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/import-layers/meta-openembedded/meta-efl/README b/import-layers/meta-openembedded/meta-efl/README
index e840076..2c10582 100644
--- a/import-layers/meta-openembedded/meta-efl/README
+++ b/import-layers/meta-openembedded/meta-efl/README
@@ -1,18 +1,18 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: morty
+branch: pyro 
 revision: HEAD
 
 URI: git://github.com/openembedded/meta-oe.git
 layers: meta-oe, meta-python
-branch: morty
+branch: pyro 
 revision: HEAD
 
-Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-efl]' in the subject'
+Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-efl][pyro]' in the subject'
 
 When sending single patches, please using something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-efl][morty][PATCH'
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-efl][pyro][PATCH'
 
-morty branch maintainer(s):
+pyro branch maintainer(s):
 Armin Kuster <akuster808@gmail.com>
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-edbus_1.7.0.bb b/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-edbus_1.7.0.bb
index 9e5ff0a..bfacf89 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-edbus_1.7.0.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-edbus_1.7.0.bb
@@ -4,3 +4,5 @@
 
 SRC_URI[md5sum] = "40b479444bb06147429a276127981890"
 SRC_URI[sha256sum] = "78e5ca334ee25185748660b4e612f984f4d3bced018f062278701429868f117b"
+
+PNBLACKLIST[python-edbus] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130600/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-efl_1.15.0.bb b/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-efl_1.15.0.bb
index 7abbc32..e9a79b2 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-efl_1.15.0.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-efl_1.15.0.bb
@@ -2,3 +2,5 @@
 
 SRC_URI[md5sum] = "f7c5d557336ea9df69bcca09c420711a"
 SRC_URI[sha256sum] = "11e607b465cb66dafe05c66e02d61e09335b370fe9fd2a74d88282b3ee597bcc"
+
+PNBLACKLIST[python-efl] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-efl_git.bb b/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-efl_git.bb
index 83a01ac..292b9eb 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-efl_git.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-devtools/python/python-efl_git.bb
@@ -7,3 +7,5 @@
 SRC_URI = "git://git.enlightenment.org/bindings/python/${BPN}.git;branch=python-efl-1.12"
 
 S = "${WORKDIR}/git"
+
+PNBLACKLIST[python-efl] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/cpu_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/cpu_svn.bb
index 14eb08f..3ffb988 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/cpu_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/cpu_svn.bb
@@ -8,3 +8,5 @@
 require e-module.inc
 
 SRC_URI += "file://configure.patch"
+
+PNBLACKLIST[cpu] ?= "Depends on blacklisted e-wm - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/diskio_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/diskio_svn.bb
index a26186e..4f778d6 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/diskio_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/diskio_svn.bb
@@ -5,6 +5,6 @@
 PV = "0.0.1+svnr${SRCPV}"
 PR = "${INC_PR}.0"
 
-PNBLACKLIST[diskio] ?= "broken: switch to https://git.enlightenment.org/enlightenment/modules/diskio.git/ and fix 0.0.1+svnr82070-r0.0/E-MODULES-EXTRA/diskio/e-module-diskio.edc:58. invalid state name: 'off'. "default" state must always be first."
+PNBLACKLIST[diskio] ?= "broken: switch to https://git.enlightenment.org/enlightenment/modules/diskio.git/ and fix 0.0.1+svnr82070-r0.0/E-MODULES-EXTRA/diskio/e-module-diskio.edc:58. invalid state name: 'off'. "default" state must always be first. - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 require e-module.inc
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-tasks_git.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-tasks_git.bb
index 6065157..7eab6d0 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-tasks_git.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-tasks_git.bb
@@ -30,3 +30,5 @@
 }
 
 FILES_${PN} += "/usr/share/e-tasks/* /usr/share/applications/* /usr/share/pixmaps/*"
+
+PNBLACKLIST[e-tasks] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm-theme-b-and-w_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm-theme-b-and-w_svn.bb
index 704e43d..9e6e9f24e 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm-theme-b-and-w_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm-theme-b-and-w_svn.bb
@@ -29,3 +29,9 @@
 }
 
 FILES_${PN} = "${datadir}/enlightenment/data/themes/"
+
+PNBLACKLIST[e-wm-theme-b-and-w] ?= "Runtime depends on blacklisted e-wm - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[e-wm-theme-b-and-w] ?= "Runtime depends on blacklisted e-wm-theme-b-and-w - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[e-wm-theme-b-and-w] ?= "Runtime depends on blacklisted e-wm-theme-b-and-w-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm-theme-illume-efenniht_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm-theme-illume-efenniht_svn.bb
index 965e4e9..5212134 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm-theme-illume-efenniht_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm-theme-illume-efenniht_svn.bb
@@ -33,3 +33,7 @@
 }
 
 FILES_${PN} = "${datadir}/enlightenment/data/themes/"
+
+PNBLACKLIST[e-wm-theme-illume-efenniht] ?= "Runtime depends on blacklisted e-wm - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[e-wm-theme-illume-efenniht] ?= "Runtime depends on blacklisted e-wm-theme-illume-efenniht - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm.inc b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm.inc
index 444ec89..a6e964b 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm.inc
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm.inc
@@ -7,12 +7,10 @@
 inherit e update-alternatives gettext pkgconfig
 S = "${WORKDIR}/${SRCNAME}"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
 PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam"
 PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
 
-
 EXTRA_OECONF = "\
     --with-edje-cc=${STAGING_BINDIR_NATIVE}/edje_cc \
     --with-eet-eet=${STAGING_BINDIR_NATIVE}/eet \
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_0.18.8.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_0.18.8.bb
index 6b4c9fc..ac18b59 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_0.18.8.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_0.18.8.bb
@@ -13,3 +13,5 @@
 
 SRC_URI[md5sum] = "79c9f524e1d0510061c62c4b038a8ece"
 SRC_URI[sha256sum] = "14c9bde4334d2f8b0776c6113d02b923ab159eea1cbf7013489e4f3bf37a51bb"
+
+PNBLACKLIST[e-wm] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_0.19.10.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_0.19.10.bb
index 86ce03d..aa6a7b8 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_0.19.10.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_0.19.10.bb
@@ -17,3 +17,5 @@
 
 SRC_URI[md5sum] = "9063617760329445ada8635270a4e627"
 SRC_URI[sha256sum] = "484d305bcf403303b18c46a3a498445b93689cd325010ae8d0601551926469d8"
+
+PNBLACKLIST[e-wm] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_git.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_git.bb
index 9eb839b..0f25fd5 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_git.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/e-wm_git.bb
@@ -12,3 +12,5 @@
 S = "${WORKDIR}/git"
 
 SRCREV = "4545d4a70031e0b2565b8d83d5f756bff1a584d0"
+
+PNBLACKLIST[e-wm] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/edje-viewer_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/edje-viewer_svn.bb
index 2b927a0..6d3efda 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/edje-viewer_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/edje-viewer_svn.bb
@@ -14,3 +14,5 @@
 S = "${WORKDIR}/${SRCNAME}"
 
 FILES_${PN} += "${datadir}"
+
+PNBLACKLIST[edje-viewer] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elbow_git.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elbow_git.bb
index 06ed2c9..d2a8539 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elbow_git.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elbow_git.bb
@@ -23,4 +23,4 @@
 
 FILES_${PN} += "${datadir}/themes"
 
-PNBLACKLIST[elbow] ?= "Depends on blacklisted webkit-efl"
+PNBLACKLIST[elbow] ?= "Depends on blacklisted webkit-efl - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elfe_git.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elfe_git.bb
index fcb97a9..e9f7f9e 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elfe_git.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elfe_git.bb
@@ -13,3 +13,5 @@
 SRCREV = "1ec0e7713c3ca901014811ff78277d9e2aaac981"
 
 DEPENDS += "elementary"
+
+PNBLACKLIST[elfe] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elmdentica_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elmdentica_svn.bb
index 56a74c5..b171217 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elmdentica_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/elmdentica_svn.bb
@@ -20,4 +20,4 @@
 
 SRC_URI += "file://configure.patch"
 
-PNBLACKLIST[elmdentica] ?= "OLD and depends on broken azy"
+PNBLACKLIST[elmdentica] ?= "OLD and depends on broken azy - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/emprint_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/emprint_svn.bb
index e4c9816..115dc7c 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/emprint_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/emprint_svn.bb
@@ -11,4 +11,4 @@
 
 FILES_${PN}-dbg += "${libdir}/${PN}/modules/.debug"
 
-PNBLACKLIST[emprint] ?= "if you want to use these modules with E18, then you need to update it to git recipe fetching newer sources from http://git.enlightenment.org/apps/emprint.git/"
+PNBLACKLIST[emprint] ?= "if you want to use these modules with E18, then you need to update it to git recipe fetching newer sources from http://git.enlightenment.org/apps/emprint.git/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/enjoy_git.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/enjoy_git.bb
index 297cbd5..716d73e 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/enjoy_git.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/enjoy_git.bb
@@ -46,3 +46,5 @@
     echo "enjoy:"
     echo "enjoy:    Use test-lms -P to see available formats that can be scanned"
 }
+
+PNBLACKLIST[enjoy] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/ephoto_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/ephoto_svn.bb
index 5cecda5..f86ffe1 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/ephoto_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/ephoto_svn.bb
@@ -17,3 +17,5 @@
 B = "${S}"
 
 SRC_URI += "file://configure.patch"
+
+PNBLACKLIST[ephoto] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exalt-client_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exalt-client_svn.bb
index afed0e8..cb78a2e 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exalt-client_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exalt-client_svn.bb
@@ -22,4 +22,5 @@
 FILES_${PN}-dev += "${libdir}/enlightenment/modules/*/*/*.la"
 FILES_${PN}-dbg += "${libdir}/enlightenment/modules/*/*/.debug"
 
-SRC_URI += "file://configure.patch"
\ No newline at end of file
+SRC_URI += "file://configure.patch"
+PNBLACKLIST[exalt-client] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exalt_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exalt_svn.bb
index 1f1c850..9e63f1b 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exalt_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exalt_svn.bb
@@ -32,3 +32,5 @@
 
 FILES_${PN} += "${datadir}/dbus-1"
 
+
+PNBLACKLIST[exalt] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exquisite-theme-illume.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exquisite-theme-illume.bb
index aad0646..c9063bc 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exquisite-theme-illume.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exquisite-theme-illume.bb
@@ -33,3 +33,9 @@
 
 CONFFILES_${PN} = "${sysconfdir}/exquisite/config-illume"
 FILES_${PN} = "${sysconfdir}/exquisite ${datadir}/exquisite/data/themes"
+
+PNBLACKLIST[exquisite-theme-illume] ?= "Depends on blacklisted edje-native - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[exquisite-theme-illume] ?= "Runtime depends on blacklisted exquisite-theme-illume - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[exquisite-theme-illume] ?= "Runtime depends on blacklisted exquisite-theme-illume-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exquisite_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exquisite_svn.bb
index 8f2d25d..826cd44 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exquisite_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/exquisite_svn.bb
@@ -39,3 +39,5 @@
 INITSCRIPT_PARAMS = "start 01 S . stop 20 0 1 6 ."
 
 FILES_${PN} += "/mnt/.splash/"
+
+PNBLACKLIST[exquisite] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130619/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/flame_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/flame_svn.bb
index 58c79a8..6583d27 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/flame_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/flame_svn.bb
@@ -13,3 +13,5 @@
 }
 
 SRC_URI += "file://configure.patch"
+
+PNBLACKLIST[flame] ?= "Depends on blacklisted e-wm - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/forecasts_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/forecasts_svn.bb
index 473bdb9..495f314 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/forecasts_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/forecasts_svn.bb
@@ -8,3 +8,5 @@
 require e-module.inc
 
 SRC_URI += "file://configure.patch"
+
+PNBLACKLIST[forecasts] ?= "Depends on blacklisted e-wm - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/news_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/news_svn.bb
index 3b652a6..4349e04 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/news_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/news_svn.bb
@@ -11,4 +11,4 @@
     sed -i -e s:\ po::g Makefile.am
 }
 
-PNBLACKLIST[news] ?= "if you want to use these modules with E18, then you need to update it to git recipe fetching newer sources from http://git.enlightenment.org/enlightenment/modules/news.git/"
+PNBLACKLIST[news] ?= "if you want to use these modules with E18, then you need to update it to git recipe fetching newer sources from http://git.enlightenment.org/enlightenment/modules/news.git/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/places_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/places_svn.bb
index 54f0e01..b184f84 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/places_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/places_svn.bb
@@ -14,3 +14,5 @@
 RRECOMMENDS_${PN} += "eject"
 
 SRC_URI += "file://configure.patch"
+
+PNBLACKLIST[places] ?= "Depends on blacklisted e-wm - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/rage_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/rage_svn.bb
index a65aa9e..0a90fe3 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/rage_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/rage_svn.bb
@@ -12,4 +12,4 @@
 SRC_URI = "${E_SVN}/trunk;module=${SRCNAME};protocol=http;scmdata=keep"
 S = "${WORKDIR}/${SRCNAME}"
 
-PNBLACKLIST[rage] ?= "if you want to use these modules with E18, then you need to update it to git recipe fetching newer sources from  http://git.enlightenment.org/apps/rage.git/"
+PNBLACKLIST[rage] ?= "if you want to use these modules with E18, then you need to update it to git recipe fetching newer sources from  http://git.enlightenment.org/apps/rage.git/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/rain_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/rain_svn.bb
index 7e85442..14aa2ed 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/rain_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/rain_svn.bb
@@ -14,3 +14,5 @@
 }
 
 SRC_URI += "file://configure.patch"
+
+PNBLACKLIST[rain] ?= "Depends on blacklisted e-wm - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/screenshot_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/screenshot_svn.bb
index 6dec194..233f777 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/screenshot_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/screenshot_svn.bb
@@ -13,4 +13,4 @@
     sed -i -e 's:AC_MSG_ERROR(emprint not found):echo foo:g' ${S}/configure.ac
 }
 
-PNBLACKLIST[screenshot] ?= "depends on blacklisted emprint"
+PNBLACKLIST[screenshot] ?= "depends on blacklisted emprint - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/terminology_0.9.1.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/terminology_0.9.1.bb
index 482bd60..77dd223 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/terminology_0.9.1.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/terminology_0.9.1.bb
@@ -6,3 +6,5 @@
 
 SRC_URI[md5sum] = "c7ce2e8ebc5f311d3d3f59ecfdf18f61"
 SRC_URI[sha256sum] = "7fb864a14202490e9181c5f254a7e772019216a3aa75c3952d0f12cd32113896"
+
+PNBLACKLIST[terminology] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/uptime_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/uptime_svn.bb
index 5c9bfa9..60d48a2 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/uptime_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/uptime_svn.bb
@@ -8,3 +8,5 @@
 require e-module.inc
 
 SRC_URI += "file://configure.patch"
+
+PNBLACKLIST[uptime] ?= "Depends on blacklisted e-wm - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/waker/0001-waker-remove-old-ecore_string_init-and-ecore_string_.patch b/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/waker/0001-waker-remove-old-ecore_string_init-and-ecore_string_.patch
deleted file mode 100644
index 2e9d104..0000000
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/e17/waker/0001-waker-remove-old-ecore_string_init-and-ecore_string_.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From b6296958d5516a735053ee4140e85e2b3a896182 Mon Sep 17 00:00:00 2001
-From: Martin Jansa <Martin.Jansa@gmail.com>
-Date: Sun, 30 Jan 2011 00:27:57 +0100
-Subject: [PATCH] waker: remove old ecore_string_init and ecore_string_shutdown
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
----
- src/bin/waker_main.c |    2 --
- src/bin/waker_tool.c |    2 --
- 2 files changed, 0 insertions(+), 4 deletions(-)
-
-diff --git a/src/bin/waker_main.c b/src/bin/waker_main.c
-index b229cf0..dd54b31 100644
---- a/src/bin/waker_main.c
-+++ b/src/bin/waker_main.c
-@@ -568,7 +568,6 @@ main(int argc, char **argv)
-    E_DBus_Connection *c;
-    
-    ecore_init();
--   ecore_string_init();
-    ecore_app_args_set(argc, (const char **)argv);
-    e_dbus_init();
-    
-@@ -586,7 +585,6 @@ main(int argc, char **argv)
-     
-    e_dbus_connection_close(c);
-    e_dbus_shutdown();
--   ecore_string_shutdown();
-    ecore_shutdown();
-    
-    return 0;
-diff --git a/src/bin/waker_tool.c b/src/bin/waker_tool.c
-index 3344fd2..52515c9 100644
---- a/src/bin/waker_tool.c
-+++ b/src/bin/waker_tool.c
-@@ -93,7 +93,6 @@ main(int argc, char **argv)
-      }
-    
-    ecore_init();
--   ecore_string_init();
-    ecore_app_args_set(argc, (const char **)argv);
-    e_dbus_init();
-    
-@@ -301,7 +300,6 @@ main(int argc, char **argv)
-    
-    e_dbus_connection_close(c);
-    e_dbus_shutdown();
--   ecore_string_shutdown();
-    ecore_shutdown();
-    
-    return 0;
--- 
-1.7.4.rc3
-
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/azy_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/azy_svn.bb
index dec2475..d3bc200 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/azy_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/azy_svn.bb
@@ -34,4 +34,4 @@
 # sysroots/qemuarm/usr/include/c++/5.2.0/bits/basic_string.h:4780:5: error: reference to 'basic_string' is ambiguous
 #     basic_string<_CharT, _Traits, _Alloc>
 #     ^
-PNBLACKLIST[azy] ?= "OLD and doesn't build with gcc-5"
+PNBLACKLIST[azy] ?= "OLD and doesn't build with gcc-5 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/edbus_1.7.9.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/edbus_1.7.9.bb
index 64e77e6..a8033ac 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/edbus_1.7.9.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/edbus_1.7.9.bb
@@ -6,3 +6,11 @@
 
 SRC_URI[md5sum] = "8f72da14e5664aad8c45eeeca0e3ff5f"
 SRC_URI[sha256sum] = "c328c4cf1424629cb67c83689ccc1f95967abcb4c03dffd437e93b799ff151c1"
+
+PNBLACKLIST[edbus] ?= "Depends on blacklisted ecore - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[edbus] ?= "Depends on blacklisted eina - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[edbus] ?= "Runtime depends on blacklisted edbus - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[edbus] ?= "Runtime depends on blacklisted edbus-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/edje-fpu.inc b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/edje-fpu.inc
index 3f2aacf..32a6daf 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/edje-fpu.inc
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/edje-fpu.inc
@@ -1,6 +1,6 @@
 
 def get_edje_fpu_setting(bb, d):
-    if d.getVar('TARGET_FPU', 1) in [ 'soft' ]:
+    if d.getVar('TARGET_FPU') in [ 'soft' ]:
         return "--enable-fixed-point"
     return ""
 
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/efl.inc b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/efl.inc
index 5436b40..4cd21bf 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/efl.inc
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/efl.inc
@@ -51,7 +51,7 @@
     --disable-image-loader-dds \
 "
 
-PACKAGECONFIG ?= "egl opengl-es gstreamer1 pulseaudio luajit ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
+PACKAGECONFIG ?= "egl opengl-es gstreamer1 pulseaudio luajit ${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)}"
 PACKAGECONFIG_class-native = "luajit"
 
 PACKAGECONFIG[wayland] = "--enable-wayland --enable-wayland-ivi-shell,--disable-wayland --disable-wayland-ivi-shell,wayland"
@@ -285,3 +285,6 @@
     ${datadir}/eo/gdb \
     ${bindir}/eldbus-codegen \
 "
+
+PNBLACKLIST[efl] ?= "Depends on broken efl-native - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+PNBLACKLIST[efl-native] ?= "Broken: fails to build with http://errors.yoctoproject.org/Errors/Details/138240/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/efl/0002-evas_3d-Add-Eet.h-includes.patch b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/efl/0002-evas_3d-Add-Eet.h-includes.patch
deleted file mode 100644
index aa7fd4b..0000000
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/efl/0002-evas_3d-Add-Eet.h-includes.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From b3cbe31c38a088af7b0dade82545475fc9b72492 Mon Sep 17 00:00:00 2001
-From: Martin Jansa <Martin.Jansa@gmail.com>
-Date: Tue, 2 Dec 2014 12:21:10 +0100
-Subject: [PATCH 2/3] evas_3d: Add Eet.h includes
-
-* with some very restrictive options like we use in efl-native, the build is complaining
-  about missing symbols from Eet.h, add include where needed
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
----
- src/lib/evas/canvas/evas_3d_eet.c                        | 1 +
- src/modules/evas/model_loaders/eet/evas_model_load_eet.c | 1 +
- src/modules/evas/model_savers/eet/evas_model_save_eet.c  | 1 +
- 3 files changed, 3 insertions(+)
-
-diff --git a/src/lib/evas/canvas/evas_3d_eet.c b/src/lib/evas/canvas/evas_3d_eet.c
-index 1515f5a..a438217 100644
---- a/src/lib/evas/canvas/evas_3d_eet.c
-+++ b/src/lib/evas/canvas/evas_3d_eet.c
-@@ -1,3 +1,4 @@
-+#include <Eet.h>
- #include <stdio.h>
- #include "evas_common_private.h"
- #include "evas_private.h"
-diff --git a/src/modules/evas/model_loaders/eet/evas_model_load_eet.c b/src/modules/evas/model_loaders/eet/evas_model_load_eet.c
-index 815b9f1..bff2cea 100644
---- a/src/modules/evas/model_loaders/eet/evas_model_load_eet.c
-+++ b/src/modules/evas/model_loaders/eet/evas_model_load_eet.c
-@@ -3,6 +3,7 @@
- #endif
- 
- #include <Eo.h>
-+#include <Eet.h>
- #include <stdio.h>
- #include "evas_common_private.h"
- #include "evas_private.h"
-diff --git a/src/modules/evas/model_savers/eet/evas_model_save_eet.c b/src/modules/evas/model_savers/eet/evas_model_save_eet.c
-index e445dca..2e1cf4e 100644
---- a/src/modules/evas/model_savers/eet/evas_model_save_eet.c
-+++ b/src/modules/evas/model_savers/eet/evas_model_save_eet.c
-@@ -2,6 +2,7 @@
-    #include "config.h"
- #endif
- 
-+#include <Eet.h>
- #include <stdio.h>
- #include "evas_common_private.h"
- #include "evas_private.h"
--- 
-2.3.0
-
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/elementary-theme-efenniht_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/elementary-theme-efenniht_svn.bb
index 494e743..783d123 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/elementary-theme-efenniht_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/elementary-theme-efenniht_svn.bb
@@ -36,3 +36,9 @@
 }
 
 FILES_${PN} = "${datadir}/elementary/themes/"
+
+PNBLACKLIST[elementary-theme-efenniht] ?= "Depends on blacklisted edje-native - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[elementary-theme-efenniht] ?= "Runtime depends on blacklisted elementary-theme-efenniht - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[elementary-theme-efenniht] ?= "Runtime depends on blacklisted elementary-theme-efenniht-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/elementary_1.15.1.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/elementary_1.15.1.bb
index f53eb44..40dd8ad 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/elementary_1.15.1.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/elementary_1.15.1.bb
@@ -14,3 +14,5 @@
 # autotools-brokensep - configure updates Elementary.h correctly in ${B}, but then build is using Elementary.h from ${S}
 # which includes #define ELM_EMAP (instead of #undef ELM_EMAP) and building fails
 B = "${S}"
+
+PNBLACKLIST[elementary] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130584/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/emotion-generic-players_1.15.0.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/emotion-generic-players_1.15.0.bb
index 1a184bd..ffdd269 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/emotion-generic-players_1.15.0.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/emotion-generic-players_1.15.0.bb
@@ -6,3 +6,9 @@
 
 SRC_URI[md5sum] = "68627c1aabf5b7fe084299adcc0b73c1"
 SRC_URI[sha256sum] = "10bad633480a691585b0ba470c573b14da0a010008d9d59d0792cea8c621d423"
+
+PNBLACKLIST[emotion-generic-players] ?= "Depends on blacklisted emotion - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[emotion-generic-players] ?= "Runtime depends on blacklisted emotion-generic-players - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[emotion-generic-players] ?= "Runtime depends on blacklisted emotion-generic-players-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/engrave_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/engrave_svn.bb
index f34be98..f950938 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/engrave_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/engrave_svn.bb
@@ -12,4 +12,4 @@
 
 # engrave.l:5:35: fatal error: libengrave_la-engrave.h: No such file or directory
 # http://errors.yoctoproject.org/Errors/Details/56597/
-PNBLACKLIST[engrave] ?= "BROKEN: fails to build with latest oe-core"
+PNBLACKLIST[engrave] ?= "BROKEN: fails to build with latest oe-core - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/entrance_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/entrance_svn.bb
index 2888dc8..b1e580d 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/entrance_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/entrance_svn.bb
@@ -11,7 +11,7 @@
 "
 S = "${WORKDIR}/${SRCNAME}"
 
-PNBLACKLIST[entrance] ?= "broken: switch to https://git.enlightenment.org/misc/entrance.git and fix 0.0.4+svnr82070-r7/entrance/data/themes/old/default.edc:678. invalid state name: 'defaault'. "default" state must always be first."
+PNBLACKLIST[entrance] ?= "broken: switch to https://git.enlightenment.org/misc/entrance.git and fix 0.0.4+svnr82070-r7/entrance/data/themes/old/default.edc:678. invalid state name: 'defaault'. "default" state must always be first. - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[consolekit] = "--enable-consolekit,--disable-consolekit,consolekit"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/epdf_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/epdf_svn.bb
index e32a5fd..d664bad 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/epdf_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/epdf_svn.bb
@@ -25,3 +25,11 @@
 
 # Some upgrade path tweaking, as in evas
 AUTO_LIBNAME_PKGS = ""
+
+PNBLACKLIST[epdf] ?= "Depends on blacklisted ecore - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[epdf] ?= "Depends on blacklisted evas - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[epdf] ?= "Runtime depends on blacklisted epdf-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[epdf] ?= "Runtime depends on blacklisted epdf - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/evas-generic-loaders_1.15.0.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/evas-generic-loaders_1.15.0.bb
index 911ce8c..ecdbcee 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/evas-generic-loaders_1.15.0.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/evas-generic-loaders_1.15.0.bb
@@ -6,3 +6,9 @@
 
 SRC_URI[md5sum] = "3ca8443b8cbf177845595c5e02fbc49c"
 SRC_URI[sha256sum] = "caa22c9ba1ae9629c16a3fe809ea927f60b8f0d80cdb7f145159b997b9ae2bcd"
+
+PNBLACKLIST[evas-generic-loaders] ?= "Depends on blacklisted eina - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[evas-generic-loaders] ?= "Runtime depends on blacklisted evas-generic-loaders - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[evas-generic-loaders] ?= "Runtime depends on blacklisted evas-generic-loaders-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/expedite_1.7.9.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/expedite_1.7.9.bb
index cee2d60..832cd00 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/expedite_1.7.9.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/expedite_1.7.9.bb
@@ -6,3 +6,23 @@
 
 SRC_URI[md5sum] = "954fe8e40fec6a561190ff0fb75b6bdd"
 SRC_URI[sha256sum] = "a05be096c911e0d66d4bdc497ebb935a04ad23696de9084aed9959b5172a593e"
+
+PNBLACKLIST[expedite] ?= "Depends on blacklisted eet - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Depends on blacklisted evas - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted evas-loader-png - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted expedite - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted expedite-themes - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted evas-engine-gl-x11 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted evas-engine-software-generic - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted expedite-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted evas-engine-software-x11 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted evas-engine-fb - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/expedite_git.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/expedite_git.bb
index 5b44cf0..65c2d4a 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/expedite_git.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/expedite_git.bb
@@ -9,3 +9,23 @@
     git://git.enlightenment.org/tools/${BPN}.git \
 "
 S = "${WORKDIR}/${SRCNAME}"
+
+PNBLACKLIST[expedite] ?= "Depends on blacklisted eet - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Depends on blacklisted evas - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted evas-loader-png - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted expedite - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted evas-engine-software-generic - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted evas-engine-fb - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted evas-engine-software-x11 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted evas-engine-gl-x11 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted expedite-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[expedite] ?= "Runtime depends on blacklisted expedite-themes - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/libeflvala_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/libeflvala_svn.bb
index 4922b1b..eaf4893 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/libeflvala_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/libeflvala_svn.bb
@@ -19,3 +19,5 @@
 
 PACKAGES =+ "${PN}-examples"
 FILES_${PN}-examples = "${datadir}/libeflvala ${bindir}/*"
+
+PNBLACKLIST[libeflvala] ?= "Depends on blacklisted elementary - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/libeweather_svn.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/libeweather_svn.bb
index eff8586..53988b0 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/libeweather_svn.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/efl/libeweather_svn.bb
@@ -44,3 +44,5 @@
     ${PN}-themes \
     ${PN}-plugins \
 "
+
+PNBLACKLIST[libeweather] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130649/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-efl-sdk.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-efl-sdk.bb
index 5ead412..ee4e2c4 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-efl-sdk.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-efl-sdk.bb
@@ -15,3 +15,5 @@
     packagegroup-core-sdk \
     ${SDK-EFL} \
     ${SDK-EXTRAS}"
+
+PNBLACKLIST[packagegroup-efl-sdk] ?= "Runtime depends on blacklisted elementary-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-efl-standalone-sdk-target.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-efl-standalone-sdk-target.bb
index 6a3f33d..2d9dde6 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-efl-standalone-sdk-target.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-efl-standalone-sdk-target.bb
@@ -15,3 +15,5 @@
     packagegroup-core-standalone-sdk-target \
     ${SDK-EFL} \
     ${SDK-EXTRAS}"
+
+PNBLACKLIST[packagegroup-efl-standalone-sdk-target] ?= "Runtime depends on blacklisted elementary-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-x11-illume.bb b/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-x11-illume.bb
index 9997828..95ebcab 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-x11-illume.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/packagegroups/packagegroup-x11-illume.bb
@@ -22,3 +22,9 @@
     e-wm \
     ${ECONFIG} \
 "
+
+PNBLACKLIST[packagegroup-x11-illume] ?= "Runtime depends on blacklisted e-wm - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[packagegroup-x11-illume] ?= "Runtime depends on blacklisted e-wm-config-mobile - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[packagegroup-x11-illume] ?= "Runtime depends on blacklisted e-wm-theme-default - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-efl/webkit/webkit-efl.inc b/import-layers/meta-openembedded/meta-efl/recipes-efl/webkit/webkit-efl.inc
index c6ef976..f49f2ee 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-efl/webkit/webkit-efl.inc
+++ b/import-layers/meta-openembedded/meta-efl/recipes-efl/webkit/webkit-efl.inc
@@ -66,4 +66,4 @@
 FILES_${PN}-inspector += "${datadir}/ewebkit2-1/inspector"
 
 # http://errors.yoctoproject.org/Errors/Details/40659/
-PNBLACKLIST[webkit-efl] ?= "Old and unmaintaned fork with many security issues"
+PNBLACKLIST[webkit-efl] ?= "Old and unmaintaned fork with many security issues - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-multimedia/lightmediascanner/files/0001-Define-comparison_fn_t-for-non-glibc-systems.patch b/import-layers/meta-openembedded/meta-efl/recipes-multimedia/lightmediascanner/files/0001-Define-comparison_fn_t-for-non-glibc-systems.patch
new file mode 100644
index 0000000..15d4b3f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-efl/recipes-multimedia/lightmediascanner/files/0001-Define-comparison_fn_t-for-non-glibc-systems.patch
@@ -0,0 +1,33 @@
+From 5bc5b8c5dad3edec6736fd7e7ce61250c4ce3725 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 12 Jul 2017 17:13:19 -0700
+Subject: [PATCH] Define comparison_fn_t for non-glibc systems
+
+lightmediascanner.c:324:12: error: 'comparison_fn_t' undeclared (first use in this function)
+           (comparison_fn_t)_plugin_sort);
+            ^~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/lib/lightmediascanner.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/lib/lightmediascanner.c b/src/lib/lightmediascanner.c
+index 344b247..b866883 100644
+--- a/src/lib/lightmediascanner.c
++++ b/src/lib/lightmediascanner.c
+@@ -37,6 +37,11 @@
+ #define DEFAULT_SLAVE_TIMEOUT 1000
+ #define DEFAULT_COMMIT_INTERVAL 100
+ 
++#if !defined(__GLIBC__)
++typedef int (*__compar_fn_t) (const void*, const void*);
++typedef __compar_fn_t comparison_fn_t;
++#endif
++
+ #ifdef HAVE_MAGIC_H
+ static magic_t _magic_handle;
+ 
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-multimedia/lightmediascanner/lightmediascanner_0.5.1.bb b/import-layers/meta-openembedded/meta-efl/recipes-multimedia/lightmediascanner/lightmediascanner_0.5.1.bb
index 9870fac..f215876 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-multimedia/lightmediascanner/lightmediascanner_0.5.1.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-multimedia/lightmediascanner/lightmediascanner_0.5.1.bb
@@ -12,6 +12,7 @@
 SRCREV = "adfddb3486276a5ed2f5008c9e43a811e1271cc9"
 SRC_URI = "git://github.com/profusion/lightmediascanner.git \
            file://id3-plugin-support-out-of-tree-build.patch \
+           file://0001-Define-comparison_fn_t-for-non-glibc-systems.patch \
           "
 
 S = "${WORKDIR}/git"
@@ -57,6 +58,6 @@
     pkgs = []
 
     pkgs += do_split_packages(d, oe.path.join(lms_libdir, "plugins"), '^(.*)\.so$', d.expand('${PN}-plugin-%s'), 'LightMediaScanner plugin for %s', prepend=True, extra_depends=d.expand('${PN}'))
-    metapkg = d.getVar('PN', True) + '-meta'
+    metapkg = d.getVar('PN') + '-meta'
     d.setVar('RDEPENDS_' + metapkg, ' '.join(pkgs))
 }
diff --git a/import-layers/meta-openembedded/meta-efl/recipes-navigation/mcnavi/mcnavi_0.3.4.bb b/import-layers/meta-openembedded/meta-efl/recipes-navigation/mcnavi/mcnavi_0.3.4.bb
index 2b5722b..040e006 100644
--- a/import-layers/meta-openembedded/meta-efl/recipes-navigation/mcnavi/mcnavi_0.3.4.bb
+++ b/import-layers/meta-openembedded/meta-efl/recipes-navigation/mcnavi/mcnavi_0.3.4.bb
@@ -12,7 +12,7 @@
 
 inherit autotools
 
-PNBLACKLIST[mcnavi] ?= "BROKEN: latest version 0.3.4 is 3 years old and now broken with more strict ejde_cc from efl-1.13"
+PNBLACKLIST[mcnavi] ?= "BROKEN: latest version 0.3.4 is 3 years old and now broken with more strict ejde_cc from efl-1.13 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 # | edje_cc: Error. parse error 0.3.4-r0/mcnavi/data/themes/Default/main.edc:126. invalid state name: 'none'. "default" state must always be first.
 # | edje_cc: Error. parse error 0.3.4-r0/mcnavi/data/themes/Default/itinerary.edc:84. invalid state name: 'none'. "default" state must always be first.
 # | edje_cc: Error. parse error 0.3.4-r0/mcnavi/data/themes/Default/text.edc:1129. invalid state name: 'none'. "default" state must always be first.
diff --git a/import-layers/meta-openembedded/meta-filesystems/README b/import-layers/meta-openembedded/meta-filesystems/README
index 0a8f6cf..48fe15f 100644
--- a/import-layers/meta-openembedded/meta-filesystems/README
+++ b/import-layers/meta-openembedded/meta-filesystems/README
@@ -10,22 +10,22 @@
 This layer depends on:
 
   URI: git://git.openembedded.org/bitbake
-  branch: morty
+  branch: 1.28
 
   URI: git://git.openembedded.org/openembedded-core
   layers: meta
-  branch: morty
+  branch: pyro
 
   URI: git://git.openembedded.org/meta-openembedded
   layers: meta-oe
-  branch: morty
+  branch: pyro
 
 Patches
 =======
 
 Please submit any patches against the filesystems layer to the
 OpenEmbedded development mailing list (openembedded-devel@lists.openembedded.org)
-with '[meta-filesystems]' in the subject.
+with '[meta-filesystems][pyro]' in the subject.
 
 Maintainers List:
   physfs      Andreas Müller <schnitzeltony@googlemail.com>
@@ -66,9 +66,9 @@
 
    git send-email -1 -M \
         --to openembedded-devel@lists.openembedded.org \
-        --subject-prefix=meta-filesystems][morty][PATCH
+        --subject-prefix=meta-filesystems][pyro][PATCH
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
 
 Table of Contents
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/fuse-exfat/fuse-exfat_1.2.3.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/fuse-exfat/fuse-exfat_1.2.3.bb
index 639e33c..99bf2be 100644
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/fuse-exfat/fuse-exfat_1.2.3.bb
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/fuse-exfat/fuse-exfat_1.2.3.bb
@@ -18,3 +18,4 @@
 SRC_URI[sha256sum] = "f2e06eba5a21c621aac1d6da21b12a5a324fdd1e20f9c8acd357dd463c2355d9"
 
 S = "${WORKDIR}/${PN}-${PV}"
+EXTRA_OECONF += "sbindir=${base_sbindir}"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/logfsprogs/logfsprogs/0001-btree-Avoid-conflicts-with-libc-namespace-about-setk.patch b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/logfsprogs/logfsprogs/0001-btree-Avoid-conflicts-with-libc-namespace-about-setk.patch
new file mode 100644
index 0000000..dbf7ae0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/logfsprogs/logfsprogs/0001-btree-Avoid-conflicts-with-libc-namespace-about-setk.patch
@@ -0,0 +1,135 @@
+From 5a8e26157d9642f022587cc1ca7525213c7a5379 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Jul 2017 18:41:53 -0700
+Subject: [PATCH] btree: Avoid conflicts with libc namespace about setkey()
+
+This issue is highlighted with musl mainly because the
+function signature from stdlib.h does not match the local
+static function
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ btree.c | 32 ++++++++++++++++----------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/btree.c b/btree.c
+index eddc33b..dd3fef9 100644
+--- a/btree.c
++++ b/btree.c
+@@ -123,7 +123,7 @@ static unsigned long bval(struct btree_geo *geo, unsigned long *node, int n)
+ 	return node[geo->no_pairs * geo->keylen + n];
+ }
+ 
+-static void setkey(struct btree_geo *geo, unsigned long *node,
++static void _setkey(struct btree_geo *geo, unsigned long *node,
+ 		unsigned long *key, int n)
+ {
+ 	longcpy(bkey(geo, node, n), key, geo->keylen);
+@@ -292,7 +292,7 @@ static unsigned long *find_level(struct btree_head *head, struct btree_geo *geo,
+ 			/* FIXME: If the right-most key on higher levels is
+ 			 * always zero, this wouldn't be necessary. */
+ 			i--;
+-			setkey(geo, node, key, i);
++			_setkey(geo, node, key, i);
+ 		}
+ 		BUG_ON(i < 0);
+ 		node = (unsigned long *)bval(geo, node, i);
+@@ -311,7 +311,7 @@ static int btree_grow(struct btree_head *head, struct btree_geo *geo)
+ 		return -ENOMEM;
+ 	if (head->node) {
+ 		fill = getfill(geo, head->node, 0);
+-		setkey(geo, node, bkey(geo, head->node, fill - 1), 0);
++		_setkey(geo, node, bkey(geo, head->node, fill - 1), 0);
+ 		setval(geo, node, (unsigned long)head->node, 0);
+ 	}
+ 	head->node = node;
+@@ -342,16 +342,16 @@ static void steal_l(struct btree_head *head, struct btree_geo *geo, int level,
+ 
+ 	for (i = rfill - 1; i >= 0; i--) {
+ 		/* Shift entries on the right */
+-		setkey(geo, right, bkey(geo, right, i), i + no_entries);
++		_setkey(geo, right, bkey(geo, right, i), i + no_entries);
+ 		setval(geo, right, bval(geo, right, i), i + no_entries);
+ 	}
+ 	for (i = 0; i < no_entries; i++) {
+ 		/* Move some entries to the right */
+-		setkey(geo, right, bkey(geo, left, lfill - no_entries + i), i);
++		_setkey(geo, right, bkey(geo, left, lfill - no_entries + i), i);
+ 		setval(geo, right, bval(geo, left, lfill - no_entries + i), i);
+ 	}
+ 	/* Set parent key */
+-	setkey(geo, parent, bkey(geo, left, lfill - no_entries - 1), lpos);
++	_setkey(geo, parent, bkey(geo, left, lfill - no_entries - 1), lpos);
+ 	for (i = lfill - no_entries; i < lfill; i++)
+ 		clearpair(geo, left, i);
+ }
+@@ -366,14 +366,14 @@ static void steal_r(struct btree_head *head, struct btree_geo *geo, int level,
+ 
+ 	for (i = 0; i < no_entries; i++) {
+ 		/* Move some entries to the left */
+-		setkey(geo, left, bkey(geo, right, i), lfill + i);
++		_setkey(geo, left, bkey(geo, right, i), lfill + i);
+ 		setval(geo, left, bval(geo, right, i), lfill + i);
+ 	}
+ 	/* Set parent key */
+-	setkey(geo, parent, bkey(geo, right, no_entries - 1), lpos);
++	_setkey(geo, parent, bkey(geo, right, no_entries - 1), lpos);
+ 	/* Shift entries on the right */
+ 	for ( ; i < rfill; i++) {
+-		setkey(geo, right, bkey(geo, right, i), i - no_entries);
++		_setkey(geo, right, bkey(geo, right, i), i - no_entries);
+ 		setval(geo, right, bval(geo, right, i), i - no_entries);
+ 	}
+ 	for (i = rfill - no_entries; i < rfill; i++)
+@@ -399,14 +399,14 @@ static int split(struct btree_head *head, struct btree_geo *geo,
+ 		return err;
+ 	}
+ 	for (i = 0; i < fill / 2; i++) {
+-		setkey(geo, new, bkey(geo, node, i), i);
++		_setkey(geo, new, bkey(geo, node, i), i);
+ 		setval(geo, new, bval(geo, node, i), i);
+-		setkey(geo, node, bkey(geo, node, i + fill / 2), i);
++		_setkey(geo, node, bkey(geo, node, i + fill / 2), i);
+ 		setval(geo, node, bval(geo, node, i + fill / 2), i);
+ 		clearpair(geo, node, i + fill / 2);
+ 	}
+ 	if (fill & 1) {
+-		setkey(geo, node, bkey(geo, node, fill - 1), i);
++		_setkey(geo, node, bkey(geo, node, fill - 1), i);
+ 		setval(geo, node, bval(geo, node, fill - 1), i);
+ 		clearpair(geo, node, fill - 1);
+ 	}
+@@ -487,10 +487,10 @@ retry:
+ 
+ 	/* shift and insert */
+ 	for (i = fill; i > pos; i--) {
+-		setkey(geo, node, bkey(geo, node, i - 1), i);
++		_setkey(geo, node, bkey(geo, node, i - 1), i);
+ 		setval(geo, node, bval(geo, node, i - 1), i);
+ 	}
+-	setkey(geo, node, key, pos);
++	_setkey(geo, node, key, pos);
+ 	setval(geo, node, val, pos);
+ 
+ 	return 0;
+@@ -513,7 +513,7 @@ static void merge(struct btree_head *head, struct btree_geo *geo, int level,
+ 
+ 	for (i = 0; i < rfill; i++) {
+ 		/* Move all entries to the left */
+-		setkey(geo, left, bkey(geo, right, i), lfill + i);
++		_setkey(geo, left, bkey(geo, right, i), lfill + i);
+ 		setval(geo, left, bval(geo, right, i), lfill + i);
+ 	}
+ 	/* Exchange left and right child in parent */
+@@ -615,7 +615,7 @@ static void *btree_remove_level(struct btree_head *head, struct btree_geo *geo,
+ 
+ 	/* remove and shift */
+ 	for (i = pos; i < fill - 1; i++) {
+-		setkey(geo, node, bkey(geo, node, i + 1), i);
++		_setkey(geo, node, bkey(geo, node, i + 1), i);
+ 		setval(geo, node, bval(geo, node, i + 1), i);
+ 	}
+ 	clearpair(geo, node, fill - 1);
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/logfsprogs/logfsprogs_git.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/logfsprogs/logfsprogs_git.bb
index c41f0ea..1b4d97d 100644
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/logfsprogs/logfsprogs_git.bb
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/logfsprogs/logfsprogs_git.bb
@@ -13,7 +13,8 @@
 
 SRC_URI = "git://github.com/prasad-joshi/logfsprogs.git \
            file://0001-Add-LDFLAGS-to-linker-cmdline.patch \
-"
+           file://0001-btree-Avoid-conflicts-with-libc-namespace-about-setk.patch \
+           "
 SRCREV = "45b72c81ce3c6fa17ca19bafc207ea93e76312f4"
 
 S = "${WORKDIR}/git"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/0001-libntfs-3g-Makefile.am-fix-install-failed-while-host.patch b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/0001-libntfs-3g-Makefile.am-fix-install-failed-while-host.patch
new file mode 100644
index 0000000..7b8eec7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/0001-libntfs-3g-Makefile.am-fix-install-failed-while-host.patch
@@ -0,0 +1,52 @@
+From 575591caf1e8972f765885679b76787ef92de77b Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 24 Apr 2017 04:24:10 -0400
+Subject: [PATCH] libntfs-3g/Makefile.am: fix install failed while host dir not exist
+
+While cross compiling, if the dir of "$(rootlibdir)" and "$(libdir)"
+(such as "/usr/lib64") do not exist on host system, the do_instal failed.
+-----------------------
+make[3]: Entering directory `tmp/work/core2-64-wrs-linux/ntfs-3g-ntfsprogs/2017.3.23-r0/build/libntfs-3g'
+if [ ! "/usr/lib64" -ef "/usr/lib64" ]; then \
+    mv -f "tmp/work/core2-64-wrs-linux/ntfs-3g-ntfsprogs/2017.3.23-r0/image//usr/lib64"/libntfs-3g.so* \
+        "tmp/work/core2-64-wrs-linux/ntfs-3g-ntfsprogs/2017.3.23-r0/image//usr/lib64";  \
+fi
+mv:...are the same file
+-----------------------
+
+Use `=' rather than `-ef' to compare them, the cross compile does not
+care about host dir.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libntfs-3g/Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libntfs-3g/Makefile.am b/libntfs-3g/Makefile.am
+index d6b150e..806109d 100644
+--- a/libntfs-3g/Makefile.am
++++ b/libntfs-3g/Makefile.am
+@@ -59,15 +59,15 @@ endif
+ # And create ldscript or symbolic link from /usr
+ install-exec-hook: install-rootlibLTLIBRARIES
+ if INSTALL_LIBRARY
+-	if [ ! "$(rootlibdir)" -ef "$(libdir)" ]; then \
++	if [ "$(rootlibdir)" != "$(libdir)" ]; then \
+ 		$(MV) -f "$(DESTDIR)/$(libdir)"/libntfs-3g.so* "$(DESTDIR)/$(rootlibdir)";  \
+ 	fi
+ if GENERATE_LDSCRIPT
+-	if [ ! "$(rootlibdir)" -ef "$(libdir)" ]; then \
++	if [ "$(rootlibdir)" != "$(libdir)" ]; then \
+ 		$(install_sh_PROGRAM) "libntfs-3g.script.so" "$(DESTDIR)/$(libdir)/libntfs-3g.so"; \
+ 	fi
+ else
+-	if [ ! "$(rootlibdir)" -ef "$(libdir)" ]; then \
++	if [ "$(rootlibdir)" != "$(libdir)" ]; then \
+ 		$(LN_S) "$(rootlibdir)/libntfs-3g.so" "$(DESTDIR)/$(libdir)/libntfs-3g.so"; \
+ 	fi
+ endif
+-- 
+2.8.1
+
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2013.1.13.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2013.1.13.bb
deleted file mode 100644
index 6957ea9..0000000
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2013.1.13.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-DESCRIPTION = "The NTFS-3G driver is an open source, freely available NTFS driver for Linux with read and write support."
-HOMEPAGE = "http://www.ntfs-3g.org/"
-DEPENDS = "fuse libgcrypt"
-PROVIDES = "ntfsprogs ntfs-3g"
-LICENSE = "GPLv2 & LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
-                    file://COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a"
-
-SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz"
-S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"
-
-SRC_URI[md5sum] = "2d6fb47ddf62b51733227126fe9227fe"
-SRC_URI[sha256sum] = "4b383f0074a3ab7683339d1f18222b107aaeb4983db119292c43c2b275cefb27"
-
-inherit autotools pkgconfig
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[uuid] = "--with-uuid,--without-uuid,util-linux"
-
-# required or it calls ldconfig at install step
-EXTRA_OEMAKE = "LDCONFIG=echo"
-
-PACKAGES =+ "ntfs-3g ntfsprogs libntfs-3g"
-
-FILES_ntfs-3g = "${base_sbindir}/*.ntfs-3g ${bindir}/ntfs-3g* ${base_sbindir}/mount.ntfs"
-RDEPENDS_ntfs-3g += "fuse"
-RRECOMMENDS_ntfs-3g = "util-linux-mount"
-
-FILES_ntfsprogs = "${base_sbindir}/* ${bindir}/* ${sbindir}/*"
-FILES_libntfs-3g = "${libdir}/*${SOLIBS}"
-
-do_install_append() {
-    # Standard mount will execute the program /sbin/mount.TYPE
-    # when called. Add the symbolic to let mount could find ntfs.
-    ln -sf mount.ntfs-3g ${D}/${base_sbindir}/mount.ntfs
-}
-
-# Satisfy the -dev runtime dependency
-ALLOW_EMPTY_${PN} = "1"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2017.3.23.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2017.3.23.bb
new file mode 100644
index 0000000..9e77766
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2017.3.23.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "The NTFS-3G driver is an open source, freely available NTFS driver for Linux with read and write support."
+HOMEPAGE = "http://www.ntfs-3g.org/"
+DEPENDS = "fuse libgcrypt"
+PROVIDES = "ntfsprogs ntfs-3g"
+LICENSE = "GPLv2 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a"
+
+SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz \
+           file://0001-libntfs-3g-Makefile.am-fix-install-failed-while-host.patch \
+"
+S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"
+SRC_URI[md5sum] = "d97474ae1954f772c6d2fa386a6f462c"
+SRC_URI[sha256sum] = "3e5a021d7b761261836dcb305370af299793eedbded731df3d6943802e1262d5"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[uuid] = "--with-uuid,--without-uuid,util-linux"
+
+# required or it calls ldconfig at install step
+EXTRA_OEMAKE = "LDCONFIG=echo"
+
+PACKAGES =+ "ntfs-3g ntfsprogs libntfs-3g"
+
+FILES_ntfs-3g = "${base_sbindir}/*.ntfs-3g ${bindir}/ntfs-3g* ${base_sbindir}/mount.ntfs"
+RDEPENDS_ntfs-3g += "fuse"
+RRECOMMENDS_ntfs-3g = "util-linux-mount"
+
+FILES_ntfsprogs = "${base_sbindir}/* ${bindir}/* ${sbindir}/*"
+FILES_libntfs-3g = "${libdir}/*${SOLIBS}"
+
+do_install_append() {
+    # Standard mount will execute the program /sbin/mount.TYPE
+    # when called. Add the symbolic to let mount could find ntfs.
+    ln -sf mount.ntfs-3g ${D}/${base_sbindir}/mount.ntfs
+    rmdir ${D}${libdir}/ntfs-3g
+}
+
+# Satisfy the -dev runtime dependency
+ALLOW_EMPTY_${PN} = "1"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/smbnetfs/smbnetfs_git.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/smbnetfs/smbnetfs_git.bb
index f1420fb..6995ad3 100644
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/smbnetfs/smbnetfs_git.bb
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/smbnetfs/smbnetfs_git.bb
@@ -24,3 +24,5 @@
 PACKAGECONFIG[gnome-keyring] = "--with-gnome-keyring=yes,--with-gnome-keyring=no,libgnome-keyring"
 
 S = "${WORKDIR}/git"
+
+PNBLACKLIST[smbnetfs] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/132827/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/unionfs-fuse/unionfs-fuse_0.26.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/unionfs-fuse/unionfs-fuse_0.26.bb
index d98d35a..2520429 100644
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/unionfs-fuse/unionfs-fuse_0.26.bb
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/unionfs-fuse/unionfs-fuse_0.26.bb
@@ -15,3 +15,5 @@
 }
 
 RDEPENDS_${PN} += "bash"
+
+PNBLACKLIST[unionfs-fuse] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130648/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils/0001-define-loff_t-if-not-already-defined.patch b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils/0001-define-loff_t-if-not-already-defined.patch
new file mode 100644
index 0000000..df202c8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils/0001-define-loff_t-if-not-already-defined.patch
@@ -0,0 +1,30 @@
+From 848717da4a28d33f8aa8f889377e61e6b1b8ae67 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Jul 2017 18:29:52 -0700
+Subject: [PATCH] define loff_t if not already defined
+
+Helps to build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ yaffs_guts.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/yaffs_guts.h b/yaffs_guts.h
+index 6bcf12d..4af17ce 100644
+--- a/yaffs_guts.h
++++ b/yaffs_guts.h
+@@ -18,6 +18,10 @@
+ 
+ #include "yportenv.h"
+ 
++#ifndef loff_t
++#define loff_t off_t
++#endif
++
+ #define YAFFS_OK	1
+ #define YAFFS_FAIL  0
+ 
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils_git.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils_git.bb
index e8d1873..67c926b 100644
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils_git.bb
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils_git.bb
@@ -14,7 +14,8 @@
 # Source is the HEAD of master branch at the time of writing this recipe
 SRC_URI = "git://www.aleph1.co.uk/yaffs2;protocol=git;branch=master \
            file://makefile-add-ldflags.patch \
-          "
+           file://0001-define-loff_t-if-not-already-defined.patch \
+           "
 
 SRCREV = "bc76682d93955cfb33051beb503ad9f8a5450578"
 S = "${WORKDIR}/git"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-support/fuse/fuse_2.9.4.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-support/fuse/fuse_2.9.4.bb
index 8cc6dbd..336281c 100644
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-support/fuse/fuse_2.9.4.bb
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-support/fuse/fuse_2.9.4.bb
@@ -22,6 +22,7 @@
 inherit autotools pkgconfig update-rc.d systemd
 
 INITSCRIPT_NAME = "fuse"
+INITSCRIPT_PARAMS = "start 3 S . stop 20 0 6 ."
 
 SYSTEMD_SERVICE_${PN} = ""
 
@@ -29,10 +30,7 @@
 
 PACKAGES =+ "fuse-utils-dbg fuse-utils libulockmgr libulockmgr-dev libulockmgr-dbg"
 
-# Fusermount requires features from the util-linux version of mount.
-RDEPENDS_${PN} += "util-linux-mount"
-
-RRECOMMENDS_${PN} = "kernel-module-fuse libulockmgr fuse-utils"
+RRECOMMENDS_${PN}_class-target = "kernel-module-fuse libulockmgr fuse-utils"
 
 FILES_${PN} += "${libdir}/libfuse.so.*"
 FILES_${PN}-dev += "${libdir}/libfuse*.la"
@@ -62,3 +60,5 @@
         install -m 0644 ${WORKDIR}/fuse.conf ${D}${sysconfdir}/modules-load.d
     fi
 }
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/aufs-util/aufs-util_git.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/aufs-util/aufs-util_git.bb
index 8980980..50d8b90 100644
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/aufs-util/aufs-util_git.bb
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/aufs-util/aufs-util_git.bb
@@ -18,6 +18,15 @@
 
 S = "${WORKDIR}/git"
 
+export HOSTCC = "${BUILD_CC}"
+
+do_configure_prepend() {
+   # Replace sbin,bin paths with bitbake environment
+   sed -i -e 's;install_sbin: Tgt = ${DESTDIR}/sbin;install_sbin: Tgt = ${DESTDIR}/${base_sbindir};' \
+          -e 's;install_ubin: Tgt = ${DESTDIR}/usr/sbin;install_sbin: Tgt = ${DESTDIR}/${bindir};' \
+	  ${S}/Makefile
+}
+
 do_configure_append () {
     install -d ${S}/include/linux/
     cp ${WORKDIR}/aufs_type.h ${S}/include/linux/
@@ -34,7 +43,7 @@
 }
 
 do_compile_class-native () {
-    oe_runmake tools CPPFLAGS="-I${S}/include -I${S}/libau"
+    oe_runmake tools CPPFLAGS="-I${S}/include -I${S}/libau" CC="${BUILD_CC}"
 }
 
 do_install () {
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/dmapi/dmapi_2.2.12.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/dmapi/dmapi_2.2.12.bb
index 0242a70..632f79d 100644
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/dmapi/dmapi_2.2.12.bb
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/dmapi/dmapi_2.2.12.bb
@@ -30,4 +30,4 @@
     oe_runmake install install-dev PKG_DEVLIB_DIR=${libdir}
 }
 
-PNBLACKLIST[dmapi] ?= "Depends on broken xfsprogs"
+PNBLACKLIST[dmapi] ?= "Depends on broken xfsprogs - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0002-Fix-mkfs-out-of-tree-builds.patch b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0002-Fix-mkfs-out-of-tree-builds.patch
new file mode 100644
index 0000000..9e561cb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0002-Fix-mkfs-out-of-tree-builds.patch
@@ -0,0 +1,37 @@
+From 0731eefd389e01419f78a115e1363ed0c28cfd3a Mon Sep 17 00:00:00 2001
+From: "Yong, Jonathan" <jonathan.yong@intel.com>
+Date: Thu, 30 Mar 2017 08:03:37 +0000
+Subject: [PATCH] Fix mkfs out of tree builds
+
+Libraries are built in builddir, not srcdir, fix Makefile.am
+accordingly.
+
+Signed-off-by: Yong, Jonathan <jonathan.yong@intel.com>
+Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
+
+The patch was imported from the f2fs-tools repo
+(git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git)
+commit ID 0731eefd389e01419f78a115e1363ed0c28cfd3a.
+
+Upstream-Status: Accepted, expected to be included in 1.9.0.
+
+Signed-off-by: Yong, Jonathan <jonathan.yong@intel.com>
+
+---
+ mkfs/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mkfs/Makefile.am b/mkfs/Makefile.am
+index 162a0cf..0ea8b49 100644
+--- a/mkfs/Makefile.am
++++ b/mkfs/Makefile.am
+@@ -10,5 +10,5 @@ lib_LTLIBRARIES = libf2fs_format.la
+ libf2fs_format_la_SOURCES = f2fs_format_main.c f2fs_format.c f2fs_format_utils.c
+ libf2fs_format_la_CFLAGS = -DWITH_BLKDISCARD
+ libf2fs_format_la_CPPFLAGS = -I$(top_srcdir)/include
+-libf2fs_format_la_LDFLAGS = -luuid -L$(top_srcdir)/lib -lf2fs \
++libf2fs_format_la_LDFLAGS = -luuid -L$(top_builddir)/lib -lf2fs \
+ 	-version-info $(FMT_CURRENT):$(FMT_REVISION):$(FMT_AGE)
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.4.0.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.4.0.bb
deleted file mode 100644
index 1a558e7..0000000
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.4.0.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-SUMMARY = "Tools for Flash-Friendly File System (F2FS)"
-HOMEPAGE = "http://sourceforge.net/projects/f2fs-tools/"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=362b4b2594cd362b874a97718faa51d3"
-
-# to provide libuuid
-DEPENDS = "util-linux"
-
-SRCREV = "baac4b4e6f41ceb02511da49dd3707674f3fea21"
-SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git \
-    file://0001-Remove-AC_CHECK_FILE-for-cross-compilation.patch"
-S = "${WORKDIR}/git"
-
-inherit pkgconfig autotools
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.8.0.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.8.0.bb
new file mode 100644
index 0000000..691cb6e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.8.0.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Tools for Flash-Friendly File System (F2FS)"
+HOMEPAGE = "http://sourceforge.net/projects/f2fs-tools/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=362b4b2594cd362b874a97718faa51d3"
+
+# to provide libuuid
+DEPENDS = "util-linux"
+
+SRCREV = "1e7aedf99b85d16f94d1d8ad2fcf846403bb2174"
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git \
+    file://0001-Remove-AC_CHECK_FILE-for-cross-compilation.patch \
+    file://0002-Fix-mkfs-out-of-tree-builds.patch"
+S = "${WORKDIR}/git"
+
+inherit pkgconfig autotools
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsdump/xfsdump_3.1.4.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsdump/xfsdump_3.1.4.bb
index fe5aef1..d5ad0b0 100644
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsdump/xfsdump_3.1.4.bb
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsdump/xfsdump_3.1.4.bb
@@ -35,4 +35,4 @@
     oe_runmake install-dev
 }
 
-PNBLACKLIST[xfsdump] ?= "Depends on broken xfsprogs"
+PNBLACKLIST[xfsdump] ?= "Depends on broken xfsprogs - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/drop-configure-check-for-aio.patch b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/drop-configure-check-for-aio.patch
deleted file mode 100644
index 7601095..0000000
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/drop-configure-check-for-aio.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-xfsprogs: drop configure check for aio
-
-It's unused and breaks compilation with uclibc.
-
-Upstream-Status: Pending
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- configure.ac         |  6 +++---
- m4/Makefile          |  1 -
- m4/package_aiodev.m4 | 36 ------------------------------------
- 3 files changed, 3 insertions(+), 40 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index b968977..4e2a263 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -47,6 +47,9 @@ AC_ARG_ENABLE(lib64,
- 	enable_lib64=yes)
- AC_SUBST(enable_lib64)
- 
-+librt="-lrt"
-+AC_SUBST(librt)
-+
- #
- # If the user specified a libdir ending in lib64 do not append another
- # 64 to the library names.
-@@ -92,9 +95,6 @@ AC_PACKAGE_GLOBALS(xfsprogs)
- AC_PACKAGE_UTILITIES(xfsprogs)
- AC_MULTILIB($enable_lib64)
- 
--AC_PACKAGE_NEED_AIO_H
--AC_PACKAGE_NEED_LIO_LISTIO
--
- AC_PACKAGE_NEED_UUID_H
- AC_PACKAGE_NEED_UUIDCOMPARE
- 
-diff --git a/m4/Makefile b/m4/Makefile
-index 654a4fb..d282f0a 100644
---- a/m4/Makefile
-+++ b/m4/Makefile
-@@ -14,7 +14,6 @@ CONFIGURE = \
- 
- LSRCFILES = \
- 	manual_format.m4 \
--	package_aiodev.m4 \
- 	package_blkid.m4 \
- 	package_globals.m4 \
- 	package_libcdev.m4 \
-diff --git a/m4/package_aiodev.m4 b/m4/package_aiodev.m4
-index 490d9c8..8b13789 100644
---- a/m4/package_aiodev.m4
-+++ b/m4/package_aiodev.m4
-@@ -1,37 +1 @@
--#
--# Check if we have a libaio.h installed
--#
--AC_DEFUN([AC_PACKAGE_WANT_AIO],
--  [ AC_CHECK_HEADERS(libaio.h, [ have_aio=true ], [ have_aio=false ])
--    AC_SUBST(have_aio)
--  ])
--
--#
--# Check if we have an aio.h installed
--#
--AC_DEFUN([AC_PACKAGE_NEED_AIO_H],
--  [ AC_CHECK_HEADERS(aio.h)
--    if test $ac_cv_header_aio_h = no; then
--	echo
--	echo 'FATAL ERROR: could not find a valid <aio.h> header.'
--	exit 1
--    fi
--  ])
--
--#
--# Check if we have the lio_listio routine in either libc/librt
--#
--AC_DEFUN([AC_PACKAGE_NEED_LIO_LISTIO],
--  [ AC_CHECK_FUNCS(lio_listio)
--    if test $ac_cv_func_lio_listio = yes; then
--	librt=""
--    else
--	AC_CHECK_LIB(rt, lio_listio,, [
--	    echo
--	    echo 'FATAL ERROR: could not find a library with lio_listio.'
--	    exit 1],[-lpthread])
--	librt="-lrt"
--    fi
--    AC_SUBST(librt)
--  ])
- 
--- 
-1.8.1.2
-
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/link_needed_libs.patch b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/link_needed_libs.patch
new file mode 100644
index 0000000..1de634e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/link_needed_libs.patch
@@ -0,0 +1,82 @@
+Index: xfsprogs-4.10.0/libxcmd/Makefile
+===================================================================
+--- xfsprogs-4.10.0.orig/libxcmd/Makefile
++++ xfsprogs-4.10.0/libxcmd/Makefile
+@@ -30,10 +30,21 @@ LCFLAGS += -DENABLE_EDITLINE
+ LTLIBS += $(LIBEDITLINE) $(LIBTERMCAP)
+ endif
+ 
++ifeq ($(ENABLE_BLKID),yes)
++LCFLAGS += -DENABLE_BLKID
++LTLIBS += $(LIBBLKID)
++endif
++
++LTLIBS += $(LIBXFS)
++
+ default: ltdepend $(LTLIBRARY)
+ 
+ include $(BUILDRULES)
+ 
+-install install-dev: default
++install: default
++	$(INSTALL_LTLIB)
++
++install-dev: default
++	$(INSTALL_LTLIB_DEV)
+ 
+ -include .ltdep
+Index: xfsprogs-4.10.0/libxfs/Makefile
+===================================================================
+--- xfsprogs-4.10.0.orig/libxfs/Makefile
++++ xfsprogs-4.10.0/libxfs/Makefile
+@@ -137,6 +137,7 @@ include $(BUILDRULES)
+ 
+ install: default
+ 	$(INSTALL) -m 755 -d $(PKG_INC_DIR)
++	$(INSTALL_LTLIB)
+ 
+ install-headers: $(addsuffix -hdrs, $(PKGHFILES))
+ 
+Index: xfsprogs-4.10.0/libxlog/Makefile
+===================================================================
+--- xfsprogs-4.10.0.orig/libxlog/Makefile
++++ xfsprogs-4.10.0/libxlog/Makefile
+@@ -19,6 +19,10 @@ default: ltdepend $(LTLIBRARY)
+ 
+ include $(BUILDRULES)
+ 
+-install install-dev: default
++install: default
++	$(INSTALL_LTLIB)
++
++install-dev: default
++	$(INSTALL_LTLIB_DEV)
+ 
+ -include .ltdep
+Index: xfsprogs-4.10.0/io/Makefile
+===================================================================
+--- xfsprogs-4.10.0.orig/io/Makefile
++++ xfsprogs-4.10.0/io/Makefile
+@@ -13,7 +13,7 @@
+ 	getrusage.c imap.c link.c mmap.c open.c parent.c pread.c prealloc.c \
+ 	pwrite.c reflink.c seek.c shutdown.c sync.c truncate.c utimes.c
+ 
+-LLDLIBS = $(LIBXCMD) $(LIBHANDLE) $(LIBPTHREAD)
++LLDLIBS = $(LIBXCMD) $(LIBHANDLE) $(LIBUUID) $(LIBPTHREAD)
+ LTDEPENDENCIES = $(LIBXCMD) $(LIBHANDLE)
+ LLDFLAGS = -static-libtool-libs
+ 
+Index: xfsprogs-4.10.0/quota/Makefile
+===================================================================
+--- xfsprogs-4.10.0.orig/quota/Makefile
++++ xfsprogs-4.10.0/quotq/Makefile
+@@ -14,7 +14,7 @@
+ PCFILES = darwin.c freebsd.c irix.c linux.c
+ LSRCFILES = $(shell echo $(PCFILES) | sed -e "s/$(PKG_PLATFORM).c//g")
+ 
+-LLDLIBS = $(LIBXCMD)
++LLDLIBS = $(LIBXCMD) $(LIBUUID)
+ LTDEPENDENCIES = $(LIBXCMD)
+ LLDFLAGS = -static
+ 
+
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/remove-install-as-user.patch b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/remove-install-as-user.patch
deleted file mode 100644
index e761db3..0000000
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/remove-install-as-user.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-remove install as user
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- include/buildmacros |  2 +-
- include/install-sh  | 95 ++++++++---------------------------------------------
- 2 files changed, 14 insertions(+), 83 deletions(-)
-
-diff --git a/include/buildmacros b/include/buildmacros
-index 7a01880..0840d55 100644
---- a/include/buildmacros
-+++ b/include/buildmacros
-@@ -30,7 +30,7 @@ OBJECTS = $(ASFILES:.s=.o) \
- 	  $(LFILES:.l=.o) \
- 	  $(YFILES:%.y=%.tab.o)
- 
--INSTALL	= $(TOPDIR)/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
-+INSTALL	= $(TOPDIR)/install-sh
- 
- IMAGES_DIR = $(TOPDIR)/all-images
- DIST_DIR = $(TOPDIR)/dist
-diff --git a/include/install-sh b/include/install-sh
-index c952a71..b9d66f7 100755
---- a/include/install-sh
-+++ b/include/install-sh
-@@ -24,11 +24,11 @@
- #       set           set      |    yes        yes
- #
- _usage() {
--    echo "Usage: $prog [-o owner] [-g group] [-m mode] -d directory"
--    echo "or     $prog [-D] [-o owner] [-g group] [-m mode] file directory/file"
--    echo "or     $prog [-o owner] [-g group] [-m mode] file [file ...] directory"
-+    echo "Usage: $prog [-m mode] -d directory"
-+    echo "or     $prog [-m mode] file directory/file"
-+    echo "or     $prog [-m mode] file [file ...] directory"
-     echo "or     $prog -S file target  (creates \"target\" symlink)"
--    echo "or     $prog -T lt_arg [-o owner] [-g group] [-m mode] libtool.lai directory"
-+    echo "or     $prog -T lt_arg [-m mode] libtool.lai directory"
-     echo ""
-     echo "The \$DIST_MANIFEST and \$DIST_ROOT environment variables affect the"
-     echo "behaviour of this command - see comments in the script."
-@@ -38,32 +38,6 @@ _usage() {
-     exit 1
- }
- 
--_chown ()
--{
--    _st=255
--    if [ $# -eq 3 ] ; then
--	chown $1:$2 $3
--	_st=$?
--	if [ $_st -ne 0 ] ; then
--	    if [ $REAL_UID != '0' ] ; then
--		if [ ! -f $DIST_ROOT/.chown.quiet ] ; then
--		    echo '==============================================='
--		    echo Ownership of files under ${DIST_ROOT:-/}
--		    echo cannot be changed
--		    echo '==============================================='
--		    if [ -n "$DIST_ROOT" ] ; then
--			touch $DIST_ROOT/.chown.quiet
--		    fi
--		fi
--	       _st=0
--	    fi     
--	fi
--    fi
--
--    return $_st
--}
--
--
- _manifest ()
- { 
-     echo $* | sed -e 's/\/\//\//g' >>${DIST_MANIFEST:-/dev/null}
-@@ -77,9 +51,6 @@ Sflag=false
- Tflag=false
- DIRMODE=755
- FILEMODE=644
--OWNER=`id -u`
--GROUP=`id -g`
--REAL_UID=$OWNER
- 
- # default is to install and don't append manifest
- INSTALL=true
-@@ -94,24 +65,16 @@ MANIFEST=:
- 
- if $INSTALL
- then
--    CP=cp; LN=ln; MKDIR=mkdir; CHMOD=chmod; CHOWN=_chown
-+    CP=cp; LN=ln; MKDIR=mkdir; CHMOD=chmod;
- else
--    CP=true; LN=true; MKDIR=true; CHMOD=true; CHOWN=true
-+    CP=true; LN=true; MKDIR=true; CHMOD=true;
- fi
- 
--[ -n "$DIST_ROOT" -a $REAL_UID -ne 0 ] && CHOWN=true
--
--while getopts "Dcm:d:S:o:g:T:" c $*
-+while getopts "Dcm:d:S:T:" c $*
- do
-    case $c in
-    c)
- 	;;
--   g)
--	GROUP=$OPTARG
--	;;
--   o)
--	OWNER=$OPTARG
--	;;
-    m)
- 	DIRMODE=`expr $OPTARG`
- 	FILEMODE=$DIRMODE
-@@ -146,18 +109,7 @@ then
-     # first usage
-     #
-     $MKDIR -p $dir 
--    status=$?
--    if [ $status -eq 0 ]
--    then
--	$CHMOD $DIRMODE $dir
--	status=$?
--    fi
--    if [ $status -eq 0 ]
--    then
--	$CHOWN $OWNER $GROUP $dir
--	status=$?
--    fi
--    $MANIFEST d $DIRMODE $OWNER $GROUP ${dir#$DIST_ROOT}
-+    $MANIFEST d $DIRMODE ${dir#$DIST_ROOT}
- elif $Sflag
- then
-     #
-@@ -203,7 +155,7 @@ then
- 			install_name=$target/$solib
- 			$CP $solib $install_name
- 			status=$?
--			$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$solib ${install_name#$DIST_ROOT}
-+			$MANIFEST f $FILEMODE $HERE/$solib ${install_name#$DIST_ROOT}
- 			break
- 		fi
- 	done
-@@ -254,7 +206,7 @@ then
- 	install_name=$target/$old_library
- 	$CP $old_library $install_name
- 	status=$?
--	$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$old_library ${install_name#$DIST_ROOT}
-+	$MANIFEST f $FILEMODE $HERE/$old_library ${install_name#$DIST_ROOT}
- 	;;
-     *)
- 	echo "$prog: -T $lt_install invalid"
-@@ -267,7 +219,6 @@ then
- 	if [ $status -eq 0 ]
- 	then
- 		$CHMOD $FILEMODE $install_name
--		$CHOWN $OWNER $GROUP $install_name
- 	fi
- 	;;
-     esac
-@@ -292,23 +243,10 @@ else
- 	then 
- 	    if [ -f $dir/$f ]
- 	    then
--		$CHMOD $FILEMODE $dir/$f
--		status=$?
--		if [ $status -eq 0 ]
--		then
--		    $CHOWN $OWNER $GROUP $dir/$f
--		    status=$?
--		fi
--		$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f
-+		$MANIFEST f $FILEMODE $HERE/$f ${dir#$DIST_ROOT}/$f
- 	    else
- 		$CHMOD $FILEMODE $dir
--		status=$?
--		if [ $status -eq 0 ]
--		then
--		    $CHOWN $OWNER $GROUP $dir
--		    status=$?
--		fi
--		$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$dir ${dir#$DIST_ROOT}
-+		$MANIFEST f $FILEMODE $HERE/$dir ${dir#$DIST_ROOT}
- 	    fi
- 	fi
-     else
-@@ -334,14 +272,7 @@ else
- 	    status=$?
- 	    if [ $status -eq 0 ]
- 	    then
--		$CHMOD $FILEMODE $dir/$f
--		status=$?
--		if [ $status -eq 0 ]
--		then
--		    $CHOWN $OWNER $GROUP $dir/$f
--		    status=$?
--		fi
--		$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f
-+		$MANIFEST f $FILEMODE $HERE/$f ${dir#$DIST_ROOT}/$f
- 	    fi
- 	    [ $status -ne 0 ] && break
- 	done
--- 
-1.8.1.2
-
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/xfsprogs-generate-crctable-which-is-moved-into-runti.patch b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/xfsprogs-generate-crctable-which-is-moved-into-runti.patch
deleted file mode 100644
index b204195..0000000
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/files/xfsprogs-generate-crctable-which-is-moved-into-runti.patch
+++ /dev/null
@@ -1,170 +0,0 @@
-From e58cb210a7c15352040a411d11a8383eac0defda Mon Sep 17 00:00:00 2001
-From: Jianchuan Wang <jianchuan.wang@windriver.com>
-Date: Tue, 30 Sep 2014 12:16:17 +0800
-Subject: [PATCH] xfsprogs: generate crctable which is moved into runtime from
- compile
-
-After upgraded, There is a compile error except x86,
-Because crc32.c need two arraies crc32table_le and crc32ctable_le from crc32table.h,
-which are generated by gen_crc32table.c relative to different platforms.
-For this, move the function implementation from gen_crc32table.c to crc.c
-
-Upstream-Status: Pending
-
-Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
----
- libxfs/Makefile | 23 ++----------------
- libxfs/crc32.c  | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
- 2 files changed, 75 insertions(+), 23 deletions(-)
-
-diff --git a/libxfs/Makefile b/libxfs/Makefile
-index ae15a5d..7670159 100644
---- a/libxfs/Makefile
-+++ b/libxfs/Makefile
-@@ -10,7 +10,7 @@ LT_CURRENT = 0
- LT_REVISION = 0
- LT_AGE = 0
- 
--HFILES = xfs.h init.h xfs_dir2_priv.h crc32defs.h crc32table.h
-+HFILES = xfs.h init.h xfs_dir2_priv.h crc32defs.h
- CFILES = cache.c \
- 	crc32.c \
- 	init.c kmem.c logitem.c radix-tree.c rdwr.c trans.c util.c \
-@@ -43,7 +43,6 @@ CFILES = cache.c \
- CFILES += $(PKG_PLATFORM).c
- PCFILES = darwin.c freebsd.c irix.c linux.c
- LSRCFILES = $(shell echo $(PCFILES) | sed -e "s/$(PKG_PLATFORM).c//g")
--LSRCFILES += gen_crc32table.c
- 
- #
- # Tracing flags:
-@@ -61,25 +60,7 @@ LTLIBS = $(LIBPTHREAD) $(LIBRT)
- # don't try linking xfs_repair with a debug libxfs.
- DEBUG = -DNDEBUG
- 
--LDIRT = gen_crc32table crc32table.h crc32selftest
--
--default: crc32selftest ltdepend $(LTLIBRARY)
--
--crc32table.h: gen_crc32table.c
--	@echo "    [CC]     gen_crc32table"
--	$(Q) $(CC) $(CFLAGS) -o gen_crc32table $<
--	@echo "    [GENERATE] $@"
--	$(Q) ./gen_crc32table > crc32table.h
--
--# The selftest binary will return an error if it fails. This is made a
--# dependency of the build process so that we refuse to build the tools on broken
--# systems/architectures. Hence we make sure that xfsprogs will never use a
--# busted CRC calculation at build time and hence avoid putting bad CRCs down on
--# disk.
--crc32selftest: gen_crc32table.c crc32table.h crc32.c
--	@echo "    [TEST]    CRC32"
--	$(Q) $(CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@
--	$(Q) ./$@
-+default: ltdepend $(LTLIBRARY)
- 
- include $(BUILDRULES)
- 
-diff --git a/libxfs/crc32.c b/libxfs/crc32.c
-index 0f847d2..be5fbc3 100644
---- a/libxfs/crc32.c
-+++ b/libxfs/crc32.c
-@@ -55,8 +55,6 @@ typedef __u32	u64;
- # define tobe(x) (x)
- #endif
- 
--#include "crc32table.h"
--
- #if CRC_LE_BITS > 8 || CRC_BE_BITS > 8
- 
- /* implements slicing-by-4 or slicing-by-8 algorithm */
-@@ -183,13 +181,86 @@ u32 __pure crc32c_le(u32 crc, unsigned char const *p, size_t len)
- 	return crc32_le_generic(crc, p, len, NULL, CRC32C_POLY_LE);
- }
- #else
-+
-+#include <stdio.h>
-+#include "crc32defs.h"
-+#include <inttypes.h>
-+
-+#define ENTRIES_PER_LINE 4
-+
-+#if CRC_LE_BITS > 8
-+# define LE_TABLE_ROWS (CRC_LE_BITS/8)
-+# define LE_TABLE_SIZE 256
-+#else
-+# define LE_TABLE_ROWS 1
-+# define LE_TABLE_SIZE (1 << CRC_LE_BITS)
-+#endif
-+
-+#if CRC_BE_BITS > 8
-+# define BE_TABLE_ROWS (CRC_BE_BITS/8)
-+# define BE_TABLE_SIZE 256
-+#else
-+# define BE_TABLE_ROWS 1
-+# define BE_TABLE_SIZE (1 << CRC_BE_BITS)
-+#endif
-+
-+static uint32_t crc32table_le[LE_TABLE_ROWS][256];
-+static uint32_t crc32ctable_le[LE_TABLE_ROWS][256];
-+
-+static uint32_t crc32table_le_init = 0;
-+static uint32_t crc32ctable_le_init = 0;
-+
-+/*
-+ * big endian ordered CRC not used by XFS.
-+static uint32_t crc32table_be[BE_TABLE_ROWS][256];
-+ */
-+
-+/**
-+ * crc32init_le() - allocate and initialize LE table data
-+ *
-+ * crc is the crc of the byte i; other entries are filled in based on the
-+ * fact that crctable[i^j] = crctable[i] ^ crctable[j].
-+ *
-+ */
-+static void crc32init_le_generic(const uint32_t polynomial,
-+				 uint32_t (*tab)[256])
-+{
-+	unsigned i, j;
-+	uint32_t crc = 1;
-+
-+	tab[0][0] = 0;
-+
-+	for (i = LE_TABLE_SIZE >> 1; i; i >>= 1) {
-+		crc = (crc >> 1) ^ ((crc & 1) ? polynomial : 0);
-+		for (j = 0; j < LE_TABLE_SIZE; j += 2 * i)
-+			tab[0][i + j] = crc ^ tab[0][j];
-+	}
-+	for (i = 0; i < LE_TABLE_SIZE; i++) {
-+		crc = tab[0][i];
-+		for (j = 1; j < LE_TABLE_ROWS; j++) {
-+			crc = tab[0][crc & 0xff] ^ (crc >> 8);
-+			tab[j][i] = crc;
-+		}
-+	}
-+}
-+
- u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
- {
-+	if (crc32table_le_init == 0) {
-+		crc32init_le_generic(CRCPOLY_LE, crc32table_le);
-+		crc32table_le_init == 1;
-+	}	
-+
- 	return crc32_le_generic(crc, p, len,
- 			(const u32 (*)[256])crc32table_le, CRCPOLY_LE);
- }
- u32 __pure crc32c_le(u32 crc, unsigned char const *p, size_t len)
- {
-+	if (crc32ctable_le_init == 0) {
-+		crc32init_le_generic(CRC32C_POLY_LE, crc32ctable_le);
-+		crc32ctable_le_init == 1;
-+	}
-+
- 	return crc32_le_generic(crc, p, len,
- 			(const u32 (*)[256])crc32ctable_le, CRC32C_POLY_LE);
- }
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/xfsprogs_3.2.3.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/xfsprogs_3.2.3.bb
deleted file mode 100644
index 460a898..0000000
--- a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/xfsprogs_3.2.3.bb
+++ /dev/null
@@ -1,55 +0,0 @@
-SUMMARY = "XFS Filesystem Utilities"
-HOMEPAGE = "http://oss.sgi.com/projects/xfs"
-SECTION = "base"
-LICENSE = "GPLv2 & LGPLv2.1"
-LICENSE_libhandle = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://doc/COPYING;md5=dbdb5f4329b7e7145de650e9ecd4ac2a"
-DEPENDS = "util-linux"
-
-SRC_URI = "ftp://oss.sgi.com/projects/xfs/cmd_tars/${BP}.tar.gz \
-    file://xfsprogs-generate-crctable-which-is-moved-into-runti.patch \
-    file://remove-install-as-user.patch \
-    file://drop-configure-check-for-aio.patch \
-"
-
-SRC_URI[md5sum] = "9f383e36682709e62b12c125e5d8b895"
-SRC_URI[sha256sum] = "7a5124a880997939551b519610a2e54bd4cd0b0adfd563ce3f4de30827109ac9"
-
-inherit autotools-brokensep
-
-PACKAGES =+ "${PN}-fsck ${PN}-mkfs libhandle"
-
-RDEPENDS_${PN} = "${PN}-fsck ${PN}-mkfs"
-
-FILES_${PN}-fsck = "${base_sbindir}/fsck.xfs"
-FILES_${PN}-mkfs = "${base_sbindir}/mkfs.xfs"
-FILES_libhandle = "${base_libdir}/libhandle${SOLIBS}"
-
-EXTRA_OECONF = "--enable-gettext=no"
-do_configure () {
-    # Prevent Makefile from calling configure without arguments,
-    # when do_configure gets called for a second time.
-    rm -f include/builddefs include/platform_defs.h
-    # Recreate configure script.
-    rm -f configure
-    oe_runmake configure
-    # Configure.
-    export DEBUG="-DNDEBUG"
-    gnu-configize --force
-    oe_runconf
-}
-
-LIBTOOL = "${HOST_SYS}-libtool"
-EXTRA_OEMAKE = "'LIBTOOL=${LIBTOOL}'"
-TARGET_CC_ARCH += "${LDFLAGS}"
-PARALLEL_MAKE = ""
-
-do_install () {
-    export DIST_ROOT=${D}
-    oe_runmake install
-    # needed for xfsdump
-    oe_runmake install-dev
-}
-
-# http://errors.yoctoproject.org/Errors/Details/83236/
-PNBLACKLIST[xfsprogs] ?= "BROKEN: Needs upgrade to 4.5.0 version to be compatible with Kernel uapi changes from 4.5"
diff --git a/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/xfsprogs_4.10.0.bb b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/xfsprogs_4.10.0.bb
new file mode 100644
index 0000000..f7e10cd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-filesystems/recipes-utils/xfsprogs/xfsprogs_4.10.0.bb
@@ -0,0 +1,57 @@
+SUMMARY = "XFS Filesystem Utilities"
+HOMEPAGE = "http://oss.sgi.com/projects/xfs"
+SECTION = "base"
+LICENSE = "GPLv2 & LGPLv2.1"
+LICENSE_libhandle = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://doc/COPYING;md5=102f7fec3d53c7c8f0b7baf9bf9d76a8"
+DEPENDS = "util-linux util-linux-native"
+SRC_URI = "https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/${BP}.tar.xz \
+           file://link_needed_libs.patch \
+"
+SRC_URI[md5sum] = "ddbb04493addf014db07a7e2b96b2804"
+SRC_URI[sha256sum] = "d8cb9ab2c686699d37914354ce3992b4aff3677093cbce06ad18bf798da8a8a7"
+
+inherit autotools-brokensep
+
+PACKAGES =+ "${PN}-fsck ${PN}-mkfs ${PN}-repair libhandle"
+
+DEPENDS += "util-linux"
+
+RDEPENDS_${PN} = "${PN}-fsck ${PN}-mkfs ${PN}-repair"
+
+FILES_${PN}-fsck = "${base_sbindir}/fsck.xfs"
+FILES_${PN}-mkfs = "${base_sbindir}/mkfs.xfs"
+FILES_${PN}-repair = "${base_sbindir}/xfs_repair"
+
+FILES_libhandle = "${base_libdir}/libhandle${SOLIBS}"
+
+EXTRA_OECONF = "--enable-gettext=no \
+                INSTALL_USER=root \
+                INSTALL_GROUP=root \
+                ac_cv_header_aio_h=yes \
+                ac_cv_lib_rt_lio_listio=yes \
+"
+
+EXTRA_AUTORECONF += "-I ${S}/m4 --exclude=autoheader"
+
+PACKAGECONFIG ??= "readline blkid"
+
+PACKAGECONFIG[readline] = "--enable-readline=yes,--enable-readline=no,readline"
+PACKAGECONFIG[blkid] = "--enable-blkid=yes,--enable-blkid=no,util-linux"
+
+export DEBUG="-DNDEBUG"
+
+EXTRA_OEMAKE = "DIST_ROOT='${D}'"
+
+do_configure_prepend () {
+    export BUILD_CC="${BUILD_CC} ${BUILD_CFLAGS}"
+    # Prevent Makefile from calling configure without arguments,
+    # when do_configure gets called for a second time.
+    rm -f ${B}/include/builddefs ${B}/include/platform_defs.h ${B}/configure
+    # Recreate configure script.
+    oe_runmake configure
+}
+
+do_install_append() {
+        oe_runmake 'DESTDIR=${D}' install install-dev
+}
diff --git a/import-layers/meta-openembedded/meta-gnome/README b/import-layers/meta-openembedded/meta-gnome/README
index 1431737..7eee0e1 100644
--- a/import-layers/meta-openembedded/meta-gnome/README
+++ b/import-layers/meta-openembedded/meta-gnome/README
@@ -1,18 +1,17 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: morty
+branch: pyro
 revision: HEAD
 
 URI: git://github.com/openembedded/meta-oe.git
-branch: morty
+branch: pyro
 revision: HEAD
 
-Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-gnome]' in the subject'
+Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-gnome][pyro]' in the subject'
 
 When sending single patches, please using something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-gnome][morty][PATCH'
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-gnome][pyro][PATCH'
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
-
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-apps/cheese/cheese_2.30.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-apps/cheese/cheese_2.30.1.bb
index 6e0e0aa..3f5a5b1 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-apps/cheese/cheese_2.30.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-apps/cheese/cheese_2.30.1.bb
@@ -20,3 +20,7 @@
 do_configure_prepend() {
     sed -i -e "s: help : :g" ${S}/Makefile.am
 }
+
+PNBLACKLIST[cheese] ?= "Depends on blacklisted gstreamer - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[cheese] ?= "Depends on blacklisted gnome-desktop - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-apps/epdfview/epdfview_0.1.8.bb b/import-layers/meta-openembedded/meta-gnome/recipes-apps/epdfview/epdfview_0.1.8.bb
index d40f51d..5e11a95 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-apps/epdfview/epdfview_0.1.8.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-apps/epdfview/epdfview_0.1.8.bb
@@ -20,6 +20,6 @@
 SRC_URI[md5sum] = "e50285b01612169b2594fea375f53ae4"
 SRC_URI[sha256sum] = "948648ae7c9d7b3b408d738bd4f48d87375b1196cae1129d6b846a8de0f2f8f0"
 
-PNBLACKLIST[epdfview] ?= "BROKEN: images are not displayed anymore"
+PNBLACKLIST[epdfview] ?= "BROKEN: images are not displayed anymore - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 # There will be no further development / upstream is gone [1]
 # [1] https://bugzilla.redhat.com/show_bug.cgi?id=906121
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-apps/gnome-mplayer/gmtk_1.0.5.bb b/import-layers/meta-openembedded/meta-gnome/recipes-apps/gnome-mplayer/gmtk_1.0.5.bb
index d455f14..f6d737c 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-apps/gnome-mplayer/gmtk_1.0.5.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-apps/gnome-mplayer/gmtk_1.0.5.bb
@@ -14,3 +14,5 @@
 EXTRA_OECONF = "--disable-gconf --with-gio --with-alsa --enable-keystore"
 
 inherit gettext pkgconfig autotools gconf
+
+PNBLACKLIST[gmtk] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130661/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-apps/gnome-mplayer/gnome-mplayer_1.0.5.bb b/import-layers/meta-openembedded/meta-gnome/recipes-apps/gnome-mplayer/gnome-mplayer_1.0.5.bb
index ef460f1..629b830 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-apps/gnome-mplayer/gnome-mplayer_1.0.5.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-apps/gnome-mplayer/gnome-mplayer_1.0.5.bb
@@ -5,7 +5,7 @@
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
 
-PNBLACKLIST[gnome-mplayer] ?= "rdepends on blacklisted mplayer"
+PNBLACKLIST[gnome-mplayer] ?= "rdepends on blacklisted mplayer - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 PR = "r2"
 
 DEPENDS = "gmtk gtk+ alsa-lib libnotify glib-2.0 dbus-glib virtual/libx11 libxscrnsaver"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-apps/pinpoint/pinpoint_git.bb b/import-layers/meta-openembedded/meta-gnome/recipes-apps/pinpoint/pinpoint_git.bb
index a90e5cd..5e902a1 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-apps/pinpoint/pinpoint_git.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-apps/pinpoint/pinpoint_git.bb
@@ -7,7 +7,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24 \
                     file://pinpoint.c;beginline=6;endline=17;md5=201d438283607da393fae6aca085454c"
 
-DEPENDS = "gnome-common glib-2.0 gdk-pixbuf cogl-1.0 clutter-1.0 clutter-gst-3.0 librsvg"
+DEPENDS = "glib-2.0 gdk-pixbuf cogl-1.0 clutter-1.0 clutter-gst-3.0 librsvg"
 
 inherit autotools gettext pkgconfig
 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-connectivity/network-manager-applet/network-manager-applet_1.0.10.bb b/import-layers/meta-openembedded/meta-gnome/recipes-connectivity/network-manager-applet/network-manager-applet_1.0.10.bb
deleted file mode 100644
index 9803a83..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-connectivity/network-manager-applet/network-manager-applet_1.0.10.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-SUMMARY = "GTK+ applet for NetworkManager"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-
-DEPENDS = "gtk+3 libnotify libsecret networkmanager dbus-glib \
-           gconf libgnome-keyring iso-codes nss \
-           intltool-native \
-"
-
-inherit gnomebase gsettings gtk-icon-cache gobject-introspection
-
-GNOME_COMPRESS_TYPE = "xz"
-
-SRC_URI[archive.md5sum] = "86b17e1bf1a37c649874883b587c6db6"
-SRC_URI[archive.sha256sum] = "b045ac3eaa68ccbbefe91510ad67b4002a7e09d1e5ce1c4bf9a67619bd2cf0eb"
-
-PACKAGECONFIG[bluetooth] = "--with-bluetooth,--without-bluetooth,gnome-bluetooth,gnome-bluetooth"
-PACKAGECONFIG[modemmanager] = "--with-modem-manager-1,--without-modem-manager-1,modemmanager"
-PACKAGECONFIG ??= ""
-
-do_configure_append() {
-    # Sigh... --enable-compile-warnings=no doesn't actually turn off -Werror
-    for i in $(find ${B} -name "Makefile") ; do
-        sed -i -e s:-Werror::g $i
-    done
-}
-
-RDEPENDS_${PN} =+ "networkmanager"
-
-FILES_${PN} += " \
-    ${datadir}/appdata \
-    ${datadir}/nm-applet/ \
-    ${datadir}/libnm-gtk/wifi.ui \
-"
-
-FILES_${PN} += "${libdir}/gnome-bluetooth/plugins/*.so"
-FILES_${PN}-dev += "${libdir}/gnome-bluetooth/plugins/libnma.la"
-FILES_${PN}-staticdev += "${libdir}/gnome-bluetooth/plugins/libnma.a"
-FILES_${PN}-dbg += "${libdir}/gnome-bluetooth/plugins/.debug/"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-connectivity/network-manager-applet/network-manager-applet_1.4.4.bb b/import-layers/meta-openembedded/meta-gnome/recipes-connectivity/network-manager-applet/network-manager-applet_1.4.4.bb
new file mode 100644
index 0000000..5ad1070
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-connectivity/network-manager-applet/network-manager-applet_1.4.4.bb
@@ -0,0 +1,34 @@
+SUMMARY = "GTK+ applet for NetworkManager"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+DEPENDS = "gtk+3 libnotify libsecret networkmanager dbus-glib \
+           gconf libgnome-keyring iso-codes nss \
+           intltool-native \
+"
+
+inherit gnomebase gsettings gtk-icon-cache gobject-introspection
+
+GNOME_COMPRESS_TYPE = "xz"
+
+SRC_URI[archive.md5sum] = "3f82cedc4703df0277c76d9feb5bf2c8"
+SRC_URI[archive.sha256sum] = "693846eeae0986e79eb1cedfbc499f132f27a9976ef189a0f16938ac59ec3226"
+
+PACKAGECONFIG[modemmanager] = "--with-wwan,--without-wwan,modemmanager"
+PACKAGECONFIG ??= ""
+
+do_configure_append() {
+    # Sigh... --enable-compile-warnings=no doesn't actually turn off -Werror
+    for i in $(find ${B} -name "Makefile") ; do
+        sed -i -e s:-Werror::g $i
+    done
+}
+
+RDEPENDS_${PN} =+ "networkmanager"
+
+FILES_${PN} += " \
+    ${datadir}/appdata \
+    ${datadir}/nm-applet/ \
+    ${datadir}/libnm-gtk/wifi.ui \
+    ${datadir}/libnma/wifi.ui \
+"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-extended/gparted/gparted_0.24.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-extended/gparted/gparted_0.24.0.bb
deleted file mode 100644
index 73a15db..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-extended/gparted/gparted_0.24.0.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-SUMMARY = "A partition editor to graphically manage disk partitions "
-HOMEPAGE = "http://gparted.org/index.php"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-inherit autotools pkgconfig gtk-icon-cache
-
-SRC_URI = " \
-    ${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.bz2 \
-    file://org.yoctoproject.pkexec.run-gparted.policy \
-    file://gparted_polkit \
-"
-SRC_URI[md5sum] = "b8480274c68876acff5965d4346710e7"
-SRC_URI[sha256sum] = "02398ab33894a59b0bd8707e598c46d8bb56f1413cd54de48eed61e2920ecd60"
-
-DEPENDS = "glib-2.0 gtkmm parted gnome-doc-utils intltool-native"
-
-do_install_append() {
-    # Add a script which checks if polkit is installed.
-    # If yes: a policy is requested from polkit / otherwise start as usual
-    install ${WORKDIR}/gparted_polkit ${D}${sbindir}
-    sed -i 's:%sbindir%:${sbindir}:g' ${D}${sbindir}/gparted_polkit
-    # relink menu entry to use our script
-    sed -i 's:${sbindir}/gparted:${sbindir}/gparted_polkit:g' ${D}${datadir}/applications/gparted.desktop
-
-    install -d ${D}${datadir}/polkit-1/actions
-    install ${WORKDIR}/org.yoctoproject.pkexec.run-gparted.policy ${D}${datadir}/polkit-1/actions/org.yoctoproject.pkexec.run-gparted.policy
-}
-
-EXTRA_OECONF = "--disable-scrollkeeper --disable-doc"
-
-FILES_${PN} += " \
-    ${datadir}/appdata \
-    ${datadir}/icons \
-    ${datadir}/polkit-1 \
-"
-
-RDEPENDS_${PN} = "dosfstools mtools e2fsprogs"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-extended/gparted/gparted_0.27.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-extended/gparted/gparted_0.27.0.bb
new file mode 100644
index 0000000..c921065
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-extended/gparted/gparted_0.27.0.bb
@@ -0,0 +1,38 @@
+SUMMARY = "A partition editor to graphically manage disk partitions "
+HOMEPAGE = "http://gparted.org/index.php"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+inherit autotools pkgconfig gtk-icon-cache
+
+SRC_URI = " \
+    ${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.gz \
+    file://org.yoctoproject.pkexec.run-gparted.policy \
+    file://gparted_polkit \
+"
+SRC_URI[md5sum] = "726f539f774b442670028af656f270bd"
+SRC_URI[sha256sum] = "208cf60c061b86bee4f658d568a3b5d843dce3ab9847f66b452298268799e7bd"
+
+DEPENDS = "glib-2.0 glib-2.0-native gtkmm parted gnome-doc-utils intltool-native"
+
+do_install_append() {
+    # Add a script which checks if polkit is installed.
+    # If yes: a policy is requested from polkit / otherwise start as usual
+    install ${WORKDIR}/gparted_polkit ${D}${sbindir}
+    sed -i 's:%sbindir%:${sbindir}:g' ${D}${sbindir}/gparted_polkit
+    # relink menu entry to use our script
+    sed -i 's:${sbindir}/gparted:${sbindir}/gparted_polkit:g' ${D}${datadir}/applications/gparted.desktop
+
+    install -d ${D}${datadir}/polkit-1/actions
+    install ${WORKDIR}/org.yoctoproject.pkexec.run-gparted.policy ${D}${datadir}/polkit-1/actions/org.yoctoproject.pkexec.run-gparted.policy
+}
+
+EXTRA_OECONF = "--disable-scrollkeeper --disable-doc"
+
+FILES_${PN} += " \
+    ${datadir}/appdata \
+    ${datadir}/icons \
+    ${datadir}/polkit-1 \
+"
+
+RDEPENDS_${PN} = "dosfstools mtools e2fsprogs"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-extended/gtk-theme-torturer/gtk-theme-torturer_git.bb b/import-layers/meta-openembedded/meta-gnome/recipes-extended/gtk-theme-torturer/gtk-theme-torturer_git.bb
index 8a21112..c419d0f 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-extended/gtk-theme-torturer/gtk-theme-torturer_git.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-extended/gtk-theme-torturer/gtk-theme-torturer_git.bb
@@ -22,4 +22,4 @@
 }
 
 # http://errors.yoctoproject.org/Errors/Details/35132/
-PNBLACKLIST[gtk-theme-torturer] ?= "BROKEN: gmacros.h:182:53: error: size of array '_GStaticAssertCompileTimeAssertion_2' is negative"
+PNBLACKLIST[gtk-theme-torturer] ?= "BROKEN: gmacros.h:182:53: error: size of array '_GStaticAssertCompileTimeAssertion_2' is negative - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/abiword/abiword_3.0.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/abiword/abiword_3.0.1.bb
index 5052b36..34fc97d 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/abiword/abiword_3.0.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/abiword/abiword_3.0.1.bb
@@ -3,11 +3,26 @@
 SECTION = "x11/office"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=ecd3ac329fca77e2d0e412bec38e1c20"
-DEPENDS     = "perl-native wv libglade libfribidi jpeg libpng \
-               librsvg libwmf-native gtkmathview asio gtk+ evolution-data-server \
-               ${@bb.utils.contains('BBFILE_COLLECTIONS', 'office-layer', 'redland rasqal', '', d)}"
-RDEPENDS_${PN}    = "glibc-gconv-ibm850 glibc-gconv-cp1252 \
-               glibc-gconv-iso8859-15 glibc-gconv-iso8859-1"
+DEPENDS  = " \
+    perl-native \
+    gtk+ \
+    gtkmathview \
+    wv \
+    libglade \
+    libfribidi \
+    jpeg \
+    libpng \
+    librsvg \
+    libwmf-native \
+    asio \
+    evolution-data-server \
+    libxslt \
+    ${@bb.utils.contains('BBFILE_COLLECTIONS', 'office-layer', 'redland rasqal', '', d)} \
+"
+RDEPENDS_${PN}_append_libc-glibc = " \
+    glibc-gconv-ibm850 glibc-gconv-cp1252 \
+    glibc-gconv-iso8859-15 glibc-gconv-iso8859-1 \
+"
 RCONFLICTS_${PN} = "${PN}-embedded"
 
 SRC_URI = " \
@@ -22,7 +37,7 @@
 SRC_URI[sha256sum] = "e094f6fbf0afc5c5538b4894888e7c346f8ee8f49c9d24821dd696d0734865c6"
 
 #want 3.x from 3.x.y for the installation directory
-SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 
 inherit autotools-brokensep pkgconfig
 
@@ -47,6 +62,8 @@
                  --with-libwmf-config=${STAGING_DIR} \
 "
 
+LDFLAGS += "-lgmodule-2.0"
+
 do_compile() {
     cd goffice-bits2
     make goffice-paths.h
@@ -111,7 +128,7 @@
     d.setVar('FILES_' + metapkg, "")
     blacklist = [ 'abiword-plugins-dbg', 'abiword-plugins', 'abiword-plugins-doc', 'abiword-plugins-dev', 'abiword-plugins-locale' ]
     metapkg_rdepends = []
-    packages = d.getVar('PACKAGES', 1).split()
+    packages = d.getVar('PACKAGES').split()
     for pkg in packages[1:]:
         if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.count("-dev") and not pkg.count("-dbg") and not pkg.count("static") and not pkg.count("locale") and not pkg.count("abiword-doc"):
             print("Modifying %s" % pkg)
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/files/0001-bonobo-ui-node-qualify-functions-with-G_GNUC_PRINTF.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/files/0001-bonobo-ui-node-qualify-functions-with-G_GNUC_PRINTF.patch
new file mode 100644
index 0000000..e9aebb8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/files/0001-bonobo-ui-node-qualify-functions-with-G_GNUC_PRINTF.patch
@@ -0,0 +1,49 @@
+From b75879e8c3e24d338c0e5843d616bc9b02da4d04 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 09:52:17 -0700
+Subject: [PATCH] bonobo-ui-node: qualify functions with G_GNUC_PRINTF
+
+This helps compiler in doing format checking correctly
+Fixes
+bonobo-ui-node.c:864:38: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
+|         g_logv   ("XML", G_LOG_LEVEL_ERROR, msg, args);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ bonobo/bonobo-ui-node.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/bonobo/bonobo-ui-node.c b/bonobo/bonobo-ui-node.c
+index 9bab5e5..6ec66e2 100644
+--- a/bonobo/bonobo-ui-node.c
++++ b/bonobo/bonobo-ui-node.c
+@@ -835,7 +835,7 @@ uiCharacters (ParseState *ps, const xmlChar *chars, int len)
+ 	g_string_append_len (ps->content, chars, len);
+ }
+ 
+-static void
++static G_GNUC_PRINTF(2, 3) void
+ uiWarning (ParseState *ps, const char *msg, ...)
+ {
+ 	va_list args;
+@@ -845,7 +845,7 @@ uiWarning (ParseState *ps, const char *msg, ...)
+ 	va_end   (args);
+ }
+ 
+-static void
++static G_GNUC_PRINTF(2, 3) void
+ uiError (ParseState *ps, const char *msg, ...)
+ {
+ 	va_list args;
+@@ -855,7 +855,7 @@ uiError (ParseState *ps, const char *msg, ...)
+ 	va_end   (args);
+ }
+ 
+-static void
++static G_GNUC_PRINTF(2, 3) void
+ uiFatalError (ParseState *ps, const char *msg, ...)
+ {
+ 	va_list args;
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/libbonobo.inc b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/libbonobo.inc
index 60a8597..e4759a8 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/libbonobo.inc
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/libbonobo.inc
@@ -3,10 +3,11 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
                     file://COPYING.LIB;md5=7fbc338309ac38fefcd64b04bb903e34"
 SECTION = "x11/gnome/libs"
-DEPENDS = "glib-2.0 orbit2-native orbit2 intltool-native libxml2 dbus dbus-glib"
+DEPENDS = "gnome-common-native glib-2.0 orbit2-native orbit2 intltool-native libxml2 dbus dbus-glib"
 
 inherit gnomebase gtk-doc lib_package
 
+EXTRA_OECONF += "'PERL_PATH=${USRBINPATH}/env perl'"
 ORBIT_IDL_SRC = "${STAGING_BINDIR_NATIVE}/orbit-idl-2"
 
 RDEPENDS_${PN}-bin = "${PN} perl"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/libbonoboui_2.24.5.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/libbonoboui_2.24.5.bb
index 627f37e..b3ca0a4 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/libbonoboui_2.24.5.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/bonobo/libbonoboui_2.24.5.bb
@@ -5,7 +5,9 @@
 
 inherit gnomebase pkgconfig gtk-doc
 
-SRC_URI += "file://gcc5.patch"
+SRC_URI += "file://gcc5.patch \
+            file://0001-bonobo-ui-node-qualify-functions-with-G_GNUC_PRINTF.patch \
+            "
 
 SRC_URI[archive.md5sum] = "853be8e28aaa4ce48ba60be7d9046bf4"
 SRC_URI[archive.sha256sum] = "fab5f2ac6c842d949861c07cb520afe5bee3dce55805151ce9cd01be0ec46fcd"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/dconf/dconf_0.18.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/dconf/dconf_0.18.0.bb
index f38be88..e24bde4 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/dconf/dconf_0.18.0.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/dconf/dconf_0.18.0.bb
@@ -9,23 +9,28 @@
 SRC_URI[archive.sha256sum] = "109b1bc6078690af1ed88cb144ef5c5aee7304769d8bdc82ed48c3696f10c955"
 GNOME_COMPRESS_TYPE = "xz"
 
-DEPENDS = "glib-2.0 gtk+3 libxml2 intltool-native"
+DEPENDS = "dbus glib-2.0 libxml2 intltool-native"
 
 inherit vala gtk-doc distro_features_check
 
-REQUIRED_DISTRO_FEATURES = "x11"
+PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "editor", "", d)}"
+
+#note: editor will be removed in version 0.23.1
+PACKAGECONFIG[editor] = "--enable-editor,--disable-editor,gtk+3"
+
+REQUIRED_DISTRO_FEATURES = "${@bb.utils.contains("PACKAGECONFIG", "editor", "x11", "", d)}"
 
 EXTRA_OECONF += "--disable-man"
 
-PACKAGES =+ "dconf-editor"
+PACKAGES =+ "${@bb.utils.contains("DISTRO_FEATURES", "x11", "dconf-editor", "", d)}"
 
 FILES_${PN} += " \
     ${datadir}/dbus-1 \
     ${libdir}/gio/modules/*.so \
+    ${datadir}/bash-completion \
 "
 FILES_dconf-editor = " \
     ${bindir}/dconf-editor \
     ${datadir}/icons \
-    ${datadir}/bash-completion \
 "
 FILES_${PN}-dbg += "${libdir}/gio/modules/.debug/libdconfsettings.so"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/devilspie/devilspie2_0.33.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/devilspie/devilspie2_0.33.bb
deleted file mode 100644
index b00a449..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/devilspie/devilspie2_0.33.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-DESCRIPTION = "Devilspie2 is a window matching utility, allowing the user to perform scripted actions on windows as they are created"
-HOMEPAGE = "http://www.gusnan.se/devilspie2"
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=00aefaa50aad75c21367df66102d542c \
-                    file://GPL3.txt;md5=d32239bcb673463ab874e80d47fae504"
-
-DEPENDS = "gtk+ glib-2.0 libwnck lua virtual/libx11"
-
-SRC_URI = " \
-    http://www.gusnan.se/devilspie2/download/devilspie2_${PV}-src.tar.gz \
-    file://default.lua \
-    file://devilspie2.desktop \
-"
-SRC_URI[md5sum] = "99c88f702e134d2b2f2f8caad4b1ef03"
-SRC_URI[sha256sum] = "01a2ebcece14065c9a2e47decd81341e2a6f63e3bf43ff446103686718748356"
-
-inherit pkgconfig
-
-do_compile() {
-    export GTK2=1
-    oe_runmake CC="${CC}" CPPFLAGS="${CPPFLAGS}" LDFLAGS=" -ldl -lm ${LDFLAGS}"
-}
-
-do_install() {
-    oe_runmake DESTDIR="${D}" PREFIX="${prefix}" install
-    install -d ${D}/${sysconfdir}/devilspie2
-    install -m 644 ${WORKDIR}/default.lua ${D}/${sysconfdir}/devilspie2
-    install -d ${D}/${sysconfdir}/xdg/autostart
-    install -m 644 ${WORKDIR}/devilspie2.desktop ${D}/${sysconfdir}/xdg/autostart
-}
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/devilspie/devilspie2_0.42.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/devilspie/devilspie2_0.42.bb
new file mode 100644
index 0000000..ae2ec5a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/devilspie/devilspie2_0.42.bb
@@ -0,0 +1,30 @@
+DESCRIPTION = "Devilspie2 is a window matching utility, allowing the user to perform scripted actions on windows as they are created"
+HOMEPAGE = "http://www.gusnan.se/devilspie2"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=00aefaa50aad75c21367df66102d542c \
+                    file://GPL3.txt;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = "gtk+ glib-2.0 libwnck lua virtual/libx11"
+
+SRC_URI = " \
+    http://download.savannah.gnu.org/releases/${BPN}/${BPN}_${PV}-src.tar.gz \
+    file://default.lua \
+    file://devilspie2.desktop \
+"
+SRC_URI[md5sum] = "f205409e921aa2d86481f1b8d518da45"
+SRC_URI[sha256sum] = "11f5bc310fba4df404c057461ffb3fadac8ef51d211008c665c48f587a5a3f85"
+
+inherit pkgconfig gettext
+
+do_compile() {
+    export GTK2=1
+    oe_runmake CC="${CC}" CPPFLAGS="${CPPFLAGS}" LDFLAGS=" -ldl -lm ${LDFLAGS}"
+}
+
+do_install() {
+    oe_runmake DESTDIR="${D}" PREFIX="${prefix}" install
+    install -d ${D}/${sysconfdir}/devilspie2
+    install -m 644 ${WORKDIR}/default.lua ${D}/${sysconfdir}/devilspie2
+    install -d ${D}/${sysconfdir}/xdg/autostart
+    install -m 644 ${WORKDIR}/devilspie2.desktop ${D}/${sysconfdir}/xdg/autostart
+}
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/eds/evolution-data-server_git.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/eds/evolution-data-server_git.bb
index c31de0c..ff3365b 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/eds/evolution-data-server_git.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/eds/evolution-data-server_git.bb
@@ -8,7 +8,7 @@
                     file://libedataserver/e-data-server-util.h;endline=20;md5=934502f03c84523aa059d4825887b380 \
                     file://calendar/libecal/e-cal.h;endline=24;md5=5d496b9b6fd2a4fdbbfc31ef9455c9d0"
 
-DEPENDS = "intltool-native glib-2.0 gtk+3 gconf dbus db gnome-common virtual/libiconv zlib libsoup-2.4 libglade libical libgnome-keyring gperf-native libgdata nss"
+DEPENDS = "intltool-native glib-2.0 gtk+3 gconf dbus db virtual/libiconv zlib libsoup-2.4 libglade libical libgnome-keyring gperf-native libgdata nss"
 
 SRCREV = "a9e4e74ec4473a4fd09e56b690bd4fa72f686687"
 
@@ -31,7 +31,7 @@
 inherit autotools gtk-doc pkgconfig gettext gobject-introspection
 
 # -ldb needs this on some platforms
-LDFLAGS += "-lpthread"
+LDFLAGS += "-lpthread -lgmodule-2.0 -lgthread-2.0"
 
 # Parallel make shows many issues with this source code.
 # Current problems seem to be duplicate execution of the calander/backends
@@ -114,4 +114,3 @@
 FILES_libedataserverui-dev = "${libdir}/libedataserverui-*.so \
                               ${libdir}/pkgconfig/libedataserverui-*.pc \
                               ${includedir}/evolution-data-server-*/libedataserverui/*.h"
-
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince/0001-Add-format-attribute-to-_synctex_malloc.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince/0001-Add-format-attribute-to-_synctex_malloc.patch
new file mode 100644
index 0000000..de739c5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince/0001-Add-format-attribute-to-_synctex_malloc.patch
@@ -0,0 +1,27 @@
+From 3776fd0b42e473fe51d3678bf26cdaa37e1d8e0d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Apr 2017 13:36:12 -0700
+Subject: [PATCH] Add format attribute to _synctex_malloc
+
+Helps in avoiding compile errors about formating with clang
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cut-n-paste/synctex/synctex_parser_utils.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cut-n-paste/synctex/synctex_parser_utils.c b/cut-n-paste/synctex/synctex_parser_utils.c
+index f8a9f6f..9459b2d 100644
+--- a/cut-n-paste/synctex/synctex_parser_utils.c
++++ b/cut-n-paste/synctex/synctex_parser_utils.c
+@@ -78,6 +78,7 @@ void *_synctex_malloc(size_t size) {
+ 	return (void *)ptr;
+ }
+ 
++__attribute__((__format__ (__printf__, 1, 0)))
+ int _synctex_error(const char * reason,...) {
+ 	va_list arg;
+ 	int result;
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince/0002-fix-gcc6-errors.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince/0002-fix-gcc6-errors.patch
deleted file mode 100644
index b8e30f7..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince/0002-fix-gcc6-errors.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- evince-3.18.2/backend/comics/comics-document.c.orig	2016-06-22 20:08:01.789805750 +0000
-+++ evince-3.18.2/backend/comics/comics-document.c	2016-06-22 20:07:00.817804688 +0000
-@@ -241,6 +241,8 @@
- /* This function shows how to use the choosen command for decompressing a
-  * comic book file. It modifies fields of the ComicsDocument struct with 
-  * this information */
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
- static gboolean 
- comics_generate_command_lines (ComicsDocument *comics_document, 
- 			       GError         **error)
-@@ -296,6 +298,7 @@
- 	}
- 
- }
-+#pragma GCC diagnostic pop
- 
- /* This function chooses an external command for decompressing a comic 
-  * book based on its mime tipe. */
---- evince-3.18.2/libdocument/ev-document-misc.c.orig	2016-06-22 20:01:49.205799262 +0000
-+++ evince-3.18.2/libdocument/ev-document-misc.c	2016-06-22 20:02:27.233799924 +0000
-@@ -519,7 +519,8 @@
- 
- 	return (dp / di);
- }
--
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wformat-y2k"
- /* Returns a locale specific date and time representation */
- gchar *
- ev_document_misc_format_date (GTime utime)
-@@ -542,6 +543,7 @@
- 
- 	return g_locale_to_utf8 (s, -1, NULL, NULL, NULL);
- }
-+#pragma GCC diagnostic pop
- 
- void
- ev_document_misc_get_pointer_position (GtkWidget *widget,
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince_3.18.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince_3.18.2.bb
deleted file mode 100644
index e42e904..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince_3.18.2.bb
+++ /dev/null
@@ -1,52 +0,0 @@
-SUMMARY = "Evince is a document viewer for document formats like pdf, ps, djvu"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=96f2f8d5ee576a2163977938ea36fa7b"
-SECTION = "x11/office"
-DEPENDS = "gtk+3 libsecret gnome-desktop3 poppler gstreamer1.0-plugins-base orc adwaita-icon-theme intltool-native"
-PR = "r5"
-
-inherit gnome pkgconfig gtk-icon-cache gsettings gobject-introspection distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "x11"
-
-SRC_URI[archive.md5sum] = "c39af6b8b1c44d4393ef8ac9dab99c0b"
-SRC_URI[archive.sha256sum] = "42ad6c7354d881a9ecab136ea84ff867acb942605bcfac48b6c12e1c2d8ecb17"
-
-SRC_URI += "file://0001-help-remove-YELP-macro.patch \
-            file://0002-fix-gcc6-errors.patch \
-"
-
-EXTRA_OECONF = " --enable-thumbnailer \
-"
-
-do_compile_prepend() {
-        export GIR_EXTRA_LIBS_PATH="${B}/libdocument/.libs"
-}
-
-
-do_install_append() {
-    install -d install -d ${D}${datadir}/pixmaps
-    install -m 0755 ${S}/data/icons/48x48/apps/evince.png ${D}${datadir}/pixmaps/
-}
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[nautilus] = "--enable-nautilus,--disable-nautilus,nautilus"
-PACKAGECONFIG[browser-plugin] = "--enable-browser-plugin,--disable-browser-plugin,"
-
-RDEPENDS_${PN} += "glib-2.0-utils"
-RRECOMMMENDS_${PN} = "adwaita-icon-theme"
-
-PACKAGES =+ "${PN}-nautilus-extension"
-PACKAGES =+ "${PN}-browser-plugin"
-FILES_${PN} += "${datadir}/dbus-1 \
-                ${datadir}/appdata \
-                ${datadir}/thumbnailers \
-               "
-FILES_${PN}-dbg += "${libdir}/*/*/.debug \
-                    ${libdir}/*/*/*/.debug"
-FILES_${PN}-dev += "${libdir}/nautilus/extensions-2.0/*.la \
-                    ${libdir}/evince/*/backends/*.la"
-FILES_${PN}-staticdev += "${libdir}/nautilus/extensions-2.0/*.a \
-                          ${libdir}/evince/*/backends/*.a"
-FILES_${PN}-nautilus-extension = "${libdir}/nautilus/*/*so"
-FILES_${PN}-browser-plugin = "${libdir}/mozilla/*/*so"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince_3.24.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince_3.24.0.bb
new file mode 100644
index 0000000..aae8e71
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/evince/evince_3.24.0.bb
@@ -0,0 +1,66 @@
+SUMMARY = "Evince is a document viewer for document formats like pdf, ps, djvu"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=96f2f8d5ee576a2163977938ea36fa7b"
+SECTION = "x11/office"
+DEPENDS = "gtk+3 libsecret gnome-desktop3 poppler gstreamer1.0-plugins-base orc adwaita-icon-theme intltool-native gnome-common-native"
+PR = "r5"
+
+inherit gnome pkgconfig gtk-icon-cache gsettings gobject-introspection distro_features_check systemd
+
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive \
+           file://0001-help-remove-YELP-macro.patch \
+           file://0001-Add-format-attribute-to-_synctex_malloc.patch \
+           "
+SRC_URI[archive.md5sum] = "3fb65ff46de191dc49c481f1fc66201c"
+SRC_URI[archive.sha256sum] = "043895af7bbd6f1b57f9ab8778e78cf9c0af5dfcc347eaa94a17bf864c04dc8f"
+
+EXTRA_OECONF = " --enable-thumbnailer \
+"
+
+do_compile_prepend() {
+        export GIR_EXTRA_LIBS_PATH="${B}/libdocument/.libs"
+}
+
+
+do_install_append() {
+    install -d ${D}${datadir}/pixmaps
+    install -m 0755 ${S}/data/icons/48x48/apps/evince.png ${D}${datadir}/pixmaps/
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}
+    then
+        install -d ${D}${systemd_unitdir}/system
+        mv ${D}${systemd_user_unitdir}/evince.service ${D}${systemd_system_unitdir}/evince.service
+    else
+        rm -rf ${D}${libdir}/systemd/user/evince.service
+    fi
+    rmdir --ignore-fail-on-non-empty ${D}${systemd_user_unitdir}
+    rmdir --ignore-fail-on-non-empty ${D}${nonarch_libdir}/systemd
+    rmdir --ignore-fail-on-non-empty ${D}${nonarch_libdir}
+}
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[nautilus] = "--enable-nautilus,--disable-nautilus,nautilus"
+PACKAGECONFIG[browser-plugin] = "--enable-browser-plugin,--disable-browser-plugin,"
+
+SYSTEMD_SERVICE_${PN} = "evince.service"
+
+RDEPENDS_${PN} += "glib-2.0-utils"
+RRECOMMMENDS_${PN} = "adwaita-icon-theme"
+
+PACKAGES =+ "${PN}-nautilus-extension"
+PACKAGES =+ "${PN}-browser-plugin"
+
+FILES_${PN} += "${datadir}/dbus-1 \
+                ${datadir}/appdata \
+                ${datadir}/thumbnailers \
+                ${systemd_unitdir}/systemd/user/evince.service \
+               "
+FILES_${PN}-dbg += "${libdir}/*/*/.debug \
+                    ${libdir}/*/*/*/.debug"
+FILES_${PN}-dev += "${libdir}/nautilus/extensions-2.0/*.la \
+                    ${libdir}/evince/*/backends/*.la"
+FILES_${PN}-staticdev += "${libdir}/nautilus/extensions-2.0/*.a \
+                          ${libdir}/evince/*/backends/*.a"
+FILES_${PN}-nautilus-extension = "${libdir}/nautilus/*/*so"
+FILES_${PN}-browser-plugin = "${libdir}/mozilla/*/*so"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gcalctool/gcalctool/fix-includedir.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gcalctool/gcalctool/fix-includedir.patch
deleted file mode 100644
index aeb02ab..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gcalctool/gcalctool/fix-includedir.patch
+++ /dev/null
@@ -1,31 +0,0 @@
----
- Makefile.am           |    2 +-
- gcalctool/Makefile.am |    2 --
- 2 files changed, 1 insertion(+), 3 deletions(-)
-
-Index: gcalctool-5.8.17/gcalctool/Makefile.am
-===================================================================
---- gcalctool-5.8.17.orig/gcalctool/Makefile.am	2005-12-19 15:46:57.000000000 +0000
-+++ gcalctool-5.8.17/gcalctool/Makefile.am	2007-05-16 16:03:26.000000000 +0100
-@@ -1,8 +1,6 @@
- ## Process this file with automake to produce Makefile.in
- 
- INCLUDES = \
--	-I$(includedir) \
--	-DG_DISABLE_DEPRECATED \
- 	-DGDK_PIXBUF_DISABLE_DEPRECATED \
- 	-DGDK_DISABLE_DEPRECATED \
- 	-DGNOME_DISABLE_DEPRECATED \
-Index: gcalctool-5.8.17/Makefile.am
-===================================================================
---- gcalctool-5.8.17.orig/Makefile.am	2007-05-16 15:35:44.000000000 +0100
-+++ gcalctool-5.8.17/Makefile.am	2007-05-16 16:06:46.000000000 +0100
-@@ -29,7 +29,7 @@ DISTCLEANFILES =                \
- 	gnome-doc-utils.make	\
- 	gcalctool.desktop
- 
--SUBDIRS = po gcalctool help
-+SUBDIRS = po gcalctool
- 
- SCHEMAS_FILE = gcalctool.schemas
- 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gcalctool/gcalctool_5.32.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gcalctool/gcalctool_5.32.0.bb
index d391bba..6028f2d 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gcalctool/gcalctool_5.32.0.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gcalctool/gcalctool_5.32.0.bb
@@ -5,7 +5,7 @@
 LICENSE = "GPL-2.0"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
-SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 SRC_URI = "http://download.gnome.org/sources/${BPN}/${SHRT_VER}/${BP}.tar.gz"
 
 SRC_URI[md5sum] = "48db927c6e7ee1d5395f953a8c184c98"
@@ -17,4 +17,4 @@
     sed -i -e "s: help: :g" ${S}/Makefile.am
 }
 
-PNBLACKLIST[gcalctool] ?= "broken at least since April 2013 http://permalink.gmane.org/gmane.comp.handhelds.openembedded/57920 and nobody complained, it's also replaced by gnome calculator"
+PNBLACKLIST[gcalctool] ?= "broken at least since April 2013 http://permalink.gmane.org/gmane.comp.handhelds.openembedded/57920 and nobody complained, it's also replaced by gnome calculator - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gdm/gdm_2.32.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gdm/gdm_2.32.2.bb
index 9266f97..64785ca 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gdm/gdm_2.32.2.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gdm/gdm_2.32.2.bb
@@ -105,4 +105,4 @@
     sed -i /gdm/d ${sysconfdir}/X11/default-display-manager || true
 }
 
-PNBLACKLIST[gdm] ?= "Depends on broken gnome-panel"
+PNBLACKLIST[gdm] ?= "Depends on broken gnome-panel - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gedit/files/0001-gedit-utils-qualify-handle_builder_error-with-format.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gedit/files/0001-gedit-utils-qualify-handle_builder_error-with-format.patch
new file mode 100644
index 0000000..4885c45
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gedit/files/0001-gedit-utils-qualify-handle_builder_error-with-format.patch
@@ -0,0 +1,31 @@
+From 623ffac1f6e7725041b386e0f2933fe36809b5a9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 09:04:30 -0700
+Subject: [PATCH] gedit-utils: qualify handle_builder_error() with format
+ string parameters
+
+gedit-utils.c:1063:32: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
+        msg_plain = g_strdup_vprintf (message, args);
+                                      ^~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gedit/gedit-utils.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gedit/gedit-utils.c b/gedit/gedit-utils.c
+index 41a5afd..c800828 100644
+--- a/gedit/gedit-utils.c
++++ b/gedit/gedit-utils.c
+@@ -1051,7 +1051,7 @@ gedit_utils_is_valid_uri (const gchar *uri)
+ 	return TRUE;
+ }
+ 
+-static GtkWidget *
++static G_GNUC_PRINTF(1, 2) GtkWidget *
+ handle_builder_error (const gchar *message, ...)
+ {
+ 	GtkWidget *label;
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gedit/files/0001-tests-document-saver.c-Define-ACCESSPERMS-if-not-def.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gedit/files/0001-tests-document-saver.c-Define-ACCESSPERMS-if-not-def.patch
new file mode 100644
index 0000000..11afe75
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gedit/files/0001-tests-document-saver.c-Define-ACCESSPERMS-if-not-def.patch
@@ -0,0 +1,31 @@
+From ee43bcc3c8d69fe56a64c3487e2d3c780ea5d25e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Jul 2017 06:53:35 -0700
+Subject: [PATCH] tests/document-saver.c: Define ACCESSPERMS if not defined
+ already
+
+Helps compile with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/document-saver.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/document-saver.c b/tests/document-saver.c
+index 9f44d5a..811ade6 100644
+--- a/tests/document-saver.c
++++ b/tests/document-saver.c
+@@ -41,6 +41,10 @@
+ #define UNOWNED_GROUP_LOCAL_URI "/tmp/gedit-document-saver-unowned-group.txt"
+ #define UNOWNED_GROUP_REMOTE_URI "sftp://localhost/tmp/gedit-document-saver-unowned-group.txt"
+ 
++#if !defined(ACCESSPERMS)
++#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
++#endif
++
+ static gboolean test_completed;
+ static gboolean mount_completed;
+ static gboolean mount_success;
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gedit/gedit_2.30.4.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gedit/gedit_2.30.4.bb
index a6c68d3..5d244de 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gedit/gedit_2.30.4.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gedit/gedit_2.30.4.bb
@@ -3,16 +3,18 @@
 LICENSE = "GPLv2+"
 PR = "r2"
 
-DEPENDS = "gvfs enchant gconf gnome-doc-utils glib-2.0 gtk+ gtksourceview2 iso-codes intltool-native"
+DEPENDS = "gvfs enchant gconf gnome-doc-utils glib-2.0 gtk+ gtksourceview2 iso-codes intltool-native gnome-common-native libice"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
 inherit gnome gettext pythonnative
-SRC_URI+= " \
-    file://0001-workaround-void-pointer-arithmetic.patch \
-    file://0001-Remove-help-directory-from-build.patch \
-    file://0002-suppress-string-format-literal-warning-to-fix-build-.patch \
-"
+SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive \
+           file://0001-workaround-void-pointer-arithmetic.patch \
+           file://0001-Remove-help-directory-from-build.patch \
+           file://0002-suppress-string-format-literal-warning-to-fix-build-.patch \
+           file://0001-tests-document-saver.c-Define-ACCESSPERMS-if-not-def.patch \
+           file://0001-gedit-utils-qualify-handle_builder_error-with-format.patch \
+           "
 SRC_URI[archive.md5sum] = "e1eecb0a92a1a363b3d375ec5ac0fb3b"
 SRC_URI[archive.sha256sum] = "a561fe3dd1d199baede1bd07c4ee65f06fc7c494dd4d3327117f04149a608e3c"
 GNOME_COMPRESS_TYPE="bz2"
@@ -20,5 +22,7 @@
 EXTRA_OECONF = "--disable-scrollkeeper \
                 --enable-gvfs-metadata"
 
+LDFLAGS += "-lgmodule-2.0 -lICE"
+
 FILES_${PN} += "${libdir}/gedit-2/plugin* ${datadir}/gedit-2"
 FILES_${PN}-dbg += "${libdir}/gedit-2/plugin-loaders/.debug ${libdir}/gedit-2/plugins/.debug"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-backgrounds/gnome-backgrounds_2.32.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-backgrounds/gnome-backgrounds_2.32.0.bb
index 2adb81b..235b02a 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-backgrounds/gnome-backgrounds_2.32.0.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-backgrounds/gnome-backgrounds_2.32.0.bb
@@ -17,3 +17,5 @@
 
 FILES_${PN} += "${datadir}/gnome-background-properties"
 
+
+PNBLACKLIST[gnome-backgrounds] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130647/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-bluetooth/gnome-bluetooth_3.18.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-bluetooth/gnome-bluetooth_3.18.2.bb
index fe3e572..8cfd65a 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-bluetooth/gnome-bluetooth_3.18.2.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-bluetooth/gnome-bluetooth_3.18.2.bb
@@ -6,11 +6,12 @@
 
 SECTION = "x11/gnome"
 
-DEPENDS = "udev gtk+3 libnotify libcanberra intltool-native \
+DEPENDS = "udev gtk+3 libnotify libcanberra intltool-native gnome-common-native \
     ${@bb.utils.contains('DISTRO_FEATURES','bluez5','bluez5','bluez4',d)} \
 "
 
-inherit gnomebase gtk-icon-cache gobject-introspection
+inherit gnomebase gtk-icon-cache gobject-introspection distro_features_check
+REQUIRED_DISTRO_FEATURES = "x11"
 
 SRC_URI[archive.md5sum] = "75d09c924468ec0c687f9ab3acf7f113"
 SRC_URI[archive.sha256sum] = "d8df073c331df0f97261869fb77ffcdbf4e3e4eaf460d3c3ed2b16e03d9c5398"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-control-center/gnome-control-center_2.32.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-control-center/gnome-control-center_2.32.1.bb
index 391d0dd..201783e 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-control-center/gnome-control-center_2.32.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-control-center/gnome-control-center_2.32.1.bb
@@ -32,4 +32,4 @@
 FILES_${PN}-dev += "${libdir}/window-manager-settings/*.la"
 FILES_${PN}-staticdev += "${libdir}/window-manager-settings/*.a"
 
-PNBLACKLIST[gnome-control-center] ?= "Depends on broken gnome-menus"
+PNBLACKLIST[gnome-control-center] ?= "Depends on broken gnome-menus - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-desktop/gnome-desktop_2.32.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-desktop/gnome-desktop_2.32.1.bb
index c1a47e0..f1dafad 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-desktop/gnome-desktop_2.32.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-desktop/gnome-desktop_2.32.1.bb
@@ -12,7 +12,7 @@
 SRC_URI[archive.sha256sum] = "55cbecf67efe1fa1e57ac966520a7c46d799c8ba3c652a1219f60cafccb3739d"
 GNOME_COMPRESS_TYPE="bz2"
 
-DEPENDS += "gconf libxrandr virtual/libx11 gtk+ glib-2.0 gnome-doc-utils startup-notification intltool-native"
+DEPENDS += "gconf libxrandr virtual/libx11 gtk+ glib-2.0 gnome-doc-utils startup-notification intltool-native gnome-common-native"
 
 EXTRA_OECONF = "--disable-scrollkeeper --disable-desktop-docs --disable-gnome-about"
 
@@ -24,3 +24,5 @@
 PACKAGES =+ "libgnome-desktop"
 FILES_libgnome-desktop = "${libdir}/lib*${SOLIBS} ${datadir}/libgnome-desktop/pnp.ids"
 FILES_${PN} += "${datadir}/gnome-about"
+
+PNBLACKLIST[gnome-desktop] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130595/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-disk-utility/gnome-disk-utility_2.32.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-disk-utility/gnome-disk-utility_2.32.0.bb
index eac9dbd..55a589c 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-disk-utility/gnome-disk-utility_2.32.0.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-disk-utility/gnome-disk-utility_2.32.0.bb
@@ -3,7 +3,10 @@
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=e9115d11797a5e6b746b4e9b90194564"
 
-DEPENDS = "glib-2.0 gtk+ libnotify libunique udisks avahi-ui virtual/libx11 libatasmart gnome-doc-utils intltool-native libgnome-keyring"
+DEPENDS = "glib-2.0 gtk+ libnotify libunique udisks avahi-ui \
+    virtual/libx11 libatasmart gnome-doc-utils intltool-native \
+    gnome-common-native libgnome-keyring dbus-glib-native \
+"
 
 PR = "r4"
 
@@ -38,3 +41,5 @@
 FILES_${PN}-dev += "${libdir}/nautilus/extensions-2.0/*.la"
 FILES_${PN}-staticdev += "${libdir}/nautilus/extensions-2.0/*.a"
 FILES_${PN}-dbg += "${libdir}/nautilus/extensions-2.0/.debug"
+
+PNBLACKLIST[gnome-disk-utility] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/132824/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-keyring/gnome-keyring_2.32.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-keyring/gnome-keyring_2.32.1.bb
index 100d32e..4ac75cb 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-keyring/gnome-keyring_2.32.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-keyring/gnome-keyring_2.32.1.bb
@@ -42,4 +42,4 @@
                     ${libdir}/${BPN}/devel/.debug/ \
                     ${base_libdir}/security/.debug/"
 
-PNBLACKLIST[gnome-keyring] ?= "This version conflicts with gcr from oe-core"
+PNBLACKLIST[gnome-keyring] ?= "This version conflicts with gcr from oe-core - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-menus/gnome-menus3_3.10.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-menus/gnome-menus3_3.10.1.bb
index bf55197..01da347 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-menus/gnome-menus3_3.10.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-menus/gnome-menus3_3.10.1.bb
@@ -4,23 +4,16 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://COPYING.LIB;md5=5f30f0716dfdd0d91eb439ebec522ec2"
 
-PNBLACKLIST[gnome-menus3] ?= "CONFLICT: 24 files are conflicting with gnome-menus"
-# e.g. sysroots/qemux86-64/usr/share/desktop-directories/X-GNOME-Other.directory
-
-DEPENDS = "python libxml2 gconf popt gtk+3"
+DEPENDS = "python libxml2 gconf popt gtk+3 intltool-native gnome-common-native"
 
 inherit gnomebase pkgconfig python-dir pythonnative gobject-introspection
 
 BPN = "gnome-menus"
 
-SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 SRC_URI = "${GNOME_MIRROR}/${BPN}/${SHRT_VER}/${BPN}-${PV}.tar.xz"
 
 SRC_URI[md5sum] = "6db025e79e2b69f39fc7aa0753f43081"
 SRC_URI[sha256sum] = "46950aba274c1ad58234374fa9b235258650737307f3bc396af48eb983668a71"
 
-PACKAGES += "${PN}-python"
 FILES_${PN} += "${datadir}/desktop-directories/"
-FILES_${PN}-python = "${libdir}/python*"
-FILES_${PN}-dbg += "${PYTHON_SITEPACKAGES_DIR}/*/.debug \
-                    ${PYTHON_SITEPACKAGES_DIR}/.debug"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-menus/gnome-menus_2.30.5.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-menus/gnome-menus_2.30.5.bb
index 4189518..d1c9e4d 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-menus/gnome-menus_2.30.5.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-menus/gnome-menus_2.30.5.bb
@@ -27,4 +27,4 @@
                     ${PYTHON_SITEPACKAGES_DIR}/.debug"
 
 # http://errors.yoctoproject.org/Errors/Details/81001/
-PNBLACKLIST[gnome-menus] ?= "BROKEN: fails to build because of python"
+PNBLACKLIST[gnome-menus] ?= "BROKEN: fails to build because of python + conflicts with gnome-menu3 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-mime-data/gnome-mime-data_2.18.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-mime-data/gnome-mime-data_2.18.0.bb
index a31eb55..eeac1bb 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-mime-data/gnome-mime-data_2.18.0.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-mime-data/gnome-mime-data_2.18.0.bb
@@ -15,5 +15,5 @@
 SRC_URI[archive.sha256sum] = "37196b5b37085bbcd45c338c36e26898fe35dd5975295f69f48028b1e8436fd7"
 GNOME_COMPRESS_TYPE="bz2"
 
-DEPENDS += "shared-mime-info intltool-native"
+DEPENDS += "shared-mime-info intltool-native glib-2.0-native"
 RDEPENDS_${PN} = "shared-mime-info"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-panel/gnome-panel3_3.0.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-panel/gnome-panel3_3.0.2.bb
index 138d985..d1cfab8 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-panel/gnome-panel3_3.0.2.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-panel/gnome-panel3_3.0.2.bb
@@ -4,7 +4,7 @@
 BPN = "gnome-panel"
 PR = "r1"
 
-PNBLACKLIST[gnome-panel3] ?= "CONFLICT: depends on libgweather3 which conflicts with libgweather"
+PNBLACKLIST[gnome-panel3] ?= "CONFLICT: depends on libgweather3 which conflicts with libgweather - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 # conflicts with gnome-panel, because they provide the same package
 # http://patches.openembedded.org/patch/43105/
@@ -48,4 +48,4 @@
                 ${libdir}/bonobo \
 "
 
-PNBLACKLIST[gnome-panel3] ?= "Depends on broken gnome-menus"
+PNBLACKLIST[gnome-panel3] ?= "Depends on broken gnome-menus - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-panel/gnome-panel_2.32.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-panel/gnome-panel_2.32.1.bb
index 2e36063..7cb8b9d 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-panel/gnome-panel_2.32.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-panel/gnome-panel_2.32.1.bb
@@ -45,4 +45,4 @@
                 ${libdir}/bonobo \
 "
 
-PNBLACKLIST[gnome-panel] ?= "Depends on broken libgweather"
+PNBLACKLIST[gnome-panel] ?= "Depends on broken libgweather - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-power-manager/gnome-power-manager_2.32.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-power-manager/gnome-power-manager_2.32.0.bb
index 87bd722..ec21107 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-power-manager/gnome-power-manager_2.32.0.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-power-manager/gnome-power-manager_2.32.0.bb
@@ -51,4 +51,4 @@
 "
 
 # gnome-power-manager-2.32.0/src/gpm-manager.c:488:18: error: too many arguments to function 'notify_notification_new'
-PNBLACKLIST[gnome-power-manager] ?= "BROKEN: not compatible with current libnotify"
+PNBLACKLIST[gnome-power-manager] ?= "BROKEN: not compatible with current libnotify - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-session/gnome-session_2.32.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-session/gnome-session_2.32.1.bb
index 94e0a63..c49f2d3 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-session/gnome-session_2.32.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-session/gnome-session_2.32.1.bb
@@ -29,4 +29,4 @@
 FILES_${PN}-dbg += "${libexecdir}/gnome-session/helpers/.debug"
 
 # http://errors.yoctoproject.org/Errors/Details/68621/
-PNBLACKLIST[gnome-session] ?= "BROKEN: fails to build with gcc-6"
+PNBLACKLIST[gnome-session] ?= "BROKEN: fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-settings-daemon/gnome-settings-daemon_2.32.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-settings-daemon/gnome-settings-daemon_2.32.1.bb
index 393eb25..c1db6d3 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-settings-daemon/gnome-settings-daemon_2.32.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-settings-daemon/gnome-settings-daemon_2.32.1.bb
@@ -16,7 +16,7 @@
 
 S = "${WORKDIR}/git"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)}"
 PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio glib-2.0 libcanberra"
 PACKAGECONFIG[smartcard] = "--enable-smartcard-support,--disable-smartcard-support,nss"
 
@@ -40,3 +40,7 @@
 FILES_${PN}-dev += "${libdir}/gnome-settings-daemon-2.0/*.la"
 FILES_${PN}-staticdev += "${libdir}/gnome-settings-daemon-2.0/*.a"
 
+
+PNBLACKLIST[gnome-settings-daemon] ?= "Depends on blacklisted libgnomekbd - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[gnome-settings-daemon] ?= "Depends on blacklisted gnome-desktop - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-system-monitor/gnome-system-monitor_2.28.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-system-monitor/gnome-system-monitor_2.28.2.bb
index 58ebd98..4b397bf 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-system-monitor/gnome-system-monitor_2.28.2.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-system-monitor/gnome-system-monitor_2.28.2.bb
@@ -4,7 +4,7 @@
 SECTION = "x11/gnome"
 PR = "r2"
 
-DEPENDS = "libgtop gtkmm glibmm gnome-doc-utils libwnck gtk+ dbus-glib librsvg intltool-native"
+DEPENDS = "libgtop gtkmm glibmm gnome-doc-utils libwnck gtk+ dbus-glib librsvg intltool-native gnome-common-native"
 
 inherit gnome
 SRC_URI[archive.md5sum] = "3f0bca9b0ebc7a365466851cd580d167"
@@ -32,3 +32,4 @@
 FILES_${PN}-doc += "${datadir}/omf \
                     ${datadir}/gnome/help "
 
+PNBLACKLIST[gnome-system-monitor] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/131635/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-vfs/gnome-vfs_2.24.4.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-vfs/gnome-vfs_2.24.4.bb
index 1c78474..3ec6466 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-vfs/gnome-vfs_2.24.4.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome-vfs/gnome-vfs_2.24.4.bb
@@ -9,7 +9,7 @@
                     file://daemon/vfs-daemon.c;endline=21;md5=5f2c61553fb16abb07fc9498ca03fe1f \
                     file://modules/cdda-cddb.h;endline=22;md5=20ed324ca64907c366ecd7f22b8e0c54"
 
-DEPENDS = "libxml2 gconf dbus bzip2 gnome-mime-data zlib intltool-native"
+DEPENDS = "libxml2 gconf dbus bzip2 gnome-mime-data zlib intltool-native gnome-common-native"
 RRECOMMENDS_${PN} = "gnome-vfs-plugin-file shared-mime-info"
 # Some legacy packages will require gnome-mime-data to be installed, but use of
 # it is deprecated.
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/gnome-terminal_2.30.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/gnome-terminal_2.30.2.bb
index 18e74da..6b3bf76 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/gnome-terminal_2.30.2.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/gnome-terminal_2.30.2.bb
@@ -19,4 +19,4 @@
 RRECOMMENDS_${PN} += "gnome-common-schemas"
 
 # http://errors.yoctoproject.org/Errors/Details/68636/
-PNBLACKLIST[gnome-terminal] ?= "BROKEN: fails to build with gcc-6"
+PNBLACKLIST[gnome-terminal] ?= "BROKEN: fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/libgnomecups_0.2.3.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/libgnomecups_0.2.3.bb
index 2caa820..3480712 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/libgnomecups_0.2.3.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/libgnomecups_0.2.3.bb
@@ -22,4 +22,4 @@
 SRC_URI[archive.sha256sum] = "e130e80942b386de19a288a4c194ff3dbe9140315b31e982058c8bffbb6a1d29"
 GNOME_COMPRESS_TYPE="bz2"
 
-PNBLACKLIST[libgnomecups] ?= "Depends on broken libgnomeui"
+PNBLACKLIST[libgnomecups] ?= "Depends on blacklisted libgnomeui - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/libgnomeprint_2.18.8.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/libgnomeprint_2.18.8.bb
index ff14616..a462a4b 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/libgnomeprint_2.18.8.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnome/libgnomeprint_2.18.8.bb
@@ -25,4 +25,4 @@
     ${libdir}/${PN}/${PV}/modules/*/*.a \
 "
 
-PNBLACKLIST[libgnomeprint] ?= "Depends on broken libgnomecups"
+PNBLACKLIST[libgnomeprint] ?= "Depends on broken libgnomecups - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnumeric/gnumeric_1.12.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnumeric/gnumeric_1.12.0.bb
index 5d1d251..49d0fe9 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnumeric/gnumeric_1.12.0.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gnumeric/gnumeric_1.12.0.bb
@@ -46,4 +46,4 @@
         prepend=True)
 }
 
-PNBLACKLIST[gnumeric] ?= "Depends on broken libgnomeprint"
+PNBLACKLIST[gnumeric] ?= "Depends on broken libgnomeprint - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gthumb/gthumb_2.12.4.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gthumb/gthumb_2.12.4.bb
index 5eee7f0..62d3df9 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gthumb/gthumb_2.12.4.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gthumb/gthumb_2.12.4.bb
@@ -2,7 +2,7 @@
 SECTION = "x11/gnome"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-DEPENDS = "glib-2.0 gtk+ libxml2 gnome-doc-utils libunique gconf libpng gstreamer jpeg tiff gst-plugins-base intltool-native"
+DEPENDS = "gnome-common-native glib-2.0 gtk+ libxml2 gnome-doc-utils libunique gconf libpng gstreamer jpeg tiff gst-plugins-base intltool-native gconf-native"
 
 PR = "r4"
 
@@ -31,3 +31,5 @@
 FILES_${PN}-dev += "${libdir}/${BPN}/extensions/*.la"
 FILES_${PN}-dbg += "${libdir}/${BPN}/extensions/.debug/"
 
+
+PNBLACKLIST[gthumb] ?= "Depends on blacklisted gstreamer - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb
index c0ac911..83aa749 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb
@@ -6,7 +6,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
 SECTION = "x11/base"
-DEPENDS = "intltool-native gtk+ gettext-native"
+DEPENDS = "intltool-native gtk+ gettext-native glib-2.0-native"
 
 PR = "r3"
 
@@ -41,8 +41,8 @@
 UPSTREAM_CHECK_REGEX = "(?P<pver>2\.([0-8]*[02468])+(\.\d+)+)"
 
 python populate_packages_prepend() {
-    engines_root = os.path.join(d.getVar('libdir', True), "gtk-2.0/2.10.0/engines")
-    themes_root = os.path.join(d.getVar('datadir', True), "themes")
+    engines_root = os.path.join(d.getVar('libdir'), "gtk-2.0/2.10.0/engines")
+    themes_root = os.path.join(d.getVar('datadir'), "themes")
 
     do_split_packages(d, engines_root, '^lib(.*)\.so$', 'gtk-engine-%s', 'GTK %s theme engine', extra_depends='')
     do_split_packages(d, themes_root, '(.*)', 'gtk-theme-%s', 'GTK theme %s', allow_dirs=True, extra_depends='')
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtksourceview/gtksourceview2/0001-test-widget.c-fix-non-literal-format-string-issues.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtksourceview/gtksourceview2/0001-test-widget.c-fix-non-literal-format-string-issues.patch
new file mode 100644
index 0000000..6118b67
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtksourceview/gtksourceview2/0001-test-widget.c-fix-non-literal-format-string-issues.patch
@@ -0,0 +1,31 @@
+From 0781b218beb8ba160ea223ff3d74a4fa2abf86fa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Apr 2017 16:21:14 -0700
+Subject: [PATCH] test-widget.c: fix non-literal format string issues
+
+clang errors out when using -Werror=format-nonliteral
+since the definition of g_strdup_vprintf() from glib-2.0
+is using va_list and clang seems to still warn where as
+gcc doesn't do that for va_list arguments
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/test-widget.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test-widget.c b/tests/test-widget.c
+index 46f5f4e..3f2e60f 100644
+--- a/tests/test-widget.c
++++ b/tests/test-widget.c
+@@ -260,7 +260,7 @@ static const gchar *buffer_ui_description =
+ 
+ /* File loading code ----------------------------------------------------------------- */
+ 
+-static void
++static void G_GNUC_PRINTF (2, 0)
+ error_dialog (GtkWindow *parent, const gchar *msg, ...)
+ {
+ 	va_list ap;
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtksourceview/gtksourceview2_2.10.5.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtksourceview/gtksourceview2_2.10.5.bb
index df37b04..012f8e3 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtksourceview/gtksourceview2_2.10.5.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gtksourceview/gtksourceview2_2.10.5.bb
@@ -4,7 +4,7 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
-DEPENDS = "gtk+ libxml2 intltool-native"
+DEPENDS = "gtk+ libxml2 intltool-native gnome-common-native glib-2.0-native"
 
 PNAME = "gtksourceview"
 
@@ -18,7 +18,8 @@
 SRC_URI = "${GNOME_MIRROR}/${PNAME}/${@gnome_verdir("${PV}")}/${PNAME}-${PV}.tar.bz2;name=archive \
            file://gtk-doc.make \
            file://suppress-string-format-literal-warning.patch \
-"
+           file://0001-test-widget.c-fix-non-literal-format-string-issues.patch \
+           "
 SRC_URI[archive.md5sum] = "1219ad1694df136f126507466aeb41aa"
 SRC_URI[archive.sha256sum] = "c585773743b1df8a04b1be7f7d90eecdf22681490d6810be54c81a7ae152191e"
 
@@ -29,4 +30,3 @@
 }
 
 FILES_${PN} += " ${datadir}/gtksourceview-2.0"
-
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gvfs/gvfs_1.28.3.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gvfs/gvfs_1.28.3.bb
index 746d73c..62b757f 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gvfs/gvfs_1.28.3.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gvfs/gvfs_1.28.3.bb
@@ -40,7 +40,7 @@
 
 RRECOMMENDS_gvfsd-ftp += "openssh-sftp openssh-ssh"
 
-PACKAGECONFIG ?= "libgphoto2 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG ?= "libgphoto2 ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 
 PACKAGECONFIG[afc] = "--enable-afc, --disable-afc, libimobiledevice libplist"
 PACKAGECONFIG[archive] = "--enable-archive, --disable-archive, libarchive"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gweather/libgweather3_3.0.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gweather/libgweather3_3.0.2.bb
index 6e1997f..6920f0a 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gweather/libgweather3_3.0.2.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gweather/libgweather3_3.0.2.bb
@@ -4,7 +4,7 @@
 SECTION = "x11/gnome/libs"
 DEPENDS = "libxml2 gconf libsoup-2.4 gtk+3"
 
-PNBLACKLIST[libgweather3] ?= "CONFLICT: 876 files are conflicting with libgweather"
+PNBLACKLIST[libgweather3] ?= "CONFLICT: 876 files are conflicting with libgweather - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 # e.g. sysroots/qemux86-64/usr/share/libgweather/locations.dtd
 #      sysroots/qemux86-64/usr/share/libgweather/Locations.zh_TW.xml
 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gweather/libgweather_2.30.3.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gweather/libgweather_2.30.3.bb
index 71fe545..8b69f1f 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gweather/libgweather_2.30.3.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/gweather/libgweather_2.30.3.bb
@@ -21,4 +21,4 @@
 FILES_${PN}-locationdata = "${datadir}/libgweather/Locations*"
 
 # http://errors.yoctoproject.org/Errors/Details/68608/
-PNBLACKLIST[libgweather] ?= "BROKEN: fails to build with gcc-6"
+PNBLACKLIST[libgweather] ?= "BROKEN: fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgdata/libgdata_0.16.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgdata/libgdata_0.16.1.bb
index 6ec6d46..c2157df 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgdata/libgdata_0.16.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgdata/libgdata_0.16.1.bb
@@ -7,7 +7,7 @@
                     file://gdata/gdata.h;endline=20;md5=079a554efcf65d46f96a515806e7e99a \
                     file://gdata/gdata-types.h;endline=20;md5=7399b111aac8718da13888fc634be6ef"
 
-DEPENDS = "libxml2 glib-2.0 libsoup-2.4 intltool-native liboauth gcr json-glib"
+DEPENDS = "gnome-common-native libxml2 glib-2.0 libsoup-2.4 intltool-native liboauth gcr json-glib"
 
 inherit gnomebase pkgconfig autotools-brokensep gettext gtk-doc vala gobject-introspection
 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnome_2.32.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnome_2.32.1.bb
index 40caa7b..0055ba4 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnome_2.32.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnome_2.32.1.bb
@@ -12,7 +12,7 @@
 SRC_URI += "file://0001-libgnome-Makefile.am-allow-deprecated-symbols.patch"
 GNOME_COMPRESS_TYPE="bz2"
 
-DEPENDS += "libcanberra gconf-native gnome-vfs libbonobo esound intltool-native"
+DEPENDS += "libcanberra gconf-native gnome-vfs libbonobo esound intltool-native gnome-common-native"
 
 EXTRA_OECONF += "--disable-gtk-doc"
 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomecanvas_2.30.3.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomecanvas_2.30.3.bb
index a0f0b51..41a89ce 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomecanvas_2.30.3.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomecanvas_2.30.3.bb
@@ -8,7 +8,7 @@
 # intltool to provide IT_PROG_INTLTOOL
 # configure: line 12654: syntax error near unexpected token `0.35.0'
 # configure: line 12654: `IT_PROG_INTLTOOL(0.35.0)'
-DEPENDS = "gtk+ libglade libart-lgpl xineramaproto intltool-native"
+DEPENDS = "gtk+ libglade libart-lgpl xineramaproto intltool-native gnome-common-native"
 
 SRC_URI[archive.md5sum] = "ffcbb719c671ff5cd86e59aeba8d0b92"
 SRC_URI[archive.sha256sum] = "859b78e08489fce4d5c15c676fec1cd79782f115f516e8ad8bed6abcb8dedd40"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomekbd_2.32.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomekbd_2.32.0.bb
index f357657..852d8e1 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomekbd_2.32.0.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomekbd_2.32.0.bb
@@ -4,7 +4,7 @@
 
 SECTION = "x11/gnome/libs"
 
-DEPENDS = "gconf gtk+ glib-2.0 libxklavier intltool-native"
+DEPENDS = "gconf gtk+ glib-2.0 libxklavier intltool-native gnome-common-native"
 
 inherit gnome
 
@@ -17,3 +17,4 @@
     find ${B} -name Makefile | xargs sed -i s:'-I/usr/include':'-I${STAGING_INCDIR}':g
 }
 
+PNBLACKLIST[libgnomekbd] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130608/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomeui_2.24.5.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomeui_2.24.5.bb
index 94b00c1..45219d4 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomeui_2.24.5.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgnome/libgnomeui_2.24.5.bb
@@ -3,7 +3,7 @@
 LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=55ca817ccb7d5b5b66355690e9abc605"
 
 SECTION = "x11/gnome/libs"
-DEPENDS = "libgnome libgnomecanvas libbonoboui libgnome-keyring intltool-native"
+DEPENDS = "libgnome libgnomecanvas libbonoboui libgnome-keyring intltool-native gnome-common-native"
 
 inherit gnome
 
@@ -27,3 +27,5 @@
 do_configure_prepend() {
     install -m 0644 ${WORKDIR}/gnome-stock-pixbufs.h ${S}/libgnomeui/pixmaps/gnome-stock-pixbufs.h
 }
+
+LDFLAGS += "-lm"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgsf/libgsf_1.14.29.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgsf/libgsf_1.14.29.bb
index 602d513..f5e2f1d 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgsf/libgsf_1.14.29.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgsf/libgsf_1.14.29.bb
@@ -5,7 +5,7 @@
 
 SECTION = "libs"
 
-DEPENDS= "libxml2 bzip2 glib-2.0 zlib intltool-native"
+DEPENDS= "libxml2 bzip2 glib-2.0 zlib intltool-native gnome-common-native"
 
 inherit autotools pkgconfig gnome gconf gobject-introspection
 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgtop/libgtop/0001-netload-Include-libc-net-headers-unconditionally.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgtop/libgtop/0001-netload-Include-libc-net-headers-unconditionally.patch
new file mode 100644
index 0000000..c4f7da4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgtop/libgtop/0001-netload-Include-libc-net-headers-unconditionally.patch
@@ -0,0 +1,46 @@
+From 3c6f70e50cb586ac4add4dea627c316242691040 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Jul 2017 09:17:29 -0700
+Subject: [PATCH] netload: Include libc net headers unconditionally
+
+This fixes compile with musl, and this conditional
+is not needed now a days if we are still using glibc < 1.0
+we have other bigger problems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/linux/netload.c | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/sysdeps/linux/netload.c b/sysdeps/linux/netload.c
+index c275db2..446bddd 100644
+--- a/sysdeps/linux/netload.c
++++ b/sysdeps/linux/netload.c
+@@ -34,8 +34,6 @@
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ 
+-#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
+-/* GNU LibC */
+ #include <net/if.h>
+ #include <netinet/ip_icmp.h>
+ #include <netinet/in.h>
+@@ -43,15 +41,6 @@
+ #include <netinet/tcp.h>
+ #include <netinet/udp.h>
+ #include <net/if.h>
+-#else /* Libc 5 */
+-#include <linux/if.h>
+-#include <linux/in.h>
+-#include <linux/ip.h>
+-#include <linux/icmp.h>
+-#include <linux/tcp.h>
+-#include <linux/udp.h>
+-#endif
+-
+ 
+ #ifdef HAVE_IFADDRS_H
+ /* needed for IPV6 support */
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgtop/libgtop_2.30.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgtop/libgtop_2.30.0.bb
index d79b9e5..946d118 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgtop/libgtop_2.30.0.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libgtop/libgtop_2.30.0.bb
@@ -6,6 +6,9 @@
 # depends on libxau
 REQUIRED_DISTRO_FEATURES = "x11"
 
+SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive \
+           file://0001-netload-Include-libc-net-headers-unconditionally.patch \
+           "
 SRC_URI[archive.md5sum] = "ee29a9ef60659ebf4b075ac281f71cb2"
 SRC_URI[archive.sha256sum] = "463bcbe5737b1b93f3345ee34abf601e8eb864f507c49ff1921c2737abafc1e5"
 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libidl/libidl-native_0.8.14.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libidl/libidl-native_0.8.14.bb
index a27da5e..2252c44 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libidl/libidl-native_0.8.14.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libidl/libidl-native_0.8.14.bb
@@ -4,7 +4,7 @@
 
 PR = "r1"
 
-DEPENDS = "bison-native glib-2.0-native"
+DEPENDS = "bison-native glib-2.0-native flex-native"
 
 SRC_URI[md5sum] = "bb8e10a218fac793a52d404d14adedcb"
 SRC_URI[sha256sum] = "c5d24d8c096546353fbc7cedf208392d5a02afe9d56ebcc1cccb258d7c4d2220"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libwnck/libwnck3_3.20.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libwnck/libwnck3_3.20.1.bb
new file mode 100644
index 0000000..02149fb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libwnck/libwnck3_3.20.1.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Window navigation construction toolkit"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+BPN = "libwnck"
+
+SECTION = "x11/libs"
+DEPENDS = "intltool-native gnome-common-native gtk+3 gdk-pixbuf-native libxres"
+
+PACKAGECONFIG ??= "startup-notification"
+PACKAGECONFIG[startup-notification] = "--enable-startup-notification,--disable-startup-notification,startup-notification"
+
+inherit gnomebase gobject-introspection gtk-doc
+SRC_URI[archive.md5sum] = "487938d65d4bfae1f2501052b1bd7492"
+SRC_URI[archive.sha256sum] = "1cb03716bc477058dfdf3ebfa4f534de3b13b1aa067fcd064d0b7813291cba72"
+
+inherit distro_features_check
+# libxres means x11 only
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libwnck/libwnck_2.31.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libwnck/libwnck_2.31.0.bb
index 83e8468..ea4c8df 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libwnck/libwnck_2.31.0.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libwnck/libwnck_2.31.0.bb
@@ -3,7 +3,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
 
 SECTION = "x11/libs"
-DEPENDS = "intltool-native gtk+ gdk-pixbuf-native libxres"
+DEPENDS = "intltool-native gnome-common-native gtk+ gdk-pixbuf-native libxres"
 
 PACKAGECONFIG ??= "startup-notification"
 PACKAGECONFIG[startup-notification] = "--enable-startup-notification,--disable-startup-notification,startup-notification"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libxklavier/files/fix-do_installe-failure.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libxklavier/files/fix-do_installe-failure.patch
new file mode 100644
index 0000000..29eeef3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libxklavier/files/fix-do_installe-failure.patch
@@ -0,0 +1,36 @@
+From 2343283caf88d2390afee08fe034b4c970b20f2e Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Sat, 16 Apr 2016 06:40:04 -0400
+Subject: [PATCH] fix do_installe failure
+
+| 18  /usr/bin/install -c -m 644 ../../libxklavier-5.4/libxklavier/libxklavier.vapi
+libxklavier.deps 'tmp/work/corei7-64-wrs-linux/libxklavier/5.4-r0/image/
+usr/share/vala/vapi'
+| 19 /usr/bin/install: cannot stat '../../libxklavier-5.4/libxklavier/
+libxklavier.vapi': No such file or directory
+| 20 Makefile:621: recipe for target 'install-vapiDATA' failed
+| 21 make[3]: *** [install-vapiDATA] Error 1
+| 22 make[3]: *** Waiting for unfinished jobs....
+
+Upstream-Stauts: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libxklavier/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libxklavier/Makefile.am b/libxklavier/Makefile.am
+index c9c1bbe..f0efa32 100644
+--- a/libxklavier/Makefile.am
++++ b/libxklavier/Makefile.am
+@@ -131,6 +131,6 @@ libxklavier.deps:
+ 	done
+ 
+ vapidir = $(datadir)/vala/vapi
+-vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
++vapi_DATA = $(VAPIGEN_VAPIS:.vapi=.deps)
+ endif
+ endif
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libxklavier/libxklavier_5.3.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libxklavier/libxklavier_5.3.bb
deleted file mode 100644
index 23e6603..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libxklavier/libxklavier_5.3.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-SUMMARY = "Helper lib for keyboard management"
-LICENSE = "LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=6e29c688d912da12b66b73e32b03d812"
-
-DEPENDS = "xkbcomp gtk+ iso-codes libxi libxml2"
-
-GNOME_COMPRESS_TYPE = "xz"
-inherit gnomebase gettext gobject-introspection distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "x11"
-
-inherit gnomebase gettext gobject-introspection
-SRC_URI[archive.md5sum] = "290ea2a8abc40f78a3a16bdae6f02808"
-SRC_URI[archive.sha256sum] = "ebec3bc54b5652838502b96223152fb1cd8fcb14ace5cb02d718fc3276bbd404"
-
-EXTRA_OECONF = "--with-xkb-bin-base=${bindir}"
-
-do_configure_append() {
-    find ${B} -name Makefile | xargs sed -i s:'-I$(includedir)':'-I.':g
-    find ${B} -name Makefile | xargs sed -i s:'-I/usr/include':'-I${STAGING_INCDIR}':g
-}
-
-do_compile_append() {
-    sed -i -e s:${STAGING_DIR_TARGET}::g \
-           -e s:/${TARGET_SYS}::g \
-              libxklavier.pc
-}
-
-
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libxklavier/libxklavier_5.4.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libxklavier/libxklavier_5.4.bb
new file mode 100644
index 0000000..2ef54f2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/libxklavier/libxklavier_5.4.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Helper lib for keyboard management"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=6e29c688d912da12b66b73e32b03d812"
+
+DEPENDS = "xkbcomp gtk+ iso-codes libxi libxml2"
+
+inherit autotools pkgconfig gettext gobject-introspection distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
+
+RDEPENDS_${PN} += "iso-codes xkbcomp"
+
+SRC_URI = " \
+    http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BPN}-${PV}.tar.bz2/13af74dcb6011ecedf1e3ed122bd31fa/${BPN}-${PV}.tar.bz2 \
+    file://fix-do_installe-failure.patch \
+"
+SRC_URI[md5sum] = "13af74dcb6011ecedf1e3ed122bd31fa"
+SRC_URI[sha256sum] = "17a34194df5cbcd3b7bfd0f561d95d1f723aa1c87fca56bc2c209514460a9320"
+
+FILES_${PN} += "${datadir}/*"
+
+EXTRA_OECONF = "--with-xkb-bin-base=${bindir}"
+
+do_configure_append() {
+    find ${B} -name Makefile | xargs sed -i s:'-I$(includedir)':'-I.':g
+    find ${B} -name Makefile | xargs sed -i s:'-I/usr/include':'-I${STAGING_INCDIR}':g
+}
+
+do_compile_append() {
+    sed -i -e s:${STAGING_DIR_TARGET}::g \
+           -e s:/${TARGET_SYS}::g \
+              libxklavier.pc
+}
+
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/metacity/metacity/0001-ui-Define-_GNU_SOURCE.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/metacity/metacity/0001-ui-Define-_GNU_SOURCE.patch
new file mode 100644
index 0000000..539d756
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/metacity/metacity/0001-ui-Define-_GNU_SOURCE.patch
@@ -0,0 +1,27 @@
+From e7fd072f0df968f342878b77098e97ff07ed28d7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 10:26:31 -0700
+Subject: [PATCH] ui: Define _GNU_SOURCE
+
+it becomes portable across musl and glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/ui/theme.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/ui/theme.c b/src/ui/theme.c
+index 84b57a0..c7eafc8 100644
+--- a/src/ui/theme.c
++++ b/src/ui/theme.c
+@@ -60,6 +60,7 @@
+ #include <gtk/gtk.h>
+ #include <string.h>
+ #include <stdlib.h>
++#define _GNU_SOURCE
+ #define __USE_XOPEN
+ #include <math.h>
+ 
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/metacity/metacity_2.34.13.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/metacity/metacity_2.34.13.bb
index 662c90d..370de70 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/metacity/metacity_2.34.13.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/metacity/metacity_2.34.13.bb
@@ -13,7 +13,10 @@
 
 GNOME_COMPRESS_TYPE = "xz"
 
-SRC_URI += "file://remove-yelp-help-rules-var.patch"
+SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive \
+           file://remove-yelp-help-rules-var.patch \
+           file://0001-ui-Define-_GNU_SOURCE.patch \
+           "
 SRC_URI[archive.md5sum] = "6d89b71672d4fa49fc87f83d610d0ef6"
 SRC_URI[archive.sha256sum] = "8cf4dbf0da0a6f36357ce7db7f829ec685908a7792453c662fb8184572b91075"
 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/nautilus/nautilus3_3.2.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/nautilus/nautilus3_3.2.1.bb
index 4655c83..5580f93 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/nautilus/nautilus3_3.2.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/nautilus/nautilus3_3.2.1.bb
@@ -51,4 +51,4 @@
 
 # 3.2.1-r4/nautilus-3.2.1/eel/eel-gnome-extensions.c:34:50: fatal error: libgnome-desktop/gnome-desktop-utils.h: No such file or directory
 # 3.2.1-r4/nautilus-3.2.1/eel/eel-editable-label.c:3105:55: error: 'GTK_STOCK_CUT' undeclared (first use in this function)
-PNBLACKLIST[nautilus3] ?= "BROKEN: fails to build, maybe missing dependency on gnome-desktop-utils.h provider"
+PNBLACKLIST[nautilus3] ?= "BROKEN: fails to build, maybe missing dependency on gnome-desktop-utils.h provider - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/nautilus/nautilus_2.32.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/nautilus/nautilus_2.32.2.bb
index d29385e..caf7f57 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/nautilus/nautilus_2.32.2.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/nautilus/nautilus_2.32.2.bb
@@ -39,3 +39,5 @@
 # Don't make nautils3 drag us in
 PRIVATE_LIBS = "libnautilus-extension.so.1"
 
+
+PNBLACKLIST[nautilus] ?= "Depends on blacklisted gnome-desktop - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/orbit2/orbit2_2.14.19.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/orbit2/orbit2_2.14.19.bb
index 1afcd49..f9af2ee 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/orbit2/orbit2_2.14.19.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/orbit2/orbit2_2.14.19.bb
@@ -3,7 +3,7 @@
 LICENSE = "GPL-2.0"
 LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
 SRC_NAME = "ORBit2"
-SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 SRC_URI = " \
     ${GNOME_MIRROR}/${SRC_NAME}/${SHRT_VER}/${SRC_NAME}-${PV}.tar.bz2 \
     file://configure-lossage.patch \
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/contacts_0.9.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/contacts_0.9.bb
index bdc7f48..516cf93 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/contacts_0.9.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/contacts_0.9.bb
@@ -16,3 +16,5 @@
     # It used 8 spaces to instead of a tab, but it doesn't work for us
     sed -i 's/^        $(MAKE) dist distdir=/\t$(MAKE) dist distdir/' Makefile.am
 }
+
+PNBLACKLIST[contacts] ?= "Fails to fetch, pimlico-project.org is gone http://errors.yoctoproject.org/Errors/Details/132854/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/contacts_git.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/contacts_git.bb
index 8a4a071..b46e9d9 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/contacts_git.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/contacts_git.bb
@@ -16,4 +16,4 @@
 
 S = "${WORKDIR}/git"
 
-
+PNBLACKLIST[contacts] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/132826/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates/0001-Fix-format-security-warnings.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates/0001-Fix-format-security-warnings.patch
new file mode 100644
index 0000000..4f551a7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates/0001-Fix-format-security-warnings.patch
@@ -0,0 +1,54 @@
+From 687881c5fa342686c8724adcdac0f9d555a351c3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Apr 2017 18:10:57 -0700
+Subject: [PATCH] Fix format security warnings
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/dates_callbacks.c | 2 +-
+ src/dates_gtk.c       | 2 +-
+ src/gconf-bridge.c    | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/dates_callbacks.c b/src/dates_callbacks.c
+index d704c8f..46b8cb1 100644
+--- a/src/dates_callbacks.c
++++ b/src/dates_callbacks.c
+@@ -365,7 +365,7 @@ dates_about_cb (GtkWidget *widget, DatesData *d)
+ 
+ 	if (!pixb) {
+ 		g_assert (error);
+-		g_warning (error->message);
++		g_warning ("%s", error->message);
+ 		g_clear_error (&error);
+ 	}
+ 
+diff --git a/src/dates_gtk.c b/src/dates_gtk.c
+index 403bc25..fd691d2 100644
+--- a/src/dates_gtk.c
++++ b/src/dates_gtk.c
+@@ -1114,7 +1114,7 @@ calendar_do_edit_dialog_response_cb (GtkDialog *dialog, gint response_id, gpoint
+ 				GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ 				GTK_MESSAGE_WARNING,
+ 				GTK_BUTTONS_NONE,
+-				prompt);
++				"%s", prompt);
+ 
+ 		g_free (prompt);
+ 
+diff --git a/src/gconf-bridge.c b/src/gconf-bridge.c
+index 49754cf..67d3757 100644
+--- a/src/gconf-bridge.c
++++ b/src/gconf-bridge.c
+@@ -1220,7 +1220,7 @@ error_handler (GConfClient *client,
+                 dlg = gtk_message_dialog_new (NULL, 0,
+                                               GTK_MESSAGE_ERROR,
+                                               GTK_BUTTONS_OK,
+-                                              message);
++                                              "%s", message);
+                 g_free (message);
+ 
+                 gtk_message_dialog_format_secondary_text
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates/0001-Update-to-new-evolution-data-server-e_source_-color-.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates/0001-Update-to-new-evolution-data-server-e_source_-color-.patch
deleted file mode 100644
index 4550d29..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates/0001-Update-to-new-evolution-data-server-e_source_-color-.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From a8ddfc4b91f2ab3d955fe528ddb98ce2c5545795 Mon Sep 17 00:00:00 2001
-From: Martin Jansa <Martin.Jansa@gmail.com>
-Date: Sun, 4 Aug 2013 13:44:50 +0200
-Subject: [PATCH] Update to new evolution-data-server e_source_*color APIs
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
----
- src/dates_gtk.c  | 6 +++---
- src/dates_main.c | 2 +-
- src/dates_view.c | 6 +++++-
- 3 files changed, 9 insertions(+), 5 deletions(-)
-
-diff --git a/src/dates_gtk.c b/src/dates_gtk.c
-index 78e71bb..ac539d2 100644
---- a/src/dates_gtk.c
-+++ b/src/dates_gtk.c
-@@ -1072,7 +1072,7 @@ calendar_do_new_dialog (GtkWindow *parent, DatesData *d)
- #endif
- 
- 			/* Set the colour */
--			e_source_set_color (source, new_colour);
-+			e_source_set_color_spec (source, new_colour);
- 
- 			/* Set the group for the source */
- 			e_source_set_group (source, group);
-@@ -1335,7 +1335,7 @@ calendar_do_edit_dialog (GtkWindow *parent, ESource *source, DatesData *d)
- 	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- 
- 	/* Get the colour from the the source */
--	e_source_get_color (source, &raw_colour);
-+	raw_colour = e_source_peek_color_spec (source);
- 
- 	/* Munge this into something usable */
- 	colour.red = (guint16)(((raw_colour & 0xff0000) >> 16) << 8);
-@@ -1459,7 +1459,7 @@ calendar_do_edit_dialog (GtkWindow *parent, ESource *source, DatesData *d)
- 			new_colour <<= 8;
- #endif
- 			/* Update the colour */
--			e_source_set_color (source, new_colour);
-+			e_source_set_color_spec (source, new_colour);
- 
- 			/* And the name */
- 			e_source_set_name (source, (gtk_entry_get_text (GTK_ENTRY (name_entry))));
-diff --git a/src/dates_main.c b/src/dates_main.c
-index ce05fe8..7273c63 100644
---- a/src/dates_main.c
-+++ b/src/dates_main.c
-@@ -112,7 +112,7 @@ dates_load_calendars (DatesData *d)
- 		system_source = e_source_new (_("Personal"), "system");
- 
- 		/* Default Evolution colour */
--		e_source_set_color (system_source, 0xBECEDD);
-+		e_source_set_color_spec (system_source, 0xBECEDD);
- 
- 		/* Set the group for the source and put it in the group */
- 		e_source_set_group (system_source, local_group);
-diff --git a/src/dates_view.c b/src/dates_view.c
-index d65db2f..f8efb9c 100644
---- a/src/dates_view.c
-+++ b/src/dates_view.c
-@@ -4876,7 +4880,7 @@ dates_view_add_calendar (DatesView *view, ECal *ecal)
- 	cal->text_gc = gdk_gc_new (
- 		GDK_DRAWABLE (priv->main->window));
- 
--	if (e_source_get_color (source, &colour)) {
-+	if (colour = e_source_peek_color_spec (source)) {
- 		GdkColor gcolour, dgcolour, tgcolour;
- 		gcolour.red = ((colour & 0xFF0000) >> 16) * 0x101;
- 		gcolour.green = ((colour & 0xFF00) >> 8)  * 0x101;
--- 
-1.8.3.2
-
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates/make-382.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates/make-382.patch
deleted file mode 100644
index fad3c58..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates/make-382.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Make 3.82 is offended by the use of spaces instead of tabs. This has been fixed
-in upstream git.
-
-JL - 15/12/10
-
-Upstream-Status: Accepted
-
-Index: git/Makefile.am
-===================================================================
---- git.orig/Makefile.am
-+++ git/Makefile.am
-@@ -7,5 +7,5 @@ DISTCLEANFILES = intltool-extract intlto
- MAINTAINERCLEANFILES = $(DISTCLEANFILES) aclocal.m4 compile config.guess config.sub configure depcomp install-sh ltmain.sh Makefile.in missing
- 
- snapshot:
--        $(MAKE) dist distdir=$(PACKAGE)-snap`date +"%Y%m%d"`
-+	$(MAKE) dist distdir=$(PACKAGE)-snap`date +"%Y%m%d"`
- 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates_git.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates_git.bb
index a4a572f..14965e9 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates_git.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/dates_git.bb
@@ -5,15 +5,14 @@
                     file://src/dates_hildon.c;endline=19;md5=63938904198b25de429abb65fbdbdb8a \
                     file://src/gconf-bridge.c;endline=22;md5=ad7626c6daf4aec590474a243f4912fa"
 
-SRCREV = "514185dc1f6588085fda41eb59898b93d0487dd4"
+SRCREV = "c8e30fa3211dcdfcda48184f4c57746a552b9c7a"
 PV = "0.4.11+git${SRCPV}"
 PR = "r9"
 
 S = "${WORKDIR}/git"
 
 SRC_URI = "git://git.gnome.org/${BPN} \
-    file://make-382.patch \
-    file://dso_linking_change_build_fix.patch \
-    file://uclibc-NL_TIME_FIRST_WEEKDAY-absent.patch \
-    file://0001-Update-to-new-evolution-data-server-e_source_-color-.patch \
-"
+           file://dso_linking_change_build_fix.patch \
+           file://uclibc-NL_TIME_FIRST_WEEKDAY-absent.patch \
+           file://0001-Fix-format-security-warnings.patch \
+           "
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/tasks_0.19.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/tasks_0.19.bb
index 47b0980..42c20c4 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/tasks_0.19.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/tasks_0.19.bb
@@ -13,4 +13,4 @@
 PR = "r3"
 
 # tasks-0.19/libkoto/koto-utils.c:81:3: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
-PNBLACKLIST[tasks] ?= "Fails to build with gcc-6"
+PNBLACKLIST[tasks] ?= "Fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/tasks_git.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/tasks_git.bb
index 32d2ac6..b71f1dc 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/tasks_git.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/pimlico/tasks_git.bb
@@ -9,4 +9,4 @@
 S = "${WORKDIR}/git"
 
 # ../../git/libkoto/koto-utils.c:81:3: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
-PNBLACKLIST[tasks] ?= "Fails to build with gcc-6"
+PNBLACKLIST[tasks] ?= "Fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/system-tools/system-tools-backends_2.10.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/system-tools/system-tools-backends_2.10.2.bb
index 745b558..862c0ea 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/system-tools/system-tools-backends_2.10.2.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/system-tools/system-tools-backends_2.10.2.bb
@@ -51,4 +51,4 @@
 FILES_${PN} += " ${datadir}/system-tools-backends-2.0/scripts"
 FILES_${PN} += " ${datadir}/polkit*"
 
-PNBLACKLIST[system-tools-backends] ?= "does not build with distroless qemuarm as reported in 'State of bitbake world' thread, nobody volunteered to fix them"
+PNBLACKLIST[system-tools-backends] ?= "does not build with distroless qemuarm as reported in 'State of bitbake world' thread, nobody volunteered to fix them - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/themes/gnome-themes_2.32.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/themes/gnome-themes_2.32.1.bb
index 8c39ad7..1a89f48 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/themes/gnome-themes_2.32.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/themes/gnome-themes_2.32.1.bb
@@ -5,7 +5,10 @@
 PR = "r3"
 
 SECTION = "x11/gnome"
-DEPENDS = "gtk-engines icon-naming-utils icon-naming-utils-native glib-2.0 intltool-native libxml-simple-perl-native"
+DEPENDS = "gtk-engines icon-naming-utils icon-naming-utils-native \
+           glib-2.0 intltool-native libxml-simple-perl-native \
+           glib-2.0-native \
+"
 RDEPENDS_${PN} = "adwaita-icon-theme"
 
 EXTRA_OECONF += "--enable-all-themes \
@@ -31,3 +34,4 @@
 SRC_URI[archive.md5sum] = "41db9e3cb25d35af2675c599e67944d1"
 SRC_URI[archive.sha256sum] = "8601ee24c2e096593221cbd6ebdb6686042225a03c02a01c0d67c163f9febd1a"
 GNOME_COMPRESS_TYPE="bz2"
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/wv/wv-1.2.4/0001-wvRTF.c-Specify-print-format-in-rtf_output.patch b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/wv/wv-1.2.4/0001-wvRTF.c-Specify-print-format-in-rtf_output.patch
new file mode 100644
index 0000000..2fc3f36
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/wv/wv-1.2.4/0001-wvRTF.c-Specify-print-format-in-rtf_output.patch
@@ -0,0 +1,26 @@
+From 079529b8d5e339e2211fa2f8c15543a738a627bc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 14:50:51 -0700
+Subject: [PATCH] wvRTF.c: Specify print format in rtf_output()
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ wvRTF.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/wvRTF.c b/wvRTF.c
+index 361d258..4f24b30 100644
+--- a/wvRTF.c
++++ b/wvRTF.c
+@@ -192,7 +192,7 @@ output_rtfUserData (rtfUserData * ud)
+     rtf_output_char ('{');
+ 
+     /* font color */
+-    rtf_output (rtfColors[ud->cCol]);
++    rtf_output ("%s", rtfColors[ud->cCol]);
+ 
+     /* font face */
+     rtf_output ("\\f%d", ud->cFont);
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/wv/wv_1.2.4.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/wv/wv_1.2.4.bb
index 6489c6f..8ed1fcd 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/wv/wv_1.2.4.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/wv/wv_1.2.4.bb
@@ -8,7 +8,8 @@
 SRC_URI = "${SOURCEFORGE_MIRROR}/wvware/wv-${PV}.tar.gz \
            file://pkgconfig.patch \
            file://0001-configure-use-foreign-mode-to-avoid-errors-with-miss.patch \
-          "
+           file://0001-wvRTF.c-Specify-print-format-in-rtf_output.patch \
+           "
 
 SRC_URI[md5sum] = "c1861c560491f121e12917fa76970ac5"
 SRC_URI[sha256sum] = "673109910e22d4cf94cc8be4dcb9a0c41b5fbdb1736d4b7bdc7778894d57c2d6"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/zenity/zenity_2.32.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/zenity/zenity_2.32.1.bb
index 4e01c5c..bd9f7a0 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-gnome/zenity/zenity_2.32.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-gnome/zenity/zenity_2.32.1.bb
@@ -4,7 +4,7 @@
 
 PR = "r2"
 
-PNBLACKLIST[zenity] ?= "BROKEN: doesn't build with B!=S"
+PNBLACKLIST[zenity] ?= "BROKEN: doesn't build with B!=S - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 DEPENDS = "gtk+ glib-2.0 libnotify gnome-doc-utils"
 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-support/florence/florence_0.5.4.bb b/import-layers/meta-openembedded/meta-gnome/recipes-support/florence/florence_0.5.4.bb
index dfdb6bd..8ce85c9 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-support/florence/florence_0.5.4.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-support/florence/florence_0.5.4.bb
@@ -8,7 +8,7 @@
 
 PR = "r1"
 
-DEPENDS = "gtk+ libxml2 libglade librsvg libxtst gconf cairo intltool-native gnome-doc-utils libnotify gstreamer"
+DEPENDS = "gtk+ libxml2 libglade librsvg libxtst gconf gconf-native cairo intltool-native gnome-doc-utils libnotify gstreamer"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/florence/florence/${PV}-gtk2/florence-${PV}.tar.bz2 \
            file://fix-no-atspi-compile.patch"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice/c99math.patch b/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice/c99math.patch
deleted file mode 100644
index 24e6c31..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice/c99math.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: goffice-0.7.14/configure.in
-===================================================================
---- goffice-0.7.14.orig/configure.in	2009-11-14 19:14:37.106109501 +0100
-+++ goffice-0.7.14/configure.in	2009-11-14 19:19:40.907333188 +0100
-@@ -66,6 +66,7 @@
- 
- AC_ISC_POSIX
- AC_PROG_CC
-+AC_PROG_CC_C99
- AC_PROG_YACC
- AM_PROG_LEX
- AC_PROG_LN_S
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice/nodolt.patch b/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice/nodolt.patch
deleted file mode 100644
index ea1777a..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice/nodolt.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: goffice-0.7.14/configure.in
-===================================================================
---- goffice-0.7.14.orig/configure.in
-+++ goffice-0.7.14/configure.in
-@@ -71,7 +71,6 @@ AC_PROG_YACC
- AM_PROG_LEX
- AC_PROG_LN_S
- AM_PROG_LIBTOOL
--DOLT
- AC_STDC_HEADERS
- AC_SYS_LARGEFILE
- 
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice/pcre-8.30.patch b/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice/pcre-8.30.patch
deleted file mode 100644
index ae9370c..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice/pcre-8.30.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Taken from http://trac.macports.org/ticket/34812
-
-Fixes abiword build failing with:
-/usr/lib/libgoffice-0.8.so: undefined reference to `pcre_info'
-
-Upstream-Status: pending
-
-http://www.linuxfromscratch.org/blfs/view/cvs/x/goffice.html
---- a/goffice/utils/regutf8.c.orig	2009-09-05 18:52:09.000000000 -0500
-+++ b/goffice/utils/regutf8.c	2012-06-09 18:04:29.000000000 -0500
-@@ -155,7 +155,7 @@
- 		default: return GO_REG_BADPAT;
- 		}
- 	} else {
--		gor->re_nsub = pcre_info (r, NULL, NULL);
-+		gor->re_nsub = pcre_fullinfo (r, NULL, 0, NULL);
- 		gor->nosub = (cflags & GO_REG_NOSUB) != 0;
- 		return 0;
- 	}
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice_0.10.1.bb b/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice_0.10.1.bb
index ab20460..6a2080d 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice_0.10.1.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-support/goffice/goffice_0.10.1.bb
@@ -48,4 +48,4 @@
 }
 
 # | ../../goffice-0.10.1/goffice/math/go-complex.c:75:3: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
-PNBLACKLIST[goffice] ?= "BROKEN: fails to build with gcc-6"
+PNBLACKLIST[goffice] ?= "BROKEN: fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-support/onboard/onboard_1.3.0.bb b/import-layers/meta-openembedded/meta-gnome/recipes-support/onboard/onboard_1.3.0.bb
new file mode 100644
index 0000000..bdf0a4e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-support/onboard/onboard_1.3.0.bb
@@ -0,0 +1,25 @@
+SUMMARY = "An onscreen keyboard"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING.GPL3;md5=8521fa4dd51909b407c5150498d34f4e"
+
+DEPENDS += "gtk+3 hunspell libcanberra libxkbfile dconf python3-distutils-extra-native intltool-native"
+
+SRC_URI = "https://launchpad.net/onboard/1.3/${PV}/+download/${BPN}-${PV}.tar.gz"
+SRC_URI[md5sum] = "8000df3e789512a90fcb227580fd60ff"
+SRC_URI[sha256sum] = "fd74b54b8bd7a075cf5f6e1a8ca3e6de5cd2663507adb690d7b1a85e71afa2e4"
+
+inherit setuptools3 pkgconfig gtk-icon-cache gsettings
+
+FILES_${PN} += " \
+    ${datadir}/dbus-1 \
+    ${datadir}/icons \
+    ${datadir}/gnome-shell \
+    ${datadir}/help \
+"
+
+RDEPENDS_${PN} += " \
+    ncurses \
+    python3-dbus \
+    python3-pycairo \
+    python3-pygobject \
+"
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-support/tracker/tracker-0.14.2/0005-Fix-missing-gobject-introspection-checks.patch b/import-layers/meta-openembedded/meta-gnome/recipes-support/tracker/tracker-0.14.2/0005-Fix-missing-gobject-introspection-checks.patch
deleted file mode 100644
index 8701f58..0000000
--- a/import-layers/meta-openembedded/meta-gnome/recipes-support/tracker/tracker-0.14.2/0005-Fix-missing-gobject-introspection-checks.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff -Naur ../tracker-0.10.8/configure.ac tracker-0.10.8//configure.ac
---- ../tracker-0.10.8/configure.ac	2011-04-08 15:03:30.000000000 +0300
-+++ tracker-0.10.8//configure.ac	2011-04-11 13:47:16.625914002 +0300
-@@ -218,7 +218,12 @@
- 
- # Needed to generate .gir files,
- # see http://live.gnome.org/GnomeGoals/AddGObjectIntrospectionSupport
--GOBJECT_INTROSPECTION_CHECK([0.9.5])
-+#GOBJECT_INTROSPECTION_CHECK([0.9.5])
-+# Satisfy missing introspection foo
-+AM_CONDITIONAL(HAVE_INTROSPECTION, test "0" == "1")
-+
-+INTROSPECTION_CFLAGS=""
-+AC_SUBST(INTROSPECTION_CFLAGS)
- 
- # NOTE: dbus and dbus-glib-1 are only used now for libtracker-client
- # which is deprecated and tracker-writeback which will be refactored
diff --git a/import-layers/meta-openembedded/meta-gnome/recipes-support/tracker/tracker_0.14.2.bb b/import-layers/meta-openembedded/meta-gnome/recipes-support/tracker/tracker_0.14.2.bb
index 7025280..eb36a12 100644
--- a/import-layers/meta-openembedded/meta-gnome/recipes-support/tracker/tracker_0.14.2.bb
+++ b/import-layers/meta-openembedded/meta-gnome/recipes-support/tracker/tracker_0.14.2.bb
@@ -85,4 +85,4 @@
 SRC_URI[sha256sum] = "9b59330aa2e9e09feee587ded895e9247f71fc25f46b023d616d9969314bc7f1"
 
 # http://errors.yoctoproject.org/Errors/Details/81007/
-PNBLACKLIST[tracker] ?= "BROKEN: fails to build with new binutils-2.27"
+PNBLACKLIST[tracker] ?= "BROKEN: fails to build with new binutils-2.27 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gpe/README b/import-layers/meta-openembedded/meta-gpe/README
index af7d98f..fd2997d 100644
--- a/import-layers/meta-openembedded/meta-gpe/README
+++ b/import-layers/meta-openembedded/meta-gpe/README
@@ -1,18 +1,17 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: morty
+branch: pyro
 revision: HEAD
 
 URI: git://github.com/openembedded/meta-oe.git
-branch: morty
+branch: pyro
 revision: HEAD
 
-Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-gpe]' in the subject'
+Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-gpe][pyro]' in the subject'
 
 When sending single patches, please using something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-gpe][PATCH'
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-gpe][pyro][PATCH'
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
-
diff --git a/import-layers/meta-openembedded/meta-gpe/recipes-graphics/gpe-scap/gpe-scap_1.4.bb b/import-layers/meta-openembedded/meta-gpe/recipes-graphics/gpe-scap/gpe-scap_1.4.bb
index 3f1e27e..db50e38 100644
--- a/import-layers/meta-openembedded/meta-gpe/recipes-graphics/gpe-scap/gpe-scap_1.4.bb
+++ b/import-layers/meta-openembedded/meta-gpe/recipes-graphics/gpe-scap/gpe-scap_1.4.bb
@@ -21,3 +21,4 @@
 
 RREPLACES_${PN} = "gpe-screenshot"
 
+PNBLACKLIST[gpe-scap] ?= "Depends on blacklisted libgpewidget - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gpe/recipes-graphics/libgpewidget/libgpewidget_0.117.bb b/import-layers/meta-openembedded/meta-gpe/recipes-graphics/libgpewidget/libgpewidget_0.117.bb
index 87a3ed0..31e247e 100644
--- a/import-layers/meta-openembedded/meta-gpe/recipes-graphics/libgpewidget/libgpewidget_0.117.bb
+++ b/import-layers/meta-openembedded/meta-gpe/recipes-graphics/libgpewidget/libgpewidget_0.117.bb
@@ -21,3 +21,5 @@
 LDFLAGS += " -L${STAGING_LIBDIR}"
 
 PACKAGES =+ "${PN}-bin"
+
+PNBLACKLIST[libgpewidget] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130594/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gpe/recipes-graphics/minilite/minilite_0.50.bb b/import-layers/meta-openembedded/meta-gpe/recipes-graphics/minilite/minilite_0.50.bb
index 90960a2..8e064fd 100644
--- a/import-layers/meta-openembedded/meta-gpe/recipes-graphics/minilite/minilite_0.50.bb
+++ b/import-layers/meta-openembedded/meta-gpe/recipes-graphics/minilite/minilite_0.50.bb
@@ -14,3 +14,5 @@
 SRC_URI[sha256sum] = "2b299425203246090a4949e034f1d0efb3ff99cd1591d0e16c57370a530b361e"
 
 export CVSBUILD="no"
+
+PNBLACKLIST[minilite] ?= "Depends on blacklisted libgpewidget - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gpe/recipes-support/fbreader/fbreader_0.12.10.bb b/import-layers/meta-openembedded/meta-gpe/recipes-support/fbreader/fbreader_0.12.10.bb
index f8ecc93..2dbcef4 100644
--- a/import-layers/meta-openembedded/meta-gpe/recipes-support/fbreader/fbreader_0.12.10.bb
+++ b/import-layers/meta-openembedded/meta-gpe/recipes-support/fbreader/fbreader_0.12.10.bb
@@ -42,3 +42,5 @@
 
 SRC_URI[md5sum] = "da9ec4721efdb0ec0aaa182bff16ad82"
 SRC_URI[sha256sum] = "328aec454db80e225aa0b5c31adef74bf62a14357482947e87e9731686b3c624"
+
+PNBLACKLIST[fbreader] ?= "Depends on blacklisted libgpewidget - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-gpe/recipes-support/fbreader/fbreader_git.bb b/import-layers/meta-openembedded/meta-gpe/recipes-support/fbreader/fbreader_git.bb
index 1ed6584..b3e7946 100644
--- a/import-layers/meta-openembedded/meta-gpe/recipes-support/fbreader/fbreader_git.bb
+++ b/import-layers/meta-openembedded/meta-gpe/recipes-support/fbreader/fbreader_git.bb
@@ -42,4 +42,4 @@
 }
 
 # http://errors.yoctoproject.org/Errors/Details/68618/
-PNBLACKLIST[fbreader] ?= "BROKEN: fails to build with gcc-6"
+PNBLACKLIST[fbreader] ?= "BROKEN: fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-initramfs/README b/import-layers/meta-openembedded/meta-initramfs/README
index 906a859..9c05e1fd 100644
--- a/import-layers/meta-openembedded/meta-initramfs/README
+++ b/import-layers/meta-openembedded/meta-initramfs/README
@@ -12,7 +12,7 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: morty
+branch: pyro
 revision: HEAD
 
 
@@ -20,12 +20,12 @@
 -----------
 
 Send patches / pull requests to openembedded-devel@lists.openembedded.org
-with '[meta-initramfs]' in the subject.
+with '[meta-initramfs][pyro]' in the subject.
 
 When sending single patches, please using something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-initramfs][morty][PATCH'
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-initramfs][pyro][PATCH'
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
 
 
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb
index 45ff50d..835b307 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-image.bb
@@ -3,10 +3,13 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
+inherit image
+
 IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
 
 # avoid circular dependencies
 EXTRA_IMAGEDEPENDS = ""
+KERNELDEPMODDEPEND = ""
 
 # We really need just kexecboot, kexec and ubiattach
 IMAGE_INSTALL = "kexecboot kexec mtd-utils-ubifs"
@@ -18,7 +21,8 @@
 
 FEED_DEPLOYDIR_BASE_URI = ""
 LDCONFIGDEPEND = ""
-
 IMAGE_ROOTFS_EXTRA_SPACE = "0"
 
-inherit image
+# disable runtime dependency on run-postinsts -> update-rc.d
+ROOTFS_BOOTSTRAP_INSTALL = ""
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb
index da3023f..6b845bd 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/images/initramfs-kexecboot-klibc-image.bb
@@ -7,7 +7,6 @@
 IMAGE_INSTALL = "kexecboot-klibc kexec-klibc ubiattach-klibc"
 
 python () {
-    if d.getVar('TARGET_ARCH', True) == "nios2":
+    if d.getVar('TARGET_ARCH') == "nios2":
         raise bb.parse.SkipPackage("'nios2' not supported arch")
 }
-
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb
index 69f3872..085955c 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-bsp/kexecboot/kexecboot-cfg_0.2.bb
@@ -57,4 +57,4 @@
 INHIBIT_DEFAULT_DEPS = "1"
 
 # Note: for qvga the label is currently limited to about 24 chars
-KEXECBOOT_LABEL ?= "${@d.getVar('DISTRO', True) or d.getVar('DISTRO_VERSION', True)}-${MACHINE}"
+KEXECBOOT_LABEL ?= "${@d.getVar('DISTRO') or d.getVar('DISTRO_VERSION')}-${MACHINE}"
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb
index c806370..b91f3fa 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/dracut/dracut_git.bb
@@ -27,7 +27,7 @@
                "
 
 # RDEPEND on systemd optionally
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,,systemd"
 
 EXTRA_OEMAKE += 'libdir=${prefix}/lib'
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.4.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.4.bb
index 2f4afce..b285b2e 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.4.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.4.bb
@@ -3,6 +3,10 @@
 require klibc.inc
 DEPENDS = "klibc"
 
+# no packaging for this crossscript
+PACKAGES = ""
+inherit nopackages
+
 FILESPATH =. "${FILE_DIRNAME}/klibc-${PV}:"
 
 SRC_URI += "file://use-env-for-perl.patch"
@@ -17,24 +21,14 @@
 do_install() {
     install -d ${D}${bindir_crossscripts}/
     install -m 0755 klcc/klcc ${D}${bindir_crossscripts}/${TARGET_PREFIX}klcc
-    # Insert an unencoded path as a comment to trigger the sstate renaming functions
-    sed -i '2i #${STAGING_DIR_TARGET}' ${D}${bindir_crossscripts}/${TARGET_PREFIX}klcc
+    # Turn the horribly encoded paths into something which sstate can transform using its ususal
+    # magic by removing all the crazy escaping.
+    sed -i -e "2i \$TARGETSYSROOT = '${STAGING_DIR_TARGET}';" \
+           -e "2i \$NATIVESYSROOT = '${STAGING_DIR_NATIVE}';" \
+           -e 's#${@d.getVar("STAGING_DIR_NATIVE", True).replace("/", "\\\\/").replace("-", "\\\\-").replace(".", "\\\\.")}#${NATIVESYSROOT}#g;' \
+           -e 's#${@d.getVar("STAGING_DIR_TARGET", True).replace("/", "\\\\/").replace("-", "\\\\-").replace(".", "\\\\.")}#${TARGETSYSROOT}#g' \
+        ${D}${bindir_crossscripts}/${TARGET_PREFIX}klcc
 }
 
-SYSROOT_PREPROCESS_FUNCS += "klcc_sysroot_preprocess"
-
-klcc_sysroot_preprocess () {
-       sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
-}
-
-deltask do_package
-deltask do_packagedata
-deltask do_package_write_ipk
-deltask do_package_write_rpm
-deltask do_package_write_deb
-deltask do_package_write_tar
-
-SSTATE_SCAN_FILES = "*"
-EXTRA_STAGING_FIXMES = "MANGLEDSTAGINGDIRTARGET MANGLEDSTAGINGDIR"
-MANGLEDSTAGINGDIR = "${@d.getVar("STAGING_DIR", True).replace("/", "\\\\/").replace("-", "\\\\-")}"
-MANGLEDSTAGINGDIRTARGET = "${@d.getVar("STAGING_DIR_TARGET", True).replace("/", "\\\\/").replace("-", "\\\\-")}"
+SYSROOT_DIRS += "${bindir_crossscripts}"
+SSTATE_SCAN_FILES += "*-klcc"
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch
new file mode 100644
index 0000000..8d1ec69
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch
@@ -0,0 +1,85 @@
+From f414dea1316a48aba3e8e293201ebd51652d3ef4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 9 Jul 2017 15:17:29 -0700
+Subject: [PATCH] Define in_* structs for non-glibc system libs
+
+These defines and structs are required to be coming from
+userspace netinet/in.h, which is being overridden in klibc
+however, libc-compat.h from kernel is only written keeping
+glibc in mind, and does not provide adequate guards for musl
+to infer that these structs should be defined in linux/in.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usr/include/netinet/in.h | 33 +++++++++++++++++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+
+Index: git/usr/include/netinet/in.h
+===================================================================
+--- git.orig/usr/include/netinet/in.h
++++ git/usr/include/netinet/in.h
+@@ -5,6 +5,42 @@
+ #ifndef _NETINET_IN_H
+ #define _NETINET_IN_H
+ 
++#ifndef __GLIBC__
++#include <linux/libc-compat.h>
++
++#undef __UAPI_DEF_IN_ADDR
++#undef __UAPI_DEF_IN_IPPROTO
++#undef __UAPI_DEF_IN_PKTINFO
++#undef __UAPI_DEF_IP_MREQ
++#undef __UAPI_DEF_SOCKADDR_IN
++#undef __UAPI_DEF_IN_CLASS
++#undef __UAPI_DEF_IN6_ADDR
++#undef __UAPI_DEF_IN6_ADDR_ALT
++#undef __UAPI_DEF_SOCKADDR_IN6
++#undef __UAPI_DEF_IPV6_MREQ
++#undef __UAPI_DEF_IPPROTO_V6
++#undef __UAPI_DEF_IPV6_OPTIONS
++#undef __UAPI_DEF_IN6_PKTINFO
++#undef __UAPI_DEF_IP6_MTUINFO
++#undef __UAPI_DEF_IF_IFREQ
++
++#define __UAPI_DEF_IN_ADDR      1
++#define __UAPI_DEF_IN_IPPROTO   1
++#define __UAPI_DEF_IN_PKTINFO   1
++#define __UAPI_DEF_IP_MREQ      1
++#define __UAPI_DEF_SOCKADDR_IN  1
++#define __UAPI_DEF_IN_CLASS     1
++#define __UAPI_DEF_IN6_ADDR     1
++#define __UAPI_DEF_IN6_ADDR_ALT 1
++#define __UAPI_DEF_SOCKADDR_IN6 1
++#define __UAPI_DEF_IPV6_MREQ    1
++#define __UAPI_DEF_IPPROTO_V6   1
++#define __UAPI_DEF_IPV6_OPTIONS 1
++#define __UAPI_DEF_IN6_PKTINFO  1
++#define __UAPI_DEF_IP6_MTUINFO  1
++#define __UAPI_DEF_IF_IFREQ     1
++#endif
++
+ #include <klibc/extern.h>
+ #include <stdint.h>
+ #include <endian.h>		/* Must be included *before* <linux/in.h> */
+Index: git/usr/include/net/if.h
+===================================================================
+--- git.orig/usr/include/net/if.h
++++ git/usr/include/net/if.h
+@@ -1,6 +1,17 @@
+ #ifndef _NET_IF_H
+ #define _NET_IF_H
+ 
++#ifndef __GLIBC__
++#include <linux/libc-compat.h>
++#undef __UAPI_DEF_IF_IFREQ
++#define __UAPI_DEF_IF_IFREQ            1
++#undef __UAPI_DEF_IF_IFNAMSIZ
++#define __UAPI_DEF_IF_IFNAMSIZ         1
++#undef __UAPI_DEF_IF_IFMAP
++#define __UAPI_DEF_IF_IFMAP            1
++#undef __UAPI_DEF_IF_NET_DEVICE_FLAGS
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
++#endif
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ #include <linux/if.h>
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-always-use-bfd-linker.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-always-use-bfd-linker.patch
new file mode 100644
index 0000000..41a6b9e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-always-use-bfd-linker.patch
@@ -0,0 +1,30 @@
+From 9ea19bd9636806a73bcf29cfcee40a268f91eb4c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 11 Jul 2017 08:09:52 -0700
+Subject: [PATCH] always use bfd linker
+
+its possible that distros choose to default to gold linker
+therefore explicitly asking for bfd linker would fix the
+linking issues on such distros
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index dc10fc5d..40647be4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -20,7 +20,7 @@ include $(srctree)/scripts/Kbuild.include
+ KLIBCROSS	?= $(CROSS_COMPILE)
+ export KLIBCROSS
+ export CC	:= $(KLIBCROSS)gcc
+-export LD	:= $(KLIBCROSS)ld
++export LD	:= $(KLIBCROSS)ld.bfd
+ export AR	:= $(KLIBCROSS)ar
+ export RANLIB	:= $(KLIBCROSS)ranlib
+ export STRIP	:= $(KLIBCROSS)strip
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-dash-Specify-format-string-in-fmtstr.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-dash-Specify-format-string-in-fmtstr.patch
new file mode 100644
index 0000000..ae8c1f1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-dash-Specify-format-string-in-fmtstr.patch
@@ -0,0 +1,31 @@
+From 2fff607fd0b5550e5072a6fffcbb01c29d5207d2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 9 Jul 2017 13:51:25 -0700
+Subject: [PATCH] dash: Specify format string in fmtstr()
+
+Fixes build with hardening flags
+
+usr/dash/jobs.c:429:3: error: format not a string literal and no format arguments [-Werror=format-security]
+   col = fmtstr(s, 32, strsignal(st));
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usr/dash/jobs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c
+index 009bbfee..299bcacc 100644
+--- a/usr/dash/jobs.c
++++ b/usr/dash/jobs.c
+@@ -426,7 +426,7 @@ sprint_status(char *s, int status, int sigonly)
+ 				goto out;
+ #endif
+ 		}
+-		col = fmtstr(s, 32, strsignal(st));
++		col = fmtstr(s, 32, "%s", strsignal(st));
+ #ifdef WCOREDUMP
+ 		if (WCOREDUMP(status)) {
+ 			col += fmtstr(s + col, 16, " (core dumped)");
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-include-linux-sysinfo.h-directly.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-include-linux-sysinfo.h-directly.patch
new file mode 100644
index 0000000..1b033ac
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-include-linux-sysinfo.h-directly.patch
@@ -0,0 +1,32 @@
+From ab060a57b41f989665ade20e813bbcb67f91f1f2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 9 Jul 2017 15:56:28 -0700
+Subject: [PATCH] include linux/sysinfo.h directly
+
+This is done to avoid the kernel header linux/kernel.h to use
+__GLIBC__ define to decide on if libc implements sysinfo() API
+or not. Kernel headers should be independent of such assumptions
+but until its done in right place, change the local header
+override to avoid this assumption
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usr/include/sys/sysinfo.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usr/include/sys/sysinfo.h b/usr/include/sys/sysinfo.h
+index dba68dc6..d145c0b1 100644
+--- a/usr/include/sys/sysinfo.h
++++ b/usr/include/sys/sysinfo.h
+@@ -5,7 +5,7 @@
+ #ifndef _SYS_SYSINFO_H
+ #define _SYS_SYSINFO_H
+ 
+-#include <linux/kernel.h>
++#include <linux/sysinfo.h>
+ 
+ extern int sysinfo(struct sysinfo *info);
+ 
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-mkfifo-Implement-mkfifo.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-mkfifo-Implement-mkfifo.patch
new file mode 100644
index 0000000..9791412
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-mkfifo-Implement-mkfifo.patch
@@ -0,0 +1,29 @@
+From b4e120f5edf06e6df138b1804a8b5180584cea6b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 10 Jul 2017 20:42:50 -0700
+Subject: [PATCH] mkfifo: Implement mkfifo
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usr/utils/mkfifo.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/usr/utils/mkfifo.c b/usr/utils/mkfifo.c
+index 5a758b2a..f1f577e6 100644
+--- a/usr/utils/mkfifo.c
++++ b/usr/utils/mkfifo.c
+@@ -26,6 +26,11 @@ static int make_fifo(char *dir)
+ 	return 0;
+ }
+ 
++int mkfifo (const char *__p, mode_t __m)
++{
++	return mknod(__p, (__m & ~S_IFMT) | S_IFIFO, (dev_t) 0);
++}
++
+ int main(int argc, char *argv[])
+ {
+ 	int c, ret = 0;
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc.inc b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc.inc
index f00e31a..cd3f398 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc.inc
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/klibc/klibc.inc
@@ -7,20 +7,28 @@
 DEPENDS = "linux-libc-headers perl-native"
 SRCREV = "4d19974d7020488f63651244e1f9f51727c3f66c"
 
-SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git"
-SRC_URI_append_linux-gnueabi = " file://klibc-config-eabi.patch \
-                                 file://armv4-fix-v4bx.patch \
-                                 "
-SRC_URI_append_linux-uclibceabi = " file://klibc-config-eabi.patch \
-                                    file://armv4-fix-v4bx.patch \
-                                    "
-SRC_URI += "file://klibc-linux-libc-dev.patch \
-            file://staging.patch \
-            file://klcc-consider-sysroot.patch \
-            "
+SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git \
+           ${ARMPATCHES} \
+           file://klibc-linux-libc-dev.patch \
+           file://staging.patch \
+           file://klcc-consider-sysroot.patch \
+           file://0001-dash-Specify-format-string-in-fmtstr.patch \
+           file://0001-Define-in_-structs-for-non-glibc-system-libs.patch \
+           file://0001-include-linux-sysinfo.h-directly.patch \
+           file://0001-mkfifo-Implement-mkfifo.patch \
+           file://0001-always-use-bfd-linker.patch \
+"
+
+ARMPATCHES ?= ""
+
+ARMPATCHES_arm = "file://klibc-config-eabi.patch \
+                  file://armv4-fix-v4bx.patch \
+                 "
+
 
 S = "${WORKDIR}/git"
 
+PARALLEL_MAKE = ""
 EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \
                 'CROSS_COMPILE=${TARGET_PREFIX}' \
                 'KLIBCKERNELSRC=${STAGING_DIR_TARGET}${exec_prefix}' \
@@ -29,9 +37,12 @@
                 'INSTALLROOT=${D}' \
                 'INSTALLDIR=${libdir}/klibc' \
                 'SHLIBDIR=${libdir}' \
+                '${KLIBCTHUMB}' \
+                'KLIBCOPTFLAGS=${TUNE_CCARGS}' \
                 "
 
 export FIX_ARMV4_EABI_BX = "${FIX_V4BX}"
+KLIBCTHUMB = "${@['CONFIG_KLIBC_THUMB=n', 'CONFIG_KLIBC_THUMB=y'][(d.getVar('ARM_INSTRUCTION_SET') == 'thumb')]}"
 
 do_configure () {
     ln -sf "${STAGING_DIR_TARGET}${exec_prefix}" linux
@@ -50,3 +61,6 @@
 KLIBC_ARCH_powerpc = "ppc"
 KLIBC_ARCH_powerpc64 = "ppc64"
 THIS_LIBKLIBC = "libklibc (= ${PV}-${PR})"
+
+SECURITY_CFLAGS = "-fno-PIE -no-pie"
+SECURITY_LDFLAGS = "-no-pie"
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.1.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.1.bb
index 8ca1ca7..8674077 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.1.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.1.bb
@@ -21,6 +21,7 @@
 S = "${WORKDIR}/git/"
 
 EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
+CFLAGS += "${TUNE_CCARGS}"
 
 do_install () {
 
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/0001-Adjust-the-order-of-headers-to-fix-build-for-musl.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/0001-Adjust-the-order-of-headers-to-fix-build-for-musl.patch
new file mode 100644
index 0000000..a7600b3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/0001-Adjust-the-order-of-headers-to-fix-build-for-musl.patch
@@ -0,0 +1,30 @@
+From 86b962e7c0de43b20b6210d059e4855ce87078bc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Jul 2017 16:20:08 -0700
+Subject: [PATCH] Adjust the order of headers to fix build for musl
+
+Fixes
+kexec/ifdown.c:33:16: error: storage size of 'ifc' isn't known
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ kexec/ifdown.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kexec/ifdown.c b/kexec/ifdown.c
+index 2215798..e13f777 100644
+--- a/kexec/ifdown.c
++++ b/kexec/ifdown.c
+@@ -16,8 +16,8 @@ char *v_ifdown = "@(#)ifdown.c  1.11  02-Jun-1998  miquels@cistron.nl";
+ #include <sys/time.h>
+ #include <errno.h>
+ 
+-#include <net/if.h>
+ #include <netinet/in.h>
++#include <net/if.h>
+ 
+ #define MAX_IFS	64
+ 
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb
index c9fec25..49c53a3 100644
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb
+++ b/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb
@@ -20,6 +20,7 @@
             file://sha256.patch \
             file://sysconf_nrprocessors.patch \
             file://fix-out-of-tree-build.patch \
+            file://0001-Adjust-the-order-of-headers-to-fix-build-for-musl.patch \
             "
 
 SRC_URI_append_arm = " file://arm_crashdump.patch"
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot/revert-check-console.patch b/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot/revert-check-console.patch
deleted file mode 100644
index 5e5e8d9..0000000
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot/revert-check-console.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From a74e0bf51adcc867b73fc44050eb9bde985c9cba Mon Sep 17 00:00:00 2001
-From: Andrea Adami <andrea.adami@gmail.com>
-Date: Sun, 28 Feb 2016 01:09:19 +0100
-Subject: [PATCH] main.c: revert check on console device
-
-Fix kernel panic because of the missing /dev/console.
-
-Revert Yocto-specific : "check console device file on fs when booting".
-
-The initramfs used in this kernel needs to be of the smallest possible
-size so we save a few kb by deploying an empty /dev which is populated
-after boot by the init (kexecboot checks and recreates the devices
-with or without devtmpfs).
-
-Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
----
- init/main.c | 7 -------
- 1 file changed, 7 deletions(-)
-
-diff --git a/init/main.c b/init/main.c
-index d191d2a..9e64d70 100644
---- a/init/main.c
-+++ b/init/main.c
-@@ -976,7 +976,6 @@ static int __ref kernel_init(void *unused)
- 
- static noinline void __init kernel_init_freeable(void)
- {
--	struct stat console_stat;
- 	/*
- 	 * Wait until kthreadd is all set-up.
- 	 */
-@@ -1008,12 +1007,6 @@ static noinline void __init kernel_init_freeable(void)
- 
- 	do_basic_setup();
- 
--	/* Use /dev/console to infer if the rootfs is setup properly */
--	if (sys_newlstat((char __user *) "/dev/console", (struct stat __user *) &console_stat)
--			|| !S_ISCHR(console_stat.st_mode)) {
--		panic("/dev/console is missing or not a character device!\nPlease ensure your rootfs is properly configured\n");
--	}
--
- 	/* Open the /dev/console on the rootfs, this should never fail */
- 	if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
- 		pr_err("Warning: unable to open an initial console.\n");
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_4.4.bb b/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_4.4.bb
deleted file mode 100644
index 66e0e53..0000000
--- a/import-layers/meta-openembedded/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_4.4.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-require recipes-kernel/linux/linux-yocto-tiny_${PV}.bb
-SUMMARY = "Yocto tiny kernel embedding a minimalistic kexecboot initramfs"
-
-SRC_URI += "file://revert-check-console.patch"
-
-PACKAGES = ""
-PROVIDES = ""
-
-KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-yocto-tiny-kexecboot-${PV}-${MACHINE}"
-KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-yocto-tiny-kexecboot-${MACHINE}"
-
-INITRAMFS_IMAGE = "initramfs-kexecboot-klibc-image"
-INITRAMFS_TASK = "${INITRAMFS_IMAGE}:do_image_complete"
-
-# disable unneeded tasks
-do_shared_workdir[noexec] = "1"
-do_install[noexec] = "1"
-do_package[noexec] = "1"
-do_package_qa[noexec] = "1"
-do_packagedata[noexec] = "1"
-do_package_deb[noexec] = "1"
-do_package_ipk[noexec] = "1"
-do_package_rpm[noexec] = "1"
-do_package_tar[noexec] = "1"
-do_package_write_deb[noexec] = "1"
-do_package_write_ipk[noexec] = "1"
-do_package_write_rpm[noexec] = "1"
-do_package_write_tar[noexec] = "1"
-do_populate_sysroot[noexec] = "1"
diff --git a/import-layers/meta-openembedded/meta-multimedia/README b/import-layers/meta-openembedded/meta-multimedia/README
index c540bed..abdc1a2 100644
--- a/import-layers/meta-openembedded/meta-multimedia/README
+++ b/import-layers/meta-openembedded/meta-multimedia/README
@@ -1,20 +1,20 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: morty
+branch: pyro
 revision: HEAD
 
 URI: git://github.com/openembedded/meta-oe.git
 layers: meta-oe, meta-ruby
-branch: morty
+branch: pyro
 revision: HEAD
 
-Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-multimedia]' in the subject'
+Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-multimedia][pyro]' in the subject'
 
 When sending single patches, please use something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-multimedia][morty][PATCH
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-multimedia][pyro][PATCH
 
 You are encouraged to fork the mirror on github https://github.com/openembedded/meta-oe/ to share your patches, this is preferred for patch sets consisting of more than one patch. Other services like gitorious, repo.or.cz or self hosted setups are of course accepted as well, 'git fetch <remote>' works the same on all of them. We recommend github because it is free, easy to use, has been proven to be reliable and has a really good web GUI.
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-igd_0.2.2.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-igd_0.2.2.bb
index 0cc4a3a..440e826 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-igd_0.2.2.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-igd_0.2.2.bb
@@ -12,3 +12,5 @@
 inherit autotools pkgconfig gtk-doc gobject-introspection
 
 EXTRA_OECONF = "--disable-python"
+
+PNBLACKLIST[gupnp-igd] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130645/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-tools_0.8.10.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-tools_0.8.10.bb
index eda70e8..ba7f825 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-tools_0.8.10.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-tools_0.8.10.bb
@@ -10,3 +10,5 @@
 SRC_URI[sha256sum] = "592c53289ff1cd70e676405c56ca87b28d2da37a385d34a3bb9b944ba9108d17"
 
 inherit autotools pkgconfig
+
+PNBLACKLIST[gupnp-tools] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130670/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb
new file mode 100644
index 0000000..bb361a1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Lightweight UPnP IGD daemon"
+DESCRIPTION = "The miniUPnP daemon is an UPnP IGD (internet gateway device) \
+which provide NAT traversal services to any UPnP enabled client on \
+the network."
+
+SECTION = "networking"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=aa71c78c373ccfe0ff207af0cd966d91"
+
+inherit autotools gettext pkgconfig
+
+DEPENDS += "iptables net-tools util-linux libmnl libnetfilter-conntrack"
+
+SRC_URI = "http://miniupnp.tuxfamily.org/files/download.php?file=${P}.tar.gz \
+"
+SRC_URI[md5sum] = "1c07a215dd9b362e75a9efc05e2fb3b4"
+SRC_URI[sha256sum] = "d96aa3a00e0f5490826bba3cb97e68cd27479e5839adac4b9bcb66eae786bfb7"
+
+IPV6 = "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '--ipv6', '', d)}"
+
+do_compile() {
+    cd ${S}
+    CONFIG_OPTIONS="${IPV6} --leasefile" ./genconfig.sh
+    oe_runmake -f Makefile.linux
+}
+
+do_install() {
+    install -d ${D}/${sbindir}
+    install ${S}/miniupnpd ${D}/${sbindir}
+    install -d ${D}/${sysconfdir}/${BPN}
+    install ${S}/netfilter/iptables_init.sh ${D}/${sysconfdir}/${BPN}
+    install ${S}/netfilter/iptables_removeall.sh ${D}/${sysconfdir}/${BPN}
+    install ${S}/netfilter/ip6tables_init.sh ${D}/${sysconfdir}/${BPN}
+    install ${S}/netfilter/ip6tables_removeall.sh ${D}/${sysconfdir}/${BPN}
+    install -m 0644 -b ${S}/miniupnpd.conf ${D}/${sysconfdir}/${BPN}
+    install -d ${D}/${sysconfdir}/init.d
+    install ${S}/linux/miniupnpd.init.d.script ${D}/${sysconfdir}/init.d/miniupnpd
+}
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/rygel/rygel_0.28.2.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/rygel/rygel_0.28.2.bb
index 79ff6e2..38fac65 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/rygel/rygel_0.28.2.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/rygel/rygel_0.28.2.bb
@@ -48,12 +48,12 @@
 
 python populate_packages_prepend () {
     rygel_libdir = d.expand('${libdir}/rygel-${LIBV}')
-    postinst = d.getVar('plugin_postinst', True)
+    postinst = d.getVar('plugin_postinst')
     pkgs = []
 
     pkgs += do_split_packages(d, oe.path.join(rygel_libdir, "plugins"), 'librygel-(.*)\.so$', d.expand('${PN}-plugin-%s'), 'Rygel plugin for %s', postinst=postinst, extra_depends=d.expand('${PN}'))
     pkgs += do_split_packages(d, oe.path.join(rygel_libdir, "plugins"), '(.*)\.plugin$', d.expand('${PN}-plugin-%s'), 'Rygel plugin for %s', postinst=postinst, extra_depends=d.expand('${PN}'))
 
-    metapkg = d.getVar('PN', True) + '-meta'
+    metapkg = d.getVar('PN') + '-meta'
     d.setVar('RDEPENDS_' + metapkg, ' '.join(pkgs))
 }
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/dvb-apps/dvb-apps_1.1.1.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/dvb-apps/dvb-apps_1.1.1.bb
index 0b4b72d..4a7ed9a 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/dvb-apps/dvb-apps_1.1.1.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/dvb-apps/dvb-apps_1.1.1.bb
@@ -132,3 +132,5 @@
 RDEPENDS_dvb-apps =+ "libdvbapi libdvbcfg libdvbsec libdvben50221 libucsi"
 RDEPENDS_dvb-femon =+ "libdvbapi"
 RDEPENDS_dvbnet =+ "libdvbapi"
+
+PNBLACKLIST[dvb-apps] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130603/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Fix-checks-for-sse2-mmx.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Fix-checks-for-sse2-mmx.patch
new file mode 100644
index 0000000..3283a5b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Fix-checks-for-sse2-mmx.patch
@@ -0,0 +1,40 @@
+From f0dab6d6fe4b0aae4394eee93be86e9747c6ed5c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Nov 2016 05:07:38 +0000
+Subject: [PATCH] Fix checks for sse2/mmx
+
+Just checking for cmdline options is not enough
+its better to check for builtin defines to be
+sure, clang does not error out on sse2 options on
+arm e.g. and it ends up doing SSE2 stuff for arm
+which is not desired
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 47d2cf2..4be000c 100755
+--- a/configure
++++ b/configure
+@@ -118,8 +118,14 @@ fi
+ # Valiate compiler
+ check_cc || die 'No C compiler found'
+ check_cc_header execinfo
+-check_cc_option mmx
+-check_cc_option sse2
++check_cc_snippet mmx '#ifndef __MMX__
++error "MMX not supported"
++#endif
++'
++check_cc_snippet sse2 '#ifndef __SSE2__
++error "SSE2 not supported"
++#endif
++'
+ 
+ if check_cc '
+ #if !defined(__clang__)
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Makefile-Ignore-warning-about-wrong-includes.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Makefile-Ignore-warning-about-wrong-includes.patch
new file mode 100644
index 0000000..248a5e6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Makefile-Ignore-warning-about-wrong-includes.patch
@@ -0,0 +1,31 @@
+From 7d672305c7ad2f716dfe1c487b525a1a92954d4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Nov 2016 06:22:36 +0000
+Subject: [PATCH] Makefile: Ignore warning about wrong includes
+
+It happens on musl especially
+usr/include/sys/poll.h:1:2: error: redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror,-W#warnings]
+| #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+|  ^
+| In file included from src/avahi.c:48:
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile b/Makefile
+index f41ef1a..cc7b249 100644
+--- a/Makefile
++++ b/Makefile
+@@ -54,6 +54,7 @@ CFLAGS  += -Wno-microsoft -Qunused-arguments -Wno-unused-function
+ CFLAGS  += -Wno-unused-value -Wno-tautological-constant-out-of-range-compare
+ CFLAGS  += -Wno-parentheses-equality -Wno-incompatible-pointer-types
+ CFLAGS  += -Wno-error=varargs
++CFLAGS  += -Wno-error=\#warnings
+ endif
+ 
+ ifeq ($(CONFIG_LIBFFMPEG_STATIC),yes)
+-- 
+1.8.3.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Move-tvheadend-specific-LD-CFLAGS-into-a-helper-vari.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Move-tvheadend-specific-LD-CFLAGS-into-a-helper-vari.patch
deleted file mode 100644
index 9dfcce0..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Move-tvheadend-specific-LD-CFLAGS-into-a-helper-vari.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 2ee64b359464b48f751683faa5ded3ee8200fe90 Mon Sep 17 00:00:00 2001
-From: Koen Kooi <koen@dominion.thruhere.net>
-Date: Fri, 21 Dec 2012 10:15:42 +0100
-Subject: [PATCH] Move tvheadend specific LD/CFLAGS into a helper variable to
- avoid being overwritten
-
-Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
-
-Upstream-Status: Inappropriate [OE specific]
----
- Makefile              |   20 ++++++++++----------
- support/configure.inc |    8 ++++----
- 2 files changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 8c6b293..daf5f14 100644
---- a/Makefile
-+++ b/Makefile
-@@ -27,12 +27,12 @@ PROG = ${BUILDDIR}/tvheadend
- # Common compiler flags
- #
- 
--CFLAGS  += -Wall -Werror -Wwrite-strings -Wno-deprecated-declarations
--CFLAGS  += -Wmissing-prototypes -fms-extensions
--CFLAGS  += -g -funsigned-char -O2 
--CFLAGS  += -D_FILE_OFFSET_BITS=64
--CFLAGS  += -I${BUILDDIR} -I${CURDIR}/src -I${CURDIR}
--LDFLAGS += -lrt -ldl -lpthread -lm
-+TVH_CFLAGS  += -Wall -Werror -Wwrite-strings -Wno-deprecated-declarations
-+TVH_CFLAGS  += -Wmissing-prototypes -fms-extensions
-+TVH_CFLAGS  += -g -funsigned-char -O2 
-+TVH_CFLAGS  += -D_FILE_OFFSET_BITS=64
-+TVH_CFLAGS  += -I${BUILDDIR} -I${CURDIR}/src -I${CURDIR}
-+TVH_LDFLAGS += -lrt -ldl -lpthread -lm
- 
- #
- # Other config
-@@ -179,8 +179,8 @@ SRCS-${CONFIG_CWC}  += src/ffdecsa/ffdecsa_interface.c \
- 	src/ffdecsa/ffdecsa_int.c
- SRCS-${CONFIG_MMX}  += src/ffdecsa/ffdecsa_mmx.c
- SRCS-${CONFIG_SSE2} += src/ffdecsa/ffdecsa_sse2.c
--${BUILDDIR}/src/ffdecsa/ffdecsa_mmx.o  : CFLAGS += -mmmx
--${BUILDDIR}/src/ffdecsa/ffdecsa_sse2.o : CFLAGS += -msse2
-+${BUILDDIR}/src/ffdecsa/ffdecsa_mmx.o  : TVH_CFLAGS += -mmmx
-+${BUILDDIR}/src/ffdecsa/ffdecsa_sse2.o : TVH_CFLAGS += -msse2
- endif
- 
- # File bundles
-@@ -217,12 +217,12 @@ all: ${PROG}
- 
- # Binary
- ${PROG}: $(OBJS) $(ALLDEPS)
--	$(CC) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS)
-+	$(CC) -o $@ $(OBJS) $(TVH_CFLAGS) $(TVH_LDFLAGS) $(CFLAGS) $(LDFLAGS)
- 
- # Object
- ${BUILDDIR}/%.o: %.c
- 	@mkdir -p $(dir $@)
--	$(CC) -MD -MP $(CFLAGS) -c -o $@ $(CURDIR)/$<
-+	$(CC) -MD -MP $(TVH_CFLAGS) $(CFLAGS) -c -o $@ $(CURDIR)/$<
- 
- # Add-on
- ${BUILDDIR}/%.so: ${SRCS_EXTRA}
-diff --git a/support/configure.inc b/support/configure.inc
-index 0130880..332511e 100644
---- a/support/configure.inc
-+++ b/support/configure.inc
-@@ -464,8 +464,8 @@ ifeq (\$(origin CC),default)
- CC        = ${CC}
- endif
- PYTHON   ?= ${PYTHON}
--CFLAGS   += ${CFLAGS}
--LDFLAGS  += ${LDFLAGS}
-+TVH_CFLAGS   += ${CFLAGS}
-+TVH_LDFLAGS  += ${LDFLAGS}
- prefix    = ${prefix}
- bindir    = ${bindir}
- mandir    = ${mandir}
-@@ -482,8 +482,8 @@ EOF
-   # Add package config
-   for pkg in ${PACKAGES[*]}; do
-     cat >>${CONFIG_MK} <<EOF
--LDFLAGS += $(pkg-config --libs $pkg)
--CFLAGS  += $(pkg-config --cflags $pkg)
-+TVH_LDFLAGS += $(pkg-config --libs $pkg)
-+TVH_CFLAGS  += $(pkg-config --cflags $pkg)
- EOF
-   done
- 
--- 
-1.7.7.6
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-disable-varargs-warning-on-clang.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-disable-varargs-warning-on-clang.patch
new file mode 100644
index 0000000..a4c4c4d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-disable-varargs-warning-on-clang.patch
@@ -0,0 +1,32 @@
+From 906d95695af95970bf551ea55b6c3e70332c6b97 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Nov 2016 05:22:32 +0000
+Subject: [PATCH] disable varargs warning on clang
+
+The issue is that 'len' is an unsigned char and we violate the promotion rules
+for passing the value to va_start.
+
+passing an object that undergoes defau
+lt argument promotion to 'va_start' has undefined behavior [-Wvarargs]
+|   va_start(ap, len);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile b/Makefile
+index 8c5e380..f41ef1a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -53,6 +53,7 @@ ifeq ($(COMPILER), clang)
+ CFLAGS  += -Wno-microsoft -Qunused-arguments -Wno-unused-function
+ CFLAGS  += -Wno-unused-value -Wno-tautological-constant-out-of-range-compare
+ CFLAGS  += -Wno-parentheses-equality -Wno-incompatible-pointer-types
++CFLAGS  += -Wno-error=varargs
+ endif
+ 
+ ifeq ($(CONFIG_LIBFFMPEG_STATIC),yes)
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-dvr-Use-labs-instead-of-abs.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-dvr-Use-labs-instead-of-abs.patch
new file mode 100644
index 0000000..ea34cdb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-dvr-Use-labs-instead-of-abs.patch
@@ -0,0 +1,37 @@
+From a715671eadcbf989fdaf05f62e71b93ac1749615 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Nov 2016 06:08:31 +0000
+Subject: [PATCH] dvr: Use labs() instead of abs()
+
+Makes clang happy
+
+dvr/dvr_db.c:853:10: error: absolute value function
+'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
+if ((abs(de->de_start - e->start) < 600) && (abs(de->de_stop - e->stop) < 600)) {
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/dvr/dvr_db.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c
+index 165caa6..5656569 100644
+--- a/src/dvr/dvr_db.c
++++ b/src/dvr/dvr_db.c
+@@ -414,11 +414,11 @@ dvr_entry_fuzzy_match(dvr_entry_t *de, epg_broadcast_t *e)
+   /* Wrong length (+/-20%) */
+   t1 = de->de_stop - de->de_start;
+   t2  = e->stop - e->start;
+-  if ( abs(t2 - t1) > (t1 / 5) )
++  if ( labs(t2 - t1) > (t1 / 5) )
+     return 0;
+ 
+   /* Outside of window */
+-  if (abs(e->start - de->de_start) > de->de_config->dvr_update_window)
++  if (labs(e->start - de->de_start) > de->de_config->dvr_update_window)
+     return 0;
+   
+   /* Title match (or contains?) */
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-hdhomerun-Override-forced-overrdiing-og-CC-STRIP-and.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-hdhomerun-Override-forced-overrdiing-og-CC-STRIP-and.patch
new file mode 100644
index 0000000..484e723
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-hdhomerun-Override-forced-overrdiing-og-CC-STRIP-and.patch
@@ -0,0 +1,40 @@
+From c3767e189e90965407937b6178adbbd8cdafe31d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Nov 2016 05:59:10 +0000
+Subject: [PATCH] hdhomerun: Override forced overrdiing og CC/STRIP and CFLAGS
+
+This is required for cross compiling otherwise it ends up
+using build host gcc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.hdhomerun | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.hdhomerun b/Makefile.hdhomerun
+index 943ffec..8bd14ff 100644
+--- a/Makefile.hdhomerun
++++ b/Makefile.hdhomerun
+@@ -18,8 +18,8 @@
+ 
+ include $(dir $(lastword $(MAKEFILE_LIST))).config.mk
+ 
+-unexport CFLAGS
+-unexport LDFLAGS
++#unexport CFLAGS
++#unexport LDFLAGS
+ 
+ define DOWNLOAD
+ 	@mkdir -p $(LIBHDHRDIR)/build
+@@ -75,6 +75,8 @@ $(LIBHDHRDIR)/$(LIBHDHR)/.tvh_download:
+ 	$(call DOWNLOAD,$(LIBHDHR_URL),$(LIBHDHRDIR)/$(LIBHDHR_TB),$(LIBHDHR_SHA1))
+ 	$(call UNTAR,$(LIBHDHR_TB),z)
+ 	ln -sf libhdhomerun $(LIBHDHRDIR)/$(LIBHDHR)
++	@sed -i -e "s/CC.*:=/CC ?=/" $(LIBHDHRDIR)/$(LIBHDHR)/Makefile
++	@sed -i -e "s/STRIP.*:=/STRIP ?=/" $(LIBHDHRDIR)/$(LIBHDHR)/Makefile
+ 	@touch $@
+ 
+ $(LIBHDHRDIR)/$(LIBHDHR)/.tvh_build: \
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0002-fix-issues-with-gcc6.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0002-fix-issues-with-gcc6.patch
deleted file mode 100644
index 55b9249..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0002-fix-issues-with-gcc6.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- git/src/htsmsg.c.orig	2016-06-17 11:47:53.026921237 -0400
-+++ git/src/htsmsg.c	2016-06-17 11:49:03.086922457 -0400
-@@ -574,13 +574,13 @@
-     case HMF_MAP:
-       printf("MAP) = {\n");
-       htsmsg_print0(&f->hmf_msg, indent + 1);
--      for(i = 0; i < indent; i++) printf("\t"); printf("}\n");
-+      for(i = 0; i < indent; i++) {printf("\t");} printf("}\n");
-       break;
- 
-     case HMF_LIST:
-       printf("LIST) = {\n");
-       htsmsg_print0(&f->hmf_msg, indent + 1);
--      for(i = 0; i < indent; i++) printf("\t"); printf("}\n");
-+      for(i = 0; i < indent; i++) {printf("\t");} printf("}\n");
-       break;
-       
-     case HMF_STR:
---- git/src/dvb/dvb_tables.c.orig	2016-06-17 11:51:09.142924652 -0400
-+++ git/src/dvb/dvb_tables.c	2016-06-17 11:54:33.962928219 -0400
-@@ -935,10 +935,10 @@
-     onid = (ptr[24] << 8) | ptr[25];
-     
-     /* Search all muxes on adapter */
--    LIST_FOREACH(tdmi, &tda->tda_muxes, tdmi_adapter_link)
--      if(tdmi->tdmi_transport_stream_id == tsid && tdmi->tdmi_network_id == onid);
--	break;
--    
-+    LIST_FOREACH(tdmi, &tda->tda_muxes, tdmi_adapter_link) {
-+      if(tdmi->tdmi_transport_stream_id == tsid && tdmi->tdmi_network_id == onid)
-+    	break;
-+    }
-     if(tdmi == NULL)
-       continue;
- 
---- git/src/epggrab/module/eit.c.orig	2016-06-17 11:49:57.726923409 -0400
-+++ git/src/epggrab/module/eit.c	2016-06-17 11:50:14.526923701 -0400
-@@ -214,7 +214,7 @@
-   if (m && m->enabled) cptr = _eit_freesat_conv;
-   else
-     m = epggrab_module_find_by_id("uk_freeview");
--    if (m && m->enabled) cptr = _eit_freesat_conv;
-+  if (m && m->enabled) cptr = _eit_freesat_conv;
- 
-   /* Convert */
-   return dvb_get_string_with_len(dst, dstlen, src, srclen, charset, cptr);
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb
index bd5062c..3b73549 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb
@@ -1,22 +1,29 @@
 SUMMARY = "Tvheadend TV streaming server"
 HOMEPAGE = "https://www.lonelycoder.com/redmine/projects/tvheadend"
 
-DEPENDS = "avahi zlib openssl python-native"
+DEPENDS = "avahi zlib openssl python-native dvb-apps"
 
 LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=9eef91148a9b14ec7f9df333daebc746"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=9cae5acac2e9ee2fc3aec01ac88ce5db"
 
-SRC_URI = "git://github.com/tvheadend/tvheadend.git \
-           file://0001-Move-tvheadend-specific-LD-CFLAGS-into-a-helper-vari.patch \
-           file://0002-fix-issues-with-gcc6.patch \
+SRC_URI = "git://github.com/tvheadend/tvheadend.git;branch=release/4.0 \
+           file://0001-Fix-checks-for-sse2-mmx.patch \
+           file://0001-disable-varargs-warning-on-clang.patch \
+           file://0001-hdhomerun-Override-forced-overrdiing-og-CC-STRIP-and.patch \
+           file://0001-dvr-Use-labs-instead-of-abs.patch \
+           file://0001-Makefile-Ignore-warning-about-wrong-includes.patch \
 "
-SRCREV = "a420c83a0e0d2c31c2c15d0fec6fedc3f5a36dfe"
-PV = "3.3"
+SRCREV = "64fec8120158de585e18be705055259484518d94"
+PV = "4.0.9+git${SRCREV}"
 
 S = "${WORKDIR}/git"
 
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[uriparser] = "--enable-uriparser,--disable-uriparser,uriparser"
+
 do_configure() {
-    ./configure --prefix=${prefix} \
+    ./configure ${PACKAGECONFIG_CONFARGS} \
+                --prefix=${prefix} \
                 --libdir=${libdir} \
                 --bindir=${bindir} \
                 --datadir=${datadir} \
@@ -30,3 +37,7 @@
 }
 
 FILES_${PN} += "${datadir}/${BPN}"
+
+RDEPENDS_${PN} += "libdvben50221 libucsi libdvbapi"
+
+PNBLACKLIST[tvheadend] ?= "Depends on blacklisted dvb-apps - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/jsonschemabuilder-native.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/jsonschemabuilder-native.bb
new file mode 100644
index 0000000..fdb7699
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/jsonschemabuilder-native.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Kodi Media Center"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://JsonSchemaBuilder.cpp;beginline=2;endline=18;md5=1f67721215c03f66545390f6e45b99c7"
+
+SRCREV = "661dd08d221f5b2bf509a696a6aca5ee7d45bb27"
+
+PV = "17.1+gitr${SRCPV}"
+SRC_URI = "git://github.com/xbmc/xbmc.git;branch=Krypton"
+
+inherit autotools-brokensep gettext native
+
+S = "${WORKDIR}/git/tools/depends/native/JsonSchemaBuilder/src"
+
+do_compile_prepend() {
+    for i in $(find . -name "Makefile") ; do
+        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' $i
+    done
+
+    for i in $(find . -name "*.mak*" -o    -name "Makefile") ; do
+        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' -e 's:-rpath \$(libdir):-rpath ${libdir}:g' $i
+    done
+}
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-Fix-file_Emu-on-musl.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-Fix-file_Emu-on-musl.patch
new file mode 100644
index 0000000..20b6377
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-Fix-file_Emu-on-musl.patch
@@ -0,0 +1,496 @@
+From 7ae4fcf290ffb0b76374efafeaee575456ac9023 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 6 Nov 2016 23:08:27 -0800
+Subject: [PATCH 01/10] Fix file_Emu on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ xbmc/cores/DllLoader/exports/emu_msvcrt.cpp        |  28 ++--
+ xbmc/cores/DllLoader/exports/emu_msvcrt.h          |   2 +-
+ .../DllLoader/exports/util/EmuFileWrapper.cpp      | 172 +++++++++------------
+ xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h |  27 ++--
+ xbmc/cores/DllLoader/exports/wrapper.c             |   4 +-
+ 5 files changed, 99 insertions(+), 134 deletions(-)
+
+diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
+index ab14942..a39014a 100644
+--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
++++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
+@@ -51,6 +51,7 @@
+ #include <fcntl.h>
+ #include <time.h>
+ #include <signal.h>
++#include <paths.h>
+ #ifdef TARGET_POSIX
+ #include "PlatformDefs.h" // for __stat64
+ #include "XFileUtils.h"
+@@ -476,13 +477,10 @@ extern "C"
+     EmuFileObject* o = g_emuFileWrapper.GetFileObjectByDescriptor(fd);
+     if (o)
+     {
+-      if(!o->used)
+-        return NULL;
+-
+       int nmode = convert_fmode(mode);
+       if( (o->mode & nmode) != nmode)
+         CLog::Log(LOGWARNING, "dll_fdopen - mode 0x%x differs from fd mode 0x%x", nmode, o->mode);
+-      return &o->file_emu;
++      return g_emuFileWrapper.GetStreamByFileObject(o);
+     }
+     else if (!IS_STD_DESCRIPTOR(fd))
+     {
+@@ -545,7 +543,7 @@ extern "C"
+         return -1;
+       }
+       object->mode = iMode;
+-      return g_emuFileWrapper.GetDescriptorByStream(&object->file_emu);
++      return g_emuFileWrapper.GetDescriptorByFileObject(object);
+     }
+     delete pFile;
+     return -1;
+@@ -1214,8 +1212,8 @@ extern "C"
+   {
+     FILE* file = NULL;
+ #if defined(TARGET_LINUX) && !defined(TARGET_ANDROID)
+-    if (strcmp(filename, MOUNTED) == 0
+-    ||  strcmp(filename, MNTTAB) == 0)
++    if (strcmp(filename, _PATH_MOUNTED) == 0
++    ||  strcmp(filename, _PATH_MNTTAB) == 0)
+     {
+       CLog::Log(LOGINFO, "%s - something opened the mount file, let's hope it knows what it's doing", __FUNCTION__);
+       return fopen(filename, mode);
+@@ -1622,7 +1620,7 @@ extern "C"
+     int ret;
+ 
+     ret = dll_fgetpos64(stream, &tmpPos);
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+     *pos = (fpos_t)tmpPos;
+ #else
+     pos->__pos = (off_t)tmpPos.__pos;
+@@ -1635,8 +1633,9 @@ extern "C"
+     CFile* pFile = g_emuFileWrapper.GetFileXbmcByStream(stream);
+     if (pFile != NULL)
+     {
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+-      *pos = pFile->GetPosition();
++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++      uint64_t *ppos = (uint64_t *) pos;
++      *ppos = pFile->GetPosition();
+ #else
+       pos->__pos = pFile->GetPosition();
+ #endif
+@@ -1657,8 +1656,9 @@ extern "C"
+     int fd = g_emuFileWrapper.GetDescriptorByStream(stream);
+     if (fd >= 0)
+     {
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+-      if (dll_lseeki64(fd, *pos, SEEK_SET) >= 0)
++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++      const uint64_t *ppos = (const uint64_t *) pos;
++      if (dll_lseeki64(fd, *ppos, SEEK_SET) >= 0)
+ #else
+       if (dll_lseeki64(fd, (__off64_t)pos->__pos, SEEK_SET) >= 0)
+ #endif
+@@ -1674,7 +1674,7 @@ extern "C"
+     {
+       // it might be something else than a file, or the file is not emulated
+       // let the operating system handle it
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+       return fsetpos(stream, pos);
+ #else
+       return fsetpos64(stream, pos);
+@@ -1690,7 +1690,7 @@ extern "C"
+     if (fd >= 0)
+     {
+       fpos64_t tmpPos;
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+       tmpPos= *pos;
+ #else
+       tmpPos.__pos = (off64_t)(pos->__pos);
+diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.h b/xbmc/cores/DllLoader/exports/emu_msvcrt.h
+index 3294d9a..c7c483f 100644
+--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.h
++++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.h
+@@ -24,7 +24,7 @@
+ #define _onexit_t void*
+ #endif
+ 
+-#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
+ typedef off_t __off_t;
+ typedef int64_t off64_t;
+ typedef off64_t __off64_t;
+diff --git a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp
+index 8927d41..e9a2ab0 100644
+--- a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp
++++ b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp
+@@ -52,16 +52,7 @@ constexpr bool isValidFilePtr(FILE* f)
+ }
+ CEmuFileWrapper::CEmuFileWrapper()
+ {
+-  // since we always use dlls we might just initialize it directly
+-  for (int i = 0; i < MAX_EMULATED_FILES; i++)
+-  {
+-    memset(&m_files[i], 0, sizeof(EmuFileObject));
+-    m_files[i].used = false;
+-#if defined(TARGET_WINDOWS) && (_MSC_VER >= 1900)
+-    m_files[i].file_emu._Placeholder = new kodi_iobuf();
+-#endif
+-    FileDescriptor(m_files[i].file_emu)->_file = -1;
+-  }
++  memset(m_files, 0, sizeof(m_files));
+ }
+ 
+ CEmuFileWrapper::~CEmuFileWrapper()
+@@ -73,29 +64,7 @@ void CEmuFileWrapper::CleanUp()
+ {
+   CSingleLock lock(m_criticalSection);
+   for (int i = 0; i < MAX_EMULATED_FILES; i++)
+-  {
+-    if (m_files[i].used)
+-    {
+-      m_files[i].file_xbmc->Close();
+-      delete m_files[i].file_xbmc;
+-
+-      if (m_files[i].file_lock)
+-      {
+-        delete m_files[i].file_lock;
+-        m_files[i].file_lock = nullptr;
+-      }
+-#if !defined(TARGET_WINDOWS)
+-      //Don't memset on Windows as it overwrites our pointer
+-      memset(&m_files[i], 0, sizeof(EmuFileObject));
+-#endif
+-      m_files[i].used = false;
+-      FileDescriptor(m_files[i].file_emu)->_file = -1;
+-    }
+-#if defined(TARGET_WINDOWS) && (_MSC_VER >= 1900)
+-    delete static_cast<kodi_iobuf*>(m_files[i].file_emu._Placeholder);
+-    m_files[i].file_emu._Placeholder = nullptr;
+-#endif
+-  }
++    UnRegisterFileObject(&m_files[i], true);
+ }
+ 
+ EmuFileObject* CEmuFileWrapper::RegisterFileObject(XFILE::CFile* pFile)
+@@ -106,13 +75,11 @@ EmuFileObject* CEmuFileWrapper::RegisterFileObject(XFILE::CFile* pFile)
+ 
+   for (int i = 0; i < MAX_EMULATED_FILES; i++)
+   {
+-    if (!m_files[i].used)
++    if (!m_files[i].file_xbmc)
+     {
+       // found a free location
+       object = &m_files[i];
+-      object->used = true;
+       object->file_xbmc = pFile;
+-      FileDescriptor(object->file_emu)->_file = (i + FILE_WRAPPER_OFFSET);
+       object->file_lock = new CCriticalSection();
+       break;
+     }
+@@ -121,82 +88,74 @@ EmuFileObject* CEmuFileWrapper::RegisterFileObject(XFILE::CFile* pFile)
+   return object;
+ }
+ 
+-void CEmuFileWrapper::UnRegisterFileObjectByDescriptor(int fd)
++void CEmuFileWrapper::UnRegisterFileObject(EmuFileObject *object, bool free_file)
++
+ {
+-  int i = fd - FILE_WRAPPER_OFFSET;
+-  if (! (i >= 0 && i < MAX_EMULATED_FILES))
+-    return;
++  if (object && object->file_xbmc)
++  {
++    if (object->file_xbmc && free_file)
++    {
++      object->file_xbmc->Close();
++      delete object->file_xbmc;
++    }
++    if (object->file_lock)
++    {
++      delete object->file_lock;
++    }
+ 
+-  if (!m_files[i].used)
+-    return;
++    memset(object, 0, sizeof(*object));
++   }
++}
+ 
++void CEmuFileWrapper::UnRegisterFileObjectByDescriptor(int fd)
++{
+   CSingleLock lock(m_criticalSection);
+-
+-  // we assume the emulated function alreay deleted the CFile object
+-  if (m_files[i].file_lock)
+-  {
+-    delete m_files[i].file_lock;
+-    m_files[i].file_lock = nullptr;
+-  }
+-#if !defined(TARGET_WINDOWS)
+-  //Don't memset on Windows as it overwrites our pointer
+-  memset(&m_files[i], 0, sizeof(EmuFileObject));
+-#endif
+-  m_files[i].used = false;
+-  FileDescriptor(m_files[i].file_emu)->_file = -1;
++  UnRegisterFileObject(GetFileObjectByDescriptor(fd), false);
+ }
+ 
+ void CEmuFileWrapper::UnRegisterFileObjectByStream(FILE* stream)
+ {
+   if (isValidFilePtr(stream))
+   {
+-    return UnRegisterFileObjectByDescriptor(FileDescriptor(*stream)->_file);
++    CSingleLock lock(m_criticalSection);
++    UnRegisterFileObject(GetFileObjectByStream(stream), false);
+   }
+ }
+ 
+ void CEmuFileWrapper::LockFileObjectByDescriptor(int fd)
+ {
+-  int i = fd - FILE_WRAPPER_OFFSET;
+-  if (i >= 0 && i < MAX_EMULATED_FILES)
++  EmuFileObject* object = GetFileObjectByDescriptor(fd);
++  if (object && object->file_xbmc)
+   {
+-    if (m_files[i].used)
+-    {
+-      m_files[i].file_lock->lock();
+-    }
++    object->file_lock->lock();
+   }
+ }
+ 
+ bool CEmuFileWrapper::TryLockFileObjectByDescriptor(int fd)
+ {
+-  int i = fd - FILE_WRAPPER_OFFSET;
+-  if (i >= 0 && i < MAX_EMULATED_FILES)
++  EmuFileObject* object = GetFileObjectByDescriptor(fd);
++  if (object && object->file_xbmc)
+   {
+-    if (m_files[i].used)
+-    {
+-      return m_files[i].file_lock->try_lock();
+-    }
++    return object->file_lock->try_lock();
+   }
+   return false;
+ }
+ 
+ void CEmuFileWrapper::UnlockFileObjectByDescriptor(int fd)
+ {
+-  int i = fd - FILE_WRAPPER_OFFSET;
+-  if (i >= 0 && i < MAX_EMULATED_FILES)
++  EmuFileObject* object = GetFileObjectByDescriptor(fd);
++  if (object && object->file_xbmc)
+   {
+-    if (m_files[i].used)
+-    {
+-      m_files[i].file_lock->unlock();
+-    }
++    object->file_lock->unlock();
+   }
+ }
+ 
+ EmuFileObject* CEmuFileWrapper::GetFileObjectByDescriptor(int fd)
+ {
+-  int i = fd - FILE_WRAPPER_OFFSET;
++  int i = fd - 0x7000000;
+   if (i >= 0 && i < MAX_EMULATED_FILES)
+   {
+-    if (m_files[i].used)
++    if (m_files[i].file_xbmc)
+     {
+       return &m_files[i];
+     }
+@@ -204,20 +163,39 @@ EmuFileObject* CEmuFileWrapper::GetFileObjectByDescriptor(int fd)
+   return nullptr;
+ }
+ 
++int CEmuFileWrapper::GetDescriptorByFileObject(EmuFileObject *object)
++{
++  int i = object - m_files;
++  if (i >= 0 && i < MAX_EMULATED_FILES)
++  {
++    return 0x7000000 + i;
++  }
++
++  return -1;
++}
++
+ EmuFileObject* CEmuFileWrapper::GetFileObjectByStream(FILE* stream)
+ {
+-  if (isValidFilePtr(stream))
++  EmuFileObject *object = (EmuFileObject*) stream;
++  if (object >= &m_files[0] || object < &m_files[MAX_EMULATED_FILES])
+   {
+-    return GetFileObjectByDescriptor(FileDescriptor(*stream)->_file);
++    if (object->file_xbmc)
++    {
++      return object;
++    }
+   }
++  return NULL;
++}
+ 
+-  return nullptr;
++FILE* CEmuFileWrapper::GetStreamByFileObject(EmuFileObject *object)
++{
++  return (FILE*) object;
+ }
+ 
+ XFILE::CFile* CEmuFileWrapper::GetFileXbmcByDescriptor(int fd)
+ {
+   auto object = GetFileObjectByDescriptor(fd);
+-  if (object != nullptr && object->used)
++  if (object != nullptr)
+   {
+     return object->file_xbmc;
+   }
+@@ -228,8 +206,9 @@ XFILE::CFile* CEmuFileWrapper::GetFileXbmcByStream(FILE* stream)
+ {
+   if (isValidFilePtr(stream))
+   {
+-    auto object = GetFileObjectByDescriptor(FileDescriptor(*stream)->_file);
+-    if (object != nullptr && object->used)
++    EmuFileObject* object = GetFileObjectByStream(stream);
++    if (object != NULL)
++
+     {
+       return object->file_xbmc;
+     }
+@@ -239,32 +218,21 @@ XFILE::CFile* CEmuFileWrapper::GetFileXbmcByStream(FILE* stream)
+ 
+ int CEmuFileWrapper::GetDescriptorByStream(FILE* stream)
+ {
+-  if (isValidFilePtr(stream))
+-  {
+-    int i = FileDescriptor(*stream)->_file - FILE_WRAPPER_OFFSET;
+-    if (i >= 0 && i < MAX_EMULATED_FILES)
+-    {
+-      return i + FILE_WRAPPER_OFFSET;
+-    }
+-  }
+-  return -1;
++  return GetDescriptorByFileObject(GetFileObjectByStream(stream));
+ }
+ 
+ FILE* CEmuFileWrapper::GetStreamByDescriptor(int fd)
+ {
+-  auto object = GetFileObjectByDescriptor(fd);
+-  if (object != nullptr && object->used)
+-  {
+-    return &object->file_emu;
+-  }
+-  return nullptr;
++  return GetStreamByFileObject(GetFileObjectByDescriptor(fd));
++}
++
++bool CEmuFileWrapper::DescriptorIsEmulatedFile(int fd)
++{
++  return GetFileObjectByDescriptor(fd) != NULL;
+ }
+ 
+ bool CEmuFileWrapper::StreamIsEmulatedFile(FILE* stream)
+ {
+-  if (isValidFilePtr(stream))
+-  {
+-    return DescriptorIsEmulatedFile(FileDescriptor(*stream)->_file);
+-  }
+-  return false;
++  return GetFileObjectByStream(stream) != NULL;
+ }
++
+diff --git a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
+index 786fa85..311a5cf 100644
+--- a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
++++ b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
+@@ -25,14 +25,14 @@
+ #include "system.h"
+ #include "threads/CriticalSection.h"
+ 
+-#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN) && !defined(TARGET_FREEBSD) && !defined(TARGET_ANDROID) && !defined(__UCLIBC__)
+-#define _file _fileno
+-#elif defined(__UCLIBC__)
+-#define _file __filedes
+-#endif
++//#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN) && !defined(TARGET_FREEBSD) && !defined(TARGET_ANDROID) && !defined(__UCLIBC__)
++//#define _file _fileno
++//#elif defined(__UCLIBC__)
++//#define _file __filedes
++//#endif
+ 
+ #define MAX_EMULATED_FILES    50
+-#define FILE_WRAPPER_OFFSET   0x00000200
++//#define FILE_WRAPPER_OFFSET   0x00000200
+ 
+ namespace XFILE
+ {
+@@ -47,12 +47,9 @@ struct kodi_iobuf {
+ 
+ typedef struct stEmuFileObject
+ {
+-  FILE    file_emu;
+   XFILE::CFile*  file_xbmc;
+   CCriticalSection *file_lock;
+   int mode;
+-  //Stick this last to avoid 3-7 bytes of padding
+-  bool    used;
+ } EmuFileObject;
+ 
+ class CEmuFileWrapper
+@@ -67,22 +64,22 @@ public:
+   void CleanUp();
+ 
+   EmuFileObject* RegisterFileObject(XFILE::CFile* pFile);
++  void UnRegisterFileObject(EmuFileObject*, bool free_file);
+   void UnRegisterFileObjectByDescriptor(int fd);
+   void UnRegisterFileObjectByStream(FILE* stream);
+   void LockFileObjectByDescriptor(int fd);
+   bool TryLockFileObjectByDescriptor(int fd);
+   void UnlockFileObjectByDescriptor(int fd);
+   EmuFileObject* GetFileObjectByDescriptor(int fd);
++  int GetDescriptorByFileObject(EmuFileObject*);
+   EmuFileObject* GetFileObjectByStream(FILE* stream);
++  FILE* GetStreamByFileObject(EmuFileObject*);
+   XFILE::CFile* GetFileXbmcByDescriptor(int fd);
+   XFILE::CFile* GetFileXbmcByStream(FILE* stream);
+-  static int GetDescriptorByStream(FILE* stream);
++  int GetDescriptorByStream(FILE* stream);
+   FILE* GetStreamByDescriptor(int fd);
+-  static constexpr bool DescriptorIsEmulatedFile(int fd)
+-  {
+-    return fd >= FILE_WRAPPER_OFFSET && fd < FILE_WRAPPER_OFFSET + MAX_EMULATED_FILES;
+-  }
+-  static bool StreamIsEmulatedFile(FILE* stream);
++  bool DescriptorIsEmulatedFile(int fd);
++  bool StreamIsEmulatedFile(FILE* stream);
+ private:
+   EmuFileObject m_files[MAX_EMULATED_FILES];
+   CCriticalSection m_criticalSection;
+diff --git a/xbmc/cores/DllLoader/exports/wrapper.c b/xbmc/cores/DllLoader/exports/wrapper.c
+index e363662..07825f3 100644
+--- a/xbmc/cores/DllLoader/exports/wrapper.c
++++ b/xbmc/cores/DllLoader/exports/wrapper.c
+@@ -39,13 +39,13 @@
+ #endif
+ #include <dlfcn.h>
+ 
+-#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
+ typedef off_t     __off_t;
+ typedef int64_t   off64_t;
+ typedef off64_t   __off64_t;
+ typedef fpos_t    fpos64_t;
+ #define stat64    stat
+-#if defined(TARGET_DARWIN) || defined(TARGET_ANDROID)
++#if defined(TARGET_DARWIN) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
+ #define _G_va_list va_list
+ #endif
+ #endif
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-change-order-of-detecting-libegl-and-libgles2.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-change-order-of-detecting-libegl-and-libgles2.patch
new file mode 100644
index 0000000..12a6c06
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-change-order-of-detecting-libegl-and-libgles2.patch
@@ -0,0 +1,32 @@
+From 21524598110e7a55113205dda4bc1a6d5987111c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 9 May 2017 06:41:33 +0000
+Subject: [PATCH] change order of detecting libegl and libgles2
+
+This actually helps building it on rpi/userland
+where libEGL depends on few functions from libGLESv2
+see
+https://www.raspberrypi.org/forums/viewtopic.php?t=7090
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index b9e4240..1ca0297 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -951,8 +951,8 @@ if test "$use_gles" = "yes"; then
+       AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.)
+       LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm"
+     else
+-      AC_CHECK_LIB([EGL],   [main],, AC_MSG_ERROR($missing_library))
+       AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library))
++      AC_CHECK_LIB([EGL],   [main],, AC_MSG_ERROR($missing_library))
+     fi
+   fi
+ else
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0002-Remove-FILEWRAP.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0002-Remove-FILEWRAP.patch
new file mode 100644
index 0000000..463a5c4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0002-Remove-FILEWRAP.patch
@@ -0,0 +1,46 @@
+From ad1977a358319093b305df6d84be6db676ef1e4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 6 Nov 2016 22:35:16 -0800
+Subject: [PATCH 02/10] Remove FILEWRAP
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ xbmc/utils/posix/PosixInterfaceForCLog.cpp | 6 +-----
+ xbmc/utils/posix/PosixInterfaceForCLog.h   | 4 +---
+ 2 files changed, 2 insertions(+), 8 deletions(-)
+
+Index: git/xbmc/utils/posix/PosixInterfaceForCLog.cpp
+===================================================================
+--- git.orig/xbmc/utils/posix/PosixInterfaceForCLog.cpp
++++ git/xbmc/utils/posix/PosixInterfaceForCLog.cpp
+@@ -29,10 +29,6 @@
+ #include "platform/android/activity/XBMCApp.h"
+ #endif // TARGET_ANDROID
+ 
+-struct FILEWRAP : public FILE
+-{};
+-
+-
+ CPosixInterfaceForCLog::CPosixInterfaceForCLog() :
+   m_file(NULL)
+ { }
+@@ -52,7 +48,7 @@ bool CPosixInterfaceForCLog::OpenLogFile
+   (void)remove(backupOldLogToFilename.c_str()); // if it's failed, try to continue
+   (void)rename(logFilename.c_str(), backupOldLogToFilename.c_str()); // if it's failed, try to continue
+ 
+-  m_file = (FILEWRAP*)fopen(logFilename.c_str(), "wb");
++  m_file = fopen(logFilename.c_str(), "wb");
+   if (!m_file)
+     return false; // error, can't open log file
+ 
+Index: git/xbmc/utils/posix/PosixInterfaceForCLog.h
+===================================================================
+--- git.orig/xbmc/utils/posix/PosixInterfaceForCLog.h
++++ git/xbmc/utils/posix/PosixInterfaceForCLog.h
+@@ -34,5 +34,5 @@ public:
+   void PrintDebugString(const std::string& debugString);
+   static void GetCurrentLocalTime(int& hour, int& minute, int& second, double& millisecond);
+ private:
+-  FILEWRAP* m_file;
++  FILE* m_file;
+ };
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0003-configure-don-t-try-to-run-stuff-to-find-tinyxml.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0003-configure-don-t-try-to-run-stuff-to-find-tinyxml.patch
new file mode 100644
index 0000000..49217a4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0003-configure-don-t-try-to-run-stuff-to-find-tinyxml.patch
@@ -0,0 +1,25 @@
+From a91a3ba229dc5903935f7dd98dd03bbb4fe5ac1f Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Sat, 6 Feb 2016 15:43:01 +0100
+Subject: [PATCH 03/10] configure: don't try to run stuff to find tinyxml
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 34fe643..3132dc1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1043,7 +1043,7 @@ fi
+ AC_LANG_PUSH([C++])
+ PKG_CHECK_MODULES([TINYXML], [tinyxml >= 2.6.2],
+   [INCLUDES="$INCLUDES $TINYXML_CFLAGS"; LIBS="$LIBS $TINYXML_LIBS"],
+-  [AC_RUN_IFELSE(
++  [AC_COMPILE_IFELSE(
+    [AC_LANG_SOURCE([[
+ #include <stdlib.h>
+ #include <tinyxml.h>
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0004-handle-SIGTERM.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0004-handle-SIGTERM.patch
new file mode 100644
index 0000000..dc37439
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0004-handle-SIGTERM.patch
@@ -0,0 +1,163 @@
+From 49046c1685465a5486fe9e1c04b99c585aab6862 Mon Sep 17 00:00:00 2001
+From: Stefan Saraev <stefan@saraev.ca>
+Date: Wed, 2 Nov 2016 11:28:34 -0700
+Subject: [PATCH 04/10] handle SIGTERM
+
+0. CApplication::Stop cant be trusted. (deadlocks crashes and boo)
+
+so, when shutdown/reboot is requested:
+
+1. save an exit code (for CEC...)
+2. call CPowerManager::{Reboot,PowerDown}
+3. ... then systemd sends TERM and waits xx seconds before sending KILL
+4. CApplication::Stop has xx seconds to save guisettings.xml and boo
+5. CEC thread has xx seconds to switch off after it received OnQuit
+6. addons / pvrmanager / cec / everything else.. are free to deadlock / crash now, we dont care
+7. KILL
+
+Signed-off-by: Stefan Saraev <stefan@saraev.ca>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ xbmc/Application.cpp         | 17 ++++++++++++-----
+ xbmc/Application.h           |  1 +
+ xbmc/XBApplicationEx.cpp     |  1 +
+ xbmc/XBApplicationEx.h       |  1 +
+ xbmc/platform/posix/main.cpp | 15 +++++++++++++++
+ 5 files changed, 30 insertions(+), 5 deletions(-)
+
+diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
+index 100a2f2..fda892d 100644
+--- a/xbmc/Application.cpp
++++ b/xbmc/Application.cpp
+@@ -2426,12 +2426,12 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg)
+   switch (pMsg->dwMessage)
+   {
+   case TMSG_POWERDOWN:
+-    Stop(EXITCODE_POWERDOWN);
++    SetExitCode(EXITCODE_POWERDOWN);
+     g_powerManager.Powerdown();
+     break;
+ 
+   case TMSG_QUIT:
+-    Stop(EXITCODE_QUIT);
++    SetExitCode(EXITCODE_QUIT);
+     break;
+   
+   case TMSG_SHUTDOWN:
+@@ -2452,12 +2452,13 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg)
+ 
+   case TMSG_RESTART:
+   case TMSG_RESET:
+-    Stop(EXITCODE_REBOOT);
++    SetExitCode(EXITCODE_REBOOT);
+     g_powerManager.Reboot();
+     break;
+ 
+   case TMSG_RESTARTAPP:
+ #if defined(TARGET_WINDOWS) || defined(TARGET_LINUX)
++    SetExitCode(EXITCODE_RESTARTAPP);
+     Stop(EXITCODE_RESTARTAPP);
+ #endif
+     break;
+@@ -2881,6 +2882,13 @@ bool CApplication::Cleanup()
+   }
+ }
+ 
++void CApplication::SetExitCode(int exitCode)
++{
++  // save it for CEC
++  m_ExitCode = exitCode;
++  m_ExitCodeSet = true;
++}
++
+ void CApplication::Stop(int exitCode)
+ {
+   try
+@@ -2888,7 +2896,7 @@ void CApplication::Stop(int exitCode)
+     m_frameMoveGuard.unlock();
+ 
+     CVariant vExitCode(CVariant::VariantTypeObject);
+-    vExitCode["exitcode"] = exitCode;
++    vExitCode["exitcode"] = m_ExitCode;
+     CAnnouncementManager::GetInstance().Announce(System, "xbmc", "OnQuit", vExitCode);
+ 
+     // Abort any active screensaver
+@@ -2922,7 +2930,6 @@ void CApplication::Stop(int exitCode)
+ 
+     m_bStop = true;
+     m_AppFocused = false;
+-    m_ExitCode = exitCode;
+     CLog::Log(LOGNOTICE, "stop all");
+ 
+     // cancel any jobs from the jobmanager
+diff --git a/xbmc/Application.h b/xbmc/Application.h
+index a9d9bf5..e536deb 100644
+--- a/xbmc/Application.h
++++ b/xbmc/Application.h
+@@ -159,6 +159,7 @@ public:
+   void StopPVRManager();
+   void ReinitPVRManager();
+   bool IsCurrentThread() const;
++  void SetExitCode(int exitCode);
+   void Stop(int exitCode);
+   void RestartApp();
+   void UnloadSkin(bool forReload = false);
+diff --git a/xbmc/XBApplicationEx.cpp b/xbmc/XBApplicationEx.cpp
+index 035aed2..34102f5 100644
+--- a/xbmc/XBApplicationEx.cpp
++++ b/xbmc/XBApplicationEx.cpp
+@@ -46,6 +46,7 @@ CXBApplicationEx::CXBApplicationEx()
+   m_bStop = false;
+   m_AppFocused = true;
+   m_ExitCode = EXITCODE_QUIT;
++  m_ExitCodeSet = false;
+   m_renderGUI = false;
+ }
+ 
+diff --git a/xbmc/XBApplicationEx.h b/xbmc/XBApplicationEx.h
+index 9bc14fa..f696b89 100644
+--- a/xbmc/XBApplicationEx.h
++++ b/xbmc/XBApplicationEx.h
+@@ -42,6 +42,7 @@ public:
+   // Variables for timing
+   bool m_bStop;
+   int  m_ExitCode;
++  bool m_ExitCodeSet;
+   bool m_AppFocused;
+   bool m_renderGUI;
+ 
+diff --git a/xbmc/platform/posix/main.cpp b/xbmc/platform/posix/main.cpp
+index a8b64e5..3d80032 100644
+--- a/xbmc/platform/posix/main.cpp
++++ b/xbmc/platform/posix/main.cpp
+@@ -41,12 +41,27 @@
+ #include "input/linux/LIRC.h"
+ #endif
+ #include "platform/XbmcContext.h"
++#include "Application.h"
++
++void xbmc_term_handler(int signum)
++{
++  CLog::Log(LOGINFO, "Received SIGTERM...");
++  if (!g_application.m_ExitCodeSet)
++    g_application.SetExitCode(EXITCODE_RESTARTAPP);
++  g_application.Stop(EXITCODE_RESTARTAPP);
++}
+ 
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+ int main(int argc, char* argv[])
+ {
++  // SIGTERM handler
++  struct sigaction action;
++  memset(&action, 0, sizeof(struct sigaction));
++  action.sa_handler = xbmc_term_handler;
++  sigaction(SIGTERM, &action, NULL);
++
+   // set up some xbmc specific relationships
+   XBMC::Context context;
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0005-add-support-to-read-frequency-output-if-using-intel-.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0005-add-support-to-read-frequency-output-if-using-intel-.patch
new file mode 100644
index 0000000..ee10c40
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0005-add-support-to-read-frequency-output-if-using-intel-.patch
@@ -0,0 +1,26 @@
+From 4d1368d20f04216aec9551d9845b305f96a21015 Mon Sep 17 00:00:00 2001
+From: Stephan Raue <stephan@openelec.tv>
+Date: Mon, 1 Sep 2014 03:16:37 +0200
+Subject: [PATCH 05/10] add support to read frequency output if using intel's
+ pstate driver
+
+---
+ xbmc/utils/CPUInfo.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp
+index 5e2ebbd..fd04d5a 100644
+--- a/xbmc/utils/CPUInfo.cpp
++++ b/xbmc/utils/CPUInfo.cpp
+@@ -274,6 +274,8 @@ CCPUInfo::CCPUInfo(void)
+     m_fProcTemperature = fopen("/sys/class/thermal/thermal_zone0/temp", "r");  // On Raspberry PIs
+ 
+   m_fCPUFreq = fopen ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
++  if (m_fCPUFreq == NULL)
++    m_fCPUFreq = fopen ("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq", "r");
+   if (!m_fCPUFreq)
+   {
+     m_cpuInfoForFreq = true;
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0006-Disable-DVD-support.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0006-Disable-DVD-support.patch
new file mode 100644
index 0000000..08dfac3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0006-Disable-DVD-support.patch
@@ -0,0 +1,35 @@
+From 3d3ec391038c6ee73897a7fab753b11b589de1ed Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 2 Nov 2016 12:39:20 -0700
+Subject: [PATCH 06/10] Disable DVD support
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.in | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 0d70e9b..050c7ca 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -10,8 +10,7 @@ EC_DIRS= \
+ 	tools/EventClients
+ 
+ DVDPCODECS_DIRS= \
+-	lib \
+-	lib/libdvd
++	lib
+ 
+ VideoPlayer_ARCHIVES=xbmc/cores/VideoPlayer/VideoPlayer.a \
+                    xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecs.a \
+@@ -347,7 +346,6 @@ libaddon: exports
+ 	$(MAKE) -C lib/addons/library.xbmc.pvr
+ 	$(MAKE) -C lib/addons/library.kodi.inputstream
+ dvdpcodecs: dllloader
+-	$(MAKE) -C lib/libdvd
+ 
+ dvdpextcodecs:
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0007-Always-compile-libcpluff-as-PIC.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0007-Always-compile-libcpluff-as-PIC.patch
new file mode 100644
index 0000000..8fd7ece
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0007-Always-compile-libcpluff-as-PIC.patch
@@ -0,0 +1,30 @@
+From d989cbdb7686c3b95dc749967f89b93e47f955a6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 3 Nov 2016 13:10:00 -0700
+Subject: [PATCH 07/10] Always compile libcpluff as PIC
+
+Fixes errors e.g.
+
+ld: lib/cpluff/libcpluff/.libs/libcpluff.a(pcontrol.o): relocation R_X86_64_PC32 against symbol `cp_stop_plugins' can not be used when making a shared object; recompile with -fPIC
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3132dc1..ab4eea3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2385,7 +2385,7 @@ XB_CONFIG_MODULE([lib/cpluff], [
+     --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
+     --host=$host_alias \
+     --build=$build_alias \
+-    --target=$target_alias CFLAGS="$CFLAGS" CC="$CC" CXX="$CXX" LDFLAGS="$LDFLAGS" LIBS=""
++    --target=$target_alias --with-pic=yes CFLAGS="$CFLAGS" CC="$CC" CXX="$CXX" LDFLAGS="$LDFLAGS" LIBS=""
+     #LDFLAGS="$LDFLAGS -Wl,-read_only_relocs,suppress"
+ ], [0])
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0008-kodi-config.cmake-use-CMAKE_FIND_ROOT_PATH-to-fix-cr.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0008-kodi-config.cmake-use-CMAKE_FIND_ROOT_PATH-to-fix-cr.patch
new file mode 100644
index 0000000..9390144
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0008-kodi-config.cmake-use-CMAKE_FIND_ROOT_PATH-to-fix-cr.patch
@@ -0,0 +1,43 @@
+From 51cd8d5f084013360b29fe497193288ebde2f4f9 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Wed, 29 Jul 2015 23:13:33 +0200
+Subject: [PATCH 08/10] kodi-config.cmake: use CMAKE_FIND_ROOT_PATH to fix
+ cross-compilation
+
+When cross-compiling, the location at build time of the libraries is
+not the same as the one at run-time. The CMAKE_FIND_ROOT_PATH variable
+is here to handle this difference, so use it in kodi-config.cmake.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ project/cmake/KodiConfig.cmake.in | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/project/cmake/KodiConfig.cmake.in b/project/cmake/KodiConfig.cmake.in
+index c02a680..9d6a566 100644
+--- a/project/cmake/KodiConfig.cmake.in
++++ b/project/cmake/KodiConfig.cmake.in
+@@ -7,10 +7,10 @@ if(NOT @APP_NAME_UC@_PREFIX)
+   set(@APP_NAME_UC@_PREFIX @APP_PREFIX@)
+ endif()
+ if(NOT @APP_NAME_UC@_INCLUDE_DIR)
+-  set(@APP_NAME_UC@_INCLUDE_DIR @APP_INCLUDE_DIR@)
++  set(@APP_NAME_UC@_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/@APP_INCLUDE_DIR@)
+ endif()
+ if(NOT @APP_NAME_UC@_LIB_DIR)
+-  set(@APP_NAME_UC@_LIB_DIR @APP_LIB_DIR@)
++  set(@APP_NAME_UC@_LIB_DIR ${CMAKE_FIND_ROOT_PATH}/@APP_LIB_DIR@)
+ endif()
+ if(NOT @APP_NAME_UC@_DATA_DIR)
+   set(@APP_NAME_UC@_DATA_DIR @APP_DATA_DIR@)
+@@ -19,6 +19,7 @@ if(NOT WIN32)
+   set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@")
+ endif()
+ list(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@ @APP_DATA_DIR@/cmake)
++list(APPEND CMAKE_MODULE_PATH ${CMAKE_FIND_ROOT_PATH}/@APP_LIB_DIR@ ${CMAKE_FIND_ROOT_PATH}/@APP_DATA_DIR@/cmake)
+ 
+ string(REPLACE ";" " " ARCH_DEFINES "@ARCH_DEFINES@")
+ add_definitions(${ARCH_DEFINES} -DBUILD_KODI_ADDON)
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0009-build-Add-support-for-musl-triplets.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0009-build-Add-support-for-musl-triplets.patch
new file mode 100644
index 0000000..f3e739a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0009-build-Add-support-for-musl-triplets.patch
@@ -0,0 +1,180 @@
+From 8b2bad58585af0f829fb06e19c9bd2b6caf30808 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 6 Nov 2016 11:54:41 -0800
+Subject: [PATCH 09/10] build: Add support for musl triplets
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac               | 12 ++++++------
+ m4/xbmc_arch.m4            | 22 +++++++++++-----------
+ tools/depends/configure.ac | 12 ++++++------
+ 3 files changed, 23 insertions(+), 23 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ab4eea3..925466a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -526,7 +526,7 @@ case $host in
+      use_x11=no
+      build_shared_lib=yes
+      ;;
+-  i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
++  i*86*-linux-gnu*|i*86*-*-linux-uclibc*|i*86*-*-linux-musl*)
+      target_platform=target_linux
+      CORE_SYSTEM_NAME=linux
+      ARCH="i486-linux"
+@@ -549,7 +549,7 @@ case $host in
+        fi
+      fi
+      ;;
+-  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
++  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*)
+      target_platform=target_linux
+      CORE_SYSTEM_NAME=linux
+      ARCH="x86_64-linux"
+@@ -601,17 +601,17 @@ case $host in
+      DEPENDS_ROOT_FOR_XCODE=$(echo ${prefix%/*})
+      AC_SUBST([DEPENDS_ROOT_FOR_XCODE])
+      ;;
+-  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*)
++  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*|powerpc-*-linux-musl*)
+      target_platform=target_linux
+      CORE_SYSTEM_NAME=linux
+      ARCH="powerpc-linux"
+      ;;
+-  powerpc64*-*-linux-gnu*|powerpc64*-*-linux-uclibc*)
++  powerpc64*-*-linux-gnu*|powerpc64*-*-linux-uclibc*|powerpc64*-*-linux-musl*)
+      target_platform=target_linux
+      CORE_SYSTEM_NAME=linux
+      ARCH="powerpc64-linux"
+      ;;
+-  arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
++  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*)
+      target_platform=target_linux
+      CORE_SYSTEM_NAME=linux
+      ARCH="arm"
+@@ -621,7 +621,7 @@ case $host in
+      use_gl=no
+      USE_STATIC_FFMPEG=1
+      ;;
+-  aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*)
++  aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*|aarch64*-*-linux-musl*)
+      target_platform=target_linux
+      ARCH="aarch64"
+      use_arch="aarch64"
+diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4
+index d28f263..ff5dc20 100644
+--- a/m4/xbmc_arch.m4
++++ b/m4/xbmc_arch.m4
+@@ -2,10 +2,10 @@ AC_DEFUN([XBMC_SETUP_ARCH_DEFINES],[
+ 
+ # build detection and setup - this is the native arch
+ case $build in
+-  i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
++  i*86*-linux-gnu*|i*86*-*-linux-uclibc*|i*86*-*-linux-musl*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+-  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
++  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+   i386-*-freebsd*)
+@@ -17,13 +17,13 @@ case $build in
+   *86*-apple-darwin*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
+      ;;
+-  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*)
++  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*|powerpc-*-linux-musl*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC")
+      ;;
+-  powerpc64-*-linux-gnu*|powerpc64-*-linux-uclibc*)
++  powerpc64-*-linux-gnu*|powerpc64-*-linux-uclibc*|powerpc64-*-linux-musl*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64")
+      ;;
+-  arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
++  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+   *)
+@@ -33,10 +33,10 @@ esac
+ 
+ # host detection and setup - this is the target arch
+ case $host in
+-  i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
++  i*86*-linux-gnu*|i*86*-*-linux-uclibc*|i*86*-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+-  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
++  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+   i386-*-freebsd*)
+@@ -54,16 +54,16 @@ case $host in
+   powerpc-apple-darwin*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
+      ;;
+-  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*)
++  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*|powerpc-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC")
+      ;;
+-  powerpc64*-*-linux-gnu*|powerpc64*-*-linux-uclibc*)
++  powerpc64*-*-linux-gnu*|powerpc64*-*-linux-uclibc*|powerpc64*-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64")
+      ;;
+-  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*)
++  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*|aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*|aarch64*-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+-  mips*-*-linux-gnu*|mips*-*-linux-uclibc*)
++  mips*-*-linux-gnu*|mips*-*-linux-uclibc*|mips*-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+   *-*linux-android*)
+diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac
+index f438e5d..409f4d7 100644
+--- a/tools/depends/configure.ac
++++ b/tools/depends/configure.ac
+@@ -120,13 +120,13 @@ platform_cc=gcc
+ platform_cxx=g++
+ 
+ case $build in
+-  arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
++  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*)
+     build_os="linux"
+   ;;
+-  *i686*-linux-gnu*|i*86*-*-linux-uclibc*)
++  *i686*-linux-gnu*|i*86*-*-linux-uclibc*|i*86*-*-linux-musl*)
+     build_os="linux"
+   ;;
+-  x86_64*-linux-gnu*|x86_64-*-linux-uclibc*)
++  x86_64*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*)
+     build_os="linux"
+   ;;
+   *darwin*)
+@@ -186,7 +186,7 @@ case $host in
+     #android builds are always cross
+     cross_compiling="yes"
+   ;;
+-  arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
++  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*)
+     if test "$use_platform" = "auto"; then
+       if test "x$use_cpu" = "xauto"; then
+         use_cpu=$host_cpu
+@@ -210,12 +210,12 @@ case $host in
+       platform_os="linux"
+     fi
+   ;;
+-  *i686*-linux-gnu*|i*86*-*-linux-uclibc*)
++  *i686*-linux-gnu*|i*86*-*-linux-uclibc*|i*86*-*-linux-musl*)
+     use_cpu=$host_cpu
+     use_toolchain="${use_toolchain:-/usr}"
+     platform_os="linux"
+   ;;
+-  x86_64*-linux-gnu*|x86_64-*-linux-uclibc*)
++  x86_64*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*)
+     use_cpu=$host_cpu
+     use_toolchain="${use_toolchain:-/usr}"
+     platform_cflags="-fPIC -DPIC"
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0010-RssReader-Fix-compiler-warning-comparing-pointer-to-.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0010-RssReader-Fix-compiler-warning-comparing-pointer-to-.patch
new file mode 100644
index 0000000..e34a5b7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0010-RssReader-Fix-compiler-warning-comparing-pointer-to-.patch
@@ -0,0 +1,40 @@
+From 55233024648b5673dbf223586968e71cc4c70711 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 16 Nov 2016 18:49:36 -0800
+Subject: [PATCH 10/10] RssReader: Fix compiler warning comparing pointer to
+ zero
+
+Clang finds this warning
+RssReader.cpp:272:19: error: ordered comparison between pointer and zero ('TiXmlElement *' and 'int')
+  while (itemNode > 0)
+         ~~~~~~~~ ^ ~
+RssReader.cpp:276:22: error: ordered comparison between pointer and zero ('TiXmlNode *' and 'int')
+    while (childNode > 0)
+           ~~~~~~~~~ ^ ~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ xbmc/utils/RssReader.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/xbmc/utils/RssReader.cpp b/xbmc/utils/RssReader.cpp
+index 9186f56..2494dc8 100644
+--- a/xbmc/utils/RssReader.cpp
++++ b/xbmc/utils/RssReader.cpp
+@@ -269,11 +269,11 @@ void CRssReader::GetNewsItems(TiXmlElement* channelXmlNode, int iFeed)
+   if (m_tagSet.empty())
+     AddTag("title");
+ 
+-  while (itemNode > 0)
++  while (itemNode != NULL)
+   {
+     TiXmlNode* childNode = itemNode->FirstChild();
+     mTagElements.clear();
+-    while (childNode > 0)
++    while (childNode != NULL)
+     {
+       std::string strName = childNode->ValueStr();
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0011-Let-configure-pass-on-unknown-architectures-setting-.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0011-Let-configure-pass-on-unknown-architectures-setting-.patch
new file mode 100644
index 0000000..7ee44f1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0011-Let-configure-pass-on-unknown-architectures-setting-.patch
@@ -0,0 +1,54 @@
+From 19a1ffc1450bd3ecfb7419d74c733b2e16bf47f3 Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint@balintreczey.hu>
+Date: Wed, 26 Aug 2015 08:14:41 +0200
+Subject: [PATCH 11/12] Let configure pass on unknown architectures setting
+ sane defaults
+
+This helps porting Kodi to new architectures while emitting warnings about
+entering uncharted territory.
+---
+ configure.ac    | 3 ++-
+ m4/xbmc_arch.m4 | 6 ++++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 925466a..8369615 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -658,7 +658,8 @@ case $host in
+      USE_STATIC_FFMPEG=1
+      ;;
+   *)
+-     AC_MSG_ERROR(unsupported host ($host))
++    ARCH=$host_cpu"-"$host_os
++    AC_MSG_WARN([unsupported host ($host), guessing ARCH as $ARCH.])
+ esac
+ AC_SUBST([ARCH])
+ 
+diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4
+index ff5dc20..dfb45fd 100644
+--- a/m4/xbmc_arch.m4
++++ b/m4/xbmc_arch.m4
+@@ -27,7 +27,8 @@ case $build in
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+   *)
+-     AC_MSG_ERROR(unsupported native build platform: $build)
++     AC_MSG_WARN([unsupported native build platform: $build])
++     AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+ esac
+ 
+ 
+@@ -70,7 +71,8 @@ case $host in
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID")
+      ;;
+   *)
+-     AC_MSG_ERROR(unsupported build target: $host)
++     AC_MSG_WARN([unsupported native build platform: $build])
++     AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+ esac
+ 
+ if test "$target_platform" = "target_android" ; then
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0012-Revert-droid-fix-builds-with-AML-disabled.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0012-Revert-droid-fix-builds-with-AML-disabled.patch
new file mode 100644
index 0000000..8d70b3f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0012-Revert-droid-fix-builds-with-AML-disabled.patch
@@ -0,0 +1,87 @@
+From 9e88aa086083b80c05b2bf057b92682186c4e6dc Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint@balintreczey.hu>
+Date: Thu, 6 Oct 2016 18:12:18 +0200
+Subject: [PATCH 12/12] Revert "[droid] fix builds with AML disabled"
+
+This reverts commit 4733383b8f1c1dd0b95e9e5358425d8a0b7ba8fc.
+---
+ xbmc/utils/SystemInfo.cpp         |  4 ----
+ xbmc/windowing/egl/EGLWrapper.cpp | 16 ++++++----------
+ 2 files changed, 6 insertions(+), 14 deletions(-)
+
+diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp
+index fcc6733..52e7fa3 100644
+--- a/xbmc/utils/SystemInfo.cpp
++++ b/xbmc/utils/SystemInfo.cpp
+@@ -57,10 +57,8 @@
+ #include "utils/XMLUtils.h"
+ #if defined(TARGET_ANDROID)
+ #include "platform/android/jni/Build.h"
+-#if defined(HAS_LIBAMCODEC)
+ #include "utils/AMLUtils.h"
+ #endif
+-#endif
+ 
+ /* Platform identification */
+ #if defined(TARGET_DARWIN)
+@@ -873,11 +871,9 @@ bool CSysInfo::IsAeroDisabled()
+ bool CSysInfo::HasHW3DInterlaced()
+ {
+ #if defined(TARGET_ANDROID)
+-#if defined(HAS_LIBAMCODEC)
+   if (aml_hw3d_present())
+     return true;
+ #endif
+-#endif
+   return false;
+ }
+ 
+diff --git a/xbmc/windowing/egl/EGLWrapper.cpp b/xbmc/windowing/egl/EGLWrapper.cpp
+index 30f5757..583d43a 100644
+--- a/xbmc/windowing/egl/EGLWrapper.cpp
++++ b/xbmc/windowing/egl/EGLWrapper.cpp
+@@ -24,19 +24,15 @@
+ #include <assert.h>
+ #if defined(TARGET_ANDROID)
+   #include "EGLNativeTypeAndroid.h"
+-#if defined(HAS_LIBAMCODEC)
+   #include "EGLNativeTypeAmlAndroid.h"
+ #endif
+-#endif
+ #if defined(TARGET_RASPBERRY_PI)
+   #include "EGLNativeTypeRaspberryPI.h"
+ #endif
+ #if defined(HAS_IMXVPU)
+   #include "EGLNativeTypeIMX.h"
+ #endif
+-#if defined(TARGET_LINUX) && defined(HAS_LIBAMCODEC)
+ #include "EGLNativeTypeAmlogic.h"
+-#endif
+ #include "EGLWrapper.h"
+ 
+ #define CheckError() m_result = eglGetError(); if(m_result != EGL_SUCCESS) CLog::Log(LOGERROR, "EGL error in %s: %x",__FUNCTION__, m_result);
+@@ -91,15 +87,15 @@ bool CEGLWrapper::Initialize(const std::string &implementation)
+   // Try to create each backend in sequence and go with the first one
+   // that we know will work
+   if (
+-#if defined(TARGET_ANDROID) && defined(HAS_LIBAMCODEC)
+-      (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAmlAndroid>(implementation))
+-#elif defined(TARGET_ANDROID)
+-      (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAndroid>(implementation))
+-#elif defined(TARGET_RASPBERRY_PI)
++#if defined(TARGET_ANDROID)
++      (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAmlAndroid>(implementation)) ||
++      (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAndroid>(implementation)) ||
++#endif
++#if defined(TARGET_RASPBERRY_PI)
+       (nativeGuess = CreateEGLNativeType<CEGLNativeTypeRaspberryPI>(implementation))
+ #elif defined(HAS_IMXVPU)
+       (nativeGuess = CreateEGLNativeType<CEGLNativeTypeIMX>(implementation))
+-#elif defined(TARGET_LINUX) && defined(HAS_LIBAMCODEC)
++#else
+       (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAmlogic>(implementation))
+ #endif
+       )
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0013-FTPParse.cpp-use-std-string.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0013-FTPParse.cpp-use-std-string.patch
new file mode 100644
index 0000000..c9c9066
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0013-FTPParse.cpp-use-std-string.patch
@@ -0,0 +1,96 @@
+From 5fa10ff6b1b60abee172296d9c1dec8dfc10615c Mon Sep 17 00:00:00 2001
+From: Stefan Saraev <stefan@saraev.ca>
+Date: Sun, 7 May 2017 17:30:47 +0300
+Subject: [PATCH] FTPParse.cpp: use std::string
+
+Fixes build with newer gcc versions.
+
+Taken from [1]
+
+Upstream-Status: Backport [2]
+
+[1] https://git.busybox.net/buildroot/plain/package/kodi/0003-FTPParse.cpp-use-std-string.patch?id=e2f03a6bde19766a1ac047c5ccfb049b5c4f61ca
+[2] https://github.com/xbmc/xbmc/commit/5fa10ff6b1b60abee172296d9c1dec8dfc10615c
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ xbmc/filesystem/FTPParse.cpp | 44 ++++++++++++++++++++++----------------------
+ 1 file changed, 22 insertions(+), 22 deletions(-)
+
+diff --git a/xbmc/filesystem/FTPParse.cpp b/xbmc/filesystem/FTPParse.cpp
+index cfcc7c64ed..b0f676ae1a 100644
+--- a/xbmc/filesystem/FTPParse.cpp
++++ b/xbmc/filesystem/FTPParse.cpp
+@@ -34,7 +34,7 @@ CFTPParse::CFTPParse()
+   m_time = 0;
+ }
+ 
+-string CFTPParse::getName()
++std::string CFTPParse::getName()
+ {
+   return m_name;
+ }
+@@ -59,16 +59,16 @@ time_t CFTPParse::getTime()
+   return m_time;
+ }
+ 
+-void CFTPParse::setTime(string str)
++void CFTPParse::setTime(std::string str)
+ {
+   /* Variables used to capture patterns via the regexes */
+-  string month;
+-  string day;
+-  string year;
+-  string hour;
+-  string minute;
+-  string second;
+-  string am_or_pm;
++  std::string month;
++  std::string day;
++  std::string year;
++  std::string hour;
++  std::string minute;
++  std::string second;
++  std::string am_or_pm;
+ 
+   /* time struct used to set the time_t variable */
+   struct tm time_struct = {};
+@@ -338,21 +338,21 @@ int CFTPParse::getDayOfWeek(int month, int date, int year)
+   return day_of_week;
+ }
+ 
+-int CFTPParse::FTPParse(string str)
++int CFTPParse::FTPParse(std::string str)
+ {
+   /* Various variable to capture patterns via the regexes */
+-  string permissions;
+-  string link_count;
+-  string owner;
+-  string group;
+-  string size;
+-  string date;
+-  string name;
+-  string type;
+-  string stuff;
+-  string facts;
+-  string version;
+-  string file_id;
++  std::string permissions;
++  std::string link_count;
++  std::string owner;
++  std::string group;
++  std::string size;
++  std::string date;
++  std::string name;
++  std::string type;
++  std::string stuff;
++  std::string facts;
++  std::string version;
++  std::string file_id;
+ 
+   /* Regex for standard Unix listing formats */
+   pcrecpp::RE unix_re("^([-bcdlps])" // type
+-- 
+2.11.0
+
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts/0001-Update-to-p8-platform.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts/0001-Update-to-p8-platform.patch
new file mode 100644
index 0000000..c4a6ae7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts/0001-Update-to-p8-platform.patch
@@ -0,0 +1,427 @@
+From 06a8224c99282ac1a606edd9e8ea3f591112942d Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Thu, 18 Feb 2016 14:04:31 +0100
+Subject: [PATCH] Update to p8-platform
+
+---
+ CMakeLists.txt                         |  6 +++---
+ pvr.hts/changelog.txt                  |  4 ++--
+ src/AutoRecordings.cpp                 |  2 +-
+ src/HTSPConnection.cpp                 |  8 +++----
+ src/HTSPDemuxer.cpp                    |  2 +-
+ src/HTSPVFS.cpp                        |  6 +++---
+ src/TimeRecordings.cpp                 |  2 +-
+ src/Tvheadend.cpp                      |  4 ++--
+ src/Tvheadend.h                        | 38 +++++++++++++++++-----------------
+ src/client.cpp                         |  4 ++--
+ src/client.h                           |  4 ++--
+ src/tvheadend/Subscription.cpp         |  2 +-
+ src/tvheadend/Subscription.h           |  4 ++--
+ src/tvheadend/utilities/AsyncState.cpp |  4 ++--
+ src/tvheadend/utilities/AsyncState.h   |  6 +++---
+ 15 files changed, 48 insertions(+), 48 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0842682..cb04942 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,10 +6,10 @@ enable_language(CXX)
+ 
+ find_package(kodi REQUIRED)
+ find_package(kodiplatform REQUIRED)
+-find_package(platform REQUIRED)
++find_package(p8-platform REQUIRED)
+ 
+ include_directories(${kodiplatform_INCLUDE_DIRS}
+-                    ${platform_INCLUDE_DIRS}
++                    ${p8-platform_INCLUDE_DIRS}
+                     ${KODI_INCLUDE_DIR}
+                     ${PROJECT_SOURCE_DIR}/lib)
+ 
+@@ -95,7 +95,7 @@ list(APPEND HTS_SOURCES
+ 
+ add_subdirectory(lib/libhts)
+ 
+-set(DEPLIBS ${platform_LIBRARIES} hts)
++set(DEPLIBS ${p8-platform_LIBRARIES} hts)
+ if(WIN32)
+   list(APPEND DEPLIBS ws2_32)
+ endif()
+diff --git a/pvr.hts/changelog.txt b/pvr.hts/changelog.txt
+index 9ffa33c..1e7fe30 100644
+--- a/pvr.hts/changelog.txt
++++ b/pvr.hts/changelog.txt
+@@ -49,7 +49,7 @@
+ - fixed: Autorec: Start and stop time handling.
+ - fixed: LocaltimeToUTC conversion (timer settings clock display incorrect).
+ - fixed: Several issues with predictive tuning.
+-- added: build: Automatically fill in platform and library name.
++- added: build: Automatically fill in p8-platform and library name.
+ - fixed: Use epg data only for creation of epg-based timers.
+ - improved: Do not try to reconnect to tvh while suspending or not fully awake again.
+ 
+@@ -97,7 +97,7 @@
+ - added: support for creating repeating timers, aka time schedules
+ - fixed: conditions for addon restart after settings changes
+ - internal: fixed build system regressions introduced with move to cmake
+-- internal: updated to use libplatform
++- internal: updated to use libp8-platform
+ 
+ 2.1.7
+ - added: support for radio channel groups
+diff --git a/src/AutoRecordings.cpp b/src/AutoRecordings.cpp
+index 5fa60a0..d9e5e1d 100644
+--- a/src/AutoRecordings.cpp
++++ b/src/AutoRecordings.cpp
+@@ -26,7 +26,7 @@
+ #include "tvheadend/utilities/Utilities.h"
+ #include "tvheadend/utilities/Logger.h"
+ 
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::entity;
+ using namespace tvheadend::utilities;
+diff --git a/src/HTSPConnection.cpp b/src/HTSPConnection.cpp
+index aec1296..86f5004 100644
+--- a/src/HTSPConnection.cpp
++++ b/src/HTSPConnection.cpp
+@@ -19,9 +19,9 @@
+  *
+  */
+ 
+-#include "platform/threads/mutex.h"
+-#include "platform/util/StringUtils.h"
+-#include "platform/sockets/tcp.h"
++#include "p8-platform/threads/mutex.h"
++#include "p8-platform/util/StringUtils.h"
++#include "p8-platform/sockets/tcp.h"
+ 
+ extern "C" {
+ #include "libhts/htsmsg_binary.h"
+@@ -33,7 +33,7 @@ extern "C" {
+ 
+ using namespace std;
+ using namespace ADDON;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::utilities;
+ 
+diff --git a/src/HTSPDemuxer.cpp b/src/HTSPDemuxer.cpp
+index a6e1f12..7f45345 100644
+--- a/src/HTSPDemuxer.cpp
++++ b/src/HTSPDemuxer.cpp
+@@ -27,7 +27,7 @@
+ 
+ using namespace std;
+ using namespace ADDON;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::utilities;
+ 
+diff --git a/src/HTSPVFS.cpp b/src/HTSPVFS.cpp
+index 0463f56..0404bab 100644
+--- a/src/HTSPVFS.cpp
++++ b/src/HTSPVFS.cpp
+@@ -19,8 +19,8 @@
+  *
+  */
+ 
+-#include "platform/threads/mutex.h"
+-#include "platform/util/StringUtils.h"
++#include "p8-platform/threads/mutex.h"
++#include "p8-platform/util/StringUtils.h"
+ #include "tvheadend/utilities/Logger.h"
+ 
+ extern "C" {
+@@ -30,7 +30,7 @@ extern "C" {
+ #include "Tvheadend.h"
+ 
+ using namespace std;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend::utilities;
+ 
+ /*
+diff --git a/src/TimeRecordings.cpp b/src/TimeRecordings.cpp
+index 5d34938..97aae09 100644
+--- a/src/TimeRecordings.cpp
++++ b/src/TimeRecordings.cpp
+@@ -25,7 +25,7 @@
+ #include "tvheadend/utilities/Utilities.h"
+ #include "tvheadend/utilities/Logger.h"
+ 
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::entity;
+ using namespace tvheadend::utilities;
+diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp
+index 2057241..14c3bd4 100644
+--- a/src/Tvheadend.cpp
++++ b/src/Tvheadend.cpp
+@@ -23,7 +23,7 @@
+ #include <ctime>
+ #include <memory>
+ 
+-#include "platform/util/StringUtils.h"
++#include "p8-platform/util/StringUtils.h"
+ 
+ #include "Tvheadend.h"
+ #include "tvheadend/utilities/Utilities.h"
+@@ -31,7 +31,7 @@
+ 
+ using namespace std;
+ using namespace ADDON;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::entity;
+ using namespace tvheadend::utilities;
+diff --git a/src/Tvheadend.h b/src/Tvheadend.h
+index 2ce4552..e794716 100644
+--- a/src/Tvheadend.h
++++ b/src/Tvheadend.h
+@@ -22,10 +22,10 @@
+  */
+ 
+ #include "client.h"
+-#include "platform/sockets/tcp.h"
+-#include "platform/threads/threads.h"
+-#include "platform/threads/mutex.h"
+-#include "platform/util/buffer.h"
++#include "p8-platform/sockets/tcp.h"
++#include "p8-platform/threads/threads.h"
++#include "p8-platform/threads/mutex.h"
++#include "p8-platform/util/buffer.h"
+ #include "kodi/xbmc_codec_types.h"
+ #include "kodi/xbmc_stream_utils.hpp"
+ #include "kodi/libXBMC_addon.h"
+@@ -88,7 +88,7 @@ class CHTSPMessage;
+ 
+ /* Typedefs */
+ typedef std::map<uint32_t,CHTSPResponse*> CHTSPResponseList;
+-typedef PLATFORM::SyncedBuffer<CHTSPMessage> CHTSPMessageQueue;
++typedef P8PLATFORM::SyncedBuffer<CHTSPMessage> CHTSPMessageQueue;
+ 
+ /*
+  * HTSP Response handler
+@@ -98,10 +98,10 @@ class CHTSPResponse
+ public:
+   CHTSPResponse();
+   ~CHTSPResponse();
+-  htsmsg_t *Get ( PLATFORM::CMutex &mutex, uint32_t timeout );
++  htsmsg_t *Get ( P8PLATFORM::CMutex &mutex, uint32_t timeout );
+   void      Set ( htsmsg_t *m );
+ private:
+-  PLATFORM::CCondition<volatile bool> m_cond;
++  P8PLATFORM::CCondition<volatile bool> m_cond;
+   bool                                m_flag;
+   htsmsg_t                           *m_msg;
+ };
+@@ -146,7 +146,7 @@ public:
+  * HTSP Connection registration thread
+  */
+ class CHTSPRegister
+-  : public PLATFORM::CThread
++  : public P8PLATFORM::CThread
+ {
+   friend class CHTSPConnection;
+ 
+@@ -163,7 +163,7 @@ private:
+  * HTSP Connection
+  */
+ class CHTSPConnection
+-  : public PLATFORM::CThread
++  : public P8PLATFORM::CThread
+ {
+   friend class CHTSPRegister;
+ 
+@@ -190,7 +190,7 @@ public:
+   inline bool IsConnected       ( void ) const { return m_ready; }
+   bool        WaitForConnection ( void );
+ 
+-  inline PLATFORM::CMutex& Mutex ( void ) { return m_mutex; }
++  inline P8PLATFORM::CMutex& Mutex ( void ) { return m_mutex; }
+ 
+   void        OnSleep ( void );
+   void        OnWake  ( void );
+@@ -202,10 +202,10 @@ private:
+   bool        SendHello        ( void );
+   bool        SendAuth         ( const std::string &u, const std::string &p );
+ 
+-  PLATFORM::CTcpSocket               *m_socket;
+-  PLATFORM::CMutex                    m_mutex;
++  P8PLATFORM::CTcpSocket               *m_socket;
++  P8PLATFORM::CMutex                    m_mutex;
+   CHTSPRegister                       m_regThread;
+-  PLATFORM::CCondition<volatile bool> m_regCond;
++  P8PLATFORM::CCondition<volatile bool> m_regCond;
+   bool                                m_ready;
+   uint32_t                            m_seq;
+   std::string                         m_serverName;
+@@ -273,13 +273,13 @@ public:
+   void SetStreamingProfile(const std::string &profile);
+ 
+ private:
+-  PLATFORM::CMutex                        m_mutex;
++  P8PLATFORM::CMutex                        m_mutex;
+   CHTSPConnection                        &m_conn;
+-  PLATFORM::SyncedBuffer<DemuxPacket*>    m_pktBuffer;
++  P8PLATFORM::SyncedBuffer<DemuxPacket*>    m_pktBuffer;
+   ADDON::XbmcStreamProperties             m_streams;
+   std::map<int,int>                       m_streamStat;
+   int64_t                                 m_seekTime;
+-  PLATFORM::CCondition<volatile int64_t>  m_seekCond;
++  P8PLATFORM::CCondition<volatile int64_t>  m_seekCond;
+   bool                                    m_seeking;
+   bool                                    m_speedChange;
+   tvheadend::status::SourceInfo           m_sourceInfo;
+@@ -350,7 +350,7 @@ private:
+  * Root object for Tvheadend connection
+  */
+ class CTvheadend
+-  : public PLATFORM::CThread
++  : public P8PLATFORM::CThread
+ {
+ public:
+   CTvheadend();
+@@ -422,7 +422,7 @@ private:
+    */
+   tvheadend::Profiles         m_profiles;
+ 
+-  PLATFORM::CMutex            m_mutex;
++  P8PLATFORM::CMutex            m_mutex;
+ 
+   CHTSPConnection             m_conn;
+ 
+@@ -519,7 +519,7 @@ public:
+    */
+   bool WaitForConnection ( void )
+   {
+-    PLATFORM::CLockObject lock(m_conn.Mutex());
++    P8PLATFORM::CLockObject lock(m_conn.Mutex());
+     return m_conn.WaitForConnection();
+   }
+   std::string GetServerName    ( void )
+diff --git a/src/client.cpp b/src/client.cpp
+index 94d2db9..3295914 100644
+--- a/src/client.cpp
++++ b/src/client.cpp
+@@ -22,14 +22,14 @@
+ #include "client.h"
+ #include "kodi/xbmc_pvr_dll.h"
+ #include "kodi/libKODI_guilib.h"
+-#include "platform/util/util.h"
++#include "p8-platform/util/util.h"
+ #include "Tvheadend.h"
+ #include "tvheadend/Settings.h"
+ #include "tvheadend/utilities/Logger.h"
+ 
+ using namespace std;
+ using namespace ADDON;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::utilities;
+ 
+diff --git a/src/client.h b/src/client.h
+index 3a5f950..a10659b 100644
+--- a/src/client.h
++++ b/src/client.h
+@@ -20,8 +20,8 @@
+  *
+  */
+ 
+-#include "platform/os.h"
+-#include "platform/threads/mutex.h"
++#include "p8-platform/os.h"
++#include "p8-platform/threads/mutex.h"
+ #include "kodi/libXBMC_addon.h"
+ #include "kodi/libXBMC_pvr.h"
+ #include "kodi/libXBMC_codec.h"
+diff --git a/src/tvheadend/Subscription.cpp b/src/tvheadend/Subscription.cpp
+index 182ca7f..e18af1e 100644
+--- a/src/tvheadend/Subscription.cpp
++++ b/src/tvheadend/Subscription.cpp
+@@ -23,7 +23,7 @@
+ #include "utilities/Logger.h"
+ #include "../Tvheadend.h"
+ 
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::utilities;
+ 
+diff --git a/src/tvheadend/Subscription.h b/src/tvheadend/Subscription.h
+index b03bcce..363e5ef 100644
+--- a/src/tvheadend/Subscription.h
++++ b/src/tvheadend/Subscription.h
+@@ -22,7 +22,7 @@
+  */
+ 
+ #include <string>
+-#include "platform/threads/mutex.h"
++#include "p8-platform/threads/mutex.h"
+ 
+ extern "C"
+ {
+@@ -146,6 +146,6 @@ namespace tvheadend
+     std::string       m_profile;
+     CHTSPConnection   &m_conn;
+ 
+-    mutable PLATFORM::CMutex  m_mutex;
++    mutable P8PLATFORM::CMutex  m_mutex;
+   };
+ }
+diff --git a/src/tvheadend/utilities/AsyncState.cpp b/src/tvheadend/utilities/AsyncState.cpp
+index 0c30a93..1f4fdf3 100644
+--- a/src/tvheadend/utilities/AsyncState.cpp
++++ b/src/tvheadend/utilities/AsyncState.cpp
+@@ -22,7 +22,7 @@
+ #include "AsyncState.h"
+ 
+ using namespace tvheadend::utilities;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ 
+ struct Param {
+   eAsyncState state;
+@@ -37,7 +37,7 @@ AsyncState::AsyncState(int timeout)
+ 
+ eAsyncState AsyncState::GetState()
+ {
+-  PLATFORM::CLockObject lock(m_mutex);
++  P8PLATFORM::CLockObject lock(m_mutex);
+   return m_state;
+ }
+ 
+diff --git a/src/tvheadend/utilities/AsyncState.h b/src/tvheadend/utilities/AsyncState.h
+index 1d672da..0819cd8 100644
+--- a/src/tvheadend/utilities/AsyncState.h
++++ b/src/tvheadend/utilities/AsyncState.h
+@@ -22,7 +22,7 @@
+ #ifndef ASYNCSTATE_H
+ #define	ASYNCSTATE_H
+ 
+-#include "platform/threads/mutex.h"
++#include "p8-platform/threads/mutex.h"
+ 
+ namespace tvheadend {
+   namespace utilities {
+@@ -75,8 +75,8 @@ namespace tvheadend {
+       static bool PredicateCallback ( void *param );
+ 
+       eAsyncState m_state;
+-      PLATFORM::CMutex m_mutex;
+-      PLATFORM::CCondition<bool> m_condition;
++      P8PLATFORM::CMutex m_mutex;
++      P8PLATFORM::CCondition<bool> m_condition;
+       int m_timeout;
+ 
+     };
+-- 
+2.0.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts_git.bb
new file mode 100644
index 0000000..7cafebf
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts_git.bb
@@ -0,0 +1,57 @@
+SUMMARY = "Kodi Media Center PVR plugins"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://src/client.cpp;md5=c8f6b73c5bc1048a3d6506700a7a91d2"
+
+DEPENDS = " \
+            zip-native \
+            p8platform \
+            kodi-platform \
+          "
+
+SRCREV_pvrhts = "7f75b70527922aef953123ff97ebaa22d9fb7cb4"
+
+SRCREV_FORMAT = "pvrhts"
+
+PV = "2.2.13+gitr${SRCPV}"
+SRC_URI = "git://github.com/kodi-pvr/pvr.hts.git;branch=Jarvis;destsuffix=pvr.hts;name=pvrhts \
+           file://0001-Update-to-p8-platform.patch \
+          "
+
+inherit cmake pkgconfig gettext
+
+S = "${WORKDIR}/pvr.hts"
+
+EXTRA_OECMAKE = " \
+	  -DADDONS_TO_BUILD=pvr.hts \
+	  -DADDON_SRC_PREFIX=${WORKDIR}/git \
+	  -DCMAKE_BUILD_TYPE=Debug \
+	  -DCMAKE_INSTALL_PREFIX=${datadir}/kodi/addons \
+          -DCMAKE_MODULE_PATH=${STAGING_DIR_HOST}${libdir}/kodi \
+          -DCMAKE_PREFIX_PATH=${STAGING_DIR_HOST}${prefix} \
+          -DPACKAGE_ZIP=1 \
+        "
+
+do_compile_prepend() {
+	sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' \
+	       -e 's:-pipe:${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -pipe:g' \
+	          ${B}/CMakeFiles/*/flags.make
+	sed -i -e 's:-pipe:${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -pipe:g'\
+	          ${B}/CMakeFiles/*/link.txt
+}
+
+# Make zip package for manual installation
+do_install_append() {
+	install -d ${D}${datadir}/kodi/addons/packages/
+	( cd ${D}${datadir}/kodi/addons
+	  zip -r ${D}${datadir}/kodi/addons/packages/pvr.hts-${PV}.zip pvr.hts -x '*.debug*' )
+}
+
+# Doesn't get added automagically, dlopen()?
+RDEPENDS_${PN} = "libkodiplatform"
+
+INSANE_SKIP_${PN} = "dev-so"
+FILES_${PN} += "${datadir}/kodi"
+FILES_${PN}-dbg += "${datadir}/kodi/addons/*/.debug/"
+
+PNBLACKLIST[kodi-addon-pvr-hts] ?= "Depends on blacklisted kodi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/0001-fix-cross-compile-badness.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/0001-fix-cross-compile-badness.patch
new file mode 100644
index 0000000..27e9d21
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/0001-fix-cross-compile-badness.patch
@@ -0,0 +1,40 @@
+From 3136317f096ea7fda4fb907e775a01952c4aae3d Mon Sep 17 00:00:00 2001
+From: Stefan Saraev <stefan@saraev.ca>
+Date: Fri, 19 Feb 2016 10:33:00 +0100
+Subject: [PATCH] fix cross compile badness
+
+From https://github.com/OpenELEC/OpenELEC.tv/blob/master/packages/mediacenter/kodi-platform/patches/kodi-platform-01_crosscompile-badness.patch
+---
+ CMakeLists.txt               | 2 +-
+ kodiplatform-config.cmake.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bf6b659..9abe773 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -22,7 +22,7 @@ if(NOT WIN32)
+   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ endif()
+ 
+-set(kodiplatform_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} "${CMAKE_INSTALL_PREFIX}/include/kodi")
++set(kodiplatform_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} "${CMAKE_INSTALL_PREFIX_TOOLCHAIN}/include/kodi")
+ IF(WIN32)
+   LIST(APPEND kodiplatform_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/kodi/windows")
+ ENDIF(WIN32)
+diff --git a/kodiplatform-config.cmake.in b/kodiplatform-config.cmake.in
+index 3fc5273..60bdf1b 100644
+--- a/kodiplatform-config.cmake.in
++++ b/kodiplatform-config.cmake.in
+@@ -10,7 +10,7 @@
+ #
+ # propagate these properties from one build system to the other
+ set (kodiplatform_VERSION "@kodiplatform_VERSION_MAJOR@.@kodiplatform_VERSION_MINOR@")
+-set (kodiplatform_INCLUDE_DIRS @kodiplatform_INCLUDE_DIRS@ @CMAKE_INSTALL_PREFIX@/include)
++set (kodiplatform_INCLUDE_DIRS @kodiplatform_INCLUDE_DIRS@ @CMAKE_INSTALL_PREFIX_TOOLCHAIN@/include)
+ set (kodiplatform_LIBRARY_DIRS "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
+ set (kodiplatform_LINKER_FLAGS "@kodiplatform_LINKER_FLAGS@")
+ set (kodiplatform_CONFIG_VARS "@kodiplatform_CONFIG_VARS@")
+-- 
+2.0.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/kodi-platform-02_no-multi-lib.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/kodi-platform-02_no-multi-lib.patch
new file mode 100644
index 0000000..a13c53b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/kodi-platform-02_no-multi-lib.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9abe773..ae433fc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -9,7 +9,6 @@ find_package(kodi REQUIRED)
+ find_package(TinyXML REQUIRED)
+ find_package(Threads REQUIRED)
+ find_package(p8-platform REQUIRED)
+-include(UseMultiArch.cmake)
+ include(CheckAtomic.cmake)
+ 
+ set(kodiplatform_NAME kodiplatform)
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform_git.bb
new file mode 100644
index 0000000..0b554ef
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Platform support library used by libCEC and binary add-ons for Kodi"
+HOMEPAGE = "http://libcec.pulse-eight.com/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://src/util/XMLUtils.cpp;beginline=2;endline=18;md5=dae8e846500e70dd8ecee55f3f018c30"
+
+DEPENDS = "libtinyxml kodi"
+
+PV = "16.0.0"
+
+SRCREV = "c8188d82678fec6b784597db69a68e74ff4986b5"
+SRC_URI = "git://github.com/xbmc/kodi-platform.git \
+           file://0001-fix-cross-compile-badness.patch \
+           file://kodi-platform-02_no-multi-lib.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig
+
+EXTRA_OECMAKE = " -DCMAKE_INSTALL_PREFIX_TOOLCHAIN=${STAGING_DIR_TARGET} \
+                  -DCMAKE_INSTALL_LIBDIR=${libdir} \
+                  -DCMAKE_INSTALL_LIBDIR_NOARCH=${libdir} \
+                  -DKODI_INCLUDE_DIR=${STAGING_LIBDIR}/kodi \
+                  -DKODI_INCLUDE_DIR=${STAGING_INCDIR}/kodi \
+                "
+
+do_compile_prepend() {
+	sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' \
+	       -e 's:-pipe:${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -pipe:g' \
+	          ${B}/CMakeFiles/kodiplatform.dir/flags.make
+	sed -i -e 's:-pipe:${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -pipe:g'\
+	          ${B}/CMakeFiles/kodiplatform.dir/link.txt
+}
+
+RPROVIDES_${PN} += "libkodiplatform"
+FILES_${PN}-dev += "${libdir}/*platform"
+
+PNBLACKLIST[kodi-platform] ?= "Depends on blacklisted kodi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup.bb
new file mode 100644
index 0000000..47e8f38
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Systemd service for kodi startup"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+
+PV = "1.0"
+
+SRC_URI = "file://kodi.service"
+
+inherit systemd
+
+do_install() {
+	install -d ${D}/lib/systemd/system
+	install -m 0644 ${WORKDIR}/kodi.service ${D}/lib/systemd/system/ 
+}
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "kodi.service"
+
+RDEPENDS_${PN} += "xinit kodi"
+
+PNBLACKLIST[kodi-startup] ?= "Runtime depends on blacklisted kodi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[kodi-startup] ?= "Runtime depends on blacklisted kodi-startup-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup/kodi.service b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup/kodi.service
new file mode 100644
index 0000000..29d0394
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup/kodi.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Kodi media thing
+
+[Service]
+User=root
+Type=simple
+SuccessExitStatus=0 1
+IOSchedulingClass=realtime
+IOSchedulingPriority=0
+
+ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- /usr/bin/X :0 
+
+[Install]
+WantedBy=basic.target
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi_17.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi_17.bb
new file mode 100644
index 0000000..43c32fb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi_17.bb
@@ -0,0 +1,207 @@
+SUMMARY = "Kodi Media Center"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=930e2a5f63425d8dd72dbd7391c43c46"
+
+FILESPATH =. "${FILE_DIRNAME}/kodi-17:"
+
+DEPENDS = " \
+            cmake-native \
+            curl-native \
+            gperf-native \
+            jsonschemabuilder-native \
+            nasm-native \
+            swig-native \
+            unzip-native \
+            yasm-native \
+            zip-native \
+            avahi \
+            boost \
+            bzip2 \
+            curl \
+            dcadec \
+            enca \
+            expat \
+            faad2 \
+            ffmpeg \
+            fontconfig \
+            fribidi \
+            giflib \
+            jasper \
+            libass \
+            libcdio \
+            libcec \
+            libmad \
+            libmicrohttpd \
+            libmms \
+            libmms \
+            libmodplug \
+            libpcre \
+            libplist \
+            libsamplerate0 \
+            libsdl-image \
+            libsdl-mixer \
+            libsquish \
+            libssh \
+            libtinyxml \
+            libusb1 \
+            libxslt \
+            lzo \
+            mpeg2dec \
+            python \
+            samba \
+            sqlite3 \
+            taglib \
+            virtual/egl \
+            virtual/libsdl \
+            wavpack \
+            yajl \
+            zlib \
+            ${@enable_glew(bb, d)} \
+          "
+
+PROVIDES = "xbmc"
+
+SRCREV = "661dd08d221f5b2bf509a696a6aca5ee7d45bb27"
+BASEPV = "17.1"
+PV = "${BASEPV}+gitr${SRCPV}"
+SRC_URI = "git://github.com/xbmc/xbmc.git;branch=Krypton \
+           https://repo.voidlinux.eu/distfiles/${BPN}-${BASEPV}-generated-addons.tar.xz;name=addons;unpack=0 \
+           file://0003-configure-don-t-try-to-run-stuff-to-find-tinyxml.patch \
+           file://0004-handle-SIGTERM.patch \
+           file://0005-add-support-to-read-frequency-output-if-using-intel-.patch \
+           file://0006-Disable-DVD-support.patch \
+           file://0007-Always-compile-libcpluff-as-PIC.patch \
+           file://0008-kodi-config.cmake-use-CMAKE_FIND_ROOT_PATH-to-fix-cr.patch \
+           file://0009-build-Add-support-for-musl-triplets.patch \
+           file://0010-RssReader-Fix-compiler-warning-comparing-pointer-to-.patch \
+           file://0011-Let-configure-pass-on-unknown-architectures-setting-.patch \
+           file://0012-Revert-droid-fix-builds-with-AML-disabled.patch \
+           file://0001-change-order-of-detecting-libegl-and-libgles2.patch \
+           file://0013-FTPParse.cpp-use-std-string.patch \
+"
+
+SRC_URI_append_libc-musl = " \
+           file://0001-Fix-file_Emu-on-musl.patch \
+           file://0002-Remove-FILEWRAP.patch \
+"
+SRC_URI[addons.md5sum] = "719614fa764011a18665d08af5c8c92f"
+SRC_URI[addons.sha256sum] = "350da57408c27473eaf40e7f544bc94841bf101dc4346085260c5c4af0adac97"
+
+inherit autotools-brokensep gettext pythonnative distro_features_check
+
+REQUIRED_DISTRO_FEATURES += "opengl"
+
+S = "${WORKDIR}/git"
+
+# breaks compilation
+ASNEEDED = ""
+
+ACCEL ?= ""
+ACCEL_x86 = "vaapi vdpau"
+ACCEL_x86-64 = "vaapi vdpau"
+
+PACKAGECONFIG ??= "${ACCEL} opengl"
+PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' x11', ' openglesv2', d)}"
+
+PACKAGECONFIG[opengl] = "--enable-gl,--enable-gles,"
+PACKAGECONFIG[openglesv2] = "--enable-gles,--enable-gl,virtual/egl"
+PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
+PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
+PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,libxinerama libxmu libxrandr libxtst"
+PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
+PACKAGECONFIG[lcms] = "--enable-lcms2,--disable-lcms2,lcms"
+
+EXTRA_OECONF = " \
+    --disable-debug \
+    --disable-libcap \
+    --disable-ccache \
+    --disable-mid \
+    --enable-libusb \
+    --enable-alsa \
+    --enable-airplay \
+    --disable-optical-drive \
+    --with-ffmpeg=shared \
+    --enable-texturepacker=no \
+    ac_cv_path_JAVA_EXE=/bin/true \
+"
+
+FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations -fomit-frame-pointer -O3 -ffast-math"
+FULL_OPTIMIZATION_armv7ve = "-fexpensive-optimizations -fomit-frame-pointer -O3 -ffast-math"
+BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
+
+EXTRA_OECONF_append = " LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
+
+# for python modules
+export HOST_SYS
+export BUILD_SYS
+export STAGING_LIBDIR
+export STAGING_INCDIR
+export PYTHON_DIR
+
+def enable_glew(bb, d):
+    if bb.utils.contains('PACKAGECONFIG', 'x11', True, False, d) and bb.utils.contains('DISTRO_FEATURES', 'opengl', True, False, d):
+        return "glew"
+    return ""
+
+do_configure() {
+    tar xf ${WORKDIR}/${BPN}-${BASEPV}-generated-addons.tar.xz -C ${S}/
+
+    ( for i in $(find ${S} -name "configure.*" ) ; do
+       cd $(dirname $i) && gnu-configize --force || true
+    done )
+    ( for f in ${S}/xbmc/interfaces/python/generated/*.cpp; do
+       touch `echo $f|sed -e 's/.cpp$/.xml/g'`
+    done )
+    make -C tools/depends/target/crossguid PREFIX=${STAGING_DIR_HOST}${prefix}
+
+    BOOTSTRAP_STANDALONE=1 make -f bootstrap.mk JSON_BUILDER="${STAGING_BINDIR_NATIVE}/JsonSchemaBuilder"
+    BOOTSTRAP_STANDALONE=1 make JAVA=/bin/true -f codegenerator.mk JSON_BUILDER="${STAGING_BINDIR_NATIVE}/JsonSchemaBuilder"
+    oe_runconf
+}
+
+do_compile_prepend() {
+    for i in $(find . -name "Makefile") ; do
+        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' $i
+    done
+
+    for i in $(find . -name "*.mak*" -o    -name "Makefile") ; do
+        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' -e 's:-rpath \$(libdir):-rpath ${libdir}:g' $i
+    done
+}
+
+INSANE_SKIP_${PN} = "rpaths"
+
+FILES_${PN} += "${datadir}/xsessions ${datadir}/icons ${libdir}/xbmc ${datadir}/xbmc"
+FILES_${PN}-dbg += "${libdir}/kodi/.debug ${libdir}/kodi/*/.debug ${libdir}/kodi/*/*/.debug ${libdir}/kodi/*/*/*/.debug"
+
+# kodi uses some kind of dlopen() method for libcec so we need to add it manually
+# OpenGL builds need glxinfo, that's in mesa-demos
+RRECOMMENDS_${PN}_append = " libcec \
+                             python \
+                             python-ctypes \
+                             python-lang \
+                             python-re \
+                             python-netclient \
+                             python-html \
+                             python-difflib \
+                             python-json \
+                             python-zlib \
+                             python-shell \
+                             python-sqlite3 \
+                             python-compression \
+                             libcurl \
+                             ${@bb.utils.contains('PACKAGECONFIG', 'x11', 'xrandr xdpyinfo', '', d)} \
+"
+RRECOMMENDS_${PN}_append_libc-glibc = " glibc-charmap-ibm850 \
+                                        glibc-gconv-ibm850 \
+					glibc-gconv-unicode \
+                                        glibc-gconv-utf-32 \
+					glibc-charmap-utf-8 \
+					glibc-localedata-en-us \
+                                      "
+
+RPROVIDES_${PN} += "xbmc"
+
+TOOLCHAIN = "gcc"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0001-configure-don-t-run-python-distutils-to-find-STAGING.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0001-configure-don-t-run-python-distutils-to-find-STAGING.patch
deleted file mode 100644
index dfc3959..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0001-configure-don-t-run-python-distutils-to-find-STAGING.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 0dce5a2abd9f42876616c35772a4d71c5399543c Mon Sep 17 00:00:00 2001
-From: Koen Kooi <koen@dominion.thruhere.net>
-Date: Sat, 17 Dec 2011 11:38:15 +0100
-Subject: [PATCH 1/4] configure: don't run python distutils to find STAGING_INCDIR/python, it is not safe for per-machine sysroots
-
-Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
----
- m4/ax_python_devel.m4 |    7 +------
- 1 files changed, 1 insertions(+), 6 deletions(-)
-
-diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4
-index adbd207..dee70f6 100644
---- a/m4/ax_python_devel.m4
-+++ b/m4/ax_python_devel.m4
-@@ -151,12 +151,7 @@ $ac_distutils_result])
- 	#
- 	AC_MSG_CHECKING([for Python include path])
- 	if test -z "$PYTHON_CPPFLAGS"; then
--		python_path=`$PYTHON -c "import distutils.sysconfig; \
--			print (distutils.sysconfig.get_python_inc ());"`
--		if test -n "${python_path}"; then
--			python_path="-I$python_path"
--		fi
--		PYTHON_CPPFLAGS=$python_path
-+		PYTHON_CPPFLAGS="-I${STAGING_INCDIR}/${PYTHON_DIR}"
- 	fi
- 	AC_MSG_RESULT([$PYTHON_CPPFLAGS])
- 	AC_SUBST([PYTHON_CPPFLAGS])
--- 
-1.7.2.5
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0002-Revert-fixed-ios-Add-memory-barriers-to-atomic-Add-S.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0002-Revert-fixed-ios-Add-memory-barriers-to-atomic-Add-S.patch
deleted file mode 100644
index e0a4037..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0002-Revert-fixed-ios-Add-memory-barriers-to-atomic-Add-S.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 7b2a8a7869d257cba35f53f6d877877c29cdac27 Mon Sep 17 00:00:00 2001
-From: Paul Menzel <paulepanter@users.sourceforge.net>
-Date: Sun, 14 Aug 2011 21:53:47 +0200
-Subject: [PATCH 2/4] Revert "fixed:[ios] Add memory barriers to atomic Add/Subtract and Increment/Decrement functions to ensure synchronized accesses."
-
-This reverts commit 9a10c48710df79118e39e9b3bb0a15bf1fe694d1.
-
-The build (OpenEmbedded `angstrom-2010.x` for `MACHINE = "beagleboard") fails with the following error.
-
-        make -C xbmc/threads
-        make[1]: Entering directory `/oe/build-angstrom-next/angstrom-dev/work/armv7a-angstrom-linux-gnueabi/xbmc-10.05-r11+gitr0+9a10c48710df79118e39e9b3bb0a15bf1fe694d1/git/xbmc/threads'
-        CPP     Atomics.o
-        /tmp/ccIzTm3L.s: Assembler messages:
-        /tmp/ccIzTm3L.s:40: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:48: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:76: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:83: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:111: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:118: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:145: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:152: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:180: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:187: Error: garbage following instruction -- `dmb ish'
-        make[1]: *** [Atomics.o] Error 1
-        make[1]: Leaving directory `/oe/build-angstrom-next/angstrom-dev/work/armv7a-angstrom-linux-gnueabi/xbmc-10.05-r11+gitr0+9a10c48710df79118e39e9b3bb0a15bf1fe694d1/git/xbmc/threads'
-        make: *** [xbmc/threads/threads.a] Error 2
----
- xbmc/threads/Atomics.cpp |    8 --------
- 1 files changed, 0 insertions(+), 8 deletions(-)
-
-diff --git a/xbmc/threads/Atomics.cpp b/xbmc/threads/Atomics.cpp
-index 5b09f18..0a98a7e 100644
---- a/xbmc/threads/Atomics.cpp
-+++ b/xbmc/threads/Atomics.cpp
-@@ -194,14 +194,12 @@ long AtomicIncrement(volatile long* pAddr)
- {
-   register long val;
-   asm volatile (
--                "dmb      ish            \n" // Memory barrier. Make sure all memory accesses appearing before this complete before any that appear after
-                 "1:                     \n" 
-                 "ldrex   %0, [%1]       \n" // (val = *pAddr)
-                 "add     %0,  #1        \n" // (val += 1)
-                 "strex   r1,  %0, [%1]	\n"
-                 "cmp     r1,   #0       \n"
-                 "bne     1b             \n"
--                "dmb     ish            \n" // Memory barrier.
-                 : "=&r" (val)
-                 : "r"(pAddr)
-                 : "r1"
-@@ -273,14 +271,12 @@ long AtomicAdd(volatile long* pAddr, long amount)
- {
-   register long val;
-   asm volatile (
--                "dmb      ish            \n" // Memory barrier. Make sure all memory accesses appearing before this complete before any that appear after
-                 "1:                     \n" 
-                 "ldrex   %0, [%1]       \n" // (val = *pAddr)
-                 "add     %0,  %2        \n" // (val += amount)
-                 "strex   r1,  %0, [%1]	\n"
-                 "cmp     r1,   #0       \n"
-                 "bne     1b             \n"
--                "dmb     ish            \n" // Memory barrier.
-                 : "=&r" (val)
-                 : "r"(pAddr), "r"(amount)
-                 : "r1"
-@@ -351,14 +347,12 @@ long AtomicDecrement(volatile long* pAddr)
- {
-   register long val;
-   asm volatile (
--                "dmb      ish            \n" // Memory barrier. Make sure all memory accesses appearing before this complete before any that appear after
-                 "1:                     \n" 
-                 "ldrex   %0, [%1]       \n" // (val = *pAddr)
-                 "sub     %0,  #1        \n" // (val -= 1)
-                 "strex   r1,  %0, [%1]	\n"
-                 "cmp     r1,   #0       \n"
-                 "bne     1b             \n"
--                "dmb     ish            \n" // Memory barrier.
-                 : "=&r" (val)
-                 : "r"(pAddr)
-                 : "r1"
-@@ -431,14 +425,12 @@ long AtomicSubtract(volatile long* pAddr, long amount)
- {
-   register long val;
-   asm volatile (
--                "dmb     ish            \n" // Memory barrier. Make sure all memory accesses appearing before this complete before any that appear after
-                 "1:                     \n" 
-                 "ldrex   %0, [%1]       \n" // (val = *pAddr)
-                 "sub     %0,  %2        \n" // (val -= amount)
-                 "strex   r1,  %0, [%1]	\n"
-                 "cmp     r1,   #0       \n"
-                 "bne     1b             \n"
--                "dmb     ish            \n" // Memory barrier.
-                 : "=&r" (val)
-                 : "r"(pAddr), "r"(amount)
-                 : "r1"
--- 
-1.7.2.5
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0003-Revert-fixed-ios-Add-memory-barriers-to-cas-assembly.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0003-Revert-fixed-ios-Add-memory-barriers-to-cas-assembly.patch
deleted file mode 100644
index 629017b..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0003-Revert-fixed-ios-Add-memory-barriers-to-cas-assembly.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From aaae1616a09d359b52e929f944ca0ceb4bb7f831 Mon Sep 17 00:00:00 2001
-From: Paul Menzel <paulepanter@users.sourceforge.net>
-Date: Sun, 14 Aug 2011 21:55:09 +0200
-Subject: [PATCH 3/4] Revert "fixed:[ios] Add memory barriers to cas() assembly to ensure alignment of memory accesses."
-
-This reverts commit 92bab651e2253d172879995b50985645b77fecd2.
-
-The build (OpenEmbedded `angstrom-2010.x` for `MACHINE = "beagleboard") fails with the following error.
-
-        CPP     Atomics.o
-        make[1]: Entering directory `/oe/build-angstrom-next/angstrom-dev/work/armv7a-angstrom-linux-gnueabi/xbmc-10.05-r11+gitr0+92bab651e2253d172879995b50985645b77fecd2/git/xbmc/windows'
-        CPP     GUIMediaWindow.o
-        /tmp/ccrsywuV.s: Assembler messages:
-        /tmp/ccrsywuV.s:40: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccrsywuV.s:48: Error: garbage following instruction -- `dmb ish'
-        make[1]: *** [Atomics.o] Error 1
-        make[1]: Leaving directory `/oe/build-angstrom-next/angstrom-dev/work/armv7a-angstrom-linux-gnueabi/xbmc-10.05-r11+gitr0+92bab651e2253d172879995b50985645b77fecd2/git/xbmc/threads'
-        make: *** [xbmc/threads/threads.a] Error 2
----
- xbmc/threads/Atomics.cpp |   33 ++++++++++++++++-----------------
- 1 files changed, 16 insertions(+), 17 deletions(-)
-
-diff --git a/xbmc/threads/Atomics.cpp b/xbmc/threads/Atomics.cpp
-index 0a98a7e..0967eb2 100644
---- a/xbmc/threads/Atomics.cpp
-+++ b/xbmc/threads/Atomics.cpp
-@@ -49,23 +49,22 @@ long cas(volatile long *pAddr, long expectedVal, long swapVal)
- #elif defined(__arm__)
- long cas(volatile long* pAddr, long expectedVal, long swapVal)
- {
--  register long prev;
--  asm volatile (
--                "dmb      ish            \n" // Memory barrier. Make sure all memory accesses appearing before this complete before any that appear after
--                "1:                      \n"
--                "ldrex    %0, [%1]       \n" // Load the current value of *pAddr(%1) into prev (%0) and lock pAddr,
--                "cmp      %0,  %2        \n" // Verify that the current value (%0) == old value (%2)
--                "bne      2f             \n" // Bail if the two values are not equal [not as expected]
--                "strex    r1,  %3, [%1]  \n"
--                "cmp      r1,  #0        \n"
--                "bne      1b             \n"
--                "dmb      ish            \n" // Memory barrier.
--                "2:                      \n"
--                : "=&r" (prev)
--                : "r"(pAddr), "r"(expectedVal),"r"(swapVal)
--                : "r1"
--                );
--  return prev;
-+  return(__sync_val_compare_and_swap(pAddr, expectedVal, swapVal));
-+//  register long prev;
-+//  asm volatile (
-+//                "1:                      \n"
-+//                "ldrex    %0, [%1]       \n" /* Load the current value of *pAddr(%1) into prev (%0) and lock pAddr,  */
-+//                "cmp      %0,  %2        \n" /* Verify that the current value (%0) == old value (%2) */
-+//                "bne      2f             \n" /* Bail if the two values are not equal [not as expected] */
-+//                "strex    r1,  %3, [%1]  \n"
-+//                "cmp      r1,  #0        \n"                
-+//                "bne      1b             \n"
-+//                "2:                        "
-+//                : "=&r" (prev)
-+//                : "r"(pAddr), "r"(expectedVal),"r"(swapVal)
-+//                : "r1"
-+//                );
-+//  return prev;
- }
- 
- #elif defined(__mips__)
--- 
-1.7.2.5
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0004-configure-cope-with-ld-is-gold-DISTRO_FEATURE.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0004-configure-cope-with-ld-is-gold-DISTRO_FEATURE.patch
deleted file mode 100644
index 345e20e..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0004-configure-cope-with-ld-is-gold-DISTRO_FEATURE.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From fd8f73826240aae543a41a2bfeea0056e2fe594d Mon Sep 17 00:00:00 2001
-From: Koen Kooi <koen@dominion.thruhere.net>
-Date: Mon, 11 Mar 2013 11:04:29 +0100
-Subject: [PATCH] configure: cope with ld-is-gold DISTRO_FEATURE
-
-Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
----
-
-Upstream-Stature: backport
-
- configure.in |   12 +++++++-----
- 1 files changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index ef94683..c8b459b 100755
---- a/configure.in
-+++ b/configure.in
-@@ -18,9 +18,14 @@ tolower(){
- # check for library basenames
- AC_DEFUN([XB_FIND_SONAME],
- [
-+  #set -x
-   if [[ "$host_vendor" != "apple" ]]; then
-     AC_MSG_CHECKING([for lib$2 soname])
-     $1_FILENAME=$($CC -nostdlib -o /dev/null $LDFLAGS -l$2 -Wl,-M 2>/dev/null | grep "^LOAD.*$2" | awk '{V=2; print $V}')
-+    if [[ -z $$1_FILENAME ]]; then
-+      #try gold linker syntax
-+      $1_FILENAME=$($CC -nostdlib -o /dev/null $LDFLAGS -l$2 -Wl,-t 3>&1 1>&2 2>&3 | grep "$2")
-+    fi
-     if [[ ! -z $$1_FILENAME ]]; then
-       $1_SONAME=$(objdump -p $$1_FILENAME | grep "SONAME.*$2" | awk '{V=2; print $V}')
-     fi
-@@ -55,6 +60,7 @@ AC_DEFUN([XB_FIND_SONAME],
-     AC_MSG_RESULT([$$1_SONAME])
-     AC_SUBST($1_SONAME)
-   fi
-+  #set +x
- ])
- 
- # Function to push and pop libs and includes for a command
--- 
-1.7.7.6
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/configure.in-Avoid-running-code.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/configure.in-Avoid-running-code.patch
deleted file mode 100644
index 5c14059..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/configure.in-Avoid-running-code.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From cfd851660a594801a591e80dc820c65cb7bd7836 Mon Sep 17 00:00:00 2001
-From: Otavio Salvador <otavio@ossystems.com.br>
-Date: Sat, 6 Oct 2012 06:40:03 -0300
-Subject: [PATCH] configure.in: Avoid running code or we break cross-compile
-
-Upstream-Status: Backport [similar change done for 12.0]
-
-Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
----
- configure.in |    6 +-----
- 1 files changed, 1 insertions(+), 5 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index ef94683..d7efcb0 100755
---- a/configure.in
-+++ b/configure.in
-@@ -1246,11 +1246,7 @@ if test "$use_external_ffmpeg" = "yes"; then
-   AC_DEFINE([USE_EXTERNAL_FFMPEG], [1], [Whether to use external FFmpeg libraries.])
- 
-   # Disable vdpau support if external libavcodec doesn't have it
--  AC_RUN_IFELSE(
--    AC_LANG_PROGRAM([[#include <libavcodec/avcodec.h>]],
--      [[avcodec_register_all();
--        AVCodec *codec = avcodec_find_decoder_by_name("vc1_vdpau");
--        return (codec) ? 0 : 1;]]),,
-+  AC_CHECK_LIB([avcodec], [ff_vdpau_vc1_decode_picture],,
-     [if test "x$use_vdpau" = "xyes"; then
-       AC_MSG_ERROR($ffmpeg_vdpau_not_supported)
-     else
--- 
-1.7.2.5
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc_git.bb
deleted file mode 100644
index 0d8dd5c..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc_git.bb
+++ /dev/null
@@ -1,97 +0,0 @@
-SUMMARY = "XBMC Media Center"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=6eb631b6da7fdb01508a80213ffc35ff"
-
-DEPENDS = "libusb1 libcec libplist expat yajl gperf-native libxmu fribidi mpeg2dec ffmpeg samba fontconfig curl python libass libmodplug libmicrohttpd wavpack libmms cmake-native libsdl-image libsdl-mixer virtual/egl mysql5 sqlite3 libmms faad2 libcdio libpcre boost lzo enca avahi libsamplerate0 libxinerama libxrandr libxtst bzip2 virtual/libsdl jasper zip-native zlib libtinyxml libmad"
-#require recipes/egl/egl.inc
-
-
-SRCREV = "82388d55dae79cbb2e486e307e23202e76a43efa"
-
-# multiple issues
-PNBLACKLIST[xbmc] ?= "/usr/include/c++/ctime:70:11: error: '::gmtime' has not been declared"
-
-PV = "11.0+gitr${SRCPV}"
-PR = "r14"
-SRC_URI = "git://github.com/xbmc/xbmc.git;branch=Eden \
-           file://0001-configure-don-t-run-python-distutils-to-find-STAGING.patch \
-           file://0002-Revert-fixed-ios-Add-memory-barriers-to-atomic-Add-S.patch \
-           file://0003-Revert-fixed-ios-Add-memory-barriers-to-cas-assembly.patch \
-           file://0004-configure-cope-with-ld-is-gold-DISTRO_FEATURE.patch \
-           file://configure.in-Avoid-running-code.patch \
-"
-
-inherit autotools gettext python-dir
-
-S = "${WORKDIR}/git"
-
-# breaks compilation
-CCACHE = ""
-
-CACHED_CONFIGUREVARS += " \
-    ac_cv_path_PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python" \
-"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl', 'openglesv2', d)}"
-PACKAGECONFIG[opengl] = "--enable-gl,--enable-gles,glew"
-PACKAGECONFIG[openglesv2] = "--enable-gles,--enable-gl,"
-
-EXTRA_OECONF = " \
-    --disable-rpath \
-    --enable-libusb \
-    --enable-airplay \
-    --disable-optical-drive \
-    --enable-external-libraries \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '--enable-gl', '--enable-gles', d)} \
-"
-
-FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations -fomit-frame-pointer -O4 -ffast-math"
-BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
-
-EXTRA_OECONF_append_armv7a = "--cpu=cortex-a8"
-
-# for python modules
-export STAGING_LIBDIR
-export STAGING_INCDIR
-export PYTHON_DIR
-
-do_configure() {
-    sh bootstrap
-    oe_runconf
-}
-
-PARALLEL_MAKE = ""
-
-do_compile_prepend() {
-    for i in $(find . -name "Makefile") ; do
-        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' $i
-    done
-
-    for i in $(find . -name "*.mak*" -o    -name "Makefile") ; do
-        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' -e 's:-rpath \$(libdir):-rpath ${libdir}:g' $i
-    done
-}
-
-INSANE_SKIP_${PN} = "rpaths"
-
-# on ARM architectures xbmc will use GLES which will make the regular wrapper fail, so start it directly
-do_install_append_arm() {
-    sed -i -e 's:Exec=xbmc:Exec=${libdir}/xbmc/xbmc.bin:g' ${D}${datadir}/applications/xbmc.desktop
-}
-
-FILES_${PN} += "${datadir}/xsessions ${datadir}/icons"
-FILES_${PN}-dbg += "${libdir}/xbmc/.debug ${libdir}/xbmc/*/.debug ${libdir}/xbmc/*/*/.debug ${libdir}/xbmc/*/*/*/.debug"
-
-# xbmc uses some kind of dlopen() method for libcec so we need to add it manually
-# OpenGL builds need glxinfo, that's in mesa-demos
-RRECOMMENDS_${PN}_append = " libcec \
-                             python \
-                             python-lang \
-                             python-re \
-                             python-netclient \
-                             libcurl \
-                             xdpyinfo \
-                             ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-demos', '', d)} \
-"
-RRECOMMENDS_${PN}_append_libc-glibc = " glibc-charmap-ibm850 glibc-gconv-ibm850"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mkv/mkvtoolnix/mkvtoolnix_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mkv/mkvtoolnix/mkvtoolnix_git.bb
index fe44ccf..8a14264 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mkv/mkvtoolnix/mkvtoolnix_git.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mkv/mkvtoolnix/mkvtoolnix_git.bb
@@ -54,4 +54,4 @@
 # | src/common/../../lib/boost/utf8_codecvt_facet/utf8_codecvt_facet.cpp:174:5: error: 'int mtx::utf8_codecvt_facet::do_length' is not a static data member of 'struct mtx::utf8_codecvt_facet'
 # |      BOOST_CODECVT_DO_LENGTH_CONST std::mbstate_t &,
 # |      ^
-PNBLACKLIST[mkvtoolnix] ?= "BROKEN: Failx to build with gcc-5"
+PNBLACKLIST[mkvtoolnix] ?= "BROKEN: Failx to build with gcc-5 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/0001-basic.h-Use-c99-supported-stdint-types.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/0001-basic.h-Use-c99-supported-stdint-types.patch
new file mode 100644
index 0000000..1087b0e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/0001-basic.h-Use-c99-supported-stdint-types.patch
@@ -0,0 +1,46 @@
+From a5cea22294a9acb6eed955bd415f562a6cc36482 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Mar 2017 11:54:23 -0700
+Subject: [PATCH] basic.h: Use c99 supported stdint types
+
+include stdint.h for getting the definitions for int types
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ basics.h | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/basics.h b/basics.h
+index 643d96e..1dc2fa7 100644
+--- a/basics.h
++++ b/basics.h
+@@ -46,17 +46,18 @@
+ 
+ #include <assert.h>
+ #include <stdio.h>
++#include <stdint.h>
+ 
+ #include "ladspa.h"
+ 
+-typedef __int8_t			int8;
+-typedef __uint8_t			uint8;
+-typedef __int16_t			int16;
+-typedef __uint16_t		uint16;
+-typedef __int32_t			int32;
+-typedef __uint32_t		uint32;
+-typedef __int64_t			int64;
+-typedef __uint64_t		uint64;
++typedef int8_t			int8;
++typedef uint8_t			uint8;
++typedef int16_t			int16;
++typedef uint16_t		uint16;
++typedef int32_t			int32;
++typedef uint32_t		uint32;
++typedef int64_t			int64;
++typedef uint64_t		uint64;
+ 
+ #define MIN_GAIN 1e-6 /* -120 dB */
+ /* smallest non-denormal 32 bit IEEE float is 1.18e-38 */
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/append_ldflags.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/append_ldflags.patch
new file mode 100644
index 0000000..3abd381
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/append_ldflags.patch
@@ -0,0 +1,18 @@
+Change the order of linker flags such that -shared is appearig after -pie/-fpie
+this helps in building the package when secuiry flags are enabled
+
+-Khem
+
+Index: caps-0.9.24/Makefile
+===================================================================
+--- caps-0.9.24.orig/Makefile
++++ caps-0.9.24/Makefile
+@@ -14,7 +14,7 @@ STRIP = strip
+ -include defines.make
+ 
+ CFLAGS += $(OPTS) $(_CFLAGS)
+-LDFLAGS += $(_LDFLAGS) $(CFLAGS)
++LDFLAGS += $(CFLAGS) $(_LDFLAGS)
+ 
+ PLUG = caps
+ 
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps_0.9.24.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps_0.9.24.bb
index 3e409e6..d788763 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps_0.9.24.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps_0.9.24.bb
@@ -3,10 +3,11 @@
 LICENSE = "GPL-3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
-SRC_URI = " \
-    http://quitte.de/dsp/${PN}_${PV}.tar.bz2 \
-    file://Avoid-ambiguity-in-div-invocation.patch \
-"
+SRC_URI = "http://quitte.de/dsp/${PN}_${PV}.tar.bz2 \
+           file://Avoid-ambiguity-in-div-invocation.patch \
+           file://0001-basic.h-Use-c99-supported-stdint-types.patch \
+           file://append_ldflags.patch \
+           "
 
 SRC_URI[md5sum] = "c1d634038dcb54702306c0e30cb1c626"
 SRC_URI[sha256sum] = "f746feba57af316b159f0169de5d78b4fd1064c2c0c8017cb5856b2f22e83f20"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb
index ba368a2..27fa0e5 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb
@@ -11,7 +11,12 @@
            file://0001-Use-DESTDIR-in-install-Makefile-rule.patch \
            file://0002-interface-remove-C-reserved-keyword.patch \
            file://0003-Fix-missing-shared-object-LDFLAGS.patch \
-"
+           file://dont-use-internal-configs.patch \
+           file://out-of-tree-build.patch \
+           file://0001-check-for-null-buffer-before-trying-a-byteswap.patch \
+           file://0002-Fix-printf-format-errors.patch \
+           file://0001-utils-Use-c99-compiler-independent-types.patch \
+           "
 SRC_URI[md5sum] = "b304bbe8ab63373924a744eac9ebc652"
 SRC_URI[sha256sum] = "005db45ef4ee017f5c32ec124f913a0546e77014266c6a1c50df902a55fe64df"
 
@@ -24,4 +29,6 @@
 # between the compilation of those two targets)
 PARALLEL_MAKE = ""
 
-inherit autotools-brokensep
+EXTRA_OECONF = "CC='${CC}' CFLAGS='${CFLAGS}'"
+
+inherit autotools
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch
new file mode 100644
index 0000000..682cf6e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch
@@ -0,0 +1,31 @@
+From c760c5d31f2412a5be5ac6896e6069d1cea08527 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 26 Jun 2017 22:31:45 -0700
+Subject: [PATCH 1/2] check for null buffer before trying a byteswap
+
+Author: Monty <paranoia@xiph.org>
+
+Patch from debian
+http://sources.debian.net/src/cdparanoia/3.10.2%2Bdebian-11/debian/patches/04-endian.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ interface/interface.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/interface/interface.c b/interface/interface.c
+index 526c2a9..763a0ea 100644
+--- a/interface/interface.c
++++ b/interface/interface.c
+@@ -118,7 +118,7 @@ long cdda_read_timed(cdrom_drive *d, void *buffer, long beginsector, long sector
+ 	if(d->bigendianp==-1) /* not determined yet */
+ 	  d->bigendianp=data_bigendianp(d);
+ 	
+-	if(d->bigendianp!=bigendianp()){
++	if(buffer && d->bigendianp!=bigendianp()){
+ 	  int i;
+ 	  u_int16_t *p=(u_int16_t *)buffer;
+ 	  long els=sectors*CD_FRAMESIZE_RAW/2;
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch
new file mode 100644
index 0000000..7699017
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch
@@ -0,0 +1,49 @@
+From 89071cbc8d3ab9a15503f397580b7590338e5e91 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 12 Jul 2017 17:23:45 -0700
+Subject: [PATCH] utils: Use c99 compiler independent types
+
+Make it portable across different platforms
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils.h | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/utils.h b/utils.h
+index 10dce58..73bba92 100644
+--- a/utils.h
++++ b/utils.h
+@@ -3,6 +3,7 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
++#include <stdint.h>
+ 
+ extern long buffering_write(int outf, char *buffer, long num);
+ extern int buffering_close(int fd);
+@@ -18,15 +19,15 @@ static inline int bigendianp(void){
+ }
+ 
+ static inline int32_t swap32(int32_t x){
+-  return((((u_int32_t)x & 0x000000ffU) << 24) | 
+-	 (((u_int32_t)x & 0x0000ff00U) <<  8) | 
+-	 (((u_int32_t)x & 0x00ff0000U) >>  8) | 
+-	 (((u_int32_t)x & 0xff000000U) >> 24));
++  return((((uint32_t)x & 0x000000ffU) << 24) | 
++	 (((uint32_t)x & 0x0000ff00U) <<  8) | 
++	 (((uint32_t)x & 0x00ff0000U) >>  8) | 
++	 (((uint32_t)x & 0xff000000U) >> 24));
+ }
+ 
+ static inline int16_t swap16(int16_t x){
+-  return((((u_int16_t)x & 0x00ffU) <<  8) | 
+-	 (((u_int16_t)x & 0xff00U) >>  8));
++  return((((uint16_t)x & 0x00ffU) <<  8) | 
++	 (((uint16_t)x & 0xff00U) >>  8));
+ }
+ 
+ #if BYTE_ORDER == LITTLE_ENDIAN
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch
new file mode 100644
index 0000000..024479c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch
@@ -0,0 +1,32 @@
+From f4f81bdadb9515938b3b5d13707bd4b9322fd967 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 26 Jun 2017 22:37:13 -0700
+Subject: [PATCH 2/2] Fix printf format errors
+
+error: format not a string literal and no format arguments
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ main.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/main.c b/main.c
+index 664acac..d568fb1 100644
+--- a/main.c
++++ b/main.c
+@@ -588,10 +588,10 @@ static void callback(long inpos, int function){
+ 	    buffer[aheadposition+19]='>';
+ 	}
+    
+-	fprintf(stderr,buffer);
++	fprintf(stderr, "%s", buffer);
+        
+ 	if (logfile != NULL && function==-1) {
+-	  fprintf(logfile,buffer+1);
++	  fprintf(logfile, "%s", buffer+1);
+ 	  fprintf(logfile,"\n\n");
+ 	  fflush(logfile);
+ 	}
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/dont-use-internal-configs.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/dont-use-internal-configs.patch
new file mode 100644
index 0000000..9b268b7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/dont-use-internal-configs.patch
@@ -0,0 +1,30 @@
+Index: cdparanoia-III-10.2/configure.in
+===================================================================
+--- cdparanoia-III-10.2.orig/configure.in
++++ cdparanoia-III-10.2/configure.in
+@@ -1,13 +1,8 @@
+ AC_INIT(interface/interface.c)
+ 
+-cp $srcdir/configure.guess $srcdir/config.guess
+-cp $srcdir/configure.sub $srcdir/config.sub
+-
+ AC_CANONICAL_HOST
+ 
+-if test -z "$CC"; then
+-	AC_PROG_CC	
+-fi
++AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_CHECK_PROG(AR,ar,ar)
+ AC_CHECK_PROG(INSTALL,install,install)
+@@ -44,8 +39,8 @@ case 4 in
+ 	$ac_cv_sizeof_long) SIZE32="long";;
+ esac
+ 
+-AC_CHECK_TYPE(int16_t,SIZE16="int16_t",,)
+-AC_CHECK_TYPE(int32_t,SIZE32="size32_t",,)
++AC_CHECK_TYPES([int16_t], [SIZE16="int16_t"], [], [[#include <stdint.h>]])
++AC_CHECK_TYPES([int32_t], [SIZE32="int32_t"], [], [[#include <stdint.h>]])
+ 
+ if test -z "$SIZE16"; then
+ 	AC_MSG_ERROR(No 16 bit type found on this platform!)
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/out-of-tree-build.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/out-of-tree-build.patch
new file mode 100644
index 0000000..06ee820
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/out-of-tree-build.patch
@@ -0,0 +1,42 @@
+Index: cdparanoia-III-10.2/Makefile.in
+===================================================================
+--- cdparanoia-III-10.2.orig/Makefile.in
++++ cdparanoia-III-10.2/Makefile.in
+@@ -6,6 +6,8 @@
+ VERSION=10.2
+ VPATH=@srcdir@
+ srcdir=@srcdir@
++top_srcdir=@top_srcdir@
++top_builddir=@top_builddir@
+ 
+ @SET_MAKE@
+ FLAGS=@TYPESIZES@ @CFLAGS@
+@@ -64,19 +66,19 @@ slib:
+ 
+ install:
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(BINDIR)
+-	$(INSTALL) -m 755 $(srcdir)/cdparanoia $(DESTDIR)$(BINDIR)
++	$(INSTALL) -m 755 $(top_builddir)/cdparanoia $(DESTDIR)$(BINDIR)
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(MANDIR)
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(MANDIR)/man1
+-	$(INSTALL) -m 0644 $(srcdir)/cdparanoia.1 $(DESTDIR)$(MANDIR)/man1
++	$(INSTALL) -m 0644 $(top_srcdir)/cdparanoia.1 $(DESTDIR)$(MANDIR)/man1
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(INCLUDEDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/paranoia/cdda_paranoia.h $(DESTDIR)$(INCLUDEDIR)
++	$(INSTALL) -m 0644 $(top_srcdir)/paranoia/cdda_paranoia.h $(DESTDIR)$(INCLUDEDIR)
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/paranoia/libcdda_paranoia.so.0.$(VERSION) $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/paranoia/libcdda_paranoia.a $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/interface/cdda_interface.h $(DESTDIR)$(INCLUDEDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/interface/libcdda_interface.so.0.$(VERSION) $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/interface/libcdda_interface.a $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/utils.h $(DESTDIR)$(INCLUDEDIR)
++	$(INSTALL) -m 0644 $(top_builddir)/paranoia/libcdda_paranoia.so.0.$(VERSION) $(DESTDIR)$(LIBDIR)
++	$(INSTALL) -m 0644 $(top_builddir)/paranoia/libcdda_paranoia.a $(DESTDIR)$(LIBDIR)
++	$(INSTALL) -m 0644 $(top_srcdir)/interface/cdda_interface.h $(DESTDIR)$(INCLUDEDIR)
++	$(INSTALL) -m 0644 $(top_builddir)/interface/libcdda_interface.so.0.$(VERSION) $(DESTDIR)$(LIBDIR)
++	$(INSTALL) -m 0644 $(top_builddir)/interface/libcdda_interface.a $(DESTDIR)$(LIBDIR)
++	$(INSTALL) -m 0644 $(top_srcdir)/utils.h $(DESTDIR)$(INCLUDEDIR)
+ 	ln -fs libcdda_interface.so.0.$(VERSION) \
+ 		$(DESTDIR)$(LIBDIR)/libcdda_interface.so.0
+ 	ln -fs libcdda_interface.so.0.$(VERSION) \
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/coriander/coriander_2.0.2.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/coriander/coriander_2.0.2.bb
index a9f52ca..1ddd9aa 100755
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/coriander/coriander_2.0.2.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/coriander/coriander_2.0.2.bb
@@ -5,7 +5,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 DEPENDS = "gtk+ libgnomeui libraw1394 libdc1394 libxv tiff"
 
-PNBLACKLIST[coriander] ?= "BROKEN: fails to use SDL probably because libsdl-config was removed, error: unknown type name 'SDL_Overlay'"
+PNBLACKLIST[coriander] ?= "BROKEN: fails to use SDL probably because libsdl-config was removed, error: unknown type name 'SDL_Overlay' - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/coriander-2/${PV}/${BP}.tar.gz \
            file://cross-compile.patch \
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dca/dcadec_0.2.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dca/dcadec_0.2.0.bb
new file mode 100644
index 0000000..45b53c1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dca/dcadec_0.2.0.bb
@@ -0,0 +1,17 @@
+SUMMARY = "DTS Coherent Acoustics decoder with support for HD extensions"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c"
+
+SRCREV = "b93deed1a231dd6dd7e39b9fe7d2abe05aa00158"
+SRC_URI = "git://github.com/foo86/dcadec.git;protocol=http"
+
+S = "${WORKDIR}/git"
+
+inherit lib_package
+
+EXTRA_OEMAKE = "CONFIG_SHARED=1"
+
+do_install() {
+	oe_runmake install DESTDIR="${D}" PREFIX="${prefix}"
+}
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dleyna/renderer-service-upnp_0.3.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dleyna/renderer-service-upnp_0.3.0.bb
index 68d59fa..4d06d2c 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dleyna/renderer-service-upnp_0.3.0.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dleyna/renderer-service-upnp_0.3.0.bb
@@ -5,7 +5,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
                     file://src/renderer-service-upnp.c;beginline=1;endline=21;md5=c25c3082684eb4ca87474b7528c6dc15"
 
-PNBLACKLIST[renderer-service-upnp] ?= "BROKEN: doesn't build with B!=S (trying to install rendererconsole.py from ${B} instead of ${S})"
+PNBLACKLIST[renderer-service-upnp] ?= "BROKEN: doesn't build with B!=S (trying to install rendererconsole.py from ${B} instead of ${S}) - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 DEPENDS = "dbus glib-2.0 gssdp gupnp gupnp-av gupnp-dlna libsoup-2.4"
 
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/faac_1.28.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/faac_1.28.bb
index 2f048af..5c9477f 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/faac_1.28.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/faac_1.28.bb
@@ -9,11 +9,15 @@
 SRC_URI = "${SOURCEFORGE_MIRROR}/faac/${BP}.tar.gz \
            file://build-fix.patch \
            file://address-gcc-6-narrowing-errors.patch \
-"
+           file://0001-frontend-Fix-format-string-security-error.patch \
+           file://0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch \
+           "
 
 SRC_URI[md5sum] = "80763728d392c7d789cde25614c878f6"
 SRC_URI[sha256sum] = "c5141199f4cfb17d749c36ba8cfe4b25f838da67c22f0fec40228b6b9c3d19df"
 
+EXTRA_OECONF += "--without-mp4v2"
+
 PACKAGES =+ "lib${BPN} lib${BPN}-dev"
 
 FILES_${PN} = " ${bindir}/faac "
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch
new file mode 100644
index 0000000..75e003e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch
@@ -0,0 +1,26 @@
+From c1d7a8b992dc36d0012cc3d54b7d3abf4ad4d5d8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 21:33:01 -0700
+Subject: [PATCH 1/2] frontend: Fix format string security error
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ frontend/main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/frontend/main.c b/frontend/main.c
+index 02146a8..cb9329c 100644
+--- a/frontend/main.c
++++ b/frontend/main.c
+@@ -715,7 +715,7 @@ int main(int argc, char *argv[])
+         break;
+ #endif
+         case 'L':
+-        fprintf(stderr, faac_copyright_string);
++        fprintf(stderr, "%s", faac_copyright_string);
+         dieMessage = license;
+         break;
+     case 'X':
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch
new file mode 100644
index 0000000..d845ddf
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch
@@ -0,0 +1,28 @@
+From 46cc9298c38b9dd735fec3f39aa2d6e56a362410 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 21:33:36 -0700
+Subject: [PATCH 2/2] mp4v2: Define __STRING if cdefs.h does not exist
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ common/mp4v2/mp4util.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/common/mp4v2/mp4util.h b/common/mp4v2/mp4util.h
+index 1f9cb64..1e7aced 100644
+--- a/common/mp4v2/mp4util.h
++++ b/common/mp4v2/mp4util.h
+@@ -23,6 +23,10 @@
+ #define __MP4_UTIL_INCLUDED__
+ #include <assert.h>
+ 
++#ifndef __STRING
++#define __STRING(x)     #x
++#endif
++
+ #ifndef ASSERT
+ #define ASSERT(expr) \
+ 	if (!(expr)) { \
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.6.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.6.bb
index 54e8697..88981e4 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.6.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.6.bb
@@ -12,7 +12,7 @@
 
 inherit autotools-brokensep pkgconfig lib_package
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)}"
 PACKAGECONFIG[sndfile] = "--enable-libsndfile-support,--disable-libsndfile-support,libsndfile1"
 PACKAGECONFIG[jack] = "--enable-jack-support,--disable-jack-support,jack"
 PACKAGECONFIG[pulseaudio] = "--enable-pulse-support,--disable-pulse-support,pulseaudio"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-ffmpeg_0.10.13.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-ffmpeg_0.10.13.bb
index 891b10c..ca19fd6 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-ffmpeg_0.10.13.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-ffmpeg_0.10.13.bb
@@ -100,4 +100,4 @@
 FILES_${PN}-staticdev += "${libdir}/gstreamer-0.10/*.a"
 
 # http://errors.yoctoproject.org/Errors/Details/40736/
-PNBLACKLIST[gst-ffmpeg] ?= "Not compatible with currently used ffmpeg 3"
+PNBLACKLIST[gst-ffmpeg] ?= "Not compatible with currently used ffmpeg 3 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-bad_0.10.23.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-bad_0.10.23.bb
index f8e77e1..38fccc8 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-bad_0.10.23.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-bad_0.10.23.bb
@@ -43,6 +43,7 @@
 PACKAGECONFIG[voamrwbenc] = "--enable-voamrwbenc,--disable-voamrwbenc,vo-amrwbenc"
 PACKAGECONFIG[voaacenc] = "--enable-voaacenc,--disable-voaacenc,vo-aacenc"
 PACKAGECONFIG[resindvd] = "--enable-resindvd,--disable-resindvd,libdvdnav libdvdread"
+PACKAGECONFIG[zbar] = "--enable-zbar,--disable-zbar,zbar jpeg"
 
 ARM_INSTRUCTION_SET = "arm"
 
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-base_0.10.36.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-base_0.10.36.bb
index eefd993..a3bfa5f 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-base_0.10.36.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-base_0.10.36.bb
@@ -23,7 +23,7 @@
 
 EXTRA_OECONF += "--disable-freetypetest"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 
 PACKAGECONFIG[gnomevfs] = "--enable-gnome_vfs,--disable-gnome_vfs,gnome-vfs"
 PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-good_0.10.31.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-good_0.10.31.bb
index 7e4a525..f993cfc 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-good_0.10.31.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-good_0.10.31.bb
@@ -8,8 +8,7 @@
 PR = "r8"
 
 PACKAGECONFIG ?= "jpeg v4l \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio x11', d)} \
 "
 PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
 PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer-0.10.36/0002-gst-glib2.m4-don-t-do-crazy-things-to-GLIB_CFLAGS.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer-0.10.36/0002-gst-glib2.m4-don-t-do-crazy-things-to-GLIB_CFLAGS.patch
new file mode 100644
index 0000000..8db3966
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer-0.10.36/0002-gst-glib2.m4-don-t-do-crazy-things-to-GLIB_CFLAGS.patch
@@ -0,0 +1,32 @@
+From 4b145ceb22bbce7ba6e209c6ab61f2d5867e69f9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Tue, 1 Nov 2016 19:02:30 +0100
+Subject: [PATCH] gst-glib2.m4: don't do crazy things to GLIB_CFLAGS
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+we are definitely not one of those poor souls mentioned
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ common/m4/gst-glib2.m4 | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/common/m4/gst-glib2.m4 b/common/m4/gst-glib2.m4
+index b01f02f..4569ae5 100644
+--- a/common/m4/gst-glib2.m4
++++ b/common/m4/gst-glib2.m4
+@@ -69,7 +69,6 @@ AC_DEFUN([AG_GST_GLIB_CHECK],
+   fi
+ 
+   dnl for the poor souls who for example have glib in /usr/local
+-  AS_SCRUB_INCLUDE(GLIB_CFLAGS)
+ 
+   AC_SUBST(GLIB_EXTRA_CFLAGS)
+ ])
+-- 
+2.5.5
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer_0.10.36.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer_0.10.36.bb
index e3bd5e5..5f97a20 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer_0.10.36.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer_0.10.36.bb
@@ -7,7 +7,7 @@
 LICENSE = "LGPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605 \
                     file://gst/gst.h;beginline=1;endline=21;md5=8e5fe5e87d33a04479fde862e238eaa4"
-DEPENDS = "glib-2.0 libxml2 bison-native flex-native"
+DEPENDS = "glib-2.0 libxml2 bison-native flex-native glib-2.0-native"
 
 PR = "r2"
 
@@ -16,6 +16,7 @@
            file://gst-inspect-check-error.patch \
            file://0001-baseparse-Fix-self-comparison-always-evaluates-to-tr.patch \
            file://0001-parse-make-grammar.y-work-with-Bison-3.patch \
+           file://0002-gst-glib2.m4-don-t-do-crazy-things-to-GLIB_CFLAGS.patch \
 "
 
 SRC_URI[md5sum] = "a0cf7d6877f694a1a2ad2b4d1ecb890b"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer/gst123_0.3.1.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer/gst123_0.3.1.bb
index 47f1d9f..9fe1bc6 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer/gst123_0.3.1.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer/gst123_0.3.1.bb
@@ -14,4 +14,4 @@
 
 inherit autotools
 
-PNBLACKLIST[gst123] ?= "gst123 is still "sometimes" using wrong sysroot"
+PNBLACKLIST[gst123] ?= "gst123 is still "sometimes" using wrong sysroot - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libao/libao_1.2.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libao/libao_1.2.0.bb
index 1339df6..4c0976e 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libao/libao_1.2.0.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libao/libao_1.2.0.bb
@@ -27,7 +27,7 @@
     do_split_packages(d, rootdir_dbg, '^(.*)\.so$', output_pattern='${BPN}-plugin-%s-dbg', description='AO %s plugin debug data')
 }
 
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)}"
 PACKAGECONFIG[esound] = "--enable-esd,--disable-esd,esound"
 PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
 PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libavc1394/libavc1394_0.5.4.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libavc1394/libavc1394_0.5.4.bb
index 97e2bf1..f5b0d48 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libavc1394/libavc1394_0.5.4.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libavc1394/libavc1394_0.5.4.bb
@@ -4,6 +4,7 @@
 SECTION = "libs/multimedia"
 
 DEPENDS = "libraw1394"
+DEPENDS_append_libc-musl = " argp-standalone"
 
 LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=dcf3c825659e82539645da41a7908589"
@@ -13,3 +14,5 @@
 SRC_URI[sha256sum] = "7cb1ff09506ae911ca9860bef4af08c2403f3e131f6c913a2cbd6ddca4215b53"
 
 inherit autotools pkgconfig
+
+LDFLAGS_append_libc-musl = " -largp"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libdc1394/libdc1394_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libdc1394/libdc1394_git.bb
index c298b44..8a9e9a1 100755
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libdc1394/libdc1394_git.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libdc1394/libdc1394_git.bb
@@ -5,11 +5,14 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=c848e78d9a4a5cc69906178e4d6fbd64"
 
 # libsdl to provide sdl.m4 with AM_PATH_SDL
-DEPENDS += "libusb1 libraw1394 libsdl"
+DEPENDS += "libusb1 libraw1394 libsdl \
+            ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxv virtual/libx11', '', d)} \
+            ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl libglu', '', d)} \
+"
 
-PV = "2.2.4+gitr${SRCPV}"
+PV = "2.2.5+gitr${SRCPV}"
 
-SRCREV = "9ac63fe7a7561bea83bfd4a5db47d4d74fde43a6"
+SRCREV = "5e78f51936fd09db0c0f742c7d2c0e5bdbbeed56"
 
 SRC_URI = "git://git.code.sf.net/p/libdc1394/code;branch=master;protocol=git \
            file://install_examples.patch \
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libsquish/libsquish_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libsquish/libsquish_git.bb
new file mode 100644
index 0000000..f060f1e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libsquish/libsquish_git.bb
@@ -0,0 +1,19 @@
+SUMMARY = "The squish library (abbreviated to libsquish) is an open source DXT compression library written in C++ "
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://alpha.cpp;beginline=3;endline=22;md5=6665e479f71feb92d590ea9ae9b9f6d5"
+
+PV = "1.10+git${SRCPV}"
+
+SRCREV = "52e7d93c5947f72380521116c05d97c528863ba8"
+SRC_URI = "git://github.com/OpenELEC/libsquish.git;protocol=https"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "INSTALL_DIR=${D}${prefix}"
+
+do_install() {
+	install -d ${D}${includedir}
+	install -d ${D}${libdir}/pkgconfig
+	oe_runmake install 
+}
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb
index a6a4f6a..16e5213 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb
@@ -3,19 +3,16 @@
 HOMEPAGE = "http://musicbrainz.org"
 LICENSE = "LGPLv2.1+"
 LIC_FILES_CHKSUM = "file://COPYING.txt;md5=fbc093901857fcd118f065f900982c24"
-DEPENDS = "expat neon neon-native"
+DEPENDS = "expat libxml2 libxml2-native neon neon-native"
 
-PV = "5.0.1+git${SRCPV}"
-PR = "r1"
+PV = "5.1.0+git${SRCPV}"
 
-SRCREV = "0749dd0a35b4a54316da064475863a4ac6e28e7e"
+SRCREV = "44c05779dd996035758f5ec426766aeedce29cc3"
 SRC_URI = "git://github.com/metabrainz/libmusicbrainz.git \
            file://allow-libdir-override.patch "
 
 S = "${WORKDIR}/git"
 
-LDFLAGS_prepend_libc-uclibc = " -lpthread "
-
 inherit cmake pkgconfig
 
 do_configure_prepend() {
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.15.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.15.bb
deleted file mode 100644
index 0fed867..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.15.bb
+++ /dev/null
@@ -1,63 +0,0 @@
-SUMMARY = "Music Player Daemon"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-HOMEPAGE ="http://www.musicpd.org"
-
-DEPENDS = "alsa-lib libsamplerate0 libsndfile1 libvorbis libogg faad2 ffmpeg curl sqlite bzip2 pulseaudio tcp-wrappers openal-soft yajl jack faad2 flac libao fluidsynth libcdio wavpack libopus mpg123 libmms libmodplug boost icu dbus expat zlib libupnp"
-
-SRC_URI = " \
-    http://www.musicpd.org/download/${BPN}/0.19/${BP}.tar.xz \
-    file://mpd.conf.in \
-"
-SRC_URI[md5sum] = "bb855b1689c9e863c2dd214ab1cb9344"
-SRC_URI[sha256sum] = "0cb9a223894b038ce966ce6d651d9b3ea3bdc7d7b9bec8d1e9e7e091cbc29b8b"
-
-inherit autotools useradd systemd
-
-EXTRA_OECONF = "enable_bzip2=yes"
-EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
-
-PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad"
-PACKAGECONFIG[id3tag] = "--enable-id3,--disable-id3,libid3tag"
-PACKAGECONFIG[lame] = "--enable-lame-encoder,--disable-lame-encoder,lame"
-PACKAGECONFIG[smb] = "--enable-smbclient,--disable-smbclient,samba"
-
-do_configure_prepend() {
-    sed -i -e 's|libsystemd-daemon|libsystemd|' ${S}/configure.ac
-}
-
-do_install_append() {
-    install -d ${D}/${localstatedir}/lib/mpd/music
-    chmod 775 ${D}/${localstatedir}/lib/mpd/music
-    install -d ${D}/${localstatedir}/lib/mpd/playlists
-    chown -R mpd ${D}/${localstatedir}/lib/mpd
-    chown mpd:mpd ${D}/${localstatedir}/lib/mpd/music
-
-    install -d ${D}/${sysconfdir}
-    install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf
-    sed -i \
-        -e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \
-        -e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \
-        -e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \
-        -e 's|%log_file%|${localstatedir}/log/mpd.log|' \
-        -e 's|%state_file%|${localstatedir}/lib/mpd/state|' \
-        ${D}/${sysconfdir}/mpd.conf
-
-    if [ -e ${D}/${systemd_unitdir}/system/mpd.service ] ; then
-        sed -i \
-            's|^ExecStart=.*|ExecStart=${bindir}/mpd --no-daemon|' \
-            ${D}/${systemd_unitdir}/system/mpd.service
-    fi
-}
-
-RPROVIDES_${PN} += "${PN}-systemd"
-RREPLACES_${PN} += "${PN}-systemd"
-RCONFLICTS_${PN} += "${PN}-systemd"
-SYSTEMD_SERVICE_${PN} = "mpd.socket"
-
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = " \
-    --system --no-create-home \
-    --home ${localstatedir}/lib/mpd \
-    --groups audio \
-    --user-group mpd"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.21.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.21.bb
new file mode 100644
index 0000000..c16f3be
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.21.bb
@@ -0,0 +1,97 @@
+SUMMARY = "Music Player Daemon"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+HOMEPAGE ="http://www.musicpd.org"
+
+inherit autotools useradd systemd pkgconfig
+
+DEPENDS += " \
+    alsa-lib \
+    libsamplerate0 \
+    libsndfile1 \
+    libvorbis \
+    libogg \
+    faad2 \
+    ffmpeg \
+    curl \
+    sqlite \
+    bzip2 \
+    pulseaudio \
+    tcp-wrappers \
+    openal-soft \
+    yajl \
+    jack \
+    faad2 \
+    flac \
+    libao \
+    fluidsynth \
+    libcdio \
+    wavpack \
+    libopus \
+    mpg123 \
+    libmms \
+    libmodplug \
+    boost \
+    icu \
+    dbus \
+    expat \
+    zlib \
+    libupnp \
+"
+
+SRC_URI = " \
+    http://www.musicpd.org/download/${BPN}/0.19/${BP}.tar.xz \
+    file://mpd.conf.in \
+"
+SRC_URI[md5sum] = "fc19f76b512bd471b6af5214965ff7c5"
+SRC_URI[sha256sum] = "8305b8bc026f4b6bde28b8dd09bfdddbe5590acf36358eed4d083a396e301730"
+
+EXTRA_OECONF = "enable_bzip2=yes"
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
+
+PACKAGECONFIG[audiofile] = "--enable-audiofile,--disable-audiofile,audiofile"
+PACKAGECONFIG[cdioparanoia] = "--enable-cdio-paranoia,--disable-cdio-paranoia,libcdio-paranoia"
+PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad"
+PACKAGECONFIG[id3tag] = "--enable-id3,--disable-id3,libid3tag"
+PACKAGECONFIG[lame] = "--enable-lame-encoder,--disable-lame-encoder,lame"
+PACKAGECONFIG[smb] = "--enable-smbclient,--disable-smbclient,samba"
+
+do_configure_prepend() {
+    sed -i -e 's|libsystemd-daemon|libsystemd|' ${S}/configure.ac
+}
+
+do_install_append() {
+    install -d ${D}/${localstatedir}/lib/mpd/music
+    chmod 775 ${D}/${localstatedir}/lib/mpd/music
+    install -d ${D}/${localstatedir}/lib/mpd/playlists
+    chown -R mpd ${D}/${localstatedir}/lib/mpd
+    chown mpd:mpd ${D}/${localstatedir}/lib/mpd/music
+
+    install -d ${D}/${sysconfdir}
+    install -m 644 ${WORKDIR}/mpd.conf.in ${D}/${sysconfdir}/mpd.conf
+    sed -i \
+        -e 's|%music_directory%|${localstatedir}/lib/mpd/music|' \
+        -e 's|%playlist_directory%|${localstatedir}/lib/mpd/playlists|' \
+        -e 's|%db_file%|${localstatedir}/lib/mpd/mpd.db|' \
+        -e 's|%log_file%|${localstatedir}/log/mpd.log|' \
+        -e 's|%state_file%|${localstatedir}/lib/mpd/state|' \
+        ${D}/${sysconfdir}/mpd.conf
+
+    if [ -e ${D}/${systemd_unitdir}/system/mpd.service ] ; then
+        sed -i \
+            's|^ExecStart=.*|ExecStart=${bindir}/mpd --no-daemon|' \
+            ${D}/${systemd_unitdir}/system/mpd.service
+    fi
+}
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "mpd.socket"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = " \
+    --system --no-create-home \
+    --home ${localstatedir}/lib/mpd \
+    --groups audio \
+    --user-group mpd"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/openal/openal-soft_1.15.1.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/openal/openal-soft_1.15.1.bb
index 5895234..e0f1a26 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/openal/openal-soft_1.15.1.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/openal/openal-soft_1.15.1.bb
@@ -9,10 +9,7 @@
 SRC_URI[md5sum] = "ea83dec3b9655a27d28e7bc7cae9cd71"
 SRC_URI[sha256sum] = "0e29a162f0841ccb4135ce76e92e8a704589b680a85eddf76f898de5236eb056"
 
-PACKAGECONFIG ?= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
-"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)}"
 PACKAGECONFIG[alsa] = "-DALSA=TRUE, -DALSA=FALSE, alsa-lib"
 PACKAGECONFIG[pulseaudio] = "-DPULSEAUDIO=TRUE, -DPULSEAUDIO=FALSE, pulseaudio"
 # currently doesn't work with libav-9
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox/0001-remove-the-error-line-and-live-without-file-type-det.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox/0001-remove-the-error-line-and-live-without-file-type-det.patch
new file mode 100644
index 0000000..605863a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox/0001-remove-the-error-line-and-live-without-file-type-det.patch
@@ -0,0 +1,28 @@
+From c2aed28e3e14329ad0a8c4371fdcce9934013f21 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 12 Jul 2017 16:36:06 -0700
+Subject: [PATCH] remove the #error line and live without file-type detection
+ with pipes
+
+this fallback is executed with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/formats.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/formats.c b/src/formats.c
+index 7e231ca..b13f0d5 100644
+--- a/src/formats.c
++++ b/src/formats.c
+@@ -416,7 +416,6 @@ static void UNUSED rewind_pipe(FILE * fp)
+   /* To fix this #error, either simply remove the #error line and live without
+    * file-type detection with pipes, or add support for your compiler in the
+    * lines above.  Test with cat monkey.au | ./sox --info - */
+-  #error FIX NEEDED HERE
+   #define NO_REWIND_PIPE
+   (void)fp;
+ #endif
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox_14.4.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox_14.4.0.bb
index 4b73aa3..e115f1c 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox_14.4.0.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox_14.4.0.bb
@@ -8,8 +8,7 @@
 
 PR = "r2"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)} \
                    magic \
 "
 PACKAGECONFIG[pulseaudio] = "--with-pulseaudio=dyn,--with-pulseaudio=no,pulseaudio,"
@@ -28,7 +27,9 @@
 LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=751419260aa954499f7abaabaa882bbe \
                     file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/sox/sox-${PV}.tar.gz"
+SRC_URI = "${SOURCEFORGE_MIRROR}/sox/sox-${PV}.tar.gz \
+           file://0001-remove-the-error-line-and-live-without-file-type-det.patch \
+           "
 SRC_URI[md5sum] = "b0c15cff7a4ba0ec17fdc74e6a1f9cf1"
 SRC_URI[sha256sum] = "3ee34b14dd267de378e8a117aae81ec4cae330772342e6a55bbf6520a0a88aa3"
 
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0001-build-these-are-foreign-automake-projects.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0001-build-these-are-foreign-automake-projects.patch
new file mode 100644
index 0000000..c0f4692
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0001-build-these-are-foreign-automake-projects.patch
@@ -0,0 +1,49 @@
+From 4c7165b3fbc0e99e7cdd77031e8a001440d0629d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
+Date: Thu, 3 Nov 2016 20:53:21 +0000
+Subject: [PATCH 1/3] build: these are 'foreign' automake projects
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In order to prevent automake from complaining about missing
+
+files ChangeLog, AUTHORS, etc., use the 'foreign' automake
+option to instruct it so.
+
+Upstream-Status: Inappropriate [no upstream activity for 7+ years]
+Signed-off-by: André Draszik <git@andred.net>
+---
+ configure.ac                | 2 +-
+ libmad-0.15.1b/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b12d11f..96300d6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -11,7 +11,7 @@ dnl   AC_CHECK_FUNC:  defines a shell variable
+ 
+ AC_PREREQ(2.59)
+ AC_INIT(streamripper,1.64.6)
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+ 
+ AC_CONFIG_HEADERS([lib/config.h])
+ 
+diff --git a/libmad-0.15.1b/configure.ac b/libmad-0.15.1b/configure.ac
+index 8fb35ee..ab116a6 100644
+--- a/libmad-0.15.1b/configure.ac
++++ b/libmad-0.15.1b/configure.ac
+@@ -26,7 +26,7 @@ AC_PREREQ(2.53)
+ 
+ AC_CONFIG_SRCDIR([decoder.h])
+ 
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+ 
+ AM_CONFIG_HEADER([config.h])
+ 
+-- 
+2.10.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0002-build-don-t-ignore-CPPFLAGS-from-environment.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0002-build-don-t-ignore-CPPFLAGS-from-environment.patch
new file mode 100644
index 0000000..58473f6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0002-build-don-t-ignore-CPPFLAGS-from-environment.patch
@@ -0,0 +1,30 @@
+From 2fcf2b164e25c4b2523dea4b04094916e57ba19e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
+Date: Thu, 3 Nov 2016 20:53:26 +0000
+Subject: [PATCH 2/3] build: don't ignore CPPFLAGS from environment
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [no upstream activity for 7+ years]
+Signed-off-by: André Draszik <git@andred.net>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 96300d6..1600c88 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -56,7 +56,7 @@ AC_ARG_WITH(curses,
+   [  --with-curses(=XXX) compile curses front-end (XXX is curses (default), ncurses, ncursesw, pdcurses or slang)])
+ 
+ 
+-CPPFLAGS="-D__UNIX__"
++CPPFLAGS="$CPPFLAGS -D__UNIX__"
+ AC_SUBST(CPPFLAGS)
+ 
+ 
+-- 
+2.10.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0003-ripstream-fix-compilation.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0003-ripstream-fix-compilation.patch
new file mode 100644
index 0000000..065254e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0003-ripstream-fix-compilation.patch
@@ -0,0 +1,42 @@
+From 6d59b60ff5108357ad2c2951a97112e713ee5368 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
+Date: Thu, 3 Nov 2016 20:53:32 +0000
+Subject: [PATCH 3/3] ripstream: fix compilation
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| ../../streamripper-1.64.6/lib/ripstream.c: In function 'write_id3v2_frame':
+| ../../streamripper-1.64.6/lib/ripstream.c:717:5: error: unknown type name '__uint32_t'
+|      __uint32_t framesize = 0;
+|      ^~~~~~~~~~
+
+The already included srtypes.h does the right thing for all
+platforms (I think). It certainly works well here.
+
+Upstream-Status: Inappropriate [no upstream activity for 7+ years]
+Signed-off-by: André Draszik <git@andred.net>
+---
+ lib/ripstream.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/lib/ripstream.c b/lib/ripstream.c
+index c671e18..7f311c6 100644
+--- a/lib/ripstream.c
++++ b/lib/ripstream.c
+@@ -713,11 +713,7 @@ write_id3v2_frame(RIP_MANAGER_INFO* rmi, char* tag_name, mchar* data,
+     int rc;
+     char bigbuf[HEADER_SIZE] = "";
+     ID3V2frame id3v2frame;
+-#ifndef WIN32
+-    __uint32_t framesize = 0;
+-#else
+-    unsigned long int framesize = 0;
+-#endif
++    uint32_t framesize = 0;
+ 
+     memset(&id3v2frame, '\000', sizeof(id3v2frame));
+     strncpy(id3v2frame.id, tag_name, 4);
+-- 
+2.10.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper_1.64.6.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper_1.64.6.bb
new file mode 100644
index 0000000..94355b6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper_1.64.6.bb
@@ -0,0 +1,29 @@
+SUMMARY = "download online streams into audio files"
+DESCRIPTION = "This command-line tool can be used to record MPEG III \
+and OGG online radio-streams into track-separated audio files."
+HOMEPAGE = "http://streamripper.sourceforge.net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+DEPENDS = "glib-2.0 libmad libogg libvorbis"
+
+SRC_URI = "\
+    ${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
+    file://0001-build-these-are-foreign-automake-projects.patch \
+    file://0002-build-don-t-ignore-CPPFLAGS-from-environment.patch \
+    file://0003-ripstream-fix-compilation.patch \
+"
+SRC_URI[mdsum] = "a37a1a8b8f9228522196a122a1c2dd32"
+SRC_URI[sha256sum] = "c1d75f2e9c7b38fd4695be66eff4533395248132f3cc61f375196403c4d8de42"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--with-included-argv=yes --with-included-libmad=no"
+EXTRA_OECONF += "\
+    --with-ogg-includes=${STAGING_INCDIR} \
+    --with-ogg-libraries=${STAGING_LIBDIR} \
+    --with-vorbis-includes=${STAGING_INCDIR} \
+    --with-vorbis-libraries=${STAGING_LIBDIR} \
+"
+
+# the included argv library needs this
+CPPFLAGS_append = " -DANSI_PROTOTYPES"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch
rename to import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch
rename to import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor_20150107.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor_20150107.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor_20150107.bb
rename to import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor_20150107.bb
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools/0004-Fix-format-error-blocking-compilation-with-hardening.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools/0004-Fix-format-error-blocking-compilation-with-hardening.patch
new file mode 100644
index 0000000..111e98a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools/0004-Fix-format-error-blocking-compilation-with-hardening.patch
@@ -0,0 +1,26 @@
+From: Petter Reinholdtsen <pere@hungry.com>
+Date: Wed, 22 Oct 2014 13:25:21 +0200
+Subject: Fix format error blocking compilation with hardening
+
+Last-Update: 2014-10-22
+Forwarded: no
+
+Enabling hardening refuses to compile code with sprintf() calls
+with no formatting string. Adjust the code to work with hardening.
+---
+ ogg123/status.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ogg123/status.c b/ogg123/status.c
+index 92b8ff1..ccec389 100644
+--- a/ogg123/status.c
++++ b/ogg123/status.c
+@@ -148,7 +148,7 @@ int print_statistics_line (stat_format_t stats[])
+ 
+     switch (stats->type) {
+     case stat_noarg:
+-      len += sprintf(str+len, stats->formatstr);
++      len += sprintf(str+len, "%s", stats->formatstr);
+       break;
+     case stat_intarg:
+       len += sprintf(str+len, stats->formatstr, stats->arg.intarg);
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools_1.4.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools_1.4.0.bb
index 2683555..e43cb40 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools_1.4.0.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools_1.4.0.bb
@@ -12,6 +12,7 @@
 
 SRC_URI = "http://downloads.xiph.org/releases/vorbis/${BP}.tar.gz \
            file://0001-oggenc-Fix-large-alloca-on-bad-AIFF-input.patch \
+           file://0004-Fix-format-error-blocking-compilation-with-hardening.patch \
           "
 
 SRC_URI[md5sum] = "567e0fb8d321b2cd7124f8208b8b90e6"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-support/gst-instruments/gst-instruments_0.2.3.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-support/gst-instruments/gst-instruments_0.2.3.bb
new file mode 100644
index 0000000..b6cdc4f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-support/gst-instruments/gst-instruments_0.2.3.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Profiling utilities for GStreamer 1.0 pipelines"
+HOMEPAGE = "https://github.com/kirushyk/gst-instruments"
+SECTION = "multimedia"
+
+LICENSE = "LGPL-3.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = "https://github.com/kirushyk/gst-instruments/archive/${PV}.tar.gz"
+
+SRC_URI[md5sum] = "14a394dec25642848b17f9999f1b4999"
+SRC_URI[sha256sum] = "5565658a33ff9596946541304fbdd3b3683dbb82171a0e6ce56f42b64a01e58d"
+
+S = "${WORKDIR}/gst-instruments-${PV}"
+
+FILES_${PN} += "${libdir}/*"
+
+INSANE_SKIP_${PN} = "dev-so"
+
+DEPENDS = "gstreamer1.0"
+
+inherit autotools pkgconfig
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp/0001-Rename-conflicting-variable-mips.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp/0001-Rename-conflicting-variable-mips.patch
new file mode 100644
index 0000000..b56c789
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp/0001-Rename-conflicting-variable-mips.patch
@@ -0,0 +1,73 @@
+From 3dc8a678a844247d0afcf7e30fb3cbd5ccbd828f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 29 Jun 2017 14:05:06 -0700
+Subject: [PATCH] Rename conflicting variable 'mips'
+
+Fixes
+test/srtp_driver.c:344:12: error: expected identifier or '(' before numeric constant
+     double mips = mips_estimate(1000000000, &ignore);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ test/srtp_driver.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/test/srtp_driver.c b/test/srtp_driver.c
+index 8872971..d38ea19 100644
+--- a/test/srtp_driver.c
++++ b/test/srtp_driver.c
+@@ -341,7 +341,7 @@ main (int argc, char *argv[]) {
+   if (do_codec_timing) {
+     srtp_policy_t policy;
+     int ignore;
+-    double mips = mips_estimate(1000000000, &ignore);
++    double est = mips_estimate(1000000000, &ignore);
+ 
+     crypto_policy_set_rtp_default(&policy.rtp);
+     crypto_policy_set_rtcp_default(&policy.rtcp);
+@@ -353,33 +353,33 @@ main (int argc, char *argv[]) {
+     policy.allow_repeat_tx = 0;
+     policy.next = NULL;
+ 
+-    printf("mips estimate: %e\n", mips);
++    printf("mips estimate: %e\n", est);
+ 
+     printf("testing srtp processing time for voice codecs:\n");
+     printf("codec\t\tlength (octets)\t\tsrtp instructions/second\n");
+     printf("G.711\t\t%d\t\t\t%e\n", 80, 
+-           (double) mips * (80 * 8) / 
++           (double) est * (80 * 8) / 
+ 	   srtp_bits_per_second(80, &policy) / .01 );
+     printf("G.711\t\t%d\t\t\t%e\n", 160, 
+-           (double) mips * (160 * 8) / 
++           (double) est * (160 * 8) / 
+ 	   srtp_bits_per_second(160, &policy) / .02);
+     printf("G.726-32\t%d\t\t\t%e\n", 40, 
+-           (double) mips * (40 * 8) / 
++           (double) est * (40 * 8) / 
+ 	   srtp_bits_per_second(40, &policy) / .01 );
+     printf("G.726-32\t%d\t\t\t%e\n", 80, 
+-           (double) mips * (80 * 8) / 
++           (double) est * (80 * 8) / 
+ 	   srtp_bits_per_second(80, &policy) / .02);
+     printf("G.729\t\t%d\t\t\t%e\n", 10, 
+-           (double) mips * (10 * 8) / 
++           (double) est * (10 * 8) / 
+ 	   srtp_bits_per_second(10, &policy) / .01 );
+     printf("G.729\t\t%d\t\t\t%e\n", 20, 
+-           (double) mips * (20 * 8) /
++           (double) est * (20 * 8) /
+ 	   srtp_bits_per_second(20, &policy) / .02 );
+     printf("Wideband\t%d\t\t\t%e\n", 320, 
+-           (double) mips * (320 * 8) /
++           (double) est * (320 * 8) /
+ 	   srtp_bits_per_second(320, &policy) / .01 );
+     printf("Wideband\t%d\t\t\t%e\n", 640, 
+-           (double) mips * (640 * 8) /
++           (double) est * (640 * 8) /
+ 	   srtp_bits_per_second(640, &policy) / .02 );
+   }
+ 
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp_1.5.2.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp_1.5.2.bb
index 3249828..8abaa12 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp_1.5.2.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp_1.5.2.bb
@@ -5,7 +5,9 @@
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=15bc16b9d2e305974dde47e733883714"
 
-SRC_URI = "https://github.com/cisco/libsrtp/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz"
+SRC_URI = "https://github.com/cisco/libsrtp/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
+           file://0001-Rename-conflicting-variable-mips.patch \
+           "
 SRC_URI[md5sum] = "2309aa6027992810a4285b042c71e644"
 SRC_URI[sha256sum] = "86e1efe353397c0751f6bdd709794143bd1b76494412860f16ff2b6d9c304eda"
 
diff --git a/import-layers/meta-openembedded/meta-networking/MAINTAINERS b/import-layers/meta-openembedded/meta-networking/MAINTAINERS
index 53593ae..8e6e3a0 100644
--- a/import-layers/meta-openembedded/meta-networking/MAINTAINERS
+++ b/import-layers/meta-openembedded/meta-networking/MAINTAINERS
@@ -2,19 +2,19 @@
 
 Please submit any patches against meta-networking to the OpenEmbedded
 development mailing list (openembedded-devel@lists.openembedded.org) with
-'[meta-networking]' in the subject.
+'[meta-networking][pyro]' in the subject.
 
 When sending single patches, please use something like:
 
    git send-email -1 -M \
         --to openembedded-devel@lists.openembedded.org \
-        --subject-prefix=meta-networking][morty][PATCH
+        --subject-prefix=meta-networking][pyro][PATCH
+
+pyro Branch Maintainer:
+Armin Kuster <akuster808@gmail.com>
 
 You may also contact the maintainers directly.
 
-morty branch maintainer(s):
-Armin Kuster <akuster808@gmail.com>
-
 Descriptions of section entries:
 
         M: Mail patches to: FullName <address@domain>
diff --git a/import-layers/meta-openembedded/meta-networking/README b/import-layers/meta-openembedded/meta-networking/README
index 329db4f..e1ba27d 100644
--- a/import-layers/meta-openembedded/meta-networking/README
+++ b/import-layers/meta-openembedded/meta-networking/README
@@ -18,19 +18,19 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/openembedded-core.git
-branch: morty
+branch: master
 revision: HEAD
 
 For some recipes, the meta-oe layer is required:
 
 URI: git://github.com/openembedded/meta-openembedded.git
 subdirectory: meta-oe
-branch: morty
+branch: master
 revision: HEAD
 
 URI: git://github.com/openembedded/meta-openembedded.git
 subdirectory: meta-python
-branch: morty
+branch: master
 revision: HEAD
 
 Maintenance
diff --git a/import-layers/meta-openembedded/meta-networking/classes/waf-samba.bbclass b/import-layers/meta-openembedded/meta-networking/classes/waf-samba.bbclass
index af4c7d0..e490176 100644
--- a/import-layers/meta-openembedded/meta-networking/classes/waf-samba.bbclass
+++ b/import-layers/meta-openembedded/meta-networking/classes/waf-samba.bbclass
@@ -1,7 +1,7 @@
 # waf is a build system which is used by samba related project.
 # Obtain details from https://wiki.samba.org/index.php/Waf
 # 
-inherit qemu pythonnative
+inherit qemu pythonnative waf
 
 DEPENDS += "qemu-native libxslt-native docbook-xsl-stylesheets-native python"
 
@@ -45,6 +45,7 @@
 do_configure() {
 
     # Prepare the cross-answers file
+    WAF_CROSS_ANSWERS_PATH="${THISDIR}/../../files/waf-cross-answers"
     CROSS_ANSWERS="${B}/cross-answers-${TARGET_ARCH}.txt"
     if [ -e ${CROSS_ANSWERS} ]; then
         rm -f ${CROSS_ANSWERS}
@@ -86,7 +87,7 @@
 }
 
 do_compile () {
-    python ./buildtools/bin/waf ${PARALLEL_MAKE}
+    python ./buildtools/bin/waf ${@get_waf_parallel_make(d)}
 }
 
 do_install() {
diff --git a/import-layers/meta-openembedded/meta-networking/conf/layer.conf b/import-layers/meta-openembedded/meta-networking/conf/layer.conf
index c09ba4a..b5aa159 100644
--- a/import-layers/meta-openembedded/meta-networking/conf/layer.conf
+++ b/import-layers/meta-openembedded/meta-networking/conf/layer.conf
@@ -19,8 +19,9 @@
 
 LICENSE_PATH += "${LAYERDIR}/licenses"
 
-# used by waf-samba.bbclass
-WAF_CROSS_ANSWERS_PATH = "${LAYERDIR}/files/waf-cross-answers"
-
 # Override security flags
 require conf/distro/include/meta_networking_security_flags.inc
+
+SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
+  wireguard-tools->wireguard-module \
+"
diff --git a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64.txt b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64.txt
index bbf7f16..1023f6a 100644
--- a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64.txt
+++ b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64.txt
@@ -36,3 +36,4 @@
 Checking for small off_t: NO
 Checking whether blkcnt_t is 32 bit: NO
 Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-arm.txt b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-arm.txt
index e926fcd..a5cd998 100644
--- a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-arm.txt
+++ b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-arm.txt
@@ -37,3 +37,4 @@
 Checking for small off_t: NO
 Checking whether blkcnt_t is 32 bit: NO
 Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i586.txt b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i586.txt
index e926fcd..a5cd998 100644
--- a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i586.txt
+++ b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i586.txt
@@ -37,3 +37,4 @@
 Checking for small off_t: NO
 Checking whether blkcnt_t is 32 bit: NO
 Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i686.txt b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i686.txt
index e926fcd..a5cd998 100644
--- a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i686.txt
+++ b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i686.txt
@@ -37,3 +37,4 @@
 Checking for small off_t: NO
 Checking whether blkcnt_t is 32 bit: NO
 Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips.txt b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips.txt
index 18bfa02..3e239e7 100644
--- a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips.txt
+++ b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips.txt
@@ -37,3 +37,4 @@
 Checking for small off_t: NO
 Checking whether blkcnt_t is 32 bit: NO
 Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips64.txt b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips64.txt
index 8fa015a..82e694f 100644
--- a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips64.txt
+++ b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips64.txt
@@ -36,3 +36,4 @@
 Checking for small off_t: NO
 Checking whether blkcnt_t is 32 bit: NO
 Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mipsel.txt b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mipsel.txt
index 18bfa02..3e239e7 100644
--- a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mipsel.txt
+++ b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mipsel.txt
@@ -37,3 +37,4 @@
 Checking for small off_t: NO
 Checking whether blkcnt_t is 32 bit: NO
 Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc.txt b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc.txt
index fb93b56..27b9378 100644
--- a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc.txt
+++ b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc.txt
@@ -37,3 +37,4 @@
 Checking for small off_t: NO
 Checking whether blkcnt_t is 32 bit: NO
 Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc64.txt b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc64.txt
index fd585f0..7fd3092 100644
--- a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc64.txt
+++ b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc64.txt
@@ -37,3 +37,4 @@
 Checking for small off_t: NO
 Checking whether blkcnt_t is 32 bit: NO
 Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-x86_64.txt b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-x86_64.txt
index bbf7f16..1023f6a 100644
--- a/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-x86_64.txt
+++ b/import-layers/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-x86_64.txt
@@ -36,3 +36,4 @@
 Checking for small off_t: NO
 Checking whether blkcnt_t is 32 bit: NO
 Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb
index dbddd55..82a297b 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb
@@ -4,7 +4,7 @@
 LICENSE = "copyleft-next-0.3.0"
 LIC_FILES_CHKSUM = "file://copyleft-next-0.3.0;md5=8743a2c359037d4d329a31e79eabeffe"
 
-DEPENDS = "python-m2crypto-native python-native libgcrypt libnl openssl"
+DEPENDS = "python-m2crypto-native python-typing-native python-native libgcrypt libnl openssl"
 
 SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz \
            file://do-not-run-ldconfig-if-destdir-is-set.patch \
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb
index 3ed3aab..47cb163 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb
@@ -9,7 +9,9 @@
 DEPENDS = "libpcap libpcre libdnet"
 
 SRC_URI = "http://fossies.org/linux/misc/daq-${PV}.tar.gz \
-            file://disable-run-test-program-while-cross-compiling.patch "
+           file://disable-run-test-program-while-cross-compiling.patch \
+           file://0001-correct-the-location-of-unistd.h.patch \
+           "
 
 # these 2 create undeclared dependency on libdnet and libnetfilter-queue from meta-networking
 # this error from test-dependencies script:
@@ -20,7 +22,7 @@
 EXTRA_OECONF = "--disable-nfq-module --disable-ipq-module --includedir=${includedir} \
     --with-libpcap-includes=${STAGING_INCDIR} --with-dnet-includes=${STAGING_LIBDIR}"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
 SRC_URI[md5sum] = "2cd6da422a72c129c685fc4bb848c24c"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/files/0001-correct-the-location-of-unistd.h.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/files/0001-correct-the-location-of-unistd.h.patch
new file mode 100644
index 0000000..4798a77
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/files/0001-correct-the-location-of-unistd.h.patch
@@ -0,0 +1,29 @@
+From 10e7d4e4bfcb70344d18f0d4ce36068475747f25 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 15:59:43 -0700
+Subject: [PATCH] correct the location of unistd.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ os-daq-modules/daq_ipfw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/os-daq-modules/daq_ipfw.c b/os-daq-modules/daq_ipfw.c
+index 016beb0..c2a4175 100644
+--- a/os-daq-modules/daq_ipfw.c
++++ b/os-daq-modules/daq_ipfw.c
+@@ -23,10 +23,10 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <unistd.h>
+ 
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <sys/unistd.h>
+ 
+ #include <netinet/in.h>
+ #include <sys/socket.h>
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/dhcpcd/dhcpcd_6.11.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/dhcpcd/dhcpcd_6.11.3.bb
index 197dfb1..cb3b5c2 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/dhcpcd/dhcpcd_6.11.3.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/dhcpcd/dhcpcd_6.11.3.bb
@@ -14,7 +14,7 @@
 
 inherit autotools-brokensep
 
-PACKAGECONFIG ?= "udev ${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6", "", d)}"
+PACKAGECONFIG ?= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 
 PACKAGECONFIG[udev] = "--with-udev,--without-udev,udev,udev"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch
new file mode 100644
index 0000000..42d2627
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch
@@ -0,0 +1,48 @@
+Index: git/ClntMessages/ClntMsgRequest.cpp
+===================================================================
+--- git.orig/ClntMessages/ClntMsgRequest.cpp
++++ git/ClntMessages/ClntMsgRequest.cpp
+@@ -142,7 +142,10 @@ TClntMsgRequest::TClntMsgRequest(List(TA
+     IsDone=false;
+     SPtr<TOpt> ptr;
+     ptr = new TOptDUID(OPTION_CLIENTID, ClntCfgMgr().getDUID(), this );
+-    Options.push_back( ptr );
++
++    if ( ptr ) { 
++        Options.push_back( ptr );
++    }
+ 
+     if (!srvDUID) {
+ 	Log(Error) << "Unable to send REQUEST: ServerId not specified.\n" << LogEnd;
+@@ -153,7 +156,9 @@ TClntMsgRequest::TClntMsgRequest(List(TA
+     ptr = new TOptDUID(OPTION_SERVERID, srvDUID,this);
+     // all IAs provided by checkSolicit
+     SPtr<TAddrIA> ClntAddrIA;
+-    Options.push_back( ptr );
++    if ( ptr ) {
++        Options.push_back( ptr );
++    }
+ 	
+     IAs.first();
+     while (ClntAddrIA = IAs.get()) 
+Index: git/Messages/Msg.cpp
+===================================================================
+--- git.orig/Messages/Msg.cpp
++++ git/Messages/Msg.cpp
+@@ -69,10 +69,15 @@ int TMsg::getSize()
+ {
+     int pktsize=0;
+     TOptList::iterator opt;
++    int optionCount = 0;
+     for (opt = Options.begin(); opt!=Options.end(); ++opt)
+     {
+-	pktsize += (*opt)->getSize();
++       Log(Info) << "### CPE Debug - Option with index  " << optionCount++ << LogEnd ;
++       Log(Info) << "### CPE Debug - Option with type " << (*opt)->getOptType() << LogEnd ;
++       pktsize += (*opt)->getSize();
+     }
++    Log(Info) << "### CPE Debug - Packet size of option (Add 4) " << pktsize << LogEnd ;
++
+     return pktsize + 4;
+ }
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb
new file mode 100644
index 0000000..8890e14
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Dibbler DHCPv6 client"
+DESCRIPTION = "Dibbler is a portable DHCPv6 implementation. It supports stateful as well as stateless autoconfiguration for IPv6."
+HOMEPAGE = "http://klub.com.pl/dhcpv6"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7236695bb6d4461c105d685a8b61c4e3"
+
+SRCREV = "c4b0ed52e751da7823dd9a36e91f93a6310e5525"
+
+SRC_URI = "git://github.com/tomaszmrugalski/dibbler \
+           file://dibbler_fix_getSize_crash.patch \
+          "
+PV = "1.0.1+1.0.2RC1+git${SRCREV}"
+
+S = "${WORKDIR}/git"
+
+PACKAGECONFIG ??= "debug bind-reuse resolvconf dns-update"
+
+PACKAGECONFIG[debug] = "--enable-debug,,,"
+PACKAGECONFIG[efence] = "--enable-efence,,,"
+PACKAGECONFIG[bind-reuse] = "--enable-bind-reuse,,,"
+PACKAGECONFIG[dst-addr-filter] = "--enable-dst-addr-check,,,"
+PACKAGECONFIG[resolvconf] = "--enable-resolvconf,,,"
+PACKAGECONFIG[dns-update] = "--enable-dns-update,,,"
+PACKAGECONFIG[auth] = "--enable-auth,,,"
+PACKAGECONFIG[gtest] = "--enable-gtest-static,,,"
+
+inherit autotools
+
+DEPENDS += "flex-native"
+
+PACKAGES =+ "${PN}-requestor ${PN}-client ${PN}-relay ${PN}-server"
+
+FILES_${PN}-client = "${sbindir}/${PN}-client"
+FILES_${PN}-relay = "${sbindir}/${PN}-relay"
+FILES_${PN}-requestor = "${sbindir}/${PN}-requestor"
+FILES_${PN}-server = "${sbindir}/${PN}-server"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/ez-ipupdate_3.0.11b7.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/ez-ipupdate_3.0.11b7.bb
new file mode 100644
index 0000000..51e220c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/ez-ipupdate_3.0.11b7.bb
@@ -0,0 +1,16 @@
+SUMMARY = "daemon that sends updates when your IP changes"
+HOMEPAGE = "http://sourceforge.net/projects/ez-ipupdate/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7783169b4be06b54e86730eb01bc3a31"
+
+SRC_URI = "http://sourceforge.net/projects/ez-ipupdate/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+    file://Makefile.am.patch \
+    file://cache_file.c.patch \
+    file://conf_file.c.patch \
+    file://wformat.patch \
+    "
+SRC_URI[md5sum] = "525be4550b4461fdf105aed8e753b020"
+SRC_URI[sha256sum] = "a15ec0dc0b78ec7578360987c68e43a67bc8d3591cbf528a323588830ae22c20"
+
+inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/Makefile.am.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/Makefile.am.patch
new file mode 100644
index 0000000..d80ed3e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/Makefile.am.patch
@@ -0,0 +1,14 @@
+Remove EXTRASRC and EXTRAOBJ from obj list
+
+--- ez-ipupdate-3.0.11b7/Makefile.am.orig	2014-07-02 13:47:50.758034983 -0600
++++ ez-ipupdate-3.0.11b7/Makefile.am	2014-07-02 13:48:38.406034650 -0600
+@@ -1,7 +1,7 @@
+ 
+ bin_PROGRAMS = ez-ipupdate
+-ez_ipupdate_SOURCES = ez-ipupdate.c conf_file.c conf_file.h md5.c md5.h cache_file.c cache_file.h error.h pid_file.c pid_file.h dprintf.h @EXTRASRC@
+-ez_ipupdate_LDADD = @EXTRAOBJ@
++ez_ipupdate_SOURCES = ez-ipupdate.c conf_file.c conf_file.h md5.c md5.h cache_file.c cache_file.h error.h pid_file.c pid_file.h dprintf.h
++ez_ipupdate_LDADD =
+ 
+ EXTRA_DIST = getpass.c ez-ipupdate.lsm example.conf example-pgpow.conf example-dhs.conf example-dyndns.conf example-ods.conf example-tzo.conf example-gnudip.conf example-easydns.conf example-justlinux.conf example-dyns.conf CHANGELOG mkbinary example-heipv6tb.conf
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/cache_file.c.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/cache_file.c.patch
new file mode 100644
index 0000000..de5eb3a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/cache_file.c.patch
@@ -0,0 +1,32 @@
+Dont assume errno type
+
+--- ez-ipupdate-3.0.11b7/cache_file.c.orig	2014-07-02 14:01:07.126029412 -0600
++++ ez-ipupdate-3.0.11b7/cache_file.c	2014-07-02 14:08:27.422026332 -0600
+@@ -43,11 +43,11 @@
+ #include <cache_file.h>
+ 
+ #if HAVE_STRERROR
+-extern int errno;
++#  include <errno.h>
+ #  define error_string strerror(errno)
+ #elif HAVE_SYS_ERRLIST
+ extern const char *const sys_errlist[];
+-extern int errno;
++#  include <errno.h>
+ #  define error_string (sys_errlist[errno])
+ #else
+ #  define error_string "error message not found"
+@@ -63,11 +63,11 @@
+ #  define dprintf(x)
+ #endif
+ #if HAVE_STRERROR
+-extern int errno;
++#  include <errno.h>
+ #  define error_string strerror(errno)
+ #elif HAVE_SYS_ERRLIST
+ extern const char *const sys_errlist[];
+-extern int errno;
++#  include <errno.h>
+ #  define error_string (sys_errlist[errno])
+ #else
+ #  define error_string "error message not found"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/conf_file.c.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/conf_file.c.patch
new file mode 100644
index 0000000..02218a3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/conf_file.c.patch
@@ -0,0 +1,18 @@
+Dont assume errno type
+
+--- ez-ipupdate-3.0.11b7/conf_file.c.orig	2014-07-02 14:01:19.174029328 -0600
++++ ez-ipupdate-3.0.11b7/conf_file.c	2014-07-02 14:08:42.982026223 -0600
+@@ -38,11 +38,11 @@
+ #include <conf_file.h>
+ 
+ #if HAVE_STRERROR
+-extern int errno;
++#  include <errno.h>
+ #  define error_string strerror(errno)
+ #elif HAVE_SYS_ERRLIST
+ extern const char *const sys_errlist[];
+-extern int errno;
++#  include <errno.h>
+ #  define error_string (sys_errlist[errno])
+ #else
+ #  define error_string "error message not found"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/wformat.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/wformat.patch
new file mode 100644
index 0000000..1de267f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/wformat.patch
@@ -0,0 +1,13 @@
+Index: ez-ipupdate-3.0.11b7/ez-ipupdate.c
+===================================================================
+--- ez-ipupdate-3.0.11b7.orig/ez-ipupdate.c
++++ ez-ipupdate-3.0.11b7/ez-ipupdate.c
+@@ -798,7 +798,7 @@ void show_message(char *fmt, ...)
+     sprintf(buf, "message incomplete because your OS sucks: %s\n", fmt);
+ #endif
+ 
+-    syslog(LOG_NOTICE, buf);
++    syslog(LOG_NOTICE, "%s", buf);
+   }
+   else
+   {
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb
index a8c4025..4655bc5 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb
@@ -34,7 +34,7 @@
 SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '', 'file://fix-disable-ipv6.patch', d)}"
 
 PACKAGECONFIG ??= "ftp uucpd \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6 ping6', '', d)} \
                   "
 PACKAGECONFIG[ftp] = "--enable-ftp,--disable-ftp,readline"
@@ -58,14 +58,16 @@
 }
 
 do_install_append () {
-    install -m 0755 -d ${D}${base_bindir}
     install -m 0755 -d ${D}${base_sbindir}
     install -m 0755 -d ${D}${sbindir}
     install -m 0755 -d ${D}${sysconfdir}/xinetd.d
-    mv ${D}${bindir}/ping* ${D}${base_bindir}/
+    if [ "${base_bindir}" != "${bindir}" ] ; then
+         install -m 0755 -d ${D}${base_bindir}
+         mv ${D}${bindir}/ping* ${D}${base_bindir}/
+         mv ${D}${bindir}/hostname ${D}${base_bindir}/
+    fi
     mv ${D}${bindir}/ifconfig ${D}${base_sbindir}/
     mv ${D}${libexecdir}/syslogd ${D}${base_sbindir}/
-    mv ${D}${bindir}/hostname ${D}${base_bindir}/
     mv ${D}${libexecdir}/tftpd ${D}${sbindir}/in.tftpd
     mv ${D}${libexecdir}/telnetd ${D}${sbindir}/in.telnetd
     mv ${D}${libexecdir}/rexecd ${D}${sbindir}/in.rexecd
@@ -104,9 +106,10 @@
 # provided by netkit, so add the corresponding -dbg packages
 # for them to avoid the confliction between the dbg package
 # of inetutils and netkit.
-PACKAGES += "${PN}-tftpd-dbg ${PN}-telnetd-dbg ${PN}-rshd-dbg"
+PACKAGES =+ "${PN}-tftpd-dbg ${PN}-telnetd-dbg ${PN}-rshd-dbg"
+NOAUTOPACKAGEDEBUG = "1"
 
-ALTERNATIVE_PRIORITY = "80"
+ALTERNATIVE_PRIORITY = "79"
 ALTERNATIVE_${PN} = "talk whois"
 ALTERNATIVE_LINK_NAME[talkd]  = "${sbindir}/in.talkd"
 ALTERNATIVE_LINK_NAME[uucpd]  = "${sbindir}/in.uucpd"
@@ -143,16 +146,23 @@
 ALTERNATIVE_${PN}-hostname = "hostname"
 ALTERNATIVE_LINK_NAME[hostname]  = "${base_bindir}/hostname"
 
+ALTERNATIVE_${PN}-doc = "hostname.1 dnsdomainname.1 logger.1 syslogd.8"
+ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
+ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1"
+ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1"
+ALTERNATIVE_LINK_NAME[syslogd.8] = "${mandir}/man8/syslogd.8"
+
 ALTERNATIVE_${PN}-ifconfig = "ifconfig"
 ALTERNATIVE_LINK_NAME[ifconfig]  = "${base_sbindir}/ifconfig"
 
 ALTERNATIVE_${PN}-ping = "ping"
 ALTERNATIVE_LINK_NAME[ping]   = "${base_bindir}/ping"
 
-ALTERNATIVE_${PN}-ping6 = "${@bb.utils.contains('PACKAGECONFIG', 'ping6', 'ping6', '', d)}"
+ALTERNATIVE_${PN}-ping6 = "${@bb.utils.filter('PACKAGECONFIG', 'ping6', d)}"
 ALTERNATIVE_LINK_NAME[ping6]  = "${base_bindir}/ping6"
 
 
+FILES_${PN}-dbg += "${base_bindir}/.debug ${base_sbindir}/.debug ${bindir}/.debug ${sbindir}/.debug"
 FILES_${PN}-ping = "${base_bindir}/ping.${BPN}"
 FILES_${PN}-ping6 = "${base_bindir}/ping6.${BPN}"
 FILES_${PN}-hostname = "${base_bindir}/hostname.${BPN}"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.3.bb
deleted file mode 100644
index 2878211..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.3.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-DESCRIPTION = "LFTP is a sophisticated file transfer program with \
-               command line interface. It supports FTP, HTTP, \
-               FISH, SFTP, HTTPS and FTPS protocols"
-HOMEPAGE = "http://lftp.yar.ru/"
-SECTION = "console/network"
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-SRC_URI = "http://fossies.org/linux/misc/lftp-${PV}.tar.gz \
-           file://fix-gcc-6-conflicts-signbit.patch \
-          "
-SRC_URI[md5sum] = "8eb1fe5f113126b60f172643c7f6c2e6"
-SRC_URI[sha256sum] = "ce6519831603c19c2cf2e3c10b41d6ddc87a16049b99383e7b9b77fbc7707214"
-
-inherit autotools gettext pkgconfig
-
-acpaths = "-I ./m4"
-
-EXTRA_OECONF += "--with-modules"
-
-PACKAGECONFIG ??= "libidn openssl zlib gnutls readline expat"
-PACKAGECONFIG[libidn] = "--with-libidn, --without-libidn, libidn"
-PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
-PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_INCDIR}/.., --without-zlib, zlib"
-PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
-PACKAGECONFIG[readline] = "--with-readline=${STAGING_INCDIR}/.. --with-readline-inc=${STAGING_INCDIR} --with-readline-lib=-lreadline, --with-readline=no, readline"
-PACKAGECONFIG[expat] = "--with-expat=${STAGING_INCDIR}/.. --with-expat-inc=${STAGING_INCDIR} --with-expat-lib=-lexpat, , expat"
-
-FILES_${PN}-dbg += "${libdir}/lftp/${PV}/.debug"
-RDEPENDS_${PN} = "perl bash readline"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.7.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.7.bb
new file mode 100644
index 0000000..b6b65da
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.7.bb
@@ -0,0 +1,34 @@
+DESCRIPTION = "LFTP is a sophisticated file transfer program with \
+               command line interface. It supports FTP, HTTP, \
+               FISH, SFTP, HTTPS and FTPS protocols"
+HOMEPAGE = "http://lftp.yar.ru/"
+SECTION = "console/network"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "http://lftp.yar.ru/ftp/lftp-${PV}.tar.bz2 \
+           file://fix-gcc-6-conflicts-signbit.patch \
+          "
+SRC_URI[md5sum] = "3701e7675baa5619c92622eb141c8301"
+SRC_URI[sha256sum] = "fe441f20a9a317cfb99a8b8e628ba0457df472b6d93964d17374d5b5ebdf9280"
+
+inherit autotools gettext pkgconfig
+
+acpaths = "-I ./m4"
+
+EXTRA_OECONF += "--with-modules"
+
+PACKAGECONFIG ??= "libidn openssl zlib gnutls readline expat"
+PACKAGECONFIG[libidn] = "--with-libidn, --without-libidn, libidn"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_INCDIR}/.., --without-zlib, zlib"
+PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
+PACKAGECONFIG[readline] = "--with-readline=${STAGING_INCDIR}/.. --with-readline-inc=${STAGING_INCDIR} --with-readline-lib=-lreadline, --with-readline=no, readline"
+PACKAGECONFIG[expat] = "--with-expat=${STAGING_INCDIR}/.. --with-expat-inc=${STAGING_INCDIR} --with-expat-lib=-lexpat, , expat"
+
+do_install_append() {
+	rm -rf ${D}${libdir}/charset.alias
+}
+
+FILES_${PN}-dbg += "${libdir}/lftp/${PV}/.debug"
+RDEPENDS_${PN} = "perl bash readline"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
index daa3c9f..f48b655 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
@@ -4,10 +4,10 @@
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=0036c1b155f4e999f3e0a373490b5db9"
 
-SRC_URI = "${GENTOO_MIRROR}/${BP}.tgz"
+SRC_URI = "git://github.com/dugsong/libdnet.git;nobranch=1"
+SRCREV = "12fca29a6d4e99d1b923d6820887fe7b24226904"
 
-SRC_URI[md5sum] = "9253ef6de1b5e28e9c9a62b882e44cc9"
-SRC_URI[sha256sum] = "83b33039787cf99990e977cef7f18a5d5e7aaffc4505548a83d31bd3515eb026"
+S = "${WORKDIR}/git"
 
 inherit autotools
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb
index 60e7e6e..3a1f0f3 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb
@@ -2,7 +2,7 @@
 LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING.LGPL;md5=243b725d71bb5df4a1e5920b344b86ad"
 
-DEPENDS = "vpnc libxml2 krb5"
+DEPENDS = "vpnc libxml2 krb5 gettext-native"
 
 PACKAGECONFIG ??= "gnutls lz4 libproxy"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb
index aab2ab5..50297f3 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb
@@ -8,6 +8,7 @@
 SRC_URI = "git://nbd.name/relayd.git"
 
 SRCREV = "2970ff60bac6b70ecb682779d5c776dc559dc0b9"
+PV = "0.0.1+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/10-use-only-libsystemd.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/10-use-only-libsystemd.patch
deleted file mode 100644
index 0ddc941..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/10-use-only-libsystemd.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -ur samba-4.4.2/lib/util/debug.c samba-4.4.2/lib/util/debug.c
---- samba-4.4.2/lib/util/debug.c	2016-05-08 18:33:24.000000000 +0200
-+++ samba-4.4.2/lib/util/debug.c	2016-05-08 18:27:09.341481492 +0200
-@@ -102,7 +102,7 @@
- 	.fd = 2 /* stderr by default */
- };
- 
--#if defined(WITH_SYSLOG) || defined(HAVE_LIBSYSTEMD_JOURNAL)
-+#if defined(WITH_SYSLOG) || defined(HAVE_LIBSYSTEMD)
- static int debug_level_to_priority(int level)
- {
- 	/*
-@@ -179,7 +179,7 @@
- }
- #endif /* WITH_SYSLOG */
- 
--#ifdef HAVE_LIBSYSTEMD_JOURNAL
-+#ifdef HAVE_LIBSYSTEMD
- #include <systemd/sd-journal.h>
- static void debug_systemd_log(int msg_level,
- 			      const char *msg, const char *msg_no_nl)
-@@ -251,7 +251,7 @@
- 	},
- #endif
- 
--#ifdef HAVE_LIBSYSTEMD_JOURNAL
-+#ifdef HAVE_LIBSYSTEMD
- 	{
- 		.name = "systemd",
- 		.log = debug_systemd_log,
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/00-fix-typos-in-man-pages.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/00-fix-typos-in-man-pages.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/00-fix-typos-in-man-pages.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/00-fix-typos-in-man-pages.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/0006-avoid-using-colon-in-the-checking-msg.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0006-avoid-using-colon-in-the-checking-msg.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/0006-avoid-using-colon-in-the-checking-msg.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0006-avoid-using-colon-in-the-checking-msg.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/16-do-not-check-xsltproc-manpages.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/16-do-not-check-xsltproc-manpages.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/20-do-not-import-target-module-while-cross-compile.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/20-do-not-import-target-module-while-cross-compile.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/20-do-not-import-target-module-while-cross-compile.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/20-do-not-import-target-module-while-cross-compile.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/21-add-config-option-without-valgrind.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/21-add-config-option-without-valgrind.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/glibc_only.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/glibc_only.patch
new file mode 100644
index 0000000..894bc8b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/glibc_only.patch
@@ -0,0 +1,15 @@
+Index: samba-4.6.2/ctdb/tests/src/test_mutex_raw.c
+===================================================================
+--- samba-4.6.2.orig/ctdb/tests/src/test_mutex_raw.c
++++ samba-4.6.2/ctdb/tests/src/test_mutex_raw.c
+@@ -166,8 +166,10 @@ int main(int argc, const char **argv)
+ 			if (ret == 0) {
+ 				pthread_mutex_unlock(mutex);
+ 			}
++#ifdef __GLIBC__
+ 		} else if (ret == EBUSY) {
+ 			printf("pid=%u\n", mutex->__data.__owner);
++#endif
+ 		} else if (ret == 0) {
+ 			pthread_mutex_unlock(mutex);
+ 		}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/netdb_defines.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/netdb_defines.patch
new file mode 100644
index 0000000..eb06866
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/netdb_defines.patch
@@ -0,0 +1,19 @@
+Index: samba-4.6.2/nsswitch/wins.c
+===================================================================
+--- samba-4.6.2.orig/nsswitch/wins.c
++++ samba-4.6.2/nsswitch/wins.c
+@@ -39,6 +39,14 @@ static pthread_mutex_t wins_nss_mutex =
+ #define INADDRSZ 4
+ #endif
+ 
++#ifndef NETDB_INTERNAL
++#define NETDB_INTERNAL (-1)
++#endif
++
++#ifndef NETDB_SUCCESS
++#define NETDB_SUCCESS  0
++#endif
++
+ NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname,
+ 				     struct hostent *he,
+ 				     char *buffer,
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.2.7-pam.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.2.7-pam.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.3.9-remove-getpwent_r.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.3.9-remove-getpwent_r.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/volatiles.03_samba b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/volatiles.03_samba
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/volatiles.03_samba
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/volatiles.03_samba
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb
deleted file mode 100644
index c564f73..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb
+++ /dev/null
@@ -1,344 +0,0 @@
-SECTION = "console/network"
-
-LICENSE = "GPL-3.0+ & LGPL-3.0+ & GPL-2.0+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
-                    file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 "
-
-SAMBA_MIRROR = "http://samba.org/samba/ftp"
-MIRRORS += "\
-${SAMBA_MIRROR}    http://mirror.internode.on.net/pub/samba \n \
-${SAMBA_MIRROR}    http://www.mirrorservice.org/sites/ftp.samba.org \n \
-"
-
-SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
-           file://00-fix-typos-in-man-pages.patch \
-           file://10-use-only-libsystemd.patch \
-           file://16-do-not-check-xsltproc-manpages.patch \
-           file://20-do-not-import-target-module-while-cross-compile.patch \
-           file://21-add-config-option-without-valgrind.patch \
-           file://0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch \
-           file://0006-avoid-using-colon-in-the-checking-msg.patch \
-           file://volatiles.03_samba \
-          "
-SRC_URI_append_libc-musl = " \
-           file://samba-4.2.7-pam.patch \
-           file://samba-4.3.9-remove-getpwent_r.patch \
-          "
-
-SRC_URI[md5sum] = "6950c5e9f7bdeb8a610c2ca957a15be4"
-SRC_URI[sha256sum] = "b876ef2e63f66265490e80a122e66ef2d7616112b839df68f56ac2e1ce17a7bd"
-
-inherit systemd waf-samba cpan-base perlnative update-rc.d
-# remove default added RDEPENDS on perl
-RDEPENDS_${PN}_remove = "perl"
-
-DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb krb5 libbsd libaio libpam"
-DEPENDS_append_libc-musl = " libtirpc"
-CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
-LDFLAGS_append_libc-musl = " -ltirpc"
-
-SYSVINITTYPE_linuxstdbase = "lsb"
-SYSVINITTYPE = "sysv"
-
-INITSCRIPT_NAME = "samba.sh"
-INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ."
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '${SYSVINITTYPE}', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'zeroconf', '', d)} \
-                   acl cups ldap \
-"
-
-RDEPENDS_${PN}-base += "${@bb.utils.contains('PACKAGECONFIG', 'lsb', 'lsb', '', d)}"
-RDEPENDS_${PN}-ctdb-tests += "bash util-linux-getopt"
-
-PACKAGECONFIG[acl] = "--with-acl-support,--without-acl-support,acl"
-PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin"
-PACKAGECONFIG[lsb] = ",,lsb"
-PACKAGECONFIG[sysv] = ",,sysvinit"
-PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,cups"
-PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
-PACKAGECONFIG[sasl] = ",,cyrus-sasl"
-PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
-PACKAGECONFIG[dmapi] = "--with-dmapi,--without-dmapi,dmapi"
-PACKAGECONFIG[zeroconf] = "--enable-avahi,--disable-avahi,avahi"
-PACKAGECONFIG[valgrind] = ",--without-valgrind,valgrind,"
-PACKAGECONFIG[lttng] = "--with-lttng, --without-lttng,lttng-ust"
-PACKAGECONFIG[archive] = "--with-libarchive, --without-libarchive, libarchive"
-
-
-SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
-SAMBA4_PDB_MODULES="pdb_tdbsam,${@bb.utils.contains('PACKAGECONFIG', 'ldap', 'pdb_ldap,', '', d)}pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
-SAMBA4_AUTH_MODULES="auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4"
-SAMBA4_MODULES="${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MODULES}"
-
-SAMBA4_LIBS="heimdal,!zlib,!popt,!talloc,!pytalloc,!pytalloc-util,!tevent,!pytevent,!tdb,!pytdb,!ldb,!pyldb"
-
-EXTRA_OECONF += "--enable-fhs \
-                 --with-piddir=/run \
-                 --with-sockets-dir=/run/samba \
-                 --with-modulesdir=${libdir}/samba \
-                 --with-lockdir=${localstatedir}/lib/samba \
-                 --with-cachedir=${localstatedir}/lib/samba \
-                 --disable-gnutls \
-                 --disable-rpath-install \
-                 --with-shared-modules=${SAMBA4_MODULES} \
-                 --bundled-libraries=${SAMBA4_LIBS} \
-                 --with-system-mitkrb5 \
-                 --without-ad-dc \
-                 ${@base_conditional('TARGET_ARCH', 'x86_64', '', '--disable-glusterfs', d)} \
-                 --with-cluster-support \
-                 --with-profiling-data \
-                 --with-libiconv=${STAGING_DIR_HOST}${prefix} \
-                 --with-pam --with-pammodulesdir=${base_libdir}/security \
-                "
-DISABLE_STATIC = ""
-
-LDFLAGS += "-Wl,-z,relro,-z,now ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
-
-do_install_append() {
-    if ${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${systemd_unitdir}/system
-        for i in nmb smb winbind; do
-            install -m 0644 packaging/systemd/$i.service ${D}${systemd_unitdir}/system
-        done
-        sed -i 's,\(ExecReload=\).*\(/kill\),\1${base_bindir}\2,' ${D}${systemd_unitdir}/system/*.service
-
-        install -d ${D}${sysconfdir}/tmpfiles.d
-        install -m644 packaging/systemd/samba.conf.tmp ${D}${sysconfdir}/tmpfiles.d/samba.conf
-        echo "d ${localstatedir}/log/samba 0755 root root -" \
-            >> ${D}${sysconfdir}/tmpfiles.d/samba.conf
-    elif ${@bb.utils.contains('PACKAGECONFIG', 'lsb', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/init.d
-        install -m 0755 packaging/LSB/samba.sh ${D}${sysconfdir}/init.d
-    elif ${@bb.utils.contains('PACKAGECONFIG', 'sysv', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/init.d
-        install -m 0755 packaging/sysv/samba.init ${D}${sysconfdir}/init.d/samba.sh
-        sed -e 's,/opt/samba/bin,${sbindir},g' \
-            -e 's,/opt/samba/smb.conf,${sysconfdir}/samba/smb.conf,g' \
-            -e 's,/opt/samba/log,${localstatedir}/log/samba,g' \
-            -e 's,/etc/init.d/samba.server,${sysconfdir}/init.d/samba.sh,g' \
-            -e 's,/usr/bin,${base_bindir},g' \
-            -i ${D}${sysconfdir}/init.d/samba.sh
-    fi
-
-    install -d ${D}${sysconfdir}/samba
-    echo "127.0.0.1 localhost" > ${D}${sysconfdir}/samba/lmhosts
-    install -m644 packaging/LSB/smb.conf ${D}${sysconfdir}/samba/smb.conf
-    install -D -m 644 ${WORKDIR}/volatiles.03_samba ${D}${sysconfdir}/default/volatiles/03_samba
-
-    install -d ${D}${sysconfdir}/sysconfig/
-    install -m644 packaging/systemd/samba.sysconfig ${D}${sysconfdir}/sysconfig/samba
-
-    # install ctdb config file and test cases
-    install -D -m 0644 ${S}/ctdb/tests/onnode/nodes ${D}${sysconfdir}/ctdb/nodes
-    # the items are from ctdb/tests/run_tests.sh
-    for d in onnode takeover tool eventscripts cunit simple complex; do
-        testdir=${D}${datadir}/ctdb-tests/$d
-        install -d $testdir
-        cp ${S}/ctdb/tests/$d/*.sh $testdir
-        cp -r ${S}/ctdb/tests/$d/scripts ${S}/ctdb/tests/$d/stubs $testdir || true
-    done
-
-    # fix file-rdeps qa warning
-    if [ -f ${D}${bindir}/onnode ]; then
-        sed -i 's:\(#!/bin/\)bash:\1sh:' ${D}${bindir}/onnode
-    fi
-
-    rm -rf ${D}/run ${D}${localstatedir}/run ${D}${localstatedir}/log
-}
-
-PACKAGES =+ "${PN}-python ${PN}-python-dbg ${PN}-pidl libwinbind libwinbind-dbg libwinbind-krb5-locator"
-PACKAGES =+ "libwbclient libnss-winbind winbind winbind-dbg libnetapi libsmbsharemodes \
-             libsmbclient libsmbclient-dev lib${BPN}-base ${PN}-base ${PN}-ctdb-tests"
-
-RDEPENDS_${PN} += "${PN}-base"
-
-FILES_${PN}-base = "${sbindir}/nmbd \
-                    ${sbindir}/smbd \
-                    ${sysconfdir}/init.d \
-                    ${localstatedir}/lib/samba \
-                    ${localstatedir}/nmbd \
-                    ${localstatedir}/spool/samba \
-"
-
-FILES_${PN}-ctdb-tests = "${bindir}/ctdb_run_tests \
-                          ${bindir}/ctdb_run_cluster_tests \
-                          ${sysconfdir}/ctdb/nodes \
-                          ${libdir}/ctdb-tests \
-                          ${datadir}/ctdb-tests \
-                          /run/ctdb \
-                         "
-
-# figured out by
-# FILES="tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/samba/4.1.12-r0/image/usr/sbin/smbd tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/samba/4.1.12-r0/image/usr/sbin/nmbd"
-#
-# while [ "${FILES}" != "${OLDFILES}" ]
-# do
-#     OLDFILES="${FILES}"
-#     NEEDED=`tmp/sysroots/x86_64-linux/usr/libexec/arm-poky-linux-gnueabi.gcc-cross-initial-arm/gcc/arm-poky-linux-gnueabi/5.2.0/objdump -x ${FILES} | grep NEEDED | egrep -E 'so(.[0-9]|$)' | sort -u | perl -MData::Dumper -le 'while (<>) {chomp; push @lib, (split)[1]}; print "(", join("|", @lib), ")"'`
-#     NF=`find tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/samba/4.1.12-r0/image/usr/lib -type f | egrep "${NEEDED}" | sort -u`
-#
-#     FILES=`perl -le 'foreach (@ARGV) { $f{$_}++ }; print join(" ", sort keys %f)' ${FILES} ${NF}`
-# done
-#
-# LIBS=`echo ${FILES} | sed -e 's,tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/samba/4.1.12-r0/image/usr/lib,${libdir},g' -e 's,.so.[0-9]+.*$,.so.*,g'`
-# for l in ${LIBS}
-# do
-#     echo $l
-# done
-
-FILES_lib${BPN}-base = "\
-                    ${sysconfdir}/default \
-                    ${sysconfdir}/samba \
-                    ${libdir}/libdcerpc-binding.so.* \
-                    ${libdir}/libgensec.so.* \
-                    ${libdir}/libndr-krb5pac.so.* \
-                    ${libdir}/libndr-nbt.so.* \
-                    ${libdir}/libndr-standard.so.* \
-                    ${libdir}/libndr.so.* \
-                    ${libdir}/libnetapi.so.* \
-                    ${libdir}/libpdb.so.* \
-                    ${libdir}/libsamba-credentials.so.* \
-                    ${libdir}/libsamba-hostconfig.so.* \
-                    ${libdir}/libsamba-util.so.* \
-                    ${libdir}/libsamdb.so.* \
-                    ${libdir}/libsmbconf.so.* \
-                    ${libdir}/libtevent-util.so.* \
-                    ${libdir}/samba/libCHARSET3.so \
-                    ${libdir}/samba/libaddns.so \
-                    ${libdir}/samba/libads.so \
-                    ${libdir}/samba/libasn1util.so \
-                    ${libdir}/samba/libauth.so \
-                    ${libdir}/samba/libauth_sam_reply.so \
-                    ${libdir}/samba/libauthkrb5.so \
-                    ${libdir}/samba/libccan.so \
-                    ${libdir}/samba/libcli-ldap-common.so \
-                    ${libdir}/samba/libcli-nbt.so \
-                    ${libdir}/samba/libcli_cldap.so \
-                    ${libdir}/samba/libcli_smb_common.so \
-                    ${libdir}/samba/libcli_spoolss.so \
-                    ${libdir}/samba/libcliauth.so \
-                    ${libdir}/samba/libdbwrap.so \
-                    ${libdir}/samba/libdcerpc-samba.so \
-                    ${libdir}/samba/liberrors.so \
-                    ${libdir}/samba/libflag_mapping.so \
-                    ${libdir}/samba/libgse.so \
-                    ${libdir}/samba/libinterfaces.so \
-                    ${libdir}/samba/libkrb5samba.so \
-                    ${libdir}/samba/libldbsamba.so \
-                    ${libdir}/samba/liblibcli_lsa3.so \
-                    ${libdir}/samba/liblibcli_netlogon3.so \
-                    ${libdir}/samba/liblibsmb.so \
-                    ${libdir}/samba/libmsrpc3.so \
-                    ${libdir}/samba/libndr-samba.so \
-                    ${libdir}/samba/libndr-samba4.so \
-                    ${libdir}/samba/libnpa_tstream.so \
-                    ${libdir}/samba/libntdb.so.* \
-                    ${libdir}/samba/libpopt_samba3.so \
-                    ${libdir}/samba/libprinting_migrate.so \
-                    ${libdir}/samba/libsamba-modules.so \
-                    ${libdir}/samba/libsamba-security.so \
-                    ${libdir}/samba/libsamba-sockets.so \
-                    ${libdir}/samba/libsamba3-util.so \
-                    ${libdir}/samba/libsamdb-common.so \
-                    ${libdir}/samba/libsecrets3.so \
-                    ${libdir}/samba/libserver-role.so \
-                    ${libdir}/samba/libsmb_transport.so \
-                    ${libdir}/samba/libsmbd_base.so \
-                    ${libdir}/samba/libsmbd_conn.so \
-                    ${libdir}/samba/libsmbd_shim.so \
-                    ${libdir}/samba/libsmbregistry.so \
-                    ${libdir}/samba/libtdb-wrap.so \
-                    ${libdir}/samba/libutil_cmdline.so \
-                    ${libdir}/samba/libutil_ntdb.so \
-                    ${libdir}/samba/libutil_reg.so \
-                    ${libdir}/samba/libutil_setid.so \
-                    ${libdir}/samba/libutil_tdb.so \
-                    ${libdir}/samba/pdb/smbpasswd.so \
-                    ${libdir}/samba/pdb/tdbsam.so \
-                    ${libdir}/samba/pdb/wbc_sam.so \
-"
-
-FILES_winbind-dbg = "${libdir}/idmap/.debug/*.so \
-                     ${libdir}/security/.debug/pam_winbind.so \
-"
-
-FILES_${PN} += "${libdir}/vfs/*.so \
-                ${libdir}/charset/*.so \
-                ${libdir}/*.dat \
-                ${libdir}/auth/*.so \
-                ${libdir}/security/pam_smbpass.so \
-"
-
-FILES_${PN}-dbg += "${libdir}/vfs/.debug/*.so \
-                    ${libdir}/charset/.debug/*.so \
-                    ${libdir}/auth/.debug/*.so \
-                    ${libdir}/security/.debug/pam_smbpass.so \
-"
-
-FILES_libwbclient = "${libdir}/libwbclient.so.* ${libdir}/samba/libwinbind-client.so"
-FILES_libnetapi = "${libdir}/libnetapi.so.*"
-FILES_libsmbsharemodes = "${libdir}/libsmbsharemodes.so.*"
-FILES_libsmbclient = "${libdir}/libsmbclient.so.*"
-FILES_libsmbclient-dev = "${libdir}/libsmbclient.so ${includedir}"
-FILES_winbind = "${sbindir}/winbindd \
-                 ${bindir}/wbinfo \
-                 ${bindir}/ntlm_auth \
-                 ${sysconfdir}/init.d/winbind \
-                 ${systemd_unitdir}/system/winbind.service \
-"
-
-FILES_libnss-winbind = "${libdir}/libnss_*${SOLIBS} \
-                        ${libdir}/nss_info \
-"
-
-FILES_${PN} += "${base_libdir}/security/pam_smbpass.so \
-"
-
-SMB_SERVICE="${systemd_unitdir}/system/nmb.service ${systemd_unitdir}/system/smb.service"
-SMB_SYSV="${sysconfdir}/init.d ${sysconfdir}/rc?.d"
-FILES_${PN}-base +="${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${SMB_SERVICE}', '', d)}"
-FILES_${PN}-base +="${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '${SMB_SYSV}', '', d)}"
-
-FILES_${PN}-dbg += "${libdir}/samba/idmap/.debug/* \
-                    ${libdir}/samba/pdb/.debug/* \
-                    ${libdir}/samba/auth/.debug/* \
-                    ${libdir}/samba/nss_info/.debug/* \
-                    ${libdir}/samba/ldb/.debug/* \
-                    ${libdir}/samba/vfs/.debug/* \
-                    ${base_libdir}/security/.debug/pam_smbpass.so \
-"
-
-FILES_libwinbind = "${base_libdir}/security/pam_winbind.so"
-FILES_libwinbind += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/winbind.service', '', d)}"
-FILES_libwinbind-dbg = "${base_libdir}/security/.debug/pam_winbind.so"
-FILES_libwinbind-krb5-locator = "${libdir}/winbind_krb5_locator.so"
-
-FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.so \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/_ldb_text.py \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/*.py \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/*.so \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/dcerpc/*.so \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/dcerpc/*.py \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/external/* \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/kcc/* \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/netcmd/*.py \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/provision/*.py \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/samba3/*.py \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/samba3/*.so \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/subunit/* \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/tests/* \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/third_party/* \
-                      ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/web_server/* \
-"
-
-FILES_${PN}-python-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/* \
-                          ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/.debug/* \
-                          ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/samba3/.debug/* \
-                          ${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/dcerpc/.debug/* \
-"
-
-RDEPENDS_${PN}-pidl_append = " perl"
-FILES_${PN}-pidl = "${bindir}/pidl ${datadir}/perl5/Parse"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.2.bb
new file mode 100644
index 0000000..7574aef
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.2.bb
@@ -0,0 +1,254 @@
+SECTION = "console/network"
+
+LICENSE = "GPL-3.0+ & LGPL-3.0+ & GPL-2.0+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
+                    file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 "
+
+SAMBA_MIRROR = "http://samba.org/samba/ftp"
+MIRRORS += "\
+${SAMBA_MIRROR}    http://mirror.internode.on.net/pub/samba \n \
+${SAMBA_MIRROR}    http://www.mirrorservice.org/sites/ftp.samba.org \n \
+"
+
+SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
+           file://00-fix-typos-in-man-pages.patch \
+           file://16-do-not-check-xsltproc-manpages.patch \
+           file://20-do-not-import-target-module-while-cross-compile.patch \
+           file://21-add-config-option-without-valgrind.patch \
+           file://0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch \
+           file://0006-avoid-using-colon-in-the-checking-msg.patch \
+           file://netdb_defines.patch \
+           file://glibc_only.patch \
+           file://volatiles.03_samba \
+          "
+SRC_URI_append_libc-musl = " \
+           file://samba-4.2.7-pam.patch \
+           file://samba-4.3.9-remove-getpwent_r.patch \
+          "
+SRC_URI[md5sum] = "461def8190ffc651fd8458b24ca2a622"
+SRC_URI[sha256sum] = "927afcc16e444718985e3952de92d34e7b776b9ca0238179d866da18a6441c35"
+
+inherit systemd waf-samba cpan-base perlnative update-rc.d
+# remove default added RDEPENDS on perl
+RDEPENDS_${PN}_remove = "perl"
+
+DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb krb5 libbsd libaio libpam"
+DEPENDS_append_libc-musl = " libtirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
+LSB = ""
+LSB_linuxstdbase = "lsb"
+
+INITSCRIPT_NAME = "samba"
+INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ."
+
+SYSTEMD_PACKAGES = "${PN}-base winbind"
+SYSTEMD_SERVICE_${PN}-base = "nmb.service smb.service"
+SYSTEMD_SERVICE_winbind = "winbind.service"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd zeroconf', d)} \
+                   acl cups ldap \
+"
+
+RDEPENDS_${PN}-base += "${LSB}"
+RDEPENDS_${PN}-ctdb-tests += "bash util-linux-getopt"
+
+PACKAGECONFIG[acl] = "--with-acl-support,--without-acl-support,acl"
+PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin"
+PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,cups"
+PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
+PACKAGECONFIG[sasl] = ",,cyrus-sasl"
+PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
+PACKAGECONFIG[dmapi] = "--with-dmapi,--without-dmapi,dmapi"
+PACKAGECONFIG[zeroconf] = "--enable-avahi,--disable-avahi,avahi"
+PACKAGECONFIG[valgrind] = ",--without-valgrind,valgrind,"
+PACKAGECONFIG[lttng] = "--with-lttng, --without-lttng,lttng-ust"
+PACKAGECONFIG[archive] = "--with-libarchive, --without-libarchive, libarchive"
+
+
+SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
+SAMBA4_PDB_MODULES="pdb_tdbsam,${@bb.utils.contains('PACKAGECONFIG', 'ldap', 'pdb_ldap,', '', d)}pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
+SAMBA4_AUTH_MODULES="auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4"
+SAMBA4_MODULES="${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MODULES}"
+
+SAMBA4_LIBS="heimdal,!zlib,!popt,!talloc,!pytalloc,!pytalloc-util,!tevent,!pytevent,!tdb,!pytdb,!ldb,!pyldb"
+
+EXTRA_OECONF += "--enable-fhs \
+                 --with-piddir=/run \
+                 --with-sockets-dir=/run/samba \
+                 --with-modulesdir=${libdir}/samba \
+                 --with-lockdir=${localstatedir}/lib/samba \
+                 --with-cachedir=${localstatedir}/lib/samba \
+                 --disable-gnutls \
+                 --disable-rpath-install \
+                 --with-shared-modules=${SAMBA4_MODULES} \
+                 --bundled-libraries=${SAMBA4_LIBS} \
+                 --with-system-mitkrb5 \
+                 --without-ad-dc \
+                 ${@base_conditional('TARGET_ARCH', 'x86_64', '', '--disable-glusterfs', d)} \
+                 --with-cluster-support \
+                 --with-profiling-data \
+                 --with-libiconv=${STAGING_DIR_HOST}${prefix} \
+                 --with-pam --with-pammodulesdir=${base_libdir}/security \
+                "
+
+LDFLAGS += "-Wl,-z,relro,-z,now ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
+
+do_install_append() {
+    for section in 1 5 7; do
+        install -d ${D}${mandir}/man$section
+        install -m 0644 ctdb/doc/*.$section ${D}${mandir}/man$section
+    done
+    for section in 1 5 7 8; do
+        install -d ${D}${mandir}/man$section
+        install -m 0644 docs/manpages/*.$section ${D}${mandir}/man$section
+    done
+
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 packaging/systemd/*.service ${D}${systemd_system_unitdir}
+    sed -e 's,\(ExecReload=\).*\(/kill\),\1${base_bindir}\2,' \
+        -e 's,/etc/sysconfig/samba,${sysconfdir}/default/samba,' \
+        -i ${D}${systemd_system_unitdir}/*.service
+
+    install -d ${D}${sysconfdir}/tmpfiles.d
+    install -m644 packaging/systemd/samba.conf.tmp ${D}${sysconfdir}/tmpfiles.d/samba.conf
+    echo "d ${localstatedir}/log/samba 0755 root root -" \
+        >> ${D}${sysconfdir}/tmpfiles.d/samba.conf
+    if [ "${LSB}" = "lsb" ]; then
+        install -d ${D}${sysconfdir}/init.d
+        install -m 0755 packaging/LSB/samba.sh ${D}${sysconfdir}/init.d/samba
+    else
+        install -d ${D}${sysconfdir}/init.d
+        install -m 0755 packaging/sysv/samba.init ${D}${sysconfdir}/init.d/samba
+        sed -e 's,/opt/samba/bin,${sbindir},g' \
+            -e 's,/opt/samba/smb.conf,${sysconfdir}/samba/smb.conf,g' \
+            -e 's,/opt/samba/log,${localstatedir}/log/samba,g' \
+            -e 's,/etc/init.d/samba.server,${sysconfdir}/init.d/samba,g' \
+            -e 's,/usr/bin,${base_bindir},g' \
+            -i ${D}${sysconfdir}/init.d/samba
+    fi
+
+    install -d ${D}${sysconfdir}/samba
+    echo "127.0.0.1 localhost" > ${D}${sysconfdir}/samba/lmhosts
+    install -m644 packaging/LSB/smb.conf ${D}${sysconfdir}/samba/smb.conf
+    install -D -m 644 ${WORKDIR}/volatiles.03_samba ${D}${sysconfdir}/default/volatiles/03_samba
+
+    install -d ${D}${sysconfdir}/default
+    install -m644 packaging/systemd/samba.sysconfig ${D}${sysconfdir}/default/samba
+
+    # install ctdb config file and test cases
+    install -D -m 0644 ${S}/ctdb/tests/onnode/nodes ${D}${sysconfdir}/ctdb/nodes
+    # the items are from ctdb/tests/run_tests.sh
+    for d in onnode takeover tool eventscripts cunit simple complex; do
+        testdir=${D}${datadir}/ctdb-tests/$d
+        install -d $testdir
+        cp ${S}/ctdb/tests/$d/*.sh $testdir
+        cp -r ${S}/ctdb/tests/$d/scripts ${S}/ctdb/tests/$d/stubs $testdir || true
+    done
+
+    # fix file-rdeps qa warning
+    if [ -f ${D}${bindir}/onnode ]; then
+        sed -i 's:\(#!/bin/\)bash:\1sh:' ${D}${bindir}/onnode
+    fi
+
+    chmod 0750 ${D}${sysconfdir}/sudoers.d
+    rm -rf ${D}/run ${D}${localstatedir}/run ${D}${localstatedir}/log
+}
+
+PACKAGES =+ "${PN}-python ${PN}-pidl \
+             ${PN}-dsdb-modules ${PN}-testsuite registry-tools \
+             winbind \
+             ${PN}-common ${PN}-base ${PN}-ctdb-tests \
+             smbclient"
+
+python samba_populate_packages() {
+    def module_hook(file, pkg, pattern, format, basename):
+        pn = d.getVar('PN', True)
+        d.appendVar('RRECOMMENDS_%s-base' % pn, ' %s' % pkg)
+
+    mlprefix = d.getVar('MLPREFIX', True) or ''
+    pam_libdir = d.expand('${base_libdir}/security')
+    pam_pkgname = mlprefix + 'pam-plugin%s'
+    do_split_packages(d, pam_libdir, '^pam_(.*)\.so$', pam_pkgname, 'PAM plugin for %s', extra_depends='', prepend=True)
+
+    libdir = d.getVar('libdir', True)
+    do_split_packages(d, libdir, '^lib(.*)\.so\..*$', 'lib%s', 'Samba %s library', extra_depends='${PN}-common', prepend=True, allow_links=True)
+    pkglibdir = '%s/samba' % libdir
+    do_split_packages(d, pkglibdir, '^lib(.*)\.so$', 'lib%s', 'Samba %s library', extra_depends='${PN}-common', prepend=True)
+    moduledir = '%s/samba/auth' % libdir
+    do_split_packages(d, moduledir, '^(.*)\.so$', 'samba-auth-%s', 'Samba %s authentication backend', hook=module_hook, extra_depends='', prepend=True)
+    moduledir = '%s/samba/pdb' % libdir
+    do_split_packages(d, moduledir, '^(.*)\.so$', 'samba-pdb-%s', 'Samba %s password backend', hook=module_hook, extra_depends='', prepend=True)
+}
+
+PACKAGESPLITFUNCS_prepend = "samba_populate_packages "
+
+RDEPENDS_${PN} += "${PN}-base"
+
+FILES_${PN}-base = "${sbindir}/nmbd \
+                    ${sbindir}/smbd \
+                    ${sysconfdir}/init.d \
+                    ${localstatedir}/lib/samba \
+                    ${localstatedir}/nmbd \
+                    ${localstatedir}/spool/samba \
+                    ${systemd_system_unitdir}/nmb.service \
+                    ${systemd_system_unitdir}/samba.service \
+                    ${systemd_system_unitdir}/smb.service"
+
+FILES_${PN}-ctdb-tests = "${bindir}/ctdb_run_tests \
+                          ${bindir}/ctdb_run_cluster_tests \
+                          ${sysconfdir}/ctdb/nodes \
+                          ${datadir}/ctdb-tests \
+                          ${datadir}/ctdb/tests \
+                         "
+
+FILES_${BPN}-common = "${sysconfdir}/default \
+                       ${sysconfdir}/samba \
+                       ${sysconfdir}/tmpfiles.d \
+"
+
+FILES_${PN} += "${libdir}/vfs/*.so \
+                ${libdir}/charset/*.so \
+                ${libdir}/*.dat \
+                ${libdir}/auth/*.so \
+"
+
+FILES_${PN}-dsdb-modules = "${libdir}/samba/ldb"
+
+FILES_${PN}-testsuite = "${bindir}/gentest \
+                         ${bindir}/locktest \
+                         ${bindir}/masktest \
+                         ${bindir}/ndrdump \
+                         ${bindir}/smbtorture"
+
+FILES_registry-tools = "${bindir}/regdiff \
+                        ${bindir}/regpatch \
+                        ${bindir}/regshell \
+                        ${bindir}/regtree"
+
+FILES_winbind = "${sbindir}/winbindd \
+                 ${bindir}/wbinfo \
+                 ${bindir}/ntlm_auth \
+                 ${libdir}/samba/idmap \
+                 ${libdir}/samba/nss_info \
+                 ${libdir}/winbind_krb5_locator.so \
+                 ${sysconfdir}/init.d/winbind \
+                 ${systemd_system_unitdir}/winbind.service"
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
+
+FILES_smbclient = "${bindir}/cifsdd \
+                   ${bindir}/rpcclient \
+                   ${bindir}/smbcacls \
+                   ${bindir}/smbclient \
+                   ${bindir}/smbcquotas \
+                   ${bindir}/smbget \
+                   ${bindir}/smbspool \
+                   ${bindir}/smbtar \
+                   ${bindir}/smbtree \
+                   ${libdir}/samba/smbspool_krb5_wrapper"
+
+RDEPENDS_${PN}-pidl_append = " perl"
+FILES_${PN}-pidl = "${bindir}/pidl ${datadir}/perl5/Parse"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb
index c62a8d3..dfd6ba9 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb
@@ -5,6 +5,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=78fa8ef966b48fbf9095e13cc92377c5"
 
 DEPENDS = "xz libpcap libpcre daq libdnet util-linux"
+DEPENDS_append_libc-musl = " libtirpc"
 
 SRC_URI = " ${GENTOO_MIRROR}/${BP}.tar.gz;name=tarball \
     file://snort.init \
@@ -46,6 +47,9 @@
 PACKAGECONFIG[openssl] = "--with-openssl-includes=${STAGING_INCDIR} --with-openssl-libraries=${STAGING_LIBDIR}, --without-openssl-includes --without-openssl-libraries, openssl,"
 PACKAGECONFIG[lzma] = "--with-lzma-includes=${STAGING_INCDIR} --with-lzma-libraries=${STAGING_LIBDIR}, --without-lzma-includes --without-lzma-libraries, xz,"
 
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
 do_install_append() {
     install -d ${D}${sysconfdir}/snort/rules
     install -d ${D}${sysconfdir}/snort/preproc_rules
@@ -53,6 +57,17 @@
     for i in map config conf dtd; do
         cp ${S}/etc/*.$i ${D}${sysconfdir}/snort/
     done
+
+    # fix the hardcoded path and lib name
+    # comment out the rules that are not provided
+    sed -i -e 's#/usr/local/lib#${libdir}#' \
+           -e 's#\.\./\(.*rules\)#${sysconfdir}/snort/\1#' \
+           -e 's#\(libsf_engine.so\)#\1.0#' \
+           -e 's/^\(include $RULE_PATH\)/#\1/' \
+           -e 's/^\(dynamicdetection\)/#\1/' \
+           -e '/preprocessor reputation/,/blacklist/ s/^/#/' \
+           ${D}${sysconfdir}/snort/snort.conf
+
     cp ${S}/preproc_rules/*.rules ${D}${sysconfdir}/snort/preproc_rules/
     install -m 755 ${WORKDIR}/snort.init ${D}${sysconfdir}/init.d/snort
     mkdir -p ${D}${localstatedir}/log/snort
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/0001-Add-printf-format-and-silence-format-security-warnin.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/0001-Add-printf-format-and-silence-format-security-warnin.patch
new file mode 100644
index 0000000..ebcfc7c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/0001-Add-printf-format-and-silence-format-security-warnin.patch
@@ -0,0 +1,34 @@
+From 400b8f235377f677a7a760f1e3a1cd26d95140bc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 16 Jun 2017 22:58:18 -0700
+Subject: [PATCH] Add printf format and silence format-security warnings
+
+Fix
+
+vconfig.c:66:4: error: format not a string literal and no format arguments [-Werror=format-security]
+    fprintf(stdout,usage);
+    ^~~~~~~
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ vconfig.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vconfig.c b/vconfig.c
+index 5057cfd..83137ba 100644
+--- a/vconfig.c
++++ b/vconfig.c
+@@ -63,7 +63,7 @@ static char* usage =
+ "            is OFF.\n";
+ 
+ void show_usage() {
+-   fprintf(stdout,usage);
++   fprintf(stdout, "%s", usage);
+ }
+ 
+ int hex_to_bytes(char* bytes, int bytes_length, char* hex_str) {
+-- 
+2.13.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb
index 09c4007..3f688b3 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb
@@ -1,10 +1,12 @@
 SUMMARY = "VLAN provides vconfig utility"
 SECTION = "misc"
 LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://vconfig.c;md5=293ef69c4e88434d37a5ee577a5288cb"
+LIC_FILES_CHKSUM = "file://vconfig.c;beginline=1;endline=19;md5=094ca47de36c20c598b15b32c270ce0a"
 
 SRC_URI = "http://${BPN}.sourcearchive.com/downloads/${PV}-3ubuntu9/${BPN}_${PV}.orig.tar.gz \
-           file://no-HOME-includes.patch"
+           file://no-HOME-includes.patch \
+           file://0001-Add-printf-format-and-silence-format-security-warnin.patch \
+"
 
 SRC_URI[md5sum] = "5f0c6060b33956fb16e11a15467dd394"
 SRC_URI[sha256sum] = "3b8f0a1bf0d3642764e5f646e1f3bbc8b1eeec474a77392d9aeb4868842b4cca"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0001-search-for-log-help-in-build-dir.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0001-search-for-log-help-in-build-dir.patch
new file mode 100644
index 0000000..184c794
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0001-search-for-log-help-in-build-dir.patch
@@ -0,0 +1,26 @@
+From 48e16e9ae7d8e4c42282bd82cbbd9a6d346a5c00 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sun, 2 Dec 2012 02:16:54 +0100
+Subject: [PATCH 1/8] search for log-help in build dir
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ makeman.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/makeman.pl b/makeman.pl
+index cf241a1..2d73432 100755
+--- a/makeman.pl
++++ b/makeman.pl
+@@ -30,7 +30,7 @@ my $vpnc = './vpnc';
+ # indenting lists (those originally starting with an asterisk). I hope
+ # this pays off when converting the manpage to HTML or such.
+ 
+-open my $LONGHELP, '-|', "$vpnc --long-help";
++open my $LONGHELP, '-|', "cat ./long-help";
+ my $vpnc_options    = '';
+ my $relative_indent = 0;
+ my $indent_needed   = 0;
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0002-Fix-vpnc-install-for-cross-compile.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0002-Fix-vpnc-install-for-cross-compile.patch
new file mode 100644
index 0000000..6f00d3b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0002-Fix-vpnc-install-for-cross-compile.patch
@@ -0,0 +1,49 @@
+From d565b4a5e0045f1e40e0e462920ed5b8faca9eec Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sun, 2 Dec 2012 02:16:54 +0100
+Subject: [PATCH 2/8] Fix vpnc install for cross compile
+
+---
+ Makefile | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 69f5aca..a15782e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -133,21 +133,21 @@ install-common: all
+ 	else \
+ 		install vpnc-script $(DESTDIR)$(ETCDIR); \
+ 	fi
+-	install -m600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
+-	install -m755 vpnc-disconnect $(DESTDIR)$(SBINDIR)
+-	install -m755 pcf2vpnc $(DESTDIR)$(BINDIR)
+-	install -m644 vpnc.8 $(DESTDIR)$(MANDIR)/man8
+-	install -m644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1
+-	install -m644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1
+-	install -m644 COPYING $(DESTDIR)$(DOCDIR)
++	install -m 600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
++	install -m 755 vpnc-disconnect $(DESTDIR)$(SBINDIR)
++	install -m 755 pcf2vpnc $(DESTDIR)$(BINDIR)
++	install -m 644 vpnc.8 $(DESTDIR)$(MANDIR)/man8
++	install -m 644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1
++	install -m 644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1
++	install -m 644 COPYING $(DESTDIR)$(DOCDIR)
+ 
+ install : install-common
+-	install -m755 vpnc $(DESTDIR)$(SBINDIR)
+-	install -m755 cisco-decrypt $(DESTDIR)$(BINDIR)
++	install -m 755 vpnc $(DESTDIR)$(SBINDIR)
++	install -m 755 cisco-decrypt $(DESTDIR)$(BINDIR)
+ 
+ install-strip : install-common
+-	install -s -m755 vpnc $(DESTDIR)$(SBINDIR)
+-	install -s -m755 cisco-decrypt $(DESTDIR)$(BINDIR)
++	install -s -m 755 vpnc $(DESTDIR)$(SBINDIR)
++	install -s -m 755 cisco-decrypt $(DESTDIR)$(BINDIR)
+ 
+ uninstall :
+ 	rm -f $(DESTDIR)$(SBINDIR)/vpnc \
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0003-error.h-is-specific-to-glibc-on-linux.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0003-error.h-is-specific-to-glibc-on-linux.patch
new file mode 100644
index 0000000..bb77306
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0003-error.h-is-specific-to-glibc-on-linux.patch
@@ -0,0 +1,30 @@
+From 6b49020893f999df56392b49b1a289cb96a113a1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 22:08:17 -0700
+Subject: [PATCH 3/8] error.h is specific to glibc on linux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdep.h | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/sysdep.h b/sysdep.h
+index 137bf6d..6a323f0 100644
+--- a/sysdep.h
++++ b/sysdep.h
+@@ -37,9 +37,10 @@ int tun_read(int fd, unsigned char *buf, int len);
+ int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);
+ 
+ /***************************************************************************/
+-#if defined(__linux__) || defined(__GLIBC__)
++#if defined(__linux__)
++#if defined(__GLIBC__)
+ #include <error.h>
+-
++#endif
+ #define HAVE_VASPRINTF 1
+ #define HAVE_ASPRINTF  1
+ #define HAVE_ERROR     1
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0004-Use-pkgconfig-instead-of-libgcrypt-config.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0004-Use-pkgconfig-instead-of-libgcrypt-config.patch
new file mode 100644
index 0000000..f70a138
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0004-Use-pkgconfig-instead-of-libgcrypt-config.patch
@@ -0,0 +1,30 @@
+From 4d1dd61c04f52a7c796debbdea5fc9139ffa271d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 22:45:05 -0700
+Subject: [PATCH 4/8] Use pkgconfig instead of libgcrypt-config
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index a15782e..b537046 100644
+--- a/Makefile
++++ b/Makefile
+@@ -63,10 +63,10 @@ RELEASE_VERSION := $(shell cat VERSION)
+ CC ?= gcc
+ CFLAGS ?= -O3 -g
+ CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
+-CFLAGS +=  $(shell libgcrypt-config --cflags) $(CRYPTO_CFLAGS)
++CFLAGS +=  $(shell pkg-config libgcrypt --cflags) $(CRYPTO_CFLAGS)
+ CPPFLAGS += -DVERSION=\"$(VERSION)\"
+ LDFLAGS ?= -g
+-LIBS += $(shell libgcrypt-config --libs) $(CRYPTO_LDADD)
++LIBS += $(shell pkg-config libgcrypt --libs) $(CRYPTO_LDADD)
+ 
+ ifeq ($(shell uname -s), SunOS)
+ LIBS += -lnsl -lresolv -lsocket
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0005-include-sys-ttydefaults.h-for-CEOT-definition.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0005-include-sys-ttydefaults.h-for-CEOT-definition.patch
new file mode 100644
index 0000000..01783f4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0005-include-sys-ttydefaults.h-for-CEOT-definition.patch
@@ -0,0 +1,30 @@
+From 1947ea776dc38c3377702dd89bd229670f4d948d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 23:06:52 -0700
+Subject: [PATCH 5/8] include sys/ttydefaults.h for CEOT definition
+
+Fixes
+
+config.c:146:25: error: use of undeclared identifier 'CEOT'
+                if (llen == 0 && c == CEOT)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ config.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/config.c b/config.c
+index 804faa7..1883d12 100644
+--- a/config.c
++++ b/config.c
+@@ -31,6 +31,7 @@
+ #include <sys/types.h>
+ #include <sys/utsname.h>
+ #include <sys/wait.h>
++#include <sys/ttydefaults.h>
+ 
+ #include <gcrypt.h>
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0006-sysdep-Add-header-include-sequence-to-adjust-for-mus.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0006-sysdep-Add-header-include-sequence-to-adjust-for-mus.patch
new file mode 100644
index 0000000..fa89df2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0006-sysdep-Add-header-include-sequence-to-adjust-for-mus.patch
@@ -0,0 +1,40 @@
+From 56768fc0c2cbd6abcf28c9805ab516db8a0548d4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 23:09:47 -0700
+Subject: [PATCH 6/8] sysdep: Add header include sequence to adjust for musl
+
+---
+ sysdep.h | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/sysdep.h b/sysdep.h
+index 6a323f0..0122b95 100644
+--- a/sysdep.h
++++ b/sysdep.h
+@@ -17,16 +17,20 @@
+  * __SKYOS__
+  *
+  */
++/* hack to make sure kernel headers understand that libc (musl)
++ * does define IFF_LOWER_UP et al.
++ */
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
+ 
+ #include <sys/types.h>
+ #include <sys/socket.h>
+-#include <netinet/in.h>
+ 
+ #if !defined(__CYGWIN__)
+-#include <net/if.h>
+-#include <net/if_arp.h>
++//#include <linux/if.h>
++//#include <net/if_arp.h>
+ #include <netinet/if_ether.h>
+ #endif
++#include <netinet/in.h>
+ 
+ #include "config.h"
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0007-add-error-API-when-error.h-is-not-on-platform.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0007-add-error-API-when-error.h-is-not-on-platform.patch
new file mode 100644
index 0000000..de67b47
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0007-add-error-API-when-error.h-is-not-on-platform.patch
@@ -0,0 +1,66 @@
+From b6a027fe4da6f66552b533f1314e5005b16c5455 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 23:52:36 -0700
+Subject: [PATCH 7/8] add error() API when error.h is not on platform
+
+sign-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdep.c | 24 ++++++++++++++++++++++++
+ sysdep.h |  2 ++
+ 2 files changed, 26 insertions(+)
+
+diff --git a/sysdep.c b/sysdep.c
+index d8f181d..2518ec1 100644
+--- a/sysdep.c
++++ b/sysdep.c
+@@ -17,6 +17,7 @@
+     GNU General Public License for more details.
+  */
+ 
++#define _GNU_SOURCE
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+@@ -794,3 +795,26 @@ int setenv(const char *name, const char *value, int overwrite)
+ 	return ret;
+ }
+ #endif
++
++#ifndef _ERROR_H_
++#define _ERROR_H_
++#include <stdarg.h>
++#include <stdio.h>
++#include <errno.h>
++
++void error(int status, int errnum, const char* format, ...)
++{
++	va_list ap;
++
++	fflush(stdout);
++	fprintf(stderr, "%s: ", program_invocation_name);
++	va_start(ap, format);
++	vfprintf(stderr, format, ap);
++	va_end(ap);
++	if (errnum)
++		fprintf(stderr, ":%d", errnum);
++	if (status)
++		exit(status);
++}
++#endif  /* _ERROR_H_ */
++
+diff --git a/sysdep.h b/sysdep.h
+index 0122b95..4e60064 100644
+--- a/sysdep.h
++++ b/sysdep.h
+@@ -44,6 +44,8 @@ int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);
+ #if defined(__linux__)
+ #if defined(__GLIBC__)
+ #include <error.h>
++#else
++void error(int status, int errnum, const char* format, ...);
+ #endif
+ #define HAVE_VASPRINTF 1
+ #define HAVE_ASPRINTF  1
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0008-include-sysdep.h-before-net-if_tun.h.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0008-include-sysdep.h-before-net-if_tun.h.patch
new file mode 100644
index 0000000..62ffdb7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0008-include-sysdep.h-before-net-if_tun.h.patch
@@ -0,0 +1,36 @@
+From 7f01847d14a1a3af50f49499743b0551ddef1311 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 23:54:01 -0700
+Subject: [PATCH 8/8] include sysdep.h before net/if_tun.h
+
+Fixes duplicate defines in header errors
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdep.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/sysdep.c b/sysdep.c
+index 2518ec1..5624ef1 100644
+--- a/sysdep.c
++++ b/sysdep.c
+@@ -57,6 +57,8 @@
+ #include <sys/cygwin.h>
+ #endif
+ 
++#include "sysdep.h"
++
+ #if defined(__DragonFly__)
+ #include <net/tun/if_tun.h>
+ #elif defined(__linux__)
+@@ -69,7 +71,6 @@
+ #include <net/if_tun.h>
+ #endif
+ 
+-#include "sysdep.h"
+ 
+ #if !defined(HAVE_VASPRINTF) || !defined(HAVE_ASPRINTF) || !defined(HAVE_ERROR)
+ #include <stdarg.h>
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/makeman.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/makeman.patch
deleted file mode 100644
index f394e6a..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/makeman.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- vpnc-0.5.1/makeman.pl.old	2008-03-16 02:17:59.000000000 -0500
-+++ vpnc-0.5.1/makeman.pl	2008-03-16 02:29:34.000000000 -0500
-@@ -29,7 +29,7 @@ my $vpnc = './vpnc';
- # indenting lists (those originally starting with an asterisk). I hope
- # this pays off when converting the manpage to HTML or such.
- 
--open my $LONGHELP, '-|', "$vpnc --long-help";
-+open my $LONGHELP, '-|', "cat ../long-help";
- my $vpnc_options    = '';
- my $relative_indent = 0;
- my $indent_needed   = 0;
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/vpnc-install.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/vpnc-install.patch
deleted file mode 100644
index 3de65ec..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/vpnc-install.patch
+++ /dev/null
@@ -1,35 +0,0 @@
---- a/Makefile~	2009-01-20 18:44:30.000000000 +0100
-+++ b/Makefile	2009-01-20 18:44:30.000000000 +0100
-@@ -119,21 +119,21 @@
- 	else \
- 		install vpnc-script $(DESTDIR)$(ETCDIR); \
- 	fi
--	install -m600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
--	install -m755 vpnc-disconnect $(DESTDIR)$(SBINDIR)
--	install -m755 pcf2vpnc $(DESTDIR)$(BINDIR)
--	install -m644 vpnc.8 $(DESTDIR)$(MANDIR)/man8
--	install -m644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1
--	install -m644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1
--	install -m644 COPYING $(DESTDIR)$(DOCDIR)
-+	install -m 600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
-+	install -m 755 vpnc-disconnect $(DESTDIR)$(SBINDIR)
-+	install -m 755 pcf2vpnc $(DESTDIR)$(BINDIR)
-+	install -m 644 vpnc.8 $(DESTDIR)$(MANDIR)/man8
-+	install -m 644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1
-+	install -m 644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1
-+	install -m 644 COPYING $(DESTDIR)$(DOCDIR)
- 
- install : install-common
--	install -m755 vpnc $(DESTDIR)$(SBINDIR)
--	install -m755 cisco-decrypt $(DESTDIR)$(BINDIR)
-+	install -m 755 vpnc $(DESTDIR)$(SBINDIR)
-+	install -m 755 cisco-decrypt $(DESTDIR)$(BINDIR)
- 
- install-strip : install-common
--	install -s -m755 vpnc $(DESTDIR)$(SBINDIR)
--	install -s -m755 cisco-decrypt $(DESTDIR)$(BINDIR)
-+	install -s -m 755 vpnc $(DESTDIR)$(SBINDIR)
-+	install -s -m 755 cisco-decrypt $(DESTDIR)$(BINDIR)
- 
- uninstall :
- 	rm -f $(DESTDIR)$(SBINDIR)/vpnc \
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb
index 1aff045..6f92acd 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb
@@ -4,17 +4,39 @@
 SECTION = "net"
 LICENSE = "GPL-2.0+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=173b74cb8ac640a9992c03f3bce22a33"
-DEPENDS = "libgcrypt"
 
-inherit perlnative
+DEPENDS += "libgcrypt"
 
-EXTRA_OEMAKE = "-e MAKEFLAGS="
-CFLAGS_append = ' -DVERSION=\\"${PV}\\"'
-LDFLAGS_append = " -lgcrypt -lgpg-error"
+PV .= "r550-2jnpr1"
+SRCREV = "b1243d29e0c00312ead038b04a2cf5e2fa31d740"
+SRC_URI = "git://github.com/ndpgroup/vpnc \
+           file://long-help \
+           file://default.conf \
+           file://0001-search-for-log-help-in-build-dir.patch \
+           file://0002-Fix-vpnc-install-for-cross-compile.patch \
+           file://0003-error.h-is-specific-to-glibc-on-linux.patch \
+           file://0004-Use-pkgconfig-instead-of-libgcrypt-config.patch \
+           file://0005-include-sys-ttydefaults.h-for-CEOT-definition.patch \
+           file://0006-sysdep-Add-header-include-sequence-to-adjust-for-mus.patch \
+           file://0007-add-error-API-when-error.h-is-not-on-platform.patch \
+           file://0008-include-sysdep.h-before-net-if_tun.h.patch \
+           "
+
+PACKAGECONFIG ?= "gnutls"
+
+PACKAGECONFIG[gnutls] = ",,gnutls"
+PACKAGECONFIG[openssl] = ",,openssl"
+
+S = "${WORKDIR}/git"
+
+inherit perlnative pkgconfig
+
+#EXTRA_OEMAKE = "-e MAKEFLAGS="
 
 do_configure_append () {
     # Make sure we use our nativeperl wrapper
     sed -i "1s:#!.*:#!/usr/bin/env nativeperl:" ${S}/*.pl
+    cp ${WORKDIR}/long-help ${S}
 }
 
 do_install () {
@@ -34,12 +56,3 @@
 CONFFILES_${PN} = "${sysconfdir}/vpnc/default.conf"
 RDEPENDS_${PN} = "perl-module-io-file"
 RRECOMMENDS_${PN} = "kernel-module-tun"
-
-SRC_URI = "http://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-${PV}.tar.gz \
-           file://makeman.patch \
-           file://vpnc-install.patch \
-           file://long-help \
-           file://default.conf"
-
-SRC_URI[md5sum] = "4378f9551d5b077e1770bbe09995afb3"
-SRC_URI[sha256sum] = "46cea3bd02f207c62c7c6f2f22133382602baeda1dc320747809e94881414884"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2016.06.10.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2016.06.10.bb
index a9119ea..64e9401 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2016.06.10.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2016.06.10.bb
@@ -12,7 +12,9 @@
 
 do_install() {
     install -d -m0755 ${D}${libdir}/crda
+    install -d -m0755 ${D}${sysconfdir}/wireless-regdb/pubkeys
     install -m 0644 regulatory.bin ${D}${libdir}/crda/regulatory.bin
+    install -m 0644 sforshee.key.pub.pem ${D}${sysconfdir}/wireless-regdb/pubkeys/sforshee.key.pub.pem
 }
 
 RSUGGESTS_${PN} = "crda"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.9.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.9.0.bb
index 0040f67..afae3c8 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.9.0.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.9.0.bb
@@ -19,5 +19,5 @@
 
 inherit autotools
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch
new file mode 100644
index 0000000..075af57
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch
@@ -0,0 +1,50 @@
+From 933e065cf8aecfa0cce5f8f92abbed5baaaf3f77 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 19:10:57 -0700
+Subject: [PATCH 1/2] Define __SWORD_TYPE and _PATH_NSSWITCH_CONF
+
+if they are not defined as is in musl then define
+them here
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/automount.h | 8 ++++++++
+ include/nsswitch.h  | 3 +++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/include/automount.h b/include/automount.h
+index 219b07d..b12c22a 100644
+--- a/include/automount.h
++++ b/include/automount.h
+@@ -42,6 +42,14 @@
+ 
+ #define ENABLE_CORES	1
+ 
++#ifndef __SWORD_TYPE
++# if __WORDSIZE == 32  /* System word size */
++#  define __SWORD_TYPE int
++# else /* __WORDSIZE == 64 */
++#  define __SWORD_TYPE long int
++# endif
++#endif
++
+ /* We MUST have the paths to mount(8) and umount(8) */
+ #ifndef HAVE_MOUNT
+ #error Failed to locate mount(8)!
+diff --git a/include/nsswitch.h b/include/nsswitch.h
+index 2b445a9..3db77b2 100644
+--- a/include/nsswitch.h
++++ b/include/nsswitch.h
+@@ -24,6 +24,9 @@
+ #include <netdb.h>
+ #include "list.h"
+ 
++#ifndef _PATH_NSSWITCH_CONF
++#define _PATH_NSSWITCH_CONF     "/etc/nsswitch.conf"
++#endif
+ #define NSSWITCH_FILE _PATH_NSSWITCH_CONF
+ 
+ enum nsswitch_status {
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch
deleted file mode 100644
index 742f25d..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 40971911d653bf53de295d7462c643e4073916b9 Mon Sep 17 00:00:00 2001
-From: Joe MacDonald <joe@deserted.net>
-Date: Fri, 1 Nov 2013 12:47:18 -0400
-Subject: [PATCH] systemd: allow --with-systemd to take a path arg
-
-If building for a cross-compile environment with systemd it is convenient
-to be able to specify a systemd path for the target that may not be the
-same as that on the host.
-
-Upstream-status: Submitted [http://www.spinics.net/lists/autofs/msg00740.html]
-
-Signed-off-by: Joe MacDonald <joe@deserted.net>
----
- aclocal.m4 |   10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/aclocal.m4 b/aclocal.m4
-index 3e6f223..105e3e9 100644
---- a/aclocal.m4
-+++ b/aclocal.m4
-@@ -229,8 +229,10 @@ dnl Check the location of the systemd unit files directory
- dnl --------------------------------------------------------------------------
- AC_DEFUN([AF_WITH_SYSTEMD],
- [AC_ARG_WITH(systemd,
--[  --with-systemd         install systemd unit file if systemd unit directory
--			  is found on system],
-+[  --with-systemd@<:@=systemddir@:>@  install systemd unit file.  If 'yes'
-+			  probe the system for unit directory.
-+			  If a path is specified, assume that
-+			  is a valid install path.],
- [if test "$withval" = yes; then
-   if test -z "$systemddir"; then
-     AC_MSG_CHECKING([location of the systemd unit files directory])
-@@ -247,6 +249,10 @@ AC_DEFUN([AF_WITH_SYSTEMD],
-   else
-     AC_MSG_RESULT(not found)
-   fi
-+else
-+ if test "$withval" != no; then
-+  systemddir=$withval
-+ fi
- fi])
- ])
- 
--- 
-1.7.10.4
-
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch
new file mode 100644
index 0000000..6b6ba6d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch
@@ -0,0 +1,51 @@
+From 8fd74ddb3369572c594b22b396346131af00faee Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 19:12:10 -0700
+Subject: [PATCH 2/2] Replace __S_IEXEC with S_IEXEC
+
+S_IEXEC is portable
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ daemon/lookup.c        | 4 ++--
+ modules/lookup_multi.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/daemon/lookup.c b/daemon/lookup.c
+index 62071df..1bec97f 100644
+--- a/daemon/lookup.c
++++ b/daemon/lookup.c
+@@ -400,7 +400,7 @@ static int read_file_source_instance(struct autofs_point *ap, struct map_source
+ 	if (!S_ISREG(st.st_mode))
+ 		return NSS_STATUS_NOTFOUND;
+ 
+-	if (st.st_mode & __S_IEXEC)
++	if (st.st_mode & S_IEXEC)
+ 		type = src_prog;
+ 	else
+ 		type = src_file;
+@@ -890,7 +890,7 @@ static int lookup_name_file_source_instance(struct autofs_point *ap, struct map_
+ 	if (!S_ISREG(st.st_mode))
+ 		return NSS_STATUS_NOTFOUND;
+ 
+-	if (st.st_mode & __S_IEXEC)
++	if (st.st_mode & S_IEXEC)
+ 		type = src_prog;
+ 	else
+ 		type = src_file;
+diff --git a/modules/lookup_multi.c b/modules/lookup_multi.c
+index 6ec8434..88d081f 100644
+--- a/modules/lookup_multi.c
++++ b/modules/lookup_multi.c
+@@ -104,7 +104,7 @@ static struct lookup_mod *nss_open_lookup(const char *format, int argc, const ch
+ 				continue;
+ 			}
+ 
+-			if (st.st_mode & __S_IEXEC)
++			if (st.st_mode & S_IEXEC)
+ 				type = src_prog;
+ 			else
+ 				type = src_file;
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/Makefile.rules-cross.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/Makefile.rules-cross.patch
deleted file mode 100644
index 7dc7096..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/Makefile.rules-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Index: autofs-5.0.7/Makefile.rules
-===================================================================
---- autofs-5.0.7.orig/Makefile.rules	2012-07-24 23:05:26.000000000 -0700
-+++ autofs-5.0.7/Makefile.rules	2012-10-26 09:23:40.270204270 -0700
-@@ -34,14 +34,14 @@
- else
- CFLAGS    ?= -O2 -Wall
- LDFLAGS   = -s
--STRIP     = strip --strip-debug
-+STRIP     = ${TARGET_PREFIX}strip --strip-debug
- endif
- endif
- 
--CC        = gcc
--CXX       = g++
-+CC        ?= ${TARGET_PREFIX}gcc
-+CXX       ?= ${TARGET_PREFIX}g++
- CXXFLAGS  = $(CFLAGS)
--LD        = ld
-+LD        ?= ${TARGET_PREFIX}ld
- SOLDFLAGS = -shared
- 
- CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch
new file mode 100644
index 0000000..cbf2bf8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch
@@ -0,0 +1,30 @@
+Make configure compatible with -Wl,--as-needed following
+https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Failure_in_..2Fconfigure
+
+2016-07-05 Martin von Gagern
+
+Index: autofs-5.1.2/aclocal.m4
+===================================================================
+--- autofs-5.1.2.orig/aclocal.m4
++++ autofs-5.1.2/aclocal.m4
+@@ -415,9 +415,9 @@ AC_DEFUN([AF_CHECK_LIBTIRPC],
+ [
+ # save current flags
+ af_check_libtirpc_save_cflags="$CFLAGS"
+-af_check_libtirpc_save_ldflags="$LDFLAGS"
++af_check_libtirpc_save_libs="$LIBS"
+ CFLAGS="$CFLAGS -I=/usr/include/tirpc"
+-LDFLAGS="$LDFLAGS -ltirpc"
++LIBS="$LIBS -ltirpc"
+ 
+ AC_TRY_LINK(
+     [ #include <rpc/rpc.h> ],
+@@ -440,7 +440,7 @@ AC_CHECK_FUNCS([getrpcbyname getservbyna
+ 
+ # restore flags
+ CFLAGS="$af_check_libtirpc_save_cflags"
+-LDFLAGS="$af_check_libtirpc_save_ldflags"
++LIBS="$af_check_libtirpc_save_libs"
+ ])
+ 
+ AC_DEFUN([AF_WITH_LIBTIRPC],
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-additional-distros.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-additional-distros.patch
deleted file mode 100644
index 6a35843..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-additional-distros.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- autofs-4.1.4/samples/rc.autofs.in~	2005-04-11 06:30:54.000000000 -0500
-+++ autofs-4.1.4/samples/rc.autofs.in	2007-04-07 13:18:44.000000000 -0500
-@@ -43,6 +43,9 @@
- 	system=debian
- elif [ -f /etc/redhat-release ]; then
- 	system=redhat
-+elif [ -f /etc/issue ] && grep -q "^SlugOS\|Yocto" /etc/issue ; then
-+	# SlugOS and Yocto behave like Debian, at least for autofs purposes.
-+	system=debian
- else
- 	echo "$0: Unknown system, please port and contact autofs@linux.kernel.org" 1>&2
- 	exit 1
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch
index 31c8510..94750b2 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch
@@ -15,8 +15,10 @@
  include/lookup_ldap.h |    4 ++++
  1 file changed, 4 insertions(+)
 
---- a/include/lookup_ldap.h
-+++ b/include/lookup_ldap.h
+Index: autofs-5.1.2/include/lookup_ldap.h
+===================================================================
+--- autofs-5.1.2.orig/include/lookup_ldap.h
++++ autofs-5.1.2/include/lookup_ldap.h
 @@ -1,7 +1,9 @@
  #ifndef LOOKUP_LDAP_H
  #define LOOKUP_LDAP_H
@@ -27,14 +29,14 @@
  
  #ifdef WITH_SASL
  #include <openssl/ssl.h>
-@@ -109,10 +111,12 @@
+@@ -117,10 +119,12 @@ struct lookup_context {
  
  #define LDAP_AUTH_USESIMPLE	0x0008
  
 +#ifdef WITH_LDAP
  /* lookup_ldap.c */
  LDAP *init_ldap_connection(unsigned logopt, const char *uri, struct lookup_context *ctxt);
- int unbind_ldap_connection(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt);
+ int unbind_ldap_connection(unsigned logopt, struct ldap_conn *conn, struct lookup_context *ctxt);
  int authtype_requires_creds(const char *authtype);
 +#endif
  
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc-name-clash-backout.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc-name-clash-backout.patch
deleted file mode 100644
index e93021d..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc-name-clash-backout.patch
+++ /dev/null
@@ -1,28 +0,0 @@
----
- lib/rpc_subs.c |   10 ----------
- 1 file changed, 10 deletions(-)
-
-diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
-index 5d6ead0..c7177f2 100644
---- a/lib/rpc_subs.c
-+++ b/lib/rpc_subs.c
-@@ -34,16 +34,6 @@
- #include <poll.h>
- 
- #ifdef WITH_LIBTIRPC
--#undef auth_destroy
--#define auth_destroy(auth)                                              \
--                do {                                                    \
--                        int refs;                                       \
--                        if ((refs = auth_put((auth))) == 0)             \
--                                ((*((auth)->ah_ops->ah_destroy))(auth));\
--                } while (0)
--#endif
--
--#ifdef WITH_LIBTIRPC
- const rpcprog_t rpcb_prog = RPCBPROG;
- const rpcvers_t rpcb_version = RPCBVERS;
- #else
--- 
-1.7.10.4
-
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch
new file mode 100644
index 0000000..bf2c964
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch
@@ -0,0 +1,19 @@
+Use pkg-config first to look for external libnsl which is now
+split out from glibc, if it does not exist then see if its provided
+by glibc itself.
+
+-Khem
+
+Index: autofs-5.1.2/configure.in
+===================================================================
+--- autofs-5.1.2.orig/configure.in
++++ autofs-5.1.2/configure.in
+@@ -186,7 +186,7 @@ fi
+ #
+ # glibc/libc 6 new libraries
+ #
+-AC_CHECK_LIB(nsl, yp_match, LIBNSL="-lnsl")
++PKG_CHECK_MODULES([NSL], [libnsl], [], [AC_CHECK_LIB([nsl],[yp_match],[LIBNSL="-lnsl"],[LIBNSL=""])])
+ AC_SUBST(LIBNSL)
+ 
+ AC_CHECK_LIB(resolv, res_query, LIBRESOLV="-lresolv")
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.1.bb
deleted file mode 100644
index 4a888c8..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.1.bb
+++ /dev/null
@@ -1,72 +0,0 @@
-SUMMARY = "Kernel based automounter for linux"
-SECTION = "utils"
-LICENSE = "GPL-2.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
-
-DEPENDS += "libtirpc flex-native bison-native"
-
-inherit autotools-brokensep systemd
-
-SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \
-           file://autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch \
-           file://no-bash.patch \
-           file://cross.patch \
-           file://libtirpc.patch \
-           file://libtirpc-name-clash-backout.patch \
-           file://autofs-5.0.7-do-not-check-for-modprobe.patch \
-           file://fix_disable_ldap.patch \
-           file://autofs-5.0.7-fix-lib-deps.patch \
-           file://add-the-needed-stdarg.h.patch \
-           file://using-pkg-config-to-detect-libxml-2.0-and-krb5.patch \
-           file://force-STRIP-to-emtpy.patch \
-           file://remove-bashism.patch \
-           file://fix-the-YACC-rule-to-fix-a-building-failure.patch \
-"
-
-SRC_URI[md5sum] = "e143df66b614b8cdb1ff533735f8e12d"
-SRC_URI[sha256sum] = "795419383b120d15699ab3b89ea0f3d029f6fb28405a83982d305c4b7b61130f"
-
-inherit update-rc.d pkgconfig
-
-INITSCRIPT_NAME = "autofs"
-INITSCRIPT_PARAMS = "defaults"
-
-# FIXME: modules/Makefile has crappy rules that don't obey LDFLAGS
-CFLAGS += "${LDFLAGS}"
-
-PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd"
-
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
-
-EXTRA_OEMAKE = "DONTSTRIP=1"
-EXTRA_OECONF += "--disable-mount-locking \
-                --enable-ignore-busy --with-openldap=no \
-                --with-sasl=no --with-libtirpc=yes \
-                --with-path=${STAGING_BINDIR_NATIVE} \
-"
-CACHED_CONFIGUREVARS = "ac_cv_path_RANLIB=${RANLIB} \
-                        ac_cv_path_RPCGEN=rpcgen \
-"
-
-do_configure_prepend () {
-    sed -e "s:filagdir:flagdir:" -i configure.in
-    if [ ! -e acinclude.m4 ]; then
-        cp aclocal.m4 acinclude.m4
-    fi
-}
-
-do_install_append () {
-    if [ -d ${D}/run ]; then
-        rmdir ${D}/run
-    fi
-    if [ -d ${D}${localstatedir}/run ]; then
-        rmdir ${D}${localstatedir}/run
-    fi
-}
-
-INSANE_SKIP_${PN} = "dev-so"
-
-RPROVIDES_${PN} += "${PN}-systemd"
-RREPLACES_${PN} += "${PN}-systemd"
-RCONFLICTS_${PN} += "${PN}-systemd"
-SYSTEMD_SERVICE_${PN} = "autofs.service"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb
new file mode 100644
index 0000000..eea7c4b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Kernel based automounter for linux"
+SECTION = "utils"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+DEPENDS += "libtirpc flex-native bison-native e2fsprogs openssl libxml2 util-linux cyrus-sasl"
+
+CFLAGS += "-I${STAGING_INCDIR}/tirpc"
+
+inherit autotools-brokensep systemd update-rc.d pkgconfig
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \
+           file://autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch \
+           file://no-bash.patch \
+           file://cross.patch \
+           file://libtirpc.patch \
+           file://autofs-5.0.7-do-not-check-for-modprobe.patch \
+           file://fix_disable_ldap.patch \
+           file://autofs-5.0.7-fix-lib-deps.patch \
+           file://add-the-needed-stdarg.h.patch \
+           file://using-pkg-config-to-detect-libxml-2.0-and-krb5.patch \
+           file://force-STRIP-to-emtpy.patch \
+           file://remove-bashism.patch \
+           file://fix-the-YACC-rule-to-fix-a-building-failure.patch \
+           file://0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch \
+           file://0002-Replace-__S_IEXEC-with-S_IEXEC.patch \
+           file://autofs-5.1.2-libtirpc-as-need.patch \
+           file://pkgconfig-libnsl.patch \
+           "
+SRC_URI[md5sum] = "28cf88f99eff553a8500659ba5d45a76"
+SRC_URI[sha256sum] = "0d57e4138c2ec8058ca92164d035546f68ce4af93acb893369993d67c7056a10"
+
+INITSCRIPT_NAME = "autofs"
+INITSCRIPT_PARAMS = "defaults"
+
+# FIXME: modules/Makefile has crappy rules that don't obey LDFLAGS
+#CFLAGS += "${LDFLAGS}"
+
+PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+
+EXTRA_OEMAKE = "DONTSTRIP=1"
+EXTRA_OECONF += "--disable-mount-locking \
+                --enable-ignore-busy --with-openldap=no \
+                --with-sasl=no --with-libtirpc \
+                --with-path=${STAGING_BINDIR_NATIVE} \
+"
+CACHED_CONFIGUREVARS = "ac_cv_path_RANLIB=${RANLIB} \
+                        ac_cv_path_RPCGEN=rpcgen \
+"
+
+do_configure_prepend () {
+    sed -e "s:filagdir:flagdir:" -i ${S}/configure.in
+    if [ ! -e ${S}/acinclude.m4 ]; then
+        cp ${S}/aclocal.m4 ${S}/acinclude.m4
+    fi
+}
+
+do_install_append () {
+    if [ -d ${D}/run ]; then
+        rmdir ${D}/run
+    fi
+    if [ -d ${D}${localstatedir}/run ]; then
+        rmdir ${D}${localstatedir}/run
+    fi
+}
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
+
+INSANE_SKIP_${PN} = "dev-so"
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "autofs.service"
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb
index 69df274..61b7ad4 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb
@@ -24,10 +24,8 @@
                  andrew_cv_runpath_switch=none"
 
 PACKAGECONFIG ??= "ntlm \
-        ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \
-        ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
-        ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-        "
+    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 ldap pam', d)} \
+"
 PACKAGECONFIG[gssapi] = "--enable-gssapi=yes,--enable-gssapi=no,krb5,"
 PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
 PACKAGECONFIG[opie] = "--with-opie,--without-opie,opie,"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd_2.20.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd_2.20.3.bb
index b5851a9..2da29d9 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd_2.20.3.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd_2.20.3.bb
@@ -16,13 +16,13 @@
 SRC_URI[md5sum] = "41c9b070aae8ed403fc8c2aac7ab157c"
 SRC_URI[sha256sum] = "aa46e7f8736b88c1d752cf606b3990041221ce91d014e955c6b02eb2167db015"
 
-PNBLACKLIST[dnrd] ?= "BROKEN: dnrd-2.20.3-r0 do_package: QA Issue: dnrd: Files/directories were installed but not shipped in any package:"
+PNBLACKLIST[dnrd] ?= "BROKEN: dnrd-2.20.3-r0 do_package: QA Issue: dnrd: Files/directories were installed but not shipped in any package: - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SYSTEMD_SERVICE_${PN} = "dnrd.service"
 SYSTEMD_AUTO_ENABLE = "disable"
 
 inherit autotools
-inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
+inherit ${@bb.utils.filter('VIRTUAL-RUNTIME_init_manager', 'systemd', d)}
 
 do_install() {
     oe_runmake install DESTDIR=${D} INSTALL="install -p"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb
new file mode 100644
index 0000000..c3d2f1a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb
@@ -0,0 +1,13 @@
+SUMMARY = "simple dynamic multicast routing daemon that only uses IGMP signalling"
+HOMEPAGE = "http://sourceforge.net/projects/igmpproxy/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1e995e2799bb0d27d63069b97f805420"
+
+SRC_URI = "http://sourceforge.net/projects/igmpproxy/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+    "
+
+SRC_URI[md5sum] = "c56f41ec195bc1fe016369bf74efc5a1"
+SRC_URI[sha256sum] = "ee18ff3d8c3ae3a29dccb7e5eedf332337330020168bd95a11cece8d7d7ee6ae"
+
+inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-Do-not-clean-kernel-source.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-Do-not-clean-kernel-source.patch
new file mode 100644
index 0000000..2c46611
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-Do-not-clean-kernel-source.patch
@@ -0,0 +1,44 @@
+From 4ebab8add4a549c16ab8b124137546c0a7b46a9b Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Tue, 15 Nov 2016 11:11:30 -0500
+Subject: [PATCH] Do not clean kernel source
+
+The default behaviour should not be to attempt to clean the kernel source
+tree when building userspace.  When not cross-compiling, however, this action is
+harmless, but when attempting to build within the sysroot and since this package
+is purely userspace, the clean step will fail.
+
+Removing the clean step eliminates an unnecessary dependency on the kernel build
+infrastructure.
+
+Upstream-status: Inappropriate (embedded specific)
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ Makefile | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index c8cd00e..9576bba 100644
+--- a/Makefile
++++ b/Makefile
+@@ -37,7 +37,7 @@ endif
+ 
+ all: user
+ 
+-user: iscsiuio/Makefile
++user:
+ 	$(MAKE) -C utils/sysdeps
+ 	$(MAKE) -C utils/fwparam_ibft
+ 	$(MAKE) -C usr
+@@ -75,7 +75,6 @@ clean:
+ 	$(MAKE) -C utils/fwparam_ibft clean
+ 	$(MAKE) -C utils clean
+ 	$(MAKE) -C usr clean
+-	$(MAKE) -C kernel clean
+ 	[ ! -f iscsiuio/Makefile ] || $(MAKE) -C iscsiuio clean
+ 	[ ! -f iscsiuio/Makefile ] || $(MAKE) -C iscsiuio distclean
+ 
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-dont-use-static.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-dont-use-static.patch
deleted file mode 100644
index ce48e2b..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-dont-use-static.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-iscsi-initiator-utils not to use static
-
-Upstream-status: Backport
-This patch is from fedora17.
-
-Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
-Signed-off-by: Vu Tran <vu.tran@windriver.com>
-
-diff --git a/usr/Makefile b/usr/Makefile
-index 673b7f1..fd14a10 100644
---- a/usr/Makefile
-+++ b/usr/Makefile
-@@ -61,7 +61,7 @@ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
- 
- iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
- 		iscsistart.o statics.o
--	$(CC) $(CFLAGS) -static $^ -o $@
-+	$(CC) $(CFLAGS) $^ -o $@
- clean:
- 	rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
- 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-fw_context-add-include-for-NI_MAXHOST-definiton.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-fw_context-add-include-for-NI_MAXHOST-definiton.patch
new file mode 100644
index 0000000..37d695f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-fw_context-add-include-for-NI_MAXHOST-definiton.patch
@@ -0,0 +1,35 @@
+From 79bea58a554205dd185509fbc4e76b5fc40f9038 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Tue, 15 Nov 2016 12:36:45 -0500
+Subject: [PATCH] fw_context: add include for NI_MAXHOST definiton
+
+This appears to build successfully with gcc 4.x but fails on gcc 5+, though it's
+not immediately clear why NI_MAXHOST isn't being defined from the include
+chain.  Currently engaging with the upstream devs to determine the best course
+of action, but this is an adequate workaround.
+
+Upstream-status: Pending
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ include/fw_context.h | 4 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/fw_context.h b/include/fw_context.h
+index 44053d8..0b05cea 100644
+--- a/include/fw_context.h
++++ b/include/fw_context.h
+@@ -21,6 +21,10 @@
+ #ifndef FWPARAM_CONTEXT_H_
+ #define FWPARAM_CONTEXT_H_
+ 
++#include <sys/socket.h>
++#ifndef NI_MAXHOST
++#define NI_MAXHOST 1025
++#endif
+ #include <netdb.h>
+ #include <net/if.h>
+ 
+-- 
+2.1.4
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-use-var-for-config.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-use-var-for-config.patch
deleted file mode 100644
index 50227a7..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-use-var-for-config.patch
+++ /dev/null
@@ -1,240 +0,0 @@
-iscsi-initiator-utils to use var for config
-
-Upstream-status: Backport
-This patch is from fedora.
-
-Use /var/lib/iscsi/ instead of /etc/iscsi/ for holding
-state files.
-
-Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
-Signed-off-by: Vu Tran <vu.tran@windriver.com>
-
-diff --git a/README b/README
-index 7364b2d..5e8bff8 100644
---- a/README
-+++ b/README
-@@ -164,10 +164,10 @@ available on all Linux installations.
- 
- The database contains two tables:
- 
--- Discovery table (/etc/iscsi/send_targets);
--- Node table (/etc/iscsi/nodes).
-+- Discovery table (/var/lib/iscsi/send_targets);
-+- Node table (/var/lib/iscsi/nodes).
- 
--The regular place for iSCSI database files: /etc/iscsi/nodes
-+The regular place for iSCSI database files: /var/lib/iscsi/nodes
- 
- The iscsiadm utility is a command-line tool to manage (update, delete,
- insert, query) the persistent database.
-@@ -444,7 +444,7 @@ a scsi_host per HBA port).
- To manage both types of initiator stacks, iscsiadm uses the interface (iface)
- structure. For each HBA port or for software iscsi for each network
- device (ethX) or NIC, that you wish to bind sessions to you must create
--a iface config /etc/iscsi/ifaces.
-+a iface config /var/lib/iscsi/ifaces.
- 
- Prep:
- 
-@@ -478,29 +478,29 @@ Running:
- iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax
- iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax
- 
--Will report iface configurations that are setup in /etc/iscsi/ifaces.
-+Will report iface configurations that are setup in /var/lib/iscsi/ifaces.
- The format is:
- 
- iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
- 
- For software iscsi, you can create the iface configs by hand, but it is
- reccomended that you use iscsiadm's iface mode. There is a iface.example in
--/etc/iscsi/ifaces which can be used as a template for the daring.
-+/var/lib/iscsi/ifaces which can be used as a template for the daring.
- 
- For each network object you wish to bind a session to you must create
--a seperate iface config in /etc/iscsi/ifaces and each iface config file
-+a seperate iface config in /var/lib/iscsi/ifaces and each iface config file
- must have a unique name which is less than or equal to 64 characters.
- 
- Example:
- 
- If you have NIC1 with MAC address 00:0F:1F:92:6B:BF and NIC2 with
- MAC address 00:C0:DD:08:63:E7 and you wanted to do software iscsi over
--TCP/IP. Then in /etc/iscsi/ifaces/iface0 you would enter:
-+TCP/IP. Then in /var/lib/iscsi/ifaces/iface0 you would enter:
- 
- iface.transport_name = tcp
- iface.hwaddress = 00:0F:1F:92:6B:BF
- 
--and in /etc/iscsi/ifaces/iface1 you would enter:
-+and in /var/lib/iscsi/ifaces/iface1 you would enter:
- 
- iface.transport_name = tcp
- iface.hwaddress = 00:C0:DD:08:63:E7
-@@ -550,7 +550,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
- qla4xxx.00:0e:1e:04:8b:2e qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<empty>
- 
- 
--Will report iface configurations that are setup in /etc/iscsi/ifaces.
-+Will report iface configurations that are setup in /var/lib/iscsi/ifaces.
- The format is:
- 
- iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
-@@ -636,7 +636,7 @@ need a seperate network connection to the target for discovery purposes.
- *This will be fixed in the next version of open-iscsi*
- 
- For compatibility reasons, when you run iscsiadm to do discovery, it
--will check for interfaces in /etc/iscsi/iscsi/ifaces that are using
-+will check for interfaces in /var/lib/iscsi/iscsi/ifaces that are using
- tcp for the iface.transport and it will bind the portals that are discovered
- so that they will be logged in through those ifaces. This behavior can also
- be overriden by passing in the interfaces you want to use. For the case
-@@ -654,7 +654,7 @@ we do not bind a session to a iface, then you can use the special iface
- 
- iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1
- 
--And if you did not define any interfaces in /etc/iscsi/ifaces and do
-+And if you did not define any interfaces in /var/lib/iscsi/ifaces and do
- not pass anything into iscsiadm, running iscsiadm will do the default
- behavior, where we allow the network subsystem to decide which
- device to use.
-@@ -696,7 +696,7 @@ To now log into targets it is the same as with sofware iscsi. See section
- 
- 	    ./iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover
- 
--	This will search /etc/iscsi/send_targets for a record with the
-+	This will search /var/lib/iscsi/send_targets for a record with the
- 	ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it
- 	will perform discovery using the settings stored in the record.
- 	If a record does not exist, it will be created using the iscsid.conf
-@@ -705,7 +705,7 @@ To now log into targets it is the same as with sofware iscsi. See section
- 	The argument to -p may also be a hostname instead of an address.
- 	    ./iscsiadm -m discoverydb -t st -p smoehost --discover
- 
--	For the ifaces, iscsiadm will first search /etc/iscsi/ifaces for
-+	For the ifaces, iscsiadm will first search /var/lib/iscsi/ifaces for
- 	interfaces using software iscsi. If any are found then nodes found
- 	during discovery will be setup so that they can logged in through
- 	those interfaces. To specify a specific iface, pass the
-@@ -761,7 +761,7 @@ To now log into targets it is the same as with sofware iscsi. See section
- 	This command will perform discovery, but not manipulate the node DB.
- 
-   - SendTargets iSCSI Discovery with a specific interface. If you
--	wish to only use a subset of the interfaces in /etc/iscsi/ifaces
-+	wish to only use a subset of the interfaces in /var/lib/iscsi/ifaces
- 	then you can pass them in during discovery:
- 
- 	     ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
-@@ -1072,8 +1072,8 @@ where targetname is the name of the target and ip_address:port is the address
- and port of the portal. tpgt, is the portal group tag of
- the portal, and is not used in iscsiadm commands except for static
- record creation. And iface name is the name of the iscsi interface
--defined in /etc/iscsi/ifaces. If no interface was defined in
--/etc/iscsi/ifaces or passed in, the default behavior is used.
-+defined in /var/lib/iscsi/ifaces. If no interface was defined in
-+/var/lib/iscsi/ifaces or passed in, the default behavior is used.
- Default here is iscsi_tcp/tcp to be used over which ever NIC the
- network layer decides is best.
- 
-@@ -1188,7 +1188,7 @@ If set, iscsid will perform discovery to the address every
- discovery.isns.discoveryd_poll_inval or
- discovery.sendtargets.discoveryd_poll_inval seconds,
- and it will log into any portals found from the discovery source using
--the ifaces in /etc/iscsi/ifaces.
-+the ifaces in /var/lib/iscsi/ifaces.
- 
- Note that for iSNS the poll_interval does not have to be set. If not set,
- iscsid will only perform rediscovery when it gets a SCN from the server.
-diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
-index 7c209f6..e94cca0 100644
---- a/doc/iscsiadm.8
-+++ b/doc/iscsiadm.8
-@@ -89,7 +89,7 @@ This option is only valid for ping submode.
- .TP
- \fB\-I\fR, \fB\-\-interface=\fI[iface]\fR
- The interface argument specifies the iSCSI interface to use for the operation.
--iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware
-+iSCSI interfaces (iface) are defined in /var/lib/iscsi/ifaces. For hardware
- iSCSI (qla4xxx) the iface config must have the hardware address
- (iface.hwaddress = port's MAC address)
- and the driver/transport_name (iface.transport_name). The iface's name is
-@@ -166,7 +166,7 @@ If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all
- of their respective records are displayed; for \fIsession\fR, all active
- sessions and connections are displayed; for \fIfw\fR, all boot firmware
- values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and
--for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed.
-+for \fIiface\fR, all ifaces setup in /var/lib/iscsi/ifaces are displayed.
- 
- .TP
- \fB\-n\fR, \fB\-\-name=\fIname\fR
-@@ -535,10 +535,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
- The file containing the iSCSI InitiatorName and InitiatorAlias read by
- \fBiscsid\fR and \fBiscsiadm\fR on startup.
- .TP
--/etc/iscsi/nodes/
-+/var/lib/iscsi/nodes/
- This directory contains the nodes with their targets.
- .TP
--/etc/iscsi/send_targets
-+/var/lib/iscsi/send_targets
- This directory contains the portals.
- 
- .SH "SEE ALSO"
-diff --git a/usr/idbm.c b/usr/idbm.c
-index 4d30aa9..316e54f 100644
---- a/usr/idbm.c
-+++ b/usr/idbm.c
-@@ -2468,9 +2468,9 @@ free_info:
- int idbm_init(idbm_get_config_file_fn *fn)
- {
- 	/* make sure root db dir is there */
--	if (access(ISCSI_CONFIG_ROOT, F_OK) != 0) {
--		if (mkdir(ISCSI_CONFIG_ROOT, 0660) != 0) {
--			log_error("Could not make %s %d\n", ISCSI_CONFIG_ROOT,
-+	if (access(ISCSIVAR, F_OK) != 0) {
-+		if (mkdir(ISCSIVAR, 0660) != 0) {
-+			log_error("Could not make %s %d\n", ISCSIVAR,
- 				   errno);
- 			return errno;
- 		}
-diff --git a/usr/idbm.h b/usr/idbm.h
-index 245f046..f45e86e 100644
---- a/usr/idbm.h
-+++ b/usr/idbm.h
-@@ -28,12 +28,16 @@
- #include "config.h"
- #include "list.h"
- 
--#define NODE_CONFIG_DIR		ISCSI_CONFIG_ROOT"nodes"
--#define SLP_CONFIG_DIR		ISCSI_CONFIG_ROOT"slp"
--#define ISNS_CONFIG_DIR		ISCSI_CONFIG_ROOT"isns"
--#define STATIC_CONFIG_DIR	ISCSI_CONFIG_ROOT"static"
--#define FW_CONFIG_DIR		ISCSI_CONFIG_ROOT"fw"
--#define ST_CONFIG_DIR		ISCSI_CONFIG_ROOT"send_targets"
-+#define ISCSIVAR			"/var/lib/iscsi/"
-+
-+#define NODE_CONFIG_DIR    ISCSIVAR"nodes"
-+#define SLP_CONFIG_DIR     ISCSIVAR"slp"
-+#define ISNS_CONFIG_DIR    ISCSIVAR"isns"
-+#define STATIC_CONFIG_DIR  ISCSIVAR"static"
-+#define FW_CONFIG_DIR      ISCSIVAR"fw"
-+#define ST_CONFIG_DIR      ISCSIVAR"send_targets"
-+
-+
- #define ST_CONFIG_NAME		"st_config"
- #define ISNS_CONFIG_NAME	"isns_config"
- 
-diff --git a/usr/iface.h b/usr/iface.h
-index 01f7074..2c6ef72 100644
---- a/usr/iface.h
-+++ b/usr/iface.h
-@@ -20,7 +20,8 @@
- #ifndef ISCSI_IFACE_H
- #define ISCSI_IFACE_H
- 
--#define IFACE_CONFIG_DIR	ISCSI_CONFIG_ROOT"ifaces"
-+#include "idbm.h"
-+#define IFACE_CONFIG_DIR	ISCSIVAR"ifaces"
- 
- struct iface_rec;
- struct list_head;
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0-873.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0-873.bb
deleted file mode 100644
index 4b13155..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0-873.bb
+++ /dev/null
@@ -1,108 +0,0 @@
-SUMMARY = "iSCSI daemon and utility programs"
-DESCRIPTION = "Open-iSCSI project is a high performance, transport \
-independent, multi-platform implementation of RFC3720. The iscsi package \
-provides the server daemon for the iSCSI protocol, as well as the utility \
-programs used to manage it. iSCSI is a protocol for distributed \
-disk access using SCSI commands sent over Internet Protocol networks."
-HOMEPAGE = "http://www.open-iscsi.org/"
-LICENSE = "GPLv2 & LGPLv2.1"
-SECTION = "net"
-DEPENDS = "openssl flex-native bison-native"
-
-LIC_FILES_CHKSUM = \
-        "file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
-         file://utils/open-isns/COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
-
-SRC_URI = "http://www.open-iscsi.org/bits/open-iscsi-${PV}.tar.gz \
-           file://iscsi-initiator-utils-use-var-for-config.patch \
-           file://iscsi-initiator-utils-dont-use-static.patch \
-           file://initd.debian \
-           file://99_iscsi-initiator-utils \
-           file://iscsi-initiator \
-           file://iscsi-initiator.service \
-           file://iscsi-initiator-targets.service \
-           file://set_initiatorname \
-"
-SRC_URI[md5sum] = "8b8316d7c9469149a6cc6234478347f7"
-SRC_URI[sha256sum] = "7dd9f2f97da417560349a8da44ea4fcfe98bfd5ef284240a2cc4ff8e88ac7cd9"
-
-S = "${WORKDIR}/open-iscsi-${PV}"
-
-inherit update-rc.d systemd
-
-TARGET_CC_ARCH += "${LDFLAGS}"
-do_configure () {
-    #need to support cross-compiling in open-isns only
-    (cd utils/open-isns; gnu-configize; \
-     ./configure --host=${TARGET_SYS} --build=${BUILD_SYS} --with-security=no )
-}
-
-do_compile () {
-    #make iscsistart one of PROGRAMS if install_user in do_install
-    #sed -i -e '/^PROGRAMS = /s;$; usr/iscsistart;' Makefile
-
-    #fix the ar used in open-isns
-    sed -i -e 's:ar cr :$(AR) cr :' ${S}/utils/open-isns/Makefile
-    oe_runmake user
-}
-
-do_install () {
-    #completely override the install_user as bugs in Makefile
-    #oe_runmake DESTDIR="${D}" install_user
-
-    #install necessary directories
-    install -d ${D}${sbindir} \
-        ${D}${sysconfdir}/init.d \
-        ${D}${sysconfdir}/iscsi \
-        ${D}${localstatedir}/lib/iscsi/nodes \
-        ${D}${localstatedir}/lib/iscsi/send_targets \
-        ${D}${localstatedir}/lib/iscsi/static \
-        ${D}${localstatedir}/lib/iscsi/isns \
-        ${D}${localstatedir}/lib/iscsi/slp \
-        ${D}${localstatedir}/lib/iscsi/ifaces \
-        ${D}/${mandir}/man8
-
-    install -p -m 755 ${S}/usr/iscsid ${S}/usr/iscsiadm \
-        ${S}/utils/iscsi-iname \
-        ${S}/usr/iscsistart ${D}/${sbindir}
-
-    install -p -m 644 ${S}/doc/iscsiadm.8 ${S}/doc/iscsid.8 ${D}/${mandir}/man8
-    install -p -m 644 ${S}/etc/iscsid.conf ${D}${sysconfdir}/iscsi
-    install -p -m 755 ${WORKDIR}/initd.debian ${D}${sysconfdir}/init.d/iscsid
-
-    sed -i -e "s:= /sbin/iscsid:= ${sbindir}/iscsid:" ${D}${sysconfdir}/iscsi/iscsid.conf
-
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/tmpfiles.d
-        echo "d /run/${BPN}/lock - - - -" \
-                     > ${D}${sysconfdir}/tmpfiles.d/iscsi.conf
-        install -d ${D}/etc/default/
-        install -p -m 755 ${WORKDIR}/iscsi-initiator ${D}${sysconfdir}/default/
-
-        install -d ${D}${systemd_unitdir}/system/
-        install -m 0644 ${WORKDIR}/iscsi-initiator.service \
-                        ${WORKDIR}/iscsi-initiator-targets.service \
-                        ${D}${systemd_unitdir}/system/
-	install -d ${D}${nonarch_libdir}/iscsi
-	install -m 0755 ${WORKDIR}/set_initiatorname ${D}${nonarch_libdir}/iscsi
-    else
-        install -d ${D}/etc/default/volatiles
-        install -m 0644 ${WORKDIR}/99_iscsi-initiator-utils ${D}/etc/default/volatiles
-    fi
-}
-
-pkg_postinst_${PN}() {
-    if [ "x$D" = "x" ]; then
-	if [ -e /etc/init.d/populate-volatile.sh ]; then
-            /etc/init.d/populate-volatile.sh update
-	elif command -v systemd-tmpfiles >/dev/null; then
-            systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/iscsi.conf
-	fi
-    fi
-}
-
-SYSTEMD_SERVICE = " iscsi-initiator.service iscsi-initiator-targets.service "
-INITSCRIPT_NAME = "iscsid"
-INITSCRIPT_PARAMS = "start 30 1 2 3 4 5 . stop 70 0 1 2 3 4 5 6 ."
-
-FILES_${PN} += "${nonarch_libdir}/iscsi"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.874.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.874.bb
new file mode 100644
index 0000000..16ac199
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.874.bb
@@ -0,0 +1,122 @@
+SUMMARY = "iSCSI daemon and utility programs"
+DESCRIPTION = "Open-iSCSI project is a high performance, transport \
+independent, multi-platform implementation of RFC3720. The iscsi package \
+provides the server daemon for the iSCSI protocol, as well as the utility \
+programs used to manage it. iSCSI is a protocol for distributed \
+disk access using SCSI commands sent over Internet Protocol networks."
+HOMEPAGE = "http://www.open-iscsi.com/"
+LICENSE = "GPLv2 & LGPLv2.1"
+SECTION = "net"
+DEPENDS = "openssl flex-native bison-native open-isns util-linux"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+SRCREV ?= "8db9717e73d32d2c5131da4f9ad86dfd9065f74b"
+
+SRC_URI = "git://github.com/open-iscsi/open-iscsi \
+    file://iscsi-initiator-utils-Do-not-clean-kernel-source.patch \
+    file://iscsi-initiator-utils-fw_context-add-include-for-NI_MAXHOST-definiton.patch \
+    file://initd.debian \
+    file://99_iscsi-initiator-utils \
+    file://iscsi-initiator \
+    file://iscsi-initiator.service \
+    file://iscsi-initiator-targets.service \
+    file://set_initiatorname \
+"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
+
+inherit update-rc.d systemd autotools distro_features_check
+# open-isns depends on systemd
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+EXTRA_OECONF = " \
+    --target=${TARGET_SYS} \
+    --host=${BUILD_SYS} \
+    --prefix=${prefix} \
+    --libdir=${libdir} \
+"
+
+EXTRA_OEMAKE = ' \
+    CC="${CC}" \
+    AR="${AR}" \
+    RANLIB="${RANLIB}" \
+    CFLAGS="${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE -I. -I../include -I../../include -I../usr -I../../usr" \
+    LDFLAGS="${LDFLAGS}" \
+    LD="${LD}" \
+    OS="${TARGET_SYS}" \
+    TARGET="${TARGET_OS}" \
+    BASE="${prefix}" \
+    MANDIR="${mandir}" \
+'
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_configure () {
+    cd ${S}/iscsiuio ; autoreconf --install; ./configure ${EXTRA_OECONF}
+}
+
+do_compile () {
+    # Make sure we DO NOT regenerate prom_lex.c.
+    mv ${S}/utils/fwparam_ibft/prom_lex.l ${S}/utils/fwparam_ibft/prom_lex.l.unused
+    oe_runmake -C ${S} ${EXTRA_OEMAKE} user
+}
+
+do_install () {
+    #install necessary directories
+    install -d ${D}${sbindir} \
+        ${D}${sysconfdir}/init.d \
+        ${D}${sysconfdir}/iscsi \
+        ${D}${localstatedir}/lib/iscsi/nodes \
+        ${D}${localstatedir}/lib/iscsi/send_targets \
+        ${D}${localstatedir}/lib/iscsi/static \
+        ${D}${localstatedir}/lib/iscsi/isns \
+        ${D}${localstatedir}/lib/iscsi/slp \
+        ${D}${localstatedir}/lib/iscsi/ifaces \
+        ${D}/${mandir}/man8
+
+    install -p -m 755 ${S}/usr/iscsid ${S}/usr/iscsiadm \
+        ${S}/utils/iscsi-iname \
+        ${S}/usr/iscsistart ${D}/${sbindir}
+
+    install -p -m 644 ${S}/doc/iscsiadm.8 ${S}/doc/iscsid.8 ${D}/${mandir}/man8
+    install -p -m 644 ${S}/etc/iscsid.conf ${D}${sysconfdir}/iscsi
+    install -p -m 755 ${WORKDIR}/initd.debian ${D}${sysconfdir}/init.d/iscsid
+
+    sed -i -e "s:= /sbin/iscsid:= ${sbindir}/iscsid:" ${D}${sysconfdir}/iscsi/iscsid.conf
+
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -d ${D}${sysconfdir}/tmpfiles.d
+        echo "d /run/${BPN}/lock - - - -" \
+                     > ${D}${sysconfdir}/tmpfiles.d/iscsi.conf
+        install -d ${D}/etc/default/
+        install -p -m 755 ${WORKDIR}/iscsi-initiator ${D}${sysconfdir}/default/
+
+        install -d ${D}${systemd_unitdir}/system/
+        install -m 0644 ${WORKDIR}/iscsi-initiator.service \
+                        ${WORKDIR}/iscsi-initiator-targets.service \
+                        ${D}${systemd_unitdir}/system/
+        install -d ${D}${nonarch_libdir}/iscsi
+        install -m 0755 ${WORKDIR}/set_initiatorname ${D}${nonarch_libdir}/iscsi
+    else
+        install -d ${D}/etc/default/volatiles
+        install -m 0644 ${WORKDIR}/99_iscsi-initiator-utils ${D}/etc/default/volatiles
+    fi
+}
+
+pkg_postinst_${PN}() {
+    if [ "x$D" = "x" ]; then
+        if [ -e /etc/init.d/populate-volatile.sh ]; then
+            /etc/init.d/populate-volatile.sh update
+        elif command -v systemd-tmpfiles >/dev/null; then
+            systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/iscsi.conf
+        fi
+    fi
+}
+
+SYSTEMD_SERVICE = " iscsi-initiator.service iscsi-initiator-targets.service "
+INITSCRIPT_NAME = "iscsid"
+INITSCRIPT_PARAMS = "start 30 1 2 3 4 5 . stop 70 0 1 2 3 4 5 6 ."
+
+FILES_${PN} += "${nonarch_libdir}/iscsi"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.2.bb
deleted file mode 100644
index 77ed09f..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.2.bb
+++ /dev/null
@@ -1,65 +0,0 @@
-SUMMARY = "A 802.1ab implementation (LLDP) to help you locate neighbors of all your equipments"
-SECTION = "net/misc"
-LICENSE = "ISC"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"
-
-DEPENDS = "libbsd libevent"
-
-SRC_URI = "\
-    http://media.luffy.cx/files/${BPN}/${BPN}-${PV}.tar.gz \
-    file://lldpd.init.d \
-    file://lldpd.default \
-    "
-
-SRC_URI[md5sum] = "b809887bc927fb558fd5dd64b6c0a494"
-SRC_URI[sha256sum] = "6054f29d41faf32186a22331853a299c87f4419b4332df4a564f76a139305a32"
-
-inherit autotools update-rc.d useradd systemd pkgconfig bash-completion
-
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "--system -g lldpd --shell /bin/false lldpd"
-GROUPADD_PARAM_${PN} = "--system lldpd"
-
-EXTRA_OECONF += "--without-embedded-libevent \
-                 --disable-oldies \
-                 --with-privsep-user=lldpd \
-                 --with-privsep-group=lldpd \
-                 --with-systemdsystemunitdir=${systemd_system_unitdir} \
-                 --without-sysusersdir \
-"
-
-PACKAGECONFIG ??= "cdp fdp edp sonmp lldpmed dot1 dot3"
-PACKAGECONFIG[json] = "--with-json,--without-json,jansson"
-PACKAGECONFIG[xml] = "--with-xml,--without-xml,libxm2"
-PACKAGECONFIG[snmp] = "--with-snmp,--without-snmp,net-snmp"
-PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
-PACKAGECONFIG[seccomp] = "--with-seccomp,--without-seccomp,libseccomp"
-PACKAGECONFIG[cdp] = "--enable-cdp,--disable-cdp"
-PACKAGECONFIG[fdp] = "--enable-fdp,--disable-fdp"
-PACKAGECONFIG[edp] = "--enable-edp,--disable-edp"
-PACKAGECONFIG[sonmp] = "--enable-sonmp,--disable-sonmp"
-PACKAGECONFIG[lldpmed] = "--enable-lldpmed,--disable-lldpmed"
-PACKAGECONFIG[dot1] = "--enable-dot1,--disable-dot1"
-PACKAGECONFIG[dot3] = "--enable-dot3,--disable-dot3"
-PACKAGECONFIG[custom] = "--enable-custom,--disable-custom"
-
-INITSCRIPT_NAME = "lldpd"
-INITSCRIPT_PARAMS = "defaults"
-
-SYSTEMD_SERVICE_${PN} = "lldpd.service"
-
-do_install_append() {
-    install -Dm 0755 ${WORKDIR}/lldpd.init.d ${D}${sysconfdir}/init.d/lldpd
-    install -Dm 0644 ${WORKDIR}/lldpd.default ${D}${sysconfdir}/default/lldpd
-    # Make an empty configuration file
-    touch ${D}${sysconfdir}/lldpd.conf
-}
-
-PACKAGES =+ "${PN}-zsh-completion"
-
-FILES_${PN} += "${libdir}/sysusers.d"
-RDEPENDS_${PN} += "os-release"
-
-FILES_${PN}-zsh-completion += "${datadir}/zsh/"
-# FIXME: zsh is broken in meta-oe so this cannot be enabled for now
-#RDEPENDS_${PN}-zsh-completion += "zsh"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.6.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.6.bb
new file mode 100644
index 0000000..0cd0637
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.6.bb
@@ -0,0 +1,65 @@
+SUMMARY = "A 802.1ab implementation (LLDP) to help you locate neighbors of all your equipments"
+SECTION = "net/misc"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"
+
+DEPENDS = "libbsd libevent"
+
+SRC_URI = "\
+    http://media.luffy.cx/files/${BPN}/${BPN}-${PV}.tar.gz \
+    file://lldpd.init.d \
+    file://lldpd.default \
+    "
+
+SRC_URI[md5sum] = "0dcdee7c1b3c62362d73f6508c11edae"
+SRC_URI[sha256sum] = "e74e2dd7e2a233ca1ff385c925ddae2a916d302819d1433741407d2f8fb0ddd8"
+
+inherit autotools update-rc.d useradd systemd pkgconfig bash-completion
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system -g lldpd --shell /bin/false lldpd"
+GROUPADD_PARAM_${PN} = "--system lldpd"
+
+EXTRA_OECONF += "--without-embedded-libevent \
+                 --disable-oldies \
+                 --with-privsep-user=lldpd \
+                 --with-privsep-group=lldpd \
+                 --with-systemdsystemunitdir=${systemd_system_unitdir} \
+                 --without-sysusersdir \
+"
+
+PACKAGECONFIG ??= "cdp fdp edp sonmp lldpmed dot1 dot3"
+PACKAGECONFIG[json] = "--with-json,--without-json,jansson"
+PACKAGECONFIG[xml] = "--with-xml,--without-xml,libxm2"
+PACKAGECONFIG[snmp] = "--with-snmp,--without-snmp,net-snmp"
+PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
+PACKAGECONFIG[seccomp] = "--with-seccomp,--without-seccomp,libseccomp"
+PACKAGECONFIG[cdp] = "--enable-cdp,--disable-cdp"
+PACKAGECONFIG[fdp] = "--enable-fdp,--disable-fdp"
+PACKAGECONFIG[edp] = "--enable-edp,--disable-edp"
+PACKAGECONFIG[sonmp] = "--enable-sonmp,--disable-sonmp"
+PACKAGECONFIG[lldpmed] = "--enable-lldpmed,--disable-lldpmed"
+PACKAGECONFIG[dot1] = "--enable-dot1,--disable-dot1"
+PACKAGECONFIG[dot3] = "--enable-dot3,--disable-dot3"
+PACKAGECONFIG[custom] = "--enable-custom,--disable-custom"
+
+INITSCRIPT_NAME = "lldpd"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "lldpd.service"
+
+do_install_append() {
+    install -Dm 0755 ${WORKDIR}/lldpd.init.d ${D}${sysconfdir}/init.d/lldpd
+    install -Dm 0644 ${WORKDIR}/lldpd.default ${D}${sysconfdir}/default/lldpd
+    # Make an empty configuration file
+    touch ${D}${sysconfdir}/lldpd.conf
+}
+
+PACKAGES =+ "${PN}-zsh-completion"
+
+FILES_${PN} += "${libdir}/sysusers.d"
+RDEPENDS_${PN} += "os-release"
+
+FILES_${PN}-zsh-completion += "${datadir}/zsh/"
+# FIXME: zsh is broken in meta-oe so this cannot be enabled for now
+#RDEPENDS_${PN}-zsh-completion += "zsh"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch
new file mode 100644
index 0000000..4644910
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch
@@ -0,0 +1,25 @@
+[PATCH] add libnetsnmp when link
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ plugins/snmp_bc/t/Makefile.am |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/snmp_bc/t/Makefile.am b/plugins/snmp_bc/t/Makefile.am
+index 57e77ac..9894620 100644
+--- a/plugins/snmp_bc/t/Makefile.am
++++ b/plugins/snmp_bc/t/Makefile.am
+@@ -74,7 +74,7 @@ nodist_libsnmp_bc_la_SOURCES = $(GENERATED_EVENT_CODE) $(REMOTE_SIM_SOURCES)
+ # libopenhpi_la_LIBADD    = $(top_builddir)/utils/libopenhpiutils.la
+ # libopenhpi_la_LDFLAGS   = -L$(top_builddir)/utils -version-info @HPI_LIB_VERSION@ -export-symbols $(top_srcdir)/src/hpi.sym
+ 
+-libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la
++libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la -lnetsnmp
+ libsnmp_bc_la_LDFLAGS = -L$(top_builddir)/utils -module -version-info @HPI_LIB_VERSION@
+ # libsnmp_bc_la_LDFLAGS = -version 0:0:0
+ 
+-- 
+1.7.10.4
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch
new file mode 100644
index 0000000..077e26c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch
@@ -0,0 +1,23 @@
+Fix alignment issue in ipmi_inventory.c
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/plugins/ipmi/ipmi_inventory.c b/plugins/ipmi/ipmi_inventory.c
+index 5382186..01655c6 100644
+--- a/plugins/ipmi/ipmi_inventory.c
++++ b/plugins/ipmi/ipmi_inventory.c
+@@ -2546,8 +2546,11 @@ static SaErrorT modify_inventory(SaHpiIdrFieldT *field,
+ 			if (tb->DataLength == 0) {
+ 				rv = ipmi_fru_set_board_info_mfg_time(fru, 0);
+ 			} else {
++                time_t the_time;
++                /* tb->Data is not aligned -- copy to temp */
++                memcpy(&the_time, tb->Data, sizeof(the_time));
+ 				rv = ipmi_fru_set_board_info_mfg_time(fru,
+-					*(time_t *)tb->Data);
++					the_time);
+ 			}
+ 			break;
+ 		case SAHPI_IDR_FIELDTYPE_MANUFACTURER:
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch
new file mode 100644
index 0000000..029b857
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch
@@ -0,0 +1,24 @@
+fix host gcc warnings
+
+Remove gcc warnings when gcc is v3.2
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index f5a5b74..4a20154 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -605,11 +605,6 @@ AC_ARG_ENABLE([werror],
+     fi],
+     [])
+ 
+-if test -n "`gcc --version | grep ' 3.2'`" ; then
+-        CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'`
+-        CXX_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'`
+-fi
+-
+ case $host_os in
+     solaris*)
+         CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wcast-qual//g'`
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch
new file mode 100644
index 0000000..205696e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch
@@ -0,0 +1,31 @@
+Fix for saftest failures.
+
+Upstream-Status: Pending
+
+Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
+
+diff -urpN a/openhpid/safhpi.c b/openhpid/safhpi.c
+--- a/openhpid/safhpi.c
++++ b/openhpid/safhpi.c
+@@ -1976,7 +1976,7 @@ SaErrorT SAHPI_API saHpiSensorThresholds
+         oh_release_domain(d); /* Unlock domain */
+ 
+         OH_CALL_ABI(h, set_sensor_thresholds, SA_ERR_HPI_INVALID_CMD, rv,
+-                    ResourceId, SensorNum, SensorThresholds);
++                    ResourceId, SensorNum, &tmp);
+         oh_release_handler(h);
+ 
+         return rv;
+diff -urpN a/utils/sahpi_struct_utils.c b/utils/sahpi_struct_utils.c
+--- a/utils/sahpi_struct_utils.c
++++ b/utils/sahpi_struct_utils.c
+@@ -3855,6 +3855,9 @@ SaHpiBoolT oh_valid_textbuffer(SaHpiText
+                                         /* found a unpaired surrogate */
+                                         return SAHPI_FALSE;
+                                 }
++                        } else {
++                            /*the first 2 bytes wrong*/
++                            return SAHPI_FALSE;
+                         }
+                 }
+                 break;
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch
new file mode 100644
index 0000000..1627c97
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch
@@ -0,0 +1,33 @@
+Fix glib cross compile
+
+Uses proper PKG_CONFIG_PATH when cross-compiling
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index b5f5aad..f5a5b74 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -110,13 +110,13 @@ else
+ *** GLIB is always available from ftp://ftp.gtk.org/.])
+ fi
+ 
+-exact_version=`pkg-config --modversion $GLIB`;
+-GLIB_CFLAGS=`pkg-config --cflags $GLIB $GTHREAD`
+-GLIB_LIBS=`pkg-config --libs $GLIB $GTHREAD`
+-GLIB_ONLY_CFLAGS=`pkg-config --cflags $GLIB`
+-GLIB_ONLY_LIBS=`pkg-config --libs $GLIB`
+-GMODULE_ONLY_CFLAGS=`pkg-config --cflags $GMODULE`
+-GMODULE_ONLY_LIBS=`pkg-config --libs $GMODULE`
++exact_version=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --modversion $GLIB`;
++GLIB_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GLIB $GTHREAD`
++GLIB_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GLIB $GTHREAD`
++GLIB_ONLY_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GLIB`
++GLIB_ONLY_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GLIB`
++GMODULE_ONLY_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GMODULE`
++GMODULE_ONLY_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GMODULE`
+ 
+ # On some versions of Solaris the pkg-config file for gthread-2.0 contains a
+ # compiler option, '-mt', that is incompatible with gcc
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch
new file mode 100644
index 0000000..7dac453
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch
@@ -0,0 +1,29 @@
+commit e9f9a73c9dba8dd59f3d6c3acd9988ec8361d55a
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date:   Mon Dec 17 16:23:45 2012 -0500
+
+    Correct dangling g_thread_exit in session.c
+    
+    hpi_shell's session.c has its progress_bar
+    thread created using pthread_create but
+    exited using g_thread_exit. Use pthread_exit
+    instead to avoid unpredictable GLIB thread
+    errors.
+    
+    Upstream-Status: Pending
+    
+    Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/hpi_shell/session.c b/hpi_shell/session.c
+index 85c31bf..187da4c 100644
+--- a/hpi_shell/session.c
++++ b/hpi_shell/session.c
+@@ -66,7 +66,7 @@ static void* progress_bar(void *unused)
+ 		if (i < (PROGRESS_BUF_SIZE - mes_len - 1)) i++;
+ 		t++;
+ 	};
+-        g_thread_exit(0);
++        pthread_exit(0);
+ 	return (void *)1;
+ }
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch
new file mode 100644
index 0000000..d03c97e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Submitted
+
+Package saftest run a test case to pass invalid session id to function
+saHpiResourceIdGet that expect return SA_ERR_HPI_INVALID_SESSION. But the check
+for SA_ERR_HPI_INVALID_SESSION is missed somehow in function saHpiResourceIdGet.
+
+Add check for SA_ERR_HPI_INVALID_SESSION.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+-----
+--- openhpi-3.4.0/baselib/safhpi.cpp.orig	2014-02-25 10:45:20.911734868 +0800
++++ openhpi-3.4.0/baselib/safhpi.cpp	2014-02-25 10:46:05.366925389 +0800
+@@ -477,6 +477,8 @@
+                                  &rpt_update_count );
+     if ( rv == SA_ERR_HPI_NOT_PRESENT ) {
+         return SA_ERR_HPI_NOT_PRESENT;
++    } else if ( rv == SA_ERR_HPI_INVALID_SESSION) {
++        return SA_ERR_HPI_INVALID_SESSION;
+     } else if ( rv != SA_OK ) {
+         return SA_ERR_HPI_UNKNOWN;
+     }
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch
new file mode 100644
index 0000000..6d3b664
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch
@@ -0,0 +1,21 @@
+Fix libxml2 for cross-compiling
+
+Use proper XML2_INCLUDE path when cross-compiling
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index 30a792c..b5f5aad 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -175,7 +175,7 @@ AC_CHECK_HEADERS([openssl/md2.h openssl/md5.h openssl/bio.h openssl/ssl.h openss
+ 
+ dnl xml is used for XML-based communication in ilo2_ribcl and oa_soap
+ AC_CHECK_LIB([xml2],[xmlParseMemory],[XML2_LIB=-lxml2],[XML2_LIB=])
+-AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="-I/usr/include/libxml2"],[XML2_INCLUDE])
++AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="$XML2_INCLUDE"],[XML2_INCLUDE])
+ AC_SUBST(XML2_LIB)
+ AC_SUBST(XML2_INCLUDE)
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch
new file mode 100644
index 0000000..3222f5d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch
@@ -0,0 +1,33 @@
+Fix ipmi plugin's test dir compilation
+
+The ipmi plugin's test dir is not included
+in compilation since it does not compile
+properly with SSL
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ plugins/ipmi/Makefile.in | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/plugins/ipmi/Makefile.in b/plugins/ipmi/Makefile.in
+index 7c6b0a4..6204dbe 100644
+--- a/plugins/ipmi/Makefile.in
++++ b/plugins/ipmi/Makefile.in
+@@ -448,7 +448,9 @@ top_srcdir = @top_srcdir@
+ MAINTAINERCLEANFILES = Makefile.in
+ AM_CPPFLAGS = -DG_LOG_DOMAIN=\"ipmi\" @OPENHPI_INCLUDES@
+ EXTRA_DIST = ipmi.sym ekeyfru.h
+-SUBDIRS = t
++#SUBDIRS = t
++#Tests don't compile wih SSL properly so comment them out
++SUBDIRS =
+ AM_CFLAGS = @OPENIPMI_CFLAGS@
+ pkglib_LTLIBRARIES = libipmi.la
+ libipmi_la_SOURCES = ipmi.c 		\
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch
new file mode 100644
index 0000000..95b0abc
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch
@@ -0,0 +1,48 @@
+Fix net-snmp when cross-compiling
+
+Remove irrelevant references to net-snmp libs and flags
+when cross-compiling net-snmp
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ acinclude.m4 | 4 ++--
+ configure    | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 82c33f6..727e461 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -160,8 +160,8 @@ AC_DEFUN([OH_CHECK_NETSNMP],
+     ],
+     [
+         have_netsnmp=yes
+-        SNMPFLAGS=`${net_snmp_config:-net-snmp-config} --cflags | perl -p -e 's/-O\S*//g'`
+-        SNMPLIBS=`${net_snmp_config:-net-snmp-config} --libs`
++        SNMPFLAGS=""
++        SNMPLIBS=""
+         AC_MSG_RESULT(yes)
+     ],
+     [AC_MSG_RESULT(no.  No SNMP based plugins can be built!)])
+diff --git a/configure b/configure
+index 00067bc..36b913c 100755
+--- a/configure
++++ b/configure
+@@ -15949,8 +15949,8 @@ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+         have_netsnmp=yes
+-        SNMPFLAGS=`${net_snmp_config:-net-snmp-config} --cflags | perl -p -e 's/-O\S*//g'`
+-        SNMPLIBS=`${net_snmp_config:-net-snmp-config} --libs`
++        SNMPFLAGS=""
++        SNMPLIBS=""
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+ 
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch
new file mode 100644
index 0000000..38d9a67
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch
@@ -0,0 +1,23 @@
+Fix sysfs when cross-compiling
+
+Use proper paths for sysfs plugins when cross-compiling
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+diff --git a/plugins/sysfs/sysfs2hpi.c b/plugins/sysfs/sysfs2hpi.c
+index a745214..3685598 100644
+--- a/plugins/sysfs/sysfs2hpi.c
++++ b/plugins/sysfs/sysfs2hpi.c
+@@ -18,7 +18,7 @@
+ 
+ #include <stdlib.h>
+ #include <string.h>
+-#include <libsysfs.h>
++#include <sysfs/libsysfs.h>
+ 
+ #include <SaHpi.h>
+ #include <oh_utils.h>
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch
new file mode 100644
index 0000000..51537ef
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch
@@ -0,0 +1,31 @@
+From 36fbaa27e7299f63c1324b0ad22b970e9365d6a7 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 24 Dec 2014 10:54:59 +0800
+Subject: [PATCH] openhpi: use serial-tests config needed by ptest
+
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+Upstream-Status: Inappropriate [default automake behavior incompatible with ptest]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4b51971..16136b3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -7,7 +7,7 @@ dnl   various hacks by Sean Dague <http://dague.net/sean> 4/23/03
+ AC_PREREQ(2.57)
+ AC_INIT(openhpi, 3.5.0)
+ AC_CONFIG_SRCDIR(openhpi.spec.in)
+-AM_INIT_AUTOMAKE([1.8])
++AM_INIT_AUTOMAKE([1.8 serial-tests])
+ 
+ AM_CONFIG_HEADER(config.h)
+ AH_TOP([#ifndef __OPENHPI_CONFIG_H
+-- 
+1.7.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init
new file mode 100755
index 0000000..3a5f4a0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init
@@ -0,0 +1,230 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          openhpid
+# Required-Start:    $network $remote_fs $syslog
+# Required-Stop:     $network $remote_fs $syslog
+# Should-Start:      $named
+# Should-Stop:       $named
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start OpenHPI daemon at boot time
+# Description:       Enable OpenHPI service which is provided by openhpid.
+### END INIT INFO
+#
+# openhpid.sh    Start/Stop the openhpi daemon.
+#
+# description: openhpid is standard UNIX program which uses the OpenHPI \
+#              APIs and provides a standard internet server to access those \
+#              APIs for client programs.
+# processname: openhpid
+# config: the standard openhpi conf file specified on the command line or the env.
+# pidfile: /var/run/openhpid.pid
+#
+# Author(s):
+#	W. David Ashley <dashley@us.ibm.com>
+#	Daniel de Araujo <ddearauj@us.ibm.com>
+
+# Source function library.
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+prog="OpenHPI"
+
+# If the openhpid executable is not available, we can't do any of this
+test -f /usr/sbin/openhpid || exit 0
+
+# Determine whether the lsb package is installed
+# If it is, determine which lsb is installed:
+# redhat, suse, or standard lsb
+
+if test -f /etc/init.d/functions
+then
+   lsbtype="rh"
+   . /etc/init.d/functions
+elif test -f /etc/rc.status
+then
+   lsbtype="suse"
+   . /etc/rc.status
+elif test -f /lib/lsb/init-functions
+then
+   lsbtype="lsb"
+   . /lib/lsb/init-functions
+elif test -f /etc/gentoo-release
+then
+   lsbtype="gentoo"
+   . /sbin/functions.sh
+else
+   lsbtype="nolsb"
+fi
+
+print_outcome()
+{
+
+	case "${lsbtype}" in
+
+		suse)
+ 			rc_status -v
+			;;
+
+		lsb)
+			if test "$?" -eq 0
+   			then
+      			log_success_msg "success"
+   			else
+				log_failure_msg "failed"
+   			fi
+  			;;
+  
+  		gentoo)
+  			eend $?
+  			;;
+
+		nolsb | rh)
+			if test "$?" -eq 0
+			then
+				echo " ... success"
+			fi
+			if test "$?" -ne 0
+			then
+				echo " ... failed"
+			fi
+			;;
+   	esac
+}
+
+start() {
+	case "${lsbtype}" in
+
+		suse)
+			echo -n "Starting $prog: "
+			startproc /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
+			RETVAL=$?
+			;;
+		lsb)
+			echo -n "Starting $prog: "
+			start_daemon /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
+			RETVAL=$?
+			;;
+		gentoo | rh)
+			echo "Starting $prog: "
+			start-stop-daemon --start --quiet --exec /usr/sbin/openhpid -- -c /etc/openhpi/openhpi.conf
+			RETVAL=$?
+			;;
+		nolsb)
+			echo -n "Starting $prog: "
+			/usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
+			RETVAL=$?
+			;;
+
+	esac
+
+	print_outcome
+
+}
+
+stop() {
+	case "${lsbtype}" in
+
+		lsb | suse)
+			echo -n "Stopping $prog: "
+			killproc /usr/sbin/openhpid
+			RETVAL=$?
+			;;
+
+		gentoo)
+			echo "Stopping $prog: "
+			start-stop-daemon --stop --quiet --exec /usr/sbin/openhpid
+			RETVAL=$?
+			;;
+
+		nolsb | rh)
+			echo -n "Stopping $prog: "
+			if test -f /var/run/openhpid.pid && test "`cat /var/run/openhpid.pid`" != ""
+         		then
+            			kill "`cat /var/run/openhpid.pid`"
+				RETVAL=$?
+			else
+				RETVAL=0
+			fi
+			;;
+
+	esac
+
+	print_outcome
+
+	if test "$RETVAL" -eq 0 && test -f /var/run/openhpid.pid
+	then
+		rm -f /var/lock/openhpid
+		rm -f /var/run/openhpid.pid
+	fi
+
+}
+
+dstatus() {
+	echo "Checking for $prog daemon: "
+
+	case "${lsbtype}" in
+
+		suse)
+			checkproc /usr/sbin/openhpid
+			rc_status -v
+			;;
+		lsb)
+			pid="`pidofproc /usr/sbin/openhpid`"
+         		if test "${pid}" != ""
+			then
+				log_success_msg "$prog is running"
+			else
+				log_success_msg "$prog is not running"
+			fi
+			;;
+		gentoo | nolsb | rh)
+			if test -f /var/run/openhpid.pid &&
+				test "`cat /var/run/openhpid.pid`" != "" &&
+				kill -s 0 "`cat /var/run/openhpid.pid`"
+			then
+				echo "$prog is running"
+			else
+				echo "$prog is not running"
+			fi
+
+			;;
+
+	esac
+
+
+
+}
+
+restart() {
+  	stop
+	start
+}
+
+force_reload() {
+	# We don't currently support a reload, but can do a restart
+	stop
+	start
+}
+
+# See how we were called.
+
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+  	restart
+	;;
+  status)
+  	dstatus
+	;;
+  force-reload)
+  	force_reload
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart|status|force-reload}"
+	exit 1
+esac
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service
new file mode 100644
index 0000000..cd4168f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Daemon providing access to the SAF Hardware Platform Interface
+After=syslog.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/openhpid.pid
+ExecStart=@SBINDIR@/openhpid -c @SYSCONFDIR@/openhpi/openhpi.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest
new file mode 100755
index 0000000..5b187d9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+for x in `find ./ -name Makefile`;
+do
+	make -C `dirname ${x}` -k runtest-TESTS
+done
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb
new file mode 100644
index 0000000..b9b0437
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb
@@ -0,0 +1,109 @@
+SUMMARY = "Hardware Platform Interface Library and Tools"
+
+DESCRIPTION = "\
+OpenHPI is an open source project created with the intent of providing an \
+implementation of the SA Forum's Hardware Platform Interface (HPI). HPI \
+provides an abstracted interface to managing computer hardware, typically for \
+chassis and rack based servers. HPI includes resource modeling; access to and \
+control over sensor, control, watchdog, and inventory data associated with \
+resources; abstracted System Event Log interfaces; hardware events and alerts; \
+and a managed hotswap interface. \
+\
+OpenHPI provides a modular mechanism for adding new hardware and device support \
+easily. Many plugins exist in the OpenHPI source tree to provide access to \
+various types of hardware. This includes, but is not limited to, IPMI based \
+servers, Blade Center, and machines which export data via sysfs. \
+"
+
+HOMEPAGE = "http://openhpi.sourceforge.net/Home"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e3c772a32386888ccb5ae1c0ba95f1a4"
+
+DEPENDS = "net-snmp libxml2 ncurses openssl glib-2.0 popt e2fsprogs"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
+           file://openhpi-netsnmp-cross-compile.patch \
+           file://openhpi-sysfs-cross-compile.patch \
+           file://openhpi-libxml2-cross-compile.patch \
+           file://openhpi-glib-cross-compile.patch \
+           file://openhpi-linkfix.patch \
+           file://openhpi-fix-host-gcc.patch \
+           file://openhpi-hpi-shell-thread-fix.patch \
+           file://openhpi-fix-testfail-errors.patch \
+           file://openhpi-add-libnetsnmp-when-link.patch \
+           file://openhpi-invalide-session.patch \
+           file://openhpi-use-serial-tests-config-needed-by-ptest.patch \
+           file://openhpi-fix-alignment-issue.patch \
+           \
+           file://openhpi.init \
+           file://openhpid.service \
+           file://run-ptest \
+"
+
+SRC_URI[md5sum] = "4718b16e0f749b5ad214a9b04f45dd23"
+SRC_URI[sha256sum] = "e0a810cb401c4bdcfc9551f2e6afd5a8ca4b411f5ee3bc60c19f82fd6e84a3dc"
+
+inherit autotools pkgconfig ptest update-rc.d systemd
+
+PACKAGES =+ "${PN}-libs"
+
+FILES_${PN}-libs = "${libdir}/${BPN}/*.so /usr/lib/${BPN}/*.so"
+
+INSANE_SKIP_${PN}-libs = "dev-so"
+RDEPENDS_${PN} += "${PN}-libs"
+
+PACKAGECONFIG ??= "libgcrypt"
+PACKAGECONFIG[sysfs] = "--enable-sysfs,--disable-sysfs,sysfsutils,"
+PACKAGECONFIG[libgcrypt] = "--enable-encryption,--disable-encryption,libgcrypt,"
+
+do_install_append () {
+    install -m 0755 -d ${D}${sysconfdir}/${BPN}
+    install -m 0755 ${S}/openhpiclient.conf.example ${D}${sysconfdir}/${BPN}/openhpiclient.conf
+    install -m 0700 ${S}/openhpi.conf.example ${D}${sysconfdir}/${BPN}/openhpi.conf
+    install -m 0755 ${S}/simulation.data.example ${D}${sysconfdir}/${BPN}/simulation.data
+    install -m 0755 ${S}/test_agent.data.example ${D}${sysconfdir}/${BPN}/test_agent.data
+    install -m 0755 ${WORKDIR}/openhpi.init ${D}${sysconfdir}/init.d/openhpid
+
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/openhpid.service ${D}${systemd_unitdir}/system
+    sed -i -e "s,@SBINDIR@,${sbindir},g" -e "s,@SYSCONFDIR@,${sysconfdir},g" \
+        ${D}${systemd_unitdir}/system/openhpid.service
+}
+
+do_compile_ptest () {
+    for x in `find ${B} -name Makefile -exec grep -l buildtest-TESTS {} \;`; do
+        dir=`dirname ${x}`
+        upper=`dirname ${dir}`
+        if [ `basename ${upper}` != "cpp" ]; then
+            oe_runmake -C ${dir} buildtest-TESTS
+        fi
+    done
+}
+
+do_install_ptest () {
+    cp -rf ${B}/openhpid/t/ohpi/.libs/* ${B}/openhpid/t/ohpi/
+    TESTS="utils marshal openhpid"
+    for subtest in ${TESTS}; do
+        mkdir -p ${D}${PTEST_PATH}/${subtest}/t
+        cp -rf ${B}/${subtest}/t/* ${D}${PTEST_PATH}/${subtest}/t
+    done
+
+    for x in `find ${D}${PTEST_PATH} -name Makefile`; do
+        sed -i "s:${S}:${PTEST_PATH}/:g" ${x};
+        sed -i "s/^Makefile:/MM:/g" ${x};
+    done;
+
+    mkdir -p ${D}${PTEST_PATH}/plugins/watchdog/
+    cp -L ${D}/${libdir}/${BPN}/libwatchdog.so ${D}${PTEST_PATH}/plugins/watchdog/
+    cp -L ${D}/${libdir}/${BPN}/libsimulator.so ${D}${PTEST_PATH}/plugins/watchdog/
+    find ${D}${PTEST_PATH}/ -name "*.c" -exec rm {} \;
+    find ${D}${PTEST_PATH}/ -name "*.o" -exec rm {} \;
+    find ${D}${PTEST_PATH}/ -name "*.h" -exec rm {} \;
+}
+
+INITSCRIPT_NAME = "openhpid"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "openhpid.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Remove-unused-variables.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Remove-unused-variables.patch
new file mode 100644
index 0000000..1c88b81
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-Remove-unused-variables.patch
@@ -0,0 +1,43 @@
+From a441a75fbb8451268a8a57616c7158cddc1823aa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 12:40:19 -0700
+Subject: [PATCH] Remove unused variables
+
+Fixes build errors with gcc7 e.g.
+
+../opensaf-5.2.0/src/amf/amfd/imm.cc: In member function 'bool ImmObjCreate::immobj_update_required()':
+../opensaf-5.2.0/src/amf/amfd/imm.cc:2174:28: error: unused variable 'pos' [-Werror=unused-variable]
+     std::string::size_type pos;
+                            ^~~
+../opensaf-5.2.0/src/amf/amfd/imm.cc:2215:28: error: unused variable 'pos' [-Werror=unused-variable]
+     std::string::size_type pos;
+                            ^~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/amf/amfd/imm.cc | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/amf/amfd/imm.cc b/src/amf/amfd/imm.cc
+index 7932364..4f47b65 100644
+--- a/src/amf/amfd/imm.cc
++++ b/src/amf/amfd/imm.cc
+@@ -2171,7 +2171,6 @@ bool ImmObjCreate::immobj_update_required() {
+   if (class_type == AVSV_SA_AMF_SI_ASSIGNMENT) {
+     std::string su_name;
+     std::string sisu_name;
+-    std::string::size_type pos;
+     while ((attribute = attrValues_[i++]) != nullptr) {
+       if (!strcmp(attribute->attrName, "safSISU")) {
+         sisu_name = Amf::to_string(
+@@ -2212,7 +2211,6 @@ bool ImmObjCreate::immobj_update_required() {
+   } else if (class_type == AVSV_SA_AMF_CSI_ASSIGNMENT) {
+     std::string comp_name;
+     std::string csicomp_name;
+-    std::string::size_type pos;
+     AVD_CSI *csi = nullptr;
+     AVD_COMP *comp = nullptr;
+     AVD_COMP_CSI_REL *compcsi = nullptr;
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch
new file mode 100644
index 0000000..512e246
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch
@@ -0,0 +1,127 @@
+From ab00d6f5793b2d850f975bcb6d5d0aa6d7a9eaa4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 12:34:37 -0700
+Subject: [PATCH] configure: Disable format-overflow if supported by gcc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.am                 |  6 ++--
+ configure.ac                |  2 ++
+ m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 79 insertions(+), 3 deletions(-)
+ create mode 100644 m4/ax_check_compile_flag.m4
+
+diff --git a/Makefile.am b/Makefile.am
+index d63fbbb..1012a2c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -52,10 +52,10 @@ AM_CPPFLAGS = \
+ 	-pthread \
+ 	-D_GNU_SOURCE -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"' \
+ 	$(CORE_INCLUDES) \
+-	$(all_includes)
++	$(all_includes) @NOWARNINGS@
+ 
+-AM_CFLAGS = -pipe -std=gnu11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror
+-AM_CXXFLAGS = -pipe -std=gnu++11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror
++AM_CFLAGS = -pipe -std=gnu11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror @NOWARNINGS@
++AM_CXXFLAGS = -pipe -std=gnu++11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror @NOWARNINGS@
+ AM_LDFLAGS = @OSAF_HARDEN_FLAGS@ -Wl,--as-needed -ldl -lrt -pthread -rdynamic
+ ACLOCAL_AMFLAGS = -I m4
+ OSAF_LIB_FLAGS =
+diff --git a/configure.ac b/configure.ac
+index 02771c6..b76b0fe 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -557,6 +557,8 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
+ fi
+ AC_SUBST(OSAF_HARDEN_FLAGS)
+ 
++AX_CHECK_COMPILE_FLAG([-Werror=format-overflow],[NOWARNINGS=-Wno-error=format-overflow])
++AC_SUBST(NOWARNINGS)
+ #############################################
+ # List the output Makefiles
+ #############################################
+diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
+new file mode 100644
+index 0000000..dcabb92
+--- /dev/null
++++ b/m4/ax_check_compile_flag.m4
+@@ -0,0 +1,74 @@
++# ===========================================================================
++#  https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
++#
++# DESCRIPTION
++#
++#   Check whether the given FLAG works with the current language's compiler
++#   or gives an error.  (Warnings, however, are ignored)
++#
++#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
++#   success/failure.
++#
++#   If EXTRA-FLAGS is defined, it is added to the current language's default
++#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
++#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
++#   force the compiler to issue an error when a bad flag is given.
++#
++#   INPUT gives an alternative input source to AC_COMPILE_IFELSE.
++#
++#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
++#   macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
++#
++# LICENSE
++#
++#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
++#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
++#
++#   This program is free software: you can redistribute it and/or modify it
++#   under the terms of the GNU General Public License as published by the
++#   Free Software Foundation, either version 3 of the License, or (at your
++#   option) any later version.
++#
++#   This program is distributed in the hope that it will be useful, but
++#   WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++#   Public License for more details.
++#
++#   You should have received a copy of the GNU General Public License along
++#   with this program. If not, see <https://www.gnu.org/licenses/>.
++#
++#   As a special exception, the respective Autoconf Macro's copyright owner
++#   gives unlimited permission to copy, distribute and modify the configure
++#   scripts that are the output of Autoconf when processing the Macro. You
++#   need not follow the terms of the GNU General Public License when using
++#   or distributing such scripts, even though portions of the text of the
++#   Macro appear in them. The GNU General Public License (GPL) does govern
++#   all other use of the material that constitutes the Autoconf Macro.
++#
++#   This special exception to the GPL applies to versions of the Autoconf
++#   Macro released by the Autoconf Archive. When you make and distribute a
++#   modified version of the Autoconf Macro, you may extend this special
++#   exception to the GPL to apply to your modified version as well.
++
++#serial 5
++
++AC_DEFUN([AX_CHECK_COMPILE_FLAG],
++[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
++AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
++  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
++  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
++  AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
++    [AS_VAR_SET(CACHEVAR,[yes])],
++    [AS_VAR_SET(CACHEVAR,[no])])
++  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
++AS_VAR_IF(CACHEVAR,yes,
++  [m4_default([$2], :)],
++  [m4_default([$3], :)])
++AS_VAR_POPDEF([CACHEVAR])dnl
++])dnl AX_CHECK_COMPILE_FLAGS
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch
new file mode 100644
index 0000000..5756a02
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch
@@ -0,0 +1,29 @@
+From 6248b717b4861d16b80235fd8e57d64e4f636428 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Apr 2017 17:39:07 -0700
+Subject: [PATCH] configure: Pass linker specific options with -Wl
+
+This helps make it pass the options to linker correctly
+and we can use non-gcc compilers
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index df4fc58..02771c6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -553,7 +553,7 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
+ 	if echo "${CFLAGS} ${CXXFLAGS}" | grep -q -- -O0; then
+ 		OSAF_HARDEN_FLAGS=""
+ 	fi
+-	OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -zrelro -znow"
++	OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -Wl,-z,relro,-z,now"
+ fi
+ AC_SUBST(OSAF_HARDEN_FLAGS)
+ 
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-plmcd-error-fix.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-plmcd-error-fix.patch
deleted file mode 100644
index 624cd2d..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-plmcd-error-fix.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From f1813af4c154fb1d3950abbdf678c3a5a67222fc Mon Sep 17 00:00:00 2001
-From: Li xin <lixin.fnst@cn.fujitsu.com>
-Date: Thu, 25 Jun 2015 11:44:27 +0900
-Subject: [PATCH] plmcd: error fix
-
-ld: cannot find -lsystemd-daemon
-collect2: error: ld returned 1 exit status
-
-Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
----
- contrib/plmc/plmcd/Makefile.am | 2 +-
- contrib/plmc/plmcd/Makefile.in | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/contrib/plmc/plmcd/Makefile.am b/contrib/plmc/plmcd/Makefile.am
-index 8d847f2..dd7913a 100644
---- a/contrib/plmc/plmcd/Makefile.am
-+++ b/contrib/plmc/plmcd/Makefile.am
-@@ -32,7 +32,7 @@ plmcd_SOURCES = \
- plmcd_LDFLAGS = -lpthread
- 
- if ENABLE_SYSTEMD
--plmcd_LDFLAGS += -lsystemd-daemon
-+plmcd_LDFLAGS += -lsystemd
- endif
- 
- plmcd_LDADD = \
-diff --git a/contrib/plmc/plmcd/Makefile.in b/contrib/plmc/plmcd/Makefile.in
-index 0185dc4..e40513a 100644
---- a/contrib/plmc/plmcd/Makefile.in
-+++ b/contrib/plmc/plmcd/Makefile.in
-@@ -106,7 +106,7 @@ build_triplet = @build@
- host_triplet = @host@
- target_triplet = @target@
- sbin_PROGRAMS = plmcd$(EXEEXT)
--@ENABLE_SYSTEMD_TRUE@am__append_1 = -lsystemd-daemon
-+@ENABLE_SYSTEMD_TRUE@am__append_1 = -lsystemd
- subdir = plmcd
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
- am__aclocal_m4_deps = $(top_srcdir)/configure.ac
--- 
-1.8.4.2
-
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/install-samples-from-srcdir.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/install-samples-from-srcdir.patch
deleted file mode 100644
index 016b64f..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/install-samples-from-srcdir.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- opensaf-4.5.0.orig/Makefile.am	2014-12-31 14:45:54.088797989 +0800
-+++ opensaf-4.5.0/Makefile.am	2014-12-31 14:45:08.328796688 +0800
-@@ -219,7 +219,7 @@ install-data-local:
- 	$(mkinstalldirs) $(DESTDIR)$(pkgpiddir)
- 	$(mkinstalldirs) $(DESTDIR)$(lockdir)
- 	$(mkinstalldirs) $(DESTDIR)$(pkglocalstatedir)
--	cp -R samples/ $(DESTDIR)$(pkgdatadir)
-+	cp -R $(srcdir)/samples/ $(DESTDIR)$(pkgdatadir)
- 
- install-data-hook:
- 	@for i in $$(grep -lr -e 'xxLIBDIRxx' -e 'xxLOGDIRxx' -e 'xxCLCCLIDIRxx' $(DESTDIR)$(pkgimmxml_svcdir)/*.xml) ; do \
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.0.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.0.0.bb
deleted file mode 100644
index da9c105..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.0.0.bb
+++ /dev/null
@@ -1,73 +0,0 @@
-SUMMARY = "OpenSAF is an open source implementation of the SAF AIS specification"
-DESCRIPTION = "OpenSAF is an open source project established to develop a base platform \
-middleware consistent with Service Availability Forum (SA Forum) \
-specifications, under the LGPLv2.1 license. The OpenSAF Foundation was \
-established by leading Communications and Enterprise Computing Companies to \
-facilitate the OpenSAF Project and to accelerate the adoption of the OpenSAF \
-code base in commercial products. \
-The OpenSAF project was launched in mid 2007 and has been under development by \
-an informal group of supporters of the OpenSAF initiative. The OpenSAF \
-Foundation was founded on January 22nd 2008 with Emerson Network Power, \
-Ericsson, Nokia Siemens Networks, HP and Sun Microsystems as founding members."
-HOMEPAGE = "http://www.opensaf.org"
-SECTION = "admin"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7"
-
-DEPENDS = "libxml2 python"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
-           file://install-samples-from-srcdir.patch \
-           file://0001-plmcd-error-fix.patch \
-           "
-
-SRC_URI[md5sum] = "94cd1a4c0406e6a45bb04c003f8690e7"
-SRC_URI[sha256sum] = "4b4188a0f3d0ed1ed0e3d77de27c45e2c96b437401de08e7df2ed9ecd54bb999"
-
-inherit autotools useradd systemd pkgconfig
-
-USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "-f -r opensaf"
-USERADD_PARAM_${PN} =  "-r -g opensaf -d ${datadir}/opensaf/ -s ${sbindir}/nologin -c \"OpenSAF\" opensaf"
-
-SYSTEMD_SERVICE_${PN} += "opensafd.service plmcboot.service plmcd.service"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-PACKAGECONFIG[systemd] = "--enable-systemd-daemon"
-PACKAGECONFIG[openhpi] = "--with-hpi-interface=B03 --enable-ais-plm,,openhpi"
-
-EXTRA_OECONF += " --libdir=${libdir}/opensaf "
-EXTRA_OEMAKE += " -Wl,-rpath,${libdir}/opensaf "
-
-PKGLIBDIR="${libdir}/opensaf/opensaf"
-
-do_configure_prepend () {
-        ( cd ${S}; autoreconf -f -i -s )
-}
-
-do_install_append() {
-    rm -fr "${D}${localstatedir}/lock"
-    rm -fr "${D}${localstatedir}/run"
-    rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
-    install -d ${D}${systemd_unitdir}/system
-    install -m 0644 ${B}/osaf/services/infrastructure/nid/config/opensafd.service \
-        ${D}${systemd_unitdir}/system
-    install -m 0644 ${B}/contrib/plmc/config/*.service ${D}/${systemd_unitdir}/system
-}
-
-FILES_${PN} += "${localstatedir}/run ${systemd_unitdir}/system/*.service"
-FILES_${PN}-staticdev += "${PKGLIBDIR}/*.a"
-
-INSANE_SKIP_${PN} = "dev-so"
-
-RDEPENDS_${PN} += "bash python"
-
-do_sysvinit_install() {
-    if [ ! -d "${D}${sysconfdir}/init.d" ]; then
-       install -d ${D}${sysconfdir}/init.d
-       install -m 0755 ${B}/osaf/services/infrastructure/nid/scripts/opensafd ${D}${sysconfdir}/init.d/
-    fi
-}
-
-addtask sysvinit_install after do_install before do_package
-
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.2.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.2.0.bb
new file mode 100644
index 0000000..be79ba8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.2.0.bb
@@ -0,0 +1,66 @@
+SUMMARY = "OpenSAF is an open source implementation of the SAF AIS specification"
+DESCRIPTION = "OpenSAF is an open source project established to develop a base platform \
+middleware consistent with Service Availability Forum (SA Forum) \
+specifications, under the LGPLv2.1 license. The OpenSAF Foundation was \
+established by leading Communications and Enterprise Computing Companies to \
+facilitate the OpenSAF Project and to accelerate the adoption of the OpenSAF \
+code base in commercial products. \
+The OpenSAF project was launched in mid 2007 and has been under development by \
+an informal group of supporters of the OpenSAF initiative. The OpenSAF \
+Foundation was founded on January 22nd 2008 with Emerson Network Power, \
+Ericsson, Nokia Siemens Networks, HP and Sun Microsystems as founding members."
+HOMEPAGE = "http://www.opensaf.org"
+SECTION = "admin"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7"
+
+DEPENDS = "libxml2 python"
+TOOLCHAIN = "gcc"
+
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
+           file://0001-configure-Pass-linker-specific-options-with-Wl.patch \
+           file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \
+           file://0001-Remove-unused-variables.patch \
+"
+SRC_URI[md5sum] = "08991fd467ae9dcea3c8747be8e3981e"
+SRC_URI[sha256sum] = "903478244afe37e329be93050f1d48fa18c84ea17862134c4217b920e267a04a"
+
+inherit autotools useradd systemd pkgconfig
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "-f -r opensaf"
+USERADD_PARAM_${PN} =  "-r -g opensaf -d ${datadir}/opensaf/ -s ${sbindir}/nologin -c \"OpenSAF\" opensaf"
+
+SYSTEMD_SERVICE_${PN} += "opensafd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+PACKAGECONFIG[systemd] = ",,systemd"
+PACKAGECONFIG[openhpi] = "--with-hpi-interface=B03 --enable-ais-plm,,openhpi"
+
+PACKAGECONFIG_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
+
+PKGLIBDIR="${libdir}"
+
+LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
+
+do_install_append() {
+    cp -av --no-preserve=ownership ${B}/lib/.libs/*.so* ${D}${libdir}
+    rm -fr "${D}${localstatedir}/lock"
+    rm -fr "${D}${localstatedir}/run"
+    rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
+    rmdir --ignore-fail-on-non-empty "${D}${datadir}/java"
+    if [ ! -d "${D}${sysconfdir}/init.d" ]; then
+        install -d ${D}${sysconfdir}/init.d
+        install -m 0755 ${B}/osaf/services/infrastructure/nid/scripts/opensafd ${D}${sysconfdir}/init.d/
+    fi
+}
+
+FILES_${PN} += "${systemd_unitdir}/system/*.service"
+FILES_${PN}-staticdev += "${PKGLIBDIR}/*.a"
+
+INSANE_SKIP_${PN} = "dev-so"
+
+RDEPENDS_${PN} += "bash python"
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc b/import-layers/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc
index 03b7985..4c794ff 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc
@@ -164,8 +164,6 @@
     install -m 770 -d ${D}${localstatedir}/spool/postfix
     chown postfix:postfix ${D}${localstatedir}/spool/postfix
 
-    install -m 2755 -d ${D}${localstatedir}/spool/mail
-    chown postfix:nogroup ${D}${localstatedir}/spool/mail
     install -m 0755 -d ${D}${localstatedir}/lib/postfix
     chown postfix:nogroup ${D}${localstatedir}/lib/postfix
     install -m 0755 -d ${D}${localstatedir}/spool/postfix
@@ -214,7 +212,7 @@
 
 do_install_append_class-target() {
     # Remove references to buildmachine paths in target makedefs.out
-    sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' ${D}/etc/postfix/makedefs.out
+    sed -i 's:-fdebug-prefix-map[^ ]*::g; s:--sysroot=${STAGING_DIR_TARGET}::g' ${D}/etc/postfix/makedefs.out
 }
 
 NATIVE_INSTALL_WORKS = "1"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.5b.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.5b.bb
index c27a1cc..73efac2 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.5b.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.5b.bb
@@ -20,8 +20,7 @@
 inherit autotools-brokensep useradd update-rc.d systemd
 
 PACKAGECONFIG ??= "shadow \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
                   "
 
 PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses, --disable-curses --disable-ncurses, ncurses"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb
index f6aaee0..e136193 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb
@@ -10,12 +10,12 @@
 
 DEPENDS = "libpcap"
 
-inherit autotools systemd
+inherit autotools pkgconfig systemd
 
 # return something like '1.2.3' or '1.2.3/rc1'
 #
 def get_sub(d):
-    parts = d.getVar('PV',True).split('-')
+    parts = d.getVar('PV').split('-')
     try:
         return parts[0] + '/' + parts[1]
     except:
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch
new file mode 100644
index 0000000..48674c3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch
@@ -0,0 +1,48 @@
+From f9150a0dc092ab2cbd47ee428436b747dce323a9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 23 Apr 2017 10:28:28 -0700
+Subject: [PATCH] SquidNew: use noexcept instead of throw for C++11 compilers
+
+Fixes errors with gcc7 which is more pedantic about c++11
+conformance regarding deprecated features
+
+include/SquidNew.h:21:51: error: dynamic exception specifications are deprecated in C++11
+_SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc)
+                                                       ^~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/SquidNew.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/include/SquidNew.h b/include/SquidNew.h
+index 39fcee0..c960347 100644
+--- a/include/SquidNew.h
++++ b/include/SquidNew.h
+@@ -18,19 +18,19 @@
+  */
+ #include <new>
+ 
+-_SQUID_EXTERNNEW_ void *operator new(size_t size) throw (std::bad_alloc)
++_SQUID_EXTERNNEW_ void *operator new(size_t size) noexcept(false)
+ {
+     return xmalloc(size);
+ }
+-_SQUID_EXTERNNEW_ void operator delete (void *address) throw()
++_SQUID_EXTERNNEW_ void operator delete (void *address) noexcept(true)
+ {
+     xfree(address);
+ }
+-_SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc)
++_SQUID_EXTERNNEW_ void *operator new[] (size_t size) noexcept(false)
+ {
+     return xmalloc(size);
+ }
+-_SQUID_EXTERNNEW_ void operator delete[] (void *address) throw()
++_SQUID_EXTERNNEW_ void operator delete[] (void *address) noexcept(true)
+ {
+     xfree(address);
+ }
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/files/Add-default-entry-for-cross-compile.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/files/Add-default-entry-for-cross-compile.patch
deleted file mode 100644
index 5f845bb..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/files/Add-default-entry-for-cross-compile.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From faa212a4e0aaf442ff58fca50770a8fadc1038e3 Mon Sep 17 00:00:00 2001
-Message-Id: <faa212a4e0aaf442ff58fca50770a8fadc1038e3.1382041123.git.Jim.Somerville@windriver.com>
-From: Jim Somerville <Jim.Somerville@windriver.com>
-Date: Thu, 17 Oct 2013 16:17:48 -0400
-Subject: [PATCH 1/1] Add default entry for cross compile
-
-Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
----
- acinclude/krb5.m4 |    6 +++++-
- 1 files changed, 5 insertions(+), 1 deletions(-)
-
-diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4
-index 5d9ac36..7a072a2 100644
---- a/acinclude/krb5.m4
-+++ b/acinclude/krb5.m4
-@@ -82,7 +82,11 @@ main(void)
- 
-         return 0;
- }
--]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ])
-+]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ],
-+[
-+  dnl Can't test in cross compiled env - so assume good
-+  squid_cv_broken_heimdal_krb5_h=no
-+])
-     ],
-     [
-      dnl Can't test in cross compiled env - so assume good
--- 
-1.7.4.1
-
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.20.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.20.bb
deleted file mode 100644
index fc7f768..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.20.bb
+++ /dev/null
@@ -1,104 +0,0 @@
-SUMMARY = "A fully-featured http proxy and web-cache daemon for Linux"
-DESCRIPTION = "A fully-featured http proxy and web-cache daemon for Linux. \
-Squid offers a rich access control, authorization and logging environment to \
-develop web proxy and content serving applications. \
-Squid offers a rich set of traffic optimization options, most of which are \
-enabled by default for simpler installation and high performance. \
-"
-HOMEPAGE = "http://www.squid-cache.org"
-SECTION = "web"
-LICENSE = "GPLv2+"
-
-MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}"
-MIN_VER = "${@oe.utils.trim_version("${PV}", 2)}"
-
-SRC_URI = "http://www.squid-cache.org/Versions/v${MAJ_VER}/${MIN_VER}/${BPN}-${PV}.tar.bz2 \
-           file://Set-up-for-cross-compilation.patch \
-           file://Skip-AC_RUN_IFELSE-tests.patch \
-           file://Fix-flawed-dynamic-ldb-link-test-in-configure.patch \
-           file://squid-use-serial-tests-config-needed-by-ptest.patch \
-           file://run-ptest \
-           file://volatiles.03_squid \
-           file://set_sysroot_patch.patch \
-           file://squid-don-t-do-squid-conf-tests-at-build-time.patch \
-"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=c492e2d6d32ec5c1aad0e0609a141ce9 \
-                    file://errors/COPYRIGHT;md5=0d98c4448c368d146f31a970bb0ced21 \
-                   "
-SRC_URI[md5sum] = "6a29d7dfc544205001f7a75c6996dc60"
-SRC_URI[sha256sum] = "5a114f8f7f44b5ae3c9b77d7b81aef13fe69e7f530855213d551f48b157cb5f1"
-
-DEPENDS = "libtool krb5 openldap db cyrus-sasl"
-
-inherit autotools useradd ptest
-
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /var/run/squid --shell /bin/false --user-group squid"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('TARGET_ARCH', 'powerpc', 'noatomics', '', d)} \
-                   ${@bb.utils.contains('TARGET_ARCH', 'mips', 'noatomics', '', d)} \
-                   ${@bb.utils.contains('TARGET_ARCH', 'mipsel', 'noatomics', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-                  "
-PACKAGECONFIG[libnetfilter-conntrack] = "--with-netfilter-conntrack=${includedir}, --without-netfilter-conntrack, libnetfilter-conntrack"
-PACKAGECONFIG[noatomics] = "squid_cv_gnu_atomics=no,squid_cv_gnu_atomics=yes,,"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
-
-BASIC_AUTH = "DB SASL LDAP NIS"
-DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
-BASIC_AUTH += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'PAM', '', d)}"
-
-EXTRA_OECONF += "--with-default-user=squid --enable-auth-basic='${BASIC_AUTH}' --sysconfdir=${sysconfdir}/${BPN} --with-logdir=${localstatedir}/log/${BPN}"
-
-export BUILDCXXFLAGS="${BUILD_CXXFLAGS}"
-
-TESTDIR = "test-suite"
-
-do_configure_prepend() {
-    export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
-}
-
-do_compile_ptest() {
-    oe_runmake -C ${TESTDIR} buildtest-TESTS
-}
-
-do_install_ptest() {
-    cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
-    cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
-
-    # do NOT need to rebuild Makefile itself
-    sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-
-    # Add squid-conf-tests for runtime tests
-    sed -e 's/^\(runtest-TESTS:\)/\1 squid-conf-tests/' \
-        -e "s/\(list=' \$(TESTS)\)/\1 squid-conf-tests/" \
-        -i ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-
-    # Ensure the path for command true is correct
-    sed -i 's:^TRUE = .*$:TRUE = /bin/true:' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-}
-
-do_install_append() {
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/tmpfiles.d
-        echo "d ${localstatedir}/run/${BPN} 0755 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
-        echo "d ${localstatedir}/log/${BPN} 0750 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
-    fi
-
-    install -d ${D}${sysconfdir}/default/volatiles
-    install -m 0644 ${WORKDIR}/volatiles.03_squid ${D}${sysconfdir}/default/volatiles/03_squid
-
-    rmdir "${D}${localstatedir}/run/${BPN}"
-    rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/run"
-
-    rmdir "${D}${localstatedir}/log/${BPN}"
-    rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/log"
-}
-
-FILES_${PN} += "${libdir} ${datadir}/errors ${datadir}/icons"
-FILES_${PN}-dbg += "/usr/src/debug"
-FILES_${PN}-doc += "${datadir}/*.txt"
-
-RDEPENDS_${PN} += "perl"
-RDEPENDS_${PN}-ptest += "make"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.25.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.25.bb
new file mode 100644
index 0000000..5116383
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.25.bb
@@ -0,0 +1,106 @@
+SUMMARY = "A fully-featured http proxy and web-cache daemon for Linux"
+DESCRIPTION = "A fully-featured http proxy and web-cache daemon for Linux. \
+Squid offers a rich access control, authorization and logging environment to \
+develop web proxy and content serving applications. \
+Squid offers a rich set of traffic optimization options, most of which are \
+enabled by default for simpler installation and high performance. \
+"
+HOMEPAGE = "http://www.squid-cache.org"
+SECTION = "web"
+LICENSE = "GPLv2+"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}"
+MIN_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "http://www.squid-cache.org/Versions/v${MAJ_VER}/${MIN_VER}/${BPN}-${PV}.tar.bz2 \
+           file://Set-up-for-cross-compilation.patch \
+           file://Skip-AC_RUN_IFELSE-tests.patch \
+           file://Fix-flawed-dynamic-ldb-link-test-in-configure.patch \
+           file://squid-use-serial-tests-config-needed-by-ptest.patch \
+           file://run-ptest \
+           file://volatiles.03_squid \
+           file://set_sysroot_patch.patch \
+           file://squid-don-t-do-squid-conf-tests-at-build-time.patch \
+           file://0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch \
+           "
+SRC_URI[md5sum] = "c34b228129a755f363367c45c46287ba"
+SRC_URI[sha256sum] = "0bfd6182154b7f29574d71c659f1cfd1b7d9be9356895dac70dc0f3696a0639b"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c492e2d6d32ec5c1aad0e0609a141ce9 \
+                    file://errors/COPYRIGHT;md5=8861130fae91400bcf99b66f133172b3 \
+                   "
+DEPENDS = "libtool krb5 openldap db cyrus-sasl"
+
+inherit autotools useradd ptest
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /var/run/squid --shell /bin/false --user-group squid"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('TARGET_ARCH', 'powerpc', 'noatomics', '', d)} \
+                   ${@bb.utils.contains('TARGET_ARCH', 'mips', 'noatomics', '', d)} \
+                   ${@bb.utils.contains('TARGET_ARCH', 'mipsel', 'noatomics', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+                  "
+PACKAGECONFIG[libnetfilter-conntrack] = "--with-netfilter-conntrack=${includedir}, --without-netfilter-conntrack, libnetfilter-conntrack"
+PACKAGECONFIG[noatomics] = "squid_cv_gnu_atomics=no,squid_cv_gnu_atomics=yes,,"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+BASIC_AUTH = "DB SASL LDAP"
+BASIC_AUTH_append_libc-glibc = " NIS"
+
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+BASIC_AUTH += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'PAM', '', d)}"
+
+EXTRA_OECONF += "--with-default-user=squid --enable-auth-basic='${BASIC_AUTH}' --sysconfdir=${sysconfdir}/${BPN} --with-logdir=${localstatedir}/log/${BPN}"
+
+export BUILDCXXFLAGS="${BUILD_CXXFLAGS}"
+
+TESTDIR = "test-suite"
+
+do_configure_prepend() {
+    export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
+}
+
+do_compile_ptest() {
+    oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+    cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
+    cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
+
+    # do NOT need to rebuild Makefile itself
+    sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+
+    # Add squid-conf-tests for runtime tests
+    sed -e 's/^\(runtest-TESTS:\)/\1 squid-conf-tests/' \
+        -e "s/\(list=' \$(TESTS)\)/\1 squid-conf-tests/" \
+        -i ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+
+    # Ensure the path for command true is correct
+    sed -i 's:^TRUE = .*$:TRUE = /bin/true:' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+}
+
+do_install_append() {
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -d ${D}${sysconfdir}/tmpfiles.d
+        echo "d ${localstatedir}/run/${BPN} 0755 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+        echo "d ${localstatedir}/log/${BPN} 0750 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+    fi
+
+    install -d ${D}${sysconfdir}/default/volatiles
+    install -m 0644 ${WORKDIR}/volatiles.03_squid ${D}${sysconfdir}/default/volatiles/03_squid
+
+    rmdir "${D}${localstatedir}/run/${BPN}"
+    rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/run"
+
+    rmdir "${D}${localstatedir}/log/${BPN}"
+    rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/log"
+}
+
+FILES_${PN} += "${libdir} ${datadir}/errors ${datadir}/icons"
+FILES_${PN}-dbg += "/usr/src/debug"
+FILES_${PN}-doc += "${datadir}/*.txt"
+
+RDEPENDS_${PN} += "perl"
+RDEPENDS_${PN}-ptest += "make"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
index 5932f85..7f56713 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
@@ -37,7 +37,7 @@
 
 EXTRA_OECONF += "--disable-option-checking"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
 # configure.in has errors
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch b/import-layers/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch
new file mode 100644
index 0000000..c3919e1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch
@@ -0,0 +1,28 @@
+From e55135c2a4ea7eae3cb1f4dccf69ca477ea095bf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 20:09:12 -0700
+Subject: [PATCH] sysdeputil.c: Fix with musl which does not have utmpx
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeputil.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/sysdeputil.c b/sysdeputil.c
+index 06f01f4..a8cff3b 100644
+--- a/sysdeputil.c
++++ b/sysdeputil.c
+@@ -58,7 +58,9 @@
+ #define VSF_SYSDEP_HAVE_SHADOW
+ #define VSF_SYSDEP_HAVE_USERSHELL
+ #define VSF_SYSDEP_HAVE_LIBCAP
+-#define VSF_SYSDEP_HAVE_UTMPX
++#if defined(__GLIBC__)
++  #define VSF_SYSDEP_HAVE_UTMPX
++#endif
+ 
+ #define __USE_GNU
+ #include <utmpx.h>
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb
index 3eaaa30..e524614 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb
@@ -19,7 +19,10 @@
            file://vsftpd.service \
            file://vsftpd-2.1.0-filter.patch \
            file://0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch \
-"
+           ${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)} \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)} \
+           file://0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch \
+           "
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \
                         file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \
@@ -30,13 +33,11 @@
 
 PACKAGECONFIG ??= "tcp-wrappers"
 PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers"
-SRC_URI +="${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)}"
 
 DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}"
 PAMLIB = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}"
 NOPAM_SRC ="${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}"
-SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)}"
 
 inherit update-rc.d useradd systemd
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch b/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch
index 0e8b792..bce38ba 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch
+++ b/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch
@@ -1,75 +1,108 @@
-1. test_bit was used to return true boolean value, if
-   BIO_UPTODATE bit of bio->bi_flags is set. But the same
-   job can be done by checking bio->bi_error, implemented in
-   linux kernel 4.3 and above. If bio->bi_error is set, then 
-   it denotes error.
+Description: Fix source to compile with 4.3+ kernels
+  commit 4246a0b63bd8f56a1469b12eafeb875b1041a451
+    block: add a bi_error field to struct bio
+  -> Removes BIO_UPTODATE and error argument to bio_endio.
+  commit b54ffb73cadcdcff9cc1ae0e11f502407e3e2e4c
+    block: remove bio_get_nr_vecs()
+  -> Removed that call (always use BIO_MAX_PAGES)
+  commit 676d23690fb62b5d51ba5d659935e9f7d9da9f8e
+    net: Fix use after free by removing length arg from sk_data_ready callbacks.
+  -> Removes len argument from sk_data_ready() callback.
+Author: Stefan Bader <stefan.bader@canonical.com>
 
-Ref: https://github.com/torvalds/linux/commit/4246a0b63bd8f56a1469b12eafeb875b1041a451
+The original patch is at http://launchpadlibrarian.net/227478885/iscsitarget_1.4.20.3+svn502-2ubuntu2_1.4.20.3+svn502-2ubuntu3.diff.gz,
+those changes were taken using #ifs to allow compilation of iscsitarget 
+package with kernel versions < 4.3.
 
-It solves below build error:
--- snip --
-iscsitarget-1.4.20.3+svn502/kernel/block-io.c:40:19: error: 'BIO_UPTODATE' undeclared (first use in this function)
-   error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? error : -EIO;
--- CUT --
-
-2. bio can always be filled to a maximum value of BIO_MAX_PAGES, 
-   so no need to check for min value for linux kernel 4.3 and above.
-
-Ref: https://github.com/torvalds/linux/commit/b54ffb73cadcdcff9cc1ae0e11f502407e3e2e4c
-
-It solves below build error:
--- snip --
-iscsitarget-1.4.20.3+svn502/kernel/block-io.c:80:15: error: implicit declaration of function 'bio_get_nr_vecs' [-Werror=implicit-function-declaration]
-    max_pages = bio_get_nr_vecs(bio_data->bdev);
--- CUT --
-
-Upstream-Status: Pending
+Upstream-Status: Submitted [http://launchpadlibrarian.net/227478885/iscsitarget_1.4.20.3+svn502-2ubuntu2_1.4.20.3+svn502-2ubuntu3.diff.gz]
 
 Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
 
 diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c iscsitarget-1.4.20.3+svn502/kernel/block-io.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c	2016-04-01 09:07:12.891810059 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/block-io.c	2016-04-01 09:15:59.076469313 +0530
-@@ -33,7 +33,11 @@ static void blockio_bio_endio(struct bio
+--- iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c	2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/block-io.c	2017-01-19 00:46:28.263951115 -0800
+@@ -29,14 +29,23 @@ struct tio_work {
+ 	struct completion tio_complete;
+ };
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++static void blockio_bio_endio(struct bio *bio)
++#else
+ static void blockio_bio_endio(struct bio *bio, int error)
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
  {
  	struct tio_work *tio_work = bio->bi_private;
  
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+	error = bio->bi_error ? -EIO : error;
++	if (bio->bi_error)
++		atomic_set(&tio_work->error, bio->bi_error);
 +#else
  	error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? error : -EIO;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */	
  
  	if (error)
  		atomic_set(&tio_work->error, error);
-@@ -61,6 +65,10 @@ blockio_make_request(struct iet_volume *
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
+ 
+ 	/* If last bio signal completion */
+ 	if (atomic_dec_and_test(&tio_work->bios_remaining))
+@@ -61,14 +70,20 @@ blockio_make_request(struct iet_volume *
  	u32 size = tio->size;
  	u32 tio_index = 0;
  
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+	int err = 0;
-+	loff_t ppos = tio->offset;	
-+#else	
++	int max_pages = bdev_q ? BIO_MAX_PAGES : 1;
++#else
  	int max_pages = 1;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
  	int err = 0;
  
-@@ -69,6 +77,7 @@ blockio_make_request(struct iet_volume *
+ 	loff_t ppos = tio->offset;
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
  	/* Calculate max_pages for bio_alloc (memory saver) */
  	if (bdev_q)
  		max_pages = bio_get_nr_vecs(bio_data->bdev);
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) */
  
  	tio_work = kzalloc(sizeof (*tio_work), GFP_KERNEL);
  	if (!tio_work)
-@@ -80,7 +89,11 @@ blockio_make_request(struct iet_volume *
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/conn.c iscsitarget-1.4.20.3+svn502/kernel/conn.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c	2017-01-19 00:39:09.737117778 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/conn.c	2017-01-19 00:52:30.037223901 -0800
+@@ -89,13 +89,21 @@ static void iet_state_change(struct sock
+ 	target->nthread_info.old_state_change(sk);
+ }
  
- 	/* Main processing loop, allocate and fill all bios */
- 	while (size && tio_index < tio->pg_cnt) {
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+		bio = bio_alloc(GFP_KERNEL, BIO_MAX_PAGES);
-+#else    		
- 		bio = bio_alloc(GFP_KERNEL, min(max_pages, BIO_MAX_PAGES));
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */		
- 		if (!bio) {
- 			err = -ENOMEM;
- 			goto out;
++static void iet_data_ready(struct sock *sk)
++#else
+ static void iet_data_ready(struct sock *sk, int len)
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
+ {
+ 	struct iscsi_conn *conn = sk->sk_user_data;
+ 	struct iscsi_target *target = conn->session->target;
+ 
+ 	nthread_wakeup(target);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++	target->nthread_info.old_data_ready(sk);
++#else
+ 	target->nthread_info.old_data_ready(sk, len);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
+ }
+ 
+ /*
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h iscsitarget-1.4.20.3+svn502/kernel/iscsi.h
+--- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h	2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.h	2017-01-19 00:48:02.102837260 -0800
+@@ -81,7 +81,11 @@ struct network_thread_info {
+ 	spinlock_t nthread_lock;
+ 
+ 	void (*old_state_change)(struct sock *);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++	void (*old_data_ready)(struct sock *);
++#else
+ 	void (*old_data_ready)(struct sock *, int);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
+ 	void (*old_write_space)(struct sock *);
+ };
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch b/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch
index e55c407..e508a5e 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch
+++ b/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch
@@ -90,25 +90,9 @@
 Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
 
 diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c iscsitarget-1.4.20.3+svn502/kernel/block-io.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c	2016-09-25 19:45:01.814641016 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/block-io.c	2016-09-25 19:47:59.666474094 +0530
-@@ -57,7 +57,6 @@ static int
- blockio_make_request(struct iet_volume *volume, struct tio *tio, int rw)
- {
- 	struct blockio_data *bio_data = volume->private;
--	struct request_queue *bdev_q = bdev_get_queue(bio_data->bdev);
- 	struct tio_work *tio_work;
- 	struct bio *tio_bio = NULL, *bio = NULL, *biotail = NULL;
- 	struct blk_plug plug;
-@@ -69,6 +68,7 @@ blockio_make_request(struct iet_volume *
- 	int err = 0;
- 	loff_t ppos = tio->offset;	
- #else	
-+	struct request_queue *bdev_q = bdev_get_queue(bio_data->bdev);
- 	int max_pages = 1;
- 	int err = 0;
- 
-@@ -102,7 +102,11 @@ blockio_make_request(struct iet_volume *
+--- iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c	2017-01-19 20:19:27.400507354 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/block-io.c	2017-01-19 20:32:22.977988593 -0800
+@@ -104,7 +104,11 @@ blockio_make_request(struct iet_volume *
  		/* bi_sector is ALWAYS in units of 512 bytes */
  		bio->bi_iter.bi_sector = ppos >> 9;
  		bio->bi_bdev = bio_data->bdev;
@@ -120,7 +104,7 @@
  		bio->bi_private = tio_work;
  
  		if (tio_bio)
-@@ -137,7 +141,12 @@ blockio_make_request(struct iet_volume *
+@@ -139,7 +143,12 @@ blockio_make_request(struct iet_volume *
  		tio_bio = tio_bio->bi_next;
  		bio->bi_next = NULL;
  
@@ -134,36 +118,14 @@
  
  	blk_finish_plug(&plug);
 diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/conn.c iscsitarget-1.4.20.3+svn502/kernel/conn.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c	2016-09-25 19:45:01.774641057 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/conn.c	2016-09-25 19:47:59.666474094 +0530
-@@ -89,13 +89,21 @@ static void iet_state_change(struct sock
- 	target->nthread_info.old_state_change(sk);
- }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+static void iet_data_ready(struct sock *sk)
-+#else
- static void iet_data_ready(struct sock *sk, int len)
-+#endif    
- {
- 	struct iscsi_conn *conn = sk->sk_user_data;
- 	struct iscsi_target *target = conn->session->target;
- 
- 	nthread_wakeup(target);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+	target->nthread_info.old_data_ready(sk);
-+#else
- 	target->nthread_info.old_data_ready(sk, len);
-+#endif
- }
- 
- /*
-@@ -140,8 +148,14 @@ static void iet_socket_bind(struct iscsi
+--- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c	2017-01-19 20:19:27.400507354 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/conn.c	2017-01-19 20:32:22.978988614 -0800
+@@ -148,8 +148,14 @@ static void iet_socket_bind(struct iscsi
  	target->nthread_info.old_state_change = conn->sock->sk->sk_state_change;
  	conn->sock->sk->sk_state_change = iet_state_change;
  
-+#if 0//LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+	target->nthread_info.old_data_ready = (void (*) (struct sock *, int )) \
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++	target->nthread_info.old_data_ready = (void (*) (struct sock *)) \
 +						conn->sock->sk->sk_data_ready;
 +	conn->sock->sk->sk_data_ready = (void (*) (struct sock *)) iet_data_ready;
 +#else
@@ -174,8 +136,8 @@
  	target->nthread_info.old_write_space = conn->sock->sk->sk_write_space;
  	conn->sock->sk->sk_write_space = iet_write_space;
 diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/digest.c iscsitarget-1.4.20.3+svn502/kernel/digest.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/digest.c	2014-05-07 02:29:55.000000000 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/digest.c	2016-09-25 19:47:59.666474094 +0530
+--- iscsitarget-1.4.20.3+svn502_org/kernel/digest.c	2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/digest.c	2017-01-19 20:32:22.978988614 -0800
 @@ -30,6 +30,9 @@ void digest_alg_available(unsigned int *
  int digest_init(struct iscsi_conn *conn)
  {
@@ -374,8 +336,8 @@
 +#endif
  }
 diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h iscsitarget-1.4.20.3+svn502/kernel/iscsi.h
---- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h	2016-09-25 19:45:01.734641099 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.h	2016-09-25 19:47:59.666474094 +0530
+--- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h	2017-01-19 20:19:27.400507354 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.h	2017-01-19 20:32:22.979988634 -0800
 @@ -14,6 +14,7 @@
  #include <linux/pagemap.h>
  #include <linux/seq_file.h>
@@ -384,19 +346,7 @@
  #include <linux/crypto.h>
  #include <linux/scatterlist.h>
  #include <net/sock.h>
-@@ -81,7 +82,11 @@ struct network_thread_info {
- 	spinlock_t nthread_lock;
- 
- 	void (*old_state_change)(struct sock *);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+	void (*old_data_ready)(struct sock *);
-+#else
- 	void (*old_data_ready)(struct sock *, int);
-+#endif
- 	void (*old_write_space)(struct sock *);
- };
- 
-@@ -275,8 +280,13 @@ struct iscsi_conn {
+@@ -275,8 +276,13 @@ struct iscsi_conn {
  	u32 write_offset;
  	int write_state;
  
@@ -410,7 +360,7 @@
  	struct scatterlist hash_sg[ISCSI_CONN_IOV_MAX];
  };
  
-@@ -552,4 +562,10 @@ enum cmnd_flags {
+@@ -552,4 +558,10 @@ enum cmnd_flags {
  #define PRODUCT_ID	"VIRTUAL-DISK"
  #define PRODUCT_REV	"0"
  
@@ -422,9 +372,9 @@
 +
  #endif	/* __ISCSI_H__ */
 diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c iscsitarget-1.4.20.3+svn502/kernel/nthread.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c	2016-09-25 19:45:01.734641099 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/nthread.c	2016-09-25 19:47:59.666474094 +0530
-@@ -126,7 +126,12 @@ static int do_recv(struct iscsi_conn *co
+--- iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c	2017-01-19 20:19:27.276504928 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/nthread.c	2017-01-19 20:32:22.979988634 -0800
+@@ -155,7 +155,12 @@ static int do_recv(struct iscsi_conn *co
  
  	oldfs = get_fs();
  	set_fs(get_ds());
@@ -437,7 +387,7 @@
  	set_fs(oldfs);
  
  	if (res <= 0) {
-@@ -347,7 +352,11 @@ static int write_data(struct iscsi_conn
+@@ -376,7 +381,11 @@ static int write_data(struct iscsi_conn
  			;
  		oldfs = get_fs();
  		set_fs(KERNEL_DS);
@@ -449,7 +399,7 @@
  		set_fs(oldfs);
  		dprintk(D_DATA, "%#Lx:%u: %d(%ld)\n",
  			(unsigned long long) conn->session->sid, conn->cid,
-@@ -478,7 +487,11 @@ static int tx_ddigest(struct iscsi_cmnd
+@@ -503,7 +512,11 @@ static int tx_ddigest(struct iscsi_cmnd
  	iov.iov_base = (char *) (&cmnd->ddigest) + (sizeof(u32) - rest);
  	iov.iov_len = rest;
  
@@ -461,7 +411,7 @@
  
  	if (res > 0) {
  		cmnd->conn->write_size -= res;
-@@ -677,7 +690,12 @@ static void close_conn(struct iscsi_conn
+@@ -702,7 +715,12 @@ static void close_conn(struct iscsi_conn
  
  	write_lock_bh(&conn->sock->sk->sk_callback_lock);
  	conn->sock->sk->sk_state_change = target->nthread_info.old_state_change;
@@ -475,8 +425,8 @@
  	write_unlock_bh(&conn->sock->sk->sk_callback_lock);
  
 diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/volume.c iscsitarget-1.4.20.3+svn502/kernel/volume.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/volume.c	2016-09-25 19:45:01.734641099 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/volume.c	2016-09-25 19:47:59.666474094 +0530
+--- iscsitarget-1.4.20.3+svn502_org/kernel/volume.c	2017-01-19 20:19:27.276504928 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/volume.c	2017-01-19 20:32:22.979988634 -0800
 @@ -84,12 +84,25 @@ static int set_scsisn(struct iet_volume
  /* Generate a MD5 hash of the target IQN and LUN number */
  static void gen_scsiid(struct iet_volume *volume)
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch b/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch
new file mode 100644
index 0000000..c996834
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch
@@ -0,0 +1,85 @@
+The previous build_with_updated_interfaces_of_linux_v4.8_and_above.patch
+does not alloc struct ahash_request before using it. This will cause the
+kernel call trace below when calling gen_scsiid on kernel 4.8 or later
+version.
+
+This patch normalizes the calling of ahash API according to the example
+in kernel doc Documentation/crypto/api-intro.txt.
+
+BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
+IP: [<ffffffffa0008d45>] volume_add+0x625/0x7f0 [iscsi_trgt]
+PGD dd77067 PUD dd7c067 PMD 0 
+Oops: 0000 [#1] PREEMPT SMP
+Modules linked in: iscsi_trgt(O)
+CPU: 0 PID: 350 Comm: ietd Tainted: G           O    4.8.12-yocto-standard #1
+Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
+task: ffff88000dfe2c00 task.stack: ffff88000de88000
+RIP: 0010:[<ffffffffa0008d45>]  [<ffffffffa0008d45>] volume_add+0x625/0x7f0 [iscsi_trgt]
+RSP: 0018:ffff88000de8bd90  EFLAGS: 00000206
+RAX: 000000000000ddfa RBX: ffff88000ddd1d78 RCX: ffffea0000000000
+RDX: 0000000000000600 RSI: 0000000000000000 RDI: ffff88000ddd1c14
+RBP: ffff88000de8be38 R08: ffff88000de44180 R09: ffff88000de8bdd0
+R10: 000000000000002c R11: 0000000000000000 R12: ffff88000ddfa600
+R13: 0000000000000000 R14: 0000000000000000 R15: ffff88000de92200
+FS:  00007f767548b700(0000) GS:ffff88000fc00000(0000) knlGS:0000000000000000
+CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: 0000000000000020 CR3: 000000000dd2d000 CR4: 00000000000006f0
+Stack:
+ ffff88000de8bdd0 ffff88000dc1b3d0 ffff88000ddfa650 ffff88000ddfa660
+ ffff88000df8f000 ffff88000ddd1c00 ffff88000de44180 0000000000000000
+ ffffea0000377440 0000000f00000c14 0000000000000000 0000000000000000
+Call Trace:
+ [<ffffffffa0006547>] ioctl+0x217/0x390 [iscsi_trgt]
+ [<ffffffff81192574>] do_vfs_ioctl+0x94/0x5c0
+ [<ffffffff8117ff73>] ? vfs_read+0xf3/0x120
+ [<ffffffff81192b19>] SyS_ioctl+0x79/0x90
+ [<ffffffff8191a45b>] entry_SYSCALL_64_fastpath+0x13/0x8f
+Code: 4c 01 e0 0f 82 a2 01 00 00 48 b9 00 00 00 80 ff 77 00 00 48 01
+c8 45 31 f6 48 b9 00 00 00 00 00 ea ff ff 89 54 24 68 48 c1 e8 0c <49>
+8b 56 20 4c 89 44 24 20 4c 89 f7 48 c1 e0 06 c7 44 24 6c 04 
+RIP  [<ffffffffa0008d45>] volume_add+0x625/0x7f0 [iscsi_trgt]
+ RSP <ffff88000de8bd90>
+CR2: 0000000000000020
+end trace cd2016297df21635 ]
+ietd_response_recv 200 0 -5
+Input/output error.
+
+Upstream-Status: Pending [This patch is based on the previous one which
+has not been merged upstream.]
+
+Signed-off-by: Zhe He <zhe.he@windriver.com>
+
+--- iscsitarget-1.4.20.3+svn502_orig/kernel/volume.c	2017-01-18 08:57:56.752187402 +0800
++++ iscsitarget-1.4.20.3+svn502/kernel/volume.c	2017-01-18 09:02:44.164195234 +0800
+@@ -93,13 +93,14 @@ static void gen_scsiid(struct iet_volume
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+ 	tfm = crypto_alloc_ahash("md5", 0, CRYPTO_ALG_ASYNC);
++	hash = ahash_request_alloc(tfm, GFP_ATOMIC);
+ #else
+ 	hash.tfm = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC);
+ 	hash.flags = 0;
+ #endif
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+-	if (!IS_ERR(tfm)) {
++	if (tfm && !IS_ERR(tfm)) {
+ #else
+ 	if (!IS_ERR(hash.tfm)) {
+ #endif
+@@ -116,10 +117,13 @@ static void gen_scsiid(struct iet_volume
+ 		nbytes += sizeof(volume->lun);
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+-		crypto_ahash_init(hash);
++		ahash_request_set_callback(hash, 0, NULL, NULL);
+ 		ahash_request_set_crypt(hash, sg, volume->scsi_id, nbytes);
+-		crypto_ahash_update(hash);
+ 		crypto_ahash_digest(hash);
++		crypto_ahash_init(hash);
++		crypto_ahash_update(hash);
++		crypto_ahash_final(hash);
++		ahash_request_free(hash);
+ 		crypto_free_ahash(tfm);
+ #else
+ 		crypto_hash_init(&hash);
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch b/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch
index 6878ca2..1e6a1d6 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch
+++ b/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch
@@ -1,57 +1,80 @@
-Fix build errors with linux kernel v3.19 and above
+Description: Fix source to compile on 3.19 kernels
+Author: Stefan Bader <stefan.bader@canonical.com>
+Forward: no
 
-Below errors came up while building iscsitarget for 
-qemux86-64 (and others) because,
-1. 'struct user_msghdr' is being used for userland-side msghdr instead
-of 'struct msghdr', which is used for kernel-side msghdr in linux v3.19
-and above.
+Fixes below inconsistent crash when trying to login to iSCSI target
+server, observed with linux kernel v4.1.
 
-error snippet:
 -- snip --
-| /CGE7_SHDD/project_yocto_1.8/poky/build/tmp/work/qemux86_64-poky-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/iscsi.c: In function 'cmnd_skip_pdu':
-| /CGE7_SHDD/project_yocto_1.8/poky/build/tmp/work/qemux86_64-poky-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/iscsi.c:492:16: error: 'struct msghdr' has no member named 'msg_iov'
-|   conn->read_msg.msg_iov = conn->read_iov;
--- CUT --
-
-Reference:
-https://github.com/torvalds/linux/commit/666547ff591cebdedc4679bf6b1b3f3383a8dea3
-
-2. 'SERVICE_ACTION_IN' has been renamed to SERVICE_ACTION_IN_16 in linux v3.19
-and above.
-
-error snippet:
+CPU: 1 PID: 29883 Comm: istd1 Tainted: G           O    4.1.35-rt40-yocto-standard #1
+Hardware name: To be filled by O.E.M. To be filled by O.E.M./Larne CRB, BIOS 4.6.5.4 09/18/2014
+task: ffff88020f1f30c0 ti: ffff8800d7f3c000 task.ti: ffff8800d7f3c000
+RIP: 0010:[<ffffffff8140d1ae>]  [<ffffffff8140d1ae>] copy_to_iter+0x3e/0x280
+RSP: 0018:ffff8800d7f3f728  EFLAGS: 00010246
+RAX: 00000000d7f3f928 RBX: 0000000000000030 RCX: 0000000000000030
+RDX: ffff8800d7f3f900 RSI: 0000000000000030 RDI: ffff8800d1501e82
+RBP: ffff8800d7f3f768 R08: 00000000c127d467 R09: 0000000000000000
+R10: ffff88020f29e118 R11: 0000000000000004 R12: ffff8800d7f3f900
+R13: 0000000000000030 R14: 0000000000000001 R15: 0000000000000246
+FS:  00007f86f9c4c700(0000) GS:ffff88021ec80000(0000) knlGS:00000000f7733700
+CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: 000000000000024e CR3: 00000000d38b0000 CR4: 00000000000406e0
+Stack:
+ffff880214f14ec0 ffff8800d1501e82 ffff8800d7f3f748 0000000000000030
+ffff88020f122500 0000000000000030 0000000000000000 0000000000000030
+ffff8800d7f3f7c8 ffffffff81806981 ffff8800d7f3f798 ffffffff8105d72a
+Call Trace:
+[<ffffffff81806981>] skb_copy_datagram_iter+0x71/0x2b0
+[<ffffffff8105d72a>] ? __local_bh_enable_ip+0x4a/0xb0
+[<ffffffff8186c9c0>] tcp_recvmsg+0x5e0/0xbb0
+[<ffffffff81898ded>] inet_recvmsg+0x8d/0xb0
+[<ffffffff817f49f3>] sock_recvmsg+0x13/0x20
+[<ffffffffa01655c3>] do_recv+0xe3/0x1f0 [iscsi_trgt]
+[<ffffffff81153097>] ? __mod_zone_page_state+0x77/0xb0
+[<ffffffff81417613>] ? __this_cpu_preempt_check+0x13/0x20
+[<ffffffff81153097>] ? __mod_zone_page_state+0x77/0xb0
+[<ffffffff8140fed5>] ? find_next_bit+0x15/0x30
+[<ffffffff813fa8e0>] ? cpumask_next_and+0x30/0x50
+[<ffffffff8113f785>] ? __alloc_pages_nodemask+0x165/0x980
+[<ffffffff8107e370>] ? preempt_count_add+0xd0/0xf0
+[<ffffffff8195da8b>] ? _raw_spin_lock+0x1b/0x60
+[<ffffffff8109cfa8>] ? cpuacct_charge+0x58/0x70
+[<ffffffff81089039>] ? update_curr+0xb9/0x190
+[<ffffffff81417613>] ? __this_cpu_preempt_check+0x13/0x20
+[<ffffffff8112b43f>] ? __perf_event_task_sched_in+0x4f/0x90
+[<ffffffff8195dbbd>] ? _raw_spin_unlock_irq+0x1d/0x40
+[<ffffffff8107e223>] ? finish_task_switch+0x63/0xe0
+[<ffffffff81959e3b>] ? __schedule+0x38b/0x980
+[<ffffffff8107e370>] ? preempt_count_add+0xd0/0xf0
+[<ffffffffa0165c65>] istd+0x4d5/0x1390 [iscsi_trgt]
+[<ffffffff81959e3b>] ? __schedule+0x38b/0x980
+[<ffffffffa0165790>] ? nthread_wakeup+0x40/0x40 [iscsi_trgt]
+[<ffffffffa0165790>] ? nthread_wakeup+0x40/0x40 [iscsi_trgt]
+[<ffffffff8107748b>] kthread+0xbb/0xe0
+[<ffffffff81950000>] ? wireless_dev_seq_show+0x100/0x180
+[<ffffffff810773d0>] ? kthread_worker_fn+0x170/0x170
+[<ffffffff8195e7a2>] ret_from_fork+0x42/0x70
+[<ffffffff810773d0>] ? kthread_worker_fn+0x170/0x170
+Code: 5a 10 48 89 7d c8 48 39 f3 48 0f 47 de 48 85 db 0f 84 6f 01 00 00 8b 02 49 89
+d4 4c 8b 72 08 4c 8b 7a 18 a8 04 0f 85 a2 00 00 00 <4d> 8b 6f 08 4d 29 f5 49 39 dd 4c 0f 47 eb a8 02 0f 85 5c 01 00 
+RSP <ffff8800d7f3f728>
+CR2: 000000000000024e
+------------[ cut here ]------------
 -- snip --
-| /CGE7_SHDD/project_yocto_1.8/poky/build/tmp/work/qemux86_64-poky-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/iscsi.c: In function 'scsi_cmnd_start':
-| /CGE7_SHDD/project_yocto_1.8/poky/build/tmp/work/qemux86_64-poky-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/iscsi.c:989:7: error: 'SERVICE_ACTION_IN' undeclared (first use in this function)
-|   case SERVICE_ACTION_IN:
--- CUT --
 
-Reference:
-https://github.com/torvalds/linux/commit/eb846d9f147455e4e5e1863bfb5e31974bb69b7c
+The original patch is at
+http://launchpadlibrarian.net/218100509/iscsitarget_1.4.20.3+svn499-0ubuntu2_1.4.20.3+svn499-0ubuntu2.1.diff.gz,
+those changes were taken using #ifs, inorder to allow compilation of 
+iscsitarget package with linux kernels < 3.19.
 
-3. In linux v3.19 and above, f_dentry member has been removed from 
-'struct file' structure.
-
-error snippet:
--- snip --
-| /CGE7_SHDD/project_yocto_1.8/poky/build/tmp/work/qemux86_64-poky-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/conn.c: In function 'iet_socket_bind':
-| /CGE7_SHDD/project_yocto_1.8/poky/build/tmp/work/qemux86_64-poky-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/conn.c:130:34: error: 'struct file' has no member named 'f_dentry'
-|   conn->sock = SOCKET_I(conn->file->f_dentry->d_inode);
--- CUT --
-
-new helper function file_inode(file) should be used instead.
-
-References:
-1. https://github.com/torvalds/linux/commit/78d28e651f97866d608d9b41f8ad291e65d47dd5
-2. https://github.com/torvalds/linux/commit/496ad9aa8ef448058e36ca7a787c61f2e63f0f54
-
-Upstream-Status: Pending
+Upstream-Status: Submitted [http://launchpadlibrarian.net/218100509/iscsitarget_1.4.20.3+svn499-0ubuntu2_1.4.20.3+svn499-0ubuntu2.1.diff.gz]
 
 Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
 
---- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c	2015-08-24 16:13:26.481924679 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/conn.c	2015-08-24 17:27:06.897653698 +0530
-@@ -127,7 +127,11 @@ static void iet_socket_bind(struct iscsi
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/conn.c iscsitarget-1.4.20.3+svn502/kernel/conn.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c	2017-01-18 22:27:02.713167436 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/conn.c	2017-01-18 23:13:11.909214379 -0800
+@@ -129,7 +129,11 @@ static void iet_socket_bind(struct iscsi
  
  	dprintk(D_GENERIC, "%llu\n", (unsigned long long) session->sid);
  
@@ -63,8 +86,9 @@
  	conn->sock->sk->sk_user_data = conn;
  
  	write_lock_bh(&conn->sock->sk->sk_callback_lock);
---- iscsitarget-1.4.20.3+svn502_org/kernel/file-io.c	2015-08-24 16:13:26.481924679 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/file-io.c	2015-08-24 17:30:54.390131100 +0530
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/file-io.c iscsitarget-1.4.20.3+svn502/kernel/file-io.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/file-io.c	2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/file-io.c	2017-01-18 23:54:38.505717079 -0800
 @@ -69,7 +69,11 @@ static int fileio_make_request(struct ie
  static int fileio_sync(struct iet_volume *lu, struct tio *tio)
  {
@@ -89,9 +113,81 @@
  
  	if (S_ISREG(inode->i_mode))
  		;
---- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.c	2015-08-24 16:13:26.481924679 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.c	2015-08-24 17:33:50.950490156 +0530
-@@ -986,7 +986,11 @@ static void scsi_cmnd_start(struct iscsi
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.c iscsitarget-1.4.20.3+svn502/kernel/iscsi.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.c	2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.c	2017-01-18 23:37:36.462970326 -0800
+@@ -489,8 +489,12 @@ static void cmnd_skip_pdu(struct iscsi_c
+ 	}
+ 	conn->read_iov[i].iov_base = addr;
+ 	conn->read_iov[i].iov_len = size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++	iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, ++i, conn->read_size);
++#else
+ 	conn->read_msg.msg_iov = conn->read_iov;
+ 	conn->read_msg.msg_iovlen = ++i;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ }
+ 
+ static void iscsi_cmnd_reject(struct iscsi_cmnd *req, int reason)
+@@ -718,7 +722,9 @@ static int cmnd_recv_pdu(struct iscsi_co
+ 	idx = offset >> PAGE_CACHE_SHIFT;
+ 	offset &= ~PAGE_CACHE_MASK;
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ 	conn->read_msg.msg_iov = conn->read_iov;
++#endif	/* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ 	conn->read_size = size = (size + 3) & -4;
+ 	conn->read_overflow = 0;
+ 
+@@ -730,16 +736,25 @@ static int cmnd_recv_pdu(struct iscsi_co
+ 		conn->read_iov[i].iov_base =  addr + offset;
+ 		if (offset + size <= PAGE_CACHE_SIZE) {
+ 			conn->read_iov[i].iov_len = size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++			iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, ++i, conn->read_size);
++#else
+ 			conn->read_msg.msg_iovlen = ++i;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ 			break;
+ 		}
+ 		conn->read_iov[i].iov_len = PAGE_CACHE_SIZE - offset;
+ 		size -= conn->read_iov[i].iov_len;
+ 		offset = 0;
+ 		if (++i >= ISCSI_CONN_IOV_MAX) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ 			conn->read_msg.msg_iovlen = i;
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ 			conn->read_overflow = size;
+ 			conn->read_size -= size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++			iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, i, conn->read_size);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ 			break;
+ 		}
+ 
+@@ -918,7 +933,9 @@ static int nop_out_start(struct iscsi_co
+ 
+ 	if ((size = cmnd->pdu.datasize)) {
+ 		size = (size + 3) & -4;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ 		conn->read_msg.msg_iov = conn->read_iov;
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ 		if (cmnd->pdu.bhs.itt != cpu_to_be32(ISCSI_RESERVED_TAG)) {
+ 			struct tio *tio;
+ 			int pg_cnt = get_pgcnt(size);
+@@ -946,7 +963,11 @@ static int nop_out_start(struct iscsi_co
+ 		}
+ 		assert(!size);
+ 		conn->read_overflow = size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++		iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, i, conn->read_size);
++#else
+ 		conn->read_msg.msg_iovlen = i;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ 	}
+ 
+ out:
+@@ -986,7 +1007,11 @@ static void scsi_cmnd_start(struct iscsi
  		set_cmnd_lunit(req);
  
  	switch (req_hdr->scb[0]) {
@@ -103,61 +199,93 @@
  		if ((req_hdr->scb[1] & 0x1f) != 0x10)
  			goto error;
  	case INQUIRY:
---- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h	2015-08-24 16:13:26.481924679 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.h	2015-08-24 17:35:31.354690051 +0530
-@@ -257,7 +257,11 @@ struct iscsi_conn {
- 	struct timer_list nop_timer;
- 
- 	struct iscsi_cmnd *read_cmnd;
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c iscsitarget-1.4.20.3+svn502/kernel/nthread.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c	2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/nthread.c	2017-01-18 23:45:03.291033881 -0800
+@@ -42,9 +42,14 @@ static inline void iscsi_conn_init_read(
+ 	len = (len + 3) & -4; // XXX ???
+ 	conn->read_iov[0].iov_base = data;
+ 	conn->read_iov[0].iov_len = len;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ 	conn->read_msg.msg_iov = conn->read_iov;
+ 	conn->read_msg.msg_iovlen = 1;
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ 	conn->read_size = (len + 3) & -4;
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+	struct user_msghdr read_msg;
-+#else
- 	struct msghdr read_msg;
++	iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, 1, conn->read_size);
 +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- 	struct iovec read_iov[ISCSI_CONN_IOV_MAX];
- 	u32 read_size;
- 	u32 read_overflow;
---- iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c	2015-08-24 16:13:26.481924679 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/nthread.c	2015-08-24 17:41:56.187428925 +0530
-@@ -80,8 +80,11 @@ static int is_data_available(struct iscs
- 	set_fs(oldfs);
- 	return (res >= 0) ? avail : res;
  }
--
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+static void forward_iov(struct user_msghdr *msg, int len)
-+#else
+ 
+ static void iscsi_conn_read_ahs(struct iscsi_conn *conn, struct iscsi_cmnd *cmnd)
+@@ -83,14 +88,31 @@ static int is_data_available(struct iscs
+ 
  static void forward_iov(struct msghdr *msg, int len)
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
  {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++	struct iovec *iov;
++
++	while (msg->msg_iter.iov->iov_len <= len) {
++		len -= msg->msg_iter.iov->iov_len;
++		msg->msg_iter.iov++;
++		msg->msg_iter.nr_segs--;
++	}
++#else
  	while (msg->msg_iov->iov_len <= len) {
  		len -= msg->msg_iov->iov_len;
-@@ -96,7 +99,11 @@ static void forward_iov(struct msghdr *m
- static int do_recv(struct iscsi_conn *conn, int state)
- {
- 	mm_segment_t oldfs;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+	struct user_msghdr msg;
-+#else
- 	struct msghdr msg;
+ 		msg->msg_iov++;
+ 		msg->msg_iovlen--;
+ 	}
 +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++	/* XXX: discards const ... */
++	iov = msg->msg_iter.iov;
++	iov->iov_base = (char *) msg->msg_iter.iov->iov_base + len;
++	iov->iov_len -= len;
++#else
+ 	msg->msg_iov->iov_base = (char *) msg->msg_iov->iov_base + len;
+ 	msg->msg_iov->iov_len -= len;
++#endif	/* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ }
+ 
+ static int do_recv(struct iscsi_conn *conn, int state)
+@@ -98,6 +120,9 @@ static int do_recv(struct iscsi_conn *co
+ 	mm_segment_t oldfs;
+ 	struct msghdr msg;
  	struct iovec iov[ISCSI_CONN_IOV_MAX];
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++	size_t iovlen = ISCSI_CONN_IOV_MAX;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
  	int i, len, res;
  
-@@ -461,7 +468,11 @@ static void exit_tx(struct iscsi_conn *c
- static int tx_ddigest(struct iscsi_cmnd *cmnd, int state)
- {
- 	int res, rest = cmnd->conn->write_size;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+	struct user_msghdr msg = {.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT};
-+#else
- 	struct msghdr msg = {.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT};
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- 	struct kvec iov;
+ 	if (!test_bit(CONN_ACTIVE, &conn->state)) {
+@@ -110,12 +135,23 @@ static int do_recv(struct iscsi_conn *co
+ 		goto out;
+ 	}
  
- 	iov.iov_base = (char *) (&cmnd->ddigest) + (sizeof(u32) - rest);
---- iscsitarget-1.4.20.3+svn502_org/kernel/target_disk.c	2015-08-24 16:13:26.481924679 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/target_disk.c	2015-08-24 17:43:42.167625159 +0530
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++	if (conn->read_msg.msg_iter.nr_segs < iovlen)
++		iovlen = conn->read_msg.msg_iter.nr_segs;
++
++	for (i = 0, len = 0; i < iovlen; i++) {
++		iov[i] = conn->read_msg.msg_iter.iov[i];
++		len += iov[i].iov_len;
++	}
++	iov_iter_init(&msg.msg_iter, READ, iov, iovlen, len);
++#else
+ 	msg.msg_iov = iov;
+ 	msg.msg_iovlen = min_t(size_t, conn->read_msg.msg_iovlen, ISCSI_CONN_IOV_MAX);
+ 	for (i = 0, len = 0; i < msg.msg_iovlen; i++) {
+ 		iov[i] = conn->read_msg.msg_iov[i];
+ 		len += iov[i].iov_len;
+ 	}
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ 
+ 	oldfs = get_fs();
+ 	set_fs(get_ds());
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/target_disk.c iscsitarget-1.4.20.3+svn502/kernel/target_disk.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/target_disk.c	2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/target_disk.c	2017-01-18 23:45:51.451010417 -0800
 @@ -606,7 +606,11 @@ static int disk_execute_cmnd(struct iscs
  	case REQUEST_SENSE:
  		send_data_rsp(cmnd, build_request_sense_response);
@@ -166,17 +294,18 @@
 +	case SERVICE_ACTION_IN_16:
 +#else
  	case SERVICE_ACTION_IN:
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */	
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
  		send_data_rsp(cmnd, build_service_action_in_response);
  		break;
  	case READ_6:
---- iscsitarget-1.4.20.3+svn502_org/kernel/volume.c	2015-08-24 16:13:26.477924674 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/volume.c	2015-08-24 18:28:15.697074780 +0530
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/volume.c iscsitarget-1.4.20.3+svn502/kernel/volume.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/volume.c	2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/volume.c	2017-01-18 23:47:07.957561600 -0800
 @@ -398,7 +398,11 @@ int is_volume_reserved(struct iet_volume
  		case READ_CAPACITY:
  			/* allowed commands when reserved */
  			break;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)			
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
 +		case SERVICE_ACTION_IN_16:
 +#else
  		case SERVICE_ACTION_IN:
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb b/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb
index 7279bc6..5c1e38e 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb
@@ -13,7 +13,8 @@
            file://fix-errors-observed-with-linux-3.19-and-greater.patch \
            file://access-sk_v6_daddr-iff-IPV6-defined.patch \
            file://build_with_updated_bio_struct_of_linux_v4.3_and_above.patch \
-           file://build_with_updated_interfaces_of_linux_v4.8_and_above.patch"
+           file://build_with_updated_interfaces_of_linux_v4.8_and_above.patch \
+           file://fix-call-trace-of-ahash-API-calling.patch"
 
 SRC_URI[md5sum] = "ef9bc823bbabd3c772208c00d5f2d089"
 SRC_URI[sha256sum] = "d3196ccb78a43266dce28587bfe30d8ab4db7566d7bce96057dfbb84100babb5"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/arno-iptables-firewall/arno-iptables-firewall_2.0.1g.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/arno-iptables-firewall/arno-iptables-firewall_2.0.1g.bb
new file mode 100644
index 0000000..6fd0aff
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/arno-iptables-firewall/arno-iptables-firewall_2.0.1g.bb
@@ -0,0 +1,35 @@
+SUMMARY = "IPTables based firewall scripts"
+HOMEPAGE = "http://rocky.eld.leidenuniv.nl/joomla/index.php?option=com_content&view=article&id=45&Itemid=63"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://gpl_license.txt;md5=11c7b65c4a4acb9d5175f7e9bf99c403"
+
+SRC_URI = "http://rocky.eld.leidenuniv.nl/arno-iptables-firewall/${BPN}_${PV}.tar.gz \
+          "
+SRC_URI[md5sum] = "77eba7f148bf2840a3e35a6f50c9c353"
+SRC_URI[sha256sum] = "0bafd85ddc235752250eaec0c7fdb21e530912483f6807a97f86158ed2d301f7"
+
+S = "${WORKDIR}/${BPN}_${PV}"
+
+inherit systemd
+
+do_install() {
+	install -d ${D}${sysconfdir} ${D}${sbindir} ${D}${bindir} ${D}${systemd_unitdir}/system ${D}${sysconfdir}/init.d
+	install -d ${D}${datadir}/arno-iptables-firewall ${D}${sysconfdir}/arno-iptables-firewall
+	cp -r ${S}${sysconfdir}/arno-iptables-firewall ${D}${sysconfdir}/
+	install -m 0755 ${S}${sysconfdir}/init.d/arno-iptables-firewall ${D}${bindir}
+	install -m 0755 ${S}/bin/arno-iptables-firewall ${D}${sbindir}
+	install -m 0755 ${S}/bin/arno-fwfilter ${D}${bindir}
+	cp -r ${S}/share/arno-iptables-firewall/* ${D}${datadir}/arno-iptables-firewall
+	cp -r ${S}/etc/arno-iptables-firewall/* ${D}${sysconfdir}/arno-iptables-firewall
+	install -m 0644 ${S}/${systemd_unitdir}/system/arno-iptables-firewall.service ${D}${systemd_unitdir}/system
+	sed -i -e 's%/usr/local/sbin%${bindir}%g' ${D}${systemd_unitdir}/system/arno-iptables-firewall.service
+	sed -i -e 's%/usr/local/sbin%${sbindir}%g' ${D}${bindir}/arno-iptables-firewall
+	sed -i -e 's%/usr/local%${exec_prefix}%g' ${D}${sysconfdir}/arno-iptables-firewall/firewall.conf
+	sed -i -e 's%#!/bin/bash%#!/bin/sh%g' ${D}${bindir}/arno-fwfilter
+	sed -i -e 's%#!/bin/bash%#!/bin/sh%g' ${D}${datadir}/arno-iptables-firewall/plugins/traffic-accounting-helper
+	sed -i -e 's%#!/bin/bash%#!/bin/sh%g' ${D}${datadir}/arno-iptables-firewall/plugins/dyndns-host-open-helper
+}
+
+SYSTEMD_SERVICE_${PN} = "arno-iptables-firewall.service"
+FILES_${PN} += "${systemd_unitdir}/system/arno-iptables-firewall.service"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.2.bb
deleted file mode 100644
index 7b11d20..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.2.bb
+++ /dev/null
@@ -1,33 +0,0 @@
-SUMMARY = "Connection tracking userspace tools for Linux"
-SECTION = "net"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
-DEPENDS = "libnfnetlink libnetfilter-conntrack libnetfilter-cttimeout \
-           libnetfilter-cthelper libnetfilter-queue bison-native"
-
-SRC_URI = " \
-    http://www.netfilter.org/projects/conntrack-tools/files/conntrack-tools-${PV}.tar.bz2;name=tar \
-    file://conntrack-failover \
-    file://init \
-    file://0001-conntrackd-build-fix-crash-when-optional-kernel-modu.patch \
-"
-SRC_URI[tar.md5sum] = "b1f9d006e7bf000a77395ff7cd3fac16"
-SRC_URI[tar.sha256sum] = "e5c423dc077f9ca8767eaa6cf40446943905711c6a8fe27f9cc1977d4d6aa11e"
-
-inherit autotools-brokensep update-rc.d pkgconfig
-
-INITSCRIPT_NAME = "conntrackd"
-
-do_install_append() {
-    install -d ${D}/${sysconfdir}/conntrackd
-    install -d ${D}/${sysconfdir}/init.d
-    install -m 0644 doc/sync/ftfw/conntrackd.conf ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample
-    install -m 0755 ${WORKDIR}/conntrack-failover ${D}/${sysconfdir}/init.d/conntrack-failover
-    install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/conntrackd
-
-    # Fix hardcoded paths in scripts
-    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd
-    sed -i 's!/etc/!${sysconfdir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd
-    sed -i 's!/var/!${localstatedir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample
-    sed -i 's!^export PATH=.*!export PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}/${sysconfdir}/init.d/conntrackd
-}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.4.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.4.bb
new file mode 100644
index 0000000..8b3490d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.4.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Connection tracking userspace tools for Linux"
+SECTION = "net"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+DEPENDS = "libnfnetlink libnetfilter-conntrack libnetfilter-cttimeout \
+           libnetfilter-cthelper libnetfilter-queue bison-native"
+
+DEPENDS_append_libc-musl = " libtirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
+SRC_URI = "http://www.netfilter.org/projects/conntrack-tools/files/conntrack-tools-${PV}.tar.bz2;name=tar \
+    file://conntrack-failover \
+    file://init \
+"
+SRC_URI[tar.md5sum] = "acd9e0b27cf16ae3092ba900e4d7560e"
+SRC_URI[tar.sha256sum] = "b7caf4fcc4c03575df57d25e5216584d597fd916c891f191dac616ce68bdba6c"
+
+inherit autotools update-rc.d pkgconfig
+
+INITSCRIPT_NAME = "conntrackd"
+
+do_install_append() {
+    install -d ${D}/${sysconfdir}/conntrackd
+    install -d ${D}/${sysconfdir}/init.d
+    install -m 0644 ${S}/doc/sync/ftfw/conntrackd.conf ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample
+    install -m 0755 ${WORKDIR}/conntrack-failover ${D}/${sysconfdir}/init.d/conntrack-failover
+    install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/conntrackd
+
+    # Fix hardcoded paths in scripts
+    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd
+    sed -i 's!/etc/!${sysconfdir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd
+    sed -i 's!/var/!${localstatedir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample
+    sed -i 's!^export PATH=.*!export PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}/${sysconfdir}/init.d/conntrackd
+}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/0001-conntrackd-build-fix-crash-when-optional-kernel-modu.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/0001-conntrackd-build-fix-crash-when-optional-kernel-modu.patch
deleted file mode 100644
index a7ab6d6..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/0001-conntrackd-build-fix-crash-when-optional-kernel-modu.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From c392c159605956c7bd4a264ab4490e2b2704c0cd Mon Sep 17 00:00:00 2001
-From: Pablo Neira Ayuso <pablo@netfilter.org>
-Date: Fri, 13 Jun 2014 12:53:17 +0200
-Subject: [PATCH] conntrackd: build: fix crash when optional kernel modules are
- not loaded
-
-Upstream-Status: Backport
-
-Fix a possible crash if conntrackd sees DCCP, SCTP and ICMPv6 traffic
-and the corresponding kernel modules that track this traffic are not
-available.
-
-Fixes: http://bugzilla.netfilter.org/show_bug.cgi?id=910
-Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
----
- src/build.c | 22 +++++++++++++---------
- 1 file changed, 13 insertions(+), 9 deletions(-)
-
-diff --git a/src/build.c b/src/build.c
-index 5799b51..9ba8b57 100644
---- a/src/build.c
-+++ b/src/build.c
-@@ -105,14 +105,14 @@ static enum nf_conntrack_attr nat_type[] =
- 	  ATTR_ORIG_NAT_SEQ_OFFSET_AFTER, ATTR_REPL_NAT_SEQ_CORRECTION_POS,
- 	  ATTR_REPL_NAT_SEQ_OFFSET_BEFORE, ATTR_REPL_NAT_SEQ_OFFSET_AFTER };
- 
-+/* ICMP, UDP and TCP are always loaded with nf_conntrack_ipv4 */
- static void build_l4proto_tcp(const struct nf_conntrack *ct, struct nethdr *n)
- {
--	ct_build_group(ct, ATTR_GRP_ORIG_PORT, n, NTA_PORT,
--		      sizeof(struct nfct_attr_grp_port));
--
- 	if (!nfct_attr_is_set(ct, ATTR_TCP_STATE))
- 		return;
- 
-+	ct_build_group(ct, ATTR_GRP_ORIG_PORT, n, NTA_PORT,
-+		      sizeof(struct nfct_attr_grp_port));
- 	ct_build_u8(ct, ATTR_TCP_STATE, n, NTA_TCP_STATE);
- 	if (CONFIG(sync).tcp_window_tracking) {
- 		ct_build_u8(ct, ATTR_TCP_WSCALE_ORIG, n, NTA_TCP_WSCALE_ORIG);
-@@ -122,12 +122,12 @@ static void build_l4proto_tcp(const struct nf_conntrack *ct, struct nethdr *n)
- 
- static void build_l4proto_sctp(const struct nf_conntrack *ct, struct nethdr *n)
- {
--	ct_build_group(ct, ATTR_GRP_ORIG_PORT, n, NTA_PORT,
--		      sizeof(struct nfct_attr_grp_port));
--
-+	/* SCTP is optional, make sure nf_conntrack_sctp is loaded */
- 	if (!nfct_attr_is_set(ct, ATTR_SCTP_STATE))
- 		return;
- 
-+	ct_build_group(ct, ATTR_GRP_ORIG_PORT, n, NTA_PORT,
-+		      sizeof(struct nfct_attr_grp_port));
- 	ct_build_u8(ct, ATTR_SCTP_STATE, n, NTA_SCTP_STATE);
- 	ct_build_u32(ct, ATTR_SCTP_VTAG_ORIG, n, NTA_SCTP_VTAG_ORIG);
- 	ct_build_u32(ct, ATTR_SCTP_VTAG_REPL, n, NTA_SCTP_VTAG_REPL);
-@@ -135,18 +135,22 @@ static void build_l4proto_sctp(const struct nf_conntrack *ct, struct nethdr *n)
- 
- static void build_l4proto_dccp(const struct nf_conntrack *ct, struct nethdr *n)
- {
--	ct_build_group(ct, ATTR_GRP_ORIG_PORT, n, NTA_PORT,
--		      sizeof(struct nfct_attr_grp_port));
--
-+	/* DCCP is optional, make sure nf_conntrack_dccp is loaded */
- 	if (!nfct_attr_is_set(ct, ATTR_DCCP_STATE))
- 		return;
- 
-+	ct_build_group(ct, ATTR_GRP_ORIG_PORT, n, NTA_PORT,
-+		      sizeof(struct nfct_attr_grp_port));
- 	ct_build_u8(ct, ATTR_DCCP_STATE, n, NTA_DCCP_STATE);
- 	ct_build_u8(ct, ATTR_DCCP_ROLE, n, NTA_DCCP_ROLE);
- }
- 
- static void build_l4proto_icmp(const struct nf_conntrack *ct, struct nethdr *n)
- {
-+	/* This is also used by ICMPv6 and nf_conntrack_ipv6 is optional */
-+	if (!nfct_attr_is_set(ct, ATTR_ICMP_TYPE))
-+		return;
-+
- 	ct_build_u8(ct, ATTR_ICMP_TYPE, n, NTA_ICMP_TYPE);
- 	ct_build_u8(ct, ATTR_ICMP_CODE, n, NTA_ICMP_CODE);
- 	ct_build_u16(ct, ATTR_ICMP_ID, n, NTA_ICMP_ID);
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch
new file mode 100644
index 0000000..90b6979
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch
@@ -0,0 +1,45 @@
+From dd35afc9ce1004128a754d5eeb8c5c2cb32ae420 Mon Sep 17 00:00:00 2001
+From: Bart De Schuymer <bdschuym@pandora.be>
+Date: Tue, 3 Jul 2012 18:47:32 +0000
+Subject: [PATCH 01/10] add RARP and update iana url
+
+---
+ ethertypes | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/ethertypes b/ethertypes
+index 5e700f6..813177b 100644
+--- a/ethertypes
++++ b/ethertypes
+@@ -5,6 +5,7 @@
+ #
+ # This list could be found on:
+ #         http://www.iana.org/assignments/ethernet-numbers
++#         http://www.iana.org/assignments/ieee-802-numbers
+ #
+ # <name>    <hexnumber> <alias1>...<alias35> #Comment
+ #
+@@ -21,15 +22,16 @@ LAT		6004			# DEC LAT
+ DIAG		6005			# DEC Diagnostics
+ CUST		6006			# DEC Customer use
+ SCA		6007			# DEC Systems Comms Arch
+-TEB		6558             	# Trans Ether Bridging   [RFC1701]
+-RAW_FR  	6559                   	# Raw Frame Relay        [RFC1701]
++TEB		6558			# Trans Ether Bridging   [RFC1701]
++RAW_FR  	6559			# Raw Frame Relay        [RFC1701]
++RARP		8035			# Reverse ARP            [RFC903]
+ AARP		80F3			# Appletalk AARP
+-ATALK		809B                  	# Appletalk
++ATALK		809B			# Appletalk
+ 802_1Q		8100	8021q 1q 802.1q	dot1q # 802.1Q Virtual LAN tagged frame
+ IPX		8137			# Novell IPX
+ NetBEUI		8191			# NetBEUI
+ IPv6		86DD	ip6 		# IP version 6
+-PPP		880B                    # PPP
++PPP		880B			# PPP
+ ATMMPOA		884C			# MultiProtocol over ATM
+ PPP_DISC	8863			# PPPoE discovery messages
+ PPP_SES		8864			# PPPoE session messages
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch
new file mode 100644
index 0000000..87b0e9b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch
@@ -0,0 +1,25 @@
+From 2a5333fc8b4825251adfb717d980d89cefde38d6 Mon Sep 17 00:00:00 2001
+From: Petri Gynther <petri.gynther@gmail.com>
+Date: Sun, 24 Feb 2013 10:56:59 +0100
+Subject: [PATCH 02/10] fix compilation warning
+
+---
+ communication.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/communication.c b/communication.c
+index 62ed667..ba058c0 100644
+--- a/communication.c
++++ b/communication.c
+@@ -282,7 +282,7 @@ static int store_counters_in_file(char *filename, struct ebt_u_replace *repl)
+ 	}
+ close_file:
+ 	fclose(file);
+-	return 0;
++	return ret;
+ }
+ 
+ /* Gets executed after ebt_deliver_table. Delivers the counters to the kernel
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch
new file mode 100644
index 0000000..c8573a4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch
@@ -0,0 +1,25 @@
+From a6faf3b50d6af4768b7b853cb536944fb18e1450 Mon Sep 17 00:00:00 2001
+From: Bart De Schuymer <bdschuym@pandora.be>
+Date: Wed, 3 Jul 2013 22:12:47 +0200
+Subject: [PATCH 03/10] add info about -Wl,-no-as-needed
+
+---
+ INSTALL | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/INSTALL b/INSTALL
+index 4a05c67..e90d5c1 100644
+--- a/INSTALL
++++ b/INSTALL
+@@ -39,6 +39,8 @@ That's all
+ You can also use a base directory different from the root directory (/),
+ using the DESTDIR option. See the Makefile for more details.
+ 
++You might need to set LDFLAGS=-Wl,-no-as-needed to build ebtables correctly
++on your system.
+ 
+ ADDITIONAL PROGRAMS:
+ ----------------------
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch
new file mode 100644
index 0000000..d8f2795
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch
@@ -0,0 +1,28 @@
+From b0617af37b8b1aafb43e8019135bea44c2d94c28 Mon Sep 17 00:00:00 2001
+From: Luis Fernando <tdthp@terra.com.br>
+Date: Wed, 3 Jul 2013 22:19:55 +0200
+Subject: [PATCH 04/10] workaround for kernel regression bug: IPv6
+ source/destination addresses are potentially not matched correctly
+
+---
+ extensions/ebt_ip6.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c
+index 0465e77..bbdc4ae 100644
+--- a/extensions/ebt_ip6.c
++++ b/extensions/ebt_ip6.c
+@@ -312,6 +312,10 @@ static void init(struct ebt_entry_match *match)
+ 
+ 	ipinfo->invflags = 0;
+ 	ipinfo->bitmask = 0;
++	memset(ipinfo->saddr.s6_addr, 0, sizeof(ipinfo->saddr.s6_addr));
++	memset(ipinfo->smsk.s6_addr, 0, sizeof(ipinfo->smsk.s6_addr));
++	memset(ipinfo->daddr.s6_addr, 0, sizeof(ipinfo->daddr.s6_addr));
++	memset(ipinfo->dmsk.s6_addr, 0, sizeof(ipinfo->dmsk.s6_addr));
+ }
+ 
+ #define OPT_SOURCE 0x01
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch
new file mode 100644
index 0000000..9585fd2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch
@@ -0,0 +1,75 @@
+From 15d3ab8a4a167dc44396b003d2ec01841949972f Mon Sep 17 00:00:00 2001
+From: Sanket Shah <sanket.shah@cyberoam.com>
+Date: Wed, 31 Jul 2013 21:40:08 +0200
+Subject: [PATCH 05/10] Add --noflush command line support for ebtables-restore
+
+---
+ ebtables-restore.c | 29 +++++++++++++++++++++++++----
+ 1 file changed, 25 insertions(+), 4 deletions(-)
+
+diff --git a/ebtables-restore.c b/ebtables-restore.c
+index ea02960..bb4d0cf 100644
+--- a/ebtables-restore.c
++++ b/ebtables-restore.c
+@@ -22,13 +22,25 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <unistd.h>
++#include <getopt.h>
+ #include "include/ebtables_u.h"
+ 
++static const struct option options[] = {
++	{.name = "noflush", .has_arg = 0, .val = 'n'},
++	{ 0 }
++};
++
+ static struct ebt_u_replace replace[3];
+ void ebt_early_init_once();
+ 
+ #define OPT_KERNELDATA  0x800 /* Also defined in ebtables.c */
+ 
++static void print_usage()
++{
++	fprintf(stderr, "Usage: ebtables-restore [ --noflush ]\n");
++	exit(1);
++}
++
+ static void copy_table_names()
+ {
+ 	strcpy(replace[0].name, "filter");
+@@ -41,11 +53,20 @@ static void copy_table_names()
+ int main(int argc_, char *argv_[])
+ {
+ 	char *argv[EBTD_ARGC_MAX], cmdline[EBTD_CMDLINE_MAXLN];
+-	int i, offset, quotemode = 0, argc, table_nr = -1, line = 0, whitespace;
++	int i, offset, quotemode = 0, argc, table_nr = -1, line = 0, whitespace, c, flush = 1;
+ 	char ebtables_str[] = "ebtables";
+ 
+-	if (argc_ != 1)
+-		ebtrest_print_error("options are not supported");
++	while ((c = getopt_long(argc_, argv_, "n", options, NULL)) != -1) {
++		switch(c) {
++			case 'n':
++				flush = 0;
++				break;
++			default:
++				print_usage();
++				break;
++		}
++	}
++
+ 	ebt_silent = 0;
+ 	copy_table_names();
+ 	ebt_early_init_once();
+@@ -68,7 +89,7 @@ int main(int argc_, char *argv_[])
+ 				ebtrest_print_error("table '%s' was not recognized", cmdline+1);
+ 			table_nr = i;
+ 			replace[table_nr].command = 11;
+-			ebt_get_kernel_table(&replace[table_nr], 1);
++			ebt_get_kernel_table(&replace[table_nr], flush);
+ 			replace[table_nr].command = 0;
+ 			replace[table_nr].flags = OPT_KERNELDATA; /* Prevent do_command from initialising replace */
+ 			continue;
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch
new file mode 100644
index 0000000..21f8e58
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch
@@ -0,0 +1,69 @@
+From 85a0f6d77a9d5c0e7ef7948395f0f6b1612dc987 Mon Sep 17 00:00:00 2001
+From: Bart De Schuymer <bdschuym@pandora.be>
+Date: Mon, 14 Apr 2014 22:04:55 +0200
+Subject: [PATCH 06/10] don't print IPv6 mask if it's all ones (based on patch
+ by Mariusz Mazur <mmazur at axeos.com>)
+
+---
+ extensions/ebt_ip6.c |  4 ++--
+ include/ebtables_u.h |  1 +
+ useful_functions.c   | 13 +++++++++++++
+ 3 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c
+index bbdc4ae..e3e0956 100644
+--- a/extensions/ebt_ip6.c
++++ b/extensions/ebt_ip6.c
+@@ -449,14 +449,14 @@ static void print(const struct ebt_u_entry *entry,
+ 		if (ipinfo->invflags & EBT_IP6_SOURCE)
+ 			printf("! ");
+ 		printf("%s", ebt_ip6_to_numeric(&ipinfo->saddr));
+-		printf("/%s ", ebt_ip6_to_numeric(&ipinfo->smsk));
++		printf("%s ", ebt_ip6_mask_to_string(&ipinfo->smsk));
+ 	}
+ 	if (ipinfo->bitmask & EBT_IP6_DEST) {
+ 		printf("--ip6-dst ");
+ 		if (ipinfo->invflags & EBT_IP6_DEST)
+ 			printf("! ");
+ 		printf("%s", ebt_ip6_to_numeric(&ipinfo->daddr));
+-		printf("/%s ", ebt_ip6_to_numeric(&ipinfo->dmsk));
++		printf("%s ", ebt_ip6_mask_to_string(&ipinfo->dmsk));
+ 	}
+ 	if (ipinfo->bitmask & EBT_IP6_TCLASS) {
+ 		printf("--ip6-tclass ");
+diff --git a/include/ebtables_u.h b/include/ebtables_u.h
+index ab615c1..35a5bcc 100644
+--- a/include/ebtables_u.h
++++ b/include/ebtables_u.h
+@@ -303,6 +303,7 @@ char *ebt_mask_to_dotted(uint32_t mask);
+ void ebt_parse_ip6_address(char *address, struct in6_addr *addr, 
+ 						   struct in6_addr *msk);
+ char *ebt_ip6_to_numeric(const struct in6_addr *addrp);
++char *ebt_ip6_mask_to_string(const struct in6_addr *msk);
+ 
+ 
+ int do_command(int argc, char *argv[], int exec_style,
+diff --git a/useful_functions.c b/useful_functions.c
+index d20b68e..d14cbe9 100644
+--- a/useful_functions.c
++++ b/useful_functions.c
+@@ -411,3 +411,16 @@ char *ebt_ip6_to_numeric(const struct in6_addr *addrp)
+ 	static char buf[50+1];
+ 	return (char *)inet_ntop(AF_INET6, addrp, buf, sizeof(buf));
+ }
++
++char *ebt_ip6_mask_to_string(const struct in6_addr *msk)
++{
++   	/* /0000:0000:0000:0000:0000:000.000.000.000
++	 * /0000:0000:0000:0000:0000:0000:0000:0000 */
++	static char buf[51+1];
++	if (msk->s6_addr32[0] == 0xFFFFFFFFL && msk->s6_addr32[1] == 0xFFFFFFFFL &&
++	    msk->s6_addr32[2] == 0xFFFFFFFFL && msk->s6_addr32[3] == 0xFFFFFFFFL)
++		*buf = '\0';
++	else
++		sprintf(buf, "/%s", ebt_ip6_to_numeric(msk));
++	return buf;
++}
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch
new file mode 100644
index 0000000..6fbe7df
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch
@@ -0,0 +1,67 @@
+From a60c7d4a6d05387aceb8ae9c38390d0f9bae84a2 Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sat, 16 May 2015 12:22:39 +0200
+Subject: [PATCH 07/10] extensions: Use stdint types
+
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ extensions/ebt_ip6.c   |  4 ++--
+ extensions/ebt_limit.c | 10 +++++-----
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c
+index e3e0956..dd48547 100644
+--- a/extensions/ebt_ip6.c
++++ b/extensions/ebt_ip6.c
+@@ -53,8 +53,8 @@ static const struct option opts[] =
+ 
+ struct icmpv6_names {
+ 	const char *name;
+-	u_int8_t type;
+-	u_int8_t code_min, code_max;
++	uint8_t type;
++	uint8_t code_min, code_max;
+ };
+ 
+ static const struct icmpv6_names icmpv6_codes[] = {
+diff --git a/extensions/ebt_limit.c b/extensions/ebt_limit.c
+index ee40e5c..d189a09 100644
+--- a/extensions/ebt_limit.c
++++ b/extensions/ebt_limit.c
+@@ -59,11 +59,11 @@ static void print_help(void)
+ "                                default %u\n", EBT_LIMIT_BURST);
+ }
+ 
+-static int parse_rate(const char *rate, u_int32_t *val)
++static int parse_rate(const char *rate, uint32_t *val)
+ {
+ 	const char *delim;
+-	u_int32_t r;
+-	u_int32_t mult = 1;  /* Seconds by default. */
++	uint32_t r;
++	uint32_t mult = 1;  /* Seconds by default. */
+ 
+ 	delim = strchr(rate, '/');
+ 	if (delim) {
+@@ -151,7 +151,7 @@ static void final_check(const struct ebt_u_entry *entry,
+ struct rates
+ {
+ 	const char *name;
+-	u_int32_t mult;
++	uint32_t mult;
+ };
+ 
+ static struct rates g_rates[] =
+@@ -162,7 +162,7 @@ static struct rates g_rates[] =
+ 	{ "sec", EBT_LIMIT_SCALE }
+ };
+ 
+-static void print_rate(u_int32_t period)
++static void print_rate(uint32_t period)
+ {
+ 	unsigned int i;
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch
new file mode 100644
index 0000000..df3f521
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch
@@ -0,0 +1,48 @@
+From 6ed23c8c2bc5efc3956e7bb6155afc8f45e6ae1a Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sat, 16 May 2015 12:31:58 +0200
+Subject: [PATCH 08/10] ethernetdb.h: Remove C++ specific compiler hint macro
+ _THROW
+
+Fixes compilation with musl libc
+
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ include/ethernetdb.h | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/include/ethernetdb.h b/include/ethernetdb.h
+index 46d8bfd..1683abe 100644
+--- a/include/ethernetdb.h
++++ b/include/ethernetdb.h
+@@ -38,21 +38,20 @@ struct ethertypeent {
+ 
+ /* Open ethertype data base files and mark them as staying open even
+    after a later search if STAY_OPEN is non-zero.  */
+-extern void setethertypeent(int __stay_open) __THROW;
++extern void setethertypeent(int __stay_open);
+ 
+ /* Close ethertype data base files and clear `stay open' flag.  */
+-extern void endethertypeent(void) __THROW;
++extern void endethertypeent(void);
+ 
+ /* Get next entry from ethertype data base file.  Open data base if
+    necessary.  */
+-extern struct ethertypeent *getethertypeent(void) __THROW;
++extern struct ethertypeent *getethertypeent(void);
+ 
+ /* Return entry from ethertype data base for network with NAME.  */
+-extern struct ethertypeent *getethertypebyname(__const char *__name)
+-    __THROW;
++extern struct ethertypeent *getethertypebyname(__const char *__name);
+ 
+ /* Return entry from ethertype data base which number is PROTO.  */
+-extern struct ethertypeent *getethertypebynumber(int __ethertype) __THROW;
++extern struct ethertypeent *getethertypebynumber(int __ethertype);
+ 
+ 
+ #endif				/* ethernetdb.h */
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch
new file mode 100644
index 0000000..248582c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch
@@ -0,0 +1,48 @@
+From e6b367c0c2668341c47242d099f4d2048ae575ef Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alin=20N=C4=83stac?= <alin.nastac@gmail.com>
+Date: Thu, 22 Oct 2015 16:41:03 +0200
+Subject: [PATCH 09/10] ebtables: Allow RETURN target rules in user defined
+ chains
+
+During loop checking ebtables marks entries with '1 << NF_BR_NUMHOOKS' if
+they're called from a base chain rather than a user defined chain.
+
+This can be used by ebtables targets that can encode a special return
+value to bail out if e.g. RETURN is used from a base chain.
+
+Unfortunately, this is broken, since the '1 << NF_BR_NUMHOOKS' is also
+copied to called user-defined-chains (i.e., a user defined chain can no
+longer be distinguished from a base chain):
+
+root@OpenWrt:~# ebtables -N foo
+root@OpenWrt:~# ebtables -A OUTPUT -j foo
+root@OpenWrt:~# ebtables -A foo -j mark --mark-or 3 --mark-target RETURN
+--mark-target RETURN not allowed on base chain.
+
+This works if -A OUTPUT -j foo is omitted, but will still appear
+if we try to call foo from OUTPUT afterwards.
+
+After this patch we still reject
+'-A OUTPUT -j mark .. --mark-target RETURN'.
+
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+ libebtc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libebtc.c b/libebtc.c
+index 17ba8f2..74830ec 100644
+--- a/libebtc.c
++++ b/libebtc.c
+@@ -1102,7 +1102,7 @@ void ebt_check_for_loops(struct ebt_u_replace *replace)
+ 			/* check if we've dealt with this chain already */
+ 			if (entries2->hook_mask & (1<<i))
+ 				goto letscontinue;
+-			entries2->hook_mask |= entries->hook_mask;
++			entries2->hook_mask |= entries->hook_mask & ~(1 << NF_BR_NUMHOOKS);
+ 			/* Jump to the chain, make sure we know how to get back */
+ 			stack[sp].chain_nr = chain_nr;
+ 			stack[sp].n = j;
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch
new file mode 100644
index 0000000..a6ef9cd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch
@@ -0,0 +1,216 @@
+From b7cee37734007fced7a4d5ed586c3a9e5ad92878 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 26 Mar 2017 13:12:21 -0700
+Subject: [PATCH 10/10] Adjust header include sequence
+
+This fixes the build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ extensions/ebt_among.c    |   2 +-
+ extensions/ebt_arpreply.c |   2 +-
+ extensions/ebt_nat.c      |   2 +-
+ include/linux/if_ether.h  | 126 ----------------------------------------------
+ useful_functions.c        |   4 +-
+ 5 files changed, 5 insertions(+), 131 deletions(-)
+ delete mode 100644 include/linux/if_ether.h
+
+diff --git a/extensions/ebt_among.c b/extensions/ebt_among.c
+index f97d07e..b096847 100644
+--- a/extensions/ebt_among.c
++++ b/extensions/ebt_among.c
+@@ -12,8 +12,8 @@
+ #include <getopt.h>
+ #include <ctype.h>
+ #include <unistd.h>
+-#include "../include/ebtables_u.h"
+ #include <netinet/ether.h>
++#include "../include/ebtables_u.h"
+ #include "../include/ethernetdb.h"
+ #include <linux/if_ether.h>
+ #include <linux/netfilter_bridge/ebt_among.h>
+diff --git a/extensions/ebt_arpreply.c b/extensions/ebt_arpreply.c
+index c3757f3..c5102a4 100644
+--- a/extensions/ebt_arpreply.c
++++ b/extensions/ebt_arpreply.c
+@@ -11,8 +11,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <getopt.h>
+-#include "../include/ebtables_u.h"
+ #include <netinet/ether.h>
++#include "../include/ebtables_u.h"
+ #include <linux/netfilter_bridge/ebt_arpreply.h>
+ 
+ static int mac_supplied;
+diff --git a/extensions/ebt_nat.c b/extensions/ebt_nat.c
+index e6afbf8..8d318d1 100644
+--- a/extensions/ebt_nat.c
++++ b/extensions/ebt_nat.c
+@@ -10,8 +10,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <getopt.h>
+-#include "../include/ebtables_u.h"
+ #include <netinet/ether.h>
++#include "../include/ebtables_u.h"
+ #include <linux/netfilter_bridge/ebt_nat.h>
+ 
+ static int to_source_supplied, to_dest_supplied;
+diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
+deleted file mode 100644
+index 28a15ff..0000000
+--- a/include/linux/if_ether.h
++++ /dev/null
+@@ -1,126 +0,0 @@
+-/*
+- * INET		An implementation of the TCP/IP protocol suite for the LINUX
+- *		operating system.  INET is implemented using the  BSD Socket
+- *		interface as the means of communication with the user level.
+- *
+- *		Global definitions for the Ethernet IEEE 802.3 interface.
+- *
+- * Version:	@(#)if_ether.h	1.0.1a	02/08/94
+- *
+- * Author:	Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+- *		Donald Becker, <becker@super.org>
+- *		Alan Cox, <alan@lxorguk.ukuu.org.uk>
+- *		Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
+- *
+- *		This program is free software; you can redistribute it and/or
+- *		modify it under the terms of the GNU General Public License
+- *		as published by the Free Software Foundation; either version
+- *		2 of the License, or (at your option) any later version.
+- */
+-
+-#ifndef _LINUX_IF_ETHER_H
+-#define _LINUX_IF_ETHER_H
+-
+-#include <linux/types.h>
+-
+-/*
+- *	IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
+- *	and FCS/CRC (frame check sequence).
+- */
+-
+-#define ETH_ALEN	6		/* Octets in one ethernet addr	 */
+-#define ETH_HLEN	14		/* Total octets in header.	 */
+-#define ETH_ZLEN	60		/* Min. octets in frame sans FCS */
+-#define ETH_DATA_LEN	1500		/* Max. octets in payload	 */
+-#define ETH_FRAME_LEN	1514		/* Max. octets in frame sans FCS */
+-#define ETH_FCS_LEN	4		/* Octets in the FCS		 */
+-
+-/*
+- *	These are the defined Ethernet Protocol ID's.
+- */
+-
+-#define ETH_P_LOOP	0x0060		/* Ethernet Loopback packet	*/
+-#define ETH_P_PUP	0x0200		/* Xerox PUP packet		*/
+-#define ETH_P_PUPAT	0x0201		/* Xerox PUP Addr Trans packet	*/
+-#define ETH_P_IP	0x0800		/* Internet Protocol packet	*/
+-#define ETH_P_X25	0x0805		/* CCITT X.25			*/
+-#define ETH_P_ARP	0x0806		/* Address Resolution packet	*/
+-#define	ETH_P_BPQ	0x08FF		/* G8BPQ AX.25 Ethernet Packet	[ NOT AN OFFICIALLY REGISTERED ID ] */
+-#define ETH_P_IEEEPUP	0x0a00		/* Xerox IEEE802.3 PUP packet */
+-#define ETH_P_IEEEPUPAT	0x0a01		/* Xerox IEEE802.3 PUP Addr Trans packet */
+-#define ETH_P_DEC       0x6000          /* DEC Assigned proto           */
+-#define ETH_P_DNA_DL    0x6001          /* DEC DNA Dump/Load            */
+-#define ETH_P_DNA_RC    0x6002          /* DEC DNA Remote Console       */
+-#define ETH_P_DNA_RT    0x6003          /* DEC DNA Routing              */
+-#define ETH_P_LAT       0x6004          /* DEC LAT                      */
+-#define ETH_P_DIAG      0x6005          /* DEC Diagnostics              */
+-#define ETH_P_CUST      0x6006          /* DEC Customer use             */
+-#define ETH_P_SCA       0x6007          /* DEC Systems Comms Arch       */
+-#define ETH_P_TEB	0x6558		/* Trans Ether Bridging		*/
+-#define ETH_P_RARP      0x8035		/* Reverse Addr Res packet	*/
+-#define ETH_P_ATALK	0x809B		/* Appletalk DDP		*/
+-#define ETH_P_AARP	0x80F3		/* Appletalk AARP		*/
+-#define ETH_P_8021Q	0x8100          /* 802.1Q VLAN Extended Header  */
+-#define ETH_P_IPX	0x8137		/* IPX over DIX			*/
+-#define ETH_P_IPV6	0x86DD		/* IPv6 over bluebook		*/
+-#define ETH_P_PAUSE	0x8808		/* IEEE Pause frames. See 802.3 31B */
+-#define ETH_P_SLOW	0x8809		/* Slow Protocol. See 802.3ad 43B */
+-#define ETH_P_WCCP	0x883E		/* Web-cache coordination protocol
+-					 * defined in draft-wilson-wrec-wccp-v2-00.txt */
+-#define ETH_P_PPP_DISC	0x8863		/* PPPoE discovery messages     */
+-#define ETH_P_PPP_SES	0x8864		/* PPPoE session messages	*/
+-#define ETH_P_MPLS_UC	0x8847		/* MPLS Unicast traffic		*/
+-#define ETH_P_MPLS_MC	0x8848		/* MPLS Multicast traffic	*/
+-#define ETH_P_ATMMPOA	0x884c		/* MultiProtocol Over ATM	*/
+-#define ETH_P_LINK_CTL	0x886c		/* HPNA, wlan link local tunnel */
+-#define ETH_P_ATMFATE	0x8884		/* Frame-based ATM Transport
+-					 * over Ethernet
+-					 */
+-#define ETH_P_PAE	0x888E		/* Port Access Entity (IEEE 802.1X) */
+-#define ETH_P_AOE	0x88A2		/* ATA over Ethernet		*/
+-#define ETH_P_TIPC	0x88CA		/* TIPC 			*/
+-#define ETH_P_1588	0x88F7		/* IEEE 1588 Timesync */
+-#define ETH_P_FCOE	0x8906		/* Fibre Channel over Ethernet  */
+-#define ETH_P_FIP	0x8914		/* FCoE Initialization Protocol */
+-#define ETH_P_EDSA	0xDADA		/* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
+-
+-/*
+- *	Non DIX types. Won't clash for 1500 types.
+- */
+-
+-#define ETH_P_802_3	0x0001		/* Dummy type for 802.3 frames  */
+-#define ETH_P_AX25	0x0002		/* Dummy protocol id for AX.25  */
+-#define ETH_P_ALL	0x0003		/* Every packet (be careful!!!) */
+-#define ETH_P_802_2	0x0004		/* 802.2 frames 		*/
+-#define ETH_P_SNAP	0x0005		/* Internal only		*/
+-#define ETH_P_DDCMP     0x0006          /* DEC DDCMP: Internal only     */
+-#define ETH_P_WAN_PPP   0x0007          /* Dummy type for WAN PPP frames*/
+-#define ETH_P_PPP_MP    0x0008          /* Dummy type for PPP MP frames */
+-#define ETH_P_LOCALTALK 0x0009		/* Localtalk pseudo type 	*/
+-#define ETH_P_CAN	0x000C		/* Controller Area Network      */
+-#define ETH_P_PPPTALK	0x0010		/* Dummy type for Atalk over PPP*/
+-#define ETH_P_TR_802_2	0x0011		/* 802.2 frames 		*/
+-#define ETH_P_MOBITEX	0x0015		/* Mobitex (kaz@cafe.net)	*/
+-#define ETH_P_CONTROL	0x0016		/* Card specific control frames */
+-#define ETH_P_IRDA	0x0017		/* Linux-IrDA			*/
+-#define ETH_P_ECONET	0x0018		/* Acorn Econet			*/
+-#define ETH_P_HDLC	0x0019		/* HDLC frames			*/
+-#define ETH_P_ARCNET	0x001A		/* 1A for ArcNet :-)            */
+-#define ETH_P_DSA	0x001B		/* Distributed Switch Arch.	*/
+-#define ETH_P_TRAILER	0x001C		/* Trailer switch tagging	*/
+-#define ETH_P_PHONET	0x00F5		/* Nokia Phonet frames          */
+-#define ETH_P_IEEE802154 0x00F6		/* IEEE802.15.4 frame		*/
+-#define ETH_P_CAIF	0x00F7		/* ST-Ericsson CAIF protocol	*/
+-
+-/*
+- *	This is an Ethernet frame header.
+- */
+-
+-struct ethhdr {
+-	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
+-	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
+-	__be16		h_proto;		/* packet type ID field	*/
+-} __attribute__((packed));
+-
+-
+-#endif	/* _LINUX_IF_ETHER_H */
+diff --git a/useful_functions.c b/useful_functions.c
+index d14cbe9..c304f4d 100644
+--- a/useful_functions.c
++++ b/useful_functions.c
+@@ -22,8 +22,6 @@
+  * along with this program; if not, write to the Free Software
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+-#include "include/ebtables_u.h"
+-#include "include/ethernetdb.h"
+ #include <stdio.h>
+ #include <netinet/ether.h>
+ #include <string.h>
+@@ -33,6 +31,8 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <arpa/inet.h>
++#include "include/ebtables_u.h"
++#include "include/ethernetdb.h"
+ 
+ const unsigned char mac_type_unicast[ETH_ALEN] =   {0,0,0,0,0,0};
+ const unsigned char msk_type_unicast[ETH_ALEN] =   {1,0,0,0,0,0};
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
index e9b726c..375423d 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
@@ -18,7 +18,17 @@
            file://ebtables.common \
            file://ebtables.service \
            file://no-as-needed.patch \
-"
+           file://0001-add-RARP-and-update-iana-url.patch \
+           file://0002-fix-compilation-warning.patch \
+           file://0003-add-info-about-Wl-no-as-needed.patch \
+           file://0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch \
+           file://0005-Add-noflush-command-line-support-for-ebtables-restor.patch \
+           file://0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch \
+           file://0007-extensions-Use-stdint-types.patch \
+           file://0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch \
+           file://0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch \
+           file://0010-Adjust-header-include-sequence.patch \
+           "
 
 SRC_URI[md5sum] = "506742a3d44b9925955425a659c1a8d0"
 SRC_URI[sha256sum] = "dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9a4455d"
@@ -30,8 +40,8 @@
 python __anonymous () {
     import re
 
-    karch = d.getVar('KARCH', True)
-    multilib = d.getVar('MLPREFIX', True)
+    karch = d.getVar('KARCH')
+    multilib = d.getVar('MLPREFIX')
 
     if multilib and karch == 'powerpc64':
         searchstr = "lib.?32"
@@ -70,8 +80,10 @@
 
     # The script ebtables-save refernces perl in exec_prefix, so
     # move it to sbindir to avoid QA issue
-    install -d ${D}/${sbindir}
-    mv ${D}/${base_sbindir}/ebtables-save ${D}/${sbindir}
+    if ${base_sbindir} != ${sbindir} ; then
+       install -d ${D}/${sbindir}
+       mv ${D}/${base_sbindir}/ebtables-save ${D}/${sbindir}
+    fi
 
     # Install systemd service files
     install -d ${D}${systemd_unitdir}/system
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-Correct-typo-in-the-location-of-internal.h-in-includ.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-Correct-typo-in-the-location-of-internal.h-in-includ.patch
new file mode 100644
index 0000000..76d2d5d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-Correct-typo-in-the-location-of-internal.h-in-includ.patch
@@ -0,0 +1,26 @@
+From 32af64e1811c74292891dc4dc8455736f7d33ccf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 30 Mar 2017 13:26:56 -0700
+Subject: [PATCH] Correct typo in the location of internal.h in #include
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/libnetfilter_queue.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libnetfilter_queue.c b/src/libnetfilter_queue.c
+index 211a8ba..065d618 100644
+--- a/src/libnetfilter_queue.c
++++ b/src/libnetfilter_queue.c
+@@ -32,7 +32,7 @@
+ 
+ #include <libnfnetlink/libnfnetlink.h>
+ #include <libnetfilter_queue/libnetfilter_queue.h>
+-#include "src/internal.h"
++#include "internal.h"
+ 
+ /**
+  * \mainpage
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch
new file mode 100644
index 0000000..9e0b420
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch
@@ -0,0 +1,255 @@
+From f3e3e8fa703e88b76b22c5486277dfca3c85a24b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 10 Apr 2017 14:56:18 -0700
+Subject: [PATCH] Declare the define visivility attribute together
+
+clang ignores the visibility attribute if its not
+defined before the definition. As a result these
+symbols become hidden and consumers of this library
+fail to link due to these missing symbols
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ doxygen.cfg.in          |  2 +-
+ src/internal.h          |  5 ++---
+ src/libnetfilter_acct.c | 41 ++++++++++++++---------------------------
+ 3 files changed, 17 insertions(+), 31 deletions(-)
+
+diff --git a/doxygen.cfg.in b/doxygen.cfg.in
+index 7f4bd04..fe64d48 100644
+--- a/doxygen.cfg.in
++++ b/doxygen.cfg.in
+@@ -72,7 +72,7 @@ RECURSIVE              = YES
+ EXCLUDE                = 
+ EXCLUDE_SYMLINKS       = NO
+ EXCLUDE_PATTERNS       = */.git/* .*.d
+-EXCLUDE_SYMBOLS        = EXPORT_SYMBOL nfacct
++EXCLUDE_SYMBOLS        = nfacct
+ EXAMPLE_PATH           = 
+ EXAMPLE_PATTERNS       = 
+ EXAMPLE_RECURSIVE      = NO
+diff --git a/src/internal.h b/src/internal.h
+index f0cc2e1..e5c5ffd 100644
+--- a/src/internal.h
++++ b/src/internal.h
+@@ -3,10 +3,9 @@
+ 
+ #include "config.h"
+ #ifdef HAVE_VISIBILITY_HIDDEN
+-#	define __visible	__attribute__((visibility("default")))
+-#	define EXPORT_SYMBOL(x)	typeof(x) (x) __visible
++#	define __EXPORT	__attribute__((visibility("default")))
+ #else
+-#	define EXPORT_SYMBOL
++#	define __EXPORT
+ #endif
+ 
+ #include <endian.h>
+diff --git a/src/libnetfilter_acct.c b/src/libnetfilter_acct.c
+index b0bcf67..0220d14 100644
+--- a/src/libnetfilter_acct.c
++++ b/src/libnetfilter_acct.c
+@@ -76,21 +76,19 @@ struct nfacct {
+  * In case of success, this function returns a valid pointer, otherwise NULL
+  * s returned and errno is appropriately set.
+  */
+-struct nfacct *nfacct_alloc(void)
++struct nfacct __EXPORT *nfacct_alloc(void)
+ {
+ 	return calloc(1, sizeof(struct nfacct));
+ }
+-EXPORT_SYMBOL(nfacct_alloc);
+ 
+ /**
+  * nfacct_free - release one accounting object
+  * \param nfacct pointer to the accounting object
+  */
+-void nfacct_free(struct nfacct *nfacct)
++void __EXPORT nfacct_free(struct nfacct *nfacct)
+ {
+ 	free(nfacct);
+ }
+-EXPORT_SYMBOL(nfacct_free);
+ 
+ /**
+  * nfacct_attr_set - set one attribute of the accounting object
+@@ -98,7 +96,7 @@ EXPORT_SYMBOL(nfacct_free);
+  * \param type attribute type you want to set
+  * \param data pointer to data that will be used to set this attribute
+  */
+-void
++void __EXPORT
+ nfacct_attr_set(struct nfacct *nfacct, enum nfacct_attr_type type,
+ 		const void *data)
+ {
+@@ -126,7 +124,6 @@ nfacct_attr_set(struct nfacct *nfacct, enum nfacct_attr_type type,
+ 		break;
+ 	}
+ }
+-EXPORT_SYMBOL(nfacct_attr_set);
+ 
+ /**
+  * nfacct_attr_set_str - set one attribute the accounting object
+@@ -134,13 +131,12 @@ EXPORT_SYMBOL(nfacct_attr_set);
+  * \param type attribute type you want to set
+  * \param name string that will be used to set this attribute
+  */
+-void
++void __EXPORT
+ nfacct_attr_set_str(struct nfacct *nfacct, enum nfacct_attr_type type,
+ 		    const char *name)
+ {
+ 	nfacct_attr_set(nfacct, type, name);
+ }
+-EXPORT_SYMBOL(nfacct_attr_set_str);
+ 
+ /**
+  * nfacct_attr_set_u64 - set one attribute the accounting object
+@@ -148,20 +144,19 @@ EXPORT_SYMBOL(nfacct_attr_set_str);
+  * \param type attribute type you want to set
+  * \param value unsigned 64-bits integer
+  */
+-void
++void __EXPORT
+ nfacct_attr_set_u64(struct nfacct *nfacct, enum nfacct_attr_type type,
+ 		    uint64_t value)
+ {
+ 	nfacct_attr_set(nfacct, type, &value);
+ }
+-EXPORT_SYMBOL(nfacct_attr_set_u64);
+ 
+ /**
+  * nfacct_attr_unset - unset one attribute the accounting object
+  * \param nfacct pointer to the accounting object
+  * \param type attribute type you want to set
+  */
+-void
++void __EXPORT
+ nfacct_attr_unset(struct nfacct *nfacct, enum nfacct_attr_type type)
+ {
+ 	switch(type) {
+@@ -182,7 +177,6 @@ nfacct_attr_unset(struct nfacct *nfacct, enum nfacct_attr_type type)
+ 		break;
+ 	}
+ }
+-EXPORT_SYMBOL(nfacct_attr_unset);
+ 
+ /**
+  * nfacct_attr_get - get one attribute the accounting object
+@@ -192,7 +186,7 @@ EXPORT_SYMBOL(nfacct_attr_unset);
+  * This function returns a valid pointer to the attribute data. If a
+  * unsupported attribute is used, this returns NULL.
+  */
+-const void *nfacct_attr_get(struct nfacct *nfacct, enum nfacct_attr_type type)
++const void __EXPORT *nfacct_attr_get(struct nfacct *nfacct, enum nfacct_attr_type type)
+ {
+ 	const void *ret = NULL;
+ 
+@@ -220,7 +214,6 @@ const void *nfacct_attr_get(struct nfacct *nfacct, enum nfacct_attr_type type)
+ 	}
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nfacct_attr_get);
+ 
+ /**
+  * nfacct_attr_get_str - get one attribute the accounting object
+@@ -230,12 +223,11 @@ EXPORT_SYMBOL(nfacct_attr_get);
+  * This function returns a valid pointer to the beginning of the string.
+  * If the attribute is unsupported, this returns NULL.
+  */
+-const char *
++const char __EXPORT *
+ nfacct_attr_get_str(struct nfacct *nfacct, enum nfacct_attr_type type)
+ {
+ 	return nfacct_attr_get(nfacct, type);
+ }
+-EXPORT_SYMBOL(nfacct_attr_get_str);
+ 
+ /**
+  * nfacct_attr_get_u64 - get one attribute the accounting object
+@@ -245,12 +237,11 @@ EXPORT_SYMBOL(nfacct_attr_get_str);
+  * This function returns a unsigned 64-bits integer. If the attribute is
+  * unsupported, this returns NULL.
+  */
+-uint64_t nfacct_attr_get_u64(struct nfacct *nfacct, enum nfacct_attr_type type)
++uint64_t __EXPORT nfacct_attr_get_u64(struct nfacct *nfacct, enum nfacct_attr_type type)
+ {
+ 	const void *ret = nfacct_attr_get(nfacct, type);
+ 	return ret ? *((uint64_t *)ret) : 0;
+ }
+-EXPORT_SYMBOL(nfacct_attr_get_u64);
+ 
+ static int
+ nfacct_snprintf_plain(char *buf, size_t rem, struct nfacct *nfacct,
+@@ -424,8 +415,8 @@ err:
+  * This function returns -1 in case that some mandatory attributes are
+  * missing. On sucess, it returns 0.
+  */
+-int nfacct_snprintf(char *buf, size_t size, struct nfacct *nfacct,
+-		    uint16_t type, uint16_t flags)
++int __EXPORT nfacct_snprintf(char *buf, size_t size, struct nfacct *nfacct,
++		             uint16_t type, uint16_t flags)
+ {
+ 	int ret = 0;
+ 
+@@ -445,7 +436,6 @@ int nfacct_snprintf(char *buf, size_t size, struct nfacct *nfacct,
+ 	}
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nfacct_snprintf);
+ 
+ /**
+  * @}
+@@ -484,7 +474,7 @@ EXPORT_SYMBOL(nfacct_snprintf);
+  * - Command NFNL_MSG_ACCT_DEL, to delete one specific nfacct object (if
+  *   unused, otherwise you hit EBUSY).
+  */
+-struct nlmsghdr *
++struct nlmsghdr __EXPORT *
+ nfacct_nlmsg_build_hdr(char *buf, uint8_t cmd, uint16_t flags, uint32_t seq)
+ {
+ 	struct nlmsghdr *nlh;
+@@ -502,14 +492,13 @@ nfacct_nlmsg_build_hdr(char *buf, uint8_t cmd, uint16_t flags, uint32_t seq)
+ 
+ 	return nlh;
+ }
+-EXPORT_SYMBOL(nfacct_nlmsg_build_hdr);
+ 
+ /**
+  * nfacct_nlmsg_build_payload - build payload from accounting object
+  * \param nlh: netlink message that you want to use to add the payload.
+  * \param nfacct: pointer to a accounting object
+  */
+-void nfacct_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfacct *nfacct)
++void __EXPORT nfacct_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfacct *nfacct)
+ {
+ 	if (nfacct->bitset & (1 << NFACCT_ATTR_NAME))
+ 		mnl_attr_put_strz(nlh, NFACCT_NAME, nfacct->name);
+@@ -526,7 +515,6 @@ void nfacct_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfacct *nfacct)
+ 	if (nfacct->bitset & (1 << NFACCT_ATTR_QUOTA))
+ 		mnl_attr_put_u64(nlh, NFACCT_QUOTA, htobe64(nfacct->quota));
+ }
+-EXPORT_SYMBOL(nfacct_nlmsg_build_payload);
+ 
+ static int nfacct_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -563,7 +551,7 @@ static int nfacct_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
+  * This function returns -1 in case that some mandatory attributes are
+  * missing. On sucess, it returns 0.
+  */
+-int
++int __EXPORT
+ nfacct_nlmsg_parse_payload(const struct nlmsghdr *nlh, struct nfacct *nfacct)
+ {
+ 	struct nlattr *tb[NFACCT_MAX+1] = {};
+@@ -589,7 +577,6 @@ nfacct_nlmsg_parse_payload(const struct nlmsghdr *nlh, struct nfacct *nfacct)
+ 
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nfacct_nlmsg_parse_payload);
+ 
+ /**
+  * @}
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-queue-Declare-the-define-visivility-attribute-together.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-queue-Declare-the-define-visivility-attribute-together.patch
new file mode 100644
index 0000000..946f1b7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-queue-Declare-the-define-visivility-attribute-together.patch
@@ -0,0 +1,1229 @@
+From 06562244ac4a1a61e1a2c6b219a517658f7349bf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 10 Apr 2017 12:09:41 -0700
+Subject: [PATCH] Declare the define visivility attribute together
+
+clang ignores the visibility attribute if its not
+defined before the definition. As a result these
+symbols become hidden and consumers of this library
+fail to link due to these missing symbols
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ doxygen.cfg.in           |   2 +-
+ src/extra/ipv4.c         |  15 +++----
+ src/extra/ipv6.c         |   9 ++--
+ src/extra/pktbuff.c      |  42 ++++++------------
+ src/extra/tcp.c          |  21 +++------
+ src/extra/udp.c          |  21 +++------
+ src/internal.h           |   5 +--
+ src/libnetfilter_queue.c | 108 ++++++++++++++++-------------------------------
+ src/nlmsg.c              |  21 +++------
+ 9 files changed, 82 insertions(+), 162 deletions(-)
+
+diff --git a/doxygen.cfg.in b/doxygen.cfg.in
+index a7378ca..659abee 100644
+--- a/doxygen.cfg.in
++++ b/doxygen.cfg.in
+@@ -72,7 +72,7 @@ RECURSIVE              = YES
+ EXCLUDE                = 
+ EXCLUDE_SYMLINKS       = NO
+ EXCLUDE_PATTERNS       = 
+-EXCLUDE_SYMBOLS        = EXPORT_SYMBOL
++EXCLUDE_SYMBOLS        =
+ EXAMPLE_PATH           = 
+ EXAMPLE_PATTERNS       = 
+ EXAMPLE_RECURSIVE      = NO
+diff --git a/src/extra/ipv4.c b/src/extra/ipv4.c
+index a93d113..56d5dc7 100644
+--- a/src/extra/ipv4.c
++++ b/src/extra/ipv4.c
+@@ -32,7 +32,7 @@
+  * This funcion returns NULL if the IPv4 is malformed or the protocol version
+  * is not 4. On success, it returns a valid pointer to the IPv4 header.
+  */
+-struct iphdr *nfq_ip_get_hdr(struct pkt_buff *pktb)
++struct iphdr __EXPORTED *nfq_ip_get_hdr(struct pkt_buff *pktb)
+ {
+ 	struct iphdr *iph;
+ 	unsigned int pktlen = pktb->tail - pktb->network_header;
+@@ -53,14 +53,13 @@ struct iphdr *nfq_ip_get_hdr(struct pkt_buff *pktb)
+ 
+ 	return iph;
+ }
+-EXPORT_SYMBOL(nfq_ip_get_hdr);
+ 
+ /**
+  * nfq_ip_set_transport_header - set transport header
+  * \param pktb: pointer to network packet buffer
+  * \param iph: pointer to the IPv4 header
+  */
+-int nfq_ip_set_transport_header(struct pkt_buff *pktb, struct iphdr *iph)
++int __EXPORTED nfq_ip_set_transport_header(struct pkt_buff *pktb, struct iphdr *iph)
+ {
+ 	int doff = iph->ihl * 4;
+ 
+@@ -71,7 +70,6 @@ int nfq_ip_set_transport_header(struct pkt_buff *pktb, struct iphdr *iph)
+ 	pktb->transport_header = pktb->network_header + doff;
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nfq_ip_set_transport_header);
+ 
+ /**
+  * nfq_ip_set_checksum - set IPv4 checksum
+@@ -80,14 +78,13 @@ EXPORT_SYMBOL(nfq_ip_set_transport_header);
+  * \note Call to this function if you modified the IPv4 header to update the
+  * checksum.
+  */
+-void nfq_ip_set_checksum(struct iphdr *iph)
++void __EXPORTED nfq_ip_set_checksum(struct iphdr *iph)
+ {
+ 	uint32_t iph_len = iph->ihl * 4;
+ 
+ 	iph->check = 0;
+ 	iph->check = nfq_checksum(0, (uint16_t *)iph, iph_len);
+ }
+-EXPORT_SYMBOL(nfq_ip_set_checksum);
+ 
+ /**
+  * nfq_ip_mangle - mangle IPv4 packet buffer
+@@ -100,7 +97,7 @@ EXPORT_SYMBOL(nfq_ip_set_checksum);
+  *
+  * \note This function recalculates the IPv4 checksum (if needed).
+  */
+-int nfq_ip_mangle(struct pkt_buff *pkt, unsigned int dataoff,
++int __EXPORTED nfq_ip_mangle(struct pkt_buff *pkt, unsigned int dataoff,
+ 		  unsigned int match_offset, unsigned int match_len,
+ 		  const char *rep_buffer, unsigned int rep_len)
+ {
+@@ -116,7 +113,6 @@ int nfq_ip_mangle(struct pkt_buff *pkt, unsigned int dataoff,
+ 
+ 	return 1;
+ }
+-EXPORT_SYMBOL(nfq_ip_mangle);
+ 
+ /**
+  * nfq_pkt_snprintf_ip - print IPv4 header into buffer in iptables LOG format
+@@ -128,7 +124,7 @@ EXPORT_SYMBOL(nfq_ip_mangle);
+  * case that there is enough room in the buffer. Read snprintf manpage for more
+  * information to know more about this strange behaviour.
+  */
+-int nfq_ip_snprintf(char *buf, size_t size, const struct iphdr *iph)
++int __EXPORTED nfq_ip_snprintf(char *buf, size_t size, const struct iphdr *iph)
+ {
+ 	int ret;
+ 	struct in_addr src = { iph->saddr };
+@@ -147,7 +143,6 @@ int nfq_ip_snprintf(char *buf, size_t size, const struct iphdr *iph)
+ 
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nfq_ip_snprintf);
+ 
+ /**
+  * @}
+diff --git a/src/extra/ipv6.c b/src/extra/ipv6.c
+index 7c5dc9b..6641c6b 100644
+--- a/src/extra/ipv6.c
++++ b/src/extra/ipv6.c
+@@ -33,7 +33,7 @@
+  * This funcion returns NULL if an invalid header is found. On sucess, it
+  * returns a valid pointer to the header.
+  */
+-struct ip6_hdr *nfq_ip6_get_hdr(struct pkt_buff *pktb)
++struct ip6_hdr __EXPORTED *nfq_ip6_get_hdr(struct pkt_buff *pktb)
+ {
+ 	struct ip6_hdr *ip6h;
+ 	unsigned int pktlen = pktb->tail - pktb->network_header;
+@@ -50,7 +50,6 @@ struct ip6_hdr *nfq_ip6_get_hdr(struct pkt_buff *pktb)
+ 
+ 	return ip6h;
+ }
+-EXPORT_SYMBOL(nfq_ip6_get_hdr);
+ 
+ /**
+  * nfq_ip6_set_transport_header - set transport header pointer for IPv6 packet
+@@ -61,7 +60,7 @@ EXPORT_SYMBOL(nfq_ip6_get_hdr);
+  * This function returns 1 if the protocol has been found and the transport
+  * header has been set. Otherwise, it returns 0.
+  */
+-int nfq_ip6_set_transport_header(struct pkt_buff *pktb, struct ip6_hdr *ip6h,
++int __EXPORTED nfq_ip6_set_transport_header(struct pkt_buff *pktb, struct ip6_hdr *ip6h,
+ 				 uint8_t target)
+ {
+ 	uint8_t nexthdr = ip6h->ip6_nxt;
+@@ -115,7 +114,6 @@ int nfq_ip6_set_transport_header(struct pkt_buff *pktb, struct ip6_hdr *ip6h,
+ 	pktb->transport_header = cur;
+ 	return cur ? 1 : 0;
+ }
+-EXPORT_SYMBOL(nfq_ip6_set_transport_header);
+ 
+ /**
+  * nfq_ip6_snprintf - print IPv6 header into one buffer in iptables LOG format
+@@ -124,7 +122,7 @@ EXPORT_SYMBOL(nfq_ip6_set_transport_header);
+  * \param ip6_hdr: pointer to a valid IPv6 header.
+  *
+  */
+-int nfq_ip6_snprintf(char *buf, size_t size, const struct ip6_hdr *ip6h)
++int __EXPORTED nfq_ip6_snprintf(char *buf, size_t size, const struct ip6_hdr *ip6h)
+ {
+ 	int ret;
+ 	char src[INET6_ADDRSTRLEN];
+@@ -143,7 +141,6 @@ int nfq_ip6_snprintf(char *buf, size_t size, const struct ip6_hdr *ip6h)
+ 
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nfq_ip6_snprintf);
+ 
+ /**
+  * @}
+diff --git a/src/extra/pktbuff.c b/src/extra/pktbuff.c
+index 1c15a00..54d8244 100644
+--- a/src/extra/pktbuff.c
++++ b/src/extra/pktbuff.c
+@@ -40,7 +40,7 @@
+  *
+  * \return a pointer to a new queue handle or NULL on failure.
+  */
+-struct pkt_buff *
++struct pkt_buff __EXPORTED *
+ pktb_alloc(int family, void *data, size_t len, size_t extra)
+ {
+ 	struct pkt_buff *pktb;
+@@ -84,120 +84,108 @@ pktb_alloc(int family, void *data, size_t len, size_t extra)
+ 	}
+ 	return pktb;
+ }
+-EXPORT_SYMBOL(pktb_alloc);
+ 
+ /**
+  * pktb_data - return pointer to the beginning of the packet buffer
+  * \param pktb Pointer to packet buffer
+  */
+-uint8_t *pktb_data(struct pkt_buff *pktb)
++uint8_t __EXPORTED *pktb_data(struct pkt_buff *pktb)
+ {
+ 	return pktb->data;
+ }
+-EXPORT_SYMBOL(pktb_data);
+ 
+ /**
+  * pktb_len - return length of the packet buffer
+  * \param pktb Pointer to packet buffer
+  */
+-uint32_t pktb_len(struct pkt_buff *pktb)
++uint32_t __EXPORTED pktb_len(struct pkt_buff *pktb)
+ {
+ 	return pktb->len;
+ }
+-EXPORT_SYMBOL(pktb_len);
+ 
+ /**
+  * pktb_free - release packet buffer
+  * \param pktb Pointer to packet buffer
+  */
+-void pktb_free(struct pkt_buff *pktb)
++void __EXPORTED pktb_free(struct pkt_buff *pktb)
+ {
+ 	free(pktb);
+ }
+-EXPORT_SYMBOL(pktb_free);
+ 
+ /**
+  * pktb_push - update pointer to the beginning of the packet buffer
+  * \param pktb Pointer to packet buffer
+  */
+-void pktb_push(struct pkt_buff *pktb, unsigned int len)
++void __EXPORTED pktb_push(struct pkt_buff *pktb, unsigned int len)
+ {
+ 	pktb->data -= len;
+ 	pktb->len += len;
+ }
+-EXPORT_SYMBOL(pktb_push);
+ 
+ /**
+  * pktb_pull - update pointer to the beginning of the packet buffer
+  * \param pktb Pointer to packet buffer
+  */
+-void pktb_pull(struct pkt_buff *pktb, unsigned int len)
++void __EXPORTED pktb_pull(struct pkt_buff *pktb, unsigned int len)
+ {
+ 	pktb->data += len;
+ 	pktb->len -= len;
+ }
+-EXPORT_SYMBOL(pktb_pull);
+ 
+ /**
+  * pktb_put - add extra bytes to the tail of the packet buffer
+  * \param pktb Pointer to packet buffer
+  */
+-void pktb_put(struct pkt_buff *pktb, unsigned int len)
++void __EXPORTED pktb_put(struct pkt_buff *pktb, unsigned int len)
+ {
+ 	pktb->tail += len;
+ 	pktb->len += len;
+ }
+-EXPORT_SYMBOL(pktb_put);
+ 
+ /**
+  * pktb_trim - set new length for this packet buffer
+  * \param pktb Pointer to packet buffer
+  */
+-void pktb_trim(struct pkt_buff *pktb, unsigned int len)
++void __EXPORTED pktb_trim(struct pkt_buff *pktb, unsigned int len)
+ {
+ 	pktb->len = len;
+ }
+-EXPORT_SYMBOL(pktb_trim);
+ 
+ /**
+  * pktb_tailroom - get room in bytes in the tail of the packet buffer
+  * \param pktb Pointer to packet buffer
+  */
+-unsigned int pktb_tailroom(struct pkt_buff *pktb)
++unsigned int __EXPORTED pktb_tailroom(struct pkt_buff *pktb)
+ {
+ 	return pktb->data_len - pktb->len;
+ }
+-EXPORT_SYMBOL(pktb_tailroom);
+ 
+ /**
+  * pktb_mac_header - return pointer to layer 2 header (if any)
+  * \param pktb Pointer to packet buffer
+  */
+-uint8_t *pktb_mac_header(struct pkt_buff *pktb)
++uint8_t __EXPORTED *pktb_mac_header(struct pkt_buff *pktb)
+ {
+ 	return pktb->mac_header;
+ }
+-EXPORT_SYMBOL(pktb_mac_header);
+ 
+ /**
+  * pktb_network_header - return pointer to layer 3 header
+  * \param pktb Pointer to packet buffer
+  */
+-uint8_t *pktb_network_header(struct pkt_buff *pktb)
++uint8_t __EXPORTED *pktb_network_header(struct pkt_buff *pktb)
+ {
+ 	return pktb->network_header;
+ }
+-EXPORT_SYMBOL(pktb_network_header);
+ 
+ /**
+  * pktb_transport_header - return pointer to layer 4 header (if any)
+  * \param pktb Pointer to packet buffer
+  */
+-uint8_t *pktb_transport_header(struct pkt_buff *pktb)
++uint8_t __EXPORTED *pktb_transport_header(struct pkt_buff *pktb)
+ {
+ 	return pktb->transport_header;
+ }
+-EXPORT_SYMBOL(pktb_transport_header);
+ 
+ static int pktb_expand_tail(struct pkt_buff *pkt, int extra)
+ {
+@@ -224,7 +212,7 @@ static int enlarge_pkt(struct pkt_buff *pkt, unsigned int extra)
+ 	return 1;
+ }
+ 
+-int pktb_mangle(struct pkt_buff *pkt,
++int __EXPORTED pktb_mangle(struct pkt_buff *pkt,
+ 		 unsigned int dataoff,
+ 		 unsigned int match_offset,
+ 		 unsigned int match_len,
+@@ -258,17 +246,15 @@ int pktb_mangle(struct pkt_buff *pkt,
+ 	pkt->mangled = true;
+ 	return 1;
+ }
+-EXPORT_SYMBOL(pktb_mangle);
+ 
+ /**
+  * pktb_mangled - return true if packet has been mangled
+  * \param pktb Pointer to packet buffer
+  */
+-bool pktb_mangled(const struct pkt_buff *pkt)
++bool __EXPORTED pktb_mangled(const struct pkt_buff *pkt)
+ {
+ 	return pkt->mangled;
+ }
+-EXPORT_SYMBOL(pktb_mangled);
+ 
+ /**
+  * @}
+diff --git a/src/extra/tcp.c b/src/extra/tcp.c
+index d1cd79d..8038ce5 100644
+--- a/src/extra/tcp.c
++++ b/src/extra/tcp.c
+@@ -40,7 +40,7 @@
+  * \note You have to call nfq_ip_set_transport_header or
+  * nfq_ip6_set_transport_header first to access the TCP header.
+  */
+-struct tcphdr *nfq_tcp_get_hdr(struct pkt_buff *pktb)
++struct tcphdr __EXPORTED *nfq_tcp_get_hdr(struct pkt_buff *pktb)
+ {
+ 	if (pktb->transport_header == NULL)
+ 		return NULL;
+@@ -51,14 +51,13 @@ struct tcphdr *nfq_tcp_get_hdr(struct pkt_buff *pktb)
+ 
+ 	return (struct tcphdr *)pktb->transport_header;
+ }
+-EXPORT_SYMBOL(nfq_tcp_get_hdr);
+ 
+ /**
+  * nfq_tcp_get_payload - get the TCP packet payload
+  * \param tcph: pointer to the TCP header
+  * \param pktb: pointer to user-space network packet buffer
+  */
+-void *nfq_tcp_get_payload(struct tcphdr *tcph, struct pkt_buff *pktb)
++void __EXPORTED *nfq_tcp_get_payload(struct tcphdr *tcph, struct pkt_buff *pktb)
+ {
+ 	unsigned int len = tcph->doff * 4;
+ 
+@@ -72,47 +71,43 @@ void *nfq_tcp_get_payload(struct tcphdr *tcph, struct pkt_buff *pktb)
+ 
+ 	return pktb->transport_header + len;
+ }
+-EXPORT_SYMBOL(nfq_tcp_get_payload);
+ 
+ /**
+  * nfq_tcp_get_payload_len - get the tcp packet payload
+  * \param tcph: pointer to the TCP header
+  * \param pktb: pointer to user-space network packet buffer
+  */
+-unsigned int
++unsigned int __EXPORTED
+ nfq_tcp_get_payload_len(struct tcphdr *tcph, struct pkt_buff *pktb)
+ {
+ 	return pktb->tail - pktb->transport_header;
+ }
+-EXPORT_SYMBOL(nfq_tcp_get_payload_len);
+ 
+ /**
+  * nfq_tcp_set_checksum_ipv4 - computes IPv4/TCP packet checksum
+  * \param tcph: pointer to the TCP header
+  * \param iph: pointer to the IPv4 header
+  */
+-void
++void __EXPORTED
+ nfq_tcp_compute_checksum_ipv4(struct tcphdr *tcph, struct iphdr *iph)
+ {
+ 	/* checksum field in header needs to be zero for calculation. */
+ 	tcph->check = 0;
+ 	tcph->check = nfq_checksum_tcpudp_ipv4(iph);
+ }
+-EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv4);
+ 
+ /**
+  * nfq_tcp_set_checksum_ipv6 - computes IPv6/TCP packet checksum
+  * \param tcph: pointer to the TCP header
+  * \param iph: pointer to the IPv6 header
+  */
+-void
++void __EXPORTED
+ nfq_tcp_compute_checksum_ipv6(struct tcphdr *tcph, struct ip6_hdr *ip6h)
+ {
+ 	/* checksum field in header needs to be zero for calculation. */
+ 	tcph->check = 0;
+ 	tcph->check = nfq_checksum_tcpudp_ipv6(ip6h, tcph);
+ }
+-EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv6);
+ 
+ /*
+  *	The union cast uses a gcc extension to avoid aliasing problems
+@@ -134,7 +129,7 @@ union tcp_word_hdr {
+  * \param tcp: pointer to a valid tcp header.
+  *
+  */
+-int nfq_tcp_snprintf(char *buf, size_t size, const struct tcphdr *tcph)
++int __EXPORTED nfq_tcp_snprintf(char *buf, size_t size, const struct tcphdr *tcph)
+ {
+ 	int ret, len = 0;
+ 
+@@ -177,7 +172,6 @@ int nfq_tcp_snprintf(char *buf, size_t size, const struct tcphdr *tcph)
+ 
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nfq_tcp_snprintf);
+ 
+ /**
+  * nfq_tcp_mangle_ipv4 - mangle TCP/IPv4 packet buffer
+@@ -189,7 +183,7 @@ EXPORT_SYMBOL(nfq_tcp_snprintf);
+  *
+  * \note This function recalculates the IPv4 and TCP checksums for you.
+  */
+-int
++int __EXPORTED
+ nfq_tcp_mangle_ipv4(struct pkt_buff *pkt,
+ 		    unsigned int match_offset, unsigned int match_len,
+ 		    const char *rep_buffer, unsigned int rep_len)
+@@ -208,7 +202,6 @@ nfq_tcp_mangle_ipv4(struct pkt_buff *pkt,
+ 
+ 	return 1;
+ }
+-EXPORT_SYMBOL(nfq_tcp_mangle_ipv4);
+ 
+ /**
+  * @}
+diff --git a/src/extra/udp.c b/src/extra/udp.c
+index 8c44a66..99c8faa 100644
+--- a/src/extra/udp.c
++++ b/src/extra/udp.c
+@@ -37,7 +37,7 @@
+  * This function returns NULL if invalid UDP header is found. On success,
+  * it returns the UDP header.
+  */
+-struct udphdr *nfq_udp_get_hdr(struct pkt_buff *pktb)
++struct udphdr __EXPORTED *nfq_udp_get_hdr(struct pkt_buff *pktb)
+ {
+ 	if (pktb->transport_header == NULL)
+ 		return NULL;
+@@ -48,14 +48,13 @@ struct udphdr *nfq_udp_get_hdr(struct pkt_buff *pktb)
+ 
+ 	return (struct udphdr *)pktb->transport_header;
+ }
+-EXPORT_SYMBOL(nfq_udp_get_hdr);
+ 
+ /**
+  * nfq_udp_get_payload - get the UDP packet payload.
+  * \param udph: the pointer to the UDP header.
+  * \param tail: pointer to the tail of the packet
+  */
+-void *nfq_udp_get_payload(struct udphdr *udph, struct pkt_buff *pktb)
++void __EXPORTED *nfq_udp_get_payload(struct udphdr *udph, struct pkt_buff *pktb)
+ {
+ 	uint16_t len = ntohs(udph->len);
+ 
+@@ -69,17 +68,15 @@ void *nfq_udp_get_payload(struct udphdr *udph, struct pkt_buff *pktb)
+ 
+ 	return pktb->transport_header + sizeof(struct udphdr);
+ }
+-EXPORT_SYMBOL(nfq_udp_get_payload);
+ 
+ /**
+  * nfq_udp_get_payload_len - get the udp packet payload.
+  * \param udp: the pointer to the udp header.
+  */
+-unsigned int nfq_udp_get_payload_len(struct udphdr *udph, struct pkt_buff *pktb)
++unsigned int __EXPORTED nfq_udp_get_payload_len(struct udphdr *udph, struct pkt_buff *pktb)
+ {
+ 	return pktb->tail - pktb->transport_header;
+ }
+-EXPORT_SYMBOL(nfq_udp_get_payload_len);
+ 
+ /**
+  * nfq_udp_set_checksum_ipv4 - computes a IPv4/TCP packet's segment
+@@ -91,14 +88,13 @@ EXPORT_SYMBOL(nfq_udp_get_payload_len);
+  * \see nfq_pkt_compute_ip_checksum
+  * \see nfq_pkt_compute_udp_checksum
+  */
+-void
++void __EXPORTED
+ nfq_udp_compute_checksum_ipv4(struct udphdr *udph, struct iphdr *iph)
+ {
+ 	/* checksum field in header needs to be zero for calculation. */
+ 	udph->check = 0;
+ 	udph->check = nfq_checksum_tcpudp_ipv4(iph);
+ }
+-EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4);
+ 
+ /**
+  * nfq_udp_set_checksum_ipv6 - computes a IPv6/TCP packet's segment
+@@ -110,14 +106,13 @@ EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4);
+  * \see nfq_pkt_compute_ip_checksum
+  * \see nfq_pkt_compute_udp_checksum
+  */
+-void
++void __EXPORTED
+ nfq_udp_compute_checksum_ipv6(struct udphdr *udph, struct ip6_hdr *ip6h)
+ {
+ 	/* checksum field in header needs to be zero for calculation. */
+ 	udph->check = 0;
+ 	udph->check = nfq_checksum_tcpudp_ipv6(ip6h, udph);
+ }
+-EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv6);
+ 
+ /**
+  * nfq_tcp_mangle_ipv4 - mangle TCP/IPv4 packet buffer
+@@ -129,7 +124,7 @@ EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv6);
+  *
+  * \note This function recalculates the IPv4 and TCP checksums for you.
+  */
+-int
++int __EXPORTED
+ nfq_udp_mangle_ipv4(struct pkt_buff *pkt,
+ 		    unsigned int match_offset, unsigned int match_len,
+ 		    const char *rep_buffer, unsigned int rep_len)
+@@ -148,7 +143,6 @@ nfq_udp_mangle_ipv4(struct pkt_buff *pkt,
+ 
+ 	return 1;
+ }
+-EXPORT_SYMBOL(nfq_udp_mangle_ipv4);
+ 
+ /**
+  * nfq_pkt_snprintf_udp_hdr - print udp header into one buffer in a humnan
+@@ -158,12 +152,11 @@ EXPORT_SYMBOL(nfq_udp_mangle_ipv4);
+  * \param udp: pointer to a valid udp header.
+  *
+  */
+-int nfq_udp_snprintf(char *buf, size_t size, const struct udphdr *udph)
++int __EXPORTED nfq_udp_snprintf(char *buf, size_t size, const struct udphdr *udph)
+ {
+ 	return snprintf(buf, size, "SPT=%u DPT=%u ",
+ 			htons(udph->source), htons(udph->dest));
+ }
+-EXPORT_SYMBOL(nfq_udp_snprintf);
+ 
+ /**
+  * @}
+diff --git a/src/internal.h b/src/internal.h
+index 558d267..79b0752 100644
+--- a/src/internal.h
++++ b/src/internal.h
+@@ -5,10 +5,9 @@
+ #include <stdint.h>
+ #include <stdbool.h>
+ #ifdef HAVE_VISIBILITY_HIDDEN
+-#	define __visible	__attribute__((visibility("default")))
+-#	define EXPORT_SYMBOL(x)	typeof(x) (x) __visible
++#	define __EXPORTED	__attribute__((visibility("default")))
+ #else
+-#	define EXPORT_SYMBOL
++#	define __EXPORTED
+ #endif
+ 
+ struct iphdr;
+diff --git a/src/libnetfilter_queue.c b/src/libnetfilter_queue.c
+index 065d618..ab0b66b 100644
+--- a/src/libnetfilter_queue.c
++++ b/src/libnetfilter_queue.c
+@@ -133,8 +133,7 @@ struct nfq_data {
+ 	struct nfattr **data;
+ };
+ 
+-int nfq_errno;
+-EXPORT_SYMBOL(nfq_errno);
++int __EXPORTED nfq_errno;
+ 
+ /***********************************************************************
+  * low level stuff 
+@@ -218,11 +217,10 @@ static int __nfq_rcv_pkt(struct nlmsghdr *nlh, struct nfattr *nfa[],
+ 
+ /* public interface */
+ 
+-struct nfnl_handle *nfq_nfnlh(struct nfq_handle *h)
++struct nfnl_handle __EXPORTED *nfq_nfnlh(struct nfq_handle *h)
+ {
+ 	return h->nfnlh;
+ }
+-EXPORT_SYMBOL(nfq_nfnlh);
+ 
+ /**
+  *
+@@ -294,11 +292,10 @@ EXPORT_SYMBOL(nfq_nfnlh);
+  * over the netlink connection associated with the given queue connection
+  * handle.
+  */
+-int nfq_fd(struct nfq_handle *h)
++int __EXPORTED nfq_fd(struct nfq_handle *h)
+ {
+ 	return nfnl_fd(nfq_nfnlh(h));
+ }
+-EXPORT_SYMBOL(nfq_fd);
+ /**
+  * @}
+  */
+@@ -349,7 +346,7 @@ EXPORT_SYMBOL(nfq_fd);
+  *
+  * \return a pointer to a new queue handle or NULL on failure.
+  */
+-struct nfq_handle *nfq_open(void)
++struct nfq_handle __EXPORTED *nfq_open(void)
+ {
+ 	struct nfnl_handle *nfnlh = nfnl_open();
+ 	struct nfq_handle *qh;
+@@ -366,7 +363,6 @@ struct nfq_handle *nfq_open(void)
+ 
+ 	return qh;
+ }
+-EXPORT_SYMBOL(nfq_open);
+ 
+ /**
+  * @}
+@@ -382,7 +378,7 @@ EXPORT_SYMBOL(nfq_open);
+  *
+  * \return a pointer to a new queue handle or NULL on failure.
+  */
+-struct nfq_handle *nfq_open_nfnl(struct nfnl_handle *nfnlh)
++struct nfq_handle __EXPORTED *nfq_open_nfnl(struct nfnl_handle *nfnlh)
+ {
+ 	struct nfnl_callback pkt_cb = {
+ 		.call		= __nfq_rcv_pkt,
+@@ -419,7 +415,6 @@ out_free:
+ 	free(h);
+ 	return NULL;
+ }
+-EXPORT_SYMBOL(nfq_open_nfnl);
+ 
+ /**
+  * \addtogroup LibrarySetup
+@@ -438,7 +433,7 @@ EXPORT_SYMBOL(nfq_open_nfnl);
+  *
+  * \return 0 on success, non-zero on failure. 
+  */
+-int nfq_close(struct nfq_handle *h)
++int __EXPORTED nfq_close(struct nfq_handle *h)
+ {
+ 	int ret;
+ 	
+@@ -447,7 +442,6 @@ int nfq_close(struct nfq_handle *h)
+ 		free(h);
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nfq_close);
+ 
+ /**
+  * nfq_bind_pf - bind a nfqueue handler to a given protocol family
+@@ -460,11 +454,10 @@ EXPORT_SYMBOL(nfq_close);
+  *
+  * \return integer inferior to 0 in case of failure
+  */
+-int nfq_bind_pf(struct nfq_handle *h, uint16_t pf)
++int __EXPORTED nfq_bind_pf(struct nfq_handle *h, uint16_t pf)
+ {
+ 	return __build_send_cfg_msg(h, NFQNL_CFG_CMD_PF_BIND, 0, pf);
+ }
+-EXPORT_SYMBOL(nfq_bind_pf);
+ 
+ /**
+  * nfq_unbind_pf - unbind nfqueue handler from a protocol family
+@@ -476,11 +469,10 @@ EXPORT_SYMBOL(nfq_bind_pf);
+  *
+  * This call is obsolete, Linux kernels from 3.8 onwards ignore it.
+  */
+-int nfq_unbind_pf(struct nfq_handle *h, uint16_t pf)
++int __EXPORTED nfq_unbind_pf(struct nfq_handle *h, uint16_t pf)
+ {
+ 	return __build_send_cfg_msg(h, NFQNL_CFG_CMD_PF_UNBIND, 0, pf);
+ }
+-EXPORT_SYMBOL(nfq_unbind_pf);
+ 
+ 
+ /**
+@@ -524,7 +516,7 @@ typedef int nfq_callback(struct nfq_q_handle *qh,
+  * The callback should return < 0 to stop processing.
+  */
+ 
+-struct nfq_q_handle *nfq_create_queue(struct nfq_handle *h, 
++struct nfq_q_handle __EXPORTED *nfq_create_queue(struct nfq_handle *h, 
+ 		uint16_t num,
+ 		nfq_callback *cb,
+ 		void *data)
+@@ -555,7 +547,6 @@ struct nfq_q_handle *nfq_create_queue(struct nfq_handle *h,
+ 	add_qh(qh);
+ 	return qh;
+ }
+-EXPORT_SYMBOL(nfq_create_queue);
+ 
+ /**
+  * @}
+@@ -573,7 +564,7 @@ EXPORT_SYMBOL(nfq_create_queue);
+  * Removes the binding for the specified queue handle. This call also unbind
+  * from the nfqueue handler, so you don't have to call nfq_unbind_pf.
+  */
+-int nfq_destroy_queue(struct nfq_q_handle *qh)
++int __EXPORTED nfq_destroy_queue(struct nfq_q_handle *qh)
+ {
+ 	int ret = __build_send_cfg_msg(qh->h, NFQNL_CFG_CMD_UNBIND, qh->id, 0);
+ 	if (ret == 0) {
+@@ -583,7 +574,6 @@ int nfq_destroy_queue(struct nfq_q_handle *qh)
+ 
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nfq_destroy_queue);
+ 
+ /**
+  * nfq_handle_packet - handle a packet received from the nfqueue subsystem
+@@ -597,11 +587,10 @@ EXPORT_SYMBOL(nfq_destroy_queue);
+  *
+  * \return 0 on success, non-zero on failure.
+  */
+-int nfq_handle_packet(struct nfq_handle *h, char *buf, int len)
++int __EXPORTED nfq_handle_packet(struct nfq_handle *h, char *buf, int len)
+ {
+ 	return nfnl_handle_packet(h->nfnlh, buf, len);
+ }
+-EXPORT_SYMBOL(nfq_handle_packet);
+ 
+ /**
+  * nfq_set_mode - set the amount of packet data that nfqueue copies to userspace
+@@ -618,7 +607,7 @@ EXPORT_SYMBOL(nfq_handle_packet);
+  *
+  * \return -1 on error; >=0 otherwise.
+  */
+-int nfq_set_mode(struct nfq_q_handle *qh,
++int __EXPORTED nfq_set_mode(struct nfq_q_handle *qh,
+ 		uint8_t mode, uint32_t range)
+ {
+ 	union {
+@@ -638,7 +627,6 @@ int nfq_set_mode(struct nfq_q_handle *qh,
+ 
+ 	return nfnl_query(qh->h->nfnlh, &u.nmh);
+ }
+-EXPORT_SYMBOL(nfq_set_mode);
+ 
+ /**
+  * nfq_set_queue_flags - set flags (options) for the kernel queue
+@@ -690,7 +678,7 @@ EXPORT_SYMBOL(nfq_set_mode);
+  *
+  * \return -1 on error with errno set appropriately; =0 otherwise.
+  */
+-int nfq_set_queue_flags(struct nfq_q_handle *qh,
++int __EXPORTED nfq_set_queue_flags(struct nfq_q_handle *qh,
+ 			uint32_t mask, uint32_t flags)
+ {
+ 	union {
+@@ -711,7 +699,6 @@ int nfq_set_queue_flags(struct nfq_q_handle *qh,
+ 
+ 	return nfnl_query(qh->h->nfnlh, &u.nmh);
+ }
+-EXPORT_SYMBOL(nfq_set_queue_flags);
+ 
+ /**
+  * nfq_set_queue_maxlen - Set kernel queue maximum length parameter
+@@ -724,7 +711,7 @@ EXPORT_SYMBOL(nfq_set_queue_flags);
+  *
+  * \return -1 on error; >=0 otherwise.
+  */
+-int nfq_set_queue_maxlen(struct nfq_q_handle *qh,
++int __EXPORTED nfq_set_queue_maxlen(struct nfq_q_handle *qh,
+ 				uint32_t queuelen)
+ {
+ 	union {
+@@ -742,7 +729,6 @@ int nfq_set_queue_maxlen(struct nfq_q_handle *qh,
+ 
+ 	return nfnl_query(qh->h->nfnlh, &u.nmh);
+ }
+-EXPORT_SYMBOL(nfq_set_queue_maxlen);
+ 
+ /**
+  * @}
+@@ -829,14 +815,13 @@ static int __set_verdict(struct nfq_q_handle *qh, uint32_t id,
+  *
+  * \return -1 on error; >= 0 otherwise.
+  */
+-int nfq_set_verdict(struct nfq_q_handle *qh, uint32_t id,
++int __EXPORTED nfq_set_verdict(struct nfq_q_handle *qh, uint32_t id,
+ 		uint32_t verdict, uint32_t data_len,
+ 		const unsigned char *buf)
+ {
+ 	return __set_verdict(qh, id, verdict, 0, 0, data_len, buf,
+ 						NFQNL_MSG_VERDICT);
+ }
+-EXPORT_SYMBOL(nfq_set_verdict);
+ 
+ /**
+  * nfq_set_verdict2 - like nfq_set_verdict, but you can set the mark.
+@@ -847,14 +832,13 @@ EXPORT_SYMBOL(nfq_set_verdict);
+  * \param data_len number of bytes of data pointed to by #buf
+  * \param buf the buffer that contains the packet data
+  */
+-int nfq_set_verdict2(struct nfq_q_handle *qh, uint32_t id,
++int __EXPORTED nfq_set_verdict2(struct nfq_q_handle *qh, uint32_t id,
+ 		     uint32_t verdict, uint32_t mark,
+ 		     uint32_t data_len, const unsigned char *buf)
+ {
+ 	return __set_verdict(qh, id, verdict, htonl(mark), 1, data_len,
+ 						buf, NFQNL_MSG_VERDICT);
+ }
+-EXPORT_SYMBOL(nfq_set_verdict2);
+ 
+ /**
+  * nfq_set_verdict_batch - issue verdicts on several packets at once
+@@ -868,13 +852,12 @@ EXPORT_SYMBOL(nfq_set_verdict2);
+  * batch support was added in Linux 3.1.
+  * These functions will fail silently on older kernels.
+  */
+-int nfq_set_verdict_batch(struct nfq_q_handle *qh, uint32_t id,
++int __EXPORTED nfq_set_verdict_batch(struct nfq_q_handle *qh, uint32_t id,
+ 					  uint32_t verdict)
+ {
+ 	return __set_verdict(qh, id, verdict, 0, 0, 0, NULL,
+ 					NFQNL_MSG_VERDICT_BATCH);
+ }
+-EXPORT_SYMBOL(nfq_set_verdict_batch);
+ 
+ /**
+  * nfq_set_verdict_batch2 - like nfq_set_verdict_batch, but you can set a mark.
+@@ -883,13 +866,12 @@ EXPORT_SYMBOL(nfq_set_verdict_batch);
+  * \param verdict verdict to return to netfilter (NF_ACCEPT, NF_DROP)
+  * \param mark mark to put on packet
+  */
+-int nfq_set_verdict_batch2(struct nfq_q_handle *qh, uint32_t id,
++int __EXPORTED nfq_set_verdict_batch2(struct nfq_q_handle *qh, uint32_t id,
+ 		     uint32_t verdict, uint32_t mark)
+ {
+ 	return __set_verdict(qh, id, verdict, htonl(mark), 1, 0,
+ 				NULL, NFQNL_MSG_VERDICT_BATCH);
+ }
+-EXPORT_SYMBOL(nfq_set_verdict_batch2);
+ 
+ /**
+  * nfq_set_verdict_mark - like nfq_set_verdict, but you can set the mark.
+@@ -905,14 +887,13 @@ EXPORT_SYMBOL(nfq_set_verdict_batch2);
+  * This function is deprecated since it is broken, its use is highly
+  * discouraged. Please, use nfq_set_verdict2 instead.
+  */
+-int nfq_set_verdict_mark(struct nfq_q_handle *qh, uint32_t id,
++int __EXPORTED nfq_set_verdict_mark(struct nfq_q_handle *qh, uint32_t id,
+ 		uint32_t verdict, uint32_t mark,
+ 		uint32_t data_len, const unsigned char *buf)
+ {
+ 	return __set_verdict(qh, id, verdict, mark, 1, data_len, buf,
+ 						NFQNL_MSG_VERDICT);
+ }
+-EXPORT_SYMBOL(nfq_set_verdict_mark);
+ 
+ /**
+  * @}
+@@ -947,12 +928,11 @@ EXPORT_SYMBOL(nfq_set_verdict_mark);
+ 	} __attribute__ ((packed));
+ \endverbatim
+  */
+-struct nfqnl_msg_packet_hdr *nfq_get_msg_packet_hdr(struct nfq_data *nfad)
++struct nfqnl_msg_packet_hdr __EXPORTED *nfq_get_msg_packet_hdr(struct nfq_data *nfad)
+ {
+ 	return nfnl_get_pointer_to_data(nfad->data, NFQA_PACKET_HDR,
+ 					struct nfqnl_msg_packet_hdr);
+ }
+-EXPORT_SYMBOL(nfq_get_msg_packet_hdr);
+ 
+ /**
+  * nfq_get_nfmark - get the packet mark
+@@ -960,11 +940,10 @@ EXPORT_SYMBOL(nfq_get_msg_packet_hdr);
+  *
+  * \return the netfilter mark currently assigned to the given queued packet.
+  */
+-uint32_t nfq_get_nfmark(struct nfq_data *nfad)
++uint32_t __EXPORTED nfq_get_nfmark(struct nfq_data *nfad)
+ {
+ 	return ntohl(nfnl_get_data(nfad->data, NFQA_MARK, uint32_t));
+ }
+-EXPORT_SYMBOL(nfq_get_nfmark);
+ 
+ /**
+  * nfq_get_timestamp - get the packet timestamp
+@@ -975,7 +954,7 @@ EXPORT_SYMBOL(nfq_get_nfmark);
+  *
+  * \return 0 on success, non-zero on failure.
+  */
+-int nfq_get_timestamp(struct nfq_data *nfad, struct timeval *tv)
++int __EXPORTED nfq_get_timestamp(struct nfq_data *nfad, struct timeval *tv)
+ {
+ 	struct nfqnl_msg_packet_timestamp *qpt;
+ 	qpt = nfnl_get_pointer_to_data(nfad->data, NFQA_TIMESTAMP,
+@@ -988,7 +967,6 @@ int nfq_get_timestamp(struct nfq_data *nfad, struct timeval *tv)
+ 
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nfq_get_timestamp);
+ 
+ /**
+  * nfq_get_indev - get the interface that the packet was received through
+@@ -1001,11 +979,10 @@ EXPORT_SYMBOL(nfq_get_timestamp);
+  * \warning all nfq_get_dev() functions return 0 if not set, since linux
+  * only allows ifindex >= 1, see net/core/dev.c:2600  (in 2.6.13.1)
+  */
+-uint32_t nfq_get_indev(struct nfq_data *nfad)
++uint32_t __EXPORTED nfq_get_indev(struct nfq_data *nfad)
+ {
+ 	return ntohl(nfnl_get_data(nfad->data, NFQA_IFINDEX_INDEV, uint32_t));
+ }
+-EXPORT_SYMBOL(nfq_get_indev);
+ 
+ /**
+  * nfq_get_physindev - get the physical interface that the packet was received
+@@ -1015,11 +992,10 @@ EXPORT_SYMBOL(nfq_get_indev);
+  * If the returned index is 0, the packet was locally generated or the
+  * physical input interface is no longer known (ie. POSTROUTING?).
+  */
+-uint32_t nfq_get_physindev(struct nfq_data *nfad)
++uint32_t __EXPORTED nfq_get_physindev(struct nfq_data *nfad)
+ {
+ 	return ntohl(nfnl_get_data(nfad->data, NFQA_IFINDEX_PHYSINDEV, uint32_t));
+ }
+-EXPORT_SYMBOL(nfq_get_physindev);
+ 
+ /**
+  * nfq_get_outdev - gets the interface that the packet will be routed out
+@@ -1029,11 +1005,10 @@ EXPORT_SYMBOL(nfq_get_physindev);
+  * returned index is 0, the packet is destined for localhost or the output
+  * interface is not yet known (ie. PREROUTING?).
+  */
+-uint32_t nfq_get_outdev(struct nfq_data *nfad)
++uint32_t __EXPORTED nfq_get_outdev(struct nfq_data *nfad)
+ {
+ 	return ntohl(nfnl_get_data(nfad->data, NFQA_IFINDEX_OUTDEV, uint32_t));
+ }
+-EXPORT_SYMBOL(nfq_get_outdev);
+ 
+ /**
+  * nfq_get_physoutdev - get the physical interface that the packet output
+@@ -1045,11 +1020,10 @@ EXPORT_SYMBOL(nfq_get_outdev);
+  * 
+  * \return The index of physical interface that the packet output will be routed out.
+  */
+-uint32_t nfq_get_physoutdev(struct nfq_data *nfad)
++uint32_t __EXPORTED nfq_get_physoutdev(struct nfq_data *nfad)
+ {
+ 	return ntohl(nfnl_get_data(nfad->data, NFQA_IFINDEX_PHYSOUTDEV, uint32_t));
+ }
+-EXPORT_SYMBOL(nfq_get_physoutdev);
+ 
+ /**
+  * nfq_get_indev_name - get the name of the interface the packet
+@@ -1089,13 +1063,12 @@ EXPORT_SYMBOL(nfq_get_physoutdev);
+ \endverbatim
+  *
+  */
+-int nfq_get_indev_name(struct nlif_handle *nlif_handle,
++int __EXPORTED nfq_get_indev_name(struct nlif_handle *nlif_handle,
+ 			struct nfq_data *nfad, char *name)
+ {
+ 	uint32_t ifindex = nfq_get_indev(nfad);
+ 	return nlif_index2name(nlif_handle, ifindex, name);
+ }
+-EXPORT_SYMBOL(nfq_get_indev_name);
+ 
+ /**
+  * nfq_get_physindev_name - get the name of the physical interface the
+@@ -1109,13 +1082,12 @@ EXPORT_SYMBOL(nfq_get_indev_name);
+  *
+  * \return  -1 in case of error, > 0 if it succeed. 
+  */
+-int nfq_get_physindev_name(struct nlif_handle *nlif_handle,
++int __EXPORTED nfq_get_physindev_name(struct nlif_handle *nlif_handle,
+ 			   struct nfq_data *nfad, char *name)
+ {
+ 	uint32_t ifindex = nfq_get_physindev(nfad);
+ 	return nlif_index2name(nlif_handle, ifindex, name);
+ }
+-EXPORT_SYMBOL(nfq_get_physindev_name);
+ 
+ /**
+  * nfq_get_outdev_name - get the name of the physical interface the
+@@ -1129,13 +1101,12 @@ EXPORT_SYMBOL(nfq_get_physindev_name);
+  *
+  * \return  -1 in case of error, > 0 if it succeed. 
+  */
+-int nfq_get_outdev_name(struct nlif_handle *nlif_handle,
++int __EXPORTED nfq_get_outdev_name(struct nlif_handle *nlif_handle,
+ 			struct nfq_data *nfad, char *name)
+ {
+ 	uint32_t ifindex = nfq_get_outdev(nfad);
+ 	return nlif_index2name(nlif_handle, ifindex, name);
+ }
+-EXPORT_SYMBOL(nfq_get_outdev_name);
+ 
+ /**
+  * nfq_get_physoutdev_name - get the name of the interface the
+@@ -1150,13 +1121,12 @@ EXPORT_SYMBOL(nfq_get_outdev_name);
+  * \return  -1 in case of error, > 0 if it succeed. 
+  */
+ 
+-int nfq_get_physoutdev_name(struct nlif_handle *nlif_handle,
++int __EXPORTED nfq_get_physoutdev_name(struct nlif_handle *nlif_handle,
+ 			    struct nfq_data *nfad, char *name)
+ {
+ 	uint32_t ifindex = nfq_get_physoutdev(nfad);
+ 	return nlif_index2name(nlif_handle, ifindex, name);
+ }
+-EXPORT_SYMBOL(nfq_get_physoutdev_name);
+ 
+ /**
+  * nfq_get_packet_hw
+@@ -1180,12 +1150,11 @@ EXPORT_SYMBOL(nfq_get_physoutdev_name);
+ 	} __attribute__ ((packed));
+ \endverbatim
+  */
+-struct nfqnl_msg_packet_hw *nfq_get_packet_hw(struct nfq_data *nfad)
++struct nfqnl_msg_packet_hw __EXPORTED *nfq_get_packet_hw(struct nfq_data *nfad)
+ {
+ 	return nfnl_get_pointer_to_data(nfad->data, NFQA_HWADDR,
+ 					struct nfqnl_msg_packet_hw);
+ }
+-EXPORT_SYMBOL(nfq_get_packet_hw);
+ 
+ /**
+  * nfq_get_uid - get the UID of the user the packet belongs to
+@@ -1193,7 +1162,7 @@ EXPORT_SYMBOL(nfq_get_packet_hw);
+  *
+  * \return 1 if there is a UID available, 0 otherwise.
+  */
+-int nfq_get_uid(struct nfq_data *nfad, uint32_t *uid)
++int __EXPORTED nfq_get_uid(struct nfq_data *nfad, uint32_t *uid)
+ {
+ 	if (!nfnl_attr_present(nfad->data, NFQA_UID))
+ 		return 0;
+@@ -1201,7 +1170,6 @@ int nfq_get_uid(struct nfq_data *nfad, uint32_t *uid)
+ 	*uid = ntohl(nfnl_get_data(nfad->data, NFQA_UID, uint32_t));
+ 	return 1;
+ }
+-EXPORT_SYMBOL(nfq_get_uid);
+ 
+ /**
+  * nfq_get_gid - get the GID of the user the packet belongs to
+@@ -1209,7 +1177,7 @@ EXPORT_SYMBOL(nfq_get_uid);
+  *
+  * \return 1 if there is a GID available, 0 otherwise.
+  */
+-int nfq_get_gid(struct nfq_data *nfad, uint32_t *gid)
++int __EXPORTED nfq_get_gid(struct nfq_data *nfad, uint32_t *gid)
+ {
+ 	if (!nfnl_attr_present(nfad->data, NFQA_GID))
+ 		return 0;
+@@ -1217,7 +1185,6 @@ int nfq_get_gid(struct nfq_data *nfad, uint32_t *gid)
+ 	*gid = ntohl(nfnl_get_data(nfad->data, NFQA_GID, uint32_t));
+ 	return 1;
+ }
+-EXPORT_SYMBOL(nfq_get_gid);
+ 
+ 
+ /**
+@@ -1227,7 +1194,7 @@ EXPORT_SYMBOL(nfq_get_gid);
+  *
+  * \return -1 on error, otherwise > 0
+  */
+-int nfq_get_secctx(struct nfq_data *nfad, unsigned char **secdata)
++int __EXPORTED nfq_get_secctx(struct nfq_data *nfad, unsigned char **secdata)
+ {
+ 	if (!nfnl_attr_present(nfad->data, NFQA_SECCTX))
+ 		return -1;
+@@ -1240,7 +1207,6 @@ int nfq_get_secctx(struct nfq_data *nfad, unsigned char **secdata)
+ 
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nfq_get_secctx);
+ 
+ /**
+  * nfq_get_payload - get payload 
+@@ -1253,7 +1219,7 @@ EXPORT_SYMBOL(nfq_get_secctx);
+  *
+  * \return -1 on error, otherwise > 0.
+  */
+-int nfq_get_payload(struct nfq_data *nfad, unsigned char **data)
++int __EXPORTED nfq_get_payload(struct nfq_data *nfad, unsigned char **data)
+ {
+ 	*data = (unsigned char *)
+ 		nfnl_get_pointer_to_data(nfad->data, NFQA_PAYLOAD, char);
+@@ -1262,7 +1228,6 @@ int nfq_get_payload(struct nfq_data *nfad, unsigned char **data)
+ 
+ 	return -1;
+ }
+-EXPORT_SYMBOL(nfq_get_payload);
+ 
+ /**
+  * @}
+@@ -1307,7 +1272,7 @@ do {								\
+  * would have been printed into the buffer (in case that there is enough
+  * room in it). See snprintf() return value for more information.
+  */
+-int nfq_snprintf_xml(char *buf, size_t rem, struct nfq_data *tb, int flags)
++int __EXPORTED nfq_snprintf_xml(char *buf, size_t rem, struct nfq_data *tb, int flags)
+ {
+ 	struct nfqnl_msg_packet_hdr *ph;
+ 	struct nfqnl_msg_packet_hw *hwph;
+@@ -1460,7 +1425,6 @@ int nfq_snprintf_xml(char *buf, size_t rem, struct nfq_data *tb, int flags)
+ 
+ 	return len;
+ }
+-EXPORT_SYMBOL(nfq_snprintf_xml);
+ 
+ /**
+  * @}
+diff --git a/src/nlmsg.c b/src/nlmsg.c
+index ba28c77..5582407 100644
+--- a/src/nlmsg.c
++++ b/src/nlmsg.c
+@@ -30,7 +30,7 @@
+  * @{
+  */
+ 
+-void nfq_nlmsg_verdict_put(struct nlmsghdr *nlh, int id, int verdict)
++void __EXPORTED nfq_nlmsg_verdict_put(struct nlmsghdr *nlh, int id, int verdict)
+ {
+ 	struct nfqnl_msg_verdict_hdr vh = {
+ 		.verdict	= htonl(verdict),
+@@ -38,20 +38,17 @@ void nfq_nlmsg_verdict_put(struct nlmsghdr *nlh, int id, int verdict)
+ 	};
+ 	mnl_attr_put(nlh, NFQA_VERDICT_HDR, sizeof(vh), &vh);
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_verdict_put);
+ 
+-void nfq_nlmsg_verdict_put_mark(struct nlmsghdr *nlh, uint32_t mark)
++void __EXPORTED nfq_nlmsg_verdict_put_mark(struct nlmsghdr *nlh, uint32_t mark)
+ {
+ 	mnl_attr_put_u32(nlh, NFQA_MARK, htonl(mark));
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_verdict_put_mark);
+ 
+-void
++void __EXPORTED
+ nfq_nlmsg_verdict_put_pkt(struct nlmsghdr *nlh, const void *pkt, uint32_t plen)
+ {
+ 	mnl_attr_put(nlh, NFQA_PAYLOAD, plen, pkt);
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_verdict_put_pkt);
+ 
+ /**
+  * @}
+@@ -85,7 +82,7 @@ EXPORT_SYMBOL(nfq_nlmsg_verdict_put_pkt);
+  *   given protocol family.  Both commands are ignored by Linux kernel 3.8 and
+  *   later versions.
+  */
+-void nfq_nlmsg_cfg_put_cmd(struct nlmsghdr *nlh, uint16_t pf, uint8_t cmd)
++void __EXPORTED nfq_nlmsg_cfg_put_cmd(struct nlmsghdr *nlh, uint16_t pf, uint8_t cmd)
+ {
+ 	struct nfqnl_msg_config_cmd command = {
+ 		.command = cmd,
+@@ -93,9 +90,8 @@ void nfq_nlmsg_cfg_put_cmd(struct nlmsghdr *nlh, uint16_t pf, uint8_t cmd)
+ 	};
+ 	mnl_attr_put(nlh, NFQA_CFG_CMD, sizeof(command), &command);
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_cfg_put_cmd);
+ 
+-void nfq_nlmsg_cfg_put_params(struct nlmsghdr *nlh, uint8_t mode, int range)
++void __EXPORTED nfq_nlmsg_cfg_put_params(struct nlmsghdr *nlh, uint8_t mode, int range)
+ {
+ 	struct nfqnl_msg_config_params params = {
+ 		.copy_range = htonl(range),
+@@ -103,13 +99,11 @@ void nfq_nlmsg_cfg_put_params(struct nlmsghdr *nlh, uint8_t mode, int range)
+ 	};
+ 	mnl_attr_put(nlh, NFQA_CFG_PARAMS, sizeof(params), &params);
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_cfg_put_params);
+ 
+-void nfq_nlmsg_cfg_put_qmaxlen(struct nlmsghdr *nlh, uint32_t queue_maxlen)
++void __EXPORTED nfq_nlmsg_cfg_put_qmaxlen(struct nlmsghdr *nlh, uint32_t queue_maxlen)
+ {
+ 	mnl_attr_put_u32(nlh, NFQA_CFG_QUEUE_MAXLEN, htonl(queue_maxlen));
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_cfg_put_qmaxlen);
+ 
+ /**
+  * @}
+@@ -179,12 +173,11 @@ static int nfq_pkt_parse_attr_cb(const struct nlattr *attr, void *data)
+  * This function returns MNL_CB_ERROR if any error occurs, or MNL_CB_OK on
+  * success.
+  */
+-int nfq_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr **attr)
++int __EXPORTED nfq_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr **attr)
+ {
+ 	return mnl_attr_parse(nlh, sizeof(struct nfgenmsg),
+ 			      nfq_pkt_parse_attr_cb, attr);
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_parse);
+ 
+ /**
+  * @}
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch
new file mode 100644
index 0000000..9377f57
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch
@@ -0,0 +1,385 @@
+From f58c5b09fb59baf07c942d373fc4d522b27e73c6 Mon Sep 17 00:00:00 2001
+From: Kevin Cernekee <cernekee@chromium.org>
+Date: Wed, 4 Jan 2017 14:30:26 -0800
+Subject: Use __EXPORTED rather than EXPORT_SYMBOL
+
+clang is sensitive to the ordering of
+__attribute__((visibility("default"))) relative to the function
+body.  gcc is not.  So if we try to re-declare an existing function
+with default visibility, clang prints a warning and generates
+a broken .so file in which nfct_helper_* are not exported to library
+callers.
+
+Move the attribute up into the function definition to make clang happy.
+
+Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ doxygen.cfg.in              |  2 +-
+ src/internal.h              |  5 ++-
+ src/libnetfilter_cthelper.c | 83 ++++++++++++++++++---------------------------
+ 3 files changed, 36 insertions(+), 54 deletions(-)
+
+diff --git a/doxygen.cfg.in b/doxygen.cfg.in
+index cac9b05..190b7cd 100644
+--- a/doxygen.cfg.in
++++ b/doxygen.cfg.in
+@@ -72,7 +72,7 @@ RECURSIVE              = YES
+ EXCLUDE                = 
+ EXCLUDE_SYMLINKS       = NO
+ EXCLUDE_PATTERNS       = */.git/* .*.d
+-EXCLUDE_SYMBOLS        = EXPORT_SYMBOL
++EXCLUDE_SYMBOLS        = 
+ EXAMPLE_PATH           = 
+ EXAMPLE_PATTERNS       = 
+ EXAMPLE_RECURSIVE      = NO
+diff --git a/src/internal.h b/src/internal.h
+index 3a88d1a..5d78171 100644
+--- a/src/internal.h
++++ b/src/internal.h
+@@ -3,10 +3,9 @@
+ 
+ #include "config.h"
+ #ifdef HAVE_VISIBILITY_HIDDEN
+-#	define __visible	__attribute__((visibility("default")))
+-#	define EXPORT_SYMBOL(x)	typeof(x) (x) __visible
++#	define __EXPORTED	__attribute__((visibility("default")))
+ #else
+-#	define EXPORT_SYMBOL
++#	define __EXPORTED
+ #endif
+ 
+ #endif
+diff --git a/src/libnetfilter_cthelper.c b/src/libnetfilter_cthelper.c
+index f8f58e6..af543a1 100644
+--- a/src/libnetfilter_cthelper.c
++++ b/src/libnetfilter_cthelper.c
+@@ -99,17 +99,16 @@ struct nfct_helper {
+  * In case of success, this function returns a valid pointer, otherwise NULL
+  * s returned and errno is appropriately set.
+  */
+-struct nfct_helper *nfct_helper_alloc(void)
++struct nfct_helper __EXPORTED *nfct_helper_alloc(void)
+ {
+ 	return calloc(1, sizeof(struct nfct_helper));
+ }
+-EXPORT_SYMBOL(nfct_helper_alloc);
+ 
+ /**
+  * nfct_helper_free - release one helper object
+  * \param nfct_helper pointer to the helper object
+  */
+-void nfct_helper_free(struct nfct_helper *h)
++void __EXPORTED nfct_helper_free(struct nfct_helper *h)
+ {
+ 	int i;
+ 
+@@ -119,7 +118,6 @@ void nfct_helper_free(struct nfct_helper *h)
+ 	}
+ 	free(h);
+ }
+-EXPORT_SYMBOL(nfct_helper_free);
+ 
+ /**
+  * nfct_helper_policy_alloc - allocate a new helper policy object
+@@ -127,21 +125,19 @@ EXPORT_SYMBOL(nfct_helper_free);
+  * In case of success, this function returns a valid pointer, otherwise NULL
+  * s returned and errno is appropriately set.
+  */
+-struct nfct_helper_policy *nfct_helper_policy_alloc(void)
++struct nfct_helper_policy __EXPORTED *nfct_helper_policy_alloc(void)
+ {
+ 	return calloc(1, sizeof(struct nfct_helper_policy));
+ }
+-EXPORT_SYMBOL(nfct_helper_policy_alloc);
+ 
+ /**
+  * nfct_helper_free - release one helper policy object
+  * \param nfct_helper pointer to the helper object
+  */
+-void nfct_helper_policy_free(struct nfct_helper_policy *p)
++void __EXPORTED nfct_helper_policy_free(struct nfct_helper_policy *p)
+ {
+ 	free(p);
+ }
+-EXPORT_SYMBOL(nfct_helper_policy_free);
+ 
+ /**
+  * nfct_helper_policy_attr_set - set one attribute of the helper object
+@@ -149,7 +145,7 @@ EXPORT_SYMBOL(nfct_helper_policy_free);
+  * \param type attribute type you want to set
+  * \param data pointer to data that will be used to set this attribute
+  */
+-void
++void __EXPORTED
+ nfct_helper_policy_attr_set(struct nfct_helper_policy *p,
+ 			    enum nfct_helper_policy_attr_type type,
+ 			    const void *data)
+@@ -170,7 +166,6 @@ nfct_helper_policy_attr_set(struct nfct_helper_policy *p,
+ 		break;
+ 	}
+ }
+-EXPORT_SYMBOL(nfct_helper_policy_attr_set);
+ 
+ /**
+  * nfct_helper_attr_set_str - set one attribute the helper object
+@@ -178,23 +173,21 @@ EXPORT_SYMBOL(nfct_helper_policy_attr_set);
+  * \param type attribute type you want to set
+  * \param name string that will be used to set this attribute
+  */
+-void
++void __EXPORTED
+ nfct_helper_policy_attr_set_str(struct nfct_helper_policy *p,
+ 				enum nfct_helper_policy_attr_type type,
+ 				const char *name)
+ {
+ 	nfct_helper_policy_attr_set(p, type, name);
+ }
+-EXPORT_SYMBOL(nfct_helper_policy_attr_set_str);
+ 
+-void
++void __EXPORTED
+ nfct_helper_policy_attr_set_u32(struct nfct_helper_policy *p,
+ 				enum nfct_helper_policy_attr_type type,
+ 				uint32_t value)
+ {
+ 	nfct_helper_policy_attr_set(p, type, &value);
+ }
+-EXPORT_SYMBOL(nfct_helper_policy_attr_set_u32);
+ 
+ /**
+  * nfct_helper_attr_set - set one attribute of the helper object
+@@ -202,7 +195,7 @@ EXPORT_SYMBOL(nfct_helper_policy_attr_set_u32);
+  * \param type attribute type you want to set
+  * \param data pointer to data that will be used to set this attribute
+  */
+-void
++void __EXPORTED
+ nfct_helper_attr_set(struct nfct_helper *h,
+ 		     enum nfct_helper_attr_type type, const void *data)
+ {
+@@ -250,7 +243,6 @@ nfct_helper_attr_set(struct nfct_helper *h,
+ 		break;
+ 	}
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_set);
+ 
+ /**
+  * nfct_helper_attr_set_str - set one attribute the helper object
+@@ -258,44 +250,40 @@ EXPORT_SYMBOL(nfct_helper_attr_set);
+  * \param type attribute type you want to set
+  * \param name string that will be used to set this attribute
+  */
+-void
++void __EXPORTED
+ nfct_helper_attr_set_str(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type,
+ 		    const char *name)
+ {
+ 	nfct_helper_attr_set(nfct_helper, type, name);
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_set_str);
+ 
+-void
++void __EXPORTED
+ nfct_helper_attr_set_u8(struct nfct_helper *nfct_helper,
+ 			 enum nfct_helper_attr_type type, uint8_t value)
+ {
+ 	nfct_helper_attr_set(nfct_helper, type, &value);
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_set_u8);
+ 
+-void
++void __EXPORTED
+ nfct_helper_attr_set_u16(struct nfct_helper *nfct_helper,
+ 			 enum nfct_helper_attr_type type, uint16_t value)
+ {
+ 	nfct_helper_attr_set(nfct_helper, type, &value);
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_set_u16);
+ 
+-void
++void __EXPORTED
+ nfct_helper_attr_set_u32(struct nfct_helper *nfct_helper,
+ 			 enum nfct_helper_attr_type type, uint32_t value)
+ {
+ 	nfct_helper_attr_set(nfct_helper, type, &value);
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_set_u32);
+ 
+ /**
+  * nfct_helper_attr_unset - unset one attribute the helper object
+  * \param nfct_helper pointer to the helper object
+  * \param type attribute type you want to set
+  */
+-void
++void __EXPORTED
+ nfct_helper_attr_unset(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
+ {
+ 	switch(type) {
+@@ -307,7 +295,6 @@ nfct_helper_attr_unset(struct nfct_helper *nfct_helper, enum nfct_helper_attr_ty
+ 		break;
+ 	}
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_unset);
+ 
+ /**
+  * nfct_helper_attr_get - get one attribute the helper object
+@@ -317,8 +304,9 @@ EXPORT_SYMBOL(nfct_helper_attr_unset);
+  * This function returns a valid pointer to the attribute data. If a
+  * unsupported attribute is used, this returns NULL.
+  */
+-const void *nfct_helper_attr_get(struct nfct_helper *helper,
+-				 enum nfct_helper_attr_type type)
++const void __EXPORTED *
++nfct_helper_attr_get(struct nfct_helper *helper,
++		     enum nfct_helper_attr_type type)
+ {
+ 	const void *ret = NULL;
+ 
+@@ -358,7 +346,6 @@ const void *nfct_helper_attr_get(struct nfct_helper *helper,
+ 	}
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_get);
+ 
+ /**
+  * nfct_helper_attr_get_str - get one attribute the helper object
+@@ -368,13 +355,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get);
+  * This function returns a valid pointer to the beginning of the string.
+  * If the attribute is unsupported, this returns NULL.
+  */
+-const char *
++const char __EXPORTED *
+ nfct_helper_attr_get_str(struct nfct_helper *nfct_helper,
+ 			 enum nfct_helper_attr_type type)
+ {
+ 	return (const char *)nfct_helper_attr_get(nfct_helper, type);
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_get_str);
+ 
+ /**
+  * nfct_helper_attr_get_u8 - get one attribute the helper object
+@@ -384,12 +370,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_str);
+  * This function returns a unsigned 8-bits integer. If the attribute is
+  * unsupported, this returns NULL.
+  */
+-uint8_t nfct_helper_attr_get_u8(struct nfct_helper *nfct_helper,
+-				  enum nfct_helper_attr_type type)
++uint8_t __EXPORTED
++nfct_helper_attr_get_u8(struct nfct_helper *nfct_helper,
++			enum nfct_helper_attr_type type)
+ {
+ 	return *((uint8_t *)nfct_helper_attr_get(nfct_helper, type));
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_get_u8);
+ 
+ /**
+  * nfct_helper_attr_get_u16 - get one attribute the helper object
+@@ -399,12 +385,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u8);
+  * This function returns a unsigned 16-bits integer. If the attribute is
+  * unsupported, this returns NULL.
+  */
+-uint16_t nfct_helper_attr_get_u16(struct nfct_helper *nfct_helper,
+-				  enum nfct_helper_attr_type type)
++uint16_t __EXPORTED
++nfct_helper_attr_get_u16(struct nfct_helper *nfct_helper,
++			 enum nfct_helper_attr_type type)
+ {
+ 	return *((uint16_t *)nfct_helper_attr_get(nfct_helper, type));
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_get_u16);
+ 
+ /**
+  * nfct_helper_attr_get_u32 - get one attribute the helper object
+@@ -414,12 +400,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u16);
+  * This function returns a unsigned 32-bits integer. If the attribute is
+  * unsupported, this returns NULL.
+  */
+-uint32_t nfct_helper_attr_get_u32(struct nfct_helper *nfct_helper,
+-				  enum nfct_helper_attr_type type)
++uint32_t __EXPORTED
++nfct_helper_attr_get_u32(struct nfct_helper *nfct_helper,
++			 enum nfct_helper_attr_type type)
+ {
+ 	return *((uint32_t *)nfct_helper_attr_get(nfct_helper, type));
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_get_u32);
+ 
+ /**
+  * nfct_helper_snprintf - print helper object into one buffer
+@@ -431,9 +417,10 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u32);
+  * This function returns -1 in case that some mandatory attributes are
+  * missing. On sucess, it returns 0.
+  */
+-int nfct_helper_snprintf(char *buf, size_t size,
+-			 struct nfct_helper *helper,
+-			 unsigned int type, unsigned int flags)
++int __EXPORTED
++nfct_helper_snprintf(char *buf, size_t size,
++		     struct nfct_helper *helper,
++		     unsigned int type, unsigned int flags)
+ {
+ 	int ret;
+ 
+@@ -454,7 +441,6 @@ int nfct_helper_snprintf(char *buf, size_t size,
+ 
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nfct_helper_snprintf);
+ 
+ /**
+  * @}
+@@ -490,7 +476,7 @@ EXPORT_SYMBOL(nfct_helper_snprintf);
+  * - Command NFNL_MSG_ACCT_DEL, to delete one specific nfct_helper object (if
+  *   unused, otherwise you hit EBUSY).
+  */
+-struct nlmsghdr *
++struct nlmsghdr __EXPORTED *
+ nfct_helper_nlmsg_build_hdr(char *buf, uint8_t cmd,
+ 			    uint16_t flags, uint32_t seq)
+ {
+@@ -509,7 +495,6 @@ nfct_helper_nlmsg_build_hdr(char *buf, uint8_t cmd,
+ 
+ 	return nlh;
+ }
+-EXPORT_SYMBOL(nfct_helper_nlmsg_build_hdr);
+ 
+ static void
+ nfct_helper_nlmsg_build_policy(struct nlmsghdr *nlh,
+@@ -530,7 +515,7 @@ nfct_helper_nlmsg_build_policy(struct nlmsghdr *nlh,
+  * \param nlh: netlink message that you want to use to add the payload.
+  * \param nfct_helper: pointer to a helper object
+  */
+-void
++void __EXPORTED
+ nfct_helper_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfct_helper *h)
+ {
+ 	struct nlattr *nest;
+@@ -593,7 +578,6 @@ nfct_helper_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfct_helper *h)
+ 	if (h->bitset & (1 << NFCTH_ATTR_STATUS))
+ 		mnl_attr_put_u32(nlh, NFCTH_STATUS, ntohl(h->status));
+ }
+-EXPORT_SYMBOL(nfct_helper_nlmsg_build_payload);
+ 
+ static int
+ nfct_helper_nlmsg_parse_tuple_cb(const struct nlattr *attr, void *data)
+@@ -795,7 +779,7 @@ nfct_helper_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
+  * This function returns -1 in case that some mandatory attributes are
+  * missing. On sucess, it returns 0.
+  */
+-int
++int __EXPORTED
+ nfct_helper_nlmsg_parse_payload(const struct nlmsghdr *nlh,
+ 				struct nfct_helper *h)
+ {
+@@ -832,7 +816,6 @@ nfct_helper_nlmsg_parse_payload(const struct nlmsghdr *nlh,
+ 	}
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nfct_helper_nlmsg_parse_payload);
+ 
+ /**
+  * @}
+-- 
+cgit v1.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch
new file mode 100644
index 0000000..2c606c8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch
@@ -0,0 +1,264 @@
+From d0c4e39d12f903e06db262656cff2e24d267bed7 Mon Sep 17 00:00:00 2001
+From: Kevin Cernekee <cernekee@chromium.org>
+Date: Wed, 4 Jan 2017 14:30:25 -0800
+Subject: Use __EXPORTED rather than EXPORT_SYMBOL
+
+clang is sensitive to the ordering of
+__attribute__((visibility("default"))) relative to the function
+body.  gcc is not.  So if we try to re-declare an existing function
+with default visibility, clang prints a warning and generates
+a broken .so file in which nfct_timeout_* are not exported to library
+callers.
+
+Move the attribute up into the function definition to make clang happy.
+
+Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ doxygen.cfg.in               |  2 +-
+ src/internal.h               |  5 ++---
+ src/libnetfilter_cttimeout.c | 44 +++++++++++++++++---------------------------
+ 3 files changed, 20 insertions(+), 31 deletions(-)
+
+diff --git a/doxygen.cfg.in b/doxygen.cfg.in
+index 8e5d449..09c3ce0 100644
+--- a/doxygen.cfg.in
++++ b/doxygen.cfg.in
+@@ -72,7 +72,7 @@ RECURSIVE              = YES
+ EXCLUDE                = 
+ EXCLUDE_SYMLINKS       = NO
+ EXCLUDE_PATTERNS       = */.git/* .*.d
+-EXCLUDE_SYMBOLS        = EXPORT_SYMBOL nfct_timeout _container_policy_cb
++EXCLUDE_SYMBOLS        = nfct_timeout _container_policy_cb
+ EXAMPLE_PATH           = 
+ EXAMPLE_PATTERNS       = 
+ EXAMPLE_RECURSIVE      = NO
+diff --git a/src/internal.h b/src/internal.h
+index 3a88d1a..5d78171 100644
+--- a/src/internal.h
++++ b/src/internal.h
+@@ -3,10 +3,9 @@
+ 
+ #include "config.h"
+ #ifdef HAVE_VISIBILITY_HIDDEN
+-#	define __visible	__attribute__((visibility("default")))
+-#	define EXPORT_SYMBOL(x)	typeof(x) (x) __visible
++#	define __EXPORTED	__attribute__((visibility("default")))
+ #else
+-#	define EXPORT_SYMBOL
++#	define __EXPORTED
+ #endif
+ 
+ #endif
+diff --git a/src/libnetfilter_cttimeout.c b/src/libnetfilter_cttimeout.c
+index 7844a1f..a0a7185 100644
+--- a/src/libnetfilter_cttimeout.c
++++ b/src/libnetfilter_cttimeout.c
+@@ -187,7 +187,7 @@ struct nfct_timeout {
+  * In case of success, this function returns a valid pointer, otherwise NULL
+  * s returned and errno is appropriately set.
+  */
+-struct nfct_timeout *nfct_timeout_alloc(void)
++struct nfct_timeout __EXPORTED *nfct_timeout_alloc(void)
+ {
+ 	struct nfct_timeout *t;
+ 
+@@ -197,19 +197,17 @@ struct nfct_timeout *nfct_timeout_alloc(void)
+ 
+ 	return t;
+ }
+-EXPORT_SYMBOL(nfct_timeout_alloc);
+ 
+ /**
+  * nfct_timeout_free - release one conntrack timeout object
+  * \param t pointer to the conntrack timeout object
+  */
+-void nfct_timeout_free(struct nfct_timeout *t)
++void __EXPORTED nfct_timeout_free(struct nfct_timeout *t)
+ {
+ 	if (t->timeout)
+ 		free(t->timeout);
+ 	free(t);
+ }
+-EXPORT_SYMBOL(nfct_timeout_free);
+ 
+ /**
+  * nfct_timeout_attr_set - set one attribute of the conntrack timeout object
+@@ -217,7 +215,7 @@ EXPORT_SYMBOL(nfct_timeout_free);
+  * \param type attribute type you want to set
+  * \param data pointer to data that will be used to set this attribute
+  */
+-int
++int __EXPORTED
+ nfct_timeout_attr_set(struct nfct_timeout *t, uint32_t type, const void *data)
+ {
+ 	switch(type) {
+@@ -236,7 +234,6 @@ nfct_timeout_attr_set(struct nfct_timeout *t, uint32_t type, const void *data)
+ 	t->attrset |= (1 << type);
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nfct_timeout_attr_set);
+ 
+ /**
+  * nfct_timeout_attr_set_u8 - set one attribute of the conntrack timeout object
+@@ -244,12 +241,11 @@ EXPORT_SYMBOL(nfct_timeout_attr_set);
+  * \param type attribute type you want to set
+  * \param data pointer to data that will be used to set this attribute
+  */
+-int
++int __EXPORTED
+ nfct_timeout_attr_set_u8(struct nfct_timeout *t, uint32_t type, uint8_t data)
+ {
+ 	return nfct_timeout_attr_set(t, type, &data);
+ }
+-EXPORT_SYMBOL(nfct_timeout_attr_set_u8);
+ 
+ /**
+  * nfct_timeout_attr_set_u16 - set one attribute of the conntrack timeout object
+@@ -257,23 +253,21 @@ EXPORT_SYMBOL(nfct_timeout_attr_set_u8);
+  * \param type attribute type you want to set
+  * \param data pointer to data that will be used to set this attribute
+  */
+-int
++int __EXPORTED
+ nfct_timeout_attr_set_u16(struct nfct_timeout *t, uint32_t type, uint16_t data)
+ {
+ 	return nfct_timeout_attr_set(t, type, &data);
+ }
+-EXPORT_SYMBOL(nfct_timeout_attr_set_u16);
+ 
+ /**
+  * nfct_timeout_attr_unset - unset one attribute of the conntrack timeout object
+  * \param t pointer to the conntrack timeout object
+  * \param type attribute type you want to set
+  */
+-void nfct_timeout_attr_unset(struct nfct_timeout *t, uint32_t type)
++void __EXPORTED nfct_timeout_attr_unset(struct nfct_timeout *t, uint32_t type)
+ {
+ 	t->attrset &= ~(1 << type);
+ }
+-EXPORT_SYMBOL(nfct_timeout_attr_unset);
+ 
+ /**
+  * nfct_timeout_policy_attr_set_u32 - set one attribute of the policy
+@@ -281,7 +275,7 @@ EXPORT_SYMBOL(nfct_timeout_attr_unset);
+  * \param type attribute type you want to set
+  * \param data data that will be used to set this attribute
+  */
+-int
++int __EXPORTED
+ nfct_timeout_policy_attr_set_u32(struct nfct_timeout *t,
+ 				 uint32_t type, uint32_t data)
+ {
+@@ -319,18 +313,17 @@ nfct_timeout_policy_attr_set_u32(struct nfct_timeout *t,
+ 
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nfct_timeout_policy_attr_set_u32);
+ 
+ /**
+  * nfct_timeout_policy_attr_unset - unset one attribute of the policy
+  * \param t pointer to the conntrack timeout object
+  * \param type attribute type you want to set
+  */
+-void nfct_timeout_policy_attr_unset(struct nfct_timeout *t, uint32_t type)
++void __EXPORTED
++nfct_timeout_policy_attr_unset(struct nfct_timeout *t, uint32_t type)
+ {
+ 	t->attrset &= ~(1 << type);
+ }
+-EXPORT_SYMBOL(nfct_timeout_policy_attr_unset);
+ 
+ /**
+  * nfct_timeout_policy_attr_to_name - get state name from protocol state number
+@@ -340,7 +333,8 @@ EXPORT_SYMBOL(nfct_timeout_policy_attr_unset);
+  * This function returns NULL if unsupported protocol or state number is passed.
+  * Otherwise, a pointer to valid string is returned.
+  */
+-const char *nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
++const char __EXPORTED *
++nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
+ {
+ 	if (timeout_protocol[l4proto].state_to_name == NULL) {
+ 		printf("no array state name\n");
+@@ -354,7 +348,6 @@ const char *nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
+ 
+ 	return timeout_protocol[l4proto].state_to_name[state];
+ }
+-EXPORT_SYMBOL(nfct_timeout_policy_attr_to_name);
+ 
+ /**
+  * @}
+@@ -438,8 +431,9 @@ nfct_timeout_snprintf_default(char *buf, size_t size,
+  * This function returns -1 in case that some mandatory attributes are
+  * missing. On sucess, it returns 0.
+  */
+-int nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
+-			  unsigned int type, unsigned int flags)
++int __EXPORTED
++nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
++		      unsigned int type, unsigned int flags)
+ {
+ 	int ret = 0;
+ 
+@@ -454,7 +448,6 @@ int nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
+ 
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nfct_timeout_snprintf);
+ 
+ /**
+  * @}
+@@ -477,7 +470,7 @@ EXPORT_SYMBOL(nfct_timeout_snprintf);
+  * - CTNL_MSG_TIMEOUT_GET: get conntrack timeout object.
+  * - CTNL_MSG_TIMEOUT_DEL: delete conntrack timeout object.
+  */
+-struct nlmsghdr *
++struct nlmsghdr __EXPORTED *
+ nfct_timeout_nlmsg_build_hdr(char *buf, uint8_t cmd,
+ 			     uint16_t flags, uint32_t seq)
+ {
+@@ -496,14 +489,13 @@ nfct_timeout_nlmsg_build_hdr(char *buf, uint8_t cmd,
+ 
+ 	return nlh;
+ }
+-EXPORT_SYMBOL(nfct_timeout_nlmsg_build_hdr);
+ 
+ /**
+  * nfct_timeout_nlmsg_build_payload - build payload from ct timeout object
+  * \param nlh: netlink message that you want to use to add the payload.
+  * \param t: pointer to a conntrack timeout object
+  */
+-void
++void __EXPORTED
+ nfct_timeout_nlmsg_build_payload(struct nlmsghdr *nlh,
+ 				 const struct nfct_timeout *t)
+ {
+@@ -532,7 +524,6 @@ nfct_timeout_nlmsg_build_payload(struct nlmsghdr *nlh,
+ 	}
+ 
+ }
+-EXPORT_SYMBOL(nfct_timeout_nlmsg_build_payload);
+ 
+ static int
+ timeout_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
+@@ -629,7 +620,7 @@ timeout_parse_attr_data(struct nfct_timeout *t, const struct nlattr *nest)
+  * This function returns -1 in case that some mandatory attributes are
+  * missing. On sucess, it returns 0.
+  */
+-int
++int __EXPORTED
+ nfct_timeout_nlmsg_parse_payload(const struct nlmsghdr *nlh,
+ 				 struct nfct_timeout *t)
+ {
+@@ -654,7 +645,6 @@ nfct_timeout_nlmsg_parse_payload(const struct nlmsghdr *nlh,
+ 	}
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nfct_timeout_nlmsg_parse_payload);
+ 
+ /**
+  * @}
+-- 
+cgit v1.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/replace-VLAs-in-union.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/replace-VLAs-in-union.patch
deleted file mode 100644
index 16e4af4..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/replace-VLAs-in-union.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-VLAs in structs and unions (non-PODs) is unsupported in non-gcc compilers
-therefore convert it to not use VLAs instead use fixed arrays
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Pending
-Index: libnetfilter_conntrack-1.0.4/src/conntrack/api.c
-===================================================================
---- libnetfilter_conntrack-1.0.4.orig/src/conntrack/api.c
-+++ libnetfilter_conntrack-1.0.4/src/conntrack/api.c
-@@ -954,16 +954,15 @@ int nfct_query(struct nfct_handle *h,
- 	       const enum nf_conntrack_query qt,
- 	       const void *data)
- {
--	size_t size = 4096;	/* enough for now */
- 	union {
--		char buffer[size];
-+		char buffer[4096];
- 		struct nfnlhdr req;
- 	} u;
- 
- 	assert(h != NULL);
- 	assert(data != NULL);
- 
--	if (__build_query_ct(h->nfnlssh_ct, qt, data, &u.req, size) == -1)
-+	if (__build_query_ct(h->nfnlssh_ct, qt, data, &u.req, 4096) == -1)
- 		return -1;
- 
- 	return nfnl_query(h->nfnlh, &u.req.nlh);
-@@ -986,16 +985,15 @@ int nfct_send(struct nfct_handle *h,
- 	      const enum nf_conntrack_query qt,
- 	      const void *data)
- {
--	size_t size = 4096;	/* enough for now */
- 	union {
--		char buffer[size];
-+		char buffer[4096];
- 		struct nfnlhdr req;
- 	} u;
- 
- 	assert(h != NULL);
- 	assert(data != NULL);
- 
--	if (__build_query_ct(h->nfnlssh_ct, qt, data, &u.req, size) == -1)
-+	if (__build_query_ct(h->nfnlssh_ct, qt, data, &u.req, 4096) == -1)
- 		return -1;
- 
- 	return nfnl_send(h->nfnlh, &u.req.nlh);
-Index: libnetfilter_conntrack-1.0.4/src/expect/api.c
-===================================================================
---- libnetfilter_conntrack-1.0.4.orig/src/expect/api.c
-+++ libnetfilter_conntrack-1.0.4/src/expect/api.c
-@@ -669,16 +669,15 @@ int nfexp_query(struct nfct_handle *h,
- 	        const enum nf_conntrack_query qt,
- 	        const void *data)
- {
--	size_t size = 4096;	/* enough for now */
- 	union {
--		char buffer[size];
-+		char buffer[4096];
- 		struct nfnlhdr req;
- 	} u;
- 
- 	assert(h != NULL);
- 	assert(data != NULL);
- 
--	if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, size) == -1)
-+	if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, 4096) == -1)
- 		return -1;
- 
- 	return nfnl_query(h->nfnlh, &u.req.nlh);
-@@ -701,16 +700,15 @@ int nfexp_send(struct nfct_handle *h,
- 	       const enum nf_conntrack_query qt,
- 	       const void *data)
- {
--	size_t size = 4096;	/* enough for now */
- 	union {
--		char buffer[size];
-+		char buffer[4096];
- 		struct nfnlhdr req;
- 	} u;
- 
- 	assert(h != NULL);
- 	assert(data != NULL);
- 
--	if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, size) == -1)
-+	if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, 4096) == -1)
- 		return -1;
- 
- 	return nfnl_send(h->nfnlh, &u.req.nlh);
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb
index 0d71303..974035c 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb
@@ -6,7 +6,9 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 DEPENDS = "libnfnetlink libmnl"
 
-SRC_URI = "http://ftp.netfilter.org/pub/libnetfilter_acct/libnetfilter_acct-1.0.3.tar.bz2"
+SRC_URI = "http://ftp.netfilter.org/pub/libnetfilter_acct/libnetfilter_acct-1.0.3.tar.bz2 \
+           file://0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch \
+"
 SRC_URI[md5sum] = "814b2972b2f5c740ff87510bc109168b"
 SRC_URI[sha256sum] = "4250ceef3efe2034f4ac05906c3ee427db31b9b0a2df41b2744f4bf79a959a1a"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.4.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.4.bb
deleted file mode 100644
index ecbc86b..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.4.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-SUMMARY = "Netfilter connection tracking library"
-DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter connection tracking state table"
-HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_conntrack/index.html"
-SECTION = "libs"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
-DEPENDS = "libnfnetlink libmnl"
-
-SRC_URI = "http://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-${PV}.tar.bz2;name=tar \
-           file://replace-VLAs-in-union.patch \
-"
-SRC_URI[tar.md5sum] = "18cf80c4b339a3285e78822dbd4f08d7"
-SRC_URI[tar.sha256sum] = "d9ec4a3caf49417f2b0a2d8d44249133e8c3ec78c757b7eb8c273f1cb6929c7d"
-
-S = "${WORKDIR}/libnetfilter_conntrack-${PV}"
-
-inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.6.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.6.bb
new file mode 100644
index 0000000..e4e186b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.6.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Netfilter connection tracking library"
+DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter connection tracking state table"
+HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_conntrack/index.html"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+DEPENDS = "libnfnetlink libmnl"
+
+SRC_URI = "http://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-${PV}.tar.bz2;name=tar \
+"
+SRC_URI[tar.md5sum] = "7139c5f408dd9606ffecfd5dcda8175b"
+SRC_URI[tar.sha256sum] = "efcc08021284e75f4d96d3581c5155a11f08fd63316b1938cbcb269c87f37feb"
+
+S = "${WORKDIR}/libnetfilter_conntrack-${PV}"
+
+inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb
index 3d37997..92cb23d 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb
@@ -6,7 +6,9 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
 DEPENDS = "libmnl"
 
-SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${PV}.tar.bz2;name=tar"
+SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${PV}.tar.bz2;name=tar \
+           file://libnetfilter-cthelper-visibility-hidden.patch \
+"
 SRC_URI[tar.md5sum] = "b2efab1a3a198a5add448960ba011acd"
 SRC_URI[tar.sha256sum] = "07618e71c4d9a6b6b3dc1986540486ee310a9838ba754926c7d14a17d8fccf3d"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb
index dcf7485..ff32f34 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb
@@ -5,7 +5,9 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
 DEPENDS = "libmnl"
 
-SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${PV}.tar.bz2;name=tar"
+SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${PV}.tar.bz2;name=tar \
+           file://libnetfilter-cttimeout-visibility-hidden.patch \
+"
 SRC_URI[tar.md5sum] = "7697437fc9ebb6f6b83df56a633db7f9"
 SRC_URI[tar.sha256sum] = "aeab12754f557cba3ce2950a2029963d817490df7edb49880008b34d7ff8feba"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb
index 30c9ae6..2f627d4 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb
@@ -4,12 +4,12 @@
 SECTION = "libs"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
-DEPENDS = "libnfnetlink"
+DEPENDS = "libnfnetlink libmnl"
+SRCREV = "ba196a97e810746e5660fe3f57c87c0ed0f2b324"
+PV .= "+git${SRCPV}"
 
-SRC_URI = "http://www.netfilter.org/projects/libnetfilter_log/files/libnetfilter_log-${PV}.tar.bz2;name=tar"
-SRC_URI[tar.md5sum] = "2a4bb0654ae675a52d2e8d1c06090b94"
-SRC_URI[tar.sha256sum] = "74e0fe75753dba3ac114531b5e73240452c789a3f3adccf5c51217da1d933b21"
+SRC_URI = "git://git.netfilter.org/libnetfilter_log"
 
-S = "${WORKDIR}/libnetfilter_log-${PV}"
+S = "${WORKDIR}/git"
 
 inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb
index ddf2aa5..754e11d 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb
@@ -6,10 +6,14 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
 DEPENDS = "libnfnetlink libmnl"
 
-SRC_URI = "http://www.netfilter.org/projects/libnetfilter_queue/files/libnetfilter_queue-${PV}.tar.bz2;name=tar"
-SRC_URI[tar.md5sum] = "df09befac35cb215865b39a36c96a3fa"
-SRC_URI[tar.sha256sum] = "838490eb5dbe358f9669823704982f5313a8d397111562373200203f93ac1a32"
+PV .= "+git${SRCREV}"
+SRCREV = "981025e103d887fb6a9c9bb49c74ec323108d098"
 
-S = "${WORKDIR}/libnetfilter_queue-${PV}"
+SRC_URI = "git://git.netfilter.org/libnetfilter_queue \
+           file://0001-Correct-typo-in-the-location-of-internal.h-in-includ.patch \
+           file://0001-libnetfilter-queue-Declare-the-define-visivility-attribute-together.patch \
+           "
+
+S = "${WORKDIR}/git"
 
 inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0001-build-resolve-automake-1.12-warnings.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0001-build-resolve-automake-1.12-warnings.patch
new file mode 100644
index 0000000..00d95cd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0001-build-resolve-automake-1.12-warnings.patch
@@ -0,0 +1,28 @@
+From 2e5f2b81fb8cbe0d1cd33e58caa19ac308e1f847 Mon Sep 17 00:00:00 2001
+From: Jan Engelhardt <jengelh@inai.de>
+Date: Tue, 9 Oct 2012 15:59:48 +0200
+Subject: [PATCH 1/6] build: resolve automake-1.12 warnings
+
+am/ltlibrary.am: warning: 'libnfnetlink.la': linking libtool libraries
+using a non-POSIX archiver requires 'AM_PROG_AR' in 'configure.ac'
+
+Signed-off-by: Jan Engelhardt <jengelh@inai.de>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index ed549df..0926a1c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -7,6 +7,7 @@ AC_CANONICAL_HOST
+ 
+ AM_INIT_AUTOMAKE([-Wall foreign subdir-objects
+ 	tar-pax no-dist-gzip dist-bzip2 1.6])
++m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+ 
+ dnl kernel style compile messages
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0002-src-get-source-code-license-header-in-sync-with-curr.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0002-src-get-source-code-license-header-in-sync-with-curr.patch
new file mode 100644
index 0000000..c2fb5e0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0002-src-get-source-code-license-header-in-sync-with-curr.patch
@@ -0,0 +1,49 @@
+From 5e6b6e23a8b04475c5a9de7eddb4c18103932fe5 Mon Sep 17 00:00:00 2001
+From: Pablo Neira Ayuso <pablo@netfilter.org>
+Date: Wed, 7 Aug 2013 20:53:57 +0200
+Subject: [PATCH 2/6] src: get source code license header in sync with current
+ licensing terms
+
+Since (3956761 license: upgrade to GPLv2+), we upgraded to GPLv2+,
+propagate that changes to src/iftable.c and src/rtnl.c
+
+Reported-by: Thomas Woerner <twoerner@redhat.com>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ src/iftable.c | 2 +-
+ src/rtnl.c    | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/iftable.c b/src/iftable.c
+index 0325335..5976ed8 100644
+--- a/src/iftable.c
++++ b/src/iftable.c
+@@ -3,7 +3,7 @@
+  * (C) 2004 by Astaro AG, written by Harald Welte <hwelte@astaro.com>
+  * (C) 2008 by Pablo Neira Ayuso <pablo@netfilter.org>
+  *
+- * This software is Free Software and licensed under GNU GPLv2. 
++ * This software is Free Software and licensed under GNU GPLv2+.
+  */
+ 
+ /* IFINDEX handling */
+diff --git a/src/rtnl.c b/src/rtnl.c
+index 5ccb272..7b4ac7d 100644
+--- a/src/rtnl.c
++++ b/src/rtnl.c
+@@ -1,10 +1,10 @@
+ /* rtnl - rtnetlink utility functions
+  *
+  * (C) 2004 by Astaro AG, written by Harald Welte <hwelte@astaro.com>
+- * 
++ *
+  * Adapted to nfnetlink by Eric Leblond <eric@inl.fr>
+  *
+- * This software is free software and licensed under GNU GPLv2. 
++ * This software is free software and licensed under GNU GPLv2+.
+  *
+  */
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0003-configure-uclinux-is-also-linux.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0003-configure-uclinux-is-also-linux.patch
new file mode 100644
index 0000000..6cb7ed6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0003-configure-uclinux-is-also-linux.patch
@@ -0,0 +1,27 @@
+From b259fe13826414c1bd5328a25c8d6d60e20e65f2 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Tue, 10 Sep 2013 16:23:29 -0300
+Subject: [PATCH 3/6] configure: uclinux is also linux
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0926a1c..b979772 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -18,7 +18,7 @@ AC_DISABLE_STATIC
+ AM_PROG_LIBTOOL
+ 
+ case "$host" in 
+-*-*-linux*) ;;
++*-*-linux* | *-*-uclinux*) ;;
+ *) AC_MSG_ERROR([Linux only, dude!]);;
+ esac
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch
new file mode 100644
index 0000000..cf3a841
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch
@@ -0,0 +1,39 @@
+From b142da8d2c9e2e2dfbe4e89e680dd124f6064ac8 Mon Sep 17 00:00:00 2001
+From: Pablo Neira Ayuso <pablo@netfilter.org>
+Date: Mon, 3 Feb 2014 12:09:29 +0100
+Subject: [PATCH 4/6] libnfnetlink: initialize attribute padding to resolve
+ valgrind warnings
+
+==12195== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
+==12195==    at 0x51209C3: __sendto_nocancel (syscall-template.S:81)
+==12195==    by 0x53E4D12: nfnl_send (libnfnetlink.c:391)
+==12195==    by 0x53E6952: nfnl_query (libnfnetlink.c:1569)
+==12195==    by 0x4E344AF: __build_send_cfg_msg.isra.1 (libnetfilter_log.c:143)
+==12195==    by 0x4E34710: nflog_bind_group (libnetfilter_log.c:413)
+==12195==    by 0x400CB1: main (nfulnl_test.c:77)
+==12195==  Address 0x7fefff3e9 is on thread 1's stack
+
+This patch sets to zero the padding that is included to align the
+attribute payload.
+
+Reported-by: Ivan Homoliak <xhomol11@gmail.com>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ src/libnfnetlink.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
+index 4b2bcd0..398b7d7 100644
+--- a/src/libnfnetlink.c
++++ b/src/libnfnetlink.c
+@@ -809,6 +809,7 @@ int nfnl_addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,
+ 	nfa->nfa_type = type;
+ 	nfa->nfa_len = len;
+ 	memcpy(NFA_DATA(nfa), data, alen);
++	memset((uint8_t *)nfa + nfa->nfa_len, 0, NFA_ALIGN(alen) - alen);
+ 	n->nlmsg_len = (NLMSG_ALIGN(n->nlmsg_len) + NFA_ALIGN(len));
+ 	return 0;
+ }
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0005-include-Sync-with-kernel-headers.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0005-include-Sync-with-kernel-headers.patch
new file mode 100644
index 0000000..383f0e8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0005-include-Sync-with-kernel-headers.patch
@@ -0,0 +1,110 @@
+From b10c90a61a5fc46f2be5aeecb9c96e84178f7717 Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sat, 16 May 2015 14:49:07 +0200
+Subject: [PATCH 5/6] include: Sync with kernel headers
+
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ include/libnfnetlink/linux_nfnetlink.h        | 44 ++++-----------------------
+ include/libnfnetlink/linux_nfnetlink_compat.h | 12 ++++----
+ 2 files changed, 12 insertions(+), 44 deletions(-)
+
+diff --git a/include/libnfnetlink/linux_nfnetlink.h b/include/libnfnetlink/linux_nfnetlink.h
+index 76a8550..44a38d6 100644
+--- a/include/libnfnetlink/linux_nfnetlink.h
++++ b/include/libnfnetlink/linux_nfnetlink.h
+@@ -25,9 +25,9 @@ enum nfnetlink_groups {
+ /* General form of address family dependent message.
+  */
+ struct nfgenmsg {
+-	u_int8_t  nfgen_family;		/* AF_xxx */
+-	u_int8_t  version;		/* nfnetlink version */
+-	u_int16_t    res_id;		/* resource id */
++	__u8  nfgen_family;		/* AF_xxx */
++	__u8  version;		/* nfnetlink version */
++	__be16    res_id;		/* resource id */
+ };
+ 
+ #define NFNETLINK_V0	0
+@@ -46,40 +46,8 @@ struct nfgenmsg {
+ #define NFNL_SUBSYS_CTNETLINK_EXP	2
+ #define NFNL_SUBSYS_QUEUE		3
+ #define NFNL_SUBSYS_ULOG		4
+-#define NFNL_SUBSYS_COUNT		5
++#define NFNL_SUBSYS_OSF			5
++#define NFNL_SUBSYS_IPSET		6
++#define NFNL_SUBSYS_COUNT		7
+ 
+-#ifdef __KERNEL__
+-
+-#include <linux/netlink.h>
+-#include <linux/capability.h>
+-#include <net/netlink.h>
+-
+-struct nfnl_callback
+-{
+-	int (*call)(struct sock *nl, struct sk_buff *skb, 
+-		struct nlmsghdr *nlh, struct nlattr *cda[]);
+-	const struct nla_policy *policy;	/* netlink attribute policy */
+-	const u_int16_t attr_count;		/* number of nlattr's */
+-};
+-
+-struct nfnetlink_subsystem
+-{
+-	const char *name;
+-	__u8 subsys_id;			/* nfnetlink subsystem ID */
+-	__u8 cb_count;			/* number of callbacks */
+-	const struct nfnl_callback *cb;	/* callback for individual types */
+-};
+-
+-extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
+-extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
+-
+-extern int nfnetlink_has_listeners(unsigned int group);
+-extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, 
+-			  int echo);
+-extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags);
+-
+-#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
+-	MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
+-
+-#endif	/* __KERNEL__ */
+ #endif	/* _NFNETLINK_H */
+diff --git a/include/libnfnetlink/linux_nfnetlink_compat.h b/include/libnfnetlink/linux_nfnetlink_compat.h
+index e145176..74b9e55 100644
+--- a/include/libnfnetlink/linux_nfnetlink_compat.h
++++ b/include/libnfnetlink/linux_nfnetlink_compat.h
+@@ -1,6 +1,8 @@
+ #ifndef _NFNETLINK_COMPAT_H
+ #define _NFNETLINK_COMPAT_H
+-#ifndef __KERNEL__
++
++#include <linux/types.h>
++
+ /* Old nfnetlink macros for userspace */
+ 
+ /* nfnetlink groups: Up to 32 maximum */
+@@ -18,10 +20,9 @@
+  * ! nfnetlink use the same attributes methods. - J. Schulist.
+  */
+ 
+-struct nfattr
+-{
+-	u_int16_t nfa_len;
+-	u_int16_t nfa_type;	/* we use 15 bits for the type, and the highest
++struct nfattr {
++	__u16 nfa_len;
++	__u16 nfa_type;	/* we use 15 bits for the type, and the highest
+ 				 * bit to indicate whether the payload is nested */
+ };
+ 
+@@ -57,5 +58,4 @@ struct nfattr
+         + NLMSG_ALIGN(sizeof(struct nfgenmsg))))
+ #define NFM_PAYLOAD(n)  NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg))
+ 
+-#endif /* ! __KERNEL__ */
+ #endif /* _NFNETLINK_COMPAT_H */
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0006-src-Use-stdint-types-everywhere.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0006-src-Use-stdint-types-everywhere.patch
new file mode 100644
index 0000000..72c9987
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0006-src-Use-stdint-types-everywhere.patch
@@ -0,0 +1,403 @@
+From 5cb589e246c91331ee6b3926b15f5e6cfc8ad95e Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sat, 16 May 2015 14:59:57 +0200
+Subject: [PATCH 6/6] src: Use stdint types everywhere
+
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ include/libnfnetlink/libnfnetlink.h | 25 ++++++-------
+ src/iftable.c                       |  8 ++---
+ src/iftable.h                       |  4 +--
+ src/libnfnetlink.c                  | 72 ++++++++++++++++++-------------------
+ src/rtnl.c                          |  4 +--
+ src/rtnl.h                          |  2 +-
+ 6 files changed, 58 insertions(+), 57 deletions(-)
+
+diff --git a/include/libnfnetlink/libnfnetlink.h b/include/libnfnetlink/libnfnetlink.h
+index 1d8c49d..cd0be3d 100644
+--- a/include/libnfnetlink/libnfnetlink.h
++++ b/include/libnfnetlink/libnfnetlink.h
+@@ -15,6 +15,7 @@
+ #define aligned_u64 unsigned long long __attribute__((aligned(8)))
+ #endif
+ 
++#include <stdint.h>
+ #include <sys/socket.h>	/* for sa_family_t */
+ #include <linux/netlink.h>
+ #include <libnfnetlink/linux_nfnetlink.h>
+@@ -55,7 +56,7 @@ struct nfnlhdr {
+ struct nfnl_callback {
+ 	int (*call)(struct nlmsghdr *nlh, struct nfattr *nfa[], void *data);
+ 	void *data;
+-	u_int16_t attr_count;
++	uint16_t attr_count;
+ };
+ 
+ struct nfnl_handle;
+@@ -69,7 +70,7 @@ extern struct nfnl_handle *nfnl_open(void);
+ extern int nfnl_close(struct nfnl_handle *);
+ 
+ extern struct nfnl_subsys_handle *nfnl_subsys_open(struct nfnl_handle *, 
+-						   u_int8_t, u_int8_t, 
++						   uint8_t, uint8_t,
+ 						   unsigned int);
+ extern void nfnl_subsys_close(struct nfnl_subsys_handle *);
+ 
+@@ -88,8 +89,8 @@ extern int nfnl_sendiov(const struct nfnl_handle *nfnlh,
+ 			const struct iovec *iov, unsigned int num,
+ 			unsigned int flags);
+ extern void nfnl_fill_hdr(struct nfnl_subsys_handle *, struct nlmsghdr *,
+-			  unsigned int, u_int8_t, u_int16_t, u_int16_t,
+-			  u_int16_t);
++			  unsigned int, uint8_t, uint16_t, uint16_t,
++			  uint16_t);
+ extern __attribute__((deprecated)) int
+ nfnl_talk(struct nfnl_handle *, struct nlmsghdr *, pid_t,
+           unsigned, struct nlmsghdr *,
+@@ -103,8 +104,8 @@ nfnl_listen(struct nfnl_handle *,
+ /* receiving */
+ extern ssize_t nfnl_recv(const struct nfnl_handle *h, unsigned char *buf, size_t len);
+ extern int nfnl_callback_register(struct nfnl_subsys_handle *,
+-				  u_int8_t type, struct nfnl_callback *cb);
+-extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, u_int8_t type);
++				  uint8_t type, struct nfnl_callback *cb);
++extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, uint8_t type);
+ extern int nfnl_handle_packet(struct nfnl_handle *, char *buf, int len);
+ 
+ /* parsing */
+@@ -180,12 +181,12 @@ extern int nfnl_query(struct nfnl_handle *h, struct nlmsghdr *nlh);
+ 
+ /* nfnl attribute handling functions */
+ extern int nfnl_addattr_l(struct nlmsghdr *, int, int, const void *, int);
+-extern int nfnl_addattr8(struct nlmsghdr *, int, int, u_int8_t);
+-extern int nfnl_addattr16(struct nlmsghdr *, int, int, u_int16_t);
+-extern int nfnl_addattr32(struct nlmsghdr *, int, int, u_int32_t);
++extern int nfnl_addattr8(struct nlmsghdr *, int, int, uint8_t);
++extern int nfnl_addattr16(struct nlmsghdr *, int, int, uint16_t);
++extern int nfnl_addattr32(struct nlmsghdr *, int, int, uint32_t);
+ extern int nfnl_nfa_addattr_l(struct nfattr *, int, int, const void *, int);
+-extern int nfnl_nfa_addattr16(struct nfattr *, int, int, u_int16_t);
+-extern int nfnl_nfa_addattr32(struct nfattr *, int, int, u_int32_t);
++extern int nfnl_nfa_addattr16(struct nfattr *, int, int, uint16_t);
++extern int nfnl_nfa_addattr32(struct nfattr *, int, int, uint32_t);
+ extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int);
+ #define nfnl_parse_nested(tb, max, nfa) \
+ 	nfnl_parse_attr((tb), (max), NFA_DATA((nfa)), NFA_PAYLOAD((nfa)))
+@@ -197,7 +198,7 @@ extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int);
+ ({	(tail)->nfa_len = (void *) NLMSG_TAIL(nlh) - (void *) tail; })
+ 
+ extern void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa, 
+-				 u_int16_t type, u_int32_t len,
++				 uint16_t type, uint32_t len,
+ 				 unsigned char *val);
+ extern unsigned int nfnl_rcvbufsiz(const struct nfnl_handle *h, 
+ 				   unsigned int size);
+diff --git a/src/iftable.c b/src/iftable.c
+index 5976ed8..157f97b 100644
+--- a/src/iftable.c
++++ b/src/iftable.c
+@@ -27,10 +27,10 @@
+ struct ifindex_node {
+ 	struct list_head head;
+ 
+-	u_int32_t	index;
+-	u_int32_t	type;
+-	u_int32_t	alen;
+-	u_int32_t	flags;
++	uint32_t	index;
++	uint32_t	type;
++	uint32_t	alen;
++	uint32_t	flags;
+ 	char		addr[8];
+ 	char		name[16];
+ };
+diff --git a/src/iftable.h b/src/iftable.h
+index 8df7f24..655df6b 100644
+--- a/src/iftable.h
++++ b/src/iftable.h
+@@ -1,8 +1,8 @@
+ #ifndef _IFTABLE_H
+ #define _IFTABLE_H
+ 
+-int iftable_delete(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif);
+-int iftable_insert(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif);
++int iftable_delete(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif);
++int iftable_insert(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif);
+ 
+ int iftable_init(void);
+ void iftable_fini(void);
+diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
+index 398b7d7..df57533 100644
+--- a/src/libnfnetlink.c
++++ b/src/libnfnetlink.c
+@@ -72,9 +72,9 @@
+ 
+ struct nfnl_subsys_handle {
+ 	struct nfnl_handle 	*nfnlh;
+-	u_int32_t		subscriptions;
+-	u_int8_t		subsys_id;
+-	u_int8_t		cb_count;
++	uint32_t		subscriptions;
++	uint8_t			subsys_id;
++	uint8_t			cb_count;
+ 	struct nfnl_callback 	*cb;	/* array of callbacks */
+ };
+ 
+@@ -86,11 +86,11 @@ struct nfnl_handle {
+ 	int			fd;
+ 	struct sockaddr_nl	local;
+ 	struct sockaddr_nl	peer;
+-	u_int32_t		subscriptions;
+-	u_int32_t		seq;
+-	u_int32_t		dump;
+-	u_int32_t		rcv_buffer_size;	/* for nfnl_catch */
+-	u_int32_t		flags;
++	uint32_t		subscriptions;
++	uint32_t		seq;
++	uint32_t		dump;
++	uint32_t		rcv_buffer_size;	/* for nfnl_catch */
++	uint32_t		flags;
+ 	struct nlmsghdr 	*last_nlhdr;
+ 	struct nfnl_subsys_handle subsys[NFNL_MAX_SUBSYS+1];
+ };
+@@ -145,7 +145,7 @@ unsigned int nfnl_portid(const struct nfnl_handle *h)
+ static int recalc_rebind_subscriptions(struct nfnl_handle *nfnlh)
+ {
+ 	int i, err;
+-	u_int32_t new_subscriptions = nfnlh->subscriptions;
++	uint32_t new_subscriptions = nfnlh->subscriptions;
+ 
+ 	for (i = 0; i < NFNL_MAX_SUBSYS; i++)
+ 		new_subscriptions |= nfnlh->subsys[i].subscriptions;
+@@ -273,8 +273,8 @@ void nfnl_set_rcv_buffer_size(struct nfnl_handle *h, unsigned int size)
+  * a valid address that points to a nfnl_subsys_handle structure is returned.
+  */
+ struct nfnl_subsys_handle *
+-nfnl_subsys_open(struct nfnl_handle *nfnlh, u_int8_t subsys_id,
+-		 u_int8_t cb_count, u_int32_t subscriptions)
++nfnl_subsys_open(struct nfnl_handle *nfnlh, uint8_t subsys_id,
++		 uint8_t cb_count, uint32_t subscriptions)
+ {
+ 	struct nfnl_subsys_handle *ssh;
+ 
+@@ -435,10 +435,10 @@ int nfnl_sendiov(const struct nfnl_handle *nfnlh, const struct iovec *iov,
+  */
+ void nfnl_fill_hdr(struct nfnl_subsys_handle *ssh,
+ 		    struct nlmsghdr *nlh, unsigned int len, 
+-		    u_int8_t family,
+-		    u_int16_t res_id,
+-		    u_int16_t msg_type,
+-		    u_int16_t msg_flags)
++		    uint8_t family,
++		    uint16_t res_id,
++		    uint16_t msg_type,
++		    uint16_t msg_flags)
+ {
+ 	assert(ssh);
+ 	assert(nlh);
+@@ -815,7 +815,7 @@ int nfnl_addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,
+ }
+ 
+ /**
+- * nfnl_nfa_addattr_l - Add variable length attribute to struct nfattr 
++ * nfnl_nfa_addattr_l - Add variable length attribute to struct nfattr
+  *
+  * @nfa: struct nfattr
+  * @maxlen: maximal length of nfattr buffer
+@@ -849,14 +849,14 @@ int nfnl_nfa_addattr_l(struct nfattr *nfa, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_addattr8 - Add u_int8_t attribute to nlmsghdr
++ * nfnl_addattr8 - Add uint8_t attribute to nlmsghdr
+  *
+  * @n: netlink message header to which attribute is to be added
+  * @maxlen: maximum length of netlink message header
+  * @type: type of new attribute
+  * @data: content of new attribute
+  */
+-int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
++int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, uint8_t data)
+ {
+ 	assert(n);
+ 	assert(maxlen > 0);
+@@ -866,7 +866,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+ }
+ 
+ /**
+- * nfnl_nfa_addattr16 - Add u_int16_t attribute to struct nfattr 
++ * nfnl_nfa_addattr16 - Add uint16_t attribute to struct nfattr
+  *
+  * @nfa: struct nfattr
+  * @maxlen: maximal length of nfattr buffer
+@@ -875,7 +875,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+  *
+  */
+ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type, 
+-		       u_int16_t data)
++		       uint16_t data)
+ {
+ 	assert(nfa);
+ 	assert(maxlen > 0);
+@@ -885,7 +885,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_addattr16 - Add u_int16_t attribute to nlmsghdr
++ * nfnl_addattr16 - Add uint16_t attribute to nlmsghdr
+  *
+  * @n: netlink message header to which attribute is to be added
+  * @maxlen: maximum length of netlink message header
+@@ -894,7 +894,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+  *
+  */
+ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+-		   u_int16_t data)
++		   uint16_t data)
+ {
+ 	assert(n);
+ 	assert(maxlen > 0);
+@@ -904,7 +904,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_nfa_addattr32 - Add u_int32_t attribute to struct nfattr 
++ * nfnl_nfa_addattr32 - Add uint32_t attribute to struct nfattr
+  *
+  * @nfa: struct nfattr
+  * @maxlen: maximal length of nfattr buffer
+@@ -913,7 +913,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+  *
+  */
+ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type, 
+-		       u_int32_t data)
++		       uint32_t data)
+ {
+ 	assert(nfa);
+ 	assert(maxlen > 0);
+@@ -923,7 +923,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_addattr32 - Add u_int32_t attribute to nlmsghdr
++ * nfnl_addattr32 - Add uint32_t attribute to nlmsghdr
+  *
+  * @n: netlink message header to which attribute is to be added
+  * @maxlen: maximum length of netlink message header
+@@ -932,7 +932,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+  *
+  */
+ int nfnl_addattr32(struct nlmsghdr *n, int maxlen, int type,
+-		   u_int32_t data)
++		   uint32_t data)
+ {
+ 	assert(n);
+ 	assert(maxlen > 0);
+@@ -980,7 +980,7 @@ int nfnl_parse_attr(struct nfattr *tb[], int max, struct nfattr *nfa, int len)
+  *
+  */ 
+ void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa, 
+-			  u_int16_t type, u_int32_t len, unsigned char *val)
++			  uint16_t type, uint32_t len, unsigned char *val)
+ {
+ 	assert(iov);
+ 	assert(nfa);
+@@ -1115,7 +1115,7 @@ struct nlmsghdr *nfnl_get_msg_next(struct nfnl_handle *h,
+  * appropiately.
+  */
+ int nfnl_callback_register(struct nfnl_subsys_handle *ssh,
+-			   u_int8_t type, struct nfnl_callback *cb)
++			   uint8_t type, struct nfnl_callback *cb)
+ {
+ 	assert(ssh);
+ 	assert(cb);
+@@ -1138,7 +1138,7 @@ int nfnl_callback_register(struct nfnl_subsys_handle *ssh,
+  * On sucess, 0 is returned. On error, -1 is returned and errno is
+  * set appropiately.
+  */
+-int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, u_int8_t type)
++int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, uint8_t type)
+ {
+ 	assert(ssh);
+ 
+@@ -1161,8 +1161,8 @@ int nfnl_check_attributes(const struct nfnl_handle *h,
+ 	assert(nfa);
+ 
+ 	int min_len;
+-	u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+-	u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++	uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++	uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ 	const struct nfnl_subsys_handle *ssh;
+ 	struct nfnl_callback *cb;
+ 
+@@ -1212,8 +1212,8 @@ static int __nfnl_handle_msg(struct nfnl_handle *h, struct nlmsghdr *nlh,
+ 			     int len)
+ {
+ 	struct nfnl_subsys_handle *ssh;
+-	u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+-	u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++	uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++	uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ 	int err = 0;
+ 
+ 	if (subsys_id > NFNL_MAX_SUBSYS)
+@@ -1243,7 +1243,7 @@ int nfnl_handle_packet(struct nfnl_handle *h, char *buf, int len)
+ {
+ 
+ 	while (len >= NLMSG_SPACE(0)) {
+-		u_int32_t rlen;
++		uint32_t rlen;
+ 		struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
+ 
+ 		if (nlh->nlmsg_len < sizeof(struct nlmsghdr)
+@@ -1285,8 +1285,8 @@ static int nfnl_is_error(struct nfnl_handle *h, struct nlmsghdr *nlh)
+ static int nfnl_step(struct nfnl_handle *h, struct nlmsghdr *nlh)
+ {
+ 	struct nfnl_subsys_handle *ssh;
+-	u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+-	u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++	uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++	uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ 
+ 	/* Is this an error message? */
+ 	if (nfnl_is_error(h, nlh)) {
+diff --git a/src/rtnl.c b/src/rtnl.c
+index 7b4ac7d..284eecd 100644
+--- a/src/rtnl.c
++++ b/src/rtnl.c
+@@ -30,7 +30,7 @@
+ #define rtnl_log(x, ...)
+ 
+ static inline struct rtnl_handler *
+-find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type)
++find_handler(struct rtnl_handle *rtnl_handle, uint16_t type)
+ {
+ 	struct rtnl_handler *h;
+ 	for (h = rtnl_handle->handlers; h; h = h->next) {
+@@ -41,7 +41,7 @@ find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type)
+ }
+ 
+ static int call_handler(struct rtnl_handle *rtnl_handle,
+-			u_int16_t type,
++			uint16_t type,
+ 			struct nlmsghdr *hdr)
+ {
+ 	struct rtnl_handler *h = find_handler(rtnl_handle, type);
+diff --git a/src/rtnl.h b/src/rtnl.h
+index 0c403dc..2cb22a8 100644
+--- a/src/rtnl.h
++++ b/src/rtnl.h
+@@ -7,7 +7,7 @@
+ struct rtnl_handler {
+ 	struct rtnl_handler *next;
+ 
+-	u_int16_t	nlmsg_type;
++	uint16_t	nlmsg_type;
+ 	int		(*handlefn)(struct nlmsghdr *h, void *arg);
+ 	void		*arg;
+ };
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb
index edd0f86..f7951ff 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb
@@ -11,7 +11,14 @@
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
 
-SRC_URI = "http://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-${PV}.tar.bz2;name=tar"
+SRC_URI = "http://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-${PV}.tar.bz2;name=tar \
+           file://0001-build-resolve-automake-1.12-warnings.patch \
+           file://0002-src-get-source-code-license-header-in-sync-with-curr.patch \
+           file://0003-configure-uclinux-is-also-linux.patch \
+           file://0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch \
+           file://0005-include-Sync-with-kernel-headers.patch \
+           file://0006-src-Use-stdint-types-everywhere.patch \
+           "
 SRC_URI[tar.md5sum] = "98927583d2016a9fb1936fed992e2c5e"
 SRC_URI[tar.sha256sum] = "f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-Declare-the-define-visivility-attribute-together.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-Declare-the-define-visivility-attribute-together.patch
new file mode 100644
index 0000000..e82b238
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-Declare-the-define-visivility-attribute-together.patch
@@ -0,0 +1,2949 @@
+From bd01f785da5222d0662be3182fe2650e1c12f43e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 10 Apr 2017 14:07:07 -0700
+Subject: [PATCH] Declare the define visivility attribute together
+
+clang ignores the visibility attribute if its not
+defined before the definition. As a result these
+symbols become hidden and consumers of this library
+fail to link due to these missing symbols
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ doxygen.cfg.in  |   2 +-
+ include/utils.h |   5 +--
+ src/batch.c     |  21 ++++-------
+ src/chain.c     | 102 +++++++++++++++++---------------------------------
+ src/common.c    |  21 ++++-------
+ src/expr.c      |  51 +++++++++----------------
+ src/gen.c       |  39 +++++++------------
+ src/object.c    |  99 ++++++++++++++++--------------------------------
+ src/rule.c      | 114 +++++++++++++++++++-------------------------------------
+ src/ruleset.c   |  48 ++++++++----------------
+ src/set.c       |  96 ++++++++++++++++-------------------------------
+ src/set_elem.c  |  72 ++++++++++++-----------------------
+ src/table.c     |  90 +++++++++++++++-----------------------------
+ src/trace.c     |  27 +++++---------
+ src/udata.c     |  48 ++++++++----------------
+ 15 files changed, 279 insertions(+), 556 deletions(-)
+
+diff --git a/doxygen.cfg.in b/doxygen.cfg.in
+index 23fcad4..e49f28d 100644
+--- a/doxygen.cfg.in
++++ b/doxygen.cfg.in
+@@ -72,7 +72,7 @@ RECURSIVE              = YES
+ EXCLUDE                = 
+ EXCLUDE_SYMLINKS       = NO
+ EXCLUDE_PATTERNS       = */.git/* .*.d
+-EXCLUDE_SYMBOLS        = EXPORT_SYMBOL
++EXCLUDE_SYMBOLS        =
+ EXAMPLE_PATH           = 
+ EXAMPLE_PATTERNS       = 
+ EXAMPLE_RECURSIVE      = NO
+diff --git a/include/utils.h b/include/utils.h
+index 2f5cf34..ff8207e 100644
+--- a/include/utils.h
++++ b/include/utils.h
+@@ -9,10 +9,9 @@
+ 
+ #include "config.h"
+ #ifdef HAVE_VISIBILITY_HIDDEN
+-#	define __visible	__attribute__((visibility("default")))
+-#	define EXPORT_SYMBOL(x)	typeof(x) (x) __visible;
++#	define __EXPORTED	__attribute__((visibility("default")))
+ #else
+-#	define EXPORT_SYMBOL
++#	define __EXPORT
+ #endif
+ 
+ #define __noreturn	__attribute__((__noreturn__))
+diff --git a/src/batch.c b/src/batch.c
+index 5ee3fd7..3bedd26 100644
+--- a/src/batch.c
++++ b/src/batch.c
+@@ -57,7 +57,7 @@ static void nftnl_batch_add_page(struct nftnl_batch_page *page,
+ 	list_add_tail(&page->head, &batch->page_list);
+ }
+ 
+-struct nftnl_batch *nftnl_batch_alloc(uint32_t pg_size, uint32_t pg_overrun_size)
++struct nftnl_batch __EXPORTED *nftnl_batch_alloc(uint32_t pg_size, uint32_t pg_overrun_size)
+ {
+ 	struct nftnl_batch *batch;
+ 	struct nftnl_batch_page *page;
+@@ -80,9 +80,8 @@ err1:
+ 	free(batch);
+ 	return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_batch_alloc);
+ 
+-void nftnl_batch_free(struct nftnl_batch *batch)
++void __EXPORTED nftnl_batch_free(struct nftnl_batch *batch)
+ {
+ 	struct nftnl_batch_page *page, *next;
+ 
+@@ -94,9 +93,8 @@ void nftnl_batch_free(struct nftnl_batch *batch)
+ 
+ 	free(batch);
+ }
+-EXPORT_SYMBOL(nftnl_batch_free);
+ 
+-int nftnl_batch_update(struct nftnl_batch *batch)
++int __EXPORTED nftnl_batch_update(struct nftnl_batch *batch)
+ {
+ 	struct nftnl_batch_page *page;
+ 	struct nlmsghdr *last_nlh;
+@@ -119,21 +117,18 @@ int nftnl_batch_update(struct nftnl_batch *batch)
+ err1:
+ 	return -1;
+ }
+-EXPORT_SYMBOL(nftnl_batch_update);
+ 
+-void *nftnl_batch_buffer(struct nftnl_batch *batch)
++void __EXPORTED *nftnl_batch_buffer(struct nftnl_batch *batch)
+ {
+ 	return mnl_nlmsg_batch_current(batch->current_page->batch);
+ }
+-EXPORT_SYMBOL(nftnl_batch_buffer);
+ 
+-uint32_t nftnl_batch_buffer_len(struct nftnl_batch *batch)
++uint32_t __EXPORTED nftnl_batch_buffer_len(struct nftnl_batch *batch)
+ {
+ 	return mnl_nlmsg_batch_size(batch->current_page->batch);
+ }
+-EXPORT_SYMBOL(nftnl_batch_buffer_len);
+ 
+-int nftnl_batch_iovec_len(struct nftnl_batch *batch)
++int __EXPORTED nftnl_batch_iovec_len(struct nftnl_batch *batch)
+ {
+ 	int num_pages = batch->num_pages;
+ 
+@@ -143,9 +138,8 @@ int nftnl_batch_iovec_len(struct nftnl_batch *batch)
+ 
+ 	return num_pages;
+ }
+-EXPORT_SYMBOL(nftnl_batch_iovec_len);
+ 
+-void nftnl_batch_iovec(struct nftnl_batch *batch, struct iovec *iov,
++void __EXPORTED nftnl_batch_iovec(struct nftnl_batch *batch, struct iovec *iov,
+ 		       uint32_t iovlen)
+ {
+ 	struct nftnl_batch_page *page;
+@@ -160,4 +154,3 @@ void nftnl_batch_iovec(struct nftnl_batch *batch, struct iovec *iov,
+ 		i++;
+ 	}
+ }
+-EXPORT_SYMBOL(nftnl_batch_iovec);
+diff --git a/src/chain.c b/src/chain.c
+index 29860c5..362fa0d 100644
+--- a/src/chain.c
++++ b/src/chain.c
+@@ -87,13 +87,12 @@ static const char *nftnl_hooknum2str(int family, int hooknum)
+ 	return "unknown";
+ }
+ 
+-struct nftnl_chain *nftnl_chain_alloc(void)
++struct nftnl_chain __EXPORTED *nftnl_chain_alloc(void)
+ {
+ 	return calloc(1, sizeof(struct nftnl_chain));
+ }
+-EXPORT_SYMBOL(nftnl_chain_alloc);
+ 
+-void nftnl_chain_free(const struct nftnl_chain *c)
++void __EXPORTED nftnl_chain_free(const struct nftnl_chain *c)
+ {
+ 	if (c->flags & (1 << NFTNL_CHAIN_NAME))
+ 		xfree(c->name);
+@@ -105,15 +104,13 @@ void nftnl_chain_free(const struct nftnl_chain *c)
+ 		xfree(c->dev);
+ 	xfree(c);
+ }
+-EXPORT_SYMBOL(nftnl_chain_free);
+ 
+-bool nftnl_chain_is_set(const struct nftnl_chain *c, uint16_t attr)
++bool __EXPORTED nftnl_chain_is_set(const struct nftnl_chain *c, uint16_t attr)
+ {
+ 	return c->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_chain_is_set);
+ 
+-void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
++void __EXPORTED nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
+ {
+ 	if (!(c->flags & (1 << attr)))
+ 		return;
+@@ -147,7 +144,6 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
+ 
+ 	c->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_chain_unset);
+ 
+ static uint32_t nftnl_chain_validate[NFTNL_CHAIN_MAX + 1] = {
+ 	[NFTNL_CHAIN_HOOKNUM]	= sizeof(uint32_t),
+@@ -159,7 +155,7 @@ static uint32_t nftnl_chain_validate[NFTNL_CHAIN_MAX + 1] = {
+ 	[NFTNL_CHAIN_FAMILY]		= sizeof(uint32_t),
+ };
+ 
+-int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
++int __EXPORTED nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
+ 			 const void *data, uint32_t data_len)
+ {
+ 	nftnl_assert_attr_exists(attr, NFTNL_CHAIN_MAX);
+@@ -226,45 +222,38 @@ int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
+ 	c->flags |= (1 << attr);
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_data);
+ 
+-void nftnl_chain_set(struct nftnl_chain *c, uint16_t attr, const void *data)
++void __EXPORTED nftnl_chain_set(struct nftnl_chain *c, uint16_t attr, const void *data)
+ {
+ 	nftnl_chain_set_data(c, attr, data, nftnl_chain_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_chain_set);
+ 
+-void nftnl_chain_set_u32(struct nftnl_chain *c, uint16_t attr, uint32_t data)
++void __EXPORTED nftnl_chain_set_u32(struct nftnl_chain *c, uint16_t attr, uint32_t data)
+ {
+ 	nftnl_chain_set_data(c, attr, &data, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_u32);
+ 
+-void nftnl_chain_set_s32(struct nftnl_chain *c, uint16_t attr, int32_t data)
++void __EXPORTED nftnl_chain_set_s32(struct nftnl_chain *c, uint16_t attr, int32_t data)
+ {
+ 	nftnl_chain_set_data(c, attr, &data, sizeof(int32_t));
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_s32);
+ 
+-void nftnl_chain_set_u64(struct nftnl_chain *c, uint16_t attr, uint64_t data)
++void __EXPORTED nftnl_chain_set_u64(struct nftnl_chain *c, uint16_t attr, uint64_t data)
+ {
+ 	nftnl_chain_set_data(c, attr, &data, sizeof(uint64_t));
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_u64);
+ 
+-void nftnl_chain_set_u8(struct nftnl_chain *c, uint16_t attr, uint8_t data)
++void __EXPORTED nftnl_chain_set_u8(struct nftnl_chain *c, uint16_t attr, uint8_t data)
+ {
+ 	nftnl_chain_set_data(c, attr, &data, sizeof(uint8_t));
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_u8);
+ 
+-int nftnl_chain_set_str(struct nftnl_chain *c, uint16_t attr, const char *str)
++int __EXPORTED nftnl_chain_set_str(struct nftnl_chain *c, uint16_t attr, const char *str)
+ {
+ 	return nftnl_chain_set_data(c, attr, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_str);
+ 
+-const void *nftnl_chain_get_data(const struct nftnl_chain *c, uint16_t attr,
++const void __EXPORTED *nftnl_chain_get_data(const struct nftnl_chain *c, uint16_t attr,
+ 				 uint32_t *data_len)
+ {
+ 	if (!(c->flags & (1 << attr)))
+@@ -310,22 +299,19 @@ const void *nftnl_chain_get_data(const struct nftnl_chain *c, uint16_t attr,
+ 	}
+ 	return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_data);
+ 
+-const void *nftnl_chain_get(const struct nftnl_chain *c, uint16_t attr)
++const void __EXPORTED *nftnl_chain_get(const struct nftnl_chain *c, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	return nftnl_chain_get_data(c, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_chain_get);
+ 
+-const char *nftnl_chain_get_str(const struct nftnl_chain *c, uint16_t attr)
++const char __EXPORTED *nftnl_chain_get_str(const struct nftnl_chain *c, uint16_t attr)
+ {
+ 	return nftnl_chain_get(c, attr);
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_str);
+ 
+-uint32_t nftnl_chain_get_u32(const struct nftnl_chain *c, uint16_t attr)
++uint32_t __EXPORTED nftnl_chain_get_u32(const struct nftnl_chain *c, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	const uint32_t *val = nftnl_chain_get_data(c, attr, &data_len);
+@@ -334,9 +320,8 @@ uint32_t nftnl_chain_get_u32(const struct nftnl_chain *c, uint16_t attr)
+ 
+ 	return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_u32);
+ 
+-int32_t nftnl_chain_get_s32(const struct nftnl_chain *c, uint16_t attr)
++int32_t __EXPORTED nftnl_chain_get_s32(const struct nftnl_chain *c, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	const int32_t *val = nftnl_chain_get_data(c, attr, &data_len);
+@@ -345,9 +330,8 @@ int32_t nftnl_chain_get_s32(const struct nftnl_chain *c, uint16_t attr)
+ 
+ 	return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_s32);
+ 
+-uint64_t nftnl_chain_get_u64(const struct nftnl_chain *c, uint16_t attr)
++uint64_t __EXPORTED nftnl_chain_get_u64(const struct nftnl_chain *c, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	const uint64_t *val = nftnl_chain_get_data(c, attr, &data_len);
+@@ -356,9 +340,8 @@ uint64_t nftnl_chain_get_u64(const struct nftnl_chain *c, uint16_t attr)
+ 
+ 	return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_u64);
+ 
+-uint8_t nftnl_chain_get_u8(const struct nftnl_chain *c, uint16_t attr)
++uint8_t __EXPORTED nftnl_chain_get_u8(const struct nftnl_chain *c, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	const uint8_t *val = nftnl_chain_get_data(c, attr, &data_len);
+@@ -367,9 +350,8 @@ uint8_t nftnl_chain_get_u8(const struct nftnl_chain *c, uint16_t attr)
+ 
+ 	return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_u8);
+ 
+-void nftnl_chain_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_chain *c)
++void __EXPORTED nftnl_chain_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_chain *c)
+ {
+ 	if (c->flags & (1 << NFTNL_CHAIN_TABLE))
+ 		mnl_attr_put_strz(nlh, NFTA_CHAIN_TABLE, c->table);
+@@ -404,7 +386,6 @@ void nftnl_chain_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_ch
+ 	if (c->flags & (1 << NFTNL_CHAIN_TYPE))
+ 		mnl_attr_put_strz(nlh, NFTA_CHAIN_TYPE, c->type);
+ }
+-EXPORT_SYMBOL(nftnl_chain_nlmsg_build_payload);
+ 
+ static int nftnl_chain_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -529,7 +510,7 @@ static int nftnl_chain_parse_hook(struct nlattr *attr, struct nftnl_chain *c)
+ 	return 0;
+ }
+ 
+-int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
++int __EXPORTED nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
+ {
+ 	struct nlattr *tb[NFTA_CHAIN_MAX+1] = {};
+ 	struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -590,7 +571,6 @@ int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
+ 
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nftnl_chain_nlmsg_parse);
+ 
+ static inline int nftnl_str2hooknum(int family, const char *hook)
+ {
+@@ -732,19 +712,17 @@ static int nftnl_chain_do_parse(struct nftnl_chain *c, enum nftnl_parse_type typ
+ 	return ret;
+ }
+ 
+-int nftnl_chain_parse(struct nftnl_chain *c, enum nftnl_parse_type type,
++int __EXPORTED nftnl_chain_parse(struct nftnl_chain *c, enum nftnl_parse_type type,
+ 		    const char *data, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_chain_do_parse(c, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_chain_parse);
+ 
+-int nftnl_chain_parse_file(struct nftnl_chain *c, enum nftnl_parse_type type,
++int __EXPORTED nftnl_chain_parse_file(struct nftnl_chain *c, enum nftnl_parse_type type,
+ 			 FILE *fp, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_chain_do_parse(c, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_chain_parse_file);
+ 
+ static int nftnl_chain_export(char *buf, size_t size,
+ 			      const struct nftnl_chain *c, int type)
+@@ -841,13 +819,12 @@ static int nftnl_chain_cmd_snprintf(char *buf, size_t size,
+ 	return offset;
+ }
+ 
+-int nftnl_chain_snprintf(char *buf, size_t size, const struct nftnl_chain *c,
++int __EXPORTED nftnl_chain_snprintf(char *buf, size_t size, const struct nftnl_chain *c,
+ 			 uint32_t type, uint32_t flags)
+ {
+ 	return nftnl_chain_cmd_snprintf(buf, size, c, nftnl_flag2cmd(flags), type,
+ 				      flags);
+ }
+-EXPORT_SYMBOL(nftnl_chain_snprintf);
+ 
+ static int nftnl_chain_do_snprintf(char *buf, size_t size, const void *c,
+ 				   uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -855,19 +832,18 @@ static int nftnl_chain_do_snprintf(char *buf, size_t size, const void *c,
+ 	return nftnl_chain_snprintf(buf, size, c, type, flags);
+ }
+ 
+-int nftnl_chain_fprintf(FILE *fp, const struct nftnl_chain *c, uint32_t type,
++int __EXPORTED nftnl_chain_fprintf(FILE *fp, const struct nftnl_chain *c, uint32_t type,
+ 			uint32_t flags)
+ {
+ 	return nftnl_fprintf(fp, c, NFTNL_CMD_UNSPEC, type, flags,
+ 			   nftnl_chain_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_chain_fprintf);
+ 
+ struct nftnl_chain_list {
+ 	struct list_head list;
+ };
+ 
+-struct nftnl_chain_list *nftnl_chain_list_alloc(void)
++struct nftnl_chain_list __EXPORTED *nftnl_chain_list_alloc(void)
+ {
+ 	struct nftnl_chain_list *list;
+ 
+@@ -879,9 +855,8 @@ struct nftnl_chain_list *nftnl_chain_list_alloc(void)
+ 
+ 	return list;
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_alloc);
+ 
+-void nftnl_chain_list_free(struct nftnl_chain_list *list)
++void __EXPORTED nftnl_chain_list_free(struct nftnl_chain_list *list)
+ {
+ 	struct nftnl_chain *r, *tmp;
+ 
+@@ -891,33 +866,28 @@ void nftnl_chain_list_free(struct nftnl_chain_list *list)
+ 	}
+ 	xfree(list);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_free);
+ 
+-int nftnl_chain_list_is_empty(const struct nftnl_chain_list *list)
++int __EXPORTED nftnl_chain_list_is_empty(const struct nftnl_chain_list *list)
+ {
+ 	return list_empty(&list->list);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_is_empty);
+ 
+-void nftnl_chain_list_add(struct nftnl_chain *r, struct nftnl_chain_list *list)
++void __EXPORTED nftnl_chain_list_add(struct nftnl_chain *r, struct nftnl_chain_list *list)
+ {
+ 	list_add(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_add);
+ 
+-void nftnl_chain_list_add_tail(struct nftnl_chain *r, struct nftnl_chain_list *list)
++void __EXPORTED nftnl_chain_list_add_tail(struct nftnl_chain *r, struct nftnl_chain_list *list)
+ {
+ 	list_add_tail(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_add_tail);
+ 
+-void nftnl_chain_list_del(struct nftnl_chain *r)
++void __EXPORTED nftnl_chain_list_del(struct nftnl_chain *r)
+ {
+ 	list_del(&r->head);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_del);
+ 
+-int nftnl_chain_list_foreach(struct nftnl_chain_list *chain_list,
++int __EXPORTED nftnl_chain_list_foreach(struct nftnl_chain_list *chain_list,
+ 			   int (*cb)(struct nftnl_chain *r, void *data),
+ 			   void *data)
+ {
+@@ -931,14 +901,13 @@ int nftnl_chain_list_foreach(struct nftnl_chain_list *chain_list,
+ 	}
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_foreach);
+ 
+ struct nftnl_chain_list_iter {
+ 	const struct nftnl_chain_list	*list;
+ 	struct nftnl_chain		*cur;
+ };
+ 
+-struct nftnl_chain_list_iter *
++struct nftnl_chain_list_iter __EXPORTED *
+ nftnl_chain_list_iter_create(const struct nftnl_chain_list *l)
+ {
+ 	struct nftnl_chain_list_iter *iter;
+@@ -955,9 +924,8 @@ nftnl_chain_list_iter_create(const struct nftnl_chain_list *l)
+ 
+ 	return iter;
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_iter_create);
+ 
+-struct nftnl_chain *nftnl_chain_list_iter_next(struct nftnl_chain_list_iter *iter)
++struct nftnl_chain __EXPORTED *nftnl_chain_list_iter_next(struct nftnl_chain_list_iter *iter)
+ {
+ 	struct nftnl_chain *r = iter->cur;
+ 
+@@ -971,10 +939,8 @@ struct nftnl_chain *nftnl_chain_list_iter_next(struct nftnl_chain_list_iter *ite
+ 
+ 	return r;
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_iter_next);
+ 
+-void nftnl_chain_list_iter_destroy(struct nftnl_chain_list_iter *iter)
++void __EXPORTED nftnl_chain_list_iter_destroy(struct nftnl_chain_list_iter *iter)
+ {
+ 	xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_iter_destroy);
+diff --git a/src/common.c b/src/common.c
+index a95883c..68bce2e 100644
+--- a/src/common.c
++++ b/src/common.c
+@@ -43,15 +43,14 @@ static struct nlmsghdr *__nftnl_nlmsg_build_hdr(char *buf, uint16_t type,
+ 	return nlh;
+ }
+ 
+-struct nlmsghdr *nftnl_nlmsg_build_hdr(char *buf, uint16_t type, uint16_t family,
++struct nlmsghdr __EXPORTED *nftnl_nlmsg_build_hdr(char *buf, uint16_t type, uint16_t family,
+ 				       uint16_t flags, uint32_t seq)
+ {
+ 	return __nftnl_nlmsg_build_hdr(buf, (NFNL_SUBSYS_NFTABLES << 8) | type,
+ 				       family, flags, seq, 0);
+ }
+-EXPORT_SYMBOL(nftnl_nlmsg_build_hdr);
+ 
+-struct nftnl_parse_err *nftnl_parse_err_alloc(void)
++struct nftnl_parse_err __EXPORTED *nftnl_parse_err_alloc(void)
+ {
+ 	struct nftnl_parse_err *err;
+ 
+@@ -63,15 +62,13 @@ struct nftnl_parse_err *nftnl_parse_err_alloc(void)
+ 
+ 	return err;
+ }
+-EXPORT_SYMBOL(nftnl_parse_err_alloc);
+ 
+-void nftnl_parse_err_free(struct nftnl_parse_err *err)
++void __EXPORTED nftnl_parse_err_free(struct nftnl_parse_err *err)
+ {
+ 	xfree(err);
+ }
+-EXPORT_SYMBOL(nftnl_parse_err_free);
+ 
+-int nftnl_parse_perror(const char *msg, struct nftnl_parse_err *err)
++int __EXPORTED nftnl_parse_perror(const char *msg, struct nftnl_parse_err *err)
+ {
+ 	switch (err->error) {
+ 	case NFTNL_PARSE_EBADINPUT:
+@@ -89,7 +86,6 @@ int nftnl_parse_perror(const char *msg, struct nftnl_parse_err *err)
+ 		return fprintf(stderr, "%s: Undefined error\n", msg);
+ 	}
+ }
+-EXPORT_SYMBOL(nftnl_parse_perror);
+ 
+ int nftnl_cmd_header_snprintf(char *buf, size_t size, uint32_t cmd, uint32_t type,
+ 			    uint32_t flags)
+@@ -165,21 +161,19 @@ int nftnl_cmd_footer_fprintf(FILE *fp, uint32_t cmd, uint32_t type,
+ 			   nftnl_cmd_footer_fprintf_cb);
+ }
+ 
+-struct nlmsghdr *nftnl_batch_begin(char *buf, uint32_t seq)
++struct nlmsghdr __EXPORTED *nftnl_batch_begin(char *buf, uint32_t seq)
+ {
+ 	return __nftnl_nlmsg_build_hdr(buf, NFNL_MSG_BATCH_BEGIN, AF_UNSPEC,
+ 				       0, seq, NFNL_SUBSYS_NFTABLES);
+ }
+-EXPORT_SYMBOL(nftnl_batch_begin);
+ 
+-struct nlmsghdr *nftnl_batch_end(char *buf, uint32_t seq)
++struct nlmsghdr __EXPORTED *nftnl_batch_end(char *buf, uint32_t seq)
+ {
+ 	return __nftnl_nlmsg_build_hdr(buf, NFNL_MSG_BATCH_END, AF_UNSPEC,
+ 				       0, seq, NFNL_SUBSYS_NFTABLES);
+ }
+-EXPORT_SYMBOL(nftnl_batch_end);
+ 
+-int nftnl_batch_is_supported(void)
++int __EXPORTED nftnl_batch_is_supported(void)
+ {
+ 	struct mnl_socket *nl;
+ 	struct mnl_nlmsg_batch *b;
+@@ -236,4 +230,3 @@ err:
+ 	mnl_nlmsg_batch_stop(b);
+ 	return -1;
+ }
+-EXPORT_SYMBOL(nftnl_batch_is_supported);
+diff --git a/src/expr.c b/src/expr.c
+index 10ba2c4..c7eb2b4 100644
+--- a/src/expr.c
++++ b/src/expr.c
+@@ -24,7 +24,7 @@
+ 
+ #include <libnftnl/expr.h>
+ 
+-struct nftnl_expr *nftnl_expr_alloc(const char *name)
++struct nftnl_expr __EXPORTED *nftnl_expr_alloc(const char *name)
+ {
+ 	struct nftnl_expr *expr;
+ 	struct expr_ops *ops;
+@@ -43,24 +43,21 @@ struct nftnl_expr *nftnl_expr_alloc(const char *name)
+ 
+ 	return expr;
+ }
+-EXPORT_SYMBOL(nftnl_expr_alloc);
+ 
+-void nftnl_expr_free(const struct nftnl_expr *expr)
++void __EXPORTED nftnl_expr_free(const struct nftnl_expr *expr)
+ {
+ 	if (expr->ops->free)
+ 		expr->ops->free(expr);
+ 
+ 	xfree(expr);
+ }
+-EXPORT_SYMBOL(nftnl_expr_free);
+ 
+-bool nftnl_expr_is_set(const struct nftnl_expr *expr, uint16_t type)
++bool __EXPORTED nftnl_expr_is_set(const struct nftnl_expr *expr, uint16_t type)
+ {
+ 	return expr->flags & (1 << type);
+ }
+-EXPORT_SYMBOL(nftnl_expr_is_set);
+ 
+-int nftnl_expr_set(struct nftnl_expr *expr, uint16_t type,
++int __EXPORTED nftnl_expr_set(struct nftnl_expr *expr, uint16_t type,
+ 		   const void *data, uint32_t data_len)
+ {
+ 	switch(type) {
+@@ -73,43 +70,37 @@ int nftnl_expr_set(struct nftnl_expr *expr, uint16_t type,
+ 	expr->flags |= (1 << type);
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_expr_set);
+ 
+-void
++void __EXPORTED
+ nftnl_expr_set_u8(struct nftnl_expr *expr, uint16_t type, uint8_t data)
+ {
+ 	nftnl_expr_set(expr, type, &data, sizeof(uint8_t));
+ }
+-EXPORT_SYMBOL(nftnl_expr_set_u8);
+ 
+-void
++void __EXPORTED
+ nftnl_expr_set_u16(struct nftnl_expr *expr, uint16_t type, uint16_t data)
+ {
+ 	nftnl_expr_set(expr, type, &data, sizeof(uint16_t));
+ }
+-EXPORT_SYMBOL(nftnl_expr_set_u16);
+ 
+-void
++void __EXPORTED
+ nftnl_expr_set_u32(struct nftnl_expr *expr, uint16_t type, uint32_t data)
+ {
+ 	nftnl_expr_set(expr, type, &data, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_expr_set_u32);
+ 
+-void
++void __EXPORTED
+ nftnl_expr_set_u64(struct nftnl_expr *expr, uint16_t type, uint64_t data)
+ {
+ 	nftnl_expr_set(expr, type, &data, sizeof(uint64_t));
+ }
+-EXPORT_SYMBOL(nftnl_expr_set_u64);
+ 
+-int nftnl_expr_set_str(struct nftnl_expr *expr, uint16_t type, const char *str)
++int __EXPORTED nftnl_expr_set_str(struct nftnl_expr *expr, uint16_t type, const char *str)
+ {
+ 	return nftnl_expr_set(expr, type, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_expr_set_str);
+ 
+-const void *nftnl_expr_get(const struct nftnl_expr *expr,
++const void __EXPORTED *nftnl_expr_get(const struct nftnl_expr *expr,
+ 			      uint16_t type, uint32_t *data_len)
+ {
+ 	const void *ret;
+@@ -129,9 +120,8 @@ const void *nftnl_expr_get(const struct nftnl_expr *expr,
+ 
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nftnl_expr_get);
+ 
+-uint8_t nftnl_expr_get_u8(const struct nftnl_expr *expr, uint16_t type)
++uint8_t __EXPORTED nftnl_expr_get_u8(const struct nftnl_expr *expr, uint16_t type)
+ {
+ 	const void *data;
+ 	uint32_t data_len;
+@@ -145,9 +135,8 @@ uint8_t nftnl_expr_get_u8(const struct nftnl_expr *expr, uint16_t type)
+ 
+ 	return *((uint8_t *)data);
+ }
+-EXPORT_SYMBOL(nftnl_expr_get_u8);
+ 
+-uint16_t nftnl_expr_get_u16(const struct nftnl_expr *expr, uint16_t type)
++uint16_t __EXPORTED nftnl_expr_get_u16(const struct nftnl_expr *expr, uint16_t type)
+ {
+ 	const void *data;
+ 	uint32_t data_len;
+@@ -161,9 +150,8 @@ uint16_t nftnl_expr_get_u16(const struct nftnl_expr *expr, uint16_t type)
+ 
+ 	return *((uint16_t *)data);
+ }
+-EXPORT_SYMBOL(nftnl_expr_get_u16);
+ 
+-uint32_t nftnl_expr_get_u32(const struct nftnl_expr *expr, uint16_t type)
++uint32_t __EXPORTED nftnl_expr_get_u32(const struct nftnl_expr *expr, uint16_t type)
+ {
+ 	const void *data;
+ 	uint32_t data_len;
+@@ -177,9 +165,8 @@ uint32_t nftnl_expr_get_u32(const struct nftnl_expr *expr, uint16_t type)
+ 
+ 	return *((uint32_t *)data);
+ }
+-EXPORT_SYMBOL(nftnl_expr_get_u32);
+ 
+-uint64_t nftnl_expr_get_u64(const struct nftnl_expr *expr, uint16_t type)
++uint64_t __EXPORTED nftnl_expr_get_u64(const struct nftnl_expr *expr, uint16_t type)
+ {
+ 	const void *data;
+ 	uint32_t data_len;
+@@ -193,17 +180,15 @@ uint64_t nftnl_expr_get_u64(const struct nftnl_expr *expr, uint16_t type)
+ 
+ 	return *((uint64_t *)data);
+ }
+-EXPORT_SYMBOL(nftnl_expr_get_u64);
+ 
+-const char *nftnl_expr_get_str(const struct nftnl_expr *expr, uint16_t type)
++const char __EXPORTED *nftnl_expr_get_str(const struct nftnl_expr *expr, uint16_t type)
+ {
+ 	uint32_t data_len;
+ 
+ 	return (const char *)nftnl_expr_get(expr, type, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_expr_get_str);
+ 
+-bool nftnl_expr_cmp(const struct nftnl_expr *e1, const struct nftnl_expr *e2)
++bool __EXPORTED nftnl_expr_cmp(const struct nftnl_expr *e1, const struct nftnl_expr *e2)
+ {
+ 	if (e1->flags != e2->flags ||
+ 	    strcmp(e1->ops->name, e2->ops->name) != 0)
+@@ -211,7 +196,6 @@ bool nftnl_expr_cmp(const struct nftnl_expr *e1, const struct nftnl_expr *e2)
+ 
+ 	return e1->ops->cmp(e1, e2);
+ }
+-EXPORT_SYMBOL(nftnl_expr_cmp);
+ 
+ void nftnl_expr_build_payload(struct nlmsghdr *nlh, struct nftnl_expr *expr)
+ {
+@@ -275,7 +259,7 @@ err1:
+ 	return NULL;
+ }
+ 
+-int nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_expr *expr,
++int __EXPORTED nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_expr *expr,
+ 			uint32_t type, uint32_t flags)
+ {
+ 	int ret;
+@@ -289,4 +273,3 @@ int nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_expr *expr,
+ 
+ 	return offset;
+ }
+-EXPORT_SYMBOL(nftnl_expr_snprintf);
+diff --git a/src/gen.c b/src/gen.c
+index 213562e..8b45caa 100644
+--- a/src/gen.c
++++ b/src/gen.c
+@@ -29,25 +29,22 @@ struct nftnl_gen {
+ 	uint32_t flags;
+ };
+ 
+-struct nftnl_gen *nftnl_gen_alloc(void)
++struct nftnl_gen __EXPORTED *nftnl_gen_alloc(void)
+ {
+ 	return calloc(1, sizeof(struct nftnl_gen));
+ }
+-EXPORT_SYMBOL(nftnl_gen_alloc);
+ 
+-void nftnl_gen_free(const struct nftnl_gen *gen)
++void __EXPORTED nftnl_gen_free(const struct nftnl_gen *gen)
+ {
+ 	xfree(gen);
+ }
+-EXPORT_SYMBOL(nftnl_gen_free);
+ 
+-bool nftnl_gen_is_set(const struct nftnl_gen *gen, uint16_t attr)
++bool __EXPORTED nftnl_gen_is_set(const struct nftnl_gen *gen, uint16_t attr)
+ {
+ 	return gen->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_gen_is_set);
+ 
+-void nftnl_gen_unset(struct nftnl_gen *gen, uint16_t attr)
++void __EXPORTED nftnl_gen_unset(struct nftnl_gen *gen, uint16_t attr)
+ {
+ 	if (!(gen->flags & (1 << attr)))
+ 		return;
+@@ -58,13 +55,12 @@ void nftnl_gen_unset(struct nftnl_gen *gen, uint16_t attr)
+ 	}
+ 	gen->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_gen_unset);
+ 
+ static uint32_t nftnl_gen_validate[NFTNL_GEN_MAX + 1] = {
+ 	[NFTNL_GEN_ID]	= sizeof(uint32_t),
+ };
+ 
+-int nftnl_gen_set_data(struct nftnl_gen *gen, uint16_t attr,
++int __EXPORTED nftnl_gen_set_data(struct nftnl_gen *gen, uint16_t attr,
+ 		       const void *data, uint32_t data_len)
+ {
+ 	nftnl_assert_attr_exists(attr, NFTNL_GEN_MAX);
+@@ -78,21 +74,18 @@ int nftnl_gen_set_data(struct nftnl_gen *gen, uint16_t attr,
+ 	gen->flags |= (1 << attr);
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_gen_set_data);
+ 
+-int nftnl_gen_set(struct nftnl_gen *gen, uint16_t attr, const void *data)
++int __EXPORTED nftnl_gen_set(struct nftnl_gen *gen, uint16_t attr, const void *data)
+ {
+ 	return nftnl_gen_set_data(gen, attr, data, nftnl_gen_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_gen_set);
+ 
+-void nftnl_gen_set_u32(struct nftnl_gen *gen, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_gen_set_u32(struct nftnl_gen *gen, uint16_t attr, uint32_t val)
+ {
+ 	nftnl_gen_set_data(gen, attr, &val, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_gen_set_u32);
+ 
+-const void *nftnl_gen_get_data(const struct nftnl_gen *gen, uint16_t attr,
++const void __EXPORTED *nftnl_gen_get_data(const struct nftnl_gen *gen, uint16_t attr,
+ 			       uint32_t *data_len)
+ {
+ 	if (!(gen->flags & (1 << attr)))
+@@ -105,21 +98,18 @@ const void *nftnl_gen_get_data(const struct nftnl_gen *gen, uint16_t attr,
+ 	}
+ 	return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_gen_get_data);
+ 
+-const void *nftnl_gen_get(const struct nftnl_gen *gen, uint16_t attr)
++const void __EXPORTED *nftnl_gen_get(const struct nftnl_gen *gen, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	return nftnl_gen_get_data(gen, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_gen_get);
+ 
+-uint32_t nftnl_gen_get_u32(const struct nftnl_gen *gen, uint16_t attr)
++uint32_t __EXPORTED nftnl_gen_get_u32(const struct nftnl_gen *gen, uint16_t attr)
+ {
+ 	const void *ret = nftnl_gen_get(gen, attr);
+ 	return ret == NULL ? 0 : *((uint32_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_gen_get_u32);
+ 
+ static int nftnl_gen_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -140,7 +130,7 @@ static int nftnl_gen_parse_attr_cb(const struct nlattr *attr, void *data)
+ 	return MNL_CB_OK;
+ }
+ 
+-int nftnl_gen_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_gen *gen)
++int __EXPORTED nftnl_gen_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_gen *gen)
+ {
+ 	struct nlattr *tb[NFTA_GEN_MAX + 1] = {};
+ 	struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -154,7 +144,6 @@ int nftnl_gen_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_gen *gen)
+ 	}
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_gen_nlmsg_parse);
+ 
+ static int nftnl_gen_snprintf_default(char *buf, size_t size,
+ 				      const struct nftnl_gen *gen)
+@@ -186,13 +175,12 @@ static int nftnl_gen_cmd_snprintf(char *buf, size_t size,
+ 	return offset;
+ }
+ 
+-int nftnl_gen_snprintf(char *buf, size_t size, const struct nftnl_gen *gen,
++int __EXPORTED nftnl_gen_snprintf(char *buf, size_t size, const struct nftnl_gen *gen,
+ 		       uint32_t type, uint32_t flags)
+ {;
+ 	return nftnl_gen_cmd_snprintf(buf, size, gen, nftnl_flag2cmd(flags), type,
+ 				    flags);
+ }
+-EXPORT_SYMBOL(nftnl_gen_snprintf);
+ 
+ static int nftnl_gen_do_snprintf(char *buf, size_t size, const void *gen,
+ 				 uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -200,10 +188,9 @@ static int nftnl_gen_do_snprintf(char *buf, size_t size, const void *gen,
+ 	return nftnl_gen_snprintf(buf, size, gen, type, flags);
+ }
+ 
+-int nftnl_gen_fprintf(FILE *fp, const struct nftnl_gen *gen, uint32_t type,
++int __EXPORTED nftnl_gen_fprintf(FILE *fp, const struct nftnl_gen *gen, uint32_t type,
+ 		      uint32_t flags)
+ {
+ 	return nftnl_fprintf(fp, gen, NFTNL_CMD_UNSPEC, type, flags,
+ 			   nftnl_gen_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_gen_fprintf);
+diff --git a/src/object.c b/src/object.c
+index e1a5ac4..d409c6d 100644
+--- a/src/object.c
++++ b/src/object.c
+@@ -39,13 +39,12 @@ static struct obj_ops *nftnl_obj_ops_lookup(uint32_t type)
+ 	return obj_ops[type];
+ }
+ 
+-struct nftnl_obj *nftnl_obj_alloc(void)
++struct nftnl_obj __EXPORTED *nftnl_obj_alloc(void)
+ {
+ 	return calloc(1, sizeof(struct nftnl_obj));
+ }
+-EXPORT_SYMBOL(nftnl_obj_alloc);
+ 
+-void nftnl_obj_free(const struct nftnl_obj *obj)
++void __EXPORTED nftnl_obj_free(const struct nftnl_obj *obj)
+ {
+ 	if (obj->flags & (1 << NFTNL_OBJ_TABLE))
+ 		xfree(obj->table);
+@@ -54,20 +53,18 @@ void nftnl_obj_free(const struct nftnl_obj *obj)
+ 
+ 	xfree(obj);
+ }
+-EXPORT_SYMBOL(nftnl_obj_free);
+ 
+-bool nftnl_obj_is_set(const struct nftnl_obj *obj, uint16_t attr)
++bool __EXPORTED nftnl_obj_is_set(const struct nftnl_obj *obj, uint16_t attr)
+ {
+ 	return obj->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_obj_is_set);
+ 
+ static uint32_t nftnl_obj_validate[NFTNL_OBJ_MAX + 1] = {
+ 	[NFTNL_OBJ_FAMILY]	= sizeof(uint32_t),
+ 	[NFTNL_OBJ_USE]		= sizeof(uint32_t),
+ };
+ 
+-void nftnl_obj_set_data(struct nftnl_obj *obj, uint16_t attr,
++void __EXPORTED nftnl_obj_set_data(struct nftnl_obj *obj, uint16_t attr,
+ 			const void *data, uint32_t data_len)
+ {
+ 	if (attr < NFTNL_OBJ_MAX)
+@@ -100,45 +97,38 @@ void nftnl_obj_set_data(struct nftnl_obj *obj, uint16_t attr,
+ 	}
+ 	obj->flags |= (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_data);
+ 
+-void nftnl_obj_set(struct nftnl_obj *obj, uint16_t attr, const void *data)
++void __EXPORTED nftnl_obj_set(struct nftnl_obj *obj, uint16_t attr, const void *data)
+ {
+ 	nftnl_obj_set_data(obj, attr, data, nftnl_obj_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_obj_set);
+ 
+-void nftnl_obj_set_u8(struct nftnl_obj *obj, uint16_t attr, uint8_t val)
++void __EXPORTED nftnl_obj_set_u8(struct nftnl_obj *obj, uint16_t attr, uint8_t val)
+ {
+ 	nftnl_obj_set_data(obj, attr, &val, sizeof(uint8_t));
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_u8);
+ 
+-void nftnl_obj_set_u16(struct nftnl_obj *obj, uint16_t attr, uint16_t val)
++void __EXPORTED nftnl_obj_set_u16(struct nftnl_obj *obj, uint16_t attr, uint16_t val)
+ {
+ 	nftnl_obj_set_data(obj, attr, &val, sizeof(uint16_t));
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_u16);
+ 
+-void nftnl_obj_set_u32(struct nftnl_obj *obj, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_obj_set_u32(struct nftnl_obj *obj, uint16_t attr, uint32_t val)
+ {
+ 	nftnl_obj_set_data(obj, attr, &val, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_u32);
+ 
+-void nftnl_obj_set_u64(struct nftnl_obj *obj, uint16_t attr, uint64_t val)
++void __EXPORTED nftnl_obj_set_u64(struct nftnl_obj *obj, uint16_t attr, uint64_t val)
+ {
+ 	nftnl_obj_set_data(obj, attr, &val, sizeof(uint64_t));
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_u64);
+ 
+-void nftnl_obj_set_str(struct nftnl_obj *obj, uint16_t attr, const char *str)
++void __EXPORTED nftnl_obj_set_str(struct nftnl_obj *obj, uint16_t attr, const char *str)
+ {
+ 	nftnl_obj_set_data(obj, attr, str, 0);
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_str);
+ 
+-const void *nftnl_obj_get_data(struct nftnl_obj *obj, uint16_t attr,
++const void __EXPORTED *nftnl_obj_get_data(struct nftnl_obj *obj, uint16_t attr,
+ 			       uint32_t *data_len)
+ {
+ 	if (!(obj->flags & (1 << attr)))
+@@ -168,50 +158,43 @@ const void *nftnl_obj_get_data(struct nftnl_obj *obj, uint16_t attr,
+ 	}
+ 	return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_data);
+ 
+-const void *nftnl_obj_get(struct nftnl_obj *obj, uint16_t attr)
++const void __EXPORTED *nftnl_obj_get(struct nftnl_obj *obj, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	return nftnl_obj_get_data(obj, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get);
+ 
+-uint8_t nftnl_obj_get_u8(struct nftnl_obj *obj, uint16_t attr)
++uint8_t __EXPORTED nftnl_obj_get_u8(struct nftnl_obj *obj, uint16_t attr)
+ {
+ 	const void *ret = nftnl_obj_get(obj, attr);
+ 	return ret == NULL ? 0 : *((uint8_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_u8);
+ 
+-uint16_t nftnl_obj_get_u16(struct nftnl_obj *obj, uint16_t attr)
++uint16_t __EXPORTED nftnl_obj_get_u16(struct nftnl_obj *obj, uint16_t attr)
+ {
+ 	const void *ret = nftnl_obj_get(obj, attr);
+ 	return ret == NULL ? 0 : *((uint16_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_u16);
+ 
+-uint32_t nftnl_obj_get_u32(struct nftnl_obj *obj, uint16_t attr)
++uint32_t __EXPORTED nftnl_obj_get_u32(struct nftnl_obj *obj, uint16_t attr)
+ {
+ 	const void *ret = nftnl_obj_get(obj, attr);
+ 	return ret == NULL ? 0 : *((uint32_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_u32);
+ 
+-uint64_t nftnl_obj_get_u64(struct nftnl_obj *obj, uint16_t attr)
++uint64_t __EXPORTED nftnl_obj_get_u64(struct nftnl_obj *obj, uint16_t attr)
+ {
+ 	const void *ret = nftnl_obj_get(obj, attr);
+ 	return ret == NULL ? 0 : *((uint64_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_u64);
+ 
+-const char *nftnl_obj_get_str(struct nftnl_obj *obj, uint16_t attr)
++const char __EXPORTED *nftnl_obj_get_str(struct nftnl_obj *obj, uint16_t attr)
+ {
+ 	return nftnl_obj_get(obj, attr);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_str);
+ 
+-void nftnl_obj_nlmsg_build_payload(struct nlmsghdr *nlh,
++void __EXPORTED nftnl_obj_nlmsg_build_payload(struct nlmsghdr *nlh,
+ 				   const struct nftnl_obj *obj)
+ {
+ 	if (obj->flags & (1 << NFTNL_OBJ_TABLE))
+@@ -228,7 +211,6 @@ void nftnl_obj_nlmsg_build_payload(struct nlmsghdr *nlh,
+ 		mnl_attr_nest_end(nlh, nest);
+ 	}
+ }
+-EXPORT_SYMBOL(nftnl_obj_nlmsg_build_payload);
+ 
+ static int nftnl_obj_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -258,7 +240,7 @@ static int nftnl_obj_parse_attr_cb(const struct nlattr *attr, void *data)
+ 	return MNL_CB_OK;
+ }
+ 
+-int nftnl_obj_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_obj *obj)
++int __EXPORTED nftnl_obj_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_obj *obj)
+ {
+ 	struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+ 	struct nlattr *tb[NFTA_OBJ_MAX + 1] = {};
+@@ -299,7 +281,6 @@ int nftnl_obj_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_obj *obj)
+ 
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_obj_nlmsg_parse);
+ 
+ #ifdef JSON_PARSING
+ static int nftnl_jansson_parse_obj(struct nftnl_obj *t, json_t *tree,
+@@ -377,19 +358,17 @@ static int nftnl_obj_do_parse(struct nftnl_obj *obj, enum nftnl_parse_type type,
+ 	return ret;
+ }
+ 
+-int nftnl_obj_parse(struct nftnl_obj *obj, enum nftnl_parse_type type,
++int __EXPORTED nftnl_obj_parse(struct nftnl_obj *obj, enum nftnl_parse_type type,
+ 		      const char *data, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_obj_do_parse(obj, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_obj_parse);
+ 
+-int nftnl_obj_parse_file(struct nftnl_obj *obj, enum nftnl_parse_type type,
++int __EXPORTED nftnl_obj_parse_file(struct nftnl_obj *obj, enum nftnl_parse_type type,
+ 			   FILE *fp, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_obj_do_parse(obj, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_obj_parse_file);
+ 
+ static int nftnl_obj_export(char *buf, size_t size,
+ 			    const struct nftnl_obj *obj,
+@@ -469,13 +448,12 @@ static int nftnl_obj_cmd_snprintf(char *buf, size_t size,
+ 	return offset;
+ }
+ 
+-int nftnl_obj_snprintf(char *buf, size_t size, const struct nftnl_obj *obj,
++int __EXPORTED nftnl_obj_snprintf(char *buf, size_t size, const struct nftnl_obj *obj,
+ 		       uint32_t type, uint32_t flags)
+ {
+ 	return nftnl_obj_cmd_snprintf(buf, size, obj, nftnl_flag2cmd(flags),
+ 				      type, flags);
+ }
+-EXPORT_SYMBOL(nftnl_obj_snprintf);
+ 
+ static int nftnl_obj_do_snprintf(char *buf, size_t size, const void *obj,
+ 				 uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -483,19 +461,18 @@ static int nftnl_obj_do_snprintf(char *buf, size_t size, const void *obj,
+ 	return nftnl_obj_snprintf(buf, size, obj, type, flags);
+ }
+ 
+-int nftnl_obj_fprintf(FILE *fp, const struct nftnl_obj *obj, uint32_t type,
++int __EXPORTED nftnl_obj_fprintf(FILE *fp, const struct nftnl_obj *obj, uint32_t type,
+ 		      uint32_t flags)
+ {
+ 	return nftnl_fprintf(fp, obj, NFTNL_CMD_UNSPEC, type, flags,
+ 			     nftnl_obj_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_obj_fprintf);
+ 
+ struct nftnl_obj_list {
+ 	struct list_head list;
+ };
+ 
+-struct nftnl_obj_list *nftnl_obj_list_alloc(void)
++struct nftnl_obj_list __EXPORTED *nftnl_obj_list_alloc(void)
+ {
+ 	struct nftnl_obj_list *list;
+ 
+@@ -507,9 +484,8 @@ struct nftnl_obj_list *nftnl_obj_list_alloc(void)
+ 
+ 	return list;
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_alloc);
+ 
+-void nftnl_obj_list_free(struct nftnl_obj_list *list)
++void __EXPORTED nftnl_obj_list_free(struct nftnl_obj_list *list)
+ {
+ 	struct nftnl_obj *r, *tmp;
+ 
+@@ -519,34 +495,29 @@ void nftnl_obj_list_free(struct nftnl_obj_list *list)
+ 	}
+ 	xfree(list);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_free);
+ 
+-int nftnl_obj_list_is_empty(struct nftnl_obj_list *list)
++int __EXPORTED nftnl_obj_list_is_empty(struct nftnl_obj_list *list)
+ {
+ 	return list_empty(&list->list);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_is_empty);
+ 
+-void nftnl_obj_list_add(struct nftnl_obj *r, struct nftnl_obj_list *list)
++void __EXPORTED nftnl_obj_list_add(struct nftnl_obj *r, struct nftnl_obj_list *list)
+ {
+ 	list_add(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_add);
+ 
+-void nftnl_obj_list_add_tail(struct nftnl_obj *r,
++void __EXPORTED nftnl_obj_list_add_tail(struct nftnl_obj *r,
+ 			       struct nftnl_obj_list *list)
+ {
+ 	list_add_tail(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_add_tail);
+ 
+-void nftnl_obj_list_del(struct nftnl_obj *t)
++void __EXPORTED nftnl_obj_list_del(struct nftnl_obj *t)
+ {
+ 	list_del(&t->head);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_del);
+ 
+-int nftnl_obj_list_foreach(struct nftnl_obj_list *table_list,
++int __EXPORTED nftnl_obj_list_foreach(struct nftnl_obj_list *table_list,
+ 			     int (*cb)(struct nftnl_obj *t, void *data),
+ 			     void *data)
+ {
+@@ -560,14 +531,13 @@ int nftnl_obj_list_foreach(struct nftnl_obj_list *table_list,
+ 	}
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_foreach);
+ 
+ struct nftnl_obj_list_iter {
+ 	struct nftnl_obj_list	*list;
+ 	struct nftnl_obj	*cur;
+ };
+ 
+-struct nftnl_obj_list_iter *
++struct nftnl_obj_list_iter __EXPORTED *
+ nftnl_obj_list_iter_create(struct nftnl_obj_list *l)
+ {
+ 	struct nftnl_obj_list_iter *iter;
+@@ -584,9 +554,8 @@ nftnl_obj_list_iter_create(struct nftnl_obj_list *l)
+ 
+ 	return iter;
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_iter_create);
+ 
+-struct nftnl_obj *nftnl_obj_list_iter_next(struct nftnl_obj_list_iter *iter)
++struct nftnl_obj __EXPORTED *nftnl_obj_list_iter_next(struct nftnl_obj_list_iter *iter)
+ {
+ 	struct nftnl_obj *r = iter->cur;
+ 
+@@ -600,10 +569,8 @@ struct nftnl_obj *nftnl_obj_list_iter_next(struct nftnl_obj_list_iter *iter)
+ 
+ 	return r;
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_iter_next);
+ 
+-void nftnl_obj_list_iter_destroy(struct nftnl_obj_list_iter *iter)
++void __EXPORTED nftnl_obj_list_iter_destroy(struct nftnl_obj_list_iter *iter)
+ {
+ 	xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_iter_destroy);
+diff --git a/src/rule.c b/src/rule.c
+index 6c22141..ad8609f 100644
+--- a/src/rule.c
++++ b/src/rule.c
+@@ -52,7 +52,7 @@ struct nftnl_rule {
+ 	struct list_head expr_list;
+ };
+ 
+-struct nftnl_rule *nftnl_rule_alloc(void)
++struct nftnl_rule __EXPORTED *nftnl_rule_alloc(void)
+ {
+ 	struct nftnl_rule *r;
+ 
+@@ -64,9 +64,8 @@ struct nftnl_rule *nftnl_rule_alloc(void)
+ 
+ 	return r;
+ }
+-EXPORT_SYMBOL(nftnl_rule_alloc);
+ 
+-void nftnl_rule_free(const struct nftnl_rule *r)
++void __EXPORTED nftnl_rule_free(const struct nftnl_rule *r)
+ {
+ 	struct nftnl_expr *e, *tmp;
+ 
+@@ -82,15 +81,13 @@ void nftnl_rule_free(const struct nftnl_rule *r)
+ 
+ 	xfree(r);
+ }
+-EXPORT_SYMBOL(nftnl_rule_free);
+ 
+-bool nftnl_rule_is_set(const struct nftnl_rule *r, uint16_t attr)
++bool __EXPORTED nftnl_rule_is_set(const struct nftnl_rule *r, uint16_t attr)
+ {
+ 	return r->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_rule_is_set);
+ 
+-void nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
++void __EXPORTED nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
+ {
+ 	if (!(r->flags & (1 << attr)))
+ 		return;
+@@ -116,7 +113,6 @@ void nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
+ 
+ 	r->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_rule_unset);
+ 
+ static uint32_t nftnl_rule_validate[NFTNL_RULE_MAX + 1] = {
+ 	[NFTNL_RULE_HANDLE]		= sizeof(uint64_t),
+@@ -127,7 +123,7 @@ static uint32_t nftnl_rule_validate[NFTNL_RULE_MAX + 1] = {
+ 	[NFTNL_RULE_ID]			= sizeof(uint32_t),
+ };
+ 
+-int nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
++int __EXPORTED nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
+ 			const void *data, uint32_t data_len)
+ {
+ 	nftnl_assert_attr_exists(attr, NFTNL_RULE_MAX);
+@@ -183,33 +179,28 @@ int nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
+ 	r->flags |= (1 << attr);
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_set_data);
+ 
+-int nftnl_rule_set(struct nftnl_rule *r, uint16_t attr, const void *data)
++int __EXPORTED nftnl_rule_set(struct nftnl_rule *r, uint16_t attr, const void *data)
+ {
+ 	return nftnl_rule_set_data(r, attr, data, nftnl_rule_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_rule_set);
+ 
+-void nftnl_rule_set_u32(struct nftnl_rule *r, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_rule_set_u32(struct nftnl_rule *r, uint16_t attr, uint32_t val)
+ {
+ 	nftnl_rule_set_data(r, attr, &val, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_rule_set_u32);
+ 
+-void nftnl_rule_set_u64(struct nftnl_rule *r, uint16_t attr, uint64_t val)
++void __EXPORTED nftnl_rule_set_u64(struct nftnl_rule *r, uint16_t attr, uint64_t val)
+ {
+ 	nftnl_rule_set_data(r, attr, &val, sizeof(uint64_t));
+ }
+-EXPORT_SYMBOL(nftnl_rule_set_u64);
+ 
+-int nftnl_rule_set_str(struct nftnl_rule *r, uint16_t attr, const char *str)
++int __EXPORTED nftnl_rule_set_str(struct nftnl_rule *r, uint16_t attr, const char *str)
+ {
+ 	return nftnl_rule_set_data(r, attr, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_rule_set_str);
+ 
+-const void *nftnl_rule_get_data(const struct nftnl_rule *r, uint16_t attr,
++const void __EXPORTED *nftnl_rule_get_data(const struct nftnl_rule *r, uint16_t attr,
+ 				   uint32_t *data_len)
+ {
+ 	if (!(r->flags & (1 << attr)))
+@@ -246,22 +237,19 @@ const void *nftnl_rule_get_data(const struct nftnl_rule *r, uint16_t attr,
+ 	}
+ 	return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_rule_get_data);
+ 
+-const void *nftnl_rule_get(const struct nftnl_rule *r, uint16_t attr)
++const void __EXPORTED *nftnl_rule_get(const struct nftnl_rule *r, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	return nftnl_rule_get_data(r, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_rule_get);
+ 
+-const char *nftnl_rule_get_str(const struct nftnl_rule *r, uint16_t attr)
++const char __EXPORTED *nftnl_rule_get_str(const struct nftnl_rule *r, uint16_t attr)
+ {
+ 	return nftnl_rule_get(r, attr);
+ }
+-EXPORT_SYMBOL(nftnl_rule_get_str);
+ 
+-uint32_t nftnl_rule_get_u32(const struct nftnl_rule *r, uint16_t attr)
++uint32_t __EXPORTED nftnl_rule_get_u32(const struct nftnl_rule *r, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	const uint32_t *val = nftnl_rule_get_data(r, attr, &data_len);
+@@ -270,9 +258,8 @@ uint32_t nftnl_rule_get_u32(const struct nftnl_rule *r, uint16_t attr)
+ 
+ 	return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_get_u32);
+ 
+-uint64_t nftnl_rule_get_u64(const struct nftnl_rule *r, uint16_t attr)
++uint64_t __EXPORTED nftnl_rule_get_u64(const struct nftnl_rule *r, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	const uint64_t *val = nftnl_rule_get_data(r, attr, &data_len);
+@@ -281,9 +268,8 @@ uint64_t nftnl_rule_get_u64(const struct nftnl_rule *r, uint16_t attr)
+ 
+ 	return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_get_u64);
+ 
+-uint8_t nftnl_rule_get_u8(const struct nftnl_rule *r, uint16_t attr)
++uint8_t __EXPORTED nftnl_rule_get_u8(const struct nftnl_rule *r, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	const uint8_t *val = nftnl_rule_get_data(r, attr, &data_len);
+@@ -292,9 +278,8 @@ uint8_t nftnl_rule_get_u8(const struct nftnl_rule *r, uint16_t attr)
+ 
+ 	return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_get_u8);
+ 
+-void nftnl_rule_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_rule *r)
++void __EXPORTED nftnl_rule_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_rule *r)
+ {
+ 	struct nftnl_expr *expr;
+ 	struct nlattr *nest, *nest2;
+@@ -335,13 +320,11 @@ void nftnl_rule_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_rule *r)
+ 	if (r->flags & (1 << NFTNL_RULE_ID))
+ 		mnl_attr_put_u32(nlh, NFTA_RULE_ID, htonl(r->id));
+ }
+-EXPORT_SYMBOL(nftnl_rule_nlmsg_build_payload);
+ 
+-void nftnl_rule_add_expr(struct nftnl_rule *r, struct nftnl_expr *expr)
++void __EXPORTED nftnl_rule_add_expr(struct nftnl_rule *r, struct nftnl_expr *expr)
+ {
+ 	list_add_tail(&expr->head, &r->expr_list);
+ }
+-EXPORT_SYMBOL(nftnl_rule_add_expr);
+ 
+ static int nftnl_rule_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -441,7 +424,7 @@ static int nftnl_rule_parse_compat(struct nlattr *nest, struct nftnl_rule *r)
+ 	return 0;
+ }
+ 
+-int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
++int __EXPORTED nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
+ {
+ 	struct nlattr *tb[NFTA_RULE_MAX+1] = {};
+ 	struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -510,7 +493,6 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
+ 
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_nlmsg_parse);
+ 
+ #ifdef JSON_PARSING
+ int nftnl_jansson_parse_rule(struct nftnl_rule *r, json_t *tree,
+@@ -658,19 +640,17 @@ static int nftnl_rule_do_parse(struct nftnl_rule *r, enum nftnl_parse_type type,
+ 
+ 	return ret;
+ }
+-int nftnl_rule_parse(struct nftnl_rule *r, enum nftnl_parse_type type,
++int __EXPORTED nftnl_rule_parse(struct nftnl_rule *r, enum nftnl_parse_type type,
+ 		   const char *data, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_rule_do_parse(r, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_rule_parse);
+ 
+-int nftnl_rule_parse_file(struct nftnl_rule *r, enum nftnl_parse_type type,
++int __EXPORTED nftnl_rule_parse_file(struct nftnl_rule *r, enum nftnl_parse_type type,
+ 			FILE *fp, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_rule_do_parse(r, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_rule_parse_file);
+ 
+ static int nftnl_rule_export(char *buf, size_t size,
+ 			     const struct nftnl_rule *r,
+@@ -819,13 +799,12 @@ static int nftnl_rule_cmd_snprintf(char *buf, size_t size,
+ 	return offset;
+ }
+ 
+-int nftnl_rule_snprintf(char *buf, size_t size, const struct nftnl_rule *r,
++int __EXPORTED nftnl_rule_snprintf(char *buf, size_t size, const struct nftnl_rule *r,
+ 			uint32_t type, uint32_t flags)
+ {
+ 	return nftnl_rule_cmd_snprintf(buf, size, r, nftnl_flag2cmd(flags), type,
+ 				     flags);
+ }
+-EXPORT_SYMBOL(nftnl_rule_snprintf);
+ 
+ static int nftnl_rule_do_snprintf(char *buf, size_t size, const void *r,
+ 				  uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -833,15 +812,14 @@ static int nftnl_rule_do_snprintf(char *buf, size_t size, const void *r,
+ 	return nftnl_rule_snprintf(buf, size, r, type, flags);
+ }
+ 
+-int nftnl_rule_fprintf(FILE *fp, const struct nftnl_rule *r, uint32_t type,
++int __EXPORTED nftnl_rule_fprintf(FILE *fp, const struct nftnl_rule *r, uint32_t type,
+ 		       uint32_t flags)
+ {
+ 	return nftnl_fprintf(fp, r, NFTNL_CMD_UNSPEC, type, flags,
+ 			   nftnl_rule_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_rule_fprintf);
+ 
+-int nftnl_expr_foreach(struct nftnl_rule *r,
++int __EXPORTED nftnl_expr_foreach(struct nftnl_rule *r,
+                           int (*cb)(struct nftnl_expr *e, void *data),
+                           void *data)
+ {
+@@ -855,7 +833,6 @@ int nftnl_expr_foreach(struct nftnl_rule *r,
+        }
+        return 0;
+ }
+-EXPORT_SYMBOL(nftnl_expr_foreach);
+ 
+ struct nftnl_expr_iter {
+ 	const struct nftnl_rule	*r;
+@@ -873,7 +850,7 @@ static void nftnl_expr_iter_init(const struct nftnl_rule *r,
+ 				       head);
+ }
+ 
+-struct nftnl_expr_iter *nftnl_expr_iter_create(const struct nftnl_rule *r)
++struct nftnl_expr_iter __EXPORTED *nftnl_expr_iter_create(const struct nftnl_rule *r)
+ {
+ 	struct nftnl_expr_iter *iter;
+ 
+@@ -885,9 +862,8 @@ struct nftnl_expr_iter *nftnl_expr_iter_create(const struct nftnl_rule *r)
+ 
+ 	return iter;
+ }
+-EXPORT_SYMBOL(nftnl_expr_iter_create);
+ 
+-struct nftnl_expr *nftnl_expr_iter_next(struct nftnl_expr_iter *iter)
++struct nftnl_expr __EXPORTED *nftnl_expr_iter_next(struct nftnl_expr_iter *iter)
+ {
+ 	struct nftnl_expr *expr = iter->cur;
+ 
+@@ -901,15 +877,13 @@ struct nftnl_expr *nftnl_expr_iter_next(struct nftnl_expr_iter *iter)
+ 
+ 	return expr;
+ }
+-EXPORT_SYMBOL(nftnl_expr_iter_next);
+ 
+-void nftnl_expr_iter_destroy(struct nftnl_expr_iter *iter)
++void __EXPORTED nftnl_expr_iter_destroy(struct nftnl_expr_iter *iter)
+ {
+ 	xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_expr_iter_destroy);
+ 
+-bool nftnl_rule_cmp(const struct nftnl_rule *r1, const struct nftnl_rule *r2)
++bool __EXPORTED nftnl_rule_cmp(const struct nftnl_rule *r1, const struct nftnl_rule *r2)
+ {
+ 	struct nftnl_expr_iter it1, it2;
+ 	struct nftnl_expr *e1, *e2;
+@@ -938,13 +912,12 @@ bool nftnl_rule_cmp(const struct nftnl_rule *r1, const struct nftnl_rule *r2)
+ 
+ 	return eq;
+ }
+-EXPORT_SYMBOL(nftnl_rule_cmp);
+ 
+ struct nftnl_rule_list {
+ 	struct list_head list;
+ };
+ 
+-struct nftnl_rule_list *nftnl_rule_list_alloc(void)
++struct nftnl_rule_list __EXPORTED *nftnl_rule_list_alloc(void)
+ {
+ 	struct nftnl_rule_list *list;
+ 
+@@ -956,9 +929,8 @@ struct nftnl_rule_list *nftnl_rule_list_alloc(void)
+ 
+ 	return list;
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_alloc);
+ 
+-void nftnl_rule_list_free(struct nftnl_rule_list *list)
++void __EXPORTED nftnl_rule_list_free(struct nftnl_rule_list *list)
+ {
+ 	struct nftnl_rule *r, *tmp;
+ 
+@@ -968,33 +940,28 @@ void nftnl_rule_list_free(struct nftnl_rule_list *list)
+ 	}
+ 	xfree(list);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_free);
+ 
+-int nftnl_rule_list_is_empty(const struct nftnl_rule_list *list)
++int __EXPORTED nftnl_rule_list_is_empty(const struct nftnl_rule_list *list)
+ {
+ 	return list_empty(&list->list);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_is_empty);
+ 
+-void nftnl_rule_list_add(struct nftnl_rule *r, struct nftnl_rule_list *list)
++void __EXPORTED nftnl_rule_list_add(struct nftnl_rule *r, struct nftnl_rule_list *list)
+ {
+ 	list_add(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_add);
+ 
+-void nftnl_rule_list_add_tail(struct nftnl_rule *r, struct nftnl_rule_list *list)
++void __EXPORTED nftnl_rule_list_add_tail(struct nftnl_rule *r, struct nftnl_rule_list *list)
+ {
+ 	list_add_tail(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_add_tail);
+ 
+-void nftnl_rule_list_del(struct nftnl_rule *r)
++void __EXPORTED nftnl_rule_list_del(struct nftnl_rule *r)
+ {
+ 	list_del(&r->head);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_del);
+ 
+-int nftnl_rule_list_foreach(struct nftnl_rule_list *rule_list,
++int __EXPORTED nftnl_rule_list_foreach(struct nftnl_rule_list *rule_list,
+ 			  int (*cb)(struct nftnl_rule *r, void *data),
+ 			  void *data)
+ {
+@@ -1008,14 +975,13 @@ int nftnl_rule_list_foreach(struct nftnl_rule_list *rule_list,
+ 	}
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_foreach);
+ 
+ struct nftnl_rule_list_iter {
+ 	const struct nftnl_rule_list	*list;
+ 	struct nftnl_rule		*cur;
+ };
+ 
+-struct nftnl_rule_list_iter *
++struct nftnl_rule_list_iter __EXPORTED *
+ nftnl_rule_list_iter_create(const struct nftnl_rule_list *l)
+ {
+ 	struct nftnl_rule_list_iter *iter;
+@@ -1032,15 +998,13 @@ nftnl_rule_list_iter_create(const struct nftnl_rule_list *l)
+ 
+ 	return iter;
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_iter_create);
+ 
+-struct nftnl_rule *nftnl_rule_list_iter_cur(struct nftnl_rule_list_iter *iter)
++struct nftnl_rule __EXPORTED *nftnl_rule_list_iter_cur(struct nftnl_rule_list_iter *iter)
+ {
+ 	return iter->cur;
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_iter_cur);
+ 
+-struct nftnl_rule *nftnl_rule_list_iter_next(struct nftnl_rule_list_iter *iter)
++struct nftnl_rule __EXPORTED *nftnl_rule_list_iter_next(struct nftnl_rule_list_iter *iter)
+ {
+ 	struct nftnl_rule *r = iter->cur;
+ 
+@@ -1054,10 +1018,8 @@ struct nftnl_rule *nftnl_rule_list_iter_next(struct nftnl_rule_list_iter *iter)
+ 
+ 	return r;
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_iter_next);
+ 
+-void nftnl_rule_list_iter_destroy(const struct nftnl_rule_list_iter *iter)
++void __EXPORTED nftnl_rule_list_iter_destroy(const struct nftnl_rule_list_iter *iter)
+ {
+ 	xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_iter_destroy);
+diff --git a/src/ruleset.c b/src/ruleset.c
+index 6ef2956..10d48f6 100644
+--- a/src/ruleset.c
++++ b/src/ruleset.c
+@@ -55,13 +55,12 @@ struct nftnl_parse_ctx {
+ 	uint16_t flags;
+ };
+ 
+-struct nftnl_ruleset *nftnl_ruleset_alloc(void)
++struct nftnl_ruleset __EXPORTED *nftnl_ruleset_alloc(void)
+ {
+ 	return calloc(1, sizeof(struct nftnl_ruleset));
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_alloc);
+ 
+-void nftnl_ruleset_free(const struct nftnl_ruleset *r)
++void __EXPORTED nftnl_ruleset_free(const struct nftnl_ruleset *r)
+ {
+ 	if (r->flags & (1 << NFTNL_RULESET_TABLELIST))
+ 		nftnl_table_list_free(r->table_list);
+@@ -73,15 +72,13 @@ void nftnl_ruleset_free(const struct nftnl_ruleset *r)
+ 		nftnl_rule_list_free(r->rule_list);
+ 	xfree(r);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_free);
+ 
+-bool nftnl_ruleset_is_set(const struct nftnl_ruleset *r, uint16_t attr)
++bool __EXPORTED nftnl_ruleset_is_set(const struct nftnl_ruleset *r, uint16_t attr)
+ {
+ 	return r->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_is_set);
+ 
+-void nftnl_ruleset_unset(struct nftnl_ruleset *r, uint16_t attr)
++void __EXPORTED nftnl_ruleset_unset(struct nftnl_ruleset *r, uint16_t attr)
+ {
+ 	if (!(r->flags & (1 << attr)))
+ 		return;
+@@ -102,9 +99,8 @@ void nftnl_ruleset_unset(struct nftnl_ruleset *r, uint16_t attr)
+ 	}
+ 	r->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_unset);
+ 
+-void nftnl_ruleset_set(struct nftnl_ruleset *r, uint16_t attr, void *data)
++void __EXPORTED nftnl_ruleset_set(struct nftnl_ruleset *r, uint16_t attr, void *data)
+ {
+ 	switch (attr) {
+ 	case NFTNL_RULESET_TABLELIST:
+@@ -128,9 +124,8 @@ void nftnl_ruleset_set(struct nftnl_ruleset *r, uint16_t attr, void *data)
+ 	}
+ 	r->flags |= (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_set);
+ 
+-void *nftnl_ruleset_get(const struct nftnl_ruleset *r, uint16_t attr)
++void __EXPORTED *nftnl_ruleset_get(const struct nftnl_ruleset *r, uint16_t attr)
+ {
+ 	if (!(r->flags & (1 << attr)))
+ 		return NULL;
+@@ -148,9 +143,8 @@ void *nftnl_ruleset_get(const struct nftnl_ruleset *r, uint16_t attr)
+ 		return NULL;
+ 	}
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_get);
+ 
+-void nftnl_ruleset_ctx_free(const struct nftnl_parse_ctx *ctx)
++void __EXPORTED nftnl_ruleset_ctx_free(const struct nftnl_parse_ctx *ctx)
+ {
+ 	switch (ctx->type) {
+ 	case NFTNL_RULESET_TABLE:
+@@ -171,15 +165,13 @@ void nftnl_ruleset_ctx_free(const struct nftnl_parse_ctx *ctx)
+ 		break;
+ 	}
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_ctx_free);
+ 
+-bool nftnl_ruleset_ctx_is_set(const struct nftnl_parse_ctx *ctx, uint16_t attr)
++bool __EXPORTED nftnl_ruleset_ctx_is_set(const struct nftnl_parse_ctx *ctx, uint16_t attr)
+ {
+ 	return ctx->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_ctx_is_set);
+ 
+-void *nftnl_ruleset_ctx_get(const struct nftnl_parse_ctx *ctx, uint16_t attr)
++void __EXPORTED *nftnl_ruleset_ctx_get(const struct nftnl_parse_ctx *ctx, uint16_t attr)
+ {
+ 	if (!(ctx->flags & (1 << attr)))
+ 		return NULL;
+@@ -203,14 +195,12 @@ void *nftnl_ruleset_ctx_get(const struct nftnl_parse_ctx *ctx, uint16_t attr)
+ 		return NULL;
+ 	}
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_ctx_get);
+ 
+-uint32_t nftnl_ruleset_ctx_get_u32(const struct nftnl_parse_ctx *ctx, uint16_t attr)
++uint32_t __EXPORTED nftnl_ruleset_ctx_get_u32(const struct nftnl_parse_ctx *ctx, uint16_t attr)
+ {
+ 	const void *ret = nftnl_ruleset_ctx_get(ctx, attr);
+ 	return ret == NULL ? 0 : *((uint32_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_ctx_get_u32);
+ 
+ #if defined(JSON_PARSING)
+ static void nftnl_ruleset_ctx_set(struct nftnl_parse_ctx *ctx, uint16_t attr,
+@@ -593,22 +583,20 @@ nftnl_ruleset_do_parse(enum nftnl_parse_type type, const void *data,
+ 	return ret;
+ }
+ 
+-int nftnl_ruleset_parse_file_cb(enum nftnl_parse_type type, FILE *fp,
++int __EXPORTED nftnl_ruleset_parse_file_cb(enum nftnl_parse_type type, FILE *fp,
+ 			      struct nftnl_parse_err *err, void *data,
+ 			      int (*cb)(const struct nftnl_parse_ctx *ctx))
+ {
+ 	return nftnl_ruleset_do_parse(type, fp, err, NFTNL_PARSE_FILE, data, cb);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_parse_file_cb);
+ 
+-int nftnl_ruleset_parse_buffer_cb(enum nftnl_parse_type type, const char *buffer,
++int __EXPORTED nftnl_ruleset_parse_buffer_cb(enum nftnl_parse_type type, const char *buffer,
+ 				struct nftnl_parse_err *err, void *data,
+ 				int (*cb)(const struct nftnl_parse_ctx *ctx))
+ {
+ 	return nftnl_ruleset_do_parse(type, buffer, err, NFTNL_PARSE_BUFFER, data,
+ 				    cb);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_parse_buffer_cb);
+ 
+ static int nftnl_ruleset_cb(const struct nftnl_parse_ctx *ctx)
+ {
+@@ -671,19 +659,17 @@ static int nftnl_ruleset_cb(const struct nftnl_parse_ctx *ctx)
+ 	return 0;
+ }
+ 
+-int nftnl_ruleset_parse(struct nftnl_ruleset *r, enum nftnl_parse_type type,
++int __EXPORTED nftnl_ruleset_parse(struct nftnl_ruleset *r, enum nftnl_parse_type type,
+ 		      const char *data, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_ruleset_parse_buffer_cb(type, data, err, r, nftnl_ruleset_cb);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_parse);
+ 
+-int nftnl_ruleset_parse_file(struct nftnl_ruleset *rs, enum nftnl_parse_type type,
++int __EXPORTED nftnl_ruleset_parse_file(struct nftnl_ruleset *rs, enum nftnl_parse_type type,
+ 			   FILE *fp, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_ruleset_parse_file_cb(type, fp, err, rs, nftnl_ruleset_cb);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_parse_file);
+ 
+ static const char *nftnl_ruleset_o_opentag(uint32_t type)
+ {
+@@ -928,7 +914,7 @@ static int nftnl_ruleset_cmd_snprintf(char *buf, size_t size,
+ 	}
+ }
+ 
+-int nftnl_ruleset_snprintf(char *buf, size_t size, const struct nftnl_ruleset *r,
++int __EXPORTED nftnl_ruleset_snprintf(char *buf, size_t size, const struct nftnl_ruleset *r,
+ 			 uint32_t type, uint32_t flags)
+ {
+ 	switch (type) {
+@@ -943,7 +929,6 @@ int nftnl_ruleset_snprintf(char *buf, size_t size, const struct nftnl_ruleset *r
+ 		return -1;
+ 	}
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_snprintf);
+ 
+ static int nftnl_ruleset_fprintf_tables(FILE *fp, const struct nftnl_ruleset *rs,
+ 				      uint32_t type, uint32_t flags)
+@@ -1157,10 +1142,9 @@ static int nftnl_ruleset_cmd_fprintf(FILE *fp, const struct nftnl_ruleset *rs,
+ 	return len;
+ }
+ 
+-int nftnl_ruleset_fprintf(FILE *fp, const struct nftnl_ruleset *rs, uint32_t type,
++int __EXPORTED nftnl_ruleset_fprintf(FILE *fp, const struct nftnl_ruleset *rs, uint32_t type,
+ 			uint32_t flags)
+ {
+ 	return nftnl_ruleset_cmd_fprintf(fp, rs, nftnl_flag2cmd(flags), type,
+ 				       flags);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_fprintf);
+diff --git a/src/set.c b/src/set.c
+index cce5e63..33a6794 100644
+--- a/src/set.c
++++ b/src/set.c
+@@ -27,7 +27,7 @@
+ #include <libnftnl/set.h>
+ #include <libnftnl/expr.h>
+ 
+-struct nftnl_set *nftnl_set_alloc(void)
++struct nftnl_set __EXPORTED *nftnl_set_alloc(void)
+ {
+ 	struct nftnl_set *s;
+ 
+@@ -38,9 +38,8 @@ struct nftnl_set *nftnl_set_alloc(void)
+ 	INIT_LIST_HEAD(&s->element_list);
+ 	return s;
+ }
+-EXPORT_SYMBOL(nftnl_set_alloc);
+ 
+-void nftnl_set_free(const struct nftnl_set *s)
++void __EXPORTED nftnl_set_free(const struct nftnl_set *s)
+ {
+ 	struct nftnl_set_elem *elem, *tmp;
+ 
+@@ -55,15 +54,13 @@ void nftnl_set_free(const struct nftnl_set *s)
+ 	}
+ 	xfree(s);
+ }
+-EXPORT_SYMBOL(nftnl_set_free);
+ 
+-bool nftnl_set_is_set(const struct nftnl_set *s, uint16_t attr)
++bool __EXPORTED nftnl_set_is_set(const struct nftnl_set *s, uint16_t attr)
+ {
+ 	return s->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_set_is_set);
+ 
+-void nftnl_set_unset(struct nftnl_set *s, uint16_t attr)
++void __EXPORTED nftnl_set_unset(struct nftnl_set *s, uint16_t attr)
+ {
+ 	if (!(s->flags & (1 << attr)))
+ 		return;
+@@ -97,7 +94,6 @@ void nftnl_set_unset(struct nftnl_set *s, uint16_t attr)
+ 
+ 	s->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_set_unset);
+ 
+ static uint32_t nftnl_set_validate[NFTNL_SET_MAX + 1] = {
+ 	[NFTNL_SET_FLAGS]		= sizeof(uint32_t),
+@@ -113,7 +109,7 @@ static uint32_t nftnl_set_validate[NFTNL_SET_MAX + 1] = {
+ 	[NFTNL_SET_GC_INTERVAL]	= sizeof(uint32_t),
+ };
+ 
+-int nftnl_set_set_data(struct nftnl_set *s, uint16_t attr, const void *data,
++int __EXPORTED nftnl_set_set_data(struct nftnl_set *s, uint16_t attr, const void *data,
+ 		       uint32_t data_len)
+ {
+ 	nftnl_assert_attr_exists(attr, NFTNL_SET_MAX);
+@@ -186,33 +182,28 @@ int nftnl_set_set_data(struct nftnl_set *s, uint16_t attr, const void *data,
+ 	s->flags |= (1 << attr);
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_set_data);
+ 
+-int nftnl_set_set(struct nftnl_set *s, uint16_t attr, const void *data)
++int __EXPORTED nftnl_set_set(struct nftnl_set *s, uint16_t attr, const void *data)
+ {
+ 	return nftnl_set_set_data(s, attr, data, nftnl_set_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_set_set);
+ 
+-void nftnl_set_set_u32(struct nftnl_set *s, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_set_set_u32(struct nftnl_set *s, uint16_t attr, uint32_t val)
+ {
+ 	nftnl_set_set(s, attr, &val);
+ }
+-EXPORT_SYMBOL(nftnl_set_set_u32);
+ 
+-void nftnl_set_set_u64(struct nftnl_set *s, uint16_t attr, uint64_t val)
++void __EXPORTED nftnl_set_set_u64(struct nftnl_set *s, uint16_t attr, uint64_t val)
+ {
+ 	nftnl_set_set(s, attr, &val);
+ }
+-EXPORT_SYMBOL(nftnl_set_set_u64);
+ 
+-int nftnl_set_set_str(struct nftnl_set *s, uint16_t attr, const char *str)
++int __EXPORTED nftnl_set_set_str(struct nftnl_set *s, uint16_t attr, const char *str)
+ {
+ 	return nftnl_set_set_data(s, attr, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_set_set_str);
+ 
+-const void *nftnl_set_get_data(const struct nftnl_set *s, uint16_t attr,
++const void __EXPORTED *nftnl_set_get_data(const struct nftnl_set *s, uint16_t attr,
+ 			       uint32_t *data_len)
+ {
+ 	if (!(s->flags & (1 << attr)))
+@@ -267,22 +258,19 @@ const void *nftnl_set_get_data(const struct nftnl_set *s, uint16_t attr,
+ 	}
+ 	return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_set_get_data);
+ 
+-const void *nftnl_set_get(const struct nftnl_set *s, uint16_t attr)
++const void __EXPORTED *nftnl_set_get(const struct nftnl_set *s, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	return nftnl_set_get_data(s, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_set_get);
+ 
+-const char *nftnl_set_get_str(const struct nftnl_set *s, uint16_t attr)
++const char __EXPORTED *nftnl_set_get_str(const struct nftnl_set *s, uint16_t attr)
+ {
+ 	return nftnl_set_get(s, attr);
+ }
+-EXPORT_SYMBOL(nftnl_set_get_str);
+ 
+-uint32_t nftnl_set_get_u32(const struct nftnl_set *s, uint16_t attr)
++uint32_t __EXPORTED nftnl_set_get_u32(const struct nftnl_set *s, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	const uint32_t *val = nftnl_set_get_data(s, attr, &data_len);
+@@ -291,9 +279,8 @@ uint32_t nftnl_set_get_u32(const struct nftnl_set *s, uint16_t attr)
+ 
+ 	return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_get_u32);
+ 
+-uint64_t nftnl_set_get_u64(const struct nftnl_set *s, uint16_t attr)
++uint64_t __EXPORTED nftnl_set_get_u64(const struct nftnl_set *s, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	const uint64_t *val = nftnl_set_get_data(s, attr, &data_len);
+@@ -302,7 +289,6 @@ uint64_t nftnl_set_get_u64(const struct nftnl_set *s, uint16_t attr)
+ 
+ 	return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_get_u64);
+ 
+ struct nftnl_set *nftnl_set_clone(const struct nftnl_set *set)
+ {
+@@ -351,7 +337,7 @@ nftnl_set_nlmsg_build_desc_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
+ 	mnl_attr_nest_end(nlh, nest);
+ }
+ 
+-void nftnl_set_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
++void __EXPORTED nftnl_set_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
+ {
+ 	if (s->flags & (1 << NFTNL_SET_TABLE))
+ 		mnl_attr_put_strz(nlh, NFTA_SET_TABLE, s->table);
+@@ -383,7 +369,6 @@ void nftnl_set_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
+ 	if (s->flags & (1 << NFTNL_SET_USERDATA))
+ 		mnl_attr_put(nlh, NFTA_SET_USERDATA, s->user.len, s->user.data);
+ }
+-EXPORT_SYMBOL(nftnl_set_nlmsg_build_payload);
+ 
+ static int nftnl_set_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -463,7 +448,7 @@ static int nftnl_set_desc_parse(struct nftnl_set *s,
+ 	return 0;
+ }
+ 
+-int nftnl_set_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
++int __EXPORTED nftnl_set_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
+ {
+ 	struct nlattr *tb[NFTA_SET_MAX+1] = {};
+ 	struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -546,7 +531,6 @@ int nftnl_set_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
+ 
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_nlmsg_parse);
+ 
+ #ifdef JSON_PARSING
+ static int nftnl_jansson_parse_set_info(struct nftnl_set *s, json_t *tree,
+@@ -718,19 +702,17 @@ static int nftnl_set_do_parse(struct nftnl_set *s, enum nftnl_parse_type type,
+ 
+ 	return ret;
+ }
+-int nftnl_set_parse(struct nftnl_set *s, enum nftnl_parse_type type,
++int __EXPORTED nftnl_set_parse(struct nftnl_set *s, enum nftnl_parse_type type,
+ 		  const char *data, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_set_do_parse(s, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_set_parse);
+ 
+-int nftnl_set_parse_file(struct nftnl_set *s, enum nftnl_parse_type type,
++int __EXPORTED nftnl_set_parse_file(struct nftnl_set *s, enum nftnl_parse_type type,
+ 		       FILE *fp, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_set_do_parse(s, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_set_parse_file);
+ 
+ static int nftnl_set_snprintf_json(char *buf, size_t size,
+ 				   const struct nftnl_set *s,
+@@ -918,13 +900,12 @@ static int nftnl_set_cmd_snprintf(char *buf, size_t size,
+ 	return offset;
+ }
+ 
+-int nftnl_set_snprintf(char *buf, size_t size, const struct nftnl_set *s,
++int __EXPORTED nftnl_set_snprintf(char *buf, size_t size, const struct nftnl_set *s,
+ 		       uint32_t type, uint32_t flags)
+ {
+ 	return nftnl_set_cmd_snprintf(buf, size, s, nftnl_flag2cmd(flags), type,
+ 				    flags);
+ }
+-EXPORT_SYMBOL(nftnl_set_snprintf);
+ 
+ static int nftnl_set_do_snprintf(char *buf, size_t size, const void *s,
+ 				 uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -932,25 +913,23 @@ static int nftnl_set_do_snprintf(char *buf, size_t size, const void *s,
+ 	return nftnl_set_snprintf(buf, size, s, type, flags);
+ }
+ 
+-int nftnl_set_fprintf(FILE *fp, const struct nftnl_set *s, uint32_t type,
++int __EXPORTED nftnl_set_fprintf(FILE *fp, const struct nftnl_set *s, uint32_t type,
+ 		      uint32_t flags)
+ {
+ 	return nftnl_fprintf(fp, s, NFTNL_CMD_UNSPEC, type, flags,
+ 			   nftnl_set_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_set_fprintf);
+ 
+-void nftnl_set_elem_add(struct nftnl_set *s, struct nftnl_set_elem *elem)
++void __EXPORTED nftnl_set_elem_add(struct nftnl_set *s, struct nftnl_set_elem *elem)
+ {
+ 	list_add_tail(&elem->head, &s->element_list);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_add);
+ 
+ struct nftnl_set_list {
+ 	struct list_head list;
+ };
+ 
+-struct nftnl_set_list *nftnl_set_list_alloc(void)
++struct nftnl_set_list __EXPORTED *nftnl_set_list_alloc(void)
+ {
+ 	struct nftnl_set_list *list;
+ 
+@@ -962,9 +941,8 @@ struct nftnl_set_list *nftnl_set_list_alloc(void)
+ 
+ 	return list;
+ }
+-EXPORT_SYMBOL(nftnl_set_list_alloc);
+ 
+-void nftnl_set_list_free(struct nftnl_set_list *list)
++void __EXPORTED nftnl_set_list_free(struct nftnl_set_list *list)
+ {
+ 	struct nftnl_set *s, *tmp;
+ 
+@@ -974,33 +952,28 @@ void nftnl_set_list_free(struct nftnl_set_list *list)
+ 	}
+ 	xfree(list);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_free);
+ 
+-int nftnl_set_list_is_empty(const struct nftnl_set_list *list)
++int __EXPORTED nftnl_set_list_is_empty(const struct nftnl_set_list *list)
+ {
+ 	return list_empty(&list->list);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_is_empty);
+ 
+-void nftnl_set_list_add(struct nftnl_set *s, struct nftnl_set_list *list)
++void __EXPORTED nftnl_set_list_add(struct nftnl_set *s, struct nftnl_set_list *list)
+ {
+ 	list_add(&s->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_add);
+ 
+-void nftnl_set_list_add_tail(struct nftnl_set *s, struct nftnl_set_list *list)
++void __EXPORTED nftnl_set_list_add_tail(struct nftnl_set *s, struct nftnl_set_list *list)
+ {
+ 	list_add_tail(&s->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_add_tail);
+ 
+-void nftnl_set_list_del(struct nftnl_set *s)
++void __EXPORTED nftnl_set_list_del(struct nftnl_set *s)
+ {
+ 	list_del(&s->head);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_del);
+ 
+-int nftnl_set_list_foreach(struct nftnl_set_list *set_list,
++int __EXPORTED nftnl_set_list_foreach(struct nftnl_set_list *set_list,
+ 			 int (*cb)(struct nftnl_set *t, void *data), void *data)
+ {
+ 	struct nftnl_set *cur, *tmp;
+@@ -1013,14 +986,13 @@ int nftnl_set_list_foreach(struct nftnl_set_list *set_list,
+ 	}
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_list_foreach);
+ 
+ struct nftnl_set_list_iter {
+ 	const struct nftnl_set_list	*list;
+ 	struct nftnl_set		*cur;
+ };
+ 
+-struct nftnl_set_list_iter *
++struct nftnl_set_list_iter __EXPORTED *
+ nftnl_set_list_iter_create(const struct nftnl_set_list *l)
+ {
+ 	struct nftnl_set_list_iter *iter;
+@@ -1037,16 +1009,14 @@ nftnl_set_list_iter_create(const struct nftnl_set_list *l)
+ 
+ 	return iter;
+ }
+-EXPORT_SYMBOL(nftnl_set_list_iter_create);
+ 
+-struct nftnl_set *
++struct nftnl_set __EXPORTED *
+ nftnl_set_list_iter_cur(const struct nftnl_set_list_iter *iter)
+ {
+ 	return iter->cur;
+ }
+-EXPORT_SYMBOL(nftnl_set_list_iter_cur);
+ 
+-struct nftnl_set *nftnl_set_list_iter_next(struct nftnl_set_list_iter *iter)
++struct nftnl_set __EXPORTED *nftnl_set_list_iter_next(struct nftnl_set_list_iter *iter)
+ {
+ 	struct nftnl_set *s = iter->cur;
+ 
+@@ -1060,13 +1030,11 @@ struct nftnl_set *nftnl_set_list_iter_next(struct nftnl_set_list_iter *iter)
+ 
+ 	return s;
+ }
+-EXPORT_SYMBOL(nftnl_set_list_iter_next);
+ 
+-void nftnl_set_list_iter_destroy(const struct nftnl_set_list_iter *iter)
++void __EXPORTED nftnl_set_list_iter_destroy(const struct nftnl_set_list_iter *iter)
+ {
+ 	xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_iter_destroy);
+ 
+ static struct nftnl_set *nftnl_set_lookup(const char *this_set_name,
+ 				      struct nftnl_set_list *set_list)
+diff --git a/src/set_elem.c b/src/set_elem.c
+index 433b896..bd1e895 100644
+--- a/src/set_elem.c
++++ b/src/set_elem.c
+@@ -27,7 +27,7 @@
+ #include <libnftnl/rule.h>
+ #include <libnftnl/expr.h>
+ 
+-struct nftnl_set_elem *nftnl_set_elem_alloc(void)
++struct nftnl_set_elem __EXPORTED *nftnl_set_elem_alloc(void)
+ {
+ 	struct nftnl_set_elem *s;
+ 
+@@ -37,9 +37,8 @@ struct nftnl_set_elem *nftnl_set_elem_alloc(void)
+ 
+ 	return s;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_alloc);
+ 
+-void nftnl_set_elem_free(struct nftnl_set_elem *s)
++void __EXPORTED nftnl_set_elem_free(struct nftnl_set_elem *s)
+ {
+ 	if (s->flags & (1 << NFTNL_SET_ELEM_CHAIN))
+ 		xfree(s->data.chain);
+@@ -55,15 +54,13 @@ void nftnl_set_elem_free(struct nftnl_set_elem *s)
+ 
+ 	xfree(s);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_free);
+ 
+-bool nftnl_set_elem_is_set(const struct nftnl_set_elem *s, uint16_t attr)
++bool __EXPORTED nftnl_set_elem_is_set(const struct nftnl_set_elem *s, uint16_t attr)
+ {
+ 	return s->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_is_set);
+ 
+-void nftnl_set_elem_unset(struct nftnl_set_elem *s, uint16_t attr)
++void __EXPORTED nftnl_set_elem_unset(struct nftnl_set_elem *s, uint16_t attr)
+ {
+ 	if (!(s->flags & (1 << attr)))
+ 		return;
+@@ -94,9 +91,8 @@ void nftnl_set_elem_unset(struct nftnl_set_elem *s, uint16_t attr)
+ 
+ 	s->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_unset);
+ 
+-int nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr,
++int __EXPORTED nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr,
+ 		       const void *data, uint32_t data_len)
+ {
+ 	switch(attr) {
+@@ -147,27 +143,23 @@ int nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr,
+ 	s->flags |= (1 << attr);
+ 	return -1;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_set);
+ 
+-void nftnl_set_elem_set_u32(struct nftnl_set_elem *s, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_set_elem_set_u32(struct nftnl_set_elem *s, uint16_t attr, uint32_t val)
+ {
+ 	nftnl_set_elem_set(s, attr, &val, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_set_u32);
+ 
+-void nftnl_set_elem_set_u64(struct nftnl_set_elem *s, uint16_t attr, uint64_t val)
++void __EXPORTED nftnl_set_elem_set_u64(struct nftnl_set_elem *s, uint16_t attr, uint64_t val)
+ {
+ 	nftnl_set_elem_set(s, attr, &val, sizeof(uint64_t));
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_set_u64);
+ 
+-int nftnl_set_elem_set_str(struct nftnl_set_elem *s, uint16_t attr, const char *str)
++int __EXPORTED nftnl_set_elem_set_str(struct nftnl_set_elem *s, uint16_t attr, const char *str)
+ {
+ 	return nftnl_set_elem_set(s, attr, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_set_str);
+ 
+-const void *nftnl_set_elem_get(struct nftnl_set_elem *s, uint16_t attr, uint32_t *data_len)
++const void __EXPORTED *nftnl_set_elem_get(struct nftnl_set_elem *s, uint16_t attr, uint32_t *data_len)
+ {
+ 	if (!(s->flags & (1 << attr)))
+ 		return NULL;
+@@ -205,31 +197,27 @@ const void *nftnl_set_elem_get(struct nftnl_set_elem *s, uint16_t attr, uint32_t
+ 	}
+ 	return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_get);
+ 
+-const char *nftnl_set_elem_get_str(struct nftnl_set_elem *s, uint16_t attr)
++const char __EXPORTED *nftnl_set_elem_get_str(struct nftnl_set_elem *s, uint16_t attr)
+ {
+ 	uint32_t size;
+ 
+ 	return nftnl_set_elem_get(s, attr, &size);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_get_str);
+ 
+-uint32_t nftnl_set_elem_get_u32(struct nftnl_set_elem *s, uint16_t attr)
++uint32_t __EXPORTED nftnl_set_elem_get_u32(struct nftnl_set_elem *s, uint16_t attr)
+ {
+ 	uint32_t size;
+ 	uint32_t val = *((uint32_t *)nftnl_set_elem_get(s, attr, &size));
+ 	return val;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_get_u32);
+ 
+-uint64_t nftnl_set_elem_get_u64(struct nftnl_set_elem *s, uint16_t attr)
++uint64_t __EXPORTED nftnl_set_elem_get_u64(struct nftnl_set_elem *s, uint16_t attr)
+ {
+ 	uint32_t size;
+ 	uint64_t val = *((uint64_t *)nftnl_set_elem_get(s, attr, &size));
+ 	return val;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_get_u64);
+ 
+ struct nftnl_set_elem *nftnl_set_elem_clone(struct nftnl_set_elem *elem)
+ {
+@@ -315,7 +303,7 @@ static struct nlattr *nftnl_set_elem_build(struct nlmsghdr *nlh,
+ 	return nest2;
+ }
+ 
+-void nftnl_set_elems_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
++void __EXPORTED nftnl_set_elems_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
+ {
+ 	struct nftnl_set_elem *elem;
+ 	struct nlattr *nest1;
+@@ -332,7 +320,6 @@ void nftnl_set_elems_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set
+ 
+ 	mnl_attr_nest_end(nlh, nest1);
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_nlmsg_build_payload);
+ 
+ static int nftnl_set_elem_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -503,7 +490,7 @@ static int nftnl_set_elems_parse(struct nftnl_set *s, const struct nlattr *nest)
+ 	return ret;
+ }
+ 
+-int nftnl_set_elems_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
++int __EXPORTED nftnl_set_elems_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
+ {
+ 	struct nlattr *tb[NFTA_SET_ELEM_LIST_MAX+1] = {};
+ 	struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -546,7 +533,6 @@ int nftnl_set_elems_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
+ 
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_nlmsg_parse);
+ 
+ static int nftnl_set_elem_json_parse(struct nftnl_set_elem *e, const void *json,
+ 				   struct nftnl_parse_err *err,
+@@ -587,19 +573,17 @@ nftnl_set_elem_do_parse(struct nftnl_set_elem *e, enum nftnl_parse_type type,
+ 
+ 	return ret;
+ }
+-int nftnl_set_elem_parse(struct nftnl_set_elem *e, enum nftnl_parse_type type,
++int __EXPORTED nftnl_set_elem_parse(struct nftnl_set_elem *e, enum nftnl_parse_type type,
+ 		       const char *data, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_set_elem_do_parse(e, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_parse);
+ 
+-int nftnl_set_elem_parse_file(struct nftnl_set_elem *e, enum nftnl_parse_type type,
++int __EXPORTED nftnl_set_elem_parse_file(struct nftnl_set_elem *e, enum nftnl_parse_type type,
+ 			    FILE *fp, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_set_elem_do_parse(e, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_parse_file);
+ 
+ static int nftnl_set_elem_snprintf_json(char *buf, size_t size,
+ 					const struct nftnl_set_elem *e,
+@@ -719,14 +703,13 @@ static int nftnl_set_elem_cmd_snprintf(char *buf, size_t size,
+ 	return offset;
+ }
+ 
+-int nftnl_set_elem_snprintf(char *buf, size_t size,
++int __EXPORTED nftnl_set_elem_snprintf(char *buf, size_t size,
+ 			    const struct nftnl_set_elem *e,
+ 			    uint32_t type, uint32_t flags)
+ {
+ 	return nftnl_set_elem_cmd_snprintf(buf, size, e, nftnl_flag2cmd(flags),
+ 					 type, flags);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_snprintf);
+ 
+ static int nftnl_set_elem_do_snprintf(char *buf, size_t size, const void *e,
+ 				      uint32_t cmd, uint32_t type,
+@@ -735,15 +718,14 @@ static int nftnl_set_elem_do_snprintf(char *buf, size_t size, const void *e,
+ 	return nftnl_set_elem_snprintf(buf, size, e, type, flags);
+ }
+ 
+-int nftnl_set_elem_fprintf(FILE *fp, struct nftnl_set_elem *se, uint32_t type,
++int __EXPORTED nftnl_set_elem_fprintf(FILE *fp, struct nftnl_set_elem *se, uint32_t type,
+ 			 uint32_t flags)
+ {
+ 	return nftnl_fprintf(fp, se, NFTNL_CMD_UNSPEC, type, flags,
+ 			   nftnl_set_elem_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_fprintf);
+ 
+-int nftnl_set_elem_foreach(struct nftnl_set *s,
++int __EXPORTED nftnl_set_elem_foreach(struct nftnl_set *s,
+ 			 int (*cb)(struct nftnl_set_elem *e, void *data),
+ 			 void *data)
+ {
+@@ -757,7 +739,6 @@ int nftnl_set_elem_foreach(struct nftnl_set *s,
+ 	}
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_foreach);
+ 
+ struct nftnl_set_elems_iter {
+ 	const struct nftnl_set		*set;
+@@ -765,7 +746,7 @@ struct nftnl_set_elems_iter {
+ 	struct nftnl_set_elem		*cur;
+ };
+ 
+-struct nftnl_set_elems_iter *
++struct nftnl_set_elems_iter __EXPORTED *
+ nftnl_set_elems_iter_create(const struct nftnl_set *s)
+ {
+ 	struct nftnl_set_elems_iter *iter;
+@@ -784,16 +765,14 @@ nftnl_set_elems_iter_create(const struct nftnl_set *s)
+ 
+ 	return iter;
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_iter_create);
+ 
+-struct nftnl_set_elem *
++struct nftnl_set_elem __EXPORTED *
+ nftnl_set_elems_iter_cur(const struct nftnl_set_elems_iter *iter)
+ {
+ 	return iter->cur;
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_iter_cur);
+ 
+-struct nftnl_set_elem *nftnl_set_elems_iter_next(struct nftnl_set_elems_iter *iter)
++struct nftnl_set_elem __EXPORTED *nftnl_set_elems_iter_next(struct nftnl_set_elems_iter *iter)
+ {
+ 	struct nftnl_set_elem *s = iter->cur;
+ 
+@@ -806,13 +785,11 @@ struct nftnl_set_elem *nftnl_set_elems_iter_next(struct nftnl_set_elems_iter *it
+ 
+ 	return s;
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_iter_next);
+ 
+-void nftnl_set_elems_iter_destroy(struct nftnl_set_elems_iter *iter)
++void __EXPORTED nftnl_set_elems_iter_destroy(struct nftnl_set_elems_iter *iter)
+ {
+ 	xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_iter_destroy);
+ 
+ static bool nftnl_attr_nest_overflow(struct nlmsghdr *nlh,
+ 				   const struct nlattr *from,
+@@ -831,7 +808,7 @@ static bool nftnl_attr_nest_overflow(struct nlmsghdr *nlh,
+ 	return false;
+ }
+ 
+-int nftnl_set_elems_nlmsg_build_payload_iter(struct nlmsghdr *nlh,
++int __EXPORTED nftnl_set_elems_nlmsg_build_payload_iter(struct nlmsghdr *nlh,
+ 					   struct nftnl_set_elems_iter *iter)
+ {
+ 	struct nftnl_set_elem *elem;
+@@ -861,4 +838,3 @@ int nftnl_set_elems_nlmsg_build_payload_iter(struct nlmsghdr *nlh,
+ 
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_nlmsg_build_payload_iter);
+diff --git a/src/table.c b/src/table.c
+index a7d5a8f..0e99f3c 100644
+--- a/src/table.c
++++ b/src/table.c
+@@ -36,28 +36,25 @@ struct nftnl_table {
+ 	uint32_t	flags;
+ };
+ 
+-struct nftnl_table *nftnl_table_alloc(void)
++struct nftnl_table __EXPORTED *nftnl_table_alloc(void)
+ {
+ 	return calloc(1, sizeof(struct nftnl_table));
+ }
+-EXPORT_SYMBOL(nftnl_table_alloc);
+ 
+-void nftnl_table_free(const struct nftnl_table *t)
++void __EXPORTED nftnl_table_free(const struct nftnl_table *t)
+ {
+ 	if (t->flags & (1 << NFTNL_TABLE_NAME))
+ 		xfree(t->name);
+ 
+ 	xfree(t);
+ }
+-EXPORT_SYMBOL(nftnl_table_free);
+ 
+-bool nftnl_table_is_set(const struct nftnl_table *t, uint16_t attr)
++bool __EXPORTED nftnl_table_is_set(const struct nftnl_table *t, uint16_t attr)
+ {
+ 	return t->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_table_is_set);
+ 
+-void nftnl_table_unset(struct nftnl_table *t, uint16_t attr)
++void __EXPORTED nftnl_table_unset(struct nftnl_table *t, uint16_t attr)
+ {
+ 	if (!(t->flags & (1 << attr)))
+ 		return;
+@@ -74,14 +71,13 @@ void nftnl_table_unset(struct nftnl_table *t, uint16_t attr)
+ 	}
+ 	t->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_table_unset);
+ 
+ static uint32_t nftnl_table_validate[NFTNL_TABLE_MAX + 1] = {
+ 	[NFTNL_TABLE_FLAGS]	= sizeof(uint32_t),
+ 	[NFTNL_TABLE_FAMILY]	= sizeof(uint32_t),
+ };
+ 
+-int nftnl_table_set_data(struct nftnl_table *t, uint16_t attr,
++int __EXPORTED nftnl_table_set_data(struct nftnl_table *t, uint16_t attr,
+ 			 const void *data, uint32_t data_len)
+ {
+ 	nftnl_assert_attr_exists(attr, NFTNL_TABLE_MAX);
+@@ -109,33 +105,28 @@ int nftnl_table_set_data(struct nftnl_table *t, uint16_t attr,
+ 	t->flags |= (1 << attr);
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_table_set_data);
+ 
+-void nftnl_table_set(struct nftnl_table *t, uint16_t attr, const void *data)
++void __EXPORTED nftnl_table_set(struct nftnl_table *t, uint16_t attr, const void *data)
+ {
+ 	nftnl_table_set_data(t, attr, data, nftnl_table_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_table_set);
+ 
+-void nftnl_table_set_u32(struct nftnl_table *t, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_table_set_u32(struct nftnl_table *t, uint16_t attr, uint32_t val)
+ {
+ 	nftnl_table_set_data(t, attr, &val, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_table_set_u32);
+ 
+-void nftnl_table_set_u8(struct nftnl_table *t, uint16_t attr, uint8_t val)
++void __EXPORTED nftnl_table_set_u8(struct nftnl_table *t, uint16_t attr, uint8_t val)
+ {
+ 	nftnl_table_set_data(t, attr, &val, sizeof(uint8_t));
+ }
+-EXPORT_SYMBOL(nftnl_table_set_u8);
+ 
+-int nftnl_table_set_str(struct nftnl_table *t, uint16_t attr, const char *str)
++int __EXPORTED nftnl_table_set_str(struct nftnl_table *t, uint16_t attr, const char *str)
+ {
+ 	return nftnl_table_set_data(t, attr, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_table_set_str);
+ 
+-const void *nftnl_table_get_data(const struct nftnl_table *t, uint16_t attr,
++const void __EXPORTED *nftnl_table_get_data(const struct nftnl_table *t, uint16_t attr,
+ 				 uint32_t *data_len)
+ {
+ 	if (!(t->flags & (1 << attr)))
+@@ -157,43 +148,37 @@ const void *nftnl_table_get_data(const struct nftnl_table *t, uint16_t attr,
+ 	}
+ 	return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_table_get_data);
+ 
+-const void *nftnl_table_get(const struct nftnl_table *t, uint16_t attr)
++const void __EXPORTED *nftnl_table_get(const struct nftnl_table *t, uint16_t attr)
+ {
+ 	uint32_t data_len;
+ 	return nftnl_table_get_data(t, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_table_get);
+ 
+-uint32_t nftnl_table_get_u32(const struct nftnl_table *t, uint16_t attr)
++uint32_t __EXPORTED nftnl_table_get_u32(const struct nftnl_table *t, uint16_t attr)
+ {
+ 	const void *ret = nftnl_table_get(t, attr);
+ 	return ret == NULL ? 0 : *((uint32_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_table_get_u32);
+ 
+-uint8_t nftnl_table_get_u8(const struct nftnl_table *t, uint16_t attr)
++uint8_t __EXPORTED nftnl_table_get_u8(const struct nftnl_table *t, uint16_t attr)
+ {
+ 	const void *ret = nftnl_table_get(t, attr);
+ 	return ret == NULL ? 0 : *((uint8_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_table_get_u8);
+ 
+-const char *nftnl_table_get_str(const struct nftnl_table *t, uint16_t attr)
++const char __EXPORTED *nftnl_table_get_str(const struct nftnl_table *t, uint16_t attr)
+ {
+ 	return nftnl_table_get(t, attr);
+ }
+-EXPORT_SYMBOL(nftnl_table_get_str);
+ 
+-void nftnl_table_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_table *t)
++void __EXPORTED nftnl_table_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_table *t)
+ {
+ 	if (t->flags & (1 << NFTNL_TABLE_NAME))
+ 		mnl_attr_put_strz(nlh, NFTA_TABLE_NAME, t->name);
+ 	if (t->flags & (1 << NFTNL_TABLE_FLAGS))
+ 		mnl_attr_put_u32(nlh, NFTA_TABLE_FLAGS, htonl(t->table_flags));
+ }
+-EXPORT_SYMBOL(nftnl_table_nlmsg_build_payload);
+ 
+ static int nftnl_table_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -219,7 +204,7 @@ static int nftnl_table_parse_attr_cb(const struct nlattr *attr, void *data)
+ 	return MNL_CB_OK;
+ }
+ 
+-int nftnl_table_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_table *t)
++int __EXPORTED nftnl_table_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_table *t)
+ {
+ 	struct nlattr *tb[NFTA_TABLE_MAX+1] = {};
+ 	struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -249,7 +234,6 @@ int nftnl_table_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_table *t)
+ 
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_table_nlmsg_parse);
+ 
+ #ifdef JSON_PARSING
+ int nftnl_jansson_parse_table(struct nftnl_table *t, json_t *tree,
+@@ -330,19 +314,17 @@ static int nftnl_table_do_parse(struct nftnl_table *t, enum nftnl_parse_type typ
+ 	return ret;
+ }
+ 
+-int nftnl_table_parse(struct nftnl_table *t, enum nftnl_parse_type type,
++int __EXPORTED nftnl_table_parse(struct nftnl_table *t, enum nftnl_parse_type type,
+ 		    const char *data, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_table_do_parse(t, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_table_parse);
+ 
+-int nftnl_table_parse_file(struct nftnl_table *t, enum nftnl_parse_type type,
++int __EXPORTED nftnl_table_parse_file(struct nftnl_table *t, enum nftnl_parse_type type,
+ 			 FILE *fp, struct nftnl_parse_err *err)
+ {
+ 	return nftnl_table_do_parse(t, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_table_parse_file);
+ 
+ static int nftnl_table_export(char *buf, size_t size,
+ 			      const struct nftnl_table *t, int type)
+@@ -400,13 +382,12 @@ static int nftnl_table_cmd_snprintf(char *buf, size_t size,
+ 	return offset;
+ }
+ 
+-int nftnl_table_snprintf(char *buf, size_t size, const struct nftnl_table *t,
++int __EXPORTED nftnl_table_snprintf(char *buf, size_t size, const struct nftnl_table *t,
+ 			 uint32_t type, uint32_t flags)
+ {
+ 	return nftnl_table_cmd_snprintf(buf, size, t, nftnl_flag2cmd(flags), type,
+ 				      flags);
+ }
+-EXPORT_SYMBOL(nftnl_table_snprintf);
+ 
+ static int nftnl_table_do_snprintf(char *buf, size_t size, const void *t,
+ 				   uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -414,19 +395,18 @@ static int nftnl_table_do_snprintf(char *buf, size_t size, const void *t,
+ 	return nftnl_table_snprintf(buf, size, t, type, flags);
+ }
+ 
+-int nftnl_table_fprintf(FILE *fp, const struct nftnl_table *t, uint32_t type,
++int __EXPORTED nftnl_table_fprintf(FILE *fp, const struct nftnl_table *t, uint32_t type,
+ 			uint32_t flags)
+ {
+ 	return nftnl_fprintf(fp, t, NFTNL_CMD_UNSPEC, type, flags,
+ 			   nftnl_table_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_table_fprintf);
+ 
+ struct nftnl_table_list {
+ 	struct list_head list;
+ };
+ 
+-struct nftnl_table_list *nftnl_table_list_alloc(void)
++struct nftnl_table_list __EXPORTED *nftnl_table_list_alloc(void)
+ {
+ 	struct nftnl_table_list *list;
+ 
+@@ -438,9 +418,8 @@ struct nftnl_table_list *nftnl_table_list_alloc(void)
+ 
+ 	return list;
+ }
+-EXPORT_SYMBOL(nftnl_table_list_alloc);
+ 
+-void nftnl_table_list_free(struct nftnl_table_list *list)
++void __EXPORTED nftnl_table_list_free(struct nftnl_table_list *list)
+ {
+ 	struct nftnl_table *r, *tmp;
+ 
+@@ -450,33 +429,28 @@ void nftnl_table_list_free(struct nftnl_table_list *list)
+ 	}
+ 	xfree(list);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_free);
+ 
+-int nftnl_table_list_is_empty(const struct nftnl_table_list *list)
++int __EXPORTED nftnl_table_list_is_empty(const struct nftnl_table_list *list)
+ {
+ 	return list_empty(&list->list);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_is_empty);
+ 
+-void nftnl_table_list_add(struct nftnl_table *r, struct nftnl_table_list *list)
++void __EXPORTED nftnl_table_list_add(struct nftnl_table *r, struct nftnl_table_list *list)
+ {
+ 	list_add(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_add);
+ 
+-void nftnl_table_list_add_tail(struct nftnl_table *r, struct nftnl_table_list *list)
++void __EXPORTED nftnl_table_list_add_tail(struct nftnl_table *r, struct nftnl_table_list *list)
+ {
+ 	list_add_tail(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_add_tail);
+ 
+-void nftnl_table_list_del(struct nftnl_table *t)
++void __EXPORTED nftnl_table_list_del(struct nftnl_table *t)
+ {
+ 	list_del(&t->head);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_del);
+ 
+-int nftnl_table_list_foreach(struct nftnl_table_list *table_list,
++int __EXPORTED nftnl_table_list_foreach(struct nftnl_table_list *table_list,
+ 			   int (*cb)(struct nftnl_table *t, void *data),
+ 			   void *data)
+ {
+@@ -490,14 +464,13 @@ int nftnl_table_list_foreach(struct nftnl_table_list *table_list,
+ 	}
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_table_list_foreach);
+ 
+ struct nftnl_table_list_iter {
+ 	const struct nftnl_table_list	*list;
+ 	struct nftnl_table		*cur;
+ };
+ 
+-struct nftnl_table_list_iter *
++struct nftnl_table_list_iter __EXPORTED *
+ nftnl_table_list_iter_create(const struct nftnl_table_list *l)
+ {
+ 	struct nftnl_table_list_iter *iter;
+@@ -514,9 +487,8 @@ nftnl_table_list_iter_create(const struct nftnl_table_list *l)
+ 
+ 	return iter;
+ }
+-EXPORT_SYMBOL(nftnl_table_list_iter_create);
+ 
+-struct nftnl_table *nftnl_table_list_iter_next(struct nftnl_table_list_iter *iter)
++struct nftnl_table __EXPORTED *nftnl_table_list_iter_next(struct nftnl_table_list_iter *iter)
+ {
+ 	struct nftnl_table *r = iter->cur;
+ 
+@@ -530,10 +502,8 @@ struct nftnl_table *nftnl_table_list_iter_next(struct nftnl_table_list_iter *ite
+ 
+ 	return r;
+ }
+-EXPORT_SYMBOL(nftnl_table_list_iter_next);
+ 
+-void nftnl_table_list_iter_destroy(const struct nftnl_table_list_iter *iter)
++void __EXPORTED nftnl_table_list_iter_destroy(const struct nftnl_table_list_iter *iter)
+ {
+ 	xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_iter_destroy);
+diff --git a/src/trace.c b/src/trace.c
+index bd05d3c..4739ef9 100644
+--- a/src/trace.c
++++ b/src/trace.c
+@@ -52,14 +52,12 @@ struct nftnl_trace {
+ 	uint32_t flags;
+ };
+ 
+-EXPORT_SYMBOL(nftnl_trace_alloc);
+-struct nftnl_trace *nftnl_trace_alloc(void)
++struct nftnl_trace __EXPORTED *nftnl_trace_alloc(void)
+ {
+ 	return calloc(1, sizeof(struct nftnl_trace));
+ }
+ 
+-EXPORT_SYMBOL(nftnl_trace_free);
+-void nftnl_trace_free(const struct nftnl_trace *t)
++void __EXPORTED nftnl_trace_free(const struct nftnl_trace *t)
+ {
+ 	xfree(t->chain);
+ 	xfree(t->table);
+@@ -70,8 +68,7 @@ void nftnl_trace_free(const struct nftnl_trace *t)
+ 	xfree(t);
+ }
+ 
+-EXPORT_SYMBOL(nftnl_trace_is_set);
+-bool nftnl_trace_is_set(const struct nftnl_trace *t, uint16_t attr)
++bool __EXPORTED nftnl_trace_is_set(const struct nftnl_trace *t, uint16_t attr)
+ {
+ 	return t->flags & (1 << attr);
+ }
+@@ -130,8 +127,7 @@ static int nftnl_trace_parse_attr_cb(const struct nlattr *attr, void *data)
+ 	return MNL_CB_OK;
+ }
+ 
+-EXPORT_SYMBOL(nftnl_trace_get_data);
+-const void *nftnl_trace_get_data(const struct nftnl_trace *trace,
++const void __EXPORTED *nftnl_trace_get_data(const struct nftnl_trace *trace,
+ 				 uint16_t type, uint32_t *data_len)
+ {
+ 	enum nftnl_trace_attr attr = type;
+@@ -201,8 +197,7 @@ const void *nftnl_trace_get_data(const struct nftnl_trace *trace,
+ 	return NULL;
+ }
+ 
+-EXPORT_SYMBOL(nftnl_trace_get_str);
+-const char *nftnl_trace_get_str(const struct nftnl_trace *trace, uint16_t type)
++const char __EXPORTED *nftnl_trace_get_str(const struct nftnl_trace *trace, uint16_t type)
+ {
+ 	if (!nftnl_trace_is_set(trace, type))
+ 		return NULL;
+@@ -216,8 +211,7 @@ const char *nftnl_trace_get_str(const struct nftnl_trace *trace, uint16_t type)
+ 	return NULL;
+ }
+ 
+-EXPORT_SYMBOL(nftnl_trace_get_u16);
+-uint16_t nftnl_trace_get_u16(const struct nftnl_trace *trace, uint16_t type)
++uint16_t __EXPORTED nftnl_trace_get_u16(const struct nftnl_trace *trace, uint16_t type)
+ {
+ 	const uint16_t *d;
+ 	uint32_t dlen;
+@@ -229,8 +223,7 @@ uint16_t nftnl_trace_get_u16(const struct nftnl_trace *trace, uint16_t type)
+ 	return 0;
+ }
+ 
+-EXPORT_SYMBOL(nftnl_trace_get_u32);
+-uint32_t nftnl_trace_get_u32(const struct nftnl_trace *trace, uint16_t type)
++uint32_t __EXPORTED nftnl_trace_get_u32(const struct nftnl_trace *trace, uint16_t type)
+ {
+ 	const uint32_t *d;
+ 	uint32_t dlen;
+@@ -242,8 +235,7 @@ uint32_t nftnl_trace_get_u32(const struct nftnl_trace *trace, uint16_t type)
+ 	return 0;
+ }
+ 
+-EXPORT_SYMBOL(nftnl_trace_get_u64);
+-uint64_t nftnl_trace_get_u64(const struct nftnl_trace *trace, uint16_t type)
++uint64_t __EXPORTED nftnl_trace_get_u64(const struct nftnl_trace *trace, uint16_t type)
+ {
+ 	const uint64_t *d;
+ 	uint32_t dlen;
+@@ -323,9 +315,8 @@ static int nftnl_trace_parse_verdict(const struct nlattr *attr,
+ 	}
+ 	return 0;
+ }
+-EXPORT_SYMBOL(nftnl_trace_nlmsg_parse);
+ 
+-int nftnl_trace_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_trace *t)
++int __EXPORTED nftnl_trace_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_trace *t)
+ {
+ 	struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+ 	struct nlattr *tb[NFTA_TRACE_MAX+1] = {};
+diff --git a/src/udata.c b/src/udata.c
+index d679dd0..7e2de0f 100644
+--- a/src/udata.c
++++ b/src/udata.c
+@@ -16,7 +16,7 @@
+ #include <stdint.h>
+ #include <string.h>
+ 
+-struct nftnl_udata_buf *nftnl_udata_buf_alloc(uint32_t data_size)
++struct nftnl_udata_buf __EXPORTED *nftnl_udata_buf_alloc(uint32_t data_size)
+ {
+ 	struct nftnl_udata_buf *buf;
+ 
+@@ -28,47 +28,40 @@ struct nftnl_udata_buf *nftnl_udata_buf_alloc(uint32_t data_size)
+ 
+ 	return buf;
+ }
+-EXPORT_SYMBOL(nftnl_udata_buf_alloc);
+ 
+-void nftnl_udata_buf_free(const struct nftnl_udata_buf *buf)
++void __EXPORTED nftnl_udata_buf_free(const struct nftnl_udata_buf *buf)
+ {
+ 	xfree(buf);
+ }
+-EXPORT_SYMBOL(nftnl_udata_buf_free);
+ 
+-uint32_t nftnl_udata_buf_len(const struct nftnl_udata_buf *buf)
++uint32_t __EXPORTED nftnl_udata_buf_len(const struct nftnl_udata_buf *buf)
+ {
+ 	return (uint32_t)(buf->end - buf->data);
+ }
+-EXPORT_SYMBOL(nftnl_udata_buf_len);
+ 
+-void *nftnl_udata_buf_data(const struct nftnl_udata_buf *buf)
++void __EXPORTED *nftnl_udata_buf_data(const struct nftnl_udata_buf *buf)
+ {
+ 	return (void *)buf->data;
+ }
+-EXPORT_SYMBOL(nftnl_udata_buf_data);
+ 
+-void nftnl_udata_buf_put(struct nftnl_udata_buf *buf, const void *data,
++void __EXPORTED nftnl_udata_buf_put(struct nftnl_udata_buf *buf, const void *data,
+ 			 uint32_t len)
+ {
+ 	memcpy(buf->data, data, len <= buf->size ? len : buf->size);
+ 	buf->end = buf->data + len;
+ }
+-EXPORT_SYMBOL(nftnl_udata_buf_put);
+ 
+-struct nftnl_udata *nftnl_udata_start(const struct nftnl_udata_buf *buf)
++struct nftnl_udata __EXPORTED *nftnl_udata_start(const struct nftnl_udata_buf *buf)
+ {
+ 	return (struct nftnl_udata *)buf->data;
+ }
+-EXPORT_SYMBOL(nftnl_udata_start);
+ 
+-struct nftnl_udata *nftnl_udata_end(const struct nftnl_udata_buf *buf)
++struct nftnl_udata __EXPORTED *nftnl_udata_end(const struct nftnl_udata_buf *buf)
+ {
+ 	return (struct nftnl_udata *)buf->end;
+ }
+-EXPORT_SYMBOL(nftnl_udata_end);
+ 
+-bool nftnl_udata_put(struct nftnl_udata_buf *buf, uint8_t type, uint32_t len,
++bool __EXPORTED nftnl_udata_put(struct nftnl_udata_buf *buf, uint8_t type, uint32_t len,
+ 		     const void *value)
+ {
+ 	struct nftnl_udata *attr;
+@@ -85,55 +78,47 @@ bool nftnl_udata_put(struct nftnl_udata_buf *buf, uint8_t type, uint32_t len,
+ 
+ 	return true;
+ }
+-EXPORT_SYMBOL(nftnl_udata_put);
+ 
+-bool nftnl_udata_put_strz(struct nftnl_udata_buf *buf, uint8_t type,
++bool __EXPORTED nftnl_udata_put_strz(struct nftnl_udata_buf *buf, uint8_t type,
+ 			  const char *strz)
+ {
+ 	return nftnl_udata_put(buf, type, strlen(strz) + 1, strz);
+ }
+-EXPORT_SYMBOL(nftnl_udata_put_strz);
+ 
+-bool nftnl_udata_put_u32(struct nftnl_udata_buf *buf, uint8_t type,
++bool __EXPORTED nftnl_udata_put_u32(struct nftnl_udata_buf *buf, uint8_t type,
+ 			 uint32_t data)
+ {
+ 	return nftnl_udata_put(buf, type, sizeof(data), &data);
+ }
+-EXPORT_SYMBOL(nftnl_udata_put_u32);
+ 
+-uint8_t nftnl_udata_type(const struct nftnl_udata *attr)
++uint8_t __EXPORTED nftnl_udata_type(const struct nftnl_udata *attr)
+ {
+ 	return attr->type;
+ }
+-EXPORT_SYMBOL(nftnl_udata_type);
+ 
+-uint8_t nftnl_udata_len(const struct nftnl_udata *attr)
++uint8_t __EXPORTED nftnl_udata_len(const struct nftnl_udata *attr)
+ {
+ 	return attr->len;
+ }
+-EXPORT_SYMBOL(nftnl_udata_len);
+ 
+-void *nftnl_udata_get(const struct nftnl_udata *attr)
++void __EXPORTED *nftnl_udata_get(const struct nftnl_udata *attr)
+ {
+ 	return (void *)attr->value;
+ }
+-EXPORT_SYMBOL(nftnl_udata_get);
+ 
+-uint32_t nftnl_udata_get_u32(const struct nftnl_udata *attr)
++uint32_t __EXPORTED nftnl_udata_get_u32(const struct nftnl_udata *attr)
+ {
+ 	uint32_t *data = (uint32_t *)attr->value;
+ 
+ 	return *data;
+ }
+-EXPORT_SYMBOL(nftnl_udata_get_u32);
+ 
+-struct nftnl_udata *nftnl_udata_next(const struct nftnl_udata *attr)
++struct nftnl_udata __EXPORTED *nftnl_udata_next(const struct nftnl_udata *attr)
+ {
+ 	return (struct nftnl_udata *)&attr->value[attr->len];
+ }
+-EXPORT_SYMBOL(nftnl_udata_next);
+ 
+-int nftnl_udata_parse(const void *data, uint32_t data_len, nftnl_udata_cb_t cb,
++int __EXPORTED nftnl_udata_parse(const void *data, uint32_t data_len, nftnl_udata_cb_t cb,
+ 		      void *cb_data)
+ {
+ 	int ret = 0;
+@@ -147,4 +132,3 @@ int nftnl_udata_parse(const void *data, uint32_t data_len, nftnl_udata_cb_t cb,
+ 
+ 	return ret;
+ }
+-EXPORT_SYMBOL(nftnl_udata_parse);
+-- 
+2.11.0 (Apple Git-81)
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-avoid-naming-local-function-as-one-of-printf-family.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-avoid-naming-local-function-as-one-of-printf-family.patch
new file mode 100644
index 0000000..06e6817
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-avoid-naming-local-function-as-one-of-printf-family.patch
@@ -0,0 +1,514 @@
+From f840cc0da571d98beb17855c177e9986bd096b72 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Apr 2017 11:46:09 -0700
+Subject: [PATCH] avoid naming local function as one of printf family
+
+Fixes build issues with clang
+error: no member named '__builtin___snprintf_chk' in 'struct expr_ops'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/expr_ops.h   | 2 +-
+ include/obj.h        | 2 +-
+ src/buffer.c         | 2 +-
+ src/expr.c           | 4 ++--
+ src/expr/bitwise.c   | 2 +-
+ src/expr/byteorder.c | 2 +-
+ src/expr/cmp.c       | 2 +-
+ src/expr/counter.c   | 2 +-
+ src/expr/ct.c        | 2 +-
+ src/expr/dup.c       | 2 +-
+ src/expr/dynset.c    | 2 +-
+ src/expr/exthdr.c    | 2 +-
+ src/expr/fib.c       | 2 +-
+ src/expr/fwd.c       | 2 +-
+ src/expr/hash.c      | 2 +-
+ src/expr/immediate.c | 2 +-
+ src/expr/limit.c     | 2 +-
+ src/expr/log.c       | 2 +-
+ src/expr/lookup.c    | 2 +-
+ src/expr/masq.c      | 2 +-
+ src/expr/match.c     | 2 +-
+ src/expr/meta.c      | 2 +-
+ src/expr/nat.c       | 2 +-
+ src/expr/numgen.c    | 2 +-
+ src/expr/objref.c    | 2 +-
+ src/expr/payload.c   | 2 +-
+ src/expr/queue.c     | 2 +-
+ src/expr/quota.c     | 2 +-
+ src/expr/range.c     | 2 +-
+ src/expr/redir.c     | 2 +-
+ src/expr/reject.c    | 2 +-
+ src/expr/rt.c        | 2 +-
+ src/expr/target.c    | 2 +-
+ src/obj/counter.c    | 2 +-
+ src/obj/ct_helper.c  | 2 +-
+ src/obj/quota.c      | 2 +-
+ src/object.c         | 4 ++--
+ 37 files changed, 39 insertions(+), 39 deletions(-)
+
+diff --git a/include/expr_ops.h b/include/expr_ops.h
+index e639390..c4fe050 100644
+--- a/include/expr_ops.h
++++ b/include/expr_ops.h
+@@ -18,7 +18,7 @@ struct expr_ops {
+ 	const void *(*get)(const struct nftnl_expr *e, uint16_t type, uint32_t *data_len);
+ 	int 	(*parse)(struct nftnl_expr *e, struct nlattr *attr);
+ 	void	(*build)(struct nlmsghdr *nlh, const struct nftnl_expr *e);
+-	int	(*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e);
++	int	(*snprintf_)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e);
+ 	int	(*json_parse)(struct nftnl_expr *e, json_t *data,
+ 			      struct nftnl_parse_err *err);
+ };
+diff --git a/include/obj.h b/include/obj.h
+index d90919f..772caff 100644
+--- a/include/obj.h
++++ b/include/obj.h
+@@ -47,7 +47,7 @@ struct obj_ops {
+ 	const void *(*get)(const struct nftnl_obj *e, uint16_t type, uint32_t *data_len);
+ 	int	(*parse)(struct nftnl_obj *e, struct nlattr *attr);
+ 	void	(*build)(struct nlmsghdr *nlh, const struct nftnl_obj *e);
+-	int	(*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_obj *e);
++	int	(*snprintf_)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_obj *e);
+ 	int	(*json_parse)(struct nftnl_obj *e, json_t *data,
+ 			      struct nftnl_parse_err *err);
+ };
+diff --git a/src/buffer.c b/src/buffer.c
+index f9d5a83..db656e2 100644
+--- a/src/buffer.c
++++ b/src/buffer.c
+@@ -206,7 +206,7 @@ int nftnl_buf_expr(struct nftnl_buf *b, int type, uint32_t flags,
+ 	case NFTNL_OUTPUT_JSON:
+ 		nftnl_buf_put(b, "{");
+ 		nftnl_buf_str(b, type, expr->ops->name, TYPE);
+-		ret = expr->ops->snprintf(b->buf + b->off, b->len, type, flags,
++		ret = expr->ops->snprintf_(b->buf + b->off, b->len, type, flags,
+ 					  expr);
+ 		if (ret > 0)
+ 			nftnl_buf_update(b, ret);
+diff --git a/src/expr.c b/src/expr.c
+index c7eb2b4..24f8f8c 100644
+--- a/src/expr.c
++++ b/src/expr.c
+@@ -265,10 +265,10 @@ int __EXPORTED nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_ex
+ 	int ret;
+ 	unsigned int offset = 0, len = size;
+ 
+-	if (!expr->ops->snprintf)
++	if (!expr->ops->snprintf_)
+ 		return 0;
+ 
+-	ret = expr->ops->snprintf(buf+offset, len, type, flags, expr);
++	ret = expr->ops->snprintf_(buf+offset, len, type, flags, expr);
+ 	SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+ 
+ 	return offset;
+diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c
+index 0febc9d..9b48e79 100644
+--- a/src/expr/bitwise.c
++++ b/src/expr/bitwise.c
+@@ -299,6 +299,6 @@ struct expr_ops expr_ops_bitwise = {
+ 	.get		= nftnl_expr_bitwise_get,
+ 	.parse		= nftnl_expr_bitwise_parse,
+ 	.build		= nftnl_expr_bitwise_build,
+-	.snprintf	= nftnl_expr_bitwise_snprintf,
++	.snprintf_	= nftnl_expr_bitwise_snprintf,
+ 	.json_parse	= nftnl_expr_bitwise_json_parse,
+ };
+diff --git a/src/expr/byteorder.c b/src/expr/byteorder.c
+index 3805307..079582f 100644
+--- a/src/expr/byteorder.c
++++ b/src/expr/byteorder.c
+@@ -314,6 +314,6 @@ struct expr_ops expr_ops_byteorder = {
+ 	.get		= nftnl_expr_byteorder_get,
+ 	.parse		= nftnl_expr_byteorder_parse,
+ 	.build		= nftnl_expr_byteorder_build,
+-	.snprintf	= nftnl_expr_byteorder_snprintf,
++	.snprintf_	= nftnl_expr_byteorder_snprintf,
+ 	.json_parse	= nftnl_expr_byteorder_json_parse,
+ };
+diff --git a/src/expr/cmp.c b/src/expr/cmp.c
+index 353e907..99b497c 100644
+--- a/src/expr/cmp.c
++++ b/src/expr/cmp.c
+@@ -284,6 +284,6 @@ struct expr_ops expr_ops_cmp = {
+ 	.get		= nftnl_expr_cmp_get,
+ 	.parse		= nftnl_expr_cmp_parse,
+ 	.build		= nftnl_expr_cmp_build,
+-	.snprintf	= nftnl_expr_cmp_snprintf,
++	.snprintf_	= nftnl_expr_cmp_snprintf,
+ 	.json_parse	= nftnl_expr_cmp_json_parse,
+ };
+diff --git a/src/expr/counter.c b/src/expr/counter.c
+index 21901e8..9fd7655 100644
+--- a/src/expr/counter.c
++++ b/src/expr/counter.c
+@@ -200,6 +200,6 @@ struct expr_ops expr_ops_counter = {
+ 	.get		= nftnl_expr_counter_get,
+ 	.parse		= nftnl_expr_counter_parse,
+ 	.build		= nftnl_expr_counter_build,
+-	.snprintf	= nftnl_expr_counter_snprintf,
++	.snprintf_	= nftnl_expr_counter_snprintf,
+ 	.json_parse	= nftnl_expr_counter_json_parse,
+ };
+diff --git a/src/expr/ct.c b/src/expr/ct.c
+index cdd08e9..6ce5478 100644
+--- a/src/expr/ct.c
++++ b/src/expr/ct.c
+@@ -356,6 +356,6 @@ struct expr_ops expr_ops_ct = {
+ 	.get		= nftnl_expr_ct_get,
+ 	.parse		= nftnl_expr_ct_parse,
+ 	.build		= nftnl_expr_ct_build,
+-	.snprintf	= nftnl_expr_ct_snprintf,
++	.snprintf_	= nftnl_expr_ct_snprintf,
+ 	.json_parse	= nftnl_expr_ct_json_parse,
+ };
+diff --git a/src/expr/dup.c b/src/expr/dup.c
+index 9aa332b..2f491d8 100644
+--- a/src/expr/dup.c
++++ b/src/expr/dup.c
+@@ -206,6 +206,6 @@ struct expr_ops expr_ops_dup = {
+ 	.get		= nftnl_expr_dup_get,
+ 	.parse		= nftnl_expr_dup_parse,
+ 	.build		= nftnl_expr_dup_build,
+-	.snprintf	= nftnl_expr_dup_snprintf,
++	.snprintf_	= nftnl_expr_dup_snprintf,
+ 	.json_parse	= nftnl_expr_dup_json_parse,
+ };
+diff --git a/src/expr/dynset.c b/src/expr/dynset.c
+index f7b99ea..758f07c 100644
+--- a/src/expr/dynset.c
++++ b/src/expr/dynset.c
+@@ -368,6 +368,6 @@ struct expr_ops expr_ops_dynset = {
+ 	.get		= nftnl_expr_dynset_get,
+ 	.parse		= nftnl_expr_dynset_parse,
+ 	.build		= nftnl_expr_dynset_build,
+-	.snprintf	= nftnl_expr_dynset_snprintf,
++	.snprintf_	= nftnl_expr_dynset_snprintf,
+ 	.json_parse	= nftnl_expr_dynset_json_parse,
+ };
+diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c
+index d4f1665..a834782 100644
+--- a/src/expr/exthdr.c
++++ b/src/expr/exthdr.c
+@@ -356,6 +356,6 @@ struct expr_ops expr_ops_exthdr = {
+ 	.get		= nftnl_expr_exthdr_get,
+ 	.parse		= nftnl_expr_exthdr_parse,
+ 	.build		= nftnl_expr_exthdr_build,
+-	.snprintf	= nftnl_expr_exthdr_snprintf,
++	.snprintf_	= nftnl_expr_exthdr_snprintf,
+ 	.json_parse	= nftnl_expr_exthdr_json_parse,
+ };
+diff --git a/src/expr/fib.c b/src/expr/fib.c
+index f3be081..3c353b2 100644
+--- a/src/expr/fib.c
++++ b/src/expr/fib.c
+@@ -272,6 +272,6 @@ struct expr_ops expr_ops_fib = {
+ 	.get		= nftnl_expr_fib_get,
+ 	.parse		= nftnl_expr_fib_parse,
+ 	.build		= nftnl_expr_fib_build,
+-	.snprintf	= nftnl_expr_fib_snprintf,
++	.snprintf_	= nftnl_expr_fib_snprintf,
+ 	.json_parse	= nftnl_expr_fib_json_parse,
+ };
+diff --git a/src/expr/fwd.c b/src/expr/fwd.c
+index c30d494..f6e41f1 100644
+--- a/src/expr/fwd.c
++++ b/src/expr/fwd.c
+@@ -180,6 +180,6 @@ struct expr_ops expr_ops_fwd = {
+ 	.get		= nftnl_expr_fwd_get,
+ 	.parse		= nftnl_expr_fwd_parse,
+ 	.build		= nftnl_expr_fwd_build,
+-	.snprintf	= nftnl_expr_fwd_snprintf,
++	.snprintf_	= nftnl_expr_fwd_snprintf,
+ 	.json_parse	= nftnl_expr_fwd_json_parse,
+ };
+diff --git a/src/expr/hash.c b/src/expr/hash.c
+index d870510..5acb66a 100644
+--- a/src/expr/hash.c
++++ b/src/expr/hash.c
+@@ -332,6 +332,6 @@ struct expr_ops expr_ops_hash = {
+ 	.get		= nftnl_expr_hash_get,
+ 	.parse		= nftnl_expr_hash_parse,
+ 	.build		= nftnl_expr_hash_build,
+-	.snprintf	= nftnl_expr_hash_snprintf,
++	.snprintf_	= nftnl_expr_hash_snprintf,
+ 	.json_parse	= nftnl_expr_hash_json_parse,
+ };
+diff --git a/src/expr/immediate.c b/src/expr/immediate.c
+index 0b188cc..94bd6da 100644
+--- a/src/expr/immediate.c
++++ b/src/expr/immediate.c
+@@ -316,6 +316,6 @@ struct expr_ops expr_ops_immediate = {
+ 	.get		= nftnl_expr_immediate_get,
+ 	.parse		= nftnl_expr_immediate_parse,
+ 	.build		= nftnl_expr_immediate_build,
+-	.snprintf	= nftnl_expr_immediate_snprintf,
++	.snprintf_	= nftnl_expr_immediate_snprintf,
+ 	.json_parse	= nftnl_expr_immediate_json_parse,
+ };
+diff --git a/src/expr/limit.c b/src/expr/limit.c
+index 856ab18..e71fc2f 100644
+--- a/src/expr/limit.c
++++ b/src/expr/limit.c
+@@ -285,6 +285,6 @@ struct expr_ops expr_ops_limit = {
+ 	.get		= nftnl_expr_limit_get,
+ 	.parse		= nftnl_expr_limit_parse,
+ 	.build		= nftnl_expr_limit_build,
+-	.snprintf	= nftnl_expr_limit_snprintf,
++	.snprintf_	= nftnl_expr_limit_snprintf,
+ 	.json_parse	= nftnl_expr_limit_json_parse,
+ };
+diff --git a/src/expr/log.c b/src/expr/log.c
+index b642255..71dd83a 100644
+--- a/src/expr/log.c
++++ b/src/expr/log.c
+@@ -352,6 +352,6 @@ struct expr_ops expr_ops_log = {
+ 	.get		= nftnl_expr_log_get,
+ 	.parse		= nftnl_expr_log_parse,
+ 	.build		= nftnl_expr_log_build,
+-	.snprintf	= nftnl_expr_log_snprintf,
++	.snprintf_	= nftnl_expr_log_snprintf,
+ 	.json_parse	= nftnl_expr_log_json_parse,
+ };
+diff --git a/src/expr/lookup.c b/src/expr/lookup.c
+index 861815f..6049913 100644
+--- a/src/expr/lookup.c
++++ b/src/expr/lookup.c
+@@ -293,6 +293,6 @@ struct expr_ops expr_ops_lookup = {
+ 	.get		= nftnl_expr_lookup_get,
+ 	.parse		= nftnl_expr_lookup_parse,
+ 	.build		= nftnl_expr_lookup_build,
+-	.snprintf	= nftnl_expr_lookup_snprintf,
++	.snprintf_	= nftnl_expr_lookup_snprintf,
+ 	.json_parse	= nftnl_expr_lookup_json_parse,
+ };
+diff --git a/src/expr/masq.c b/src/expr/masq.c
+index 7c235d3..adec325 100644
+--- a/src/expr/masq.c
++++ b/src/expr/masq.c
+@@ -228,6 +228,6 @@ struct expr_ops expr_ops_masq = {
+ 	.get		= nftnl_expr_masq_get,
+ 	.parse		= nftnl_expr_masq_parse,
+ 	.build		= nftnl_expr_masq_build,
+-	.snprintf	= nftnl_expr_masq_snprintf,
++	.snprintf_	= nftnl_expr_masq_snprintf,
+ 	.json_parse	= nftnl_expr_masq_json_parse,
+ };
+diff --git a/src/expr/match.c b/src/expr/match.c
+index dd09e1e..f0d8868 100644
+--- a/src/expr/match.c
++++ b/src/expr/match.c
+@@ -249,6 +249,6 @@ struct expr_ops expr_ops_match = {
+ 	.get		= nftnl_expr_match_get,
+ 	.parse		= nftnl_expr_match_parse,
+ 	.build		= nftnl_expr_match_build,
+-	.snprintf	= nftnl_expr_match_snprintf,
++	.snprintf_	= nftnl_expr_match_snprintf,
+ 	.json_parse 	= nftnl_expr_match_json_parse,
+ };
+diff --git a/src/expr/meta.c b/src/expr/meta.c
+index 2c75841..907a677 100644
+--- a/src/expr/meta.c
++++ b/src/expr/meta.c
+@@ -290,6 +290,6 @@ struct expr_ops expr_ops_meta = {
+ 	.get		= nftnl_expr_meta_get,
+ 	.parse		= nftnl_expr_meta_parse,
+ 	.build		= nftnl_expr_meta_build,
+-	.snprintf	= nftnl_expr_meta_snprintf,
++	.snprintf_	= nftnl_expr_meta_snprintf,
+ 	.json_parse 	= nftnl_expr_meta_json_parse,
+ };
+diff --git a/src/expr/nat.c b/src/expr/nat.c
+index 29bc3a2..d476283 100644
+--- a/src/expr/nat.c
++++ b/src/expr/nat.c
+@@ -383,6 +383,6 @@ struct expr_ops expr_ops_nat = {
+ 	.get		= nftnl_expr_nat_get,
+ 	.parse		= nftnl_expr_nat_parse,
+ 	.build		= nftnl_expr_nat_build,
+-	.snprintf	= nftnl_expr_nat_snprintf,
++	.snprintf_	= nftnl_expr_nat_snprintf,
+ 	.json_parse	= nftnl_expr_nat_json_parse,
+ };
+diff --git a/src/expr/numgen.c b/src/expr/numgen.c
+index a15f03a..28ef741 100644
+--- a/src/expr/numgen.c
++++ b/src/expr/numgen.c
+@@ -264,6 +264,6 @@ struct expr_ops expr_ops_ng = {
+ 	.get		= nftnl_expr_ng_get,
+ 	.parse		= nftnl_expr_ng_parse,
+ 	.build		= nftnl_expr_ng_build,
+-	.snprintf	= nftnl_expr_ng_snprintf,
++	.snprintf_	= nftnl_expr_ng_snprintf,
+ 	.json_parse	= nftnl_expr_ng_json_parse,
+ };
+diff --git a/src/expr/objref.c b/src/expr/objref.c
+index 4cfa3cb..c394290 100644
+--- a/src/expr/objref.c
++++ b/src/expr/objref.c
+@@ -278,6 +278,6 @@ struct expr_ops expr_ops_objref = {
+ 	.get		= nftnl_expr_objref_get,
+ 	.parse		= nftnl_expr_objref_parse,
+ 	.build		= nftnl_expr_objref_build,
+-	.snprintf	= nftnl_expr_objref_snprintf,
++	.snprintf_	= nftnl_expr_objref_snprintf,
+ 	.json_parse	= nftnl_expr_objref_json_parse,
+ };
+diff --git a/src/expr/payload.c b/src/expr/payload.c
+index 91e1587..894ac08 100644
+--- a/src/expr/payload.c
++++ b/src/expr/payload.c
+@@ -348,6 +348,6 @@ struct expr_ops expr_ops_payload = {
+ 	.get		= nftnl_expr_payload_get,
+ 	.parse		= nftnl_expr_payload_parse,
+ 	.build		= nftnl_expr_payload_build,
+-	.snprintf	= nftnl_expr_payload_snprintf,
++	.snprintf_	= nftnl_expr_payload_snprintf,
+ 	.json_parse	= nftnl_expr_payload_json_parse,
+ };
+diff --git a/src/expr/queue.c b/src/expr/queue.c
+index 8a9deda..389af83 100644
+--- a/src/expr/queue.c
++++ b/src/expr/queue.c
+@@ -276,6 +276,6 @@ struct expr_ops expr_ops_queue = {
+ 	.get		= nftnl_expr_queue_get,
+ 	.parse		= nftnl_expr_queue_parse,
+ 	.build		= nftnl_expr_queue_build,
+-	.snprintf	= nftnl_expr_queue_snprintf,
++	.snprintf_	= nftnl_expr_queue_snprintf,
+ 	.json_parse	= nftnl_expr_queue_json_parse,
+ };
+diff --git a/src/expr/quota.c b/src/expr/quota.c
+index 667e6e1..ff5d182 100644
+--- a/src/expr/quota.c
++++ b/src/expr/quota.c
+@@ -203,6 +203,6 @@ struct expr_ops expr_ops_quota = {
+ 	.get		= nftnl_expr_quota_get,
+ 	.parse		= nftnl_expr_quota_parse,
+ 	.build		= nftnl_expr_quota_build,
+-	.snprintf	= nftnl_expr_quota_snprintf,
++	.snprintf_	= nftnl_expr_quota_snprintf,
+ 	.json_parse	= nftnl_expr_quota_json_parse,
+ };
+diff --git a/src/expr/range.c b/src/expr/range.c
+index 8c8ce12..34d422b 100644
+--- a/src/expr/range.c
++++ b/src/expr/range.c
+@@ -283,6 +283,6 @@ struct expr_ops expr_ops_range = {
+ 	.get		= nftnl_expr_range_get,
+ 	.parse		= nftnl_expr_range_parse,
+ 	.build		= nftnl_expr_range_build,
+-	.snprintf	= nftnl_expr_range_snprintf,
++	.snprintf_	= nftnl_expr_range_snprintf,
+ 	.json_parse	= nftnl_expr_range_json_parse,
+ };
+diff --git a/src/expr/redir.c b/src/expr/redir.c
+index 43538d5..8a21f93 100644
+--- a/src/expr/redir.c
++++ b/src/expr/redir.c
+@@ -242,6 +242,6 @@ struct expr_ops expr_ops_redir = {
+ 	.get		= nftnl_expr_redir_get,
+ 	.parse		= nftnl_expr_redir_parse,
+ 	.build		= nftnl_expr_redir_build,
+-	.snprintf	= nftnl_expr_redir_snprintf,
++	.snprintf_	= nftnl_expr_redir_snprintf,
+ 	.json_parse	= nftnl_expr_redir_json_parse,
+ };
+diff --git a/src/expr/reject.c b/src/expr/reject.c
+index 11d8b20..b10e729 100644
+--- a/src/expr/reject.c
++++ b/src/expr/reject.c
+@@ -200,6 +200,6 @@ struct expr_ops expr_ops_reject = {
+ 	.get		= nftnl_expr_reject_get,
+ 	.parse		= nftnl_expr_reject_parse,
+ 	.build		= nftnl_expr_reject_build,
+-	.snprintf	= nftnl_expr_reject_snprintf,
++	.snprintf_	= nftnl_expr_reject_snprintf,
+ 	.json_parse	= nftnl_expr_reject_json_parse,
+ };
+diff --git a/src/expr/rt.c b/src/expr/rt.c
+index 5088e66..9f44b29 100644
+--- a/src/expr/rt.c
++++ b/src/expr/rt.c
+@@ -238,6 +238,6 @@ struct expr_ops expr_ops_rt = {
+ 	.get		= nftnl_expr_rt_get,
+ 	.parse		= nftnl_expr_rt_parse,
+ 	.build		= nftnl_expr_rt_build,
+-	.snprintf	= nftnl_expr_rt_snprintf,
++	.snprintf_	= nftnl_expr_rt_snprintf,
+ 	.json_parse	= nftnl_expr_rt_json_parse,
+ };
+diff --git a/src/expr/target.c b/src/expr/target.c
+index ed4bf7d..2ef4078 100644
+--- a/src/expr/target.c
++++ b/src/expr/target.c
+@@ -249,6 +249,6 @@ struct expr_ops expr_ops_target = {
+ 	.get		= nftnl_expr_target_get,
+ 	.parse		= nftnl_expr_target_parse,
+ 	.build		= nftnl_expr_target_build,
+-	.snprintf	= nftnl_expr_target_snprintf,
++	.snprintf_	= nftnl_expr_target_snprintf,
+ 	.json_parse	= nftnl_expr_target_json_parse,
+ };
+diff --git a/src/obj/counter.c b/src/obj/counter.c
+index beadc93..8c4cc25 100644
+--- a/src/obj/counter.c
++++ b/src/obj/counter.c
+@@ -179,6 +179,6 @@ struct obj_ops obj_ops_counter = {
+ 	.get		= nftnl_obj_counter_get,
+ 	.parse		= nftnl_obj_counter_parse,
+ 	.build		= nftnl_obj_counter_build,
+-	.snprintf	= nftnl_obj_counter_snprintf,
++	.snprintf_	= nftnl_obj_counter_snprintf,
+ 	.json_parse	= nftnl_obj_counter_json_parse,
+ };
+diff --git a/src/obj/ct_helper.c b/src/obj/ct_helper.c
+index d6d3111..4c7c88b 100644
+--- a/src/obj/ct_helper.c
++++ b/src/obj/ct_helper.c
+@@ -205,6 +205,6 @@ struct obj_ops obj_ops_ct_helper = {
+ 	.get		= nftnl_obj_ct_helper_get,
+ 	.parse		= nftnl_obj_ct_helper_parse,
+ 	.build		= nftnl_obj_ct_helper_build,
+-	.snprintf	= nftnl_obj_ct_helper_snprintf,
++	.snprintf_	= nftnl_obj_ct_helper_snprintf,
+ 	.json_parse	= nftnl_obj_quota_json_parse,
+ };
+diff --git a/src/obj/quota.c b/src/obj/quota.c
+index d5757b2..e959ff8 100644
+--- a/src/obj/quota.c
++++ b/src/obj/quota.c
+@@ -200,6 +200,6 @@ struct obj_ops obj_ops_quota = {
+ 	.get		= nftnl_obj_quota_get,
+ 	.parse		= nftnl_obj_quota_parse,
+ 	.build		= nftnl_obj_quota_build,
+-	.snprintf	= nftnl_obj_quota_snprintf,
++	.snprintf_	= nftnl_obj_quota_snprintf,
+ 	.json_parse	= nftnl_obj_quota_json_parse,
+ };
+diff --git a/src/object.c b/src/object.c
+index d409c6d..b938c97 100644
+--- a/src/object.c
++++ b/src/object.c
+@@ -389,7 +389,7 @@ static int nftnl_obj_export(char *buf, size_t size,
+ 		nftnl_buf_u32(&b, type, obj->use, USE);
+ 
+ 	if (obj->ops)
+-		ret = obj->ops->snprintf(buf + b.len, size - b.len, type,
++		ret = obj->ops->snprintf_(buf + b.len, size - b.len, type,
+ 					 flags, obj);
+ 
+ 	b.len += ret;
+@@ -410,7 +410,7 @@ static int nftnl_obj_snprintf_dflt(char *buf, size_t size,
+ 	SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+ 
+ 	if (obj->ops) {
+-		ret = obj->ops->snprintf(buf + offset, offset, type, flags, obj);
++		ret = obj->ops->snprintf_(buf + offset, offset, type, flags, obj);
+ 		SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+ 	}
+ 	ret = snprintf(buf + offset, offset, "]");
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/snprintf_shadow.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/snprintf_shadow.patch
new file mode 100644
index 0000000..0453b1b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/snprintf_shadow.patch
@@ -0,0 +1,224 @@
+Taken from 
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755956
+
+--- ./src/expr_ops.h	2014-06-24 17:07:05.574784704 +0400
++++ ../libnftnl-1.0.2-my/./src/expr_ops.h	2014-07-25 00:19:28.367694613 +0400
+@@ -28,7 +28,7 @@
+ 	const void *(*get)(const struct nft_rule_expr *e, uint16_t type, uint32_t *data_len);
+ 	int 	(*parse)(struct nft_rule_expr *e, struct nlattr *attr);
+ 	void	(*build)(struct nlmsghdr *nlh, struct nft_rule_expr *e);
+-	int	(*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, struct nft_rule_expr *e);
++    int	(*snprintf_)(char *buf, size_t len, uint32_t type, uint32_t flags, struct nft_rule_expr *e);
+ 	int	(*xml_parse)(struct nft_rule_expr *e, mxml_node_t *tree,
+ 			     struct nft_parse_err *err);
+ 	int	(*json_parse)(struct nft_rule_expr *e, json_t *data,
+--- ./src/rule.c	2014-06-24 17:07:05.574784704 +0400
++++ ../libnftnl-1.0.2-my/./src/rule.c	2014-07-25 00:19:28.355694880 +0400
+@@ -813,7 +813,7 @@
+ 			       "{\"type\":\"%s\",", expr->ops->name);
+ 		SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+ 
+-		ret = expr->ops->snprintf(buf+offset, len, type, flags, expr);
++        ret = expr->ops->snprintf_(buf+offset, len, type, flags, expr);
+ 		SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+ 
+ 		/*
+--- ./src/expr.c	2014-06-24 17:07:05.574784704 +0400
++++ ../libnftnl-1.0.2-my/./src/expr.c	2014-07-25 00:19:27.367716863 +0400
+@@ -227,7 +227,7 @@
+ 	int ret;
+ 	unsigned int offset = 0, len = size;
+ 
+-	ret = expr->ops->snprintf(buf+offset, len, type, flags, expr);
++	ret = expr->ops->snprintf_(buf+offset, len, type, flags, expr);
+ 	SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+ 
+ 	return offset;
+--- ./src/expr/exthdr.c	2014-06-25 18:34:08.174284719 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/exthdr.c	2014-07-25 00:21:48.192583628 +0400
+@@ -362,7 +362,7 @@
+ 	.get		= nft_rule_expr_exthdr_get,
+ 	.parse		= nft_rule_expr_exthdr_parse,
+ 	.build		= nft_rule_expr_exthdr_build,
+-	.snprintf	= nft_rule_expr_exthdr_snprintf,
++	.snprintf_	= nft_rule_expr_exthdr_snprintf,
+ 	.xml_parse	= nft_rule_expr_exthdr_xml_parse,
+ 	.json_parse	= nft_rule_expr_exthdr_json_parse,
+ };
+--- ./src/expr/log.c	2014-06-25 18:34:08.178284810 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/log.c	2014-07-25 00:21:48.160584340 +0400
+@@ -332,7 +332,7 @@
+ 	.get		= nft_rule_expr_log_get,
+ 	.parse		= nft_rule_expr_log_parse,
+ 	.build		= nft_rule_expr_log_build,
+-	.snprintf	= nft_rule_expr_log_snprintf,
++	.snprintf_	= nft_rule_expr_log_snprintf,
+ 	.xml_parse	= nft_rule_expr_log_xml_parse,
+ 	.json_parse	= nft_rule_expr_log_json_parse,
+ };
+--- ./src/expr/limit.c	2014-06-25 18:34:08.178284810 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/limit.c	2014-07-25 00:21:48.108585496 +0400
+@@ -250,7 +250,7 @@
+ 	.get		= nft_rule_expr_limit_get,
+ 	.parse		= nft_rule_expr_limit_parse,
+ 	.build		= nft_rule_expr_limit_build,
+-	.snprintf	= nft_rule_expr_limit_snprintf,
++	.snprintf_	= nft_rule_expr_limit_snprintf,
+ 	.xml_parse	= nft_rule_expr_limit_xml_parse,
+ 	.json_parse	= nft_rule_expr_limit_json_parse,
+ };
+--- ./src/expr/cmp.c	2014-06-25 18:34:08.174284719 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/cmp.c	2014-07-25 00:21:48.172584073 +0400
+@@ -331,7 +331,7 @@
+ 	.get		= nft_rule_expr_cmp_get,
+ 	.parse		= nft_rule_expr_cmp_parse,
+ 	.build		= nft_rule_expr_cmp_build,
+-	.snprintf	= nft_rule_expr_cmp_snprintf,
++	.snprintf_	= nft_rule_expr_cmp_snprintf,
+ 	.xml_parse	= nft_rule_expr_cmp_xml_parse,
+ 	.json_parse	= nft_rule_expr_cmp_json_parse,
+ };
+--- ./src/expr/target.c	2014-06-25 18:34:08.182284901 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/target.c	2014-07-25 00:21:48.184583806 +0400
+@@ -274,7 +274,7 @@
+ 	.get		= nft_rule_expr_target_get,
+ 	.parse		= nft_rule_expr_target_parse,
+ 	.build		= nft_rule_expr_target_build,
+-	.snprintf	= nft_rule_expr_target_snprintf,
++	.snprintf_	= nft_rule_expr_target_snprintf,
+ 	.xml_parse	= nft_rule_expr_target_xml_parse,
+ 	.json_parse	= nft_rule_expr_target_json_parse,
+ };
+--- ./src/expr/byteorder.c	2014-06-25 18:34:08.158284356 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/byteorder.c	2014-07-25 00:21:48.148584607 +0400
+@@ -384,7 +384,7 @@
+ 	.get		= nft_rule_expr_byteorder_get,
+ 	.parse		= nft_rule_expr_byteorder_parse,
+ 	.build		= nft_rule_expr_byteorder_build,
+-	.snprintf	= nft_rule_expr_byteorder_snprintf,
++	.snprintf_	= nft_rule_expr_byteorder_snprintf,
+ 	.xml_parse	= nft_rule_expr_byteorder_xml_parse,
+ 	.json_parse	= nft_rule_expr_byteorder_json_parse,
+ };
+--- ./src/expr/lookup.c	2014-06-25 18:34:08.178284810 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/lookup.c	2014-07-25 00:21:48.136584874 +0400
+@@ -305,7 +305,7 @@
+ 	.get		= nft_rule_expr_lookup_get,
+ 	.parse		= nft_rule_expr_lookup_parse,
+ 	.build		= nft_rule_expr_lookup_build,
+-	.snprintf	= nft_rule_expr_lookup_snprintf,
++	.snprintf_	= nft_rule_expr_lookup_snprintf,
+ 	.xml_parse	= nft_rule_expr_lookup_xml_parse,
+ 	.json_parse	= nft_rule_expr_lookup_json_parse,
+ };
+--- ./src/expr/immediate.c	2014-06-25 18:34:08.178284810 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/immediate.c	2014-07-25 00:21:48.124585141 +0400
+@@ -365,7 +365,7 @@
+ 	.get		= nft_rule_expr_immediate_get,
+ 	.parse		= nft_rule_expr_immediate_parse,
+ 	.build		= nft_rule_expr_immediate_build,
+-	.snprintf	= nft_rule_expr_immediate_snprintf,
++	.snprintf_	= nft_rule_expr_immediate_snprintf,
+ 	.xml_parse	= nft_rule_expr_immediate_xml_parse,
+ 	.json_parse	= nft_rule_expr_immediate_json_parse,
+ };
+--- ./src/expr/meta.c	2014-06-25 18:34:08.178284810 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/meta.c	2014-07-25 00:21:48.040587008 +0400
+@@ -340,7 +340,7 @@
+ 	.get		= nft_rule_expr_meta_get,
+ 	.parse		= nft_rule_expr_meta_parse,
+ 	.build		= nft_rule_expr_meta_build,
+-	.snprintf	= nft_rule_expr_meta_snprintf,
++	.snprintf_	= nft_rule_expr_meta_snprintf,
+ 	.xml_parse 	= nft_rule_expr_meta_xml_parse,
+ 	.json_parse 	= nft_rule_expr_meta_json_parse,
+ };
+--- ./src/expr/queue.c	2014-06-25 18:34:08.182284901 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/queue.c	2014-07-25 00:21:48.208583272 +0400
+@@ -294,7 +294,7 @@
+ 	.get		= nft_rule_expr_queue_get,
+ 	.parse		= nft_rule_expr_queue_parse,
+ 	.build		= nft_rule_expr_queue_build,
+-	.snprintf	= nft_rule_expr_queue_snprintf,
++	.snprintf_	= nft_rule_expr_queue_snprintf,
+ 	.xml_parse	= nft_rule_expr_queue_xml_parse,
+ 	.json_parse	= nft_rule_expr_queue_json_parse,
+ };
+--- ./src/expr/nat.c	2014-06-25 18:34:08.182284901 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/nat.c	2014-07-25 00:21:48.084586030 +0400
+@@ -430,7 +430,7 @@
+ 	.get		= nft_rule_expr_nat_get,
+ 	.parse		= nft_rule_expr_nat_parse,
+ 	.build		= nft_rule_expr_nat_build,
+-	.snprintf	= nft_rule_expr_nat_snprintf,
++	.snprintf_	= nft_rule_expr_nat_snprintf,
+ 	.xml_parse	= nft_rule_expr_nat_xml_parse,
+ 	.json_parse	= nft_rule_expr_nat_json_parse,
+ };
+--- ./src/expr/payload.c	2014-06-25 18:34:08.182284901 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/payload.c	2014-07-25 00:21:48.200583450 +0400
+@@ -337,7 +337,7 @@
+ 	.get		= nft_rule_expr_payload_get,
+ 	.parse		= nft_rule_expr_payload_parse,
+ 	.build		= nft_rule_expr_payload_build,
+-	.snprintf	= nft_rule_expr_payload_snprintf,
++	.snprintf_	= nft_rule_expr_payload_snprintf,
+ 	.xml_parse	= nft_rule_expr_payload_xml_parse,
+ 	.json_parse	= nft_rule_expr_payload_json_parse,
+ };
+--- ./src/expr/reject.c	2014-06-25 18:34:08.182284901 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/reject.c	2014-07-25 00:21:48.096585762 +0400
+@@ -242,7 +242,7 @@
+ 	.get		= nft_rule_expr_reject_get,
+ 	.parse		= nft_rule_expr_reject_parse,
+ 	.build		= nft_rule_expr_reject_build,
+-	.snprintf	= nft_rule_expr_reject_snprintf,
++	.snprintf_	= nft_rule_expr_reject_snprintf,
+ 	.xml_parse	= nft_rule_expr_reject_xml_parse,
+ 	.json_parse	= nft_rule_expr_reject_json_parse,
+ };
+--- ./src/expr/counter.c	2014-06-25 18:34:08.174284719 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/counter.c	2014-07-25 00:21:48.056586652 +0400
+@@ -236,7 +236,7 @@
+ 	.get		= nft_rule_expr_counter_get,
+ 	.parse		= nft_rule_expr_counter_parse,
+ 	.build		= nft_rule_expr_counter_build,
+-	.snprintf	= nft_rule_expr_counter_snprintf,
++	.snprintf_	= nft_rule_expr_counter_snprintf,
+ 	.xml_parse	= nft_rule_expr_counter_xml_parse,
+ 	.json_parse	= nft_rule_expr_counter_json_parse,
+ };
+--- ./src/expr/ct.c	2014-06-25 18:34:08.174284719 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/ct.c	2014-07-25 00:21:48.068586385 +0400
+@@ -428,7 +428,7 @@
+ 	.get		= nft_rule_expr_ct_get,
+ 	.parse		= nft_rule_expr_ct_parse,
+ 	.build		= nft_rule_expr_ct_build,
+-	.snprintf	= nft_rule_expr_ct_snprintf,
++	.snprintf_	= nft_rule_expr_ct_snprintf,
+ 	.xml_parse	= nft_rule_expr_ct_xml_parse,
+ 	.json_parse	= nft_rule_expr_ct_json_parse,
+ };
+--- ./src/expr/bitwise.c	2014-06-25 18:34:08.158284356 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/bitwise.c	2014-07-25 00:21:49.272559599 +0400
+@@ -403,7 +403,7 @@
+ 	.get		= nft_rule_expr_bitwise_get,
+ 	.parse		= nft_rule_expr_bitwise_parse,
+ 	.build		= nft_rule_expr_bitwise_build,
+-	.snprintf	= nft_rule_expr_bitwise_snprintf,
++    .snprintf_	= nft_rule_expr_bitwise_snprintf,
+ 	.xml_parse	= nft_rule_expr_bitwise_xml_parse,
+ 	.json_parse	= nft_rule_expr_bitwise_json_parse,
+ };
+--- ./src/expr/match.c	2014-06-25 18:34:08.178284810 +0400
++++ ../libnftnl-1.0.2-my/./src/expr/match.c	2014-07-25 00:21:48.032587186 +0400
+@@ -273,7 +273,7 @@
+ 	.get		= nft_rule_expr_match_get,
+ 	.parse		= nft_rule_expr_match_parse,
+ 	.build		= nft_rule_expr_match_build,
+-	.snprintf	= nft_rule_expr_match_snprintf,
++	.snprintf_	= nft_rule_expr_match_snprintf,
+ 	.xml_parse 	= nft_rule_expr_match_xml_parse,
+ 	.json_parse 	= nft_rule_expr_match_json_parse,
+ };
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl_1.0.6.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl_1.0.6.bb
deleted file mode 100644
index 72aec19..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl_1.0.6.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-SUMMARY = "Library for low-level interaction with nftables Netlink's API over libmnl"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=79808397c3355f163c012616125c9e26"
-SECTION = "libs"
-DEPENDS = "libmnl"
-
-SRC_URI = "http://netfilter.org/projects/libnftnl/files/${BP}.tar.bz2  \
-          "
-
-SRC_URI[md5sum] = "6d7f9f161538ca7efd535dcc70caf964"
-SRC_URI[sha256sum] = "ad3b932a39a1e567308e91b683b32239a5e1aea9b4582dfffe2288c3400ab07e"
-
-inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl_1.0.7.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl_1.0.7.bb
new file mode 100644
index 0000000..ca01c0a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl_1.0.7.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Library for low-level interaction with nftables Netlink's API over libmnl"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=79808397c3355f163c012616125c9e26"
+SECTION = "libs"
+DEPENDS = "libmnl"
+PV .= "+git${SRCPV}"
+SRCREV = "4b89c0cb0883f638ff1abbc2ff47c43cdc26aac5"
+SRC_URI = "git://git.netfilter.org/libnftnl \
+           file://0001-Declare-the-define-visivility-attribute-together.patch \
+           file://0001-avoid-naming-local-function-as-one-of-printf-family.patch \
+           "
+SRC_URI[md5sum] = "82183867168eb6644926c48b991b8aac"
+SRC_URI[sha256sum] = "9bb66ecbc64b8508249402f0093829f44177770ad99f6042b86b3a467d963982"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/nfacct/nfacct_1.0.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/nfacct/nfacct_1.0.2.bb
index d92f7c0..8177ebc 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/nfacct/nfacct_1.0.2.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/nfacct/nfacct_1.0.2.bb
@@ -3,7 +3,7 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
 
-SRC_URI = "ftp://ftp.netfilter.org/pub/nfacct/nfacct-1.0.2.tar.bz2"
+SRC_URI = "ftp://ftp.netfilter.org/pub/${BPN}/${BP}.tar.bz2"
 
 SRC_URI[md5sum] = "94faafdaaed85ca9220c5692be8a408e"
 SRC_URI[sha256sum] = "ecff2218754be318bce3c3a5d1775bab93bf4168b2c4aac465785de5655fbd69"
@@ -11,7 +11,5 @@
 
 EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
 
-S = "${WORKDIR}/nfacct-${PV}"
-
 inherit autotools pkgconfig
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0001-payload-explicit-network-ctx-assignment-for-icmp-icm.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0001-payload-explicit-network-ctx-assignment-for-icmp-icm.patch
new file mode 100644
index 0000000..86a3d53
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0001-payload-explicit-network-ctx-assignment-for-icmp-icm.patch
@@ -0,0 +1,323 @@
+From 0011985554e269e1cc8f8e5b41eb9dcd795ebe8c Mon Sep 17 00:00:00 2001
+From: Arturo Borrero Gonzalez <arturo@debian.org>
+Date: Wed, 25 Jan 2017 12:51:08 +0100
+Subject: [PATCH] payload: explicit network ctx assignment for icmp/icmp6 in
+ special families
+
+In the inet, bridge and netdev families, we can add rules like these:
+
+% nft add rule inet t c ip protocol icmp icmp type echo-request
+% nft add rule inet t c ip6 nexthdr icmpv6 icmpv6 type echo-request
+
+However, when we print the ruleset:
+
+% nft list ruleset
+table inet t {
+	chain c {
+		icmpv6 type echo-request
+		icmp type echo-request
+	}
+}
+
+These rules we obtain can't be added again:
+
+% nft add rule inet t c icmp type echo-request
+<cmdline>:1:19-27: Error: conflicting protocols specified: inet-service vs. icmp
+add rule inet t c icmp type echo-request
+                  ^^^^^^^^^
+
+% nft add rule inet t c icmpv6 type echo-request
+<cmdline>:1:19-29: Error: conflicting protocols specified: inet-service vs. icmpv6
+add rule inet t c icmpv6 type echo-request
+                  ^^^^^^^^^^^
+
+Since I wouldn't expect an IP packet carrying ICMPv6, or IPv6 packet
+carrying ICMP, if the link layer is inet, the network layer protocol context
+can be safely update to 'ip' or 'ip6'.
+
+Moreover, nft currently generates a 'meta nfproto ipvX' depedency when
+using icmp or icmp6 in the inet family, and similar in netdev and bridge
+families.
+
+While at it, a bit of code factorization is introduced.
+
+Fixes: https://bugzilla.netfilter.org/show_bug.cgi?id=1073
+Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/payload.c                       | 70 ++++++++++++++++---------------------
+ tests/py/any/icmpX.t.netdev         |  8 +++++
+ tests/py/any/icmpX.t.netdev.payload | 36 +++++++++++++++++++
+ tests/py/bridge/icmpX.t             |  8 +++++
+ tests/py/bridge/icmpX.t.payload     | 36 +++++++++++++++++++
+ tests/py/inet/icmpX.t               |  8 +++++
+ tests/py/inet/icmpX.t.payload       | 36 +++++++++++++++++++
+ 7 files changed, 162 insertions(+), 40 deletions(-)
+ create mode 100644 tests/py/any/icmpX.t.netdev
+ create mode 100644 tests/py/any/icmpX.t.netdev.payload
+ create mode 100644 tests/py/bridge/icmpX.t
+ create mode 100644 tests/py/bridge/icmpX.t.payload
+ create mode 100644 tests/py/inet/icmpX.t
+ create mode 100644 tests/py/inet/icmpX.t.payload
+
+diff --git a/src/payload.c b/src/payload.c
+index af533b2..74f8254 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -223,6 +223,34 @@ static int payload_add_dependency(struct eval_ctx *ctx,
+ 	return 0;
+ }
+ 
++static const struct proto_desc *
++payload_gen_special_dependency(struct eval_ctx *ctx, const struct expr *expr)
++{
++	switch (expr->payload.base) {
++	case PROTO_BASE_LL_HDR:
++		switch (ctx->pctx.family) {
++		case NFPROTO_INET:
++			return &proto_inet;
++		case NFPROTO_BRIDGE:
++			return &proto_eth;
++		case NFPROTO_NETDEV:
++			return &proto_netdev;
++		default:
++			break;
++		}
++		break;
++	case PROTO_BASE_TRANSPORT_HDR:
++		if (expr->payload.desc == &proto_icmp)
++			return &proto_ip;
++		if (expr->payload.desc == &proto_icmp6)
++			return &proto_ip6;
++		return &proto_inet_service;
++	default:
++		break;
++	}
++	return NULL;
++}
++
+ /**
+  * payload_gen_dependency - generate match expression on payload dependency
+  *
+@@ -276,46 +304,8 @@ int payload_gen_dependency(struct eval_ctx *ctx, const struct expr *expr,
+ 
+ 	desc = ctx->pctx.protocol[expr->payload.base - 1].desc;
+ 	/* Special case for mixed IPv4/IPv6 and bridge tables */
+-	if (desc == NULL) {
+-		switch (ctx->pctx.family) {
+-		case NFPROTO_INET:
+-			switch (expr->payload.base) {
+-			case PROTO_BASE_LL_HDR:
+-				desc = &proto_inet;
+-				break;
+-			case PROTO_BASE_TRANSPORT_HDR:
+-				desc = &proto_inet_service;
+-				break;
+-			default:
+-				break;
+-			}
+-			break;
+-		case NFPROTO_BRIDGE:
+-			switch (expr->payload.base) {
+-			case PROTO_BASE_LL_HDR:
+-				desc = &proto_eth;
+-				break;
+-			case PROTO_BASE_TRANSPORT_HDR:
+-				desc = &proto_inet_service;
+-				break;
+-			default:
+-				break;
+-			}
+-			break;
+-		case NFPROTO_NETDEV:
+-			switch (expr->payload.base) {
+-			case PROTO_BASE_LL_HDR:
+-				desc = &proto_netdev;
+-				break;
+-			case PROTO_BASE_TRANSPORT_HDR:
+-				desc = &proto_inet_service;
+-				break;
+-			default:
+-				break;
+-			}
+-			break;
+-		}
+-	}
++	if (desc == NULL)
++		desc = payload_gen_special_dependency(ctx, expr);
+ 
+ 	if (desc == NULL)
+ 		return expr_error(ctx->msgs, expr,
+diff --git a/tests/py/any/icmpX.t.netdev b/tests/py/any/icmpX.t.netdev
+new file mode 100644
+index 0000000..a327ce6
+--- /dev/null
++++ b/tests/py/any/icmpX.t.netdev
+@@ -0,0 +1,8 @@
++:ingress;type filter hook ingress device lo priority 0
++
++*netdev;test-netdev;ingress
++
++ip protocol icmp icmp type echo-request;ok;icmp type echo-request
++icmp type echo-request;ok
++ip6 nexthdr icmpv6 icmpv6 type echo-request;ok;icmpv6 type echo-request
++icmpv6 type echo-request;ok
+diff --git a/tests/py/any/icmpX.t.netdev.payload b/tests/py/any/icmpX.t.netdev.payload
+new file mode 100644
+index 0000000..8b8107c
+--- /dev/null
++++ b/tests/py/any/icmpX.t.netdev.payload
+@@ -0,0 +1,36 @@
++# ip protocol icmp icmp type echo-request
++netdev test-netdev ingress
++  [ meta load protocol => reg 1 ]
++  [ cmp eq reg 1 0x00000008 ]
++  [ payload load 1b @ network header + 9 => reg 1 ]
++  [ cmp eq reg 1 0x00000001 ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000008 ]
++
++# icmp type echo-request
++netdev test-netdev ingress
++  [ meta load protocol => reg 1 ]
++  [ cmp eq reg 1 0x00000008 ]
++  [ payload load 1b @ network header + 9 => reg 1 ]
++  [ cmp eq reg 1 0x00000001 ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000008 ]
++
++# ip6 nexthdr icmpv6 icmpv6 type echo-request
++netdev test-netdev ingress
++  [ meta load protocol => reg 1 ]
++  [ cmp eq reg 1 0x0000dd86 ]
++  [ payload load 1b @ network header + 6 => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000080 ]
++
++# icmpv6 type echo-request
++netdev test-netdev ingress
++  [ meta load protocol => reg 1 ]
++  [ cmp eq reg 1 0x0000dd86 ]
++  [ payload load 1b @ network header + 6 => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000080 ]
++
+diff --git a/tests/py/bridge/icmpX.t b/tests/py/bridge/icmpX.t
+new file mode 100644
+index 0000000..8c0a597
+--- /dev/null
++++ b/tests/py/bridge/icmpX.t
+@@ -0,0 +1,8 @@
++:input;type filter hook input priority 0
++
++*bridge;test-bridge;input
++
++ip protocol icmp icmp type echo-request;ok;icmp type echo-request
++icmp type echo-request;ok
++ip6 nexthdr icmpv6 icmpv6 type echo-request;ok;icmpv6 type echo-request
++icmpv6 type echo-request;ok
+diff --git a/tests/py/bridge/icmpX.t.payload b/tests/py/bridge/icmpX.t.payload
+new file mode 100644
+index 0000000..19efdd8
+--- /dev/null
++++ b/tests/py/bridge/icmpX.t.payload
+@@ -0,0 +1,36 @@
++# ip protocol icmp icmp type echo-request
++bridge test-bridge input
++  [ payload load 2b @ link header + 12 => reg 1 ]
++  [ cmp eq reg 1 0x00000008 ]
++  [ payload load 1b @ network header + 9 => reg 1 ]
++  [ cmp eq reg 1 0x00000001 ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000008 ]
++
++# icmp type echo-request
++bridge test-bridge input
++  [ payload load 2b @ link header + 12 => reg 1 ]
++  [ cmp eq reg 1 0x00000008 ]
++  [ payload load 1b @ network header + 9 => reg 1 ]
++  [ cmp eq reg 1 0x00000001 ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000008 ]
++
++# ip6 nexthdr icmpv6 icmpv6 type echo-request
++bridge test-bridge input
++  [ payload load 2b @ link header + 12 => reg 1 ]
++  [ cmp eq reg 1 0x0000dd86 ]
++  [ payload load 1b @ network header + 6 => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000080 ]
++
++# icmpv6 type echo-request
++bridge test-bridge input
++  [ payload load 2b @ link header + 12 => reg 1 ]
++  [ cmp eq reg 1 0x0000dd86 ]
++  [ payload load 1b @ network header + 6 => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000080 ]
++
+diff --git a/tests/py/inet/icmpX.t b/tests/py/inet/icmpX.t
+new file mode 100644
+index 0000000..1b467a1
+--- /dev/null
++++ b/tests/py/inet/icmpX.t
+@@ -0,0 +1,8 @@
++:input;type filter hook input priority 0
++
++*inet;test-inet;input
++
++ip protocol icmp icmp type echo-request;ok;icmp type echo-request
++icmp type echo-request;ok
++ip6 nexthdr icmpv6 icmpv6 type echo-request;ok;icmpv6 type echo-request
++icmpv6 type echo-request;ok
+diff --git a/tests/py/inet/icmpX.t.payload b/tests/py/inet/icmpX.t.payload
+new file mode 100644
+index 0000000..81ca774
+--- /dev/null
++++ b/tests/py/inet/icmpX.t.payload
+@@ -0,0 +1,36 @@
++# ip protocol icmp icmp type echo-request
++inet test-inet input
++  [ meta load nfproto => reg 1 ]
++  [ cmp eq reg 1 0x00000002 ]
++  [ payload load 1b @ network header + 9 => reg 1 ]
++  [ cmp eq reg 1 0x00000001 ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000008 ]
++
++# icmp type echo-request
++inet test-inet input
++  [ meta load nfproto => reg 1 ]
++  [ cmp eq reg 1 0x00000002 ]
++  [ payload load 1b @ network header + 9 => reg 1 ]
++  [ cmp eq reg 1 0x00000001 ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000008 ]
++
++# ip6 nexthdr icmpv6 icmpv6 type echo-request
++inet test-inet input
++  [ meta load nfproto => reg 1 ]
++  [ cmp eq reg 1 0x0000000a ]
++  [ payload load 1b @ network header + 6 => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000080 ]
++
++# icmpv6 type echo-request
++inet test-inet input
++  [ meta load nfproto => reg 1 ]
++  [ cmp eq reg 1 0x0000000a ]
++  [ payload load 1b @ network header + 6 => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000080 ]
++
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0002-proto-Add-some-exotic-ICMPv6-types.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0002-proto-Add-some-exotic-ICMPv6-types.patch
new file mode 100644
index 0000000..4d9e9d1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0002-proto-Add-some-exotic-ICMPv6-types.patch
@@ -0,0 +1,147 @@
+From 9ade8fb75f8963375b45b3f2973b8bb7aa66ad76 Mon Sep 17 00:00:00 2001
+From: Phil Sutter <phil@nwl.cc>
+Date: Thu, 16 Mar 2017 13:43:20 +0100
+Subject: [PATCH] proto: Add some exotic ICMPv6 types
+
+This adds support for matching on inverse ND messages as defined by
+RFC3122 (not implemented in Linux) and MLDv2 as defined by RFC3810.
+
+Note that ICMPV6_MLD2_REPORT macro is defined in linux/icmpv6.h but
+including that header leads to conflicts with symbols defined in
+netinet/icmp6.h.
+
+In addition to the above, "mld-listener-done" is introduced as an alias
+for "mld-listener-reduction".
+
+Signed-off-by: Phil Sutter <phil@nwl.cc>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/proto.c                       |  8 ++++++++
+ tests/py/ip6/icmpv6.t             |  8 ++++++--
+ tests/py/ip6/icmpv6.t.payload.ip6 | 34 +++++++++++++++++++++++++++++++++-
+ 3 files changed, 47 insertions(+), 3 deletions(-)
+
+diff --git a/src/proto.c b/src/proto.c
+index fb96530..79e9dbf 100644
+--- a/src/proto.c
++++ b/src/proto.c
+@@ -632,6 +632,10 @@ const struct proto_desc proto_ip = {
+ 
+ #include <netinet/icmp6.h>
+ 
++#define IND_NEIGHBOR_SOLICIT	141
++#define IND_NEIGHBOR_ADVERT	142
++#define ICMPV6_MLD2_REPORT	143
++
+ static const struct symbol_table icmp6_type_tbl = {
+ 	.base		= BASE_DECIMAL,
+ 	.symbols	= {
+@@ -643,6 +647,7 @@ static const struct symbol_table icmp6_type_tbl = {
+ 		SYMBOL("echo-reply",			ICMP6_ECHO_REPLY),
+ 		SYMBOL("mld-listener-query",		MLD_LISTENER_QUERY),
+ 		SYMBOL("mld-listener-report",		MLD_LISTENER_REPORT),
++		SYMBOL("mld-listener-done",		MLD_LISTENER_REDUCTION),
+ 		SYMBOL("mld-listener-reduction",	MLD_LISTENER_REDUCTION),
+ 		SYMBOL("nd-router-solicit",		ND_ROUTER_SOLICIT),
+ 		SYMBOL("nd-router-advert",		ND_ROUTER_ADVERT),
+@@ -650,6 +655,9 @@ static const struct symbol_table icmp6_type_tbl = {
+ 		SYMBOL("nd-neighbor-advert",		ND_NEIGHBOR_ADVERT),
+ 		SYMBOL("nd-redirect",			ND_REDIRECT),
+ 		SYMBOL("router-renumbering",		ICMP6_ROUTER_RENUMBERING),
++		SYMBOL("ind-neighbor-solicit",		IND_NEIGHBOR_SOLICIT),
++		SYMBOL("ind-neighbor-advert",		IND_NEIGHBOR_ADVERT),
++		SYMBOL("mld2-listener-report",		ICMPV6_MLD2_REPORT),
+ 		SYMBOL_LIST_END
+ 	},
+ };
+diff --git a/tests/py/ip6/icmpv6.t b/tests/py/ip6/icmpv6.t
+index afbd451..a898fe3 100644
+--- a/tests/py/ip6/icmpv6.t
++++ b/tests/py/ip6/icmpv6.t
+@@ -11,7 +11,8 @@ icmpv6 type echo-request accept;ok
+ icmpv6 type echo-reply accept;ok
+ icmpv6 type mld-listener-query accept;ok
+ icmpv6 type mld-listener-report accept;ok
+-icmpv6 type mld-listener-reduction accept;ok
++icmpv6 type mld-listener-done accept;ok
++icmpv6 type mld-listener-reduction accept;ok;icmpv6 type mld-listener-done accept
+ icmpv6 type nd-router-solicit accept;ok
+ icmpv6 type nd-router-advert accept;ok
+ icmpv6 type nd-neighbor-solicit accept;ok
+@@ -19,8 +20,11 @@ icmpv6 type nd-neighbor-advert accept;ok
+ icmpv6 type nd-redirect accept;ok
+ icmpv6 type parameter-problem accept;ok
+ icmpv6 type router-renumbering accept;ok
++icmpv6 type ind-neighbor-solicit accept;ok
++icmpv6 type ind-neighbor-advert accept;ok
++icmpv6 type mld2-listener-report accept;ok
+ icmpv6 type {destination-unreachable, time-exceeded, nd-router-solicit} accept;ok
+-icmpv6 type {router-renumbering, mld-listener-reduction, time-exceeded, nd-router-solicit} accept;ok
++icmpv6 type {router-renumbering, mld-listener-done, time-exceeded, nd-router-solicit} accept;ok
+ icmpv6 type {mld-listener-query, time-exceeded, nd-router-advert} accept;ok
+ icmpv6 type != {mld-listener-query, time-exceeded, nd-router-advert} accept;ok
+ 
+diff --git a/tests/py/ip6/icmpv6.t.payload.ip6 b/tests/py/ip6/icmpv6.t.payload.ip6
+index 9fe2496..30f58ca 100644
+--- a/tests/py/ip6/icmpv6.t.payload.ip6
++++ b/tests/py/ip6/icmpv6.t.payload.ip6
+@@ -54,6 +54,14 @@ ip6 test-ip6 input
+   [ cmp eq reg 1 0x00000083 ]
+   [ immediate reg 0 accept ]
+ 
++# icmpv6 type mld-listener-done accept
++ip6 test-ip6 input
++  [ payload load 1b @ network header + 6 => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000084 ]
++  [ immediate reg 0 accept ]
++
+ # icmpv6 type mld-listener-reduction accept
+ ip6 test-ip6 input
+   [ payload load 1b @ network header + 6 => reg 1 ]
+@@ -118,6 +126,30 @@ ip6 test-ip6 input
+   [ cmp eq reg 1 0x0000008a ]
+   [ immediate reg 0 accept ]
+ 
++# icmpv6 type ind-neighbor-solicit accept
++ip6 test-ip6 input
++  [ payload load 1b @ network header + 6 => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x0000008d ]
++  [ immediate reg 0 accept ]
++
++# icmpv6 type ind-neighbor-advert accept
++ip6 test-ip6 input
++  [ payload load 1b @ network header + 6 => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x0000008e ]
++  [ immediate reg 0 accept ]
++
++# icmpv6 type mld2-listener-report accept
++ip6 test-ip6 input
++  [ payload load 1b @ network header + 6 => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x0000008f ]
++  [ immediate reg 0 accept ]
++
+ # icmpv6 type {destination-unreachable, time-exceeded, nd-router-solicit} accept
+ __set%d test-ip6 3
+ __set%d test-ip6 0
+@@ -129,7 +161,7 @@ ip6 test-ip6 input
+   [ lookup reg 1 set __set%d ]
+   [ immediate reg 0 accept ]
+ 
+-# icmpv6 type {router-renumbering, mld-listener-reduction, time-exceeded, nd-router-solicit} accept
++# icmpv6 type {router-renumbering, mld-listener-done, time-exceeded, nd-router-solicit} accept
+ __set%d test-ip6 3
+ __set%d test-ip6 0
+ 	element 0000008a  : 0 [end]	element 00000084  : 0 [end]	element 00000003  : 0 [end]	element 00000085  : 0 [end]
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch
new file mode 100644
index 0000000..50cac30
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch
@@ -0,0 +1,62 @@
+From 8d8cfe5ad6ca460a5262fb15fdbef3601058c784 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Thu, 18 May 2017 13:30:54 +0200
+Subject: [PATCH 1/4] payload: split ll proto dependency into helper
+
+will be re-used in folloup patch for icmp/icmpv6 depenency
+handling.
+
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/payload.c | 29 ++++++++++++++++++-----------
+ 1 file changed, 18 insertions(+), 11 deletions(-)
+
+diff --git a/src/payload.c b/src/payload.c
+index 55128fe..31e5a02 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -224,21 +224,28 @@ static int payload_add_dependency(struct eval_ctx *ctx,
+ }
+ 
+ static const struct proto_desc *
++payload_get_get_ll_hdr(const struct eval_ctx *ctx)
++{
++	switch (ctx->pctx.family) {
++	case NFPROTO_INET:
++		return &proto_inet;
++	case NFPROTO_BRIDGE:
++		return &proto_eth;
++	case NFPROTO_NETDEV:
++		return &proto_netdev;
++	default:
++		break;
++	}
++
++	return NULL;
++}
++
++static const struct proto_desc *
+ payload_gen_special_dependency(struct eval_ctx *ctx, const struct expr *expr)
+ {
+ 	switch (expr->payload.base) {
+ 	case PROTO_BASE_LL_HDR:
+-		switch (ctx->pctx.family) {
+-		case NFPROTO_INET:
+-			return &proto_inet;
+-		case NFPROTO_BRIDGE:
+-			return &proto_eth;
+-		case NFPROTO_NETDEV:
+-			return &proto_netdev;
+-		default:
+-			break;
+-		}
+-		break;
++		return payload_get_get_ll_hdr(ctx);
+ 	case PROTO_BASE_TRANSPORT_HDR:
+ 		if (expr->payload.desc == &proto_icmp)
+ 			return &proto_ip;
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0004-src-allow-update-of-net-base-w.-meta-l4proto-icmpv6.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0004-src-allow-update-of-net-base-w.-meta-l4proto-icmpv6.patch
new file mode 100644
index 0000000..180edb3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0004-src-allow-update-of-net-base-w.-meta-l4proto-icmpv6.patch
@@ -0,0 +1,65 @@
+From 9a1f2bbf3cd2417e0c10d18578e224abe2071d68 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Tue, 21 Mar 2017 19:47:22 +0100
+Subject: [PATCH 2/4] src: allow update of net base w. meta l4proto icmpv6
+
+nft add rule ip6 f i meta l4proto ipv6-icmp icmpv6 type nd-router-advert
+<cmdline>:1:50-60: Error: conflicting protocols specified: unknown vs. icmpv6
+
+add icmpv6 to nexthdr list so base gets updated correctly.
+
+Reported-by: Thomas Woerner <twoerner@redhat.com>
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/proto.c                 | 1 +
+ tests/py/any/meta.t         | 1 +
+ tests/py/any/meta.t.payload | 7 +++++++
+ 3 files changed, 9 insertions(+)
+
+diff --git a/src/proto.c b/src/proto.c
+index 79e9dbf..fcdfbe7 100644
+--- a/src/proto.c
++++ b/src/proto.c
+@@ -779,6 +779,7 @@ const struct proto_desc proto_inet_service = {
+ 		PROTO_LINK(IPPROTO_TCP,		&proto_tcp),
+ 		PROTO_LINK(IPPROTO_DCCP,	&proto_dccp),
+ 		PROTO_LINK(IPPROTO_SCTP,	&proto_sctp),
++		PROTO_LINK(IPPROTO_ICMPV6,	&proto_icmp6),
+ 	},
+ 	.templates	= {
+ 		[0]	= PROTO_META_TEMPLATE("l4proto", &inet_protocol_type, NFT_META_L4PROTO, 8),
+diff --git a/tests/py/any/meta.t b/tests/py/any/meta.t
+index c3ac0a4..2ff942f 100644
+--- a/tests/py/any/meta.t
++++ b/tests/py/any/meta.t
+@@ -38,6 +38,7 @@ meta l4proto { 33, 55, 67, 88};ok;meta l4proto { 33, 55, 67, 88}
+ meta l4proto != { 33, 55, 67, 88};ok
+ meta l4proto { 33-55};ok
+ meta l4proto != { 33-55};ok
++meta l4proto ipv6-icmp icmpv6 type nd-router-advert;ok;icmpv6 type nd-router-advert
+ 
+ meta priority root;ok
+ meta priority none;ok
+diff --git a/tests/py/any/meta.t.payload b/tests/py/any/meta.t.payload
+index e432656..871f1ad 100644
+--- a/tests/py/any/meta.t.payload
++++ b/tests/py/any/meta.t.payload
+@@ -187,6 +187,13 @@ ip test-ip4 input
+   [ byteorder reg 1 = hton(reg 1, 2, 1) ]
+   [ lookup reg 1 set __set%d 0x1 ]
+ 
++# meta l4proto ipv6-icmp icmpv6 type nd-router-advert
++ip test-ip4 input
++  [ meta load l4proto => reg 1 ]
++  [ cmp eq reg 1 0x0000003a ]
++  [ payload load 1b @ transport header + 0 => reg 1 ]
++  [ cmp eq reg 1 0x00000086 ]
++
+ # meta mark 0x4
+ ip test-ip4 input
+   [ meta load mark => reg 1 ]
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0005-src-ipv6-switch-implicit-dependencies-to-meta-l4prot.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0005-src-ipv6-switch-implicit-dependencies-to-meta-l4prot.patch
new file mode 100644
index 0000000..f600ae0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0005-src-ipv6-switch-implicit-dependencies-to-meta-l4prot.patch
@@ -0,0 +1,98 @@
+From 2366ed9ffcb4f5f5341f10f0a1d1a4688d37ad87 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Wed, 22 Mar 2017 15:08:48 +0100
+Subject: [PATCH 3/4] src: ipv6: switch implicit dependencies to meta l4proto
+
+when using rule like
+
+ip6 filter input tcp dport 22
+nft generates:
+  [ payload load 1b @ network header + 6 => reg 1 ]
+  [ cmp eq reg 1 0x00000006 ]
+  [ payload load 2b @ transport header + 2 => reg 1 ]
+  [ cmp eq reg 1 0x00001600 ]
+
+which is: ip6 filter input ip6 nexthdr tcp dport 22
+IOW, such a rule won't match if e.g. a fragment header is in place.
+
+This changes ip6_proto to use 'meta l4proto' which is the protocol header
+found by exthdr walk.
+
+A side effect is that for bridge we get a shorter dependency chain as it
+no longer needs to prepend 'ether proto ipv6' for old 'ip6 nexthdr' dep.
+
+Only problem:
+
+ip6 nexthdr tcp tcp dport 22
+will now inject a (useless) meta l4 dependency as ip6 nexthdr is no
+longer flagged as EXPR_F_PROTOCOL, to avoid this add a small helper
+that skips the unneded meta dependency in that case.
+
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/payload.c | 19 ++++++++++++++++++-
+ src/proto.c   |  2 +-
+ 2 files changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/src/payload.c b/src/payload.c
+index 31e5a02..38db15e 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -117,6 +117,23 @@ static const struct expr_ops payload_expr_ops = {
+ 	.pctx_update	= payload_expr_pctx_update,
+ };
+ 
++/*
++ * ipv6 is special case, we normally use 'meta l4proto' to fetch the last
++ * l4 header of the ipv6 extension header chain so we will also match
++ * tcp after a fragmentation header, for instance.
++ *
++ * If user specifically asks for nexthdr x, treat is as a full
++ * dependency rather than injecting another (useless) meta l4 one.
++ */
++static bool proto_key_is_protocol(const struct proto_desc *desc, unsigned int type)
++{
++	if (type == desc->protocol_key ||
++	    (desc == &proto_ip6 && type == IP6HDR_NEXTHDR))
++		return true;
++
++	return false;
++}
++
+ struct expr *payload_expr_alloc(const struct location *loc,
+ 				const struct proto_desc *desc,
+ 				unsigned int type)
+@@ -129,7 +146,7 @@ struct expr *payload_expr_alloc(const struct location *loc,
+ 	if (desc != NULL) {
+ 		tmpl = &desc->templates[type];
+ 		base = desc->base;
+-		if (type == desc->protocol_key)
++		if (proto_key_is_protocol(desc, type))
+ 			flags = EXPR_F_PROTOCOL;
+ 	} else {
+ 		tmpl = &proto_unknown_template;
+diff --git a/src/proto.c b/src/proto.c
+index fcdfbe7..3b20a5f 100644
+--- a/src/proto.c
++++ b/src/proto.c
+@@ -707,7 +707,6 @@ const struct proto_desc proto_icmp6 = {
+ const struct proto_desc proto_ip6 = {
+ 	.name		= "ip6",
+ 	.base		= PROTO_BASE_NETWORK_HDR,
+-	.protocol_key	= IP6HDR_NEXTHDR,
+ 	.protocols	= {
+ 		PROTO_LINK(IPPROTO_ESP,		&proto_esp),
+ 		PROTO_LINK(IPPROTO_AH,		&proto_ah),
+@@ -720,6 +719,7 @@ const struct proto_desc proto_ip6 = {
+ 		PROTO_LINK(IPPROTO_ICMPV6,	&proto_icmp6),
+ 	},
+ 	.templates	= {
++		[0]	= PROTO_META_TEMPLATE("l4proto", &inet_protocol_type, NFT_META_L4PROTO, 8),
+ 		[IP6HDR_VERSION]	= HDR_BITFIELD("version", &integer_type, 0, 4),
+ 		[IP6HDR_DSCP]		= HDR_BITFIELD("dscp", &dscp_type, 4, 6),
+ 		[IP6HDR_ECN]		= HDR_BITFIELD("ecn", &ecn_type, 10, 2),
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0006-payload-enforce-ip-ip6-protocol-depending-on-icmp-or.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0006-payload-enforce-ip-ip6-protocol-depending-on-icmp-or.patch
new file mode 100644
index 0000000..00076d7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0006-payload-enforce-ip-ip6-protocol-depending-on-icmp-or.patch
@@ -0,0 +1,84 @@
+From f21a7a4849b50c30341ec571813bd7fe37040ad3 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Thu, 18 May 2017 13:30:54 +0200
+Subject: [PATCH 4/4] payload: enforce ip/ip6 protocol depending on icmp or
+ icmpv6
+
+After some discussion with Pablo we agreed to treat icmp/icmpv6 specially.
+
+in the case of a rule like 'tcp dport 22' the inet, bridge and netdev
+families only care about the lower layer protocol.
+
+In the icmpv6 case however we'd like to also enforce an ipv6 protocol check
+(and ipv4 check in icmp case).
+
+This extends payload_gen_special_dependency() to consider this.
+With this patch:
+
+add rule $pf filter input meta l4proto icmpv6
+add rule $pf filter input meta l4proto icmpv6 icmpv6 type echo-request
+add rule $pf filter input icmpv6 type echo-request
+
+will work in all tables and all families.
+For inet/bridge/netdev, an ipv6 protocol dependency is added; this will
+not match ipv4 packets with ip->protocol == icmpv6, EXCEPT in the case
+of the ip family.
+
+Its still possible to match icmpv6-in-ipv4 in inet/bridge/netdev with an
+explicit dependency:
+
+add rule inet f i ip protocol ipv6-icmp meta l4proto ipv6-icmp icmpv6 type ...
+
+Implicit dependencies won't get removed at the moment, so
+  bridge ... icmp type echo-request
+will be shown as
+  ether type ip meta l4proto 1 icmp type echo-request
+
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/payload.c | 27 +++++++++++++++++++++++----
+ 1 file changed, 23 insertions(+), 4 deletions(-)
+
+diff --git a/src/payload.c b/src/payload.c
+index 38db15e..8796ee5 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -264,10 +264,29 @@ payload_gen_special_dependency(struct eval_ctx *ctx, const struct expr *expr)
+ 	case PROTO_BASE_LL_HDR:
+ 		return payload_get_get_ll_hdr(ctx);
+ 	case PROTO_BASE_TRANSPORT_HDR:
+-		if (expr->payload.desc == &proto_icmp)
+-			return &proto_ip;
+-		if (expr->payload.desc == &proto_icmp6)
+-			return &proto_ip6;
++		if (expr->payload.desc == &proto_icmp ||
++		    expr->payload.desc == &proto_icmp6) {
++			const struct proto_desc *desc, *desc_upper;
++			struct stmt *nstmt;
++
++			desc = ctx->pctx.protocol[PROTO_BASE_LL_HDR].desc;
++			if (!desc) {
++				desc = payload_get_get_ll_hdr(ctx);
++				if (!desc)
++					break;
++			}
++
++			desc_upper = &proto_ip6;
++			if (expr->payload.desc == &proto_icmp)
++				desc_upper = &proto_ip;
++
++			if (payload_add_dependency(ctx, desc, desc_upper,
++						   expr, &nstmt) < 0)
++				return NULL;
++
++			list_add_tail(&nstmt->list, &ctx->stmt->list);
++			return desc_upper;
++		}
+ 		return &proto_inet_service;
+ 	default:
+ 		break;
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0007-src-ip-switch-implicit-dependencies-to-meta-l4proto-.patch b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0007-src-ip-switch-implicit-dependencies-to-meta-l4proto-.patch
new file mode 100644
index 0000000..5b72437
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/files/0007-src-ip-switch-implicit-dependencies-to-meta-l4proto-.patch
@@ -0,0 +1,86 @@
+From 0825c57d571bb7121e7048e198b9b023f7e7f358 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Sun, 7 May 2017 03:53:30 +0200
+Subject: [PATCH] src: ip: switch implicit dependencies to meta l4proto too
+
+after ip6 nexthdr also switch ip to meta l4proto instead of ip protocol.
+
+While its needed for ipv6 (due to extension headers) this isn't needed
+for ip but it has the advantage that
+
+tcp dport 22
+
+produces same expressions for ip/ip6/inet families.
+
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/payload.c | 17 +++++++++++------
+ src/proto.c   |  3 ++-
+ 2 files changed, 13 insertions(+), 7 deletions(-)
+
+diff --git a/src/payload.c b/src/payload.c
+index 8796ee5..11b6df3 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -118,17 +118,22 @@ static const struct expr_ops payload_expr_ops = {
+ };
+ 
+ /*
+- * ipv6 is special case, we normally use 'meta l4proto' to fetch the last
+- * l4 header of the ipv6 extension header chain so we will also match
++ * We normally use 'meta l4proto' to fetch the last l4 header of the
++ * ipv6 extension header chain so we will also match
+  * tcp after a fragmentation header, for instance.
++ * For consistency we also use meta l4proto for ipv4.
+  *
+- * If user specifically asks for nexthdr x, treat is as a full
+- * dependency rather than injecting another (useless) meta l4 one.
++ * If user specifically asks for nexthdr x, don't add another (useless)
++ * meta dependency.
+  */
+ static bool proto_key_is_protocol(const struct proto_desc *desc, unsigned int type)
+ {
+-	if (type == desc->protocol_key ||
+-	    (desc == &proto_ip6 && type == IP6HDR_NEXTHDR))
++	if (type == desc->protocol_key)
++		return true;
++
++	if (desc == &proto_ip6 && type == IP6HDR_NEXTHDR)
++		return true;
++	if (desc == &proto_ip && type == IPHDR_PROTOCOL)
+ 		return true;
+ 
+ 	return false;
+diff --git a/src/proto.c b/src/proto.c
+index 3b20a5f..2afedf7 100644
+--- a/src/proto.c
++++ b/src/proto.c
+@@ -587,7 +587,6 @@ const struct proto_desc proto_ip = {
+ 	.name		= "ip",
+ 	.base		= PROTO_BASE_NETWORK_HDR,
+ 	.checksum_key	= IPHDR_CHECKSUM,
+-	.protocol_key	= IPHDR_PROTOCOL,
+ 	.protocols	= {
+ 		PROTO_LINK(IPPROTO_ICMP,	&proto_icmp),
+ 		PROTO_LINK(IPPROTO_ESP,		&proto_esp),
+@@ -600,6 +599,7 @@ const struct proto_desc proto_ip = {
+ 		PROTO_LINK(IPPROTO_SCTP,	&proto_sctp),
+ 	},
+ 	.templates	= {
++		[0]	= PROTO_META_TEMPLATE("l4proto", &inet_protocol_type, NFT_META_L4PROTO, 8),
+ 		[IPHDR_VERSION]		= HDR_BITFIELD("version", &integer_type, 0, 4),
+ 		[IPHDR_HDRLENGTH]	= HDR_BITFIELD("hdrlength", &integer_type, 4, 4),
+ 		[IPHDR_DSCP]            = HDR_BITFIELD("dscp", &dscp_type, 8, 6),
+@@ -779,6 +779,7 @@ const struct proto_desc proto_inet_service = {
+ 		PROTO_LINK(IPPROTO_TCP,		&proto_tcp),
+ 		PROTO_LINK(IPPROTO_DCCP,	&proto_dccp),
+ 		PROTO_LINK(IPPROTO_SCTP,	&proto_sctp),
++		PROTO_LINK(IPPROTO_ICMP,	&proto_icmp),
+ 		PROTO_LINK(IPPROTO_ICMPV6,	&proto_icmp6),
+ 	},
+ 	.templates	= {
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/nftables_0.6.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/nftables_0.6.bb
deleted file mode 100644
index 5dd9362..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/nftables_0.6.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-SUMMARY = "Netfilter Tables userspace utillites"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d1a78fdd879a263a5e0b42d1fc565e79"
-SECTION = "net"
-
-DEPENDS = "libmnl libnftnl readline gmp"
-RRECOMMENDS_${PN} += "kernel-module-nf-tables \
-    "
-
-SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.bz2 \
-           file://fix-to-generate-ntf.8.patch \
-          "
-SRC_URI[md5sum] = "fd320e35fdf14b7be795492189b13dae"
-SRC_URI[sha256sum] = "dede62655f1c56f2bc9f9be12d103d930dcef6d5f9e0855854ad9c6f93cd6c2d"
-
-inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/nftables_0.7.bb b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/nftables_0.7.bb
new file mode 100644
index 0000000..0ea7995
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-filter/nftables/nftables_0.7.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Netfilter Tables userspace utillites"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d1a78fdd879a263a5e0b42d1fc565e79"
+SECTION = "net"
+
+DEPENDS = "libmnl libnftnl readline gmp"
+RRECOMMENDS_${PN} += "kernel-module-nf-tables \
+    "
+
+SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.bz2 \
+           file://fix-to-generate-ntf.8.patch \
+           \
+           file://0001-payload-explicit-network-ctx-assignment-for-icmp-icm.patch \
+           file://0002-proto-Add-some-exotic-ICMPv6-types.patch \
+           \
+           file://0003-payload-split-ll-proto-dependency-into-helper.patch \
+           file://0004-src-allow-update-of-net-base-w.-meta-l4proto-icmpv6.patch \
+           file://0005-src-ipv6-switch-implicit-dependencies-to-meta-l4prot.patch \
+           file://0006-payload-enforce-ip-ip6-protocol-depending-on-icmp-or.patch \
+           file://0007-src-ip-switch-implicit-dependencies-to-meta-l4proto-.patch \
+          "
+SRC_URI[md5sum] = "4c005e76a15a029afaba71d7db21d065"
+SRC_URI[sha256sum] = "fe639239d801ce5890397f6f4391c58a934bfc27d8b7d5ef922692de5ec4ed43"
+
+ASNEEDED = ""
+
+inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-irc/znc/znc_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-irc/znc/znc_git.bb
index f3345a9..c2d7156 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-irc/znc/znc_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-irc/znc/znc_git.bb
@@ -21,7 +21,7 @@
 
 inherit autotools-brokensep pkgconfig
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
 # ZNC has a custom autogen.sh that states that this command is needed *and* expected to fail
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb
index e9eea56..192ece0 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb
@@ -33,8 +33,8 @@
 NETMAP_ALL_DRIVERS = "ixgbe igb e1000e e1000 veth.c forcedeth.c virtio_net.c r8169.c"
 
 python __anonymous () {
-    drivers_list = d.getVar("NETMAP_DRIVERS", True).split()
-    all_drivers_list = d.getVar("NETMAP_ALL_DRIVERS", True).split()
+    drivers_list = d.getVar("NETMAP_DRIVERS").split()
+    all_drivers_list = d.getVar("NETMAP_ALL_DRIVERS").split()
     config_drivers = "--drivers=" + ",".join(drivers_list)
 
     extra_oeconf_drivers = bb.utils.contains_any('NETMAP_DRIVERS', all_drivers_list, config_drivers, '--no-drivers', d)
@@ -70,7 +70,7 @@
 #define NETMAP_LINUX_HAVE_E1000E_DOWN2
 EOF
 
-if ${@ 'false' if (bb.utils.vercmp_string(d.getVar('KERNEL_VERSION', True) or "0", '3.17') < 0) else 'true' } ; then
+if ${@ 'false' if (bb.utils.vercmp_string(d.getVar('KERNEL_VERSION') or "0", '3.17') < 0) else 'true' } ; then
     echo OK
     cat >>  ${S}/LINUX/netmap_linux_config.h <<EOF
 #define NETMAP_LINUX_ALLOC_NETDEV_4ARGS
@@ -89,4 +89,4 @@
 }
 
 # http://errors.yoctoproject.org/Errors/Details/83335/
-PNBLACKLIST[netmap-modules] ?= "BROKEN: not compatible with default kernel version 4.8"
+PNBLACKLIST[netmap-modules] ?= "BROKEN: not compatible with default kernel version 4.8 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-kernel/netmap/netmap_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-kernel/netmap/netmap_git.bb
index 667e7cc..2d8509c 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-kernel/netmap/netmap_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-kernel/netmap/netmap_git.bb
@@ -34,4 +34,4 @@
 RRECOMMENDS_${PN} = "kernel-module-netmap"
 
 # http://errors.yoctoproject.org/Errors/Details/69733/
-PNBLACKLIST[netmap] ?= "BROKEN: Tries to build kernel module and fails, either it should be disabled or there should be dependency on kernel like in netmap-modules"
+PNBLACKLIST[netmap] ?= "BROKEN: Tries to build kernel module and fails, either it should be disabled or there should be dependency on kernel like in netmap-modules - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-module_0.0.20170421.bb b/import-layers/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-module_0.0.20170421.bb
new file mode 100644
index 0000000..2c69c58
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-module_0.0.20170421.bb
@@ -0,0 +1,31 @@
+require wireguard.inc
+
+inherit module kernel-module-split
+
+DEPENDS = "virtual/kernel libmnl"
+
+# This module requires Linux 3.10 higher and several networking related
+# configuration options. For exact kernel requirements visit:
+# https://www.wireguard.io/install/#kernel-requirements
+
+EXTRA_OEMAKE_append = " \
+    KERNELDIR=${STAGING_KERNEL_DIR} \
+    "
+
+MAKE_TARGETS = "module"
+
+RRECOMMENDS_${PN} = "kernel-module-xt-hashlimit"
+MODULE_NAME = "wireguard"
+
+# Kernel module packages MUST begin with 'kernel-module-', otherwise
+# multilib image generation can fail.
+#
+# The following line is only necessary if the recipe name does not begin
+# with kernel-module-.
+PKG_${PN} = "kernel-module-${MODULE_NAME}"
+
+module_do_install() {
+    install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}
+    install -m 0644 ${MODULE_NAME}.ko \
+    ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko
+}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20170421.bb b/import-layers/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20170421.bb
new file mode 100644
index 0000000..79d420f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20170421.bb
@@ -0,0 +1,27 @@
+require wireguard.inc
+
+inherit bash-completion systemd pkgconfig
+
+DEPENDS = "wireguard-module libmnl"
+
+do_compile_prepend () {
+    cd ${S}/tools
+}
+
+do_install () {
+    cd ${S}/tools
+    oe_runmake DESTDIR="${D}" PREFIX="${prefix}" SYSCONFDIR="${sysconfdir}" \
+        SYSTEMDUNITDIR="${systemd_unitdir}" \
+        WITH_SYSTEMDUNITS=${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'yes', '', d)} \
+        WITH_BASHCOMPLETION=yes \
+        WITH_WGQUICK=yes \
+        install
+}
+
+FILES_${PN} = " \
+    ${sysconfdir} \
+    ${systemd_unitdir} \
+    ${bindir} \
+"
+
+RDEPENDS_${PN} = "wireguard-module"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard.inc b/import-layers/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard.inc
new file mode 100644
index 0000000..46a9971
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard.inc
@@ -0,0 +1,18 @@
+SUMMARY = "WireGuard is an extremely simple yet fast and modern VPN"
+DESCRIPTION="WireGuard is a secure network tunnel, operating at layer 3, \
+implemented as a kernel virtual network interface for Linux, which aims to \
+replace both IPsec for most use cases, as well as popular user space and/or \
+TLS-based solutions like OpenVPN, while being more secure, more performant, \
+and easier to use."
+SECTION = "networking"
+HOMEPAGE = "https://www.wireguard.io/"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://../COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "8e559f4fd672b15c38a15eb4d88cc84d"
+SRC_URI[sha256sum] = "03c82af774224cd171d000ee4a519b5e474cc6842ac04967773cf77b26750000"
+
+S = "${WORKDIR}/WireGuard-${PV}/src/"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/0001-ftp-include-sys-types.h-for-u_long.patch b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/0001-ftp-include-sys-types.h-for-u_long.patch
new file mode 100644
index 0000000..8376603
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/0001-ftp-include-sys-types.h-for-u_long.patch
@@ -0,0 +1,30 @@
+From 2ee0c51d81a0a08d64b64ab624074e5f7cd9615a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Jul 2017 00:07:32 -0700
+Subject: [PATCH] ftp: include sys/types.h for u_long
+
+fixes
+ftp.c:1091:2: error: unknown type name 'u_long'; did you mean 'long'?
+  u_long a1,a2,a3,a4,p1,p2;
+  ^~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ftp/ftp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/ftp/ftp.c b/ftp/ftp.c
+index 7a56af6..5dcb513 100644
+--- a/ftp/ftp.c
++++ b/ftp/ftp.c
+@@ -43,6 +43,7 @@ char ftp_rcsid[] =
+ #include <sys/socket.h>
+ #include <sys/time.h>
+ #include <sys/file.h>
++#include <sys/types.h>
+ 
+ #include <netinet/in.h>
+ #include <netinet/ip.h>
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp_0.17.bb b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp_0.17.bb
index 37f5bc7..394a69e 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp_0.17.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp_0.17.bb
@@ -6,9 +6,10 @@
 LIC_FILES_CHKSUM = "file://ftp/ftp.c;beginline=2;endline=3;md5=2d40a75a50d83b8f6317b3f53db72bfa"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/n/netkit-ftp/netkit-ftp_${PV}.orig.tar.gz;name=archive \
-            ${DEBIAN_MIRROR}/main/n/netkit-ftp/netkit-ftp_${PV}-31.debian.tar.xz;name=patch31 \
-            file://Add_ARG_MAX_define.patch \
-"
+           ${DEBIAN_MIRROR}/main/n/netkit-ftp/netkit-ftp_${PV}-31.debian.tar.xz;name=patch31 \
+           file://Add_ARG_MAX_define.patch \
+           file://0001-ftp-include-sys-types.h-for-u_long.patch \
+           "
 
 SRC_URI[archive.md5sum] = "94441610c9b86ef45c4c6ec609444060"
 SRC_URI[archive.sha256sum] = "61c913299b81a4671ff089aac821329f7db9bc111aa812993dd585798b700349"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/0001-rpcgen-Fix-printf-formats.patch b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/0001-rpcgen-Fix-printf-formats.patch
new file mode 100644
index 0000000..8bd77d2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/0001-rpcgen-Fix-printf-formats.patch
@@ -0,0 +1,51 @@
+From 439e3e35f7fcbff1abb782de4b19b31e43ae3449 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 09:59:19 -0700
+Subject: [PATCH] rpcgen: Fix printf formats
+
+Fixes build with hardening flags
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ rpcgen/rpc_hout.c   | 2 +-
+ rpcgen/rpc_tblout.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/rpcgen/rpc_hout.c b/rpcgen/rpc_hout.c
+index 0ef52df..09a7b57 100644
+--- a/rpcgen/rpc_hout.c
++++ b/rpcgen/rpc_hout.c
+@@ -474,7 +474,7 @@ pdeclaration(const char *name, declaration *dec, int tab,
+ 			break;
+ 		}
+ 	}
+-	f_print(fout, separator );
++	f_print(fout, "%s", separator );
+ }
+ 
+ static int
+diff --git a/rpcgen/rpc_tblout.c b/rpcgen/rpc_tblout.c
+index d64bfde..fd62a52 100644
+--- a/rpcgen/rpc_tblout.c
++++ b/rpcgen/rpc_tblout.c
+@@ -99,7 +99,7 @@ write_table(const definition *def)
+ 		} 
+ 		else {
+ 			expected = 1;
+-			f_print(fout, null_entry);
++			f_print(fout, "%s", null_entry);
+ 		}
+ 		for (proc = vp->procs; proc != NULL; proc = proc->next) {
+ 			current = atoi(proc->proc_num);
+@@ -139,7 +139,7 @@ write_table(const definition *def)
+ 		}
+ 
+ 		/* print the table trailer */
+-		f_print(fout, tbl_end);
++		f_print(fout, "%s", tbl_end);
+ 		f_print(fout, tbl_nproc, progvers, progvers, progvers);
+ 	}
+ }
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc_0.17.bb b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc_0.17.bb
index abc9d88..9487fdc 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc_0.17.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc_0.17.bb
@@ -4,10 +4,15 @@
 LICENSE = "SPL-1.0"
 LIC_FILES_CHKSUM = "file://rpcinfo/rpcinfo.c;beginline=2;endline=3;md5=3e6339e3ce266e1122c5ba293e04bc89"
 
+DEPENDS_append_libc-musl = " libtirpc"
 SRC_URI = "http://sources.openembedded.org/${BPN}-${PV}.tar.gz \
-           file://gcc4.patch"
+           file://gcc4.patch \
+           file://0001-rpcgen-Fix-printf-formats.patch \
+           "
 SRC_URI[md5sum] = "67212720482ea1aea9182a98653a9642"
 SRC_URI[sha256sum] = "421d63b414162237a72867061f1bd3e3752a0d962cd5d30b5e933ddad8a14d3b"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LIBS_append_libc-musl = " -ltirpc"
 
 do_configure () {
     ./configure --prefix=${prefix}
@@ -16,6 +21,7 @@
     echo "LD=${LD}" >> MCONFIG
     echo "CFLAGS=${CFLAGS}" >> MCONFIG
     echo "LDFLAGS=${LDFLAGS}" >> MCONFIG
+    echo "LIBS=${LIBS}" >> MCONFIG
 }
 
 do_compile () {
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh_0.17.bb b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh_0.17.bb
index 8f08acf..d61636e 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh_0.17.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh_0.17.bb
@@ -36,14 +36,14 @@
 LDFLAGS += " -L${STAGING_LIBDIR} -lutil -lcrypt"
 
 PACKAGECONFIG ??= ""
-PACKAGECONFIG += " ${@bb.utils.contains("DISTRO_FEATURES", "pam", "pam", "", d)}"
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG[pam] = " , --without-pam, libpam, libpam"
 
 do_configure () {
     ./configure --prefix=${prefix} --exec-prefix=${exec_prefix}
     echo "INSTALLROOT=${D}" > MCONFIG
 
-    if [ "${@bb.utils.contains('PACKAGECONFIG', 'pam', 'pam', '', d)}" != "" ]; then
+    if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
         echo "USE_PAM=1" >> MCONFIG
     fi
 
@@ -65,7 +65,7 @@
     'BINDIR=${bindir}' 'SBINDIR=${sbindir}' \
     'MANDIR=${mandir}' install
 
-    if [ "${@bb.utils.contains('PACKAGECONFIG', 'pam', 'pam', '', d)}" != "" ]; then
+    if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
         install -d ${D}${sysconfdir}/pam.d
         install -m 0644 debian/hosts.equiv ${D}/${sysconfdir}
         install -m 0644 ${WORKDIR}/rexec.pam ${D}/${sysconfdir}/pam.d/rexec
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0001-Add-missing-include-path-to-I-options.patch b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0001-Add-missing-include-path-to-I-options.patch
new file mode 100644
index 0000000..b1325b3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0001-Add-missing-include-path-to-I-options.patch
@@ -0,0 +1,46 @@
+From 55ab6f1389261edff5f4c942bc3b0d8e695856d7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Aug 2017 18:11:33 -0700
+Subject: [PATCH 1/2] Add missing include path to -I options
+
+Fixes errors like
+| rwho.c:52:10: fatal error: 'protocols/rwhod.h' file not found
+| #include <protocols/rwhod.h>
+|          ^~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ rwho/Makefile  | 1 +
+ rwhod/Makefile | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/rwho/Makefile b/rwho/Makefile
+index 6f86388..67b28d4 100644
+--- a/rwho/Makefile
++++ b/rwho/Makefile
+@@ -6,6 +6,7 @@ include ../MRULES
+ rwho: rwho.o
+ 	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
+ 
++CFLAGS += -I../include
+ rwho.o: ../version.h
+ 
+ install: rwho
+diff --git a/rwhod/Makefile b/rwhod/Makefile
+index 772b641..9034218 100644
+--- a/rwhod/Makefile
++++ b/rwhod/Makefile
+@@ -7,6 +7,8 @@ ifneq ($(USE_GLIBC),1)
+ CFLAGS += -D_GNU_SOURCE
+ endif
+ 
++CFLAGS += -I../include
++
+ OBJS = rwhod.o
+ 
+ rwhod: $(OBJS)
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0002-Fix-build-issues-found-with-musl.patch b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0002-Fix-build-issues-found-with-musl.patch
new file mode 100644
index 0000000..717b4d7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0002-Fix-build-issues-found-with-musl.patch
@@ -0,0 +1,71 @@
+From 2108213242638fa355f662382f55495d91301858 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Aug 2017 18:13:17 -0700
+Subject: [PATCH 2/2] Fix build issues found with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ ruptime/ruptime.c | 1 +
+ rwho/rwho.c       | 1 +
+ rwhod/rwhod.c     | 5 +++--
+ 3 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/ruptime/ruptime.c b/ruptime/ruptime.c
+index 1d4f7b6..f1f043c 100644
+--- a/ruptime/ruptime.c
++++ b/ruptime/ruptime.c
+@@ -53,6 +53,7 @@ char ruptime_rcsid[] =
+ #include <string.h>
+ #include <errno.h>
+ #include <time.h>
++#include <fcntl.h>
+ 
+ struct hs {
+ 	char	hs_hostname[MAXHOSTNAMELEN];
+diff --git a/rwho/rwho.c b/rwho/rwho.c
+index 63919ac..71aec9e 100644
+--- a/rwho/rwho.c
++++ b/rwho/rwho.c
+@@ -49,6 +49,7 @@ char rcsid[] = "$Id: rwho.c,v 1.7 1999/08/01 20:44:18 dholland Exp $";
+ #include <assert.h>
+ #include <stdio.h>
+ #include <time.h>
++#include <fcntl.h>
+ #include <protocols/rwhod.h>
+ 
+ #include "../version.h"
+diff --git a/rwhod/rwhod.c b/rwhod/rwhod.c
+index 54498d0..40cabcf 100644
+--- a/rwhod/rwhod.c
++++ b/rwhod/rwhod.c
+@@ -76,6 +76,7 @@ char rcsid[] =
+ #include <grp.h>
+ #include <time.h>
+ #include <stdint.h>
++#include <fcntl.h>
+ 
+ #include "../version.h"
+ 
+@@ -102,7 +103,7 @@ struct	nlist nl[] = {
+ static void	broadcaster(void);
+ static int	configure(int s);
+ static int	verify(const char *name);
+-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
++#if defined(__GLIBC__) &&  (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2))
+ static int	getloadavg(double ptr[3], int n);
+ #endif
+ 
+@@ -549,7 +550,7 @@ sendpacket(struct whod *wd)
+ 	}
+ }
+ 
+-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
++#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2))
+ /*
+  * Taken from:
+  *
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho_0.17.bb b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho_0.17.bb
index 04baa42..5685f03 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho_0.17.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho_0.17.bb
@@ -8,7 +8,9 @@
            ${DEBIAN_MIRROR}/main/n/netkit-rwho/netkit-rwho_${PV}-13.debian.tar.gz;name=patch13 \
            file://rwhod \
            file://rwhod.default \
-"
+           file://0001-Add-missing-include-path-to-I-options.patch \
+           file://0002-Fix-build-issues-found-with-musl.patch \
+           "
 SRC_URI[archive.md5sum] = "0f71620d45d472f89134ba0d74242e75"
 SRC_URI[archive.sha256sum] = "0409e2ce4bfdb2dacb2c193d0fedfc49bb975cb057c5c6b0ffcca603a1188da7"
 SRC_URI[patch13.md5sum] = "82ed5a3c6b0bbf00b36508b9787963b9"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch
new file mode 100644
index 0000000..f2f1b12
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch
@@ -0,0 +1,66 @@
+From 7a3095d1e9b7c73f9dca56250f433bcfc7cb660e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 10:15:34 -0700
+Subject: [PATCH] telnet/telnetd: Fix print format strings
+
+Fixes build with hardening flags
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ telnet/utilities.cc | 6 +++---
+ telnetd/utility.c   | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/telnet/utilities.cc b/telnet/utilities.cc
+index 66839ab..36f0731 100644
+--- a/telnet/utilities.cc
++++ b/telnet/utilities.cc
+@@ -583,17 +583,17 @@ void printsub(int direction, unsigned char *pointer, int length) {
+ 			case ENV_VAR:
+ 			    if (pointer[1] == TELQUAL_SEND)
+ 				goto def_case;
+-			    fprintf(NetTrace, "\" VAR " + noquote);
++			    fprintf(NetTrace, "%s", "\" VAR " + noquote);
+ 			    noquote = 2;
+ 			    break;
+ 
+ 			case ENV_VALUE:
+-			    fprintf(NetTrace, "\" VALUE " + noquote);
++			    fprintf(NetTrace, "%s", "\" VALUE " + noquote);
+ 			    noquote = 2;
+ 			    break;
+ 
+ 			case ENV_ESC:
+-			    fprintf(NetTrace, "\" ESC " + noquote);
++			    fprintf(NetTrace, "%s", "\" ESC " + noquote);
+ 			    noquote = 2;
+ 			    break;
+ 
+diff --git a/telnetd/utility.c b/telnetd/utility.c
+index 29b7da1..75314cb 100644
+--- a/telnetd/utility.c
++++ b/telnetd/utility.c
+@@ -909,17 +909,17 @@ printsub(char direction, unsigned char *pointer, int length)
+ 			case ENV_VAR:
+ 			    if (pointer[1] == TELQUAL_SEND)
+ 				goto def_case;
+-			    netoprintf("\" VAR " + noquote);
++			    netoprintf("%s", "\" VAR " + noquote);
+ 			    noquote = 2;
+ 			    break;
+ 
+ 			case ENV_VALUE:
+-			    netoprintf("\" VALUE " + noquote);
++			    netoprintf("%s", "\" VALUE " + noquote);
+ 			    noquote = 2;
+ 			    break;
+ 
+ 			case ENV_ESC:
+-			    netoprintf("\" ESC " + noquote);
++			    netoprintf("%s", "\" ESC " + noquote);
+ 			    noquote = 2;
+ 			    break;
+ 
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb
index 9438adc..54a58c8 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb
@@ -5,11 +5,12 @@
 LIC_FILES_CHKSUM = "file://telnet/telnet.cc;beginline=2;endline=3;md5=780868e7b566313e70cb701560ca95ef"
 
 SRC_URI = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/${BP}.tar.gz \
-    file://To-aviod-buffer-overflow-in-telnet.patch \
-    file://Warning-fix-in-the-step-of-install.patch \
-    file://telnet-xinetd \
-    file://cross-compile.patch \
-"
+           file://To-aviod-buffer-overflow-in-telnet.patch \
+           file://Warning-fix-in-the-step-of-install.patch \
+           file://telnet-xinetd \
+           file://cross-compile.patch \
+           file://0001-telnet-telnetd-Fix-print-format-strings.patch \
+           "
 
 EXTRA_OEMAKE = "INSTALLROOT=${D} SBINDIR=${sbindir} DAEMONMODE=755 \
     MANMODE=644 MANDIR=${mandir}"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/0001-tftp-Include-missing-fcntl.h.patch b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/0001-tftp-Include-missing-fcntl.h.patch
new file mode 100644
index 0000000..7893690
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/0001-tftp-Include-missing-fcntl.h.patch
@@ -0,0 +1,27 @@
+From fa57e161fc953264a75d50a787cb83983e60acc7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Aug 2017 18:30:02 -0700
+Subject: [PATCH] tftp: Include missing fcntl.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ tftp/main.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tftp/main.c b/tftp/main.c
+index 8c54843..5c9b698 100644
+--- a/tftp/main.c
++++ b/tftp/main.c
+@@ -63,6 +63,7 @@ char main_rcsid[] =
+ #include <ctype.h>
+ #include <netdb.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ 
+ #include "tftpsubs.h"  /* for mysignal() */
+ 
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp_0.17.bb b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp_0.17.bb
index 67a541d..92c13e8 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp_0.17.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp_0.17.bb
@@ -6,9 +6,10 @@
 LIC_FILES_CHKSUM = "file://tftp/tftp.c;beginline=2;endline=3;md5=84d2cfe1e60863a7d82648734ba4d30c"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/n/${BPN}/${BPN}_${PV}.orig.tar.gz;name=archive \
-    ${DEBIAN_MIRROR}/main/n/${BPN}/${BPN}_${PV}-18.diff.gz;name=patch18 \
-    file://tftp.conf \
-"
+           ${DEBIAN_MIRROR}/main/n/${BPN}/${BPN}_${PV}-18.diff.gz;name=patch18 \
+           file://tftp.conf \
+           file://0001-tftp-Include-missing-fcntl.h.patch \
+           "
 
 SRC_URI[archive.md5sum] = "b7262c798e2ff50e29c2ff50dfd8d6a8"
 SRC_URI[archive.sha256sum] = "3a43c0010d4e61f412563fd83769d4667d8b8e82903526d21cb9205fe55ad14d"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/accel-ppp/accel-ppp_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/accel-ppp/accel-ppp_git.bb
index 22b7cfe..0a86504 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/accel-ppp/accel-ppp_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/accel-ppp/accel-ppp_git.bb
@@ -42,4 +42,4 @@
 }
 
 # http://errors.yoctoproject.org/Errors/Details/81003/
-PNBLACKLIST[accel-ppp] ?= "BROKEN: fails to build with new binutils-2.27"
+PNBLACKLIST[accel-ppp] ?= "BROKEN: fails to build with new binutils-2.27 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/dante/dante_1.4.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/dante/dante_1.4.1.bb
new file mode 100644
index 0000000..ffdab22
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/dante/dante_1.4.1.bb
@@ -0,0 +1,49 @@
+SECTION = "console/utils"
+SUMMARY = "A free SOCKS server"
+DESCRIPTION = "Dante consists of a SOCKS server and a SOCKS client,\
+implementing RFC 1928 and related standards. It is a flexible product\
+that can be used to provide convenient and secure network\
+connectivity. Once installed, Dante can in most cases be made\
+transparent to clients, providing functionality somewhat similar to\
+what could be described as a non-transparent Layer 4 router."
+HOMEPAGE = "http://www.inet.no/dante/"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=221118dda731fe93a85d0ed973467249"
+
+SRC_URI = "https://www.inet.no/dante/files/dante-${PV}.tar.gz \
+          "
+SRC_URI[md5sum] = "68c2ce12119e12cea11a90c7a80efa8f"
+SRC_URI[sha256sum] = "b6d232bd6fefc87d14bf97e447e4fcdeef4b28b16b048d804b50b48f261c4f53"
+
+# without --without-gssapi, config.log will contain reference to /usr/lib
+# as a consequence of GSSAPI path being set to /usr by default.
+# --with-gssapi-path=PATH specify gssapi path
+# --without-gssapi        disable gssapi support
+# --enable-release        build prerelease as full release
+EXTRA_OECONF += "--without-gssapi --sbindir=${bindir}"
+
+DEPENDS += "flex-native bison-native libpam"
+
+inherit autotools-brokensep distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "pam"
+
+EXTRA_AUTORECONF = "-I ${S}"
+
+PACKAGECONFIG[libwrap] = ",--disable-libwrap,tcp-wrappers,libwrap"
+PACKAGECONFIG[krb5] = ",--without-krb5,krb5"
+
+PACKAGECONFIG ??= ""
+
+do_install_append() {
+    install -d ${D}${sysconfdir}
+    cp ${S}/example/sock[sd].conf ${D}${sysconfdir}
+}
+
+PACKAGES =+ "${PN}-sockd ${PN}-libdsocks "
+
+FILES_${PN}-libdsocks = "${libdir}/libdsocks.so"
+FILES_${PN}-sockd = "${bindir}/sockd ${sysconfdir}/sockd.conf"
+
+INSANE_SKIP_${PN}-libdsocks = "dev-elf"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-configure-fix-check-for-enable-perl-cc-checks.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-configure-fix-check-for-enable-perl-cc-checks.patch
new file mode 100644
index 0000000..b87e9ee
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-configure-fix-check-for-enable-perl-cc-checks.patch
@@ -0,0 +1,31 @@
+From c6304a3e4b8441ff0a6464c0f1f6c5229092fa32 Mon Sep 17 00:00:00 2001
+From: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed, 24 May 2017 16:40:03 +0800
+Subject: [PATCH 1/4] configure: fix check for --enable-perl-cc-checks
+
+This patch comes from git://git.code.sf.net/p/net-snmp/code,
+the commit is 8f431d410b803603dc809d82e0893509615d9a11.
+
+Upstream-Status: Backport
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+---
+ configure.d/config_project_perl_python | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.d/config_project_perl_python b/configure.d/config_project_perl_python
+index 23f8c7e..475c843 100644
+--- a/configure.d/config_project_perl_python
++++ b/configure.d/config_project_perl_python
+@@ -84,7 +84,7 @@ if test "x$install_perl" != "xno" ; then
+ 
+     #       What compiler was used to build the perl binary?
+     #
+-    if test "xenable_perl_cc_checks" != "xno" ; then
++    if test "x$enable_perl_cc_checks" != "xno" ; then
+         AC_MSG_CHECKING([for Perl cc])
+         changequote(, )
+         PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'`
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch
new file mode 100644
index 0000000..999976d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch
@@ -0,0 +1,30 @@
+From 94e7e4969bc84c945dfea12d67a1e10f61973948 Mon Sep 17 00:00:00 2001
+From: Wenlin Kang <wenlin.kang@windriver.com>
+Date: Wed, 24 May 2017 16:45:34 +0800
+Subject: [PATCH 2/4] configure: fix a cc check issue.
+
+When has "." in cc value, the expression
+$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'
+can't get corretly the cc's value.
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+---
+ configure.d/config_project_perl_python | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.d/config_project_perl_python b/configure.d/config_project_perl_python
+index 475c843..22d2ad3 100644
+--- a/configure.d/config_project_perl_python
++++ b/configure.d/config_project_perl_python
+@@ -87,7 +87,7 @@ if test "x$install_perl" != "xno" ; then
+     if test "x$enable_perl_cc_checks" != "xno" ; then
+         AC_MSG_CHECKING([for Perl cc])
+         changequote(, )
+-        PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'`
++        PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\.\w\s\/]+).;\s*/$1/);'`
+         changequote([, ])
+         if test "x$PERLCC" != "x" ; then
+             AC_MSG_RESULT([$PERLCC])
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch
new file mode 100644
index 0000000..7951234
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch
@@ -0,0 +1,186 @@
+From e57fc809ad6ae522670f3dc157aadde20d968ca7 Mon Sep 17 00:00:00 2001
+From: Bart Van Assche <bvanassche@acm.org>
+Date: Wed, 24 May 2017 17:05:03 +0800
+Subject: [PATCH 3/4] CHANGES: BUG: 2712: Fix Perl module compilation
+
+Avoid that building the Net-SNMP Perl modules fails as follows:
+
+ERROR from evaluation of /sources/net-snmp-5.7.3/perl/ASN/Makefile.PL: Bizarre \ copy of HASH in list assignment at /usr/lib/perl5/site_perl/5.24.0/Carp.pm line\ 229.
+
+See also https://sourceforge.net/p/net-snmp/bugs/2712/.
+
+This patch comes from git://git.code.sf.net/p/net-snmp/code,
+the commit is 4e793461e96a2b4fd81142ab312d074d5c8841fa.
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+---
+ perl/ASN/Makefile.PL                 | 4 +---
+ perl/Makefile.PL                     | 4 +---
+ perl/OID/Makefile.PL                 | 5 +----
+ perl/SNMP/Makefile.PL                | 5 +----
+ perl/TrapReceiver/Makefile.PL        | 5 +----
+ perl/agent/Makefile.PL               | 5 +----
+ perl/agent/Support/Makefile.PL       | 5 +----
+ perl/agent/default_store/Makefile.PL | 5 +----
+ perl/default_store/Makefile.PL       | 5 +----
+ 9 files changed, 9 insertions(+), 34 deletions(-)
+
+diff --git a/perl/ASN/Makefile.PL b/perl/ASN/Makefile.PL
+index 4576781..c33d8ba 100644
+--- a/perl/ASN/Makefile.PL
++++ b/perl/ASN/Makefile.PL
+@@ -7,9 +7,7 @@ my $lib_version;
+ # See lib/ExtUtils/MakeMaker.pm for details of how to influence
+ # the contents of the Makefile that is written.
+ 
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+ 
+ Check_Version();
+ 
+diff --git a/perl/Makefile.PL b/perl/Makefile.PL
+index 31fdc40..48aba2a 100644
+--- a/perl/Makefile.PL
++++ b/perl/Makefile.PL
+@@ -3,9 +3,7 @@ use Config;
+ use Getopt::Long;
+ require 5;
+ 
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+ 
+ sub InitMakeParams {
+     $nsconfig="net-snmp-config"; # in path by default
+diff --git a/perl/OID/Makefile.PL b/perl/OID/Makefile.PL
+index 6bb1616..2589985 100644
+--- a/perl/OID/Makefile.PL
++++ b/perl/OID/Makefile.PL
+@@ -6,11 +6,8 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+ 
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+ 
+ Check_Version();
+ 
+diff --git a/perl/SNMP/Makefile.PL b/perl/SNMP/Makefile.PL
+index e617cb7..8aab9a9 100644
+--- a/perl/SNMP/Makefile.PL
++++ b/perl/SNMP/Makefile.PL
+@@ -3,15 +3,12 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+ my $opts;
+ 
+ # See lib/ExtUtils/MakeMaker.pm for details of how to influence
+ # the contents of the Makefile that is written.
+ 
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+ 
+ Check_Version();
+ 
+diff --git a/perl/TrapReceiver/Makefile.PL b/perl/TrapReceiver/Makefile.PL
+index 874ee21..7e9e58e 100644
+--- a/perl/TrapReceiver/Makefile.PL
++++ b/perl/TrapReceiver/Makefile.PL
+@@ -3,11 +3,8 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+ 
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+ 
+ Check_Version();
+ 
+diff --git a/perl/agent/Makefile.PL b/perl/agent/Makefile.PL
+index 4f7bee3..003c0d1 100644
+--- a/perl/agent/Makefile.PL
++++ b/perl/agent/Makefile.PL
+@@ -3,11 +3,8 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+ 
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+ 
+ Check_Version();
+ 
+diff --git a/perl/agent/Support/Makefile.PL b/perl/agent/Support/Makefile.PL
+index 48815b6..2325e10 100644
+--- a/perl/agent/Support/Makefile.PL
++++ b/perl/agent/Support/Makefile.PL
+@@ -3,14 +3,11 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+ 
+ # See lib/ExtUtils/MakeMaker.pm for details of how to influence
+ # the contents of the Makefile that is written.
+ 
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+ 
+ Check_Version();
+ 
+diff --git a/perl/agent/default_store/Makefile.PL b/perl/agent/default_store/Makefile.PL
+index ed6483a..31cfbee 100644
+--- a/perl/agent/default_store/Makefile.PL
++++ b/perl/agent/default_store/Makefile.PL
+@@ -3,11 +3,8 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+ 
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+ 
+ Check_Version();
+ 
+diff --git a/perl/default_store/Makefile.PL b/perl/default_store/Makefile.PL
+index 7c671b8..01c8dd0 100644
+--- a/perl/default_store/Makefile.PL
++++ b/perl/default_store/Makefile.PL
+@@ -3,11 +3,8 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+ 
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+ 
+ 
+ sub InitMakeParams {
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch
new file mode 100644
index 0000000..2b03f9e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch
@@ -0,0 +1,30 @@
+From 4ad98ef125eb4e7d7a1a93146042002f78254d36 Mon Sep 17 00:00:00 2001
+From: Wenlin Kang <wenlin.kang@windriver.com>
+Date: Wed, 24 May 2017 17:10:20 +0800
+Subject: [PATCH 4/4] configure: fix incorrect variable
+
+For cross compile platform, this variable will not be correct, so fix it.
+
+Upstream-Status: Inappropriate [cross compile specific]
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index cfcdf73..164df05 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -171,7 +171,7 @@ OTHERCLEANTODOS=perlclean @PYTHONCLEANTARGS@ cleanfeatures perlcleanfeatures pyt
+ #
+ # override LD_RUN_PATH to avoid dependencies on the build directory
+ perlmodules: perlmakefiles subdirs
+-	@(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{archlibexp}/CORE);'`") ; \
++	@(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{installprivlib}/CORE);'`") ; \
+         if test $$? != 0 ; then \
+            exit 1 ; \
+         fi
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
index 79e7766..2d6887e 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
@@ -26,11 +26,15 @@
            file://0001-get_pid_from_inode-Include-limit.h.patch \
            file://0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch \
            file://0001-snmplib-UDPIPv6-transport-Add-a-missing-return-state.patch \
+           file://0001-configure-fix-check-for-enable-perl-cc-checks.patch \
+           file://0002-configure-fix-a-cc-check-issue.patch \
+           file://0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch \
+           file://0004-configure-fix-incorrect-variable.patch \
            "
 SRC_URI[md5sum] = "9f682bd70c717efdd9f15b686d07baee"
 SRC_URI[sha256sum] = "e8dfc79b6539b71a6ff335746ce63d2da2239062ad41872fff4354cafed07a3e"
 
-inherit autotools update-rc.d siteinfo systemd pkgconfig
+inherit autotools-brokensep update-rc.d siteinfo systemd pkgconfig perlnative
 
 EXTRA_OEMAKE = "INSTALL_PREFIX=${D} OTHERLDFLAGS='${LDFLAGS}' HOST_CPPFLAGS='${BUILD_CPPFLAGS}'"
 
@@ -43,11 +47,13 @@
 PACKAGECONFIG[elfutils] = "--with-elf, --without-elf, elfutils"
 PACKAGECONFIG[libnl] = "--with-nl, --without-nl, libnl"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
 
-EXTRA_OECONF = "--disable-embedded-perl \
-                --with-perl-modules=no \
+PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no,\
+                       perl, perl perl-lib"
+
+EXTRA_OECONF = "--enable-shared \
                 --disable-manuals \
                 --with-defaults \
                 --with-install-prefix=${D} \
@@ -63,12 +69,38 @@
     ac_cv_ETC_MNTTAB=/etc/mtab \
     lt_cv_shlibpath_overrides_runpath=yes \
 "
+export PERLPROG="${bindir}/env perl"
+PERLPROG_append = "${@bb.utils.contains('PACKAGECONFIG', 'perl', ' -I${WORKDIR}', '', d)}"
+
+HAS_PERL = "${@bb.utils.contains('PACKAGECONFIG', 'perl', '1', '0', d)}"
 
 do_configure_prepend() {
-    export PERLPROG="${bindir}/env perl"
     sed -i -e "s|I/usr/include|I${STAGING_INCDIR}|g" \
         "${S}"/configure \
         "${S}"/configure.d/config_os_libs2
+
+    if [ "${HAS_PERL}" = "1" ]; then
+        # this may need to be changed when package perl has any change.
+        cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl/*/Config.pm ${WORKDIR}/
+        cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl/*/Config_heavy.pl ${WORKDIR}/
+        sed -e "s@libpth => '/usr/lib.*@libpth => '${STAGING_DIR_TARGET}/${libdir} ${STAGING_DIR_TARGET}/${base_libdir}',@g" \
+            -e "s@privlibexp => '/usr@privlibexp => '${STAGING_DIR_TARGET}/usr@g" \
+            -e "s@scriptdir => '/usr@scriptdir => '${STAGING_DIR_TARGET}/usr@g" \
+            -e "s@sitearchexp => '/usr@sitearchexp => '${STAGING_DIR_TARGET}/usr@g" \
+            -e "s@sitelibexp => '/usr@sitearchexp => '${STAGING_DIR_TARGET}/usr@g" \
+            -e "s@vendorarchexp => '/usr@vendorarchexp => '${STAGING_DIR_TARGET}/usr@g" \
+            -e "s@vendorlibexp => '/usr@vendorlibexp => '${STAGING_DIR_TARGET}/usr@g" \
+            -i ${WORKDIR}/Config.pm
+    fi
+
+}
+
+do_configure_append() {
+    if [ "${HAS_PERL}" = "1" ]; then
+        sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=${STAGING_DIR_TARGET}\$\{includedir\}@g" \
+            -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L${STAGING_DIR_TARGET}\$\{libdir\}@g" \
+            -i ${B}/net-snmp-config
+    fi
 }
 
 do_install_append() {
@@ -84,6 +116,12 @@
         -i ${D}${bindir}/net-snmp-create-v3-user
     sed    -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
         -i ${D}${bindir}/net-snmp-config
+
+    if [ "${HAS_PERL}" = "1" ]; then
+        sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=\$\{includedir\}@g" \
+            -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \
+            -i ${D}${bindir}/net-snmp-config
+    fi
 }
 
 do_install_ptest() {
@@ -122,9 +160,14 @@
 
 PACKAGES += "${PN}-libs ${PN}-mibs ${PN}-server ${PN}-client ${PN}-server-snmpd ${PN}-server-snmptrapd"
 
+# perl module
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'perl', '${PN}-perl-modules', '', d)}"
+
 ALLOW_EMPTY_${PN} = "1"
 ALLOW_EMPTY_${PN}-server = "1"
 
+FILES_${PN}-perl-modules = "${libdir}/perl/*"
+
 FILES_${PN}-libs = "${libdir}/lib*${SOLIBS}"
 FILES_${PN}-mibs = "${datadir}/snmp/mibs"
 FILES_${PN}-server-snmpd = "${sbindir}/snmpd \
@@ -158,11 +201,13 @@
 SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service"
 SYSTEMD_SERVICE_${PN}-server-snmptrapd =  "snmptrapd.service"
 
+RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'net-snmp-perl-modules', '', d)}"
 RDEPENDS_${PN} += "net-snmp-client"
 RDEPENDS_${PN}-server-snmpd += "net-snmp-mibs"
 RDEPENDS_${PN}-server-snmptrapd += "net-snmp-server-snmpd"
 RDEPENDS_${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd"
-RDEPENDS_${PN}-client += "net-snmp-mibs"
+RDEPENDS_${PN}-client += "net-snmp-mibs net-snmp-libs"
+RDEPENDS_${PN}-libs += "libpci"
 RDEPENDS_${PN}-ptest += "perl \
                          perl-module-test \
                          perl-module-file-basename \
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/nopoll/nopoll_0.4.2.b297.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/nopoll/nopoll_0.4.2.b297.bb
new file mode 100644
index 0000000..1d77891
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/nopoll/nopoll_0.4.2.b297.bb
@@ -0,0 +1,23 @@
+SUMMARY = "OpenSource WebSocket Toolkit"
+DESCRIPTION = "noPoll is a OpenSource WebSocket implementation (RFC 6455), \
+written in ansi C, that allows building pure WebSocket solutions or to \
+provide WebSocket support to existing TCP oriented applications.\
+\
+noPoll provides support for WebSocket (ws://) and TLS (secure) WebSocket (wss://),\
+allowing message based (handler notified) programming or stream oriented access."
+
+HOMEPAGE = "http://www.aspl.es/nopoll/"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f0504124678c1b3158146e0630229298 \
+                   "
+DEPENDS = "openssl"
+SRC_URI = "http://www.aspl.es/nopoll/downloads/nopoll-${PV}.tar.gz \
+          "
+SRC_URI[md5sum] = "8c411cd0f3c0479aed28c4cf7b114fbb"
+SRC_URI[sha256sum] = "f5fbf8aaa16a77b0f265d8c847eb06cb3e68f2b1a50737466dae81181618654c"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--disable-nopoll-doc"
+
+LDFLAGS += "-lpthread"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow.inc b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow.inc
index d309ae1..cccbfa1 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow.inc
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow.inc
@@ -16,7 +16,7 @@
 DEPENDS = "virtual/libc"
 
 PACKAGECONFIG ??= "openssl"
-PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl, openssl, libssl"
+PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl, openssl openssl-native, libssl"
 
 EXTRA_OECONF += " \
                  KARCH=${TARGET_ARCH} \
@@ -25,11 +25,10 @@
 
 S = "${WORKDIR}/git"
 
-inherit autotools-brokensep
+inherit autotools-brokensep pkgconfig
 
-do_configure() {
+do_configure_prepend() {
     ./boot.sh
-    oe_runconf
 }
 
 do_install_append() {
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch
new file mode 100644
index 0000000..952274b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch
@@ -0,0 +1,64 @@
+From 7b62e5884353b247f542844d1e4687d0e9211999 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 04:27:32 -0700
+Subject: [PATCH 1/2] Check and use strlcpy from libc before defining own
+
+This is required especially on musl where
+function prototype conflicts and causes build
+failures.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ lib/util.c   | 2 ++
+ lib/util.h   | 1 +
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 13064f6..596c43f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -57,7 +57,7 @@ OFP_CHECK_HWTABLES
+ OFP_CHECK_HWLIBS
+ AC_SYS_LARGEFILE
+ 
+-AC_CHECK_FUNCS([strsignal])
++AC_CHECK_FUNCS([strlcpy strsignal])
+ 
+ AC_ARG_VAR(KARCH, [Kernel Architecture String])
+ AC_SUBST(KARCH)
+diff --git a/lib/util.c b/lib/util.c
+index 21cc28d..1f341b1 100644
+--- a/lib/util.c
++++ b/lib/util.c
+@@ -138,6 +138,7 @@ xasprintf(const char *format, ...)
+     return s;
+ }
+ 
++#ifndef HAVE_STRLCPY
+ void
+ strlcpy(char *dst, const char *src, size_t size)
+ {
+@@ -148,6 +149,7 @@ strlcpy(char *dst, const char *src, size_t size)
+         dst[n_copy] = '\0';
+     }
+ }
++#endif
+ 
+ void
+ ofp_fatal(int err_no, const char *format, ...)
+diff --git a/lib/util.h b/lib/util.h
+index fde681f..9e45ea9 100644
+--- a/lib/util.h
++++ b/lib/util.h
+@@ -41,6 +41,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "compiler.h"
++#include "config.h"
+ 
+ #ifndef va_copy
+ #ifdef __va_copy
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch
new file mode 100644
index 0000000..75180fe
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch
@@ -0,0 +1,59 @@
+From 5bba224edea38607e8732081f86679ffd8b218ab Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 04:29:04 -0700
+Subject: [PATCH 2/2] lib/netdev: Adjust header include sequence
+
+Specify libc headers before kernel UAPIs
+this helps compiling with musl where otherwise
+it uses the definition from kernel and complains
+about double definition in libc headers
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/netdev.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/lib/netdev.c b/lib/netdev.c
+index 3b6fbc5..c7de25e 100644
+--- a/lib/netdev.c
++++ b/lib/netdev.c
+@@ -39,7 +39,6 @@
+ #include <fcntl.h>
+ #include <arpa/inet.h>
+ #include <inttypes.h>
+-#include <linux/if_tun.h>
+ 
+ /* Fix for some compile issues we were experiencing when setting up openwrt
+  * with the 2.4 kernel. linux/ethtool.h seems to use kernel-style inttypes,
+@@ -57,10 +56,6 @@
+ #define s64 __s64
+ #endif
+ 
+-#include <linux/ethtool.h>
+-#include <linux/rtnetlink.h>
+-#include <linux/sockios.h>
+-#include <linux/version.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+@@ -68,12 +63,16 @@
+ #include <net/ethernet.h>
+ #include <net/if.h>
+ #include <net/if_arp.h>
+-#include <net/if_packet.h>
+ #include <net/route.h>
+ #include <netinet/in.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <linux/ethtool.h>
++#include <linux/rtnetlink.h>
++#include <linux/sockios.h>
++#include <linux/version.h>
++#include <linux/if_tun.h>
+ 
+ #include "fatal-signal.h"
+ #include "list.h"
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_git.bb
index 6403bfb..eceb45e 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_git.bb
@@ -2,3 +2,8 @@
 
 SRCREV = "c84f33f09d5dbcfc9b489f64cb30475bf36f653a"
 PV = "1.0+git${SRCPV}"
+
+SRC_URI += "\
+           file://0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch \
+           file://0002-lib-netdev-Adjust-header-include-sequence.patch \
+           "
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch
new file mode 100644
index 0000000..d1ee3c5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch
@@ -0,0 +1,29 @@
+From 1f8d336a5cd88b87e15596d05980f6fe77a0f226 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 11:28:41 -0700
+Subject: [PATCH 1/4] Use -1 instead of WAIT_ANY
+
+WAIT_ANY is not supported by POSIX and some C libraries
+e.g. musl do not define this.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usl/usl_pid.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usl/usl_pid.c b/usl/usl_pid.c
+index 103458b..9819473 100644
+--- a/usl/usl_pid.c
++++ b/usl/usl_pid.c
+@@ -78,7 +78,7 @@ int usl_pid_reap_children(int waitfor)
+ 
+ 	/* Wait for processes in our process group. */
+ 
+-	while (((pid = waitpid(WAIT_ANY, &status, (waitfor ? 0: WNOHANG))) != -1) && (pid != 0)) {
++	while (((pid = waitpid(-1, &status, (waitfor ? 0: WNOHANG))) != -1) && (pid != 0)) {
+ 		have_callback = 0;
+ 		usl_list_for_each(walk, tmp, &usl_child_list) {
+ 			child = usl_list_entry(walk, struct usl_pid_child, list);
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch
new file mode 100644
index 0000000..c50f68e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch
@@ -0,0 +1,34 @@
+From 25dce20a75bc84ae9e4ec640590cef0c12750789 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 17:48:13 -0700
+Subject: [PATCH 1/2] l2tp_api: Included needed headers
+
+These are flagged by musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ l2tp_api.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/l2tp_api.c b/l2tp_api.c
+index d16f80e..9d6f60a 100644
+--- a/l2tp_api.c
++++ b/l2tp_api.c
+@@ -22,9 +22,12 @@
+  * Each module implements the required RPC xxx_1_svc() callbacks which
+  * are called directly by the RPC library.
+  */
+-
++#define _GNU_SOURCE
++#include <sys/types.h>
++#include <rpc/types.h>
++#include <rpc/xdr.h>
+ #include <rpc/pmap_clnt.h>
+-#include <net/ethernet.h>
++//#include <netinet/in.h>
+ 
+ #include "usl.h"
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch
new file mode 100644
index 0000000..9df3265
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch
@@ -0,0 +1,25 @@
+From 2d633f4c18ff3cb52234449fd86a0a63b55d669b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 11:31:55 -0700
+Subject: [PATCH 2/4] cli: include fcntl.h for O_CREAT define
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cli/cli_readline.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cli/cli_readline.c b/cli/cli_readline.c
+index 097ed6a..127136c 100644
+--- a/cli/cli_readline.c
++++ b/cli/cli_readline.c
+@@ -24,6 +24,7 @@
+ #include <sys/file.h>
+ #include <sys/stat.h>
+ #include <sys/errno.h>
++#include <fcntl.h>
+ #include <signal.h>
+ 
+ #include <readline/readline.h>
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch
new file mode 100644
index 0000000..3f8bcaa
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch
@@ -0,0 +1,33 @@
+From a41cbeee3cf660663a9baac80545050a8d960898 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 18:09:58 -0700
+Subject: [PATCH 2/2] user ipv6 structures
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ l2tp_api.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/l2tp_api.c b/l2tp_api.c
+index 9d6f60a..f0946fd 100644
+--- a/l2tp_api.c
++++ b/l2tp_api.c
+@@ -450,10 +450,12 @@ int l2tp_api_rpc_check_request(SVCXPRT *xprt)
+ 	 * non-loopback interface, reject the request.
+ 	 */
+ 	if ((!l2tp_opt_remote_rpc) &&
+-	    ((xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) &&
+-	     (xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_ANY)))) {
++	    ((xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_LOOPBACK)) &&
++	     (xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_ANY)))) {
++		char straddr[INET6_ADDRSTRLEN];
++		inet_ntop(AF_INET6, &xprt->xp_raddr.sin6_addr, straddr, sizeof(straddr));
+ 		if (l2tp_opt_trace_flags & L2TP_DEBUG_API) {
+-			l2tp_log(LOG_ERR, "Rejecting RPC request from %s", inet_ntoa(xprt->xp_raddr.sin_addr));
++			l2tp_log(LOG_ERR, "Rejecting RPC request from %s", straddr);
+ 		}
+ 		svcerr_auth(xprt, AUTH_TOOWEAK);
+ 		return -EPERM;
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch
new file mode 100644
index 0000000..e05be1b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch
@@ -0,0 +1,35 @@
+From 74fe72583472bcc3c89a52839cac2ebbad6c8a74 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 11:34:52 -0700
+Subject: [PATCH 3/4] cli: Define _GNU_SOURCE for getting sighandler_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cli/cli_readline.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cli/cli_readline.c b/cli/cli_readline.c
+index 127136c..931779b 100644
+--- a/cli/cli_readline.c
++++ b/cli/cli_readline.c
+@@ -17,7 +17,7 @@
+  *  Boston, MA 02110-1301 USA
+  *
+  *****************************************************************************/
+-
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <sys/types.h>
+@@ -634,7 +634,7 @@ static void cli_rl_uninstall_signal_handlers(void)
+ 
+ static int cli_rl_install_signal_handlers(void)
+ {
+-	__sighandler_t handler;
++	sighandler_t handler;
+ 
+ 	rl_catch_signals = 0;
+ 	rl_clear_signals();
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0004-Adjust-for-linux-kernel-headers-assumptions-on-glibc.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0004-Adjust-for-linux-kernel-headers-assumptions-on-glibc.patch
new file mode 100644
index 0000000..0fcba65
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0004-Adjust-for-linux-kernel-headers-assumptions-on-glibc.patch
@@ -0,0 +1,36 @@
+From ede4ae8e25f9fb746a6f4e076d0ef029938d2880 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 11:46:56 -0700
+Subject: [PATCH 4/4] Adjust for linux-kernel headers assumptions on glibc
+
+Fixes build issues e.g.
+
+In file included from /mnt/a/build/tmp-musl/work/cortexa7hf-neon-vfpv4-oe-linux-musleabi/openl2tp/1.8-r0/recipe-sysroot/usr/include/linux/if_pppox.h:24:
+/mnt/a/build/tmp-musl/work/cortexa7hf-neon-vfpv4-oe-linux-musleabi/openl2tp/1.8-r0/recipe-sysroot/usr/include/linux/if.h:97:2: error: expected identifier
+        IFF_LOWER_UP                    = 1<<16, /* __volatile__ */
+        ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ plugins/ppp_unix.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/plugins/ppp_unix.c b/plugins/ppp_unix.c
+index 869066f..5c1e44f 100644
+--- a/plugins/ppp_unix.c
++++ b/plugins/ppp_unix.c
+@@ -21,6 +21,11 @@
+  * Plugin to use the standard UNIX pppd
+  */
+ 
++/* hack to make sure kernel headers understand that libc (musl)
++ * does define IFF_LOWER_UP et al.
++ */
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
++
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/types.h>
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb
index 67118d8..e1670b3 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb
@@ -16,14 +16,28 @@
            file://openl2tp-simplify-gcc-warning-hack.patch \
            file://Makefile-obey-LDFLAGS.patch \
            file://0001-test-pppd_dummy.c-Fix-return-value.patch \
+           file://0001-Use-1-instead-of-WAIT_ANY.patch \
+           file://0002-cli-include-fcntl.h-for-O_CREAT-define.patch \
+           file://0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch \
+           file://0001-l2tp_api-Included-needed-headers.patch \
+           "
+
+SRC_URI_append_libc-musl = "\
+           file://0004-Adjust-for-linux-kernel-headers-assumptions-on-glibc.patch \
+           file://0002-user-ipv6-structures.patch \
            "
 SRC_URI[md5sum] = "e3d08dedfb9e6a9a1e24f6766f6dadd0"
 SRC_URI[sha256sum] = "1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f"
 
 inherit autotools-brokensep pkgconfig
 
+DEPENDS_append_libc-musl = " libtirpc"
+CPPFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
 PARALLEL_MAKE = ""
-EXTRA_OEMAKE = 'CFLAGS="${CFLAGS} -Wno-unused-but-set-variable"'
+EXTRA_OEMAKE = 'CFLAGS="${CFLAGS} -Wno-unused-but-set-variable" CPPFLAGS="${CPPFLAGS}" OPT_CFLAGS="${CFLAGS}"'
 
 do_compile_prepend() {
     sed -i -e "s:SYS_LIBDIR=.*:SYS_LIBDIR=${libdir}:g" \
@@ -34,5 +48,6 @@
         -e 's:$(CROSS_COMPILE)nm:${NM}:g' \
         -e 's:$(CROSS_COMPILE)strip:${STRIP}:g' \
         -e 's:$(CROSS_COMPILE)install:install:g' \
+        -e 's:CPPFLAGS-y:CPPFLAGS:g' \
         ${S}/Makefile
 }
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/0001-ospf6d-check-ospf6-before-using-it-in-ospf6_clean.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/0001-ospf6d-check-ospf6-before-using-it-in-ospf6_clean.patch
deleted file mode 100644
index f08bb57..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/0001-ospf6d-check-ospf6-before-using-it-in-ospf6_clean.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Upstream-Status: Pending
-
-Subject: ospf6d: check ospf6 before using it in ospf6_clean
-
-The ospf6 variable might be 'NULL' causing segment fault error.
-Check it before referencing it.
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
----
- ospf6d/ospf6d.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c
-index 3cdd5c1..e3bf1af 100644
---- a/ospf6d/ospf6d.c
-+++ b/ospf6d/ospf6d.c
-@@ -1892,6 +1892,8 @@ ospf6_init (void)
- void
- ospf6_clean (void)
- {
-+  if (ospf6 == NULL)
-+    return;
-   if (ospf6->route_table)
-     ospf6_route_remove_all (ospf6->route_table);
-   if (ospf6->brouter_table)
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
deleted file mode 100644
index a07e33f..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-quagga: Avoid duplicate connected address adding to the list
-
-commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
-introduces an regression: ifp->connected list is cleaned up when ripd is
-restarting, however, for interface addresses which are not specified in
-ripd configuration file, they are never to be added into ifp->connected
-again, this will lead to some abnormal behavior for route advertising.
-
-Instead of cleaning up the ifp->connected list to avoid duplicated
-connected address being added into this list, we can check this
-condition during interface address adding process and return early
-when an identical address has already been added.
-
-Upstream-Status: Pending
-
-Signed-off-by: Hu Yadi <Yadi.hu@windriver.com>
-Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
-Signed-off-by: Joe MacDonald <joe@deserted.net>
----
---- a/lib/if.c
-+++ b/lib/if.c
-@@ -738,6 +738,16 @@ connected_add_by_prefix (struct interfac
-                          struct prefix *destination)
- {
-   struct connected *ifc;
-+  struct listnode *cnode;
-+  struct connected *c;
-+  int ret = 0;
-+
-+  for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c))
-+    {
-+      ret = connected_same_prefix (p, (c->address));
-+      if(ret == 1)
-+        return NULL;
-+    }
- 
-   /* Allocate new connected address. */
-   ifc = connected_new ();
---- a/ripd/rip_interface.c
-+++ b/ripd/rip_interface.c
-@@ -516,13 +516,6 @@ rip_interface_clean (void)
- 	  thread_cancel (ri->t_wakeup);
- 	  ri->t_wakeup = NULL;
- 	}
--
--      for (conn_node = listhead (ifp->connected); conn_node; conn_node = next)
--        {
--          ifc = listgetdata (conn_node);
--          next = conn_node->next;
--          listnode_delete (ifp->connected, ifc);
--        }
-     }
- }
- 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default
index 0c1ce6c..4c4bc23 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default
@@ -4,7 +4,6 @@
 
 # Bind all daemons to loopback only by default
 zebra_options=" --daemon -A 127.0.0.1"
-babeld_options="--daemon -A 127.0.0.1"
 bgpd_options="  --daemon -A 127.0.0.1"
 ospfd_options=" --daemon -A 127.0.0.1"
 ospf6d_options="--daemon -A ::1"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init
index 60b5ab0..df1beb7 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init
@@ -26,7 +26,7 @@
 C_PATH=/etc/quagga
 
 # Keep zebra first and do not list watchquagga!
-DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld"
+DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd"
 
 # Print the name of the pidfile.
 pidfile()
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch
deleted file mode 100644
index 4b8c9a9..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-ripd: Fix two bugs after received SIGHUP signal
-
-There are two problems for ripd implementation after received
-SIGHUP signal:
-1). ripd didn't clean up ifp->connected list before reload
-    configuration file.
-2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON
-    which lead to the unnecessary route to be advertised.
-
-Upstream-Status: Submitted [http://patchwork.diac24.net/patch/604/]
-
-Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
-Signed-off-by: Joe MacDonald <joe@deserted.net>
----
---- a/ripd/rip_interface.c
-+++ b/ripd/rip_interface.c
-@@ -500,6 +500,8 @@
-   struct listnode *node;
-   struct interface *ifp;
-   struct rip_interface *ri;
-+  struct connected *ifc;
-+  struct listnode *conn_node, *next;
- 
-   for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
-     {
-@@ -514,6 +516,13 @@
- 	  thread_cancel (ri->t_wakeup);
- 	  ri->t_wakeup = NULL;
- 	}
-+
-+      for (conn_node = listhead (ifp->connected); conn_node; conn_node = next)
-+        {
-+          ifc = listgetdata (conn_node);
-+          next = conn_node->next;
-+          listnode_delete (ifp->connected, ifc);
-+        }
-     }
- }
- 
-@@ -548,8 +557,8 @@
- 	  ri->key_chain = NULL;
- 	}
- 
--      ri->split_horizon = RIP_NO_SPLIT_HORIZON;
--      ri->split_horizon_default = RIP_NO_SPLIT_HORIZON;
-+      ri->split_horizon = RIP_SPLIT_HORIZON;
-+      ri->split_horizon_default = RIP_SPLIT_HORIZON;
- 
-       ri->list[RIP_FILTER_IN] = NULL;
-       ri->list[RIP_FILTER_OUT] = NULL;
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc
index ae08a2d..4fb6723 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc
@@ -28,8 +28,6 @@
            file://watchquagga.default \
            file://volatiles.03_quagga \
            file://quagga.pam \
-           file://ripd-fix-two-bugs-after-received-SIGHUP.patch \
-           file://quagga-Avoid-duplicate-connected-address.patch \
            file://bgpd.service \
            file://isisd.service \
            file://ospf6d.service \
@@ -39,11 +37,11 @@
            file://zebra.service \
 "
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
 PACKAGECONFIG[pam] = "--with-libpam, --without-libpam, libpam"
 
-inherit autotools update-rc.d useradd systemd
+inherit autotools update-rc.d useradd systemd pkgconfig
 
 SYSTEMD_PACKAGES = "${PN} ${PN}-bgpd ${PN}-isisd ${PN}-ospf6d ${PN}-ospfd ${PN}-ripd ${PN}-ripngd"
 SYSTEMD_SERVICE_${PN}-bgpd = "bgpd.service"
@@ -72,6 +70,8 @@
                 ap_cv_cc_pie=no \
                 ${SNMP_CONF}"
 
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
+
 do_install () {
     # Install init script and default settings
     install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d \
@@ -202,7 +202,7 @@
 # Add quagga's user and group
 USERADD_PACKAGES = "${PN}"
 GROUPADD_PARAM_${PN} = "--system quagga ; --system quaggavty"
-USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga --shell /bin/false quagga"
+USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga -G quaggavty --shell /bin/false quagga"
 
 pkg_postinst_${PN} () {
     if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga_1.0.20160315.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga_1.0.20160315.bb
deleted file mode 100644
index d165781..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga_1.0.20160315.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-require quagga.inc
-
-SRC_URI += " \
-            file://0001-ospf6d-check-ospf6-before-using-it-in-ospf6_clean.patch \
-"
-
-SRC_URI[md5sum] = "e73d6e527fb80240f180de420cfe8042"
-SRC_URI[sha256sum] = "21ffb7bad0ef5f130f18dd299d219ea1cb4f5c03d473b6b32c83c340cd853263"
-
-QUAGGASUBDIR = ""
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga_1.1.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga_1.1.0.bb
new file mode 100644
index 0000000..1b5c34c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga_1.1.0.bb
@@ -0,0 +1,6 @@
+require quagga.inc
+
+SRC_URI[md5sum] = "daa303871e07ea5856aae6fd79e89722"
+SRC_URI[sha256sum] = "f7a43a9c59bfd3722002210530b2553c8d5cc05bfea5acd56d4f102b9f55dc63"
+
+QUAGGASUBDIR = ""
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0001-ppoe-Dont-include-linux-if_ether.h.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0001-ppoe-Dont-include-linux-if_ether.h.patch
new file mode 100644
index 0000000..11356ce
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0001-ppoe-Dont-include-linux-if_ether.h.patch
@@ -0,0 +1,30 @@
+From 8d4d452d733bac8c5b55a90bddec8cc323cc9fa8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 19:20:07 -0700
+Subject: [PATCH 1/2] ppoe: Dont include linux/if_ether.h
+
+Fixes build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/pppoe.h | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/src/pppoe.h b/src/pppoe.h
+index ec067a0..281879c 100644
+--- a/src/pppoe.h
++++ b/src/pppoe.h
+@@ -127,10 +127,6 @@ typedef unsigned long UINT32_t;
+ #error Could not find a 32-bit integer type
+ #endif
+ 
+-#ifdef HAVE_LINUX_IF_ETHER_H
+-#include <linux/if_ether.h>
+-#endif
+-
+ #include <netinet/in.h>
+ 
+ #ifdef HAVE_NETINET_IF_ETHER_H
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0002-Enable-support-for-the-kernel-module.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0002-Enable-support-for-the-kernel-module.patch
new file mode 100644
index 0000000..139d1f0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0002-Enable-support-for-the-kernel-module.patch
@@ -0,0 +1,25 @@
+From aca8473a516a8dc013866105da141fe1cd947474 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 19:24:53 -0700
+Subject: [PATCH 2/2] Enable support for the kernel module
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/configure.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/configure.in b/src/configure.in
+index cae0976..951a042 100644
+--- a/src/configure.in
++++ b/src/configure.in
+@@ -33,6 +33,7 @@ AC_CHECK_HEADERS(linux/if_pppox.h, [], [],
+ #include<net/ethernet.h>
+ #include<linux/if.h>
+ #include<linux/in.h>
++#include<linux/in6.h>
+ ])
+ 
+ dnl Checks for typedefs, structures, and compiler characteristics.
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.12.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.12.bb
index e1ca17f..fbe015f 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.12.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.12.bb
@@ -17,7 +17,10 @@
            file://pppoe-server.default \
            file://pppoe-server.init \
            file://configure.in-Error-fix.patch \
-           file://pppoe-server.service"
+           file://pppoe-server.service \
+           file://0001-ppoe-Dont-include-linux-if_ether.h.patch \
+           file://0002-Enable-support-for-the-kernel-module.patch \
+           "
 
 SRC_URI[md5sum] = "216eb52b69062b92a64ee37fd71f4b66"
 SRC_URI[sha256sum] = "00794e04031546b0e9b8cf286f2a6d1ccfc4a621b2a3abb2d7ef2a7ab7cc86c2"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp/0001-Use-foreign-switch-for-automake.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp/0001-Use-foreign-switch-for-automake.patch
new file mode 100644
index 0000000..b932ebb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp/0001-Use-foreign-switch-for-automake.patch
@@ -0,0 +1,28 @@
+From 748bc693cf24baf42e459e12f152349e392b6737 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 20 Dec 2016 21:32:11 -0800
+Subject: [PATCH] Use foreign switch for automake
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 64cc9994..19ccd4a3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -29,7 +29,7 @@ dnl SUCH DAMAGE.
+ dnl
+ 
+ AC_INIT([libusrsctp], [0.9.3.0])
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+ 
+ AC_PROG_CC
+ AC_PROG_LIBTOOL
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb
new file mode 100644
index 0000000..3ec7466
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb
@@ -0,0 +1,24 @@
+DESCRIPTION = "This is a userland SCTP stack supporting FreeBSD, Linux, Mac OS X and Windows."
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=ffcf846341f3856d79a483eafa18e2a5"
+
+SRCREV = "dbfc1b8c4cf1a46a4d8987ba542d5ff06bdaf14c"
+SRC_URI = "git://github.com/sctplab/usrsctp;protocol=https;branch=master \
+           file://0001-Use-foreign-switch-for-automake.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+DEPENDS += "openssl"
+
+CFLAGS  += "-DSCTP_USE_OPENSSL_SHA1 -fPIC"
+LDFLAGS += "-lssl -lcrypto"
+
+PACKAGECONFIG ?= "disablewarnings inet inet6"
+PACKAGECONFIG[disablewarnings] = "--disable-warnings-as-errors,,"
+PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,"
+PACKAGECONFIG[inet6] = "--enable-inet6,--disable-inet6,"
+
+EXTRA_OECONF += "--disable-debug"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch
new file mode 100644
index 0000000..b4d6d94
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch
@@ -0,0 +1,69 @@
+From 549773fdaf1fb003b84f25df386a07d299cdeb3e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 18 Jul 2017 21:25:33 -0700
+Subject: [PATCH] zeroconf: Rename arp_op to avoid namespace conflicts with C
+ library
+
+on musl e.g. we get
+In file included from /mnt/a/oe/build/tmp/work/corei7-64-bec-linux-musl/zeroconf/0.9-r1/recipe-sysroot/usr/include/net/ethernet.h:10:0,
+
+This is because in musl arp_op is a define which is included
+and causes the conflict
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ zeroconf.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/zeroconf.c b/zeroconf.c
+index 812d34b..f27e907 100644
+--- a/zeroconf.c
++++ b/zeroconf.c
+@@ -14,8 +14,6 @@
+ 
+ #include <sys/types.h>
+ #include <sys/socket.h>
+-#include <linux/rtnetlink.h>
+-#include <linux/if.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -34,6 +32,8 @@
+ #include <sys/time.h>
+ #include <signal.h>
+ #include <limits.h>
++#include <linux/rtnetlink.h>
++#include <linux/if.h>
+ 
+ #include "delay.h"
+ 
+@@ -108,7 +108,7 @@ int  arp_conflict(struct intf *intf, struct arp_packet *pkt);
+ void arp_packet_dump(struct arp_packet *pkt);
+ void arp_packet_send(int as,
+ 		     struct intf *intf,
+-		     short int arp_op,
++		     short int arpop,
+ 		     int null_sender);
+ void arp_probe(int as, struct intf *intf);
+ void arp_claim(int as, struct intf *intf);
+@@ -1591,7 +1591,7 @@ int  arp_conflict(struct intf *intf, struct arp_packet *pkt)
+ 
+ void arp_packet_send(int as,
+ 		     struct intf *intf,
+-		     short int arp_op,
++		     short int arpop,
+ 		     int null_sender)
+ {
+ 
+@@ -1605,7 +1605,7 @@ void arp_packet_send(int as,
+   ap.arp.ar_pro = htons(ARP_IP_PROTO);
+   ap.arp.ar_hln = ETH_ALEN;
+   ap.arp.ar_pln = 4; /* octets in IPv4 address */
+-  ap.arp.ar_op = htons(arp_op);
++  ap.arp.ar_op = htons(arpop);
+ 
+   /* filling with 0xff sets the destination to
+    * the broadcast link-layer address for free
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb b/import-layers/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb
index 13f9b9b..753d832 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb
@@ -20,7 +20,9 @@
            file://compilefix.patch \
            file://makefile-add-ldflags.patch \
            file://zeroconf-default \
-           file://debian-zeroconf"
+           file://debian-zeroconf \
+           file://0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch \
+           "
 
 SRC_URI[md5sum] = "bdafb16b008ebb5633e4e581f77821d2"
 SRC_URI[sha256sum] = "a8c74df127753e2310fa1e072f3c9ca44a404bb0bbce9cfec7a84c6dff8bec7b"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch
deleted file mode 100644
index 80e9804..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Index: arptables-v0.0.3-4/Makefile
-===================================================================
---- arptables-v0.0.3-4.orig/Makefile	2010-03-08 18:49:28.000000000 +0300
-+++ arptables-v0.0.3-4/Makefile	2010-03-22 15:52:56.000000000 +0300
-@@ -6,12 +6,11 @@
- LIBDIR:=$(PREFIX)/lib
- BINDIR:=$(PREFIX)/sbin
- MANDIR:=$(PREFIX)/man
--INITDIR:=/etc/rc.d/init.d
-+INITDIR:=/etc/init.d
- SYSCONFIGDIR:=/etc/sysconfig
- DESTDIR:=
- 
--COPT_FLAGS:=-O2
--CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG
-+ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\"
- 
- ifndef ARPT_LIBDIR
- ARPT_LIBDIR:=$(LIBDIR)/arptables
-@@ -22,16 +21,16 @@
- all: arptables
- 
- arptables.o: arptables.c
--	$(CC) $(CFLAGS) -c -o $@ $<
-+	$(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $<
- 
- arptables-standalone.o: arptables-standalone.c
--	$(CC) $(CFLAGS) -c -o $@ $<
-+	$(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $<
- 
- libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c
--	$(CC) $(CFLAGS) -c -o $@ $<
-+	$(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $<
- 
- arptables: arptables-standalone.o arptables.o libarptc/libarptc.o $(EXT_OBJS)
--	$(CC) $(CFLAGS) -o $@ $^
-+	$(CC) $(LDFLAGS) $(CFLAGS) $(ARPCFLAGS) -o $@ $^
- 
- $(DESTDIR)$(MANDIR)/man8/arptables.8: arptables.8
- 	mkdir -p $(@D)
-@@ -50,6 +49,7 @@
- 	cat arptables-restore | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-restore_
- 	install -m 0755 -o root -g root arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore
- 	cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_
-+	install -d $(DESTDIR)$(INITDIR)
- 	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi
- 	rm -f arptables-save_ arptables-restore_ arptables.sysv_
- 
-Index: arptables-v0.0.3-4/extensions/Makefile
-===================================================================
---- arptables-v0.0.3-4.orig/extensions/Makefile	2010-03-08 18:49:28.000000000 +0300
-+++ arptables-v0.0.3-4/extensions/Makefile	2010-03-22 15:52:38.000000000 +0300
-@@ -4,4 +4,7 @@
- EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o)
- 
- extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
--	$(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $<
-+	$(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
-+
-+extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
-+	$(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch
new file mode 100644
index 0000000..e8be45e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch
@@ -0,0 +1,79 @@
+From a2021f0bc0f029dfa05dcca5db3d2ec77904d41a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 30 Mar 2017 12:33:51 -0700
+Subject: [PATCH] Use ARPCFLAGS for package specific compiler flags
+
+This leaves room for setting CFLAGS in environment
+which OE uses to pass tweaks
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile            | 15 +++++++--------
+ extensions/Makefile |  5 ++++-
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 7bead0d..336db6b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -7,15 +7,13 @@ LIBDIR:=$(PREFIX)/lib
+ BINDIR:=$(PREFIX)/sbin
+ MANDIR:=$(PREFIX)/man
+ man8dir=$(MANDIR)/man8
+-INITDIR:=/etc/rc.d/init.d
++INITDIR:=/etc/init.d
+ SYSCONFIGDIR:=/etc/sysconfig
+ DESTDIR:=
+ 
+ MANS = arptables.8 arptables-save.8 arptables-restore.8
+ 
+-COPT_FLAGS:=-O2
+-CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG
+-
++ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\"
+ ifndef ARPT_LIBDIR
+ ARPT_LIBDIR:=$(LIBDIR)/arptables
+ endif
+@@ -25,13 +23,13 @@ include extensions/Makefile
+ all: arptables libarptc/libarptc.a
+ 
+ arptables.o: arptables.c
+-	$(CC) $(CFLAGS) -c -o $@ $<
++	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
+ 
+ arptables-standalone.o: arptables-standalone.c
+-	$(CC) $(CFLAGS) -c -o $@ $<
++	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
+ 
+ libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c
+-	$(CC) $(CFLAGS) -c -o $@ $<
++	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
+ 
+ libarptc/libarptc.a: libarptc/libarptc.o
+ 	$(AR) rcs $@ $<
+@@ -53,7 +51,8 @@ scripts: arptables-save arptables-restore arptables.sysv
+ 	install -m 0755 arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore
+ 	cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_
+ 	if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
+-	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi
++	install -d $(DESTDIR)$(INITDIR)
++	install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables
+ 	rm -f arptables-save_ arptables-restore_ arptables.sysv_
+ 
+ .PHONY: install-man
+diff --git a/extensions/Makefile b/extensions/Makefile
+index 0189cc9..b046425 100644
+--- a/extensions/Makefile
++++ b/extensions/Makefile
+@@ -4,4 +4,7 @@ EXT_FUNC+=standard mangle CLASSIFY MARK
+ EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o)
+ 
+ extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
+-	$(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $<
++	$(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
++
++extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
++	$(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-arpt-get-target-fix.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-arpt-get-target-fix.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-init-busybox.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-init-busybox.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-remove-bashism.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch
rename to import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-remove-bashism.patch
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service b/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables.service
similarity index 100%
rename from import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service
rename to import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables.service
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb
deleted file mode 100644
index f536408..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-SUMMARY = "Administration tool for arp packet filtering"
-LICENSE = "GPL-2.0"
-SECTION = "net"
-
-PR = "r2"
-
-RDEPENDS_${PN} += "perl"
-
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
-SRC_URI = " \
-    ${SOURCEFORGE_MIRROR}/ebtables/arptables-v${PV}.tar.gz;name=arptables \
-    file://arptables-compile-install.patch \
-    file://arptables-init-busybox.patch \
-    file://arptables-arpt-get-target-fix.patch \
-    file://arptables-remove-bashism.patch \
-    file://arptables.service \
-"
-SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5"
-SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928"
-
-S = "${WORKDIR}/arptables-v${PV}"
-
-do_compile () {
-    oe_runmake
-}
-
-# the install target is not multi-job safe, but it doesn't do much
-# so we just install serially
-#
-PARALLEL_MAKEINST = "-j1"
-
-fakeroot do_install () {
-    oe_runmake 'BINDIR=${sbindir}' 'MANDIR=${mandir}/' 'DESTDIR=${D}' install
-}
-
-do_install_append() {
-    install -d ${D}${systemd_unitdir}/system
-    install -m 644 ${WORKDIR}/arptables.service ${D}${systemd_unitdir}/system
-}
-
-inherit systemd
-
-SYSTEMD_SERVICE_${PN} = "arptables.service"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables_git.bb
new file mode 100644
index 0000000..274a55d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/arptables/arptables_git.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Administration tool for arp packet filtering"
+SECTION = "net"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+SRCREV = "f4ab8f63f11a72f14687a6646d04ae1bae3fa45f"
+PV = "0.0.4+git${SRCPV}"
+
+SRC_URI = " \
+    git://git.netfilter.org/arptables \
+    file://0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch \
+    file://arptables-init-busybox.patch \
+    file://arptables-arpt-get-target-fix.patch \
+    file://arptables-remove-bashism.patch \
+    file://arptables.service \
+"
+SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5"
+SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928"
+
+S = "${WORKDIR}/git"
+SYSTEMD_SERVICE_${PN} = "arptables.service"
+
+inherit systemd
+
+EXTRA_OEMAKE = "'BINDIR=${sbindir}' 'MANDIR=${mandir}'"
+
+do_install_append() {
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -d ${D}${systemd_unitdir}/system
+        install -m 644 ${WORKDIR}/arptables.service ${D}${systemd_unitdir}/system
+    fi
+}
+
+RDEPENDS_${PN} += "perl"
+
+# the install target is not multi-job safe, but it doesn't do much
+# so we just install serially
+#
+PARALLEL_MAKEINST = "-j1"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/chrony/chrony_2.4.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/chrony/chrony_2.4.bb
index 088708f..71431f4 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/chrony/chrony_2.4.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/chrony/chrony_2.4.bb
@@ -60,7 +60,7 @@
 #   - 'scfilter' enables support for system call filtering, but requires the
 #     kernel to have CONFIG_SECCOMP enabled.
 PACKAGECONFIG ??= "editline \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
 "
 PACKAGECONFIG[readline] = "--without-editline,--without-readline,readline"
 PACKAGECONFIG[editline] = ",--without-editline,libedit"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/cifs/cifs-utils_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/cifs/cifs-utils_git.bb
index 099d885..efda707 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/cifs/cifs-utils_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/cifs/cifs-utils_git.bb
@@ -4,9 +4,9 @@
 LICENSE = "GPLv3 & LGPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
-PV = "6.4"
+PV = "6.6"
 
-SRCREV = "487f46da737291877867cbd3acb40fea087d3863"
+SRCREV = "7926aaea98cdc96b6544b8e21fb5b0b4422c340d"
 SRC_URI = "git://git.samba.org/cifs-utils.git"
 
 S = "${WORKDIR}/git"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb_2.5.6.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb_2.5.6.bb
index 7cea0f6..b5a6064 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb_2.5.6.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb_2.5.6.bb
@@ -27,6 +27,9 @@
 PARALLEL_MAKE = ""
 
 DEPENDS += "popt libtevent libtalloc libldb"
+DEPENDS_append_libc-musl = " libtirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
 
 # ctdbd_wrapper requires pgrep, hence procps
 RDEPENDS_${PN} += "procps"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp/pkgconfig_fix.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp/pkgconfig_fix.patch
deleted file mode 100644
index ad73c00..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp/pkgconfig_fix.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Upstream-Status: Inappropriate [packaging]
-
-
-Index: curl-7.20.0/libcurl.pc.in
-===================================================================
---- curl-7.20.0.orig/libcurl.pc.in	2009-11-17 18:11:07.000000000 +0000
-+++ curl-7.20.0/libcurl.pc.in	2010-03-25 12:13:26.814051066 +0000
-@@ -35,6 +35,7 @@
- URL: http://curl.haxx.se/
- Description: Library to transfer files with ftp, http, etc.
- Version: @CURLVERSION@
--Libs: -L${libdir} -lcurl @LIBS@
--Libs.private: @LIBCURL_LIBS@ @LIBS@
-+Requires.private: @GNUTLS_REQUIRED@
-+Libs: -L${libdir} -lcurl
-+Libs.private: -ldl -lz
- Cflags: -I${includedir}
-Index: curl-7.20.0/configure.ac
-===================================================================
---- curl-7.20.0.orig/configure.ac	2010-02-04 21:41:46.000000000 +0000
-+++ curl-7.20.0/configure.ac	2010-03-25 12:12:18.673129001 +0000
-@@ -1668,6 +1668,7 @@
-        AC_SUBST(USE_GNUTLS, [1])
-        GNUTLS_ENABLED=1
-        USE_GNUTLS="yes"
-+       GNUTLS_REQUIRED="gnutls"
-        curl_ssl_msg="enabled (GnuTLS)"
-        ],
-        [
-@@ -1696,6 +1697,8 @@
- 
- fi dnl OPENSSL != 1
- 
-+AC_SUBST(GNUTLS_REQUIRED)
-+
- dnl ----------------------------------------------------
- dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
- dnl ----------------------------------------------------
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp_0.7.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp_0.7.3.bb
deleted file mode 100644
index c3a242a..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp_0.7.3.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-SUMMARY = "C++ library for client-side URL transfers"
-HOMEPAGE = "http://code.google.com/p/curlpp/"
-SECTION = "libdevel"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
-DEPENDS = "curl boost"
-DEPENDS_class-native = "curl-native"
-
-SRC_URI = "http://curlpp.googlecode.com/files/curlpp-${PV}.tar.gz \
-    file://example21.cpp-remove-deprecated-code.patch \
-"
-
-SRC_URI[md5sum] = "ccc3d30d4b3b5d2cdbed635898c29485"
-SRC_URI[sha256sum] = "e3f9427b27c5bddf898d383d45c0d3d5397e2056ff935d9a5cdaef6a9a653bd5"
-
-inherit autotools-brokensep pkgconfig binconfig
-
-EXTRA_OECONF = "--with-boost=${STAGING_DIR_HOST}${prefix}"
-# Upstream is currently working on porting the code to use std::unique_ptr instead of the
-# deprecated auto_ptr.  For now, ignore the issue.
-CXXFLAGS += "-Wno-error=deprecated-declarations"
-
-do_install_append () {
-    sed -i 's,${STAGING_DIR_TARGET},,g' ${D}${libdir}/pkgconfig/curlpp.pc
-}
-
-PACKAGES =+ "libcurlpp libcurlpp-dev libcurlpp-staticdev"
-
-FILES_lib${BPN} = "${libdir}/lib*.so.*"
-
-FILES_lib${BPN}-dev = "${includedir} \
-    ${libdir}/lib*.la \
-    ${libdir}/pkgconfig \
-    ${bindir}/*-config \
-"
-
-FILES_lib${BPN}-staticdev = "${libdir}/lib*.a"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp_0.8.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp_0.8.1.bb
new file mode 100644
index 0000000..340f57d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp_0.8.1.bb
@@ -0,0 +1,33 @@
+SUMMARY = "C++ library for client-side URL transfers"
+HOMEPAGE = "http://www.curlpp.org/"
+SECTION = "libdevel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+DEPENDS = "curl"
+DEPENDS_class-native = "curl-native"
+
+SRC_URI = "git://github.com/jpbarrette/curlpp.git"
+
+SRCREV = "592552a165cc569dac7674cb7fc9de3dc829906f"
+
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig binconfig
+
+do_install_append () {
+    sed -i 's,${STAGING_DIR_TARGET},,g' ${D}${libdir}/pkgconfig/curlpp.pc
+}
+
+PACKAGES =+ "libcurlpp libcurlpp-dev libcurlpp-staticdev"
+
+FILES_lib${BPN} = "${libdir}/lib*.so.*"
+
+FILES_lib${BPN}-dev = "${includedir} \
+    ${libdir}/pkgconfig \
+    ${bindir}/*-config \
+"
+
+FILES_lib${BPN}-staticdev = "${libdir}/lib*.a"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq.inc b/import-layers/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq.inc
index 9ef54fe..ef79c5f 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq.inc
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq.inc
@@ -7,7 +7,7 @@
                     file://COPYING-v3;md5=d32239bcb673463ab874e80d47fae504"
 
 #at least versions 2.15 and prior are moved to the archive folder on the server
-SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV',1).split('.')[1]) > 15]}dnsmasq-${PV}.tar.gz;name=dnsmasq-${PV} \
+SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV').split('.')[1]) > 15]}dnsmasq-${PV}.tar.gz;name=dnsmasq-${PV} \
            file://init \
            file://dnsmasq.conf \
            file://dnsmasq-resolvconf.service \
@@ -53,7 +53,7 @@
 
     install -d ${D}${systemd_unitdir}/system
 
-    if [ "${@bb.utils.contains('PACKAGECONFIG', 'resolvconf', 'resolvconf', '', d)}" != "" ]; then
+    if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then
         install -m 0644 ${WORKDIR}/dnsmasq-resolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service
     else
         install -m 0644 ${WORKDIR}/dnsmasq-noresolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service
@@ -61,11 +61,11 @@
 
     install -m 0755 ${S}/contrib/lease-tools/dhcp_release ${D}${bindir}
 
-    if [ "${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'dbus', '', d)}" != "" ]; then
+    if [ "${@bb.utils.filter('PACKAGECONFIG', 'dbus', d)}" ]; then
         install -d ${D}${sysconfdir}/dbus-1/system.d
         install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/
     fi
-    if [ "${@bb.utils.contains('PACKAGECONFIG', 'resolvconf', 'resolvconf', '', d)}" != "" ]; then
+    if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then
         install -d ${D}${sysconfdir}/resolvconf/update.d/
         install -m 0755 ${WORKDIR}/dnsmasq.resolvconf ${D}${sysconfdir}/resolvconf/update.d/dnsmasq
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf b/import-layers/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf
index 34d5135..9e5ab9f 100755
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf
@@ -4,6 +4,11 @@
 # as the long options legal on the command line. See
 # "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
 
+# Listen on this specific port instead of the standard DNS port
+# (53). Setting this to zero completely disables DNS function,
+# leaving only DHCP and/or TFTP.
+#port=5353
+
 # Change these lines if you want dnsmasq to serve MX records.
 # Only one of mx-host and mx-target need be set, the other defaults
 # to the name of the host  running dnsmasq.
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot_2.2.25.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot_2.2.25.bb
deleted file mode 100644
index 66af361..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot_2.2.25.bb
+++ /dev/null
@@ -1,67 +0,0 @@
-SUMMARY = "Dovecot is an open source IMAP and POP3 email server"
-DESCRIPTION = "Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory."
-SECTION = "mail"
-LICENSE = "LGPLv2.1 & MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a981379bd0f1c362f8d1d21515e5b30b"
-
-SRC_URI = "http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \
-           file://0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch \
-           file://dovecot.service \
-           file://dovecot.socket"
-
-SRC_URI[md5sum] = "8f62ea76489c47c369cbbe0b19818448"
-SRC_URI[sha256sum] = "d8d9f32c846397f7c22749a84c5cf6f59c55ff7ded3dc9f07749a255182f9667"
-
-DEPENDS = "openssl xz zlib bzip2 libcap icu"
-
-inherit autotools pkgconfig systemd useradd
-
-PACKAGECONFIG ??= " \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
-                  "
-
-PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
-PACKAGECONFIG[ldap] = "--with-ldap=plugin,--without-ldap,openldap,"
-PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
-
-# From native build in armv7a-hf/eglibc
-CACHED_CONFIGUREVARS += "i_cv_signed_size_t=no \
-                         i_cv_gmtime_max_time_t=32 \
-                         i_cv_signed_time_t=yes \
-                         i_cv_mmap_plays_with_write=yes \
-                         i_cv_fd_passing=yes \
-                         i_cv_c99_vsnprintf=yes \
-                         lib_cv___va_copy=yes \
-                         lib_cv_va_copy=yes \
-                         lib_cv_va_val_copy=yes \
-                        "
-
-# hardcode epoll() to avoid running unsafe tests
-# BSD needs kqueue and uclibc poll()
-EXTRA_OECONF = " --with-ioloop=epoll \
-                 --with-systemdsystemunitdir=${systemd_unitdir}/system"
-
-SYSTEMD_PACKAGES = "${PN}"
-SYSTEMD_SERVICE_${PN} = "dovecot.service dovecot.socket"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-do_install_append () {
-    install -d 755 ${D}/etc/dovecot
-    touch 644 ${D}/etc/dovecot/dovecot.conf
-    install -m 0644 ${WORKDIR}/dovecot.service ${D}${systemd_unitdir}/system
-    sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/dovecot.service
-    sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/dovecot.service
-}
-
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "-r -d ${libexecdir} -M -s ${base_sbindir}/nologin -g dovecot dovecot; \
-                      -r -d ${libexecdir} -M -s ${base_sbindir}/nologin -g dovenull dovenull"
-GROUPADD_PARAM_${PN} = "-f -r dovecot;-f -r dovenull"
-
-FILES_${PN} += "${libdir}/dovecot/*plugin.so \
-                ${libdir}/dovecot/libfs_compress.so \
-                ${libdir}/dovecot/libssl_iostream_openssl.so"
-FILES_${PN}-staticdev += "${libdir}/dovecot/*/*.a"
-FILES_${PN}-dev += "${libdir}/dovecot/libdovecot*.so"
-FILES_${PN}-dbg += "${libdir}/dovecot/*/.debug"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot_2.2.29.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot_2.2.29.bb
new file mode 100644
index 0000000..b2a3de3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot_2.2.29.bb
@@ -0,0 +1,68 @@
+SUMMARY = "Dovecot is an open source IMAP and POP3 email server"
+DESCRIPTION = "Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory."
+SECTION = "mail"
+LICENSE = "LGPLv2.1 & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a981379bd0f1c362f8d1d21515e5b30b"
+
+SRC_URI = "http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \
+           file://0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch \
+           file://dovecot.service \
+           file://dovecot.socket"
+
+SRC_URI[md5sum] = "ff95486a5c43025a2c3f5a712e7962b9"
+SRC_URI[sha256sum] = "d939ea99126eb8a8c6955390b422b6e27ec0fa43a3b59b2b3218cb5ad67139a6"
+
+DEPENDS = "openssl xz zlib bzip2 libcap icu"
+
+DEPENDS_append_libc-musl = " libtirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
+inherit autotools pkgconfig systemd useradd
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ldap pam', d)}"
+
+PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
+PACKAGECONFIG[ldap] = "--with-ldap=plugin,--without-ldap,openldap,"
+PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
+
+# From native build in armv7a-hf/eglibc
+CACHED_CONFIGUREVARS += "i_cv_signed_size_t=no \
+                         i_cv_gmtime_max_time_t=32 \
+                         i_cv_signed_time_t=yes \
+                         i_cv_mmap_plays_with_write=yes \
+                         i_cv_fd_passing=yes \
+                         i_cv_c99_vsnprintf=yes \
+                         lib_cv___va_copy=yes \
+                         lib_cv_va_copy=yes \
+                         lib_cv_va_val_copy=yes \
+                        "
+
+# hardcode epoll() to avoid running unsafe tests
+# BSD needs kqueue and uclibc poll()
+EXTRA_OECONF = " --with-ioloop=epoll \
+                 --with-systemdsystemunitdir=${systemd_unitdir}/system"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "dovecot.service dovecot.socket"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install_append () {
+    install -d 755 ${D}/etc/dovecot
+    touch 644 ${D}/etc/dovecot/dovecot.conf
+    install -m 0644 ${WORKDIR}/dovecot.service ${D}${systemd_unitdir}/system
+    sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/dovecot.service
+    sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/dovecot.service
+}
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "-r -d ${libexecdir} -M -s ${base_sbindir}/nologin -g dovecot dovecot; \
+                      -r -d ${libexecdir} -M -s ${base_sbindir}/nologin -g dovenull dovenull"
+GROUPADD_PARAM_${PN} = "-f -r dovecot;-f -r dovenull"
+
+FILES_${PN} += "${libdir}/dovecot/*plugin.so \
+                ${libdir}/dovecot/libfs_compress.so \
+                ${libdir}/dovecot/libssl_iostream_openssl.so"
+FILES_${PN}-staticdev += "${libdir}/dovecot/*/*.a"
+FILES_${PN}-dev += "${libdir}/dovecot/libdovecot*.so"
+FILES_${PN}-dbg += "${libdir}/dovecot/*/.debug"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-Makefile.in-don-t-compile-documentation.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-Makefile.in-don-t-compile-documentation.patch
deleted file mode 100644
index 1de4a86..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-Makefile.in-don-t-compile-documentation.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From feccf89f08a455460668cf286151662e4c1557b3 Mon Sep 17 00:00:00 2001
-From: Li xin <lixin.fnst@cn.fujitsu.com>
-Date: Thu, 20 Aug 2015 15:32:30 +0900
-Subject: [PATCH] Makefile.in: don't compile documentation
-
-The documentation file is not suitable for cross-compile,
-Errors will occur:
-| /bin/sh: ../../user/v9/drbdsetup: /lib/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory
-| ../../user/v9/drbdsetup xml-help disk-options > drbdsetup_xml-help_disk-options.xml
-| /bin/sh: ../../user/v9/drbdsetup: /lib/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory
-| /bin/sh: ../../user/v9/drbdsetup: /lib/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory
-| make[1]: *** [drbdsetup_xml-help_new-resource.xml] Error 126
-
-so we do not compile it.
-
-Upstream-Status: pending
-
-Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
----
- Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index 5365a2c..d5967d8 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -45,7 +45,7 @@ WITH_84_SUPPORT = @WITH_84_SUPPORT@
- # and not in e.g. dash. I'm too lazy to fix it to be compatible.
- SHELL=/bin/bash
- 
--SUBDIRS     = user/shared user/v9 user/v84 user/v83 scripts documentation/v83 documentation/v84 documentation/v9
-+SUBDIRS     = user/shared user/v9 user/v84 user/v83 scripts
- 
- REL_VERSION := $(shell $(SED) -ne '/^AC_INIT/{s/^[^,]*, *\([^,]*\) *,.*/\1/;p;q}' configure.ac)
- ifdef FORCE
--- 
-1.8.4.2
-
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_8.9.6.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_8.9.6.bb
index 3d6f5b2..5f6c43f 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_8.9.6.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_8.9.6.bb
@@ -30,7 +30,12 @@
                 --without-manual\
                "
 
-RDEPENDS_${PN} += "bash perl"
+do_install_append() {
+    # don't install empty /var/lock to avoid conflict with base-files
+    rm -rf ${D}${localstatedir}/lock
+}
+
+RDEPENDS_${PN} += "bash perl-module-getopt-long perl-module-exporter perl-module-constant perl-module-overloading perl-module-exporter-heavy"
 
 # The drbd items are explicitly put under /lib when installed.
 #
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/fping/fping_3.5.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/fping/fping_3.5.bb
index 2f5f2b6..82e3bf0 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/fping/fping_3.5.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/fping/fping_3.5.bb
@@ -21,5 +21,5 @@
 
 EXTRA_OECONF = "--enable-ipv4"
 
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/fwknop/fwknop_2.6.9.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/fwknop/fwknop_2.6.9.bb
new file mode 100644
index 0000000..49b11ad
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/fwknop/fwknop_2.6.9.bb
@@ -0,0 +1,34 @@
+SUMMARY = "fwknop - Single Packet Authorization"
+HOMEPAGE = "http://www.cipherdyne.org/fwknop/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+		    "
+inherit autotools-brokensep
+
+SRC_URI = "http://www.cipherdyne.org/${BPN}/download/${BPN}-${PV}.tar.bz2 \
+          "
+
+SRC_URI[md5sum] = "e2c49e9674888a028bd443a55c3aaa22"
+SRC_URI[sha256sum] = "5bf47fe1fd30e862d29464f762c0b8bf89b5e298665c37624d6707826da956d4"
+
+DEPENDS = "libpcap gpgme"
+
+EXTRA_OECONF = " --with-iptables=/usr/sbin/iptables \
+               "
+
+do_configure () {
+	aclocal
+	libtoolize --automake --copy --force
+	autoconf
+	autoheader
+	automake -a
+	oe_runconf
+}
+
+PACKAGES =+ "${PN}-client ${PN}-daemon"
+
+FILES_${PN}-client = "${bindir}/fwknop"
+FILES_${PN}-daemon = "${sbindir}/fwknopd \
+                      ${sysconfdir}/fwknop/access.conf \
+                      ${sysconfdir}/fwknop/fwknopd.conf"
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ifenslave/ifenslave_2.7.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/ifenslave/ifenslave_2.7.bb
index 7473b0d..5028921 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/ifenslave/ifenslave_2.7.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ifenslave/ifenslave_2.7.bb
@@ -17,4 +17,10 @@
     install -m 0755 -D ${S}/debian/ifenslave.if-pre-up ${D}${sysconfdir}/network/if-pre-up.d/ifenslave
     install -m 0755 -D ${S}/debian/ifenslave.if-post-down ${D}${sysconfdir}/network/if-post-down.d/ifenslave
     install -m 0755 -D ${S}/debian/ifenslave.if-up ${D}${sysconfdir}/network/if-up.d/ifenslave
+    install -m 0644 -D ${S}/debian/ifenslave.8 ${D}${mandir}/man8/ifenslave.8
 }
+
+FILES_${PN}-doc_remove = "${mandir}"
+FILES_${PN} += "${mandir}/man8/ifenslave.8"
+
+RDEPENDS_${PN} = "man"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-header-issues-found-with-musl-libc.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-header-issues-found-with-musl-libc.patch
new file mode 100644
index 0000000..630ecdb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-header-issues-found-with-musl-libc.patch
@@ -0,0 +1,249 @@
+From 7d9585be093c9cb2428b373c0b0088bb778942d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 20 Mar 2017 21:37:47 -0700
+Subject: [PATCH] Fix header issues found with musl libc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/libipsec/ipsec_strerror.h         | 3 +++
+ src/libipsec/libpfkey.h               | 4 +++-
+ src/racoon/admin.c                    | 2 +-
+ src/racoon/backupsa.c                 | 6 +++---
+ src/racoon/cftoken.l                  | 4 ++++
+ src/racoon/logger.h                   | 3 +++
+ src/racoon/misc.h                     | 3 +++
+ src/racoon/missing/crypto/sha2/sha2.h | 3 +++
+ src/racoon/netdb_dnssec.h             | 3 +++
+ src/racoon/pfkey.c                    | 1 -
+ src/racoon/plog.h                     | 2 ++
+ src/racoon/str2val.h                  | 3 +++
+ src/racoon/vmbuf.h                    | 3 +++
+ src/setkey/extern.h                   | 3 ++-
+ src/setkey/setkey.c                   | 1 -
+ 15 files changed, 36 insertions(+), 8 deletions(-)
+
+diff --git a/src/libipsec/ipsec_strerror.h b/src/libipsec/ipsec_strerror.h
+index 2b4264f..dac66a1 100644
+--- a/src/libipsec/ipsec_strerror.h
++++ b/src/libipsec/ipsec_strerror.h
+@@ -34,6 +34,9 @@
+ #ifndef _IPSEC_STRERROR_H
+ #define _IPSEC_STRERROR_H
+ 
++#undef __P
++#define __P(protos)     protos          /* ANSI C prototypes */
++
+ extern int __ipsec_errcode;
+ extern void __ipsec_set_strerror __P((const char *));
+ 
+diff --git a/src/libipsec/libpfkey.h b/src/libipsec/libpfkey.h
+index 61d2f2a..f7991b7 100644
+--- a/src/libipsec/libpfkey.h
++++ b/src/libipsec/libpfkey.h
+@@ -34,6 +34,9 @@
+ #ifndef _LIBPFKEY_H
+ #define _LIBPFKEY_H
+ 
++#undef __P
++#define __P(protos)     protos          /* ANSI C prototypes */
++
+ #ifndef KAME_LIBPFKEY_H
+ #define KAME_LIBPFKEY_H
+ 
+@@ -43,7 +46,6 @@
+ 
+ #define PRIORITY_OFFSET_POSITIVE_MAX	0x3fffffff
+ #define PRIORITY_OFFSET_NEGATIVE_MAX	0x40000000
+-
+ struct sadb_msg;
+ extern void pfkey_sadump __P((struct sadb_msg *));
+ extern void pfkey_sadump_withports __P((struct sadb_msg *));
+diff --git a/src/racoon/admin.c b/src/racoon/admin.c
+index 4b1875b..03ea3f8 100644
+--- a/src/racoon/admin.c
++++ b/src/racoon/admin.c
+@@ -36,7 +36,6 @@
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+-#include <sys/signal.h>
+ #include <sys/stat.h>
+ #include <sys/un.h>
+ 
+@@ -46,6 +45,7 @@
+ #include PATH_IPSEC_H
+ 
+ 
++#include <signal.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+diff --git a/src/racoon/backupsa.c b/src/racoon/backupsa.c
+index 82d74ca..95307ca 100644
+--- a/src/racoon/backupsa.c
++++ b/src/racoon/backupsa.c
+@@ -276,9 +276,9 @@ do { 								\
+ 		GETNEXTNUM(sa_args.a_keylen, strtoul);
+ 		GETNEXTNUM(sa_args.flags, strtoul);
+ 		GETNEXTNUM(sa_args.l_alloc, strtoul);
+-		GETNEXTNUM(sa_args.l_bytes, strtouq);
+-		GETNEXTNUM(sa_args.l_addtime, strtouq);
+-		GETNEXTNUM(sa_args.l_usetime, strtouq);
++		GETNEXTNUM(sa_args.l_bytes, strtoull);
++		GETNEXTNUM(sa_args.l_addtime, strtoull);
++		GETNEXTNUM(sa_args.l_usetime, strtoull);
+ 		GETNEXTNUM(sa_args.seq, strtoul);
+ 
+ #undef GETNEXTNUM
+diff --git a/src/racoon/cftoken.l b/src/racoon/cftoken.l
+index 1701922..787f4a9 100644
+--- a/src/racoon/cftoken.l
++++ b/src/racoon/cftoken.l
+@@ -77,6 +77,10 @@
+ 
+ #include "cfparse.h"
+ 
++#ifndef GLOB_TILDE
++#define GLOB_TILDE 0
++#endif
++
+ int yyerrorcount = 0;
+ 
+ #if defined(YIPS_DEBUG)
+diff --git a/src/racoon/logger.h b/src/racoon/logger.h
+index 3fd3e94..67af5f0 100644
+--- a/src/racoon/logger.h
++++ b/src/racoon/logger.h
+@@ -34,6 +34,9 @@
+ #ifndef _LOGGER_H
+ #define _LOGGER_H
+ 
++#undef __P
++#define __P(protos)     protos          /* ANSI C prototypes */
++
+ struct log {
+ 	int head;
+ 	int siz;
+diff --git a/src/racoon/misc.h b/src/racoon/misc.h
+index 3e758d9..30d9825 100644
+--- a/src/racoon/misc.h
++++ b/src/racoon/misc.h
+@@ -34,6 +34,9 @@
+ #ifndef _MISC_H
+ #define _MISC_H
+ 
++#undef __P
++#define __P(protos)     protos          /* ANSI C prototypes */
++
+ #define BIT2STR(b) bit2str(b, sizeof(b)<<3)
+ 
+ #ifdef HAVE_FUNC_MACRO
+diff --git a/src/racoon/missing/crypto/sha2/sha2.h b/src/racoon/missing/crypto/sha2/sha2.h
+index 42bcc2a..c043dfe 100644
+--- a/src/racoon/missing/crypto/sha2/sha2.h
++++ b/src/racoon/missing/crypto/sha2/sha2.h
+@@ -40,6 +40,9 @@
+ #ifndef __SHA2_H__
+ #define __SHA2_H__
+ 
++#undef __P
++#define __P(protos)     protos          /* ANSI C prototypes */
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+diff --git a/src/racoon/netdb_dnssec.h b/src/racoon/netdb_dnssec.h
+index a11209d..98fd813 100644
+--- a/src/racoon/netdb_dnssec.h
++++ b/src/racoon/netdb_dnssec.h
+@@ -34,6 +34,9 @@
+ #ifndef _NETDB_DNSSEC_H
+ #define _NETDB_DNSSEC_H
+ 
++#undef __P
++#define __P(protos)     protos          /* ANSI C prototypes */
++
+ #ifndef T_CERT
+ #define T_CERT	37		/* defined by RFC2538 section 2 */
+ #endif
+diff --git a/src/racoon/pfkey.c b/src/racoon/pfkey.c
+index 8f26c19..a06c30e 100644
+--- a/src/racoon/pfkey.c
++++ b/src/racoon/pfkey.c
+@@ -59,7 +59,6 @@
+ #include <sys/param.h>
+ #include <sys/socket.h>
+ #include <sys/queue.h>
+-#include <sys/sysctl.h>
+ 
+ #include <net/route.h>
+ #include <net/pfkeyv2.h>
+diff --git a/src/racoon/plog.h b/src/racoon/plog.h
+index ed43c8b..920c850 100644
+--- a/src/racoon/plog.h
++++ b/src/racoon/plog.h
+@@ -34,6 +34,8 @@
+ #ifndef _PLOG_H
+ #define _PLOG_H
+ 
++#undef __P
++#define __P(protos)     protos          /* ANSI C prototypes */
+ #ifdef HAVE_STDARG_H
+ #include <stdarg.h>
+ #else
+diff --git a/src/racoon/str2val.h b/src/racoon/str2val.h
+index 4a7cec1..d3d698e 100644
+--- a/src/racoon/str2val.h
++++ b/src/racoon/str2val.h
+@@ -34,6 +34,9 @@
+ #ifndef _STR2VAL_H
+ #define _STR2VAL_H
+ 
++#undef __P
++#define __P(protos)     protos          /* ANSI C prototypes */
++
+ extern caddr_t val2str __P((const char *, size_t));
+ extern char *str2val __P((const char *, int, size_t *));
+ 
+diff --git a/src/racoon/vmbuf.h b/src/racoon/vmbuf.h
+index 3f2f4ea..8287a00 100644
+--- a/src/racoon/vmbuf.h
++++ b/src/racoon/vmbuf.h
+@@ -34,6 +34,9 @@
+ #ifndef _VMBUF_H
+ #define _VMBUF_H
+ 
++#undef __P
++#define __P(protos)     protos          /* ANSI C prototypes */
++
+ /*
+  *	bp      v
+  *	v       v
+diff --git a/src/setkey/extern.h b/src/setkey/extern.h
+index 6f439fa..a1d9d14 100644
+--- a/src/setkey/extern.h
++++ b/src/setkey/extern.h
+@@ -1,6 +1,7 @@
+ /*	$NetBSD: extern.h,v 1.5 2009/03/06 11:45:03 tteras Exp $	*/
+ 
+-
++#undef __P
++#define __P(protos)     protos          /* ANSI C prototypes */
+ 
+ void parse_init __P((void));
+ int parse __P((FILE **));
+diff --git a/src/setkey/setkey.c b/src/setkey/setkey.c
+index c400faa..51f8b75 100644
+--- a/src/setkey/setkey.c
++++ b/src/setkey/setkey.c
+@@ -40,7 +40,6 @@
+ #include <sys/socket.h>
+ #include <sys/time.h>
+ #include <sys/stat.h>
+-#include <sys/sysctl.h>
+ #include <err.h>
+ #include <netinet/in.h>
+ #include <net/pfkeyv2.h>
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-cfparse-clear-memory-equal-to-size-of-array.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-cfparse-clear-memory-equal-to-size-of-array.patch
new file mode 100644
index 0000000..e9dd84a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-cfparse-clear-memory-equal-to-size-of-array.patch
@@ -0,0 +1,30 @@
+From a5c59f6a1479947d33dba5191724cc5fc88a614b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 10:39:57 -0700
+Subject: [PATCH 2/2] cfparse: clear memory equal to size of array
+
+Fixes compiler error
+cfparse.y: In function 'set_isakmp_proposal':
+cfparse.y:2567:3: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/racoon/cfparse.y | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/racoon/cfparse.y b/src/racoon/cfparse.y
+index 0d9bd67..5d9c67b 100644
+--- a/src/racoon/cfparse.y
++++ b/src/racoon/cfparse.y
+@@ -2564,7 +2564,7 @@ set_isakmp_proposal(rmconf)
+ 		plog(LLV_DEBUG2, LOCATION, NULL,
+ 			"encklen=%d\n", s->encklen);
+ 
+-		memset(types, 0, ARRAYLEN(types));
++		memset(types, 0, sizeof(types));
+ 		types[algclass_isakmp_enc] = s->algclass[algclass_isakmp_enc];
+ 		types[algclass_isakmp_hash] = s->algclass[algclass_isakmp_hash];
+ 		types[algclass_isakmp_dh] = s->algclass[algclass_isakmp_dh];
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb
index bf89927..d7e8b25 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb
@@ -22,7 +22,9 @@
            file://racoon.service \
            file://fix-CVE-2015-4047.patch \
            file://0001-Fix-build-with-clang.patch \
-          "
+           file://0001-Fix-header-issues-found-with-musl-libc.patch \
+           file://0002-cfparse-clear-memory-equal-to-size-of-array.patch \
+           "
 SRC_URI[md5sum] = "d53ec14a0a3ece64e09e5e34b3350b41"
 SRC_URI[sha256sum] = "8eb6b38716e2f3a8a72f1f549c9444c2bc28d52c9536792690564c74fe722f2d"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libldb/libldb_1.1.27.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/libldb/libldb_1.1.27.bb
deleted file mode 100644
index f4370ef..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/libldb/libldb_1.1.27.bb
+++ /dev/null
@@ -1,61 +0,0 @@
-SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
-HOMEPAGE = "http://ldb.samba.org"
-SECTION = "libs"
-LICENSE = "LGPL-3.0+ & LGPL-2.1+ & GPL-3.0+"
-
-DEPENDS += "libtdb libtalloc libtevent popt"
-RDEPENDS_pyldb += "python"
-
-SRC_URI = "http://samba.org/ftp/ldb/ldb-${PV}.tar.gz \
-           file://do-not-import-target-module-while-cross-compile.patch \
-           file://ldb-Add-configure-options-for-packages.patch \
-          "
-
-PACKAGECONFIG ??= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
-"
-PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
-PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
-PACKAGECONFIG[ldap] = ",,openldap"
-PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
-PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
-PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
-PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
-
-SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'ldap', '', 'file://avoid-openldap-unless-wanted.patch', d)}"
-
-LIC_FILES_CHKSUM = "file://pyldb.h;endline=24;md5=dfbd238cecad76957f7f860fbe9adade \
-                    file://man/ldb.3.xml;beginline=261;endline=262;md5=137f9fd61040c1505d1aa1019663fd08 \
-                    file://tools/ldbdump.c;endline=19;md5=a7d4fc5d1f75676b49df491575a86a42"
-
-SRC_URI[md5sum] = "50a194dea128d062cf4b44c59130219b"
-SRC_URI[sha256sum] = "cdb8269cba09006ddf3766eb7721192b52ae3fdc8a6b95f4318b6b740b9d35ac"
-
-inherit waf-samba
-
-S = "${WORKDIR}/ldb-${PV}"
-
-EXTRA_OECONF += "--disable-rpath \
-                 --disable-rpath-install \
-                 --bundled-libraries=NONE \
-                 --builtin-libraries=replace \
-                 --with-modulesdir=${libdir}/ldb/modules \
-                 --with-privatelibdir=${libdir}/ldb \
-                 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
-                "
-DISABLE_STATIC = ""
-
-PACKAGES += "pyldb pyldb-dbg pyldb-dev"
-
-FILES_${PN} += "${libdir}/ldb/*"
-FILES_${PN}-dbg += "${libdir}/ldb/.debug/* \
-                    ${libdir}/ldb/modules/ldb/.debug/*"
-
-FILES_pyldb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
-               ${libdir}/libpyldb-util.so.1 \
-               ${libdir}/libpyldb-util.so.1.1.17 \
-              "
-FILES_pyldb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
-                   ${libdir}/.debug/libpyldb-util.so.1.1.17"
-FILES_pyldb-dev = "${libdir}/libpyldb-util.so"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libldb/libldb_1.1.29.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/libldb/libldb_1.1.29.bb
new file mode 100644
index 0000000..a90919b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/libldb/libldb_1.1.29.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
+HOMEPAGE = "http://ldb.samba.org"
+SECTION = "libs"
+LICENSE = "LGPL-3.0+ & LGPL-2.1+ & GPL-3.0+"
+
+DEPENDS += "libtdb libtalloc libtevent popt"
+RDEPENDS_pyldb += "python"
+
+SRC_URI = "http://samba.org/ftp/ldb/ldb-${PV}.tar.gz \
+           file://do-not-import-target-module-while-cross-compile.patch \
+           file://ldb-Add-configure-options-for-packages.patch \
+          "
+
+PACKAGECONFIG ??= "\
+    ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
+"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[ldap] = ",,openldap"
+PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
+PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
+PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
+PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
+
+SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'ldap', '', 'file://avoid-openldap-unless-wanted.patch', d)}"
+
+LIC_FILES_CHKSUM = "file://pyldb.h;endline=24;md5=dfbd238cecad76957f7f860fbe9adade \
+                    file://man/ldb.3.xml;beginline=261;endline=262;md5=137f9fd61040c1505d1aa1019663fd08 \
+                    file://tools/ldbdump.c;endline=19;md5=a7d4fc5d1f75676b49df491575a86a42"
+
+SRC_URI[md5sum] = "9c90abfb94c1e2a693399392cf4cddb9"
+SRC_URI[sha256sum] = "59d84f9a5b799f519ba7b2685bb46f5a26f1bbf05b7a144b2f5e017d01d80f97"
+
+inherit waf-samba
+
+S = "${WORKDIR}/ldb-${PV}"
+
+EXTRA_OECONF += "--disable-rpath \
+                 --disable-rpath-install \
+                 --bundled-libraries=NONE \
+                 --builtin-libraries=replace \
+                 --with-modulesdir=${libdir}/ldb/modules \
+                 --with-privatelibdir=${libdir}/ldb \
+                 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
+                "
+
+PACKAGES =+ "pyldb pyldb-dbg pyldb-dev"
+
+NOAUTOPACKAGEDEBUG = "1"
+
+FILES_${PN} += "${libdir}/ldb/*"
+FILES_${PN}-dbg += "${bindir}/.debug/* \
+                    ${libdir}/.debug/* \
+                    ${libdir}/ldb/.debug/* \
+                    ${libdir}/ldb/modules/ldb/.debug/*"
+
+FILES_pyldb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
+               ${libdir}/libpyldb-util.so.* \
+              "
+FILES_pyldb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
+                   ${libdir}/.debug/libpyldb-util.so.*"
+FILES_pyldb-dev = "${libdir}/libpyldb-util.so"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-Fix-comparison-types.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-Fix-comparison-types.patch
new file mode 100644
index 0000000..26b5e25
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-Fix-comparison-types.patch
@@ -0,0 +1,38 @@
+From ed4422979b221c8613ca02eb5c57cb80009366d1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 18 Mar 2017 10:13:24 -0700
+Subject: [PATCH 1/2] Fix comparison types
+
+Fixes
+error: comparison between pointer and integer ('char *' and 'int')
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ clients/memflush.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/clients/memflush.cc b/clients/memflush.cc
+index 8bd0dbf..71545ea 100644
+--- a/clients/memflush.cc
++++ b/clients/memflush.cc
+@@ -39,7 +39,7 @@ int main(int argc, char *argv[])
+ {
+   options_parse(argc, argv);
+ 
+-  if (opt_servers == false)
++  if (opt_servers == NULL)
+   {
+     char *temp;
+ 
+@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
+       opt_servers= strdup(temp);
+     }
+ 
+-    if (opt_servers == false)
++    if (opt_servers == NULL)
+     {
+       std::cerr << "No Servers provided" << std::endl;
+       exit(EXIT_FAILURE);
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-configure.ac-Do-not-configure-build-aux.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-configure.ac-Do-not-configure-build-aux.patch
new file mode 100644
index 0000000..06febc5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-configure.ac-Do-not-configure-build-aux.patch
@@ -0,0 +1,28 @@
+From fa0fe001a5373c1ef9ff2175555b14fc07399e1b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 18 Mar 2017 10:01:44 -0700
+Subject: [PATCH] configure.ac: Do not configure build-aux
+
+Fixes
+configure: error: cannot find install-sh, install.sh, or shtool
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 17b7351..0263112 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -17,7 +17,6 @@ AC_INIT([libmemcached],VERSION_NUMBER,[http://libmemcached.org/])
+ AC_PROG_CC([cc gcc clang])
+ AC_PROG_CXX([c++ g++ clang++])
+ 
+-AC_CONFIG_AUX_DIR([build-aux])
+ AC_CONFIG_MACRO_DIR([m4])
+ 
+ AC_CANONICAL_HOST
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0002-POSIX_SPAWN_USEVFORK-is-not-linux-specific-but-glibc.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0002-POSIX_SPAWN_USEVFORK-is-not-linux-specific-but-glibc.patch
new file mode 100644
index 0000000..e1e1be8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0002-POSIX_SPAWN_USEVFORK-is-not-linux-specific-but-glibc.patch
@@ -0,0 +1,30 @@
+From e95609e4ae40a794ed198924505fd22d7d86a124 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 18 Mar 2017 10:16:14 -0700
+Subject: [PATCH 2/2] POSIX_SPAWN_USEVFORK is not linux specific but glibc
+ specific
+
+Fixes
+cmdline.cc:206:12: error: use of undeclared identifier 'POSIX_SPAWN_USEVFORK'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libtest/cmdline.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc
+index 29a22de..34f0a89 100644
+--- a/libtest/cmdline.cc
++++ b/libtest/cmdline.cc
+@@ -201,7 +201,7 @@ Application::error_t Application::run(const char *args[])
+ 
+   fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0);
+ 
+-#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__)
++#if defined(POSIX_SPAWN_USEVFORK) || defined(__GLIBC__)
+   // Use USEVFORK on linux
+   flags |= POSIX_SPAWN_USEVFORK;
+ #endif
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached.inc b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached.inc
index 172443a..e86f832 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached.inc
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached.inc
@@ -7,6 +7,7 @@
 SRC_URI = "http://launchpad.net/libmemcached/1.0/${PV}/+download/libmemcached-${PV}.tar.gz"
 
 TARGET_LDFLAGS += "-luuid"
+TARGET_CFLAGS += "-D__USE_GNU -D_GNU_SOURCE"
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[sasl] = "--enable-sasl,--disable-sasl,cyrus-sasl"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.15.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.15.bb
deleted file mode 100644
index 18232b4..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.15.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require libmemcached.inc
-
-SRC_URI += "file://crosscompile.patch"
-
-SRC_URI[md5sum] = "616297a1aedefc52b3f6922eda5d559a"
-SRC_URI[sha256sum] = "dd7e9560029835bddf761a5b4c2339d9e5c7374558659b6c11b2c95e7d3a4325"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.18.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.18.bb
new file mode 100644
index 0000000..56778c0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.18.bb
@@ -0,0 +1,10 @@
+require libmemcached.inc
+
+SRC_URI += "\
+           file://crosscompile.patch \
+           file://0001-configure.ac-Do-not-configure-build-aux.patch \
+           file://0001-Fix-comparison-types.patch \
+           file://0002-POSIX_SPAWN_USEVFORK-is-not-linux-specific-but-glibc.patch \
+           "
+SRC_URI[md5sum] = "b3958716b4e53ddc5992e6c49d97e819"
+SRC_URI[sha256sum] = "e22c0bb032fde08f53de9ffbc5a128233041d9f33b5de022c0978a2149885f82"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.8.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.8.bb
deleted file mode 100644
index 3f031ca..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.8.bb
+++ /dev/null
@@ -1,51 +0,0 @@
-SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
-HOMEPAGE = "http://talloc.samba.org"
-SECTION = "libs"
-LICENSE = "LGPL-3.0+ & GPL-3.0+"
-
-SRC_URI = "https://samba.org/ftp/talloc/talloc-${PV}.tar.gz \
-           file://talloc-Add-configure-options-for-packages.patch \
-"
-LIC_FILES_CHKSUM = "file://talloc.h;beginline=3;endline=27;md5=a301712782cad6dd6d5228bfa7825249 \
-                    file://pytalloc.h;beginline=1;endline=18;md5=2c498cc6f2263672483237b20f46b43d"
-
-SRC_URI[md5sum] = "6fb70af4174330e4cc139ea63b07c9e9"
-SRC_URI[sha256sum] = "22d14911164d4de67ff76b5269fa5250d01f78c955bc77e28615350996877130"
-
-
-inherit waf-samba
-
-PACKAGECONFIG ??= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
-"
-PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
-PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
-PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
-PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
-PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
-PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
-
-SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'attr', '', 'file://avoid-attr-unless-wanted.patch', d)}"
-
-S = "${WORKDIR}/talloc-${PV}"
-
-EXTRA_OECONF += "--disable-rpath \
-                 --disable-rpath-install \
-                 --bundled-libraries=NONE \
-                 --builtin-libraries=replace \
-                 --disable-silent-rules \
-                 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
-                "
-DISABLE_STATIC = ""
-
-PACKAGES += "pytalloc pytalloc-dbg pytalloc-dev"
-
-FILES_pytalloc = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
-                  ${libdir}/libpytalloc-util.so.2 \
-                  ${libdir}/libpytalloc-util.so.2.1.1 \
-                 "
-FILES_pytalloc-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
-                      ${libdir}/.debug/libpytalloc-util.so.2.1.1"
-FILES_pytalloc-dev = "${libdir}/libpytalloc-util.so"
-RDEPENDS_pytalloc = "python"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.9.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.9.bb
new file mode 100644
index 0000000..d80af50
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.9.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
+HOMEPAGE = "http://talloc.samba.org"
+SECTION = "libs"
+LICENSE = "LGPL-3.0+ & GPL-3.0+"
+LIC_FILES_CHKSUM = "file://talloc.h;beginline=3;endline=27;md5=a301712782cad6dd6d5228bfa7825249 \
+                    file://pytalloc.h;beginline=1;endline=18;md5=2c498cc6f2263672483237b20f46b43d"
+
+
+SRC_URI = "https://samba.org/ftp/talloc/talloc-${PV}.tar.gz \
+           file://talloc-Add-configure-options-for-packages.patch \
+"
+SRC_URI[md5sum] = "19ba14eba97d79a169fa92ea824d2b9e"
+SRC_URI[sha256sum] = "f0aad4cb88a3322207c82136ddc07bed48a37c2c21f82962d6c5ccb422711062"
+
+inherit waf-samba
+
+PACKAGECONFIG ??= "\
+    ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
+"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
+PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
+PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
+PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
+
+SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'attr', '', 'file://avoid-attr-unless-wanted.patch', d)}"
+
+S = "${WORKDIR}/talloc-${PV}"
+
+EXTRA_OECONF += "--disable-rpath \
+                 --disable-rpath-install \
+                 --bundled-libraries=NONE \
+                 --builtin-libraries=replace \
+                 --disable-silent-rules \
+                 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
+                "
+
+PACKAGES += "pytalloc pytalloc-dbg pytalloc-dev"
+
+FILES_pytalloc = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
+                  ${libdir}/libpytalloc-util.so.2 \
+                  ${libdir}/libpytalloc-util.so.2.1.1 \
+                 "
+FILES_pytalloc-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
+                      ${libdir}/.debug/libpytalloc-util.so.2.1.1"
+FILES_pytalloc-dev = "${libdir}/libpytalloc-util.so"
+RDEPENDS_pytalloc = "python"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb_1.3.10.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb_1.3.10.bb
deleted file mode 100644
index 7eb0d7c..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb_1.3.10.bb
+++ /dev/null
@@ -1,44 +0,0 @@
-SUMMARY = "The tdb library"
-SECTION = "libs"
-LICENSE = "LGPL-3.0+ & GPL-3.0+"
-
-LIC_FILES_CHKSUM = "file://tools/tdbdump.c;endline=18;md5=b59cd45aa8624578126a8c98f48018c4 \
-                    file://include/tdb.h;endline=27;md5=f5bb544641d3081821bcc1dd58310be6"
-
-SRC_URI = "https://samba.org/ftp/tdb/tdb-${PV}.tar.gz \
-           file://do-not-check-xsltproc-manpages.patch \
-           file://tdb-Add-configure-options-for-packages.patch \
-"
-
-SRC_URI[md5sum] = "c98f24eb469022b0f1741d3a504cfda5"
-SRC_URI[sha256sum] = "5578fb726bd04835f250bea11fe7d1398fe0bb3a7c9390404241c83cd6b50c1c"
-
-PACKAGECONFIG ??= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
-"
-PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
-PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
-PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
-PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
-PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
-PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
-
-S = "${WORKDIR}/tdb-${PV}"
-
-inherit waf-samba
-
-EXTRA_OECONF += "--disable-rpath \
-                 --bundled-libraries=NONE \
-                 --builtin-libraries=replace \
-                 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
-                "
-DISABLE_STATIC = ""
-
-PACKAGES += "tdb-tools python-tdb python-tdb-dbg"
-
-FILES_${PN} = "${libdir}/*.so.*"
-FILES_tdb-tools = "${bindir}/*"
-FILES_python-tdb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
-FILES_python-tdb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/*"
-RDEPENDS_python-tdb = "python"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb_1.3.12.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb_1.3.12.bb
new file mode 100644
index 0000000..e256ac9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb_1.3.12.bb
@@ -0,0 +1,43 @@
+SUMMARY = "The tdb library"
+SECTION = "libs"
+LICENSE = "LGPL-3.0+ & GPL-3.0+"
+
+LIC_FILES_CHKSUM = "file://tools/tdbdump.c;endline=18;md5=b59cd45aa8624578126a8c98f48018c4 \
+                    file://include/tdb.h;endline=27;md5=f5bb544641d3081821bcc1dd58310be6"
+
+SRC_URI = "https://samba.org/ftp/tdb/tdb-${PV}.tar.gz \
+           file://do-not-check-xsltproc-manpages.patch \
+           file://tdb-Add-configure-options-for-packages.patch \
+"
+
+SRC_URI[md5sum] = "d9627e7aacd535a8251401f914bb6924"
+SRC_URI[sha256sum] = "60134e32253cac8e2efe5e0185d20123c208bcf6ad15edf2f50d80daadf8c348"
+
+PACKAGECONFIG ??= "\
+    ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
+"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
+PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
+PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
+PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
+
+S = "${WORKDIR}/tdb-${PV}"
+
+inherit waf-samba
+
+EXTRA_OECONF += "--disable-rpath \
+                 --bundled-libraries=NONE \
+                 --builtin-libraries=replace \
+                 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
+                "
+
+PACKAGES += "tdb-tools python-tdb python-tdb-dbg"
+
+FILES_${PN} = "${libdir}/*.so.*"
+FILES_tdb-tools = "${bindir}/*"
+FILES_python-tdb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
+FILES_python-tdb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/*"
+RDEPENDS_python-tdb = "python"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent_0.9.29.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent_0.9.29.bb
deleted file mode 100644
index 7125893..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent_0.9.29.bb
+++ /dev/null
@@ -1,45 +0,0 @@
-SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
-HOMEPAGE = "http://tevent.samba.org"
-SECTION = "libs"
-LICENSE = "LGPLv3+"
-
-DEPENDS += "libtalloc"
-RDEPENDS_python-tevent = "python"
-
-SRC_URI = "https://samba.org/ftp/tevent/tevent-${PV}.tar.gz \
-           file://tevent-Add-configure-options-for-packages.patch \
-"
-LIC_FILES_CHKSUM = "file://tevent.h;endline=26;md5=4e458d658cb25e21efc16f720e78b85a"
-
-SRC_URI[md5sum] = "4372c1430a1ecb7ea0adddfdf21c0d55"
-SRC_URI[sha256sum] = "a4f519b0bbb718fe2175bee9011ee4d199675f28c2ef80531be38e7bbaa1c42b"
-
-inherit waf-samba
-
-PACKAGECONFIG ??= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
-"
-PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
-PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
-PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
-PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
-PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
-PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
-
-SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'attr', '', 'file://avoid-attr-unless-wanted.patch', d)}"
-
-S = "${WORKDIR}/tevent-${PV}"
-
-EXTRA_OECONF += "--disable-rpath \
-                 --bundled-libraries=NONE \
-                 --builtin-libraries=replace \
-                 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
-                 --without-gettext \
-                "
-DISABLE_STATIC = ""
-
-PACKAGES += "python-tevent python-tevent-dbg"
-
-FILES_python-tevent = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
-FILES_python-tevent-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent_0.9.31.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent_0.9.31.bb
new file mode 100644
index 0000000..ad711e7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent_0.9.31.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
+HOMEPAGE = "http://tevent.samba.org"
+SECTION = "libs"
+LICENSE = "LGPLv3+"
+
+DEPENDS += "libtalloc"
+RDEPENDS_python-tevent = "python"
+
+SRC_URI = "https://samba.org/ftp/tevent/tevent-${PV}.tar.gz \
+           file://tevent-Add-configure-options-for-packages.patch \
+"
+LIC_FILES_CHKSUM = "file://tevent.h;endline=26;md5=4e458d658cb25e21efc16f720e78b85a"
+
+SRC_URI[md5sum] = "5453847664ae6bc4ec0153e59ac635b9"
+SRC_URI[sha256sum] = "4a13f2256ad804c860e84068258bd0f8be31cf0c79aa8f3019fa32f6928c2bfc"
+
+inherit waf-samba
+
+PACKAGECONFIG ??= "\
+    ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
+"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
+PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
+PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
+PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
+
+SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'attr', '', 'file://avoid-attr-unless-wanted.patch', d)}"
+
+S = "${WORKDIR}/tevent-${PV}"
+
+EXTRA_OECONF += "--disable-rpath \
+                 --bundled-libraries=NONE \
+                 --builtin-libraries=replace \
+                 --with-libiconv=${STAGING_DIR_HOST}${prefix}\
+                 --without-gettext \
+                "
+
+PACKAGES += "python-tevent python-tevent-dbg"
+
+FILES_python-tevent = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
+FILES_python-tevent-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch
new file mode 100644
index 0000000..87e7dc3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch
@@ -0,0 +1,34 @@
+From b83fd54584fabd5d24f6645b4a3cf345c9d2020d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 16:11:59 -0700
+Subject: [PATCH 1/3] ttcp: Add printf format string
+
+Fixes compiler warnings when format security is enabled
+
+| ../../../linux-atm-2.5.2/src/test/ttcp.c:666:21: error: format not a string literal and no format arguments [-Werror=format-security]
+|      fprintf(stderr, Usage);
+|                      ^~~~~
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/test/ttcp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/test/ttcp.c b/src/test/ttcp.c
+index acb9185..337cee5 100644
+--- a/src/test/ttcp.c
++++ b/src/test/ttcp.c
+@@ -663,7 +663,7 @@ int no_check = 0;
+     exit(0);
+ 
+   usage:
+-    fprintf(stderr, Usage);
++    fprintf(stderr, "%s", Usage);
+     exit(1);
+ }
+ 
+-- 
+2.13.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch
new file mode 100644
index 0000000..ce06123
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch
@@ -0,0 +1,30 @@
+From 27fa80dc8045e71c30dd2abea835206d5c8f6c71 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 16:18:56 -0700
+Subject: [PATCH 2/3] sigd: Replace on_exit() API with atexit()
+
+on_exit is not universally available
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/sigd/atmsigd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sigd/atmsigd.c b/src/sigd/atmsigd.c
+index 52e41c7..b766606 100644
+--- a/src/sigd/atmsigd.c
++++ b/src/sigd/atmsigd.c
+@@ -517,7 +517,7 @@ int main(int argc,char **argv)
+ 	    exit(0);
+ 	}
+     }
+-    (void) on_exit(trace_on_exit,NULL);
++    atexit(trace_on_exit);
+     poll_loop();
+     close_all();
+     for (sig = entities; sig; sig = sig->next) stop_saal(&sig->saal);
+-- 
+2.13.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch
new file mode 100644
index 0000000..0302286
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch
@@ -0,0 +1,37 @@
+From fe954b2fb17d813aaab3e926cee76144314a115a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 16:22:55 -0700
+Subject: [PATCH 3/3] mpoad: Drop old hack to compile with very old glibc
+
+Use poll.h instead of sys/poll.h
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/mpoad/io.c | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/src/mpoad/io.c b/src/mpoad/io.c
+index 69900c2..8d1433f 100644
+--- a/src/mpoad/io.c
++++ b/src/mpoad/io.c
+@@ -10,14 +10,7 @@
+ #include <errno.h>
+ #include <sys/ioctl.h>
+ #include <sys/param.h> /* for OPEN_MAX   */
+-#if __GLIBC__ >= 2
+-#include <sys/poll.h>
+-#else /* ugly hack to make it compile on RH 4.2 - WA */
+-#include <syscall.h>
+-#include <linux/poll.h>
+-#define SYS_poll 168
+-_syscall3(int,poll,struct pollfd *,ufds,unsigned int,nfds,int,timeout);
+-#endif
++#include <poll.h>
+ #include <atm.h>
+ #include <linux/types.h>
+ #include <linux/atmioc.h>
+-- 
+2.13.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb
index 6ab8b07..9fce4fb 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb
@@ -11,6 +11,9 @@
            file://link-with-ldflags.patch \
            file://install-from-buildir.patch \
            file://0001-fix-compile-error-with-linux-kernel-v4.8.patch \
+           file://0001-ttcp-Add-printf-format-string.patch \
+           file://0002-sigd-Replace-on_exit-API-with-atexit.patch \
+           file://0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch \
 "
 
 SRC_URI[md5sum] = "d49499368c3cf15f73a05d9bce8824a8"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch
new file mode 100644
index 0000000..1453b75
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch
@@ -0,0 +1,32 @@
+From a36afac485745cf980fba1809526f2025cb4d101 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 23 Apr 2017 00:16:45 -0700
+Subject: [PATCH] Remove newline from format line
+
+Fixes
+
+error: '__builtin___snprintf_chk' output truncated before the last format character [-Werror=format-truncation=]
+     "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+                                               ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ addrdb/addrdb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/addrdb/addrdb.c b/addrdb/addrdb.c
+index 4bb7f79..05d53f3 100644
+--- a/addrdb/addrdb.c
++++ b/addrdb/addrdb.c
+@@ -178,7 +178,7 @@ int addrdb_dump_leases(const char *lease_file)
+ 			continue;
+ 		}
+ 		snprintf(hwaddr_buf, sizeof(hwaddr_buf),
+-				"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
++				"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
+ 				lease->hwaddr[0], lease->hwaddr[1],
+ 				lease->hwaddr[2], lease->hwaddr[3],
+ 				lease->hwaddr[4], lease->hwaddr[5],
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch
new file mode 100644
index 0000000..0a81a22
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch
@@ -0,0 +1,44 @@
+From ab725a3faaeead90ae3c63cbcd370af087c413a5 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Mon, 27 Mar 2017 17:55:06 -0700
+Subject: [PATCH] addrdb/coord-config-parse.y: add missing <time.h> include
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The %union definition uses the time_t structure. In order to use this
+structure, the <time.h> header has to be included. Otherwise, the build
+breaks with some C libraries, such as musl:
+
+In file included from coord-config-lex.l:23:0:
+coord-config-parse.y:107:2: error: unknown type name ‘time_t’
+  time_t timestamp;
+  ^
+
+This patch includes <time.h> using the '%code requires' directive of
+Yacc.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ addrdb/coord-config-parse.y | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/addrdb/coord-config-parse.y b/addrdb/coord-config-parse.y
+index 2e10a88..85ee058 100644
+--- a/addrdb/coord-config-parse.y
++++ b/addrdb/coord-config-parse.y
+@@ -102,6 +102,10 @@
+ 
+ %}
+ 
++%code requires {
++#include <time.h>
++}
++
+ %union {
+ 	unsigned long number;
+ 	time_t timestamp;
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch
new file mode 100644
index 0000000..6839306
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch
@@ -0,0 +1,27 @@
+From ad088233608ba2205511da4f270f8ba29844b84c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Apr 2017 09:02:02 -0700
+Subject: [PATCH] src/iz.c: Undef dprintf before redefining
+
+Clang is picky and warns about macros redefinition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/iz.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/iz.c b/src/iz.c
+index 32be1a8..886f0a5 100644
+--- a/src/iz.c
++++ b/src/iz.c
+@@ -60,6 +60,7 @@ static int iz_seq = 0;
+ /* Parsed options */
+ static int iz_debug = 0;
+ 
++#undef dprintf
+ #define dprintf(lvl, fmt...)			\
+ 	do {					\
+ 		if (iz_debug >= lvl)		\
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb
index 8c7dbc0..be73f8a 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb
@@ -11,6 +11,9 @@
 SRC_URI = "git://git.code.sf.net/p/linux-zigbee/linux-zigbee \
            file://no-help2man.patch \
            file://0001-Fix-build-errors-with-clang.patch \
+           file://0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch \
+           file://0001-src-iz.c-Undef-dprintf-before-redefining.patch \
+           file://0001-Remove-newline-from-format-line.patch \
            "
 SRCREV = "38f42dbfce9e13629263db3bd3b81f14c69bb733"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/memcached/memcached/configure.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/memcached/memcached/configure.patch
deleted file mode 100644
index 7001a0e..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/memcached/memcached/configure.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: memcached-1.4.17/configure.ac
-===================================================================
---- memcached-1.4.17.orig/configure.ac	2013-12-20 21:44:49.000000000 +0000
-+++ memcached-1.4.17/configure.ac	2014-07-18 07:17:00.593499483 +0000
-@@ -4,7 +4,7 @@
- AC_INIT(memcached, VERSION_NUMBER, memcached@googlegroups.com)
- AC_CANONICAL_SYSTEM
- AC_CONFIG_SRCDIR(memcached.c)
--AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
-+AM_INIT_AUTOMAKE([foreign])
- AM_CONFIG_HEADER(config.h)
- 
- AC_PROG_CC
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/memcached/memcached_1.4.17.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/memcached/memcached_1.4.17.bb
deleted file mode 100644
index 293f8d4..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/memcached/memcached_1.4.17.bb
+++ /dev/null
@@ -1,53 +0,0 @@
-SUMMARY = "A high-performance memory object caching system"
-DESCRIPTION = "\
- memcached optimizes specific high-load serving applications that are designed \
- to take advantage of its versatile no-locking memory access system. Clients \
- are available in several different programming languages, to suit the needs \
- of the specific application. Traditionally this has been used in mod_perl \
- apps to avoid storing large chunks of data in Apache memory, and to share \
- this burden across several machines."
-SECTION = "web"
-HOMEPAGE = "http://memcached.org/"
-LICENSE = "BSD-3-Clause"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=7e5ded7363d335e1bb18013ca08046ff"
-
-inherit autotools
-
-DEPENDS += "libevent"
-RDEPENDS_${PN} += "perl perl-module-posix perl-module-autoloader \
-    perl-module-tie-hash bash \
-    "
-
-SRC_URI = "http://www.memcached.org/files/${BP}.tar.gz \
-           file://configure.patch \
-           file://memcached-add-hugetlbfs-check.patch"
-
-# set the same COMPATIBLE_HOST as libhugetlbfs
-COMPATIBLE_HOST = '(i.86|x86_64|powerpc|powerpc64|arm).*-linux'
-
-SRC_URI[md5sum] = "46402dfbd7faadf6182283dbbd18b1a6"
-SRC_URI[sha256sum] = "d9173ef6d99ba798c982ea4566cb4f0e64eb23859fdbf9926a89999d8cdc0458"
-
-python __anonymous () {
-    endianness = d.getVar('SITEINFO_ENDIANNESS', True)
-    if endianness == 'le':
-        d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=little")
-    else:
-        d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=big")
-}
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[hugetlbfs] = "--enable-hugetlbfs, --disable-hugetlbfs, libhugetlbfs"
-
-inherit update-rc.d
-
-INITSCRIPT_NAME = "memcached"
-INITSCRIPT_PARAMS = "defaults"
-
-do_install_append() {
-    install -D -m 755 ${S}/scripts/memcached-init ${D}${sysconfdir}/init.d/memcached
-    mkdir -p ${D}/usr/share/memcached/scripts
-    install -m 755 ${S}/scripts/memcached-tool ${D}/usr/share/memcached/scripts
-    install -m 755 ${S}/scripts/start-memcached ${D}/usr/share/memcached/scripts
-}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/memcached/memcached_1.4.36.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/memcached/memcached_1.4.36.bb
new file mode 100644
index 0000000..48c3c9e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/memcached/memcached_1.4.36.bb
@@ -0,0 +1,52 @@
+SUMMARY = "A high-performance memory object caching system"
+DESCRIPTION = "\
+ memcached optimizes specific high-load serving applications that are designed \
+ to take advantage of its versatile no-locking memory access system. Clients \
+ are available in several different programming languages, to suit the needs \
+ of the specific application. Traditionally this has been used in mod_perl \
+ apps to avoid storing large chunks of data in Apache memory, and to share \
+ this burden across several machines."
+SECTION = "web"
+HOMEPAGE = "http://memcached.org/"
+LICENSE = "BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=7e5ded7363d335e1bb18013ca08046ff"
+
+inherit autotools
+
+DEPENDS += "libevent"
+RDEPENDS_${PN} += "perl perl-module-posix perl-module-autoloader \
+    perl-module-tie-hash bash \
+    "
+
+SRC_URI = "http://www.memcached.org/files/${BP}.tar.gz \
+           file://memcached-add-hugetlbfs-check.patch \
+           "
+SRC_URI[md5sum] = "1e028fbab7288911fcaa5ed2a21817fe"
+SRC_URI[sha256sum] = "773b6bb20bf80223ca6a15d75f570fbab346ad11ec98595e5af5e33f54bd82d8"
+
+# set the same COMPATIBLE_HOST as libhugetlbfs
+COMPATIBLE_HOST = '(i.86|x86_64|powerpc|powerpc64|arm).*-linux'
+
+python __anonymous () {
+    endianness = d.getVar('SITEINFO_ENDIANNESS')
+    if endianness == 'le':
+        d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=little")
+    else:
+        d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=big")
+}
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[hugetlbfs] = "--enable-hugetlbfs, --disable-hugetlbfs, libhugetlbfs"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "memcached"
+INITSCRIPT_PARAMS = "defaults"
+
+do_install_append() {
+    install -D -m 755 ${S}/scripts/memcached-init ${D}${sysconfdir}/init.d/memcached
+    mkdir -p ${D}/usr/share/memcached/scripts
+    install -m 755 ${S}/scripts/memcached-tool ${D}/usr/share/memcached/scripts
+    install -m 755 ${S}/scripts/start-memcached ${D}/usr/share/memcached/scripts
+}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/mtr/mtr_0.86.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/mtr/mtr_0.86.bb
deleted file mode 100644
index 1d8a2cf..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/mtr/mtr_0.86.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "Combined traceroute and ping utility"
-DESCRIPTION = "mtr combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool."
-HOMEPAGE = "http://www.bitwizard.nl/mtr/"
-SECTION = "net"
-DEPENDS = "ncurses"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
-                    file://mtr.c;beginline=5;endline=16;md5=af1fafbbfa1bfd48af839f4bb3221106"
-
-SRC_URI = "ftp://ftp.bitwizard.nl/mtr/mtr-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "8d63592c9d4579ef20cf491b41843eb2"
-SRC_URI[sha256sum] = "c5d948920b641cc35f8b380fc356ddfe07cce6a9c6474afe242fc58113f28c06"
-
-inherit autotools
-
-EXTRA_OECONF = "--without-gtk"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/mtr/mtr_0.87.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/mtr/mtr_0.87.bb
new file mode 100644
index 0000000..9d3275e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/mtr/mtr_0.87.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Combined traceroute and ping utility"
+DESCRIPTION = "mtr combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool."
+HOMEPAGE = "http://www.bitwizard.nl/mtr/"
+SECTION = "net"
+DEPENDS = "ncurses"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://ui/mtr.c;beginline=5;endline=16;md5=af1fafbbfa1bfd48af839f4bb3221106"
+
+PV .= "+git${SRCPV}"
+
+SRCREV = "e6d0a7e93129e8023654ebf58dfa8135d1b1af56"
+SRC_URI = "git://github.com/traviscross/mtr"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--without-gtk"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+PACKAGES += "${PN}-bash-completions"
+
+FILES_${PN}-bash-completions = "${datadir}/bash-completion/"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ncp/libowfat_0.31.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/ncp/libowfat_0.31.bb
new file mode 100644
index 0000000..4b072f7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ncp/libowfat_0.31.bb
@@ -0,0 +1,27 @@
+SUMMARY = "reimplement libdjb"
+DESCRIPTION = "libowfat is a library of general purpose APIs extracted from Dan \
+Bernstein's software (libdjb), reimplemented and covered by the GNU \
+General Public License Version 2 (no later versions)."
+HOMEPAGE = "http://www.fefe.de/libowfat"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+SRC_URI = "https://www.fefe.de/${BPN}/${BP}.tar.xz"
+SRC_URI[md5sum] = "120798fab86cfd72dc6b12284d248dd0"
+SRC_URI[sha256sum] = "d1e4ac1cfccbb7dc51d77d96398e6302d229ba7538158826c84cb4254c7e8a12"
+
+EXTRA_OEMAKE = "\
+    DIET= \
+    CC='${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}' \
+    CCC='${CC}' CFLAGS='${CFLAGS} -I.' CFLAGS_OPT='${CFLAGS} -I.' \
+"
+
+do_install() {
+    make install \
+        DESTDIR=${D} \
+        INCLUDEDIR=${includedir}/${BPN} \
+        LIBDIR=${libdir} \
+        MAN3DIR=${mandir}/man3
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ncp/ncp_1.2.4.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/ncp/ncp_1.2.4.bb
new file mode 100644
index 0000000..f42223b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ncp/ncp_1.2.4.bb
@@ -0,0 +1,31 @@
+SUMMARY = "a fast file copy tool for LANs"
+DESCRIPTION = "ncp is a utility for copying files in a LAN. It has absolutely no \
+security or integrity checking, no throttling, no features, except \
+one: you don't have to type the coordinates of your peer."
+HOMEPAGE = "http://www.fefe.de/ncp"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+DEPENDS = "libowfat"
+
+SRC_URI = "https://dl.fefe.de/${BP}.tar.bz2"
+SRC_URI[md5sum] = "421c4855bd3148b7d0a4342942b4bf13"
+SRC_URI[sha256sum] = "6cfa72edd5f7717bf7a4a93ccc74c4abd89892360e2e0bb095a73c24b9359b88"
+
+EXTRA_OEMAKE = "\
+    DIET= \
+    DEBUG=nostrip \
+    CC='${CC}' CFLAGS='${CFLAGS} -I${STAGING_INCDIR}/libowfat' LDFLAGS='${LDFLAGS}' \
+"
+
+do_install() {
+    install -d -m0755 ${D}${bindir} ${D}${mandir}/man1
+
+    install -m0755 ncp ${D}${bindir}
+    ln -sf ncp ${D}${bindir}/npoll
+    ln -sf ncp ${D}${bindir}/npush
+
+    install -m0644 ncp.1 npush.1 ${D}${mandir}/man1
+    ln -sf npush.1 ${D}${mandir}/man1/npoll.1
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd/0001-bundle-own-base64-encode-decode-functions.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd/0001-bundle-own-base64-encode-decode-functions.patch
new file mode 100644
index 0000000..0966b65
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd/0001-bundle-own-base64-encode-decode-functions.patch
@@ -0,0 +1,379 @@
+From ccd166b73eaae4dd1e1785c63ceb9b303568ed46 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 21 Mar 2017 11:30:49 -0700
+Subject: [PATCH] bundle own base64 encode/decode functions
+
+Not all libc implementations provide it.
+as an aside libresolv is no longer needed
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile |   4 +-
+ base64.c | 313 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ netcat.c |   2 +
+ socks.c  |   3 +
+ 4 files changed, 320 insertions(+), 2 deletions(-)
+ create mode 100644 base64.c
+
+Index: netcat-openbsd-1.105/Makefile
+===================================================================
+--- netcat-openbsd-1.105.orig/Makefile
++++ netcat-openbsd-1.105/Makefile
+@@ -1,9 +1,9 @@
+ #       $OpenBSD: Makefile,v 1.6 2001/09/02 18:45:41 jakob Exp $
+ 
+ PROG=	nc
+-SRCS=	netcat.c atomicio.c socks.c
++SRCS=	netcat.c atomicio.c socks.c base64.c
+ 
+-LIBS=  `pkg-config --libs libbsd` -lresolv
++LIBS=  `pkg-config --libs libbsd`
+ OBJS=  $(SRCS:.c=.o)
+ CFLAGS=  -g -O2
+ LDFLAGS=  -Wl,--no-add-needed
+Index: netcat-openbsd-1.105/base64.c
+===================================================================
+--- /dev/null
++++ netcat-openbsd-1.105/base64.c
+@@ -0,0 +1,313 @@
++/*
++ * Copyright (c) 1996-1999 by Internet Software Consortium.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
++ */
++
++/*
++ * Portions Copyright (c) 1995 by International Business Machines, Inc.
++ *
++ * International Business Machines, Inc. (hereinafter called IBM) grants
++ * permission under its copyrights to use, copy, modify, and distribute this
++ * Software with or without fee, provided that the above copyright notice and
++ * all paragraphs of this notice appear in all copies, and that the name of IBM
++ * not be used in connection with the marketing of any product incorporating
++ * the Software or modifications thereof, without specific, written prior
++ * permission.
++ *
++ * To the extent it has a right to do so, IBM grants an immunity from suit
++ * under its patents, if any, for the use, sale or manufacture of products to
++ * the extent that such products are used for performing Domain Name System
++ * dynamic updates in TCP/IP networks by means of the Software.  No immunity is
++ * granted for any product per se or for any other function of any product.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ * PARTICULAR PURPOSE.  IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
++ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
++ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
++ */
++
++#if !defined(LINT) && !defined(CODECENTER)
++static const char rcsid[] = "$BINDId: base64.c,v 8.7 1999/10/13 16:39:33 vixie Exp $";
++#endif /* not lint */
++
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/socket.h>
++
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <arpa/nameser.h>
++
++#include <ctype.h>
++#include <resolv.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#define Assert(Cond) if (!(Cond)) abort()
++
++static const char Base64[] =
++	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
++static const char Pad64 = '=';
++
++/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
++   The following encoding technique is taken from RFC 1521 by Borenstein
++   and Freed.  It is reproduced here in a slightly edited form for
++   convenience.
++
++   A 65-character subset of US-ASCII is used, enabling 6 bits to be
++   represented per printable character. (The extra 65th character, "=",
++   is used to signify a special processing function.)
++
++   The encoding process represents 24-bit groups of input bits as output
++   strings of 4 encoded characters. Proceeding from left to right, a
++   24-bit input group is formed by concatenating 3 8-bit input groups.
++   These 24 bits are then treated as 4 concatenated 6-bit groups, each
++   of which is translated into a single digit in the base64 alphabet.
++
++   Each 6-bit group is used as an index into an array of 64 printable
++   characters. The character referenced by the index is placed in the
++   output string.
++
++                         Table 1: The Base64 Alphabet
++
++      Value Encoding  Value Encoding  Value Encoding  Value Encoding
++          0 A            17 R            34 i            51 z
++          1 B            18 S            35 j            52 0
++          2 C            19 T            36 k            53 1
++          3 D            20 U            37 l            54 2
++          4 E            21 V            38 m            55 3
++          5 F            22 W            39 n            56 4
++          6 G            23 X            40 o            57 5
++          7 H            24 Y            41 p            58 6
++          8 I            25 Z            42 q            59 7
++          9 J            26 a            43 r            60 8
++         10 K            27 b            44 s            61 9
++         11 L            28 c            45 t            62 +
++         12 M            29 d            46 u            63 /
++         13 N            30 e            47 v
++         14 O            31 f            48 w         (pad) =
++         15 P            32 g            49 x
++         16 Q            33 h            50 y
++
++   Special processing is performed if fewer than 24 bits are available
++   at the end of the data being encoded.  A full encoding quantum is
++   always completed at the end of a quantity.  When fewer than 24 input
++   bits are available in an input group, zero bits are added (on the
++   right) to form an integral number of 6-bit groups.  Padding at the
++   end of the data is performed using the '=' character.
++
++   Since all base64 input is an integral number of octets, only the
++         -------------------------------------------------
++   following cases can arise:
++
++       (1) the final quantum of encoding input is an integral
++           multiple of 24 bits; here, the final unit of encoded
++	   output will be an integral multiple of 4 characters
++	   with no "=" padding,
++       (2) the final quantum of encoding input is exactly 8 bits;
++           here, the final unit of encoded output will be two
++	   characters followed by two "=" padding characters, or
++       (3) the final quantum of encoding input is exactly 16 bits;
++           here, the final unit of encoded output will be three
++	   characters followed by one "=" padding character.
++   */
++
++int
++b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
++	size_t datalength = 0;
++	u_char input[3];
++	u_char output[4];
++	size_t i;
++
++	while (2 < srclength) {
++		input[0] = *src++;
++		input[1] = *src++;
++		input[2] = *src++;
++		srclength -= 3;
++
++		output[0] = input[0] >> 2;
++		output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
++		output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
++		output[3] = input[2] & 0x3f;
++		Assert(output[0] < 64);
++		Assert(output[1] < 64);
++		Assert(output[2] < 64);
++		Assert(output[3] < 64);
++
++		if (datalength + 4 > targsize)
++			return (-1);
++		target[datalength++] = Base64[output[0]];
++		target[datalength++] = Base64[output[1]];
++		target[datalength++] = Base64[output[2]];
++		target[datalength++] = Base64[output[3]];
++	}
++
++	/* Now we worry about padding. */
++	if (0 != srclength) {
++		/* Get what's left. */
++		input[0] = input[1] = input[2] = '\0';
++		for (i = 0; i < srclength; i++)
++			input[i] = *src++;
++
++		output[0] = input[0] >> 2;
++		output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
++		output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
++		Assert(output[0] < 64);
++		Assert(output[1] < 64);
++		Assert(output[2] < 64);
++
++		if (datalength + 4 > targsize)
++			return (-1);
++		target[datalength++] = Base64[output[0]];
++		target[datalength++] = Base64[output[1]];
++		if (srclength == 1)
++			target[datalength++] = Pad64;
++		else
++			target[datalength++] = Base64[output[2]];
++		target[datalength++] = Pad64;
++	}
++	if (datalength >= targsize)
++		return (-1);
++	target[datalength] = '\0';	/* Returned value doesn't count \0. */
++	return (datalength);
++}
++//libresolv_hidden_def (b64_ntop)
++
++/* skips all whitespace anywhere.
++   converts characters, four at a time, starting at (or after)
++   src from base - 64 numbers into three 8 bit bytes in the target area.
++   it returns the number of data bytes stored at the target, or -1 on error.
++ */
++
++int
++b64_pton(char const *src, u_char *target, size_t targsize) {
++	int tarindex, state, ch;
++	char *pos;
++
++	state = 0;
++	tarindex = 0;
++
++	while ((ch = *src++) != '\0') {
++		if (isspace(ch))	/* Skip whitespace anywhere. */
++			continue;
++
++		if (ch == Pad64)
++			break;
++
++		pos = strchr(Base64, ch);
++		if (pos == 0) 		/* A non-base64 character. */
++			return (-1);
++
++		switch (state) {
++		case 0:
++			if (target) {
++				if ((size_t)tarindex >= targsize)
++					return (-1);
++				target[tarindex] = (pos - Base64) << 2;
++			}
++			state = 1;
++			break;
++		case 1:
++			if (target) {
++				if ((size_t)tarindex + 1 >= targsize)
++					return (-1);
++				target[tarindex]   |=  (pos - Base64) >> 4;
++				target[tarindex+1]  = ((pos - Base64) & 0x0f)
++							<< 4 ;
++			}
++			tarindex++;
++			state = 2;
++			break;
++		case 2:
++			if (target) {
++				if ((size_t)tarindex + 1 >= targsize)
++					return (-1);
++				target[tarindex]   |=  (pos - Base64) >> 2;
++				target[tarindex+1]  = ((pos - Base64) & 0x03)
++							<< 6;
++			}
++			tarindex++;
++			state = 3;
++			break;
++		case 3:
++			if (target) {
++				if ((size_t)tarindex >= targsize)
++					return (-1);
++				target[tarindex] |= (pos - Base64);
++			}
++			tarindex++;
++			state = 0;
++			break;
++		default:
++			abort();
++		}
++	}
++
++	/*
++	 * We are done decoding Base-64 chars.  Let's see if we ended
++	 * on a byte boundary, and/or with erroneous trailing characters.
++	 */
++
++	if (ch == Pad64) {		/* We got a pad char. */
++		ch = *src++;		/* Skip it, get next. */
++		switch (state) {
++		case 0:		/* Invalid = in first position */
++		case 1:		/* Invalid = in second position */
++			return (-1);
++
++		case 2:		/* Valid, means one byte of info */
++			/* Skip any number of spaces. */
++			for ((void)NULL; ch != '\0'; ch = *src++)
++				if (!isspace(ch))
++					break;
++			/* Make sure there is another trailing = sign. */
++			if (ch != Pad64)
++				return (-1);
++			ch = *src++;		/* Skip the = */
++			/* Fall through to "single trailing =" case. */
++			/* FALLTHROUGH */
++
++		case 3:		/* Valid, means two bytes of info */
++			/*
++			 * We know this char is an =.  Is there anything but
++			 * whitespace after it?
++			 */
++			for ((void)NULL; ch != '\0'; ch = *src++)
++				if (!isspace(ch))
++					return (-1);
++
++			/*
++			 * Now make sure for cases 2 and 3 that the "extra"
++			 * bits that slopped past the last full byte were
++			 * zeros.  If we don't check them, they become a
++			 * subliminal channel.
++			 */
++			if (target && target[tarindex] != 0)
++				return (-1);
++		}
++	} else {
++		/*
++		 * We ended by seeing the end of the string.  Make sure we
++		 * have no partial bytes lying around.
++		 */
++		if (state != 0)
++			return (-1);
++	}
++
++	return (tarindex);
++}
+Index: netcat-openbsd-1.105/netcat.c
+===================================================================
+--- netcat-openbsd-1.105.orig/netcat.c
++++ netcat-openbsd-1.105/netcat.c
+@@ -169,6 +169,9 @@ static int connect_with_timeout(int fd,
+         socklen_t salen, int ctimeout);
+ static void quit();
+ 
++int	b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize);
++int	b64_pton(char const *src, u_char *target, size_t targsize);
++
+ int
+ main(int argc, char *argv[])
+ {
+Index: netcat-openbsd-1.105/socks.c
+===================================================================
+--- netcat-openbsd-1.105.orig/socks.c
++++ netcat-openbsd-1.105/socks.c
+@@ -53,6 +53,9 @@
+ #define SOCKS_DOMAIN	3
+ #define SOCKS_IPV6	4
+ 
++int	b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize);
++int	b64_pton(char const *src, u_char *target, size_t targsize);
++
+ int	remote_connect(const char *, const char *, struct addrinfo);
+ int	socks_connect(const char *, const char *, struct addrinfo,
+ 	    const char *, const char *, struct addrinfo, int,
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb
index 0afe10c..9d7420f 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb
@@ -2,19 +2,22 @@
 SUMMARY = "OpenBSD Netcat"
 HOMEPAGE = "http://ftp.debian.org"
 LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://../debian/copyright;md5=ee6bbaacb5db5f2973818f0902c3ae6f"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=ee6bbaacb5db5f2973818f0902c3ae6f"
 
 DEPENDS += "glib-2.0 libbsd"
+do_patch[depends] = "quilt-native:do_populate_sysroot"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/n/netcat-openbsd/netcat-openbsd_${PV}.orig.tar.gz;name=netcat \
-           ${DEBIAN_MIRROR}/main/n/netcat-openbsd/netcat-openbsd_${PV}-7.debian.tar.gz;name=netcat-patch"
+           ${DEBIAN_MIRROR}/main/n/netcat-openbsd/netcat-openbsd_${PV}-7.debian.tar.gz;name=netcat-patch;subdir=${BP} \
+           file://0001-bundle-own-base64-encode-decode-functions.patch \
+           "
 
 SRC_URI[netcat.md5sum] = "7e67b22f1ad41a1b7effbb59ff28fca1"
 SRC_URI[netcat.sha256sum] = "40653fe66c1516876b61b07e093d826e2a5463c5d994f1b7e6ce328f3edb211e"
 SRC_URI[netcat-patch.md5sum] = "e914f8eb7eda5c75c679dd77787ac76b"
 SRC_URI[netcat-patch.sha256sum] = "eee759327ffea293e81d0dde67921b7fcfcad279ffd7a2c9d037bbc8f882b363"
 
-S = "${WORKDIR}/${BPN}-${PV}"
+inherit pkgconfig
 
 EXTRA_OEMAKE += "'LDFLAGS=${LDFLAGS}'"
 
@@ -23,9 +26,18 @@
 netcat_do_patch() {
     cd ${S}
     quilt pop -a || true
-    QUILT_PATCHES=${WORKDIR}/debian/patches QUILT_SERIES=${WORKDIR}/debian/patches/series quilt push -a
+    if [ -d ${S}/.pc-netcat ]; then
+            rm -rf ${S}/.pc
+            mv ${S}/.pc-netcat ${S}/.pc
+            QUILT_PATCHES=${S}/debian/patches quilt pop -a
+            rm -rf ${S}/.pc ${S}/debian
+    fi
+    QUILT_PATCHES=${S}/debian/patches quilt push -a
+    mv ${S}/.pc ${S}/.pc-netcat
 }
 
+do_unpack[cleandirs] += "${S}"
+
 python do_patch() {
     bb.build.exec_func('netcat_do_patch', d)
     bb.build.exec_func('patch_do_patch', d)
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat.inc b/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat.inc
index 91a24a1..1544164 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat.inc
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/netcat/netcat.inc
@@ -9,7 +9,7 @@
 capabilities."
 
 SECTION = "net"
-inherit update-alternatives gettext
+inherit update-alternatives gettext pkgconfig
 
 ALTERNATIVE_${PN} = "nc"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/netcf/netcf_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/netcf/netcf_git.bb
index ed713ac..a7a5000 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/netcf/netcf_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/netcf/netcf_git.bb
@@ -20,7 +20,7 @@
 
 EXTRA_OECONF_append_class-target = " --with-driver=redhat"
 
-PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "", d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[systemd] = "--with-sysinit=systemd,--with-sysinit=initscripts,"
 
 do_configure_prepend() {
@@ -47,9 +47,11 @@
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
        install -d ${D}${systemd_unitdir}/system
        if [ -d "${D}${libdir}/systemd/system" ]; then
-           mv ${D}${libdir}/systemd/system/* ${D}${systemd_unitdir}/system/
-           rm -rf ${D}${libdir}/systemd/
-       else
+           if [ "${systemd_unitdir}" != "${libdir}/systemd" ] ; then 
+               mv ${D}${libdir}/systemd/system/* ${D}${systemd_unitdir}/system/
+               rm -rf ${D}${libdir}/systemd/
+	   fi
+       elif [ "${systemd_unitdir}" != "${nonarch_libdir}/systemd" ] ; then 
            mv ${D}${nonarch_libdir}/systemd/system/* ${D}${systemd_unitdir}/system/
            rm -rf ${D}${nonarch_libdir}/systemd/
        fi
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/nis/nis.inc b/import-layers/meta-openembedded/meta-networking/recipes-support/nis/nis.inc
index c4aa10e..e027a1c 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/nis/nis.inc
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/nis/nis.inc
@@ -25,7 +25,7 @@
 # so force the package to be skipped here (this will cause a
 # 'nothing provides' error)
 python () {
-    os = bb.data.getVar("TARGET_OS", d, 1)
+    os = d.getVar("TARGET_OS", True)
     if os == "linux-uclibc":
         raise bb.parse.SkipPackage("NIS functionality requires rpcsvc/yp.h, uClibC does not provide this")
 }
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/nis/yp-tools/0001-lib-yp_all_host.c-Fix-build-with-gcc-7.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/nis/yp-tools/0001-lib-yp_all_host.c-Fix-build-with-gcc-7.patch
new file mode 100644
index 0000000..d1d5f9c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/nis/yp-tools/0001-lib-yp_all_host.c-Fix-build-with-gcc-7.patch
@@ -0,0 +1,33 @@
+From 71fdfdfcea2bfa5f522512366bfcdf95f861ecc6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 23 Apr 2017 23:44:37 -0700
+Subject: [PATCH] lib/yp_all_host.c: Fix build with gcc 7
+
+fixes
+
+| ../../../../../../../workspace/sources/yp-tools/lib/yp_all_host.c: In function 'yp_all_host':
+| ../../../../../../../workspace/sources/yp-tools/lib/yp_all_host.c:109:30: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
+|        inmap == NULL || inmap == '\0')
+|                               ^~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/yp_all_host.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/yp_all_host.c b/lib/yp_all_host.c
+index 59cf236..4a07a7e 100644
+--- a/lib/yp_all_host.c
++++ b/lib/yp_all_host.c
+@@ -106,7 +106,7 @@ yp_all_host (const char *indomain, const char *inmap,
+ 
+   if (hostname == NULL || hostname[0] == '\0' ||
+       indomain == NULL || indomain[0] == '\0' ||
+-      inmap == NULL || inmap == '\0')
++      inmap == NULL || inmap[0] == '\0')
+     return YPERR_BADARGS;
+ 
+   res = YPERR_YPERR;
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/nis/yp-tools_3.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/nis/yp-tools_3.3.bb
index 69217fa..7bd4630 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/nis/yp-tools_3.3.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/nis/yp-tools_3.3.bb
@@ -15,7 +15,8 @@
            file://domainname.service \
            file://yp-tools-ipv4-ipv6-Provide-an-in-place-version-of-mapv4v6addr.patch \
            file://alignment-cheat.patch \
-"
+           file://0001-lib-yp_all_host.c-Fix-build-with-gcc-7.patch \
+           "
 SRC_URI[md5sum] = "acebeecc11a73fb8097503670344834c"
 SRC_URI[sha256sum] = "812be817df3d4c25813552be336c6c6ad5aedaf65611b81af3ad9f98fb3c2e50"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_1.38.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_1.38.bb
index 9fc6406..b9c0aa7 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_1.38.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_1.38.bb
@@ -19,7 +19,7 @@
 HOMEPAGE = "http://www.linux-nis.org/nis/ypbind-mt/index.html"
 DEPENDS = " \
            yp-tools \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+           ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
           "
 RDEPENDS_${PN} += "yp-tools"
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_2.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_2.2.bb
index 82544e7..0b7e504 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_2.2.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_2.2.bb
@@ -15,10 +15,10 @@
 the server which answered as first. \
 "
 HOMEPAGE = "http://www.linux-nis.org/nis/ypbind-mt/index.html"
-DEPENDS = "yp-tools ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+DEPENDS = "yp-tools ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PROVIDES += "ypbind"
 
-PNBLACKLIST[ypbind-mt] ?= "BROKEN: Depends on broken yp-tools"
+PNBLACKLIST[ypbind-mt] ?= "BROKEN: Depends on broken yp-tools - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "http://www.linux-nis.org/download/ypbind-mt/${BP}.tar.bz2 \
            file://ypbind.init \
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ntimed/ntimed_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/ntimed/ntimed_git.bb
index dac5617..527ea33 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/ntimed/ntimed_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ntimed/ntimed_git.bb
@@ -16,6 +16,9 @@
 
 S = "${WORKDIR}/git"
 
+# use adjtimex on musl
+CFLAGS_append_libc-musl = " -Dntp_adjtime=adjtimex"
+
 EXTRA_OEMAKE = "\
     'CC=${CC}' \
     'CFLAGS=${CFLAGS}' \
@@ -23,11 +26,7 @@
 "
 
 do_configure () {
-    sh ./configure
-}
-
-do_compile () {
-    oe_runmake
+    sh ${S}/configure
 }
 
 do_install () {
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p10.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p10.bb
new file mode 100644
index 0000000..719c60b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p10.bb
@@ -0,0 +1,170 @@
+SUMMARY = "Network Time Protocol daemon and utilities"
+DESCRIPTION = "The Network Time Protocol (NTP) is used to \
+synchronize the time of a computer client or server to \
+another server or reference time source, such as a radio \
+or satellite receiver or modem."
+HOMEPAGE = "http://support.ntp.org"
+SECTION = "net"
+LICENSE = "NTP"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=e877a1d567a6a58996d2b66e3e387003"
+
+DEPENDS = "libevent"
+
+SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
+           file://ntp-4.2.4_p6-nano.patch \
+           file://ntpd \
+           file://ntp.conf \
+           file://ntpdate \
+           file://ntpdate.default \
+           file://ntpdate.service \
+           file://ntpd.service \
+           file://sntp.service \
+           file://sntp \
+           file://ntpd.list \
+"
+
+SRC_URI[md5sum] = "745384ed0dedb3f66b33fe84d66466f9"
+SRC_URI[sha256sum] = "ddd2366e64219b9efa0f7438e06800d0db394ac5c88e13c17b70d0dcdf99b99f"
+
+inherit autotools update-rc.d useradd systemd pkgconfig
+
+# The ac_cv_header_readline_history is to stop ntpdc depending on either
+# readline or curses
+EXTRA_OECONF += "--with-net-snmp-config=no \
+                 --without-ntpsnmpd \
+                 ac_cv_header_readline_history_h=no \
+                 --with-yielding_select=yes \
+                 --with-locfile=redhat \
+                 --without-rpath \
+                 "
+CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
+
+USERADD_PACKAGES = "${PN}"
+NTP_USER_HOME ?= "/var/lib/ntp"
+USERADD_PARAM_${PN} = "--system --home-dir ${NTP_USER_HOME} \
+                       --no-create-home \
+                       --shell /bin/false --user-group ntp"
+
+# NB: debug is default-enabled by NTP; keep it default-enabled here.
+PACKAGECONFIG ??= "cap debug refclocks openssl \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
+                          --with-openssl-incdir=${STAGING_INCDIR} \
+                          --with-crypto, \
+                          --without-openssl --without-crypto, \
+                          openssl"
+PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap"
+PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline"
+PACKAGECONFIG[refclocks] = "--enable-all-clocks,--disable-all-clocks,pps-tools"
+PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging"
+PACKAGECONFIG[mdns] = "ac_cv_header_dns_sd_h=yes,ac_cv_header_dns_sd_h=no,mdns"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+do_install_append() {
+    install -d ${D}${sysconfdir}/init.d
+    install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir}
+    install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d
+    install -d ${D}${bindir}
+    install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync
+
+    install -m 755 -d ${D}${NTP_USER_HOME}
+    chown ntp:ntp ${D}${NTP_USER_HOME}
+
+    # Fix hardcoded paths in scripts
+    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
+    sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
+    sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
+    sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
+    sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync
+    sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace
+    sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace
+    sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait
+    sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait
+    sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj
+    sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj
+
+    install -d ${D}/${sysconfdir}/default
+    install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate
+    install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/
+
+    install -d ${D}/${sysconfdir}/network/if-up.d
+    ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d
+
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/
+    install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
+    install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/
+
+    install -d ${D}${systemd_unitdir}/ntp-units.d
+    install -m 0644 ${WORKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list
+
+    # Remove an empty libexecdir.
+    rmdir --ignore-fail-on-non-empty ${D}${libexecdir}
+}
+
+PACKAGES += "ntpdate sntp ${PN}-tickadj ${PN}-utils"
+# NOTE: you don't need ntpdate, use "ntpd -q -g -x"
+
+# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
+# with wonky clocks (e.g. OpenSlug)
+RDEPENDS_${PN} = "${PN}-tickadj"
+# Handle move from bin to utils package
+RPROVIDES_${PN}-utils = "${PN}-bin"
+RREPLACES_${PN}-utils = "${PN}-bin"
+RCONFLICTS_${PN}-utils = "${PN}-bin"
+
+SYSTEMD_PACKAGES = "${PN} ntpdate sntp"
+SYSTEMD_SERVICE_${PN} = "ntpd.service"
+SYSTEMD_SERVICE_ntpdate = "ntpdate.service"
+SYSTEMD_SERVICE_sntp = "sntp.service"
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+
+RPROVIDES_ntpdate += "ntpdate-systemd"
+RREPLACES_ntpdate += "ntpdate-systemd"
+RCONFLICTS_ntpdate += "ntpdate-systemd"
+
+RSUGGESTS_${PN} = "iana-etc"
+
+FILES_${PN} = "${sbindir}/ntpd.ntp ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \
+    ${NTP_USER_HOME} \
+    ${systemd_unitdir}/ntp-units.d/60-ntpd.list ${libexecdir}\
+"
+FILES_${PN}-tickadj = "${sbindir}/tickadj"
+FILES_${PN}-utils = "${sbindir} ${datadir}/ntp/lib"
+RDEPENDS_${PN}-utils += "perl"
+FILES_ntpdate = "${sbindir}/ntpdate \
+    ${sysconfdir}/network/if-up.d/ntpdate-sync \
+    ${bindir}/ntpdate-sync \
+    ${sysconfdir}/default/ntpdate \
+    ${systemd_unitdir}/system/ntpdate.service \
+"
+FILES_sntp = "${sbindir}/sntp \
+              ${sysconfdir}/default/sntp \
+              ${systemd_unitdir}/system/sntp.service \
+             "
+
+CONFFILES_${PN} = "${sysconfdir}/ntp.conf"
+CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate"
+
+INITSCRIPT_NAME = "ntpd"
+# No dependencies, so just go in at the standard level (20)
+INITSCRIPT_PARAMS = "defaults"
+
+pkg_postinst_ntpdate() {
+    if ! grep -q -s ntpdate $D/var/spool/cron/root; then
+        echo "adding crontab"
+        test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron
+        echo "30 * * * *    ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root
+    fi
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "ntpd"
+ALTERNATIVE_LINK_NAME[ntpd] = "${sbindir}/ntpd"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p9.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p9.bb
deleted file mode 100644
index 9d74c96..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p9.bb
+++ /dev/null
@@ -1,170 +0,0 @@
-SUMMARY = "Network Time Protocol daemon and utilities"
-DESCRIPTION = "The Network Time Protocol (NTP) is used to \
-synchronize the time of a computer client or server to \
-another server or reference time source, such as a radio \
-or satellite receiver or modem."
-HOMEPAGE = "http://support.ntp.org"
-SECTION = "net"
-LICENSE = "NTP"
-LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=f41fedb22dffefcbfafecc85b0f79cfa"
-
-DEPENDS = "libevent"
-
-SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
-           file://ntp-4.2.4_p6-nano.patch \
-           file://ntpd \
-           file://ntp.conf \
-           file://ntpdate \
-           file://ntpdate.default \
-           file://ntpdate.service \
-           file://ntpd.service \
-           file://sntp.service \
-           file://sntp \
-           file://ntpd.list \
-"
-
-SRC_URI[md5sum] = "857452b05f5f2e033786f77ade1974ed"
-SRC_URI[sha256sum] = "b724287778e1bac625b447327c9851eedef020517a3545625e9f652a90f30b72"
-
-inherit autotools update-rc.d useradd systemd pkgconfig
-
-# The ac_cv_header_readline_history is to stop ntpdc depending on either
-# readline or curses
-EXTRA_OECONF += "--with-net-snmp-config=no \
-                 --without-ntpsnmpd \
-                 ac_cv_header_readline_history_h=no \
-                 --with-yielding_select=yes \
-                 --with-locfile=redhat \
-                 --without-rpath \
-                 "
-CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
-
-USERADD_PACKAGES = "${PN}"
-NTP_USER_HOME ?= "/var/lib/ntp"
-USERADD_PARAM_${PN} = "--system --home-dir ${NTP_USER_HOME} \
-                       --no-create-home \
-                       --shell /bin/false --user-group ntp"
-
-# NB: debug is default-enabled by NTP; keep it default-enabled here.
-PACKAGECONFIG ??= "cap debug refclocks openssl \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-"
-PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
-                          --with-openssl-incdir=${STAGING_INCDIR} \
-                          --with-crypto, \
-                          --without-openssl --without-crypto, \
-                          openssl"
-PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap"
-PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline"
-PACKAGECONFIG[refclocks] = "--enable-all-clocks,--disable-all-clocks,pps-tools"
-PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging"
-PACKAGECONFIG[mdns] = "ac_cv_header_dns_sd_h=yes,ac_cv_header_dns_sd_h=no,mdns"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
-
-do_install_append() {
-    install -d ${D}${sysconfdir}/init.d
-    install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir}
-    install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d
-    install -d ${D}${bindir}
-    install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync
-
-    install -m 755 -d ${D}${NTP_USER_HOME}
-    chown ntp:ntp ${D}${NTP_USER_HOME}
-
-    # Fix hardcoded paths in scripts
-    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
-    sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
-    sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
-    sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
-    sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync
-    sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace
-    sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace
-    sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait
-    sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait
-    sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj
-    sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj
-
-    install -d ${D}/${sysconfdir}/default
-    install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate
-    install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/
-
-    install -d ${D}/${sysconfdir}/network/if-up.d
-    ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d
-
-    install -d ${D}${systemd_unitdir}/system
-    install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/
-    install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
-    install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/
-
-    install -d ${D}${systemd_unitdir}/ntp-units.d
-    install -m 0644 ${WORKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list
-
-    # Remove an empty libexecdir.
-    rmdir --ignore-fail-on-non-empty ${D}${libexecdir}
-}
-
-PACKAGES += "ntpdate sntp ${PN}-tickadj ${PN}-utils"
-# NOTE: you don't need ntpdate, use "ntpd -q -g -x"
-
-# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
-# with wonky clocks (e.g. OpenSlug)
-RDEPENDS_${PN} = "${PN}-tickadj"
-# Handle move from bin to utils package
-RPROVIDES_${PN}-utils = "${PN}-bin"
-RREPLACES_${PN}-utils = "${PN}-bin"
-RCONFLICTS_${PN}-utils = "${PN}-bin"
-
-SYSTEMD_PACKAGES = "${PN} ntpdate sntp"
-SYSTEMD_SERVICE_${PN} = "ntpd.service"
-SYSTEMD_SERVICE_ntpdate = "ntpdate.service"
-SYSTEMD_SERVICE_sntp = "sntp.service"
-
-RPROVIDES_${PN} += "${PN}-systemd"
-RREPLACES_${PN} += "${PN}-systemd"
-RCONFLICTS_${PN} += "${PN}-systemd"
-
-RPROVIDES_ntpdate += "ntpdate-systemd"
-RREPLACES_ntpdate += "ntpdate-systemd"
-RCONFLICTS_ntpdate += "ntpdate-systemd"
-
-RSUGGESTS_${PN} = "iana-etc"
-
-FILES_${PN} = "${sbindir}/ntpd.ntp ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \
-    ${NTP_USER_HOME} \
-    ${systemd_unitdir}/ntp-units.d/60-ntpd.list ${libexecdir}\
-"
-FILES_${PN}-tickadj = "${sbindir}/tickadj"
-FILES_${PN}-utils = "${sbindir} ${datadir}/ntp/lib"
-RDEPENDS_${PN}-utils += "perl"
-FILES_ntpdate = "${sbindir}/ntpdate \
-    ${sysconfdir}/network/if-up.d/ntpdate-sync \
-    ${bindir}/ntpdate-sync \
-    ${sysconfdir}/default/ntpdate \
-    ${systemd_unitdir}/system/ntpdate.service \
-"
-FILES_sntp = "${sbindir}/sntp \
-              ${sysconfdir}/default/sntp \
-              ${systemd_unitdir}/system/sntp.service \
-             "
-
-CONFFILES_${PN} = "${sysconfdir}/ntp.conf"
-CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate"
-
-INITSCRIPT_NAME = "ntpd"
-# No dependencies, so just go in at the standard level (20)
-INITSCRIPT_PARAMS = "defaults"
-
-pkg_postinst_ntpdate() {
-    if ! grep -q -s ntpdate $D/var/spool/cron/root; then
-        echo "adding crontab"
-        test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron
-        echo "30 * * * *    ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root
-    fi
-}
-
-inherit update-alternatives
-
-ALTERNATIVE_PRIORITY = "100"
-
-ALTERNATIVE_${PN} = "ntpd"
-ALTERNATIVE_LINK_NAME[ntpd] = "${sbindir}/ntpd"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/open-isns/open-isns_0.97.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/open-isns/open-isns_0.97.bb
new file mode 100644
index 0000000..420ef5b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/open-isns/open-isns_0.97.bb
@@ -0,0 +1,36 @@
+# Copyright (C) 2016 Joe MacDonald <joe_macdonald@mentor.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "iSNS daemon and utility programs"
+DESCRIPTION = "This is a partial implementation of RFC4171, the Internet \
+Storage Name Service (iSNS).  The distribution includes the iSNS server, \
+supporting persisten storage of registrations, isnsadm, a command line \
+utility for managing nodes, and isnsdd, a corresponding discovery daemon."
+HOMEPAGE = "http://github.com/gonzoleeman/open-isns/"
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=321bf41f280cf805086dd5a720b37785"
+SECTION = "net"
+
+DEPENDS = "openssl systemd"
+
+SRC_URI = " \
+    git://github.com/open-iscsi/open-isns \
+"
+
+SRCREV ?= "09954404e948e41eb0fce8e28836018b4ce3d20d"
+
+S = "${WORKDIR}/git"
+
+inherit systemd autotools-brokensep distro_features_check
+# depends on systemd
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+EXTRA_OECONF = " --prefix=${prefix} --enable-shared"
+EXTRA_OEMAKE += "SYSTEMDDIR=${D}${systemd_unitdir}/system"
+
+do_install_append () {
+    oe_runmake INCDIR=${D}${includedir}/libisns/ install_hdrs
+    oe_runmake LIBDIR=${D}${libdir} install_lib
+}
+
+FILES_${PN} += "${libdir} ${systemd_unitdir}"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn-volatile.conf b/import-layers/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn-volatile.conf
index 4a3dc4a..1205806 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn-volatile.conf
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn-volatile.conf
@@ -1 +1 @@
-d /var/run/openvpn 0755 root root -
+d @LOCALSTATEDIR@/run/openvpn 0755 root root -
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn_2.3.9.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn_2.3.9.bb
index a3ef765..db510de 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn_2.3.9.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn_2.3.9.bb
@@ -25,7 +25,7 @@
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '--disable-plugin-auth-pam', d)}"
 
 # Explicitly specify IPROUTE to bypass the configure-time check for /sbin/ip on the host.
-EXTRA_OECONF += "IPROUTE=/sbin/ip"
+EXTRA_OECONF += "IPROUTE=${base_sbindir}/ip"
 
 do_install_append() {
     install -d ${D}/${sysconfdir}/init.d
@@ -47,11 +47,10 @@
         install -d ${D}/${localstatedir}
         install -d ${D}/${localstatedir}/lib
         install -d -m 710 ${D}/${localstatedir}/lib/openvpn
-        install -d -m 755 ${D}/${localstatedir}/run/
-        install -d -m 755 ${D}/${localstatedir}/run/openvpn
 
         install -d ${D}${sysconfdir}/tmpfiles.d
         install -m 0644 ${WORKDIR}/openvpn-volatile.conf ${D}${sysconfdir}/tmpfiles.d/openvpn.conf
+        sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${sysconfdir}/tmpfiles.d/openvpn.conf
     fi
 }
 
@@ -61,7 +60,8 @@
 
 FILES_${PN}-dbg += "${libdir}/openvpn/plugins/.debug"
 FILES_${PN} += "${systemd_unitdir}/system/openvpn@.service \
-                /run"
+                ${sysconfdir}/tmpfiles.d \
+               "
 FILES_${PN}-sample += "${systemd_unitdir}/system/openvpn@loopback-server.service \
                        ${systemd_unitdir}/system/openvpn@loopback-client.service \
                        ${sysconfdir}/openvpn/sample/"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-Fix-build-with-format-string-checks.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-Fix-build-with-format-string-checks.patch
new file mode 100644
index 0000000..f8eb3ae
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-Fix-build-with-format-string-checks.patch
@@ -0,0 +1,33 @@
+From 40848547abf592c8d29b85ef1346001514944435 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 10:14:20 -0700
+Subject: [PATCH] Fix build with format string checks
+
+Fixes
+| ruli_addr.c:418:5: error: format not a string literal and no format arguments [-Werror=format-security]
+|      return fprintf(out, inet_ntoa(addr->ipv4));
+|      ^~~~~~
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/ruli_addr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ruli_addr.c b/src/ruli_addr.c
+index 00d5d0d..f1eabae 100644
+--- a/src/ruli_addr.c
++++ b/src/ruli_addr.c
+@@ -415,7 +415,7 @@ int ruli_in_print(FILE *out, const _ruli_addr *addr, int family)
+ {
+   switch (family) {
+   case PF_INET:
+-    return fprintf(out, inet_ntoa(addr->ipv4));
++    return fprintf(out, "%s", inet_ntoa(addr->ipv4));
+ 
+   case PF_INET6:
+     return ruli_inet6_print(out, &addr->ipv6);
+-- 
+2.13.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch
new file mode 100644
index 0000000..9044415
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch
@@ -0,0 +1,35 @@
+From d3fb471f53712e710fb5777b1b0851c46b7be64c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 25 Jun 2017 01:23:03 -0700
+Subject: [PATCH] src/ruli_addr.c: Add missing format string
+
+fixes
+
+| ruli_addr.c: In function 'ruli_in_snprint':
+| ruli_addr.c:491:5: error: format not a string literal and no format arguments [-Werror=format-security]
+|      return snprintf(buf, size, inet_ntoa(addr->ipv4));
+|      ^~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/ruli_addr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ruli_addr.c b/src/ruli_addr.c
+index f1eabae..5f1fd4f 100644
+--- a/src/ruli_addr.c
++++ b/src/ruli_addr.c
+@@ -488,7 +488,7 @@ int ruli_in_snprint(char *buf, size_t size, const _ruli_addr *addr, int family)
+ {
+   switch (family) {
+   case PF_INET:
+-    return snprintf(buf, size, inet_ntoa(addr->ipv4));
++    return snprintf(buf, size, "%s", inet_ntoa(addr->ipv4));
+ 
+   case PF_INET6:
+     return ruli_inet6_snprint(buf, size, &addr->ipv6);    
+-- 
+2.13.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/files/Makefile.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/files/Makefile.patch
new file mode 100644
index 0000000..60789a3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/files/Makefile.patch
@@ -0,0 +1,122 @@
+diff -Naur patch.org/ruli-0.36/Makefile patch.new/ruli-0.36/Makefile 
+--- ruli-0.36/Makefile	2015-09-10 15:14:13.952262350 -0400
++++ ruli-0.36/Makefile	2015-09-10 15:14:38.628261620 -0400
+@@ -7,17 +7,17 @@
+ .PHONY: default
+ default:
+ 	$(MAKE) -C src   
+-	$(MAKE) -C sample 
++#	$(MAKE) -C sample 
+ 
+ .PHONY: clean
+ clean:
+ 	$(MAKE) -C src    clean
+-	$(MAKE) -C sample clean
++#	$(MAKE) -C sample clean
+ 
+ .PHONY: install
+ install:
+ 	$(MAKE) -C src    install
+-	$(MAKE) -C sample install
++#	$(MAKE) -C sample install
+ 
+ .PHONY: dpkg
+ dpkg:
+
+=====================================================================
+
+diff -Naur patch.org/git/src/Makefile patch.new/git/src/Makefile 
+--- ruli-0.36/src/Makefile	2005-06-13 12:34:53.000000000 -0400
++++ ruli-0.36/src/Makefile	2015-09-11 09:46:06.290287347 -0400
+@@ -18,9 +18,9 @@
+ #
+ # Debian packaging likes this: OOP_BASE_DIR = /usr
+ #
+-OOP_BASE_DIR    = /usr/local/oop
+-OOP_INCLUDE_DIR = $(OOP_BASE_DIR)/include
+-OOP_LIB_DIR     = $(OOP_BASE_DIR)/lib
++#OOP_BASE_DIR    = /usr/local/oop
++OOP_INCLUDE_DIR = ${PKG_CONFIG_SYSROOT_DIR}/$(includedir)/
++#OOP_LIB_DIR     = $(OOP_BASE_DIR)/lib
+ 
+ #
+ # INSTALL_BASE_DIR indicates where RULI
+@@ -30,11 +30,11 @@
+ #
+ # Debian packaging likes this: INSTALL_BASE_DIR = $(DESTDIR)/usr
+ #
+-INSTALL_BASE_DIR     = ../install/ruli
+-INSTALL_INCLUDE_DIR  = $(INSTALL_BASE_DIR)/include
+-INSTALL_LIB_DIR      = $(INSTALL_BASE_DIR)/lib
+-INSTALL_MAN_DIR      = $(INSTALL_BASE_DIR)/share/man
+-INSTALL_MAN3_DIR     = $(INSTALL_MAN_DIR)/man3
++#INSTALL_BASE_DIR     = ../install/ruli
++#INSTALL_INCLUDE_DIR  = $(INSTALL_BASE_DIR)/include
++#INSTALL_LIB_DIR      = $(INSTALL_BASE_DIR)/lib
++#INSTALL_MAN_DIR      = $(INSTALL_BASE_DIR)/share/man
++#INSTALL_MAN3_DIR     = $(INSTALL_MAN_DIR)/man3
+ 
+ # SunOS, Linux
+ PLATFORM=$(shell uname)
+@@ -45,7 +45,7 @@
+ 
+ WARN = -pedantic -ansi -Wshadow -Wpointer-arith -Wcast-qual \
+ 	-Wcast-align -Wwrite-strings -Wredundant-decls
+-CC = gcc
++#CC = gcc
+ 
+ # gcc-specific options (not valid for g++)
+ ifeq ($(CC),gcc)
+@@ -58,7 +58,7 @@
+ FLAGS = $(DEBUG) -O2 -pipe -Wall -g -shared -D_REENTRANT \
+         $(DEFINE_SOLARIS) -I. -I$(OOP_INCLUDE_DIR)
+ SOFT_CFLAGS = $(WARN) $(FLAGS)
+-CFLAGS = $(WARN) -Werror $(FLAGS)
++CFLAGS = $(WARN) $(FLAGS)
+ LIBOBJ = ruli_isaac.o ruli_mem.o ruli_rand.o ruli_util.o ruli_list.o \
+ 	ruli_addr.o ruli_sock.o ruli_txt.o ruli_msg.o ruli_fsm.o \
+ 	ruli_res.o ruli_parse.o ruli_host.o ruli_srv.o ruli_conf.o \
+@@ -66,7 +66,7 @@
+ 	ruli_getaddrinfo.o
+ SHAREDOBJ = $(LIBOBJ:%.o=%.os)
+ SONAME = libruli.so.4
+-LDFLAGS = -L$(OOP_LIB_DIR)
++#LDFLAGS = -L$(OOP_LIB_DIR)
+ 
+ COMPILE = $(CC) $(ARCH) $(CPPFLAGS) $(CFLAGS) -c
+ SHARED_COMPILE = $(CC) $(ARCH) $(CPPFLAGS) $(SHARED) $(CFLAGS) -o $@ -c
+@@ -89,19 +89,19 @@
+ strip: ruli
+ 	strip $(SONAME) libruli.a
+ 
+-.PHONY: install
+-install: ruli
+-	mkdir -p $(INSTALL_LIB_DIR) $(INSTALL_INCLUDE_DIR) $(INSTALL_MAN3_DIR)
+-	cp $(SONAME) libruli.a $(INSTALL_LIB_DIR)
+-	cp *.h $(INSTALL_INCLUDE_DIR)
+-	cp ../doc/man/*.3 $(INSTALL_MAN3_DIR)
+-	cd $(INSTALL_LIB_DIR) && ln -s $(SONAME) libruli.so
+-	@echo
+-	@echo "REMINDER:"
+-	@echo "Add $(INSTALL_LIB_DIR) to your dynamic loader path:"
+-	@echo "# echo $(INSTALL_LIB_DIR) >> /etc/ld.so.conf"
+-	@echo "# ldconfig"
+-	@echo
++#.PHONY: install
++#install: ruli
++#	mkdir -p $(INSTALL_LIB_DIR) $(INSTALL_INCLUDE_DIR) $(INSTALL_MAN3_DIR)
++#	cp $(SONAME) libruli.a $(INSTALL_LIB_DIR)
++#	cp *.h $(INSTALL_INCLUDE_DIR)
++#	cp ../doc/man/*.3 $(INSTALL_MAN3_DIR)
++#	cd $(INSTALL_LIB_DIR) && ln -s $(SONAME) libruli.so
++#	@echo
++#	@echo "REMINDER:"
++#	@echo "Add $(INSTALL_LIB_DIR) to your dynamic loader path:"
++#	@echo "# echo $(INSTALL_LIB_DIR) >> /etc/ld.so.conf"
++#	@echo "# ldconfig"
++#	@echo
+ 
+ .PHONY: ruli
+ ruli: $(SONAME) libruli.a
+
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/ruli_0.36.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/ruli_0.36.bb
new file mode 100644
index 0000000..885796d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ruli/ruli_0.36.bb
@@ -0,0 +1,25 @@
+SUMMARY = "RULI stands for Resolver User Layer Interface It's a library	built on top of an asynchronous DNS stub resolver"
+
+HOMEPAGE = "http://www.nongnu.org/ruli/"
+
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+DEPENDS = "liboop"
+
+SRC_URI = "http://download.savannah.gnu.org/releases/ruli/ruli_${PV}.orig.tar.gz \
+           file://Makefile.patch \
+           file://0001-Fix-build-with-format-string-checks.patch \
+           file://0001-src-ruli_addr.c-Add-missing-format-string.patch \
+           "
+
+SRC_URI[md5sum] = "e73fbfdeadddb68a703a70cea5271468"
+SRC_URI[sha256sum] = "11d32def5b514748fbd9ea8c88049ae99e1bb358efc74eb91a4d268a3999dbfa"
+
+do_install1() {
+    install -d ${D}${includedir}/ruli
+    install -d ${D}${libdir}
+    install -m 0644 ${S}/src/ruli*.h ${D}${includedir}/ruli
+    install -m 0644 ${S}/src/libruli.so ${D}${libdir}
+    install -m 0644 ${S}/src/libruli.so.4 ${D}${libdir}
+}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch
new file mode 100644
index 0000000..d53cff2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch
@@ -0,0 +1,17 @@
+help compile when S != B
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: ssmtp-2.64/Makefile.in
+===================================================================
+--- ssmtp-2.64.orig/Makefile.in
++++ ssmtp-2.64/Makefile.in
+@@ -24,7 +24,7 @@ INSTALLED_REVALIASES_FILE=$(REVALIASES_F
+ # Programs
+ GEN_CONFIG=$(srcdir)/generate_config
+ 
+-SRCS=ssmtp.c arpadate.c base64.c xgethostname.c @SRCS@
++SRCS=$(srcdir)/ssmtp.c $(srcdir)/arpadate.c $(srcdir)/base64.c $(srcdir)/xgethostname.c @SRCS@
+ 
+ OBJS=$(SRCS:.c=.o)
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch
new file mode 100644
index 0000000..26d8527
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch
@@ -0,0 +1,74 @@
+Use DESTDIR during  install/uninstall, this helps
+with cross or staged builds. Additionally pass LDFLAGS
+during linking.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+
+Index: ssmtp-2.64/Makefile.in
+===================================================================
+--- ssmtp-2.64.orig/Makefile.in
++++ ssmtp-2.64/Makefile.in
+@@ -46,40 +46,40 @@ all: ssmtp
+ 
+ .PHONY: install
+ install: ssmtp $(GEN_CONFIG)
+-	$(INSTALL) -d -m 755 $(bindir)
+-	$(INSTALL) -s -m 755 ssmtp $(bindir)/ssmtp
+-	$(INSTALL) -d -m 755 $(mandir)
+-	$(INSTALL) -m 644 $(srcdir)/ssmtp.8 $(mandir)/ssmtp.8
+-	$(INSTALL) -d -m 755 $(SSMTPCONFDIR)
+-	$(INSTALL) -m 644 $(srcdir)/revaliases $(INSTALLED_REVALIASES_FILE)
+-	$(GEN_CONFIG) $(INSTALLED_CONFIGURATION_FILE)
++	$(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
++	$(INSTALL) -m 755 ssmtp $(DESTDIR)$(bindir)/ssmtp
++	$(INSTALL) -d -m 755 $(DESTDIR)$(mandir)
++	$(INSTALL) -m 644 $(srcdir)/ssmtp.8 $(DESTDIR)$(mandir)/ssmtp.8
++	$(INSTALL) -d -m 755 $(DESTDIR)$(SSMTPCONFDIR)
++	$(INSTALL) -m 644 $(srcdir)/revaliases $(DESTDIR)$(INSTALLED_REVALIASES_FILE)
++	$(GEN_CONFIG) $(DESTDIR)$(INSTALLED_CONFIGURATION_FILE)
+ 
+ 
+ .PHONY: install-sendmail
+ install-sendmail: install
+-	$(RM) $(bindir)/sendmail
+-	$(LN_S) ssmtp $(bindir)/sendmail
+-	$(INSTALL) -d -m 755 $(libexecdir)
+-	$(RM) $(libexecdir)/sendmail
+-	$(LN_S) sendmail /lib/sendmail
+-	$(RM) $(mandir)/sendmail.8
+-	$(LN_S) ssmtp.8 $(mandir)/sendmail.8
++	$(RM) $(DESTDIR)$(bindir)/sendmail
++	$(LN_S) ssmtp $(DESTDIR)$(bindir)/sendmail
++	$(INSTALL) -d -m 755 $(DESTDIR)$(libexecdir)
++	$(RM) $(DESTDIR)$(libexecdir)/sendmail
++	$(LN_S) sendmail $(DESTDIR)/lib/sendmail
++	$(RM) $(DESTDIR)$(mandir)/sendmail.8
++	$(LN_S) ssmtp.8 $(DESTDIR)$(mandir)/sendmail.8
+ 
+ .PHONY: uninstall
+ uninstall:
+-	$(RM) $(bindir)/ssmtp
+-	$(RM) $(mandir)/ssmtp.8
+-	$(RM) $(CONFIGURATION_FILE) $(REVALIASES_FILE)
+-	$(RM) -r $(SSMTPCONFDIR)
++	$(RM) $(DESTDIR)$(bindir)/ssmtp
++	$(RM) $(DESTDIR)$(mandir)/ssmtp.8
++	$(RM) $(DESTDIR)$(CONFIGURATION_FILE) $(DESTDIR)$(REVALIASES_FILE)
++	$(RM) -r $(DESTDIR)$(SSMTPCONFDIR)
+ 
+ .PHONY: uninstall-sendmail
+ uninstall-sendmail: uninstall
+-	$(RM)  $(bindir)/sendmail /lib/sendmail
+-	$(RM)  $(mandir)/sendmail.8
++	$(RM)  $(DESTDIR)$(bindir)/sendmail $(DESTDIR)/lib/sendmail
++	$(RM)  $(DESTDIR)$(mandir)/sendmail.8
+ 
+ # Binaries:
+ ssmtp: $(OBJS)
+-	$(CC) -o ssmtp $(OBJS) @LIBS@ $(CFLAGS)
++	$(CC) -o ssmtp $(OBJS) @LIBS@ $(CFLAGS) $(LDFLAGS)
+ 
+ .PHONY: clean
+ clean:
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb
new file mode 100644
index 0000000..9d4864d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb
@@ -0,0 +1,31 @@
+SUMMARY = "extremely simple MTA to get mail off the system to a mail hub"
+HOMEPAGE = "http://packages.qa.debian.org/s/ssmtp.html"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e"
+
+SRC_URI = "\
+           ${DEBIAN_MIRROR}/main/s/${BPN}/${BPN}_${PV}.orig.tar.bz2 \
+           file://build-ouside_srcdir.patch \
+           file://use-DESTDIR.patch \
+          "
+
+EXTRA_OECONF += "--mandir=${mandir}"
+
+EXTRA_OEMAKE = "GEN_CONFIG='/bin/true'"
+
+SRC_URI[md5sum] = "65b4e0df4934a6cd08c506cabcbe584f"
+SRC_URI[sha256sum] = "22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36"
+
+inherit autotools pkgconfig
+
+DEPENDS += "openssl inetutils"
+
+do_install_append () {
+    install -d ${D}${mandir}/
+    mv ${D}${exec_prefix}/man/* ${D}${mandir}/
+    rmdir ${D}${exec_prefix}/man
+    ln -s ssmtp ${D}${sbindir}/sendmail
+    ln -s ssmtp ${D}${sbindir}/newaliases
+    ln -s ssmtp ${D}${sbindir}/mailq
+}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/files/install-strongswan-swanctl-service.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/files/install-strongswan-swanctl-service.patch
deleted file mode 100644
index 86baccf..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/files/install-strongswan-swanctl-service.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-commit 44cbabd8a42bc2a436562ed33fb8c89fa6b75b6e
-Author: Chris Patterson <pattersonc@ainfosec.com>
-Date:   Fri Dec 18 08:31:48 2015 -0500
-
-    strongswan-swanctl.service.in: match install used by strongswan.service
-    
-    Signed-off-by: Chris Patterson <pattersonc@ainfosec.com>
-
-Upstream-Status: Submitted
-https://github.com/strongswan/strongswan/pull/25
-
-diff --git a/init/systemd-swanctl/strongswan-swanctl.service.in b/init/systemd-swanctl/strongswan-swanctl.service.in
-index 818d352..944101f 100644
---- a/init/systemd-swanctl/strongswan-swanctl.service.in
-+++ b/init/systemd-swanctl/strongswan-swanctl.service.in
-@@ -7,3 +7,6 @@ Type=notify
- ExecStart=@SBINDIR@/charon-systemd
- ExecStartPost=@SBINDIR@/swanctl --load-all --noprompt
- ExecReload=@SBINDIR@/swanctl --reload
-+
-+[Install]
-+WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/files/support-newer-systemd.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/files/support-newer-systemd.patch
deleted file mode 100644
index 550cf67..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/files/support-newer-systemd.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-commit 82498129e0a91dfc3ed2c4ec3b2252f44655b83c
-Author: Chris Patterson <pattersonc@ainfosec.com>
-Date:   Fri Dec 18 08:27:57 2015 -0500
-
-    configure: support systemd >= 209
-    
-    libsystemd-journal and libsystemd-daemon are now just
-    part of libsystemd.
-    
-    Keep original systemd checks as a fallback.
-    
-    Updates charon-systemd/Makefile.am accordingly.
-    
-    Tested on:
-    - debian wheezy (systemd v44)
-    - ubuntu 15.10 (systemd v255).
-    
-    Signed-off-by: Chris Patterson <pattersonc@ainfosec.com>
-
-Upstream-Status: Submitted
-https://github.com/strongswan/strongswan/pull/24
-
-diff --git a/configure.ac b/configure.ac
-index 3d71ce0..f6c0426 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -941,13 +941,17 @@ if test x$systemd = xtrue; then
- 		AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)])
- 	fi
- 
--	PKG_CHECK_MODULES(systemd_daemon, [libsystemd-daemon])
--	AC_SUBST(systemd_daemon_CFLAGS)
--	AC_SUBST(systemd_daemon_LIBS)
--
--	PKG_CHECK_MODULES(systemd_journal, [libsystemd-journal])
--	AC_SUBST(systemd_journal_CFLAGS)
--	AC_SUBST(systemd_journal_LIBS)
-+	PKG_CHECK_MODULES(systemd, [libsystemd >= 209],
-+		[AC_SUBST(systemd_CFLAGS)
-+		AC_SUBST(systemd_LIBS)],
-+		[PKG_CHECK_MODULES(systemd_daemon, [libsystemd-daemon])
-+		AC_SUBST(systemd_daemon_CFLAGS)
-+		AC_SUBST(systemd_daemon_LIBS)
-+
-+		PKG_CHECK_MODULES(systemd_journal, [libsystemd-journal])
-+		AC_SUBST(systemd_journal_CFLAGS)
-+		AC_SUBST(systemd_journal_LIBS)
-+		])
- fi
- 
- if test x$tss = xtrousers; then
-diff --git a/src/charon-systemd/Makefile.am b/src/charon-systemd/Makefile.am
-index 1b9ac15..ee85d43 100644
---- a/src/charon-systemd/Makefile.am
-+++ b/src/charon-systemd/Makefile.am
-@@ -9,11 +9,11 @@ charon_systemd_CPPFLAGS = \
- 	-I$(top_srcdir)/src/libstrongswan \
- 	-I$(top_srcdir)/src/libhydra \
- 	-I$(top_srcdir)/src/libcharon \
--	$(systemd_daemon_CFLAGS) $(systemd_journal_CFLAGS) \
-+	$(systemd_CFLAGS) $(systemd_daemon_CFLAGS) $(systemd_journal_CFLAGS) \
- 	-DPLUGINS=\""${charon_plugins}\""
- 
- charon_systemd_LDADD = \
- 	$(top_builddir)/src/libstrongswan/libstrongswan.la \
- 	$(top_builddir)/src/libhydra/libhydra.la \
- 	$(top_builddir)/src/libcharon/libcharon.la \
--	$(systemd_daemon_LIBS) $(systemd_journal_LIBS) -lm $(PTHREADLIB) $(DLLIB)
-+	$(systemd_LIBS) $(systemd_daemon_LIBS) $(systemd_journal_LIBS) -lm $(PTHREADLIB) $(DLLIB)
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/strongswan_5.5.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/strongswan_5.5.0.bb
deleted file mode 100644
index 8941cf6..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/strongswan_5.5.0.bb
+++ /dev/null
@@ -1,55 +0,0 @@
-DESCRIPTION = "strongSwan is an OpenSource IPsec implementation for the \
-Linux operating system."
-SUMMARY = "strongSwan is an OpenSource IPsec implementation"
-HOMEPAGE = "http://www.strongswan.org"
-SECTION = "net"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-DEPENDS = "gmp openssl flex-native flex bison-native"
-
-SRC_URI = "http://download.strongswan.org/strongswan-${PV}.tar.bz2 \
-        file://fix-funtion-parameter.patch \
-"
-
-SRC_URI[md5sum] = "a96fa7eb6c62b40143dadb064b6bd586"
-SRC_URI[sha256sum] = "58463998ac6725eac3687e8a20c1f69803c3772657076d06c43386a24b4c8454"
-
-EXTRA_OECONF = " \
-        --without-lib-prefix \
-"
-
-EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
-
-
-PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \
-        ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \
-"
-PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,"
-PACKAGECONFIG[charon] = "--enable-charon,--disable-charon,"
-PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,"
-PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,"
-PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,"
-PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,"
-PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,"
-PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient,"
-PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,"
-PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,"
-PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,"
-PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc"
-
-# requires swanctl
-PACKAGECONFIG[systemd-charon] = "--enable-systemd,--disable-systemd,systemd,"
-
-inherit autotools systemd pkgconfig
-
-RRECOMMENDS_${PN} = "kernel-module-ipsec"
-
-FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS} ${libdir}/ipsec/plugins/*.so"
-FILES_${PN}-dbg += "${libdir}/ipsec/.debug ${libdir}/ipsec/plugins/.debug ${libexecdir}/ipsec/.debug"
-FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la ${libdir}/ipsec/plugins/*.la"
-FILES_${PN}-staticdev += "${libdir}/ipsec/*.a ${libdir}/ipsec/plugins/*.a"
-
-RPROVIDES_${PN} += "${PN}-systemd"
-RREPLACES_${PN} += "${PN}-systemd"
-RCONFLICTS_${PN} += "${PN}-systemd"
-SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'swanctl', '${BPN}-swanctl.service', '${BPN}.service', d)}"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb
new file mode 100644
index 0000000..d63214b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/strongswan/strongswan_5.5.1.bb
@@ -0,0 +1,130 @@
+DESCRIPTION = "strongSwan is an OpenSource IPsec implementation for the \
+Linux operating system."
+SUMMARY = "strongSwan is an OpenSource IPsec implementation"
+HOMEPAGE = "http://www.strongswan.org"
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS = "gmp openssl flex-native flex bison-native"
+
+SRC_URI = "http://download.strongswan.org/strongswan-${PV}.tar.bz2 \
+        file://fix-funtion-parameter.patch \
+"
+
+SRC_URI[md5sum] = "4eba9474f7dc6c8c8d7037261358e68d"
+SRC_URI[sha256sum] = "720b301991f77bdedd8d551a956f52e2d11686a0ec18e832094f86cf2b842ab7"
+
+EXTRA_OECONF = " \
+        --without-lib-prefix \
+"
+
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
+
+
+PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \
+        ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \
+"
+PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,,${PN}-plugin-aesni"
+PACKAGECONFIG[charon] = "--enable-charon,--disable-charon,"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,${PN}-plugin-curl"
+PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp"
+PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,${PN}-plugin-ldap"
+PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,${PN}-plugin-mysql"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,${PN}-plugin-openssl"
+PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient,"
+PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,${PN}-plugin-soup"
+PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,${PN}-plugin-sqlite"
+PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,,${PN}-plugin-stroke"
+PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc"
+
+# requires swanctl
+PACKAGECONFIG[systemd-charon] = "--enable-systemd,--disable-systemd,systemd,"
+
+inherit autotools systemd pkgconfig
+
+RRECOMMENDS_${PN} = "kernel-module-ipsec"
+
+FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS}"
+FILES_${PN}-dbg += "${bindir}/.debug ${libdir}/ipsec/.debug ${libexecdir}/ipsec/.debug"
+FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la"
+FILES_${PN}-staticdev += "${libdir}/ipsec/*.a"
+
+CONFFILES_${PN} = "${sysconfdir}/*.conf ${sysconfdir}/ipsec.d/*.conf ${sysconfdir}/strongswan.d/*.conf"
+
+PACKAGES += "${PN}-plugins"
+ALLOW_EMPTY_${PN}-plugins = "1"
+
+PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
+NOAUTOPACKAGEDEBUG = "1"
+
+python split_strongswan_plugins () {
+    sysconfdir = d.expand('${sysconfdir}/strongswan.d/charon')
+    libdir = d.expand('${libdir}/ipsec/plugins')
+    dbglibdir = os.path.join(libdir, '.debug')
+
+    def add_plugin_conf(f, pkg, file_regex, output_pattern, modulename):
+        dvar = d.getVar('PKGD', True)
+        oldfiles = d.getVar('CONFFILES_' + pkg, True)
+        newfile = '/' + os.path.relpath(f, dvar)
+
+        if not oldfiles:
+            d.setVar('CONFFILES_' + pkg, newfile)
+        else:
+            d.setVar('CONFFILES_' + pkg, oldfiles + " " + newfile)
+
+    split_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.so', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True)
+    do_split_packages(d, sysconfdir, '(.*)\.conf', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True, hook=add_plugin_conf)
+
+    split_dbg_packages = do_split_packages(d, dbglibdir, 'libstrongswan-(.*)\.so', '${PN}-plugin-%s-dbg', 'strongSwan %s plugin - Debugging files', prepend=True, extra_depends='${PN}-dbg')
+    split_dev_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.la', '${PN}-plugin-%s-dev', 'strongSwan %s plugin - Development files', prepend=True, extra_depends='${PN}-dev')
+    split_staticdev_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.a', '${PN}-plugin-%s-staticdev', 'strongSwan %s plugin - Development files (Static Libraries)', prepend=True, extra_depends='${PN}-staticdev')
+
+    if split_packages:
+        pn = d.getVar('PN', True)
+        d.setVar('RRECOMMENDS_' + pn + '-plugins', ' '.join(split_packages))
+        d.appendVar('RRECOMMENDS_' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages))
+        d.appendVar('RRECOMMENDS_' + pn + '-dev', ' ' + ' '.join(split_dev_packages))
+        d.appendVar('RRECOMMENDS_' + pn + '-staticdev', ' ' + ' '.join(split_staticdev_packages))
+}
+
+PACKAGESPLITFUNCS_prepend = "split_strongswan_plugins "
+
+# Install some default plugins based on default strongSwan ./configure options
+# See https://wiki.strongswan.org/projects/strongswan/wiki/Pluginlist
+RDEPENDS_${PN} += "\
+    ${PN}-plugin-aes \
+    ${PN}-plugin-attr \
+    ${PN}-plugin-cmac \
+    ${PN}-plugin-constraints \
+    ${PN}-plugin-des \
+    ${PN}-plugin-dnskey \
+    ${PN}-plugin-hmac \
+    ${PN}-plugin-kernel-netlink \
+    ${PN}-plugin-md5 \
+    ${PN}-plugin-nonce \
+    ${PN}-plugin-pem \
+    ${PN}-plugin-pgp \
+    ${PN}-plugin-pkcs1 \
+    ${PN}-plugin-pkcs7 \
+    ${PN}-plugin-pkcs8 \
+    ${PN}-plugin-pkcs12 \
+    ${PN}-plugin-pubkey \
+    ${PN}-plugin-random \
+    ${PN}-plugin-rc2 \
+    ${PN}-plugin-resolve \
+    ${PN}-plugin-revocation \
+    ${PN}-plugin-sha1 \
+    ${PN}-plugin-sha2 \
+    ${PN}-plugin-socket-default \
+    ${PN}-plugin-sshkey \
+    ${PN}-plugin-updown \
+    ${PN}-plugin-vici \
+    ${PN}-plugin-x509 \
+    ${PN}-plugin-xauth-generic \
+    ${PN}-plugin-xcbc \
+    "
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'swanctl', '${BPN}-swanctl.service', '${BPN}.service', d)}"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/stunnel/stunnel_5.35.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/stunnel/stunnel_5.35.bb
index 51369f4..3e2e2c2 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/stunnel/stunnel_5.35.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/stunnel/stunnel_5.35.bb
@@ -16,8 +16,6 @@
 
 EXTRA_OECONF += "--with-ssl='${STAGING_EXECPREFIXDIR}' --disable-fips"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)}"
 PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.0.bb
deleted file mode 100644
index 43e388c..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.0.bb
+++ /dev/null
@@ -1,52 +0,0 @@
-SUMMARY = "A sophisticated network protocol analyzer"
-HOMEPAGE = "http://www.tcpdump.org/"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867"
-SECTION = "net"
-DEPENDS = "libpcap"
-
-SRC_URI = " \
-    http://www.tcpdump.org/release/${BP}.tar.gz \
-    file://unnecessary-to-check-libpcap.patch \
-    file://tcpdump-configure-dlpi.patch \
-    file://add-ptest.patch \
-    file://run-ptest \
-"
-
-SRC_URI[md5sum] = "2b83364eef53b63ca3181b4eb56dab0c"
-SRC_URI[sha256sum] = "eae98121cbb1c9adbedd9a777bf2eae9fa1c1c676424a54740311c8abcee5a5e"
-
-export LIBS=" -lpcap"
-
-inherit autotools-brokensep ptest
-CACHED_CONFIGUREVARS = "ac_cv_linux_vers=${ac_cv_linux_vers=2}"
-
-PACKAGECONFIG ??= "openssl"
-PACKAGECONFIG[openssl] = "--with-crypto=yes, --without-openssl --without-crypto, openssl"
-PACKAGECONFIG[smi] = "--with-smi, --without-smi,libsmi"
-PACKAGECONFIG[libcap-ng] = "--with-cap-ng=yes,--with-cap-ng=no,libcap-ng"
-
-EXTRA_AUTORECONF += " -I m4"
-
-do_configure_prepend() {
-    mkdir -p ${S}/m4
-    if [ -f aclocal.m4 ]; then
-        mv aclocal.m4 ${S}/m4
-    fi
-    # AC_CHECK_LIB(dlpi.. was looking to host /lib
-    sed -i 's:-L/lib::g' ./configure.in
-}
-do_configure_append() {
-    sed -i 's:-L/usr/lib::' ./Makefile
-    sed -i 's:-Wl,-rpath,${STAGING_LIBDIR}::' ./Makefile
-    sed -i 's:-I/usr/include::' ./Makefile
-}
-
-do_install_append() {
-    # tcpdump 4.0.0 installs a copy to /usr/sbin/tcpdump.4.0.0
-    rm -f ${D}${sbindir}/tcpdump.${PV}
-}
-
-do_compile_ptest() {
-    oe_runmake buildtest-TESTS
-}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb
new file mode 100644
index 0000000..85db693
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb
@@ -0,0 +1,52 @@
+SUMMARY = "A sophisticated network protocol analyzer"
+HOMEPAGE = "http://www.tcpdump.org/"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867"
+SECTION = "net"
+DEPENDS = "libpcap"
+
+SRC_URI = " \
+    http://www.tcpdump.org/release/${BP}.tar.gz \
+    file://unnecessary-to-check-libpcap.patch \
+    file://tcpdump-configure-dlpi.patch \
+    file://add-ptest.patch \
+    file://run-ptest \
+"
+
+SRC_URI[md5sum] = "9bbc1ee33dab61302411b02dd0515576"
+SRC_URI[sha256sum] = "798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79"
+
+export LIBS=" -lpcap"
+
+inherit autotools-brokensep ptest
+CACHED_CONFIGUREVARS = "ac_cv_linux_vers=${ac_cv_linux_vers=2}"
+
+PACKAGECONFIG ??= "openssl"
+PACKAGECONFIG[openssl] = "--with-crypto=yes, --without-openssl --without-crypto, openssl"
+PACKAGECONFIG[smi] = "--with-smi, --without-smi,libsmi"
+PACKAGECONFIG[libcap-ng] = "--with-cap-ng=yes,--with-cap-ng=no,libcap-ng"
+
+EXTRA_AUTORECONF += " -I m4"
+
+do_configure_prepend() {
+    mkdir -p ${S}/m4
+    if [ -f aclocal.m4 ]; then
+        mv aclocal.m4 ${S}/m4
+    fi
+    # AC_CHECK_LIB(dlpi.. was looking to host /lib
+    sed -i 's:-L/lib::g' ./configure.in
+}
+do_configure_append() {
+    sed -i 's:-L/usr/lib::' ./Makefile
+    sed -i 's:-Wl,-rpath,${STAGING_LIBDIR}::' ./Makefile
+    sed -i 's:-I/usr/include::' ./Makefile
+}
+
+do_install_append() {
+    # tcpdump 4.0.0 installs a copy to /usr/sbin/tcpdump.4.0.0
+    rm -f ${D}${sbindir}/tcpdump.${PV}
+}
+
+do_compile_ptest() {
+    oe_runmake buildtest-TESTS
+}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/tcpreplay/tcpreplay_4.1.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/tcpreplay/tcpreplay_4.1.1.bb
deleted file mode 100644
index 389d61b..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/tcpreplay/tcpreplay_4.1.1.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-SUMMARY = "Use previously captured traffic to test network devices"
-
-HOMEPAGE = "http://tcpreplay.synfin.net/"
-SECTION = "net"
-
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=890b830b22fd632e9ffd996df20338f8"
-
-SRC_URI = "http://prdownloads.sourceforge.net/tcpreplay/${PV}/tcpreplay-${PV}.tar.gz \
-           "
-SRC_URI[md5sum] = "80394c33fe697b53b69eac9bb0968ae9"
-SRC_URI[sha256sum] = "61b916ef91049cad2a9ddc8de6f5e3e3cc5d9998dbb644dc91cf3a798497ffe4"
-
-DEPENDS = "libpcap"
-
-EXTRA_OECONF += "--with-libpcap=${STAGING_DIR_HOST}/usr"
-
-inherit siteinfo autotools-brokensep
-
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/tcpreplay/tcpreplay_4.1.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/tcpreplay/tcpreplay_4.1.2.bb
new file mode 100644
index 0000000..6ee9d73
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/tcpreplay/tcpreplay_4.1.2.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Use previously captured traffic to test network devices"
+
+HOMEPAGE = "http://tcpreplay.synfin.net/"
+SECTION = "net"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=890b830b22fd632e9ffd996df20338f8"
+
+SRC_URI = "http://prdownloads.sourceforge.net/tcpreplay/${PV}/tcpreplay-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "3105b10b07dbc0b07ce2da07a2368359"
+SRC_URI[sha256sum] = "da483347e83a9b5df0e0dbb0f822a2d37236e79dda35f4bc4e6684fa827f25ea"
+
+DEPENDS = "libpcap"
+
+EXTRA_OECONF += "--with-libpcap=${STAGING_DIR_HOST}/usr"
+
+inherit siteinfo autotools-brokensep
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/disable-documentation.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/disable-documentation.patch
new file mode 100644
index 0000000..01d0236
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/disable-documentation.patch
@@ -0,0 +1,37 @@
+--- a/configure.ac	2016-01-01 17:42:27.000000000 +0100
++++ b/configure.ac	2017-04-20 14:03:37.238254471 +0200
+@@ -284,24 +284,12 @@
+ AC_SUBST(LIBS)
+ AC_SUBST(ADDITIONAL_OBJECTS)
+ 
+-# Check for asciidoc
+-AC_PATH_PROG(A2X, a2x, no)
+-AM_CONDITIONAL(HAVE_A2X, test "x$A2X" != "xno")
+-if test x"$A2X" = x"no"; then
+-  AC_MSG_ERROR([Test for asciidoc failed. See the file 'INSTALL' for help.])
+-fi
+-
+ AC_CONFIG_FILES([
+ Makefile
+ src/Makefile
+ data/Makefile
+ data/templates/Makefile
+ etc/Makefile
+-docs/Makefile
+-docs/man5/Makefile
+-docs/man5/tinyproxy.conf.txt
+-docs/man8/Makefile
+-docs/man8/tinyproxy.txt
+ m4macros/Makefile
+ tests/Makefile
+ tests/scripts/Makefile
+--- a/Makefile.am	2016-01-01 17:42:27.000000000 +0100
++++ b/Makefile.am	2017-04-20 14:03:53.842822997 +0200
+@@ -2,7 +2,6 @@
+ 	src \
+ 	data \
+ 	etc \
+-	docs \
+ 	m4macros \
+ 	tests
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/tinyproxy.service b/import-layers/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/tinyproxy.service
new file mode 100644
index 0000000..ea079f9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/tinyproxy.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Tinyproxy, Lightweight http(s) proxy daemon
+RequiresMountsFor=/var
+
+[Service]
+Group=tinyproxy
+ExecStartPre=/bin/mkdir -p /var/log/tinyproxy
+ExecStartPre=/bin/chown -R nobody.tinyproxy /var/log/tinyproxy
+ExecStartPre=/bin/mkdir -p /var/run/tinyproxy
+ExecStartPre=/bin/chown -R nobody.tinyproxy /var/run/tinyproxy
+ExecStart=/usr/sbin/tinyproxy -d
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy_1.8.4.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy_1.8.4.bb
new file mode 100644
index 0000000..e8025c4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy_1.8.4.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Lightweight http(s) proxy daemon"
+HOMEPAGE = "https://tinyproxy.github.io/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.gz \
+		   file://disable-documentation.patch \
+		   file://tinyproxy.service"
+
+SRC_URI[md5sum] = "3b60f7d08e0821ed1a3e2cf1e5778cac"
+SRC_URI[sha256sum] = "8234c879a129feee61efa98bac14a1a3e46e5cf08f01696a216940872aa70faf"
+
+EXTRA_OECONF += " \
+	--enable-filter \
+	--enable-transparent \
+	--disable-regexcheck \
+	--enable-reverse \
+	--enable-upstream \
+	--enable-xtinyproxy \
+	"
+
+inherit autotools systemd useradd
+
+#User specific
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "nobody"
+GROUPADD_PARAM_${PN} = "--system tinyproxy"
+
+SYSTEMD_PACKAGES += "${BPN}"
+SYSTEMD_SERVICE_${PN} = "tinyproxy.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "enable"
+
+do_install_append() {
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		install -d ${D}${systemd_system_unitdir}
+		install -m 0644 ${WORKDIR}/tinyproxy.service ${D}${systemd_system_unitdir}
+	fi
+}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/tnftp/tnftp_20151004.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/tnftp/tnftp_20151004.bb
index 8c2c111..83ad11b 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/tnftp/tnftp_20151004.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/tnftp/tnftp_20151004.bb
@@ -33,7 +33,7 @@
 SRC_URI[sha256sum] = "c94a8a49d3f4aec1965feea831d4d5bf6f90c65fd8381ee0863d11a5029a43a0"
 
 PACKAGECONFIG ?= "openssl \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
 "
 PACKAGECONFIG[openssl] = "--enable-ssl, --disable-ssl --with-ssl=no, openssl"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/traceroute/traceroute_2.1.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/traceroute/traceroute_2.1.0.bb
index 48a0c12..8f17d3f 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/traceroute/traceroute_2.1.0.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/traceroute/traceroute_2.1.0.bb
@@ -33,10 +33,10 @@
 
     install -m755 wrappers/tcptraceroute ${D}${bindir}
 
-    install -d ${D}${mandir}
-    install -p -m644 ${BPN}/${BPN}.8 ${D}${mandir}
-    ln -s ${BPN}.8 ${D}${mandir}/${BPN}6.8
-    ln -s ${BPN}.8 ${D}${mandir}/tcptraceroute.8
+    install -d ${D}${mandir}/man8
+    install -p -m644 ${BPN}/${BPN}.8 ${D}${mandir}/man8
+    ln -s ${BPN}.8 ${D}${mandir}/man8/${BPN}6.8
+    ln -s ${BPN}.8 ${D}${mandir}/man8/tcptraceroute.8
 
 }
 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/uftp/uftp_4.9.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/uftp/uftp_4.9.3.bb
new file mode 100644
index 0000000..1166f9a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/uftp/uftp_4.9.3.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "Encrypted UDP based FTP with multicast"
+HOMEPAGE = "https://sourceforge.net/projects/uftp-multicast"
+SECTION = "libs/network"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/uftp-multicast/source-tar/uftp-${PV}.tar.gz"
+SRC_URI[md5sum] = "231d6ba7820d89a712fe7d727ab0f8e6"
+SRC_URI[sha256sum] = "9e9215af0315257c6cc4f40fbc6161057e861be1fff10a38a5564f699e99c78f"
+
+DEPENDS = "openssl"
+
+do_install () {
+	oe_runmake install DESTDIR=${D}
+}
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/wireshark/files/Do-not-set-CC_FOR_BUILD-flags.patch b/import-layers/meta-openembedded/meta-networking/recipes-support/wireshark/files/Do-not-set-CC_FOR_BUILD-flags.patch
deleted file mode 100644
index 64a08ad..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/wireshark/files/Do-not-set-CC_FOR_BUILD-flags.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-[PATCH] Do not set CC_FOR_BUILD flags
-
-Upstream-status: Pending
-
-AC_WIRESHARK_COMPILER_FLAGS_CHECK() is checking which options CC is supported,
-and put the supported options into CFLAGS, but it should not put them into 
-CFLAGS_FOR_BUILD. since CC and BUILD_CC can be different, CFLAGS_FOR_BUILD is
-used by BUILD_CC 
-
-BUILD_CC is used to generated host tools, do not use the gcc's optimised options,
-do not effect the running of host tools. so do not set CC_FOR_BUILD flags.
-
-Signed-off-by: Roy.Li <rongqing.li@windriver.com>
----
- acinclude.m4 | 8 --------
- 1 file changed, 8 deletions(-)
-
-diff --git a/acinclude.m4 b/acinclude.m4
-index 136fc27..8d3d360 100644
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -1755,10 +1755,6 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
-               # just the new option.
-               #
-               CFLAGS="$CFLAGS_saved $GCC_OPTION"
--              #
--              # Add it to the flags we use when building build tools.
--              #
--              CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD $GCC_OPTION"
-             ],
-             [
-               AC_MSG_RESULT(yes)
-@@ -1771,10 +1767,6 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
-           # just the new option.
-           #
-           CFLAGS="$CFLAGS_saved $GCC_OPTION"
--          #
--          # Add it to the flags we use when building build tools.
--          #
--          CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD $GCC_OPTION"
-         fi
-       ],
-       [
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/wireshark/wireshark_2.2.4.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/wireshark/wireshark_2.2.4.bb
deleted file mode 100644
index 29dfbfe..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-support/wireshark/wireshark_2.2.4.bb
+++ /dev/null
@@ -1,71 +0,0 @@
-DESCRIPTION = "wireshark - a popular network protocol analyzer"
-HOMEPAGE = "http://www.wireshark.org"
-SECTION = "net"
-LICENSE = "GPL-2.0"
-LIC_FILES_CHKSUM = "file://README.linux;md5=631e077455b7972172eb149195e065b0"
-
-DEPENDS = "pcre expat glib-2.0 glib-2.0-native"
-
-SRC_URI = "https://2.na.dl.wireshark.org/src/all-versions/${BP}.tar.bz2"
-
-PE = "1"
-
-SRC_URI[md5sum] = "6d0878ba931ea379f6e675d4cba6536b"
-SRC_URI[sha256sum] = "42a7fb35eed5a32478153e24601a284bb50148b7ba919c3e8452652f4c2a3911"
-
-inherit autotools pkgconfig perlnative
-
-ARM_INSTRUCTION_SET = "arm"
-
-PACKAGECONFIG ?= "libpcap gnutls libnl libcap sbc"
-PACKAGECONFIG += " ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk2 graphics", "", d)}"
-#PACKAGECONFIG += " ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "gtk3", "", d)}"
-
-PACKAGECONFIG[libcap] = "--with-libcap=${STAGING_LIBDIR}, --with-libcap=no --enable-pcap-ng-default , libcap"
-PACKAGECONFIG[libpcap] = "--with-pcap=${STAGING_LIBDIR} --with-pcap-remote, --with-pcap=no --enable-pcap-ng-default  , libpcap"
-PACKAGECONFIG[libsmi] = "--with-libsmi=yes, --with-libsmi=no, libsmi"
-PACKAGECONFIG[libnl] = "--with-libnl=yes, --with-libnl=no, libnl"
-PACKAGECONFIG[portaudio] = "--with-portaudio=yes, --with-portaudio=no, portaudio-v19"
-PACKAGECONFIG[gtk2] = "--with-gtk=2, , gtk+"
-PACKAGECONFIG[gtk3] = "--with-gtk=3, , gtk+3"
-PACKAGECONFIG[graphics] = "--enable-wireshark, --with-gtk=no --disable-wireshark,"
-PACKAGECONFIG[gnutls] = "--with-gnutls=yes, --with-gnutls=no, gnutls"
-PACKAGECONFIG[gcrypt] = "--with-gcrypt=yes, --with-gcrypt=no, libgcrypt"
-PACKAGECONFIG[ssl] = "--with-ssl=yes, --with-ssl=no, openssl"
-PACKAGECONFIG[krb5] = "--with-krb5=yes, --with-krb5=no, krb5"
-PACKAGECONFIG[lua] = "--with-lua=yes, --with-lua=no, lua"
-PACKAGECONFIG[zlib] = "--with-zlib=yes, --with-zlib=no, zlib"
-PACKAGECONFIG[geoip] = "--with-geoip=yes, --with-geoip=no, geoip"
-PACKAGECONFIG[plugins] = "--with-plugins=yes, --with-plugins=no"
-PACKAGECONFIG[sbc] = "--with-sbc=yes, --with-sbc=no, sbc"
-
-PACKAGECONFIG[libssh] = "--with-ssh=yes, --with-ssh=no, libssh2"
-
-
-# these next two options require addional layers
-PACKAGECONFIG[c-ares] = "--with-c-ares=yes, --with-c-ares=no, c-ares"
-
-EXTRA_OECONF += "--with-qt=no --enable-tshark --enable-rawshark"
-
-# Currently wireshark does not install header files
-do_install_append () {
-
-	install -d ${D}/${includedir}/${BPN}
-	install -d ${D}/${includedir}/${BPN}/epan
-	install -d ${D}/${includedir}/${BPN}/epan/crypt
-	install -d ${D}/${includedir}/${BPN}/epan/dfilter
-	install -d ${D}/${includedir}/${BPN}/epan/dissectors
-	install -d ${D}/${includedir}/${BPN}/epan/ftypes
-	install -d ${D}/${includedir}/${BPN}/epan/wmem
-
-	install config.h ${D}/${includedir}/${BPN}
-	install ${S}/register.h ${D}/${includedir}/${BPN}
-	install -D ${S}/epan/*.h ${D}/${includedir}/${BPN}/epan
-	install -D ${S}/epan/crypt/*.h ${D}/${includedir}/${BPN}/epan/crypt
-	install -D ${S}/epan/dfilter/*.h ${D}/${includedir}/${BPN}/epan/dfilter
-	install -D ${S}/epan/dissectors/*.h ${D}/${includedir}/${BPN}/epan/dissectors
-	install -D ${S}/epan/ftypes/*.h ${D}/${includedir}/${BPN}/epan/ftypes
-	install -D ${S}/epan/wmem/*.h ${D}/${includedir}/${BPN}/epan/wmem
-}
-
-FILES_${PN} += "${datadir}*"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-support/wireshark/wireshark_2.2.9.bb b/import-layers/meta-openembedded/meta-networking/recipes-support/wireshark/wireshark_2.2.9.bb
new file mode 100644
index 0000000..82c25ff
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-support/wireshark/wireshark_2.2.9.bb
@@ -0,0 +1,71 @@
+DESCRIPTION = "wireshark - a popular network protocol analyzer"
+HOMEPAGE = "http://www.wireshark.org"
+SECTION = "net"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6e271234ba1a13c6e512e76b94ac2f77"
+
+DEPENDS = "pcre expat glib-2.0 glib-2.0-native"
+
+SRC_URI = "https://2.na.dl.wireshark.org/src/all-versions/${BP}.tar.bz2"
+
+PE = "1"
+
+SRC_URI[md5sum] = "7d5e65efd0714bd6248aa5b36c28320d"
+SRC_URI[sha256sum] = "c8b32c0e7d44a277e737c53d9d142ad3fe4265338f25a7fd8c891f58a7633fc2"
+
+inherit autotools pkgconfig perlnative
+
+ARM_INSTRUCTION_SET = "arm"
+
+PACKAGECONFIG ?= "libpcap gnutls libnl libcap sbc"
+PACKAGECONFIG += " ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk2 graphics", "", d)}"
+#PACKAGECONFIG += " ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "gtk3", "", d)}"
+
+PACKAGECONFIG[libcap] = "--with-libcap=${STAGING_LIBDIR}, --with-libcap=no --enable-pcap-ng-default , libcap"
+PACKAGECONFIG[libpcap] = "--with-pcap=${STAGING_LIBDIR} --with-pcap-remote, --with-pcap=no --enable-pcap-ng-default  , libpcap"
+PACKAGECONFIG[libsmi] = "--with-libsmi=yes, --with-libsmi=no, libsmi"
+PACKAGECONFIG[libnl] = "--with-libnl=yes, --with-libnl=no, libnl"
+PACKAGECONFIG[portaudio] = "--with-portaudio=yes, --with-portaudio=no, portaudio-v19"
+PACKAGECONFIG[gtk2] = "--with-gtk=2, , gtk+"
+PACKAGECONFIG[gtk3] = "--with-gtk=3, , gtk+3"
+PACKAGECONFIG[graphics] = "--enable-wireshark, --with-gtk=no --disable-wireshark,"
+PACKAGECONFIG[gnutls] = "--with-gnutls=yes, --with-gnutls=no, gnutls"
+PACKAGECONFIG[gcrypt] = "--with-gcrypt=yes, --with-gcrypt=no, libgcrypt"
+PACKAGECONFIG[ssl] = "--with-ssl=yes, --with-ssl=no, openssl"
+PACKAGECONFIG[krb5] = "--with-krb5=yes, --with-krb5=no, krb5"
+PACKAGECONFIG[lua] = "--with-lua=yes, --with-lua=no, lua"
+PACKAGECONFIG[zlib] = "--with-zlib=yes, --with-zlib=no, zlib"
+PACKAGECONFIG[geoip] = "--with-geoip=yes, --with-geoip=no, geoip"
+PACKAGECONFIG[plugins] = "--with-plugins=yes, --with-plugins=no"
+PACKAGECONFIG[sbc] = "--with-sbc=yes, --with-sbc=no, sbc"
+
+PACKAGECONFIG[libssh] = "--with-ssh=yes, --with-ssh=no, libssh2"
+
+
+# these next two options require addional layers
+PACKAGECONFIG[c-ares] = "--with-c-ares=yes, --with-c-ares=no, c-ares"
+
+EXTRA_OECONF += "--with-qt=no --enable-tshark --enable-rawshark"
+
+# Currently wireshark does not install header files
+do_install_append () {
+
+	install -d ${D}/${includedir}/${BPN}
+	install -d ${D}/${includedir}/${BPN}/epan
+	install -d ${D}/${includedir}/${BPN}/epan/crypt
+	install -d ${D}/${includedir}/${BPN}/epan/dfilter
+	install -d ${D}/${includedir}/${BPN}/epan/dissectors
+	install -d ${D}/${includedir}/${BPN}/epan/ftypes
+	install -d ${D}/${includedir}/${BPN}/epan/wmem
+
+	install config.h ${D}/${includedir}/${BPN}
+	install ${S}/register.h ${D}/${includedir}/${BPN}
+	install -D ${S}/epan/*.h ${D}/${includedir}/${BPN}/epan
+	install -D ${S}/epan/crypt/*.h ${D}/${includedir}/${BPN}/epan/crypt
+	install -D ${S}/epan/dfilter/*.h ${D}/${includedir}/${BPN}/epan/dfilter
+	install -D ${S}/epan/dissectors/*.h ${D}/${includedir}/${BPN}/epan/dissectors
+	install -D ${S}/epan/ftypes/*.h ${D}/${includedir}/${BPN}/epan/ftypes
+	install -D ${S}/epan/wmem/*.h ${D}/${includedir}/${BPN}/epan/wmem
+}
+
+FILES_${PN} += "${datadir}*"
diff --git a/import-layers/meta-openembedded/meta-oe/README b/import-layers/meta-openembedded/meta-oe/README
index a4fc10e..fdc5640 100644
--- a/import-layers/meta-openembedded/meta-oe/README
+++ b/import-layers/meta-openembedded/meta-oe/README
@@ -1,16 +1,15 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: morty
+branch: pyro
 revision: HEAD
 
-Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-oe]' in the subject'
+Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-oe][pyro]' in the subject'
 
 When sending single patches, please use something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-oe][morty][PATCH'
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-oe][pyro][PATCH'
 
 You are encouraged to fork the mirror on github https://github.com/openembedded/meta-oe/ to share your patches, this is preferred for patch sets consisting of more than one patch. Other services like gitorious, repo.or.cz or self hosted setups are of course accepted as well, 'git fetch <remote>' works the same on all of them. We recommend github because it is free, easy to use, has been proven to be reliable and has a really good web GUI.
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
-
diff --git a/import-layers/meta-openembedded/meta-oe/classes/breakpad.bbclass b/import-layers/meta-openembedded/meta-oe/classes/breakpad.bbclass
index b3abf27..36f11ff 100644
--- a/import-layers/meta-openembedded/meta-oe/classes/breakpad.bbclass
+++ b/import-layers/meta-openembedded/meta-oe/classes/breakpad.bbclass
@@ -10,11 +10,11 @@
 BREAKPAD_BIN ?= ""
 
 python () {
-    breakpad_bin = d.getVar("BREAKPAD_BIN", True)
+    breakpad_bin = d.getVar("BREAKPAD_BIN")
 
     if not breakpad_bin:
-       PN = d.getVar("PN", True)
-       FILE = os.path.basename(d.getVar("FILE", True))
+       PN = d.getVar("PN")
+       FILE = os.path.basename(d.getVar("FILE"))
        bb.error("To build %s, see breakpad.bbclass for instructions on \
                  setting up your Breakpad configuration" % PN)
        raise ValueError('BREAKPAD_BIN not defined in %s' % PN)
diff --git a/import-layers/meta-openembedded/meta-oe/classes/gitpkgv.bbclass b/import-layers/meta-openembedded/meta-oe/classes/gitpkgv.bbclass
index 8cd4bfd..2d9680a 100644
--- a/import-layers/meta-openembedded/meta-oe/classes/gitpkgv.bbclass
+++ b/import-layers/meta-openembedded/meta-oe/classes/gitpkgv.bbclass
@@ -52,14 +52,14 @@
     import bb
     from pipes import quote
 
-    src_uri = d.getVar('SRC_URI', 1).split()
+    src_uri = d.getVar('SRC_URI').split()
     fetcher = bb.fetch2.Fetch(src_uri, d)
     ud = fetcher.ud
 
     #
     # If SRCREV_FORMAT is set respect it for tags
     #
-    format = d.getVar('SRCREV_FORMAT', True)
+    format = d.getVar('SRCREV_FORMAT')
     if not format:
         names = []
         for url in ud.values():
@@ -110,9 +110,9 @@
                             d, quiet=True).strip()
                         ver = gitpkgv_drop_tag_prefix(output)
                     except Exception:
-                        ver = "0.0-%s-g%s" % (commits, rev[:7])
+                        ver = "0.0-%s-g%s" % (commits, vars['rev'][:7])
                 else:
-                    ver = "%s+%s" % (commits, rev[:7])
+                    ver = "%s+%s" % (commits, vars['rev'][:7])
 
                 format = format.replace(name, ver)
 
diff --git a/import-layers/meta-openembedded/meta-oe/classes/gitver.bbclass b/import-layers/meta-openembedded/meta-oe/classes/gitver.bbclass
index 9154143..380374a 100644
--- a/import-layers/meta-openembedded/meta-oe/classes/gitver.bbclass
+++ b/import-layers/meta-openembedded/meta-oe/classes/gitver.bbclass
@@ -23,7 +23,7 @@
 def get_git_pv(d, tagadjust=None):
     import os
 
-    srcdir = d.getVar("EXTERNALSRC", True) or d.getVar("S", True)
+    srcdir = d.getVar("EXTERNALSRC") or d.getVar("S")
     gitdir = os.path.abspath(os.path.join(srcdir, ".git"))
     try:
         ver = gitrev_run("git describe --tags", gitdir)
@@ -45,11 +45,11 @@
 def get_git_hash(d):
     import os
 
-    srcdir = d.getVar("EXTERNALSRC", True) or d.getVar("S", True)
+    srcdir = d.getVar("EXTERNALSRC") or d.getVar("S")
     gitdir = os.path.abspath(os.path.join(srcdir, ".git"))
     try:
-        return gitrev_run("git rev-parse HEAD", gitdir)
-
+        rev = gitrev_run("git rev-list HEAD -1")
+        return rev[:7]
     except Exception as exc:
         bb.fatal(str(exc))
 
@@ -79,6 +79,6 @@
         mark_dependency(d, tagdir)
 
 python () {
-    srcdir = d.getVar("EXTERNALSRC", True) or d.getVar("S", True)
+    srcdir = d.getVar("EXTERNALSRC") or d.getVar("S")
     mark_recipe_dependencies(srcdir, d)
 }
diff --git a/import-layers/meta-openembedded/meta-oe/classes/machine_kernel_pr.bbclass b/import-layers/meta-openembedded/meta-oe/classes/machine_kernel_pr.bbclass
index 463b64d..e48bd01 100644
--- a/import-layers/meta-openembedded/meta-oe/classes/machine_kernel_pr.bbclass
+++ b/import-layers/meta-openembedded/meta-oe/classes/machine_kernel_pr.bbclass
@@ -1,6 +1,6 @@
 python __anonymous () {
 
-    machine_kernel_pr = d.getVar('MACHINE_KERNEL_PR', True)
+    machine_kernel_pr = d.getVar('MACHINE_KERNEL_PR')
 
     if machine_kernel_pr:
         d.setVar('PR', machine_kernel_pr)
diff --git a/import-layers/meta-openembedded/meta-oe/classes/meson.bbclass b/import-layers/meta-openembedded/meta-oe/classes/meson.bbclass
new file mode 100644
index 0000000..c33174a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/classes/meson.bbclass
@@ -0,0 +1,100 @@
+inherit python3native
+
+DEPENDS_append = " meson-native ninja-native"
+
+# As Meson enforces out-of-tree builds we can just use cleandirs
+B = "${WORKDIR}/build"
+do_configure[cleandirs] = "${B}"
+
+# Where the meson.build build configuration is
+MESON_SOURCEPATH = "${S}"
+
+# These variables in the environment override the *native* tools, not the cross.
+export CC = "${BUILD_CC}"
+export CXX = "${BUILD_CXX}"
+export LD = "${BUILD_LD}"
+export AR = "${BUILD_AR}"
+
+def noprefix(var, d):
+    return d.getVar(var, True).replace(d.getVar('prefix', True) + '/', '', 1)
+
+MESONOPTS = " --prefix ${prefix} \
+              --bindir ${@noprefix('bindir', d)} \
+              --sbindir ${@noprefix('sbindir', d)} \
+              --datadir ${@noprefix('datadir', d)} \
+              --libdir ${@noprefix('libdir', d)} \
+              --libexecdir ${@noprefix('libexecdir', d)} \
+              --includedir ${@noprefix('includedir', d)} \
+              --mandir ${@noprefix('mandir', d)} \
+              --infodir ${@noprefix('infodir', d)} \
+              --localedir ${@noprefix('localedir', d)} \
+              --sysconfdir ${sysconfdir} \
+              --localstatedir ${localstatedir} \
+              --sharedstatedir ${sharedstatedir}"
+
+MESON_C_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+
+MESON_HOST_ENDIAN = "${@bb.utils.contains('SITEINFO_ENDIANNESS', 'be', 'big', 'little', d)}"
+MESON_TARGET_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'big', 'little', d)}"
+
+EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}"
+
+MESON_CROSS_FILE = ""
+MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
+
+def meson_array(var, d):
+    return "', '".join(d.getVar(var, True).split()).join(("'", "'"))
+
+addtask write_config before do_configure
+do_write_config[vardeps] += "MESON_C_ARGS TOOLCHAIN_OPTIONS"
+do_write_config() {
+    # This needs to be Py to split the args into single-element lists
+    cat >${WORKDIR}/meson.cross <<EOF
+[binaries]
+c = '${HOST_PREFIX}gcc'
+cpp = '${HOST_PREFIX}g++'
+ar = '${HOST_PREFIX}ar'
+ld = '${HOST_PREFIX}ld'
+strip = '${HOST_PREFIX}strip'
+readelf = '${HOST_PREFIX}readelf'
+pkgconfig = 'pkg-config'
+
+[properties]
+c_args = [${@meson_array('MESON_C_ARGS', d)}]
+cpp_args = [${@meson_array('TOOLCHAIN_OPTIONS', d)}]
+c_link_args = [${@meson_array('TOOLCHAIN_OPTIONS', d)}]
+cpp_link_args = [${@meson_array('TOOLCHAIN_OPTIONS', d)}]
+
+[host_machine]
+system = '${HOST_OS}'
+cpu_family = '${HOST_ARCH}'
+cpu = '${HOST_ARCH}'
+endian = '${MESON_HOST_ENDIAN}'
+
+[target_machine]
+system = '${TARGET_OS}'
+cpu_family = '${TARGET_ARCH}'
+cpu = '${TARGET_ARCH}'
+endian = '${MESON_TARGET_ENDIAN}'
+EOF
+}
+
+CONFIGURE_FILES = "meson.build"
+
+meson_do_configure() {
+    if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" ${MESON_CROSS_FILE} ${EXTRA_OEMESON}; then
+        cat ${B}/meson-logs/meson-log.txt
+        bbfatal_log meson failed
+    fi
+}
+
+do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"
+meson_do_compile() {
+    ninja ${PARALLEL_MAKE}
+}
+
+meson_do_install() {
+    DESTDIR='${D}' ninja ${PARALLEL_MAKEINST} install
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
diff --git a/import-layers/meta-openembedded/meta-oe/classes/socorro-syms.bbclass b/import-layers/meta-openembedded/meta-oe/classes/socorro-syms.bbclass
index 3f6ae63..cc435ab 100644
--- a/import-layers/meta-openembedded/meta-oe/classes/socorro-syms.bbclass
+++ b/import-layers/meta-openembedded/meta-oe/classes/socorro-syms.bbclass
@@ -21,10 +21,10 @@
 
 python symbol_file_preprocess() {
 
-    package_dir = d.getVar("PKGD", True)
-    breakpad_bin = d.getVar("BREAKPAD_BIN", True)
+    package_dir = d.getVar("PKGD")
+    breakpad_bin = d.getVar("BREAKPAD_BIN")
     if not breakpad_bin:
-        package_name = d.getVar("PN", True)
+        package_name = d.getVar("PN")
         bb.error("Package %s depends on Breakpad via socorro-syms. See "
             "breakpad.bbclass for instructions on setting up the Breakpad "
             "configuration." % package_name)
@@ -106,7 +106,7 @@
         # child of the build directory TOPDIR.
         git_root_dir = run_command(
             "git rev-parse --show-toplevel", os.path.dirname(source_file_path))
-        if not git_root_dir.startswith(d.getVar("TOPDIR", True)):
+        if not git_root_dir.startswith(d.getVar("TOPDIR")):
             return None
 
         return git_repository_path(source_file_path)
diff --git a/import-layers/meta-openembedded/meta-oe/conf/distro/include/meta_oe_security_flags.inc b/import-layers/meta-openembedded/meta-oe/conf/distro/include/meta_oe_security_flags.inc
index 815fb16..03868bf 100644
--- a/import-layers/meta-openembedded/meta-oe/conf/distro/include/meta_oe_security_flags.inc
+++ b/import-layers/meta-openembedded/meta-oe/conf/distro/include/meta_oe_security_flags.inc
@@ -1,5 +1,6 @@
 # Build errors with the pie options enabled
 SECURITY_CFLAGS_pn-libdbus-c++ = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libdevmapper = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-lvm2 = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-rrdtool = "${SECURITY_NO_PIE_CFLAGS}"
 
diff --git a/import-layers/meta-openembedded/meta-oe/conf/layer.conf b/import-layers/meta-openembedded/meta-oe/conf/layer.conf
index bdc8210..54425c6 100644
--- a/import-layers/meta-openembedded/meta-oe/conf/layer.conf
+++ b/import-layers/meta-openembedded/meta-oe/conf/layer.conf
@@ -79,3 +79,5 @@
 
 # Override security flags
 require conf/distro/include/meta_oe_security_flags.inc
+
+HOSTTOOLS += "id"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/files/Fix-build-error-due-missing-space-before-macro.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/files/Fix-build-error-due-missing-space-before-macro.patch
deleted file mode 100644
index 00eb2ed..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/files/Fix-build-error-due-missing-space-before-macro.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 3fb9b6aeed2e2758239e59ba9ba1ca98535fe510 Mon Sep 17 00:00:00 2001
-From: Otavio Salvador <otavio@ossystems.com.br>
-Date: Fri, 19 Aug 2016 15:08:44 +0000
-Subject: [PATCH] Fix build error due missing space before macro
-Organization: O.S. Systems Software LTDA.
-
-Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
----
- src/native-state-x11.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/native-state-x11.cpp b/src/native-state-x11.cpp
-index 3b66b77..3c1703b 100644
---- a/src/native-state-x11.cpp
-+++ b/src/native-state-x11.cpp
-@@ -60,7 +60,7 @@ NativeStateX11::display()
- bool
- NativeStateX11::create_window(WindowProperties const& properties)
- {
--    static const char *win_name("glmark2 "GLMARK_VERSION);
-+    static const char *win_name("glmark2 " GLMARK_VERSION);
- 
-     if (!xdpy_) {
-         Log::error("Error: X11 Display has not been initialized!\n");
--- 
-2.1.4
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/files/Fix-deprecated-declarations.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/files/Fix-deprecated-declarations.patch
deleted file mode 100644
index 7a25de7..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/files/Fix-deprecated-declarations.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Index: git/src/image-reader.cpp
-===================================================================
---- git.orig/src/image-reader.cpp	2016-07-29 16:17:51.000000000 -0500
-+++ git/src/image-reader.cpp	2016-07-29 16:18:43.000000000 -0500
-@@ -120,7 +120,7 @@
- 
-     Log::debug("Reading PNG file %s\n", filename.c_str());
- 
--    const std::auto_ptr<std::istream> is_ptr(Util::get_resource(filename));
-+    const std::unique_ptr<std::istream> is_ptr(Util::get_resource(filename));
-     if (!(*is_ptr)) {
-         Log::error("Cannot open file %s!\n", filename.c_str());
-         return false;
-Index: git/src/libmatrix/shader-source.cc
-===================================================================
---- git.orig/src/libmatrix/shader-source.cc	2016-07-29 16:18:14.000000000 -0500
-+++ git/src/libmatrix/shader-source.cc	2016-07-29 16:18:43.000000000 -0500
-@@ -34,7 +34,7 @@
- bool
- ShaderSource::load_file(const std::string& filename, std::string& str)
- {
--    std::auto_ptr<std::istream> is_ptr(Util::get_resource(filename));
-+    std::unique_ptr<std::istream> is_ptr(Util::get_resource(filename));
-     std::istream& inputFile(*is_ptr);
- 
-     if (!inputFile)
-Index: git/src/model.cpp
-===================================================================
---- git.orig/src/model.cpp	2016-07-29 16:18:00.000000000 -0500
-+++ git/src/model.cpp	2016-07-29 16:18:43.000000000 -0500
-@@ -361,7 +361,7 @@
- 
-     Log::debug("Loading model from 3ds file '%s'\n", filename.c_str());
- 
--    const std::auto_ptr<std::istream> input_file_ptr(Util::get_resource(filename));
-+    const std::unique_ptr<std::istream> input_file_ptr(Util::get_resource(filename));
-     std::istream& input_file(*input_file_ptr);
- 
-     if (!input_file) {
-@@ -681,7 +681,7 @@
- {
-     Log::debug("Loading model from obj file '%s'\n", filename.c_str());
- 
--    const std::auto_ptr<std::istream> input_file_ptr(Util::get_resource(filename));
-+    const std::unique_ptr<std::istream> input_file_ptr(Util::get_resource(filename));
-     std::istream& inputFile(*input_file_ptr);
-     if (!inputFile)
-     {
-Index: git/src/scene-jellyfish.cpp
-===================================================================
---- git.orig/src/scene-jellyfish.cpp	2016-07-29 16:18:08.000000000 -0500
-+++ git/src/scene-jellyfish.cpp	2016-07-29 16:18:43.000000000 -0500
-@@ -272,7 +272,7 @@
- {
-     Log::debug("Loading model from file '%s'\n", filename.c_str());
- 
--    const std::auto_ptr<std::istream> input_file_ptr(Util::get_resource(filename));
-+    const std::unique_ptr<std::istream> input_file_ptr(Util::get_resource(filename));
-     std::istream& inputFile(*input_file_ptr);
-     if (!inputFile)
-     {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/files/build-Check-packages-to-be-used-by-the-enabled-flavo.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/files/build-Check-packages-to-be-used-by-the-enabled-flavo.patch
index ff13329..72b8deb 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/files/build-Check-packages-to-be-used-by-the-enabled-flavo.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/files/build-Check-packages-to-be-used-by-the-enabled-flavo.patch
@@ -18,9 +18,9 @@
 --- a/wscript
 +++ b/wscript
 @@ -121,13 +121,17 @@ def configure(ctx):
-                 ('mirclient','mirclient', '0.13', list_contains(Options.options.flavors, 'mir')),
-                 ('wayland-client','wayland-client', None, list_contains(Options.options.flavors, 'wayland')),
-                 ('wayland-egl','wayland-egl', None, list_contains(Options.options.flavors, 'wayland'))]
+                 ('mirclient','mirclient', '0.13', list_contains(ctx.options.flavors, 'mir')),
+                 ('wayland-client','wayland-client', None, list_contains(ctx.options.flavors, 'wayland')),
+                 ('wayland-egl','wayland-egl', None, list_contains(ctx.options.flavors, 'wayland'))]
 -    for (pkg, uselib, atleast, mandatory) in opt_pkgs:
 +    for (pkg, uselib, atleast, check) in opt_pkgs:
 +        # Check packages required by the flavors
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
index a2558a7..26c5c04 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
@@ -12,13 +12,13 @@
 
 PV = "2014.03+${SRCPV}"
 
-SRC_URI = "git://github.com/glmark2/glmark2.git;protocol=https \
-           file://build-Check-packages-to-be-used-by-the-enabled-flavo.patch \
-           file://0001-Fix-wl_surface-should-be-destoryed-after-the-wl_wind.patch \
-           file://Fix-build-error-due-missing-space-before-macro.patch \
-           file://Fix-configure-for-sqrt-check.patch \
-           file://Fix-deprecated-declarations.patch"
-SRCREV = "fa71af2dfab711fac87b9504b6fc9862f44bf72a"
+SRC_URI = " \
+    git://github.com/glmark2/glmark2.git;protocol=https \
+    file://build-Check-packages-to-be-used-by-the-enabled-flavo.patch \
+    file://0001-Fix-wl_surface-should-be-destoryed-after-the-wl_wind.patch \
+    file://Fix-configure-for-sqrt-check.patch \
+"
+SRCREV = "f413c5b423250b4fde8f95639ad368d5b02c5b9b"
 
 S = "${WORKDIR}/git"
 
@@ -39,7 +39,7 @@
 PACKAGECONFIG[wayland-gles2] = ",,virtual/libgles2 wayland"
 
 python __anonymous() {
-    packageconfig = (d.getVar("PACKAGECONFIG", True) or "").split()
+    packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
     flavors = []
     if "x11-gles2" in packageconfig:
         flavors.append("x11-glesv2")
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iozone3/iozone3/parallelism.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iozone3/iozone3/parallelism.patch
new file mode 100644
index 0000000..d5622ed
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iozone3/iozone3/parallelism.patch
@@ -0,0 +1,97 @@
+remove libasync.o and libbif.o from deps
+
+there are no implicit rules to build them and they get wrong CFLAGS
+when compiled with implicit rule.
+
+They are built as part of iozone_linux.o target anyway
+
+Only fixed linux targets for now
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+
+
+--- current/makefile.org	2016-12-06 02:19:10.367911020 +0000
++++ current/makefile	2016-12-06 02:21:38.767911020 +0000
+@@ -167,7 +167,7 @@
+ #
+ # GNU 'C' compiler Linux build with threads, largefiles, async I/O 
+ #
+-linux:	iozone_linux.o libasync.o libbif.o fileop_linux.o pit_server.o
++linux:	iozone_linux.o fileop_linux.o pit_server.o
+ 	$(CC)  -O3 $(LDFLAGS) iozone_linux.o libasync.o libbif.o -lpthread \
+ 		-lrt -o iozone
+ 	$(CC)  -O3 -Dlinux fileop_linux.o -o fileop
+@@ -176,7 +176,7 @@
+ #
+ # GNU 'C' compiler Linux build for powerpc chip with threads, largefiles, async I/O 
+ #
+-linux-powerpc: iozone_linux-powerpc.o  libbif.o libasync.o fileop_linux-ppc.o pit_server.o
++linux-powerpc: iozone_linux-powerpc.o fileop_linux-ppc.o pit_server.o
+ 	$(CC) -O3 $(LDFLAGS) iozone_linux-powerpc.o libasync.o \
+ 		libbif.o -lpthread  -lrt -o iozone
+ 	$(CC)  -O3 -Dlinux fileop_linux-ppc.o -o fileop
+@@ -184,7 +184,7 @@
+ #
+ # GNU 'C' compiler Linux build for sparc chip with threads, largefiles, async I/O 
+ #
+-linux-sparc: iozone_linux-sparc.o  libbif.o libasync.o fileop_linux.o pit_server.o
++linux-sparc: iozone_linux-sparc.o fileop_linux.o pit_server.o
+ 	$(CC) -O3 $(LDFLAGS) iozone_linux-sparc.o libasync.o libbif.o \
+ 		-lpthread -lrt -o iozone
+ 	$(CC) -O3 -Dlinux fileop_linux.o -o fileop
+@@ -193,7 +193,7 @@
+ #
+ # GNU 'C' compiler Linux build with threads, largefiles, async I/O 
+ #
+-linux-ia64:	iozone_linux-ia64.o  libbif.o libasync.o fileop_linux-ia64.o pit_server.o
++linux-ia64:	iozone_linux-ia64.o fileop_linux-ia64.o pit_server.o
+ 	$(CC) -O3 $(LDFLAGS) iozone_linux-ia64.o libbif.o libasync.o \
+ 		-lrt -lpthread -o iozone
+ 	$(CC)  -O3 -Dlinux fileop_linux-ia64.o -o fileop
+@@ -202,7 +202,7 @@
+ #
+ # GNU 'C' compiler Linux build for powerpc chip with threads, largefiles, async I/O 
+ #
+-linux-powerpc64: iozone_linux-powerpc64.o  libbif.o libasync.o fileop_linux-ppc64.o pit_server-linux-powerpc64.o
++linux-powerpc64: iozone_linux-powerpc64.o fileop_linux-ppc64.o pit_server-linux-powerpc64.o
+ 	$(CC) -O3 -Dunix -DHAVE_ANSIC_C -DSHARED_MEM -DASYNC_IO \
+ 		-D_LARGEFILE64_SOURCE -Dlinux \
+ 		iozone_linux-powerpc64.o libasync.o libbif.o -lpthread \
+@@ -213,7 +213,7 @@
+ #
+ # GNU 'C' compiler Linux build with threads, largefiles, async I/O
+ #
+-linux-arm:	iozone_linux-arm.o  libbif.o libasync.o fileop_linux-arm.o pit_server.o
++linux-arm:	iozone_linux-arm.o fileop_linux-arm.o pit_server.o
+ 	$(CC) -O3 $(LDFLAGS) iozone_linux-arm.o libbif.o libasync.o \
+ 		-lrt -lpthread -o iozone
+ 	$(CC) -O3 -Dlinux fileop_linux-arm.o -o fileop
+@@ -222,7 +222,7 @@
+ #
+ # GNU 'C' compiler Linux build with threads, largefiles, async I/O 
+ #
+-linux-AMD64:	iozone_linux-AMD64.o  libbif.o libasync.o fileop_linux-AMD64.o pit_server.o
++linux-AMD64:	iozone_linux-AMD64.o fileop_linux-AMD64.o pit_server.o
+ 	$(CC)  -O3 $(LDFLAGS) iozone_linux-AMD64.o libbif.o libasync.o \
+ 		-lrt -lpthread -o iozone
+ 	$(CC)  -O3 -Dlinux fileop_linux-AMD64.o -o fileop
+@@ -231,7 +231,7 @@
+ #
+ # GNU 'C' compiler Linux build with S/390, threads, largfiles, async I/O
+ #
+-linux-S390:	iozone_linux-s390.o libbif.o libasync.o fileop_linux-s390.o pit_server.o
++linux-S390:	iozone_linux-s390.o fileop_linux-s390.o pit_server.o
+ 	$(CC)  -O2 $(LDFLAGS) -lpthread -lrt iozone_linux-s390.o \
+ 		libbif.o libasync.o -o iozone
+ 	$(CC)  -O3 -Dlinux fileop_linux-s390.o -o fileop
+@@ -240,7 +240,7 @@
+ #
+ # GNU 'C' compiler Linux build with S/390, threads, largfiles, async I/O
+ #
+-linux-S390X:	iozone_linux-s390x.o libbif.o libasync.o fileop_linux-s390x.o pit_server.o
++linux-S390X:	iozone_linux-s390x.o fileop_linux-s390x.o pit_server.o
+ 	$(CC)  -O2 $(LDFLAGS) -lpthread -lrt iozone_linux-s390x.o \
+ 		libbif.o libasync.o -o iozone
+ 	$(CC)  -O3 -Dlinux fileop_linux-s390x.o -o fileop
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iozone3/iozone3_434.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iozone3/iozone3_434.bb
deleted file mode 100644
index daa36ee..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iozone3/iozone3_434.bb
+++ /dev/null
@@ -1,114 +0,0 @@
-SUMMARY = "Filesystem and Disk Benchmarking Tool"
-HOMEPAGE = "http://www.iozone.org/"
-AUTHOR = "Don Capps <don.capps2@verizon.net>, William D. Norcott <wnorcott@us.oracle.com>"
-SECTION = "console/tests"
-LICENSE = "iozone3"
-LIC_FILES_CHKSUM = "file://iozone.c;beginline=268;endline=272;md5=ab42a6185fd0443978871f11a007ac0b"
-
-SRC_URI = "http://www.iozone.org/src/current/${BPN}_${PV}.tar \
-    file://copyright.txt \
-"
-SRC_URI[md5sum] = "3e8f4213581407225065b91774e970ed"
-SRC_URI[sha256sum] = "2c388d9db393a5505b31eca38951883744c69745f687f3c7df5185b4681d462a"
-
-S = "${WORKDIR}/${BPN}_${PV}/src/current/"
-
-#
-# All other arches can use the default OEMAKE except those
-# explicitly listed below. Another, the iozone3 Makefile
-# needs to be told about the cross-compiler explicitly here.
-#
-EXTRA_OEMAKE_powerpc = "linux-powerpc CC='${CC}' GCC='${CC}'"
-EXTRA_OEMAKE_powerpc64 = "linux-powerpc64 CC='${CC}' GCC='${CC}'"
-EXTRA_OEMAKE_arm = "linux-arm CC='${CC}' GCC='${CC}'"
-EXTRA_OEMAKE = "linux CC='${CC}' GCC='${CC}'"
-
-TARGET_CC_ARCH += "${LDFLAGS}"
-
-do_install() {
-    install -d ${D}${bindir} \
-               ${D}${mandir}/man1 \
-               ${D}${datadir}/doc/${BPN}/examples
-
-    install -m 0755 ${S}/iozone ${D}${bindir}
-    install -m 0755 ${S}/fileop ${D}${bindir}
-    install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/iozone.1 ${D}${mandir}/man1/
-    install -m 0644 ${WORKDIR}/copyright.txt ${D}${datadir}/doc/${BPN}/
-
-    install -m 0644 ${S}/*.dem ${D}${datadir}/doc/${BPN}/examples
-    install -m 0644 ${S}/client_list ${D}${datadir}/doc/${BPN}/examples
-    install -m 0644 ${S}/Gnuplot.txt ${D}${datadir}/doc/${BPN}/examples
-
-    install -m 0755 ${S}/Generate_Graphs ${D}${datadir}/doc/${BPN}/examples
-    install -m 0755 ${S}/gengnuplot.sh ${D}${datadir}/doc/${BPN}/examples
-    install -m 0755 ${S}/report.pl ${D}${datadir}/doc/${BPN}/examples
-
-    install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/Iozone_ps.gz ${D}${datadir}/doc/${BPN}/
-    install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/IOzone_msword_98.pdf ${D}${datadir}/doc/${BPN}/
-    install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/Run_rules.doc ${D}${datadir}/doc/${BPN}/
-}
-
-FILES_${PN} += "${datadir}/doc/${PN}/copyright.txt"
-
-# LICENSE:
-#
-#  Copyright 1991, 1992, 1994, 1998, 1999, 2002   William D. Norcott
-#
-#  License to freely use and distribute this software is hereby granted
-#  by the author, subject to the condition that this copyright notice
-#  remains intact.  The author retains the exclusive right to publish
-#  derivative works based on this work, including, but not limited to
-#  revised versions of this work.
-#
-
-#
-# Below is author reply to question about distributing iozone3 in
-# OpenEmbedded:
-#
-# ========================================================================
-#
-# Marcin,
-#
-#     Re-distribution is permitted as long as the copyright is
-#     maintained and the source code is not changed. I do not
-#     see a problem with your mods to enable fileop for Linux-arm,
-#     as these mods have been returned to the Iozone folks,
-#     and they have been accepted for inclusion in the next
-#     release :-)
-#
-# Thank you for your contribution,
-# Don Capps
-#
-# ----- Original Message -----
-# From: "Marcin Juszkiewicz" <firma@hrw.one.pl>
-# To: "Don Capps" <don.capps2@verizon.net>; "William D. Norcott"
-# <wnorcott@us.oracle.com>
-# Sent: Sunday, October 29, 2006 4:55 PM
-# Subject: iozone3 263 patch for arm and License question
-#
-#
-# > Morning
-# >
-# > I want to include iozone3 in OpenEmbedded [1] metadata to give it for
-# > other developers. Currently OE is used to build few distributions for
-# > misc platforms: ARM, SH3, SH4, x86, PowerPC and different types of
-# > machines (PDA, settopbox, devboards, desktops, thin clients, routers).
-# >
-# > According to your distribution of derivations is forbidden. Packaging
-# > iozone3 in OpenEmbedded will not involve any source code changes. But
-# > when I was building it for ARM I discovered that fileop binary was not
-# > built - so I created patch for it (attached). Not yet tested it on target
-# > device.
-# >
-# > Thus, I seek your written permission via e-mail to distribute a package of
-# > the unmodified source code and also a package of the pre-compiled binary.
-# > Your copyright statement will be included in the package.
-# >
-# >
-# > 1. http://www.openembedded.org/
-# >
-# > Regards
-# > --
-# > JID: hrw-jabber.org
-# > OpenEmbedded developer/consultant
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iozone3/iozone3_465.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iozone3/iozone3_465.bb
new file mode 100644
index 0000000..2864a4d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iozone3/iozone3_465.bb
@@ -0,0 +1,117 @@
+SUMMARY = "Filesystem and Disk Benchmarking Tool"
+HOMEPAGE = "http://www.iozone.org/"
+AUTHOR = "Don Capps <don.capps2@verizon.net>, William D. Norcott <wnorcott@us.oracle.com>"
+SECTION = "console/tests"
+LICENSE = "iozone3"
+LIC_FILES_CHKSUM = "file://iozone.c;beginline=37;endline=48;md5=7331260091868dcad0f9edea735b5f4b \
+    file://iozone.c;beginline=260;endline=266;md5=77f9ee51e45b57a7e7519c4fa0b4f00b \
+"
+SRC_URI = "http://www.iozone.org/src/current/${BPN}_${PV}.tar \
+    file://parallelism.patch \
+    file://copyright.txt \
+"
+SRC_URI[md5sum] = "c924e5e46fb1cf8145f420e8e57eb954"
+SRC_URI[sha256sum] = "2e3d72916e7d7340a7c505fc0c3d28553fcc5ff2daf41d811368e55bd4e6a293"
+
+S = "${WORKDIR}/${BPN}_${PV}/src/current/"
+
+#
+# All other arches can use the default OEMAKE except those
+# explicitly listed below. Another, the iozone3 Makefile
+# needs to be told about the cross-compiler explicitly here.
+#
+EXTRA_OEMAKE_powerpc = "linux-powerpc CC='${CC}' GCC='${CC}'"
+EXTRA_OEMAKE_powerpc64 = "linux-powerpc64 CC='${CC}' GCC='${CC}'"
+EXTRA_OEMAKE_x86-64 = "linux-AMD64 CC='${CC}' GCC='${CC}'"
+EXTRA_OEMAKE_arm = "linux-arm CC='${CC}' GCC='${CC}'"
+EXTRA_OEMAKE = "linux CC='${CC}' GCC='${CC}'"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_install() {
+    install -d ${D}${bindir} \
+               ${D}${mandir}/man1 \
+               ${D}${datadir}/doc/${BPN}/examples
+
+    install -m 0755 ${S}/iozone ${D}${bindir}
+    install -m 0755 ${S}/fileop ${D}${bindir}
+    install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/iozone.1 ${D}${mandir}/man1/
+    install -m 0644 ${WORKDIR}/copyright.txt ${D}${datadir}/doc/${BPN}/
+
+    install -m 0644 ${S}/*.dem ${D}${datadir}/doc/${BPN}/examples
+    install -m 0644 ${S}/client_list ${D}${datadir}/doc/${BPN}/examples
+    install -m 0644 ${S}/Gnuplot.txt ${D}${datadir}/doc/${BPN}/examples
+
+    install -m 0755 ${S}/Generate_Graphs ${D}${datadir}/doc/${BPN}/examples
+    install -m 0755 ${S}/gengnuplot.sh ${D}${datadir}/doc/${BPN}/examples
+    install -m 0755 ${S}/report.pl ${D}${datadir}/doc/${BPN}/examples
+
+    install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/Iozone_ps.gz ${D}${datadir}/doc/${BPN}/
+    install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/IOzone_msword_98.pdf ${D}${datadir}/doc/${BPN}/
+    install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/Run_rules.doc ${D}${datadir}/doc/${BPN}/
+}
+
+FILES_${PN} += "${datadir}/doc/${PN}/copyright.txt"
+
+# LICENSE:
+#
+#  Copyright 1991, 1992, 1994, 1998, 1999, 2002   William D. Norcott
+#
+#  License to freely use and distribute this software is hereby granted
+#  by the author, subject to the condition that this copyright notice
+#  remains intact.  The author retains the exclusive right to publish
+#  derivative works based on this work, including, but not limited to
+#  revised versions of this work.
+#
+
+#
+# Below is author reply to question about distributing iozone3 in
+# OpenEmbedded:
+#
+# ========================================================================
+#
+# Marcin,
+#
+#     Re-distribution is permitted as long as the copyright is
+#     maintained and the source code is not changed. I do not
+#     see a problem with your mods to enable fileop for Linux-arm,
+#     as these mods have been returned to the Iozone folks,
+#     and they have been accepted for inclusion in the next
+#     release :-)
+#
+# Thank you for your contribution,
+# Don Capps
+#
+# ----- Original Message -----
+# From: "Marcin Juszkiewicz" <firma@hrw.one.pl>
+# To: "Don Capps" <don.capps2@verizon.net>; "William D. Norcott"
+# <wnorcott@us.oracle.com>
+# Sent: Sunday, October 29, 2006 4:55 PM
+# Subject: iozone3 263 patch for arm and License question
+#
+#
+# > Morning
+# >
+# > I want to include iozone3 in OpenEmbedded [1] metadata to give it for
+# > other developers. Currently OE is used to build few distributions for
+# > misc platforms: ARM, SH3, SH4, x86, PowerPC and different types of
+# > machines (PDA, settopbox, devboards, desktops, thin clients, routers).
+# >
+# > According to your distribution of derivations is forbidden. Packaging
+# > iozone3 in OpenEmbedded will not involve any source code changes. But
+# > when I was building it for ARM I discovered that fileop binary was not
+# > built - so I created patch for it (attached). Not yet tested it on target
+# > device.
+# >
+# > Thus, I seek your written permission via e-mail to distribute a package of
+# > the unmodified source code and also a package of the pre-compiled binary.
+# > Your copyright statement will be included in the package.
+# >
+# >
+# > 1. http://www.openembedded.org/
+# >
+# > Regards
+# > --
+# > JID: hrw-jabber.org
+# > OpenEmbedded developer/consultant
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf-2.0.5/0001-fix-out-of-tree-config.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf-2.0.5/0001-fix-out-of-tree-config.patch
deleted file mode 100644
index e8a0297..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf-2.0.5/0001-fix-out-of-tree-config.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-iperf: fix out of tree configuration
-
-The configure step uses a package header to check for support of types/declares,
-this package header encapsulates all the required system header for providing
-the needed resources. When configured from an out of tree directory the package
-header is not found due to the hard path.
-We now make the path for package header relative to our 'srcdir' so it is
-found appropriately.
-
-Signed-off-by: Awais Belal <awais_belal@mentor.com>
----
-diff --git a/configure.ac b/configure.ac
-index 2b3fd20..d420f9e 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -176,8 +176,8 @@ dnl Check for system services
- 
- dnl check for multicast
- if test "$ac_cv_multicast" != no; then
--  AC_CHECK_TYPES(struct ip_mreq,,,[#include "compat/headers_slim.h"])
--  AC_CHECK_DECLS(IP_ADD_MEMBERSHIP,,,[#include "compat/headers_slim.h"])
-+  AC_CHECK_TYPES(struct ip_mreq,,,[#include "${srcdir}/compat/headers_slim.h"])
-+  AC_CHECK_DECLS(IP_ADD_MEMBERSHIP,,,[#include "${srcdir}/compat/headers_slim.h"])
-   AC_MSG_CHECKING(for multicast support)
-   ac_cv_multicast=no
-   if test "$ac_cv_have_decl_IP_ADD_MEMBERSHIP" = yes; then
-@@ -193,9 +193,9 @@ fi
- 
- dnl check for IPv6
- if test "$ac_cv_have_ipv6" != no; then
--  AC_CHECK_TYPES(struct sockaddr_storage,,,[#include "compat/headers_slim.h"])
--  AC_CHECK_TYPES(struct sockaddr_in6,,,[#include "compat/headers_slim.h"])
--  AC_CHECK_DECLS(AF_INET6,,,[#include "compat/headers_slim.h"])
-+  AC_CHECK_TYPES(struct sockaddr_storage,,,[#include "${srcdir}/compat/headers_slim.h"])
-+  AC_CHECK_TYPES(struct sockaddr_in6,,,[#include "${srcdir}/compat/headers_slim.h"])
-+  AC_CHECK_DECLS(AF_INET6,,,[#include "${srcdir}/compat/headers_slim.h"])
-   AC_MSG_CHECKING(for IPv6 headers and structures)
-   ac_cv_have_ipv6=no
-   if test "$ac_cv_type_struct_sockaddr_storage" = yes; then
-@@ -211,9 +211,9 @@ fi
- 
- if test "$ac_cv_have_ipv6" = yes; then
-   if test "$ac_cv_multicast" = yes; then
--    AC_CHECK_TYPES(struct ipv6_mreq,,,[#include "compat/headers_slim.h"])
--    AC_CHECK_DECLS(IPV6_ADD_MEMBERSHIP,,,[#include "compat/headers_slim.h"])
--    AC_CHECK_DECLS(IPV6_MULTICAST_HOPS,,,[#include "compat/headers_slim.h"])
-+    AC_CHECK_TYPES(struct ipv6_mreq,,,[#include "${srcdir}/compat/headers_slim.h"])
-+    AC_CHECK_DECLS(IPV6_ADD_MEMBERSHIP,,,[#include "${srcdir}/compat/headers_slim.h"])
-+    AC_CHECK_DECLS(IPV6_MULTICAST_HOPS,,,[#include "${srcdir}/compat/headers_slim.h"])
-     AC_MSG_CHECKING(for IPv6 multicast support)
-     ac_cv_have_ipv6_multicast=no
-     if test "$ac_cv_type_struct_ipv6_mreq" = yes; then
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf-2.0.5/0002-fix-bool-size-m4.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf-2.0.5/0002-fix-bool-size-m4.patch
deleted file mode 100644
index 348e316..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf-2.0.5/0002-fix-bool-size-m4.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- iperf-2.0.5/m4/dast.m4.orig	2016-06-15 11:42:03.945581785 -0400
-+++ iperf-2.0.5/m4/dast.m4	2016-06-15 11:42:11.053581641 -0400
-@@ -11,7 +11,12 @@
- 
- AC_DEFUN(DAST_CHECK_BOOL, [
- 
--AC_CHECK_SIZEOF(bool)
-+if test "$ac_cv_header_stdbool_h" = yes; then
-+  AC_CHECK_SIZEOF(bool,,[#include <stdbool.h>])
-+else
-+    AC_CHECK_SIZEOF(bool)
-+fi
-+
- if test "$ac_cv_sizeof_bool" = 0 ; then
-   AC_DEFINE(bool, int)
- fi
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf-2.0.5/iperf-2.0.5_ManPage.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf-2.0.5/iperf-2.0.5_ManPage.patch
deleted file mode 100755
index 12e8f46..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf-2.0.5/iperf-2.0.5_ManPage.patch
+++ /dev/null
@@ -1,8 +0,0 @@
-diff --git iperf-2.0.5/man/Makefile.am iperf-2.0.5/man/Makefile.am
- index ed97bc6..728873f 100644
---- iperf-2.0.5/man/Makefile.am
-+++ iperf-2.0.5/man/Makefile.am
-@@ -1,2 +1 @@
--man_MANS = iperf.1
--dist_man_MANS = $(man_MANS)
-+dist_man_MANS = iperf.1
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf_2.0.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf_2.0.5.bb
deleted file mode 100644
index 9981d82..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf/iperf_2.0.5.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-DESCRIPTION = "Iperf is a tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics"
-HOMEPAGE = "http://dast.nlanr.net/Projects/Iperf/"
-SECTION = "console/network"
-LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://COPYING;md5=e8478eae9f479e39bc34975193360298"
-
-SRC_URI = " ${SOURCEFORGE_MIRROR}/iperf/${BP}.tar.gz \
-            file://iperf-2.0.5_ManPage.patch \
-            file://0001-fix-out-of-tree-config.patch \
-            file://0002-fix-bool-size-m4.patch \
-          "
-
-SRC_URI[md5sum] = "44b5536b67719f4250faed632a3cd016"
-SRC_URI[sha256sum] = "636b4eff0431cea80667ea85a67ce4c68698760a9837e1e9d13096d20362265b"
-
-S = "${WORKDIR}/${BP}"
-
-inherit autotools pkgconfig
-
-EXTRA_OECONF = "--exec-prefix=${STAGING_DIR_HOST}${layout_exec_prefix}"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf3/iperf3/0001-include-stdint.h-for-various-std-c99-int-types.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf3/iperf3/0001-include-stdint.h-for-various-std-c99-int-types.patch
new file mode 100644
index 0000000..ae36208
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf3/iperf3/0001-include-stdint.h-for-various-std-c99-int-types.patch
@@ -0,0 +1,39 @@
+From be653711fb92d2430b3ecc546b4e3ad927d19ec5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 12:59:42 -0700
+Subject: [PATCH 1/2] include stdint.h for various std c99 int types
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/cjson.h | 2 ++
+ src/timer.h | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/src/cjson.h b/src/cjson.h
+index fb8cd3b..69cd272 100644
+--- a/src/cjson.h
++++ b/src/cjson.h
+@@ -23,6 +23,8 @@
+ #ifndef cJSON__h
+ #define cJSON__h
+ 
++#include <stdint.h>
++
+ #ifdef __cplusplus
+ extern "C"
+ {
+diff --git a/src/timer.h b/src/timer.h
+index 0f9c5eb..0b195be 100644
+--- a/src/timer.h
++++ b/src/timer.h
+@@ -31,6 +31,7 @@
+ #define __TIMER_H
+ 
+ #include <sys/time.h>
++#include <stdint.h>
+ 
+ /* TimerClientData is an opaque value that tags along with a timer.  The
+ ** client can use it for whatever, and it gets passed to the callback when
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf3/iperf3/0002-Remove-pg-from-profile_CFLAGS.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf3/iperf3/0002-Remove-pg-from-profile_CFLAGS.patch
new file mode 100644
index 0000000..06eb41a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf3/iperf3/0002-Remove-pg-from-profile_CFLAGS.patch
@@ -0,0 +1,31 @@
+From 6db0e28f906bc3784019dfb5bb011237a8034fda Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 13:00:16 -0700
+Subject: [PATCH 2/2] Remove -pg from profile_CFLAGS
+
+musl fails to link with missing gcrt1.o
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 23b0c72..6268145 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -49,9 +49,9 @@ iperf3_LDFLAGS          = -g
+ iperf3_profile_SOURCES  = main.c \
+ 						  $(libiperf_la_SOURCES)
+ 
+-iperf3_profile_CFLAGS   = -pg -g
++iperf3_profile_CFLAGS   = -g
+ iperf3_profile_LDADD    = libiperf.la
+-iperf3_profile_LDFLAGS  = -pg -g
++iperf3_profile_LDFLAGS  = -g
+ 
+ # Specify the sources and various flags for the test cases
+ t_timer_SOURCES         = t_timer.c
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf3/iperf3_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf3/iperf3_git.bb
index d19aa1e..4a01896 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf3/iperf3_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/iperf3/iperf3_git.bb
@@ -11,10 +11,11 @@
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=8c3434c5a9a53c78c7739f0bc9e5adda"
 
-SRC_URI = "\
-    git://github.com/esnet/iperf.git \
-    file://automake-foreign.patch \
-"
+SRC_URI = "git://github.com/esnet/iperf.git \
+           file://automake-foreign.patch \
+           file://0001-include-stdint.h-for-various-std-c99-int-types.patch \
+           file://0002-Remove-pg-from-profile_CFLAGS.patch \
+           "
 
 PV = "3.1.3+gitr${SRCPV}"
 SRCREV = "099244ec686b620393e9845478a554b1c7ca5c8b"
@@ -25,4 +26,6 @@
 
 PACKAGECONFIG[lksctp] = "ac_cv_header_netinet_sctp_h=yes,ac_cv_header_netinet_sctp_h=no,lksctp-tools"
 
+CFLAGS += "-D_GNU_SOURCE"
+
 BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/files/0001-install-perl-lib-to-directory-perl-instead-of-perl5.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/files/0001-install-perl-lib-to-directory-perl-instead-of-perl5.patch
deleted file mode 100644
index 0b8d0e4..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/files/0001-install-perl-lib-to-directory-perl-instead-of-perl5.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Upstream-Status: Inappropriate [oe-core specific]
-
-libhugetlbfs depends on perl, and perl installs a directory 'perl'
-and make a symlink 'perl5' to it. So just install perl libs in
-libhugetlbfs to directory 'perl' instead of 'perl5'. This can avoid
-the following error:
-| CalledProcessError: Command 'tar -cf - -C .../perl/5.14.3-r1/sysroot-destdir
-| -ps . | tar -xf - -C .../tmp/sysroots/t4240qds'
-| returned non-zero exit status 2 with output
-| tar: ./usr/lib/perl5: Cannot create symlink to `perl': File exists
-| tar: Exiting with failure status due to previous errors
-
-
-Signed-off-by: Ting Liu <b28495@freescale.com>
-
---- a/Makefileold	2013-10-11 23:07:31.759421318 -0500
-+++ b/Makefile	2013-10-11 23:08:01.935571122 -0500
-@@ -173,17 +173,17 @@
- DOCDIR = $(PREFIX)/share/doc/libhugetlbfs
- 
- ifdef CC32
--PMDIR = $(PREFIX)/lib/perl5/TLBC
-+PMDIR = $(PREFIX)/lib/perl/TLBC
- endif
- 
- ifdef CC64
- ifeq ($(ARCH),x86_64)
--PMDIR = $(PREFIX)/lib/perl5/TLBC
-+PMDIR = $(PREFIX)/lib/perl/TLBC
- else
- ifeq ($(ARCH),aarch64)
--PMDIR = $(PREFIX)/lib/perl5/TLBC
-+PMDIR = $(PREFIX)/lib/perl/TLBC
- else
--PMDIR = $(PREFIX)/lib64/perl5/TLBC
-+PMDIR = $(PREFIX)/lib64/perl/TLBC
- endif
- endif
- endif
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/files/libhugetlbfs-avoid-using-restrict-as-var-name.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/files/libhugetlbfs-avoid-using-restrict-as-var-name.patch
deleted file mode 100644
index b77cfe1..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/files/libhugetlbfs-avoid-using-restrict-as-var-name.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Avoid using keyword restrict as variable name which causes error with gcc 5.x:
-
-| hugeutils.c: In function '__lh_hugetlbfs_setup_env':
-| hugeutils.c:304:40: error: expected identifier or '(' before 'restrict'
-|    char *p, *tok, *exe, buf[MAX_EXE+1], restrict[MAX_EXE];
-|                                         ^
-
-Upstream-Status: Pending
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-diff --git a/hugeutils.c b/hugeutils.c
-index 53a7fbd..b9d7001 100644
---- a/hugeutils.c
-+++ b/hugeutils.c
-@@ -301,14 +301,14 @@ void hugetlbfs_setup_env()
- 
- 	env = getenv("HUGETLB_RESTRICT_EXE");
- 	if (env) {
--		char *p, *tok, *exe, buf[MAX_EXE+1], restrict[MAX_EXE];
-+		char *p, *tok, *exe, buf[MAX_EXE+1], restricted[MAX_EXE];
- 		int found = 0;
- 
- 		exe = get_exe_name(buf, sizeof buf);
- 		DEBUG("Found HUGETLB_RESTRICT_EXE, this exe is \"%s\"\n", exe);
--		strncpy(restrict, env, sizeof restrict);
--		restrict[sizeof(restrict)-1] = 0;
--		for (p = restrict; (tok = strtok(p, ":")) != NULL; p = NULL) {
-+		strncpy(restricted, env, sizeof restricted);
-+		restricted[sizeof(restricted)-1] = 0;
-+		for (p = restricted; (tok = strtok(p, ":")) != NULL; p = NULL) {
- 			DEBUG("  ...check exe match for \"%s\"\n",  tok);
- 			if (strcmp(tok, exe) == 0) {
- 				found = 1;
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
index 301b550..823e07c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
@@ -7,10 +7,10 @@
 RDEPENDS_${PN} += "bash perl python python-io python-lang python-subprocess python-resource ${PN}-perl"
 RDEPENDS_${PN}-tests += "bash"
 
-PV = "2.19"
+PV = "2.20"
 PE = "1"
 
-SRCREV = "426c22d65415fcb8927f68fbc5887e075a8dc40a"
+SRCREV = "e44180072b796c0e28e53c4d01ef6279caaa2a99"
 SRC_URI = " \
     git://github.com/libhugetlbfs/libhugetlbfs.git;protocol=https \
     file://skip-checking-LIB32-and-LIB64-if-they-point-to-the-s.patch \
@@ -18,7 +18,6 @@
     file://tests-Makefile-install-static-4G-edge-testcases.patch \
     file://0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch \
     file://libhugetlbfs-elf_i386-avoid-search-host-library-path.patch \
-    file://libhugetlbfs-avoid-using-restrict-as-var-name.patch \
     file://Force-text-segment-alignment-to-0x08000000-for-i386-.patch \
 "
 
@@ -39,7 +38,7 @@
 #The CUSTOM_LDSCRIPTS doesn't work with the gold linker
 inherit cpan-base
 do_configure() {
-    if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then
+    if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
       sed -i 's/CUSTOM_LDSCRIPTS = yes/CUSTOM_LDSCRIPTS = no/'  Makefile
     fi
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch
new file mode 100644
index 0000000..20791bf
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch
@@ -0,0 +1,29 @@
+From 31d58ed7e6552781f415501e96d7cc74f83b910d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 12 Jul 2017 18:08:51 -0700
+Subject: [PATCH 1/2] Check for musl define guard before redefining socklen_t
+
+musl uses __DEFINED_socklen_t so check for that as well
+along with HAVE_socklen_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/bench.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/bench.h b/src/bench.h
+index 597d068..2ebdf5a 100644
+--- a/src/bench.h
++++ b/src/bench.h
+@@ -77,7 +77,7 @@ typedef long long int64;
+ #endif /* HAVE_int64_t */
+ #endif /* HAVE_int64 */
+ 
+-#ifndef HAVE_socklen_t
++#if !defined(HAVE_socklen_t) && !defined(__DEFINED_socklen_t)
+ typedef int socklen_t;
+ #endif
+ 
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_http.c-Add-printf-format.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_http.c-Add-printf-format.patch
new file mode 100644
index 0000000..18ed43d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_http.c-Add-printf-format.patch
@@ -0,0 +1,26 @@
+From 6faa6acdf20aa6f738eed1483b7dceed94286adb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 14:39:10 -0700
+Subject: [PATCH] lat_http.c: Add printf format
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/lat_http.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lat_http.c b/src/lat_http.c
+index c630d59..28d04f7 100644
+--- a/src/lat_http.c
++++ b/src/lat_http.c
+@@ -27,7 +27,7 @@ http(char *server, char *file, int prog)
+ 	sock = tcp_connect(server, prog, SOCKOPT_REUSE);
+ 	sprintf(buf, "GET /%s HTTP/1.0\r\n\r\n\n", file);
+ 	if (debug) {
+-		printf(buf);
++		printf("%s", buf);
+ 	}
+ 	write(sock, buf, strlen(buf));
+ 	while ((n = read(sock, buf, XFERSIZE)) > 0) {
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch
new file mode 100644
index 0000000..d5c8f5f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch
@@ -0,0 +1,76 @@
+From 76f3a9abc2ff96155425ef97d8c5520cfbc8fe6a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 12 Jul 2017 18:09:46 -0700
+Subject: [PATCH 2/2] build: Adjust CFLAGS/LDFLAGS to append values passed from
+ env
+
+For musl we have to pass additional arguments via cflags and ldflags
+to link in librirpc, make room for those changes to take effect
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ scripts/build |  2 +-
+ src/Makefile  | 14 +++++++-------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/scripts/build b/scripts/build
+index 34a1371..3786741 100755
+--- a/scripts/build
++++ b/scripts/build
+@@ -18,7 +18,7 @@ done
+ 
+ trap 'rm -f ${BASE}$$.s ${BASE}$$.c ${BASE}$$.o ${BASE}$$; exit 1' 1 2 15
+ 
+-LDLIBS=-lm
++LDLIBS+=-lm
+ 
+ # check for HP-UX's ANSI compiler
+ echo "main(int ac, char *av[]) { int i; }" > ${BASE}$$.c
+diff --git a/src/Makefile b/src/Makefile
+index d9efd54..96467d7 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -112,8 +112,8 @@ LIBOBJS= $O/lib_tcp.o $O/lib_udp.o $O/lib_unix.o $O/lib_timing.o 	\
+ 	$O/lib_sched.o
+ 
+ lmbench: $(UTILS)
+-	@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all
+-	-@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt
++	@env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all
++	-@env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt
+ 
+ results: lmbench
+ 	@env OS="${OS}" ../scripts/config-run
+@@ -137,7 +137,7 @@ os: lmbench
+ 	@env OS="${OS}" BENCHMARK_HARDWARE=NO  BENCHMARK_OS=YES ../scripts/results
+ 
+ install: lmbench
+-	@env CFLAGS=-O MAKE="$(MAKE)"  MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target
++	@env CFLAGS+=-O MAKE="$(MAKE)"  MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target
+ 
+ install-target:
+ 	if [ ! -d $(BASE) ]; then mkdir $(BASE); fi
+@@ -155,16 +155,16 @@ all: $(EXES) $O/lmbench
+ opt: $(OPT_EXES)
+ asm: $(ASMS)
+ $(ASMS):
+-	$(CC) -S $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ `basename $@ .s`.c
++	$(CC) -S $(CFLAGS) $(CPPFLAGS) -o $@ `basename $@ .s`.c $(LDFLAGS)
+ 
+ Wall:
+-	@env CFLAGS="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
++	@env CFLAGS+="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
+ 
+ debug:
+-	@env CFLAGS="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
++	@env CFLAGS+="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
+ 
+ assembler:
+-	@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm
++	@env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm
+ 
+ 
+ tag:
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
index 62906fd..03b3721 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
@@ -7,6 +7,10 @@
 
 inherit autotools-brokensep
 
+DEPENDS_append_libc-musl = " libtirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDLIBS_append_libc-musl = " -ltirpc "
+
 PR = "r2"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
@@ -19,12 +23,15 @@
            file://lmbench_result_html_report.patch \
            file://fix-lmbench-memory-check-failure.patch \
            file://0001-avoid-gcc-optimize-away-the-loops.patch \
-"
+           file://0001-lat_http.c-Add-printf-format.patch \
+           file://0001-Check-for-musl-define-guard-before-redefining-sockle.patch \
+           file://0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch \
+           "
 SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
 SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
 
 EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \
-                LDFLAGS="${LDFLAGS}" LD="${LD}" OS="${TARGET_SYS}" \
+                LDFLAGS="${LDFLAGS}" LDLIBS="${LDLIBS}" LD="${LD}" OS="${TARGET_SYS}" \
                 TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"'
 
 do_configure() {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/nbench-byte/nbench-byte_2.2.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/nbench-byte/nbench-byte_2.2.3.bb
index 4ec1c63..56272d9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/nbench-byte/nbench-byte_2.2.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/nbench-byte/nbench-byte_2.2.3.bb
@@ -1,12 +1,12 @@
 DESCRIPTION = "BYTE Magazine's native benchmarks (also called BYTEmark) \
 designed to expose the capabilities of a system's CPU, FPU, \
 and memory system."
-HOMEPAGE = "http://www.math.utah.edu/~mayer/linux/"
+HOMEPAGE = "http://www.tux.org/~mayer/linux/"
 LICENSE = "nbench-byte"
 LIC_FILES_CHKSUM = "file://README;beginline=57;endline=66;md5=020ef579f8fa5746b7e307a54707834f"
 SECTION = "console/utils"
 
-SRC_URI = "http://www.math.utah.edu/~mayer/linux/${BP}.tar.gz \
+SRC_URI = "http://www.tux.org/~mayer/linux/${BP}.tar.gz \
            file://nbench_32bits.patch \
            file://Makefile-add-more-dependencies-to-pointer.h.patch"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/phoronix-test-suite/phoronix-test-suite_6.0.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/phoronix-test-suite/phoronix-test-suite_6.0.1.bb
deleted file mode 100644
index aab64a3..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/phoronix-test-suite/phoronix-test-suite_6.0.1.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-SUMMARY = "Phoronix Test Suite"
-DESCRIPTION = "The Phoronix Test Suite is designed to carry out both qualitative \
-and quantitative benchmarks in a clean, reproducible, and easy-to-use manner."
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-SECTION = "console/tests"
-
-SRC_URI = "http://www.phoronix-test-suite.com/releases/${BP}.tar.gz"
-SRC_URI[md5sum] = "c3b26fcc57a3a253e558f759fdc1089f"
-SRC_URI[sha256sum] = "27add54f4ecb464549de580cece84b4a4945b99df3ef7ff7034eb7f23ffb3b39"
-S = "${WORKDIR}/phoronix-test-suite"
-
-inherit systemd allarch
-
-do_install() {
-    DESTDIR=${D} ./install-sh ${exec_prefix}
-
-    if [ "${systemd_unitdir}" != "/usr/lib/systemd" ]; then
-        install -d ${D}/${systemd_unitdir}/system/
-        mv ${D}/usr/lib/systemd/system/* ${D}/${systemd_unitdir}/system/
-        rm -rf ${D}/usr/lib/
-    fi
-}
-
-SYSTEMD_SERVICE_${PN} = "phoromatic-client.service phoromatic-server.service"
-RDEPENDS_${PN} += "bash python php-cli"
-
-FILES_${PN} += " \
-    ${datadir}/phoronix-test-suite \
-    ${datadir}/appdata/phoronix-test-suite.appdata.xml \
-    ${datadir}/icons/hicolor/48x48/apps/phoronix-test-suite.png \
-    ${datadir}/icons/hicolor/64x64/mimetypes/application-x-openbenchmarking.png \
-    ${datadir}/mime/packages/openbenchmarking-mime.xml \
-    ${systemd_unitdir}/* \
-"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/phoronix-test-suite/phoronix-test-suite_6.6.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/phoronix-test-suite/phoronix-test-suite_6.6.1.bb
new file mode 100644
index 0000000..b321779
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/phoronix-test-suite/phoronix-test-suite_6.6.1.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Phoronix Test Suite"
+DESCRIPTION = "The Phoronix Test Suite is designed to carry out both qualitative \
+and quantitative benchmarks in a clean, reproducible, and easy-to-use manner."
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+SECTION = "console/tests"
+
+SRC_URI = "http://www.phoronix-test-suite.com/releases/${BP}.tar.gz"
+SRC_URI[md5sum] = "5bcac5896a4a34fc6ae4ae94991e1637"
+SRC_URI[sha256sum] = "631ceb808d8bd6cebe69c8b711d55090d6880e906a65837f18fa8200fe7d2c4d"
+
+S = "${WORKDIR}/phoronix-test-suite"
+
+inherit systemd allarch
+
+do_install() {
+    DESTDIR=${D} ./install-sh ${exec_prefix}
+
+    if [ "${systemd_unitdir}" != "/usr/lib/systemd" ]; then
+        install -d ${D}/${systemd_unitdir}/system/
+        mv ${D}/usr/lib/systemd/system/* ${D}/${systemd_unitdir}/system/
+        rm -rf ${D}/usr/lib/
+    fi
+}
+
+SYSTEMD_SERVICE_${PN} = "phoromatic-client.service phoromatic-server.service"
+RDEPENDS_${PN} += "bash python php-cli"
+
+FILES_${PN} += " \
+    ${datadir}/phoronix-test-suite \
+    ${datadir}/appdata/phoronix-test-suite.appdata.xml \
+    ${datadir}/icons/hicolor/48x48/apps/phoronix-test-suite.png \
+    ${datadir}/icons/hicolor/64x64/mimetypes/application-x-openbenchmarking.png \
+    ${datadir}/mime/packages/openbenchmarking-mime.xml \
+    ${systemd_unitdir}/* \
+"
+
+PNBLACKLIST[phoronix-test-suite] ?= "Runtime depends on blacklisted php-cli - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/pmbw/pmbw_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/pmbw/pmbw_git.bb
new file mode 100644
index 0000000..8113da7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/pmbw/pmbw_git.bb
@@ -0,0 +1,30 @@
+SUMMERY = "Parallel Memory Bandwidth Measurement / Benchmark"
+DESCRIPTION = "\
+The tool pmbw is a set of assembler routines to measure the parallel memory \
+(cache and RAM) bandwidth of modern multi-core machines."
+HOMEPAGE = "http://panthema.net/2013/pmbw/"
+SECTION = "benchmark/tests"
+AUTHOR = "Timo Bingmann"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "git://github.com/bingmann/pmbw;protocol=https"
+
+PV = "0.6.2+git${SRCPV}"
+SRCREV = "4a3b37728060a8aba06fc83f157a1965088d79d6"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+# the hand coded asm uses r11, which therefore cannot be used for storing
+# the frame pointer when debugging on arm
+SELECTED_OPTIMIZATION_remove_arm = "-fno-omit-frame-pointer"
+
+PACKAGES =+ "${PN}-stats2gnuplot"
+
+FILES_${PN}-stats2gnuplot = "${bindir}/stats2gnuplot"
+
+RRECOMMENDS_${PN} = "${PN}-stats2gnuplot"
+
+PNBLACKLIST[pmbw] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130568/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/sysbench/sysbench_0.4.12.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/sysbench/sysbench_0.4.12.bb
index fdf54e3..708c71f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/sysbench/sysbench_0.4.12.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/sysbench/sysbench_0.4.12.bb
@@ -13,7 +13,7 @@
 SRC_URI[md5sum] = "3a6d54fdd3fe002328e4458206392b9d"
 SRC_URI[sha256sum] = "83fa7464193e012c91254e595a89894d8e35b4a38324b52a5974777e3823ea9e"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'largefile', d)}"
 PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
 PACKAGECONFIG[aio] = "--enable-aio,--disable-aio,libaio,"
 PACKAGECONFIG[mysql] = "--with-mysql \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/tinymembench/tinymembench_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/tinymembench/tinymembench_git.bb
index 5968d82..8cb59da 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/tinymembench/tinymembench_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/tinymembench/tinymembench_git.bb
@@ -27,3 +27,7 @@
 #| {standard input}:82: Error: selected processor does not support Thumb mode `mla r3,r4,r3,r5'
 #| {standard input}:82: Error: unshifted register required -- `and r8,r7,r3,lsr#16'
 ARM_INSTRUCTION_SET = "arm"
+#
+# Does not work for 64bit mips.
+#
+COMPATIBLE_HOST = "^(?!mips64).*"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/bluez/bluez4.inc b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/bluez/bluez4.inc
index 59c35e4..5240ccf 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/bluez/bluez4.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/bluez/bluez4.inc
@@ -15,11 +15,7 @@
 DEPENDS = "udev libusb dbus-glib glib-2.0 libcheck readline libsndfile1"
 RDEPENDS_${PN}-dev = "bluez-hcidump"
 
-PACKAGECONFIG ??= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)}\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'pie', 'pie', '', d)}\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd','systemd', '', d)} \
-"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa pie systemd', d)}"
 PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
 PACKAGECONFIG[pie] = "--enable-pie,--disable-pie,"
 PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/,--with-systemdunitdir="
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/ell/ell_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/ell/ell_git.bb
new file mode 100644
index 0000000..d259f52
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/ell/ell_git.bb
@@ -0,0 +1,17 @@
+SUMMARY  = "Embedded Linux Library"
+DESCRIPTION = "ELL is a DBUS library which provides DBUS bindings."
+LICENSE  = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fb504b67c50331fc78734fed90fb0e09"
+SECTION = "libs"
+
+inherit autotools pkgconfig
+
+S = "${WORKDIR}/git"
+SRCREV = "399099946abaeb2f3718a0667cc11436a7c0be14"
+SRC_URI = "git://git.kernel.org/pub/scm/libs/ell/ell.git"
+
+do_configure_prepend () {
+    mkdir ${S}/build-aux
+}
+
+DEPENDS = "dbus"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/gnokii/gnokii_0.6.31.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/gnokii/gnokii_0.6.31.bb
index 2de547a..b6098d8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/gnokii/gnokii_0.6.31.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/gnokii/gnokii_0.6.31.bb
@@ -8,7 +8,7 @@
 DEPENDS = "glib-2.0 intltool-native"
 X11DEPENDS = " libxpm gtk+"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[bluez4] = "--enable-bluetooth,--disable-bluetooth,bluez4"
 PACKAGECONFIG[libical] = "--enable-libical,--disable-libical,libical"
 PACKAGECONFIG[pcsc-lite] = "--enable-libpcsclite,--disable-libpcsclite,pcsc-lite"
@@ -32,3 +32,5 @@
 
 SRC_URI[md5sum] = "d9627f4a1152d3ea7806df4532850d5f"
 SRC_URI[sha256sum] = "8f5a083b05c1a66a3402ca5cd80084e14c2c0632c991bb53b03c78e9adb02501"
+
+PNBLACKLIST[gnokii] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130662/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/gnuradio/gnuradio/0001-buildsys-don-t-add-usr-include-and-usr-lib-to-config.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/gnuradio/gnuradio/0001-buildsys-don-t-add-usr-include-and-usr-lib-to-config.patch
deleted file mode 100644
index 7caaf51..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/gnuradio/gnuradio/0001-buildsys-don-t-add-usr-include-and-usr-lib-to-config.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From a130153ae84d8bb5914879cef94df09f06825c10 Mon Sep 17 00:00:00 2001
-From: Koen Kooi <koen@dominion.thruhere.net>
-Date: Sat, 18 Jun 2011 11:25:36 +0200
-Subject: [PATCH] buildsys: don't add /usr/include and /usr/lib to configure tests for libusb
-
-Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
----
- config/usrp_libusb.m4 |   13 -------------
- 1 files changed, 0 insertions(+), 13 deletions(-)
-
-diff --git a/config/usrp_libusb.m4 b/config/usrp_libusb.m4
-index cc3410f..b421820 100644
---- a/config/usrp_libusb.m4
-+++ b/config/usrp_libusb.m4
-@@ -117,10 +117,6 @@ AC_DEFUN([USRP_LIBUSB], [
-       dnl configured to find this header.
-       AC_LANG_PUSH(C)
-       save_CPPFLAGS="$CPPFLAGS"
--      if test x$USB_INCLUDEDIR != x; then
--        USB_INCLUDES="-I$USB_INCLUDEDIR"
--        CPPFLAGS="$USB_INCLUDES"
--      fi
-       AC_MSG_CHECKING([$libusb_name for header $usb_header])
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-         #include "$usb_header"
-@@ -172,9 +168,6 @@ AC_DEFUN([USRP_LIBUSB], [
-             *)
-               AC_LANG_PUSH(C)
-               save_CPPFLAGS="$CPPFLAGS"
--              if test x$USB_INCLUDEDIR != x; then
--                CPPFLAGS="$USB_INCLUDES"
--              fi
-               save_LIBS="$LIBS"
-               LIBS="$USB_LIBS"
-               AC_MSG_CHECKING([$libusb_name for symbol usb_debug in library $usb_lib_name])
-@@ -217,9 +210,6 @@ AC_DEFUN([USRP_LIBUSB], [
-     dnl final error checking, mostly to create #define's
-     AC_LANG_PUSH(C)
-     save_CPPFLAGS="$CPPFLAGS"
--    if test x$USB_INCLUDEDIR != x; then
--      CPPFLAGS="$USB_INCLUDES"
--    fi
-     dnl Check for the header.
-     AC_CHECK_HEADERS([$usb_header], [], [libusbok=no])
-     CPPFLAGS="$save_CPPFLAGS"
-@@ -231,9 +221,6 @@ AC_DEFUN([USRP_LIBUSB], [
-       dnl check for the library (again)
-       AC_LANG_PUSH(C)
-       save_CPPFLAGS="$CPPFLAGS"
--      if test x$USB_INCLUDEDIR != x; then
--        CPPFLAGS="$USB_INCLUDES"
--      fi
-       save_LIBS="$LIBS"
-       LIBS="$USB_LIBS"
-       AC_CHECK_LIB([$usb_lib_name], [$usb_lib_func], [], [
--- 
-1.6.6.1
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd/0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd/0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch
deleted file mode 100644
index 2fc7896..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd/0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From ecbb0b3dc122b0d290987cf9c84010bbe53e1022 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni@qca.qualcomm.com>
-Date: Fri, 4 Mar 2016 17:20:18 +0200
-Subject: [PATCH 1/1] WPS: Reject a Credential with invalid passphrase
-
-WPA/WPA2-Personal passphrase is not allowed to include control
-characters. Reject a Credential received from a WPS Registrar both as
-STA (Credential) and AP (AP Settings) if the credential is for WPAPSK or
-WPA2PSK authentication type and includes an invalid passphrase.
-
-This fixes an issue where hostapd or wpa_supplicant could have updated
-the configuration file PSK/passphrase parameter with arbitrary data from
-an external device (Registrar) that may not be fully trusted. Should
-such data include a newline character, the resulting configuration file
-could become invalid and fail to be parsed.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4476
-
-Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi@windriver.com>
----
- src/utils/common.c         | 12 ++++++++++++
- src/utils/common.h         |  1 +
- src/wps/wps_attr_process.c | 10 ++++++++++
- 3 files changed, 23 insertions(+)
-
-diff --git a/src/utils/common.c b/src/utils/common.c
-index 450e2c6..27b7c02 100644
---- a/src/utils/common.c
-+++ b/src/utils/common.c
-@@ -697,6 +697,18 @@ int is_hex(const u8 *data, size_t len)
- }
- 
- 
-+int has_ctrl_char(const u8 *data, size_t len)
-+{
-+	size_t i;
-+
-+	for (i = 0; i < len; i++) {
-+		if (data[i] < 32 || data[i] == 127)
-+			return 1;
-+	}
-+	return 0;
-+}
-+
-+
- size_t merge_byte_arrays(u8 *res, size_t res_len,
- 			 const u8 *src1, size_t src1_len,
- 			 const u8 *src2, size_t src2_len)
-diff --git a/src/utils/common.h b/src/utils/common.h
-index 701dbb2..a972240 100644
---- a/src/utils/common.h
-+++ b/src/utils/common.h
-@@ -488,6 +488,7 @@ const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len);
- 
- char * wpa_config_parse_string(const char *value, size_t *len);
- int is_hex(const u8 *data, size_t len);
-+int has_ctrl_char(const u8 *data, size_t len);
- size_t merge_byte_arrays(u8 *res, size_t res_len,
- 			 const u8 *src1, size_t src1_len,
- 			 const u8 *src2, size_t src2_len);
-diff --git a/src/wps/wps_attr_process.c b/src/wps/wps_attr_process.c
-index eadb22f..e8c4579 100644
---- a/src/wps/wps_attr_process.c
-+++ b/src/wps/wps_attr_process.c
-@@ -229,6 +229,16 @@ static int wps_workaround_cred_key(struct wps_credential *cred)
- 		cred->key_len--;
- #endif /* CONFIG_WPS_STRICT */
- 	}
-+
-+
-+	if (cred->auth_type & (WPS_AUTH_WPAPSK | WPS_AUTH_WPA2PSK) &&
-+	    (cred->key_len < 8 || has_ctrl_char(cred->key, cred->key_len))) {
-+		wpa_printf(MSG_INFO, "WPS: Reject credential with invalid WPA/WPA2-Personal passphrase");
-+		wpa_hexdump_ascii_key(MSG_INFO, "WPS: Network Key",
-+				      cred->key, cred->key_len);
-+		return -1;
-+	}
-+
- 	return 0;
- }
- 
---
-1.9.1
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd/key-replay-cve-multiple.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd/key-replay-cve-multiple.patch
new file mode 100644
index 0000000..694da8f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd/key-replay-cve-multiple.patch
@@ -0,0 +1,984 @@
+The WPA2 four-way handshake protocol is vulnerable to replay attacks which can
+result in unauthenticated clients gaining access to the network.
+
+Backport a number of patches from upstream to fix this.
+
+CVE: CVE-2017-13077
+CVE: CVE-2017-13078
+CVE: CVE-2017-13079
+CVE: CVE-2017-13080
+CVE: CVE-2017-13081
+CVE: CVE-2017-13082
+CVE: CVE-2017-13086
+CVE: CVE-2017-13087
+CVE: CVE-2017-13088
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From cf4cab804c7afd5c45505528a8d16e46163243a2 Mon Sep 17 00:00:00 2001
+From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+Date: Fri, 14 Jul 2017 15:15:35 +0200
+Subject: [PATCH 1/8] hostapd: Avoid key reinstallation in FT handshake
+
+Do not reinstall TK to the driver during Reassociation Response frame
+processing if the first attempt of setting the TK succeeded. This avoids
+issues related to clearing the TX/RX PN that could result in reusing
+same PN values for transmitted frames (e.g., due to CCM nonce reuse and
+also hitting replay protection on the receiver) and accepting replayed
+frames on RX side.
+
+This issue was introduced by the commit
+0e84c25434e6a1f283c7b4e62e483729085b78d2 ('FT: Fix PTK configuration in
+authenticator') which allowed wpa_ft_install_ptk() to be called multiple
+times with the same PTK. While the second configuration attempt is
+needed with some drivers, it must be done only if the first attempt
+failed.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+---
+ src/ap/ieee802_11.c  | 16 +++++++++++++---
+ src/ap/wpa_auth.c    | 11 +++++++++++
+ src/ap/wpa_auth.h    |  3 ++-
+ src/ap/wpa_auth_ft.c | 10 ++++++++++
+ src/ap/wpa_auth_i.h  |  1 +
+ 5 files changed, 37 insertions(+), 4 deletions(-)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 4e04169..333035f 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -1841,6 +1841,7 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ {
+ 	struct ieee80211_ht_capabilities ht_cap;
+ 	struct ieee80211_vht_capabilities vht_cap;
++	int set = 1;
+ 
+ 	/*
+ 	 * Remove the STA entry to ensure the STA PS state gets cleared and
+@@ -1848,9 +1849,18 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ 	 * FT-over-the-DS, where a station re-associates back to the same AP but
+ 	 * skips the authentication flow, or if working with a driver that
+ 	 * does not support full AP client state.
++	 *
++	 * Skip this if the STA has already completed FT reassociation and the
++	 * TK has been configured since the TX/RX PN must not be reset to 0 for
++	 * the same key.
+ 	 */
+-	if (!sta->added_unassoc)
++	if (!sta->added_unassoc &&
++	    (!(sta->flags & WLAN_STA_AUTHORIZED) ||
++	     !wpa_auth_sta_ft_tk_already_set(sta->wpa_sm))) {
+ 		hostapd_drv_sta_remove(hapd, sta->addr);
++		wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED);
++		set = 0;
++	}
+ 
+ #ifdef CONFIG_IEEE80211N
+ 	if (sta->flags & WLAN_STA_HT)
+@@ -1873,11 +1883,11 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ 			    sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
+ 			    sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
+ 			    sta->vht_opmode, sta->p2p_ie ? 1 : 0,
+-			    sta->added_unassoc)) {
++			    set)) {
+ 		hostapd_logger(hapd, sta->addr,
+ 			       HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
+ 			       "Could not %s STA to kernel driver",
+-			       sta->added_unassoc ? "set" : "add");
++			       set ? "set" : "add");
+ 
+ 		if (sta->added_unassoc) {
+ 			hostapd_drv_sta_remove(hapd, sta->addr);
+diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
+index 3587086..707971d 100644
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -1745,6 +1745,9 @@ int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event)
+ #else /* CONFIG_IEEE80211R */
+ 		break;
+ #endif /* CONFIG_IEEE80211R */
++	case WPA_DRV_STA_REMOVED:
++		sm->tk_already_set = FALSE;
++		return 0;
+ 	}
+ 
+ #ifdef CONFIG_IEEE80211R
+@@ -3250,6 +3253,14 @@ int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm)
+ }
+ 
+ 
++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm)
++{
++	if (!sm || !wpa_key_mgmt_ft(sm->wpa_key_mgmt))
++		return 0;
++	return sm->tk_already_set;
++}
++
++
+ int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
+ 			     struct rsn_pmksa_cache_entry *entry)
+ {
+diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
+index 0de8d97..97461b0 100644
+--- a/src/ap/wpa_auth.h
++++ b/src/ap/wpa_auth.h
+@@ -267,7 +267,7 @@ void wpa_receive(struct wpa_authenticator *wpa_auth,
+ 		 u8 *data, size_t data_len);
+ enum wpa_event {
+ 	WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH,
+-	WPA_REAUTH_EAPOL, WPA_ASSOC_FT
++	WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_DRV_STA_REMOVED
+ };
+ void wpa_remove_ptk(struct wpa_state_machine *sm);
+ int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event);
+@@ -280,6 +280,7 @@ int wpa_auth_pairwise_set(struct wpa_state_machine *sm);
+ int wpa_auth_get_pairwise(struct wpa_state_machine *sm);
+ int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm);
+ int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm);
++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm);
+ int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
+ 			     struct rsn_pmksa_cache_entry *entry);
+ struct rsn_pmksa_cache_entry *
+diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c
+index 42242a5..e63b99a 100644
+--- a/src/ap/wpa_auth_ft.c
++++ b/src/ap/wpa_auth_ft.c
+@@ -780,6 +780,14 @@ void wpa_ft_install_ptk(struct wpa_state_machine *sm)
+ 		return;
+ 	}
+ 
++	if (sm->tk_already_set) {
++		/* Must avoid TK reconfiguration to prevent clearing of TX/RX
++		 * PN in the driver */
++		wpa_printf(MSG_DEBUG,
++			   "FT: Do not re-install same PTK to the driver");
++		return;
++	}
++
+ 	/* FIX: add STA entry to kernel/driver here? The set_key will fail
+ 	 * most likely without this.. At the moment, STA entry is added only
+ 	 * after association has been completed. This function will be called
+@@ -792,6 +800,7 @@ void wpa_ft_install_ptk(struct wpa_state_machine *sm)
+ 
+ 	/* FIX: MLME-SetProtection.Request(TA, Tx_Rx) */
+ 	sm->pairwise_set = TRUE;
++	sm->tk_already_set = TRUE;
+ }
+ 
+ 
+@@ -898,6 +907,7 @@ static int wpa_ft_process_auth_req(struct wpa_state_machine *sm,
+ 
+ 	sm->pairwise = pairwise;
+ 	sm->PTK_valid = TRUE;
++	sm->tk_already_set = FALSE;
+ 	wpa_ft_install_ptk(sm);
+ 
+ 	buflen = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
+diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h
+index 72b7eb3..7fd8f05 100644
+--- a/src/ap/wpa_auth_i.h
++++ b/src/ap/wpa_auth_i.h
+@@ -65,6 +65,7 @@ struct wpa_state_machine {
+ 	struct wpa_ptk PTK;
+ 	Boolean PTK_valid;
+ 	Boolean pairwise_set;
++	Boolean tk_already_set;
+ 	int keycount;
+ 	Boolean Pair;
+ 	struct wpa_key_replay_counter {
+-- 
+2.7.4
+
+From 927f891007c402fefd1ff384645b3f07597c3ede Mon Sep 17 00:00:00 2001
+From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+Date: Wed, 12 Jul 2017 16:03:24 +0200
+Subject: [PATCH 2/8] Prevent reinstallation of an already in-use group key
+
+Track the current GTK and IGTK that is in use and when receiving a
+(possibly retransmitted) Group Message 1 or WNM-Sleep Mode Response, do
+not install the given key if it is already in use. This prevents an
+attacker from trying to trick the client into resetting or lowering the
+sequence counter associated to the group key.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+---
+ src/common/wpa_common.h |  11 +++++
+ src/rsn_supp/wpa.c      | 116 ++++++++++++++++++++++++++++++------------------
+ src/rsn_supp/wpa_i.h    |   4 ++
+ 3 files changed, 87 insertions(+), 44 deletions(-)
+
+diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
+index af1d0f0..d200285 100644
+--- a/src/common/wpa_common.h
++++ b/src/common/wpa_common.h
+@@ -217,6 +217,17 @@ struct wpa_ptk {
+ 	size_t tk_len;
+ };
+ 
++struct wpa_gtk {
++	u8 gtk[WPA_GTK_MAX_LEN];
++	size_t gtk_len;
++};
++
++#ifdef CONFIG_IEEE80211W
++struct wpa_igtk {
++	u8 igtk[WPA_IGTK_MAX_LEN];
++	size_t igtk_len;
++};
++#endif /* CONFIG_IEEE80211W */
+ 
+ /* WPA IE version 1
+  * 00-50-f2:1 (OUI:OUI type)
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 3c47879..95bd7be 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -714,6 +714,15 @@ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ 	const u8 *_gtk = gd->gtk;
+ 	u8 gtk_buf[32];
+ 
++	/* Detect possible key reinstallation */
++	if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
++	    os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
++		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++			"WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
++			gd->keyidx, gd->tx, gd->gtk_len);
++		return 0;
++	}
++
+ 	wpa_hexdump_key(MSG_DEBUG, "WPA: Group Key", gd->gtk, gd->gtk_len);
+ 	wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 		"WPA: Installing GTK to the driver (keyidx=%d tx=%d len=%d)",
+@@ -748,6 +757,9 @@ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ 	}
+ 	os_memset(gtk_buf, 0, sizeof(gtk_buf));
+ 
++	sm->gtk.gtk_len = gd->gtk_len;
++	os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++
+ 	return 0;
+ }
+ 
+@@ -854,6 +866,48 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
+ }
+ 
+ 
++#ifdef CONFIG_IEEE80211W
++static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
++				       const struct wpa_igtk_kde *igtk)
++{
++	size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
++	u16 keyidx = WPA_GET_LE16(igtk->keyid);
++
++	/* Detect possible key reinstallation */
++	if (sm->igtk.igtk_len == len &&
++	    os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
++		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++			"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
++			keyidx);
++		return  0;
++	}
++
++	wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++		"WPA: IGTK keyid %d pn %02x%02x%02x%02x%02x%02x",
++		keyidx, MAC2STR(igtk->pn));
++	wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK", igtk->igtk, len);
++	if (keyidx > 4095) {
++		wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
++			"WPA: Invalid IGTK KeyID %d", keyidx);
++		return -1;
++	}
++	if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
++			   broadcast_ether_addr,
++			   keyidx, 0, igtk->pn, sizeof(igtk->pn),
++			   igtk->igtk, len) < 0) {
++		wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
++			"WPA: Failed to configure IGTK to the driver");
++		return -1;
++	}
++
++	sm->igtk.igtk_len = len;
++	os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++
++	return 0;
++}
++#endif /* CONFIG_IEEE80211W */
++
++
+ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ 			       struct wpa_eapol_ie_parse *ie)
+ {
+@@ -864,30 +918,14 @@ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ 	if (ie->igtk) {
+ 		size_t len;
+ 		const struct wpa_igtk_kde *igtk;
+-		u16 keyidx;
++
+ 		len = wpa_cipher_key_len(sm->mgmt_group_cipher);
+ 		if (ie->igtk_len != WPA_IGTK_KDE_PREFIX_LEN + len)
+ 			return -1;
++
+ 		igtk = (const struct wpa_igtk_kde *) ie->igtk;
+-		keyidx = WPA_GET_LE16(igtk->keyid);
+-		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: IGTK keyid %d "
+-			"pn %02x%02x%02x%02x%02x%02x",
+-			keyidx, MAC2STR(igtk->pn));
+-		wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK",
+-				igtk->igtk, len);
+-		if (keyidx > 4095) {
+-			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+-				"WPA: Invalid IGTK KeyID %d", keyidx);
+-			return -1;
+-		}
+-		if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
+-				   broadcast_ether_addr,
+-				   keyidx, 0, igtk->pn, sizeof(igtk->pn),
+-				   igtk->igtk, len) < 0) {
+-			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+-				"WPA: Failed to configure IGTK to the driver");
++		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
+ 			return -1;
+-		}
+ 	}
+ 
+ 	return 0;
+@@ -2307,7 +2345,7 @@ void wpa_sm_deinit(struct wpa_sm *sm)
+  */
+ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ {
+-	int clear_ptk = 1;
++	int clear_keys = 1;
+ 
+ 	if (sm == NULL)
+ 		return;
+@@ -2333,11 +2371,11 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ 		/* Prepare for the next transition */
+ 		wpa_ft_prepare_auth_request(sm, NULL);
+ 
+-		clear_ptk = 0;
++		clear_keys = 0;
+ 	}
+ #endif /* CONFIG_IEEE80211R */
+ 
+-	if (clear_ptk) {
++	if (clear_keys) {
+ 		/*
+ 		 * IEEE 802.11, 8.4.10: Delete PTK SA on (re)association if
+ 		 * this is not part of a Fast BSS Transition.
+@@ -2347,6 +2385,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ 		os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 		sm->tptk_set = 0;
+ 		os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++		os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++#ifdef CONFIG_IEEE80211W
++		os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++#endif /* CONFIG_IEEE80211W */
+ 	}
+ 
+ #ifdef CONFIG_TDLS
+@@ -2877,6 +2919,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
+ 	os_memset(sm->pmk, 0, sizeof(sm->pmk));
+ 	os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 	os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++	os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++#ifdef CONFIG_IEEE80211W
++	os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++#endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211R
+ 	os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
+ 	os_memset(sm->pmk_r0, 0, sizeof(sm->pmk_r0));
+@@ -2949,29 +2995,11 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf)
+ 		os_memset(&gd, 0, sizeof(gd));
+ #ifdef CONFIG_IEEE80211W
+ 	} else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) {
+-		struct wpa_igtk_kde igd;
+-		u16 keyidx;
+-
+-		os_memset(&igd, 0, sizeof(igd));
+-		keylen = wpa_cipher_key_len(sm->mgmt_group_cipher);
+-		os_memcpy(igd.keyid, buf + 2, 2);
+-		os_memcpy(igd.pn, buf + 4, 6);
+-
+-		keyidx = WPA_GET_LE16(igd.keyid);
+-		os_memcpy(igd.igtk, buf + 10, keylen);
+-
+-		wpa_hexdump_key(MSG_DEBUG, "Install IGTK (WNM SLEEP)",
+-				igd.igtk, keylen);
+-		if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
+-				   broadcast_ether_addr,
+-				   keyidx, 0, igd.pn, sizeof(igd.pn),
+-				   igd.igtk, keylen) < 0) {
+-			wpa_printf(MSG_DEBUG, "Failed to install the IGTK in "
+-				   "WNM mode");
+-			os_memset(&igd, 0, sizeof(igd));
++		const struct wpa_igtk_kde *igtk;
++
++		igtk = (const struct wpa_igtk_kde *) (buf + 2);
++		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
+ 			return -1;
+-		}
+-		os_memset(&igd, 0, sizeof(igd));
+ #endif /* CONFIG_IEEE80211W */
+ 	} else {
+ 		wpa_printf(MSG_DEBUG, "Unknown element id");
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index f653ba6..afc9e37 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -31,6 +31,10 @@ struct wpa_sm {
+ 	u8 rx_replay_counter[WPA_REPLAY_COUNTER_LEN];
+ 	int rx_replay_counter_set;
+ 	u8 request_counter[WPA_REPLAY_COUNTER_LEN];
++	struct wpa_gtk gtk;
++#ifdef CONFIG_IEEE80211W
++	struct wpa_igtk igtk;
++#endif /* CONFIG_IEEE80211W */
+ 
+ 	struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
+ 
+-- 
+2.7.4
+
+From 8280294e74846ea342389a0cd17215050fa5afe8 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Sun, 1 Oct 2017 12:12:24 +0300
+Subject: [PATCH 3/8] Extend protection of GTK/IGTK reinstallation of WNM-Sleep
+ Mode cases
+
+This extends the protection to track last configured GTK/IGTK value
+separately from EAPOL-Key frames and WNM-Sleep Mode frames to cover a
+corner case where these two different mechanisms may get used when the
+GTK/IGTK has changed and tracking a single value is not sufficient to
+detect a possible key reconfiguration.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/rsn_supp/wpa.c   | 53 +++++++++++++++++++++++++++++++++++++---------------
+ src/rsn_supp/wpa_i.h |  2 ++
+ 2 files changed, 40 insertions(+), 15 deletions(-)
+
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 95bd7be..7a2c68d 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -709,14 +709,17 @@ struct wpa_gtk_data {
+ 
+ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ 				      const struct wpa_gtk_data *gd,
+-				      const u8 *key_rsc)
++				      const u8 *key_rsc, int wnm_sleep)
+ {
+ 	const u8 *_gtk = gd->gtk;
+ 	u8 gtk_buf[32];
+ 
+ 	/* Detect possible key reinstallation */
+-	if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
+-	    os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
++	if ((sm->gtk.gtk_len == (size_t) gd->gtk_len &&
++	     os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) ||
++	    (sm->gtk_wnm_sleep.gtk_len == (size_t) gd->gtk_len &&
++	     os_memcmp(sm->gtk_wnm_sleep.gtk, gd->gtk,
++		       sm->gtk_wnm_sleep.gtk_len) == 0)) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
+ 			gd->keyidx, gd->tx, gd->gtk_len);
+@@ -757,8 +760,14 @@ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ 	}
+ 	os_memset(gtk_buf, 0, sizeof(gtk_buf));
+ 
+-	sm->gtk.gtk_len = gd->gtk_len;
+-	os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++	if (wnm_sleep) {
++		sm->gtk_wnm_sleep.gtk_len = gd->gtk_len;
++		os_memcpy(sm->gtk_wnm_sleep.gtk, gd->gtk,
++			  sm->gtk_wnm_sleep.gtk_len);
++	} else {
++		sm->gtk.gtk_len = gd->gtk_len;
++		os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++	}
+ 
+ 	return 0;
+ }
+@@ -852,7 +861,7 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
+ 	    (wpa_supplicant_check_group_cipher(sm, sm->group_cipher,
+ 					       gtk_len, gtk_len,
+ 					       &gd.key_rsc_len, &gd.alg) ||
+-	     wpa_supplicant_install_gtk(sm, &gd, key_rsc))) {
++	     wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0))) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"RSN: Failed to install GTK");
+ 		os_memset(&gd, 0, sizeof(gd));
+@@ -868,14 +877,18 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
+ 
+ #ifdef CONFIG_IEEE80211W
+ static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
+-				       const struct wpa_igtk_kde *igtk)
++				       const struct wpa_igtk_kde *igtk,
++				       int wnm_sleep)
+ {
+ 	size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
+ 	u16 keyidx = WPA_GET_LE16(igtk->keyid);
+ 
+ 	/* Detect possible key reinstallation */
+-	if (sm->igtk.igtk_len == len &&
+-	    os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
++	if ((sm->igtk.igtk_len == len &&
++	     os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) ||
++	    (sm->igtk_wnm_sleep.igtk_len == len &&
++	     os_memcmp(sm->igtk_wnm_sleep.igtk, igtk->igtk,
++		       sm->igtk_wnm_sleep.igtk_len) == 0)) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
+ 			keyidx);
+@@ -900,8 +913,14 @@ static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
+ 		return -1;
+ 	}
+ 
+-	sm->igtk.igtk_len = len;
+-	os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++	if (wnm_sleep) {
++		sm->igtk_wnm_sleep.igtk_len = len;
++		os_memcpy(sm->igtk_wnm_sleep.igtk, igtk->igtk,
++			  sm->igtk_wnm_sleep.igtk_len);
++	} else {
++		sm->igtk.igtk_len = len;
++		os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++	}
+ 
+ 	return 0;
+ }
+@@ -924,7 +943,7 @@ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ 			return -1;
+ 
+ 		igtk = (const struct wpa_igtk_kde *) ie->igtk;
+-		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
++		if (wpa_supplicant_install_igtk(sm, igtk, 0) < 0)
+ 			return -1;
+ 	}
+ 
+@@ -1574,7 +1593,7 @@ static void wpa_supplicant_process_1_of_2(struct wpa_sm *sm,
+ 	if (wpa_supplicant_rsc_relaxation(sm, key->key_rsc))
+ 		key_rsc = null_rsc;
+ 
+-	if (wpa_supplicant_install_gtk(sm, &gd, key_rsc) ||
++	if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0) ||
+ 	    wpa_supplicant_send_2_of_2(sm, key, ver, key_info) < 0)
+ 		goto failed;
+ 	os_memset(&gd, 0, sizeof(gd));
+@@ -2386,8 +2405,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ 		sm->tptk_set = 0;
+ 		os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ 		os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++		os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
+ #ifdef CONFIG_IEEE80211W
+ 		os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++		os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
+ #endif /* CONFIG_IEEE80211W */
+ 	}
+ 
+@@ -2920,8 +2941,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
+ 	os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 	os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ 	os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++	os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
+ #ifdef CONFIG_IEEE80211W
+ 	os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++	os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
+ #endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211R
+ 	os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
+@@ -2986,7 +3009,7 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf)
+ 
+ 		wpa_hexdump_key(MSG_DEBUG, "Install GTK (WNM SLEEP)",
+ 				gd.gtk, gd.gtk_len);
+-		if (wpa_supplicant_install_gtk(sm, &gd, key_rsc)) {
++		if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 1)) {
+ 			os_memset(&gd, 0, sizeof(gd));
+ 			wpa_printf(MSG_DEBUG, "Failed to install the GTK in "
+ 				   "WNM mode");
+@@ -2998,7 +3021,7 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf)
+ 		const struct wpa_igtk_kde *igtk;
+ 
+ 		igtk = (const struct wpa_igtk_kde *) (buf + 2);
+-		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
++		if (wpa_supplicant_install_igtk(sm, igtk, 1) < 0)
+ 			return -1;
+ #endif /* CONFIG_IEEE80211W */
+ 	} else {
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index afc9e37..9a54631 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -32,8 +32,10 @@ struct wpa_sm {
+ 	int rx_replay_counter_set;
+ 	u8 request_counter[WPA_REPLAY_COUNTER_LEN];
+ 	struct wpa_gtk gtk;
++	struct wpa_gtk gtk_wnm_sleep;
+ #ifdef CONFIG_IEEE80211W
+ 	struct wpa_igtk igtk;
++	struct wpa_igtk igtk_wnm_sleep;
+ #endif /* CONFIG_IEEE80211W */
+ 
+ 	struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
+-- 
+2.7.4
+
+From 8f82bc94e8697a9d47fa8774dfdaaede1084912c Mon Sep 17 00:00:00 2001
+From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+Date: Fri, 29 Sep 2017 04:22:51 +0200
+Subject: [PATCH 4/8] Prevent installation of an all-zero TK
+
+Properly track whether a PTK has already been installed to the driver
+and the TK part cleared from memory. This prevents an attacker from
+trying to trick the client into installing an all-zero TK.
+
+This fixes the earlier fix in commit
+ad00d64e7d8827b3cebd665a0ceb08adabf15e1e ('Fix TK configuration to the
+driver in EAPOL-Key 3/4 retry case') which did not take into account
+possibility of an extra message 1/4 showing up between retries of
+message 3/4.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+---
+ src/common/wpa_common.h | 1 +
+ src/rsn_supp/wpa.c      | 5 ++---
+ src/rsn_supp/wpa_i.h    | 1 -
+ 3 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
+index d200285..1021ccb 100644
+--- a/src/common/wpa_common.h
++++ b/src/common/wpa_common.h
+@@ -215,6 +215,7 @@ struct wpa_ptk {
+ 	size_t kck_len;
+ 	size_t kek_len;
+ 	size_t tk_len;
++	int installed; /* 1 if key has already been installed to driver */
+ };
+ 
+ struct wpa_gtk {
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 7a2c68d..0550a41 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -510,7 +510,6 @@ static void wpa_supplicant_process_1_of_4(struct wpa_sm *sm,
+ 		os_memset(buf, 0, sizeof(buf));
+ 	}
+ 	sm->tptk_set = 1;
+-	sm->tk_to_set = 1;
+ 
+ 	kde = sm->assoc_wpa_ie;
+ 	kde_len = sm->assoc_wpa_ie_len;
+@@ -615,7 +614,7 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
+ 	enum wpa_alg alg;
+ 	const u8 *key_rsc;
+ 
+-	if (!sm->tk_to_set) {
++	if (sm->ptk.installed) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Do not re-install same PTK to the driver");
+ 		return 0;
+@@ -659,7 +658,7 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
+ 
+ 	/* TK is not needed anymore in supplicant */
+ 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
+-	sm->tk_to_set = 0;
++	sm->ptk.installed = 1;
+ 
+ 	if (sm->wpa_ptk_rekey) {
+ 		eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL);
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index 9a54631..41f371f 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -24,7 +24,6 @@ struct wpa_sm {
+ 	struct wpa_ptk ptk, tptk;
+ 	int ptk_set, tptk_set;
+ 	unsigned int msg_3_of_4_ok:1;
+-	unsigned int tk_to_set:1;
+ 	u8 snonce[WPA_NONCE_LEN];
+ 	u8 anonce[WPA_NONCE_LEN]; /* ANonce from the last 1/4 msg */
+ 	int renew_snonce;
+-- 
+2.7.4
+
+From 12fac09b437a1dc8a0f253e265934a8aaf4d2f8b Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Sun, 1 Oct 2017 12:32:57 +0300
+Subject: [PATCH 5/8] Fix PTK rekeying to generate a new ANonce
+
+The Authenticator state machine path for PTK rekeying ended up bypassing
+the AUTHENTICATION2 state where a new ANonce is generated when going
+directly to the PTKSTART state since there is no need to try to
+determine the PMK again in such a case. This is far from ideal since the
+new PTK would depend on a new nonce only from the supplicant.
+
+Fix this by generating a new ANonce when moving to the PTKSTART state
+for the purpose of starting new 4-way handshake to rekey PTK.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/ap/wpa_auth.c | 24 +++++++++++++++++++++---
+ 1 file changed, 21 insertions(+), 3 deletions(-)
+
+diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
+index 707971d..bf10cc1 100644
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -1901,6 +1901,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2)
+ }
+ 
+ 
++static int wpa_auth_sm_ptk_update(struct wpa_state_machine *sm)
++{
++	if (random_get_bytes(sm->ANonce, WPA_NONCE_LEN)) {
++		wpa_printf(MSG_ERROR,
++			   "WPA: Failed to get random data for ANonce");
++		sm->Disconnect = TRUE;
++		return -1;
++	}
++	wpa_hexdump(MSG_DEBUG, "WPA: Assign new ANonce", sm->ANonce,
++		    WPA_NONCE_LEN);
++	sm->TimeoutCtr = 0;
++	return 0;
++}
++
++
+ SM_STATE(WPA_PTK, INITPMK)
+ {
+ 	u8 msk[2 * PMK_LEN];
+@@ -2458,9 +2473,12 @@ SM_STEP(WPA_PTK)
+ 		SM_ENTER(WPA_PTK, AUTHENTICATION);
+ 	else if (sm->ReAuthenticationRequest)
+ 		SM_ENTER(WPA_PTK, AUTHENTICATION2);
+-	else if (sm->PTKRequest)
+-		SM_ENTER(WPA_PTK, PTKSTART);
+-	else switch (sm->wpa_ptk_state) {
++	else if (sm->PTKRequest) {
++		if (wpa_auth_sm_ptk_update(sm) < 0)
++			SM_ENTER(WPA_PTK, DISCONNECTED);
++		else
++			SM_ENTER(WPA_PTK, PTKSTART);
++	} else switch (sm->wpa_ptk_state) {
+ 	case WPA_PTK_INITIALIZE:
+ 		break;
+ 	case WPA_PTK_DISCONNECT:
+-- 
+2.7.4
+
+From 6c4bed4f47d1960ec04981a9d50e5076aea5223d Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Fri, 22 Sep 2017 11:03:15 +0300
+Subject: [PATCH 6/8] TDLS: Reject TPK-TK reconfiguration
+
+Do not try to reconfigure the same TPK-TK to the driver after it has
+been successfully configured. This is an explicit check to avoid issues
+related to resetting the TX/RX packet number. There was already a check
+for this for TPK M2 (retries of that message are ignored completely), so
+that behavior does not get modified.
+
+For TPK M3, the TPK-TK could have been reconfigured, but that was
+followed by immediate teardown of the link due to an issue in updating
+the STA entry. Furthermore, for TDLS with any real security (i.e.,
+ignoring open/WEP), the TPK message exchange is protected on the AP path
+and simple replay attacks are not feasible.
+
+As an additional corner case, make sure the local nonce gets updated if
+the peer uses a very unlikely "random nonce" of all zeros.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/rsn_supp/tdls.c | 38 ++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 36 insertions(+), 2 deletions(-)
+
+diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
+index e424168..9eb9738 100644
+--- a/src/rsn_supp/tdls.c
++++ b/src/rsn_supp/tdls.c
+@@ -112,6 +112,7 @@ struct wpa_tdls_peer {
+ 		u8 tk[16]; /* TPK-TK; assuming only CCMP will be used */
+ 	} tpk;
+ 	int tpk_set;
++	int tk_set; /* TPK-TK configured to the driver */
+ 	int tpk_success;
+ 	int tpk_in_progress;
+ 
+@@ -192,6 +193,20 @@ static int wpa_tdls_set_key(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
+ 	u8 rsc[6];
+ 	enum wpa_alg alg;
+ 
++	if (peer->tk_set) {
++		/*
++		 * This same TPK-TK has already been configured to the driver
++		 * and this new configuration attempt (likely due to an
++		 * unexpected retransmitted frame) would result in clearing
++		 * the TX/RX sequence number which can break security, so must
++		 * not allow that to happen.
++		 */
++		wpa_printf(MSG_INFO, "TDLS: TPK-TK for the peer " MACSTR
++			   " has already been configured to the driver - do not reconfigure",
++			   MAC2STR(peer->addr));
++		return -1;
++	}
++
+ 	os_memset(rsc, 0, 6);
+ 
+ 	switch (peer->cipher) {
+@@ -209,12 +224,15 @@ static int wpa_tdls_set_key(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
+ 		return -1;
+ 	}
+ 
++	wpa_printf(MSG_DEBUG, "TDLS: Configure pairwise key for peer " MACSTR,
++		   MAC2STR(peer->addr));
+ 	if (wpa_sm_set_key(sm, alg, peer->addr, -1, 1,
+ 			   rsc, sizeof(rsc), peer->tpk.tk, key_len) < 0) {
+ 		wpa_printf(MSG_WARNING, "TDLS: Failed to set TPK to the "
+ 			   "driver");
+ 		return -1;
+ 	}
++	peer->tk_set = 1;
+ 	return 0;
+ }
+ 
+@@ -696,7 +714,7 @@ static void wpa_tdls_peer_clear(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
+ 	peer->cipher = 0;
+ 	peer->qos_info = 0;
+ 	peer->wmm_capable = 0;
+-	peer->tpk_set = peer->tpk_success = 0;
++	peer->tk_set = peer->tpk_set = peer->tpk_success = 0;
+ 	peer->chan_switch_enabled = 0;
+ 	os_memset(&peer->tpk, 0, sizeof(peer->tpk));
+ 	os_memset(peer->inonce, 0, WPA_NONCE_LEN);
+@@ -1159,6 +1177,7 @@ skip_rsnie:
+ 		wpa_tdls_peer_free(sm, peer);
+ 		return -1;
+ 	}
++	peer->tk_set = 0; /* A new nonce results in a new TK */
+ 	wpa_hexdump(MSG_DEBUG, "TDLS: Initiator Nonce for TPK handshake",
+ 		    peer->inonce, WPA_NONCE_LEN);
+ 	os_memcpy(ftie->Snonce, peer->inonce, WPA_NONCE_LEN);
+@@ -1751,6 +1770,19 @@ static int wpa_tdls_addset_peer(struct wpa_sm *sm, struct wpa_tdls_peer *peer,
+ }
+ 
+ 
++static int tdls_nonce_set(const u8 *nonce)
++{
++	int i;
++
++	for (i = 0; i < WPA_NONCE_LEN; i++) {
++		if (nonce[i])
++			return 1;
++	}
++
++	return 0;
++}
++
++
+ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
+ 				   const u8 *buf, size_t len)
+ {
+@@ -2004,7 +2036,8 @@ skip_rsn:
+ 	peer->rsnie_i_len = kde.rsn_ie_len;
+ 	peer->cipher = cipher;
+ 
+-	if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0) {
++	if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0 ||
++	    !tdls_nonce_set(peer->inonce)) {
+ 		/*
+ 		 * There is no point in updating the RNonce for every obtained
+ 		 * TPK M1 frame (e.g., retransmission due to timeout) with the
+@@ -2020,6 +2053,7 @@ skip_rsn:
+ 				"TDLS: Failed to get random data for responder nonce");
+ 			goto error;
+ 		}
++		peer->tk_set = 0; /* A new nonce results in a new TK */
+ 	}
+ 
+ #if 0
+-- 
+2.7.4
+
+Note: [PATCH 7/8] only applies to wpa_supplicant
+
+From b372ab0b7daea719749194dc554b26e6367603f2 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Fri, 22 Sep 2017 12:06:37 +0300
+Subject: [PATCH 8/8] FT: Do not allow multiple Reassociation Response frames
+
+The driver is expected to not report a second association event without
+the station having explicitly request a new association. As such, this
+case should not be reachable. However, since reconfiguring the same
+pairwise or group keys to the driver could result in nonce reuse issues,
+be extra careful here and do an additional state check to avoid this
+even if the local driver ends up somehow accepting an unexpected
+Reassociation Response frame.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/rsn_supp/wpa.c    | 3 +++
+ src/rsn_supp/wpa_ft.c | 8 ++++++++
+ src/rsn_supp/wpa_i.h  | 1 +
+ 3 files changed, 12 insertions(+)
+
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 0550a41..2a53c6f 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -2440,6 +2440,9 @@ void wpa_sm_notify_disassoc(struct wpa_sm *sm)
+ #ifdef CONFIG_TDLS
+ 	wpa_tdls_disassoc(sm);
+ #endif /* CONFIG_TDLS */
++#ifdef CONFIG_IEEE80211R
++	sm->ft_reassoc_completed = 0;
++#endif /* CONFIG_IEEE80211R */
+ 
+ 	/* Keys are not needed in the WPA state machine anymore */
+ 	wpa_sm_drop_sa(sm);
+diff --git a/src/rsn_supp/wpa_ft.c b/src/rsn_supp/wpa_ft.c
+index 205793e..d45bb45 100644
+--- a/src/rsn_supp/wpa_ft.c
++++ b/src/rsn_supp/wpa_ft.c
+@@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
+ 	u16 capab;
+ 
+ 	sm->ft_completed = 0;
++	sm->ft_reassoc_completed = 0;
+ 
+ 	buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
+ 		2 + sm->r0kh_id_len + ric_ies_len + 100;
+@@ -681,6 +682,11 @@ int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
+ 		return -1;
+ 	}
+ 
++	if (sm->ft_reassoc_completed) {
++		wpa_printf(MSG_DEBUG, "FT: Reassociation has already been completed for this FT protocol instance - ignore unexpected retransmission");
++		return 0;
++	}
++
+ 	if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) {
+ 		wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
+ 		return -1;
+@@ -781,6 +787,8 @@ int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
+ 		return -1;
+ 	}
+ 
++	sm->ft_reassoc_completed = 1;
++
+ 	if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0)
+ 		return -1;
+ 
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index 41f371f..56f88dc 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -128,6 +128,7 @@ struct wpa_sm {
+ 	size_t r0kh_id_len;
+ 	u8 r1kh_id[FT_R1KH_ID_LEN];
+ 	int ft_completed;
++	int ft_reassoc_completed;
+ 	int over_the_ds_in_progress;
+ 	u8 target_ap[ETH_ALEN]; /* over-the-DS target AP */
+ 	int set_ptk_after_assoc;
+-- 
+2.7.4
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd_2.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd_2.5.bb
deleted file mode 100644
index ab01235..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd_2.5.bb
+++ /dev/null
@@ -1,47 +0,0 @@
-HOMEPAGE = "http://w1.fi/hostapd/"
-SECTION = "kernel/userland"
-LICENSE = "GPLv2 | BSD"
-LIC_FILES_CHKSUM = "file://${B}/README;md5=4d53178f44d4b38418a4fa8de365e11c"
-DEPENDS = "libnl openssl"
-SUMMARY = "User space daemon for extended IEEE 802.11 management"
-
-inherit update-rc.d systemd
-INITSCRIPT_NAME = "hostapd"
-
-SYSTEMD_SERVICE_${PN} = "hostapd.service"
-SYSTEMD_AUTO_ENABLE_${PN} = "disable"
-
-SRC_URI = " \
-    http://w1.fi/releases/hostapd-${PV}.tar.gz \
-    file://defconfig \
-    file://init \
-    file://hostapd.service \
-    file://0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch \
-"
-
-S = "${WORKDIR}/hostapd-${PV}"
-B = "${WORKDIR}/hostapd-${PV}/hostapd"
-
-do_configure() {
-    install -m 0644 ${WORKDIR}/defconfig ${B}/.config
-}
-
-do_compile() {
-    export CFLAGS="-MMD -O2 -Wall -g -I${STAGING_INCDIR}/libnl3"
-    make
-}
-
-do_install() {
-    install -d ${D}${sbindir} ${D}${sysconfdir}/init.d ${D}${systemd_unitdir}/system/
-    install -m 0644 ${B}/hostapd.conf ${D}${sysconfdir}
-    install -m 0755 ${B}/hostapd ${D}${sbindir}
-    install -m 0755 ${B}/hostapd_cli ${D}${sbindir}
-    install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/hostapd
-    install -m 0644 ${WORKDIR}/hostapd.service ${D}${systemd_unitdir}/system/
-    sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/hostapd.service
-}
-
-CONFFILES_${PN} += "${sysconfdir}/hostapd.conf"
-
-SRC_URI[md5sum] = "69f9cec3f76d74f402864a43e4f8624f"
-SRC_URI[sha256sum] = "8e272d954dc0d7026c264b79b15389ec2b2c555b32970de39f506b9f463ec74a"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd_2.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd_2.6.bb
new file mode 100644
index 0000000..c3a1ead
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/hostapd/hostapd_2.6.bb
@@ -0,0 +1,48 @@
+HOMEPAGE = "http://w1.fi/hostapd/"
+SECTION = "kernel/userland"
+LICENSE = "GPLv2 | BSD"
+LIC_FILES_CHKSUM = "file://${B}/README;md5=8aa4e8c78b59b12016c4cb2d0a8db350"
+DEPENDS = "libnl openssl"
+SUMMARY = "User space daemon for extended IEEE 802.11 management"
+
+inherit update-rc.d systemd
+INITSCRIPT_NAME = "hostapd"
+
+SYSTEMD_SERVICE_${PN} = "hostapd.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "disable"
+
+SRC_URI = " \
+    http://w1.fi/releases/hostapd-${PV}.tar.gz \
+    file://defconfig \
+    file://init \
+    file://hostapd.service \
+    file://key-replay-cve-multiple.patch \
+"
+
+S = "${WORKDIR}/hostapd-${PV}"
+B = "${WORKDIR}/hostapd-${PV}/hostapd"
+
+do_configure() {
+    install -m 0644 ${WORKDIR}/defconfig ${B}/.config
+}
+
+do_compile() {
+    export CFLAGS="-MMD -O2 -Wall -g -I${STAGING_INCDIR}/libnl3"
+    make
+}
+
+do_install() {
+    install -d ${D}${sbindir} ${D}${sysconfdir}/init.d ${D}${systemd_unitdir}/system/
+    install -m 0644 ${B}/hostapd.conf ${D}${sysconfdir}
+    install -m 0755 ${B}/hostapd ${D}${sbindir}
+    install -m 0755 ${B}/hostapd_cli ${D}${sbindir}
+    install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/hostapd
+    install -m 0644 ${WORKDIR}/hostapd.service ${D}${systemd_unitdir}/system/
+    sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/hostapd.service
+}
+
+CONFFILES_${PN} += "${sysconfdir}/hostapd.conf"
+
+SRC_URI[md5sum] = "eaa56dce9bd8f1d195eb62596eab34c7"
+SRC_URI[sha256sum] = "01526b90c1d23bec4b0f052039cc4456c2fd19347b4d830d1d58a0a6aea7117d"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/irssi/irssi_0.8.16-rc1.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/irssi/irssi_0.8.16-rc1.bb
deleted file mode 100644
index 54d881d..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/irssi/irssi_0.8.16-rc1.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-SUMMARY = "ncurses IRC client"
-DESCRIPTION = "Irssi is an ncurses IRC client"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=55fdc1113306167d6ea2561404ce02f8"
-
-DEPENDS = "glib-2.0 ncurses openssl"
-
-REALPV = "0.8.16-rc1"
-PV = "0.8.15+${REALPV}"
-
-SRC_URI = "http://irssi.org/files/irssi-${REALPV}.tar.gz"
-
-SRC_URI[md5sum] = "769fec4df8e633c583c411ccd2cd563a"
-SRC_URI[sha256sum] = "bb6c0125db30b697f80837941c17372b7484c64d57a6920b8bfa7ee3def92de3"
-
-S = "${WORKDIR}/irssi-${REALPV}"
-
-inherit autotools pkgconfig
-
-EXTRA_OECONF = "--enable-ssl \
-    --with-ncurses=${STAGING_EXECPREFIXDIR} \
-"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/irssi/irssi_1.0.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/irssi/irssi_1.0.1.bb
new file mode 100644
index 0000000..041f5de
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/irssi/irssi_1.0.1.bb
@@ -0,0 +1,12 @@
+SUMMARY = "ncurses IRC client"
+DESCRIPTION = "Irssi is an ncurses IRC client"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=55fdc1113306167d6ea2561404ce02f8"
+
+DEPENDS = "glib-2.0 ncurses openssl"
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz"
+SRC_URI[md5sum] = "f6bed196cef63ea089f5cce089784445"
+SRC_URI[sha256sum] = "9428c51a3f3598ffaef438c351a8d609cf10db34f2435bdcb84456226c383ccf"
+
+inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/krb5/krb5/fix-CVE-2017-11368.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/krb5/krb5/fix-CVE-2017-11368.patch
new file mode 100644
index 0000000..a2eb7bc
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/krb5/krb5/fix-CVE-2017-11368.patch
@@ -0,0 +1,116 @@
+Upstream-Status: Backport [https://github.com/krb5/krb5/commit/ffb35baac6981f9e8914f8f3bffd37f284b85970]
+
+Backport patch to fix CVE-2017-11368.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From ffb35baac6981f9e8914f8f3bffd37f284b85970 Mon Sep 17 00:00:00 2001
+From: Greg Hudson <ghudson@mit.edu>
+Date: Thu, 13 Jul 2017 12:14:20 -0400
+Subject: [PATCH] Prevent KDC unset status assertion failures
+
+Assign status values if S4U2Self padata fails to decode, if an
+S4U2Proxy request uses invalid KDC options, or if an S4U2Proxy request
+uses an evidence ticket which does not match the canonicalized request
+server principal name.  Reported by Samuel Cabrero.
+
+If a status value is not assigned during KDC processing, default to
+"UNKNOWN_REASON" rather than failing an assertion.  This change will
+prevent future denial of service bugs due to similar mistakes, and
+will allow us to omit assigning status values for unlikely errors such
+as small memory allocation failures.
+
+CVE-2017-11368:
+
+In MIT krb5 1.7 and later, an authenticated attacker can cause an
+assertion failure in krb5kdc by sending an invalid S4U2Self or
+S4U2Proxy request.
+
+  CVSSv3 Vector: AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H/E:H/RL:O/RC:C
+
+ticket: 8599 (new)
+target_version: 1.15-next
+target_version: 1.14-next
+tags: pullup
+---
+ src/kdc/do_as_req.c  |  4 ++--
+ src/kdc/do_tgs_req.c |  3 ++-
+ src/kdc/kdc_util.c   | 10 ++++++++--
+ 3 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/src/kdc/do_as_req.c b/src/kdc/do_as_req.c
+index 2d3ad13..9b256c8 100644
+--- a/src/kdc/do_as_req.c
++++ b/src/kdc/do_as_req.c
+@@ -366,8 +366,8 @@ finish_process_as_req(struct as_req_state *state, krb5_error_code errcode)
+     did_log = 1;
+ 
+ egress:
+-    if (errcode != 0)
+-        assert (state->status != 0);
++    if (errcode != 0 && state->status == NULL)
++        state->status = "UNKNOWN_REASON";
+ 
+     au_state->status = state->status;
+     au_state->reply = &state->reply;
+diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c
+index cdc79ad..d8d6719 100644
+--- a/src/kdc/do_tgs_req.c
++++ b/src/kdc/do_tgs_req.c
+@@ -823,7 +823,8 @@ process_tgs_req(struct server_handle *handle, krb5_data *pkt,
+     free(reply.enc_part.ciphertext.data);
+ 
+ cleanup:
+-    assert(status != NULL);
++    if (status == NULL)
++        status = "UNKNOWN_REASON";
+     if (reply_key)
+         krb5_free_keyblock(kdc_context, reply_key);
+     if (errcode)
+diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c
+index 778a629..b710aef 100644
+--- a/src/kdc/kdc_util.c
++++ b/src/kdc/kdc_util.c
+@@ -1220,8 +1220,10 @@ kdc_process_for_user(kdc_realm_t *kdc_active_realm,
+     req_data.data = (char *)pa_data->contents;
+ 
+     code = decode_krb5_pa_for_user(&req_data, &for_user);
+-    if (code)
++    if (code) {
++        *status = "DECODE_PA_FOR_USER";
+         return code;
++    }
+ 
+     code = verify_for_user_checksum(kdc_context, tgs_session, for_user);
+     if (code) {
+@@ -1320,8 +1322,10 @@ kdc_process_s4u_x509_user(krb5_context context,
+     req_data.data = (char *)pa_data->contents;
+ 
+     code = decode_krb5_pa_s4u_x509_user(&req_data, s4u_x509_user);
+-    if (code)
++    if (code) {
++        *status = "DECODE_PA_S4U_X509_USER";
+         return code;
++    }
+ 
+     code = verify_s4u_x509_user_checksum(context,
+                                          tgs_subkey ? tgs_subkey :
+@@ -1624,6 +1628,7 @@ kdc_process_s4u2proxy_req(kdc_realm_t *kdc_active_realm,
+      * that is validated previously in validate_tgs_request().
+      */
+     if (request->kdc_options & (NON_TGT_OPTION | KDC_OPT_ENC_TKT_IN_SKEY)) {
++        *status = "INVALID_S4U2PROXY_OPTIONS";
+         return KRB5KDC_ERR_BADOPTION;
+     }
+ 
+@@ -1631,6 +1636,7 @@ kdc_process_s4u2proxy_req(kdc_realm_t *kdc_active_realm,
+     if (!krb5_principal_compare(kdc_context,
+                                 server->princ, /* after canon */
+                                 server_princ)) {
++        *status = "EVIDENCE_TICKET_MISMATCH";
+         return KRB5KDC_ERR_SERVER_NOMATCH;
+     }
+ 
+-- 
+2.10.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/krb5/krb5_1.13.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/krb5/krb5_1.13.6.bb
deleted file mode 100644
index 06f7f90..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/krb5/krb5_1.13.6.bb
+++ /dev/null
@@ -1,103 +0,0 @@
-SUMMARY = "A network authentication protocol"
-DESCRIPTION = "Kerberos is a system for authenticating users and services on a network. \
- Kerberos is a trusted third-party service.  That means that there is a \
- third party (the Kerberos server) that is trusted by all the entities on \
- the network (users and services, usually called "principals"). \
- . \
- This is the MIT reference implementation of Kerberos V5. \
- . \
- This package contains the Kerberos key server (KDC).  The KDC manages all \
- authentication credentials for a Kerberos realm, holds the master keys \
- for the realm, and responds to authentication requests.  This package \
- should be installed on both master and slave KDCs."
-
-HOMEPAGE = "http://web.mit.edu/Kerberos/"
-SECTION = "console/network"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${S}/../NOTICE;md5=c6f37efad53b098e420f45e7ab6807dc"
-DEPENDS = "ncurses util-linux e2fsprogs e2fsprogs-native"
-
-inherit autotools-brokensep binconfig perlnative systemd
-
-SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
-SRC_URI = "http://web.mit.edu/kerberos/dist/${BPN}/${SHRT_VER}/${BP}.tar.gz \
-           file://0001-aclocal-Add-parameter-to-disable-keyutils-detection.patch \
-           file://debian-suppress-usr-lib-in-krb5-config.patch;striplevel=2 \
-           file://crosscompile_nm.patch \
-           file://etc/init.d/krb5-kdc \
-           file://etc/init.d/krb5-admin-server \
-           file://etc/default/krb5-kdc \
-           file://etc/default/krb5-admin-server \
-           file://krb5-kdc.service \
-           file://krb5-admin-server.service \
-"
-SRC_URI[md5sum] = "6164ca9c075b4ecc68eadd6d13040417"
-SRC_URI[sha256sum] = "9c0a46b8918237a53916370d2e02298c2b294f55f0351f9404e18930bc26badc"
-
-S = "${WORKDIR}/${BP}/src"
-
-SYSTEMD_SERVICE_${PN} = "krb5-admin-server.service krb5-kdc.service"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-PACKAGECONFIG ??= "openssl"
-PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
-PACKAGECONFIG[openssl] = "--with-pkinit-crypto-impl=openssl,,openssl"
-PACKAGECONFIG[keyutils] = "--enable-keyutils,--disable-keyutils,keyutils"
-PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
-PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
-
-EXTRA_OECONF += " --without-tcl --with-system-et --disable-rpath"
-CACHED_CONFIGUREVARS += "krb5_cv_attr_constructor_destructor=yes ac_cv_func_regcomp=yes \
-                  ac_cv_printf_positional=yes ac_cv_file__etc_environment=yes \
-                  ac_cv_file__etc_TIMEZONE=no"
-
-CFLAGS_append = " -fPIC -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
-LDFLAGS_append = " -pthread"
-
-FILES_${PN} += "${datadir}/gnats"
-FILES_${PN}-doc += "${datadir}/examples"
-FILES_${PN}-dbg += "${libdir}/krb5/plugins/*/.debug"
-
-# As this recipe doesn't inherit update-rc.d, we need to add this dependency here
-RDEPENDS_${PN}_class-target += "initscripts-functions"
-
-do_configure() {
-    gnu-configize --force
-    autoreconf
-    oe_runconf
-}
-
-do_install_append() {
-    rm -rf ${D}/${localstatedir}/run
-
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
-        mkdir -p ${D}/${sysconfdir}/init.d ${D}/${sysconfdir}/default
-        install -m 0755 ${WORKDIR}/etc/init.d/* ${D}/${sysconfdir}/init.d
-        install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default
-
-        mkdir -p ${D}/${sysconfdir}/default/volatiles
-        echo "d root root 0755 ${localstatedir}/run/krb5kdc none" \
-              > ${D}${sysconfdir}/default/volatiles/87_krb5
-    fi
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/tmpfiles.d
-        echo "d /run/krb5kdc - - - -" \
-              > ${D}${sysconfdir}/tmpfiles.d/krb5.conf
-
-        install -d ${D}${systemd_system_unitdir}
-        install -m 0644 ${WORKDIR}/krb5-admin-server.service ${D}${systemd_system_unitdir}
-        install -m 0644 ${WORKDIR}/krb5-kdc.service ${D}${systemd_system_unitdir}
-    fi
-}
-
-pkg_postinst_${PN} () {
-    if [ -z "$D" ]; then
-        if command -v systemd-tmpfiles >/dev/null; then
-            systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/krb5.conf
-        elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
-            ${sysconfdir}/init.d/populate-volatile.sh update
-        fi
-    fi
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/krb5/krb5_1.15.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/krb5/krb5_1.15.1.bb
new file mode 100644
index 0000000..b515eb5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/krb5/krb5_1.15.1.bb
@@ -0,0 +1,183 @@
+SUMMARY = "A network authentication protocol"
+DESCRIPTION = "Kerberos is a system for authenticating users and services on a network. \
+ Kerberos is a trusted third-party service.  That means that there is a \
+ third party (the Kerberos server) that is trusted by all the entities on \
+ the network (users and services, usually called "principals"). \
+ . \
+ This is the MIT reference implementation of Kerberos V5. \
+ . \
+ This package contains the Kerberos key server (KDC).  The KDC manages all \
+ authentication credentials for a Kerberos realm, holds the master keys \
+ for the realm, and responds to authentication requests.  This package \
+ should be installed on both master and slave KDCs."
+
+HOMEPAGE = "http://web.mit.edu/Kerberos/"
+SECTION = "console/network"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${S}/../NOTICE;md5=3e12b8a065cca25dfdcac734fb3ec0b9"
+DEPENDS = "ncurses util-linux e2fsprogs e2fsprogs-native"
+
+inherit autotools-brokensep binconfig perlnative systemd update-rc.d
+
+SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "http://web.mit.edu/kerberos/dist/${BPN}/${SHRT_VER}/${BP}.tar.gz \
+           file://0001-aclocal-Add-parameter-to-disable-keyutils-detection.patch \
+           file://debian-suppress-usr-lib-in-krb5-config.patch;striplevel=2 \
+           file://crosscompile_nm.patch \
+           file://etc/init.d/krb5-kdc \
+           file://etc/init.d/krb5-admin-server \
+           file://etc/default/krb5-kdc \
+           file://etc/default/krb5-admin-server \
+           file://krb5-kdc.service \
+           file://krb5-admin-server.service \
+           file://fix-CVE-2017-11368.patch;striplevel=2 \
+"
+SRC_URI[md5sum] = "8022f3a1cde8463e44fd35ef42731f85"
+SRC_URI[sha256sum] = "437c8831ddd5fde2a993fef425dedb48468109bb3d3261ef838295045a89eb45"
+
+CVE_PRODUCT = "kerberos"
+
+S = "${WORKDIR}/${BP}/src"
+
+PACKAGECONFIG ??= "openssl"
+PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
+PACKAGECONFIG[openssl] = "--with-pkinit-crypto-impl=openssl,,openssl"
+PACKAGECONFIG[keyutils] = "--enable-keyutils,--disable-keyutils,keyutils"
+PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
+PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
+
+EXTRA_OECONF += " --without-tcl --with-system-et --disable-rpath"
+CACHED_CONFIGUREVARS += "krb5_cv_attr_constructor_destructor=yes ac_cv_func_regcomp=yes \
+                  ac_cv_printf_positional=yes ac_cv_file__etc_environment=yes \
+                  ac_cv_file__etc_TIMEZONE=no"
+
+CFLAGS_append = " -fPIC -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
+LDFLAGS_append = " -pthread"
+
+do_configure() {
+    gnu-configize --force
+    autoreconf
+    oe_runconf
+}
+
+do_install_append() {
+    rm -rf ${D}/${localstatedir}/run
+    rm -f ${D}${bindir}/sclient
+    rm -f ${D}${bindir}/sim_client
+    rm -f ${D}${bindir}/uuclient
+    rm -f ${D}${sbindir}/krb5-send-pr
+    rm -f ${D}${sbindir}/sim_server
+    rm -f ${D}${sbindir}/sserver
+    rm -f ${D}${sbindir}/uuserver
+
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+        mkdir -p ${D}/${sysconfdir}/init.d ${D}/${sysconfdir}/default
+        install -m 0755 ${WORKDIR}/etc/init.d/* ${D}/${sysconfdir}/init.d
+        install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default
+
+        mkdir -p ${D}/${sysconfdir}/default/volatiles
+        echo "d root root 0755 ${localstatedir}/run/krb5kdc none" \
+              > ${D}${sysconfdir}/default/volatiles/87_krb5
+    fi
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -d ${D}${sysconfdir}/tmpfiles.d
+        echo "d /run/krb5kdc - - - -" \
+              > ${D}${sysconfdir}/tmpfiles.d/krb5.conf
+
+        install -d ${D}${systemd_system_unitdir}
+        install -m 0644 ${WORKDIR}/krb5-admin-server.service ${D}${systemd_system_unitdir}
+        install -m 0644 ${WORKDIR}/krb5-kdc.service ${D}${systemd_system_unitdir}
+    fi
+}
+
+PACKAGES =+ "${PN}-admin-server \
+             ${PN}-gss-samples \
+             ${PN}-k5tls \
+             ${PN}-kdc \
+             ${PN}-kdc-ldap \
+             ${PN}-kpropd \
+             ${PN}-otp \
+             ${PN}-pkinit \
+             ${PN}-user \
+             libgssapi-krb5 \
+             libgssrpc \
+             libk5crypto \
+             libkadm5clnt-mit \
+             libkadm5srv-mit \
+             libkdb5 \
+             libkrad \
+             libkrb5 \
+             libkrb5support \
+             libverto"
+
+FILES_${PN} = "${libdir}/krb5/plugins/preauth/test.so"
+FILES_${PN}-doc += "${datadir}/examples"
+FILES_${PN}-dbg += "${libdir}/krb5/plugins/*/.debug"
+
+FILES_${PN}-admin-server = "${sbindir}/kadmin.local \
+                            ${sbindir}/kadmind \
+                            ${sbindir}/kprop \
+                            ${sysconfdir}/default/krb5-admin-server \
+                            ${sysconfdir}/init.d/krb5-admin-server \
+                            ${systemd_system_unitdir}/krb5-admin-server.service"
+
+FILES_${PN}-gss-samples = "${bindir}/gss-client \
+                           ${sbindir}/gss-server"
+
+FILES_${PN}-k5tls = "${libdir}/krb5/plugins/tls/k5tls.so"
+
+FILES_${PN}-kdc = "${libdir}/krb5/plugins/kdb/db2.so \
+                   ${localstatedir}/krb5kdc \
+                   ${sbindir}/kdb5_util \
+                   ${sbindir}/kproplog \
+                   ${sbindir}/krb5kdc \
+                   ${sysconfdir}/default/krb5-kdc \
+                   ${sysconfdir}/default/volatiles/87_krb5 \
+                   ${sysconfdir}/init.d/krb5-kdc \
+                   ${sysconfdir}/tmpfiles.d/krb5.conf \
+                   ${systemd_system_unitdir}/krb5-kdc.service"
+
+FILES_${PN}-kdc-ldap = "${libdir}/krb5/libkdb_ldap${SOLIBS} \
+                        ${libdir}/krb5/plugins/kdb/kldap.so \
+                        ${sbindir}/kdb5_ldap_util"
+
+FILES_${PN}-kpropd = "${sbindir}/kpropd"
+FILES_${PN}-otp = "${libdir}/krb5/plugins/preauth/otp.so"
+FILES_${PN}-pkinit = "${libdir}/krb5/plugins/preauth/pkinit.so"
+FILES_${PN}-user = "${bindir}/k*"
+
+FILES_libgssapi-krb5 = "${libdir}/libgssapi_krb5${SOLIBS}"
+FILES_libgssrpc = "${libdir}/libgssrpc${SOLIBS}"
+FILES_libk5crypto = "${libdir}/libk5crypto${SOLIBS}"
+FILES_libkadm5clnt-mit = "${libdir}/libkadm5clnt_mit${SOLIBS}"
+FILES_libkadm5srv-mit = "${libdir}/libkadm5srv_mit${SOLIBS}"
+FILES_libkdb5 = "${libdir}/libkdb5${SOLIBS}"
+FILES_libkrad = "${libdir}/libkrad${SOLIBS}"
+FILES_libkrb5 = "${libdir}/libkrb5${SOLIBS} \
+                 ${libdir}/krb5/plugins/authdata \
+                 ${libdir}/krb5/plugins/libkrb5"
+FILES_libkrb5support = "${libdir}/libkrb5support${SOLIBS}"
+FILES_libverto = "${libdir}/libverto${SOLIBS}"
+
+RDEPENDS_${PN}-kadmin-server = "${PN}-kdc"
+RDEPENDS_${PN}-kpropd = "${PN}-kdc"
+
+INITSCRIPT_PACKAGES = "${PN}-admin-server ${PN}-kdc"
+INITSCRIPT_NAME_${PN}-admin-server = "krb5-admin-server"
+INITSCRIPT_NAME_${PN}-kdc = "krb5-kdc"
+
+SYSTEMD_PACKAGES = "${PN}-admin-server ${PN}-kdc"
+SYSTEMD_SERVICE_${PN}-admin-server = "krb5-admin-server.service"
+SYSTEMD_SERVICE_${PN}-kdc = "krb5-kdc.service"
+
+pkg_postinst_${PN}-kdc () {
+    if [ -z "$D" ]; then
+        if command -v systemd-tmpfiles >/dev/null; then
+            systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/krb5.conf
+        elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+            ${sysconfdir}/init.d/populate-volatile.sh update
+        fi
+    fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libev/libev_4.24.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libev/libev_4.24.bb
new file mode 100644
index 0000000..5e0f3a5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libev/libev_4.24.bb
@@ -0,0 +1,22 @@
+SUMMARY = "A full-featured and high-performance event loop that is loosely \
+modelled after libevent."
+HOMEPAGE = "http://software.schmorp.de/pkg/libev.html"
+LICENSE = "BSD-2-Clause | GPL-2.0+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d6ad416afd040c90698edcdf1cbee347"
+
+SRC_URI = "http://dist.schmorp.de/libev/Attic/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "94459a5a22db041dec6f98424d6efe54"
+SRC_URI[sha256sum] = "973593d3479abdf657674a55afe5f78624b0e440614e2b8cb3a07f16d4d7f821"
+
+S = "${WORKDIR}/${PN}-${PV}"
+
+inherit autotools
+
+EXTRA_OECONF += "--with-pic"
+
+do_install_append() {
+    # Avoid conflicting with libevent. The provided compatibility layer is
+    # still basic so drop it for now.
+    rm ${D}${includedir}/event.h
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libmbim/libmbim_1.14.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libmbim/libmbim_1.14.0.bb
index 02a1788..f89ef9d 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libmbim/libmbim_1.14.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libmbim/libmbim_1.14.0.bb
@@ -7,7 +7,7 @@
     file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
 "
 
-DEPENDS = "glib-2.0 libgudev"
+DEPENDS = "glib-2.0 glib-2.0-native libgudev"
 
 inherit autotools pkgconfig bash-completion
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libmtp/libmtp_1.1.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libmtp/libmtp_1.1.5.bb
index b5df8e0..c05ff4e 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libmtp/libmtp_1.1.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libmtp/libmtp_1.1.5.bb
@@ -50,9 +50,6 @@
 RDEPENDS_${PN} += "libmtp-common"
 RRECOMMENDS_${PN} += "libmtp-runtime mtp-tools"
 FILES_${PN}-dbg += "${nonarch_base_libdir}/udev/.debug/*"
-PKG_${PN}-bin = "mtp-tools"
-SUMMARY_${PN}-bin = "Tools for communicating with MTP devices"
-DESCRIPTION_${PN}-bin = "${DESCRIPTION}\nThis package contains tools for communicating with MTP devices."
 FILES_libmtp-common = "${nonarch_base_libdir}/udev/rules.d/*"
 SUMMARY_libmtp-common = "The udev rules file for MTP devices"
 FILES_libmtp-runtime = "${nonarch_base_libdir}/udev/mtp-probe"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libndp/libndp/0001-include-sys-select.h-for-fd_-definitions.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libndp/libndp/0001-include-sys-select.h-for-fd_-definitions.patch
new file mode 100644
index 0000000..15aa94e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libndp/libndp/0001-include-sys-select.h-for-fd_-definitions.patch
@@ -0,0 +1,25 @@
+From 94e9a082d76414f82794b0c9817d0c24e3868275 Mon Sep 17 00:00:00 2001
+From: Kylie McClain <somasis@exherbo.org>
+Date: Sat, 21 May 2016 21:24:36 -0400
+Subject: [PATCH] ndptool: Fix compilation on musl libc
+
+FD_ZERO, fd_set, etc are defined within sys/select.h on musl.
+
+Signed-off-by: Kylie McClain <somasis@exherbo.org>
+Signed-off-by: Jiri Pirko <jiri@mellanox.com>
+---
+ utils/ndptool.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/utils/ndptool.c b/utils/ndptool.c
+index 1d96f4c..96479fa 100644
+--- a/utils/ndptool.c
++++ b/utils/ndptool.c
+@@ -28,6 +28,7 @@
+ #include <arpa/inet.h>
+ #include <errno.h>
+ #include <ndp.h>
++#include <sys/select.h>
+ 
+ enum verbosity_level {
+ 	VERB1,
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libndp/libndp_1.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libndp/libndp_1.6.bb
index a35dff8..2cc345a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libndp/libndp_1.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libndp/libndp_1.6.bb
@@ -3,8 +3,11 @@
 LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 
-SRC_URI = "http://libndp.org/files/${BPN}-${PV}.tar.gz"
-SRC_URI[md5sum] = "1e54d26bcb4a4110bc3f90c5dd04f1a7"
-SRC_URI[sha256sum] = "0c7dfa84e013bd5e569ef2c6292a6f72cfaf14f4ff77a77425e52edc33ffac0e"
+SRC_URI = "git://github.com/jpirko/libndp \
+           file://0001-include-sys-select.h-for-fd_-definitions.patch \
+           "
+# tag for v1.6
+SRCREV = "2f721c4ff519f38f46695a60d9f9d88f35bf3c1d"
+S = "${WORKDIR}/git"
 
 inherit autotools
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libqmi/libqmi_1.16.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libqmi/libqmi_1.16.0.bb
index 679b102..80c26c0 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libqmi/libqmi_1.16.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libqmi/libqmi_1.16.0.bb
@@ -7,7 +7,7 @@
     file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
 "
 
-DEPENDS = "glib-2.0 libgudev libmbim"
+DEPENDS = "glib-2.0 libgudev libmbim glib-2.0-native"
 
 inherit autotools pkgconfig bash-completion
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent/0001-Define-64bit-atomic-helpers-for-ppc-32-bit.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent/0001-Define-64bit-atomic-helpers-for-ppc-32-bit.patch
new file mode 100644
index 0000000..4d09797
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent/0001-Define-64bit-atomic-helpers-for-ppc-32-bit.patch
@@ -0,0 +1,30 @@
+From c9859a38a58996b8767a30e14febc03845f66f95 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 1 Jul 2017 13:10:53 -0700
+Subject: [PATCH] Define 64bit atomic helpers for ppc 32-bit
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/atomic64.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/atomic64.c b/src/atomic64.c
+index f841b39b..35c7c9d8 100644
+--- a/src/atomic64.c
++++ b/src/atomic64.c
+@@ -18,10 +18,10 @@
+ #include <stdbool.h>
+ 
+ /*
+- * only need these on MIPS, since it lacks hardware 64-bit atomics,
++ * only need these on MIPS & PPC32, since it lacks hardware 64-bit atomics,
+  * unlike x86 and ARM.
+  */
+-#if defined(__mips__) || defined(__mipsel__)
++#if defined(__mips__) || defined(__mipsel__) || defined(__powerpc__)
+ 
+ static void __spin_lock(volatile int *lock) {
+   while (__sync_lock_test_and_set(lock, 1))
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent/0001-implement-64bit-atomic-for-mips.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent/0001-implement-64bit-atomic-for-mips.patch
new file mode 100644
index 0000000..84e0772
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent/0001-implement-64bit-atomic-for-mips.patch
@@ -0,0 +1,263 @@
+From d7b6df5808e7bef5930b61a82e880699a9f9e208 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 29 Jun 2017 15:39:19 -0700
+Subject: [PATCH] implement 64bit atomic for mips
+
+GCC does not provide 64bit atomics for mips32
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/Makefile.am |   1 +
+ src/atomic64.c  | 228 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 229 insertions(+)
+ create mode 100644 src/atomic64.c
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 99aaace0..cbbbbee9 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -27,6 +27,7 @@ libtorrent_la_LIBADD = \
+ 	utils/libsub_utils.la
+ 
+ libtorrent_la_SOURCES = \
++	atomic64.c \
+ 	globals.cc \
+ 	globals.h \
+ 	manager.cc \
+diff --git a/src/atomic64.c b/src/atomic64.c
+new file mode 100644
+index 00000000..f841b39b
+--- /dev/null
++++ b/src/atomic64.c
+@@ -0,0 +1,228 @@
++/*===----- atomic64.c - Support functions for 64-bit atomic operations.-----===
++ *
++ *                     The LLVM Compiler Infrastructure
++ *
++ * This file is dual licensed under the MIT and the University of Illinois Open
++ * Source Licenses. See LICENSE.TXT for details.
++ *
++ *===-----------------------------------------------------------------------===
++ *
++ *  atomic64.c defines a set of functions for performing atomic accesses on
++ *  64-bit memory locations. It also implements spinlock synchronization
++ *  operations.
++ *
++ *===-----------------------------------------------------------------------===
++ */
++
++#include <stdint.h>
++#include <stdbool.h>
++
++/*
++ * only need these on MIPS, since it lacks hardware 64-bit atomics,
++ * unlike x86 and ARM.
++ */
++#if defined(__mips__) || defined(__mipsel__)
++
++static void __spin_lock(volatile int *lock) {
++  while (__sync_lock_test_and_set(lock, 1))
++    while (*lock) {}
++}
++
++static void __spin_unlock(volatile int *lock) {
++  __sync_lock_release(lock);
++}
++
++/*
++ * Make sure the lock is on its own cache line to prevent false sharing.
++ * Put it inside a struct that is aligned and padded to the typical MIPS
++ * cacheline which is 32 bytes.
++ */
++static struct {
++  int lock;
++  char pad[32 - sizeof(int)];
++} __attribute__((aligned (32))) lock = { 0 };
++
++
++uint64_t __sync_fetch_and_add_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr;
++  *ptr = ret + val;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_fetch_and_sub_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr;
++  *ptr = ret - val;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_fetch_and_and_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr;
++  *ptr = ret & val;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_fetch_and_or_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr;
++  *ptr = ret | val;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_fetch_and_xor_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr;
++  *ptr = ret ^ val;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_add_and_fetch_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr + val;
++  *ptr = ret;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_sub_and_fetch_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr - val;
++  *ptr = ret;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_and_and_fetch_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr & val;
++  *ptr = ret;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_or_and_fetch_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr | val;
++  *ptr = ret;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_xor_and_fetch_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr ^ val;
++  *ptr = ret;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++bool __sync_bool_compare_and_swap_8(volatile uint64_t *ptr,
++                                         uint64_t oldval, uint64_t newval) {
++  bool ret = false;
++
++  __spin_lock(&lock.lock);
++
++  if (*ptr == oldval) {
++    *ptr = newval;
++    ret = true;
++  }
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_val_compare_and_swap_8(volatile uint64_t *ptr,
++                                            uint64_t oldval, uint64_t newval) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr;
++  if (ret == oldval)
++    *ptr = newval;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++uint64_t __sync_lock_test_and_set_8(volatile uint64_t *ptr, uint64_t val) {
++  uint64_t ret;
++
++  __spin_lock(&lock.lock);
++
++  ret = *ptr;
++  *ptr = val;
++
++  __spin_unlock(&lock.lock);
++
++  return ret;
++}
++
++void __sync_lock_release_8(volatile uint64_t *ptr) {
++  __spin_lock(&lock.lock);
++
++  *ptr = 0;
++
++  __spin_unlock(&lock.lock);
++}
++
++#endif
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent_0.13.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent_0.13.3.bb
deleted file mode 100644
index 4af3a6a..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent_0.13.3.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-DESCRIPTION = "libTorrent is a BitTorrent library written in C++ for *nix, \
-with a focus on high performance and good code."
-HOMEPAGE = "http://libtorrent.rakshasa.no/"
-LICENSE = "GPL-2.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
-
-DEPENDS = "libsigc++-2.0 openssl cppunit"
-
-SRC_URI = "http://libtorrent.rakshasa.no/downloads/${BP}.tar.gz \
-    file://don-t-run-code-while-configuring-package.patch \
-"
-
-SRC_URI[md5sum] = "e94f6c590bb02aaf4d58618f738a85f2"
-SRC_URI[sha256sum] = "34317d6783b7f8d0805274c9467475b5432a246c0de8e28fc16e3b0b43f35677"
-
-inherit autotools pkgconfig
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent_git.bb
new file mode 100644
index 0000000..92e6528
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libtorrent/libtorrent_git.bb
@@ -0,0 +1,26 @@
+DESCRIPTION = "libTorrent is a BitTorrent library written in C++ for *nix, \
+with a focus on high performance and good code."
+HOMEPAGE = "http://libtorrent.rakshasa.no/"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+DEPENDS = "zlib libsigc++-2.0 openssl cppunit"
+
+SRC_URI = "git://github.com/rakshasa/libtorrent \
+           file://don-t-run-code-while-configuring-package.patch \
+           file://0001-implement-64bit-atomic-for-mips.patch \
+           file://0001-Define-64bit-atomic-helpers-for-ppc-32-bit.patch \
+           "
+SRCREV = "c167c5a9e0bcf0df23ae5efd91396aae0e37eb87"
+
+PV = "0.13.6+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--with-zlib=${STAGING_EXECPREFIXDIR}"
+
+do_configure_prepend() {
+    (cd ${S}; ./autogen.sh; cd -)
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libuv/libuv_1.11.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libuv/libuv_1.11.0.bb
new file mode 100644
index 0000000..0a5846b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libuv/libuv_1.11.0.bb
@@ -0,0 +1,19 @@
+SUMMARY = "A multi-platform support library with a focus on asynchronous I/O"
+HOMEPAGE = "https://github.com/libuv/libuv"
+BUGTRACKER = "https://github.com/libuv/libuv/issues"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=bb5ea0d651f4c3519327171906045775"
+
+SRC_URI = "https://github.com/libuv/${BPN}/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz"
+
+SRC_URI[md5sum] = "15550a9f5f45f7f32ae2d9bb0a21a2a7"
+SRC_URI[sha256sum] = "6ec7eec6ecc24b1a8ffedebedb2fe9313fffb5410de89aaf784dd01080411c7a"
+
+inherit autotools
+
+do_configure() {
+    ${S}/autogen.sh || bbnote "${PN} failed to autogen.sh"
+    oe_runconf
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_2.1.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_2.1.0.bb
new file mode 100644
index 0000000..9354799
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_2.1.0.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Canonical libwebsockets.org websocket library"
+HOMEPAGE = "https://libwebsockets.org/"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3393a657830d4a118c5a6ed35ba53d0"
+
+DEPENDS = "zlib"
+
+SRC_URI = "https://github.com/warmcat/libwebsockets/archive/v${PV}.tar.gz"
+
+SRC_URI[md5sum] = "4df3be57dee43aeebd54a3ed56568f50"
+SRC_URI[sha256sum] = "bcc96aaa609daae4d3f7ab1ee480126709ef4f6a8bf9c85de40aae48e38cce66"
+
+inherit cmake pkgconfig
+
+PACKAGECONFIG ?= "libuv client server http2 ssl"
+PACKAGECONFIG[client] = "-DLWS_WITHOUT_CLIENT=OFF,-DLWS_WITHOUT_CLIENT=ON,"
+PACKAGECONFIG[http2] = "-DLWS_WITH_HTTP2=ON,-DLWS_WITH_HTTP2=OFF,"
+PACKAGECONFIG[ipv6] = "-DLWS_IPV6=ON,-DLWS_IPV6=OFF,"
+PACKAGECONFIG[libev] = "-DLWS_WITH_LIBEV=ON,-DLWS_WITH_LIBEV=OFF,libev"
+PACKAGECONFIG[libuv] = "-DLWS_WITH_LIBUV=ON,-DLWS_WITH_LIBUV=OFF,libuv"
+PACKAGECONFIG[server] = "-DLWS_WITHOUT_SERVER=OFF,-DLWS_WITHOUT_SERVER=ON,"
+PACKAGECONFIG[ssl] = "-DLWS_WITH_SSL=ON,-DLWS_WITH_SSL=OFF,openssl"
+PACKAGECONFIG[testapps] = "-DLWS_WITHOUT_TESTAPPS=OFF,-DLWS_WITHOUT_TESTAPPS=ON,"
+
+PACKAGES =+ "${PN}-testapps"
+
+FILES_${PN}-dev += "${libdir}/cmake"
+FILES_${PN}-testapps += "${datadir}/libwebsockets-test-server/*"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/linuxptp/linuxptp/no-incdefs-using-host-headers.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/linuxptp/linuxptp/no-incdefs-using-host-headers.patch
new file mode 100644
index 0000000..02dbb23
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/linuxptp/linuxptp/no-incdefs-using-host-headers.patch
@@ -0,0 +1,29 @@
+From 8a4cad5e2f2cbb6a34bdc6e877fe499502b8c4c8 Mon Sep 17 00:00:00 2001
+From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
+Date: Fri, 23 Dec 2016 18:12:29 +0100
+Subject: [PATCH] linuxptp: no incdefs using host headers
+
+Avoid using host headers via incdefs.sh shell script.
+
+Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
+---
+
+ makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/makefile b/makefile
+index 8cdbd15..85174b8 100644
+--- a/makefile
++++ b/makefile
+@@ -33,7 +33,7 @@ OBJECTS	= $(OBJ) hwstamp_ctl.o phc2sys.o phc_ctl.o pmc.o pmc_common.o \
+ SRC	= $(OBJECTS:.o=.c)
+ DEPEND	= $(OBJECTS:.o=.d)
+ srcdir	:= $(dir $(lastword $(MAKEFILE_LIST)))
+-incdefs := $(shell $(srcdir)/incdefs.sh)
++#incdefs := $(shell $(srcdir)/incdefs.sh)
+ version := $(shell $(srcdir)/version.sh $(srcdir))
+ VPATH	= $(srcdir)
+ 
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/linuxptp/linuxptp_1.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/linuxptp/linuxptp_1.6.bb
index 0939d17..2e28644 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/linuxptp/linuxptp_1.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/linuxptp/linuxptp_1.6.bb
@@ -3,13 +3,14 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
 SRC_URI = "http://sourceforge.net/projects/linuxptp/files/v${PV}/linuxptp-${PV}.tgz \
-           file://build-Allow-CC-and-prefix-to-be-overriden.patch"
+           file://build-Allow-CC-and-prefix-to-be-overriden.patch \
+           file://no-incdefs-using-host-headers.patch"
 
 SRC_URI[md5sum] = "6aa15d83f5a35f1fd076ba9adc4e7285"
 SRC_URI[sha256sum] = "e7fd16a9f235b059be527bd512e86f0c1d9f2e7c36736e6d6d9727a4427ac14c"
 
 EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} \
-    EXTRA_CFLAGS='-D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME -DHAVE_ONESTEP_SYNC ${CFLAGS}'"
+    EXTRA_CFLAGS='-D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME -DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC ${CFLAGS}'"
 
 do_install () {
     install -d ${D}/${bindir}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc.inc b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc.inc
deleted file mode 100644
index 6ff8e01..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc.inc
+++ /dev/null
@@ -1,13 +0,0 @@
-DESCRIPTION = "LIRC is a package that allows you to decode and send infra-red signals of many commonly used remote controls."
-DESCRIPTION_append_lirc = " This package contains the lirc daemon, libraries and tools."
-DESCRIPTION_append_lirc-exec = " This package contains a daemon that runs programs on IR signals."
-DESCRIPTION_append_lirc-remotes = " This package contains some config files for remotes."
-DESCRIPTION_append_lirc-nslu2example = " This package contains a working config for RC5 remotes and a modified NSLU2."
-HOMEPAGE = "http://www.lirc.org"
-SECTION = "console/network"
-LICENSE = "GPLv2"
-DEPENDS = "alsa-lib libftdi libusb1 libusb-compat jack portaudio-v19"
-
-SRC_URI = "http://prdownloads.sourceforge.net/lirc/lirc-${PV}.tar.bz2"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc/0001-lircrcd-Mark-local-inline-funtions-as-static.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc/0001-lircrcd-Mark-local-inline-funtions-as-static.patch
deleted file mode 100644
index e19d276..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc/0001-lircrcd-Mark-local-inline-funtions-as-static.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c2be4543e4777c9e3d74b30326ba37b01917b0a9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 25 Aug 2016 03:02:37 +0000
-Subject: [PATCH] lircrcd: Mark local inline funtions as static
-
-These functions are not used anywhere outside
-this file, so they should be converted into static
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- daemons/lircrcd.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/daemons/lircrcd.c b/daemons/lircrcd.c
-index 55777cd..5ddc94d 100644
---- a/daemons/lircrcd.c
-+++ b/daemons/lircrcd.c
-@@ -153,7 +153,7 @@ char *s;
- /* A safer write(), since sockets might not write all but only some of the
-    bytes requested */
- 
--inline int write_socket(int fd, char *buf, int len)
-+static inline int write_socket(int fd, char *buf, int len)
- {
- 	int done, todo = len;
- 
-@@ -167,7 +167,7 @@ inline int write_socket(int fd, char *buf, int len)
- 	return (len);
- }
- 
--inline int write_socket_len(int fd, char *buf)
-+static inline int write_socket_len(int fd, char *buf)
- {
- 	int len;
- 
-@@ -177,7 +177,7 @@ inline int write_socket_len(int fd, char *buf)
- 	return (1);
- }
- 
--inline int read_timeout(int fd, char *buf, int len, int timeout)
-+static inline int read_timeout(int fd, char *buf, int len, int timeout)
- {
- 	fd_set fds;
- 	struct timeval tv;
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc/pollfd.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc/pollfd.patch
new file mode 100644
index 0000000..4feea80
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc/pollfd.patch
@@ -0,0 +1,101 @@
+Index: lirc-0.9.4d/daemons/lircrcd.cpp
+===================================================================
+--- lirc-0.9.4d.orig/daemons/lircrcd.cpp
++++ lirc-0.9.4d/daemons/lircrcd.cpp
+@@ -29,10 +29,12 @@
+ #include <sys/un.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <poll.h>
+ #include <syslog.h>
+ 
+ #include "lirc_client.h"
+ #include "lirc/lirc_log.h"
++#include "lirc/curl_poll.h"
+ 
+ #define MAX_CLIENTS 100
+ #define WHITE_SPACE " \t"
+Index: lirc-0.9.4d/lib/curl_poll.c
+===================================================================
+--- lirc-0.9.4d.orig/lib/curl_poll.c
++++ lirc-0.9.4d/lib/curl_poll.c
+@@ -36,6 +36,7 @@
+ #include <stdlib.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
++#include <sys/poll.h>
+ 
+ #include "lirc_log.h"
+ #include "curl_poll.h"
+@@ -67,7 +68,7 @@ static const logchannel_t logchannel = L
+ 
+ #ifdef HAVE_POLL_FINE
+ 
+-int curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
++int curl_poll(struct pollfd *ufds, unsigned int nfds, int timeout_ms)
+ {
+ 	return poll(ufds, nfds, timeout_ms);
+ }
+@@ -112,7 +113,7 @@ static int verify_sock(int s)
+ }
+ 
+ 
+-int curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
++int curl_poll(struct pollfd *ufds, unsigned int nfds, int timeout_ms)
+ {
+ 	struct timeval pending_tv;
+ 	struct timeval* ptimeout;
+Index: lirc-0.9.4d/lib/curl_poll.h
+===================================================================
+--- lirc-0.9.4d.orig/lib/curl_poll.h
++++ lirc-0.9.4d/lib/curl_poll.h
+@@ -1,5 +1,5 @@
+-#ifndef _POLL_H
+-#define _POLL_H
++#ifndef _LIB_CURL_POLL_H
++#define _LIB_CURL_POLL_H
+ /***************************************************************************
+  *                                  _   _ ____  _
+  *  Project                     ___| | | |  _ \| |
+@@ -29,13 +29,9 @@
+ extern "C" {
+ #endif
+ 
+-#ifdef HAVE_SYS_POLL_H
+-#include <sys/poll.h>
+-#else
+ #include <poll.h>
+-#endif
+ 
+-int curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms);
++int curl_poll(struct pollfd *ufds, unsigned int nfds, int timeout_ms);
+ 
+ #ifdef __cplusplus
+ }
+Index: lirc-0.9.4d/lib/lirc/curl_poll.h
+===================================================================
+--- lirc-0.9.4d.orig/lib/lirc/curl_poll.h
++++ lirc-0.9.4d/lib/lirc/curl_poll.h
+@@ -1,5 +1,5 @@
+-#ifndef _POLL_H
+-#define _POLL_H
++#ifndef _LIRC_CURL_POLL_H
++#define _LIRC_CURL_POLL_H
+ /***************************************************************************
+  *                                  _   _ ____  _
+  *  Project                     ___| | | |  _ \| |
+@@ -29,13 +29,9 @@
+ extern "C" {
+ #endif
+ 
+-#ifdef HAVE_SYS_POLL_H
+-#include <sys/poll.h>
+-#else
+ #include <poll.h>
+-#endif
+ 
+-int curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms);
++int curl_poll(struct pollfd *ufds, unsigned int nfds, int timeout_ms);
+ 
+ #ifdef __cplusplus
+ }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc_0.9.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc_0.9.2.bb
deleted file mode 100644
index 1726192..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc_0.9.2.bb
+++ /dev/null
@@ -1,72 +0,0 @@
-require lirc.inc
-
-SRC_URI += " \
-    file://0001-lircrcd-Mark-local-inline-funtions-as-static.patch \
-    file://lircd.service \
-    file://lircd.init \
-    file://lircexec.init \
-    file://lircd.conf \
-    file://lirc_options.conf \
-    file://lirc.tmpfiles \
-"
-#file://0001-Adaptation-for-STM-configuration.patch \
-#
-SRC_URI[md5sum] = "3afc84e79c0839823cc20e7a710dd06d"
-SRC_URI[sha256sum] = "4e3f948fcdee6dce009171143f0cb7cd7be48593dd58138db4101a41f651a1dd"
-
-SYSTEMD_PACKAGES = "lirc"
-SYSTEMD_SERVICE_${PN} = "lircd.service lircmd.service"
-SYSTEMD_AUTO_ENABLE_lirc = "enable"
-
-inherit autotools pkgconfig systemd python3native
-
-PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd"
-PACKAGECONFIG[x11] = "--with-x,--with-x=no,libx11,"
-
-PACKAGECONFIG ?= " \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' x11', '', d)} \
-"
-
-#EXTRA_OEMAKE = 'SUBDIRS="lib daemons tools"'
-do_install_append() {
-    install -m 0755 -d ${D}${sysconfdir}
-    install -m 0755 -d ${D}${sysconfdir}/lirc
-    install -m 0755 -d ${D}${systemd_unitdir}/system
-    install -m 0755 -d ${D}${libdir}/tmpfiles.d
-    install -m 0644 ${WORKDIR}/lircd.conf ${D}${sysconfdir}/lirc/
-    install -m 0644 ${WORKDIR}/lirc_options.conf ${D}${sysconfdir}/lirc/
-    install -m 0644 ${WORKDIR}/lircd.service ${D}${systemd_unitdir}/system/
-    install -m 0755 ${WORKDIR}/lircexec.init ${D}${systemd_unitdir}/system/
-    install -m 0644 ${WORKDIR}/lirc.tmpfiles ${D}${libdir}/tmpfiles.d/lirc.conf
-    rm -rf ${D}${libdir}/lirc/plugins/*.la
-    rmdir ${D}/var/run/lirc ${D}/var/run
-}
-
-PACKAGES =+ "${PN}-contrib ${PN}-exec ${PN}-plugins ${PN}-python"
-
-RDEPENDS_${PN} = "bash"
-RDEPENDS_${PN}-exec = "${PN}"
-RDEPENDS_${PN}-python = "python"
-
-RRECOMMENDS_lirc = "${PN}-exec ${PN}-plugins"
-
-FILES_${PN}-plugins = "${libdir}/lirc/plugins/*.so ${datadir}/lirc/configs"
-FILES_${PN}-contrib = "${datadir}/lirc/contrib"
-FILES_${PN}-exec = "${bindir}/irexec ${sysconfdir}/lircexec"
-FILES_${PN} += "${systemd_unitdir}/system/lircexec.init"
-FILES_${PN} += "${systemd_unitdir}/system/lircd.service"
-FILES_${PN} += "${systemd_unitdir}/system/lircd.socket"
-FILES_${PN} += "${libdir}/tmpfiles.d/lirc.conf"
-FILES_${PN}-dbg += "${libdir}/lirc/plugins/.debug"
-FILES_${PN}-python += "${libdir}/python*/site-packages"
-
-
-INITSCRIPT_PACKAGES = "lirc lirc-exec"
-INITSCRIPT_NAME_lirc-exec = "lircexec"
-INITSCRIPT_PARAMS_lirc-exec = "defaults 21"
-
-# this is for distributions that don't use udev
-pkg_postinst_${PN}_append() {
-    if [ ! -c $D/dev/lirc -a ! -f /sbin/udevd ]; then mknod $D/dev/lirc c 61 0; fi
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc_0.9.4d.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc_0.9.4d.bb
new file mode 100644
index 0000000..b13163d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/lirc/lirc_0.9.4d.bb
@@ -0,0 +1,87 @@
+DESCRIPTION = "LIRC is a package that allows you to decode and send infra-red signals of many commonly used remote controls."
+DESCRIPTION_append_lirc = " This package contains the lirc daemon, libraries and tools."
+DESCRIPTION_append_lirc-exec = " This package contains a daemon that runs programs on IR signals."
+DESCRIPTION_append_lirc-remotes = " This package contains some config files for remotes."
+DESCRIPTION_append_lirc-nslu2example = " This package contains a working config for RC5 remotes and a modified NSLU2."
+HOMEPAGE = "http://www.lirc.org"
+SECTION = "console/network"
+LICENSE = "GPLv2"
+DEPENDS = "libxslt-native alsa-lib libftdi libusb1 libusb-compat jack portaudio-v19"
+
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "http://prdownloads.sourceforge.net/lirc/lirc-${PV}.tar.bz2 \
+    file://pollfd.patch \
+    file://lircd.service \
+    file://lircd.init \
+    file://lircexec.init \
+    file://lircd.conf \
+    file://lirc_options.conf \
+    file://lirc.tmpfiles \
+"
+SRC_URI[md5sum] = "0d11679cbdd94a5a6da00a8e7231b4bf"
+SRC_URI[sha256sum] = "c68f18c35b489b865c0a741d119b136e8702191538cd3551b977a7af6c4e41ab"
+
+SYSTEMD_PACKAGES = "lirc lirc-exec"
+SYSTEMD_SERVICE_${PN} = "lircd.service lircmd.service lircd-setup.service lircd-uinput.service"
+SYSTEMD_SERVICE_${PN}-exec = "irexec.service"
+SYSTEMD_AUTO_ENABLE_lirc = "enable"
+SYSTEMD_AUTO_ENABLE_lirc-exec = "enable"
+
+inherit autotools pkgconfig systemd python3native
+
+PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd"
+PACKAGECONFIG[x11] = "--with-x,--with-x=no,libx11,"
+
+PACKAGECONFIG ?= " \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' x11', '', d)} \
+"
+CACHED_CONFIGUREVARS = "HAVE_WORKING_POLL=yes"
+
+#EXTRA_OEMAKE = 'SUBDIRS="lib daemons tools"'
+do_install_append() {
+    install -m 0755 -d ${D}${sysconfdir}
+    install -m 0755 -d ${D}${sysconfdir}/lirc
+    install -m 0755 -d ${D}${systemd_unitdir}/system
+    install -m 0755 -d ${D}${libdir}/tmpfiles.d
+    install -m 0644 ${WORKDIR}/lircd.conf ${D}${sysconfdir}/lirc/
+    install -m 0644 ${WORKDIR}/lirc_options.conf ${D}${sysconfdir}/lirc/
+    install -m 0644 ${WORKDIR}/lircd.service ${D}${systemd_unitdir}/system/
+    install -m 0755 ${WORKDIR}/lircexec.init ${D}${systemd_unitdir}/system/
+    install -m 0644 ${WORKDIR}/lirc.tmpfiles ${D}${libdir}/tmpfiles.d/lirc.conf
+    rm -rf ${D}${libdir}/lirc/plugins/*.la
+    rmdir ${D}/var/run/lirc ${D}/var/run
+    chown -R root:root ${D}${datadir}/lirc/contrib
+}
+
+PACKAGES =+ "${PN}-contrib ${PN}-exec ${PN}-plugins ${PN}-python"
+
+RDEPENDS_${PN} = "bash"
+RDEPENDS_${PN}-exec = "${PN}"
+RDEPENDS_${PN}-python = "python"
+
+RRECOMMENDS_lirc = "${PN}-exec ${PN}-plugins"
+
+FILES_${PN}-plugins = "${libdir}/lirc/plugins/*.so ${datadir}/lirc/configs"
+FILES_${PN}-contrib = "${datadir}/lirc/contrib"
+FILES_${PN}-exec = "${bindir}/irexec ${sysconfdir}/lircexec ${systemd_unitdir}/system/irexec.service"
+FILES_${PN} += "${systemd_unitdir}/system/lircexec.init"
+FILES_${PN} += "${systemd_unitdir}/system/lircd.service"
+FILES_${PN} += "${systemd_unitdir}/system/lircd.socket"
+FILES_${PN} += "${libdir}/tmpfiles.d/lirc.conf"
+FILES_${PN}-dbg += "${libdir}/lirc/plugins/.debug"
+FILES_${PN}-python += "${libdir}/python*/site-packages"
+
+
+INITSCRIPT_PACKAGES = "lirc lirc-exec"
+INITSCRIPT_NAME_lirc-exec = "lircexec"
+INITSCRIPT_PARAMS_lirc-exec = "defaults 21"
+
+# this is for distributions that don't use udev
+pkg_postinst_${PN}_append() {
+    if [ ! -c $D/dev/lirc -a ! -f /sbin/udevd ]; then mknod $D/dev/lirc c 61 0; fi
+}
+
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.6.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.6.4.bb
index 5e4e220..e60cd4b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.6.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/modemmanager/modemmanager_1.6.4.bb
@@ -20,7 +20,7 @@
 S = "${WORKDIR}/ModemManager-${PV}"
 
 PACKAGECONFIG ??= "mbim qmi polkit \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
 "
 
 PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/mosh/mosh_1.2.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/mosh/mosh_1.2.4.bb
deleted file mode 100644
index 4bf238d..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/mosh/mosh_1.2.4.bb
+++ /dev/null
@@ -1,47 +0,0 @@
-# NOTE: mosh-server requires a UTF-8 locale, but there's no way to add
-# an explicit dependency for this so you need to ensure this is in your
-# image yourself when you install mosh-server.
-
-SUMMARY = "Remote shell supporting roaming and high-latency connections"
-DESCRIPTION = "Remote terminal application that allows roaming, supports \
-intermittent connectivity, and provides intelligent local echo and line \
-editing of user keystrokes. Mosh is a replacement for SSH. It's more \
-robust and responsive, especially over Wi-Fi, cellular, and \
-long-distance links."
-HOMEPAGE = "http://mosh.mit.edu"
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-DEPENDS = "protobuf-native protobuf ncurses zlib libio-pty-perl openssl libutempter"
-
-SRC_URI = "http://mosh.mit.edu/mosh-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "c2d918f4d91fdc32546e2e089f9281b2"
-SRC_URI[sha256sum] = "e74d0d323226046e402dd469a176075fc2013b69b0e67cea49762c957175df46"
-
-inherit autotools
-
-PACKAGE_BEFORE_PN += "${PN}-server"
-FILES_${PN}-server = "${bindir}/mosh-server"
-
-NEEDED_PERL_MODULES = "\
-    perl-module-socket \
-    perl-module-getopt-long \
-    perl-module-errno \
-    perl-module-io-socket-inet \
-    perl-module-posix \
-"
-
-# mosh uses SSH to authenticate and the client uses OpenSSH-specific features
-RDEPENDS_${PN} += "openssh-ssh ${NEEDED_PERL_MODULES}"
-# The server seemed not to work with dropbear either
-RDEPENDS_${PN}-server += "openssh-sshd ${NEEDED_PERL_MODULES}"
-
-# Fails to build with thumb-1 (qemuarm)
-#| {standard input}: Assembler messages:
-#| {standard input}:2100: Error: instruction not supported in Thumb16 mode -- `adds r4,r4,r4'
-#| {standard input}:2101: Error: instruction not supported in Thumb16 mode -- `adcs r5,r5,r5'
-#| {standard input}:2102: Error: instruction not supported in Thumb16 mode -- `adcs r6,r6,r6'
-#| {standard input}:2103: Error: instruction not supported in Thumb16 mode -- `adcs r7,r7,r7'
-#| {standard input}:2104: Error: selected processor does not support Thumb mode `it cs'
-ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/mosh/mosh_1.3.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/mosh/mosh_1.3.0.bb
new file mode 100644
index 0000000..9fc8435
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/mosh/mosh_1.3.0.bb
@@ -0,0 +1,46 @@
+# NOTE: mosh-server requires a UTF-8 locale, but there's no way to add
+# an explicit dependency for this so you need to ensure this is in your
+# image yourself when you install mosh-server.
+
+SUMMARY = "Remote shell supporting roaming and high-latency connections"
+DESCRIPTION = "Remote terminal application that allows roaming, supports \
+intermittent connectivity, and provides intelligent local echo and line \
+editing of user keystrokes. Mosh is a replacement for SSH. It's more \
+robust and responsive, especially over Wi-Fi, cellular, and \
+long-distance links."
+HOMEPAGE = "http://mosh.mit.edu"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = "protobuf-native protobuf ncurses zlib libio-pty-perl openssl libutempter"
+
+SRC_URI = "http://mosh.mit.edu/mosh-${PV}.tar.gz"
+SRC_URI[md5sum] = "d961276995936953bf2d5a794068b076"
+SRC_URI[sha256sum] = "320e12f461e55d71566597976bd9440ba6c5265fa68fbf614c6f1c8401f93376"
+
+inherit autotools pkgconfig
+
+PACKAGE_BEFORE_PN += "${PN}-server"
+FILES_${PN}-server = "${bindir}/mosh-server"
+
+NEEDED_PERL_MODULES = "\
+    perl-module-socket \
+    perl-module-getopt-long \
+    perl-module-errno \
+    perl-module-io-socket-inet \
+    perl-module-posix \
+"
+
+# mosh uses SSH to authenticate and the client uses OpenSSH-specific features
+RDEPENDS_${PN} += "openssh-ssh ${NEEDED_PERL_MODULES}"
+# The server seemed not to work with dropbear either
+RDEPENDS_${PN}-server += "openssh-sshd ${NEEDED_PERL_MODULES}"
+
+# Fails to build with thumb-1 (qemuarm)
+#| {standard input}: Assembler messages:
+#| {standard input}:2100: Error: instruction not supported in Thumb16 mode -- `adds r4,r4,r4'
+#| {standard input}:2101: Error: instruction not supported in Thumb16 mode -- `adcs r5,r5,r5'
+#| {standard input}:2102: Error: instruction not supported in Thumb16 mode -- `adcs r6,r6,r6'
+#| {standard input}:2103: Error: instruction not supported in Thumb16 mode -- `adcs r7,r7,r7'
+#| {standard input}:2104: Error: selected processor does not support Thumb mode `it cs'
+ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager-openvpn_1.0.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager-openvpn_1.0.8.bb
deleted file mode 100644
index fe1d601..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager-openvpn_1.0.8.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-SUMMARY = "NetworkManager-openvpn-plugin"
-SECTION = "net/misc"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=100d5a599bead70ddcd70dcd73f2e29c"
-
-DEPENDS = "dbus dbus-glib networkmanager openvpn intltool-native"
-
-inherit gnomebase useradd gettext systemd
-
-SRC_URI = "${GNOME_MIRROR}/NetworkManager-openvpn/${@gnome_verdir("${PV}")}/NetworkManager-openvpn-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "758a9951ad5e20a37c72cc7326c9c750"
-SRC_URI[sha256sum] = "1b979519d72ba4d78e729d4856c5b53fad914ca7ee3ca91209ce489ba78912ac"
-
-S = "${WORKDIR}/NetworkManager-openvpn-${PV}"
-
-PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome"
-
-# Create user and group nm-openvpn that are needed since version 1.0.6
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "--system nm-openvpn"
-
-FILES_${PN} += " \
-    ${libdir}/NetworkManager/*.so \
-"
-
-RDEPENDS_${PN} = " \
-    networkmanager \
-    openvpn \
-"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager-openvpn_1.2.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager-openvpn_1.2.8.bb
new file mode 100644
index 0000000..cce3f91
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager-openvpn_1.2.8.bb
@@ -0,0 +1,39 @@
+SUMMARY = "NetworkManager-openvpn-plugin"
+SECTION = "net/misc"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=100d5a599bead70ddcd70dcd73f2e29c"
+
+DEPENDS = "dbus dbus-glib networkmanager openvpn intltool-native glib-2.0-native"
+
+inherit gnomebase useradd gettext systemd
+
+SRC_URI = "${GNOME_MIRROR}/NetworkManager-openvpn/${@gnome_verdir("${PV}")}/NetworkManager-openvpn-${PV}.tar.xz"
+SRC_URI[md5sum] = "9f325be386aa906ff9b0b7c0bdf2a59a"
+SRC_URI[sha256sum] = "3e0b4007f248d96df4b8eb5d0f937536044af7053debbbf525e67c9bc5d30654"
+
+S = "${WORKDIR}/NetworkManager-openvpn-${PV}"
+
+PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome"
+
+do_install_append () {
+    rm -rf ${D}${libdir}/NetworkManager/*.la
+}
+
+# Create user and group nm-openvpn that are needed since version 1.0.6
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system nm-openvpn"
+
+FILES_${PN} += " \
+    ${libdir}/NetworkManager/*.so \
+    ${libdir}/NetworkManager/VPN/nm-openvpn-service.name \
+"
+
+FILES_${PN}-staticdev += " \
+    ${libdir}/NetworkManager/*.a \
+"
+
+RDEPENDS_${PN} = " \
+    networkmanager \
+    openvpn \
+"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch
new file mode 100644
index 0000000..ced0c7c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch
@@ -0,0 +1,82 @@
+From 047d3bf96b510740f64687480333c378e414995f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 15:57:05 -0700
+Subject: [PATCH 1/5] adjust net/ headers for musl compatibility
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libnm-core/nm-utils.c          | 12 +++++++-----
+ libnm-core/nm-utils.h          |  5 ++---
+ src/platform/wifi/wifi-utils.h |  2 +-
+ 3 files changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
+index df75d56..868224e 100644
+--- a/libnm-core/nm-utils.c
++++ b/libnm-core/nm-utils.c
+@@ -19,24 +19,26 @@
+  * Copyright 2005 - 2014 Red Hat, Inc.
+  */
+ 
+-#include "nm-default.h"
+-
+-#include "nm-utils.h"
+-
+ #include <string.h>
+ #include <errno.h>
+ #include <stdlib.h>
+-#include <netinet/ether.h>
+ #include <arpa/inet.h>
+ #include <uuid/uuid.h>
+ #include <libintl.h>
+ #include <gmodule.h>
+ #include <sys/stat.h>
++//#include <net/if_arp.h>
++//#include <net/ethernet.h>
++#include <netinet/ether.h>
++
++#include "nm-default.h"
+ 
++#include "nm-utils.h"
+ #if WITH_JANSSON
+ #include <jansson.h>
+ #endif
+ 
++
+ #include "nm-common-macros.h"
+ #include "nm-utils-private.h"
+ #include "nm-setting-private.h"
+diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
+index 407c14e..156ccae 100644
+--- a/libnm-core/nm-utils.h
++++ b/libnm-core/nm-utils.h
+@@ -27,11 +27,10 @@
+ 
+ #include <glib.h>
+ 
+-#include <netinet/in.h>
+-
+ /* For ETH_ALEN and INFINIBAND_ALEN */
+-#include <linux/if_ether.h>
++//#include <linux/if_ether.h>
+ #include <linux/if_infiniband.h>
++#include <netinet/in.h>
+ 
+ #include "nm-core-enum-types.h"
+ #include "nm-setting-wireless-security.h"
+diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
+index 8e2b93f..84f5ce9 100644
+--- a/src/platform/wifi/wifi-utils.h
++++ b/src/platform/wifi/wifi-utils.h
+@@ -22,7 +22,7 @@
+ #ifndef __WIFI_UTILS_H__
+ #define __WIFI_UTILS_H__
+ 
+-#include <net/ethernet.h>
++//#include <net/ethernet.h>
+ 
+ #include "nm-dbus-interface.h"
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0001-check-for-strndupa-before-using-it.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0001-check-for-strndupa-before-using-it.patch
new file mode 100644
index 0000000..26f380b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0001-check-for-strndupa-before-using-it.patch
@@ -0,0 +1,67 @@
+From 05e8bd664d0244cb8ab4376b962830b97860f6bf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 18:37:19 -0700
+Subject: [PATCH] check for strndupa before using it
+
+musl does not have strndupa
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ config.h.in                        |  4 ++++
+ configure.ac                       |  1 +
+ src/systemd/src/basic/alloc-util.h | 12 ++++++++++++
+ 3 files changed, 17 insertions(+)
+
+diff --git a/config.h.in b/config.h.in
+index db8c135..c4229ed 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -41,6 +41,10 @@
+    */
+ #undef HAVE_DCGETTEXT
+ 
++/* Define to 1 if you have the declaration of `strndupa', and to 0 if you
++   don't. */
++#undef HAVE_DECL_STRNDUPA
++
+ /* Define to 1 if you have the <dlfcn.h> header file. */
+ #undef HAVE_DLFCN_H
+ 
+diff --git a/configure.ac b/configure.ac
+index 2630f8d..d0a57fd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -54,6 +54,7 @@ AC_SUBST(NM_VERSION)
+ 
+ GIT_SHA_RECORD(NM_GIT_SHA)
+ 
++AC_CHECK_DECLS([strndupa], [], [], [[#include <string.h>]])
+ dnl
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ dnl
+diff --git a/src/systemd/src/basic/alloc-util.h b/src/systemd/src/basic/alloc-util.h
+index ceeee51..924b59c 100644
+--- a/src/systemd/src/basic/alloc-util.h
++++ b/src/systemd/src/basic/alloc-util.h
+@@ -25,6 +25,18 @@
+ #include <string.h>
+ 
+ #include "macro.h"
++#include "config.h"
++
++#if !HAVE_DECL_STRNDUPA
++#define strndupa(s, n) \
++  ({ \
++    const char *__old = (s); \
++    size_t __len = strnlen(__old, (n)); \
++    char *__new = (char *)alloca(__len + 1); \
++    __new[__len] = '\0'; \
++    (char *)memcpy(__new, __old, __len); \
++  })
++#endif
+ 
+ #define new(t, n) ((t*) malloc_multiply(sizeof(t), (n)))
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0006-Fix-nm-version-macro-includes.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-Fix-nm-version-macro-includes.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0006-Fix-nm-version-macro-includes.patch
rename to import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-Fix-nm-version-macro-includes.patch
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-add-pkg-config-for-libgcrypt.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-add-pkg-config-for-libgcrypt.patch
deleted file mode 100644
index bb95eaa..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-add-pkg-config-for-libgcrypt.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From a9261fee4a41045c42e0d292237cee532e11982c Mon Sep 17 00:00:00 2001
-From: Adrian <adrian.freihofer@gmail.com>
-Date: Thu, 27 Nov 2014 15:43:26 +0100
-Subject: [PATCH] add pkg config for libgcrypt
-
----
- configure.ac | 18 +++++++-----------
- 1 file changed, 7 insertions(+), 11 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 94b0758..654a015 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -480,17 +480,13 @@ if test x"$ac_crypto" = xnss; then
-   with_nss=yes
- elif test x"$ac_crypto" = xgnutls; then
-   PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.2])
--  AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
--  if test x"$LIBGCRYPT_CONFIG" = xno; then
--    AC_MSG_ERROR([gnutls explicitly requested but gcrypt not found on system])
--  else
--    AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have libgnutls])
--    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
--    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
--    AC_SUBST(LIBGCRYPT_CFLAGS)
--    AC_SUBST(LIBGCRYPT_LIBS)
--    with_gnutls=yes
--  fi
-+  AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have libgnutls])
-+  PKG_CHECK_MODULES(LIBGCRYPT, [libgcrypt >= 1.1.42], [
-+      AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
-+      with_gnutls=yes
-+    ], [
-+      AC_MSG_ERROR([gnutls explicitly requested but gcrypt not found on system])
-+    ])
- else
-   AC_MSG_ERROR([Please choose either 'nss' or 'gnutls' for certificate and crypto operations])
- fi
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-networkmanager-fixed-issues-of-NetworkManager-wait-o.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-networkmanager-fixed-issues-of-NetworkManager-wait-o.patch
deleted file mode 100644
index 4eb9e21..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-networkmanager-fixed-issues-of-NetworkManager-wait-o.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 0690452b863286e524d2037427816b7850301f93 Mon Sep 17 00:00:00 2001
-From: Haiqing Bai <Haiqing.Bai@windriver.com>
-Date: Tue, 6 Sep 2016 09:27:38 +0800
-Subject: [PATCH] networkmanager: fixed issues of
- NetworkManager-wait-online.service.in.
-
-Remove network.target in "Before" to avoid circle dependency.
-Wants=network.target
-Before=network.target network-online.target
-
-Correct the "WantedBy" to network-online.target.
-
-Upstream-status: Pending
-
-Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
----
- data/NetworkManager-wait-online.service.in | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/data/NetworkManager-wait-online.service.in b/data/NetworkManager-wait-online.service.in
-index 6ad6942..1753d20 100644
---- a/data/NetworkManager-wait-online.service.in
-+++ b/data/NetworkManager-wait-online.service.in
-@@ -1,13 +1,14 @@
- [Unit]
- Description=Network Manager Wait Online
-+Documentation=man:nm-online(1)
- Requisite=NetworkManager.service
- After=NetworkManager.service
--Wants=network.target
--Before=network.target network-online.target
-+Before=network-online.target
- 
- [Service]
- Type=oneshot
- ExecStart=@bindir@/nm-online -s -q --timeout=30
-+RemainAfterExit=yes
- 
- [Install]
--WantedBy=multi-user.target
-+WantedBy=network-online.target
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch
new file mode 100644
index 0000000..22bc6e8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch
@@ -0,0 +1,30 @@
+From 98d7e3ae5b15e30af1bf5dd1d279e1a774bf2b86 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 16:05:05 -0700
+Subject: [PATCH 2/5] socket-util.h: Include linux/sockios.h on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemd/src/basic/socket-util.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/systemd/src/basic/socket-util.h b/src/systemd/src/basic/socket-util.h
+index 2536b08..76d6107 100644
+--- a/src/systemd/src/basic/socket-util.h
++++ b/src/systemd/src/basic/socket-util.h
+@@ -29,6 +29,12 @@
+ #include <linux/netlink.h>
+ #include <linux/if_packet.h>
+ 
++#if !defined(__GLIBC__)
++/* SIOCGSTAMPNS from linux/asm-generic.h
++ * for src/systemd/src/libsystemd-network/sd-lldp.c */
++#include <linux/sockios.h>
++#endif
++
+ #include "macro.h"
+ #include "util.h"
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch
new file mode 100644
index 0000000..236914f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch
@@ -0,0 +1,39 @@
+From 16c3dc7a407101243d2056d2c93e61dce1a05350 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 16:08:45 -0700
+Subject: [PATCH 3/5] Define ETH_ALEN
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libnm-core/nm-utils.h          | 1 +
+ src/platform/wifi/wifi-utils.h | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
+index 156ccae..68e222b 100644
+--- a/libnm-core/nm-utils.h
++++ b/libnm-core/nm-utils.h
+@@ -29,6 +29,7 @@
+ 
+ /* For ETH_ALEN and INFINIBAND_ALEN */
+ //#include <linux/if_ether.h>
++#define ETH_ALEN	6		/* Octets in one ethernet addr	 */
+ #include <linux/if_infiniband.h>
+ #include <netinet/in.h>
+ 
+diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
+index 84f5ce9..33a838d 100644
+--- a/src/platform/wifi/wifi-utils.h
++++ b/src/platform/wifi/wifi-utils.h
+@@ -24,6 +24,8 @@
+ 
+ //#include <net/ethernet.h>
+ 
++#define ETH_ALEN	6		/* Octets in one ethernet addr	 */
++
+ #include "nm-dbus-interface.h"
+ 
+ typedef struct WifiData WifiData;
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0003-core-fix-failure-to-configure-routes-due-to-wrong-de.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0003-core-fix-failure-to-configure-routes-due-to-wrong-de.patch
deleted file mode 100644
index 5da536e..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0003-core-fix-failure-to-configure-routes-due-to-wrong-de.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 11aa07ed939193e85516c287a57dee1837242972 Mon Sep 17 00:00:00 2001
-From: Thomas Haller <thaller@redhat.com>
-Date: Mon, 4 Jan 2016 18:54:26 +0100
-Subject: [PATCH 1/7] core: fix failure to configure routes due to wrong
- device-route for IPv4 peer-addresses
-
-As in the case of a OpenVPN connection, we might add an address like:
-  10.8.0.58/32 ptp 10.8.0.57
-
-In this case, kernel would automatically add a device-route like:
-  10.8.0.57/32 via 0.0.0.0 dev 32 metric 0 mss 0 src rtprot-kernel scope link pref-src 10.8.0.58
-
-nm_ip4_config_commit() checks all IP addresses to figure out
-the present device-routes. Then the routes are synced by NMRouteManager.
-Due to a bug, we would not consider the peer-address, but the local-address
-and configure a route 10.8.0.58/32, instead of 10.8.0.57/32.
-
-That stays mostly unnoticed, because usually the peer and the local-address are
-in the same subnet, so that there is no difference (/32 is an example of the
-peer-address being in a different subnet).
-
-It also seems that due to a bug fixed by df4e5357521 this issue didn't surface.
-Probably because we would not notice the 10.8.0.57/32 right away and thus
-nm_route_manager_ip4_route_sync() would not wrongly delete it.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=759892
-
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809195
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809494
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809526
-https://bugs.archlinux.org/task/47535
-https://bugzilla.redhat.com/show_bug.cgi?id=1294309
-https://mail.gnome.org/archives/networkmanager-list/2015-December/msg00059.html
----
- src/nm-ip4-config.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
-index f625d35..61e29af 100644
---- a/src/nm-ip4-config.c
-+++ b/src/nm-ip4-config.c
-@@ -298,7 +298,8 @@ nm_ip4_config_commit (const NMIP4Config *config, int ifindex, gboolean routes_fu
- 
- 				route.ifindex = ifindex;
- 				route.source = NM_IP_CONFIG_SOURCE_KERNEL;
--				route.network = nm_utils_ip4_address_clear_host_address (addr->address, addr->plen);
-+				route.network = nm_utils_ip4_address_clear_host_address (addr->peer_address ? : addr->address,
-+				                                                         addr->plen);
- 				route.plen = addr->plen;
- 				route.pref_src = addr->address;
- 				route.metric = default_route_metric;
--- 
-2.5.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch
new file mode 100644
index 0000000..27c9ae9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch
@@ -0,0 +1,93 @@
+From 2153109e60e362e0d09215d529bf00176f31a3e7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 16:09:41 -0700
+Subject: [PATCH 4/5] Define missing features to cater for musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemd/sd-adapt/nm-sd-adapt.h | 2 +-
+ src/systemd/src/basic/parse-util.c | 5 ++++-
+ src/systemd/src/basic/stdio-util.h | 2 ++
+ src/systemd/src/basic/util.h       | 5 +++++
+ src/systemd/src/systemd/sd-event.h | 4 ----
+ 5 files changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/src/systemd/sd-adapt/nm-sd-adapt.h b/src/systemd/sd-adapt/nm-sd-adapt.h
+index cf27c1a..72c1b89 100644
+--- a/src/systemd/sd-adapt/nm-sd-adapt.h
++++ b/src/systemd/sd-adapt/nm-sd-adapt.h
+@@ -119,7 +119,7 @@ G_STMT_START { \
+ #  ifdef HAVE___SECURE_GETENV
+ #    define secure_getenv __secure_getenv
+ #  else
+-#    error neither secure_getenv nor __secure_getenv is available
++#    define secure_getenv getenv
+ #  endif
+ #endif
+ 
+diff --git a/src/systemd/src/basic/parse-util.c b/src/systemd/src/basic/parse-util.c
+index 2738663..9c21e5a 100644
+--- a/src/systemd/src/basic/parse-util.c
++++ b/src/systemd/src/basic/parse-util.c
+@@ -25,8 +25,11 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifdef __GLIBC__
+ #include <xlocale.h>
+-
++#else
++#include <locale.h>
++#endif
+ #include "alloc-util.h"
+ #include "extract-word.h"
+ #include "macro.h"
+diff --git a/src/systemd/src/basic/stdio-util.h b/src/systemd/src/basic/stdio-util.h
+index bd1144b..c92e935 100644
+--- a/src/systemd/src/basic/stdio-util.h
++++ b/src/systemd/src/basic/stdio-util.h
+@@ -19,7 +19,9 @@
+   along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+ 
++#ifdef __GLIBC__
+ #include <printf.h>
++#endif
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+diff --git a/src/systemd/src/basic/util.h b/src/systemd/src/basic/util.h
+index bb2fc31..fe074a5 100644
+--- a/src/systemd/src/basic/util.h
++++ b/src/systemd/src/basic/util.h
+@@ -46,6 +46,11 @@
+ #include "missing.h"
+ #include "time-util.h"
+ 
++#if !defined(__GLIBC__)
++typedef int (*__compar_fn_t) (const void*, const void*);
++typedef __compar_fn_t comparison_fn_t;
++#endif
++
+ size_t page_size(void) _pure_;
+ #define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
+ 
+diff --git a/src/systemd/src/systemd/sd-event.h b/src/systemd/src/systemd/sd-event.h
+index cc26b7d..c7e0004 100644
+--- a/src/systemd/src/systemd/sd-event.h
++++ b/src/systemd/src/systemd/sd-event.h
+@@ -69,11 +69,7 @@ typedef int (*sd_event_handler_t)(sd_event_source *s, void *userdata);
+ typedef int (*sd_event_io_handler_t)(sd_event_source *s, int fd, uint32_t revents, void *userdata);
+ typedef int (*sd_event_time_handler_t)(sd_event_source *s, uint64_t usec, void *userdata);
+ typedef int (*sd_event_signal_handler_t)(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata);
+-#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
+ typedef int (*sd_event_child_handler_t)(sd_event_source *s, const siginfo_t *si, void *userdata);
+-#else
+-typedef void* sd_event_child_handler_t;
+-#endif
+ 
+ int sd_event_default(sd_event **e);
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0004-ppp-manager-clear-ppp_watch_id-upon-pppd-termination.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0004-ppp-manager-clear-ppp_watch_id-upon-pppd-termination.patch
deleted file mode 100644
index 41f2882..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0004-ppp-manager-clear-ppp_watch_id-upon-pppd-termination.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 8204c2a1968f757599c5ebec9a85efaacb0e522a Mon Sep 17 00:00:00 2001
-From: Beniamino Galvani <bgalvani@redhat.com>
-Date: Mon, 4 Jan 2016 14:18:02 +0100
-Subject: [PATCH 2/7] ppp-manager: clear @ppp_watch_id upon pppd termination
-
-Set @ppp_watch_id to zero upon pppd termination, otherwise the call to
-g_source_remove(priv->ppp_watch_id) in dispose() could trigger a failed
-assertion.
-
-(cherry picked from commit 5f93f0101538db39efe0f9ea2316e63bff953bf0)
----
- src/ppp-manager/nm-ppp-manager.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c
-index d27b262..85ca9c5 100644
---- a/src/ppp-manager/nm-ppp-manager.c
-+++ b/src/ppp-manager/nm-ppp-manager.c
-@@ -828,6 +828,7 @@ ppp_watch_cb (GPid pid, gint status, gpointer user_data)
- 
- 	nm_log_dbg (LOGD_PPP, "pppd pid %d cleaned up", priv->pid);
- 	priv->pid = 0;
-+	priv->ppp_watch_id = 0;
- 	g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_PPP_STATUS_DEAD);
- }
- 
--- 
-2.5.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0005-device-update-ip_iface-only-if-IP-interface-exists.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0005-device-update-ip_iface-only-if-IP-interface-exists.patch
deleted file mode 100644
index 05c2dca..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0005-device-update-ip_iface-only-if-IP-interface-exists.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From cbcb848e6d4f4e8c4aa11c80f1f3dbb7fb2d397e Mon Sep 17 00:00:00 2001
-From: Beniamino Galvani <bgalvani@redhat.com>
-Date: Mon, 4 Jan 2016 14:22:01 +0100
-Subject: [PATCH 3/7] device: update @ip_iface only if IP interface exists
-
-If @ip_ifindex is zero, the IP interface has disappeared and
-there's no point in updating @ip_iface.
-
-Actually, unconditionally updating @ip_iface is dangerous because it
-breaks the assumption used by other functions (as
-nm_device_get_ip_ifindex()) that a non-NULL @ip_iface implies a valid
-@ip_ifindex. This was causing the scary failure:
-
-  devices/nm-device.c:666:get_ip_iface_identifier: assertion failed: (ifindex)
-
-https://bugzilla.redhat.com/show_bug.cgi?id=1268617
-(cherry picked from commit ed536998f9530698ff3082fc5587dbeb7d3a594f)
----
- src/devices/nm-device.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
-index bb39ca5..4413e92 100644
---- a/src/devices/nm-device.c
-+++ b/src/devices/nm-device.c
-@@ -1526,12 +1526,13 @@ device_ip_link_changed (NMDevice *self)
- {
- 	NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- 	const NMPlatformLink *pllink;
--	int ip_ifindex;
- 
- 	priv->device_ip_link_changed_id = 0;
- 
--	ip_ifindex = nm_device_get_ip_ifindex (self);
--	pllink = nm_platform_link_get (NM_PLATFORM_GET, ip_ifindex);
-+	if (!priv->ip_ifindex)
-+		return G_SOURCE_REMOVE;
-+
-+	pllink = nm_platform_link_get (NM_PLATFORM_GET, priv->ip_ifindex);
- 	if (!pllink)
- 		return G_SOURCE_REMOVE;
- 
--- 
-2.5.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
new file mode 100644
index 0000000..f4a04c7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
@@ -0,0 +1,36 @@
+From 9e9e5814456ec23b9fc669d342bf9d8f7ee49fc2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 16:48:00 -0700
+Subject: [PATCH 5/5] sd-lldp.h: Remove net/ethernet.h seems to be over
+ specified
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemd/src/systemd/sd-lldp.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: NetworkManager-1.4.2/src/systemd/src/systemd/sd-lldp.h
+===================================================================
+--- NetworkManager-1.4.2.orig/src/systemd/src/systemd/sd-lldp.h
++++ NetworkManager-1.4.2/src/systemd/src/systemd/sd-lldp.h
+@@ -22,7 +22,7 @@
+ ***/
+ 
+ #include <inttypes.h>
+-#include <net/ethernet.h>
++//#include <net/ethernet.h>
+ #include <sys/types.h>
+ 
+ #include "sd-event.h"
+Index: NetworkManager-1.4.2/src/systemd/src/libsystemd-network/sd-lldp.c
+===================================================================
+--- NetworkManager-1.4.2.orig/src/systemd/src/libsystemd-network/sd-lldp.c
++++ NetworkManager-1.4.2/src/systemd/src/libsystemd-network/sd-lldp.c
+@@ -21,6 +21,7 @@
+ #include "nm-sd-adapt.h"
+ 
+ #include <arpa/inet.h>
++#include <net/ethernet.h>
+ 
+ #include "sd-lldp.h"
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager_1.0.12.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager_1.0.12.bb
deleted file mode 100644
index 9134880..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager_1.0.12.bb
+++ /dev/null
@@ -1,118 +0,0 @@
-SUMMARY = "NetworkManager"
-SECTION = "net/misc"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=cbbffd568227ada506640fe950a4823b \
-                    file://libnm-util/COPYING;md5=1c4fa765d6eb3cd2fbd84344a1b816cd \
-                    file://docs/api/html/license.html;md5=51d7fb67bde992e58533a8481cee070b \
-"
-
-DEPENDS = "intltool-native libnl dbus dbus-glib dbus-glib-native libgudev util-linux libndp libnewt polkit"
-
-inherit gnomebase gettext systemd bluetooth bash-completion vala gobject-introspection
-
-SRC_URI = " \
-    ${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
-    file://0001-don-t-try-to-run-sbin-dhclient-to-get-the-version-nu.patch \
-    file://0002-add-pkg-config-for-libgcrypt.patch \
-    file://0006-Fix-nm-version-macro-includes.patch \
-    file://0002-networkmanager-fixed-issues-of-NetworkManager-wait-o.patch \
-"
-SRC_URI[md5sum] = "ebb273456a81ccf9dfaf2461061b0e96"
-SRC_URI[sha256sum] = "3a470f8c60109b1acb5784ddc2423501706b5fe34c793a6faee87e591eb04a9e"
-
-S = "${WORKDIR}/NetworkManager-${PV}"
-
-EXTRA_OECONF = " \
-    --disable-ifcfg-rh \
-    --disable-ifnet \
-    --disable-ifcfg-suse \
-    --disable-more-warnings \
-    --with-iptables=${sbindir}/iptables \
-    --with-tests \
-    --with-nmtui=yes \
-"
-
-do_compile_prepend() {
-        export GIR_EXTRA_LIBS_PATH="${B}/libnm-util/.libs"
-}
-
-PACKAGECONFIG ??= "nss ifupdown netconfig dhclient dnsmasq \
-    ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','consolekit',d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES','bluetooth','${BLUEZ}','',d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES','wifi','wifi','',d)} \
-"
-PACKAGECONFIG[systemd] = " \
-    --with-systemdsystemunitdir=${systemd_unitdir}/system --with-session-tracking=systemd --enable-polkit, \
-    --without-systemdsystemunitdir, \
-    polkit \
-"
-PACKAGECONFIG[bluez5] = "--enable-bluez5-dun,--disable-bluez5-dun,bluez5"
-# consolekit is not picked by shlibs, so add it to RDEPENDS too
-PACKAGECONFIG[consolekit] = "--with-session-tracking=consolekit,,consolekit,consolekit"
-PACKAGECONFIG[concheck] = "--with-libsoup=yes,--with-libsoup=no,libsoup-2.4"
-PACKAGECONFIG[modemmanager] = "--with-modem-manager-1=yes,--with-modem-manager-1=no,modemmanager"
-PACKAGECONFIG[ppp] = "--enable-ppp,--disable-ppp,ppp,ppp"
-# Use full featured dhcp client instead of internal one
-PACKAGECONFIG[dhclient] = "--with-dhclient=${base_sbindir}/dhclient,,,dhcp-client"
-PACKAGECONFIG[dnsmasq] = "--with-dnsmasq=${bindir}/dnsmasq"
-PACKAGECONFIG[nss] = "--with-crypto=nss,,nss"
-PACKAGECONFIG[gnutls] = "--with-crypto=gnutls,,gnutls libgcrypt"
-PACKAGECONFIG[wifi] = "--enable-wifi=yes,--enable-wifi=no,wireless-tools,wpa-supplicant wireless-tools"
-PACKAGECONFIG[ifupdown] = "--enable-ifupdown,--disable-ifupdown"
-PACKAGECONFIG[netconfig] = "--with-netconfig=yes,--with-netconfig=no"
-PACKAGECONFIG[qt4-x11-free] = "--enable-qt,--disable-qt,qt4-x11-free"
-
-PACKAGES =+ "libnmutil libnmglib libnmglib-vpn \
-  ${PN}-nmtui ${PN}-nmtui-doc \
-  ${PN}-adsl \
-"
-
-FILES_libnmutil += "${libdir}/libnm-util.so.*"
-FILES_libnmglib += "${libdir}/libnm-glib.so.*"
-FILES_libnmglib-vpn += "${libdir}/libnm-glib-vpn.so.*"
-
-FILES_${PN}-adsl = "${libdir}/NetworkManager/libnm-device-plugin-adsl.so"
-
-FILES_${PN} += " \
-    ${libexecdir} \
-    ${libdir}/pppd/*/nm-pppd-plugin.so \
-    ${libdir}/NetworkManager/*.so \
-    ${datadir}/polkit-1 \
-    ${datadir}/dbus-1 \
-    ${base_libdir}/udev/* \
-    ${systemd_unitdir}/system \
-"
-
-RRECOMMENDS_${PN} += "iptables \
-    ${@bb.utils.contains('PACKAGECONFIG','dnsmasq','dnsmasq','',d)} \
-"
-RCONFLICTS_${PN} = "connman"
-
-FILES_${PN}-dbg += " \
-    ${libdir}/NetworkManager/.debug/ \
-    ${libdir}/pppd/*/.debug/ \
-"
-
-FILES_${PN}-dev += " \
-    ${datadir}/NetworkManager/gdb-cmd \
-    ${libdir}/pppd/*/*.la \
-    ${libdir}/NetworkManager/*.la \
-"
-
-FILES_${PN}-nmtui = " \
-    ${bindir}/nmtui \
-    ${bindir}/nmtui-edit \
-    ${bindir}/nmtui-connect \
-    ${bindir}/nmtui-hostname \
-"
-
-FILES_${PN}-nmtui-doc = " \
-    ${mandir}/man1/nmtui* \
-"
-
-SYSTEMD_SERVICE_${PN} = "NetworkManager.service NetworkManager-dispatcher.service"
-
-do_install_append() {
-    rm -rf ${D}/run ${D}${localstatedir}/run
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager_1.4.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager_1.4.4.bb
new file mode 100644
index 0000000..85098fe
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/networkmanager/networkmanager_1.4.4.bb
@@ -0,0 +1,128 @@
+SUMMARY = "NetworkManager"
+SECTION = "net/misc"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cbbffd568227ada506640fe950a4823b \
+                    file://libnm-util/COPYING;md5=1c4fa765d6eb3cd2fbd84344a1b816cd \
+                    file://docs/api/html/license.html;md5=8eb8e72bab097b9d11763002cb003697 \
+"
+
+DEPENDS = " \
+    intltool-native \
+    libnl \
+    dbus \
+    dbus-glib \
+    dbus-glib-native \
+    libgudev \
+    util-linux \
+    libndp \
+    libnewt \
+    polkit \
+    jansson \
+"
+
+inherit gnomebase gettext systemd bluetooth bash-completion vala gobject-introspection
+
+SRC_URI = "${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
+           file://0001-don-t-try-to-run-sbin-dhclient-to-get-the-version-nu.patch \
+           file://0002-Fix-nm-version-macro-includes.patch \
+           file://0001-adjust-net-headers-for-musl-compatibility.patch \
+           file://0002-socket-util.h-Include-linux-sockios.h-on-musl.patch \
+           file://0003-Define-ETH_ALEN.patch \
+           file://0004-Define-missing-features-to-cater-for-musl.patch \
+           file://0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch \
+           file://0001-check-for-strndupa-before-using-it.patch \
+           "
+SRC_URI[md5sum] = "63f1e0d6d7e9099499d062c84c927a75"
+SRC_URI[sha256sum] = "829378f318cc008d138a23ca6a9191928ce75344e7e47a2f2c35f4ac82133309"
+
+S = "${WORKDIR}/NetworkManager-${PV}"
+
+EXTRA_OECONF = " \
+    --disable-ifcfg-rh \
+    --disable-ifnet \
+    --disable-ifcfg-suse \
+    --disable-more-warnings \
+    --with-iptables=${sbindir}/iptables \
+    --with-tests \
+    --with-nmtui=yes \
+"
+
+do_compile_prepend() {
+        export GIR_EXTRA_LIBS_PATH="${B}/libnm-util/.libs"
+}
+
+PACKAGECONFIG ??= "nss ifupdown netconfig dhclient dnsmasq \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', 'consolekit', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'wifi', d)} \
+"
+PACKAGECONFIG[systemd] = " \
+    --with-systemdsystemunitdir=${systemd_unitdir}/system --with-session-tracking=systemd --enable-polkit, \
+    --without-systemdsystemunitdir, \
+    polkit \
+"
+PACKAGECONFIG[bluez5] = "--enable-bluez5-dun,--disable-bluez5-dun,bluez5"
+# consolekit is not picked by shlibs, so add it to RDEPENDS too
+PACKAGECONFIG[consolekit] = "--with-session-tracking=consolekit,,consolekit,consolekit"
+PACKAGECONFIG[concheck] = "--with-libsoup=yes,--with-libsoup=no,libsoup-2.4"
+PACKAGECONFIG[modemmanager] = "--with-modem-manager-1=yes,--with-modem-manager-1=no,modemmanager"
+PACKAGECONFIG[ppp] = "--enable-ppp,--disable-ppp,ppp,ppp"
+# Use full featured dhcp client instead of internal one
+PACKAGECONFIG[dhclient] = "--with-dhclient=${base_sbindir}/dhclient,,,dhcp-client"
+PACKAGECONFIG[dnsmasq] = "--with-dnsmasq=${bindir}/dnsmasq"
+PACKAGECONFIG[nss] = "--with-crypto=nss,,nss"
+PACKAGECONFIG[gnutls] = "--with-crypto=gnutls,,gnutls"
+PACKAGECONFIG[wifi] = "--enable-wifi=yes,--enable-wifi=no,wireless-tools,wpa-supplicant wireless-tools"
+PACKAGECONFIG[ifupdown] = "--enable-ifupdown,--disable-ifupdown"
+PACKAGECONFIG[netconfig] = "--with-netconfig=yes,--with-netconfig=no"
+PACKAGECONFIG[qt4-x11-free] = "--enable-qt,--disable-qt,qt4-x11-free"
+
+PACKAGES =+ "libnmutil libnmglib libnmglib-vpn \
+  ${PN}-nmtui ${PN}-nmtui-doc \
+  ${PN}-adsl \
+"
+
+FILES_libnmutil += "${libdir}/libnm-util.so.*"
+FILES_libnmglib += "${libdir}/libnm-glib.so.*"
+FILES_libnmglib-vpn += "${libdir}/libnm-glib-vpn.so.*"
+
+FILES_${PN}-adsl = "${libdir}/NetworkManager/libnm-device-plugin-adsl.so"
+
+FILES_${PN} += " \
+    ${libexecdir} \
+    ${libdir}/pppd/*/nm-pppd-plugin.so \
+    ${libdir}/NetworkManager/*.so \
+    ${datadir}/polkit-1 \
+    ${datadir}/dbus-1 \
+    ${base_libdir}/udev/* \
+    ${systemd_unitdir}/system \
+"
+
+RRECOMMENDS_${PN} += "iptables \
+    ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \
+"
+RCONFLICTS_${PN} = "connman"
+
+FILES_${PN}-dev += " \
+    ${datadir}/NetworkManager/gdb-cmd \
+    ${libdir}/pppd/*/*.la \
+    ${libdir}/NetworkManager/*.la \
+"
+
+FILES_${PN}-nmtui = " \
+    ${bindir}/nmtui \
+    ${bindir}/nmtui-edit \
+    ${bindir}/nmtui-connect \
+    ${bindir}/nmtui-hostname \
+"
+
+FILES_${PN}-nmtui-doc = " \
+    ${mandir}/man1/nmtui* \
+"
+
+SYSTEMD_SERVICE_${PN} = "NetworkManager.service NetworkManager-dispatcher.service"
+
+do_install_append() {
+    rm -rf ${D}/run ${D}${localstatedir}/run
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/obex-data-server/obex-data-server-0.4.6-build-fixes-1.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/obex-data-server/obex-data-server-0.4.6-build-fixes-1.patch
new file mode 100644
index 0000000..e2c4e9f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/obex-data-server/obex-data-server-0.4.6-build-fixes-1.patch
@@ -0,0 +1,20 @@
+Submitted By:            Armin K. <krejzi at email dot com>
+Date:                    2012-07-06
+Initial Package Version: 0.4.6
+Upstream Status:         Unknown
+Origin:                  Self
+Description:             Some build fixes.
+
+Index: obex-data-server-0.4.6/src/ods-obex.c
+===================================================================
+--- obex-data-server-0.4.6.orig/src/ods-obex.c
++++ obex-data-server-0.4.6/src/ods-obex.c
+@@ -412,7 +412,7 @@ ods_obex_setup_usbtransport (OdsObexCont
+ 		goto err;
+ 	}
+ 
+-	interfaces_num = OBEX_FindInterfaces(obex_context->obex_handle, &obex_intf);
++	interfaces_num = OBEX_EnumerateInterfaces(obex_context->obex_handle);
+ 	if (intf_num >= interfaces_num) {
+ 		g_set_error (error, ODS_ERROR, ODS_ERROR_FAILED, "Invalid interface number");
+ 		goto err;
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/obex-data-server_0.4.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/obex-data-server_0.4.6.bb
index c2c284e..e10b89c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/obex-data-server_0.4.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/obex-data-server_0.4.6.bb
@@ -2,14 +2,15 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
-DEPENDS = "gtk+ dbus-glib imagemagick openobex"
+DEPENDS = "gtk+ dbus-glib dbus-glib-native imagemagick openobex"
 DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES','bluez5','bluez5','bluez4',d)}"
 
-SRC_URI = "http://tadas.dailyda.com/software/obex-data-server-${PV}.tar.gz"
+SRC_URI = "http://tadas.dailyda.com/software/obex-data-server-${PV}.tar.gz \
+           file://obex-data-server-0.4.6-build-fixes-1.patch \
+"
 SRC_URI[md5sum] = "961ca5db6fe9c97024e133cc6203cc4d"
 SRC_URI[sha256sum] = "b399465ddbd6d0217abedd9411d9d74a820effa0a6a142adc448268d3920094f"
 
 inherit autotools-brokensep pkgconfig
 
 FILES_${PN} += "${datadir}/dbus-1/"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex-1.5/disable-cable-test.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex-1.5/disable-cable-test.patch
deleted file mode 100644
index 95b636d..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex-1.5/disable-cable-test.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#
-# Patch managed by http://www.holgerschurig.de/patcher.html
-#
-
---- openobex-1.2/apps/Makefile.am~disable-cable-test
-+++ openobex-1.2/apps/Makefile.am
-@@ -6,7 +6,7 @@
- 	obex_io.c obex_io.h \
- 	obex_put_common.c obex_put_common.h
- 
--bin_PROGRAMS = irxfer obex_tcp irobex_palm3 obex_test
-+bin_PROGRAMS = irxfer obex_tcp irobex_palm3
- 
- obex_test_SOURCES = \
- 	obex_test.c obex_test.h \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex-1.5/libusb_crosscompile_check.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex-1.5/libusb_crosscompile_check.patch
deleted file mode 100644
index 1177dfe..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex-1.5/libusb_crosscompile_check.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- /tmp/acinclude.m4	2009-04-12 10:32:15.000000000 +0200
-+++ openobex-1.5/acinclude.m4	2009-04-12 10:32:38.000000000 +0200
-@@ -158,7 +158,7 @@
- 		;;
- 	*)
- 		PKG_CHECK_MODULES(USB, libusb, usb_lib_found=yes, AC_MSG_RESULT(no))
--		AC_CHECK_FILE(${prefix}/lib/pkgconfig/libusb.pc, REQUIRES="libusb")
-+		REQUIRES="libusb"
- 		;;
- 	esac
- 	AC_SUBST(USB_CFLAGS)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex-1.5/separate_builddir.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex-1.5/separate_builddir.patch
deleted file mode 100644
index 8abf8ae..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex-1.5/separate_builddir.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Fix detection of IrDA failing with B!=S
-
-Upstream-Status: Pending
-
-Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-
---- a/acinclude.m4	2014-05-24 14:05:41.757796816 +0100
-+++ b/acinclude.m4	2014-05-24 14:03:06.556795536 +0100
-@@ -54,6 +54,7 @@
- ])
- 
- AC_DEFUN([AC_PATH_IRDA_LINUX], [
-+	CPPFLAGS="${CPPFLAGS} -I${srcdir}"
- 	AC_CACHE_CHECK([for IrDA support], irda_found, [
- 		AC_TRY_COMPILE([
- 				#include <sys/socket.h>
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex_1.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex_1.5.bb
deleted file mode 100644
index 6ac7905..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex_1.5.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-DESCRIPTION = "The Openobex project is an open source implementation of the \
-Object Exchange (OBEX) protocol."
-HOMEPAGE = "http://openobex.triq.net"
-SECTION = "libs"
-DEPENDS = "virtual/libusb0"
-DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES','bluez5','bluez5','bluez4',d)}"
-
-LICENSE = "GPLv2 & LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
-                    file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
-"
-
-SRC_URI = "http://www.kernel.org/pub/linux/bluetooth/openobex-${PV}.tar.gz \
-           file://disable-cable-test.patch \
-           file://libusb_crosscompile_check.patch \
-           file://separate_builddir.patch"
-
-SRC_URI[md5sum] = "0d83dc86445a46a1b9750107ba7ab65c"
-SRC_URI[sha256sum] = "e602047570799a47ecb028420bda8f2cef41310e5a99d084de10aa9422935e65"
-
-inherit autotools binconfig pkgconfig
-
-EXTRA_OECONF = "--enable-apps --enable-syslog"
-
-do_install_append() {
-    install -d ${D}${datadir}/aclocal
-    install -m 0644 ${S}/openobex.m4 ${D}${datadir}/aclocal
-}
-
-PACKAGES += "openobex-apps"
-FILES_${PN} = "${libdir}/lib*.so.*"
-FILES_${PN}-dev += "${bindir}/openobex-config"
-FILES_${PN}-apps = "${bindir}/*"
-DEBIAN_NOAUTONAME_${PN}-apps = "1"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex_1.7.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex_1.7.2.bb
new file mode 100644
index 0000000..053c80a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obex/openobex_1.7.2.bb
@@ -0,0 +1,37 @@
+DESCRIPTION = "The Openobex project is an open source implementation of the \
+Object Exchange (OBEX) protocol."
+HOMEPAGE = "http://openobex.triq.net"
+SECTION = "libs"
+DEPENDS = "virtual/libusb0"
+DEPENDS_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES','bluez5','bluez5','bluez4',d)}"
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+                    file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}/${PV}/${BP}-Source.tar.gz \
+"
+
+SRC_URI[md5sum] = "f6e0b6cb7dcfd731460a7e9a91429a3a"
+SRC_URI[sha256sum] = "158860aaea52f0fce0c8e4b64550daaae06df2689e05834697b7e8c7d73dd4fc"
+
+inherit cmake pkgconfig
+
+S = "${WORKDIR}/${BP}-Source"
+
+EXTRA_OECONF = " -DCMAKE_SKIP_RPATH=ON "
+
+#--enable-apps --enable-syslog
+
+do_install_append () {
+    rmdir ${D}${bindir}
+}
+
+PACKAGES =+ "openobex-apps"
+FILES_${PN}-apps = "${bindir}/*"
+FILES_${PN} += "${libdir}/lib*.so.*"
+FILES_${PN}-dev += "${bindir}/openobex-config ${libdir}/cmake"
+DEBIAN_NOAUTONAME_${PN}-apps = "1"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp/0001-apps-CMakeLists.txt-Explicitly-link-libbfb-and-libmu.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp/0001-apps-CMakeLists.txt-Explicitly-link-libbfb-and-libmu.patch
new file mode 100644
index 0000000..1f6de87
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp/0001-apps-CMakeLists.txt-Explicitly-link-libbfb-and-libmu.patch
@@ -0,0 +1,66 @@
+From b8dc608dad7d9fc3a4c16acd0327d97b81c23b95 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Nov 2016 01:32:31 +0000
+Subject: [PATCH] apps/CMakeLists.txt: Explicitly link libbfb and libmulticobex
+
+Transitive linking is disabled now for multicobex and
+obexftp, This ends up with linking errors for apps, therefore
+they are required to be added to link line explicitly.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ apps/CMakeLists.txt | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+Index: obexftp-0.24.2-Source/apps/CMakeLists.txt
+===================================================================
+--- obexftp-0.24.2-Source.orig/apps/CMakeLists.txt
++++ obexftp-0.24.2-Source/apps/CMakeLists.txt
+@@ -5,14 +5,23 @@ add_definitions( -DVERSION="${obexftp_VE
+ add_definitions ( -DHAVE_USB )
+ 
+ add_executable ( obexftp_app obexftp.c )
+-target_link_libraries ( obexftp_app obexftp )
++target_link_libraries ( obexftp_app
++  PRIVATE multicobex
++  PRIVATE bfb
++  obexftp
++)
+ set_target_properties ( obexftp_app PROPERTIES
+   OUTPUT_NAME obexftp
+ )
+ 
+ 
+ add_executable ( obexftpd_app obexftpd.c )
+-target_link_libraries ( obexftpd_app obexftp openobex )
++target_link_libraries ( obexftpd_app
++  PRIVATE multicobex
++  PRIVATE bfb
++  obexftp
++  openobex
++)
+ set_target_properties ( obexftpd_app PROPERTIES
+   OUTPUT_NAME obexftpd
+ )
+Index: obexftp-0.24.2-Source/fuse/CMakeLists.txt
+===================================================================
+--- obexftp-0.24.2-Source.orig/fuse/CMakeLists.txt
++++ obexftp-0.24.2-Source/fuse/CMakeLists.txt
+@@ -13,6 +13,8 @@ if ( Fuse_FOUND )
+   )
+ 
+   target_link_libraries ( obexfs
++    PRIVATE multicobex
++    PRIVATE bfb
+     obexftp
+     ${Fuse_LIBRARIES}
+     ${EXPAT_LIBRARIES}
+@@ -23,6 +25,8 @@ if ( Fuse_FOUND )
+   )
+ 
+   target_link_libraries ( obexautofs
++    PRIVATE multicobex
++    PRIVATE bfb
+     obexftp
+     ${Fuse_LIBRARIES}
+   )
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp/make_fuse_swig_optional.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp/make_fuse_swig_optional.patch
new file mode 100644
index 0000000..84b143b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp/make_fuse_swig_optional.patch
@@ -0,0 +1,24 @@
+Index: obexftp-0.24.2-Source/CMakeLists.txt
+===================================================================
+--- obexftp-0.24.2-Source.orig/CMakeLists.txt
++++ obexftp-0.24.2-Source/CMakeLists.txt
+@@ -58,9 +58,17 @@ add_subdirectory ( bfb )
+ add_subdirectory ( multicobex )
+ add_subdirectory ( obexftp )
+ add_subdirectory ( apps )
+-add_subdirectory ( fuse )
+-add_subdirectory ( swig )
+ add_subdirectory ( doc )
++
++option ( ENABLE_FUSE "Build the obexftp fuse module" OFF )
++if ( ENABLE_FUSE )
++  add_subdirectory ( fuse )
++endif ( ENABLE_FUSE )
++
++option ( ENABLE_SWIG "Build the obexftp swig module" OFF )
++if ( ENABLE_SWIG )
++  add_subdirectory ( swig )
++endif ( ENABLE_SWIG )
+ #examples
+ 
+ set ( prefix      "${CMAKE_INSTALL_PREFIX}" )
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp_0.23.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp_0.23.bb
deleted file mode 100644
index b6bdfb7..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp_0.23.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-DESCRIPTION = "A tool for transfer files to/from any OBEX enabled device"
-LICENSE = "GPLv2 & LGPLv2 & LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-
-DEPENDS += "openobex"
-
-SRC_URI = "http://sourceforge.net/projects/openobex/files/obexftp/${PV}/obexftp-${PV}.tar.bz2 \
-           file://Remove_some_printf_in_obexftpd.patch "
-
-SRC_URI[md5sum] = "f20762061b68bc921e80be4aebc349eb"
-SRC_URI[sha256sum] = "44a74ff288d38c0f75354d6bc2efe7d6dec10112eaff2e7b10e292b0d2105b36"
-
-inherit autotools pkgconfig
-
-EXTRA_OECONF += "--disable-tcl --disable-perl --disable-python --disable-ruby"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp_0.24.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp_0.24.2.bb
new file mode 100644
index 0000000..489861c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/obexftp/obexftp_0.24.2.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "A tool for transfer files to/from any OBEX enabled device"
+LICENSE = "GPLv2 & PD & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LGPL-2.1.txt;md5=4fbd65380cdd255951079008b364516c \
+                    file://GPL-2.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://License.txt;md5=fcbddc3c1debed80dd80da2d3e5f0dc1 \
+                   "
+
+DEPENDS += "openobex obexftp-native"
+SRC_URI = "http://downloads.sourceforge.net/openobex/${BP}-Source.tar.gz \
+           file://Remove_some_printf_in_obexftpd.patch \
+           file://0001-apps-CMakeLists.txt-Explicitly-link-libbfb-and-libmu.patch \
+           file://make_fuse_swig_optional.patch \
+"
+SRC_URI[md5sum] = "157a9d1b2ed220203f7084db906de73c"
+SRC_URI[sha256sum] = "d40fb48e0a0eea997b3e582774b29f793919a625d54b87182e31a3f3d1c989a3"
+
+inherit cmake pkgconfig
+
+PACKAGECONFIG ?= ""
+# fuse support will need meta-filesystems layer
+PACKAGECONFIG[fuse] = "-DENABLE_FUSE=ON,-DENABLE_FUSE=OFF,fuse"
+PACKAGECONFIG[swig] = "-DENABLE_SWIG=ON,-DENABLE_SWIG=OFF,swig"
+
+DEPENDS_remove_class-native = "fuse-native"
+
+S = "${WORKDIR}/${BP}-Source"
+
+EXTRA_OECMAKE += "-DCMAKE_SKIP_RPATH=ON \
+                  -DENABLE_PERL=OFF -DENABLE_PYTHON=OFF \
+                  -DENABLE_RUBY=OFF -DENABLE_TCL=OFF \
+"
+
+do_compile_class-native () {
+    oe_runmake crctable
+}
+
+do_install_class-native () {
+    install -D -m 0755 ${B}/bfb/crctable ${D}${bindir}/crctable
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/rtorrent/rtorrent_0.9.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/rtorrent/rtorrent_0.9.3.bb
deleted file mode 100644
index eb0a39a..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/rtorrent/rtorrent_0.9.3.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "Torrent client"
-HOMEPAGE = "http://libtorrent.rakshasa.no/"
-LICENSE = "GPL-2.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-DEPENDS = "libsigc++-2.0 curl cppunit libtorrent ncurses"
-
-SRC_URI = "http://libtorrent.rakshasa.no/downloads/${BP}.tar.gz \
-    file://don-t-run-code-while-configuring-package.patch \
-"
-
-SRC_URI[md5sum] = "0bf2f262faa8c8c8d3b11ce286ea2bf2"
-SRC_URI[sha256sum] = "9e93ca41beb1afe74ad7ad8013e0d53ae3586c9b0e97263d722f721535cc7310"
-
-inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/rtorrent/rtorrent_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/rtorrent/rtorrent_git.bb
new file mode 100644
index 0000000..af1c4d6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/rtorrent/rtorrent_git.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Torrent client"
+HOMEPAGE = "http://libtorrent.rakshasa.no/"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "libsigc++-2.0 curl cppunit libtorrent ncurses"
+
+SRC_URI = "git://github.com/rakshasa/rtorrent \
+    file://don-t-run-code-while-configuring-package.patch \
+"
+SRCREV = "226e670decf92e7adaa845a6982aca4f164ea740"
+
+PV = "0.9.6+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+do_configure_prepend() {
+    (cd ${S}; ./autogen.sh; cd -)
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/ser2net/ser2net_2.9.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/ser2net/ser2net_2.9.1.bb
index 8fe6a6f..288c586 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/ser2net/ser2net_2.9.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/ser2net/ser2net_2.9.1.bb
@@ -12,4 +12,4 @@
 
 inherit autotools pkgconfig
 
-BBCLASSEXTEND += "native nativesdk"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/soft66/soft66_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/soft66/soft66_git.bb
index b649526..816f583 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/soft66/soft66_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/soft66/soft66_git.bb
@@ -3,7 +3,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
                     file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02 "
 
-PNBLACKLIST[soft66] ?= "BROKEN: depends on broken libftdi"
+PNBLACKLIST[soft66] ?= "BROKEN: depends on broken libftdi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 DEPENDS = "libftdi"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/telepathy/libtelepathy_0.3.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/telepathy/libtelepathy_0.3.3.bb
index c398dc1..783bd5d 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/telepathy/libtelepathy_0.3.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/telepathy/libtelepathy_0.3.3.bb
@@ -22,3 +22,5 @@
 
 FILES_${PN} += "${datadir}/telepathy \
     ${datadir}/dbus-1"
+
+PNBLACKLIST[libtelepathy] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130609/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/telepathy/telepathy-mission-control_5.16.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/telepathy/telepathy-mission-control_5.16.1.bb
index 582783c..6a4d5d0 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/telepathy/telepathy-mission-control_5.16.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/telepathy/telepathy-mission-control_5.16.1.bb
@@ -49,3 +49,5 @@
 FILES_libmissioncontrol-dbg = "${libdir}/.debug/libmissioncontrol.so.*"
 FILES_libmissioncontrol-config-dbg = "${libdir}/.debug/libmissioncontrol-config.so.*"
 FILES_libmissioncontrol-server-dbg = "${libdir}/.debug/libmissioncontrol-server.so.*"
+
+PNBLACKLIST[telepathy-mission-control] ?= "Depends on blacklisted libtelepathy - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/thrift/thrift_0.9.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/thrift/thrift_0.9.3.bb
index 905e561..9baeed1 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/thrift/thrift_0.9.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/thrift/thrift_0.9.3.bb
@@ -3,18 +3,19 @@
 HOMEPAGE = "https://thrift.apache.org/"
 
 LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e4ed21f679b2aafef26eac82ab0c2cbf"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e4ed21f679b2aafef26eac82ab0c2cbf \
+                    file://NOTICE;md5=115f49498b66b494b0472658f2bfe80b"
 
-DEPENDS = "thrift-native boost python libevent flex-native bison-native \
-           glib-2.0 openssl"
+DEPENDS = "thrift-native boost flex-native bison-native openssl"
 
-SRC_URI = "git://git-wip-us.apache.org/repos/asf/thrift.git;protocol=https \
+SRC_URI = "http://mirror.switch.ch/mirror/apache/dist/thrift/${PV}/${BPN}-${PV}.tar.gz \
            file://0001-Forcibly-disable-check-for-Qt5.patch \
            file://0001-THRIFT-3828-In-cmake-avoid-use-of-both-quoted-paths-.patch \
            file://0002-THRIFT-3831-in-test-cpp-explicitly-use-signed-char.patch \
 "
-SRCREV = "61b8a29b0704ccd81b520f2300f5d1bb261fea3e"
-S = "${WORKDIR}/git"
+
+SRC_URI[md5sum] = "88d667a8ae870d5adeca8cb7d6795442"
+SRC_URI[sha256sum] = "b0740a070ac09adde04d43e852ce4c320564a292f26521c46b78e0641564969e"
 
 BBCLASSEXTEND = "native nativesdk"
 
@@ -25,12 +26,44 @@
 export BUILD_SYS
 export HOST_SYS
 
-EXTRA_OECMAKE = "-DWITH_QT4=OFF -DWITH_QT5=OFF -DBUILD_JAVA=OFF"
+EXTRA_OECMAKE = " \
+    -DBUILD_LIBRARIES=ON \
+    -DBUILD_COMPILER=ON \
+    -DBUILD_TESTING=OFF \
+    -DBUILD_EXAMPLES=OFF \
+    -DBUILD_TUTORIALS=OFF \
+    -DWITH_CPP=ON \
+    -DWITH_JAVA=OFF \
+    -DWITH_STATIC_LIB=ON \
+    -DWITH_SHARED_LIB=ON \
+    -DWITH_OPENSSL=ON \
+    -DWITH_QT4=OFF \
+    -DWITH_QT5=OFF \
+"
+
 EXTRA_OECMAKE_append_class-native = "\
              -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DWITH_CPP=OFF"
 EXTRA_OECMAKE_append_class-nativesdk = "\
              -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DWITH_PYTHON=OFF"
 
+PACKAGECONFIG ??= "libevent glib python"
+PACKAGECONFIG[libevent] = "-DWITH_LIBEVENT=ON,-DWITH_LIBEVENT=OFF,libevent,"
+PACKAGECONFIG[python] = "-DWITH_PYTHON=ON,-DWITH_PYTHON=OFF,python,"
+PACKAGECONFIG[glib] = "-DWITH_C_GLIB=ON,-DWITH_C_GLIB=OFF,glib-2.0 ,"
+
 do_install_append () {
     ln -sf thrift ${D}/${bindir}/thrift-compiler
 }
+
+LEAD_SONAME = "libthrift.so.${PV}"
+
+# thrift packages
+PACKAGE_BEFORE_PN = "${PN}-compiler lib${BPN}"
+FILES_lib${BPN} = "${libdir}/*.so.*"
+FILES_${PN}-compiler = "${bindir}/*"
+
+# The thrift packages just pulls in some default dependencies but is otherwise empty
+RRECOMMENDS_${PN} = "${PN}-compiler lib${BPN}"
+ALLOW_EMPTY_${PN} = "1"
+RRECOMMENDS_${PN}_class-native = ""
+RRECOMMENDS_${PN}_class-nativesdk = ""
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-Add-format-string-to-fprintf-call.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-Add-format-string-to-fprintf-call.patch
new file mode 100644
index 0000000..8e5f4da
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/0001-Add-format-string-to-fprintf-call.patch
@@ -0,0 +1,26 @@
+From a0ad5128d14b022239445e251cf4a9826e86aa96 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 07:48:31 -0700
+Subject: [PATCH] Add format string to fprintf() call
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/vt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/vt.c b/src/vt.c
+index 795d393..a533d3d 100644
+--- a/src/vt.c
++++ b/src/vt.c
+@@ -499,7 +499,7 @@ static int vt_cmd_dump_candidates(const struct vt_handle *vh,
+ 		}
+ 		llen += cmdlen;
+ 
+-		ret = fprintf(vh->vh_stream, e->cmd);
++		ret = fprintf(vh->vh_stream, "%s", e->cmd);
+ 		if (ret < 0)
+ 			return ret;
+ 
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/add-dependency-to-support-parallel-compilation.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/add-dependency-to-support-parallel-compilation.patch
new file mode 100644
index 0000000..dbf0082
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/add-dependency-to-support-parallel-compilation.patch
@@ -0,0 +1,23 @@
+When "make -j10", the compilation will fail,
+because scan.c has included gram.h, but gram.h was produced
+after scan.c was compiled
+
+So add this dependency to ensure that gram.h is produced
+before scan.c is produced.
+
+Upstream-Status: Inappropriate [upstream is not active]
+
+Signed-off-by: Roy.Li <RongQing.Li@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/Makefile.am |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -81,3 +81,5 @@ CLEANFILES = gram.c gram.h \
+ 
+ DISTCLEANFILES = $(BUILT_SOURCES)
+ MAINTAINERCLEANFILES = Makefile.in
++
++scan.c: gram.h
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d
new file mode 100755
index 0000000..ebd70a6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d
@@ -0,0 +1,112 @@
+#!/bin/sh
+#
+# mip6d		Start script for the Mobile IPv6 daemon
+#
+# chkconfig:	- 55 25
+# description:	The mobile IPv6 daemon allows nodes to remain \
+#		reachable while moving around in the IPv6 Internet.
+# processname:	mip6d
+# config:	/etc/mip6d.conf
+# config:	/etc/sysconfig/mip6d
+#
+### BEGIN INIT INFO
+# Provides: mipv6-daemon
+# Required-Start: $local_fs $remote_fs $network $named
+# Required-Stop: $local_fs $remote_fs $network
+# Should-Start: $syslog
+# Should-Stop: $network $syslog
+# Default-Start:
+# Default-Stop: 0 1 6
+# Short-Description: Start and stop Mobile IPV6 daemon
+# Description:	The mobile IPv6 daemon allows nodes to remain
+#		reachable while moving around in the IPv6 Internet.
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+if [ -f /etc/sysconfig/mip6d ]; then
+	. /etc/sysconfig/mip6d
+fi
+
+mip6d=/usr/sbin/mip6d
+prog="mip6d"
+lockfile=/var/lock/subsys/$prog
+
+start() {
+	[ -x $mip6d ] || exit 5
+	echo -n $"Starting $prog: "
+	start-stop-daemon -S -x ${mip6d} && success || failure
+	retval=$?
+	echo
+	[ $retval -eq 0 ] && touch ${lockfile}
+	return $retval
+}
+
+stop() {
+	echo -n $"Stopping $prog: "
+	start-stop-daemon -K -x $mip6d
+	retval=$?
+	echo
+	[ $retval -eq 0 ] && rm -f ${lockfile}
+	return $retval
+}
+
+restart() {
+	stop
+	start
+}
+
+reload()
+{
+	echo -n $"Reloading $prog configuration: "
+	killproc $mip6d -HUP
+	retval=$?
+	echo
+	return $retval
+}
+
+force_reload() {
+	restart
+}
+
+rh_status() {
+	status $prog
+}
+
+rh_status_q() {
+	rh_status > /dev/null 2>&1
+}
+
+case "$1" in
+  start)
+	rh_status_q && exit 0
+	$1
+	;;
+  stop)
+	rh_status_q || exit 0
+	$1
+	;;
+  restart)
+	$1
+	;;
+  reload)
+	rh_status_q || exit 7
+	$1
+	;;
+  force-reload)
+	force_reload
+	;;
+  status)
+	rh_status
+	;;
+  condrestart|try-restart)
+	rh_status_q || exit 0
+	restart
+	;;
+  *)
+	echo $"Usage: $prog {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+	exit 2
+esac
+
+exit $?
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d.service b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d.service
new file mode 100644
index 0000000..2b5a5b9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/files/mip6d.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=MIPL Mobile IPv6
+After=network.target
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/mip6d
+ExecStart=@SBINDIR@/mip6d $ARGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/umip_1.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/umip_1.0.bb
index e80c1b1..cbf3061 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/umip_1.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/umip/umip_1.0.bb
@@ -9,12 +9,32 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=073dc31ccb2ebed70db54f1e8aeb4c33"
 DEPENDS = "rpm indent-native"
 
-SRC_URI = "git://git.umip.org/umip.git"
+SRC_URI = "git://git.umip.org/umip.git \
+           file://add-dependency-to-support-parallel-compilation.patch \
+           file://mip6d \
+           file://mip6d.service \
+           file://0001-Add-format-string-to-fprintf-call.patch \
+           "
 SRCREV = "428974c2d0d8e75a2750a3ab0488708c5dfdd8e3"
 
 S = "${WORKDIR}/git"
-EXTRA_OE_CONF = "--enable-vt"
 
-inherit autotools-brokensep
+EXTRA_OECONF = "--enable-vt"
 
-PARALLEL_MAKE = ""
+inherit autotools-brokensep systemd update-rc.d
+
+INITSCRIPT_NAME = "mip6d"
+INITSCRIPT_PARAMS = "start 64 . stop 36 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "mip6d.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install_append() {
+	install -D -m 0755 ${WORKDIR}/mip6d ${D}${sysconfdir}/init.d/mip6d
+	install -D -m 0644 ${WORKDIR}/mip6d.service ${D}${systemd_system_unitdir}/mip6d.service
+	sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+	    -e 's,@SBINDIR@,${sbindir},g' \
+	    ${D}${systemd_system_unitdir}/mip6d.service
+}
+
+RRECOMMENDS_${PN} = "kernel-module-mip6 kernel-module-ipv6"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/usbmuxd/usbmuxd_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/usbmuxd/usbmuxd_git.bb
index 52bf811..4365aa4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/usbmuxd/usbmuxd_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/usbmuxd/usbmuxd_git.bb
@@ -18,7 +18,7 @@
 FILES_${PN} += "${base_libdir}/udev/rules.d/"
 
 # fix usbmuxd installing files to /usr/lib64 on 64bit hosts:
-EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
+EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[plist] = "-DWANT_PLIST=1,-DWANT_PLIST=0,libplist"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvdial_1.61.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvdial_1.61.bb
index 65617fa..3a71fb9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvdial_1.61.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvdial_1.61.bb
@@ -4,6 +4,8 @@
 LICENSE = "LGPLv2"
 LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=55ca817ccb7d5b5b66355690e9abc605"
 
+inherit pkgconfig
+
 DEPENDS = "wvstreams"
 RDEPENDS_${PN} = "ppp"
 
@@ -28,5 +30,3 @@
 do_install() {
     oe_runmake prefix=${D}/usr PPPDIR=${D}/etc/ppp/peers install
 }
-
-PNBLACKLIST[wvdial] ?= "Depends on broken wvstreams"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Check-for-limits.h-during-configure.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Check-for-limits.h-during-configure.patch
new file mode 100644
index 0000000..b092ba2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-Check-for-limits.h-during-configure.patch
@@ -0,0 +1,26 @@
+From 7deaf836d1f1b9e4426818584b4267f8c4a095aa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 21:04:07 -0700
+Subject: [PATCH 1/5] Check for limits.h during configure
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index fe0fa2b..188adfe 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -139,6 +139,8 @@ int main()
+ 			     [Compiler warning on deprecated functions])])
+ CPPFLAGS="$CPPFLAGS_save"
+ 
++AC_CHECK_HEADERS(limits.h)
++
+ # argp
+ USE_WVSTREAMS_ARGP=0
+ AC_CHECK_HEADERS(argp.h)
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-build-fix-parallel-make.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-build-fix-parallel-make.patch
new file mode 100644
index 0000000..6bc3433
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0001-build-fix-parallel-make.patch
@@ -0,0 +1,76 @@
+From 90de630f21ac744a37b3adac1bd84654471744ff Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 24 Aug 2017 22:30:01 -0700
+Subject: [PATCH 1/2] build: fix parallel make
+
+Imported from Gentoo
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile         | 15 +++++++++++++--
+ wvrules-posix.mk |  7 +++++--
+ 2 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 72c8bef..5a4cfb2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -131,12 +131,19 @@ utils/tests/%: PRELIBS+=$(LIBWVSTREAMS)
+ # libwvstreams: stream/event handling library
+ #
+ TARGETS += libwvstreams.so
+-TARGETS += crypto/tests/ssltest ipstreams/tests/unixtest
++TARGETS += crypto/tests/ssltest                                                                                                                             
++crypto/tests/ssltest: $(LIBWVSTREAMS)                                                                                                                       
++
++TARGETS += ipstreams/tests/unixtest
++ipstreams/tests/unixtest: $(LIBWVSTREAMS)
++
+ TARGETS += crypto/tests/printcert
++crypto/tests/printcert: $(LIBWVSTREAMS)
+ 
+ ifndef _MACOS
+   ifneq ("$(with_readline)", "no")
+     TARGETS += ipstreams/tests/wsd
++    ipstreams/tests/wsd: $(LIBWVSTREAMS)
+     ipstreams/tests/wsd-LIBS += -lreadline
+   else
+     TEST_SKIP_OBJS += ipstreams/tests/wsd
+@@ -179,7 +186,11 @@ uniconf/tests/%: PRELIBS+=$(LIBUNICONF)
+ #
+ ifneq ("$(with_dbus)", "no")
+   TARGETS += libwvdbus.so
+-  TARGETS += dbus/tests/wvdbus dbus/tests/wvdbusd
++  TARGETS += dbus/tests/wvdbus
++  dbus/tests/wvdbus: $(LIBWVDBUS)
++
++  TARGETS += dbus/tests/wvdbusd
++  dbus/tests/wvdbusd: $(LIBWVDBUS)
+   TESTS += $(call tests_cc,dbus/tests)
+   libwvdbus_OBJS += $(call objects,dbus)
+   libwvdbus.so: $(libwvdbus_OBJS) $(LIBWVSTREAMS)
+diff --git a/wvrules-posix.mk b/wvrules-posix.mk
+index f94d2cd..2e99f36 100644
+--- a/wvrules-posix.mk
++++ b/wvrules-posix.mk
+@@ -80,12 +80,15 @@ define wvlink_ar
+ 	$(AR) s $1
+ endef
+ 
+-CC: FORCE
++CC:
+ 	@CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
+ 	  $(WVSTREAMS)/gen-cc CC c
+ 
+-CXX: FORCE
++CXX:
+ 	@CC="$(CXX)" CFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
+ 	  $(WVSTREAMS)/gen-cc CXX cc
+ 
++#All files must depend on the above two rules. This is a godawful hack.
++$(shell find -type f '(' -name '*.c' -o -name '*.cc' ')' ): CC CXX
++
+ wvlink=$(LINK_MSG)$(WVLINK_CC) $(LDFLAGS) $($1-LDFLAGS) -o $1 $(filter %.o %.a %.so, $2) $($1-LIBS) $(XX_LIBS) $(LDLIBS) $(PRELIBS) $(LIBS)
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvrules.mk-Use-_DEFAULT_SOURCE.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvrules.mk-Use-_DEFAULT_SOURCE.patch
new file mode 100644
index 0000000..59f70e3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvrules.mk-Use-_DEFAULT_SOURCE.patch
@@ -0,0 +1,29 @@
+From 4afff42714a15cb796d3589d87c6fac4558b2c95 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 24 Aug 2017 22:33:32 -0700
+Subject: [PATCH 2/2] wvrules.mk: Use _DEFAULT_SOURCE
+
+Fixes warnings with newer glibc
+warning: "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ wvrules.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/wvrules.mk b/wvrules.mk
+index 877f700..124bffd 100644
+--- a/wvrules.mk
++++ b/wvrules.mk
+@@ -83,7 +83,7 @@ runtests:
+ 
+ INCFLAGS=$(addprefix -I,$(WVSTREAMS_INC) $(XPATH))
+ CPPFLAGS+=$(INCFLAGS) \
+-	-D_BSD_SOURCE -D_GNU_SOURCE $(OSDEFINE) \
++	-D_DEFAULT_SOURCE $(OSDEFINE) \
+ 	-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
+ 	-DUNSTABLE
+ 
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvtask-Dont-use-ucontext-on-non-glibc-systems.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvtask-Dont-use-ucontext-on-non-glibc-systems.patch
new file mode 100644
index 0000000..232db9e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0002-wvtask-Dont-use-ucontext-on-non-glibc-systems.patch
@@ -0,0 +1,135 @@
+From 0e054339c1422168a7f4a9dcf090268053a33b1f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 21:05:37 -0700
+Subject: [PATCH 2/5] wvtask: Dont use ucontext on non-glibc systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/wvtask.cc | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/utils/wvtask.cc b/utils/wvtask.cc
+index cdcd544..c0bff7d 100644
+--- a/utils/wvtask.cc
++++ b/utils/wvtask.cc
+@@ -199,7 +199,9 @@ WvTaskMan::WvTaskMan()
+     stacktop = (char *)alloca(0);
+     
+     context_return = 0;
++#ifdef __GLIBC__
+     assert(getcontext(&get_stack_return) == 0);
++#endif
+     if (context_return == 0)
+     {
+ 	// initial setup - start the stackmaster() task (never returns!)
+@@ -265,13 +267,17 @@ int WvTaskMan::run(WvTask &task, int val)
+ 	state = &old_task->mystate;
+     
+     context_return = 0;
++#ifdef __GLIBC__
+     assert(getcontext(state) == 0);
++#endif
+     int newval = context_return;
+     if (newval == 0)
+     {
+ 	// saved the state, now run the task.
+         context_return = val;
++#ifdef __GLIBC__
+         setcontext(&task.mystate);
++#endif
+         return -1;
+     }
+     else
+@@ -319,13 +325,17 @@ int WvTaskMan::yield(int val)
+ #endif
+ 		
+     context_return = 0;
++#ifdef __GLIBC__
+     assert(getcontext(&current_task->mystate) == 0);
++#endif
+     int newval = context_return;
+     if (newval == 0)
+     {
+ 	// saved the task state; now yield to the toplevel.
+         context_return = val;
++#ifdef __GLIBC__
+         setcontext(&toplevel);
++#endif
+         return -1;
+     }
+     else
+@@ -341,7 +351,9 @@ int WvTaskMan::yield(int val)
+ void WvTaskMan::get_stack(WvTask &task, size_t size)
+ {
+     context_return = 0;
++#ifdef __GLIBC__
+     assert(getcontext(&get_stack_return) == 0);
++#endif
+     if (context_return == 0)
+     {
+ 	assert(magic_number == -WVTASK_MAGIC);
+@@ -371,7 +383,9 @@ void WvTaskMan::get_stack(WvTask &task, size_t size)
+ 	// initial setup
+ 	stack_target = &task;
+ 	context_return = size/1024 + (size%1024 > 0);
++#ifdef __GLIBC__
+ 	setcontext(&stackmaster_task);
++#endif
+     }
+     else
+     {
+@@ -409,7 +423,9 @@ void WvTaskMan::_stackmaster()
+ 	assert(magic_number == -WVTASK_MAGIC);
+ 	
+         context_return = 0;
++#ifdef __GLIBC__
+         assert(getcontext(&stackmaster_task) == 0);
++#endif
+         val = context_return;
+ 	if (val == 0)
+ 	{
+@@ -419,7 +435,9 @@ void WvTaskMan::_stackmaster()
+ 	    // all current stack allocations) and go back to get_stack
+ 	    // (or the constructor, if that's what called us)
+             context_return = 1;
++#ifdef __GLIBC__
+             setcontext(&get_stack_return);
++#endif
+ 	}
+ 	else
+ 	{
+@@ -474,7 +492,9 @@ void WvTaskMan::do_task()
+ 	
+     // back here from longjmp; someone wants stack space.    
+     context_return = 0;
++#ifdef __GLIBC__
+     assert(getcontext(&task->mystate) == 0);
++#endif
+     if (context_return == 0)
+     {
+ 	// done the setjmp; that means the target task now has
+@@ -510,7 +530,9 @@ void WvTaskMan::do_task()
+                 }
+                 else
+                 {
++#ifdef __GLIBC__
+                     assert(getcontext(&task->func_call) == 0);
++#endif
+                     task->func_call.uc_stack.ss_size = task->stacksize;
+                     task->func_call.uc_stack.ss_sp = task->stack;
+                     task->func_call.uc_stack.ss_flags = 0;
+@@ -521,9 +543,11 @@ void WvTaskMan::do_task()
+                             (void (*)(void))call_func, 1, task);
+ 
+                     context_return = 0;
++#ifdef __GLIBC__
+                     assert(getcontext(&task->func_return) == 0);
+                     if (context_return == 0)
+                         setcontext(&task->func_call);
++#endif
+                 }
+ 		
+ 		// the task's function terminated.
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0003-wvtask-Check-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0003-wvtask-Check-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch
new file mode 100644
index 0000000..f930419
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0003-wvtask-Check-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch
@@ -0,0 +1,27 @@
+From f1fc9f4d523dd8b773a4535176547b0619ec05c6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 21:08:57 -0700
+Subject: [PATCH 3/5] wvtask: Check for HAVE_LIBC_STACK_END only on glibc
+ systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/wvtask.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/wvtask.cc b/utils/wvtask.cc
+index c0bff7d..716344b 100644
+--- a/utils/wvtask.cc
++++ b/utils/wvtask.cc
+@@ -563,7 +563,7 @@ void WvTaskMan::do_task()
+ 
+ const void *WvTaskMan::current_top_of_stack()
+ {
+-#ifdef HAVE_LIBC_STACK_END
++#if defined(HAVE_LIBC_STACK_END) && defined(__GLIBC__)
+     extern const void *__libc_stack_end;
+     if (use_shared_stack() || current_task == NULL)
+         return __libc_stack_end;
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0004-wvcrash-Replace-use-of-basename-API.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0004-wvcrash-Replace-use-of-basename-API.patch
new file mode 100644
index 0000000..6f3fbff
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0004-wvcrash-Replace-use-of-basename-API.patch
@@ -0,0 +1,28 @@
+From bfe68126693f9159f7ac66a69217e0b5f43e5781 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 21:11:21 -0700
+Subject: [PATCH 4/5] wvcrash: Replace use of basename API
+
+musl does not have this API
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/wvcrash.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/wvcrash.cc b/utils/wvcrash.cc
+index 0417759..3d160b7 100644
+--- a/utils/wvcrash.cc
++++ b/utils/wvcrash.cc
+@@ -404,7 +404,7 @@ extern void __wvcrash_init_buffers(const char *program_name);
+ void wvcrash_setup(const char *_argv0, const char *_desc)
+ {
+     if (_argv0)
+-	argv0 = basename(_argv0);
++	argv0 = strrchr(_argv0, '/') ? strrchr(_argv0, '/')+1 : _argv0;
+     __wvcrash_init_buffers(argv0);
+     if (_desc)
+     {
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0005-check-for-libexecinfo-during-configure.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0005-check-for-libexecinfo-during-configure.patch
new file mode 100644
index 0000000..25e9ee2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/0005-check-for-libexecinfo-during-configure.patch
@@ -0,0 +1,30 @@
+From fd9515f08dcdafea6ae03413fbe5a43a6438fe3e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 21:25:48 -0700
+Subject: [PATCH 5/5] check for libexecinfo during configure
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 188adfe..1ab4d3c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -159,6 +159,12 @@ AC_SEARCH_LIBS([argp_parse], [argp c], [], [
+       USE_WVSTREAMS_ARGP=1
+   fi
+ ])
++
++USE_LIBEXECINFO=0
++AC_SEARCH_LIBS([backtrace], [execinfo], [], [
++USE_LIBEXECINFO=1
++])
++
+ # Function checks
+ AC_HEADER_DIRENT
+ 
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/argp.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/argp.patch
new file mode 100644
index 0000000..e857213
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/argp.patch
@@ -0,0 +1,37 @@
+Check for argp_parse in libargp and then in libc before using internal version
+
+Index: wvstreams-4.6.1/configure.ac
+===================================================================
+--- wvstreams-4.6.1.orig/configure.ac
++++ wvstreams-4.6.1/configure.ac
+@@ -142,20 +142,21 @@ CPPFLAGS="$CPPFLAGS_save"
+ # argp
+ USE_WVSTREAMS_ARGP=0
+ AC_CHECK_HEADERS(argp.h)
+-AC_CHECK_FUNC(argp_parse)
+-if test "$ac_cv_func_argp_parse" != yes \
+-    -o "$ac_cv_header_argp_h" != yes ; then
+-    (
+-    	echo
++AC_SEARCH_LIBS([argp_parse], [argp c], [], [
++
++  if test "$ac_cv_func_argp_parse" != yes \
++      -o "$ac_cv_header_argp_h" != yes ; then
++      (
++       	echo
+     	echo 'configuring argp...'
+     	cd argp
+     	./configure --host=$host_cpu-$host_os || exit $?
+     	echo 'argp configured.'
+     	echo
+-    ) || exit $?
+-    USE_WVSTREAMS_ARGP=1
+-fi
+-
++      ) || exit $?
++      USE_WVSTREAMS_ARGP=1
++  fi
++])
+ # Function checks
+ AC_HEADER_DIRENT
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/gcc-6.patch b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/gcc-6.patch
new file mode 100644
index 0000000..b084887
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams/gcc-6.patch
@@ -0,0 +1,42 @@
+Description: Fix compilation with gcc-6
+Author: Gert Wollny <gw.fossdev@gmail.com>
+Last-Updated: 2016-07-26
+Forwarded: No
+Bug-Debian: https://bugs.debian.org/811659
+Bug-Debian: https://bugs.debian.org/831146
+
+--- a/streams/wvstream.cc
++++ b/streams/wvstream.cc
+@@ -907,9 +907,9 @@
+     
+     if (forceable)
+     {
+-	si.wants.readable = readcb;
+-	si.wants.writable = writecb;
+-	si.wants.isexception = exceptcb;
++	si.wants.readable = static_cast<bool>(readcb);
++	si.wants.writable = static_cast<bool>(writecb);
++	si.wants.isexception = static_cast<bool>(exceptcb);
+     }
+     else
+     {
+@@ -1019,7 +1019,8 @@
+ 
+ IWvStream::SelectRequest WvStream::get_select_request()
+ {
+-    return IWvStream::SelectRequest(readcb, writecb, exceptcb);
++    return IWvStream::SelectRequest(static_cast<bool>(readcb), static_cast<bool>(writecb),
++				    static_cast<bool>(exceptcb));
+ }
+ 
+ 
+@@ -1107,7 +1108,8 @@
+     // inefficient, because if the alarm was expired then pre_select()
+     // returned true anyway and short-circuited the previous select().
+     TRACE("hello-%p\n", this);
+-    return !alarm_was_ticking || select(0, readcb, writecb, exceptcb);
++    return !alarm_was_ticking || select(0, static_cast<bool>(readcb),
++					static_cast<bool>(writecb), static_cast<bool>(exceptcb));
+ }
+ 
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb
index 8d86448..e3d5e7d 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/wvdial/wvstreams_4.6.1.bb
@@ -5,21 +5,29 @@
 LIC_FILES_CHKSUM = "file://LICENSE;md5=55ca817ccb7d5b5b66355690e9abc605"
 
 DEPENDS = "zlib openssl (>= 0.9.8) dbus readline"
+DEPENDS_append_libc-musl = " argp-standalone libexecinfo"
 
 SRC_URI = "http://${BPN}.googlecode.com/files/${BP}.tar.gz \
            file://04_signed_request.diff \
            file://05_gcc.diff \
            file://06_gcc-4.7.diff \
            file://07_buildflags.diff \
-          "
+           file://gcc-6.patch \
+           file://argp.patch \
+           file://0001-Check-for-limits.h-during-configure.patch \
+           file://0002-wvtask-Dont-use-ucontext-on-non-glibc-systems.patch \
+           file://0003-wvtask-Check-for-HAVE_LIBC_STACK_END-only-on-glibc-s.patch \
+           file://0004-wvcrash-Replace-use-of-basename-API.patch \
+           file://0005-check-for-libexecinfo-during-configure.patch \
+           file://0001-build-fix-parallel-make.patch \
+           file://0002-wvrules.mk-Use-_DEFAULT_SOURCE.patch \
+           "
 
 SRC_URI[md5sum] = "2760dac31a43d452a19a3147bfde571c"
 SRC_URI[sha256sum] = "8403f5fbf83aa9ac0c6ce15d97fd85607488152aa84e007b7d0621b8ebc07633"
 
 inherit autotools-brokensep pkgconfig
 
-PARALLEL_MAKE = ""
-
 TARGET_CFLAGS_append = " -fno-tree-dce -fno-optimize-sibling-calls"
 
 LDFLAGS_append = " -Wl,-rpath-link,${CROSS_DIR}/${TARGET_SYS}/lib"
@@ -46,6 +54,3 @@
 
 FILES_${PN}-valgrind = "${libdir}/valgrind/wvstreams.supp"
 RDEPENDS_${PN} += "perl"
-
-# http://errors.yoctoproject.org/Errors/Details/68614/
-PNBLACKLIST[wvstreams] ?= "BROKEN: fails to build with gcc-6"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zabbix/zabbix_2.4.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zabbix/zabbix_2.4.7.bb
deleted file mode 100644
index 8b9c4b8..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zabbix/zabbix_2.4.7.bb
+++ /dev/null
@@ -1,75 +0,0 @@
-SUMMARY = "Open-source monitoring solution for your IT infrastructure"
-DESCRIPTION = "\
-ZABBIX is software that monitors numerous parameters of a network and the \
-health and integrity of servers. ZABBIX uses a flexible notification \
-mechanism that allows users to configure e-mail based alerts for virtually \
-any event. This allows a fast reaction to server problems. ZABBIX offers \
-excellent reporting and data visualisation features based on the stored \
-data. This makes ZABBIX ideal for capacity planning. \
-\
-ZABBIX supports both polling and trapping. All ZABBIX reports and \
-statistics, as well as configuration parameters are accessed through a \
-web-based front end. A web-based front end ensures that the status of \
-your network and the health of your servers can be assessed from any \
-location. Properly configured, ZABBIX can play an important role in \
-monitoring IT infrastructure. This is equally true for small \
-organisations with a few servers and for large companies with a \
-multitude of servers."
-HOMEPAGE = "http://www.zabbix.com/"
-SECTION = "Applications/Internet"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=300e938ad303147fede2294ed78fe02e"
-DEPENDS  = "openldap virtual/libiconv"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-SRC_URI = "http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/${PV}/${BPN}-${PV}.tar.gz \
-    file://0001-Fix-configure.ac.patch \
-    file://zabbix-agent.service \
-"
-
-SRC_URI[md5sum] = "9f8aeb11d8415585f41c3f2f22566b78"
-SRC_URI[sha256sum] = "d2c47b8f5b9b91f18010d54c45de55845d979014a8b3fe4bef64e0b08f8b00da"
-
-inherit autotools-brokensep linux-kernel-base pkgconfig systemd useradd
-
-SYSTEMD_PACKAGES = "${PN}"
-SYSTEMD_SERVICE_${PN} = "zabbix-agent.service"
-SYSTEMD_AUTO_ENABLE = "enable"
-
-USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "-r zabbix"
-USERADD_PARAM_${PN} = "-r -g zabbix -d /var/lib/zabbix \
-    -s /sbin/nologin -c \"Zabbix Monitoring System\" zabbix \
-"
-
-KERNEL_VERSION = "${@get_kernelversion_headers('${STAGING_KERNEL_DIR}')}"
-
-EXTRA_OECONF = " \
-    --enable-dependency-tracking \
-    --enable-agent \
-    --enable-ipv6 \
-    --with-net-snmp \
-    --with-ldap=${STAGING_EXECPREFIXDIR} \
-    --with-jabber \
-    --with-unixodbc \
-    --with-ssh2 \
-    --with-sqlite3 \
-"
-CFLAGS_append = " -lldap -llber"
-
-do_configure_prepend() {
-    export KERNEL_VERSION="${KERNEL_VERSION}"
-}
-
-do_install_append() {
-    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-        install -d ${D}${systemd_unitdir}/system
-        install -m 0644 ${WORKDIR}/zabbix-agent.service ${D}${systemd_unitdir}/system/
-        sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/zabbix-agent.service
-    fi
-}
-
-FILES_${PN} += "${libdir}"
-
-RDEPENDS_${PN} = "logrotate"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zabbix/zabbix_3.0.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zabbix/zabbix_3.0.8.bb
new file mode 100644
index 0000000..7e7d6de
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zabbix/zabbix_3.0.8.bb
@@ -0,0 +1,75 @@
+SUMMARY = "Open-source monitoring solution for your IT infrastructure"
+DESCRIPTION = "\
+ZABBIX is software that monitors numerous parameters of a network and the \
+health and integrity of servers. ZABBIX uses a flexible notification \
+mechanism that allows users to configure e-mail based alerts for virtually \
+any event. This allows a fast reaction to server problems. ZABBIX offers \
+excellent reporting and data visualisation features based on the stored \
+data. This makes ZABBIX ideal for capacity planning. \
+\
+ZABBIX supports both polling and trapping. All ZABBIX reports and \
+statistics, as well as configuration parameters are accessed through a \
+web-based front end. A web-based front end ensures that the status of \
+your network and the health of your servers can be assessed from any \
+location. Properly configured, ZABBIX can play an important role in \
+monitoring IT infrastructure. This is equally true for small \
+organisations with a few servers and for large companies with a \
+multitude of servers."
+HOMEPAGE = "http://www.zabbix.com/"
+SECTION = "Applications/Internet"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=300e938ad303147fede2294ed78fe02e"
+DEPENDS  = "openldap virtual/libiconv"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+SRC_URI = "http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/${PV}/${BPN}-${PV}.tar.gz \
+    file://0001-Fix-configure.ac.patch \
+    file://zabbix-agent.service \
+"
+
+SRC_URI[md5sum] = "f7f41850397d2078ccae4b7389f9a005"
+SRC_URI[sha256sum] = "1df3e106427ed21547b8119049a161092f597d04507f9eb535951a9ee887a476"
+
+inherit autotools-brokensep linux-kernel-base pkgconfig systemd useradd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "zabbix-agent.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "-r zabbix"
+USERADD_PARAM_${PN} = "-r -g zabbix -d /var/lib/zabbix \
+    -s /sbin/nologin -c \"Zabbix Monitoring System\" zabbix \
+"
+
+KERNEL_VERSION = "${@get_kernelversion_headers('${STAGING_KERNEL_DIR}')}"
+
+EXTRA_OECONF = " \
+    --enable-dependency-tracking \
+    --enable-agent \
+    --enable-ipv6 \
+    --with-net-snmp \
+    --with-ldap=${STAGING_EXECPREFIXDIR} \
+    --with-jabber \
+    --with-unixodbc \
+    --with-ssh2 \
+    --with-sqlite3 \
+"
+CFLAGS_append = " -lldap -llber"
+
+do_configure_prepend() {
+    export KERNEL_VERSION="${KERNEL_VERSION}"
+}
+
+do_install_append() {
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        install -d ${D}${systemd_unitdir}/system
+        install -m 0644 ${WORKDIR}/zabbix-agent.service ${D}${systemd_unitdir}/system/
+        sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/zabbix-agent.service
+    fi
+}
+
+FILES_${PN} += "${libdir}"
+
+RDEPENDS_${PN} = "logrotate"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeroc-ice/zeroc-ice_3.5.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeroc-ice/zeroc-ice_3.5.1.bb
index 2b6f56e..7c833b0 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeroc-ice/zeroc-ice_3.5.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeroc-ice/zeroc-ice_3.5.1.bb
@@ -18,7 +18,7 @@
 #| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include/db_cxx.h:273:14: note: virtual int Db::set_bt_compare(int (*)(Db*, const Dbt*, const Dbt*, size_t*)) <near match>
 #| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include/db_cxx.h:273:14: note:   no known conversion for argument 1 from 'int (*)(DB*, const DBT*, const DBT*) {aka int (*)(__db*, const __db_dbt*, const __db_dbt*)}' to 'int (*)(Db*, const Dbt*, const Dbt*, size_t*) {aka int (*)(Db*, const Dbt*, const Dbt*, long unsigned int*)}'
 #| make[3]: *** [MapDb.o] Error 1
-PNBLACKLIST[zeroc-ice] ?= "BROKEN: not compatible with default db version"
+PNBLACKLIST[zeroc-ice] ?= "BROKEN: not compatible with default db version - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 S = "${WORKDIR}/Ice-${PV}"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeromq/cppzmq_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeromq/cppzmq_git.bb
index f41cd0a..a64745c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeromq/cppzmq_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeromq/cppzmq_git.bb
@@ -3,7 +3,9 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=db174eaf7b55a34a7c89551197f66e94"
 DEPENDS = "zeromq"
+
 SRCREV = "68a7b09cfce01c4c279fba2cf91686fcfc566848"
+PV = "4.1.5+git${SRCPV}"
 
 SRC_URI = "git://github.com/zeromq/cppzmq.git"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeromq/zeromq_4.1.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeromq/zeromq_4.1.5.bb
deleted file mode 100644
index 8da8674..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeromq/zeromq_4.1.5.bb
+++ /dev/null
@@ -1,32 +0,0 @@
-DESCRIPTION = "ZeroMQ looks like an embeddable networking library but acts like a concurrency framework"
-HOMEPAGE = "http://www.zeromq.org"
-LICENSE = "LGPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=d5311495d952062e0e4fbba39cbf3de1"
-
-PACKAGECONFIG ??= "libsodium"
-PACKAGECONFIG[libsodium] = "--with-libsodium, --without-libsodium, libsodium"
-
-SRC_URI = "http://github.com/zeromq/zeromq4-1/releases/download/v${PV}/zeromq-${PV}.tar.gz \
-    file://run-ptest \
-"
-SRC_URI[md5sum] = "e7adf4b7dbae09b28cfd10d26cd67fac"
-SRC_URI[sha256sum] = "04aac57f081ffa3a2ee5ed04887be9e205df3a7ddade0027460b8042432bdbcf"
-
-S = "${WORKDIR}/zeromq-${PV}"
-
-#Uncomment to choose polling system manually. valid values are kqueue, epoll, devpoll, poll or select
-#EXTRA_OECONF += "--with-poller=kqueue"
-#CFLAGS_append = " -O0"
-#CXXFLAGS_append = " -O0"
-
-inherit autotools ptest pkgconfig
-
-do_compile_ptest () {
-    echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${B}/Makefile
-    oe_runmake buildtest-TESTS
-}
-
-do_install_ptest () {
-    install -d ${D}${PTEST_PATH}/tests
-    install -m 0755 ${B}/.libs/test_* ${D}${PTEST_PATH}/tests
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeromq/zeromq_4.1.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeromq/zeromq_4.1.6.bb
new file mode 100644
index 0000000..e126f32
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-connectivity/zeromq/zeromq_4.1.6.bb
@@ -0,0 +1,32 @@
+DESCRIPTION = "ZeroMQ looks like an embeddable networking library but acts like a concurrency framework"
+HOMEPAGE = "http://www.zeromq.org"
+LICENSE = "LGPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=d5311495d952062e0e4fbba39cbf3de1"
+
+PACKAGECONFIG ??= "libsodium"
+PACKAGECONFIG[libsodium] = "--with-libsodium, --without-libsodium, libsodium"
+
+SRC_URI = "http://github.com/zeromq/zeromq4-1/releases/download/v${PV}/zeromq-${PV}.tar.gz \
+    file://run-ptest \
+"
+SRC_URI[md5sum] = "c89db4dbc0b90c34c9f4983cbff6d321"
+SRC_URI[sha256sum] = "02ebf60a43011e770799336365bcbce2eb85569e9b5f52aa0d8cc04672438a0a"
+
+S = "${WORKDIR}/zeromq-${PV}"
+
+#Uncomment to choose polling system manually. valid values are kqueue, epoll, devpoll, poll or select
+#EXTRA_OECONF += "--with-poller=kqueue"
+#CFLAGS_append = " -O0"
+#CXXFLAGS_append = " -O0"
+
+inherit autotools ptest pkgconfig
+
+do_compile_ptest () {
+    echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${B}/Makefile
+    oe_runmake buildtest-TESTS
+}
+
+do_install_ptest () {
+    install -d ${D}${PTEST_PATH}/tests
+    install -m 0755 ${B}/.libs/test_* ${D}${PTEST_PATH}/tests
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb
index 205e1d1..a953ebc 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb
@@ -20,3 +20,5 @@
     install -m 0755 dbus-daemon-proxy ${D}${bindir}
 }
 
+
+PNBLACKLIST[dbus-daemon-proxy] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130613/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0001-pipe.c-Use-a-string-instead-of-char.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0001-pipe.c-Use-a-string-instead-of-char.patch
new file mode 100644
index 0000000..6883f9a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0001-pipe.c-Use-a-string-instead-of-char.patch
@@ -0,0 +1,27 @@
+From 6bcb58bd69c38b9200e8ec6c382247167571189d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 1 Jul 2017 16:44:15 -0700
+Subject: [PATCH] pipe.c: Use a string instead of char
+
+Fixes
+error: invalid conversion from 'char' to 'const void*' [-fpermissive]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/pipe.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/pipe.cpp b/src/pipe.cpp
+index 45c2ba6..1303c2d 100644
+--- a/src/pipe.cpp
++++ b/src/pipe.cpp
+@@ -83,5 +83,5 @@ ssize_t Pipe::read(void *buffer, unsigned int &nbytes)
+ void Pipe::signal()
+ {
+   // TODO: ignoring return of read/write generates warning; maybe relevant for eventloop work...
+-  ::write(_fd_write, '\0', 1);
++  ::write(_fd_write, "", 1);
+ }
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0001-src-eventloop.cpp-use-portable-method-for-initializi.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0001-src-eventloop.cpp-use-portable-method-for-initializi.patch
new file mode 100644
index 0000000..eed84e4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0001-src-eventloop.cpp-use-portable-method-for-initializi.patch
@@ -0,0 +1,36 @@
+From 93fd4868d71aa7a26cdfd382d1e4c85112f069f9 Mon Sep 17 00:00:00 2001
+From: Peter Williams <peter@newton.cx>
+Date: Sat, 19 Dec 2015 21:07:37 -0500
+Subject: [PATCH] src/eventloop.cpp: use portable method for initializing
+ recursive mutex
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+---
+Upstream-Status: Backport [https://github.com/andreas-volz/dbus-cplusplus/commit/cdaeaa825db191bd65aad3aaaeb3178738727f05]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/eventloop.cpp | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/src/eventloop.cpp b/src/eventloop.cpp
+index 7fb06a3..f622812 100644
+--- a/src/eventloop.cpp
++++ b/src/eventloop.cpp
+@@ -85,8 +85,11 @@ DefaultMutex::DefaultMutex(bool recursive)
+ {
+   if (recursive)
+   {
+-    pthread_mutex_t recmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+-    _mutex = recmutex;
++    pthread_mutexattr_t attr;
++
++    pthread_mutexattr_init(&attr);
++    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
++    pthread_mutex_init(&_mutex, &attr);
+   }
+   else
+   {
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0002-tools-generate_proxy.cpp-avoid-possibly-undefined-ui.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0002-tools-generate_proxy.cpp-avoid-possibly-undefined-ui.patch
new file mode 100644
index 0000000..65cd939
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0002-tools-generate_proxy.cpp-avoid-possibly-undefined-ui.patch
@@ -0,0 +1,58 @@
+From c673a76857cbe0ca82fa11aea9b70f94c3e5b041 Mon Sep 17 00:00:00 2001
+From: Peter Williams <peter@newton.cx>
+Date: Sat, 19 Dec 2015 21:08:46 -0500
+Subject: [PATCH] tools/generate_proxy.cpp: avoid possibly undefined 'uint'
+ type
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+---
+Upstream-Status: Backport [https://github.com/andreas-volz/dbus-cplusplus/commit/43f119a2b3fe951c0f1d88cc61170d4c81a88880]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ tools/generate_proxy.cpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tools/generate_proxy.cpp b/tools/generate_proxy.cpp
+index bf1094a..ebb75fa 100644
+--- a/tools/generate_proxy.cpp
++++ b/tools/generate_proxy.cpp
+@@ -352,7 +352,7 @@ void generate_proxy(Xml::Document &doc, const char *filename)
+         if (!arg_name.length())
+         {
+           arg_name = "argin";
+-          arg_name += toString <uint> (i);
++          arg_name += toString <unsigned int> (i);
+         }
+ 
+         // generate extra code to wrap object
+@@ -445,7 +445,7 @@ void generate_proxy(Xml::Document &doc, const char *filename)
+ 
+           if (!arg_name.length())
+           {
+-            arg_name = "argout" + toString <uint> (i);
++            arg_name = "argout" + toString <unsigned int> (i);
+           }
+ 
+           if (arg_object.length())
+@@ -569,7 +569,7 @@ void generate_proxy(Xml::Document &doc, const char *filename)
+         // use a default if no arg name given
+         if (!arg_name.length())
+         {
+-          arg_name = "arg" + toString <uint> (i);
++          arg_name = "arg" + toString <unsigned int> (i);
+         }
+ 
+         body << arg_name << ";" << endl;
+@@ -605,7 +605,7 @@ void generate_proxy(Xml::Document &doc, const char *filename)
+ 
+         if (!arg_name.length())
+         {
+-          arg_name = "arg" + toString <uint> (j);
++          arg_name = "arg" + toString <unsigned int> (j);
+         }
+ 
+         if (arg_object.length())
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0003-Fixed-undefined-ssize_t-for-clang-3.8.0-on-FreeBSD.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0003-Fixed-undefined-ssize_t-for-clang-3.8.0-on-FreeBSD.patch
new file mode 100644
index 0000000..f69cefd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0003-Fixed-undefined-ssize_t-for-clang-3.8.0-on-FreeBSD.patch
@@ -0,0 +1,30 @@
+From 465d98dbcdcb72375c198010a50b80b953e7d5a6 Mon Sep 17 00:00:00 2001
+From: Yuri <yuri@tsoft.com>
+Date: Sat, 28 May 2016 13:20:10 -0700
+Subject: [PATCH] Fixed undefined ssize_t for clang-3.8.0 on FreeBSD.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+---
+Upstream-Status: Backport [https://github.com/andreas-volz/dbus-cplusplus/commit/463f5a4400d494b831c3b3348c0a21f0faf14f39]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ include/dbus-c++/pipe.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/dbus-c++/pipe.h b/include/dbus-c++/pipe.h
+index 999f042..682646c 100644
+--- a/include/dbus-c++/pipe.h
++++ b/include/dbus-c++/pipe.h
+@@ -30,6 +30,8 @@
+ /* STD */
+ #include <cstdlib>
+ 
++#include <sys/types.h>
++
+ namespace DBus
+ {
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0004-use-POSIX-poll.h-instead-of-sys-poll.h.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0004-use-POSIX-poll.h-instead-of-sys-poll.h.patch
new file mode 100644
index 0000000..0c2c487
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/0004-use-POSIX-poll.h-instead-of-sys-poll.h.patch
@@ -0,0 +1,77 @@
+From 12de53b0f24c478ea4ff6b4e2c55366dbd2f02b1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
+Date: Fri, 25 Nov 2016 09:33:20 +0000
+Subject: [PATCH] use POSIX poll.h instead of sys/poll.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+POSIX specifies that <poll.h> is the correct header to
+include for poll()
+  http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html
+whereas <sys/poll.h> is only needed for ancient glibc (<2.3),
+so let's follow POSIX instead.
+
+As a side-effect, this silences compilation warnings when
+compiling against the musl C-library such as:
+
+| In file included from ../../libdbus-c++-0.9.0/src/eventloop.cpp:31:0:
+| <sysroot>/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
+|  #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+|   ^~~~~~~
+| In file included from ../../libdbus-c++-0.9.0/src/eventloop-integration.cpp:39:0:
+| <sysroot>/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
+|  #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+|   ^~~~~~~
+
+Signed-off-by: André Draszik <git@andred.net>
+---
+Upstream-Status: Submitted [https://github.com/andreas-volz/dbus-cplusplus/pull/3]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/eventloop-integration.cpp | 2 +-
+ src/eventloop.cpp             | 2 +-
+ src/pipe.cpp                  | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/eventloop-integration.cpp b/src/eventloop-integration.cpp
+index 5776971..271b503 100644
+--- a/src/eventloop-integration.cpp
++++ b/src/eventloop-integration.cpp
+@@ -36,7 +36,7 @@
+ /* STD */
+ #include <string.h>
+ #include <cassert>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+ 
+diff --git a/src/eventloop.cpp b/src/eventloop.cpp
+index f622812..7790e1e 100644
+--- a/src/eventloop.cpp
++++ b/src/eventloop.cpp
+@@ -28,7 +28,7 @@
+ #include <dbus-c++/eventloop.h>
+ #include <dbus-c++/debug.h>
+ 
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/time.h>
+ 
+ #include <dbus/dbus.h>
+diff --git a/src/pipe.cpp b/src/pipe.cpp
+index 01211b3..45c2ba6 100644
+--- a/src/pipe.cpp
++++ b/src/pipe.cpp
+@@ -32,7 +32,7 @@
+ 
+ /* STD */
+ #include <unistd.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <cassert>
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/fix-missing-unistd.h-include.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/fix-missing-unistd.h-include.patch
new file mode 100644
index 0000000..903a720
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/fix-missing-unistd.h-include.patch
@@ -0,0 +1,40 @@
+
+sniped from ChromiumOS
+
+https://bugs.gentoo.org/424707
+
+From 154f7861d19a2bd5c79c488f9989610971db451b Mon Sep 17 00:00:00 2001
+From: Han Shen <shenhan@google.com>
+Date: Thu, 31 May 2012 16:49:35 -0700
+Subject: [PATCH] Fixed dbus-c++ gcc 4.7 building problem.
+
+Just add "unistd.h" inclusion to eventloop-integration.h.
+
+BUG=None
+TEST=Manually built using gcc 4.7.
+
+Change-Id: I87bd1f90db6a4c974a5ed8134044e8be2034aff2
+Reviewed-on: https://gerrit.chromium.org/gerrit/24260
+Tested-by: Han Shen <shenhan@google.com>
+Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
+Commit-Ready: Han Shen <shenhan@chromium.org>
+Upstream-Status: Inappropriate [ not author, no upstream ]
+Signed-off-by: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
+---
+ include/dbus-c++/eventloop-integration.h |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/dbus-c++/eventloop-integration.h b/include/dbus-c++/eventloop-integration.h
+index 5108340..1b56ab5 100644
+--- a/include/dbus-c++/eventloop-integration.h
++++ b/include/dbus-c++/eventloop-integration.h
+@@ -27,6 +27,7 @@
+ 
+ #include <cstring>
+ #include <errno.h>
++#include <unistd.h>
+ #include "api.h"
+ #include "dispatcher.h"
+ #include "util.h"
+-- 
+1.7.9.7
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/remove-CXX_FOR_BUILD-stuff.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/remove-CXX_FOR_BUILD-stuff.patch
new file mode 100644
index 0000000..fa29d3c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++-0.9.0/remove-CXX_FOR_BUILD-stuff.patch
@@ -0,0 +1,33 @@
+From: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
+Date: Fri, 18 Nov 2016 10:23:07 +0100
+Subject: Build libdbus-c++ tools for target platform rather than enforced for
+host platform.
+
+Upstream-Status: Inappropriate [no upstream]
+Signed-off-by: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
+---
+
+diff -Naur libdbus-c++-0.9.0.ori/configure.ac libdbus-c++-0.9.0/configure.ac
+--- libdbus-c++-0.9.0.ori/configure.ac	2016-11-15 14:25:36.085882774 +0100
++++ libdbus-c++-0.9.0/configure.ac	2016-11-15 14:27:08.814568717 +0100
+@@ -64,9 +64,6 @@
+ AC_PROG_CC
+ AC_PROG_CXX
+ 
+-CXX_FOR_BUILD=${CXX_FOR_BUILD-${CXX}}
+-AC_SUBST(CXX_FOR_BUILD)
+-
+ AM_PROG_LIBTOOL
+ 
+ PKG_PROG_PKG_CONFIG
+diff -Naur libdbus-c++-0.9.0.ori/tools/Makefile.am libdbus-c++-0.9.0/tools/Makefile.am
+--- libdbus-c++-0.9.0.ori/tools/Makefile.am	2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/tools/Makefile.am	2016-11-15 14:26:19.454203583 +0100
+@@ -1,7 +1,5 @@
+ # hacky, but ...
+ 
+-CXX = $(CXX_FOR_BUILD)
+-
+ AM_CPPFLAGS = \
+ 	$(dbus_CFLAGS) \
+ 	$(xml_CFLAGS) \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++_0.9.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++_0.9.0.bb
new file mode 100644
index 0000000..a6d8b86
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/dbus/libdbus-c++_0.9.0.bb
@@ -0,0 +1,30 @@
+SUMMARY = "DBus-C++ Library"
+DESCRIPTION = "DBus-c++ attempts to provide a C++ API for D-BUS. The library has a glib and an Ecore mainloop integration. It also offers an optional own main loop."
+HOMEPAGE = "http://dbus-cplusplus.sourceforge.net"
+SECTION = "base"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+DEPENDS = "dbus expat glib-2.0 libpcre"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/dbus-cplusplus/dbus-c++/${PV}/${BP}.tar.gz \
+           file://fix-missing-unistd.h-include.patch \
+           file://remove-CXX_FOR_BUILD-stuff.patch \
+           file://0001-src-eventloop.cpp-use-portable-method-for-initializi.patch \
+           file://0002-tools-generate_proxy.cpp-avoid-possibly-undefined-ui.patch \
+           file://0003-Fixed-undefined-ssize_t-for-clang-3.8.0-on-FreeBSD.patch \
+           file://0004-use-POSIX-poll.h-instead-of-sys-poll.h.patch \
+           file://0001-pipe.c-Use-a-string-instead-of-char.patch \
+           "
+SRC_URI[md5sum] = "e752116f523fa88ef041e63d3dee4de2"
+SRC_URI[sha256sum] = "bc11ac297b3cb010be904c72789695543ee3fdf3d75cdc8225fd371385af4e61"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-ecore --disable-examples --disable-tests"
+LDFLAGS += "-pthread"
+
+PACKAGE_BEFORE_PN = "${PN}-tools"
+
+FILES_${PN}-tools = "${bindir}"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/fakeroot/fakeroot-native_1.18.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/fakeroot/fakeroot-native_1.18.4.bb
index a27a60b..9d50ea4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/fakeroot/fakeroot-native_1.18.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/fakeroot/fakeroot-native_1.18.4.bb
@@ -8,7 +8,7 @@
 
 # Compatability for the rare systems not using or having SYSV
 python () {
-    if d.getVar('HOST_NONSYSV', True) and d.getVar('HOST_NONSYSV', True) != '0':
+    if d.getVar('HOST_NONSYSV') and d.getVar('HOST_NONSYSV') != '0':
         d.setVar('EXTRA_OECONF', ' --with-ipc=tcp --program-prefix= ')
 }
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/fakeroot/fakeroot_1.18.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/fakeroot/fakeroot_1.18.4.bb
index 37b3c18..0a787e3 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/fakeroot/fakeroot_1.18.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/fakeroot/fakeroot_1.18.4.bb
@@ -27,4 +27,4 @@
 SRC_URI[sha256sum] = "0a359efa3e9496c33234b3e9c89306a09bb4da9d33de43c261f1d8447e6ebea2"
 
 # http://errors.yoctoproject.org/Errors/Details/35143/
-PNBLACKLIST[fakeroot] ?= "BROKEN: QA Issue: -dev package contains non-symlink .so"
+PNBLACKLIST[fakeroot] ?= "BROKEN: QA Issue: -dev package contains non-symlink .so - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/glib-2.0/glibmm_2.44.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/glib-2.0/glibmm_2.44.0.bb
deleted file mode 100644
index d9cffff..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/glib-2.0/glibmm_2.44.0.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-SUMMARY = "C++ bindings for the glib library"
-HOMEPAGE = "http://www.gtkmm.org/"
-SECTION = "libs"
-LICENSE = "LGPLv2.1 & GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
-                    file://COPYING.tools;md5=751419260aa954499f7abaabaa882bbe"
-
-DEPENDS = "mm-common glib-2.0 libsigc++-2.0"
-inherit autotools pkgconfig
-
-SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
-
-SRC_URI = " \
-    ftp://ftp.gnome.org/pub/GNOME/sources/glibmm/${SHRT_VER}/glibmm-${PV}.tar.xz \
-    file://remove-examples.patch \
-"
-SRC_URI[md5sum] = "32ee4150b436d097fe2506d0b0b13a75"
-SRC_URI[sha256sum] = "1b0ac0425d24895507c0e0e8088a464c7ae2d289c47afa1c11f63278fc672ea8"
-
-do_install_append() {
-    install -d ${D}${datadir}/glibmm-2.4
-    install -d ${D}${datadir}/aclocal
-
-    install -m 0644 glib/glibmmconfig.h ${D}${datadir}/glibmm-2.4/
-    install -m 0644 scripts/glibmm_check_perl.m4 ${D}${datadir}/aclocal/ || true
-}
-
-FILES_${PN} = "${libdir}/lib*.so.*"
-FILES_${PN}-dev += "${datadir}/glibmm-* ${libdir}/glibmm-2.4/include/ ${libdir}/glibmm-2.4/proc/ ${libdir}/giomm-2.4/include/"
-
-RDEPENDS_${PN}-dev = "perl"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/glib-2.0/glibmm_2.50.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/glib-2.0/glibmm_2.50.1.bb
new file mode 100644
index 0000000..401b3b2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/glib-2.0/glibmm_2.50.1.bb
@@ -0,0 +1,32 @@
+SUMMARY = "C++ bindings for the glib library"
+HOMEPAGE = "http://www.gtkmm.org/"
+SECTION = "libs"
+LICENSE = "LGPLv2.1 & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
+                    file://COPYING.tools;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "mm-common glib-2.0 libsigc++-2.0 glib-2.0-native"
+inherit autotools pkgconfig
+
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
+
+SRC_URI = " \
+    ftp://ftp.gnome.org/pub/GNOME/sources/glibmm/${SHRT_VER}/glibmm-${PV}.tar.xz \
+    file://remove-examples.patch \
+"
+SRC_URI[md5sum] = "a5b915dc42fc62983fa78ca8486f4391"
+SRC_URI[sha256sum] = "1fd85051da9cb402cc8348cec72dfe4d79f9345df4a1dbf68703a4ded45846a4"
+
+do_install_append() {
+    install -d ${D}${datadir}/glibmm-2.4
+    install -d ${D}${datadir}/aclocal
+
+    install -m 0644 glib/glibmmconfig.h ${D}${datadir}/glibmm-2.4/
+    install -m 0644 scripts/glibmm_check_perl.m4 ${D}${datadir}/aclocal/ || true
+}
+
+FILES_${PN} = "${libdir}/lib*.so.*"
+FILES_${PN}-dev += "${datadir}/glibmm-* ${libdir}/glibmm-2.4/include/ ${libdir}/glibmm-2.4/proc/ ${libdir}/giomm-2.4/include/"
+
+RDEPENDS_${PN}-dev = "perl"
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/libsigc++-2.0/libsigc++-2.0_2.10.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/libsigc++-2.0/libsigc++-2.0_2.10.0.bb
new file mode 100644
index 0000000..53bd5de
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/libsigc++-2.0/libsigc++-2.0_2.10.0.bb
@@ -0,0 +1,22 @@
+SUMMARY = "A library for loose coupling of C++ method calls"
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
+
+DEPENDS = "mm-common"
+
+SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.10/libsigc++-${PV}.tar.xz"
+SRC_URI[md5sum] = "70bcbde2c900e4925d6ef4bf50954195"
+SRC_URI[sha256sum] = "f843d6346260bfcb4426259e314512b99e296e8ca241d771d21ac64f28298d81"
+
+S = "${WORKDIR}/libsigc++-${PV}"
+
+inherit autotools
+
+EXTRA_AUTORECONF = "--exclude=autoheader"
+
+FILES_${PN}-dev += "${libdir}/sigc++-*/"
+FILES_${PN}-doc += "${datadir}/devhelp"
+
+BBCLASSEXTEND = "native"
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/libsigc++-2.0/libsigc++-2.0_2.2.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/libsigc++-2.0/libsigc++-2.0_2.2.11.bb
deleted file mode 100644
index 546305f..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/libsigc++-2.0/libsigc++-2.0_2.2.11.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "A library for loose coupling of C++ method calls"
-SECTION = "libs"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
-
-DEPENDS = "mm-common"
-
-SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-${PV}.tar.xz"
-SRC_URI[md5sum] = "815d0c6d61601f51bbcaeef6826606b0"
-SRC_URI[sha256sum] = "9834045f74f56752c2c6b3cdc195c30ab8314ad22dc8e626d6f67f940f1e4957"
-
-S = "${WORKDIR}/libsigc++-${PV}"
-
-inherit autotools
-
-EXTRA_AUTORECONF = "--exclude=autoheader"
-
-FILES_${PN}-dev += "${libdir}/sigc++-*/"
-FILES_${PN}-doc += "${datadir}/devhelp"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/libxml/libxml++/libxml++_ptest.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/libxml/libxml++/libxml++_ptest.patch
index 82960f1..0d1a518 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/libxml/libxml++/libxml++_ptest.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/libxml/libxml++/libxml++_ptest.patch
@@ -1,21 +1,21 @@
-diff --git a/Makefile.am b/Makefile.am
-index d4aadb1..0e36756 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -253,5 +253,8 @@ post-html: docs/index.html
- 	rsync $(rsync_args) -r docs/index.html $$USER,libxmlplusplus@web.sourceforge.net:$(web_path_project)
- 	rsync $(rsync_args) -r examples $$USER,libxmlplusplus@web.sourceforge.net:$(web_path_project)
+Index: libxml++-2.40.1/Makefile.am
+===================================================================
+--- libxml++-2.40.1.orig/Makefile.am
++++ libxml++-2.40.1/Makefile.am
+@@ -24,5 +24,8 @@ dist_noinst_SCRIPTS = autogen.sh
+ 
+ DISTCLEANFILES = MSVC_Net2010/libxml++/libxml++config.h
  
 +install-ptest:
 +	make -C examples install-ptest
 +
  # Optional: auto-generate the ChangeLog file from the git log on make dist
- include $(top_srcdir)/macros/dist-changelog.am
-diff --git a/examples/Makefile.am b/examples/Makefile.am
-index d9541ca..c27e088 100644
---- a/examples/Makefile.am
-+++ b/examples/Makefile.am
-@@ -19,6 +19,8 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I. $(LIBXMLXX_CFLAGS)
+ include $(top_srcdir)/build/dist-changelog.am
+Index: libxml++-2.40.1/examples/Makefile.am
+===================================================================
+--- libxml++-2.40.1.orig/examples/Makefile.am
++++ libxml++-2.40.1/examples/Makefile.am
+@@ -19,6 +19,8 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_
  AM_CXXFLAGS = $(LIBXMLXX_WXXFLAGS)
  LDADD = $(top_builddir)/libxml++/libxml++-$(LIBXMLXX_API_VERSION).la $(LIBXMLXX_LIBS)
  
@@ -24,7 +24,7 @@
  check_PROGRAMS = \
    dom_build/dom_build \
    dom_parse_entities/dom_parse_entities \
-@@ -36,6 +38,23 @@ check_PROGRAMS = \
+@@ -37,6 +39,23 @@ check_PROGRAMS = \
    schemavalidation/schemavalidation \
    textreader/textreader
  
@@ -48,7 +48,7 @@
  # Shell scripts that call the example programs.
  check_SCRIPTS = \
    dom_build/make_check.sh \
-@@ -147,10 +166,10 @@ dist_noinst_DATA = \
+@@ -154,10 +173,10 @@ dist_noinst_DATA = \
  # file are located in different directories.
  dom_read_write/make_check.sh: Makefile
  	echo '# Generated and used by "make check"' >$@
@@ -61,7 +61,7 @@
  standard_scripts = $(filter-out dom_read_write/make_check.sh,$(check_SCRIPTS))
  
  # All other script files are generated like so:
-@@ -162,3 +181,18 @@ $(standard_scripts): Makefile
+@@ -169,3 +188,18 @@ $(standard_scripts): Makefile
  CLEANFILES = \
    dom_read_write/example_output.xml \
    $(check_SCRIPTS)
@@ -77,6 +77,6 @@
 +	cd $(srcdir) && cp --parents $(dist_noinst_DATA) $(DESTDIR)/examples
 +	cp Makefile $(DESTDIR)/examples
 +	$(MKDIR_P) $(DESTDIR)/macros
-+	cp $(srcdir)/../macros/test-driver $(DESTDIR)/macros
++	cp $(top_srcdir)/build/test-driver $(DESTDIR)/macros
 +	sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/examples/Makefile
 +
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/libxml/libxml++_2.38.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/libxml/libxml++_2.38.1.bb
deleted file mode 100644
index 70965f3..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/libxml/libxml++_2.38.1.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-SUMMARY = "C++ wrapper for libxml library"
-DESCRIPTION = "C++ wrapper for libxml library"
-HOMEPAGE = "http://libxmlplusplus.sourceforge.net"
-BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml%2B%2B"
-SECTION = "libs"
-LICENSE = "LGPL-2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 "
-
-SHRT_VER = "${@d.getVar('PV',True).split('.')[0]}.${@d.getVar('PV',True).split('.')[1]}"
-SRC_URI = "${GNOME_MIRROR}/${BPN}/${SHRT_VER}/${BP}.tar.xz \
-    file://libxml++_ptest.patch \
-    file://run-ptest \
-"
-SRC_URI[md5sum] = "6b16aac575725a9bc0e9d96489e9251f"
-SRC_URI[sha256sum] = "882529189b03db6c69925b3f579ab1941feb4f02b5fe2612504ee7e498a4a05f"
-
-DEPENDS = "libxml2 glibmm"
-
-inherit autotools pkgconfig ptest
-
-do_compile_ptest() {
-  oe_runmake -C examples buildtest
-}
-
-FILES_${PN}-doc += "${datadir}/devhelp"
-FILES_${PN}-dev += "${libdir}/libxml++-2.6/include/libxml++config.h"
-
-RDEPENDS_${PN}-ptest += "make"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/libxml/libxml++_2.40.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/libxml/libxml++_2.40.1.bb
new file mode 100644
index 0000000..c001c18
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/libxml/libxml++_2.40.1.bb
@@ -0,0 +1,28 @@
+SUMMARY = "C++ wrapper for libxml library"
+DESCRIPTION = "C++ wrapper for libxml library"
+HOMEPAGE = "http://libxmlplusplus.sourceforge.net"
+BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml%2B%2B"
+SECTION = "libs"
+LICENSE = "LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 "
+
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${SHRT_VER}/${BP}.tar.xz \
+    file://libxml++_ptest.patch \
+    file://run-ptest \
+"
+SRC_URI[md5sum] = "377a87bea899f2b4ff62df2418c3d8a6"
+SRC_URI[sha256sum] = "4ad4abdd3258874f61c2e2a41d08e9930677976d303653cd1670d3e9f35463e9"
+
+DEPENDS = "libxml2 glibmm"
+
+inherit autotools pkgconfig ptest
+
+do_compile_ptest() {
+  oe_runmake -C examples buildtest
+}
+
+FILES_${PN}-doc += "${datadir}/devhelp"
+FILES_${PN}-dev += "${libdir}/libxml++-2.6/include/libxml++config.h"
+
+RDEPENDS_${PN}-ptest += "make"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/llvm/llvm.inc b/import-layers/meta-openembedded/meta-oe/recipes-core/llvm/llvm.inc
index fa971f3..f27261f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/llvm/llvm.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/llvm/llvm.inc
@@ -153,7 +153,7 @@
     split_packages = do_split_packages(d, libdir, '^lib(.*)\.so$', 'libllvm${LLVM_RELEASE}-%s', 'Split package for %s', allow_dirs=True, allow_links=True, recursive=True)
     split_staticdev_packages = do_split_packages(d, libllvm_libdir, '^lib(.*)\.a$', 'libllvm${LLVM_RELEASE}-%s-staticdev', 'Split staticdev package for %s', allow_dirs=True)
     if split_packages:
-        pn = d.getVar('PN', True)
+        pn = d.getVar('PN')
         d.appendVar('RDEPENDS_' + pn, ' '+' '.join(split_packages))
         d.appendVar('RDEPENDS_' + pn + '-dbg', ' '+' '.join(split_dbg_packages))
         d.appendVar('RDEPENDS_' + pn + '-staticdev', ' '+' '.join(split_staticdev_packages))
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/meta/distro-feed-configs.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/meta/distro-feed-configs.bb
index ea5ca38..2a8de54 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/meta/distro-feed-configs.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/meta/distro-feed-configs.bb
@@ -22,8 +22,8 @@
 
 #def distro_feed_configs(d):
 #    import bb
-#    parchs = d.getVar( "PACKAGE_EXTRA_ARCHS", 1 ).split()
-#    march = d.getVar( "MACHINE_ARCH", 1 ).split()
+#    parchs = d.getVar("PACKAGE_EXTRA_ARCHS").split()
+#    march = d.getVar("MACHINE_ARCH").split()
 #    archs = [ "all" ] + parchs + march
 #    confs = [ ( "${sysconfdir}/opkg/%s-feed.conf" % feed ) for feed in archs ]
 #    return " ".join( confs )
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/mm-common/mm-common_0.9.10.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/mm-common/mm-common_0.9.10.bb
new file mode 100644
index 0000000..899eb8a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/mm-common/mm-common_0.9.10.bb
@@ -0,0 +1,12 @@
+inherit gnomebase
+
+GNOME_COMPRESS_TYPE="xz"
+
+SRC_URI[archive.md5sum] = "49dc47af8c89ce5b3c768306b9a0f922"
+SRC_URI[archive.sha256sum] = "16c0e2bc196b67fbc145edaecb5dbe5818386504fe5703de27002d77140fa217"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+BBCLASSEXTEND = "native"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/mm-common/mm-common_0.9.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/mm-common/mm-common_0.9.8.bb
deleted file mode 100644
index 943343b..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/mm-common/mm-common_0.9.8.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-inherit gnomebase
-
-GNOME_COMPRESS_TYPE="xz"
-
-SRC_URI[archive.md5sum] = "00fd5c6850cd5fecc2e02b04d0dd1637"
-SRC_URI[archive.sha256sum] = "c9ab5fd3872fbe245fbc35347acf4a95063111f81d54c43df3af662dad0a03d5"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-
-BBCLASSEXTEND = "native"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/packagegroups/packagegroup-cli-tools.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/packagegroups/packagegroup-cli-tools.bb
index 2a4b067..697f9bf 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/packagegroups/packagegroup-cli-tools.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/packagegroups/packagegroup-cli-tools.bb
@@ -43,3 +43,7 @@
 RRECOMMENDS_${PN}-debug = "\
     ltrace \
 "
+
+PNBLACKLIST[packagegroup-cli-tools] ?= "Runtime depends on blacklisted dbus-daemon-proxy - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[packagegroup-cli-tools] ?= "Runtime depends on blacklisted packagegroup-cli-tools - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/plymouth/plymouth_0.9.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/plymouth/plymouth_0.9.2.bb
index 1c1a02d..6163cff 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/plymouth/plymouth_0.9.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/plymouth/plymouth_0.9.2.bb
@@ -14,7 +14,7 @@
 
 DEPENDS = "libcap libpng cairo dbus udev"
 PROVIDES = "virtual/psplash"
-RPROVIDES_${PN} = "virtual/psplash virtual/psplash-support"
+RPROVIDES_${PN} = "virtual-psplash virtual-psplash-support"
 
 SRC_URI = "http://www.freedesktop.org/software/plymouth/releases/${BPN}-${PV}.tar.bz2"
 SRC_URI[md5sum] = "ff420994deb7ea203df678df92e7ab7d"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/proxy-libintl/proxy-libintl-20100902/create-as-shared-lib.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/proxy-libintl/proxy-libintl-20100902/create-as-shared-lib.patch
deleted file mode 100644
index 306e3b8..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/proxy-libintl/proxy-libintl-20100902/create-as-shared-lib.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- a/src/proxy-libintl/Makefile.org	2009-09-12 23:19:04.989421607 -0700
-+++ a/src/proxy-libintl/Makefile	2009-09-12 23:21:14.100640001 -0700
-@@ -4,20 +4,20 @@ ZIPFILE = proxy-libintl-$(TIMESTAMP).zip
- CC = gcc
- CFLAGS = -Wall -I ../../include
- 
--all : ../../lib/libintl.a ../../lib/intl.lib
-+all : ../../lib/libintl.so ../../lib/intl.lib
- 
--../../lib/libintl.a : libintl.o
--	ar rc $@ libintl.o
-+../../lib/libintl.so : libintl.o
-+	$(CC) -shared -o $@ libintl.o
- 
--../../lib/intl.lib : ../../lib/libintl.a
--	cp ../../lib/libintl.a $@
--	strip --strip-unneeded $@
-+../../lib/intl.lib : ../../lib/libintl.so
-+	cp ../../lib/libintl.so $@
-+	$(STRIP) --strip-unneeded $@
- 
- libintl.o : libintl.c
- 	$(CC) $(CFLAGS) -c libintl.c
- 
- clean :
--	rm -f *.o ../../lib/libintl.a ../../$(ZIPFILE)
-+	rm -f *.o ../../lib/libintl.so ../../$(ZIPFILE)
- 
- dist : clean all
--	cd ../..; zip $(ZIPFILE) include/libintl.h lib/{libintl.a,intl.lib} src/proxy-libintl/{README.txt,COPYING.LIB.txt,Makefile,libintl.[ch]}; manifestify $(ZIPFILE)
-+	cd ../..; zip $(ZIPFILE) include/libintl.h lib/{libintl.so,intl.lib} src/proxy-libintl/{README.txt,COPYING.LIB.txt,Makefile,libintl.[ch]}; manifestify $(ZIPFILE)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/proxy-libintl/proxy-libintl-20100902/stub-only.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/proxy-libintl/proxy-libintl-20100902/stub-only.patch
deleted file mode 100644
index 7186b13c..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/proxy-libintl/proxy-libintl-20100902/stub-only.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-Index: proxy-libintl/src/proxy-libintl/libintl.c
-===================================================================
---- proxy-libintl.orig/src/proxy-libintl/libintl.c
-+++ proxy-libintl/src/proxy-libintl/libintl.c
-@@ -18,9 +18,12 @@
-  */
- 
- #ifdef _WIN32
--#include <windows.h>
-+#  include <windows.h>
- #else
--#include <dlfcn.h>
-+#  include <stddef.h>
-+#  if !STUB_ONLY
-+#    include <dlfcn.h>
-+#  endif
- typedef void* HMODULE;
- #endif
- 
-@@ -65,11 +68,13 @@ static char * (*p_bind_textdomain_codese
- static int
- use_intl_dll (HMODULE dll)
- {
--#ifdef _WIN32
--#define LOOKUP(fn) p_##fn = (void *) GetProcAddress (dll, #fn); if (p_##fn == NULL) return 0
--#else
--#define LOOKUP(fn) p_##fn = (void *) dlsym (dll, #fn); if (p_##fn == NULL) return 0
--#endif
-+#if !STUB_ONLY
-+#  ifdef _WIN32
-+#    define LOOKUP(fn) p_##fn = (void *) GetProcAddress (dll, #fn); if (p_##fn == NULL) return 0
-+#  else
-+#    define LOOKUP(fn) p_##fn = (void *) dlsym (dll, #fn); if (p_##fn == NULL) return 0
-+#  endif  /* _WIN32 */
-+
- 
-   LOOKUP (gettext);
-   LOOKUP (dgettext);
-@@ -82,7 +87,7 @@ use_intl_dll (HMODULE dll)
-   LOOKUP (bind_textdomain_codeset);
-   
- #undef LOOKUP
--
-+#endif  /* !STUB_ONLY */
-   return 1;
- }
- 
-@@ -171,13 +176,17 @@ setup (void)
- 
-   if (!beenhere)
-     {
--#ifdef _WIN32
--      HMODULE intl_dll = LoadLibrary ("intl.dll");
--#elif defined(__APPLE__) && defined(__MACH__)
--      HMODULE intl_dll = dlopen ("libintl.dylib", RTLD_LAZY);
--#else
--      HMODULE intl_dll = dlopen ("libintl.so", RTLD_LAZY);
--#endif
-+#if !STUB_ONLY
-+#  ifdef _WIN32
-+    HMODULE intl_dll = LoadLibrary ("intl.dll");
-+#  elif defined(__APPLE__) && defined(__MACH__)
-+    HMODULE intl_dll = dlopen ("libintl.dylib", RTLD_LAZY);
-+#  else
-+    HMODULE intl_dll = dlopen ("libintl.so", RTLD_LAZY);
-+#  endif
-+#else  /* !STUB_ONLY */
-+    HMODULE intl_dll = NULL;
-+#endif  /* STUB_ONLY */
- 
-       if (intl_dll != NULL &&
- 	  use_intl_dll (intl_dll))
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/proxy-libintl/proxy-libintl_20100902.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/proxy-libintl/proxy-libintl_20100902.bb
index a46a91c..f11ae7e 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/proxy-libintl/proxy-libintl_20100902.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/proxy-libintl/proxy-libintl_20100902.bb
@@ -18,7 +18,7 @@
 FILES_${PN}-dev = "${includedir}/libintl.h ${libdir}/libintl.a"
 INSANE_SKIP_${PN}-dev = "staticdev"
 ALLOW_EMPTY_${PN} = "1"
-CFLAGS_append = " -fPIC -Wall -I ../../include ${@['-DSTUB_ONLY', ''][d.getVar('USE_NLS', 1) != 'no']}"
+CFLAGS_append = " -fPIC -Wall -I ../../include ${@['-DSTUB_ONLY', ''][d.getVar('USE_NLS') != 'no']}"
 TARGET_CC_ARCH += "${LDFLAGS}"
 
 do_compile() {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox/0001-Fix-TOYBOX_VERSION.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox/0001-Fix-TOYBOX_VERSION.patch
deleted file mode 100644
index 8af4305..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox/0001-Fix-TOYBOX_VERSION.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 209fad8ebd17bf46d0431dafbb547f429a3cffdf Mon Sep 17 00:00:00 2001
-From: Paul Barker <paul@paulbarker.me.uk>
-Date: Sat, 4 Jun 2016 15:05:49 +0100
-Subject: [PATCH 1/2] Fix TOYBOX_VERSION
-
-The latest tagged version is 0.7.1.
-
-Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
-Upstream-status: Submitted
----
- main.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/main.c b/main.c
-index eeae2f3..bedb333 100644
---- a/main.c
-+++ b/main.c
-@@ -6,7 +6,7 @@
- #include "toys.h"
- 
- #ifndef TOYBOX_VERSION
--#define TOYBOX_VERSION "0.7.0"
-+#define TOYBOX_VERSION "0.7.1"
- #endif
- 
- // Populate toy_list[].
--- 
-2.1.4
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox/0002-Fix-trimmed-printf-in-grep.patch b/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox/0002-Fix-trimmed-printf-in-grep.patch
deleted file mode 100644
index 37808d0..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox/0002-Fix-trimmed-printf-in-grep.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 9c51a0d7690fb3b08871dae2486af4032d8442fb Mon Sep 17 00:00:00 2001
-From: Paul Barker <paul@paulbarker.me.uk>
-Date: Sat, 4 Jun 2016 15:42:48 +0100
-Subject: [PATCH 2/2] Fix trimmed printf in grep
-
-Using a default trim value of INT_MAX/2 when printing a line causes nothing to
-be printed on a system built using OpenEmbedded for the qemux86 target. This may
-also affect other systems.
-
-Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
-Upstream-status: Submitted
----
- toys/posix/grep.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/toys/posix/grep.c b/toys/posix/grep.c
-index 2ca02d2..f38c538 100644
---- a/toys/posix/grep.c
-+++ b/toys/posix/grep.c
-@@ -74,7 +74,10 @@ static void outline(char *line, char dash, char *name, long lcount, long bcount,
-   if (!line || (lcount && (toys.optflags&FLAG_n)))
-     printf("%ld%c", lcount, line ? dash : TT.outdelim);
-   if (bcount && (toys.optflags&FLAG_b)) printf("%ld%c", bcount-1, dash);
--  if (line) xprintf("%.*s%c", trim ? trim : INT_MAX/2, line, TT.outdelim);
-+  if (line) {
-+    if (trim) xprintf("%.*s%c", trim, line, TT.outdelim);
-+    else xprintf("%s%c", line, TT.outdelim);
-+  }
- }
- 
- // Show matches in one file
--- 
-2.1.4
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox_0.7.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox_0.7.1.bb
deleted file mode 100644
index defca70..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox_0.7.1.bb
+++ /dev/null
@@ -1,74 +0,0 @@
-SUMMARY = "Toybox combines common utilities together into a single executable."
-HOMEPAGE = "http://www.landley.net/toybox/"
-DEPENDS = "attr"
-
-SRC_URI = " \
-    http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.gz \
-    file://0001-Fix-TOYBOX_VERSION.patch \
-    file://0002-Fix-trimmed-printf-in-grep.patch \
-"
-
-SRC_URI[md5sum] = "e959e5ff8c6806781eb06e56f302a393"
-SRC_URI[sha256sum] = "5bb3069f58faf12940d5cfde3209ac7f63210bebdd9023979b0c20cede126ea7"
-
-LICENSE = "BSD-0-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=f0b8b3dd6431bcaa245da0a08bd0d511"
-
-SECTION = "base"
-
-TOYBOX_BIN = "generated/unstripped/toybox"
-
-do_configure() {
-    oe_runmake defconfig
-
-    # Disable killall5 as it isn't managed by update-alternatives
-    sed -e 's/CONFIG_KILLALL5=y/# CONFIG_KILLALL5 is not set/' -i .config
-
-    # Disable swapon as it doesn't handle the '-a' argument used during boot
-    sed -e 's/CONFIG_SWAPON=y/# CONFIG_SWAPON is not set/' -i .config
-}
-
-do_compile() {
-    oe_runmake ${TOYBOX_BIN}
-
-    # Create a list of links needed
-    ${BUILD_CC} -I . scripts/install.c -o generated/instlist
-    ./generated/instlist long | sed -e 's#^#/#' > toybox.links
-}
-
-do_install() {
-    # Install manually instead of using 'make install'
-    install -d ${D}${base_bindir}
-    if grep -q "CONFIG_TOYBOX_SUID=y" ${B}/.config; then
-        install -m 4755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox
-    else
-        install -m 0755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox
-    fi
-
-    install -d ${D}${sysconfdir}
-    install -m 0644 ${B}/toybox.links ${D}${sysconfdir}
-}
-
-inherit update-alternatives
-
-# If you've chosen to install toybox you probably want it to take precedence
-# over busybox where possible but not over other packages
-ALTERNATIVE_PRIORITY = "60"
-
-python do_package_prepend () {
-    # Read links from /etc/toybox.links and create appropriate
-    # update-alternatives variables
-
-    dvar = d.getVar('D', True)
-    pn = d.getVar('PN', True)
-    target = "/bin/toybox"
-
-    f = open('%s/etc/toybox.links' % (dvar), 'r')
-    for alt_link_name in f:
-        alt_link_name = alt_link_name.strip()
-        alt_name = os.path.basename(alt_link_name)
-        d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name)
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
-        d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
-    f.close()
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox_0.7.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox_0.7.3.bb
new file mode 100644
index 0000000..0cd44ff
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-core/toybox/toybox_0.7.3.bb
@@ -0,0 +1,74 @@
+SUMMARY = "Toybox combines common utilities together into a single executable."
+HOMEPAGE = "http://www.landley.net/toybox/"
+DEPENDS = "attr"
+
+SRC_URI = " \
+    http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.gz \
+"
+
+SRC_URI[md5sum] = "6fa2a001402cb067ba541e0d8948da50"
+SRC_URI[sha256sum] = "e6469b508224e0d2e4564dda05c4bb47aef5c28bf29d6c983bcdc6e3a0cd29d6"
+
+LICENSE = "BSD-0-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f0b8b3dd6431bcaa245da0a08bd0d511"
+
+SECTION = "base"
+
+TOYBOX_BIN = "generated/unstripped/toybox"
+
+EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
+
+do_configure() {
+    oe_runmake defconfig
+
+    # Disable killall5 as it isn't managed by update-alternatives
+    sed -e 's/CONFIG_KILLALL5=y/# CONFIG_KILLALL5 is not set/' -i .config
+
+    # Disable swapon as it doesn't handle the '-a' argument used during boot
+    sed -e 's/CONFIG_SWAPON=y/# CONFIG_SWAPON is not set/' -i .config
+}
+
+do_compile() {
+    oe_runmake ${TOYBOX_BIN}
+
+    # Create a list of links needed
+    ${BUILD_CC} -I . scripts/install.c -o generated/instlist
+    ./generated/instlist long | sed -e 's#^#/#' > toybox.links
+}
+
+do_install() {
+    # Install manually instead of using 'make install'
+    install -d ${D}${base_bindir}
+    if grep -q "CONFIG_TOYBOX_SUID=y" ${B}/.config; then
+        install -m 4755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox
+    else
+        install -m 0755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox
+    fi
+
+    install -d ${D}${sysconfdir}
+    install -m 0644 ${B}/toybox.links ${D}${sysconfdir}
+}
+
+inherit update-alternatives
+
+# If you've chosen to install toybox you probably want it to take precedence
+# over busybox where possible but not over other packages
+ALTERNATIVE_PRIORITY = "60"
+
+python do_package_prepend () {
+    # Read links from /etc/toybox.links and create appropriate
+    # update-alternatives variables
+
+    dvar = d.getVar('D')
+    pn = d.getVar('PN')
+    target = "/bin/toybox"
+
+    f = open('%s/etc/toybox.links' % (dvar), 'r')
+    for alt_link_name in f:
+        alt_link_name = alt_link_name.strip()
+        alt_name = os.path.basename(alt_link_name)
+        d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name)
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
+        d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
+    f.close()
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/fix-big-endian-build.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/fix-big-endian-build.patch
new file mode 100644
index 0000000..8deaf3a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools/fix-big-endian-build.patch
@@ -0,0 +1,39 @@
+Fix build on big endian systems
+
+The usb_linux_client.c file defines cpu_to_le16/32 by using the C
+library htole16/32 function calls. However, cpu_to_le16/32 are used
+when initializing structures, i.e in a context where a function call
+is not allowed.
+
+It works fine on little endian systems because htole16/32 are defined
+by the C library as no-ops. But on big-endian systems, they are
+actually doing something, which might involve calling a function,
+causing build failures.
+
+To solve this, we simply open-code cpu_to_le16/32 in a way that allows
+them to be used when initializing structures.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/system/core/adb/usb_linux_client.c
+===================================================================
+--- a/system/core/adb/usb_linux_client.c
++++ b/system/core/adb/usb_linux_client.c
+@@ -34,8 +34,15 @@
+ #define MAX_PACKET_SIZE_FS	64
+ #define MAX_PACKET_SIZE_HS	512
+ 
+-#define cpu_to_le16(x)  htole16(x)
+-#define cpu_to_le32(x)  htole32(x)
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++# define cpu_to_le16(x) (x)
++# define cpu_to_le32(x) (x)
++#else
++# define cpu_to_le16(x) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
++# define cpu_to_le32(x) \
++	((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >>  8) | \
++	 (((x) & 0x0000ff00u) <<  8) | (((x) & 0x000000ffu) << 24))
++#endif
+ 
+ struct usb_handle
+ {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
index a9e7d5d..34fddcb 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
@@ -7,7 +7,7 @@
     file://${COMMON_LICENSE_DIR}/BSD-2-Clause;md5=8bef8e6712b1be5aa76af1ebde9d6378 \
     file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9 \
 "
-DEPENDS = "libbsd libpcre openssl zlib"
+DEPENDS = "libbsd libpcre openssl zlib libcap"
 
 ANDROID_TAG = "android-5.1.1_r37"
 ANDROID_MIRROR = "android.googlesource.com"
@@ -23,14 +23,15 @@
     git://${LIBHARDWARE_REPO};name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware;tag=${ANDROID_TAG} \
     git://${LIBSELINUX_REPO};name=libselinux;protocol=https;nobranch=1;destsuffix=git/external/libselinux;tag=${ANDROID_TAG} \
     git://${BUILD_REPO};name=build;protocol=https;nobranch=1;destsuffix=git/build;tag=${ANDROID_TAG} \
-    file://remove-selinux-android.patch;apply=yes \
-    file://use-capability.patch;apply=yes \
-    file://use-local-socket.patch;apply=yes \
-    file://preserve-ownership.patch;apply=yes \
-    file://mkbootimg-Add-dt-parameter-to-specify-DT-image.patch;apply=yes \
-    file://remove-bionic-android.patch;apply=yes \
-    file://define-shell-command.patch;apply=yes \
-    file://implicit-declaration-function-strlcat-strlcopy.patch;apply=yes \
+    file://remove-selinux-android.patch \
+    file://use-capability.patch \
+    file://use-local-socket.patch \
+    file://preserve-ownership.patch \
+    file://mkbootimg-Add-dt-parameter-to-specify-DT-image.patch \
+    file://remove-bionic-android.patch \
+    file://define-shell-command.patch \
+    file://implicit-declaration-function-strlcat-strlcopy.patch \
+    file://fix-big-endian-build.patch \
     file://android-tools-adbd.service \
     file://.gitignore;subdir=git \
     file://adb.mk;subdir=${BPN} \
@@ -43,6 +44,10 @@
 S = "${WORKDIR}/git"
 B = "${WORKDIR}/${BPN}"
 
+# http://errors.yoctoproject.org/Errors/Details/133881/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
 inherit systemd
 
 SYSTEMD_SERVICE_${PN} = "android-tools-adbd.service"
@@ -160,4 +165,4 @@
     ${bindir}/mkuserimg \
 "
 
-BBCLASSEXTEND += "native"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive.inc b/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive.inc
index 9399363..9684d1f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive.inc
@@ -6,10 +6,10 @@
 DEPENDS_class-native = "m4-native gnu-config-native"
 DEPENDS_class-nativesdk = "m4-nativesdk gnu-config-nativesdk"
 
-RDEPENDS_${PN} = "m4 gnu-config"
+RDEPENDS_${PN} = "m4 gnu-config gnome-common"
 RDEPENDS_${PN}_class-native = "m4-native gnu-config-native"
 RDEPENDS_${PN}_class-nativesdk = "m4-nativesdk gnu-config-nativesdk"
 
-SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2"
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.xz"
 
 inherit autotools
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive/delete-some-m4-files.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive/delete-some-m4-files.patch
new file mode 100644
index 0000000..2aa788b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive/delete-some-m4-files.patch
@@ -0,0 +1,23 @@
+Delete two m4files ax_code_coverage.m4 and ax_check_enable_debug.m4
+to avoid installing conflicts. These two files can be installed by
+gnome-common from oe-core, even if the files in gnmoe-common is
+copied from autoconf-archive(the reason is that the old version
+autoconf-archive don't provide the two files).
+After upgrading to the new version, we need to drop them in meta-oe
+and then set rdepends to gnome-common(oe-core)
+
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+
+Index: a/configure.ac
+===================================================================
+--- a/configure.ac     2016-09-16 06:00:00.000000000 +0800
++++ b/configure.ac     2017-04-18 17:43:05.946290554 +0800
+@@ -19,7 +19,7 @@
+ 
+ AC_PROG_SED
+ 
+-M4FILES="m4_esyscmd([echo -n m4/*.m4])"
++M4FILES="m4_esyscmd([echo -n m4/*.m4 | sed -e 's:m4/ax_code_coverage.m4 ::g'|sed -e 's:m4/ax_check_enable_debug.m4 ::g'])"
+ AC_SUBST([M4FILES])
+ 
+ TEXIFILES="m4_esyscmd([cd m4 && echo -n *.m4 | sed -e 's/\.m4/.texi/g'])"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive_2012.04.07.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive_2012.04.07.bb
deleted file mode 100644
index 5baaecc..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive_2012.04.07.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require autoconf-archive.inc
-
-
-PARALLEL_MAKE = ""
-
-LICENSE = "GPLv2 & GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-SRC_URI[md5sum] = "e842c5b9fae021007bd70550362e5e80"
-SRC_URI[sha256sum] = "040b443bf68efd52fbfcb294b556bfbbbfe432db78445ca25e0cfe2e88f96a14"
-
-EXTRA_OECONF += "ac_cv_path_M4=m4"
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive_2016.09.16.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive_2016.09.16.bb
new file mode 100644
index 0000000..561b57b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/autoconf-archive/autoconf-archive_2016.09.16.bb
@@ -0,0 +1,17 @@
+require autoconf-archive.inc
+
+
+PARALLEL_MAKE = ""
+
+LICENSE = "GPLv2 & GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI[md5sum] = "bf19d4cddce260b3c3e1d51d42509071"
+SRC_URI[sha256sum] = "e8f2efd235f842bad2f6938bf4a72240a5e5fcd248e8444335e63beb60fabd82"
+
+SRC_URI += "\
+        file://delete-some-m4-files.patch \
+"
+
+EXTRA_OECONF += "ac_cv_path_M4=m4"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad_git.bb
new file mode 100644
index 0000000..36c2b63
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad_git.bb
@@ -0,0 +1,109 @@
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+# Applications using this library needs to add link against libbreakpad_client.a.
+
+SUMMARY = "An open-source multi-platform crash reporting system"
+DESCRIPTION = "Breakpad is a library and tool suite that allows you to distribute an application to users with compiler-provided debugging information removed, record crashes in compact \"minidump\" files, send them back to your server, and produce C and C++ stack traces from these minidumps. "
+HOMEPAGE = "https://code.google.com/p/google-breakpad/"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=56c24a43c81c3af6fcf590851931489e"
+SECTION = "libs"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
+
+PE = "1"
+
+PV = "1.0+git${SRCPV}"
+
+SRCREV_FORMAT = "breakpad_glog_gmock_gtest_protobuf_lss"
+
+SRCREV_breakpad = "2f6cb866d615d6240a18c7535c994c6bb93b1ba5"
+SRCREV_glog = "d8cb47f77d1c31779f3ff890e1a5748483778d6a"
+SRCREV_gmock = "f7d03d2734759ee12b57d2dbcb695607d89e8e05"
+SRCREV_gtest = "ec44c6c1675c25b9827aacd08c02433cccde7780"
+SRCREV_protobuf = "cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac"
+SRCREV_lss = "1549d20f6d3e7d66bb4e687c0ab9da42c2bff2ac"
+
+SRC_URI = "git://github.com/google/breakpad;name=breakpad \
+           git://github.com/google/glog.git;destsuffix=git/src/third_party/glog;name=glog \
+           git://github.com/google/googlemock.git;destsuffix=git/src/testing;name=gmock \
+           git://github.com/google/googletest.git;destsuffix=git/src/testing/gtest;name=gtest \
+           git://github.com/google/protobuf.git;destsuffix=git/src/third_party/protobuf/protobuf;name=protobuf \
+           git://chromium.googlesource.com/linux-syscall-support;protocol=https;destsuffix=git/src/third_party/lss;name=lss \
+"
+S = "${WORKDIR}/git"
+
+COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*"
+
+do_install_append() {
+        install -d ${D}${includedir}
+        install -d ${D}${includedir}/breakpad
+
+        install -d ${D}${includedir}/breakpad/client/linux/crash_generation
+        install -m 0644 ${S}/src/client/linux/crash_generation/crash_generation_client.h  ${D}${includedir}/breakpad/client/linux/crash_generation/crash_generation_client.h
+
+        install -d ${D}${includedir}/breakpad/client/linux/handler/
+        install -m 0644 ${S}/src/client/linux/handler/exception_handler.h ${D}${includedir}/breakpad/client/linux/handler/exception_handler.h
+        install -m 0644 ${S}/src/client/linux/handler/minidump_descriptor.h ${D}${includedir}/breakpad/client/linux/handler/minidump_descriptor.h
+
+        install -d ${D}${includedir}/breakpad/client/linux/dump_writer_common
+        install -m 0644 ${S}/src/client/linux/dump_writer_common/mapping_info.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/mapping_info.h
+        install -m 0644 ${S}/src/client/linux/dump_writer_common/thread_info.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/thread_info.h
+        install -m 0644 ${S}/src/client/linux/dump_writer_common/raw_context_cpu.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/raw_context_cpu.h
+
+        install -d ${D}${includedir}/breakpad/client/linux/minidump_writer
+        install -m 0644 ${S}/src/client/linux/minidump_writer/linux_dumper.h ${D}${includedir}/breakpad/client/linux/minidump_writer/linux_dumper.h
+        install -m 0644 ${S}/src/client/linux/minidump_writer/minidump_writer.h ${D}${includedir}/breakpad/client/linux/minidump_writer/minidump_writer.h
+
+        install -d ${D}${includedir}/breakpad/common
+        install -m 0644 ${S}/src/common/memory.h ${D}${includedir}/breakpad/common/memory.h
+        install -m 0644 ${S}/src/common/scoped_ptr.h ${D}${includedir}/breakpad/common/scoped_ptr.h
+        install -m 0644 ${S}/src/common/using_std_string.h ${D}${includedir}/breakpad/common/using_std_string.h
+
+        install -d ${D}${includedir}/breakpad/google_breakpad/common
+        install -m 0644 ${S}/src/google_breakpad/common/breakpad_types.h ${D}${includedir}/breakpad/google_breakpad/common/breakpad_types.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_format.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_format.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_amd64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_amd64.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_arm.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_arm.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_arm.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_arm64.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_mips.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_mips.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_ppc64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_ppc64.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_ppc.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_ppc.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_sparc.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_sparc.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_x86.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_x86.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_linux.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_linux.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_mac.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_mac.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_ps3.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_ps3.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_solaris.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_solaris.h
+        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_win32.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_win32.h
+
+        install -d ${D}${includedir}/breakpad/third_party/lss
+        install -m 0644 ${S}/src/third_party/lss/linux_syscall_support.h ${D}${includedir}/breakpad/third_party/lss/linux_syscall_support.h
+}
+
+PACKAGES =+ "${PN}-minidump-upload ${PN}-sym-upload"
+
+FILES_${PN}-minidump-upload = "${bindir}/minidump_upload"
+FILES_${PN}-sym-upload = "${bindir}/sym_upload"
+
+
+SYSROOT_PREPROCESS_FUNCS += "breakpad_populate_sysroot"
+breakpad_populate_sysroot() {
+        sysroot_stage_dir ${D}/usr/include ${SYSROOT_DESTDIR}/usr/include
+        sysroot_stage_dir ${D}/usr/lib ${SYSROOT_DESTDIR}/usr/lib
+        sysroot_stage_dir ${D}/usr/lib ${SYSROOT_DESTDIR}/usr/lib
+}
+
+# Fails to build with thumb-1 (qemuarm)
+#| {standard input}: Assembler messages:
+#| {standard input}:2178: Error: selected processor does not support Thumb mode `it ne'
+#| {standard input}:2179: Error: Thumb does not support conditional execution
+#| {standard input}:2180: Error: selected processor does not support Thumb mode `it eq'
+#| {standard input}:2181: Error: Thumb does not support conditional execution
+#| {standard input}:2183: Error: lo register required -- `str ip,[r1,#-4]!'
+#| {standard input}:2184: Error: Thumb does not support this addressing mode -- `str r6,[r1,#-4]!'
+#| {standard input}:2191: Error: lo register required -- `ldr pc,[sp]'
+#| make: *** [src/client/linux/handler/exception_handler.o] Error 1
+ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad_svn.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad_svn.bb
deleted file mode 100644
index b573ea5..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad_svn.bb
+++ /dev/null
@@ -1,91 +0,0 @@
-# Released under the MIT license (see COPYING.MIT for the terms)
-
-# Applications using this library needs to add link against libbreakpad_client.a.
-
-SUMMARY = "An open-source multi-platform crash reporting system"
-DESCRIPTION = "Breakpad is a library and tool suite that allows you to distribute an application to users with compiler-provided debugging information removed, record crashes in compact \"minidump\" files, send them back to your server, and produce C and C++ stack traces from these minidumps. "
-HOMEPAGE = "https://code.google.com/p/google-breakpad/"
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=56c24a43c81c3af6fcf590851931489e"
-SECTION = "libs"
-
-inherit autotools
-
-BBCLASSEXTEND = "native"
-
-SRCREV = "r1435"
-SRC_URI = "svn://google-breakpad.googlecode.com/svn;module=trunk;protocol=http"
-S = "${WORKDIR}/trunk"
-
-COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*"
-
-do_install_append() {
-        install -d ${D}${includedir}
-        install -d ${D}${includedir}/breakpad
-
-        install -d ${D}${includedir}/breakpad/client/linux/crash_generation
-        install -m 0644 ${S}/src/client/linux/crash_generation/crash_generation_client.h  ${D}${includedir}/breakpad/client/linux/crash_generation/crash_generation_client.h
-
-        install -d ${D}${includedir}/breakpad/client/linux/handler/
-        install -m 0644 ${S}/src/client/linux/handler/exception_handler.h ${D}${includedir}/breakpad/client/linux/handler/exception_handler.h
-        install -m 0644 ${S}/src/client/linux/handler/minidump_descriptor.h ${D}${includedir}/breakpad/client/linux/handler/minidump_descriptor.h
-
-        install -d ${D}${includedir}/breakpad/client/linux/dump_writer_common
-        install -m 0644 ${S}/src/client/linux/dump_writer_common/mapping_info.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/mapping_info.h
-        install -m 0644 ${S}/src/client/linux/dump_writer_common/thread_info.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/thread_info.h
-        install -m 0644 ${S}/src/client/linux/dump_writer_common/raw_context_cpu.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/raw_context_cpu.h
-
-        install -d ${D}${includedir}/breakpad/client/linux/minidump_writer
-        install -m 0644 ${S}/src/client/linux/minidump_writer/linux_dumper.h ${D}${includedir}/breakpad/client/linux/minidump_writer/linux_dumper.h
-        install -m 0644 ${S}/src/client/linux/minidump_writer/minidump_writer.h ${D}${includedir}/breakpad/client/linux/minidump_writer/minidump_writer.h
-
-        install -d ${D}${includedir}/breakpad/common
-        install -m 0644 ${S}/src/common/memory.h ${D}${includedir}/breakpad/common/memory.h
-        install -m 0644 ${S}/src/common/scoped_ptr.h ${D}${includedir}/breakpad/common/scoped_ptr.h
-        install -m 0644 ${S}/src/common/using_std_string.h ${D}${includedir}/breakpad/common/using_std_string.h
-
-        install -d ${D}${includedir}/breakpad/google_breakpad/common
-        install -m 0644 ${S}/src/google_breakpad/common/breakpad_types.h ${D}${includedir}/breakpad/google_breakpad/common/breakpad_types.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_format.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_format.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_amd64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_amd64.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_arm.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_arm.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_arm.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_arm64.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_mips.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_mips.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_ppc64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_ppc64.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_ppc.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_ppc.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_sparc.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_sparc.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_x86.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_x86.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_linux.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_linux.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_mac.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_mac.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_ps3.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_ps3.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_solaris.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_solaris.h
-        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_win32.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_win32.h
-
-        install -d ${D}${includedir}/breakpad/third_party/lss
-        install -m 0644 ${S}/src/third_party/lss/linux_syscall_support.h ${D}${includedir}/breakpad/third_party/lss/linux_syscall_support.h
-}
-
-PACKAGES =+ "${PN}-minidump-upload ${PN}-sym-upload"
-
-FILES_${PN}-minidump-upload = "${bindir}/minidump_upload"
-FILES_${PN}-sym-upload = "${bindir}/sym_upload"
-
-
-SYSROOT_PREPROCESS_FUNCS += "breakpad_populate_sysroot"
-breakpad_populate_sysroot() {
-        sysroot_stage_dir ${D}/usr/include ${SYSROOT_DESTDIR}/usr/include
-        sysroot_stage_dir ${D}/usr/lib ${SYSROOT_DESTDIR}/usr/lib
-        sysroot_stage_dir ${D}/usr/lib ${SYSROOT_DESTDIR}/usr/lib
-}
-
-# Fails to build with thumb-1 (qemuarm)
-#| {standard input}: Assembler messages:
-#| {standard input}:2178: Error: selected processor does not support Thumb mode `it ne'
-#| {standard input}:2179: Error: Thumb does not support conditional execution
-#| {standard input}:2180: Error: selected processor does not support Thumb mode `it eq'
-#| {standard input}:2181: Error: Thumb does not support conditional execution
-#| {standard input}:2183: Error: lo register required -- `str ip,[r1,#-4]!'
-#| {standard input}:2184: Error: Thumb does not support this addressing mode -- `str r6,[r1,#-4]!'
-#| {standard input}:2191: Error: lo register required -- `ldr pc,[sp]'
-#| make: *** [src/client/linux/handler/exception_handler.o] Error 1
-ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9_0.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9_0.6.bb
index 6940d2d..c6d7890 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9_0.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/cloud9/cloud9_0.6.bb
@@ -8,7 +8,7 @@
 # Nodejs-native for node-waf, nodejs4-native for the headers
 DEPENDS = "libxml2 nodejs-native nodejs4-native"
 
-PNBLACKLIST[cloud9] ?= "Not comatible with current nodejs 0.12, but upstream is working on it for v3"
+PNBLACKLIST[cloud9] ?= "Not comatible with current nodejs 0.12, but upstream is working on it for v3 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 inherit systemd
 
 SRC_URI = "git://github.com/ajaxorg/cloud9.git;name=cloud9ide \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/cppunit/cppunit_1.13.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/cppunit/cppunit_1.13.1.bb
deleted file mode 100644
index 9420294..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/cppunit/cppunit_1.13.1.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-DESCRIPTION = "CppUnit is the C++ port of the famous JUnit framework for unit testing. Test output is in XML for automatic testing and GUI based for supervised tests. "
-HOMEPAGE = "http://www.freedesktop.org/wiki/Software/cppunit"
-LICENSE = "LGPL-2.1"
-SECTION = "libs"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
-SRC_URI = " \
-    http://dev-www.libreoffice.org/src/cppunit-${PV}.tar.gz \
-    file://0001-doc-Makefile.am-do-not-preserve-file-flags-when-copy.patch \
-"
-SRC_URI[md5sum] = "fa9aa839145cdf860bf596532bb8af97"
-SRC_URI[sha256sum] = "d5b9f3ffc9f1634d75b20b54f48c02e0817bca6afa1d5160b244889d6bff8e0f"
-
-inherit autotools
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/cppunit/cppunit_1.13.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/cppunit/cppunit_1.13.2.bb
new file mode 100644
index 0000000..65b08b0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/cppunit/cppunit_1.13.2.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "CppUnit is the C++ port of the famous JUnit framework for unit testing. Test output is in XML for automatic testing and GUI based for supervised tests. "
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/cppunit"
+LICENSE = "LGPL-2.1"
+SECTION = "libs"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+SRC_URI = " \
+    http://dev-www.libreoffice.org/src/cppunit-${PV}.tar.gz \
+    file://0001-doc-Makefile.am-do-not-preserve-file-flags-when-copy.patch \
+"
+SRC_URI[md5sum] = "d1c6bdd5a76c66d2c38331e2d287bc01"
+SRC_URI[sha256sum] = "3f47d246e3346f2ba4d7c9e882db3ad9ebd3fcbd2e8b732f946e0e3eeb9f429f"
+
+inherit autotools
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/cxxtest/cxxtest_4.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/cxxtest/cxxtest_4.3.bb
new file mode 100644
index 0000000..2915011
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/cxxtest/cxxtest_4.3.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "CxxTest is a unit testing framework for C++ that is similar in spirit to JUnit, CppUnit, and xUnit."
+HOMEPAGE = "http://cxxtest.com/"
+LICENSE = "LGPL-2.0"
+SECTION = "devel"
+
+SRC_URI = "http://downloads.sourceforge.net/project/cxxtest/cxxtest/${PV}/cxxtest-${PV}.tar.gz"
+SRC_URI[md5sum] = "b3a24b3e1aad9acf6adac37f4c3f83ec"
+SRC_URI[sha256sum] = "356d0f4810e8eb5c344147a0cca50fc0d84122c286e7644b61cb365c2ee22083"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/cxxtest-${PV}/COPYING;md5=e6a600fd5e1d9cbde2d983680233ad02"
+S = "${WORKDIR}/cxxtest-${PV}/python"
+
+inherit distutils
+
+do_install_append() {
+    install -d ${D}${includedir}
+    cp -a ../cxxtest ${D}${includedir}
+    sed '1c\
+#!/usr/bin/env python' -i ${D}${bindir}/cxxtestgen
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/0001-undefined-strdup-macro.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/0001-undefined-strdup-macro.patch
new file mode 100644
index 0000000..ea940e9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/0001-undefined-strdup-macro.patch
@@ -0,0 +1,29 @@
+From 9c2438e85e4d7deb9422be257a25e8ab16093821 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Dec 2016 14:02:02 -0800
+Subject: [PATCH] undefined strdup macro
+
+build fails due to strdup define in string2.h
+system header.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dmalloc.h.3 | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/dmalloc.h.3 b/dmalloc.h.3
+index 8bda997..b70c07e 100644
+--- a/dmalloc.h.3
++++ b/dmalloc.h.3
+@@ -1,5 +1,8 @@
+ /* NOTE: start of $Id: dmalloc.h.4,v 1.15 2007/05/14 17:23:37 gray Exp $ */
+ 
++#undef strndup
++#undef strdup
++
+ /* dmalloc version defines */
+ #define DMALLOC_VERSION_MAJOR	5	/* X.0.0 */
+ #define DMALLOC_VERSION_MINOR	5	/* 0.X.0 */
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/02-Makefile.in.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/02-Makefile.in.patch
new file mode 100644
index 0000000..967643b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/02-Makefile.in.patch
@@ -0,0 +1,312 @@
+Description: Changes for building shared libraries
+ This patch includes changes for building shared libraries with PIC object
+ files and the correct soname and libname.
+Author: Daniel Rus Morales <danirus@tol-project.org>
+
+Index: dmalloc-5.5.2/Makefile.in
+===================================================================
+--- dmalloc-5.5.2.orig/Makefile.in
++++ dmalloc-5.5.2/Makefile.in
+@@ -41,7 +41,7 @@ LIBRARY	= lib$(MODULE).a
+ 
+ # thread version of the library
+ LIB_TH	= lib$(MODULE)th.a
+-LIB_TH_SL = lib$(MODULE)th.@shlibext@
++LIB_TH_SL = lib$(MODULE)th.@shlibext@.5.5.2
+ @TH_ON@BUILD_ALL_1 = threads
+ @TH_ON@INSTALL_LIB_1 = installth
+ @SL_ON@BUILD_THREADS_1 = $(LIB_TH_SL)
+@@ -50,8 +50,8 @@ LIB_TH_SL = lib$(MODULE)th.@shlibext@
+ @TH_ON@@SL_ON@INSTALL_LIB_2 = installthsl
+ 
+ # C++ version of the library
+-LIB_CXX	= lib$(MODULE)xx.a
+-LIB_CXX_SL = lib$(MODULE)xx.@shlibext@
++LIB_CXX	= lib$(MODULE)cxx.a
++LIB_CXX_SL = lib$(MODULE)cxx.@shlibext@.5.5.2
+ @CXX_ON@BUILD_ALL_3 = $(LIB_CXX)
+ @CXX_ON@INSTALL_LIB_3 = installcxx
+ @SL_ON@BUILD_CXX_3 = $(LIB_CXX_SL)
+@@ -61,7 +61,7 @@ LIB_CXX_SL = lib$(MODULE)xx.@shlibext@
+ 
+ # threads + C++
+ LIB_TH_CXX = lib$(MODULE)thcxx.a
+-LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@
++LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@.5.5.2
+ @TH_ON@@CXX_ON@BUILD_ALL_5 = $(LIB_TH_CXX)
+ @TH_ON@@CXX_ON@INSTALL_LIB_5 = installthcxx
+ @TH_ON@BUILD_CXX_5 = $(LIB_TH_CXX)
+@@ -76,7 +76,7 @@ LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlib
+ @CXX_ON@@SL_ON@INSTALL_THREADS_6 = installthcxxsl
+ 
+ # shared versions of the libraries
+-LIB_SL = lib$(MODULE).@shlibext@
++LIB_SL = lib$(MODULE).@shlibext@.5.5.2
+ @SL_ON@BUILD_ALL_7 = $(LIB_SL)
+ @SL_ON@INSTALL_LIB_7 = installsl
+ @SL_ON@BUILD_TH_CXX_7 = $(LIB_TH_CXX_SL)
+@@ -145,9 +145,13 @@ SHELL = /bin/sh
+ 
+ HFLS = dmalloc.h
+ OBJS = arg_check.o compat.o dmalloc_rand.o dmalloc_tab.o env.o heap.o
++OBJS_SL = arg_check_sl.o compat_sl.o dmalloc_rand_sl.o dmalloc_tab_sl.o env_sl.o heap_sl.o
+ NORMAL_OBJS = chunk.o error.o malloc.o
++NORMAL_OBJS_SL = chunk_sl.o error_sl.o malloc_sl.o
+ THREAD_OBJS = chunk_th.o error_th.o malloc_th.o
++THREAD_OBJS_SL = chunk_th_sl.o error_th_sl.o malloc_th_sl.o
+ CXX_OBJS = dmallocc.o
++CXX_OBJS_SL = dmallocc_sl.o
+ 
+ CFLAGS = $(CCFLAGS)
+ TEST = $(MODULE)_t
+@@ -160,9 +164,9 @@ all : $(BUILD_ALL)
+ 
+ clean :
+ 	rm -f $(A_OUT) core *.o *.t
+-	rm -f $(LIBRARY) $(LIB_TH) $(LIB_CXX) $(LIB_TH_CXX) $(TEST) $(TEST_FC)
+-	rm -f $(LIB_TH_SL) $(LIB_CXX_SL) $(LIB_TH_CXX_SL) $(LIB_SL)
++	rm -f $(TEST) $(TEST_FC)
+ 	rm -f $(UTIL) dmalloc.h
++	rm -f lib$(MODULE)*.*
+ 
+ realclean : clean
+ 
+@@ -181,43 +185,43 @@ installincs : $(HFLS)
+ 	$(INSTALL_DATA) $(HFLS) $(includedir)
+ 
+ installthsl : $(LIB_TH_SL)
+-	$(srcdir)/mkinstalldirs $(libdir)
+-	$(INSTALL_PROGRAM) $(LIB_TH_SL) $(libdir)
++	$(srcdir)/mkinstalldirs $(shlibdir)
++	$(INSTALL) $(LIB_TH_SL) $(shlibdir)
+ 
+ installth : $(INSTALL_THREADS)
+ 	$(srcdir)/mkinstalldirs $(libdir)
+-	$(INSTALL_PROGRAM) $(LIB_TH) $(libdir)
++	$(INSTALL) $(LIB_TH) $(libdir)
+ @CXX_OFF@	@echo "Enter 'make installthcxx' to install the threaded C++ library"
+ @SL_OFF@	@echo "Enter 'make installthsl' to install the threaded shared-library"
+ 
+ installthcxxsl : $(LIB_TH_CXX_SL)
+ 	$(srcdir)/mkinstalldirs $(shlibdir)
+-	$(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(shlibdir)
++	$(INSTALL) $(LIB_TH_CXX_SL) $(shlibdir)
+ 
+ installthcxx : $(INSTALL_TH_CXX)
+ 	$(srcdir)/mkinstalldirs $(libdir)
+-	$(INSTALL_PROGRAM) $(LIB_TH_CXX) $(libdir)
++	$(INSTALL) $(LIB_TH_CXX) $(libdir)
+ @SL_OFF@	@echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library"
+ 
+ installcxxsl : $(LIB_CXX_SL)
+-	$(srcdir)/mkinstalldirs $(libdir)
+-	$(INSTALL_PROGRAM) $(LIB_CXX_SL) $(libdir)
++	$(srcdir)/mkinstalldirs $(shlibdir)
++	$(INSTALL) $(LIB_CXX_SL) $(shlibdir)
+ 
+ installcxx : $(INSTALL_CXX)
+ 	$(srcdir)/mkinstalldirs $(libdir)
+-	$(INSTALL_PROGRAM) $(LIB_CXX) $(libdir)
++	$(INSTALL) $(LIB_CXX) $(libdir)
+ @TH_OFF@	@echo "Enter 'make installthcxx' to install the threaded C++ library"
+ @SL_OFF@	@echo "Enter 'make installcxxsl' to install the C++ shared-library"
+ 
+ installsl : $(LIB_SL)
+ 	$(srcdir)/mkinstalldirs $(shlibdir)
+-	$(INSTALL_PROGRAM) $(LIB_SL) $(shlibdir)
++	$(INSTALL) $(LIB_SL) $(shlibdir)
+ @CXX_OFF@	@echo "Enter 'make installcxxsl' to install the C++ shared-library"
+ @TH_OFF@	@echo "Enter 'make installthsl' to install thread shared-library"
+ 
+ installlib : $(INSTALL_LIB)
+ 	$(srcdir)/mkinstalldirs $(libdir)
+-	$(INSTALL_PROGRAM) $(LIBRARY) $(libdir)
++	$(INSTALL) $(LIBRARY) $(libdir)
+ 	@RANLIB@ $(libdir)/$(LIBRARY)
+ @SL_OFF@	@echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)"
+ @CXX_OFF@	@echo "Enter 'make installcxx' to install the C++ library"
+@@ -255,10 +259,8 @@ shlib : $(BUILD_SL)
+ # NOTE: you may have to edit the configure.ac script to get this to
+ # work on your operating system.  Please send feedback to the author
+ # via: http://256.com/gray/email.html
+-$(LIB_SL) : $(LIBRARY)
+-	rm -f $@ $@.t
+-	@shlinkargs@ $(LIBRARY) $(OBJS) $(NORMAL_OBJS)
+-	mv $@.t $@
++$(LIB_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL)
++	$(CC) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL)
+ 
+ $(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
+ 	ar cr $@ $?
+@@ -268,32 +270,26 @@ $(LIB_TH) : $(OBJS) $(THREAD_OBJS)
+ 	ar cr $@ $?
+ 	@RANLIB@ $@
+ 
+-$(LIB_TH_SL) : $(LIB_TH)
+-	rm -f $@ $@.t
+-	@shlinkargs@ $(LIB_TH) $(OBJS) $(THREAD_OBJS)
+-	mv $@.t $@
++$(LIB_TH_SL) : $(OBJS_SL) $(THREAD_OBJS_SL)
++	$(CC) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL)
+ 
+ $(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
+ 	ar cr $@ $?
+ 	@RANLIB@ $@
+ 
+-$(LIB_CXX_SL) : $(LIB_CXX)
+-	rm -f $@ $@.t
+-	@shlinkargs@ $(LIB_CXX) $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
+-	mv $@.t $@
++$(LIB_CXX_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
++	$(CC) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
+ 
+ $(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
+ 	ar cr $@ $?
+ 	@RANLIB@ $@
+ 
+-$(LIB_TH_CXX_SL) : $(LIB_TH_CXX)
+-	rm -f $@ $@.t
+-	@shlinkargs@ $(LIB_TH_CXX) $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
+-	mv $@.t $@
++$(LIB_TH_CXX_SL) : $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
++	$(CC) -shared -Wl,-soname,libdmallocthcxx.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
+ 
+-threadssl : $(LIB_TH_SL)
++threadssl : $(LIB_TH_SL)$(ver)
+ 
+-threadscxxsl : $(LIB_TH_CXX_SL)
++threadscxxsl : $(LIB_TH_CXX_SL)$(ver)
+ 
+ threadscxx : $(BUILD_TH_CXX)
+ @SL_OFF@	@echo "Enter 'make threadscxxsl' to build the threaded C++ shared-library"
+@@ -302,7 +298,7 @@ threads : $(BUILD_THREADS)
+ @CXX_OFF@	@echo "Enter 'make threadscxx' to build the threaded C++ library"
+ @SL_OFF@	@echo "Enter 'make threadssl' to build the threaded shared library"
+ 
+-cxxsl :  $(LIB_CXX_SL)
++cxxsl :  $(LIB_CXX_SL)$(ver)
+ 
+ cxx : $(BUILD_CXX)
+ @SL_OFF@	@echo "Enter 'make cxxsl' to build the cxx shared library"
+@@ -371,6 +367,11 @@ dmallocc.o : $(srcdir)/dmallocc.cc
+ 	$(CXX) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \
+ 		-o ./$@
+ 
++dmallocc_sl.o : $(srcdir)/dmallocc.cc
++	rm -f $@
++	$(CXX) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \
++		-o ./$@
++
+ #
+ # auto configure settings - uncomment if you are doing configure
+ # development on the library
+@@ -395,38 +396,109 @@ dmallocc.o : $(srcdir)/dmallocc.cc
+ 
+ arg_check.o: arg_check.c conf.h settings.h dmalloc.h chunk.h debug_tok.h \
+   dmalloc_loc.h error.h arg_check.h
++arg_check_sl.o: arg_check.c conf.h settings.h dmalloc.h chunk.h debug_tok.h \
++  dmalloc_loc.h error.h arg_check.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ chunk.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
+   dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
+   error_val.h heap.h
++chunk_sl.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
++  dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
++  error_val.h heap.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ compat.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h
++compat_sl.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ dmalloc.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h compat.h \
+   debug_tok.h dmalloc_loc.h env.h error_val.h version.h
++dmalloc_sl.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h compat.h \
++  debug_tok.h dmalloc_loc.h env.h error_val.h version.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ dmalloc_argv.o: dmalloc_argv.c conf.h settings.h dmalloc_argv.h \
+   dmalloc_argv_loc.h compat.h
++dmalloc_argv_sl.o: dmalloc_argv.c conf.h settings.h dmalloc_argv.h \
++  dmalloc_argv_loc.h compat.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ dmalloc_fc_t.o: dmalloc_fc_t.c conf.h settings.h dmalloc.h dmalloc_argv.h \
+   dmalloc_rand.h debug_tok.h dmalloc_loc.h error_val.h
++dmalloc_fc_t_sl.o: dmalloc_fc_t.c conf.h settings.h dmalloc.h dmalloc_argv.h \
++  dmalloc_rand.h debug_tok.h dmalloc_loc.h error_val.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ dmalloc_rand.o: dmalloc_rand.c dmalloc_rand.h
++dmalloc_rand_sl.o: dmalloc_rand.c dmalloc_rand.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ dmalloc_t.o: dmalloc_t.c conf.h settings.h compat.h dmalloc.h \
+   dmalloc_argv.h dmalloc_rand.h arg_check.h debug_tok.h dmalloc_loc.h \
+   error_val.h heap.h
++dmalloc_t_sl.o: dmalloc_t.c conf.h settings.h compat.h dmalloc.h \
++  dmalloc_argv.h dmalloc_rand.h arg_check.h debug_tok.h dmalloc_loc.h \
++  error_val.h heap.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ dmalloc_tab.o: dmalloc_tab.c conf.h settings.h chunk.h compat.h dmalloc.h \
+   dmalloc_loc.h error.h error_val.h dmalloc_tab.h dmalloc_tab_loc.h
++dmalloc_tab_sl.o: dmalloc_tab.c conf.h settings.h chunk.h compat.h dmalloc.h \
++  dmalloc_loc.h error.h error_val.h dmalloc_tab.h dmalloc_tab_loc.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ env.o: env.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h \
+   debug_tok.h env.h error.h
++env_sl.o: env.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h \
++  debug_tok.h env.h error.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ error.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
+   dmalloc_loc.h env.h error.h error_val.h version.h
++error_sl.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
++  dmalloc_loc.h env.h error.h error_val.h version.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ heap.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
+   dmalloc_loc.h error.h error_val.h heap.h
++heap_sl.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
++  dmalloc_loc.h error.h error_val.h heap.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ malloc.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
+   debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
+   malloc_funcs.h return.h
++malloc_sl.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
++  debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
++  malloc_funcs.h return.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ protect.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \
+   heap.h protect.h
++protect_sl.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \
++  heap.h protect.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ chunk_th.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
+   dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
+   error_val.h heap.h
++chunk_th_sl.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
++  dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
++  error_val.h heap.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ error_th.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
+   dmalloc_loc.h env.h error.h error_val.h version.h
++error_th_sl.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
++  dmalloc_loc.h env.h error.h error_val.h version.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
+ malloc_th.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
+   debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
+   malloc_funcs.h return.h
++malloc_th_sl.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
++  debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
++  malloc_funcs.h return.h
++	rm -f $@
++	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/03-threads.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/03-threads.patch
new file mode 100644
index 0000000..be09452
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/03-threads.patch
@@ -0,0 +1,18 @@
+Description: Fix LOCK_THREADS in settings.dist
+ This patch takes into account that if --enable-threads is used, LOCK_THREADS
+ doesn't get updated
+Author: Markus Stenberg <markus.stenberg@conformiq.com>
+Author: Daniel Rus Morales <danirus@tol-project.org>
+Bug-Debian: http://bugs.debian.org/276457
+
+--- dmalloc-5.5.1.orig/settings.dist	2007-03-25 21:16:43.000000000 +0200
++++ dmalloc-5.5.1/settings.dist	2007-04-27 20:56:49.000000000 +0200
+@@ -409,7 +409,7 @@
+  */
+ 
+ #ifndef LOCK_THREADS
+-#define LOCK_THREADS 0
++#define LOCK_THREADS 1
+ #endif
+ 
+ #if LOCK_THREADS
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/100-use-xtools.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/100-use-xtools.patch
new file mode 100644
index 0000000..e1db690
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/100-use-xtools.patch
@@ -0,0 +1,109 @@
+This patch makes configure use the cross ld and ar rather than the native tools.
+
+It was build up by Yann E. MORIN <yann.morin.1998@anciens.enib.fr> from some
+bits gathered from buildroot, which is LGPL v2.1
+License for dmalloc is:
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies, and that the name of Gray Watson not be used in advertising
+ * or publicity pertaining to distribution of the document or software
+ * without specific, written prior permission.
+ *
+ * Gray Watson makes no representations about the suitability of the
+ * software described herein for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+
+I personnaly believe that the resulting code should therefore be
+LGPL v2.1, but don't believe me, ask your lawyers!
+
+Index: dmalloc-5.5.2/configure.ac
+===================================================================
+--- dmalloc-5.5.2.orig/configure.ac
++++ dmalloc-5.5.2/configure.ac
+@@ -69,6 +69,15 @@ if test "$ac_cv_prog_cc_stdc" = "no" ; t
+ fi
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
++AN_MAKEVAR([AR], [AC_PROG_AR])
++AN_PROGRAM([ar], [AC_PROG_AR])
++AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
++AC_PROG_AR
++AN_MAKEVAR([LD], [AC_PROG_LD])
++AN_PROGRAM([ld], [AC_PROG_LD])
++AC_DEFUN([AC_PROG_LD], [AC_CHECK_TOOL(LD, ld, :)])
++AC_PROG_LD
++
+ AC_C_CONST
+ 
+ # we need this for various settings
+@@ -131,14 +140,14 @@ AC_SUBST(shlibdir)
+ AC_MSG_CHECKING([shared library link args])
+ AC_COMPILE_IFELSE([ int foo(int val) { return val + 1; } ],[
+ 	# so now we try to create an archive from the compiled .o file
+-	(ar cr conftest.a conftest.o) 2>&5
++	(${ac_cv_prog_AR} cr conftest.a conftest.o) 2>&5
+ 	# see which shared-library ld commands work
+ 	#
+ 	# Darwin/Mac OS X - Terry Teague
+ 	# username terry_teague at domain users.sourceforge.net
+ 	ac_cv_shared_lib_link_objs=no
+ 	if test `uname` = "Darwin"; then
+-          if (ld -dylib -o conftest.so.t -lc conftest.a) 2>&5; then
++          if (${ac_cv_prog_LD} -dylib -o conftest.so.t -lc conftest.a) 2>&5; then
+             # By convention on some platforms
+             # libLLL.so, libLLL.X.so are symlinks to libLLL.X.Y.Z.so
+             # where X.Y.Z is version # (major.minor.increment) of the library
+@@ -156,12 +165,12 @@ AC_COMPILE_IFELSE([ int foo(int val) { r
+             ac_cv_shared_link_args='# Could not configure shlib linking'
+             enable_shlib=no
+           fi
+-       elif (ld -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
+-		ac_cv_shared_link_args='ld -shared --whole-archive -soname $@ -o $@.t'
+-	elif (ld -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
+-		ac_cv_shared_link_args='ld -shared -o $@.t -all -soname $@ -none -lc -all'
+-	elif (ld -G -o conftest.so.t conftest.a) 2>&5; then
+-		ac_cv_shared_link_args='ld -G -o $@.t'
++        elif (${ac_cv_prog_LD} -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
++		ac_cv_shared_link_args='${CC} -Wl,-shared -Wl,--whole-archive -Wl,-soname,$@ -o $@.t -Wl,--no-whole-archive'
++	elif (${ac_cv_prog_LD} -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
++		ac_cv_shared_link_args='${CC} -Wl,-shared -o $@.t -Wl,-all -Wl,-soname,$@ -Wl,-none -lc -Wl,-all'
++	elif (${ac_cv_prog_LD} -G -o conftest.so.t conftest.a) 2>&5; then
++		ac_cv_shared_link_args='${CC} -Wl,-G -o $@.t'
+ 	else
+ 		# oh well, toss an error
+ 		ac_cv_shared_link_args='# Could not configure shlib linking'
+Index: dmalloc-5.5.2/Makefile.in
+===================================================================
+--- dmalloc-5.5.2.orig/Makefile.in
++++ dmalloc-5.5.2/Makefile.in
+@@ -263,25 +263,25 @@ $(LIB_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL)
+ 	$(CC) $(LDFLAGS) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL)
+ 
+ $(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
+-	ar cr $@ $?
++	@AR@ cr $@ $?
+ 	@RANLIB@ $@
+ 
+ $(LIB_TH) : $(OBJS) $(THREAD_OBJS)
+-	ar cr $@ $?
++	@AR@ cr $@ $?
+ 	@RANLIB@ $@
+ 
+ $(LIB_TH_SL) : $(OBJS_SL) $(THREAD_OBJS_SL)
+ 	$(CC) $(LDFLAGS) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL)
+ 
+ $(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
+-	ar cr $@ $?
++	@AR@ cr $@ $?
+ 	@RANLIB@ $@
+ 
+ $(LIB_CXX_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
+ 	$(CC) $(LDFLAGS) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
+ 
+ $(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
+-	ar cr $@ $?
++	@AR@ cr $@ $?
+ 	@RANLIB@ $@
+ 
+ $(LIB_TH_CXX_SL) : $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/13-fix-ldflags-in-makefile.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/13-fix-ldflags-in-makefile.patch
new file mode 100644
index 0000000..2581e54
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/13-fix-ldflags-in-makefile.patch
@@ -0,0 +1,38 @@
+Index: dmalloc-5.5.2/Makefile.in
+===================================================================
+--- dmalloc-5.5.2.orig/Makefile.in
++++ dmalloc-5.5.2/Makefile.in
+@@ -260,7 +260,7 @@ shlib : $(BUILD_SL)
+ # work on your operating system.  Please send feedback to the author
+ # via: http://256.com/gray/email.html
+ $(LIB_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL)
+-	$(CC) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL)
++	$(CC) $(LDFLAGS) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL)
+ 
+ $(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
+ 	ar cr $@ $?
+@@ -271,21 +271,21 @@ $(LIB_TH) : $(OBJS) $(THREAD_OBJS)
+ 	@RANLIB@ $@
+ 
+ $(LIB_TH_SL) : $(OBJS_SL) $(THREAD_OBJS_SL)
+-	$(CC) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL)
++	$(CC) $(LDFLAGS) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL)
+ 
+ $(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
+ 	ar cr $@ $?
+ 	@RANLIB@ $@
+ 
+ $(LIB_CXX_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
+-	$(CC) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
++	$(CC) $(LDFLAGS) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
+ 
+ $(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
+ 	ar cr $@ $?
+ 	@RANLIB@ $@
+ 
+ $(LIB_TH_CXX_SL) : $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
+-	$(CC) -shared -Wl,-soname,libdmallocthcxx.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
++	$(CC) $(LDFLAGS) -shared -Wl,-soname,libdmallocthcxx.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
+ 
+ threadssl : $(LIB_TH_SL)$(ver)
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/130-mips.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/130-mips.patch
new file mode 100644
index 0000000..935ac98
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/130-mips.patch
@@ -0,0 +1,90 @@
+Patch to correctly handle the MIPS case.
+
+It was build up by Yann E. MORIN <yann.morin.1998@anciens.enib.fr> from some
+bits gathered from buildroot, which is LGPL v2.1
+License for dmalloc is:
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies, and that the name of Gray Watson not be used in advertising
+ * or publicity pertaining to distribution of the document or software
+ * without specific, written prior permission.
+ *
+ * Gray Watson makes no representations about the suitability of the
+ * software described herein for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+
+I personnaly believe that the resulting code should therefore be
+LGPL v2.1, but don't believe me, ask your lawyers!
+
+Index: dmalloc-5.5.2/return.h
+===================================================================
+--- dmalloc-5.5.2.orig/return.h
++++ dmalloc-5.5.2/return.h
+@@ -106,26 +106,16 @@
+ /*************************************/
+ 
+ /*
+- * For DEC Mips machines running Ultrix
++ * For Mips machines running Linux
+  */
+ #if __mips
+ 
+ /*
+- * I have no idea how to get inline assembly with the default cc.
+- * Anyone know how?
+- */
+-
+-#if 0
+-
+-/*
+  * NOTE: we assume here that file is global.
+  *
+- * $31 is the frame pointer.  $2 looks to be the return address but maybe
+- * not consistently.
++ * $31 is the return address.
+  */
+-#define GET_RET_ADDR(file)	asm("sw $2, file")
+-
+-#endif
++#define GET_RET_ADDR(file)	asm("sw $31, %0" : "=m" (file))
+ 
+ #endif /* __mips */
+ 
+Index: dmalloc-5.5.2/configure.ac
+===================================================================
+--- dmalloc-5.5.2.orig/configure.ac
++++ dmalloc-5.5.2/configure.ac
+@@ -585,31 +585,7 @@ int main() { return 1; }
+ # check if the return.h macros work
+ #
+ AC_MSG_CHECKING([return.h macros work])
+-AC_RUN_IFELSE([
+-
+-#define __CONF_H__
+-#define USE_RETURN_MACROS 1
+-#define RETURN_MACROS_WORK 1
+-
+-#include "return.h"
+-
+-static void foo (void)
+-{
+-  char	*ret_addr;
+-  GET_RET_ADDR(ret_addr);
+-}
+-
+-main()
+-{
+-  foo();
+-  exit(0);
+-}
+-],
+-[ AC_DEFINE(RETURN_MACROS_WORK, 1) AC_MSG_RESULT([yes]) ],
+-[ AC_DEFINE(RETURN_MACROS_WORK, 0) AC_MSG_RESULT([no]) ],
+-[ AC_DEFINE(RETURN_MACROS_WORK, 0) AC_MSG_RESULT([no]) ]
+-)
+-
++AC_DEFINE(RETURN_MACROS_WORK, 1)
+ ##############################################################################
+ 
+ #
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/150-use_DESTDIR.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/150-use_DESTDIR.patch
new file mode 100644
index 0000000..7edd464
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/150-use_DESTDIR.patch
@@ -0,0 +1,104 @@
+Make install rules use DESTDIR.
+Split installation of the utilitity from the global install.
+
+Copyright 2007 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
+Licensed to you as dmalloc-5.5.2 is.
+
+Index: dmalloc-5.5.2/Makefile.in
+===================================================================
+--- dmalloc-5.5.2.orig/Makefile.in
++++ dmalloc-5.5.2/Makefile.in
+@@ -178,66 +178,66 @@ distclean : clean
+ #	rm -f configure
+ 
+ installdirs :
+-	$(srcdir)/mkinstalldirs $(includedir) $(libdir) $(bindir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(includedir) $(DESTDIR)/$(libdir) $(DESTDIR)/$(bindir)
+ 
+ installincs : $(HFLS)
+-	$(srcdir)/mkinstalldirs $(includedir)
+-	$(INSTALL_DATA) $(HFLS) $(includedir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(includedir)
++	$(INSTALL_DATA) $(HFLS) $(DESTDIR)/$(includedir)
+ 
+ installthsl : $(LIB_TH_SL)
+-	$(srcdir)/mkinstalldirs $(shlibdir)
+-	$(INSTALL) $(LIB_TH_SL) $(shlibdir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
++	$(INSTALL) $(LIB_TH_SL) $(DESTDIR)/$(shlibdir)
+ 
+ installth : $(INSTALL_THREADS)
+-	$(srcdir)/mkinstalldirs $(libdir)
+-	$(INSTALL) $(LIB_TH) $(libdir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
++	$(INSTALL) $(LIB_TH) $(DESTDIR)/$(libdir)
+ @CXX_OFF@	@echo "Enter 'make installthcxx' to install the threaded C++ library"
+ @SL_OFF@	@echo "Enter 'make installthsl' to install the threaded shared-library"
+ 
+ installthcxxsl : $(LIB_TH_CXX_SL)
+-	$(srcdir)/mkinstalldirs $(shlibdir)
+-	$(INSTALL) $(LIB_TH_CXX_SL) $(shlibdir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
++	$(INSTALL) $(LIB_TH_CXX_SL) $(DESTDIR)/$(shlibdir)
+ 
+ installthcxx : $(INSTALL_TH_CXX)
+-	$(srcdir)/mkinstalldirs $(libdir)
+-	$(INSTALL) $(LIB_TH_CXX) $(libdir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
++	$(INSTALL) $(LIB_TH_CXX) $(DESTDIR)/$(libdir)
+ @SL_OFF@	@echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library"
+ 
+ installcxxsl : $(LIB_CXX_SL)
+-	$(srcdir)/mkinstalldirs $(shlibdir)
+-	$(INSTALL) $(LIB_CXX_SL) $(shlibdir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
++	$(INSTALL) $(LIB_CXX_SL) $(DESTDIR)/$(shlibdir)
+ 
+ installcxx : $(INSTALL_CXX)
+-	$(srcdir)/mkinstalldirs $(libdir)
+-	$(INSTALL) $(LIB_CXX) $(libdir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
++	$(INSTALL) $(LIB_CXX) $(DESTDIR)/$(libdir)
+ @TH_OFF@	@echo "Enter 'make installthcxx' to install the threaded C++ library"
+ @SL_OFF@	@echo "Enter 'make installcxxsl' to install the C++ shared-library"
+ 
+ installsl : $(LIB_SL)
+-	$(srcdir)/mkinstalldirs $(shlibdir)
+-	$(INSTALL) $(LIB_SL) $(shlibdir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(shlibdir)
++	$(INSTALL) $(LIB_SL) $(DESTDIR)/$(shlibdir)
+ @CXX_OFF@	@echo "Enter 'make installcxxsl' to install the C++ shared-library"
+ @TH_OFF@	@echo "Enter 'make installthsl' to install thread shared-library"
+ 
+ installlib : $(INSTALL_LIB)
+-	$(srcdir)/mkinstalldirs $(libdir)
+-	$(INSTALL) $(LIBRARY) $(libdir)
+-	@RANLIB@ $(libdir)/$(LIBRARY)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(libdir)
++	$(INSTALL) $(LIBRARY) $(DESTDIR)/$(libdir)
++	@RANLIB@ $(DESTDIR)/$(libdir)/$(LIBRARY)
+ @SL_OFF@	@echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)"
+ @CXX_OFF@	@echo "Enter 'make installcxx' to install the C++ library"
+ @TH_OFF@	@echo "Enter 'make installth' to install thread library"
+ 
+ installdocs : $(srcdir)/docs/$(HTMLFILE) $(srcdir)/docs/$(TEXIFILE) \
+ 		$(srcdir)/docs/$(PDFFILE)
+-	$(srcdir)/mkinstalldirs $(docdir)
+-	$(INSTALL_DATA) $(srcdir)/docs/$(HTMLFILE) $(docdir)
+-	$(INSTALL_DATA) $(srcdir)/docs/$(TEXIFILE) $(docdir)
+-	$(INSTALL_DATA) $(srcdir)/docs/$(PDFFILE) $(docdir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(docdir)
++	$(INSTALL_DATA) $(srcdir)/docs/$(HTMLFILE) $(DESTDIR)/$(docdir)
++	$(INSTALL_DATA) $(srcdir)/docs/$(TEXIFILE) $(DESTDIR)/$(docdir)
++	$(INSTALL_DATA) $(srcdir)/docs/$(PDFFILE) $(DESTDIR)/$(docdir)
+ 
+ install : installincs installlib $(UTIL)
+-	$(srcdir)/mkinstalldirs $(bindir)
+-	$(INSTALL_PROGRAM) $(UTIL) $(bindir)
+-	@echo "Enter 'make installdocs' to install $(DOCFILES) in $(docdir)"
++	$(srcdir)/mkinstalldirs $(DESTDIR)/$(bindir)
++	$(INSTALL_PROGRAM) $(UTIL) $(DESTDIR)/$(bindir)
++	@echo "Enter 'make installdocs' to install $(DOCFILES) in $(DESTDIR)/$(docdir)"
+ 
+ dmalloc.h.2 : $(srcdir)/configure
+ 	$(SHELL) $(srcdir)/configure
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/configure-pagesize-HACK.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/configure-pagesize-HACK.patch
new file mode 100644
index 0000000..a5bd736
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/configure-pagesize-HACK.patch
@@ -0,0 +1,37 @@
+We cant run tests during cross compile therefore pin to 4k pages
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: dmalloc-5.5.2/configure.ac
+===================================================================
+--- dmalloc-5.5.2.orig/configure.ac
++++ dmalloc-5.5.2/configure.ac
+@@ -348,26 +348,8 @@ AC_MSG_RESULT([$ac_cv_use_mmap])
+ #
+ AC_CHECK_FUNCS(getpagesize)
+ AC_MSG_CHECKING([basic-block size])
+-ac_cv_page_size=0
+-if test $ac_cv_page_size = 0; then
+-   AC_RUN_IFELSE([main() { if (getpagesize()<=2048) exit(0); else exit(1); }],
+-	[ ac_cv_page_size=11 ] )
+-fi
+-if test $ac_cv_page_size = 0; then
+-   AC_RUN_IFELSE([main() { if (getpagesize()<=4096) exit(0); else exit(1); }],
+-	[ ac_cv_page_size=12 ] )
+-fi
+-if test $ac_cv_page_size = 0; then
+-   AC_RUN_IFELSE([main() { if (getpagesize()<=8192) exit(0); else exit(1); }],
+-	[ ac_cv_page_size=13 ] )
+-fi
+-if test $ac_cv_page_size = 0; then
+-   AC_RUN_IFELSE([main() { if (getpagesize()<=16384) exit(0); else exit(1); }],
+-	[ ac_cv_page_size=14 ] )
+-fi
+-if test $ac_cv_page_size = 0; then
+-    ac_cv_page_size=15
+-fi
++# fix to 4K for now
++ac_cv_page_size=12
+ AC_DEFINE_UNQUOTED([BASIC_BLOCK],[$ac_cv_page_size])
+ AC_MSG_RESULT([$ac_cv_page_size])
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc_5.5.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc_5.5.2.bb
new file mode 100644
index 0000000..2f0d8a3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc_5.5.2.bb
@@ -0,0 +1,39 @@
+# Copyright (C) 2016 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Debug Malloc Library"
+
+DESCRIPTION = "The debug memory allocation or dmalloc library has been \
+designed as a drop in replacement for the system's malloc, realloc, \
+calloc, free and other memory management routines while providing \
+powerful debugging facilities configurable at runtime. These facilities \
+include such things as memory-leak tracking, fence-post write detection, \
+file/line number reporting, and general logging of statistics."
+
+HOMEPAGE = "http://dmalloc.com/"
+LICENSE = "CC-BY-SA-3.0"
+
+LIC_FILES_CHKSUM = "file://dmalloc.c;beginline=4;endline=17;md5=83d13664f87f1f1a3b6b2b6f6eba85aa"
+
+SECTION = "libs"
+
+SRC_URI = "http://dmalloc.com/releases/dmalloc-${PV}.tgz \
+           file://02-Makefile.in.patch \
+           file://03-threads.patch \
+           file://13-fix-ldflags-in-makefile.patch \
+           file://configure-pagesize-HACK.patch \
+           file://100-use-xtools.patch  \
+           file://130-mips.patch \
+           file://150-use_DESTDIR.patch \
+           file://0001-undefined-strdup-macro.patch \
+"
+
+SRC_URI[md5sum] = "f92e5606c23a8092f3d5694e8d1c932e"
+SRC_URI[sha256sum] = "d3be5c6eec24950cb3bd67dbfbcdf036f1278fae5fd78655ef8cdf9e911e428a"
+
+ARM_INSTRUCTION_SET = "arm"
+
+inherit autotools
+
+EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
+EXTRA_OECONF += "--enable-threads --enable-cxx --enable-shlib"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dt/dt_18.32.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dt/dt_18.32.bb
index 9688d02..0234f76 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/dt/dt_18.32.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/dt/dt_18.32.bb
@@ -45,3 +45,5 @@
 }
 
 RDEPENDS_${PN} += "tcsh"
+
+PNBLACKLIST[dt] ?= "Rdepends on blacklisted tcsh - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany-plugins_1.28.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany-plugins_1.28.bb
deleted file mode 100644
index 781287a..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany-plugins_1.28.bb
+++ /dev/null
@@ -1,263 +0,0 @@
-DESCRIPTION = "A fast and lightweight IDE"
-HOMEPAGE = "http://plugins.geany.org/"
-
-LICENSE_DEFAULT = "GPLv2"
-LICENSE = "${LICENSE_DEFAULT} & BSD-2-Clause & GPLv3"
-
-python () {
-    for plugin in d.getVar('PLUGINS', True).split():
-        if 'LICENSE_%s' % plugin not in d:
-            d.setVar('LICENSE_' + plugin, '${LICENSE_DEFAULT}')
-}
-
-DEPENDS = " \
-    geany \
-    libxml2 \
-    libsoup-2.4 \
-    enchant \
-    intltool-native \
-    libassuan \
-    gpgme \
-    vte9 \
-    libgit2 \
-"
-
-inherit autotools pkgconfig gtk-icon-cache
-
-SRC_URI = "http://plugins.geany.org/${PN}/${PN}-${PV}.tar.bz2"
-SRC_URI[md5sum] = "54ad042b6f91ff8e7a497c22faa2db4b"
-SRC_URI[sha256sum] = "b13471e0a4cb76d04a96bb21c965087b50c16390edee0c6b3bbd920d8ac17745"
-
-do_configure_prepend() {
-    rm -f ${S}/build/cache/glib-gettext.m4
-}
-
-FILES_${PN} += "${datadir}/icons"
-FILES_${PN}-dev += "${libdir}/geany/*.la ${libdir}/${PN}/*/*.la"
-
-PLUGINS += "${PN}-addons"
-LIC_FILES_CHKSUM += "file://addons/COPYING;md5=4325afd396febcb659c36b49533135d4"
-FILES_${PN}-addons = "${libdir}/geany/addons.so"
-RDEPENDS_${PN}-addons = "${PN}"
-
-PLUGINS += "${PN}-autoclose"
-LIC_FILES_CHKSUM += "file://autoclose/COPYING;md5=751419260aa954499f7abaabaa882bbe"
-FILES_${PN}-autoclose = "${libdir}/geany/autoclose.so"
-RDEPENDS_${PN}-autoclose = "${PN}"
-
-PLUGINS += "${PN}-automark"
-LIC_FILES_CHKSUM += "file://automark/COPYING;md5=751419260aa954499f7abaabaa882bbe"
-FILES_${PN}-automark = "${libdir}/geany/automark.so"
-RDEPENDS_${PN}-automark = "${PN}"
-
-PLUGINS += "${PN}-codenav"
-LIC_FILES_CHKSUM += "file://codenav/COPYING;md5=751419260aa954499f7abaabaa882bbe"
-FILES_${PN}-codenav = "${libdir}/geany/codenav.so"
-RDEPENDS_${PN}-codenav = "${PN}"
-
-PLUGINS += "${PN}-commander"
-LIC_FILES_CHKSUM += "file://commander/COPYING;md5=d32239bcb673463ab874e80d47fae504"
-LICENSE_${PN}-commander = "GPLv3"
-FILES_${PN}-commander = "${libdir}/geany/commander.so"
-RDEPENDS_${PN}-commander = "${PN}"
-
-PLUGINS += "${PN}-debugger"
-LIC_FILES_CHKSUM += "file://debugger/COPYING;md5=4325afd396febcb659c36b49533135d4"
-FILES_${PN}-debugger = "${libdir}/geany/debugger.so ${datadir}/${PN}/debugger"
-RDEPENDS_${PN}-debugger = "${PN}"
-
-PLUGINS += "${PN}-defineformat"
-LIC_FILES_CHKSUM += "file://defineformat/COPYING;md5=751419260aa954499f7abaabaa882bbe"
-FILES_${PN}-defineformat = "${libdir}/geany/defineformat.so"
-RDEPENDS_${PN}-defineformat = "${PN}"
-
-# no gnome devhelp in some common layer
-EXTRA_OECONF += "--disable-devhelp"
-#PLUGINS += "${PN}-devhelp"
-#LIC_FILES_CHKSUM += "file://devhelp/COPYING;md5=d32239bcb673463ab874e80d47fae504"
-#LICENSE_${PN}-devhelp = "GPLv3"
-#FILES_${PN}-devhelp = "${libdir}/geany/devhelp.so"
-#RDEPENDS_${PN}-devhelp = "${PN}"
-
-PLUGINS += "${PN}-geanyctags"
-LIC_FILES_CHKSUM += "file://geanyctags/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-geanyctags = "${libdir}/geany/geanyctags.so"
-RDEPENDS_${PN}-geanyctags = "${PN}"
-
-PLUGINS += "${PN}-geanydoc"
-LIC_FILES_CHKSUM += "file://geanydoc/COPYING;md5=d32239bcb673463ab874e80d47fae504"
-LICENSE_${PN}-geanydoc = "GPLv3"
-FILES_${PN}-geanydoc = "${libdir}/geany/geanydoc.so"
-RDEPENDS_${PN}-geanydoc = "${PN}"
-
-PLUGINS += "${PN}-geanyextrasel"
-LIC_FILES_CHKSUM += "file://geanyextrasel/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-geanyextrasel = "${libdir}/geany/geanyextrasel.so"
-RDEPENDS_${PN}-geanyextrasel = "${PN}"
-
-PLUGINS += "${PN}-geanyinsertnum"
-LIC_FILES_CHKSUM += "file://geanyinsertnum/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-geanyinsertnum = "${libdir}/geany/geanyinsertnum.so"
-RDEPENDS_${PN}-geanyinsertnum = "${PN}"
-
-PLUGINS += "${PN}-geanylatex"
-LIC_FILES_CHKSUM += "file://geanylatex/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-geanylatex = "${libdir}/geany/geanylatex.so"
-RDEPENDS_${PN}-geanylatex = "${PN}"
-
-PLUGINS += "${PN}-geanylipsum"
-LIC_FILES_CHKSUM += "file://geanylipsum/COPYING;md5=4325afd396febcb659c36b49533135d4"
-FILES_${PN}-geanylipsum = "${libdir}/geany/geanylipsum.so"
-RDEPENDS_${PN}-geanylipsum = "${PN}"
-
-# no lua: max supported version is 5.2
-EXTRA_OECONF += "--disable-geanylua"
-#PLUGINS += "${PN}-geanylua"
-#LIC_FILES_CHKSUM += "file://geanylua/COPYING;md5=4325afd396febcb659c36b49533135d4"
-#FILES_${PN}-geanylua = "${libdir}/geany/geanylua.so ${libdir}/${PN}/geanylua/*.so"
-#RDEPENDS_${PN}-geanylua = "${PN}"
-
-PLUGINS += "${PN}-geanymacro"
-LIC_FILES_CHKSUM += "file://geanymacro/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-geanymacro = "${libdir}/geany/geanymacro.so"
-RDEPENDS_${PN}-geanymacro = "${PN}"
-
-PLUGINS += "${PN}-geanyminiscript"
-LIC_FILES_CHKSUM += "file://geanyminiscript/COPYING;md5=4325afd396febcb659c36b49533135d4"
-FILES_${PN}-geanyminiscript = "${libdir}/geany/geanyminiscript.so"
-RDEPENDS_${PN}-geanyminiscript = "${PN}"
-
-PLUGINS += "${PN}-geanynumberedbookmarks"
-LIC_FILES_CHKSUM += "file://geanynumberedbookmarks/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-geanynumberedbookmarks = "${libdir}/geany/geanynumberedbookmarks.so"
-RDEPENDS_${PN}-geanynumberedbookmarks = "${PN}"
-
-PLUGINS += "${PN}-geanypg"
-LIC_FILES_CHKSUM += "file://geanypg/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-FILES_${PN}-geanypg = "${libdir}/geany/geanypg.so"
-RDEPENDS_${PN}-geanypg = "${PN}"
-
-PLUGINS += "${PN}-geanyprj"
-LIC_FILES_CHKSUM += "file://geanyprj/COPYING;md5=d32239bcb673463ab874e80d47fae504"
-LICENSE_${PN}-geanyprj = "GPLv3"
-FILES_${PN}-geanyprj = "${libdir}/geany/geanyprj.so"
-RDEPENDS_${PN}-geanyprj = "${PN}"
-
-# no gnome pygtk
-EXTRA_OECONF += "--disable-geanypy"
-#PLUGINS += "${PN}-geanypy"
-#LIC_FILES_CHKSUM += "file://geanypy/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-#FILES_${PN}-geanypy = "${libdir}/geany/geanypy.so"
-#RDEPENDS_${PN}-geanypy = "${PN}"
-
-PLUGINS += "${PN}-geanyvc"
-LIC_FILES_CHKSUM += "file://geanyvc/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-geanyvc = "${libdir}/geany/geanyvc.so"
-RDEPENDS_${PN}-geanyvc = "${PN}"
-
-PLUGINS += "${PN}-geniuspaste"
-LIC_FILES_CHKSUM += "file://geniuspaste/COPYING;md5=bfc203269f8862ebfc1198cdc809a95a"
-FILES_${PN}-geniuspaste = "${libdir}/geany/geniuspaste.so ${datadir}/${PN}/geniuspaste"
-RDEPENDS_${PN}-geniuspaste = "${PN}"
-
-PLUGINS += "${PN}-git-changebar"
-LIC_FILES_CHKSUM += "file://git-changebar/COPYING;md5=d32239bcb673463ab874e80d47fae504"
-LICENSE_${PN}-git-changebar = "GPLv3"
-FILES_${PN}-git-changebar = "${libdir}/geany/git-changebar.so"
-RDEPENDS_${PN}-git-changebar = "${PN}"
-
-PLUGINS += "${PN}-lineoperations"
-LIC_FILES_CHKSUM += "file://lineoperations/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-lineoperations = "${libdir}/geany/lineoperations.so"
-RDEPENDS_${PN}-lineoperations = "${PN}"
-
-# no markdown - avoid floating dependencies
-EXTRA_OECONF += " --disable-peg-markdown"
-#PLUGINS += "${PN}-markdown"
-#LIC_FILES_CHKSUM += "file://markdown/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-#FILES_${PN}-markdown = "${libdir}/geany/markdown.so"
-#RDEPENDS_${PN}-markdown = "${PN}"
-
-PLUGINS += "${PN}-multiterm"
-LIC_FILES_CHKSUM += "file://multiterm/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-FILES_${PN}-multiterm = "${libdir}/geany/multiterm.so"
-RDEPENDS_${PN}-multiterm = "${PN}"
-
-PLUGINS += "${PN}-overview"
-LIC_FILES_CHKSUM += "file://overview/overview/overviewplugin.c;beginline=4;endline=20;md5=1aa33522916cdeb46cccac0c629da0d0"
-FILES_${PN}-overview = "${libdir}/geany/overview.so ${datadir}/${PN}/overview"
-RDEPENDS_${PN}-overview = "${PN}"
-
-PLUGINS += "${PN}-pairtaghighlighter"
-LICENSE_${PN}-pairtaghighlighter = "BSD-2-Clause"
-LIC_FILES_CHKSUM += "file://pairtaghighlighter/COPYING;md5=d6d927525a612b3a8dbebc4b2e9b47c1"
-FILES_${PN}-pairtaghighlighter = "${libdir}/geany/pairtaghighlighter.so"
-RDEPENDS_${PN}-pairtaghighlighter = "${PN}"
-
-PLUGINS += "${PN}-pohelper"
-LICENSE_${PN}-pohelper = "GPLv3"
-LIC_FILES_CHKSUM += "file://pohelper/COPYING;md5=d32239bcb673463ab874e80d47fae504"
-FILES_${PN}-pohelper = "${libdir}/geany/pohelper.so"
-RDEPENDS_${PN}-pohelper = "${PN}"
-
-PLUGINS += "${PN}-pretty-printer"
-LIC_FILES_CHKSUM += "file://pretty-printer/src/PrettyPrinter.c;beginline=1;endline=17;md5=1665115c2fadb17c1b53cdb4e43b2440"
-FILES_${PN}-pretty-printer = "${libdir}/geany/pretty-printer.so"
-RDEPENDS_${PN}-pretty-printer = "${PN}"
-
-PLUGINS += "${PN}-projectorganizer"
-LIC_FILES_CHKSUM += "file://projectorganizer/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-projectorganizer = "${libdir}/geany/projectorganizer.so"
-RDEPENDS_${PN}-projectorganizer = "${PN}"
-
-PLUGINS += "${PN}-scope"
-LIC_FILES_CHKSUM += "file://scope/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-scope = "${libdir}/geany/scope.so"
-RDEPENDS_${PN}-scope = "${PN}"
-
-PLUGINS += "${PN}-sendmail"
-LIC_FILES_CHKSUM += "file://sendmail/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
-FILES_${PN}-sendmail = "${libdir}/geany/sendmail.so"
-RDEPENDS_${PN}-sendmail = "${PN}"
-
-PLUGINS += "${PN}-shiftcolumn"
-LIC_FILES_CHKSUM += "file://shiftcolumn/COPYING;md5=751419260aa954499f7abaabaa882bbe"
-FILES_${PN}-shiftcolumn = "${libdir}/geany/shiftcolumn.so"
-RDEPENDS_${PN}-shiftcolumn = "${PN}"
-
-PLUGINS += "${PN}-spellcheck"
-LIC_FILES_CHKSUM += "file://spellcheck/COPYING;md5=4325afd396febcb659c36b49533135d4"
-FILES_${PN}-spellcheck = "${libdir}/geany/spellcheck.so"
-RDEPENDS_${PN}-spellcheck = "${PN}"
-
-PLUGINS += "${PN}-tableconvert"
-LIC_FILES_CHKSUM += "file://tableconvert/COPYING;md5=6753686878d090a1f3f9445661d3dfbc"
-FILES_${PN}-tableconvert = "${libdir}/geany/tableconvert.so"
-RDEPENDS_${PN}-tableconvert = "${PN}"
-
-PLUGINS += "${PN}-treebrowser"
-LIC_FILES_CHKSUM += "file://treebrowser/README;beginline=67;endline=67;md5=52f90857fd1a9672111e472dd056a0d8"
-FILES_${PN}-treebrowser = "${libdir}/geany/treebrowser.so"
-RDEPENDS_${PN}-treebrowser = "${PN}"
-
-PLUGINS += "${PN}-updatechecker"
-LIC_FILES_CHKSUM += "file://updatechecker/COPYING;md5=4325afd396febcb659c36b49533135d4"
-FILES_${PN}-updatechecker = "${libdir}/geany/updatechecker.so"
-RDEPENDS_${PN}-updatechecker = "${PN}"
-
-# no webkit - lasts ages and is not properly detected
-EXTRA_OECONF += " --disable-webhelper"
-#PLUGINS += "${PN}-webhelper"
-#LIC_FILES_CHKSUM += "file://webhelper/COPYING;md5=d32239bcb673463ab874e80d47fae504"
-#LICENSE_${PN}-webhelper = "GPLv3"
-#FILES_${PN}-webhelper = "${libdir}/geany/webhelper.so"
-#RDEPENDS_${PN}-webhelper = "${PN}"
-
-PLUGINS += "${PN}-xmlsnippets"
-LIC_FILES_CHKSUM += "file://xmlsnippets/COPYING;md5=4325afd396febcb659c36b49533135d4"
-FILES_${PN}-xmlsnippets = "${libdir}/geany/xmlsnippets.so"
-RDEPENDS_${PN}-xmlsnippets = "${PN}"
-
-PACKAGES =+ "${PLUGINS}"
-RDEPENDS_${PN} = "${PLUGINS}"
-ALLOW_EMPTY_${PN} = "1"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany-plugins_1.30.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany-plugins_1.30.bb
new file mode 100644
index 0000000..f01dda8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany-plugins_1.30.bb
@@ -0,0 +1,263 @@
+DESCRIPTION = "A fast and lightweight IDE"
+HOMEPAGE = "http://plugins.geany.org/"
+
+LICENSE_DEFAULT = "GPLv2"
+LICENSE = "${LICENSE_DEFAULT} & BSD-2-Clause & GPLv3"
+
+python () {
+    for plugin in d.getVar('PLUGINS').split():
+        if 'LICENSE_%s' % plugin not in d:
+            d.setVar('LICENSE_' + plugin, '${LICENSE_DEFAULT}')
+}
+
+DEPENDS = " \
+    geany \
+    libxml2 \
+    libsoup-2.4 \
+    enchant \
+    intltool-native \
+    libassuan \
+    gpgme \
+    vte9 \
+    libgit2 \
+"
+
+inherit autotools pkgconfig gtk-icon-cache
+
+SRC_URI = "http://plugins.geany.org/${PN}/${PN}-${PV}.tar.bz2"
+SRC_URI[md5sum] = "13f8e5d900b4911059385649b8dde887"
+SRC_URI[sha256sum] = "8adb90645d273d9549e1fa99b69ea87dc1fd612f7467eb18eee11a6b30c9ba5b"
+
+do_configure_prepend() {
+    rm -f ${S}/build/cache/glib-gettext.m4
+}
+
+FILES_${PN} += "${datadir}/icons"
+FILES_${PN}-dev += "${libdir}/geany/*.la ${libdir}/${PN}/*/*.la"
+
+PLUGINS += "${PN}-addons"
+LIC_FILES_CHKSUM += "file://addons/COPYING;md5=4325afd396febcb659c36b49533135d4"
+FILES_${PN}-addons = "${libdir}/geany/addons.so"
+RDEPENDS_${PN}-addons = "${PN}"
+
+PLUGINS += "${PN}-autoclose"
+LIC_FILES_CHKSUM += "file://autoclose/COPYING;md5=751419260aa954499f7abaabaa882bbe"
+FILES_${PN}-autoclose = "${libdir}/geany/autoclose.so"
+RDEPENDS_${PN}-autoclose = "${PN}"
+
+PLUGINS += "${PN}-automark"
+LIC_FILES_CHKSUM += "file://automark/COPYING;md5=751419260aa954499f7abaabaa882bbe"
+FILES_${PN}-automark = "${libdir}/geany/automark.so"
+RDEPENDS_${PN}-automark = "${PN}"
+
+PLUGINS += "${PN}-codenav"
+LIC_FILES_CHKSUM += "file://codenav/COPYING;md5=751419260aa954499f7abaabaa882bbe"
+FILES_${PN}-codenav = "${libdir}/geany/codenav.so"
+RDEPENDS_${PN}-codenav = "${PN}"
+
+PLUGINS += "${PN}-commander"
+LIC_FILES_CHKSUM += "file://commander/COPYING;md5=d32239bcb673463ab874e80d47fae504"
+LICENSE_${PN}-commander = "GPLv3"
+FILES_${PN}-commander = "${libdir}/geany/commander.so"
+RDEPENDS_${PN}-commander = "${PN}"
+
+PLUGINS += "${PN}-debugger"
+LIC_FILES_CHKSUM += "file://debugger/COPYING;md5=4325afd396febcb659c36b49533135d4"
+FILES_${PN}-debugger = "${libdir}/geany/debugger.so ${datadir}/${PN}/debugger"
+RDEPENDS_${PN}-debugger = "${PN}"
+
+PLUGINS += "${PN}-defineformat"
+LIC_FILES_CHKSUM += "file://defineformat/COPYING;md5=751419260aa954499f7abaabaa882bbe"
+FILES_${PN}-defineformat = "${libdir}/geany/defineformat.so"
+RDEPENDS_${PN}-defineformat = "${PN}"
+
+# no gnome devhelp in some common layer
+EXTRA_OECONF += "--disable-devhelp"
+#PLUGINS += "${PN}-devhelp"
+#LIC_FILES_CHKSUM += "file://devhelp/COPYING;md5=d32239bcb673463ab874e80d47fae504"
+#LICENSE_${PN}-devhelp = "GPLv3"
+#FILES_${PN}-devhelp = "${libdir}/geany/devhelp.so"
+#RDEPENDS_${PN}-devhelp = "${PN}"
+
+PLUGINS += "${PN}-geanyctags"
+LIC_FILES_CHKSUM += "file://geanyctags/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-geanyctags = "${libdir}/geany/geanyctags.so"
+RDEPENDS_${PN}-geanyctags = "${PN}"
+
+PLUGINS += "${PN}-geanydoc"
+LIC_FILES_CHKSUM += "file://geanydoc/COPYING;md5=d32239bcb673463ab874e80d47fae504"
+LICENSE_${PN}-geanydoc = "GPLv3"
+FILES_${PN}-geanydoc = "${libdir}/geany/geanydoc.so"
+RDEPENDS_${PN}-geanydoc = "${PN}"
+
+PLUGINS += "${PN}-geanyextrasel"
+LIC_FILES_CHKSUM += "file://geanyextrasel/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-geanyextrasel = "${libdir}/geany/geanyextrasel.so"
+RDEPENDS_${PN}-geanyextrasel = "${PN}"
+
+PLUGINS += "${PN}-geanyinsertnum"
+LIC_FILES_CHKSUM += "file://geanyinsertnum/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-geanyinsertnum = "${libdir}/geany/geanyinsertnum.so"
+RDEPENDS_${PN}-geanyinsertnum = "${PN}"
+
+PLUGINS += "${PN}-geanylatex"
+LIC_FILES_CHKSUM += "file://geanylatex/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-geanylatex = "${libdir}/geany/geanylatex.so"
+RDEPENDS_${PN}-geanylatex = "${PN}"
+
+PLUGINS += "${PN}-geanylipsum"
+LIC_FILES_CHKSUM += "file://lipsum/COPYING;md5=4325afd396febcb659c36b49533135d4"
+FILES_${PN}-geanylipsum = "${libdir}/geany/lipsum.so"
+RDEPENDS_${PN}-geanylipsum = "${PN}"
+
+# no lua: max supported version is 5.2
+EXTRA_OECONF += "--disable-geanylua"
+#PLUGINS += "${PN}-geanylua"
+#LIC_FILES_CHKSUM += "file://geanylua/COPYING;md5=4325afd396febcb659c36b49533135d4"
+#FILES_${PN}-geanylua = "${libdir}/geany/geanylua.so ${libdir}/${PN}/geanylua/*.so"
+#RDEPENDS_${PN}-geanylua = "${PN}"
+
+PLUGINS += "${PN}-geanymacro"
+LIC_FILES_CHKSUM += "file://geanymacro/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-geanymacro = "${libdir}/geany/geanymacro.so"
+RDEPENDS_${PN}-geanymacro = "${PN}"
+
+PLUGINS += "${PN}-geanyminiscript"
+LIC_FILES_CHKSUM += "file://geanyminiscript/COPYING;md5=4325afd396febcb659c36b49533135d4"
+FILES_${PN}-geanyminiscript = "${libdir}/geany/geanyminiscript.so"
+RDEPENDS_${PN}-geanyminiscript = "${PN}"
+
+PLUGINS += "${PN}-geanynumberedbookmarks"
+LIC_FILES_CHKSUM += "file://geanynumberedbookmarks/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-geanynumberedbookmarks = "${libdir}/geany/geanynumberedbookmarks.so"
+RDEPENDS_${PN}-geanynumberedbookmarks = "${PN}"
+
+PLUGINS += "${PN}-geanypg"
+LIC_FILES_CHKSUM += "file://geanypg/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+FILES_${PN}-geanypg = "${libdir}/geany/geanypg.so"
+RDEPENDS_${PN}-geanypg = "${PN}"
+
+PLUGINS += "${PN}-geanyprj"
+LIC_FILES_CHKSUM += "file://geanyprj/COPYING;md5=d32239bcb673463ab874e80d47fae504"
+LICENSE_${PN}-geanyprj = "GPLv3"
+FILES_${PN}-geanyprj = "${libdir}/geany/geanyprj.so"
+RDEPENDS_${PN}-geanyprj = "${PN}"
+
+# no gnome pygtk
+EXTRA_OECONF += "--disable-geanypy"
+#PLUGINS += "${PN}-geanypy"
+#LIC_FILES_CHKSUM += "file://geanypy/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+#FILES_${PN}-geanypy = "${libdir}/geany/geanypy.so"
+#RDEPENDS_${PN}-geanypy = "${PN}"
+
+PLUGINS += "${PN}-geanyvc"
+LIC_FILES_CHKSUM += "file://geanyvc/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-geanyvc = "${libdir}/geany/geanyvc.so"
+RDEPENDS_${PN}-geanyvc = "${PN}"
+
+PLUGINS += "${PN}-geniuspaste"
+LIC_FILES_CHKSUM += "file://geniuspaste/COPYING;md5=bfc203269f8862ebfc1198cdc809a95a"
+FILES_${PN}-geniuspaste = "${libdir}/geany/geniuspaste.so ${datadir}/${PN}/geniuspaste"
+RDEPENDS_${PN}-geniuspaste = "${PN}"
+
+PLUGINS += "${PN}-git-changebar"
+LIC_FILES_CHKSUM += "file://git-changebar/COPYING;md5=d32239bcb673463ab874e80d47fae504"
+LICENSE_${PN}-git-changebar = "GPLv3"
+FILES_${PN}-git-changebar = "${libdir}/geany/git-changebar.so"
+RDEPENDS_${PN}-git-changebar = "${PN}"
+
+PLUGINS += "${PN}-lineoperations"
+LIC_FILES_CHKSUM += "file://lineoperations/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-lineoperations = "${libdir}/geany/lineoperations.so"
+RDEPENDS_${PN}-lineoperations = "${PN}"
+
+# no markdown - avoid floating dependencies
+EXTRA_OECONF += " --disable-peg-markdown"
+#PLUGINS += "${PN}-markdown"
+#LIC_FILES_CHKSUM += "file://markdown/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+#FILES_${PN}-markdown = "${libdir}/geany/markdown.so"
+#RDEPENDS_${PN}-markdown = "${PN}"
+
+PLUGINS += "${PN}-multiterm"
+LIC_FILES_CHKSUM += "file://multiterm/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+FILES_${PN}-multiterm = "${libdir}/geany/multiterm.so"
+RDEPENDS_${PN}-multiterm = "${PN}"
+
+PLUGINS += "${PN}-overview"
+LIC_FILES_CHKSUM += "file://overview/overview/overviewplugin.c;beginline=4;endline=20;md5=1aa33522916cdeb46cccac0c629da0d0"
+FILES_${PN}-overview = "${libdir}/geany/overview.so ${datadir}/${PN}/overview"
+RDEPENDS_${PN}-overview = "${PN}"
+
+PLUGINS += "${PN}-pairtaghighlighter"
+LICENSE_${PN}-pairtaghighlighter = "BSD-2-Clause"
+LIC_FILES_CHKSUM += "file://pairtaghighlighter/COPYING;md5=d6d927525a612b3a8dbebc4b2e9b47c1"
+FILES_${PN}-pairtaghighlighter = "${libdir}/geany/pairtaghighlighter.so"
+RDEPENDS_${PN}-pairtaghighlighter = "${PN}"
+
+PLUGINS += "${PN}-pohelper"
+LICENSE_${PN}-pohelper = "GPLv3"
+LIC_FILES_CHKSUM += "file://pohelper/COPYING;md5=d32239bcb673463ab874e80d47fae504"
+FILES_${PN}-pohelper = "${libdir}/geany/pohelper.so"
+RDEPENDS_${PN}-pohelper = "${PN}"
+
+PLUGINS += "${PN}-pretty-printer"
+LIC_FILES_CHKSUM += "file://pretty-printer/src/PrettyPrinter.c;beginline=1;endline=17;md5=1665115c2fadb17c1b53cdb4e43b2440"
+FILES_${PN}-pretty-printer = "${libdir}/geany/pretty-printer.so"
+RDEPENDS_${PN}-pretty-printer = "${PN}"
+
+PLUGINS += "${PN}-projectorganizer"
+LIC_FILES_CHKSUM += "file://projectorganizer/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-projectorganizer = "${libdir}/geany/projectorganizer.so"
+RDEPENDS_${PN}-projectorganizer = "${PN}"
+
+PLUGINS += "${PN}-scope"
+LIC_FILES_CHKSUM += "file://scope/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-scope = "${libdir}/geany/scope.so"
+RDEPENDS_${PN}-scope = "${PN}"
+
+PLUGINS += "${PN}-sendmail"
+LIC_FILES_CHKSUM += "file://sendmail/COPYING;md5=c107cf754550e65755c42985a5d4e9c9"
+FILES_${PN}-sendmail = "${libdir}/geany/sendmail.so"
+RDEPENDS_${PN}-sendmail = "${PN}"
+
+PLUGINS += "${PN}-shiftcolumn"
+LIC_FILES_CHKSUM += "file://shiftcolumn/COPYING;md5=751419260aa954499f7abaabaa882bbe"
+FILES_${PN}-shiftcolumn = "${libdir}/geany/shiftcolumn.so"
+RDEPENDS_${PN}-shiftcolumn = "${PN}"
+
+PLUGINS += "${PN}-spellcheck"
+LIC_FILES_CHKSUM += "file://spellcheck/COPYING;md5=4325afd396febcb659c36b49533135d4"
+FILES_${PN}-spellcheck = "${libdir}/geany/spellcheck.so"
+RDEPENDS_${PN}-spellcheck = "${PN}"
+
+PLUGINS += "${PN}-tableconvert"
+LIC_FILES_CHKSUM += "file://tableconvert/COPYING;md5=6753686878d090a1f3f9445661d3dfbc"
+FILES_${PN}-tableconvert = "${libdir}/geany/tableconvert.so"
+RDEPENDS_${PN}-tableconvert = "${PN}"
+
+PLUGINS += "${PN}-treebrowser"
+LIC_FILES_CHKSUM += "file://treebrowser/README;beginline=67;endline=67;md5=52f90857fd1a9672111e472dd056a0d8"
+FILES_${PN}-treebrowser = "${libdir}/geany/treebrowser.so"
+RDEPENDS_${PN}-treebrowser = "${PN}"
+
+PLUGINS += "${PN}-updatechecker"
+LIC_FILES_CHKSUM += "file://updatechecker/COPYING;md5=4325afd396febcb659c36b49533135d4"
+FILES_${PN}-updatechecker = "${libdir}/geany/updatechecker.so"
+RDEPENDS_${PN}-updatechecker = "${PN}"
+
+# no webkit - lasts ages and is not properly detected
+EXTRA_OECONF += " --disable-webhelper"
+#PLUGINS += "${PN}-webhelper"
+#LIC_FILES_CHKSUM += "file://webhelper/COPYING;md5=d32239bcb673463ab874e80d47fae504"
+#LICENSE_${PN}-webhelper = "GPLv3"
+#FILES_${PN}-webhelper = "${libdir}/geany/webhelper.so"
+#RDEPENDS_${PN}-webhelper = "${PN}"
+
+PLUGINS += "${PN}-xmlsnippets"
+LIC_FILES_CHKSUM += "file://xmlsnippets/COPYING;md5=4325afd396febcb659c36b49533135d4"
+FILES_${PN}-xmlsnippets = "${libdir}/geany/xmlsnippets.so"
+RDEPENDS_${PN}-xmlsnippets = "${PN}"
+
+PACKAGES =+ "${PLUGINS}"
+RDEPENDS_${PN} = "${PLUGINS}"
+ALLOW_EMPTY_${PN} = "1"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany/0001-configure.ac-remove-additional-c-test.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany/0001-configure.ac-remove-additional-c-test.patch
deleted file mode 100644
index 5166fec..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany/0001-configure.ac-remove-additional-c-test.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From e62d5b59262ec7ffe07931790712c7e247377795 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
-Date: Thu, 21 Feb 2013 09:31:31 +0100
-Subject: [PATCH] configure.ac remove additional c++ test
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-For openembedded cross-builds CXX can contain something like:
-
-arm-oe-linux-gnueabi-g++  -march=armv5te  -marm -mthumb-interwork --sysroot=/home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/sysroots/qemuarm
-
-This ends up in
-
-configure:5582: error: No C++ compiler found. Please install a C++ compiler.
-
-Anyway if [1] is still valid, the combination of AC_PROG_CC and AC_PROG_CXX
-should thow an error message.
-
-[1] http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
----
- configure.ac |    5 -----
- 1 files changed, 0 insertions(+), 5 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index c37312a..742bf35 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -26,11 +26,6 @@ AC_USE_SYSTEM_EXTENSIONS
- AC_PROG_CC
- 
- AC_PROG_CXX
--# check for C++ compiler explicitly and fail if none is found, do this check
--# after AC_PROG_CXX has set the CXX environment variable
--if ! which $CXX >/dev/null 2>&1; then
--	AC_MSG_ERROR([No C++ compiler found. Please install a C++ compiler.])
--fi
- 
- AC_PROG_INSTALL
- AC_PROG_LN_S
--- 
-1.7.6.5
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany_1.28.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany_1.28.bb
deleted file mode 100644
index da97090..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany_1.28.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "A fast and lightweight IDE"
-HOMEPAGE = "http://www.geany.org/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=bd7b2c994af21d318bd2cd3b3f80c2d5"
-DEPENDS = "gtk+ python3-docutils-native"
-
-inherit autotools pkgconfig perlnative pythonnative
-
-SRC_URI = " \
-    http://download.geany.org/${BP}.tar.bz2 \
-    file://0001-configure.ac-remove-additional-c-test.patch \
-"
-SRC_URI[md5sum] = "39a29deb598e9e3503ee7d9d5fb51a34"
-SRC_URI[sha256sum] = "f73a3708f1a26e9bf72da564d5037d6f7fedca2e0d6175db0681c2b672100a5a"
-
-FILES_${PN} += "${datadir}/icons"
-
-EXTRA_OECONF = "--disable-html-docs"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany_1.30.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany_1.30.1.bb
new file mode 100644
index 0000000..e316ea7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/geany/geany_1.30.1.bb
@@ -0,0 +1,16 @@
+SUMMARY = "A fast and lightweight IDE"
+HOMEPAGE = "http://www.geany.org/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bd7b2c994af21d318bd2cd3b3f80c2d5"
+
+DEPENDS = "gtk+ libxml-parser-perl-native python3-docutils-native intltool-native"
+
+inherit autotools pkgconfig perlnative pythonnative gettext
+
+SRC_URI = "http://download.geany.org/${BP}.tar.bz2"
+SRC_URI[md5sum] = "75081b600560c5c8366eda0e1b8cc531"
+SRC_URI[sha256sum] = "0ac360f1f3d6c28790a81d570252a7d40421f6e1d8e5a8d653756bd041d88491"
+
+FILES_${PN} += "${datadir}/icons"
+
+EXTRA_OECONF = "--disable-html-docs"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/glade/glade3/0001-Add-G_GNUC_PRINTF-on-functions-with-format-strings.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/glade/glade3/0001-Add-G_GNUC_PRINTF-on-functions-with-format-strings.patch
new file mode 100644
index 0000000..03cb762
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/glade/glade3/0001-Add-G_GNUC_PRINTF-on-functions-with-format-strings.patch
@@ -0,0 +1,62 @@
+From fcf29abe59607b5791f9de18ddb86b9ae3c9b7cc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 23:50:05 -0700
+Subject: [PATCH] Add G_GNUC_PRINTF on functions with format strings
+
+This allows compilation with clang without errors, even when
+-Wformat-nonliteral is active (as long as there are no real cases of
+non literal formatting).
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gladeui/glade-command.c | 4 ++--
+ gladeui/glade-utils.c   | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gladeui/glade-command.c b/gladeui/glade-command.c
+index 9819766..4ac40ee 100644
+--- a/gladeui/glade-command.c
++++ b/gladeui/glade-command.c
+@@ -266,7 +266,7 @@ glade_command_collapse (GladeCommand  *command,
+  *
+  * Marks the begining of a group.
+  */
+-void
++G_GNUC_PRINTF(1, 2) void
+ glade_command_push_group (const gchar *fmt, ...)
+ {
+ 	va_list         args;
+@@ -655,7 +655,7 @@ glade_command_set_properties_list (GladeProject *project, GList *props)
+ 
+ 	multiple = g_list_length (me->sdata) > 1;
+ 	if (multiple)
+-		glade_command_push_group (cmd->description);
++		glade_command_push_group ("%s", cmd->description);
+ 
+ 
+ 	glade_command_check_group (GLADE_COMMAND (me));
+diff --git a/gladeui/glade-utils.c b/gladeui/glade-utils.c
+index ae52501..c51ae59 100644
+--- a/gladeui/glade-utils.c
++++ b/gladeui/glade-utils.c
+@@ -197,7 +197,7 @@ glade_utils_get_pspec_from_funcname (const gchar *funcname)
+  *          selected "OK", True if the @type was GLADE_UI_YES_OR_NO and
+  *          the user selected "YES"; False otherwise.
+  */
+-gint
++G_GNUC_PRINTF(4, 5) gint
+ glade_util_ui_message (GtkWidget           *parent, 
+ 		       GladeUIMessageType   type,
+ 		       GtkWidget           *widget,
+@@ -320,7 +320,7 @@ remove_message_timeout (FlashInfo * fi)
+  *
+  * Flash a temporary message on the statusbar.
+  */
+-void
++G_GNUC_PRINTF(3, 4) void
+ glade_util_flash_message (GtkWidget *statusbar, guint context_id, gchar *format, ...)
+ {
+ 	va_list args;
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/glade/glade3_3.8.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/glade/glade3_3.8.5.bb
index fd65536..c4f6000 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/glade/glade3_3.8.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/glade/glade3_3.8.5.bb
@@ -8,11 +8,11 @@
 
 inherit autotools pkgconfig pythonnative gtk-icon-cache
 
-SRC_URI = " \
-    http://ftp.gnome.org/pub/GNOME/sources/glade3/3.8/glade3-${PV}.tar.xz \
-    file://0001-gnome-doc-utils.make-sysrooted-pkg-config.patch \
-    file://0002-fix-gcc-6-build.patch \
-"
+SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/glade3/3.8/glade3-${PV}.tar.xz \
+           file://0001-gnome-doc-utils.make-sysrooted-pkg-config.patch \
+           file://0002-fix-gcc-6-build.patch \
+           file://0001-Add-G_GNUC_PRINTF-on-functions-with-format-strings.patch \
+           "
 SRC_URI[md5sum] = "4e4b4f5ee34a03e017e4cef97d796c1f"
 SRC_URI[sha256sum] = "58a5f6e4df4028230ddecc74c564808b7ec4471b1925058e29304f778b6b2735"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Adjust-the-cmake-files.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Adjust-the-cmake-files.patch
new file mode 100644
index 0000000..f7030c5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Adjust-the-cmake-files.patch
@@ -0,0 +1,145 @@
+From d8986cb065e770017ee1622fb7324387ead60203 Mon Sep 17 00:00:00 2001
+From: Ming Liu <peter.x.liu@external.atlascopco.com>
+Date: Tue, 7 Mar 2017 11:46:52 +0100
+Subject: [PATCH] Adjust the cmake files
+
+- Remove json_test which can not build with boost 1.61.0.
+- Build shared library as well with the original static library.
+- Add FindLibJsonSpirit.cmake to be able to be found by the dependers.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
+---
+ CMakeLists.txt             |  8 +++---
+ FindLibJsonSpirit.cmake    | 64 ++++++++++++++++++++++++++++++++++++++++++++++
+ json_spirit/CMakeLists.txt | 16 +++++++++++-
+ 3 files changed, 83 insertions(+), 5 deletions(-)
+ create mode 100644 FindLibJsonSpirit.cmake
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4637a6c..b292f0f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+ 
+ PROJECT(json_spirit)
+-SUBDIRS(json_spirit json_demo json_headers_only_demo json_map_demo json_test)
++SUBDIRS(json_spirit json_demo json_headers_only_demo json_map_demo)
+ INCLUDE_DIRECTORIES(json_spirit)
+ 
+ INSTALL(
+@@ -16,11 +16,11 @@ INSTALL(
+   ${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer.h
+   ${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer_template.h
+   ${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer_options.h
+-  DESTINATION include)
++  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ INSTALL(
+   FILES
+-  ${CMAKE_BINARY_DIR}/json_spirit/libjson_spirit.a
+-  DESTINATION lib)
++  ${CMAKE_SOURCE_DIR}/FindLibJsonSpirit.cmake
++  DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules)
+ 
+ INCLUDE(CPack)
+diff --git a/FindLibJsonSpirit.cmake b/FindLibJsonSpirit.cmake
+new file mode 100644
+index 0000000..7ee7687
+--- /dev/null
++++ b/FindLibJsonSpirit.cmake
+@@ -0,0 +1,64 @@
++# FindLibJsonSpirit - Find libjson_spirit headers and libraries.
++#
++# Sample:
++#
++#   SET( LibJsonSpirit_USE_STATIC_LIBS OFF )
++#   FIND_PACKAGE( LibJsonSpirit REQUIRED )
++#   IF( LibJsonSpirit_FOUND )
++#      INCLUDE_DIRECTORIES( ${LibJsonSpirit_INCLUDE_DIRS} )
++#      TARGET_LINK_LIBRARIES( ... ${LibJsonSpirit_LIBRARIES} )
++#   ENDIF()
++#
++# Variables used by this module need to be set before calling find_package
++#
++#   LibJsonSpirit_USE_STATIC_LIBS	Can be set to ON to force the use of the static
++#					libjson_spirit libraries. Defaults to OFF.
++#
++# Variables provided by this module:
++#
++#   LibJsonSpirit_FOUND		Include dir, libjson_spirit libraries.
++#
++#   LibJsonSpirit_LIBRARIES	Link to these to use all the libraries you specified.
++#
++#   LibJsonSpirit_INCLUDE_DIRS	Include directories.
++#
++# For each component you specify in find_package(), the following (UPPER-CASE)
++# variables are set to pick and choose components instead of just using
++# LibJsonSpirit_LIBRARIES:
++#
++#   LIBJSONSPIRIT_FOUND			TRUE if libjson_spirit was found
++#   LIBJSONSPIRIT_LIBRARY		libjson_spirit library
++#
++
++# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
++IF(LibJsonSpirit_USE_STATIC_LIBS)
++    SET( _ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
++    SET(CMAKE_FIND_LIBRARY_SUFFIXES .a )
++ENDIF()
++
++# Look for the header files
++UNSET(LibJsonSpirit_INCLUDE_DIRS CACHE)
++FIND_PATH(LibJsonSpirit_INCLUDE_DIRS NAMES json_spirit.h)
++
++# Look for the core library
++UNSET(LIBJSONSPIRIT_LIBRARY CACHE)
++FIND_LIBRARY(LIBJSONSPIRIT_LIBRARY NAMES json_spirit)
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibJsonSpirit DEFAULT_MSG LIBJSONSPIRIT_LIBRARY LibJsonSpirit_INCLUDE_DIRS)
++MARK_AS_ADVANCED(
++    LIBJSONSPIRIT_FOUND
++    LIBJSONSPIRIT_LIBRARY
++)
++
++# Prepare return values and collectiong more components
++SET(LibJsonSpirit_FOUND ${LIBJSONSPIRIT_FOUND})
++SET(LibJsonSpirit_LIBRARIES ${LIBJSONSPIRIT_LIBRARY})
++MARK_AS_ADVANCED(
++    LibJsonSpirit_FOUND
++    LibJsonSpirit_LIBRARIES
++    LibJsonSpirit_INCLUDE_DIRS
++)
++
++# Restore CMAKE_FIND_LIBRARY_SUFFIXES
++IF(LibJsonSpirit_USE_STATIC_LIBS)
++    SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES} )
++ENDIF()
+diff --git a/json_spirit/CMakeLists.txt b/json_spirit/CMakeLists.txt
+index fb52818..c1613b2 100644
+--- a/json_spirit/CMakeLists.txt
++++ b/json_spirit/CMakeLists.txt
+@@ -13,5 +13,19 @@ json_spirit_writer_template.h )
+ FIND_PACKAGE(Boost 1.34 REQUIRED)
+ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
+ 
+-ADD_LIBRARY(json_spirit STATIC ${JSON_SPIRIT_SRCS})
++SET(JSONSPIRIT_SOVERSION_MAJOR "4")
++SET(JSONSPIRIT_SOVERSION_MINOR "0")
++SET(JSONSPIRIT_SOVERSION_PATCH "8")
+ 
++ADD_LIBRARY(json_spirit SHARED ${JSON_SPIRIT_SRCS})
++SET_TARGET_PROPERTIES(json_spirit PROPERTIES PROJECT_LABEL "Json Spirit Library")
++SET_TARGET_PROPERTIES(json_spirit PROPERTIES COMPILE_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
++SET_TARGET_PROPERTIES(json_spirit PROPERTIES VERSION ${JSONSPIRIT_SOVERSION_MAJOR}.${JSONSPIRIT_SOVERSION_MINOR}.${JSONSPIRIT_SOVERSION_PATCH})
++SET_TARGET_PROPERTIES(json_spirit PROPERTIES SOVERSION ${JSONSPIRIT_SOVERSION_MAJOR})
++INSTALL(TARGETS json_spirit DESTINATION ${CMAKE_INSTALL_LIBDIR})
++
++ADD_LIBRARY(json_spirit_static STATIC ${JSON_SPIRIT_SRCS})
++SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES PROJECT_LABEL "Json Spirit Static Library")
++SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES OUTPUT_NAME "json_spirit")
++SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES SOVERSION ${JSONSPIRIT_SOVERSION_MAJOR})
++INSTALL(TARGETS json_spirit_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/json_spirit_v4.08.zip b/import-layers/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/json_spirit_v4.08.zip
new file mode 100644
index 0000000..27d46b1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit/json_spirit_v4.08.zip
Binary files differ
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb
new file mode 100644
index 0000000..2f456bf
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb
@@ -0,0 +1,26 @@
+SUMMARY = "A C++ JSON Parser/Generator Implemented with Boost Spirit."
+DESCRIPTION = "JSON Spirit, a C++ library that reads and writes JSON files or streams. \
+It is written using the Boost Spirit parser generator. If you are \
+already using Boost, you can use JSON Spirit without any additional \
+dependencies."
+HOMEPAGE = "https://www.codeproject.com/kb/recipes/json_spirit.aspx"
+SECTION = "libs"
+PRIORITY = "optional"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=278ef6183dec4aae1524fccc4b0113c9"
+
+SRC_URI = "file://json_spirit_v${PV}.zip \
+           file://0001-Adjust-the-cmake-files.patch \
+"
+
+S = "${WORKDIR}/json_spirit_v${PV}"
+
+DEPENDS = "boost"
+
+LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
+
+inherit cmake
+
+FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibJsonSpirit.cmake"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.8.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.8.0.bb
new file mode 100644
index 0000000..fe6ae24
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.8.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "JSON C++ lib used to read and write json file."
+DESCRIPTION = "Jsoncpp is an implementation of a JSON (http://json.org) reader \
+               and writer in C++. JSON (JavaScript Object Notation) is a \
+               lightweight data-interchange format. It is easy for humans to \
+               read and write. It is easy for machines to parse and generate."
+
+HOMEPAGE = "https://github.com/open-source-parsers/jsoncpp"
+
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c56ee55c03a55f8105b969d8270632ce"
+
+SRCREV = "f700fe455940d4d325c088b9174a173e130e0fa8"
+SRC_URI = "git://github.com/open-source-parsers/jsoncpp"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON -DJSONCPP_WITH_TESTS=OFF"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-cmake-replace-hardcoded-lib-CMAKE_LIBRARY_PATH-with-.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-cmake-replace-hardcoded-lib-CMAKE_LIBRARY_PATH-with-.patch
new file mode 100644
index 0000000..748e4da
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-cmake-replace-hardcoded-lib-CMAKE_LIBRARY_PATH-with-.patch
@@ -0,0 +1,77 @@
+From ac61124df17ab76527508bbb9a3115d4d6cc1af6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 21 Nov 2016 11:26:26 -0800
+Subject: [PATCH] cmake: replace hardcoded lib/${CMAKE_LIBRARY_PATH} with
+ {CMAKE_INSTALL_LIBDIR}
+
+Fixes
+| CMake Error at src/jsonrpccpp/CMakeLists.txt:207 (install):
+|   install TARGETS given unknown argument "/lib".
+
+and
+
+Wrong install paths during cross compile
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/jsonrpccpp/CMakeLists.txt    | 8 ++++----
+ src/stubgenerator/CMakeLists.txt | 6 +++---
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/src/jsonrpccpp/CMakeLists.txt b/src/jsonrpccpp/CMakeLists.txt
+index e4a1eb5..13f9056 100644
+--- a/src/jsonrpccpp/CMakeLists.txt
++++ b/src/jsonrpccpp/CMakeLists.txt
+@@ -205,15 +205,15 @@ if (WIN32)
+ endif()
+ 
+ install(TARGETS ${ALL_LIBS}
+-	LIBRARY DESTINATION lib${LIB_SUFFIX}/${CMAKE_LIBRARY_PATH}
+-	ARCHIVE DESTINATION lib${LIB_SUFFIX}/${CMAKE_LIBRARY_PATH}
++	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ 	RUNTIME DESTINATION bin
+ )
+ 
+ #set pkg-config
+ get_filename_component(FULL_PATH_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE)
+ set(FULL_PATH_INCLUDEDIR "${FULL_PATH_INSTALL_PREFIX}/include")
+-set(FULL_PATH_LIBDIR "${FULL_PATH_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_PATH}")
++set(FULL_PATH_LIBDIR "${FULL_PATH_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+ 
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/libjsonrpccpp-client.pc.cmake ${CMAKE_BINARY_DIR}/libjsonrpccpp-client.pc)
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/libjsonrpccpp-server.pc.cmake ${CMAKE_BINARY_DIR}/libjsonrpccpp-server.pc)
+@@ -223,6 +223,6 @@ INSTALL(FILES
+     "${CMAKE_BINARY_DIR}/libjsonrpccpp-server.pc"
+     "${CMAKE_BINARY_DIR}/libjsonrpccpp-client.pc"
+     "${CMAKE_BINARY_DIR}/libjsonrpccpp-common.pc"
+-    DESTINATION "lib${LIB_SUFFIX}/${CMAKE_LIBRARY_PATH}/pkgconfig")
++    DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ 
+ 
+diff --git a/src/stubgenerator/CMakeLists.txt b/src/stubgenerator/CMakeLists.txt
+index f9dbe4c..b57b0fe 100644
+--- a/src/stubgenerator/CMakeLists.txt
++++ b/src/stubgenerator/CMakeLists.txt
+@@ -58,15 +58,15 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/libjsonrpccpp-stub.pc.cmake ${CMAKE_BIN
+ 
+ INSTALL(FILES
+     "${CMAKE_BINARY_DIR}/libjsonrpccpp-stub.pc"
+-    DESTINATION "lib/${CMAKE_LIBRARY_PATH}/pkgconfig")
++    DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ 
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/stubgenerator/
+         DESTINATION include/jsonrpccpp/stubgen
+         FILES_MATCHING PATTERN "*.h")
+ 
+ install(TARGETS ${ALL_LIBS} jsonrpcstub
+-        LIBRARY DESTINATION lib${LIB_SUFFIX}/${CMAKE_LIBRARY_PATH}
+-        ARCHIVE DESTINATION lib${LIB_SUFFIX}/${CMAKE_LIBRARY_PATH}
++        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+         RUNTIME DESTINATION bin
+ )
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorclient-Typecast-min-arguments-correctl.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorclient-Typecast-min-arguments-correctl.patch
new file mode 100644
index 0000000..d21e979
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorclient-Typecast-min-arguments-correctl.patch
@@ -0,0 +1,33 @@
+From 9500f12f5d827840634311d6ca972d9551211e4d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 21 Nov 2016 01:00:51 -0800
+Subject: [PATCH] filedescriptorclient: Typecast min() arguments correctly
+
+Fixes
+
+| /mnt/a/build/tmp-glibc/work/cortexa7hf-neon-vfpv4-oe-linux-gnueabi/jsonrpc/0.7.0-r0/git/src/jsonrpccp
+p/client/connectors/filedescriptorclient.cpp:47:92: note:   deduced conflicting types for parameter 'co
+nst _Tp' ('unsigned int' and 'long unsigned int')
+|      ssize_t byteWritten = write(outputfd, toSend.c_str(), min(toSend.size(), MAX_WRITE_SIZE));
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/jsonrpccpp/client/connectors/filedescriptorclient.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp b/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp
+index 77aac7e..6325b5c 100644
+--- a/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp
++++ b/src/jsonrpccpp/client/connectors/filedescriptorclient.cpp
+@@ -43,7 +43,7 @@ void FileDescriptorClient::SendRPCMessage(const std::string& message,
+   string toSend = message;
+   do
+   {
+-    ssize_t byteWritten = write(outputfd, toSend.c_str(), min(toSend.size(), MAX_WRITE_SIZE));
++    ssize_t byteWritten = write(outputfd, toSend.c_str(), min((long unsigned int)toSend.size(), MAX_WRITE_SIZE));
+     if (byteWritten < 1)
+       throw JsonRpcException(Errors::ERROR_CLIENT_CONNECTOR,
+         "Unknown error occured while writing to the output file descriptor");
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorserver-Include-sys-select.h-before-oth.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorserver-Include-sys-select.h-before-oth.patch
new file mode 100644
index 0000000..3b9068a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-filedescriptorserver-Include-sys-select.h-before-oth.patch
@@ -0,0 +1,34 @@
+From c7aad10628949e126f50e3264b5bc7eb417347c6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 21 Nov 2016 01:25:10 -0800
+Subject: [PATCH] filedescriptorserver: Include sys/select.h before other
+ headers
+
+Fixes errors e.g.
+| /mnt/a/build/tmp-glibc/work/cortexa7hf-neon-vfpv4-oe-linux-gnueabi/jsonrpc/0.7.0-r0/git/src/jsonrpccp
+p/server/connectors/filedescriptorserver.h:63:7: error: unknown type name 'fd_set'
+|       fd_set read_fds;
+|       ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/jsonrpccpp/server/connectors/filedescriptorserver.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp b/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp
+index 9d74223..8e019ca 100644
+--- a/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp
++++ b/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp
+@@ -7,8 +7,8 @@
+  * @license See attached LICENSE.txt
+  ************************************************************************/
+ 
+-#include "filedescriptorserver.h"
+ #include <sys/select.h>
++#include "filedescriptorserver.h"
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-memset-and-family-needs-to-include-string.h.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-memset-and-family-needs-to-include-string.h.patch
new file mode 100644
index 0000000..21ef98b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0001-memset-and-family-needs-to-include-string.h.patch
@@ -0,0 +1,26 @@
+From f5416f1c2b2989f94163a2ae4b91c9b9fa13c620 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 13:32:31 -0700
+Subject: [PATCH 1/2] memset() and family needs to include string.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp b/src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp
+index 9fca57b..e63c49e 100644
+--- a/src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp
++++ b/src/jsonrpccpp/server/connectors/unixdomainsocketserver.cpp
+@@ -16,7 +16,7 @@
+ #include <cstdio>
+ #include <fcntl.h>
+ #include <unistd.h>
+-#include <string>
++#include <cstring>
+ 
+ using namespace jsonrpc;
+ using namespace std;
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0002-Fix-build-problem-on-Mac.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0002-Fix-build-problem-on-Mac.patch
new file mode 100644
index 0000000..aece45b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc/0002-Fix-build-problem-on-Mac.patch
@@ -0,0 +1,27 @@
+From 79050ef9607f242e0d509969b19e9390220c3411 Mon Sep 17 00:00:00 2001
+From: Yongwei Wu <wuyongwei@gmail.com>
+Date: Sat, 31 Dec 2016 11:57:11 +0800
+Subject: [PATCH 2/2] Fix build problem on Mac.
+
+__suseconds_t is not defined on Mac/BSD; use the POSIX-conformant
+suseconds_t.
+---
+ src/jsonrpccpp/server/connectors/filedescriptorserver.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp b/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp
+index 8e019ca..68107f2 100644
+--- a/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp
++++ b/src/jsonrpccpp/server/connectors/filedescriptorserver.cpp
+@@ -122,7 +122,7 @@ int FileDescriptorServer::WaitForRead() {
+   FD_ZERO(&except_fds);
+   FD_SET(inputfd, &read_fds);
+   timeout.tv_sec = 0;
+-  timeout.tv_usec = (__suseconds_t) (READ_TIMEOUT * 1000000);
++  timeout.tv_usec = (suseconds_t) (READ_TIMEOUT * 1000000);
+   // Wait for something to read
+   return select(inputfd + 1, &read_fds, &write_fds, &except_fds, &timeout);
+ }
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc_0.7.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc_0.7.0.bb
new file mode 100644
index 0000000..eb1ff65
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/jsonrpc/jsonrpc_0.7.0.bb
@@ -0,0 +1,32 @@
+SUMMARY = "C++ framework for json-rpc 1.0 and 2.0"
+DESCRIPTION = "JsonRpc-Cpp is an OpenSource implementation of JSON-RPC \
+               protocol in C++. JSON-RPC is a lightweight remote procedure \
+               call protocol similar to XML-RPC."
+HOMEPAGE = "https://github.com/cinemast/libjson-rpc-cpp"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=ee72d601854d5d2a065cf642883c489b"
+
+PV = "0.7.0+git${SRCPV}"
+
+SRC_URI = "git://github.com/cinemast/libjson-rpc-cpp \
+           file://0001-cmake-replace-hardcoded-lib-CMAKE_LIBRARY_PATH-with-.patch \
+           file://0001-filedescriptorclient-Typecast-min-arguments-correctl.patch \
+           file://0001-filedescriptorserver-Include-sys-select.h-before-oth.patch \
+           file://0001-memset-and-family-needs-to-include-string.h.patch \
+           file://0002-Fix-build-problem-on-Mac.patch \
+           "
+SRCREV = "ccbdb41388bdd929828941652da816bf52a0580e"
+
+SECTION = "libs"
+
+DEPENDS = "curl jsoncpp libmicrohttpd"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE += "-DCOMPILE_TESTS=NO -DCOMPILE_STUBGEN=NO -DCOMPILE_EXAMPLES=NO \
+                  -DBUILD_SHARED_LIBS=YES -DBUILD_STATIC_LIBS=YES \
+                  -DCMAKE_LIBRARY_PATH=${libdir} \
+"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit/stdc-predef.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit/stdc-predef.patch
new file mode 100644
index 0000000..c95cdc9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit/stdc-predef.patch
@@ -0,0 +1,17 @@
+__STDC_ISO_10646__ is defined in stdc-predef.h
+therefore include it to see if its there on a platform
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libedit-20160903-3.1/src/chartype.h
+===================================================================
+--- libedit-20160903-3.1.orig/src/chartype.h
++++ libedit-20160903-3.1/src/chartype.h
+@@ -29,6 +29,7 @@
+ #ifndef _h_chartype_f
+ #define _h_chartype_f
+ 
++#include <stdc-predef.h>
+ /* Ideally we should also test the value of the define to see if it
+  * supports non-BMP code points without requiring UTF-16, but nothing
+  * seems to actually advertise this properly, despite Unicode 3.1 having
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit_20160618-3.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit_20160618-3.1.bb
deleted file mode 100644
index bda421d..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit_20160618-3.1.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SUMMARY = "BSD replacement for libreadline"
-DESCRIPTION = "Command line editor library providing generic line editing, \
-history, and tokenization functions"
-HOMEPAGE = "http://www.thrysoee.dk/editline/"
-SECTION = "libs"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=1e4228d0c5a9093b01aeaaeae6641533"
-
-DEPENDS = "ncurses"
-
-inherit autotools
-
-# upstream site does not allow wget's User-Agent
-FETCHCMD_wget += "-U bitbake"
-SRC_URI = "http://www.thrysoee.dk/editline/${BPN}-${PV}.tar.gz"
-
-S = "${WORKDIR}/${BPN}-${PV}"
-
-SRC_URI[md5sum] = "b6e60f326a3fce91bea1a6fe4700af58"
-SRC_URI[sha256sum] = "b6b159c0c6ec8a7f349ea2a75d8b960efa346c462c1ac4921f1ac0de85a9f5d6"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit_20170329-3.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit_20170329-3.1.bb
new file mode 100644
index 0000000..fc24671
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libedit/libedit_20170329-3.1.bb
@@ -0,0 +1,21 @@
+SUMMARY = "BSD replacement for libreadline"
+DESCRIPTION = "Command line editor library providing generic line editing, \
+history, and tokenization functions"
+HOMEPAGE = "http://www.thrysoee.dk/editline/"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1e4228d0c5a9093b01aeaaeae6641533"
+
+DEPENDS = "ncurses"
+
+inherit autotools
+
+# upstream site does not allow wget's User-Agent
+FETCHCMD_wget += "-U bitbake"
+SRC_URI = "http://www.thrysoee.dk/editline/${BPN}-${PV}.tar.gz \
+           file://stdc-predef.patch \
+          "
+SRC_URI[md5sum] = "c57a0690e62ef523c083598730272cfd"
+SRC_URI[sha256sum] = "91f2d90fbd2a048ff6dad7131d9a39e690fd8a8fd982a353f1333dd4017dd4be"
+
+S = "${WORKDIR}/${BPN}-${PV}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/libfribidi/fribidi_0.19.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libfribidi/fribidi_0.19.7.bb
index e79de66..423a914 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/libfribidi/fribidi_0.19.7.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libfribidi/fribidi_0.19.7.bb
@@ -16,3 +16,5 @@
 
 SRC_URI[md5sum] = "6c7e7cfdd39c908f7ac619351c1c5c23"
 SRC_URI[sha256sum] = "08222a6212bbc2276a2d55c3bf370109ae4a35b689acbc66571ad2a670595a8e"
+
+CVE_PRODUCT = "gnu_fribidi"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/libgee/libgee_0.18.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libgee/libgee_0.18.0.bb
index 3fa9d9f..6386f1f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/libgee/libgee_0.18.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libgee/libgee_0.18.0.bb
@@ -18,7 +18,7 @@
     done
 }
 
-SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/libgee/${SHRT_VER}/${BP}.tar.xz"
 SRC_URI[md5sum] = "29ea6125e653d7e60b49a9a9544abc96"
 SRC_URI[sha256sum] = "4ad99ef937d071b4883c061df40bfe233f7649d50c354cf81235f180b4244399"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-Add-CMake-build-files.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-Add-CMake-build-files.patch
new file mode 100644
index 0000000..cd0d143
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/0001-Add-CMake-build-files.patch
@@ -0,0 +1,302 @@
+From 613297214d78ee10111e74e90e025166ebbcad9f Mon Sep 17 00:00:00 2001
+From: Peter Liu <peter.x.liu@external.atlascopco.com>
+Date: Sun, 5 Mar 2017 16:15:40 +0100
+Subject: [PATCH] Add CMake build files
+
+Upstream-Status: Pending
+
+Signed-off-by: Peter Liu <peter.x.liu@external.atlascopco.com>
+---
+ CMakeLists.txt     | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ FindLibRcf.cmake   |  63 +++++++++++++++++++++++
+ VERSION.cmake      |  21 ++++++++
+ src/CMakeLists.txt |  25 +++++++++
+ 4 files changed, 256 insertions(+)
+ create mode 100644 CMakeLists.txt
+ create mode 100644 FindLibRcf.cmake
+ create mode 100644 VERSION.cmake
+ create mode 100755 src/CMakeLists.txt
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+new file mode 100644
+index 0000000..f6e24be
+--- /dev/null
++++ b/CMakeLists.txt
+@@ -0,0 +1,147 @@
++PROJECT (librcf)
++
++CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
++
++####################################################################
++# OPTION                                                           #
++####################################################################
++OPTION (LIBRCF_USE_OPENSSL "Build with OpenSSL support?" OFF)
++OPTION (LIBRCF_OPENSSL_STATIC "Enable static linking to OpenSSL?" OFF)
++OPTION (LIBRCF_USE_ZLIB "Build with zlib support?" OFF)
++OPTION (LIBRCF_ZLIB_STATIC "Enable static linking to zlib?" OFF)
++OPTION (LIBRCF_USE_SF_SERIALIZATION "Build with SF serialization support?" ON)
++OPTION (LIBRCF_USE_BOOST_SERIALIZATION "Build with Boost.Serialization support?" OFF)
++OPTION (LIBRCF_USE_BOOST_FILESYSTEM "Build with Boost.Filesystem support (required for file transfer support)?" OFF)
++OPTION (LIBRCF_USE_BOOST_ASIO "Build with Boost asio support?" ON)
++OPTION (LIBRCF_USE_PROTOBUF "Build with Protocol Buffer support?" OFF)
++OPTION (LIBRCF_USE_JSON "Build with JSON Spirit (required for JSON-RPC support)?" OFF)
++OPTION (LIBRCF_USE_IPV6 "Build with IPv6 support?" OFF)
++OPTION (LIBRCF_USE_CUSTOM_ALLOCATOR "Build with custom allocator support?" OFF)
++OPTION (LIBRCF_BUILD_DLL "Build a DLL exporting RCF?" OFF)
++OPTION (LIBRCF_AUTO_INIT_DEINIT "Enable automatic RCF initialization and deinitialization?" OFF)
++OPTION (LIBRCF_BUILD_STATIC_LIBS "Build the static library?" ON)
++OPTION (LIBRCF_BUILD_SHARED_LIBS "Build the shared library?" ON)
++OPTION (LIBRCF_BUILD_DEMOS "Build demo programs?" ON)
++
++####################################################################
++# CONFIGURATION                                                    #
++####################################################################
++INCLUDE (${CMAKE_SOURCE_DIR}/VERSION.cmake)
++
++SET (LIBRCF_LIBRARIES "-lpthread -ldl")
++INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/include)
++
++IF (LIBRCF_USE_OPENSSL)
++  IF (NOT OPENSSL_FOUND)
++    FIND_PACKAGE (OpenSSL REQUIRED)
++  ENDIF (NOT OPENSSL_FOUND)
++  INCLUDE_DIRECTORIES (${OPENSSL_INCLUDE_DIR})
++  ADD_DEFINITIONS (-DRCF_USE_OPENSSL)
++ENDIF (LIBRCF_USE_OPENSSL)
++
++IF (LIBRCF_OPENSSL_STATIC)
++  LIST (APPEND LIBRCF_LIBRARIES ${OPENSSL_LIBRARIES})
++  ADD_DEFINITIONS (-DRCF_OPENSSL_STATIC)
++ENDIF (LIBRCF_OPENSSL_STATIC)
++
++IF (LIBRCF_USE_ZLIB)
++  IF (NOT ZLIB_FOUND)
++    FIND_PACKAGE (ZLIB REQUIRED)
++  ENDIF (NOT ZLIB_FOUND)
++  INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIR})
++  ADD_DEFINITIONS (-DRCF_USE_ZLIB)
++ENDIF (LIBRCF_USE_ZLIB)
++
++IF (LIBRCF_ZLIB_STATIC)
++  LIST (APPEND LIBRCF_LIBRARIES ${ZLIB_LIBRARIES})
++  ADD_DEFINITIONS (-DRCF_ZLIB_STATIC)
++ENDIF (LIBRCF_ZLIB_STATIC)
++
++IF (LIBRCF_USE_SF_SERIALIZATION)
++  IF (NOT Boost_SYSTEM_FOUND)
++    FIND_PACKAGE (Boost REQUIRED COMPONENTS system)
++  ENDIF (NOT Boost_SYSTEM_FOUND)
++  INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
++  LIST (APPEND LIBRCF_LIBRARIES ${Boost_SYSTEM_LIBRARY})
++  ADD_DEFINITIONS (-DRCF_USE_SF_SERIALIZATION)
++ENDIF (LIBRCF_USE_SF_SERIALIZATION)
++
++IF (LIBRCF_USE_BOOST_SERIALIZATION)
++  IF (NOT Boost_SERIALIZATION_FOUND)
++    FIND_PACKAGE (Boost REQUIRED COMPONENTS serialization)
++  ENDIF (NOT Boost_SERIALIZATION_FOUND)
++  INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
++  LIST (APPEND LIBRCF_LIBRARIES ${Boost_SERIALIZATION_LIBRARY})
++  ADD_DEFINITIONS (-DRCF_USE_BOOST_SERIALIZATION)
++ENDIF (LIBRCF_USE_BOOST_SERIALIZATION)
++
++IF (LIBRCF_USE_BOOST_FILESYSTEM)
++  IF (NOT Boost_FILESYSTEM_FOUND)
++    FIND_PACKAGE (Boost REQUIRED COMPONENTS filesystem system)
++  ENDIF (NOT Boost_FILESYSTEM_FOUND)
++  INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
++  LIST (APPEND LIBRCF_LIBRARIES ${Boost_FILESYSTEM_LIBRARY})
++  LIST (APPEND LIBRCF_LIBRARIES ${Boost_SYSTEM_LIBRARY})
++  ADD_DEFINITIONS (-DRCF_USE_BOOST_FILESYSTEM)
++ENDIF (LIBRCF_USE_BOOST_FILESYSTEM)
++
++IF (LIBRCF_USE_BOOST_ASIO)
++  IF (NOT Boost_FOUND)
++    FIND_PACKAGE (Boost REQUIRED)
++  ENDIF (NOT Boost_FOUND)
++  INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
++  ADD_DEFINITIONS (-DRCF_USE_BOOST_ASIO)
++ENDIF (LIBRCF_USE_BOOST_ASIO)
++
++IF (LIBRCF_USE_PROTOBUF)
++  IF(NOT Protobuf_FOUND)
++    FIND_PACKAGE (Protobuf REQUIRED)
++  ENDIF (NOT Protobuf_FOUND)
++  INCLUDE_DIRECTORIES (${Protobuf_INCLUDE_DIR})
++  LIST (APPEND LIBRCF_LIBRARIES ${Protobuf_LIBRARIES})
++  ADD_DEFINITIONS (-DRCF_USE_PROTOBUF)
++ENDIF (LIBRCF_USE_PROTOBUF)
++
++IF (LIBRCF_USE_JSON)
++  IF (NOT LibJsonSpirit_FOUND)
++    FIND_PACKAGE (LibJsonSpirit REQUIRED)
++  ENDIF (NOT LibJsonSpirit_FOUND)
++  INCLUDE_DIRECTORIES (${LibJsonSpirit_INCLUDE_DIR})
++  LIST (APPEND LIBRCF_LIBRARIES ${LibJsonSpirit_LIBRARIES})
++  ADD_DEFINITIONS (-DRCF_USE_JSON)
++ENDIF (LIBRCF_USE_JSON)
++
++IF (LIBRCF_USE_IPV6)
++  ADD_DEFINITIONS (-DRCF_USE_IPV6)
++ENDIF (LIBRCF_USE_IPV6)
++
++IF (LIBRCF_USE_CUSTOM_ALLOCATOR)
++  ADD_DEFINITIONS (-DRCF_USE_CUSTOM_ALLOCATOR)
++ENDIF (LIBRCF_USE_CUSTOM_ALLOCATOR)
++
++IF (LIBRCF_BUILD_DLL)
++  ADD_DEFINITIONS (-DRCF_BUILD_DLL)
++ENDIF (LIBRCF_BUILD_DLL)
++
++IF (LIBRCF_AUTO_INIT_DEINIT)
++  ADD_DEFINITIONS (-DRCF_AUTO_INIT_DEINIT)
++ENDIF (LIBRCF_AUTO_INIT_DEINIT)
++
++####################################################################
++# SUBDIRECTORY                                                     #
++####################################################################
++ADD_SUBDIRECTORY (src)
++
++IF (LIBRCF_BUILD_DEMOS)
++  # Server
++  ADD_EXECUTABLE (RcfServer demo/Server.cpp)
++  TARGET_LINK_LIBRARIES (RcfServer rcf ${LIBRCF_LIBRARIES})
++  INSTALL (TARGETS RcfServer DESTINATION ${CMAKE_INSTALL_BINDIR})
++
++  # Client
++  ADD_EXECUTABLE (RcfClient demo/Client.cpp)
++  TARGET_LINK_LIBRARIES (RcfClient rcf ${LIBRCF_LIBRARIES})
++  INSTALL (TARGETS RcfClient DESTINATION ${CMAKE_INSTALL_BINDIR})
++ENDIF (LIBRCF_BUILD_DEMOS)
++
++INSTALL (FILES ${CMAKE_SOURCE_DIR}/FindLibRcf.cmake DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules)
+diff --git a/FindLibRcf.cmake b/FindLibRcf.cmake
+new file mode 100644
+index 0000000..9d7d8cd
+--- /dev/null
++++ b/FindLibRcf.cmake
+@@ -0,0 +1,63 @@
++# FindLibRcf - Find librcf headers and libraries.
++#
++# Sample:
++#
++#   SET( LibRcf_USE_STATIC_LIBS OFF )
++#   FIND_PACKAGE( LibRcf REQUIRED )
++#   IF( LibRcf_FOUND )
++#      INCLUDE_DIRECTORIES( ${LibRcf_INCLUDE_DIRS} )
++#      TARGET_LINK_LIBRARIES( ... ${LibRcf_LIBRARIES} )
++#   ENDIF()
++#
++# Variables used by this module need to be set before calling find_package
++#
++#   LibRcf_USE_STATIC_LIBS	Can be set to ON to force the use of the static
++#				librcf libraries. Defaults to OFF.
++#
++# Variables provided by this module:
++#
++#   LibRcf_FOUND		Include dir, librcf libraries.
++#
++#   LibRcf_LIBRARIES		Link to these to use all the libraries you specified.
++#
++#   LibRcf_INCLUDE_DIRS		Include directories.
++#
++# For each component you specify in find_package(), the following (UPPER-CASE)
++# variables are set to pick and choose components instead of just using LibRcf_LIBRARIES:
++#
++#   LIBRCF_FOUND			TRUE if librcf was found
++#   LIBRCF_LIBRARY			librcf libraries
++#
++
++# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
++IF(LibRcf_USE_STATIC_LIBS)
++    SET( _ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
++    SET(CMAKE_FIND_LIBRARY_SUFFIXES .a )
++ENDIF()
++
++# Look for the header files
++UNSET(LibRcf_INCLUDE_DIRS CACHE)
++FIND_PATH(LibRcf_INCLUDE_DIRS NAMES RCF/RcfClient.hpp)
++
++# Look for the core library
++UNSET(LIBRCF_LIBRARY CACHE)
++FIND_LIBRARY(LIBRCF_LIBRARY NAMES rcf)
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibRcf DEFAULT_MSG LIBRCF_LIBRARY LibRcf_INCLUDE_DIRS)
++MARK_AS_ADVANCED(
++    LIBRCF_FOUND
++    LIBRCF_LIBRARY
++)
++
++# Prepare return values and collectiong more components
++SET(LibRcf_FOUND ${LIBRCF_FOUND})
++SET(LibRcf_LIBRARIES ${LIBRCF_LIBRARY})
++MARK_AS_ADVANCED(
++    LibRcf_FOUND
++    LibRcf_LIBRARIES
++    LibRcf_INCLUDE_DIRS
++)
++
++# Restore CMAKE_FIND_LIBRARY_SUFFIXES
++IF(LibRcf_USE_STATIC_LIBS)
++    SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES} )
++ENDIF()
+diff --git a/VERSION.cmake b/VERSION.cmake
+new file mode 100644
+index 0000000..8b4bcdc
+--- /dev/null
++++ b/VERSION.cmake
+@@ -0,0 +1,21 @@
++# ==================================================
++# Versioning
++# ==========
++#
++# MAJOR Major number for this branch.
++#
++# MINOR The most recent interface number this
++#     library implements.
++#
++# COMPATMINOR The latest binary compatible minor number
++#     this library implements.
++#
++# PATCH The implementation number of the current interface.
++#
++#
++# - The package VERSION will be MAJOR.MINOR.PATCH.
++#
++
++SET (LIBRCF_SOVERSION_MAJOR "2")
++SET (LIBRCF_SOVERSION_MINOR "2")
++SET (LIBRCF_SOVERSION_PATCH "0")
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+new file mode 100755
+index 0000000..c227901
+--- /dev/null
++++ b/src/CMakeLists.txt
+@@ -0,0 +1,25 @@
++IF (NOT LIBRCF_BUILD_SHARED_LIBS)
++  ADD_LIBRARY (rcf STATIC RCF/RCF.cpp)
++ELSE (NOT LIBRCF_BUILD_SHARED_LIBS)
++  ADD_LIBRARY (rcf SHARED RCF/RCF.cpp)
++  TARGET_LINK_LIBRARIES (rcf ${LIBRCF_LIBRARIES})
++  SET_TARGET_PROPERTIES (rcf PROPERTIES COMPILE_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
++  SET_TARGET_PROPERTIES (rcf PROPERTIES VERSION ${LIBRCF_SOVERSION_MAJOR}.${LIBRCF_SOVERSION_MINOR}.${LIBRCF_SOVERSION_PATCH})
++ENDIF (NOT LIBRCF_BUILD_SHARED_LIBS)
++
++SET_TARGET_PROPERTIES (rcf PROPERTIES PROJECT_LABEL "RCF Library")
++SET_TARGET_PROPERTIES (rcf PROPERTIES OUTPUT_NAME "rcf")
++SET_TARGET_PROPERTIES (rcf PROPERTIES SOVERSION ${LIBRCF_SOVERSION_MAJOR})
++SET_TARGET_PROPERTIES (rcf PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_LIBDIR})
++
++INSTALL (DIRECTORY "${CMAKE_SOURCE_DIR}/include/RCF" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
++INSTALL (DIRECTORY "${CMAKE_SOURCE_DIR}/include/SF" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
++INSTALL (TARGETS rcf LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++
++IF (LIBRCF_BUILD_STATIC_LIBS AND LIBRCF_BUILD_SHARED_LIBS)
++  ADD_LIBRARY (rcf_static STATIC RCF/RCF.cpp)
++  SET_TARGET_PROPERTIES (rcf_static PROPERTIES PROJECT_LABEL "RCF Static Library")
++  SET_TARGET_PROPERTIES (rcf_static PROPERTIES OUTPUT_NAME "rcf")
++  SET_TARGET_PROPERTIES (rcf_static PROPERTIES SOVERSION ${LIBRCF_SOVERSION_MAJOR})
++  INSTALL (TARGETS rcf_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ENDIF (LIBRCF_BUILD_STATIC_LIBS AND LIBRCF_BUILD_SHARED_LIBS)
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/aarch64-support.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/aarch64-support.patch
new file mode 100644
index 0000000..28cd0fe
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf/aarch64-support.patch
@@ -0,0 +1,13 @@
+Index: RCF-2.2.0.0/src/RCF/ByteOrdering.cpp
+===================================================================
+--- RCF-2.2.0.0.orig/src/RCF/ByteOrdering.cpp
++++ RCF-2.2.0.0/src/RCF/ByteOrdering.cpp
+@@ -60,7 +60,7 @@ namespace RCF {
+ 

+     const ByteOrder MachineByteOrder = LittleEndian;

+ 

+-#elif defined(__arm__)

++#elif defined(__arm__) || defined(__aarch64__)

+ 

+     const ByteOrder MachineByteOrder = LittleEndian;

+ 

diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf_2.2.0.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf_2.2.0.0.bb
new file mode 100644
index 0000000..51ad7ec
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/librcf/librcf_2.2.0.0.bb
@@ -0,0 +1,49 @@
+SUMMARY = "RCF (Remote Call Framework) is a cross-platform interprocess communication framework for C++"
+DESCRIPTION = "Unlike other communication frameworks, RCF doesn't use a separate \
+IDL (Interface Definition Language). RCF interfaces are defined directly in C++, \
+and serialization for user-defined data types likewise is implemented in C++. \
+Instead of a separate IDL compiler tool, RCF uses the C++ compiler to generate \
+client and server stubs."
+HOMEPAGE = "http://www.deltavsoft.com/"
+SECTION = "libs"
+PRIORITY = "optional"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://license.txt;md5=137c2935b51c95068a8b1bbd434ffe2d"
+
+SRC_URI = "http://www.deltavsoft.com/downloads/RCF-${PV}.tar.gz \
+           file://0001-Add-CMake-build-files.patch \
+           file://aarch64-support.patch \
+          "
+
+SRC_URI[md5sum] = "7ecb3c73f7eb66dba8790b659374f690"
+SRC_URI[sha256sum] = "bbfcc88de502c39604878c395f516b03fff4eac63eb4f7f44c07d433839712dd"
+
+S = "${WORKDIR}/RCF-${PV}"
+
+inherit cmake
+
+PACKAGECONFIG ?= "zlib openssl sf-serialization boost-filesystem boost-asio protobuf json dll static shared demos"
+PACKAGECONFIG[zlib] = "-DLIBRCF_USE_ZLIB=ON,-DLIBRCF_USE_ZLIB=OFF,zlib,zlib"
+PACKAGECONFIG[zlib-static] = "-DLIBRCF_USE_ZLIB=ON -DLIBRCF_ZLIB_STATIC=ON,-DLIBRCF_ZLIB_STATIC=OFF,zlib,"
+PACKAGECONFIG[openssl] = "-DLIBRCF_USE_OPENSSL=ON,-DLIBRCF_USE_OPENSSL=OFF,openssl,libssl libcrypto"
+PACKAGECONFIG[openssl-static] = "-DLIBRCF_USE_OPENSSL=ON -DLIBRCF_OPENSSL_STATIC=ON,-DLIBRCF_OPENSSL_STATIC=OFF,openssl,"
+PACKAGECONFIG[sf-serialization] = "-DLIBRCF_USE_SF_SERIALIZATION=ON,-DLIBRCF_USE_SF_SERIALIZATION=OFF,boost,"
+PACKAGECONFIG[boost-serialization] = "-DLIBRCF_USE_BOOST_SERIALIZATION=ON,-DLIBRCF_USE_BOOST_SERIALIZATION=OFF,boost,"
+PACKAGECONFIG[boost-filesystem] = "-DLIBRCF_USE_BOOST_FILESYSTEM=ON,-DLIBRCF_USE_BOOST_FILESYSTEM=OFF,boost,"
+PACKAGECONFIG[boost-asio] = "-DLIBRCF_USE_BOOST_ASIO=ON,-DLIBRCF_USE_BOOST_ASIO=OFF,boost,"
+PACKAGECONFIG[protobuf] = "-DLIBRCF_USE_PROTOBUF=ON,-DLIBRCF_USE_PROTOBUF=OFF,protobuf,"
+PACKAGECONFIG[json] = "-DLIBRCF_USE_JSON=ON,-DLIBRCF_USE_JSON=OFF,json-spirit,"
+PACKAGECONFIG[ipv6] = "-DLIBRCF_USE_IPV6=ON,-DLIBRCF_USE_IPV6=OFF,"
+PACKAGECONFIG[custom-allocator] = "-DLIBRCF_USE_CUSTOM_ALLOCATOR=ON,-DLIBRCF_USE_CUSTOM_ALLOCATOR=OFF,"
+PACKAGECONFIG[dll] = "-DLIBRCF_BUILD_DLL=ON,-DLIBRCF_BUILD_DLL=OFF,"
+PACKAGECONFIG[auto-init-deinit] = "-DLIBRCF_AUTO_INIT_DEINIT=ON,-DLIBRCF_AUTO_INIT_DEINIT=OFF,"
+PACKAGECONFIG[static] = "-DLIBRCF_BUILD_STATIC_LIBS=ON,-DLIBRCF_BUILD_STATIC_LIBS=OFF,"
+PACKAGECONFIG[shared] = "-DLIBRCF_BUILD_SHARED_LIBS=ON,-DLIBRCF_BUILD_SHARED_LIBS=OFF,"
+PACKAGECONFIG[demos] = "-DLIBRCF_BUILD_DEMOS=ON,-DLIBRCF_BUILD_DEMOS=OFF,"
+
+PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'demos', '${PN}-demos', '', d)}"
+
+FILES_${PN}-demos = "${bindir}/*"
+FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibRcf.cmake"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox_git.bb
index 609281a..f9f4e08 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/libubox/libubox_git.bb
@@ -19,6 +19,7 @@
 "
 
 SRCREV = "155bf39896f126b1ba121b816922a88dc34c31e3"
+PV = "1.0.1+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/log4cplus/log4cplus_1.2.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/log4cplus/log4cplus_1.2.0.bb
index c2f5ec0..31ab9a6 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/log4cplus/log4cplus_1.2.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/log4cplus/log4cplus_1.2.0.bb
@@ -12,4 +12,4 @@
 
 inherit autotools pkgconfig
 
-BBCLASSEXTEND += "native"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_1.0.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_1.0.0.bb
index 62117b1..b13bd7b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_1.0.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_1.0.0.bb
@@ -94,4 +94,4 @@
 do_make_scripts[deptask] = "do_populate_sysroot"
 
 # http://errors.yoctoproject.org/Errors/Details/56327/
-PNBLACKLIST[ltp-ddt] ?= "BROKEN: fails since last autotools.bbclass changes"
+PNBLACKLIST[ltp-ddt] ?= "BROKEN: fails since last autotools.bbclass changes - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-ARM-code-has-unreachable-code-after-switch-statement.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-ARM-code-has-unreachable-code-after-switch-statement.patch
new file mode 100644
index 0000000..4d0e039
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-ARM-code-has-unreachable-code-after-switch-statement.patch
@@ -0,0 +1,40 @@
+From 95ff340a74af16cca89fd5c5ca99890821053209 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 00:47:16 -0700
+Subject: [PATCH] ARM code has unreachable code after switch statement move
+ initialization
+
+Fixed
+sysdeps/linux-gnu/arm/trace.c:173:33: error: statement will never be executed [-Werror=switch-unreachable]
+    uint32_t operand1, operand2, result = 0;
+                                 ^~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/linux-gnu/arm/trace.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/sysdeps/linux-gnu/arm/trace.c b/sysdeps/linux-gnu/arm/trace.c
+index 5e51e91..f974d1f 100644
+--- a/sysdeps/linux-gnu/arm/trace.c
++++ b/sysdeps/linux-gnu/arm/trace.c
+@@ -155,6 +155,8 @@ arm_get_next_pcs(struct process *proc,
+ 	const unsigned cond = BITS(this_instr, 28, 31);
+ 	const unsigned opcode = BITS(this_instr, 24, 27);
+ 
++	uint32_t operand1, operand2, result = 0;
++
+ 	if (cond == COND_NV)
+ 		switch (opcode) {
+ 			arch_addr_t addr;
+@@ -170,7 +172,6 @@ arm_get_next_pcs(struct process *proc,
+ 		}
+ 	else
+ 		switch (opcode) {
+-			uint32_t operand1, operand2, result = 0;
+ 		case 0x0:
+ 		case 0x1:			/* data processing */
+ 		case 0x2:
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Add-support-for-mips64-n32-n64.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Add-support-for-mips64-n32-n64.patch
new file mode 100644
index 0000000..d0daf14
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Add-support-for-mips64-n32-n64.patch
@@ -0,0 +1,1148 @@
+From 5f6dfafb80bdc2566fe91d5fde96769175fabf35 Mon Sep 17 00:00:00 2001
+From: Faraz Shahbazker <faraz.shahbazker@imgtec.com>
+Date: Sat, 1 Jul 2017 10:56:59 -0700
+Subject: [PATCH] Add support for mips64 n32/n64
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+Source: http://lists.alioth.debian.org/pipermail/ltrace-devel/2015-May/001327.html
+
+ backend.h                            |   8 +
+ ltrace-elf.c                         |  12 ++
+ proc.h                               |   1 +
+ sysdeps/linux-gnu/mips/Makefile.am   |   1 +
+ sysdeps/linux-gnu/mips/abi.c         |  64 +++++++
+ sysdeps/linux-gnu/mips/arch.h        |  24 ++-
+ sysdeps/linux-gnu/mips/plt.c         |  68 ++++++--
+ sysdeps/linux-gnu/mips/signalent1.h  |  52 ++++++
+ sysdeps/linux-gnu/mips/syscallent1.h | 328 +++++++++++++++++++++++++++++++++++
+ sysdeps/linux-gnu/mips/trace.c       | 241 ++++++++++++++++++-------
+ sysdeps/linux-gnu/mksyscallent_mips  |   9 +-
+ 11 files changed, 728 insertions(+), 80 deletions(-)
+ create mode 100644 sysdeps/linux-gnu/mips/abi.c
+ create mode 100644 sysdeps/linux-gnu/mips/signalent1.h
+ create mode 100644 sysdeps/linux-gnu/mips/syscallent1.h
+
+diff --git a/backend.h b/backend.h
+index e25daa0..0d6926a 100644
+--- a/backend.h
++++ b/backend.h
+@@ -314,6 +314,14 @@ int arch_process_exec(struct process *proc);
+ int arch_get_sym_info(struct ltelf *lte, const char *filename, size_t sym_index,
+ 		      GElf_Rela *rela, GElf_Sym *sym);
+ 
++/* The following callback has to be implemented in backend if arch.h
++ * defines ARCH_HAVE_GET_ABI
++ *
++ * This is called from read_module just once, when reading the main module.
++ * The value returned is an architecture specific ID for the current ABI
++ * to be used later for ABI-specific operations. */
++char arch_get_abi(GElf_Ehdr ehdr);
++
+ enum plt_status {
+ 	PLT_FAIL,
+ 	PLT_OK,
+diff --git a/ltrace-elf.c b/ltrace-elf.c
+index f439cb0..a85edca 100644
+--- a/ltrace-elf.c
++++ b/ltrace-elf.c
+@@ -1131,6 +1131,14 @@ populate_symtab(struct process *proc, const char *filename,
+ 				    only_exported_names);
+ }
+ 
++#ifndef ARCH_HAVE_GET_ABI
++char
++arch_get_abi(GElf_Ehdr ehdr)
++{
++       return 0;
++}
++#endif
++
+ static int
+ read_module(struct library *lib, struct process *proc,
+ 	    const char *filename, GElf_Addr bias, int main)
+@@ -1151,6 +1159,10 @@ read_module(struct library *lib, struct process *proc,
+ 	 * with 32-bit ltrace.  It is desirable to preserve this.  */
+ 	proc->e_machine = lte.ehdr.e_machine;
+ 	proc->e_class = lte.ehdr.e_ident[EI_CLASS];
++	/* Another candidate for the ABI module. We probably
++	 * want to do all of the e_* stuff only once, for main */
++	if (main)
++		proc->e_abi = arch_get_abi(lte.ehdr);
+ 	get_arch_dep(proc);
+ 
+ 	/* Find out the base address.  For PIE main binaries we look
+diff --git a/proc.h b/proc.h
+index a611456..00094e1 100644
+--- a/proc.h
++++ b/proc.h
+@@ -117,6 +117,7 @@ struct process {
+ 	 * nauseam.  */
+ 	short e_machine;
+ 	char e_class;
++	char e_abi;
+ 
+ #if defined(HAVE_LIBDW)
+ 	/* Unwind info for leader, NULL for non-leader procs. */
+diff --git a/sysdeps/linux-gnu/mips/Makefile.am b/sysdeps/linux-gnu/mips/Makefile.am
+index 1fd8c2a..571ee0d 100644
+--- a/sysdeps/linux-gnu/mips/Makefile.am
++++ b/sysdeps/linux-gnu/mips/Makefile.am
+@@ -20,6 +20,7 @@ noinst_LTLIBRARIES = \
+ 	../libcpu.la
+ 
+ ___libcpu_la_SOURCES = \
++	abi.c \
+ 	plt.c \
+ 	regs.c \
+ 	trace.c
+diff --git a/sysdeps/linux-gnu/mips/abi.c b/sysdeps/linux-gnu/mips/abi.c
+new file mode 100644
+index 0000000..64e3c10
+--- /dev/null
++++ b/sysdeps/linux-gnu/mips/abi.c
+@@ -0,0 +1,64 @@
++/*
++ * This file is part of ltrace.
++ * Copyright (C) 2015 Imagination Technologies Limited
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of the
++ * License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA
++ */
++
++#include <stdio.h>
++#include <gelf.h>
++#include "arch.h"
++
++/*
++ *  There is no bit in the header-flags to mark N64 ABI, it must be
++ *  determined by exclusion of other ABIs. The following values are
++ *  from elfcpp/mips.h in binutils sources
++ */
++enum
++{
++	E_MIPS_ABI_MASK = 0x0000F000,
++	E_MIPS_ABI_N32 	= 0x00000020,
++	E_MIPS_ABI_O32 	= 0x00001000,
++	E_MIPS_ABI_O64 	= 0x00002000,
++	E_MIPS_ABI_EABI32 = 0x00003000,
++	E_MIPS_ABI_EABI64 = 0x00004000,
++};
++
++char
++arch_get_abi(GElf_Ehdr ehdr)
++{
++	enum mips_abi_type abi;
++	switch (ehdr.e_flags & E_MIPS_ABI_MASK) {
++	case E_MIPS_ABI_O32:
++		abi = ABI_O32; break;
++	case E_MIPS_ABI_O64:
++		abi = ABI_O64; break;
++	case E_MIPS_ABI_EABI32:
++	case E_MIPS_ABI_EABI64:
++		fprintf(stderr, "%s: MIPS EABI is not supported\n", __func__);
++		abi = -1;
++		break;
++	default:
++		if (ehdr.e_flags & E_MIPS_ABI_N32)
++			abi = ABI_N32;
++		else
++			abi = ABI_N64;
++	}
++
++	return abi;
++}
++
++/**@}*/
+diff --git a/sysdeps/linux-gnu/mips/arch.h b/sysdeps/linux-gnu/mips/arch.h
+index 16273d2..8b75df2 100644
+--- a/sysdeps/linux-gnu/mips/arch.h
++++ b/sysdeps/linux-gnu/mips/arch.h
+@@ -1,5 +1,6 @@
+ /*
+  * This file is part of ltrace.
++ * Copyright (C) 2015 Imagination Technologies Limited
+  * Copyright (C) 2013,2014 Petr Machata, Red Hat Inc.
+  * Copyright (C) 2006 Eric Vaitl
+  *
+@@ -38,8 +39,12 @@
+ #define BREAKPOINT_LENGTH 4
+ #define DECR_PC_AFTER_BREAK 0
+ 
+-#define LT_ELFCLASS	ELFCLASS32
++#ifdef __LP64__
++#define LT_ELFCLASS	ELFCLASS64
+ #define LT_ELF_MACHINE	EM_MIPS
++#endif /* __LP64__ */
++#define LT_ELFCLASS2	ELFCLASS32
++#define LT_ELF_MACHINE2 EM_MIPS
+ 
+ #define ARCH_HAVE_LTELF_DATA
+ struct arch_ltelf_data {
+@@ -53,8 +58,14 @@ struct arch_ltelf_data {
+ #define ARCH_HAVE_ADD_PLT_ENTRY
+ #define ARCH_HAVE_SW_SINGLESTEP
+ #define ARCH_HAVE_SYMBOL_RET
+-
++#define ARCH_HAVE_GET_ABI
+ #define ARCH_HAVE_LIBRARY_SYMBOL_DATA
++
++#ifdef __LP64__
++#define ARCH_HAVE_SIZEOF
++#define ARCH_HAVE_ALIGNOF
++#endif /* __LP64__ */
++
+ enum mips_plt_type
+ {
+ 	/* A symbol has associated PLT entry.  */
+@@ -73,7 +84,14 @@ enum mips_plt_type
+ 	MIPS_PLT_NEED_UNRESOLVE,
+ };
+ 
+-struct mips_unresolve_data;
++enum mips_abi_type
++{
++	ABI_O32,
++	ABI_N32,
++	ABI_N64,
++	ABI_O64,
++};
++
+ struct arch_library_symbol_data {
+ 	enum mips_plt_type type;
+ 	union {
+diff --git a/sysdeps/linux-gnu/mips/plt.c b/sysdeps/linux-gnu/mips/plt.c
+index f3c12da..2d85ad9 100644
+--- a/sysdeps/linux-gnu/mips/plt.c
++++ b/sysdeps/linux-gnu/mips/plt.c
+@@ -1,5 +1,6 @@
+ /*
+  * This file is part of ltrace.
++ * Copyright (C) 2015 Imagination Technologies Limited
+  * Copyright (C) 2012,2013,2014 Petr Machata, Red Hat Inc.
+  * Copyright (C) 2012 Edgar E. Iglesias, Axis Communications
+  * Copyright (C) 2008,2009 Juan Cespedes
+@@ -182,6 +183,11 @@ arch_find_dl_debug(struct process *proc, arch_addr_t dyn_addr,
+ {
+ 	arch_addr_t rld_addr;
+ 	int r;
++#ifdef __LP64__
++	size_t addrsize = proc->mask_32bit ? 4 : (sizeof *ret);
++#else /* !__LP64__ */
++	size_t addrsize = sizeof *ret;
++#endif /* !__LP64__ */
+ 
+ 	/* MIPS puts the address of the r_debug structure into the
+ 	 * DT_MIPS_RLD_MAP entry instead of into the DT_DEBUG entry.  */
+@@ -189,7 +195,7 @@ arch_find_dl_debug(struct process *proc, arch_addr_t dyn_addr,
+ 					 DT_MIPS_RLD_MAP, &rld_addr);
+ 	if (r == 0) {
+ 		if (umovebytes(proc, rld_addr,
+-			       ret, sizeof *ret) != sizeof *ret) {
++			       ret, addrsize) != addrsize) {
+ 			r = -1;
+ 		}
+ 	}
+@@ -295,14 +301,25 @@ arch_elf_init(struct ltelf *lte, struct library *lib)
+ 
+ 	for (j = 0; j < data->d_size / 16; ++j) {
+ 		uint32_t insn;
++		int got_size = 4;
++		uint32_t load_inst = 0x24180000U; /* addui t8,0,xx  */
++
++#ifdef __LP64__
++		if (arch_get_abi(lte->ehdr) == ABI_N64
++		    || arch_get_abi(lte->ehdr) == ABI_O64) {
++			got_size = 8;
++			load_inst = 0x64180000U; /* daddui t8,0,xx  */
++		}
++#endif /* __LP64__ */
++
+ 		if (elf_read_u32(data, j * 16 + 12, &insn) < 0)
+ 			goto fail_stubs;
+ 
+ 		if (insn == 0)
+ 			continue;
+ 
+-		/* 0x2418XXXX encodes lbu 0,t8,XXXX or li t8,XXXX.  */
+-		if ((insn & 0xffff0000U) != 0x24180000U)
++		/* 0x[62]418XXXX encodes [d]addiu t8, 0, XXXX.  */
++		if ((insn & 0xffff0000U) != load_inst)
+ 			goto fail_stubs;
+ 
+ 		unsigned idx = insn & 0xffff;
+@@ -323,8 +340,8 @@ arch_elf_init(struct ltelf *lte, struct library *lib)
+ 			+ lte->arch.mips_local_gotno;
+ 		/* XXX Double cast.  */
+ 		arch_addr_t got_entry_addr
+-			= (arch_addr_t) (uintptr_t) lte->arch.pltgot_addr
+-			+ got_idx * 4;
++			= (arch_addr_t) (uintptr_t) (lte->arch.pltgot_addr
++						     + got_idx * got_size);
+ 
+ 		GElf_Rela rela = {
+ 			/* XXX double cast.  */
+@@ -336,7 +353,7 @@ arch_elf_init(struct ltelf *lte, struct library *lib)
+ 		if (VECT_PUSHBACK(&lte->plt_relocs, &rela) < 0)
+ 			goto fail_stubs;
+ 
+-		fprintf(stderr,
++		debug(2,
+ 			"added stub entry for symbol %u at %#lx, GOT @%p\n",
+ 			idx, (unsigned long) rela.r_addend, got_entry_addr);
+ 	}
+@@ -362,8 +379,17 @@ read_got_entry(struct process *proc, GElf_Addr addr, GElf_Addr *valp)
+ {
+ 	/* XXX double cast.  */
+ 	arch_addr_t a = (arch_addr_t) (uintptr_t) addr;
+-	uint32_t l;
+-	if (proc_read_32(proc, a, &l) < 0) {
++	uint64_t l = 0;
++	int result;
++
++#ifdef __LP64__
++	if (!proc->mask_32bit)
++		result = proc_read_64(proc, a, &l);
++	else
++#endif /* __LP64__ */
++		result = proc_read_32(proc, a, (uint32_t *) &l);
++
++	if (result < 0) {
+ 		fprintf(stderr, "ptrace read got entry @%#" PRIx64 ": %s\n",
+ 			addr, strerror(errno));
+ 		return -1;
+@@ -426,13 +452,13 @@ arch_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
+ 	GElf_Addr stub_addr = rela->r_addend + lte->bias;
+ 
+ 	debug(2, "PLT-less arch_elf_add_plt_entry %s = %#llx\n",
+-	      a_name, stub_addr);
++	      a_name, (unsigned long long) stub_addr);
+ 
+ 	struct library_symbol *libsym = NULL;
+ 	if (default_elf_add_plt_entry(proc, lte, a_name, rela, ndx,
+ 				      &libsym) < 0) {
+-		fprintf(stderr, "%s: failed %s(%#llx): %s\n", __func__,
+-			a_name, stub_addr, strerror(errno));
++		fprintf(stderr, "%s: failed %s(%#lx): %s\n", __func__,
++			a_name, (unsigned long) stub_addr, strerror(errno));
+ 		goto fail;
+ 	}
+ 
+@@ -503,13 +529,27 @@ jump_to_entry_point(struct process *proc, struct breakpoint *bp)
+ static int
+ unresolve_got_entry(struct process *proc, GElf_Addr addr, GElf_Addr value)
+ {
+-	uint32_t v32 = (uint32_t) value;
+-	uint32_t a32 = (uint32_t) addr;
+-	if (ptrace(PTRACE_POKETEXT, proc->pid, a32, v32) < 0) {
++	arch_addr_t a = (arch_addr_t) (uintptr_t) addr;
++#ifdef __LP64__
++	/* To write 32-bit value in 64-bit mode, we must read-modify-write
++	   the 64-bit value with only the lower 32 bits modified.  */
++	if (proc->mask_32bit) {
++		GElf_Addr orig = ptrace(PTRACE_PEEKTEXT, proc->pid, a, 0);
++		char *obytes = (char *) &orig;
++		char *nbytes = (char *) &value;
++		unsigned i;
++
++		for (i = 0; i < 4; i++)
++			obytes[i] = nbytes[i];
++		value = orig;
++	}
++#endif /* __LP64__ */
++	if (ptrace(PTRACE_POKETEXT, proc->pid, a, (unsigned long) value) < 0) {
+ 		fprintf(stderr, "failed to unresolve GOT entry: %s\n",
+ 			strerror(errno));
+ 		return -1;
+ 	}
++
+ 	return 0;
+ }
+ 
+diff --git a/sysdeps/linux-gnu/mips/signalent1.h b/sysdeps/linux-gnu/mips/signalent1.h
+new file mode 100644
+index 0000000..9e9d1f7
+--- /dev/null
++++ b/sysdeps/linux-gnu/mips/signalent1.h
+@@ -0,0 +1,52 @@
++/*
++ * This file is part of ltrace.
++ * Copyright (C) 2015 Imagination Technologies Limited
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of the
++ * License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA
++ */
++
++	"SIG_0",           /* 0 */
++	"SIGHUP",          /* 1 */
++	"SIGINT",          /* 2 */
++	"SIGQUIT",         /* 3 */
++	"SIGILL",          /* 4 */
++	"SIGTRAP",         /* 5 */
++	"SIGIOT",          /* 6 */
++	"SIGEMT",          /* 7 */
++	"SIGFPE",          /* 8 */
++	"SIGKILL",         /* 9 */
++	"SIGBUS",          /* 10 */
++	"SIGSEGV",         /* 11 */
++	"SIGSYS",          /* 12 */
++	"SIGPIPE",         /* 13 */
++	"SIGALRM",         /* 14 */
++	"SIGTERM",         /* 15 */
++	"SIGUSR1",         /* 16 */
++	"SIGUSR2",         /* 17 */
++	"SIGCHLD",         /* 18 */
++	"SIGPWR",          /* 19 */
++	"SIGWINCH",        /* 20 */
++	"SIGURG",          /* 21 */
++	"SIGIO",           /* 22 */
++	"SIGSTOP",         /* 23 */
++	"SIGTSTP",         /* 24 */
++	"SIGCONT",         /* 25 */
++	"SIGTTIN",         /* 26 */
++	"SIGTTOU",         /* 27 */
++	"SIGVTALRM",       /* 28 */
++	"SIGPROF",         /* 29 */
++	"SIGXCPU",         /* 30 */
++	"SIGXFSZ",         /* 31 */
+diff --git a/sysdeps/linux-gnu/mips/syscallent1.h b/sysdeps/linux-gnu/mips/syscallent1.h
+new file mode 100644
+index 0000000..dfa4954
+--- /dev/null
++++ b/sysdeps/linux-gnu/mips/syscallent1.h
+@@ -0,0 +1,328 @@
++/*
++ * This file is part of ltrace.
++ * Copyright (C) 2015 Imagination Technologies Limited
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of the
++ * License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA
++ */
++
++/* MIPS64 */
++
++	"read",                            /* 0 */
++	"write",                           /* 1 */
++	"open",                            /* 2 */
++	"close",                           /* 3 */
++	"stat",                            /* 4 */
++	"fstat",                           /* 5 */
++	"lstat",                           /* 6 */
++	"poll",                            /* 7 */
++	"lseek",                           /* 8 */
++	"mmap",                            /* 9 */
++	"mprotect",                        /* 10 */
++	"munmap",                          /* 11 */
++	"brk",                             /* 12 */
++	"rt_sigaction",                    /* 13 */
++	"rt_sigprocmask",                  /* 14 */
++	"ioctl",                           /* 15 */
++	"pread64",                         /* 16 */
++	"pwrite64",                        /* 17 */
++	"readv",                           /* 18 */
++	"writev",                          /* 19 */
++	"access",                          /* 20 */
++	"pipe",                            /* 21 */
++	"_newselect",                      /* 22 */
++	"sched_yield",                     /* 23 */
++	"mremap",                          /* 24 */
++	"msync",                           /* 25 */
++	"mincore",                         /* 26 */
++	"madvise",                         /* 27 */
++	"shmget",                          /* 28 */
++	"shmat",                           /* 29 */
++	"shmctl",                          /* 30 */
++	"dup",                             /* 31 */
++	"dup2",                            /* 32 */
++	"pause",                           /* 33 */
++	"nanosleep",                       /* 34 */
++	"getitimer",                       /* 35 */
++	"setitimer",                       /* 36 */
++	"alarm",                           /* 37 */
++	"getpid",                          /* 38 */
++	"sendfile",                        /* 39 */
++	"socket",                          /* 40 */
++	"connect",                         /* 41 */
++	"accept",                          /* 42 */
++	"sendto",                          /* 43 */
++	"recvfrom",                        /* 44 */
++	"sendmsg",                         /* 45 */
++	"recvmsg",                         /* 46 */
++	"shutdown",                        /* 47 */
++	"bind",                            /* 48 */
++	"listen",                          /* 49 */
++	"getsockname",                     /* 50 */
++	"getpeername",                     /* 51 */
++	"socketpair",                      /* 52 */
++	"setsockopt",                      /* 53 */
++	"getsockopt",                      /* 54 */
++	"clone",                           /* 55 */
++	"fork",                            /* 56 */
++	"execve",                          /* 57 */
++	"exit",                            /* 58 */
++	"wait4",                           /* 59 */
++	"kill",                            /* 60 */
++	"uname",                           /* 61 */
++	"semget",                          /* 62 */
++	"semop",                           /* 63 */
++	"semctl",                          /* 64 */
++	"shmdt",                           /* 65 */
++	"msgget",                          /* 66 */
++	"msgsnd",                          /* 67 */
++	"msgrcv",                          /* 68 */
++	"msgctl",                          /* 69 */
++	"fcntl",                           /* 70 */
++	"flock",                           /* 71 */
++	"fsync",                           /* 72 */
++	"fdatasync",                       /* 73 */
++	"truncate",                        /* 74 */
++	"ftruncate",                       /* 75 */
++	"getdents",                        /* 76 */
++	"getcwd",                          /* 77 */
++	"chdir",                           /* 78 */
++	"fchdir",                          /* 79 */
++	"rename",                          /* 80 */
++	"mkdir",                           /* 81 */
++	"rmdir",                           /* 82 */
++	"creat",                           /* 83 */
++	"link",                            /* 84 */
++	"unlink",                          /* 85 */
++	"symlink",                         /* 86 */
++	"readlink",                        /* 87 */
++	"chmod",                           /* 88 */
++	"fchmod",                          /* 89 */
++	"chown",                           /* 90 */
++	"fchown",                          /* 91 */
++	"lchown",                          /* 92 */
++	"umask",                           /* 93 */
++	"gettimeofday",                    /* 94 */
++	"getrlimit",                       /* 95 */
++	"getrusage",                       /* 96 */
++	"sysinfo",                         /* 97 */
++	"times",                           /* 98 */
++	"ptrace",                          /* 99 */
++	"getuid",                          /* 100 */
++	"syslog",                          /* 101 */
++	"getgid",                          /* 102 */
++	"setuid",                          /* 103 */
++	"setgid",                          /* 104 */
++	"geteuid",                         /* 105 */
++	"getegid",                         /* 106 */
++	"setpgid",                         /* 107 */
++	"getppid",                         /* 108 */
++	"getpgrp",                         /* 109 */
++	"setsid",                          /* 110 */
++	"setreuid",                        /* 111 */
++	"setregid",                        /* 112 */
++	"getgroups",                       /* 113 */
++	"setgroups",                       /* 114 */
++	"setresuid",                       /* 115 */
++	"getresuid",                       /* 116 */
++	"setresgid",                       /* 117 */
++	"getresgid",                       /* 118 */
++	"getpgid",                         /* 119 */
++	"setfsuid",                        /* 120 */
++	"setfsgid",                        /* 121 */
++	"getsid",                          /* 122 */
++	"capget",                          /* 123 */
++	"capset",                          /* 124 */
++	"rt_sigpending",                   /* 125 */
++	"rt_sigtimedwait",                 /* 126 */
++	"rt_sigqueueinfo",                 /* 127 */
++	"rt_sigsuspend",                   /* 128 */
++	"sigaltstack",                     /* 129 */
++	"utime",                           /* 130 */
++	"mknod",                           /* 131 */
++	"personality",                     /* 132 */
++	"ustat",                           /* 133 */
++	"statfs",                          /* 134 */
++	"fstatfs",                         /* 135 */
++	"sysfs",                           /* 136 */
++	"getpriority",                     /* 137 */
++	"setpriority",                     /* 138 */
++	"sched_setparam",                  /* 139 */
++	"sched_getparam",                  /* 140 */
++	"sched_setscheduler",              /* 141 */
++	"sched_getscheduler",              /* 142 */
++	"sched_get_priority_max",          /* 143 */
++	"sched_get_priority_min",          /* 144 */
++	"sched_rr_get_interval",           /* 145 */
++	"mlock",                           /* 146 */
++	"munlock",                         /* 147 */
++	"mlockall",                        /* 148 */
++	"munlockall",                      /* 149 */
++	"vhangup",                         /* 150 */
++	"pivot_root",                      /* 151 */
++	"_sysctl",                         /* 152 */
++	"prctl",                           /* 153 */
++	"adjtimex",                        /* 154 */
++	"setrlimit",                       /* 155 */
++	"chroot",                          /* 156 */
++	"sync",                            /* 157 */
++	"acct",                            /* 158 */
++	"settimeofday",                    /* 159 */
++	"mount",                           /* 160 */
++	"umount2",                         /* 161 */
++	"swapon",                          /* 162 */
++	"swapoff",                         /* 163 */
++	"reboot",                          /* 164 */
++	"sethostname",                     /* 165 */
++	"setdomainname",                   /* 166 */
++	"create_module",                   /* 167 */
++	"init_module",                     /* 168 */
++	"delete_module",                   /* 169 */
++	"get_kernel_syms",                 /* 170 */
++	"query_module",                    /* 171 */
++	"quotactl",                        /* 172 */
++	"nfsservctl",                      /* 173 */
++	"getpmsg",                         /* 174 */
++	"putpmsg",                         /* 175 */
++	"afs_syscall",                     /* 176 */
++	"reserved177",                     /* 177 */
++	"gettid",                          /* 178 */
++	"readahead",                       /* 179 */
++	"setxattr",                        /* 180 */
++	"lsetxattr",                       /* 181 */
++	"fsetxattr",                       /* 182 */
++	"getxattr",                        /* 183 */
++	"lgetxattr",                       /* 184 */
++	"fgetxattr",                       /* 185 */
++	"listxattr",                       /* 186 */
++	"llistxattr",                      /* 187 */
++	"flistxattr",                      /* 188 */
++	"removexattr",                     /* 189 */
++	"lremovexattr",                    /* 190 */
++	"fremovexattr",                    /* 191 */
++	"tkill",                           /* 192 */
++	"reserved193",                     /* 193 */
++	"futex",                           /* 194 */
++	"sched_setaffinity",               /* 195 */
++	"sched_getaffinity",               /* 196 */
++	"cacheflush",                      /* 197 */
++	"cachectl",                        /* 198 */
++	"sysmips",                         /* 199 */
++	"io_setup",                        /* 200 */
++	"io_destroy",                      /* 201 */
++	"io_getevents",                    /* 202 */
++	"io_submit",                       /* 203 */
++	"io_cancel",                       /* 204 */
++	"exit_group",                      /* 205 */
++	"lookup_dcookie",                  /* 206 */
++	"epoll_create",                    /* 207 */
++	"epoll_ctl",                       /* 208 */
++	"epoll_wait",                      /* 209 */
++	"remap_file_pages",                /* 210 */
++	"rt_sigreturn",                    /* 211 */
++	"set_tid_address",                 /* 212 */
++	"restart_syscall",                 /* 213 */
++	"semtimedop",                      /* 214 */
++	"fadvise64",                       /* 215 */
++	"timer_create",                    /* 216 */
++	"timer_settime",                   /* 217 */
++	"timer_gettime",                   /* 218 */
++	"timer_getoverrun",                /* 219 */
++	"timer_delete",                    /* 220 */
++	"clock_settime",                   /* 221 */
++	"clock_gettime",                   /* 222 */
++	"clock_getres",                    /* 223 */
++	"clock_nanosleep",                 /* 224 */
++	"tgkill",                          /* 225 */
++	"utimes",                          /* 226 */
++	"mbind",                           /* 227 */
++	"get_mempolicy",                   /* 228 */
++	"set_mempolicy",                   /* 229 */
++	"mq_open",                         /* 230 */
++	"mq_unlink",                       /* 231 */
++	"mq_timedsend",                    /* 232 */
++	"mq_timedreceive",                 /* 233 */
++	"mq_notify",                       /* 234 */
++	"mq_getsetattr",                   /* 235 */
++	"vserver",                         /* 236 */
++	"waitid",                          /* 237 */
++	"238",                             /* 238 */
++	"add_key",                         /* 239 */
++	"request_key",                     /* 240 */
++	"keyctl",                          /* 241 */
++	"set_thread_area",                 /* 242 */
++	"inotify_init",                    /* 243 */
++	"inotify_add_watch",               /* 244 */
++	"inotify_rm_watch",                /* 245 */
++	"migrate_pages",                   /* 246 */
++	"openat",                          /* 247 */
++	"mkdirat",                         /* 248 */
++	"mknodat",                         /* 249 */
++	"fchownat",                        /* 250 */
++	"futimesat",                       /* 251 */
++	"newfstatat",                      /* 252 */
++	"unlinkat",                        /* 253 */
++	"renameat",                        /* 254 */
++	"linkat",                          /* 255 */
++	"symlinkat",                       /* 256 */
++	"readlinkat",                      /* 257 */
++	"fchmodat",                        /* 258 */
++	"faccessat",                       /* 259 */
++	"pselect6",                        /* 260 */
++	"ppoll",                           /* 261 */
++	"unshare",                         /* 262 */
++	"splice",                          /* 263 */
++	"sync_file_range",                 /* 264 */
++	"tee",                             /* 265 */
++	"vmsplice",                        /* 266 */
++	"move_pages",                      /* 267 */
++	"set_robust_list",                 /* 268 */
++	"get_robust_list",                 /* 269 */
++	"kexec_load",                      /* 270 */
++	"getcpu",                          /* 271 */
++	"epoll_pwait",                     /* 272 */
++	"ioprio_set",                      /* 273 */
++	"ioprio_get",                      /* 274 */
++	"utimensat",                       /* 275 */
++	"signalfd",                        /* 276 */
++	"timerfd",                         /* 277 */
++	"eventfd",                         /* 278 */
++	"fallocate",                       /* 279 */
++	"timerfd_create",                  /* 280 */
++	"timerfd_gettime",                 /* 281 */
++	"timerfd_settime",                 /* 282 */
++	"signalfd4",                       /* 283 */
++	"eventfd2",                        /* 284 */
++	"epoll_create1",                   /* 285 */
++	"dup3",                            /* 286 */
++	"pipe2",                           /* 287 */
++	"inotify_init1",                   /* 288 */
++	"preadv",                          /* 289 */
++	"pwritev",                         /* 290 */
++	"rt_tgsigqueueinfo",               /* 291 */
++	"perf_event_open",                 /* 292 */
++	"accept4",                         /* 293 */
++	"recvmmsg",                        /* 294 */
++	"fanotify_init",                   /* 295 */
++	"fanotify_mark",                   /* 296 */
++	"prlimit64",                       /* 297 */
++	"name_to_handle_at",               /* 298 */
++	"open_by_handle_at",               /* 299 */
++	"clock_adjtime",                   /* 300 */
++	"syncfs",                          /* 301 */
++	"sendmmsg",                        /* 302 */
++	"setns",                           /* 303 */
++	"process_vm_readv",                /* 304 */
++	"process_vm_writev",               /* 305 */
+diff --git a/sysdeps/linux-gnu/mips/trace.c b/sysdeps/linux-gnu/mips/trace.c
+index e81b374..d54818e 100644
+--- a/sysdeps/linux-gnu/mips/trace.c
++++ b/sysdeps/linux-gnu/mips/trace.c
+@@ -1,5 +1,6 @@
+ /*
+  * This file is part of ltrace.
++ * Copyright (C) 2015 Imagination Technologies Limited
+  * Copyright (C) 2013 Petr Machata, Red Hat Inc.
+  * Copyright (C) 2012 Edgar E. Iglesias, Axis Communications
+  * Copyright (C) 2010 Arnaud Patard, Mandriva SA
+@@ -29,6 +30,7 @@
+ #include <signal.h>
+ #include <sys/ptrace.h>
+ #include <asm/ptrace.h>
++#include <asm/unistd.h>
+ #include <assert.h>
+ #include <asm/unistd.h>
+ 
+@@ -68,6 +70,44 @@
+ void
+ get_arch_dep(struct process *proc)
+ {
++#ifdef __LP64__
++	proc->mask_32bit = (proc->e_class == ELFCLASS32);
++#endif /* __LP64__ */
++	/* n32 personality is best approximated by n64,
++	   at least for syscall numbers */
++	proc->personality = (proc->e_class == ELFCLASS64
++			     || proc->e_abi == ABI_N32);
++}
++
++/**
++   \param abi ABI of current process, from mips_abi_type enum
++   \param list An array of 4 elements, each corresponding to an ABI, in
++   the order: o32, n32, n64, o64
++
++   return value from array corresponding to requested ABI
++ */
++static int
++abi_select(const int abi, const int list[])
++{
++	int retval;
++	switch (abi)
++	{
++	case ABI_N32:
++		retval = list[1];
++		break;
++	case ABI_N64:
++		retval = list[2];
++		break;
++	case ABI_O64:
++		retval = list[3];
++		break;
++	case ABI_O32:
++	default:
++		retval = list[0];
++		break;
++	}
++
++	return retval;
+ }
+ 
+ /**
+@@ -90,53 +130,94 @@ get_arch_dep(struct process *proc)
+ int
+ syscall_p(struct process *proc, int status, int *sysnum)
+ {
+-	if (WIFSTOPPED(status)
+-			&& WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) {
+-		/* get the user's pc (plus 8) */
+-		long pc = (long)get_instruction_pointer(proc);
+-		/* fetch the SWI instruction */
+-		int insn = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 4, 0);
+-		int num = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 8, 0);
+-
+-		/*
+-		   On a mips,  syscall looks like:
+-		   24040fa1    li v0, 0x0fa1   # 4001 --> _exit syscall
+-		   0000000c    syscall
+-		 */
+-		if(insn!=0x0000000c){
+-			/* sigreturn returns control to the point
+-			   where the signal was received; skip check 
+-			   for preceeding syscall instruction */
+-			int depth = proc->callstack_depth;
+-			struct callstack_element *top = NULL;
+-			if (depth > 0)
+-				top = &proc->callstack[depth - 1];
+-
+-			if (top != NULL &&  top->is_syscall &&
+-			    (top->c_un.syscall == (__NR_rt_sigreturn -
+-						   __NR_Linux) ||
+-			     top->c_un.syscall == (__NR_sigreturn -
+-						   __NR_Linux))) {
+-				*sysnum = top->c_un.syscall;
+-				return 2;
+-			}
+-			else
+-				return 0;
+-		}
+-
+-		*sysnum = (num & 0xFFFF) - 4000;
+-		/* if it is a syscall, return 1 or 2 */
+-		if (proc->callstack_depth > 0 &&
+-				proc->callstack[proc->callstack_depth - 1].is_syscall &&
+-				proc->callstack[proc->callstack_depth - 1].c_un.syscall == *sysnum) {
++	unsigned long pc;
++	int insn, prev;
++	int min_syscall, max_syscall, sigreturn, rt_sigreturn;
++	struct callstack_element *top = NULL;
++	int depth = proc->callstack_depth;
++	const int syscallbase[] = {__NR_O32_Linux, __NR_N32_Linux,
++				   __NR_64_Linux, __NR_O32_Linux};
++	const int syscallnum[] = {__NR_O32_Linux_syscalls,
++				  __NR_N32_Linux_syscalls,
++				  __NR_64_Linux_syscalls,
++				  __NR_O32_Linux_syscalls};
++	const int rt_sigreturn_list[] = {193, 211, 211, 193};
++	const int sigreturn_list[] = {119, -1, -1, 119};
++
++	if (!WIFSTOPPED(status)
++	    || WSTOPSIG(status) != (SIGTRAP | proc->tracesysgood))
++		return 0;
++
++	/* get the user's pc (plus 8) */
++	pc = (unsigned long)get_instruction_pointer(proc);
++	/* fetch the SWI instruction */
++	insn = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 4, 0);
++	prev = ptrace(PTRACE_PEEKTEXT, proc->pid, pc - 8, 0);
++
++	if (depth > 0)
++		top = &proc->callstack[depth - 1];
++
++	/* Range of syscall numbers varies with ABI; ref:asm/unistd.h */
++	min_syscall = abi_select(proc->e_abi, syscallbase);
++	max_syscall = min_syscall + abi_select(proc->e_abi, syscallnum);
++	sigreturn = min_syscall + abi_select(proc->e_abi, sigreturn_list);
++	rt_sigreturn = min_syscall + abi_select(proc->e_abi, rt_sigreturn_list);
++
++	/* not a syscall instruction */
++	if(insn!=0x0000000c){
++		/* sigreturn returns control to the point where the signal was
++		   received; skip check for preceeding syscall instruction */
++		if (top != NULL &&  top->is_syscall
++		    && (top->c_un.syscall == (rt_sigreturn - min_syscall)
++			|| top->c_un.syscall == (sigreturn - min_syscall))) {
++			*sysnum = top->c_un.syscall;
+ 			return 2;
+ 		}
++		else
++			return 0;
++	}
+ 
+-		if (*sysnum >= 0) {
+-			return 1;
+-		}
++	/*
++	  On a mips,  syscall looks like:
++	  24020fa1    li v0, 0x0fa1   # 4001 --> _exit syscall
++	  0000000c    syscall
++	*/
++	if ((prev & 0xFFFF0000) == 0x24020000) {
++		*sysnum = (prev & 0xFFFF) - min_syscall;
+ 	}
+-	return 0;
++	/*
++	  The above is not necessary in Linux kernel > v2.6.35. Recent
++	  kernels have a fancy-pants method of restarting syscalls.
++	  We must read v0 instead, to get the syscall number.
++
++	  Unfortunately, v0 is not preserved till the point of return.
++	  If already in syscall and v0 is invalid, assume this event
++	  to be a return without attempting to match previous syscall.
++
++	  Caveat: logic fails if v0 incidentally contains a valid
++	  syscall number, distinct from the current syscall number,
++	  at the point of return from a nested syscall.
++	*/
++	else {
++		int v0 = ptrace(PTRACE_PEEKUSER, proc->pid, off_v0, 0);
++
++		if ((v0 >= min_syscall) && (v0 <= max_syscall))
++			*sysnum = v0 - min_syscall;
++		else if (depth > 0 && top->is_syscall)
++			*sysnum = top->c_un.syscall;
++		else /* syscall instruction without valid number - ignored */
++			return 0;
++	}
++
++	/* if it is a syscall, return 1 or 2 */
++	if (depth > 0 && top->is_syscall && top->c_un.syscall == *sysnum) {
++		return 2;
++	}
++
++	if (*sysnum >= 0)
++		return 1;
++	else
++		return 0;
+ }
+ 
+ /* Based on GDB code.  */
+@@ -162,9 +243,11 @@ mips32_relative_offset (uint32_t inst)
+   return ((itype_immediate(inst) ^ 0x8000) - 0x8000) << 2;
+ }
+ 
+-int mips_next_pcs(struct process *proc, uint32_t pc, uint32_t *newpc)
++int mips_next_pcs(struct process *proc, unsigned long pc,
++		  unsigned long *newpc)
+ {
+-	uint32_t inst, rx;
++	uint32_t inst;
++	unsigned long rx;
+ 	int op;
+ 	int rn;
+ 	int nr = 0;
+@@ -277,8 +360,8 @@ int mips_next_pcs(struct process *proc, uint32_t pc, uint32_t *newpc)
+ 	return nr;
+ 
+ fail:
+-	printf("nr=%d pc=%x\n", nr, pc);
+-	printf("pc=%x %x\n", newpc[0], newpc[1]);
++	printf("nr=%d pc=%lx\n", nr, pc);
++	printf("pc=%lx %lx\n", newpc[0], newpc[1]);
+ 	return 0;
+ }
+ 
+@@ -304,17 +387,27 @@ fail:
+  * branches within the LL-SC sequence.
+  */
+ #define inrange(x,lo,hi) ((x)<=(hi) && (x)>=(lo))
++/* Instruction encodings for atomic operations */
++#ifdef __mips64
++#define op_SC_p(op)	(op == 0x38 || op == 0x3c)
++#define op_LL_p(op)	(op == 0x30 || op == 0x34)
++#else /* !__mips64 */
++#define op_SC_p(op)	(op == 0x38)
++#define op_LL_p(op)	(op == 0x30)
++#endif /* !__mips64 */
++
+ static int
+-mips_atomic_next_pcs(struct process *proc, uint32_t lladdr, uint32_t *newpcs)
++mips_atomic_next_pcs(struct process *proc, unsigned long lladdr,
++		     unsigned long *newpcs)
+ {
+ 	int nr = 0;
+ 
+-	uint32_t scaddr;
++	unsigned long scaddr;
+ 	for (scaddr = lladdr + 4; scaddr - lladdr <= 2048; scaddr += 4) {
+ 		/* Found SC, now stepover trailing branch */
+ 		uint32_t inst;
+ 		if (proc_read_32(proc, (arch_addr_t)scaddr, &inst) >= 0 &&
+-		    itype_op(inst) == 0x38) {
++		    op_SC_p (itype_op(inst))) {
+ 			newpcs[nr++] = scaddr + 4;
+ 			break;
+ 		}
+@@ -327,16 +420,16 @@ mips_atomic_next_pcs(struct process *proc, uint32_t lladdr, uint32_t *newpcs)
+ 	}
+ 
+ 	/* Scan LL<->SC range for branches going outside that range */
+-	uint32_t spc;
++	unsigned long spc;
+ 	for (spc = lladdr + 4; spc < scaddr; spc += 4) {
+-		uint32_t scanpcs[2];
++		unsigned long scanpcs[2];
+ 		int snr = mips_next_pcs(proc, spc, scanpcs);
+ 
+ 		int i;
+ 		for (i = 0; i < snr; ++i) {
+ 			if (!inrange(scanpcs[i], lladdr, scaddr)) {
+-				uint32_t *tmp = realloc(newpcs, (nr + 1) *
+-							sizeof *newpcs);
++				unsigned long *tmp = realloc(newpcs, (nr + 1)
++							     * sizeof *newpcs);
+ 				if (tmp == NULL) {
+ 					perror("malloc atomic next pcs");
+ 					return -1;
+@@ -357,8 +450,8 @@ arch_sw_singlestep(struct process *proc, struct breakpoint *bp,
+ 		   int (*add_cb)(arch_addr_t, struct sw_singlestep_data *),
+ 		   struct sw_singlestep_data *add_cb_data)
+ {
+-	uint32_t pc = (uint32_t) get_instruction_pointer(proc);
+-	uint32_t *newpcs;
++	unsigned long pc = (unsigned long) get_instruction_pointer(proc);
++	unsigned long *newpcs;
+ 	int nr;
+ 	uint32_t inst;
+ 
+@@ -369,7 +462,7 @@ arch_sw_singlestep(struct process *proc, struct breakpoint *bp,
+ 		return SWS_FAIL;
+ 
+ 	/* Starting an atomic read-modify-write sequence */
+-	if (itype_op(inst) == 0x30)
++	if (op_LL_p(itype_op(inst)))
+ 		nr = mips_atomic_next_pcs(proc, pc, newpcs);
+ 	else
+ 		nr = mips_next_pcs(proc, pc, newpcs);
+@@ -462,7 +555,7 @@ gimme_arg(enum tof type, struct process *proc, int arg_num,
+ 				debug(2,"ret = %#lx",addr);
+ 				return addr;
+ 			}
+-			ret = addr + 4*arg_num;
++			ret = addr + sizeof(long) * arg_num;
+ 			ret=ptrace(PTRACE_PEEKTEXT,proc->pid,addr,0);
+ 			debug(2,"ret = %#lx",ret);
+ 			return ret;
+@@ -474,7 +567,7 @@ gimme_arg(enum tof type, struct process *proc, int arg_num,
+ 			debug(2,"ret = %#lx",addr);
+ 			return addr;
+ 		}
+-		ret = addr + 4*arg_num;
++		ret = addr + sizeof(long) * arg_num;
+ 		ret=ptrace(PTRACE_PEEKTEXT,proc->pid,addr,0);
+ 		debug(2,"ret = %#lx",ret);
+ 		return ret;
+@@ -483,4 +576,34 @@ gimme_arg(enum tof type, struct process *proc, int arg_num,
+ 	return 0;
+ }
+ 
++#ifdef __LP64__
++size_t
++arch_type_sizeof(struct process *proc, struct arg_type_info *info)
++{
++	if (proc == NULL)
++		return (size_t)-2;
++
++	switch (info->type) {
++	case ARGTYPE_LONG:
++	case ARGTYPE_ULONG:
++		return proc->mask_32bit ? 4 : sizeof (long);
++
++	case ARGTYPE_POINTER:
++		return proc->mask_32bit ? 4 : sizeof (void *);
++
++	default:
++		/* Use default value.  */
++		return (size_t)-2;
++	}
++}
++
++size_t
++arch_type_alignof(struct process *proc, struct arg_type_info *info)
++{
++	if (proc == NULL)
++		return (size_t)-2;
++
++	return arch_type_sizeof(proc, info);
++}
++#endif /* __LP64__ */
+ /**@}*/
+diff --git a/sysdeps/linux-gnu/mksyscallent_mips b/sysdeps/linux-gnu/mksyscallent_mips
+index f3961b4..f8dcfe1 100755
+--- a/sysdeps/linux-gnu/mksyscallent_mips
++++ b/sysdeps/linux-gnu/mksyscallent_mips
+@@ -19,9 +19,7 @@
+ 
+ # hack expression to generate arch/syscallent.h from <asm/unistd.h>
+ # It reads from stdin and writes to stdout
+-# It should work OK on i386,m68k,arm,ia64
+-# It does NOT work in mips, s390
+-# It is untested in other architectures
++# Default is o32; arch=mips64 generates n64 syscalls
+ 
+ BEGIN {
+ 	max=0;
+@@ -31,7 +29,10 @@ BEGIN {
+ {
+ 	#debug
+ 	#printf("/%s/%s/%s/%s/\n", $1, $2, $3, $4);
+-	if ($2 ~ /__NR_Linux/ && $3 ~ /4000/) {
++        min=4000
++        if (arch ~ "mips64") min=5000
++
++	if ($2 ~ /__NR_Linux/ && $3 ~ min) {
+ 		syscall=1;
+ 	}
+ 	if ($2 ~ /__NR_Linux_syscalls/) {
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Fix-tautological-compare-warning.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Fix-tautological-compare-warning.patch
new file mode 100644
index 0000000..a599d0e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Fix-tautological-compare-warning.patch
@@ -0,0 +1,261 @@
+From 0af8ced6376f2256b9daac301c851e1c99c3b035 Mon Sep 17 00:00:00 2001
+From: Adam Trhon <adam.trhon@tbs-biometrics.com>
+Date: Fri, 12 May 2017 13:39:11 +0200
+Subject: [PATCH] Fix tautological compare warning
+
+By default, gcc ignores warning from code generated by macros
+(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80369). When
+ltrace is compiled under icecream the warning *is generated*
+(https://github.com/icecc/icecream/issues/202)
+and the compilation fails (because of -Werror).
+
+Upstream-Status: Submitted [ltrace-devel@lists.alioth.debian.org]
+
+Signed-off-by: Adam Trhon <adam.trhon@tbs-biometrics.com>
+---
+ filter.c                        | 4 ++--
+ sysdeps/linux-gnu/arm/fetch.c   | 2 +-
+ sysdeps/linux-gnu/arm/trace.c   | 2 +-
+ sysdeps/linux-gnu/ia64/fetch.c  | 2 +-
+ sysdeps/linux-gnu/metag/trace.c | 2 +-
+ sysdeps/linux-gnu/mips/plt.c    | 2 +-
+ sysdeps/linux-gnu/ppc/fetch.c   | 2 +-
+ sysdeps/linux-gnu/ppc/plt.c     | 2 +-
+ sysdeps/linux-gnu/ppc/trace.c   | 4 ++--
+ sysdeps/linux-gnu/s390/fetch.c  | 2 +-
+ sysdeps/linux-gnu/s390/trace.c  | 4 ++--
+ sysdeps/linux-gnu/x86/fetch.c   | 2 +-
+ sysdeps/linux-gnu/x86/trace.c   | 4 ++--
+ value.c                         | 4 ++--
+ 14 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/filter.c b/filter.c
+index ba50c40..a65856d 100644
+--- a/filter.c
++++ b/filter.c
+@@ -79,7 +79,7 @@ filter_lib_matcher_name_init(struct filter_lib_matcher *matcher,
+ {
+ 	switch (type) {
+ 	case FLM_MAIN:
+-		assert(type != type);
++		assert(!"Unexpected value of type");
+ 		abort();
+ 
+ 	case FLM_SONAME:
+@@ -137,7 +137,7 @@ matcher_matches_library(struct filter_lib_matcher *matcher, struct library *lib)
+ 	case FLM_MAIN:
+ 		return lib->type == LT_LIBTYPE_MAIN;
+ 	}
+-	assert(matcher->type != matcher->type);
++	assert(!"Unexpected value of matcher->type");
+ 	abort();
+ }
+ 
+diff --git a/sysdeps/linux-gnu/arm/fetch.c b/sysdeps/linux-gnu/arm/fetch.c
+index b500448..8f75fcf 100644
+--- a/sysdeps/linux-gnu/arm/fetch.c
++++ b/sysdeps/linux-gnu/arm/fetch.c
+@@ -317,7 +317,7 @@ arch_fetch_retval(struct fetch_context *ctx, enum tof type,
+ 		memmove(data, ctx->regs.uregs, sz);
+ 		return 0;
+ 	}
+-	assert(info->type != info->type);
++	assert(!"Unexpected value of info->type");
+ 	abort();
+ }
+ 
+diff --git a/sysdeps/linux-gnu/arm/trace.c b/sysdeps/linux-gnu/arm/trace.c
+index 5e51e91..e76bf63 100644
+--- a/sysdeps/linux-gnu/arm/trace.c
++++ b/sysdeps/linux-gnu/arm/trace.c
+@@ -701,7 +701,7 @@ arch_type_sizeof(struct process *proc, struct arg_type_info *info)
+ 		return (size_t)-2;
+ 
+ 	default:
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		abort();
+ 	}
+ }
+diff --git a/sysdeps/linux-gnu/ia64/fetch.c b/sysdeps/linux-gnu/ia64/fetch.c
+index 171c7a2..ee2fbc7 100644
+--- a/sysdeps/linux-gnu/ia64/fetch.c
++++ b/sysdeps/linux-gnu/ia64/fetch.c
+@@ -409,7 +409,7 @@ arch_fetch_arg_next(struct fetch_context *ctx, enum tof type,
+ 	case ARGTYPE_ARRAY:
+ 		/* Arrays decay into pointers.  XXX Fortran?  */
+ 	default:
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		abort();
+ 	}
+ }
+diff --git a/sysdeps/linux-gnu/metag/trace.c b/sysdeps/linux-gnu/metag/trace.c
+index ad5fffe..7a843d6 100644
+--- a/sysdeps/linux-gnu/metag/trace.c
++++ b/sysdeps/linux-gnu/metag/trace.c
+@@ -142,7 +142,7 @@ get_regval_from_unit(enum metag_unitnum unit, unsigned int reg,
+ 		return regs->ax[reg][0];
+ 	/* We really shouldn't be here.  */
+ 	default:
+-		assert(unit != unit);
++		assert(!"Unexpected value of unit");
+ 		abort();
+ 	}
+ 	return 0;
+diff --git a/sysdeps/linux-gnu/mips/plt.c b/sysdeps/linux-gnu/mips/plt.c
+index c7c10ac..ca2307d 100644
+--- a/sysdeps/linux-gnu/mips/plt.c
++++ b/sysdeps/linux-gnu/mips/plt.c
+@@ -651,7 +651,7 @@ mips_stub_bp_continue(struct breakpoint *bp, struct process *proc)
+ 		break;
+ 	}
+ 
+-	assert(bp->libsym->arch.type != bp->libsym->arch.type);
++	assert(!"Unexpected value of bp->libsym->arch.type");
+ 	abort();
+ }
+ 
+diff --git a/sysdeps/linux-gnu/ppc/fetch.c b/sysdeps/linux-gnu/ppc/fetch.c
+index c6cbd71..5db5675 100644
+--- a/sysdeps/linux-gnu/ppc/fetch.c
++++ b/sysdeps/linux-gnu/ppc/fetch.c
+@@ -502,7 +502,7 @@ allocate_argument(struct fetch_context *ctx, struct process *proc,
+ 	case ARGTYPE_ARRAY:
+ 		/* Arrays decay into pointers.  XXX Fortran?  */
+ 	default:
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		abort();
+ 	}
+ 
+diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c
+index 5f81889..781da03 100644
+--- a/sysdeps/linux-gnu/ppc/plt.c
++++ b/sysdeps/linux-gnu/ppc/plt.c
+@@ -1085,7 +1085,7 @@ ppc_plt_bp_continue(struct breakpoint *bp, struct process *proc)
+ 		break;
+ 	}
+ 
+-	assert(bp->libsym->arch.type != bp->libsym->arch.type);
++	assert(!"Unexpected value of bp->libsym->arch.type");
+ 	abort();
+ }
+ 
+diff --git a/sysdeps/linux-gnu/ppc/trace.c b/sysdeps/linux-gnu/ppc/trace.c
+index 5aab538..caa6035 100644
+--- a/sysdeps/linux-gnu/ppc/trace.c
++++ b/sysdeps/linux-gnu/ppc/trace.c
+@@ -217,7 +217,7 @@ arch_type_sizeof(struct process *proc, struct arg_type_info *info)
+ 		return (size_t)-2;
+ 
+ 	default:
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		abort();
+ 		break;
+ 	}
+@@ -231,7 +231,7 @@ arch_type_alignof(struct process *proc, struct arg_type_info *info)
+ 
+ 	switch (info->type) {
+ 	default:
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		abort();
+ 		break;
+ 
+diff --git a/sysdeps/linux-gnu/s390/fetch.c b/sysdeps/linux-gnu/s390/fetch.c
+index 4ad5951..4721c30 100644
+--- a/sysdeps/linux-gnu/s390/fetch.c
++++ b/sysdeps/linux-gnu/s390/fetch.c
+@@ -266,7 +266,7 @@ arch_fetch_arg_next(struct fetch_context *ctx, enum tof type,
+ 		return allocate_gpr(ctx, proc, info, valuep, sz);
+ 
+ 	default:
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		abort();
+ 	}
+ 	return -1;
+diff --git a/sysdeps/linux-gnu/s390/trace.c b/sysdeps/linux-gnu/s390/trace.c
+index 78b04c3..24f7801 100644
+--- a/sysdeps/linux-gnu/s390/trace.c
++++ b/sysdeps/linux-gnu/s390/trace.c
+@@ -213,7 +213,7 @@ arch_type_sizeof(struct process *proc, struct arg_type_info *info)
+ 		return (size_t)-2;
+ 
+ 	default:
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		abort();
+ 	}
+ }
+@@ -226,7 +226,7 @@ arch_type_alignof(struct process *proc, struct arg_type_info *info)
+ 
+ 	switch (info->type) {
+ 	default:
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		break;
+ 
+ 	case ARGTYPE_CHAR:
+diff --git a/sysdeps/linux-gnu/x86/fetch.c b/sysdeps/linux-gnu/x86/fetch.c
+index 6868101..ae2ed79 100644
+--- a/sysdeps/linux-gnu/x86/fetch.c
++++ b/sysdeps/linux-gnu/x86/fetch.c
+@@ -523,7 +523,7 @@ classify(struct process *proc, struct fetch_context *context,
+ 
+ 	default:
+ 		/* Unsupported type.  */
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		abort();
+ 	}
+ 	abort();
+diff --git a/sysdeps/linux-gnu/x86/trace.c b/sysdeps/linux-gnu/x86/trace.c
+index 6a1a6a5..d8d2115 100644
+--- a/sysdeps/linux-gnu/x86/trace.c
++++ b/sysdeps/linux-gnu/x86/trace.c
+@@ -145,7 +145,7 @@ arch_type_sizeof(struct process *proc, struct arg_type_info *info)
+ 		return (size_t)-2;
+ 
+ 	default:
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		abort();
+ 	}
+ }
+@@ -158,7 +158,7 @@ arch_type_alignof(struct process *proc, struct arg_type_info *info)
+ 
+ 	switch (info->type) {
+ 	default:
+-		assert(info->type != info->type);
++		assert(!"Unexpected value of info->type");
+ 		abort();
+ 		break;
+ 
+diff --git a/value.c b/value.c
+index 2125ba9..30edb4e 100644
+--- a/value.c
++++ b/value.c
+@@ -363,7 +363,7 @@ value_set_word(struct value *value, long word)
+ 		u.u64 = word;
+ 		break;
+ 	default:
+-		assert(sz != sz);
++		assert(!"Unexpected value of sz");
+ 		abort();
+ 	}
+ 
+@@ -414,7 +414,7 @@ value_extract_word(struct value *value, long *retp,
+ 		*retp = (long)u.u64;
+ 		return 0;
+ 	default:
+-		assert(sz != sz);
++		assert(!"Unexpected value of sz");
+ 		abort();
+ 	}
+ }
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Use-correct-enum-type.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Use-correct-enum-type.patch
new file mode 100644
index 0000000..01a3584
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Use-correct-enum-type.patch
@@ -0,0 +1,28 @@
+From df490528d1e81a98ba2991c700c92a8e6c969083 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Mar 2017 21:32:22 -0800
+Subject: [PATCH 1/2] Use correct enum type
+
+Clang warns about wrong enum initializtion
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/linux-gnu/aarch64/fetch.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/linux-gnu/aarch64/fetch.c b/sysdeps/linux-gnu/aarch64/fetch.c
+index 2744df0..1dcf7cc 100644
+--- a/sysdeps/linux-gnu/aarch64/fetch.c
++++ b/sysdeps/linux-gnu/aarch64/fetch.c
+@@ -173,7 +173,7 @@ static struct fetch_script
+ pass_arg(struct fetch_context const *context,
+ 	 struct process *proc, struct arg_type_info *info)
+ {
+-	enum fetch_method cvt = CVT_NOP;
++	enum convert_method cvt = CVT_NOP;
+ 
+ 	size_t sz = type_sizeof(proc, info);
+ 	if (sz == (size_t) -1)
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-configure-Recognise-linux-musl-as-a-host-OS.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-configure-Recognise-linux-musl-as-a-host-OS.patch
new file mode 100644
index 0000000..52264a1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-configure-Recognise-linux-musl-as-a-host-OS.patch
@@ -0,0 +1,25 @@
+From c1d3aaf5ec810c2594938438c7b4ccd20943f255 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 7 Jul 2017 10:20:52 -0700
+Subject: [PATCH] configure: Recognise linux-musl as a host OS
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index 3e8667f..95d6642 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -35,6 +35,7 @@ AC_CANONICAL_HOST
+ case "${host_os}" in
+     linux-gnu*) HOST_OS="linux-gnu" ;;
+     linux-uclibc*) HOST_OS="linux-gnu" ;;
++    linux-musl*) HOST_OS="linux-gnu" ;;
+     *)		AC_MSG_ERROR([unkown host-os ${host_os}]) ;;
+ esac
+ AC_SUBST(HOST_OS)
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0002-Fix-const-qualifier-error.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0002-Fix-const-qualifier-error.patch
new file mode 100644
index 0000000..c152771
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0002-Fix-const-qualifier-error.patch
@@ -0,0 +1,76 @@
+From 4d3ec1a514f9b1df8ce3a1b04c8a2823d977377f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Mar 2017 21:34:01 -0800
+Subject: [PATCH 2/2] Fix const qualifier error
+
+Fixes clang warning
+error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dict.h    | 2 +-
+ library.c | 2 +-
+ vect.h    | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+Index: git/dict.h
+===================================================================
+--- git.orig/dict.h
++++ git/dict.h
+@@ -90,7 +90,7 @@ int dict_clone(struct dict *target, cons
+ 		assert(_source_d->values.elt_size == sizeof(VALUE_TYPE)); \
+ 		/* Check that callbacks are typed properly.  */		\
+ 		void (*_key_dtor_cb)(KEY_TYPE *, void *) = DTOR_KEY;	\
+-		int (*_key_clone_cb)(KEY_TYPE *, const KEY_TYPE *,	\
++		int (*_key_clone_cb)(KEY_TYPE *, KEY_TYPE *,	\
+ 				     void *) = CLONE_KEY;		\
+ 		void (*_value_dtor_cb)(VALUE_TYPE *, void *) = DTOR_VALUE; \
+ 		int (*_value_clone_cb)(VALUE_TYPE *, const VALUE_TYPE *, \
+Index: git/library.c
+===================================================================
+--- git.orig/library.c
++++ git/library.c
+@@ -353,7 +353,7 @@ static void
+ library_exported_names_init(struct library_exported_names *names)
+ {
+ 	DICT_INIT(&names->names,
+-		  const char*, uint64_t,
++		  char*, uint64_t,
+ 		  dict_hash_string, dict_eq_string, NULL);
+ 	DICT_INIT(&names->addrs,
+ 		  uint64_t, struct vect*,
+Index: git/vect.h
+===================================================================
+--- git.orig/vect.h
++++ git/vect.h
+@@ -66,7 +66,7 @@ int vect_clone(struct vect *target, cons
+ 		assert(_source_vec->elt_size == sizeof(ELT_TYPE));	\
+ 		/* Check that callbacks are typed properly.  */		\
+ 		void (*_dtor_callback)(ELT_TYPE *, void *) = DTOR;	\
+-		int (*_clone_callback)(ELT_TYPE *, const ELT_TYPE *,	\
++		int (*_clone_callback)(ELT_TYPE *, ELT_TYPE *,	\
+ 				       void *) = CLONE;			\
+ 		vect_clone((TGT_VEC), _source_vec,			\
+ 			   (int (*)(void *, const void *,		\
+Index: git/value_dict.c
+===================================================================
+--- git.orig/value_dict.c
++++ git/value_dict.c
+@@ -40,7 +40,7 @@ val_dict_init(struct value_dict *dict)
+ }
+ 
+ static int
+-value_clone_cb(struct value *tgt, const struct value *src, void *data)
++value_clone_cb(struct value *tgt, struct value *src, void *data)
+ {
+ 	return value_clone(tgt, src);
+ }
+@@ -53,7 +53,7 @@ value_dtor(struct value *val, void *data
+ 
+ static int
+ named_value_clone(struct named_value *tgt,
+-		  const struct named_value *src, void *data)
++		  struct named_value *src, void *data)
+ {
+ 	tgt->name = strdup(src->name);
+ 	if (tgt->name == NULL)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
index 8ae0185..01b3bbe 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
@@ -10,20 +10,26 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
 
 PE = "1"
-PV = "7.3+git${SRCPV}"
-SRCREV = "01b10e191e99d8cb147e5a2b7da8196e0ec6fb94"
+PV = "7.91+git${SRCPV}"
+SRCREV = "c22d359433b333937ee3d803450dc41998115685"
 
 DEPENDS = "elfutils"
 RDEPENDS_${PN} = "elfutils"
 SRC_URI = "git://anonscm.debian.org/collab-maint/ltrace.git;branch=master \
            file://configure-allow-to-disable-selinux-support.patch \
            file://0001-replace-readdir_r-with-readdir.patch \
-          "
+           file://0001-Use-correct-enum-type.patch \
+           file://0002-Fix-const-qualifier-error.patch \
+           file://0001-ARM-code-has-unreachable-code-after-switch-statement.patch \
+           file://0001-Fix-tautological-compare-warning.patch \
+           file://0001-Add-support-for-mips64-n32-n64.patch \
+           file://0001-configure-Recognise-linux-musl-as-a-host-OS.patch \
+           "
 S = "${WORKDIR}/git"
 
 inherit autotools
 
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
 PACKAGECONFIG[unwind] = "--with-libunwind,--without-libunwind,libunwind"
 PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb
index 964dc1d..cee9cc4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/luajit/luajit_2.0.4.bb
@@ -11,7 +11,7 @@
 
 S = "${WORKDIR}/LuaJIT-${PV}"
 
-inherit pkgconfig binconfig
+inherit pkgconfig binconfig siteinfo
 
 BBCLASSEXTEND = "native"
 
@@ -21,9 +21,7 @@
 # you need to install the multilib development package (e.g.
 # libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
 # (HOST_CC="gcc -m32").
-BUILD_CC_ARCH_append_powerpc = ' -m32'
-BUILD_CC_ARCH_append_x86 = ' -m32'
-BUILD_CC_ARCH_append_arm = ' -m32'
+BUILD_CC_ARCH_append = " ${@['-m32',''][d.getVar('SITEINFO_BITS', True) != '32']}"
 
 # The lua makefiles expect the TARGET_SYS to be from uname -s
 # Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/mercurial/files/mercurial-CVE-2017-9462.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/mercurial/files/mercurial-CVE-2017-9462.patch
new file mode 100644
index 0000000..3564661
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/mercurial/files/mercurial-CVE-2017-9462.patch
@@ -0,0 +1,135 @@
+# HG changeset patch
+# User Augie Fackler <augie@google.com>
+# Date 1492021435 25200
+#      Wed Apr 12 11:23:55 2017 -0700
+# Branch stable
+# Node ID 77eaf9539499a1b8be259ffe7ada787d07857f80
+# Parent  68f263f52d2e3e2798b4f1e55cb665c6b043f93b
+dispatch: protect against malicious 'hg serve --stdio' invocations (sec)
+
+Some shared-ssh installations assume that 'hg serve --stdio' is a safe
+command to run for minimally trusted users. Unfortunately, the messy
+implementation of argument parsing here meant that trying to access a
+repo named '--debugger' would give the user a pdb prompt, thereby
+sidestepping any hoped-for sandboxing. Serving repositories over HTTP(S)
+is unaffected.
+
+We're not currently hardening any subcommands other than 'serve'. If
+your service exposes other commands to users with arbitrary repository
+names, it is imperative that you defend against repository names of
+'--debugger' and anything starting with '--config'.
+
+The read-only mode of hg-ssh stopped working because it provided its hook
+configuration to "hg serve --stdio" via --config parameter. This is banned for
+security reasons now. This patch switches it to directly call ui.setconfig().
+If your custom hosting infrastructure relies on passing --config to
+"hg serve --stdio", you'll need to find a different way to get that configuration
+into Mercurial, either by using ui.setconfig() as hg-ssh does in this patch,
+or by placing an hgrc file someplace where Mercurial will read it.
+
+mitrandir@fb.com provided some extra fixes for the dispatch code and
+for hg-ssh in places that I overlooked.
+
+CVE: CVE-2017-9462
+
+Upstream-Status: Backport
+
+diff --git a/contrib/hg-ssh b/contrib/hg-ssh
+--- a/contrib/hg-ssh
++++ b/contrib/hg-ssh
+@@ -32,7 +32,7 @@
+ # enable importing on demand to reduce startup time
+ from mercurial import demandimport; demandimport.enable()
+ 
+-from mercurial import dispatch
++from mercurial import dispatch, ui as uimod
+ 
+ import sys, os, shlex
+ 
+@@ -61,14 +61,15 @@
+         repo = os.path.normpath(os.path.join(cwd, os.path.expanduser(path)))
+         if repo in allowed_paths:
+             cmd = ['-R', repo, 'serve', '--stdio']
++            req = dispatch.request(cmd)
+             if readonly:
+-                cmd += [
+-                    '--config',
+-                    'hooks.pretxnopen.hg-ssh=python:__main__.rejectpush',
+-                    '--config',
+-                    'hooks.prepushkey.hg-ssh=python:__main__.rejectpush'
+-                    ]
+-            dispatch.dispatch(dispatch.request(cmd))
++                if not req.ui:
++                    req.ui = uimod.ui.load()
++                req.ui.setconfig('hooks', 'pretxnopen.hg-ssh',
++                                 'python:__main__.rejectpush', 'hg-ssh')
++                req.ui.setconfig('hooks', 'prepushkey.hg-ssh',
++                                 'python:__main__.rejectpush', 'hg-ssh')
++            dispatch.dispatch(req)
+         else:
+             sys.stderr.write('Illegal repository "%s"\n' % repo)
+             sys.exit(255)
+diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
+--- a/mercurial/dispatch.py
++++ b/mercurial/dispatch.py
+@@ -155,6 +155,37 @@
+         pass # happens if called in a thread
+ 
+     def _runcatchfunc():
++        realcmd = None
++        try:
++            cmdargs = fancyopts.fancyopts(req.args[:], commands.globalopts, {})
++            cmd = cmdargs[0]
++            aliases, entry = cmdutil.findcmd(cmd, commands.table, False)
++            realcmd = aliases[0]
++        except (error.UnknownCommand, error.AmbiguousCommand,
++                IndexError, getopt.GetoptError):
++            # Don't handle this here. We know the command is
++            # invalid, but all we're worried about for now is that
++            # it's not a command that server operators expect to
++            # be safe to offer to users in a sandbox.
++            pass
++        if realcmd == 'serve' and '--stdio' in cmdargs:
++            # We want to constrain 'hg serve --stdio' instances pretty
++            # closely, as many shared-ssh access tools want to grant
++            # access to run *only* 'hg -R $repo serve --stdio'. We
++            # restrict to exactly that set of arguments, and prohibit
++            # any repo name that starts with '--' to prevent
++            # shenanigans wherein a user does something like pass
++            # --debugger or --config=ui.debugger=1 as a repo
++            # name. This used to actually run the debugger.
++            if (len(req.args) != 4 or
++                req.args[0] != '-R' or
++                req.args[1].startswith('--') or
++                req.args[2] != 'serve' or
++                req.args[3] != '--stdio'):
++                raise error.Abort(
++                    _('potentially unsafe serve --stdio invocation: %r') %
++                    (req.args,))
++
+         try:
+             debugger = 'pdb'
+             debugtrace = {
+diff --git a/tests/test-ssh.t b/tests/test-ssh.t
+--- a/tests/test-ssh.t
++++ b/tests/test-ssh.t
+@@ -357,6 +357,19 @@
+   abort: destination 'a repo' is not empty
+   [255]
+ 
++Make sure hg is really paranoid in serve --stdio mode. It used to be
++possible to get a debugger REPL by specifying a repo named --debugger.
++  $ hg -R --debugger serve --stdio
++  abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio']
++  [255]
++  $ hg -R --config=ui.debugger=yes serve --stdio
++  abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio']
++  [255]
++Abbreviations of 'serve' also don't work, to avoid shenanigans.
++  $ hg -R narf serv --stdio
++  abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
++  [255]
++
+ Test hg-ssh using a helper script that will restore PYTHONPATH (which might
+ have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
+ parameters:
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/mercurial/mercurial-native_3.8.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/mercurial/mercurial-native_3.8.4.bb
deleted file mode 100644
index 0526fc2..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/mercurial/mercurial-native_3.8.4.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "The Mercurial distributed SCM"
-HOMEPAGE = "http://mercurial.selenic.com/"
-SECTION = "console/utils"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-DEPENDS = "python-native"
-
-SRC_URI = "https://www.mercurial-scm.org/release/${BP}.tar.gz"
-SRC_URI[md5sum] = "cec2c3db688cb87142809089c6ae13e9"
-SRC_URI[sha256sum] = "4b2e3ef19d34fa1d781cb7425506a05d4b6b1172bab69d6ea78874175fdf3da6"
-
-S = "${WORKDIR}/mercurial-${PV}"
-
-inherit native
-
-EXTRA_OEMAKE = "STAGING_LIBDIR=${STAGING_LIBDIR} STAGING_INCDIR=${STAGING_INCDIR} \
-    PREFIX=${prefix}"
-
-do_configure_append () {
-    sed -i -e 's:PYTHON=python:PYTHON=${STAGING_BINDIR_NATIVE}/python-native/python:g' ${S}/Makefile
-}
-
-do_install () {
-    oe_runmake -e install-bin DESTDIR=${D} PREFIX=${prefix}
-}
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/mercurial/mercurial-native_4.0.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/mercurial/mercurial-native_4.0.1.bb
new file mode 100644
index 0000000..a08acd9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/mercurial/mercurial-native_4.0.1.bb
@@ -0,0 +1,28 @@
+SUMMARY = "The Mercurial distributed SCM"
+HOMEPAGE = "http://mercurial.selenic.com/"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS = "python-native"
+
+SRC_URI = "https://www.mercurial-scm.org/release/${BP}.tar.gz \
+           file://mercurial-CVE-2017-9462.patch \
+"
+SRC_URI[md5sum] = "22a9b1d7c0c06a53f0ae5b386d536d08"
+SRC_URI[sha256sum] = "6aa4ade93c1b5e11937820880a466ebf1c824086d443cd799fc46e2617250d40"
+
+S = "${WORKDIR}/mercurial-${PV}"
+
+inherit native
+
+EXTRA_OEMAKE = "STAGING_LIBDIR=${STAGING_LIBDIR} STAGING_INCDIR=${STAGING_INCDIR} \
+    PREFIX=${prefix}"
+
+do_configure_append () {
+    sed -i -e 's:PYTHON=python:PYTHON=${STAGING_BINDIR_NATIVE}/python-native/python:g' ${S}/Makefile
+}
+
+do_install () {
+    oe_runmake -e install-bin DESTDIR=${D} PREFIX=${prefix}
+}
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/meson/meson/native_bindir.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/meson/meson/native_bindir.patch
new file mode 100644
index 0000000..53eeff7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/meson/meson/native_bindir.patch
@@ -0,0 +1,52 @@
+diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py
+index da73a57b7ecd..22100f69c580 100644
+--- a/mesonbuild/dependencies.py
++++ b/mesonbuild/dependencies.py
+@@ -65,7 +65,7 @@ class Dependency():
+     def need_threads(self):
+         return False
+ 
+-    def get_pkgconfig_variable(self, variable_name):
++    def get_pkgconfig_variable(self, variable_name, use_native=False):
+         raise MesonException('Tried to get a pkg-config variable from a non-pkgconfig dependency.')
+ 
+ class InternalDependency(Dependency):
+@@ -177,8 +177,12 @@ class PkgConfigDependency(Dependency):
+         return s.format(self.__class__.__name__, self.name, self.is_found,
+                         self.version_reqs)
+ 
+-    def _call_pkgbin(self, args):
+-        p, out = Popen_safe([self.pkgbin] + args, env=os.environ)[0:2]
++    def _call_pkgbin(self, args, use_native=False):
++        if use_native:
++            pkgbin = [self.pkgbin + "-native"]
++        else:
++            pkgbin = [self.pkgbin]
++        p, out = Popen_safe(pkgbin + args, env=os.environ)[0:2]
+         return (p.returncode, out.strip())
+ 
+     def _set_cargs(self):
+@@ -212,8 +216,8 @@ class PkgConfigDependency(Dependency):
+                 self.is_libtool = True
+             self.libs.append(lib)
+ 
+-    def get_pkgconfig_variable(self, variable_name):
+-        ret, out = self._call_pkgbin(['--variable=' + variable_name, self.name])
++    def get_pkgconfig_variable(self, variable_name, use_native=False):
++        ret, out = self._call_pkgbin(['--variable=' + variable_name, self.name], use_native=use_native)
+         variable = ''
+         if ret != 0:
+             if self.required:
+@@ -933,10 +937,10 @@ class QtBaseDependency(Dependency):
+             corekwargs = {'required': 'false', 'silent': 'true'}
+             core = PkgConfigDependency(self.qtpkgname + 'Core', env, corekwargs)
+         # Used by self.compilers_detect()
+-        self.bindir = core.get_pkgconfig_variable('host_bins')
++        self.bindir = core.get_pkgconfig_variable('host_bins', use_native=True)
+         if not self.bindir:
+             # If exec_prefix is not defined, the pkg-config file is broken
+-            prefix = core.get_pkgconfig_variable('exec_prefix')
++            prefix = core.get_pkgconfig_variable('exec_prefix', use_native=True)
+             if prefix:
+                 self.bindir = os.path.join(prefix, 'bin')
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/meson/meson_0.37.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/meson/meson_0.37.1.bb
new file mode 100644
index 0000000..dbbea64
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/meson/meson_0.37.1.bb
@@ -0,0 +1,20 @@
+HOMEPAGE = "http://mesonbuild.com"
+SUMMARY = "A high performance build system"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+SRC_URI = " \
+    git://github.com/mesonbuild/meson.git \
+    file://native_bindir.patch \
+"
+
+SRCREV = "3d4bfdcb22314ea7db45a5b075f8b2a9c1498aab"
+
+S = "${WORKDIR}/git"
+
+inherit setuptools3
+
+RDEPENDS_${PN}_class-target = "ninja python3-core python3-modules"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c/0001-Comment-intentional-fallthrough-in-case-statements.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c/0001-Comment-intentional-fallthrough-in-case-statements.patch
new file mode 100644
index 0000000..a388297
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c/0001-Comment-intentional-fallthrough-in-case-statements.patch
@@ -0,0 +1,39 @@
+From 15d8bb6792c9639d85a9ffe2ac81431f1b986c21 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 08:53:50 -0700
+Subject: [PATCH] Comment intentional fallthrough in case statements
+
+Fixes build with gcc7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/msgpack/v1/adaptor/detail/cpp03_define_array.hpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/include/msgpack/v1/adaptor/detail/cpp03_define_array.hpp b/include/msgpack/v1/adaptor/detail/cpp03_define_array.hpp
+index b35c21a7..4c463a90 100644
+--- a/include/msgpack/v1/adaptor/detail/cpp03_define_array.hpp
++++ b/include/msgpack/v1/adaptor/detail/cpp03_define_array.hpp
+@@ -105,6 +105,7 @@ struct define_array<A0, A1> {
+             switch(size) {
+             default:
+             case 2: ptr[1].convert(a1);
++            //fallthrough
+             case 1: ptr[0].convert(a0);
+             }
+         }
+@@ -193,8 +194,11 @@ struct define_array<A0, A1, A2, A3> {
+             switch(size) {
+             default:
+             case 4: ptr[3].convert(a3);
++            //fallthrough
+             case 3: ptr[2].convert(a2);
++            //fallthrough
+             case 2: ptr[1].convert(a1);
++            //fallthrough
+             case 1: ptr[0].convert(a0);
+             }
+         }
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c_2.1.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c_2.1.1.bb
new file mode 100644
index 0000000..7655d94
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/msgpack/msgpack-c_2.1.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "MessagePack implementation for C and C++"
+DESCRIPTION = "MessagePack is an efficient binary serialization format. It's like JSON. but fast and small"
+HOMEPAGE = "http://msgpack.org/index.html"
+LICENSE = "BSL-1.0"
+LIC_FILES_CHKSUM = "file://NOTICE;md5=7a858c074723608e08614061dc044352 \
+                    file://COPYING;md5=0639c4209b6f2abf1437c813b208f2d3 \
+                    file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c \
+                   "
+
+PV .= "+git${SRCPV}"
+
+SRCREV = "20ef1f925b007f170ab1c257e4aa61fdd0927773"
+
+SRC_URI = "git://github.com/msgpack/msgpack-c \
+           file://0001-Comment-intentional-fallthrough-in-case-statements.patch \
+           "
+
+inherit cmake pkgconfig
+
+S = "${WORKDIR}/git"
+
+FILES_${PN}-dev += "${libdir}/cmake/msgpack/*.cmake"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ninja/ninja_1.7.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ninja/ninja_1.7.1.bb
deleted file mode 100644
index 2a4b829..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ninja/ninja_1.7.1.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-SUMMARY = "Ninja is a small build system with a focus on speed."
-HOMEPAGE = "http://martine.github.com/ninja/"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a81586a64ad4e476c791cda7e2f2c52e"
-
-DEPENDS = "re2c-native ninja-native"
-
-SRCREV = "b49b0fc01bb052b6ac856b1e72be9391e962398e"
-
-SRC_URI = "git://github.com/martine/ninja.git;branch=release"
-
-S = "${WORKDIR}/git"
-
-do_configure[noexec] = "1"
-
-do_compile_class-native() {
-    ./configure.py --bootstrap
-}
-
-do_compile() {
-    ./configure.py
-    ninja
-}
-
-do_install() {
-    install -d ${D}${bindir}
-    install -m 0755 ${S}/ninja ${D}${bindir}/
-}
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/ninja/ninja_1.7.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ninja/ninja_1.7.2.bb
new file mode 100644
index 0000000..932e3a6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/ninja/ninja_1.7.2.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Ninja is a small build system with a focus on speed."
+HOMEPAGE = "http://martine.github.com/ninja/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a81586a64ad4e476c791cda7e2f2c52e"
+
+DEPENDS = "re2c-native ninja-native"
+
+SRCREV = "717b7b4a31db6027207588c0fb89c3ead384747b"
+
+SRC_URI = "git://github.com/martine/ninja.git;branch=release"
+
+S = "${WORKDIR}/git"
+
+do_configure[noexec] = "1"
+
+do_compile_class-native() {
+    ./configure.py --bootstrap
+}
+
+do_compile() {
+    ./configure.py
+    ninja
+}
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 ${S}/ninja ${D}${bindir}/
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_4.6.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_4.6.1.bb
deleted file mode 100644
index 03e9812..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_4.6.1.bb
+++ /dev/null
@@ -1,88 +0,0 @@
-DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
-HOMEPAGE = "http://nodejs.org"
-LICENSE = "MIT & BSD & Artistic-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=8e3c01094f0fcb889b13f0354e52f914"
-
-DEPENDS = "openssl zlib"
-
-COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*"
-COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*"
-COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*"
-
-SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
-    file://no-registry.patch \
-"
-SRC_URI[md5sum] = "4f70295e3eebef1f998fa38456263eaf"
-SRC_URI[sha256sum] = "fe2a85df8758001878abb5bbaf17a6b6cdc12b3e465b1d3bace83b37fdf0345a"
-
-S = "${WORKDIR}/node-v${PV}"
-
-# v8 errors out if you have set CCACHE
-CCACHE = ""
-
-def map_nodejs_arch(a, d):
-    import re
-
-    if   re.match('i.86$', a): return 'ia32'
-    elif re.match('x86_64$', a): return 'x64'
-    elif re.match('aarch64$', a): return 'arm64'
-    elif re.match('powerpc64$', a): return 'ppc64'
-    elif re.match('powerpc$', a): return 'ppc'
-    return a
-
-ARCHFLAGS_arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \
-                 ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \
-                    bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \
-                    bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \
-                    '--with-arm-fpu=vfp', d), d), d)}"
-GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' "
-ARCHFLAGS ?= ""
-
-# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi
-do_configure () {
-    export LD="${CXX}"
-    GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES
-    # $TARGET_ARCH settings don't match --dest-cpu settings
-   ./configure --prefix=${prefix} --without-snapshot --shared-openssl --shared-zlib \
-               --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH', True), d)}" \
-               --dest-os=linux \
-               ${ARCHFLAGS}
-}
-
-do_compile () {
-    export LD="${CXX}"
-    oe_runmake BUILDTYPE=Release
-}
-
-do_install () {
-    oe_runmake install DESTDIR=${D}
-}
-
-do_install_append_class-native() {
-    # use node from PATH instead of absolute path to sysroot
-    # node-v0.10.25/tools/install.py is using:
-    # shebang = os.path.join(node_prefix, 'bin/node')
-    # update_shebang(link_path, shebang)
-    # and node_prefix can be very long path to bindir in native sysroot and
-    # when it exceeds 128 character shebang limit it's stripped to incorrect path
-    # and npm fails to execute like in this case with 133 characters show in log.do_install:
-    # updating shebang of /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/work/x86_64-linux/nodejs-native/0.10.15-r0/image/home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/npm to /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/node
-    # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js
-    # use sed on npm-cli.js because otherwise symlink is replaced with normal file and
-    # npm-cli.js continues to use old shebang
-    sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
-}
-
-do_install_append_class-target() {
-    sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
-}
-
-PACKAGES =+ "${PN}-npm"
-FILES_${PN}-npm = "${exec_prefix}/lib/node_modules ${bindir}/npm"
-RDEPENDS_${PN}-npm = "bash python-shell python-datetime python-subprocess python-textutils"
-
-PACKAGES =+ "${PN}-systemtap"
-FILES_${PN}-systemtap = "${datadir}/systemtap"
-
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_4.8.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_4.8.2.bb
new file mode 100644
index 0000000..ae84ad3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_4.8.2.bb
@@ -0,0 +1,88 @@
+DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
+HOMEPAGE = "http://nodejs.org"
+LICENSE = "MIT & BSD & Artistic-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f45e9ffb97e64da46d14f462d34a039f"
+
+DEPENDS = "openssl zlib"
+
+COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*"
+COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*"
+COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*"
+
+SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
+    file://no-registry.patch \
+"
+SRC_URI[md5sum] = "aea6139f952bb7e1d66f76afedee813c"
+SRC_URI[sha256sum] = "b961350b8490c791bdd3663925662ba0fbe01e004b43f1c2779baffcc816b930"
+
+S = "${WORKDIR}/node-v${PV}"
+
+# v8 errors out if you have set CCACHE
+CCACHE = ""
+
+def map_nodejs_arch(a, d):
+    import re
+
+    if   re.match('i.86$', a): return 'ia32'
+    elif re.match('x86_64$', a): return 'x64'
+    elif re.match('aarch64$', a): return 'arm64'
+    elif re.match('powerpc64$', a): return 'ppc64'
+    elif re.match('powerpc$', a): return 'ppc'
+    return a
+
+ARCHFLAGS_arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \
+                 ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \
+                    bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \
+                    bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \
+                    '--with-arm-fpu=vfp', d), d), d)}"
+GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' "
+ARCHFLAGS ?= ""
+
+# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi
+do_configure () {
+    export LD="${CXX}"
+    GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES
+    # $TARGET_ARCH settings don't match --dest-cpu settings
+   ./configure --prefix=${prefix} --without-snapshot --shared-openssl --shared-zlib \
+               --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \
+               --dest-os=linux \
+               ${ARCHFLAGS}
+}
+
+do_compile () {
+    export LD="${CXX}"
+    oe_runmake BUILDTYPE=Release
+}
+
+do_install () {
+    oe_runmake install DESTDIR=${D}
+}
+
+do_install_append_class-native() {
+    # use node from PATH instead of absolute path to sysroot
+    # node-v0.10.25/tools/install.py is using:
+    # shebang = os.path.join(node_prefix, 'bin/node')
+    # update_shebang(link_path, shebang)
+    # and node_prefix can be very long path to bindir in native sysroot and
+    # when it exceeds 128 character shebang limit it's stripped to incorrect path
+    # and npm fails to execute like in this case with 133 characters show in log.do_install:
+    # updating shebang of /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/work/x86_64-linux/nodejs-native/0.10.15-r0/image/home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/npm to /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/node
+    # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js
+    # use sed on npm-cli.js because otherwise symlink is replaced with normal file and
+    # npm-cli.js continues to use old shebang
+    sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
+}
+
+do_install_append_class-target() {
+    sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
+}
+
+PACKAGES =+ "${PN}-npm"
+FILES_${PN}-npm = "${exec_prefix}/lib/node_modules ${bindir}/npm"
+RDEPENDS_${PN}-npm = "bash python-shell python-datetime python-subprocess python-textutils"
+
+PACKAGES =+ "${PN}-systemtap"
+FILES_${PN}-systemtap = "${datadir}/systemtap"
+
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/packagekit/packagekit_0.5.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/packagekit/packagekit_0.5.6.bb
index 3633f29..1b60c47 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/packagekit/packagekit_0.5.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/packagekit/packagekit_0.5.6.bb
@@ -62,4 +62,4 @@
 FILES_${PN}-staticdev += "${libdir}/packagekit-backend/*.a ${libdir}/gtk-2.0/*/*.a"
 
 # PackageKit-0.5.6/backends/opkg/pk-backend-opkg.c:31:26: fatal error: libopkg/opkg.h: No such file or directory
-PNBLACKLIST[packagekit] ?= "BROKEN: depends on old deprecated libopkg which is currently disabled and will be removed soon"
+PNBLACKLIST[packagekit] ?= "BROKEN: depends on old deprecated libopkg which is currently disabled and will be removed soon - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php-5.6.26/0001-Add-lpthread-to-link.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php-5.6.26/0001-Add-lpthread-to-link.patch
new file mode 100644
index 0000000..f70e550
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php-5.6.26/0001-Add-lpthread-to-link.patch
@@ -0,0 +1,38 @@
+From ed0a954983d50267c2fc0bc13aba929ea0cad971 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 2 May 2017 06:34:40 +0000
+Subject: [PATCH] Add -lpthread to link
+
+When building the php-5.6.26, the following errors occured:
+
+    ld: TSRM/.libs/TSRM.o: undefined reference to symbol
+    'pthread_sigmask@@GLIBC_2.2.5'
+
+    error adding symbols: DSO missing from command line
+
+This is because no pthread to link, so we should add it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ configure.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index a467dff1..9afef652 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1058,7 +1058,8 @@ case $php_sapi_module in
+     ;;
+ esac
+ 
+-EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
++PTHREAD_LIBS="-lpthread"
++EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS $PTHREAD_LIBS"
+ 
+ dnl this has to be here to prevent the openssl crypt() from
+ dnl overriding the system provided crypt().
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php-7.1.7/0001-Specify-tag-with-libtool.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php-7.1.7/0001-Specify-tag-with-libtool.patch
new file mode 100644
index 0000000..18b4937
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php-7.1.7/0001-Specify-tag-with-libtool.patch
@@ -0,0 +1,62 @@
+From 5c84b039e97abd88f6a18da0e6d27383c00fea92 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 26 Jul 2017 23:06:56 -0700
+Subject: [PATCH] Specify --tag with libtool
+
+This helps in compiling with external toolchains
+with -fPIE appended to CC e.g. via hardening flags
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ acinclude.m4 | 8 ++++----
+ configure.in | 4 ++--
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index a114a98..1cc7a26 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -806,10 +806,10 @@ dnl
+ dnl PHP_BUILD_PROGRAM
+ dnl
+ AC_DEFUN([PHP_BUILD_PROGRAM],[
+-  php_c_pre='$(LIBTOOL) --mode=compile $(CC)'
++  php_c_pre='$(LIBTOOL) --tag=CC --mode=compile $(CC)'
+   php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
+   php_c_post=
+-  php_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
++  php_cxx_pre='$(LIBTOOL) --tag=CXX --mode=compile $(CXX)'
+   php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
+   php_cxx_post=
+   php_lo=lo
+@@ -819,10 +819,10 @@ AC_DEFUN([PHP_BUILD_PROGRAM],[
+     no)  pic_setting='-prefer-non-pic';;
+   esac
+ 
+-  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
++  shared_c_pre='$(LIBTOOL) --tag=CC --mode=compile $(CC)'
+   shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
+   shared_c_post=
+-  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
++  shared_cxx_pre='$(LIBTOOL) --tag=CXX --mode=compile $(CXX)'
+   shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
+   shared_cxx_post=
+   shared_lo=lo
+diff --git a/configure.in b/configure.in
+index 7d65b63..7221af9 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1431,8 +1431,8 @@ PHP_SET_LIBTOOL_VARIABLE([--silent])
+ dnl libtool 1.4.3 needs this.
+ PHP_SET_LIBTOOL_VARIABLE([--preserve-dup-deps])
+ 
+-test -z "$PHP_COMPILE" && PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
+-test -z "$CXX_PHP_COMPILE" && CXX_PHP_COMPILE='$(LIBTOOL) --mode=compile $(CXX_COMPILE) -c $<'
++test -z "$PHP_COMPILE" && PHP_COMPILE='$(LIBTOOL) --tag=CC --mode=compile $(COMPILE) -c $<'
++test -z "$CXX_PHP_COMPILE" && CXX_PHP_COMPILE='$(LIBTOOL) --tag=CXX --mode=compile $(CXX_COMPILE) -c $<'
+ SHARED_LIBTOOL='$(LIBTOOL)'
+ 
+ CC=$old_CC
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php-7.1.7/change-AC_TRY_RUN-to-AC_TRY_LINK.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php-7.1.7/change-AC_TRY_RUN-to-AC_TRY_LINK.patch
new file mode 100644
index 0000000..39c334f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php-7.1.7/change-AC_TRY_RUN-to-AC_TRY_LINK.patch
@@ -0,0 +1,56 @@
+[PATCH] config.m4: change AC_TRY_RUN to AC_TRY_LINK
+
+Upstream-Status: Pending
+
+AC_TRY_RUN is not suitable for cross-compile
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ ext/fileinfo/config.m4 | 31 ++++++-------------------------
+ 1 file changed, 6 insertions(+), 25 deletions(-)
+
+diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4
+index 7e98d62..8a8ea0e 100644
+--- a/ext/fileinfo/config.m4
++++ b/ext/fileinfo/config.m4
+@@ -14,31 +14,12 @@ if test "$PHP_FILEINFO" != "no"; then
+     libmagic/readcdf.c libmagic/softmagic.c"
+ 
+   AC_MSG_CHECKING([for strcasestr])
+-  AC_TRY_RUN([
+-#include <string.h>
+-#include <strings.h>
+-#include <stdlib.h>
+-
+-int main(void)
+-{
+-        char *s0, *s1, *ret;
+-
+-        s0 = (char *) malloc(42);
+-        s1 = (char *) malloc(8);
+-
+-        memset(s0, 'X', 42);
+-        s0[24] = 'Y';
+-        s0[26] = 'Z';
+-        s0[41] = '\0';
+-        memset(s1, 'x', 8);
+-        s1[0] = 'y';
+-        s1[2] = 'Z';
+-        s1[7] = '\0';
+-
+-        ret = strcasestr(s0, s1);
+-
+-        return !(NULL != ret);
+-}
++  AC_TRY_COMPILE([
++     #include <string.h>
++     #include <strings.h>
++     #include <stdlib.h>
++  ],[
++     strcasestr(NULL, NULL);
+   ],[
+     dnl using the platform implementation
+     AC_MSG_RESULT(yes)
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php.inc b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php.inc
index cd91940..0e55020 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php.inc
@@ -9,6 +9,8 @@
            openssl libmcrypt"
 DEPENDS_class-native = "zlib-native libxml2-native"
 
+PHP_MAJOR_VERSION = "${@d.getVar('PV', True).split('.')[0]}"
+
 SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \
            file://acinclude-xml2-config.patch \
            file://0001-php-don-t-use-broken-wrapper-for-mkdir.patch \
@@ -24,8 +26,7 @@
             file://php-fpm.conf \
             file://php-fpm-apache.conf \
             file://configure.patch \
-            file://pthread-check-threads-m4.patch \
-            file://70_mod_php5.conf \
+            file://70_mod_php${PHP_MAJOR_VERSION}.conf \
             file://php-fpm.service \
           "
 S = "${WORKDIR}/php-${PV}"
@@ -37,7 +38,7 @@
 SSTATE_SCAN_FILES += "phpize"
 SSTATE_SCAN_FILES += "build-defs.h"
 
-PHP_LIBDIR = "${libdir}/php5"
+PHP_LIBDIR = "${libdir}/php${PHP_MAJOR_VERSION}"
 
 # Common EXTRA_OECONF
 COMMON_EXTRA_OECONF = "--enable-sockets \
@@ -58,7 +59,7 @@
                 --with-iconv=${STAGING_LIBDIR}/.. \
                 --with-mcrypt=${STAGING_DIR_TARGET}${exec_prefix} \
                 --with-bz2=${STAGING_DIR_TARGET}${exec_prefix} \
-                --with-config-file-path=${sysconfdir}/php/apache2-php5 \
+                --with-config-file-path=${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION} \
                 ${@base_conditional('SITEINFO_ENDIANNESS', 'le', 'ac_cv_c_bigendian_php=no', 'ac_cv_c_bigendian_php=yes', d)} \
                 ${@bb.utils.contains('PACKAGECONFIG', 'pam', '', 'ac_cv_lib_pam_pam_start=no', d)} \
                 ${COMMON_EXTRA_OECONF} \
@@ -70,8 +71,7 @@
 "
 
 PACKAGECONFIG ??= "mysql sqlite3 imap \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
 "
 PACKAGECONFIG_class-native = ""
 
@@ -137,9 +137,9 @@
 
 # fixme
 do_install_append_class-target() {
-    install -d ${D}/${sysconfdir}/
-    if [ -d ${D}/${STAGING_DIR_NATIVE}/${sysconfdir} ];then
-         mv ${D}/${STAGING_DIR_NATIVE}/${sysconfdir}/* ${D}/${sysconfdir}/
+    install -d ${D}${sysconfdir}/
+    if [ -d ${RECIPE_SYSROOT_NATIVE}${sysconfdir} ];then
+         install -m 0644 ${RECIPE_SYSROOT_NATIVE}${sysconfdir}/pear.conf ${D}${sysconfdir}/
     fi
     rm -rf ${D}/${TMPDIR}
     rm -rf ${D}/.registry
@@ -147,7 +147,7 @@
     rm -rf ${D}/.[a-z]*
     rm -rf ${D}/var
     rm -f  ${D}/${sysconfdir}/php-fpm.conf.default
-    sed -i 's:${STAGING_DIR_NATIVE}::g' ${D}/${sysconfdir}/pear.conf
+    sed -i 's:${STAGING_DIR_NATIVE}::g' ${D}${sysconfdir}/pear.conf
     install -m 0644 ${WORKDIR}/php-fpm.conf ${D}/${sysconfdir}/php-fpm.conf
     install -d ${D}/${sysconfdir}/apache2/conf.d
     install -m 0644 ${WORKDIR}/php-fpm-apache.conf ${D}/${sysconfdir}/apache2/conf.d/php-fpm.conf
@@ -177,13 +177,13 @@
     if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
         install -d ${D}${libdir}/apache2/modules
         install -d ${D}${sysconfdir}/apache2/modules.d
-        install -d ${D}${sysconfdir}/php/apache2-php5
-        install -m 755  libs/libphp5.so ${D}${libdir}/apache2/modules
-        install -m 644  ${WORKDIR}/70_mod_php5.conf ${D}${sysconfdir}/apache2/modules.d
-        sed -i s,lib/,${libdir}/, ${D}${sysconfdir}/apache2/modules.d/70_mod_php5.conf
+        install -d ${D}${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION}
+        install -m 755  libs/libphp${PHP_MAJOR_VERSION}.so ${D}${libdir}/apache2/modules
+        install -m 644  ${WORKDIR}/70_mod_php${PHP_MAJOR_VERSION}.conf ${D}${sysconfdir}/apache2/modules.d
+        sed -i s,lib/,${libdir}/, ${D}${sysconfdir}/apache2/modules.d/70_mod_php${PHP_MAJOR_VERSION}.conf
         cat ${S}/php.ini-production | \
             sed -e 's,extension_dir = \"\./\",extension_dir = \"/usr/lib/extensions\",' \
-            > ${D}${sysconfdir}/php/apache2-php5/php.ini
+            > ${D}${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION}/php.ini
         rm -f ${D}${sysconfdir}/apache2/httpd.conf*
     fi
 }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php7.conf b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php7.conf
new file mode 100644
index 0000000..d206265
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php/70_mod_php7.conf
@@ -0,0 +1,9 @@
+LoadModule php7_module lib/apache2/modules/libphp7.so
+
+<FilesMatch "\.ph(p[2-7]?|tml)$">
+	SetHandler application/x-httpd-php
+</FilesMatch>
+
+<FilesMatch "\.phps$">
+	SetHandler application/x-httpd-php-source
+</FilesMatch>
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php_5.5.38.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php_5.5.38.bb
deleted file mode 100644
index 26f35b1..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php_5.5.38.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require php.inc
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=464ca70af214d2407f6b7d4458158afd"
-
-SRC_URI[md5sum] = "312244a0eecad602a1555ed2434e223f"
-SRC_URI[sha256sum] = "473c81ebb2e48ca468caee031762266651843d7227c18a824add9b07b9393e38"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php_5.6.26.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php_5.6.26.bb
index cbd0615..dfce949 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php_5.6.26.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php_5.6.26.bb
@@ -2,6 +2,9 @@
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=b602636d46a61c0ac0432bbf5c078fe4"
 
-SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch"
+SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch \
+            file://pthread-check-threads-m4.patch \
+            file://0001-Add-lpthread-to-link.patch \
+           "
 SRC_URI[md5sum] = "cb424b705cfb715fc04f499f8a8cf52e"
 SRC_URI[sha256sum] = "d47aab8083a4284b905777e1b45dd7735adc53be827b29f896684750ac8b6236"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php_7.1.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php_7.1.7.bb
new file mode 100644
index 0000000..ebf9237
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/php/php_7.1.7.bb
@@ -0,0 +1,16 @@
+require php.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c0af599f66d0461c5837c695fcbc5c1e"
+
+SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch \
+            file://0001-Specify-tag-with-libtool.patch \
+           "
+SRC_URI[md5sum] = "22e11a372f99afbbbf3f46a31e8a82ca"
+SRC_URI[sha256sum] = "079b6792987f38dc485f92258c04f9e02dedd593f9d260ebe725343f812d1ff8"
+
+PACKAGECONFIG[mysql] = "--with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config \
+                        --with-pdo-mysql=${STAGING_BINDIR_CROSS}/mysql_config \
+                        ,--without-mysqli --without-pdo-mysql \
+                        ,mysql5"
+
+FILES_${PN}-fpm += "${sysconfdir}/php-fpm.d/www.conf.default"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_2.6.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_2.6.1.bb
deleted file mode 100644
index 2977c59..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_2.6.1.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-SUMMARY = "Protocol Buffers - structured data serialisation mechanism"
-DESCRIPTION = "Protocol Buffers are a way of encoding structured data in an \
-efficient yet extensible format. Google uses Protocol Buffers for almost \
-all of its internal RPC protocols and file formats."
-HOMEPAGE = "https://github.com/google/protobuf"
-SECTION = "console/tools"
-LICENSE = "BSD-3-Clause"
-
-PACKAGE_BEFORE_PN = "${PN}-compiler"
-
-DEPENDS = "zlib"
-RDEPENDS_${PN}-compiler = "${PN}"
-RDEPENDS_${PN}-dev += "${PN}-compiler"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=af6809583bfde9a31595a58bb4a24514"
-
-SRCREV = "bba83652e1be610bdb7ee1566ad18346d98b843c"
-
-PV = "2.6.1+git${SRCPV}"
-
-SRC_URI = "git://github.com/google/protobuf.git"
-
-EXTRA_OECONF += " --with-protoc=echo"
-
-inherit autotools
-
-S = "${WORKDIR}/git"
-
-FILES_${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_3.1.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_3.1.0.bb
new file mode 100644
index 0000000..18210b1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/protobuf/protobuf_3.1.0.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Protocol Buffers - structured data serialisation mechanism"
+DESCRIPTION = "Protocol Buffers are a way of encoding structured data in an \
+efficient yet extensible format. Google uses Protocol Buffers for almost \
+all of its internal RPC protocols and file formats."
+HOMEPAGE = "https://github.com/google/protobuf"
+SECTION = "console/tools"
+LICENSE = "BSD-3-Clause"
+
+PACKAGE_BEFORE_PN = "${PN}-compiler"
+
+DEPENDS = "zlib"
+RDEPENDS_${PN}-compiler = "${PN}"
+RDEPENDS_${PN}-dev += "${PN}-compiler"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=35953c752efc9299b184f91bef540095"
+
+SRCREV = "a428e42072765993ff674fda72863c9f1aa2d268"
+
+PV = "3.1.0+git${SRCPV}"
+
+SRC_URI = "git://github.com/google/protobuf.git"
+
+EXTRA_OECONF += " --with-protoc=echo"
+
+inherit autotools
+
+S = "${WORKDIR}/git"
+
+FILES_${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}"
+
+MIPS_INSTRUCTION_SET = "mips"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.bb
new file mode 100644
index 0000000..56dd33d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.bb
@@ -0,0 +1,9 @@
+require python-distutils-extra.inc
+
+inherit setuptools
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${libdir}/${PYTHON_DIR}/site-packages"
+
+RDEPENDS_${PN} = "\
+    python-distutils \
+"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.inc b/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.inc
new file mode 100644
index 0000000..4d87d77
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-distutils-extra.inc
@@ -0,0 +1,13 @@
+SUMMARY = "python-distutils extension"
+DESCRITION = "python-distutils extension integrating gettext support, themed icons and scrollkeeper based documentation"
+HOMEPAGE = "https://launchpad.net/python-distutils-extra"
+SECTION = "devel/python"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4325afd396febcb659c36b49533135d4"
+
+PV = "2.39"
+SRC_URI = "https://launchpad.net/python-distutils-extra/trunk/${PV}/+download/python-distutils-extra-${PV}.tar.gz"
+SRC_URI[md5sum] = "16e06db0ef73a35b4bff4b9eed5699b5"
+SRC_URI[sha256sum] = "723f24f4d65fc8d99b33a002fbbb3771d4cc9d664c97085bf37f3997ae8063af"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-pygobject_3.20.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-pygobject_3.20.1.bb
deleted file mode 100644
index 77416d4..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-pygobject_3.20.1.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-SUMMARY = "Python GObject bindings"
-SECTION = "devel/python"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
-
-inherit autotools pkgconfig gnomebase distutils-base gobject-introspection
-
-PYTHON_BASEVERSION = "2.7"
-PYTHON_PN = "python"
-
-DEPENDS += "python glib-2.0"
-
-SRCNAME="pygobject"
-SRC_URI = " \
-    http://ftp.gnome.org/pub/GNOME/sources/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \
-    file://0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch \
-"
-
-SRC_URI[md5sum] = "4354c6283b135f859563b72457f6a321"
-SRC_URI[sha256sum] = "3d261005d6fed6a92ac4c25f283792552f7dad865d1b7e0c03c2b84c04dbd745"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-BBCLASSEXTEND = "native"
-
-EXTRA_OECONF = "--disable-cairo --with-python=${PYTHON}"
-
-RDEPENDS_${PN} += "python-setuptools python-importlib"
-
-do_install_append() {
-    # Remove files that clash with python3-pygobject; their content is same
-    rm ${D}${includedir}/pygobject-3.0/pygobject.h ${D}${libdir}/pkgconfig/pygobject-3.0.pc
-}
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-pygobject_3.22.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-pygobject_3.22.0.bb
new file mode 100644
index 0000000..acc2f5b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-pygobject_3.22.0.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Python GObject bindings"
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
+
+inherit autotools pkgconfig gnomebase distutils-base gobject-introspection
+
+PYTHON_BASEVERSION = "2.7"
+PYTHON_PN = "python"
+
+DEPENDS += "gnome-common-native python glib-2.0"
+
+SRCNAME="pygobject"
+SRC_URI = " \
+    http://ftp.gnome.org/pub/GNOME/sources/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \
+    file://0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch \
+"
+
+SRC_URI[md5sum] = "ed4117ed5d554d25fd7718807fbf819f"
+SRC_URI[sha256sum] = "08b29cfb08efc80f7a8630a2734dec65a99c1b59f1e5771c671d2e4ed8a5cbe7"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF = "--disable-cairo --with-python=${PYTHON}"
+
+RDEPENDS_${PN} += "python-setuptools python-importlib"
+RDEPENDS_${PN}_class-native = ""
+
+do_install_append() {
+    # Remove files that clash with python3-pygobject; their content is same
+    rm -rf ${D}${includedir}/pygobject-3.0//pygobject.h ${D}${libdir}/pkgconfig
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-simplejson_3.8.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-simplejson_3.8.2.bb
deleted file mode 100644
index 0c9112e..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python-simplejson_3.8.2.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY = "Simple, fast, extensible JSON encoder/decoder for Python"
-HOMEPAGE = "http://cheeseshop.python.org/pypi/simplejson"
-SECTION = "devel/python"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=c6338d7abd321c0b50a2a547e441c52e"
-PR = "r1"
-
-SRCNAME = "simplejson"
-
-SRC_URI = "http://cheeseshop.python.org/packages/source/s/simplejson/${SRCNAME}-${PV}.tar.gz"
-SRC_URI[md5sum] = "53b1371bbf883b129a12d594a97e9a18"
-SRC_URI[sha256sum] = "d58439c548433adcda98e695be53e526ba940a4b9c44fb9a05d92cd495cdd47f"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit setuptools
-
-RDEPENDS_${PN} = "\
-    python-core \
-    python-re \
-    python-io \
-    python-netserver \
-    python-numbers \
-"
-
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python3-distutils-extra.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python3-distutils-extra.bb
new file mode 100644
index 0000000..af242b8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/python/python3-distutils-extra.bb
@@ -0,0 +1,11 @@
+require python-distutils-extra.inc
+
+inherit setuptools3
+
+S = "${WORKDIR}/python-distutils-extra-${PV}"
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${libdir}/${PYTHON_DIR}/site-packages"
+
+RDEPENDS_${PN} = "\
+    python3-setuptools \
+"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch b/import-layers/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch
new file mode 100644
index 0000000..cf3e16e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson/remove-march-native-from-CMAKE_CXX_FLAGS.patch
@@ -0,0 +1,40 @@
+From 827155e5e659b2a5065b00d701bc59b57feab2bf Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Mon, 19 Dec 2016 01:37:11 -0800
+Subject: [PATCH] remove -march=native from CMAKE_CXX_FLAGS
+
+Not appropriate when cross compiling.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: git/CMakeLists.txt
+===================================================================
+--- git.orig/CMakeLists.txt
++++ git/CMakeLists.txt
+@@ -51,10 +51,10 @@ endif(CCACHE_FOUND)
+ 
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+     if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "powerpc" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64le")
+-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native")
++      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+     else()
+       #FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER.
+-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
++      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+     endif()
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
+     set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wsign-conversion)
+@@ -84,7 +84,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "C
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native")
+     else()
+       #FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER.
+-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
++      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+     endif()
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers")
+     set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wimplicit-fallthrough -Weverything)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson_git.bb
new file mode 100644
index 0000000..4cded07
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/rapidjson/rapidjson_git.bb
@@ -0,0 +1,25 @@
+SUMMARY = "A fast JSON parser/generator for C++ with both SAX/DOM style API"
+HOMEPAGE = "http://rapidjson.org/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://license.txt;md5=ba04aa8f65de1396a7e59d1d746c2125"
+
+SRC_URI = "git://github.com/miloyip/rapidjson.git;nobranch=1 \
+           file://remove-march-native-from-CMAKE_CXX_FLAGS.patch \
+"
+
+SRCREV = "e5635fb27feab7f6e8d7b916aa20ad799045a641"
+
+PV = "1.1.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE += "-DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF"
+
+# RapidJSON is a header-only C++ library, so the main package will be empty.
+
+FILES_${PN}-dev += "${libdir}/cmake"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/sip/sip_4.19.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/sip/sip_4.19.2.bb
new file mode 100644
index 0000000..1d837c5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/sip/sip_4.19.2.bb
@@ -0,0 +1,42 @@
+SUMMARY = "SIP is a C++/Python Wrapper Generator"
+HOMEPAGE = "http://www.riverbankcomputing.co.uk/sip"
+SECTION = "devel"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://LICENSE-GPL2;md5=e91355d8a6f8bd8f7c699d62863c7303"
+
+inherit python-dir
+
+DEPENDS = "python"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/pyqt/sip/sip-${PV}/sip-${PV}.tar.gz"
+SRC_URI[md5sum] = "4f48e212890ebe584e8d804cfbcfc61e"
+SRC_URI[sha256sum] = "432b4aad25254e6997913e33b1ca3cf5fd21d5729a50a3ce2edccbea82c80533"
+
+BBCLASSEXTEND = "native"
+
+PACKAGES += "python-sip"
+
+do_configure_prepend_class-target() {
+    echo "py_platform = linux" > sip.cfg
+    echo "py_inc_dir = %(sysroot)/${includedir}/python%(py_major).%(py_minor)" >> sip.cfg
+    echo "sip_bin_dir = ${D}/${bindir}" >> sip.cfg
+    echo "sip_inc_dir = ${D}/${includedir}" >> sip.cfg
+    echo "sip_module_dir = ${D}/${libdir}/python%(py_major).%(py_minor)/site-packages" >> sip.cfg
+    echo "sip_sip_dir = ${D}/${datadir}/sip" >> sip.cfg
+    python configure.py --configuration sip.cfg --sysroot ${STAGING_DIR_HOST} CC="${CC}" CXX="${CXX}" LINK="${CXX}" STRIP="" LINK_SHLIB="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LFLAGS="${LDFLAGS}"
+}
+do_configure_prepend_class-native() {
+    echo "py_platform = linux" > sip.cfg
+    echo "py_inc_dir = ${includedir}/python%(py_major).%(py_minor)" >> sip.cfg
+    echo "sip_bin_dir = ${D}/${bindir}" >> sip.cfg
+    echo "sip_inc_dir = ${D}/${includedir}" >> sip.cfg
+    echo "sip_module_dir = ${D}/${libdir}/python%(py_major).%(py_minor)/site-packages" >> sip.cfg
+    echo "sip_sip_dir = ${D}/${datadir}/sip" >> sip.cfg
+    python configure.py --configuration sip.cfg --sysroot ${STAGING_DIR_NATIVE}
+}
+do_install() {
+    oe_runmake install
+}
+
+FILES_python-sip = "${libdir}/${PYTHON_DIR}/site-packages/"
+FILES_${PN}-dbg += "${libdir}/${PYTHON_DIR}/site-packages/.debug"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk_8.6.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk_8.6.6.bb
index 59075bc..d3bf397 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk_8.6.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/tcltk/tk_8.6.6.bb
@@ -32,7 +32,7 @@
 S = "${WORKDIR}/${BPN}${PV}/unix"
 
 # Short version format: "8.6"
-VER = "${@os.path.splitext(d.getVar('PV', True))[0]}"
+VER = "${@os.path.splitext(d.getVar('PV'))[0]}"
 
 LDFLAGS += "-Wl,-rpath,${libdir}/tcltk/${PV}/lib"
 inherit autotools distro_features_check
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb
index 402c42e..0849e88 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/uw-imap/uw-imap_2007f.bb
@@ -17,7 +17,7 @@
 
 S = "${WORKDIR}/imap-${PV}"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG[pam] = ",,libpam"
 
 EXTRA_OEMAKE = "CC='${CC}' ARRC='${AR} -rc' RANLIB='${RANLIB}'"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool.inc b/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool.inc
index 0745130..f7d480f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool.inc
@@ -1,6 +1,6 @@
 DESCRIPTION = "Vala DBus Binding Tool"
 SECTION = "devel"
-DEPENDS = "vala libgee libxml2 intltool-native"
+DEPENDS = "vala libgee libxml2"
 HOMEPAGE = "http://wiki.freesmartphone.org/index.php/Implementations/vala-dbus-binding-tool"
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool_0.4.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool_0.4.0.bb
index 82fb73c..19e3dce 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool_0.4.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool_0.4.0.bb
@@ -2,3 +2,5 @@
 
 SRC_URI[md5sum] = "59eab7abf38f35355d3786803bd2441f"
 SRC_URI[sha256sum] = "1e37ab2e6238eaef9f573560ea7379e6955570f7c9503083e50c4c185c1956df"
+
+PNBLACKLIST[vala-dbus-binding-tool] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/131628/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool_git.bb
index 02a869f..32f3455 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool_git.bb
@@ -16,3 +16,5 @@
     file://0001-configure.ac-don-t-use-dash-in-m4-macro-names.patch \
 "
 S = "${WORKDIR}/git"
+
+PNBLACKLIST[vala-dbus-binding-tool] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130581/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/xerces-c/xerces-c_3.1.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/xerces-c/xerces-c_3.1.4.bb
index b848b06..64ac747 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/xerces-c/xerces-c_3.1.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/xerces-c/xerces-c_3.1.4.bb
@@ -16,8 +16,8 @@
 inherit autotools
 
 PACKAGECONFIG ??= "curl icu"
-PACKAGECONFIG[curl] = "--with-curl=${STAGING_DIR},--with-curl=no,curl"
-PACKAGECONFIG[icu] = "--with-icu=${STAGING_DIR},--with-icu=no,icu"
+PACKAGECONFIG[curl] = "--with-curl=${STAGING_DIR_TARGET}${prefix},--with-curl=no,curl"
+PACKAGECONFIG[icu] = "--with-icu=${STAGING_DIR_TARGET}${prefix},--with-icu=no,icu"
 
 do_install_prepend () {
     sed -i -e 's:-L${STAGING_DIR}/lib:-L\$\{libdir\}:g' ${B}/xerces-c.pc
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_1.0.12.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_1.0.12.bb
new file mode 100644
index 0000000..8ced7b8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_1.0.12.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Yet Another JSON Library."
+
+DESCRIPTION = "YAJL is a small event-driven (SAX-style) JSON parser \
+written in ANSI C, and a small validating JSON generator."
+
+HOMEPAGE = "http://lloyd.github.com/yajl/"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=da2e9aa80962d54e7c726f232a2bd1e8"
+
+# Use 1.0.12 tag
+SRCREV = "17b1790fb9c8abbb3c0f7e083864a6a014191d56"
+SRC_URI = "git://github.com/lloyd/yajl;nobranch=1"
+
+inherit cmake lib_package
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb
index 1bf5389..d9a5821 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb
@@ -15,4 +15,4 @@
 
 inherit cmake lib_package
 
-EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
+EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/acpica_20150515.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/acpica_20150515.bb
deleted file mode 100644
index de897e1..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/acpica_20150515.bb
+++ /dev/null
@@ -1,46 +0,0 @@
-SUMMARY = "ACPICA tools for the development and debug of ACPI tables"
-DESCRIPTION = "The ACPI Component Architecture (ACPICA) project provides an \
-OS-independent reference implementation of the Advanced Configuration and \
-Power Interface Specification (ACPI). ACPICA code contains those portions of \
-ACPI meant to be directly integrated into the host OS as a kernel-resident \
-subsystem, and a small set of tools to assist in developing and debugging \
-ACPI tables."
-
-HOMEPAGE = "http://www.acpica.org/"
-SECTION = "console/tools"
-
-LICENSE = "BSD | GPLv2"
-LIC_FILES_CHKSUM = "file://generate/unix/readme.txt;md5=204407e197c1a01154a48f6c6280c3aa"
-
-COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
-
-DEPENDS = "bison flex"
-
-SRC_URI = "https://acpica.org/sites/acpica/files/acpica-unix2-${PV}.tar.gz \
-    file://no-werror.patch \
-    "
-SRC_URI[md5sum] = "2bc4a7ccc82de9df9fa964f784ecb29c"
-SRC_URI[sha256sum] = "61204ec56d71bc9bfa2ee2ade4c66f7e8541772ac72ef8ccc20b3f339cc96374"
-
-S = "${WORKDIR}/acpica-unix2-${PV}"
-
-EXTRA_OEMAKE = "CC='${CC}' 'OPT_CFLAGS=-Wall'"
-
-do_install() {
-    install -D -p -m0755 generate/unix/bin*/iasl ${D}${bindir}/iasl
-    install -D -p -m0755 generate/unix/bin*/acpibin ${D}${bindir}/acpibin
-    install -D -p -m0755 generate/unix/bin*/acpiexec ${D}${bindir}/acpiexec
-    install -D -p -m0755 generate/unix/bin*/acpihelp ${D}${bindir}/acpihelp
-    install -D -p -m0755 generate/unix/bin*/acpinames ${D}${bindir}/acpinames
-    install -D -p -m0755 generate/unix/bin*/acpisrc ${D}${bindir}/acpisrc
-    install -D -p -m0755 generate/unix/bin*/acpixtract ${D}${bindir}/acpixtract
-}
-
-# iasl*.bb is a subset of this recipe, so RREPLACE it
-PROVIDES = "iasl"
-RPROVIDES_${PN} += "iasl"
-RREPLACES_${PN} += "iasl"
-RCONFLIGHTS_${PN} += "iasl"
-
-NATIVE_INSTALL_WORKS = "1"
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/acpitests_20140828.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/acpitests_20140828.bb
deleted file mode 100644
index 1f6f190..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/acpitests_20140828.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-SUMMARY = "Test suite used to validate ACPICA"
-HOMEPAGE = "http://www.acpica.org/"
-
-LICENSE = "Intel"
-LIC_FILES_CHKSUM = "file://tests/aapits/atexec.c;beginline=1;endline=115;md5=e92bcdfcd01d117d1bda3e814bb2030a"
-
-DEPENDS = "bison flex"
-
-SRC_URI = "https://acpica.org/sites/acpica/files/acpitests-unix-${PV}.tar.gz;name=acpitests \
-           https://acpica.org/sites/acpica/files/acpica-unix2-${PV}.tar.gz;name=acpica \
-           file://aapits-linux.patch \
-           file://aapits-makefile.patch \
-"
-SRC_URI[acpitests.md5sum] = "db9d6fdaa8e3eb101d700ee5ba4938ed"
-SRC_URI[acpitests.sha256sum] = "e576c74bf1bf1c9f7348bf9419e05c8acfece7105abcdc052e66670c7af2cf00"
-SRC_URI[acpica.md5sum] = "6f05f0d10166a1b1ff6107f3d1cdf1e5"
-SRC_URI[acpica.sha256sum] = "01d8867656c5ba41dec307c4383ce676196ad4281ac2c9dec9f5be5fac6d888e"
-
-S = "${WORKDIR}/acpitests-unix-${PV}"
-
-EXTRA_OEMAKE = "'CC=${TARGET_PREFIX}gcc ${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}' 'OPT_CFLAGS=-Wall'"
-
-# The Makefiles expect a specific layout
-do_compile() {
-    cp -af ${WORKDIR}/acpica-unix2-${PV}/source ${S}
-    cd tests/aapits
-    oe_runmake
-}
-
-do_install() {
-    install -d ${D}${bindir}
-    install -m0755 tests/aapits/bin/aapits ${D}${bindir}
-}
-
-COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/boinc-AM_CONDITIONAL.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/boinc-AM_CONDITIONAL.patch
new file mode 100644
index 0000000..7becb94
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/boinc-AM_CONDITIONAL.patch
@@ -0,0 +1,24 @@
+Add configure check for gtk2+ and objc++
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+--- A/configure.ac
++++ B/configure.ac
+@@ -39,6 +39,7 @@ AC_PROG_CC
+ AC_PROG_CXX
+ AC_PROG_F77
+ AC_PROG_CPP
++AC_PROG_OBJCXX
+ AC_PROG_MAKE_SET
+ SAH_LINKS
+ AC_LANG_PUSH(C)
+@@ -744,6 +745,8 @@ AM_CONDITIONAL(ENABLE_LIBRARIES, [test "
+ AM_CONDITIONAL(INSTALL_HEADERS, [test "${enable_install_headers}" = yes])
+ AM_CONDITIONAL(HAVE_CUDA_LIB, [test "${enable_client}" = yes -a -f ./coprocs/CUDA/posix/${boinc_platform}/libcudart.so])
+ 
++PKG_CHECK_MODULES([GTK2], [gtk+-2.0])
++
+ dnl ======================================================================
+ dnl some more vodoo required for building portable client-binary (client, clientgui)
+ dnl ======================================================================
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/cross-compile.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/cross-compile.patch
new file mode 100644
index 0000000..287391a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/cross-compile.patch
@@ -0,0 +1,98 @@
+Remove rpath, its bad for cross compiling to encode
+build time rpaths
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: boinc-client_release-7.6-7.6.33/api/Makefile.am
+===================================================================
+--- boinc-client_release-7.6-7.6.33.orig/api/Makefile.am
++++ boinc-client_release-7.6-7.6.33/api/Makefile.am
+@@ -43,18 +43,18 @@ endif
+ 
+ lib_LTLIBRARIES = libboinc_api.la
+ libboinc_api_la_SOURCES = $(api_files)
+-libboinc_api_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
++libboinc_api_la_LDFLAGS = -version-number $(LIBBOINC_VERSION)
+ 
+ if BUILD_GRAPHICS_API
+ lib_LTLIBRARIES += libboinc_graphics2.la
+ libboinc_graphics2_la_SOURCES = $(graphics2_files)
+ libboinc_graphics2_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_srcdir)/samples/image_libs
+-libboinc_graphics2_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION) -ljpeg
++libboinc_graphics2_la_LDFLAGS = -version-number $(LIBBOINC_VERSION) -ljpeg
+ endif #BUILD_GRAPHICS_API
+ 
+ lib_LTLIBRARIES += libboinc_opencl.la
+ libboinc_opencl_la_SOURCES = $(opencl_files)
+-libboinc_opencl_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
++libboinc_opencl_la_LDFLAGS = -version-number $(LIBBOINC_VERSION)
+ 
+ if INSTALL_HEADERS
+ ## install only headers that are meant for exporting the API !!
+Index: boinc-client_release-7.6-7.6.33/lib/Makefile.am
+===================================================================
+--- boinc-client_release-7.6-7.6.33.orig/lib/Makefile.am
++++ boinc-client_release-7.6-7.6.33/lib/Makefile.am
+@@ -173,7 +173,7 @@ lib_LTLIBRARIES = libboinc.la
+ libboinc_la_SOURCES = $(generic_sources) $(mac_sources) $(win_sources)
+ libboinc_la_CFLAGS = $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
+ libboinc_la_CXXFLAGS = $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
+-libboinc_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -static -version-number $(LIBBOINC_VERSION)
++libboinc_la_LDFLAGS = -static -version-number $(LIBBOINC_VERSION)
+ libboinc_la_LIBADD =
+ 
+ if ENABLE_BOINCCRYPT
+@@ -181,7 +181,7 @@ lib_LTLIBRARIES += libboinc_crypt.la
+ libboinc_crypt_la_SOURCES = crypt.cpp
+ libboinc_crypt_la_CFLAGS = $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS) $(SSL_CFLAGS)
+ libboinc_crypt_la_CXXFLAGS = $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS) $(SSL_CXXFLAGS)
+-libboinc_crypt_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -static -version-number $(LIBBOINC_VERSION)
++libboinc_crypt_la_LDFLAGS = -static -version-number $(LIBBOINC_VERSION)
+ libboinc_crypt_la_LIBADD =
+ endif
+ 
+@@ -190,7 +190,7 @@ lib_LTLIBRARIES += libboinc_fcgi.la
+ libboinc_fcgi_la_SOURCES = $(libfcgi_sources) $(mac_sources) $(win_sources)
+ libboinc_fcgi_la_CFLAGS = -D_USING_FCGI_ $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
+ libboinc_fcgi_la_CXXFLAGS = -D_USING_FCGI_ $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
+-libboinc_fcgi_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
++libboinc_fcgi_la_LDFLAGS = -version-number $(LIBBOINC_VERSION)
+ libboinc_fcgi_la_LIBADD =
+ endif 
+ # end of "if ENABLE_FCGI"
+Index: boinc-client_release-7.6-7.6.33/sched/Makefile.am
+===================================================================
+--- boinc-client_release-7.6-7.6.33.orig/sched/Makefile.am
++++ boinc-client_release-7.6-7.6.33/sched/Makefile.am
+@@ -26,7 +26,7 @@ lib_LTLIBRARIES = libsched.la
+ libsched_la_SOURCES = $(libsched_sources)
+ libsched_la_CFLAGS = $(AM_CPPFLAGS)
+ libsched_la_CXXFLAGS = $(AM_CPPFLAGS)
+-libsched_la_LDFLAGS= -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
++libsched_la_LDFLAGS= -version-number $(LIBBOINC_VERSION)
+ libsched_la_LIBADD= $(SSL_LIBS)
+ 
+ ## install only headers that are meant for exporting the API !!
+@@ -48,7 +48,7 @@ lib_LTLIBRARIES += libsched_fcgi.la
+ libsched_fcgi_la_SOURCES = $(libsched_sources)
+ libsched_fcgi_la_CFLAGS = -D_USING_FCGI_ $(AM_CPPFLAGS)
+ libsched_fcgi_la_CXXFLAGS = -D_USING_FCGI_ $(AM_CPPFLAGS)
+-libsched_fcgi_la_LDFLAGS= -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
++libsched_fcgi_la_LDFLAGS= -version-number $(LIBBOINC_VERSION)
+ libsched_fcgi_la_LIBADD=
+ 
+ endif
+Index: boinc-client_release-7.6-7.6.33/zip/Makefile.am
+===================================================================
+--- boinc-client_release-7.6-7.6.33.orig/zip/Makefile.am
++++ boinc-client_release-7.6-7.6.33/zip/Makefile.am
+@@ -61,7 +61,7 @@ endif
+ 
+ lib_LTLIBRARIES = libboinc_zip.la
+ libboinc_zip_la_SOURCES = $(libboinc_zip_sources)
+-libboinc_zip_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
++libboinc_zip_la_LDFLAGS = -version-number $(LIBBOINC_VERSION)
+ libboinc_zip_la_LIBADD =
+ 
+ # Some OSs may not prefix libraries with lib.
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/gtk-configure.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/gtk-configure.patch
new file mode 100644
index 0000000..4ae8d58
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/gtk-configure.patch
@@ -0,0 +1,29 @@
+Check for gtk2+ only when manager is enabled
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: boinc-client_release-7.6-7.6.33/configure.ac
+===================================================================
+--- boinc-client_release-7.6-7.6.33.orig/configure.ac
++++ boinc-client_release-7.6-7.6.33/configure.ac
+@@ -1033,6 +1033,11 @@ else
+   AM_CONDITIONAL([GUI_GTK], false)
+ fi
+ 
++dnl ---------- GTK+2.0-----------------------------------------------------
++if test "X${no_x}" != "Xyes"; then
++  PKG_CHECK_MODULES([GTK2], [gtk+-2.0])
++fi
++
+ dnl ---------- libNotify --------------------------------------------------
+ if test "${enable_manager}" = yes ; then
+   PKG_CHECK_MODULES(LIBNOTIFY, [libnotify])
+@@ -1082,7 +1087,6 @@ AM_CONDITIONAL(ENABLE_BOINCCRYPT, [test
+ AM_CONDITIONAL(INSTALL_HEADERS, [test "${enable_install_headers}" = yes])
+ AM_CONDITIONAL(HAVE_CUDA_LIB, [test "${enable_client}" = yes -a -f ./coprocs/CUDA/posix/${boinc_platform}/libcudart.so])
+ 
+-PKG_CHECK_MODULES([GTK2], [gtk+-2.0])
+ 
+ dnl ======================================================================
+ dnl some more vodoo required for building portable client-binary (client, clientgui)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/opengl_m4_check.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/opengl_m4_check.patch
new file mode 100644
index 0000000..0b057ea
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client/opengl_m4_check.patch
@@ -0,0 +1,19 @@
+Do not add prefix/lib to library search path
+let sysroot take care of that
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate[Cross-compile specific]
+
+Index: boinc-client_release-7.6-7.6.33/m4/ax_check_gl.m4
+===================================================================
+--- boinc-client_release-7.6-7.6.33.orig/m4/ax_check_gl.m4
++++ boinc-client_release-7.6-7.6.33/m4/ax_check_gl.m4
+@@ -58,7 +58,7 @@ else
+     else
+       ax_try_lib="${ax_lib}"
+     fi
+-    LIBS="-L${prefix}/lib ${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
++    LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
+     AC_LINK_IFELSE(
+     [AC_LANG_PROGRAM([[
+ # if HAVE_WINDOWS_H && defined(_WIN32)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client_7.6.33.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client_7.6.33.bb
new file mode 100644
index 0000000..ac5f755
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client_7.6.33.bb
@@ -0,0 +1,77 @@
+# Copyright (C) 2016 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Open-source software for volunteer computing"
+DESCRIPTION = "The Berkeley Open Infrastructure for Network Computing (BOINC) is an open- \
+source software platform which supports distributed computing, primarily in \
+the form of volunteer computing and desktop Grid computing.  It is well \
+suited for problems which are often described as trivially parallel.  BOINC \
+is the underlying software used by projects such as SETI@home, Einstein@Home, \
+ClimatePrediciton.net, the World Community Grid, and many other distributed \
+computing projects. \
+This package installs the BOINC client software, which will allow your \
+computer to participate in one or more BOINC projects, using your spare \
+computer time to search for cures for diseases, model protein folding, study \
+global warming, discover sources of gravitational waves, and many other types \
+of scientific and mathematical research."
+
+HOMEPAGE = "http://boinc.berkeley.edu/"
+LICENSE = "LGPLv2+ & GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6"
+SECTION = "applications"
+DEPENDS = "curl \
+           jpeg \
+           openssl \
+           sqlite3 \
+           virtual/libgl \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'libnotify', '', d)} \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk+ libnotify xcb-util libxscrnsaver', '', d)} \
+           nettle \
+"
+
+SRC_URI = "https://github.com/BOINC/boinc/archive/client_release/7.6/${PV}.tar.gz \
+           file://boinc-AM_CONDITIONAL.patch \
+           file://opengl_m4_check.patch \
+           file://cross-compile.patch \
+           file://gtk-configure.patch \
+"
+SRC_URI[md5sum] = "437b4b98e384b4bda4ef7056e68166ac"
+SRC_URI[sha256sum] = "c4b1c29b9655013e0ac61dddf47ad7f30f38c46159f02a9d9dc8ab854e99aa6d"
+
+inherit gettext autotools-brokensep pkgconfig
+
+S = "${WORKDIR}/${BPN}_release-7.6-${PV}"
+
+EXTRA_OECONF += "\
+    --enable-libraries \
+    --enable-unicode \
+    --enable-shared \
+    --enable-dynamic-client-linkage \
+    --enable-client \
+    --disable-server \
+    --disable-static \
+    --disable-manager \
+    --with-ssl=${STAGING_EXECPREFIXDIR} \
+    --without-wxdir \
+    --without-x \
+    --with-boinc-platform=${TARGET_SYS} \
+"
+export PKG_CONFIG = "${STAGING_BINDIR_NATIVE}/pkg-config"
+
+do_configure_prepend () {
+	if "${@bb.utils.contains('DEPENDS', 'gtk+', '1', '0', d)}" = "0"
+	then
+		export GTK2_CFLAGS=""
+		export GTK2_LIBS=""
+	fi
+}
+
+do_compile_prepend () {
+	# Disable rpaths
+	sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' ${B}/${TARGET_SYS}-libtool
+	sed -i -e 's|^sys_lib_dlsearch_path_spec=.*|sys_lib_dlsearch_path_spec=""|g' ${B}/${TARGET_SYS}-libtool
+	sed -i -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' ${B}/${TARGET_SYS}-libtool
+}
+
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/cfengine/cfengine_3.9.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/cfengine/cfengine_3.9.0.bb
index 68a15f8..4aa8ded 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/cfengine/cfengine_3.9.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/cfengine/cfengine_3.9.0.bb
@@ -31,8 +31,7 @@
 SYSTEMD_AUTO_ENABLE_${PN} = "disable"
 
 PACKAGECONFIG ??= "libpcre openssl \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)} \
 "
 PACKAGECONFIG[libxml2] = "--with-libxml2=yes,--with-libxml2=no,libxml2,"
 PACKAGECONFIG[mysql] = "--with-mysql=yes,--with-mysql=no,mysql,"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-collectd-replace-deprecated-readdir_r-with-readdir.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-collectd-replace-deprecated-readdir_r-with-readdir.patch
deleted file mode 100644
index f3d53f2..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-collectd-replace-deprecated-readdir_r-with-readdir.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-Subject: [PATCH] collectd: replace deprecated readdir_r() with readdir()
-
-* Replace the usage of readdir_r() with readdir()
-  to address a compilation error under glibc 2.24
-  due to the deprecation of readdir_r
-
-| ../../collectd-5.5.0/src/vserver.c: In function 'vserver_read':
-| ../../collectd-5.5.0/src/vserver.c:167:3: error: 'readdir_r' is deprecated [-Werror=deprecated-declarations]
-|    status = readdir_r (proc, (struct dirent *) dirent_buffer, &dent);
-|    ^~~~~~
-| In file included from /buildarea4/myu2/build/prj_test_20160722/bitbake_build/tmp/sysroots/qemux86/usr/include/features.h:368:0,
-|                  from /buildarea4/myu2/build/prj_test_20160722/bitbake_build/tmp/sysroots/qemux86/usr/include/stdio.h:27,
-|                  from ../../collectd-5.5.0/src/daemon/collectd.h:34,
-|                  from ../../collectd-5.5.0/src/vserver.c:29:
-| /buildarea4/myu2/build/prj_test_20160722/bitbake_build/tmp/sysroots/qemux86/usr/include/dirent.h:189:12: note: declared here
-|  extern int __REDIRECT (readdir_r,
-|             ^
-
-  [1]https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7584a3f96de88d5eefe5d6c634515278cbfbf052;hp=8d9c92017d85f23ba6a2b3614b2f2bcf1820d6f0
-
-Upstream-Status: Pending
-
-Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
----
- src/vserver.c | 15 ++++-----------
- 1 file changed, 4 insertions(+), 11 deletions(-)
-
-diff --git a/src/vserver.c b/src/vserver.c
-index bd2e867..2e4e715 100644
---- a/src/vserver.c
-+++ b/src/vserver.c
-@@ -131,15 +131,8 @@ static derive_t vserver_get_sock_bytes(const char *s)
- 
- static int vserver_read (void)
- {
--#if NAME_MAX < 1024
--# define DIRENT_BUFFER_SIZE (sizeof (struct dirent) + 1024 + 1)
--#else
--# define DIRENT_BUFFER_SIZE (sizeof (struct dirent) + NAME_MAX + 1)
--#endif
--
- 	DIR 			*proc;
--	struct dirent 	*dent; /* 42 */
--	char dirent_buffer[DIRENT_BUFFER_SIZE];
-+	struct dirent 	*dent = NULL; /* 42 */
- 
- 	errno = 0;
- 	proc = opendir (PROCDIR);
-@@ -164,11 +157,11 @@ static int vserver_read (void)
- 
- 		int status;
- 
--		status = readdir_r (proc, (struct dirent *) dirent_buffer, &dent);
--		if (status != 0)
-+		dent = readdir (proc);
-+		if (dent == NULL && errno != 0)
- 		{
- 			char errbuf[4096];
--			ERROR ("vserver plugin: readdir_r failed: %s",
-+			ERROR ("vserver plugin: readdir failed: %s",
- 					sstrerror (errno, errbuf, sizeof (errbuf)));
- 			closedir (proc);
- 			return (-1);
--- 
-2.8.2
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-conditionally-check-libvirt.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-conditionally-check-libvirt.patch
index d0a5804..1ceacd8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-conditionally-check-libvirt.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-conditionally-check-libvirt.patch
@@ -9,31 +9,28 @@
  configure.ac | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
 
-diff --git a/configure.ac b/configure.ac
-index 923498e..7206095 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4778,12 +4778,14 @@ then
- 		with_libxml2="no (pkg-config doesn't know libxml-2.0)"
- 	fi
+Index: collectd-5.7.1/configure.ac
+===================================================================
+--- collectd-5.7.1.orig/configure.ac
++++ collectd-5.7.1/configure.ac
+@@ -5556,12 +5556,14 @@ else
+ 	with_libxml2="no (pkg-config doesn't know libxml-2.0)"
+ fi
  
--	$PKG_CONFIG --exists libvirt 2>/dev/null
--	if test "$?" = "0"
--	then
--		with_libvirt="yes"
--	else
--		with_libvirt="no (pkg-config doesn't know libvirt)"
-+	if test "x$enable_libvirt" = "xyes"; then
-+		$PKG_CONFIG --exists libvirt 2>/dev/null
-+		if test "$?" = "0"
-+		then
-+			with_libvirt="yes"
-+		else
-+			with_libvirt="no (pkg-config doesn't know libvirt)"
-+		fi
- 	fi
+-$PKG_CONFIG --exists libvirt 2>/dev/null
+-if test "$?" = "0"
+-then
+-	with_libvirt="yes"
+-else
+-	with_libvirt="no (pkg-config doesn't know libvirt)"
++if test "x$enable_libvirt" = "xyes"; then
++	$PKG_CONFIG --exists libvirt 2>/dev/null
++	if test "$?" = "0"
++	then
++		with_libvirt="yes"
++	else
++		with_libvirt="no (pkg-config doesn't know libvirt)"
++	fi
  fi
  if test "x$with_libxml2" = "xyes"
--- 
-1.9.1
-
+ then
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-configure-Check-for-Wno-error-format-truncation-comp.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-configure-Check-for-Wno-error-format-truncation-comp.patch
new file mode 100644
index 0000000..70b0983
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-configure-Check-for-Wno-error-format-truncation-comp.patch
@@ -0,0 +1,121 @@
+From 14d469bc82c758116aef7d549abd49c131b4170f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 11:54:57 -0700
+Subject: [PATCH] configure: Check for -Wno-error=format-truncation compiler
+ option
+
+If this option is supported by compiler then disable it ( gcc7+)
+Fixes
+client.c:834:23: error: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Werror=format-truncation=]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac                |  3 +-
+ m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 76 insertions(+), 1 deletion(-)
+ create mode 100644 m4/ax_check_compile_flag.m4
+
+diff --git a/configure.ac b/configure.ac
+index 8854542..f3a6b57 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4,7 +4,6 @@ AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)])
+ AC_CONFIG_SRCDIR(src/target_set.c)
+ AC_CONFIG_HEADERS(src/config.h)
+ AC_CONFIG_AUX_DIR([libltdl/config])
+-
+ dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
+ dnl we don't really need the 'u' even in older toolchains.  Then there is
+ dnl older libtool, which spelled it AR_FLAGS
+@@ -6688,6 +6687,8 @@ then
+         AM_CFLAGS="$AM_CFLAGS -Werror"
+         AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
+ fi
++AX_CHECK_COMPILE_FLAG([-Werror=format-truncation],[AM_CFLAGS="$AM_CFLAGS -Wno-error=format-truncation" AM_CXXFLAGS="$AM_CXXFLAGS -Wno-error=format-truncation"])
++
+ AC_SUBST([AM_CFLAGS])
+ AC_SUBST([AM_CXXFLAGS])
+ 
+diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
+new file mode 100644
+index 0000000..dcabb92
+--- /dev/null
++++ b/m4/ax_check_compile_flag.m4
+@@ -0,0 +1,74 @@
++# ===========================================================================
++#  https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
++#
++# DESCRIPTION
++#
++#   Check whether the given FLAG works with the current language's compiler
++#   or gives an error.  (Warnings, however, are ignored)
++#
++#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
++#   success/failure.
++#
++#   If EXTRA-FLAGS is defined, it is added to the current language's default
++#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
++#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
++#   force the compiler to issue an error when a bad flag is given.
++#
++#   INPUT gives an alternative input source to AC_COMPILE_IFELSE.
++#
++#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
++#   macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
++#
++# LICENSE
++#
++#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
++#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
++#
++#   This program is free software: you can redistribute it and/or modify it
++#   under the terms of the GNU General Public License as published by the
++#   Free Software Foundation, either version 3 of the License, or (at your
++#   option) any later version.
++#
++#   This program is distributed in the hope that it will be useful, but
++#   WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++#   Public License for more details.
++#
++#   You should have received a copy of the GNU General Public License along
++#   with this program. If not, see <https://www.gnu.org/licenses/>.
++#
++#   As a special exception, the respective Autoconf Macro's copyright owner
++#   gives unlimited permission to copy, distribute and modify the configure
++#   scripts that are the output of Autoconf when processing the Macro. You
++#   need not follow the terms of the GNU General Public License when using
++#   or distributing such scripts, even though portions of the text of the
++#   Macro appear in them. The GNU General Public License (GPL) does govern
++#   all other use of the material that constitutes the Autoconf Macro.
++#
++#   This special exception to the GPL applies to versions of the Autoconf
++#   Macro released by the Autoconf Archive. When you make and distribute a
++#   modified version of the Autoconf Macro, you may extend this special
++#   exception to the GPL to apply to your modified version as well.
++
++#serial 5
++
++AC_DEFUN([AX_CHECK_COMPILE_FLAG],
++[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
++AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
++  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
++  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
++  AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
++    [AS_VAR_SET(CACHEVAR,[yes])],
++    [AS_VAR_SET(CACHEVAR,[no])])
++  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
++AS_VAR_IF(CACHEVAR,yes,
++  [m4_default([$2], :)],
++  [m4_default([$3], :)])
++AS_VAR_POPDEF([CACHEVAR])dnl
++])dnl AX_CHECK_COMPILE_FLAGS
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-fix-to-build-with-glibc-2.25.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-fix-to-build-with-glibc-2.25.patch
new file mode 100644
index 0000000..be942e5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-fix-to-build-with-glibc-2.25.patch
@@ -0,0 +1,24 @@
+Subject: fix to build with glibc 2.25
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/md.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/md.c b/src/md.c
+index 3725f9a..202225b 100644
+--- a/src/md.c
++++ b/src/md.c
+@@ -25,6 +25,7 @@
+ #include "utils_ignorelist.h"
+ 
+ #include <sys/ioctl.h>
++#include <sys/sysmacros.h>
+ 
+ #include <linux/major.h>
+ #include <linux/raid/md_u.h>
+-- 
+2.8.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-redefine-the-dependence.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-redefine-the-dependence.patch
deleted file mode 100644
index ef6afad..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/0001-redefine-the-dependence.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-[PATCH] define the collectd dependence
-
-Upstream-Status: Pending
-
-libavltree.la libcommon.la libheap.la are created dynamically, and in LDADD,
-but not in DEPENDENCIES
-
-Signed-off-by: Roy Li <rongqing.li@windriver.com>
----
- src/daemon/Makefile.am | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am
-index 10860ec..7f826e3 100644
---- a/src/daemon/Makefile.am
-+++ b/src/daemon/Makefile.am
-@@ -49,7 +49,7 @@ collectd_CPPFLAGS =  $(AM_CPPFLAGS) $(LTDLINCL)
- collectd_CFLAGS = $(AM_CFLAGS)
- collectd_LDFLAGS = -export-dynamic
- collectd_LDADD = libavltree.la libcommon.la libheap.la -lm
--collectd_DEPENDENCIES =
-+collectd_DEPENDENCIES = libavltree.la libcommon.la libheap.la
- 
- # Link to these libraries..
- if BUILD_WITH_LIBRT
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/CVE-2016-6254.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/CVE-2016-6254.patch
deleted file mode 100644
index bc85b4c..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/CVE-2016-6254.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From dd8483a4beb6f61521d8b32c726523bbea21cd92 Mon Sep 17 00:00:00 2001
-From: Florian Forster <octo@collectd.org>
-Date: Tue, 19 Jul 2016 10:00:37 +0200
-Subject: [PATCH] network plugin: Fix heap overflow in parse_packet().
-
-Emilien Gaspar has identified a heap overflow in parse_packet(), the
-function used by the network plugin to parse incoming network packets.
-
-This is a vulnerability in collectd, though the scope is not clear at
-this point. At the very least specially crafted network packets can be
-used to crash the daemon. We can't rule out a potential remote code
-execution though.
-
-Fixes: CVE-2016-6254
-
-cherry picked from upstream commit b589096f
-
-Upstream Status: Backport
-
-Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com>
----
- src/network.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/src/network.c b/src/network.c
-index 551bd5c..cb979b2 100644
---- a/src/network.c
-+++ b/src/network.c
-@@ -1444,6 +1444,7 @@ static int parse_packet (sockent_t *se, /* {{{ */
- 				printed_ignore_warning = 1;
- 			}
- 			buffer = ((char *) buffer) + pkg_length;
-+			buffer_size -= (size_t) pkg_length;
- 			continue;
- 		}
- #endif /* HAVE_LIBGCRYPT */
-@@ -1471,6 +1472,7 @@ static int parse_packet (sockent_t *se, /* {{{ */
- 				printed_ignore_warning = 1;
- 			}
- 			buffer = ((char *) buffer) + pkg_length;
-+			buffer_size -= (size_t) pkg_length;
- 			continue;
- 		}
- #endif /* HAVE_LIBGCRYPT */
-@@ -1612,6 +1614,7 @@ static int parse_packet (sockent_t *se, /* {{{ */
- 			DEBUG ("network plugin: parse_packet: Unknown part"
- 					" type: 0x%04hx", pkg_type);
- 			buffer = ((char *) buffer) + pkg_length;
-+			buffer_size -= (size_t) pkg_length;
- 		}
- 	} /* while (buffer_size > sizeof (part_header_t)) */
- 
--- 
-2.7.4
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/collectd-version.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/collectd-version.patch
deleted file mode 100644
index 86c3f65..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/collectd-version.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Don't pick up version string from parent git repository
-
-If the collectd source is extracted from a tarball underneath a
-directory structure that includes another git repository, that
-repository will be picked up by "git describe" which is not
-desirable. Check whether collectd itself is a git repository and just
-use the default version if not.
-
-Upstream-Status: Pending
-
-Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-
-diff --git a/version-gen.sh b/version-gen.sh
-index b09be8e..2671066 100755
---- a/version-gen.sh
-+++ b/version-gen.sh
-@@ -2,8 +2,10 @@
- 
- DEFAULT_VERSION="5.5.0.git"
- 
--VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
--
-+VERSION=""
-+if test -d .git ; then
-+	VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
-+fi
- if test -z "$VERSION"; then
- 	VERSION="$DEFAULT_VERSION"
- fi
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/no-gcrypt-badpath.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/no-gcrypt-badpath.patch
index 0e876ae..1fde6a0 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/no-gcrypt-badpath.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd/no-gcrypt-badpath.patch
@@ -1,30 +1,43 @@
-Disable defaulting of GCRYPT_LDFLAGS to -L/usr/lib
-
-Prevents "unsafe for cross compilation" warnings that cause
-do_qa_configure to fail.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-
-Index: collectd-5.4.1/configure.ac
+Index: collectd-5.7.1/configure.ac
 ===================================================================
---- collectd-5.4.1.orig/configure.ac	2014-09-03 01:20:22.062084244 -0700
-+++ collectd-5.4.1/configure.ac	2014-09-03 01:20:22.058084244 -0700
-@@ -1867,11 +1867,11 @@
- 		GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
- 	fi
+--- collectd-5.7.1.orig/configure.ac
++++ collectd-5.7.1/configure.ac
+@@ -2305,7 +2305,7 @@ AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([
+ 	 with_libgcrypt="yes"
+  else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
+  then
+-	 with_libgcrypt_config="$withval/bin/gcrypt-config"
++	 with_libgcrypt_config="$withval/bin/pkg-config"
+ 	 with_libgcrypt="yes"
+  else if test -d "$withval"
+  then
+@@ -2313,12 +2313,12 @@ AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([
+ 	 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
+ 	 with_libgcrypt="yes"
+  else
+-	 with_libgcrypt_config="gcrypt-config"
++	 with_libgcrypt_config="pkg-config"
+ 	 with_libgcrypt="$withval"
+  fi; fi; fi
+ ],
+ [
+- with_libgcrypt_config="libgcrypt-config"
++ with_libgcrypt_config="pkg-config"
+  with_libgcrypt="yes"
+ ])
  
--	if test "x$GCRYPT_LDFLAGS" = "x"
--	then
--		gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
--		GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
--	fi
-+#	if test "x$GCRYPT_LDFLAGS" = "x"
-+#	then
-+#		gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
-+#		GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
-+#	fi
+@@ -2326,12 +2326,12 @@ if test "x$with_libgcrypt" = "xyes" && t
+ then
+ 	if test "x$GCRYPT_CPPFLAGS" = "x"
+ 	then
+-		GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
++		GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags libgcrypt 2>/dev/null`
+ 	fi
  
  	if test "x$GCRYPT_LIBS" = "x"
  	then
+-		GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
++		GCRYPT_LIBS=`"$with_libgcrypt_config" --lib libgcrypt 2>/dev/null`
+ 	fi
+ fi
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd_5.5.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd_5.5.0.bb
deleted file mode 100644
index 34edecf..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd_5.5.0.bb
+++ /dev/null
@@ -1,88 +0,0 @@
-SUMMARY = "Collects and summarises system performance statistics"
-DESCRIPTION = "collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files."
-LICENSE = "GPLv2 & MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=1bd21f19f7f0c61a7be8ecacb0e28854"
-
-DEPENDS = "rrdtool curl libpcap libxml2 yajl libgcrypt libtool lvm2"
-
-SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \
-           file://no-gcrypt-badpath.patch \
-           file://collectd-version.patch \
-           file://0001-redefine-the-dependence.patch  \
-           file://collectd.init \
-           file://collectd.service \
-           file://0001-conditionally-check-libvirt.patch \
-           file://0001-collectd-replace-deprecated-readdir_r-with-readdir.patch \
-           file://CVE-2016-6254.patch \
-"
-SRC_URI[md5sum] = "c39305ef5514b44238b0d31f77e29e6a"
-SRC_URI[sha256sum] = "847684cf5c10de1dc34145078af3fcf6e0d168ba98c14f1343b1062a4b569e88"
-
-inherit autotools pythonnative update-rc.d pkgconfig systemd
-
-SYSTEMD_SERVICE_${PN} = "collectd.service"
-
-# Floatingpoint layout, architecture dependent
-# 'nothing', 'endianflip' or 'intswap'
-FPLAYOUT ?= "--with-fp-layout=nothing"
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[openjdk] = "--with-java=${STAGING_DIR_TARGET}${libdir}/jvm,--without-java,openjdk-7"
-PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp --with-libnetsnmp=no,net-snmp"
-PACKAGECONFIG[libmemcached] = "--with-libmemcached,--without-libmemcached,libmemcached"
-PACKAGECONFIG[iptables] = "--enable-iptables,--disable-iptables,iptables"
-PACKAGECONFIG[postgresql] = "--enable-postgresql --with-libpq=yes, \
-        --disable-postgresql --with-libpq=no,postgresql"
-PACKAGECONFIG[mysql] = "--enable-mysql --with-libmysql=yes, \
-        --disable-mysql --with-libmysql=no,mysql5"
-PACKAGECONFIG[dbi] = "--enable-dbi,--disable-dbi,libdbi"
-PACKAGECONFIG[modbus] = "--enable-modbus,--disable-modbus,libmodbus"
-PACKAGECONFIG[libowcapi] = "--with-libowcapi,--without-libowcapi,owfs"
-PACKAGECONFIG[sensors] = "--enable-sensors --with-libsensors=yes, \
-        --disable-sensors --with-libsensors=no,lmsensors"
-PACKAGECONFIG[amqp] = "--enable-amqp --with-librabbitmq=yes, \
-        --disable-amqp --with-librabbitmq=no,rabbitmq-c"
-# protobuf-c, libvirt that are currently only available in meta-virtualization layer
-PACKAGECONFIG[pinba] = "--enable-pinba,--disable-pinba,protobuf-c-native protobuf-c"
-PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
-PACKAGECONFIG[libesmtp] = "--with-libesmtp,--without-libesmtp,libesmtp"
-PACKAGECONFIG[libmnl] = "--with-libmnl,--without-libmnl,libmnl"
-PACKAGECONFIG[libatasmart] = "--with-libatasmart,--without-libatasmart,libatasmart"
-PACKAGECONFIG[ldap] = "--enable-openldap --with-libldap,--disable-openldap --without-libldap, openldap"
-
-EXTRA_OECONF = " \
-                ${FPLAYOUT} \
-                --disable-perl --with-libperl=no --with-perl-bindings=no \
-                --with-libgcrypt=${STAGING_BINDIR_CROSS}/libgcrypt-config \
-                --disable-notify_desktop \
-"
-
-do_install_append() {
-    install -d ${D}${sysconfdir}/init.d
-    install -m 0755 ${WORKDIR}/collectd.init ${D}${sysconfdir}/init.d/collectd
-    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/collectd
-    sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/collectd
-    sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/collectd
-    sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/collectd
-
-    # Fix configuration file to allow collectd to start up
-    sed -i 's!^#FQDNLookup[ \t]*true!FQDNLookup   false!g' ${D}${sysconfdir}/collectd.conf
-
-    rmdir "${D}${localstatedir}/run"
-    rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
-
-    # Install systemd unit files
-    install -d ${D}${systemd_unitdir}/system
-    install -m 0644 ${WORKDIR}/collectd.service ${D}${systemd_unitdir}/system
-    sed -i -e 's,@SBINDIR@,${sbindir},g' \
-        ${D}${systemd_unitdir}/system/collectd.service
-}
-
-CONFFILES_${PN} = "${sysconfdir}/collectd.conf"
-
-INITSCRIPT_NAME = "collectd"
-INITSCRIPT_PARAMS = "defaults"
-
-# threshold.so load.so are also provided by gegl
-# disk.so is also provided by libgphoto2-camlibs
-PRIVATE_LIBS = "threshold.so load.so disk.so"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd_5.7.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd_5.7.1.bb
new file mode 100644
index 0000000..b7789c7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/collectd/collectd_5.7.1.bb
@@ -0,0 +1,86 @@
+SUMMARY = "Collects and summarises system performance statistics"
+DESCRIPTION = "collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files."
+LICENSE = "GPLv2 & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1bd21f19f7f0c61a7be8ecacb0e28854"
+
+DEPENDS = "rrdtool curl libpcap libxml2 yajl libgcrypt libtool lvm2"
+
+SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \
+           file://collectd.init \
+           file://collectd.service \
+           file://no-gcrypt-badpath.patch \
+           file://0001-conditionally-check-libvirt.patch \
+           file://0001-fix-to-build-with-glibc-2.25.patch \
+           file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \
+"
+SRC_URI[md5sum] = "dc36141ed3058c4919bbd54b87c07873"
+SRC_URI[sha256sum] = "7edd3643c0842215553b2421d5456f4e9a8a58b07e216b40a7e8e91026d8e501"
+
+inherit autotools pythonnative update-rc.d pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "collectd.service"
+
+# Floatingpoint layout, architecture dependent
+# 'nothing', 'endianflip' or 'intswap'
+FPLAYOUT ?= "--with-fp-layout=nothing"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[openjdk] = "--with-java=${STAGING_DIR_TARGET}${libdir}/jvm,--without-java,openjdk-7"
+PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp --with-libnetsnmp=no,net-snmp"
+PACKAGECONFIG[libmemcached] = "--with-libmemcached,--without-libmemcached,libmemcached"
+PACKAGECONFIG[iptables] = "--enable-iptables,--disable-iptables,iptables"
+PACKAGECONFIG[postgresql] = "--enable-postgresql --with-libpq=yes, \
+        --disable-postgresql --with-libpq=no,postgresql"
+PACKAGECONFIG[mysql] = "--enable-mysql --with-libmysql=yes, \
+        --disable-mysql --with-libmysql=no,mysql5"
+PACKAGECONFIG[dbi] = "--enable-dbi,--disable-dbi,libdbi"
+PACKAGECONFIG[modbus] = "--enable-modbus,--disable-modbus,libmodbus"
+PACKAGECONFIG[libowcapi] = "--with-libowcapi,--without-libowcapi,owfs"
+PACKAGECONFIG[sensors] = "--enable-sensors --with-libsensors=yes, \
+        --disable-sensors --with-libsensors=no,lmsensors"
+PACKAGECONFIG[amqp] = "--enable-amqp --with-librabbitmq=yes, \
+        --disable-amqp --with-librabbitmq=no,rabbitmq-c"
+# protobuf-c, libvirt that are currently only available in meta-virtualization layer
+PACKAGECONFIG[pinba] = "--enable-pinba,--disable-pinba,protobuf-c-native protobuf-c"
+PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
+PACKAGECONFIG[libesmtp] = "--with-libesmtp,--without-libesmtp,libesmtp"
+PACKAGECONFIG[libmnl] = "--with-libmnl,--without-libmnl,libmnl"
+PACKAGECONFIG[libatasmart] = "--with-libatasmart,--without-libatasmart,libatasmart"
+PACKAGECONFIG[ldap] = "--enable-openldap --with-libldap,--disable-openldap --without-libldap, openldap"
+
+EXTRA_OECONF = " \
+                ${FPLAYOUT} \
+                --disable-perl --with-libperl=no --with-perl-bindings=no \
+                --with-libgcrypt=${STAGING_BINDIR_CROSS}/libgcrypt-config \
+                --disable-notify_desktop \
+"
+
+do_install_append() {
+    install -d ${D}${sysconfdir}/init.d
+    install -m 0755 ${WORKDIR}/collectd.init ${D}${sysconfdir}/init.d/collectd
+    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/collectd
+    sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/collectd
+    sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/collectd
+    sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/collectd
+
+    # Fix configuration file to allow collectd to start up
+    sed -i 's!^#FQDNLookup[ \t]*true!FQDNLookup   false!g' ${D}${sysconfdir}/collectd.conf
+
+    rmdir "${D}${localstatedir}/run"
+    rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
+
+    # Install systemd unit files
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/collectd.service ${D}${systemd_unitdir}/system
+    sed -i -e 's,@SBINDIR@,${sbindir},g' \
+        ${D}${systemd_unitdir}/system/collectd.service
+}
+
+CONFFILES_${PN} = "${sysconfdir}/collectd.conf"
+
+INITSCRIPT_NAME = "collectd"
+INITSCRIPT_PARAMS = "defaults"
+
+# threshold.so load.so are also provided by gegl
+# disk.so is also provided by libgphoto2-camlibs
+PRIVATE_LIBS = "threshold.so load.so disk.so"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/corosync/corosync/0001-Include-fcntl.h-for-F_-and-O_-defines.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/corosync/corosync/0001-Include-fcntl.h-for-F_-and-O_-defines.patch
new file mode 100644
index 0000000..fe4b079
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/corosync/corosync/0001-Include-fcntl.h-for-F_-and-O_-defines.patch
@@ -0,0 +1,28 @@
+From 85ea47fedbc96ed9180e08b0d371d9966e3a88da Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Aug 2017 17:28:55 -0700
+Subject: [PATCH] Include fcntl.h for F_* and O_* defines
+
+Fixes errors like
+utils.c:95:22: error: use of undeclared identifier 'O_WRONLY'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ qdevices/utils.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/qdevices/utils.c b/qdevices/utils.c
+index 41850b8c..87090853 100644
+--- a/qdevices/utils.c
++++ b/qdevices/utils.c
+@@ -39,6 +39,7 @@
+ 
+ #include <err.h>
+ #include <errno.h>
++#include <fcntl.h>
+ #include <inttypes.h>
+ #include <libgen.h>
+ #include <stdio.h>
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/corosync/corosync_2.4.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/corosync/corosync_2.4.0.bb
deleted file mode 100644
index a213a27..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/corosync/corosync_2.4.0.bb
+++ /dev/null
@@ -1,56 +0,0 @@
-SUMMARY = "The Corosync Cluster Engine and Application Programming Interfaces"
-DESCRIPTION = "This package contains the Corosync Cluster Engine Executive, several default \
-APIs and libraries, default configuration files, and an init script."
-HOMEPAGE = "http://corosync.github.io/corosync/"
-
-SECTION = "base"
-
-inherit autotools pkgconfig systemd
-
-SRC_URI = "http://build.clusterlabs.org/corosync/releases/${BP}.tar.gz"
-SRC_URI[md5sum] = "11bdd5ee2aed5eb2443dd6d6acd6a1ab"
-SRC_URI[sha256sum] = "6fe9523852a892701c4c28c1cd32e067e44cf0e696d5ecf3790afdef1fc309cb"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=a85eb4ce24033adb6088dd1d6ffc5e5d"
-
-DEPENDS = "groff-native nss libqb"
-
-SYSTEMD_SERVICE_${PN} = "corosync.service corosync-notifyd.service"
-SYSTEMD_AUTO_ENABLE = "enable"
-
-INITSCRIPT_NAME = "corosync-daemon"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
-
-PACKAGECONFIG[systemd] = "--enable-systemd --with-systemddir=${systemd_unitdir}/system/,--with-systemddir="
-
-EXTRA_OECONF = "--with-upstartdir=%{_sysconfdir}/init"
-
-do_configure_prepend() {
-    ( cd ${S}
-    ${S}/autogen.sh )
-}
-
-do_install_append() {
-    install -d ${D}${sysconfdir}/sysconfig/
-    install -d ${D}/${sysconfdir}/init.d
-    install -m 0644 ${S}/init/corosync.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync
-    install -m 0644 ${S}/init/corosync-notifyd.conf.in ${D}${sysconfdir}/sysconfig/corosync-notifyd.conf
-    install -m 0644 ${S}/init/corosync.conf.in ${D}${sysconfdir}/sysconfig/corosync.conf
-    install -m 0644 ${S}/init/corosync.in ${D}${sysconfdir}/init.d/corosync
-    install -m 0644 ${S}/init/corosync-notifyd.in ${D}${sysconfdir}/init.d/corosync-notifyd
-
-    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-        install -d ${D}${systemd_unitdir}/system
-        install -m 0644 ${S}/init/corosync.service.in ${D}${systemd_unitdir}/system/corosync.service
-        install -m 0644 ${S}/init/corosync-notifyd.service.in ${D}${systemd_unitdir}/system/corosync-notifyd.service
-        sed -i -e 's,@INITWRAPPERSDIR@,${sysconfdir}/init.d,g' ${D}${systemd_unitdir}/system/corosync.service
-        sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/corosync-notifyd.service
-        sed -i -e 's,@SBINDIR@,${base_sbindir},g' ${D}${systemd_unitdir}/system/corosync-notifyd.service
-    fi
-}
-
-RDEPENDS_${PN} += "bash"
-
-FILES_${PN}-dbg += "${libexecdir}/lcrso/.debug"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/corosync/corosync_2.4.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/corosync/corosync_2.4.2.bb
new file mode 100644
index 0000000..c4af006
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/corosync/corosync_2.4.2.bb
@@ -0,0 +1,56 @@
+SUMMARY = "The Corosync Cluster Engine and Application Programming Interfaces"
+DESCRIPTION = "This package contains the Corosync Cluster Engine Executive, several default \
+APIs and libraries, default configuration files, and an init script."
+HOMEPAGE = "http://corosync.github.io/corosync/"
+
+SECTION = "base"
+
+inherit autotools pkgconfig systemd
+
+SRC_URI = "http://build.clusterlabs.org/corosync/releases/${BP}.tar.gz \
+           file://0001-Include-fcntl.h-for-F_-and-O_-defines.patch \
+          "
+SRC_URI[md5sum] = "547fa78704da53aa35912be58d31035f"
+SRC_URI[sha256sum] = "f26e3011309fe4bcce94b1dc20ea8c462f19483a73f3ca62f13b925d011a4ba9"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a85eb4ce24033adb6088dd1d6ffc5e5d"
+
+DEPENDS = "groff-native nss libqb"
+
+SYSTEMD_SERVICE_${PN} = "corosync.service corosync-notifyd.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+INITSCRIPT_NAME = "corosync-daemon"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemddir=${systemd_system_unitdir},--disable-systemd --without-systemddir,systemd"
+
+EXTRA_OECONF = "ac_cv_path_BASHPATH=${base_bindir}/bash"
+EXTRA_OEMAKE = "tmpfilesdir_DATA="
+
+do_configure_prepend() {
+    ( cd ${S}
+    ${S}/autogen.sh )
+}
+
+do_install_append() {
+    install -d ${D}${sysconfdir}/sysconfig/
+    install -m 0644 ${S}/init/corosync.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync
+    install -m 0644 ${S}/tools/corosync-notifyd.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync-notifyd
+
+    rm -rf "${D}${localstatedir}/run"
+
+    install -d ${D}${sysconfdir}/default/volatiles
+    echo "d root root 0755 ${localstatedir}/log/cluster none" > ${D}${sysconfdir}/default/volatiles/05_corosync
+
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        install -d ${D}${sysconfdir}/tmpfiles.d
+        echo "d ${localstatedir}/log/cluster - - - -" > ${D}${sysconfdir}/tmpfiles.d/corosync.conf
+    fi
+}
+
+RDEPENDS_${PN} += "bash"
+
+FILES_${PN}-dbg += "${libexecdir}/lcrso/.debug"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/dash/dash/0001-Fix-printf-format-errors-with-clang.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/dash/dash/0001-Fix-printf-format-errors-with-clang.patch
new file mode 100644
index 0000000..b3991fa
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/dash/dash/0001-Fix-printf-format-errors-with-clang.patch
@@ -0,0 +1,28 @@
+From 3ddf397febf47f8de9ca2805e92355ecb3ba0e9f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Apr 2017 12:37:54 -0700
+Subject: [PATCH] Fix printf format errors with clang
+
+error: format string is not a string literal (potentially insecure)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/jobs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/jobs.c b/src/jobs.c
+index c2c2332..dcb81c1 100644
+--- a/src/jobs.c
++++ b/src/jobs.c
+@@ -427,7 +427,7 @@ sprint_status(char *s, int status, int sigonly)
+ 				goto out;
+ #endif
+ 		}
+-		col = fmtstr(s, 32, strsignal(st));
++		col = fmtstr(s, 32, "%s", strsignal(st));
+ #ifdef WCOREDUMP
+ 		if (WCOREDUMP(status)) {
+ 			col += fmtstr(s + col, 16, " (core dumped)");
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/dash/dash_0.5.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/dash/dash_0.5.8.bb
index 4961d7b..78ca60d 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/dash/dash_0.5.8.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/dash/dash_0.5.8.bb
@@ -7,7 +7,9 @@
 
 inherit autotools update-alternatives
 
-SRC_URI = "http://gondor.apana.org.au/~herbert/${BPN}/files/${BP}.tar.gz"
+SRC_URI = "http://gondor.apana.org.au/~herbert/${BPN}/files/${BP}.tar.gz \
+           file://0001-Fix-printf-format-errors-with-clang.patch \
+           "
 SRC_URI[md5sum] = "5c152209680dab3c319e8923f6c51378"
 SRC_URI[sha256sum] = "c6db3a237747b02d20382a761397563d813b306c020ae28ce25a1c3915fac60f"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/dialog/dialog_1.3-20160424.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/dialog/dialog_1.3-20160424.bb
deleted file mode 100644
index 2d8fbae..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/dialog/dialog_1.3-20160424.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-SUMMARY = "display dialog boxes from shell scripts"
-DESCRIPTION = "Dialog lets you to present a variety of questions \
-or display messages using dialog boxes from a shell \
-script (or any scripting language)."
-HOMEPAGE = "http://invisible-island.net/dialog/"
-SECTION = "console/utils"
-DEPENDS = "ncurses"
-LICENSE = "LGPL-2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
-
-SRC_URI[md5sum] = "582d804252205f73df2d892ebdc5212e"
-SRC_URI[sha256sum] = "47f5870876e778aa2902f2e91b4070418d4651b647e1a67a94127cb8aab5b5eb"
-
-SRC_URI = "ftp://invisible-island.net/dialog/dialog-${PV}.tgz \
-          "
-
-# hardcoded here for use in dialog-static recipe
-S = "${WORKDIR}/dialog-${PV}"
-
-inherit autotools-brokensep pkgconfig
-
-EXTRA_OECONF = "--with-ncurses \
-                --disable-rpath-hack"
-
-do_configure() {
-    gnu-configize --force
-    sed -i 's,${cf_ncuconfig_root}6-config,${cf_ncuconfig_root}-config,g' -i configure
-    sed -i 's,cf_have_ncuconfig=unknown,cf_have_ncuconfig=yes,g' -i configure
-    oe_runconf
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/dialog/dialog_1.3-20160828.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/dialog/dialog_1.3-20160828.bb
new file mode 100644
index 0000000..bff3d97
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/dialog/dialog_1.3-20160828.bb
@@ -0,0 +1,29 @@
+SUMMARY = "display dialog boxes from shell scripts"
+DESCRIPTION = "Dialog lets you to present a variety of questions \
+or display messages using dialog boxes from a shell \
+script (or any scripting language)."
+HOMEPAGE = "http://invisible-island.net/dialog/"
+SECTION = "console/utils"
+DEPENDS = "ncurses"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+SRC_URI = "ftp://invisible-island.net/dialog/dialog-${PV}.tgz \
+          "
+SRC_URI[md5sum] = "a39ec183517bc1feaff017d067300b8c"
+SRC_URI[sha256sum] = "453095abaec288bfbc1ca9faced917e17742cff1ea45ec46210071ac153562f9"
+
+# hardcoded here for use in dialog-static recipe
+S = "${WORKDIR}/dialog-${PV}"
+
+inherit autotools-brokensep pkgconfig
+
+EXTRA_OECONF = "--with-ncurses \
+                --disable-rpath-hack"
+
+do_configure() {
+    gnu-configize --force
+    sed -i 's,${cf_ncuconfig_root}6-config,${cf_ncuconfig_root}-config,g' -i configure
+    sed -i 's,cf_have_ncuconfig=unknown,cf_have_ncuconfig=yes,g' -i configure
+    oe_runconf
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch
new file mode 100644
index 0000000..69b2f90
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch
@@ -0,0 +1,36 @@
+diff -uNr dlm-4.0.2.orig/dlm_controld/Makefile dlm-4.0.2/dlm_controld/Makefile
+--- dlm-4.0.2.orig/dlm_controld/Makefile	2017-04-04 10:49:23.661320260 +0200
++++ dlm-4.0.2/dlm_controld/Makefile	2017-04-04 10:50:36.121326429 +0200
+@@ -55,7 +55,7 @@
+ BIN_CFLAGS += -fPIE -DPIE
+ BIN_CFLAGS += -I../include -I../libdlm
+ 
+-BIN_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
++BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,now -Wl,-z,relro -pie
+ BIN_LDFLAGS += -lpthread -lrt -lcpg -lcmap -lcfg -lquorum
+ 
+ LIB_CFLAGS += $(BIN_CFLAGS)
+diff -uNr dlm-4.0.2.orig/dlm_tool/Makefile dlm-4.0.2/dlm_tool/Makefile
+--- dlm-4.0.2.orig/dlm_tool/Makefile	2013-07-31 17:50:26.000000000 +0200
++++ dlm-4.0.2/dlm_tool/Makefile	2017-04-04 10:50:44.617327153 +0200
+@@ -32,7 +32,7 @@
+ BIN_CFLAGS += -fPIE -DPIE
+ BIN_CFLAGS += -I../include -I../libdlm -I../dlm_controld
+ 
+-BIN_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
++BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,now -Wl,-z,relro -pie
+ BIN_LDFLAGS += -L../libdlm -L../dlm_controld
+ BIN_LDFLAGS += -lpthread -ldlm -ldlmcontrol
+ 
+diff -uNr dlm-4.0.2.orig/dlm_controld/Makefile dlm-4.0.2/dlm_controld/Makefile
+--- dlm-4.0.2.orig/dlm_controld/Makefile	2017-04-04 11:02:58.578389641 +0200
++++ dlm-4.0.2/dlm_controld/Makefile	2017-04-04 11:07:55.672414935 +0200
+@@ -59,7 +59,7 @@
+ BIN_LDFLAGS += -lpthread -lrt -lcpg -lcmap -lcfg -lquorum
+ 
+ LIB_CFLAGS += $(BIN_CFLAGS)
+-LIB_LDFLAGS += -Wl,-z,relro -pie
++LIB_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -pie
+ 
+ ifeq ($(USE_SD_NOTIFY),yes)
+ 	BIN_CFLAGS += $(shell pkg-config --cflags libsystemd-daemon) \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/dlm/dlm_4.0.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/dlm/dlm_4.0.2.bb
index ff37305..31e411e 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/dlm/dlm_4.0.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/dlm/dlm_4.0.2.bb
@@ -5,7 +5,9 @@
 
 REQUIRED_DISTRO_FEATURES = "systemd"
 
-SRC_URI = "https://git.fedorahosted.org/cgit/dlm.git/snapshot/${BP}.tar.xz"
+SRC_URI = "https://git.fedorahosted.org/cgit/dlm.git/snapshot/${BP}.tar.xz \
+    file://respect-ldflags-also-from-bin_ldflags.patch \
+"
 
 SRC_URI[md5sum] = "efc2ee6093aa6aa0a88aaad83e998a3f"
 SRC_URI[sha256sum] = "b89bc557aaffbab0ac005398025f247718a5589cff6574d902eaffe2b20e683e"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/efibootmgr/efibootmgr/0001-Remove-extra-const-keywords-gcc-7-gripes-about.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/efibootmgr/efibootmgr/0001-Remove-extra-const-keywords-gcc-7-gripes-about.patch
new file mode 100644
index 0000000..b6211c2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/efibootmgr/efibootmgr/0001-Remove-extra-const-keywords-gcc-7-gripes-about.patch
@@ -0,0 +1,49 @@
+From a9f8d414972b0b7c963d7efe38b5cfdcb6413c46 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Mon, 6 Feb 2017 16:34:54 -0500
+Subject: [PATCH] Remove extra const keywords gcc 7 gripes about.
+
+Signed-off-by: Peter Jones <pjones@redhat.com>
+---
+ src/efibootdump.c | 2 +-
+ src/efibootmgr.c  | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/efibootdump.c b/src/efibootdump.c
+index 3e448c2..5a9b681 100644
+--- a/src/efibootdump.c
++++ b/src/efibootdump.c
+@@ -36,7 +36,7 @@ print_boot_entry(efi_load_option *loadopt, size_t data_size)
+ 	uint8_t *optional_data = NULL;
+ 	size_t optional_data_len = 0;
+ 	uint16_t pathlen;
+-	const unsigned char const *desc;
++	const unsigned char *desc;
+ 	char *raw;
+ 	size_t raw_len;
+ 
+diff --git a/src/efibootmgr.c b/src/efibootmgr.c
+index baefa68..683623b 100644
+--- a/src/efibootmgr.c
++++ b/src/efibootmgr.c
+@@ -214,7 +214,7 @@ warn_duplicate_name(list_t *boot_list)
+ 	list_t *pos;
+ 	var_entry_t *boot;
+ 	efi_load_option *load_option;
+-	const unsigned char const *desc;
++	const unsigned char *desc;
+ 
+ 	list_for_each(pos, boot_list) {
+ 		boot = list_entry(pos, var_entry_t, list);
+@@ -821,7 +821,7 @@ show_boot_vars()
+ {
+ 	list_t *pos;
+ 	var_entry_t *boot;
+-	const unsigned char const *description;
++	const unsigned char *description;
+ 	efi_load_option *load_option;
+ 	efidp dp = NULL;
+ 	unsigned char *optional_data = NULL;
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/efibootmgr/efibootmgr_0.12.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/efibootmgr/efibootmgr_0.12.bb
index 0dee582..193150b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/efibootmgr/efibootmgr_0.12.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/efibootmgr/efibootmgr_0.12.bb
@@ -12,6 +12,7 @@
 
 SRCREV = "75d25807ba81cb724964c989012611272c8f1f5d"
 SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https \
+           file://0001-Remove-extra-const-keywords-gcc-7-gripes-about.patch \
           "
 
 S = "${WORKDIR}/git"
@@ -25,5 +26,3 @@
 do_install () {
     install -D -p -m0755 src/efibootmgr ${D}/${sbindir}/efibootmgr
 }
-
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/efivar/efivar/0001-Remove-some-extra-const-that-gcc-complains-about.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/efivar/efivar/0001-Remove-some-extra-const-that-gcc-complains-about.patch
new file mode 100644
index 0000000..4ae8cb9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/efivar/efivar/0001-Remove-some-extra-const-that-gcc-complains-about.patch
@@ -0,0 +1,44 @@
+From 29a2dea16113b5a8e51de46437c6a9f7426c5867 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Mon, 6 Feb 2017 14:28:19 -0500
+Subject: [PATCH 1/2] Remove some extra "const" that gcc complains about.
+
+One of these days I'll get these right.
+
+Signed-off-by: Peter Jones <pjones@redhat.com>
+---
+ src/include/efivar/efiboot-loadopt.h | 4 ++--
+ src/loadopt.c                        | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/include/efivar/efiboot-loadopt.h b/src/include/efivar/efiboot-loadopt.h
+index 07db5c4..efc29c6 100644
+--- a/src/include/efivar/efiboot-loadopt.h
++++ b/src/include/efivar/efiboot-loadopt.h
+@@ -32,8 +32,8 @@ extern ssize_t efi_loadopt_create(uint8_t *buf, ssize_t size,
+ 
+ extern efidp efi_loadopt_path(efi_load_option *opt, ssize_t limit)
+ 	__attribute__((__nonnull__ (1)));
+-extern const unsigned char const * efi_loadopt_desc(efi_load_option *opt,
+-						    ssize_t limit)
++extern const unsigned char * efi_loadopt_desc(efi_load_option *opt,
++					      ssize_t limit)
+ 	__attribute__((__visibility__ ("default")))
+ 	__attribute__((__nonnull__ (1)));
+ extern uint32_t efi_loadopt_attrs(efi_load_option *opt)
+diff --git a/src/loadopt.c b/src/loadopt.c
+index 64e333f..ec50722 100644
+--- a/src/loadopt.c
++++ b/src/loadopt.c
+@@ -336,7 +336,7 @@ teardown(void)
+ 
+ __attribute__((__nonnull__ (1)))
+ __attribute__((__visibility__ ("default")))
+-const unsigned char const *
++const unsigned char *
+ efi_loadopt_desc(efi_load_option *opt, ssize_t limit)
+ {
+ 	if (last_desc) {
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/efivar/efivar/0002-New-gcc-version-new-way-symbol-versioning-breaks.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/efivar/efivar/0002-New-gcc-version-new-way-symbol-versioning-breaks.patch
new file mode 100644
index 0000000..737b78b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/efivar/efivar/0002-New-gcc-version-new-way-symbol-versioning-breaks.patch
@@ -0,0 +1,66 @@
+From 31e655d2b5f66e772d9714422b7332bbaa60d2e6 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Mon, 6 Feb 2017 14:41:58 -0500
+Subject: [PATCH 2/2] New gcc version, new way symbol versioning breaks.
+
+Apparently I get to redo this every time there's a compiler release.
+Yaaaaaay.
+
+Anyway, the current method is to define the two compat things from the
+land before time as @libefivar.so.0 symbols and list them there in the
+link map.  Then we have the real one defined with another name, and set
+as efi_set_variable@@LIBEFIVAR_0.24.  Then to make there actually be a
+efi_set_variable symbol to link against, we create it as a weak alias.
+
+This is all completely absurd.
+
+Signed-off-by: Peter Jones <pjones@redhat.com>
+---
+ src/lib.c | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/src/lib.c b/src/lib.c
+index 6a9b392..afa7d94 100644
+--- a/src/lib.c
++++ b/src/lib.c
+@@ -49,7 +49,7 @@ _efi_set_variable(efi_guid_t guid, const char *name, uint8_t *data,
+ {
+ 	return ops->set_variable(guid, name, data, data_size, attributes, 0600);
+ }
+-__asm__(".symver _efi_set_variable,_efi_set_variable@");
++__asm__(".symver _efi_set_variable,_efi_set_variable@libefivar.so.0");
+ 
+ int
+ __attribute__((__nonnull__ (2, 3)))
+@@ -59,17 +59,24 @@ _efi_set_variable_variadic(efi_guid_t guid, const char *name, uint8_t *data,
+ {
+ 	return ops->set_variable(guid, name, data, data_size, attributes, 0600);
+ }
+-__asm__(".symver _efi_set_variable_variadic,efi_set_variable@");
++__asm__(".symver _efi_set_variable_variadic,efi_set_variable@libefivar.so.0");
+ 
+ int
+ __attribute__((__nonnull__ (2, 3)))
+ __attribute__((__visibility__ ("default")))
+-efi_set_variable(efi_guid_t guid, const char *name, uint8_t *data,
+-		 size_t data_size, uint32_t attributes, mode_t mode)
++_efi_set_variable_mode(efi_guid_t guid, const char *name, uint8_t *data,
++		       size_t data_size, uint32_t attributes, mode_t mode)
+ {
+ 	return ops->set_variable(guid, name, data, data_size, attributes, mode);
+ }
+-__asm__(".symver efi_set_variable,efi_set_variable@@LIBEFIVAR_0.24");
++__asm__(".symver _efi_set_variable_mode,efi_set_variable@@LIBEFIVAR_0.24");
++
++int
++__attribute__((__nonnull__ (2, 3)))
++__attribute__((__visibility__ ("default")))
++efi_set_variable(efi_guid_t guid, const char *name, uint8_t *data,
++		 size_t data_size, uint32_t attributes, mode_t mode)
++	__attribute((weak, alias ("_efi_set_variable_mode")));
+ 
+ int
+ __attribute__((__nonnull__ (2, 3)))
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/efivar/efivar_0.24.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/efivar/efivar_0.24.bb
index efffde5..877ca90 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/efivar/efivar_0.24.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/efivar/efivar_0.24.bb
@@ -8,18 +8,22 @@
 DEPENDS = "popt"
 DEPENDS_append_class-target = " efivar-native"
 
+inherit pkgconfig
+
 COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
 
 SRCREV = "963cb2e5adc145fe00717f94e382f2973f80e753"
 SRC_URI = "git://github.com/rhinstaller/efivar.git \
            file://0002-disable-static-build.patch \
+           file://allow-multi-definitions-for-native.patch \
+           file://0001-Remove-some-extra-const-that-gcc-complains-about.patch \
+           file://0002-New-gcc-version-new-way-symbol-versioning-breaks.patch \
 "
 SRC_URI_append_class-target = " file://0001-efivar-fix-for-cross-compile.patch \
                                 file://0003-efivar-fix-for-cross-compile.patch \
                                 ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'file://0004-fix-unknow-option-for-gold-linker.patch', '', d)} \
                               "
 SRC_URI_append_class-native = " file://fix-compile-failure-with-host-gcc-4.6.patch \
-                                file://allow-multi-definitions-for-native.patch \
                               "
 
 S = "${WORKDIR}/git"
@@ -40,4 +44,3 @@
 }
 
 BBCLASSEXTEND = "native"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-CMakeLists.txt-Add-AUTOCONF_HOST_OPT-to-help-cross-c.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-CMakeLists.txt-Add-AUTOCONF_HOST_OPT-to-help-cross-c.patch
new file mode 100644
index 0000000..539a42a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0001-CMakeLists.txt-Add-AUTOCONF_HOST_OPT-to-help-cross-c.patch
@@ -0,0 +1,52 @@
+From ceb47f37582a055bb7f253f813c435ad55c5b6eb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 10:02:50 -0700
+Subject: [PATCH 1/2] CMakeLists.txt: Add AUTOCONF_HOST_OPT to help cross
+ compiling
+
+This helps in doing cross compiles for modules which are using
+GNU autoconf for build system
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CMakeLists.txt | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b093f9a..ebf0cd7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -290,6 +290,12 @@ else()
+   endif()
+ endif()
+ 
++if("${GNU_HOST}" STREQUAL "")
++    set(AUTOCONF_HOST_OPT "")
++else()
++    set(AUTOCONF_HOST_OPT "--host=${GNU_HOST}")
++endif()
++
+ # Memory Allocator
+ # ================
+ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+@@ -299,7 +305,7 @@ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+   # Link to Jemalloc as an external dependency
+   ExternalProject_Add(jemalloc
+     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc
+-    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc/configure --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR>
++    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc/configure ${AUTOCONF_HOST_OPT} --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR>
+     CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
+     BUILD_COMMAND ${MAKE}
+     INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
+@@ -317,7 +323,7 @@ endif()
+ if(FLB_REGEX)
+   ExternalProject_Add(onigmo
+     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/onigmo
+-    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/onigmo/configure --with-pic --disable-shared --enable-static --prefix=<INSTALL_DIR>
++    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/onigmo/configure ${AUTOCONF_HOST_OPT} --with-pic --disable-shared --enable-static --prefix=<INSTALL_DIR>
+     CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
+     BUILD_COMMAND ${MAKE}
+     INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0002-msgpack-Add-comment-for-intended-fallthrough.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0002-msgpack-Add-comment-for-intended-fallthrough.patch
new file mode 100644
index 0000000..35cdb18
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0002-msgpack-Add-comment-for-intended-fallthrough.patch
@@ -0,0 +1,28 @@
+From d95c2977da074be0d3913e94fb8fb5ed1c64404a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 10:04:03 -0700
+Subject: [PATCH 2/2] msgpack: Add comment for intended fallthrough
+
+Helps fixing build with gcc7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/msgpack-c-0b7cabd/include/msgpack/unpack_template.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/msgpack-c-0b7cabd/include/msgpack/unpack_template.h b/lib/msgpack-c-0b7cabd/include/msgpack/unpack_template.h
+index a6dae6f..651e6c2 100644
+--- a/lib/msgpack-c-0b7cabd/include/msgpack/unpack_template.h
++++ b/lib/msgpack-c-0b7cabd/include/msgpack/unpack_template.h
+@@ -248,7 +248,7 @@ msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const c
+ 
+             _fixed_trail_again:
+                 ++p;
+-
++            // fallthrough
+             default:
+                 if((size_t)(pe - p) < trail) { goto _out; }
+                 n = p;  p += trail - 1;
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.11.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.11.3.bb
new file mode 100644
index 0000000..8d756e6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.11.3.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Fast data collector for Embedded Linux"
+HOMEPAGE = "http://fluentbit.io"
+BUGTRACKER = "https://github.com/fluent/fluent-bit/issues"
+
+SRC_URI = "http://fluentbit.io/releases/0.11/fluent-bit-${PV}.tar.gz \
+           file://0001-CMakeLists.txt-Add-AUTOCONF_HOST_OPT-to-help-cross-c.patch \
+           file://0002-msgpack-Add-comment-for-intended-fallthrough.patch \
+           "
+SRC_URI[md5sum] = "9383262339412782b80cc49e7ad15609"
+SRC_URI[sha256sum] = "eb8a85c656fa60682b0bf8dd1ad58d848cd251dab4f35a6777acd552c65b0511"
+
+S = "${WORKDIR}/fluent-bit-${PV}"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
+
+DEPENDS = "zlib"
+INSANE_SKIP_${PN}-dev += "dev-elf"
+
+inherit cmake systemd
+
+EXTRA_OECMAKE = "-DGNU_HOST=${HOST_SYS}"
+
+SYSTEMD_SERVICE_${PN} = "fluent-bit.service"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.7.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.7.2.bb
deleted file mode 100644
index c75f446..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit_0.7.2.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-SUMMARY = "Fast data collector for Embedded Linux"
-HOMEPAGE = "http://fluentbit.io"
-BUGTRACKER = "https://github.com/fluent/fluent-bit/issues"
-
-SRC_URI = "http://fluentbit.io/releases/0.7/fluent-bit-${PV}.tar.gz"
-SRC_URI[md5sum] = "6df9d676e1d2d782a243e655e144e8ae"
-SRC_URI[sha256sum] = "695b56ce378f56855c9554f88f5d8e4f7b11ba7691284903870f779912af4ebe"
-S = "${WORKDIR}/fluent-bit-${PV}"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
-
-DEPENDS = "zlib"
-INSANE_SKIP_${PN}-dev += "dev-elf"
-
-inherit cmake
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot.inc b/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot.inc
index 69bc74b..19ee874 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot.inc
@@ -15,9 +15,10 @@
 PACKAGECONFIG ??= "cairo"
 PACKAGECONFIG[cairo] = "--with-cairo,--without-cairo,cairo pango"
 PACKAGECONFIG[lua] = "--with-lua,--without-lua,lua"
+# there's compilation failure if qt4 is enabled
+PACKAGECONFIG[qt4] = "--with-qt,--without-qt,qt4-x11-free"
 
 EXTRA_OECONF = "--with-readline=${STAGING_LIBDIR}/.. \
-                --without-lisp-files \
                 --without-tutorial \
                 --disable-wxwidgets"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot-4.6.5/lua-loadlibs-configure-in-fix.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot/lua-loadlibs-configure-in-fix.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot-4.6.5/lua-loadlibs-configure-in-fix.patch
rename to import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot/lua-loadlibs-configure-in-fix.patch
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot-4.6.5/subdirs.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot/subdirs.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot-4.6.5/subdirs.patch
rename to import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot/subdirs.patch
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot_4.6.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot_4.6.5.bb
deleted file mode 100644
index 3f694a0..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot_4.6.5.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-require gnuplot.inc
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/gnuplot/${BP}.tar.gz;name=archive \
-    http://www.mneuroth.de/privat/zaurus/qtplot-0.2.tar.gz;name=qtplot \
-    file://subdirs.patch \
-    file://lua-loadlibs-configure-in-fix.patch \
-    file://gnuplot.desktop \
-    file://gnuplot.png \
-"
-
-SRC_URI[archive.md5sum] = "9a476b21f74bd99c876f1509d731a0f9"
-SRC_URI[archive.sha256sum] = "e550f030c7d04570e89c3d4e3f6e82296816508419c86ab46c4dd73156519a2d"
-SRC_URI[qtplot.md5sum] = "0a481885a496092c77eb4017540b5cf6"
-SRC_URI[qtplot.sha256sum] = "6df317183ff62cc82f3dcf88207a267cd6478cb5147f55d7530c94f1ad5f4132"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot_5.0.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot_5.0.5.bb
new file mode 100644
index 0000000..42308ba
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/gnuplot/gnuplot_5.0.5.bb
@@ -0,0 +1,14 @@
+require gnuplot.inc
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/gnuplot/${BP}.tar.gz;name=archive \
+    http://www.mneuroth.de/privat/zaurus/qtplot-0.2.tar.gz;name=qtplot \
+    file://subdirs.patch \
+    file://lua-loadlibs-configure-in-fix.patch \
+    file://gnuplot.desktop \
+    file://gnuplot.png \
+"
+
+SRC_URI[archive.md5sum] = "c5e96fca73afbee4f57cbc1bfce6b3b8"
+SRC_URI[archive.sha256sum] = "25f3e0bf192e01115c580f278c3725d7a569eb848786e12b455a3fda70312053"
+SRC_URI[qtplot.md5sum] = "0a481885a496092c77eb4017540b5cf6"
+SRC_URI[qtplot.sha256sum] = "6df317183ff62cc82f3dcf88207a267cd6478cb5147f55d7530c94f1ad5f4132"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/konkretcmpi/konkretcmpi/0001-to-fix-lib64-can-not-be-shiped-in-64bit-target.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/konkretcmpi/konkretcmpi/0001-to-fix-lib64-can-not-be-shiped-in-64bit-target.patch
deleted file mode 100644
index 7da13ee..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/konkretcmpi/konkretcmpi/0001-to-fix-lib64-can-not-be-shiped-in-64bit-target.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From f3c39fd2a4b5f53338b5f821788c63858bf860cf Mon Sep 17 00:00:00 2001
-From: Lei Maohui <leimaohui@cn.fujitsu.com>
-Date: Sun, 2 Aug 2015 22:08:43 +0900
-Subject: [PATCH] to fix lib64 can not be shiped in 64bit target
-
-To fix the warning as following:
-WARNING: QA Issue: konkretcmpi: Files/directories were installed but not shipped in any package:
-  /usr/lib64
-  /usr/lib64/libkonkret.so
-  /usr/lib64/libkonkret.so.0.0.1
-  /usr/lib64/libkonkret.so.0
-  /usr/lib64/libkonkretmof.so.0.0.1
-  /usr/lib64/libkonkretmof.so
-  ...
-
-Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
----
- cmake/modules/FindKonkretCMPI.cmake | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/cmake/modules/FindKonkretCMPI.cmake b/cmake/modules/FindKonkretCMPI.cmake
-index b888cfd..097caed 100644
---- a/cmake/modules/FindKonkretCMPI.cmake
-+++ b/cmake/modules/FindKonkretCMPI.cmake
-@@ -9,7 +9,7 @@ find_path(KONKRETCMPI_INCLUDE_DIR
- find_library(KONKRETCMPI_LIBRARY
-     NAMES konkret
-     HINTS $ENV{KONKRETCMPI_LIB_DIR}
--    PATH_SUFFIXES lib64 lib
-+    PATH_SUFFIXES lib lib64
-     PATHS /usr /usr/local
- )
- 
--- 
-1.8.4.2
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc/0001-include-asm-ioctl.h-explicitly.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc/0001-include-asm-ioctl.h-explicitly.patch
new file mode 100644
index 0000000..abdedad
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc/0001-include-asm-ioctl.h-explicitly.patch
@@ -0,0 +1,43 @@
+From b5ca64c7398d516e9845d849e8306df7ac024bc4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 11 Apr 2017 13:59:34 -0700
+Subject: [PATCH] include asm/ioctl.h explicitly
+
+Needed for _IOC* defines
+
+helps compiling with musl where this file is
+not included indirectly
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ server/drivers/hd44780-pifacecad.c | 1 +
+ server/drivers/hd44780-spi.c       | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/server/drivers/hd44780-pifacecad.c b/server/drivers/hd44780-pifacecad.c
+index 43db19c..e2798ad 100644
+--- a/server/drivers/hd44780-pifacecad.c
++++ b/server/drivers/hd44780-pifacecad.c
+@@ -54,6 +54,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
++#include <asm/ioctl.h>
+ #include <stdint.h>
+ #include <linux/spi/spidev.h>
+ 
+diff --git a/server/drivers/hd44780-spi.c b/server/drivers/hd44780-spi.c
+index 5f94333..8a4015b 100644
+--- a/server/drivers/hd44780-spi.c
++++ b/server/drivers/hd44780-spi.c
+@@ -29,6 +29,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
++#include <asm/ioctl.h>
+ #include <stdint.h>
+ #include <linux/spi/spidev.h>
+ 
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc5.inc b/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc5.inc
deleted file mode 100644
index 680f558..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc5.inc
+++ /dev/null
@@ -1,81 +0,0 @@
-DESCRIPTION = "LCDproc is a client/server suite to drive all kinds of LCD (-like) devices. The client \
-shipped with this package can be used to acquire various kinds of system stats."
-SUMMARY = "Drivers for character-based LCD displays"
-HOMEPAGE = "http://lcdproc.org"
-SECTION = "utils"
-LICENSE = "GPLv2+"
-DEPENDS = "ncurses lirc"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760 \
-                    file://README;beginline=60;md5=637e042cdd3671ba00e78b58ede45d3b"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/lcdproc/${BP}.tar.gz"
-
-inherit autotools update-rc.d
-
-LCD_DRIVERS ?= "all"
-LCD_DEFAULT_DRIVER ?= "curses"
-
-PACKAGECONFIG ??= "usb"
-PACKAGECONFIG[usb] = "--enable-libusb,--disable-libusb,virtual/libusb0"
-PACKAGECONFIG[ftdi] = "--enable-libftdi,--disable-libftdi,libftdi"
-
-EXTRA_OECONF = "--enable-drivers=${LCD_DRIVERS}"
-
-do_install () {
-    # binaries
-    install -D -m 0755 server/LCDd ${D}${sbindir}/LCDd
-    install -D -m 0755 clients/lcdproc/lcdproc ${D}${bindir}/lcdproc
-
-    # init scripts
-    install -d ${D}${sysconfdir}/init.d
-    # so far, not fixed :-( and now even uglier :-((
-    cat scripts/init-LCDd.debian | sed -e s'/--oknodo//' -e 's/ -s -f / -s 1 -f 1 /' -e 's/force-reload/force-restart/' -e 's/sleep 1/sleep 4/' > ${D}${sysconfdir}/init.d/lcdd
-    chmod 0755 ${D}${sysconfdir}/init.d/lcdd
-    install -m 0755 scripts/init-lcdproc.debian ${D}${sysconfdir}/init.d/lcdproc
-    sed -i s'/--oknodo//' ${D}${sysconfdir}/init.d/lcdproc
-
-    # configuration files
-    install -m 0644 ${S}/LCDd.conf ${D}${sysconfdir}/LCDd.conf
-    sed -i 's!^DriverPath=.*!DriverPath=${libdir}/lcdproc/!' ${D}${sysconfdir}/LCDd.conf
-    sed -i 's!^Driver=.*!Driver=${LCD_DEFAULT_DRIVER}!' ${D}${sysconfdir}/LCDd.conf
-    install -m 0644 ${S}/clients/lcdproc/lcdproc.conf ${D}${sysconfdir}/lcdproc.conf
-
-    # driver library files
-    install -d ${D}${libdir}/lcdproc
-    for i in server/drivers/*.so; do
-        install -m 0644 $i ${D}${libdir}/lcdproc/
-    done
-}
-
-PACKAGES =+ "lcdd"
-
-RRECOMMENDS_${PN} = "lcdd"
-
-FILES_lcdd = "${sysconfdir}/LCDd.conf \
-    ${sbindir}/LCDd \
-    ${sysconfdir}/init.d/lcdd"
-
-CONFFILES_lcdd = "${sysconfdir}/LCDd.conf"
-CONFFILES_${PN} = "${sysconfdir}/lcdproc.conf"
-
-# Driver packages
-
-# USB / no USB trickery
-
-RCONFLICTS_lcdd-driver-hd47780nousb = "lcdd-driver-hd44780"
-RCONFLICTS_lcdd-driver-hd47780 = "lcdd-driver-hd44780nousb"
-
-INITSCRIPT_PACKAGES = "lcdd lcdproc"
-INITSCRIPT_NAME_lcdd = "lcdd"
-INITSCRIPT_NAME_lcdproc = "lcdproc"
-INITSCRIPT_PARAMS_lcdd = "defaults 70 21"
-INITSCRIPT_PARAMS_lcdproc = "defaults 71 20"
-
-python populate_packages_prepend() {
-    plugindir = d.expand('${libdir}/lcdproc')
-    do_split_packages(d, plugindir, '(.*)\.so$', 'lcdd-driver-%s', 'LCDd driver for %s', prepend=True)
-}
-
-PACKAGES_DYNAMIC += "^lcdd-driver-.*"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc_0.5.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc_0.5.6.bb
deleted file mode 100644
index f57e9df..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc_0.5.6.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-require lcdproc5.inc
-
-SRC_URI[md5sum] = "df4f5c2c7285eaf6979b9c7768b4877f"
-SRC_URI[sha256sum] = "bd2f43c30ff43b30f43110abe6b4a5bc8e0267cb9f57fa97cc5e5ef9488b984a"
-
-PACKAGECONFIG ?= ""
-PACKAGECONFIG[g15] = ",,libg15 g15daemon libg15render,"
-PACKAGECONFIG[hid] = "--enable-libhid,--disable-libhid,libhid"
-
-LCD_DRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'g15', '', ',!g15', d)}"
-
-do_install_append () {
-    # binaries
-    install -D -m 0755 clients/lcdvc/lcdvc ${D}${sbindir}/lcdvc
-
-    # configuration files
-    install -D -m 0644 ${S}/clients/lcdvc/lcdvc.conf ${D}${sysconfdir}/lcdvc.conf
-}
-
-PACKAGES =+ "lcdvc"
-CONFFILES_lcdvc = "${sysconfdir}/lcdvc.conf"
-FILES_lcdvc = "${sysconfdir}/lcdvc.conf ${sbindir}/lcdvc"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc_git.bb
new file mode 100644
index 0000000..96bc826
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/lcdproc/lcdproc_git.bb
@@ -0,0 +1,99 @@
+DESCRIPTION = "LCDproc is a client/server suite to drive all kinds of LCD (-like) devices. The client \
+shipped with this package can be used to acquire various kinds of system stats."
+SUMMARY = "Drivers for character-based LCD displays"
+HOMEPAGE = "http://lcdproc.org"
+SECTION = "utils"
+LICENSE = "GPLv2+"
+DEPENDS = "ncurses lirc"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760 \
+                    file://README.md;beginline=107;md5=5c927ce1742d6d5cddc45b7ad6230f75"
+
+BASEPV = "0.5.8"
+PV = "${BASEPV}+git${SRCPV}"
+SRCREV = "f5156e2e41bb418f14761afea22eee8efb49fb85"
+SRC_URI = "git://github.com/lcdproc/lcdproc;branch=lcdproc-${BASEPV} \
+           file://0001-include-asm-ioctl.h-explicitly.patch \
+           "
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig update-rc.d
+
+LCD_DRIVERS ?= "all,!irman,!svga"
+LCD_DEFAULT_DRIVER ?= "curses"
+
+PACKAGECONFIG ??= "usb"
+PACKAGECONFIG[usb] = "--enable-libusb,--disable-libusb,virtual/libusb0"
+PACKAGECONFIG[ftdi] = "--enable-libftdi,--disable-libftdi,libftdi"
+PACKAGECONFIG[g15] = ",,libg15 g15daemon libg15render,"
+PACKAGECONFIG[hid] = "--enable-libhid,--disable-libhid,libhid"
+PACKAGECONFIG[png] = "--enable-libpng,--disable-libpng,libpng"
+
+LCD_DRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'g15', '', ',!g15', d)}"
+
+EXTRA_OECONF = "--enable-drivers='${LCD_DRIVERS}'"
+
+do_install () {
+    # binaries
+    install -D -m 0755 server/LCDd ${D}${sbindir}/LCDd
+    install -D -m 0755 clients/lcdproc/lcdproc ${D}${bindir}/lcdproc
+
+    # init scripts
+    install -d ${D}${sysconfdir}/init.d
+    # so far, not fixed :-( and now even uglier :-((
+    cat scripts/init-LCDd.debian | sed -e s'/--oknodo//' -e 's/ -s -f / -s 1 -f 1 /' -e 's/force-reload/force-restart/' -e 's/sleep 1/sleep 4/' > ${D}${sysconfdir}/init.d/lcdd
+    chmod 0755 ${D}${sysconfdir}/init.d/lcdd
+    install -m 0755 scripts/init-lcdproc.debian ${D}${sysconfdir}/init.d/lcdproc
+    sed -i s'/--oknodo//' ${D}${sysconfdir}/init.d/lcdproc
+
+    # configuration files
+    install -m 0644 ${S}/LCDd.conf ${D}${sysconfdir}/LCDd.conf
+    sed -i 's!^DriverPath=.*!DriverPath=${libdir}/lcdproc/!' ${D}${sysconfdir}/LCDd.conf
+    sed -i 's!^Driver=.*!Driver=${LCD_DEFAULT_DRIVER}!' ${D}${sysconfdir}/LCDd.conf
+    install -m 0644 ${S}/clients/lcdproc/lcdproc.conf ${D}${sysconfdir}/lcdproc.conf
+
+    # driver library files
+    install -d ${D}${libdir}/lcdproc
+    for i in server/drivers/*.so; do
+        install -m 0644 $i ${D}${libdir}/lcdproc/
+    done
+    # binaries
+    install -D -m 0755 clients/lcdvc/lcdvc ${D}${sbindir}/lcdvc
+
+    # configuration files
+    install -D -m 0644 ${S}/clients/lcdvc/lcdvc.conf ${D}${sysconfdir}/lcdvc.conf
+}
+
+PACKAGES =+ "lcdd lcdvc"
+
+RRECOMMENDS_${PN} = "lcdd"
+
+FILES_lcdd = "${sysconfdir}/LCDd.conf \
+    ${sbindir}/LCDd \
+    ${sysconfdir}/init.d/lcdd"
+
+CONFFILES_lcdd = "${sysconfdir}/LCDd.conf"
+CONFFILES_${PN} = "${sysconfdir}/lcdproc.conf"
+CONFFILES_lcdvc = "${sysconfdir}/lcdvc.conf"
+FILES_lcdvc = "${sysconfdir}/lcdvc.conf ${sbindir}/lcdvc"
+
+# Driver packages
+
+# USB / no USB trickery
+
+RCONFLICTS_lcdd-driver-hd47780nousb = "lcdd-driver-hd44780"
+RCONFLICTS_lcdd-driver-hd47780 = "lcdd-driver-hd44780nousb"
+
+INITSCRIPT_PACKAGES = "lcdd lcdproc"
+INITSCRIPT_NAME_lcdd = "lcdd"
+INITSCRIPT_NAME_lcdproc = "lcdproc"
+INITSCRIPT_PARAMS_lcdd = "defaults 70 21"
+INITSCRIPT_PARAMS_lcdproc = "defaults 71 20"
+
+python populate_packages_prepend() {
+    plugindir = d.expand('${libdir}/lcdproc')
+    do_split_packages(d, plugindir, '(.*)\.so$', 'lcdd-driver-%s', 'LCDd driver for %s', prepend=True)
+}
+
+PACKAGES_DYNAMIC += "^lcdd-driver-.*"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libcec/files/python-install-location.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/libcec/files/python-install-location.patch
new file mode 100644
index 0000000..b6be78dd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libcec/files/python-install-location.patch
@@ -0,0 +1,28 @@
+From 330fa6777d51d41eefacff8e98e4250d210fde35 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Javi=20Mart=C3=ADnez?= <javi@flamingalah.net>
+Date: Tue, 13 Dec 2016 22:31:13 +0100
+Subject: [PATCH] Improve/fix installation of Python bindings
+
+Upstream-Status: Backport
+
+dist-packages is a Debian-specific directory for distribution packages (and used in derivatives such as Ubuntu). Therefore changed to site-packages.
+---
+ src/libcec/cmake/CheckPlatformSupport.cmake | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake
+index fcd0ef7..7661107 100644
+--- a/src/libcec/cmake/CheckPlatformSupport.cmake
++++ b/src/libcec/cmake/CheckPlatformSupport.cmake
+@@ -195,9 +195,9 @@ else()
+               RENAME      __init__.py)
+     else()
+       install(TARGETS     ${SWIG_MODULE_cec_REAL_NAME}
+-              DESTINATION lib/python${PYTHON_VERSION}/dist-packages/cec)
++              DESTINATION lib/python${PYTHON_VERSION}/site-packages/cec)
+       install(FILES       ${CMAKE_BINARY_DIR}/src/libcec/cec.py
+-              DESTINATION lib/python${PYTHON_VERSION}/dist-packages/cec
++              DESTINATION lib/python${PYTHON_VERSION}/site-packages/cec
+               RENAME      __init__.py)
+     endif()
+   endif()
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libcec/libcec_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/libcec/libcec_git.bb
index 0f2a64e..cb65caa 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/libcec/libcec_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libcec/libcec_git.bb
@@ -2,18 +2,26 @@
 HOMEPAGE = "http://libcec.pulse-eight.com/"
 
 LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5e8e16396992369f73f3d28875f846da"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e61fd86f9c947b430126181da2c6c715"
 
-DEPENDS = "udev lockdev"
+DEPENDS = "p8platform udev lockdev ncurses swig-native python3"
 
-PV = "2.1.4"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libx11 libxrandr', '', d)}"
+DEPENDS_append_rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' userland', d)}"
 
-SRCREV = "81e38211724bc6e8bd7a60f484433053ed682635"
-SRC_URI = "git://github.com/Pulse-Eight/libcec.git;branch=release"
+PV = "4.0.1+gitr${SRCPV}"
+
+SRCREV = "2fc92b5f02dca702da92ccc5ed7b805b240ef5df"
+SRC_URI = "git://github.com/Pulse-Eight/libcec.git \
+           file://python-install-location.patch"
 
 S = "${WORKDIR}/git"
 
-inherit autotools pkgconfig
+inherit cmake pkgconfig
+
+# Create the wrapper for python3
+PACKAGES += "python3-${BPN}"
+FILES_python3-${BPN} = "${libdir}/python3*"
 
 # cec-client and xbmc need the .so present to work :(
 FILES_${PN} += "${libdir}/*.so"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libexecinfo/libexecinfo/0001-makefile-Fix-build-on-linux.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/libexecinfo/libexecinfo/0001-makefile-Fix-build-on-linux.patch
new file mode 100644
index 0000000..f1863f1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libexecinfo/libexecinfo/0001-makefile-Fix-build-on-linux.patch
@@ -0,0 +1,59 @@
+From 910bbc2cb6cc1cfa6deed9d170da02a639902c7c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 19 Mar 2017 16:14:54 -0700
+Subject: [PATCH 1/2] makefile: Fix build on linux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 33 +++++++++++++++++----------------
+ 1 file changed, 17 insertions(+), 16 deletions(-)
+
+Index: libexecinfo-1.1/Makefile
+===================================================================
+--- libexecinfo-1.1.orig/Makefile
++++ libexecinfo-1.1/Makefile
+@@ -23,24 +23,25 @@
+ # SUCH DAMAGE.
+ #
+ # $Id: Makefile,v 1.3 2004/07/19 05:19:55 sobomax Exp $
++#
++# Linux Makefile by Matt Smith <mcs@darkregion.net>, 2011/01/04
+ 
+-LIB=	execinfo
+-
+-SRCS=	stacktraverse.c stacktraverse.h execinfo.c execinfo.h
+-
+-INCS=	execinfo.h
+-
+-SHLIB_MAJOR=	1
+-SHLIB_MINOR=	0
+-
+-NOPROFILE=	yes
+-
+-DPADD=		${LIBM}
+-LDADD=		-lm
+-
+-#WARNS?=	4
+-
+-#stacktraverse.c: gen.py
+-#	./gen.py > stacktraverse.c
++CC?=cc
++AR?=ar
++EXECINFO_CFLAGS=$(CFLAGS) -O2 -pipe -fno-strict-aliasing -std=gnu99 -fstack-protector -c
++EXECINFO_LDFLAGS=$(LDFLAGS)
++
++all: static dynamic
++
++static:
++	$(CC) $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) stacktraverse.c
++	$(CC) $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) execinfo.c
++	$(AR) rcs libexecinfo.a stacktraverse.o execinfo.o
++
++dynamic:
++	$(CC) -fpic -DPIC $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) stacktraverse.c -o stacktraverse.So
++	$(CC) -fpic -DPIC $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) execinfo.c -o execinfo.So
++	$(CC) -shared -Wl,-soname,libexecinfo.so.1 -o libexecinfo.so.1 $(EXECINFO_LDFLAGS) stacktraverse.So execinfo.So
+ 
+-.include <bsd.lib.mk>
++clean:
++	rm -rf *.o *.So *.a *.so
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libexecinfo/libexecinfo/0002-execinfo-Fix-compiler-errors-found-with-newer-gcc-cl.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/libexecinfo/libexecinfo/0002-execinfo-Fix-compiler-errors-found-with-newer-gcc-cl.patch
new file mode 100644
index 0000000..423b670
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libexecinfo/libexecinfo/0002-execinfo-Fix-compiler-errors-found-with-newer-gcc-cl.patch
@@ -0,0 +1,79 @@
+From 0810817773fb81d7383d2fa8464244c8f79845fb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 19 Mar 2017 16:16:18 -0700
+Subject: [PATCH 2/2] execinfo: Fix compiler errors found with newer gcc/clang
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ execinfo.c | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/execinfo.c b/execinfo.c
+index 906fb14..9448b60 100644
+--- a/execinfo.c
++++ b/execinfo.c
+@@ -69,7 +69,8 @@ backtrace(void **buffer, int size)
+ char **
+ backtrace_symbols(void *const *buffer, int size)
+ {
+-    int i, clen, alen, offset;
++    size_t clen, alen;
++    int i, offset;
+     char **rval;
+     char *cp;
+     Dl_info info;
+@@ -78,7 +79,6 @@ backtrace_symbols(void *const *buffer, int size)
+     rval = malloc(clen);
+     if (rval == NULL)
+         return NULL;
+-    (char **)cp = &(rval[size]);
+     for (i = 0; i < size; i++) {
+         if (dladdr(buffer[i], &info) != 0) {
+             if (info.dli_sname == NULL)
+@@ -92,14 +92,14 @@ backtrace_symbols(void *const *buffer, int size)
+                    2 +                      /* " <" */
+                    strlen(info.dli_sname) + /* "function" */
+                    1 +                      /* "+" */
+-                   D10(offset) +            /* "offset */
++                   10 +                     /* "offset */
+                    5 +                      /* "> at " */
+                    strlen(info.dli_fname) + /* "filename" */
+                    1;                       /* "\0" */
+             rval = realloc_safe(rval, clen + alen);
+             if (rval == NULL)
+                 return NULL;
+-            snprintf(cp, alen, "%p <%s+%d> at %s",
++            snprintf((char *) rval + clen, alen, "%p <%s+%d> at %s",
+               buffer[i], info.dli_sname, offset, info.dli_fname);
+         } else {
+             alen = 2 +                      /* "0x" */
+@@ -108,12 +108,15 @@ backtrace_symbols(void *const *buffer, int size)
+             rval = realloc_safe(rval, clen + alen);
+             if (rval == NULL)
+                 return NULL;
+-            snprintf(cp, alen, "%p", buffer[i]);
++            snprintf((char *) rval + clen, alen, "%p", buffer[i]);
+         }
+-        rval[i] = cp;
+-        cp += alen;
++        rval[i] = (char *) clen;
++        clen += alen;
+     }
+ 
++    for (i = 0; i < size; i++)
++        rval[i] += (long) rval;
++
+     return rval;
+ }
+ 
+@@ -155,6 +158,6 @@ backtrace_symbols_fd(void *const *buffer, int size, int fd)
+                 return;
+             snprintf(buf, len, "%p\n", buffer[i]);
+         }
+-        write(fd, buf, len - 1);
++        write(fd, buf, strlen(buf));
+     }
+ }
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libexecinfo/libexecinfo_1.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/libexecinfo/libexecinfo_1.1.bb
new file mode 100644
index 0000000..13a38ab
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libexecinfo/libexecinfo_1.1.bb
@@ -0,0 +1,32 @@
+# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "A quick-n-dirty BSD licensed clone of the GNU libc backtrace facility."
+HOMEPAGE = "http://www.freshports.org/devel/libexecinfo"
+LIC_FILES_CHKSUM = "file://execinfo.c;endline=25;md5=85bd3fa4ea9acae5182e29db063fe2e5"
+LICENSE = "BSD-2-Clause"
+SECTION = "libs"
+DEPENDS = ""
+
+SRC_URI = "http://distcache.freebsd.org/local-distfiles/itetcu/${BP}.tar.bz2 \
+           file://0001-makefile-Fix-build-on-linux.patch \
+           file://0002-execinfo-Fix-compiler-errors-found-with-newer-gcc-cl.patch \
+           "
+SRC_URI[md5sum] = "8e9e81c554c1c5d735bc877448e92b91"
+SRC_URI[sha256sum] = "c9a21913e7fdac8ef6b33250b167aa1fc0a7b8a175145e26913a4c19d8a59b1f"
+
+CFLAGS += "-fno-omit-frame-pointer"
+CFLAGS += " -D_GNU_SOURCE"
+
+do_install() {
+    install -D -m 0744 ${S}/execinfo.h ${D}${includedir}/execinfo.h
+    install -D -m 0744 ${S}/stacktraverse.h ${D}${includedir}/stacktraverse.h
+    install -D -m 0744 ${B}/libexecinfo.a ${D}${libdir}/libexecinfo.a
+    install -D -m 0755 ${B}/libexecinfo.so.1 ${D}${libdir}/libexecinfo.so.1
+    ln -s libexecinfo.so.1 ${D}${libdir}/libexecinfo.so
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim/0001-Use-AM_CPPFLAGS-instead-of-INCLUDES.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim/0001-Use-AM_CPPFLAGS-instead-of-INCLUDES.patch
new file mode 100644
index 0000000..41e07f3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim/0001-Use-AM_CPPFLAGS-instead-of-INCLUDES.patch
@@ -0,0 +1,53 @@
+From d2ccba90186e2affbb3d146ada341ea2ae6fab2c Mon Sep 17 00:00:00 2001
+From: Akira TAGOH <akira@tagoh.org>
+Date: Mon, 13 May 2013 16:05:32 +0900
+Subject: [PATCH 1/3] Use AM_CPPFLAGS instead of INCLUDES
+
+---
+ docs/reference/Makefile.am | 2 +-
+ libgxim/Makefile.am        | 2 +-
+ tests/Makefile.am          | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
+index 24986e1..f785735 100644
+--- a/docs/reference/Makefile.am
++++ b/docs/reference/Makefile.am
+@@ -84,7 +84,7 @@ expand_content_files=
+ # signals and properties.
+ # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
+ # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
+-INCLUDES=					\
++AM_CPPFLAGS=					\
+ 	$(GXIM_CFLAGS)				\
+ 	-I$(top_srcdir)				\
+ 	$(NULL)
+diff --git a/libgxim/Makefile.am b/libgxim/Makefile.am
+index 572bdb5..ae1ba32 100644
+--- a/libgxim/Makefile.am
++++ b/libgxim/Makefile.am
+@@ -1,7 +1,7 @@
+ ##
+ # Global definitions
+ NULL =
+-INCLUDES =							\
++AM_CPPFLAGS =							\
+ 	$(GXIM_CFLAGS)						\
+ 	-I$(top_srcdir)						\
+ 	$(NULL)
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 2926829..919ccc8 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -1,7 +1,7 @@
+ ##
+ # Global definitions
+ NULL =
+-INCLUDES =					\
++AM_CPPFLAGS =					\
+ 	-I$(top_srcdir)/libgxim			\
+ 	-I$(top_srcdir)				\
+ 	$(GXIM_CFLAGS)				\
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim/0002-Update-autotools-macro.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim/0002-Update-autotools-macro.patch
new file mode 100644
index 0000000..808203b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim/0002-Update-autotools-macro.patch
@@ -0,0 +1,31 @@
+From 3215783732b147723e3613cc3c3f83cdcf2ae832 Mon Sep 17 00:00:00 2001
+From: Akira TAGOH <akira@tagoh.org>
+Date: Wed, 22 Jan 2014 18:59:32 +0900
+Subject: [PATCH 2/3] Update autotools macro
+
+---
+ configure.ac | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d559491..8b846a6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -11,10 +11,12 @@ dnl V=0 to make.
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+ 
+ AM_MAINTAINER_MODE
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+ AC_CONFIG_MACRO_DIR([m4macros])
+ 
+-AC_PROG_LIBTOOL
++LT_PREREQ([2.2])
++LT_INIT([disable-static])
++
+ AC_PROG_INTLTOOL
+ 
+ AC_PROG_CC
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim/0003-Add-format-string-qualifier-to-fix-potential-securit.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim/0003-Add-format-string-qualifier-to-fix-potential-securit.patch
new file mode 100644
index 0000000..cb21e1e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim/0003-Add-format-string-qualifier-to-fix-potential-securit.patch
@@ -0,0 +1,30 @@
+From d05d7fa24ee128f1f33a2e905fc3601955dd27d4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 18:06:02 -0700
+Subject: [PATCH 3/3] Add format string qualifier to fix potential security
+ risk
+
+Fixes
+libgxim/gximprotocol10.c:2076:66: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libgxim/gximprotocol10.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libgxim/gximprotocol10.c b/libgxim/gximprotocol10.c
+index 04887a5..65bd4df 100644
+--- a/libgxim/gximprotocol10.c
++++ b/libgxim/gximprotocol10.c
+@@ -2073,7 +2073,7 @@ g_xim_protocol10_closure_real_parser_error(GXimProtocol *proto,
+ 	msg = g_strdup_printf("Unable to parse the protocol %s properly",
+ 			      g_xim_protocol_name(major_opcode));
+ 
+-	g_xim_messages_error(G_XIM_PROTOCOL_GET_IFACE (proto)->message, msg);
++	g_xim_messages_error(G_XIM_PROTOCOL_GET_IFACE (proto)->message, "%s", msg);
+ 	switch (major_opcode) {
+ 	    case G_XIM_CONNECT:
+ 	    case G_XIM_AUTH_REQUIRED:
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim_0.5.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim_0.5.0.bb
index 772babf..5bf7c6e 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim_0.5.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libgxim/libgxim_0.5.0.bb
@@ -10,7 +10,11 @@
 SECTION = "System Environment/Libraries"
 
 SRC_URI = "https://bitbucket.org/tagoh/libgxim/downloads/${BPN}-${PV}.tar.bz2 \
-           file://multi-line-ACLOCAL_AMFLAGS-isnot-supported-by-autoreconf.patch"
+           file://multi-line-ACLOCAL_AMFLAGS-isnot-supported-by-autoreconf.patch \
+           file://0001-Use-AM_CPPFLAGS-instead-of-INCLUDES.patch \
+           file://0002-Update-autotools-macro.patch \
+           file://0003-Add-format-string-qualifier-to-fix-potential-securit.patch \
+           "
 
 SRC_URI[md5sum] = "4bb1fa63d00eb224439d413591c29a6a"
 SRC_URI[sha256sum] = "75e20d1744139644f9951b78ea3910b162d3380302315cb4b3d0640f23694c79"
@@ -19,7 +23,7 @@
 LIC_FILES_CHKSUM = "\
 file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
-EXTRA_OECONF = " --disable-static --disable-rebuilds"
-DEPENDS += "gtk+ glib-2.0 ruby-native intltool-native"
+EXTRA_OECONF = " --disable-static --disable-rebuilds --enable-compile-warnings=minimum"
+DEPENDS += "gtk+ glib-2.0 glib-2.0-native ruby-native intltool-native gnome-common-native"
 
 inherit autotools pkgconfig gettext
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/liblockfile/liblockfile-1.09/glibc-2.4.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/liblockfile/liblockfile-1.09/glibc-2.4.patch
deleted file mode 100644
index e3c4aaa..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/liblockfile/liblockfile-1.09/glibc-2.4.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-The local function eaccess conflicts with a glibc function of the same name.
-Rename the function so that this can be build under glibc 2.4, and older
-revisions, without any problems.
-
---- liblockfile-1.06/dotlockfile.c	2006/07/10 03:17:40	1.1
-+++ liblockfile-1.06/dotlockfile.c	2006/07/10 03:18:26
-@@ -42,7 +42,7 @@
- extern int optind;
- #endif
- 
--extern int eaccess(char *, gid_t, struct stat *);
-+extern int xeaccess(char *, gid_t, struct stat *);
- 
- /*
-  *	Sleep for an amout of time while regulary checking if
-@@ -252,14 +252,14 @@
- 		return L_ERROR;
- 	}
- 	gid = getgid();
--	if (eaccess(dir, gid, &st) < 0) {
-+	if (xeaccess(dir, gid, &st) < 0) {
- 		if (errno == ENOENT) {
- enoent:
- 			if (!quiet) fprintf(stderr,
- 				"dotlockfile: %s: no such directory\n", dir);
- 			return L_TMPLOCK;
- 		}
--		if ((r = eaccess(dir, getegid(), &st) < 0) && errno == ENOENT)
-+		if ((r = xeaccess(dir, getegid(), &st) < 0) && errno == ENOENT)
- 			goto enoent;
- 		if (r < 0 || !ismaillock(lockfile, pwd->pw_name)) {
- 			if (!quiet) fprintf(stderr,
-@@ -272,7 +272,7 @@
- 	/*
- 	 *	Now we should be able to chdir() to the lock directory.
- 	 *	When we stat("."), it should be the same as at the
--	 *	eaccess() check or someone played symlink() games on us.
-+	 *	xeaccess() check or someone played symlink() games on us.
- 	 */
- 	if (chdir(dir) < 0 || stat(".", &st2) < 0) {
- 		if (!quiet) fprintf(stderr,
---- liblockfile-1.06/lockfile.c	2006/07/10 03:17:40	1.1
-+++ liblockfile-1.06/lockfile.c	2006/07/10 03:18:26
-@@ -54,7 +54,7 @@
- #ifdef LIB
- static
- #endif
--int eaccess(char *fn, gid_t gid, struct stat *st)
-+int xeaccess(char *fn, gid_t gid, struct stat *st)
- {
- 	struct stat	tmp;
- 	uid_t		uid = geteuid();
-@@ -96,7 +96,7 @@
- 		*p = 0;
- 	else
- 		strcpy(dir, ".");
--	if (eaccess(dir, egid, NULL) >= 0) {
-+	if (xeaccess(dir, egid, NULL) >= 0) {
- 		free(dir);
- 		return 0;
- 	}
-@@ -111,7 +111,7 @@
- 			return 0;
- 		mailgid = st.st_gid;
- 	}
--	ret = eaccess(dir, mailgid, NULL) >= 0;
-+	ret = xeaccess(dir, mailgid, NULL) >= 0;
- 	free (dir);
- 	return ret;
- }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/liblogging/liblogging_1.0.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/liblogging/liblogging_1.0.5.bb
index 3488b19..64a258b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/liblogging/liblogging_1.0.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/liblogging/liblogging_1.0.5.bb
@@ -19,5 +19,5 @@
 
 EXTRA_OECONF = "--disable-man-pages"
 
-PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "", d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[systemd] = "--enable-journal, --disable-journal, systemd"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libqb/libqb/0001-Remove-runtime-check-for-CLOCK_MONOTONIC.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/libqb/libqb/0001-Remove-runtime-check-for-CLOCK_MONOTONIC.patch
new file mode 100644
index 0000000..28bc5c0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libqb/libqb/0001-Remove-runtime-check-for-CLOCK_MONOTONIC.patch
@@ -0,0 +1,43 @@
+From e6fbad0c122ba8e87b67a9e2447505adcaafe204 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 16:31:38 -0700
+Subject: [PATCH] Remove runtime check for CLOCK_MONOTONIC
+
+Does not work during cross compile
+
+use a compile-time check to detect whether the
+monotonic clock is available. This check can run just fine when we are
+cross-compiling.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index fa13ae6..f4f0f46 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -175,9 +175,17 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+                  )
+ 
+ AC_MSG_CHECKING(for a working clock_getres(CLOCK_MONOTONIC, &ts))
+-AC_RUN_IFELSE([AC_LANG_PROGRAM(
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#include <time.h>]],
+-[[struct timespec ts; if(clock_getres(CLOCK_MONOTONIC, &ts)) return -1;]])],
++[[
++#include <unistd.h>
++int main() {
++#if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC))
++        #error No monotonic clock
++#endif
++    return 0;
++
++]])],
+                     [
+                       AC_MSG_RESULT([yes])
+                       AC_DEFINE_UNQUOTED([HAVE_CLOCK_GETRES_MONOTONIC], 1, [Define to 1 if clock_getres(CLOCK_MONOTONIC, &ts) works])
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libqb/libqb_0.17.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/libqb/libqb_0.17.2.bb
deleted file mode 100644
index 94030b2..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/libqb/libqb_0.17.2.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-SUMMARY = "An IPC library for high performance servers"
-DESCRIPTION = "libqb is a library with the primary purpose of providing high performance client server reusable features. \
-It provides high performance logging, tracing, ipc, and poll."
-
-HOMEPAGE = "https://github.com/clusterlabs/libqb/wiki"
-SECTION = "libs"
-
-LICENSE = "LGPL-2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=321bf41f280cf805086dd5a720b37785"
-
-inherit autotools-brokensep pkgconfig
-
-PV = "0.17.2+git${SRCPV}"
-
-SRCREV = "bd2c587f6ccacd8a5644b275d99324d200c2b378"
-SRC_URI = "git://github.com/ClusterLabs/${BPN}.git"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
-    ( cd ${S}
-    ${S}/autogen.sh )
-}
-
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libqb/libqb_1.0.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/libqb/libqb_1.0.1.bb
new file mode 100644
index 0000000..e26bb7c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libqb/libqb_1.0.1.bb
@@ -0,0 +1,23 @@
+SUMMARY = "An IPC library for high performance servers"
+DESCRIPTION = "libqb is a library with the primary purpose of providing high performance client server reusable features. \
+It provides high performance logging, tracing, ipc, and poll."
+
+HOMEPAGE = "https://github.com/clusterlabs/libqb/wiki"
+SECTION = "libs"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=321bf41f280cf805086dd5a720b37785"
+
+inherit autotools pkgconfig
+
+PV .= "+git${SRCPV}"
+
+SRCREV = "0a329683a76bc6aeb36f20f2bf6b43ba0440c4dc"
+SRC_URI = "git://github.com/ClusterLabs/${BPN}.git \
+           file://0001-Remove-runtime-check-for-CLOCK_MONOTONIC.patch \
+          "
+S = "${WORKDIR}/git"
+
+do_configure_prepend() {
+    ( cd ${S}
+    ${S}/autogen.sh )
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libuio/libuio/0001-include-fcntl.h-for-O_RDWR-define.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/libuio/libuio/0001-include-fcntl.h-for-O_RDWR-define.patch
new file mode 100644
index 0000000..3cae5c9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libuio/libuio/0001-include-fcntl.h-for-O_RDWR-define.patch
@@ -0,0 +1,38 @@
+From d39c78d322585a32f9a55c67c25a99602ce08b12 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 1 Apr 2017 09:01:33 -0700
+Subject: [PATCH] include fcntl.h for O_RDWR define
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tools/lsuio.c | 1 +
+ tools/rwuio.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/tools/lsuio.c b/tools/lsuio.c
+index 58eb922..4769446 100644
+--- a/tools/lsuio.c
++++ b/tools/lsuio.c
+@@ -19,6 +19,7 @@
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <getopt.h>
++#include <fcntl.h>
+ 
+ #include "system.h"
+ #include "uio_helper.h"
+diff --git a/tools/rwuio.c b/tools/rwuio.c
+index aef9e90..ebc71e1 100644
+--- a/tools/rwuio.c
++++ b/tools/rwuio.c
+@@ -20,6 +20,7 @@
+ */
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <fcntl.h>
+ #include <sys/types.h>
+ #include <getopt.h>
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/libuio/libuio_0.2.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/libuio/libuio_0.2.1.bb
index f405197..dd34c18 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/libuio/libuio_0.2.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/libuio/libuio_0.2.1.bb
@@ -4,12 +4,16 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
 
 SRC_URI = "git://git.code.sf.net/p/libuio/code \
-           file://replace_inline_with_static-inline.patch"
+           file://replace_inline_with_static-inline.patch \
+           file://0001-include-fcntl.h-for-O_RDWR-define.patch \
+           "
 
 inherit autotools
 
 SRCREV = "ed4f07ea147ac403c28105ab44d01bbf524d36f9"
 
+PV .= "+git${SRCPV}"
+
 S = "${WORKDIR}/git"
 
 PACKAGES += "${PN}-tools"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/lprng/lprng_3.8.C.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/lprng/lprng_3.8.C.bb
index 80b93d9..963c632 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/lprng/lprng_3.8.C.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/lprng/lprng_3.8.C.bb
@@ -12,6 +12,9 @@
 EXTRA_OECONF = "--disable-ssl --disable-kerberos --enable-force_localhost"
 FILES_${PN}-dbg += "${libdir}/lprng/filters/.debug"
 
+# configure: WARNING: Program 'clear' is not found. Set environment CLEAR=no if you do not want to use it
+export CLEAR = "no"
+
 do_install_append() {
     mv ${D}/etc/printcap.sample ${D}/etc/printcap
     mv ${D}/etc/lpd/lpd.conf.sample ${D}/etc/lpd/lpd.conf
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/mml-widget/gtkmathview_0.8.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/mml-widget/gtkmathview_0.8.0.bb
index c693639..15935c8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/mml-widget/gtkmathview_0.8.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/mml-widget/gtkmathview_0.8.0.bb
@@ -1,5 +1,5 @@
 HOMEPAGE = "http://helm.cs.unibo.it/mml-widget/"
-DEPENDS = "t1lib gtk+ popt libxslt libxml2"
+DEPENDS = "t1lib gtk+ popt libxslt-native libxml2"
 
 LICENSE = "LGPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=6a6a8e020838b23406c81b19c1d46df6"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/mozjs/mozjs/0001-add-support-for-big-endian-32bit-ARM.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/mozjs/mozjs/0001-add-support-for-big-endian-32bit-ARM.patch
deleted file mode 100644
index 7b7038f..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/mozjs/mozjs/0001-add-support-for-big-endian-32bit-ARM.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 07830cbc409f8e998fa839275470031fc83d6eb6 Mon Sep 17 00:00:00 2001
-From: Koen Kooi <koen.kooi@linaro.org>
-Date: Thu, 21 Apr 2016 14:10:54 +0200
-Subject: [PATCH] add support for big endian 32bit ARM
-
-Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
----
- mfbt/double-conversion/utils.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
-index fe26dab..78a19cb 100644
---- a/mfbt/double-conversion/utils.h
-+++ b/mfbt/double-conversion/utils.h
-@@ -58,7 +58,7 @@
-     defined(__mips__) || defined(__powerpc__) || \
-     defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
-     defined(__SH4__) || defined(__alpha__) || \
--    defined(__aarch64__) || \
-+    defined(__aarch64__) || defined(__ARMEB__) || \
-     defined(_MIPS_ARCH_MIPS32R2)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
--- 
-2.4.3
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/mozjs/mozjs/0001-compare-the-first-character-of-string-to-be-null-or-.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/mozjs/mozjs/0001-compare-the-first-character-of-string-to-be-null-or-.patch
new file mode 100644
index 0000000..40d646c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/mozjs/mozjs/0001-compare-the-first-character-of-string-to-be-null-or-.patch
@@ -0,0 +1,32 @@
+From f36c9476d2816e0d3e61c9e13c22ed73883cb54a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 24 Apr 2017 12:13:43 -0700
+Subject: [PATCH] compare the first character of string to be null or not
+
+Fixes
+
+error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
+|          if (value[0] == '\0')
+|                          ^~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ js/src/shell/jsoptparse.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/js/src/shell/jsoptparse.cpp b/js/src/shell/jsoptparse.cpp
+index b49d0a5..612aa00 100644
+--- a/js/src/shell/jsoptparse.cpp
++++ b/js/src/shell/jsoptparse.cpp
+@@ -243,7 +243,7 @@ OptionParser::extractValue(size_t argc, char **argv, size_t *i, char **value)
+     char *eq = strchr(argv[*i], '=');
+     if (eq) {
+         *value = eq + 1;
+-        if (value[0] == '\0')
++        if (value[0][0] == '\0')
+             return error("A value is required for option %.*s", eq - argv[*i], argv[*i]);
+         return Okay;
+     }
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/mozjs/mozjs_17.0.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/mozjs/mozjs_17.0.0.bb
index 24631e4..b674439 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/mozjs/mozjs_17.0.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/mozjs/mozjs_17.0.0.bb
@@ -2,21 +2,20 @@
 LICENSE = "MPL-2.0"
 LIC_FILES_CHKSUM = "file://../../LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
 
-SRC_URI = " \
-    http://ftp.mozilla.org/pub/mozilla.org/js/${BPN}${PV}.tar.gz \
-    file://0001-mozjs17.0.0-fix-the-compile-bug-of-powerpc.patch \
-    file://0001-js.pc.in-do-not-include-RequiredDefines.h-for-depend.patch \
-    file://0002-Move-JS_BYTES_PER_WORD-out-of-config.h.patch;patchdir=../../ \
-    file://0003-Add-AArch64-support.patch;patchdir=../../ \
-    file://0004-mozbug746112-no-decommit-on-large-pages.patch;patchdir=../../ \
-    file://0005-aarch64-64k-page.patch;patchdir=../../ \
-    file://0001-regenerate-configure.patch;patchdir=../../ \
-    file://fix-the-compile-error-of-powerpc64.patch;patchdir=../../ \
-    file://fix_milestone_compile_issue.patch \
-    file://0010-fix-cross-compilation-on-i586-targets.patch;patchdir=../../ \
-    file://0001-add-support-for-big-endian-32bit-ARM.patch;patchdir=../../ \
-    file://Manually_mmap_heap_memory_esr17.patch;patchdir=../../ \
-  "
+SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/js/${BPN}${PV}.tar.gz \
+           file://0001-mozjs17.0.0-fix-the-compile-bug-of-powerpc.patch \
+           file://0001-js.pc.in-do-not-include-RequiredDefines.h-for-depend.patch \
+           file://0002-Move-JS_BYTES_PER_WORD-out-of-config.h.patch;patchdir=../../ \
+           file://0003-Add-AArch64-support.patch;patchdir=../../ \
+           file://0004-mozbug746112-no-decommit-on-large-pages.patch;patchdir=../../ \
+           file://0005-aarch64-64k-page.patch;patchdir=../../ \
+           file://0001-regenerate-configure.patch;patchdir=../../ \
+           file://fix-the-compile-error-of-powerpc64.patch;patchdir=../../ \
+           file://fix_milestone_compile_issue.patch \
+           file://0010-fix-cross-compilation-on-i586-targets.patch;patchdir=../../ \
+           file://Manually_mmap_heap_memory_esr17.patch;patchdir=../../ \
+           file://0001-compare-the-first-character-of-string-to-be-null-or-.patch;patchdir=../../ \
+           "
 
 SRC_URI[md5sum] = "20b6f8f1140ef6e47daa3b16965c9202"
 SRC_URI[sha256sum] = "321e964fe9386785d3bf80870640f2fa1c683e32fe988eeb201b04471c172fba"
@@ -27,6 +26,11 @@
 
 DEPENDS += "nspr zlib"
 
+# Host specific flags need to be defined, otherwise target flags will be passed to the host
+export HOST_CFLAGS = "${BUILD_CFLAGS}"
+export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
+export HOST_LDFLAGS = "${BUILD_LDFLAGS}"
+
 # nspr's package-config is ignored so set libs manually
 EXTRA_OECONF = " \
     --target=${TARGET_SYS} \
@@ -42,7 +46,7 @@
     --disable-methodjit \
 "
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR},--without-x,virtual/libx11"
 
 # mozjs requires autoreconf 2.13
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-networking_0.3.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-networking_0.3.1.bb
index 7cfcbe2..081bd3b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-networking_0.3.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-networking_0.3.1.bb
@@ -28,3 +28,5 @@
 
 FILES_${PN} =+ "${libdir}/cmpi/libcmpiLMI_Networking.so ${prefix}/libexec*"
 FILES_${PN}-dbg =+ "${libdir}/cmpi/.debug*"
+
+PNBLACKLIST[openlmi-networking] ?= "Depends on blacklisted openlmi-providers - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-providers_0.6.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-providers_0.6.0.bb
index 6048888..2eda653 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-providers_0.6.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-providers_0.6.0.bb
@@ -52,3 +52,5 @@
 FILES_${PN}-dbg =+ "${libdir}/cmpi/.debug*"
 
 RDEPENDS_${PN} = "python"
+
+PNBLACKLIST[openlmi-providers] ?= "Depends on blacklisted lmsensors - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-storage_0.8.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-storage_0.8.1.bb
index 015d803..f99b77c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-storage_0.8.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/openlmi/openlmi-storage_0.8.1.bb
@@ -30,3 +30,5 @@
 }
 
 FILES_${PN} =+ "${sysconfdir}/openlmi/storage/storage.conf ${datadir}/${BPN}/*"
+
+PNBLACKLIST[openlmi-storage] ?= "Depends on blacklisted pywbem - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/p7zip_16.02.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/p7zip_16.02.bb
index fdd51db..67ffbc6 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/p7zip_16.02.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/p7zip_16.02.bb
@@ -36,4 +36,4 @@
     chmod 0755 ${D}${bindir}/7z
 }
 
-BBCLASSEXTEND += "native"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/p8platform/p8platform_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/p8platform/p8platform_git.bb
new file mode 100644
index 0000000..f6347c2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/p8platform/p8platform_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Platform support library used by libCEC and binary add-ons for Kodi"
+HOMEPAGE = "http://libcec.pulse-eight.com/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://src/os.h;md5=752555fa94e82005d45fd201fee5bd33"
+
+PV = "2.1.0"
+
+SRC_URI = "git://github.com/Pulse-Eight/platform.git"
+SRCREV = "d7bceb64541cb046421cbcd4c98d91e9bf24822f"
+
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig
+
+EXTRA_OECMAKE += "-DCMAKE_INSTALL_LIBDIR=${libdir} -DCMAKE_INSTALL_LIBDIR_NOARCH=${libdir}"
+
+FILES_${PN}-dev += "${libdir}/p8-platform"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/polkit/polkit-group-rule.inc b/import-layers/meta-openembedded/meta-oe/recipes-extended/polkit/polkit-group-rule.inc
index b727d00..40e4005 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/polkit/polkit-group-rule.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/polkit/polkit-group-rule.inc
@@ -1,4 +1,4 @@
-# polkit must prepare polkid group
+# polkit must prepare polkitd group
 DEPENDS += "polkit"
 
 inherit useradd
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/polkit/polkit_0.113.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/polkit/polkit_0.113.bb
index daafaf5..326c934 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/polkit/polkit_0.113.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/polkit/polkit_0.113.bb
@@ -9,8 +9,8 @@
 
 inherit autotools gtk-doc pkgconfig useradd systemd gobject-introspection
 
-PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
-                 ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','consolekit',d)}"
+PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
+                 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', 'consolekit', d)}"
 
 PACKAGECONFIG[pam] = "--with-authfw=pam,--with-authfw=shadow,libpam,libpam"
 PACKAGECONFIG[systemd] = "--enable-libsystemd-login=yes --with-systemdsystemunitdir=${systemd_unitdir}/system/,--enable-libsystemd-login=no --with-systemdsystemunitdir=,systemd"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/pywbem/pywbem_0.8.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/pywbem/pywbem_0.8.0.bb
index 2f9a5bd..7f1986e 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/pywbem/pywbem_0.8.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/pywbem/pywbem_0.8.0.bb
@@ -16,7 +16,7 @@
 LICENSE = "LGPLv2"
 LIC_FILES_CHKSUM = "file://pywbem/LICENSE.txt;md5=fbc093901857fcd118f065f900982c24"
 SECTION = "Development/Libraries"
-DEPENDS = "python-m2crypto-native"
+DEPENDS = "python-m2crypto-native python-typing-native"
 SRC_URI = "http://jaist.dl.sourceforge.net/project/${BPN}/${BPN}/${BP}/${BP}-dev.r704.zip"
 SRC_URI[md5sum] = "84072451dcdd1aa9ee82363848faf7ad"
 SRC_URI[sha256sum] = "898035866d3cc741bbcd62c4ac26e633ad07b7c11d89db2472b9f923f3fd3ed8"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/rarpd/rarpd_ss981107.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/rarpd/rarpd_ss981107.bb
index a112168..4025b80 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/rarpd/rarpd_ss981107.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/rarpd/rarpd_ss981107.bb
@@ -44,7 +44,7 @@
     fi
 }
 
-inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','',d)}
+inherit ${@bb.utils.filter('VIRTUAL-RUNTIME_init_manager', 'systemd', d)}
 
 SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE_${PN} = "rarpd.service"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.conf b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.conf
index 923b98e..ab024ad 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.conf
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.conf
@@ -30,7 +30,7 @@
 # If you want you can bind a single interface, if the bind option is not
 # specified all the interfaces will listen for incoming connections.
 #
-# bind 127.0.0.1
+bind 127.0.0.1
 
 # Specify the path for the unix socket that will be used to listen for
 # incoming connections. There is no default, so Redis will not listen
@@ -53,14 +53,14 @@
 # Specify the log file name. Also 'stdout' can be used to force
 # Redis to log on the standard output. Note that if you use standard
 # output for logging but daemonize, logs will be sent to /dev/null
-logfile /var/log/redis.log
+# logfile /var/log/redis.log
 
 # To enable logging to the system logger, just set 'syslog-enabled' to yes,
 # and optionally update the other syslog parameters to suit your needs.
-# syslog-enabled no
+syslog-enabled yes
 
 # Specify the syslog identity.
-# syslog-ident redis
+syslog-ident redis
 
 # Specify the syslog facility.  Must be USER or between LOCAL0-LOCAL7.
 # syslog-facility local0
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.service b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.service
new file mode 100644
index 0000000..36d2985
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Redis In-Memory Data Store
+After=network.target
+
+[Service]
+User=redis
+Group=redis
+ExecStart=/usr/bin/redis-server /etc/redis/redis.conf
+ExecStop=/usr/bin/redis-cli shutdown
+Restart=always
+LimitNOFILE=10032
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis_3.0.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis_3.0.2.bb
index 2e4b760..9395b33 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis_3.0.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis_3.0.2.bb
@@ -12,13 +12,21 @@
            file://oe-use-libc-malloc.patch \
            file://redis.conf \
            file://init-redis-server \
+           file://redis.service \
            file://hiredis-update-Makefile-to-add-symbols-to-staticlib.patch \
 "
 
 SRC_URI[md5sum] = "87be8867447f62524b584813e5a7bd14"
 SRC_URI[sha256sum] = "93e422c0d584623601f89b956045be158889ebe594478a2c24e1bf218495633f"
 
-inherit autotools-brokensep update-rc.d
+inherit autotools-brokensep update-rc.d systemd useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN}  = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis"
+GROUPADD_PARAM_${PN} = "--system redis"
+
+
+REDIS_ON_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
 
 do_install() {
     export PREFIX=${D}/${prefix}
@@ -28,9 +36,20 @@
     install -d ${D}/${sysconfdir}/init.d
     install -m 0755 ${WORKDIR}/init-redis-server ${D}/${sysconfdir}/init.d/redis-server
     install -d ${D}/var/lib/redis/
+    chown redis.redis ${D}/var/lib/redis/
+
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/redis.service ${D}${systemd_system_unitdir}
+    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_system_unitdir}/redis.service
+
+    if [ "${REDIS_ON_SYSTEMD}" = true ]; then
+        sed -i 's!daemonize yes!# daemonize yes!' ${D}/${sysconfdir}/redis/redis.conf
+    fi
 }
 
 CONFFILES_${PN} = "${sysconfdir}/redis/redis.conf"
 
 INITSCRIPT_NAME = "redis-server"
 INITSCRIPT_PARAMS = "defaults 87"
+
+SYSTEMD_SERVICE_${PN} = "redis.service"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/rrdtool/rrdtool_1.6.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/rrdtool/rrdtool_1.6.0.bb
index 09aac4d..a3aac45 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/rrdtool/rrdtool_1.6.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/rrdtool/rrdtool_1.6.0.bb
@@ -19,11 +19,12 @@
 
 BBCLASSEXTEND = "native"
 
-SYSTEMD_SERVICE_${PN} = "rrdcached.socket rrdcached.service"
+SYSTEMD_PACKAGES = "rrdcached"
+SYSTEMD_SERVICE_rrdcached = "rrdcached.socket rrdcached.service"
 
 EXTRA_AUTORECONF = "-I m4"
 
-PACKAGECONFIG ??= "python perl ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG ??= "python perl ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 
 PACKAGECONFIG[python] = "--enable-python=yes \
 am_cv_python_pythondir=${STAGING_LIBDIR}/python${PYTHON_BASEVERSION}/site-packages \
@@ -99,6 +100,14 @@
 }
 
 PACKAGES =+ "${PN}-perl ${PN}-python"
+PACKAGES =+ "rrdcached"
+
+DESCRIPTION_rrdcached = \
+"The rrdcached package contains the data caching daemon for RRDtool."
+
+FILES_rrdcached = "${bindir}/rrdcached \
+    ${systemd_unitdir}/system/rrdcached.service \
+    ${systemd_unitdir}/system/rrdcached.socket"
 
 FILES_${PN}-doc += "${datadir}/rrdtool/examples"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch
new file mode 100644
index 0000000..23c0f25
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch
@@ -0,0 +1,33 @@
+From 3c3c21f4735eb215206273bc714c57c969926d3d Mon Sep 17 00:00:00 2001
+From: Ming Liu <peter.x.liu@external.atlascopco.com>
+Date: Sun, 26 Feb 2017 14:10:21 +0100
+Subject: [PATCH] Include sys/time.h
+
+struct timeval is defined in sys/time.h with a musl libc.
+
+Upstream-Status: Inappropriate [musl libc specific]
+
+Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
+---
+ tests/msleep.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/tests/msleep.c b/tests/msleep.c
+index 26a8206..ca818be 100644
+--- a/tests/msleep.c
++++ b/tests/msleep.c
+@@ -26,11 +26,7 @@
+ #include "config.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+-#if defined(__FreeBSD__)
+ #include <sys/time.h>
+-#else
+-#include <time.h>
+-#endif
+ 
+ int main(int argc, char *argv[])
+ {
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch
new file mode 100644
index 0000000..7903bb1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch
@@ -0,0 +1,35 @@
+From 6746e3a9615d1566bf228e9012d0841b15178810 Mon Sep 17 00:00:00 2001
+From: Ming Liu <liu.ming50@gmail.com>
+Date: Sun, 26 Feb 2017 13:50:33 +0100
+Subject: [PATCH] Undefine GLOB_BRACE
+
+GLOB_BRACE is not defined in posix and thus not implemented in musl libc.
+
+Fixed by defining it to 0 if it is undefined.
+
+Upstream-Status: Inappropriate [musl libc specific]
+
+Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
+---
+ plugins/imfile/imfile.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
+index d20471f..f9aff81 100644
+--- a/plugins/imfile/imfile.c
++++ b/plugins/imfile/imfile.c
+@@ -85,6 +85,11 @@ static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config para
+ 
+ #define ADD_METADATA_UNSPECIFIED -1
+ 
++/* fixes build with musl libc */
++#ifndef GLOB_BRACE
++#define GLOB_BRACE 0
++#endif
++
+ /* this structure is used in pure polling mode as well one of the support
+  * structures for inotify.
+  */
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb
index 7242323..d1d391b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb
@@ -26,19 +26,23 @@
            file://rsyslog-fix-ptest-not-finish.patch \
 "
 
+SRC_URI_append_libc-musl = " \
+    file://0001-Undefine-GLOB_BRACE.patch \
+    file://0001-Include-sys-time-h.patch \
+"
+
 SRC_URI[md5sum] = "ad0f25f429aa2daa326732950a5eeb6c"
 SRC_URI[sha256sum] = "06e2884181333dccecceaca82827ae24ca7a258b4fbf7b1e07a80d4caae640ca"
 
-inherit autotools pkgconfig systemd update-rc.d update-alternatives ptest
+inherit autotools pkgconfig systemd update-rc.d ptest
 
-EXTRA_OECONF += "--disable-generate-man-pages"
+EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes"
 
 # first line is default yes in configure
 PACKAGECONFIG ??= " \
     rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \
     imdiag gnutls imfile \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'snmp', 'snmp', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \
 "
 
@@ -114,7 +118,7 @@
 
 do_install_append() {
     install -d "${D}${sysconfdir}/init.d"
-    install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog.${BPN}
+    install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
     install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
     install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.rsyslog
 }
@@ -124,20 +128,10 @@
 INITSCRIPT_NAME = "syslog"
 INITSCRIPT_PARAMS = "defaults"
 
-# higher than sysklogd's 100
-ALTERNATIVE_PRIORITY = "110"
-
-ALTERNATIVE_${PN} = "syslogd syslog-conf syslog-logrotate"
-
-ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
-ALTERNATIVE_TARGET[syslogd] = "${sbindir}/rsyslogd"
-ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
-ALTERNATIVE_TARGET[syslog-conf] = "${sysconfdir}/rsyslog.conf"
-ALTERNATIVE_LINK_NAME[syslog-logrotate] = "${sysconfdir}/logrotate.d/syslog"
-ALTERNATIVE_TARGET[syslog-logrotate] = "${sysconfdir}/logrotate.rsyslog"
-
 CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf"
 
+RCONFLICTS_${PN} = "busybox-syslog sysklogd syslog-ng"
+
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
 RCONFLICTS_${PN} += "${PN}-systemd"
@@ -154,19 +148,3 @@
 VALGRIND_aarch64 = ""
 RDEPENDS_${PN}-ptest += "make diffutils gzip bash gawk coreutils procps"
 RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}"
-
-# no syslog-init for systemd
-python () {
-    if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-        pn = d.getVar('PN', True)
-        sysconfdir = d.getVar('sysconfdir', True)
-        d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init')
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (sysconfdir))
-        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
-
-    if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
-        pn = d.getVar('PN', True)
-        d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service')
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True)))
-        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/rsyslog.service' % (d.getVar('systemd_unitdir', True)))
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-Replace-need-for-error.h-when-it-does-not-exist.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-Replace-need-for-error.h-when-it-does-not-exist.patch
new file mode 100644
index 0000000..e723050
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-Replace-need-for-error.h-when-it-does-not-exist.patch
@@ -0,0 +1,124 @@
+From 394bf0f1ed07419d40f6024363cc1ffc7ef61bc6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Aug 2017 21:56:25 -0700
+Subject: [PATCH] Replace need for error.h when it does not exist
+
+helps fixing build on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ brokerUpc.c   |  5 ++++-
+ configure.ac  |  2 +-
+ httpAdapter.c |  4 +++-
+ support.c     | 14 +++++++++++++-
+ trace.c       |  4 +++-
+ 5 files changed, 24 insertions(+), 5 deletions(-)
+
+diff --git a/brokerUpc.c b/brokerUpc.c
+index 17cbd9b..fe2b347 100644
+--- a/brokerUpc.c
++++ b/brokerUpc.c
+@@ -20,8 +20,11 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
++#ifdef HAVE_ERROR_H
+ #include <error.h>
+-
++#else
++#include <err.h>
++#endif
+ #include "support.h"
+ #include "native.h"
+ #include <sfcCommon/utilft.h>
+diff --git a/configure.ac b/configure.ac
+index ab2964e..d4915a1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -517,7 +517,7 @@ fi
+ # Checks for header files.
+ AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
+-AC_CHECK_HEADERS([fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h zlib.h])
++AC_CHECK_HEADERS([error.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h zlib.h])
+ AC_CHECK_HEADERS([cmpi/cmpimacs.h cmpi/cmpift.h cmpi/cmpidt.h],[],[AC_MSG_ERROR([Could not find required CPMI header.])])
+ 
+ # Checks for typedefs, structures, and compiler characteristics.
+diff --git a/httpAdapter.c b/httpAdapter.c
+index 2719e6c..e768972 100644
+--- a/httpAdapter.c
++++ b/httpAdapter.c
+@@ -71,7 +71,9 @@
+ #ifdef HAVE_UDS
+ #include <grp.h>
+ #endif
+-
++#ifndef __SOCKADDR_ARG
++# define __SOCKADDR_ARG         struct sockaddr *__restrict
++#endif
+ /* should probably go into cimRequest.h */
+ #define CIM_PROTOCOL_ANY     0
+ #define CIM_PROTOCOL_CIM_XML 1
+diff --git a/support.c b/support.c
+index c7bba8b..5b3eef1 100644
+--- a/support.c
++++ b/support.c
+@@ -32,7 +32,11 @@
+ #include "support.h"
+ #include <stdio.h>
+ #include <stdlib.h>
++#ifdef HAVE_ERROR_H
+ #include <error.h>
++#else
++#include <err.h>
++#endif
+ #include <errno.h>
+ #include "native.h"
+ #include "trace.h"
+@@ -331,17 +335,25 @@ loadQualifierDeclMI(const char *provider,
+   _SFCB_RETURN(NULL);
+ };
+ 
++
+ /****************************************************************************/
+ 
+ /** Exits the program with a memory allocation error message in case the given 
+  *  condition holds.
+  */
++#if HAVE_ERROR_H
+ #define __ALLOC_ERROR(cond) \
+   if ( cond ) { \
+     error_at_line ( -1, errno, __FILE__, __LINE__, \
+ 		    "unable to allocate requested memory." ); \
+   }
+-
++#else
++#define __ALLOC_ERROR(cond) \
++  if ( cond ) { \
++    err(1, "%s:%d: %s", __FILE__, __LINE__, \
++		    "unable to allocate requested memory." ); \
++  }
++#endif
+ /**
+  * flag to ensure MM is initialized only once
+  */
+diff --git a/trace.c b/trace.c
+index d7f30db..438af46 100644
+--- a/trace.c
++++ b/trace.c
+@@ -279,7 +279,9 @@ _sfcb_trap(int tn)
+   }
+ #endif
+ }
+-
++#ifndef SA_INTERRUPT
++# define SA_INTERRUPT 0x20000000 /* from GLIBC's <bits/sigaction.h> */
++#endif
+ sigHandler     *
+ setSignal(int sn, sigHandler * sh, int flags)
+ {
+-- 
+2.14.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-include-stdint.h-system-header-for-UINT16_MAX.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-include-stdint.h-system-header-for-UINT16_MAX.patch
new file mode 100644
index 0000000..c2111a2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-include-stdint.h-system-header-for-UINT16_MAX.patch
@@ -0,0 +1,29 @@
+From 446fb15f79499f52ce01ca759dbdcfe635519a82 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 07:09:33 -0700
+Subject: [PATCH] include stdint.h system header for UINT16_MAX
+
+Fixes build error
+
+error: 'UINT16_MAX' undeclared (first use in this function)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ interopServerProvider.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/interopServerProvider.c b/interopServerProvider.c
+index 23ae182..532febe 100644
+--- a/interopServerProvider.c
++++ b/interopServerProvider.c
+@@ -33,6 +33,7 @@
+ #include <sfcCommon/utilft.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <stdint.h>
+ #include <ctype.h>
+ #include <string.h>
+ #include <sys/types.h>
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb_1.4.9.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb_1.4.9.bb
index 84e465d..c6b9f10 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb_1.4.9.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb_1.4.9.bb
@@ -12,6 +12,7 @@
 DEPENDS = "curl libpam openssl sblim-sfc-common unzip-native"
 
 SRC_URI = "http://downloads.sourceforge.net/sblim/${BP}.tar.bz2 \
+           file://sfcb.service \
            file://sblim-sfcb-1.3.9-sfcbrepos-schema-location.patch \
            file://sblim-sfcb-1.3.15-fix-provider-debugging.patch \
            file://sblim-sfcb-1.3.16-maxMsgLen.patch \
@@ -19,13 +20,15 @@
            file://sblim-sfcb-1.3.16-multilib-man-cfg.patch \
            file://sblim-sfcb-1.4.8-default-ecdh-curve-name.patch \
            file://sblim-sfcb-1.4.9-fix-ftbfs.patch \
-           file://sfcb.service"
+           file://0001-include-stdint.h-system-header-for-UINT16_MAX.patch \
+           file://0001-Replace-need-for-error.h-when-it-does-not-exist.patch \
+"
 
 SRC_URI[md5sum] = "28021cdabc73690a94f4f9d57254ce30"
 SRC_URI[sha256sum] = "634a67b2f7ac3b386a79160eb44413d618e33e4e7fc74ae68b0240484af149dd"
 
 inherit autotools
-inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
+inherit ${@bb.utils.filter('VIRTUAL-RUNTIME_init_manager', 'systemd', d)}
 
 SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE_${PN} = "sblim-sfcb.service"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/scsirastools/scsirastools_1.6.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/scsirastools/scsirastools_1.6.4.bb
index c64bd92..d0c36e4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/scsirastools/scsirastools_1.6.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/scsirastools/scsirastools_1.6.4.bb
@@ -8,6 +8,8 @@
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://COPYING;md5=687ea108478d26152ae46eb29d9d1545"
 
+DEPENDS += "groff-native"
+
 SRC_URI = "http://prdownloads.sourceforge.net/scsirastools/scsirastools-${PV}.tar.gz"
 SRC_URI[md5sum] = "2d775111b62e2dfc1960a722f5fda211"
 SRC_URI[sha256sum] = "38d2c6c9b04a2c594e528927b950754f94c0522718d17c78e6589ba778339bf8"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/smartmontools/smartmontools_6.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/smartmontools/smartmontools_6.5.bb
index 55d366e..0970d2a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/smartmontools/smartmontools_6.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/smartmontools/smartmontools_6.5.bb
@@ -18,9 +18,7 @@
     file://smartd.service \
 "
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'libcap-ng', 'libcap-ng', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
-"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'libcap-ng selinux', d)}"
 PACKAGECONFIG[libcap-ng] = "--with-libcap-ng=yes,--with-libcap-ng=no,libcap-ng"
 PACKAGECONFIG[selinux] = "--with-selinux=yes,--with-selinux=no,libselinux"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/subsurface/subsurface_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/subsurface/subsurface_git.bb
index 22b9d2f..90adaf4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/subsurface/subsurface_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/subsurface/subsurface_git.bb
@@ -4,7 +4,7 @@
 
 DEPENDS = "libdivecomputer gtk+ libxml2 glib-2.0 gconf"
 
-PNBLACKLIST[subsurface] ?= "Needs to be upgraded for compatibility with new libdivecomputer"
+PNBLACKLIST[subsurface] ?= "Needs to be upgraded for compatibility with new libdivecomputer - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 inherit gtk-icon-cache cmake
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/t1lib/t1lib-5.1.2/format_security.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/t1lib/t1lib-5.1.2/format_security.patch
new file mode 100644
index 0000000..8b4ce40
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/t1lib/t1lib-5.1.2/format_security.patch
@@ -0,0 +1,41 @@
+Fix printf formats to use format qualifiers
+fixes
+
+error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+--- a/lib/type1/objects.c
++++ b/lib/type1/objects.c
+@@ -957,7 +957,7 @@
+  
+        sprintf(typemsg, "Wrong object type in %s; expected %s, found %s.\n",
+                   name, TypeFmt(expect), TypeFmt(obj->type));
+-       IfTrace0(TRUE,typemsg);
++       IfTrace1(TRUE, "%s", typemsg);
+  
+        ObjectPostMortem(obj);
+  
+--- a/lib/t1lib/t1subset.c
++++ b/lib/t1lib/t1subset.c
+@@ -759,7 +759,7 @@
+ 	     tr_len);
+     T1_PrintLog( "T1_SubsetFont()", err_warn_msg_buf,
+ 		 T1LOG_DEBUG);
+-    l+=sprintf( &(trailerbuf[l]), linebuf); /* contains the PostScript trailer */
++    l+=sprintf( &(trailerbuf[l]), "%s", linebuf); /* contains the PostScript trailer */
+   }
+   
+   /* compute size of output file */
+--- a/lib/type1/objects.h
++++ b/lib/type1/objects.h
+@@ -214,7 +214,7 @@
+ /*SHARED*/
+ /* NDW: personally, I want to see status and error messages! */
+ #define IfTrace0(condition,model)                                 \
+-        {if (condition) printf(model);}
++        {if (condition) fputs(model,stdout);}
+ #define IfTrace1(condition,model,arg0)                            \
+         {if (condition) printf(model,arg0);}
+ #define IfTrace2(condition,model,arg0,arg1)                       \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/t1lib/t1lib_5.1.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/t1lib/t1lib_5.1.2.bb
index 1d670a7..826dbda 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/t1lib/t1lib_5.1.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/t1lib/t1lib_5.1.2.bb
@@ -9,7 +9,8 @@
 
 SRC_URI = "${DEBIAN_MIRROR}/main/t/t1lib/t1lib_${PV}.orig.tar.gz \
            file://configure.patch \
-           file://libtool.patch"
+           file://libtool.patch \
+           file://format_security.patch"
 SRC_URI[md5sum] = "a5629b56b93134377718009df1435f3c"
 SRC_URI[sha256sum] = "821328b5054f7890a0d0cd2f52825270705df3641dbd476d58d17e56ed957b59"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/01_build.1.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/01_build.1.patch
deleted file mode 100644
index b9f41ad..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/01_build.1.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Author: Franz Pletz <fpletz@franz-pletz.org>
-Description: Original comment: Fix build
-Not sure why we have this patch. Let's keep it for compatibility.
---- a/pathnames.h
-+++ b/pathnames.h
-@@ -92,6 +92,10 @@
- # define _PATH_TCSHELL		"/local/bin/tcsh"	/* use ram disk */
- #endif /* _MINIX && !_PATH_TCSHELL */
- 
-+#ifndef _PATH_TCSHELL
-+# define _PATH_TCSHELL		"/bin/tcsh"		/* Debian */
-+#endif /* !_PATH_TCSHELL */
-+
- #if defined(__EMX__) && !defined(_PATH_DEVNULL)
- # define _PATH_DEVNULL		"nul"
- #endif /* __EMX__ && !_PATH_DEVNULL */
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/01_build.2.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/01_build.2.patch
deleted file mode 100644
index ff27531..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/01_build.2.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Author: Franz Pletz <fpletz@franz-pletz.org>
-Description: Update manpage.
---- a/tcsh.man
-+++ b/tcsh.man
-@@ -578,7 +578,7 @@ Repeating \fIdabbrev-expand\fR without a
- changes to the next previous word etc., skipping identical matches
- much like \fIhistory-search-backward\fR does.
- .TP 8
--.B delete-char \fR(not bound)
-+.B delete-char \fR(bound to `Del' if using the standard \fI/etc/csh.cshrc\fR)
- Deletes the character under the cursor.
- See also \fIdelete-char-or-list-or-eof\fR.
- .TP 8
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/01_build.3.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/01_build.3.patch
deleted file mode 100644
index d36c177..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/01_build.3.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Author: Franz Pletz <fpletz@franz-pletz.org>
-Description: Enable NODOT
---- a/config_f.h
-+++ b/config_f.h
-@@ -98,7 +98,7 @@
- /*
-  * NODOT	Don't put "." in the default path, for security reasons
-  */
--#undef NODOT
-+#define NODOT
- 
- /*
-  * AUTOLOGOUT	tries to determine if it should set autologout depending
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/12_unknown_lscolors.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/12_unknown_lscolors.patch
deleted file mode 100644
index faa59cc..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/12_unknown_lscolors.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Author: Franz Pletz <fpletz@franz-pletz.org>
-Description: Don't die on unknown LS_COLORS values
-Removing the patch causes a segfault when dircolors is set by coreutils' dircolors.
-Debian-Bug: #592089
-
---- a/tw.color.c
-+++ b/tw.color.c
-@@ -239,13 +239,10 @@ parseLS_COLORS(const Char *value)
- 		    if ((Char)variables[i].variable[0] == (v[0] & CHAR) &&
- 			(Char)variables[i].variable[1] == (v[1] & CHAR))
- 			break;
--		if (i < nvariables) {
--		    v += 3;
-+		v += 3;
-+		if (i < nvariables)
- 		    getstring(&c, &v, &variables[i].color, ':');
--		    continue;
--		}
--		else
--		    stderror(ERR_BADCOLORVAR, v[0], v[1]);
-+		continue;
- 	    }
- 	    break;
- 	}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/15_no-strip.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/15_no-strip.patch
deleted file mode 100644
index cbc9f65..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/15_no-strip.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Author: Lucas Nussbaum <lucas@debian.org>
-Description: do not strip binary
- Stripping should be handled by dh_strip instead, so DEB_BUILD_OPTIONS=nostrip works.
- Closes: #438109, #411607
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -596,7 +596,6 @@ install: tcsh$(EXEEXT)
- 	-mkdir -p ${DESTBIN}
- 	-mv -f ${DESTBIN}/tcsh$(EXEEXT)  ${DESTBIN}/tcsh.old
- 	cp tcsh$(EXEEXT) ${DESTBIN}/tcsh$(EXEEXT)
--	-strip ${DESTBIN}/tcsh$(EXEEXT)
- 	chmod 755 ${DESTBIN}/tcsh$(EXEEXT)
- 
- install.man: tcsh.man
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-broken-test.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-broken-test.patch
deleted file mode 100644
index 0bda0ba..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-broken-test.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Author: Lucas Nussbaum <lucas@debian.org>
-Description: disable syntactically incorrect test
---- a/tests/lexical.at
-+++ b/tests/lexical.at
-@@ -172,9 +172,6 @@
- AT_DATA([nohist.csh],
- [echo ! space !	tab != "!(" newline !
- ])
--AT_CHECK([tcsh -f nohist.csh], ,
--[[! space ! tab != !( newline !
--]])
- 
- AT_CLEANUP
- 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-lexical.at-31.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-lexical.at-31.patch
deleted file mode 100644
index 98a9b2e..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-lexical.at-31.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- a/tests/lexical.at
-+++ b/tests/lexical.at
-@@ -27,27 +27,6 @@ AT_CHECK([tcsh -f oneword.csh], ,
- 
- AT_CLEANUP
- 
--
--AT_SETUP([Comments])
--
--AT_CHECK([echo 'echo OK@%:@comment' | tcsh -f], , [OK
--])
--
--AT_CHECK([tcsh -f -c 'echo @%:@no comment'], ,
--[@%:@no comment
--])
--
--AT_DATA([comment2.csh],
--[[echo testing...@%:@\
--OK
--]])
--AT_CHECK([tcsh -f comment2.csh], ,
--[testing... OK
--])
--
--AT_CLEANUP
--
--
- AT_SETUP([Escaping special characters])
- 
- AT_DATA([nosplit.csh],
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-test-nice.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-test-nice.patch
deleted file mode 100644
index 79f918c..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-test-nice.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Author: Lucas Nussbaum <lucas@debian.org>
-Description: disable test that fails on the buildd with
-  "setpriority: Permission denied".
---- a/tests/commands.at
-+++ b/tests/commands.at
-@@ -888,17 +888,6 @@ TCSH_UNTESTED([migrate])
- TCSH_UNTESTED([newgrp])
- 
- 
--AT_SETUP([nice])
--
--# Nothing really tested
--AT_CHECK([tcsh -f -c 'nice set var=1; echo $?var'], ,
--[0
--])
--
--
--AT_CLEANUP
--
--
- AT_SETUP([nohup])
- 
- AT_DATA([nohup.csh],
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-test-notty.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-test-notty.patch
deleted file mode 100644
index 69f0564..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/disable-test-notty.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Lucas Nussbaum <lucas@debian.org>
-Description: Those tests fail when running the testsuite without a tty. Disabling them.
-
---- a/tests/commands.at
-+++ b/tests/commands.at
-@@ -1203,11 +1203,6 @@ AT_SETUP([source])
- AT_DATA([script.csh],
- [[set var=$1
- ]])
--AT_CHECK([[tcsh -f -c 'source -h script.csh foo; history' \
--	   | sed 's/	[^	]*	/ TIME /']], ,
--[     1 TIME source -h script.csh foo ; history
--     2 TIME set var=$1
--])
- 
- AT_CHECK([tcsh -f -c 'source -h script.csh foo; echo $var'], 1, [],
- [var: Undefined variable.
---- a/tests/variables.at
-+++ b/tests/variables.at
-@@ -319,10 +319,6 @@ AT_CLEANUP
- 
- AT_SETUP([$ edit])
- 
--AT_CHECK([TERM=something tcsh -f -c 'echo $?edit'], ,
--[1
--])
--
- AT_CHECK([TERM=dumb tcsh -f -c 'echo $?edit'], ,
- [0
- ])
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/fix-gcc6-wait-union.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/fix-gcc6-wait-union.patch
deleted file mode 100644
index acc2ce9..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/fix-gcc6-wait-union.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- tcsh-6.18.01/sh.proc.c.orig	2016-06-08 16:11:02.902326725 +0000
-+++ tcsh-6.18.01/sh.proc.c	2016-06-08 16:38:22.150304901 +0000
-@@ -48,7 +48,7 @@
- #endif /* aiws */
- 
- #if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
--# if !defined(__ANDROID__)
-+# if !defined(__ANDROID__) && !defined(__GLIBC__)
- #  define BSDWAIT
- # endif
- #endif /* _BSD || (IRIS4D && __STDC__) || __lucid || glibc */
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/tcsh-6.17.02-multibyte.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/tcsh-6.17.02-multibyte.patch
deleted file mode 100644
index 3dd420a..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/files/tcsh-6.17.02-multibyte.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Author:  Jean-Luc Leger <reiga@dspnet.fr.eu.org>
-Description: fix broken globbing expansion
-Debian-Bug: #603545
-Index: tcsh-6.18.01/tc.str.c
-===================================================================
---- tcsh-6.18.01.orig/tc.str.c	2012-01-10 13:34:31.000000000 -0800
-+++ tcsh-6.18.01/tc.str.c	2013-02-26 13:12:13.429153489 -0800
-@@ -122,8 +122,9 @@
- #else
-     ret = mbtowc(&tmp, s, n);
- #endif
--    if (ret > 0) {
-+    if (ret >= 0)
- 	*pwc = tmp;
-+    if (ret >= 0) {
- #if defined(UTF16_STRINGS) && defined(HAVE_MBRTOWC)
- 	if (tmp >= 0xd800 && tmp <= 0xdbff) {
- 	    /* UTF-16 surrogate pair.  Fetch second half and compute
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh/0001-Enable-system-malloc-on-all-linux.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh/0001-Enable-system-malloc-on-all-linux.patch
new file mode 100644
index 0000000..ff2f6a3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh/0001-Enable-system-malloc-on-all-linux.patch
@@ -0,0 +1,30 @@
+From 0553455813a1f717ef50cc911e4db73da3d23c32 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Mar 2017 18:47:40 -0700
+Subject: [PATCH 1/2] Enable system malloc on all linux
+
+Dont trigger on being just android or glibc
+internal malloc falls flat on musl based systems
+as well. So switch to using system malloc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ config_f.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config_f.h b/config_f.h
+index 6a632a5..0a66960 100644
+--- a/config_f.h
++++ b/config_f.h
+@@ -139,7 +139,7 @@
+  *		This can be much slower and no memory statistics will be
+  *		provided.
+  */
+-#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__GLIBC__) || defined(__OpenBSD__) || defined(__APPLE__) || defined (__ANDROID__)
++#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__linux__) || defined(__OpenBSD__) || defined(__APPLE__)
+ # define SYSMALLOC
+ #else
+ # undef SYSMALLOC
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh/0002-Add-debian-csh-scripts.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh/0002-Add-debian-csh-scripts.patch
new file mode 100644
index 0000000..e4de6f7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh/0002-Add-debian-csh-scripts.patch
@@ -0,0 +1,60 @@
+From 60271713025f6b17dda29721be012a8428e77185 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Mar 2017 18:56:49 -0700
+Subject: [PATCH 2/2] Add debian csh scripts
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ csh.cshrc  | 15 +++++++++++++++
+ csh.login  |  8 ++++++++
+ csh.logout |  1 +
+ 3 files changed, 24 insertions(+)
+ create mode 100644 csh.cshrc
+ create mode 100644 csh.login
+ create mode 100644 csh.logout
+
+diff --git a/csh.cshrc b/csh.cshrc
+new file mode 100644
+index 0000000..29c934a
+--- /dev/null
++++ b/csh.cshrc
+@@ -0,0 +1,15 @@
++# /etc/csh.cshrc: system-wide .cshrc file for csh(1) and tcsh(1)
++
++if ($?tcsh && $?prompt) then
++
++	bindkey "\e[1~" beginning-of-line # Home
++	bindkey "\e[7~" beginning-of-line # Home rxvt
++	bindkey "\e[2~" overwrite-mode    # Ins
++	bindkey "\e[3~" delete-char       # Delete
++	bindkey "\e[4~" end-of-line       # End
++	bindkey "\e[8~" end-of-line       # End rxvt
++
++	set autoexpand
++	set autolist
++	set prompt = "%U%m%u:%B%~%b%# "
++endif
+diff --git a/csh.login b/csh.login
+new file mode 100644
+index 0000000..2455c3c
+--- /dev/null
++++ b/csh.login
+@@ -0,0 +1,8 @@
++# /etc/csh.login: system-wide .login file for csh(1) and tcsh(1)
++
++# allow for other packages/system admins to customize the shell environment
++if (-e /etc/csh/login.d && `/bin/ls /etc/csh/login.d` != "") then
++  foreach FILE (`/bin/ls /etc/csh/login.d/*`)
++    source $FILE;
++  end;
++endif
+diff --git a/csh.logout b/csh.logout
+new file mode 100644
+index 0000000..a207eba
+--- /dev/null
++++ b/csh.logout
+@@ -0,0 +1 @@
++# /etc/csh.logout: system-wide .logout file for csh(1) and tcsh(1)
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh_6.18.01.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh_6.18.01.bb
deleted file mode 100644
index d7a7fd4..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh_6.18.01.bb
+++ /dev/null
@@ -1,53 +0,0 @@
-DESCRIPTION = "TENEX C Shell, an enhanced version of Berkeley csh \
-    The TENEX C Shell is an enhanced version of the Berkeley Unix C shell. \
-    It includes all features of 4.4BSD C shell, plus a command-line editor, \
-    programmable word completion, spelling correction and more."
-
-HOMEPAGE = "http://www.tcsh.org/"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://Copyright;md5=1cf29be62df2be1a3763118b25b4c780"
-SECTION = "base"
-DEPENDS = "ncurses gettext-native"
-SRC_URI = " \
-    ${DEBIAN_MIRROR}/main/t/tcsh/tcsh_${PV}.orig.tar.gz;name=tarball \
-    ${DEBIAN_MIRROR}/main/t/tcsh/tcsh_${PV}-2.diff.gz;name=diffs2 \
-    ${DEBIAN_MIRROR}/main/t/tcsh/tcsh_${PV}-5.diff.gz;name=diffs5 \
-    file://01_build.1.patch \
-    file://01_build.2.patch \
-    file://01_build.3.patch \
-    file://15_no-strip.patch \
-    file://disable-test-notty.patch \
-    file://disable-test-nice.patch \
-    file://disable-lexical.at-31.patch \
-    file://12_unknown_lscolors.patch \
-    file://tcsh-6.17.02-multibyte.patch \
-    file://disable-broken-test.patch \
-    file://fix-gcc6-wait-union.patch \
-"
-SRC_URI[tarball.md5sum] = "6eed09dbd4223ab5b6955378450d228a"
-SRC_URI[tarball.sha256sum] = "d81ca27851f3e8545666399b4bcf25433e602a195113b3f7c73886fef84c9fa8"
-SRC_URI[diffs2.md5sum] = "ea39b818b624aca49ebf2cd2708d6ff9"
-SRC_URI[diffs2.sha256sum] = "95b0c1a339b745c47c5d2f9d02c22a71597462e2e882b51614a9d1f75bd3d16c"
-SRC_URI[diffs5.md5sum] = "d536c12a02dc48c332cc472b86927319"
-SRC_URI[diffs5.sha256sum] = "7548d64bf996548bfbc13f3e0959fd2e8455f8375381a31da67d79554aabc7af"
-
-inherit autotools
-
-do_install_append () {
-    oe_runmake install.man DESTDIR=${D}
-
-    install -d ${D}${base_bindir}
-    ln -s /usr/bin/tcsh ${D}${base_bindir}/tcsh
-
-    install -d ${D}${sysconfdir}/csh/login.d
-    install -m 0644 ${S}/debian/csh.cshrc ${S}/debian/csh.login ${S}/debian/csh.logout ${S}/complete.tcsh ${D}${sysconfdir}
-    install -D -m 0644 ${S}/csh-mode.el ${D}${datadir}/emacs/site-lisp/csh-mode.el
-}
-
-FILES_${PN} += "${datadir}/emacs/site-lisp/csh-mode.el"
-
-
-pkg_postinst_${PN} () {
-#!/bin/sh -e
-echo /usr/bin/tcsh >> $D/etc/shells
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh_6.20.00.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh_6.20.00.bb
new file mode 100644
index 0000000..b59d88f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/tcsh/tcsh_6.20.00.bb
@@ -0,0 +1,44 @@
+DESCRIPTION = "TENEX C Shell, an enhanced version of Berkeley csh \
+    The TENEX C Shell is an enhanced version of the Berkeley Unix C shell. \
+    It includes all features of 4.4BSD C shell, plus a command-line editor, \
+    programmable word completion, spelling correction and more."
+
+HOMEPAGE = "http://www.tcsh.org/"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://Copyright;md5=575cf2715c3bf894e1f79aec1d4eaaf5"
+SECTION = "base"
+DEPENDS = "ncurses gettext-native"
+SRC_URI = " \
+    http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/${BP}.tar.gz \
+    file://0001-Enable-system-malloc-on-all-linux.patch \
+    file://0002-Add-debian-csh-scripts.patch \
+"
+SRC_URI[md5sum] = "59d40ef40a68e790d95e182069431834"
+SRC_URI[sha256sum] = "b89de7064ab54dac454a266cfe5d8bf66940cb5ed048d0c30674ea62e7ecef9d"
+
+EXTRA_OEMAKE += "CC_FOR_GETHOST='${BUILD_CC}'"
+inherit autotools
+
+do_compile_prepend() {
+    oe_runmake CC_FOR_GETHOST='${BUILD_CC}' CFLAGS='${BUILD_CFLAGS}' gethost
+}
+
+do_install_append () {
+    oe_runmake install.man DESTDIR=${D}
+
+    install -d ${D}${base_bindir}
+    ln -s /usr/bin/tcsh ${D}${base_bindir}/tcsh
+    ln -s /usr/bin/tcsh ${D}${base_bindir}/csh
+    install -d ${D}${sysconfdir}/csh/login.d
+    install -m 0644 ${S}/csh.cshrc ${S}/csh.login ${S}/csh.logout ${S}/complete.tcsh ${D}${sysconfdir}
+    install -D -m 0644 ${S}/csh-mode.el ${D}${datadir}/emacs/site-lisp/csh-mode.el
+}
+
+FILES_${PN} += "${datadir}/emacs/site-lisp/csh-mode.el"
+
+
+pkg_postinst_${PN} () {
+#!/bin/sh -e
+echo /usr/bin/tcsh >> $D/etc/shells
+echo /usr/bin/csh >> $D/etc/shells
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils/0001-include-sys-select.h-for-FD_-definitions.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils/0001-include-sys-select.h-for-FD_-definitions.patch
new file mode 100644
index 0000000..6c8ba90
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils/0001-include-sys-select.h-for-FD_-definitions.patch
@@ -0,0 +1,25 @@
+From e291d720a7d9576063717969dde82c33bac7eecf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 11 Apr 2017 14:19:21 -0700
+Subject: [PATCH 1/2] include sys/select.h for FD_* definitions
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ demos/inventory_sim/inventory_sim.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/demos/inventory_sim/inventory_sim.c b/demos/inventory_sim/inventory_sim.c
+index fadf27b..22c33d1 100644
+--- a/demos/inventory_sim/inventory_sim.c
++++ b/demos/inventory_sim/inventory_sim.c
+@@ -132,6 +132,7 @@ Examples
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <sys/select.h>
+ #include <netinet/in.h>
+ #include <linux/tipc.h>
+ 
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils/0002-replace-non-standard-uint-with-unsigned-int.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils/0002-replace-non-standard-uint-with-unsigned-int.patch
new file mode 100644
index 0000000..03e711e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils/0002-replace-non-standard-uint-with-unsigned-int.patch
@@ -0,0 +1,211 @@
+From 3d091efa09478d0330be686184ae4793764504e7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 11 Apr 2017 14:22:23 -0700
+Subject: [PATCH 2/2] replace non-standard uint with unsigned int
+
+make it portable on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ demos/benchmark/client_tipc.c       | 34 +++++++++++++++++-----------------
+ demos/benchmark/common_tipc.h       |  2 +-
+ demos/benchmark/server_tipc.c       | 10 +++++-----
+ demos/inventory_sim/inventory_sim.c | 12 ++++++------
+ 4 files changed, 29 insertions(+), 29 deletions(-)
+
+diff --git a/demos/benchmark/client_tipc.c b/demos/benchmark/client_tipc.c
+index 5d889ee..d913e42 100644
+--- a/demos/benchmark/client_tipc.c
++++ b/demos/benchmark/client_tipc.c
+@@ -65,7 +65,7 @@ static const struct sockaddr_tipc master_clnt_addr = {
+ 
+ static int master_clnt_sd;
+ static int master_srv_sd;
+-static uint client_id;
++static unsigned int client_id;
+ static unsigned char *buf = NULL;
+ static int non_blk = 0;
+ static int select_ip(struct srv_info *sinfo, char *name);
+@@ -79,7 +79,7 @@ struct master_client_cmd {
+ 	__u32 bounce;
+ };
+ 
+-static void master_to_client(uint cmd, uint msglen, uint msgcnt, uint bounce)
++static void master_to_client(unsigned int cmd, unsigned int msglen, unsigned int msgcnt, unsigned int bounce)
+ {
+ 	struct master_client_cmd c;
+ 
+@@ -93,7 +93,7 @@ static void master_to_client(uint cmd, uint msglen, uint msgcnt, uint bounce)
+ 		die("Unable to send cmd %u to clients\n", cmd);
+ }
+ 
+-static void client_from_master(uint *cmd, uint *msglen, uint *msgcnt, uint *bounce)
++static void client_from_master(unsigned int *cmd, unsigned int *msglen, unsigned int *msgcnt, unsigned int *bounce)
+ {
+ 	struct master_client_cmd c;
+ 
+@@ -114,7 +114,7 @@ struct client_master_cmd {
+ 	__u32 cmd;
+ };
+ 
+-static void client_to_master(uint cmd)
++static void client_to_master(unsigned int cmd)
+ {
+ 	struct client_master_cmd c;
+ 
+@@ -125,7 +125,7 @@ static void client_to_master(uint cmd)
+ 		die("Client: Unable to send msg to master\n");
+ }
+ 
+-static void master_from_client(uint *cmd)
++static void master_from_client(unsigned int *cmd)
+ {
+ 	struct client_master_cmd c;
+ 
+@@ -137,7 +137,7 @@ static void master_from_client(uint *cmd)
+ 	*cmd = ntohl(c.cmd);
+ }
+ 
+-static void master_to_srv(uint cmd, uint msglen, uint msgcnt, uint echo)
++static void master_to_srv(unsigned int cmd, unsigned int msglen, unsigned int msgcnt, unsigned int echo)
+ {
+ 	struct master_srv_cmd c;
+ 
+@@ -151,7 +151,7 @@ static void master_to_srv(uint cmd, uint msglen, uint msgcnt, uint echo)
+ 		die("Unable to send cmd %u to servers\n", cmd);
+ }
+ 
+-static void master_from_srv(uint *cmd, struct srv_info *sinfo, __u32 *tipc_addr)
++static void master_from_srv(unsigned int *cmd, struct srv_info *sinfo, __u32 *tipc_addr)
+ {
+ 	struct srv_to_master_cmd c;
+ 
+@@ -290,7 +290,7 @@ static void client_main(unsigned int clnt_id, ushort tcp_port, int tcp_addr)
+ {
+ 	int peer_sd, efd = 0;
+ 	int imp = clnt_id % 4;
+-	uint cmd, msglen, msgcnt, echo;
++	unsigned int cmd, msglen, msgcnt, echo;
+ 	struct epoll_event event, revents;
+ 	struct sockaddr_in tcp_dest;
+ 	int rc;
+@@ -400,22 +400,22 @@ static void client_main(unsigned int clnt_id, ushort tcp_port, int tcp_addr)
+ int main(int argc, char *argv[], char *dummy[])
+ {
+ 	int c;
+-	uint cmd;
+-	uint latency_transf = DEFAULT_LAT_MSGS;
+-	uint thruput_transf = DEFAULT_THRU_MSGS;
+-	uint req_clients = DEFAULT_CLIENTS;
+-	uint first_msglen = DEFAULT_MSGLEN;
+-	uint last_msglen = TIPC_MAX_USER_MSG_SIZE;
++	unsigned int cmd;
++	unsigned int latency_transf = DEFAULT_LAT_MSGS;
++	unsigned int thruput_transf = DEFAULT_THRU_MSGS;
++	unsigned int req_clients = DEFAULT_CLIENTS;
++	unsigned int first_msglen = DEFAULT_MSGLEN;
++	unsigned int last_msglen = TIPC_MAX_USER_MSG_SIZE;
+ 	unsigned long long msglen;
+ 	unsigned long long num_clients;
+ 	struct timeval start_time;
+ 	unsigned long long elapsed;
+ 	unsigned long long msgcnt;
+ 	unsigned long long iter;
+-	uint clnt_id;
+-	uint conn_typ = TIPC_CONN;
++	unsigned int clnt_id;
++	unsigned int conn_typ = TIPC_CONN;
+ 	ushort tcp_port = 0;
+-	uint tcp_addr = 0;
++	unsigned int tcp_addr = 0;
+ 	struct srv_info sinfo;
+ 	__u32 peer_tipc_addr;
+ 	char ifname[16] = {0,};
+diff --git a/demos/benchmark/common_tipc.h b/demos/benchmark/common_tipc.h
+index 1765ba1..47947e0 100644
+--- a/demos/benchmark/common_tipc.h
++++ b/demos/benchmark/common_tipc.h
+@@ -256,7 +256,7 @@ static void get_ip_list(struct srv_info *sinfo, char *ifname)
+ 	}
+ }
+ 
+-static uint own_node(void)
++static unsigned int own_node(void)
+ {
+ 	struct sockaddr_tipc addr;
+ 	socklen_t sz = sizeof(addr);
+diff --git a/demos/benchmark/server_tipc.c b/demos/benchmark/server_tipc.c
+index 9d0e2be..3cd82b7 100644
+--- a/demos/benchmark/server_tipc.c
++++ b/demos/benchmark/server_tipc.c
+@@ -45,7 +45,7 @@ static int wait_for_connection(int listener_sd);
+ static void echo_messages(int peer_sd, int master_sd, int srv_id);
+ static __u32 own_node_addr;
+ 
+-static void srv_to_master(uint cmd, struct srv_info *sinfo)
++static void srv_to_master(unsigned int cmd, struct srv_info *sinfo)
+ {
+ 	struct srv_to_master_cmd c;
+ 
+@@ -62,7 +62,7 @@ static void srv_to_master(uint cmd, struct srv_info *sinfo)
+ 		die("Server: unable to send info to master\n");
+ }
+ 
+-static void srv_from_master(uint *cmd, uint* msglen, uint *msgcnt, uint *echo)
++static void srv_from_master(unsigned int *cmd, unsigned int* msglen, unsigned int *msgcnt, unsigned int *echo)
+ {
+ 	struct master_srv_cmd c;
+ 
+@@ -84,8 +84,8 @@ int main(int argc, char *argv[], char *dummy[])
+ {
+ 	ushort tcp_port = 4711;
+ 	struct srv_info sinfo;
+-	uint cmd;
+-	uint max_msglen;
++	unsigned int cmd;
++	unsigned int max_msglen;
+ 	struct sockaddr_in srv_addr;
+ 	int lstn_sd, peer_sd;
+ 	int srv_id = 0, srv_cnt = 0;;
+@@ -221,7 +221,7 @@ static int wait_for_connection(int lstn_sd)
+ 
+ static void echo_messages(int peer_sd, int master_sd, int srv_id)
+ {
+-	uint cmd, msglen, msgcnt, echo, rcvd = 0;
++	unsigned int cmd, msglen, msgcnt, echo, rcvd = 0;
+ 
+ 	do {
+ 		/* Get msg length and number to expect, and ack: */
+diff --git a/demos/inventory_sim/inventory_sim.c b/demos/inventory_sim/inventory_sim.c
+index 22c33d1..9bf5443 100644
+--- a/demos/inventory_sim/inventory_sim.c
++++ b/demos/inventory_sim/inventory_sim.c
+@@ -940,9 +940,9 @@ int simItem(int itemID, int lagTime, int speed)
+ 	char outMsg[MSG_SIZE_MAX];
+ 	char *marker;
+ 	int msgSize;
+-	uint zone;
+-	uint cluster;
+-	uint node;
++	unsigned int zone;
++	unsigned int cluster;
++	unsigned int node;
+ 	char itemName[NAME_SIZE];
+ 	int haveItem;
+ 	int res;
+@@ -1134,9 +1134,9 @@ int simCust(int itemID, int lagTime, int waitTime, int speed, int taskID)
+ 	char msg[MSG_SIZE_MAX];
+ 	char *marker;
+ 	int msgSize;
+-	uint zone;
+-	uint cluster;
+-	uint node;
++	unsigned int zone;
++	unsigned int cluster;
++	unsigned int node;
+ 	char custName[NAME_SIZE];
+ 	int transactionID;
+ 	int needItem;
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils_2.2.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils_2.2.0.bb
deleted file mode 100644
index 5c5b289..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils_2.2.0.bb
+++ /dev/null
@@ -1,45 +0,0 @@
-SUMMARY = "Transparent Inter-Process Communication protocol"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://tipclog/tipc.h;endline=35;md5=985b6ea8735818511d276c1b466cce98"
-
-SRC_URI = "git://tipc.git.sourceforge.net/gitroot/tipc/tipcutils"
-SRCREV = "dc8c2d324cda2e80a6e07ee1998fca0839d4a721"
-
-DEPENDS="virtual/kernel"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-inherit autotools pkgconfig
-
-DEPENDS += "libdaemon"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
-    ( cd ${S}; ${S}/bootstrap )
-}
-
-do_install_append() {
-    demos="benchmark hello_world topology_subscr_demo connection_demo \
-           multicast_demo stream_demo"
-    for i in $demos;do
-        install -d ${D}/opt/tipcutils/demos/$i
-        install ${B}/demos/$i/client_tipc ${D}/opt/tipcutils/demos/$i/
-        install ${B}/demos/$i/server_tipc ${D}/opt/tipcutils/demos/$i/
-    done
-    install -d ${D}/opt/tipcutils/demos/inventory_sim
-    install ${B}/demos/inventory_sim/inventory_sim ${D}/opt/tipcutils/demos/inventory_sim/
-
-    install -d ${D}/opt/tipcutils/ptts
-    install ${B}/ptts/tipcTS ${D}/opt/tipcutils/ptts/
-    install ${B}/ptts/tipcTC ${D}/opt/tipcutils/ptts/
-
-    install -d ${D}${sysconfdir}
-    cp -R --no-dereference --preserve=mode,links -v ${S}/scripts/etc/* ${D}${sysconfdir}/
-    chown -R root:root ${D}${sysconfdir}
-}
-
-PACKAGES += "${PN}-demos"
-FILES_${PN}-dbg += "/opt/tipcutils/demos/*/.debug /opt/tipcutils/ptts/.debug"
-FILES_${PN}-demos = "/opt/tipcutils/*"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils_git.bb
new file mode 100644
index 0000000..b7157b4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/tipcutils/tipcutils_git.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Transparent Inter-Process Communication protocol"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://tipclog/tipc.h;endline=35;md5=985b6ea8735818511d276c1b466cce98"
+
+SRC_URI = "git://git.code.sf.net/p/tipc/tipcutils \
+           file://0001-include-sys-select.h-for-FD_-definitions.patch \
+           file://0002-replace-non-standard-uint-with-unsigned-int.patch \
+           "
+SRCREV = "7ab2211b87414ba240b0b2e4af219c1057c9cf9a"
+PV = "2.2.0+git${SRCPV}"
+
+DEPENDS="virtual/kernel"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit autotools pkgconfig
+
+DEPENDS += "libdaemon"
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend() {
+    ( cd ${S}; ${S}/bootstrap )
+}
+
+do_install_append() {
+    demos="benchmark hello_world topology_subscr_demo connection_demo \
+           multicast_demo stream_demo"
+    for i in $demos;do
+        install -d ${D}/opt/tipcutils/demos/$i
+        install ${B}/demos/$i/client_tipc ${D}/opt/tipcutils/demos/$i/
+        install ${B}/demos/$i/server_tipc ${D}/opt/tipcutils/demos/$i/
+    done
+    install -d ${D}/opt/tipcutils/demos/inventory_sim
+    install ${B}/demos/inventory_sim/inventory_sim ${D}/opt/tipcutils/demos/inventory_sim/
+
+    install -d ${D}/opt/tipcutils/ptts
+    install ${B}/ptts/tipcTS ${D}/opt/tipcutils/ptts/
+    install ${B}/ptts/tipcTC ${D}/opt/tipcutils/ptts/
+
+    install -d ${D}${sysconfdir}
+    cp -R --no-dereference --preserve=mode,links -v ${S}/scripts/etc/* ${D}${sysconfdir}/
+    chown -R root:root ${D}${sysconfdir}
+}
+
+PACKAGES += "${PN}-demos"
+FILES_${PN}-dbg += "/opt/tipcutils/demos/*/.debug /opt/tipcutils/ptts/.debug"
+FILES_${PN}-demos = "/opt/tipcutils/*"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/zlog/zlog_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/zlog/zlog_git.bb
new file mode 100644
index 0000000..51c746f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/zlog/zlog_git.bb
@@ -0,0 +1,19 @@
+DESCRIPTION = "Zlog is a pure C logging library"
+HOMEPAGE = "https://github.com/HardySimpson/zlog"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+PV = "1.2.12+git${SRCPV}"
+
+SRCREV = "13904dab2878aa2654d0c20fb8600a3dc5f2dd68"
+SRC_URI = "git://github.com/HardySimpson/zlog"
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig
+
+EXTRA_OEMAKE = "CC='${CC}' LD='${LD}'"
+
+do_install() {
+    oe_runmake install PREFIX=${D}${exec_prefix} INSTALL=install
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/atk/atkmm_2.22.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-gnome/atk/atkmm_2.22.7.bb
deleted file mode 100644
index 6f51e34..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-gnome/atk/atkmm_2.22.7.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-SUMMARY = "C++ bindings for the atk"
-SECTION = "libs"
-
-LICENSE = "LGPLv2.1 & GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1 \
-                    file://COPYING.tools;md5=751419260aa954499f7abaabaa882bbe"
-
-DEPENDS = "atk glibmm"
-
-inherit gnome autotools pkgconfig
-
-GNOME_COMPRESS_TYPE = "xz"
-
-SRC_URI[archive.md5sum] = "fec7db3fc47ba2e0c95d130ec865a236"
-SRC_URI[archive.sha256sum] = "bfbf846b409b4c5eb3a52fa32a13d86936021969406b3dcafd4dd05abd70f91b"
-
-EXTRA_OECONF = " --disable-documentation "
-
-FILES_${PN}-dev += "${libdir}/*/include ${libdir}/*/proc/m4"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/atk/atkmm_2.24.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-gnome/atk/atkmm_2.24.2.bb
new file mode 100644
index 0000000..30ac90a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-gnome/atk/atkmm_2.24.2.bb
@@ -0,0 +1,17 @@
+SUMMARY = "C++ bindings for the atk"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1 & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://COPYING.tools;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "atk glibmm"
+
+inherit gnome autotools pkgconfig
+
+SRC_URI[archive.md5sum] = "d53b60b0f1be597e86070954a49cf0c3"
+SRC_URI[archive.sha256sum] = "ff95385759e2af23828d4056356f25376cfabc41e690ac1df055371537e458bd"
+
+EXTRA_OECONF = " --disable-documentation "
+
+FILES_${PN}-dev += "${libdir}/*/include ${libdir}/*/proc/m4"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtk+/gtkmm_2.24.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtk+/gtkmm_2.24.3.bb
deleted file mode 100644
index f4e0865..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtk+/gtkmm_2.24.3.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-SUMMARY = "C++ bindings for the GTK+ toolkit"
-HOMEPAGE = "http://www.gtkmm.org/"
-SECTION = "libs"
-
-LICENSE = "LGPLv2.1 & GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
-                    file://COPYING.tools;md5=751419260aa954499f7abaabaa882bbe"
-
-DEPENDS = "atkmm pangomm glibmm gtk+ cairomm"
-
-inherit gnome autotools pkgconfig distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "x11"
-
-GNOME_COMPRESS_TYPE = "xz"
-
-SRC_URI[archive.md5sum] = "42fc5a3feeb33ea59b7660200e2a5465"
-SRC_URI[archive.sha256sum] = "c564a438677174b97d69dd70467cb03c933481006398dc9377417aa6abe02a39"
-
-EXTRA_OECONF = " --disable-documentation "
-
-FILES_${PN}-dev += "${libdir}/*/include ${libdir}/*/proc/m4"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtk+/gtkmm_2.24.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtk+/gtkmm_2.24.5.bb
new file mode 100644
index 0000000..195bb21
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtk+/gtkmm_2.24.5.bb
@@ -0,0 +1,22 @@
+SUMMARY = "C++ bindings for the GTK+ toolkit"
+HOMEPAGE = "http://www.gtkmm.org/"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1 & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
+                    file://COPYING.tools;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "atkmm pangomm glibmm gtk+ cairomm"
+
+inherit gnome autotools pkgconfig distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
+
+GNOME_COMPRESS_TYPE = "xz"
+
+SRC_URI[archive.md5sum] = "6c59ae8bbff48fad9132f23af347acf1"
+SRC_URI[archive.sha256sum] = "0680a53b7bf90b4e4bf444d1d89e6df41c777e0bacc96e9c09fc4dd2f5fe6b72"
+
+EXTRA_OECONF = " --disable-documentation "
+
+FILES_${PN}-dev += "${libdir}/*/include ${libdir}/*/proc/m4"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtkextra/gtkextra_3.0.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtkextra/gtkextra_3.0.5.bb
index 926eff7..34b7aa6 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtkextra/gtkextra_3.0.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtkextra/gtkextra_3.0.5.bb
@@ -16,4 +16,4 @@
 inherit autotools pkgconfig gobject-introspection
 
 # | ./.libs/libgtkextra-x11-3.0.so: error: undefined reference to 'roundint'
-PNBLACKLIST[gtkextra] ?= "BROKEN: Fails to build with gcc-5"
+PNBLACKLIST[gtkextra] ?= "BROKEN: Fails to build with gcc-5 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtkhtml2/gtkhtml2_svn.bb b/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtkhtml2/gtkhtml2_svn.bb
index cd22576..021b077 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtkhtml2/gtkhtml2_svn.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-gnome/gtkhtml2/gtkhtml2_svn.bb
@@ -37,3 +37,5 @@
 inherit pkgconfig autotools
 
 EXTRA_OECONF = " --disable-accessibility"
+
+PNBLACKLIST[gtkhtml2] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130633/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/libglade/libglade-2.6.4/0001-configure.in-remove-deprecated-GNOME_COMMON_INIT.patch b/import-layers/meta-openembedded/meta-oe/recipes-gnome/libglade/libglade-2.6.4/0001-configure.in-remove-deprecated-GNOME_COMMON_INIT.patch
new file mode 100644
index 0000000..4738274
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-gnome/libglade/libglade-2.6.4/0001-configure.in-remove-deprecated-GNOME_COMMON_INIT.patch
@@ -0,0 +1,30 @@
+From ceefcb19cebf8bc3d45ee502f8eabd3bc5bd0aac Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Sat, 11 Feb 2017 16:42:12 +0100
+Subject: [PATCH] configure.in: remove deprecated GNOME_COMMON_INIT
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.in | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 8905f1c..3901398 100644
+--- a/configure.in
++++ b/configure.in
+@@ -15,7 +15,6 @@ AC_CONFIG_HEADERS([config.h])
+ 
+ AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2])
+ 
+-GNOME_COMMON_INIT
+ 
+ if test "$enable_debug" != "no"; then
+   AC_DEFINE([DEBUG],[1],[enable use of LIBGLADE_DEBUG environment variable])
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/libglade/libglade_2.6.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-gnome/libglade/libglade_2.6.4.bb
index 8cd023a..fdb9f8a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-gnome/libglade/libglade_2.6.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-gnome/libglade/libglade_2.6.4.bb
@@ -15,17 +15,21 @@
 ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
 GNOME_COMPRESS_TYPE="bz2"
 
-SRC_URI += "file://glade-cruft.patch file://no-xml2.patch file://python_environment.patch"
+SRC_URI += " \
+    file://glade-cruft.patch \
+    file://no-xml2.patch \
+    file://python_environment.patch \
+    file://0001-configure.in-remove-deprecated-GNOME_COMMON_INIT.patch \
+"
 
 SRC_URI[archive.md5sum] = "d1776b40f4e166b5e9c107f1c8fe4139"
 SRC_URI[archive.sha256sum] = "64361e7647839d36ed8336d992fd210d3e8139882269bed47dc4674980165dec"
 
 EXTRA_OECONF += "--without-libxml2 --disable-gtk-doc"
 
-CFLAGS += "-lz"
+CFLAGS += "-lz -lgmodule-2.0"
 
 PACKAGES += " ${PN}-data"
 FILES_${PN} = "${libdir}/lib*.so.*"
 FILES_${PN}-data = "${datadir}/xml/libglade/glade-2.0.dtd"
 FILES_${PN}-dev += "${bindir}/libglade-convert"
-#RDEPENDS_${PN} = "${PN}-data"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/libunique/libunique/0001-test-unique-Add-format-qualifier-s-for-string.patch b/import-layers/meta-openembedded/meta-oe/recipes-gnome/libunique/libunique/0001-test-unique-Add-format-qualifier-s-for-string.patch
new file mode 100644
index 0000000..7f9fdf3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-gnome/libunique/libunique/0001-test-unique-Add-format-qualifier-s-for-string.patch
@@ -0,0 +1,32 @@
+From 37632aca00d48c53e91f08bc7435c721ba81b2cd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 30 Mar 2017 14:32:55 -0700
+Subject: [PATCH] test-unique: Add format qualifier %s for string
+
+Fixes potential security issues that compiler flags
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/test-unique.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test-unique.c b/tests/test-unique.c
+index b7cde45..82ee81b 100644
+--- a/tests/test-unique.c
++++ b/tests/test-unique.c
+@@ -82,10 +82,10 @@ app_message_cb (UniqueApp         *app,
+                                    GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_INFO,
+                                    GTK_BUTTONS_CLOSE,
+-                                   title);
++                                   "%s",title);
+   if (message)
+     gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+-                                              message);
++                                              "%s",message);
+ 
+   gtk_window_set_urgency_hint (GTK_WINDOW (dialog), TRUE);
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/libunique/libunique_1.1.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-gnome/libunique/libunique_1.1.6.bb
index 3018398..9133ccc 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-gnome/libunique/libunique_1.1.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-gnome/libunique/libunique_1.1.6.bb
@@ -4,18 +4,19 @@
 BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=libunique"
 
 SRC_URI = "${GNOME_MIRROR}/libunique/1.1/libunique-${PV}.tar.bz2 \
-    file://fix_for_compile_with_gcc-4.6.0.patch \
-    file://noconst.patch \
-    file://build.patch \
-    file://0001-Makefile.am-use-LIBTOOL-instead-of-hardcoded-libtool.patch \
-"
+           file://fix_for_compile_with_gcc-4.6.0.patch \
+           file://noconst.patch \
+           file://build.patch \
+           file://0001-Makefile.am-use-LIBTOOL-instead-of-hardcoded-libtool.patch \
+           file://0001-test-unique-Add-format-qualifier-s-for-string.patch \
+           "
 
 SRC_URI[md5sum] = "7955769ef31f1bc4f83446dbb3625e6d"
 SRC_URI[sha256sum] = "e5c8041cef8e33c55732f06a292381cb345db946cf792a4ae18aa5c66cdd4fbb"
 
 PR = "r7"
 
-DEPENDS = "glib-2.0 gtk+"
+DEPENDS = "dbus-glib-native glib-2.0 gtk+"
 
 PACKAGECONFIG ??= "dbus"
 PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus dbus-glib"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-gnome/vte9/vte9.inc b/import-layers/meta-openembedded/meta-oe/recipes-gnome/vte9/vte9.inc
index 6a5c63c..206c430 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-gnome/vte9/vte9.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-gnome/vte9/vte9.inc
@@ -1,7 +1,7 @@
 SUMMARY = "Virtual terminal emulator GTK+ widget library"
 BUGTRACKER = "https://bugzilla.gnome.org/buglist.cgi?product=vte"
 LICENSE = "LGPLv2.0"
-DEPENDS = " glib-2.0 gtk+ intltool-native ncurses"
+DEPENDS = " glib-2.0 gtk+ intltool-native gnome-common-native ncurses"
 RDEPENDS_libvte = "vte-termcap"
 
 # help gnomebase get the SRC_URI correct
@@ -16,4 +16,3 @@
 PACKAGES =+ "libvte9 vte9-termcap"
 FILES_libvte9 = "${libdir}/*.so.* ${libexecdir}/gnome-pty-helper"
 FILES_vte9-termcap = "${datadir}/vte/termcap-0.0"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/assimp/assimp_3.1.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/assimp/assimp_3.1.1.bb
index 5ffa5c2..4da3dc2 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/assimp/assimp_3.1.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/assimp/assimp_3.1.1.bb
@@ -5,7 +5,7 @@
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=bc4231a2268da8fc55525ad119638a87"
 
-DEPENDS = "boost"
+DEPENDS = "boost virtual/libgl"
 
 SRC_URI = "http://sourceforge.net/projects/${BPN}/files/${BPN}-3.1/${BPN}-${PV}_no_test_models.zip"
 SRC_URI[md5sum] = "ccd4788204509da58a3a53c7aeda7a8b"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/cairo/cairomm_1.11.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/cairo/cairomm_1.11.2.bb
deleted file mode 100644
index a330458..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/cairo/cairomm_1.11.2.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-SUMMARY = "C++ bindings for Cairo graphics library"
-
-LICENSE = "LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=c46bda00ffbb0ba1dac22f8d087f54d9"
-
-inherit autotools pkgconfig
-
-DEPENDS = "cairo libsigc++-2.0"
-
-SRC_URI = "http://cairographics.org/releases/cairomm-${PV}.tar.gz;name=archive"
-SRC_URI[archive.md5sum] = "732a3ff5b57401eb5dfeef795a2a0c52"
-SRC_URI[archive.sha256sum] = "ccf677098c1e08e189add0bd146f78498109f202575491a82f1815b6bc28008d"
-
-FILES_${PN}-doc += "${datadir}/devhelp"
-FILES_${PN}-dev += "${libdir}/cairomm-*/"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/cairo/cairomm_1.12.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/cairo/cairomm_1.12.0.bb
new file mode 100644
index 0000000..d49a509
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/cairo/cairomm_1.12.0.bb
@@ -0,0 +1,15 @@
+SUMMARY = "C++ bindings for Cairo graphics library"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c46bda00ffbb0ba1dac22f8d087f54d9"
+
+inherit gnomebase
+
+DEPENDS = "cairo libsigc++-2.0"
+
+SRC_URI[archive.md5sum] = "c62b476b61bd0abf7e9851f417d73291"
+SRC_URI[archive.sha256sum] = "a54ada8394a86182525c0762e6f50db6b9212a2109280d13ec6a0b29bfd1afe6"
+
+FILES_${PN}-doc += "${datadir}/devhelp"
+FILES_${PN}-dev += "${libdir}/cairomm-*/"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/clutter/clutter-box2d_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/clutter/clutter-box2d_git.bb
index 194d104..d73e2f1 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/clutter/clutter-box2d_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/clutter/clutter-box2d_git.bb
@@ -5,7 +5,7 @@
 # 0.12.1+gitAUTOINC+de5452e56b-r1/git/clutter-box2d/clutter-box2d.h:226:47:
 #  fatal error: clutter-box2d/clutter-box2d-child.h: No such file or directory
 # |  #include <clutter-box2d/clutter-box2d-child.h>
-PNBLACKLIST[clutter-box2d] ?= "BROKEN: doesn't build with B!=S"
+PNBLACKLIST[clutter-box2d] ?= "BROKEN: doesn't build with B!=S - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRCREV = "de5452e56b537a11fd7f9453d048ff4b4793b5a2"
 PV = "0.12.1+git${SRCPV}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/directfb/directfb.inc b/import-layers/meta-openembedded/meta-oe/recipes-graphics/directfb/directfb.inc
index fc272bd..bfbd9c2 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/directfb/directfb.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/directfb/directfb.inc
@@ -51,6 +51,8 @@
   --disable-sdl \
   --disable-vnc \
   --disable-x11 \
+  --disable-x11vdpau \
+  --disable-xine-vdpau \
 "
 
 #Once -fno-omit-frame-pointer option of gcc is added into TARGET_CLFAGS as default
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbgrab/fbgrab_1.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbgrab/fbgrab_1.2.bb
deleted file mode 100644
index 1d87b86..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbgrab/fbgrab_1.2.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "FBGrab is a framebuffer screenshot program"
-HOMEPAGE = "http://fbgrab.monells.se/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a"
-SECTION = "console/utils"
-DEPENDS = "libpng zlib"
-SRC_URI = "http://fbgrab.monells.se/${BP}.tar.gz"
-
-inherit autotools-brokensep
-
-S = "${WORKDIR}/${BPN}"
-
-SRC_URI[md5sum] = "15b432735d6efd0373722bb96577b945"
-SRC_URI[sha256sum] = "61e0772ad6ea744ee597ae478398ddd0ba6fceee2cf343859bebde2c15bafb91"
-
-do_configure_prepend() {
-    sed -i 's|$(DESTDIR)/usr/man/|$(DESTDIR)${mandir}/|g' ${S}/Makefile
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbgrab/fbgrab_1.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbgrab/fbgrab_1.3.bb
new file mode 100644
index 0000000..e12bc09
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbgrab/fbgrab_1.3.bb
@@ -0,0 +1,16 @@
+SUMMARY = "FBGrab is a framebuffer screenshot program"
+HOMEPAGE = "http://fbgrab.monells.se/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a"
+SECTION = "console/utils"
+DEPENDS = "libpng zlib"
+SRC_URI = "http://fbgrab.monells.se/${BP}.tar.gz"
+
+inherit autotools-brokensep
+
+SRC_URI[md5sum] = "7d8c24081c681dfbba21f2934c1ac656"
+SRC_URI[sha256sum] = "5fab478cbf8731fbacefaa76236a8f8b38ccff920c53b3a8253bc35509fba8ed"
+
+do_configure_prepend() {
+    sed -i 's|$(DESTDIR)/usr/man/|$(DESTDIR)${mandir}/|g' ${S}/Makefile
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/fbida_2.10.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/fbida_2.10.bb
index c14fc9b..0bf48ac 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/fbida_2.10.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/fbida_2.10.bb
@@ -10,12 +10,19 @@
 
 DEPENDS = "virtual/libiconv jpeg fontconfig freetype libexif"
 
-SRC_URI = "https://www.kraxel.org/releases/fbida/fbida-${PV}.tar.gz"
+SRC_URI = "https://www.kraxel.org/releases/fbida/fbida-${PV}.tar.gz \
+	   file://0001-Avoid-using-host-path.patch \
+	   file://fix-preprocessor.patch \
+           file://support-jpeg-turbo.patch \
+           file://use-jpeg-turbo.patch \
+	   "
 SRC_URI[md5sum] = "09460b964b58c2e39b665498eca29018"
 SRC_URI[sha256sum] = "7a5a3aac61b40a6a2bbf716d270a46e2f8e8d5c97e314e927d41398a4d0b6cb6"
 
 B = "${WORKDIR}/build"
 
+inherit pkgconfig
+
 EXTRA_OEMAKE = "STRIP= 'srcdir=${S}' -f ${S}/GNUmakefile"
 
 PACKAGECONFIG ??= "gif png curl"
@@ -30,29 +37,29 @@
 do_compile() {
     sed -i -e 's# fbgs# \$(srcdir)/fbgs#; s#-Ijpeg#-I\$(srcdir)/jpeg#; s# jpeg/# \$(srcdir)/jpeg/#' ${S}/GNUmakefile
     sed -i -e 's:/sbin/ldconfig:echo x:' ${S}/mk/Autoconf.mk
-    sed -i -e 's: cpp: ${TARGET_PREFIX}cpp -I${STAGING_INCDIR}:' ${S}/GNUmakefile
+    sed -i -e 's: cpp: ${CPP}:' ${S}/GNUmakefile
 
     # Be sure to respect preferences (force to "no")
     # Also avoid issues when ${BUILD_ARCH} == ${HOST_ARCH}
-    if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'curl', 'curl', '', d)}" ]; then
+    if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'curl', d)}" ]; then
         sed -i -e '/^HAVE_LIBCURL/s/:=.*$/:= no/' ${S}/GNUmakefile
     fi
-    if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gif', 'gif', '', d)}" ]; then
+    if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'gif', d)}" ]; then
         sed -i -e '/^HAVE_LIBGIF/s/:=.*$/:= no/' ${S}/GNUmakefile
     fi
-    if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'png', 'png', '', d)}" ]; then
+    if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'png', d)}" ]; then
         sed -i -e '/^HAVE_LIBPNG/s/:=.*$/:= no/' ${S}/GNUmakefile
     fi
-    if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'tiff', 'tiff', '', d)}" ]; then
+    if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'tiff', d)}" ]; then
         sed -i -e '/^HAVE_LIBTIFF/s/:=.*$/:= no/' ${S}/GNUmakefile
     fi
-    if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'motif', 'motif', '', d)}" ]; then
+    if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'motif', d)}" ]; then
         sed -i -e '/^HAVE_MOTIF/s/:=.*$/:= no/' ${S}/GNUmakefile
     fi
-    if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'webp', 'webp', '', d)}" ]; then
+    if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'webp', d)}" ]; then
         sed -i -e '/^HAVE_LIBWEBP/s/:=.*$/:= no/' ${S}/GNUmakefile
     fi
-    if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'lirc', 'lirc', '', d)}" ]; then
+    if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'lirc', d)}" ]; then
         sed -i -e '/^HAVE_LIBLIRC/s/:=.*$/:= no/' ${S}/GNUmakefile
     fi
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/0001-Avoid-using-host-path.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/0001-Avoid-using-host-path.patch
new file mode 100644
index 0000000..cdf2c25
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/0001-Avoid-using-host-path.patch
@@ -0,0 +1,34 @@
+From 8d8fa9f22d9f6a95523bac63ac3af724faf5ff92 Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Fri, 7 Apr 2017 23:26:09 +0200
+Subject: [PATCH] Avoid using host-path
+
+Remove the explicit reference to /usr/local/* , this is completely
+bogus and causes trouble during cross-compilation.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Inappropriate [upstream requires this]
+---
+ mk/Variables.mk | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/mk/Variables.mk b/mk/Variables.mk
+index 99f787c..3ffd87a 100644
+--- a/mk/Variables.mk
++++ b/mk/Variables.mk
+@@ -42,12 +42,6 @@ CFLAGS		+= -Wall -Wmissing-prototypes -Wstrict-prototypes \
+ 		   -Wpointer-arith -Wunused
+ CXXFLAGS	+= -Wall -Wpointer-arith -Wunused
+ 
+-# add /usr/local to the search path if something is in there ...
+-ifneq ($(wildcard /usr/local/include/*.h),)
+-  CFLAGS  += -I/usr/local/include
+-  LDFLAGS += -L/usr/local/$(LIB)
+-endif
+-
+ # fixup include path for $(srcdir) != "."
+ ifneq ($(srcdir),.)
+   CFLAGS  += -I. -I$(srcdir)
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/fix-preprocessor.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/fix-preprocessor.patch
new file mode 100644
index 0000000..909a0a6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/fix-preprocessor.patch
@@ -0,0 +1,14 @@
+Index: fbida-2.13/GNUmakefile
+===================================================================
+--- fbida-2.13.orig/GNUmakefile
++++ fbida-2.13/GNUmakefile
+@@ -53,8 +53,7 @@ include $(srcdir)/mk/Autoconf.mk
+ 
+ ac_jpeg_ver = $(shell \
+ 	$(call ac_init,for libjpeg version);\
+-	$(call ac_s_cmd,echo JPEG_LIB_VERSION \
+-		| cpp -include jpeglib.h | tail -n 1);\
++	$(call ac_s_cmd,cpp -include jpeglib.h -dM -E -x c /dev/null  | grep 'define JPEG_LIB_VERSION' | cut -f 3 -d' ');\
+ 	$(call ac_fini))
+ 
+ define make-config
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/support-jpeg-turbo.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/support-jpeg-turbo.patch
new file mode 100644
index 0000000..05cd74d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/support-jpeg-turbo.patch
@@ -0,0 +1,1854 @@
+Add patch by Ondrej Sury to migrate to libjpeg-turbo (Closes: #763263)
+
+Index: fbida-2.10/jpeg/62/jpegcomp.h
+===================================================================
+--- /dev/null
++++ fbida-2.10/jpeg/62/jpegcomp.h
+@@ -0,0 +1,30 @@
++/*
++ * jpegcomp.h
++ *
++ * Copyright (C) 2010, D. R. Commander
++ * For conditions of distribution and use, see the accompanying README file.
++ *
++ * JPEG compatibility macros
++ * These declarations are considered internal to the JPEG library; most
++ * applications using the library shouldn't need to include this file.
++ */
++
++#if JPEG_LIB_VERSION >= 70
++#define _DCT_scaled_size DCT_h_scaled_size
++#define _DCT_h_scaled_size DCT_h_scaled_size
++#define _DCT_v_scaled_size DCT_v_scaled_size
++#define _min_DCT_scaled_size min_DCT_h_scaled_size
++#define _min_DCT_h_scaled_size min_DCT_h_scaled_size
++#define _min_DCT_v_scaled_size min_DCT_v_scaled_size
++#define _jpeg_width jpeg_width
++#define _jpeg_height jpeg_height
++#else
++#define _DCT_scaled_size DCT_scaled_size
++#define _DCT_h_scaled_size DCT_scaled_size
++#define _DCT_v_scaled_size DCT_scaled_size
++#define _min_DCT_scaled_size min_DCT_scaled_size
++#define _min_DCT_h_scaled_size min_DCT_scaled_size
++#define _min_DCT_v_scaled_size min_DCT_scaled_size
++#define _jpeg_width image_width
++#define _jpeg_height image_height
++#endif
+Index: fbida-2.10/jpeg/62/transupp.c
+===================================================================
+--- fbida-2.10.orig/jpeg/62/transupp.c
++++ fbida-2.10/jpeg/62/transupp.c
+@@ -1,8 +1,10 @@
+ /*
+  * transupp.c
+  *
+- * Copyright (C) 1997, Thomas G. Lane.
+- * This file is part of the Independent JPEG Group's software.
++ * This file was part of the Independent JPEG Group's software:
++ * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.
++ * libjpeg-turbo Modifications:
++ * Copyright (C) 2010, D. R. Commander.
+  * For conditions of distribution and use, see the accompanying README file.
+  *
+  * This file contains image transformation routines and other utility code
+@@ -20,6 +22,17 @@
+ #include "jinclude.h"
+ #include "jpeglib.h"
+ #include "transupp.h"		/* My own external interface */
++#include "jpegcomp.h"
++#include <ctype.h>		/* to declare isdigit() */
++
++
++#if JPEG_LIB_VERSION >= 70
++#define dstinfo_min_DCT_h_scaled_size dstinfo->min_DCT_h_scaled_size
++#define dstinfo_min_DCT_v_scaled_size dstinfo->min_DCT_v_scaled_size
++#else
++#define dstinfo_min_DCT_h_scaled_size DCTSIZE
++#define dstinfo_min_DCT_v_scaled_size DCTSIZE
++#endif
+ 
+ 
+ #if TRANSFORMS_SUPPORTED
+@@ -28,7 +41,8 @@
+  * Lossless image transformation routines.  These routines work on DCT
+  * coefficient arrays and thus do not require any lossy decompression
+  * or recompression of the image.
+- * Thanks to Guido Vollbeding for the initial design and code of this feature.
++ * Thanks to Guido Vollbeding for the initial design and code of this feature,
++ * and to Ben Jackson for introducing the cropping feature.
+  *
+  * Horizontal flipping is done in-place, using a single top-to-bottom
+  * pass through the virtual source array.  It will thus be much the
+@@ -42,6 +56,13 @@
+  * arrays for most of the transforms.  That could result in much thrashing
+  * if the image is larger than main memory.
+  *
++ * If cropping or trimming is involved, the destination arrays may be smaller
++ * than the source arrays.  Note it is not possible to do horizontal flip
++ * in-place when a nonzero Y crop offset is specified, since we'd have to move
++ * data from one block row to another but the virtual array manager doesn't
++ * guarantee we can touch more than one row at a time.  So in that case,
++ * we have to use a separate destination array.
++ *
+  * Some notes about the operating environment of the individual transform
+  * routines:
+  * 1. Both the source and destination virtual arrays are allocated from the
+@@ -54,20 +75,65 @@
+  *    and we may as well take that as the effective iMCU size.
+  * 4. When "trim" is in effect, the destination's dimensions will be the
+  *    trimmed values but the source's will be untrimmed.
+- * 5. All the routines assume that the source and destination buffers are
++ * 5. When "crop" is in effect, the destination's dimensions will be the
++ *    cropped values but the source's will be uncropped.  Each transform
++ *    routine is responsible for picking up source data starting at the
++ *    correct X and Y offset for the crop region.  (The X and Y offsets
++ *    passed to the transform routines are measured in iMCU blocks of the
++ *    destination.)
++ * 6. All the routines assume that the source and destination buffers are
+  *    padded out to a full iMCU boundary.  This is true, although for the
+  *    source buffer it is an undocumented property of jdcoefct.c.
+- * Notes 2,3,4 boil down to this: generally we should use the destination's
+- * dimensions and ignore the source's.
+  */
+ 
+ 
+ LOCAL(void)
+-do_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+-	   jvirt_barray_ptr *src_coef_arrays)
+-/* Horizontal flip; done in-place, so no separate dest array is required */
++do_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
++	 JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
++	 jvirt_barray_ptr *src_coef_arrays,
++	 jvirt_barray_ptr *dst_coef_arrays)
++/* Crop.  This is only used when no rotate/flip is requested with the crop. */
++{
++  JDIMENSION dst_blk_y, x_crop_blocks, y_crop_blocks;
++  int ci, offset_y;
++  JBLOCKARRAY src_buffer, dst_buffer;
++  jpeg_component_info *compptr;
++
++  /* We simply have to copy the right amount of data (the destination's
++   * image size) starting at the given X and Y offsets in the source.
++   */
++  for (ci = 0; ci < dstinfo->num_components; ci++) {
++    compptr = dstinfo->comp_info + ci;
++    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
++    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
++    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
++	 dst_blk_y += compptr->v_samp_factor) {
++      dst_buffer = (*srcinfo->mem->access_virt_barray)
++	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
++	 (JDIMENSION) compptr->v_samp_factor, TRUE);
++      src_buffer = (*srcinfo->mem->access_virt_barray)
++	((j_common_ptr) srcinfo, src_coef_arrays[ci],
++	 dst_blk_y + y_crop_blocks,
++	 (JDIMENSION) compptr->v_samp_factor, FALSE);
++      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
++	jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
++			dst_buffer[offset_y],
++			compptr->width_in_blocks);
++      }
++    }
++  }
++}
++
++
++LOCAL(void)
++do_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
++		   JDIMENSION x_crop_offset,
++		   jvirt_barray_ptr *src_coef_arrays)
++/* Horizontal flip; done in-place, so no separate dest array is required.
++ * NB: this only works when y_crop_offset is zero.
++ */
+ {
+-  JDIMENSION MCU_cols, comp_width, blk_x, blk_y;
++  JDIMENSION MCU_cols, comp_width, blk_x, blk_y, x_crop_blocks;
+   int ci, k, offset_y;
+   JBLOCKARRAY buffer;
+   JCOEFPTR ptr1, ptr2;
+@@ -79,17 +145,20 @@ do_flip_h (j_decompress_ptr srcinfo, j_c
+    * mirroring by changing the signs of odd-numbered columns.
+    * Partial iMCUs at the right edge are left untouched.
+    */
+-  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
++  MCU_cols = srcinfo->output_width /
++    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+     comp_width = MCU_cols * compptr->h_samp_factor;
++    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
+     for (blk_y = 0; blk_y < compptr->height_in_blocks;
+ 	 blk_y += compptr->v_samp_factor) {
+       buffer = (*srcinfo->mem->access_virt_barray)
+ 	((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y,
+ 	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+       for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
++	/* Do the mirroring */
+ 	for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {
+ 	  ptr1 = buffer[offset_y][blk_x];
+ 	  ptr2 = buffer[offset_y][comp_width - blk_x - 1];
+@@ -105,6 +174,80 @@ do_flip_h (j_decompress_ptr srcinfo, j_c
+ 	    *ptr2++ = -temp1;
+ 	  }
+ 	}
++	if (x_crop_blocks > 0) {
++	  /* Now left-justify the portion of the data to be kept.
++	   * We can't use a single jcopy_block_row() call because that routine
++	   * depends on memcpy(), whose behavior is unspecified for overlapping
++	   * source and destination areas.  Sigh.
++	   */
++	  for (blk_x = 0; blk_x < compptr->width_in_blocks; blk_x++) {
++	    jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks,
++			    buffer[offset_y] + blk_x,
++			    (JDIMENSION) 1);
++	  }
++	}
++      }
++    }
++  }
++}
++
++
++LOCAL(void)
++do_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
++	   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
++	   jvirt_barray_ptr *src_coef_arrays,
++	   jvirt_barray_ptr *dst_coef_arrays)
++/* Horizontal flip in general cropping case */
++{
++  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
++  JDIMENSION x_crop_blocks, y_crop_blocks;
++  int ci, k, offset_y;
++  JBLOCKARRAY src_buffer, dst_buffer;
++  JBLOCKROW src_row_ptr, dst_row_ptr;
++  JCOEFPTR src_ptr, dst_ptr;
++  jpeg_component_info *compptr;
++
++  /* Here we must output into a separate array because we can't touch
++   * different rows of a single virtual array simultaneously.  Otherwise,
++   * this is essentially the same as the routine above.
++   */
++  MCU_cols = srcinfo->output_width /
++    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);
++
++  for (ci = 0; ci < dstinfo->num_components; ci++) {
++    compptr = dstinfo->comp_info + ci;
++    comp_width = MCU_cols * compptr->h_samp_factor;
++    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
++    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
++    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
++	 dst_blk_y += compptr->v_samp_factor) {
++      dst_buffer = (*srcinfo->mem->access_virt_barray)
++	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
++	 (JDIMENSION) compptr->v_samp_factor, TRUE);
++      src_buffer = (*srcinfo->mem->access_virt_barray)
++	((j_common_ptr) srcinfo, src_coef_arrays[ci],
++	 dst_blk_y + y_crop_blocks,
++	 (JDIMENSION) compptr->v_samp_factor, FALSE);
++      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
++	dst_row_ptr = dst_buffer[offset_y];
++	src_row_ptr = src_buffer[offset_y];
++	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
++	  if (x_crop_blocks + dst_blk_x < comp_width) {
++	    /* Do the mirrorable blocks */
++	    dst_ptr = dst_row_ptr[dst_blk_x];
++	    src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
++	    /* this unrolled loop doesn't need to know which row it's on... */
++	    for (k = 0; k < DCTSIZE2; k += 2) {
++	      *dst_ptr++ = *src_ptr++;	 /* copy even column */
++	      *dst_ptr++ = - *src_ptr++; /* copy odd column with sign change */
++	    }
++	  } else {
++	    /* Copy last partial block(s) verbatim */
++	    jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
++			    dst_row_ptr + dst_blk_x,
++			    (JDIMENSION) 1);
++	  }
++	}
+       }
+     }
+   }
+@@ -113,11 +256,13 @@ do_flip_h (j_decompress_ptr srcinfo, j_c
+ 
+ LOCAL(void)
+ do_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
++	   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+ 	   jvirt_barray_ptr *src_coef_arrays,
+ 	   jvirt_barray_ptr *dst_coef_arrays)
+ /* Vertical flip */
+ {
+   JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
++  JDIMENSION x_crop_blocks, y_crop_blocks;
+   int ci, i, j, offset_y;
+   JBLOCKARRAY src_buffer, dst_buffer;
+   JBLOCKROW src_row_ptr, dst_row_ptr;
+@@ -131,33 +276,39 @@ do_flip_v (j_decompress_ptr srcinfo, j_c
+    * of odd-numbered rows.
+    * Partial iMCUs at the bottom edge are copied verbatim.
+    */
+-  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
++  MCU_rows = srcinfo->output_height /
++    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+     comp_height = MCU_rows * compptr->v_samp_factor;
++    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
++    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+     for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+ 	 dst_blk_y += compptr->v_samp_factor) {
+       dst_buffer = (*srcinfo->mem->access_virt_barray)
+ 	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+ 	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+-      if (dst_blk_y < comp_height) {
++      if (y_crop_blocks + dst_blk_y < comp_height) {
+ 	/* Row is within the mirrorable area. */
+ 	src_buffer = (*srcinfo->mem->access_virt_barray)
+ 	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+-	   comp_height - dst_blk_y - (JDIMENSION) compptr->v_samp_factor,
++	   comp_height - y_crop_blocks - dst_blk_y -
++	   (JDIMENSION) compptr->v_samp_factor,
+ 	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+       } else {
+ 	/* Bottom-edge blocks will be copied verbatim. */
+ 	src_buffer = (*srcinfo->mem->access_virt_barray)
+-	  ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_y,
++	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
++	   dst_blk_y + y_crop_blocks,
+ 	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+       }
+       for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+-	if (dst_blk_y < comp_height) {
++	if (y_crop_blocks + dst_blk_y < comp_height) {
+ 	  /* Row is within the mirrorable area. */
+ 	  dst_row_ptr = dst_buffer[offset_y];
+ 	  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
++	  src_row_ptr += x_crop_blocks;
+ 	  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+ 	       dst_blk_x++) {
+ 	    dst_ptr = dst_row_ptr[dst_blk_x];
+@@ -173,7 +324,8 @@ do_flip_v (j_decompress_ptr srcinfo, j_c
+ 	  }
+ 	} else {
+ 	  /* Just copy row verbatim. */
+-	  jcopy_block_row(src_buffer[offset_y], dst_buffer[offset_y],
++	  jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
++			  dst_buffer[offset_y],
+ 			  compptr->width_in_blocks);
+ 	}
+       }
+@@ -184,11 +336,12 @@ do_flip_v (j_decompress_ptr srcinfo, j_c
+ 
+ LOCAL(void)
+ do_transpose (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
++	      JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+ 	      jvirt_barray_ptr *src_coef_arrays,
+ 	      jvirt_barray_ptr *dst_coef_arrays)
+ /* Transpose source into destination */
+ {
+-  JDIMENSION dst_blk_x, dst_blk_y;
++  JDIMENSION dst_blk_x, dst_blk_y, x_crop_blocks, y_crop_blocks;
+   int ci, i, j, offset_x, offset_y;
+   JBLOCKARRAY src_buffer, dst_buffer;
+   JCOEFPTR src_ptr, dst_ptr;
+@@ -201,6 +354,8 @@ do_transpose (j_decompress_ptr srcinfo,
+    */
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
++    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
++    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+     for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+ 	 dst_blk_y += compptr->v_samp_factor) {
+       dst_buffer = (*srcinfo->mem->access_virt_barray)
+@@ -210,11 +365,12 @@ do_transpose (j_decompress_ptr srcinfo,
+ 	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+ 	     dst_blk_x += compptr->h_samp_factor) {
+ 	  src_buffer = (*srcinfo->mem->access_virt_barray)
+-	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
++	    ((j_common_ptr) srcinfo, src_coef_arrays[ci],
++	     dst_blk_x + x_crop_blocks,
+ 	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+ 	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+-	    src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+ 	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
++	    src_ptr = src_buffer[offset_x][dst_blk_y + offset_y + y_crop_blocks];
+ 	    for (i = 0; i < DCTSIZE; i++)
+ 	      for (j = 0; j < DCTSIZE; j++)
+ 		dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+@@ -228,6 +384,7 @@ do_transpose (j_decompress_ptr srcinfo,
+ 
+ LOCAL(void)
+ do_rot_90 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
++	   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+ 	   jvirt_barray_ptr *src_coef_arrays,
+ 	   jvirt_barray_ptr *dst_coef_arrays)
+ /* 90 degree rotation is equivalent to
+@@ -237,6 +394,7 @@ do_rot_90 (j_decompress_ptr srcinfo, j_c
+  */
+ {
+   JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;
++  JDIMENSION x_crop_blocks, y_crop_blocks;
+   int ci, i, j, offset_x, offset_y;
+   JBLOCKARRAY src_buffer, dst_buffer;
+   JCOEFPTR src_ptr, dst_ptr;
+@@ -246,11 +404,14 @@ do_rot_90 (j_decompress_ptr srcinfo, j_c
+    * at the (output) right edge properly.  They just get transposed and
+    * not mirrored.
+    */
+-  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
++  MCU_cols = srcinfo->output_height /
++    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+     comp_width = MCU_cols * compptr->h_samp_factor;
++    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
++    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+     for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+ 	 dst_blk_y += compptr->v_samp_factor) {
+       dst_buffer = (*srcinfo->mem->access_virt_barray)
+@@ -259,15 +420,26 @@ do_rot_90 (j_decompress_ptr srcinfo, j_c
+       for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+ 	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+ 	     dst_blk_x += compptr->h_samp_factor) {
+-	  src_buffer = (*srcinfo->mem->access_virt_barray)
+-	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
+-	     (JDIMENSION) compptr->h_samp_factor, FALSE);
++	  if (x_crop_blocks + dst_blk_x < comp_width) {
++	    /* Block is within the mirrorable area. */
++	    src_buffer = (*srcinfo->mem->access_virt_barray)
++	      ((j_common_ptr) srcinfo, src_coef_arrays[ci],
++	       comp_width - x_crop_blocks - dst_blk_x -
++	       (JDIMENSION) compptr->h_samp_factor,
++	       (JDIMENSION) compptr->h_samp_factor, FALSE);
++	  } else {
++	    /* Edge blocks are transposed but not mirrored. */
++	    src_buffer = (*srcinfo->mem->access_virt_barray)
++	      ((j_common_ptr) srcinfo, src_coef_arrays[ci],
++	       dst_blk_x + x_crop_blocks,
++	       (JDIMENSION) compptr->h_samp_factor, FALSE);
++	  }
+ 	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+-	    src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+-	    if (dst_blk_x < comp_width) {
++	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
++	    if (x_crop_blocks + dst_blk_x < comp_width) {
+ 	      /* Block is within the mirrorable area. */
+-	      dst_ptr = dst_buffer[offset_y]
+-		[comp_width - dst_blk_x - offset_x - 1];
++	      src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]
++		[dst_blk_y + offset_y + y_crop_blocks];
+ 	      for (i = 0; i < DCTSIZE; i++) {
+ 		for (j = 0; j < DCTSIZE; j++)
+ 		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+@@ -277,7 +449,8 @@ do_rot_90 (j_decompress_ptr srcinfo, j_c
+ 	      }
+ 	    } else {
+ 	      /* Edge blocks are transposed but not mirrored. */
+-	      dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
++	      src_ptr = src_buffer[offset_x]
++		[dst_blk_y + offset_y + y_crop_blocks];
+ 	      for (i = 0; i < DCTSIZE; i++)
+ 		for (j = 0; j < DCTSIZE; j++)
+ 		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+@@ -292,6 +465,7 @@ do_rot_90 (j_decompress_ptr srcinfo, j_c
+ 
+ LOCAL(void)
+ do_rot_270 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
++	    JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+ 	    jvirt_barray_ptr *src_coef_arrays,
+ 	    jvirt_barray_ptr *dst_coef_arrays)
+ /* 270 degree rotation is equivalent to
+@@ -301,6 +475,7 @@ do_rot_270 (j_decompress_ptr srcinfo, j_
+  */
+ {
+   JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;
++  JDIMENSION x_crop_blocks, y_crop_blocks;
+   int ci, i, j, offset_x, offset_y;
+   JBLOCKARRAY src_buffer, dst_buffer;
+   JCOEFPTR src_ptr, dst_ptr;
+@@ -310,11 +485,14 @@ do_rot_270 (j_decompress_ptr srcinfo, j_
+    * at the (output) bottom edge properly.  They just get transposed and
+    * not mirrored.
+    */
+-  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
++  MCU_rows = srcinfo->output_width /
++    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+     comp_height = MCU_rows * compptr->v_samp_factor;
++    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
++    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+     for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+ 	 dst_blk_y += compptr->v_samp_factor) {
+       dst_buffer = (*srcinfo->mem->access_virt_barray)
+@@ -324,14 +502,15 @@ do_rot_270 (j_decompress_ptr srcinfo, j_
+ 	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+ 	     dst_blk_x += compptr->h_samp_factor) {
+ 	  src_buffer = (*srcinfo->mem->access_virt_barray)
+-	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
++	    ((j_common_ptr) srcinfo, src_coef_arrays[ci],
++	     dst_blk_x + x_crop_blocks,
+ 	     (JDIMENSION) compptr->h_samp_factor, FALSE);
+ 	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+ 	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
+-	    if (dst_blk_y < comp_height) {
++	    if (y_crop_blocks + dst_blk_y < comp_height) {
+ 	      /* Block is within the mirrorable area. */
+ 	      src_ptr = src_buffer[offset_x]
+-		[comp_height - dst_blk_y - offset_y - 1];
++		[comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
+ 	      for (i = 0; i < DCTSIZE; i++) {
+ 		for (j = 0; j < DCTSIZE; j++) {
+ 		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+@@ -341,7 +520,8 @@ do_rot_270 (j_decompress_ptr srcinfo, j_
+ 	      }
+ 	    } else {
+ 	      /* Edge blocks are transposed but not mirrored. */
+-	      src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
++	      src_ptr = src_buffer[offset_x]
++		[dst_blk_y + offset_y + y_crop_blocks];
+ 	      for (i = 0; i < DCTSIZE; i++)
+ 		for (j = 0; j < DCTSIZE; j++)
+ 		  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+@@ -356,6 +536,7 @@ do_rot_270 (j_decompress_ptr srcinfo, j_
+ 
+ LOCAL(void)
+ do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
++	    JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+ 	    jvirt_barray_ptr *src_coef_arrays,
+ 	    jvirt_barray_ptr *dst_coef_arrays)
+ /* 180 degree rotation is equivalent to
+@@ -365,89 +546,95 @@ do_rot_180 (j_decompress_ptr srcinfo, j_
+  */
+ {
+   JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
++  JDIMENSION x_crop_blocks, y_crop_blocks;
+   int ci, i, j, offset_y;
+   JBLOCKARRAY src_buffer, dst_buffer;
+   JBLOCKROW src_row_ptr, dst_row_ptr;
+   JCOEFPTR src_ptr, dst_ptr;
+   jpeg_component_info *compptr;
+ 
+-  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+-  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
++  MCU_cols = srcinfo->output_width /
++    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);
++  MCU_rows = srcinfo->output_height /
++    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+     comp_width = MCU_cols * compptr->h_samp_factor;
+     comp_height = MCU_rows * compptr->v_samp_factor;
++    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
++    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+     for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+ 	 dst_blk_y += compptr->v_samp_factor) {
+       dst_buffer = (*srcinfo->mem->access_virt_barray)
+ 	((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,
+ 	 (JDIMENSION) compptr->v_samp_factor, TRUE);
+-      if (dst_blk_y < comp_height) {
++      if (y_crop_blocks + dst_blk_y < comp_height) {
+ 	/* Row is within the vertically mirrorable area. */
+ 	src_buffer = (*srcinfo->mem->access_virt_barray)
+ 	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
+-	   comp_height - dst_blk_y - (JDIMENSION) compptr->v_samp_factor,
++	   comp_height - y_crop_blocks - dst_blk_y -
++	   (JDIMENSION) compptr->v_samp_factor,
+ 	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+       } else {
+ 	/* Bottom-edge rows are only mirrored horizontally. */
+ 	src_buffer = (*srcinfo->mem->access_virt_barray)
+-	  ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_y,
++	  ((j_common_ptr) srcinfo, src_coef_arrays[ci],
++	   dst_blk_y + y_crop_blocks,
+ 	   (JDIMENSION) compptr->v_samp_factor, FALSE);
+       }
+       for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+-	if (dst_blk_y < comp_height) {
++	dst_row_ptr = dst_buffer[offset_y];
++	if (y_crop_blocks + dst_blk_y < comp_height) {
+ 	  /* Row is within the mirrorable area. */
+-	  dst_row_ptr = dst_buffer[offset_y];
+ 	  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];
+-	  /* Process the blocks that can be mirrored both ways. */
+-	  for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++) {
++	  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
+ 	    dst_ptr = dst_row_ptr[dst_blk_x];
+-	    src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
+-	    for (i = 0; i < DCTSIZE; i += 2) {
+-	      /* For even row, negate every odd column. */
+-	      for (j = 0; j < DCTSIZE; j += 2) {
+-		*dst_ptr++ = *src_ptr++;
+-		*dst_ptr++ = - *src_ptr++;
++	    if (x_crop_blocks + dst_blk_x < comp_width) {
++	      /* Process the blocks that can be mirrored both ways. */
++	      src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
++	      for (i = 0; i < DCTSIZE; i += 2) {
++		/* For even row, negate every odd column. */
++		for (j = 0; j < DCTSIZE; j += 2) {
++		  *dst_ptr++ = *src_ptr++;
++		  *dst_ptr++ = - *src_ptr++;
++		}
++		/* For odd row, negate every even column. */
++		for (j = 0; j < DCTSIZE; j += 2) {
++		  *dst_ptr++ = - *src_ptr++;
++		  *dst_ptr++ = *src_ptr++;
++		}
+ 	      }
+-	      /* For odd row, negate every even column. */
+-	      for (j = 0; j < DCTSIZE; j += 2) {
+-		*dst_ptr++ = - *src_ptr++;
+-		*dst_ptr++ = *src_ptr++;
++	    } else {
++	      /* Any remaining right-edge blocks are only mirrored vertically. */
++	      src_ptr = src_row_ptr[x_crop_blocks + dst_blk_x];
++	      for (i = 0; i < DCTSIZE; i += 2) {
++		for (j = 0; j < DCTSIZE; j++)
++		  *dst_ptr++ = *src_ptr++;
++		for (j = 0; j < DCTSIZE; j++)
++		  *dst_ptr++ = - *src_ptr++;
+ 	      }
+ 	    }
+ 	  }
+-	  /* Any remaining right-edge blocks are only mirrored vertically. */
+-	  for (; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
+-	    dst_ptr = dst_row_ptr[dst_blk_x];
+-	    src_ptr = src_row_ptr[dst_blk_x];
+-	    for (i = 0; i < DCTSIZE; i += 2) {
+-	      for (j = 0; j < DCTSIZE; j++)
+-		*dst_ptr++ = *src_ptr++;
+-	      for (j = 0; j < DCTSIZE; j++)
+-		*dst_ptr++ = - *src_ptr++;
+-	    }
+-	  }
+ 	} else {
+ 	  /* Remaining rows are just mirrored horizontally. */
+-	  dst_row_ptr = dst_buffer[offset_y];
+ 	  src_row_ptr = src_buffer[offset_y];
+-	  /* Process the blocks that can be mirrored. */
+-	  for (dst_blk_x = 0; dst_blk_x < comp_width; dst_blk_x++) {
+-	    dst_ptr = dst_row_ptr[dst_blk_x];
+-	    src_ptr = src_row_ptr[comp_width - dst_blk_x - 1];
+-	    for (i = 0; i < DCTSIZE2; i += 2) {
+-	      *dst_ptr++ = *src_ptr++;
+-	      *dst_ptr++ = - *src_ptr++;
++	  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
++	    if (x_crop_blocks + dst_blk_x < comp_width) {
++	      /* Process the blocks that can be mirrored. */
++	      dst_ptr = dst_row_ptr[dst_blk_x];
++	      src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];
++	      for (i = 0; i < DCTSIZE2; i += 2) {
++		*dst_ptr++ = *src_ptr++;
++		*dst_ptr++ = - *src_ptr++;
++	      }
++	    } else {
++	      /* Any remaining right-edge blocks are only copied. */
++	      jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
++			      dst_row_ptr + dst_blk_x,
++			      (JDIMENSION) 1);
+ 	    }
+ 	  }
+-	  /* Any remaining right-edge blocks are only copied. */
+-	  for (; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {
+-	    dst_ptr = dst_row_ptr[dst_blk_x];
+-	    src_ptr = src_row_ptr[dst_blk_x];
+-	    for (i = 0; i < DCTSIZE2; i++)
+-	      *dst_ptr++ = *src_ptr++;
+-	  }
+ 	}
+       }
+     }
+@@ -457,6 +644,7 @@ do_rot_180 (j_decompress_ptr srcinfo, j_
+ 
+ LOCAL(void)
+ do_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
++	       JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,
+ 	       jvirt_barray_ptr *src_coef_arrays,
+ 	       jvirt_barray_ptr *dst_coef_arrays)
+ /* Transverse transpose is equivalent to
+@@ -470,18 +658,23 @@ do_transverse (j_decompress_ptr srcinfo,
+  */
+ {
+   JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;
++  JDIMENSION x_crop_blocks, y_crop_blocks;
+   int ci, i, j, offset_x, offset_y;
+   JBLOCKARRAY src_buffer, dst_buffer;
+   JCOEFPTR src_ptr, dst_ptr;
+   jpeg_component_info *compptr;
+ 
+-  MCU_cols = dstinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+-  MCU_rows = dstinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
++  MCU_cols = srcinfo->output_height /
++    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);
++  MCU_rows = srcinfo->output_width /
++    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+     comp_width = MCU_cols * compptr->h_samp_factor;
+     comp_height = MCU_rows * compptr->v_samp_factor;
++    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;
++    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;
+     for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;
+ 	 dst_blk_y += compptr->v_samp_factor) {
+       dst_buffer = (*srcinfo->mem->access_virt_barray)
+@@ -490,17 +683,26 @@ do_transverse (j_decompress_ptr srcinfo,
+       for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
+ 	for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;
+ 	     dst_blk_x += compptr->h_samp_factor) {
+-	  src_buffer = (*srcinfo->mem->access_virt_barray)
+-	    ((j_common_ptr) srcinfo, src_coef_arrays[ci], dst_blk_x,
+-	     (JDIMENSION) compptr->h_samp_factor, FALSE);
++	  if (x_crop_blocks + dst_blk_x < comp_width) {
++	    /* Block is within the mirrorable area. */
++	    src_buffer = (*srcinfo->mem->access_virt_barray)
++	      ((j_common_ptr) srcinfo, src_coef_arrays[ci],
++	       comp_width - x_crop_blocks - dst_blk_x -
++	       (JDIMENSION) compptr->h_samp_factor,
++	       (JDIMENSION) compptr->h_samp_factor, FALSE);
++	  } else {
++	    src_buffer = (*srcinfo->mem->access_virt_barray)
++	      ((j_common_ptr) srcinfo, src_coef_arrays[ci],
++	       dst_blk_x + x_crop_blocks,
++	       (JDIMENSION) compptr->h_samp_factor, FALSE);
++	  }
+ 	  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {
+-	    if (dst_blk_y < comp_height) {
+-	      src_ptr = src_buffer[offset_x]
+-		[comp_height - dst_blk_y - offset_y - 1];
+-	      if (dst_blk_x < comp_width) {
++	    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
++	    if (y_crop_blocks + dst_blk_y < comp_height) {
++	      if (x_crop_blocks + dst_blk_x < comp_width) {
+ 		/* Block is within the mirrorable area. */
+-		dst_ptr = dst_buffer[offset_y]
+-		  [comp_width - dst_blk_x - offset_x - 1];
++		src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]
++		  [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
+ 		for (i = 0; i < DCTSIZE; i++) {
+ 		  for (j = 0; j < DCTSIZE; j++) {
+ 		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+@@ -516,7 +718,8 @@ do_transverse (j_decompress_ptr srcinfo,
+ 		}
+ 	      } else {
+ 		/* Right-edge blocks are mirrored in y only */
+-		dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
++		src_ptr = src_buffer[offset_x]
++		  [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];
+ 		for (i = 0; i < DCTSIZE; i++) {
+ 		  for (j = 0; j < DCTSIZE; j++) {
+ 		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+@@ -526,11 +729,10 @@ do_transverse (j_decompress_ptr srcinfo,
+ 		}
+ 	      }
+ 	    } else {
+-	      src_ptr = src_buffer[offset_x][dst_blk_y + offset_y];
+-	      if (dst_blk_x < comp_width) {
++	      if (x_crop_blocks + dst_blk_x < comp_width) {
+ 		/* Bottom-edge blocks are mirrored in x only */
+-		dst_ptr = dst_buffer[offset_y]
+-		  [comp_width - dst_blk_x - offset_x - 1];
++		src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]
++		  [dst_blk_y + offset_y + y_crop_blocks];
+ 		for (i = 0; i < DCTSIZE; i++) {
+ 		  for (j = 0; j < DCTSIZE; j++)
+ 		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+@@ -540,7 +742,8 @@ do_transverse (j_decompress_ptr srcinfo,
+ 		}
+ 	      } else {
+ 		/* At lower right corner, just transpose, no mirroring */
+-		dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];
++		src_ptr = src_buffer[offset_x]
++		  [dst_blk_y + offset_y + y_crop_blocks];
+ 		for (i = 0; i < DCTSIZE; i++)
+ 		  for (j = 0; j < DCTSIZE; j++)
+ 		    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];
+@@ -554,83 +757,372 @@ do_transverse (j_decompress_ptr srcinfo,
+ }
+ 
+ 
++/* Parse an unsigned integer: subroutine for jtransform_parse_crop_spec.
++ * Returns TRUE if valid integer found, FALSE if not.
++ * *strptr is advanced over the digit string, and *result is set to its value.
++ */
++
++LOCAL(boolean)
++jt_read_integer (const char ** strptr, JDIMENSION * result)
++{
++  const char * ptr = *strptr;
++  JDIMENSION val = 0;
++
++  for (; isdigit(*ptr); ptr++) {
++    val = val * 10 + (JDIMENSION) (*ptr - '0');
++  }
++  *result = val;
++  if (ptr == *strptr)
++    return FALSE;		/* oops, no digits */
++  *strptr = ptr;
++  return TRUE;
++}
++
++
++/* Parse a crop specification (written in X11 geometry style).
++ * The routine returns TRUE if the spec string is valid, FALSE if not.
++ *
++ * The crop spec string should have the format
++ *	<width>[f]x<height>[f]{+-}<xoffset>{+-}<yoffset>
++ * where width, height, xoffset, and yoffset are unsigned integers.
++ * Each of the elements can be omitted to indicate a default value.
++ * (A weakness of this style is that it is not possible to omit xoffset
++ * while specifying yoffset, since they look alike.)
++ *
++ * This code is loosely based on XParseGeometry from the X11 distribution.
++ */
++
++GLOBAL(boolean)
++jtransform_parse_crop_spec (jpeg_transform_info *info, const char *spec)
++{
++  info->crop = FALSE;
++  info->crop_width_set = JCROP_UNSET;
++  info->crop_height_set = JCROP_UNSET;
++  info->crop_xoffset_set = JCROP_UNSET;
++  info->crop_yoffset_set = JCROP_UNSET;
++
++  if (isdigit(*spec)) {
++    /* fetch width */
++    if (! jt_read_integer(&spec, &info->crop_width))
++      return FALSE;
++    if (*spec == 'f' || *spec == 'F') {
++      spec++;
++      info->crop_width_set = JCROP_FORCE;
++    } else
++      info->crop_width_set = JCROP_POS;
++  }
++  if (*spec == 'x' || *spec == 'X') {
++    /* fetch height */
++    spec++;
++    if (! jt_read_integer(&spec, &info->crop_height))
++      return FALSE;
++    if (*spec == 'f' || *spec == 'F') {
++      spec++;
++      info->crop_height_set = JCROP_FORCE;
++    } else
++      info->crop_height_set = JCROP_POS;
++  }
++  if (*spec == '+' || *spec == '-') {
++    /* fetch xoffset */
++    info->crop_xoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;
++    spec++;
++    if (! jt_read_integer(&spec, &info->crop_xoffset))
++      return FALSE;
++  }
++  if (*spec == '+' || *spec == '-') {
++    /* fetch yoffset */
++    info->crop_yoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;
++    spec++;
++    if (! jt_read_integer(&spec, &info->crop_yoffset))
++      return FALSE;
++  }
++  /* We had better have gotten to the end of the string. */
++  if (*spec != '\0')
++    return FALSE;
++  info->crop = TRUE;
++  return TRUE;
++}
++
++
++/* Trim off any partial iMCUs on the indicated destination edge */
++
++LOCAL(void)
++trim_right_edge (jpeg_transform_info *info, JDIMENSION full_width)
++{
++  JDIMENSION MCU_cols;
++
++  MCU_cols = info->output_width / info->iMCU_sample_width;
++  if (MCU_cols > 0 && info->x_crop_offset + MCU_cols ==
++      full_width / info->iMCU_sample_width)
++    info->output_width = MCU_cols * info->iMCU_sample_width;
++}
++
++LOCAL(void)
++trim_bottom_edge (jpeg_transform_info *info, JDIMENSION full_height)
++{
++  JDIMENSION MCU_rows;
++
++  MCU_rows = info->output_height / info->iMCU_sample_height;
++  if (MCU_rows > 0 && info->y_crop_offset + MCU_rows ==
++      full_height / info->iMCU_sample_height)
++    info->output_height = MCU_rows * info->iMCU_sample_height;
++}
++
++
+ /* Request any required workspace.
+  *
++ * This routine figures out the size that the output image will be
++ * (which implies that all the transform parameters must be set before
++ * it is called).
++ *
+  * We allocate the workspace virtual arrays from the source decompression
+  * object, so that all the arrays (both the original data and the workspace)
+  * will be taken into account while making memory management decisions.
+  * Hence, this routine must be called after jpeg_read_header (which reads
+  * the image dimensions) and before jpeg_read_coefficients (which realizes
+  * the source's virtual arrays).
++ *
++ * This function returns FALSE right away if -perfect is given
++ * and transformation is not perfect.  Otherwise returns TRUE.
+  */
+ 
+-GLOBAL(void)
++GLOBAL(boolean)
+ jtransform_request_workspace (j_decompress_ptr srcinfo,
+ 			      jpeg_transform_info *info)
+ {
+-  jvirt_barray_ptr *coef_arrays = NULL;
++  jvirt_barray_ptr *coef_arrays;
++  boolean need_workspace, transpose_it;
+   jpeg_component_info *compptr;
+-  int ci;
++  JDIMENSION xoffset, yoffset;
++  JDIMENSION width_in_iMCUs, height_in_iMCUs;
++  JDIMENSION width_in_blocks, height_in_blocks;
++  int ci, h_samp_factor, v_samp_factor;
+ 
++  /* Determine number of components in output image */
+   if (info->force_grayscale &&
+       srcinfo->jpeg_color_space == JCS_YCbCr &&
+-      srcinfo->num_components == 3) {
++      srcinfo->num_components == 3)
+     /* We'll only process the first component */
+     info->num_components = 1;
+-  } else {
++  else
+     /* Process all the components */
+     info->num_components = srcinfo->num_components;
++
++  /* Compute output image dimensions and related values. */
++#if JPEG_LIB_VERSION >= 80
++  jpeg_core_output_dimensions(srcinfo);
++#else
++  srcinfo->output_width = srcinfo->image_width;
++  srcinfo->output_height = srcinfo->image_height;
++#endif
++
++  /* Return right away if -perfect is given and transformation is not perfect.
++   */
++  if (info->perfect) {
++    if (info->num_components == 1) {
++      if (!jtransform_perfect_transform(srcinfo->output_width,
++	  srcinfo->output_height,
++	  srcinfo->_min_DCT_h_scaled_size,
++	  srcinfo->_min_DCT_v_scaled_size,
++	  info->transform))
++	return FALSE;
++    } else {
++      if (!jtransform_perfect_transform(srcinfo->output_width,
++	  srcinfo->output_height,
++	  srcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size,
++	  srcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size,
++	  info->transform))
++	return FALSE;
++    }
++  }
++
++  /* If there is only one output component, force the iMCU size to be 1;
++   * else use the source iMCU size.  (This allows us to do the right thing
++   * when reducing color to grayscale, and also provides a handy way of
++   * cleaning up "funny" grayscale images whose sampling factors are not 1x1.)
++   */
++  switch (info->transform) {
++  case JXFORM_TRANSPOSE:
++  case JXFORM_TRANSVERSE:
++  case JXFORM_ROT_90:
++  case JXFORM_ROT_270:
++    info->output_width = srcinfo->output_height;
++    info->output_height = srcinfo->output_width;
++    if (info->num_components == 1) {
++      info->iMCU_sample_width = srcinfo->_min_DCT_v_scaled_size;
++      info->iMCU_sample_height = srcinfo->_min_DCT_h_scaled_size;
++    } else {
++      info->iMCU_sample_width =
++	srcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size;
++      info->iMCU_sample_height =
++	srcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size;
++    }
++    break;
++  default:
++    info->output_width = srcinfo->output_width;
++    info->output_height = srcinfo->output_height;
++    if (info->num_components == 1) {
++      info->iMCU_sample_width = srcinfo->_min_DCT_h_scaled_size;
++      info->iMCU_sample_height = srcinfo->_min_DCT_v_scaled_size;
++    } else {
++      info->iMCU_sample_width =
++	srcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size;
++      info->iMCU_sample_height =
++	srcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size;
++    }
++    break;
+   }
+ 
++  /* If cropping has been requested, compute the crop area's position and
++   * dimensions, ensuring that its upper left corner falls at an iMCU boundary.
++   */
++  if (info->crop) {
++    /* Insert default values for unset crop parameters */
++    if (info->crop_xoffset_set == JCROP_UNSET)
++      info->crop_xoffset = 0;	/* default to +0 */
++    if (info->crop_yoffset_set == JCROP_UNSET)
++      info->crop_yoffset = 0;	/* default to +0 */
++    if (info->crop_xoffset >= info->output_width ||
++	info->crop_yoffset >= info->output_height)
++      ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
++    if (info->crop_width_set == JCROP_UNSET)
++      info->crop_width = info->output_width - info->crop_xoffset;
++    if (info->crop_height_set == JCROP_UNSET)
++      info->crop_height = info->output_height - info->crop_yoffset;
++    /* Ensure parameters are valid */
++    if (info->crop_width <= 0 || info->crop_width > info->output_width ||
++	info->crop_height <= 0 || info->crop_height > info->output_height ||
++	info->crop_xoffset > info->output_width - info->crop_width ||
++	info->crop_yoffset > info->output_height - info->crop_height)
++      ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
++    /* Convert negative crop offsets into regular offsets */
++    if (info->crop_xoffset_set == JCROP_NEG)
++      xoffset = info->output_width - info->crop_width - info->crop_xoffset;
++    else
++      xoffset = info->crop_xoffset;
++    if (info->crop_yoffset_set == JCROP_NEG)
++      yoffset = info->output_height - info->crop_height - info->crop_yoffset;
++    else
++      yoffset = info->crop_yoffset;
++    /* Now adjust so that upper left corner falls at an iMCU boundary */
++    if (info->crop_width_set == JCROP_FORCE)
++      info->output_width = info->crop_width;
++    else
++      info->output_width =
++        info->crop_width + (xoffset % info->iMCU_sample_width);
++    if (info->crop_height_set == JCROP_FORCE)
++      info->output_height = info->crop_height;
++    else
++      info->output_height =
++        info->crop_height + (yoffset % info->iMCU_sample_height);
++    /* Save x/y offsets measured in iMCUs */
++    info->x_crop_offset = xoffset / info->iMCU_sample_width;
++    info->y_crop_offset = yoffset / info->iMCU_sample_height;
++  } else {
++    info->x_crop_offset = 0;
++    info->y_crop_offset = 0;
++  }
++
++  /* Figure out whether we need workspace arrays,
++   * and if so whether they are transposed relative to the source.
++   */
++  need_workspace = FALSE;
++  transpose_it = FALSE;
+   switch (info->transform) {
+   case JXFORM_NONE:
++    if (info->x_crop_offset != 0 || info->y_crop_offset != 0)
++      need_workspace = TRUE;
++    /* No workspace needed if neither cropping nor transforming */
++    break;
+   case JXFORM_FLIP_H:
+-    /* Don't need a workspace array */
++    if (info->trim)
++      trim_right_edge(info, srcinfo->output_width);
++    if (info->y_crop_offset != 0 || info->slow_hflip)
++      need_workspace = TRUE;
++    /* do_flip_h_no_crop doesn't need a workspace array */
+     break;
+   case JXFORM_FLIP_V:
+-  case JXFORM_ROT_180:
+-    /* Need workspace arrays having same dimensions as source image.
+-     * Note that we allocate arrays padded out to the next iMCU boundary,
+-     * so that transform routines need not worry about missing edge blocks.
+-     */
+-    coef_arrays = (jvirt_barray_ptr *)
+-      (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,
+-	SIZEOF(jvirt_barray_ptr) * info->num_components);
+-    for (ci = 0; ci < info->num_components; ci++) {
+-      compptr = srcinfo->comp_info + ci;
+-      coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
+-	((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,
+-	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
+-				(long) compptr->h_samp_factor),
+-	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+-				(long) compptr->v_samp_factor),
+-	 (JDIMENSION) compptr->v_samp_factor);
+-    }
++    if (info->trim)
++      trim_bottom_edge(info, srcinfo->output_height);
++    /* Need workspace arrays having same dimensions as source image. */
++    need_workspace = TRUE;
+     break;
+   case JXFORM_TRANSPOSE:
++    /* transpose does NOT have to trim anything */
++    /* Need workspace arrays having transposed dimensions. */
++    need_workspace = TRUE;
++    transpose_it = TRUE;
++    break;
+   case JXFORM_TRANSVERSE:
++    if (info->trim) {
++      trim_right_edge(info, srcinfo->output_height);
++      trim_bottom_edge(info, srcinfo->output_width);
++    }
++    /* Need workspace arrays having transposed dimensions. */
++    need_workspace = TRUE;
++    transpose_it = TRUE;
++    break;
+   case JXFORM_ROT_90:
++    if (info->trim)
++      trim_right_edge(info, srcinfo->output_height);
++    /* Need workspace arrays having transposed dimensions. */
++    need_workspace = TRUE;
++    transpose_it = TRUE;
++    break;
++  case JXFORM_ROT_180:
++    if (info->trim) {
++      trim_right_edge(info, srcinfo->output_width);
++      trim_bottom_edge(info, srcinfo->output_height);
++    }
++    /* Need workspace arrays having same dimensions as source image. */
++    need_workspace = TRUE;
++    break;
+   case JXFORM_ROT_270:
+-    /* Need workspace arrays having transposed dimensions.
+-     * Note that we allocate arrays padded out to the next iMCU boundary,
+-     * so that transform routines need not worry about missing edge blocks.
+-     */
++    if (info->trim)
++      trim_bottom_edge(info, srcinfo->output_width);
++    /* Need workspace arrays having transposed dimensions. */
++    need_workspace = TRUE;
++    transpose_it = TRUE;
++    break;
++  }
++
++  /* Allocate workspace if needed.
++   * Note that we allocate arrays padded out to the next iMCU boundary,
++   * so that transform routines need not worry about missing edge blocks.
++   */
++  if (need_workspace) {
+     coef_arrays = (jvirt_barray_ptr *)
+       (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,
+-	SIZEOF(jvirt_barray_ptr) * info->num_components);
++		SIZEOF(jvirt_barray_ptr) * info->num_components);
++    width_in_iMCUs = (JDIMENSION)
++      jdiv_round_up((long) info->output_width,
++		    (long) info->iMCU_sample_width);
++    height_in_iMCUs = (JDIMENSION)
++      jdiv_round_up((long) info->output_height,
++		    (long) info->iMCU_sample_height);
+     for (ci = 0; ci < info->num_components; ci++) {
+       compptr = srcinfo->comp_info + ci;
++      if (info->num_components == 1) {
++	/* we're going to force samp factors to 1x1 in this case */
++	h_samp_factor = v_samp_factor = 1;
++      } else if (transpose_it) {
++	h_samp_factor = compptr->v_samp_factor;
++	v_samp_factor = compptr->h_samp_factor;
++      } else {
++	h_samp_factor = compptr->h_samp_factor;
++	v_samp_factor = compptr->v_samp_factor;
++      }
++      width_in_blocks = width_in_iMCUs * h_samp_factor;
++      height_in_blocks = height_in_iMCUs * v_samp_factor;
+       coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)
+ 	((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,
+-	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+-				(long) compptr->v_samp_factor),
+-	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
+-				(long) compptr->h_samp_factor),
+-	 (JDIMENSION) compptr->h_samp_factor);
++	 width_in_blocks, height_in_blocks, (JDIMENSION) v_samp_factor);
+     }
+-    break;
+-  }
+-  info->workspace_coef_arrays = coef_arrays;
++    info->workspace_coef_arrays = coef_arrays;
++  } else
++    info->workspace_coef_arrays = NULL;
++
++  return TRUE;
+ }
+ 
+ 
+@@ -642,13 +1134,18 @@ transpose_critical_parameters (j_compres
+   int tblno, i, j, ci, itemp;
+   jpeg_component_info *compptr;
+   JQUANT_TBL *qtblptr;
+-  JDIMENSION dtemp;
++  JDIMENSION jtemp;
+   UINT16 qtemp;
+ 
+-  /* Transpose basic image dimensions */
+-  dtemp = dstinfo->image_width;
++  /* Transpose image dimensions */
++  jtemp = dstinfo->image_width;
+   dstinfo->image_width = dstinfo->image_height;
+-  dstinfo->image_height = dtemp;
++  dstinfo->image_height = jtemp;
++#if JPEG_LIB_VERSION >= 70
++  itemp = dstinfo->min_DCT_h_scaled_size;
++  dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;
++  dstinfo->min_DCT_v_scaled_size = itemp;
++#endif
+ 
+   /* Transpose sampling factors */
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+@@ -674,47 +1171,162 @@ transpose_critical_parameters (j_compres
+ }
+ 
+ 
+-/* Trim off any partial iMCUs on the indicated destination edge */
++/* Adjust Exif image parameters.
++ *
++ * We try to adjust the Tags ExifImageWidth and ExifImageHeight if possible.
++ */
+ 
++#if JPEG_LIB_VERSION >= 70
+ LOCAL(void)
+-trim_right_edge (j_compress_ptr dstinfo)
++adjust_exif_parameters (JOCTET FAR * data, unsigned int length,
++			JDIMENSION new_width, JDIMENSION new_height)
+ {
+-  int ci, max_h_samp_factor;
+-  JDIMENSION MCU_cols;
++  boolean is_motorola; /* Flag for byte order */
++  unsigned int number_of_tags, tagnum;
++  unsigned int firstoffset, offset;
++  JDIMENSION new_value;
++
++  if (length < 12) return; /* Length of an IFD entry */
++
++  /* Discover byte order */
++  if (GETJOCTET(data[0]) == 0x49 && GETJOCTET(data[1]) == 0x49)
++    is_motorola = FALSE;
++  else if (GETJOCTET(data[0]) == 0x4D && GETJOCTET(data[1]) == 0x4D)
++    is_motorola = TRUE;
++  else
++    return;
++
++  /* Check Tag Mark */
++  if (is_motorola) {
++    if (GETJOCTET(data[2]) != 0) return;
++    if (GETJOCTET(data[3]) != 0x2A) return;
++  } else {
++    if (GETJOCTET(data[3]) != 0) return;
++    if (GETJOCTET(data[2]) != 0x2A) return;
++  }
+ 
+-  /* We have to compute max_h_samp_factor ourselves,
+-   * because it hasn't been set yet in the destination
+-   * (and we don't want to use the source's value).
+-   */
+-  max_h_samp_factor = 1;
+-  for (ci = 0; ci < dstinfo->num_components; ci++) {
+-    int h_samp_factor = dstinfo->comp_info[ci].h_samp_factor;
+-    max_h_samp_factor = MAX(max_h_samp_factor, h_samp_factor);
++  /* Get first IFD offset (offset to IFD0) */
++  if (is_motorola) {
++    if (GETJOCTET(data[4]) != 0) return;
++    if (GETJOCTET(data[5]) != 0) return;
++    firstoffset = GETJOCTET(data[6]);
++    firstoffset <<= 8;
++    firstoffset += GETJOCTET(data[7]);
++  } else {
++    if (GETJOCTET(data[7]) != 0) return;
++    if (GETJOCTET(data[6]) != 0) return;
++    firstoffset = GETJOCTET(data[5]);
++    firstoffset <<= 8;
++    firstoffset += GETJOCTET(data[4]);
+   }
+-  MCU_cols = dstinfo->image_width / (max_h_samp_factor * DCTSIZE);
+-  if (MCU_cols > 0)		/* can't trim to 0 pixels */
+-    dstinfo->image_width = MCU_cols * (max_h_samp_factor * DCTSIZE);
+-}
++  if (firstoffset > length - 2) return; /* check end of data segment */
+ 
+-LOCAL(void)
+-trim_bottom_edge (j_compress_ptr dstinfo)
+-{
+-  int ci, max_v_samp_factor;
+-  JDIMENSION MCU_rows;
++  /* Get the number of directory entries contained in this IFD */
++  if (is_motorola) {
++    number_of_tags = GETJOCTET(data[firstoffset]);
++    number_of_tags <<= 8;
++    number_of_tags += GETJOCTET(data[firstoffset+1]);
++  } else {
++    number_of_tags = GETJOCTET(data[firstoffset+1]);
++    number_of_tags <<= 8;
++    number_of_tags += GETJOCTET(data[firstoffset]);
++  }
++  if (number_of_tags == 0) return;
++  firstoffset += 2;
+ 
+-  /* We have to compute max_v_samp_factor ourselves,
+-   * because it hasn't been set yet in the destination
+-   * (and we don't want to use the source's value).
+-   */
+-  max_v_samp_factor = 1;
+-  for (ci = 0; ci < dstinfo->num_components; ci++) {
+-    int v_samp_factor = dstinfo->comp_info[ci].v_samp_factor;
+-    max_v_samp_factor = MAX(max_v_samp_factor, v_samp_factor);
++  /* Search for ExifSubIFD offset Tag in IFD0 */
++  for (;;) {
++    if (firstoffset > length - 12) return; /* check end of data segment */
++    /* Get Tag number */
++    if (is_motorola) {
++      tagnum = GETJOCTET(data[firstoffset]);
++      tagnum <<= 8;
++      tagnum += GETJOCTET(data[firstoffset+1]);
++    } else {
++      tagnum = GETJOCTET(data[firstoffset+1]);
++      tagnum <<= 8;
++      tagnum += GETJOCTET(data[firstoffset]);
++    }
++    if (tagnum == 0x8769) break; /* found ExifSubIFD offset Tag */
++    if (--number_of_tags == 0) return;
++    firstoffset += 12;
++  }
++
++  /* Get the ExifSubIFD offset */
++  if (is_motorola) {
++    if (GETJOCTET(data[firstoffset+8]) != 0) return;
++    if (GETJOCTET(data[firstoffset+9]) != 0) return;
++    offset = GETJOCTET(data[firstoffset+10]);
++    offset <<= 8;
++    offset += GETJOCTET(data[firstoffset+11]);
++  } else {
++    if (GETJOCTET(data[firstoffset+11]) != 0) return;
++    if (GETJOCTET(data[firstoffset+10]) != 0) return;
++    offset = GETJOCTET(data[firstoffset+9]);
++    offset <<= 8;
++    offset += GETJOCTET(data[firstoffset+8]);
++  }
++  if (offset > length - 2) return; /* check end of data segment */
++
++  /* Get the number of directory entries contained in this SubIFD */
++  if (is_motorola) {
++    number_of_tags = GETJOCTET(data[offset]);
++    number_of_tags <<= 8;
++    number_of_tags += GETJOCTET(data[offset+1]);
++  } else {
++    number_of_tags = GETJOCTET(data[offset+1]);
++    number_of_tags <<= 8;
++    number_of_tags += GETJOCTET(data[offset]);
+   }
+-  MCU_rows = dstinfo->image_height / (max_v_samp_factor * DCTSIZE);
+-  if (MCU_rows > 0)		/* can't trim to 0 pixels */
+-    dstinfo->image_height = MCU_rows * (max_v_samp_factor * DCTSIZE);
++  if (number_of_tags < 2) return;
++  offset += 2;
++
++  /* Search for ExifImageWidth and ExifImageHeight Tags in this SubIFD */
++  do {
++    if (offset > length - 12) return; /* check end of data segment */
++    /* Get Tag number */
++    if (is_motorola) {
++      tagnum = GETJOCTET(data[offset]);
++      tagnum <<= 8;
++      tagnum += GETJOCTET(data[offset+1]);
++    } else {
++      tagnum = GETJOCTET(data[offset+1]);
++      tagnum <<= 8;
++      tagnum += GETJOCTET(data[offset]);
++    }
++    if (tagnum == 0xA002 || tagnum == 0xA003) {
++      if (tagnum == 0xA002)
++	new_value = new_width; /* ExifImageWidth Tag */
++      else
++	new_value = new_height; /* ExifImageHeight Tag */
++      if (is_motorola) {
++	data[offset+2] = 0; /* Format = unsigned long (4 octets) */
++	data[offset+3] = 4;
++	data[offset+4] = 0; /* Number Of Components = 1 */
++	data[offset+5] = 0;
++	data[offset+6] = 0;
++	data[offset+7] = 1;
++	data[offset+8] = 0;
++	data[offset+9] = 0;
++	data[offset+10] = (JOCTET)((new_value >> 8) & 0xFF);
++	data[offset+11] = (JOCTET)(new_value & 0xFF);
++      } else {
++	data[offset+2] = 4; /* Format = unsigned long (4 octets) */
++	data[offset+3] = 0;
++	data[offset+4] = 1; /* Number Of Components = 1 */
++	data[offset+5] = 0;
++	data[offset+6] = 0;
++	data[offset+7] = 0;
++	data[offset+8] = (JOCTET)(new_value & 0xFF);
++	data[offset+9] = (JOCTET)((new_value >> 8) & 0xFF);
++	data[offset+10] = 0;
++	data[offset+11] = 0;
++      }
++    }
++    offset += 12;
++  } while (--number_of_tags);
+ }
++#endif
+ 
+ 
+ /* Adjust output image parameters as needed.
+@@ -736,18 +1348,22 @@ jtransform_adjust_parameters (j_decompre
+ {
+   /* If force-to-grayscale is requested, adjust destination parameters */
+   if (info->force_grayscale) {
+-    /* We use jpeg_set_colorspace to make sure subsidiary settings get fixed
+-     * properly.  Among other things, the target h_samp_factor & v_samp_factor
+-     * will get set to 1, which typically won't match the source.
+-     * In fact we do this even if the source is already grayscale; that
+-     * provides an easy way of coercing a grayscale JPEG with funny sampling
+-     * factors to the customary 1,1.  (Some decoders fail on other factors.)
++    /* First, ensure we have YCbCr or grayscale data, and that the source's
++     * Y channel is full resolution.  (No reasonable person would make Y
++     * be less than full resolution, so actually coping with that case
++     * isn't worth extra code space.  But we check it to avoid crashing.)
+      */
+-    if ((dstinfo->jpeg_color_space == JCS_YCbCr &&
+-	 dstinfo->num_components == 3) ||
+-	(dstinfo->jpeg_color_space == JCS_GRAYSCALE &&
+-	 dstinfo->num_components == 1)) {
+-      /* We have to preserve the source's quantization table number. */
++    if (((dstinfo->jpeg_color_space == JCS_YCbCr &&
++	  dstinfo->num_components == 3) ||
++	 (dstinfo->jpeg_color_space == JCS_GRAYSCALE &&
++	  dstinfo->num_components == 1)) &&
++	srcinfo->comp_info[0].h_samp_factor == srcinfo->max_h_samp_factor &&
++	srcinfo->comp_info[0].v_samp_factor == srcinfo->max_v_samp_factor) {
++      /* We use jpeg_set_colorspace to make sure subsidiary settings get fixed
++       * properly.  Among other things, it sets the target h_samp_factor &
++       * v_samp_factor to 1, which typically won't match the source.
++       * We have to preserve the source's quantization table number, however.
++       */
+       int sv_quant_tbl_no = dstinfo->comp_info[0].quant_tbl_no;
+       jpeg_set_colorspace(dstinfo, JCS_GRAYSCALE);
+       dstinfo->comp_info[0].quant_tbl_no = sv_quant_tbl_no;
+@@ -755,50 +1371,66 @@ jtransform_adjust_parameters (j_decompre
+       /* Sorry, can't do it */
+       ERREXIT(dstinfo, JERR_CONVERSION_NOTIMPL);
+     }
++  } else if (info->num_components == 1) {
++    /* For a single-component source, we force the destination sampling factors
++     * to 1x1, with or without force_grayscale.  This is useful because some
++     * decoders choke on grayscale images with other sampling factors.
++     */
++    dstinfo->comp_info[0].h_samp_factor = 1;
++    dstinfo->comp_info[0].v_samp_factor = 1;
+   }
+ 
+-  /* Correct the destination's image dimensions etc if necessary */
++  /* Correct the destination's image dimensions as necessary
++   * for rotate/flip, resize, and crop operations.
++   */
++#if JPEG_LIB_VERSION >= 70
++  dstinfo->jpeg_width = info->output_width;
++  dstinfo->jpeg_height = info->output_height;
++#endif
++
++  /* Transpose destination image parameters */
+   switch (info->transform) {
+-  case JXFORM_NONE:
+-    /* Nothing to do */
+-    break;
+-  case JXFORM_FLIP_H:
+-    if (info->trim)
+-      trim_right_edge(dstinfo);
+-    break;
+-  case JXFORM_FLIP_V:
+-    if (info->trim)
+-      trim_bottom_edge(dstinfo);
+-    break;
+   case JXFORM_TRANSPOSE:
+-    transpose_critical_parameters(dstinfo);
+-    /* transpose does NOT have to trim anything */
+-    break;
+   case JXFORM_TRANSVERSE:
+-    transpose_critical_parameters(dstinfo);
+-    if (info->trim) {
+-      trim_right_edge(dstinfo);
+-      trim_bottom_edge(dstinfo);
+-    }
+-    break;
+   case JXFORM_ROT_90:
+-    transpose_critical_parameters(dstinfo);
+-    if (info->trim)
+-      trim_right_edge(dstinfo);
+-    break;
+-  case JXFORM_ROT_180:
+-    if (info->trim) {
+-      trim_right_edge(dstinfo);
+-      trim_bottom_edge(dstinfo);
+-    }
+-    break;
+   case JXFORM_ROT_270:
++#if JPEG_LIB_VERSION < 70
++    dstinfo->image_width = info->output_height;
++    dstinfo->image_height = info->output_width;
++#endif
+     transpose_critical_parameters(dstinfo);
+-    if (info->trim)
+-      trim_bottom_edge(dstinfo);
++    break;
++  default:
++#if JPEG_LIB_VERSION < 70
++    dstinfo->image_width = info->output_width;
++    dstinfo->image_height = info->output_height;
++#endif
+     break;
+   }
+ 
++  /* Adjust Exif properties */
++  if (srcinfo->marker_list != NULL &&
++      srcinfo->marker_list->marker == JPEG_APP0+1 &&
++      srcinfo->marker_list->data_length >= 6 &&
++      GETJOCTET(srcinfo->marker_list->data[0]) == 0x45 &&
++      GETJOCTET(srcinfo->marker_list->data[1]) == 0x78 &&
++      GETJOCTET(srcinfo->marker_list->data[2]) == 0x69 &&
++      GETJOCTET(srcinfo->marker_list->data[3]) == 0x66 &&
++      GETJOCTET(srcinfo->marker_list->data[4]) == 0 &&
++      GETJOCTET(srcinfo->marker_list->data[5]) == 0) {
++    /* Suppress output of JFIF marker */
++    dstinfo->write_JFIF_header = FALSE;
++#if JPEG_LIB_VERSION >= 70
++    /* Adjust Exif image parameters */
++    if (dstinfo->jpeg_width != srcinfo->image_width ||
++	dstinfo->jpeg_height != srcinfo->image_height)
++      /* Align data segment to start of TIFF structure for parsing */
++      adjust_exif_parameters(srcinfo->marker_list->data + 6,
++	srcinfo->marker_list->data_length - 6,
++	dstinfo->jpeg_width, dstinfo->jpeg_height);
++#endif
++  }
++
+   /* Return the appropriate output data set */
+   if (info->workspace_coef_arrays != NULL)
+     return info->workspace_coef_arrays;
+@@ -816,40 +1448,110 @@ jtransform_adjust_parameters (j_decompre
+  */
+ 
+ GLOBAL(void)
+-jtransform_execute_transformation (j_decompress_ptr srcinfo,
+-				   j_compress_ptr dstinfo,
+-				   jvirt_barray_ptr *src_coef_arrays,
+-				   jpeg_transform_info *info)
++jtransform_execute_transform (j_decompress_ptr srcinfo,
++			      j_compress_ptr dstinfo,
++			      jvirt_barray_ptr *src_coef_arrays,
++			      jpeg_transform_info *info)
+ {
+   jvirt_barray_ptr *dst_coef_arrays = info->workspace_coef_arrays;
+ 
++  /* Note: conditions tested here should match those in switch statement
++   * in jtransform_request_workspace()
++   */
+   switch (info->transform) {
+   case JXFORM_NONE:
++    if (info->x_crop_offset != 0 || info->y_crop_offset != 0)
++      do_crop(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
++	      src_coef_arrays, dst_coef_arrays);
+     break;
+   case JXFORM_FLIP_H:
+-    do_flip_h(srcinfo, dstinfo, src_coef_arrays);
++    if (info->y_crop_offset != 0 || info->slow_hflip)
++      do_flip_h(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
++		src_coef_arrays, dst_coef_arrays);
++    else
++      do_flip_h_no_crop(srcinfo, dstinfo, info->x_crop_offset,
++			src_coef_arrays);
+     break;
+   case JXFORM_FLIP_V:
+-    do_flip_v(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
++    do_flip_v(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
++	      src_coef_arrays, dst_coef_arrays);
+     break;
+   case JXFORM_TRANSPOSE:
+-    do_transpose(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
++    do_transpose(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
++		 src_coef_arrays, dst_coef_arrays);
+     break;
+   case JXFORM_TRANSVERSE:
+-    do_transverse(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
++    do_transverse(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
++		  src_coef_arrays, dst_coef_arrays);
+     break;
+   case JXFORM_ROT_90:
+-    do_rot_90(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
++    do_rot_90(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
++	      src_coef_arrays, dst_coef_arrays);
+     break;
+   case JXFORM_ROT_180:
+-    do_rot_180(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
++    do_rot_180(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
++	       src_coef_arrays, dst_coef_arrays);
+     break;
+   case JXFORM_ROT_270:
+-    do_rot_270(srcinfo, dstinfo, src_coef_arrays, dst_coef_arrays);
++    do_rot_270(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
++	       src_coef_arrays, dst_coef_arrays);
+     break;
+   }
+ }
+ 
++/* jtransform_perfect_transform
++ *
++ * Determine whether lossless transformation is perfectly
++ * possible for a specified image and transformation.
++ *
++ * Inputs:
++ *   image_width, image_height: source image dimensions.
++ *   MCU_width, MCU_height: pixel dimensions of MCU.
++ *   transform: transformation identifier.
++ * Parameter sources from initialized jpeg_struct
++ * (after reading source header):
++ *   image_width = cinfo.image_width
++ *   image_height = cinfo.image_height
++ *   MCU_width = cinfo.max_h_samp_factor * cinfo.block_size
++ *   MCU_height = cinfo.max_v_samp_factor * cinfo.block_size
++ * Result:
++ *   TRUE = perfect transformation possible
++ *   FALSE = perfect transformation not possible
++ *           (may use custom action then)
++ */
++
++GLOBAL(boolean)
++jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,
++			     int MCU_width, int MCU_height,
++			     JXFORM_CODE transform)
++{
++  boolean result = TRUE; /* initialize TRUE */
++
++  switch (transform) {
++  case JXFORM_FLIP_H:
++  case JXFORM_ROT_270:
++    if (image_width % (JDIMENSION) MCU_width)
++      result = FALSE;
++    break;
++  case JXFORM_FLIP_V:
++  case JXFORM_ROT_90:
++    if (image_height % (JDIMENSION) MCU_height)
++      result = FALSE;
++    break;
++  case JXFORM_TRANSVERSE:
++  case JXFORM_ROT_180:
++    if (image_width % (JDIMENSION) MCU_width)
++      result = FALSE;
++    if (image_height % (JDIMENSION) MCU_height)
++      result = FALSE;
++    break;
++  default:
++    break;
++  }
++
++  return result;
++}
++
+ #endif /* TRANSFORMS_SUPPORTED */
+ 
+ 
+Index: fbida-2.10/jpeg/62/transupp.h
+===================================================================
+--- fbida-2.10.orig/jpeg/62/transupp.h
++++ fbida-2.10/jpeg/62/transupp.h
+@@ -1,7 +1,7 @@
+ /*
+  * transupp.h
+  *
+- * Copyright (C) 1997, Thomas G. Lane.
++ * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.
+  * This file is part of the Independent JPEG Group's software.
+  * For conditions of distribution and use, see the accompanying README file.
+  *
+@@ -22,32 +22,6 @@
+ #define TRANSFORMS_SUPPORTED 1		/* 0 disables transform code */
+ #endif
+ 
+-/* Short forms of external names for systems with brain-damaged linkers. */
+-
+-#ifdef NEED_SHORT_EXTERNAL_NAMES
+-#define jtransform_request_workspace		jTrRequest
+-#define jtransform_adjust_parameters		jTrAdjust
+-#define jtransform_execute_transformation	jTrExec
+-#define jcopy_markers_setup			jCMrkSetup
+-#define jcopy_markers_execute			jCMrkExec
+-#endif /* NEED_SHORT_EXTERNAL_NAMES */
+-
+-
+-/*
+- * Codes for supported types of image transformations.
+- */
+-
+-typedef enum {
+-	JXFORM_NONE,		/* no transformation */
+-	JXFORM_FLIP_H,		/* horizontal flip */
+-	JXFORM_FLIP_V,		/* vertical flip */
+-	JXFORM_TRANSPOSE,	/* transpose across UL-to-LR axis */
+-	JXFORM_TRANSVERSE,	/* transpose across UR-to-LL axis */
+-	JXFORM_ROT_90,		/* 90-degree clockwise rotation */
+-	JXFORM_ROT_180,		/* 180-degree rotation */
+-	JXFORM_ROT_270		/* 270-degree clockwise (or 90 ccw) */
+-} JXFORM_CODE;
+-
+ /*
+  * Although rotating and flipping data expressed as DCT coefficients is not
+  * hard, there is an asymmetry in the JPEG format specification for images
+@@ -75,6 +49,25 @@ typedef enum {
+  * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim
+  * followed by -rot 180 -trim trims both edges.)
+  *
++ * We also offer a lossless-crop option, which discards data outside a given
++ * image region but losslessly preserves what is inside.  Like the rotate and
++ * flip transforms, lossless crop is restricted by the JPEG format: the upper
++ * left corner of the selected region must fall on an iMCU boundary.  If this
++ * does not hold for the given crop parameters, we silently move the upper left
++ * corner up and/or left to make it so, simultaneously increasing the region
++ * dimensions to keep the lower right crop corner unchanged.  (Thus, the
++ * output image covers at least the requested region, but may cover more.)
++ * The adjustment of the region dimensions may be optionally disabled.
++ *
++ * We also provide a lossless-resize option, which is kind of a lossless-crop
++ * operation in the DCT coefficient block domain - it discards higher-order
++ * coefficients and losslessly preserves lower-order coefficients of a
++ * sub-block.
++ *
++ * Rotate/flip transform, resize, and crop can be requested together in a
++ * single invocation.  The crop is applied last --- that is, the crop region
++ * is specified in terms of the destination image after transform/resize.
++ *
+  * We also offer a "force to grayscale" option, which simply discards the
+  * chrominance channels of a YCbCr image.  This is lossless in the sense that
+  * the luminance channel is preserved exactly.  It's not the same kind of
+@@ -83,22 +76,100 @@ typedef enum {
+  * be aware of the option to know how many components to work on.
+  */
+ 
++
++/* Short forms of external names for systems with brain-damaged linkers. */
++
++#ifdef NEED_SHORT_EXTERNAL_NAMES
++#define jtransform_parse_crop_spec	jTrParCrop
++#define jtransform_request_workspace	jTrRequest
++#define jtransform_adjust_parameters	jTrAdjust
++#define jtransform_execute_transform	jTrExec
++#define jtransform_perfect_transform	jTrPerfect
++#define jcopy_markers_setup		jCMrkSetup
++#define jcopy_markers_execute		jCMrkExec
++#endif /* NEED_SHORT_EXTERNAL_NAMES */
++
++
++/*
++ * Codes for supported types of image transformations.
++ */
++
++typedef enum {
++	JXFORM_NONE,		/* no transformation */
++	JXFORM_FLIP_H,		/* horizontal flip */
++	JXFORM_FLIP_V,		/* vertical flip */
++	JXFORM_TRANSPOSE,	/* transpose across UL-to-LR axis */
++	JXFORM_TRANSVERSE,	/* transpose across UR-to-LL axis */
++	JXFORM_ROT_90,		/* 90-degree clockwise rotation */
++	JXFORM_ROT_180,		/* 180-degree rotation */
++	JXFORM_ROT_270		/* 270-degree clockwise (or 90 ccw) */
++} JXFORM_CODE;
++
++/*
++ * Codes for crop parameters, which can individually be unspecified,
++ * positive or negative for xoffset or yoffset,
++ * positive or forced for width or height.
++ */
++
++typedef enum {
++        JCROP_UNSET,
++        JCROP_POS,
++        JCROP_NEG,
++        JCROP_FORCE
++} JCROP_CODE;
++
++/*
++ * Transform parameters struct.
++ * NB: application must not change any elements of this struct after
++ * calling jtransform_request_workspace.
++ */
++
+ typedef struct {
+   /* Options: set by caller */
+   JXFORM_CODE transform;	/* image transform operator */
++  boolean perfect;		/* if TRUE, fail if partial MCUs are requested */
+   boolean trim;			/* if TRUE, trim partial MCUs as needed */
+   boolean force_grayscale;	/* if TRUE, convert color image to grayscale */
++  boolean crop;			/* if TRUE, crop source image */
++  boolean slow_hflip;  /* For best performance, the JXFORM_FLIP_H transform
++                          normally modifies the source coefficients in place.
++                          Setting this to TRUE will instead use a slower,
++                          double-buffered algorithm, which leaves the source
++                          coefficients in tact (necessary if other transformed
++                          images must be generated from the same set of
++                          coefficients. */
++
++  /* Crop parameters: application need not set these unless crop is TRUE.
++   * These can be filled in by jtransform_parse_crop_spec().
++   */
++  JDIMENSION crop_width;	/* Width of selected region */
++  JCROP_CODE crop_width_set;	/* (forced disables adjustment) */
++  JDIMENSION crop_height;	/* Height of selected region */
++  JCROP_CODE crop_height_set;	/* (forced disables adjustment) */
++  JDIMENSION crop_xoffset;	/* X offset of selected region */
++  JCROP_CODE crop_xoffset_set;	/* (negative measures from right edge) */
++  JDIMENSION crop_yoffset;	/* Y offset of selected region */
++  JCROP_CODE crop_yoffset_set;	/* (negative measures from bottom edge) */
+ 
+   /* Internal workspace: caller should not touch these */
+   int num_components;		/* # of components in workspace */
+   jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */
++  JDIMENSION output_width;	/* cropped destination dimensions */
++  JDIMENSION output_height;
++  JDIMENSION x_crop_offset;	/* destination crop offsets measured in iMCUs */
++  JDIMENSION y_crop_offset;
++  int iMCU_sample_width;	/* destination iMCU size */
++  int iMCU_sample_height;
+ } jpeg_transform_info;
+ 
+ 
+ #if TRANSFORMS_SUPPORTED
+ 
++/* Parse a crop specification (written in X11 geometry style) */
++EXTERN(boolean) jtransform_parse_crop_spec
++	JPP((jpeg_transform_info *info, const char *spec));
+ /* Request any required workspace */
+-EXTERN(void) jtransform_request_workspace
++EXTERN(boolean) jtransform_request_workspace
+ 	JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));
+ /* Adjust output image parameters */
+ EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters
+@@ -106,10 +177,24 @@ EXTERN(jvirt_barray_ptr *) jtransform_ad
+ 	     jvirt_barray_ptr *src_coef_arrays,
+ 	     jpeg_transform_info *info));
+ /* Execute the actual transformation, if any */
+-EXTERN(void) jtransform_execute_transformation
++EXTERN(void) jtransform_execute_transform
+ 	JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+ 	     jvirt_barray_ptr *src_coef_arrays,
+ 	     jpeg_transform_info *info));
++/* Determine whether lossless transformation is perfectly
++ * possible for a specified image and transformation.
++ */
++EXTERN(boolean) jtransform_perfect_transform
++	JPP((JDIMENSION image_width, JDIMENSION image_height,
++	     int MCU_width, int MCU_height,
++	     JXFORM_CODE transform));
++
++/* jtransform_execute_transform used to be called
++ * jtransform_execute_transformation, but some compilers complain about
++ * routine names that long.  This macro is here to avoid breaking any
++ * old source code that uses the original name...
++ */
++#define jtransform_execute_transformation	jtransform_execute_transform
+ 
+ #endif /* TRANSFORMS_SUPPORTED */
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/use-jpeg-turbo.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/use-jpeg-turbo.patch
new file mode 100644
index 0000000..9963955
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fbida/files/use-jpeg-turbo.patch
@@ -0,0 +1,13 @@
+Index: fbida-2.10/GNUmakefile
+===================================================================
+--- fbida-2.10.orig/GNUmakefile
++++ fbida-2.10/GNUmakefile
+@@ -51,7 +51,7 @@ HAVE_LIBSANE	:= $(call ac_lib,sane_init,
+ HAVE_LIBCURL	:= $(call ac_lib,curl_easy_init,curl)
+ HAVE_LIBLIRC	:= $(call ac_lib,lirc_init,lirc_client)
+ HAVE_MOTIF	:= $(call ac_lib,XmStringGenerate,Xm,-L/usr/X11R6/$(LIB) -lXpm -lXt -lXext -lX11)
+-JPEG_VER        := $(call ac_jpeg_ver)
++JPEG_VER        := 62
+ endef
+ 
+ # transposing
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fim/fim_0.4-rc1.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fim/fim_0.4-rc1.bb
index 90ac702..7d1a3aa 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fim/fim_0.4-rc1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fim/fim_0.4-rc1.bb
@@ -8,7 +8,7 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=fa01bff138cc98a62b8840a157951c88"
 
-PNBLACKLIST[fim] ?= "BROKEN: doesn't build with B!=S (flex: can't open lex.lex)"
+PNBLACKLIST[fim] ?= "BROKEN: doesn't build with B!=S (flex: can't open lex.lex) - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 # flex with provide /usr/include/FlexLexer.h
 DEPENDS = "flex-native bison-native flex"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fontforge/fontforge_20150824.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fontforge/fontforge_20150824.bb
deleted file mode 100644
index 544149d..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fontforge/fontforge_20150824.bb
+++ /dev/null
@@ -1,60 +0,0 @@
-SUMMARY = "A font editor"
-HOMEPAGE = "http://fontforge.github.io/en-US/"
-LICENSE = "BSD-3-Clause & GPLv3"
-LIC_FILES_CHKSUM = " \
-    file://COPYING.gplv3;md5=d32239bcb673463ab874e80d47fae504 \
-    file://LICENSE;md5=3f922b42ed0033fa0fd4cd3268f6429c \
-"
-
-DEPENDS = "glib-2.0 pango giflib tiff libxml2 jpeg python libtool uthash gnulib"
-DEPENDS_append_class-target = " libxi"
-
-inherit autotools pkgconfig pythonnative distro_features_check
-
-REQUIRED_DISTRO_FEATURES_append_class-target = " x11"
-
-SRC_URI = "git://github.com/${BPN}/${BPN}.git"
-# tag 20150824
-SRCREV = "07d5ccff2704f8a56f1b3cc6695a4e31f85f88e6"
-S = "${WORKDIR}/git"
-
-EXTRA_OECONF_append_class-native = " with_x=no"
-
-do_configure_prepend() {
-    # uthash sources are expected in uthash/src
-    currdir=`pwd`
-    cd ${S}
-
-    mkdir -p uthash/src
-    cp ${STAGING_INCDIR}/ut*.h uthash/src
-
-    # avoid bootstrap cloning gnulib on every configure
-    cat >.gitmodules <<EOF
-[submodule "gnulib"]
-       path = gnulib
-       url = git://git.sv.gnu.org/gnulib
-EOF
-    cp -rf ${STAGING_DATADIR}/gnulib ${S}
-
-    # --force to avoid errors on reconfigure e.g if recipes changed we depend on
-    # | bootstrap: running: libtoolize --quiet
-    # | libtoolize:   error: 'libltdl/COPYING.LIB' exists: use '--force' to overwrite
-    # | ...
-    ./bootstrap --force
-
-    cd $currdir
-}
-
-PACKAGES =+ "${PN}-python-dbg ${PN}-python"
-
-FILES_${PN} += " \
-    ${datadir}/mime \
-    ${datadir}/icons \
-"
-
-FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR} ${datadir}/${PN}/python"
-FILES_${PN}-python-dbg = "${PYTHON_SITEPACKAGES_DIR}/.debug"
-RDEPENDS_${PN}-python = "python"
-
-# for e.g kde's oxygen-fonts
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/fontforge/fontforge_20161012.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fontforge/fontforge_20161012.bb
new file mode 100644
index 0000000..1c3376d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/fontforge/fontforge_20161012.bb
@@ -0,0 +1,60 @@
+SUMMARY = "A font editor"
+HOMEPAGE = "http://fontforge.github.io/en-US/"
+LICENSE = "BSD-3-Clause & GPLv3"
+LIC_FILES_CHKSUM = " \
+    file://COPYING.gplv3;md5=d32239bcb673463ab874e80d47fae504 \
+    file://LICENSE;md5=3f922b42ed0033fa0fd4cd3268f6429c \
+"
+
+DEPENDS = "glib-2.0 pango giflib tiff libxml2 jpeg python libtool uthash gnulib"
+DEPENDS_append_class-target = " libxi"
+
+inherit autotools pkgconfig pythonnative distro_features_check gettext
+
+REQUIRED_DISTRO_FEATURES_append_class-target = " x11"
+
+SRC_URI = "git://github.com/${BPN}/${BPN}.git"
+# tag 20161012
+SRCREV = "072edb0235cd163d6c3391da9cc3754c3c66f47a"
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF_append_class-native = " with_x=no"
+
+do_configure_prepend() {
+    # uthash sources are expected in uthash/src
+    currdir=`pwd`
+    cd ${S}
+
+    mkdir -p uthash/src
+    cp ${STAGING_INCDIR}/ut*.h uthash/src
+
+    # avoid bootstrap cloning gnulib on every configure
+    cat >.gitmodules <<EOF
+[submodule "gnulib"]
+       path = gnulib
+       url = git://git.sv.gnu.org/gnulib
+EOF
+    cp -rf ${STAGING_DATADIR}/gnulib ${S}
+
+    # --force to avoid errors on reconfigure e.g if recipes changed we depend on
+    # | bootstrap: running: libtoolize --quiet
+    # | libtoolize:   error: 'libltdl/COPYING.LIB' exists: use '--force' to overwrite
+    # | ...
+    ./bootstrap --force
+
+    cd $currdir
+}
+
+PACKAGES =+ "${PN}-python-dbg ${PN}-python"
+
+FILES_${PN} += " \
+    ${datadir}/mime \
+    ${datadir}/icons \
+"
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR} ${datadir}/${PN}/python"
+FILES_${PN}-python-dbg = "${PYTHON_SITEPACKAGES_DIR}/.debug"
+RDEPENDS_${PN}-python = "python"
+
+# for e.g kde's oxygen-fonts
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gegl/gegl_0.3.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gegl/gegl_0.3.4.bb
index 9de8489..90f0216 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gegl/gegl_0.3.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gegl/gegl_0.3.4.bb
@@ -19,6 +19,8 @@
 SRC_URI[md5sum] = "c19478321594d715a4cb324a0decda6f"
 SRC_URI[sha256sum] = "846290a790854d1e6b7c17a2d6f82ad7cb14c72e240bd3b81b98cc0ceddbc3ec"
 
+LDFLAGS += "-lm"
+
 # There are a couple of non-symlink .so files installed into libdir, which need to go into main package
 FILES_${PN}_append = " ${libdir}/gegl-0.3/*.so ${libdir}/gegl-0.3/*.json ${libdir}/libgegl-npd-0.3.so ${libdir}/libgegl-sc-0.3.so"
 FILES_${PN}-dev_append = " ${libdir}/gegl-0.3/*.la ${libdir}/libgegl-0.3.so"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gimp/gimp_2.8.18.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gimp/gimp_2.8.18.bb
deleted file mode 100644
index 1f83523..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gimp/gimp_2.8.18.bb
+++ /dev/null
@@ -1,48 +0,0 @@
-SUMMARY = "The GIMP is the GNU Image Manipulation Program"
-HOMEPAGE = "http://www.gimp.org"
-SECTION = "x11/graphics"
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-DEPENDS = " \
-    gdk-pixbuf-native \
-    intltool-native \
-    gtk+ \
-    babl \
-    gegl \
-    libart-lgpl \
-    jpeg \
-    libpng \
-    libexif \
-    tiff \
-    lcms \
-    poppler \
-    jasper \
-    bzip2 \
-    libgudev \
-"
-DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxmu libxpm', '', d)}"
-
-inherit gnome gtk-doc
-
-SRC_URI = " \
-    http://ftp.gimp.org/pub/gimp/v2.8/gimp-${PV}.tar.bz2 \
-    file://0001-configure-ac-do-not-check-for-freetype-config.patch \
-    file://bump_Babl-GEGL_versions.patch \
-"
-SRC_URI[md5sum] = "5adaa11a68bc8a42bb2c778fee4d389c"
-SRC_URI[sha256sum] = "39dd2247c678deaf5cc664397d3c6bd4fb910d3472290fd54b52b441b5815441"
-
-EXTRA_OECONF = "--disable-python \
-                --without-webkit \
-                --without-wmf"
-
-do_configure_append() {
-    find ${B} -name Makefile | xargs sed -i s:'-I$(includedir)':'-I.':g
-    find ${B} -name Makefile | xargs sed -i s:'-I/usr/include':'-I${STAGING_INCDIR}':g
-}
-
-CFLAGS += "-fPIC"
-
-FILES_${PN}-dbg += "${libdir}/gimp/2.0/*/.debug"
-FILES_${PN}  += "${datadir}/appdata"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gimp/gimp_2.8.20.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gimp/gimp_2.8.20.bb
new file mode 100644
index 0000000..9588ab0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gimp/gimp_2.8.20.bb
@@ -0,0 +1,50 @@
+SUMMARY = "The GIMP is the GNU Image Manipulation Program"
+HOMEPAGE = "http://www.gimp.org"
+SECTION = "x11/graphics"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = " \
+    gdk-pixbuf-native \
+    intltool-native \
+    libxslt-native \
+    gtk+ \
+    babl \
+    gegl \
+    libart-lgpl \
+    jpeg \
+    libpng \
+    libexif \
+    tiff \
+    lcms \
+    poppler \
+    jasper \
+    bzip2 \
+    libgudev \
+    libmng \
+"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxmu libxpm', '', d)}"
+
+inherit gnome gtk-doc
+
+SRC_URI = " \
+    http://ftp.gimp.org/pub/gimp/v2.8/gimp-${PV}.tar.bz2 \
+    file://0001-configure-ac-do-not-check-for-freetype-config.patch \
+    file://bump_Babl-GEGL_versions.patch \
+"
+SRC_URI[md5sum] = "d405640c426b234d6efc36fb4f5bae57"
+SRC_URI[sha256sum] = "939ca1df70be865c672ffd654f4e20f188121d01601c5c90237214101533c805"
+
+EXTRA_OECONF = "--disable-python \
+                --without-webkit \
+                --without-wmf"
+
+do_configure_append() {
+    find ${B} -name Makefile | xargs sed -i s:'-I$(includedir)':'-I.':g
+    find ${B} -name Makefile | xargs sed -i s:'-I/usr/include':'-I${STAGING_INCDIR}':g
+}
+
+CFLAGS += "-fPIC"
+
+FILES_${PN}-dbg += "${libdir}/gimp/2.0/*/.debug"
+FILES_${PN}  += "${datadir}/appdata"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/glcompbench/glcompbench/0001-waf-Disable-errors-due-to-Wdeprecated.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/glcompbench/glcompbench/0001-waf-Disable-errors-due-to-Wdeprecated.patch
new file mode 100644
index 0000000..deb6016
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/glcompbench/glcompbench/0001-waf-Disable-errors-due-to-Wdeprecated.patch
@@ -0,0 +1,31 @@
+From 49297e2fbe0420a255cbe67989d0ec539125412c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 23 Apr 2017 10:38:24 -0700
+Subject: [PATCH] waf: Disable errors due to -Wdeprecated
+
+throw() has been deprecated in c++11 and removed
+from c++17, gcc7 is more pedandic about this warning
+we therefore add a workaround to ignore this warning
+for now.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ wscript | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/wscript b/wscript
+index 485a9fb..7f59761 100644
+--- a/wscript
++++ b/wscript
+@@ -79,7 +79,7 @@ def configure(ctx):
+             ctx.check_cfg(package = pkg, uselib_store = uselib, args = '--cflags --libs',
+                           mandatory = True)
+ 
+-    ctx.env.append_unique('CXXFLAGS', '-Wall -Werror -std=c++11 -Wextra'.split(' '))
++    ctx.env.append_unique('CXXFLAGS', '-Wall -Werror -std=c++11 -Wextra -Wno-error=deprecated'.split(' '))
+ 
+     # Prepend -O# and -g flags so that they can be overriden by the CFLAGS environment variable
+     if Options.options.opt:
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/glcompbench/glcompbench_2012.08.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/glcompbench/glcompbench_2012.08.bb
index 7cf9692..e846585 100755
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/glcompbench/glcompbench_2012.08.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/glcompbench/glcompbench_2012.08.bb
@@ -11,7 +11,8 @@
            file://Fix_space_issues.patch \
            file://Fix_auto_ptr_deprecated.patch \
            file://0001-build-Specify-std-c-11-on-cmdline.patch \
-"
+           file://0001-waf-Disable-errors-due-to-Wdeprecated.patch \
+           "
 
 SRC_URI[md5sum] = "c939d9156fe940960098f38707fea827"
 SRC_URI[sha256sum] = "b04b738cec06c6786ceafa86e4735fd8b971c078265754854ef356b0379542ee"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/glm/glm_0.9.8.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/glm/glm_0.9.8.4.bb
new file mode 100644
index 0000000..2d2e9ad
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/glm/glm_0.9.8.4.bb
@@ -0,0 +1,22 @@
+SUMMARY = "OpenGL Mathematics Library"
+DESCRIPTION = "OpenGL Mathematics (GLM) is a header only C++ \
+mathematics library for graphics software based on the OpenGL \
+Shading Language (GLSL) specifications."
+HOMEPAGE = "https://glm.g-truc.net"
+BUGTRACKER = "https://github.com/g-truc/glm/issues"
+
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://copying.txt;md5=4431606d144252143c9c3df384a74cad"
+
+SRC_URI = "git://github.com/g-truc/glm;protocol=https"
+
+SRCREV = "5dcc56489e1b66dfd5bca751fa9b8dc68059e008"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+FILES_${PN}-dev += "${libdir}/cmake"
+RDEPENDS_${PN}-dev = ""
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gphoto2/libgphoto2-2.5.8/0001-scripts-remove-bashisms.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gphoto2/libgphoto2-2.5.8/0001-scripts-remove-bashisms.patch
new file mode 100644
index 0000000..0e0dc87
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gphoto2/libgphoto2-2.5.8/0001-scripts-remove-bashisms.patch
@@ -0,0 +1,149 @@
+From c00e63e97d8718836ba011d9172128732eecf001 Mon Sep 17 00:00:00 2001
+From: Ismo Puustinen <ismo.puustinen@intel.com>
+Date: Tue, 24 Jan 2017 22:24:05 +0200
+Subject: [PATCH] scripts: remove bashisms.
+
+Convert bash scripts to more generic shell scripts. This removes the
+strict bash dependency and the scripts should now run with any posix
+shell. Also fix the issues reported by shellcheck while at it.
+
+Upstream-status: Accepted [https://github.com/gphoto/libgphoto2/commit/39b4395532058c0edb9a56d0ff04e48a472e4743]
+
+---
+ packaging/generic/check-ptp-camera          | 12 ++++++------
+ packaging/linux-hotplug/gphoto-set-procperm | 14 +++++++-------
+ packaging/linux-hotplug/usbcam.console      |  4 ++--
+ packaging/linux-hotplug/usbcam.group        |  2 +-
+ packaging/linux-hotplug/usbcam.user         |  2 +-
+ packaging/linux-hotplug/usbcam.x11-app      |  4 ++--
+ 6 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/packaging/generic/check-ptp-camera b/packaging/generic/check-ptp-camera
+index 1793fc8..bc3c6ac 100644
+--- a/packaging/generic/check-ptp-camera
++++ b/packaging/generic/check-ptp-camera
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+ # License as published by the Free Software Foundation; either
+@@ -20,13 +20,13 @@ INTERFACE="${1:-06/01/01}"
+ 
+ BASENAME=${DEVPATH##*/}
+ for d in /sys/${DEVPATH}/${BASENAME}:*; do
+-	[[ -d ${d} ]] || continue
+-	INTERFACEID="$(< ${d}/bInterfaceClass)"
+-	INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceSubClass)"
+-	INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceProtocol)"
++	[ -d "${d}" ] || continue
++	INTERFACEID="$(cat "${d}"/bInterfaceClass)"
++	INTERFACEID="${INTERFACEID}/$(cat "${d}"/bInterfaceSubClass)"
++	INTERFACEID="${INTERFACEID}/$(cat "${d}"/bInterfaceProtocol)"
+ 
+ 	#echo ${d}: ${INTERFACEID}
+-	if [[ ${INTERFACE} == ${INTERFACEID} ]]; then
++	if [ "${INTERFACE}" = "${INTERFACEID}" ]; then
+ 		# Found interface
+ 		exit 0
+ 	fi
+diff --git a/packaging/linux-hotplug/gphoto-set-procperm b/packaging/linux-hotplug/gphoto-set-procperm
+index d72ee68..977cbf5 100644
+--- a/packaging/linux-hotplug/gphoto-set-procperm
++++ b/packaging/linux-hotplug/gphoto-set-procperm
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+ # License as published by the Free Software Foundation; either
+@@ -18,22 +18,22 @@
+ # This is taken from Fedora Core gphoto2 package.
+ # http://cvs.fedora.redhat.com/viewcvs/*checkout*/devel/gphoto2/gphoto-set-procperm
+ 
+-console_user=`cat /var/run/console/console.lock` 
++console_user=$(cat /var/run/console/console.lock)
+ 
+ if [ -z "$console_user" ] ; then
+   exit 1 
+ fi
+ 
+-if [ -z "$HAL_PROP_USB_BUS_NUMBER" -o -z "$HAL_PROP_USB_LINUX_DEVICE_NUMBER" ] ; then
++if [ -z "$HAL_PROP_USB_BUS_NUMBER" ] || [ -z "$HAL_PROP_USB_LINUX_DEVICE_NUMBER" ] ; then
+   exit 1 
+ fi
+ 
+-if [ $HAL_PROP_USB_BUS_NUMBER -lt 0 -o  $HAL_PROP_USB_LINUX_DEVICE_NUMBER -lt 0 ] ; then
++if [ "$HAL_PROP_USB_BUS_NUMBER" -lt 0 ] || [ "$HAL_PROP_USB_LINUX_DEVICE_NUMBER" -lt 0 ] ; then
+   exit 1 
+ fi
+ 
+ 
+-bus_num=`printf %.3u $HAL_PROP_USB_BUS_NUMBER`
+-dev_num=`printf %.3u $HAL_PROP_USB_LINUX_DEVICE_NUMBER`
++bus_num=$(printf %.3u "$HAL_PROP_USB_BUS_NUMBER")
++dev_num=$(printf %.3u "$HAL_PROP_USB_LINUX_DEVICE_NUMBER")
+ 
+-chown $console_user /proc/bus/usb/$bus_num/$dev_num 
++chown "$console_user" /proc/bus/usb/"$bus_num"/"$dev_num"
+diff --git a/packaging/linux-hotplug/usbcam.console b/packaging/linux-hotplug/usbcam.console
+index d72128f..7ac6dc5 100755
+--- a/packaging/linux-hotplug/usbcam.console
++++ b/packaging/linux-hotplug/usbcam.console
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+ # License as published by the Free Software Foundation; either
+@@ -50,7 +50,7 @@ then
+         /var/lock/console.lock
+     do
+         if [ -f "$conlock" ]; then
+-	    CONSOLEOWNER=`cat $conlock`
++            CONSOLEOWNER=$(cat $conlock)
+         fi
+     done
+     if [ -n "$CONSOLEOWNER" ]
+diff --git a/packaging/linux-hotplug/usbcam.group b/packaging/linux-hotplug/usbcam.group
+index f96c33d..8761fac 100755
+--- a/packaging/linux-hotplug/usbcam.group
++++ b/packaging/linux-hotplug/usbcam.group
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+ # License as published by the Free Software Foundation; either
+diff --git a/packaging/linux-hotplug/usbcam.user b/packaging/linux-hotplug/usbcam.user
+index c46f155..a3ba71a 100644
+--- a/packaging/linux-hotplug/usbcam.user
++++ b/packaging/linux-hotplug/usbcam.user
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+ # License as published by the Free Software Foundation; either
+diff --git a/packaging/linux-hotplug/usbcam.x11-app b/packaging/linux-hotplug/usbcam.x11-app
+index 023ae9b..618e7db 100644
+--- a/packaging/linux-hotplug/usbcam.x11-app
++++ b/packaging/linux-hotplug/usbcam.x11-app
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+ # License as published by the Free Software Foundation; either
+@@ -69,7 +69,7 @@ then
+     if [ "${USER}" != "root" ]
+     then
+ 	# we don't want to run this as root. definitely not.
+-	cd "${DIRECTORY}"
++	cd "${DIRECTORY}" || exit 1
+ 	usrhome=~${USER}
+ 	"${SU}" "${USER}" -c "${ENV} DISPLAY=${DISPLAY} HOME=${usrhome} ${X11_APP}"
+     fi
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.8.bb
index 098da79..5e798ef 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.8.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.8.bb
@@ -16,6 +16,7 @@
            file://0001-configure.ac-remove-AM_PO_SUBDIRS.patch \
            file://0002-correct-jpeg-memsrcdest-support.patch \
            file://avoid_using_sprintf.patch \
+           file://0001-scripts-remove-bashisms.patch \
 "
 
 SRC_URI[libgphoto2.md5sum] = "873ab01aced49c6b92a98e515db5dcef"
@@ -23,7 +24,7 @@
 
 inherit autotools pkgconfig gettext lib_package
 
-EXTRA_OECONF = " --with-drivers=all udevscriptdir=/lib/udev ac_cv_lib_ltdl_lt_dlcaller_register=yes"
+EXTRA_OECONF = " --with-drivers=all udevscriptdir=${nonarch_base_libdir}/udev ac_cv_lib_ltdl_lt_dlcaller_register=yes"
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[gd] = ",--without-gdlib,gd"
@@ -47,7 +48,6 @@
 PACKAGES =+ "libgphotoport libgphoto2-camlibs"
 FILES_libgphoto2-camlibs = "${libdir}/libgphoto2*/*/*.so*"
 RRECOMMENDS_${PN} = "libgphoto2-camlibs"
-RDEPENDS_${PN} = "bash"
 
 FILES_libgphotoport = "${libdir}/libgphoto2_port.so.*"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gtkperf/gtkperf/0001-Include-stdlib.h-for-exit-API.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gtkperf/gtkperf/0001-Include-stdlib.h-for-exit-API.patch
new file mode 100644
index 0000000..d529ddd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gtkperf/gtkperf/0001-Include-stdlib.h-for-exit-API.patch
@@ -0,0 +1,34 @@
+From f8ac48abded02353918b02db38629988bd111c46 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 08:19:44 -0700
+Subject: [PATCH 1/2] Include stdlib.h for exit() API
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes
+main.c:81: warning: incompatible implicit declaration of built-in function ‘exit’
+
+Patch from Debian
+http://sources.debian.net/src/gtkperf/0.40%2Bds-2/debian/patches/01-include_stdlib.patch/
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/main.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/main.c b/src/main.c
+index 888eb36..c226799 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -11,6 +11,7 @@
+ #endif
+ 
+ #include <getopt.h>
++#include <stdlib.h>
+ 
+ #include "interface.h"
+ #include "support.h"
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gtkperf/gtkperf/0002-timing.c-Fix-format-security-errors.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gtkperf/gtkperf/0002-timing.c-Fix-format-security-errors.patch
new file mode 100644
index 0000000..0548040
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gtkperf/gtkperf/0002-timing.c-Fix-format-security-errors.patch
@@ -0,0 +1,42 @@
+From 47974b8473c5b928f6742caee466f5c2d4d2e9eb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 08:22:26 -0700
+Subject: [PATCH 2/2] timing.c: Fix format-security errors
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/timing.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/timing.c b/src/timing.c
+index 0b8f0eb..c0668c9 100644
+--- a/src/timing.c
++++ b/src/timing.c
+@@ -97,7 +97,7 @@ add_test_info_time (AppData * appdata)
+ 	gtk_text_buffer_insert (appdata->textview_info_buffer, &iter,
+ 				timestring, -1);
+ 
+-	g_printf (timestring);
++	g_printf ("%s", timestring);
+ 
+ }
+ 
+@@ -129,7 +129,7 @@ add_test_info_end (AppData * appdata)
+ 	gtk_statusbar_push (GTK_STATUSBAR (appdata->statusbar_main), 0,
+ 			    " Test Finished");
+ 
+-	g_printf (timestring);
++	g_printf ("%s", timestring);
+ 
+ }
+ 
+@@ -154,5 +154,5 @@ add_test_info_start (AppData * appdata)
+ 	gtk_statusbar_push (GTK_STATUSBAR (appdata->statusbar_main), 0,
+ 			    " Running tests...");
+ 
+-	g_printf (timestring);
++	g_printf ("%s", timestring);
+ }
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gtkperf/gtkperf_0.40.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gtkperf/gtkperf_0.40.bb
index e404a7a..2db91904 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/gtkperf/gtkperf_0.40.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/gtkperf/gtkperf_0.40.bb
@@ -4,7 +4,10 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
 SRC_URI = "http://prdownloads.sourceforge.net/${BPN}/${BPN}_${PV}.tar.gz \
-           file://Makevars"
+           file://Makevars \
+           file://0001-Include-stdlib.h-for-exit-API.patch \
+           file://0002-timing.c-Fix-format-security-errors.patch \
+           "
 
 SRC_URI[md5sum] = "4331dde4bb83865e15482885fcb0cc53"
 SRC_URI[sha256sum] = "9704344e732038eecbd007dd996a56293a6b027b5b76f3f036273a3fae1ab27b"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/libmng/libmng_2.0.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/libmng/libmng_2.0.3.bb
new file mode 100644
index 0000000..ba928d2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/libmng/libmng_2.0.3.bb
@@ -0,0 +1,23 @@
+# Copyright (C) 2016 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Development files for the Multiple-image Network Graphics library"
+HOMEPAGE = "http://www.libpng.org/pub/mng/"
+LICENSE = "Zlib"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=32becdb8930f90eab219a8021130ec09"
+SECTION = "devel"
+DEPENDS = "zlib"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "7e9a12ba2a99dff7e736902ea07383d4"
+SRC_URI[sha256sum] = "cf112a1fb02f5b1c0fce5cab11ea8243852c139e669c44014125874b14b7dfaa"
+
+inherit autotools-brokensep pkgconfig
+
+PACKAGECONFIG ??= "jpeg"
+
+PACKAGECONFIG[jpeg] = "--with-jpeg,--without-jpeg,jpeg"
+PACKAGECONFIG[lcms] = "--with-lcms2,--without-lcms2,lcms"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/libsexy/libsexy_0.1.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/libsexy/libsexy_0.1.11.bb
index 86b4958..2ba1ebb 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/libsexy/libsexy_0.1.11.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/libsexy/libsexy_0.1.11.bb
@@ -4,3 +4,5 @@
 
 SRC_URI[md5sum] = "33c079a253270ec8bfb9508e4bb30754"
 SRC_URI[sha256sum] = "8c4101a8cda5fccbba85ba1a15f46f2cf75deaa8b3c525ce5b135b9e1a8fe49e"
+
+PNBLACKLIST[libsexy] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130607/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/libvncserver/libvncserver/0002-format_string.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/libvncserver/libvncserver/0002-format_string.patch
new file mode 100644
index 0000000..566a208
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/libvncserver/libvncserver/0002-format_string.patch
@@ -0,0 +1,21 @@
+From: Luca Falavigna <dktrkranz@debian.org>
+Date: Tue, 27 Jan 2015 01:26:04 +0000
+Subject: format_string
+
+---
+ client_examples/gtkvncviewer.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client_examples/gtkvncviewer.c b/client_examples/gtkvncviewer.c
+index 261b2da..861e4e3 100644
+--- a/client_examples/gtkvncviewer.c
++++ b/client_examples/gtkvncviewer.c
+@@ -588,7 +588,7 @@ static void GtkDefaultLog (const char *format, ...)
+ 
+ 	time (&log_clock);
+ 	strftime (buf, 255, "%d/%m/%Y %X ", localtime (&log_clock));
+-	fprintf (stdout, buf);
++	fprintf (stdout, "%s", buf);
+ 
+ 	vfprintf (stdout, format, args);
+ 	fflush (stdout);
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/libvncserver/libvncserver_0.9.10.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/libvncserver/libvncserver_0.9.10.bb
index 387202b..0eba87c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/libvncserver/libvncserver_0.9.10.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/libvncserver/libvncserver_0.9.10.bb
@@ -14,6 +14,7 @@
     ${DEBIAN_MIRROR}/main/libv/libvncserver/libvncserver_0.9.10+dfsg.orig.tar.xz \
     file://0001-remove-webclients-build.patch \
     file://0002-common-add-sha1.patch \
+    file://0002-format_string.patch \
 "
 
 SRC_URI[md5sum] = "e883b6c7bd339a5e1c48645051abe5c4"
@@ -21,4 +22,6 @@
 
 S = "${WORKDIR}/${BPN}-LibVNCServer-${PV}"
 
+EXTRA_OECONF += "--without-libva"
+
 TARGET_LDFLAGS += "-lgcrypt"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/lxdm/lxdm/0001-check-for-libexecinfo-providing-backtrace-APIs.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/lxdm/lxdm/0001-check-for-libexecinfo-providing-backtrace-APIs.patch
new file mode 100644
index 0000000..f9fd497
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/lxdm/lxdm/0001-check-for-libexecinfo-providing-backtrace-APIs.patch
@@ -0,0 +1,36 @@
+From 1d2425febf2020e38db70188df582acc9f37b136 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 30 Mar 2017 13:01:33 -0700
+Subject: [PATCH] check for libexecinfo providing backtrace() APIs
+
+on musl it depends on external library to provide backtrace APIs
+unlike glibc where it is bundled in
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index aa3291c..b15f65d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -15,6 +15,7 @@ AM_PROG_CC_C_O
+ 
+ # Checks for libraries.
+ AC_CHECK_LIB([crypt], [crypt])
++AC_CHECK_LIB([execinfo], [backtrace])
+ 
+ # Check for PAM support
+ AC_ARG_WITH(pam, AC_HELP_STRING([--with-pam],[Use PAM for authentication]),
+@@ -33,6 +34,7 @@ AM_CONDITIONAL(HAVE_PAM, [test -n "$USE_PAM" -a "x$USE_PAM" != xno ])
+ # Checks for header files.
+ AC_PATH_X
+ AC_CHECK_HEADERS([shadow.h stdlib.h string.h unistd.h utmpx.h])
++AC_CHECK_HEADERS([execinfo.h])
+ 
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_TYPE_PID_T
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/lxdm/lxdm_0.5.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/lxdm/lxdm_0.5.3.bb
index 407129d..c98c3a1 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/lxdm/lxdm_0.5.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/lxdm/lxdm_0.5.3.bb
@@ -2,13 +2,13 @@
 HOMEPAGE = "http://blog.lxde.org/?p=531"
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-SRC_URI = " \
-    ${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}%20${PV}/${BPN}-${PV}.tar.xz \
-    file://lxdm.conf \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'file://lxdm-pam file://lxdm-pam-debug', '', d)} \
-    ${@bb.utils.contains("DISTRO_TYPE", "debug", "", "file://0001-lxdm.conf.in-blacklist-root-for-release-images.patch",d)} \
-    file://0002-let-autotools-create-lxdm.conf.patch \
-"
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}%20${PV}/${BPN}-${PV}.tar.xz \
+           file://lxdm.conf \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'file://lxdm-pam file://lxdm-pam-debug', '', d)} \
+           ${@bb.utils.contains("DISTRO_TYPE", "debug", "", "file://0001-lxdm.conf.in-blacklist-root-for-release-images.patch",d)} \
+           file://0002-let-autotools-create-lxdm.conf.patch \
+           file://0001-check-for-libexecinfo-providing-backtrace-APIs.patch \
+           "
 SRC_URI[md5sum] = "061caae432634e6db38bbdc84bc6ffa0"
 SRC_URI[sha256sum] = "4891efee81c72a400cc6703e40aa76f3f3853833d048b72ec805da0f93567f2f"
 
@@ -16,6 +16,7 @@
 
 DEPENDS = "virtual/libintl intltool-native cairo dbus gdk-pixbuf glib-2.0 gtk+ virtual/libx11 libxcb pango iso-codes"
 DEPENDS += "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "", "consolekit", d)}"
+DEPENDS_append_libc-musl = " libexecinfo"
 
 # combine oe-core way with angstrom DISTRO_TYPE
 DISTRO_TYPE ?= "${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "debug", "",d)}"
@@ -25,6 +26,7 @@
 REQUIRED_DISTRO_FEATURES = "x11"
 
 CFLAGS_append = " -fno-builtin-fork -fno-builtin-memset -fno-builtin-strstr "
+LDFLAGS_append_libc-musl = " -lexecinfo"
 
 EXTRA_OECONF += "--enable-gtk3=no --enable-password=yes --with-x -with-xconn=xcb \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/ --disable-consolekit', '--without-systemdsystemunitdir', d)} \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/pango/pangomm_2.36.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/pango/pangomm_2.36.0.bb
deleted file mode 100644
index f738153..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/pango/pangomm_2.36.0.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "C++ bindings for the pango library"
-SECTION = "libs"
-LICENSE = "LGPLv2.1 & GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
-                    file://COPYING.tools;md5=751419260aa954499f7abaabaa882bbe"
-
-DEPENDS = "mm-common cairomm glibmm pango"
-
-SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
-
-SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/pangomm/${SHRT_VER}/pangomm-${PV}.tar.xz"
-SRC_URI[md5sum] = "62910723211d86ab825b666b479871c9"
-SRC_URI[sha256sum] = "a8d96952c708d7726bed260d693cece554f8f00e48b97cccfbf4f5690b6821f0"
-
-inherit autotools pkgconfig
-
-EXTRA_OECONF = " --disable-documentation "
-
-FILES_${PN} = "${libdir}/lib*.so.*"
-FILES_${PN}-dev += "${libdir}/*/include/ ${libdir}/pangomm-*/"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/pango/pangomm_2.40.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/pango/pangomm_2.40.1.bb
new file mode 100644
index 0000000..02bb1cc
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/pango/pangomm_2.40.1.bb
@@ -0,0 +1,21 @@
+SUMMARY = "C++ bindings for the pango library"
+SECTION = "libs"
+LICENSE = "LGPLv2.1 & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
+                    file://COPYING.tools;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "mm-common cairomm glibmm pango"
+
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
+
+SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/pangomm/${SHRT_VER}/pangomm-${PV}.tar.xz"
+SRC_URI[md5sum] = "874eadd9434613dbacf0272c82c3ac23"
+SRC_URI[sha256sum] = "9762ee2a2d5781be6797448d4dd2383ce14907159b30bc12bf6b08e7227be3af"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = " --disable-documentation "
+
+FILES_${PN} = "${libdir}/lib*.so.*"
+FILES_${PN}-dev += "${libdir}/*/include/ ${libdir}/pangomm-*/"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/slim/slim_1.3.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/slim/slim_1.3.2.bb
index 71359e0..2fbdcab 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/slim/slim_1.3.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/slim/slim_1.3.2.bb
@@ -79,4 +79,4 @@
 sed -i /slim/d $D${sysconfdir}/X11/default-display-manager || true
 }
 
-PNBLACKLIST[slim] ?= "does not build with distroless qemuarm as reported in 'State of bitbake world' thread, nobody volunteered to fix them"
+PNBLACKLIST[slim] ?= "does not build with distroless qemuarm as reported in 'State of bitbake world' thread, nobody volunteered to fix them - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/terminus-font/terminus-font_4.38.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/terminus-font/terminus-font_4.38.bb
index e5bea97..4c8399d 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/terminus-font/terminus-font_4.38.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/terminus-font/terminus-font_4.38.bb
@@ -16,7 +16,7 @@
 
 inherit allarch fontcache
 
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[x11] = ""
 
 # Don't use font cache mecanism for console packages
@@ -43,3 +43,5 @@
 FILES_${PN}-consolefonts = "${datadir}/consolefonts"
 FILES_${PN}-consoletrans = "${datadir}/consoletrans"
 FILES_${PN}-pcf = "${datadir}/fonts/terminus"
+
+PNBLACKLIST[terminus-font] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130638/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/tesseract/tesseract-lang_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/tesseract/tesseract-lang_git.bb
index 28ea33e..ac36a91 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/tesseract/tesseract-lang_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/tesseract/tesseract-lang_git.bb
@@ -18,7 +18,7 @@
 python populate_packages_prepend () {
     tessdata_dir= d.expand('${datadir}/tessdata')
     pkgs = do_split_packages(d, tessdata_dir, '^([a-z_]*)\.*', '${BPN}-%s', 'tesseract-ocr language files for %s', extra_depends='')
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
     d.appendVar('RDEPENDS_' + pn, ' '+' '.join(pkgs))
 }
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/ttf-fonts/ttf-abyssinica_1.500.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/ttf-fonts/ttf-abyssinica_1.500.bb
index cd96fbb..ce003e9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/ttf-fonts/ttf-abyssinica_1.500.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/ttf-fonts/ttf-abyssinica_1.500.bb
@@ -6,7 +6,7 @@
 LIC_FILES_CHKSUM = "file://OFL.txt;md5=1694c7fc245cdc85c9971db707928159"
 
 SRCNAME = "AbyssinicaSIL"
-SRC_URI = "http://software.sil.org/downloads/d/abyssinica/${SRCNAME}-${PV}.zip"
+SRC_URI = "http://software.sil.org/downloads/r/abyssinica/${SRCNAME}-${PV}.zip"
 S = "${WORKDIR}/${SRCNAME}-${PV}"
 
 SRC_URI[md5sum] = "a3d943d18e303197c8d3d92d2de54d1e"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/vdpau/libvdpau_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/vdpau/libvdpau_git.bb
new file mode 100644
index 0000000..31f4df4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/vdpau/libvdpau_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Video Decode and Presentation API for UNIX"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=83af8811a28727a13f04132cc33b7f58"
+
+DEPENDS = "virtual/libx11 libxext dri2proto"
+
+PV = "1.1.1+git${SRCPV}"
+
+SRCREV = "a21bf7aa438f5dd40d0a300a3167aa3d6f26dccc"
+SRC_URI = "git://anongit.freedesktop.org/vdpau/libvdpau"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+do_install_append() {
+    rm -f ${D}${libdir}/*/*.la
+}
+
+FILES_${PN}-dbg += "${libdir}/vdpau/.debug"
+FILES_${PN}-dev += "${libdir}/vdpau/lib*${SOLIBSDEV}"
+FILES_${PN} += "${libdir}/vdpau/lib*${SOLIBS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/wayland/wayland-fits_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/wayland/wayland-fits_git.bb
index d060c47..2af6697 100755
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/wayland/wayland-fits_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/wayland/wayland-fits_git.bb
@@ -31,3 +31,5 @@
 
 FILES_${PN} += "${bindir}/wfits ${libdir}/weston/*.so"
 FILES_${PN}-dbg += "${bindir}/.debug ${libdir}/weston/.debug ${prefix}/src"
+
+PNBLACKLIST[wayland-fits] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130632/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xdotool/xdotool_1.20100416.2809.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xdotool/xdotool_1.20100416.2809.bb
index 474d298..b68e994 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xdotool/xdotool_1.20100416.2809.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xdotool/xdotool_1.20100416.2809.bb
@@ -7,7 +7,7 @@
 
 PR = "r1"
 
-inherit distro_features_check
+inherit distro_features_check pkgconfig
 # depends on virtual/libx11
 REQUIRED_DISTRO_FEATURES = "x11"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-app/xstdcmap_1.0.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-app/xstdcmap_1.0.3.bb
index 3f5511e..99f7036 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-app/xstdcmap_1.0.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-app/xstdcmap_1.0.3.bb
@@ -8,8 +8,9 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=2b08d9e2e718ac83e6fe2b974d4b5fd8"
 
-RDEPENDS_${PN} = "libxmu"
+DEPENDS += "libxmu"
 BBCLASSEXTEND = "native"
 
 SRC_URI[md5sum] = "eb5473acaef15a5db9b50df29c6a7f90"
 SRC_URI[sha256sum] = "f648e2b0cf16aa29856de998e2c7204be39dc1f8daeda9464d32288e0b580fc1"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-input-mtev_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-input-mtev_git.bb
index 547ec86..5f2adec 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-input-mtev_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-input-mtev_git.bb
@@ -5,7 +5,7 @@
 
 DEPENDS += "pixman"
 
-PNBLACKLIST[xf86-input-mtev] ?= "BROKEN: doesn't build with B!=S (Makefile without ${S} in sed call)"
+PNBLACKLIST[xf86-input-mtev] ?= "BROKEN: doesn't build with B!=S (Makefile without ${S} in sed call) - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "git://gitorious.org/xorg/xf86-input-mtev.git file://fix-it.patch"
 SRCREV = "1eb469166ffc095c5801475f057f911f97a6e641"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib_0.0.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib_0.0.6.bb
index 082c771..6a3689a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib_0.0.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib_0.0.6.bb
@@ -28,8 +28,8 @@
 do_install_append() {
     install -d ${D}/${datadir}/hal/fdi/policy/20thirdparty
     install -m 0644 ${WORKDIR}/10-x11-input-tslib.fdi ${D}/${datadir}/hal/fdi/policy/20thirdparty
-    install -d ${D}/lib/udev/rules.d
-    install -m 0644 ${WORKDIR}/99-xf86-input-tslib.rules ${D}/lib/udev/rules.d/
+    install -d ${D}${nonarch_base_libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/99-xf86-input-tslib.rules ${D}${nonarch_base_libdir}/udev/rules.d/
 }
 
-FILES_${PN} += "${datadir}/hal /lib/udev"
+FILES_${PN} += "${datadir}/hal ${nonarch_base_libdir}/udev"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-ati_7.6.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-ati_7.6.1.bb
deleted file mode 100644
index bffa7b0..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-ati_7.6.1.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-require recipes-graphics/xorg-driver/xorg-driver-video.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=aabff1606551f9461ccf567739af63dc"
-
-SUMMARY = "X.Org X server -- ATI Radeon video driver"
-
-DESCRIPTION = "Open-source X.org graphics driver for ATI Radeon graphics"
-
-DEPENDS += "virtual/libx11 libxvmc drm xf86driproto glproto \
-            virtual/libgl xineramaproto libpciaccess"
-
-COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
-
-SRC_URI[md5sum] = "ede86cd3d1b1d8882f0aea61d9e924ed"
-SRC_URI[sha256sum] = "2516d9eeb8da8bcd3a01365ed1314919777910fa904ab268af342b5693e1d34c"
-
-EXTRA_OECONF += "--disable-glamor"
-
-RDEPENDS_${PN} += "xserver-xorg-module-exa"
-RRECOMMENDS_${PN} += "linux-firmware-radeon"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-ati_7.8.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-ati_7.8.0.bb
new file mode 100644
index 0000000..a101008
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-ati_7.8.0.bb
@@ -0,0 +1,20 @@
+require recipes-graphics/xorg-driver/xorg-driver-video.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=aabff1606551f9461ccf567739af63dc"
+
+SUMMARY = "X.Org X server -- ATI Radeon video driver"
+
+DESCRIPTION = "Open-source X.org graphics driver for ATI Radeon graphics"
+
+DEPENDS += "virtual/libx11 libxvmc drm xf86driproto glproto \
+            virtual/libgl xineramaproto libpciaccess"
+
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+SRC_URI[md5sum] = "f34d04a755e761e03b459155fa3ddcbb"
+SRC_URI[sha256sum] = "401f5de772928f3dc4ce43a885adb0a47a2f61aa4a9e45d2ab3d184136a9d6fa"
+
+EXTRA_OECONF += "--disable-glamor"
+
+RDEPENDS_${PN} += "xserver-xorg-module-exa"
+RRECOMMENDS_${PN} += "linux-firmware-radeon"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-geode_2.11.16.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-geode_2.11.16.bb
index d267598..e543413 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-geode_2.11.16.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-geode_2.11.16.bb
@@ -13,4 +13,4 @@
 RDEPENDS_${PN} += "xserver-xorg-module-exa"
 
 # 2_2.11.16-r21.0/xf86-video-geode-2.11.16/src/gx_driver.c:376:20: error: implicit declaration of function 'xf86MapVidMem' [-Werror=implicit-function-declaration]
-PNBLACKLIST[xf86-video-geode] ?= "BROKEN, fails to build"
+PNBLACKLIST[xf86-video-geode] ?= "BROKEN, fails to build - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo_git.bb
index 74c066f..5818d0c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo_git.bb
@@ -21,3 +21,5 @@
 SRCREV = "cb9ed17035a79e49dde26a1e7e2bc5f10fd8144b"
 
 EXTRA_OECONF = " --disable-kms "
+
+PNBLACKLIST[xf86-video-glamo] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130629/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-nouveau_1.0.12.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-nouveau_1.0.12.bb
index 3a7507c..444189a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-nouveau_1.0.12.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-driver/xf86-video-nouveau_1.0.12.bb
@@ -15,3 +15,5 @@
 SRC_URI[md5sum] = "dc79910c7b9e32321cefc7af250c7765"
 SRC_URI[sha256sum] = "0ea057ad7fc31caba2d4e46c7e418fe2b3c762b04fb8d382f53383397fd8391e"
 
+
+PNBLACKLIST[xf86-video-nouveau] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130657/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-adobe-100dpi_1.0.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-adobe-100dpi_1.0.3.bb
index 85a4466..29229bb 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-adobe-100dpi_1.0.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-adobe-100dpi_1.0.3.bb
@@ -6,7 +6,7 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=5dfa0fdf45473b4ca0acf37d854df10e"
 
-DEPENDS = "util-macros-native font-util-native bdftopcf-native"
+DEPENDS = "util-macros-native font-util-native bdftopcf-native font-util"
 RDEPENDS_${PN} = "encodings font-util"
 RDEPENDS_${PN}_class-native = "font-util-native"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-adobe-utopia-100dpi_1.0.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-adobe-utopia-100dpi_1.0.4.bb
index 16e3d2c..898850b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-adobe-utopia-100dpi_1.0.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-adobe-utopia-100dpi_1.0.4.bb
@@ -6,7 +6,7 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=fa13e704b7241f60ef9105cc041b9732"
 
-DEPENDS = "util-macros-native font-util-native bdftopcf-native"
+DEPENDS = "util-macros-native font-util-native bdftopcf-native font-util"
 RDEPENDS_${PN} = "encodings font-util"
 RDEPENDS_${PN}_class-native = "font-util-native"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-bh-100dpi_1.0.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-bh-100dpi_1.0.3.bb
index 08ed6b6..4976e52 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-bh-100dpi_1.0.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-bh-100dpi_1.0.3.bb
@@ -6,7 +6,7 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=cffd5e9c4b61b3d74166ca74b99e460e"
 
-DEPENDS = "util-macros-native font-util-native bdftopcf-native"
+DEPENDS += "util-macros-native font-util-native bdftopcf-native font-util"
 RDEPENDS_${PN} = "encodings font-util"
 RDEPENDS_${PN}_class-native = "font-util-native"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-bh-lucidatypewriter-100dpi_1.0.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-bh-lucidatypewriter-100dpi_1.0.3.bb
index 5ded41a..6e0b33c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-bh-lucidatypewriter-100dpi_1.0.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-bh-lucidatypewriter-100dpi_1.0.3.bb
@@ -6,7 +6,7 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=0d221a9cd144806cb469735cc4775939"
 
-DEPENDS = "util-macros-native font-util-native bdftopcf-native"
+DEPENDS = "util-macros-native font-util-native bdftopcf-native font-util"
 RDEPENDS_${PN} = "encodings font-util"
 RDEPENDS_${PN}_class-native = "font-util-native"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-misc-misc_1.1.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-misc-misc_1.1.2.bb
index a7c284a..e4cd90a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-misc-misc_1.1.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/font-misc-misc_1.1.2.bb
@@ -6,7 +6,7 @@
 LICENSE = "PD"
 LIC_FILES_CHKSUM = "file://COPYING;md5=200c507f595ee97008c7c5c3e94ab9a8"
 
-DEPENDS = "util-macros-native font-util-native bdftopcf-native"
+DEPENDS = "util-macros-native font-util-native bdftopcf-native font-util"
 RDEPENDS_${PN} = "encodings font-util"
 
 inherit distro_features_check
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/xorg-fonts-100dpi.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/xorg-fonts-100dpi.bb
index 45e3f7b..fcf6826 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/xorg-fonts-100dpi.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xorg-font/xorg-fonts-100dpi.bb
@@ -12,3 +12,13 @@
     font-bh-lucidatypewriter-100dpi \
     font-bitstream-100dpi \
 "
+
+PNBLACKLIST[xorg-fonts-100dpi] ?= "Runtime depends on blacklisted font-adobe-100dpi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[xorg-fonts-100dpi] ?= "Runtime depends on blacklisted xorg-fonts-100dpi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[xorg-fonts-100dpi] ?= "Runtime depends on blacklisted font-bh-100dpi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[xorg-fonts-100dpi] ?= "Runtime depends on blacklisted font-adobe-utopia-100dpi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[xorg-fonts-100dpi] ?= "Runtime depends on blacklisted font-bh-lucidatypewriter-100dpi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0001-Don-t-install-Xsession-or-Xserver.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0001-Don-t-install-Xsession-or-Xserver.patch
new file mode 100644
index 0000000..26288d6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0001-Don-t-install-Xsession-or-Xserver.patch
@@ -0,0 +1,30 @@
+From c92ce6a4b3622874f820b5ec487a2b63f519826c Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 10 Nov 2016 14:33:05 +0200
+Subject: [PATCH] Don't install Xsession or Xserver
+
+The goal is to use Xsession and Xserver from xserver-nodm-init.
+Xsession scripts and xserver-common from this recipe will still
+be used as before.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index caa5de1..7e36bbc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -20,7 +20,5 @@ install-program:
+ 	install -m 755 run-calibrate.sh $(DESTDIR)$(PREFIX)/bin/run-calibrate.sh
+ 	install -m 644 X11/Xdefaults $(DESTDIR)/etc/X11/Xdefaults
+ 	install -m 755 X11/Xinit $(DESTDIR)/etc/X11/Xinit
+-	install -m 755 X11/Xserver $(DESTDIR)/etc/X11/Xserver
+-	install -m 755 X11/Xsession $(DESTDIR)/etc/X11/Xsession
+ 	install -m 755 X11/xserver-common $(DESTDIR)/etc/X11/xserver-common
+ 	install -m 755 X11/functions $(DESTDIR)/etc/X11/functions
+ 	install -d $(DESTDIR)/etc/X11/xmodmap
+-- 
+2.1.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0003-add-89xdgautostart-Xsession.d-script.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0003-add-89xdgautostart-Xsession.d-script.patch
deleted file mode 100644
index bf806a9..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0003-add-89xdgautostart-Xsession.d-script.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From a93a86c2ff1ca5eb35615f4e1568409ff342aa7f Mon Sep 17 00:00:00 2001
-From: Martin Jansa <Martin.Jansa@gmail.com>
-Date: Wed, 11 Apr 2012 14:29:41 +0200
-Subject: [PATCH 03/12] add 89xdgautostart Xsession.d script
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
----
- X11/Xsession.d/89xdgautostart |    9 +++++++++
- 1 files changed, 9 insertions(+), 0 deletions(-)
- create mode 100644 X11/Xsession.d/89xdgautostart
-
-diff --git a/X11/Xsession.d/89xdgautostart b/X11/Xsession.d/89xdgautostart
-new file mode 100644
-index 0000000..9886f9f
---- /dev/null
-+++ b/X11/Xsession.d/89xdgautostart
-@@ -0,0 +1,9 @@
-+#!/bin/sh
-+
-+XDGAUTOSTART=/etc/xdg/autostart
-+if [ -d $XDGAUTOSTART ] ; then
-+    for SCRIPT in $XDGAUTOSTART/*; do
-+        CMD=`grep ^Exec= $SCRIPT | cut -d '=' -f 2`
-+        $CMD &
-+    done
-+fi
--- 
-1.7.8.5
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0005-add-XWindowManager-Xsession.d-script.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0005-add-XWindowManager-Xsession.d-script.patch
deleted file mode 100644
index 1782665..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0005-add-XWindowManager-Xsession.d-script.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From b01a532ebb525552e23d7169a2aeb55c42b3ec99 Mon Sep 17 00:00:00 2001
-From: Martin Jansa <Martin.Jansa@gmail.com>
-Date: Wed, 11 Apr 2012 14:32:13 +0200
-Subject: [PATCH 05/12] add XWindowManager Xsession.d script
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
----
- X11/Xsession.d/90xXWindowManager |    6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
- create mode 100644 X11/Xsession.d/90xXWindowManager
-
-Index: xserver-common-1.34/X11/Xsession.d/90xXWindowManager
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ xserver-common-1.34/X11/Xsession.d/90xXWindowManager	2012-06-28 15:02:22.010521773 +0200
-@@ -0,0 +1,7 @@
-+if [ -x $HOME/.Xsession ]; then
-+    exec $HOME/.Xsession
-+elif [ -x /usr/bin/x-session-manager ]; then
-+    exec /usr/bin/x-session-manager
-+else
-+    exec /usr/bin/x-window-manager
-+fi
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0014-Xserver-Start-Xsession-like-x11-common-does.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0014-Xserver-Start-Xsession-like-x11-common-does.patch
deleted file mode 100644
index 5a75964..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/0014-Xserver-Start-Xsession-like-x11-common-does.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 8171f89944969a081be1ac193b2a59016e39a345 Mon Sep 17 00:00:00 2001
-From: Martin Jansa <Martin.Jansa@gmail.com>
-Date: Tue, 29 Oct 2013 17:07:21 +0100
-Subject: [PATCH 14/14] Xserver: Start Xsession like x11-common does
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
----
- X11/Xserver | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/X11/Xserver b/X11/Xserver
-index 559f059..4b88637 100755
---- a/X11/Xserver
-+++ b/X11/Xserver
-@@ -4,6 +4,6 @@
- . /etc/X11/xserver-common
- 
- echo "tslib: $TSLIB_TSDEVICE"
--echo "exec $XSERVER $ARGS -dpi $DPI $*"
--exec $XSERVER $ARGS -dpi $DPI $*
-+echo "exec xinit /etc/X11/Xsession -- $BINDIR/$XSERVER $ARGS -dpi $DPI $*"
- 
-+exec xinit /etc/X11/Xsession -- $BINDIR/$XSERVER $ARGS -dpi $DPI $*
--- 
-1.8.4.2
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common_1.34.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common_1.34.bb
index 0315ed7..cc30541 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common_1.34.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-common/xserver-common_1.34.bb
@@ -2,7 +2,7 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
-PR = "r8"
+PR = "r9"
 
 # we are using a gpe-style Makefile
 inherit gpe
@@ -13,8 +13,6 @@
 SRC_URI_append = " \
     file://0001-COPYING-add-GPLv2-license-file.patch \
     file://0002-add-setdpi-Xinit.d-script.patch \
-    file://0003-add-89xdgautostart-Xsession.d-script.patch \
-    file://0005-add-XWindowManager-Xsession.d-script.patch \
     file://0006-add-support-for-etc-X11-xserver-system.patch \
     file://0007-use-own-functions-file-instead-etc-init.d-functions.patch \
     file://0008-xserver-common-add-dpi-and-nocursor-params-for-gta01.patch \
@@ -23,8 +21,8 @@
     file://0011-xserver-common-add-support-for-nexus-one-alias-mahim.patch \
     file://0012-xserver-common-add-support-for-gta04-alias-OpenPhoen.patch \
     file://0013-xserver-common-add-support-for-tuna-alias-Galaxy-Nex.patch \
-    file://0014-Xserver-Start-Xsession-like-x11-common-does.patch \
     file://0015-xserver-common-disable-TCP-connections.patch \
+    file://0001-Don-t-install-Xsession-or-Xserver.patch \
 "
 
 do_install_append() {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/gplv2-license.patch b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/gplv2-license.patch
deleted file mode 100644
index ec93253..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/gplv2-license.patch
+++ /dev/null
@@ -1,353 +0,0 @@
-COPYING: add GPLv2 license file
-
-this is a local file recipe and the license file is missing.In order
-to pass the license checksum checking, the license file is needed. So
-this patch add the GPLv2 license file.
-
-Signed-off-by: Yu Ke <ke.yu@intel.com>
-
-diff --git a/COPYING b/COPYING
-new file mode 100644
-index 0000000..d511905
---- /dev/null
-+++ b/COPYING
-@@ -0,0 +1,339 @@
-+		    GNU GENERAL PUBLIC LICENSE
-+		       Version 2, June 1991
-+
-+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
-+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+ Everyone is permitted to copy and distribute verbatim copies
-+ of this license document, but changing it is not allowed.
-+
-+			    Preamble
-+
-+  The licenses for most software are designed to take away your
-+freedom to share and change it.  By contrast, the GNU General Public
-+License is intended to guarantee your freedom to share and change free
-+software--to make sure the software is free for all its users.  This
-+General Public License applies to most of the Free Software
-+Foundation's software and to any other program whose authors commit to
-+using it.  (Some other Free Software Foundation software is covered by
-+the GNU Lesser General Public License instead.)  You can apply it to
-+your programs, too.
-+
-+  When we speak of free software, we are referring to freedom, not
-+price.  Our General Public Licenses are designed to make sure that you
-+have the freedom to distribute copies of free software (and charge for
-+this service if you wish), that you receive source code or can get it
-+if you want it, that you can change the software or use pieces of it
-+in new free programs; and that you know you can do these things.
-+
-+  To protect your rights, we need to make restrictions that forbid
-+anyone to deny you these rights or to ask you to surrender the rights.
-+These restrictions translate to certain responsibilities for you if you
-+distribute copies of the software, or if you modify it.
-+
-+  For example, if you distribute copies of such a program, whether
-+gratis or for a fee, you must give the recipients all the rights that
-+you have.  You must make sure that they, too, receive or can get the
-+source code.  And you must show them these terms so they know their
-+rights.
-+
-+  We protect your rights with two steps: (1) copyright the software, and
-+(2) offer you this license which gives you legal permission to copy,
-+distribute and/or modify the software.
-+
-+  Also, for each author's protection and ours, we want to make certain
-+that everyone understands that there is no warranty for this free
-+software.  If the software is modified by someone else and passed on, we
-+want its recipients to know that what they have is not the original, so
-+that any problems introduced by others will not reflect on the original
-+authors' reputations.
-+
-+  Finally, any free program is threatened constantly by software
-+patents.  We wish to avoid the danger that redistributors of a free
-+program will individually obtain patent licenses, in effect making the
-+program proprietary.  To prevent this, we have made it clear that any
-+patent must be licensed for everyone's free use or not licensed at all.
-+
-+  The precise terms and conditions for copying, distribution and
-+modification follow.
-+
-+		    GNU GENERAL PUBLIC LICENSE
-+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-+
-+  0. This License applies to any program or other work which contains
-+a notice placed by the copyright holder saying it may be distributed
-+under the terms of this General Public License.  The "Program", below,
-+refers to any such program or work, and a "work based on the Program"
-+means either the Program or any derivative work under copyright law:
-+that is to say, a work containing the Program or a portion of it,
-+either verbatim or with modifications and/or translated into another
-+language.  (Hereinafter, translation is included without limitation in
-+the term "modification".)  Each licensee is addressed as "you".
-+
-+Activities other than copying, distribution and modification are not
-+covered by this License; they are outside its scope.  The act of
-+running the Program is not restricted, and the output from the Program
-+is covered only if its contents constitute a work based on the
-+Program (independent of having been made by running the Program).
-+Whether that is true depends on what the Program does.
-+
-+  1. You may copy and distribute verbatim copies of the Program's
-+source code as you receive it, in any medium, provided that you
-+conspicuously and appropriately publish on each copy an appropriate
-+copyright notice and disclaimer of warranty; keep intact all the
-+notices that refer to this License and to the absence of any warranty;
-+and give any other recipients of the Program a copy of this License
-+along with the Program.
-+
-+You may charge a fee for the physical act of transferring a copy, and
-+you may at your option offer warranty protection in exchange for a fee.
-+
-+  2. You may modify your copy or copies of the Program or any portion
-+of it, thus forming a work based on the Program, and copy and
-+distribute such modifications or work under the terms of Section 1
-+above, provided that you also meet all of these conditions:
-+
-+    a) You must cause the modified files to carry prominent notices
-+    stating that you changed the files and the date of any change.
-+
-+    b) You must cause any work that you distribute or publish, that in
-+    whole or in part contains or is derived from the Program or any
-+    part thereof, to be licensed as a whole at no charge to all third
-+    parties under the terms of this License.
-+
-+    c) If the modified program normally reads commands interactively
-+    when run, you must cause it, when started running for such
-+    interactive use in the most ordinary way, to print or display an
-+    announcement including an appropriate copyright notice and a
-+    notice that there is no warranty (or else, saying that you provide
-+    a warranty) and that users may redistribute the program under
-+    these conditions, and telling the user how to view a copy of this
-+    License.  (Exception: if the Program itself is interactive but
-+    does not normally print such an announcement, your work based on
-+    the Program is not required to print an announcement.)
-+
-+These requirements apply to the modified work as a whole.  If
-+identifiable sections of that work are not derived from the Program,
-+and can be reasonably considered independent and separate works in
-+themselves, then this License, and its terms, do not apply to those
-+sections when you distribute them as separate works.  But when you
-+distribute the same sections as part of a whole which is a work based
-+on the Program, the distribution of the whole must be on the terms of
-+this License, whose permissions for other licensees extend to the
-+entire whole, and thus to each and every part regardless of who wrote it.
-+
-+Thus, it is not the intent of this section to claim rights or contest
-+your rights to work written entirely by you; rather, the intent is to
-+exercise the right to control the distribution of derivative or
-+collective works based on the Program.
-+
-+In addition, mere aggregation of another work not based on the Program
-+with the Program (or with a work based on the Program) on a volume of
-+a storage or distribution medium does not bring the other work under
-+the scope of this License.
-+
-+  3. You may copy and distribute the Program (or a work based on it,
-+under Section 2) in object code or executable form under the terms of
-+Sections 1 and 2 above provided that you also do one of the following:
-+
-+    a) Accompany it with the complete corresponding machine-readable
-+    source code, which must be distributed under the terms of Sections
-+    1 and 2 above on a medium customarily used for software interchange; or,
-+
-+    b) Accompany it with a written offer, valid for at least three
-+    years, to give any third party, for a charge no more than your
-+    cost of physically performing source distribution, a complete
-+    machine-readable copy of the corresponding source code, to be
-+    distributed under the terms of Sections 1 and 2 above on a medium
-+    customarily used for software interchange; or,
-+
-+    c) Accompany it with the information you received as to the offer
-+    to distribute corresponding source code.  (This alternative is
-+    allowed only for noncommercial distribution and only if you
-+    received the program in object code or executable form with such
-+    an offer, in accord with Subsection b above.)
-+
-+The source code for a work means the preferred form of the work for
-+making modifications to it.  For an executable work, complete source
-+code means all the source code for all modules it contains, plus any
-+associated interface definition files, plus the scripts used to
-+control compilation and installation of the executable.  However, as a
-+special exception, the source code distributed need not include
-+anything that is normally distributed (in either source or binary
-+form) with the major components (compiler, kernel, and so on) of the
-+operating system on which the executable runs, unless that component
-+itself accompanies the executable.
-+
-+If distribution of executable or object code is made by offering
-+access to copy from a designated place, then offering equivalent
-+access to copy the source code from the same place counts as
-+distribution of the source code, even though third parties are not
-+compelled to copy the source along with the object code.
-+
-+  4. You may not copy, modify, sublicense, or distribute the Program
-+except as expressly provided under this License.  Any attempt
-+otherwise to copy, modify, sublicense or distribute the Program is
-+void, and will automatically terminate your rights under this License.
-+However, parties who have received copies, or rights, from you under
-+this License will not have their licenses terminated so long as such
-+parties remain in full compliance.
-+
-+  5. You are not required to accept this License, since you have not
-+signed it.  However, nothing else grants you permission to modify or
-+distribute the Program or its derivative works.  These actions are
-+prohibited by law if you do not accept this License.  Therefore, by
-+modifying or distributing the Program (or any work based on the
-+Program), you indicate your acceptance of this License to do so, and
-+all its terms and conditions for copying, distributing or modifying
-+the Program or works based on it.
-+
-+  6. Each time you redistribute the Program (or any work based on the
-+Program), the recipient automatically receives a license from the
-+original licensor to copy, distribute or modify the Program subject to
-+these terms and conditions.  You may not impose any further
-+restrictions on the recipients' exercise of the rights granted herein.
-+You are not responsible for enforcing compliance by third parties to
-+this License.
-+
-+  7. If, as a consequence of a court judgment or allegation of patent
-+infringement or for any other reason (not limited to patent issues),
-+conditions are imposed on you (whether by court order, agreement or
-+otherwise) that contradict the conditions of this License, they do not
-+excuse you from the conditions of this License.  If you cannot
-+distribute so as to satisfy simultaneously your obligations under this
-+License and any other pertinent obligations, then as a consequence you
-+may not distribute the Program at all.  For example, if a patent
-+license would not permit royalty-free redistribution of the Program by
-+all those who receive copies directly or indirectly through you, then
-+the only way you could satisfy both it and this License would be to
-+refrain entirely from distribution of the Program.
-+
-+If any portion of this section is held invalid or unenforceable under
-+any particular circumstance, the balance of the section is intended to
-+apply and the section as a whole is intended to apply in other
-+circumstances.
-+
-+It is not the purpose of this section to induce you to infringe any
-+patents or other property right claims or to contest validity of any
-+such claims; this section has the sole purpose of protecting the
-+integrity of the free software distribution system, which is
-+implemented by public license practices.  Many people have made
-+generous contributions to the wide range of software distributed
-+through that system in reliance on consistent application of that
-+system; it is up to the author/donor to decide if he or she is willing
-+to distribute software through any other system and a licensee cannot
-+impose that choice.
-+
-+This section is intended to make thoroughly clear what is believed to
-+be a consequence of the rest of this License.
-+
-+  8. If the distribution and/or use of the Program is restricted in
-+certain countries either by patents or by copyrighted interfaces, the
-+original copyright holder who places the Program under this License
-+may add an explicit geographical distribution limitation excluding
-+those countries, so that distribution is permitted only in or among
-+countries not thus excluded.  In such case, this License incorporates
-+the limitation as if written in the body of this License.
-+
-+  9. The Free Software Foundation may publish revised and/or new versions
-+of the General Public License from time to time.  Such new versions will
-+be similar in spirit to the present version, but may differ in detail to
-+address new problems or concerns.
-+
-+Each version is given a distinguishing version number.  If the Program
-+specifies a version number of this License which applies to it and "any
-+later version", you have the option of following the terms and conditions
-+either of that version or of any later version published by the Free
-+Software Foundation.  If the Program does not specify a version number of
-+this License, you may choose any version ever published by the Free Software
-+Foundation.
-+
-+  10. If you wish to incorporate parts of the Program into other free
-+programs whose distribution conditions are different, write to the author
-+to ask for permission.  For software which is copyrighted by the Free
-+Software Foundation, write to the Free Software Foundation; we sometimes
-+make exceptions for this.  Our decision will be guided by the two goals
-+of preserving the free status of all derivatives of our free software and
-+of promoting the sharing and reuse of software generally.
-+
-+			    NO WARRANTY
-+
-+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-+REPAIR OR CORRECTION.
-+
-+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-+POSSIBILITY OF SUCH DAMAGES.
-+
-+		     END OF TERMS AND CONDITIONS
-+
-+	    How to Apply These Terms to Your New Programs
-+
-+  If you develop a new program, and you want it to be of the greatest
-+possible use to the public, the best way to achieve this is to make it
-+free software which everyone can redistribute and change under these terms.
-+
-+  To do so, attach the following notices to the program.  It is safest
-+to attach them to the start of each source file to most effectively
-+convey the exclusion of warranty; and each file should have at least
-+the "copyright" line and a pointer to where the full notice is found.
-+
-+    <one line to give the program's name and a brief idea of what it does.>
-+    Copyright (C) <year>  <name of author>
-+
-+    This program is free software; you can redistribute it and/or modify
-+    it under the terms of the GNU General Public License as published by
-+    the Free Software Foundation; either version 2 of the License, or
-+    (at your option) any later version.
-+
-+    This program is distributed in the hope that it will be useful,
-+    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+    GNU General Public License for more details.
-+
-+    You should have received a copy of the GNU General Public License along
-+    with this program; if not, write to the Free Software Foundation, Inc.,
-+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-+
-+Also add information on how to contact you by electronic and paper mail.
-+
-+If the program is interactive, make it output a short notice like this
-+when it starts in an interactive mode:
-+
-+    Gnomovision version 69, Copyright (C) year name of author
-+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-+    This is free software, and you are welcome to redistribute it
-+    under certain conditions; type `show c' for details.
-+
-+The hypothetical commands `show w' and `show c' should show the appropriate
-+parts of the General Public License.  Of course, the commands you use may
-+be called something other than `show w' and `show c'; they could even be
-+mouse-clicks or menu items--whatever suits your program.
-+
-+You should also get your employer (if you work as a programmer) or your
-+school, if any, to sign a "copyright disclaimer" for the program, if
-+necessary.  Here is a sample; alter the names:
-+
-+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-+
-+  <signature of Ty Coon>, 1 April 1989
-+  Ty Coon, President of Vice
-+
-+This General Public License does not permit incorporating your program into
-+proprietary programs.  If your program is a subroutine library, you may
-+consider it more useful to permit linking proprietary applications with the
-+library.  If this is what you want to do, use the GNU Lesser General
-+Public License instead of this License.
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm
deleted file mode 100755
index 5d7e8a2..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-#
-### BEGIN INIT INFO
-# Provides: xserver
-# Required-Start: $local_fs $remote_fs dbus
-# Required-Stop: $local_fs $remote_fs
-# Default-Start:     5
-# Default-Stop:      0 1 2 3 6
-### END INIT INFO
-
-
-. /etc/init.d/functions
-
-for x in $(cat /proc/cmdline); do
-        case $x in
-        x11=false)
-		echo "X Server disabled" 
-		exit 0;
-                ;;
-        esac
-done
-
-case "$1" in
-  start)
-    # We don't want this script to block the rest of the boot process
-    if [ "$2" != "background" ]; then
-      $0 $1 background &
-    else
-       # work around from /etc/X11/Xinit
-       export USER=root
-       export HOME=/home/root
-       if [ ! -d $HOME ] && [ -d /root ]; then
-         HOME=/root
-       fi
-
-       . /etc/profile
-
-       echo "Starting Xserver"
-       . /etc/X11/xserver-common
-       xinit /etc/X11/Xsession -- `which $XSERVER` $ARGS >/var/log/Xsession.log 2>&1
-    fi 
-  ;;
-
-  stop)
-        echo "Stopping XServer"
-        killproc xinit
-  ;;
-
-  restart)
-	$0 stop
-        sleep 1
-        $0 start
-  ;;
-
-  *)
-        echo "usage: $0 { start | stop | restart }"
-  ;;
-esac
-
-exit 0
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm.conf b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm.conf
deleted file mode 100644
index 3c0582a..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm.conf
+++ /dev/null
@@ -1 +0,0 @@
-HOME=/home/root
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm.service b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm.service
deleted file mode 100644
index 94d221e..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm.service
+++ /dev/null
@@ -1,9 +0,0 @@
-[Unit]
-Description=Xserver startup with a display manager
-
-[Service]
-EnvironmentFile=/etc/default/xserver-nodm
-ExecStart=/etc/X11/Xserver
-
-[Install]
-Alias=display-manager.service
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init_2.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init_2.0.bb
deleted file mode 100644
index 95a07d1..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init_2.0.bb
+++ /dev/null
@@ -1,41 +0,0 @@
-SUMMARY = "Simple Xserver Init Script (no dm)"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-SECTION = "x11"
-
-PR = "r22"
-
-SRC_URI = "file://xserver-nodm \
-           file://gplv2-license.patch \
-           file://xserver-nodm.service \
-           file://xserver-nodm.conf \
-"
-S = "${WORKDIR}"
-
-inherit update-rc.d systemd
-
-INITSCRIPT_NAME = "xserver-nodm"
-INITSCRIPT_PARAMS = "start 01 5 . stop 01 0 1 2 3 6 ."
-INITSCRIPT_PARAMS_shr = "start 90 5 . stop 90 0 1 2 3 6 ."
-
-do_install() {
-    install -d ${D}${sysconfdir}/init.d
-    install xserver-nodm ${D}${sysconfdir}/init.d
-
-    install -d ${D}${sysconfdir}/default
-
-    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-        install -d ${D}${systemd_unitdir}/system
-        install xserver-nodm.conf ${D}${sysconfdir}/default/xserver-nodm
-        install -m 0644 ${WORKDIR}/xserver-nodm.service ${D}${systemd_unitdir}/system
-    fi
-}
-
-RDEPENDS_${PN} = "xserver-common (>= 1.30) xinit"
-
-RPROVIDES_${PN} += "${PN}-systemd"
-RREPLACES_${PN} += "${PN}-systemd"
-RCONFLICTS_${PN} += "${PN}-systemd"
-SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
-
-FILES_${PN} += "${sysconfdir}/default/xserver-nodm"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-Fix-for-a-compilation-error-if-glibc-2.25-or-later-h.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-Fix-for-a-compilation-error-if-glibc-2.25-or-later-h.patch
new file mode 100644
index 0000000..9434815
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-Fix-for-a-compilation-error-if-glibc-2.25-or-later-h.patch
@@ -0,0 +1,112 @@
+From b8c8fbe0a2481e97fc57dd596346827a692a5768 Mon Sep 17 00:00:00 2001
+From: Dave Anderson <anderson@redhat.com>
+Date: Tue, 28 Mar 2017 15:44:40 -0400
+Subject: [PATCH 1/3] Fix for a compilation error if glibc-2.25 or later has
+ been installed on the host build machine.  Without the patch, the build fails
+ with the error message "amd64-linux-nat.c:496:1: error: conflicting types for
+ 'ps_get_thread_area'". (anderson@redhat.com)
+
+Upstream-Status: Backport
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ Makefile                     |  6 +++++
+ configure.c                  |  2 +-
+ gdb-7.6-proc_service.h.patch | 55 ++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 62 insertions(+), 1 deletion(-)
+ create mode 100644 gdb-7.6-proc_service.h.patch
+
+diff --git a/Makefile b/Makefile
+index 202ef8b..b6b7e80 100644
+--- a/Makefile
++++ b/Makefile
+@@ -264,6 +264,12 @@ gdb_patch:
+ 	if [ "${ARCH}" = "x86_64" ] && [ "${TARGET}" = "PPC64" ] && [ -f ${GDB}-ppc64le-support.patch ]; then \
+ 		patch -d ${GDB} -p1 -F0 < ${GDB}-ppc64le-support.patch ; \
+ 	fi
++	if [ -f /usr/include/proc_service.h ]; then \
++		grep 'extern ps_err_e ps_get_thread_area (struct' /usr/include/proc_service.h; \
++		if [ $$? -eq 0 ]; then \
++			patch -p0 < ${GDB}-proc_service.h.patch; \
++		fi; \
++	fi
+ 
+ library: make_build_data ${OBJECT_FILES}
+ 	ar -rs ${PROGRAM}lib.a ${OBJECT_FILES}
+diff --git a/configure.c b/configure.c
+index d63cdd7..776defe 100644
+--- a/configure.c
++++ b/configure.c
+@@ -240,7 +240,7 @@ struct supported_gdb_version {
+ 	    "7.6",
+ 	    "GDB_FILES=${GDB_7.6_FILES}",
+ 	    "GDB_OFILES=${GDB_7.6_OFILES}",
+-	    "GDB_PATCH_FILES=gdb-7.6.patch gdb-7.6-ppc64le-support.patch",
++	    "GDB_PATCH_FILES=gdb-7.6.patch gdb-7.6-ppc64le-support.patch gdb-7.6-proc_service.h.patch",
+ 	    "GDB_FLAGS=-DGDB_7_6",
+ 	    "GPLv3"
+ 	},
+diff --git a/gdb-7.6-proc_service.h.patch b/gdb-7.6-proc_service.h.patch
+new file mode 100644
+index 0000000..49d18bb
+--- /dev/null
++++ b/gdb-7.6-proc_service.h.patch
+@@ -0,0 +1,55 @@
++--- gdb-7.6/gdb/gdb_proc_service.h.orig
+++++ gdb-7.6/gdb/gdb_proc_service.h
++@@ -115,7 +115,7 @@ extern pid_t ps_getpid (struct ps_procha
++ /* Fetch the special per-thread address associated with the given LWP.
++    This call is only used on a few platforms (most use a normal register).
++    The meaning of the `int' parameter is machine-dependent.  */
++-extern ps_err_e ps_get_thread_area (const struct ps_prochandle *,
+++extern ps_err_e ps_get_thread_area (struct ps_prochandle *,
++ 				    lwpid_t, int, psaddr_t *);
++ 
++ 
++--- gdb-7.6/gdb/amd64-linux-nat.c.orig
+++++ gdb-7.6/gdb/amd64-linux-nat.c
++@@ -493,7 +493,7 @@ amd64_linux_new_fork (struct lwp_info *p
++    a request for a thread's local storage address.  */
++ 
++ ps_err_e
++-ps_get_thread_area (const struct ps_prochandle *ph,
+++ps_get_thread_area (struct ps_prochandle *ph,
++                     lwpid_t lwpid, int idx, void **base)
++ {
++   if (gdbarch_bfd_arch_info (target_gdbarch ())->bits_per_word == 32)
++--- gdb-7.6/gdb/aarch64-linux-nat.c.orig
+++++ gdb-7.6/gdb/aarch64-linux-nat.c
++@@ -750,7 +750,7 @@ aarch64_linux_new_fork (struct lwp_info
++    storage (or its descriptor).  */
++ 
++ ps_err_e
++-ps_get_thread_area (const struct ps_prochandle *ph,
+++ps_get_thread_area (struct ps_prochandle *ph,
++ 		    lwpid_t lwpid, int idx, void **base)
++ {
++   struct iovec iovec;
++--- gdb-7.6/gdb/arm-linux-nat.c.orig
+++++ gdb-7.6/gdb/arm-linux-nat.c
++@@ -613,7 +613,7 @@ supply_fpregset (struct regcache *regcac
++ /* Fetch the thread-local storage pointer for libthread_db.  */
++ 
++ ps_err_e
++-ps_get_thread_area (const struct ps_prochandle *ph,
+++ps_get_thread_area (struct ps_prochandle *ph,
++                     lwpid_t lwpid, int idx, void **base)
++ {
++   if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
++--- gdb-7.6/gdb/i386-linux-nat.c.orig
+++++ gdb-7.6/gdb/i386-linux-nat.c
++@@ -849,7 +849,7 @@ i386_linux_new_fork (struct lwp_info *pa
++    storage (or its descriptor).  */
++ 
++ ps_err_e
++-ps_get_thread_area (const struct ps_prochandle *ph, 
+++ps_get_thread_area (struct ps_prochandle *ph, 
++ 		    lwpid_t lwpid, int idx, void **base)
++ {
++   /* NOTE: cagney/2003-08-26: The definition of this buffer is found
+-- 
+2.8.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch
index 39732a9..26a34e5 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch
@@ -1,14 +1,15 @@
-From cbaaa42933bb27b1bcff4c7d71d54c913201ee88 Mon Sep 17 00:00:00 2001
+From 73269df4d8196abe81112acaa2613155b308a8b8 Mon Sep 17 00:00:00 2001
 From: Lei Maohui <leimaohui@cn.fujitsu.com>
 Date: Fri, 9 Jan 2015 11:51:18 +0900
-Subject: [PATCH] cross_add_configure_option
+Subject: [PATCH 1/9] cross_add_configure_option
 
+%% original patch: 0001-cross_add_configure_option.patch
 ---
  Makefile | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index 9c44633..39bebd0 100644
+index a2baec1..f1972c8 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -232,7 +232,7 @@ gdb_merge: force
@@ -20,15 +21,15 @@
  	    --with-bugurl="" --with-expat=no --with-python=no --disable-sim; \
  	  make --no-print-directory CRASH_TARGET=${TARGET}; echo ${TARGET} > crash.target) \
  	else make --no-print-directory rebuild; fi
-@@ -277,7 +277,7 @@ force:
+@@ -283,7 +283,7 @@ force:
  
  make_configure: force
  	@rm -f configure
 -	@${CC} ${CONF_FLAGS} -o configure configure.c ${WARNING_ERROR} ${WARNING_OPTIONS}
-+	@cc ${CONF_FLAGS} -o configure configure.c ${WARNING_ERROR} ${WARNING_OPTIONS}
++	@${BUILD_CC} ${CONF_FLAGS} -o configure configure.c ${WARNING_ERROR} ${WARNING_OPTIONS}
  
  clean: make_configure
  	@./configure ${CONF_TARGET_FLAG} -q -b
 -- 
-1.8.4.2
+2.8.1
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch
new file mode 100644
index 0000000..8355fe4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch
@@ -0,0 +1,36 @@
+From 52fc1a7c17768fd52c3577d21dad84e8babb94b5 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 6 Apr 2017 23:01:14 -0400
+Subject: [PATCH 2/3] crash: fix build error unknown type name 'gdb_fpregset_t'
+
+Upstream-Status: Pending
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ gdb-7.6/gdb/gdb_proc_service.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/gdb-7.6/gdb/gdb_proc_service.h b/gdb-7.6/gdb/gdb_proc_service.h
+index 8bc6088..99c6496 100644
+--- a/gdb-7.6/gdb/gdb_proc_service.h
++++ b/gdb-7.6/gdb/gdb_proc_service.h
+@@ -20,6 +20,7 @@
+ #define GDB_PROC_SERVICE_H
+ 
+ #include <sys/types.h>
++#include "gregset.h"
+ 
+ #ifdef HAVE_PROC_SERVICE_H
+ #include <proc_service.h>
+@@ -53,8 +54,6 @@
+ #include <sys/procfs.h>
+ #endif
+ 
+-#include "gregset.h"
+-
+ /* Functions in this interface return one of these status codes.  */
+ typedef enum
+ {
+-- 
+2.8.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch
new file mode 100644
index 0000000..1f4bd01
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch
@@ -0,0 +1,33 @@
+From c7950ef5228adc52a500b4fc67d7e48c3c09c1df Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 6 Apr 2017 23:02:44 -0400
+Subject: [PATCH 3/3] crash: detect the sysroot's glibc header file
+
+This is cross compile, so let the Makefile detect the sysroot's glibc
+header file, not the host's glibc header file.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index b6b7e80..94f21a5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -264,8 +264,8 @@ gdb_patch:
+ 	if [ "${ARCH}" = "x86_64" ] && [ "${TARGET}" = "PPC64" ] && [ -f ${GDB}-ppc64le-support.patch ]; then \
+ 		patch -d ${GDB} -p1 -F0 < ${GDB}-ppc64le-support.patch ; \
+ 	fi
+-	if [ -f /usr/include/proc_service.h ]; then \
+-		grep 'extern ps_err_e ps_get_thread_area (struct' /usr/include/proc_service.h; \
++	if [ -f ${RECIPE_SYSROOT}/usr/include/proc_service.h ]; then \
++		grep 'extern ps_err_e ps_get_thread_area (struct' ${RECIPE_SYSROOT}/usr/include/proc_service.h; \
+ 		if [ $$? -eq 0 ]; then \
+ 			patch -p0 < ${GDB}-proc_service.h.patch; \
+ 		fi; \
+-- 
+2.8.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0004-crash-fix-build-failure-with-mips.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0004-crash-fix-build-failure-with-mips.patch
new file mode 100644
index 0000000..1e7ce6b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0004-crash-fix-build-failure-with-mips.patch
@@ -0,0 +1,87 @@
+From 423ebdce07aa9f398f32c0adf659353069d023c6 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 4 May 2017 07:14:13 +0000
+Subject: [PATCH] crash: fix build failure with mips
+
+When build crash with mips:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+mips-linux-nat.c:157:1: error: conflicting types for 'ps_get_thread_area'
+ ps_get_thread_area (const struct ps_prochandle *ph,
+ ^~~~~~~~~~~~~~~~~~
+In file included from gdb_proc_service.h:26:0,
+                 from mips-linux-nat.c:32:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This problem have been fixed on intel and arm plantform, we can use the
+similar approch to fix it on mips.
+
+Upstream-status: Submitted [https://github.com/crash-utility/crash/pull/11]
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ Makefile                                |  1 +
+ crash-fix-build-failure-with-mips.patch | 39 +++++++++++++++++++++++++++++++++
+ 2 files changed, 40 insertions(+)
+ create mode 100644 crash-fix-build-failure-with-mips.patch
+
+diff --git a/Makefile b/Makefile
+index 5496523..2ec3325 100644
+--- a/Makefile
++++ b/Makefile
+@@ -268,6 +268,7 @@ gdb_patch:
+ 		grep 'extern ps_err_e ps_get_thread_area (struct' ${RECIPE_SYSROOT}/usr/include/proc_service.h; \
+ 		if [ $$? -eq 0 ]; then \
+ 			patch -p0 < ${GDB}-proc_service.h.patch; \
++			patch -p1 < crash-fix-build-failure-with-mips.patch; \
+ 		fi; \
+ 	fi
+ 
+diff --git a/crash-fix-build-failure-with-mips.patch b/crash-fix-build-failure-with-mips.patch
+new file mode 100644
+index 0000000..0c70c5f
+--- /dev/null
++++ b/crash-fix-build-failure-with-mips.patch
+@@ -0,0 +1,39 @@
++From 615c802d9c73fad48723b6567042cd54f6795849 Mon Sep 17 00:00:00 2001
++From: Dengke Du <dengke.du@windriver.com>
++Date: Thu, 4 May 2017 06:14:47 +0000
++Subject: [PATCH] crash: fix build failure with mips
++
++When build crash with mips:
++
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++mips-linux-nat.c:157:1: error: conflicting types for 'ps_get_thread_area'
++ ps_get_thread_area (const struct ps_prochandle *ph,
++ ^~~~~~~~~~~~~~~~~~
++In file included from gdb_proc_service.h:26:0,
++                 from mips-linux-nat.c:32:
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++
++This problem have been fixed on intel and arm plantform, we can use the
++similar approch to fix it on mips.
++
++Signed-off-by: Dengke Du <dengke.du@windriver.com>
++---
++ gdb-7.6/gdb/mips-linux-nat.c | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/gdb-7.6/gdb/mips-linux-nat.c b/gdb-7.6/gdb/mips-linux-nat.c
++index 61e83c6..d517e37 100644
++--- a/gdb-7.6/gdb/mips-linux-nat.c
+++++ b/gdb-7.6/gdb/mips-linux-nat.c
++@@ -154,7 +154,7 @@ mips64_linux_register_addr (struct gdbarch *gdbarch, int regno, int store)
++ /* Fetch the thread-local storage pointer for libthread_db.  */
++ 
++ ps_err_e
++-ps_get_thread_area (const struct ps_prochandle *ph,
+++ps_get_thread_area (struct ps_prochandle *ph,
++                     lwpid_t lwpid, int idx, void **base)
++ {
++   if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
++-- 
++2.11.0
++
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.1.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.1.5.bb
deleted file mode 100644
index 936438b..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.1.5.bb
+++ /dev/null
@@ -1,113 +0,0 @@
-SUMMARY = "Kernel analysis utility for live systems, netdump, diskdump, kdump, LKCD or mcore dumpfiles"
-DESCRIPTION = "The core analysis suite is a self-contained tool that can be used to\
-investigate either live systems, kernel core dumps created from the\
-netdump, diskdump and kdump packages from Red Hat Linux, the mcore kernel patch\
-offered by Mission Critical Linux, or the LKCD kernel patch."
-
-HOMEPAGE = "http://people.redhat.com/anderson"
-SECTION = "devel"
-
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING3;md5=d32239bcb673463ab874e80d47fae504"
-
-DEPENDS = "zlib readline"
-
-SRC_URI = "https://github.com/crash-utility/${BPN}/archive/${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
-           http://ftp.gnu.org/gnu/gdb/gdb-7.6.tar.gz;name=gdb;subdir=${BP} \
-           file://7001force_define_architecture.patch \
-           file://7003cross_ranlib.patch \
-           file://0001-cross_add_configure_option.patch \
-           file://sim-ppc-drop-LIBS-from-psim-dependency.patch \
-           file://sim-common-sim-arange-fix-extern-inline-handling.patch \
-           file://donnot-extract-gdb-during-do-compile.patch \
-           file://gdb_build_jobs_and_not_write_crash_target.patch \
-           file://remove-unrecognized-gcc-option-m32-for-mips.patch \
-           "
-
-SRC_URI[md5sum] = "7bd06eaec6827d4fac636b2b592d3056"
-SRC_URI[sha256sum] = "c3954412c8557614a0d50092c007aa96b4e3e6e97453dfbb60241ab680caf7b2"
-
-SRC_URI[gdb.md5sum] = "a9836707337e5f7bf76a009a8904f470"
-SRC_URI[gdb.sha256sum] = "8070389a5dcc104eb0be483d582729f98ed4d761ad19cedd3f17b5d2502faa36"
-
-inherit gettext
-
-BBCLASSEXTEND = "native cross"
-
-# crash 7.1.3 and before don't support mips64
-COMPATIBLE_HOST = "^(?!mips64).*"
-
-EXTRA_OEMAKE = 'RPMPKG="${PV}" \
-                GDB_TARGET="${TARGET_SYS}" \
-                GDB_HOST="${BUILD_SYS}" \
-                GDB_MAKE_JOBS="${PARALLEL_MAKE}" \
-                LDFLAGS="${LDFLAGS}" \
-                '
-
-EXTRA_OEMAKE_class-cross = 'RPMPKG="${PV}" \
-                            GDB_TARGET="${BUILD_SYS} \
-                                        \${GDB_CONF_FLAGS} \
-                                        --target=${TARGET_SYS}" \
-                            GDB_HOST="${BUILD_SYS}" \
-                            GDB_MAKE_JOBS="${PARALLEL_MAKE}" \
-                            '
-
-EXTRA_OEMAKE_append_class-native = " LDFLAGS='${BUILD_LDFLAGS}'"
-EXTRA_OEMAKE_append_class-cross = " LDFLAGS='${BUILD_LDFLAGS}'"
-
-REMOVE_M32 = "sed -i -e 's/#define TARGET_CFLAGS_ARM_ON_X86_64.*/#define TARGET_CFLAGS_ARM_ON_X86_64\t\"TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64\"/g' ${S}/configure.c"
-
-REMOVE_M32_class-cross = ""
-
-do_configure() {
-    :
-}
-
-do_compile_prepend() {
-    case ${TARGET_ARCH} in
-        aarch64*)    ARCH=ARM64 ;;
-        arm*)        ARCH=ARM ;;
-        i*86*)       ARCH=X86 ;;
-        x86_64*)     ARCH=X86_64 ;;
-        powerpc64*)  ARCH=PPC64 ;;
-        powerpc*)    ARCH=PPC ;;
-        mips*)       ARCH=MIPS ;;
-    esac
-
-    sed -i s/FORCE_DEFINE_ARCH/"${ARCH}"/g ${S}/configure.c
-    ${REMOVE_M32}
-    sed -i 's/&gt;/>/g' ${S}/Makefile
-}
-
-do_compile() {
-    oe_runmake ${EXTRA_OEMAKE}
-}
-
-do_install_prepend () {
-    install -d ${D}${bindir}
-    install -d ${D}/${mandir}/man8
-    install -d ${D}${includedir}/crash
-
-    install -m 0644 ${S}/crash.8 ${D}/${mandir}/man8/
-    install -m 0644 ${S}/defs.h ${D}${includedir}/crash
-}
-
-do_install_class-target () {
-    oe_runmake DESTDIR=${D} install
-}
-
-do_install_class-native () {
-    oe_runmake DESTDIR=${D}${STAGING_DIR_NATIVE} install
-}
-
-do_install_class-cross () {
-    install -m 0755 ${S}/crash ${D}/${bindir}
-}
-
-RDEPENDS_${PN} += "liblzma"
-RDEPENDS_${PN}_class-native = ""
-RDEPENDS_${PN}_class-cross = ""
-
-# Causes gcc to get stuck and eat all available memory in qemuarm builds
-# jenkins  15161  100 12.5 10389596 10321284 ?   R    11:40  28:17 /home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/cc1 -quiet -I . -I . -I ./common -I ./config -I ./../include/opcode -I ./../opcodes/.. -I ./../readline/.. -I ../bfd -I ./../bfd -I ./../include -I ../libdecnumber -I ./../libdecnumber -I ./gnulib/import -I build-gnulib/import -isysroot /home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemuarm -MMD eval.d -MF .deps/eval.Tpo -MP -MT eval.o -D LOCALEDIR="/usr/local/share/locale" -D CRASH_MERGE -D HAVE_CONFIG_H -D TUI=1 eval.c -quiet -dumpbase eval.c -march=armv5te -mthumb -mthumb-interwork -mtls-dialect=gnu -auxbase-strip eval.o -g -O2 -Wall -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -feliminate-unused-debug-types -o -
-ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.1.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.1.8.bb
new file mode 100644
index 0000000..9c31f5e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.1.8.bb
@@ -0,0 +1,118 @@
+SUMMARY = "Kernel analysis utility for live systems, netdump, diskdump, kdump, LKCD or mcore dumpfiles"
+DESCRIPTION = "The core analysis suite is a self-contained tool that can be used to\
+investigate either live systems, kernel core dumps created from the\
+netdump, diskdump and kdump packages from Red Hat Linux, the mcore kernel patch\
+offered by Mission Critical Linux, or the LKCD kernel patch."
+
+HOMEPAGE = "http://people.redhat.com/anderson"
+SECTION = "devel"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING3;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = "zlib readline"
+
+SRC_URI = "https://github.com/crash-utility/${BPN}/archive/${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
+           http://ftp.gnu.org/gnu/gdb/gdb-7.6.tar.gz;name=gdb;subdir=${BP} \
+           file://7001force_define_architecture.patch \
+           file://7003cross_ranlib.patch \
+           file://0001-cross_add_configure_option.patch \
+           file://sim-ppc-drop-LIBS-from-psim-dependency.patch \
+           file://sim-common-sim-arange-fix-extern-inline-handling.patch \
+           file://donnot-extract-gdb-during-do-compile.patch \
+           file://gdb_build_jobs_and_not_write_crash_target.patch \
+           file://remove-unrecognized-gcc-option-m32-for-mips.patch \
+           file://0001-Fix-for-a-compilation-error-if-glibc-2.25-or-later-h.patch \
+           file://0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch \
+           file://0003-crash-detect-the-sysroot-s-glibc-header-file.patch \
+           file://0004-crash-fix-build-failure-with-mips.patch \
+           "
+
+SRC_URI[md5sum] = "31787074f267a3536eebff008a0652ec"
+SRC_URI[sha256sum] = "9965dee9199d7e39764fbee7f21c7c45b1f7b6d17c8e92ad62f468f062876478"
+
+SRC_URI[gdb.md5sum] = "a9836707337e5f7bf76a009a8904f470"
+SRC_URI[gdb.sha256sum] = "8070389a5dcc104eb0be483d582729f98ed4d761ad19cedd3f17b5d2502faa36"
+
+inherit gettext
+
+BBCLASSEXTEND = "native cross"
+TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}"
+
+# crash 7.1.3 and before don't support mips64
+COMPATIBLE_HOST = "^(?!mips64).*"
+
+EXTRA_OEMAKE = 'RPMPKG="${PV}" \
+                GDB_TARGET="${TARGET_SYS}" \
+                GDB_HOST="${BUILD_SYS}" \
+                GDB_MAKE_JOBS="${PARALLEL_MAKE}" \
+                LDFLAGS="${LDFLAGS}" \
+                '
+
+EXTRA_OEMAKE_class-cross = 'RPMPKG="${PV}" \
+                            GDB_TARGET="${BUILD_SYS} \
+                                        \${GDB_CONF_FLAGS} \
+                                        --target=${TARGET_SYS}" \
+                            GDB_HOST="${BUILD_SYS}" \
+                            GDB_MAKE_JOBS="${PARALLEL_MAKE}" \
+                            '
+
+EXTRA_OEMAKE_append_class-native = " LDFLAGS='${BUILD_LDFLAGS}'"
+EXTRA_OEMAKE_append_class-cross = " LDFLAGS='${BUILD_LDFLAGS}'"
+
+REMOVE_M32 = "sed -i -e 's/#define TARGET_CFLAGS_ARM_ON_X86_64.*/#define TARGET_CFLAGS_ARM_ON_X86_64\t\"TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64\"/g' ${S}/configure.c"
+
+REMOVE_M32_class-cross = ""
+
+do_configure() {
+    :
+}
+
+do_compile_prepend() {
+    case ${TARGET_ARCH} in
+        aarch64*)    ARCH=ARM64 ;;
+        arm*)        ARCH=ARM ;;
+        i*86*)       ARCH=X86 ;;
+        x86_64*)     ARCH=X86_64 ;;
+        powerpc64*)  ARCH=PPC64 ;;
+        powerpc*)    ARCH=PPC ;;
+        mips*)       ARCH=MIPS ;;
+    esac
+
+    sed -i s/FORCE_DEFINE_ARCH/"${ARCH}"/g ${S}/configure.c
+    ${REMOVE_M32}
+    sed -i 's/&gt;/>/g' ${S}/Makefile
+}
+
+do_compile() {
+    oe_runmake ${EXTRA_OEMAKE} RECIPE_SYSROOT=${RECIPE_SYSROOT}
+}
+
+do_install_prepend () {
+    install -d ${D}${bindir}
+    install -d ${D}/${mandir}/man8
+    install -d ${D}${includedir}/crash
+
+    install -m 0644 ${S}/crash.8 ${D}/${mandir}/man8/
+    install -m 0644 ${S}/defs.h ${D}${includedir}/crash
+}
+
+do_install_class-target () {
+    oe_runmake DESTDIR=${D} install
+}
+
+do_install_class-native () {
+    oe_runmake DESTDIR=${D}${STAGING_DIR_NATIVE} install
+}
+
+do_install_class-cross () {
+    install -m 0755 ${S}/crash ${D}/${bindir}
+}
+
+RDEPENDS_${PN} += "liblzma"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-cross = ""
+
+# Causes gcc to get stuck and eat all available memory in qemuarm builds
+# jenkins  15161  100 12.5 10389596 10321284 ?   R    11:40  28:17 /home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/cc1 -quiet -I . -I . -I ./common -I ./config -I ./../include/opcode -I ./../opcodes/.. -I ./../readline/.. -I ../bfd -I ./../bfd -I ./../include -I ../libdecnumber -I ./../libdecnumber -I ./gnulib/import -I build-gnulib/import -isysroot /home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemuarm -MMD eval.d -MF .deps/eval.Tpo -MP -MT eval.o -D LOCALEDIR="/usr/local/share/locale" -D CRASH_MERGE -D HAVE_CONFIG_H -D TUI=1 eval.c -quiet -dumpbase eval.c -march=armv5te -mthumb -mthumb-interwork -mtls-dialect=gnu -auxbase-strip eval.o -g -O2 -Wall -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -feliminate-unused-debug-types -o -
+ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap-module_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap-module_git.bb
index cb91327..1119d4c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap-module_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap-module_git.bb
@@ -7,7 +7,7 @@
 inherit module
 
 # See https://github.com/ktap/ktap/issues/80
-PNBLACKLIST[ktap-module] ?= "Not compatible with 3.19 kernel"
+PNBLACKLIST[ktap-module] ?= "Not compatible with 3.19 kernel - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 # Only build the module
 MAKE_TARGETS = "mod"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap_git.bb
index 248e7bd..a947b7f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/ktap/ktap_git.bb
@@ -5,7 +5,7 @@
 SUMMARY = "KTAP is a scripting dynamic tracing tool for Linux"
 DEPENDS = "ktap-module"
 
-PNBLACKLIST[ktap] ?= "Depends on blacklisted kernel-module-ktapvm"
+PNBLACKLIST[ktap] ?= "Depends on blacklisted kernel-module-ktapvm - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 # Only build the userspace app
 EXTRA_OEMAKE += "ktap"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-Add-proper-format-string-to-print-a-str.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-Add-proper-format-string-to-print-a-str.patch
new file mode 100644
index 0000000..056a0ba
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-Add-proper-format-string-to-print-a-str.patch
@@ -0,0 +1,35 @@
+From 0fff28f31aef9ad1d5a817216a3c98ba9d605106 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 19 Jun 2017 23:52:14 -0700
+Subject: [PATCH] makedumpfile: Add proper format string to print a string
+
+Fix
+makedumpfile.c: In function 'write_eraseinfo':
+makedumpfile.c:8273:4: error: format not a string literal and no format arguments [-Werror=format-security]
+    DEBUG_MSG(obuf);
+    ^~~~~~~~~
+makedumpfile.c:8273:4: error: format not a string literal and no format arguments [-Werror=format-security]
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ makedumpfile.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/makedumpfile.c b/makedumpfile.c
+index e69b6df..8b8a6b0 100644
+--- a/makedumpfile.c
++++ b/makedumpfile.c
+@@ -8270,7 +8270,7 @@ write_eraseinfo(struct cache_data *cd_page, unsigned long *size_out)
+ 			}
+ 			sprintf(obuf, "erase %s %s", erase_info[i].symbol_expr,
+ 							size_str);
+-			DEBUG_MSG(obuf);
++			DEBUG_MSG("%s", obuf);
+ 			if (!write_cache(cd_page, obuf, strlen(obuf)))
+ 				goto out;
+ 			size_eraseinfo += strlen(obuf);
+-- 
+2.13.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch b/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch
new file mode 100644
index 0000000..e0c3d9a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch
@@ -0,0 +1,73 @@
+From 653fe8e724081d2f289c2245d1220d5f7170538d Mon Sep 17 00:00:00 2001
+From: Alexandru Moise <alexandru.moise@windriver.com>
+Date: Fri, 29 Apr 2016 07:40:46 +0000
+Subject: [PATCH] mem_section: Support only 46 bit for MAX_PHYSMEM_BITS on
+ PPC64
+
+Related to change:
+http://lists.infradead.org/pipermail/kexec/2013-January/007849.html
+
+Linux on PPC64 has supported only 46 bit MAX_PHYSMEM_BITS since commit:
+048ee0993ec8360abb0b51bdf8f8721e9ed62ec4
+
+Also remove set_ppc64_max_physmem_bits and set info->max_physmem_bits in
+get_machdep_info_ppc64 instead. set_ppc64_max_physmem_bits is broken
+for all kernels compiled with CONFIG_SPARSEMEM=n. makedumpfile is
+unable to get mem_section field from powerpc kernel since commit:
+fd59d231f81cb02870b9cf15f456a897f3669b4e
+
+Upstream-Status: Pending
+
+Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ arch/ppc64.c | 28 ++--------------------------
+ 1 file changed, 2 insertions(+), 26 deletions(-)
+
+diff --git a/arch/ppc64.c b/arch/ppc64.c
+index 89a7f05..6c928ab 100644
+--- a/arch/ppc64.c
++++ b/arch/ppc64.c
+@@ -302,37 +302,13 @@ ppc64_vtop_level4(unsigned long vaddr)
+ }
+ 
+ int
+-set_ppc64_max_physmem_bits(void)
+-{
+-	long array_len = ARRAY_LENGTH(mem_section);
+-	/*
+-	 * The older ppc64 kernels uses _MAX_PHYSMEM_BITS as 42 and the
+-	 * newer kernels 3.7 onwards uses 46 bits.
+-	 */
+-
+-	info->max_physmem_bits  = _MAX_PHYSMEM_BITS_ORIG ;
+-	if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
+-		|| (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
+-		return TRUE;
+-
+-	info->max_physmem_bits  = _MAX_PHYSMEM_BITS_3_7;
+-	if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME()))
+-		|| (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT())))
+-		return TRUE;
+-
+-	return FALSE;
+-}
+-
+-int
+ get_machdep_info_ppc64(void)
+ {
+ 	unsigned long vmlist, vmap_area_list, vmalloc_start;
+ 
+ 	info->section_size_bits = _SECTION_SIZE_BITS;
+-	if (!set_ppc64_max_physmem_bits()) {
+-		ERRMSG("Can't detect max_physmem_bits.\n");
+-		return FALSE;
+-	}
++	info->max_physmem_bits = _MAX_PHYSMEM_BITS_3_7;
++
+ 	info->page_offset = __PAGE_OFFSET;
+ 
+ 	if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) {
+-- 
+2.5.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.0.bb
deleted file mode 100644
index 93a6f62..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.0.bb
+++ /dev/null
@@ -1,53 +0,0 @@
-SUMMARY = "VMcore extraction tool"
-DESCRIPTION = "\
-    This program is used to extract a subset of the memory available either \
-    via /dev/mem or /proc/vmcore (for crashdumps). It is used to get memory \
-    images without extra uneeded information (zero pages, userspace programs, \
-    etc). \
-"
-HOMEPAGE = "http://makedumpfile.sourceforge.net"
-
-DEPENDS = "bzip2 zlib elfutils"
-RDEPENDS_${PN}-tools = "perl ${PN}"
-
-# arm would compile but has never been tested upstream.  mips would not compile.
-#
-COMPATIBLE_HOST = "(x86_64|i.86|powerpc|arm).*-linux"
-
-PACKAGES =+ "${PN}-tools"
-FILES_${PN}-tools = "${bindir}/*.pl"
-
-SRC_URI = "\
-    ${SOURCEFORGE_MIRROR}/makedumpfile/${BPN}-${PV}.tar.gz \
-    file://0001-makedumpfile-replace-hardcode-CFLAGS.patch \
-"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-LICENSE = "GPLv2.0"
-
-SRC_URI[md5sum] = "041c5c6de2c3066600e4ca646c2397d6"
-SRC_URI[sha256sum] = "e3147abc52df2ceac1e9affef45bf37e2f2e1d9979bc94a761ee11e4044072ac"
-
-SECTION = "base"
-
-# If we do not specify TARGET, makedumpfile will build for the host but use the
-# target gcc.
-#
-EXTRA_OEMAKE = "\
-    LINKTYPE=static \
-    TARGET=${TARGET_ARCH} \
-"
-
-do_install () {
-    mkdir -p ${D}/usr/bin
-    install -m 755 ${S}/makedumpfile ${D}/usr/bin
-    install -m 755 ${S}/makedumpfile-R.pl ${D}/usr/bin
-
-    mkdir -p ${D}/usr/share/man/man8
-    install -m 644 ${S}/makedumpfile.8.gz ${D}/usr/share/man/man8
-
-    mkdir -p ${D}/usr/share/man/man5
-    install -m 644 ${S}/makedumpfile.conf.5.gz ${D}/usr/share/man/man5
-
-    mkdir -p ${D}/etc/
-    install -m 644 ${S}/makedumpfile.conf ${D}/etc/makedumpfile.conf.sample
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.1.bb
new file mode 100644
index 0000000..83bbf7f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.1.bb
@@ -0,0 +1,55 @@
+SUMMARY = "VMcore extraction tool"
+DESCRIPTION = "\
+    This program is used to extract a subset of the memory available either \
+    via /dev/mem or /proc/vmcore (for crashdumps). It is used to get memory \
+    images without extra uneeded information (zero pages, userspace programs, \
+    etc). \
+"
+HOMEPAGE = "http://makedumpfile.sourceforge.net"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+LICENSE = "GPLv2.0"
+
+DEPENDS = "bzip2 zlib elfutils"
+RDEPENDS_${PN}-tools = "perl ${PN}"
+
+# arm would compile but has never been tested upstream.  mips would not compile.
+#
+COMPATIBLE_HOST = "(x86_64|i.86|powerpc|arm).*-linux"
+
+PACKAGES =+ "${PN}-tools"
+FILES_${PN}-tools = "${bindir}/*.pl"
+
+SRC_URI = "\
+    ${SOURCEFORGE_MIRROR}/makedumpfile/${BPN}-${PV}.tar.gz \
+    file://0001-makedumpfile-replace-hardcode-CFLAGS.patch \
+    file://0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch \
+    file://0001-makedumpfile-Add-proper-format-string-to-print-a-str.patch \
+"
+SRC_URI[md5sum] = "16c0ae9902ae57be4a603a6ab1e86c53"
+SRC_URI[sha256sum] = "0b6e73106998670407887de9e1a505b3a2dbb2fb517a4b968a665eda8fb097ce"
+
+SECTION = "base"
+
+# If we do not specify TARGET, makedumpfile will build for the host but use the
+# target gcc.
+#
+EXTRA_OEMAKE = "\
+    LINKTYPE=static \
+    TARGET=${TARGET_ARCH} \
+"
+
+do_install () {
+    mkdir -p ${D}/usr/bin
+    install -m 755 ${S}/makedumpfile ${D}/usr/bin
+    install -m 755 ${S}/makedumpfile-R.pl ${D}/usr/bin
+
+    mkdir -p ${D}/usr/share/man/man8
+    install -m 644 ${S}/makedumpfile.8.gz ${D}/usr/share/man/man8
+
+    mkdir -p ${D}/usr/share/man/man5
+    install -m 644 ${S}/makedumpfile.conf.5.gz ${D}/usr/share/man/man5
+
+    mkdir -p ${D}/etc/
+    install -m 644 ${S}/makedumpfile.conf ${D}/etc/makedumpfile.conf.sample
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_1.0.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_1.0.2.bb
deleted file mode 100644
index babe544..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_1.0.2.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-SUMMARY = "minicoredumper provides an alternate core dump facility for Linux \
-to allow minimal and customized crash dumps"
-LICENSE = " LGPLv2.1 & BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=45445387350de96a0e70410470ee5cab"
-DEPENDS = "elfutils dbus dbus-glib-native glib-2.0 dbus-glib util-linux"
-
-inherit autotools pkgconfig systemd update-rc.d
-
-SRC_URI = "https://linutronix.de/${BPN}/files/${BPN}-${PV}.tar.gz \
-           file://minicoredumper.service \
-           file://minicoredumper.init \
-"
-SRC_URI[md5sum] = "5ba9d116b52a8e2fb93456260644e753"
-SRC_URI[sha256sum] = "1b0eeb3d70dbd2ad6f2f673e4e3446e5dd784e132730e21d8f9dc0977e47dd9a"
-
-SYSTEMD_SERVICE_${PN} = "minicoredumper.service"
-SYSTEMD_AUTO_ENABLE = "enable"
-
-INITSCRIPT_PACKAGES = "${PN}"
-INITSCRIPT_NAME_${PN} = "minicoredumper"
-INITSCRIPT_PARAMS_${PN} = "defaults 89"
-
-do_install_append() {
-    install -d ${D}/${sysconfdir}/minicoredumper
-    cp -rf ${S}/etc/* ${D}/${sysconfdir}/
-
-    install -d ${D}${systemd_system_unitdir}
-    install -m 0644 ${WORKDIR}/minicoredumper.service ${D}${systemd_system_unitdir}
-    install -d ${D}${sysconfdir}/init.d
-    install -m 0644 ${WORKDIR}/minicoredumper.init ${D}${sysconfdir}/init.d/minicoredumper
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb
new file mode 100644
index 0000000..58cd45a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb
@@ -0,0 +1,39 @@
+SUMMARY = "minicoredumper provides an alternate core dump facility for Linux \
+to allow minimal and customized crash dumps"
+LICENSE = " LGPLv2.1 & BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=709087c2ed0acda54a4d91497a889e42 \
+                    file://COPYING.BSD;md5=b915ac80d5236d6aa659cb986daf00e5 \
+                    file://COPYING.LGPLv2.1;md5=321bf41f280cf805086dd5a720b37785 \
+                   "
+DEPENDS = "elfutils dbus dbus-glib-native glib-2.0 dbus-glib util-linux json-c"
+
+inherit autotools pkgconfig systemd update-rc.d
+
+SRCREV = "248019446ccf6079926efb54f8b6dd7be769bbae"
+
+PR .= "+git${SRCPV}"
+
+SRC_URI = "git://github.com/Linutronix/minicoredumper-debian;branch=unstable \
+           file://minicoredumper.service \
+           file://minicoredumper.init \
+"
+
+S = "${WORKDIR}/git"
+
+SYSTEMD_SERVICE_${PN} = "minicoredumper.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME_${PN} = "minicoredumper"
+INITSCRIPT_PARAMS_${PN} = "defaults 89"
+
+do_install_append() {
+    rmdir ${D}${localstatedir}/run
+    install -d ${D}/${sysconfdir}/minicoredumper
+    cp -rf ${S}/etc/* ${D}/${sysconfdir}/
+
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/minicoredumper.service ${D}${systemd_system_unitdir}
+    install -d ${D}${sysconfdir}/init.d
+    install -m 0644 ${WORKDIR}/minicoredumper.init ${D}${sysconfdir}/init.d/minicoredumper
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/audiofile_0.2.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/audiofile_0.2.7.bb
deleted file mode 100644
index 6188659..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/audiofile_0.2.7.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-DESCRIPTION = "The Audio File Library provides a uniform and elegant \
-API for accessing a variety of audio file formats, such as AIFF/AIFF-C, \
-WAVE, NeXT/Sun .snd/.au, Berkeley/IRCAM/CARL Sound File, Audio Visual \
-Research, Amiga IFF/8SVX, and NIST SPHERE."
-HOMEPAGE = "http://www.68k.org/~michael/audiofile/"
-SECTION = "libs"
-LICENSE = "LGPLv2 & GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
-                    file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
-
-SRC_URI = "${GNOME_MIRROR}/audiofile/0.2/${BP}.tar.gz"
-SRC_URI[md5sum] = "a39be317a7b1971b408805dc5e371862"
-SRC_URI[sha256sum] = "a61c4036c2600a645843f16bec4be166093a9df5f15b02c85291213aa9cf15a2"
-
-inherit autotools lib_package binconfig
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/audiofile_0.3.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/audiofile_0.3.6.bb
new file mode 100644
index 0000000..f4e19e4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/audiofile_0.3.6.bb
@@ -0,0 +1,27 @@
+DESCRIPTION = "The Audio File Library provides a uniform and elegant \
+API for accessing a variety of audio file formats, such as AIFF/AIFF-C, \
+WAVE, NeXT/Sun .snd/.au, Berkeley/IRCAM/CARL Sound File, Audio Visual \
+Research, Amiga IFF/8SVX, and NIST SPHERE."
+HOMEPAGE = "http://www.68k.org/~michael/audiofile/"
+SECTION = "libs"
+LICENSE = "LGPLv2 & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+                    file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = " \
+    ${GNOME_MIRROR}/audiofile/0.3/${BP}.tar.xz \
+    file://0001-fix-negative-shift-constants.patch \
+    file://0002-fix-build-on-gcc6.patch \
+    file://0003-fix-CVE-2015-7747.patch \
+"
+SRC_URI[md5sum] = "235dde14742317328f0109e9866a8008"
+SRC_URI[sha256sum] = "ea2449ad3f201ec590d811db9da6d02ffc5e87a677d06b92ab15363d8cb59782"
+
+inherit autotools lib_package pkgconfig
+
+DEPENDS = " \
+    asciidoc-native \
+    alsa-lib \
+    libogg \
+    flac \
+"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/files/0001-fix-negative-shift-constants.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/files/0001-fix-negative-shift-constants.patch
new file mode 100644
index 0000000..ecb3108
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/files/0001-fix-negative-shift-constants.patch
@@ -0,0 +1,77 @@
+From 99127676dba8f5d607757428bc14a6b7ab52d5ed Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 16 Dec 2016 12:42:06 +0100
+Subject: [PATCH 1/3] fix negative shift constants
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Stolen from [1]
+
+[1] http://pkgs.fedoraproject.org/cgit/rpms/audiofile.git/tree/audiofile-0.3.6-left-shift-neg.patch
+
+Upstrem-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ libaudiofile/modules/SimpleModule.h | 2 +-
+ test/FloatToInt.cpp                 | 2 +-
+ test/IntToFloat.cpp                 | 2 +-
+ test/Sign.cpp                       | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libaudiofile/modules/SimpleModule.h b/libaudiofile/modules/SimpleModule.h
+index 03c6c69..e4cc138 100644
+--- a/libaudiofile/modules/SimpleModule.h
++++ b/libaudiofile/modules/SimpleModule.h
+@@ -123,7 +123,7 @@ struct signConverter
+ 	typedef typename IntTypes<Format>::UnsignedType UnsignedType;
+ 
+ 	static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
+-	static const int kMinSignedValue = -1 << kScaleBits;
++	static const int kMinSignedValue = 0-(1U<<kScaleBits);
+ 
+ 	struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
+ 	{
+diff --git a/test/FloatToInt.cpp b/test/FloatToInt.cpp
+index 0d179a8..bf491b2 100644
+--- a/test/FloatToInt.cpp
++++ b/test/FloatToInt.cpp
+@@ -115,7 +115,7 @@ TEST_F(FloatToIntTest, Int16)
+ 		EXPECT_EQ(readData[i], expectedData[i]);
+ }
+ 
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = 0-(1U<<23);
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+ 
+ TEST_F(FloatToIntTest, Int24)
+diff --git a/test/IntToFloat.cpp b/test/IntToFloat.cpp
+index b716635..1d91b58 100644
+--- a/test/IntToFloat.cpp
++++ b/test/IntToFloat.cpp
+@@ -117,7 +117,7 @@ TEST_F(IntToFloatTest, Int16)
+ 		EXPECT_EQ(readData[i], expectedData[i]);
+ }
+ 
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = 0-(1U<<23);
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+ 
+ TEST_F(IntToFloatTest, Int24)
+diff --git a/test/Sign.cpp b/test/Sign.cpp
+index 7275399..c339514 100644
+--- a/test/Sign.cpp
++++ b/test/Sign.cpp
+@@ -116,7 +116,7 @@ TEST_F(SignConversionTest, Int16)
+ 		EXPECT_EQ(readData[i], expectedData[i]);
+ }
+ 
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = 0-(1U<<23);
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+ static const uint32_t kMaxUInt24 = (1<<24) - 1;
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/files/0002-fix-build-on-gcc6.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/files/0002-fix-build-on-gcc6.patch
new file mode 100644
index 0000000..2c66cf4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/files/0002-fix-build-on-gcc6.patch
@@ -0,0 +1,75 @@
+From a74c1e9c583375b9e55c29a36442485089e4b7f9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 16 Dec 2016 12:42:06 +0100
+Subject: [PATCH 2/3] fix build on gcc6
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Stolen from [1]
+
+[1] http://pkgs.fedoraproject.org/cgit/rpms/audiofile.git/tree/audiofile-0.3.6-narrowing.patch
+
+Upstrem-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ test/NeXT.cpp | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/test/NeXT.cpp b/test/NeXT.cpp
+index 7e39850..a37cea1 100644
+--- a/test/NeXT.cpp
++++ b/test/NeXT.cpp
+@@ -37,13 +37,13 @@
+ 
+ #include "TestUtilities.h"
+ 
+-const char kDataUnspecifiedLength[] =
++const signed char kDataUnspecifiedLength[] =
+ {
+ 	'.', 's', 'n', 'd',
+ 	0, 0, 0, 24, // offset of 24 bytes
+-	0xff, 0xff, 0xff, 0xff, // unspecified length
++	-1, -1, -1, -1, // unspecified length
+ 	0, 0, 0, 3, // 16-bit linear
+-	0, 0, 172, 68, // 44100 Hz
++	0, 0, -84, 68, // 44100 Hz (0xAC44)
+ 	0, 0, 0, 1, // 1 channel
+ 	0, 1,
+ 	0, 1,
+@@ -57,13 +57,13 @@ const char kDataUnspecifiedLength[] =
+ 	0, 55
+ };
+ 
+-const char kDataTruncated[] =
++const signed char kDataTruncated[] =
+ {
+ 	'.', 's', 'n', 'd',
+ 	0, 0, 0, 24, // offset of 24 bytes
+ 	0, 0, 0, 20, // length of 20 bytes
+ 	0, 0, 0, 3, // 16-bit linear
+-	0, 0, 172, 68, // 44100 Hz
++	0, 0, -84, 68, // 44100 Hz (0xAC44)
+ 	0, 0, 0, 1, // 1 channel
+ 	0, 1,
+ 	0, 1,
+@@ -152,13 +152,13 @@ TEST(NeXT, Truncated)
+ 	ASSERT_EQ(::unlink(testFileName.c_str()), 0);
+ }
+ 
+-const char kDataZeroChannels[] =
++const signed char kDataZeroChannels[] =
+ {
+ 	'.', 's', 'n', 'd',
+ 	0, 0, 0, 24, // offset of 24 bytes
+ 	0, 0, 0, 2, // 2 bytes
+ 	0, 0, 0, 3, // 16-bit linear
+-	0, 0, 172, 68, // 44100 Hz
++	0, 0, -84, 68, // 44100 Hz (0xAC44)
+ 	0, 0, 0, 0, // 0 channels
+ 	0, 1
+ };
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/files/0003-fix-CVE-2015-7747.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/files/0003-fix-CVE-2015-7747.patch
new file mode 100644
index 0000000..895e320
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/audiofile/files/0003-fix-CVE-2015-7747.patch
@@ -0,0 +1,35 @@
+From 746c38105ce4fa1b609995d3386ea6b8b1f2f7bd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 16 Dec 2016 12:50:51 +0100
+Subject: [PATCH 3/3] fix CVE-2015-7747
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Stolen from [1]
+
+[1] http://pkgs.fedoraproject.org/cgit/rpms/audiofile.git/tree/audiofile-0.3.6-CVE-2015-7747.patch
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ libaudiofile/modules/ModuleState.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libaudiofile/modules/ModuleState.cpp b/libaudiofile/modules/ModuleState.cpp
+index f76c495..0c29d7a 100644
+--- a/libaudiofile/modules/ModuleState.cpp
++++ b/libaudiofile/modules/ModuleState.cpp
+@@ -402,7 +402,7 @@ status ModuleState::arrange(AFfilehandle file, Track *track)
+ 		addModule(new Transform(outfc, in.pcm, out.pcm));
+ 
+ 	if (in.channelCount != out.channelCount)
+-		addModule(new ApplyChannelMatrix(infc, isReading,
++		addModule(new ApplyChannelMatrix(outfc, isReading,
+ 			in.channelCount, out.channelCount,
+ 			in.pcm.minClip, in.pcm.maxClip,
+ 			track->channelMatrix));
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/cdrkit/cdrkit_1.1.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/cdrkit/cdrkit_1.1.11.bb
index 554b89f..f0efc51 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/cdrkit/cdrkit_1.1.11.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/cdrkit/cdrkit_1.1.11.bb
@@ -5,10 +5,10 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=b30d3b2750b668133fc17b401e1b98f8"
 
 # While writing download from cdrkit.org was broken so get sources from debian
-SRC_URI = " \
-    ${DEBIAN_MIRROR}/main/c/${BPN}/${BPN}_${PV}.orig.tar.gz \
-    file://0001-do-not-create-a-run-test-to-determine-order-of-bitfi.patch \
-"
+SRC_URI = "${DEBIAN_MIRROR}/main/c/${BPN}/${BPN}_${PV}.orig.tar.gz \
+           file://0001-do-not-create-a-run-test-to-determine-order-of-bitfi.patch \
+           file://0001-genisoimage-Fix-fprintf-format-errors.patch \
+           "
 SRC_URI[md5sum] = "efe08e2f3ca478486037b053acd512e9"
 SRC_URI[sha256sum] = "d1c030756ecc182defee9fe885638c1785d35a2c2a297b4604c0e0dcc78e47da"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/cdrkit/files/0001-genisoimage-Fix-fprintf-format-errors.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/cdrkit/files/0001-genisoimage-Fix-fprintf-format-errors.patch
new file mode 100644
index 0000000..f52f71b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/cdrkit/files/0001-genisoimage-Fix-fprintf-format-errors.patch
@@ -0,0 +1,49 @@
+From 8547f23c4416ed98f585c53c62e7d8afd8edab36 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 21:05:31 -0700
+Subject: [PATCH] genisoimage: Fix fprintf format errors
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ genisoimage/genisoimage.c | 4 ++--
+ genisoimage/tree.c        | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/genisoimage/genisoimage.c b/genisoimage/genisoimage.c
+index 46f0cb7..9089081 100644
+--- a/genisoimage/genisoimage.c
++++ b/genisoimage/genisoimage.c
+@@ -3406,7 +3406,7 @@ if (check_session == 0)
+ 	if (goof) {
+ 		fprintf(stderr, "ISO9660/Rock Ridge tree sort failed.\n");
+ 		if(merge_warn_msg)
+-			fprintf(stderr, merge_warn_msg);
++			fprintf(stderr, "%s", merge_warn_msg);
+ 		exit(1);
+ 	}
+ #ifdef UDF
+@@ -3419,7 +3419,7 @@ if (check_session == 0)
+ 	if (goof) {
+ 		fprintf(stderr, "Joliet tree sort failed. The -joliet-long switch may help you.\n");
+ 		if(merge_warn_msg)
+-			fprintf(stderr, merge_warn_msg);
++			fprintf(stderr, "%s", merge_warn_msg);
+ 		exit(1);
+ 	}
+ 	/*
+diff --git a/genisoimage/tree.c b/genisoimage/tree.c
+index 7805888..8412cc3 100644
+--- a/genisoimage/tree.c
++++ b/genisoimage/tree.c
+@@ -647,7 +647,7 @@ got_valid_name:
+      fprintf(stderr, "Unable to sort directory %s\n",
+            this_dir->whole_name);
+      if(merge_warn_msg)
+-        fprintf(stderr, merge_warn_msg);
++        fprintf(stderr, "%s", merge_warn_msg);
+      exit(1);
+ 	}
+ 	/*
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/esound/esound/0001-replace-missing-AM_PATH_AUDIOFILE-by-PKG_CHECK_MODUL.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/esound/esound/0001-replace-missing-AM_PATH_AUDIOFILE-by-PKG_CHECK_MODUL.patch
new file mode 100644
index 0000000..89c97a4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/esound/esound/0001-replace-missing-AM_PATH_AUDIOFILE-by-PKG_CHECK_MODUL.patch
@@ -0,0 +1,31 @@
+From 218e0702d6ce4d2cb20d5d108daa16afca2b7c41 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 16 Dec 2016 13:22:51 +0100
+Subject: [PATCH] replace missing AM_PATH_AUDIOFILE by PKG_CHECK_MODULES(
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstrem-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 486c492..dccfd1b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -353,7 +353,7 @@ echo "---------------------------------------------------------------------"
+ echo "--- Checking for the audiofile library.  NOTE: This library is now"
+ echo "--- REQUIRED from proper compilation of the esound package."
+ 
+-AM_PATH_AUDIOFILE(0.1.5, [
++PKG_CHECK_MODULES(AUDIOFILE, audiofile, [
+ 
+ build_esdplay=true
+ echo "--- libaudiofile found. Building esound with audiofile support"
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/esound/esound_0.2.36.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/esound/esound_0.2.36.bb
index 035358d..d19ba82 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/esound/esound_0.2.36.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/esound/esound_0.2.36.bb
@@ -8,10 +8,13 @@
 
 PR = "r1"
 
-SRC_URI = "ftp://ftp.gnome.org/pub/GNOME/sources/esound/0.2/esound-0.2.36.tar.bz2;name=archive \
-           file://esound_0.2.36-1ubuntu5.diff.gz \
-           file://no-docs.patch \
-           file://configure-fix.patch"
+SRC_URI = " \
+    ftp://ftp.gnome.org/pub/GNOME/sources/esound/0.2/esound-0.2.36.tar.bz2;name=archive \
+    file://esound_0.2.36-1ubuntu5.diff.gz \
+    file://no-docs.patch \
+    file://configure-fix.patch \
+    file://0001-replace-missing-AM_PATH_AUDIOFILE-by-PKG_CHECK_MODUL.patch \
+"
 
 SRC_URI[archive.md5sum] = "3facb5aa0115cc1c31771b9ad454ae76"
 SRC_URI[archive.sha256sum] = "68bf399fcbd45c5e9ba99cd13a3a479e4ef2bc5dc52e540ffa00aef1e1b19a76"
@@ -21,6 +24,9 @@
     --disable-arts \
     --disable-artstest \
 "
+
+CFLAGS += "-lm"
+
 do_configure_prepend() {
     sed -i -e 's:/usr/include/mme:${STAGING_INCDIR}/mme:g' ${S}/configure.ac
 }
@@ -30,4 +36,3 @@
 FILES_esddsp = "${bindir}/esddsp ${libdir}/libesddsp.so.*"
 FILES_esd = "${bindir}/esd"
 FILES_esd-utils = "${bindir}/*"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/a2jmidid/0002-aarch64.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/a2jmidid/0002-aarch64.patch
new file mode 100644
index 0000000..b344f54
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/a2jmidid/0002-aarch64.patch
@@ -0,0 +1,31 @@
+Consider compiler define for aarch64
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status:Pending
+
+Index: a2jmidid-8/sigsegv.c
+===================================================================
+--- a2jmidid-8.orig/sigsegv.c
++++ a2jmidid-8/sigsegv.c
+@@ -91,18 +91,18 @@ static void signal_segv(int signum, sigi
+     a2j_error("info.si_errno = %d", info->si_errno);
+     a2j_error("info.si_code  = %d (%s)", info->si_code, si_codes[info->si_code]);
+     a2j_error("info.si_addr  = %p", info->si_addr);
+-#if !defined(__alpha__) && !defined(__ia64__) && !defined(__FreeBSD_kernel__) && !defined(__arm__) && !defined(__hppa__) && !defined(__sh__)
++#if !defined(__alpha__) && !defined(__ia64__) && !defined(__FreeBSD_kernel__) && !defined(__arm__) && !defined(__hppa__) && !defined(__sh__) && !defined(__aarch64__)
+     for(i = 0; i < NGREG; i++)
+         a2j_error("reg[%02d]       = 0x" REGFORMAT, i,
+ #if defined(__powerpc__)
+                 ucontext->uc_mcontext.uc_regs[i]
+-#elif defined(__sparc__) && defined(__arch64__)
++#elif defined(__sparc__) || defined(__arch64__)
+                 ucontext->uc_mcontext.mc_gregs[i]
+ #else
+                 ucontext->uc_mcontext.gregs[i]
+ #endif
+                 );
+-#endif /* alpha, ia64, kFreeBSD, arm, hppa */
++#endif /* alpha, ia64, kFreeBSD, arm, hppa aarch64 */
+ 
+ #if defined(SIGSEGV_STACK_X86) || defined(SIGSEGV_STACK_IA64)
+ # if defined(SIGSEGV_STACK_IA64)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/a2jmidid_8.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/a2jmidid_8.bb
index d7e93b6..59b73f8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/a2jmidid_8.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/a2jmidid_8.bb
@@ -7,15 +7,19 @@
 "
 
 DEPENDS = "alsa-lib jack dbus"
+DEPENDS_append_libc-musl = " libexecinfo"
 
 SRC_URI = " \
     http://download.gna.org/${BPN}/${BPN}-${PV}.tar.bz2 \
     file://0001-wscript-add-pthread-library-dependency-to-fix-linkin.patch \
+    file://0002-aarch64.patch \
 "
 SRC_URI[md5sum] = "9cf4edbc3ad2ddeeaf6c8c1791ff3ddd"
 SRC_URI[sha256sum] = "2a9635f62aabc59edb54ada07048dd47e896b90caff94bcee710d3582606f55f"
 
-inherit waf
+inherit waf pkgconfig
+
+LDFLAGS_append_libc-musl = " -lexecinfo"
 
 export LINKFLAGS="${LDFLAGS}"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/jack/0001-typecast-input-parameter-to-int-for-abs.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/jack/0001-typecast-input-parameter-to-int-for-abs.patch
new file mode 100644
index 0000000..c119f19
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/jack/0001-typecast-input-parameter-to-int-for-abs.patch
@@ -0,0 +1,32 @@
+From 8ec6f75bf7a318a3a1e352df7c97630cfaba537a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Apr 2017 16:18:39 -0700
+Subject: [PATCH] typecast input parameter to int for abs()
+
+Fixes
+../tests/test.cpp:482:73: error: call of overloaded 'abs(jack_nframes_t)' is ambiguous
+
+because the signature is int abs(int) and its passing
+unsigned int to it.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/test.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test.cpp b/tests/test.cpp
+index 8a8a8117..9655742e 100644
+--- a/tests/test.cpp
++++ b/tests/test.cpp
+@@ -479,7 +479,7 @@ int process4(jack_nframes_t nframes, void *arg)
+ 	jack_nframes_t delta_time = cur_time - last_time;
+ 
+ 	Log("calling process4 callback : jack_frame_time = %ld delta_time = %ld\n", cur_time, delta_time);
+-	if (delta_time > 0  && (jack_nframes_t)abs(delta_time - cur_buffer_size) > tolerance) {
++	if (delta_time > 0  && (jack_nframes_t)abs(int(delta_time - cur_buffer_size)) > tolerance) {
+ 		printf("!!! ERROR !!! jack_frame_time seems to return incorrect values cur_buffer_size = %d, delta_time = %d tolerance %d\n", cur_buffer_size, delta_time, tolerance);
+ 	}
+ 
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/jack_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/jack_git.bb
index 66cec0a..b85ba8a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/jack_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/jack/jack_git.bb
@@ -12,23 +12,28 @@
     file://common/jack/jack.h;beginline=1;endline=19;md5=6b736ed6b810592b135480a5e853392e \
 "
 
-DEPENDS = "libsamplerate0 libsndfile1 libopus readline"
+DEPENDS = "libsamplerate0 libsndfile1 readline"
 
-SRC_URI = "git://github.com/jackaudio/jack2.git"
-SRCREV = "364159f8212393442670b9c3b68b75aa39d98975"
+SRC_URI = "git://github.com/jackaudio/jack2.git \
+           file://0001-typecast-input-parameter-to-int-for-abs.patch \
+          "
+SRCREV = "2d1d323505585d406a7e64fb932953baefc5945e"
 PV = "1.9.10+git${SRCPV}"
 S = "${WORKDIR}/git"
 
 inherit waf pkgconfig
 
 PACKAGECONFIG ??= "alsa"
-PACKAGECONFIG[alsa] = "--alsa=yes,alsa=no,alsa-lib"
+PACKAGECONFIG[alsa] = "--alsa=yes,--alsa=no,alsa-lib"
+PACKAGECONFIG[opus] = "--opus=yes,--opus=no,libopus"
 
 # portaudio is for windows builds only
 EXTRA_OECONF = "--portaudio=no"
 
 PACKAGES =+ "libjack jack-server jack-utils"
 
+RDEPENDS_jack-dev_remove = "${PN} (= ${EXTENDPKGV})"
+
 FILES_libjack = "${libdir}/*.so.* ${libdir}/jack/*.so"
 FILES_jack-server = "${bindir}/jackd"
 FILES_jack-utils = "${bindir}/*"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libass/libass.inc b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libass/libass.inc
index 85ac873..4bc3db0 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libass/libass.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libass/libass.inc
@@ -3,7 +3,7 @@
 SECTION = "libs/multimedia"
 
 LICENSE = "ISC"
-LIC_FILES_CHKSUM = "file://COPYING;md5=8ae98663bac55afe5d989919d296f28a"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a42532a0684420bdb15556c3cdd49a75"
 
 DEPENDS = "enca fontconfig freetype libpng fribidi"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libass/libass_0.13.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libass/libass_0.13.2.bb
deleted file mode 100644
index 8cf2bd8..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libass/libass_0.13.2.bb
+++ /dev/null
@@ -1,4 +0,0 @@
-require recipes-multimedia/${BPN}/${BPN}.inc
-
-SRC_URI[md5sum] = "1c8cbd5751aeb192bda04a65d0464fd9"
-SRC_URI[sha256sum] = "d698d0a6adca7c36c5a86b540d67b05bfd36cebc3c351ab7646497c43fe1face"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libass/libass_0.13.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libass/libass_0.13.6.bb
new file mode 100644
index 0000000..40ac0f8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libass/libass_0.13.6.bb
@@ -0,0 +1,4 @@
+require recipes-multimedia/${BPN}/${BPN}.inc
+
+SRC_URI[md5sum] = "daa6cfca437c0776af5f79750cdd9b4e"
+SRC_URI[sha256sum] = "f8a874d104e3e72e2cc057e5a1710c650b10367486845a26e5ff28ed7a912c2d"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libcdio/libcdio-paranoia_10.2+0.93+1.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libcdio/libcdio-paranoia_10.2+0.93+1.bb
new file mode 100644
index 0000000..82a16cc
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libcdio/libcdio-paranoia_10.2+0.93+1.bb
@@ -0,0 +1,24 @@
+SUMMARY = "library to read digital audio CDs with error correction"
+HOMEPAGE = "http://www.gnu.org/software/libcdio/"
+SECTION = "libs"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "libcdio"
+
+SRC_URI = "${GNU_MIRROR}/libcdio/${BP}.tar.bz2"
+SRC_URI[md5sum] = "0255aa50e660db7f2c39658b9c565814"
+SRC_URI[sha256sum] = "ec1d9b1d5a28cc042f2cb33a7cc0a2b5ce5525f102bc4c15db1fac322559a493"
+
+inherit autotools pkgconfig
+
+PACKAGES += "${PN}-utils"
+
+FILES_${PN} = "${libdir}/${BPN}${SOLIB}"
+FILES_${PN}-utils = "${bindir}/*"
+
+python libcdio_split_packages() {
+    libdir = d.expand('${libdir}')
+    do_split_packages(d, libdir, '^lib(.*)\.so\..*', 'lib%s', 'libcdio %s library', extra_depends='', allow_links=True)
+}
+
+PACKAGESPLITFUNCS =+ "libcdio_split_packages"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libcdio/libcdio_0.93.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libcdio/libcdio_0.93.bb
index f21f914..99e6a84 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libcdio/libcdio_0.93.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libcdio/libcdio_0.93.bb
@@ -1,25 +1,28 @@
-ESCRIPTION = "The GNU Compact Disc Input and Control library (libcdio) contains a library for CD-ROM and CD image access."
+SUMMARY = "The GNU Compact Disc Input and Control library (libcdio) contains a library for CD-ROM and CD image access."
 HOMEPAGE = "http://www.gnu.org/software/libcdio/"
 SECTION = "libs"
-
 LICENSE = "GPLv3+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
-DEPENDS = "ncurses"
-
 SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz"
 SRC_URI[md5sum] = "d154476feaac5a7b5f180e83eaf3d689"
 SRC_URI[sha256sum] = "4972cd22fd8d0e8bff922d35c7a645be0db0ab0e7b3dfaecc9cd8272429d6975"
 
 inherit autotools pkgconfig
 
+PACKAGECONFIG ??= "cdda-player"
+PACKAGECONFIG[cdda-player] = "--with-cdda-player,--without-cdda-player,ncurses"
+PACKAGECONFIG[cddb] = "--enable-cddb,--disable-cddb,libcddb"
+PACKAGECONFIG[vcd-info] = "--enable-vcd-info,--disable-vcd-info,vcdimager"
+
 PACKAGES += "${PN}-utils"
 
-FILES_${PN} = "${libdir}/${PN}${SOLIB}"
+FILES_${PN} = "${libdir}/${BPN}${SOLIB}"
 FILES_${PN}-utils = "${bindir}/*"
 
-python populate_packages_prepend () {
-    glibdir = d.expand('${libdir}')
-    do_split_packages(d, glibdir, '^lib(.*)\.so\..*', 'lib%s', 'gstreamer %s library', extra_depends='', allow_links=True)
+python libcdio_split_packages() {
+    libdir = d.expand('${libdir}')
+    do_split_packages(d, libdir, '^lib(.*)\.so\..*', 'lib%s', 'libcdio %s library', extra_depends='', allow_links=True)
 }
 
+PACKAGESPLITFUNCS =+ "libcdio_split_packages"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libopus/libopus_1.1.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libopus/libopus_1.1.2.bb
deleted file mode 100644
index 9d9a634..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libopus/libopus_1.1.2.bb
+++ /dev/null
@@ -1,50 +0,0 @@
-SUMMARY = "Opus Audio Codec"
-DESCRIPTION = "The Opus codec is designed for interactive \
-speech and audio transmission over the Internet. It is \
-designed by the IETF Codec Working Group and incorporates \
-technology from Skype's SILK codec and Xiph.Org's CELT codec."
-HOMEPAGE = "http://www.opus-codec.org/"
-SECTION = "libs/multimedia"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=e304cdf74c2a1b0a33a5084c128a23a3"
-
-SRC_URI = "http://downloads.xiph.org/releases/opus/opus-${PV}.tar.gz"
-SRC_URI[md5sum] = "1f08a661bc72930187893a07f3741a91"
-SRC_URI[sha256sum] = "0e290078e31211baa7b5886bcc8ab6bc048b9fc83882532da4a1a45e58e907fd"
-
-S = "${WORKDIR}/opus-${PV}"
-
-inherit autotools pkgconfig
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[fixed-point] = "--enable-fixed-point,,"
-PACKAGECONFIG[float-approx] = "--enable-float-approx,,"
-
-EXTRA_OECONF = "--with-NE10-includes=${STAGING_DIR_TARGET}${includedir} \
-                --with-NE10-libraries=${STAGING_DIR_TARGET}${libdir} \
-                --enable-asm \
-                --enable-intrinsics \
-               "
-
-python () {
-    if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
-        d.appendVar('PACKAGECONFIG', ' fixed-point')
-
-    # Ne10 is only available for armv7 and aarch64
-    if any((t.startswith('armv7') or t.startswith('aarch64')) for t in d.getVar('TUNE_FEATURES', True).split()):
-        d.appendVar('DEPENDS', ' ne10')
-}
-
-# Fails to build with thumb-1 (qemuarm)
-#| {standard input}: Assembler messages:
-#| {standard input}:389: Error: selected processor does not support Thumb mode `smull r5,r7,r1,r4'
-#| {standard input}:418: Error: selected processor does not support Thumb mode `smull r5,r6,r4,r1'
-#| {standard input}:448: Error: selected processor does not support Thumb mode `smull r4,r5,r1,r0'
-#| {standard input}:474: Error: selected processor does not support Thumb mode `smull r0,r4,r8,r1'
-#| {standard input}:510: Error: selected processor does not support Thumb mode `smull fp,r0,r10,r1'
-#| {standard input}:553: Error: selected processor does not support Thumb mode `smull fp,r1,r10,r3'
-#| {standard input}:741: Error: selected processor does not support Thumb mode `smull r3,r0,r6,r10'
-#| {standard input}:761: Error: selected processor does not support Thumb mode `smull fp,r2,r3,r9'
-#| {standard input}:773: Error: selected processor does not support Thumb mode `smull fp,r3,r5,r8'
-#| make[2]: *** [celt/celt.lo] Error 1
-ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libopus/libopus_1.1.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libopus/libopus_1.1.3.bb
new file mode 100644
index 0000000..a24f5e3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libopus/libopus_1.1.3.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Opus Audio Codec"
+DESCRIPTION = "The Opus codec is designed for interactive \
+speech and audio transmission over the Internet. It is \
+designed by the IETF Codec Working Group and incorporates \
+technology from Skype's SILK codec and Xiph.Org's CELT codec."
+HOMEPAGE = "http://www.opus-codec.org/"
+SECTION = "libs/multimedia"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e304cdf74c2a1b0a33a5084c128a23a3"
+
+SRC_URI = "http://downloads.xiph.org/releases/opus/opus-${PV}.tar.gz"
+SRC_URI[md5sum] = "32bbb6b557fe1b6066adc0ae1f08b629"
+SRC_URI[sha256sum] = "58b6fe802e7e30182e95d0cde890c0ace40b6f125cffc50635f0ad2eef69b633"
+
+S = "${WORKDIR}/opus-${PV}"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[fixed-point] = "--enable-fixed-point,,"
+PACKAGECONFIG[float-approx] = "--enable-float-approx,,"
+
+EXTRA_OECONF = " \
+    --with-NE10-includes=${STAGING_DIR_TARGET}${includedir} \
+    --with-NE10-libraries=${STAGING_DIR_TARGET}${libdir} \
+    --enable-asm \
+    --enable-intrinsics \
+    --enable-custom-modes \
+"
+
+python () {
+    if d.getVar('TARGET_FPU') in [ 'soft' ]:
+        d.appendVar('PACKAGECONFIG', ' fixed-point')
+
+    # Ne10 is only available for armv7 and aarch64
+    if any((t.startswith('armv7') or t.startswith('aarch64')) for t in d.getVar('TUNE_FEATURES').split()):
+        d.appendVar('DEPENDS', ' ne10')
+}
+
+# Fails to build with thumb-1 (qemuarm)
+#| {standard input}: Assembler messages:
+#| {standard input}:389: Error: selected processor does not support Thumb mode `smull r5,r7,r1,r4'
+#| {standard input}:418: Error: selected processor does not support Thumb mode `smull r5,r6,r4,r1'
+#| {standard input}:448: Error: selected processor does not support Thumb mode `smull r4,r5,r1,r0'
+#| {standard input}:474: Error: selected processor does not support Thumb mode `smull r0,r4,r8,r1'
+#| {standard input}:510: Error: selected processor does not support Thumb mode `smull fp,r0,r10,r1'
+#| {standard input}:553: Error: selected processor does not support Thumb mode `smull fp,r1,r10,r3'
+#| {standard input}:741: Error: selected processor does not support Thumb mode `smull r3,r0,r6,r10'
+#| {standard input}:761: Error: selected processor does not support Thumb mode `smull fp,r2,r3,r9'
+#| {standard input}:773: Error: selected processor does not support Thumb mode `smull fp,r3,r5,r8'
+#| make[2]: *** [celt/celt.lo] Error 1
+ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libsdl-mixer/libsdl-mixer_1.2.12.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libsdl-mixer/libsdl-mixer_1.2.12.bb
index f1a01b9..c83fcc8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libsdl-mixer/libsdl-mixer_1.2.12.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libsdl-mixer/libsdl-mixer_1.2.12.bb
@@ -13,7 +13,7 @@
 
 S = "${WORKDIR}/SDL_mixer-${PV}"
 
-inherit autotools-brokensep
+inherit autotools-brokensep pkgconfig
 
 EXTRA_AUTORECONF += "--include=acinclude"
 EXTRA_OECONF = "--disable-music-mp3 --enable-music-ogg --enable-music-ogg-tremor LIBS=-L${STAGING_LIBDIR}"
@@ -37,4 +37,3 @@
         sed -i -e 's:-L/usr/lib:-L${STAGING_LIBDIR}:g' $i
     done
 }
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libsdl-mixer/libsdl2-mixer_2.0.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libsdl-mixer/libsdl2-mixer_2.0.1.bb
index 2dc48e4..8276b44 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libsdl-mixer/libsdl2-mixer_2.0.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/libsdl-mixer/libsdl2-mixer_2.0.1.bb
@@ -11,7 +11,7 @@
 
 S = "${WORKDIR}/SDL2_mixer-${PV}"
 
-inherit autotools-brokensep
+inherit autotools-brokensep pkgconfig
 
 EXTRA_AUTORECONF += "--include=acinclude"
 EXTRA_OECONF = "--disable-music-mp3 --enable-music-ogg --enable-music-ogg-tremor LIBS=-L${STAGING_LIBDIR}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/live555/live555.inc b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/live555/live555.inc
index 0d11de9..daae8d7 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/live555/live555.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/live555/live555.inc
@@ -7,9 +7,7 @@
 LICENSE = "LGPLv3"
 SECTION = "devel"
 
-INC_PR = "r1"
-
-URLV = "${@d.getVar('PV',1)[0:4]}.${@d.getVar('PV',1)[4:6]}.${@d.getVar('PV',1)[6:8]}"
+URLV = "${@d.getVar('PV')[0:4]}.${@d.getVar('PV')[4:6]}.${@d.getVar('PV')[6:8]}"
 SRC_URI = "http://www.live555.com/liveMedia/public/live.${URLV}.tar.gz \
            file://config.linux-cross"
 # only latest live version stays on http://www.live555.com/liveMedia/public/, add mirror for older
@@ -18,14 +16,17 @@
 S = "${WORKDIR}/live"
 TARGET_CC_ARCH += "${LDFLAGS}"
 
+XLOCALE_libc-musl = " -DXLOCALE_NOT_USED"
+XLOCALE ?= ""
+
 do_configure() {
     cp ${WORKDIR}/config.linux-cross .
-    echo "COMPILE_OPTS+=" -fPIC "" >> config.linux-cross
+    echo "COMPILE_OPTS+=" -fPIC ${XLOCALE}"" >> config.linux-cross
     ./genMakefiles linux-cross
 }
 
 do_compile() {
-    make
+    oe_runmake
 }
 
 do_install() {
@@ -45,14 +46,14 @@
     done
     cp ${S}/*/*.a ${D}${libdir}
     install -d ${D}${bindir}
-    for i in MPEG2TransportStreamIndexer openRTSP playSIP sapWatch testMPEG1or2AudioVideoToDarwin testMPEG1or2ProgramToTransportStream testMPEG1or2Splitter testMPEG1or2VideoReceiver testMPEG2TransportStreamTrickPlay testMPEG4VideoToDarwin testOnDemandRTSPServer testRelay testAMRAudioStreamer testDVVideoStreamer testMP3Receiver testMP3Streamer testMPEG1or2AudioVideoStreamer testMPEG1or2VideoStreamer testMPEG2TransportStreamer testMPEG4VideoStreamer testWAVAudioStreamer vobStreamer; do
+    for i in MPEG2TransportStreamIndexer openRTSP playSIP sapWatch testMPEG1or2ProgramToTransportStream testMPEG1or2Splitter testMPEG1or2VideoReceiver testMPEG2TransportStreamTrickPlay testOnDemandRTSPServer testRelay testAMRAudioStreamer testDVVideoStreamer testMP3Receiver testMP3Streamer testMPEG1or2AudioVideoStreamer testMPEG1or2VideoStreamer testMPEG2TransportStreamer testMPEG4VideoStreamer testWAVAudioStreamer vobStreamer; do
         install -m 0755 ${S}/testProgs/${i} ${D}${bindir}/
     done
     install -m 0755 ${S}/mediaServer/live555MediaServer ${D}${bindir}/
 }
 
 PACKAGES =+ " live555-openrtsp live555-playsip live555-mediaserver"
-FILES_${PN} = "${bindir}/sapWatch ${bindir}/testMPEG1or2AudioVideoToDarwin ${bindir}/testMPEG1or2ProgramToTransportStream ${bindir}/testMPEG1or2Splitter ${bindir}/testMPEG1or2VideoReceiver ${bindir}/testMPEG2TransportStreamTrickPlay ${bindir}/testMPEG4VideoToDarwin ${bindir}/testOnDemandRTSPServer ${bindir}/testRelay ${bindir}/testAMRAudioStreamer ${bindir}/testDVVideoStreamer ${bindir}/testMP3Receiver ${bindir}/testMP3Streamer ${bindir}/testMPEG1or2AudioVideoStreamer ${bindir}/testMPEG1or2VideoStreamer ${bindir}/testMPEG2TransportStreamer ${bindir}/testMPEG4VideoStreamer ${bindir}/testWAVAudioStreamer ${bindir}/vobStreamer ${bindir}/MPEG2TransportStreamIndexer"
+FILES_${PN} = "${bindir}/sapWatch ${bindir}/testMPEG1or2ProgramToTransportStream ${bindir}/testMPEG1or2Splitter ${bindir}/testMPEG1or2VideoReceiver ${bindir}/testMPEG2TransportStreamTrickPlay ${bindir}/testOnDemandRTSPServer ${bindir}/testRelay ${bindir}/testAMRAudioStreamer ${bindir}/testDVVideoStreamer ${bindir}/testMP3Receiver ${bindir}/testMP3Streamer ${bindir}/testMPEG1or2AudioVideoStreamer ${bindir}/testMPEG1or2VideoStreamer ${bindir}/testMPEG2TransportStreamer ${bindir}/testMPEG4VideoStreamer ${bindir}/testWAVAudioStreamer ${bindir}/vobStreamer ${bindir}/MPEG2TransportStreamIndexer"
 FILES_live555-openrtsp = "${bindir}/openRTSP"
 FILES_live555-playsip = "${bindir}/playSIP"
 FILES_live555-mediaserver = "${bindir}/live555MediaServer"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/live555/live555_20130430.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/live555/live555_20130430.bb
deleted file mode 100644
index f83285c..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/live555/live555_20130430.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require live555.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=68ad62c64cc6c620126241fd429e68fe"
-
-SRC_URI[md5sum] = "95533d91bd196e42fd748076dc244b09"
-SRC_URI[sha256sum] = "e549af608c9961d85cb647bc3b99804fec0fbaf5338c1b72d057558ae5cd2aea"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/live555/live555_20170410.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/live555/live555_20170410.bb
new file mode 100644
index 0000000..27fc429
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/live555/live555_20170410.bb
@@ -0,0 +1,9 @@
+require live555.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02 \
+                   "
+
+SRC_URI[md5sum] = "b7084a72aeb09549c8b248f8cc308841"
+SRC_URI[sha256sum] = "4c37d9c828f9028403997272e49968c260385dbbaef62e28ba24faef0dda868b"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mikmod/libmikmod_3.3.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mikmod/libmikmod_3.3.6.bb
index 2e1b9bf..d53dff6 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mikmod/libmikmod_3.3.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mikmod/libmikmod_3.3.6.bb
@@ -3,7 +3,7 @@
 LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c"
 
-DEPENDS = "alsa-lib texinfo pulseaudio"
+DEPENDS = "alsa-lib texinfo"
 
 SRC_URI = "\
     ${SOURCEFORGE_MIRROR}/project/mikmod/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
@@ -24,3 +24,5 @@
     --enable-threads \
 "
 
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)}"
+PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna_1.1.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna_1.1.5.bb
index 7c6db62..81d700a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna_1.1.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/minidlna/minidlna_1.1.5.bb
@@ -2,3 +2,5 @@
 
 SRCREV = "v1_1_5"
 LIC_FILES_CHKSUM = "file://LICENCE.miniupnpd;md5=b0dabf9d8e0f871554e309d62ead8d2b"
+
+PNBLACKLIST[minidlna] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130630/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mplayer2_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mplayer2_git.bb
index 330dfd3..1a4ae27 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mplayer2_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mplayer2_git.bb
@@ -156,4 +156,4 @@
 }
 
 # http://errors.yoctoproject.org/Errors/Details/40734/
-PNBLACKLIST[mplayer2] ?= "Not compatible with currently used ffmpeg 3"
+PNBLACKLIST[mplayer2] ?= "Not compatible with currently used ffmpeg 3 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mpv/0001-Fix-build-with-HAVE_GL-0.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mpv/0001-Fix-build-with-HAVE_GL-0.patch
new file mode 100644
index 0000000..ab2b534
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mpv/0001-Fix-build-with-HAVE_GL-0.patch
@@ -0,0 +1,39 @@
+From 212f6c8206bd4dcc7d8970c5f1632823ae4e783a Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Sun, 12 Feb 2017 23:01:21 -0800
+Subject: [PATCH] Fix build with HAVE_GL==0
+
+video/out/opengl/hwdec.h includes video/out/opengl/common.h, which tries
+to include opengl headers.
+
+Upstream-Status: Backport
+---
+ options/options.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/options/options.c b/options/options.c
+index b711156..0bb36ad 100644
+--- a/options/options.c
++++ b/options/options.c
+@@ -40,7 +40,6 @@
+ #include "stream/stream.h"
+ #include "video/csputils.h"
+ #include "video/hwdec.h"
+-#include "video/out/opengl/hwdec.h"
+ #include "video/image_writer.h"
+ #include "sub/osd.h"
+ #include "audio/filter/af.h"
+@@ -53,6 +52,10 @@
+ #include "video/out/drm_common.h"
+ #endif
+ 
++#if HAVE_GL
++#include "video/out/opengl/hwdec.h"
++#endif
++
+ extern const char mp_help_text[];
+ 
+ static void print_version(struct mp_log *log)
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mpv_0.15.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mpv_0.15.0.bb
deleted file mode 100644
index f51df77..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mpv_0.15.0.bb
+++ /dev/null
@@ -1,61 +0,0 @@
-SUMMARY = "Open Source multimedia player"
-DESCRIPTION = "mpv is a fork of mplayer2 and MPlayer. It shares some features with the former projects while introducing many more."
-SECTION = "multimedia"
-HOMEPAGE = "http://www.mpv.io/"
-DEPENDS = "zlib ffmpeg jpeg virtual/libx11 xsp libxv \
-           libxscrnsaver libv4l libxinerama libvdpau \
-"
-
-REQUIRED_DISTRO_FEATURES = "x11"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=91f1cb870c1cc2d31351a4d2595441cb"
-
-SRC_URI = "https://github.com/mpv-player/mpv/archive/v${PV}.tar.gz;name=mpv \
-           http://www.freehackers.org/~tnagy/release/waf-1.8.12;name=waf;subdir=${BPN}-${PV} \
-"
-SRC_URI[mpv.md5sum] = "9042bd3fbff2bc8ba0b7fadaa4a22101"
-SRC_URI[mpv.sha256sum] = "7d31217ba8572f364fcea2955733f821374ae6d8c6d8f22f8bc63c44c0400bdc"
-SRC_URI[waf.md5sum] = "cef4ee82206b1843db082d0b0506bf71"
-SRC_URI[waf.sha256sum] = "01bf2beab2106d1558800c8709bc2c8e496d3da4a2ca343fe091f22fca60c98b"
-
-inherit waf pkgconfig pythonnative distro_features_check
-
-# Note: both lua and libass are required to get on-screen-display (controls)
-PACKAGECONFIG ??= "lua libass"
-PACKAGECONFIG[lua] = "--enable-lua,--disable-lua,lua luajit"
-PACKAGECONFIG[libass] = "--enable-libass,--disable-libass,libass"
-PACKAGECONFIG[libarchive] = "--enable-libarchive,--disable-libarchive,libarchive"
-PACKAGECONFIG[jack] = "--enable-jack, --disable-jack, jack"
-PACKAGECONFIG[vaapi] = "--enable-vaapi, --disable-vaapi,libva"
-
-SIMPLE_TARGET_SYS = "${@'${TARGET_SYS}'.replace('${TARGET_VENDOR}', '')}"
-EXTRA_OECONF = " \
-    --prefix=${prefix} \
-    --target=${SIMPLE_TARGET_SYS} \
-    --confdir=${sysconfdir} \
-    --datadir=${datadir} \
-    --disable-manpage-build \
-    --disable-gl \
-    --disable-libsmbclient \
-    --disable-encoding \
-    --disable-libbluray \
-    --disable-dvdread \
-    --disable-dvdnav \
-    --disable-cdda \
-    --disable-enca \
-    --disable-libguess \
-    --disable-uchardet \
-    --disable-rubberband \
-    --disable-lcms2 \
-    --disable-vapoursynth \
-    --disable-vapoursynth-lazy \
-    ${PACKAGECONFIG_CONFARGS} \
-"
-
-do_configure_prepend () {
-    ln -sf waf-1.8.12 ${S}/waf
-    chmod +x ${S}/waf
-}
-
-FILES_${PN} += "${datadir}/icons"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mpv_0.24.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mpv_0.24.0.bb
new file mode 100644
index 0000000..b1da217
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/mplayer/mpv_0.24.0.bb
@@ -0,0 +1,70 @@
+SUMMARY = "Open Source multimedia player"
+DESCRIPTION = "mpv is a fork of mplayer2 and MPlayer. It shares some features with the former projects while introducing many more."
+SECTION = "multimedia"
+HOMEPAGE = "http://www.mpv.io/"
+DEPENDS = "zlib ffmpeg jpeg virtual/libx11 xsp libxv \
+           libxscrnsaver libv4l libxinerama \
+"
+
+REQUIRED_DISTRO_FEATURES = "x11"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=91f1cb870c1cc2d31351a4d2595441cb"
+
+SRC_URI = " \
+    https://github.com/mpv-player/mpv/archive/v${PV}.tar.gz;name=mpv \
+    http://www.freehackers.org/~tnagy/release/waf-1.8.12;name=waf;subdir=${BPN}-${PV} \
+    file://0001-Fix-build-with-HAVE_GL-0.patch \
+"
+SRC_URI[mpv.md5sum] = "5c85d1163911e49315a5bf1ca1fae13d"
+SRC_URI[mpv.sha256sum] = "a41854fa0ac35b9c309ad692aaee67c8d4495c3546f11cb4cdd0a124195d3f15"
+SRC_URI[waf.md5sum] = "cef4ee82206b1843db082d0b0506bf71"
+SRC_URI[waf.sha256sum] = "01bf2beab2106d1558800c8709bc2c8e496d3da4a2ca343fe091f22fca60c98b"
+
+inherit waf pkgconfig pythonnative distro_features_check
+
+# Note: both lua and libass are required to get on-screen-display (controls)
+PACKAGECONFIG ??= " \
+    lua \
+    libass \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \
+"
+PACKAGECONFIG[drm] = "--enable-drm,--disable-drm,libdrm"
+PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/mesa"
+PACKAGECONFIG[lua] = "--enable-lua,--disable-lua,lua luajit"
+PACKAGECONFIG[libass] = "--enable-libass,--disable-libass,libass"
+PACKAGECONFIG[libarchive] = "--enable-libarchive,--disable-libarchive,libarchive"
+PACKAGECONFIG[jack] = "--enable-jack, --disable-jack, jack"
+PACKAGECONFIG[vaapi] = "--enable-vaapi, --disable-vaapi,libva"
+PACKAGECONFIG[vdpau] = "--enable-vdpau, --disable-vdpau,libvdpau"
+PACKAGECONFIG[wayland] = "--enable-wayland, --disable-wayland,wayland libxkbcommon"
+
+SIMPLE_TARGET_SYS = "${@'${TARGET_SYS}'.replace('${TARGET_VENDOR}', '')}"
+
+EXTRA_OECONF = " \
+    --prefix=${prefix} \
+    --target=${SIMPLE_TARGET_SYS} \
+    --confdir=${sysconfdir} \
+    --datadir=${datadir} \
+    --disable-manpage-build \
+    --disable-gl \
+    --disable-libsmbclient \
+    --disable-encoding \
+    --disable-libbluray \
+    --disable-dvdread \
+    --disable-dvdnav \
+    --disable-cdda \
+    --disable-uchardet \
+    --disable-rubberband \
+    --disable-lcms2 \
+    --disable-vapoursynth \
+    --disable-vapoursynth-lazy \
+    ${PACKAGECONFIG_CONFARGS} \
+"
+
+do_configure_prepend () {
+    ln -sf waf-1.8.12 ${S}/waf
+    chmod +x ${S}/waf
+}
+
+FILES_${PN} += "${datadir}/icons"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/pulseaudio/pavucontrol/0001-build-sys-Use-C-11-for-building.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/pulseaudio/pavucontrol/0001-build-sys-Use-C-11-for-building.patch
new file mode 100644
index 0000000..b59569f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/pulseaudio/pavucontrol/0001-build-sys-Use-C-11-for-building.patch
@@ -0,0 +1,27 @@
+From 1f92aa5c8d910519e3a74b2e3a9199aa9026a16c Mon Sep 17 00:00:00 2001
+From: Arun Raghavan <git@arunraghavan.net>
+Date: Mon, 25 Jan 2016 08:41:42 +0530
+Subject: [PATCH 1/2] build-sys: Use C++11 for building
+
+This requirement was added by gtkmm at some point:
+
+http://www.murrayc.com/permalink/2015/07/31/gtkmm-now-uses-c11/
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index 5b50e2d..8f28782 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -39,6 +39,7 @@ AC_PROG_CC
+ AC_PROG_LN_S
+ AC_TYPE_SIGNAL
+ AC_HEADER_STDC
++AX_CXX_COMPILE_STDCXX_11
+ 
+ AC_ARG_ENABLE(gtk3,
+    [AS_HELP_STRING([--disable-gtk3],
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/pulseaudio/pavucontrol/0002-build-sys-Add-m4-file-for-AX_CXX_COMPILE_STDCXX_11.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/pulseaudio/pavucontrol/0002-build-sys-Add-m4-file-for-AX_CXX_COMPILE_STDCXX_11.patch
new file mode 100644
index 0000000..97ec37d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/pulseaudio/pavucontrol/0002-build-sys-Add-m4-file-for-AX_CXX_COMPILE_STDCXX_11.patch
@@ -0,0 +1,624 @@
+From ccb3eb7b4ff65414a56e2294080885b8966da52b Mon Sep 17 00:00:00 2001
+From: Arun Raghavan <git@arunraghavan.net>
+Date: Tue, 2 Feb 2016 17:01:47 +0530
+Subject: [PATCH 2/2] build-sys: Add m4 file for AX_CXX_COMPILE_STDCXX_11
+
+---
+ m4/ax_cxx_compile_stdcxx.m4    | 558 +++++++++++++++++++++++++++++++++++++++++
+ m4/ax_cxx_compile_stdcxx_11.m4 |  39 +++
+ 2 files changed, 597 insertions(+)
+ create mode 100644 m4/ax_cxx_compile_stdcxx.m4
+ create mode 100644 m4/ax_cxx_compile_stdcxx_11.m4
+
+diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4
+new file mode 100644
+index 0000000..079e17d
+--- /dev/null
++++ b/m4/ax_cxx_compile_stdcxx.m4
+@@ -0,0 +1,558 @@
++# ===========================================================================
++#   http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++#   AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
++#
++# DESCRIPTION
++#
++#   Check for baseline language coverage in the compiler for the specified
++#   version of the C++ standard.  If necessary, add switches to CXXFLAGS to
++#   enable support.  VERSION may be '11' (for the C++11 standard) or '14'
++#   (for the C++14 standard).
++#
++#   The second argument, if specified, indicates whether you insist on an
++#   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
++#   -std=c++11).  If neither is specified, you get whatever works, with
++#   preference for an extended mode.
++#
++#   The third argument, if specified 'mandatory' or if left unspecified,
++#   indicates that baseline support for the specified C++ standard is
++#   required and that the macro should error out if no mode with that
++#   support is found.  If specified 'optional', then configuration proceeds
++#   regardless, after defining HAVE_CXX${VERSION} if and only if a
++#   supporting mode is found.
++#
++# LICENSE
++#
++#   Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
++#   Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
++#   Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
++#   Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
++#   Copyright (c) 2015 Paul Norman <penorman@mac.com>
++#   Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
++#
++#   Copying and distribution of this file, with or without modification, are
++#   permitted in any medium without royalty provided the copyright notice
++#   and this notice are preserved.  This file is offered as-is, without any
++#   warranty.
++
++#serial 1
++
++dnl  This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
++dnl  (serial version number 13).
++
++AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
++  m4_if([$1], [11], [],
++        [$1], [14], [],
++        [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])],
++        [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
++  m4_if([$2], [], [],
++        [$2], [ext], [],
++        [$2], [noext], [],
++        [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
++  m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
++        [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
++        [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
++        [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
++  AC_LANG_PUSH([C++])dnl
++  ac_success=no
++  AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
++  ax_cv_cxx_compile_cxx$1,
++  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
++    [ax_cv_cxx_compile_cxx$1=yes],
++    [ax_cv_cxx_compile_cxx$1=no])])
++  if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
++    ac_success=yes
++  fi
++
++  m4_if([$2], [noext], [], [dnl
++  if test x$ac_success = xno; then
++    for switch in -std=gnu++$1 -std=gnu++0x; do
++      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
++      AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
++                     $cachevar,
++        [ac_save_CXXFLAGS="$CXXFLAGS"
++         CXXFLAGS="$CXXFLAGS $switch"
++         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
++          [eval $cachevar=yes],
++          [eval $cachevar=no])
++         CXXFLAGS="$ac_save_CXXFLAGS"])
++      if eval test x\$$cachevar = xyes; then
++        CXXFLAGS="$CXXFLAGS $switch"
++        ac_success=yes
++        break
++      fi
++    done
++  fi])
++
++  m4_if([$2], [ext], [], [dnl
++  if test x$ac_success = xno; then
++    dnl HP's aCC needs +std=c++11 according to:
++    dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
++    dnl Cray's crayCC needs "-h std=c++11"
++    for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do
++      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
++      AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
++                     $cachevar,
++        [ac_save_CXXFLAGS="$CXXFLAGS"
++         CXXFLAGS="$CXXFLAGS $switch"
++         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
++          [eval $cachevar=yes],
++          [eval $cachevar=no])
++         CXXFLAGS="$ac_save_CXXFLAGS"])
++      if eval test x\$$cachevar = xyes; then
++        CXXFLAGS="$CXXFLAGS $switch"
++        ac_success=yes
++        break
++      fi
++    done
++  fi])
++  AC_LANG_POP([C++])
++  if test x$ax_cxx_compile_cxx$1_required = xtrue; then
++    if test x$ac_success = xno; then
++      AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
++    fi
++  else
++    if test x$ac_success = xno; then
++      HAVE_CXX$1=0
++      AC_MSG_NOTICE([No compiler with C++$1 support was found])
++    else
++      HAVE_CXX$1=1
++      AC_DEFINE(HAVE_CXX$1,1,
++                [define if the compiler supports basic C++$1 syntax])
++    fi
++
++    AC_SUBST(HAVE_CXX$1)
++  fi
++])
++
++
++dnl  Test body for checking C++11 support
++
++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
++  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
++)
++
++
++dnl  Test body for checking C++14 support
++
++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
++  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
++  _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
++)
++
++
++dnl  Tests for new features in C++11
++
++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
++
++// If the compiler admits that it is not ready for C++11, why torture it?
++// Hopefully, this will speed up the test.
++
++#ifndef __cplusplus
++
++#error "This is not a C++ compiler"
++
++#elif __cplusplus < 201103L
++
++#error "This is not a C++11 compiler"
++
++#else
++
++namespace cxx11
++{
++
++  namespace test_static_assert
++  {
++
++    template <typename T>
++    struct check
++    {
++      static_assert(sizeof(int) <= sizeof(T), "not big enough");
++    };
++
++  }
++
++  namespace test_final_override
++  {
++
++    struct Base
++    {
++      virtual void f() {}
++    };
++
++    struct Derived : public Base
++    {
++      virtual void f() override {}
++    };
++
++  }
++
++  namespace test_double_right_angle_brackets
++  {
++
++    template < typename T >
++    struct check {};
++
++    typedef check<void> single_type;
++    typedef check<check<void>> double_type;
++    typedef check<check<check<void>>> triple_type;
++    typedef check<check<check<check<void>>>> quadruple_type;
++
++  }
++
++  namespace test_decltype
++  {
++
++    int
++    f()
++    {
++      int a = 1;
++      decltype(a) b = 2;
++      return a + b;
++    }
++
++  }
++
++  namespace test_type_deduction
++  {
++
++    template < typename T1, typename T2 >
++    struct is_same
++    {
++      static const bool value = false;
++    };
++
++    template < typename T >
++    struct is_same<T, T>
++    {
++      static const bool value = true;
++    };
++
++    template < typename T1, typename T2 >
++    auto
++    add(T1 a1, T2 a2) -> decltype(a1 + a2)
++    {
++      return a1 + a2;
++    }
++
++    int
++    test(const int c, volatile int v)
++    {
++      static_assert(is_same<int, decltype(0)>::value == true, "");
++      static_assert(is_same<int, decltype(c)>::value == false, "");
++      static_assert(is_same<int, decltype(v)>::value == false, "");
++      auto ac = c;
++      auto av = v;
++      auto sumi = ac + av + 'x';
++      auto sumf = ac + av + 1.0;
++      static_assert(is_same<int, decltype(ac)>::value == true, "");
++      static_assert(is_same<int, decltype(av)>::value == true, "");
++      static_assert(is_same<int, decltype(sumi)>::value == true, "");
++      static_assert(is_same<int, decltype(sumf)>::value == false, "");
++      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
++      return (sumf > 0.0) ? sumi : add(c, v);
++    }
++
++  }
++
++  namespace test_noexcept
++  {
++
++    int f() { return 0; }
++    int g() noexcept { return 0; }
++
++    static_assert(noexcept(f()) == false, "");
++    static_assert(noexcept(g()) == true, "");
++
++  }
++
++  namespace test_constexpr
++  {
++
++    template < typename CharT >
++    unsigned long constexpr
++    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
++    {
++      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
++    }
++
++    template < typename CharT >
++    unsigned long constexpr
++    strlen_c(const CharT *const s) noexcept
++    {
++      return strlen_c_r(s, 0UL);
++    }
++
++    static_assert(strlen_c("") == 0UL, "");
++    static_assert(strlen_c("1") == 1UL, "");
++    static_assert(strlen_c("example") == 7UL, "");
++    static_assert(strlen_c("another\0example") == 7UL, "");
++
++  }
++
++  namespace test_rvalue_references
++  {
++
++    template < int N >
++    struct answer
++    {
++      static constexpr int value = N;
++    };
++
++    answer<1> f(int&)       { return answer<1>(); }
++    answer<2> f(const int&) { return answer<2>(); }
++    answer<3> f(int&&)      { return answer<3>(); }
++
++    void
++    test()
++    {
++      int i = 0;
++      const int c = 0;
++      static_assert(decltype(f(i))::value == 1, "");
++      static_assert(decltype(f(c))::value == 2, "");
++      static_assert(decltype(f(0))::value == 3, "");
++    }
++
++  }
++
++  namespace test_uniform_initialization
++  {
++
++    struct test
++    {
++      static const int zero {};
++      static const int one {1};
++    };
++
++    static_assert(test::zero == 0, "");
++    static_assert(test::one == 1, "");
++
++  }
++
++  namespace test_lambdas
++  {
++
++    void
++    test1()
++    {
++      auto lambda1 = [](){};
++      auto lambda2 = lambda1;
++      lambda1();
++      lambda2();
++    }
++
++    int
++    test2()
++    {
++      auto a = [](int i, int j){ return i + j; }(1, 2);
++      auto b = []() -> int { return '0'; }();
++      auto c = [=](){ return a + b; }();
++      auto d = [&](){ return c; }();
++      auto e = [a, &b](int x) mutable {
++        const auto identity = [](int y){ return y; };
++        for (auto i = 0; i < a; ++i)
++          a += b--;
++        return x + identity(a + b);
++      }(0);
++      return a + b + c + d + e;
++    }
++
++    int
++    test3()
++    {
++      const auto nullary = [](){ return 0; };
++      const auto unary = [](int x){ return x; };
++      using nullary_t = decltype(nullary);
++      using unary_t = decltype(unary);
++      const auto higher1st = [](nullary_t f){ return f(); };
++      const auto higher2nd = [unary](nullary_t f1){
++        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
++      };
++      return higher1st(nullary) + higher2nd(nullary)(unary);
++    }
++
++  }
++
++  namespace test_variadic_templates
++  {
++
++    template <int...>
++    struct sum;
++
++    template <int N0, int... N1toN>
++    struct sum<N0, N1toN...>
++    {
++      static constexpr auto value = N0 + sum<N1toN...>::value;
++    };
++
++    template <>
++    struct sum<>
++    {
++      static constexpr auto value = 0;
++    };
++
++    static_assert(sum<>::value == 0, "");
++    static_assert(sum<1>::value == 1, "");
++    static_assert(sum<23>::value == 23, "");
++    static_assert(sum<1, 2>::value == 3, "");
++    static_assert(sum<5, 5, 11>::value == 21, "");
++    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
++
++  }
++
++  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
++  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
++  // because of this.
++  namespace test_template_alias_sfinae
++  {
++
++    struct foo {};
++
++    template<typename T>
++    using member = typename T::member_type;
++
++    template<typename T>
++    void func(...) {}
++
++    template<typename T>
++    void func(member<T>*) {}
++
++    void test();
++
++    void test() { func<foo>(0); }
++
++  }
++
++}  // namespace cxx11
++
++#endif  // __cplusplus >= 201103L
++
++]])
++
++
++dnl  Tests for new features in C++14
++
++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
++
++// If the compiler admits that it is not ready for C++14, why torture it?
++// Hopefully, this will speed up the test.
++
++#ifndef __cplusplus
++
++#error "This is not a C++ compiler"
++
++#elif __cplusplus < 201402L
++
++#error "This is not a C++14 compiler"
++
++#else
++
++namespace cxx14
++{
++
++  namespace test_polymorphic_lambdas
++  {
++
++    int
++    test()
++    {
++      const auto lambda = [](auto&&... args){
++        const auto istiny = [](auto x){
++          return (sizeof(x) == 1UL) ? 1 : 0;
++        };
++        const int aretiny[] = { istiny(args)... };
++        return aretiny[0];
++      };
++      return lambda(1, 1L, 1.0f, '1');
++    }
++
++  }
++
++  namespace test_binary_literals
++  {
++
++    constexpr auto ivii = 0b0000000000101010;
++    static_assert(ivii == 42, "wrong value");
++
++  }
++
++  namespace test_generalized_constexpr
++  {
++
++    template < typename CharT >
++    constexpr unsigned long
++    strlen_c(const CharT *const s) noexcept
++    {
++      auto length = 0UL;
++      for (auto p = s; *p; ++p)
++        ++length;
++      return length;
++    }
++
++    static_assert(strlen_c("") == 0UL, "");
++    static_assert(strlen_c("x") == 1UL, "");
++    static_assert(strlen_c("test") == 4UL, "");
++    static_assert(strlen_c("another\0test") == 7UL, "");
++
++  }
++
++  namespace test_lambda_init_capture
++  {
++
++    int
++    test()
++    {
++      auto x = 0;
++      const auto lambda1 = [a = x](int b){ return a + b; };
++      const auto lambda2 = [a = lambda1(x)](){ return a; };
++      return lambda2();
++    }
++
++  }
++
++  namespace test_digit_seperators
++  {
++
++    constexpr auto ten_million = 100'000'000;
++    static_assert(ten_million == 100000000, "");
++
++  }
++
++  namespace test_return_type_deduction
++  {
++
++    auto f(int& x) { return x; }
++    decltype(auto) g(int& x) { return x; }
++
++    template < typename T1, typename T2 >
++    struct is_same
++    {
++      static constexpr auto value = false;
++    };
++
++    template < typename T >
++    struct is_same<T, T>
++    {
++      static constexpr auto value = true;
++    };
++
++    int
++    test()
++    {
++      auto x = 0;
++      static_assert(is_same<int, decltype(f(x))>::value, "");
++      static_assert(is_same<int&, decltype(g(x))>::value, "");
++      return x;
++    }
++
++  }
++
++}  // namespace cxx14
++
++#endif  // __cplusplus >= 201402L
++
++]])
+diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4
+new file mode 100644
+index 0000000..09db383
+--- /dev/null
++++ b/m4/ax_cxx_compile_stdcxx_11.m4
+@@ -0,0 +1,39 @@
++# ============================================================================
++#  http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
++# ============================================================================
++#
++# SYNOPSIS
++#
++#   AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional])
++#
++# DESCRIPTION
++#
++#   Check for baseline language coverage in the compiler for the C++11
++#   standard; if necessary, add switches to CXXFLAGS to enable support.
++#
++#   This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
++#   macro with the version set to C++11.  The two optional arguments are
++#   forwarded literally as the second and third argument respectively.
++#   Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
++#   more information.  If you want to use this macro, you also need to
++#   download the ax_cxx_compile_stdcxx.m4 file.
++#
++# LICENSE
++#
++#   Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
++#   Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
++#   Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
++#   Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
++#   Copyright (c) 2015 Paul Norman <penorman@mac.com>
++#   Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
++#
++#   Copying and distribution of this file, with or without modification, are
++#   permitted in any medium without royalty provided the copyright notice
++#   and this notice are preserved. This file is offered as-is, without any
++#   warranty.
++
++#serial 14
++
++include([ax_cxx_compile_stdcxx.m4])
++
++AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/pulseaudio/pavucontrol_3.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/pulseaudio/pavucontrol_3.0.bb
index 51e24c4..959068d 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/pulseaudio/pavucontrol_3.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/pulseaudio/pavucontrol_3.0.bb
@@ -8,8 +8,13 @@
 
 REQUIRED_DISTRO_FEATURES = "x11"
 
-SRC_URI = "http://freedesktop.org/software/pulseaudio/${BPN}/${BP}.tar.xz"
+SRC_URI = "http://freedesktop.org/software/pulseaudio/${BPN}/${BP}.tar.xz \
+           file://0001-build-sys-Use-C-11-for-building.patch \
+           file://0002-build-sys-Add-m4-file-for-AX_CXX_COMPILE_STDCXX_11.patch \
+          "
 SRC_URI[md5sum] = "176308d2c03f8f3a7b2bd4f4d284fe71"
 SRC_URI[sha256sum] = "b3d2ea5a25fc88dcee80c396014f72df1b4742f8cfbbc5349c39d64a0d338890"
 
 EXTRA_OECONF = " --disable-gtk3 --disable-lynx "
+
+RDEPENDS_${PN} += "pulseaudio-server"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-Revert-media-ctl-Don-t-install-libmediactl-and-libv4.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-Revert-media-ctl-Don-t-install-libmediactl-and-libv4.patch
index 4b3de3c..7413094 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-Revert-media-ctl-Don-t-install-libmediactl-and-libv4.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-Revert-media-ctl-Don-t-install-libmediactl-and-libv4.patch
@@ -1,4 +1,4 @@
-From 4ee15a8a69b84526ece1180a288a37db077bcd9b Mon Sep 17 00:00:00 2001
+From 2d6bfa75b2e16b4d764f1bf00bb902fb4b5e507b Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Fri, 27 Feb 2015 21:55:36 +0000
 Subject: [PATCH] Revert "media-ctl: Don't install libmediactl and
@@ -11,23 +11,27 @@
 Conflicts:
 	utils/media-ctl/Makefile.am
 ---
- utils/media-ctl/Makefile.am | 11 +++--------
- 1 file changed, 3 insertions(+), 8 deletions(-)
+ utils/media-ctl/Makefile.am | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
 
 diff --git a/utils/media-ctl/Makefile.am b/utils/media-ctl/Makefile.am
-index a3931fb..fe1fea5 100644
+index ee7dcc9..d11fa2e 100644
 --- a/utils/media-ctl/Makefile.am
 +++ b/utils/media-ctl/Makefile.am
-@@ -1,14 +1,9 @@
+@@ -1,8 +1,7 @@
 -noinst_LTLIBRARIES = libmediactl.la libv4l2subdev.la
 -
 +lib_LTLIBRARIES = libmediactl.la libv4l2subdev.la
  libmediactl_la_SOURCES = libmediactl.c mediactl-priv.h
 -libmediactl_la_CFLAGS = -static $(LIBUDEV_CFLAGS)
 -libmediactl_la_LDFLAGS = -static $(LIBUDEV_LIBS)
--
 +libmediactl_la_CFLAGS = $(LIBUDEV_CFLAGS)
 +libmediactl_la_LDFLAGS = $(LIBUDEV_LIBS)
+ 
+ media-bus-format-names.h: ../../include/linux/media-bus-format.h
+ 	sed -e '/#define MEDIA_BUS_FMT/ ! d; s/.*FMT_//; /FIXED/ d; s/\t.*//; s/.*/{ \"&\", MEDIA_BUS_FMT_& },/;' \
+@@ -18,9 +17,6 @@ CLEANFILES = $(BUILT_SOURCES)
+ nodist_libv4l2subdev_la_SOURCES = $(BUILT_SOURCES)
  libv4l2subdev_la_SOURCES = libv4l2subdev.c
  libv4l2subdev_la_LIBADD = libmediactl.la
 -libv4l2subdev_la_CFLAGS = -static
@@ -37,5 +41,5 @@
  noinst_HEADERS = mediactl.h v4l2subdev.h
  
 -- 
-2.1.4
+2.9.3
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-buildsystem-do-not-assume-building-in-source-tree.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-buildsystem-do-not-assume-building-in-source-tree.patch
new file mode 100644
index 0000000..54161f9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-buildsystem-do-not-assume-building-in-source-tree.patch
@@ -0,0 +1,110 @@
+From 806822f5acb756d5acda0f9063c84b28b38b3ffb Mon Sep 17 00:00:00 2001
+From: Ismo Puustinen <ismo.puustinen@intel.com>
+Date: Mon, 3 Apr 2017 13:23:38 +0300
+Subject: [PATCH v4l-utils] buildsystem: do not assume building in source tree.
+
+Use $(top_srcdir) as reference for include paths and buildtime scripts.
+Otherwise compilation outside of project root directory will fail
+because header and script paths are wrong.
+
+To reproduce: mkdir b; cd b; ../configure; make
+
+Upstream-status: Accepted [https://git.linuxtv.org//v4l-utils.git/commit/?id=bd98c9a99bffc8d44c54859345e4dfee0ada4275]
+
+Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
+---
+ utils/cec-compliance/Makefile.am  | 2 +-
+ utils/cec-ctl/Makefile.am         | 2 +-
+ utils/cec-follower/Makefile.am    | 4 ++--
+ utils/qv4l2/Makefile.am           | 2 +-
+ utils/v4l2-compliance/Makefile.am | 2 +-
+ utils/v4l2-ctl/Makefile.am        | 2 +-
+ 6 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/utils/cec-compliance/Makefile.am b/utils/cec-compliance/Makefile.am
+index ec5de51..8331aa0 100644
+--- a/utils/cec-compliance/Makefile.am
++++ b/utils/cec-compliance/Makefile.am
+@@ -7,7 +7,7 @@ cec_compliance_LDFLAGS = -lrt
+ cec-compliance.cpp: cec-table.h
+ 
+ cec-table.h: ../cec-ctl/msg2ctl.pl ../../include/linux/cec.h ../../include/linux/cec-funcs.h
+-	../cec-ctl/msg2ctl.pl 2 ../../include/linux/cec.h ../../include/linux/cec-funcs.h >$@
++	$(top_srcdir)/utils/cec-ctl/msg2ctl.pl 2 $(top_srcdir)/include/linux/cec.h $(top_srcdir)/include/linux/cec-funcs.h >$@
+ 
+ cec-compliance.cpp: version.h
+ 
+diff --git a/utils/cec-ctl/Makefile.am b/utils/cec-ctl/Makefile.am
+index 0a7ef22..6afb6c9 100644
+--- a/utils/cec-ctl/Makefile.am
++++ b/utils/cec-ctl/Makefile.am
+@@ -7,7 +7,7 @@ cec_ctl_LDFLAGS = -lrt
+ cec-ctl.cpp: cec-ctl-gen.h
+ 
+ cec-ctl-gen.h: msg2ctl.pl ../../include/linux/cec.h ../../include/linux/cec-funcs.h
+-	./msg2ctl.pl 0 ../../include/linux/cec.h ../../include/linux/cec-funcs.h >$@
++	$(top_srcdir)/utils/cec-ctl/msg2ctl.pl 0 $(top_srcdir)/include/linux/cec.h $(top_srcdir)/include/linux/cec-funcs.h >$@
+ 
+ clean-local:
+ 	-rm -vf cec-ctl-gen.h
+diff --git a/utils/cec-follower/Makefile.am b/utils/cec-follower/Makefile.am
+index 538edb2..fdbf3d9 100644
+--- a/utils/cec-follower/Makefile.am
++++ b/utils/cec-follower/Makefile.am
+@@ -7,12 +7,12 @@ cec_follower_LDFLAGS = -lrt
+ cec-log.cpp: cec-log.h
+ 
+ cec-log.h: ../cec-ctl/msg2ctl.pl ../../include/linux/cec.h ../../include/linux/cec-funcs.h
+-	../cec-ctl/msg2ctl.pl 1 ../../include/linux/cec.h ../../include/linux/cec-funcs.h >$@
++	$(top_srcdir)/utils/cec-ctl/msg2ctl.pl 1 $(top_srcdir)/include/linux/cec.h $(top_srcdir)/include/linux/cec-funcs.h >$@
+ 
+ cec-follower.cpp: cec-table.h version.h
+ 
+ cec-table.h: ../cec-ctl/msg2ctl.pl ../../include/linux/cec.h ../../include/linux/cec-funcs.h
+-	../cec-ctl/msg2ctl.pl 2 ../../include/linux/cec.h ../../include/linux/cec-funcs.h >$@
++	$(top_srcdir)/utils/cec-ctl/msg2ctl.pl 2 $(top_srcdir)/include/linux/cec.h $(top_srcdir)/include/linux/cec-funcs.h >$@
+ 
+ version.h:
+ 	@if git rev-parse HEAD >/dev/null 2>&1; then \
+diff --git a/utils/qv4l2/Makefile.am b/utils/qv4l2/Makefile.am
+index fd58486..ccd1a2a 100644
+--- a/utils/qv4l2/Makefile.am
++++ b/utils/qv4l2/Makefile.am
+@@ -8,7 +8,7 @@ qv4l2_SOURCES = qv4l2.cpp general-tab.cpp ctrl-tab.cpp vbi-tab.cpp capture-win.c
+ nodist_qv4l2_SOURCES = moc_qv4l2.cpp moc_general-tab.cpp moc_capture-win.cpp moc_vbi-tab.cpp qrc_qv4l2.cpp
+ qv4l2_LDADD = ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la \
+   ../libv4l2util/libv4l2util.la ../libmedia_dev/libmedia_dev.la
+-qv4l2_CPPFLAGS = -I../common
++qv4l2_CPPFLAGS = -I$(top_srcdir)/utils/common
+ 
+ if WITH_QTGL
+ qv4l2_CPPFLAGS += $(QTGL_CFLAGS)
+diff --git a/utils/v4l2-compliance/Makefile.am b/utils/v4l2-compliance/Makefile.am
+index 03db8df..18b9892 100644
+--- a/utils/v4l2-compliance/Makefile.am
++++ b/utils/v4l2-compliance/Makefile.am
+@@ -5,7 +5,7 @@ DEFS :=
+ v4l2_compliance_SOURCES = v4l2-compliance.cpp v4l2-test-debug.cpp v4l2-test-input-output.cpp \
+ 	v4l2-test-controls.cpp v4l2-test-io-config.cpp v4l2-test-formats.cpp v4l2-test-buffers.cpp \
+ 	v4l2-test-codecs.cpp v4l2-test-colors.cpp v4l2-compliance.h
+-v4l2_compliance_CPPFLAGS = -I../common
++v4l2_compliance_CPPFLAGS = -I$(top_srcdir)/utils/common
+ 
+ if WITH_V4L2_COMPLIANCE_LIBV4L
+ v4l2_compliance_LDADD = ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la -lrt -lpthread
+diff --git a/utils/v4l2-ctl/Makefile.am b/utils/v4l2-ctl/Makefile.am
+index 955647d..825e53f 100644
+--- a/utils/v4l2-ctl/Makefile.am
++++ b/utils/v4l2-ctl/Makefile.am
+@@ -7,7 +7,7 @@ v4l2_ctl_SOURCES = v4l2-ctl.cpp v4l2-ctl.h v4l2-ctl-common.cpp v4l2-ctl-tuner.cp
+ 	v4l2-ctl-overlay.cpp v4l2-ctl-vbi.cpp v4l2-ctl-selection.cpp v4l2-ctl-misc.cpp \
+ 	v4l2-ctl-streaming.cpp v4l2-ctl-sdr.cpp v4l2-ctl-edid.cpp v4l2-ctl-modes.cpp \
+ 	v4l2-tpg-colors.c v4l2-tpg-core.c v4l-stream.c
+-v4l2_ctl_CPPFLAGS = -I../common
++v4l2_ctl_CPPFLAGS = -I$(top_srcdir)/utils/common
+ 
+ if WITH_V4L2_CTL_LIBV4L
+ v4l2_ctl_LDADD = ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la -lrt -lpthread
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-ir-ctl-Define-TEMP_FAILURE_RETRY-if-undefined.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-ir-ctl-Define-TEMP_FAILURE_RETRY-if-undefined.patch
new file mode 100644
index 0000000..f1e11da
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-ir-ctl-Define-TEMP_FAILURE_RETRY-if-undefined.patch
@@ -0,0 +1,55 @@
+From e60aea50e41ae8a17672beb5859beecb66e7a305 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 13:11:25 -0700
+Subject: [PATCH 1/3] ir-ctl: Define TEMP_FAILURE_RETRY if undefined
+
+use strndup() instead of strndupa() which is not
+universally available in C libraries
+
+Taken from AlpineLinux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/ir-ctl/ir-ctl.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
+index bc58cee..1a44011 100644
+--- a/utils/ir-ctl/ir-ctl.c
++++ b/utils/ir-ctl/ir-ctl.c
+@@ -42,6 +42,16 @@
+ # define _(string) string
+ #endif
+ 
++/* taken from glibc unistd.h */
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++  (__extension__                                                              \
++    ({ long int __result;                                                     \
++       do __result = (long int) (expression);                                 \
++       while (__result == -1L && errno == EINTR);                             \
++       __result; }))
++#endif
++
+ # define N_(string) string
+ 
+ 
+@@ -344,12 +354,14 @@ static struct file *read_scancode(const char *name)
+ 		return NULL;
+ 	}
+ 
+-	pstr = strndupa(name, p - name);
++	pstr = strndup(name, p - name);
+ 
+ 	if (!protocol_match(pstr, &proto)) {
+ 		fprintf(stderr, _("error: protocol '%s' not found\n"), pstr);
++		free(pstr);
+ 		return NULL;
+ 	}
++	free(pstr);
+ 
+ 	if (!strtoscancode(p + 1, &scancode)) {
+ 		fprintf(stderr, _("error: invalid scancode '%s'\n"), p + 1);
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0002-contrib-test-Link-mc_nextgen_test-with-libargp-if-ne.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0002-contrib-test-Link-mc_nextgen_test-with-libargp-if-ne.patch
new file mode 100644
index 0000000..2fb4057
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0002-contrib-test-Link-mc_nextgen_test-with-libargp-if-ne.patch
@@ -0,0 +1,28 @@
+From b3acc4c6407f9553f32582a9aee6a11b5fcd1d8a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 13:17:19 -0700
+Subject: [PATCH 2/3] contrib/test: Link mc_nextgen_test with libargp if needed
+
+musl depends on external argp implementation e.g.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ contrib/test/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/contrib/test/Makefile.am b/contrib/test/Makefile.am
+index 4641e21..e47b948 100644
+--- a/contrib/test/Makefile.am
++++ b/contrib/test/Makefile.am
+@@ -32,7 +32,7 @@ v4l2gl_LDFLAGS = $(X11_LIBS) $(GL_LIBS) $(GLU_LIBS) $(ARGP_LIBS)
+ v4l2gl_LDADD = ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la
+ 
+ mc_nextgen_test_CFLAGS = $(LIBUDEV_CFLAGS)
+-mc_nextgen_test_LDFLAGS = $(LIBUDEV_LIBS)
++mc_nextgen_test_LDFLAGS = $(ARGP_LIBS) $(LIBUDEV_LIBS)
+ 
+ 
+ ioctl_test_SOURCES = ioctl-test.c ioctl-test.h ioctl_32.h ioctl_64.h
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-v4l2-ctl-Do-not-use-getsubopt.patch b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-v4l2-ctl-Do-not-use-getsubopt.patch
new file mode 100644
index 0000000..0a986ae
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0003-v4l2-ctl-Do-not-use-getsubopt.patch
@@ -0,0 +1,49 @@
+From d04aa6866cbea57c4a81b033cd60586a9436ac6b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 13:20:05 -0700
+Subject: [PATCH 3/3] v4l2-ctl: Do not use getsubopt
+
+POSIX says that behavior when subopts list is empty is undefined.
+musl libs will set value to NULL which leads to crash.
+
+Taken from AlpineLinux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/v4l2-ctl/v4l2-ctl-common.cpp | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
+index 3ea6cd3..291fb3e 100644
+--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
++++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
+@@ -692,16 +692,17 @@ static bool parse_subset(char *optarg)
+ 
+ static bool parse_next_subopt(char **subs, char **value)
+ {
+-	static char *const subopts[] = {
+-	    NULL
+-	};
+-	int opt = getsubopt(subs, subopts, value);
++	char *p = *subs;
++	*value = *subs;
+ 
+-	if (opt < 0 || *value)
+-		return false;
+-	fprintf(stderr, "No value given to suboption <%s>\n",
+-			subopts[opt]);
+-	return true;
++	while (*p && *p != ',')
++		p++;
++
++	if (*p)
++		*p++ = '\0';
++
++	*subs = p;
++	return false;
+ }
+ 
+ void common_cmd(int ch, char *optarg)
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.10.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.10.1.bb
deleted file mode 100644
index b9732fe..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.10.1.bb
+++ /dev/null
@@ -1,48 +0,0 @@
-SUMMARY = "v4l2 and IR applications"
-LICENSE = "GPLv2 & LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=48da9957849056017dc568bbc43d8975 \
-                    file://COPYING.libv4l;md5=d749e86a105281d7a44c2328acebc4b0"
-PROVIDES = "libv4l media-ctl"
-
-DEPENDS = "jpeg \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11', '', d)}"
-
-inherit autotools gettext pkgconfig
-
-PACKAGECONFIG ??= "media-ctl"
-PACKAGECONFIG[media-ctl] = "--enable-v4l-utils,--disable-v4l-utils,,"
-
-SRC_URI = "http://linuxtv.org/downloads/v4l-utils/v4l-utils-${PV}.tar.bz2 \
-           file://0001-Revert-media-ctl-Don-t-install-libmediactl-and-libv4.patch \
-           file://mediactl-pkgconfig.patch \
-           file://export-mediactl-headers.patch \
-          "
-SRC_URI[md5sum] = "936c9c58343840e91294e4dcec7dc05f"
-SRC_URI[sha256sum] = "6147ccc29fe7dd3c5c3994d613c4f2a099bac8b44694a96e5cf4d7caca8336c0"
-
-EXTRA_OECONF = "--disable-qv4l2 --enable-shared --with-udevdir=${base_libdir}/udev"
-
-VIRTUAL-RUNTIME_ir-keytable-keymaps ?= "rc-keymaps"
-
-PACKAGES =+ "media-ctl ir-keytable rc-keymaps libv4l libv4l-dbg libv4l-dev"
-
-FILES_media-ctl = "${bindir}/media-ctl ${libdir}/libmediactl.so.*"
-
-FILES_ir-keytable = "${bindir}/ir-keytable ${base_libdir}/udev/rules.d/*-infrared.rules"
-RDEPENDS_ir-keytable += "${VIRTUAL-RUNTIME_ir-keytable-keymaps}"
-
-FILES_rc-keymaps = "${sysconfdir}/rc* ${base_libdir}/udev/rc*"
-
-FILES_${PN} = "${bindir} ${sbindir}"
-
-FILES_libv4l += "${libdir}/libv4l*${SOLIBS} ${libdir}/libv4l/*.so ${libdir}/libv4l/plugins/*.so \
-                 ${libdir}/libdvbv5*${SOLIBS} \
-                 ${libdir}/libv4l/*-decomp"
-
-FILES_libv4l-dbg += "${libdir}/libv4l/.debug ${libdir}/libv4l/plugins/.debug"
-FILES_libv4l-dev += "${includedir} ${libdir}/pkgconfig \
-                     ${libdir}/libv4l*${SOLIBSDEV} ${libdir}/*.la \
-                     ${libdir}/v4l*${SOLIBSDEV} ${libdir}/libv4l/*.la ${libdir}/libv4l/plugins/*.la"
-
-PARALLEL_MAKE_class-native = ""
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.12.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.12.3.bb
new file mode 100644
index 0000000..b408bb0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.12.3.bb
@@ -0,0 +1,53 @@
+SUMMARY = "v4l2 and IR applications"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=48da9957849056017dc568bbc43d8975 \
+                    file://COPYING.libv4l;md5=d749e86a105281d7a44c2328acebc4b0"
+PROVIDES = "libv4l media-ctl"
+
+DEPENDS = "jpeg \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11', '', d)}"
+DEPENDS_append_libc-musl = " argp-standalone"
+
+inherit autotools gettext pkgconfig
+
+PACKAGECONFIG ??= "media-ctl"
+PACKAGECONFIG[media-ctl] = "--enable-v4l-utils,--disable-v4l-utils,,"
+
+SRC_URI = "http://linuxtv.org/downloads/v4l-utils/v4l-utils-${PV}.tar.bz2 \
+           file://0001-Revert-media-ctl-Don-t-install-libmediactl-and-libv4.patch \
+           file://0001-buildsystem-do-not-assume-building-in-source-tree.patch \
+           file://mediactl-pkgconfig.patch \
+           file://export-mediactl-headers.patch \
+           file://0001-ir-ctl-Define-TEMP_FAILURE_RETRY-if-undefined.patch \
+           file://0002-contrib-test-Link-mc_nextgen_test-with-libargp-if-ne.patch \
+           file://0003-v4l2-ctl-Do-not-use-getsubopt.patch \
+           "
+SRC_URI[md5sum] = "89e1ed6c69c94e0489dc0a638c7841aa"
+SRC_URI[sha256sum] = "5a47dd6f0e7dfe902d94605c01d385a4a4e87583ff5856d6f181900ea81cf46e"
+
+EXTRA_OECONF = "--disable-qv4l2 --enable-shared --with-udevdir=${base_libdir}/udev"
+
+VIRTUAL-RUNTIME_ir-keytable-keymaps ?= "rc-keymaps"
+
+PACKAGES =+ "media-ctl ir-keytable rc-keymaps libv4l libv4l-dbg libv4l-dev"
+
+FILES_media-ctl = "${bindir}/media-ctl ${libdir}/libmediactl.so.*"
+
+FILES_ir-keytable = "${bindir}/ir-keytable ${base_libdir}/udev/rules.d/*-infrared.rules"
+RDEPENDS_ir-keytable += "${VIRTUAL-RUNTIME_ir-keytable-keymaps}"
+
+FILES_rc-keymaps = "${sysconfdir}/rc* ${base_libdir}/udev/rc*"
+
+FILES_${PN} = "${bindir} ${sbindir}"
+
+FILES_libv4l += "${libdir}/libv4l*${SOLIBS} ${libdir}/libv4l/*.so ${libdir}/libv4l/plugins/*.so \
+                 ${libdir}/libdvbv5*${SOLIBS} \
+                 ${libdir}/libv4l/*-decomp"
+
+FILES_libv4l-dbg += "${libdir}/libv4l/.debug ${libdir}/libv4l/plugins/.debug"
+FILES_libv4l-dev += "${includedir} ${libdir}/pkgconfig \
+                     ${libdir}/libv4l*${SOLIBSDEV} ${libdir}/*.la \
+                     ${libdir}/v4l*${SOLIBSDEV} ${libdir}/libv4l/*.la ${libdir}/libv4l/plugins/*.la"
+
+PARALLEL_MAKE_class-native = ""
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-navigation/gdal/gdal_1.11.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-navigation/gdal/gdal_1.11.1.bb
index 012806a..4e821be 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-navigation/gdal/gdal_1.11.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-navigation/gdal/gdal_1.11.1.bb
@@ -111,4 +111,4 @@
 # | gdalserver.c:124:21: error: storage size of 'sHints' isn't known
 # |      struct addrinfo sHints;
 # |                      ^
-PNBLACKLIST[gdal] ?= "BROKEN: fails to build with gcc-5"
+PNBLACKLIST[gdal] ?= "BROKEN: fails to build with gcc-5 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-navigation/geoclue/geoclue_2.4.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-navigation/geoclue/geoclue_2.4.4.bb
index 3170d44..1d531ae 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-navigation/geoclue/geoclue_2.4.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-navigation/geoclue/geoclue_2.4.4.bb
@@ -8,7 +8,7 @@
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=8114b83a0435d8136b47bd70111ce5cd"
 
-DEPENDS = "glib-2.0 dbus json-glib libsoup-2.4 intltool-native"
+DEPENDS = "glib-2.0 dbus json-glib libsoup-2.4 intltool-native gobject-introspection-native"
 
 inherit autotools pkgconfig gtk-doc
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-navigation/gpsd/gpsd_3.14.bb b/import-layers/meta-openembedded/meta-oe/recipes-navigation/gpsd/gpsd_3.14.bb
index 4d00fea..fb02f95 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-navigation/gpsd/gpsd_3.14.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-navigation/gpsd/gpsd_3.14.bb
@@ -36,6 +36,8 @@
 export STAGING_INCDIR
 export STAGING_LIBDIR
 
+LDFLAGS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
+
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)}"
 PACKAGECONFIG[bluez] = "bluez='true',bluez='false',${BLUEZ}"
 PACKAGECONFIG[qt] = "qt='yes',qt='no',qt4-x11-free"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-navigation/navit/navit-fpu.inc b/import-layers/meta-openembedded/meta-oe/recipes-navigation/navit/navit-fpu.inc
index d963702..54b7a97 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-navigation/navit/navit-fpu.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-navigation/navit/navit-fpu.inc
@@ -1,6 +1,6 @@
 
 def get_navit_fpu_setting(bb, d):
-    if d.getVar('TARGET_FPU', 1) in [ 'soft' ]:
+    if d.getVar('TARGET_FPU') in [ 'soft' ]:
         return "--enable-avoid-float"
     return ""
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-navigation/orrery/orrery/0001-orrery-Fix-sprintf-format.patch b/import-layers/meta-openembedded/meta-oe/recipes-navigation/orrery/orrery/0001-orrery-Fix-sprintf-format.patch
new file mode 100644
index 0000000..eb6241f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-navigation/orrery/orrery/0001-orrery-Fix-sprintf-format.patch
@@ -0,0 +1,26 @@
+From e600d3c09d2f97a197f86e6987d44d142e7b7cdf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 21:12:17 -0700
+Subject: [PATCH] orrery: Fix sprintf format
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ orrery.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/orrery.c b/orrery.c
+index e3a1f6d..1b31a9f 100644
+--- a/orrery.c
++++ b/orrery.c
+@@ -3767,7 +3767,7 @@ static void drawOptsScreens(void)
+ 		      displayWidth/2 - gdk_string_width(smallFont, scratchString)/2,
+ 		      12, scratchString);
+       for (day = 0; day < 7; day++) {
+-	sprintf(scratchString, dayName[day]);
++	sprintf(scratchString, "%s", dayName[day]);
+ 	gdk_draw_string(pixmap, smallFont, blueGC,
+ 			CAL_DAY_WIDTH/2 + day*CAL_DAY_WIDTH + CAL_LEFT_OFFSET -
+ 			gdk_string_width(smallFont, scratchString)/2,
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-navigation/orrery/orrery_2.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-navigation/orrery/orrery_2.7.bb
index 40a6df3..1a00b08 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-navigation/orrery/orrery_2.7.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-navigation/orrery/orrery_2.7.bb
@@ -10,7 +10,8 @@
 SRC_URI = "http://projects.openmoko.org/frs/download.php/923/orrery_2.7_clean.tar.gz \
            file://orrery.png \
            file://use.GdkPixbuf.patch \
-"
+           file://0001-orrery-Fix-sprintf-format.patch \
+           "
 
 SRC_URI[md5sum]    = "bd62a33e7554ee1030313dfcdefcda8b"
 SRC_URI[sha256sum] = "645166a5e05b2064ab630534a514697fc47b681951e7fe1d635c259cbdf7a5e6"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-mail_3.9.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-mail_3.9.0.bb
index 938af2e..534ba3b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-mail_3.9.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-mail_3.9.0.bb
@@ -4,7 +4,7 @@
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=e059bde2972c1790af786f3e86bac22e"
 
-PNBLACKLIST[claws-mail] ?= "depends on blacklisted libetpan"
+PNBLACKLIST[claws-mail] ?= "depends on blacklisted libetpan - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 inherit autotools pkgconfig gettext
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-gtkhtml2-viewer_0.31.bb b/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-gtkhtml2-viewer_0.31.bb
index c252573..29b41be 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-gtkhtml2-viewer_0.31.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-gtkhtml2-viewer_0.31.bb
@@ -4,7 +4,7 @@
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=977f04a8048c04684e521c06e2844a94"
 
-PNBLACKLIST[claws-plugin-gtkhtml2-viewer] ?= "depends on blacklisted claws-mail"
+PNBLACKLIST[claws-plugin-gtkhtml2-viewer] ?= "depends on blacklisted claws-mail - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 PR = "r1"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-mailmbox_1.15.bb b/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-mailmbox_1.15.bb
index b132177..986b5d4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-mailmbox_1.15.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-mailmbox_1.15.bb
@@ -4,7 +4,7 @@
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
-PNBLACKLIST[claws-plugin-mailmbox] ?= "depends on blacklisted claws-mail"
+PNBLACKLIST[claws-plugin-mailmbox] ?= "depends on blacklisted claws-mail - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "http://www.claws-mail.org/downloads/plugins_obsolete/mailmbox-${PV}.tar.gz"
 SRC_URI[md5sum] = "7f72c68e6e1a8768f1247f455fd20b62"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-rssyl_0.34.bb b/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-rssyl_0.34.bb
index 7da460c..eec9a2d 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-rssyl_0.34.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/claws-plugin-rssyl_0.34.bb
@@ -4,7 +4,7 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=0c2348e0a084e573f0220f5e45d8097e"
 
-PNBLACKLIST[claws-plugin-rssyl] ?= "depends on blacklisted claws-mail"
+PNBLACKLIST[claws-plugin-rssyl] ?= "depends on blacklisted claws-mail - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "http://www.claws-mail.org/downloads/plugins_obsolete/rssyl-${PV}.tar.gz \
            file://configure.patch"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/sylpheed_2.7.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/sylpheed_2.7.1.bb
index 304b654..978d777 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/sylpheed_2.7.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-sato/claws-mail/sylpheed_2.7.1.bb
@@ -29,3 +29,5 @@
 
 inherit autotools pkgconfig
 
+
+PNBLACKLIST[sylpheed] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130651/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/apcupsd/apcupsd_3.14.10.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/apcupsd/apcupsd_3.14.10.bb
index 3ef1792..c8c54a4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/apcupsd/apcupsd_3.14.10.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/apcupsd/apcupsd_3.14.10.bb
@@ -7,7 +7,7 @@
 SRC_URI[md5sum] = "5928822d855c5cf7ac29655e3e0b8c23"
 SRC_URI[sha256sum] = "0707b5ec9916fbde9e44eb8d18037c8d8f75dfd6aeef51aba5487e189eef2032"
 
-PNBLACKLIST[apcupsd] ?= "BROKEN: doesn't build with B!=S"
+PNBLACKLIST[apcupsd] ?= "BROKEN: doesn't build with B!=S - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 inherit autotools
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop/0001-include-missing-header-files.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop/0001-include-missing-header-files.patch
new file mode 100644
index 0000000..3708f60
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop/0001-include-missing-header-files.patch
@@ -0,0 +1,97 @@
+From 7b651793269b6b86f12c43c30b751b86def27222 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 18 Mar 2017 17:56:40 -0700
+Subject: [PATCH] include missing header files
+
+fixes build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ deviate.c     | 1 +
+ procdbase.c   | 2 +-
+ showgeneric.c | 2 +-
+ showlinux.c   | 2 +-
+ showprocs.c   | 2 +-
+ showsys.c     | 2 +-
+ 6 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/deviate.c b/deviate.c
+index 7cf1b49..8e615af 100644
+--- a/deviate.c
++++ b/deviate.c
+@@ -178,6 +178,7 @@ static const char rcsid[] = "$Id: deviate.c,v 1.45 2010/10/23 14:02:03 gerlof Ex
+ #include <stdio.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#include <stdlib.h>
+ #include <unistd.h>
+ #include <limits.h>
+ #include <memory.h>
+diff --git a/procdbase.c b/procdbase.c
+index 9cab347..0487d26 100644
+--- a/procdbase.c
++++ b/procdbase.c
+@@ -67,7 +67,7 @@ static const char rcsid[] = "$Id: procdbase.c,v 1.8 2010/04/23 12:19:35 gerlof E
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <string.h>
+-#include <malloc.h>
++#include <stdlib.h>
+ 
+ #include "atop.h"
+ #include "photoproc.h"
+diff --git a/showgeneric.c b/showgeneric.c
+index 775afa8..3d5be0e 100644
+--- a/showgeneric.c
++++ b/showgeneric.c
+@@ -268,7 +268,7 @@ static const char rcsid[] = "$Id: showgeneric.c,v 1.71 2010/10/25 19:08:32 gerlo
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <string.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <curses.h>
+diff --git a/showlinux.c b/showlinux.c
+index 6e60754..aba2ee6 100644
+--- a/showlinux.c
++++ b/showlinux.c
+@@ -274,7 +274,7 @@ static const char rcsid[] = "$Id: showlinux.c,v 1.70 2010/10/23 14:04:12 gerlof
+ #include <string.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <curses.h>
+diff --git a/showprocs.c b/showprocs.c
+index 5194524..f0169ad 100644
+--- a/showprocs.c
++++ b/showprocs.c
+@@ -94,7 +94,7 @@ static const char rcsid[] = "$Id: showprocs.c,v 1.15 2011/09/05 11:44:16 gerlof
+ #include <string.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <curses.h>
+diff --git a/showsys.c b/showsys.c
+index 26331be..5a05fe5 100644
+--- a/showsys.c
++++ b/showsys.c
+@@ -80,7 +80,7 @@ static const char rcsid[] = "XXXXXX";
+ #include <string.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <curses.h>
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop_2.2.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop_2.2.3.bb
index 21311e3..1ab9e7c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop_2.2.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/atop/atop_2.2.3.bb
@@ -15,11 +15,12 @@
 
 DEPENDS = "ncurses zlib"
 
-ATOP_VER = "${@'-'.join(d.getVar('PV', True).rsplit('.', 1))}"
+ATOP_VER = "${@'-'.join(d.getVar('PV').rsplit('.', 1))}"
 
 SRC_URI = " \
     http://www.atoptool.nl/download/${BPN}-${ATOP_VER}.tar.gz \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'file://volatiles.atop.conf', 'file://volatiles.99_atop', d)} \
+    file://0001-include-missing-header-files.patch \
     file://remove-bashisms.patch \
     file://fix-permissions.patch \
     file://sysvinit-implement-status.patch \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c/0001-avro-c-Fix-build-with-clang-compiler.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c/0001-avro-c-Fix-build-with-clang-compiler.patch
new file mode 100644
index 0000000..01235d8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c/0001-avro-c-Fix-build-with-clang-compiler.patch
@@ -0,0 +1,37 @@
+From 518bb8ccfb3f3fc143fbd571782f3e40573d01b5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 10 Apr 2017 09:15:04 -0700
+Subject: [PATCH] avro-c: Fix build with clang compiler
+
+Clang advertizes itself to be compatible with gcc 4.2.1
+while that was true several years ago, it now supports
+a lot more newer features, the test to just check gcc
+version should be supplanted with clang check as well
+so atomic support in clang can be asserted as well
+
+Fixes
+
+lang/c/src/avro/refcount.h:301:2: error: "No atomic implementation!"
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lang/c/src/avro/refcount.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lang/c/src/avro/refcount.h b/lang/c/src/avro/refcount.h
+index 69afa4fc..d76ba057 100644
+--- a/lang/c/src/avro/refcount.h
++++ b/lang/c/src/avro/refcount.h
+@@ -118,7 +118,8 @@ avro_refcount_dec(volatile int *refcount)
+  * GCC intrinsics
+  */
+ 
+-#elif (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40500
++#elif (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40500 \
++|| defined(__clang__)
+ 
+ static inline void
+ avro_refcount_set(volatile int *refcount, int value)
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c_1.8.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c_1.8.1.bb
new file mode 100644
index 0000000..276fe2b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/avro/avro-c_1.8.1.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Apache Avro data serialization system."
+HOMEPAGE = "http://apr.apache.org/"
+SECTION = "libs"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=73bdf70f268f0b3b9c5a83dd7a6f3324"
+
+DEPENDS = "jansson zlib xz"
+PV .= "+git${SRCPV}"
+
+SRCREV = "4b3677c32b879e0e7f717eb95f9135ac654da760"
+SRC_URI = "git://github.com/apache/avro \
+           file://0001-avro-c-Fix-build-with-clang-compiler.patch;patchdir=../../ \
+"
+
+S = "${WORKDIR}/git/lang/c"
+
+LDFLAGS_append_libc-uclibc = " -lm"
+
+inherit cmake
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/frame_2.5.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/frame_2.5.0.bb
index 0ad10a4..da1a2a3 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/frame_2.5.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/frame_2.5.0.bb
@@ -15,8 +15,10 @@
 SRC_URI[md5sum] = "02baa941091c5d198cd1623b3ad36e68"
 SRC_URI[sha256sum] = "cfb9ab52cdccd926f1822a457264d0014c7eb9f4600a72626063dd073b26256f"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[x11] = "--enable-x11, --disable-x11, libxi xext virtual/xserver"
 
 PACKAGE_BEFORE_PN += "${PN}-test"
 FILES_${PN}-test = "${bindir}/frame-test*"
+
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis/0001-libgeis-Compare-the-first-character-of-string-to-nul.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis/0001-libgeis-Compare-the-first-character-of-string-to-nul.patch
new file mode 100644
index 0000000..3b3acab
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis/0001-libgeis-Compare-the-first-character-of-string-to-nul.patch
@@ -0,0 +1,43 @@
+From 1e48821ba109b00e9c2931f12aa206c4ef54fd71 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 24 Apr 2017 12:34:55 -0700
+Subject: [PATCH] libgeis: Compare the first character of string to null
+
+gcc7 wants to be specific when it comes to comparing characters
+and strings
+
+fixes
+
+| ../../../../../../../workspace/sources/geis/libgeis/geis_v1.c: In function '_v1_subscribe_device':
+| ../../../../../../../workspace/sources/geis/libgeis/geis_v1.c:613:20: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libgeis/geis_v1.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgeis/geis_v1.c b/libgeis/geis_v1.c
+index 67045ee..07c0851 100644
+--- a/libgeis/geis_v1.c
++++ b/libgeis/geis_v1.c
+@@ -610,7 +610,7 @@ _v1_subscribe_device(GeisInstance instance,
+                      const char **gesture_list)
+ {
+   GeisStatus result = GEIS_UNKNOWN_ERROR;
+-  if (gesture_list == GEIS_ALL_GESTURES)
++  if (gesture_list[0][0] == GEIS_ALL_GESTURES)
+   {
+     geis_debug("subscribing device %d for all gestures", device_id);
+   }
+@@ -757,7 +757,7 @@ geis_unsubscribe(GeisInstance     instance,
+                  GeisGestureType *gesture_list)
+ {
+   GeisStatus status = GEIS_STATUS_NOT_SUPPORTED;
+-  if (gesture_list == GEIS_ALL_GESTURES)
++  if (gesture_list[0] == GEIS_ALL_GESTURES)
+   {
+     status = geis_subscription_deactivate(instance->subscription);
+   }
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis_2.2.17.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis_2.2.17.bb
index 281dc3d..976aafb 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis_2.2.17.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/geis_2.2.17.bb
@@ -19,9 +19,10 @@
 
 DEPENDS += "grail dbus-glib python3 virtual/libx11 libxext libxi libxcb dbus frame"
 
-SRC_URI = "https://launchpad.net/${BPN}/trunk/${PV}/+download/${BPN}-${PV}.tar.xz\
+SRC_URI = "https://launchpad.net/${BPN}/trunk/${PV}/+download/${BPN}-${PV}.tar.xz \
            file://fix-indentation-for-gcc6.patch \
-"
+           file://0001-libgeis-Compare-the-first-character-of-string-to-nul.patch \
+           "
 SRC_URI[md5sum] = "2ff9d76a3ea5794516bb02c9d1924faf"
 SRC_URI[sha256sum] = "8a60f5683852094038904e690d23cc5a90a980fc52da67f0f28890baa25c70eb"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/grail_3.1.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/grail_3.1.1.bb
index 3026744..22fd0f4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/grail_3.1.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/canonical-multitouch/grail_3.1.1.bb
@@ -11,13 +11,14 @@
 inherit autotools pkgconfig
 
 DEPENDS = "frame"
-
+CXXFLAGS_append_toolchain-clang = " -Wno-pessimizing-move"
 SRC_URI = "https://launchpad.net/${BPN}/trunk/${PV}/+download/${BPN}-${PV}.tar.bz2"
 SRC_URI[md5sum] = "0df1b3ec6167920f310e2effe6e2ad44"
 SRC_URI[sha256sum] = "5eed1f650f042481daa3a2de5e7d43261fe343b2a1b1e240f3b7fc26572c9df3"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[x11] = "--with-x11, --without-x11, libxi"
 
 PACKAGE_BEFORE_PN += "${PN}-test"
 FILES_${PN}-test = "${bindir}/grail-test*"
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ckermit/ckermit_302.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/ckermit/ckermit_302.bb
index 187a57e..61c08ee 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/ckermit/ckermit_302.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ckermit/ckermit_302.bb
@@ -24,6 +24,7 @@
 # trying to look inside the stdio headers.
 CKERMIT_ADDITIONAL = ""
 CKERMIT_ADDITIONAL_libc-uclibc = "-DNOARROWKEYS"
+CKERMIT_ADDITIONAL_libc-musl = "-DNOARROWKEYS"
 
 TARGET_CC_ARCH += "${LDFLAGS}"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.2.bb
deleted file mode 100644
index d160a09..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.2.bb
+++ /dev/null
@@ -1,33 +0,0 @@
-SUMMARY = "Manage plain dm-crypt and LUKS encrypted volumes"
-DESCRIPTION = "Cryptsetup is used to conveniently setup dm-crypt managed \
-device-mapper mappings. These include plain dm-crypt volumes and \
-LUKS volumes. The difference is that LUKS uses a metadata header \
-and can hence offer more features than plain dm-crypt. On the other \
-hand, the header is visible and vulnerable to damage."
-HOMEPAGE = "http://code.google.com/p/cryptsetup/"
-SECTION = "console"
-LICENSE = "GPL-2.0-with-OpenSSL-exception"
-LIC_FILES_CHKSUM = "file://COPYING;md5=32107dd283b1dfeb66c9b3e6be312326"
-
-DEPENDS = "util-linux lvm2 popt libgcrypt"
-
-SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v1.7/${BP}.tar.xz"
-SRC_URI[md5sum] = "a11a140cea496961222170944db01fc1"
-SRC_URI[sha256sum] = "dbb35dbf5f0c1749168c86c913fe98e872247bfc8425314b494c2423e7e43342"
-
-inherit autotools gettext pkgconfig
-
-# Use openssl because libgcrypt drops root privileges
-# if libgcrypt is linked with libcap support
-PACKAGECONFIG ??= "openssl"
-PACKAGECONFIG[openssl] = "--with-crypto_backend=openssl,,openssl"
-PACKAGECONFIG[gcrypt] = "--with-crypto_backend=gcrypt,,libgcrypt"
-
-RRECOMMENDS_${PN} = "kernel-module-aes-generic \
-                     kernel-module-dm-crypt \
-                     kernel-module-md5 \
-                     kernel-module-cbc \
-                     kernel-module-sha256-generic \
-"
-
-EXTRA_OECONF = "--enable-static"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.4.bb
new file mode 100644
index 0000000..c13b764
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/cryptsetup/cryptsetup_1.7.4.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Manage plain dm-crypt and LUKS encrypted volumes"
+DESCRIPTION = "Cryptsetup is used to conveniently setup dm-crypt managed \
+device-mapper mappings. These include plain dm-crypt volumes and \
+LUKS volumes. The difference is that LUKS uses a metadata header \
+and can hence offer more features than plain dm-crypt. On the other \
+hand, the header is visible and vulnerable to damage."
+HOMEPAGE = "http://code.google.com/p/cryptsetup/"
+SECTION = "console"
+LICENSE = "GPL-2.0-with-OpenSSL-exception"
+LIC_FILES_CHKSUM = "file://COPYING;md5=32107dd283b1dfeb66c9b3e6be312326"
+
+DEPENDS = "util-linux libdevmapper popt libgcrypt"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v1.7/${BP}.tar.xz"
+SRC_URI[md5sum] = "058ed35c5b776032c2a036838f9e22a7"
+SRC_URI[sha256sum] = "7ccf893ef79a38fb92d61f03c17b964982119f5319cdaa85a1335b8558cca016"
+
+inherit autotools gettext pkgconfig
+
+# Use openssl because libgcrypt drops root privileges
+# if libgcrypt is linked with libcap support
+PACKAGECONFIG ??= "openssl"
+PACKAGECONFIG[openssl] = "--with-crypto_backend=openssl,,openssl"
+PACKAGECONFIG[gcrypt] = "--with-crypto_backend=gcrypt,,libgcrypt"
+
+RRECOMMENDS_${PN} = "kernel-module-aes-generic \
+                     kernel-module-dm-crypt \
+                     kernel-module-md5 \
+                     kernel-module-cbc \
+                     kernel-module-sha256-generic \
+                     kernel-module-xts \
+"
+
+EXTRA_OECONF = "--enable-static"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp/makefile-fix.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp/makefile-fix.patch
deleted file mode 100644
index c0d552d..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp/makefile-fix.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-digitemp: allow override of CC and CFLAGS vars
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-
---- a/Makefile	2008-08-28 21:37:00.000000000 +0000
-+++ b/Makefile	2011-11-24 22:22:39.882511272 +0000
-@@ -11,8 +11,9 @@
- 
- VERSION = 3.6.0
- 
--CC	= gcc
--CFLAGS	= -I./src -I./userial -O2 -Wall # -g
-+CC	?= gcc
-+CFLAGS	?=  -O2 -Wall # -g
-+CFLAGS += -I./src -I./userial
- 
- OBJS		=	src/digitemp.o src/device_name.o src/ds2438.o
- HDRS		= 	src/digitemp.h src/device_name.h
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_3.6.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_3.6.0.bb
deleted file mode 100644
index 2582820..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_3.6.0.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY = "read temperature sensors in a 1-Wire net"
-SECTION = "util"
-DEPENDS = "libusb1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=44fee82a1d2ed0676cf35478283e0aa0"
-
-PR = "r2"
-
-SRC_URI = "http://www.digitemp.com/software/linux/digitemp-${PV}.tar.gz \
-           file://makefile-fix.patch"
-SRC_URI[md5sum] = "9be2e48db37920f21925ae6e88f83b84"
-SRC_URI[sha256sum] = "14cfc584cd3714fe8c9a2cdc8388be49e08b5e395d95e6bcd11d4410e2505ca2"
-
-EXTRA_OEMAKE = "ds9097 ds9097u \
-                SYSTYPE='Linux' \
-"
-# Fix GNU_HASH QA errors
-TARGET_CC_ARCH += "${CFLAGS} ${LDFLAGS}"
-
-do_configure() {
-    rm -f digitemp_*
-}
-
-do_install() {
-    install -d ${D}${sbindir}
-    install digitemp_* ${D}${sbindir}
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_git.bb
new file mode 100644
index 0000000..460aa14
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/digitemp/digitemp_git.bb
@@ -0,0 +1,25 @@
+SUMMARY = "read temperature sensors in a 1-Wire net"
+SECTION = "util"
+DEPENDS = "libusb1"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=44fee82a1d2ed0676cf35478283e0aa0"
+
+PV = "3.7.1+git${SRCPV}"
+
+SRC_URI = "git://github.com/bcl/digitemp"
+
+SRCREV = "389f67655efa1674f595106c3a47b5ad082609a7"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "ds9097 ds9097u \
+                SYSTYPE='Linux' \
+"
+do_configure() {
+    rm -f digitemp_*
+}
+
+do_install() {
+    install -d ${D}${sbindir}
+    install -m 0755 digitemp_* ${D}${sbindir}
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/dstat/dstat_0.7.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/dstat/dstat_0.7.3.bb
index 1673b91..18af738 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/dstat/dstat_0.7.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/dstat/dstat_0.7.3.bb
@@ -7,7 +7,7 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
-DEPENDS += "asciidoc-native"
+DEPENDS += "asciidoc-native xmlto-native"
 
 SRC_URI = "git://github.com/dagwieers/dstat.git"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/eject/eject_2.1.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/eject/eject_2.1.5.bb
index 0440f0c..49a3d74 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/eject/eject_2.1.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/eject/eject_2.1.5.bb
@@ -33,3 +33,5 @@
 ALTERNATIVE_PRIORITY[volname] = "100"
 ALTERNATIVE_PRIORITY[eject] = "100"
 
+ALTERNATIVE_${PN}-doc = "eject.1"
+ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs.inc
index 012895e..5b905f9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs.inc
@@ -18,7 +18,7 @@
 
 EXTRA_OECONF =  "--without-sound --with-crt-dir=${STAGING_LIBDIR} "
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[x11] = "--with-x-toolkit=gtk,--without-x --without-dbus,${X11DEPENDS}"
 
 
@@ -86,7 +86,7 @@
     ${STAGING_DIR_TARGET}/${base_libdir}/libgcc_s.so.* \
     ${STAGING_DIR_TARGET}/${base_libdir}/libpthread* $treedir/${base_libdir}/
 
-    if [ ! -z "${@bb.utils.contains('PACKAGECONFIG', 'x11', 'x11', '', d)}" ] ; then
+    if [ ! -z "${@bb.utils.filter('PACKAGECONFIG', 'x11', d)}" ]; then
         echo "X11 build enabled"
         # copy only as much stuff as we need
         # before: 5.5G   ../../qemu-treedir/
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs_23.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs_23.4.bb
index a324828..3388ff0 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs_23.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/emacs/emacs_23.4.bb
@@ -2,7 +2,7 @@
 
 PR = "r4"
 
-PNBLACKLIST[emacs] ?= "qemu: uncaught target signal 11 (Segmentation fault) - core dumped"
+PNBLACKLIST[emacs] ?= "qemu: uncaught target signal 11 (Segmentation fault) - core dumped - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "${GNU_MIRROR}/emacs/emacs-${PV}.tar.gz;name=tarball \
            file://use-qemu.patch \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/farsight2_0.0.22.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/farsight2_0.0.22.bb
index 2989850..14ce57a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/farsight2_0.0.22.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/farsight2_0.0.22.bb
@@ -9,7 +9,7 @@
 
 DEPENDS = "libnice glib-2.0 libxml2 zlib dbus gstreamer gst-plugins-base"
 
-inherit autotools
+inherit autotools pkgconfig
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[gupnp] = "--enable-gupnp,--disable-gupnp,gupnp-igd"
@@ -28,3 +28,7 @@
 
 SRC_URI[md5sum] = "e1f540cf3ebab06c3d7db1f46b44ac88"
 SRC_URI[sha256sum] = "3ae59aa61a8071c9fad111e5fd606aabc27961eb4192f8729987a27dae6b3974"
+
+PNBLACKLIST[farsight2] ?= "Depends on blacklisted gstreamer - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+PNBLACKLIST[farsight2] ?= "Depends on blacklisted libnice - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+PNBLACKLIST[farsight2] ?= "Depends on blacklisted gst-plugins-base - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.0.13.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.0.13.bb
deleted file mode 100644
index 3c2a054..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.0.13.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-SUMMARY = "Interactive Connectivity Establishment library"
-DESCRIPTION = "Libnice is an implementation of the IETF's draft Interactive Connectivity Establishment standard (ICE)."
-HOMEPAGE = "http://nice.freedesktop.org/wiki/"
-SRC_URI = "http://nice.freedesktop.org/releases/libnice-${PV}.tar.gz"
-
-LICENSE = "LGPLv2.1 & MPLv1.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=9c42325015702feda4f4d2f19a55b767 \
-                    file://COPYING.LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
-                    file://COPYING.MPL;md5=3c617710e51cdbe0fc00716f056dfb1a \
-"
-
-PR = "r4"
-
-DEPENDS = "glib-2.0 gstreamer"
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[gupnp] = "--enable-gupnp,--disable-gupnp,gupnp-igd"
-
-inherit autotools pkgconfig gtk-doc
-
-EXTRA_OECONF = "--disable-gtk-doc"
-
-FILES_${PN} += "${libdir}/gstreamer-0.10/*.so"
-FILES_${PN}-dev += "${libdir}/gstreamer-0.10/*.la"
-FILES_${PN}-staticdev += "${libdir}/gstreamer-0.10/*.a"
-FILES_${PN}-dbg += "${libdir}/gstreamer-0.10/.debug"
-
-do_configure_prepend() {
-    mkdir ${S}/m4 || true
-}
-
-do_compile_append() {
-    for i in $(find ${B} -name "*.pc") ; do
-        sed -i -e s:${STAGING_DIR_TARGET}::g \
-               -e s:/${TARGET_SYS}::g \
-                  $i
-    done
-}
-
-
-SRC_URI[md5sum] = "e5b9f799a57cb939ea2658ec35253ab9"
-SRC_URI[sha256sum] = "d8dd260c486a470a6052a5323920878a084e44a19df09b15728b85c9e3d6edf0"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.1.13.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.1.13.bb
new file mode 100644
index 0000000..48c8221
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/farsight/libnice_0.1.13.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Interactive Connectivity Establishment library"
+DESCRIPTION = "Libnice is an implementation of the IETF's draft Interactive Connectivity Establishment standard (ICE)."
+HOMEPAGE = "http://nice.freedesktop.org/wiki/"
+SRC_URI = "http://nice.freedesktop.org/releases/libnice-${PV}.tar.gz"
+SRC_URI[md5sum] = "3226faeaf48a9150ada00da2e2865959"
+SRC_URI[sha256sum] = "61112d9f3be933a827c8365f20551563953af6718057928f51f487bfe88419e1"
+
+LICENSE = "LGPLv2.1 & MPLv1.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9c42325015702feda4f4d2f19a55b767 \
+                    file://COPYING.LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://COPYING.MPL;md5=3c617710e51cdbe0fc00716f056dfb1a \
+"
+
+DEPENDS = "glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[gupnp] = "--enable-gupnp,--disable-gupnp,gupnp-igd"
+
+inherit autotools pkgconfig gtk-doc gobject-introspection
+
+FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
+FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
+FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a"
+FILES_${PN}-dbg += "${libdir}/gstreamer-1.0/.debug"
+
+do_configure_prepend() {
+    mkdir ${S}/m4 || true
+}
+
+do_compile_append() {
+    for i in $(find ${B} -name "*.pc") ; do
+        sed -i -e s:${STAGING_DIR_TARGET}::g \
+               -e s:/${TARGET_SYS}::g \
+                  $i
+    done
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/benchfft_3.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/benchfft_3.1.bb
index 3e06a5a..49cc270 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/benchfft_3.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/benchfft_3.1.bb
@@ -18,4 +18,4 @@
 SRC_URI[md5sum] = "9356e5e9dcb3f1481977009720a2ccf8"
 SRC_URI[sha256sum] = "1b4a5b5e48ad5e61a21586b7b59d5c0a88691a981e73e2c6dc5868197461791b"
 
-PNBLACKLIST[benchfft] ?= "does not build with distroless qemuarm as reported in 'State of bitbake world' thread, nobody volunteered to fix them"
+PNBLACKLIST[benchfft] ?= "does not build with distroless qemuarm as reported in 'State of bitbake world' thread, nobody volunteered to fix them - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw/0001-NEON-autodetection-segfaults-assume-neon-present.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw/0001-NEON-autodetection-segfaults-assume-neon-present.patch
new file mode 100644
index 0000000..6340f42
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw/0001-NEON-autodetection-segfaults-assume-neon-present.patch
@@ -0,0 +1,80 @@
+From 97af5a2efbe30726ce4d7c921efed6afc32a314f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Sun, 25 Dec 2016 13:41:19 +0100
+Subject: [PATCH] NEON autodetection segfaults: assume neon present
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If TUNE_FEATURES contain 'neon' we can assume our machine supports it
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ simd-support/neon.c | 46 +---------------------------------------------
+ 1 file changed, 1 insertion(+), 45 deletions(-)
+
+diff --git a/simd-support/neon.c b/simd-support/neon.c
+index 86b2cb6..8d6537e 100644
+--- a/simd-support/neon.c
++++ b/simd-support/neon.c
+@@ -23,54 +23,10 @@
+ 
+ #if HAVE_NEON
+ 
+-/* check for an environment where signals are known to work */
+-#if defined(unix) || defined(linux)
+-  # include <signal.h>
+-  # include <setjmp.h>
+-
+-  static jmp_buf jb;
+-
+-  static void sighandler(int x)
+-  {
+-       UNUSED(x);
+-       longjmp(jb, 1);
+-  }
+-
+-  static int really_have_neon(void)
+-  {
+-       void (*oldsig)(int);
+-       oldsig = signal(SIGILL, sighandler);
+-       if (setjmp(jb)) {
+-	    signal(SIGILL, oldsig);
+-	    return 0;
+-       } else {
+-	    /* paranoia: encode the instruction in binary because the
+-	       assembler may not recognize it without -mfpu=neon */
+-	    /*asm volatile ("vand q0, q0, q0");*/
+-	    asm volatile (".long 0xf2000150");
+-	    signal(SIGILL, oldsig);
+-	    return 1;
+-       }
+-  }
+-
+-  int X(have_simd_neon)(void)
+-  {
+-       static int init = 0, res;
+-
+-       if (!init) {
+-	    res = really_have_neon();
+-	    init = 1;
+-       }
+-       return res;
+-  }
+-
+-
+-#else
+-/* don't know how to autodetect NEON; assume it is present */
++/* autodetect NEON broken; assume it is present */
+   int X(have_simd_neon)(void)
+   {
+        return 1;
+   }
+-#endif
+ 
+ #endif
+-- 
+2.5.5
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.4.bb
deleted file mode 100644
index e753743..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.4.bb
+++ /dev/null
@@ -1,74 +0,0 @@
-DESCRIPTION = "FFTW"
-SECTION = "libs"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-
-SRC_URI = "http://www.fftw.org/fftw-${PV}.tar.gz"
-SRC_URI[md5sum] = "2edab8c06b24feeb3b82bbb3ebf3e7b3"
-SRC_URI[sha256sum] = "8f0cde90929bc05587c3368d2f15cd0530a60b8a9912a8e2979a72dbe5af0982"
-
-inherit autotools pkgconfig
-
-# we had multiple recipes in the past
-PROVIDES = "fftwl fftwf"
-
-EXTRA_OECONF = "--disable-fortran --enable-shared --enable-threads"
-
-FFTW_NEON = "${@bb.utils.contains('TUNE_FEATURES', 'neon', '--enable-neon', '', d)}"
-FFTW_NEON_class-native = ""
-
-do_configure() {
-    # configure fftw
-    rm -rf ${WORKDIR}/build-fftw
-	mkdir -p ${B}
-    cd ${B}
-    # full (re)configure
-    autotools_do_configure
-    mv ${B} ${WORKDIR}/build-fftw
-
-    # configure fftwl
-    rm -rf ${WORKDIR}/build-fftwl
-	mkdir -p ${B}
-    cd ${B}
-    # configure only
-    oe_runconf  --enable-long-double
-    mv ${B} ${WORKDIR}/build-fftwl 
-
-    # configure fftwf
-    rm -rf ${WORKDIR}/build-fftwf
-	mkdir -p ${B}
-    cd ${B}
-    # configure only
-    oe_runconf --enable-single ${FFTW_NEON}
-    mv ${B} ${WORKDIR}/build-fftwf
-}
-
-do_compile() {
-    for lib in fftw fftwl fftwf; do
-        cd ${WORKDIR}/build-$lib
-        autotools_do_compile
-    done
-}
-
-do_install() {
-    for lib in fftw fftwl fftwf; do
-        cd ${WORKDIR}/build-$lib
-        autotools_do_install
-    done
-}
-
-
-PACKAGES =+ "libfftw libfftwl libfftwf"
-FILES_libfftw = "${libdir}/libfftw3.so.* ${libdir}/libfftw3_*.so.*"
-FILES_libfftwl = "${libdir}/libfftw3l.so.* ${libdir}/libfftw3l_*.so.*"
-FILES_libfftwf = "${libdir}/libfftw3f.so.* ${libdir}/libfftw3f_*.so.*"
-
-PACKAGES =+ "fftw-wisdom fftwl-wisdom fftwf-wisdom fftw-wisdom-to-conf"
-FILES_fftw-wisdom = "${bindir}/fftw-wisdom"
-FILES_fftwl-wisdom = "${bindir}/fftwl-wisdom"
-FILES_fftwf-wisdom = "${bindir}/fftwf-wisdom"
-FILES_fftw-wisdom-to-conf = "${bindir}/fftw-wisdom-to-conf"
-
-RDEPENDS_${PN}-dev = ""
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.6.bb
new file mode 100644
index 0000000..ed14e16
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fftw/fftw_3.3.6.bb
@@ -0,0 +1,81 @@
+DESCRIPTION = "FFTW"
+SECTION = "libs"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+SRC_URI = " \
+    http://www.fftw.org/fftw-${PV}-pl1.tar.gz \
+    file://0001-NEON-autodetection-segfaults-assume-neon-present.patch \
+"
+SRC_URI[md5sum] = "682a0e78d6966ca37c7446d4ab4cc2a1"
+SRC_URI[sha256sum] = "1ef4aa8427d9785839bc767f3eb6a84fcb5e9a37c31ed77a04e7e047519a183d"
+
+S = "${WORKDIR}/fftw-${PV}-pl1"
+
+inherit autotools pkgconfig
+
+# we had multiple recipes in the past
+PROVIDES = "fftwl fftwf"
+
+EXTRA_OECONF = "--disable-fortran --enable-shared --enable-threads"
+
+CFLAGS += "-D_GNU_SOURCE"
+
+FFTW_NEON = "${@bb.utils.contains('TUNE_FEATURES', 'neon', '--enable-neon', '', d)}"
+FFTW_NEON_class-native = ""
+
+do_configure() {
+    # configure fftw
+    rm -rf ${WORKDIR}/build-fftw
+	mkdir -p ${B}
+    cd ${B}
+    # full (re)configure
+    autotools_do_configure
+    mv ${B} ${WORKDIR}/build-fftw
+
+    # configure fftwl
+    rm -rf ${WORKDIR}/build-fftwl
+	mkdir -p ${B}
+    cd ${B}
+    # configure only
+    oe_runconf  --enable-long-double
+    mv ${B} ${WORKDIR}/build-fftwl 
+
+    # configure fftwf
+    rm -rf ${WORKDIR}/build-fftwf
+	mkdir -p ${B}
+    cd ${B}
+    # configure only
+    oe_runconf --enable-single ${FFTW_NEON}
+    mv ${B} ${WORKDIR}/build-fftwf
+}
+
+do_compile() {
+    for lib in fftw fftwl fftwf; do
+        cd ${WORKDIR}/build-$lib
+        autotools_do_compile
+    done
+}
+
+do_install() {
+    for lib in fftw fftwl fftwf; do
+        cd ${WORKDIR}/build-$lib
+        autotools_do_install
+    done
+}
+
+
+PACKAGES =+ "libfftw libfftwl libfftwf"
+FILES_libfftw = "${libdir}/libfftw3.so.* ${libdir}/libfftw3_*.so.*"
+FILES_libfftwl = "${libdir}/libfftw3l.so.* ${libdir}/libfftw3l_*.so.*"
+FILES_libfftwf = "${libdir}/libfftw3f.so.* ${libdir}/libfftw3f_*.so.*"
+
+PACKAGES =+ "fftw-wisdom fftwl-wisdom fftwf-wisdom fftw-wisdom-to-conf"
+FILES_fftw-wisdom = "${bindir}/fftw-wisdom"
+FILES_fftwl-wisdom = "${bindir}/fftwl-wisdom"
+FILES_fftwf-wisdom = "${bindir}/fftwf-wisdom"
+FILES_fftw-wisdom-to-conf = "${bindir}/fftw-wisdom-to-conf"
+
+RDEPENDS_${PN}-dev = ""
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/flite/flite-alsa_1.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/flite/flite-alsa_1.3.bb
index 51012e6..0883c1a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/flite/flite-alsa_1.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/flite/flite-alsa_1.3.bb
@@ -10,3 +10,12 @@
 
 SRC_URI[md5sum] = "ae0aca1cb7b4801f4372f3a75a9e52b5"
 SRC_URI[sha256sum] = "922225f7001e57a0fbace8833b0a48790a68f6c7b491f2d47c78ad537ab78a8b"
+
+# Looks like caused by flite-1.3-alsa_support-1.2.diff
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/armv5te-oe-linux-gnueabi/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox16/usr/lib/libflite_cmu_us_kal16.so.1.3' [ldflags]
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/armv5te-oe-linux-gnueabi/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox8/usr/lib/libflite_cmu_us_kal.so.1.3' [ldflags]
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/core2-64-oe-linux/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox16/usr/lib/libflite_cmu_us_kal16.so.1.3' [ldflags]
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/core2-64-oe-linux/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox8/usr/lib/libflite_cmu_us_kal.so.1.3' [ldflags]
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/i586-oe-linux/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox16/usr/lib/libflite_cmu_us_kal16.so.1.3' [ldflags]
+# flite-alsa-1.3: No GNU_HASH in the elf binary: '/tmp/work/i586-oe-linux/flite-alsa/1.3-r1/packages-split/libflite-alsa-vox8/usr/lib/libflite_cmu_us_kal.so.1.3' [ldflags]
+PNBLACKLIST[flite-alsa] ?= "OLD: wasn't updated in over 6 years, only navit was RSUGGESTing it and doesn't respect LDFLAGS - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk-native.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk-native.bb
new file mode 100644
index 0000000..353987e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk-native.bb
@@ -0,0 +1,16 @@
+require ${BPN}.inc
+
+DEPENDS = "zlib-native jpeg-native libpng-native libxext-native libxft-native"
+
+inherit native
+
+EXTRA_OECMAKE += " \
+    -DOPTION_BUILD_SHARED_LIBS=OFF \
+    -DOPTION_USE_THREADS=OFF \
+    -DOPTION_USE_XDBE=OFF \
+    -DOPTION_USE_XFT=OFF \
+    -DOPTION_BUILD_EXAMPLES=OFF \
+    -DOPTION_USE_XINERAMA=OFF \
+    -DOPTION_USE_XFIXES=OFF \
+    -DOPTION_USE_XCURSOR=OFF \
+"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.bb
new file mode 100644
index 0000000..542fd66
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.bb
@@ -0,0 +1,34 @@
+require ${BPN}.inc
+
+DEPENDS = "alsa-lib zlib jpeg libpng libxext libxft  ${BPN}-native"
+
+inherit binconfig lib_package gtk-icon-cache mime
+
+EXTRA_OECMAKE = " \
+    -DOPTION_BUILD_SHARED_LIBS=ON \
+    -DOPTION_USE_THREADS=ON \
+    -DOPTION_USE_XDBE=ON \
+    -DOPTION_USE_XFT=ON \
+    -DFLTK_CONFIG_PATH=${libdir}/cmake \
+"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
+
+PACKAGECONFIG[examples] = "-DOPTION_BUILD_EXAMPLES=ON,-DOPTION_BUILD_EXAMPLES=OFF,"
+PACKAGECONFIG[opengl] = "-DOPTION_USE_GL=ON,-DOPTION_USE_GL=OFF,virtual/libgl"
+PACKAGECONFIG[xinerama] = "-DOPTION_USE_XINERAMA=ON,-DOPTION_USE_XINERAMA=OFF,libxinerama"
+PACKAGECONFIG[xfixes] = "-DOPTION_USE_XFIXES=ON,-DOPTION_USE_XFIXES=OFF,libxfixes"
+PACKAGECONFIG[xcursor] = "-DOPTION_USE_XCURSOR=ON,-DOPTION_USE_XCURSOR=OFF,libxcursor"
+
+do_install_append() {
+    sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${bindir}/fltk-config
+}
+
+python populate_packages_prepend () {
+    if (d.getVar('DEBIAN_NAMES')):
+        d.setVar('PKG_${BPN}', 'libfltk${PV}')
+}
+
+LEAD_SONAME = "libfltk.so"
+
+FILES_${PN} += "${datadir}/mime"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.inc
new file mode 100644
index 0000000..dbe700a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk.inc
@@ -0,0 +1,21 @@
+SUMMARY = "FLTK is a cross-platform C++ GUI toolkit"
+HOMEPAGE = "http://www.fltk.org"
+SECTION = "libs"
+LICENSE = "LGPLv2 & FLTK"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f6b26344a24a941a01a5b0826e80b5ca"
+
+SRC_URI = " \
+    http://fltk.org/pub/fltk/1.3.4/${BP}-source.tar.gz \
+    file://disable_test.patch \
+    file://fltk-no-freetype-config.patch \
+    file://0001-Fl_Preferences.cxx-do-not-use-dlopen-in-case-glibc-s.patch \
+    file://0002-always-build-fluid-and-export-pointers.patch \
+"
+
+PV = "1.3.4-1"
+SRC_URI[md5sum] = "d7fcd27ab928648e1a1366dd2e273970"
+SRC_URI[sha256sum] = "7fb2c8882433ce694e6900c94fda505e8f4ed3fa9c7e597007098a33b85c53f4"
+
+inherit cmake pkgconfig
+
+TARGET_CC_ARCH += "${LDFLAGS} -DXFT_MAJOR=2"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0001-Fl_Preferences.cxx-do-not-use-dlopen-in-case-glibc-s.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0001-Fl_Preferences.cxx-do-not-use-dlopen-in-case-glibc-s.patch
new file mode 100644
index 0000000..e6e68a0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0001-Fl_Preferences.cxx-do-not-use-dlopen-in-case-glibc-s.patch
@@ -0,0 +1,39 @@
+From e76a062338063615c069fedc5a143cc38c34d9b2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Tue, 28 Feb 2017 01:00:21 +0100
+Subject: [PATCH] Fl_Preferences.cxx: do not use dlopen in case glibc's headers
+ are missing
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| /home/work/x86_64-linux/fltk-native/1.3.4-1-r0/fltk-1.3.4-1/src/Fl_Preferences.cxx: In static member function ‘static int Fl_Plugin_Manager::load(const char*)’:
+| /home/work/x86_64-linux/fltk-native/1.3.4-1-r0/fltk-1.3.4-1/src/Fl_Preferences.cxx:1741:27: error: ‘RTLD_LAZY’ was not declared in this scope
+|      dl = dlopen(filename, RTLD_LAZY);
+|                            ^~~~~~~~~
+| /home/work/x86_64-linux/fltk-native/1.3.4-1-r0/fltk-1.3.4-1/src/Fl_Preferences.cxx:1741:36: error: ‘dlopen’ was not declared in this scope
+|      dl = dlopen(filename, RTLD_LAZY);
+|                                     ^
+| src/CMakeFiles/fltk.dir/build.make:1217: recipe for target 'src/CMakeFiles/fltk.dir/Fl_Preferences.cxx.o' failed
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ src/Fl_Preferences.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
+index 1233bb1..7857b9b 100644
+--- a/src/Fl_Preferences.cxx
++++ b/src/Fl_Preferences.cxx
+@@ -1737,7 +1737,7 @@ int Fl_Plugin_Manager::load(const char *filename) {
+   HMODULE dl = LoadLibrary(filename);
+ #else
+   void * dl = NULL;
+-# if HAVE_DLSYM
++# if HAVE_DLSYM && HAVE_DLFCN_H
+     dl = dlopen(filename, RTLD_LAZY);
+ # endif
+ #endif
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0002-always-build-fluid-and-export-pointers.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0002-always-build-fluid-and-export-pointers.patch
new file mode 100644
index 0000000..cca977c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/0002-always-build-fluid-and-export-pointers.patch
@@ -0,0 +1,31 @@
+From 16010cb1a69ea2326d8102b7f1e34b65aca4b278 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Tue, 28 Feb 2017 01:20:42 +0100
+Subject: [PATCH] always build fluid and export pointers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ CMake/export.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMake/export.cmake b/CMake/export.cmake
+index 968186a..95e04eb 100644
+--- a/CMake/export.cmake
++++ b/CMake/export.cmake
+@@ -21,7 +21,7 @@
+ # final config and export
+ #######################################################################
+ # Set the fluid executable path
+-if(CMAKE_CROSSCOMPILING)
++if(FALSE)
+    find_file(FLUID_PATH
+       NAMES fluid fluid.exe
+       PATHS ENV PATH
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fix-boolean-issue-with-jpeg9.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fix-boolean-issue-with-jpeg9.patch
deleted file mode 100644
index 014184d..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fix-boolean-issue-with-jpeg9.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 14c22398f8370e33a798360ed0dad513af8f1470 Mon Sep 17 00:00:00 2001
-From: AlbrechtS <AlbrechtS@ea41ed52-d2ee-0310-a9c1-e6b18d33e121>
-Date: Sun, 15 Mar 2015 19:32:33 +0000
-Subject: [PATCH] Fix 'boolean' issue with jpeg-9 library compatibility (STR
- #2920).
-
-According to comments in STR #2920 and my own tests this is also
-compatible with older jpeg libraries (at least jpeg-8).
-
-Upstream-Status: Backport
-
----
- src/Fl_JPEG_Image.cxx |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/Fl_JPEG_Image.cxx b/src/Fl_JPEG_Image.cxx
-index 47120a7..6cebe88 100644
---- a/src/Fl_JPEG_Image.cxx
-+++ b/src/Fl_JPEG_Image.cxx
-@@ -155,7 +155,7 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *filename)	// I - File to load
-   
-   jpeg_create_decompress(&dinfo);
-   jpeg_stdio_src(&dinfo, fp);
--  jpeg_read_header(&dinfo, 1);
-+  jpeg_read_header(&dinfo, TRUE);
-   
-   dinfo.quantize_colors      = (boolean)FALSE;
-   dinfo.out_color_space      = JCS_RGB;
-@@ -337,7 +337,7 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *name, const unsigned char *data)
-   
-   jpeg_create_decompress(&dinfo);
-   jpeg_mem_src(&dinfo, data);
--  jpeg_read_header(&dinfo, 1);
-+  jpeg_read_header(&dinfo, TRUE);
-   
-   dinfo.quantize_colors      = (boolean)FALSE;
-   dinfo.out_color_space      = JCS_RGB;
--- 
-1.7.9.5
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fltk-no-freetype-config.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fltk-no-freetype-config.patch
index 4d13ffc..2a9915b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fltk-no-freetype-config.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk/fltk-no-freetype-config.patch
@@ -1,20 +1,40 @@
---- a/configure.in.orig	2015-11-26 14:30:17.893426966 +0800
-+++ b/configure.in	2015-11-26 14:33:00.285424099 +0800
-@@ -969,12 +969,12 @@ case $host_os_gui in
-         AC_ARG_ENABLE(xft, [  --enable-xft            turn on Xft support [[default=yes]]])
+From 699420d306cadbb5285942e09f4383d84b01985d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 13 Jan 2017 13:21:23 +0100
+Subject: [PATCH] replace freetype-config by pkg-config
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.ac | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f0efd48..3af5ecb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1006,12 +1006,12 @@ case $host_os_gui in
  
+ 	xft_found=no
  	if test x$enable_xft != xno; then
--            AC_PATH_PROG(FTCONFIG,freetype-config)
-+            AC_PATH_PROG(PKGCONFIG,pkg-config)
+-	    AC_PATH_PROG(FTCONFIG, freetype-config)
++	    AC_PATH_PROG(PKGCONFIG,pkg-config)
  
 -	    if test "x$FTCONFIG" != x; then
--	        CPPFLAGS="`$FTCONFIG --cflags` $CPPFLAGS"
--	        CFLAGS="`$FTCONFIG --cflags` $CFLAGS"
--	        CXXFLAGS="`$FTCONFIG --cflags` $CXXFLAGS"
+-		CPPFLAGS="`$FTCONFIG --cflags` $CPPFLAGS"
+-		CFLAGS="`$FTCONFIG --cflags` $CFLAGS"
+-		CXXFLAGS="`$FTCONFIG --cflags` $CXXFLAGS"
 +	    if test "x$PKGCONFIG" != x; then
 +	        CPPFLAGS="`$PKGCONFIG --cflags xft` $CPPFLAGS"
 +	        CFLAGS="`$PKGCONFIG --cflags xft` $CFLAGS"
 +	        CXXFLAGS="`$PKGCONFIG --cflags xft` $CXXFLAGS"
  
- 	        AC_CHECK_LIB(fontconfig, FcPatternCreate)
+ 		AC_CHECK_LIB(fontconfig, FcPatternCreate)
  		AC_CHECK_HEADER(X11/Xft/Xft.h,
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk_1.3.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk_1.3.3.bb
deleted file mode 100644
index 117ecc3..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/fltk/fltk_1.3.3.bb
+++ /dev/null
@@ -1,49 +0,0 @@
-SUMMARY = "FLTK is a cross-platform C++ GUI toolkit"
-HOMEPAGE = "http://www.fltk.org"
-SECTION = "libs"
-LICENSE = "LGPLv2 & FLTK"
-LIC_FILES_CHKSUM = "file://COPYING;md5=f6b26344a24a941a01a5b0826e80b5ca"
-
-DEPENDS = "alsa-lib zlib jpeg libpng libxext libxft"
-
-SRC_URI = "http://fltk.org/pub/fltk/${PV}/${BP}-source.tar.gz \
-           file://disable_test.patch \
-           file://fltk-no-freetype-config.patch \
-           file://fix-boolean-issue-with-jpeg9.patch \
-"
-
-SRC_URI[md5sum] = "9ccdb0d19dc104b87179bd9fd10822e3"
-SRC_URI[sha256sum] = "f8398d98d7221d40e77bc7b19e761adaf2f1ef8bb0c30eceb7beb4f2273d0d97"
-
-inherit autotools-brokensep binconfig pkgconfig lib_package
-
-TARGET_CC_ARCH += "${LDFLAGS} -DXFT_MAJOR=2"
-
-EXTRA_OECONF = "--enable-shared \
-                --enable-threads \
-                --enable-xdbe \
-                --enable-xft \
-"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl', '', d)}"
-
-PACKAGECONFIG[opengl] = "--enable-gl,--disable-gl,virtual/libgl"
-PACKAGECONFIG[xinerama] = "--enable-xinerama,--disable-xinerama,libxinerama"
-PACKAGECONFIG[xfixes] = "--enable-xfixes,--disable-xfixes,libxfixes"
-PACKAGECONFIG[xcursor] = "--enable-xcursor,--disable-xcursor,libxcursor"
-
-do_configure() {
-    oe_runconf
-}
-
-do_install_append_class-target() {
-    sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${bindir}/fltk-config
-}
-
-python populate_packages_prepend () {
-    if (d.getVar('DEBIAN_NAMES', 1)):
-        d.setVar('PKG_${BPN}', 'libfltk${PV}')
-}
-
-LEAD_SONAME = "libfltk.so"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp/0003-add-missing-define.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp/0003-add-missing-define.patch
new file mode 100644
index 0000000..220edef
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp/0003-add-missing-define.patch
@@ -0,0 +1,45 @@
+libwinpr/comm_seria: fix missing define
+
+FreeRDP uses CMSPAR, which is defined by glibc in bits/termios.h .
+
+glibc has two flavours of bits/termios.h: a genmeric one and an
+architecture-specific one. When installing, glibc will install the
+architecture-specific file if it exists, otherwise it installs the
+generic file. Only Alpha, MIPS, PPC and Sparc have their own
+bits/termios.h.
+
+The generic bits/termios.h, as well as the Alpha, PPC and Sparc flavours
+do define CMSPAR. However, the MIPS flavour does not define it.
+
+Define CMSPAR to the value from the generic value, which is also the
+value known to the Linux kernel for MIPS.
+
+Fixes:
+    http://autobuild.buildroot.org/results/0b4/0b4793f0bf9f4c57933897f3480054a4e06528ad/
+    http://autobuild.buildroot.org/results/7a2/7a2284d0a2987158fa2e78f789b07c8c6fcdb974/
+    http://autobuild.buildroot.org/results/387/3874088c3ccd4bbf76ea0c911ca1ef64c7dc9d1c/
+    ...
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Cc: Peter Korsgaard <jacmet@uclibc.org>
+Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+diff -durN freerdp-17834af7bb378f85a3b3cc4dcadaa5125a337e16.orig/winpr/libwinpr/comm/comm_serial_sys.c freerdp-17834af7bb378f85a3b3cc4dcadaa5125a337e16/winpr/libwinpr/comm/comm_serial_sys.c
+--- freerdp-17834af7bb378f85a3b3cc4dcadaa5125a337e16.orig/winpr/libwinpr/comm/comm_serial_sys.c	2015-09-04 16:20:17.000000000 +0100
++++ freerdp-17834af7bb378f85a3b3cc4dcadaa5125a337e16/winpr/libwinpr/comm/comm_serial_sys.c	2015-10-04 11:07:41.868513726 +0100
+@@ -27,6 +27,14 @@
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+ #include <termios.h>
++
++/* glibc for MIPS has its own bits/termios.h which does not define
++ * CMSPAR, so we vampirise the value from the generic bits/termios.h
++ */
++#ifndef CMSPAR
++#define CMSPAR 010000000000
++#endif
++
+ #include <unistd.h>
+ 
+ #include "comm_serial_sys.h"
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp_git.bb
index 339a053..f0aa1b6 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/freerdp/freerdp_git.bb
@@ -17,6 +17,7 @@
 SRC_URI = "git://github.com/FreeRDP/FreeRDP.git \
     file://winpr-makecert-Build-with-install-RPATH.patch \
     file://0001-FindGStreamer_1_0-fix-build-failure-for-new-gstreame.patch \
+    file://0003-add-missing-define.patch \
 "
 
 S = "${WORKDIR}/git"
@@ -32,14 +33,10 @@
     -DWITH_MANPAGES=OFF \
 "
 
-PACKAGECONFIG ??= "  \
-                ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\
-                ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\
-                ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)}\
-                ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}\
-                ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}\
-                gstreamer cups \
-                "
+PACKAGECONFIG ??= " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'directfb pam pulseaudio wayland x11', d)}\
+    gstreamer cups \
+"
 
 X11_DEPS = "virtual/libx11 libxinerama libxext libxcursor libxv libxi libxrender libxfixes libxdamage libxrandr libxkbfile"
 PACKAGECONFIG[x11] = "-DWITH_X11=ON -DWITH_XINERAMA=ON -DWITH_XEXT=ON -DWITH_XCURSOR=ON -DWITH_XV=ON -DWITH_XI=ON -DWITH_XRENDER=ON -DWITH_XFIXES=ON -DWITH_XDAMAGE=ON -DWITH_XRANDR=ON -DWITH_XKBFILE=ON,-DWITH_X11=OFF,${X11_DEPS}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/.gitignore-the-new-test-case.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/.gitignore-the-new-test-case.patch
new file mode 100644
index 0000000..eab4975
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/.gitignore-the-new-test-case.patch
@@ -0,0 +1,24 @@
+From 8520274759cb8f95e483b02a445aff225e13467b Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Tue, 16 Aug 2016 16:00:27 +0200
+Subject: [PATCH] .gitignore the new test case
+
+Upstream-Status: Backport
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ tests/tga/.gitignore | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/tga/.gitignore b/tests/tga/.gitignore
+index e88e124..7a659b1 100644
+--- a/tests/tga/.gitignore
++++ b/tests/tga/.gitignore
+@@ -4,3 +4,4 @@
+ /bug00248
+ /bug00248a
+ /tga_null
++/tga_read
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10166.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10166.patch
new file mode 100644
index 0000000..7ccfbea
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10166.patch
@@ -0,0 +1,60 @@
+From c92240c1670c20c2f854761d3a89ab61dd158c91 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Sat, 6 Aug 2016 10:08:53 +0200
+Subject: [PATCH] Fix potential unsigned underflow
+
+No need to decrease `u`, so we don't do it. While we're at it, we also factor
+out the overflow check of the loop, what improves performance and readability.
+
+This issue has been reported by Stefan Esser to security@libgd.org.
+
+Upstream-Status: Backport
+CVE: CVE-2016-10166
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_interpolation.c | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/src/gd_interpolation.c b/src/gd_interpolation.c
+index 7e7943d..9944349 100644
+--- a/src/gd_interpolation.c
++++ b/src/gd_interpolation.c
+@@ -829,8 +829,13 @@ static inline LineContribType * _gdContributionsAlloc(unsigned int line_length,
+ {
+ 	unsigned int u = 0;
+ 	LineContribType *res;
+-	int overflow_error = 0;
++	size_t weights_size;
+ 
++	if (overflow2(windows_size, sizeof(double))) {
++		return NULL;
++	} else {
++		weights_size = windows_size * sizeof(double);
++	}
+ 	res = (LineContribType *) gdMalloc(sizeof(LineContribType));
+ 	if (!res) {
+ 		return NULL;
+@@ -847,15 +852,11 @@ static inline LineContribType * _gdContributionsAlloc(unsigned int line_length,
+ 		return NULL;
+ 	}
+ 	for (u = 0 ; u < line_length ; u++) {
+-		if (overflow2(windows_size, sizeof(double))) {
+-			overflow_error = 1;
+-		} else {
+-			res->ContribRow[u].Weights = (double *) gdMalloc(windows_size * sizeof(double));
+-		}
+-		if (overflow_error == 1 || res->ContribRow[u].Weights == NULL) {
++		res->ContribRow[u].Weights = (double *) gdMalloc(weights_size);
++		if (res->ContribRow[u].Weights == NULL) {
+ 			unsigned int i;
+-			u--;
+-			for (i=0;i<=u;i++) {
++
++			for (i=0;i<u;i++) {
+ 				gdFree(res->ContribRow[i].Weights);
+ 			}
+ 			gdFree(res->ContribRow);
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10167.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10167.patch
new file mode 100644
index 0000000..54ef22c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10167.patch
@@ -0,0 +1,48 @@
+From 6ab531ef0d82efb9e00236ee5ea23928335d221f Mon Sep 17 00:00:00 2001
+From: Catalin Enache <catalin.enache@windriver.com>
+Date: Fri, 7 Apr 2017 12:30:22 +0300
+Subject: [PATCH] Fix DOS vulnerability in gdImageCreateFromGd2Ctx()
+
+We must not pretend that there are image data if there are none. Instead
+we fail reading the image file gracefully.
+
+Upstream-Status: Backport
+CVE: CVE-2016-10167
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_gd2.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/src/gd_gd2.c b/src/gd_gd2.c
+index 8df93c1..bae65ea 100644
+--- a/src/gd_gd2.c
++++ b/src/gd_gd2.c
+@@ -445,18 +445,16 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
+ 
+ 						if (im->trueColor) {
+ 							if (!gdGetInt (&im->tpixels[y][x], in)) {
+-								/*printf("EOF while reading\n"); */
+-								/*gdImageDestroy(im); */
+-								/*return 0; */
+-								im->tpixels[y][x] = 0;
++								gd_error("gd2: EOF while reading\n");
++								gdImageDestroy(im);
++								return NULL;
+ 							}
+ 						} else {
+ 							int ch;
+ 							if (!gdGetByte (&ch, in)) {
+-								/*printf("EOF while reading\n"); */
+-								/*gdImageDestroy(im); */
+-								/*return 0; */
+-								ch = 0;
++								gd_error("gd2: EOF while reading\n");
++								gdImageDestroy(im);
++								return NULL;
+ 							}
+ 							im->pixels[y][x] = ch;
+ 						}
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10168.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10168.patch
new file mode 100644
index 0000000..aef1060
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-10168.patch
@@ -0,0 +1,38 @@
+From 2d37bdc03a6e2b820fe380016f22592a7733e0be Mon Sep 17 00:00:00 2001
+From: Catalin Enache <catalin.enache@windriver.com>
+Date: Fri, 7 Apr 2017 12:32:49 +0300
+Subject: [PATCH] Fix #354: Signed Integer Overflow gd_io.c
+
+GD2 stores the number of horizontal and vertical chunks as words (i.e. 2
+byte unsigned). These values are multiplied and assigned to an int when
+reading the image, what can cause integer overflows. We have to avoid
+that, and also make sure that either chunk count is actually greater
+than zero. If illegal chunk counts are detected, we bail out from
+reading the image.
+
+Upstream-Status: Backport
+CVE: CVE-2016-10168
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_gd2.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/gd_gd2.c b/src/gd_gd2.c
+index bae65ea..9006bd2 100644
+--- a/src/gd_gd2.c
++++ b/src/gd_gd2.c
+@@ -151,6 +151,10 @@ _gd2GetHeader (gdIOCtxPtr in, int *sx, int *sy,
+ 	GD2_DBG (printf ("%d Chunks vertically\n", *ncy));
+ 
+ 	if (gd2_compressed (*fmt)) {
++		if (*ncx <= 0 || *ncy <= 0 || *ncx > INT_MAX / *ncy) {
++			GD2_DBG(printf ("Illegal chunk counts: %d * %d\n", *ncx, *ncy));
++			goto fail1;
++		}
+ 		nc = (*ncx) * (*ncy);
+ 
+ 		GD2_DBG (printf ("Reading %d chunk index entries\n", nc));
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-1.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-1.patch
new file mode 100644
index 0000000..97b7f72
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-1.patch
@@ -0,0 +1,167 @@
+From fb0e0cce0b9f25389ab56604c3547351617e1415 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Tue, 16 Aug 2016 16:26:19 +0200
+Subject: [PATCH] Fix OOB reads of the TGA decompression buffer
+
+It is possible to craft TGA files which will overflow the decompression
+buffer, but not the image's bitmap. Therefore we augment the check for the
+bitmap's overflow with a check for the buffer's overflow.
+
+This issue had been reported by Ibrahim El-Sayed to security@libgd.org.
+
+CVE-2016-6906
+
+Upstream-Status: Backport
+CVE: CVE-2016-6906
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_tga.c                |   6 ++++--
+ tests/tga/.gitignore        |   1 +
+ tests/tga/CMakeLists.txt    |   1 +
+ tests/tga/Makemodule.am     |   2 ++
+ tests/tga/heap_overflow.c   |  51 ++++++++++++++++++++++++++++++++++++++++++++
+ tests/tga/heap_overflow.tga | Bin 0 -> 605 bytes
+ 6 files changed, 59 insertions(+), 2 deletions(-)
+ create mode 100644 tests/tga/heap_overflow.c
+ create mode 100644 tests/tga/heap_overflow.tga
+
+diff --git a/src/gd_tga.c b/src/gd_tga.c
+index 8737b04..68e4b17 100644
+--- a/src/gd_tga.c
++++ b/src/gd_tga.c
+@@ -300,7 +300,8 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 				encoded_pixels = ( ( decompression_buffer[ buffer_caret ] & ~TGA_RLE_FLAG ) + 1 );
+ 				buffer_caret++;
+ 
+-				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size) {
++				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size
++						|| buffer_caret + pixel_block_size > rle_size) {
+ 					gdFree( decompression_buffer );
+ 					gdFree( conversion_buffer );
+ 					return -1;
+@@ -316,7 +317,8 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 				encoded_pixels = decompression_buffer[ buffer_caret ] + 1;
+ 				buffer_caret++;
+ 
+-				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size) {
++				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size
++						|| buffer_caret + (encoded_pixels * pixel_block_size) > rle_size) {
+ 					gdFree( decompression_buffer );
+ 					gdFree( conversion_buffer );
+ 					return -1;
+diff --git a/tests/tga/.gitignore b/tests/tga/.gitignore
+index 7a659b1..cf0556b 100644
+--- a/tests/tga/.gitignore
++++ b/tests/tga/.gitignore
+@@ -3,5 +3,6 @@
+ /bug00247a
+ /bug00248
+ /bug00248a
++/heap_overflow
+ /tga_null
+ /tga_read
+diff --git a/tests/tga/CMakeLists.txt b/tests/tga/CMakeLists.txt
+index 789fb14..11542a0 100644
+--- a/tests/tga/CMakeLists.txt
++++ b/tests/tga/CMakeLists.txt
+@@ -5,6 +5,7 @@ LIST(APPEND TESTS_FILES
+ 	bug00247a
+ 	bug00248
+ 	bug00248a
++	heap_overflow
+ 	tga_read
+ )
+ 
+diff --git a/tests/tga/Makemodule.am b/tests/tga/Makemodule.am
+index a1e6af6..916d707 100644
+--- a/tests/tga/Makemodule.am
++++ b/tests/tga/Makemodule.am
+@@ -4,6 +4,7 @@ libgd_test_programs += \
+ 	tga/bug00247a \
+ 	tga/bug00248 \
+ 	tga/bug00248a \
++	tga/heap_overflow \
+ 	tga/tga_null \
+ 	tga/tga_read
+ 
+@@ -14,6 +15,7 @@ EXTRA_DIST += \
+ 	tga/bug00247a.tga \
+ 	tga/bug00248.tga \
+ 	tga/bug00248a.tga \
++	tga/heap_overflow.tga \
+ 	tga/tga_read_rgb.png \
+ 	tga/tga_read_rgb.tga \
+ 	tga/tga_read_rgb_rle.tga
+diff --git a/tests/tga/heap_overflow.c b/tests/tga/heap_overflow.c
+new file mode 100644
+index 0000000..0e9a2d0
+--- /dev/null
++++ b/tests/tga/heap_overflow.c
+@@ -0,0 +1,51 @@
++/**
++ * Test that the crafted TGA file doesn't trigger OOB reads.
++ */
++
++
++#include "gd.h"
++#include "gdtest.h"
++
++
++static size_t read_test_file(char **buffer, char *basename);
++
++
++int main()
++{
++    gdImagePtr im;
++    char *buffer;
++    size_t size;
++
++    size = read_test_file(&buffer, "heap_overflow.tga");
++    im = gdImageCreateFromTgaPtr(size, (void *) buffer);
++    gdTestAssert(im == NULL);
++    free(buffer);
++
++    return gdNumFailures();
++}
++
++
++static size_t read_test_file(char **buffer, char *basename)
++{
++    char *filename;
++    FILE *fp;
++    size_t exp_size, act_size;
++
++    filename = gdTestFilePath2("tga", basename);
++    fp = fopen(filename, "rb");
++    gdTestAssert(fp != NULL);
++
++	fseek(fp, 0, SEEK_END);
++	exp_size = ftell(fp);
++	fseek(fp, 0, SEEK_SET);
++
++    *buffer = malloc(exp_size);
++    gdTestAssert(*buffer != NULL);
++    act_size = fread(*buffer, sizeof(**buffer), exp_size, fp);
++    gdTestAssert(act_size == exp_size);
++
++    fclose(fp);
++    free(filename);
++
++    return act_size;
++}
+diff --git a/tests/tga/heap_overflow.tga b/tests/tga/heap_overflow.tga
+new file mode 100644
+index 0000000000000000000000000000000000000000..e9bc0ecb2a847ac6edba92dd0ff61167b49002cd
+GIT binary patch
+literal 605
+zcmZQz;9`IQ9tIu;g&7<$F3o7Yg1qzyh6tefy9wZAs2d<Uh*yuz=?XwW4Qvuv#g2nS
+zp93+mT0rVR>T&8(2TGy=f_l)@gSap~$FayUFu(!|SyJIFga^{8fGj~vwq8kkVgvv>
+Cavop+
+
+literal 0
+HcmV?d00001
+
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-2.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-2.patch
new file mode 100644
index 0000000..8b6de97
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/CVE-2016-6906-2.patch
@@ -0,0 +1,135 @@
+From 58b6dde319c301b0eae27d12e2a659e067d80558 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Tue, 16 Aug 2016 16:26:19 +0200
+Subject: [PATCH] Fix OOB reads of the TGA decompression buffer
+
+It is possible to craft TGA files which will overflow the decompression
+buffer, but not the image's bitmap. Therefore we also have to check for
+potential decompression buffer overflows.
+
+This issue had been reported by Ibrahim El-Sayed to security@libgd.org;
+a modified case exposing an off-by-one error of the first patch had been
+provided by Konrad Beckmann.
+
+This commit is an amendment to commit fb0e0cce, so we use CVE-2016-6906
+as well.
+
+Upstream-Status: Backport
+CVE: CVE-2016-6906
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_tga.c                  |   8 +++++++-
+ tests/tga/Makemodule.am       |   3 ++-
+ tests/tga/heap_overflow.c     |  16 ++++++++++++----
+ tests/tga/heap_overflow_1.tga | Bin 0 -> 605 bytes
+ tests/tga/heap_overflow_2.tga | Bin 0 -> 8746 bytes
+ 5 files changed, 21 insertions(+), 6 deletions(-)
+ create mode 100644 tests/tga/heap_overflow_1.tga
+ create mode 100644 tests/tga/heap_overflow_2.tga
+
+diff --git a/src/gd_tga.c b/src/gd_tga.c
+index 68e4b17..f80f0b1 100644
+--- a/src/gd_tga.c
++++ b/src/gd_tga.c
+@@ -295,7 +295,13 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 		buffer_caret = 0;
+ 
+ 		while( bitmap_caret < image_block_size ) {
+-			
++
++			if (buffer_caret + pixel_block_size > rle_size) {
++				gdFree( decompression_buffer );
++				gdFree( conversion_buffer );
++				return -1;
++			}
++
+ 			if ((decompression_buffer[buffer_caret] & TGA_RLE_FLAG) == TGA_RLE_FLAG) {
+ 				encoded_pixels = ( ( decompression_buffer[ buffer_caret ] & ~TGA_RLE_FLAG ) + 1 );
+ 				buffer_caret++;
+diff --git a/tests/tga/Makemodule.am b/tests/tga/Makemodule.am
+index 916d707..ab08dbf 100644
+--- a/tests/tga/Makemodule.am
++++ b/tests/tga/Makemodule.am
+@@ -15,7 +15,8 @@ EXTRA_DIST += \
+ 	tga/bug00247a.tga \
+ 	tga/bug00248.tga \
+ 	tga/bug00248a.tga \
+-	tga/heap_overflow.tga \
++	tga/heap_overflow_1.tga \
++	tga/heap_overflow_2.tga \
+ 	tga/tga_read_rgb.png \
+ 	tga/tga_read_rgb.tga \
+ 	tga/tga_read_rgb_rle.tga
+diff --git a/tests/tga/heap_overflow.c b/tests/tga/heap_overflow.c
+index 0e9a2d0..ddd4b63 100644
+--- a/tests/tga/heap_overflow.c
++++ b/tests/tga/heap_overflow.c
+@@ -1,5 +1,5 @@
+ /**
+- * Test that the crafted TGA file doesn't trigger OOB reads.
++ * Test that crafted TGA files don't trigger OOB reads.
+  */
+ 
+ 
+@@ -7,21 +7,29 @@
+ #include "gdtest.h"
+ 
+ 
++static void check_file(char *basename);
+ static size_t read_test_file(char **buffer, char *basename);
+ 
+ 
+ int main()
+ {
++    check_file("heap_overflow_1.tga");
++    check_file("heap_overflow_2.tga");
++
++    return gdNumFailures();
++}
++
++
++static void check_file(char *basename)
++{
+     gdImagePtr im;
+     char *buffer;
+     size_t size;
+ 
+-    size = read_test_file(&buffer, "heap_overflow.tga");
++    size = read_test_file(&buffer, basename);
+     im = gdImageCreateFromTgaPtr(size, (void *) buffer);
+     gdTestAssert(im == NULL);
+     free(buffer);
+-
+-    return gdNumFailures();
+ }
+ 
+ 
+diff --git a/tests/tga/heap_overflow_1.tga b/tests/tga/heap_overflow_1.tga
+new file mode 100644
+index 0000000000000000000000000000000000000000..e9bc0ecb2a847ac6edba92dd0ff61167b49002cd
+GIT binary patch
+literal 605
+zcmZQz;9`IQ9tIu;g&7<$F3o7Yg1qzyh6tefy9wZAs2d<Uh*yuz=?XwW4Qvuv#g2nS
+zp93+mT0rVR>T&8(2TGy=f_l)@gSap~$FayUFu(!|SyJIFga^{8fGj~vwq8kkVgvv>
+Cavop+
+
+literal 0
+HcmV?d00001
+
+diff --git a/tests/tga/heap_overflow_2.tga b/tests/tga/heap_overflow_2.tga
+new file mode 100644
+index 0000000000000000000000000000000000000000..2b681f2df8941d6823aa761be0a7fa3c02c92cbf
+GIT binary patch
+literal 8746
+zcmeIxF$#b%6a>*<djij4?cuz+Vi5?!RIY)@*eDAQ@`zPSwQE1NTI<YQEqdQG#s5@h
+zwDFtAoIjm)CIQa|$z*q(vz}DbnPjrN&RI{Y=}a=&UFWPP)joCZ<31}ey8!(}FZZ71
+zWop>#e)AY=opmMw&j!h4cb&7IRMVMcvb)Y%PpaumGTB|{tS8lUCYkK6bJmk;IzMDC
+D4PYIN
+
+literal 0
+HcmV?d00001
+
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/Fix-290-TGA-RLE-decoding-is-broken.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/Fix-290-TGA-RLE-decoding-is-broken.patch
new file mode 100644
index 0000000..64f5c62
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd/Fix-290-TGA-RLE-decoding-is-broken.patch
@@ -0,0 +1,359 @@
+From 4f8e26f2a40ffaa3a5b77be6a49989a1a42e2b83 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Tue, 16 Aug 2016 14:27:23 +0200
+Subject: [PATCH] Fix #290: TGA RLE decoding is broken
+
+We make it work only, for now. Actually, it doesn't make sense that
+`oTga::bitmap` is an `int *` as we're storing only bytes there. If this
+will be changed, we can even get rid of the `conversion_buffer` in
+`read_image_tga` altogether, and read the image data into the
+`decompression_buffer` (if RLE'd) or the `tga->bitmap` (if uncompressed)
+directly.
+
+Upstream-Status: Backport
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ src/gd_tga.c                   |  18 ++++++++++--------
+ tests/tga/CMakeLists.txt       |   1 +
+ tests/tga/Makemodule.am        |   8 ++++++--
+ tests/tga/tga_read.c           |  40 ++++++++++++++++++++++++++++++++++++++++
+ tests/tga/tga_read_rgb.png     | Bin 0 -> 2349 bytes
+ tests/tga/tga_read_rgb.tga     | Bin 0 -> 90444 bytes
+ tests/tga/tga_read_rgb_rle.tga | Bin 0 -> 9987 bytes
+ 7 files changed, 57 insertions(+), 10 deletions(-)
+ create mode 100644 tests/tga/tga_read.c
+ create mode 100644 tests/tga/tga_read_rgb.png
+ create mode 100644 tests/tga/tga_read_rgb.tga
+ create mode 100644 tests/tga/tga_read_rgb_rle.tga
+
+diff --git a/src/gd_tga.c b/src/gd_tga.c
+index ec6781f..8737b04 100644
+--- a/src/gd_tga.c
++++ b/src/gd_tga.c
+@@ -207,12 +207,13 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ {
+ 	int pixel_block_size = (tga->bits / 8);
+ 	int image_block_size = (tga->width * tga->height) * pixel_block_size;
+-	uint8_t* decompression_buffer = NULL;
++	int* decompression_buffer = NULL;
+ 	unsigned char* conversion_buffer = NULL;
+ 	int buffer_caret = 0;
+ 	int bitmap_caret = 0;
+ 	int i = 0;
+ 	int encoded_pixels;
++	int rle_size;
+ 
+ 	if(overflow2(tga->width, tga->height)) {
+ 		return -1;
+@@ -266,7 +267,7 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 		/*! \brief Read in RLE compressed RGB TGA
+ 		 *  Chunk load the pixel data from an RLE compressed RGB type TGA.
+ 		 */
+-		decompression_buffer = (uint8_t*) gdMalloc(image_block_size * sizeof(uint8_t));
++		decompression_buffer = (int*) gdMalloc(image_block_size * sizeof(int));
+ 		if (decompression_buffer == NULL) {
+ 			return -1;
+ 		}
+@@ -277,7 +278,8 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 			return -1;
+ 		}
+ 
+-		if (gdGetBuf(conversion_buffer, image_block_size, ctx) != image_block_size) {
++		rle_size = gdGetBuf(conversion_buffer, image_block_size, ctx);
++		if (rle_size <= 0) {
+ 			gdFree(conversion_buffer);
+ 			gdFree(decompression_buffer);
+ 			return -1;
+@@ -285,7 +287,7 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 
+ 		buffer_caret = 0;
+ 
+-		while( buffer_caret < image_block_size) {
++		while( buffer_caret < rle_size) {
+ 			decompression_buffer[buffer_caret] = (int)conversion_buffer[buffer_caret];
+ 			buffer_caret++;
+ 		}
+@@ -298,14 +300,14 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 				encoded_pixels = ( ( decompression_buffer[ buffer_caret ] & ~TGA_RLE_FLAG ) + 1 );
+ 				buffer_caret++;
+ 
+-				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) >= image_block_size) {
++				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size) {
+ 					gdFree( decompression_buffer );
+ 					gdFree( conversion_buffer );
+ 					return -1;
+ 				}
+ 
+ 				for (i = 0; i < encoded_pixels; i++) {
+-					memcpy(tga->bitmap + bitmap_caret, decompression_buffer + buffer_caret, pixel_block_size);
++					memcpy(tga->bitmap + bitmap_caret, decompression_buffer + buffer_caret, pixel_block_size * sizeof(int));
+ 					bitmap_caret += pixel_block_size;
+ 				}
+ 				buffer_caret += pixel_block_size;
+@@ -314,13 +316,13 @@ int read_image_tga( gdIOCtx *ctx, oTga *tga )
+ 				encoded_pixels = decompression_buffer[ buffer_caret ] + 1;
+ 				buffer_caret++;
+ 
+-				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) >= image_block_size) {
++				if ((bitmap_caret + (encoded_pixels * pixel_block_size)) > image_block_size) {
+ 					gdFree( decompression_buffer );
+ 					gdFree( conversion_buffer );
+ 					return -1;
+ 				}
+ 
+-				memcpy(tga->bitmap + bitmap_caret, decompression_buffer + buffer_caret, encoded_pixels * pixel_block_size);
++				memcpy(tga->bitmap + bitmap_caret, decompression_buffer + buffer_caret, encoded_pixels * pixel_block_size * sizeof(int));
+ 				bitmap_caret += (encoded_pixels * pixel_block_size);
+ 				buffer_caret += (encoded_pixels * pixel_block_size);
+ 			}
+diff --git a/tests/tga/CMakeLists.txt b/tests/tga/CMakeLists.txt
+index c3a589c..789fb14 100644
+--- a/tests/tga/CMakeLists.txt
++++ b/tests/tga/CMakeLists.txt
+@@ -5,6 +5,7 @@ LIST(APPEND TESTS_FILES
+ 	bug00247a
+ 	bug00248
+ 	bug00248a
++	tga_read
+ )
+ 
+ ADD_GD_TESTS()
+diff --git a/tests/tga/Makemodule.am b/tests/tga/Makemodule.am
+index dff828f..a1e6af6 100644
+--- a/tests/tga/Makemodule.am
++++ b/tests/tga/Makemodule.am
+@@ -4,7 +4,8 @@ libgd_test_programs += \
+ 	tga/bug00247a \
+ 	tga/bug00248 \
+ 	tga/bug00248a \
+-	tga/tga_null
++	tga/tga_null \
++	tga/tga_read
+ 
+ EXTRA_DIST += \
+ 	tga/CMakeLists.txt \
+@@ -12,4 +13,7 @@ EXTRA_DIST += \
+ 	tga/bug00247.tga \
+ 	tga/bug00247a.tga \
+ 	tga/bug00248.tga \
+-	tga/bug00248a.tga
++	tga/bug00248a.tga \
++	tga/tga_read_rgb.png \
++	tga/tga_read_rgb.tga \
++	tga/tga_read_rgb_rle.tga
+diff --git a/tests/tga/tga_read.c b/tests/tga/tga_read.c
+new file mode 100644
+index 0000000..310b72f
+--- /dev/null
++++ b/tests/tga/tga_read.c
+@@ -0,0 +1,40 @@
++/**
++ * Basic test case for reading TGA files.
++ */
++
++
++#include "gd.h"
++#include "gdtest.h"
++
++
++static void assert_equals(char *exp, char *orig);
++
++
++int main()
++{
++    assert_equals("tga_read_rgb.png", "tga_read_rgb.tga");
++    assert_equals("tga_read_rgb.png", "tga_read_rgb_rle.tga");
++
++    return gdNumFailures();
++}
++
++
++static void assert_equals(char *exp, char *orig)
++{
++    gdImagePtr im;
++    FILE *fp;
++    char *filename;
++
++    fp = gdTestFileOpen2("tga", orig);
++    gdTestAssertMsg(fp != NULL, "can't open %s", orig);
++
++    im = gdImageCreateFromTga(fp);
++    gdTestAssertMsg(im != NULL, "can't read %s", orig);
++    fclose(fp);
++
++    filename = gdTestFilePath2("tga", exp);
++    gdAssertImageEqualsToFile(filename, im);
++    gdFree(filename);
++
++    gdImageDestroy(im);
++}
+diff --git a/tests/tga/tga_read_rgb.png b/tests/tga/tga_read_rgb.png
+new file mode 100644
+index 0000000000000000000000000000000000000000..bc468e3d927eaeb77d2f5c3bc35b970457f60f18
+GIT binary patch
+literal 2349
+zcmZ`*c{tSX7XOaO7-6K6b&RD_MnXy$nHe#bsVG~TvfZ*vO?Jle8%ar+AySDfStFGh
+zG#*)pL0RUPJ(FedBaE?x-*o@D_deZwpZ7WMdCuo~-t)faoX_)~lW+lNCI*p(001C{
+zHOJWSbt_+Pfp_!w<m@>WzS`|-X@&uIeytaE1*v>QB*5J9HUNl9{Spw6`Sc(k6uyJC
+zHWeNNLm|3~tCo{U002|57?VrEU+1$sy;a&|;-kbZl`6E_C%>gqbDtC=57F3fUD$)k
+zSG5DTL6#NnU=7wGcCw|<f|{rZi)5q<cVW*NQPQCY0xPU0_nGG#D?wR37BO^o^261%
+z+}quQI_1ZP=gTNp-n|;#)z~^;78o=e@tRYrS#8Jc>M{W*OdYEgjJp6u9Rb7l#X%t`
+zun;^h28uEP=P3Px?|rNGF#17D%A(CJ_ar|?n^0nq!~w+Wg23867ryn!Zlb|~&7A~z
+zqkP=IPyLrOM?58>2rEq=&{*9OMU!HNWJkg`(`y(=2{WLg392OTDyiM2$iCLcv5LCG
+zjWwRq46Da$pV|V^4Gvs36k1dWF^V4c8j%3~jN{*0*$phpF|-#zi@;k@t-s?cqW&sd
+zPh{x~@zm`!5V23*L&Qb=_elN~nEEqQhrhNZiRU#|qjK>6ptaYgj*sAcuS+t-7X5aB
+zUI5f*aL0Dut+y0vde?tg7QMa^0`(plvuD^Q>)J(abQY>@6P_*YY;XJ54VC^_f7F2x
+z21ee^35}!<L@bW?<-JgJ-%sahFv68xPXghCl|CsCc-P-A{`kl_3By}Mq}YnYYmSt4
+z8h8mx?<zBgq9CzV4*#zR8t}x5Or8!9Rn6LgajJ!B)ebxEtrwC@*p4M@D51#?OEY}<
+zqJHu+sCRU2YXNxiq(DP@*(Ui?Jz;IQ@O$Lbf}e8Nwij*L&iUd$N4-Ykfp$vDx#uv?
+z#_eULpAbPvN<tVA>Ek##rQDAOW+@)2?%}XiiSi^ted1PQu{v0&?bA^r%z?7*An3_H
+zvYFv8{p8fsCguNR$#3=6O{^H&8kT9N92CeaRAj3Y_cNl-znY8JZ{MpO#OK}A<_w9J
+zWMI2Kl?xv|S-FTV(aUG_`UWTZOFJGgv2)>JR#*H2Uad(wyqbIZt?w|Dw|k<eY&&9F
+zcr!zDg7=#H^=^MC+W02GN{78K=4Kuq90c@$7f$7+h)^YFm}-?3cEdU+Ivh5RC<+Yy
+zOz(7r<tT|Z34S@glz^9lpp@OstDBGA(iwk<LQ#r@i_)^MV*Re3^qB#j7N}4etZfK>
+zt6<wtj&M2(TLgTh3AH(}4;f4j=<Iu^axvT0!8B)K0O!7g?WnhIyGH5@EtT77&?E{6
+zB5<#{PWJOxQkF}LskzI@;(qVCjE%v-h|S8;`k#h^W5wR-cadW2H2Mk+7QZhqSRd!M
+zcQ8fpx~O^(^O#2gXiWDX&u@lZT#qjPG~Xh0UobVq#~Lumf!%S9`Jhf%MH?4Re5-17
+z7BP>D>=sy59jEGoeEx_W13BnmhAs?*j6#bG1a@#16O~1>q+P2@%QN~``Ws7=WX;F9
+z`=p5I$1ig*G|iW8vslr2^8hj+A0HWDoT-@fn5I53ZWWp!r8fMghmpjdqC%E#%2HFI
+zY&A(g!Li3+$<B^y8^Hw5!sXd&k%Ev!a;~aB#joj1?2ntu9|!GAFUwyc0oe_~y<}?E
+zUh@HUbCI(x2W1rmg7ckzRL2Ew#cdujut+*-t0g)81Tu+3ZH4uP`r1d1kSooU@5ybL
+zR5_J%A5sbak)KrSf>(r|V*&yCb;Ha(&ACi9w;?kQ7q1$hwjli^);+KIJAh|K&YL#E
+z+b(`PZN>V_5?v`hu-U429K9fO%8*k8pE=jDkn5ZJK|Vgl*@&QE^;mwlCxWbq4(hyi
+zUuz)bk@5^HOk@gB`SaWZfX07Eom07js%np8Xot&?YP8R+3|jrR4c#zO{LO<?^G84O
+zoP}G`MK)LZDo_$#nWR09X>NY_mL~1^BUG})*4b;Z_zq+`Q@kzUHC&`trCiQYum;1?
+zBic+0Bl>LLYU?>!B3k!Ils}uXR*`OEr3`f<P@HZFk`0fP5`^X=BOtC?@!vUq7B4OF
+zZEw6+3eoFRE@xEw(%DfIybhJuo03Du2ldm$20Sn3hj15Lu&gPQp=N%r%hME$*j{^@
+zRTffQhH7JLB-70qVkSm$9Zt`mahHLT7O^JnNqAAJs0C^n+1uj_E-}S^?&_U=H?;D_
+z1U9UJAz|+7z|Yq(6${A~5fhc}hH5twnKukf#Dn_JnQ$J4-Z$d}*Trq>?aKr2p19c6
+zYJ}r+^s>6aD~mrp;oIUhlig4sM)Jg3=J{K;dp#BCzRu1sU3D1wJl{jA^Y#ShVT+|^
+zUyjiM&wD~v3zy}K!zWm%3cpu#(*)cmxw1+n+C7V|hcZ6h8CZLubXt&J)h$6yflV6>
+zOVv_gDb*glO9FLL8x6bqM6(F#pGhGy+jjOyt9-daMWGrJKF{XvnT#^TeYaq2MG)qw
+zJ=RV;Mwg*goOa?(wM=EH<#AS$egRj*wnm+Bu4Pb{$-O}GZSiuT1UdBDwv2Rz)b3+L
+zRA=nkaWHB7I$T~B%;KynnS0b@3YpKqt$2;qzwLf>DZ4RFCQB!=QQ`Ft&y_PThuDsA
+zckawmbFnA9Tl7+Ez%a)>>T+Nh@8UxzrZP`<pHEXVd#|2v=f_b#A@|oAzbk6Q_>|O)
+zgw?Xli!)-)xrF2z=thH-TI;|>UVYK64@asT%484CF-pjk+~~wA+Z%fZYua+sDJ<Nf
+zfO`bfl}ig_0&C7BCuBa)xZ?-mQO=bQ2N5;>Sw}~|(tM}hK+z>+^8QQhOsTxl+2AJ+
+zX8WjlS|;0WRv7s_Bk=@u$v3GL@qC?&jcNEv<o68kaz!pHOs@;#CSh|{!j&zrsfn8j
+z6|o#^6C2NO9!G&u;Q0U5hkpCs|2Z3I$nNY~x}Tl<rOB|1KiB|RQyiuYbv@>9Cook&
+
+literal 0
+HcmV?d00001
+
+diff --git a/tests/tga/tga_read_rgb.tga b/tests/tga/tga_read_rgb.tga
+new file mode 100644
+index 0000000000000000000000000000000000000000..5f11f5a080f3424dff6ff368db6af140a5777e23
+GIT binary patch
+literal 90444
+zcmeI4Kab?b5yc6Af(;c(13`fU*%&xb;tQC_*aPhI`Y#kR+DO4FyO7x>23DD|fPu*!
+zc$3RVz$FeASlIpmlR7c>{0XS{cwI!Xhn!*0&G0z9w?L_y)m6=&?%yLhCt|YfC)vBd
+z@3Mbp-(`!RR#lbBv<6~842S_SAO^&M7!U(uKn#chF(3xSfEW-1Vn7Ut0Wly3#DEwO
+z17bi7hygJm2E>3E5CdYM&A?}$ex4m_TFdrYYCYz+9zh#Fz&|9|x2zKn^W#B#+TPQk
+zkGJqug1wSH+UqE;=D8ly$2|8{dOgm*N*~8rNAWn%b(B8lxv$dearRaEIL<nX$9b-!
+z^fAwUm0pjtuhPeH)=@mpa~-9RdG4$9dYpZgK8~}F;&GnqD1FRxU!~XM?5p%~oOKkB
+z^IXTEkMH5{66|-Z6BF}fVs88T*I)i3JJhoOSJ|O9w{_I#nWx?l)duSh)duUtlh$At
+z17Cjm-|T(t=^t5ksQGyXeY}RR66}rB$6N4TCD<$JL)!2RcC~{xmhcaW#u{p)fITEy
+zttmer=|ik~9;VU``gjIkB^qnU`Ab-pXwrv%OZ+UJZKV%gx2JNgp5i>D59woyTux<9
+z(uedh6&9yB59vetm?D=`nUnM(eN2VLDb7RskUpl!<y7V*eMlcuVR4G{kUpf3DRMcL
+zIY}SV$5dFH;yfm%k4wB~a-Co=-1}Dr-lw`wu&?y~m97o@G#T{q3H)`Uv4-!7EMeD)
+zw)K9=Z~mTThuUAV|7C~TzV%W6$E~45nY6k?xn!MZFO2s+{6m8MjdfuTKfpgE*thW<
+z{Cw2@xOHLsAGrJk{yNcELpGPN>qM)WwmHy;dAx?N66{Tw1IK#{s}k%La$6ep^HE#+
+za9lo1VAA+y4Y_=oz@+gjedzt&v$!^qahUWWUeAKpvG42Bhn^$GX6~HMCw)jC=fvyS
+zbCo`%kFl9Mr}If4(#JXRI`&+p59woU=FaJS(ueeMPP~piSLs9g7@N6sI-m3*eVh}o
+zW6yPB`q2AV`u~)Z`u~(cA78-VB^qn^p2#KaF44B$FA47vAM{(Ncz3vdANUYI_Vq~T
+zJFok7_+8Hr{@dw6AD4;m*uMzx*i#=x;yd<VQBUIaym%dZzk)u#fWJ#L*6_E}FJX6y
+zR{!R@|ExhDui;aE=k$%!$6N58@;j%mqz`GsGuYJ*`gjJP^1JEGWequh2}}9ibmmGQ
+z`krwX_ipJ!*U+x(reg27kUpdjX`!D1>7##b#EsTQ`Va%U4)il1ee|!5xY623A7Vh)
+zfqn+0kN&k0H(DF%Lk#FT(9eMM(Z4q0Mr$K|hyh&(`Wcv*KJ@;s-aDDpdnZ93Q+a<^
+z`j9>*rH}Wyw|@5N=h^$%`<z>~{m%qin`x{~&_)6OkZ858w2#x+NA1ID_95uwC47}=
+zz52*T_`_V+ZoXxF%76dsKew<oecZR}82QUk$J(XkqFq?rVsrM=+dI91F>*dfeUR^p
+zOs8;+{5;gLHn&=|ON(1<&R+VEKDzjZ2Kw$F(#J>m?+&_ubg5)Jru)Zfp6{oApOQYd
+zwa^ujKBNz5CFMK%pzr4xvxIHj*iUG$U^$H6v1y&(p%Guen9G_f*dx5vTC9wj2G56n
+z|5yYq@Of%s<Hq`6AI$y@fakh_U0A;Ni03elS1=yhthu+C<>UB*F_<5lxjeqIJnut3
+z$IoG`U%^;I&v~(rw(xbnjlQMNoBDNqtoebp40e+5=NOml8^f{p%x`^%M%@zTb9U92
+zey`caUXzcCKJMFfjC?Z2I$CbIXp=9ClcgtjY;nf67)H!$*JzV-%cp;I=eWXg*SM{G
+z<g|2%V~)!lp64;Nt>)excV35he&noN-o;q_P5nGz@Fe=cxFsxRdfmf(i(%wkbmVOi
+z<GmvulgFhoW*&QO%(TX~{yvYo+;Ngy9%9Bgxif~z9^;-Z_AjlDKIHhib%?RP2szXo
+zb1ZKaayY(coc$}-*dLD9FsrNkam>0$*aBw#8>@*ua-LwUy=ULlxgBeMVC(4mz?d=L
+z_l$AfL*EMCbKYVYeX+I**76U1IV`@fly#^3k7J@WwoB=3qAm}dkd@q$&?aw;nHAPY
+zkGSW%b<U`^)n{WM$234rTl(r4|H<k?-x@VGuhRF0{=)U=9sRs-S^X9J$Kr45=K*VE
+z?x@dK7_WdC|75w=hTj*&HZG^d4C4MiQTjTz(eKCSdA4$}-^NU9?0BsB7<EJRv5M<>
+zjM~z1wy>NiUh`*t=0grOa$~XBqwf(`bL{&Nv(L)Dt+i$hM%}T0Ywn2gyzFaqH+62u
+znjhFYg+6XEuIZ!mnU_qvoEF0_&M_9A1#2Vj?;)kd&10{Pnbz3W-{(;`L?3xqJ!<_u
+zq|pK5ox157qc4Ur$oM{eY<ASIP~Xx3bHlid(;DrJ#oyG=1J0<AOW0kav99wzjQAR6
+z`Y5~h4E?#wX&8>;RaY%z$lG}i?DabAc{6t3SU!%Lz54L^aXXxotd-Wsw#6;B%OjUM
+zD?;50zR?BR9J{qHINtkNk>fv?*DlXfkI5XH*VMTkYkuIY=KN6KHP49M!q(h-<VYWW
+zLC^-DH?WQ4)wtdAz7+ZEP_y$|;Kr`MgL4d5yYXXo?W<x{=lvjcT_Syye%-B&oGX~!
+zW14-9bW>S=?Dw6+?RztJJVw_s>il&!w;aSvSk0-$y1eBu-};Bt`kXMv2A<sC!l)bG
+zQ%nb~b#d{XpA~t{XF&S`wt&^23BL6loVw@AAFds+>%V`jj1%vpoYuag&vZk-^mW!o
+z{6l{K=$sQ6J4jooBdbp^vdU+vg?&!%Lto8v6gS<p*3sv%&2eF-hXQTt&W>B3NxTo|
+zJ$0?XuD>^IF^>ND-+x>CivCBKX=F=Z==0BJ%qu%s7{p9R-CoAQ)Ykbp4&p1v+l7tI
+ze2ZJmd-QdlGs;=m81zx!;LnQM`!EhYwMczD`tjIK-E-v+*Av$l%x)axyw+1Q)CIlg
+zpM1yqC=fG!(BE)O{-I56_<INY%evG32YWu48COQeJ6T1%gpnoM6RdT;#c>h(*uRR#
+zY-)Yn+8oQ(mKHZ3`i<p!4%SDH{&lEtt)tJeHuC&D>#-1P*4OgH`*7Y<*NSTlW~l?u
+z_^$TWzM?kP5H+#s8MCx~HSd@q%j9RD)x0AwhZ#4y8?Rv;{hN@pf@l0b9J7w+TUZ@E
+zj+<H^_ig0Zm>gprYP!Z|KdsSc$gk`Cn0;;JbB;C+{UXjy-E-v+*ORR^SdQ-lUL&6M
+zE`2O_=z-(-dq`>LH1C-49PDc6tVLb!*r{V7-Y|}SUhiYZIQE8p%=dqYHMKtO+pL3i
+zjmdEt=NMNo`wWHEBeo9lt#z~<?~%K5<8;=D_u;&!u9e>laJ+!s!q&m=;i;P(W_sz|
+zBlPomtc10+gk#qFF$;fAwz2;Oj7$x+MW|c2nmQKZxy4=HEn;Mob_2U$U;Kx7t2XYp
+zW90GN9LL7I568{8;kbmqa&-lc87nNd%d-|%1?#Ly-E-v+*Av(!|E7m#AN`)8pWK^1
+zntzY?IclF~1)z(S(?_E{e>U+xocGkVirDA1zqJQA=ChN3KDzOHqxR`m0J^w<*>l{g
+z?@XzCuKeM83jEu>fu366a~1CyYgpX3=-Vg7kFx^M1fQvL7@yhf*{XNl#rtsHQ`d?+
+z3Jt6x9e7RncENo8opuGF3A<;QHd_C`JU)Bso-2R2o@}k54}K5X^yq~5lcnX#pLPYH
+z5BttRos|2|Cf<khp1M}?+Cv8mSnjO#eI(A;@rPf5)IC@J>GY(v)!K>yF(3xSfEW-1
+zVn7Ut0Wly3#DEwO17bi7hygJm2E>3E5CdXB42S_SAO^&M7!U(uKn#chF(3xSfEW-1
+pVn7Ut0Wly3rpJK2`Txh?|LN;LKmWt?-@f?SH@|xR>#u*F{Rp+*(8>S+
+
+literal 0
+HcmV?d00001
+
+diff --git a/tests/tga/tga_read_rgb_rle.tga b/tests/tga/tga_read_rgb_rle.tga
+new file mode 100644
+index 0000000000000000000000000000000000000000..ce845ad0c3da65205af25854d64568b1cf0921e3
+GIT binary patch
+literal 9987
+zcmeI2J!~9R5Xbk<L5NgWrh*l6K@rf2A`LFK334O|$EPT_a+TuJx!kjzIGiJ2I<P>x
+ziiRRbk%9(oq!dtCIspYA&6UugGcC>X|IOQdZ+$+;#>5ek&eFVnJ3DVa{%>aX?a5Je
+zF>-%5qwk}eQT$4wzvw%Lr!o5$L%T1%_;U0&GrMhYD|*=1u+QBMI7bBz5GWAXUI?5o
+z4)=h152)YuP~W$``}B?1quuDQ!tKvI-d*GdmoNVj?N0AU(FV5-mWdwpH55x49>GD6
+z=%BBmXlU4mV>@qJ8fX!<cQoubnZc3TbVtK}?@1Y0!9an5mD0dE28xA&sM>=CL?@={
+z0-|RLqE&j)8olUxtrw;AqBVNamHEBs60Ks5R&l9p6>VC@T4)u!Z+{g<yLY2MYn^Q1
+zd9ELFE4tU$u)n0?3plJ1J?v}PZ)msyr`8V<5?$KSu-0S-M?&o#4QoBb4;grXfdT`M
+zN=c*-Fi>D%n-xb5tYDzPz)HDn9RtO}K-2&bfLTDa$ReF=%5-@43+;@(Xqh_Lqg5;e
+zg}THltzs{<ie37oodrXq8PIa=9O>E>BBIs4hP5RP*Wqxy6Qz9`Y(v8pI6+HwtX$ra
+zy1k}`<+7Ep?x=h3^=RRT3_QR<fq_Rg0|yu=Ft9z}zzPNm46Kv})-g~l4EUq{0-{A0
+z@uf#ui57)+Y^yj$Kb#Ty+&-!K64#`N?AC_rx07^75BGbIkyuBfFo`X6d}cobiI>AG
+z_yH!{gxCD>ho1(boNM2tG;8-@MK-H=sqwzy_Dk<p<<Y;ghphqw-d=+40((iXvX>d}
+zeC*AO?;PyiJI7egrh5aA*tASEv0P|sHWdv;37nkl7;GWQvslElsh1w>E)mVkrK5Wr
+zvyT~j8_(=*6BF=71Iw<4W?fOstUs?=BFaQ*Da#xiBX|}K8QkJdG}zFPqlKLAcr83*
+zWg<d$C_)R@Zt(9GMk4VnKb+4e=emmuJZ@>Q+HzQdV{TOj;%(7%jzp+KJSs$|sS9Fk
+zi>8|_;%+MHn6)L%h}LxJYN%Lsjm=l2JEG}rgt!}vT81WTD?iXN22oo(>Q%FW$7$$!
+zt&?$T0IopDHZ|A}nmLfzok8W3vju;nlA35T-r~-!Mh%-@xp^A6E=V4LfMg^hw4o2J
+zZI)js`N&kV*g%#wDTZ~m<nWLi1ePizuWxAjE=soYvC=mb&tTOxu05X^q<~*Zj<9wL
+zP=$-ZWz~5>cOy6~E}sky$N;c`=y|Ej2+1ZQ2f9i4w?h@e2{8NMT~!94nB@itGuLH}
+zXVpo_fLn+Ny=`_6ub%qVxz9IOHOQr&m-w|E<2CfOb2=CaIW-6=RoY?8DbvigNhHcJ
+zG#i_20Ls>TP|sG<1T!>Hm<6C_+a^z4YoiJ>5de05QI0M6IheVSK%5>}CEC#MwBHBI
+ziIa1Wpa&iZ_r@?tJkJ5<afw}YS{54Q*|ADIR<0rq7ju0Ezq{lB$w1gObbznQZdZVC
+zC{fEsk6_CHMd|PuWL7zD?Gbil$1PB(y&Zkn_I|ZCmODo!ml!;5_YN=f8&f%XLJ69i
+zw+YreoXy~Iho>|{-W{nZBP!8&Q$t}P*I~(hRwZ6%$Lp+>-V88<W1vX?KTsG@4Mp7*
+zP43JO--G~U!gJBc0<A+dG0?19zUEwf+}?LWRX6~j_TKxg%r*$-xiTt}Yajv!vcmP)
+zqnTh(gvtWBmMHdlF_;5HXb)v)Q_z7o(;nJBIi5s&D7DGOkh+Oa-OSuJgOmf2R1I-V
+zRL&L6j_DV<hr<B?9Mn_S!{H7Uhx4N2TcLZ}5FFv{ZJA>rG8_ARaUB|->lMt--ZnEI
+zTJ7{U4;S{j2Ay9PTlySLkZpPkSyjD9xB@11Gqz?H&}bm6INZyXa|<usjtD%sjy+Z`
+zO^{AKuWKHIUn2Ss=N8*9c5f<jyF%cp-^Zcb5%Fp{gGhMmxXnNb1>}y*$KYeSt=BT^
+z9)n8f69who6DC3I4i6#*smWsw#8aACPLFDXvaYploY`rTzv^v6%`=fZ=~tM<Gx7U2
+zGVu^u%W!94&zt&L+f3G5W^S(`9GhA$F^gxQaDFP%)PFP84q_$@7HzQb60>~+#d%*t
+zf%)V_G>Dlk3}01X6V9YA0}KH#x+MuyPXYm7$4BlC*YhI}#g|)Uh0-v*i7ggcv&@^C
+zjYO%ac80KpJfmhZkwXX$pH_*;t&cQIT_(xF6ht!Iic3UdT(%7ihfT|wtXWA&V1Sf;
+zU3WEU`G(*m{rfc5Lu-SUf;0gW_gTQ5!wKEEk(Qj)=S2;}8FVa^9uYEg=U`?TJS&;e
+zZ|IGrGhpnT4H$<N0L>R>%fn7eg+%K9in1ezX3K%Y`r6i<mRK!fyE0L3T&%#2e?}WI
+zcSMQE6&v2hGddfHYR&MD28%5H1s1ZQZU%;X@Wf!oTq<&1f;-%4`%tL#0yUz{`gTy@
+x8%~Vp2_Ce5$E=Cyg!2^tf$X%_aF4$a-uv+CN7vrJ_RjTJKYsJtTUTF;{sH~|7$pDz
+
+literal 0
+HcmV?d00001
+
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd_2.2.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd_2.2.3.bb
index c5aff66..5621706 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd_2.2.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gd/gd_2.2.3.bb
@@ -13,7 +13,14 @@
 DEPENDS = "freetype libpng jpeg zlib tiff"
 
 SRC_URI = "git://github.com/libgd/libgd.git;branch=GD-2.2 \
-           file://fix-gcc-unused-functions.patch"
+           file://fix-gcc-unused-functions.patch \
+           file://CVE-2016-10166.patch \
+           file://CVE-2016-10167.patch \
+           file://CVE-2016-10168.patch \
+           file://.gitignore-the-new-test-case.patch \
+           file://Fix-290-TGA-RLE-decoding-is-broken.patch;apply=no \
+           file://CVE-2016-6906-1.patch;apply=no \
+           file://CVE-2016-6906-2.patch;apply=no"
 
 SRCREV = "46ceef5970bf3a847ff61d1bdde7501d66c11d0c"
 
@@ -32,6 +39,19 @@
 
 EXTRA_OEMAKE = 'LDFLAGS="${LDFLAGS}"'
 
+do_git_apply () {
+       cd ${S}
+       if [ ! -f tests/tga/tga_read_rgb.png ]; then
+               git apply ${S}/../Fix-290-TGA-RLE-decoding-is-broken.patch
+               git apply ${S}/../CVE-2016-6906-1.patch
+               git apply ${S}/../CVE-2016-6906-2.patch
+       fi
+}
+
+do_patch_append() {
+    bb.build.exec_func('do_git_apply', d)
+}
+
 do_install_append() {
     # cleanup buildpaths from gdlib.pc
     sed -i -e 's#${STAGING_DIR_HOST}##g' ${D}${libdir}/pkgconfig/gdlib.pc
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.1.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.1.2.bb
deleted file mode 100644
index da82599..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.1.2.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-DESCRIPTION = "The gflags package contains a C++ library that implements commandline flags processing. It includes built-in support for standard types such as string and the ability to define flags in the source file in which they are used"
-
-HOMEPAGE = "https://github.com/gflags/gflags"
-
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://COPYING.txt;md5=c80d1a3b623f72bb85a4c75b556551df"
-
-SRC_URI = "https://github.com/gflags/gflags/archive/v${PV}.tar.gz"
-SRC_URI[md5sum] = "ac432de923f9de1e9780b5254884599f"
-SRC_URI[sha256sum] = "d8331bd0f7367c8afd5fcb5f5e85e96868a00fd24b7276fa5fcee1e5575c2662"
-S = "${WORKDIR}/${PN}-${PV}/"
-
-FILES_${PN}-dev += "${libdir}/cmake"
-
-inherit cmake
-
-EXTRA_OECMAKE="-DBUILD_SHARED_LIBS=ON"
-
-PACKAGES =+ "${PN}-bash-completion"
-FILES_${PN}-bash-completion += "${bindir}/gflags_completions.sh"
-RDEPENDS_${PN}-bash-completion = "bash-completion"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.2.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.2.0.bb
new file mode 100644
index 0000000..0e85b3f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gflags/gflags_2.2.0.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "The gflags package contains a C++ library that implements commandline flags processing. It includes built-in support for standard types such as string and the ability to define flags in the source file in which they are used"
+
+HOMEPAGE = "https://github.com/gflags/gflags"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=c80d1a3b623f72bb85a4c75b556551df"
+
+SRC_URI = "git://github.com/gflags/gflags.git"
+SRCREV = "f8a0efe03aa69b3336d8e228b37d4ccb17324b88"
+
+S = "${WORKDIR}/git"
+
+FILES_${PN}-dev += "${libdir}/cmake"
+
+inherit cmake
+
+EXTRA_OECMAKE="-DBUILD_SHARED_LIBS=ON -DREGISTER_INSTALL_PREFIX=OFF -DLIB_INSTALL_DIR=${baselib}"
+
+PACKAGES =+ "${PN}-bash-completion"
+FILES_${PN}-bash-completion += "${bindir}/gflags_completions.sh"
+RDEPENDS_${PN}-bash-completion = "bash bash-completion"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gnulib/gnulib_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gnulib/gnulib_git.bb
index 5b2ed49..c7c7ae8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gnulib/gnulib_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gnulib/gnulib_git.bb
@@ -12,8 +12,11 @@
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=e4cf3810f33a067ea7ccd2cd889fed21"
 SRCREV = "b6b3ed1fa4c6de12908a9f01d1689f156c3cd441"
+PV = "0.1.496+git${SRCPV}"
+
 SRC_URI = "git://git.sv.gnu.org/gnulib;protocol=git \
 "
+
 S = "${WORKDIR}/git"
 
 do_install () {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch
new file mode 100644
index 0000000..27f855d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Fix-build-failure-for-ppc.patch
@@ -0,0 +1,28 @@
+Subject: Fix build failure for ppc
+
+Upstream-Status: Pending
+
+Fix the following build failure.
+
+  error: 'siginfo_t' does not name a type
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/stacktrace_powerpc-linux-inl.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/stacktrace_powerpc-linux-inl.h b/src/stacktrace_powerpc-linux-inl.h
+index 5d16fa1..a9bf775 100644
+--- a/src/stacktrace_powerpc-linux-inl.h
++++ b/src/stacktrace_powerpc-linux-inl.h
+@@ -44,6 +44,7 @@
+ 
+ #include <stdint.h>   // for uintptr_t
+ #include <stdlib.h>   // for NULL
++#include <signal.h>   // for siginfo_t
+ #include <gperftools/stacktrace.h>
+ #include <base/vdso_support.h>
+ 
+-- 
+2.8.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Support-Atomic-ops-on-clang.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Support-Atomic-ops-on-clang.patch
new file mode 100644
index 0000000..e582c0d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Support-Atomic-ops-on-clang.patch
@@ -0,0 +1,33 @@
+From ea9f64eb2cdf3be6c4dc65fa1472d854616e43ca Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Mar 2017 13:38:46 -0800
+Subject: [PATCH] Support Atomic ops on clang
+
+clang pretends to be gcc 4.2 which is a lie
+it actually supports a lot more features then
+gcc 4.2, here it depends on gcc 4.7 to enable
+the atomics and fails for clang
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/base/atomicops.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/base/atomicops.h b/src/base/atomicops.h
+index be038f3..f1a21ff 100644
+--- a/src/base/atomicops.h
++++ b/src/base/atomicops.h
+@@ -118,7 +118,7 @@
+ #include "base/atomicops-internals-linuxppc.h"
+ #elif defined(__GNUC__) && defined(__mips__)
+ #include "base/atomicops-internals-mips.h"
+-#elif defined(__GNUC__) && GCC_VERSION >= 40700
++#elif defined(__GNUC__) && GCC_VERSION >= 40700 || defined(__clang__)
+ #include "base/atomicops-internals-gcc.h"
+ #else
+ #error You need to implement atomic operations for this architecture
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Use-ucontext_t-instead-of-struct-ucontext.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Use-ucontext_t-instead-of-struct-ucontext.patch
new file mode 100644
index 0000000..5bd0b6f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools/0001-Use-ucontext_t-instead-of-struct-ucontext.patch
@@ -0,0 +1,36 @@
+From 12ac0dc6742e1bcdfaf1842186c9002f0820a5e8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 1 Jul 2017 13:21:21 -0700
+Subject: [PATCH] Use ucontext_t instead of struct ucontext
+
+Newer glibc has dropped the ucontext tag from exposing
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/stacktrace_powerpc-linux-inl.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/stacktrace_powerpc-linux-inl.h b/src/stacktrace_powerpc-linux-inl.h
+index a9bf775..47ff2d7 100644
+--- a/src/stacktrace_powerpc-linux-inl.h
++++ b/src/stacktrace_powerpc-linux-inl.h
+@@ -53,7 +53,6 @@
+ #elif defined(HAVE_UCONTEXT_H)
+ #include <ucontext.h>  // for ucontext_t
+ #endif
+-typedef ucontext ucontext_t;
+ 
+ // PowerPC64 Little Endian follows BE wrt. backchain, condition register,
+ // and LR save area, so no need to adjust the reading struct.
+@@ -202,7 +201,7 @@ static int GET_STACK_TRACE_OR_FRAMES {
+         struct rt_signal_frame_32 {
+           char dummy[64 + 16];
+           siginfo_t info;
+-          struct ucontext uc;
++          ucontext_t uc;
+           // We don't care about the rest, since IP value is at 'uc' field.A
+         } *sigframe = reinterpret_cast<rt_signal_frame_32*>(current);
+         result[n] = (void*) sigframe->uc.uc_mcontext.uc_regs->gregs[PT_NIP];
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb
index 2e4479c..43780a5 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gperftools/gperftools_2.5.bb
@@ -4,7 +4,11 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a"
 DEPENDS = "libunwind"
 
-SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/gperftools/gperftools-2.5.tar.gz/aa1eaf95dbe2c9828d0bd3a00f770f50/gperftools-2.5.tar.gz"
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/gperftools/gperftools-2.5.tar.gz/aa1eaf95dbe2c9828d0bd3a00f770f50/gperftools-2.5.tar.gz \
+           file://0001-Support-Atomic-ops-on-clang.patch \
+           file://0001-Fix-build-failure-for-ppc.patch \
+           file://0001-Use-ucontext_t-instead-of-struct-ucontext.patch \
+           "
 
 SRC_URI[md5sum] = "aa1eaf95dbe2c9828d0bd3a00f770f50"
 SRC_URI[sha256sum] = "6fa2748f1acdf44d750253e160cf6e2e72571329b42e563b455bde09e9e85173"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/eglibc-2.17.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/eglibc-2.17.patch
deleted file mode 100644
index e43bdcb..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/eglibc-2.17.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Upstream-Status: pending
-
---- gpm-1.99.7.orig/src/daemon/open_console.c	2008-07-24 12:33:05.000000000 +0200
-+++ gpm-1.99.7/src/daemon/open_console.c	2013-01-10 12:39:47.975461947 +0100
-@@ -23,6 +23,7 @@
- #include <fcntl.h>              /* open and co.  */
- #include <sys/stat.h>           /* stat() */
- #include <sys/ioctl.h>          /* ioctl() */
-+#include <sys/types.h>          /* major() */
- 
- /* Linux specific (to be outsourced in gpm2 */
- #include <linux/serial.h>       /* for serial console check */
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/no-docs.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/no-docs.patch
deleted file mode 100644
index f10217a..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/no-docs.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#
-# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
-#
-
-Index: gpm-1.99.7/Makefile.in
-===================================================================
---- gpm-1.99.7.orig/Makefile.in	2008-07-24 03:36:35.000000000 -0700
-+++ gpm-1.99.7/Makefile.in	2010-06-22 18:28:45.269507001 -0700
-@@ -19,7 +19,7 @@
- # user-overridable flags, but it's also all the implicit rule looks at.
- # missing ?
- 
--SUBDIRS = src doc contrib gpm2
-+SUBDIRS = src
- 
- 
- ### simple, but effective rules
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/remove_nested_functions.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/remove_nested_functions.patch
deleted file mode 100644
index d2d6cb8..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/remove_nested_functions.patch
+++ /dev/null
@@ -1,326 +0,0 @@
-Remove nested functions, they are not available in all compilers
-e.g. clang will not support them.
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Index: gpm-1.99.7/src/drivers/summa/i.c
-===================================================================
---- gpm-1.99.7.orig/src/drivers/summa/i.c
-+++ gpm-1.99.7/src/drivers/summa/i.c
-@@ -36,6 +36,28 @@ extern int summamaxy;
- 
- extern signed char summaid;
- 
-+static void resetsumma(int fd)
-+{
-+   write(fd, 0, 1);          /* Reset */
-+   usleep(400000);           /* wait */
-+}
-+
-+static int waitsumma(int fd)
-+{
-+   struct timeval timeout;
-+
-+   fd_set readfds;
-+
-+   int err;
-+
-+   FD_ZERO(&readfds);
-+   FD_SET(fd, &readfds);
-+   timeout.tv_sec = 0;
-+   timeout.tv_usec = 200000;
-+   err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
-+   return (err);
-+}
-+
- Gpm_Type *I_summa(int fd, unsigned short flags, struct Gpm_Type *type, int argc,
-                   char **argv)
- {
-@@ -43,24 +65,6 @@ Gpm_Type *I_summa(int fd, unsigned short
-    flags = argc = 0;            /* FIXME: 1.99.13 */
-    argv = NULL;
- 
--   void resetsumma() {
--      write(fd, 0, 1);          /* Reset */
--      usleep(400000);           /* wait */
--   }
--   int waitsumma() {
--      struct timeval timeout;
--
--      fd_set readfds;
--
--      int err;
--
--      FD_ZERO(&readfds);
--      FD_SET(fd, &readfds);
--      timeout.tv_sec = 0;
--      timeout.tv_usec = 200000;
--      err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
--      return (err);
--   }
-    int err;
- 
-    char buffer[255];
-@@ -91,7 +95,7 @@ Gpm_Type *I_summa(int fd, unsigned short
-     */
-    setspeed(fd, 1200, 9600, 1,
-             B9600 | CS8 | CREAD | CLOCAL | HUPCL | PARENB | PARODD);
--   resetsumma();
-+   resetsumma(fd);
- 
-    write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE));
- 
-@@ -103,7 +107,7 @@ Gpm_Type *I_summa(int fd, unsigned short
-        * read the Summa Firm-ID 
-        */
-       write(fd, SS_FIRMID, strlen(SS_FIRMID));
--      err = waitsumma();
-+      err = waitsumma(fd);
-       if(!((err == -1) || (!err))) {
-          summaid = 10;          /* Original Summagraphics */
-          read(fd, buffer, 255); /* Read Firm-ID */
-@@ -111,14 +115,14 @@ Gpm_Type *I_summa(int fd, unsigned short
-    }
- 
-    if(summaid < 0) {            /* Genius-test */
--      resetsumma();
-+      resetsumma(fd);
-       write(fd, GEN_MMSERIES, 1);
-       write(fd, &GEN_MODELL, 1);        /* Read modell */
--      err = waitsumma();
-+      err = waitsumma(fd);
-       if(!((err == -1) || (!err))) {    /* read Genius-ID */
--         err = waitsumma();
-+         err = waitsumma(fd);
-          if(!((err == -1) || (!err))) {
--            err = waitsumma();
-+            err = waitsumma(fd);
-             if(!((err == -1) || (!err))) {
-                read(fd, &config, 1);
-                summaid = (config[0] & 224) >> 5;        /* genius tablet-id
-@@ -135,14 +139,14 @@ Gpm_Type *I_summa(int fd, unsigned short
-     * unknown tablet ?
-     */
-    if((summaid < 0) || (summaid == 11)) {
--      resetsumma();
-+      resetsumma(fd);
-       write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3);
-    }
- 
-    /*
-     * read tablet size 
-     */
--   err = waitsumma();
-+   err = waitsumma(fd);
-    if(!((err == -1) || (!err)))
-       read(fd, buffer, sizeof(buffer));
-    write(fd, SS_READCONFIG, 1);
-Index: gpm-1.99.7/src/drivers/wacom/i.c
-===================================================================
---- gpm-1.99.7.orig/src/drivers/wacom/i.c
-+++ gpm-1.99.7/src/drivers/wacom/i.c
-@@ -30,10 +30,6 @@
- #include "message.h"            /* gpm_report */
- #include "wacom.h"              /* wacom */
- 
--Gpm_Type *I_wacom(int fd, unsigned short flags, struct Gpm_Type *type, int argc,
--                  char **argv)
--{
--
- /* wacom graphire tablet */
- #define UD_RESETBAUD     "\r$"  /* reset baud rate to default (wacom V) */
-    /*
-@@ -45,83 +41,91 @@ Gpm_Type *I_wacom(int fd, unsigned short
- #define UD_COORD         "~C\r" /* Request max coordinates */
- #define UD_STOP          "\nSP\r"       /* stop sending coordinates */
- 
--   flags = 0;                   /* FIXME: 1.99.13 */
- 
--   void reset_wacom() {
--      /*
--       * Init Wacom communication; this is modified from xf86Wacom.so module 
--       */
--      /*
--       * Set speed to 19200 
--       */
--      setspeed(fd, 1200, 19200, 0, B19200 | CS8 | CREAD | CLOCAL | HUPCL);
--      /*
--       * Send Reset Baudrate Command 
--       */
--      write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD));
--      usleep(250000);
--      /*
--       * Send Reset Command 
--       */
--      write(fd, UD_RESET, strlen(UD_RESET));
--      usleep(75000);
--      /*
--       * Set speed to 9600bps 
--       */
--      setspeed(fd, 1200, 9600, 0, B9600 | CS8 | CREAD | CLOCAL | HUPCL);
--      /*
--       * Send Reset Command 
--       */
--      write(fd, UD_RESET, strlen(UD_RESET));
--      usleep(250000);
--      write(fd, UD_STOP, strlen(UD_STOP));
--      usleep(100000);
--   }
-+static void reset_wacom(int fd)
-+{
-+   /*
-+    * Init Wacom communication; this is modified from xf86Wacom.so module 
-+    */
-+   /*
-+    * Set speed to 19200 
-+    */
-+   setspeed(fd, 1200, 19200, 0, B19200 | CS8 | CREAD | CLOCAL | HUPCL);
-+   /*
-+    * Send Reset Baudrate Command 
-+    */
-+   write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD));
-+   usleep(250000);
-+   /*
-+    * Send Reset Command 
-+    */
-+   write(fd, UD_RESET, strlen(UD_RESET));
-+   usleep(75000);
-+   /*
-+    * Set speed to 9600bps 
-+    */
-+   setspeed(fd, 1200, 9600, 0, B9600 | CS8 | CREAD | CLOCAL | HUPCL);
-+   /*
-+    * Send Reset Command 
-+    */
-+   write(fd, UD_RESET, strlen(UD_RESET));
-+   usleep(250000);
-+   write(fd, UD_STOP, strlen(UD_STOP));
-+   usleep(100000);
-+}
- 
--   int wait_wacom() {
--      /*
--       *  Wait up to 200 ms for Data from Tablet.
--       *  Do not read that data.
--       *  Give back 0 on timeout condition, -1 on error and 1 for DataPresent
--       */
--      struct timeval timeout;
--
--      fd_set readfds;
--
--      int err;
--
--      FD_ZERO(&readfds);
--      FD_SET(fd, &readfds);
--      timeout.tv_sec = 0;
--      timeout.tv_usec = 200000;
--      err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
--      return ((err > 0) ? 1 : err);
--   }
-+static int wait_wacom(int fd)
-+{
-+   /*
-+    *  Wait up to 200 ms for Data from Tablet.
-+    *  Do not read that data.
-+    *  Give back 0 on timeout condition, -1 on error and 1 for DataPresent
-+    */
-+   struct timeval timeout;
- 
--   char buffer[50], *p;
-+   fd_set readfds;
- 
--   int RequestData(char *cmd) {
--      int err;
-+   int err;
- 
--      /*
--       * Send cmd if not null, and get back answer from tablet.
--       * Get Data to buffer until full or timeout.
--       * Give back 0 for timeout and !0 for buffer full
--       */
--      if(cmd)
--         write(fd, cmd, strlen(cmd));
--      memset(buffer, 0, sizeof(buffer));
--      p = buffer;
--      err = wait_wacom();
--      while(err != -1 && err && (p - buffer) < (int) (sizeof(buffer) - 1)) {
--         p += read(fd, p, (sizeof(buffer) - 1) - (p - buffer));
--         err = wait_wacom();
--      }
--      /*
--       * return 1 for buffer full 
--       */
--      return ((strlen(buffer) >= (sizeof(buffer) - 1)) ? !0 : 0);
-+   FD_ZERO(&readfds);
-+   FD_SET(fd, &readfds);
-+   timeout.tv_sec = 0;
-+   timeout.tv_usec = 200000;
-+   err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout);
-+   return ((err > 0) ? 1 : err);
-+}
-+
-+static int RequestData(int fd, char *cmd, char *buffer)
-+{
-+   int err;
-+   char *p;
-+   /*
-+    * Send cmd if not null, and get back answer from tablet.
-+    * Get Data to buffer until full or timeout.
-+    * Give back 0 for timeout and !0 for buffer full
-+    */
-+   if(cmd)
-+      write(fd, cmd, strlen(cmd));
-+   memset(buffer, 0, sizeof(buffer));
-+   p = buffer;
-+   err = wait_wacom(fd);
-+   while(err != -1 && err && (p - buffer) < (int) (sizeof(buffer) - 1)) {
-+      p += read(fd, p, (sizeof(buffer) - 1) - (p - buffer));
-+      err = wait_wacom(fd);
-    }
-+   /*
-+    * return 1 for buffer full 
-+    */
-+   return ((strlen(buffer) >= (sizeof(buffer) - 1)) ? !0 : 0);
-+}
-+
-+Gpm_Type *I_wacom(int fd, unsigned short flags, struct Gpm_Type *type, int argc,
-+                  char **argv)
-+{
-+
-+   flags = 0;                   /* FIXME: 1.99.13 */
-+
-+   char buffer[50];
- 
-    /*
-     * We do both modes, relative and absolute, with the same function.
-@@ -143,17 +147,17 @@ Gpm_Type *I_wacom(int fd, unsigned short
-    };
-    parse_argv(optioninfo, argc, argv);
-    type->absolute = WacomAbsoluteWanted;
--   reset_wacom();
-+   reset_wacom(fd);
- 
-    /*
-     * "Flush" input queque 
-     */
--   while(RequestData(NULL)) ;
-+   while(RequestData(fd, NULL, buffer)) ;
- 
-    /*
-     * read WACOM-ID 
-     */
--   RequestData(UD_FIRMID);
-+   RequestData(fd, UD_FIRMID, buffer);
- 
-    /*
-     * Search for matching modell 
-@@ -180,7 +184,7 @@ Gpm_Type *I_wacom(int fd, unsigned short
-     * read Wacom max size 
-     */
-    if(WacomModell != (-1) && (!wcmodell[WacomModell].maxX)) {
--      RequestData(UD_COORD);
-+      RequestData(fd, UD_COORD, buffer);
-       sscanf(buffer + 2, "%d,%d", &wmaxx, &wmaxy);
-       wmaxx = (wmaxx - wcmodell[WacomModell].border);
-       wmaxy = (wmaxy - wcmodell[WacomModell].border);
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/gpm.service.in b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/gpm.service.in
new file mode 100644
index 0000000..ee6c040
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/gpm.service.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Virtual console mouse server
+
+[Service]
+Type=forking
+ExecStart=@bindir@/gpm -m /dev/input/mice -t imps2
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/init b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/init
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/init
rename to import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/init
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/no-docs.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/no-docs.patch
new file mode 100644
index 0000000..3faef84
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/no-docs.patch
@@ -0,0 +1,18 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+Index: gpm-1.99.7/Makefile.in
+===================================================================
+--- gpm-1.99.7.orig/Makefile.in	2008-07-24 03:36:35.000000000 -0700
++++ gpm-1.99.7/Makefile.in	2010-06-22 18:28:45.269507001 -0700
+@@ -19,7 +19,7 @@
+ # user-overridable flags, but it's also all the implicit rule looks at.
+ # missing ?
+ 
+-SUBDIRS = src doc contrib
++SUBDIRS = src
+ 
+ 
+ ### simple, but effective rules
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/processcreds.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/processcreds.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm-1.99.7/processcreds.patch
rename to import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm/processcreds.patch
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_1.99.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_1.99.7.bb
deleted file mode 100644
index bbb8c28..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_1.99.7.bb
+++ /dev/null
@@ -1,53 +0,0 @@
-DESCRIPTION = "GPM (General Purpose Mouse) is a mouse server \
-for the console and xterm, with sample clients included \
-(emacs, etc)."
-SECTION = "console/utils"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://gpm2/core/main.c;endline=19;md5=66d3c205c4e7ee5704b2ee351dfed72f"
-
-PR = "r2"
-
-DEPENDS = "ncurses"
-
-SRC_URI = "ftp://arcana.linux.it/pub/gpm/gpm-${PV}.tar.bz2 \
-           file://no-docs.patch \
-           file://processcreds.patch \
-           file://eglibc-2.17.patch \
-           file://remove_nested_functions.patch \
-           file://init"
-
-inherit autotools-brokensep update-rc.d
-
-INITSCRIPT_NAME = "gpm"
-INITSCRIPT_PARAMS = "defaults"
-
-#export LIBS = "-lm"
-
-# all fields are /* FIXME: gpm 1.99.13 */
-# gpm-1.99.7/src/lib/libhigh.c:171:43: error: parameter 'clientdata' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/lib/report-lib.c:28:21: error: parameter 'line' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/lib/report-lib.c:28:33: error: parameter 'file' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/drivers/empty/i.c:26:23: error: parameter 'fd' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/drivers/empty/i.c:26:42: error: parameter 'flags' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/drivers/etouch/i.c:34:43: error: parameter 'flags' set but not used [-Werror=unused-but-set-parameter]
-# gpm-1.99.7/src/drivers/msc/r.c:32:12: error: variable 'dy' set but not used [-Werror=unused-but-set-variable]
-# gpm-1.99.7/src/drivers/msc/r.c:32:8: error: variable 'dx' set but not used [-Werror=unused-but-set-variable]
-# cc1: all warnings being treated as errors
-CFLAGS += "-Wno-extra -Wno-error=unused-but-set-parameter -Wno-error=unused-but-set-variable"
-
-# twiddler is WIP in 1.99.7 and probably not worth fixing (a lot of changes in gpm-2-dev after 1.99.7
-# gpm-1.99.7/src/drivers/twid/twiddler.c:503:14: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
-# /gpm-1.99.7/src/mice.c:221:5: error: (near initialization for 'mice[32].init') [-Werror]
-CFLAGS += "-Wno-error=int-to-pointer-cast -Wno-error"
-
-do_install () {
-    oe_runmake 'DESTDIR=${D}' install
-    install -m 0644 src/headers/gpm.h ${D}${includedir}
-    install -d ${D}/${sysconfdir}/init.d
-    install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/gpm
-    cd ${D}${libdir} && ln -sf libgpm.so.1.19.0 libgpm.so.1
-}
-SRC_URI[md5sum] = "9fdddf5f53cb11d40bb2bb671d3ac544"
-SRC_URI[sha256sum] = "6071378b24494e36ca3ef6377606e7e565040413c86704753a162d2180af32ee"
-
-FILES_${PN} += "${datadir}/emacs"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_git.bb
new file mode 100644
index 0000000..69f12d9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/gpm/gpm_git.bb
@@ -0,0 +1,45 @@
+DESCRIPTION = "GPM (General Purpose Mouse) is a mouse server \
+for the console and xterm, with sample clients included \
+(emacs, etc)."
+SECTION = "console/utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
+
+PV = "1.99.7+git${SRCREV}"
+PR = "r2"
+SRCREV = "1fd19417b8a4dd9945347e98dfa97e4cfd798d77"
+
+DEPENDS = "ncurses"
+
+SRC_URI = "git://github.com/telmich/gpm;protocol=git \
+           file://no-docs.patch \
+           file://processcreds.patch \
+           file://gpm.service.in \
+           file://init"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep update-rc.d systemd
+
+INITSCRIPT_NAME = "gpm"
+INITSCRIPT_PARAMS = "defaults"
+
+do_configure_prepend() {
+    (cd ${S};./autogen.sh;cd -)
+}
+
+do_install_append () {
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -d ${D}${systemd_system_unitdir}
+        sed 's:@bindir@:${bindir}:' < ${WORKDIR}/gpm.service.in >${D}${systemd_system_unitdir}/gpm.service
+    fi
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+        install -D -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/gpm
+    fi
+    install -D -m 0644 ${S}/src/headers/gpm.h ${D}${includedir}/gpm.h
+    ln -s libgpm.so.2 ${D}${libdir}/libgpm.so
+}
+
+SYSTEMD_SERVICE_${PN} = "gpm.service"
+
+FILES_${PN} += "${datadir}/emacs"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.3.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.3.3.bb
deleted file mode 100644
index 9e6f774..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.3.3.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "A spell checker and morphological analyzer library"
-HOMEPAGE = "http://hunspell.sourceforge.net/"
-LICENSE = "LGPLv2.1 | GPLv2 | MPLv1.1"
-LIC_FILES_CHKSUM = " \
-    file://COPYING;md5=ed3a37b3ba6d6be3e08ab45987cf1b88 \
-    file://COPYING.LGPL;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
-    file://COPYING.MPL;md5=bfe1f75d606912a4111c90743d6c7325 \
-"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/Hunspell/${PV}/${BPN}-${PV}.tar.gz"
-SRC_URI[md5sum] = "4967da60b23413604c9e563beacc63b4"
-SRC_URI[sha256sum] = "a7b2c0de0e2ce17426821dc1ac8eb115029959b3ada9d80a81739fa19373246c"
-
-inherit autotools pkgconfig gettext
-
-RDEPENDS_${PN} = "perl"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.6.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.6.1.bb
new file mode 100644
index 0000000..125729f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/hunspell/hunspell_1.6.1.bb
@@ -0,0 +1,17 @@
+SUMMARY = "A spell checker and morphological analyzer library"
+HOMEPAGE = "http://hunspell.github.io/"
+LICENSE = "GPLv3 | LGPLv3"
+LIC_FILES_CHKSUM = " \
+    file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+    file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02 \
+"
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/archive/v${PV}.tar.gz"
+SRC_URI[md5sum] = "0df1c18c1284f8625af5ae5a8d5c4cef"
+SRC_URI[sha256sum] = "30f593733c50b794016bb03d31fd2a2071e4610c6fa4708e33edad2335102c49"
+
+inherit autotools pkgconfig gettext
+
+RDEPENDS_${PN} = "perl"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/iksemel/iksemel_1.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/iksemel/iksemel_1.4.bb
index f1276f9..3dc22c5 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/iksemel/iksemel_1.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/iksemel/iksemel_1.4.bb
@@ -9,7 +9,7 @@
 PR = "r1"
 
 # http://errors.yoctoproject.org/Errors/Details/25825/
-PNBLACKLIST[iksemel] ?= "Not compatible with gnutls version 3.4 currently in oe-core"
+PNBLACKLIST[iksemel] ?= "Not compatible with gnutls version 3.4 currently in oe-core - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "http://iksemel.googlecode.com/files/${BP}.tar.gz;name=archive \
            file://r25.diff"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/imagemagick/imagemagick_7.0.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/imagemagick/imagemagick_7.0.2.bb
index cfaa7c3..960cb00 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/imagemagick/imagemagick_7.0.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/imagemagick/imagemagick_7.0.2.bb
@@ -23,7 +23,7 @@
 EXTRA_OECONF = "--program-prefix= --program-suffix=.im7 --without-perl --disable-openmp --without-xml --disable-opencl"
 
 CACHED_CONFIGUREVARS = "ac_cv_sys_file_offset_bits=yes"
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[graphviz] = "--with-gvc,--without-gvc,graphviz"
 PACKAGECONFIG[jp2] = "--with-jp2,,jasper"
 PACKAGECONFIG[lzma] = "--with-lzma,--without-lzma,xz"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ipmitool/ipmitool_1.8.18.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/ipmitool/ipmitool_1.8.18.bb
new file mode 100644
index 0000000..9f73d27
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ipmitool/ipmitool_1.8.18.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utility for IPMI control"
+DESCRIPTION = "This package contains a utility for interfacing with devices that support \
+the Intelligent Platform Management Interface specification. IPMI is \
+an open standard for machine health, inventory, and remote power control. \
+\
+This utility can communicate with IPMI-enabled devices through either a \
+kernel driver such as OpenIPMI or over the RMCP LAN protocol defined in \
+the IPMI specification. IPMIv2 adds support for encrypted LAN \
+communications and remote Serial-over-LAN functionality. \
+\
+It provides commands for reading the Sensor Data Repository (SDR) and \
+displaying sensor values, displaying the contents of the System Event \
+Log (SEL), printing Field Replaceable Unit (FRU) information, reading and \
+setting LAN configuration, and chassis power control. \
+"
+
+HOMEPAGE = "http://ipmitool.sourceforge.net/"
+SECTION = "kernel/userland"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9aa91e13d644326bf281924212862184"
+
+DEPENDS = "openssl readline ncurses"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/ipmitool/ipmitool-${PV}.tar.bz2"
+SRC_URI[md5sum] = "bab7ea104c7b85529c3ef65c54427aa3"
+SRC_URI[sha256sum] = "0c1ba3b1555edefb7c32ae8cd6a3e04322056bc087918f07189eeedfc8b81e01"
+
+inherit autotools
+
+# --disable-dependency-tracking speeds up the build
+# --enable-file-security adds some security checks
+# --disable-intf-free disables FreeIPMI support - we don't want to depend on
+#   FreeIPMI libraries, FreeIPMI has its own ipmitoool-like utility.
+#
+EXTRA_OECONF = "--disable-dependency-tracking --enable-file-security --disable-intf-free"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ipmiutil/ipmiutil_2.9.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/ipmiutil/ipmiutil_2.9.6.bb
index bdb3d47..ee0766e 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/ipmiutil/ipmiutil_2.9.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ipmiutil/ipmiutil_2.9.6.bb
@@ -15,6 +15,8 @@
 LICENSE = "BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://COPYING;md5=5f9372493401f309e6149dd2ce0a044b"
 
+DEPENDS += "openssl"
+
 PARALLEL_MAKE = ""
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/ipmiutil/ipmiutil-${PV}.tar.gz \
@@ -26,7 +28,7 @@
 inherit autotools-brokensep pkgconfig systemd
 
 PACKAGECONFIG ?= "lanplus gpl"
-PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[systemd] = "--enable-systemd=${datadir}/${BPN}, --enable-systemd=no"
 PACKAGECONFIG[sha256] = "--enable-sha256, --enable-sha256=no, openssl-native, openssl"
 PACKAGECONFIG[lanplus] = "--enable-lanplus, --enable-lanplus=no, openssl-native, openssl"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lcov/lcov_1.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lcov/lcov_1.11.bb
index 114bd84..2f9ac33 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lcov/lcov_1.11.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lcov/lcov_1.11.bb
@@ -23,6 +23,5 @@
 
 do_install() {
     oe_runmake install PREFIX=${D}
-    sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/*
 }
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/files/0001-Makefile.am-add-CFLAGS-and-LDFLAGS-definiton.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/files/0001-Makefile.am-add-CFLAGS-and-LDFLAGS-definiton.patch
new file mode 100644
index 0000000..8c867ac
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/files/0001-Makefile.am-add-CFLAGS-and-LDFLAGS-definiton.patch
@@ -0,0 +1,41 @@
+From 75c1d3b8667328d874590a5321eb244256b7d932 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <Mingli.Yu@windriver.com>
+Date: Wed, 18 Jan 2017 07:35:58 +0000
+Subject: [PATCH] Makefile.am: add CFLAGS and LDFLAGS definiton
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+* When build libatasmart, we need first build strpool in host
+  env. To build strpool, the compiler is host compiler, but
+  the CFLAGS and LDFLAGS are for cross-compiler, so unify them
+  to fix below error.
+  | make -C strpool strpool
+  | make[1]: Entering directory '../libatasmart/0.19-r0/build/strpool'
+  | gcc  -DHAVE_CONFIG_H -I. -I../../git/strpool -I..    -isystem../build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -O2 -pipe -g -fstack-protector-strong -pie -fpie -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -c -o strpool.o `test -f '../strpool.c' || echo '../../git/strpool/'`../strpool.c
+  | gcc: error: unrecognized command line option ‘-fstack-protector-strong’
+  | make[1]: *** [Makefile:404: strpool.o] Error 1
+
+Upstream-Status: Pending
+
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+---
+ strpool/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/strpool/Makefile.am b/strpool/Makefile.am
+index b041cea..013fcd3 100644
+--- a/strpool/Makefile.am
++++ b/strpool/Makefile.am
+@@ -17,6 +17,8 @@
+ # <http://www.gnu.org/licenses/>.
+ 
+ CC = @CC_FOR_BUILD@
++CFLAGS = @BUILD_CFLAGS@
++LDFLAGS = @BUILD_LDFLAGS@
+ AM_CFLAGS = @BUILD_CFLAGS@
+ AM_LDFLAGS = @BUILD_LDFLAGS@
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb
index 16657b4..4cfb732 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libatasmart/libatasmart_0.19.bb
@@ -5,7 +5,9 @@
 DEPENDS = "udev"
 
 SRCREV = "de6258940960443038b4c1651dfda3620075e870"
-SRC_URI = "git://git.0pointer.de/libatasmart.git"
+SRC_URI = "git://git.0pointer.de/libatasmart.git \
+           file://0001-Makefile.am-add-CFLAGS-and-LDFLAGS-definiton.patch \
+"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libcanberra/libcanberra_0.30.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libcanberra/libcanberra_0.30.bb
index f473775..72c93ab 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libcanberra/libcanberra_0.30.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libcanberra/libcanberra_0.30.bb
@@ -22,9 +22,8 @@
     --disable-lynx \
 "
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES','alsa','alsa','',d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES','pulseaudio','pulseaudio','',d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES','x11','gtk gtk3','',d)} \
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk gtk3', '', d)} \
 "
 PACKAGECONFIG[alsa] = "--enable-alsa, --disable-alsa, alsa-lib"
 PACKAGECONFIG[pulseaudio] = "--enable-pulse, --disable-pulse, pulseaudio"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libdbi/libdbi-drivers_0.8.3-1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libdbi/libdbi-drivers_0.8.3-1.bb
index ec869c4..8d2c505 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libdbi/libdbi-drivers_0.8.3-1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libdbi/libdbi-drivers_0.8.3-1.bb
@@ -5,4 +5,4 @@
 SRC_URI[sha256sum] = "4ab9944398ce769c0deeb64d2f73555c67bc25ccd2ade1ccf552226c7b2acf72"
 
 # libdbi-drivers-0.8.3-1/drivers/mysql/dbd_mysql.c:232:5: error: conflicting types for 'dbd_goto_row'
-PNBLACKLIST[libdbi-drivers] ?= "BROKEN: fails to build with gcc-5"
+PNBLACKLIST[libdbi-drivers] ?= "BROKEN: fails to build with gcc-5 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libetpan/libetpan_0.57.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libetpan/libetpan_0.57.bb
index 1091bb0..5cadf16 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libetpan/libetpan_0.57.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libetpan/libetpan_0.57.bb
@@ -9,7 +9,7 @@
 PR = "r1"
 
 # http://errors.yoctoproject.org/Errors/Details/25823/
-PNBLACKLIST[libetpan] ?= "Not compatible with gnutls version 3.4 currently in oe-core"
+PNBLACKLIST[libetpan] ?= "Not compatible with gnutls version 3.4 currently in oe-core - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/libetpan/libetpan-${PV}.tar.gz \
            file://libetpan-autoreconf.patch \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libftdi/libftdi_1.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libftdi/libftdi_1.3.bb
index 5eee0db..199e5a8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libftdi/libftdi_1.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libftdi/libftdi_1.3.bb
@@ -24,7 +24,7 @@
 
 inherit cmake binconfig pkgconfig
 
-EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
+EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
 
 FILES_${PN}-dev += "${libdir}/cmake"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.1.bb
deleted file mode 100644
index 092a674..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.1.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-SUMMARY = "the Git linkable library"
-HOMEPAGE = "http://libgit2.github.com/"
-LICENSE = "GPL-2.0-with-GCC-exception"
-LIC_FILES_CHKSUM = "file://COPYING;md5=34197a479f637beb9e09e56893f48bc2"
-
-DEPENDS = "curl openssl zlib libssh2"
-
-SRC_URI = "git://github.com/libgit2/libgit2.git;branch=maint/v0.24"
-SRCREV = "211e117a0590583a720c53172406f34186c543bd"
-
-S = "${WORKDIR}/git"
-
-inherit cmake
-
-EXTRA_OECMAKE = "\
-        -DTHREADSAFE=ON \
-        -DBUILD_CLAR=OFF \
-        -DSHA1_TYPE="builtin" \
-        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-        -DBUILD_EXAMPLES=OFF \
-"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.3.bb
new file mode 100644
index 0000000..8f580f9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libgit2/libgit2_0.24.3.bb
@@ -0,0 +1,23 @@
+SUMMARY = "the Git linkable library"
+HOMEPAGE = "http://libgit2.github.com/"
+LICENSE = "GPL-2.0-with-GCC-exception"
+LIC_FILES_CHKSUM = "file://COPYING;md5=34197a479f637beb9e09e56893f48bc2"
+
+DEPENDS = "curl openssl zlib libssh2"
+
+SRC_URI = "git://github.com/libgit2/libgit2.git;branch=maint/v0.24"
+SRCREV = "4cf1ec7cff28da8838a2f0a9fb330e312ea3f963"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "\
+        -DTHREADSAFE=ON \
+        -DBUILD_CLAR=OFF \
+        -DSHA1_TYPE="builtin" \
+        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+        -DBUILD_EXAMPLES=OFF \
+"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libiio/libiio_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libiio/libiio_git.bb
new file mode 100644
index 0000000..d66ac58
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libiio/libiio_git.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Library for interfacing with IIO devices"
+HOMEPAGE = "https://wiki.analog.com/resources/tools-software/linux-software/libiio"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c"
+
+SRCREV = "08f947d5e40600259bb698c3b95538e9f2bfecc2"
+PV = "0.8+git${SRCPV}"
+
+SRC_URI = "git://github.com/analogdevicesinc/libiio.git"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "flex-native bison-native avahi libaio libusb1 libxml2"
+
+inherit cmake pythonnative
+
+PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-python"
+
+RDEPENDS_${PN}-python = "${PN} python-ctypes python-stringold"
+
+FILES_${PN}-iiod = "${sbindir}/iiod"
+FILES_${PN}-tests = "${bindir}"
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd/Check-response-existence-on-upgrade.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd/Check-response-existence-on-upgrade.patch
new file mode 100644
index 0000000..a02bbd4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd/Check-response-existence-on-upgrade.patch
@@ -0,0 +1,49 @@
+From: jose.bollo@iot.bzh
+Date: Thu, 4 May 2017 21:47:38 +0200
+Subject: [PATCH] Check response existence on upgrade
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When a connection upgrade is requested and when the
+request sent an error reply, the response is most of
+the time already sent when the test on
+connection->response->upgrade_handler is made, leading
+to dereferencing NULL.
+
+Two possibilities exist:
+
+  NULL == connection->response || NULL == connection->response->upgrade_handler
+
+or
+
+  NULL != connection->response && NULL == connection->response->upgrade_handler
+
+The first is prefered because it is probably safer to close the connection
+in that case.
+
+Upstream-Status: Accepted [https://gnunet.org/git/libmicrohttpd.git/commit/?id=b4216c60fdb5b48f6cfec416301fc63a1167e6cd]
+
+Change-Id: Ie6e7fc165f7fe3635ade0952bb34a0b937d38716
+Signed-off-by: José Bollo <jobol@nonadev.net>
+Signed-off-by: José Bollo <jose.bollo@iot.bzh>
+---
+ src/microhttpd/connection.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
+index a495524..d39c110 100644
+--- a/src/microhttpd/connection.c
++++ b/src/microhttpd/connection.c
+@@ -882,7 +882,7 @@ keepalive_possible (struct MHD_Connection *connection)
+ #ifdef UPGRADE_SUPPORT
+     if ( (MHD_str_equal_caseless_ (end,
+                                    "upgrade")) &&
+-         (NULL == connection->response->upgrade_handler) )
++         (NULL == connection->response || NULL == connection->response->upgrade_handler) )
+       return MHD_NO;
+ #endif /* UPGRADE_SUPPORT */
+ 
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.50.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.50.bb
deleted file mode 100644
index 421b78e..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.50.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-DESCRIPTION = "A small C library that is supposed to make it easy to run an HTTP server as part of another application"
-HOMEPAGE = "http://www.gnu.org/software/libmicrohttpd/"
-LICENSE = "LGPL-2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=9331186f4f80db7da0e724bdd6554ee5"
-SECTION = "net"
-DEPENDS = "libgcrypt gnutls file"
-
-SRC_URI = "http://ftp.gnu.org/gnu/libmicrohttpd/${BPN}-${PV}.tar.gz"
-SRC_URI[md5sum] = "4a3f793d59f663a2b0fc62d44668fb66"
-SRC_URI[sha256sum] = "d1b6385068abded29b6470e383287aa7705de05ae3c08ad0bf5747ac4dc6ebd7"
-
-inherit autotools lib_package pkgconfig
-
-EXTRA_OECONF += "--disable-static --with-gnutls=${STAGING_LIBDIR}/../"
-
-PACKAGECONFIG ?= "curl"
-PACKAGECONFIG_append_class-target = "\
-        ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
-"
-PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
-PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,"
-
-do_compile_append() {
-    sed -i s:-L${STAGING_LIBDIR}::g libmicrohttpd.pc
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.53.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.53.bb
new file mode 100644
index 0000000..45f2460
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libmicrohttpd/libmicrohttpd_0.9.53.bb
@@ -0,0 +1,28 @@
+DESCRIPTION = "A small C library that is supposed to make it easy to run an HTTP server as part of another application"
+HOMEPAGE = "http://www.gnu.org/software/libmicrohttpd/"
+LICENSE = "LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9331186f4f80db7da0e724bdd6554ee5"
+SECTION = "net"
+DEPENDS = "libgcrypt gnutls file"
+
+SRC_URI = "http://ftp.gnu.org/gnu/libmicrohttpd/${BPN}-${PV}.tar.gz"
+SRC_URI[md5sum] = "5a425e993a0f5295aecb5d6607a1c242"
+SRC_URI[sha256sum] = "9b15ec2d381f44936323adfd4f989fa35add517cccbbfa581896b02a393c2cc4"
+
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+SRC_URI += " file://Check-response-existence-on-upgrade.patch"
+
+inherit autotools lib_package pkgconfig gettext
+
+EXTRA_OECONF += "--disable-static --with-gnutls=${STAGING_LIBDIR}/../"
+
+PACKAGECONFIG ?= "curl"
+PACKAGECONFIG_append_class-target = "\
+        ${@bb.utils.filter('DISTRO_FEATURES', 'largefile', d)} \
+"
+PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,"
+
+do_compile_append() {
+    sed -i s:-L${STAGING_LIBDIR}::g libmicrohttpd.pc
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih-1.0.3/0001-signal.c-SIGCLD-and-SIGCHILD-are-same-on-sytem-V-sys.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih-1.0.3/0001-signal.c-SIGCLD-and-SIGCHILD-are-same-on-sytem-V-sys.patch
new file mode 100644
index 0000000..a43b4b1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih-1.0.3/0001-signal.c-SIGCLD-and-SIGCHILD-are-same-on-sytem-V-sys.patch
@@ -0,0 +1,28 @@
+From f1b9992caf9910f9f7afae401045e42572cc84ff Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 1 Apr 2017 08:50:35 -0700
+Subject: [PATCH] signal.c: SIGCLD and SIGCHILD are same on sytem V systems
+
+Musl drops the SIGCLD legacy
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ nih/signal.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/nih/signal.c b/nih/signal.c
+index a241df9..691c8e6 100644
+--- a/nih/signal.c
++++ b/nih/signal.c
+@@ -87,7 +87,7 @@ static const SignalName signal_names[] = {
+ 	{ SIGSTKFLT, "STKFLT" },
+ #endif
+ 	{ SIGCHLD,   "CHLD"   },
+-	{ SIGCLD,    "CLD"    },
++	{ SIGCHLD,    "CLD"   },
+ 	{ SIGCONT,   "CONT"   },
+ 	{ SIGSTOP,   "STOP"   },
+ 	{ SIGTSTP,   "TSTP"   },
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih_1.0.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih_1.0.3.bb
index 40aa896..02fe805 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih_1.0.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libnih/libnih_1.0.3.bb
@@ -23,8 +23,9 @@
 DEPENDS_class-native = "dbus-native"
 
 SRC_URI = "https://launchpad.net/${BPN}/1.0/${PV}/+download/${BP}.tar.gz \
-    file://libnih_1.0.3-4ubuntu16.patch \
-"
+           file://libnih_1.0.3-4ubuntu16.patch \
+           file://0001-signal.c-SIGCLD-and-SIGCHILD-are-same-on-sytem-V-sys.patch \
+           "
 
 SRC_URI[md5sum] = "db7990ce55e01daffe19006524a1ccb0"
 SRC_URI[sha256sum] = "897572df7565c0a90a81532671e23c63f99b4efde2eecbbf11e7857fbc61f405"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/explicit_linking.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/explicit_linking.patch
new file mode 100644
index 0000000..05d3bf6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/explicit_linking.patch
@@ -0,0 +1,20 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -51,7 +51,7 @@ noinst_PROGRAMS = test-oop
+ 
+ test_oop_SOURCES = test-oop.c
+ test_oop_CFLAGS = $(GLIB2_CFLAGS) $(GLIB_INCLUDES) $(TCL_INCLUDES) $(WWW_INCLUDES)
+-test_oop_LDADD = $(lib_LTLIBRARIES)
++test_oop_LDADD = $(lib_LTLIBRARIES) $(GLIB2_LIBS) $(ADNS_LIBS) $(TCL_LIBS) $(READLINE_LIBS)
+ 
+ release: dist
+ 	gzip -dc $(PACKAGE)-$(VERSION).tar.gz | bzip2 -9 \
+--- a/liboop-glib2.pc.in
++++ b/liboop-glib2.pc.in
+@@ -7,5 +7,5 @@ Name: liboop-glib2
+ Description: Event loop management library (GLIB2 support)
+ Version: @VERSION@
+ Requires: liboop = @VERSION@ glib-2.0
+-Libs: -L${libdir} -loop-glib2
++Libs: -L${libdir} -loop-glib2 @GLIB2_LIBS@
+ Cflags: -D_REENTRANT -I${includedir}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/new-readline-typedef.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/new-readline-typedef.patch
new file mode 100644
index 0000000..0a02420
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/new-readline-typedef.patch
@@ -0,0 +1,11 @@
+--- a/test-oop.c
++++ b/test-oop.c
+@@ -180,7 +180,7 @@ static void *stop_readline(oop_source *s
+ static void add_readline(oop_source *src) {
+ 	rl_callback_handler_install(
+ 		(char *) "> ", /* readline isn't const-correct */
+-		(VFunction *) on_readline);
++		(rl_vcpfunc_t *) on_readline);
+ 	oop_readline_register(src);
+ 	src->on_signal(src,SIGQUIT,stop_readline,NULL);
+ }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/read_bugfixes.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/read_bugfixes.patch
new file mode 100644
index 0000000..1880a24
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/read_bugfixes.patch
@@ -0,0 +1,40 @@
+From: Ian Jackson <ijackson@chiark.greenend.org.uk>
+Applied-Upstream: no
+Bug-Debian: http://bugs.debian.org/579604
+Subject: oop-read.h bugfixes
+
+Some years ago I contributed a feature for reading lines and records
+to liboop: oop-read.h and read.c.  Since it took a while for that
+feature to make it into distributed versions, for a long time I've
+been using my own copy of the source file.  It seems that I fixed a
+couple of bugs in my copy which are still in the Debian package.  I
+can't find any record of me having told anyone about them and now I
+find that 1.0-6 still has the bugs.
+
+There are two fixes:
+ * Initialise "rd->discard" properly
+ * Avoid rd->neednotcheck becoming negative
+
+--- a/read.c
++++ b/read.c
+@@ -114,6 +114,7 @@ oop_read *oop_rd_new(oop_source *oop, oo
+   rd->allocbuf= 0;
+   rd->used= 0;
+   rd->alloc= buf ? bufsz : 0;
++  rd->discard= 0;
+   rd->neednotcheck= 0;
+   rd->displacedchar= -1;
+   rd->style= *OOP_RD_STYLE_IMMED;
+@@ -235,7 +236,11 @@ static void *on_process(oop_source *oop,
+   
+   if (rd->discard) {
+     rd->used -= rd->discard;
+-    rd->neednotcheck -= rd->discard;
++    if (rd->neednotcheck > rd->discard) {
++      rd->neednotcheck -= rd->discard;
++    } else {
++      rd->neednotcheck= 0;
++    }
+     memmove(buf, buf + rd->discard, rd->used);
+     rd->discard= 0;
+   }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/tcl_dev.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/tcl_dev.patch
new file mode 100644
index 0000000..e738be5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop/tcl_dev.patch
@@ -0,0 +1,22 @@
+--- a/configure
++++ b/configure
+@@ -19935,7 +19935,7 @@
+ fi
+ 
+ if test xno != x$with_tcl; then
+-  for version in 8.4 8.3 8.2 8.1 8.0 ; do
++  for version in "" 8.4 8.3 8.2 8.1 8.0 ; do
+     CPPFLAGS="$save_cppflags -I/usr/include/tcl$version"
+     as_ac_Lib=`echo "ac_cv_lib_tcl$version''_Tcl_Main" | $as_tr_sh`
+ echo "$as_me:$LINENO: checking for Tcl_Main in -ltcl$version" >&5
+--- a/configure.ac
++++ b/configure.ac
+@@ -71,7 +71,7 @@
+ fi
+ 
+ if test xno != x$with_tcl; then
+-  for version in 8.4 8.3 8.2 8.1 8.0 ; do
++  for version in "" 8.4 8.3 8.2 8.1 8.0 ; do
+     CPPFLAGS="$save_cppflags -I/usr/include/tcl$version"
+     AC_CHECK_LIB(tcl$version,Tcl_Main,[
+     AC_CHECK_HEADER(tcl.h,[
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop_1.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop_1.0.bb
new file mode 100644
index 0000000..82818c2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/liboop/liboop_1.0.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "Liboop is a low-level event loop management library for POSIX-based operating systems"
+HOMEPAGE = "http://liboop.org/"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8b54f38ccbd44feb80ab90e01af8b700"
+
+SRC_URI = "http://ftp.debian.org/debian/pool/main/libo/liboop/liboop_${PV}.orig.tar.gz \
+           file://read_bugfixes.patch \
+           file://explicit_linking.patch \
+           file://tcl_dev.patch \
+           file://new-readline-typedef.patch \
+"
+
+SRC_URI[md5sum] = "36cb971047d3af02369446f5e0b315a2"
+SRC_URI[sha256sum] = "34d83c6e0f09ee15cb2bc3131e219747c3b612bb57cf7d25318ab90da9a2d97c"
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
+PACKAGECONFIG[glib] = "--with-glib,--without-glib,glib-2.0 libpcre"
+PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl"
+
+EXTRA_OECONF += "--without-adns -without-libwww"
+
+inherit autotools pkgconfig
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.0.bb
deleted file mode 100644
index 811829e..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.0.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-SUMMARY = "base library for low-level IEEE 1394 accesses"
-HOMEPAGE = "https://ieee1394.wiki.kernel.org/index.php/Libraries#libraw1394"
-SECTION = "libs"
-LICENSE = "LGPL-2.1"
-LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499"
-
-SRC_URI = "https://www.kernel.org/pub/linux/libs/ieee1394/${BPN}-${PV}.tar.gz"
-SRC_URI[md5sum] = "d06cccb776b240b6ab5efdee33b87af2"
-SRC_URI[sha256sum] = "a83cff16fb8885831bc29d7d17f3c570dc39251d89e20795c08e87720de0ba70"
-
-inherit autotools
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.2.bb
new file mode 100644
index 0000000..3377807
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libraw1394/libraw1394_2.1.2.bb
@@ -0,0 +1,11 @@
+SUMMARY = "base library for low-level IEEE 1394 accesses"
+HOMEPAGE = "https://ieee1394.wiki.kernel.org/index.php/Libraries#libraw1394"
+SECTION = "libs"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499"
+
+SRC_URI = "https://www.kernel.org/pub/linux/libs/ieee1394/${BPN}-${PV}.tar.gz"
+SRC_URI[md5sum] = "45031ab15ca93e50c19886a38bc1814a"
+SRC_URI[sha256sum] = "ddc4e32721cdfe680d964aaede68ac606a20cd17dd2ba70e2d7e0692086ab57c"
+
+inherit autotools
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/files/automake_foreign.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/files/automake_foreign.patch
new file mode 100644
index 0000000..2d5bd6d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/files/automake_foreign.patch
@@ -0,0 +1,13 @@
+Index: SDL2_ttf-2.0.14/Makefile.am
+===================================================================
+--- SDL2_ttf-2.0.14.orig/Makefile.am
++++ SDL2_ttf-2.0.14/Makefile.am
+@@ -1,6 +1,8 @@
+ # Makefile.am for the SDL truetype font loading library and viewer
+ lib_LTLIBRARIES = libSDL2_ttf.la
+ 
++AUTOMAKE_OPTIONS = foreign
++
+ libSDL2_ttfincludedir = $(includedir)/SDL2
+ libSDL2_ttfinclude_HEADERS =	\
+ 	SDL_ttf.h
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl-ttf_2.0.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl-ttf_2.0.11.bb
index 0249abe..d8b378f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl-ttf_2.0.11.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl-ttf_2.0.11.bb
@@ -12,7 +12,9 @@
 
 S = "${WORKDIR}/SDL_ttf-${PV}"
 
-inherit autotools
+inherit autotools pkgconfig
+
+LDFLAGS += "-lm"
 
 do_configure_prepend() {
     # make autoreconf happy
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl2-ttf_2.0.14.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl2-ttf_2.0.14.bb
index af5a55c..4601593 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl2-ttf_2.0.14.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libsdl-ttf/libsdl2-ttf_2.0.14.bb
@@ -1,23 +1,25 @@
 SUMMARY = "Simple DirectMedia Layer truetype font library"
 SECTION = "libs"
-DEPENDS = "virtual/libsdl2 freetype"
+DEPENDS = "virtual/libsdl2 freetype virtual/libgl"
 LICENSE = "Zlib"
 LIC_FILES_CHKSUM = "file://COPYING.txt;md5=cb33e7c4df9fbde389f149ad6bc93ce5"
 
 SRC_URI = " \
     http://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-${PV}.tar.gz \
     file://use.pkg-config.for.freetype2.patch \
+    file://automake_foreign.patch \
 "
 SRC_URI[md5sum] = "e53c05e1e7f1382c316afd6c763388b1"
 SRC_URI[sha256sum] = "34db5e20bcf64e7071fe9ae25acaa7d72bdc4f11ab3ce59acc768ab62fe39276"
 
 S = "${WORKDIR}/SDL2_ttf-${PV}"
 
-inherit autotools
+inherit autotools pkgconfig distro_features_check
+
+# links to libGL.so
+REQUIRED_DISTRO_FEATURES += "x11 opengl"
 
 do_configure_prepend() {
-    touch ${S}/NEWS ${S}/README ${S}/AUTHORS ${S}/ChangeLog
-
     # Removing these files fixes a libtool version mismatch.
     MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
 
@@ -25,3 +27,4 @@
         rm -f ${S}/acinclude/$i
     done
 }
+ASNEEDED = ""
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libsodium/libsodium_1.0.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libsodium/libsodium_1.0.11.bb
index 22d3155..cbcbe96 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libsodium/libsodium_1.0.11.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libsodium/libsodium_1.0.11.bb
@@ -8,3 +8,5 @@
 SRC_URI[sha256sum] = "a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765"
 
 inherit autotools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libssh/libssh_0.7.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libssh/libssh_0.7.3.bb
index c0b8913..79e7dc5 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libssh/libssh_0.7.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libssh/libssh_0.7.3.bb
@@ -16,7 +16,7 @@
     -DWITH_PCAP=1 \
     -DWITH_SFTP=1 \
     -DWITH_ZLIB=1 \
-    -DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')} \
+    -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
     "
 
 PACKAGECONFIG ??=""
@@ -31,3 +31,4 @@
 }
 
 FILES_${PN}-dev += "${libdir}/cmake"
+TOOLCHAIN = "gcc"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libssh2/libssh2_1.7.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libssh2/libssh2_1.7.0.bb
index 155d3d4..c62dab1 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libssh2/libssh2_1.7.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libssh2/libssh2_1.7.0.bb
@@ -23,4 +23,4 @@
 PACKAGECONFIG[openssl] = "--with-openssl --with-libssl-prefix=${STAGING_LIBDIR},--without-openssl,openssl"
 PACKAGECONFIG[gcrypt] = "--with-libgcrypt --with-libgcrypt-prefix=${STAGING_EXECPREFIXDIR},--without-libgcrypt,libgcrypt"
 
-BBCLASSEXTEND += "native"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml/libtinyxml_2.6.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml/libtinyxml_2.6.2.bb
index 4460be2..138df9f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml/libtinyxml_2.6.2.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml/libtinyxml_2.6.2.bb
@@ -42,4 +42,4 @@
     install -m 0644 ${S}/tinyxml.h ${D}${includedir}
 }
 
-BBCLASSEXTEND += "native"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_3.0.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_3.0.0.bb
deleted file mode 100644
index af0b785..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_3.0.0.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "TinyXML-2 is a simple, small, efficient, C++ XML parser that can be easily integrating into other programs"
-HOMEPAGE = "http://www.grinninglizard.com/tinyxml2/"
-SECTION = "libs"
-LICENSE = "Zlib"
-LIC_FILES_CHKSUM = "file://tinyxml2.cpp;endline=22;md5=c19221dbd8a66ad3090462af4c5de5e7"
-
-SRC_URI = "git://github.com/leethomason/tinyxml2.git"
-
-SRCREV = "1977a7258cc66fd4da7f1e9da05a4933646a7803"
-
-S = "${WORKDIR}/git"
-
-inherit cmake
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_4.0.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_4.0.1.bb
new file mode 100644
index 0000000..3a66598
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_4.0.1.bb
@@ -0,0 +1,15 @@
+SUMMARY = "TinyXML-2 is a simple, small, efficient, C++ XML parser that can be easily integrating into other programs"
+HOMEPAGE = "http://www.grinninglizard.com/tinyxml2/"
+SECTION = "libs"
+LICENSE = "Zlib"
+LIC_FILES_CHKSUM = "file://tinyxml2.cpp;endline=22;md5=c19221dbd8a66ad3090462af4c5de5e7"
+
+SRC_URI = "git://github.com/leethomason/tinyxml2.git"
+
+SRCREV = "74d44acb176f8510abf28ee0a70961eb26631988"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb
index 0282ba5..8c84cb3 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb
@@ -11,7 +11,9 @@
 PV = "1.1.6-alt2+git${SRCPV}"
 
 SRC_URI = "git://git.altlinux.org/people/ldv/packages/libutempter.git \
-    file://0001-Fix-macro-error.patch"
+           file://0001-Fix-macro-error.patch \
+           file://libutempter-remove-glibc-assumption.patch \
+          "
 
 S = "${WORKDIR}/git/${BPN}"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch
new file mode 100644
index 0000000..6ed9335
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch
@@ -0,0 +1,81 @@
+diff -Naur libutempter-1.1.6.orig/utempter.c libutempter-1.1.6/utempter.c
+--- libutempter-1.1.6.orig/utempter.c	2010-11-04 13:14:53.000000000 -0400
++++ libutempter-1.1.6/utempter.c	2014-06-20 16:37:09.762403323 -0400
+@@ -34,13 +34,7 @@
+ #include <sys/stat.h>
+ #include <utmp.h>
+ 
+-#ifdef __GLIBC__
+ # include <pty.h>
+-#elif defined(__FreeBSD__)
+-# include <libutil.h>
+-#else
+-# error Unsupported platform
+-#endif /* __GLIBC__ || __FreeBSD__ */
+ 
+ #define	DEV_PREFIX	"/dev/"
+ #define	DEV_PREFIX_LEN	(sizeof(DEV_PREFIX)-1)
+@@ -106,17 +100,12 @@
+ 
+ static int
+ write_uwtmp_record(const char *user, const char *term, const char *host,
+-#ifdef __GLIBC__
+ 		   pid_t pid,
+-#endif
+ 		   int add)
+ {
+ 	struct utmp ut;
+ 	struct timeval tv;
+-
+-#ifdef __GLIBC__
+ 	size_t offset;
+-#endif
+ 
+ 	memset(&ut, 0, sizeof(ut));
+ 
+@@ -128,8 +117,6 @@
+ 	if (host)
+ 		strncpy(ut.ut_host, host, sizeof(ut.ut_host));
+ 
+-#ifdef __GLIBC__
+-
+ 	offset = (strlen(term) <= sizeof(ut.ut_id)) ? 0 :
+ 			strlen(term) - sizeof(ut.ut_id);
+ 	strncpy(ut.ut_id, term + offset, sizeof(ut.ut_id));
+@@ -156,27 +143,6 @@
+ 
+ 	(void) updwtmp(_PATH_WTMP, &ut);
+ 
+-#elif defined(__FreeBSD__)
+-
+-	ut.ut_time = tv.tv_sec;
+-
+-	if (add)
+-	{
+-		login(&ut);
+-	} else
+-	{
+-		if (logout(term) != 1)
+-		{
+-#ifdef	UTEMPTER_DEBUG
+-			fprintf(stderr, "utempter: logout: %s\n",
+-				strerror(errno));
+-#endif
+-			exit(EXIT_FAILURE);
+-		}
+-	}
+-
+-#endif /* __GLIBC__ || __FreeBSD__ */
+-
+ #ifdef	UTEMPTER_DEBUG
+ 	fprintf(stderr,
+ 		"utempter: DEBUG: utmp/wtmp record %s for terminal '%s'\n",
+@@ -255,8 +221,6 @@
+ 	validate_device(device);
+ 
+ 	return write_uwtmp_record(pw->pw_name, device + DEV_PREFIX_LEN, host,
+-#ifdef __GLIBC__
+ 				  pid,
+-#endif
+ 				  add);
+ }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c/0001-Use-the-API-properly-in-the-example-format-security-.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c/0001-Use-the-API-properly-in-the-example-format-security-.patch
new file mode 100644
index 0000000..9ff9d70
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c/0001-Use-the-API-properly-in-the-example-format-security-.patch
@@ -0,0 +1,26 @@
+From 97f0b7b25474fab25f5757f7c50a77e20be5d05b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= <valtri@civ.zcu.cz>
+Date: Mon, 7 Sep 2015 15:00:48 +0200
+Subject: [PATCH] Use the API properly in the example (format security error
+ fixed).
+
+---
+ examples/helloworld1/mylog.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/examples/helloworld1/mylog.h b/examples/helloworld1/mylog.h
+index 280f3dc..57e5369 100644
+--- a/examples/helloworld1/mylog.h
++++ b/examples/helloworld1/mylog.h
+@@ -39,7 +39,7 @@ static LOG4C_INLINE int mylog_fini(){
+ 
+ static LOG4C_INLINE void mylog_msg(char *catName,int a_priority, char *msg){
+ #ifndef WITHOUT_LOG4C
+-	log4c_category_log(log4c_category_get(catName), a_priority, msg);
++	log4c_category_log(log4c_category_get(catName), a_priority, "%s", msg);
+ #else
+ 	printf(msg);
+ #endif
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c_1.2.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c_1.2.4.bb
index 3286b08..ef7ad84 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c_1.2.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/log4c/log4c_1.2.4.bb
@@ -4,7 +4,9 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
-           file://fix_configure_with-expat.patch"
+           file://fix_configure_with-expat.patch \
+           file://0001-Use-the-API-properly-in-the-example-format-security-.patch \
+          "
 
 SRC_URI[md5sum] = "0d94919136e1d16b68427562e74cb3dd"
 SRC_URI[sha256sum] = "5991020192f52cc40fa852fbf6bbf5bd5db5d5d00aa9905c67f6f0eadeed48ea"
@@ -15,3 +17,5 @@
 BINCONFIG = "${bindir}/log4c-config"
 
 inherit autotools binconfig-disabled
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.1.bb
deleted file mode 100644
index c7bf288..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.1.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-DESCRIPTION = "A library of C++ classes for flexible logging to files, syslog, IDSA and other destinations."
-HOMEPAGE = "http://sourceforge.net/projects/log4cpp/"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
-
-SRC_URI[md5sum] = "1e173df8ee97205f412ff84aa93b8fbe"
-SRC_URI[sha256sum] = "35abf332630a6809c969276b1d60b90c81a95daf24c86cfd7866ffef72f9bed0"
-
-SRC_URI = "http://downloads.sourceforge.net/${BPN}/${BP}.tar.gz \
-           file://fix-pc.patch;striplevel=2 \
-          "
-
-S = "${WORKDIR}/${BPN}"
-
-inherit autotools pkgconfig
-
-EXTRA_OECONF = "\
-    --enable-doxygen=no \
-    --enable-dot=no \
-    --enable-html-docs=no \
-    --enable-latex-docs=no \
-    LDFLAGS=-pthread \
-"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.2.bb
new file mode 100644
index 0000000..dc52c9f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/log4cpp/log4cpp_1.1.2.bb
@@ -0,0 +1,22 @@
+DESCRIPTION = "A library of C++ classes for flexible logging to files, syslog, IDSA and other destinations."
+HOMEPAGE = "http://sourceforge.net/projects/log4cpp/"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+RC = "rc5"
+SRC_URI = "http://downloads.sourceforge.net/${BPN}/${BP}${RC}.tar.gz \
+           file://fix-pc.patch;striplevel=2 \
+          "
+SRC_URI[md5sum] = "58b4591a2f3e7ef3d5e3e7cfb3a81a62"
+SRC_URI[sha256sum] = "a611d99a20af6676c60219762771c0bfac90f4879bbde70038ece75338b588ec"
+
+S = "${WORKDIR}/${BPN}"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "\
+    --enable-doxygen=no \
+    --enable-dot=no \
+    --enable-html-docs=no \
+    --enable-latex-docs=no \
+"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch
new file mode 100644
index 0000000..e86ab25
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-Avoid-bashisms-in-init-scripts.patch
@@ -0,0 +1,182 @@
+From 916ea0c70fd063ab7b81f16fd917a75dc02edf4f Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Fri, 17 Mar 2017 03:18:28 +0100
+Subject: [PATCH] Avoid bashisms in init scripts
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ scripts/blk_availability_init_red_hat.in      | 4 ++--
+ scripts/clvmd_init_red_hat.in                 | 6 +++---
+ scripts/cmirrord_init_red_hat.in              | 4 ++--
+ scripts/lvm2_cluster_activation_red_hat.sh.in | 4 ++--
+ scripts/lvm2_lvmetad_init_red_hat.in          | 4 ++--
+ scripts/lvm2_lvmpolld_init_red_hat.in         | 4 ++--
+ scripts/lvm2_monitoring_init_red_hat.in       | 4 ++--
+ scripts/lvm2_monitoring_init_rhel4            | 4 ++--
+ 8 files changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/scripts/blk_availability_init_red_hat.in b/scripts/blk_availability_init_red_hat.in
+index a84ffe7..6b855b7 100644
+--- a/scripts/blk_availability_init_red_hat.in
++++ b/scripts/blk_availability_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+ #
+@@ -53,6 +53,6 @@ case "$1" in
+   status)
+ 	;;
+   *)
+-	echo $"Usage: $0 {start|stop|status}"
++	echo "Usage: $0 {start|stop|status}"
+ 	;;
+ esac
+diff --git a/scripts/clvmd_init_red_hat.in b/scripts/clvmd_init_red_hat.in
+index d7f3392..abc8011 100644
+--- a/scripts/clvmd_init_red_hat.in
++++ b/scripts/clvmd_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # clvmd - Clustered LVM Daemon init script
+ #
+@@ -161,7 +161,7 @@ restart() {
+ 	fi
+ }
+ 
+-[ "$EUID" != "0" ] && {
++[ "$(id -u)" != "0" ] && {
+ 	echo "clvmd init script can only be executed as root user"
+ 	exit 4
+ }
+@@ -206,7 +206,7 @@ case "$1" in
+ 	;;
+ 
+   *)
+-	echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
++	echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+ 	rtrn=2
+ 	;;
+ esac
+diff --git a/scripts/cmirrord_init_red_hat.in b/scripts/cmirrord_init_red_hat.in
+index d4b7e37..d442cbc 100755
+--- a/scripts/cmirrord_init_red_hat.in
++++ b/scripts/cmirrord_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # chkconfig: - 22 78
+ # description: Starts and stops cmirrord
+@@ -101,7 +101,7 @@ case "$1" in
+ 		;;
+ 
+ 	*)
+-		echo $"Usage: $0 {start|stop|restart|status}"
++		echo "Usage: $0 {start|stop|restart|status}"
+ 		;;
+ esac
+ 
+diff --git a/scripts/lvm2_cluster_activation_red_hat.sh.in b/scripts/lvm2_cluster_activation_red_hat.sh.in
+index abea026..d8cba2e 100644
+--- a/scripts/lvm2_cluster_activation_red_hat.sh.in
++++ b/scripts/lvm2_cluster_activation_red_hat.sh.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ sbindir=@sbindir@
+ 
+@@ -54,7 +54,7 @@ case "$1" in
+ 	rtrn=$?
+ 	;;
+   *)
+-	echo $"Usage: $0 {activate|deactivate}"
++	echo "Usage: $0 {activate|deactivate}"
+ 	rtrn=3
+ 	;;
+ esac
+diff --git a/scripts/lvm2_lvmetad_init_red_hat.in b/scripts/lvm2_lvmetad_init_red_hat.in
+index b2f5d50..96269a9 100644
+--- a/scripts/lvm2_lvmetad_init_red_hat.in
++++ b/scripts/lvm2_lvmetad_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+ #
+@@ -105,7 +105,7 @@ case "$1" in
+ 	;;
+ 
+   *)
+-	echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
++	echo "Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
+ 	;;
+ esac
+ 
+diff --git a/scripts/lvm2_lvmpolld_init_red_hat.in b/scripts/lvm2_lvmpolld_init_red_hat.in
+index c521955..cdbaece 100644
+--- a/scripts/lvm2_lvmpolld_init_red_hat.in
++++ b/scripts/lvm2_lvmpolld_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+ #
+@@ -107,7 +107,7 @@ case "$1" in
+ 	;;
+ 
+   *)
+-	echo $"Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
++	echo "Usage: $0 {start|stop|force-stop|restart|condrestart|try-restart|status}"
+ 	;;
+ esac
+ 
+diff --git a/scripts/lvm2_monitoring_init_red_hat.in b/scripts/lvm2_monitoring_init_red_hat.in
+index de7ff0d..9ff6bb7 100644
+--- a/scripts/lvm2_monitoring_init_red_hat.in
++++ b/scripts/lvm2_monitoring_init_red_hat.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2007-2009 Red Hat, Inc. All rights reserved.
+ #
+@@ -128,7 +128,7 @@ case "$1" in
+ 	;;
+ 
+   *)
+-	echo $"Usage: $0 {start|stop|restart|status|force-stop}"
++	echo "Usage: $0 {start|stop|restart|status|force-stop}"
+ 	;;
+ esac
+ 
+diff --git a/scripts/lvm2_monitoring_init_rhel4 b/scripts/lvm2_monitoring_init_rhel4
+index 8eb06c5..2e8d0f7 100644
+--- a/scripts/lvm2_monitoring_init_rhel4
++++ b/scripts/lvm2_monitoring_init_rhel4
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Copyright (C) 2007 Red Hat, Inc. All rights reserved.
+ #
+@@ -93,7 +93,7 @@ case "$1" in
+ 	;;
+ 
+   *)
+-	echo $"Usage: $0 {start|stop|restart|status|force-stop}"
++	echo "Usage: $0 {start|stop|restart|status|force-stop}"
+ 	;;
+ esac
+ 
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-implement-libc-specific-reopen_stream.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-implement-libc-specific-reopen_stream.patch
new file mode 100644
index 0000000..5d72402
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0001-implement-libc-specific-reopen_stream.patch
@@ -0,0 +1,79 @@
+From e3103459416616d3b8508e7176e897b0ae6c90f2 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:49:40 +0000
+Subject: [PATCH] implement libc specific reopen_stream
+
+musl defines stdin/stdio/stderr as constant types which means
+we can not assign to them as we are doing here but works ok with glibc
+therefore abstract out the _reopen_stream definition depending upon if
+we are using glibc or otherwise
+
+Origin:
+http://git.alpinelinux.org/cgit/aports/tree/main/lvm2/fix-stdio-usage.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+
+---
+ lib/log/log.c      | 6 ++++++
+ tools/lvmcmdline.c | 6 +++---
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/lib/log/log.c b/lib/log/log.c
+index c933154..3581084 100644
+--- a/lib/log/log.c
++++ b/lib/log/log.c
+@@ -161,6 +161,7 @@ static void _check_and_replace_standard_log_streams(FILE *old_stream, FILE *new_
+  * Close and reopen standard stream on file descriptor fd.
+  */
+ int reopen_standard_stream(FILE **stream, const char *mode)
++#ifdef __GLIBC__
+ {
+ 	int fd, fd_copy, new_fd;
+ 	const char *name;
+@@ -207,6 +208,11 @@ int reopen_standard_stream(FILE **stream, const char *mode)
+ 	*stream = new_stream;
+ 	return 1;
+ }
++#else
++{
++	return (freopen(NULL, mode, *stream) != NULL);
++}
++#endif
+ 
+ void init_log_fn(lvm2_log_fn_t log_fn)
+ {
+diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
+index 9a4deb7..f1f18e6 100644
+--- a/tools/lvmcmdline.c
++++ b/tools/lvmcmdline.c
+@@ -1818,7 +1818,7 @@ static int _check_standard_fds(void)
+ 	int err = is_valid_fd(STDERR_FILENO);
+ 
+ 	if (!is_valid_fd(STDIN_FILENO) &&
+-	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
++	    !freopen(_PATH_DEVNULL, "r", stdin)) {
+ 		if (err)
+ 			perror("stdin stream open");
+ 		else
+@@ -1828,7 +1828,7 @@ static int _check_standard_fds(void)
+ 	}
+ 
+ 	if (!is_valid_fd(STDOUT_FILENO) &&
+-	    !(stdout = fopen(_PATH_DEVNULL, "w"))) {
++	    !freopen(_PATH_DEVNULL, "w", stdout)) {
+ 		if (err)
+ 			perror("stdout stream open");
+ 		/* else no stdout */
+@@ -1836,7 +1836,7 @@ static int _check_standard_fds(void)
+ 	}
+ 
+ 	if (!is_valid_fd(STDERR_FILENO) &&
+-	    !(stderr = fopen(_PATH_DEVNULL, "w"))) {
++	    !freopen(_PATH_DEVNULL, "w", stderr)) {
+ 		printf("stderr stream open: %s\n",
+ 		       strerror(errno));
+ 		return 0;
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0002-Guard-use-of-mallinfo-with-__GLIBC__.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0002-Guard-use-of-mallinfo-with-__GLIBC__.patch
new file mode 100644
index 0000000..95dcede
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0002-Guard-use-of-mallinfo-with-__GLIBC__.patch
@@ -0,0 +1,30 @@
+From 3ae9c0b607ec33fb07f32a41e9d28cc9068dd39a Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:52:44 +0000
+Subject: [PATCH] Guard use of mallinfo() with __GLIBC__
+
+This API is glibc-only
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+
+---
+ lib/mm/memlock.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
+index da90144..f34f890 100644
+--- a/lib/mm/memlock.c
++++ b/lib/mm/memlock.c
+@@ -150,7 +150,7 @@ static void _touch_memory(void *mem, size_t size)
+ 
+ static void _allocate_memory(void)
+ {
+-#ifndef VALGRIND_POOL
++#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
+ 	void *stack_mem;
+ 	struct rlimit limit;
+ 	int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
new file mode 100644
index 0000000..9ab1c06
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
@@ -0,0 +1,30 @@
+From b1ad91a059d99afd1ce25823b7c0a8d3ac63d2fd Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:55:49 +0000
+Subject: [PATCH 3/4] include fcntl.h for O_* defines and fcntl() signature
+
+On glibc _somehow_ this header gets pulled in indirectly
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+Upstream-Status: Pending
+---
+ libdaemon/server/daemon-server.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
+index 6af6de9..a9590e7 100644
+--- a/libdaemon/server/daemon-server.c
++++ b/libdaemon/server/daemon-server.c
+@@ -18,6 +18,7 @@
+ #include "daemon-server.h"
+ #include "daemon-log.h"
+ 
++#include <fcntl.h>
+ #include <dlfcn.h>
+ #include <errno.h>
+ #include <pthread.h>
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0004-tweak-MODPROBE_CMD-for-cross-compile.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0004-tweak-MODPROBE_CMD-for-cross-compile.patch
new file mode 100644
index 0000000..aaeaa72
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/0004-tweak-MODPROBE_CMD-for-cross-compile.patch
@@ -0,0 +1,38 @@
+From 0012ea63f6070a5d41fa380970f9c30b953237d2 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 25 Oct 2016 11:59:40 +0000
+Subject: [PATCH 4/4] tweak MODPROBE_CMD for cross compile
+
+Lvm uses variable MODPROBE_CMD at runtime, so build time detection of modprobe
+is incorrect.
+------
+|lvm lvcreate --thinpool wrl/pool00 --size 5556m --config  devices
+{ preferred_names=["^/dev/mapper/", "^/dev/md/", "^/dev/sd"]
+filter=["r|/loop1$|","r|/loop2$|","r|/loop3$|","r|/loop4$|","r|/loop5$|","r|/loop6$|","r|/loop7$|"] }
+|tmp/sysroots/x86_64-linux/usr/bin/modprobe: execvp failed: No such file or directory
+|tmp/sysroots/x86_64-linux/usr/bin/modprobe failed: 2
+------
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ configure.in | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index cc77aab..a3579f2 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1853,7 +1853,6 @@ if test "$UDEV_SYNC" = yes; then
+ fi
+ 
+ ################################################################################
+-AC_PATH_TOOL(MODPROBE_CMD, modprobe)
+ 
+ if test -n "$MODPROBE_CMD"; then
+ 	AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/lvm.conf b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/lvm.conf
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/lvm.conf
rename to import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/files/lvm.conf
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb
new file mode 100644
index 0000000..462e8fb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb
@@ -0,0 +1,31 @@
+require lvm2.inc
+
+SRC_URI[md5sum] = "c5a54ee0b86703daaad6e856439e115a"
+SRC_URI[sha256sum] = "e120b066b85b224552efda40204488c5123de068725676fd6e5c8bc655051b94"
+
+DEPENDS += "autoconf-archive-native"
+
+PACKAGECONFIG = ""
+
+# Unset user/group to unbreak install.
+EXTRA_OECONF = "--with-user= \
+                --with-group= \
+                --enable-pkgconfig \
+                --with-usrlibdir=${libdir} \
+"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_install_append() {
+    # Remove things unrelated to libdevmapper
+    rm -rf ${D}${sysconfdir}
+    for i in `ls ${D}${sbindir}/*`; do
+	if [ $i != ${D}${sbindir}/dmsetup ]; then
+	    rm $i
+	fi
+    done
+    # Remove docs
+    rm -rf ${D}${datadir}
+}
+
+RRECOMMENDS_${PN} += "lvm2-udevrules"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
index 74b7211..cb5a9e0 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
@@ -1,80 +1,33 @@
 SECTION = "utils"
 DESCRIPTION = "LVM2 is a set of utilities to manage logical volumes in Linux."
-DEPENDS = "udev"
 LICENSE = "GPLv2 & LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+LIC_FILES_CHKSUM = "file://COPYING;md5=12713b4d9386533feeb07d6e4831765a \
                     file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24"
 
+DEPENDS += "util-linux"
+
 SRC_URI = "ftp://sources.redhat.com/pub/lvm2/old/LVM2.${PV}.tgz \
            file://lvm.conf \
-           file://0001-implement-libc-specific-_reopen_stream.patch \
-           file://0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch \
-           file://0003-Guard-use-of-mallinfo-with-__GLIBC__.patch \
-           file://0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch \
-           file://0005-tweak-MODPROBE_CMD-for-cross-compile.patch \
+           file://0001-implement-libc-specific-reopen_stream.patch \
+           file://0002-Guard-use-of-mallinfo-with-__GLIBC__.patch \
+           file://0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch \
+           file://0004-tweak-MODPROBE_CMD-for-cross-compile.patch \
+           file://0001-Avoid-bashisms-in-init-scripts.patch \
            "
-
 S = "${WORKDIR}/LVM2.${PV}"
 
 inherit autotools-brokensep pkgconfig systemd
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
-                   thin-provisioning-tools \
-                   odirect \
-"
+# odirect is always enabled because there currently is a bug in
+# lib/device/dev-io.c which prevents compiling without it. It is
+# better to stick to configurations that were actually tested by
+# upstream...
+PACKAGECONFIG_append = " odirect"
 
+PACKAGECONFIG[dmeventd] = "--enable-dmeventd,--disable-dmeventd"
+PACKAGECONFIG[lvmetad] = "--enable-lvmetad,--disable-lvmetad"
+PACKAGECONFIG[odirect] = "--enable-o_direct,--disable-o_direct"
 PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline"
 PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
 PACKAGECONFIG[thin-provisioning-tools] = "--with-thin=internal,--with-thin=none,,thin-provisioning-tools"
-PACKAGECONFIG[odirect] = "--enable-o_direct,--disable-o_direct"
-
-# Unset user/group to unbreak install.
-EXTRA_OECONF = "--with-user= \
-                --with-group= \
-                --enable-realtime \
-                --enable-applib \
-                --enable-cmdlib \
-                --enable-udev_sync \
-                --enable-udev_rules \
-                --enable-pkgconfig \
-                --enable-dmeventd \
-                --enable-lvmetad \
-                --with-udev-prefix= \
-                --with-usrlibdir=${libdir} \
-                --with-systemdsystemunitdir=${systemd_system_unitdir} \
-                --disable-thin_check_needs_check \
-                --with-thin-check=${sbindir}/thin_check \
-                --with-thin-dump=${sbindir}/thin_dump \
-                --with-thin-repair=${sbindir}/thin_repair \
-                --with-thin-restore=${sbindir}/thin_restore \
-"
-
-CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
-
-do_install_append() {
-    # Install machine specific configuration file
-    install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
-    sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
-    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-        oe_runmake 'DESTDIR=${D}' install install_systemd_units
-        sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
-    else
-        oe_runmake 'DESTDIR=${D}' install install_initscripts
-        mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
-        rm -rf ${D}${sysconfdir}/rc.d
-    fi
-}
-
-SYSTEMD_PACKAGES = "${PN}"
-SYSTEMD_SERVICE_${PN} = "lvm2-monitor.service dm-event.socket dm-event.service lvm2-lvmetad.socket \
-                         lvm2-pvscan@.service blk-availability.service"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-TARGET_CC_ARCH += "${LDFLAGS}"
-
-FILES_${PN} += "${libdir}/device-mapper/*.so ${base_libdir}/udev"
-FILES_${PN}-dbg += "${libdir}/device-mapper/.debug"
-
-RDEPENDS_${PN} = "bash"
-
-CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
+PACKAGECONFIG[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0001-implement-libc-specific-_reopen_stream.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0001-implement-libc-specific-_reopen_stream.patch
deleted file mode 100644
index f0b4e71..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0001-implement-libc-specific-_reopen_stream.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 089c9c701a1b68b721f479dfc0c58c35b9dd4175 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:39:53 +0000
-Subject: [PATCH 1/4] implement libc specific _reopen_stream
-
-musl defines stdin/stdio/stderr as constant types which means
-we can not assign to them as we are doing here but works ok with glibc
-therefore abstract out the _reopen_stream definition depending upon if
-we are using glibc or otherwise
-
-Origin:
-http://git.alpinelinux.org/cgit/aports/tree/main/lvm2/fix-stdio-usage.patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- lib/commands/toolcontext.c | 22 +++++++++++-----------
- tools/lvmcmdline.c         |  6 +++---
- 2 files changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
-index a2f21b8..7f796e4 100644
---- a/lib/commands/toolcontext.c
-+++ b/lib/commands/toolcontext.c
-@@ -1637,7 +1637,10 @@ static void _init_globals(struct cmd_context *cmd)
- /*
-  * Close and reopen stream on file descriptor fd.
-  */
--static int _reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
-+#ifdef __GLIBC__
-+#define _reopen_stream(stream, fd, mode, name) __reopen_stream(stream, fd, mode, name, &stream)
-+
-+static int __reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
- {
- 	int fd_copy, new_fd;
- 
-@@ -1664,6 +1667,9 @@ static int _reopen_stream(FILE *stream, int fd, const char *mode, const char *na
- 
- 	return 1;
- }
-+#else
-+#define _reopen_stream(stream, fd, mode, name) (freopen(NULL, mode, stream) != NULL)
-+#endif
- 
- static int _init_lvmetad(struct cmd_context *cmd)
- {
-@@ -1741,7 +1747,6 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
- 				       unsigned set_filters)
- {
- 	struct cmd_context *cmd;
--	FILE *new_stream;
- 	int flags;
- 
- #ifdef M_MMAP_MAX
-@@ -1791,9 +1796,8 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
- 		if (is_valid_fd(STDIN_FILENO) &&
- 		    ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
- 		    (flags & O_ACCMODE) != O_WRONLY) {
--			if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream))
-+			if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin"))
- 				goto_out;
--			stdin = new_stream;
- 			if (setvbuf(stdin, cmd->linebuffer, _IOLBF, linebuffer_size)) {
- 				log_sys_error("setvbuf", "");
- 				goto out;
-@@ -1803,9 +1807,8 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
- 		if (is_valid_fd(STDOUT_FILENO) &&
- 		    ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
- 		    (flags & O_ACCMODE) != O_RDONLY) {
--			if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream))
-+			if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout"))
- 				goto_out;
--			stdout = new_stream;
- 			if (setvbuf(stdout, cmd->linebuffer + linebuffer_size,
- 				     _IOLBF, linebuffer_size)) {
- 				log_sys_error("setvbuf", "");
-@@ -2131,7 +2134,6 @@ int refresh_toolcontext(struct cmd_context *cmd)
- void destroy_toolcontext(struct cmd_context *cmd)
- {
- 	struct dm_config_tree *cft_cmdline;
--	FILE *new_stream;
- 	int flags;
- 
- 	if (cmd->dump_filter && cmd->filter && cmd->filter->dump &&
-@@ -2167,8 +2169,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
- 		if (is_valid_fd(STDIN_FILENO) &&
- 		    ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
- 		    (flags & O_ACCMODE) != O_WRONLY) {
--			if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) {
--				stdin = new_stream;
-+			if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin")) {
- 				setlinebuf(stdin);
- 			} else
- 				cmd->linebuffer = NULL;	/* Leave buffer in place (deliberate leak) */
-@@ -2177,8 +2178,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
- 		if (is_valid_fd(STDOUT_FILENO) &&
- 		    ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
- 		    (flags & O_ACCMODE) != O_RDONLY) {
--			if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) {
--				stdout = new_stream;
-+			if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout")) {
- 				setlinebuf(stdout);
- 			} else
- 				cmd->linebuffer = NULL;	/* Leave buffer in place (deliberate leak) */
-diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
-index 6577977..a33258a 100644
---- a/tools/lvmcmdline.c
-+++ b/tools/lvmcmdline.c
-@@ -1744,7 +1744,7 @@ static int _check_standard_fds(void)
- 	int err = is_valid_fd(STDERR_FILENO);
- 
- 	if (!is_valid_fd(STDIN_FILENO) &&
--	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
-+	    !freopen(_PATH_DEVNULL, "r", stdin)) {
- 		if (err)
- 			perror("stdin stream open");
- 		else
-@@ -1754,7 +1754,7 @@ static int _check_standard_fds(void)
- 	}
- 
- 	if (!is_valid_fd(STDOUT_FILENO) &&
--	    !(stdout = fopen(_PATH_DEVNULL, "w"))) {
-+	    !freopen(_PATH_DEVNULL, "w", stdout)) {
- 		if (err)
- 			perror("stdout stream open");
- 		/* else no stdout */
-@@ -1762,7 +1762,7 @@ static int _check_standard_fds(void)
- 	}
- 
- 	if (!is_valid_fd(STDERR_FILENO) &&
--	    !(stderr = fopen(_PATH_DEVNULL, "w"))) {
-+	    !freopen(_PATH_DEVNULL, "w", stderr)) {
- 		printf("stderr stream open: %s\n",
- 		       strerror(errno));
- 		return 0;
--- 
-2.7.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch
deleted file mode 100644
index 969a152..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From c8a1b669cbff3eee367fd4db3389e337bc4c98ba Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:46:26 +0000
-Subject: [PATCH 2/4] use PTHREAD_MUTEX_RECURSIVE instead of
- PTHREAD_MUTEX_RECURSIVE_NP
-
-PTHREAD_MUTEX_RECURSIVE_NP was used for compatibility with old glibc.
-Although due to the_GNU_SOURCES define the portable,
-PTHREAD_MUTEX_RECURSIVE will be available for Linuxes since at least
-1998. Simplify things giving us compatibility with musl which
-apparently does not provide the non-portable define.
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- daemons/lvmetad/lvmetad-core.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
-index 7af9bde..63707c2 100644
---- a/daemons/lvmetad/lvmetad-core.c
-+++ b/daemons/lvmetad/lvmetad-core.c
-@@ -300,7 +300,7 @@ static struct dm_config_tree *lock_vg(lvmetad_state *s, const char *id) {
- 	if (!(vg = dm_hash_lookup(s->lock.vg, id))) {
- 		if (!(vg = malloc(sizeof(pthread_mutex_t))) ||
- 		    pthread_mutexattr_init(&rec) ||
--		    pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP) ||
-+		    pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE) ||
- 		    pthread_mutex_init(vg, &rec))
- 			goto bad;
- 		if (!dm_hash_insert(s->lock.vg, id, vg)) {
-@@ -2890,7 +2890,7 @@ static int init(daemon_state *s)
- 	ls->log = s->log;
- 
- 	pthread_mutexattr_init(&rec);
--	pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP);
-+	pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE);
- 	pthread_mutex_init(&ls->lock.pvid_to_pvmeta, &rec);
- 	pthread_mutex_init(&ls->lock.vgid_to_metadata, &rec);
- 	pthread_mutex_init(&ls->lock.pvid_to_vgid, NULL);
--- 
-2.7.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0003-Guard-use-of-mallinfo-with-__GLIBC__.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0003-Guard-use-of-mallinfo-with-__GLIBC__.patch
deleted file mode 100644
index 3d71767..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0003-Guard-use-of-mallinfo-with-__GLIBC__.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From e018d055603389b22cbc3bd68b1525f3048ebee7 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:50:26 +0000
-Subject: [PATCH 3/4] Guard use of mallinfo() with __GLIBC__
-
-This API is glibc-only
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- lib/mm/memlock.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
-index 969f1d7..405a7c0 100644
---- a/lib/mm/memlock.c
-+++ b/lib/mm/memlock.c
-@@ -145,7 +145,7 @@ static void _touch_memory(void *mem, size_t size)
- 
- static void _allocate_memory(void)
- {
--#ifndef VALGRIND_POOL
-+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
- 	void *stack_mem;
- 	struct rlimit limit;
- 	int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;
--- 
-2.7.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
deleted file mode 100644
index 2a3b843..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 9b793d5b4adc5d8b3684e7f66943e236eae7c2db Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Jan 2016 04:52:59 +0000
-Subject: [PATCH 4/4] include fcntl.h for O_* defines and fcntl() signature
-
-On glibc _somehow_ this header gets pulled in indirectly
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- libdaemon/server/daemon-server.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
-index d9d60d1..433d100 100644
---- a/libdaemon/server/daemon-server.c
-+++ b/libdaemon/server/daemon-server.c
-@@ -18,6 +18,7 @@
- #include "daemon-server.h"
- #include "daemon-log.h"
- 
-+#include <fcntl.h>
- #include <dlfcn.h>
- #include <errno.h>
- #include <pthread.h>
--- 
-2.7.0
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0005-tweak-MODPROBE_CMD-for-cross-compile.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0005-tweak-MODPROBE_CMD-for-cross-compile.patch
deleted file mode 100644
index 8db320d..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2/0005-tweak-MODPROBE_CMD-for-cross-compile.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 72866782f83c8cf85b10017df461128af90cae6e Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Tue, 30 Aug 2016 22:33:47 -0400
-Subject: [PATCH] tweak MODPROBE_CMD for cross compile
-
-Lvm uses variable MODPROBE_CMD at runtime, so build time detection of modprobe
-is incorrect.
-------
-|lvm lvcreate --thinpool wrl/pool00 --size 5556m --config  devices
-{ preferred_names=["^/dev/mapper/", "^/dev/md/", "^/dev/sd"]
-filter=["r|/loop1$|","r|/loop2$|","r|/loop3$|","r|/loop4$|","r|/loop5$|","r|/loop6$|","r|/loop7$|"] }
-|tmp/sysroots/x86_64-linux/usr/bin/modprobe: execvp failed: No such file or directory
-|tmp/sysroots/x86_64-linux/usr/bin/modprobe failed: 2
-------
-
-Upstream-Status: Inappropriate [oe specific]
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- configure.in | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index 8e04782..77681b0 100644
---- a/configure.in
-+++ b/configure.in
-@@ -1779,8 +1779,6 @@ if test "$UDEV_SYNC" = yes; then
- fi
- 
- ################################################################################
--AC_PATH_TOOL(MODPROBE_CMD, modprobe)
--
- if test -n "$MODPROBE_CMD"; then
- 	AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
- fi
--- 
-2.8.1
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.138.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.138.bb
deleted file mode 100644
index 13a866e..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.138.bb
+++ /dev/null
@@ -1,4 +0,0 @@
-require lvm2.inc
-
-SRC_URI[md5sum] = "c660e02ad4586a1d297b6befbe85556d"
-SRC_URI[sha256sum] = "93878a4ba4f70d9f2d0d919eb85bc51652a58776b5428ec8e7e32769d332f596"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb
new file mode 100644
index 0000000..7939f05
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb
@@ -0,0 +1,81 @@
+require lvm2.inc
+
+SRC_URI[md5sum] = "c5a54ee0b86703daaad6e856439e115a"
+SRC_URI[sha256sum] = "e120b066b85b224552efda40204488c5123de068725676fd6e5c8bc655051b94"
+
+DEPENDS += "autoconf-archive-native"
+
+LVM2_PACKAGECONFIG = "dmeventd lvmetad"
+LVM2_PACKAGECONFIG_append_class-target = " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
+    thin-provisioning-tools \
+    udev \
+"
+
+PACKAGECONFIG ??= "${LVM2_PACKAGECONFIG}"
+
+# Unset user/group to unbreak install.
+EXTRA_OECONF = "--with-user= \
+                --with-group= \
+                --enable-realtime \
+                --enable-applib \
+                --enable-cmdlib \
+                --enable-pkgconfig \
+                --with-usrlibdir=${libdir} \
+                --with-systemdsystemunitdir=${systemd_system_unitdir} \
+                --disable-thin_check_needs_check \
+                --with-thin-check=${sbindir}/thin_check \
+                --with-thin-dump=${sbindir}/thin_dump \
+                --with-thin-repair=${sbindir}/thin_repair \
+                --with-thin-restore=${sbindir}/thin_restore \
+"
+
+CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
+
+do_install_append() {
+    # Install machine specific configuration file
+    install -d ${D}${sysconfdir}/lvm
+    install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
+    sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        oe_runmake 'DESTDIR=${D}' install install_systemd_units
+        sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
+    else
+        oe_runmake 'DESTDIR=${D}' install install_initscripts
+        mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
+        rm -rf ${D}${sysconfdir}/rc.d
+    fi
+    # Remove things related to libdevmapper
+    rm -f ${D}${sbindir}/dmsetup
+    rm -f ${D}${libdir}/libdevmapper.so.*
+    rm -f ${D}${libdir}/libdevmapper.so ${D}${libdir}/pkgconfig/devmapper.pc ${D}${includedir}/libdevmapper.h
+}
+
+PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \
+                         ${@bb.utils.contains('PACKAGECONFIG', 'lvmetad', 'lvm2-lvmetad.socket lvm2-pvscan@.service', '', d)} \
+                         blk-availability.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+FILES_${PN} += "${libdir}/device-mapper/*.so"
+FILES_${PN}-scripts = " \
+    ${sbindir}/blkdeactivate \
+    ${sbindir}/fsadm \
+    ${sbindir}/lvmconf \
+    ${sbindir}/lvmdump \
+"
+# Specified explicitly for the udev rules, just in case that it does not get picked
+# up automatically:
+FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d"
+RDEPENDS_${PN}_append_class-target = " libdevmapper"
+
+RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) bash"
+RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})"
+
+CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lzip/lzip_1.16.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/lzip/lzip_1.16.bb
index af0b6ae..a5d9962 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lzip/lzip_1.16.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lzip/lzip_1.16.bb
@@ -38,4 +38,4 @@
     fi
 }
 
-BBCLASSEXTEND += "native nativesdk"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch
deleted file mode 100644
index bea2f62..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog/mcelog-debash.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 8f57d35747a3b3fabc33466563077373090f869c Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Tue, 2 Sep 2014 07:05:15 -0700
-Subject: [PATCH] cache-error-trigger: remove bashism
-
-Use "$(cat $F)" to instead of "$(< $F)" to debash.
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- triggers/cache-error-trigger |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/triggers/cache-error-trigger b/triggers/cache-error-trigger
-index e32bfd6..785526f 100755
---- a/triggers/cache-error-trigger
-+++ b/triggers/cache-error-trigger
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!/bin/sh
- # cache error trigger. This shell script is executed by mcelog in daemon mode
- # when a CPU reports excessive corrected cache errors. This could be a indication
- # for future uncorrected errors.
-@@ -28,7 +28,7 @@ for i in $AFFECTED_CPUS ; do
- 	logger -s -p daemon.crit -t mcelog "Offlining CPU $i due to cache error threshold"
- 	F=$(printf "/sys/devices/system/cpu/cpu%d/online" $i)
- 	echo 0 > $F
--	if [ "$(< $F)" != "0" ] ; then
-+	if [ "$(cat $F)" != "0" ] ; then
- 		logger -s -p daemon.warn -t mcelog "Offlining CPU $i failed"
- 		EXIT=1
- 	fi
--- 
-1.7.9.5
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.40.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.40.bb
deleted file mode 100644
index 9aebbd5..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.40.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-SUMMARY = "mcelog daemon accounts memory and some other errors in various ways."
-DESCRIPTION = "mcelog is required by both 32bit x86 Linux kernels (since 2.6.30) \
-and 64bit Linux kernels (since early 2.6 kernel releases) to log machine checks \
-and should run on all Linux systems that need error handling."
-HOMEPAGE = "http://mcelog.org/"
-SECTION = "System Environment/Base"
-
-SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git;protocol=http; \
-    file://mcelog-debash.patch \
-    file://run-ptest \
-"
-
-SRCREV = "008c73e6de3a4bf969d1627e695d4efc807aed92"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://README;md5=3d12dd2a10bdd22379cc4c0fc6949a88"
-
-S = "${WORKDIR}/git"
-
-inherit autotools-brokensep ptest
-
-COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux'
-
-do_install_append() {
-    install -d ${D}${sysconfdir}/cron.hourly
-    install -m 0755 ${S}/mcelog.cron ${D}${sysconfdir}/cron.hourly/
-    sed -i 's/bash/sh/' ${D}${sysconfdir}/cron.hourly/mcelog.cron
-}
-
-do_install_ptest() {
-    install -d ${D}${PTEST_PATH}
-    cp -r ${S}/tests ${S}/input ${D}${PTEST_PATH}
-    sed -i 's#../../mcelog#mcelog#' ${D}${PTEST_PATH}/tests/test
-}
-
-RDEPENDS_${PN}-ptest += "${PN} make bash mce-inject"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.49.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.49.bb
new file mode 100644
index 0000000..84633a7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mcelog/mcelog_1.49.bb
@@ -0,0 +1,35 @@
+SUMMARY = "mcelog daemon accounts memory and some other errors in various ways."
+DESCRIPTION = "mcelog is required by both 32bit x86 Linux kernels (since 2.6.30) \
+and 64bit Linux kernels (since early 2.6 kernel releases) to log machine checks \
+and should run on all Linux systems that need error handling."
+HOMEPAGE = "http://mcelog.org/"
+SECTION = "System Environment/Base"
+
+SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git;protocol=http; \
+    file://run-ptest \
+"
+
+SRCREV = "2cfdf29b2ef98ccd5ed42cdde8bbe437e0d6412f"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://README.md;md5=279840fabb191e6cd9150492d31b0e20"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep ptest
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux'
+
+do_install_append() {
+    install -d ${D}${sysconfdir}/cron.hourly
+    install -m 0755 ${S}/mcelog.cron ${D}${sysconfdir}/cron.hourly/
+    sed -i 's/bash/sh/' ${D}${sysconfdir}/cron.hourly/mcelog.cron
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}
+    cp -r ${S}/tests ${S}/input ${D}${PTEST_PATH}
+    sed -i 's#../../mcelog#mcelog#' ${D}${PTEST_PATH}/tests/test
+}
+
+RDEPENDS_${PN}-ptest += "${PN} make bash mce-inject"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/files/remove_ncurses_check.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/files/remove_ncurses_check.patch
deleted file mode 100644
index 16137da..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/files/remove_ncurses_check.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -uwr mg-20110905/configure mg-20110905-changed/configure
---- mg-20110905/configure	2011-09-05 13:36:16.000000000 -0500
-+++ mg-20110905-changed/configure	2014-08-14 10:46:14.168715425 -0500
-@@ -163,32 +163,6 @@
-     echo 'Fails.'
- fi
- 
--
--if [ ! -r /usr/include/term.h ]; then
--    note 'term.h'
--    if [ -r /usr/include/ncurses/term.h ]; then
--	echo "Found in /usr/include/ncurses"
--	extraflags="$extraflags -I/usr/include/ncurses"
--    else
--	for i in pkg local; do
--	    if [ -r /usr/$i/include/term.h ]; then
--		echo "Found in /usr/$i/include"
--		extralibs="$extralibs -L/usr/$i/lib"
--		extraflags="$extraflags -I/usr/$i/include"
--		break
--	    else
--		false
--	    fi
--	done ||
--	{
--	    echo 'Not found!' >&2
--	    echo 'Do you have the ncurses devel package installed?' >&2
--	    echo 'If you know where term.h is, please email the author!' >&2
--	    exit 1
--	}
--    fi
--fi
--
- note 'base and dirname'
- if gcc_defines "__GLIBC__" || gcc_defines "__CYGWIN__" ; then
-     echo 'Not present, adding.'
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-Undefine-REGEX-for-musl-based-systems.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-Undefine-REGEX-for-musl-based-systems.patch
new file mode 100644
index 0000000..1302679
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-Undefine-REGEX-for-musl-based-systems.patch
@@ -0,0 +1,39 @@
+From a370ccd9447752c555aeca04f64021efedde4db3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 7 Apr 2017 17:16:19 -0700
+Subject: [PATCH] Undefine REGEX for musl based systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ GNUmakefile | 1 -
+ Makefile    | 2 +-
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/GNUmakefile b/GNUmakefile
+index 7bf7dca..0e10030 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -41,7 +41,6 @@ endif
+ CC?=		gcc
+ CFLAGS?=	-O2 -pipe
+ CFLAGS+=	-g -Wall
+-CPPFLAGS=	-DREGEX
+ CPPFLAGS+=	-D_GNU_SOURCE
+ CPPFLAGS+=	$(BSD_CPPFLAGS) -D__dead=__dead2
+ LIBS=		$(CURSES_LIBS) $(BSD_LIBS)
+diff --git a/Makefile b/Makefile
+index 94ce340..d516bbc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -10,7 +10,7 @@ DPADD+=	${LIBCURSES} ${LIBUTIL}
+ #	REGEX		-- create regular expression functions.
+ #	STARTUPFILE	-- look for and handle initialization file.
+ #
+-CFLAGS+=-Wall -DREGEX
++CFLAGS+=-Wall
+ 
+ SRCS=	autoexec.c basic.c bell.c buffer.c cinfo.c dir.c display.c \
+ 	echo.c extend.c file.c fileio.c funmap.c help.c kbd.c keymap.c \
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-fileio-Include-sys-param.h-for-MAXNAMLEN.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-fileio-Include-sys-param.h-for-MAXNAMLEN.patch
new file mode 100644
index 0000000..551f1df
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0001-fileio-Include-sys-param.h-for-MAXNAMLEN.patch
@@ -0,0 +1,25 @@
+From 51539bcd2ee9f765595c0be16eebc1daee112b27 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 7 Apr 2017 16:52:59 -0700
+Subject: [PATCH 1/2] fileio: Include sys/param.h for MAXNAMLEN
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ fileio.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/fileio.c b/fileio.c
+index 48a67a2..9b69665 100644
+--- a/fileio.c
++++ b/fileio.c
+@@ -12,6 +12,7 @@
+ #include <sys/time.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#include <sys/param.h>
+ #include <dirent.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0002-fileio-Define-DEFFILEMODE-if-platform-is-missing.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0002-fileio-Define-DEFFILEMODE-if-platform-is-missing.patch
new file mode 100644
index 0000000..907d670
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg/0002-fileio-Define-DEFFILEMODE-if-platform-is-missing.patch
@@ -0,0 +1,28 @@
+From ce24a29cabb8f1774d262e120e5764a2afeb3825 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 7 Apr 2017 16:53:49 -0700
+Subject: [PATCH 2/2] fileio: Define DEFFILEMODE if platform is missing
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ fileio.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/fileio.c b/fileio.c
+index 9b69665..a852fd2 100644
+--- a/fileio.c
++++ b/fileio.c
+@@ -28,6 +28,10 @@
+ #include "kbd.h"
+ #include "pathnames.h"
+ 
++#if !defined(DEFFILEMODE)
++# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
++#endif
++
+ static char *bkuplocation(const char *);
+ static int   bkupleavetmp(const char *);
+ 
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20161005.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20161005.bb
deleted file mode 100644
index f9ceb46..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20161005.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-SUMMARY = "A portable version of the mg maintained by the OpenBSD team"
-HOMEPAGE = "http://homepage.boetes.org/software/mg/"
-LICENSE = "PD"
-LIC_FILES_CHKSUM = "file://version.c;md5=1895eb37bf6bd79cdc5c89d8166fabfb"
-DEPENDS = "ncurses libbsd"
-SECTION = "console/editors"
-
-SRC_URI = "http://homepage.boetes.org/software/mg/mg-${PV}.tar.gz"
-SRC_URI[md5sum] = "fc6faeeee7308bb46f3512b75867ed51"
-SRC_URI[sha256sum] = "b7fcb5136a6783ca24c8463ab0852fc1f26bdb2bb1c24759b2c51ccfc46c5e61"
-
-# CFLAGS isn't in EXTRA_OEMAKE, as the makefile picks it up via ?=
-EXTRA_OEMAKE = "\
-    'CC=${CC}' \
-    'LDFLAGS=${LDFLAGS}' \
-    \
-    'prefix=${prefix}' \
-    'bindir=${bindir}' \
-    'libdir=${libdir}' \
-    'includedir=${includedir}' \
-    'mandir=${mandir}' \
-    'PKG_CONFIG=pkg-config' \
-"
-
-CFLAGS += "-I${STAGING_INCDIR}/bsd"
-
-do_install () {
-    oe_runmake install DESTDIR=${D}
-}
-
-inherit pkgconfig
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20170401.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20170401.bb
new file mode 100644
index 0000000..dad1d00
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mg/mg_20170401.bb
@@ -0,0 +1,37 @@
+SUMMARY = "A portable version of the mg maintained by the OpenBSD team"
+HOMEPAGE = "http://homepage.boetes.org/software/mg/"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://version.c;md5=1895eb37bf6bd79cdc5c89d8166fabfb"
+DEPENDS = "ncurses libbsd"
+SECTION = "console/editors"
+
+SRC_URI = "http://homepage.boetes.org/software/mg/mg-${PV}.tar.gz \
+           file://0001-fileio-Include-sys-param.h-for-MAXNAMLEN.patch \
+           file://0002-fileio-Define-DEFFILEMODE-if-platform-is-missing.patch \
+           "
+SRC_URI_append_libc-musl = "\
+           file://0001-Undefine-REGEX-for-musl-based-systems.patch \
+           "
+SRC_URI[md5sum] = "884388589fb38c2109ad9fed328be20a"
+SRC_URI[sha256sum] = "0a3608b17c153960cb1d954ca3b62445a77c0c1a18aa5c8c58aba9f6b8d62aab"
+
+# CFLAGS isn't in EXTRA_OEMAKE, as the makefile picks it up via ?=
+EXTRA_OEMAKE = "\
+    'CC=${CC}' \
+    'LDFLAGS=${LDFLAGS}' \
+    \
+    'prefix=${prefix}' \
+    'bindir=${bindir}' \
+    'libdir=${libdir}' \
+    'includedir=${includedir}' \
+    'mandir=${mandir}' \
+    'PKG_CONFIG=pkg-config' \
+"
+
+CFLAGS += "-I${STAGING_INCDIR}/bsd"
+
+do_install () {
+    oe_runmake install DESTDIR=${D}
+}
+
+inherit pkgconfig
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0001-multipathd.service-Error-fix.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0001-multipathd.service-Error-fix.patch
index 1e48e1c..60c3c0a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0001-multipathd.service-Error-fix.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0001-multipathd.service-Error-fix.patch
@@ -1,4 +1,4 @@
-From 74ff5e1cf8ef83dabcf6e6b92f87d6761f7f4d51 Mon Sep 17 00:00:00 2001
+From 630483b9738349c8b3e637a00879b96834a33cdb Mon Sep 17 00:00:00 2001
 From: Li xin <lixin.fnst@cn.fujitsu.com>
 Date: Tue, 7 Jul 2015 11:34:36 +0900
 Subject: [PATCH] multipathd.service: Error fix
@@ -13,10 +13,10 @@
  1 file changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service
-index be3ba3f..b8d3ecd 100644
+index e3d6f91..a7e00b2 100644
 --- a/multipathd/multipathd.service
 +++ b/multipathd/multipathd.service
-@@ -6,11 +6,12 @@ DefaultDependencies=no
+@@ -8,11 +8,12 @@ Wants=local-fs-pre.target multipathd.socket blk-availability.service
  Conflicts=shutdown.target
  
  [Service]
@@ -25,12 +25,12 @@
  NotifyAccess=main
  LimitCORE=infinity
 +PIDFile=/var/run/multipathd.pid
- ExecStartPre=/sbin/modprobe dm-multipath
+ ExecStartPre=/sbin/modprobe -a scsi_dh_alua scsi_dh_emc scsi_dh_rdac dm-multipath
 -ExecStart=/sbin/multipathd -d -s
 +ExecStart=/sbin/multipathd
  ExecReload=/sbin/multipathd reconfigure
  
  [Install]
 -- 
-1.8.4.2
+2.11.0
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch
index a16a854..803e52c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch
@@ -1,4 +1,7 @@
-Always use devmapper for kpartx
+From 7267cf235fc052eaa1ca36e437096576edacb131 Mon Sep 17 00:00:00 2001
+From: Aws Ismail <aws.ismail@windriver.com>
+Date: Mon, 22 Sep 2014 17:22:32 -0700
+Subject: [PATCH] Always use devmapper for kpartx
 
 Do not try to compute the LIBDM_API_COOKIE make variable
 from host information when cross-compiling.
@@ -7,23 +10,27 @@
 
 Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
 Signed-off-by: Joe Slater <joe.slater@windriver.com>
+---
+ kpartx/Makefile | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
 
 diff --git a/kpartx/Makefile b/kpartx/Makefile
-index 2a07334..24bdabc 100644
+index e8a59f2..e694a65 100644
 --- a/kpartx/Makefile
 +++ b/kpartx/Makefile
-@@ -4,13 +4,7 @@
- #
- include ../Makefile.inc
+@@ -7,11 +7,7 @@ CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
  
--CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
--
+ LIBDEPS += -ldevmapper
+ 
 -LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h)
 -
 -ifneq ($(strip $(LIBDM_API_COOKIE)),0)
 -	CFLAGS += -DLIBDM_API_COOKIE
 -endif
-+CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DLIBDM_API_COOKIE
++CFLAGS += -DLIBDM_API_COOKIE
  
- LDFLAGS = -ldevmapper
  OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \
+ 	gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch
index 89d2352..33834f6 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch
@@ -1,4 +1,7 @@
-Always use devmapper
+From c4f0dba4e86bfa20252fcc8218398e7468ca9149 Mon Sep 17 00:00:00 2001
+From: Aws Ismail <aws.ismail@windriver.com>
+Date: Mon, 22 Sep 2014 17:22:32 -0700
+Subject: [PATCH] Always use devmapper
 
 Do not try to compute several _API_ make variables
 from host information when cross-compiling.
@@ -7,38 +10,48 @@
 
 Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
 Signed-off-by: Joe Slater <joe.slater@windriver.com>
+---
+ libmultipath/Makefile | 27 ++++-----------------------
+ 1 file changed, 4 insertions(+), 23 deletions(-)
 
 diff --git a/libmultipath/Makefile b/libmultipath/Makefile
-index e5b06b3..efd6cf6 100644
+index 495cebe..9626e69 100644
 --- a/libmultipath/Makefile
 +++ b/libmultipath/Makefile
-@@ -17,23 +17,18 @@ OBJS = memory.o parser.o vector.o devmapper.o \
-        log.o configure.o structs_vec.o sysfs.o prio.o checkers.o \
-        lock.o waiter.o file.o wwids.o
+@@ -20,29 +20,10 @@ ifdef SYSTEMD
+ 	endif
+ endif
  
 -LIBDM_API_FLUSH = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_no_flush' /usr/include/libdevmapper.h)
- 
+-
 -ifneq ($(strip $(LIBDM_API_FLUSH)),0)
-+#ifneq ($(strip $(LIBDM_API_FLUSH)),0)
- 	CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
+-	CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
 -endif
-+#endif
- 
+-
 -LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h)
 -
 -ifneq ($(strip $(LIBDM_API_COOKIE)),0)
-+#ifneq ($(strip $(LIBDM_API_COOKIE)),0)
- 	CFLAGS += -DLIBDM_API_COOKIE
+-	CFLAGS += -DLIBDM_API_COOKIE
 -endif
 -
--LIBUDEV_API_RECVBUF = $(shell grep -Ecs '^[a-z]*[[:space:]]+udev_monitor_set_resolve_buffer_size' /usr/include/libudev.h)
-+#endif
- 
+-LIBUDEV_API_RECVBUF = $(shell grep -Ecs '^[a-z]*[[:space:]]+udev_monitor_set_receive_buffer_size' /usr/include/libudev.h)
+-
 -ifneq ($(strip $(LIBUDEV_API_RECVBUF)),0)
-+#ifneq ($(strip $(LIBUDEV_API_RECVBUF)),0)
- 	CFLAGS += -DLIBUDEV_API_RECVBUF
+-	CFLAGS += -DLIBUDEV_API_RECVBUF
 -endif
-+#endif
+-
+-LIBDM_API_DEFERRED = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_deferred_remove' /usr/include/libdevmapper.h)
+-
+-ifneq ($(strip $(LIBDM_API_DEFERRED)),0)
+-	CFLAGS += -DLIBDM_API_DEFERRED
+-endif
++CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
++CFLAGS += -DLIBDM_API_COOKIE
++CFLAGS += -DLIBUDEV_API_RECVBUF
++CFLAGS += -DLIBDM_API_DEFERRED
  
- 
- all: $(LIBS)
+ OBJS = memory.o parser.o vector.o devmapper.o callout.o \
+ 	hwtable.o blacklist.o util.o dmparser.o config.o \
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/checkers-disable-libcheckrbd.so.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/checkers-disable-libcheckrbd.so.patch
new file mode 100644
index 0000000..908a516
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/checkers-disable-libcheckrbd.so.patch
@@ -0,0 +1,31 @@
+From 148b848f45957e5e1c0466e8c79c84ba4a0bf241 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Fri, 27 Jan 2017 10:35:54 +0100
+Subject: [PATCH] checkers: disable libcheckrbd.so
+
+libcheckrbd.so depends on librados, which is not currently available
+as a recipe. These checkers seem to be optional, so for now we merely
+disable compilation of libcheckrbd.so.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ libmultipath/checkers/Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile
+index 11ab76f..c848d50 100644
+--- a/libmultipath/checkers/Makefile
++++ b/libmultipath/checkers/Makefile
+@@ -14,7 +14,6 @@ LIBS= \
+ 	libcheckemc_clariion.so \
+ 	libcheckhp_sw.so \
+ 	libcheckrdac.so \
+-	libcheckrbd.so
+ 
+ all: $(LIBS)
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/do-not-link-libmpathpersist-to-TMPDIR.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/do-not-link-libmpathpersist-to-TMPDIR.patch
deleted file mode 100644
index 86d5e0e..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/do-not-link-libmpathpersist-to-TMPDIR.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From fe65ac8face3c88d9d4e12811f44e63ad72c59ae Mon Sep 17 00:00:00 2001
-From: Bian Naimeng <biannm@cn.fujitsu.com>
-Date: Thu, 18 Jun 2015 12:25:25 +0900
-Subject: [PATCH] fix build warning
-
-  NOTE: Executing RunQueue Tasks
-  WARNING: QA Issue: Symlink /lib/libmpathpersist.so in multipath-tools-dev points to TMPDIR [symlink-to-sysroot]
-  NOTE: Tasks Summary: Attempted 1604 tasks of which 1591 didn't need to be rerun and all succeeded.
-
-Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
----
- libmpathpersist/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/libmpathpersist/Makefile b/libmpathpersist/Makefile
-index c4ec1c5..62022eb 100644
---- a/libmpathpersist/Makefile
-+++ b/libmpathpersist/Makefile
-@@ -32,7 +32,7 @@ install: $(LIBS)
- 	$(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(man3dir)
- 	$(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)/usr/include/
- 	$(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)/usr/share/doc/mpathpersist/
--	ln -sf $(DESTDIR)$(syslibdir)/$(LIBS) $(DESTDIR)$(syslibdir)/$(DEVLIB)
-+	ln -sf $(syslibdir)/$(LIBS) $(DESTDIR)$(syslibdir)/$(DEVLIB)
- 	install -m 644 mpath_persistent_reserve_in.3.gz $(DESTDIR)$(man3dir)	
- 	install -m 644 mpath_persistent_reserve_out.3.gz $(DESTDIR)$(man3dir)	
- 	install -m 644 mpath_persist.h $(DESTDIR)/usr/include/
--- 
-1.8.4.2
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch
index 71963e0..5b7b696 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch
@@ -1,4 +1,8 @@
-multipath-tools: modify Makefile.inc for cross-compilation
+From 9f5768eca165502b0f17d271aa6f7cf530ec60b2 Mon Sep 17 00:00:00 2001
+From: Joe Slater <joe.slater@windriver.com>
+Date: Mon, 22 Sep 2014 17:22:32 -0700
+Subject: [PATCH] multipath-tools: modify Makefile.inc for
+ cross-compilation
 
 Do not look for systemd info on the host, and allow us to pass in CFLAGS
 using the OPTFLAGS variable.
@@ -10,10 +14,15 @@
 Update for version 0.5.0-144-g770e6d0
 
 Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ Makefile.inc | 17 +++++------------
+ 1 file changed, 5 insertions(+), 12 deletions(-)
 
+diff --git a/Makefile.inc b/Makefile.inc
+index 1cc8f44..15f8b91 100644
 --- a/Makefile.inc
 +++ b/Makefile.inc
-@@ -21,12 +21,6 @@ ifndef LIB
+@@ -29,12 +29,6 @@ ifndef RUN
  	endif
  endif
  
@@ -26,14 +35,25 @@
  ifndef SYSTEMDPATH
  	SYSTEMDPATH=usr/lib
  endif
-@@ -53,7 +47,10 @@ ifndef RPM_OPT_FLAGS
- 	RPM_OPT_FLAGS = -O2 -g -pipe -Wformat-security -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
- endif
+@@ -61,13 +55,12 @@ RM		= rm -f
+ LN		= ln -sf
+ INSTALL_PROGRAM	= install
  
+-OPTFLAGS	= -O2 -g -pipe -Wall -Wextra -Wformat=2 \
+-		  -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \
+-		  -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector \
+-		  --param=ssp-buffer-size=4
 +ifndef OPTFLAGS
- OPTFLAGS     = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes
++OPTFLAGS     = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes
 +endif
-+
- CFLAGS	     = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\"
- SHARED_FLAGS = -shared
  
+-CFLAGS		= $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\"
+-SHARED_FLAGS	= -shared
++CFLAGS	     = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\"
++SHARED_FLAGS = -shared
+ 
+ %.o:	%.c
+ 	$(CC) $(CFLAGS) -c -o $@ $<
+-- 
+2.11.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/shared-libs-avoid-linking-.so-as-executable.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/shared-libs-avoid-linking-.so-as-executable.patch
new file mode 100644
index 0000000..88579e6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/shared-libs-avoid-linking-.so-as-executable.patch
@@ -0,0 +1,55 @@
+From 4311856200480288494df8df737f71ea316592d0 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Thu, 26 Jan 2017 15:28:34 +0100
+Subject: [PATCH] shared libs: avoid linking .so as executable
+
+When the OE build systems sets CFLAGS including -pie, gcc overrides
+the earlier -shared parameter and tries to link a binary, leading to
+errors about missing functions like main().
+
+Reordering the parameters so that -shared comes after CFLAGS
+fixes this.
+
+Upstream-Status: Inappropriate [OE specific, -pie shouldn't be in CFLAGS?!]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+diff --git a/libmpathcmd/Makefile b/libmpathcmd/Makefile
+index 457c4ca..f68c82c 100644
+--- a/libmpathcmd/Makefile
++++ b/libmpathcmd/Makefile
+@@ -9,7 +9,7 @@ OBJS = mpath_cmd.o
+ all: $(LIBS)
+ 
+ $(LIBS): $(OBJS)
+-	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS) $(LIBDEPS)
++	$(CC) $(LDFLAGS) $(CFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ -o $@ $(OBJS) $(LIBDEPS)
+ 	$(LN) $@ $(DEVLIB)
+ 
+ install: $(LIBS)
+diff --git a/libmpathpersist/Makefile b/libmpathpersist/Makefile
+index 6e43427..2486302 100644
+--- a/libmpathpersist/Makefile
++++ b/libmpathpersist/Makefile
+@@ -15,7 +15,7 @@ all: $(LIBS)
+ 
+ $(LIBS):
+ 	$(CC) -c $(CFLAGS) *.c
+-	$(CC) $(LDFLAGS) $(SHARED_FLAGS) $(LIBDEPS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS)
++	$(CC) $(LDFLAGS) $(CFLAGS) $(SHARED_FLAGS) $(LIBDEPS) -Wl,-soname=$@ -o $@ $(OBJS)
+ 	$(LN) $(LIBS) $(DEVLIB)
+ 	$(GZIP) mpath_persistent_reserve_in.3 > mpath_persistent_reserve_in.3.gz
+ 	$(GZIP) mpath_persistent_reserve_out.3 > mpath_persistent_reserve_out.3.gz
+diff --git a/libmultipath/Makefile b/libmultipath/Makefile
+index 495cebe..752bcc0 100644
+--- a/libmultipath/Makefile
++++ b/libmultipath/Makefile
+@@ -55,7 +55,7 @@ OBJS = memory.o parser.o vector.o devmapper.o callout.o \
+ all: $(LIBS)
+ 
+ $(LIBS): $(OBJS)
+-	$(CC) $(LDFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS) $(LIBDEPS)
++	$(CC) $(LDFLAGS) $(CFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ -o $@ $(OBJS) $(LIBDEPS)
+ 	$(LN) $@ $(DEVLIB)
+ 
+ install:
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb
index 6bd6118..5f8c422 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb
@@ -1,6 +1,6 @@
 SUMMARY = "The upstream project used to drive the Device Mapper multipathing driver"
 
-DEPENDS = "lvm2 libaio readline udev"
+DEPENDS = "libdevmapper libaio liburcu readline udev"
 
 LICENSE = "LGPLv2"
 
@@ -9,56 +9,48 @@
            file://makefile_inc.patch \
            file://always-use-libdevmapper.patch \
            file://always-use-libdevmapper-kpartx.patch \
-           file://do-not-link-libmpathpersist-to-TMPDIR.patch \
            file://0001-multipathd.service-Error-fix.patch \
+           file://shared-libs-avoid-linking-.so-as-executable.patch \
+           file://checkers-disable-libcheckrbd.so.patch \
            "
-# 0.5.0
-#
-#SRCREV = "82f391e787dc02e9d9294aa391137ab424bb83c4"
-#LIC_FILES_CHKSUM = "file://COPYING;md5=7be2873b6270e45abacc503abbe2aa3d"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
 
-# 0.5.0 + commits thru 7/18/2014
-#
-#SRCREV = "0d72f46c12207a6b7b89f5ef4f5ab5f87ed8bc90"
-#LIC_FILES_CHKSUM = "file://COPYING;md5=b06690e7a95c166eefe0199b39118eb1"
-
-# 0.5.0 + commits thru 9/12/2014
-#
-#    includes important systemd related structure size fix
-#
-#SRCREV = "aec68ab217fd2956443b27ceeb97dd6475267789"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b06690e7a95c166eefe0199b39118eb1"
-
-# 0.5.0 + commits thru 2/16/2015
-SRCREV = "770e6d0da035deaced82885939161c2b69225e10"
+# 0.6.4
+SRCREV = "922421cf795d53d339862bb2d99f1a85c96ad9a3"
 
 inherit systemd
 
 
 S = "${WORKDIR}/git"
 
-PV = "0.5.0+git${@'${SRCPV}'.split('+')[-1]}"
+PV = "0.6.4+git${@'${SRCPV}'.split('+')[-1]}"
 
 TARGET_CC_ARCH += "${LDFLAGS}"
 
+# multipath-tools includes a copy of the valgrind.h header
+# file and uses the macros to suppress some false positives. However,
+# that only works on ARM when thumb is disabled. Otherwise one gets:
+#   Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r12,r12,ror#3'
+#   ../Makefile.inc:66: recipe for target 'debug.o' failed
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
 # The exact version of SYSTEMD does not matter but should be greater than 209.
 #
 EXTRA_OEMAKE = 'MULTIPATH_VERSION=${PV} DESTDIR=${D} syslibdir=${base_libdir} \
                 OPTFLAGS="${CFLAGS}" \
+                bindir=${base_sbindir} \
                 LIB=${base_libdir} libdir=${base_libdir}/multipath \
-                unitdir=/lib/systemd/system \
+                unitdir=${systemd_system_unitdir} \
                 ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "SYSTEMD=216", "", d)} \
                '
 
 do_install() {
     oe_runmake install
 
-    # Copy a sample conf file, but do not rename it multipath.conf.
-    #
-    cp multipath.conf.defaults ${D}${sysconfdir}
-
     # We copy an initscript, but do not start multipathd at init time.
     #
+    install -d ${D}${sysconfdir}/init.d
     cp ${WORKDIR}/multipathd.oe ${D}${sysconfdir}/init.d/multipathd
 
 }
@@ -68,11 +60,12 @@
 # systemd and udev stuff always goes under /lib!
 #
 FILES_${PN} += "${base_libdir}/multipath \
-                /lib/systemd"
+                ${systemd_system_unitdir} \
+		"
 
 PACKAGES =+ "kpartx"
 FILES_kpartx = "${base_sbindir}/kpartx \
-                /usr/lib/udev/kpartx_id \
+                ${nonarch_libdir}/udev/kpartx_id \
                "
 
 RDEPENDS_${PN} += "kpartx"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb-native_5.5.52.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb-native_5.5.55.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb-native_5.5.52.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb-native_5.5.55.bb
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb.inc
index 689b8ab..fd9dcbd 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb.inc
@@ -16,9 +16,11 @@
            file://configure.cmake-fix-valgrind.patch \
            file://fix-a-building-failure.patch \
            file://change-cc-to-cc-version.patch \
+           file://0001-disable-ucontext-on-musl.patch \
+           file://gcc7.patch \
           "
-SRC_URI[md5sum] = "fca86f1eaed2163b4bdce4f98f472324"
-SRC_URI[sha256sum] = "e142f9459507b97c5848042863b313ce70750118446bb4e35e5c07fe66007293"
+SRC_URI[md5sum] = "54a0bbbc9b67308e7c076622d02f0fcd"
+SRC_URI[sha256sum] = "cb94e315d0fc90c62db5a6c7829c9966f674285d99b3ba3ffa575fb4a26edc86"
 
 S = "${WORKDIR}/mariadb-${PV}"
 
@@ -48,7 +50,7 @@
 
 EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} setupdb"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} setupdb"
 PACKAGECONFIG_class-native = ""
 PACKAGECONFIG[pam] = ",-DWITHOUT_AUTH_PAM=TRUE,libpam"
 PACKAGECONFIG[valgrind] = "-DWITH_VALGRIND=TRUE,-DWITH_VALGRIND=FALSE,valgrind"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/0001-disable-ucontext-on-musl.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/0001-disable-ucontext-on-musl.patch
new file mode 100644
index 0000000..60e9199
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/0001-disable-ucontext-on-musl.patch
@@ -0,0 +1,28 @@
+From 5bc3e7ef9700d12054e0125a126f1bb093f01ef9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 26 Mar 2017 14:30:33 -0700
+Subject: [PATCH] disable ucontext on musl
+
+musl does not have *contex() APIs even though it has ucontext.h header
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/my_context.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/my_context.h b/include/my_context.h
+index dd44103..9b28c17 100644
+--- a/include/my_context.h
++++ b/include/my_context.h
+@@ -31,7 +31,7 @@
+ #define MY_CONTEXT_USE_X86_64_GCC_ASM
+ #elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__)
+ #define MY_CONTEXT_USE_I386_GCC_ASM
+-#elif defined(HAVE_UCONTEXT_H)
++#elif defined(__GLIBC__) && defined(HAVE_UCONTEXT_H)
+ #define MY_CONTEXT_USE_UCONTEXT
+ #else
+ #define MY_CONTEXT_DISABLE
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/gcc7.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/gcc7.patch
new file mode 100644
index 0000000..3e75b26
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb/gcc7.patch
@@ -0,0 +1,13 @@
+Index: mariadb-5.5.55/client/mysql.cc
+===================================================================
+--- mariadb-5.5.55.orig/client/mysql.cc
++++ mariadb-5.5.55/client/mysql.cc
+@@ -2850,7 +2850,7 @@ You can turn off this feature to get a q
+         mysql_free_result(fields);
+         break;
+       }
+-      field_names[i][num_fields*2]= '\0';
++      field_names[i][num_fields*2][0]= '\0';
+       j=0;
+       while ((sql_field=mysql_fetch_field(fields)))
+       {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb_5.5.52.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb_5.5.55.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb_5.5.52.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/mysql/mariadb_5.5.55.bb
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano-2.2.5/ncursesw.includedir.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano-2.2.5/ncursesw.includedir.patch
deleted file mode 100644
index 0f224be..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano-2.2.5/ncursesw.includedir.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -uNr nano-2.2.5.orig//configure.ac nano-2.2.5/configure.ac
---- nano-2.2.5.orig//configure.ac	2010-08-06 03:00:51.000000000 +0200
-+++ nano-2.2.5/configure.ac	2010-08-10 14:11:52.000000000 +0200
-@@ -442,7 +442,7 @@
-     AC_CHECK_HEADERS(ncurses.h)
- 
-     if test x$enable_utf8 != xno; then
--	AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CPPFLAGS="-I/usr/include/ncursesw $CPPFLAGS" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
-+	AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
-     fi
- 
-     if eval "test x$CURSES_LIB_NAME = x"; then
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano.inc
index 3fad029..22f0fb2 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano.inc
@@ -5,15 +5,13 @@
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
 SECTION = "console/utils"
-DEPENDS = "ncurses"
+DEPENDS = "ncurses file"
 RDEPENDS_${PN} = "ncurses-terminfo"
 
-INC_PR = "r3"
+PV_MAJOR = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 
-PV_MAJOR = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+SRC_URI = "https://nano-editor.org/dist/v${PV_MAJOR}/nano-${PV}.tar.xz"
 
-SRC_URI = "ftp://nano-editor.org/pub/nano/v${PV_MAJOR}/nano-${PV}.tar.gz"
+inherit autotools gettext pkgconfig
 
-inherit autotools gettext
-
-PACKAGECONFIG[tiny] = "--enable-tiny,--enable-all,"
+PACKAGECONFIG[tiny] = "--enable-tiny,"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.2.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.2.5.bb
deleted file mode 100644
index e656f46..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.2.5.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-include nano.inc
-
-PR = "${INC_PR}.0"
-
-SRC_URI += "file://ncursesw.includedir.patch"
-
-SRC_URI[md5sum] = "77a10a49589f975ce98350a4527a2ebf"
-SRC_URI[sha256sum] = "9015945d1badabbada203b37c4779d3dd1066234235c714deb439989c5cd7d9e"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.7.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.7.4.bb
new file mode 100644
index 0000000..eaf393e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/nano/nano_2.7.4.bb
@@ -0,0 +1,4 @@
+include nano.inc
+
+SRC_URI[md5sum] = "c011c7f9e47cb1da27d4e7cc8b56ec6a"
+SRC_URI[sha256sum] = "752170643039e2c95a433de357f0c70a8c4c4c561a90a7e7259a63e225b659b9"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-CMakeLists.txt-Remove-mthumb-interwork.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-CMakeLists.txt-Remove-mthumb-interwork.patch
new file mode 100644
index 0000000..9f2faaa
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-CMakeLists.txt-Remove-mthumb-interwork.patch
@@ -0,0 +1,44 @@
+From 8a0d1cbfcc0649b2696c9cf20f877366de259ce3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 12 Nov 2016 18:15:26 +0000
+Subject: [PATCH] CMakeLists.txt: Remove -mthumb-interwork
+
+This option is meaningless with aapcs ABI
+which is the default for Linux and android
+for armv7+ architectures
+
+As an aside it helps in compiling with clang
+where this option is absent
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CMakeLists.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 784a5a8..68da920 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -117,7 +117,7 @@ if(ANDROID_PLATFORM)
+ 
+     # Adding cflags for armv7. Aarch64 does not need such flags.
+     if(${NE10_TARGET_ARCH} STREQUAL "armv7")
+-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=${FLOAT_ABI} -mfpu=vfp3")
++        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a -mfloat-abi=${FLOAT_ABI} -mfpu=vfp3")
+         if(NE10_ARM_HARD_FLOAT)
+             # "--no-warn-mismatch" is needed for linker to suppress linker error about not all functions use VFP register to pass argument, eg.
+             #   .../arm-linux-androideabi/bin/ld: error: ..../test-float.o
+@@ -138,8 +138,8 @@ if(ANDROID_PLATFORM)
+     ${CMAKE_C_FLAGS}")
+ elseif(GNULINUX_PLATFORM)
+     if("${NE10_TARGET_ARCH}" STREQUAL "armv7")
+-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3 -funsafe-math-optimizations")
+-      set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfpu=neon")
++      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a -mfpu=vfp3 -funsafe-math-optimizations")
++      set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a -mfpu=neon")
+       # Turn on asm optimization for Linux on ARM v7.
+       set(NE10_ASM_OPTIMIZATION on)
+     endif()
+-- 
+1.8.3.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-Dont-specify-march-explicitly.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-Dont-specify-march-explicitly.patch
new file mode 100644
index 0000000..a8fea82
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10/0001-Dont-specify-march-explicitly.patch
@@ -0,0 +1,38 @@
+From 66d332e4b631eef800c6f62cd347b164ee3b59d4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Apr 2017 10:11:21 -0700
+Subject: [PATCH] Dont specify -march explicitly
+
+it assumes armv7-a for all armv7 based machines but that may
+not be true e.g. machines based on armv7ve and cortexa-7
+it causes conflicts in OE builds because it specifies -march
+in recipes anyway so this is redundant in CMakeLists.txt
+
+Fixes
+
+| cc1: warning: switch -mcpu=cortex-a7 conflicts with -march=armv7-a switch
+| cc1: warning: switch -mcpu=cortex-a7 conflicts with -march=armv7-a switch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 68da920..a4b94b9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -138,8 +138,8 @@ if(ANDROID_PLATFORM)
+     ${CMAKE_C_FLAGS}")
+ elseif(GNULINUX_PLATFORM)
+     if("${NE10_TARGET_ARCH}" STREQUAL "armv7")
+-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a -mfpu=vfp3 -funsafe-math-optimizations")
+-      set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a -mfpu=neon")
++      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb -mfpu=vfp3 -funsafe-math-optimizations")
++      set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb -mfpu=neon")
+       # Turn on asm optimization for Linux on ARM v7.
+       set(NE10_ASM_OPTIMIZATION on)
+     endif()
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10_1.2.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10_1.2.1.bb
index de97982..e5b50ce 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10_1.2.1.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ne10/ne10_1.2.1.bb
@@ -1,13 +1,17 @@
 DESCRIPTION = "Library containing NEON-optimized implementations for a common set of functions"
 HOMEPAGE = "http://projectne10.github.io/Ne10/"
 LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=463ac0a7d64edc2b787c4206635ca2b1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e7fe20c9be97be5579e3ab5d92d3a218"
 SECTION = "libs"
 
-SRC_URI = "git://github.com/projectNe10/Ne10.git"
-SRCREV = "a08b29d88e3c94d32b5b8f827e7fcf0bc2b34ac2"
+SRC_URI = "git://github.com/projectNe10/Ne10.git \
+           file://0001-CMakeLists.txt-Remove-mthumb-interwork.patch \
+           file://0001-Dont-specify-march-explicitly.patch \
+           "
+SRCREV = "18c4c982a595dad069cd8df4932aefb1d257591f"
 
 S = "${WORKDIR}/git"
+PV .= "gitr+${SRCPV}"
 
 inherit cmake
 
@@ -18,10 +22,10 @@
 COMPATIBLE_MACHINE_armv7a = "(.*)"
 
 python () {
-    if any(t.startswith('armv7') for t in d.getVar('TUNE_FEATURES', True).split()):
+    if any(t.startswith('armv7') for t in d.getVar('TUNE_FEATURES').split()):
         d.setVar('NE10_TARGET_ARCH', 'armv7')
         bb.debug(2, 'Building Ne10 for armv7')
-    elif any(t.startswith('aarch64') for t in d.getVar('TUNE_FEATURES', True).split()):
+    elif any(t.startswith('aarch64') for t in d.getVar('TUNE_FEATURES').split()):
         d.setVar('NE10_TARGET_ARCH', 'aarch64')
         bb.debug(2, 'Building Ne10 for aarch64')
     else:
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/ode/ode_0.13.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/ode/ode_0.13.bb
index 2dc82a8..c90c819 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/ode/ode_0.13.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/ode/ode_0.13.bb
@@ -26,3 +26,6 @@
 # if it isn't explicitly selected and "$build_os" == "$target_os", then configure will run
 # series of AC_TRY_RUN which won't work for cross-compilation and configure fails
 PACKAGECONFIG[double-precision] = "--enable-double-precision,--disable-double-precision"
+
+PNBLACKLIST[ode] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130599/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+PNBLACKLIST[ode] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130620/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/open-vcdiff/open-vcdiff_0.8.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/open-vcdiff/open-vcdiff_0.8.4.bb
index c32668b..d3f2e78 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/open-vcdiff/open-vcdiff_0.8.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/open-vcdiff/open-vcdiff_0.8.4.bb
@@ -18,4 +18,4 @@
 inherit autotools
 
 # http://errors.yoctoproject.org/Errors/Details/68667/
-PNBLACKLIST[open-vcdiff] ?= "BROKEN: fails to build with gcc-6"
+PNBLACKLIST[open-vcdiff] ?= "BROKEN: fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openct/openct_0.6.20.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/openct/openct_0.6.20.bb
index d4ad9c1..0f5568c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/openct/openct_0.6.20.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openct/openct_0.6.20.bb
@@ -24,7 +24,7 @@
 LICENSE = "LGPLv2+"
 LIC_FILES_CHKSUM = "file://LGPL-2.1;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
-inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
+inherit ${@bb.utils.filter('VIRTUAL-RUNTIME_init_manager', 'systemd', d)}
 SYSTEMD_SERVICE_${PN} += "openct.service "
 SYSTEMD_AUTO_ENABLE = "enable"
 
@@ -34,7 +34,7 @@
     --enable-pcsc \
     --enable-doc \
     --enable-api-doc \
-    --with-udev=/lib/udev \
+    --with-udev=${nonarch_base_libdir}/udev \
     --with-bundle=${libdir}/pcsc/drivers \
 "
 
@@ -42,7 +42,7 @@
 
 FILES_${PN} += " \
     ${libdir}/ctapi \
-    /lib/udev \
+    ${nonarch_base_libdir}/udev \
     ${libdir}/openct-ifd.so \
     ${libdir}/pcsc \
     /run/openct/status \
@@ -62,7 +62,7 @@
 do_install () {
     rm -rf ${D}
     install -d ${D}/etc
-    install -dm 755 ${D}/lib/udev
+    install -dm 755 ${D}${nonarch_base_libdir}/udev
     # fix up hardcoded paths
     sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \
         ${WORKDIR}/openct.service ${WORKDIR}/openct.init
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv-samples_2.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv-samples_2.4.bb
index b8e3a2d..107184b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv-samples_2.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv-samples_2.4.bb
@@ -38,4 +38,4 @@
 FILES_${PN}-dev += "${datadir}/opencv/samples/*.c* ${datadir}/opencv/samples/*.vcp* ${datadir}/opencv/samples/build*"
 FILES_${PN} += "${bindir} ${datadir}/opencv"
 
-PNBLACKLIST[opencv-samples] ?= "Depends on blacklisted opencv"
+PNBLACKLIST[opencv-samples] ?= "Depends on blacklisted opencv - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch
index d568018..1077d05 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch
@@ -17,7 +17,7 @@
    endif()
  
 +  if(NOT DEFINED OPENCV_ICV_PATH)
-   set(OPENCV_ICV_UNPACK_PATH "${CMAKE_CURRENT_LIST_DIR}/unpack")
+   set(OPENCV_ICV_UNPACK_PATH "${CMAKE_BINARY_DIR}/3rdparty/ippicv")
    set(OPENCV_ICV_PATH "${OPENCV_ICV_UNPACK_PATH}${OPENCV_ICV_PACKAGE_SUBDIR}")
 +  endif()
  
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Make-opencv-ts-create-share-library-intead-of-static.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Make-opencv-ts-create-share-library-intead-of-static.patch
new file mode 100644
index 0000000..05ec41f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Make-opencv-ts-create-share-library-intead-of-static.patch
@@ -0,0 +1,26 @@
+From 49d1f7c40a5d097f23671318045ac54bc07846cf Mon Sep 17 00:00:00 2001
+From: Bian Naimeng <biannm@cn.fujitsu.com>
+Date: Wed, 19 Apr 2017 03:11:37 +0900
+Subject: [PATCH] Make opencv-ts create share library intead of static.
+
+Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
+---
+ modules/ts/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt
+index bb56da2..7bb4ce9 100644
+--- a/modules/ts/CMakeLists.txt
++++ b/modules/ts/CMakeLists.txt
+@@ -4,7 +4,7 @@ if(IOS)
+   ocv_module_disable(ts)
+ endif()
+ 
+-set(OPENCV_MODULE_TYPE STATIC)
++#set(OPENCV_MODULE_TYPE STATIC)
+ set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
+ 
+ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
+-- 
+1.8.4.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Revert-cuda-fix-fp16-compilation.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Revert-cuda-fix-fp16-compilation.patch
new file mode 100644
index 0000000..507d796
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Revert-cuda-fix-fp16-compilation.patch
@@ -0,0 +1,27 @@
+From 69f9707678190f6a0948a547dce948251f972676 Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <Randy.MacLeod@windriver.com>
+Date: Wed, 26 Apr 2017 14:57:30 -0400
+Subject: [PATCH 1/2] Revert "cuda: fix fp16 compilation"
+
+This reverts commit 12e00827be40576b686ea4438a6e6ef85208743d.
+---
+ modules/core/include/opencv2/core/cvdef.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h
+index 699b166..efc24ca 100644
+--- a/modules/core/include/opencv2/core/cvdef.h
++++ b/modules/core/include/opencv2/core/cvdef.h
+@@ -303,8 +303,7 @@ enum CpuFeatures {
+ #define CV_2PI 6.283185307179586476925286766559
+ #define CV_LOG2 0.69314718055994530941723212145818
+ 
+-#if defined __ARM_FP16_FORMAT_IEEE \
+-    && !defined __CUDACC__
++#if defined (__ARM_FP16_FORMAT_IEEE)
+ #  define CV_FP16_TYPE 1
+ #else
+ #  define CV_FP16_TYPE 0
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-To-fix-errors-as-following.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-To-fix-errors-as-following.patch
new file mode 100644
index 0000000..820ab81
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-To-fix-errors-as-following.patch
@@ -0,0 +1,53 @@
+From db1d9cc82b68f6593360d66ef40cb6b0fc377e6e Mon Sep 17 00:00:00 2001
+From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+Date: Fri, 19 May 2017 04:27:50 +0900
+Subject: [PATCH] To fix errors as following:
+
+"test_main.cpp:45: undefined reference to `parseCustomOptions(int, char**)'"
+"perf_abs.cpp:13: undefined reference to `cvtest::param_seed'"
+"test_superres.cpp:270: undefined reference to `checkIppStatus()'"
+
+Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+---
+ modules/ts/include/opencv2/ts.hpp        | 4 ++--
+ modules/ts/include/opencv2/ts/ts_ext.hpp | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/modules/ts/include/opencv2/ts.hpp b/modules/ts/include/opencv2/ts.hpp
+index c573905..7ff6cc1 100644
+--- a/modules/ts/include/opencv2/ts.hpp
++++ b/modules/ts/include/opencv2/ts.hpp
+@@ -539,7 +539,7 @@ protected:
+     }
+ };
+ 
+-extern uint64 param_seed;
++CV_EXPORTS extern uint64 param_seed;
+ 
+ struct CV_EXPORTS DefaultRngAuto
+ {
+@@ -602,7 +602,7 @@ void dumpOpenCLDevice();
+ #define TEST_DUMP_OCL_INFO
+ #endif
+ 
+-void parseCustomOptions(int argc, char **argv);
++CV_EXPORTS void parseCustomOptions(int argc, char **argv);
+ 
+ #define CV_TEST_MAIN(resourcesubdir, ...) \
+ int main(int argc, char **argv) \
+diff --git a/modules/ts/include/opencv2/ts/ts_ext.hpp b/modules/ts/include/opencv2/ts/ts_ext.hpp
+index 05ccc63..8075065 100644
+--- a/modules/ts/include/opencv2/ts/ts_ext.hpp
++++ b/modules/ts/include/opencv2/ts/ts_ext.hpp
+@@ -9,7 +9,7 @@
+ #define OPENCV_TS_EXT_HPP
+ 
+ namespace cvtest {
+-void checkIppStatus();
++CV_EXPORTS void checkIppStatus();
+ }
+ 
+ #define CV_TEST_INIT \
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-tracking-make-opencv_dnn-dependancy-optional.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-tracking-make-opencv_dnn-dependancy-optional.patch
new file mode 100644
index 0000000..fba43eb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-tracking-make-opencv_dnn-dependancy-optional.patch
@@ -0,0 +1,243 @@
+From 69f86025978b9bbbefa54a7248316a859773aeaf Mon Sep 17 00:00:00 2001
+From: berak <px1704@web.de>
+Date: Sat, 4 Mar 2017 12:38:50 +0100
+Subject: [PATCH] tracking: make opencv_dnn dependancy optional
+
+Upstream-status: Backport [https://github.com/opencv/opencv_contrib/commit/43925b60d392fbd01d6b0449713f010f9babe448]
+Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
+
+---
+ modules/tracking/CMakeLists.txt                   |  3 +--
+ modules/tracking/samples/goturnTracker.cpp        | 22 +++++++++++++++++++---
+ modules/tracking/samples/multiTracker_dataset.cpp |  1 +
+ modules/tracking/samples/tracker_dataset.cpp      |  1 +
+ modules/tracking/src/gtrTracker.cpp               | 11 ++++++++++-
+ modules/tracking/src/gtrTracker.hpp               | 12 ++++++++----
+ modules/tracking/src/gtrUtils.cpp                 |  6 +++---
+ modules/tracking/src/gtrUtils.hpp                 |  5 ++---
+ modules/tracking/src/tracker.cpp                  |  1 +
+ 9 files changed, 46 insertions(+), 16 deletions(-)
+
+diff --git a/modules/tracking/CMakeLists.txt b/modules/tracking/CMakeLists.txt
+index a8b3183..d27f999 100644
+--- a/modules/tracking/CMakeLists.txt
++++ b/modules/tracking/CMakeLists.txt
+@@ -1,2 +1 @@
+-set(the_description "Tracking API")
+-ocv_define_module(tracking opencv_imgproc opencv_core opencv_video opencv_highgui opencv_dnn opencv_plot OPTIONAL opencv_datasets WRAP python)
+\ No newline at end of file
++ocv_define_module(tracking opencv_imgproc opencv_core opencv_video opencv_highgui opencv_plot OPTIONAL opencv_dnn opencv_datasets WRAP python)
+diff --git a/modules/tracking/samples/goturnTracker.cpp b/modules/tracking/samples/goturnTracker.cpp
+index 389771e..1e6632d 100644
+--- a/modules/tracking/samples/goturnTracker.cpp
++++ b/modules/tracking/samples/goturnTracker.cpp
+@@ -45,6 +45,9 @@
+ //1 - Train you own GOTURN model using <https://github.com/Auron-X/GOTURN_Training_Toolkit>
+ //2 - Download pretrained caffemodel from <https://github.com/opencv/opencv_extra>
+ 
++#include "opencv2/opencv_modules.hpp"
++#if defined(HAVE_OPENCV_DNN) && defined(HAVE_OPENCV_DATASETS)
++
+ #include "opencv2/datasets/track_alov.hpp"
+ #include <opencv2/core/utility.hpp>
+ #include <opencv2/tracking.hpp>
+@@ -65,8 +68,8 @@ static bool startSelection = false;
+ Rect2d boundingBox;
+ 
+ static const char* keys =
+-{ "{@dataset_path     |true| Dataset path     }"
+-"{@dataset_id     |1| Dataset ID     }"
++{ "{@dataset_path     || Dataset path   }"
++  "{@dataset_id      |1| Dataset ID     }"
+ };
+ 
+ static void onMouse(int event, int x, int y, int, void*)
+@@ -144,9 +147,14 @@ int main(int argc, char *argv[])
+     Ptr<cv::datasets::TRACK_alov> dataset = TRACK_alov::create();
+     dataset->load(datasetRootPath);
+     dataset->initDataset(datasetID);
+-
+     //Read first frame
+     dataset->getNextFrame(frame);
++    if (frame.empty())
++    {
++        cout << "invalid dataset: " << datasetRootPath << endl;
++        return -2;
++    }
++
+     frame.copyTo(image);
+     rectangle(image, boundingBox, Scalar(255, 0, 0), 2, 1);
+     imshow("GOTURN Tracking", image);
+@@ -215,3 +223,11 @@ int main(int argc, char *argv[])
+ 
+     return 0;
+ }
++
++#else // ! HAVE_OPENCV_DNN && HAVE_OPENCV_DATASETS
++#include <opencv2/core.hpp>
++int main() {
++    CV_Error(cv::Error::StsNotImplemented , "this sample needs to be built with opencv_datasets and opencv_dnn !");
++    return -1;
++}
++#endif
+diff --git a/modules/tracking/samples/multiTracker_dataset.cpp b/modules/tracking/samples/multiTracker_dataset.cpp
+index 2826b19..b5c27da 100644
+--- a/modules/tracking/samples/multiTracker_dataset.cpp
++++ b/modules/tracking/samples/multiTracker_dataset.cpp
+@@ -234,6 +234,7 @@ int main(int argc, char *argv[])
+ }
+ 
+ #else // ! HAVE_OPENCV_DATASETS
++#include <opencv2/core.hpp>
+ int main() {
+ 	CV_Error(cv::Error::StsNotImplemented , "this sample needs to be built with opencv_datasets !");
+ 	return -1;
+diff --git a/modules/tracking/samples/tracker_dataset.cpp b/modules/tracking/samples/tracker_dataset.cpp
+index 8b7832a..6178105 100644
+--- a/modules/tracking/samples/tracker_dataset.cpp
++++ b/modules/tracking/samples/tracker_dataset.cpp
+@@ -234,6 +234,7 @@ int main(int argc, char *argv[])
+ 
+ 
+ #else // ! HAVE_OPENCV_DATASETS
++#include <opencv2/core.hpp>
+ int main() {
+ 	CV_Error(cv::Error::StsNotImplemented , "this sample needs to be built with opencv_datasets !");
+ 	return -1;
+diff --git a/modules/tracking/src/gtrTracker.cpp b/modules/tracking/src/gtrTracker.cpp
+index 58debfd..4904f47 100644
+--- a/modules/tracking/src/gtrTracker.cpp
++++ b/modules/tracking/src/gtrTracker.cpp
+@@ -38,7 +38,7 @@
+ // the use of this software, even if advised of the possibility of such damage.
+ //
+ //M*/
+-
++#include "opencv2/opencv_modules.hpp"
+ #include "gtrTracker.hpp"
+ 
+ 
+@@ -54,9 +54,16 @@ void TrackerGOTURN::Params::write(cv::FileStorage& /*fs*/) const {}
+ 
+ Ptr<TrackerGOTURN> TrackerGOTURN::createTracker(const TrackerGOTURN::Params &parameters)
+ {
++#ifdef HAVE_OPENCV_DNN
+     return Ptr<gtr::TrackerGOTURNImpl>(new gtr::TrackerGOTURNImpl(parameters));
++#else
++    (void)(parameters);
++    CV_ErrorNoReturn(cv::Error::StsNotImplemented , "to use GOTURN, the tracking module needs to be built with opencv_dnn !");
++#endif
+ }
+ 
++
++#ifdef HAVE_OPENCV_DNN
+ namespace gtr
+ {
+ 
+@@ -183,9 +190,11 @@ bool TrackerGOTURNImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
+     //Set new model image and BB from current frame
+     ((TrackerGOTURNModel*)static_cast<TrackerModel*>(model))->setImage(curFrame);
+     ((TrackerGOTURNModel*)static_cast<TrackerModel*>(model))->setBoudingBox(curBB);
++
+     return true;
+ }
+ 
+ }
++#endif // OPENCV_HAVE_DNN
+ 
+ }
+diff --git a/modules/tracking/src/gtrTracker.hpp b/modules/tracking/src/gtrTracker.hpp
+index 34f2c48..21ae3d9 100644
+--- a/modules/tracking/src/gtrTracker.hpp
++++ b/modules/tracking/src/gtrTracker.hpp
+@@ -45,11 +45,15 @@
+ 
+ #include "precomp.hpp"
+ #include "opencv2/video/tracking.hpp"
+-#include "opencv2/dnn.hpp"
+ #include "gtrUtils.hpp"
+ #include "opencv2/imgproc.hpp"
+-#include<algorithm>
+-#include<limits.h>
++
++#include <algorithm>
++#include <limits.h>
++
++#include "opencv2/opencv_modules.hpp"
++#ifdef HAVE_OPENCV_DNN
++#include "opencv2/dnn.hpp"
+ 
+ namespace cv
+ {
+@@ -72,5 +76,5 @@ public:
+ 
+ }
+ }
+-
++#endif
+ #endif
+diff --git a/modules/tracking/src/gtrUtils.cpp b/modules/tracking/src/gtrUtils.cpp
+index 0df1197..e80dda1 100644
+--- a/modules/tracking/src/gtrUtils.cpp
++++ b/modules/tracking/src/gtrUtils.cpp
+@@ -58,7 +58,7 @@ double generateRandomLaplacian(double b, double m)
+         return m - b*log(n);
+ }
+ 
+-Rect2f anno2rect(vector<Point2f> annoBB)
++Rect2f anno2rect(std::vector<Point2f> annoBB)
+ {
+     Rect2f rectBB;
+     rectBB.x = min(annoBB[0].x, annoBB[1].x);
+@@ -69,9 +69,9 @@ Rect2f anno2rect(vector<Point2f> annoBB)
+     return rectBB;
+ }
+ 
+-vector <TrainingSample> gatherFrameSamples(Mat prevFrame, Mat currFrame, Rect2f prevBB, Rect2f currBB)
++std::vector <TrainingSample> gatherFrameSamples(Mat prevFrame, Mat currFrame, Rect2f prevBB, Rect2f currBB)
+ {
+-    vector <TrainingSample> trainingSamples;
++    std::vector <TrainingSample> trainingSamples;
+     Point2f currCenter, prevCenter;
+     Rect2f targetPatchRect, searchPatchRect;
+     Mat targetPatch, searchPatch;
+diff --git a/modules/tracking/src/gtrUtils.hpp b/modules/tracking/src/gtrUtils.hpp
+index 8f388be..41aad21 100644
+--- a/modules/tracking/src/gtrUtils.hpp
++++ b/modules/tracking/src/gtrUtils.hpp
+@@ -4,7 +4,6 @@
+ #include "precomp.hpp"
+ #include <vector>
+ #include "opencv2/highgui.hpp"
+-#include <opencv2/datasets/track_alov.hpp>
+ 
+ namespace cv
+ {
+@@ -50,10 +49,10 @@ struct TrainingSample
+ double generateRandomLaplacian(double b, double m);
+ 
+ //Convert ALOV300++ anno coordinates to Rectangle BB
+-Rect2f anno2rect(vector<Point2f> annoBB);
++Rect2f anno2rect(std::vector<Point2f> annoBB);
+ 
+ //Gather samples from random video frame
+-vector <TrainingSample> gatherFrameSamples(Mat prevFrame, Mat currFrame, Rect2f prevBB, Rect2f currBB);
++std::vector <TrainingSample> gatherFrameSamples(Mat prevFrame, Mat currFrame, Rect2f prevBB, Rect2f currBB);
+ 
+ }
+ }
+diff --git a/modules/tracking/src/tracker.cpp b/modules/tracking/src/tracker.cpp
+index 8127f2a..b96aca8 100644
+--- a/modules/tracking/src/tracker.cpp
++++ b/modules/tracking/src/tracker.cpp
+@@ -112,6 +112,7 @@ Ptr<Tracker> Tracker::create( const String& trackerType )
+   BOILERPLATE_CODE("TLD",TrackerTLD);
+   BOILERPLATE_CODE("KCF",TrackerKCF);
+   BOILERPLATE_CODE("GOTURN", TrackerGOTURN);
++
+   return Ptr<Tracker>();
+ }
+ 
+-- 
+2.9.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0002-Revert-check-FP16-build-condition-correctly.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0002-Revert-check-FP16-build-condition-correctly.patch
new file mode 100644
index 0000000..d1950a9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0002-Revert-check-FP16-build-condition-correctly.patch
@@ -0,0 +1,245 @@
+From 9108e39e5584ef9b41f80751639b4ec72b3e9538 Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <Randy.MacLeod@windriver.com>
+Date: Wed, 26 Apr 2017 15:00:32 -0400
+Subject: [PATCH 2/2] Revert "check FP16 build condition correctly"
+
+This reverts commit c7cb116dc08441fe56cf82d5b21f929e5b674c13.
+
+Fix up revert conflicts to take previous behaviour.
+---
+ cmake/OpenCVCompilerOptions.cmake         | 45 +++++++++--------------
+ modules/core/include/opencv2/core/cvdef.h |  2 +-
+ modules/core/src/convert.cpp              | 11 +++---
+ modules/core/test/test_intrin.cpp         | 60 ++++++++++++++-----------------
+ 4 files changed, 48 insertions(+), 70 deletions(-)
+
+diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake
+index 5bb0479..4b19fdb 100644
+--- a/cmake/OpenCVCompilerOptions.cmake
++++ b/cmake/OpenCVCompilerOptions.cmake
+@@ -185,7 +185,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+     add_extra_compiler_option("-mfp16-format=ieee")
+   endif(ARM)
+   if(ENABLE_NEON)
+-    add_extra_compiler_option("-mfpu=neon")
++    add_extra_compiler_option("-mfpu=neon-fp16")
+   endif()
+   if(ENABLE_VFPV3 AND NOT ENABLE_NEON)
+     add_extra_compiler_option("-mfpu=vfpv3")
+@@ -370,34 +370,6 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_OPENCV_GCC_VERSION_NUM GREATER 399)
+   add_extra_compiler_option(-fvisibility-inlines-hidden)
+ endif()
+ 
+-if(NOT OPENCV_FP16_DISABLE AND NOT IOS)
+-  if(ARM AND ENABLE_NEON)
+-    set(FP16_OPTION "-mfpu=neon-fp16")
+-  elseif((X86 OR X86_64) AND NOT MSVC AND ENABLE_AVX)
+-    set(FP16_OPTION "-mf16c")
+-  endif()
+-  try_compile(__VALID_FP16
+-    "${OpenCV_BINARY_DIR}"
+-    "${OpenCV_SOURCE_DIR}/cmake/checks/fp16.cpp"
+-    COMPILE_DEFINITIONS "-DCHECK_FP16" "${FP16_OPTION}"
+-    OUTPUT_VARIABLE TRY_OUT
+-    )
+-  if(NOT __VALID_FP16)
+-    if((X86 OR X86_64) AND NOT MSVC AND NOT ENABLE_AVX)
+-      # GCC enables AVX when mf16c is passed
+-      message(STATUS "FP16: Feature disabled")
+-    else()
+-      message(STATUS "FP16: Compiler support is not available")
+-    endif()
+-  else()
+-    message(STATUS "FP16: Compiler support is available")
+-    set(HAVE_FP16 1)
+-    if(NOT ${FP16_OPTION} STREQUAL "")
+-      add_extra_compiler_option(${FP16_OPTION})
+-    endif()
+-  endif()
+-endif()
+-
+ #combine all "extra" options
+ set(CMAKE_C_FLAGS           "${CMAKE_C_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_C_FLAGS}")
+ set(CMAKE_CXX_FLAGS         "${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}")
+@@ -450,6 +422,21 @@ if(MSVC)
+   endif()
+ endif()
+ 
++if(NOT OPENCV_FP16_DISABLE)
++  try_compile(__VALID_FP16
++    "${OpenCV_BINARY_DIR}"
++    "${OpenCV_SOURCE_DIR}/cmake/checks/fp16.cpp"
++    COMPILE_DEFINITIONS "-DCHECK_FP16"
++    OUTPUT_VARIABLE TRY_OUT
++    )
++  if(NOT __VALID_FP16)
++    message(STATUS "FP16: Compiler support is not available")
++  else()
++    message(STATUS "FP16: Compiler support is available")
++    set(HAVE_FP16 1)
++  endif()
++endif()
++
+ if(APPLE AND NOT CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{LDFLAGS} AND EXISTS "/usr/local/lib")
+   link_directories("/usr/local/lib")
+ endif()
+diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h
+index efc24ca..a10936b 100644
+--- a/modules/core/include/opencv2/core/cvdef.h
++++ b/modules/core/include/opencv2/core/cvdef.h
+@@ -312,7 +312,7 @@ enum CpuFeatures {
+ typedef union Cv16suf
+ {
+     short i;
+-#if CV_FP16_TYPE
++#if ( defined (__arm__) || defined (__aarch64__) ) && !defined (__CUDACC__) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) )
+     __fp16 h;
+ #endif
+     struct _fp16Format
+diff --git a/modules/core/src/convert.cpp b/modules/core/src/convert.cpp
+index e04d89e..46db26f 100644
+--- a/modules/core/src/convert.cpp
++++ b/modules/core/src/convert.cpp
+@@ -44,7 +44,6 @@
+ #include "precomp.hpp"
+ 
+ #include "opencl_kernels_core.hpp"
+-#include "opencv2/core/hal/intrin.hpp"
+ 
+ #include "opencv2/core/openvx/ovx_defs.hpp"
+ 
+@@ -4382,7 +4381,7 @@ struct Cvt_SIMD<float, int>
+ 
+ #endif
+ 
+-#if !CV_FP16_TYPE
++#if !( ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) ) )
+ // const numbers for floating points format
+ const unsigned int kShiftSignificand    = 13;
+ const unsigned int kMaskFp16Significand = 0x3ff;
+@@ -4390,7 +4389,7 @@ const unsigned int kBiasFp16Exponent    = 15;
+ const unsigned int kBiasFp32Exponent    = 127;
+ #endif
+ 
+-#if CV_FP16_TYPE
++#if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) )
+ static float convertFp16SW(short fp16)
+ {
+     // Fp16 -> Fp32
+@@ -4452,7 +4451,7 @@ static float convertFp16SW(short fp16)
+ }
+ #endif
+ 
+-#if CV_FP16_TYPE
++#if ( defined (__arm__) || defined (__aarch64__) ) && ( defined (__GNUC__) && ( ( ( 4 <= __GNUC__ ) && ( 7 <= __GNUC__ ) ) || ( 5 <= __GNUC__ ) ) )
+ static short convertFp16SW(float fp32)
+ {
+     // Fp32 -> Fp16
+@@ -4560,7 +4559,7 @@ cvtScaleHalf_<float, short>( const float* src, size_t sstep, short* dst, size_t
+             if ( ( (intptr_t)dst & 0xf ) == 0 )
+ #endif
+             {
+-#if CV_FP16 && CV_SIMD128
++#if CV_FP16
+                 for ( ; x <= size.width - 4; x += 4)
+                 {
+                     v_float32x4 v_src = v_load(src + x);
+@@ -4606,7 +4605,7 @@ cvtScaleHalf_<short, float>( const short* src, size_t sstep, float* dst, size_t
+             if ( ( (intptr_t)src & 0xf ) == 0 )
+ #endif
+             {
+-#if CV_FP16 && CV_SIMD128
++#if CV_FP16
+                 for ( ; x <= size.width - 4; x += 4)
+                 {
+                     v_float16x4 v_src = v_load_f16(src + x);
+diff --git a/modules/core/test/test_intrin.cpp b/modules/core/test/test_intrin.cpp
+index 66b2083..7349d48 100644
+--- a/modules/core/test/test_intrin.cpp
++++ b/modules/core/test/test_intrin.cpp
+@@ -729,56 +729,48 @@ template<typename R> struct TheTest
+         return *this;
+     }
+ 
++#if CV_FP16
+     TheTest & test_loadstore_fp16()
+     {
+-#if CV_FP16
+         AlignedData<R> data;
+         AlignedData<R> out;
+ 
+-        if(checkHardwareSupport(CV_CPU_FP16))
+-        {
+-            // check if addresses are aligned and unaligned respectively
+-            EXPECT_EQ((size_t)0, (size_t)&data.a.d % 16);
+-            EXPECT_NE((size_t)0, (size_t)&data.u.d % 16);
+-            EXPECT_EQ((size_t)0, (size_t)&out.a.d % 16);
+-            EXPECT_NE((size_t)0, (size_t)&out.u.d % 16);
+-
+-            // check some initialization methods
+-            R r1 = data.u;
+-            R r2 = v_load_f16(data.a.d);
+-            R r3(r2);
+-            EXPECT_EQ(data.u[0], r1.get0());
+-            EXPECT_EQ(data.a[0], r2.get0());
+-            EXPECT_EQ(data.a[0], r3.get0());
+-
+-            // check some store methods
+-            out.a.clear();
+-            v_store_f16(out.a.d, r1);
+-            EXPECT_EQ(data.a, out.a);
+-        }
++        // check if addresses are aligned and unaligned respectively
++        EXPECT_EQ((size_t)0, (size_t)&data.a.d % 16);
++        EXPECT_NE((size_t)0, (size_t)&data.u.d % 16);
++        EXPECT_EQ((size_t)0, (size_t)&out.a.d % 16);
++        EXPECT_NE((size_t)0, (size_t)&out.u.d % 16);
++
++        // check some initialization methods
++        R r1 = data.u;
++        R r2 = v_load_f16(data.a.d);
++        R r3(r2);
++        EXPECT_EQ(data.u[0], r1.get0());
++        EXPECT_EQ(data.a[0], r2.get0());
++        EXPECT_EQ(data.a[0], r3.get0());
++
++        // check some store methods
++        out.a.clear();
++        v_store_f16(out.a.d, r1);
++        EXPECT_EQ(data.a, out.a);
+ 
+         return *this;
+-#endif
+     }
+ 
+     TheTest & test_float_cvt_fp16()
+     {
+-#if CV_FP16
+         AlignedData<v_float32x4> data;
+ 
+-        if(checkHardwareSupport(CV_CPU_FP16))
+-        {
+-            // check conversion
+-            v_float32x4 r1 = v_load(data.a.d);
+-            v_float16x4 r2 = v_cvt_f16(r1);
+-            v_float32x4 r3 = v_cvt_f32(r2);
+-            EXPECT_EQ(0x3c00, r2.get0());
+-            EXPECT_EQ(r3.get0(), r1.get0());
+-        }
++        // check conversion
++        v_float32x4 r1 = v_load(data.a.d);
++        v_float16x4 r2 = v_cvt_f16(r1);
++        v_float32x4 r3 = v_cvt_f32(r2);
++        EXPECT_EQ(0x3c00, r2.get0());
++        EXPECT_EQ(r3.get0(), r1.get0());
+ 
+         return *this;
+-#endif
+     }
++#endif
+ 
+ };
+ 
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/fixgcc60.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/fixgcc60.patch
deleted file mode 100644
index 5d0bf97..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/fixgcc60.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake
-index 28ccc1c6be4f..b0e1cbf77287 100644
---- a/cmake/OpenCVPCHSupport.cmake
-+++ b/cmake/OpenCVPCHSupport.cmake
-@@ -19,7 +19,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
-         ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
-         OUTPUT_VARIABLE gcc_compiler_version)
-     #MESSAGE("GCC Version: ${gcc_compiler_version}")
--    IF(gcc_compiler_version VERSION_GREATER "4.2.-1")
-+    IF(gcc_compiler_version VERSION_GREATER "4.2.-1" AND gcc_compiler_version VERSION_LESS "6.0.0")
-         SET(PCHSupport_FOUND TRUE)
-     ENDIF()
- 
-diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake
-index 3a23cd73633d..1fea1578b1d9 100644
---- a/cmake/OpenCVUtils.cmake
-+++ b/cmake/OpenCVUtils.cmake
-@@ -76,7 +76,11 @@ function(ocv_include_directories)
-     if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}")
-       list(APPEND __add_before "${dir}")
-     else()
--      include_directories(AFTER SYSTEM "${dir}")
-+	    if (gcc_compiler_version VERSION_LESS "6.0.0")
-+		    include_directories(AFTER SYSTEM "${dir}")
-+	    else()
-+		    include_directories(AFTER "${dir}")
-+	    endif()
-     endif()
-   endforeach()
-   include_directories(BEFORE ${__add_before})
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/uselocalxfeatures.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/uselocalxfeatures.patch
new file mode 100644
index 0000000..a2db48d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/uselocalxfeatures.patch
@@ -0,0 +1,12 @@
+diff --git a/modules/xfeatures2d/CMakeLists.txt b/modules/xfeatures2d/CMakeLists.txt
+index f295bddaed66..6086e75ec37b 100644
+--- a/modules/xfeatures2d/CMakeLists.txt
++++ b/modules/xfeatures2d/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ set(the_description "Contributed/Experimental Algorithms for Salient 2D Features Detection")
+ ocv_define_module(xfeatures2d opencv_core opencv_imgproc opencv_features2d opencv_calib3d opencv_shape opencv_highgui opencv_videoio opencv_ml
+                   OPTIONAL opencv_cudaarithm WRAP python java)
+-include(cmake/download_vgg.cmake)
+-include(cmake/download_boostdesc.cmake)
++#include(cmake/download_vgg.cmake)
++#include(cmake/download_boostdesc.cmake)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/useoeprotobuf.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/useoeprotobuf.patch
new file mode 100644
index 0000000..3068bd4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv/useoeprotobuf.patch
@@ -0,0 +1,13 @@
+diff --git a/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake b/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake
+index eb2a729cc2eb..8717736484de 100644
+--- a/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake
++++ b/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake
+@@ -24,7 +24,7 @@ if(NOT BUILD_PROTOBUF AND NOT (DEFINED PROTOBUF_INCLUDE_DIR AND DEFINED PROTOBUF
+   find_package(Protobuf QUIET)
+ endif()
+ 
+-if(PROTOBUF_FOUND)
++if(PROTOBUF_FOUND OR (DEFINED PROTOBUF_INCLUDE_DIR AND DEFINED PROTOBUF_LIBRARIES))
+   # nothing
+ else()
+   include(${CMAKE_CURRENT_LIST_DIR}/download_protobuf.cmake)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_2.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_2.4.bb
index ced066f..d17c640 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_2.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_2.4.bb
@@ -65,12 +65,12 @@
     do_split_packages(d, cv_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
     do_split_packages(d, cv_libdir, '^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True)
 
-    pn = d.getVar('PN', 1)
+    pn = d.getVar('PN')
     metapkg =  pn + '-dev'
     d.setVar('ALLOW_EMPTY_' + metapkg, "1")
     blacklist = [ metapkg ]
     metapkg_rdepends = [ ]
-    packages = d.getVar('PACKAGES', 1).split()
+    packages = d.getVar('PACKAGES').split()
     for pkg in packages[1:]:
         if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'):
             metapkg_rdepends.append(pkg)
@@ -103,4 +103,4 @@
 }
 
 # http://errors.yoctoproject.org/Errors/Details/40660/
-PNBLACKLIST[opencv] ?= "Not compatible with currently used ffmpeg 3"
+PNBLACKLIST[opencv] ?= "Not compatible with currently used ffmpeg 3 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.1.bb
deleted file mode 100644
index 1bbb965..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.1.bb
+++ /dev/null
@@ -1,150 +0,0 @@
-SUMMARY = "Opencv : The Open Computer Vision Library"
-HOMEPAGE = "http://opencv.org/"
-SECTION = "libs"
-
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=0ea90d28b4de883d7af5e6711f14f7bf"
-
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
-
-DEFAULT_PREFERENCE = "-1"
-
-DEPENDS = "python-numpy libtool swig swig-native python bzip2 zlib glib-2.0 libwebp protobuf protobuf-native"
-
-SRCREV_opencv = "92387b1ef8fad15196dd5f7fb4931444a68bc93a"
-SRCREV_contrib = "5409d5ad560523c85c6796cc5a009347072d883c"
-SRCREV_party3 = "81a676001ca8075ada498583e4166079e5744668"
-IPP_MD5 = "808b791a6eac9ed78d32a7666804320e"
-
-SRCREV_FORMAT = "opencv"
-SRC_URI = "git://github.com/Itseez/opencv.git;name=opencv \
-    git://github.com/Itseez/opencv_contrib.git;destsuffix=contrib;name=contrib \
-    git://github.com/Itseez/opencv_3rdparty.git;branch=ippicv/master_20151201;destsuffix=party3;name=party3 \
-    file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
-    file://fixgcc60.patch \
-    file://fixpkgconfig.patch \
-"
-
-PV = "3.1+git${SRCPV}"
-
-S = "${WORKDIR}/git"
-
-do_unpack_extra() {
-    tar xzf ${WORKDIR}/party3/ippicv/ippicv_linux_20151201.tgz -C ${WORKDIR}
-}
-addtask unpack_extra after do_unpack before do_patch
-
-EXTRA_OECMAKE = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include \
-    -DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
-    -DWITH_1394=OFF \
-    -DCMAKE_SKIP_RPATH=ON \
-    -DOPENCV_ICV_PACKAGE_DOWNLOADED=${IPP_MD5} \
-    -DOPENCV_ICV_PATH=${WORKDIR}/ippicv_lnx \
-    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \
-    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \
-    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \
-    ${@base_conditional("libdir", "/usr/lib64", "-DLIB_SUFFIX=64", "", d)} \
-    ${@base_conditional("libdir", "/usr/lib32", "-DLIB_SUFFIX=32", "", d)} \
-"
-EXTRA_OECMAKE_append_x86 = " -DX86=ON"
-
-PACKAGECONFIG ??= "eigen jpeg png tiff v4l libv4l gstreamer samples tbb  gphoto2 \
-    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \
-    ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "libav", "", d)}"
-
-PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas,"
-PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft,"
-PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen,"
-PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2,"
-PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base,"
-PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3,"
-PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper,"
-PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg,"
-PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav,"
-PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils,"
-PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers,"
-PACKAGECONFIG[oracle-java] = "-DJAVA_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native oracle-jse-jdk oracle-jse-jdk-native,"
-PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng,"
-PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,,"
-PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb,"
-PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff,"
-PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils,"
-
-inherit distutils-base pkgconfig cmake
-
-export PYTHON_CSPEC="-I${STAGING_INCDIR}/${PYTHON_DIR}"
-export PYTHON="${STAGING_BINDIR_NATIVE}/python"
-export JAVA_HOME="${STAGING_DIR_NATIVE}/usr/bin/java"
-export ANT_DIR="${STAGING_DIR_NATIVE}/usr/share/ant/"
-
-TARGET_CC_ARCH += "-I${S}/include "
-
-PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java-dbg ${PN}-java', '', d)} \
-    ${PN}-samples-dbg ${PN}-samples ${PN}-apps python-opencv"
-
-python populate_packages_prepend () {
-    cv_libdir = d.expand('${libdir}')
-    cv_libdir_dbg = d.expand('${libdir}/.debug')
-    do_split_packages(d, cv_libdir, '^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True)
-    do_split_packages(d, cv_libdir, '^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
-    do_split_packages(d, cv_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
-    do_split_packages(d, cv_libdir, '^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True)
-
-    pn = d.getVar('PN', 1)
-    metapkg =  pn + '-dev'
-    d.setVar('ALLOW_EMPTY_' + metapkg, "1")
-    blacklist = [ metapkg ]
-    metapkg_rdepends = [ ]
-    packages = d.getVar('PACKAGES', 1).split()
-    for pkg in packages[1:]:
-        if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'):
-            metapkg_rdepends.append(pkg)
-    d.setVar('RRECOMMENDS_' + metapkg, ' '.join(metapkg_rdepends))
-
-    metapkg =  pn
-    blacklist = [ metapkg ]
-    metapkg_rdepends = [ ]
-    for pkg in packages[1:]:
-        if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-locale'):
-            metapkg_rdepends.append(pkg)
-    bb.data.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends), d)
-
-}
-
-PACKAGES_DYNAMIC += "^libopencv-.*"
-
-FILES_${PN} = ""
-FILES_${PN}-apps = "${bindir}/* ${datadir}/OpenCV"
-FILES_${PN}-dev = "${includedir} ${libdir}/pkgconfig ${datadir}/OpenCV/*.cmake ${datadir}/OpenCV/3rdparty/${baselib}/*.a"
-FILES_${PN}-doc = "${datadir}/OpenCV/doc"
-FILES_${PN}-java = "${datadir}/OpenCV/java"
-FILES_${PN}-java-dbg = "${datadir}/OpenCV/java/.debug/"
-FILES_${PN}-samples = "${datadir}/OpenCV/samples/"
-FILES_${PN}-samples-dbg = "${datadir}/OpenCV/samples/bin/.debug"
-
-INSANE_SKIP_${PN}-dev = "staticdev"
-INSANE_SKIP_${PN}-java = "libdir"
-INSANE_SKIP_${PN}-java-dbg = "libdir"
-
-ALLOW_EMPTY_${PN} = "1"
-
-SUMMARY_python-opencv = "Python bindings to opencv"
-FILES_python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
-RDEPENDS_python-opencv = "python-core python-numpy"
-
-do_install_append() {
-    cp ${S}/include/opencv/*.h ${D}${includedir}/opencv/
-    sed -i '/blobtrack/d' ${D}${includedir}/opencv/cvaux.h
-
-    # Move Python files into correct library folder (for multilib build)
-    if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then
-        mv ${D}/usr/lib/* ${D}/${libdir}/
-        rm -rf ${D}/usr/lib
-    fi
-
-    if ${@bb.utils.contains("PACKAGECONFIG", "samples", "true", "false", d)}; then
-        install -d ${D}${datadir}/OpenCV/samples/bin/
-        cp -f bin/*-tutorial-* bin/*-example-* ${D}${datadir}/OpenCV/samples/bin/
-    fi
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.2.bb
new file mode 100644
index 0000000..535c761
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opencv/opencv_3.2.bb
@@ -0,0 +1,175 @@
+SUMMARY = "Opencv : The Open Computer Vision Library"
+HOMEPAGE = "http://opencv.org/"
+SECTION = "libs"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2b2f8752cc5edf504d283107d033f544"
+
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+DEPENDS = "libtool swig-native bzip2 zlib glib-2.0 libwebp"
+
+SRCREV_opencv = "70bbf17b133496bd7d54d034b0f94bd869e0e810"
+SRCREV_contrib = "86342522b0eb2b16fa851c020cc4e0fef4e010b7"
+SRCREV_ipp = "81a676001ca8075ada498583e4166079e5744668"
+SRCREV_bootdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26"
+SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d"
+IPP_MD5 = "808b791a6eac9ed78d32a7666804320e"
+
+SRCREV_FORMAT = "opencv"
+SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
+    git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=contrib \
+    git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20151201;destsuffix=ipp;name=ipp \
+    git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=bootdesc;name=bootdesc \
+    git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg \
+    file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
+    file://fixpkgconfig.patch \
+    file://uselocalxfeatures.patch;patchdir=../contrib/ \
+    file://useoeprotobuf.patch;patchdir=../contrib/ \
+    file://0001-Revert-cuda-fix-fp16-compilation.patch \
+    file://0002-Revert-check-FP16-build-condition-correctly.patch \
+    file://0001-Make-opencv-ts-create-share-library-intead-of-static.patch \
+    file://0001-To-fix-errors-as-following.patch \
+    file://0001-tracking-make-opencv_dnn-dependancy-optional.patch;patchdir=../contrib/ \
+"
+
+PV = "3.2+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+do_unpack_extra() {
+    tar xzf ${WORKDIR}/ipp/ippicv/ippicv_linux_20151201.tgz -C ${WORKDIR}
+    cp ${WORKDIR}/vgg/*.i ${WORKDIR}/contrib/modules/xfeatures2d/src
+    cp ${WORKDIR}/bootdesc/*.i ${WORKDIR}/contrib/modules/xfeatures2d/src
+}
+addtask unpack_extra after do_unpack before do_patch
+
+EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
+    -DWITH_1394=OFF \
+    -DCMAKE_SKIP_RPATH=ON \
+    -DOPENCV_ICV_PACKAGE_DOWNLOADED=${IPP_MD5} \
+    -DOPENCV_ICV_PATH=${WORKDIR}/ippicv_lnx \
+    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \
+    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \
+    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \
+    ${@base_conditional("libdir", "/usr/lib64", "-DLIB_SUFFIX=64", "", d)} \
+    ${@base_conditional("libdir", "/usr/lib32", "-DLIB_SUFFIX=32", "", d)} \
+"
+EXTRA_OECMAKE_append_x86 = " -DX86=ON"
+
+PACKAGECONFIG ??= "python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \
+    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \
+    ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "libav", "", d)}"
+
+PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas,"
+PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft,"
+PACKAGECONFIG[dnn] = "-DBUILD_opencv_dnn=ON -DUPDATE_PROTO_FILES=ON -DBUILD_PROTOBUF=OFF,-DBUILD_opencv_dnn=OFF,protobuf protobuf-native,"
+PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen gflags glog,"
+PACKAGECONFIG[freetype] = "-DBUILD_opencv_freetype=ON,-DBUILD_opencv_freetype=OFF,freetype,"
+PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2,"
+PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base,"
+PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3,"
+PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper,"
+PACKAGECONFIG[java] = "-DJAVA_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native fastjar-native openjdk-8-native,"
+PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg,"
+PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav,"
+PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils,"
+PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers virtual/opencl-icd,"
+PACKAGECONFIG[oracle-java] = "-DJAVA_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${ORACLE_JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native oracle-jse-jdk oracle-jse-jdk-native,"
+PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng,"
+PACKAGECONFIG[python2] = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python-numpy,"
+PACKAGECONFIG[python3] = "-DPYTHON3_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python3-numpy,"
+PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,,"
+PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb,"
+PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract,"
+PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff,"
+PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils,"
+
+inherit pkgconfig cmake
+
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'distutils3-base', '', d)}
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'distutils-base', '', d)}
+
+export PYTHON_CSPEC="-I${STAGING_INCDIR}/${PYTHON_DIR}"
+export PYTHON="${STAGING_BINDIR_NATIVE}/${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3', 'python', d)}"
+export ORACLE_JAVA_HOME="${STAGING_DIR_NATIVE}/usr/bin/java"
+export JAVA_HOME="${STAGING_DIR_NATIVE}/usr/lib/jvm/openjdk-8-native"
+export ANT_DIR="${STAGING_DIR_NATIVE}/usr/share/ant/"
+
+TARGET_CC_ARCH += "-I${S}/include "
+
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'samples', '${PN}-samples', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'java', '${PN}-java', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python-${BPN}', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-${BPN}', '', d)} \
+    ${PN}-apps"
+
+python populate_packages_prepend () {
+    cv_libdir = d.expand('${libdir}')
+    do_split_packages(d, cv_libdir, '^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True)
+    do_split_packages(d, cv_libdir, '^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
+    do_split_packages(d, cv_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
+    do_split_packages(d, cv_libdir, '^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True)
+
+    pn = d.getVar('PN')
+    metapkg =  pn + '-dev'
+    d.setVar('ALLOW_EMPTY_' + metapkg, "1")
+    blacklist = [ metapkg ]
+    metapkg_rdepends = [ ]
+    packages = d.getVar('PACKAGES').split()
+    for pkg in packages[1:]:
+        if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'):
+            metapkg_rdepends.append(pkg)
+    d.setVar('RRECOMMENDS_' + metapkg, ' '.join(metapkg_rdepends))
+
+    metapkg =  pn
+    d.setVar('ALLOW_EMPTY_' + metapkg, "1")
+    blacklist = [ metapkg ]
+    metapkg_rdepends = [ ]
+    for pkg in packages[1:]:
+        if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-locale') and not pkg.endswith('-staticdev'):
+            metapkg_rdepends.append(pkg)
+    d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
+
+}
+
+PACKAGES_DYNAMIC += "^libopencv-.*"
+
+FILES_${PN} = ""
+FILES_${PN}-dbg += "${datadir}/OpenCV/java/.debug/* ${datadir}/OpenCV/samples/bin/.debug/*"
+FILES_${PN}-dev = "${includedir} ${libdir}/pkgconfig ${datadir}/OpenCV/*.cmake"
+FILES_${PN}-staticdev += "${datadir}/OpenCV/3rdparty/lib/*.a"
+FILES_${PN}-apps = "${bindir}/* ${datadir}/OpenCV"
+FILES_${PN}-java = "${datadir}/OpenCV/java"
+FILES_${PN}-samples = "${datadir}/OpenCV/samples/"
+
+INSANE_SKIP_${PN}-java = "libdir"
+INSANE_SKIP_${PN}-dbg = "libdir"
+
+ALLOW_EMPTY_${PN} = "1"
+
+SUMMARY_python-opencv = "Python bindings to opencv"
+FILES_python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
+RDEPENDS_python-opencv = "python-core python-numpy"
+
+SUMMARY_python3-opencv = "Python bindings to opencv"
+FILES_python3-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
+RDEPENDS_python3-opencv = "python3-core python3-numpy"
+
+do_install_append() {
+    cp ${S}/include/opencv/*.h ${D}${includedir}/opencv/
+    sed -i '/blobtrack/d' ${D}${includedir}/opencv/cvaux.h
+
+    # Move Python files into correct library folder (for multilib build)
+    if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then
+        mv ${D}/usr/lib/* ${D}/${libdir}/
+        rm -rf ${D}/usr/lib
+    fi
+
+    if ${@bb.utils.contains("PACKAGECONFIG", "samples", "true", "false", d)}; then
+        install -d ${D}${datadir}/OpenCV/samples/bin/
+        cp -f bin/*-tutorial-* bin/*-example-* ${D}${datadir}/OpenCV/samples/bin/
+    fi
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/do-not-install-pyc-and-pyo.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/do-not-install-pyc-and-pyo.patch
new file mode 100644
index 0000000..d4e02be
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/do-not-install-pyc-and-pyo.patch
@@ -0,0 +1,25 @@
+Do not install pyc and pyo for python module
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ swig/python/Makefile.am | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/swig/python/Makefile.am b/swig/python/Makefile.am
+index da95a81..97a62bf 100644
+--- a/swig/python/Makefile.am
++++ b/swig/python/Makefile.am
+@@ -33,8 +33,6 @@ CLEANFILES = OpenIPMI_wrap.c OpenIPMI.py OpenIPMI.pyo OpenIPMI.pyc
+ install-exec-local: _OpenIPMI.la OpenIPMI.py OpenIPMI.pyc OpenIPMI.pyo
+ 	$(INSTALL) -d $(DESTDIR)$(PYTHON_INSTALL_DIR)
+ 	$(INSTALL_DATA) OpenIPMI.py "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
+-	$(INSTALL_DATA) OpenIPMI.pyc "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
+-	$(INSTALL_DATA) OpenIPMI.pyo "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
+ 	if test "x$(PYTHON_GUI_DIR)" = "xopenipmigui"; then \
+ 	    $(INSTALL) -d $(DESTDIR)$(bindir); \
+ 	    $(INSTALL_SCRIPT) $(srcdir)/openipmigui.py "$(DESTDIR)$(bindir)/openipmigui";\
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/fix-symlink-install-error-in-cmdlang.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/fix-symlink-install-error-in-cmdlang.patch
new file mode 100644
index 0000000..9a568b2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/fix-symlink-install-error-in-cmdlang.patch
@@ -0,0 +1,22 @@
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date:   Thu Jun 7 16:00:13 2012 -0400
+
+    This patch fixes the error during the install stage when
+    creating a symbolic link for opeipmish in openipmi/cmdlang
+    
+    Upstream-Status: Pending
+    
+    Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/cmdlang/Makefile.am b/cmdlang/Makefile.am
+index 92d6e83..f6039f9 100644
+--- a/cmdlang/Makefile.am
++++ b/cmdlang/Makefile.am
+@@ -36,6 +36,7 @@ CLEANFILES = libOpenIPMIcmdlang.map
+ # compatability.
+ install-data-local:
+ 	rm -f $(DESTDIR)$(bindir)/ipmish
++	mkdir -p $(DESTDIR)$(bindir)/
+ 	$(LN_S) openipmish $(DESTDIR)$(bindir)/ipmish
+ 
+ uninstall-local:
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/include_sys_types.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/include_sys_types.patch
new file mode 100644
index 0000000..58ec5d8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/include_sys_types.patch
@@ -0,0 +1,17 @@
+include sys/types.h for u_int32_t
+
+ui.c:340:5: error: unknown type name 'u_int32_t'; did you mean 'uint32_t'?
+     u_int32_t     addr;
+     ^~~~~~~~~
+Index: OpenIPMI-2.0.22/ui/ui.c
+===================================================================
+--- OpenIPMI-2.0.22.orig/ui/ui.c
++++ OpenIPMI-2.0.22/ui/ui.c
+@@ -42,6 +42,7 @@
+ #include <fcntl.h>
+ #include <time.h>
+ #include <sys/time.h>
++#include <sys/types.h>
+ #include <ctype.h>
+ 
+ #include <OpenIPMI/selector.h>
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi-init-fix-the-arguments.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi-init-fix-the-arguments.patch
new file mode 100644
index 0000000..51a398b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi-init-fix-the-arguments.patch
@@ -0,0 +1,41 @@
+Subject: [PATCH] ipmi-init: fix the arguments
+
+The functions success/failure/warning defined in /etc/init.d/functions
+(provided by initscripts) only accepts numeric argument as return code,
+not a string.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ ipmi.init | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ipmi.init b/ipmi.init
+index 2ebcd94..d8161c5 100644
+--- a/ipmi.init
++++ b/ipmi.init
+@@ -45,17 +45,17 @@ elif [ -r /etc/init.d/functions ]; then
+ 	case "$ACTION" in
+ 	    success)
+ 		echo -n $*
+-		success "$*"
++		success 0
+ 		echo
+ 		;;
+ 	    failure)
+ 		echo -n $*
+-		failure "$*"
++		failure 1
+ 		echo
+ 		;;
+ 	    warning)
+ 		echo -n $*
+-		warning "$*"
++		warning 0
+ 		echo
+ 		;;
+ 	    *)
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi.service b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi.service
new file mode 100644
index 0000000..6fe1378
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/ipmi.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=IPMI Driver
+After=network.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@LIBEXECDIR@/openipmi-helper start
+ExecStop=@LIBEXECDIR@/openipmi-helper stop-all
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/makefile-add-ldflags.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/makefile-add-ldflags.patch
new file mode 100644
index 0000000..271c532
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/makefile-add-ldflags.patch
@@ -0,0 +1,19 @@
+Add LDFLAGS variable to Makefile.am, make sure the extra linker flags can be passed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/swig/perl/Makefile.am b/swig/perl/Makefile.am
+index 2f9ee4c..3a18892 100644
+--- a/swig/perl/Makefile.am
++++ b/swig/perl/Makefile.am
+@@ -20,7 +20,7 @@ OpenIPMI_SRC = OpenIPMI_perl.c
+ OpenIPMI_OBJ = OpenIPMI_wrap.lo OpenIPMI_perl.lo
+ 
+ OpenIPMI.so: $(OpenIPMI_OBJ)
+-	$(LIBTOOL) --mode=link $(CC) -shared -module -avoid-version -o $(@:.so=.la) $^ $(OPENIPMI_SWIG_LIBS) $(PERL_POSIX_LIB) -rpath $(PERL_INSTALL_DIR)/auto/OpenIPMI
++	$(LIBTOOL) --mode=link $(CC) -shared -module -avoid-version $(LDFLAGS) -o $(@:.so=.la) $^ $(OPENIPMI_SWIG_LIBS) $(PERL_POSIX_LIB) -rpath $(PERL_INSTALL_DIR)/auto/OpenIPMI
+ 	rm -f OpenIPMI.so
+ 	mv .libs/OpenIPMI.so .
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-don-t-rm-.libs.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-don-t-rm-.libs.patch
new file mode 100644
index 0000000..ee3c660
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-don-t-rm-.libs.patch
@@ -0,0 +1,32 @@
+From bbd51cf010c80322034f7094e2c6a656aa1f17a7 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Fri, 13 Feb 2015 06:55:33 +0000
+Subject: [PATCH] openipmi: don't rm .libs
+
+Don't remove .libs after OpenIPMI.so generated, this may cause
+dummystuff.so fails to link from the second build with error:
+
+* error: .libs/dummystuff.o: No such file or directory
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ swig/perl/Makefile.am | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/swig/perl/Makefile.am b/swig/perl/Makefile.am
+index 12a282c..2f9ee4c 100644
+--- a/swig/perl/Makefile.am
++++ b/swig/perl/Makefile.am
+@@ -23,7 +23,6 @@ OpenIPMI.so: $(OpenIPMI_OBJ)
+ 	$(LIBTOOL) --mode=link $(CC) -shared -module -avoid-version -o $(@:.so=.la) $^ $(OPENIPMI_SWIG_LIBS) $(PERL_POSIX_LIB) -rpath $(PERL_INSTALL_DIR)/auto/OpenIPMI
+ 	rm -f OpenIPMI.so
+ 	mv .libs/OpenIPMI.so .
+-	rm -rf .libs
+ 
+ dummystuff.lo: dummystuff.c
+ 	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-helper b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-helper
new file mode 100755
index 0000000..4cebfb9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-helper
@@ -0,0 +1,512 @@
+#!/bin/sh
+#############################################################################
+#
+# ipmi:		OpenIPMI Driver helper script
+#
+# Authors:	Jan Safranek <jsafrane@redhat.com>
+#
+# Based on IPMI init script by:
+#               Matt Domsch <Matt_Domsch@dell.com>
+#               Chris Poblete <Chris_Poblete@dell.com>
+#
+# Status return code bits
+# no bits set = no errors
+# bit 0 set = minimum modules aren't loaded
+# bit 1 set = requested feature module isn't loaded
+# bit 2 set = /dev/ipmi0 (or /dev/imb if using that instead) doesn't exist
+# bit 3 set = /dev/watchdog doesn't exist
+# bit 4 set = lockfile doesn't exist
+# bit 5 set = modules are loaded even when asked to be unloaded
+
+CONFIGFILE=/etc/sysconfig/ipmi
+# source config info
+[ -r ${CONFIGFILE} ] && . ${CONFIGFILE}
+
+#############################################################################
+# GLOBALS
+#############################################################################
+MODULE_NAME="ipmi"
+INTF_NUM=0
+
+IPMI_SMB_MODULE_NAME="ipmi_smb"
+IPMI_SI_MODULE_NAME="ipmi_si"
+kernel=`uname -r | cut -d. -f1-2`
+if [ "${kernel}" == "2.4" ]; then
+    IPMI_SMB_MODULE_NAME="ipmi_smb_intf"
+    IPMI_SI_MODULE_NAME="ipmi_si_drv"
+fi
+
+MODULES_INTERFACES=""
+[ "${DEV_IPMI}" = "yes" ] && MODULES_INTERFACES="${MODULES_INTERFACES} ipmi_devintf"
+[ "${IPMI_IMB}" = "yes" ] && MODULES_INTERFACES="${MODULES_INTERFACES} ipmi_imb"
+
+MODULES_FEATURES=""
+[ "${IPMI_WATCHDOG}" = "yes" ] && MODULES_FEATURES="${MODULES_FEATURES} ipmi_watchdog"
+[ "${IPMI_POWEROFF}" = "yes" ] && MODULES_FEATURES="${MODULES_FEATURES} ipmi_poweroff"
+
+MODULES_HW=""
+[ "${IPMI_SI}"  = "yes" ] && MODULES_HW="${MODULES_HW} ${IPMI_SI_MODULE_NAME}"
+[ "${IPMI_SMB}" = "yes" ] && MODULES_HW="${MODULES_HW} ${IPMI_SMB_MODULE_NAME}"
+
+MODULES_BASE="ipmi_msghandler"
+MODULES="${MODULES_INTERFACES} ${MODULES_FEATURES} ${MODULES_HW} ${MODULES_BASE}"
+
+RETVAL=0
+LOCKFILE=/var/lock/subsys/ipmi
+DEV_IPMI_TIMEOUT=150
+
+UDEV_EXISTS=0
+if [ -e /sbin/udev -o -e /sbin/udevd ]; then
+    UDEV_EXISTS=1
+fi
+
+#############################################################################
+# NOTES:
+# * /dev/ipmi0 is unconditionally deleted here on ipmi_devintf unload,
+#   because SLES9 and RHEL4 kernels don't send a message for udev to delete
+#   it for us.
+# 
+#############################################################################
+
+modules_loaded_verbose()
+{
+	OnePlusLoaded=0
+	OnePlusUnloaded=0
+	for m in $@; do
+		if /sbin/lsmod | grep $m >/dev/null 2>&1 ; then
+			echo "$m module loaded."
+			OnePlusLoaded=1
+		else
+			echo "$m module not loaded."
+			OnePlusUnloaded=1
+		fi
+	done
+}
+
+modules_loaded()
+{
+	OnePlusLoaded=0
+	OnePlusUnloaded=0
+	for m in $@; do
+		if /sbin/lsmod | grep $m >/dev/null 2>&1 ; then
+			OnePlusLoaded=1
+		else
+			OnePlusUnloaded=1
+		fi
+	done
+}
+
+device_node_exists ()
+{
+	if [ -e "$1" ]; then
+		echo "$1 exists."
+		return 1
+	fi
+	echo "$1 does not exist."
+	return 0
+}
+
+minimum_modules_loaded()
+{
+        rc_base=1
+	rc_hw=1
+        modules_loaded_verbose "${MODULES_BASE}"
+	[ ${OnePlusLoaded} -eq 0 ] && rc_base=0
+	    
+	modules_loaded_verbose "${MODULES_HW}"
+	[ ${OnePlusLoaded} -eq 0 ] && rc_hw=0
+	
+	return $((rc_base && rc_hw))
+}
+
+#############################################################################
+
+load_si()
+{
+	if [ "${IPMI_SI}" = "yes" ]; then
+		modprobe ${IPMI_SI_MODULE_NAME} > /dev/null 2>&1
+		modules_loaded ${IPMI_SI_MODULE_NAME}
+		[ ${OnePlusLoaded} -ne 1 ] && RETVAL=$((RETVAL | 1))
+	fi
+}
+
+load_smb()
+{
+	if [ "${IPMI_SMB}" = "yes" ]; then
+		modprobe ${IPMI_SMB_MODULE_NAME} > /dev/null 2>&1
+		modules_loaded ${IPMI_SMB_MODULE_NAME}
+		[ ${OnePlusLoaded} -ne 1 ] && RETVAL=$((RETVAL | 1))
+	fi
+}
+
+load_hw_modules()
+{
+	load_si
+	load_smb
+}
+
+start_watchdog_common()
+{
+	load_hw_modules
+	modprobe ipmi_watchdog ${IPMI_WATCHDOG_OPTIONS} > /dev/null 2>&1
+	modules_loaded ipmi_watchdog
+	[ ${OnePlusUnloaded} -ne 0 ] &&
+		RETVAL=$((RETVAL | 2)) &&
+		echo "Watchdog startup failed: cannot load ipmi_watchdog module" &&
+		return
+	if [ ${UDEV_EXISTS} -eq 0 -a ! -e /dev/watchdog ]; then
+		mknod -m 0600 /dev/watchdog c 10 130
+		[ $? -ne 0 ] &&
+			RETVAL=$((RETVAL | 8)) &&
+			echo "Watchdog startup failed: cannot create /dev/watchdog" &&
+			return
+	fi
+}
+
+start_watchdog_quiet()
+{
+	[ "${IPMI_WATCHDOG}" != "yes" ] &&
+		return
+	start_watchdog_common
+}
+
+start_watchdog()
+{
+	[ "${IPMI_WATCHDOG}" != "yes" ] &&
+		RETVAL=$((RETVAL | 2)) &&
+		echo "Watchdog not configured" &&
+		return
+	start_watchdog_common
+}
+
+stop_watchdog()
+{
+	modprobe -q -r ipmi_watchdog > /dev/null 2>&1
+	modules_loaded ipmi_watchdog
+	if [ ${OnePlusLoaded} -ne 0 ]; then
+	    RETVAL=$((RETVAL | 32))
+	    echo "Watchog shutdown failed: cannot unload ipmi_watchdog module"
+	else
+	    if [ "${IPMI_WATCHDOG}" = "yes" ]; then
+		[ ${UDEV_EXISTS} -eq 0 ] && rm -f /dev/watchdog
+	    fi
+	fi
+}
+
+stop_watchdog_quiet()
+{
+	modprobe -q -r ipmi_watchdog > /dev/null 2>&1
+	modules_loaded ipmi_watchdog
+	if [ ${OnePlusLoaded} -ne 0 ]; then
+	    RETVAL=$((RETVAL | 32))
+	else
+	    if [ "${IPMI_WATCHDOG}" = "yes" ]; then
+		[ ${UDEV_EXISTS} -eq 0 ] && rm -f /dev/watchdog
+	    fi
+	fi
+}
+
+start_powercontrol_common()
+{
+	local poweroff_opts=""
+	load_hw_modules
+	if [ "${IPMI_POWERCYCLE}" == "yes" ]; then
+	    modinfo ipmi_poweroff 2>/dev/null | grep poweroff_control > /dev/null 2>&1 && \
+		poweroff_opts="poweroff_control=2"
+	    modinfo ipmi_poweroff 2>/dev/null | grep poweroff_powercycle > /dev/null 2>&1 && \
+		poweroff_opts="poweroff_powercycle=1"
+	fi
+	modprobe ipmi_poweroff "${poweroff_opts}" > /dev/null 2>&1
+	modules_loaded ipmi_poweroff
+	[ ${OnePlusUnloaded} -ne 0 ] &&
+		RETVAL=$((RETVAL | 2)) &&
+		echo "Powercontroll startup failed: cannot load ipmi_poweroff module" &&
+		return
+}
+
+start_powercontrol_quiet()
+{
+	[ "${IPMI_POWEROFF}" != "yes" ] &&
+		return
+	start_powercontrol_common
+}
+
+start_powercontrol()
+{
+	[ "${IPMI_POWEROFF}" != "yes" ] &&
+		RETVAL=$((RETVAL | 2)) &&
+		echo "Powercontroll not configured" &&
+		return
+	start_powercontrol_common
+}
+
+stop_powercontrol()
+{
+	modprobe -q -r ipmi_poweroff > /dev/null 2>&1
+	modules_loaded ipmi_poweroff
+	if [ ${OnePlusLoaded} -ne 0 ]; then
+	    RETVAL=$((RETVAL | 32))
+	    echo "Powercontroll shutdown failed: cannot unload ipmi_poweroff module"
+	fi
+}
+
+stop_powercontrol_quiet()
+{
+	modprobe -q -r ipmi_poweroff > /dev/null 2>&1
+	modules_loaded ipmi_poweroff
+	[ ${OnePlusLoaded} -ne 0 ] && RETVAL=$((RETVAL | 32))
+}
+
+#############################################################################
+unload_all_ipmi_modules()
+{
+	stop_watchdog_quiet
+	stop_powercontrol_quiet
+	for m in ${MODULES}; do
+		modprobe -q -r ${m} > /dev/null 2>&1
+	done
+        # delete interface node ONLY if ipmi_devintf is unloaded
+        [ `lsmod | grep -c "ipmi_devintf"` -eq 0 ] &&
+	        rm -f "/dev/ipmi${INTF_NUM}"
+}
+
+unload_ipmi_modules_leave_features()
+{
+	for m in ${MODULES_INTERFACES}; do
+		modprobe -q -r ${m} > /dev/null 2>&1
+	done
+        # delete interface node ONLY if ipmi_devintf is unloaded
+        [ `lsmod | grep -c "ipmi_devintf"` -eq 0 ] &&
+	        rm -f "/dev/ipmi${INTF_NUM}"
+	lsmod | egrep -q "ipmi_(poweroff|watchdog)" > /dev/null 2>&1
+	if [ "$?" -ne "0" ]; then
+		stop_watchdog_quiet
+		stop_powercontrol_quiet
+		for m in ${MODULES}; do
+			modprobe -q -r ${m} > /dev/null 2>&1
+		done
+	fi
+}
+
+#############################################################################
+load_ipmi_modules ()
+{
+	local locdelay
+	modprobe ipmi_msghandler > /dev/null 2>&1
+	modules_loaded ipmi_msghandler
+	[ ${OnePlusLoaded} -ne 1 ] && unload_all_ipmi_modules && RETVAL=$((RETVAL | 1)) && return
+	load_hw_modules
+	[ $((RETVAL & 1)) -eq 1 ] && unload_all_ipmi_modules && RETVAL=$((RETVAL | 1)) && return
+
+	if [ "${DEV_IPMI}" = "yes" ]; then
+		modprobe ipmi_devintf > /dev/null 2>&1
+		modules_loaded ipmi_devintf
+		RETVAL=$((RETVAL & ~2))
+		[ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+		if [ ${OnePlusLoaded} -eq 1 ]; then
+			if [ ${UDEV_EXISTS} -eq 0 ]; then
+				DEVMAJOR=`cat /proc/devices | awk '/ipmidev/{print $1}'`
+				rm -f /dev/ipmi${INTF_NUM}
+				mknod -m 0600 /dev/ipmi${INTF_NUM} c ${DEVMAJOR} 0 || RETVAL=$((RETVAL | 4))
+			fi
+
+			# udev can take several seconds to create /dev/ipmi0, 
+			# but it happens asynchronously, so delay here
+			locdelay=${DEV_IPMI_TIMEOUT}
+			while [ ! -e /dev/ipmi${INTF_NUM} -a ${locdelay} -gt 0 ]; do
+				locdelay=$((locdelay - 1))
+				sleep 0.1
+			done
+		fi
+	fi
+
+	if [ "${IPMI_IMB}" = "yes" ]; then
+		modprobe ipmi_imb > /dev/null 2>&1
+		modules_loaded ipmi_imb
+		RETVAL=$((RETVAL & ~2))
+		[ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+		if [ ${OnePlusLoaded} -eq 1 ]; then
+			DEVMAJOR=`cat /proc/devices | awk '/imb/{print $1}'`
+			rm -f /dev/imb
+			mknod -m 0600 /dev/imb c ${DEVMAJOR} 0 || RETVAL=$((RETVAL | 4))
+		fi
+	fi
+
+	# Per Corey Minyard, essentially no one uses ipmi_radisys
+	# and we don't want to encourage its further use
+	# so it won't be handled here.
+	return
+}
+
+#############################################################################
+start()
+{
+	load_ipmi_modules
+	if [ ${RETVAL} -eq 0 ]; then
+		touch ${LOCKFILE}
+	else
+		if [ $((RETVAL & 1)) -eq 1 ]; then
+			echo "Startup failed."
+		else
+			touch ${LOCKFILE} && echo "Warning!?"
+		fi
+	fi
+	start_watchdog_quiet
+	start_powercontrol_quiet
+}
+
+#############################################################################
+stop()
+{
+	unload_ipmi_modules_leave_features
+	modules_loaded ${MODULES_INTERFACES}
+	if [ ${OnePlusLoaded} -ne 0 ]; then
+		RETVAL=$((RETVAL | 32))
+		echo "Shutdown failed, something may be in use"
+	else
+		rm -f ${LOCKFILE}
+	fi
+}
+
+stop_all()
+{
+	unload_all_ipmi_modules
+	modules_loaded ${MODULES}
+	if [ ${OnePlusLoaded} -ne 0 ]; then
+		RETVAL=$((RETVAL | 32))
+		echo "Shutdown failed, something may be in use"
+	else
+		rm -f ${LOCKFILE}
+	fi
+}
+
+#############################################################################
+restart()
+{
+	stop_all
+	RETVAL=0
+	start
+}
+
+#############################################################################
+
+reload()
+{
+	stop_all
+	RETVAL=0
+	start
+}
+
+#############################################################################
+
+status_all()
+{
+	minimum_modules_loaded
+	[ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+	
+	modules_loaded_verbose ${MODULES_FEATURES} ${MODULES_INTERFACES}
+	[ ${OnePlusUnloaded} -ne 0 ] && RETVAL=$((RETVAL | 2))
+
+	if [ "${DEV_IPMI}" = "yes" ]; then 
+	    device_node_exists /dev/ipmi${INTF_NUM}
+	    [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+	fi
+
+	if [ "${IPMI_IMB}" = "yes" ]; then
+	    device_node_exists /dev/imb
+	    [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+	fi
+
+	if [ "${IPMI_WATCHDOG}" = "yes" ]; then
+	    device_node_exists /dev/watchdog
+	    [ $? -eq 0 ] && RETVAL=$((RETVAL | 8))
+	fi
+
+	[ ! -e ${LOCKFILE} ] && RETVAL=$((RETVAL | 16))
+}
+
+status()
+{
+	minimum_modules_loaded
+	[ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+	
+	if [ "${DEV_IPMI}" = "yes" ]; then 
+	    modules_loaded_verbose ipmi_devintf
+	    [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+
+	    device_node_exists /dev/ipmi${INTF_NUM}
+	    [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+	fi
+
+	if [ "${IPMI_IMB}" = "yes" ]; then
+	    device_node_exists /dev/imb
+	    [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+	fi
+}
+
+status_watchdog()
+{
+	minimum_modules_loaded
+	[ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+
+	modules_loaded_verbose ipmi_watchdog
+	[ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+
+	device_node_exists /dev/watchdog
+	[ $? -eq 0 ] && RETVAL=$((RETVAL | 8))
+}
+
+status_powercontrol()
+{
+	minimum_modules_loaded
+	[ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+
+	modules_loaded_verbose ipmi_powercontrol
+	[ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+}
+
+#############################################################################
+usage ()
+{
+	echo $"Usage: $0 {start|stop|status" 1>&2
+	echo $"          restart|condrestart|try-restart|reload|force-reload" 1>&2
+	echo $"          start-watchdog|stop-watchdog|status-watchdog" 1>&2
+	echo $"          start-powercontrol|stop-powercontrol|status-powercontrol" 1>&2
+	echo $"          stop-all|status-all}" 1>&2
+	RETVAL=2
+}
+
+condrestart ()
+{
+	[ -e ${LOCKFILE} ] && restart
+}
+
+#############################################################################
+# MAIN
+#############################################################################
+case "$1" in
+	start) start ;;
+	stop)  stop ;;
+	restart) restart ;;
+	force-reload) reload ;;
+	reload) reload ;;
+	status)	status ;;
+	status-all) status_all ;;
+	condrestart) condrestart ;;
+	try-restart) condrestart ;;
+	start-watchdog) start_watchdog ;;
+	stop-watchdog) stop_watchdog ;;
+	status-watchdog) status_watchdog ;;
+	start-powercontrol) start_powercontrol ;;
+	stop-powercontrol) stop_powercontrol ;;
+	status-powercontrol) status_powercontrol ;;
+	stop-all) stop_all ;;
+	*) usage ;;
+esac
+
+exit ${RETVAL}
+
+#############################################################################
+# end of file
+#############################################################################
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-no-openipmigui-man.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-no-openipmigui-man.patch
new file mode 100644
index 0000000..1fa68f9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-no-openipmigui-man.patch
@@ -0,0 +1,26 @@
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date:   Thu Jun 7 12:28:34 2012 -0400
+
+    This patch was carried over from WRL4.3 (openipmi v2.0.16)
+    
+    It was updated for openipmi v2.0.19
+    
+    Disable making openipmigui man page since we don't need it
+    
+    Upstream-Status: Pending
+    
+    Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+    Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index 632f55b..5ce79f5 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -1,6 +1,6 @@
+ 
+ man_MANS = ipmi_ui.1 openipmicmd.1 openipmish.1 ipmi_cmdlang.7 \
+-	openipmigui.1 openipmi_conparms.7 solterm.1 rmcp_ping.1 \
++	openipmi_conparms.7 solterm.1 rmcp_ping.1 \
+ 	openipmi_eventd.1
+ 
+ EXTRA_DIST = $(man_MANS)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-remove-host-path-from-la_LDFLAGS.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-remove-host-path-from-la_LDFLAGS.patch
new file mode 100644
index 0000000..6f16234
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/files/openipmi-remove-host-path-from-la_LDFLAGS.patch
@@ -0,0 +1,85 @@
+From aa0dc0783a6ff5fb56c914b640836223e3c192bb Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 29 Dec 2014 18:16:04 +0800
+Subject: [PATCH] remove host path from la_LDFLAGS
+
+Upstream-Status: Inappropriate [ cross compile specific ]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ cmdlang/Makefile.am |    2 +-
+ glib/Makefile.am    |    4 ++--
+ tcl/Makefile.am     |    2 +-
+ unix/Makefile.am    |    4 ++--
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/cmdlang/Makefile.am b/cmdlang/Makefile.am
+index 00c3d2b..0fa85d7 100644
+--- a/cmdlang/Makefile.am
++++ b/cmdlang/Makefile.am
+@@ -16,7 +16,7 @@ libOpenIPMIcmdlang_la_LIBADD = -lm \
+ 	$(top_builddir)/utils/libOpenIPMIutils.la \
+ 	$(top_builddir)/lib/libOpenIPMI.la
+ libOpenIPMIcmdlang_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMIcmdlang.map -L$(libdir)
++	-Wl,-Map -Wl,libOpenIPMIcmdlang.map
+ 
+ bin_PROGRAMS = openipmish
+ 
+diff --git a/glib/Makefile.am b/glib/Makefile.am
+index 671cae2..eff55f3 100644
+--- a/glib/Makefile.am
++++ b/glib/Makefile.am
+@@ -11,14 +11,14 @@ libOpenIPMIglib_la_SOURCES = glib_os_hnd.c
+ libOpenIPMIglib_la_CFLAGS = $(GLIB_CFLAGS) $(AM_CFLAGS)
+ libOpenIPMIglib_la_LIBADD = $(GDBM_LIB)
+ libOpenIPMIglib_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMIglib.map $(GLIB_LIBS) -L$(libdir) \
++	-Wl,-Map -Wl,libOpenIPMIglib.map $(GLIB_LIBS) \
+ 	-rpath $(libdir)
+ 
+ libOpenIPMIglib12_la_SOURCES = glib_os_hnd.c
+ libOpenIPMIglib12_la_CFLAGS = $(GLIB12_CFLAGS) $(AM_CFLAGS)
+ libOpenIPMIglib12_la_LIBADD = $(GDBM_LIB)
+ libOpenIPMIglib12_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMIglib12.map $(GLIB12_LIBS) -L$(libdir) \
++	-Wl,-Map -Wl,libOpenIPMIglib12.map $(GLIB12_LIBS) \
+ 	-rpath $(libdir)
+ 
+ CLEANFILES = libOpenIPMIglib.map libOpenIPMIglib12.map
+diff --git a/tcl/Makefile.am b/tcl/Makefile.am
+index b702819..282619c 100644
+--- a/tcl/Makefile.am
++++ b/tcl/Makefile.am
+@@ -11,7 +11,7 @@ libOpenIPMItcl_la_SOURCES = tcl_os_hnd.c
+ libOpenIPMItcl_la_CFLAGS = $(TCL_CFLAGS) $(AM_CFLAGS)
+ libOpenIPMItcl_la_LIBADD = $(GDBM_LIB)
+ libOpenIPMItcl_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMItcl.map $(TCL_LIBS) -L$(libdir) \
++	-Wl,-Map -Wl,libOpenIPMItcl.map $(TCL_LIBS) \
+ 	-rpath $(libdir)
+ 
+ noinst_PROGRAMS = test_handlers
+diff --git a/unix/Makefile.am b/unix/Makefile.am
+index a792147..a108bc6 100644
+--- a/unix/Makefile.am
++++ b/unix/Makefile.am
+@@ -11,13 +11,13 @@ libOpenIPMIpthread_la_SOURCES = posix_thread_os_hnd.c selector.c
+ libOpenIPMIpthread_la_LIBADD = -lpthread $(GDBM_LIB) \
+ 	$(top_builddir)/utils/libOpenIPMIutils.la
+ libOpenIPMIpthread_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMIpthread.map -L$(libdir)
++	-Wl,-Map -Wl,libOpenIPMIpthread.map
+ 
+ libOpenIPMIposix_la_SOURCES = posix_os_hnd.c selector.c
+ libOpenIPMIposix_la_LIBADD = $(top_builddir)/utils/libOpenIPMIutils.la \
+ 	$(GDBM_LIB)
+ libOpenIPMIposix_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+-	-Wl,-Map -Wl,libOpenIPMIposix.map -L$(libdir)
++	-Wl,-Map -Wl,libOpenIPMIposix.map
+ 
+ noinst_HEADERS = heap.h
+ 
+-- 
+1.7.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/openipmi_2.0.22.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/openipmi_2.0.22.bb
new file mode 100644
index 0000000..9f4b0ff
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openipmi/openipmi_2.0.22.bb
@@ -0,0 +1,112 @@
+SUMMARY = "IPMI (Intelligent Platform Management Interface) library and tools"
+DESCRIPTION = "OpenIPMI is an effort to create a full-function IPMI system, \
+to allow full access to all IPMI information on a server \
+and to abstract it to a level that will make it easy to use"
+
+HOMEPAGE = "http://openipmi.sourceforge.net"
+
+DEPENDS = " \
+    glib-2.0 \
+    ncurses \
+    net-snmp \
+    openssl \
+    popt \
+    python \
+    swig-native \
+    "
+
+LICENSE = "GPLv2 & LGPLv2.1 & BSD"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
+                    file://COPYING.BSD;md5=4b318d4160eb69c8ee53452feb1b4cdf \
+                    "
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/openipmi/OpenIPMI-${PV}.tar.gz \
+           file://fix-symlink-install-error-in-cmdlang.patch \
+           file://openipmi-no-openipmigui-man.patch \
+           file://openipmi-remove-host-path-from-la_LDFLAGS.patch \
+           file://openipmi-don-t-rm-.libs.patch \
+           file://ipmi-init-fix-the-arguments.patch \
+           file://makefile-add-ldflags.patch \
+           file://do-not-install-pyc-and-pyo.patch \
+           file://include_sys_types.patch \
+           file://openipmi-helper \
+           file://ipmi.service \
+           "
+
+SRC_URI[md5sum] = "9a4e1f6bb073379c494839201ea10aee"
+SRC_URI[sha256sum] = "4988900043c35fcfa9b2bf275d6593904f6429221befb770ba6ecb5502108e55"
+
+S = "${WORKDIR}/OpenIPMI-${PV}"
+
+inherit autotools-brokensep pkgconfig pythonnative perlnative update-rc.d systemd
+
+EXTRA_OECONF = "--disable-static \
+                --with-perl='${STAGING_BINDIR_NATIVE}/perl-native/perl' \
+                --with-python='${STAGING_BINDIR_NATIVE}/python-native/python' \
+                --with-pythoninstall='${PYTHON_SITEPACKAGES_DIR}' \
+                --with-glibver=2.0 --with-glib12=no"
+
+PACKAGECONFIG ??= "gdbm"
+PACKAGECONFIG[gdbm] = "ac_cv_header_gdbm_h=yes,ac_cv_header_gdbm_h=no,gdbm,"
+
+PACKAGES += "${PN}-perl ${PN}-python"
+
+FILES_${PN}-perl = " \
+    ${libdir}/perl/vendor_perl/*/OpenIPMI.pm \
+    ${libdir}/perl/vendor_perl/*/auto/OpenIPMI/OpenIPMI.so \
+    "
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
+
+FILES_${PN}-dbg += " \
+    ${libdir}/perl/vendor_perl/*/auto/OpenIPMI/.debug \
+    ${PYTHON_SITEPACKAGES_DIR}/.debug \
+    "
+
+do_configure () {
+
+    # Let's perform regular configuration first then handle perl issues.
+    autotools_do_configure
+
+    perl_ver=`perl -V:version | cut -d\' -f 2`
+    
+    # Force openipmi perl bindings to be compiled using perl-native instead of
+    # the host's perl. Set the proper install directory for the resulting
+    # openipmi.pm and openipmi.so
+    for i in ${S}/swig/Makefile ${S}/swig/perl/Makefile; do
+        echo "SAL: i = $i"
+        echo "SAL: STAGING_INCDIR_NATIVE = $STAGING_INCDIR_NATIVE"
+        echo "SAL: libdir = $libdir"
+        sed -i -e "/^PERL_CFLAGS/s:-I/usr/local/include:-I${STAGING_INCDIR_NATIVE}:g" $i
+        sed -i -e "/^PERL_INSTALL_DIR/s:^PERL_INSTALL_DIR = .*:PERL_INSTALL_DIR = ${libdir}/perl/vendor_perl/$perl_ver:g" $i
+    done
+}
+
+do_install_append () {
+    echo "SAL: D = $D"
+    echo "SAL: libdir = $libdir"
+    install -m 0755 -d ${D}${sysconfdir}/sysconfig ${D}${sysconfdir}/init.d
+    install -m 0755 ${S}/ipmi.init ${D}${sysconfdir}/init.d/ipmi
+    install -m 0644 ${S}/ipmi.sysconf ${D}${sysconfdir}/sysconfig/ipmi
+    # SAL: mv: cannot stat `/localdisk/loadbuild/slittle1/workspace/cgts_test_build/bitbake_build/tmp/work/x86_64-wrs-linux/openipmi-2.0.19-r4/image/usr/lib64/perl5': No such file or directory
+    # SAL: real path to perl is /localdisk/loadbuild/slittle1/workspace/cgts_test_build/bitbake_build/tmp/work/x86_64-wrs-linux/perl-5.14.2-r8.3/package/usr/lib64/perl5 and it is a symlink to perl so no need to mv.
+    if [ -d ${D}${libdir}/perl5 ]
+    then
+        mv ${D}${libdir}/perl5 ${D}${libdir}/perl
+    fi
+ 
+    # for systemd
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0664 ${WORKDIR}/ipmi.service ${D}${systemd_unitdir}/system
+    sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" ${D}${systemd_unitdir}/system/ipmi.service
+    install -d ${D}${libexecdir}
+    install -m 0755 ${WORKDIR}/openipmi-helper ${D}${libexecdir}
+}
+
+INITSCRIPT_NAME = "ipmi"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "ipmi.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openldap/openldap_2.4.44.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/openldap/openldap_2.4.44.bb
index 05ffc5c..f5c233f 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/openldap/openldap_2.4.44.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openldap/openldap_2.4.44.bb
@@ -14,7 +14,7 @@
 "
 SECTION = "libs"
 
-LDAP_VER = "${@'.'.join(d.getVar('PV',1).split('.')[0:2])}"
+LDAP_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 
 SRC_URI = "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${BP}.tgz \
     file://openldap-m4-pthread.patch \
@@ -54,7 +54,7 @@
 
 PACKAGECONFIG ??= "gnutls modules \
                    mdb ldap meta monitor null passwd shell proxycache dnssrv \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
 "
 #--with-tls              with TLS/SSL support auto|openssl|gnutls [auto]
 PACKAGECONFIG[gnutls] = "--with-tls=gnutls,,gnutls libgcrypt"
@@ -150,7 +150,7 @@
 # it was disabled for cross-compiling.
 CPPFLAGS_append = " -D_GNU_SOURCE -DURANDOM_DEVICE=\'/dev/urandom\' -fPIC"
 
-LDFLAGS += "-pthread"
+LDFLAGS_append = " -pthread"
 
 do_configure() {
     cp ${STAGING_DATADIR_NATIVE}/libtool/build-aux/ltmain.sh ${S}/build
@@ -242,7 +242,7 @@
     d.setVar('ALLOW_EMPTY_' + metapkg, "1")
     d.setVar('FILES_' + metapkg, "")
     metapkg_rdepends = []
-    packages = d.getVar('PACKAGES', 1).split()
+    packages = d.getVar('PACKAGES').split()
     for pkg in packages[1:]:
         if pkg.count("openldap-backend-") and not pkg in metapkg_rdepends and not pkg.count("-dev") and not pkg.count("-dbg") and not pkg.count("static") and not pkg.count("locale"):
             metapkg_rdepends.append(pkg)
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openmotif/openmotif_2.3.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/openmotif/openmotif_2.3.3.bb
index 2baeda0..35c39cb 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/openmotif/openmotif_2.3.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openmotif/openmotif_2.3.3.bb
@@ -7,7 +7,7 @@
 
 PR = "r3"
 
-PNBLACKLIST[openmotif] ?= "BROKEN: doesn't build with B!=S"
+PNBLACKLIST[openmotif] ?= "BROKEN: doesn't build with B!=S - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "http://motif.ics.com/sites/default/files/openmotif-2.3.3.tar.gz \
            file://configure.patch;patch=1"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/opensync/wbxml2_0.10.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/opensync/wbxml2_0.10.8.bb
index bd15bba..8c948c5 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/opensync/wbxml2_0.10.8.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/opensync/wbxml2_0.10.8.bb
@@ -15,7 +15,7 @@
 
 inherit cmake pkgconfig
 
-EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
+EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}"
 
 PACKAGES += "${PN}-tools"
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/openwbem/openwbem_3.2.3.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/openwbem/openwbem_3.2.3.bb
index f5896e6..e914238 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/openwbem/openwbem_3.2.3.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/openwbem/openwbem_3.2.3.bb
@@ -93,7 +93,7 @@
     touch ${D}/var/lib/openwbem/{classassociation,instances,instassociation,namespaces,schema}.{dat,ndx,lock}
 }
 
-inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
+inherit ${@bb.utils.filter('VIRTUAL-RUNTIME_init_manager', 'systemd', d)}
 SYSTEMD_SERVICE_${PN} = "owcimomd.service"
 SYSTEMD_AUTO_ENABLE = "disable"
 FILES_${PN} += " \
@@ -112,4 +112,4 @@
 "
 
 # http://errors.yoctoproject.org/Errors/Details/68630/
-PNBLACKLIST[openwbem] ?= "BROKEN: fails to build with gcc-6"
+PNBLACKLIST[openwbem] ?= "BROKEN: fails to build with gcc-6 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_1.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_1.7.bb
deleted file mode 100644
index d2a76c0..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_1.7.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-SUMMARY = "Lightweight and minimal (~20K) dumb-terminal emulation program"
-SECTION = "console/utils"
-LICENSE = "GPLv2+"
-HOMEPAGE = "http://code.google.com/p/picocom/"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=393a5ca445f6965873eca0259a17f833"
-
-SRC_URI = "http://picocom.googlecode.com/files/picocom-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "8eaba1d31407e8408674d6e57af447ef"
-SRC_URI[sha256sum] = "d0f31c8f7a215a76922d30c81a52b9a2348c89e02a84935517002b3bc2c1129e"
-
-EXTRA_OEMAKE = "'CC=${CC}' 'LD=${LD}' 'VERSION=${PV}' \
-		'CFLAGS=${CFLAGS}' 'LDFLAGS=${LDFLAGS}' "
-
-do_install () {
-    install -d ${D}${bindir}
-    install -m 0755 ${BPN} pcasc pcxm pcym pczm ${D}${bindir}/
-}
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_git.bb
new file mode 100644
index 0000000..e091094
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/picocom/picocom_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Lightweight and minimal (~20K) dumb-terminal emulation program"
+SECTION = "console/utils"
+LICENSE = "GPLv2+"
+HOMEPAGE = "http://code.google.com/p/picocom/"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3000e4830620e310fe65c0eb69df9e8a"
+
+BASEPV = "2.2"
+PV = "${BASEPV}+git${SRCPV}"
+
+SRCREV = "deffd18c24145bd6f965f44e735a50b65810ccdc"
+
+SRC_URI = "git://github.com/npat-efault/picocom"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'LD=${CC}' 'VERSION=${BASEPV}' \
+		'CFLAGS=${CFLAGS}' 'LDFLAGS=${LDFLAGS}' "
+
+do_install () {
+    install -d ${D}${bindir}
+    install -m 0755 ${BPN} pcasc pcxm pcym pczm ${D}${bindir}/
+}
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin-otr_4.0.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin-otr_4.0.0.bb
index b884b5a..47cdc72 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin-otr_4.0.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin-otr_4.0.0.bb
@@ -4,7 +4,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=92fe174bad6da3763f6e9e9eaff6df24"
 DEPENDS = "libgcrypt libotr pidgin intltool-native"
 
-PNBLACKLIST[pidgin-otr] ?= "depends on blacklisted pidgin"
+PNBLACKLIST[pidgin-otr] ?= "depends on blacklisted pidgin - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "http://www.cypherpunks.ca/otr/${BP}.tar.gz \
            file://ignore_extra-portability_warnings.patch \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin_2.11.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin_2.11.0.bb
index e997146..462e21c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin_2.11.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pidgin/pidgin_2.11.0.bb
@@ -2,7 +2,7 @@
 SECTION = "x11/network"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-DEPENDS = "python virtual/libintl intltool-native libxml2 gconf"
+DEPENDS = "python virtual/libintl intltool-native libxml2 gconf glib-2.0-native"
 
 inherit autotools gettext pkgconfig gconf perlnative
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-make-Respect-variables-from-environement.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-make-Respect-variables-from-environement.patch
new file mode 100644
index 0000000..2d0ea02
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-make-Respect-variables-from-environement.patch
@@ -0,0 +1,60 @@
+From 6245f18091cad11520c159248c1cf7a84f12857c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Apr 2017 13:15:43 -0700
+Subject: [PATCH] make: Respect variables from environement
+
+link with shared zlib
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.unx | 18 ++++++++----------
+ 1 file changed, 8 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile.unx b/Makefile.unx
+index 772da46..4ae7061 100644
+--- a/Makefile.unx
++++ b/Makefile.unx
+@@ -24,18 +24,16 @@ ZINC = -I$(ZPATH)
+ ZLIB = $(ZPATH)/libz.a
+ 
+ INCS = $(ZINC)
+-LIBS = $(ZLIB)
++LIBS = -lz
+ 
+-CC = gcc
+-LD = gcc
+-RM = rm
+-CFLAGS = -O -Wall $(INCS) -DUSE_ZLIB
++CC ?= gcc
++LD ?= gcc
++RM ?= rm
++CFLAGS += -O -Wall $(INCS) -DUSE_ZLIB
+ # [note that -Wall is a gcc-specific compilation flag ("all warnings on")]
+ O = .o
+ E =
+ 
+-LDFLAGS =
+-
+ PROG = pngcheck
+ PROG2 = pngsplit
+ PROG3 = png-fix-IDAT-windowsize
+@@ -57,13 +55,13 @@ EXES = $(PROG)$(E) $(PROG2)$(E) $(PROG3)$(E)
+ all:  $(EXES)
+ 
+ $(PROG)$(E): $(PROG).c
+-	$(CC) $(CFLAGS) -o $@ $(PROG).c $(LIBS)
++	$(CC) $(CFLAGS) -o $@ $(PROG).c $(LDFLAGS) $(LIBS)
+ 
+ $(PROG2)$(E): gpl/$(PROG2).c
+-	$(CC) $(CFLAGS) -o $@ gpl/$(PROG2).c $(LIBS)
++	$(CC) $(CFLAGS) -o $@ gpl/$(PROG2).c $(LDFLAGS) $(LIBS)
+ 
+ $(PROG3)$(E): gpl/$(PROG3).c
+-	$(CC) $(CFLAGS) -o $@ gpl/$(PROG3).c $(LIBS)
++	$(CC) $(CFLAGS) -o $@ gpl/$(PROG3).c $(LDFLAGS) $(LIBS)
+ 
+ 
+ # maintenance ---------------------------------------------------------------
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch
new file mode 100644
index 0000000..6d4465f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch
@@ -0,0 +1,36 @@
+From d4d8257953bd1e7be167aed24c0578362cc5f675 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Apr 2017 13:12:30 -0700
+Subject: [PATCH 1/2] png-fix-IDAT-windowsize: Fix format string errors in
+ fprintf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gpl/png-fix-IDAT-windowsize.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gpl/png-fix-IDAT-windowsize.c b/gpl/png-fix-IDAT-windowsize.c
+index 6d4ef9c..d212017 100644
+--- a/gpl/png-fix-IDAT-windowsize.c
++++ b/gpl/png-fix-IDAT-windowsize.c
+@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
+             fprintf(stderr, "  Compiled with zlib %s; using zlib %s.\n",
+               ZLIB_VERSION, zlib_version);
+             fprintf(stderr, "\n");
+-            fprintf(stderr, png_fix_IDAT_windowsize_usage);
++            fprintf(stderr, "%s", png_fix_IDAT_windowsize_usage);
+             fflush(stderr);
+             return 1;
+         }
+@@ -143,7 +143,7 @@ int main(int argc, char *argv[])
+     fflush(stdout);
+ 
+     if ( argn == argc ) {
+-        fprintf(stderr, png_fix_IDAT_windowsize_usage);
++        fprintf(stderr, "%s", png_fix_IDAT_windowsize_usage);
+         fflush(stderr);
+         return 5;
+     } else {
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/10-pngsplit-format-strings.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/10-pngsplit-format-strings.patch
new file mode 100644
index 0000000..f2c8668
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck/10-pngsplit-format-strings.patch
@@ -0,0 +1,40 @@
+From: Jari Aalto <jari.aalto@cante.net>
+Subject: Correct fomat strings fro hardened build flags
+
+---
+ gpl/pngsplit.c |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/gpl/pngsplit.c
++++ b/gpl/pngsplit.c
+@@ -141,8 +141,8 @@
+                   0 == strncmp( argv[argn], "-quiet", 2 ) )
+             verbose = 0;
+         else {
+-            fprintf(stderr, pngsplit_hdr);
+-            fprintf(stderr, pngsplit_usage);
++            fprintf(stderr, "%s", pngsplit_hdr);
++            fprintf(stderr, "%s", pngsplit_usage);
+             fflush(stderr);
+             return 1;
+         }
+@@ -150,8 +150,8 @@
+     }
+ 
+     if ( argn == argc ) {
+-        fprintf(stderr, pngsplit_hdr);
+-        fprintf(stderr, pngsplit_usage);
++        fprintf(stderr, "%s", pngsplit_hdr);
++        fprintf(stderr, "%s", pngsplit_usage);
+         fflush(stderr);
+         return 5;
+     } else {
+@@ -162,7 +162,7 @@
+ 
+     /*=============================  MAIN LOOP  =============================*/
+ 
+-    fprintf(stdout, pngsplit_hdr);
++    fprintf(stdout, "%s", pngsplit_hdr);
+     fflush(stdout);
+ 
+     while (argn <= argc) {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb
index 6d0dfff..9f617ec 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/pngcheck/pngcheck_2.3.0.bb
@@ -4,15 +4,21 @@
 LIC_FILES_CHKSUM = "file://gpl/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 DEPENDS = "zlib libpng"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/project/png-mng/${BPN}/${PV}/${BPN}-${PV}.tar.gz"
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/png-mng/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+           file://10-pngsplit-format-strings.patch \
+           file://0001-png-fix-IDAT-windowsize-Fix-format-string-errors-in-.patch \
+           file://0001-make-Respect-variables-from-environement.patch \
+           "
 
 SRC_URI[md5sum] = "980bd6d9a3830fdce746d7fe3c9166ee"
 SRC_URI[sha256sum] = "77f0a039ac64df55fbd06af6f872fdbad4f639d009bbb5cd5cbe4db25690f35f"
 
-EXTRA_OEMAKE = "-e MAKEFLAGS="
+CFLAGS += "-DUSE_ZLIB"
+
+EXTRA_OEMAKE = "-f ${S}/Makefile.unx"
 
 do_compile() {
-    oe_runmake -f Makefile.unx INCS=-I${STAGING_DIR_HOST}${incdir} LIBS='${STAGING_DIR_HOST}${libdir}/libz.a ${LDFLAGS}'
+    oe_runmake
 }
 
 do_install() {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.5.bb
deleted file mode 100644
index 0fc50e1..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.5.bb
+++ /dev/null
@@ -1,105 +0,0 @@
-SUMMARY = "Modern, powerful open source cross-platform C++ class libraries"
-DESCRIPTION = "Modern, powerful open source C++ class libraries and frameworks for building network- and internet-based applications that run on desktop, server, mobile and embedded systems."
-SECTION = "libs"
-HOMEPAGE = "http://pocoproject.org/"
-LICENSE = "BSL-1.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=4267f48fc738f50380cbeeb76f95cebc"
-
-# These dependencies are required by Foundation
-DEPENDS = "libpcre zlib"
-
-inherit cmake ptest
-
-BBCLASSEXTEND = "native"
-
-SRCREV = "7dfdcfb70d75ccdaaf2b43fa0b23f82599aebec3"
-SRC_URI = " \
-    git://github.com/pocoproject/poco.git \
-    file://run-ptest \
-   "
-
-S = "${WORKDIR}/git"
-
-EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \
-                 ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}"
-
-# For the native build we want to use the bundled version
-EXTRA_OECMAKE_append_class-native = " -DPOCO_UNBUNDLED=OFF"
-
-# do not use rpath
-EXTRA_OECMAKE_append = " -DCMAKE_SKIP_RPATH=ON"
-
-# By default the most commonly used poco components are built
-# Foundation is built anyway and doesn't need to be listed explicitly
-# these don't have dependencies outside oe-core
-PACKAGECONFIG ??= "XML JSON MongoDB PDF Util Net NetSSL Crypto Data DataSQLite Zip"
-
-PACKAGECONFIG[XML] = "-DENABLE_XML=ON,-DENABLE_XML=OFF,expat"
-PACKAGECONFIG[JSON] = "-DENABLE_JSON=ON,-DENABLE_JSON=OFF"
-PACKAGECONFIG[MongoDB] = "-DENABLE_MONGODB=ON,-DENABLE_MONGODB=OFF"
-PACKAGECONFIG[PDF] = "-DENABLE_PDF=ON,-DENABLE_PDF=OFF,zlib"
-PACKAGECONFIG[Util] = "-DENABLE_UTIL=ON,-DENABLE_UTIL=OFF"
-PACKAGECONFIG[Net] = "-DENABLE_NET=ON,-DENABLE_NET=OFF"
-PACKAGECONFIG[NetSSL] = "-DENABLE_NETSSL=ON,-DENABLE_NETSSL=OFF,openssl"
-PACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON,-DENABLE_CRYPTO=OFF,openssl"
-PACKAGECONFIG[Data] = "-DENABLE_DATA=ON,-DENABLE_DATA=OFF"
-PACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON,-DENABLE_DATA_SQLITE=OFF,sqlite3"
-PACKAGECONFIG[Zip] = "-DENABLE_ZIP=ON,-DENABLE_ZIP=OFF"
-
-# Additional components not build by default,
-# they might have dependencies not included in oe-core
-# or they don't work on all architectures
-PACKAGECONFIG[mod_poco] = "-DENABLE_APACHECONNECTOR=ON,-DENABLE_APACHECONNECTOR=OFF,apr apache2"
-PACKAGECONFIG[CppParser] = "-DENABLE_CPPPARSER=ON,-DENABLE_CPPPARSER=OFF"
-PACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON,-DENABLE_DATA_MYSQL=OFF,mariadb"
-PACKAGECONFIG[DataODBC] = "-DENABLE_DATA_ODBC=ON,-DENABLE_DATA_ODBC=OFF,libiodbc"
-PACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF"
-PACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF"
-PACKAGECONFIG[SevenZip] = "-DENABLE_SEVENZIP=ON,-DENABLE_SEVENZIP=OFF"
-
-# Make a package for each library
-PACKAGES = "${PN}-dbg ${POCO_PACKAGES}"
-python __anonymous () {
-    packages = []
-    testrunners = []
-    components = d.getVar("PACKAGECONFIG", True).split()
-    components.append("Foundation")
-    for lib in components:
-        pkg = ("poco-%s" % lib.lower()).replace("_","")
-        packages.append(pkg)
-        if not d.getVar("FILES_%s" % pkg, True):
-            d.setVar("FILES_%s" % pkg, "${libdir}/libPoco%s.so.*" % lib)
-        testrunners.append("%s" % lib)
-
-    d.setVar("POCO_PACKAGES", " ".join(packages))
-    d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners))
-}
-
-# "poco" is a metapackage which pulls in all Poco components
-PACKAGES += "${PN}"
-RRECOMMENDS_${PN} += "${POCO_PACKAGES}"
-RRECOMMENDS_${PN}_class-native = ""
-ALLOW_EMPTY_${PN} = "1"
-
-# -dev last to pick up the remaining stuff
-PACKAGES += "${PN}-dev ${PN}-staticdev"
-FILES_${PN}-dev = "${includedir} ${libdir}/libPoco*.so ${libdir}/cmake"
-FILES_${PN}-staticdev = "${libdir}/libPoco*.a"
-
-# ptest support
-FILES_${PN}-dbg += "${PTEST_PATH}/bin/.debug"
-
-# cppunit is only built if tests are enabled
-PACKAGES += "${PN}-cppunit"
-FILES_${PN}-cppunit += "${libdir}/libCppUnit.so*"
-ALLOW_EMPTY_${PN}-cppunit = "1"
-
-RDEPENDS_${PN}-ptest += "${PN}-cppunit"
-
-do_install_ptest () {
-       cp -rf ${B}/bin/ ${D}${PTEST_PATH}
-       cp -f ${B}/lib/libCppUnit.so* ${D}${libdir}
-       cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/
-       find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \;
-       echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners"
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.8.bb
new file mode 100644
index 0000000..1b83735
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/poco/poco_1.7.8.bb
@@ -0,0 +1,106 @@
+SUMMARY = "Modern, powerful open source cross-platform C++ class libraries"
+DESCRIPTION = "Modern, powerful open source C++ class libraries and frameworks for building network- and internet-based applications that run on desktop, server, mobile and embedded systems."
+SECTION = "libs"
+HOMEPAGE = "http://pocoproject.org/"
+LICENSE = "BSL-1.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4267f48fc738f50380cbeeb76f95cebc"
+
+# These dependencies are required by Foundation
+DEPENDS = "libpcre zlib"
+
+inherit cmake ptest
+
+BBCLASSEXTEND = "native"
+
+SRCREV = "aae9c2e0f64caf019d31ba8f97635d5656b25ba5"
+SRC_URI = " \
+    git://github.com/pocoproject/poco.git;branch=poco-${PV} \
+    file://run-ptest \
+   "
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DPOCO_UNBUNDLED=ON \
+                  -DZLIB_LIBRARY_RELEASE:STRING=z -DPCRE_LIBRARY:STRING=pcre \
+                 ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON ', '', d)}"
+
+# For the native build we want to use the bundled version
+EXTRA_OECMAKE_append_class-native = " -DPOCO_UNBUNDLED=OFF"
+
+# do not use rpath
+EXTRA_OECMAKE_append = " -DCMAKE_SKIP_RPATH=ON"
+
+# By default the most commonly used poco components are built
+# Foundation is built anyway and doesn't need to be listed explicitly
+# these don't have dependencies outside oe-core
+PACKAGECONFIG ??= "XML JSON MongoDB PDF Util Net NetSSL Crypto Data DataSQLite Zip"
+
+PACKAGECONFIG[XML] = "-DENABLE_XML=ON -DEXPAT_LIBRARY:STRING=expat,-DENABLE_XML=OFF,expat"
+PACKAGECONFIG[JSON] = "-DENABLE_JSON=ON,-DENABLE_JSON=OFF"
+PACKAGECONFIG[MongoDB] = "-DENABLE_MONGODB=ON,-DENABLE_MONGODB=OFF"
+PACKAGECONFIG[PDF] = "-DENABLE_PDF=ON,-DENABLE_PDF=OFF,zlib"
+PACKAGECONFIG[Util] = "-DENABLE_UTIL=ON,-DENABLE_UTIL=OFF"
+PACKAGECONFIG[Net] = "-DENABLE_NET=ON,-DENABLE_NET=OFF"
+PACKAGECONFIG[NetSSL] = "-DENABLE_NETSSL=ON -DOPENSSL_SSL_LIBRARY:STRING=ssl -DOPENSSL_CRYPTO_LIBRARY:STRING=crypto,-DENABLE_NETSSL=OFF,openssl"
+PACKAGECONFIG[Crypto] = "-DENABLE_CRYPTO=ON -DOPENSSL_SSL_LIBRARY:STRING=ssl -DOPENSSL_CRYPTO_LIBRARY:STRING=crypto,-DENABLE_CRYPTO=OFF,openssl"
+PACKAGECONFIG[Data] = "-DENABLE_DATA=ON,-DENABLE_DATA=OFF"
+PACKAGECONFIG[DataSQLite] = "-DENABLE_DATA_SQLITE=ON -DSQLITE3_LIBRARY:STRING=sqlite3,-DENABLE_DATA_SQLITE=OFF,sqlite3"
+PACKAGECONFIG[Zip] = "-DENABLE_ZIP=ON,-DENABLE_ZIP=OFF"
+
+# Additional components not build by default,
+# they might have dependencies not included in oe-core
+# or they don't work on all architectures
+PACKAGECONFIG[mod_poco] = "-DENABLE_APACHECONNECTOR=ON,-DENABLE_APACHECONNECTOR=OFF,apr apache2"
+PACKAGECONFIG[CppParser] = "-DENABLE_CPPPARSER=ON,-DENABLE_CPPPARSER=OFF"
+PACKAGECONFIG[DataMySQL] = "-DENABLE_DATA_MYSQL=ON -DMYSQL_LIB:STRING=mysqlclient_r,-DENABLE_DATA_MYSQL=OFF,mariadb"
+PACKAGECONFIG[DataODBC] = "-DENABLE_DATA_ODBC=ON,-DENABLE_DATA_ODBC=OFF,libiodbc"
+PACKAGECONFIG[PageCompiler] = "-DENABLE_PAGECOMPILER=ON,-DENABLE_PAGECOMPILER=OFF"
+PACKAGECONFIG[PageCompilerFile2Page] = "-DENABLE_PAGECOMPILER_FILE2PAGE=ON,-DENABLE_PAGECOMPILER_FILE2PAGE=OFF"
+PACKAGECONFIG[SevenZip] = "-DENABLE_SEVENZIP=ON,-DENABLE_SEVENZIP=OFF"
+
+# Make a package for each library
+PACKAGES = "${PN}-dbg ${POCO_PACKAGES}"
+python __anonymous () {
+    packages = []
+    testrunners = []
+    components = d.getVar("PACKAGECONFIG").split()
+    components.append("Foundation")
+    for lib in components:
+        pkg = ("poco-%s" % lib.lower()).replace("_","")
+        packages.append(pkg)
+        if not d.getVar("FILES_%s" % pkg):
+            d.setVar("FILES_%s" % pkg, "${libdir}/libPoco%s.so.*" % lib)
+        testrunners.append("%s" % lib)
+
+    d.setVar("POCO_PACKAGES", " ".join(packages))
+    d.setVar("POCO_TESTRUNNERS", "\n".join(testrunners))
+}
+
+# "poco" is a metapackage which pulls in all Poco components
+PACKAGES += "${PN}"
+RRECOMMENDS_${PN} += "${POCO_PACKAGES}"
+RRECOMMENDS_${PN}_class-native = ""
+ALLOW_EMPTY_${PN} = "1"
+
+# -dev last to pick up the remaining stuff
+PACKAGES += "${PN}-dev ${PN}-staticdev"
+FILES_${PN}-dev = "${includedir} ${libdir}/libPoco*.so ${libdir}/cmake"
+FILES_${PN}-staticdev = "${libdir}/libPoco*.a"
+
+# ptest support
+FILES_${PN}-dbg += "${PTEST_PATH}/bin/.debug"
+
+# cppunit is only built if tests are enabled
+PACKAGES += "${PN}-cppunit"
+FILES_${PN}-cppunit += "${libdir}/libCppUnit.so*"
+ALLOW_EMPTY_${PN}-cppunit = "1"
+
+RDEPENDS_${PN}-ptest += "${PN}-cppunit"
+
+do_install_ptest () {
+       cp -rf ${B}/bin/ ${D}${PTEST_PATH}
+       cp -f ${B}/lib/libCppUnit.so* ${D}${libdir}
+       cp -rf ${B}/*/testsuite/data ${D}${PTEST_PATH}/bin/
+       find "${D}${PTEST_PATH}" -executable -exec chrpath -d {} \;
+       echo "${POCO_TESTRUNNERS}" > "${D}${PTEST_PATH}/testrunners"
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.47.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.47.0.bb
deleted file mode 100644
index 071cfb2..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.47.0.bb
+++ /dev/null
@@ -1,56 +0,0 @@
-SUMMARY = "Poppler is a PDF rendering library based on the xpdf-3.0 code base"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-
-SRC_URI = " \
-    http://poppler.freedesktop.org/${BP}.tar.xz \
-    file://0001-add-manadatory-options-to-find-qt4-qt5-moc.patch \
-    file://0002-fix-gcc-6-math-ambiguous-errors.patch \
-"
-SRC_URI[md5sum] = "669b195ff24173d35cacf1d20b6fe4fa"
-SRC_URI[sha256sum] = "b872e7228fc34a71ce4b47a5aea2a57ae67528818fa846e1e0eda089319bd242"
-
-DEPENDS = "fontconfig zlib cairo lcms"
-
-inherit autotools pkgconfig gtk-doc gobject-introspection
-
-PACKAGECONFIG ??= "jpeg openjpeg png tiff nss ${@bb.utils.contains('BBFILE_COLLECTIONS', 'qt5-layer', 'qt5', '', d)}"
-PACKAGECONFIG[jpeg] = "--enable-libjpeg,--disable-libjpeg,jpeg"
-PACKAGECONFIG[png] = "--enable-libpng,--disable-libpng,libpng"
-PACKAGECONFIG[tiff] = "--enable-libtiff,--disable-libtiff,tiff"
-PACKAGECONFIG[curl] = "--enable-libcurl,--disable-libcurl,curl"
-PACKAGECONFIG[openjpeg] = "--enable-libopenjpeg=openjpeg2,--disable-libopenjpeg,openjpeg"
-PACKAGECONFIG[qt5] = "--enable-poppler-qt5 --with-moc-qt5=${STAGING_BINDIR_NATIVE}/qt5/moc,--disable-poppler-qt5,qtbase"
-PACKAGECONFIG[qt4e] = "--enable-poppler-qt4 --with-moc-qt4=${STAGING_BINDIR_NATIVE}/moc4,--disable-poppler-qt4,qt4-embedded"
-PACKAGECONFIG[nss] = "--enable-libnss,--disable-libnss,nss"
-
-# Needed for qt5
-CXXFLAGS += "--std=c++11"
-
-EXTRA_OECONF = "\
-    --enable-xpdf-headers \
-    --disable-gtk-test \
-    --enable-zlib \
-"
-
-do_compile_prepend() {
-        export GIR_EXTRA_LIBS_PATH="${B}/poppler/.libs"
-}
-
-# Adjust library names when building for QT4e
-QT4E_PATCHES = "${@bb.utils.contains('PACKAGECONFIG', 'qt4e', 'file://fix-qt4e-library-dependencies.patch', '', d)}"
-SRC_URI_append = "${QT4E_PATCHES}"
-
-# check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points
-def get_poppler_fpu_setting(bb, d):
-    if d.getVar('TARGET_FPU', 1) in [ 'soft' ]:
-        return "--enable-fixedpoint"
-    return ""
-
-EXTRA_OECONF += "${@get_poppler_fpu_setting(bb, d)}"
-
-PACKAGES =+ "libpoppler libpoppler-glib"
-FILES_libpoppler = "${libdir}/libpoppler.so.*"
-FILES_libpoppler-glib = "${libdir}/libpoppler-glib.so.*"
-
-RDEPENDS_libpoppler = "poppler-data"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.53.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.53.0.bb
new file mode 100644
index 0000000..c1bfb31
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/poppler/poppler_0.53.0.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Poppler is a PDF rendering library based on the xpdf-3.0 code base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = " \
+    http://poppler.freedesktop.org/${BP}.tar.xz \
+    file://0001-add-manadatory-options-to-find-qt4-qt5-moc.patch \
+    file://0002-fix-gcc-6-math-ambiguous-errors.patch \
+"
+SRC_URI[md5sum] = "943679f1030b9bc19a989f24121a282a"
+SRC_URI[sha256sum] = "592bf72960c6b5948b67657594b05e72d9a278daf7613c9f3cdff9a5b73096a8"
+
+DEPENDS = "fontconfig zlib cairo lcms"
+
+inherit autotools pkgconfig gtk-doc gobject-introspection
+
+PACKAGECONFIG ??= "jpeg openjpeg png tiff nss ${@bb.utils.contains('BBFILE_COLLECTIONS', 'qt5-layer', 'qt5', '', d)}"
+PACKAGECONFIG[jpeg] = "--enable-libjpeg,--disable-libjpeg,jpeg"
+PACKAGECONFIG[png] = "--enable-libpng,--disable-libpng,libpng"
+PACKAGECONFIG[tiff] = "--enable-libtiff,--disable-libtiff,tiff"
+PACKAGECONFIG[curl] = "--enable-libcurl,--disable-libcurl,curl"
+PACKAGECONFIG[openjpeg] = "--enable-libopenjpeg=openjpeg2,--disable-libopenjpeg,openjpeg"
+PACKAGECONFIG[qt5] = "--enable-poppler-qt5 --with-moc-qt5=${STAGING_BINDIR_NATIVE}/qt5/moc,--disable-poppler-qt5,qtbase qttools-native"
+PACKAGECONFIG[qt4e] = "--enable-poppler-qt4 --with-moc-qt4=${STAGING_BINDIR_NATIVE}/moc4,--disable-poppler-qt4,qt4-embedded"
+PACKAGECONFIG[nss] = "--enable-libnss,--disable-libnss,nss"
+
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
+
+EXTRA_OECONF = "\
+    --enable-xpdf-headers \
+    --disable-gtk-test \
+    --enable-zlib \
+"
+
+do_compile_prepend() {
+    export GIR_EXTRA_LIBS_PATH="${B}/poppler/.libs"
+}
+
+# Adjust library names when building for QT4e
+QT4E_PATCHES = "${@bb.utils.contains('PACKAGECONFIG', 'qt4e', 'file://fix-qt4e-library-dependencies.patch', '', d)}"
+SRC_URI_append = "${QT4E_PATCHES}"
+
+# check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points
+def get_poppler_fpu_setting(bb, d):
+    if d.getVar('TARGET_FPU') in [ 'soft' ]:
+        return "--enable-fixedpoint"
+    return ""
+
+EXTRA_OECONF += "${@get_poppler_fpu_setting(bb, d)}"
+
+PACKAGES =+ "libpoppler libpoppler-glib"
+FILES_libpoppler = "${libdir}/libpoppler.so.*"
+FILES_libpoppler-glib = "${libdir}/libpoppler-glib.so.*"
+
+RDEPENDS_libpoppler = "poppler-data"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20140130.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20140130.bb
deleted file mode 100644
index 8f2b0db..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20140130.bb
+++ /dev/null
@@ -1,32 +0,0 @@
-SUMMARY = "A portable audio library"
-SECTION = "libs/multimedia"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=26107732c2ab637c5710446fcfaf02df"
-
-PV = "v19+svnr1919"
-
-SRC_URI = "http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz \
-           file://ldflags.patch"
-SRC_URI[md5sum] = "7f220406902af9dca009668e198cbd23"
-SRC_URI[sha256sum] = "8fe024a5f0681e112c6979808f684c3516061cc51d3acc0b726af98fc96c8d57"
-
-S = "${WORKDIR}/portaudio"
-
-inherit autotools pkgconfig
-
-PACKAGECONFIG ??= "alsa jack"
-PACKAGECONFIG[alsa] = "--with-alsa, --without-alsa, alsa-lib,"
-PACKAGECONFIG[jack] = "--with-jack, --without-jack, jack,"
-
-EXTRA_OECONF = "--without-oss --without-asihpi"
-
-do_install_append() {
-    mkdir --parents ${D}${bindir}
-    for b in ${B}/bin/pa*; do
-        # Bit nasty, should always work
-        ${B}/*-libtool --mode install install $b ${D}${bindir}
-    done
-}
-
-PACKAGES += "portaudio-examples"
-FILES_portaudio-examples = "${bindir}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20161030.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20161030.bb
new file mode 100644
index 0000000..489f8ad
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/portaudio/portaudio-v19_20161030.bb
@@ -0,0 +1,32 @@
+SUMMARY = "A portable audio library"
+SECTION = "libs/multimedia"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=26107732c2ab637c5710446fcfaf02df"
+
+PV = "v190600"
+
+SRC_URI = "http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz \
+           file://ldflags.patch"
+SRC_URI[md5sum] = "4df8224e047529ca9ad42f0521bf81a8"
+SRC_URI[sha256sum] = "f5a21d7dcd6ee84397446fa1fa1a0675bb2e8a4a6dceb4305a8404698d8d1513"
+
+S = "${WORKDIR}/portaudio"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= "alsa jack"
+PACKAGECONFIG[alsa] = "--with-alsa, --without-alsa, alsa-lib,"
+PACKAGECONFIG[jack] = "--with-jack, --without-jack, jack,"
+
+EXTRA_OECONF = "--without-oss --without-asihpi"
+
+do_install_append() {
+    mkdir --parents ${D}${bindir}
+    for b in ${B}/bin/pa*; do
+        # Bit nasty, should always work
+        ${B}/*-libtool --mode install install $b ${D}${bindir}
+    done
+}
+
+PACKAGES += "portaudio-examples"
+FILES_portaudio-examples = "${bindir}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql.inc
index 454624c..812c2ae 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql.inc
@@ -20,7 +20,6 @@
 HOMEPAGE = "http://www.postgresql.com"
 LICENSE = "BSD"
 DEPENDS = "zlib readline tzcode-native"
-INC_PR = "r0"
 
 ARM_INSTRUCTION_SET = "arm"
 
@@ -38,9 +37,9 @@
 # LDFLAGS for shared libraries
 export LDFLAGS_SL = "${LDFLAGS}"
 
-inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd
+inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd gettext
 
-CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR}"
+CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR} -I${STAGING_INCDIR}/tcl8.6"
 
 SYSTEMD_SERVICE_${PN} = "postgresql.service"
 SYSTEMD_AUTO_ENABLE_${PN} = "disable"
@@ -55,14 +54,13 @@
     fi
 }
 
-enable_pam = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+enable_pam = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG ??= "${enable_pam} openssl python uuid libxml tcl nls libxml perl"
 PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
 PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl,"
 PACKAGECONFIG[python] = "--with-python,--without-python,python,python"
 PACKAGECONFIG[uuid] = "--with-ossp-uuid,--without-ossp-uuid,ossp-uuid,"
-# when tcl native package  is fixed change WORKDIR to STAGING_BINDIR_CROSS
-PACKAGECONFIG[tcl] = "--with-tcl --with-tclconfig=${STAGING_BINDIR_CROSS},--without-tcl,tcl,"
+PACKAGECONFIG[tcl] = "--with-tcl --with-tclconfig=${STAGING_BINDIR_CROSS},--without-tcl,tcl tcl-native,"
 PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,,"
 PACKAGECONFIG[libxml] = "--with-libxml,--without-libxml,libxml2,libxml2"
 PACKAGECONFIG[perl] = "--with-perl,--without-perl,perl,perl"
@@ -91,7 +89,7 @@
             fpack="${PN}-" + name + "-dbg" + " " + fpack
         d.setVar('PACKAGES', fpack)
 
-    conf=(d.getVar('PACKAGECONFIG', True) or "").split()
+    conf=(d.getVar('PACKAGECONFIG') or "").split()
     pack=d.getVar('PACKAGES', False) or ""
     bb.debug(1, "PACKAGECONFIG=%s" % conf)
     bb.debug(1, "PACKAGES1=%s" % pack )
@@ -105,7 +103,7 @@
     if "python" in conf:
         fill_more("plpython")
 
-    pack=d.getVar('PACKAGES', True) or ""
+    pack=d.getVar('PACKAGES') or ""
     bb.debug(1, "PACKAGES2=%s" % pack)
 
 }
@@ -191,7 +189,7 @@
     # multiple server config directory
     install -d -m 700 ${D}${sysconfdir}/default/${BPN}
 
-    if [ "${@d.getVar('enable_pam', True)}" = "pam" ]; then
+    if [ "${@d.getVar('enable_pam')}" = "pam" ]; then
         install -d ${D}${sysconfdir}/pam.d
         install -m 644 ${WORKDIR}/postgresql.pam ${D}${sysconfdir}/pam.d/postgresql
     fi
@@ -221,7 +219,7 @@
     ${libdir}/${BPN}/libpqwalreceiver.so \
     ${libdir}/${BPN}/*_and_*.so \
     ${@'${sysconfdir}/pam.d/postgresql' \
-       if 'pam' == d.getVar('enable_pam', True) \
+       if 'pam' == d.getVar('enable_pam') \
        else ''} \
 "
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb
new file mode 100644
index 0000000..e4d2eda
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb
@@ -0,0 +1,11 @@
+require postgresql.inc
+
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=81b69ddb31a8be66baafd14a90146ee2"
+
+SRC_URI += "\
+    file://remove.autoconf.version.check.patch \
+    file://not-check-libperl.patch \
+"
+
+SRC_URI[md5sum] = "2fee03f2034034dbfcb3321a0bb0f829"
+SRC_URI[sha256sum] = "e3eb51d045c180b03d2de1f0c3af9356e10be49448e966ca01dfc2c6d1cc9d23"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.8.bb
deleted file mode 100644
index 7dba92c..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/postgresql/postgresql_9.4.8.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-require postgresql.inc
-
-LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=3a9c1120056a102a8c8c4013cd828dce"
-
-PR = "${INC_PR}.0"
-
-SRC_URI += "\
-    file://remove.autoconf.version.check.patch \
-    file://not-check-libperl.patch \
-"
-
-SRC_URI[md5sum] = "a1a2e8014b2b4c49fc58fe2e2fe83681"
-SRC_URI[sha256sum] = "4a10640e180e0d9adb587bc25a82dcce6bf507b033637e7fb9d4eeffa33a6b4c"
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/procmail/procmail_3.22.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/procmail/procmail_3.22.bb
index 56656c4..aa474ce 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/procmail/procmail_3.22.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/procmail/procmail_3.22.bb
@@ -38,7 +38,8 @@
 
 do_install() {
     install -d ${D}${bindir}
-    install -d ${D}${mandir}/man{1,5}
+    install -d ${D}${mandir}/man1
+    install -d ${D}${mandir}/man5
     oe_runmake -i BASENAME=${D}/usr MANDIR=${D}${mandir} install
     install -m 0644 debian/mailstat.1 ${D}${mandir}/man1
 }
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb
index 6e1c8ab..97326a2 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/psqlodbc/psqlodbc_09.05.0300.bb
@@ -12,3 +12,5 @@
 
 SRC_URI[md5sum] = "4c6e0b22187d7bb1c998ffac89e50f6b"
 SRC_URI[sha256sum] = "9521f328bf28aaaf5c8488dc89792b614f9d6271742c0baf9bb41c97537764a8"
+
+PNBLACKLIST[psqlodbc] ?= "Depends on blacklisted postgresql - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/files/0001-configure.ac-do-additional-checks-on-libxml2-also-wh.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/files/0001-configure.ac-do-additional-checks-on-libxml2-also-wh.patch
new file mode 100644
index 0000000..7faeb13
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/files/0001-configure.ac-do-additional-checks-on-libxml2-also-wh.patch
@@ -0,0 +1,34 @@
+From 3f97aac5a1f43ef57b02fb9ccdcadd41a6b69fa9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Tue, 27 Oct 2015 10:21:24 +0100
+Subject: [PATCH] configure.ac: do additional checks on libxml2 also when
+ detected by pkg-config
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Applied [1]
+
+[1] https://github.com/dajobe/raptor/pull/33
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 10ff870..35fa08e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -601,7 +601,7 @@ have_libxml=0
+ need_libxml=0
+ 
+ oCPPFLAGS="$CPPFLAGS"
+-if test "X$XML_CONFIG" != X; then
++if test "X$libxml_source" != X; then
+   CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS"
+   LIBS="$LIBS $LIBXML_LIBS"
+   AC_CHECK_FUNC(xmlCreatePushParserCtxt, have_xmlCreatePushParserCtxt=yes, have_xmlCreatePushParserCtxt=no)
+-- 
+2.1.0
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/raptor2_2.0.15.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/raptor2_2.0.15.bb
new file mode 100644
index 0000000..dd00c14
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/raptor2/raptor2_2.0.15.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Library for parsing and serializing RDF syntaxes"
+LICENSE = "GPLv2 | LGPLv2.1 | Apache-2.0"
+LIC_FILES_CHKSUM = " \
+    file://LICENSE.txt;md5=b840e5ae3aeb897f45b473341348cd9c \
+    file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+    file://LICENSE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+"
+
+DEPENDS = "libxml2 libxslt curl yajl"
+
+SRC_URI = " \
+    http://download.librdf.org/source/${BPN}-${PV}.tar.gz \
+    file://0001-configure.ac-do-additional-checks-on-libxml2-also-wh.patch \
+"
+SRC_URI[md5sum] = "a39f6c07ddb20d7dd2ff1f95fa21e2cd"
+SRC_URI[sha256sum] = "ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = " \
+    --without-xml2-config \
+    --without-curl-config \
+    --without-xslt-config \
+"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c24xx-gpio_svn.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c24xx-gpio_svn.bb
index 082dc00..255754d 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c24xx-gpio_svn.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c24xx-gpio_svn.bb
@@ -13,7 +13,7 @@
 CLEANBROKEN = "1"
 
 do_compile() {
-    ${CC} ${CFLAGS} ${LDFLAGS} -static -o ${PN} gpio.c
+    ${CC} ${CFLAGS} ${LDFLAGS} -o ${PN} gpio.c
 }
 
 do_install() {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c64xx-gpio_svn.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c64xx-gpio_svn.bb
index bed0555..976a4f1 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c64xx-gpio_svn.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/samsung-soc-utils/s3c64xx-gpio_svn.bb
@@ -12,7 +12,7 @@
 CLEANBROKEN = "1"
 
 do_compile() {
-    ${CC} ${CFLAGS} ${LDFLAGS} -static -o ${PN} gpio-s3c6410.c
+    ${CC} ${CFLAGS} ${LDFLAGS} -o ${PN} gpio-s3c6410.c
 }
 
 do_install() {
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/files/make-sysroot-work.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/files/make-sysroot-work.patch
index 5405ed8..3fd85d9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/files/make-sysroot-work.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/files/make-sysroot-work.patch
@@ -1,27 +1,31 @@
-[PATCH] make sysroot work
+From 15f0722bc5481cca5ba92adceab8c769112e4ea6 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Mon, 24 Oct 2016 07:28:13 +0000
+Subject: [PATCH] sdparm: make sysroot work
 
 Upstream-Status: Pending
 
 Add = before the included dir to make sysroot work
 
 Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
 ---
  src/Makefile.am | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/Makefile.am b/src/Makefile.am
-index c83788c..9f62115 100644
+index 61dd9f8..42c911f 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
-@@ -32,7 +32,7 @@ sglib_SOURCES =		../lib/sg_lib.c \
+@@ -41,7 +41,7 @@ sglib_SOURCES =		../lib/sg_lib.c \
  			../lib/sg_pt_common.c
  
  if HAVE_SGUTILS
--INCLUDES = -I/usr/include/scsi
+-INCLUDES = -I/scsi
 +INCLUDES = -I=@includedir@/scsi
  sdparm_LDADD = @GETOPT_O_FILES@ @os_libs@ @SGUTILS_LIBS@
  sdparm_DEPENDENCIES = @GETOPT_O_FILES@
  else
 -- 
-1.9.1
+2.7.4
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.09.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.09.bb
deleted file mode 100644
index ca11ca4..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.09.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-SUMMARY = "fetch and change SCSI mode pages"
-DESCRIPTION = "The sdparm utility accesses and optionally modifies \
-SCSI devices' mode page and inquiry data."
-HOMEPAGE = "http://sg.danny.cz/sg/sdparm.html"
-SECTION = "console/utils"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=ecab6c36b7ba82c675581dd0afde36f7 \
-                    file://lib/BSD_LICENSE;md5=1d52f4a66f1e0ed96776bf354ab7a2ed"
-DEPENDS="sg3-utils"
-SRC_URI = "http://sg.danny.cz/sg/p/${BPN}-${PV}.tgz \
-           file://make-sysroot-work.patch \
-           "
-
-PACKAGES =+ "${PN}-scripts"
-RDEPENDS_${PN}-scripts += "bash ${PN}"
-
-SRC_URI[md5sum] = "e51b1fd41c3e4c9d1274a2e4f046eebf"
-SRC_URI[sha256sum] = "7294f44173ac0946f1de8af02b1bdb0bd648079245396589397a2b0d3abc42d3"
-
-inherit autotools
-
-# Put the bash scripts to ${PN}-scripts
-FILES_${PN}-scripts = "${bindir}/sas_disk_blink ${bindir}/scsi_ch_swp"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.10.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.10.bb
new file mode 100644
index 0000000..8ab2819
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sdparm/sdparm_1.10.bb
@@ -0,0 +1,23 @@
+SUMMARY = "fetch and change SCSI mode pages"
+DESCRIPTION = "The sdparm utility accesses and optionally modifies \
+SCSI devices' mode page and inquiry data."
+HOMEPAGE = "http://sg.danny.cz/sg/sdparm.html"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ecab6c36b7ba82c675581dd0afde36f7 \
+                    file://lib/BSD_LICENSE;md5=1d52f4a66f1e0ed96776bf354ab7a2ed"
+DEPENDS="sg3-utils"
+SRC_URI = "http://sg.danny.cz/sg/p/${BPN}-${PV}.tgz \
+           file://make-sysroot-work.patch \
+           "
+
+PACKAGES =+ "${PN}-scripts"
+RDEPENDS_${PN}-scripts += "bash ${PN}"
+
+SRC_URI[md5sum] = "bdae64375376ce8fe4bf9521c1db858f"
+SRC_URI[sha256sum] = "1ea1ed1bb1ee2aef62392618fa42da9ed027d5e655f174525c39235778292ab3"
+
+inherit autotools
+
+# Put the bash scripts to ${PN}-scripts
+FILES_${PN}-scripts = "${bindir}/sas_disk_blink ${bindir}/scsi_ch_swp"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils-4.14/fix-for-cross-compiling.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils-4.14/fix-for-cross-compiling.patch
deleted file mode 100644
index 86a7da6..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils-4.14/fix-for-cross-compiling.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 990234af84a5399017d1c4fe03c5c756a8e51e23 Mon Sep 17 00:00:00 2001
-From: Hongjun Yang <Hongjun.Yang@windriver.com>
-Date: Tue, 20 Aug 2013 09:41:43 +0800
-Subject: [PATCH] fix cross compiling issue
-
-Upstream-Status: Pending
-
-Signed-off-by: Hongjun.Yang <hongjun.yang@windriver.com>
-
----
- configure | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure b/configure
-index 6ee98e0..8067f54 100755
---- a/configure
-+++ b/configure
-@@ -26965,7 +26965,7 @@ fi
- if test "$cross_compiling" = yes; then :
-   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
--as_fn_error $? "cannot run test program while cross compiling
-+$as_echo "cannot run test program while cross compiling
- See \`config.log' for more details" "$LINENO" 5; }
- else
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--- 
-1.8.1.4
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils/0001-Fix-build-with-clang.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils/0001-Fix-build-with-clang.patch
new file mode 100644
index 0000000..7b627c1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils/0001-Fix-build-with-clang.patch
@@ -0,0 +1,29 @@
+From fa8371d348f6a8b0799b2e6c38247dd1399d85e3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Apr 2017 08:49:48 -0700
+Subject: [PATCH] Fix build with clang
+
+ATTRIBUTE_FORMAT_ARG macro gets computed to be empty with clang
+whereas it does support format attribute, we hard code it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/shar-opts.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/shar-opts.h b/src/shar-opts.h
+index a287046..172676f 100644
+--- a/src/shar-opts.h
++++ b/src/shar-opts.h
+@@ -377,7 +377,7 @@ extern tOptions sharOptions;
+ #   define ATTRIBUTE_FORMAT_ARG(_a)
+ # endif
+ 
+-static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
++static inline char* aoGetsText(char const* pz) __attribute__ ((format_arg(1)));
+ static inline char* aoGetsText(char const* pz) {
+     if (pz == NULL) return NULL;
+     return (char*)gettext(pz);
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.14.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.14.bb
deleted file mode 100644
index d69e6ec..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.14.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "This is the set of GNU shar utilities."
-HOMEPAGE = "http://www.gnu.org/software/sharutils/"
-SECTION = "console/utils"
-LICENSE="GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-inherit gettext autotools-brokensep
-
-SRC_URI = "ftp://ftp.gnu.org/gnu/sharutils/sharutils-4.14.tar.gz \
-    file://fix-for-cross-compiling.patch \
-"
-
-SRC_URI[md5sum] = "5686c11131b4c4c0841f8f3ef34d136a"
-SRC_URI[sha256sum] = "90f5107c167cfd1b299bb211828d2586471087863dbed698f53109cd5f717208"
-
-do_configure () {
-    oe_runconf
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.15.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.15.2.bb
new file mode 100644
index 0000000..812fee9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sharutils/sharutils_4.15.2.bb
@@ -0,0 +1,21 @@
+SUMMARY = "This is the set of GNU shar utilities."
+HOMEPAGE = "http://www.gnu.org/software/sharutils/"
+SECTION = "console/utils"
+LICENSE="GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+inherit gettext autotools
+
+SRC_URI = "ftp://ftp.gnu.org/gnu/${BPN}/${BP}.tar.gz \
+           file://0001-Fix-build-with-clang.patch \
+"
+SRC_URI[md5sum] = "32a51b23e25ad5e6af4b89f228be1800"
+SRC_URI[sha256sum] = "ee336e68549664e7a19b117adf02edfdeac6307f22e5ba78baca457116914637"
+
+do_install_append() {
+    if [ -e ${D}${libdir}/charset.alias ]
+    then
+        rm -rf ${D}${libdir}/charset.alias
+        rmdir --ignore-fail-on-non-empty ${D}${libdir}
+    fi
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite-2.8.17/0001-shell.c-Fix-format-not-a-string-literal-warning.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite-2.8.17/0001-shell.c-Fix-format-not-a-string-literal-warning.patch
new file mode 100644
index 0000000..c5d7c0c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite-2.8.17/0001-shell.c-Fix-format-not-a-string-literal-warning.patch
@@ -0,0 +1,32 @@
+From 443980ddc82fb40e2e1f9544f2be169bd23dd246 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 16:49:24 -0700
+Subject: [PATCH] shell.c:  Fix format not a string literal warning
+
+src/shell.c:695:20: error: format not a string literal and no format arguments [-Werror=format-security]
+|      fprintf(stderr,zHelp);
+|                     ^~~~~
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/shell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/shell.c b/src/shell.c
+index bb46c49..3c6fe0f 100644
+--- a/src/shell.c
++++ b/src/shell.c
+@@ -692,7 +692,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
+   }else
+ 
+   if( c=='h' && strncmp(azArg[0], "help", n)==0 ){
+-    fprintf(stderr,zHelp);
++    fprintf(stderr, "%s", zHelp);
+   }else
+ 
+   if( c=='i' && strncmp(azArg[0], "indices", n)==0 && nArg>1 ){
+-- 
+2.13.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite_2.8.17.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite_2.8.17.bb
index e6e14c2..501c0e3 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite_2.8.17.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/sqlite/sqlite_2.8.17.bb
@@ -8,9 +8,11 @@
 PR = "r7"
 
 SRC_URI = "http://www.hwaci.com/sw/sqlite/sqlite-${PV}.tar.gz \
-    file://mainmk_build_dynamic.patch \
-    file://mainmk_no_tcl.patch \
-    file://sqlite.pc"
+           file://mainmk_build_dynamic.patch \
+           file://mainmk_no_tcl.patch \
+           file://sqlite.pc \
+           file://0001-shell.c-Fix-format-not-a-string-literal-warning.patch \
+           "
 
 SOURCES = "attach.o auth.o btree.o btree_rb.o build.o copy.o date.o delete.o \
            expr.o func.o hash.o insert.o main.o opcodes.o os.o pager.o \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/files/add-option-to-remove-docs.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/files/add-option-to-remove-docs.patch
new file mode 100644
index 0000000..9b2bd99
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/files/add-option-to-remove-docs.patch
@@ -0,0 +1,57 @@
+Add option to build this utility without a documentation.
+
+For full documentation building are necessary utilities like
+groff and ps2pdf. Full documentation can takes a lot of space.
+So it can be disabled by overloading makefile variable WITHOUT_DOC.
+
+Upstream-Status: Inappropriate [Other]
+Workaround specific to our build system.
+
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index 9bdd8f1..a2b5494 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -141,6 +141,14 @@ GROFF = @GROFF@
+ #
+ SOELIM = @SOELIM@
+ 
++# Option to build this utility without building and installing the documentation.
++WITHOUT_DOC ?= 0
++ifeq ($(WITHOUT_DOC),0)
++	BUILD_DOC = all-doc
++	INST_DOC = install-doc
++	CLR_DOC = clean-doc
++endif
++
+ # ---------------------------------------------------------
+ # You should not need to change anything below this line.
+ 
+@@ -4090,7 +4098,7 @@ bin/test_url_decode: $(test_url_decode_obj) .bin srecord/libsrecord.la
+ 	$(LIBTOOL) --mode=link --tag=CXX $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ \
+ 		$(test_url_decode_obj) srecord/libsrecord.la $(LDFLAGS) $(LIBS)
+ 
+-all: all-bin all-doc
++all: all-bin $(BUILD_DOC)
+ 
+ all-bin: bin/srec_cat bin/srec_cmp bin/srec_info bin/test_arglex_ambiguous \
+ 		bin/test_crc16 bin/test_fletcher16 bin/test_gecos \
+@@ -4156,7 +4164,7 @@ test_files = t0001a t0002a t0003a t0004a t0005a t0006a t0007a t0008a t0009a \
+ sure: $(test_files)
+ 	@echo Passed All Tests
+ 
+-clean: clean-bin clean-doc clean-misc clean-obj
++clean: clean-bin $(CLR_DOC) clean-misc clean-obj
+ 
+ clean-bin:
+ 	rm -f bin/srec_cat bin/srec_cmp bin/srec_info bin/test_arglex_ambiguous
+@@ -4443,7 +4451,7 @@ distclean-directories:
+ 	rm -rf test/fletcher16/.libs test/gecos/.libs test/hyphen/.libs
+ 	rm -rf test/url_decode/.libs
+ 
+-install: install-bin install-doc install-include install-libdir install-man
++install: install-bin $(INST_DOC) install-include install-libdir install-man
+ 
+ install-bin: $(bindir)/srec_cat $(bindir)/srec_cmp $(bindir)/srec_info
+ 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/srecord_1.64.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/srecord_1.64.bb
new file mode 100644
index 0000000..fe1af47
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/srecord/srecord_1.64.bb
@@ -0,0 +1,23 @@
+SUMMARY = "A collection of powerful tools for manipulating EPROM load files."
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8dfcbf2f0a144b97f0931b6394debea7"
+
+SRC_URI = " \
+    http://srecord.sourceforge.net/srecord-${PV}.tar.gz \
+    file://add-option-to-remove-docs.patch \
+"
+
+SRC_URI[md5sum] = "4de4a7497472d7972645c2af91313769"
+SRC_URI[sha256sum] = "49a4418733c508c03ad79a29e95acec9a2fbc4c7306131d2a8f5ef32012e67e2"
+
+DEPENDS = "libtool-native boost groff-native"
+
+inherit autotools-brokensep
+
+EXTRA_OECONF = "--without-gcrypt LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
+
+# Set variable WITHOUT_DOC=0 to enable documentation generation
+EXTRA_OEMAKE = "WITHOUT_DOC=1"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/synergy/synergy_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/synergy/synergy_git.bb
index e6057f4..f2063e4 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/synergy/synergy_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/synergy/synergy_git.bb
@@ -4,12 +4,13 @@
 LICENSE = "GPL-2.0"
 SECTION = "x11/utils"
 
-DEPENDS = "virtual/libx11 libxtst libxinerama unzip-native curl openssl"
+DEPENDS = "virtual/libx11 libxtst libxinerama curl openssl"
+do_unpack_extra[depends] = "unzip-native:do_populate_sysroot"
 
 # depends on virtual/libx11
 REQUIRED_DISTRO_FEATURES = "x11"
 
-SRC_URI = "git://github.com/synergy/synergy.git;protocol=http"
+SRC_URI = "git://github.com/symless/synergy-core.git;protocol=https"
 
 # Version 1.7.4-rc8
 SRCREV ?= "588fb4b805dd452556d05dbc03fe29ea5b4e43c0"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-for-mutex.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-for-mutex.patch
deleted file mode 100644
index 89022aa..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-for-mutex.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Fix the memory leak problem for mutex
-
-Upstream-Status: Pending
-
-Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
----
- lib/logqueue.c               |    1 +
- modules/affile/affile-dest.c |    2 ++
- modules/dbparser/dbparser.c  |    1 +
- 3 files changed, 4 insertions(+), 0 deletions(-)
-
-diff --git a/lib/logqueue.c b/lib/logqueue.c
-index 337a3c1..10edcf0 100644
---- a/lib/logqueue.c
-+++ b/lib/logqueue.c
-@@ -188,6 +188,7 @@ log_queue_init_instance(LogQueue *self, const gchar *persist_name)
- void
- log_queue_free_method(LogQueue *self)
- {
-+  g_static_mutex_free(&self->lock);
-   g_free(self->persist_name);
-   g_free(self);
- }
-diff --git a/modules/affile/affile-dest.c b/modules/affile/affile-dest.c
-index a2bcdad..ce79f6f 100644
---- a/modules/affile/affile-dest.c
-+++ b/modules/affile/affile-dest.c
-@@ -305,6 +305,7 @@ affile_dw_free(LogPipe *s)
- {
-   AFFileDestWriter *self = (AFFileDestWriter *) s;
-   
-+  g_static_mutex_free(&self->lock);
-   log_pipe_unref((LogPipe *) self->writer);
-   self->writer = NULL;
-   g_free(self->filename);
-@@ -687,6 +688,7 @@ affile_dd_free(LogPipe *s)
-   /* NOTE: this must be NULL as deinit has freed it, otherwise we'd have circular references */
-   g_assert(self->single_writer == NULL && self->writer_hash == NULL);
- 
-+  g_static_mutex_free(&self->lock);
-   log_template_unref(self->filename_template);
-   log_writer_options_destroy(&self->writer_options);
-   log_dest_driver_free(s);
-diff --git a/modules/dbparser/dbparser.c b/modules/dbparser/dbparser.c
-index f1248b5..9775701 100644
---- a/modules/dbparser/dbparser.c
-+++ b/modules/dbparser/dbparser.c
-@@ -284,6 +284,7 @@ log_db_parser_free(LogPipe *s)
- {
-   LogDBParser *self = (LogDBParser *) s;
- 
-+  g_static_mutex_free(&self->lock);
-   if (self->db)
-     pattern_db_free(self->db);
- 
--- 
-1.7.1
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/configure.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/configure.patch
deleted file mode 100644
index 109f58c..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/configure.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Index: syslog-ng-3.5.4.1/configure.ac
-===================================================================
---- syslog-ng-3.5.4.1.orig/configure.ac	2014-07-18 13:49:36.794141441 +0000
-+++ syslog-ng-3.5.4.1/configure.ac	2014-07-18 14:23:57.738197606 +0000
-@@ -8,7 +8,8 @@ dnl SNAPSHOT_VERSION   - snapshot version to add to version number
- dnl BINARY_BRANCH      - the value is added to all source/binary packages
- dnl SOURCE_REVISION    - Revision of the source-tree, will added to the version string
- dnl
--AC_INIT(syslog-ng/main.c)
-+AC_INIT(syslog-ng, 3.5.4.1)
-+AC_CONFIG_SRCDIR(syslog-ng/main.c)
- AC_CONFIG_MACRO_DIR([m4])
- m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
- 
-@@ -53,7 +54,7 @@ else
-         CURRDATE=`date +"%a, %d %b %Y %H:%M:%S %Z"`
- fi
- 
--AM_INIT_AUTOMAKE($PACKAGE, $VERSION, [foreign no-define subdir-objects])
-+AM_INIT_AUTOMAKE([foreign no-define subdir-objects])
- _AM_PROG_TAR([ustar])
- if test -n "$SNAPSHOT_VERSION"; then
- 	VERSION=$VERSION+$SNAPSHOT_VERSION
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/dbifix.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/dbifix.patch
deleted file mode 100644
index 15dfb68..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/dbifix.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: syslog-ng-3.5.4.1/configure.ac
-===================================================================
---- syslog-ng-3.5.4.1.orig/configure.ac	2014-07-18 14:35:03.134215740 +0000
-+++ syslog-ng-3.5.4.1/configure.ac	2014-07-18 15:31:52.510308653 +0000
-@@ -576,13 +576,14 @@
- dnl ***************************************************************************
- 
- AC_CHECK_LIB(dl, dlsym, DL_LIBS="-ldl")
-+if test "x$enable_sql" != "xno"; then
- PKG_CHECK_MODULES(LIBDBI, dbi >= $LIBDBI_MIN_VERSION, libdbi_pkgconfig_not_found="0", libdbi_pkgconfig_not_found="1")
- 
- if test "$libdbi_pkgconfig_not_found" -eq 1; then
- 	dnl if libdbi has no .pc file, try it without one
- 	AC_CHECK_LIB(dbi, dbi_initialize, LIBDBI_LIBS="-ldbi"; LIBDBI_CFLAGS="-I/usr/include")
- fi
--
-+fi
- if test "x$enable_sql" = "xauto"; then
- 	AC_MSG_CHECKING(whether to enable SQL support)
- 	if test "x$LIBDBI_LIBS" != "x"; then
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/fix-a-memory-leak-in-log_driver_free.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/fix-a-memory-leak-in-log_driver_free.patch
deleted file mode 100644
index 2603474..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/fix-a-memory-leak-in-log_driver_free.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From a269669ba3cb6d1c06a3322b4a6a035cb787d085 Mon Sep 17 00:00:00 2001
-From: Gergely Nagy <algernon@balabit.hu>
-Date: Tue, 14 Jan 2014 13:58:05 +0100
-Subject: [PATCH] driver: Fix a memory leak in log_driver_free()
-
-Upstream-Status: Backport
-
-After freeing up the members of self->plugins, free self->plugins itself
-too.
-
-Signed-off-by: Gergely Nagy <algernon@balabit.hu>
----
- lib/driver.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/lib/driver.c b/lib/driver.c
-index d77fe57..a6867b9 100644
---- a/lib/driver.c
-+++ b/lib/driver.c
-@@ -91,6 +91,10 @@ log_driver_free(LogPipe *s)
-     {
-       log_driver_plugin_free((LogDriverPlugin *) l->data);
-     }
-+  if (self->plugins)
-+    {
-+      g_list_free(self->plugins);
-+    }
-   if (self->group)
-     g_free(self->group);
-   if (self->id)
--- 
-1.8.4.1
-
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
index f0da2b7..0c6f543 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
@@ -1,4 +1,4 @@
-@version: 3.5
+@version: 3.8
 #
 # Syslog-ng configuration file, compatible with default Debian syslogd
 # installation. Originally written by anonymous (I can't find his name)
@@ -52,7 +52,7 @@
 destination d_newserr { file("/var/log/news/news.err"); };
 destination d_newsnotice { file("/var/log/news/news.notice"); };
 
-# Some `catch-all' logfiles.
+# Some 'catch-all' logfiles.
 #
 destination d_debug { file("/var/log/debug"); };
 destination d_error { file("/var/log/error"); };
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
index f53c607..6b30c20 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
@@ -15,18 +15,17 @@
 index fc16f8d..8e09deb 100644
 --- a/contrib/systemd/syslog-ng.service
 +++ b/contrib/systemd/syslog-ng.service
-@@ -3,9 +3,8 @@ Description=System Logger Daemon
- Documentation=man:syslog-ng(8)
+@@ -4,8 +4,8 @@ Description=System Logger Daemon
  
  [Service]
--Type=notify
--ExecStart=/usr/sbin/syslog-ng -F
+ Type=notify
+-ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS
 -ExecReload=/bin/kill -HUP $MAINPID
-+ExecStart=@SBINDIR@/syslog-ng -F -p @LOCALSTATEDIR@/run/syslogd.pid
++ExecStart=@SBINDIR@/syslog-ng -F $SYSLOGNG_OPTS -p @LOCALSTATEDIR@/run/syslogd.pid
 +ExecReload=@BASEBINDIR@/kill -HUP $MAINPID
+ EnvironmentFile=-/etc/default/syslog-ng
+ EnvironmentFile=-/etc/sysconfig/syslog-ng
  StandardOutput=journal
- StandardError=journal
- Restart=on-failure
 -- 
 1.8.4.2
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
index 898e9c2..0977f7e 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
@@ -10,19 +10,19 @@
 HOMEPAGE = "http://www.balabit.com/network-security/syslog-ng/opensource-logging-system"
 
 LICENSE = "GPLv2 & LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=e0e8658d9be248f01b7933df24dc1408"
+LIC_FILES_CHKSUM = "file://COPYING;md5=24c0c5cb2c83d9f2ab725481e4df5240"
 
 # util-linux added to get libuuid
-DEPENDS = "libpcre flex eventlog glib-2.0 util-linux"
+DEPENDS = "libpcre flex eventlog glib-2.0 openssl util-linux"
 
-SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${BPN}_${PV}.tar.gz \
+SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \
            file://syslog-ng.conf \
            file://initscript \
            file://volatiles.03_syslog-ng \
            file://configure.ac-add-option-enable-thread-tls-to-manage-.patch \
 "
 
-inherit autotools systemd pkgconfig update-alternatives update-rc.d
+inherit autotools gettext systemd pkgconfig update-rc.d
 
 EXTRA_OECONF = " \
     --enable-dynamic-linking \
@@ -32,32 +32,38 @@
     --sysconfdir=${sysconfdir}/${BPN} \
     --with-module-dir=${libdir}/${BPN} \
     --with-sysroot=${STAGING_DIR_HOST} \
-    --with-libmongo-client=no --disable-mongodb \
+    --without-mongoc --disable-mongodb \
     --with-librabbitmq-client=no \
+    --disable-python \
+    --disable-java --disable-java-modules \
     ${CONFIG_TLS} \
 "
 
 CONFIG_TLS = "--enable-thread-tls"
 CONFIG_TLS_arm = "${@base_conditional( "DEBUG_BUILD", "1", " --disable-thread-tls", " --enable-thread-tls", d )}"
 
-PACKAGECONFIG ??= "openssl \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+PACKAGECONFIG ??= " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \
 "
-PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl,openssl,"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
 PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/,--disable-systemd --without-systemdsystemunitdir,systemd,"
 PACKAGECONFIG[linux-caps] = "--enable-linux-caps,--disable-linux-caps,libcap,"
-PACKAGECONFIG[pcre] = "--enable-pcre,--disable-pcre,libpcre,"
 PACKAGECONFIG[dbi] = "--enable-sql,--disable-sql,libdbi,"
 PACKAGECONFIG[libnet] = "--enable-libnet --with-libnet=${STAGING_BINDIR_CROSS},--disable-libnet,libnet,"
+PACKAGECONFIG[http] = "--enable-http,--disable-http,curl,"
 PACKAGECONFIG[smtp] = "--enable-smtp --with-libesmtp=${STAGING_LIBDIR},--disable-smtp,libesmtp,"
 PACKAGECONFIG[json] = "--enable-json,--disable-json,json-c,"
 PACKAGECONFIG[tcp-wrapper] = "--enable-tcp-wrapper,--disable-tcp-wrapper,tcp-wrappers,"
 PACKAGECONFIG[geoip] = "--enable-geoip,--disable-geoip,geoip,"
+PACKAGECONFIG[native] = "--enable-native,--disable-native,,"
 
 do_configure_prepend() {
-    eval "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}"
+	olddir=$(pwd)
+	cd ${AUTOTOOLS_SCRIPT_PATH}
+
+	ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} -I ${S}/m4 ${ACLOCALEXTRAPATH} || die "extra autoreconf execution failed."
+
+	cd $olddir
 }
 
 do_install_prepend() {
@@ -70,7 +76,7 @@
     install -d ${D}/${sysconfdir}/${BPN}
     install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf
     install -d ${D}/${sysconfdir}/init.d
-    install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${BPN}
+    install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog
     install -d ${D}/${sysconfdir}/default/volatiles/
     install -m 755 ${WORKDIR}/volatiles.03_syslog-ng ${D}/${sysconfdir}/default/volatiles/03_syslog-ng
     install -d ${D}/${localstatedir}/lib/${BPN}
@@ -86,7 +92,7 @@
 FILES_${PN}-libs = "${libdir}/${BPN}/*.so ${libdir}/libsyslog-ng-*.so*"
 FILES_${PN}-libs-dev = "${libdir}/${BPN}/lib*.la"
 FILES_${PN}-libs-dbg = "${libdir}/${BPN}/.debug"
-FILES_${PN}-staticdev = "${libdir}/${BPN}/libtest/*.a"
+FILES_${PN}-staticdev += "${libdir}/${BPN}/libtest/*.a"
 INSANE_SKIP_${PN}-libs = "dev-so"
 RDEPENDS_${PN} += "${PN}-libs"
 
@@ -96,26 +102,12 @@
 # update-rc.d and update-alternatives is important
 RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}"
 
+RCONFLICTS_${PN} = "busybox-syslog sysklogd rsyslog"
+
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
 RCONFLICTS_${PN} += "${PN}-systemd"
 SYSTEMD_SERVICE_${PN} = "${BPN}.service"
 
-# no syslog-init for systemd
-python () {
-    if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-        pn = d.getVar('PN', True)
-        sysconfdir = d.getVar('sysconfdir', True)
-        d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init')
-        d.setVarFlag('ALTERNATIVE_PRIORITY', 'syslog-init', '200')
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (sysconfdir))
-
-    if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
-        pn = d.getVar('PN', True)
-        d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service')
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True)))
-        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/${BPN}.service' % (d.getVar('systemd_unitdir', True)))
-}
-
 INITSCRIPT_NAME = "syslog"
 INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.6.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.6.4.bb
deleted file mode 100644
index 73609af..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.6.4.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-require syslog-ng.inc
-
-SRC_URI += " \
-    file://fix-a-memory-leak-in-log_driver_free.patch \
-    file://fix-config-libnet.patch \
-    file://fix-invalid-ownership.patch \
-    file://Fix-the-memory-leak-problem-for-mutex.patch \
-    file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
-    file://configure.patch \
-    file://dbifix.patch \
-    file://syslog-ng.service-the-syslog-ng-service.patch \
-"
-
-SRC_URI[md5sum] = "e9f401615e92e5eb27396c995c1446ba"
-SRC_URI[sha256sum] = "7be11df31ac7d716f1f952e22b5ae8e2049edd633a41b223776a853d9106f4e7"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
new file mode 100644
index 0000000..91a0e46
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
@@ -0,0 +1,11 @@
+require syslog-ng.inc
+
+SRC_URI += " \
+    file://fix-config-libnet.patch \
+    file://fix-invalid-ownership.patch \
+    file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
+    file://syslog-ng.service-the-syslog-ng-service.patch \
+"
+
+SRC_URI[md5sum] = "acf14563cf5ce435db8db35486ce66af"
+SRC_URI[sha256sum] = "84b081f6e5f98cbc52052e342bcfdc5de5fe0ebe9f5ec32fe9eaec5759224cc5"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/system-config-keyboard/system-config-keyboard_1.4.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/system-config-keyboard/system-config-keyboard_1.4.0.bb
index 078fcea..26b4412 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/system-config-keyboard/system-config-keyboard_1.4.0.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/system-config-keyboard/system-config-keyboard_1.4.0.bb
@@ -5,10 +5,9 @@
 SRC_URI = "https://fedorahosted.org/releases/s/y/${BPN}/${BP}.tar.bz2"
 SRC_URI[md5sum] = "c267db0ee7a2131ba418399dc17f9e72"
 SRC_URI[sha256sum] = "218c883e4e2bfcc82bfe07e785707b5c2ece28df772f2155fd044b9bb1614284"
-inherit python-dir
 
 inherit python-dir gettext
-DEPENDS = "intltool-native"
+DEPENDS += "intltool-native gettext-native"
 
 EXTRA_OEMAKE = " \
     PYTHON='${STAGING_BINDIR_NATIVE}'/python-native/python \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/system-setup-keyboard/system-setup-keyboard_0.8.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/system-setup-keyboard/system-setup-keyboard_0.8.8.bb
index fbbfa3d..0bd7af7 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/system-setup-keyboard/system-setup-keyboard_0.8.8.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/system-setup-keyboard/system-setup-keyboard_0.8.8.bb
@@ -29,3 +29,5 @@
 }
 
 FILES_${PN} += "${systemd_unitdir}/system/${BPN}.service"
+
+PNBLACKLIST[system-setup-keyboard] ?= "Depends on blacklisted system-config-keyboard-native - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb.bb
new file mode 100644
index 0000000..35840fd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb.bb
@@ -0,0 +1,40 @@
+DESCRIPTION = "Parallelism library for C++ - runtime files \
+    TBB is a library that helps you leverage multi-core processor \
+    performance without having to be a threading expert. It represents a \
+    higher-level, task-based parallelism that abstracts platform details \
+    and threading mechanism for performance and scalability."
+HOMEPAGE = "http://threadingbuildingblocks.org/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
+PRDATE = "20170118"
+PV = "${PRDATE}"
+SRC_URI = "https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb2017_${PRDATE}oss_src.tgz \
+           file://cross-compile.patch \
+           file://tbb.pc"
+SRC_URI[md5sum] = "26baa6fbcc8f03ee45c0641b91d9588a"
+SRC_URI[sha256sum] = "48bb526287fa8b4e7d1e1b2ba9e5fb9c3e372b497772c06ef9ccd7f93f344e74"
+
+S = "${WORKDIR}/tbb2017_${PRDATE}oss/"
+
+COMPILER ?= "gcc"
+COMPILER_toolchain-clang = "clang"
+do_compile() {
+    oe_runmake compiler=${COMPILER} arch=${HOST_ARCH} runtime=cc4
+}
+
+do_install() {
+    install -d ${D}${includedir} ${D}${libdir}/pkgconfig
+    rm ${S}/include/tbb/index.html -f
+    cp -R --no-dereference --preserve=mode,links -v ${S}/include/tbb ${D}${includedir}
+    install -m 0755 ${B}/build/linux_*_release/lib*.so* ${D}${libdir}
+    install -m 0644 ${WORKDIR}/tbb.pc ${D}${libdir}/pkgconfig
+}
+
+# fails with thumb enabled:
+# | arm-oe-linux-gnueabi-g++  -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a9 -mcpu=cortex-a9 -D__ARM__ -D__LINUX_ARM_ARCH__=7 -funwind-tables -mvectorize-with-neon-quad -rdynamic --sysroot=/OE/sysroots/m14tv -c -MMD -DTBB_USE_DEBUG  -g -O0 -DUSE_PTHREAD -fPIC -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-non-virtual-dtor -O2 -pipe -g -feliminate-unused-debug-types -fpermissive -fvisibility-inlines-hidden   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_queue.cpp
+# | {standard input}: Assembler messages:
+# | {standard input}:250: Error: thumb conditional instruction should be in IT block -- `strexeq r2,r3,[r4]'
+# ...
+# | make[1]: *** [concurrent_queue.o] Error 1
+ARM_INSTRUCTION_SET = "arm"
+SECURITY_CFLAGS_append = " -fPIC"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/allow-to-build-for-older-arm-cores.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/allow-to-build-for-older-arm-cores.patch
deleted file mode 100644
index cd2ec94..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/allow-to-build-for-older-arm-cores.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
-Description: Allow to build TBB for ARM cores older than ARMv7a
-
-| ../../include/tbb/machine/gcc_armv7.h:39:2: error: #error Threading
-Building Blocks ARM port requires an ARMv7-a architecture.
-| make[1]: *** [concurrent_hash_map.o] Error 1
-
-https://bugs.launchpad.net/linaro-oe/+bug/1167144
-
-Upstream-status: pending
-
----
- include/tbb/tbb_machine.h |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- tbb41_20130314oss.orig/include/tbb/tbb_machine.h
-+++ tbb41_20130314oss/include/tbb/tbb_machine.h
-@@ -237,11 +237,11 @@ template<> struct atomic_selector<8> {
-         #include "machine/linux_intel64.h"
-     #elif __ia64__
-         #include "machine/linux_ia64.h"
-     #elif __powerpc__
-         #include "machine/mac_ppc.h"
--    #elif __arm__
-+    #elif __ARM_ARCH_7A__
-         #include "machine/gcc_armv7.h"
-     #elif __TBB_GCC_BUILTIN_ATOMICS_PRESENT
-         #include "machine/gcc_generic.h"
-     #endif
-     #include "machine/linux_common.h"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/cross-compile.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/cross-compile.patch
index b970a37..d54b307 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/cross-compile.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb/cross-compile.patch
@@ -5,14 +5,14 @@
  build/linux.gcc.inc |    5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
 
---- tbb41_20121003oss.orig/build/linux.gcc.inc
-+++ tbb41_20121003oss/build/linux.gcc.inc
-@@ -40,12 +40,13 @@ DYLIB_KEY = -shared
+Index: tbb2017_20170118oss/build/linux.gcc.inc
+===================================================================
+--- tbb2017_20170118oss.orig/build/linux.gcc.inc
++++ tbb2017_20170118oss/build/linux.gcc.inc
+@@ -32,8 +32,9 @@ DYLIB_KEY = -shared
  EXPORT_KEY = -Wl,--version-script,
  LIBDL = -ldl
  
- TBB_NOSTRICT = 1
- 
 -CPLUS = g++
 -CONLY = gcc
 +CPLUS = $(CXX)
@@ -20,6 +20,20 @@
 +CPLUS_FLAGS = $(CXXFLAGS)
  LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
  LIBS += -lpthread -lrt
- LINK_FLAGS = -Wl,-rpath-link=.
- C_FLAGS = $(CPLUS_FLAGS)
- # gcc 4.4 and higher support -std=c++0x
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
+Index: tbb2017_20170118oss/build/linux.clang.inc
+===================================================================
+--- tbb2017_20170118oss.orig/build/linux.clang.inc
++++ tbb2017_20170118oss/build/linux.clang.inc
+@@ -31,8 +31,9 @@ DYLIB_KEY = -shared
+ EXPORT_KEY = -Wl,--version-script,
+ LIBDL = -ldl
+ 
+-CPLUS = clang++
+-CONLY = clang
++CPLUS = $(CXX)
++CONLY = $(CC)
++CPLUS_FLAGS = $(CXXFLAGS)
+ LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
+ LIBS += -lpthread -lrt
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb_4.1.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb_4.1.bb
deleted file mode 100644
index 09ed6ec..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/tbb/tbb_4.1.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-DESCRIPTION = "Parallelism library for C++ - runtime files \
-    TBB is a library that helps you leverage multi-core processor \
-    performance without having to be a threading expert. It represents a \
-    higher-level, task-based parallelism that abstracts platform details \
-    and threading mechanism for performance and scalability."
-HOMEPAGE = "http://threadingbuildingblocks.org/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=2c7f2caf277a3933e3acdf7f89d54cc1"
-PRDATE = "20130314"
-PR = "r${PRDATE}"
-
-SRC_URI = "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_${PRDATE}oss_src.tgz \
-           file://cross-compile.patch \
-           file://allow-to-build-for-older-arm-cores.patch \
-           file://tbb.pc"
-
-S = "${WORKDIR}/tbb41_${PRDATE}oss/"
-
-SRC_URI[md5sum] = "ed4af7ccfa122f16cf9920b241633a3a"
-SRC_URI[sha256sum] = "32fd5979971b772caa96d40646cee585ed0070516ba2dbbcb1f9b6033d08a92d"
-
-do_compile() {
-    oe_runmake compiler=gcc arch=${HOST_ARCH} runtime=cc4
-}
-
-do_install() {
-    install -d ${D}${includedir} ${D}${libdir}/pkgconfig
-    rm ${S}/include/tbb/index.html -f
-    cp -R --no-dereference --preserve=mode,links -v ${S}/include/tbb ${D}${includedir}
-    install -m 0755 ${B}/build/linux_*_release/lib*.so* ${D}${libdir}
-    install -m 0644 ${WORKDIR}/tbb.pc ${D}${libdir}/pkgconfig
-}
-
-# fails with thumb enabled:
-# | arm-oe-linux-gnueabi-g++  -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a9 -mcpu=cortex-a9 -D__ARM__ -D__LINUX_ARM_ARCH__=7 -funwind-tables -mvectorize-with-neon-quad -rdynamic --sysroot=/OE/sysroots/m14tv -c -MMD -DTBB_USE_DEBUG  -g -O0 -DUSE_PTHREAD -fPIC -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-non-virtual-dtor -O2 -pipe -g -feliminate-unused-debug-types -fpermissive -fvisibility-inlines-hidden   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_queue.cpp
-# | {standard input}: Assembler messages:
-# | {standard input}:250: Error: thumb conditional instruction should be in IT block -- `strexeq r2,r3,[r4]'
-# ...
-# | make[1]: *** [concurrent_queue.o] Error 1
-ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks/0001-Make-udev-rules-directory-configurable.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks/0001-Make-udev-rules-directory-configurable.patch
new file mode 100644
index 0000000..3cc0400
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks/0001-Make-udev-rules-directory-configurable.patch
@@ -0,0 +1,91 @@
+From 32278297170ffb49116b5789e4a0588b99d02bd0 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Thu, 9 Feb 2017 11:02:53 +0200
+Subject: [PATCH] Make udev rules directory configurable.
+
+udev rules directory can be configurable via undevrulesdir variable. And use
+libdir, sbindir for installing librares and binaries.
+
+Upstream-Status: Inappropriate[Embedded specific]
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ configure.ac            | 14 +++-----------
+ data/Makefile.am        |  1 -
+ src/probers/Makefile.am |  2 +-
+ tools/Makefile.am       |  2 +-
+ 4 files changed, 5 insertions(+), 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8c4e4c2..a143397 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -227,15 +227,8 @@ if test "x$GCC" = "xyes"; then
+   LDFLAGS="-Wl,--as-needed $LDFLAGS"
+ fi
+ 
+-if test "$prefix" = "/usr" -o "$prefix" = "/usr/local" ; then
+-  slashlibdir=/lib
+-  slashsbindir=/sbin
+-else
+-  slashlibdir=$prefix/lib
+-  slashsbindir=$prefix/sbin
+-fi
+-AC_SUBST(slashlibdir)
+-AC_SUBST(slashsbindir)
++udevrulesdir=/lib/udev/udev.d
++AC_SUBST(udevrulesdir)
+ 
+ # *************
+ # Remote Access
+@@ -299,8 +292,7 @@ echo "
+         sysconfdir:                 ${sysconfdir}
+         localstatedir:              ${localstatedir}
+         docdir:                     ${docdir}
+-        slashlibdir:                ${slashlibdir}
+-        slashsbindir:               ${slashsbindir}
++        udevrulesdir:               ${udevrulesdir}
+         systemdsystemunitdir:       ${systemdsystemunitdir}
+ 
+         compiler:                   ${CC}
+diff --git a/data/Makefile.am b/data/Makefile.am
+index 411ea0f..4834960 100644
+--- a/data/Makefile.am
++++ b/data/Makefile.am
+@@ -34,7 +34,6 @@ $(systemdservice_DATA): $(systemdservice_in_files) Makefile
+ 	@sed -e "s|\@libexecdir\@|$(prefix)/lib/udisks|" $< > $@
+ endif
+ 
+-udevrulesdir = $(slashlibdir)/udev/rules.d
+ udevrules_DATA = 80-udisks.rules
+ 
+ pkgconfigdir = $(datadir)/pkgconfig
+diff --git a/src/probers/Makefile.am b/src/probers/Makefile.am
+index 01c693b..6a0361a 100644
+--- a/src/probers/Makefile.am
++++ b/src/probers/Makefile.am
+@@ -20,7 +20,7 @@ INCLUDES = \
+ # TODO: ideally move most of this to udev and/or util-linux
+ #
+ 
+-udevhelperdir = $(slashlibdir)/udev
++udevhelperdir = $(libdir)/udev
+ udevhelper_PROGRAMS =	udisks-part-id 			\
+ 			udisks-probe-sas-expander 	\
+ 			$(NULL)
+diff --git a/tools/Makefile.am b/tools/Makefile.am
+index 18325f7..0aaec11 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -54,7 +54,7 @@ udisks_LDADD = 						\
+ 	$(DBUS_GLIB_LIBS)				\
+ 	$(POLKIT_DBUS_LIBS)
+ 
+-slashsbin_PROGRAMS = umount.udisks
++sbin_PROGRAMS = umount.udisks
+ 
+ umount_udisks_SOURCES = umount-udisks.c
+ umount_udisks_LDADD = $(DBUS_GLIB_LIBS) $(POLKIT_DBUS_LIBS)
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks2_2.1.7.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks2_2.1.7.bb
index fbf6701..c784fd2 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks2_2.1.7.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks2_2.1.7.bb
@@ -2,8 +2,8 @@
 LICENSE = "GPLv2+ & LGPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=dd79f6dbbffdbc8e86b086a8f0c0ef43"
 
-DEPENDS = "acl libatasmart polkit libgudev dbus-glib glib-2.0 intltool-native gnome-common-native"
-DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+DEPENDS = "acl libatasmart polkit libgudev dbus-glib glib-2.0 intltool-native gnome-common-native libxslt-native"
+DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 
 RDEPENDS_${PN} = "acl"
 
@@ -13,6 +13,8 @@
 SRC_URI[md5sum] = "8bccd36573b75286538bd5bd2c424f45"
 SRC_URI[sha256sum] = "abae2bb3bdc691ca13c1e4c244630b8c881c4f3b35c207299f1b39b7bec83785"
 
+CVE_PRODUCT = "udisks"
+
 inherit autotools systemd gtk-doc gobject-introspection
 
 S = "${WORKDIR}/udisks-${PV}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks_1.0.5.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks_1.0.5.bb
index eec6933..ffe2c26 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks_1.0.5.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/udisks/udisks_1.0.5.bb
@@ -2,16 +2,21 @@
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=73d83aebe7e4b62346afde80e0e94273"
 
-DEPENDS = "libatasmart sg3-utils polkit libgudev dbus-glib glib-2.0 intltool-native lvm2"
+DEPENDS = "libatasmart sg3-utils polkit libgudev dbus-glib glib-2.0 intltool-native lvm2 \
+    dbus-glib-native \
+"
 # optional dependencies: device-mapper parted
 
-DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+    dbus-glib-native \
+"
 
 SRC_URI = " \
     http://hal.freedesktop.org/releases/${BPN}-${PV}.tar.gz;name=${BPN} \
     file://optional-depends.patch \
     file://0001-fix-build-with-newer-glibc-versions.patch \
     file://udisks-1.0.5-fix-service-file.patch \
+    file://0001-Make-udev-rules-directory-configurable.patch \
 "
 
 SRC_URI[udisks.md5sum] = "70d48dcfe523a74cd7c7fbbc2847fcdd"
@@ -22,7 +27,8 @@
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[parted] = "--enable-parted,--disable-parted,parted"
 
-EXTRA_OECONF = "--disable-man-pages"
+EXTRA_OECONF = "--disable-man-pages --libdir=${base_libdir} --sbindir=${base_sbindir}"
+EXTRA_OEMAKE = "udevrulesdir=${nonarch_base_libdir}/udev/rules.d/"
 
 FILES_${PN} += "${libdir}/polkit-1/extensions/*.so \
                 ${datadir}/dbus-1/ \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim/0001-Add-support-for-aarch64.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim/0001-Add-support-for-aarch64.patch
new file mode 100644
index 0000000..4b12494
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim/0001-Add-support-for-aarch64.patch
@@ -0,0 +1,82 @@
+From 24fd52cc45f7b5ff45afe072f5fbe66485df8c8e Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@suse.de>
+Date: Wed, 29 Oct 2014 14:18:28 +0100
+Subject: [PATCH] Add support for aarch64
+
+* include/private/gcconfig.h: Add support for aarch64.
+---
+ sigscheme/libgcroots/include/private/gcconfig.h | 37 +++++++++++++++++++++++++
+ 1 file changed, 37 insertions(+)
+
+diff --git a/sigscheme/libgcroots/include/private/gcconfig.h b/sigscheme/libgcroots/include/private/gcconfig.h
+index 4d42b03..0f13db6 100644
+--- a/sigscheme/libgcroots/include/private/gcconfig.h
++++ b/sigscheme/libgcroots/include/private/gcconfig.h
+@@ -62,6 +62,13 @@
+ # endif
+ 
+ /* Determine the machine type: */
++# if defined(__aarch64__)
++#    define AARCH64
++#    if !defined(LINUX)
++#      define NOSYS
++#      define mach_type_known
++#    endif
++# endif
+ # if defined(__arm__) || defined(__thumb__)
+ #    define ARM32
+ #    if !defined(LINUX) && !defined(NETBSD)
+@@ -231,6 +238,10 @@
+ #    define IA64
+ #    define mach_type_known
+ # endif
++# if defined(LINUX) && defined(__aarch64__)
++#    define AARCH64
++#    define mach_type_known
++# endif
+ # if defined(LINUX) && defined(__arm__)
+ #    define ARM32
+ #    define mach_type_known
+@@ -504,6 +515,7 @@
+ 		    /* 			running Amdahl UTS4		*/
+                     /*             S390       ==> 390-like machine      */
+ 		    /*                  running LINUX                   */
++                    /*             AARCH64    ==> ARM AArch64           */
+ 		    /* 		   ARM32      ==> Intel StrongARM	*/
+ 		    /* 		   IA64	      ==> Intel IPF		*/
+ 		    /*				  (e.g. Itanium)	*/
+@@ -1724,6 +1736,31 @@
+ #   endif
+ # endif
+ 
++# ifdef AARCH64
++#   define CPP_WORDSZ 64
++#   define MACH_TYPE "AARCH64"
++#   define ALIGNMENT 8
++#   ifndef HBLKSIZE
++#     define HBLKSIZE 4096
++#   endif
++#   ifdef LINUX
++#     define OS_TYPE "LINUX"
++#     define LINUX_STACKBOTTOM
++#     define DYNAMIC_LOADING
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++      extern char _end[];
++#     define DATAEND ((ptr_t)(&_end))
++#   endif
++#   ifdef NOSYS
++      /* __data_start is usually defined in the target linker script.   */
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++      extern void *__stack_base__;
++#     define STACKBOTTOM ((ptr_t)__stack_base__)
++#   endif
++# endif
++
+ # ifdef ARM32
+ #   define CPP_WORDSZ 32
+ #   define MACH_TYPE "ARM32"
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim_1.8.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim_1.8.6.bb
index 76a4125..909756a 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim_1.8.6.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/uim/uim_1.8.6.bb
@@ -8,6 +8,7 @@
 
 SRC_URI_append_class-target = " file://uim-module-manager.patch \
     file://0001-fix-bug-for-cross-compile.patch \
+    file://0001-Add-support-for-aarch64.patch \
 "
 SRC_URI[md5sum] = "ecea4c597bab1fd4ba98ea84edcece59"
 SRC_URI[sha256sum] = "7b1ea803c73f3478917166f04f67cce6e45ad7ea5ab6df99b948c17eb1cb235f"
@@ -42,7 +43,7 @@
     rm -rf ${D}/${datadir}/applications
 }
 
-PACKAGES += "uim-xim uim-utils uim-skk uim-gtk2.0 uim-gtk3 uim-fep uim-common uim-anthy libuim0 libuim-dev"
+PACKAGES =+ "uim-xim uim-utils uim-skk uim-gtk2.0 uim-gtk3 uim-fep uim-anthy uim-common libuim0 libuim-dev"
 
 FILES_${PN} = "${bindir}/uim-help \
     ${libdir}/uim/plugin/libuim-* \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/upower/upower_0.99.4.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/upower/upower_0.99.4.bb
index 44a04de..3651e18 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/upower/upower_0.99.4.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/upower/upower_0.99.4.bb
@@ -10,7 +10,7 @@
 
 inherit autotools pkgconfig gettext gobject-introspection systemd
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[idevice] = "--with-idevice,--without-idevice,libimobiledevice libplist"
 PACKAGECONFIG[systemd] = "--with-systemdutildir=${systemd_unitdir} --with-systemdsystemunitdir=${systemd_system_unitdir}, \
                           --without-systemdutildir --without-systemdsystemunitdir,systemd"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20140529.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20140529.bb
deleted file mode 100644
index a265411..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20140529.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-SUMMARY = "Data files for usbmodeswitch"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-inherit allarch
-
-SRC_URI = "http://www.draisberghof.de/usb_modeswitch/${BP}.tar.bz2"
-SRC_URI[md5sum] = "dff94177781298aaf0b3c2a3c3dea6b2"
-SRC_URI[sha256sum] = "53889157937109e04dafe897c098ec94f3f44f9c0c83fc6ec8417aa9a587e536"
-
-do_install() {
-    oe_runmake install DESTDIR=${D}
-}
-
-RDEPENDS_${PN} = "usb-modeswitch (>= 2.2.0)"
-FILES_${PN} += "${base_libdir}/udev/rules.d/ \
-                ${datadir}/usb_modeswitch"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20170205.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20170205.bb
new file mode 100644
index 0000000..eeed5e2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch-data_20170205.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Data files for usbmodeswitch"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+inherit allarch
+
+DEPENDS += "tcl-native"
+
+SRC_URI = "http://www.draisberghof.de/usb_modeswitch/${BP}.tar.bz2"
+SRC_URI[md5sum] = "0cc107cd0c4c83df0d9400c999e21dfd"
+SRC_URI[sha256sum] = "e2dcfd9d28928d8d8f03381571a23442b3c50d48d343bc40a1a07d01662738d1"
+
+do_install() {
+    oe_runmake install DESTDIR=${D}
+}
+
+RDEPENDS_${PN} = "usb-modeswitch (>= 2.4.0)"
+FILES_${PN} += "${base_libdir}/udev/rules.d/ \
+                ${datadir}/usb_modeswitch"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.2.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.2.0.bb
deleted file mode 100644
index 425f66b..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.2.0.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-SUMMARY = "A mode switching tool for controlling 'flip flop' (multiple device) USB gear"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-DEPENDS = "libusb1"
-
-SRC_URI = "http://www.draisberghof.de/usb_modeswitch/${BP}.tar.bz2"
-SRC_URI[md5sum] = "f323fe700edd6ea404c40934ddf32b22"
-SRC_URI[sha256sum] = "2752103de171ed5f6c8d6a6e3e73e16c9ee3e8e394dd39c5991f7680eb908a3a"
-
-EXTRA_OEMAKE = "TCL=${bindir}/tclsh"
-
-FILES_${PN} = "${bindir} ${sysconfdir} ${nonarch_base_libdir}/udev/usb_modeswitch ${sbindir} ${localstatedir}/lib/usb_modeswitch"
-RDEPENDS_${PN} = "tcl"
-RRECOMMENDS_${PN} = "usb-modeswitch-data"
-
-do_install() {
-    oe_runmake DESTDIR=${D} install
-}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.5.0.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.5.0.bb
new file mode 100644
index 0000000..ff439f3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/usb-modeswitch/usb-modeswitch_2.5.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "A mode switching tool for controlling 'flip flop' (multiple device) USB gear"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "libusb1"
+
+SRC_URI = "http://www.draisberghof.de/usb_modeswitch/${BP}.tar.bz2"
+SRC_URI[md5sum] = "38ad5c9d70e06227a00361bdc2b1e568"
+SRC_URI[sha256sum] = "31c0be280d49a99ec3dc0be3325bef320d9c04b50714ef0ce1e36a614d687633"
+
+inherit pkgconfig
+
+EXTRA_OEMAKE = "TCL=${bindir}/tclsh"
+
+FILES_${PN} = "${bindir} ${sysconfdir} ${nonarch_base_libdir}/udev/usb_modeswitch ${sbindir} ${localstatedir}/lib/usb_modeswitch"
+RDEPENDS_${PN} = "tcl"
+RRECOMMENDS_${PN} = "usb-modeswitch-data"
+
+do_install() {
+    oe_runmake DESTDIR=${D} install
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/files/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/files/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch
new file mode 100644
index 0000000..f3c8eeb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/files/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch
@@ -0,0 +1,29 @@
+From 08b17ec505e09e8f5a4d73ffc3aa61561ec2e0da Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 30 Mar 2017 00:27:54 -0700
+Subject: [PATCH] include sys/stat.h for fixing build issue on musl
+
+error: field has incomplete
+      type 'struct stat'
+        struct stat fs;
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tools/utouch-frame-test-mtdev.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tools/utouch-frame-test-mtdev.c b/tools/utouch-frame-test-mtdev.c
+index 5253320..2032af4 100644
+--- a/tools/utouch-frame-test-mtdev.c
++++ b/tools/utouch-frame-test-mtdev.c
+@@ -30,6 +30,7 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <sys/stat.h>
+ #include "common-defs.h"
+ 
+ struct frame_test {
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/utouch-frame_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/utouch-frame_git.bb
index 6ec566d..39d46af 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/utouch-frame_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/utouch/utouch-frame_git.bb
@@ -10,7 +10,9 @@
 inherit autotools pkgconfig
 
 SRC_URI = "git://bitmath.org/git/frame.git;protocol=http \
-           file://remove-man-page-creation.patch"
+           file://remove-man-page-creation.patch \
+           file://0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch \
+           "
 SRCREV = "95363d5a1f7394d71144bf3b408ef4e6db4350fc"
 
 PV = "1.1.2+git${SRCPV}"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vala-terminal/vala-terminal_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vala-terminal/vala-terminal_git.bb
index ef0cfaf..1219cb8 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vala-terminal/vala-terminal_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vala-terminal/vala-terminal_git.bb
@@ -8,7 +8,7 @@
 PE = "1"
 PR = "r1"
 
-PNBLACKLIST[vala-terminal] ?= "BROKEN: Doesn't work with B!=S, touch: cannot touch `src/.stamp': No such file or directory"
+PNBLACKLIST[vala-terminal] ?= "BROKEN: Doesn't work with B!=S, touch: cannot touch `src/.stamp': No such file or directory - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 inherit autotools perlnative vala
 
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_4.3.36.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_4.3.36.bb
index f8a24a5..c7bae1c 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_4.3.36.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_4.3.36.bb
@@ -41,6 +41,10 @@
 # compile and install mount utility
 do_compile_append() {
     oe_runmake 'LD=${CC}' 'LDFLAGS=${LDFLAGS}' -C ${S}/utils
+    if ! [ -e vboxguest.ko -a -e vboxsf.ko -a -e vboxvideo.ko ] ; then
+        echo "ERROR: One of vbox*.ko modules wasn't built"
+        exit 1
+    fi
 }
 
 module_do_install() {
@@ -65,4 +69,4 @@
 KERNEL_MODULE_AUTOLOAD += "vboxguest vboxsf vboxvideo"
 
 # http://errors.yoctoproject.org/Errors/Details/83333/
-PNBLACKLIST[vboxguestdrivers] ?= "BROKEN: not compatible with default kernel version 4.8"
+PNBLACKLIST[vboxguestdrivers] ?= "BROKEN: not compatible with default kernel version 4.8 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.18.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.18.bb
new file mode 100644
index 0000000..4085b9f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.18.bb
@@ -0,0 +1,69 @@
+SUMMARY = "VirtualBox Linux Guest Drivers"
+SECTION = "core"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/${VBOX_NAME}/COPYING;md5=e197d5641bb35b29d46ca8c4bf7f2660"
+
+DEPENDS = "virtual/kernel"
+
+inherit module kernel-module-split
+
+COMPATIBLE_MACHINE = "(qemux86|qemux86-64)"
+
+VBOX_NAME = "VirtualBox-${PV}"
+
+SRC_URI = "http://download.virtualbox.org/virtualbox/${PV}/${VBOX_NAME}.tar.bz2 \
+           file://Makefile.utils \
+"
+SRC_URI[md5sum] = "1a7db64cd69ba6d39574fb333e031251"
+SRC_URI[sha256sum] = "7ed0959bbbd02826b86b3d5dc8348931ddfab267c31f8ed36ee53c12f5522cd9"
+
+S = "${WORKDIR}/vbox_module"
+
+export BUILD_TARGET_ARCH="${ARCH}"
+export BUILD_TARGET_ARCH_x86-64="amd64"
+export KERN_DIR="${STAGING_KERNEL_DIR}"
+
+addtask export_sources before do_patch after do_unpack
+
+do_export_sources() {
+    mkdir -p "${S}"
+    ${WORKDIR}/${VBOX_NAME}/src/VBox/Additions/linux/export_modules ${T}/vbox_modules.tar.gz
+    tar -C "${S}" -xzf ${T}/vbox_modules.tar.gz
+
+    # add a mount utility to use shared folder from VBox Addition Source Code
+    mkdir -p "${S}/utils"
+    install ${WORKDIR}/${VBOX_NAME}/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c ${S}/utils
+    install ${WORKDIR}/${VBOX_NAME}/src/VBox/Additions/linux/sharedfolders/vbsfmount.c ${S}/utils
+    install ${S}/../Makefile.utils ${S}/utils/Makefile
+
+}
+
+# compile and install mount utility
+do_compile_append() {
+    oe_runmake 'LD=${CC}' 'LDFLAGS=${LDFLAGS}' -C ${S}/utils
+    if ! [ -e vboxguest.ko -a -e vboxsf.ko -a -e vboxvideo.ko ] ; then
+        echo "ERROR: One of vbox*.ko modules wasn't built"
+        exit 1
+    fi
+}
+
+module_do_install() {
+    MODULE_DIR=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel/misc
+    install -d $MODULE_DIR
+    install -m 644 vboxguest.ko $MODULE_DIR
+    install -m 644 vboxsf.ko $MODULE_DIR
+    install -m 644 vboxvideo.ko $MODULE_DIR
+}
+
+do_install_append() {
+    install -d ${D}${base_sbindir}
+    install -m 755 ${S}/utils/mount.vboxsf ${D}${base_sbindir}
+}
+
+PACKAGES += "kernel-module-vboxguest kernel-module-vboxsf kernel-module-vboxvideo"
+RRECOMMENDS_${PN} += "kernel-module-vboxguest kernel-module-vboxsf kernel-module-vboxvideo"
+
+FILES_${PN} = "${base_sbindir}"
+
+# autoload if installed
+KERNEL_MODULE_AUTOLOAD += "vboxguest vboxsf vboxvideo"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.6.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.6.bb
deleted file mode 100644
index 8665267..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_5.1.6.bb
+++ /dev/null
@@ -1,65 +0,0 @@
-SUMMARY = "VirtualBox Linux Guest Drivers"
-SECTION = "core"
-LICENSE = "GPL-2.0"
-LIC_FILES_CHKSUM = "file://${WORKDIR}/${VBOX_NAME}/COPYING;md5=e197d5641bb35b29d46ca8c4bf7f2660"
-
-DEPENDS = "virtual/kernel"
-
-inherit module kernel-module-split
-
-COMPATIBLE_MACHINE = "(qemux86|qemux86-64)"
-
-VBOX_NAME = "VirtualBox-${PV}"
-
-SRC_URI = "http://download.virtualbox.org/virtualbox/${PV}/${VBOX_NAME}.tar.bz2 \
-           file://Makefile.utils \
-"
-SRC_URI[md5sum] = "8c2331a718cfc038963c1214c2ba9811"
-SRC_URI[sha256sum] = "2e0112b0d85841587b8f212e6ba8f6c35b31e1cce6b6999497dc917cd37e6911"
-
-S = "${WORKDIR}/vbox_module"
-
-export BUILD_TARGET_ARCH="${ARCH}"
-export BUILD_TARGET_ARCH_x86-64="amd64"
-export KERN_DIR="${STAGING_KERNEL_DIR}"
-
-addtask export_sources before do_patch after do_unpack
-
-do_export_sources() {
-    mkdir -p "${S}"
-    ${WORKDIR}/${VBOX_NAME}/src/VBox/Additions/linux/export_modules ${T}/vbox_modules.tar.gz
-    tar -C "${S}" -xzf ${T}/vbox_modules.tar.gz
-
-    # add a mount utility to use shared folder from VBox Addition Source Code
-    mkdir -p "${S}/utils"
-    install ${WORKDIR}/${VBOX_NAME}/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c ${S}/utils
-    install ${WORKDIR}/${VBOX_NAME}/src/VBox/Additions/linux/sharedfolders/vbsfmount.c ${S}/utils
-    install ${S}/../Makefile.utils ${S}/utils/Makefile
-
-}
-
-# compile and install mount utility
-do_compile_append() {
-    oe_runmake 'LD=${CC}' 'LDFLAGS=${LDFLAGS}' -C ${S}/utils
-}
-
-module_do_install() {
-    MODULE_DIR=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel/misc
-    install -d $MODULE_DIR
-    install -m 644 vboxguest.ko $MODULE_DIR
-    install -m 644 vboxsf.ko $MODULE_DIR
-    install -m 644 vboxvideo.ko $MODULE_DIR
-}
-
-do_install_append() {
-    install -d ${D}${base_sbindir}
-    install -m 755 ${S}/utils/mount.vboxsf ${D}${base_sbindir}
-}
-
-PACKAGES += "kernel-module-vboxguest kernel-module-vboxsf kernel-module-vboxvideo"
-RRECOMMENDS_${PN} += "kernel-module-vboxguest kernel-module-vboxsf kernel-module-vboxvideo"
-
-FILES_${PN} = "${base_sbindir}"
-
-# autoload if installed
-KERNEL_MODULE_AUTOLOAD += "vboxguest vboxsf vboxvideo"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/disable_acl_header_check.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/disable_acl_header_check.patch
index 8f824e7..65e5f58 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/disable_acl_header_check.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/disable_acl_header_check.patch
@@ -4,10 +4,10 @@
 
 Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
 ================================================
-diff --git a/src/configure.in b/src/configure.in
+diff --git a/src/configure.ac b/src/configure.ac
 index fb965e5..d734064 100644
---- a/src/configure.in
-+++ b/src/configure.in
+--- a/src/configure.ac
++++ b/src/configure.ac
 @@ -2511,7 +2511,7 @@ AC_CHECK_HEADERS(stdarg.h stdint.h stdlib.h string.h \
  	sys/systeminfo.h locale.h sys/stream.h termios.h \
  	libc.h sys/statfs.h poll.h sys/poll.h pwd.h \
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/vim-add-knob-whether-elf.h-are-checked.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/vim-add-knob-whether-elf.h-are-checked.patch
index 693d130..6c620f9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/vim-add-knob-whether-elf.h-are-checked.patch
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/files/vim-add-knob-whether-elf.h-are-checked.patch
@@ -7,13 +7,13 @@
 
 Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
 ---
- src/configure.in |    7 +++++++
+ src/configure.ac |    7 +++++++
  1 file changed, 7 insertions(+)
 
-diff --git a/src/configure.in b/src/configure.in
+diff --git a/src/configure.ac b/src/configure.ac
 index d734064..f504fa6 100644
---- a/src/configure.in
-+++ b/src/configure.in
+--- a/src/configure.ac
++++ b/src/configure.ac
 @@ -2483,11 +2483,18 @@ AC_TRY_COMPILE([#include <stdio.h>], [int x __attribute__((unused));],
  	AC_MSG_RESULT(no))
  
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim-tiny_8.0.0022.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim-tiny_8.0.0427.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim-tiny_8.0.0022.bb
rename to import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim-tiny_8.0.0427.bb
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0022.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0022.bb
deleted file mode 100644
index 112ae80..0000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0022.bb
+++ /dev/null
@@ -1,111 +0,0 @@
-SUMMARY = "Vi IMproved - enhanced vi editor"
-SECTION = "console/utils"
-DEPENDS = "ncurses gettext-native"
-# vimdiff doesn't like busybox diff
-RSUGGESTS_${PN} = "diffutils"
-LICENSE = "vim"
-LIC_FILES_CHKSUM = "file://../runtime/doc/uganda.txt;md5=eea32ac1424bba14096736a494ae9045"
-
-SRC_URI = "git://github.com/vim/vim.git \
-           file://disable_acl_header_check.patch;patchdir=.. \
-           file://vim-add-knob-whether-elf.h-are-checked.patch;patchdir=.. \
-"
-SRCREV = "ec68a99464055029c01082762517e97245ddae0c"
-
-S = "${WORKDIR}/git/src"
-
-VIMDIR = "vim${@d.getVar('PV',1).split('.')[0]}${@d.getVar('PV',1).split('.')[1]}"
-
-inherit autotools update-alternatives
-inherit autotools-brokensep
-
-# vim configure.in contains functions which got 'dropped' by autotools.bbclass
-do_configure () {
-    rm -f auto/*
-    touch auto/config.mk
-    aclocal
-    autoconf
-    oe_runconf
-    touch auto/configure
-    touch auto/config.mk auto/config.h
-}
-
-#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny
-PACKAGECONFIG ??= ""
-PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
-PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
-
-PACKAGECONFIG[gtkgui] = "--enable-gtk2-test --enable-gui=gtk2,--enable-gui=no,gtk+,"
-PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
-PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
-PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
-PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
-PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
-
-EXTRA_OECONF = " \
-    --disable-gpm \
-    --disable-gtktest \
-    --disable-xim \
-    --disable-netbeans \
-    --with-tlib=ncurses \
-    ac_cv_small_wchar_t=no \
-    vim_cv_getcwd_broken=no \
-    vim_cv_memmove_handles_overlap=yes \
-    vim_cv_stat_ignores_slash=no \
-    vim_cv_terminfo=yes \
-    vim_cv_tgent=non-zero \
-    vim_cv_toupper_broken=no \
-    vim_cv_tty_group=world \
-    STRIP=/bin/true \
-"
-
-do_install() {
-    autotools_do_install
-
-    # Work around file-rdeps picking up csh, awk, perl or python as a dep
-    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132
-    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk
-    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl
-    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py
-
-    # Install example vimrc from runtime files
-    install -m 0644 ../runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc
-
-    # we use --with-features=big as default
-    mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN}
-}
-
-PARALLEL_MAKEINST = ""
-
-PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools"
-FILES_${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax"
-FILES_${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc"
-FILES_${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor"
-FILES_${PN}-vimrc = "${datadir}/${BPN}/vimrc"
-FILES_${PN}-data = "${datadir}/${BPN}"
-FILES_${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools"
-FILES_${PN}-common = " \
-    ${datadir}/${BPN}/${VIMDIR}/*.vim \
-    ${datadir}/${BPN}/${VIMDIR}/autoload \
-    ${datadir}/${BPN}/${VIMDIR}/colors \
-    ${datadir}/${BPN}/${VIMDIR}/compiler \
-    ${datadir}/${BPN}/${VIMDIR}/ftplugin \
-    ${datadir}/${BPN}/${VIMDIR}/indent \
-    ${datadir}/${BPN}/${VIMDIR}/keymap \
-    ${datadir}/${BPN}/${VIMDIR}/lang \
-    ${datadir}/${BPN}/${VIMDIR}/macros \
-    ${datadir}/${BPN}/${VIMDIR}/plugin \
-    ${datadir}/${BPN}/${VIMDIR}/print \
-    ${datadir}/${BPN}/${VIMDIR}/spell \
-    ${datadir}/icons \
-"
-
-RDEPENDS_${PN} = "ncurses-terminfo-base"
-# Recommend that runtime data is installed along with vim
-RRECOMMENDS_${PN} = "${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-common"
-
-ALTERNATIVE_${PN} = "vi vim"
-ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}"
-ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi"
-ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim"
-ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0427.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0427.bb
new file mode 100644
index 0000000..1f86fcd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/vim/vim_8.0.0427.bb
@@ -0,0 +1,112 @@
+SUMMARY = "Vi IMproved - enhanced vi editor"
+SECTION = "console/utils"
+DEPENDS = "ncurses gettext-native"
+# vimdiff doesn't like busybox diff
+RSUGGESTS_${PN} = "diffutils"
+LICENSE = "vim"
+LIC_FILES_CHKSUM = "file://../runtime/doc/uganda.txt;md5=eea32ac1424bba14096736a494ae9045"
+
+SRC_URI = "git://github.com/vim/vim.git \
+           file://disable_acl_header_check.patch;patchdir=.. \
+           file://vim-add-knob-whether-elf.h-are-checked.patch;patchdir=.. \
+"
+SRCREV = "ad4187e6fc9c8e1083a172852d958a70a689a75c"
+
+S = "${WORKDIR}/git/src"
+
+VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}"
+
+inherit autotools update-alternatives
+inherit autotools-brokensep
+
+# vim configure.in contains functions which got 'dropped' by autotools.bbclass
+do_configure () {
+    rm -f auto/*
+    touch auto/config.mk
+    aclocal
+    autoconf
+    oe_runconf
+    touch auto/configure
+    touch auto/config.mk auto/config.h
+}
+
+#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny
+PACKAGECONFIG ??= ""
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}"
+
+PACKAGECONFIG[gtkgui] = "--enable-gtk2-test --enable-gui=gtk2,--enable-gui=no,gtk+,"
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
+PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
+PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
+PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
+
+EXTRA_OECONF = " \
+    --disable-gpm \
+    --disable-gtktest \
+    --disable-xim \
+    --disable-netbeans \
+    --with-tlib=ncurses \
+    ac_cv_small_wchar_t=no \
+    vim_cv_getcwd_broken=no \
+    vim_cv_memmove_handles_overlap=yes \
+    vim_cv_stat_ignores_slash=no \
+    vim_cv_terminfo=yes \
+    vim_cv_tgent=non-zero \
+    vim_cv_toupper_broken=no \
+    vim_cv_tty_group=world \
+    STRIP=/bin/true \
+"
+
+do_install() {
+    autotools_do_install
+
+    # Work around file-rdeps picking up csh, awk, perl or python as a dep
+    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132
+    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk
+    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl
+    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py
+
+    # Install example vimrc from runtime files
+    install -m 0644 ../runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc
+
+    # we use --with-features=big as default
+    mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN}
+}
+
+PARALLEL_MAKEINST = ""
+
+PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools"
+FILES_${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax"
+FILES_${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc"
+FILES_${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor"
+FILES_${PN}-vimrc = "${datadir}/${BPN}/vimrc"
+FILES_${PN}-data = "${datadir}/${BPN}"
+FILES_${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools"
+FILES_${PN}-common = " \
+    ${datadir}/${BPN}/${VIMDIR}/*.vim \
+    ${datadir}/${BPN}/${VIMDIR}/autoload \
+    ${datadir}/${BPN}/${VIMDIR}/colors \
+    ${datadir}/${BPN}/${VIMDIR}/compiler \
+    ${datadir}/${BPN}/${VIMDIR}/ftplugin \
+    ${datadir}/${BPN}/${VIMDIR}/indent \
+    ${datadir}/${BPN}/${VIMDIR}/keymap \
+    ${datadir}/${BPN}/${VIMDIR}/lang \
+    ${datadir}/${BPN}/${VIMDIR}/macros \
+    ${datadir}/${BPN}/${VIMDIR}/plugin \
+    ${datadir}/${BPN}/${VIMDIR}/print \
+    ${datadir}/${BPN}/${VIMDIR}/spell \
+    ${datadir}/icons \
+"
+
+RDEPENDS_${BPN} = "ncurses-terminfo-base"
+# Recommend that runtime data is installed along with vim
+RRECOMMENDS_${BPN} = "${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-common"
+
+ALTERNATIVE_${PN} = "vi vim"
+ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}"
+ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi"
+ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0001-makefile-Pass-CFLAGS-to-compile.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0001-makefile-Pass-CFLAGS-to-compile.patch
new file mode 100644
index 0000000..90eff5b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0001-makefile-Pass-CFLAGS-to-compile.patch
@@ -0,0 +1,26 @@
+From 0378cbb323c662a565f7f3de2dee3d8a646e7bd1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 09:32:42 -0700
+Subject: [PATCH 1/2] makefile: Pass CFLAGS to compile
+
+Set CC if not already set
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ host/tools/wmiconfig/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/host/tools/wmiconfig/Makefile b/host/tools/wmiconfig/Makefile
+index c6738c5..3253a7e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,4 +1,4 @@
+-CC :=$(ATH_CROSS_COMPILE_TYPE)gcc
++CC ?= $(ATH_CROSS_COMPILE_TYPE)gcc
+ 
+ all:
+-	$(CC) -Wall -DUSER_KEYS -g $(LDFLAGS) -I../../include -I../../../include -I../../wlan/include -I../../os/linux/include wmiconfig.c -o wmiconfig
++	$(CC) -Wall -DUSER_KEYS -g $(CFLAGS) $(LDFLAGS) -I../../include -I../../../include -I../../wlan/include -I../../os/linux/include wmiconfig.c -o wmiconfig
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0002-fix-err-API-to-have-format-string.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0002-fix-err-API-to-have-format-string.patch
new file mode 100644
index 0000000..f67f784
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig/0002-fix-err-API-to-have-format-string.patch
@@ -0,0 +1,656 @@
+From 909ebdde4ee2233d65de8fa01fde8e9a3bec12b7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 09:33:26 -0700
+Subject: [PATCH 2/2] fix err() API to have format string
+
+Fixes errors with hardening flags
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ host/tools/wmiconfig/wmiconfig.c | 148 +++++++++++++++++++--------------------
+ 1 file changed, 74 insertions(+), 74 deletions(-)
+
+diff --git a/host/tools/wmiconfig/wmiconfig.c b/host/tools/wmiconfig/wmiconfig.c
+index 21c9dcd..a6ec481 100644
+--- a/wmiconfig.c
++++ b/wmiconfig.c
+@@ -483,7 +483,7 @@ main (int argc, char **argv)
+     strcpy(ifname, ethIf);
+     s = socket(AF_INET, SOCK_DGRAM, 0);
+     if (s < 0) {
+-        err(1, "socket");
++        err(1, "%s", "socket");
+     }
+ 
+     while (1) {
+@@ -1506,28 +1506,28 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)filterCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SETBSSFILTER, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_POWER_MODE:
+         ifr.ifr_data = (void *)pwrCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SETPWR, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_PM_PARAMS:
+         ifr.ifr_data = (void *)pmParamCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_PMPARAMS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_IBSS_PM_CAPS:
+         ifr.ifr_data = (void *)adhocPmCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_IBSS_PM_CAPS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_ERROR_DETECTION:
+@@ -1535,7 +1535,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_HB_CHALLENGE_RESP:
+@@ -1543,7 +1543,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+ #ifdef USER_KEYS
+@@ -1554,7 +1554,7 @@ main (int argc, char **argv)
+ 
+             if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+             {
+-                err(1, ifr.ifr_name);
++                err(1, "%s", ifr.ifr_name);
+             }
+ 
+             break;
+@@ -1575,7 +1575,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)sParamCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SETSCAN, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_VERSION:
+@@ -1586,7 +1586,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)revinfo;
+         if (ioctl(s, AR6000_IOCTL_WMI_GETREV, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         printf("Host Rev = 0x%x(%u.%u.%u.%u), Target Rev = 0x%x(%u.%u.%u.%u)\n",
+               revinfo->host_ver,
+@@ -1606,14 +1606,14 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)listenCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SETLISTENINT, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BMISS_TIME:
+         ifr.ifr_data = (void *)bmissCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_BMISS_TIME, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_RSSI_THRESHOLDS:
+@@ -1621,14 +1621,14 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_SNR_THRESHOLDS:
+         ifr.ifr_data = (void *)snrThresholdParam;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_SNRTHRESHOLD, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_CLR_RSSISNR:
+@@ -1636,7 +1636,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_LQ_THRESHOLDS:
+@@ -1644,7 +1644,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_CHANNEL:
+@@ -1693,18 +1693,18 @@ main (int argc, char **argv)
+  
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_CHANNELPARAMS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_SSID:
+         if (index > MAX_PROBED_SSID_INDEX) {
+             printf("num option for ssid command too large\n");
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+             break;
+         }
+         if (strlen((char *)ssid) > sizeof (ssidCmd->ssid)) {
+             printf("ssid name too large\n");
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+             break;
+         }
+         ssidCmd->entryIndex = index;
+@@ -1722,7 +1722,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)ssidCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_PROBEDSSID, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BADAP:
+@@ -1735,7 +1735,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)badApCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_BADAP, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_CREATE_QOS:
+@@ -1794,7 +1794,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)crePStreamCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_CREATE_QOS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_TARGET_STATS:
+@@ -1807,7 +1807,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)&tgtStatsCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_GET_TARGET_STATS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         printTargetStats(&(tgtStatsCmd.targetStats));
+         break;
+@@ -1815,7 +1815,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)pBitMask;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_ERROR_REPORT_BITMASK, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_DELETE_QOS:
+@@ -1824,7 +1824,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)delPStreamCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_DELETE_QOS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_QOS_QUEUE:
+@@ -1840,7 +1840,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)getQosQueueCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_GET_QOS_QUEUE, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+ 
+         printf("Active TSIDs \n");
+@@ -1855,7 +1855,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)ieInfo;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_ASSOC_INFO, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_AC_PARAMS:
+@@ -1871,14 +1871,14 @@ main (int argc, char **argv)
+         ifr.ifr_data = (void *)acParamsCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_ACCESS_PARAMS, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_DISC_TIMEOUT:
+         ifr.ifr_data = (void *)discCmd;
+         if (ioctl(s, AR6000_IOCTL_WMI_SET_DISC_TIMEOUT, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+      case WMI_SET_ADHOC_BSSID:
+@@ -1887,7 +1887,7 @@ main (int argc, char **argv)
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+             printf("fail to set adhoc bssid \n");
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_OPT_MODE:
+@@ -1895,7 +1895,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_OPT_SEND_FRAME:
+@@ -1903,7 +1903,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BEACON_INT:
+@@ -1911,7 +1911,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_VOICE_PKT_SIZE:
+@@ -1919,7 +1919,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_MAX_SP:
+@@ -1927,7 +1927,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_ROAM_TBL:
+@@ -1935,7 +1935,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_ROAM_CTRL:
+@@ -1943,7 +1943,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_POWERSAVE_TIMERS:
+@@ -1951,7 +1951,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_POWER_MODE:
+@@ -1959,7 +1959,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         printf("Power mode is %s\n",
+                (getPowerMode->powerMode == MAX_PERF_POWER) ? "maxperf" : "rec");
+@@ -1969,7 +1969,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_ROAM_DATA:
+@@ -1977,7 +1977,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BT_STATUS:
+@@ -1985,7 +1985,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BT_PARAMS:
+@@ -1993,7 +1993,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;   
+     case WMI_SET_RETRYLIMITS:
+@@ -2001,14 +2001,14 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_START_SCAN:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_STARTSCAN;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_FIX_RATES:
+@@ -2031,14 +2031,14 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_FIX_RATES:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_GETFIXRATES;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         } else {
+             int i;
+             printf("Fix rate set index:");
+@@ -2057,7 +2057,7 @@ main (int argc, char **argv)
+         index--;
+         setAuthMode->mode = atoi(argv[index]);
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_REASSOC_MODE:
+@@ -2067,42 +2067,42 @@ main (int argc, char **argv)
+         index--;
+         setReassocMode->mode = atoi(argv[index]);
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_LPREAMBLE:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_LPREAMBLE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_RTS:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_RTS;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_WMM:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_WMM;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_TXOP:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_TXOP;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case DIAG_READ:
+         ((int *)buf)[0] = AR6000_XIOCTL_DIAG_READ;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         printf("diagdata: 0x%x\n", *diagdata);
+         break;
+@@ -2110,7 +2110,7 @@ main (int argc, char **argv)
+         ((int *)buf)[0] = AR6000_XIOCTL_DIAG_WRITE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_RD:
+@@ -2118,7 +2118,7 @@ main (int argc, char **argv)
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0)
+         {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         else
+         {
+@@ -2139,14 +2139,14 @@ main (int argc, char **argv)
+         index--;
+         setKeepAlive->keepaliveInterval = atoi(argv[index]);
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_KEEPALIVE:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_GET_KEEPALIVE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         printf("Keepalive interval is %d secs and AP is %s\n",
+                getKeepAlive->keepaliveInterval, (getKeepAlive->configured ?
+@@ -2156,63 +2156,63 @@ main (int argc, char **argv)
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_APPIE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_MGMT_FRM_RX_FILTER:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_DBGLOG_CFG_MODULE:
+         ((int *)buf)[0] = AR6000_XIOCTL_DBGLOG_CFG_MODULE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_DBGLOG_GET_DEBUG_LOGS:
+         ((int *)buf)[0] = AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_HOST_SLEEP_MODE:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_WOW_MODE:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_WOW_MODE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_ADD_WOW_PATTERN:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_ADD_WOW_PATTERN;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_DEL_WOW_PATTERN:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_DEL_WOW_PATTERN;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_GET_WOW_LIST:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_GET_WOW_LIST;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case DIAG_DUMP_CHIP_MEM:
+@@ -2225,7 +2225,7 @@ main (int argc, char **argv)
+                 ((int *)buf)[0] = AR6000_XIOCTL_DIAG_READ;
+                 ifr.ifr_data = buf;
+                 if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-                    err(1, ifr.ifr_name);
++                    err(1, "%s", ifr.ifr_name);
+                 }
+                 printf("0x%04x:0x%04x\n", *diagaddr, *diagdata);
+             }
+@@ -2237,21 +2237,21 @@ main (int argc, char **argv)
+         index = optind - 1;
+         *connectCtrlFlags = strtoul(argv[index], NULL, 0);
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case DUMP_HTC_CREDITS:        
+         ((int *)buf)[0] = AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_AKMP_INFO:
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_AKMP_PARAMS;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_PMKID_LIST:
+@@ -2259,7 +2259,7 @@ main (int argc, char **argv)
+             ((int *)buf)[0] = AR6000_XIOCTL_WMI_SET_PMKID_LIST;
+             ifr.ifr_data = buf;
+             if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-                err(1, ifr.ifr_name);
++                err(1, "%s", ifr.ifr_name);
+             }
+         } else {
+             printf("No PMKIDs entered\n");
+@@ -2269,7 +2269,7 @@ main (int argc, char **argv)
+         ((int *)buf)[0] = AR6000_XIOCTL_WMI_GET_PMKID_LIST;
+         ifr.ifr_data = buf;
+         if (ioctl(s, AR6000_IOCTL_EXTENDED, &ifr) < 0) {
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     case WMI_SET_BSS_PMKID_INFO:
+@@ -2277,7 +2277,7 @@ main (int argc, char **argv)
+         iwr.u.data.length = sizeof(*pi_cmd);
+         if (ioctl(s, IEEE80211_IOCTL_ADDPMKID, &iwr) < 0) {
+             printf("ADDPMKID IOCTL Error\n");
+-            err(1, ifr.ifr_name);
++            err(1, "%s", ifr.ifr_name);
+         }
+         break;
+     default:
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig_svn.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig_svn.bb
index 596a4e6..c66572b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig_svn.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/wmiconfig/wmiconfig_svn.bb
@@ -6,7 +6,10 @@
 PV = "0.0.0+svnr${SRCPV}"
 PR = "r2"
 
-SRC_URI = "svn://svn.openmoko.org/trunk/src/target;module=AR6kSDK.build_sw.18;protocol=http"
+SRC_URI = "svn://svn.openmoko.org/trunk/src/target;module=AR6kSDK.build_sw.18;protocol=http \
+           file://0001-makefile-Pass-CFLAGS-to-compile.patch \
+           file://0002-fix-err-API-to-have-format-string.patch \
+           "
 S = "${WORKDIR}/AR6kSDK.build_sw.18/host/tools/wmiconfig"
 
 CLEANBROKEN = "1"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/xchat/xchat_2.8.8.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/xchat/xchat_2.8.8.bb
index 6da11cd..408c700 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/xchat/xchat_2.8.8.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/xchat/xchat_2.8.8.bb
@@ -35,3 +35,5 @@
 
 SRC_URI[md5sum] = "6775c44f38e84d06c06c336b32c4a452"
 SRC_URI[sha256sum] = "0d6d69437b5e1e45f3e66270fe369344943de8a1190e498fafa5296315a27db0"
+
+PNBLACKLIST[xchat] ?= "Depends on blacklisted libsexy - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/files/0001-explicitly-disable-man-generation-disable-documentat.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/files/0001-explicitly-disable-man-generation-disable-documentat.patch
new file mode 100644
index 0000000..b2b0e49
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/files/0001-explicitly-disable-man-generation-disable-documentat.patch
@@ -0,0 +1,31 @@
+From 41093d9634bfeddcaec866745d8d4022f4c6f8c1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Sun, 19 Feb 2017 21:01:39 +0100
+Subject: [PATCH] explicitly disable man generation --disable-documentation is
+ not enough
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index c01c54f..dcdf7a2 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,6 +1,6 @@
+ NULL =
+ 
+-SUBDIRS=po man
++SUBDIRS=po
+ 
+ INCLUDES =					\
+ 	-I$(top_srcdir)				\
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/xdg-user-dirs_0.15.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/xdg-user-dirs_0.15.bb
index b94e0cc..c056759 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/xdg-user-dirs_0.15.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/xdg-user-dirs/xdg-user-dirs_0.15.bb
@@ -4,6 +4,7 @@
 
 SRC_URI = " \
     http://user-dirs.freedesktop.org/releases/${BPN}-${PV}.tar.gz \
+    file://0001-explicitly-disable-man-generation-disable-documentat.patch \
     file://xdg-user-dirs.desktop \
 "
 SRC_URI[md5sum] = "f5aaf5686ad7d8809a664bfb4566a54d"
@@ -11,6 +12,8 @@
 
 inherit autotools gettext
 
+EXTRA_OECONF = "--disable-documentation"
+
 do_install_append () {
     install -d ${D}${sysconfdir}/xdg/autostart
     install -m 644 ${WORKDIR}/xdg-user-dirs.desktop ${D}${sysconfdir}/xdg/autostart
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-make-relies-GNU-extentions.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-make-relies-GNU-extentions.patch
new file mode 100644
index 0000000..04239ba
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-make-relies-GNU-extentions.patch
@@ -0,0 +1,32 @@
+From 224507bc4b6e58f7a6e445bfebfb59d6b8d78bd6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Dec 2016 17:38:51 -0800
+Subject: [PATCH] make relies GNU extentions
+
+We get errors like
+`%'-style pattern rules are a GNU make extension
+
+Disable this warning, since we use gmake with OE
+anyway
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 56d3dd0..9f85fd7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,7 +3,7 @@ AC_PREREQ([2.61])
+ AC_INIT([zbar], [0.10], [spadix@users.sourceforge.net])
+ AC_CONFIG_AUX_DIR(config)
+ AC_CONFIG_MACRO_DIR(config)
+-AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects std-options dist-bzip2])
++AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-portability foreign subdir-objects std-options dist-bzip2])
+ AC_CONFIG_HEADERS([include/config.h])
+ AC_CONFIG_SRCDIR(zbar/scanner.c)
+ LT_PREREQ([2.2])
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-undefine-__va_arg_pack.patch b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-undefine-__va_arg_pack.patch
new file mode 100644
index 0000000..f7d8ba1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar/0001-undefine-__va_arg_pack.patch
@@ -0,0 +1,51 @@
+From f842872244219d9881fbec77054702412b1e16f8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Dec 2016 16:41:27 -0800
+Subject: [PATCH] undefine __va_arg_pack
+
+dprintf() is also a libc function. This fixes
+the compile errors
+
+/usr/include/bits/stdio2.h:140:1: error: expected identifier or '(' before '{' token
+|  {
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ zbar/debug.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/zbar/debug.h b/zbar/debug.h
+index 482ca8d..68948f6 100644
+--- a/zbar/debug.h
++++ b/zbar/debug.h
+@@ -23,6 +23,7 @@
+ 
+ /* varargs variations on compile time debug spew */
+ 
++#undef __va_arg_pack
+ #ifndef DEBUG_LEVEL
+ 
+ # ifdef __GNUC__
+@@ -36,15 +37,14 @@
+ #else
+ 
+ # include <stdio.h>
+-
+ # ifdef __GNUC__
+-#  define dprintf(level, args...) \
++#  define dprintf(level, format, args...) \
+     if((level) <= DEBUG_LEVEL)    \
+-        fprintf(stderr, args)
++        fprintf(stderr, format, args)
+ # else
+-#  define dprintf(level, ...)     \
++#  define dprintf(level, format, ...)     \
+     if((level) <= DEBUG_LEVEL)    \
+-        fprintf(stderr, __VA_ARGS__)
++        fprintf(stderr, format, __VA_ARGS__)
+ # endif
+ 
+ #endif /* DEBUG_LEVEL */
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar_0.10.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar_0.10.bb
new file mode 100644
index 0000000..6b6e501
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/zbar/zbar_0.10.bb
@@ -0,0 +1,28 @@
+DESRIPTION = "2D barcode scanner toolkit."
+SECTION = "graphics"
+LICENSE = "LGPL-2.1"
+
+DEPENDS = "pkgconfig intltool-native libpng jpeg"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=42bafded1b380c6fefbeb6c5cd5448d9"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${PN}/${P}.tar.bz2 \
+           file://0001-undefine-__va_arg_pack.patch \
+           file://0001-make-relies-GNU-extentions.patch \
+"
+
+SRC_URI[md5sum] = "0fd61eb590ac1bab62a77913c8b086a5"
+SRC_URI[sha256sum] = "234efb39dbbe5cef4189cc76f37afbe3cfcfb45ae52493bfe8e191318bdbadc6"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+
+PACKAGECONFIG[x11] = "--with-x,-without-x,libxcb libx11 libsm libxau libxext libxv libice libxdmcp"
+
+EXTRA_OECONF = " --without-imagemagick --without-qt --without-python --disable-video --without-gtk"
+
+do_install_append() {
+    #remove usr/bin if empty
+    rmdir ${D}${bindir}
+}
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/zile/zile_2.4.11.bb b/import-layers/meta-openembedded/meta-oe/recipes-support/zile/zile_2.4.11.bb
index 49fbaea..d663f44b 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/zile/zile_2.4.11.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/zile/zile_2.4.11.bb
@@ -20,6 +20,6 @@
 }
 
 PACKAGECONFIG ??= ""
-PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)}"
 
 PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-ignore-constant-logical-operand-warning-with-clang.patch b/import-layers/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-ignore-constant-logical-operand-warning-with-clang.patch
new file mode 100644
index 0000000..a3cc1ff
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-oe/recipes-test/fwts/fwts/0001-ignore-constant-logical-operand-warning-with-clang.patch
@@ -0,0 +1,83 @@
+From 953cff93c85d3cfd5cbcac56e14443dc5f6e5fbd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Oct 2016 01:57:16 +0000
+Subject: [PATCH] ignore constant-logical-operand warning with clang
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/dmi/dmicheck/dmicheck.c            | 3 +++
+ src/lib/src/fwts_acpi_tables.c         | 5 +++++
+ src/uefi/uefirtauthvar/uefirtauthvar.c | 5 +++++
+ 3 files changed, 13 insertions(+)
+
+diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
+index ecd98223..7fca4a64 100644
+--- a/src/dmi/dmicheck/dmicheck.c
++++ b/src/dmi/dmicheck/dmicheck.c
+@@ -209,6 +209,8 @@ static const char *uuid_patterns[] = {
+ 	"0A0A0A0A-0A0A-0A0A-0A0A-0A0A0A0A0A0A",
+ 	NULL,
+ };
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
+ 
+ static const fwts_chassis_type_map fwts_dmi_chassis_type[] = {
+ 	{ "Invalid",		FWTS_SMBIOS_CHASSIS_INVALID },
+@@ -245,6 +247,7 @@ static const fwts_chassis_type_map fwts_dmi_chassis_type[] = {
+ 	{ "Convertible",	FWTS_SMBIOS_CHASSIS_CONVERTIBLE },
+ 	{ "Detachable",		FWTS_SMBIOS_CHASSIS_DETACHABLE },
+ };
++#pragma clang diagnostic pop
+ 
+ /* Remapping table from buggy version numbers to correct values */
+ static const fwts_dmi_version dmi_versions[] = {
+diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
+index 30b4060e..d5339bf7 100644
+--- a/src/lib/src/fwts_acpi_tables.c
++++ b/src/lib/src/fwts_acpi_tables.c
+@@ -394,10 +394,14 @@ static int fwts_acpi_handle_fadt(
+ 	/* Determine FACS addr and load it.
+ 	 * Will ignore the missing FACS in the hardware-reduced mode.
+ 	 */
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Waddress-of-packed-member"
++
+ 	result = fwts_acpi_handle_fadt_tables(fw, fadt,
+ 			"FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL",
+ 			&fadt->firmware_control, &fadt->x_firmware_ctrl,
+ 			provenance);
++
+ 	if (result != FWTS_OK) {
+ 		if ((result == FWTS_NULL_POINTER) &&
+ 				fwts_acpi_is_reduced_hardware(fadt)) {
+@@ -416,6 +420,7 @@ static int fwts_acpi_handle_fadt(
+ 		return FWTS_ERROR;
+ 	}
+ 	return FWTS_OK;
++#pragma clang diagnostic pop
+ }
+ 
+ /*
+diff --git a/src/uefi/uefirtauthvar/uefirtauthvar.c b/src/uefi/uefirtauthvar/uefirtauthvar.c
+index cdfd7aa3..001e8cc8 100644
+--- a/src/uefi/uefirtauthvar/uefirtauthvar.c
++++ b/src/uefi/uefirtauthvar/uefirtauthvar.c
+@@ -142,6 +142,9 @@ static int uefirtauthvar_deinit(fwts_framework *fw)
+ 	return FWTS_OK;
+ }
+ 
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wconstant-logical-operand"
++
+ static int check_fw_support(fwts_framework *fw, uint64_t status)
+ {
+ 	if ((status == EFI_INVALID_PARAMETER) &&
+@@ -172,6 +175,8 @@ static int check_fw_support(fwts_framework *fw, uint64_t status)
+ 	return FWTS_OK;
+ }
+ 
++#pragma clang diagnostic pop
++
+ /*
+  * Set the created authenticated variable, AuthVarCreate,
+  * and checking the data size and data.
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-test/fwts/fwts_git.bb b/import-layers/meta-openembedded/meta-oe/recipes-test/fwts/fwts_git.bb
index 197fe20..4c4ae66 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-test/fwts/fwts_git.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-test/fwts/fwts_git.bb
@@ -3,22 +3,29 @@
 HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts"
 
 LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=16;md5=deb8af5388e838d133eaa036f4d1496f"
+LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=16;md5=31da590f3e9f3bd34dcdb9e4db568519"
 
-PV = "14.12.00"
+PV = "17.03.00"
 
-SRCREV = "efc18d16294f492b7f72bba64344b2eed50e6a69"
-SRC_URI = "git://kernel.ubuntu.com/hwe/fwts.git"
+SRCREV = "e3e9d1442b4cc70f5b30199f584cec8e25aeaad4"
+SRC_URI = "git://kernel.ubuntu.com/hwe/fwts.git \
+           file://0001-ignore-constant-logical-operand-warning-with-clang.patch \
+           "
 
 S = "${WORKDIR}/git"
 
-DEPENDS = "libpcre json-c glib-2.0"
+COMPATIBLE_HOST = "(i.86|x86_64|aarch64|powerpc64).*-linux"
 
-inherit autotools-brokensep
+DEPENDS = "libpcre json-c glib-2.0 dtc"
 
-CFLAGS += "-I${STAGING_INCDIR}/json-c -Wno-error=misleading-indentation"
+inherit autotools pkgconfig
+
+CFLAGS += "-I${STAGING_INCDIR}/json-c -Wno-error=unknown-pragmas"
 
 FILES_${PN} += "${libdir}/fwts/lib*${SOLIBS}"
 FILES_${PN}-dev += "${libdir}/fwts/lib*${SOLIBSDEV} ${libdir}/fwts/lib*.la"
 FILES_${PN}-staticdev += "${libdir}/fwts/lib*a"
 FILES_${PN}-dbg += "${libdir}/fwts/.debug"
+
+TOOLCHAIN = "gcc"
+
diff --git a/import-layers/meta-openembedded/meta-perl/README b/import-layers/meta-openembedded/meta-perl/README
index 1f6d9a6..2a9b9ac 100644
--- a/import-layers/meta-openembedded/meta-perl/README
+++ b/import-layers/meta-openembedded/meta-perl/README
@@ -52,7 +52,7 @@
 This layer depends on:
 
   URI: git://git.openembedded.org/openembedded-core
-  branch: morty
+  branch: pyro 
   revision: HEAD
   prio: default
 
@@ -75,12 +75,12 @@
 -----------
 
 Send patches / pull requests to openembedded-devel@lists.openembedded.org with
-'[meta-perl]' in the subject.
+'[meta-perl][pyro]' in the subject.
 
 When sending single patches, please using something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-perl][morty][PATCH'
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-perl][pyro][PATCH'
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
 
 License
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/adduser/adduser_3.115.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/adduser/adduser_3.115.bb
index 81068d6..c211862 100644
--- a/import-layers/meta-openembedded/meta-perl/recipes-perl/adduser/adduser_3.115.bb
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/adduser/adduser_3.115.bb
@@ -22,8 +22,7 @@
     install -m 0755 ${S}/adduser ${D}${sbindir}
     install -m 0755 ${S}/deluser ${D}${sbindir}
 
-    install -d ${D}${libdir}/perl/${PERLVERSION}/Debian
-    install -m 0644 ${S}/AdduserCommon.pm ${D}${libdir}/perl/${PERLVERSION}/Debian
+    install -D -m 0644 ${S}/AdduserCommon.pm ${D}${libdir}/perl/${@get_perl_version(d)}/Debian/AdduserCommon.pm
     sed -i -e "s/VERSION/${PV}/" ${D}${sbindir}/*
 
     install -d ${D}/${sysconfdir}
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libauthen/libauthen-radius-perl/run-ptest b/import-layers/meta-openembedded/meta-perl/recipes-perl/libauthen/libauthen-radius-perl/run-ptest
new file mode 100644
index 0000000..f1c833e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libauthen/libauthen-radius-perl/run-ptest
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+
+# prepare testing config
+CONF_USERS=`readlink -f /etc/raddb/users`
+mv ${CONF_USERS} ${CONF_USERS}_orig
+echo "testing Cleartext-Password := \"testpassword\"" > ${CONF_USERS}
+cat ${CONF_USERS}_orig >> ${CONF_USERS}
+
+# restart radiusd server
+systemctl restart radiusd || /etc/init.d/radiusd restart || {
+        echo "FAIL: Start radiusd service."
+        exit 1
+}
+
+# run teests
+perl test.pl
+
+# restore the config and restart
+mv ${CONF_USERS}_orig ${CONF_USERS}
+systemctl restart radiusd || /etc/init.d/radiusd restart
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch b/import-layers/meta-openembedded/meta-perl/recipes-perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch
new file mode 100644
index 0000000..9798af4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch
@@ -0,0 +1,90 @@
+From 829302792bf0e4935d29efc23ca1f2e9e7ee7dfd Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 7 Jan 2016 03:12:38 -0500
+Subject: [PATCH] test.pl: adjust for ptest
+
+* Don't use interactive inputs, set default test
+  settings instead.
+* Change the test results output to the ptest format
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ test.pl | 31 ++++++++++++++++++-------------
+ 1 file changed, 18 insertions(+), 13 deletions(-)
+
+diff --git a/test.pl b/test.pl
+index cfd1c1e..9b4f10e 100644
+--- a/test.pl
++++ b/test.pl
+@@ -7,11 +7,11 @@
+ # Change 1..1 below to 1..last_test_to_print .
+ # (It may become useful if the test is moved to ./t subdirectory.)
+ 
+-BEGIN {print "1..5\n";}
+-END {print "not ok 1\n" unless $loaded;}
++BEGIN {print "Start testing for libauthen-radius-perl\n";}
++END {print "\nFAIL: test1\n" unless $loaded;}
+ use Authen::Radius;
+ $loaded = 1;
+-print "ok 1\n";
++print "\nPASS: test1\n";
+ 
+ ######################### End of black magic.
+ 
+@@ -19,26 +19,31 @@ print "ok 1\n";
+ # (correspondingly "not ok 13") depending on the success of chunk 13
+ # of the test code):
+ 
++$host = "127.0.0.1";
++$secret = "testing123";
++$user = "testing";
++$pwd = "testpassword";
++
+ print "Make sure this machine is in your Radius clients file!\n";
+-print "Enter hostname[:port] of your Radius server: "; chomp ($host = <STDIN>);
+-print "Enter shared-secret of your Radius server: "; chomp ($secret = <STDIN>);
+-print "Enter a username to be validated: "; chomp ($user = <STDIN>);
+-print "Enter this user's password: "; chomp ($pwd = <STDIN>);
++print "hostname of your Radius server: $host\n";
++print "shared-secret of your Radius server: $secret\n";
++print "The username to be validated: $user\n";
++print "The user's password: $pwd\n";
+ 
+ $t = 2;
+ if ($host ne '') {
+ 	$r = new Authen::Radius(Host => $host, Secret => $secret, Debug => 1);
+-	print defined($r) ? "" : "not ", "ok $t\n"; $t++;
++	print defined($r) ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++;
+ 	#Authen::Radius->load_dictionary;
+-	print $r->check_pwd($user, $pwd) ? "" : "not ", "ok $t\n"; $t++;
++	print $r->check_pwd($user, $pwd) ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++;
+ 	@a = $r->get_attributes;
+-	print $#a != -1 ? "" : "not ", "ok $t\n"; $t++;
++	print $#a != -1 ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++;
+ 	#for $a (@a) {
+ 	#	print "attr: name=$a->{'Name'} value=$a->{'Value'}\n";
+ 	#}
+ } else {
+ 	foreach my $t (2..4) {
+-		print "skipped $t\n";
++		print "\nSKIP test$t\n";
+ 	}
+ }
+ 
+@@ -53,9 +58,9 @@ my $data = "what do ya want for nothing?";
+ my $etalon_digest = hex_to_ascii("750c783e6ab0b503eaa86e310a5db738");
+ my $digest = Authen::Radius::hmac_md5(undef, $data, $key);
+ if ($etalon_digest eq $digest) {
+-	print "ok 5\n";
++	print "\nPASS: test5\n";
+ } else {
+-	print "not ok 5\n";
++	print "\nFAIL: test5\n";
+ }
+ 
+ exit;
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libauthen/libauthen-radius-perl_0.22.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libauthen/libauthen-radius-perl_0.22.bb
new file mode 100644
index 0000000..ea5bb1b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libauthen/libauthen-radius-perl_0.22.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Authen::Radius - provide simple Radius client facilities"
+DESCRIPTION = "The Authen::Radius module provides a simple class that \
+    allows you to send/receive Radius requests/responses to/from a \
+    Radius server. \
+"
+
+HOMEPAGE = "http://search.cpan.org/~manowar/RadiusPerl"
+SECTION = "libs"
+
+LICENSE = "Artistic-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=78ab6ea0cba1f1ec1680ebb149e3bc11"
+
+DEPENDS = "perl"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MA/MANOWAR/RadiusPerl-${PV}.tar.gz \
+           file://test.pl-adjust-for-ptest.patch \
+           file://run-ptest \
+"
+SRC_URI[md5sum] = "d1fe2d6ecf7ea99299e4e3a8f945aad8"
+SRC_URI[sha256sum] = "3b276506986ccaa4949d92b13ce053a0017ad11562a991cc753364923fe81ca7"
+
+S = "${WORKDIR}/Authen-Radius-${PV}"
+
+inherit cpan ptest
+
+do_install_ptest() {
+    install -m 0755 ${S}/test.pl ${D}${PTEST_PATH}
+}
+
+RDEPENDS_${PN} += "\
+    libdata-hexdump-perl \
+    perl-module-digest-md5 \
+    perl-module-data-dumper \
+    perl-module-io-select \
+    perl-module-io-socket \
+"
+RDEPENDS_${PN}-ptest += "${PN} freeradius"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libcgi/libcgi-perl_4.28.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libcgi/libcgi-perl_4.28.bb
deleted file mode 100644
index 20626d2..0000000
--- a/import-layers/meta-openembedded/meta-perl/recipes-perl/libcgi/libcgi-perl_4.28.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-DESCRIPTION = "CGI.pm is a stable, complete and mature solution for processing and preparing \
-HTTP requests and responses. Major features including processing form \
-submissions, file uploads, reading and writing cookies, query string generation \
-and manipulation, and processing and preparing HTTP headers."
-HOMEPAGE = "http://search.cpan.org/~leejo/CGI-4.28/lib/CGI.pod"
-SECTION = "libs"
-LICENSE = "Artistic-2.0 | GPL-2.0"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=2e9769f0a2613a98bc7fce15dee0c533"
-
-SRC_URI = "http://search.cpan.org/CPAN/authors/id/L/LE/LEEJO/CGI-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "28efb391377f6e98c19c23292d5fcc8c"
-SRC_URI[sha256sum] = "1297d3ed6616cacb4eb57860e3e743f3890111e7a63ca08849930f42f1360532"
-
-S = "${WORKDIR}/CGI-${PV}"
-
-inherit cpan
-
-RPROVIDES_${PN} += "perl-module-cgi"
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libcgi/libcgi-perl_4.35.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libcgi/libcgi-perl_4.35.bb
new file mode 100644
index 0000000..4fa3429
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libcgi/libcgi-perl_4.35.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "CGI.pm is a stable, complete and mature solution for processing and preparing \
+HTTP requests and responses. Major features including processing form \
+submissions, file uploads, reading and writing cookies, query string generation \
+and manipulation, and processing and preparing HTTP headers."
+HOMEPAGE = "http://search.cpan.org/~leejo/CGI-4.28/lib/CGI.pod"
+SECTION = "libs"
+LICENSE = "Artistic-2.0 | GPL-2.0"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2e9769f0a2613a98bc7fce15dee0c533"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/L/LE/LEEJO/CGI-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "15e63942c02354426b25f056f2a4467c"
+SRC_URI[sha256sum] = "0b34cdc59f596632b0620939286f6e18e7e81d043b6b57b974a8e07d18b5fc1d"
+
+S = "${WORKDIR}/CGI-${PV}"
+
+inherit cpan
+
+RPROVIDES_${PN} += "perl-module-cgi"
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libdata/files/run-ptest b/import-layers/meta-openembedded/meta-perl/recipes-perl/libdata/files/run-ptest
new file mode 100644
index 0000000..c9f9ca9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libdata/files/run-ptest
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+for case in `find t -type f -name '*.t'`; do
+    perl $case >$case.output 2>&1
+    ret=$?
+    cat $case.output
+    if [ $ret -ne 0 ]; then
+        echo "FAIL: ${case%.t}"
+    elif grep -i 'SKIP' $case.output; then
+        echo "SKIP: ${case%.t}"
+    else
+        echo "PASS: ${case%.t}"
+    fi
+
+    rm -f $case.output
+done
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libdata/libdata-hexdump-perl_0.02.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libdata/libdata-hexdump-perl_0.02.bb
new file mode 100644
index 0000000..6ab5a42
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libdata/libdata-hexdump-perl_0.02.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Data::HexDump - Hexadecial Dumper"
+DESCRIPTION = "Dump in hexadecimal the content of a scalar. The result \
+is returned in a string. Each line of the result consists of the offset \
+in the source in the leftmost column of each line, followed by one or \
+more columns of data from the source in hexadecimal. The rightmost column \
+of each line shows the printable characters \
+(all others are shown as single dots).\
+"
+
+HOMEPAGE = "http://search.cpan.org/~ftassin/Data-HexDump-0.02/lib/Data/HexDump.pm"
+SECTION = "libs"
+
+LICENSE = "Artistic-1.0"
+LIC_FILES_CHKSUM = "file://lib/Data/HexDump.pm;beginline=215;endline=217;md5=bf1cd9373f8d1f85fe091ee069a480e9"
+
+DEPENDS = "perl"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/F/FT/FTASSIN/Data-HexDump-${PV}.tar.gz \
+           file://run-ptest \
+"
+SRC_URI[md5sum] = "467b7183d1062ab4a502b50c34e7d67f"
+SRC_URI[sha256sum] = "1a9d843e7f667c1c6f77c67af5d77e7462ff23b41937cb17454d03535cd9be70"
+
+S = "${WORKDIR}/Data-HexDump-${PV}"
+
+inherit cpan ptest
+
+do_install_ptest () {
+    install -d ${D}${PTEST_PATH}/t
+    install -m 0755 ${B}/t/* ${D}${PTEST_PATH}/t
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libmime/libmime-types-perl_2.04.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libmime/libmime-types-perl_2.04.bb
deleted file mode 100644
index ef53029..0000000
--- a/import-layers/meta-openembedded/meta-perl/recipes-perl/libmime/libmime-types-perl_2.04.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "MIME::Types - Definition of MIME types"
-DESCRIPTION = "MIME types are used in MIME compliant lines, for instance \
-as part of e-mail and HTTP traffic, to indicate the type of content which \
-is transmitted. Sometimes real knowledge about a mime-type is need.\
-\n\
-This module maintains a set of MIME::Type objects, which each describe \
-one known mime type."
-HOMEPAGE = "http://search.cpan.org/~markov/MIME-Types-${PV}"
-SECTION = "libraries"
-
-LICENSE = "Artistic-1.0|GPLv1+"
-LIC_FILES_CHKSUM = "file://META.yml;beginline=11;endline=11;md5=963ce28228347875ace682de56eef8e8"
-
-SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MA/MARKOV/MIME-Types-${PV}.tar.gz \
-           file://run-ptest \
-          "
-SRC_URI[md5sum] = "e292bbf7756bb4999407f3f660697168"
-SRC_URI[sha256sum] = "22b6069d372d587b1f2ecc6d0aaf50fb5c64920caed8c214b9884e64538acc8f"
-
-S = "${WORKDIR}/MIME-Types-${PV}"
-
-inherit cpan ptest
-
-do_install_ptest () {
-    cp -r ${B}/t ${D}${PTEST_PATH}
-}
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libmime/libmime-types-perl_2.13.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libmime/libmime-types-perl_2.13.bb
new file mode 100644
index 0000000..fd51c16
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libmime/libmime-types-perl_2.13.bb
@@ -0,0 +1,26 @@
+SUMMARY = "MIME::Types - Definition of MIME types"
+DESCRIPTION = "MIME types are used in MIME compliant lines, for instance \
+as part of e-mail and HTTP traffic, to indicate the type of content which \
+is transmitted. Sometimes real knowledge about a mime-type is need.\
+\n\
+This module maintains a set of MIME::Type objects, which each describe \
+one known mime type."
+HOMEPAGE = "http://search.cpan.org/~markov/MIME-Types-${PV}"
+SECTION = "libraries"
+
+LICENSE = "Artistic-1.0|GPLv1+"
+LIC_FILES_CHKSUM = "file://META.yml;beginline=11;endline=11;md5=963ce28228347875ace682de56eef8e8"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MA/MARKOV/MIME-Types-${PV}.tar.gz \
+           file://run-ptest \
+          "
+SRC_URI[md5sum] = "f2892ae9e6ea660a58746699c3924817"
+SRC_URI[sha256sum] = "99c3376357bbe22cc8b6c78f560aa18d81621287695cd629008a6c4e66b77bf8"
+
+S = "${WORKDIR}/MIME-Types-${PV}"
+
+inherit cpan ptest
+
+do_install_ptest () {
+    cp -r ${B}/t ${D}${PTEST_PATH}
+}
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/files/0001-libnet-ssleay-perl-Disable-test-that-fails-with-open.patch b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/files/0001-libnet-ssleay-perl-Disable-test-that-fails-with-open.patch
deleted file mode 100644
index 393ee19..0000000
--- a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/files/0001-libnet-ssleay-perl-Disable-test-that-fails-with-open.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From e7a2d3a57fd51f0d4d5b3fcb6669b1876d4b18d2 Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Tue, 10 Nov 2015 01:23:18 -0500
-Subject: [PATCH 1/2] libnet-ssleay-perl: Disable test that fails with
- openssl-1.0.2b or above
-
-Run testsuits:
-t/local/33_x509_create_cert............NOK 39/123
-not ok 39 - PEM_get_string_PrivateKey+passwd+enc_alg
-|   Failed test 'PEM_get_string_PrivateKey+passwd+enc_alg'
-|   at t/local/33_x509_create_cert.t line 104.
-|                   undef
-|     doesn't match '(?^:-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----)'
-
-This is due to the following change in OpenSSL:
-(git://git.openssl.org/openssl.git)
-......
-4d9dc0c269be87b92da188df1fbd8bfee4700eb3 is the first bad commit
-commit 4d9dc0c269be87b92da188df1fbd8bfee4700eb3
-Author: Dr. Stephen Henson <steve@openssl.org>
-Date: Thu May 28 15:44:20 2015 +0100
-
-check for error when creating PKCS#8 structure
-
-Reviewed-by: Rich Salz <rsalz@openssl.org>
-(cherry picked from commit 2849707fa65d2803e6d1c1603fdd3fd1fdc4c6cc)
-......
-
-Upstream-Status: Backport from upstream latest 1.72:
-http://www.cpan.org/authors/id/M/MI/MIKEM/Net-SSLeay-1.72.tar.gz
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- t/local/33_x509_create_cert.t | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/t/local/33_x509_create_cert.t b/t/local/33_x509_create_cert.t
-index 2f2c013..3e653ce 100755
---- a/t/local/33_x509_create_cert.t
-+++ b/t/local/33_x509_create_cert.t
-@@ -2,7 +2,7 @@
- 
- use strict;
- use warnings;
--use Test::More tests => 123;
-+use Test::More tests => 121;
- use Net::SSLeay qw/MBSTRING_ASC MBSTRING_UTF8 EVP_PK_RSA EVP_PKT_SIGN EVP_PKT_ENC/;
- use File::Spec;
- use utf8;
-@@ -99,10 +99,13 @@ is(Net::SSLeay::X509_NAME_cmp($ca_issuer, $ca_subject), 0, "X509_NAME_cmp");
-   }
-   ok(my $alg1 = Net::SSLeay::EVP_get_cipherbyname("DES-EDE3-CBC"), "EVP_get_cipherbyname");
-   like(my $key_pem3 = Net::SSLeay::PEM_get_string_PrivateKey($pk,"password",$alg1), qr/-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----/, "PEM_get_string_PrivateKey+passwd+enc_alg");
--  
--  ok(my $alg2 = Net::SSLeay::EVP_get_cipherbyname("DES-EDE3-OFB"), "EVP_get_cipherbyname");
--  like(my $key_pem4 = Net::SSLeay::PEM_get_string_PrivateKey($pk,"password",$alg2), qr/-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----/, "PEM_get_string_PrivateKey+passwd+enc_alg");
--  
-+
-+# DES-EDE3-OFB has no ASN1 support, detected by changes to do_pk8pkey as of openssl 1.0.1n
-+# https://git.openssl.org/?p=openssl.git;a=commit;h=4d9dc0c269be87b92da188df1fbd8bfee4700eb3
-+# this test now fails
-+#  ok(my $alg2 = Net::SSLeay::EVP_get_cipherbyname("DES-EDE3-OFB"), "EVP_get_cipherbyname");
-+#  like(my $key_pem4 = Net::SSLeay::PEM_get_string_PrivateKey($pk,"password",$alg2), qr/-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----/, "PEM_get_string_PrivateKey+passwd+enc_alg");
-+
-   is(Net::SSLeay::X509_NAME_print_ex($name), "O=Company Name,C=UK,CN=Common name text X509", "X509_NAME_print_ex");  
- 
-   # 2014-06-06: Sigh, some versions of openssl have this patch, which afffects the results of this test:
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/files/0002-Recent-1.0.2-betas-have-dropped-the-SSLv3_method-fun.patch b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/files/0002-Recent-1.0.2-betas-have-dropped-the-SSLv3_method-fun.patch
deleted file mode 100644
index e3650b8..0000000
--- a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/files/0002-Recent-1.0.2-betas-have-dropped-the-SSLv3_method-fun.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From d94f2d3f96db529383b22f2dc294847190d1bfbe Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Tue, 10 Nov 2015 02:11:30 -0500
-Subject: [PATCH 2/2] Recent 1.0.2 betas have dropped the SSLv3_method
- function. This patch leaves out the function on newer versions, much the same
- as the SSLv2 deprecation is handled. It also fixes the ALPN test, which was
- incorrectly failing on OpenSSL due to the LibreSSL check (earlier versions
- bailed out before that line). Signed-off-by: Patch from Tom Molesworth
-
-Upstream-Status: Backport from upstream 1.67
-http://www.cpan.org/authors/id/M/MI/MIKEM/Net-SSLeay-1.67.tar.gz
-https://rt.cpan.org/Public/Bug/Display.html?id=101484
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- SSLeay.xs                 | 12 ++++++++++++
- t/local/41_alpn_support.t |  2 +-
- 2 files changed, 13 insertions(+), 1 deletion(-)
-
-diff --git a/SSLeay.xs b/SSLeay.xs
-index c31396d..1fd4fab 100644
---- a/SSLeay.xs
-+++ b/SSLeay.xs
-@@ -1409,6 +1409,9 @@ SSL_CTX_v2_new()
- #endif
- #endif
- 
-+#ifndef OPENSSL_NO_SSL3
-+#if OPENSSL_VERSION_NUMBER < 0x10002000L
-+
- SSL_CTX *
- SSL_CTX_v3_new()
-      CODE:
-@@ -1416,6 +1419,9 @@ SSL_CTX_v3_new()
-      OUTPUT:
-      RETVAL
- 
-+#endif
-+#endif
-+
- SSL_CTX *
- SSL_CTX_v23_new()
-      CODE:
-@@ -3758,9 +3764,15 @@ SSLv2_method()
- #endif
- #endif
- 
-+#ifndef OPENSSL_NO_SSL3
-+#if OPENSSL_VERSION_NUMBER < 0x10002000L
-+
- const SSL_METHOD *
- SSLv3_method()
- 
-+#endif
-+#endif
-+
- const SSL_METHOD *
- TLSv1_method()
- 
-diff --git a/t/local/41_alpn_support.t b/t/local/41_alpn_support.t
-index ba984b5..87a0214 100644
---- a/t/local/41_alpn_support.t
-+++ b/t/local/41_alpn_support.t
-@@ -11,7 +11,7 @@ use Config;
- 
- BEGIN {
-   plan skip_all => "openssl 1.0.2 required" unless Net::SSLeay::SSLeay >= 0x10002000;
--  plan skip_all => "libressl not supported" if &Net::SSLeay::LIBRESSL_VERSION_NUMBER;
-+  plan skip_all => "libressl not supported" if defined &Net::SSLeay::LIBRESSL_VERSION_NUMBER;
-   plan skip_all => "fork() not supported on $^O" unless $Config{d_fork};
- }
- 
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-ldap-perl_0.65.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-ldap-perl_0.65.bb
new file mode 100644
index 0000000..f2b1f16
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-ldap-perl_0.65.bb
@@ -0,0 +1,29 @@
+SUMMARY = "LDAP Perl module"
+DESCRIPTION = "Net::LDAP is a collection of modules that implements \
+a LDAP services API for Perl programs. The module may be used to \
+search directories or perform maintenance functions such as adding, \
+deleting or modifying entries."
+
+SECTION = "libs"
+
+LICENSE = "Artistic-1.0|GPLv1+"
+LIC_FILES_CHKSUM = "file://README;beginline=3;endline=5;md5=4d6588c2fa0d38ae162f6314d201d89e"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MA/MARSCHAP/perl-ldap-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "d057c8db76913d95c0e460c7bdd98b27"
+SRC_URI[sha256sum] = "5f57dd261dc16ebf942a272ddafe69526598df71151a51916edc37a4f2f23834"
+
+S = "${WORKDIR}/perl-ldap-${PV}"
+
+inherit cpan
+
+do_configure_prepend() {
+    perl -pi -e 's/auto_install_now.*//g' Makefile.PL
+}
+
+RDEPENDS_${PN} = "perl \
+    libconvert-asn1-perl \
+    libio-socket-ssl-perl \
+    libauthen-sasl-perl \
+"
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-libidn-perl_0.12.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-libidn-perl_0.12.bb
index 0c53b6a..1ef9f0b 100644
--- a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-libidn-perl_0.12.bb
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-libidn-perl_0.12.bb
@@ -10,7 +10,7 @@
 DEPENDS += "libidn"
 # We must need glibc-gconvs to enable charset related functions,
 # such as Net::LibIDN::idn_to_ascii().
-RDEPENDS_${PN} += "glibc-gconvs"
+RDEPENDS_${PN}_append_libc-glibc = " glibc-gconvs"
 
 SRC_URI = "http://search.cpan.org/CPAN/authors/id/T/TH/THOR/Net-LibIDN-${PV}.tar.gz"
 SRC_URI[md5sum] = "c3e4de2065009d67bcb1df0afb473e12"
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-ssleay-perl_1.65.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-ssleay-perl_1.65.bb
deleted file mode 100644
index cfd6f51..0000000
--- a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-ssleay-perl_1.65.bb
+++ /dev/null
@@ -1,51 +0,0 @@
-SUMMARY = "Net::SSLeay - Perl extension for using OpenSSL"
-DESCRIPTION = "This module offers some high level convenience functions for accessing \
-web pages on SSL servers (for symmetry, same API is offered for \
-accessing http servers, too), a sslcat() function for writing your own \
-clients, and finally access to the SSL api of SSLeay/OpenSSL package \
-so you can write servers or clients for more complicated applications."
-HOMEPAGE = "http://search.cpan.org/dist/Net-SSLeay/"
-SECTION = "libs"
-
-LICENSE = "OpenSSL"
-LIC_FILES_CHKSUM = "file://README;beginline=274;endline=294;md5=49f415984b387be999ee2ad0e5c692fe"
-
-DEPENDS = "openssl zlib"
-RDEPENDS_${PN} += "perl-module-carp \
-                   perl-module-errno \
-                   perl-module-extutils-makemaker \
-                   perl-module-mime-base64 \
-                   perl-module-socket \
-                  "
-
-SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MI/MIKEM/Net-SSLeay-${PV}.tar.gz \
-           file://0001-libnet-ssleay-perl-Disable-test-that-fails-with-open.patch \
-           file://0002-Recent-1.0.2-betas-have-dropped-the-SSLv3_method-fun.patch \
-           file://run-ptest \
-          "
-SRC_URI[md5sum] = "19600c036e9e0bbfbf9157f083e40755"
-SRC_URI[sha256sum] = "2fb1371120b85f018944d95736c107163f04ba56b6029c0709a2c3d6247b9c06"
-
-S = "${WORKDIR}/Net-SSLeay-${PV}"
-
-inherit cpan ptest
-
-EXTRA_CPANFLAGS = "LIBS='-L=${STAGING_LIBDIR} -L=${STAGING_BASELIBDIR}' \
-                   INC=-I=${STAGING_INCDIR} \
-                   'EXTRALIBS=-lssl -lcrypto -lz' \
-                   'LDLOADLIBS=-lssl -lcrypto -lz' \
-                  "
-
-do_configure_prepend() {
-    export OPENSSL_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
-}
-
-do_install_ptest() {
-    cp -r ${B}/t ${D}${PTEST_PATH}
-}
-
-BBCLASSEXTEND = "native"
-
-FILES_${PN}-dbg =+ "${libdir}/perl/vendor_perl/*/auto/Net/SSLeay/.debug/"
-
-RDEPENDS_${PN}-ptest = " perl"
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-ssleay-perl_1.80.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-ssleay-perl_1.80.bb
new file mode 100644
index 0000000..cf621aa
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-ssleay-perl_1.80.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Net::SSLeay - Perl extension for using OpenSSL"
+DESCRIPTION = "This module offers some high level convenience functions for accessing \
+web pages on SSL servers (for symmetry, same API is offered for \
+accessing http servers, too), a sslcat() function for writing your own \
+clients, and finally access to the SSL api of SSLeay/OpenSSL package \
+so you can write servers or clients for more complicated applications."
+HOMEPAGE = "http://search.cpan.org/dist/Net-SSLeay/"
+SECTION = "libs"
+
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README;beginline=274;endline=294;md5=67d67095d83e339da538a082fad5f38e"
+
+DEPENDS = "openssl zlib openssl-native"
+RDEPENDS_${PN} += "perl-module-carp \
+                   perl-module-errno \
+                   perl-module-extutils-makemaker \
+                   perl-module-mime-base64 \
+                   perl-module-socket \
+                  "
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MI/MIKEM/Net-SSLeay-${PV}.tar.gz \
+           file://run-ptest \
+          "
+SRC_URI[md5sum] = "b1e0fd96d7f3be57580377226ca5f089"
+SRC_URI[sha256sum] = "a541a66d59fc5f9bb7af09d3a0b68305e4c43ba9488b12915728fd282ea01b93"
+
+S = "${WORKDIR}/Net-SSLeay-${PV}"
+
+inherit cpan ptest
+
+EXTRA_CPANFLAGS = "LIBS='-L=${STAGING_LIBDIR} -L=${STAGING_BASELIBDIR}' \
+                   INC=-I=${STAGING_INCDIR} \
+                   '-lssl -lcrypto -lz' \
+                  "
+
+do_install_ptest() {
+    cp -r ${B}/t ${D}${PTEST_PATH}
+}
+
+BBCLASSEXTEND = "native"
+
+FILES_${PN}-dbg =+ "${libdir}/perl/vendor_perl/*/auto/Net/SSLeay/.debug/"
+
+RDEPENDS_${PN}-ptest = " perl"
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-telnet-perl_3.04.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-telnet-perl_3.04.bb
new file mode 100644
index 0000000..652e8c9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libnet/libnet-telnet-perl_3.04.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Net-Telnet Perl module"
+DESCRIPTION = "Net::Telnet allows you to make client connections to a TCP port and do \
+network I/O, especially to a port using the TELNET protocol. Simple I/O \
+methods such as print, get, and getline are provided. More sophisticated \
+interactive features are provided because connecting to a TELNET port \
+ultimately means communicating with a program designed for human interaction. \
+These interactive features include the ability to specify a time-out and to \
+wait for patterns to appear in the input stream, such as the prompt from a \
+shell."
+
+HOMEPAGE = "http://search.cpan.org/dist/Net-Telnet/"
+SECTION = "Development/Libraries"
+
+LICENSE = "Artistic-1.0|GPLv1+"
+LIC_FILES_CHKSUM = "file://README;beginline=4;endline=7;md5=3fd238bfb6ee1810cb15d5d95e07b0f5"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/J/JR/JROGERS/Net-Telnet-${PV}.tar.gz"
+SRC_URI[md5sum] = "d2514080116c1b0fa5f96295c84538e3"
+SRC_URI[sha256sum] = "e64d567a4e16295ecba949368e7a6b8b5ae2a16b3ad682121d9b007dc5d2a37a"
+
+S = "${WORKDIR}/Net-Telnet-${PV}"
+
+inherit cpan
+
+RDEPENDS_${PN} = "perl"
diff --git a/import-layers/meta-openembedded/meta-perl/recipes-perl/libtext/libtext-iconv-perl_1.7.bb b/import-layers/meta-openembedded/meta-perl/recipes-perl/libtext/libtext-iconv-perl_1.7.bb
index 934be03..275ccb8 100644
--- a/import-layers/meta-openembedded/meta-perl/recipes-perl/libtext/libtext-iconv-perl_1.7.bb
+++ b/import-layers/meta-openembedded/meta-perl/recipes-perl/libtext/libtext-iconv-perl_1.7.bb
@@ -10,7 +10,7 @@
 SECTION = "libs"
 LICENSE = "Artistic-1.0 | GPL-1.0+"
 LIC_FILES_CHKSUM = "file://README;beginline=3;endline=6;md5=fadf2919c7128e887d26b4d905f90649"
-RRECOMMENDS_${PN} += "glibc-gconvs"
+RRECOMMENDS_${PN}_append_libc-glibc = " glibc-gconvs"
 
 SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MP/MPIOTR/Text-Iconv-${PV}.tar.gz"
 
diff --git a/import-layers/meta-openembedded/meta-python/README b/import-layers/meta-openembedded/meta-python/README
index 7406184..01b056c 100644
--- a/import-layers/meta-openembedded/meta-python/README
+++ b/import-layers/meta-openembedded/meta-python/README
@@ -17,12 +17,12 @@
 
 	URI: git://git.openembedded.org/openembedded-core
 	layers: meta
-	branch: morty
+	branch: pyro 
 	revision: HEAD
 
 	URI: git://git.openembedded.org/meta-openembedded
 	layers: meta-oe
-	branch: morty
+	branch:  pyro
 	revision: HEAD
 
 Please follow the recommended setup procedures of your OE distribution.
@@ -39,14 +39,12 @@
 before posting.
 
 Send pull requests to openembedded-devel@lists.openembedded.org with
-'[meta-python]' in the subject.
+'[meta-python][pyro]' in the subject.
 
 When sending single patches, please use something like: 
-'git send-email -M -1 --to=openembedded-devel@lists.openembedded.org --subject-prefix=meta-python][morty][PATCH'
+'git send-email -M -1 --to=openembedded-devel@lists.openembedded.org --subject-prefix=meta-python][pyro][PATCH'
 
 Maintenance
 -------------------------
-
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
-
diff --git a/import-layers/meta-openembedded/meta-python/classes/pypi.bbclass b/import-layers/meta-openembedded/meta-python/classes/pypi.bbclass
index cd27cd2..e5d7ab3 100644
--- a/import-layers/meta-openembedded/meta-python/classes/pypi.bbclass
+++ b/import-layers/meta-openembedded/meta-python/classes/pypi.bbclass
@@ -1,5 +1,5 @@
 def pypi_package(d):
-    bpn = d.getVar('BPN', True)
+    bpn = d.getVar('BPN')
     if bpn.startswith('python-'):
         return bpn[7:]
     elif bpn.startswith('python3-'):
@@ -10,9 +10,9 @@
 PYPI_PACKAGE_EXT ?= "tar.gz"
 
 def pypi_src_uri(d):
-    package = d.getVar('PYPI_PACKAGE', True)
-    package_ext = d.getVar('PYPI_PACKAGE_EXT', True)
-    pv = d.getVar('PV', True)
+    package = d.getVar('PYPI_PACKAGE')
+    package_ext = d.getVar('PYPI_PACKAGE_EXT')
+    pv = d.getVar('PV')
     return 'https://files.pythonhosted.org/packages/source/%s/%s/%s-%s.%s' % (package[0], package, package, pv, package_ext)
 
 PYPI_SRC_URI ?= "${@pypi_src_uri(d)}"
@@ -21,3 +21,6 @@
 SECTION = "devel/python"
 SRC_URI += "${PYPI_SRC_URI}"
 S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
+
+UPSTREAM_CHECK_URI ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
+UPSTREAM_CHECK_REGEX ?= "/${PYPI_PACKAGE}/(?P<pver>(\d+[\.\-_]*)+)"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-connectivity/gateone/gateone_git.bb b/import-layers/meta-openembedded/meta-python/recipes-connectivity/gateone/gateone_git.bb
index 5323554..8b2a192 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-connectivity/gateone/gateone_git.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-connectivity/gateone/gateone_git.bb
@@ -14,7 +14,7 @@
 
 S = "${WORKDIR}/git"
 
-inherit distutils python-dir systemd update-rc.d
+inherit setuptools python-dir systemd update-rc.d
 
 DISTUTILS_INSTALL_ARGS = "--root=${D} \
     --prefix=${prefix} \
diff --git a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-gsocketpool/files/0001-fix_setup_py.patch b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-gsocketpool/files/0001-fix_setup_py.patch
new file mode 100644
index 0000000..a9135a3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-gsocketpool/files/0001-fix_setup_py.patch
@@ -0,0 +1,35 @@
+From 2d47a5df58802173bf90d760b1d6f520aeea76fc Mon Sep 17 00:00:00 2001
+From: Andrej Rode <andrej.rode@ettus.com>
+Date: Mon, 10 Apr 2017 16:47:41 -0700
+Subject: [PATCH] setup: remove find_packages since that would install tests as
+ a package as well
+
+Signed-off-by: Andrej Rode <andrej.rode@ettus.com>
+---
+ setup.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 6b37016..a1f11a7 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,6 +1,6 @@
+ # -*- coding: utf-8 -*-
+ 
+-from setuptools import setup, find_packages
++from setuptools import setup
+ 
+ setup(
+     name='gsocketpool',
+@@ -9,7 +9,7 @@ setup(
+     author='Studio Ousia',
+     author_email='ikuya@ousia.jp',
+     url='http://github.com/studio-ousia/gsocketpool',
+-    packages=find_packages(),
++    packages=['gsocketpool'],
+     license=open('LICENSE').read(),
+     include_package_data=True,
+     classifiers=(
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-gsocketpool/python-gsocketpool_0.1.5.bb b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-gsocketpool/python-gsocketpool_0.1.5.bb
new file mode 100644
index 0000000..f86152c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-gsocketpool/python-gsocketpool_0.1.5.bb
@@ -0,0 +1,16 @@
+SUMMARY = "A simple connection pool for gevent"
+DESCRIPTION = "creates a pool of connections that can be used with gevent"
+HOMEPAGE = "https://github.com/studio-ousia/gsocketpool"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4ba825394aec026b5f94edca44426859"
+DEPENDS += "python-gevent"
+RDEPENDS_${PN} += "python-gevent"
+
+SRC_URI_append = " \
+    file://0001-fix_setup_py.patch;patch=1;pnum=1 \
+"
+
+SRC_URI[md5sum] = "04f618864b18d6b06f774994f172ef49"
+SRC_URI[sha256sum] = "b6b73deab9bcbc428d4813697eebe5c3b9c40a971f62e13607b881aa749af9d0"
+
+inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-mprpc/files/0001-fix_setup_py.patch b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-mprpc/files/0001-fix_setup_py.patch
new file mode 100644
index 0000000..f5df9b9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-mprpc/files/0001-fix_setup_py.patch
@@ -0,0 +1,34 @@
+From bda99eab9036d46e7bb06b446d11cab0b1dd8093 Mon Sep 17 00:00:00 2001
+From: Andrej Rode <andrej.rode@ettus.com>
+Date: Mon, 10 Apr 2017 16:49:50 -0700
+Subject: [PATCH] setup: remove find_packages and only install mprpc
+
+Signed-off-by: Andrej Rode <andrej.rode@ettus.com>
+---
+ setup.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 5001d0c..4c0ba75 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,6 +1,6 @@
+ # -*- coding: utf-8 -*-
+ 
+-from setuptools import setup, Extension, find_packages
++from setuptools import setup, Extension
+ 
+ setup(
+     name='mprpc',
+@@ -10,7 +10,7 @@ setup(
+     author='Studio Ousia',
+     author_email='ikuya@ousia.jp',
+     url='http://github.com/studio-ousia/mprpc',
+-    packages=find_packages(),
++    packages=['mprpc'],
+     ext_modules=[
+         Extension('mprpc.client', ['mprpc/client.c']),
+         Extension('mprpc.server', ['mprpc/server.c'])
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-mprpc/python-mprpc_0.1.13.bb b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-mprpc/python-mprpc_0.1.13.bb
new file mode 100644
index 0000000..78df00a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-mprpc/python-mprpc_0.1.13.bb
@@ -0,0 +1,17 @@
+SUMMARY = "A gevent based messagpack rpc library"
+DESCRIPTION = "mprpc is a fast implementation of the messagepack rpc protocol for python. \
+It is based on gevent for handling connections and enabling concurrent connections."
+HOMEPAGE = "https://github.com/studio-ousia/mprpc"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4ba825394aec026b5f94edca44426859"
+DEPENDS += "python-gevent"
+RDEPENDS_${PN} += "python-gevent python-msgpack python-gsocketpool"
+
+SRC_URI_append = " \
+    file://0001-fix_setup_py.patch;patch=1;pnum=1 \
+"
+
+SRC_URI[md5sum] = "449e6239eb5ff07b9cceb86e1ab0c2ee"
+SRC_URI[sha256sum] = "5881cc7fbb8de814e2b4aa5958bfe147c5c301e46749190f0e6abf373cf56d82"
+
+inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-pyconnman/python-pyconnman_0.1.0.bb b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-pyconnman/python-pyconnman_0.1.0.bb
new file mode 100644
index 0000000..77b5e4d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-pyconnman/python-pyconnman_0.1.0.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "Python-based Network Connectivity Management"
+HOMEPAGE = "https://pypi.python.org/pypi/pyconnman/"
+LICENSE = "Apache-2.0"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+SRC_URI[md5sum] = "b7fa82034b1c0e1fb1b518ffe3bb4fc0"
+SRC_URI[sha256sum] = "46c64c0692063fd0c9fb0216d49f7884bec9fa9760d8473db4b1e2f8162fab4a"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} = "connman python-dbus python-pprint"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-pyro4/python-pyro4_4.39.bb b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-pyro4/python-pyro4_4.39.bb
deleted file mode 100644
index 5b4ca7b..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-pyro4/python-pyro4_4.39.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-SUMMARY = "Python Remote Objects"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=b48b62dd270c4691fabaa85be3236030"
-
-SRC_URI[md5sum] = "75ed5cd142803b0a8d587dc8b6bb51ed"
-SRC_URI[sha256sum] = "39c6ca7f86b0f0bebfeada687a5a8b99f66470a52b0f815195ae63c683266f24"
-
-PYPI_PACKAGE = "Pyro4"
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-pyro4/python-pyro4_4.55.bb b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-pyro4/python-pyro4_4.55.bb
new file mode 100644
index 0000000..cc28a81
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-pyro4/python-pyro4_4.55.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Python Remote Objects"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=378acef375e17a3bff03bd0f78c53220"
+
+SRC_URI[md5sum] = "0400a4d260dbeaa4e7e725c4ba310ead"
+SRC_URI[sha256sum] = "49a7a142542d87dde1cecc8d3ee048ec9481ba861d61234d219fadd06e6ced96"
+
+PYPI_PACKAGE = "Pyro4"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-logging \
+    ${PYTHON_PN}-selectors34 \
+    ${PYTHON_PN}-serpent \
+    ${PYTHON_PN}-threading \
+    ${PYTHON_PN}-zlib \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-thrift/python-thrift_0.10.0.bb b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-thrift/python-thrift_0.10.0.bb
new file mode 100644
index 0000000..e6f61bd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-thrift/python-thrift_0.10.0.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Python bindings for the Apache Thrift RPC system"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://PKG-INFO;md5=26a2009ddcb7c4162f8bafd5ef73c670"
+
+SRC_URI[md5sum] = "76bb768a210257dd203923110042e560"
+SRC_URI[sha256sum] = "b7f6c09155321169af03f9fb20dc15a4a0c7481e7c334a5ba8f7f0d864633209"
+
+PYPI_PACKAGE_EXT = "zip"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-logging \
+    ${PYTHON_PN}-six \
+    ${PYTHON_PN}-stringold \
+    ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-thrift/python-thrift_0.9.3.bb b/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-thrift/python-thrift_0.9.3.bb
deleted file mode 100644
index 652de95..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-connectivity/python-thrift/python-thrift_0.9.3.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-SUMMARY = "Python bindings for the Apache Thrift RPC system"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://PKG-INFO;md5=1203b6a05c3bff3229710e3f063ddca7"
-
-SRC_URI[md5sum] = "b519551d7a086bb0b4f222a8f566b7e8"
-SRC_URI[sha256sum] = "dfbc3d3bd19d396718dab05abaf46d93ae8005e2df798ef02e32793cd963877e"
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-anyjson.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-anyjson.inc
new file mode 100644
index 0000000..a0d20ff
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-anyjson.inc
@@ -0,0 +1,13 @@
+SUMMARY = "Wraps the best available JSON implementation available in a common interface"
+DESCRIPTION = "Anyjson loads whichever is the fastest JSON module installed and  \
+provides a uniform API regardless of which JSON implementation is used."
+HOMEPAGE = "https://bitbucket.org/runeh/anyjson"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=989aa97e73c912a83a3c873fa11deb08"
+
+inherit pypi
+
+SRC_URI[md5sum] = "2ea28d6ec311aeeebaf993cb3008b27c"
+SRC_URI[sha256sum] = "37812d863c9ad3e35c0734c42e0bf0320ce8c3bed82cd20ad54cb34d158157ba"
+
+RDEPENDS_${PN} += "${PYTHON_PN}-simplejson"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-anyjson_0.3.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-anyjson_0.3.3.bb
new file mode 100644
index 0000000..31b8749
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-anyjson_0.3.3.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-anyjson.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-astroid_1.4.9.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-astroid_1.4.9.bb
new file mode 100644
index 0000000..cee1291
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-astroid_1.4.9.bb
@@ -0,0 +1,17 @@
+SUMMARY = "An abstract syntax tree for Python with inference support."
+HOMEPAGE = "https://pypi.python.org/pypi/astroid"
+SECTION = "devel/python"
+LICENSE = "LGPL"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI[md5sum] = "a57438971de05eb801b82eae59c05217"
+SRC_URI[sha256sum] = "a483e7891ce3a06dadfc6cb9095b0938aca58940d43576d72e4502b480c085d7"
+
+inherit setuptools pypi
+
+RDEPENDS_${PN}_class-target += "\
+    ${PYTHON_PN}-distutils \
+    ${PYTHON_PN}-lazy-object-proxy \
+    ${PYTHON_PN}-six \
+    ${PYTHON_PN}-wrapt \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-autobahn_0.8.6.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-autobahn_0.8.6.bb
deleted file mode 100644
index e64dd8f..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-autobahn_0.8.6.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-DESCRIPTION = "AutobahnPython provides a WebSocket (RFC6455, Hybi-10 to -17, Hixie-76) framework for creating WebSocket-based clients and servers. \
-AutobahnPython also includes an implementation of WAMP (The WebSockets Application Messaging Protocol), a light-weight,  \
-asynchronous RPC/PubSub over JSON/WebSocket protocol."
-HOMEPAGE = "http://autobahn.ws/python"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = " file://autobahn/__init__.py;beginline=1;endline=17;md5=1fdeccf6e5b70cda64cc1345597c18e3"
-
-SRC_URI[md5sum] = "160429e7fb043940e79aa7f4ebbab57a"
-SRC_URI[sha256sum] = "94ae5c6f37f9fe7c9d3f12c170fcc273afed4104a1c5508b26d6014bb9e6373e"
-
-PYPI_PACKAGE_EXT = "zip"
-inherit pypi setuptools
-
-RDEPENDS_${PN} = "python python-pprint python-twisted-protocols python-netserver python-twisted-web"
-
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-babel.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-babel.inc
new file mode 100644
index 0000000..866ce78
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-babel.inc
@@ -0,0 +1,20 @@
+DESCRIPTION = "A collection of tools for internationalizing Python applications"
+HOMEPAGE = "http://babel.edgewall.org/"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e6eeaabc92cfc2d03f53e789324d7292"
+
+SRC_URI[md5sum] = "afa20bc55b0e991833030129ad498f35"
+SRC_URI[sha256sum] = "c535c4403802f6eb38173cd4863e419e2274921a01a8aad8a5b497c131c62875"
+
+PYPI_PACKAGE = "Babel"
+
+inherit pypi
+
+CLEANBROKEN = "1"
+
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-numbers \
+    ${PYTHON_PN}-pickle \
+    ${PYTHON_PN}-pytz \
+    ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-babel_2.3.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-babel_2.3.4.bb
new file mode 100644
index 0000000..e0eadcd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-babel_2.3.4.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-babel.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-backports-functools-lru-cache_1.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-backports-functools-lru-cache_1.3.bb
new file mode 100644
index 0000000..211cfde
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-backports-functools-lru-cache_1.3.bb
@@ -0,0 +1,14 @@
+SUMMARY = "Backport of functools.lru_cache from Python 3.3"
+HOMEPAGE = "https://github.com/jaraco/backports.functools_lru_cache"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://setup.py;beginline=42;endline=42;md5=98fc3658e5970d26f6b2109808c766be"
+
+PYPI_PACKAGE = "backports.functools_lru_cache"
+
+SRC_URI[md5sum] = "b26a223250bd24ea2e0ad6ce47b19084"
+SRC_URI[sha256sum] = "444a21bcec4ae177da554321f81a78dc879eaa8f6ea9920cb904830585d31e95"
+
+DEPENDS = "python-setuptools-scm-native"
+
+inherit setuptools pypi
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-bcrypt_3.1.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-bcrypt_3.1.1.bb
deleted file mode 100644
index aae037f..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-bcrypt_3.1.1.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-DESCRIPTION = "Modern password hashing for your software and your servers."
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=8f7bb094c7232b058c7e9f2e431f389c"
-
-DEPENDS = "python-cffi-native"
-
-SRC_URI[md5sum] = "7348b2c361e23cf205701bba7652d789"
-SRC_URI[sha256sum] = "0309a4a72bd1dc314279cf1ee14e277227732f14c9b63ab96715654e13fe9321"
-
-inherit pypi setuptools
-
-RDEPENDS_${PN} = "\
-    python-cffi \
-    python-six \
-"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-bcrypt_3.1.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-bcrypt_3.1.3.bb
new file mode 100644
index 0000000..c690f0d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-bcrypt_3.1.3.bb
@@ -0,0 +1,15 @@
+DESCRIPTION = "Modern password hashing for your software and your servers."
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8f7bb094c7232b058c7e9f2e431f389c"
+
+DEPENDS = "python-cffi-native"
+
+SRC_URI[md5sum] = "20da8b40790caad99c4086dba533154b"
+SRC_URI[sha256sum] = "6645c8d0ad845308de3eb9be98b6fd22a46ec5412bfc664a423e411cdd8f5488"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN}_class-target += "\
+    ${PYTHON_PN}-cffi \
+    ${PYTHON_PN}-six \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-can.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-can.inc
new file mode 100644
index 0000000..1878f31
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-can.inc
@@ -0,0 +1,9 @@
+SUMMARY = "Controller Area Network (CAN) interface module for Python"
+SECTION = "devel/python"
+LICENSE = "LGPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=38138baa100d7259934590850bc0406e"
+
+SRC_URI[md5sum] = "f653aecf8b9034bbba32cc04ca6a7b6d"
+SRC_URI[sha256sum] = "edabb426e6cd11c2dc7a98980340135aa0eb02143b0d51bf14e3e6178c131cc3"
+
+PYPI_PACKAGE="python-can"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-can_1.5.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-can_1.5.2.bb
new file mode 100644
index 0000000..ec81a9e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-can_1.5.2.bb
@@ -0,0 +1,4 @@
+require python-can.inc
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "python-sqlite3"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cassandra-driver.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cassandra-driver.inc
new file mode 100644
index 0000000..3146bc7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cassandra-driver.inc
@@ -0,0 +1,33 @@
+SUMMARY = "DataStax Python Driver for Apache Cassandra"
+DESCRIPTION = "A modern, feature-rich and highly-tunable Python client \
+library for Apache Cassandra (1.2+) and DataStax Enterprise (3.1+) using \
+exclusively Cassandra's binary protocol and Cassandra Query Language v3."
+HOMEPAGE = "https://github.com/datastax/python-driver"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
+SRCNAME = "cassandra-driver"
+
+SRC_URI[md5sum] = "7561a89cd8a432a22cf33abef76b64ee"
+SRC_URI[sha256sum] = "10b0c88854f3bddcfd994cb208d780507de62524ef8dcb4f068c084d335b7054"
+
+DISTUTILS_BUILD_ARGS += " \
+    --no-libev \
+"
+DISTUTILS_INSTALL_ARGS += " \
+    --no-libev \
+"
+
+inherit pypi
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-cython \
+    ${PYTHON_PN}-multiprocessing \
+    ${PYTHON_PN}-six \
+    ${PYTHON_PN}-json \
+    libevent \
+"
+
+DEPENDS_${PN} += "\
+    ${PYTHON_PN}-cython \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-certifi.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-certifi.inc
index 894154d..1df23cf 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-certifi.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-certifi.inc
@@ -7,8 +7,7 @@
 LICENSE = "ISC"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=f77f61d14ee6feac4228d3ebd26cc1f1"
 
-SRC_URI[md5sum] = "baa81e951a29958563689d868ef1064d"
-SRC_URI[sha256sum] = "8275aef1bbeaf05c53715bfc5d8569bd1e04ca1e8e69608cc52bcaac2604eb19"
+SRC_URI[md5sum] = "b72521a8badff5e89a8eabea586d79ab"
+SRC_URI[sha256sum] = "81877fb7ac126e9215dfb15bfef7115fdc30e798e0013065158eed0707fd99ce"
 
 BBCLASSEXTEND = "native nativesdk"
-
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-certifi_2016.9.26.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-certifi_2017.1.23.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-certifi_2016.9.26.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-certifi_2017.1.23.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cffi.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cffi.inc
index d24d6ff..21e41c1 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cffi.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cffi.inc
@@ -1,9 +1,13 @@
 SUMMARY = "Foreign Function Interface for Python calling C code"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=5677e2fdbf7cdda61d6dd2b57df547bf"
-DEPENDS = "libffi ${PYTHON_PN}-pycparser"
+DEPENDS += "libffi ${PYTHON_PN}-pycparser"
 
-SRC_URI[md5sum] = "c8e877fe0426a99d0cf5872cf2f95b27"
-SRC_URI[sha256sum] = "c321bd46faa7847261b89c0469569530cad5a41976bb6dba8202c0159f476568"
+SRC_URI[md5sum] = "b8fa7ccb87790531db3316ab17aa8244"
+SRC_URI[sha256sum] = "563e0bd53fda03c151573217b3a49b3abad8813de9dd0632e10090f6190fdaf8"
+
+RDEPENDS_${PN}_class-target = " \
+    ${PYTHON_PN}-io \
+"
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cffi_1.8.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cffi_1.8.3.bb
deleted file mode 100644
index 1d2d241..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cffi_1.8.3.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools
-require python-cffi.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cffi_1.9.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cffi_1.9.1.bb
new file mode 100644
index 0000000..3cd62d1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cffi_1.9.1.bb
@@ -0,0 +1,2 @@
+require python-cffi.inc
+inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-chardet.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-chardet.inc
new file mode 100644
index 0000000..42b64a2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-chardet.inc
@@ -0,0 +1,8 @@
+SUMMARY = "Universal encoding detector for Python 2 and 3"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+inherit pypi
+
+SRC_URI[md5sum] = "96e364abdbde20b5f6dbbe2ad9d54d04"
+SRC_URI[sha256sum] = "4f7832e7c583348a9eddd927ee8514b3bf717c061f57b21dbe7697211454d9bb"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-chardet_2.3.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-chardet_2.3.0.bb
deleted file mode 100644
index dfc979b..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-chardet_2.3.0.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-SUMMARY = "Universal encoding detector for Python 2 and 3"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=a6f89e2100d9b6cdffcea4f398e37343"
-
-SRC_URI[md5sum] = "25274d664ccb5130adae08047416e1a8"
-SRC_URI[sha256sum] = "e53e38b3a4afe6d1132de62b7400a4ac363452dc5dfcf8d88e8e0cce663c68aa"
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-chardet_3.0.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-chardet_3.0.2.bb
new file mode 100644
index 0000000..b7a46e9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-chardet_3.0.2.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-chardet.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-click.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-click.inc
index 90809af..718bbab 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-click.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-click.inc
@@ -8,8 +8,10 @@
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=09e8b7869f94ba9e9a7b260d53c65dab"
 
-SRC_URI[md5sum] = "d0b09582123605220ad6977175f3e51d"
-SRC_URI[sha256sum] = "cc6a19da8ebff6e7074f731447ef7e112bd23adf3de5c597cf9989f2fd8defe9"
+SRC_URI[md5sum] = "fc4cc00c4863833230d3af92af48abd4"
+SRC_URI[sha256sum] = "f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b"
+
+CLEANBROKEN = "1"
 
 RDEPENDS_${PN} += "\
     ${PYTHON_PN}-io \
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-click_6.6.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-click_6.7.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-click_6.6.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-click_6.7.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cloudeebus_0.6.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cloudeebus_0.6.0.bb
deleted file mode 100644
index 1490e22..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cloudeebus_0.6.0.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-DESCRIPTION = "A component which enables calling DBus methods and registering on DBus signals from Javascript"
-HOMEPAGE = "https://github.com/01org/cloudeebus"
-SECTION = "devel/python"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
-
-SRC_URI = "git://github.com/01org/cloudeebus.git;protocol=http;branch=master "
-SRCREV = "b5cc957eeabfe98cb996baf8e5a0ac848993c3d4"
-
-S = "${WORKDIR}/git"
-
-inherit distutils setuptools
-
-DEPENDS_${PN} = "python python-distribute"
-RDEPENDS_${PN} = "python python-dbus python-json python-argparse python-pygobject python-autobahn python-twisted python-subprocess"
-
-do_install_prepend() {
-  install -d ${D}${PYTHON_SITEPACKAGES_DIR}/${PN}
-}
-
-DISTUTILS_INSTALL_ARGS = "--root=${D} \
-    --single-version-externally-managed \
-    --prefix=${prefix} \
-    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
-    --install-data=${datadir}"
-
-do_install_append() {
-  distutils_do_install
-  install -d ${D}${datadir}/doc/${BPN}/
-  install -m 0644 ${S}/README.md ${D}${datadir}/doc/${BPN}/
-}
-
-FILES_${PN} += "${datadir}/cloudeebus"
-FILES_${PN} += "${sysconfdir}/dbus-1/system.d/org.cloudeebus.conf"
-
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cmd2_0.6.9.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cmd2_0.6.9.bb
deleted file mode 100644
index ed99792..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cmd2_0.6.9.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "Extra features for standard library's cmd module"
-HOMEPAGE = "http://packages.python.org/cmd2/"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://setup.py;beginline=17;endline=17;md5=25c0f7ede01b1eab41daf880e5791f05"
-
-SRC_URI[md5sum] = "cf39b5a34955d263b42a7ffc9d3e536d"
-SRC_URI[sha256sum] = "ef09745c91dbc13344db6d81f4dea4c844bf2fabf3baf91fab1bb54e4b3bb328"
-
-inherit pypi setuptools
-
-RDEPENDS_${PN} += "\
-    ${PYTHON_PN}-doctest \
-    ${PYTHON_PN}-pyparsing \
-    ${PYTHON_PN}-shell \
-    ${PYTHON_PN}-stringold \
-    ${PYTHON_PN}-subprocess \
-    ${PYTHON_PN}-textutils \
-    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cmd2_0.7.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cmd2_0.7.0.bb
new file mode 100644
index 0000000..5c092a7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cmd2_0.7.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Extra features for standard library's cmd module"
+HOMEPAGE = "http://packages.python.org/cmd2/"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://setup.py;beginline=43;endline=43;md5=0f13c9cfc75288223cf7edd2f3b985a2"
+
+SRC_URI[md5sum] = "ee92ff1b73765d64bf230e94512d0b7a"
+SRC_URI[sha256sum] = "5ab76a1f07dd5fd1cc3c15ba4080265f33b80c7fd748d71bd69a51d60b30f51a"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-doctest \
+    ${PYTHON_PN}-pyparsing \
+    ${PYTHON_PN}-shell \
+    ${PYTHON_PN}-six \
+    ${PYTHON_PN}-stringold \
+    ${PYTHON_PN}-subprocess \
+    ${PYTHON_PN}-threading \
+    ${PYTHON_PN}-textutils \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography-vectors.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography-vectors.inc
index 62dfbfd..122528b 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography-vectors.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography-vectors.inc
@@ -3,13 +3,15 @@
 LICENSE = "Apache-2.0 | BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=8c3617db4fb6fae01f1d253ab91511e4"
 
-DEPENDS = " \
+DEPENDS += " \
     ${PYTHON_PN}-cryptography \
 "
 
-SRC_URI[md5sum] = "b8555dfadafc4ecab4ee4650430d9cab"
-SRC_URI[sha256sum] = "0728815ef0c53d67fd437aa5220450a9752d41ecb28108f5df628a092ff466ea"
+SRC_URI[md5sum] = "c3f2a66d71a0413879d4dd001c56de95"
+SRC_URI[sha256sum] = "4be4eee8a11deee5c2f00e389b49de8ce2642130282d1cd0adffb2f7dbe0acdc"
 
 PYPI_PACKAGE = "cryptography_vectors"
 
 BBCLASSEXTEND = "native nativesdk"
+
+UPSTREAM_CHECK_REGEX = ""
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography-vectors_1.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography-vectors_1.7.2.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography-vectors_1.4.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography-vectors_1.7.2.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography.inc
index d4767b1..601b12b 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography.inc
@@ -1,6 +1,6 @@
 SUMMARY = "Provides cryptographic recipes and primitives to python developers"
 LICENSE = "Apache-2.0 | BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=8c3617db4fb6fae01f1d253ab91511e4"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d5ede125ed08d4fd14ec44d334bdb388"
 
 DEPENDS += " \
     ${PYTHON_PN}-cffi \
@@ -9,18 +9,27 @@
     ${PYTHON_PN}-six \
 "
 
-SRC_URI[md5sum] = "a9763e3831cc7cdb402c028fac1ceb39"
-SRC_URI[sha256sum] = "bb149540ed90c4b2171bf694fe6991d6331bc149ae623c8ff419324f4222d128"
+SRC_URI[md5sum] = "fade66de437392ed1ba6980768626204"
+SRC_URI[sha256sum] = "878cb68b3da3d493ffd68f36db11c29deee623671d3287c3f8d685117ffda9a9"
 
 RDEPENDS_${PN} += " \
     ${PYTHON_PN}-cffi \
     ${PYTHON_PN}-idna \
+    ${PYTHON_PN}-pyasn1 \
+    ${PYTHON_PN}-pycparser \
+    ${PYTHON_PN}-setuptools \
+    ${PYTHON_PN}-six \
+"
+
+RDEPENDS_${PN}_class-target += " \
+    ${PYTHON_PN}-cffi \
+    ${PYTHON_PN}-idna \
     ${PYTHON_PN}-numbers \
     ${PYTHON_PN}-pyasn1 \
     ${PYTHON_PN}-pycparser \
+    ${PYTHON_PN}-subprocess \
     ${PYTHON_PN}-setuptools \
     ${PYTHON_PN}-six \
-    ${PYTHON_PN}-subprocess \
     ${PYTHON_PN}-threading \
 "
 
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography_1.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography_1.4.bb
deleted file mode 100644
index b05c615..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography_1.4.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-inherit pypi setuptools
-require python-cryptography.inc
-
-SRC_URI += " \
-    file://run-ptest \
-"
-
-DEPENDS += " \
-    ${PYTHON_PN}-enum34 \
-"
-
-RDEPENDS_${PN} += " \
-    ${PYTHON_PN}-contextlib \
-    ${PYTHON_PN}-enum34 \
-    ${PYTHON_PN}-ipaddress \
-"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography_1.7.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography_1.7.2.bb
new file mode 100644
index 0000000..f5b1e0b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cryptography_1.7.2.bb
@@ -0,0 +1,21 @@
+inherit pypi setuptools
+require python-cryptography.inc
+
+SRC_URI += " \
+    file://run-ptest \
+"
+
+DEPENDS += " \
+    ${PYTHON_PN}-enum34 \
+"
+
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-enum34 \
+    ${PYTHON_PN}-ipaddress \
+"
+
+RDEPENDS_${PN}_class-target += " \
+    ${PYTHON_PN}-enum34 \
+    ${PYTHON_PN}-ipaddress \
+    ${PYTHON_PN}-contextlib \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cython.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cython.inc
index de8a1a9..1ecdcc9 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cython.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cython.inc
@@ -7,14 +7,13 @@
 PYPI_PACKAGE = "Cython"
 BBCLASSEXTEND = "native"
 
-SRC_URI[md5sum] = "890b494a12951f1d6228c416a5789554"
-SRC_URI[sha256sum] = "84808fda00508757928e1feadcf41c9f78e9a9b7167b6649ab0933b76f75e7b9"
+SRC_URI[md5sum] = "642c81285e1bb833b14ab3f439964086"
+SRC_URI[sha256sum] = "f141d1f9c27a07b5a93f7dc5339472067e2d7140d1c5a9e20112a5665ca60306"
 
 inherit pypi
 
-RDEPENDS_${PN} += "\
+RDEPENDS_${PN}_class-target += "\
     ${PYTHON_PN}-netserver \
     ${PYTHON_PN}-subprocess \
     ${PYTHON_PN}-shell \
 "
-RDEPENDS_${PN}_class-native = ""
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cython_0.24.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cython_0.24.1.bb
deleted file mode 100644
index 6be0b1e..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cython_0.24.1.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-inherit setuptools
-require python-cython.inc
-
-RDEPENDS_${PN} += "\
-    python-distribute \
-"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cython_0.25.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cython_0.25.2.bb
new file mode 100644
index 0000000..bdf9490
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-cython_0.25.2.bb
@@ -0,0 +1,9 @@
+inherit setuptools
+require python-cython.inc
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/Cython/"
+UPSTREAM_CHECK_REGEX = "/Cython/(?P<pver>(\d+[\.\-_]*)+)"
+
+RDEPENDS_${PN} += "\
+    python-distribute \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dateutil.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dateutil.inc
index 5c9355e..d0ebc70 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dateutil.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dateutil.inc
@@ -4,8 +4,8 @@
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=51430b33c900f45f999c459ee29ca493"
 
-SRC_URI[md5sum] = "05ffc6d2cc85a7fd93bb245807f715ef"
-SRC_URI[sha256sum] = "1408fdb07c6a1fa9997567ce3fcee6a337b39a503d80699e0f213de4aa4b32ed"
+SRC_URI[md5sum] = "6e38f91e8c94c15a79ce22768dfeca87"
+SRC_URI[sha256sum] = "62a2f8df3d66f878373fd0072eacf4ee52194ba302e00082828e0d263b0418d2"
 
 PYPI_PACKAGE = "python-dateutil"
 inherit pypi
@@ -13,7 +13,7 @@
 PACKAGES =+ "${PN}-zoneinfo"
 FILES_${PN}-zoneinfo = "${libdir}/${PYTHON_DIR}/site-packages/dateutil/zoneinfo"
 
-RDEPENDS_${PN} = "\
+RDEPENDS_${PN}_class-target = "\
     ${PYTHON_PN}-core \
     ${PYTHON_PN}-datetime \
     ${PYTHON_PN}-six \
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dateutil_2.5.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dateutil_2.6.0.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dateutil_2.5.3.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dateutil_2.6.0.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-decorator.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-decorator.inc
index 9264cef..aeae231 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-decorator.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-decorator.inc
@@ -7,10 +7,10 @@
 decorator, just because you can."
 
 LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=41e24e0e235a97e60cdb5c4137fa2cd0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=893f896413826096ce5270c700a498fd"
 
-SRC_URI[md5sum] = "434b57fdc3230c500716c5aff8896100"
-SRC_URI[sha256sum] = "9c6e98edcb33499881b86ede07d9968c81ab7c769e28e9af24075f0a5379f070"
+SRC_URI[md5sum] = "73644c8f0bd4983d1b6a34b49adec0ae"
+SRC_URI[sha256sum] = "953d6bf082b100f43229cf547f4f97f97e970f5ad645ee7601d55ff87afdfe76"
 
 inherit pypi
 
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-decorator_4.0.10.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-decorator_4.0.11.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-decorator_4.0.10.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-decorator_4.0.11.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-django_1.10.5.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-django_1.10.5.bb
new file mode 100644
index 0000000..11242df
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-django_1.10.5.bb
@@ -0,0 +1,24 @@
+SUMMARY = "A high-level Python Web framework"
+HOMEPAGE = "http://www.djangoproject.com/"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f09eb47206614a4954c51db8a94840fa"
+
+SRC_URI[md5sum] = "3fce02f1e6461fec21f1f15ea7489924"
+SRC_URI[sha256sum] = "0db89374b691b9c8b057632a6cd64b18d08db2f4d63b4d4af6024267ab965f8b"
+
+PYPI_PACKAGE = "Django"
+inherit pypi setuptools
+
+FILES_${PN} += "${datadir}/django"
+
+BBCLASSEXTEND = "nativesdk"
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-importlib \
+    ${PYTHON_PN}-numbers \
+    ${PYTHON_PN}-pip \
+    ${PYTHON_PN}-pkgutil \
+    ${PYTHON_PN}-subprocess \
+    ${PYTHON_PN}-threading \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-django_1.9.7.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-django_1.9.7.bb
deleted file mode 100644
index 8693da8..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-django_1.9.7.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-SUMMARY = "A high-level Python Web framework"
-HOMEPAGE = "http://www.djangoproject.com/"
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=f09eb47206614a4954c51db8a94840fa"
-
-SRC_URI[md5sum] = "7de9ba83bfe01f4b7d45645c1b259c83"
-SRC_URI[sha256sum] = "2b29e81c8c32b3c0d9a0119217416887c480d927ae2630bada2da83078c93bf6"
-
-PYPI_PACKAGE = "Django"
-inherit pypi setuptools
-
-FILES_${PN} += "${datadir}/django"
-
-BBCLASSEXTEND = "nativesdk"
-
-RDEPENDS_${PN} += "\
-    ${PYTHON_PN}-datetime \
-    ${PYTHON_PN}-importlib \
-    ${PYTHON_PN}-numbers \
-    ${PYTHON_PN}-pip \
-    ${PYTHON_PN}-pkgutil \
-    ${PYTHON_PN}-subprocess \
-    ${PYTHON_PN}-threading \
-    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dnspython.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dnspython.inc
new file mode 100644
index 0000000..6a04429
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dnspython.inc
@@ -0,0 +1,20 @@
+DESCRIPTION = "DNS toolkit for Python"
+HOMEPAGE = "http://www.dnspython.org/"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b9d855ee0d7bea17c8b0994d37985e1e"
+
+SRC_URI[md5sum] = "05d33ffb5d8f35ae0474bb952778a344"
+SRC_URI[sha256sum] = "40f563e1f7a7b80dc5a4e76ad75c23da53d62f1e15e6e517293b04e1f84ead7c"
+
+PYPI_PACKAGE_EXT = "zip"
+
+inherit pypi
+
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-crypt \
+    ${PYTHON_PN}-io \
+    ${PYTHON_PN}-math \
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-numbers \
+    ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dnspython_1.15.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dnspython_1.15.0.bb
new file mode 100644
index 0000000..9dbcd0f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dnspython_1.15.0.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-dnspython.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dominate_2.2.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dominate_2.2.1.bb
deleted file mode 100644
index dc6e41c..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dominate_2.2.1.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API."
-LICENSE = "LGPLv3"
-LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=a30b9a8d0a5585c482c6c5a6d54aaebc"
-
-SRC_URI[md5sum] = "cd156b5b290f49f2bb5814ea8acc12a3"
-SRC_URI[sha256sum] = "4aa6a2f458461541f9ceeb58b49da9b42320f80aa2a6f692baea2817431d9953"
-
-PYPI_PACKAGE_EXT = "zip"
-
-inherit pypi setuptools
-
-RDEPENDS_${PN} += "\
-    ${PYTHON_PN}-numbers \
-    ${PYTHON_PN}-threading \
-    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dominate_2.3.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dominate_2.3.1.bb
new file mode 100644
index 0000000..13ebf92
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-dominate_2.3.1.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API."
+LICENSE = "LGPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b52f2d57d10c4f7ee67a7eb9615d5d24"
+
+SRC_URI[md5sum] = "45bd97e6f7888aac24ae86013c57638e"
+SRC_URI[sha256sum] = "4b8ce6f33633c9dd9175b228d21c00c801b6bd0327747cd5e17fc2da934c3a69"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-numbers \
+    ${PYTHON_PN}-threading \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-enum34_1.1.6.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-enum34_1.1.6.bb
index e9d075f..31d2147 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-enum34_1.1.6.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-enum34_1.1.6.bb
@@ -6,3 +6,5 @@
 SRC_URI[sha256sum] = "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"
 
 inherit pypi setuptools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-bootstrap_3.3.6.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-bootstrap_3.3.6.0.bb
deleted file mode 100644
index a115f23..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-bootstrap_3.3.6.0.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-DESCRIPTION = "An extension that includes Bootstrap in your project, without any boilerplate code."
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://PKG-INFO;md5=3452e378337a5cc2092d32a140178d5a"
-
-SRC_URI[md5sum] = "b8aedbe51f2bf511af955f2bc288cd8c"
-SRC_URI[sha256sum] = "3a7b71e22596a6d559965e059958960e0bb671adc131537a79edb491a8f31714"
-
-PYPI_PACKAGE = "Flask-Bootstrap"
-
-inherit pypi setuptools
-
-RDEPENDS_${PN} += "\
-    ${PYTHON_PN}-dominate \
-    ${PYTHON_PN}-flask \
-    ${PYTHON_PN}-visitor \
-    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-bootstrap_3.3.7.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-bootstrap_3.3.7.1.bb
new file mode 100644
index 0000000..2b2a6f9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-bootstrap_3.3.7.1.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "An extension that includes Bootstrap in your project, without any boilerplate code."
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;md5=a03749709f06118a17349deb5a210619"
+
+SRC_URI[md5sum] = "e40d50f5c5b6438c1c6200a6f2871f81"
+SRC_URI[sha256sum] = "cb08ed940183f6343a64e465e83b3a3f13c53e1baabb8d72b5da4545ef123ac8"
+
+PYPI_PACKAGE = "Flask-Bootstrap"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-dominate \
+    ${PYTHON_PN}-flask \
+    ${PYTHON_PN}-visitor \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-login.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-login.inc
index 6d4db48..7dddba0 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-login.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-login.inc
@@ -6,9 +6,9 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=8aa87a1cd9fa41d969ad32cfdac2c596"
 
-SRC_URI[md5sum] = "d95c2275d3e1c755145910077366dc45"
-SRC_URI[sha256sum] = "e72eff5c35e5a31db1aeca1db5d2501be702674ea88e8f223b5d2b11644beee6"
+SRC_URI[md5sum] = "e050efaa2c4dbc2d97f480a70f4d44aa"
+SRC_URI[sha256sum] = "d25e356b14a59f52da0ab30c31c2ad285fa23a840f0f6971df7ed247c77082a7"
 
 PYPI_PACKAGE = "Flask-Login"
 
-RDEPENDS_${PN} = "${PYTHON_PN}-flask"
+RDEPENDS_${PN}_class-target = "${PYTHON_PN}-flask"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-login_0.3.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-login_0.4.0.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-login_0.3.2.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-login_0.4.0.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-sqlalchemy_2.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-sqlalchemy_2.1.bb
deleted file mode 100644
index a258713..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-sqlalchemy_2.1.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-DESCRIPTION = "Adds SQLAlchemy support to your Flask application."
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=5ed1b8cc741515a835a7f6bf2f62ef4a"
-
-SRC_URI[md5sum] = "dc15fe08b07b434d3d2c4063b4674b72"
-SRC_URI[sha256sum] = "c5244de44cc85d2267115624d83faef3f9e8f088756788694f305a5d5ad137c5"
-
-PYPI_PACKAGE = "Flask-SQLAlchemy"
-
-inherit pypi setuptools
-
-RDEPENDS_${PN} = "python-sqlalchemy"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-sqlalchemy_2.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-sqlalchemy_2.2.bb
new file mode 100644
index 0000000..1190f34
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask-sqlalchemy_2.2.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "Adds SQLAlchemy support to your Flask application."
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5ed1b8cc741515a835a7f6bf2f62ef4a"
+
+SRC_URI[md5sum] = "a93e6af389afac6666733e369c06c798"
+SRC_URI[sha256sum] = "f0d8241efba723d7b878f73550f5d3c0fbb042416123b52b36640b7491fa208b"
+
+PYPI_PACKAGE = "Flask-SQLAlchemy"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} = "${PYTHON_PN}-sqlalchemy ${PYTHON_PN}-flask"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask.inc
index 87d020e..04935a6 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask.inc
@@ -6,8 +6,10 @@
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=19866b76b054ab30c270c0eb9d7e43d7"
 
-SRC_URI[md5sum] = "d2af95d8fe79cf7da099f062dd122a08"
-SRC_URI[sha256sum] = "b4713f2bfb9ebc2966b8a49903ae0d3984781d5c878591cf2f7b484d28756b0e"
+SRC_URI[md5sum] = "c1d30f51cff4a38f9454b23328a15c5a"
+SRC_URI[sha256sum] = "93e803cdbe326a61ebd5c5d353959397c85f829bec610d59cb635c9f97d7ca8b"
+
+CLEANBROKEN = "1"
 
 PYPI_PACKAGE = "Flask"
 
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask_0.11.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask_0.12.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask_0.11.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-flask_0.12.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-funcsigs_1.0.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-funcsigs_1.0.2.bb
new file mode 100644
index 0000000..dad15ee
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-funcsigs_1.0.2.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+"
+DESCRPTION = " \
+funcsigs is a backport of the `PEP 362`_ function signature features from \
+Python 3.3's `inspect`_ module. The backport is compatible with Python 2.6, \
+2.7 as well as 3.3 and up. 3.2 was supported by version 0.4, but with \
+setuptools and pip no longer supporting 3.2, we cannot make any statement \
+about 3.2 compatibility. \
+"
+
+HOMEPAGE = "http://funcsigs.readthedocs.org"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d6bc91dc8e5793892189fe7481a2d354"
+
+SRC_URI[md5sum] = "7e583285b1fb8a76305d6d68f4ccc14e"
+SRC_URI[sha256sum] = "a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50"
+
+inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gdata_1.2.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gdata_1.2.4.bb
deleted file mode 100644
index 2205584..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gdata_1.2.4.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-SUMMARY = "Google Data APIs Python Client Library"
-SECTION = "devel/python"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://README.txt;md5=473bd4dff0ddca1f958244b2dc7a162c"
-HOMEPAGE = "http://code.google.com/p/gdata-python-client/"
-
-inherit distutils
-
-SRC_URI = "http://gdata-python-client.googlecode.com/files/gdata.py-${PV}.tar.gz"
-SRC_URI[md5sum] = "521f33a377d64f8a6505ba119415b787"
-SRC_URI[sha256sum] = "fc5ddb8f76b17abd728721a0e0177ea35f55a70106f44dc9010b22eceb06abde"
-
-S = "${WORKDIR}/gdata.py-${PV}"
-
-FILES_${PN} += "${datadir}"
-
-RDEPENDS_${PN} = "python-xml"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gdata_2.0.18.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gdata_2.0.18.bb
new file mode 100644
index 0000000..897581f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gdata_2.0.18.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Google Data APIs Python Client Library"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://README.txt;md5=4c8f0e6846e52a7fe4943acf462d808d"
+HOMEPAGE = "http://code.google.com/p/gdata-python-client/"
+
+SRC_URI[md5sum] = "13b6e6dd8f9e3e9a8e005e05a8329408"
+SRC_URI[sha256sum] = "56e7d22de819c22b13ceb0fe1869729b4287f89ebbd4bb55380d7bcf61a1fdb6"
+
+S = "${WORKDIR}/gdata.py-${PV}"
+
+inherit pypi distutils
+
+FILES_${PN} += "${datadir}"
+
+RDEPENDS_${PN} = " \
+    ${PYTHON_PN}-distutils \
+    ${PYTHON_PN}-json \
+    ${PYTHON_PN}-netserver \
+    ${PYTHON_PN}-stringold \
+    ${PYTHON_PN}-xml \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gevent/libev-conf.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gevent/libev-conf.patch
new file mode 100644
index 0000000..79c1867
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gevent/libev-conf.patch
@@ -0,0 +1,26 @@
+From 2294734ef9d5e2efb05820e9759a1635799bdea9 Mon Sep 17 00:00:00 2001
+From: Andrej Rode <andrej.rode@ettus.com>
+Date: Mon, 10 Apr 2017 19:25:18 -0700
+Subject: [PATCH] libev: make configure crosscompile compatible
+
+Signed-off-by: Andrej Rode <andrej.rode@ettus.com>
+---
+ deps/libev/configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/deps/libev/configure b/deps/libev/configure
+index 743817e..96c2366 100755
+--- a/deps/libev/configure
++++ b/deps/libev/configure
+@@ -2208,7 +2208,7 @@ fi
+ ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_link='$CC -static -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ 
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gevent_0.13.8.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gevent_0.13.8.bb
deleted file mode 100644
index d1c0a3c..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gevent_0.13.8.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "A coroutine-based Python networking library"
-DESCRIPTION = "gevent is a coroutine-based Python networking library that uses greenlet to provide \
-a high-level synchronous API on top of the libevent event loop."
-HOMEPAGE = "http://www.gevent.org"
-LICENSE = "MIT & BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=2dbb33d00e1fd31c7041460a81ac0bd2 \
-                    file://LICENSE.pyevent;md5=718070c63de243053e2c616268b00fdd"
-DEPENDS += "python-greenlet libevent"
-RDEPENDS_${PN} += "python-greenlet python-mime python-pprint python-re"
-
-SRC_URI[md5sum] = "ca9dcaa7880762d8ebbc266b11252960"
-SRC_URI[sha256sum] = "54b8d26300ce408c0916a3e63ef6cd3e6aca76230833558deb7de15196ed955e"
-
-inherit pypi setuptools
-
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gevent_1.2.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gevent_1.2.1.bb
new file mode 100644
index 0000000..953f48f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-gevent_1.2.1.bb
@@ -0,0 +1,28 @@
+SUMMARY = "A coroutine-based Python networking library"
+DESCRIPTION = "gevent is a coroutine-based Python networking library that uses greenlet to provide \
+a high-level synchronous API on top of the libevent event loop."
+HOMEPAGE = "http://www.gevent.org"
+LICENSE = "MIT & Python-2.0 & BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2dbb33d00e1fd31c7041460a81ac0bd2 \
+                    file://NOTICE;md5=5966cd2c6582656d28ab3c33da3860f8 \
+                    file://deps/libev/LICENSE;md5=d6ad416afd040c90698edcdf1cbee347"
+DEPENDS += "python-greenlet libevent"
+RDEPENDS_${PN} += "python-greenlet python-mime python-pprint python-re"
+
+SRC_URI_append = " \
+    file://libev-conf.patch;patch=1;pnum=1 \
+"
+
+SRC_URI[md5sum] = "6700a2433c8e0635425e6798760efc81"
+SRC_URI[sha256sum] = "3de300d0e32c31311e426e4d5d73b36777ed99c2bac3f8fbad939eeb2c29fa7c"
+
+# The python-gevent has no autoreconf ability
+# and the logic for detecting a cross compile is flawed
+# so always force a cross compile
+do_configure_append() {
+	sed -i -e 's/^cross_compiling=no/cross_compiling=yes/' ${S}/deps/libev/configure
+	sed -i -e 's/^cross_compiling=no/cross_compiling=yes/' ${S}/deps/c-ares/configure
+}
+
+inherit pypi setuptools
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-greenlet/0001-Use-x-instead-of-r-for-aarch64-register-names.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-greenlet/0001-Use-x-instead-of-r-for-aarch64-register-names.patch
deleted file mode 100644
index 4868bf3..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-greenlet/0001-Use-x-instead-of-r-for-aarch64-register-names.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From b53fb3bf861f895034452e984f2accb8bebbd3c9 Mon Sep 17 00:00:00 2001
-From: Fredrik Fornwall <fredrik@fornwall.net>
-Date: Wed, 7 Sep 2016 09:25:54 +0200
-Subject: [PATCH] Use x instead of r for aarch64 register names
-
-This fixes clang compatibility.
----
-Upstream-Status: Backport
-
- platform/switch_aarch64_gcc.h | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/platform/switch_aarch64_gcc.h b/platform/switch_aarch64_gcc.h
-index 2fbc569..0b9d556 100644
---- a/platform/switch_aarch64_gcc.h
-+++ b/platform/switch_aarch64_gcc.h
-@@ -2,6 +2,7 @@
-  * this is the internal transfer function.
-  *
-  * HISTORY
-+ * 07-Sep-16 Add clang support using x register naming. Fredrik Fornwall
-  * 13-Apr-13 Add support for strange GCC caller-save decisions
-  * 08-Apr-13 File creation. Michael Matz
-  *
-@@ -15,8 +16,8 @@
- 
- #ifdef SLP_EVAL
- #define STACK_MAGIC 0
--#define REGS_TO_SAVE "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", \
--                     "r27", "r28", "r30" /* aka lr */, \
-+#define REGS_TO_SAVE "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26", \
-+                     "x27", "x28", "x30" /* aka lr */, \
-                      "v8", "v9", "v10", "v11", \
-                      "v12", "v13", "v14", "v15"
- 
--- 
-1.9.1
-
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-greenlet_0.4.12.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-greenlet_0.4.12.bb
new file mode 100644
index 0000000..4fc2c1d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-greenlet_0.4.12.bb
@@ -0,0 +1,10 @@
+SUMMARY = "Python lightweight in-process concurrent programming"
+LICENSE = "MIT & PSF"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=03143d7a1a9f5d8a0fee825f24ca9c36 \
+                    file://LICENSE.PSF;md5=c106931d9429eda0492617f037b8f69a"
+
+SRC_URI[md5sum] = "e8637647d58a26c4a1f51ca393e53c00"
+SRC_URI[sha256sum] = "e4c99c6010a5d153d481fdaf63b8a0782825c0721506d880403a3b9b82ae347e"
+
+inherit pypi distutils
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-greenlet_0.4.9.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-greenlet_0.4.9.bb
deleted file mode 100644
index 4c0faf5..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-greenlet_0.4.9.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "Python lightweight in-process concurrent programming"
-LICENSE = "MIT & PSF"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=03143d7a1a9f5d8a0fee825f24ca9c36 \
-                    file://LICENSE.PSF;md5=c106931d9429eda0492617f037b8f69a"
-
-SRC_URI += "\
-           file://0001-Use-x-instead-of-r-for-aarch64-register-names.patch \
-           "
-SRC_URI[md5sum] = "c6659cdb2a5e591723e629d2eef22e82"
-SRC_URI[sha256sum] = "58b2f3a2e7075c655616bf95e82868db4980f3bb6661db70ad02a51e4ddd2252"
-
-PYPI_PACKAGE_EXT = "zip"
-inherit pypi distutils
-
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-html5lib_0.9999999.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-html5lib_0.9999999.bb
deleted file mode 100644
index bb92e59..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-html5lib_0.9999999.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-SUMMARY = "HTML parser based on the WHATWG HTML specifcation"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1ba5ada9e6fead1fdc32f43c9f10ba7c"
-
-SRC_URI[md5sum] = "ef43cb05e9e799f25d65d1135838a96f"
-SRC_URI[sha256sum] = "2612a191a8d5842bfa057e41ba50bbb9dcb722419d2408c78cff4758d0754868"
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-html5lib_0.999999999.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-html5lib_0.999999999.bb
new file mode 100644
index 0000000..d0f7b56
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-html5lib_0.999999999.bb
@@ -0,0 +1,14 @@
+SUMMARY = "HTML parser based on the WHATWG HTML specifcation"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1ba5ada9e6fead1fdc32f43c9f10ba7c"
+
+SRC_URI[md5sum] = "8578e4e3a341436cb9743a9e4a299239"
+SRC_URI[sha256sum] = "ee747c0ffd3028d2722061936b5c65ee4fe13c8e4613519b4447123fc4546298"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-six \
+    ${PYTHON_PN}-webencodings \
+    ${PYTHON_PN}-xml \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-humanize.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-humanize.inc
new file mode 100644
index 0000000..d9fac09
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-humanize.inc
@@ -0,0 +1,10 @@
+SUMMARY = "Python humanize utilities"
+HOMEPAGE = "http://github.com/jmoiron/humanize"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=d2eff82fc25dd07c919a02465884f02e"
+
+SRC_URI[md5sum] = "e8473d9dc1b220911cac2edd53b1d973"
+SRC_URI[sha256sum] = "a43f57115831ac7c70de098e6ac46ac13be00d69abbf60bdcac251344785bb19"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-humanize_0.5.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-humanize_0.5.1.bb
new file mode 100644
index 0000000..5769309
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-humanize_0.5.1.bb
@@ -0,0 +1,2 @@
+inherit pypi setuptools
+require python-humanize.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-idna.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-idna.inc
index 8e1fcb4..d099c0f 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-idna.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-idna.inc
@@ -1,9 +1,13 @@
 SUMMARY = "Internationalised Domain Names in Applications"
 HOMEPAGE = "https://github.com/kjd/idna"
 LICENSE = "BSD-3-Clause & Python-2.0 & Unicode"
-LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=134bdad79491c37bdae32811572b4bc6"
+LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=c9ba5acd829579492fd5eb306c7a0565"
 
-SRC_URI[md5sum] = "f6473caa9c5e0cc1ad3fd5d04c3c114b"
-SRC_URI[sha256sum] = "ed36f281aebf3cd0797f163bb165d84c31507cedd15928b095b1675e2d04c676"
+SRC_URI[md5sum] = "fc1d992bef73e8824db411bb5d21f012"
+SRC_URI[sha256sum] = "3cb5ce08046c4e3a560fc02f138d0ac63e00f8ce5901a56b32ec8b7994082aab"
+
+RDEPENDS_${PN}_class-target = "\
+    ${PYTHON_PN}-codecs \
+"
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-idna_2.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-idna_2.5.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-idna_2.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-idna_2.5.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ipaddress_1.0.16.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ipaddress_1.0.16.bb
deleted file mode 100644
index 1e97ef7..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ipaddress_1.0.16.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-SUMMARY = "Python 3.3+'s ipaddress for Python 2.6, 2.7, 3.2."
-HOMEPAGE = "https://github.com/phihag/ipaddress"
-LICENSE = "Python-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=7f538584cc3407bf76042def7168548a"
-
-DEPENDS += "python-pip"
-
-SRC_URI[md5sum] = "1e27b62aa20f5b6fc200b2bdbf0d0847"
-SRC_URI[sha256sum] = "5a3182b322a706525c46282ca6f064d27a02cffbd449f9f47416f1dc96aa71b0"
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ipaddress_1.0.18.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ipaddress_1.0.18.bb
new file mode 100644
index 0000000..cc4f589
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ipaddress_1.0.18.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Python 3.3+'s ipaddress for Python 2.6, 2.7, 3.2."
+HOMEPAGE = "https://github.com/phihag/ipaddress"
+LICENSE = "Python-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7f538584cc3407bf76042def7168548a"
+
+DEPENDS += "python-pip"
+
+SRC_URI[md5sum] = "310c2dfd64eb6f0df44aa8c59f2334a7"
+SRC_URI[sha256sum] = "5d8534c8e185f2d8a1fda1ef73f2c8f4b23264e8e30063feeb9511d492a413e1"
+
+inherit pypi setuptools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-isort_4.2.5.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-isort_4.2.5.bb
new file mode 100644
index 0000000..e365dc6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-isort_4.2.5.bb
@@ -0,0 +1,11 @@
+SUMMARY = "A Python utility / library to sort Python imports."
+HOMEPAGE = "https://pypi.python.org/pypi/isort"
+LICENSE = "MIT"
+SECTION = "devel/python"
+LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=8227180126797a0148f94f483f3e1489"
+
+SRC_URI[md5sum] = "71489ebd936429d5bda2af7ae662ed78"
+SRC_URI[sha256sum] = "56b20044f43cf6e6783fe95d054e754acca52dd43fbe9277c1bdff835537ea5c"
+
+inherit setuptools pypi
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jinja2.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jinja2.inc
index c3ed6de..cf8010e 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jinja2.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jinja2.inc
@@ -4,11 +4,12 @@
 
 PYPI_PACKAGE = "Jinja2"
 
-SRC_URI[md5sum] = "edb51693fe22c53cee5403775c71a99e"
-SRC_URI[sha256sum] = "bc1ff2ff88dbfacefde4ddde471d1417d3b304e8df103a7a9437d47269201bf4"
+SRC_URI[md5sum] = "9e55f0db6620dd99a1b366183a94270d"
+SRC_URI[sha256sum] = "702a24d992f856fa8d5a7a36db6128198d0c21e1da34448ca236c42e92384825"
 
 RDEPENDS_${PN} += "${PYTHON_PN}-io ${PYTHON_PN}-pickle ${PYTHON_PN}-crypt \
     ${PYTHON_PN}-math ${PYTHON_PN}-netclient ${PYTHON_PN}-re ${PYTHON_PN}-textutils \
-    ${PYTHON_PN}-lang ${PYTHON_PN}-pprint ${PYTHON_PN}-shell ${PYTHON_PN}-markupsafe"
+    ${PYTHON_PN}-lang ${PYTHON_PN}-pprint ${PYTHON_PN}-shell ${PYTHON_PN}-markupsafe \
+    ${PYTHON_PN}-json ${PYTHON_PN}-threading ${PYTHON_PN}-numbers"
 
 CLEANBROKEN = "1"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jinja2_2.8.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jinja2_2.9.5.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jinja2_2.8.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jinja2_2.9.5.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonpatch_1.14.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonpatch_1.14.bb
deleted file mode 100644
index c845eda..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonpatch_1.14.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-SUMMARY  = "Appling JSON patches in Python 2.6+ and 3.x"
-HOMEPAGE = "https://github.com/stefankoegl/python-json-patch"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=32b15c843b7a329130f4e266a281ebb3"
-
-inherit pypi setuptools
-
-SRC_URI[md5sum] = "cf4fbad8188f1389363433dbf867109f"
-SRC_URI[sha256sum] = "776d828d6f7b4581862529cf413439a652d74b9e3a0261fa08c36fd761a78b4a"
-
-RDEPENDS_${PN} += "${PYTHON_PN}-json ${PYTHON_PN}-jsonpointer ${PYTHON_PN}-netclient ${PYTHON_PN}-re ${PYTHON_PN}-stringold"
-
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonpatch_1.15.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonpatch_1.15.bb
new file mode 100644
index 0000000..f214bf2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonpatch_1.15.bb
@@ -0,0 +1,12 @@
+SUMMARY  = "Appling JSON patches in Python 2.6+ and 3.x"
+HOMEPAGE = "https://github.com/stefankoegl/python-json-patch"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=32b15c843b7a329130f4e266a281ebb3"
+
+inherit pypi setuptools
+
+SRC_URI[md5sum] = "818d36e05d68ba90ca2b26597bd82975"
+SRC_URI[sha256sum] = "ae23cd08b2f7246f8f2475363501e740c4ef93f08f2a3b7b9bcfac0cc37fceb1"
+
+RDEPENDS_${PN} += "${PYTHON_PN}-json ${PYTHON_PN}-jsonpointer ${PYTHON_PN}-netclient ${PYTHON_PN}-re ${PYTHON_PN}-stringold"
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonschema.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonschema.inc
index 3466457..74933f5 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonschema.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonschema.inc
@@ -2,8 +2,8 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=7a60a81c146ec25599a3e1dabb8610a8"
 
-SRC_URI[md5sum] = "374e848fdb69a3ce8b7e778b47c30640"
-SRC_URI[sha256sum] = "36673ac378feed3daa5956276a829699056523d7961027911f064b52255ead41"
+SRC_URI[md5sum] = "50c6b69a373a8b55ff1e0ec6e78f13f4"
+SRC_URI[sha256sum] = "6ff5f3180870836cae40f06fa10419f557208175f13ad7bc26caa77beb1f6e02"
 
 RDEPENDS_${PN} += " \
     ${PYTHON_PN}-core \
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonschema_2.5.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonschema_2.6.0.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonschema_2.5.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-jsonschema_2.6.0.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lazy-object-proxy_1.2.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lazy-object-proxy_1.2.2.bb
new file mode 100644
index 0000000..ded9cfa
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lazy-object-proxy_1.2.2.bb
@@ -0,0 +1,10 @@
+SUMMARY = "A fast and thorough lazy object proxy"
+HOMEPAGE = "https://python-lazy-object-proxy.readthedocs.io/"
+LICENSE = "BSD"
+SECTION = "devel/python"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=96b1673d10167cb31b78e64f561c3286"
+
+SRC_URI[md5sum] = "841b5592bc12c6ef7e48ed1d7a5f9066"
+SRC_URI[sha256sum] = "ddd4cf1c74279c349cb7b9c54a2efa5105854f57de5f2d35829ee93631564268"
+
+inherit setuptools pypi
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap/setup.cfg.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap/setup.cfg.patch
deleted file mode 100644
index a703d34..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap/setup.cfg.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- python-ldap-2.3.9/setup.cfg.orig    2009-08-13 11:07:23.000000000 +0200
-+++ python-ldap-2.3.9/setup.cfg 2009-08-13 11:07:37.000000000 +0200
-@@ -1,9 +1,9 @@
- [_ldap]
- extra_objects = 
- extra_compile_args = 
--libs = ldap_r lber sasl2 ssl crypto
-+libs = ldap_r lber ssl crypto
- library_dirs = /opt/openldap-RE24/lib
--include_dirs = /opt/openldap-RE24/include /usr/include/sasl
-+include_dirs = /opt/openldap-RE24/include
-
- [egg_info]
- tag_build =  
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap_2.3.9.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap_2.3.9.bb
deleted file mode 100644
index 5a1a93f..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap_2.3.9.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-SUMMARY = "LDAP client API for Python, C wrapper module around OpenLDAP 2.x with an object-oriented API"
-LICENSE = "Python-style"
-LIC_FILES_CHKSUM = "file://LICENCE;md5=a41c82edffa04912007cae1d20cac555"
-HOMEPAGE = "http://www.python-ldap.org/"
-DEPENDS = "python openldap"
-
-SRC_URI = "file://setup.cfg.patch"
-SRC_URI[md5sum] = "a9f9f16338288d118a1ae6266c993247"
-SRC_URI[sha256sum] = "62f75b21c5ee744408c9d8b59878328b3bdf47899d30e8abf0c09b3ffb893ed4"
-
-PYPI_PACKAGE = "python-ldap"
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap_2.4.10.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap_2.4.10.bb
deleted file mode 100644
index 5b3b8bd..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap_2.4.10.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Copyright (C) 2012 Wind River Systems, Inc.
-#
-SUMMARY = "Provides a wrapper in Python to LDAP"
-DESCRIPTION = "This module provides access to the LDAP \
-(Lightweight Directory Access Protocol) through Python operations \
-instead of C API. The module mainly acts as a wrapper for the \
-OpenLDAP 2.x libraries. Errors will appear as exceptions."
-
-LICENSE = "PSF"
-HOMEPAGE = "http://www.python-ldap.org/"
-DEPENDS = "python openldap cyrus-sasl"
-
-PYPI_PACKAGE = "python-ldap"
-inherit pypi setuptools
-
-LIC_FILES_CHKSUM = "file://LICENCE;md5=a41c82edffa04912007cae1d20cac555"
-SRC_URI[md5sum] = "a15827ca13c90e9101e5e9405c1d83be"
-SRC_URI[sha256sum] = "67cc7801bf24c29386ab99966ceb68d6a60fa9e0566cc95a4fbb2c4695a8ce54"
-
-do_configure_prepend() {
-    sed -i -e 's:^library_dirs =.*::' setup.cfg
-    sed -i -e 's:^include_dirs =.*:include_dirs = =/usr/include/sasl/:' setup.cfg
-}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap_2.4.32.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap_2.4.32.bb
new file mode 100644
index 0000000..f25ad1e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ldap_2.4.32.bb
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2012 Wind River Systems, Inc.
+#
+SUMMARY = "Provides a wrapper in Python to LDAP"
+DESCRIPTION = "This module provides access to the LDAP \
+(Lightweight Directory Access Protocol) through Python operations \
+instead of C API. The module mainly acts as a wrapper for the \
+OpenLDAP 2.x libraries. Errors will appear as exceptions."
+
+LICENSE = "PSF"
+HOMEPAGE = "http://www.python-ldap.org/"
+DEPENDS = "python openldap cyrus-sasl"
+
+PYPI_PACKAGE = "python-ldap"
+inherit pypi setuptools
+
+LIC_FILES_CHKSUM = "file://LICENCE;md5=a41c82edffa04912007cae1d20cac555"
+SRC_URI[md5sum] = "7c46c8a04acc227a778c7900c87cdfc7"
+SRC_URI[sha256sum] = "5810f1b5a9ae9255df99fb9c2dcab7352fed325687efda56c0faae1a82c5e3cb"
+
+do_configure_prepend() {
+    sed -i -e 's:^library_dirs =.*::' setup.cfg
+    sed -i -e 's:^include_dirs =.*:include_dirs = =/usr/include/sasl/:' setup.cfg
+}
+
+RDEPENDS_${PN} = " \
+    ${PYTHON_PN}-pprint \
+    ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml.inc
index 7481b98..d5e6ae4 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml.inc
@@ -18,8 +18,8 @@
 
 DEPENDS += "libxml2 libxslt"
 
-SRC_URI[md5sum] = "6dd7314233029d9dab0156e7b1c7830b"
-SRC_URI[sha256sum] = "61d5d3e00b5821e6cda099b3b4ccfea4527bf7c595e0fb3a7a760490cedd6172"
+SRC_URI[md5sum] = "075692ce442e69bbd604d44e21c02753"
+SRC_URI[sha256sum] = "aa502d78a51ee7d127b4824ff96500f0181d3c7826e6ee7b800d068be79361c7"
 
 DISTUTILS_BUILD_ARGS += " \
                      --with-xslt-config='pkg-config libxslt' \
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml/0001-lxml.etree-Add-empty-variadic-argument.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml/0001-lxml.etree-Add-empty-variadic-argument.patch
new file mode 100644
index 0000000..efaecd6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml/0001-lxml.etree-Add-empty-variadic-argument.patch
@@ -0,0 +1,40 @@
+From f8d2c3394767025b3b27b71248b3ecb50480cde7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Apr 2017 17:10:45 -0700
+Subject: [PATCH] lxml.etree: Add empty variadic argument
+
+format checker says that argument 4 is a printf formatted argument
+but there is no more arguments to follow
+
+Fixes libxslt format warnings
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/lxml/lxml.etree.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/lxml/lxml.etree.c b/src/lxml/lxml.etree.c
+index d482091..faab06c 100644
+--- a/src/lxml/lxml.etree.c
++++ b/src/lxml/lxml.etree.c
+@@ -186086,7 +186086,7 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
+  *         except:
+  */
+             __pyx_t_26 = __Pyx_PyObject_AsString(__pyx_v_message); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(19, 228, __pyx_L18_except_error)
+-            xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, __pyx_t_26);
++            xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, __pyx_t_26, "");
+ 
+             /* "src/lxml/xsltext.pxi":229
+  *                 c_inst_node.name, _cstr(e))
+@@ -186136,7 +186136,7 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
+  *     except:
+  */
+             __pyx_t_26 = __Pyx_PyObject_AsString(__pyx_v_message); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(19, 234, __pyx_L18_except_error)
+-            xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, __pyx_t_26);
++            xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, __pyx_t_26, "");
+ 
+             /* "src/lxml/xsltext.pxi":235
+  *                 "Error executing extension element '%s'", c_inst_node.name)
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml_3.6.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml_3.6.4.bb
deleted file mode 100644
index 81ccb12..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml_3.6.4.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit setuptools
-require python-lxml.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml_3.7.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml_3.7.3.bb
new file mode 100644
index 0000000..5c93a3f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-lxml_3.7.3.bb
@@ -0,0 +1,6 @@
+inherit setuptools
+require python-lxml.inc
+
+SRC_URI = "${PYPI_SRC_URI} \
+           file://0001-lxml.etree-Add-empty-variadic-argument.patch \
+           "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-m2crypto/0001-M2Crypto-Error-fix.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-m2crypto/0001-M2Crypto-Error-fix.patch
deleted file mode 100644
index 2a74b68..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-m2crypto/0001-M2Crypto-Error-fix.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-From 02a24ac541df68033d4efd7e2f8a1b92dc49328d Mon Sep 17 00:00:00 2001
-From: Li xin <lixin.fnst@cn.fujitsu.com>
-Date: Mon, 27 Jul 2015 05:06:20 +0900
-Subject: [PATCH] M2Crypto: Error fix.
-
-After swig upgrade from 3.0.2 to 3.0.6,build the recipes which
-depends on python-m2crypto will occur errors like this:
-SALT_LEN = m2.PKCS5_SALT_LEN
-AttributeError: 'module' object has no attribute 'PKCS5_SALT_LEN'
-since python-m2crypto depends on swig-native
-
-Ref:
-https://github.com/martinpaljak/M2Crypto/issues/60#issuecomment-75735489
-
-This patch is from:
-http://pkgs.fedoraproject.org/cgit/m2crypto.git/tree/m2crypto-0.21.1-swig-3.0.5.patch
-
-Upstream-Status: pending
-
-Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
----
- M2Crypto/__init__.py |  4 ++--
- M2Crypto/m2.py       |  2 +-
- SWIG/_lib.i          |  4 ++++
- SWIG/_pkcs7.i        |  1 +
- setup.py             | 26 +++++++++++++++++++++++++-
- 5 files changed, 33 insertions(+), 4 deletions(-)
-
-diff --git a/M2Crypto/__init__.py b/M2Crypto/__init__.py
-index e7acfe7..02f4d28 100644
---- a/M2Crypto/__init__.py
-+++ b/M2Crypto/__init__.py
-@@ -19,7 +19,7 @@ Copyright 2008-2011 Heikki Toivonen. All rights reserved.
- version_info = (0, 21, 1)
- version = '.'.join([str(_v) for _v in version_info])
- 
--import __m2crypto
-+import _m2crypto
- import m2
- import ASN1
- import AuthCookie
-@@ -57,4 +57,4 @@ import util
- encrypt=1
- decrypt=0
- 
--__m2crypto.lib_init()
-+_m2crypto.lib_init()
-diff --git a/M2Crypto/m2.py b/M2Crypto/m2.py
-index e4bb695..822143f 100644
---- a/M2Crypto/m2.py
-+++ b/M2Crypto/m2.py
-@@ -25,7 +25,7 @@ Portions created by Open Source Applications Foundation (OSAF) are
- Copyright (C) 2004 OSAF. All Rights Reserved.
- """
- 
--from __m2crypto import *
-+from _m2crypto import *
- lib_init()
- 
- 
-diff --git a/SWIG/_lib.i b/SWIG/_lib.i
-index 42dc180..47a53b8 100644
---- a/SWIG/_lib.i
-+++ b/SWIG/_lib.i
-@@ -100,6 +100,7 @@ int ssl_verify_callback(int ok, X509_STORE_CTX *ctx) {
-     int cret;
-     int new_style_callback = 0, warning_raised_exception=0;
-     PyGILState_STATE gilstate;
-+    PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
- 
-     ssl = (SSL *)X509_STORE_CTX_get_app_data(ctx);
- 
-@@ -185,6 +186,7 @@ int ssl_verify_callback(int ok, X509_STORE_CTX *ctx) {
- void ssl_info_callback(const SSL *s, int where, int ret) {
-     PyObject *argv, *retval, *_SSL;
-     PyGILState_STATE gilstate;
-+    PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
- 
-     gilstate = PyGILState_Ensure();
- 
-@@ -204,6 +206,7 @@ DH *ssl_set_tmp_dh_callback(SSL *ssl, int is_export, int keylength) {
-     PyObject *argv, *ret, *_ssl;
-     DH *dh;
-     PyGILState_STATE gilstate;
-+    PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
- 
-     gilstate = PyGILState_Ensure();
- 
-@@ -227,6 +230,7 @@ RSA *ssl_set_tmp_rsa_callback(SSL *ssl, int is_export, int keylength) {
-     PyObject *argv, *ret, *_ssl;
-     RSA *rsa;
-     PyGILState_STATE gilstate;
-+    PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
- 
-     gilstate = PyGILState_Ensure();
- 
-diff --git a/SWIG/_pkcs7.i b/SWIG/_pkcs7.i
-index 174f40a..7bffbfc 100644
---- a/SWIG/_pkcs7.i
-+++ b/SWIG/_pkcs7.i
-@@ -157,6 +157,7 @@ PyObject *smime_read_pkcs7(BIO *bio) {
-     BIO *bcont = NULL;
-     PKCS7 *p7;
-     PyObject *tuple, *_p7, *_BIO;
-+    PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
- 
-     if (BIO_method_type(bio) == BIO_TYPE_MEM) {
-         /* OpenSSL FAQ explains that this is needed for mem BIO to return EOF,
-diff --git a/setup.py b/setup.py
-index e7c49eb..b98abe0 100644
---- a/setup.py
-+++ b/setup.py
-@@ -20,6 +20,7 @@ except ImportError:
-     from distutils.command import build_ext
- 
- from distutils.core import Extension
-+from distutils.file_util import copy_file
- 
- 
- class _M2CryptoBuildExt(build_ext.build_ext):
-@@ -57,7 +58,17 @@ class _M2CryptoBuildExt(build_ext.build_ext):
-         self.swig_opts.append('-includeall')
-         #self.swig_opts.append('-D__i386__') # Uncomment for early OpenSSL 0.9.7 versions, or on Fedora Core if build fails
-         #self.swig_opts.append('-DOPENSSL_NO_EC') # Try uncommenting if you can't build with EC disabled
--        
-+        self.swig_opts.append('-modern')
-+        self.swig_opts.append('-builtin')
-+
-+        # These two lines are a workaround for
-+        # http://bugs.python.org/issue2624 , hard-coding that we are only
-+        # building a single extension with a known path; a proper patch to
-+        # distutils would be in the run phase, when extension name and path are
-+        # known.
-+        self.swig_opts.append('-outdir')
-+        self.swig_opts.append(os.path.join(self.build_lib, 'M2Crypto'))
-+
-         self.include_dirs += [os.path.join(self.openssl, opensslIncludeDir),
-                               os.path.join(os.getcwd(), 'SWIG')]        
-             
-@@ -71,6 +82,19 @@ class _M2CryptoBuildExt(build_ext.build_ext):
-                
-         self.library_dirs += [os.path.join(self.openssl, opensslLibraryDir)]
- 
-+    def run(self):
-+        '''Overloaded build_ext implementation to allow inplace=1 to work,
-+        which is needed for (python setup.py test).'''
-+        # This is another workaround for http://bugs.python.org/issue2624 + the
-+        # corresponding lack of support in setuptools' test command. Note that
-+        # just using self.inplace in finalize_options() above does not work
-+        # because swig is not rerun if the __m2crypto.so extension exists.
-+        # Again, hard-coding our extension name and location.
-+        build_ext.build_ext.run(self)
-+        if self.inplace:
-+            copy_file(os.path.join(self.build_lib, 'M2Crypto', '_m2crypto.py'),
-+                      os.path.join('M2Crypto', '_m2crypto.py'),
-+                      verbose=self.verbose, dry_run=self.dry_run)
- 
- if sys.version_info < (2,4):
- 
--- 
-1.8.4.2
-
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-m2crypto_0.23.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-m2crypto_0.23.0.bb
deleted file mode 100644
index ab665d4..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-m2crypto_0.23.0.bb
+++ /dev/null
@@ -1,48 +0,0 @@
-SUMMARY = "A Python crypto and SSL toolkit"
-HOMEPAGE = "http://chandlerproject.org/bin/view/Projects/MeTooCrypto"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://PKG-INFO;md5=68f7880de949412b2ea248932d97ed54"
-
-SRC_URI[md5sum] = "89557730e245294a6cab06de8ad4fb42"
-SRC_URI[sha256sum] = "1ac3b6eafa5ff7e2a0796675316d7569b28aada45a7ab74042ad089d15a9567f"
-
-SRC_URI += "file://0001-setup.py-link-in-sysroot-not-in-host-directories.patch "
-
-PYPI_PACKAGE = "M2Crypto"
-inherit pypi setuptools siteinfo
-
-DEPENDS += "openssl swig-native"
-
-DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_DIR_HOST} -I${STAGING_INCDIR}"
-DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_DIR_HOST}"
-
-inherit setuptools
-
-SWIG_FEATURES_x86-64 = "-D__x86_64__"
-SWIG_FEATURES ?= ""
-export SWIG_FEATURES
-
-# Get around a problem with swig, but only if the
-# multilib header file exists.
-#
-do_compile_prepend() {
-    if [ "${SITEINFO_BITS}" = "64" ];then
-        bit="64"
-    else
-        bit="32"
-    fi
-
-    if [ -e ${STAGING_INCDIR}/openssl/opensslconf-${bit}.h ] ;then
-        for i in SWIG/_ec.i SWIG/_evp.i; do
-            sed -i -e "s/opensslconf.*\./opensslconf-${bit}\./" "$i"
-        done
-    elif [ -e ${STAGING_INCDIR}/openssl/opensslconf-n${bit}.h ] ;then
-        for i in SWIG/_ec.i SWIG/_evp.i; do
-            sed -i -e "s/opensslconf.*\./opensslconf-n${bit}\./" "$i"
-        done
-    fi
-}
-
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-m2crypto_0.25.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-m2crypto_0.25.1.bb
new file mode 100644
index 0000000..72523bd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-m2crypto_0.25.1.bb
@@ -0,0 +1,49 @@
+SUMMARY = "A Python crypto and SSL toolkit"
+HOMEPAGE = "http://chandlerproject.org/bin/view/Projects/MeTooCrypto"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;md5=95295693f047bb8f76928251a6154a60"
+
+SRC_URI[md5sum] = "040234289fbef5bed4029f0f7d1dae35"
+SRC_URI[sha256sum] = "ac303a1881307a51c85ee8b1d87844d9866ee823b4fdbc52f7e79187c2d9acef"
+
+SRC_URI += "file://0001-setup.py-link-in-sysroot-not-in-host-directories.patch "
+
+PYPI_PACKAGE = "M2Crypto"
+inherit pypi setuptools siteinfo
+
+DEPENDS += "openssl swig-native"
+RDEPENDS_${PN} += "python-typing"
+
+DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_DIR_HOST} -I${STAGING_INCDIR}"
+DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_DIR_HOST}"
+
+inherit setuptools
+
+SWIG_FEATURES_x86-64 = "-D__x86_64__"
+SWIG_FEATURES ?= ""
+export SWIG_FEATURES
+
+# Get around a problem with swig, but only if the
+# multilib header file exists.
+#
+do_compile_prepend() {
+    if [ "${SITEINFO_BITS}" = "64" ];then
+        bit="64"
+    else
+        bit="32"
+    fi
+
+    if [ -e ${STAGING_INCDIR}/openssl/opensslconf-${bit}.h ] ;then
+        for i in SWIG/_ec.i SWIG/_evp.i; do
+            sed -i -e "s/opensslconf.*\./opensslconf-${bit}\./" "$i"
+        done
+    elif [ -e ${STAGING_INCDIR}/openssl/opensslconf-n${bit}.h ] ;then
+        for i in SWIG/_ec.i SWIG/_evp.i; do
+            sed -i -e "s/opensslconf.*\./opensslconf-n${bit}\./" "$i"
+        done
+    fi
+}
+
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-mock_2.0.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-mock_2.0.0.bb
index b4557b7..840c36e 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-mock_2.0.0.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-mock_2.0.0.bb
@@ -16,4 +16,7 @@
     python-pyparsing \
     python-mccabe \
     python-pep8 \
-    python-pyflakes"
+    python-pyflakes \
+    python-pbr \
+    python-funcsigs \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-msgpack_0.4.7.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-msgpack_0.4.7.bb
deleted file mode 100644
index a3f73fb..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-msgpack_0.4.7.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-SUMMARY = "MessagePack (de)serializer"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=cd9523181d9d4fbf7ffca52eaa2a5751"
-
-SRC_URI[md5sum] = "eb2aad1081534ef3a9f32a0ecd350b9b"
-SRC_URI[sha256sum] = "5e001229a54180a02dcdd59db23c9978351af55b1290c27bc549e381f43acd6b"
-
-PYPI_PACKAGE = "msgpack-python"
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-msgpack_0.4.8.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-msgpack_0.4.8.bb
new file mode 100644
index 0000000..8a0ad8f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-msgpack_0.4.8.bb
@@ -0,0 +1,9 @@
+SUMMARY = "MessagePack (de)serializer"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cd9523181d9d4fbf7ffca52eaa2a5751"
+
+SRC_URI[md5sum] = "dcd854fb41ee7584ebbf35e049e6be98"
+SRC_URI[sha256sum] = "1a2b19df0f03519ec7f19f826afb935b202d8979b0856c6fb3dc28955799f886"
+
+PYPI_PACKAGE = "msgpack-python"
+inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ndg-httpsclient.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ndg-httpsclient.inc
index ae2bca1..3c6253f 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ndg-httpsclient.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ndg-httpsclient.inc
@@ -8,12 +8,11 @@
 
 PYPI_PACKAGE = "ndg_httpsclient"
 
-DEPENDS = " \
+DEPENDS += " \
     ${PYTHON_PN}-pyopenssl \
-"
-
-DEPENDS = " \
     ${PYTHON_PN}-pyasn1 \
 "
 
 BBCLASSEXTEND = "native nativesdk"
+
+UPSTREAM_CHECK_REGEX = ""
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ndg-httpsclient_0.4.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ndg-httpsclient_0.4.2.bb
index 2da1112..ca0eb32 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ndg-httpsclient_0.4.2.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ndg-httpsclient_0.4.2.bb
@@ -1,2 +1,2 @@
-inherit pypi setuptools
 require python-ndg-httpsclient.inc
+inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-netaddr_0.7.18.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-netaddr_0.7.18.bb
deleted file mode 100644
index 6fdbf19..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-netaddr_0.7.18.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-SUMMARY = "A network address manipulation library for Python."
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=b277425f87f3b06d25af45d8b96f9682"
-
-SRC_URI[md5sum] = "c65bb34f8bedfbbca0b316c490cd13a0"
-SRC_URI[sha256sum] = "a1f5c9fcf75ac2579b9995c843dade33009543c04f218ff7c007b3c81695bd19"
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-netaddr_0.7.19.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-netaddr_0.7.19.bb
new file mode 100644
index 0000000..5b03735
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-netaddr_0.7.19.bb
@@ -0,0 +1,8 @@
+SUMMARY = "A network address manipulation library for Python."
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e6345d695ffe3776f68a56fe7962db44"
+
+SRC_URI[md5sum] = "51019ef59c93f3979bcb37d3b8527e07"
+SRC_URI[sha256sum] = "38aeec7cdd035081d3a4c306394b19d677623bf76fa0913f6695127c7753aefd"
+
+inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-networkx_1.11.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-networkx_1.11.bb
new file mode 100644
index 0000000..28a7baa
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-networkx_1.11.bb
@@ -0,0 +1,8 @@
+DESCRIPTION = "Python package for creating and manipulating graphs and networks"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=925586ea588eb990de840dc71ea3752f"
+
+SRC_URI[md5sum] = "6ef584a879e9163013e9a762e1cf7cd1"
+SRC_URI[sha256sum] = "0d0e70e10dfb47601cbb3425a00e03e2a2e97477be6f80638fef91d54dd1e4b8"
+
+inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-numeric/0001-it-tries-to-define-this-function-differently-than-it.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-numeric/0001-it-tries-to-define-this-function-differently-than-it.patch
new file mode 100644
index 0000000..81ed744
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-numeric/0001-it-tries-to-define-this-function-differently-than-it.patch
@@ -0,0 +1,30 @@
+From 322e781c67d7a78fc2cfc3d377f50b825fc64abb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Jun 2017 20:21:01 -0700
+Subject: [PATCH] it tries to define this function differently than it is
+ defined in sys/time.h.
+
+Use the definition from system
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Packages/RNG/Src/ranf.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/Packages/RNG/Src/ranf.c b/Packages/RNG/Src/ranf.c
+index 5ca7dc5..e669fa8 100644
+--- a/Packages/RNG/Src/ranf.c
++++ b/Packages/RNG/Src/ranf.c
+@@ -149,9 +149,6 @@ void Mixranf(int *s,u32 s48[2])
+ #else
+ 	struct timeval tv;
+ 	struct timezone tz;
+-#if !defined(__sgi)
+-	int gettimeofday(struct timeval *, struct timezone *);
+-#endif
+ 
+ 	(void)gettimeofday(&tv,&tz);
+ 	s48[0] = (u32)tv.tv_sec;
+-- 
+2.13.0
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-numeric/no-lapack.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-numeric/no-lapack.patch
deleted file mode 100644
index c1916b8..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-numeric/no-lapack.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-
-#
-# Patch managed by http://www.holgerschurig.de/patcher.html
-#
-
---- Numeric-23.7/setup.py~nolapack
-+++ Numeric-23.7/setup.py
-@@ -32,7 +32,7 @@
-     mathlibs = []
- 
- # delete all but the first one in this list if using your own LAPACK/BLAS
--sourcelist = [os.path.join('Src', 'lapack_litemodule.c'),
-+sourcelist = [
-               #os.path.join('Src', 'blas_lite.c'), 
-               #os.path.join('Src', 'f2c_lite.c'), 
-               #os.path.join('Src', 'zlapack_lite.c'),
-@@ -40,12 +40,12 @@
-              ]
- # set these to use your own BLAS;
- 
--library_dirs_list = ['/usr/lib/atlas']
--libraries_list = ['lapack', 'cblas', 'f77blas', 'atlas', 'g2c'] 
-+library_dirs_list = []
-+libraries_list = [] 
- 
- # set to true (1), if you also want BLAS optimized matrixmultiply/dot/innerproduct
--use_dotblas = 1 
--include_dirs = ['/usr/include/atlas']  
-+use_dotblas = 0
-+include_dirs = []  
-                    # You may need to set this to find cblas.h
-                    #  e.g. on UNIX using ATLAS this should be ['/usr/include/atlas']
- extra_link_args = []
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-numeric_24.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-numeric_24.2.bb
index c0b04e1..c91d77c 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-numeric_24.2.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-numeric_24.2.bb
@@ -5,7 +5,9 @@
 
 PR = "ml3"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/Numeric-${PV}.tar.gz"
+SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/Numeric-${PV}.tar.gz \
+           file://0001-it-tries-to-define-this-function-differently-than-it.patch \
+"
 S = "${WORKDIR}/Numeric-${PV}"
 
 inherit distutils
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-paho-mqtt.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-paho-mqtt.inc
new file mode 100644
index 0000000..7ff3fb2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-paho-mqtt.inc
@@ -0,0 +1,14 @@
+SUMMARY = "MQTT version 3.1/3.1.1 client library"
+LICENSE = "EPL-1.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=eb48c6ee2cb9f5b8b9fe75e6f817bdfc"
+SRCNAME = "paho-mqtt"
+
+inherit pypi
+SRC_URI[md5sum] = "241150b3fcb920ddca4d33181f3238b1"
+SRC_URI[sha256sum] = "9100a6aa706ab699d414ec02705a21eb66f436184691d0bf1f2a85a6213c6c1f"
+
+RDEPENDS_${PN} = "\
+               ${PYTHON_PN}-math \
+               ${PYTHON_PN}-io \
+               ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-paho-mqtt_1.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-paho-mqtt_1.1.bb
deleted file mode 100644
index b8f5f3f..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-paho-mqtt_1.1.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "MQTT version 3.1/3.1.1 client library"
-LICENSE = "EPL-1.0"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=eb48c6ee2cb9f5b8b9fe75e6f817bdfc"
-SRCNAME = "paho-mqtt"
-
-inherit pypi setuptools
-
-RDEPENDS_${PN} = "\
-               python-math \
-               python-io \
-               python-threading \
-"
-
-SRC_URI[md5sum] = "a6407b74eb5e5411e157be1de5c11366"
-SRC_URI[sha256sum] = "0f7a629efe6e3a2c61b59d3550aa9f2c4529b5689a65fde45e6f1ac36b9a261e"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-paho-mqtt_1.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-paho-mqtt_1.2.bb
new file mode 100644
index 0000000..f369b2e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-paho-mqtt_1.2.bb
@@ -0,0 +1,3 @@
+inherit setuptools
+require python-paho-mqtt.inc
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-parse_1.6.6.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-parse_1.6.6.bb
deleted file mode 100644
index 45b52a3..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-parse_1.6.6.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-SUMMARY = "Parse strings using a specification based on the Python format() syntax"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://parse.py;md5=e067ba2a08b73721dbe7356dc0282918;startline=1108;endline=1126"
-
-SRC_URI[md5sum] = "11bc8c60a30fe52db4ac9a827653d0ca"
-SRC_URI[sha256sum] = "71435aaac494e08cec76de646de2aab8392c114e56fe3f81c565ecc7eb886178"
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-parse_1.8.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-parse_1.8.0.bb
new file mode 100644
index 0000000..0fd905b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-parse_1.8.0.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Parse strings using a specification based on the Python format() syntax"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://parse.py;md5=083d8ef8f98a3035dbf890a808498fde;startline=1189;endline=1208"
+
+SRC_URI[md5sum] = "6ea7e32cb35810113137f6073fb30639"
+SRC_URI[sha256sum] = "8b4f28bbe7c0f24981669ea92b2ba704ee63b5346027e82be30118bb5788ff10"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-logging \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-passlib.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-passlib.inc
index 3cd2c0a..f289c0e 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-passlib.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-passlib.inc
@@ -7,7 +7,7 @@
 hashing for multi-user applications."
 HOMEPAGE = "https://bitbucket.org/ecollins/passlib"
 LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=bae8faa3e2689ee0df3f2127fc4517f5"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=73eed1a5470b969951dac411086c7036"
 
-SRC_URI[md5sum] = "d2edd6c42cde136a538b48d90a06ad67"
-SRC_URI[sha256sum] = "a83d34f53dc9b17aa42c9a35c3fbcc5120f3fcb07f7f8721ec45e6a27be347fc"
+SRC_URI[md5sum] = "254869dae3fd9f09f0746a3cb29a0b15"
+SRC_URI[sha256sum] = "3d948f64138c25633613f303bcc471126eae67c04d5e3f6b7b8ce6242f8653e0"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-passlib_1.6.5.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-passlib_1.7.1.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-passlib_1.6.5.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-passlib_1.7.1.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pbr_1.10.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pbr_1.10.0.bb
deleted file mode 100644
index fd35197..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pbr_1.10.0.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-DESCRIPTION = "Python Build Reasonableness: PBR is a library that injects some useful and sensible default behaviors into your setuptools run"
-HOMEPAGE = "https://pypi.python.org/pypi/pbr"
-SECTION = "devel/python"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2"
-
-SRC_URI[md5sum] = "8e4968c587268f030e38329feb9c8f17"
-SRC_URI[sha256sum] = "186428c270309e6fdfe2d5ab0949ab21ae5f7dea831eab96701b86bd666af39c"
-
-inherit pypi setuptools
-
-DEPENDS_class-target += " \
-        python-pip \
-        "
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pbr_2.0.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pbr_2.0.0.bb
new file mode 100644
index 0000000..a044a9e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pbr_2.0.0.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "Python Build Reasonableness: PBR is a library that injects some useful and sensible default behaviors into your setuptools run"
+HOMEPAGE = "https://pypi.python.org/pypi/pbr"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2"
+
+SRC_URI[md5sum] = "dfc1c3788eff06acfaade6f1655fa490"
+SRC_URI[sha256sum] = "0ccd2db529afd070df815b1521f01401d43de03941170f8a800e7531faba265d"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN}_class-target += " \
+        python-pip \
+        "
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pip_8.1.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pip_8.1.2.bb
deleted file mode 100644
index 8bb052e..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pip_8.1.2.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-SUMMARY = "PIP is a tool for installing and managing Python packages"
-LICENSE = "MIT & LGPL-2.1"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=25fba45109565f87de20bae85bc39452"
-
-SRC_URI[md5sum] = "87083c0b9867963b29f7aba3613e8f4a"
-SRC_URI[sha256sum] = "4d24b03ffa67638a3fa931c09fd9e0273ffa904e95ebebe7d4b1a54c93d7b732"
-
-inherit pypi setuptools
-
-# Since PIP is like CPAN for PERL we need to drag in all python modules to ensure everything works
-RDEPENDS_${PN} = "python-modules python-distribute"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pip_9.0.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pip_9.0.1.bb
new file mode 100644
index 0000000..2851761
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pip_9.0.1.bb
@@ -0,0 +1,13 @@
+SUMMARY = "PIP is a tool for installing and managing Python packages"
+LICENSE = "MIT & LGPL-2.1"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=25fba45109565f87de20bae85bc39452"
+
+SRC_URI[md5sum] = "35f01da33009719497f01a4ba69d63c9"
+SRC_URI[sha256sum] = "09f243e1a7b461f654c26a725fa373211bb7ff17a9300058b205c61658ca940d"
+
+inherit pypi setuptools
+
+# Since PIP is like CPAN for PERL we need to drag in all python modules to ensure everything works
+RDEPENDS_${PN}_class-target = "python-modules python-distribute"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ply_3.10.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ply_3.10.bb
new file mode 100644
index 0000000..8e61efa
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ply_3.10.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Python Lex and Yacc"
+DESCRIPTION = "Python ply: PLY is yet another implementation of lex and yacc for Python"
+HOMEPAGE = "https://pypi.python.org/pypi/ply"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://README.md;beginline=3;endline=30;md5=fcb04bc2f765e46ab7084d6ab6e452bb"
+
+SRCNAME = "ply"
+
+SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "1d63c166ab250bab87d8dcc42dcca70e"
+SRC_URI[sha256sum] = "96e94af7dd7031d8d6dd6e2a8e0de593b511c211a86e28a9c9621c275ac8bacb"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prettytable_0.7.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prettytable_0.7.2.bb
index c8f7b5f..6f4390e 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prettytable_0.7.2.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prettytable_0.7.2.bb
@@ -15,8 +15,11 @@
 inherit setuptools
 
 do_install_append() {
-    perm_files=`find "${D}${PYTHON_SITEPACKAGES_DIR}/" -name "top_level.txt"`
+    perm_files=`find "${D}${PYTHON_SITEPACKAGES_DIR}/" -name "*.txt" -o -name "PKG-INFO"`
     for f in $perm_files; do
         chmod 644 "${f}"
     done
 }
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/PrettyTable/"
+UPSTREAM_CHECK_REGEX = "/PrettyTable/(?P<pver>(\d+[\.\-_]*)+)"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prompt-toolkit.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prompt-toolkit.inc
index 8554aea..30c2c81 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prompt-toolkit.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prompt-toolkit.inc
@@ -2,8 +2,8 @@
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=b2cde7da89f0c1f3e49bf968d00d554f"
 
-SRC_URI[md5sum] = "f74cd8ac84176fac1cdb136843ccb0d6"
-SRC_URI[sha256sum] = "ef0b8188179fe7d052161ed274b43e18f5a680ff84d01462293b327e1668d2ef"
+SRC_URI[md5sum] = "427b496d2c147bd3819bc3a7f6e0d493"
+SRC_URI[sha256sum] = "33d68ca09f76cd73287fde7df5748ffacf26a8238dd61ee81ac50860ea7c6776"
 
 PYPI_PACKAGE = "prompt_toolkit"
 
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prompt-toolkit_1.0.7.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prompt-toolkit_1.0.13.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prompt-toolkit_1.0.7.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-prompt-toolkit_1.0.13.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-psutil.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-psutil.inc
new file mode 100644
index 0000000..6d3ebf8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-psutil.inc
@@ -0,0 +1,12 @@
+SUMMARY = "A cross-platform process and system utilities module for Python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=0f02e99f7f3c9a7fe8ecfc5d44c2be62"
+
+SRC_URI[md5sum] = "c9aa2599dcd9e5b59d71b6660d396062"
+SRC_URI[sha256sum] = "2fc91d068faa5613c093335f0e758673ef8c722ad4bfa4aded64c13ae69089eb"
+
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-shell \
+    ${PYTHON_PN}-subprocess \
+    ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-psutil_4.2.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-psutil_4.2.0.bb
deleted file mode 100644
index a5703da..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-psutil_4.2.0.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-SUMMARY = "A cross-platform process and system utilities module for Python"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=0f02e99f7f3c9a7fe8ecfc5d44c2be62"
-
-SRC_URI[md5sum] = "713f259f917a0c26acfbb7e6ae632ef7"
-SRC_URI[sha256sum] = "544f013a0aea7199e07e3efe5627f5d4165179a04c66050b234cc3be2eca1ace"
-
-RDEPENDS_${PN} += " \
-    python-subprocess \
-    "
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-psutil_5.2.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-psutil_5.2.0.bb
new file mode 100644
index 0000000..bf402aa
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-psutil_5.2.0.bb
@@ -0,0 +1,2 @@
+inherit pypi setuptools
+require python-psutil.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-py.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-py.inc
index 9e33b16..4ac502e 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-py.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-py.inc
@@ -2,7 +2,7 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=a6bb0320b04a0a503f12f69fea479de9"
 
-SRC_URI[md5sum] = "5d2c63c56dc3f2115ec35c066ecd582b"
-SRC_URI[sha256sum] = "a6501963c725fc2554dabfece8ae9a8fb5e149c0ac0a42fd2b02c5c1c57fc114"
+SRC_URI[md5sum] = "68ee0b5867282595d0b410a7f3c03ab3"
+SRC_URI[sha256sum] = "c4b89fd1ff1162375115608d01f77c38cca1d0f28f37fd718005e19b28be41a7"
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-py_1.4.31.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-py_1.4.32.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-py_1.4.31.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-py_1.4.32.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyalsaaudio.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyalsaaudio.inc
new file mode 100644
index 0000000..d150409
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyalsaaudio.inc
@@ -0,0 +1,11 @@
+SUMMARY = "Support for the Linux 2.6.x ALSA Sound System"
+SECTION = "devel/python"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1a3b161aa0fcec32a0c8907a2219ad9d"
+
+SRC_URI[md5sum] = "b46f69561bc85fc52e698b2440ca251e"
+SRC_URI[sha256sum] = "84e8f8da544d7f4bd96479ce4a237600077984d9be1d7f16c1d9a492ecf50085"
+
+DEPENDS += "alsa-lib"
+
+RDEPENDS_${PN} += "libasound"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyalsaaudio_0.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyalsaaudio_0.4.bb
deleted file mode 100644
index 0e660ad..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyalsaaudio_0.4.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "Support for the Linux 2.6.x ALSA Sound System"
-SECTION = "devel/python"
-DEPENDS = "alsa-lib"
-LICENSE = "PSF"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1a3b161aa0fcec32a0c8907a2219ad9d"
-SRCNAME = "pyalsaaudio"
-PR = "ml2"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/pyalsaaudio/${SRCNAME}-${PV}.tar.gz"
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit distutils
-
-SRC_URI[md5sum] = "b312c28efba7db0494836a79f0a49898"
-SRC_URI[sha256sum] = "07148ce16024724b17cc24c51d0f4fb78af214b09b7dc8dcb7b06e5647f4c582"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyalsaaudio_0.8.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyalsaaudio_0.8.4.bb
new file mode 100644
index 0000000..e515342
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyalsaaudio_0.8.4.bb
@@ -0,0 +1,2 @@
+require python-pyalsaaudio.inc
+inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyasn1.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyasn1.inc
index 7c25de8..4eb2d9b 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyasn1.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyasn1.inc
@@ -1,13 +1,16 @@
 SUMMARY = "Python library implementing ASN.1 types."
 HOMEPAGE = "http://pyasn1.sourceforge.net/"
 LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=425e62320d430219736139b134db2fc4"
+LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=280606d9c18f200e03e0c247ac61475a"
 
-SRC_URI[md5sum] = "f00a02a631d4016818659d1cc38d229a"
-SRC_URI[sha256sum] = "853cacd96d1f701ddd67aa03ecc05f51890135b7262e922710112f12a2ed2a7f"
+SRC_URI[md5sum] = "79f98135071c8dd5c37b6c923c51be45"
+SRC_URI[sha256sum] = "738c4ebd88a718e700ee35c8d129acce2286542daa80a82823a7073644f706ad"
 
-RDEPENDS_${PN} += " \
+RDEPENDS_${PN}_class-target += " \
+    ${PYTHON_PN}-codecs \
     ${PYTHON_PN}-lang \
+    ${PYTHON_PN}-logging \
+    ${PYTHON_PN}-math \
     ${PYTHON_PN}-shell \
 "
 
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyasn1_0.1.9.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyasn1_0.2.3.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyasn1_0.1.9.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyasn1_0.2.3.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pybind11.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pybind11.inc
index e13f6a5..6d36d87 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pybind11.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pybind11.inc
@@ -1,9 +1,8 @@
 SUMMARY = "Seamless operability between C++11 and Python"
 HOMEPAGE = "https://github.com/wjakob/pybind11"
 LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://PKG-INFO;md5=1e9383cd3e97753d7dd6067d079519ea"
+LIC_FILES_CHKSUM = "file://PKG-INFO;md5=485d9f8aa1ab513bec0de2f55cd69672"
 PR = "r0"
 
-SRC_URI = "https://pypi.python.org/packages/89/0b/f3a25633e49be5fae17ed2c7751c8106a08199db70e3c82e8cc043388ba9/pybind11-1.8.1.tar.gz"
-SRC_URI[md5sum] = "67845d8fd89a1c400dc7c61ccdee14d6"
-SRC_URI[sha256sum] = "358d4b7d8c38cd1dde66064178c6bbaaa2c479a44e67e642820fe0f329a4fff8"
+SRC_URI[md5sum] = "c96103168e9abceaa6d46f6074dcaf38"
+SRC_URI[sha256sum] = "1b1a4824aad88b1073fe8dbd21683e1e5228f3ed3b29c2785fbf5dea6bf1063c"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pybind11_1.8.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pybind11_2.0.1.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pybind11_1.8.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pybind11_2.0.1.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycparser.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycparser.inc
index bf3b757..4913f42 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycparser.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycparser.inc
@@ -1,8 +1,14 @@
 SUMMARY = "Parser of the C language, written in pure Python"
 LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=8fb364772b1441821d391591f340c35a"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d0cfca7bbc0610f849707d9e4fd82eac"
 
-SRC_URI[md5sum] = "a2bc8d28c923b4fe2b2c3b4b51a4f935"
-SRC_URI[sha256sum] = "7959b4a74abdc27b312fed1c21e6caf9309ce0b29ea86b591fd2e99ecdf27f73"
+SRC_URI[md5sum] = "ca98dcb50bc1276f230118f6af5a40c7"
+SRC_URI[sha256sum] = "0aac31e917c24cb3357f5a4d5566f2cc91a19ca41862f6c3c22dc60a629673b6"
 
 BBCLASSEXTEND = "native nativesdk"
+
+RDEPENDS_${PN}_class-target += "\
+    ${PYTHON_PN}-subprocess \
+    cpp \
+    cpp-symlinks \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycparser_2.14.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycparser_2.17.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycparser_2.14.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycparser_2.17.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto.inc
new file mode 100644
index 0000000..fb2c17d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto.inc
@@ -0,0 +1,17 @@
+DESCRIPTION = "Cryptographic modules for Python."
+HOMEPAGE = "http://www.pycrypto.org/"
+LICENSE = "PSFv2"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=35f354d199e8cb7667b059a23578e63d"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+DEPENDS += " gmp"
+
+inherit pypi autotools-brokensep
+
+SRC_URI[md5sum] = "55a61a054aa66812daf5161a0d5d7eda"
+SRC_URI[sha256sum] = "f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c"
+
+do_compile[noexec] = "1"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto/CVE-2013-7459.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto/CVE-2013-7459.patch
new file mode 100644
index 0000000..9006c5c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto/CVE-2013-7459.patch
@@ -0,0 +1,98 @@
+From 8dbe0dc3eea5c689d4f76b37b93fe216cf1f00d4 Mon Sep 17 00:00:00 2001
+From: Legrandin <helderijs@gmail.com>
+Date: Sun, 22 Dec 2013 22:24:46 +0100
+Subject: [PATCH] Throw exception when IV is used with ECB or CTR
+
+The IV parameter is currently ignored when initializing
+a cipher in ECB or CTR mode.
+
+For CTR mode, it is confusing: it takes some time to see
+that a different parameter is needed (the counter).
+
+For ECB mode, it is outright dangerous.
+
+This patch forces an exception to be raised.
+
+Upstream-Status: Backport
+[https://github.com/dlitz/pycrypto/commit/8dbe0dc3eea5c689d4f76b37b93fe216cf1f00d4]
+
+CVE: CVE-2013-7459
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ lib/Crypto/SelfTest/Cipher/common.py | 31 +++++++++++++++++++++++--------
+ src/block_template.c                 | 11 +++++++++++
+ 2 files changed, 34 insertions(+), 8 deletions(-)
+
+diff --git a/lib/Crypto/SelfTest/Cipher/common.py b/lib/Crypto/SelfTest/Cipher/common.py
+index 8bebed9..91ec743 100644
+--- a/lib/Crypto/SelfTest/Cipher/common.py
++++ b/lib/Crypto/SelfTest/Cipher/common.py
+@@ -239,19 +239,34 @@ class RoundtripTest(unittest.TestCase):
+         return """%s .decrypt() output of .encrypt() should not be garbled""" % (self.module_name,)
+ 
+     def runTest(self):
+-        for mode in (self.module.MODE_ECB, self.module.MODE_CBC, self.module.MODE_CFB, self.module.MODE_OFB, self.module.MODE_OPENPGP):
++
++        ## ECB mode
++        mode = self.module.MODE_ECB
++        encryption_cipher = self.module.new(a2b_hex(self.key), mode)
++        ciphertext = encryption_cipher.encrypt(self.plaintext)
++        decryption_cipher = self.module.new(a2b_hex(self.key), mode)
++        decrypted_plaintext = decryption_cipher.decrypt(ciphertext)
++        self.assertEqual(self.plaintext, decrypted_plaintext)
++
++        ## OPENPGP mode
++        mode = self.module.MODE_OPENPGP
++        encryption_cipher = self.module.new(a2b_hex(self.key), mode, self.iv)
++        eiv_ciphertext = encryption_cipher.encrypt(self.plaintext)
++        eiv = eiv_ciphertext[:self.module.block_size+2]
++        ciphertext = eiv_ciphertext[self.module.block_size+2:]
++        decryption_cipher = self.module.new(a2b_hex(self.key), mode, eiv)
++        decrypted_plaintext = decryption_cipher.decrypt(ciphertext)
++        self.assertEqual(self.plaintext, decrypted_plaintext)
++
++        ## All other non-AEAD modes (but CTR)
++        for mode in (self.module.MODE_CBC, self.module.MODE_CFB, self.module.MODE_OFB):
+             encryption_cipher = self.module.new(a2b_hex(self.key), mode, self.iv)
+             ciphertext = encryption_cipher.encrypt(self.plaintext)
+-            
+-            if mode != self.module.MODE_OPENPGP:
+-                decryption_cipher = self.module.new(a2b_hex(self.key), mode, self.iv)
+-            else:
+-                eiv = ciphertext[:self.module.block_size+2]
+-                ciphertext = ciphertext[self.module.block_size+2:]
+-                decryption_cipher = self.module.new(a2b_hex(self.key), mode, eiv)
++            decryption_cipher = self.module.new(a2b_hex(self.key), mode, self.iv)
+             decrypted_plaintext = decryption_cipher.decrypt(ciphertext)
+             self.assertEqual(self.plaintext, decrypted_plaintext)
+ 
++
+ class PGPTest(unittest.TestCase):
+     def __init__(self, module, params):
+         unittest.TestCase.__init__(self)
+diff --git a/src/block_template.c b/src/block_template.c
+index c36b316..8746948 100644
+--- a/src/block_template.c
++++ b/src/block_template.c
+@@ -170,6 +170,17 @@ ALGnew(PyObject *self, PyObject *args, PyObject *kwdict)
+ 				"Key cannot be the null string");
+ 		return NULL;
+ 	}
++	if (IVlen != 0 && mode == MODE_ECB)
++	{
++		PyErr_Format(PyExc_ValueError, "ECB mode does not use IV");
++		return NULL;
++	}
++	if (IVlen != 0 && mode == MODE_CTR)
++	{
++		PyErr_Format(PyExc_ValueError,
++			"CTR mode needs counter parameter, not IV");
++		return NULL;
++	}
+ 	if (IVlen != BLOCK_SIZE && mode != MODE_ECB && mode != MODE_CTR)
+ 	{
+ 		PyErr_Format(PyExc_ValueError,
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto/cross-compiling.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto/cross-compiling.patch
new file mode 100644
index 0000000..712f3e8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto/cross-compiling.patch
@@ -0,0 +1,23 @@
+Index: pycrypto-2.6/setup.py
+===================================================================
+--- pycrypto-2.6.orig/setup.py
++++ pycrypto-2.6/setup.py
+@@ -271,7 +271,8 @@ class PCTBuildConfigure(Command):
+         if not os.path.exists("config.status"):
+             if os.system("chmod 0755 configure") != 0:
+                 raise RuntimeError("chmod error")
+-            cmd = "sh configure"    # we use "sh" here so that it'll work on mingw32 with standard python.org binaries
++            host = os.environ.get("HOST_SYS")
++            cmd = "ac_cv_func_malloc_0_nonnull=yes sh configure --host " + host   # we use "sh" here so that it'll work on mingw32 with standard python.org binaries
+             if self.verbose < 1:
+                 cmd += " -q"
+             if os.system(cmd) != 0:
+@@ -370,7 +371,7 @@ kw = {'name':"pycrypto",
+       'ext_modules': plat_ext + [
+             # _fastmath (uses GNU mp library)
+             Extension("Crypto.PublicKey._fastmath",
+-                      include_dirs=['src/','/usr/include/'],
++                      include_dirs=['src/'],
+                       libraries=['gmp'],
+                       sources=["src/_fastmath.c"]),
+ 
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto_2.6.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto_2.6.1.bb
new file mode 100644
index 0000000..919f91e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pycrypto_2.6.1.bb
@@ -0,0 +1,13 @@
+inherit distutils
+require python-pycrypto.inc
+
+SRC_URI += "file://cross-compiling.patch \
+            file://CVE-2013-7459.patch \
+           "
+
+# We explicitly call distutils_do_install, since we want it to run, but
+# *don't* want the autotools install to run, since this package doesn't
+# provide a "make install" target.
+do_install() {
+       distutils_do_install
+}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyinotify.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyinotify.inc
index a9edb2c..0168f1a 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyinotify.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyinotify.inc
@@ -7,5 +7,4 @@
 SRC_URI[md5sum] = "8e580fa1ff3971f94a6f81672b76c406"
 SRC_URI[sha256sum] = "9c998a5d7606ca835065cdabc013ae6c66eb9ea76a00a1e3bc6e0cfe2b4f71f4"
 
-PYPI_PACKAGE = "pyinotify"
 inherit pypi
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pylint_1.6.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pylint_1.6.4.bb
deleted file mode 100644
index b9219dd..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pylint_1.6.4.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY="Pylint is a Python source code analyzer"
-HOMEPAGE= "http://www.pylint.org/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
-
-SRC_URI[md5sum] = "66ba9c27e067568bdabcdd7c21303903"
-SRC_URI[sha256sum] = "ef901a34b62ed7a734370ba5b162d890231ba8822abe88c6dda1268e2575f5f1"
-
-RDEPENDS_${PN} += "python-codecs \
-                   python-contextlib \
-                   python-core \
-                   python-distutils \
-                   python-io \
-                   python-lang \
-                   python-multiprocessing \
-                   python-netserver \
-                   python-numbers \
-                   python-pickle \
-                   python-re \
-                   python-shell \
-                   python-six \
-                   python-stringold \
-                   python-subprocess \
-                   python-textutils \
-                   python-unittest"
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pylint_1.6.5.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pylint_1.6.5.bb
new file mode 100644
index 0000000..f5b4ad0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pylint_1.6.5.bb
@@ -0,0 +1,44 @@
+SUMMARY="Pylint is a Python source code analyzer"
+HOMEPAGE= "http://www.pylint.org/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
+
+SRC_URI[md5sum] = "31da2185bf59142479e4fa16d8a9e347"
+SRC_URI[sha256sum] = "a673984a8dd78e4a8b8cfdee5359a1309d833cf38405008f4a249994a8456719"
+
+RDEPENDS_${PN} += "python-codecs \
+                   python-contextlib \
+                   python-core \
+                   python-distutils \
+                   python-io \
+                   python-lang \
+                   python-multiprocessing \
+                   python-netserver \
+                   python-numbers \
+                   python-pickle \
+                   python-re \
+                   python-shell \
+                   python-six \
+                   python-stringold \
+                   python-subprocess \
+                   python-textutils \
+                   python-unittest \
+                   python-backports-functools-lru-cache \
+                   python-setuptools \
+                   python-astroid \
+                   python-wrapt \
+                   python-isort \
+                   python-lazy-object-proxy \
+                   "
+
+inherit pypi setuptools
+
+do_install_append(){
+    rm ${D}${bindir}/pylint
+    cat >> ${D}${bindir}/pylint <<EOF
+#!/usr/bin/env python
+from pylint import run_pylint
+run_pylint()
+EOF
+    chmod 755 ${D}${bindir}/pylint
+}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymisp.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymisp.inc
index 2b2601a..fe25b50 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymisp.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymisp.inc
@@ -1,9 +1,9 @@
 DESCRIPTION = "Python API for MISP"
 HOMEPAGE = "https://github.com/MISP/PyMISP"
 LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://PKG-INFO;md5=200286bb8d148a5a157bf22abf623cbb"
+LIC_FILES_CHKSUM = "file://PKG-INFO;md5=2e1efdc433498cebd33ec277ad8741e5"
 
-SRC_URI[md5sum] = "03b5def47d8fde29f2303ed42ab1e375"
-SRC_URI[sha256sum] = "2bb35c365470ad46f9afbb96408c01894aaa10b369fac0f6b92010190a7087ad"
+SRC_URI[md5sum] = "5320f41bf96cf22d13af7eb31e1d321f"
+SRC_URI[sha256sum] = "6c7bd97f0ea9c7eb1935902f1bc6fc1ec27eba86056c5b938234a7229891d5a2"
 
-RDEPENDS_${PN} += " ${PYTHON_PN}-requests"
+RDEPENDS_${PN} += " ${PYTHON_PN}-requests ${PYTHON_PN}-json ${PYTHON_PN}-jsonschema"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymisp_2.4.51.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymisp_2.4.67.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymisp_2.4.51.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymisp_2.4.67.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymongo.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymongo.inc
index 0a256a7..e709a36 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymongo.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymongo.inc
@@ -8,5 +8,12 @@
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=2a944942e1496af1886903d274dedb13"
 
-SRC_URI[md5sum] = "42cd12a5014fb7d3e1987ca04f5c651f"
-SRC_URI[sha256sum] = "3d45302fc2622fabf34356ba274c69df41285bac71bbd229f1587283b851b91e"
+SRC_URI[md5sum] = "aa77f88e51e281c9f328cea701bb6f3e"
+SRC_URI[sha256sum] = "d359349c6c9ff9f482805f89e66e476846317dc7b1eea979d7da9c0857ee2721"
+
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-numbers \
+    ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymongo_3.3.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymongo_3.4.0.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymongo_3.3.0.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pymongo_3.4.0.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyopenssl.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyopenssl.inc
index 0ddad12..579ca60 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyopenssl.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyopenssl.inc
@@ -2,17 +2,17 @@
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
 
-DEPENDS = "openssl ${PYTHON_PN}-cryptography"
+DEPENDS += "openssl ${PYTHON_PN}-cryptography"
 
-SRC_URI[md5sum] = "d8100b0c333f0eeadaf05914da8792a6"
-SRC_URI[sha256sum] = "88f7ada2a71daf2c78a4f139b19d57551b4c8be01f53a1cb5c86c2f3bf01355f"
+SRC_URI[md5sum] = "6635503758c65ea6f70d18d1b18e46d5"
+SRC_URI[sha256sum] = "7779a3bbb74e79db234af6a08775568c6769b5821faecf6e2f4143edb227516e"
 
 PYPI_PACKAGE = "pyOpenSSL"
 
 PACKAGES =+ "${PN}-tests"
 FILES_${PN}-tests = "${libdir}/${PYTHON_DIR}/site-packages/OpenSSL/test"
 
-RDEPENDS_${PN} = " \
+RDEPENDS_${PN}_class-target = " \
     ${PYTHON_PN}-cryptography \
     ${PYTHON_PN}-six \
     ${PYTHON_PN}-threading \
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyopenssl_16.1.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyopenssl_16.1.0.bb
deleted file mode 100644
index d7177e2..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyopenssl_16.1.0.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools
-require python-pyopenssl.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyopenssl_16.2.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyopenssl_16.2.0.bb
new file mode 100644
index 0000000..b7d5146
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyopenssl_16.2.0.bb
@@ -0,0 +1,2 @@
+require python-pyopenssl.inc
+inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyparsing.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyparsing.inc
new file mode 100644
index 0000000..033e0db
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyparsing.inc
@@ -0,0 +1,19 @@
+SUMMARY = "Python parsing module"
+HOMEPAGE = "http://pyparsing.wikispaces.com/"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fb46329938e6bc829b256e37d5c1e31a"
+
+SRC_URI[md5sum] = "0214e42d63af850256962b6744c948d9"
+SRC_URI[sha256sum] = "0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04"
+
+inherit pypi
+
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-debugger \
+    ${PYTHON_PN}-json \
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-pprint \
+    ${PYTHON_PN}-stringold \
+    ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyparsing_2.1.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyparsing_2.1.4.bb
deleted file mode 100644
index 9aa5473..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyparsing_2.1.4.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-SUMMARY = "Python parsing module"
-HOMEPAGE = "http://pyparsing.wikispaces.com/"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=fb46329938e6bc829b256e37d5c1e31a"
-
-SRC_URI[md5sum] = "322059c57f0c9f11da1c6c06a2ba2197"
-SRC_URI[sha256sum] = "a9234dea79b50d49b92a994132cd1c84e873f3936db94977a66f0a4159b1797c"
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyparsing_2.2.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyparsing_2.2.0.bb
new file mode 100644
index 0000000..90217f3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyparsing_2.2.0.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-pyparsing.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyserial.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyserial.inc
index a4c7728..2508e76 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyserial.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyserial.inc
@@ -7,10 +7,21 @@
 RDEPENDS_${PN} = "\
     ${PYTHON_PN}-fcntl \
     ${PYTHON_PN}-io \
+    ${PYTHON_PN}-logging \
+    ${PYTHON_PN}-netclient \
     ${PYTHON_PN}-stringold \
+    ${PYTHON_PN}-threading \
 "
 
-SRC_URI[md5sum] = "2f72100de3e410b36d575e12e82e9d27"
-SRC_URI[sha256sum] = "d657051249ce3cbd0446bcfb2be07a435e1029da4d63f53ed9b4cdde7373364c"
+RSRC_URI[md5sum] = "6afe4c2e47bcec6eb7051b8c1ce19d52"
+SRC_URI[sha256sum] = "2949cddffc2b05683065a3cd2345114b1a49b08df8cb843d69ba99dc3e19edc2"
 
 inherit pypi
+
+do_install_append() {
+	# We don't support jpython now.
+	if [ -e ${D}${PYTHON_SITEPACKAGES_DIR}/serial/serialjava.py ]; then
+		rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/serial/serialjava.py
+		rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/serial/serialjava.pyc
+	fi
+}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyserial_3.1.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyserial_3.1.1.bb
deleted file mode 100644
index ad2b350..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyserial_3.1.1.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit setuptools
-require python-pyserial.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyserial_3.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyserial_3.3.bb
new file mode 100644
index 0000000..91a0f26
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyserial_3.3.bb
@@ -0,0 +1,4 @@
+inherit setuptools
+require python-pyserial.inc
+
+RDEPENDS_${PN} += "${PYTHON_PN}-importlib"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysmi_0.1.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysmi_0.1.2.bb
new file mode 100644
index 0000000..aa234dd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysmi_0.1.2.bb
@@ -0,0 +1,22 @@
+SUMMARY = "SNMP SMI/MIB Parser"
+DESCRIPTION = "A pure-Python implementation of SNMP/SMI MIB \
+  parsing and conversion library. Can produce PySNMP MIB modules. \
+"
+HOMEPAGE = "https://pypi.python.org/pypi/pysmi"
+SECTION = "devel/python"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=d8b1bbadd635f187dee74d999a8c67b8"
+
+SRCNAME = "pysmi"
+
+SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "f8754e9ed75698cc16b40f125df85b12"
+SRC_URI[sha256sum] = "e0912180fc6faa9c264df78f97e7c451f77f84f5bd840098d2ce7b1bf70082bc"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} = "python-ply"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysnmp_4.3.5.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysnmp_4.3.5.bb
new file mode 100644
index 0000000..0b38d58
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysnmp_4.3.5.bb
@@ -0,0 +1,25 @@
+SUMMARY = "A pure-Python SNMPv1/v2c/v3 library"
+DESCRIPTION = "SNMP v1/v2c/v3 engine and apps written in pure-Python. \
+  Supports Manager/Agent/Proxy roles, scriptable MIBs, asynchronous \
+  operation (asyncio, twisted, asyncore) and multiple transports.\
+"
+HOMEPAGE = "https://pypi.python.org/pypi/pysnmp"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=280606d9c18f200e03e0c247ac61475a"
+
+SRCNAME = "pysnmp"
+
+SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "387aaa23c168ccc0b59775cfdf519fc0"
+SRC_URI[sha256sum] = "38253fe95cea33f352fb36e85f3c2874043401724300c4888df74835161169d2"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} += "python-pycrypto \
+                   python-pyasn1 \
+                   python-pysmi \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysocks.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysocks.inc
index 0697fd7..5aec6fc 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysocks.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysocks.inc
@@ -3,9 +3,13 @@
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=1d457bcffb9661b45f799d4efee72f16"
 
-SRC_URI[md5sum] = "68f4ad7a8d4fa725656ae3e9dd142d29"
-SRC_URI[sha256sum] = "e51c7694b10288e6fd9a28e15c0bcce9aca0327e7b32ebcd9af05fcd56f38b88"
+SRC_URI[md5sum] = "571f4c23982fa86bf0e7a441f1b6c881"
+SRC_URI[sha256sum] = "02419a225ff5dcfc3c9695ef8fc9b4d8cc99658e650c6d4718d4c8f451e63f41"
 
 PYPI_PACKAGE = "PySocks"
 
+RDEPENDS_${PN}_class-target += "\
+    ${PYTHON_PN}-io \
+"
+
 BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysocks_1.5.7.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysocks_1.6.6.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysocks_1.5.7.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysocks_1.6.6.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysqlite.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysqlite.inc
new file mode 100644
index 0000000..8845565
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysqlite.inc
@@ -0,0 +1,18 @@
+DESCRIPTION = "DB-API 2.0 interface for SQLite 3.x"
+HOMEPAGE = "http://github.com/ghaering/pysqlite"
+LICENSE = "Zlib"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=28ad4f115e06c88bd737372a453369d8"
+
+SRC_URI[md5sum] = "033f17b8644577715aee55e8832ac9fc"
+SRC_URI[sha256sum] = "17d3335863e8cf8392eea71add33dab3f96d060666fe68ab7382469d307f4490"
+
+inherit pypi
+
+DEPENDS += "${PYTHON_PN}-pip"
+
+RDEPENDS_${PN}_class-target += "\
+    ${PYTHON_PN}-datetime \
+    sqlite3 \
+"
+
+FILES_${PN}-doc += "${datadir}"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysqlite_2.8.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysqlite_2.8.3.bb
new file mode 100644
index 0000000..95938f2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pysqlite_2.8.3.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-pysqlite.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest-runner.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest-runner.inc
new file mode 100644
index 0000000..85a8de1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest-runner.inc
@@ -0,0 +1,17 @@
+SUMMARY = "Invoke py.test as distutils command with dependency resolution"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e38b971c2b4c33b978d1b9c9ece9ae63"
+
+SRC_URI[md5sum] = "bdb73eb18eca2727944a2dcf963c5a81"
+SRC_URI[sha256sum] = "983a31eab45e375240e250161a556163bc8d250edaba97960909338c273a89b3"
+
+
+inherit pypi
+
+DEPENDS += " \
+    ${PYTHON_PN}-setuptools-scm-native"
+
+RDEPENDS_${PN} = "${PYTHON_PN}-py ${PYTHON_PN}-setuptools ${PYTHON_PN}-argparse ${PYTHON_PN}-debugger ${PYTHON_PN}-json \
+                  ${PYTHON_PN}-io"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest-runner_2.11.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest-runner_2.11.1.bb
new file mode 100644
index 0000000..0a5055c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest-runner_2.11.1.bb
@@ -0,0 +1,5 @@
+inherit setuptools
+require python-pytest-runner.inc
+
+# Dependency only exists for python2
+RDEPENDS_${PN} += "python-compiler"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest-runner_2.8.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest-runner_2.8.bb
deleted file mode 100644
index a4685ec..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest-runner_2.8.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "Invoke py.test as distutils command with dependency resolution"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e38b971c2b4c33b978d1b9c9ece9ae63"
-
-SRC_URI[md5sum] = "041f3624f450d87a242e3907d7f90e8f"
-SRC_URI[sha256sum] = "1ec44deddaa551f85fd563c40a4c483a2609aca1f284a95399566a74d0680d5c"
-PYPI_PACKAGE_HASH = "466cff61a9e0d513222afa3529bdb565a465812b7e50b218a5afd705f46b258c"
-
-DEPENDS += " \
-    python-setuptools-scm"
-
-RDEPENDS_${PN} = "python-py python-setuptools python-argparse python-debugger python-json"
-
-inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest.inc
index 454939e..c9c9bbf 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest.inc
@@ -2,10 +2,10 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=d8a5609608d9a5a180705b0fa298ae01"
 
-SRC_URI[md5sum] = "6e736a6d7bc854b25d44a60bcba5f2f9"
-SRC_URI[sha256sum] = "e82bc0596ee96b2287c08705cfcb6898db1fe4b5c87db3b6823f1fdd77fb3ff1"
+SRC_URI[md5sum] = "6639592fa430567d024189f097fcdbd7"
+SRC_URI[sha256sum] = "643434a9f1a188271da35e20064cb8b6c5440976c5bb541dc7b5b0e3cf75d940"
 
-RDEPENDS_${PN} = " \
+RDEPENDS_${PN}_class-target += " \
     ${PYTHON_PN}-argparse \
     ${PYTHON_PN}-debugger \
     ${PYTHON_PN}-json \
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest_3.0.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest_3.0.6.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest_3.0.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytest_3.0.6.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytz.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytz.inc
new file mode 100644
index 0000000..1c6564b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytz.inc
@@ -0,0 +1,18 @@
+SUMMARY = "World timezone definitions, modern and historical"
+HOMEPAGE = "http://pythonhosted.org/pytz"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=39ea92752a35cf67d8a885d8e3af3c69"
+
+inherit pypi
+PYPI_PACKAGE_EXT = "zip"
+
+SRC_URI[md5sum] = "f89bde8a811c8a1a5bac17eaaa94383c"
+SRC_URI[sha256sum] = "f5c056e8f62d45ba8215e5cb8f50dfccb198b4b9fbea8500674f3443e4689589"
+
+RDEPENDS_${PN}_class-target += "\
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-io \
+    ${PYTHON_PN}-threading \
+"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytz_2016.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytz_2016.4.bb
deleted file mode 100644
index 6cbea28..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytz_2016.4.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "World timezone definitions, modern and historical"
-HOMEPAGE = " http://pythonhosted.org/pytz"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=22b38951eb857cf285a4560a914b7cd6"
-
-SRC_URI[md5sum] = "a3316cf3842ed0375ba5931914239d97"
-SRC_URI[sha256sum] = "c823de61ff40d1996fe087cec343e0503881ca641b897e0f9b86c7683a0bfee1"
-
-inherit pypi setuptools
-
-RDEPENDS_${PN} = "\
-    python-core \
-    python-datetime \
-"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytz_2017.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytz_2017.2.bb
new file mode 100755
index 0000000..f2ffc59
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pytz_2017.2.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-pytz.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyudev_0.20.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyudev_0.20.0.bb
deleted file mode 100644
index e403d4e..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyudev_0.20.0.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SUMMARY = "A libudev binding"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
-
-SRC_URI[md5sum] = "30c19f94dba43b6f5a010285838a3f45"
-SRC_URI[sha256sum] = "14d85bc9611dbf798732996cb7107858f58a3a1b9d246e4063c7a20ade65842a"
-
-inherit pypi setuptools
-
-do_configure_prepend() {
-    sed -i "/import pyudev/d" ${S}/setup.py
-    sed -i "s/str(pyudev.__version__)/'${PV}'/g" ${S}/setup.py
-}
-
-RDEPENDS_${PN} = "\
-    python-ctypes \
-    python-subprocess \
-    python-misc \
-    python-contextlib \
-"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyudev_0.21.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyudev_0.21.0.bb
new file mode 100644
index 0000000..b0a1acb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyudev_0.21.0.bb
@@ -0,0 +1,22 @@
+SUMMARY = "A libudev binding"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+SRC_URI[md5sum] = "cf4d9db7d772622144ca1be6b5d9353b"
+SRC_URI[sha256sum] = "094b7a100150114748aaa3b70663485dd360457a709bfaaafe5a977371033f2b"
+
+inherit pypi setuptools
+
+do_configure_prepend() {
+    sed -i "/import pyudev/d" ${S}/setup.py
+    sed -i "s/str(pyudev.__version__)/'${PV}'/g" ${S}/setup.py
+}
+
+RDEPENDS_${PN} = "\
+    ${PYTHON_PN}-contextlib \
+    ${PYTHON_PN}-ctypes \
+    ${PYTHON_PN}-misc \
+    ${PYTHON_PN}-six \
+    ${PYTHON_PN}-subprocess \
+    ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyyaml.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyyaml.inc
new file mode 100644
index 0000000..a3cf677
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyyaml.inc
@@ -0,0 +1,14 @@
+SUMMARY = "Python support for YAML"
+HOMEPAGE = "http://www.pyyaml.org"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=6015f088759b10e0bc2bf64898d4ae17"
+DEPENDS = "libyaml ${PYTHON_PN}-cython-native ${PYTHON_PN}"
+
+PYPI_PACKAGE = "PyYAML"
+inherit pypi
+
+SRC_URI[md5sum] = "4c129761b661d181ebf7ff4eb2d79950"
+SRC_URI[sha256sum] = "592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyyaml/setup.py b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyyaml/setup.py
deleted file mode 100644
index 2ed1c94..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyyaml/setup.py
+++ /dev/null
@@ -1,64 +0,0 @@
-NAME = 'PyYAML'
-VERSION = '3.10'
-DESCRIPTION = "YAML parser and emitter for Python"
-LONG_DESCRIPTION = """\
-YAML is a data serialization format designed for human readability and
-interaction with scripting languages.  PyYAML is a YAML parser and
-emitter for Python.
-
-PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
-support, capable extension API, and sensible error messages.  PyYAML
-supports standard YAML tags and provides Python-specific tags that allow
-to represent an arbitrary Python object.
-
-PyYAML is applicable for a broad range of tasks from complex
-configuration files to object serialization and persistance."""
-AUTHOR = "Kirill Simonov"
-AUTHOR_EMAIL = 'xi@resolvent.net'
-LICENSE = "MIT"
-PLATFORMS = "Any"
-URL = "http://pyyaml.org/wiki/PyYAML"
-DOWNLOAD_URL = "http://pyyaml.org/download/pyyaml/%s-%s.tar.gz" % (NAME, VERSION)
-CLASSIFIERS = [
-    "Development Status :: 5 - Production/Stable",
-    "Intended Audience :: Developers",
-    "License :: OSI Approved :: MIT License",
-    "Operating System :: OS Independent",
-    "Programming Language :: Python",
-    "Topic :: Software Development :: Libraries :: Python Modules",
-    "Topic :: Text Processing :: Markup",
-]
-
-from distutils.core import setup
-from distutils.extension import Extension
-from Cython.Distutils import build_ext
-
-import sys, os.path
-
-
-if __name__ == '__main__':
-
-    setup(
-        name=NAME,
-        version=VERSION,
-        description=DESCRIPTION,
-        long_description=LONG_DESCRIPTION,
-        author=AUTHOR,
-        author_email=AUTHOR_EMAIL,
-        license=LICENSE,
-        platforms=PLATFORMS,
-        url=URL,
-        download_url=DOWNLOAD_URL,
-        classifiers=CLASSIFIERS,
-
-        package_dir={'': 'lib'},
-        packages=['yaml'],
-
-        ext_modules = [
-        Extension( "_yaml", ["ext/_yaml.pyx"], libraries = ["yaml"] )
-        ],
-
-        cmdclass={
-            'build_ext': build_ext,
-        },
-    )
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyyaml_3.12.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyyaml_3.12.bb
index 61b1d2c..5a4c92d 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyyaml_3.12.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-pyyaml_3.12.bb
@@ -1,24 +1,2 @@
-SUMMARY = "Python support for YAML"
-HOMEPAGE = "http://www.pyyaml.org"
-SECTION = "devel/python"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=6015f088759b10e0bc2bf64898d4ae17"
-DEPENDS = "libyaml python-cython-native"
-
-SRC_URI = "http://pyyaml.org/download/pyyaml/PyYAML-${PV}.tar.gz \
-           file://setup.py \
-"
-
-SRC_URI[md5sum] = "4c129761b661d181ebf7ff4eb2d79950"
-SRC_URI[sha256sum] = "592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab"
-
-S = "${WORKDIR}/PyYAML-${PV}"
-
-inherit distutils
-
-do_configure_prepend() {
-    # upstream setup.py overcomplicated, use ours
-    install -m 0644 ${WORKDIR}/setup.py ${S}
-}
-
-BBCLASSEXTEND = "native"
+require python-pyyaml.inc
+inherit setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-requests.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-requests.inc
index 287078a..b66f66e 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-requests.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-requests.inc
@@ -3,8 +3,8 @@
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=d9bb3515869c0f426cb8441c899ae7f5"
 
-SRC_URI[md5sum] = "ad5f9c47b5c5dfdb28363ad7546b0763"
-SRC_URI[sha256sum] = "5acf980358283faba0b897c73959cecf8b841205bb4b2ad3ef545f46eae1a133"
+SRC_URI[md5sum] = "921ec6b48f2ddafc8bb6160957baf444"
+SRC_URI[sha256sum] = "5722cd09762faa01276230270ff16af7acf7c5c45d623868d9ba116f15791ce8"
 
 RDEPENDS_${PN} += " \
     ${PYTHON_PN}-email \
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-requests_2.11.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-requests_2.13.0.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-requests_2.11.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-requests_2.13.0.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-selectors34_1.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-selectors34_1.1.bb
new file mode 100644
index 0000000..1982418
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-selectors34_1.1.bb
@@ -0,0 +1,12 @@
+SUMMARY = "Backport of the selectors module from Python 3.4"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://PKG-INFO;md5=1cfbbf590d8d5b7fe937516217b778b3"
+
+SRC_URI[md5sum] = "403194b10f35a5258e0642712fdd3753"
+SRC_URI[sha256sum] = "84b3743b9046461aebbcd13c15e79ab91e79acfb6e030b54a0ec6360ae0bbc52"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-six \
+    "    
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-serpent.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-serpent.inc
new file mode 100644
index 0000000..0b1aa91
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-serpent.inc
@@ -0,0 +1,13 @@
+SUMMARY = "Serialization based on ast.literal_eval"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://PKG-INFO;md5=3773e39c491bb1f9ccc98389d57169d7"
+
+SRC_URI[md5sum] = "cdef596f727cb6b4176c89769d2d41ee"
+SRC_URI[sha256sum] = "946b2c837f889971df3575af9dadd8f09bfe48549ebc1b9f6434263b653707ce"
+
+inherit pypi
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-numbers \
+    "    
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-serpent_1.19.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-serpent_1.19.bb
new file mode 100644
index 0000000..0db3cf9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-serpent_1.19.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-serpent.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-setuptools-scm.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-setuptools-scm.inc
new file mode 100644
index 0000000..3249870
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-setuptools-scm.inc
@@ -0,0 +1,14 @@
+SUMMARY = "the blessed package to manage your versions by scm tags"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=838c366f69b72c5df05c96dff79b35f2"
+
+SRC_URI[md5sum] = "b6916c78ed6253d6602444fad4279c5b"
+SRC_URI[sha256sum] = "daf12d05aa2155a46aa357453757ffdc47d87f839e62114f042bceac6a619e2f"
+
+PYPI_PACKAGE = "setuptools_scm"
+inherit pypi
+
+RDEPENDS_${PN}_class-target = "${PYTHON_PN}-py ${PYTHON_PN}-setuptools ${PYTHON_PN}-argparse ${PYTHON_PN}-debugger ${PYTHON_PN}-json"
+RDEPENDS_${PN}_class-native = "${PYTHON_PN}-setuptools-native"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-setuptools-scm_1.11.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-setuptools-scm_1.11.1.bb
deleted file mode 100644
index 2a3b97d..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-setuptools-scm_1.11.1.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "the blessed package to manage your versions by scm tags"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=838c366f69b72c5df05c96dff79b35f2"
-
-inherit pypi setuptools
-
-SRCNAME = "setuptools_scm"
-
-SRC_URI = "https://pypi.python.org/packages/84/aa/c693b5d41da513fed3f0ee27f1bf02a303caa75bbdfa5c8cc233a1d778c4/${SRCNAME}-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "4d19b2bc9580016d991f665ac20e2e8f"
-SRC_URI[sha256sum] = "8c45f738a23410c5276b0ed9294af607f491e4260589f1eb90df8312e23819bf"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-RDEPENDS_${PN} = "python-py python-setuptools python-argparse python-debugger python-json"
-
-
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-setuptools-scm_1.15.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-setuptools-scm_1.15.0.bb
new file mode 100644
index 0000000..5f9bb0b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-setuptools-scm_1.15.0.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-setuptools-scm.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-simplejson.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-simplejson.inc
new file mode 100644
index 0000000..2eed199
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-simplejson.inc
@@ -0,0 +1,17 @@
+SUMMARY = "Simple, fast, extensible JSON encoder/decoder for Python"
+HOMEPAGE = "http://cheeseshop.python.org/pypi/simplejson"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=c6338d7abd321c0b50a2a547e441c52e"
+
+SRC_URI[md5sum] = "426a9631d22851a7a970b1a677368b15"
+SRC_URI[sha256sum] = "953be622e88323c6f43fad61ffd05bebe73b9fd9863a46d68b052d2aa7d71ce2"
+
+inherit pypi
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-re \
+    ${PYTHON_PN}-io \
+    ${PYTHON_PN}-netserver \
+    ${PYTHON_PN}-numbers \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-simplejson_3.10.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-simplejson_3.10.0.bb
new file mode 100644
index 0000000..e33edfe
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-simplejson_3.10.0.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-simplejson.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-singledispatch_3.4.0.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-singledispatch_3.4.0.3.bb
index 87f46e5..44c9505 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-singledispatch_3.4.0.3.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-singledispatch_3.4.0.3.bb
@@ -9,5 +9,4 @@
 SRC_URI[md5sum] = "af2fc6a3d6cc5a02d0bf54d909785fcb"
 SRC_URI[sha256sum] = "5b06af87df13818d14f08a028e42f566640aef80805c3b50c5056b086e3c2b9c"
 
-PYPI_PACKAGE = "singledispatch"
 inherit pypi setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-six.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-six.inc
deleted file mode 100644
index e33c01d..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-six.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "Python 2 and 3 compatibility library"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=6f00d4a50713fa859858dd9abaa35b21"
-
-SRC_URI[md5sum] = "34eed507548117b2ab523ab14b2f8b55"
-SRC_URI[sha256sum] = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
-
-do_compile_append() {
-    ${PYTHON} setup.py -q bdist_egg --dist-dir ./
-}
-do_install_append() {
-    install -m 0644 ${S}/*.egg ${D}/${PYTHON_SITEPACKAGES_DIR}/
-}
-
-RDEPENDS_${PN} += "${PYTHON_PN}-io"
-
-BBCLASSEXTEND = "native nativesdk"
-
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-six_1.10.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-six_1.10.0.bb
deleted file mode 100644
index 9075745..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-six_1.10.0.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools
-require python-six.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-slip-dbus_0.6.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-slip-dbus_0.6.0.bb
deleted file mode 100644
index 2714f43..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-slip-dbus_0.6.0.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY = "Convenience functions for dbus services in Python 2.x"
-HOMEPAGE = "http://nphilipp.fedorapeople.org/python-slip/"
-DESCRIPTION = "\
-The Simple Library for Python 2.x packages contain miscellaneous code for \
-convenience, extension and workaround purposes. \
-\
-This package provides slip.dbus.service.Object, which is a dbus.service.Object \
-derivative that ends itself after a certain time without being used and/or if \
-there are no clients anymore on the message bus, as well as convenience \
-functions and decorators for integrating a dbus service with PolicyKit."
-
-SECTION = "devel/python"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
-SRCNAME = "python-slip"
-
-SRC_URI = "https://fedorahosted.org/released/${SRCNAME}/${SRCNAME}-${PV}.tar.bz2"
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit setuptools
-
-SRC_URI[md5sum] = "fb3299d75af1a67ca6679d96ce839da6"
-SRC_URI[sha256sum] = "f47361ec52b608309b83c71905e692b6b363eaf3b8a7afdeff866cd94463ad5c"
-
-do_compile_prepend() {
-    sed -e 's/@VERSION@/${PV}/g' setup.py.in > setup.py
-}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-slip-dbus_0.6.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-slip-dbus_0.6.1.bb
new file mode 100644
index 0000000..8081416
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-slip-dbus_0.6.1.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Convenience functions for dbus services in Python 2.x"
+HOMEPAGE = "http://nphilipp.fedorapeople.org/python-slip/"
+DESCRIPTION = "\
+The Simple Library for Python 2.x packages contain miscellaneous code for \
+convenience, extension and workaround purposes. \
+\
+This package provides slip.dbus.service.Object, which is a dbus.service.Object \
+derivative that ends itself after a certain time without being used and/or if \
+there are no clients anymore on the message bus, as well as convenience \
+functions and decorators for integrating a dbus service with PolicyKit."
+
+SECTION = "devel/python"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
+SRCNAME = "python-slip"
+
+SRC_URI = "https://github.com/nphilipp/${SRCNAME}/releases/download/${SRCNAME}-${PV}/${SRCNAME}-${PV}.tar.bz2"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
+
+SRC_URI[md5sum] = "a6d8ee96245fc21785d4c1c062c85f2f"
+SRC_URI[sha256sum] = "bc897f1ab6f5b4989f85548799aaeb84fde67bbba18e40341bfe1d7885c2fd9a"
+
+do_compile_prepend() {
+    sed -e 's/@VERSION@/${PV}/g' setup.py.in > setup.py
+}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-smbus.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-smbus.inc
new file mode 100644
index 0000000..ded30ce
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-smbus.inc
@@ -0,0 +1,18 @@
+SUMMARY = "Set of i2c tools for linux - Python module"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://smbusmodule.c;startline=1;endline=17;md5=fa24df321a520ff8e10f203425ab9fa8"
+
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/i2c-tools-${PV}.tar.bz2 \
+"
+SRC_URI[md5sum] = "7104a1043d11a5e2c7b131614eb1b962"
+SRC_URI[sha256sum] = "db5e69f2e2a6e3aa2ecdfe6a5f490b149c504468770f58921c8c5b8a7860a441"
+
+DEPENDS += "i2c-tools"
+
+S = "${WORKDIR}/i2c-tools-${PV}/py-smbus/"
+
+do_configure_prepend() {
+    # Adjust for OE header rename
+    sed -i s:linux/i2c-dev.h:linux/i2c-dev-user.h: Module.mk
+    sed -i s:linux/i2c-dev.h:linux/i2c-dev-user.h: smbusmodule.c
+}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-smbus_3.1.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-smbus_3.1.1.bb
deleted file mode 100644
index df47df6..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-smbus_3.1.1.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SUMMARY = "Set of i2c tools for linux - Python module"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://smbusmodule.c;startline=1;endline=17;md5=fa24df321a520ff8e10f203425ab9fa8"
-
-SRC_URI = "http://dl.lm-sensors.org/i2c-tools/releases/i2c-tools-${PV}.tar.bz2 \
-"
-SRC_URI[md5sum] = "0fdbff53ebd0b8d9249256d6c56480b1"
-SRC_URI[sha256sum] = "14d4d7d60d1c12e43f2befe239c682a5c44c27682f153d4b58c1e392d2db1700"
-
-DEPENDS = "i2c-tools"
-
-inherit distutils
-
-S = "${WORKDIR}/i2c-tools-${PV}/py-smbus/"
-
-do_configure_prepend() {
-    # Adjust for OE header rename
-    sed -i s:linux/i2c-dev.h:linux/i2c-dev-user.h: Module.mk
-    sed -i s:linux/i2c-dev.h:linux/i2c-dev-user.h: smbusmodule.c
-}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-smbus_3.1.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-smbus_3.1.2.bb
new file mode 100644
index 0000000..1b95778
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-smbus_3.1.2.bb
@@ -0,0 +1,2 @@
+inherit distutils
+require python-smbus.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-snimpy_0.8.11.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-snimpy_0.8.11.bb
new file mode 100644
index 0000000..cbdc6bd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-snimpy_0.8.11.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Interactive SNMP tool"
+DESCRIPTION = "Snimpy is a Python-based tool providing a simple interface to build SNMP query"
+HOMEPAGE = "https://pypi.python.org/pypi/snimpy"
+SECTION = "devel/python"
+
+DEPENDS = "libsmi python-cffi-native python-vcversioner-native"
+
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=7c53ab2d1240828625c3e093d049d4f4"
+
+SRCNAME = "snimpy"
+
+SRC_URI = "https://files.pythonhosted.org/packages/source/s/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "7f6270ce2e7206df165602e66d5ceb96"
+SRC_URI[sha256sum] = "10410614c7bff1053ca65bd760ce919f1a074f4988b857df4c57cf35847922b0"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} = "python-cffi \
+                  python-pycparser \
+                  python-pysnmp \
+                  python-setuptools \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-spidev.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-spidev.inc
new file mode 100644
index 0000000..1b93763
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-spidev.inc
@@ -0,0 +1,17 @@
+SUMMARY = "Python bindings for Linux SPI access through spidev"
+DESCRIPTION = "This project contains a python module for interfacing with SPI\
+devices from user space via the spidev linux kernel driver.\
+This is a modified version of the code originally found\
+[here](http://elk.informatik.fh-augsburg.de/da/da-49/trees/pyap7k/lang/py-spi)\
+All code is GPLv2 licensed unless explicitly stated otherwise."
+HOMEPAGE = "http://github.com/doceme/py-spidev"
+SECTION = "devel/python"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=54bdb9022ebb75ab68399cdaab97da60"
+SRCNAME = "spidev"
+
+SRC_URI[md5sum] = "f601676f1bb48b9aa3b3897f95216365"
+SRC_URI[sha256sum] = "09d2b5122f0dd79910713a11f9a0020f71537224bf829916def4fffc0ea59456"
+
+
+inherit pypi
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-sqlalchemy.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-sqlalchemy.inc
new file mode 100644
index 0000000..07e70d7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-sqlalchemy.inc
@@ -0,0 +1,20 @@
+DESCRIPTION = "Python SQL toolkit and Object Relational Mapper that gives \
+application developers the full power and flexibility of SQL"
+HOMEPAGE = "http://www.sqlalchemy.org/"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=452f4b8adb0feba42e5be5f1fbfbf538"
+
+PYPI_PACKAGE = "SQLAlchemy"
+inherit pypi
+
+SRC_URI[md5sum] = "938b1e5ca2372c3ec9a586996a3b5653"
+SRC_URI[sha256sum] = "b65cdc73cd348448ef0164f6c77d45a9f27ca575d3c5d71ccc33adf684bc6ef0"
+
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-json \
+    ${PYTHON_PN}-pickle \
+    ${PYTHON_PN}-logging \
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-numbers \
+    ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-sqlalchemy_0.7.9.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-sqlalchemy_0.7.9.bb
deleted file mode 100644
index 91e66db..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-sqlalchemy_0.7.9.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-DESCRIPTION = "Python SQL toolkit and Object Relational Mapper that gives \
-application developers the full power and flexibility of SQL"
-HOMEPAGE = "http://www.sqlalchemy.org/"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=baffc5e5f4804c92fc9be155fed70d41"
-RDEPENDS_${PN} += "python-numbers"
-
-SRCNAME = "SQLAlchemy"
-
-PYPI_PACKAGE = "SQLAlchemy"
-inherit pypi
-
-SRC_URI[md5sum] = "c4852d586d95a59fbc9358f4467875d5"
-SRC_URI[sha256sum] = "f7a305ad122144f364ce09a2d9ed5159d5f46ec43650653593e7dfa05d3294a1"
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit setuptools
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-sqlalchemy_1.1.9.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-sqlalchemy_1.1.9.bb
new file mode 100644
index 0000000..53c8fec
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-sqlalchemy_1.1.9.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-sqlalchemy.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-systemd_234.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-systemd_234.bb
new file mode 100644
index 0000000..ef11831
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-systemd_234.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Python interface for libsystemd"
+HOMEPAGE = "https://github.com/systemd/python-systemd"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=4fbd65380cdd255951079008b364516c"
+
+PYPI_PACKAGE = "systemd-python"
+DEPENDS += "systemd (<=234)"
+RDEPENDS_${PN} += "systemd"
+REQUIRED_DISTRO_FEATURES = "systemd"
+inherit pypi setuptools distro_features_check
+
+SRC_URI[md5sum] = "5071ea5bcb976186e92a3f5e75df221d"
+SRC_URI[sha256sum] = "fd0e44bf70eadae45aadc292cb0a7eb5b0b6372cd1b391228047d33895db83e7"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-tornado.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-tornado.inc
index 7e3ac8c..9b1cf41 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-tornado.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-tornado.inc
@@ -6,11 +6,11 @@
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://setup.py;startline=2;endline=15;md5=5ab7571a79ad62d0ca7aea308bac7560"
 
-SRC_URI[md5sum] = "d13a99dc0b60ba69f5f8ec1235e5b232"
-SRC_URI[sha256sum] = "c9c2d32593d16eedf2cec1b6a41893626a2649b40b21ca9c4cac4243bde2efbf"
+SRC_URI[md5sum] = "b4816ea209118667ffc52ce9ff06ac85"
+SRC_URI[sha256sum] = "2898f992f898cd41eeb8d53b6df75495f2f423b6672890aadaf196ea1448edcc"
 
 RDEPENDS_${PN} += "${PYTHON_PN}-compression ${PYTHON_PN}-numbers ${PYTHON_PN}-email ${PYTHON_PN}-subprocess \
-                   ${PYTHON_PN}-pkgutil ${PYTHON_PN}-html ${PYTHON_PN}-json ${PYTHON_PN}-certifi"
+                   ${PYTHON_PN}-pkgutil ${PYTHON_PN}-html ${PYTHON_PN}-json ${PYTHON_PN}-certifi ${PYTHON_PN}-threading"
 
 RDEPENDS_${PN}-test += "${PN} ${PYTHON_PN}-unittest"
 
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-tornado_4.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-tornado_4.4.2.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-tornado_4.3.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-tornado_4.4.2.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-typing.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-typing.inc
new file mode 100644
index 0000000..49da4fe
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-typing.inc
@@ -0,0 +1,9 @@
+SUMMARY = "Simple Python module defined by PEP 484."
+HOMEPAGE = "https://github.com/python/typing"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=64fc2b30b67d0a8423c250e0386ed72f"
+
+SRC_URI[md5sum] = "3996a747158e5591abf689c1c5f8f9db"
+SRC_URI[sha256sum] = "ca2daac7e393e8ee86e9140cd0cf0172ff6bb50ebdf0b06281770f98f31bff21"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-typing_3.5.3.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-typing_3.5.3.0.bb
new file mode 100644
index 0000000..04ce063
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-typing_3.5.3.0.bb
@@ -0,0 +1,2 @@
+inherit pypi setuptools
+require python-typing.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ujson_1.35.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ujson_1.35.bb
index 4ef3d18..238dc92 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ujson_1.35.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-ujson_1.35.bb
@@ -7,7 +7,6 @@
 SRC_URI[md5sum] = "42f77b0cce686dfa4da2e68480b1dd24"
 SRC_URI[sha256sum] = "f66073e5506e91d204ab0c614a148d5aa938bdbf104751be66f8ad7a222f5f86"
 
-PYPI_PACKAGE = "ujson"
 inherit pypi setuptools
 
 RDEPENDS_${PN} += "\
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-unidiff_0.5.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-unidiff_0.5.2.bb
deleted file mode 100644
index 3b018c7..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-unidiff_0.5.2.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "Unified diff parsing/metadata extraction library"
-HOMEPAGE = "http://github.com/matiasb/python-unidiff"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=4c434b08ef42fea235bb019b5e5a97b3"
-
-SRC_URI[md5sum] = "20dd70ba5a35bc95bf869322d6852227"
-SRC_URI[sha256sum] = "344330ec3637e96b44dca77e086b205645b55648cf4d2b80fc673200f8a6a7e9"
-
-inherit  pypi setuptools
-
-U = "${D}${LIBDIR}${PYTHON_SITEPACKAGES_DIR}"
-
-do_install_append (){
-    mv ${U}/tests ${U}/unidiff/
-}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-unidiff_0.5.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-unidiff_0.5.3.bb
new file mode 100644
index 0000000..6d40cca
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-unidiff_0.5.3.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Unified diff parsing/metadata extraction library"
+HOMEPAGE = "http://github.com/matiasb/python-unidiff"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4c434b08ef42fea235bb019b5e5a97b3"
+
+SRC_URI[md5sum] = "31a61729e64ee409135a2ccec80c7104"
+SRC_URI[sha256sum] = "79b4be3e5479dfc6d77747d23ec98200559ca6a842fad1f92c2a7eb56b99195b"
+
+inherit  pypi setuptools
+
+U = "${D}${LIBDIR}${PYTHON_SITEPACKAGES_DIR}"
+
+do_install_append (){
+    mv ${U}/tests ${U}/unidiff/
+}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-urllib3.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-urllib3.inc
index 938eb5e..485f57f 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-urllib3.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-urllib3.inc
@@ -1,10 +1,10 @@
 SUMMARY = "Python HTTP library with thread-safe connection pooling, file post support, sanity friendly, and more"
 HOMEPAGE = "https://github.com/shazow/urllib3"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=ea114851ad9a8c311aac8728a681a067"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=06dfcbb88fb0787a2039e26af11276f5"
 
-SRC_URI[md5sum] = "1eadd93bd5e58d3528d977111f2997ea"
-SRC_URI[sha256sum] = "d30dd4d1cbbc36ebab6e4a2076820cfe0c60f10adf087fecbc5a3edae79fdc81"
+SRC_URI[md5sum] = "e62d42006807308fea9556c17af8e250"
+SRC_URI[sha256sum] = "cc49b66adcb45e19c6944cff35eedb60ee2228f0afba51f4da29c47e7a398f15"
 
 RDEPENDS_${PN} += "\
     ${PYTHON_PN}-certifi \
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-urllib3_1.18.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-urllib3_1.2.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-urllib3_1.18.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-urllib3_1.2.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-vcversioner_2.16.0.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-vcversioner_2.16.0.0.bb
index f4a6009..cd6fa8d 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-vcversioner_2.16.0.0.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-vcversioner_2.16.0.0.bb
@@ -20,5 +20,6 @@
 RDEPENDS_${PN} += "\
     ${PYTHON_PN}-subprocess \
     "
+RDEPENDS_${PN}_class-native = ""
 
 BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-vobject_0.9.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-vobject_0.9.2.bb
deleted file mode 100644
index 56f0112..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-vobject_0.9.2.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "Python package for parsing and generating vCard and vCalendar files"
-HOMEPAGE = "http://vobject.skyhouseconsulting.com/"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
-
-SRC_URI[md5sum] = "ccf66aeb1c896d8c34ac62a8b4e7ecfb"
-SRC_URI[sha256sum] = "8b310c21a4d58e13aeb7e60fd846a1748e1c9c3374f3e2acc96f728c3ae5d6e1"
-
-inherit pypi setuptools
-
-RDEPENDS_${PN} += "\
-    ${PYTHON_PN}-dateutil \
-    ${PYTHON_PN}-numbers \
-    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-vobject_0.9.4.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-vobject_0.9.4.1.bb
new file mode 100644
index 0000000..fc95193
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-vobject_0.9.4.1.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Python package for parsing and generating vCard and vCalendar files"
+HOMEPAGE = "http://vobject.skyhouseconsulting.com/"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+SRC_URI[md5sum] = "73432a3e6e9a4788f73a9acc4d7b1fa8"
+SRC_URI[sha256sum] = "faea7d4fb3e2bc8ef6367e7f9b4ad0841aa1980fd5dd96d05c7a90e39880811c"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-dateutil \
+    ${PYTHON_PN}-numbers \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webcolors.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webcolors.inc
index ae91c62..fe1ab95 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webcolors.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webcolors.inc
@@ -1,8 +1,12 @@
 SUMMARY = "Simple Python module for working with HTML/CSS color definitions."
 LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=0c764ddee13cfbe0564c201d76ff19d6"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=358df7e9eb65e1843dbb36abd476c5c0"
 
-SRC_URI[md5sum] = "2e9da1bbb7a087c6108e05be64640afb"
-SRC_URI[sha256sum] = "b3b1c3a41e9c69d1982b76b6531239115519f91cc034a24e975749832dc51b8e"
+SRC_URI[md5sum] = "4733fa1077f680bbdd918cdef1e32c11"
+SRC_URI[sha256sum] = "e47e68644d41c0b1f1e4d939cfe4039bdf1ab31234df63c7a4f59d4766487206"
+
+RDEPENDS_${PN}_class-target = "\
+    ${PYTHON_PN}-stringold \
+"
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webcolors_1.5.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webcolors_1.7.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webcolors_1.5.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webcolors_1.7.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webencodings_0.5.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webencodings_0.5.bb
new file mode 100644
index 0000000..fbe6285
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-webencodings_0.5.bb
@@ -0,0 +1,10 @@
+SUMMARY = "Character encoding aliases for legacy web content"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;startline=8;endline=9;md5=2fc6c99a19e6dbde9f7a2239143c9d13"
+
+SRC_URI[md5sum] = "878714d45241f7970dffd8991d61fff9"
+SRC_URI[sha256sum] = "a5c55ee93b24e740fe951c37b5c228dccc1f171450e188555a775261cce1b904"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "${PYTHON_PN}-codecs"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-werkzeug.inc b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-werkzeug.inc
index 91c47ae..e55f56d 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-werkzeug.inc
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-werkzeug.inc
@@ -10,11 +10,13 @@
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=a68f5361a2b2ca9fdf26b38aaecb6faa"
 
-SRC_URI[md5sum] = "1d34afa1f19abcef4c0da51ebc2c4ea7"
-SRC_URI[sha256sum] = "e72c46bc14405cba7a26bd2ce28df734471bc9016bc8b4cb69466c2c14c2f7e5"
+SRC_URI[md5sum] = "cb4010478dd33905f95920e4880204a2"
+SRC_URI[sha256sum] = "455d7798ac263266dbd38d4841f7534dd35ca9c3da4a8df303f8488f38f3bcc0"
 
 PYPI_PACKAGE = "Werkzeug"
 
+CLEANBROKEN = "1"
+
 RDEPENDS_${PN} += " \
     ${PYTHON_PN}-datetime \
     ${PYTHON_PN}-difflib \
@@ -25,6 +27,7 @@
     ${PYTHON_PN}-netserver \
     ${PYTHON_PN}-numbers \
     ${PYTHON_PN}-pkgutil \
+    ${PYTHON_PN}-pprint \
     ${PYTHON_PN}-subprocess \
     ${PYTHON_PN}-threading \
     ${PYTHON_PN}-unixadmin \
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-werkzeug_0.11.11.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-werkzeug_0.11.15.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-werkzeug_0.11.11.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-werkzeug_0.11.15.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-wrapt_1.10.8.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-wrapt_1.10.8.bb
new file mode 100644
index 0000000..58aa1bd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-wrapt_1.10.8.bb
@@ -0,0 +1,15 @@
+SUMMARY = "A Python module for decorators, wrappers and monkey patching."
+HOMEPAGE = "http://wrapt.readthedocs.org/"
+LICENSE = "BSD"
+SECTION = "devel/python"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=82704725592991ea88b042d150a66303"
+
+SRC_URI[md5sum] = "7c2a7e6262acc396ef6528b3d66bd047"
+SRC_URI[sha256sum] = "4ea17e814e39883c6cf1bb9b0835d316b2f69f0f0882ffe7dad1ede66ba82c73"
+
+inherit setuptools pypi
+
+RDEPENDS_${PN}_class-target += "\
+    ${PYTHON_PN}-stringold \
+    ${PYTHON_PN}-threading \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-yappi_0.94.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-yappi_0.94.bb
deleted file mode 100644
index 83f2bc9..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-yappi_0.94.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-SUMMARY  = "Yet Another Python Profiler"
-HOMEPAGE = "http://yappi.googlecode.com/"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://PKG-INFO;md5=ad426a7287507a8db02778ff586d5370"
-
-SRC_URI[md5sum] = "a02c49efe783c4e31d6bbd805a37adec"
-SRC_URI[sha256sum] = "15cc17dba1252ecaae29ced1e96c216165d93fd3e9ea05dff1f5e5866f16bd59"
-
-PYPI_PACKAGE = "yappi"
-inherit pypi setuptools
-
-RDEPENDS_${PN} += "\
-    ${PYTHON_PN}-pickle \
-    ${PYTHON_PN}-threading \
-    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-yappi_0.98.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-yappi_0.98.bb
new file mode 100644
index 0000000..51308c8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-yappi_0.98.bb
@@ -0,0 +1,15 @@
+SUMMARY  = "Yet Another Python Profiler"
+HOMEPAGE = "http://yappi.googlecode.com/"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://PKG-INFO;md5=6b131c3041637f6a5175a43112dde05c"
+
+SRC_URI[md5sum] = "dc56240575c99938a924eaeb7c0d8beb"
+SRC_URI[sha256sum] = "5f657129e1b9b952379ffbc009357d0dcdb58c50f3bfe88ffbb992e4b27b263c"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-pickle \
+    ${PYTHON_PN}-threading \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-zopeinterface_4.2.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-zopeinterface_4.2.0.bb
deleted file mode 100644
index 985074b..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-zopeinterface_4.2.0.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "Interface definitions for Zope products"
-LICENSE = "ZPL-2.1"
-LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e54fd776274c1b7423ec128974bd9d46"
-
-SRC_URI[md5sum] = "2950a6db7e985e19c7a846cc20f5d82a"
-SRC_URI[sha256sum] = "36762743940a075283e1fb22a2ec9e8231871dace2aa00599511ddc4edf0f8f9"
-
-PYPI_PACKAGE = "zope.interface"
-inherit pypi setuptools
-
-RPROVIDES_${PN} += "zope-interfaces"
-FILES_${PN}-dbg += "${PYTHON_SITEPACKAGES_DIR}/*.egg/*/*/.debug"
-FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/zope/interface/*.c"
-FILES_${PN}-doc += "${PYTHON_SITEPACKAGES_DIR}/zope/interface/*.txt"
-FILES_${PN}-tests = " \
-        ${PYTHON_SITEPACKAGES_DIR}/zope/interface/tests \
-        ${PYTHON_SITEPACKAGES_DIR}/zope/interface/common/tests \
-"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-zopeinterface_4.3.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-zopeinterface_4.3.3.bb
new file mode 100644
index 0000000..7596394
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python-zopeinterface_4.3.3.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Interface definitions for Zope products"
+LICENSE = "ZPL-2.1"
+LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e54fd776274c1b7423ec128974bd9d46"
+
+SRC_URI[md5sum] = "ba3f32eacaea66094b7e2ae2788cec89"
+SRC_URI[sha256sum] = "8780ef68ca8c3fe1abb30c058a59015129d6e04a6b02c2e56b9c7de6078dfa88"
+
+PYPI_PACKAGE = "zope.interface"
+inherit pypi setuptools
+
+RPROVIDES_${PN} += "zope-interfaces"
+FILES_${PN}-dbg += "${PYTHON_SITEPACKAGES_DIR}/*.egg/*/*/.debug"
+FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/zope/interface/*.c"
+FILES_${PN}-doc += "${PYTHON_SITEPACKAGES_DIR}/zope/interface/*.txt"
+FILES_${PN}-tests = " \
+        ${PYTHON_SITEPACKAGES_DIR}/zope/interface/tests \
+        ${PYTHON_SITEPACKAGES_DIR}/zope/interface/common/tests \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-anyjson_0.3.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-anyjson_0.3.3.bb
new file mode 100644
index 0000000..199e225
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-anyjson_0.3.3.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-anyjson.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-babel_2.3.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-babel_2.3.4.bb
new file mode 100644
index 0000000..05084ac
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-babel_2.3.4.bb
@@ -0,0 +1,5 @@
+inherit setuptools3
+require python-babel.inc
+
+# Requires _pydecimal.py which is in misc
+RDEPENDS_${PN} += "${PYTHON_PN}-misc"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-can_1.5.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-can_1.5.2.bb
new file mode 100644
index 0000000..a1d45b8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-can_1.5.2.bb
@@ -0,0 +1,4 @@
+require python-can.inc
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "python3-sqlite3"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cassandra-driver_3.8.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cassandra-driver_3.8.0.bb
new file mode 100644
index 0000000..34f149d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cassandra-driver_3.8.0.bb
@@ -0,0 +1,8 @@
+inherit setuptools3
+require python-cassandra-driver.inc
+
+# Requires concurrent which is currently in -misc
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-misc \
+    ${PYTHON_PN}-numbers \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-certifi_2016.9.26.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-certifi_2017.1.23.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-certifi_2016.9.26.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-certifi_2017.1.23.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cffi_1.8.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cffi_1.9.1.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cffi_1.8.3.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cffi_1.9.1.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-chardet_3.0.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-chardet_3.0.2.bb
new file mode 100644
index 0000000..038043c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-chardet_3.0.2.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-chardet.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-click_6.6.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-click_6.6.bb
deleted file mode 100644
index 1920644..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-click_6.6.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools3
-require python-click.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-click_6.7.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-click_6.7.bb
new file mode 100644
index 0000000..ecd1514
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-click_6.7.bb
@@ -0,0 +1,4 @@
+inherit pypi setuptools3
+require python-click.inc
+
+RDEPENDS_${PN} += "${PYTHON_PN}-enum"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cryptography-vectors_1.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cryptography-vectors_1.7.2.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cryptography-vectors_1.4.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cryptography-vectors_1.7.2.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cryptography_1.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cryptography_1.7.2.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cryptography_1.4.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cryptography_1.7.2.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cython_0.24.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cython_0.25.2.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cython_0.24.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-cython_0.25.2.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dateutil_2.5.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dateutil_2.6.0.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dateutil_2.5.3.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dateutil_2.6.0.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-decorator_4.0.10.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-decorator_4.0.10.bb
deleted file mode 100644
index 844cbdc..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-decorator_4.0.10.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit setuptools3
-require python-decorator.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-decorator_4.0.11.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-decorator_4.0.11.bb
new file mode 100644
index 0000000..7840b20
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-decorator_4.0.11.bb
@@ -0,0 +1,6 @@
+inherit setuptools3
+require python-decorator.inc
+
+RDEPENDS_${PN}_class-target += "\
+    ${PYTHON_PN}-enum \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dnspython_1.15.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dnspython_1.15.0.bb
new file mode 100644
index 0000000..26024c6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-dnspython_1.15.0.bb
@@ -0,0 +1,9 @@
+inherit setuptools3
+require python-dnspython.inc
+
+# Requires _pydecimal.py which is in misc
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-enum \
+    ${PYTHON_PN}-misc \
+    ${PYTHON_PN}-selectors \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-flask-login_0.3.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-flask-login_0.4.0.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-flask-login_0.3.2.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-flask-login_0.4.0.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-flask_0.11.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-flask_0.12.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-flask_0.11.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-flask_0.12.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-humanize_0.5.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-humanize_0.5.1.bb
new file mode 100644
index 0000000..04464ac
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-humanize_0.5.1.bb
@@ -0,0 +1,2 @@
+inherit pypi setuptools3
+require python-humanize.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-idna_2.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-idna_2.5.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-idna_2.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-idna_2.5.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-jinja2_2.8.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-jinja2_2.8.bb
deleted file mode 100644
index 61156b6..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-jinja2_2.8.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools3
-require python-jinja2.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-jinja2_2.9.5.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-jinja2_2.9.5.bb
new file mode 100644
index 0000000..8375f8c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-jinja2_2.9.5.bb
@@ -0,0 +1,7 @@
+inherit pypi setuptools3
+require python-jinja2.inc
+
+# Requires _pydecimal which is in misc
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-misc \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-jsonschema_2.5.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-jsonschema_2.6.0.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-jsonschema_2.5.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-jsonschema_2.6.0.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-lxml/0001-lxml.etree-Add-empty-variadic-argument.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-lxml/0001-lxml.etree-Add-empty-variadic-argument.patch
new file mode 100644
index 0000000..bb012dc
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-lxml/0001-lxml.etree-Add-empty-variadic-argument.patch
@@ -0,0 +1,40 @@
+From 36e64cf2f0676ee422c1fd41456967f3015b2fa3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Apr 2017 17:10:45 -0700
+Subject: [PATCH] lxml.etree: Add empty variadic argument
+
+format checker says that argument 4 is a printf formatted argument
+but there is no more arguments to follow
+
+Fixes libxslt format warnings
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/lxml/lxml.etree.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/lxml/lxml.etree.c b/src/lxml/lxml.etree.c
+index d482091..faab06c 100644
+--- a/src/lxml/lxml.etree.c
++++ b/src/lxml/lxml.etree.c
+@@ -186086,7 +186086,7 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
+  *         except:
+  */
+             __pyx_t_26 = __Pyx_PyObject_AsString(__pyx_v_message); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(19, 228, __pyx_L18_except_error)
+-            xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, __pyx_t_26);
++            xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, __pyx_t_26, "");
+ 
+             /* "src/lxml/xsltext.pxi":229
+  *                 c_inst_node.name, _cstr(e))
+@@ -186136,7 +186136,7 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
+  *     except:
+  */
+             __pyx_t_26 = __Pyx_PyObject_AsString(__pyx_v_message); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(19, 234, __pyx_L18_except_error)
+-            xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, __pyx_t_26);
++            xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, __pyx_t_26, "");
+ 
+             /* "src/lxml/xsltext.pxi":235
+  *                 "Error executing extension element '%s'", c_inst_node.name)
+-- 
+2.12.2
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-lxml_3.6.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-lxml_3.6.4.bb
deleted file mode 100644
index ff4bc7f..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-lxml_3.6.4.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit setuptools3
-require python-lxml.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-lxml_3.7.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-lxml_3.7.3.bb
new file mode 100644
index 0000000..8b13d2d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-lxml_3.7.3.bb
@@ -0,0 +1,6 @@
+inherit setuptools3
+require python-lxml.inc
+
+SRC_URI = "${PYPI_SRC_URI} \
+           file://0001-lxml.etree-Add-empty-variadic-argument.patch \
+           "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-multidict/0001-Allow-calling-make-clean-without-sphinx-build.patch b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-multidict/0001-Allow-calling-make-clean-without-sphinx-build.patch
new file mode 100644
index 0000000..d1d7ef5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-multidict/0001-Allow-calling-make-clean-without-sphinx-build.patch
@@ -0,0 +1,34 @@
+From 39e13b4e3f7a1d1dd748e80cee241d511865d4e8 Mon Sep 17 00:00:00 2001
+From: Pascal Bach <pascal.bach@nextrem.ch>
+Date: Mon, 16 Jan 2017 21:29:12 +0100
+Subject: [PATCH] Allow calling make clean without sphinx-build
+
+Currently make clean fails without sphinx-build installed
+However sphinx-build is not really necessary to do a clean.
+This trick makes the docs/Makefile use the false binary instead of
+sphinx-build for the check when a clean is done.
+
+Upstream-Status: Submitted https://github.com/aio-libs/multidict/pull/41
+
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 8f525f3..6d601e5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -51,8 +51,8 @@ clean:
+ 	rm -rf coverage
+ 	rm -rf build
+ 	rm -rf cover
+-	make -C docs clean
+-	python setup.py clean
++	make -C docs clean SPHINXBUILD=false
++	python3 setup.py clean
+ 	rm -f multidict/_multidict.html
+ 	rm -f multidict/_multidict.c
+ 	rm -f multidict/_multidict.*.so
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-multidict_2.1.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-multidict_2.1.4.bb
new file mode 100644
index 0000000..62895d2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-multidict_2.1.4.bb
@@ -0,0 +1,11 @@
+SUMMARY = "Multidicts are useful for working with HTTP headers, URL query args etc."
+HOMEPAGE = "https://github.com/aio-libs/multidict/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+inherit pypi setuptools3
+
+SRC_URI += "file://0001-Allow-calling-make-clean-without-sphinx-build.patch"
+
+SRC_URI[md5sum] = "051d92edec87fd98e43ea83f3ce6072d"
+SRC_URI[sha256sum] = "a77aa8c9f68846c3b5db43ff8ed2a7a884dbe845d01f55113a3fba78518c4cd7"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-paho-mqtt_1.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-paho-mqtt_1.2.bb
new file mode 100644
index 0000000..4981e61
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-paho-mqtt_1.2.bb
@@ -0,0 +1,3 @@
+inherit setuptools3
+require python-paho-mqtt.inc
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-passlib_1.6.5.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-passlib_1.7.1.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-passlib_1.6.5.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-passlib_1.7.1.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-prompt-toolkit_1.0.7.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-prompt-toolkit_1.0.13.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-prompt-toolkit_1.0.7.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-prompt-toolkit_1.0.13.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-psutil_5.2.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-psutil_5.2.0.bb
new file mode 100644
index 0000000..c1969ea
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-psutil_5.2.0.bb
@@ -0,0 +1,4 @@
+inherit pypi setuptools3
+require python-psutil.inc
+
+RDEPENDS_${PN} += "${PYTHON_PN}-netclient"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-py_1.4.31.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-py_1.4.32.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-py_1.4.31.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-py_1.4.32.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyalsaaudio_0.8.4.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyalsaaudio_0.8.4.bb
new file mode 100644
index 0000000..b7da1a4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyalsaaudio_0.8.4.bb
@@ -0,0 +1,2 @@
+require python-pyalsaaudio.inc
+inherit pypi setuptools3
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyasn1_0.1.9.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyasn1_0.2.3.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyasn1_0.1.9.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyasn1_0.2.3.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pybind11_1.8.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pybind11_2.0.1.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pybind11_1.8.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pybind11_2.0.1.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pycparser_2.14.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pycparser_2.14.bb
deleted file mode 100644
index b30db54..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pycparser_2.14.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools3
-require python-pycparser.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pycparser_2.17.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pycparser_2.17.bb
new file mode 100644
index 0000000..7cc024e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pycparser_2.17.bb
@@ -0,0 +1,6 @@
+inherit pypi setuptools3
+require python-pycparser.inc
+
+RDEPENDS_${PN}_class-target += "\
+    ${PYTHON_PN}-netclient \
+    " 
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pymisp_2.4.51.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pymisp_2.4.67.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pymisp_2.4.51.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pymisp_2.4.67.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pymongo_3.3.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pymongo_3.3.0.bb
deleted file mode 100644
index 5164b18..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pymongo_3.3.0.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools3
-require python-pymongo.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pymongo_3.4.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pymongo_3.4.0.bb
new file mode 100644
index 0000000..3b250a1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pymongo_3.4.0.bb
@@ -0,0 +1,10 @@
+inherit pypi setuptools3
+require python-pymongo.inc
+
+# Requires _pydecimal which is in misc
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-enum \
+    ${PYTHON_PN}-misc \
+    ${PYTHON_PN}-selectors \
+    ${PYTHON_PN}-subprocess \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyopenssl_16.1.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyopenssl_16.2.0.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyopenssl_16.1.0.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyopenssl_16.2.0.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyparsing_2.2.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyparsing_2.2.0.bb
new file mode 100644
index 0000000..0805fee
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyparsing_2.2.0.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-pyparsing.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyserial_3.1.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyserial_3.1.1.bb
deleted file mode 100644
index 17ed3f8..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyserial_3.1.1.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-inherit setuptools3
-require python-pyserial.inc
-
-do_install_append() {
-    rm -f ${D}${bindir}/miniterm.py
-    rmdir ${D}${bindir}
-}
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyserial_3.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyserial_3.3.bb
new file mode 100644
index 0000000..44c1368
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyserial_3.3.bb
@@ -0,0 +1,9 @@
+inherit setuptools3
+require python-pyserial.inc
+
+do_install_append() {
+    rm -f ${D}${bindir}/miniterm.py
+    rmdir ${D}${bindir}
+}
+
+RDEPENDS_${PN} += "${PYTHON_PN}-enum ${PYTHON_PN}-selectors"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pysocks_1.5.7.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pysocks_1.5.7.bb
deleted file mode 100644
index 6b09355..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pysocks_1.5.7.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools3
-require python-pysocks.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pysocks_1.6.6.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pysocks_1.6.6.bb
new file mode 100644
index 0000000..f8aa01b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pysocks_1.6.6.bb
@@ -0,0 +1,8 @@
+inherit pypi setuptools3
+require python-pysocks.inc
+
+RDEPENDS_${PN}_class-target += "\
+    ${PYTHON_PN}-enum \
+    ${PYTHON_PN}-netclient \
+    ${PYTHON_PN}-selectors \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pytest-runner_2.11.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pytest-runner_2.11.1.bb
new file mode 100644
index 0000000..df56ba6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pytest-runner_2.11.1.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-pytest-runner.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pytest_3.0.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pytest_3.0.6.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pytest_3.0.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pytest_3.0.6.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pytz_2017.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pytz_2017.2.bb
new file mode 100755
index 0000000..19a89dc
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pytz_2017.2.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-pytz.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyyaml_3.12.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyyaml_3.12.bb
new file mode 100644
index 0000000..470aca6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-pyyaml_3.12.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-pyyaml.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-requests_2.11.1.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-requests_2.13.0.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-requests_2.11.1.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-requests_2.13.0.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-serpent_1.19.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-serpent_1.19.bb
new file mode 100644
index 0000000..199dcfa
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-serpent_1.19.bb
@@ -0,0 +1,8 @@
+inherit setuptools3
+require python-serpent.inc
+
+# Requires _pydecimal which is in misc
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-enum \
+    ${PYTHON_PN}-misc \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-setuptools-scm_1.15.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-setuptools-scm_1.15.0.bb
new file mode 100644
index 0000000..5bf5983
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-setuptools-scm_1.15.0.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-setuptools-scm.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-simplejson_3.10.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-simplejson_3.10.0.bb
new file mode 100644
index 0000000..d44bc15
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-simplejson_3.10.0.bb
@@ -0,0 +1,7 @@
+inherit setuptools3
+require python-simplejson.inc
+
+# Requires _pydecimal which is in misc
+RDEPENDS_${PN} += " \
+    ${PYTHON_PN}-misc \
+"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-six_1.10.0.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-six_1.10.0.bb
deleted file mode 100644
index 7f76157..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-six_1.10.0.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools3
-require python-six.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-smbus_3.1.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-smbus_3.1.2.bb
new file mode 100644
index 0000000..b357bcd
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-smbus_3.1.2.bb
@@ -0,0 +1,2 @@
+inherit distutils3
+require python-smbus.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-spidev_3.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-spidev_3.2.bb
new file mode 100644
index 0000000..610611e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-spidev_3.2.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-spidev.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-sqlalchemy_1.1.9.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-sqlalchemy_1.1.9.bb
new file mode 100644
index 0000000..01f1e97
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-sqlalchemy_1.1.9.bb
@@ -0,0 +1,5 @@
+inherit setuptools3
+require python-sqlalchemy.inc
+
+# Requires _pydecimal.py which is in misc
+RDEPENDS_${PN} += "${PYTHON_PN}-enum ${PYTHON_PN}-misc"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-systemd_234.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-systemd_234.bb
new file mode 100644
index 0000000..845b7d9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-systemd_234.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Python interface for libsystemd"
+HOMEPAGE = "https://github.com/systemd/python-systemd"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=4fbd65380cdd255951079008b364516c"
+
+PYPI_PACKAGE = "systemd-python"
+DEPENDS += "systemd (<=234)"
+RDEPENDS_${PN} += "systemd"
+REQUIRED_DISTRO_FEATURES = "systemd"
+inherit pypi setuptools3 distro_features_check
+
+SRC_URI[md5sum] = "5071ea5bcb976186e92a3f5e75df221d"
+SRC_URI[sha256sum] = "fd0e44bf70eadae45aadc292cb0a7eb5b0b6372cd1b391228047d33895db83e7"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-tornado_4.3.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-tornado_4.3.bb
deleted file mode 100644
index eecc1f0..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-tornado_4.3.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools3
-require python-tornado.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-tornado_4.4.2.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-tornado_4.4.2.bb
new file mode 100644
index 0000000..77c9fb5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-tornado_4.4.2.bb
@@ -0,0 +1,7 @@
+inherit pypi setuptools3
+require python-tornado.inc
+
+# Requires _compression which is currently located in misc
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-misc \
+    "
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-urllib3_1.18.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-urllib3_1.2.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-urllib3_1.18.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-urllib3_1.2.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-webcolors_1.5.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-webcolors_1.7.bb
similarity index 100%
rename from import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-webcolors_1.5.bb
rename to import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-webcolors_1.7.bb
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-werkzeug_0.11.11.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-werkzeug_0.11.11.bb
deleted file mode 100644
index af2d86a..0000000
--- a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-werkzeug_0.11.11.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit pypi setuptools3
-require python-werkzeug.inc
diff --git a/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-werkzeug_0.11.15.bb b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-werkzeug_0.11.15.bb
new file mode 100644
index 0000000..145a1de
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-devtools/python/python3-werkzeug_0.11.15.bb
@@ -0,0 +1,4 @@
+inherit pypi setuptools3
+require python-werkzeug.inc
+
+RDEPENDS_${PN} += "${PYTHON_PN}-misc"
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-cson/python-cson_git.bb b/import-layers/meta-openembedded/meta-python/recipes-extended/python-cson/python-cson_git.bb
new file mode 100644
index 0000000..efb338c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-cson/python-cson_git.bb
@@ -0,0 +1,21 @@
+# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Python library for CSON (schema-compressed JSON)"
+HOMEPAGE = "https://github.com/gt3389b/python-cson/"
+LICENSE = "MIT"
+SECTION = "devel/python"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7709d2635e63ab96973055a23c2a4cac"
+
+SRCREV = "f3f2898c44bb16b951d3e9f2fbf6d1c4158edda2"
+SRC_URI = "git://github.com/gt3389b/python-cson.git"
+
+S = "${WORKDIR}/git"
+
+RDEPENDS_${PN}_class-native = ""
+DEPENDS_append_class-native = " python-native "
+
+inherit setuptools
+
+BBCLASSEXTEND = "native"
+
diff --git a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted_3.10.7.bb b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted_3.10.7.bb
index 712c4b9..8335d08 100644
--- a/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted_3.10.7.bb
+++ b/import-layers/meta-openembedded/meta-python/recipes-extended/python-pyparted/python-pyparted_3.10.7.bb
@@ -24,4 +24,4 @@
 RDEPENDS_${PN} += "python-stringold python-codecs python-math parted (>= 2.3)"
 RDEPENDS_${PN}_class-native = ""
 
-BBCLASSEXTEND += "native"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-ruby/README b/import-layers/meta-openembedded/meta-ruby/README
index 5ce01bc..137bd13 100644
--- a/import-layers/meta-openembedded/meta-ruby/README
+++ b/import-layers/meta-openembedded/meta-ruby/README
@@ -1,18 +1,17 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: morty
+branch: pyro
 revision: HEAD
 
 URI: git://github.com/openembedded/meta-oe.git
-branch: morty
+branch: pyro
 revision: HEAD
 
-Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-ruby]' in the subject'
+Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-ruby][pyro]' in the subject'
 
 When sending single patches, please using something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-ruby][morty][PATCH'
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-ruby][pyro][PATCH'
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
-
diff --git a/import-layers/meta-openembedded/meta-ruby/recipes-devtools/ruby/bundler_git.bb b/import-layers/meta-openembedded/meta-ruby/recipes-devtools/ruby/bundler_git.bb
index 31e72e5..df89520 100644
--- a/import-layers/meta-openembedded/meta-ruby/recipes-devtools/ruby/bundler_git.bb
+++ b/import-layers/meta-openembedded/meta-ruby/recipes-devtools/ruby/bundler_git.bb
@@ -29,3 +29,5 @@
 RDEPENDS_${PN} = "git"
 
 BBCLASSEXTEND = "native"
+
+PNBLACKLIST[bundler] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130640/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-systemd/README b/import-layers/meta-openembedded/meta-systemd/README
index 073afae..804fc3f 100644
--- a/import-layers/meta-openembedded/meta-systemd/README
+++ b/import-layers/meta-openembedded/meta-systemd/README
@@ -1,13 +1,13 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: morty
+branch: pyro
 revision: HEAD
 
 And we're working to break the dependency on this one:
 
 URI: git://github.com/openembedded/meta-oe.git
-branch: morty
+branch: pyro
 revision: HEAD
 
 To make BBMASK'ing per layer possible the following directory structure is
@@ -15,12 +15,12 @@
 
 $[LAYERDIR}/<layer name>/recipes-<group-name>/<recipe-name>/<recipe-name>.bbappend
 
-Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-oe][meta-systemd]' in the subject'
+Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-oe][meta-systemd][pyro]' in the subject'
 
 When sending single patches, please use something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-oe][meta-systemd][morty][PATCH'
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-oe][meta-systemd][pyro][PATCH'
 
 You are encouraged to fork the mirror on github https://github.com/openembedded/meta-oe/ to share your patches, this is preferred for patch sets consisting of more than one patch. Other services like gitorious, repo.or.cz or self hosted setups are of course accepted as well, 'git fetch <remote>' works the same on all of them. We recommend github because it is free, easy to use, has been proven to be reliable and has a really good web GUI.
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
diff --git a/import-layers/meta-openembedded/meta-webserver/README b/import-layers/meta-openembedded/meta-webserver/README
index 1a63dcc..fab7217 100644
--- a/import-layers/meta-openembedded/meta-webserver/README
+++ b/import-layers/meta-openembedded/meta-webserver/README
@@ -13,14 +13,14 @@
 
 URI: git://github.com/openembedded/oe-core.git
 subdirectory: meta
-branch: morty
+branch: pyro 
 revision: HEAD
 
 For some recipes, the meta-oe layer is required:
 
 URI: git://github.com/openembedded/meta-oe.git
 subdirectory: meta-oe
-branch: morty
+branch: pyro 
 revision: HEAD
 
 
@@ -52,9 +52,12 @@
 -----------
 
 Send patches / pull requests to openembedded-devel@lists.openembedded.org
-with '[meta-webserver][morty]' in the subject.
+with '[meta-webserver][pyro]' in the subject.
 
-morty branch maintainer(s):
+When sending single patches, please use something like:
+'git send-email -M -1 --to=openembedded-devel@lists.openembedded.org --subject-prefix=meta-webserver][pyro][PATCH'
+
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
 
 
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache-mod/apache-websocket_git.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache-mod/apache-websocket_git.bb
index da33115..0beb3ed 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache-mod/apache-websocket_git.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache-mod/apache-websocket_git.bb
@@ -6,7 +6,7 @@
 
 inherit autotools-brokensep pkgconfig
 
-DEPENDS = "apache2 apache2-native"
+DEPENDS = "apache2 apache2-native pbzip2-native"
 RDEPENDS_${PN} += "apache2"
 
 # Original (github.com/disconnect/apache-websocket) is dead since 2012, the
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.23.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.23.bb
deleted file mode 100644
index aa26cc7..0000000
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.23.bb
+++ /dev/null
@@ -1,45 +0,0 @@
-DESCRIPTION = "The Apache HTTP Server is a powerful, efficient, and \
-extensible web server."
-SUMMARY = "Apache HTTP Server"
-HOMEPAGE = "http://httpd.apache.org/"
-DEPENDS = "expat-native pcre-native apr-native apr-util-native"
-SECTION = "net"
-LICENSE = "Apache-2.0"
-
-inherit autotools pkgconfig native
-
-SRC_URI = "http://archive.apache.org/dist/httpd/httpd-${PV}.tar.bz2 \
-           file://0001-configure-use-pkg-config-for-PCRE-detection.patch \
-          "
-
-S = "${WORKDIR}/httpd-${PV}"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
-SRC_URI[md5sum] = "04f19c60e810c028f5240a062668a688"
-SRC_URI[sha256sum] = "0c1694b2aad7765896faf92843452ee2555b9591ae10d4f19b245f2adfe85e58"
-
-EXTRA_OECONF = "--with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
-                --with-apr-util=${STAGING_BINDIR_CROSS}/apu-1-config \
-                --prefix=${prefix} --datadir=${datadir}/apache2 \
-               "
-
-do_install () {
-    install -d ${D}${bindir} ${D}${libdir}
-    cp server/gen_test_char ${D}${bindir}
-    install -m 755 support/apxs ${D}${bindir}/
-    install -m 755 httpd ${D}${bindir}/
-    install -d ${D}${datadir}/apache2/build
-    cp ${S}/build/*.mk ${D}${datadir}/apache2/build
-    cp build/*.mk ${D}${datadir}/apache2/build
-    cp ${S}/build/instdso.sh ${D}${datadir}/apache2/build
-
-    install -d ${D}${includedir}/apache2
-    cp ${S}/include/* ${D}${includedir}/apache2
-    cp include/* ${D}${includedir}/apache2
-    cp ${S}/os/unix/os.h ${D}${includedir}/apache2
-    cp ${S}/os/unix/unixd.h ${D}${includedir}/apache2
-
-    cp support/envvars-std ${D}${bindir}/envvars
-    chmod 755 ${D}${bindir}/envvars
-}
-
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.25.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.25.bb
new file mode 100644
index 0000000..99717d2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.25.bb
@@ -0,0 +1,45 @@
+DESCRIPTION = "The Apache HTTP Server is a powerful, efficient, and \
+extensible web server."
+SUMMARY = "Apache HTTP Server"
+HOMEPAGE = "http://httpd.apache.org/"
+DEPENDS = "expat-native pcre-native apr-native apr-util-native"
+SECTION = "net"
+LICENSE = "Apache-2.0"
+
+inherit autotools pkgconfig native
+
+SRC_URI = "${APACHE_MIRROR}/httpd/httpd-${PV}.tar.bz2 \
+           file://0001-configure-use-pkg-config-for-PCRE-detection.patch \
+          "
+
+S = "${WORKDIR}/httpd-${PV}"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
+SRC_URI[md5sum] = "2826f49619112ad5813c0be5afcc7ddb"
+SRC_URI[sha256sum] = "f87ec2df1c9fee3e6bfde3c8b855a3ddb7ca1ab20ca877bd0e2b6bf3f05c80b2"
+
+EXTRA_OECONF = "--with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
+                --with-apr-util=${STAGING_BINDIR_CROSS}/apu-1-config \
+                --prefix=${prefix} --datadir=${datadir}/apache2 \
+               "
+
+do_install () {
+    install -d ${D}${bindir} ${D}${libdir}
+    cp server/gen_test_char ${D}${bindir}
+    install -m 755 support/apxs ${D}${bindir}/
+    install -m 755 httpd ${D}${bindir}/
+    install -d ${D}${datadir}/apache2/build
+    cp ${S}/build/*.mk ${D}${datadir}/apache2/build
+    cp build/*.mk ${D}${datadir}/apache2/build
+    cp ${S}/build/instdso.sh ${D}${datadir}/apache2/build
+
+    install -d ${D}${includedir}/apache2
+    cp ${S}/include/* ${D}${includedir}/apache2
+    cp include/* ${D}${includedir}/apache2
+    cp ${S}/os/unix/os.h ${D}${includedir}/apache2
+    cp ${S}/os/unix/unixd.h ${D}${includedir}/apache2
+
+    cp support/envvars-std ${D}${bindir}/envvars
+    chmod 755 ${D}${bindir}/envvars
+}
+
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2/fix-libtool-name.patch b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2/fix-libtool-name.patch
deleted file mode 100644
index 027af04..0000000
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2/fix-libtool-name.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-Fix build scripts to use correct libtool filename
-
-Upstream-Status: Inappropriate [configuration]
-
----
- httpd-2.4.2/build/config_vars.sh.in |    2 +-
- httpd-2.4.2/configure               |    2 +-
- httpd-2.4.2/configure.in            |    2 +-
- httpd-2.4.2/support/apxs.in         |    2 +-
- 4 files changed, 4 insertions(+), 4 deletions(-)
-
---- a/build/config_vars.sh.in
-+++ b/build/config_vars.sh.in
-@@ -35,7 +35,7 @@ else
-    APU_CONFIG=@APU_CONFIG@
- fi
- 
--APR_LIBTOOL="`${APR_CONFIG} --apr-libtool`"
-+APR_LIBTOOL="`${APR_CONFIG} --apr-libtool | sed -e s,libtool,${host_alias}-libtool,`"
- APR_INCLUDEDIR="`${APR_CONFIG} --includedir`"
- test -n "@APU_CONFIG@" && APU_INCLUDEDIR="`${APU_CONFIG} --includedir`"
- 
---- a/configure
-+++ b/configure
-@@ -6205,7 +6205,7 @@ case $host in
-       if test "x$LTFLAGS" = "x"; then
-           LTFLAGS='--silent'
-       fi
--      my_libtool=`$apr_config --apr-libtool`
-+      my_libtool=`$apr_config --apr-libtool | sed -e s,libtool,${host_alias}-libtool,`
-       LIBTOOL="$my_libtool \$(LTFLAGS)"
-       libtoolversion=`$my_libtool --version`
-       case $libtoolversion in
---- a/configure.in
-+++ b/configure.in
-@@ -264,7 +264,7 @@ case $host in
-       if test "x$LTFLAGS" = "x"; then
-           LTFLAGS='--silent'
-       fi
--      my_libtool=`$apr_config --apr-libtool`
-+      my_libtool=`$apr_config --apr-libtool | sed -e s,libtool,${host_alias}-libtool,`
-       LIBTOOL="$my_libtool \$(LTFLAGS)"
-       libtoolversion=`$my_libtool --version`
-       case $libtoolversion in
---- a/support/apxs.in
-+++ b/support/apxs.in
-@@ -352,7 +352,7 @@ if ($apr_major_version < 2) {
-     }
- }
- 
--my $libtool = `$apr_config --apr-libtool`;
-+my $libtool = `$apr_config --apr-libtool| sed -e s,libtool,${host_alias}-libtool,`;
- chomp($libtool);
- 
- my $apr_includedir = `$apr_config --includes`;
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.23.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.23.bb
deleted file mode 100644
index 0cd762e..0000000
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.23.bb
+++ /dev/null
@@ -1,182 +0,0 @@
-DESCRIPTION = "The Apache HTTP Server is a powerful, efficient, and \
-extensible web server."
-SUMMARY = "Apache HTTP Server"
-HOMEPAGE = "http://httpd.apache.org/"
-DEPENDS = "libtool-native apache2-native openssl expat pcre apr apr-util"
-SECTION = "net"
-LICENSE = "Apache-2.0"
-
-SRC_URI = "http://archive.apache.org/dist/httpd/httpd-${PV}.tar.bz2 \
-           file://server-makefile.patch \
-           file://httpd-2.4.1-corelimit.patch \
-           file://httpd-2.4.4-export.patch \
-           file://httpd-2.4.1-selinux.patch \
-           file://apache-configure_perlbin.patch \
-           file://replace-lynx-to-curl-in-apachectl-script.patch \
-           file://apache-ssl-ltmain-rpath.patch \
-           file://httpd-2.4.3-fix-race-issue-of-dir-install.patch \
-           file://0001-configure-use-pkg-config-for-PCRE-detection.patch \
-           file://configure-allow-to-disable-selinux-support.patch \
-           file://init \
-           file://apache2-volatile.conf \
-           file://apache2.service \
-          "
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
-SRC_URI[md5sum] = "04f19c60e810c028f5240a062668a688"
-SRC_URI[sha256sum] = "0c1694b2aad7765896faf92843452ee2555b9591ae10d4f19b245f2adfe85e58"
-
-S = "${WORKDIR}/httpd-${PV}"
-
-inherit autotools update-rc.d pkgconfig systemd
-
-SYSTEMD_SERVICE_${PN} = "apache2.service"
-SYSTEMD_AUTO_ENABLE_${PN} = "disable"
-
-SSTATE_SCAN_FILES += "apxs config_vars.mk config.nice"
-
-CFLAGS_append = " -DPATH_MAX=4096"
-CFLAGS_prepend = "-I${STAGING_INCDIR}/openssl "
-EXTRA_OECONF = "--enable-ssl \
-    --with-ssl=${STAGING_LIBDIR}/.. \
-    --with-expat=${STAGING_LIBDIR}/.. \
-    --with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
-    --with-apr-util=${STAGING_BINDIR_CROSS}/apu-1-config \
-    --enable-info \
-    --enable-rewrite \
-    --with-dbm=sdbm \
-    --with-berkeley-db=no \
-    --localstatedir=/var/${BPN} \
-    --with-gdbm=no \
-    --with-ndbm=no \
-    --includedir=${includedir}/${BPN} \
-    --datadir=${datadir}/${BPN} \
-    --sysconfdir=${sysconfdir}/${BPN} \
-    --libexecdir=${libdir}/${BPN}/modules \
-    ap_cv_void_ptr_lt_long=no \
-    --enable-mpms-shared \
-    ac_cv_have_threadsafe_pollset=no"
-
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
-PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux"
-PACKAGECONFIG[openldap] = "--enable-ldap --enable-authnz-ldap,--disable-ldap --disable-authnz-ldap,openldap"
-
-do_install_append() {
-    install -d ${D}/${sysconfdir}/init.d
-    cat ${WORKDIR}/init | \
-        sed -e 's,/usr/sbin/,${sbindir}/,g' \
-            -e 's,/usr/bin/,${bindir}/,g' \
-            -e 's,/usr/lib,${libdir}/,g' \
-            -e 's,/etc/,${sysconfdir}/,g' \
-            -e 's,/usr/,${prefix}/,g' > ${D}/${sysconfdir}/init.d/${BPN}
-    chmod 755 ${D}/${sysconfdir}/init.d/${BPN}
-    # remove the goofy original files...
-    rm -rf ${D}/${sysconfdir}/${BPN}/original
-    # Expat should be found in the staging area via DEPENDS...
-    rm -f ${D}/${libdir}/libexpat.*
-
-    install -d ${D}${sysconfdir}/${BPN}/conf.d
-    install -d ${D}${sysconfdir}/${BPN}/modules.d
-
-    # Ensure configuration file pulls in conf.d and modules.d
-    printf "\nIncludeOptional ${sysconfdir}/${BPN}/conf.d/*.conf" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
-    printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.load" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
-    printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.conf\n\n" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
-    # match with that is in init script
-    printf "\nPidFile /run/httpd.pid" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
-    # Set 'ServerName' to fix error messages when restart apache service
-    sed -i 's/^#ServerName www.example.com/ServerName localhost/' ${D}/${sysconfdir}/${BPN}/httpd.conf
-
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/tmpfiles.d/
-        install -m 0644 ${WORKDIR}/apache2-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
-    fi
-
-    install -d ${D}${systemd_unitdir}/system
-    install -m 0644 ${WORKDIR}/apache2.service ${D}${systemd_unitdir}/system
-    sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apache2.service
-    sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/apache2.service
-
-    chown -R root:root ${D}
-}
-
-do_install_append_class-target() {
-    sed -i -e 's,${STAGING_DIR_HOST},,g' \
-           -e 's,APU_INCLUDEDIR = .*,APU_INCLUDEDIR = ,g' \
-           -e 's,APU_CONFIG = .*,APU_CONFIG = ,g' ${D}${datadir}/apache2/build/config_vars.mk
-
-    sed -i -e 's,${STAGING_DIR_HOST},,g' \
-           -e 's,".*/configure","configure",g' ${D}${datadir}/apache2/build/config.nice
-}
-
-SYSROOT_PREPROCESS_FUNCS += "apache_sysroot_preprocess"
-
-apache_sysroot_preprocess () {
-    install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
-    install -m 755 ${D}${bindir}/apxs ${SYSROOT_DESTDIR}${bindir_crossscripts}/
-    install -d ${SYSROOT_DESTDIR}${sbindir}/
-    install -m 755 ${D}${sbindir}/apachectl ${SYSROOT_DESTDIR}${sbindir}/
-    sed -i 's!my $installbuilddir = .*!my $installbuilddir = "${STAGING_DIR_HOST}/${datadir}/${BPN}/build";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs
-    sed -i 's!my $libtool = .*!my $libtool = "${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs
-
-    sed -i 's!^APR_CONFIG = .*!APR_CONFIG = ${STAGING_BINDIR_CROSS}/apr-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
-    sed -i 's!^APU_CONFIG = .*!APU_CONFIG = ${STAGING_BINDIR_CROSS}/apu-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
-    sed -i 's!^includedir = .*!includedir = ${STAGING_INCDIR}/apache2!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
-    sed -i 's!^CFLAGS = -I[^ ]*!CFLAGS = -I${STAGING_INCDIR}/openssl!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
-    sed -i 's!^EXTRA_LDFLAGS = .*!EXTRA_LDFLAGS = -L${STAGING_LIBDIR}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
-    sed -i 's!^EXTRA_INCLUDES = .*!EXTRA_INCLUDES = -I$(includedir) -I. -I${STAGING_INCDIR}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
-    sed -i 's!--sysroot=[^ ]*!--sysroot=${STAGING_DIR_HOST}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
-}
-
-#
-# implications - used by update-rc.d scripts
-#
-INITSCRIPT_NAME = "apache2"
-INITSCRIPT_PARAMS = "defaults 91 20"
-LEAD_SONAME = "libapr-1.so.0"
-
-PACKAGES = "${PN}-scripts ${PN}-doc ${PN}-dev ${PN}-dbg ${PN}"
-
-CONFFILES_${PN} = "${sysconfdir}/${BPN}/httpd.conf \
-                   ${sysconfdir}/${BPN}/magic \
-                   ${sysconfdir}/${BPN}/mime.types \
-                   ${sysconfdir}/init.d/${BPN} "
-
-# we override here rather than append so that .so links are
-# included in the runtime package rather than here (-dev)
-# and to get build, icons, error into the -dev package
-FILES_${PN}-dev = "${datadir}/${BPN}/build \
-                   ${datadir}/${BPN}/icons \
-                   ${datadir}/${BPN}/error \
-                   ${bindir}/apr-config ${bindir}/apu-config \
-                   ${libdir}/apr*.exp \
-                   ${includedir}/${BPN} \
-                   ${libdir}/*.la \
-                   ${libdir}/*.a \
-                   ${bindir}/apxs \
-                "
-
-
-# manual to manual
-FILES_${PN}-doc += " ${datadir}/${BPN}/manual"
-
-FILES_${PN}-scripts += "${bindir}/dbmmanage"
-
-#
-# override this too - here is the default, less datadir
-#
-FILES_${PN} =  "${bindir} ${sbindir} ${libexecdir} ${libdir}/lib*.so.* ${sysconfdir} \
-                ${sharedstatedir} ${localstatedir} /bin /sbin /lib/*.so* \
-                ${libdir}/${BPN}"
-
-# we want htdocs and cgi-bin to go with the binary
-FILES_${PN} += "${datadir}/${BPN}/htdocs ${datadir}/${BPN}/cgi-bin"
-
-#make sure the lone .so links also get wrapped in the base package
-FILES_${PN} += "${libdir}/lib*.so ${libdir}/pkgconfig/*"
-
-FILES_${PN}-dbg += "${libdir}/${BPN}/modules/.debug"
-
-RDEPENDS_${PN} += "openssl libgcc"
-RDEPENDS_${PN}-scripts += "perl ${PN}"
-RDEPENDS_${PN}-dev = "perl"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.25.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.25.bb
new file mode 100644
index 0000000..0ba7d3c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.25.bb
@@ -0,0 +1,182 @@
+DESCRIPTION = "The Apache HTTP Server is a powerful, efficient, and \
+extensible web server."
+SUMMARY = "Apache HTTP Server"
+HOMEPAGE = "http://httpd.apache.org/"
+DEPENDS = "libtool-native apache2-native openssl expat pcre apr apr-util"
+SECTION = "net"
+LICENSE = "Apache-2.0"
+
+SRC_URI = "${APACHE_MIRROR}/httpd/httpd-${PV}.tar.bz2 \
+           file://server-makefile.patch \
+           file://httpd-2.4.1-corelimit.patch \
+           file://httpd-2.4.4-export.patch \
+           file://httpd-2.4.1-selinux.patch \
+           file://apache-configure_perlbin.patch \
+           file://replace-lynx-to-curl-in-apachectl-script.patch \
+           file://apache-ssl-ltmain-rpath.patch \
+           file://httpd-2.4.3-fix-race-issue-of-dir-install.patch \
+           file://0001-configure-use-pkg-config-for-PCRE-detection.patch \
+           file://configure-allow-to-disable-selinux-support.patch \
+           file://init \
+           file://apache2-volatile.conf \
+           file://apache2.service \
+          "
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
+SRC_URI[md5sum] = "2826f49619112ad5813c0be5afcc7ddb"
+SRC_URI[sha256sum] = "f87ec2df1c9fee3e6bfde3c8b855a3ddb7ca1ab20ca877bd0e2b6bf3f05c80b2"
+
+S = "${WORKDIR}/httpd-${PV}"
+
+inherit autotools update-rc.d pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "apache2.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "disable"
+
+SSTATE_SCAN_FILES += "apxs config_vars.mk config.nice"
+
+CFLAGS_append = " -DPATH_MAX=4096"
+CFLAGS_prepend = "-I${STAGING_INCDIR}/openssl "
+EXTRA_OECONF = "--enable-ssl \
+    --with-ssl=${STAGING_LIBDIR}/.. \
+    --with-expat=${STAGING_LIBDIR}/.. \
+    --with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
+    --with-apr-util=${STAGING_BINDIR_CROSS}/apu-1-config \
+    --enable-info \
+    --enable-rewrite \
+    --with-dbm=sdbm \
+    --with-berkeley-db=no \
+    --localstatedir=/var/${BPN} \
+    --with-gdbm=no \
+    --with-ndbm=no \
+    --includedir=${includedir}/${BPN} \
+    --datadir=${datadir}/${BPN} \
+    --sysconfdir=${sysconfdir}/${BPN} \
+    --libexecdir=${libdir}/${BPN}/modules \
+    ap_cv_void_ptr_lt_long=no \
+    --enable-mpms-shared \
+    ac_cv_have_threadsafe_pollset=no"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
+PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux"
+PACKAGECONFIG[openldap] = "--enable-ldap --enable-authnz-ldap,--disable-ldap --disable-authnz-ldap,openldap"
+
+do_install_append() {
+    install -d ${D}/${sysconfdir}/init.d
+    cat ${WORKDIR}/init | \
+        sed -e 's,/usr/sbin/,${sbindir}/,g' \
+            -e 's,/usr/bin/,${bindir}/,g' \
+            -e 's,/usr/lib,${libdir}/,g' \
+            -e 's,/etc/,${sysconfdir}/,g' \
+            -e 's,/usr/,${prefix}/,g' > ${D}/${sysconfdir}/init.d/${BPN}
+    chmod 755 ${D}/${sysconfdir}/init.d/${BPN}
+    # remove the goofy original files...
+    rm -rf ${D}/${sysconfdir}/${BPN}/original
+    # Expat should be found in the staging area via DEPENDS...
+    rm -f ${D}/${libdir}/libexpat.*
+
+    install -d ${D}${sysconfdir}/${BPN}/conf.d
+    install -d ${D}${sysconfdir}/${BPN}/modules.d
+
+    # Ensure configuration file pulls in conf.d and modules.d
+    printf "\nIncludeOptional ${sysconfdir}/${BPN}/conf.d/*.conf" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
+    printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.load" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
+    printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.conf\n\n" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
+    # match with that is in init script
+    printf "\nPidFile /run/httpd.pid" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
+    # Set 'ServerName' to fix error messages when restart apache service
+    sed -i 's/^#ServerName www.example.com/ServerName localhost/' ${D}/${sysconfdir}/${BPN}/httpd.conf
+
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -d ${D}${sysconfdir}/tmpfiles.d/
+        install -m 0644 ${WORKDIR}/apache2-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
+    fi
+
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/apache2.service ${D}${systemd_unitdir}/system
+    sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apache2.service
+    sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/apache2.service
+
+    chown -R root:root ${D}
+}
+
+do_install_append_class-target() {
+    sed -i -e 's,${STAGING_DIR_HOST},,g' \
+           -e 's,APU_INCLUDEDIR = .*,APU_INCLUDEDIR = ,g' \
+           -e 's,APU_CONFIG = .*,APU_CONFIG = ,g' ${D}${datadir}/apache2/build/config_vars.mk
+
+    sed -i -e 's,${STAGING_DIR_HOST},,g' \
+           -e 's,".*/configure","configure",g' ${D}${datadir}/apache2/build/config.nice
+}
+
+SYSROOT_PREPROCESS_FUNCS += "apache_sysroot_preprocess"
+
+apache_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+    install -m 755 ${D}${bindir}/apxs ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+    install -d ${SYSROOT_DESTDIR}${sbindir}/
+    install -m 755 ${D}${sbindir}/apachectl ${SYSROOT_DESTDIR}${sbindir}/
+    sed -i 's!my $installbuilddir = .*!my $installbuilddir = "${STAGING_DIR_HOST}/${datadir}/${BPN}/build";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs
+    sed -i 's!my $libtool = .*!my $libtool = "${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs
+
+    sed -i 's!^APR_CONFIG = .*!APR_CONFIG = ${STAGING_BINDIR_CROSS}/apr-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
+    sed -i 's!^APU_CONFIG = .*!APU_CONFIG = ${STAGING_BINDIR_CROSS}/apu-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
+    sed -i 's!^includedir = .*!includedir = ${STAGING_INCDIR}/apache2!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
+    sed -i 's!^CFLAGS = -I[^ ]*!CFLAGS = -I${STAGING_INCDIR}/openssl!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
+    sed -i 's!^EXTRA_LDFLAGS = .*!EXTRA_LDFLAGS = -L${STAGING_LIBDIR}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
+    sed -i 's!^EXTRA_INCLUDES = .*!EXTRA_INCLUDES = -I$(includedir) -I. -I${STAGING_INCDIR}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
+    sed -i 's!--sysroot=[^ ]*!--sysroot=${STAGING_DIR_HOST}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
+}
+
+#
+# implications - used by update-rc.d scripts
+#
+INITSCRIPT_NAME = "apache2"
+INITSCRIPT_PARAMS = "defaults 91 20"
+LEAD_SONAME = "libapr-1.so.0"
+
+PACKAGES = "${PN}-scripts ${PN}-doc ${PN}-dev ${PN}-dbg ${PN}"
+
+CONFFILES_${PN} = "${sysconfdir}/${BPN}/httpd.conf \
+                   ${sysconfdir}/${BPN}/magic \
+                   ${sysconfdir}/${BPN}/mime.types \
+                   ${sysconfdir}/init.d/${BPN} "
+
+# we override here rather than append so that .so links are
+# included in the runtime package rather than here (-dev)
+# and to get build, icons, error into the -dev package
+FILES_${PN}-dev = "${datadir}/${BPN}/build \
+                   ${datadir}/${BPN}/icons \
+                   ${datadir}/${BPN}/error \
+                   ${bindir}/apr-config ${bindir}/apu-config \
+                   ${libdir}/apr*.exp \
+                   ${includedir}/${BPN} \
+                   ${libdir}/*.la \
+                   ${libdir}/*.a \
+                   ${bindir}/apxs \
+                "
+
+
+# manual to manual
+FILES_${PN}-doc += " ${datadir}/${BPN}/manual"
+
+FILES_${PN}-scripts += "${bindir}/dbmmanage"
+
+#
+# override this too - here is the default, less datadir
+#
+FILES_${PN} =  "${bindir} ${sbindir} ${libexecdir} ${libdir}/lib*.so.* ${sysconfdir} \
+                ${sharedstatedir} ${localstatedir} /bin /sbin /lib/*.so* \
+                ${libdir}/${BPN}"
+
+# we want htdocs and cgi-bin to go with the binary
+FILES_${PN} += "${datadir}/${BPN}/htdocs ${datadir}/${BPN}/cgi-bin"
+
+#make sure the lone .so links also get wrapped in the base package
+FILES_${PN} += "${libdir}/lib*.so ${libdir}/pkgconfig/*"
+
+FILES_${PN}-dbg += "${libdir}/${BPN}/modules/.debug"
+
+RDEPENDS_${PN} += "openssl libgcc"
+RDEPENDS_${PN}-scripts += "perl ${PN}"
+RDEPENDS_${PN}-dev = "perl"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb
index 82fbb77..ba39f97 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb
@@ -9,7 +9,7 @@
 
 DEPENDS = "libpcre openssl mysql5 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 
-SRC_URI = "http://www.cherokee-project.de/mirrors/cherokee/1.2/${PV}/cherokee-${PV}.tar.gz \
+SRC_URI = "http://mirror.aarnet.edu.au/pub/${BPN}/1.2/${PV}/${BP}.tar.gz \
            file://cherokee.init \
            file://cherokee.service \
            file://cherokee-install-configured.py-once.patch \
@@ -19,7 +19,7 @@
 
 inherit autotools pkgconfig binconfig update-rc.d systemd
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ffmpeg] = "--with-ffmpeg,--without-ffmpeg,libav"
 PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
 PACKAGECONFIG[geoip] = "--with-geoip,--without-geoip,geoip"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/monkey/files/0001-configure-Respect-LIBS-variable-from-env.patch b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/monkey/files/0001-configure-Respect-LIBS-variable-from-env.patch
new file mode 100644
index 0000000..7a22951
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/monkey/files/0001-configure-Respect-LIBS-variable-from-env.patch
@@ -0,0 +1,29 @@
+From b0526a9b5325bd4758dad8d14efd85c98ef2ebff Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 18:25:23 -0700
+Subject: [PATCH] configure: Respect LIBS variable from env
+
+For musl we need to pass -lexecinfo from env
+this change accomodates that
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 4286c34..f1c65db 100755
+--- a/configure
++++ b/configure
+@@ -620,7 +620,7 @@ LIBDEFS = -DSHAREDLIB -fPIC \$(DEFS)
+ INCDIR  = ./include
+ LDFLAGS = $LDFLAGS
+ DESTDIR = ../bin/monkey
+-LIBS    = -ldl $libs
++LIBS    = -ldl $libs ${LIBS}
+ OBJ     = monkey.o mk_method.o mk_mimetype.o mk_vhost.o mk_request.o \\
+           mk_header.o mk_config.o mk_signals.o \\
+           mk_user.o mk_utils.o mk_epoll.o mk_scheduler.o \\
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/monkey/monkey_1.5.6.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/monkey/monkey_1.5.6.bb
index be8ed37..97dc276 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/monkey/monkey_1.5.6.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/monkey/monkey_1.5.6.bb
@@ -7,7 +7,10 @@
 
 SECTION = "net"
 
+DEPENDS_append_libc-musl = " libexecinfo"
+
 SRC_URI = "http://monkey-project.com/releases/1.5/monkey-${PV}.tar.gz \
+           file://0001-configure-Respect-LIBS-variable-from-env.patch \
            file://monkey.service \
            file://monkey.init"
 
@@ -24,7 +27,13 @@
                 --disable-plugins=mbedtls \
                 --debug \
                 --malloc-libc"
+
+do_configure_prepend_libc-musl() {
+	export LIBS="-lexecinfo"
+}
+
 DISABLE_STATIC = ""
+CLEANBROKEN = "1"
 
 inherit autotools-brokensep pkgconfig update-rc.d systemd
 
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf
index 93f3c66..472fde1 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf
@@ -1,2 +1,2 @@
-d www www-data 0755 /run/nginx none
+d @NGINX_USER@ www-data 0755 /run/nginx none
 d root root 0755 /var/log/nginx none
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.conf b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.conf
index fb7e4b6..69d3a2a 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.conf
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.conf
@@ -1,5 +1,5 @@
 
-user  www-data;
+user  www;
 worker_processes  1;
 
 error_log  /var/log/nginx/error.log;
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.init b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.init
old mode 100755
new mode 100644
index 0f38b9c..1a2bd7d
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.init
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.init
@@ -3,7 +3,7 @@
 DAEMON=/usr/sbin/nginx
 NAME=nginx
 DESC=nginx
-PID=/var/run/nginx/nginx.pid
+PID=/run/nginx/nginx.pid
 
 test -x $DAEMON || exit 0
 
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc
index 36f2ac6..f98f299 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc
@@ -20,7 +20,9 @@
     file://nginx.service \
 "
 
-inherit update-rc.d useradd
+inherit update-rc.d useradd systemd
+
+SYSTEMD_SERVICE_${PN} = "nginx.service"
 
 CFLAGS_append = " -fPIE -pie"
 CXXFLAGS_append = " -fPIE -pie"
@@ -61,6 +63,11 @@
     --conf-path=${sysconfdir}/nginx/nginx.conf \
     --http-log-path=${localstatedir}/log/nginx/access.log \
     --error-log-path=${localstatedir}/log/nginx/error.log \
+    --http-client-body-temp-path=/run/nginx/client_body_temp \
+    --http-proxy-temp-path=/run/nginx/proxy_temp \
+    --http-fastcgi-temp-path=/run/nginx/fastcgi_temp \
+    --http-uwsgi-temp-path=/run/nginx/uwsgi_temp \
+    --http-scgi-temp-path=/run/nginx/scgi_temp \
     --pid-path=/run/nginx/nginx.pid \
     --prefix=${prefix} \
     --with-http_ssl_module \
@@ -98,6 +105,7 @@
     install -d ${D}${sysconfdir}/default/volatiles
     install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx
     sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx
+    sed -i 's,@NGINX_USER@,${NGINX_USER},g' ${D}${sysconfdir}/default/volatiles/99_nginx
 
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
         install -d ${D}${systemd_unitdir}/system
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.10.1.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.10.1.bb
deleted file mode 100644
index c5392c7..0000000
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.10.1.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require nginx.inc
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=0bb58ed0dfd4f5dbece3b52aba79f023"
-
-SRC_URI[md5sum] = "088292d9caf6059ef328aa7dda332e44"
-SRC_URI[sha256sum] = "1fd35846566485e03c0e318989561c135c598323ff349c503a6c14826487a801"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.10.3.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.10.3.bb
new file mode 100644
index 0000000..b62fd4c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.10.3.bb
@@ -0,0 +1,6 @@
+require nginx.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=0bb58ed0dfd4f5dbece3b52aba79f023"
+
+SRC_URI[md5sum] = "204a20cb4f0b0c9db746c630d89ff4ea"
+SRC_URI[sha256sum] = "75020f1364cac459cb733c4e1caed2d00376e40ea05588fb8793076a4c69dd90"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.11.10.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.11.10.bb
new file mode 100644
index 0000000..37565fc
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.11.10.bb
@@ -0,0 +1,10 @@
+require nginx.inc
+
+# 1.10.x branch is the current stable branch, the recommended default
+# 1.11.x is the current mainline branches containing all new features
+DEFAULT_PREFERENCE = "-1"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=903753de5f86a1ee0341fd2f9491b282"
+
+SRC_URI[md5sum] = "6fb10f579055d27a2240d51c7d85c190"
+SRC_URI[sha256sum] = "778b3cabb07633f754cd9dee32fc8e22582bce22bfa407be76a806abd935533d"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.11.5.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.11.5.bb
deleted file mode 100644
index ae05c96..0000000
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.11.5.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-require nginx.inc
-
-# 1.10.x branch is the current stable branch, the recommended default
-# 1.11.x is the current mainline branches containing all new features
-DEFAULT_PREFERENCE = "-1"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=0bb58ed0dfd4f5dbece3b52aba79f023"
-
-SRC_URI[md5sum] = "db43f2b19746f6f47401c3afc3924dc6"
-SRC_URI[sha256sum] = "223f8a2345a75f891098cf26ccdf208b293350388f51ce69083674c9432db6f6"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nostromo/nostromo_1.9.6.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nostromo/nostromo_1.9.6.bb
index 5493c12..16f45ce 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nostromo/nostromo_1.9.6.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nostromo/nostromo_1.9.6.bb
@@ -16,7 +16,7 @@
 
 TARGET_CC_ARCH += "${LDFLAGS}"
 
-DEPENDS = "openssl groff-native"
+DEPENDS = "openssl groff-native base-passwd"
 
 inherit update-rc.d
 
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.0.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.0.bb
index efa533a..2125b24 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.0.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.0.bb
@@ -4,6 +4,8 @@
 LICENSE = "BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://src/thttpd.c;beginline=1;endline=26;md5=0c5762c2c34dcbe9eb18815516502872"
 
+DEPENDS += "base-passwd"
+
 SRC_URI = "http://opensource.dyc.edu/pub/sthttpd/sthttpd-${PV}.tar.gz \
            file://thttpd.service \
            file://thttpd.conf \
@@ -49,4 +51,3 @@
 
 FILES_${PN} += "${SRV_DIR}"
 FILES_${PN}-dbg += "${SRV_DIR}/cgi-bin/.debug"
-
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-php/xdebug/xdebug_2.2.6.bb b/import-layers/meta-openembedded/meta-webserver/recipes-php/xdebug/xdebug_2.2.6.bb
deleted file mode 100644
index 1ecac88..0000000
--- a/import-layers/meta-openembedded/meta-webserver/recipes-php/xdebug/xdebug_2.2.6.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-SUMMARY = "Debugging and profiling extension for PHP"
-LICENSE = "Xdebug"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=34df3a274aa12b795417c65634c07f16"
-
-DEPENDS = "php"
-
-SRC_URI = "http://xdebug.org/files/xdebug-${PV}.tgz"
-
-SRC_URI[md5sum] = "f216356861e27284580d0208060ea7fa"
-SRC_URI[sha256sum] = "6dd1cba0605e75009331aa3625a19ef49ade5a75aa9fe2ff8a818108d2cce84e"
-
-inherit autotools
-
-EXTRA_OECONF += "--enable-xdebug -with-php-config=${STAGING_BINDIR_CROSS}/php-config"
-
-do_configure() {
-    cd ${S}
-    ${STAGING_BINDIR_CROSS}/phpize
-    cd ${B}
-
-    # Running autoreconf as autotools_do_configure would do here
-    # breaks the libtool configuration resulting in a failure later
-    # in do_compile. It's possible this may be fixable, however the
-    # easiest course of action for the moment is to avoid doing that.
-    oe_runconf
-}
-
-do_install() {
-    oe_runmake install INSTALL_ROOT=${D}
-}
-
-FILES_${PN} += "${libdir}/php5/extensions/*/*.so"
-FILES_${PN}-dbg += "${libdir}/php5/extensions/*/.debug"
-
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-php/xdebug/xdebug_2.5.1.bb b/import-layers/meta-openembedded/meta-webserver/recipes-php/xdebug/xdebug_2.5.1.bb
new file mode 100644
index 0000000..7741378
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-php/xdebug/xdebug_2.5.1.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Debugging and profiling extension for PHP"
+LICENSE = "Xdebug"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=34df3a274aa12b795417c65634c07f16"
+
+DEPENDS = "php"
+
+SRC_URI = "http://xdebug.org/files/xdebug-${PV}.tgz"
+
+SRC_URI[md5sum] = "6167b1e104f1108d77f08eb561a12b22"
+SRC_URI[sha256sum] = "7fda9020fd5a2c549ae5a692fcabbb00f74e39dda81d53d25e622bdab4880ec2"
+
+inherit autotools
+
+EXTRA_OECONF += "--enable-xdebug -with-php-config=${STAGING_BINDIR_CROSS}/php-config"
+
+do_configure() {
+    cd ${S}
+    ${STAGING_BINDIR_CROSS}/phpize
+    cd ${B}
+
+    # Running autoreconf as autotools_do_configure would do here
+    # breaks the libtool configuration resulting in a failure later
+    # in do_compile. It's possible this may be fixable, however the
+    # easiest course of action for the moment is to avoid doing that.
+    oe_runconf
+}
+
+do_install() {
+    oe_runmake install INSTALL_ROOT=${D}
+}
+
+FILES_${PN} += "${libdir}/php*/extensions/*/*.so"
+FILES_${PN}-dbg += "${libdir}/php*/extensions/*/.debug"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-support/spawn-fcgi/spawn-fcgi_1.6.4.bb b/import-layers/meta-openembedded/meta-webserver/recipes-support/spawn-fcgi/spawn-fcgi_1.6.4.bb
index 99e58bd..8b2ff44 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-support/spawn-fcgi/spawn-fcgi_1.6.4.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-support/spawn-fcgi/spawn-fcgi_1.6.4.bb
@@ -12,5 +12,5 @@
 
 inherit autotools
 
-PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6", "", d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-webadmin/netdata/netdata_git.bb b/import-layers/meta-openembedded/meta-webserver/recipes-webadmin/netdata/netdata_git.bb
index 317ddcc..de14064 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-webadmin/netdata/netdata_git.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-webadmin/netdata/netdata_git.bb
@@ -5,6 +5,7 @@
 
 SRC_URI = "git://github.com/firehol/netdata.git;protocol=https"
 SRCREV = "36c1304e37094174ea51001903058e65053107ca"
+PV = "1.0.1+git${SRCPV}"
 
 # patch to disable timeout because timeout are not available with actual version
 # of core-utils
@@ -18,6 +19,8 @@
 
 S = "${WORKDIR}/git"
 
+DEPENDS += "zlib"
+
 inherit pkgconfig autotools useradd systemd
 
 #systemd
diff --git a/import-layers/meta-openembedded/meta-xfce/README b/import-layers/meta-openembedded/meta-xfce/README
index 5291c82..a8e21a9 100644
--- a/import-layers/meta-openembedded/meta-xfce/README
+++ b/import-layers/meta-openembedded/meta-xfce/README
@@ -1,11 +1,11 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: morty
+branch: pyro
 revision: HEAD
 
 URI: git://github.com/openembedded/meta-oe.git
-branch: morty
+branch: pyro
 revision: HEAD
 meta-xfce depends on meta-oe, meta-gnome and meta-multimedia in this repository.
 
@@ -14,10 +14,10 @@
 
 BBMASK = "meta-xfce/recipes-multimedia"
 
-Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-xfce]' in the subject'
+Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-xfce][pyro]' in the subject'
 
 When sending single patches, please using something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-xfce][morty][PATCH'
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-xfce][pyro][PATCH'
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/files/0001-add_launcher-Exit-early-if-no-row-is-selected.patch b/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/files/0001-add_launcher-Exit-early-if-no-row-is-selected.patch
new file mode 100644
index 0000000..fb2dfc9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/files/0001-add_launcher-Exit-early-if-no-row-is-selected.patch
@@ -0,0 +1,37 @@
+From 1060e7ac8a63b93d56006718f0e9b1d9382b2226 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Mon, 31 Oct 2016 08:33:16 +0100
+Subject: [PATCH] add_launcher: Exit early if no row is selected
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Stolen from [1]
+
+[1] http://pkgs.fedoraproject.org/cgit/rpms/menulibre.git/tree/menulibre-add-launcher-none-check.patch
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ menulibre/MenulibreApplication.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/menulibre/MenulibreApplication.py b/menulibre/MenulibreApplication.py
+index e234800..ac73b03 100644
+--- a/menulibre/MenulibreApplication.py
++++ b/menulibre/MenulibreApplication.py
+@@ -1418,6 +1418,10 @@ class MenulibreWindow(Gtk.ApplicationWindow):
+         model, parent_data = self.treeview.get_parent_row_data()
+         model, row_data = self.treeview.get_selected_row_data()
+ 
++        # Exit early if no row is selected
++        if not row_data:
++            return
++
+         # Currently selected item is a directory, take its categories.
+         if row_data[2] == MenuItemTypes.DIRECTORY:
+             self.treeview.add_child(new_row_data)
+-- 
+2.5.5
+
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/files/0002-setup.py-avoid-usr-share-share-paths.patch b/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/files/0002-setup.py-avoid-usr-share-share-paths.patch
new file mode 100644
index 0000000..b63d4dc
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/files/0002-setup.py-avoid-usr-share-share-paths.patch
@@ -0,0 +1,40 @@
+From 99788b4557543c490493ce1b827538c49142c25d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Mon, 31 Oct 2016 09:08:51 +0100
+Subject: [PATCH] setup.py: avoid /usr/share/share paths
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ setup.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 5fc237d..c4fbf7c 100644
+--- a/setup.py
++++ b/setup.py
+@@ -143,7 +143,7 @@ class InstallAndUpdateDataDirectory(DistUtilsExtra.auto.install_auto):
+ 
+         if self.root:
+             target_data = os.path.relpath(self.install_data, self.root) + os.sep
+-            target_pkgdata = os.path.join(target_data, 'share', 'menulibre', '')
++            target_pkgdata = os.path.join(target_data, 'menulibre', '')
+             target_scripts = os.path.join(self.install_scripts, '')
+ 
+             data_dir = os.path.join(self.prefix, 'share', 'menulibre', '')
+@@ -152,7 +152,7 @@ class InstallAndUpdateDataDirectory(DistUtilsExtra.auto.install_auto):
+             # --user install
+             self.root = ''
+             target_data = os.path.relpath(self.install_data) + os.sep
+-            target_pkgdata = os.path.join(target_data, 'share', 'menulibre', '')
++            target_pkgdata = os.path.join(target_data, 'menulibre', '')
+             target_scripts = os.path.join(self.install_scripts, '')
+ 
+             # Use absolute paths
+-- 
+2.5.5
+
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/files/0003-MenulibreXdg.py-fix-loading-of-desktop-files.patch b/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/files/0003-MenulibreXdg.py-fix-loading-of-desktop-files.patch
new file mode 100644
index 0000000..1e92088
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/files/0003-MenulibreXdg.py-fix-loading-of-desktop-files.patch
@@ -0,0 +1,36 @@
+From 90098d835b62b38ac396d55b80a684770dbaacde Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Mon, 31 Oct 2016 15:50:52 +0100
+Subject: [PATCH] MenulibreXdg.py: fix loading of desktop files
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+fixes:
+| UnicodeDecodeError: 'ascii' codec can't decode byet 0xd9 in position 235: ordinal not in range(128)
+
+and information display not properly filled.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ menulibre/MenulibreXdg.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/menulibre/MenulibreXdg.py b/menulibre/MenulibreXdg.py
+index e04c5e6..14b2593 100644
+--- a/menulibre/MenulibreXdg.py
++++ b/menulibre/MenulibreXdg.py
+@@ -74,7 +74,7 @@ class MenulibreDesktopEntry:
+ 
+     def load_properties(self, filename):
+         """Load the properties."""
+-        input_file = open(filename)
++        input_file = open(filename, 'rt', encoding='utf-8')
+         self.load_properties_from_text(input_file.read())
+         input_file.close()
+ 
+-- 
+2.5.5
+
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/menulibre_2.1.3.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/menulibre_2.1.3.bb
new file mode 100644
index 0000000..69e52fe
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-apps/menulibre/menulibre_2.1.3.bb
@@ -0,0 +1,36 @@
+DESCRIPTION = "An advanced menu editor"
+HOMEPAGE = "https://launchpad.net/menulibre"
+SECTION = "x11/graphics"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = "python3-distutils-extra-native intltool-native"
+
+inherit distutils3 gtk-icon-cache
+
+SRC_URI = " \
+    https://launchpad.net/menulibre/2.1/${PV}/+download/${PN}-${PV}.tar.gz \
+    file://0001-add_launcher-Exit-early-if-no-row-is-selected.patch \
+    file://0002-setup.py-avoid-usr-share-share-paths.patch \
+    file://0003-MenulibreXdg.py-fix-loading-of-desktop-files.patch \
+"
+SRC_URI[md5sum] = "19d9d3337322eb5513454bb8cdfb739b"
+SRC_URI[sha256sum] = "bdd69740119902f1b1f8c7831155f4428403792a0a6c4287bcbb395c4e71fb31"
+
+do_install_append() {
+    sed -i 's:${D}::g' ${D}${datadir}/applications/menulibre.desktop
+}
+
+FILES_${PN} += " \
+    ${datadir}/applications \
+    ${datadir}/menulibre \
+    ${datadir}/icons \
+"
+
+RDEPENDS_${PN} += " \
+    gtk+3 \
+    python3-pygobject \
+    gnome-menus3 \
+    python3-unixadmin \
+    python3-psutil \
+"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/mousepad/mousepad_0.4.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/mousepad/mousepad_0.4.0.bb
index e87dea7..4ca21a6 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-apps/mousepad/mousepad_0.4.0.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-apps/mousepad/mousepad_0.4.0.bb
@@ -17,4 +17,3 @@
 EXTRA_OECONF = "--disable-gtk3"
 
 FILES_${PN} += "${datadir}/glib-2.0/schemas"
-
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/ristretto/ristretto_0.8.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/ristretto/ristretto_0.8.0.bb
deleted file mode 100644
index 66399cf..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-apps/ristretto/ristretto_0.8.0.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "Tiny image-viewer"
-HOMEPAGE = "http://goodies.xfce.org/projects/applications/ristretto"
-SECTION = "x11/application"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=35d145429ad3cbf5308d1dc93f66376b"
-DEPENDS = "exo libexif gtk+ dbus-glib libxfce4ui libxfce4util xfconf cairo"
-
-inherit xfce-app
-
-RRECOMMENDS_${PN} += "tumbler"
-
-SRC_URI[md5sum] = "94c778850325a4e5a12e3433c8a05432"
-SRC_URI[sha256sum] = "71625324cecda7199acbc95a3ea5132d0dcbf808771e7a209ea2b9503ae4f328"
-
-FILES_${PN} += "${datadir}/appdata"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/ristretto/ristretto_0.8.2.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/ristretto/ristretto_0.8.2.bb
new file mode 100644
index 0000000..c4baa72
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-apps/ristretto/ristretto_0.8.2.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Tiny image-viewer"
+HOMEPAGE = "http://goodies.xfce.org/projects/applications/ristretto"
+SECTION = "x11/application"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=35d145429ad3cbf5308d1dc93f66376b"
+DEPENDS = "exo libexif gtk+ dbus-glib libxfce4ui libxfce4util xfconf cairo file"
+
+inherit xfce-app
+
+RRECOMMENDS_${PN} += "tumbler"
+
+SRC_URI[md5sum] = "a8d8bb6b8fa7f868cfa3ae778630946e"
+SRC_URI[sha256sum] = "f8f3b77ca6fc77ddf8cff1bb52e5c5802c462663f72f324393b3a0360f6901b8"
+
+FILES_${PN} += "${datadir}/appdata"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xarchiver/xarchiver_git.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xarchiver/xarchiver_git.bb
index ca29922..e275af0 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xarchiver/xarchiver_git.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xarchiver/xarchiver_git.bb
@@ -8,7 +8,7 @@
 DEPENDS = "gtk+ glib-2.0 xfce4-dev-tools-native intltool-native"
 
 SRC_URI = "git://github.com/schnitzeltony/xarchiver.git;branch=master"
-SRCREV = "e80e90528c9aab2fe36d9078b945b44c05cc20d3"
+SRCREV = "5a26dd8ceab0af71b30c83286d7c7398a858c814"
 PV = "0.5.3"
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-notifyd/xfce4-notifyd_0.3.2.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-notifyd/xfce4-notifyd_0.3.2.bb
deleted file mode 100644
index 2894af4..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-notifyd/xfce4-notifyd_0.3.2.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "Easily themable notification daemon with transparency effects"
-HOMEPAGE = "http://goodies.xfce.org/projects/applications/xfce4-notifyd"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-DEPENDS = "libxfce4util libxfce4ui xfconf gtk+ dbus dbus-glib libnotify"
-
-inherit xfce-app
-
-SRC_URI[md5sum] = "9ee9bd823710c8753cb99f5a8028d528"
-SRC_URI[sha256sum] = "c554db55d9d759c32115e9e5da029bd68b07628438ef2bac7ae4b458567c85a4"
-
-do_compile_prepend() {
-    mkdir -p xfce4-notifyd
-}
-
-FILES_${PN} += " \
-    ${systemd_user_unitdir} \
-    ${libdir}/xfce4/notifyd \
-    ${datadir}/themes \
-    ${datadir}/dbus-1 \
-"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-notifyd/xfce4-notifyd_0.3.6.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-notifyd/xfce4-notifyd_0.3.6.bb
new file mode 100644
index 0000000..ac2360a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-notifyd/xfce4-notifyd_0.3.6.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Easily themable notification daemon with transparency effects"
+HOMEPAGE = "http://goodies.xfce.org/projects/applications/xfce4-notifyd"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+DEPENDS = "libxfce4util libxfce4ui xfconf gtk+ dbus dbus-glib libnotify \
+    dbus-glib-native \
+"
+
+inherit xfce-app
+
+SRC_URI[md5sum] = "19e602fa5e33afaf7563f069261ae1db"
+SRC_URI[sha256sum] = "f4ca7c0dadd3d4cdf8cd3c8ae60ccea77b8cf409f8517161796364eb1d766cf9"
+
+do_compile_prepend() {
+    mkdir -p xfce4-notifyd
+}
+
+FILES_${PN} += " \
+    ${systemd_user_unitdir} \
+    ${libdir}/xfce4/notifyd \
+    ${datadir}/themes \
+    ${datadir}/dbus-1 \
+"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-taskmanager/xfce4-taskmanager_1.1.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-taskmanager/xfce4-taskmanager_1.1.0.bb
deleted file mode 100644
index cb1be67..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-taskmanager/xfce4-taskmanager_1.1.0.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-SUMMARY = "Easy to use task manager"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-inherit xfce-app
-
-DEPENDS += "gtk+ cairo libwnck xfce4-dev-tools-native exo-native"
-
-SRC_URI[md5sum] = "7da465a4798629ebd8650fef62770ab7"
-SRC_URI[sha256sum] = "2e1eb161f966cbfbd68bd029fb59115bc5ab0c0704cb500d20e7d73967e59ecb"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-taskmanager/xfce4-taskmanager_1.2.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-taskmanager/xfce4-taskmanager_1.2.0.bb
new file mode 100644
index 0000000..f955585
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-taskmanager/xfce4-taskmanager_1.2.0.bb
@@ -0,0 +1,10 @@
+SUMMARY = "Easy to use task manager"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+inherit xfce-app
+
+DEPENDS += "gtk+ cairo libwnck libxmu xfce4-dev-tools-native exo-native"
+
+SRC_URI[md5sum] = "6f30ce3c688454812008281065a6e05c"
+SRC_URI[sha256sum] = "5746d473ad428b13db7c05cfcbc8099fbea13da6be26d3a9359bcb4de971ba69"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-terminal/xfce4-terminal_0.6.3.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-terminal/xfce4-terminal_0.6.3.bb
deleted file mode 100644
index 98ffec2..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-terminal/xfce4-terminal_0.6.3.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-SUMMARY = "Terminal emulator for the Xfce desktop environment"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-DEPENDS = "glib-2.0 gtk+ vte9 libxfce4ui"
-RDEPENDS_${PN} += "vte9-termcap"
-
-inherit xfce-app
-
-FILES_${PN} += "${datadir}/xfce4 \
-                ${datadir}/gnome-control-center"
-
-SRC_URI[md5sum] = "6a2816d8b0933cd707ed456ceb731399"
-SRC_URI[sha256sum] = "912f4716c2395a14a80620ef982b4af1e2a67a8df9a1ef0b802ecae826057e08"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-terminal/xfce4-terminal_0.8.4.bb b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-terminal/xfce4-terminal_0.8.4.bb
new file mode 100644
index 0000000..bc1d216
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-apps/xfce4-terminal/xfce4-terminal_0.8.4.bb
@@ -0,0 +1,12 @@
+SUMMARY = "Terminal emulator for the Xfce desktop environment"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS = "glib-2.0 gtk+3 vte libxfce4ui"
+
+inherit xfce-app
+
+FILES_${PN} += "${datadir}/xfce4 \
+                ${datadir}/gnome-control-center"
+
+SRC_URI[md5sum] = "7d9ea57301d6a770e5db8e7ecd6e4cda"
+SRC_URI[sha256sum] = "c5c1163b30e7a43d56ff92a25193bf9f29ce60e6cf43e5988530df79c84cfdc8"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-art/cursor-themes/openzone_1.2.3.bb b/import-layers/meta-openembedded/meta-xfce/recipes-art/cursor-themes/openzone_1.2.3.bb
index 9547736..df0ed50 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-art/cursor-themes/openzone_1.2.3.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-art/cursor-themes/openzone_1.2.3.bb
@@ -3,9 +3,8 @@
 SECTION = "x11/wm"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=a2f562fb8fb1e138b810d69521c4bcd7"
-DEPENDS = "icon-slicer-native xcursorgen-native"
 
-inherit allarch
+inherit allarch gtk-icon-cache
 
 SRC_URI = "http://xfce-look.org/CONTENT/content-files/111343-OpenZone-${PV}.tar.xz"
 SRC_URI[md5sum] = "4dae968cbd525072664ef7a4fc7c4154"
@@ -13,6 +12,9 @@
 
 S = "${WORKDIR}/OpenZone"
 
+do_compile() {
+}
+
 do_install() {
     install -d ${D}${datadir}/icons
     for theme in `find -name '*.tar.xz'`; do
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-bindings/vala/xfce4-vala_4.10.3.bb b/import-layers/meta-openembedded/meta-xfce/recipes-bindings/vala/xfce4-vala_4.10.3.bb
index 77fff63..c9eace8 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-bindings/vala/xfce4-vala_4.10.3.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-bindings/vala/xfce4-vala_4.10.3.bb
@@ -9,7 +9,7 @@
 SRC_URI[md5sum] = "0bbb1d6e473e0fe9b335b7b1b49d8a71"
 SRC_URI[sha256sum] = "07a8f2b7c09fcdd3d86e0c52adea3c58ca011d0142a93997a01b4af77260ae7b"
 
-EXTRA_OECONF = "-with-vala-api=0.32"
+EXTRA_OECONF = "-with-vala-api=0.34"
 
 FILES_${PN} += "${datadir}/vala-*/vapi"
 
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-core/images/core-image-minimal-xfce.bb b/import-layers/meta-openembedded/meta-xfce/recipes-core/images/core-image-minimal-xfce.bb
index a683c2d..f5c5c26 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-core/images/core-image-minimal-xfce.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-core/images/core-image-minimal-xfce.bb
@@ -1,7 +1,6 @@
 DESCRIPTION = "A XFCE minimal demo image."
 
 IMAGE_INSTALL = "packagegroup-core-boot \
-    ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
     packagegroup-core-x11 \
     packagegroup-xfce-base \
     kernel-modules \
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-extended/imsettings/imsettings/0001-Rename-use-of-stdout-and-stderr.patch b/import-layers/meta-openembedded/meta-xfce/recipes-extended/imsettings/imsettings/0001-Rename-use-of-stdout-and-stderr.patch
new file mode 100644
index 0000000..d77ce4d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-extended/imsettings/imsettings/0001-Rename-use-of-stdout-and-stderr.patch
@@ -0,0 +1,72 @@
+From 7ee62ef0083844ab2fffcd106e3ee2e5f29b2a91 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 12 Jul 2017 18:53:56 -0700
+Subject: [PATCH] Rename use of stdout and stderr
+
+Since it shadow the standard definitions especially
+seen on musl where libc defines these as macros they
+cause all short of compilation errors on musl, using
+a leading underscore makes it unique
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ imsettings-daemon/imsettings-proc.c | 28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/imsettings-daemon/imsettings-proc.c b/imsettings-daemon/imsettings-proc.c
+index 915e78b..b78fcff 100644
+--- a/imsettings-daemon/imsettings-proc.c
++++ b/imsettings-daemon/imsettings-proc.c
+@@ -39,8 +39,8 @@
+ #define MAXRESTART 3
+ 
+ typedef struct _IMSettingsProcInfo {
+-	GIOChannel     *stdout;
+-	GIOChannel     *stderr;
++	GIOChannel     *_stdout;
++	GIOChannel     *_stderr;
+ 	GPid            pid;
+ 	GTimeVal        started_time;
+ 	guint           id;
+@@ -368,12 +368,12 @@ _start_process(IMSettingsProc     *proc,
+ 					     &ofd, &efd,
+ 					     error)) {
+ 			pinfo->pid = pid;
+-			pinfo->stdout = g_io_channel_unix_new(ofd);
+-			pinfo->stderr = g_io_channel_unix_new(efd);
+-			g_io_channel_set_close_on_unref(pinfo->stdout, TRUE);
+-			g_io_channel_set_close_on_unref(pinfo->stderr, TRUE);
+-			pinfo->oid = g_io_add_watch(pinfo->stdout, G_IO_IN, _log_write_cb, proc);
+-			pinfo->eid = g_io_add_watch(pinfo->stderr, G_IO_IN, _log_write_cb, proc);
++			pinfo->_stdout = g_io_channel_unix_new(ofd);
++			pinfo->_stderr = g_io_channel_unix_new(efd);
++			g_io_channel_set_close_on_unref(pinfo->_stdout, TRUE);
++			g_io_channel_set_close_on_unref(pinfo->_stderr, TRUE);
++			pinfo->oid = g_io_add_watch(pinfo->_stdout, G_IO_IN, _log_write_cb, proc);
++			pinfo->eid = g_io_add_watch(pinfo->_stderr, G_IO_IN, _log_write_cb, proc);
+ 			g_get_current_time(&pinfo->started_time);
+ 			pinfo->id = g_child_watch_add(pid, _watch_im_status_cb, proc);
+ 
+@@ -521,13 +521,13 @@ imsettings_proc_get_property(GObject    *object,
+ static void
+ imsettings_proc_info_finalize(IMSettingsProcInfo *pinfo)
+ {
+-	if (pinfo->stdout) {
+-		g_io_channel_unref(pinfo->stdout);
+-		pinfo->stdout = NULL;
++	if (pinfo->_stdout) {
++		g_io_channel_unref(pinfo->_stdout);
++		pinfo->_stdout = NULL;
+ 	}
+-	if (pinfo->stderr) {
+-		g_io_channel_unref(pinfo->stderr);
+-		pinfo->stderr = NULL;
++	if (pinfo->_stderr) {
++		g_io_channel_unref(pinfo->_stderr);
++		pinfo->_stderr = NULL;
+ 	}
+ 	if (pinfo->oid > 0) {
+ 		g_source_remove(pinfo->oid);
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-extended/imsettings/imsettings_1.7.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-extended/imsettings/imsettings_1.7.1.bb
index 8c04db6..c3e15db 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-extended/imsettings/imsettings_1.7.1.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-extended/imsettings/imsettings_1.7.1.bb
@@ -7,11 +7,13 @@
 HOMEPAGE = "http://code.google.com/p/imsettings/"
 SECTION = "Applications/System"
 
-inherit autotools gtk-doc
+inherit autotools gtk-doc gobject-introspection
 
 SRC_URI = "https://bitbucket.org/tagoh/imsettings/downloads/${BPN}-${PV}.tar.bz2 \
            file://gtk-is-required-by-notify.patch \
-           file://multi-line-ACLOCAL_AMFLAGS-isnot-supported-by-autoreconf.patch"
+           file://multi-line-ACLOCAL_AMFLAGS-isnot-supported-by-autoreconf.patch \
+           file://0001-Rename-use-of-stdout-and-stderr.patch \
+           "
 
 SRC_URI[md5sum] = "ab439e21a7d86fa99fbc04586c755349"
 SRC_URI[sha256sum] = "12c35352386057ba68d69a0b7d9a1d0d01ebbd893aafe0a094c3158c8079ac9a"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfce4-mpc-plugin/xfce4-mpc-plugin_0.4.5.bb b/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfce4-mpc-plugin/xfce4-mpc-plugin_0.4.5.bb
deleted file mode 100644
index 964f5d3..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfce4-mpc-plugin/xfce4-mpc-plugin_0.4.5.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "Simple client plugin for Music Player Daemon"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-mpc-plugin"
-SECTION = "x11/application"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=3604d987e6dfdfc672c754d08953b0e0"
-
-inherit xfce-panel-plugin
-
-DEPENDS += "libmpd"
-
-# for now we recommend our own mpd-server
-RRECOMMENDS_${PN} = "mpd"
-
-SRC_URI[md5sum] = "718e64748e46908a44cd0b96eacbda28"
-SRC_URI[sha256sum] = "e71f57a28915c57459d6ce0eeeee1d0934f523c0ed083158c3d3b3836fc06fcf"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfce4-mpc-plugin/xfce4-mpc-plugin_0.5.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfce4-mpc-plugin/xfce4-mpc-plugin_0.5.0.bb
new file mode 100644
index 0000000..f709e4d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfce4-mpc-plugin/xfce4-mpc-plugin_0.5.0.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Simple client plugin for Music Player Daemon"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-mpc-plugin"
+SECTION = "x11/application"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3604d987e6dfdfc672c754d08953b0e0"
+
+inherit xfce-panel-plugin
+
+DEPENDS += "libmpd"
+
+# for now we recommend our own mpd-server
+RRECOMMENDS_${PN} = "mpd"
+
+SRC_URI[md5sum] = "13d5d95ef0c305bac45fde6231258e5d"
+SRC_URI[sha256sum] = "f1320916ae3112e6825699652a502cebfa78bb006c649b42d3d331dfe57b6cb0"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfmpc/xfmpc_0.2.2.bb b/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfmpc/xfmpc_0.2.2.bb
deleted file mode 100644
index b1cabd6..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfmpc/xfmpc_0.2.2.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-SUMMARY = "Music Player Daemon (MPD) client written in GTK+"
-HOMEPAGE = "http://goodies.xfce.org/projects/applications/xfmpc"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-DEPENDS = "gtk+ libxfce4util libxfce4ui libmpd vala-native"
-
-# for now we recommend our own mpd-server
-RRECOMMENDS_${PN} = "mpd"
-
-inherit xfce-app
-
-SRC_URI[md5sum] = "e4e198850c2467c47783969ac9c16ec0"
-SRC_URI[sha256sum] = "ed0cc2940bd5928bb30fab1531c22185a97bd0cc5beacd9e3be4d4cd994a6862"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfmpc/xfmpc_0.2.3.bb b/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfmpc/xfmpc_0.2.3.bb
new file mode 100644
index 0000000..3d902a1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-multimedia/xfmpc/xfmpc_0.2.3.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Music Player Daemon (MPD) client written in GTK+"
+HOMEPAGE = "http://goodies.xfce.org/projects/applications/xfmpc"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+DEPENDS = "gtk+ libxfce4util libxfce4ui libmpd vala-native"
+
+# for now we recommend our own mpd-server
+RRECOMMENDS_${PN} = "mpd"
+
+inherit xfce-app
+
+SRC_URI[md5sum] = "e2d2faeb7a6f62813e287f3d12522b71"
+SRC_URI[sha256sum] = "4189c0c82b66b758a6d5bc651493b675d3d46329e5f1a76ff26c448125f4fcb0"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/battery/xfce4-battery-plugin/fix-build-on-aarch64.patch b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/battery/xfce4-battery-plugin/fix-build-on-aarch64.patch
deleted file mode 100644
index ed4eec0..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/battery/xfce4-battery-plugin/fix-build-on-aarch64.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Upstream-Status: Backport from 
-
-http://git.xfce.org/panel-plugins/xfce4-battery-plugin/commit/?id=0f6926479728ca784a20b63d7c146a91e37d98fb
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From 0f6926479728ca784a20b63d7c146a91e37d98fb Mon Sep 17 00:00:00 2001
-From: Landry Breuil <landry@xfce.org>
-Date: Thu, 19 Mar 2015 20:42:24 +0100
-Subject: Fix build on aarch64 (bug #11724)
-
-
-diff --git a/panel-plugin/libacpi.c b/panel-plugin/libacpi.c
-index 530194d..efb5c9c 100644
---- a/panel-plugin/libacpi.c
-+++ b/panel-plugin/libacpi.c
-@@ -29,6 +29,7 @@
- #include <sys/types.h>
- #include <dirent.h>
- #include <glob.h>
-+#include <unistd.h>
- 
- #ifdef __FreeBSD__
- #include <fcntl.h>
-@@ -52,7 +53,6 @@ static int      acpifd;
- #include <sys/sysctl.h>
- #include <err.h>
- #include <errno.h>
--#include <unistd.h>
- 
- #endif
- 
--- 
-cgit v0.10.1
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/battery/xfce4-battery-plugin_1.0.5.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/battery/xfce4-battery-plugin_1.0.5.bb
deleted file mode 100644
index 5293c9e..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/battery/xfce4-battery-plugin_1.0.5.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-SUMMARY = "A battery monitor panel plugin for Xfce4, compatible with APM and ACP"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-battery-plugin"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-inherit xfce-panel-plugin
-
-SRC_URI += "file://fix-build-on-aarch64.patch"
-
-SRC_URI[md5sum] = "ca2d394e411a20442a519efa0d14f8ec"
-SRC_URI[sha256sum] = "f659b1af40ab72c93448affaa693ab551827a5600ce9b97a799b7c2419bdeb11"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/battery/xfce4-battery-plugin_1.1.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/battery/xfce4-battery-plugin_1.1.0.bb
new file mode 100644
index 0000000..9d2d954
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/battery/xfce4-battery-plugin_1.1.0.bb
@@ -0,0 +1,9 @@
+SUMMARY = "A battery monitor panel plugin for Xfce4, compatible with APM and ACP"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-battery-plugin"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+inherit xfce-panel-plugin
+
+SRC_URI[md5sum] = "f78d8d0cc13d40753a207a836869b953"
+SRC_URI[sha256sum] = "8c9deec8d95da4cc39d6d9091433e5822b6bbe07d80117045dd4dd3480427ece"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/clipman/xfce4-clipman-plugin_1.4.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/clipman/xfce4-clipman-plugin_1.4.0.bb
deleted file mode 100644
index 988fbb0..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/clipman/xfce4-clipman-plugin_1.4.0.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-SUMMARY = "Clipman is a clipboard manager for Xfce"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin"
-SECTION = "x11/application"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-
-inherit xfce-panel-plugin
-
-DEPENDS += "xfconf xproto libxtst"
-
-SRC_URI[md5sum] = "cd9c05e54e0fcc3f8d774cacdf18f42c"
-SRC_URI[sha256sum] = "a97671540663df1d90503f73695ac36e16fa2c832be8845ad9402529b8148294"
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[qrencode] = "--enable-libqrencode,--disable-libqrencode,qrencode"
-
-FILES_${PN} += "${datadir}/appdata"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/clipman/xfce4-clipman-plugin_1.4.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/clipman/xfce4-clipman-plugin_1.4.1.bb
new file mode 100644
index 0000000..aa6a5bc
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/clipman/xfce4-clipman-plugin_1.4.1.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Clipman is a clipboard manager for Xfce"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-clipman-plugin"
+SECTION = "x11/application"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+inherit xfce-panel-plugin
+
+DEPENDS += "xfconf xproto libxtst"
+
+SRC_URI[md5sum] = "5a5c01c347f4503c58902977e671ea09"
+SRC_URI[sha256sum] = "341cce9665a89e5930e754ef3e27ff97594da22b82b1403099ebcf5c18a5351f"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[qrencode] = "--enable-libqrencode,--disable-libqrencode,qrencode"
+
+FILES_${PN} += "${datadir}/appdata"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/closebutton/xfce4-closebutton-plugin_git.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/closebutton/xfce4-closebutton-plugin_git.bb
index 341107f..3cd4ee6 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/closebutton/xfce4-closebutton-plugin_git.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/closebutton/xfce4-closebutton-plugin_git.bb
@@ -10,7 +10,7 @@
 PV = "0.1.0+gitr${SRCPV}"
 
 SRC_URI = "git://github.com/schnitzeltony/xfce4-closebutton-plugin.git;branch=master"
-SRCREV = "bd76154afe26ba8a5251a1887d88f9d855301850"
+SRCREV = "02b74f13ad6f639234c8db1854963038b2780a2c"
 S = "${WORKDIR}/git"
 
 EXTRA_OECONF += "--enable-maintainer-mode"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/datetime/xfce4-datetime-plugin_0.6.2.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/datetime/xfce4-datetime-plugin_0.6.2.bb
deleted file mode 100644
index a97ba6c..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/datetime/xfce4-datetime-plugin_0.6.2.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-SUMMARY = "Panel plugin displaying date and time and a calendar when left-clicked"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-datetime-plugin"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-
-inherit xfce-panel-plugin
-
-SRC_URI[md5sum] = "fe604a251eadbc5b0f2b4737b85d92c8"
-SRC_URI[sha256sum] = "9734da671e8d1d7de5fae92093a05d653c9245b838542fb9aff3e10368cc9e2c"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/datetime/xfce4-datetime-plugin_0.7.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/datetime/xfce4-datetime-plugin_0.7.0.bb
new file mode 100644
index 0000000..af38ba5
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/datetime/xfce4-datetime-plugin_0.7.0.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Panel plugin displaying date and time and a calendar when left-clicked"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-datetime-plugin"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+inherit xfce-panel-plugin
+
+SRC_URI[md5sum] = "30caaa94c6c267827a31ad69fa472e51"
+SRC_URI[sha256sum] = "297f3077f7aee52a237449fbd8595e232267bc600b5b9e7ddc5baab306ed67b9"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/diskperf/xfce4-diskperf-plugin_2.5.5.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/diskperf/xfce4-diskperf-plugin_2.5.5.bb
deleted file mode 100644
index 801699c..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/diskperf/xfce4-diskperf-plugin_2.5.5.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-SUMMARY = "Panel plugin displaying instant disk/partition performance"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-diskperf-plugin"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d3e627798d6a60bece47aa8b3532e1f1"
-
-inherit xfce-panel-plugin
-
-SRC_URI[md5sum] = "199e4365cb3a1fcd5f6164044aedba17"
-SRC_URI[sha256sum] = "cbeb0c00f97362eef3f135afb77947aef73e938bae0386250a122ac6644b521b"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/diskperf/xfce4-diskperf-plugin_2.6.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/diskperf/xfce4-diskperf-plugin_2.6.1.bb
new file mode 100644
index 0000000..161b2bb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/diskperf/xfce4-diskperf-plugin_2.6.1.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Panel plugin displaying instant disk/partition performance"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-diskperf-plugin"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d3e627798d6a60bece47aa8b3532e1f1"
+
+inherit xfce-panel-plugin
+
+SRC_URI[md5sum] = "63d5f03934c2dbddb3ad7bf7f535cc23"
+SRC_URI[sha256sum] = "212ddc742be3eecb6ad5554e1b1df03d5685cb71f48a558d5f895de37c57e4fa"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/equake/xfce4-equake-plugin_1.3.8.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/equake/xfce4-equake-plugin_1.3.8.1.bb
new file mode 100644
index 0000000..8b24e98
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/equake/xfce4-equake-plugin_1.3.8.1.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "Equake XFCE is a panel plugin for the XFCE panel which monitors earthquakes and displays an update each time a new earthquake occurs."
+HOMEPAGE = "http://freecode.com/projects/equake-xfce"
+SECTION = "x11/application"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+inherit xfce-panel-plugin
+
+DEPENDS += "curl"
+
+SRC_URI[md5sum] = "07d42b8a3d440d6f1861048a6cc3a15a"
+SRC_URI[sha256sum] = "eff9cfd604d1bd998c5208176fbe2c6da705c250dce572f5e30b2c77f4ec741c"
+
+FILES_${PN} += "${libdir}/xfce4/panel-plugins/xfce4-equake-plugin"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/equake/xfce4-equake-plugin_1.3.8.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/equake/xfce4-equake-plugin_1.3.8.bb
deleted file mode 100644
index 76d25f8..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/equake/xfce4-equake-plugin_1.3.8.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-DESCRIPTION = "Equake XFCE is a panel plugin for the XFCE panel which monitors earthquakes and displays an update each time a new earthquake occurs."
-HOMEPAGE = "http://freecode.com/projects/equake-xfce"
-SECTION = "x11/application"
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-inherit xfce-panel-plugin
-
-SRC_URI[md5sum] = "c8f6cb2aec62513c343281eacc4fc395"
-SRC_URI[sha256sum] = "431575da3d49fea3afa60f02e83c8d74e20e9a229c9c4ec82c21d45e2c986925"
-
-FILES_${PN} += "${libdir}/xfce4/panel-plugins/xfce4-equake-plugin"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/fsguard/xfce4-fsguard-plugin_1.0.2.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/fsguard/xfce4-fsguard-plugin_1.0.2.bb
deleted file mode 100644
index 0f9199d..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/fsguard/xfce4-fsguard-plugin_1.0.2.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-DESCRIPTION = "The FSGuard panel plugin checks free space on a chosen mount point frequently and displays a message when a limit is reached"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-fsguard-plugin?&#recet_releases"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-
-inherit xfce-panel-plugin
-
-SRC_URI[md5sum] = "db7741d1827e428b005e94d25e2ec00a"
-SRC_URI[sha256sum] = "a2c8d59386ae3d23cf6bdd06a1cdd7a1b9473cf6f38ae106600b194c601040ae"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/fsguard/xfce4-fsguard-plugin_1.1.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/fsguard/xfce4-fsguard-plugin_1.1.0.bb
new file mode 100644
index 0000000..8b924ac
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/fsguard/xfce4-fsguard-plugin_1.1.0.bb
@@ -0,0 +1,9 @@
+DESCRIPTION = "The FSGuard panel plugin checks free space on a chosen mount point frequently and displays a message when a limit is reached"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-fsguard-plugin?&#recet_releases"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+inherit xfce-panel-plugin
+
+SRC_URI[md5sum] = "c9fcc1ff37f38e6ed518eca3b9887aa8"
+SRC_URI[sha256sum] = "6b038322b49d29625219e6a54497085b8f834b9c1fd15282ce286a6529d7c445"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/genmon/files/0001-Allow-timer-period-to-be-set-at-250ms-resolution.-Pa.patch b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/genmon/files/0001-Allow-timer-period-to-be-set-at-250ms-resolution.-Pa.patch
deleted file mode 100644
index 28c0eb1..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/genmon/files/0001-Allow-timer-period-to-be-set-at-250ms-resolution.-Pa.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 2d5fa307827a7b32af4f7b2ae0604f943e3a6e99 Mon Sep 17 00:00:00 2001
-From: John Lindgren <john.lindgren@aol.com>
-Date: Tue, 21 Aug 2012 19:33:45 -0400
-Subject: [PATCH] Allow timer period to be set at 250ms resolution.  Patch
- from Miguel Guedes.  Closes: #9102.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Upstream-Status: Applied [1]
-
-[1] http://git.xfce.org/panel-plugins/xfce4-genmon-plugin/commit/?id=2d5fa307827a7b32af4f7b2ae0604f943e3a6e99
-
-Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
----
- panel-plugin/config_gui.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/panel-plugin/config_gui.c b/panel-plugin/config_gui.c
-index a4c891d..90e55c1 100644
---- a/panel-plugin/config_gui.c
-+++ b/panel-plugin/config_gui.c
-@@ -106,8 +106,8 @@ int genmon_CreateConfigGUI (GtkWidget *vbox1,
-     gtk_widget_show (alignment1);
-     gtk_container_add (GTK_CONTAINER (eventbox1), alignment1);
- 
--    wSc_Period_adj = gtk_adjustment_new (15, 1, 60*60*24, 1, 1, 0);
--    wSc_Period = gtk_spin_button_new (GTK_ADJUSTMENT (wSc_Period_adj), 1, 0);
-+    wSc_Period_adj = gtk_adjustment_new (15, .25, 60*60*24, .25, 1, 0);
-+    wSc_Period = gtk_spin_button_new (GTK_ADJUSTMENT (wSc_Period_adj), .25, 2);
-     gtk_widget_show (wSc_Period);
-     gtk_container_add (GTK_CONTAINER (alignment1), wSc_Period);
-     gtk_tooltips_set_tip (tooltips, wSc_Period,
--- 
-1.7.6.5
-
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/genmon/xfce4-genmon-plugin_3.4.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/genmon/xfce4-genmon-plugin_3.4.0.bb
deleted file mode 100644
index a13db62..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/genmon/xfce4-genmon-plugin_3.4.0.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-DESCRIPTION = "This plugin cyclically spawns the indicated script/program, captures its output (stdout) and displays the resulting string into the panel."
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-genmon-plugin"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=68ad62c64cc6c620126241fd429e68fe"
-
-inherit xfce-panel-plugin
-
-SRC_URI += "file://0001-Allow-timer-period-to-be-set-at-250ms-resolution.-Pa.patch"
-
-SRC_URI[md5sum] = "24108b339bb040ed360266f53a245224"
-SRC_URI[sha256sum] = "b0a5337b49c85623dc89f3c9e47c7374b1d466af2418033d2d6dfc57a9790387"
-
-S = "${WORKDIR}/xfce4-genmon-plugin-3.4"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/genmon/xfce4-genmon-plugin_4.0.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/genmon/xfce4-genmon-plugin_4.0.0.bb
new file mode 100644
index 0000000..0624fe9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/genmon/xfce4-genmon-plugin_4.0.0.bb
@@ -0,0 +1,9 @@
+DESCRIPTION = "This plugin cyclically spawns the indicated script/program, captures its output (stdout) and displays the resulting string into the panel."
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-genmon-plugin"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=68ad62c64cc6c620126241fd429e68fe"
+
+inherit xfce-panel-plugin
+
+SRC_URI[md5sum] = "f28cfbf9c82e758a236c1f5fcbcb8a35"
+SRC_URI[sha256sum] = "a7db4f786166643076323dcde99ad12e92383cc29b4b806862d5483ec468c3e3"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mailwatch/xfce4-mailwatch-plugin_1.2.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mailwatch/xfce4-mailwatch-plugin_1.2.0.bb
index 8d4e77e..c822414 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mailwatch/xfce4-mailwatch-plugin_1.2.0.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mailwatch/xfce4-mailwatch-plugin_1.2.0.bb
@@ -10,5 +10,5 @@
 SRC_URI[md5sum] = "7263114ec0f2987a3aff15afeeb45577"
 SRC_URI[sha256sum] = "624acc8229a8593c0dfeb28f883f4958119a715cc81cecdbaf29efc8ab1edcad"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin/0001-check-for-fstab.h-during-configure.patch b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin/0001-check-for-fstab.h-during-configure.patch
new file mode 100644
index 0000000..e2165c2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin/0001-check-for-fstab.h-during-configure.patch
@@ -0,0 +1,87 @@
+From 09e325f8296eb9e63dc57ed137f4a9940f164563 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 21 Mar 2017 17:11:46 -0700
+Subject: [PATCH] check for fstab.h during configure
+
+fstab.h is not universally available, checking it during
+configure creates a knob to disable fstab reads in the
+plugin
+
+Makes it compile/build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Patch Reworked for xfce4-mount-plugin 0.6.4->1.1.2
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.ac           |  1 +
+ panel-plugin/devices.c | 22 +++++++++++++++++++---
+ 2 files changed, 20 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b131117..c633fef 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -69,6 +69,7 @@ AC_CHECK_HEADERS([sys/socket.h])
+ AC_CHECK_HEADERS([sys/time.h])
+ AC_CHECK_HEADERS([unistd.h])
+ AC_CHECK_HEADERS([sys/sockio.h])
++AC_CHECK_HEADERS([fstab.h])
+ AC_HEADER_SYS_WAIT
+ AC_PROG_GCC_TRADITIONAL
+ AC_TYPE_SIZE_T
+diff --git a/panel-plugin/devices.c b/panel-plugin/devices.c
+index 797b079..d29df56 100644
+--- a/panel-plugin/devices.c
++++ b/panel-plugin/devices.c
+@@ -24,8 +24,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+-
++#if HAVE_FSTAB_H
+ #include <fstab.h>
++#endif
++
+ #include <glib.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -468,11 +470,12 @@ disks_new (gboolean include_NFSs, gboolean *showed_fstab_dialog, gint length)
+ {
+     GPtrArray * pdisks; /* to be returned */
+     t_disk * pdisk;
+-    struct fstab *pfstab;
+     gboolean has_valid_mount_device;
+ 
+     pdisks = g_ptr_array_new();
+ 
++#if HAVE_FSTAB_H
++    struct fstab *pfstab;
+     /* open fstab */
+     if (setfsent()!=1)
+     {
+@@ -526,7 +529,20 @@ disks_new (gboolean include_NFSs, gboolean *showed_fstab_dialog, gint length)
+     } /* end for */
+ 
+     endfsent(); /* close file */
+-
++#else
++        /* popup notification dialog */
++        if (! (*showed_fstab_dialog) ) {
++            xfce_message_dialog (NULL,
++                               _("Xfce 4 Mount Plugin"),
++                               "dialog-info",
++                               _("Your /etc/fstab could not be read because fstab is not supported. This will severely degrade the plugin's abilities."),
++                               NULL,
++                               "gtk-ok",
++                               GTK_RESPONSE_OK,
++                               NULL);
++             *showed_fstab_dialog = TRUE;
++         }
++#endif
+     return pdisks;
+ }
+ 
+-- 
+2.9.3
+
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin_0.6.4.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin_0.6.4.bb
deleted file mode 100644
index 6dc2c17..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin_0.6.4.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-SUMMARY = "Mount/umount utility for the xfce panel"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-mount-plugin"
-SECTION = "x11/application"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-inherit xfce-panel-plugin
-
-SRC_URI[md5sum] = "f5917e9aa2a06bc6a872cc10d2ee4f6f"
-SRC_URI[sha256sum] = "541d7af84d7d0b00ae547aa1f438e2fac51ee4195c4d0a17173c4f72accb227d"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin_1.1.2.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin_1.1.2.bb
new file mode 100644
index 0000000..6700937
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin_1.1.2.bb
@@ -0,0 +1,11 @@
+SUMMARY = "Mount/umount utility for the xfce panel"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-mount-plugin"
+SECTION = "x11/application"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+inherit xfce-panel-plugin
+
+SRC_URI += "file://0001-check-for-fstab.h-during-configure.patch"
+SRC_URI[md5sum] = "7eba9696d82433a5577741214d34b588"
+SRC_URI[sha256sum] = "54578447abaf9da630a750d64acdc37d4fd20dda6460208d6d1ffaa9e43ee1a6"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/netload/xfce4-netload-plugin/0001-Do-not-include-sys-sysctl.h-its-unused-on-linux-port.patch b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/netload/xfce4-netload-plugin/0001-Do-not-include-sys-sysctl.h-its-unused-on-linux-port.patch
new file mode 100644
index 0000000..e354181
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/netload/xfce4-netload-plugin/0001-Do-not-include-sys-sysctl.h-its-unused-on-linux-port.patch
@@ -0,0 +1,25 @@
+From 7fcc7352ec11644ac8be4e9ec1584a5be3333684 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 12 Jul 2017 18:18:30 -0700
+Subject: [PATCH] Do not include sys/sysctl.h its unused on linux port
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ panel-plugin/os.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/panel-plugin/os.h b/panel-plugin/os.h
+index 473c2a4..9a5c544 100644
+--- a/panel-plugin/os.h
++++ b/panel-plugin/os.h
+@@ -170,7 +170,6 @@
+ #elif __linux__             /* L I N U X */
+ #  include <stdio.h>
+ #  include <sys/param.h>
+-#  include <sys/sysctl.h>
+ #  include <stdlib.h>
+ #  include <stdarg.h>
+ #  include <unistd.h>
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/netload/xfce4-netload-plugin_1.2.4.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/netload/xfce4-netload-plugin_1.2.4.bb
deleted file mode 100644
index c9f7a2a..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/netload/xfce4-netload-plugin_1.2.4.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-SUMMARY = "Panel plugin displaying current load of the network interfaces"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-netload-plugin"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=35a7203c41b86d15546dddc05995f97f"
-
-inherit xfce-panel-plugin
-
-SRC_URI[md5sum] = "ce53e1135e4bff5afcd899627110bd11"
-SRC_URI[sha256sum] = "fface918822c012d806717116566e54947ad7613b9290b45a18e2d5ffb8730d3"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/netload/xfce4-netload-plugin_1.3.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/netload/xfce4-netload-plugin_1.3.1.bb
new file mode 100644
index 0000000..35c8861
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/netload/xfce4-netload-plugin_1.3.1.bb
@@ -0,0 +1,12 @@
+SUMMARY = "Panel plugin displaying current load of the network interfaces"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-netload-plugin"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=35a7203c41b86d15546dddc05995f97f"
+
+inherit xfce-panel-plugin
+
+SRC_URI = "http://archive.xfce.org/src/panel-plugins/${BPN}/${@'${PV}'[0:3]}/${BPN}-${PV}.tar.bz2 \
+           file://0001-Do-not-include-sys-sysctl.h-its-unused-on-linux-port.patch \
+           "
+SRC_URI[md5sum] = "f25aa3242e3119b49f259a3e4a1af08b"
+SRC_URI[sha256sum] = "99762781099d1e0ab9aa6a7b30c2bd94d8f658dbe61c760410d5d42d0766391c"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/notes/files/01_fix_format-string.patch b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/notes/files/01_fix_format-string.patch
new file mode 100644
index 0000000..8066df0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/notes/files/01_fix_format-string.patch
@@ -0,0 +1,53 @@
+Fix formatting strings when compiling with Wformat options
+
+Imported from debian
+
+--- a/lib/application.c
++++ b/lib/application.c
+@@ -352,7 +352,7 @@ static void xnp_application_update_notes
+ 			XfconfChannel* _tmp16_;
+ 			const gchar* _tmp17_;
+ 			_tmp9_ = _ ("Select notes path");
+-			_tmp10_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _tmp9_);
++			_tmp10_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", _tmp9_);
+ 			g_object_ref_sink (_tmp10_);
+ 			error_dialog = _tmp10_;
+ 			_tmp11_ = error_dialog;
+@@ -419,7 +419,7 @@ static void xnp_application_update_notes
+ 		XfconfChannel* _tmp35_;
+ 		const gchar* _tmp36_;
+ 		_tmp27_ = _ ("Select notes path");
+-		_tmp28_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _tmp27_);
++		_tmp28_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", _tmp27_);
+ 		g_object_ref_sink (_tmp28_);
+ 		error_dialog = _tmp28_;
+ 		_tmp29_ = error_dialog;
+@@ -2082,7 +2082,7 @@ static void xnp_application_delete_windo
+ 		gint _tmp9_;
+ 		_tmp3_ = window;
+ 		_tmp4_ = _ ("Are you sure you want to delete this group?");
+-		_tmp5_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) _tmp3_, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, _tmp4_);
++		_tmp5_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) _tmp3_, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", _tmp4_);
+ 		g_object_ref_sink (_tmp5_);
+ 		dialog = _tmp5_;
+ 		_tmp6_ = dialog;
+@@ -2721,7 +2721,7 @@ void xnp_application_open_settings_dialo
+ 		e = _inner_error_;
+ 		_inner_error_ = NULL;
+ 		_tmp0_ = _ ("Unable to open the settings dialog");
+-		_tmp1_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _tmp0_);
++		_tmp1_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", _tmp0_);
+ 		g_object_ref_sink (_tmp1_);
+ 		error_dialog = _tmp1_;
+ 		_tmp2_ = error_dialog;
+--- a/lib/window.c
++++ b/lib/window.c
+@@ -3542,7 +3542,7 @@ void xnp_window_delete_note (XnpWindow*
+ 		GtkMessageDialog* _tmp13_;
+ 		gint _tmp14_;
+ 		_tmp9_ = _ ("Are you sure you want to delete this note?");
+-		_tmp10_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, _tmp9_);
++		_tmp10_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", _tmp9_);
+ 		g_object_ref_sink (_tmp10_);
+ 		dialog = _tmp10_;
+ 		_tmp11_ = dialog;
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/notes/xfce4-notes-plugin_1.8.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/notes/xfce4-notes-plugin_1.8.1.bb
index 313534b..fcf98c1 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/notes/xfce4-notes-plugin_1.8.1.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/notes/xfce4-notes-plugin_1.8.1.bb
@@ -9,6 +9,7 @@
 
 SRC_URI += " \
     file://0001-main-status-icon.c-remove-deprecated-g_type_init.patch \
+    file://01_fix_format-string.patch \
 "
 SRC_URI[md5sum] = "31cb9520b01512a94344770b4befdb3b"
 SRC_URI[sha256sum] = "07a4c3e71431c24f97d2e270452dd0fa51ff0bdb6219a13a20d0bfa8d9de54b2"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/sensors/xfce4-sensors-plugin_1.2.6.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/sensors/xfce4-sensors-plugin_1.2.6.bb
deleted file mode 100644
index c2e0ed9..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/sensors/xfce4-sensors-plugin_1.2.6.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY = "Sensors plugin for the Xfce Panel"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-sensors-plugin"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b94789bed9aec03b9656a9cc5398c706"
-
-inherit xfce-panel-plugin
-
-SRC_URI[md5sum] = "33c2e343c1224d9c4ae757a70cbe08eb"
-SRC_URI[sha256sum] = "235ef842bd45e701bceebb21a384ab09f21afceea8ed95f91bb4c6cf3abe1bc0"
-
-EXTRA_OECONF = " \
-    --disable-procacpi \
-    --disable-sysfsacpi \
-    --disable-xnvctrl \
-"
-
-do_configure_prepend() {
-    sed -i 's:LIBSENSORS_CFLAGS=.*:LIBSENSORS_CFLAGS=-I${STAGING_INCDIR}:g' ${S}/configure.ac
-}
-
-PACKAGECONFIG ??= "libsensors"
-PACKAGECONFIG[libsensors] = "--enable-libsensors,--disable-libsensors, lmsensors"
-PACKAGECONFIG[hddtemp]    = "--enable-hddtemp,--disable-hddtemp, hddtemp"
-PACKAGECONFIG[netcat]     = "--enable-netcat,--disable-netcat, netcat"
-PACKAGECONFIG[libnotify]  = "--enable-notification,--disable-notification, libnotify"
-
-FILES_SOLIBSDEV = "${libdir}/xfce4/modules/lib*${SOLIBSDEV}"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/sensors/xfce4-sensors-plugin_1.2.97.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/sensors/xfce4-sensors-plugin_1.2.97.bb
new file mode 100644
index 0000000..4d78bb2
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/sensors/xfce4-sensors-plugin_1.2.97.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Sensors plugin for the Xfce Panel"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-sensors-plugin"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b94789bed9aec03b9656a9cc5398c706"
+
+inherit xfce-panel-plugin
+
+SRC_URI[md5sum] = "0c74c3112c5e6e07647c116cd43ff5a7"
+SRC_URI[sha256sum] = "7524ec4534de9ef7f676de2895a41bf70b73b94da5a27fd4a022b16eda56d0f4"
+
+EXTRA_OECONF = " \
+    --disable-procacpi \
+    --disable-sysfsacpi \
+    --disable-xnvctrl \
+"
+
+do_configure_prepend() {
+    sed -i 's:LIBSENSORS_CFLAGS=.*:LIBSENSORS_CFLAGS=-I${STAGING_INCDIR}:g' ${S}/configure.ac
+}
+
+PACKAGECONFIG ??= "libsensors"
+PACKAGECONFIG[libsensors] = "--enable-libsensors,--disable-libsensors, lmsensors"
+PACKAGECONFIG[hddtemp]    = "--enable-hddtemp,--disable-hddtemp, hddtemp"
+PACKAGECONFIG[netcat]     = "--enable-netcat,--disable-netcat, netcat"
+PACKAGECONFIG[libnotify]  = "--enable-notification,--disable-notification, libnotify"
+
+FILES_SOLIBSDEV = "${libdir}/xfce4/modules/lib*${SOLIBSDEV}"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/smartbookmark/xfce4-smartbookmark-plugin_0.4.6.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/smartbookmark/xfce4-smartbookmark-plugin_0.4.6.bb
deleted file mode 100644
index 3f47f06..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/smartbookmark/xfce4-smartbookmark-plugin_0.4.6.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-SUMMARY = "Panel plugin allowing to send requests directly to browser"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-smartbookmark-plugin"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-
-inherit xfce-panel-plugin
-
-SRC_URI[md5sum] = "01b7735d4d9ab0150d4ddd3becb94d5f"
-SRC_URI[sha256sum] = "3bed2b322cd39ce5845d6da07938c702260f3f1a9700b690ef377fba752ba24f"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/smartbookmark/xfce4-smartbookmark-plugin_0.5.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/smartbookmark/xfce4-smartbookmark-plugin_0.5.0.bb
new file mode 100644
index 0000000..6289ad3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/smartbookmark/xfce4-smartbookmark-plugin_0.5.0.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Panel plugin allowing to send requests directly to browser"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-smartbookmark-plugin"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+inherit xfce-panel-plugin
+
+SRC_URI[md5sum] = "6f242fe584ee2fdd2b1d3d69ef3d5914"
+SRC_URI[sha256sum] = "139539c58d54d878de86ef8a882c793cd909981e6b888f7f9d5e230a8fe310a4"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/systemload/xfce4-systemload-plugin_1.1.2.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/systemload/xfce4-systemload-plugin_1.1.2.bb
deleted file mode 100644
index c212f88..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/systemload/xfce4-systemload-plugin_1.1.2.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-DESCRIPTION = "Panel plugin displaying current CPU load, the memory in use, the swap space and the system uptime"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-systemload-plugin"
-LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://COPYING;md5=9acb172a93ff6c43cce2aff790a8aef8"
-
-inherit xfce-panel-plugin
-
-DEPENDS += "upower"
-
-SRC_URI[md5sum] = "68c9d20b352c13f3eb6b39a0d9fe2ba2"
-SRC_URI[sha256sum] = "b469b6b3a08ec29b9061151950d876d36bf25a3106ec77256923fdd6b5d18a7c"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/systemload/xfce4-systemload-plugin_1.2.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/systemload/xfce4-systemload-plugin_1.2.1.bb
new file mode 100644
index 0000000..eeb4518
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/systemload/xfce4-systemload-plugin_1.2.1.bb
@@ -0,0 +1,11 @@
+DESCRIPTION = "Panel plugin displaying current CPU load, the memory in use, the swap space and the system uptime"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-systemload-plugin"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9acb172a93ff6c43cce2aff790a8aef8"
+
+inherit xfce-panel-plugin
+
+DEPENDS += "upower"
+
+SRC_URI[md5sum] = "550277af9886c47005117110f6e7ec0d"
+SRC_URI[sha256sum] = "2bf7d0802534a1eb2e9f251af2bb97abc3f58608c1f01511d302c06111d34812"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/timer/xfce4-timer-plugin/0001-Specify-string-format-explicitly.patch b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/timer/xfce4-timer-plugin/0001-Specify-string-format-explicitly.patch
new file mode 100644
index 0000000..3f0bb05
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/timer/xfce4-timer-plugin/0001-Specify-string-format-explicitly.patch
@@ -0,0 +1,32 @@
+From 6b786e1c161026ab5486ac218891a85db65bf3ba Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Mar 2017 15:28:24 -0700
+Subject: [PATCH] Specify string format explicitly
+
+Avoids below errors when compiling with -Wformat-security
+
+error: format string is not a string literal (potentially insecure)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/xfcetimer.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/xfcetimer.c b/src/xfcetimer.c
+index 601772f..4b89682 100644
+--- a/src/xfcetimer.c
++++ b/src/xfcetimer.c
+@@ -190,7 +190,7 @@ static gboolean update_function (gpointer data){
+ 
+     dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
+                                     GTK_MESSAGE_WARNING,
+-                                    GTK_BUTTONS_NONE, dialog_message);
++                                    GTK_BUTTONS_NONE, "%s", dialog_message);
+                            
+     gtk_window_set_title ((GtkWindow *) dialog, dialog_title);                                    
+  
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/timer/xfce4-timer-plugin_1.6.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/timer/xfce4-timer-plugin_1.6.0.bb
index d61235f..9615192 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/timer/xfce4-timer-plugin_1.6.0.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/timer/xfce4-timer-plugin_1.6.0.bb
@@ -6,5 +6,7 @@
 
 inherit xfce-panel-plugin
 
+SRC_URI += "file://0001-Specify-string-format-explicitly.patch"
+
 SRC_URI[md5sum] = "3be2a4ccfb2af20441b1d25c2cea5f28"
 SRC_URI[sha256sum] = "39d7d21f099bc4219f6a6156142f0bbb8374986ee1970a9c0c8dc138b87f867c"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/verve/xfce4-verve-plugin_1.1.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/verve/xfce4-verve-plugin_1.1.0.bb
index 65503a4..5795160 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/verve/xfce4-verve-plugin_1.1.0.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/verve/xfce4-verve-plugin_1.1.0.bb
@@ -5,5 +5,7 @@
 
 inherit xfce-panel-plugin
 
+DEPENDS += "dbus-glib-native"
+
 SRC_URI[md5sum] = "ddd0190ae56f6117dbcf9ff2bf5a8cbf"
 SRC_URI[sha256sum] = "a3196f818c7ad57d19cd6581e168fd2b9f96de070246aea70c35ce2e5f9d9c84"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/wavelan/xfce4-wavelan-plugin_0.5.12.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/wavelan/xfce4-wavelan-plugin_0.5.12.bb
deleted file mode 100644
index 1ccd557..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/wavelan/xfce4-wavelan-plugin_0.5.12.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-SUMMARY = "Panel plugin displaying stats from a wireless lan interface"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-wavelan-plugin"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=e1e5872df9c5cf1a23f16493d9104920"
-
-inherit xfce-panel-plugin
-
-SRC_URI[md5sum] = "3ba5ee0626612942d249d4a80a1a67b7"
-SRC_URI[sha256sum] = "67dce45739f063b95e2bc2232c625277685887b1f84088316d919671b5500ac4"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/wavelan/xfce4-wavelan-plugin_0.6.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/wavelan/xfce4-wavelan-plugin_0.6.0.bb
new file mode 100644
index 0000000..0c94f3c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/wavelan/xfce4-wavelan-plugin_0.6.0.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Panel plugin displaying stats from a wireless lan interface"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-wavelan-plugin"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e1e5872df9c5cf1a23f16493d9104920"
+
+inherit xfce-panel-plugin
+
+SRC_URI[md5sum] = "b163b22f8543e5e5767a68af35c9028e"
+SRC_URI[sha256sum] = "4d5bd6654cfd077f3432b08d296f7bd052e765e51b77c629886a9542f4e5ecdc"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/weather/xfce4-weather-plugin_0.8.8.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/weather/xfce4-weather-plugin_0.8.8.bb
deleted file mode 100644
index 28d3bda..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/weather/xfce4-weather-plugin_0.8.8.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-SUMMARY = "Panel plugin to display current temperature and weather condition"
-HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-weather-plugin"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-
-inherit xfce-panel-plugin
-
-DEPENDS += "libsoup-2.4 dbus-glib upower"
-
-SRC_URI[md5sum] = "29fe8892bb4c6b1e639862a63110618e"
-SRC_URI[sha256sum] = "651b722714fdafde3f548f183958c34e1539cf563193d7e51f28bfb6933d6d3f"
-
-FILES_${PN} += "${datadir}/xfce4/weather"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/weather/xfce4-weather-plugin_0.8.9.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/weather/xfce4-weather-plugin_0.8.9.bb
new file mode 100644
index 0000000..d9ed2ce
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/weather/xfce4-weather-plugin_0.8.9.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Panel plugin to display current temperature and weather condition"
+HOMEPAGE = "http://goodies.xfce.org/projects/panel-plugins/xfce4-weather-plugin"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+inherit xfce-panel-plugin
+
+DEPENDS += "libsoup-2.4 dbus-glib upower"
+
+SRC_URI[md5sum] = "0c56c057e1c354b30409b7871ab6f314"
+SRC_URI[sha256sum] = "0e15d14b3e18c3da46ad23ee3158a25220f1474a48b611de96edb56221aecee5"
+
+FILES_${PN} += "${datadir}/xfce4/weather"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/whiskermenu/xfce4-whiskermenu-plugin_2.0.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/whiskermenu/xfce4-whiskermenu-plugin_2.0.1.bb
deleted file mode 100644
index 7cf1e43..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/whiskermenu/xfce4-whiskermenu-plugin_2.0.1.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-SUMMARY = "An alternate menu for the Xfce desktop environment"
-HOMEPAGE = "http://gottcode.org/xfce4-whiskermenu-plugin/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-
-inherit xfce-panel-plugin cmake
-
-SRC_URI[md5sum] = "0718eb713809df0049fcc5b7ddd9b533"
-SRC_URI[sha256sum] = "ced25394512d102090a504b95f19dffad8bf38754c3ddad85c765b184a7eb616"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/whiskermenu/xfce4-whiskermenu-plugin_2.1.2.bb b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/whiskermenu/xfce4-whiskermenu-plugin_2.1.2.bb
new file mode 100644
index 0000000..46b508a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-panel-plugins/whiskermenu/xfce4-whiskermenu-plugin_2.1.2.bb
@@ -0,0 +1,11 @@
+SUMMARY = "An alternate menu for the Xfce desktop environment"
+HOMEPAGE = "http://gottcode.org/xfce4-whiskermenu-plugin/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+inherit xfce-panel-plugin cmake
+
+SRC_URI[md5sum] = "eb07c2107c9d1276e9b1bec01f7347a1"
+SRC_URI[sha256sum] = "efd95c330055fd7901a59a48569d14885c168017c5fdb2e233976a78bccb8923"
+
+RRECOMMENDS_${PN} += "menulibre"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/exo/exo/0001-Probable-fix-for-Thunar-detailed-view-Xfce-12916.patch b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/exo/exo/0001-Probable-fix-for-Thunar-detailed-view-Xfce-12916.patch
deleted file mode 100644
index 16f12fe..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/exo/exo/0001-Probable-fix-for-Thunar-detailed-view-Xfce-12916.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From fea2619e6d07ac72b2eff6f408bb3daa2dbdf671 Mon Sep 17 00:00:00 2001
-From: Sean Davis <smd.seandavis@gmail.com>
-Date: Thu, 27 Oct 2016 20:31:36 -0400
-Subject: [PATCH] Probable fix for Thunar detailed view (Xfce #12916)
-
-Upstream-Status: Pending [1-2]
-
-[1] https://git.xfce.org/xfce/exo/commit/?id=fea2619e6d07ac72b2eff6f408bb3daa2dbdf671
-[2] https://bugzilla.xfce.org/show_bug.cgi?id=12916
-
----
- exo/exo-tree-view.c | 6 +-----
- 1 file changed, 1 insertion(+), 5 deletions(-)
-
-diff --git a/exo/exo-tree-view.c b/exo/exo-tree-view.c
-index 8c8564f..2d0fc04 100644
---- a/exo/exo-tree-view.c
-+++ b/exo/exo-tree-view.c
-@@ -385,13 +385,9 @@ exo_tree_view_button_press_event (GtkWidget      *widget,
-         }
-     }
- 
--  /* see bug http://bugzilla.xfce.org/show_bug.cgi?id=6230 for more information */
-   if (G_LIKELY (gtk_tree_selection_get_select_function (selection) == (GtkTreeSelectionFunc) exo_noop_false))
-     {
--      /* just reset the select function (previously set to exo_noop_false),
--       * there's no clean way to do this, so what the heck.
--       */
--      gtk_tree_selection_set_select_function (selection, NULL, NULL, NULL);
-+      gtk_tree_selection_set_select_function (selection, (GtkTreeSelectionFunc) exo_noop_true, NULL, NULL);
-     }
- 
-   /* release the path (if any) */
--- 
-2.5.5
-
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/exo/exo_0.11.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/exo/exo_0.11.1.bb
deleted file mode 100644
index c145ce0..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/exo/exo_0.11.1.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-DESCRIPTION="Application library for the Xfce desktop environment"
-SECTION = "x11"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-DEPENDS = "gtk+ libxfce4util libxfce4ui virtual/libx11 liburi-perl-native cairo"
-DEPENDS_class-native = "glib-2.0-native xfce4-dev-tools-native intltool-native"
-
-inherit xfce pythonnative perlnative gtk-doc distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "x11"
-REQUIRED_DISTRO_FEATURES_class-native = ""
-
-# SRC_URI must follow inherited one
-SRC_URI += " \
-    file://exo-no-tests-0.8.patch \
-    file://configure.patch \
-    file://0001-Probable-fix-for-Thunar-detailed-view-Xfce-12916.patch \
-"
-
-SRC_URI_append_class-native = " \
-    file://reduce-build-to-exo-csource-only.patch \
-"
-
-SRC_URI[md5sum] = "866292556586facb034191aa66431697"
-SRC_URI[sha256sum] = "c70c47f690284a5cb4f507dd89088efbdd8123506f924e33a5f97aab74eb97d4"
-
-PACKAGES =+ "exo-csource"
-
-# Note: python bindings did not work in oe-dev and are about to be moved to
-# pyxfce see http://comments.gmane.org/gmane.comp.desktop.xfce.devel.version4/19560
-FILES_${PN} += "${datadir}/xfce4/ \
-                ${libdir}/xfce4/exo-1 \
-"
-
-FILES_${PN}-dbg += "${libdir}/gio/modules/.debug \
-"
-
-FILES_exo-csource += "${bindir}/exo-csource"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/exo/exo_0.11.2.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/exo/exo_0.11.2.bb
new file mode 100644
index 0000000..cb29c34
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/exo/exo_0.11.2.bb
@@ -0,0 +1,39 @@
+DESCRIPTION="Application library for the Xfce desktop environment"
+SECTION = "x11"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS = "gtk+ libxfce4util libxfce4ui virtual/libx11 liburi-perl-native cairo"
+DEPENDS_class-native = "glib-2.0-native xfce4-dev-tools-native intltool-native"
+
+inherit xfce pythonnative perlnative gtk-doc distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
+REQUIRED_DISTRO_FEATURES_class-native = ""
+
+# SRC_URI must follow inherited one
+SRC_URI += " \
+    file://exo-no-tests-0.8.patch \
+    file://configure.patch \
+"
+
+SRC_URI_append_class-native = " \
+    file://reduce-build-to-exo-csource-only.patch \
+"
+
+SRC_URI[md5sum] = "0b036c8042a2ed5d3767d1177a4213a2"
+SRC_URI[sha256sum] = "76bd1c4229503ff3c301485de3a41c55dec93e98de1a9eef1be77fe502ca4f77"
+
+PACKAGES =+ "exo-csource"
+
+# Note: python bindings did not work in oe-dev and are about to be moved to
+# pyxfce see http://comments.gmane.org/gmane.comp.desktop.xfce.devel.version4/19560
+FILES_${PN} += "${datadir}/xfce4/ \
+                ${libdir}/xfce4/exo-1 \
+"
+
+FILES_${PN}-dbg += "${libdir}/gio/modules/.debug \
+"
+
+FILES_exo-csource += "${bindir}/exo-csource"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/thunar/thunar_1.6.10.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/thunar/thunar_1.6.10.bb
deleted file mode 100644
index 90fd788..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/thunar/thunar_1.6.10.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-SUMMARY = "File manager for the Xfce Desktop Environment"
-SECTION = "x11"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-DEPENDS = "exo glib-2.0 gtk+ gdk-pixbuf libxfce4util libxfce4ui xfconf libsm dbus-glib startup-notification libnotify xfce4-panel udev"
-
-inherit xfce distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "x11"
-
-SRC_URI = "http://archive.xfce.org/src/xfce/${BPN}/${@'${PV}'[0:3]}/Thunar-${PV}.tar.bz2"
-SRC_URI[md5sum] = "3089e1dca6e408641b07cd9c759dea5e"
-SRC_URI[sha256sum] = "7e9d24067268900e5e44d3325e60a1a2b2f8f556ec238ec12574fbea15fdee8a"
-
-S = "${WORKDIR}/Thunar-${PV}/"
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[pcre] = "--enable-pcre,--disable-pcre,libpcre"
-
-FILES_${PN} += " \
-    ${libdir}/thunarx-2/* \
-    ${libdir}/xfce4/panel/plugins/* \
-    ${libdir}/Thunar/[Tt]hunar* \
-    ${datadir}/appdata \
-    ${datadir}/dbus-1 \
-    ${datadir}/polkit-1 \
-    ${datadir}/Thunar \
-    ${datadir}/xfce4/panel/plugins/* \
-"
-
-FILES_${PN}-dbg += "${libdir}/thunarx-2/.debug/ \
-                    ${libdir}/xfce4/panel/plugins/.debug/ \
-                    ${libdir}/Thunar/.debug/"
-
-RRECOMMENDS_${PN} = "gvfs gvfsd-trash"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/thunar/thunar_1.6.11.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/thunar/thunar_1.6.11.bb
new file mode 100644
index 0000000..c750e8c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/thunar/thunar_1.6.11.bb
@@ -0,0 +1,35 @@
+SUMMARY = "File manager for the Xfce Desktop Environment"
+SECTION = "x11"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+DEPENDS = "exo glib-2.0 gtk+ gdk-pixbuf libxfce4util libxfce4ui xfconf libsm dbus-glib startup-notification libnotify xfce4-panel udev"
+
+inherit xfce distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "http://archive.xfce.org/src/xfce/${BPN}/${@'${PV}'[0:3]}/Thunar-${PV}.tar.bz2"
+SRC_URI[md5sum] = "9749be8247cb19ed0fd36e4118c6236a"
+SRC_URI[sha256sum] = "b1c7c3121827f59610900ef1cc19aa10a50ab2cc3ae38eee15181b64256e8b42"
+
+S = "${WORKDIR}/Thunar-${PV}/"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[pcre] = "--enable-pcre,--disable-pcre,libpcre"
+
+FILES_${PN} += " \
+    ${libdir}/thunarx-2/* \
+    ${libdir}/xfce4/panel/plugins/* \
+    ${libdir}/Thunar/[Tt]hunar* \
+    ${datadir}/appdata \
+    ${datadir}/dbus-1 \
+    ${datadir}/polkit-1 \
+    ${datadir}/Thunar \
+    ${datadir}/xfce4/panel/plugins/* \
+"
+
+FILES_${PN}-dbg += "${libdir}/thunarx-2/.debug/ \
+                    ${libdir}/xfce4/panel/plugins/.debug/ \
+                    ${libdir}/Thunar/.debug/"
+
+RRECOMMENDS_${PN} = "gvfs gvfsd-trash"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/tumbler/tumbler_0.1.31.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/tumbler/tumbler_0.1.31.bb
index 66385a4..1f5419a 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/tumbler/tumbler_0.1.31.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/tumbler/tumbler_0.1.31.bb
@@ -2,7 +2,7 @@
 SECTION = "x11/libs"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-DEPENDS = "dbus-glib freetype gdk-pixbuf poppler curl xfce4-dev-tools-native libxml2 libgsf"
+DEPENDS = "dbus-glib dbus-glib-native freetype gdk-pixbuf poppler curl xfce4-dev-tools-native libxml2 libgsf"
 
 inherit xfce gtk-doc
 
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/files/0001-Fix-compiler-warning-in-clock-plugin-about-shadowed-.patch b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/files/0001-Fix-compiler-warning-in-clock-plugin-about-shadowed-.patch
deleted file mode 100644
index d971fca..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/files/0001-Fix-compiler-warning-in-clock-plugin-about-shadowed-.patch
+++ /dev/null
@@ -1,606 +0,0 @@
-From 5a9e94ab7bd628f5bf6b46ea7ea91cf40b4aee98 Mon Sep 17 00:00:00 2001
-From: Matt Thirtytwo <matt.59491@gmail.com>
-Date: Mon, 2 Mar 2015 21:18:41 +0100
-Subject: [PATCH] Fix compiler warning in clock plugin about shadowed 'time'
- variable
-
-Upstream-Status: Backport [1]
-
-[1] http://git.xfce.org/xfce/xfce4-panel/commit/?id=5a9e94ab7bd628f5bf6b46ea7ea91cf40b4aee98
-
-Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
-
----
- plugins/clock/clock-analog.c  | 20 ++++++-------
- plugins/clock/clock-binary.c  | 28 +++++++++---------
- plugins/clock/clock-digital.c |  8 ++---
- plugins/clock/clock-fuzzy.c   |  6 ++--
- plugins/clock/clock-lcd.c     | 34 +++++++++++-----------
- plugins/clock/clock-time.c    | 68 +++++++++++++++++++++----------------------
- plugins/clock/clock.c         | 12 ++++----
- 7 files changed, 88 insertions(+), 88 deletions(-)
-
-diff --git a/plugins/clock/clock-analog.c b/plugins/clock/clock-analog.c
-index 2e96a09..910450d 100644
---- a/plugins/clock/clock-analog.c
-+++ b/plugins/clock/clock-analog.c
-@@ -216,7 +216,7 @@ xfce_clock_analog_expose_event (GtkWidget      *widget,
-   gdouble          xc, yc;
-   gdouble          angle, radius;
-   cairo_t         *cr;
--  GDateTime       *time;
-+  GDateTime       *date_time;
- 
-   panel_return_val_if_fail (XFCE_CLOCK_IS_ANALOG (analog), FALSE);
- 
-@@ -239,7 +239,7 @@ xfce_clock_analog_expose_event (GtkWidget      *widget,
-       cairo_clip (cr);
- 
-       /* get the local time */
--      time = clock_time_get_time (analog->time);
-+      date_time = clock_time_get_time (analog->time);
- 
-       /* set the line properties */
-       cairo_set_line_width (cr, 1);
-@@ -251,20 +251,20 @@ xfce_clock_analog_expose_event (GtkWidget      *widget,
-       if (analog->show_seconds)
-         {
-           /* second pointer */
--          angle = TICKS_TO_RADIANS (g_date_time_get_second (time));
-+          angle = TICKS_TO_RADIANS (g_date_time_get_second (date_time));
-           xfce_clock_analog_draw_pointer (cr, xc, yc, radius, angle, 0.7, TRUE);
-         }
- 
-       /* minute pointer */
--      angle = TICKS_TO_RADIANS (g_date_time_get_minute (time));
-+      angle = TICKS_TO_RADIANS (g_date_time_get_minute (date_time));
-       xfce_clock_analog_draw_pointer (cr, xc, yc, radius, angle, 0.8, FALSE);
- 
-       /* hour pointer */
--      angle = HOURS_TO_RADIANS (g_date_time_get_hour (time), g_date_time_get_minute (time));
-+      angle = HOURS_TO_RADIANS (g_date_time_get_hour (date_time), g_date_time_get_minute (date_time));
-       xfce_clock_analog_draw_pointer (cr, xc, yc, radius, angle, 0.5, FALSE);
- 
-       /* cleanup */
--      g_date_time_unref (time);
-+      g_date_time_unref (date_time);
-       cairo_destroy (cr);
-     }
- 
-@@ -347,12 +347,12 @@ xfce_clock_analog_draw_pointer (cairo_t *cr,
- 
- static gboolean
- xfce_clock_analog_update (XfceClockAnalog *analog,
--                          ClockTime       *time)
-+                          ClockTime       *clock_time)
- {
-   GtkWidget *widget = GTK_WIDGET (analog);
- 
-   panel_return_val_if_fail (XFCE_CLOCK_IS_ANALOG (analog), FALSE);
--  panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (time), FALSE);
-+  panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (clock_time), FALSE);
- 
-   /* update if the widget if visible */
-   if (G_LIKELY (GTK_WIDGET_VISIBLE (widget)))
-@@ -364,11 +364,11 @@ xfce_clock_analog_update (XfceClockAnalog *analog,
- 
- 
- GtkWidget *
--xfce_clock_analog_new (ClockTime *time)
-+xfce_clock_analog_new (ClockTime *clock_time)
- {
-   XfceClockAnalog *analog = g_object_new (XFCE_CLOCK_TYPE_ANALOG, NULL);
- 
--  analog->time = time;
-+  analog->time = clock_time;
-   analog->timeout = clock_time_timeout_new (CLOCK_INTERVAL_MINUTE,
-                                             analog->time,
-                                             G_CALLBACK (xfce_clock_analog_update), analog);
-diff --git a/plugins/clock/clock-binary.c b/plugins/clock/clock-binary.c
-index 4751c51..46b852c 100644
---- a/plugins/clock/clock-binary.c
-+++ b/plugins/clock/clock-binary.c
-@@ -262,7 +262,7 @@ xfce_clock_binary_expose_event_true_binary (XfceClockBinary *binary,
-                                             GtkAllocation   *alloc)
- {
-   GdkColor    *active, *inactive;
--  GDateTime   *time;
-+  GDateTime   *date_time;
-   gint         row, rows;
-   static gint  binary_table[] = { 32, 16, 8, 4, 2, 1 };
-   gint         col, cols = G_N_ELEMENTS (binary_table);
-@@ -282,7 +282,7 @@ xfce_clock_binary_expose_event_true_binary (XfceClockBinary *binary,
-       active = &(GTK_WIDGET (binary)->style->dark[GTK_STATE_SELECTED]);
-     }
- 
--  time = clock_time_get_time (binary->time);
-+  date_time = clock_time_get_time (binary->time);
- 
-   /* init sizes */
-   remain_h = alloc->height;
-@@ -293,11 +293,11 @@ xfce_clock_binary_expose_event_true_binary (XfceClockBinary *binary,
-     {
-       /* get the time this row represents */
-       if (row == 0)
--        ticks = g_date_time_get_hour (time);
-+        ticks = g_date_time_get_hour (date_time);
-       else if (row == 1)
--        ticks = g_date_time_get_minute (time);
-+        ticks = g_date_time_get_minute (date_time);
-       else
--        ticks = g_date_time_get_second (time);
-+        ticks = g_date_time_get_second (date_time);
- 
-       /* reset sizes */
-       remain_w = alloc->width;
-@@ -336,7 +336,7 @@ xfce_clock_binary_expose_event_true_binary (XfceClockBinary *binary,
-       offset_y += h;
-     }
- 
--  g_date_time_unref (time);
-+  g_date_time_unref (date_time);
- }
- 
- 
-@@ -348,7 +348,7 @@ xfce_clock_binary_expose_event_binary (XfceClockBinary *binary,
- {
-   GdkColor    *active, *inactive;
-   static gint  binary_table[] = { 80, 40, 20, 10, 8, 4, 2, 1 };
--  GDateTime   *time;
-+  GDateTime   *date_time;
-   gint         row, rows = G_N_ELEMENTS (binary_table) / 2;
-   gint         col, cols;
-   gint         digit;
-@@ -368,7 +368,7 @@ xfce_clock_binary_expose_event_binary (XfceClockBinary *binary,
-       active = &(GTK_WIDGET (binary)->style->dark[GTK_STATE_SELECTED]);
-     }
- 
--  time = clock_time_get_time (binary->time);
-+  date_time = clock_time_get_time (binary->time);
- 
-   remain_w = alloc->width;
-   offset_x = alloc->x;
-@@ -379,11 +379,11 @@ xfce_clock_binary_expose_event_binary (XfceClockBinary *binary,
-     {
-       /* get the time this row represents */
-       if (col == 0)
--        ticks = g_date_time_get_hour (time);
-+        ticks = g_date_time_get_hour (date_time);
-       else if (col == 2)
--        ticks = g_date_time_get_minute (time);
-+        ticks = g_date_time_get_minute (date_time);
-       else if (col == 4)
--        ticks = g_date_time_get_second (time);
-+        ticks = g_date_time_get_second (date_time);
- 
-       /* reset sizes */
-       remain_h = alloc->height;
-@@ -520,7 +520,7 @@ xfce_clock_binary_expose_event (GtkWidget      *widget,
- 
- static gboolean
- xfce_clock_binary_update (XfceClockBinary     *binary,
--                          ClockTime           *time)
-+                          ClockTime           *clock_time)
- {
-   GtkWidget *widget = GTK_WIDGET (binary);
- 
-@@ -536,11 +536,11 @@ xfce_clock_binary_update (XfceClockBinary     *binary,
- 
- 
- GtkWidget *
--xfce_clock_binary_new (ClockTime *time)
-+xfce_clock_binary_new (ClockTime *clock_time)
- {
-   XfceClockBinary *binary = g_object_new (XFCE_CLOCK_TYPE_BINARY, NULL);
- 
--  binary->time = time;
-+  binary->time = clock_time;
-   binary->timeout = clock_time_timeout_new (CLOCK_INTERVAL_MINUTE,
-                                             binary->time,
-                                             G_CALLBACK (xfce_clock_binary_update), binary);
-diff --git a/plugins/clock/clock-digital.c b/plugins/clock/clock-digital.c
-index c293ed2..34e7019 100644
---- a/plugins/clock/clock-digital.c
-+++ b/plugins/clock/clock-digital.c
-@@ -194,12 +194,12 @@ xfce_clock_digital_finalize (GObject *object)
- 
- static gboolean
- xfce_clock_digital_update (XfceClockDigital *digital,
--                           ClockTime        *time)
-+                           ClockTime        *clock_time)
- {
-   gchar            *string;
- 
-   panel_return_val_if_fail (XFCE_CLOCK_IS_DIGITAL (digital), FALSE);
--  panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (time), FALSE);
-+  panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (clock_time), FALSE);
- 
-   /* set time string */
-   string = clock_time_strdup_strftime (digital->time, digital->format);
-@@ -212,11 +212,11 @@ xfce_clock_digital_update (XfceClockDigital *digital,
- 
- 
- GtkWidget *
--xfce_clock_digital_new (ClockTime *time)
-+xfce_clock_digital_new (ClockTime *clock_time)
- {
-   XfceClockDigital *digital = g_object_new (XFCE_CLOCK_TYPE_DIGITAL, NULL);
- 
--  digital->time = time;
-+  digital->time = clock_time;
-   digital->timeout = clock_time_timeout_new (clock_time_interval_from_format (digital->format),
-                                              digital->time,
-                                              G_CALLBACK (xfce_clock_digital_update), digital);
-diff --git a/plugins/clock/clock-fuzzy.c b/plugins/clock/clock-fuzzy.c
-index 7b0aa41..4b361dd 100644
---- a/plugins/clock/clock-fuzzy.c
-+++ b/plugins/clock/clock-fuzzy.c
-@@ -275,7 +275,7 @@ xfce_clock_fuzzy_finalize (GObject *object)
- 
- static gboolean
- xfce_clock_fuzzy_update (XfceClockFuzzy *fuzzy,
--                         ClockTime      *time)
-+                         ClockTime      *clock_time)
- {
-   GDateTime      *date_time;
-   gint            sector;
-@@ -353,11 +353,11 @@ xfce_clock_fuzzy_update (XfceClockFuzzy *fuzzy,
- 
- 
- GtkWidget *
--xfce_clock_fuzzy_new (ClockTime *time)
-+xfce_clock_fuzzy_new (ClockTime *clock_time)
- {
-   XfceClockFuzzy *fuzzy = g_object_new (XFCE_CLOCK_TYPE_FUZZY, NULL);
- 
--  fuzzy->time = time;
-+  fuzzy->time = clock_time;
-   fuzzy->timeout = clock_time_timeout_new (CLOCK_INTERVAL_MINUTE,
-                                            fuzzy->time,
-                                            G_CALLBACK (xfce_clock_fuzzy_update), fuzzy);
-diff --git a/plugins/clock/clock-lcd.c b/plugins/clock/clock-lcd.c
-index 84e74e6..b180d30 100644
---- a/plugins/clock/clock-lcd.c
-+++ b/plugins/clock/clock-lcd.c
-@@ -285,7 +285,7 @@ xfce_clock_lcd_expose_event (GtkWidget      *widget,
-   gint          ticks, i;
-   gdouble       size;
-   gdouble       ratio;
--  GDateTime    *time;
-+  GDateTime    *date_time;
- 
-   panel_return_val_if_fail (XFCE_CLOCK_IS_LCD (lcd), FALSE);
- 
-@@ -317,10 +317,10 @@ xfce_clock_lcd_expose_event (GtkWidget      *widget,
-       cairo_set_line_width (cr, MAX (size * 0.05, 1.5));
- 
-       /* get the local time */
--      time = clock_time_get_time (lcd->time);
-+      date_time = clock_time_get_time (lcd->time);
- 
-       /* draw the hours */
--      ticks = g_date_time_get_hour (time);
-+      ticks = g_date_time_get_hour (date_time);
- 
-       /* convert 24h clock to 12h clock */
-       if (!lcd->show_military && ticks > 12)
-@@ -333,8 +333,8 @@ xfce_clock_lcd_expose_event (GtkWidget      *widget,
-        * because we might miss the exact second (due to slightly delayed
-        * timeout) we queue a resize the first 3 seconds or anything in
-        * the first minute */
--      if ((ticks == 10 || ticks == 0) && g_date_time_get_minute (time) == 0
--          && (!lcd->show_seconds || g_date_time_get_second (time) < 3))
-+      if ((ticks == 10 || ticks == 0) && g_date_time_get_minute (date_time) == 0
-+          && (!lcd->show_seconds || g_date_time_get_second (date_time) < 3))
-         g_object_notify (G_OBJECT (lcd), "size-ratio");
- 
-       if (ticks >= 10)
-@@ -352,7 +352,7 @@ xfce_clock_lcd_expose_event (GtkWidget      *widget,
-           if (i == 0)
-             {
-               /* get the minutes */
--              ticks = g_date_time_get_minute (time);
-+              ticks = g_date_time_get_minute (date_time);
-             }
-           else
-             {
-@@ -361,11 +361,11 @@ xfce_clock_lcd_expose_event (GtkWidget      *widget,
-                 break;
- 
-               /* get the seconds */
--              ticks = g_date_time_get_second (time);
-+              ticks = g_date_time_get_second (date_time);
-             }
- 
-           /* draw the dots */
--          if (lcd->flash_separators && (g_date_time_get_second (time) % 2) == 1)
-+          if (lcd->flash_separators && (g_date_time_get_second (date_time) % 2) == 1)
-             offset_x += size * RELATIVE_SPACE * 2;
-           else
-             offset_x = xfce_clock_lcd_draw_dots (cr, size, offset_x, offset_y);
-@@ -380,14 +380,14 @@ xfce_clock_lcd_expose_event (GtkWidget      *widget,
-       if (lcd->show_meridiem)
-         {
-           /* am or pm? */
--          ticks = g_date_time_get_hour (time) >= 12 ? 11 : 10;
-+          ticks = g_date_time_get_hour (date_time) >= 12 ? 11 : 10;
- 
-           /* draw the digit */
-           offset_x = xfce_clock_lcd_draw_digit (cr, ticks, size, offset_x, offset_y);
-         }
- 
-       /* drop the pushed group */
--      g_date_time_unref (time);
-+      g_date_time_unref (date_time);
-       cairo_pop_group_to_source (cr);
-       cairo_paint (cr);
-       cairo_destroy (cr);
-@@ -403,16 +403,16 @@ xfce_clock_lcd_get_ratio (XfceClockLcd *lcd)
- {
-   gdouble    ratio;
-   gint       ticks;
--  GDateTime *time;
-+  GDateTime *date_time;
- 
-   /* get the local time */
--  time = clock_time_get_time (lcd->time);
-+  date_time = clock_time_get_time (lcd->time);
- 
-   /* 8:8(space)8 */
-   ratio = (3 * RELATIVE_DIGIT) + RELATIVE_DOTS + RELATIVE_SPACE;
- 
--  ticks = g_date_time_get_hour (time);
--  g_date_time_unref (time);
-+  ticks = g_date_time_get_hour (date_time);
-+  g_date_time_unref (date_time);
- 
-   if (!lcd->show_military && ticks > 12)
-     ticks -= 12;
-@@ -584,7 +584,7 @@ xfce_clock_lcd_draw_digit (cairo_t *cr,
- 
- static gboolean
- xfce_clock_lcd_update (XfceClockLcd *lcd,
--                       ClockTime    *time)
-+                       ClockTime    *clock_time)
- {
-   GtkWidget *widget = GTK_WIDGET (lcd);
- 
-@@ -600,11 +600,11 @@ xfce_clock_lcd_update (XfceClockLcd *lcd,
- 
- 
- GtkWidget *
--xfce_clock_lcd_new (ClockTime *time)
-+xfce_clock_lcd_new (ClockTime *clock_time)
- {
-   XfceClockLcd *lcd = g_object_new (XFCE_CLOCK_TYPE_LCD, NULL);
- 
--  lcd->time = time;
-+  lcd->time = clock_time;
-   lcd->timeout = clock_time_timeout_new (CLOCK_INTERVAL_MINUTE,
-                                          lcd->time,
-                                          G_CALLBACK (xfce_clock_lcd_update), lcd);
-diff --git a/plugins/clock/clock-time.c b/plugins/clock/clock-time.c
-index 16b0f89..b015b13 100644
---- a/plugins/clock/clock-time.c
-+++ b/plugins/clock/clock-time.c
-@@ -107,10 +107,10 @@ clock_time_class_init (ClockTimeClass *klass)
- 
- 
- static void
--clock_time_init (ClockTime *time)
-+clock_time_init (ClockTime *clock_time)
- {
--  time->timezone_name = g_strdup (DEFAULT_TIMEZONE);
--  time->timezone = g_time_zone_new_local ();
-+  clock_time->timezone_name = g_strdup (DEFAULT_TIMEZONE);
-+  clock_time->timezone = g_time_zone_new_local ();
- }
- 
- 
-@@ -118,11 +118,11 @@ clock_time_init (ClockTime *time)
- static void
- clock_time_finalize (GObject *object)
- {
--  ClockTime *time = XFCE_CLOCK_TIME (object);
-+  ClockTime *clock_time = XFCE_CLOCK_TIME (object);
- 
--  g_free (time->timezone_name);
-+  g_free (clock_time->timezone_name);
- 
--  g_time_zone_unref (time->timezone);
-+  g_time_zone_unref (clock_time->timezone);
- 
-   G_OBJECT_CLASS (clock_time_parent_class)->finalize (object);
- }
-@@ -135,12 +135,12 @@ clock_time_get_property (GObject    *object,
-                          GValue     *value,
-                          GParamSpec *pspec)
- {
--  ClockTime *time = XFCE_CLOCK_TIME (object);
-+  ClockTime *clock_time = XFCE_CLOCK_TIME (object);
- 
-   switch (prop_id)
-     {
-     case PROP_TIMEZONE:
--      g_value_set_string (value, time->timezone_name);
-+      g_value_set_string (value, clock_time->timezone_name);
-       break;
- 
-     default:
-@@ -157,29 +157,29 @@ clock_time_set_property (GObject      *object,
-                          const GValue *value,
-                          GParamSpec   *pspec)
- {
--  ClockTime     *time = XFCE_CLOCK_TIME (object);
-+  ClockTime     *clock_time = XFCE_CLOCK_TIME (object);
-   const gchar   *str_value;
- 
-   switch (prop_id)
-     {
-     case PROP_TIMEZONE:
-       str_value = g_value_get_string (value);
--      if (g_strcmp0 (time->timezone_name, str_value) != 0)
-+      if (g_strcmp0 (clock_time->timezone_name, str_value) != 0)
-         {
--          g_free (time->timezone_name);
--          g_time_zone_unref (time->timezone);
-+          g_free (clock_time->timezone_name);
-+          g_time_zone_unref (clock_time->timezone);
-           if (str_value == NULL || g_strcmp0 (str_value, "") == 0)
-             {
--              time->timezone_name = g_strdup (DEFAULT_TIMEZONE);
--              time->timezone = g_time_zone_new_local ();
-+              clock_time->timezone_name = g_strdup (DEFAULT_TIMEZONE);
-+              clock_time->timezone = g_time_zone_new_local ();
-             }
-           else
-             {
--              time->timezone_name = g_strdup (str_value);
--              time->timezone = g_time_zone_new (str_value);
-+              clock_time->timezone_name = g_strdup (str_value);
-+              clock_time->timezone = g_time_zone_new (str_value);
-             }
- 
--          g_signal_emit (G_OBJECT (time), clock_time_signals[TIME_CHANGED], 0);
-+          g_signal_emit (G_OBJECT (clock_time), clock_time_signals[TIME_CHANGED], 0);
-         }
-       break;
- 
-@@ -192,14 +192,14 @@ clock_time_set_property (GObject      *object,
- 
- 
- GDateTime *
--clock_time_get_time (ClockTime *time)
-+clock_time_get_time (ClockTime *clock_time)
- {
-   GDateTime *date_time;
- 
--  panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (time), NULL);
-+  panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (clock_time), NULL);
- 
--  if (time->timezone != NULL)
--    date_time = g_date_time_new_now (time->timezone);
-+  if (clock_time->timezone != NULL)
-+    date_time = g_date_time_new_now (clock_time->timezone);
-   else
-     date_time = g_date_time_new_now_local ();
- 
-@@ -209,15 +209,15 @@ clock_time_get_time (ClockTime *time)
- 
- 
- gchar *
--clock_time_strdup_strftime (ClockTime       *time,
-+clock_time_strdup_strftime (ClockTime       *clock_time,
-                             const gchar     *format)
- {
-   GDateTime *date_time;
-   gchar     *str;
- 
--  panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (time), NULL);
-+  panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (clock_time), NULL);
- 
--  date_time = clock_time_get_time (time);
-+  date_time = clock_time_get_time (clock_time);
-   str = g_date_time_format (date_time, format);
- 
-   g_date_time_unref (date_time);
-@@ -262,7 +262,7 @@ static gboolean
- clock_time_timeout_running (gpointer user_data)
- {
-   ClockTimeTimeout *timeout = user_data;
--  GDateTime        *time;
-+  GDateTime        *date_time;
- 
-   g_signal_emit (G_OBJECT (timeout->time), clock_time_signals[TIME_CHANGED], 0);
- 
-@@ -270,8 +270,8 @@ clock_time_timeout_running (gpointer user_data)
-   if (timeout->interval == CLOCK_INTERVAL_MINUTE)
-     {
-       /* sync again when we don't run on time */
--      time = clock_time_get_time (timeout->time);
--      timeout->restart = (g_date_time_get_second (time) != 0);
-+      date_time = clock_time_get_time (timeout->time);
-+      timeout->restart = (g_date_time_get_second (date_time) != 0);
-     }
- 
-   return !timeout->restart;
-@@ -312,13 +312,13 @@ clock_time_timeout_sync (gpointer user_data)
- 
- ClockTimeTimeout *
- clock_time_timeout_new (guint       interval,
--                        ClockTime  *time,
-+                        ClockTime  *clock_time,
-                         GCallback   c_handler,
-                         gpointer    gobject)
- {
-   ClockTimeTimeout *timeout;
- 
--  panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (time), NULL);
-+  panel_return_val_if_fail (XFCE_IS_CLOCK_TIME (clock_time), NULL);
- 
-   panel_return_val_if_fail (interval > 0, NULL);
- 
-@@ -326,10 +326,10 @@ clock_time_timeout_new (guint       interval,
-   timeout->interval = 0;
-   timeout->timeout_id = 0;
-   timeout->restart = FALSE;
--  timeout->time = time;
-+  timeout->time = clock_time;
- 
-   timeout->time_changed_id =
--    g_signal_connect_swapped (G_OBJECT (time), "time-changed",
-+    g_signal_connect_swapped (G_OBJECT (clock_time), "time-changed",
-                               c_handler, gobject);
- 
-   g_object_ref (G_OBJECT (timeout->time));
-@@ -345,7 +345,7 @@ void
- clock_time_timeout_set_interval (ClockTimeTimeout *timeout,
-                                  guint             interval)
- {
--  GDateTime *time;
-+  GDateTime *date_time;
-   guint      next_interval;
-   gboolean   restart;
- 
-@@ -372,8 +372,8 @@ clock_time_timeout_set_interval (ClockTimeTimeout *timeout,
-   /* get the seconds to the next internal */
-   if (interval == CLOCK_INTERVAL_MINUTE)
-     {
--      time = clock_time_get_time (timeout->time);
--      next_interval = 60 - g_date_time_get_second (time);
-+      date_time = clock_time_get_time (timeout->time);
-+      next_interval = 60 - g_date_time_get_second (date_time);
-     }
-   else
-     {
-diff --git a/plugins/clock/clock.c b/plugins/clock/clock.c
-index 6c80978..e07c17b 100644
---- a/plugins/clock/clock.c
-+++ b/plugins/clock/clock.c
-@@ -1113,17 +1113,17 @@ static void
- clock_plugin_calendar_show_event (GtkWidget   *calendar_window,
-                                   ClockPlugin *plugin)
- {
--  GDateTime *time;
-+  GDateTime *date_time;
- 
-   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
- 
-   clock_plugin_reposition_calendar (plugin);
- 
--  time = clock_time_get_time (plugin->time);
--  gtk_calendar_select_month (GTK_CALENDAR (plugin->calendar), g_date_time_get_month (time) - 1,
--                             g_date_time_get_year (time));
--  gtk_calendar_select_day (GTK_CALENDAR (plugin->calendar), g_date_time_get_day_of_month (time));
--  g_date_time_unref (time);
-+  date_time = clock_time_get_time (plugin->time);
-+  gtk_calendar_select_month (GTK_CALENDAR (plugin->calendar), g_date_time_get_month (date_time) - 1,
-+                             g_date_time_get_year (date_time));
-+  gtk_calendar_select_day (GTK_CALENDAR (plugin->calendar), g_date_time_get_day_of_month (date_time));
-+  g_date_time_unref (date_time);
- }
- 
- 
--- 
-2.5.0
-
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/files/0002-clock-time-make-change-of-system-s-timezone-change-t.patch b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/files/0001-clock-time-make-change-of-system-s-timezone-change-t.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/files/0002-clock-time-make-change-of-system-s-timezone-change-t.patch
rename to import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/files/0001-clock-time-make-change-of-system-s-timezone-change-t.patch
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/files/0002-windowmenu-do-not-display-desktop-icon-when-no-windo.patch b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/files/0002-windowmenu-do-not-display-desktop-icon-when-no-windo.patch
new file mode 100644
index 0000000..b2d960c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/files/0002-windowmenu-do-not-display-desktop-icon-when-no-windo.patch
@@ -0,0 +1,60 @@
+From 0651f228cef01a6c3e4758a991cace1cd7721031 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Mon, 24 Sep 2012 09:57:46 +0200
+Subject: [PATCH] windowmenu: do not display desktop icon when no window is
+ active
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+* desktop icon is of no use
+* desktop icon confuses when using showdesktop plugin
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ plugins/windowmenu/windowmenu.c |   12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/plugins/windowmenu/windowmenu.c b/plugins/windowmenu/windowmenu.c
+index c96123a..9404021 100644
+--- a/plugins/windowmenu/windowmenu.c
++++ b/plugins/windowmenu/windowmenu.c
+@@ -256,7 +256,7 @@ window_menu_plugin_init (WindowMenuPlugin *plugin)
+   g_signal_connect (G_OBJECT (plugin->button), "toggled",
+       G_CALLBACK (window_menu_plugin_menu), plugin);
+ 
+-  plugin->icon = xfce_panel_image_new_from_source ("user-desktop");
++  plugin->icon = xfce_panel_image_new_from_source (NULL);
+   gtk_container_add (GTK_CONTAINER (plugin->button), plugin->icon);
+   gtk_widget_show (plugin->icon);
+ }
+@@ -634,7 +634,7 @@ window_menu_plugin_active_window_changed (WnckScreen       *screen,
+           /* skip 'fake' windows */
+           type = wnck_window_get_window_type (window);
+           if (type == WNCK_WINDOW_DESKTOP || type == WNCK_WINDOW_DOCK)
+-            goto show_desktop_icon;
++            goto show_no_icon;
+ 
+           /* get the window icon and set the tooltip */
+           gtk_widget_set_tooltip_text (GTK_WIDGET (icon),
+@@ -648,11 +648,11 @@ window_menu_plugin_active_window_changed (WnckScreen       *screen,
+         }
+       else
+         {
+-          show_desktop_icon:
++          show_no_icon:
+ 
+-          /* desktop is shown right now */
+-          xfce_panel_image_set_from_source (icon, "user-desktop");
+-          gtk_widget_set_tooltip_text (GTK_WIDGET (icon), _("Desktop"));
++          /* no icon is shown right now */
++          xfce_panel_image_set_from_source (icon, NULL);
++          gtk_widget_set_tooltip_text (GTK_WIDGET (icon), _("No Windows"));
+         }
+     }
+ }
+-- 
+1.7.6.5
+
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/xfce4-panel_4.12.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/xfce4-panel_4.12.0.bb
deleted file mode 100644
index 18f5ab7..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/xfce4-panel_4.12.0.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-SUMMARY = "Xfce4 Panel"
-SECTION = "x11"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=26a8bd75d8f8498bdbbe64a27791d4ee"
-DEPENDS = "libxfce4util garcon libxfce4ui xfconf exo gtk+ gtk+3 dbus cairo virtual/libx11 libxml2 libwnck"
-
-inherit xfce gtk-doc distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "x11"
-
-SRC_URI[md5sum] = "5a333af704e386c90ad829b6baf1a758"
-SRC_URI[sha256sum] = "30920fc2e2fc26279a82b5261a155c2cc15ab2aa1ced2275684a6ff8261b97b0"
-SRC_URI += " \
-    file://0001-Fix-compiler-warning-in-clock-plugin-about-shadowed-.patch \
-    file://0002-clock-time-make-change-of-system-s-timezone-change-t.patch \
-"
-
-EXTRA_OECONF += "--enable-gtk3"
-
-python populate_packages_prepend() {
-    plugin_dir = d.expand('${libdir}/xfce4/panel/plugins/')
-    plugin_name = d.expand('${PN}-plugin-%s')
-    do_split_packages(d, plugin_dir, '^lib(.*).so$', plugin_name,
-                      '${PN} plugin for %s', extra_depends='', prepend=True,
-                      aux_files_pattern=['${datadir}/xfce4/panel/plugins/%s.desktop',
-                                         '${sysconfdir}/xdg/xfce/panel/%s-*',
-                                         '${datadir}/icons/hicolor/48x48/apps/*-%s.png',
-                                         '${bindir}/*%s*'])
-}
-
-PACKAGES_DYNAMIC += "^${PN}-plugin-.*"
-
-PACKAGES =+ "${PN}-gtk3"
-
-FILES_${PN} += "${libdir}/xfce4/panel/migrate \
-                ${libdir}/xfce4/panel/wrapper-1.0"
-
-FILES_${PN}-gtk3 = " \
-    ${libdir}/libxfce4panel-2.0${SOLIBS} \
-    ${libdir}/xfce4/panel/wrapper-2.0 \
-"
-FILES_${PN}-dbg += "${libdir}/xfce4/panel/plugins/.debug \
-"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/xfce4-panel_4.12.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/xfce4-panel_4.12.1.bb
new file mode 100644
index 0000000..80332ce
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-panel/xfce4-panel_4.12.1.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Xfce4 Panel"
+SECTION = "x11"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=26a8bd75d8f8498bdbbe64a27791d4ee"
+DEPENDS = "libxfce4util garcon libxfce4ui xfconf exo gtk+ gtk+3 dbus cairo virtual/libx11 libxml2 libwnck"
+
+inherit xfce gtk-doc distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI[md5sum] = "0b943f2e72a3693dddb1af559826cb62"
+SRC_URI[sha256sum] = "93d58b80cca9c9eb58adb281bc75404df7cf6cae89f7f98bb9f38690009aa2e8"
+SRC_URI += " \
+    file://0001-clock-time-make-change-of-system-s-timezone-change-t.patch \
+    file://0002-windowmenu-do-not-display-desktop-icon-when-no-windo.patch \
+"
+
+EXTRA_OECONF += "--enable-gtk3"
+
+python populate_packages_prepend() {
+    plugin_dir = d.expand('${libdir}/xfce4/panel/plugins/')
+    plugin_name = d.expand('${PN}-plugin-%s')
+    do_split_packages(d, plugin_dir, '^lib(.*).so$', plugin_name,
+                      '${PN} plugin for %s', extra_depends='', prepend=True,
+                      aux_files_pattern=['${datadir}/xfce4/panel/plugins/%s.desktop',
+                                         '${sysconfdir}/xdg/xfce/panel/%s-*',
+                                         '${datadir}/icons/hicolor/48x48/apps/*-%s.png',
+                                         '${bindir}/*%s*'])
+}
+
+PACKAGES_DYNAMIC += "^${PN}-plugin-.*"
+
+PACKAGES =+ "${PN}-gtk3"
+
+FILES_${PN} += "${libdir}/xfce4/panel/migrate \
+                ${libdir}/xfce4/panel/wrapper-1.0"
+
+FILES_${PN}-gtk3 = " \
+    ${libdir}/libxfce4panel-2.0${SOLIBS} \
+    ${libdir}/xfce4/panel/wrapper-2.0 \
+"
+FILES_${PN}-dbg += "${libdir}/xfce4/panel/plugins/.debug \
+"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-power-manager/xfce4-power-manager_1.6.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-power-manager/xfce4-power-manager_1.6.0.bb
index e69118c..08d00df 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-power-manager/xfce4-power-manager_1.6.0.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfce4-power-manager/xfce4-power-manager_1.6.0.bb
@@ -20,7 +20,7 @@
     --enable-panel-plugins \
 "
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[systemd] = "--enable-polkit, --disable-polkit, polkit"
 
 PACKAGES += "xfce4-powermanager-plugin"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfconf/xfconf_4.12.0.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfconf/xfconf_4.12.0.bb
deleted file mode 100644
index ff1dfa4..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfconf/xfconf_4.12.0.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "Xfce configuration daemon and utilities"
-SECTION = "x11/wm"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-DEPENDS = "dbus-glib libxfce4util perl intltool-native xfce4-dev-tools-native"
-
-inherit xfce gtk-doc
-
-EXTRA_OECONF += "PERL=${STAGING_DIR_TARGET}/usr/bin/perl"
-
-SRC_URI[md5sum] = "8ebfac507b4d6ce3f4bac9d257c2853b"
-SRC_URI[sha256sum] = "9910eaea8405336415d4d7f3056403f8c67bc23ba0dce251eac35205c603b156"
-
-FILES_${PN} += "${libdir}/xfce4/xfconf/xfconfd \
-                ${datadir}/dbus-1/services/org.xfce.Xfconf.service"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfconf/xfconf_4.12.1.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfconf/xfconf_4.12.1.bb
new file mode 100644
index 0000000..a42426f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfconf/xfconf_4.12.1.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Xfce configuration daemon and utilities"
+SECTION = "x11/wm"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+DEPENDS = "dbus-glib libxfce4util perl intltool-native xfce4-dev-tools-native"
+
+inherit xfce gtk-doc
+
+EXTRA_OECONF += "PERL=${STAGING_DIR_TARGET}/usr/bin/perl"
+
+SRC_URI[md5sum] = "20dc8d2bfd80ba136bf4964021b32757"
+SRC_URI[sha256sum] = "35f48564e5694faa54fdc180cd3268e16fc2352946a89a3c2fc12cbe400ada36"
+
+FILES_${PN} += "${libdir}/xfce4/xfconf/xfconfd \
+                ${datadir}/dbus-1/services/org.xfce.Xfconf.service"
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfdesktop/xfdesktop_4.12.3.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfdesktop/xfdesktop_4.12.3.bb
index e951343..daecf82 100644
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfdesktop/xfdesktop_4.12.3.bb
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfdesktop/xfdesktop_4.12.3.bb
@@ -2,7 +2,7 @@
 SECTION = "x11/base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-DEPENDS = "glib-2.0 gtk+ libxfce4util libxfce4ui libwnck xfconf dbus-glib thunar garcon exo"
+DEPENDS = "glib-2.0 gtk+ libxfce4util libxfce4ui libwnck xfconf dbus-glib dbus-glib-native thunar garcon exo"
 
 inherit xfce distro_features_check
 
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfwm4/files/0001-don-t-block-display-events-when-time-is-set-backward.patch b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfwm4/files/0001-don-t-block-display-events-when-time-is-set-backward.patch
deleted file mode 100644
index 08fd76b..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfwm4/files/0001-don-t-block-display-events-when-time-is-set-backward.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From e87977696f03b0c9f72884f8e3e3ec3248dfd80a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
-Date: Tue, 18 Jun 2013 12:46:42 +0200
-Subject: [PATCH] don't block display events when time is set backwards
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Upstream-Status: Submitted [1]
-
-[1] https://bugzilla.xfce.org/show_bug.cgi?id=10184
-
-Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
----
- src/display.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/src/display.c b/src/display.c
-index 00318d5..651bc7a 100644
---- a/src/display.c
-+++ b/src/display.c
-@@ -733,7 +733,7 @@ myDisplayUpdateCurrentTime (DisplayInfo *display, XEvent *ev)
-             break;
-     }
- 
--    if ((timestamp != (guint32) CurrentTime) && TIMESTAMP_IS_BEFORE(display->current_time, timestamp))
-+    if ((timestamp != (guint32) CurrentTime) /*&& TIMESTAMP_IS_BEFORE(display->current_time, timestamp)*/)
-     {
-         display->current_time = timestamp;
-     }
--- 
-1.7.6.5
-
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfwm4/xfwm4_4.12.3.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfwm4/xfwm4_4.12.3.bb
deleted file mode 100644
index ad70860..0000000
--- a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfwm4/xfwm4_4.12.3.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-DESCRIPTION="Xfce4 Window Manager"
-SECTION = "x11/wm"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d791728a073bc009b4ffaf00b7599855"
-DEPENDS = "virtual/libx11 libxpm gtk+ libxfce4util libxfce4ui xfconf libwnck dbus-glib startup-notification exo-native"
-
-inherit xfce update-alternatives distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "x11"
-
-SRC_URI += "file://0001-don-t-block-display-events-when-time-is-set-backward.patch"
-SRC_URI[md5sum] = "197ef087ca6a263627f1bea6d5a79d6f"
-SRC_URI[sha256sum] = "f4a988fbc4e0df7e8583c781d271559e56fd28696092f94ae052e9e6edb09eac"
-
-python populate_packages_prepend () {
-    themedir = d.expand('${datadir}/themes')
-    do_split_packages(d, themedir, '^(.*)', 'xfwm4-theme-%s', 'XFWM4 theme %s', allow_dirs=True)
-}
-
-PACKAGES_DYNAMIC += "^xfwm4-theme-.*"
-
-ALTERNATIVE_${PN} = "x-window-manager"
-ALTERNATIVE_TARGET[x-window-manager] = "${bindir}/xfwm4"
-ALTERNATIVE_PRIORITY[x-window-manager] = "30"
-
-RDEPENDS_${PN} = "xfwm4-theme-default"
-FILES_${PN} += "${libdir}/xfce4/xfwm4/helper-dialog \
-                ${datadir}/xfwm4/defaults \
-"
-FILES_${PN}-dbg += "${libexecdir}/xfce4/xfwm4/.debug/*"
-
diff --git a/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfwm4/xfwm4_4.12.4.bb b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfwm4/xfwm4_4.12.4.bb
new file mode 100644
index 0000000..2aa68e3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-xfce/recipes-xfce/xfwm4/xfwm4_4.12.4.bb
@@ -0,0 +1,30 @@
+DESCRIPTION="Xfce4 Window Manager"
+SECTION = "x11/wm"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d791728a073bc009b4ffaf00b7599855"
+DEPENDS = "virtual/libx11 libxpm gtk+ libxfce4util libxfce4ui xfconf libwnck dbus-glib startup-notification exo-native"
+
+inherit xfce update-alternatives distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI[md5sum] = "3ec136efc5387fd3b53cd66b684f52d7"
+SRC_URI[sha256sum] = "fa74048a75649a6e92df763a3cfb706d3fed1e1a6adf567f6693325a5a6efb36"
+
+python populate_packages_prepend () {
+    themedir = d.expand('${datadir}/themes')
+    do_split_packages(d, themedir, '^(.*)', 'xfwm4-theme-%s', 'XFWM4 theme %s', allow_dirs=True)
+}
+
+PACKAGES_DYNAMIC += "^xfwm4-theme-.*"
+
+ALTERNATIVE_${PN} = "x-window-manager"
+ALTERNATIVE_TARGET[x-window-manager] = "${bindir}/xfwm4"
+ALTERNATIVE_PRIORITY[x-window-manager] = "30"
+
+RDEPENDS_${PN} = "xfwm4-theme-default"
+FILES_${PN} += "${libdir}/xfce4/xfwm4/helper-dialog \
+                ${datadir}/xfwm4/defaults \
+"
+FILES_${PN}-dbg += "${libexecdir}/xfce4/xfwm4/.debug/*"
+
diff --git a/import-layers/meta-raspberrypi/.github/ISSUE_TEMPLATE.md b/import-layers/meta-raspberrypi/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..ea2697d
--- /dev/null
+++ b/import-layers/meta-raspberrypi/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,27 @@
+<!--
+If you are reporting a new issue, make sure that we do not have any duplicates
+already open. You can ensure this by searching the issue list for this
+repository. If there is a duplicate, please close your issue and add a comment
+to the existing issue instead.
+-->
+
+**Description**
+
+<!--
+Briefly describe the problem you are having in a few paragraphs.
+-->
+
+**Steps to reproduce the issue:**
+1.
+2.
+3.
+
+**Describe the results you received:**
+
+
+**Describe the results you expected:**
+
+
+**Additional information you deem important (e.g. issue happens only occasionally):**
+
+**Additional details (revisions used, host distro, etc.):**
diff --git a/import-layers/meta-raspberrypi/.github/PULL_REQUEST_TEMPLATE.md b/import-layers/meta-raspberrypi/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..223f23a
--- /dev/null
+++ b/import-layers/meta-raspberrypi/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,16 @@
+<!--
+Please make sure you've read and understood our contributing guidelines.
+
+For additional information on the contribution guidelines:
+https://wiki.yoctoproject.org/wiki/Contribution_Guidelines#General_Information
+
+If this PR fixes an issue, make sure your description includes "fixes #xxxx".
+
+If this PR connects to an issue, make sure your description includes "connected to #xxxx".
+
+Please provide the following information:
+-->
+
+**- What I did**
+
+**- How I did it**
diff --git a/import-layers/meta-raspberrypi/.gitignore b/import-layers/meta-raspberrypi/.gitignore
index bd5616a..706144a 100644
--- a/import-layers/meta-raspberrypi/.gitignore
+++ b/import-layers/meta-raspberrypi/.gitignore
@@ -3,3 +3,5 @@
 .*.swp
 *.orig
 *.rej
+*.log
+docs/_build
diff --git a/import-layers/meta-raspberrypi/README b/import-layers/meta-raspberrypi/README
deleted file mode 100644
index bfc3e2e..0000000
--- a/import-layers/meta-raspberrypi/README
+++ /dev/null
@@ -1,352 +0,0 @@
-Quick links
-===========
-Git repository web frontend:
-    http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/
-Mailing list (yocto mailing list):
-    yocto@yoctoproject.org
-Issues management (Github Issues):
-    https://github.com/agherzan/meta-raspberrypi/issues
-
-
-Contents:
-=========
-1. Description
-2. Yocto BSP Layer - Raspberry Pi
-    2.A. How to use it
-    2.B. Images
-3. Optional build configuration
-    3.A. Compressed deployed files
-    3.B. GPU memory
-    3.C. Add purchased license codecs
-    3.D. Disable overscan
-    3.E. Set overclocking options
-    3.F. Video camera support with V4L2 drivers
-    3.G. Enable offline compositing support
-    3.H. Enable kgdb over console support
-    3.I. Boot to U-Boot
-    3.J. Image with Initramfs
-    3.K. Device tree support
-    3.L. Enable SPI bus
-    3.M. Enable I2C
-    3.N. Enable PiTFT support
-    3.O. Enable UART support
-4. Extra apps
-    4.A. omxplayer
-5. Board Configuration
-    5.A. Audio Routing
-6. Source code and mirrors
-7. Contribution
-    7.A. Mailing List
-    7.B. Github Issues
-8. Maintainers
-
-
-1. Description
-==============
-
-This is the general hardware specific BSP overlay for the RaspberryPi device.
-
-More information can be found at:
-                   http://www.raspberrypi.org/ (Official Site)
-
-The core BSP part of meta-raspberrypi should work with different
-OpenEmbedded/Yocto distributions and layer stacks, such as:
-* Distro-less (only with OE-Core).
-* Angstrom.
-* Yocto/Poky (main focus of testing).
-
-2. Yocto BSP Layer - RaspberryPi
-================================
-
-This layer depends on:
-
-URI: git://git.yoctoproject.org/poky
-branch: master
-revision: HEAD
-
-URI: git://git.openembedded.org/meta-openembedded
-layers: meta-oe, meta-multimedia, meta-networking, meta-python
-branch: master
-revision: HEAD
-
-2.A. How to use it
-==================
-a. source poky/oe-init-build-env rpi-build
-b. Add needed layer to bblayers.conf:
-    - meta-raspberrypi
-c. Set MACHINE in local.conf to one of the supported boards:
-    - raspberrypi
-    - raspberrypi0
-    - raspberrypi0-wifi
-    - raspberrypi2
-    - raspberrypi3
-    - raspberrypi-cm (dummy alias for raspberrypi)
-    - raspberrypi-cm3 (dummy alias for raspberrypi2)
-d. bitbake rpi-hwup-image
-e. dd to a SD card the generated sdimg file (use xzcat if rpi-sdimg.xz is used)
-f. Boot your RPI.
-
-2.B. Images
--===========
-* rpi-hwup-image
-    Hardware up image
-* rpi-basic-image
-    Based on rpi-hwup-image with some added features (ex: splash)
-* rpi-test-image
-    Image based on rpi-basic-image which includes most of the packages in this
-    layer and some media samples.
-
-3. Optional build configuration
-===============================
-
-There are a set of ways in which a user can influence different paramenters of the build.
-We list here the ones that are closely related to this BSP or specific to it. For the rest
-please check: http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html
-
-3.A. Compressed deployed files
-==============================
-1. Overwrite IMAGE_FSTYPES in local.conf
-    IMAGE_FSTYPES = "tar.bz2 ext3.xz"
-2. Overwrite SDIMG_ROOTFS_TYPE in local.conf
-    SDIMG_ROOTFS_TYPE = "ext3.xz"
-3. Overwrite SDIMG_COMPRESSION in local.conf
-    SDIMG_COMPRESSION = "xz"
-*Accommodate the values above to your own needs (ex: ext3 / ext4).
-
-3.B. GPU memory
-===============
-Variable    : Details
-GPU_MEM     : GPU memory in megabyte. Sets the memory split between the ARM and
-              GPU. ARM gets the remaining memory. Min 16. Default 64.
-GPU_MEM_256 : GPU memory in megabyte for the 256MB Raspberry Pi. Ignored by the
-              512MB RP. Overrides gpu_mem. Max 192. Default not set.
-GPU_MEM_512 : GPU memory in megabyte for the 512MB Raspberry Pi. Ignored by the
-              256MB RP. Overrides gpu_mem. Max 448. Default not set.
-GPU_MEM_1024: GPU memory in megabyte for the 1024MB Raspberry Pi. Ignored by the
-              256MB/512MB RP. Overrides gpu_mem. Max 944. Default not set.
-
-3.C. Add purchased license codecs
-=================================
-To add you own licenses use variables KEY_DECODE_MPG2 and KEY_DECODE_WVC1 in
-local.conf. Example:
-KEY_DECODE_MPG2 = "12345678"
-KEY_DECODE_WVC1 = "12345678"
-You can supply more licenses separated by comma. Example:
-KEY_DECODE_WVC1 = "0x12345678,0xabcdabcd,0x87654321"
-
-3.D. Disable overscan
-=====================
-By default the GPU adds a black border around the video output to compensate for
-TVs which cut off part of the image. To disable this set this variable in
-local.conf:
-DISABLE_OVERSCAN = "1"
-
-3.E. Set overclocking options
-=============================
-The Raspberry PI can be overclocked. As of now overclocking up to the "Turbo
-Mode" is officially supported by the raspbery and does not void warranty.
-Check the config.txt for a detailed description of options and modes. Example:
-# Turbo mode
-ARM_FREQ = "1000"
-CORE_FREQ = "500"
-SDRAM_FREQ = "500"
-OVER_VOLTAGE = "6"
-
-3.F. Video camera support with V4L2 drivers
-===========================================
-Set this variable to enable support for the video camera (Linux 3.12.4+ required)
-VIDEO_CAMERA = "1"
-
-3.G. Enable offline compositing support
-=======================================
-Set this variable to enable support for dispmanx offline compositing
-DISPMANX_OFFLINE = "1"
-
-This will enable the firmware to fall back to off-line compositing of
-Dispmanx elements. Normally the compositing is done on-line, during scanout,
-but cannot handle too many elements. With off-line enabled, an off-screen
-buffer is allocated for compositing. When scene complexity (number and sizes
-of elements) is high, compositing will happen off-line into the buffer.
-
-Heavily recommended for Wayland/Weston.
-
-See: http://wayland.freedesktop.org/raspberrypi.html
-
-3.H. Enable kgdb over console support
-=====================================
-To add the kdbg over console (kgdboc) parameter to the kernel command line,
-set this variable in local.conf:
-ENABLE_KGDB = "1"
-
-3.I. Boot to U-Boot
-===================
-To have u-boot load kernel image, set in your local.conf
-KERNEL_IMAGETYPE = "uImage"
-
-This will make kernel.img be u-boot image which will load uImage.
-By default, kernel.img is the actual kernel image (ex. Image).
-
-3.J. Image with Initramfs
-=========================
-To build an initramfs image :
-    * Set this 3 kernel variables (in linux-raspberrypi.inc for example)
-        - kernel_configure_variable BLK_DEV_INITRD y
-        - kernel_configure_variable INITRAMFS_SOURCE ""
-        - kernel_configure_variable RD_GZIP y
-    * Set the yocto variables (in linux-raspberrypi.inc for example)
-        - INITRAMFS_IMAGE = "<a name for your initramfs image>"
-        - INITRAMFS_IMAGE_BUNDLE = "1"
-    * Set the meta-rasberrypi variable (in raspberrypi.conf for example)
-        - KERNEL_INITRAMFS = "-initramfs"
-
-3.K. Device tree support
-=========================
-Device tree for RPi is only supported when using linux-raspberrypi 3.18+
-kernels.
-
-    * Set KERNEL_DEVICETREE (in conf/machine/raspberrypi.conf)
-        - the trailer is added to the kernel image before kernel install task.
-          While creating the SDCard image, this modified kernel is put on
-          boot partition (as kernel.img) as well as DeviceTree blobs (.dtb files).
-
-NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for
-      older kernel versions.
-
-3.L. Enable SPI bus
-====================
-When using device tree kernels, set this variable to enable the SPI bus
-ENABLE_SPI_BUS = "1"
-
-3.M. Enable I2C
-===============
-When using device tree kernels, set this variable to enable I2C
-ENABLE_I2C = "1"
-
-3.N. Enable PiTFT support
-=========================
-Basic support for using PiTFT screens can be enabled by adding
-below in local.conf:
-
-MACHINE_FEATURES += "pitft"
-  - This will enable SPI bus and i2c device-trees, it will also setup
-    framebuffer for console and x server on PiTFT.
-
-NOTE: To get this working the overlay for the PiTFT model must be build,
-      added and specified as well (dtoverlay=<driver> in config.txt)
-
-Below is a list of currently supported PiTFT models in meta-raspberrypi,
-the modelname should be added as a MACHINE_FEATURES in local.conf like below:
-    - MACHINE_FEATURES += "pitft <modelname>"
-
-List of currently supported models:
-    - pitft22
-    - pitft28r
-
-3.O. Enable UART
-===============
-RaspberryPi 0, 1, 2 and CM will have UART console enabled by default.
-
-RaspberryPi 0 WiFi and 3 does not have the UART enabled by default because this
-needs a fixed core frequency and enable_uart wil set it to the minimum. Certain
-operations - 60fps h264 decode, high quality deinterlace - which aren't
-performed on the ARM may be affected, and we wouldn't want to do that to users
-who don't want to use the serial port. Users who want serial console support on
-RaspberryPi3 will have to explicitely set in local.conf: ENABLE_UART = "1".
-
-Ref.: https://github.com/raspberrypi/firmware/issues/553
-      https://github.com/RPi-Distro/repo/issues/22
-
-4. Extra apps
-=============
-
-4.A. omxplayer
-==============
-omxplayer depends on libav which has a commercial license. So in order to be
-able to compile omxplayer you will need to whiteflag the commercial license
-adding to you local.conf:
-LICENSE_FLAGS_WHITELIST = "commercial"
-
-5. Board Configuration
-======================
-
-5.A. Audio Routing
-==================
-To load audio driver
-
-    modprobe snd-bcm2835
-
-To test audio playback
-
-    e.g. aplay test.wav
-
-Note that without HDMI connected this emits audio from the 3.5in jack connector
-as expected. However With an HDMI display connected there is no audio output from
-the jack connector.
-
-To force the audio routing via the 3.5in jack connector use
-
-    amixer cset numid=3 1
-
-Options to amixer cset are:
-
-    0=auto
-    1=headphones
-    2=hdmi
-
-6. Source code and mirrors
-==========================
-
-Main repo:
-    git://git.yoctoproject.org/meta-raspberrypi
-    http://git.yoctoproject.org/git/meta-raspberrypi
-
-Github mirror:
-    https://github.com/agherzan/meta-raspberrypi
-
-Bitbucket mirror:
-    https://bitbucket.org/agherzan/meta-raspberrypi
-
-
-7. Contributing
-===============
-
-7.A. Mailing list
-=================
-The main communication tool we use is a mailing list:
-    yocto@yoctoproject.org
-    https://lists.yoctoproject.org/listinfo/yocto
-
-Feel free to ask any kind of questions but always prepend your email subject
-with "[meta-raspberrypi]". This is because we use the 'yocto' mailing list and
-not a perticular 'meta-raspberrypi' mailing list.
-
-7.B. Patches and pull requests
-==============================
-
-To contribute to this project you should send pull requests to the github mirror
-(<https://github.com/agherzan/meta-raspberrypi>). **Additionally** you can send
-the patches for review to the above specified mailing list.
-
-When creating patches, please use something like:
-
-    git format-patch -s --subject-prefix='meta-raspberrypi][PATCH' origin
-
-When sending patches to mailing list, please use something like:
-
-    git send-email --to yocto@yoctoproject.org <generated patch>
-
-7.C. Github issues
-==================
-In order to manage and trace the meta-raspberrypi issues, we use github issues:
-    https://github.com/agherzan/meta-raspberrypi/issues
-
-If you push patches which have a github issue associated, please provide the
-issue number in the commit log just before "Signed-off-by" line(s). Example line
-for a bug:
-    [Issue #13]
-
-
-8. Maintainers
-==============
-
-    Andrei Gherzan <andrei at gherzan.ro>
diff --git a/import-layers/meta-raspberrypi/README.md b/import-layers/meta-raspberrypi/README.md
new file mode 100644
index 0000000..c2ea048
--- /dev/null
+++ b/import-layers/meta-raspberrypi/README.md
@@ -0,0 +1,55 @@
+# meta-raspberrypi
+
+Yocto BSP layer for the Raspberry Pi boards - <http://www.raspberrypi.org/>.
+
+[![Build Status](https://yocto-ci.resin.io/job/meta-raspberrypi1/badge/icon)](https://yocto-ci.resin.io/job/meta-raspberrypi1)
+[![Build Status](https://yocto-ci.resin.io/job/meta-raspberrypi2/badge/icon)](https://yocto-ci.resin.io/job/meta-raspberrypi2)
+[![Build Status](https://yocto-ci.resin.io/job/meta-raspberrypi3/badge/icon)](https://yocto-ci.resin.io/job/meta-raspberrypi3)
+[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/agherzan/meta-raspberrypi)
+
+## Quick links
+
+* Git repository web frontend:
+  <http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/>
+* Mailing list (yocto mailing list): <yocto@yoctoproject.org>
+* Issues management (Github Issues):
+  <https://github.com/agherzan/meta-raspberrypi/issues>
+
+## Description
+
+This is the general hardware specific BSP overlay for the RaspberryPi device.
+
+More information can be found at: <http://www.raspberrypi.org/> (Official Site)
+
+The core BSP part of meta-raspberrypi should work with different
+OpenEmbedded/Yocto distributions and layer stacks, such as:
+
+* Distro-less (only with OE-Core).
+* Angstrom.
+* Yocto/Poky (main focus of testing).
+
+## Dependencies
+
+This layer depends on:
+
+* URI: git://git.yoctoproject.org/poky
+  * branch: pyro
+  * revision: HEAD
+
+* URI: git://git.openembedded.org/meta-openembedded
+  * layers: meta-oe, meta-multimedia, meta-networking, meta-python
+  * branch: pyro
+  * revision: HEAD
+
+## Quick Start
+
+1. source poky/oe-init-build-env rpi-build
+2. Add this layer to bblayers.conf and the dependencies above
+3. Set MACHINE in local.conf to one of the supported boards
+4. bitbake rpi-hwup-image
+5. dd to a SD card the generated sdimg file (use xzcat if rpi-sdimg.xz is used)
+6. Boot your RPI.
+
+## Maintainers
+
+* Andrei Gherzan `<andrei at gherzan.ro>`
diff --git a/import-layers/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass b/import-layers/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass
index dc2330a..e925d4e 100644
--- a/import-layers/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass
+++ b/import-layers/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass
@@ -3,8 +3,8 @@
 def get_dts(d, ver=None):
     import re
 
-    staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True)
-    dts = d.getVar("KERNEL_DEVICETREE", True)
+    staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR")
+    dts = d.getVar("KERNEL_DEVICETREE")
 
     # d.getVar() might return 'None' as a normal string
     # leading to 'is None' check isn't enough.
diff --git a/import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass b/import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass
index 79ab53a..56a854e 100644
--- a/import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass
+++ b/import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass
@@ -72,6 +72,10 @@
 # Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS.
 FATPAYLOAD ?= ""
 
+# SD card vfat partition image name
+SDIMG_VFAT = "${IMAGE_NAME}.vfat"
+SDIMG_LINK_VFAT = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.vfat"
+
 IMAGE_CMD_rpi-sdimg () {
 
 	# Align partitions
@@ -107,7 +111,7 @@
 		DT_ROOT="${@split_overlays(d, 1)}"
 
 		# Copy board device trees to root folder
-		for DTB in ${DT_ROOT}; do
+		for DTB in $DT_ROOT; do
 			DTB_BASE_NAME=`basename ${DTB} .dtb`
 
 			mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb
@@ -115,7 +119,7 @@
 
 		# Copy device tree overlays to dedicated folder
 		mmd -i ${WORKDIR}/boot.img overlays
-		for DTB in ${DT_OVERLAYS}; do
+		for DTB in $DT_OVERLAYS; do
 				DTB_EXT=${DTB##*.}
 				DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
 
@@ -145,6 +149,16 @@
 	echo "${IMAGE_NAME}" > ${WORKDIR}/image-version-info
 	mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}/image-version-info ::
 
+        # Deploy vfat partition (for u-boot case only)
+        case "${KERNEL_IMAGETYPE}" in
+        "uImage")
+                cp ${WORKDIR}/boot.img ${IMGDEPLOYDIR}/${SDIMG_VFAT}
+                ln -sf ${SDIMG_VFAT} ${SDIMG_LINK_VFAT}
+                ;;
+        *)
+                ;;
+        esac
+
 	# Burn Partitions
 	dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
 	# If SDIMG_ROOTFS_TYPE is a .xz file use xzcat
diff --git a/import-layers/meta-raspberrypi/conf/machine/include/rpi-base.inc b/import-layers/meta-raspberrypi/conf/machine/include/rpi-base.inc
index dc98099..7ed1088 100644
--- a/import-layers/meta-raspberrypi/conf/machine/include/rpi-base.inc
+++ b/import-layers/meta-raspberrypi/conf/machine/include/rpi-base.inc
@@ -32,6 +32,7 @@
     overlays/lirc-rpi.dtbo \
     overlays/pitft22.dtbo \
     overlays/pitft28-resistive.dtbo \
+    overlays/pitft35-resistive.dtbo \
     overlays/pps-gpio.dtbo \
     overlays/rpi-ft5406.dtbo \
     overlays/w1-gpio.dtbo \
@@ -52,7 +53,44 @@
 # Set Raspberrypi splash image
 SPLASH = "psplash-raspberrypi"
 
-IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* ${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}"
+def make_dtb_boot_files(d):
+    # Generate IMAGE_BOOT_FILES entries for device tree files listed in
+    # KERNEL_DEVICETREE.
+    alldtbs = d.getVar('KERNEL_DEVICETREE')
+    imgtyp = d.getVar('KERNEL_IMAGETYPE')
+
+    def transform(dtb):
+        if dtb.endswith('dtb'):
+            # eg: whatever/bcm2708-rpi-b.dtb has:
+            #     DEPLOYDIR file: ${KERNEL_IMAGETYPE}-bcm2708-rpi-b.dtb
+            #     destination: bcm2708-rpi-b.dtb
+            base = os.path.basename(dtb)
+            src = '{}-{}'.format(imgtyp, base)
+            dst = base
+            return '{};{}'.format(src, dst)
+        elif dtb.endswith('dtbo'):
+            # overlay dtb:
+            # eg: overlays/hifiberry-amp.dtbo has:
+            #     DEPLOYDIR file: ${KERNEL_IMAGETYPE}-hifiberry-amp.dtbo
+            #     destination: overlays/hifiberry-amp.dtbo
+            base = os.path.basename(dtb)
+            src = '{}-{}'.format(imgtyp, base)
+            dst = dtb
+            return '{};{}'.format(src, dtb)
+
+    return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
+
+
+IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \
+                 ${@make_dtb_boot_files(d)} \
+                 ${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', \
+                    '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
+                    '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
+                 "
+do_image_wic[depends] += " \
+    bcm2835-bootfiles:do_deploy \
+    ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
+    "
 
 # The kernel image is installed into the FAT32 boot partition and does not need
 # to also be installed into the rootfs.
diff --git a/import-layers/meta-raspberrypi/conf/machine/include/rpi-default-providers.inc b/import-layers/meta-raspberrypi/conf/machine/include/rpi-default-providers.inc
index 078e9d6..5b2658b 100644
--- a/import-layers/meta-raspberrypi/conf/machine/include/rpi-default-providers.inc
+++ b/import-layers/meta-raspberrypi/conf/machine/include/rpi-default-providers.inc
@@ -6,4 +6,5 @@
 PREFERRED_PROVIDER_virtual/libgles2 ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "userland", d)}"
 PREFERRED_PROVIDER_virtual/libgl ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "mesa-gl", d)}"
 PREFERRED_PROVIDER_virtual/mesa ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "mesa-gl", d)}"
+PREFERRED_PROVIDER_libgbm ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "mesa-gl", d)}"
 PREFERRED_PROVIDER_jpeg ?= "jpeg"
diff --git a/import-layers/meta-raspberrypi/conf/machine/include/rpi-default-versions.inc b/import-layers/meta-raspberrypi/conf/machine/include/rpi-default-versions.inc
index e65a4ae..faa6b41 100644
--- a/import-layers/meta-raspberrypi/conf/machine/include/rpi-default-versions.inc
+++ b/import-layers/meta-raspberrypi/conf/machine/include/rpi-default-versions.inc
@@ -1,3 +1,3 @@
 # RaspberryPi BSP default versions
 
-PREFERRED_VERSION_linux-raspberrypi ?= "4.4.%"
+PREFERRED_VERSION_linux-raspberrypi ??= "4.9.%"
diff --git a/import-layers/meta-raspberrypi/conf/machine/raspberrypi0.conf b/import-layers/meta-raspberrypi/conf/machine/raspberrypi0.conf
index 7c2b811..3bd9e95 100644
--- a/import-layers/meta-raspberrypi/conf/machine/raspberrypi0.conf
+++ b/import-layers/meta-raspberrypi/conf/machine/raspberrypi0.conf
@@ -5,5 +5,5 @@
 MACHINEOVERRIDES = "raspberrypi:${MACHINE}"
 include conf/machine/raspberrypi.conf
 
-SERIAL_CONSOLE = "115200 ttyAMA0"
+SERIAL_CONSOLE ?= "115200 ttyAMA0"
 VC4_CMA_SIZE ?= "cma-128"
diff --git a/import-layers/meta-raspberrypi/conf/machine/raspberrypi3-64.conf b/import-layers/meta-raspberrypi/conf/machine/raspberrypi3-64.conf
index fc36142..e3d11f2 100644
--- a/import-layers/meta-raspberrypi/conf/machine/raspberrypi3-64.conf
+++ b/import-layers/meta-raspberrypi/conf/machine/raspberrypi3-64.conf
@@ -6,9 +6,6 @@
 
 MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-bcm43430"
 
-# Set this early so it overrides rpi-default-versions.inc
-PREFERRED_VERSION_linux-raspberrypi ?= "4.9.%"
-
 require conf/machine/include/arm/arch-armv8.inc
 include conf/machine/include/rpi-base.inc
 
@@ -26,6 +23,7 @@
     overlays/lirc-rpi.dtbo \
     overlays/pitft22.dtbo \
     overlays/pitft28-resistive.dtbo \
+    overlays/pitft35-resistive.dtbo \
     overlays/pps-gpio.dtbo \
     overlays/rpi-ft5406.dtbo \
     overlays/w1-gpio.dtbo \
@@ -39,3 +37,4 @@
 VC4_CMA_SIZE ?= "cma-256"
 
 UBOOT_MACHINE = "rpi_3_config"
+MACHINE_FEATURES_append = " vc4graphics"
diff --git a/import-layers/meta-raspberrypi/conf/machine/raspberrypi3.conf b/import-layers/meta-raspberrypi/conf/machine/raspberrypi3.conf
index 884d875..b511bec 100644
--- a/import-layers/meta-raspberrypi/conf/machine/raspberrypi3.conf
+++ b/import-layers/meta-raspberrypi/conf/machine/raspberrypi3.conf
@@ -10,6 +10,6 @@
 
 SDIMG_KERNELIMAGE ?= "kernel7.img"
 KERNEL_DEFCONFIG ?= "bcm2709_defconfig"
-UBOOT_MACHINE ?= "rpi_2_config"
+UBOOT_MACHINE = "rpi_3_32b_config"
 SERIAL_CONSOLE ?= "115200 ttyS0"
 VC4_CMA_SIZE ?= "cma-256"
diff --git a/import-layers/meta-raspberrypi/docs/Makefile b/import-layers/meta-raspberrypi/docs/Makefile
new file mode 100644
index 0000000..d0de87f
--- /dev/null
+++ b/import-layers/meta-raspberrypi/docs/Makefile
@@ -0,0 +1,225 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  applehelp  to make an Apple Help Book"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  epub3      to make an epub3"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  texinfo    to make Texinfo files"
+	@echo "  info       to make Texinfo files and run them through makeinfo"
+	@echo "  gettext    to make PO message catalogs"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  xml        to make Docutils-native XML files"
+	@echo "  pseudoxml  to make pseudoxml-XML files for display purposes"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+	@echo "  coverage   to run coverage check of the documentation (if enabled)"
+	@echo "  dummy      to check syntax errors of document sources"
+
+.PHONY: clean
+clean:
+	rm -rf $(BUILDDIR)/*
+
+.PHONY: html
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+.PHONY: dirhtml
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+.PHONY: singlehtml
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+.PHONY: pickle
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+.PHONY: json
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+.PHONY: htmlhelp
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+.PHONY: qthelp
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/meta-raspberrypi.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/meta-raspberrypi.qhc"
+
+.PHONY: applehelp
+applehelp:
+	$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
+	@echo
+	@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
+	@echo "N.B. You won't be able to view it unless you put it in" \
+	      "~/Library/Documentation/Help or install it in your application" \
+	      "bundle."
+
+.PHONY: devhelp
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/meta-raspberrypi"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/meta-raspberrypi"
+	@echo "# devhelp"
+
+.PHONY: epub
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+.PHONY: epub3
+epub3:
+	$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
+	@echo
+	@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
+
+.PHONY: latex
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+.PHONY: latexpdf
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+.PHONY: latexpdfja
+latexpdfja:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through platex and dvipdfmx..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+.PHONY: text
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+.PHONY: man
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+.PHONY: texinfo
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+.PHONY: info
+info:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo "Running Texinfo files through makeinfo..."
+	make -C $(BUILDDIR)/texinfo info
+	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+.PHONY: gettext
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+.PHONY: changes
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+.PHONY: linkcheck
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+.PHONY: doctest
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
+
+.PHONY: coverage
+coverage:
+	$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
+	@echo "Testing of coverage in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/coverage/python.txt."
+
+.PHONY: xml
+xml:
+	$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
+	@echo
+	@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+
+.PHONY: pseudoxml
+pseudoxml:
+	$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
+	@echo
+	@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
+
+.PHONY: dummy
+dummy:
+	$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
+	@echo
+	@echo "Build finished. Dummy builder generates no files."
diff --git a/import-layers/meta-raspberrypi/docs/conf.py b/import-layers/meta-raspberrypi/docs/conf.py
new file mode 100644
index 0000000..ce0bb0a
--- /dev/null
+++ b/import-layers/meta-raspberrypi/docs/conf.py
@@ -0,0 +1,343 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+#
+# meta-raspberrypi documentation build configuration file, created by
+# sphinx-quickstart on Tue May 23 09:51:24 2017.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+# import os
+# import sys
+# sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#
+# needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = []
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+#
+# source_suffix = ['.rst', '.md']
+source_suffix = ['.rst', '.md']
+
+# The encoding of source files.
+#
+# source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = 'meta-raspberrypi'
+copyright = '2017, meta-raspberrypi contributors'
+author = 'meta-raspberrypi contributors'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = 'pyro'
+# The full version, including alpha/beta/rc tags.
+release = 'pyro'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#
+# today = ''
+#
+# Else, today_fmt is used as the format for a strftime call.
+#
+# today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This patterns also effect to html_static_path and html_extra_path
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#
+# default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#
+# add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#
+# add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#
+# show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+# modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+# keep_warnings = False
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+#
+html_theme = 'alabaster'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#
+# html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+# html_theme_path = []
+
+# The name for this set of Sphinx documents.
+# "<project> v<release> documentation" by default.
+#
+# html_title = 'meta-raspberrypi vmaster'
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#
+# html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#
+# html_logo = None
+
+# The name of an image file (relative to this directory) to use as a favicon of
+# the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#
+# html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#
+# html_extra_path = []
+
+# If not None, a 'Last updated on:' timestamp is inserted at every page
+# bottom, using the given strftime format.
+# The empty string is equivalent to '%b %d, %Y'.
+#
+# html_last_updated_fmt = None
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#
+# html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#
+# html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#
+# html_additional_pages = {}
+
+# If false, no module index is generated.
+#
+# html_domain_indices = True
+
+# If false, no index is generated.
+#
+# html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#
+# html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#
+# html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#
+# html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#
+# html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#
+# html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+# html_file_suffix = None
+
+# Language to be used for generating the HTML full-text search index.
+# Sphinx supports the following languages:
+#   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
+#   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
+#
+# html_search_language = 'en'
+
+# A dictionary with options for the search language support, empty by default.
+# 'ja' uses this config value.
+# 'zh' user can custom change `jieba` dictionary path.
+#
+# html_search_options = {'type': 'default'}
+
+# The name of a javascript file (relative to the configuration directory) that
+# implements a search results scorer. If empty, the default will be used.
+#
+# html_search_scorer = 'scorer.js'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'meta-raspberrypidoc'
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+     # The paper size ('letterpaper' or 'a4paper').
+     #
+     # 'papersize': 'letterpaper',
+
+     # The font size ('10pt', '11pt' or '12pt').
+     #
+     # 'pointsize': '10pt',
+
+     # Additional stuff for the LaTeX preamble.
+     #
+     # 'preamble': '',
+
+     # Latex figure (float) alignment
+     #
+     # 'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+#  author, documentclass [howto, manual, or own class]).
+latex_documents = [
+    (master_doc, 'meta-raspberrypi.tex', 'meta-raspberrypi Documentation',
+     'meta-raspberrypi contributors', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#
+# latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#
+# latex_use_parts = False
+
+# If true, show page references after internal links.
+#
+# latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#
+# latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#
+# latex_appendices = []
+
+# It false, will not define \strong, \code, 	itleref, \crossref ... but only
+# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
+# packages.
+#
+# latex_keep_old_macro_names = True
+
+# If false, no module index is generated.
+#
+# latex_domain_indices = True
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    (master_doc, 'meta-raspberrypi', 'meta-raspberrypi Documentation',
+     [author], 1)
+]
+
+# If true, show URL addresses after external links.
+#
+# man_show_urls = False
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+#  dir menu entry, description, category)
+texinfo_documents = [
+    (master_doc, 'meta-raspberrypi', 'meta-raspberrypi Documentation',
+     author, 'meta-raspberrypi', 'One line description of project.',
+     'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#
+# texinfo_appendices = []
+
+# If false, no module index is generated.
+#
+# texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#
+# texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#
+# texinfo_no_detailmenu = False
+
+source_parsers = {
+    '.md': 'recommonmark.parser.CommonMarkParser',
+}
diff --git a/import-layers/meta-raspberrypi/docs/contributing.md b/import-layers/meta-raspberrypi/docs/contributing.md
new file mode 100644
index 0000000..94dbf49
--- /dev/null
+++ b/import-layers/meta-raspberrypi/docs/contributing.md
@@ -0,0 +1,38 @@
+# Contributing
+
+## Mailing list
+
+The main communication tool we use is a mailing list:
+* <yocto@yoctoproject.org>
+* <https://lists.yoctoproject.org/listinfo/yocto>
+
+Feel free to ask any kind of questions but always prepend your email subject
+with "[meta-raspberrypi]". This is because we use the 'yocto' mailing list and
+not a perticular 'meta-raspberrypi' mailing list.
+
+## Patches and pull requests
+
+All the contributions should be compliant with the openembedded patch
+guidelines: <http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines>
+
+To contribute to this project you should send pull requests to the github mirror
+(<https://github.com/agherzan/meta-raspberrypi>). **Additionally** you can send
+the patches for review to the above specified mailing list.
+
+When creating patches for the mailing list, please use something like:
+
+    git format-patch -s --subject-prefix='meta-raspberrypi][PATCH' origin
+
+When sending patches to the mailing list, please use something like:
+
+    git send-email --to yocto@yoctoproject.org <generated patch>
+
+## Github issues
+
+In order to manage and trace the meta-raspberrypi issues, we use github issues:
+<https://github.com/agherzan/meta-raspberrypi/issues>
+
+If you push patches which have a github issue associated, please provide the
+issue number in the commit log just before "Signed-off-by" line(s). Example line
+for a bug:
+`[Issue #13]`
diff --git a/import-layers/meta-raspberrypi/docs/extra-apps.md b/import-layers/meta-raspberrypi/docs/extra-apps.md
new file mode 100644
index 0000000..53007dc
--- /dev/null
+++ b/import-layers/meta-raspberrypi/docs/extra-apps.md
@@ -0,0 +1,9 @@
+# Extra apps
+
+## omxplayer
+
+omxplayer depends on libav which has a commercial license. So in order to be
+able to compile omxplayer you will need to whiteflag the commercial
+license in your local.conf:
+
+    LICENSE_FLAGS_WHITELIST = "commercial"
diff --git a/import-layers/meta-raspberrypi/docs/extra-build-config.md b/import-layers/meta-raspberrypi/docs/extra-build-config.md
new file mode 100644
index 0000000..365c490
--- /dev/null
+++ b/import-layers/meta-raspberrypi/docs/extra-build-config.md
@@ -0,0 +1,180 @@
+# Optional build configuration
+
+There are a set of ways in which a user can influence different paramenters of
+the build. We list here the ones that are closely related to this BSP or
+specific to it. For the rest please check:
+<http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html>
+
+## Compressed deployed files
+
+1. Overwrite IMAGE_FSTYPES in local.conf
+    * `IMAGE_FSTYPES = "tar.bz2 ext3.xz"`
+
+2. Overwrite SDIMG_ROOTFS_TYPE in local.conf
+    * `SDIMG_ROOTFS_TYPE = "ext3.xz"`
+
+3. Overwrite SDIMG_COMPRESSION in local.conf
+    * `SDIMG_COMPRESSION = "xz"`
+
+Accommodate the values above to your own needs (ex: ext3 / ext4).
+
+## GPU memory
+
+* `GPU_MEM`: GPU memory in megabyte. Sets the memory split between the ARM and
+  GPU. ARM gets the remaining memory. Min 16. Default 64.
+
+* `GPU_MEM_256`: GPU memory in megabyte for the 256MB Raspberry Pi. Ignored by
+  the 512MB RP. Overrides gpu_mem. Max 192. Default not set.
+
+* `GPU_MEM_512`: GPU memory in megabyte for the 512MB Raspberry Pi. Ignored by
+  the 256MB RP. Overrides gpu_mem. Max 448. Default not set.
+
+* `GPU_MEM_1024`: GPU memory in megabyte for the 1024MB Raspberry Pi. Ignored by
+  the 256MB/512MB RP. Overrides gpu_mem. Max 944. Default not set.
+
+## Add purchased license codecs
+
+To add you own licenses use variables `KEY_DECODE_MPG2` and `KEY_DECODE_WVC1` in
+local.conf. Example:
+
+    KEY_DECODE_MPG2 = "12345678"
+    KEY_DECODE_WVC1 = "12345678"
+
+You can supply more licenses separated by comma. Example:
+
+    KEY_DECODE_WVC1 = "0x12345678,0xabcdabcd,0x87654321"
+
+
+## Disable overscan
+
+By default the GPU adds a black border around the video output to compensate for
+TVs which cut off part of the image. To disable this set this variable in
+local.conf:
+
+    DISABLE_OVERSCAN = "1"
+
+## Set overclocking options
+
+The Raspberry PI can be overclocked. As of now overclocking up to the "Turbo
+Mode" is officially supported by the raspbery and does not void warranty. Check
+the config.txt for a detailed description of options and modes. Example turbo
+mode:
+
+    ARM_FREQ = "1000"
+    CORE_FREQ = "500"
+    SDRAM_FREQ = "500"
+    OVER_VOLTAGE = "6"
+
+## Video camera support with V4L2 drivers
+
+Set this variable to enable support for the video camera (Linux 3.12.4+
+required):
+
+    VIDEO_CAMERA = "1"
+
+## Enable offline compositing support
+
+Set this variable to enable support for dispmanx offline compositing:
+
+    DISPMANX_OFFLINE = "1"
+
+This will enable the firmware to fall back to off-line compositing of Dispmanx
+elements. Normally the compositing is done on-line, during scanout, but cannot
+handle too many elements. With off-line enabled, an off-screen buffer is
+allocated for compositing. When scene complexity (number and sizes
+of elements) is high, compositing will happen off-line into the buffer.
+
+Heavily recommended for Wayland/Weston.
+
+See: <http://wayland.freedesktop.org/raspberrypi.html>
+
+## Enable kgdb over console support
+
+To add the kdbg over console (kgdboc) parameter to the kernel command line, set
+this variable in local.conf:
+
+    ENABLE_KGDB = "1"
+
+## Boot to U-Boot
+
+To have u-boot load kernel image, set in your local.conf:
+
+    KERNEL_IMAGETYPE = "uImage"
+
+This will make kernel.img be u-boot image which will load uImage. By default,
+kernel.img is the actual kernel image (ex. Image).
+
+## Image with Initramfs
+
+To build an initramfs image:
+
+* Set this 3 kernel variables (in linux-raspberrypi.inc for example)
+  - kernel_configure_variable BLK_DEV_INITRD y
+  - kernel_configure_variable INITRAMFS_SOURCE ""
+  - kernel_configure_variable RD_GZIP y
+
+* Set the yocto variables (in linux-raspberrypi.inc for example)
+  - `INITRAMFS_IMAGE = "<a name for your initramfs image>"`
+  - `INITRAMFS_IMAGE_BUNDLE = "1"`
+
+* Set the meta-rasberrypi variable (in raspberrypi.conf for example)
+  - `KERNEL_INITRAMFS = "-initramfs"`
+
+## Enable SPI bus
+
+When using device tree kernels, set this variable to enable the SPI bus:
+
+    ENABLE_SPI_BUS = "1"
+
+## Enable I2C
+
+When using device tree kernels, set this variable to enable I2C:
+
+    ENABLE_I2C = "1"
+
+## Enable PiTFT support
+
+Basic support for using PiTFT screens can be enabled by adding below in
+local.conf:
+
+* `MACHINE_FEATURES += "pitft"`
+  - This will enable SPI bus and i2c device-trees, it will also setup
+    framebuffer for console and x server on PiTFT.
+
+NOTE: To get this working the overlay for the PiTFT model must be build, added
+and specified as well (dtoverlay=<driver> in config.txt).
+
+Below is a list of currently supported PiTFT models in meta-raspberrypi, the
+modelname should be added as a MACHINE_FEATURES in local.conf like below:
+
+    MACHINE_FEATURES += "pitft <modelname>"
+
+List of currently supported models:
+* pitft22
+* pitft28r
+* pitft35r
+
+## Misc. display
+
+If you would like to use the Waveshare "C" 1024×600, 7 inch Capacitive Touch
+Screen LCD, HDMI interface (<http://www.waveshare.com/7inch-HDMI-LCD-C.htm>) Rev
+2.1, please set the following in your local.conf:
+
+    WAVESHARE_1024X600_C_2_1 = "1"
+
+## Enable UART
+
+RaspberryPi 0, 1, 2 and CM will have UART console enabled by default.
+
+RaspberryPi 0 WiFi and 3 does not have the UART enabled by default because this
+needs a fixed core frequency and enable_uart wil set it to the minimum. Certain
+operations - 60fps h264 decode, high quality deinterlace - which aren't
+performed on the ARM may be affected, and we wouldn't want to do that to users
+who don't want to use the serial port. Users who want serial console support on
+RaspberryPi3 will have to explicitely set in local.conf:
+
+    ENABLE_UART = "1"
+
+Ref.:
+* <https://github.com/raspberrypi/firmware/issues/553>
+* <https://github.com/RPi-Distro/repo/issues/22>
diff --git a/import-layers/meta-raspberrypi/docs/index.rst b/import-layers/meta-raspberrypi/docs/index.rst
new file mode 100644
index 0000000..0d7ee07
--- /dev/null
+++ b/import-layers/meta-raspberrypi/docs/index.rst
@@ -0,0 +1,26 @@
+.. meta-raspberrypi documentation master file, created by
+   sphinx-quickstart on Tue May 23 09:51:24 2017.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Welcome to meta-raspberrypi's documentation!
+============================================
+
+Contents:
+
+.. toctree::
+   :maxdepth: 2
+
+   readme
+   layer-contents
+   extra-build-config
+   extra-apps
+   contributing
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/import-layers/meta-raspberrypi/docs/layer-contents.md b/import-layers/meta-raspberrypi/docs/layer-contents.md
new file mode 100644
index 0000000..29cfa35
--- /dev/null
+++ b/import-layers/meta-raspberrypi/docs/layer-contents.md
@@ -0,0 +1,24 @@
+# Layer Contents
+
+## Supported Machines
+
+* raspberrypi
+* raspberrypi0
+* raspberrypi0-wifi
+* raspberrypi2
+* raspberrypi3
+* raspberrypi3-64 (64 bit kernel & userspace)
+* raspberrypi-cm (dummy alias for raspberrypi)
+* raspberrypi-cm3 (dummy alias for raspberrypi2)
+
+## Images
+
+* rpi-hwup-image
+  * Hardware up image
+
+* rpi-basic-image
+  * Based on rpi-hwup-image with some added features (ex: splash)
+
+* rpi-test-image
+  * Image based on rpi-basic-image which includes most of the packages in this
+    layer and some media samples.
diff --git a/import-layers/meta-raspberrypi/docs/readme.md b/import-layers/meta-raspberrypi/docs/readme.md
new file mode 120000
index 0000000..32d46ee
--- /dev/null
+++ b/import-layers/meta-raspberrypi/docs/readme.md
@@ -0,0 +1 @@
+../README.md
\ No newline at end of file
diff --git a/import-layers/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb b/import-layers/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb
index 20ec343..b3c5084 100644
--- a/import-layers/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb
+++ b/import-layers/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb
@@ -18,6 +18,7 @@
 PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
 PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}"
 PITFT28r="${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "1", "0", d)}"
+PITFT35r="${@bb.utils.contains("MACHINE_FEATURES", "pitft35r", "1", "0", d)}"
 
 VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}"
 
@@ -99,6 +100,11 @@
         echo "dtoverlay=pitft28-resistive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
     fi
 
+    if [ "${PITFT35r}" = "1" ]; then
+        echo "# Enable PITFT35r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "dtoverlay=pitft35-resistive,rotate=90,speed=42000000,fps=20" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    fi
+
     # UART support
     if [ "${ENABLE_UART}" = "1" ]; then
         echo "# Enable UART" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
@@ -110,6 +116,16 @@
         echo "# Enable VC4 Graphics" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
         echo "dtoverlay=vc4-kms-v3d,${VC4_CMA_SIZE}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
     fi
+
+    # Waveshare "C" 1024x600 7" Rev2.1 IPS capacitive touch (http://www.waveshare.com/7inch-HDMI-LCD-C.htm)
+    if [ "${WAVESHARE_1024X600_C_2_1}" = "1" ]; then
+        echo "# Waveshare \"C\" 1024x600 7\" Rev2.1 IPS capacitive touch screen" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "max_usb_current=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "hdmi_group=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "hdmi_mode=87" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "hdmi_cvt 1024 600 60 6 0 0 0" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+        echo "hdmi_drive=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    fi
 }
 
 do_deploy_append_raspberrypi3-64() {
diff --git a/import-layers/meta-raspberrypi/recipes-bsp/common/firmware.inc b/import-layers/meta-raspberrypi/recipes-bsp/common/firmware.inc
index 1c3a911..67078c1 100644
--- a/import-layers/meta-raspberrypi/recipes-bsp/common/firmware.inc
+++ b/import-layers/meta-raspberrypi/recipes-bsp/common/firmware.inc
@@ -1,10 +1,9 @@
-RPIFW_DATE ?= "20170405"
+RPIFW_DATE ?= "20171029"
 RPIFW_SRC_URI ?= "https://github.com/raspberrypi/firmware/archive/1.${RPIFW_DATE}.tar.gz"
 RPIFW_S ?= "${WORKDIR}/firmware-1.${RPIFW_DATE}"
 
 SRC_URI = "${RPIFW_SRC_URI}"
-SRC_URI[md5sum] = "ea82d14a7cd8cfae9b78e00d4e56bc71"
-SRC_URI[sha256sum] = "2f4e5bddbac1372590db203002c35cbba3fb9d6172a93c314ee27bf05ae13bff"
-
+SRC_URI[md5sum] = "4d27c1888a7bab3097471906e7b4a319"
+SRC_URI[sha256sum] = "46ce28c8d87ef22bdcc57ac1836ca3f04d1ec6f46580ff5a30bf76b3c0822117"
 PV = "${RPIFW_DATE}"
 
diff --git a/import-layers/meta-raspberrypi/recipes-bsp/u-boot/files/0001-arm-add-save_boot_params-for-ARM1176.patch b/import-layers/meta-raspberrypi/recipes-bsp/u-boot/files/0001-arm-add-save_boot_params-for-ARM1176.patch
deleted file mode 100644
index a5ebff5..0000000
--- a/import-layers/meta-raspberrypi/recipes-bsp/u-boot/files/0001-arm-add-save_boot_params-for-ARM1176.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 3e10fcde3f3c24a488866dd33fa3f5d46ff3d7a3 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?C=C3=A9dric=20Schieli?= <cschieli@gmail.com>
-Date: Fri, 11 Nov 2016 11:59:06 +0100
-Subject: [PATCH] arm: add save_boot_params for ARM1176
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Implement a hook to allow boards to save boot-time CPU state for later
-use. When U-Boot is chain-loaded by another bootloader, CPU registers may
-contain useful information such as system configuration information. This
-feature mirrors the equivalent ARMv7 feature.
-
-Signed-off-by: Cédric Schieli <cschieli@gmail.com>
-Acked-by: Stephen Warren <swarren@nvidia.com>
-Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
-Upstream-status: Backport
----
- arch/arm/cpu/arm1176/start.S | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
-index a602d4e..7c00201 100644
---- a/arch/arm/cpu/arm1176/start.S
-+++ b/arch/arm/cpu/arm1176/start.S
-@@ -16,6 +16,7 @@
- 
- #include <asm-offsets.h>
- #include <config.h>
-+#include <linux/linkage.h>
- 
- #ifndef CONFIG_SYS_PHY_UBOOT_BASE
- #define CONFIG_SYS_PHY_UBOOT_BASE	CONFIG_SYS_UBOOT_BASE
-@@ -37,6 +38,11 @@
- 	.globl reset
- 
- reset:
-+	/* Allow the board to save important registers */
-+	b	save_boot_params
-+.globl	save_boot_params_ret
-+save_boot_params_ret:
-+
- 	/*
- 	 * set the cpu to SVC32 mode
- 	 */
-@@ -110,3 +116,7 @@ mmu_disable_phys:
- c_runtime_cpu_setup:
- 
- 	mov	pc, lr
-+
-+WEAK(save_boot_params)
-+	b	save_boot_params_ret	/* back to my caller */
-+ENDPROC(save_boot_params)
--- 
-2.1.4
-
diff --git a/import-layers/meta-raspberrypi/recipes-bsp/u-boot/files/0002-rpi-passthrough-of-the-firmware-provided-FDT-blob.patch b/import-layers/meta-raspberrypi/recipes-bsp/u-boot/files/0002-rpi-passthrough-of-the-firmware-provided-FDT-blob.patch
deleted file mode 100644
index 323b7ab..0000000
--- a/import-layers/meta-raspberrypi/recipes-bsp/u-boot/files/0002-rpi-passthrough-of-the-firmware-provided-FDT-blob.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-From ade243a211d62327e9ebadce27bbbff7981e37f0 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?C=C3=A9dric=20Schieli?= <cschieli@gmail.com>
-Date: Fri, 11 Nov 2016 11:59:07 +0100
-Subject: [PATCH] rpi: passthrough of the firmware provided FDT blob
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Raspberry firmware used to pass a FDT blob at a fixed address (0x100),
-but this is not true anymore. The address now depends on both the
-memory size and the blob size [1].
-
-If one wants to passthrough this FDT blob to the kernel, the most
-reliable way is to save its address from the r2/x0 register in the
-U-Boot entry point and expose it in a environment variable for
-further processing.
-
-This patch just does this:
-- save the provided address in the global variable fw_dtb_pointer
-- expose it in ${fdt_addr} if it points to a a valid FDT blob
-
-There are many different ways to use it. One can, for example, use
-the following script which will extract from the tree the command
-line built by the firmware, then hand over the blob to a previously
-loaded kernel:
-
-fdt addr ${fdt_addr}
-fdt get value bootargs /chosen bootargs
-bootz ${kernel_addr_r} - ${fdt_addr}
-
-Alternatively, users relying on sysboot/pxe can simply omit any FDT
-statement in their extlinux.conf file, U-Boot will automagically pick
-${fdt_addr} and pass it to the kernel.
-
-[1] https://www.raspberrypi.org/forums//viewtopic.php?f=107&t=134018
-
-Upstream-Status: Backport
-
-Signed-off-by: Cédric Schieli <cschieli@gmail.com>
-Acked-by: Stephen Warren <swarren@nvidia.com>
-Signed-off-by: Jonathan Liu <net147@gmail.com>
----
- board/raspberrypi/rpi/Makefile        |  1 +
- board/raspberrypi/rpi/lowlevel_init.S | 36 +++++++++++++++++++++++++++++++++++
- board/raspberrypi/rpi/rpi.c           | 29 ++++++++++++++++++++++++++++
- 3 files changed, 66 insertions(+)
- create mode 100644 board/raspberrypi/rpi/lowlevel_init.S
-
-diff --git a/board/raspberrypi/rpi/Makefile b/board/raspberrypi/rpi/Makefile
-index 4ce2c98..dcb25ac 100644
---- a/board/raspberrypi/rpi/Makefile
-+++ b/board/raspberrypi/rpi/Makefile
-@@ -5,3 +5,4 @@
- #
- 
- obj-y	:= rpi.o
-+obj-y	+= lowlevel_init.o
-diff --git a/board/raspberrypi/rpi/lowlevel_init.S b/board/raspberrypi/rpi/lowlevel_init.S
-new file mode 100644
-index 0000000..cdbd8e1
---- /dev/null
-+++ b/board/raspberrypi/rpi/lowlevel_init.S
-@@ -0,0 +1,36 @@
-+/*
-+ * (C) Copyright 2016
-+ * Cédric Schieli <cschieli@gmail.com>
-+ *
-+ * SPDX-License-Identifier:	GPL-2.0+
-+ */
-+
-+#include <config.h>
-+
-+.align 8
-+.global fw_dtb_pointer
-+fw_dtb_pointer:
-+#ifdef CONFIG_ARM64
-+	.dword 0x0
-+#else
-+	.word 0x0
-+#endif
-+
-+/*
-+ * Routine: save_boot_params (called after reset from start.S)
-+ * Description: save ATAG/FDT address provided by the firmware at boot time
-+ */
-+
-+.global save_boot_params
-+save_boot_params:
-+
-+	/* The firmware provided ATAG/FDT address can be found in r2/x0 */
-+#ifdef CONFIG_ARM64
-+	adr	x8, fw_dtb_pointer
-+	str	x0, [x8]
-+#else
-+	str	r2, fw_dtb_pointer
-+#endif
-+
-+	/* Returns */
-+	b	save_boot_params_ret
-diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
-index 6245b36..ffd6d31 100644
---- a/board/raspberrypi/rpi/rpi.c
-+++ b/board/raspberrypi/rpi/rpi.c
-@@ -25,6 +25,9 @@
- 
- DECLARE_GLOBAL_DATA_PTR;
- 
-+/* From lowlevel_init.S */
-+extern unsigned long fw_dtb_pointer;
-+
- static const struct bcm2835_gpio_platdata gpio_platdata = {
- 	.base = BCM2835_GPIO_BASE,
- };
-@@ -285,6 +288,31 @@ static void set_fdtfile(void)
- 	setenv("fdtfile", fdtfile);
- }
- 
-+/*
-+ * If the firmware provided a valid FDT at boot time, let's expose it in
-+ * ${fdt_addr} so it may be passed unmodified to the kernel.
-+ */
-+static void set_fdt_addr(void)
-+{
-+	if (getenv("fdt_addr"))
-+		return;
-+
-+	if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC)
-+		return;
-+
-+	setenv_hex("fdt_addr", fw_dtb_pointer);
-+}
-+
-+/*
-+ * Prevent relocation from stomping on a firmware provided FDT blob.
-+ */
-+unsigned long board_get_usable_ram_top(unsigned long total_size)
-+{
-+	if ((gd->ram_top - fw_dtb_pointer) > SZ_64M)
-+		return gd->ram_top;
-+	return fw_dtb_pointer & ~0xffff;
-+}
-+
- static void set_usbethaddr(void)
- {
- 	ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_mac_address, msg, 1);
-@@ -356,6 +384,7 @@ static void set_serial_number(void)
- 
- int misc_init_r(void)
- {
-+	set_fdt_addr();
- 	set_fdtfile();
- 	set_usbethaddr();
- #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
--- 
-2.10.2
-
diff --git a/import-layers/meta-raspberrypi/recipes-bsp/u-boot/files/0003-Include-lowlevel_init.o-for-rpi2.patch b/import-layers/meta-raspberrypi/recipes-bsp/u-boot/files/0003-Include-lowlevel_init.o-for-rpi2.patch
deleted file mode 100644
index 1431a2e..0000000
--- a/import-layers/meta-raspberrypi/recipes-bsp/u-boot/files/0003-Include-lowlevel_init.o-for-rpi2.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 1eb01436bc57ad32519a4567a1c9ec82d52d60a1 Mon Sep 17 00:00:00 2001
-From: Paul Barker <paul@paulbarker.me.uk>
-Date: Tue, 29 Nov 2016 19:47:49 +0000
-Subject: [PATCH] Include lowlevel_init.o for rpi2
-
-Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
-Upstream-status: Inappropriate
-    (not needed upstream as rpi_2 board directory is removed in latest
-    version)
----
- board/raspberrypi/rpi_2/Makefile | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/board/raspberrypi/rpi_2/Makefile b/board/raspberrypi/rpi_2/Makefile
-index d82cd21..9f865c5 100644
---- a/board/raspberrypi/rpi_2/Makefile
-+++ b/board/raspberrypi/rpi_2/Makefile
-@@ -5,3 +5,4 @@
- #
-
- obj-y	:= ../rpi/rpi.o
-+obj-y	+= ../rpi/lowlevel_init.o
---
-2.1.4
-
diff --git a/import-layers/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend b/import-layers/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
index a4545f0..3781666 100644
--- a/import-layers/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/import-layers/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -1,7 +1 @@
-FILESEXTRAPATHS_prepend_rpi := "${THISDIR}/files:"
 RDEPENDS_${PN}_append_rpi = " rpi-u-boot-scr"
-SRC_URI_append_rpi = " \
-    file://0001-arm-add-save_boot_params-for-ARM1176.patch \
-    file://0002-rpi-passthrough-of-the-firmware-provided-FDT-blob.patch \
-    file://0003-Include-lowlevel_init.o-for-rpi2.patch \
-    "
diff --git a/import-layers/meta-raspberrypi/recipes-core/psplash/psplash_git.bbappend b/import-layers/meta-raspberrypi/recipes-core/psplash/psplash_git.bbappend
index 65dc30f..698564b 100644
--- a/import-layers/meta-raspberrypi/recipes-core/psplash/psplash_git.bbappend
+++ b/import-layers/meta-raspberrypi/recipes-core/psplash/psplash_git.bbappend
@@ -1,2 +1,4 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SPLASH_IMAGES += "file://psplash-raspberrypi-img.h;outsuffix=raspberrypi"
+SPLASH_IMAGES_append_rpi = " file://psplash-raspberrypi-img.h;outsuffix=raspberrypi"
+ALTERNATIVE_PRIORITY_psplash-raspberrypi[psplash] = "10"
+
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.50.bb b/import-layers/meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.50.bb
deleted file mode 100644
index 9cf6f48..0000000
--- a/import-layers/meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.50.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-DESCRIPTION = "Package that provides access to GPIO and other IO\
-functions on the Broadcom BCM 2835 chip, allowing access to the\
-GPIO pins on the 26 pin IDE plug on the RPi board"
-SECTION = "base"
-HOMEPAGE = "http://www.open.com.au/mikem/bcm2835"
-AUTHOR = "Mike McCauley (mikem@open.com.au)"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-
-COMPATIBLE_MACHINE = "raspberrypi"
-
-SRC_URI = "http://www.airspayce.com/mikem/bcm2835/bcm2835-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "258caf3437012d09a651e1852d0bd60c"
-SRC_URI[sha256sum] = "52180b8a61b6546c1df4aed259d0a4d2fa56e50605e0d4d967a76bf2b23dafb8"
-
-inherit autotools
-
-do_compile_append() {
-    # Now compiling the examples provided by the package
-    mkdir -p ${B}/examples
-    for file in `ls ${S}/examples`; do
-        ${CC} ${LDFLAGS} ${S}/examples/${file}/${file}.c -o ${B}/examples/${file} -Bstatic -L${B}/src -lbcm2835 -I${S}/src
-    done
-}
-
-do_install_append() {
-    install -d ${D}/${libdir}/${BPN}
-    for file in ${B}/examples/*
-    do
-        install -m 0755 ${file} ${D}/${libdir}/${BPN}
-    done
-}
-
-PACKAGES += "${PN}-tests"
-
-FILES_${PN} = ""
-FILES_${PN}-tests = "${libdir}/${BPN}"
-FILES_${PN}-dbg += "${libdir}/${BPN}/.debug"
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.52.bb b/import-layers/meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.52.bb
new file mode 100644
index 0000000..8e41c61
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.52.bb
@@ -0,0 +1,42 @@
+DESCRIPTION = "Package that provides access to GPIO and other IO\
+functions on the Broadcom BCM 2835 chip, allowing access to the\
+GPIO pins on the 26 pin IDE plug on the RPi board"
+SECTION = "base"
+HOMEPAGE = "http://www.open.com.au/mikem/bcm2835"
+AUTHOR = "Mike McCauley (mikem@open.com.au)"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+COMPATIBLE_MACHINE = "raspberrypi"
+
+SRC_URI = "http://www.airspayce.com/mikem/bcm2835/bcm2835-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "b5dc426b4ff258bb1397442f98e40236"
+SRC_URI[sha256sum] = "b9fd10f7a80aadaed28a77168709b7c519568a63b6e98d0a50e9c5fe31bea6bb"
+
+inherit autotools
+
+do_compile_append() {
+    # Now compiling the examples provided by the package
+    mkdir -p ${B}/examples
+    for file in `ls ${S}/examples`; do
+        ${CC} ${LDFLAGS} ${S}/examples/${file}/${file}.c -o ${B}/examples/${file} -Bstatic -L${B}/src -lbcm2835 -I${S}/src
+    done
+}
+
+do_install_append() {
+    install -d ${D}/${libdir}/${BPN}
+    for file in ${B}/examples/*
+    do
+        install -m 0755 ${file} ${D}/${libdir}/${BPN}
+    done
+}
+
+PACKAGES += "${PN}-tests"
+
+RDEPENDS_${PN}-dev = ""
+
+FILES_${PN} = ""
+FILES_${PN}-tests = "${libdir}/${BPN}"
+FILES_${PN}-dbg += "${libdir}/${BPN}/.debug"
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/files/remove-initscript-lsb-dependency.patch b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/files/remove-initscript-lsb-dependency.patch
index 7ea9a3b..c8afe60 100644
--- a/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/files/remove-initscript-lsb-dependency.patch
+++ b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/files/remove-initscript-lsb-dependency.patch
@@ -1,13 +1,28 @@
-Remove dependencies on LSB functions
+From 1338f98a279616f4e5e9ea30a25d1dfa0c7df5d6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= <petter@technux.se>
+Date: Sun, 4 Jun 2017 12:22:40 +0200
+Subject: [PATCH] Remove dependencies on LSB functions
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+See this as a rebase of the previous 'Remove dependencies on LSB
+functions patch' with only minor modifications from the original version,
+based on the work done by Alex Lennon <ajlennon@dynamicdevices.co.uk> in
+'25fd817 pi-blaster: Added recipe'.
 
 Upstream-Status: Inappropriate [configuration]
 
-Signed-off-by: Alex Lennon <ajlennon@dynamicdevices.co.uk>
+Signed-off-by: Petter Mabäcker <petter@technux.se>
+---
+ debian/pi-blaster.init | 38 +++++++-------------------------------
+ 1 file changed, 7 insertions(+), 31 deletions(-)
 
-diff -ur git.org/pi-blaster.boot.sh git/pi-blaster.boot.sh
---- git.org/pi-blaster.boot.sh	2014-05-20 14:49:44.378582168 +0100
-+++ git/pi-blaster.boot.sh	2014-05-20 14:51:08.330582386 +0100
-@@ -28,12 +28,12 @@
+diff --git a/debian/pi-blaster.init b/debian/pi-blaster.init
+index b142d70..01a686c 100644
+--- a/debian/pi-blaster.init
++++ b/debian/pi-blaster.init
+@@ -28,12 +28,12 @@ SCRIPTNAME=/etc/init.d/$NAME
  [ -r /etc/default/$NAME ] && . /etc/default/$NAME
  
  # Load the VERBOSE setting and other rcS variables
@@ -22,7 +37,7 @@
  
  #
  # Function that starts the daemon/service
-@@ -77,48 +77,23 @@
+@@ -77,48 +77,24 @@ do_stop()
  
  case "$1" in
    start)
@@ -52,6 +67,7 @@
  	# 'force-reload' alias
  	#
 -	log_daemon_msg "Restarting $DESC" "$NAME"
++	echo "Restarting $DESC" "$NAME"
  	do_stop
 -	case "$?" in
 -	  0|1)
@@ -67,11 +83,14 @@
 -		log_end_msg 1
 -		;;
 -	esac
-+	do_start
++    do_start
  	;;
    *)
 -	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
-+	echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
++	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
  	exit 3
  	;;
  esac
+-- 
+1.9.1
+
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster.inc b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster.inc
index a3beccc..a548957 100644
--- a/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster.inc
+++ b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster.inc
@@ -2,7 +2,7 @@
 HOMEPAGE = "https://github.com/sarfata/pi-blaster/"
 SECTION = "devel/libs"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://README.md;beginline=157;endline=170;md5=f20832f31126609af5a7bf2340014540"
+LIC_FILES_CHKSUM = "file://README.md;beginline=212;endline=239;md5=a012868ef5f83b9f257af253d7cb07a3"
 
 SRC_URI = "git://github.com/sarfata/pi-blaster \
            file://remove-initscript-lsb-dependency.patch \
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster_git.bb b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster_git.bb
index 263852b..ac812ab 100644
--- a/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster_git.bb
+++ b/import-layers/meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster_git.bb
@@ -1,3 +1,3 @@
 require pi-blaster.inc
 
-SRCREV = "ec5e1b4c6191d8f9a538497dbbb86f9cf0de7016"
+SRCREV = "9f45eb23a8a3b2d1c08d08a6d68f206fe91ecf4c"
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.1.bb b/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.1.bb
deleted file mode 100644
index 89f601b..0000000
--- a/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.1.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-DESCRIPTION = "A module to control Raspberry Pi GPIO channels"
-HOMEPAGE = "http://code.google.com/p/raspberry-gpio-python/"
-SECTION = "devel/python"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=9b95630a648966b142f1a0dcea001cb7"
-
-SRCNAME = "RPi.GPIO"
-
-SRC_URI = "\
-          http://pypi.python.org/packages/source/R/RPi.GPIO/${SRCNAME}-${PV}.tar.gz \
-          file://0001-Remove-nested-functions.patch \
-          "
-SRC_URI[md5sum] = "254d0443a436eb241367c487274e7197"
-SRC_URI[sha256sum] = "54e5fb06d9ea1a1389a497fb5a06dfa950c86303b0f4ba89b68c55999d1df064"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit distutils
-
-COMPATIBLE_MACHINE = "raspberrypi"
-
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.2.bb b/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.2.bb
new file mode 100644
index 0000000..a08ea98
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.2.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "A module to control Raspberry Pi GPIO channels"
+HOMEPAGE = "http://code.google.com/p/raspberry-gpio-python/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=9b95630a648966b142f1a0dcea001cb7"
+
+SRCNAME = "RPi.GPIO"
+
+SRC_URI = "\
+          http://pypi.python.org/packages/source/R/RPi.GPIO/${SRCNAME}-${PV}.tar.gz \
+          file://0001-Remove-nested-functions.patch \
+          "
+SRC_URI[md5sum] = "9db86fd5f3bae872de9dbb068ee0b096"
+SRC_URI[sha256sum] = "82acff0ef6bbe3cdf6f4dbdd73d96add5294bb94baf7f51c1d901861af3c2392"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+COMPATIBLE_MACHINE = "raspberrypi"
+
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/python/rpio_0.10.0.bb b/import-layers/meta-raspberrypi/recipes-devtools/python/rpio_0.10.0.bb
index 69ecb6f..1a6cee7 100644
--- a/import-layers/meta-raspberrypi/recipes-devtools/python/rpio_0.10.0.bb
+++ b/import-layers/meta-raspberrypi/recipes-devtools/python/rpio_0.10.0.bb
@@ -16,5 +16,10 @@
 
 COMPATIBLE_MACHINE = "raspberrypi"
 
+RDEPENDS_${PN} = "\
+    python-logging \
+    python-threading \
+"
+
 SRC_URI[md5sum] = "cefc45422833dcafcd59b78dffc540f4"
 SRC_URI[sha256sum] = "b89f75dec9de354681209ebfaedfe22b7c178aacd91a604a7bd6d92024e4cf7e"
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch
index 603422c..01e0546 100644
--- a/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch
+++ b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch
@@ -1,21 +1,21 @@
-From 6d85e6cc3ab97c3f060e5e0a8e3f1945a14c86ba Mon Sep 17 00:00:00 2001
-From: Gianfranco Costamagna <gianfranco.costamagna@abinsula.com>
-Date: Mon, 12 Oct 2015 12:15:51 +0200
-Subject: [PATCH] Add initial cross compile support (rebase from Petter Mabäcker <petter@technux.se> version)
+From ca25788e2563bad0d554deb9f4300d1e7d062825 Mon Sep 17 00:00:00 2001
+From: Aurelian Zanoschi <aurelian17@gmail.com>
+Date: Mon, 31 Jul 2017 20:25:15 +0300
+Subject: [PATCH] Add initial cross compile support
 
 ---
- devLib/Makefile             |   54 ++++++++++++++++++++++++-------------------
- examples/Gertboard/Makefile |   22 +++++++++++-------
- examples/Makefile           |   22 +++++++++++-------
- examples/PiFace/Makefile    |   22 +++++++++++-------
- examples/PiGlow/Makefile    |    4 ++--
- examples/q2w/Makefile       |    4 ++--
- gpio/Makefile               |   29 ++++++++++++-----------
- wiringPi/Makefile           |   50 +++++++++++++++++++++------------------
- 8 files changed, 119 insertions(+), 88 deletions(-)
+ devLib/Makefile             | 54 +++++++++++++++++++++++++--------------------
+ examples/Gertboard/Makefile | 22 +++++++++++-------
+ examples/Makefile           | 22 +++++++++++-------
+ examples/PiFace/Makefile    | 22 +++++++++++-------
+ examples/PiGlow/Makefile    |  4 ++--
+ examples/q2w/Makefile       |  4 ++--
+ gpio/Makefile               | 29 ++++++++++++------------
+ wiringPi/Makefile           | 52 ++++++++++++++++++++++++-------------------
+ 8 files changed, 120 insertions(+), 89 deletions(-)
 
 diff --git a/devLib/Makefile b/devLib/Makefile
-index 0fb0033..cbea759 100644
+index cf665d6..040c03a 100644
 --- a/devLib/Makefile
 +++ b/devLib/Makefile
 @@ -31,15 +31,19 @@ ifneq ($V,1)
@@ -46,7 +46,7 @@
  
  LIBS    =
  
-@@ -66,16 +70,16 @@ $(STATIC):	$(OBJ)
+@@ -68,16 +72,16 @@ $(STATIC):	$(OBJ)
  
  $(DYNAMIC):	$(OBJ)
  	$Q echo "[Link (Dynamic)]"
@@ -66,7 +66,7 @@
  
  .PHONY:	tags
  tags:	$(SRC)
-@@ -86,22 +90,22 @@ tags:	$(SRC)
+@@ -88,22 +92,22 @@ tags:	$(SRC)
  .PHONY:	install
  install:	$(DYNAMIC)
  	$Q echo "[Install Headers]"
@@ -99,7 +99,7 @@
  
  .PHONY:	install-deb
  install-deb:	$(DYNAMIC)
-@@ -116,9 +120,11 @@ install-deb:	$(DYNAMIC)
+@@ -118,9 +122,11 @@ install-deb:	$(DYNAMIC)
  .PHONY:	uninstall
  uninstall:
  	$Q echo "[UnInstall]"
@@ -148,7 +148,7 @@
  # Should not alter anything below this line
  ###############################################################################
 diff --git a/examples/Makefile b/examples/Makefile
-index e6b9b71..931b167 100644
+index 6d87885..8623816 100644
 --- a/examples/Makefile
 +++ b/examples/Makefile
 @@ -26,14 +26,20 @@ ifneq ($V,1)
@@ -162,7 +162,7 @@
 -CFLAGS	= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
 -
 -LDFLAGS	= -L/usr/local/lib
--LDLIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
+-LDLIBS    = -lwiringPi -lwiringPiDev -lpthread -lm -lcrypt -lrt
 +DESTDIR?=/usr
 +PREFIX?=/local
 +
@@ -176,12 +176,12 @@
 +CFLAGS	?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
 +
 +LDFLAGS	?= -L$(LIB_DIR)
-+LDLIBS    ?= -lwiringPi -lwiringPiDev -lpthread -lm
++LDLIBS    ?= -lwiringPi -lwiringPiDev -lpthread -lm -lcrypt -lrt
  
  # Should not alter anything below this line
  ###############################################################################
 diff --git a/examples/PiFace/Makefile b/examples/PiFace/Makefile
-index 4685adc..cfaf902 100644
+index f937c14..ad030b3 100644
 --- a/examples/PiFace/Makefile
 +++ b/examples/PiFace/Makefile
 @@ -26,14 +26,20 @@ ifneq ($V,1)
@@ -214,7 +214,7 @@
  # Should not alter anything below this line
  ###############################################################################
 diff --git a/examples/PiGlow/Makefile b/examples/PiGlow/Makefile
-index acd4818..dabd64e 100644
+index f182db7..d1ea74f 100644
 --- a/examples/PiGlow/Makefile
 +++ b/examples/PiGlow/Makefile
 @@ -29,10 +29,10 @@ endif
@@ -231,7 +231,7 @@
  
  # Should not alter anything below this line
 diff --git a/examples/q2w/Makefile b/examples/q2w/Makefile
-index 6f50fa0..c5e9f6e 100644
+index 8f773bf..14aa6e4 100644
 --- a/examples/q2w/Makefile
 +++ b/examples/q2w/Makefile
 @@ -29,10 +29,10 @@ endif
@@ -248,7 +248,7 @@
  
  ###############################################################################
 diff --git a/gpio/Makefile b/gpio/Makefile
-index 7dcd090..83ec454 100644
+index f41a005..22753ee 100644
 --- a/gpio/Makefile
 +++ b/gpio/Makefile
 @@ -30,13 +30,17 @@ ifneq ($V,1)
@@ -259,7 +259,7 @@
 -DEBUG	= -O2
 -CC	= gcc
 -INCLUDE	= -I$(DESTDIR)$(PREFIX)/include
--CFLAGS	= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
+-CFLAGS	= $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe
 +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include
 +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib
 +BIN_DIR?=$(DESTDIR)$(PREFIX)/bin
@@ -269,10 +269,10 @@
 +DEBUG	?= -O2
 +CC	?= gcc
 +INCLUDE	?= -I$(INCLUDE_DIR)
-+CFLAGS	?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
++CFLAGS	?= $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe
 +
 +LDFLAGS	?= -L$(LIB_DIR)
- LIBS    = -lwiringPi -lwiringPiDev -lpthread
+ LIBS    = -lwiringPi -lwiringPiDev -lpthread -lrt -lm -lcrypt
  
  # May not need to  alter anything below this line
 @@ -72,13 +76,10 @@ tags:	$(SRC)
@@ -293,7 +293,7 @@
  
  .PHONY:	install-deb
  install-deb:	gpio
-@@ -89,7 +90,7 @@ install-deb:	gpio
+@@ -91,7 +92,7 @@ install-deb:	gpio
  .PHONY:	uninstall
  uninstall:
  	$Q echo "[UnInstall]"
@@ -303,10 +303,10 @@
  
  .PHONY:	depend
 diff --git a/wiringPi/Makefile b/wiringPi/Makefile
-index 6bbcc5d..5355b74 100644
+index e1868b9..750d290 100644
 --- a/wiringPi/Makefile
 +++ b/wiringPi/Makefile
-@@ -25,19 +25,23 @@ VERSION=$(shell cat ../VERSION)
+@@ -25,21 +25,25 @@ VERSION=$(shell cat ../VERSION)
  DESTDIR?=/usr
  PREFIX?=/local
  
@@ -334,19 +334,22 @@
 +CC	?= gcc
 +INCLUDE	?= -I.
  DEFS	= -D_GNU_SOURCE
- CFLAGS	= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
+-CFLAGS	= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Wextra -Winline $(INCLUDE) -pipe -fPIC
++CFLAGS	= $(DEBUG) $(DEFS) $(INCLUDE) -Wformat=2 -Wall -Wextra -Winline -pipe -fPIC
  
-@@ -89,17 +93,17 @@ $(STATIC):	$(OBJ)
+ LIBS    = -lm -lpthread -lrt -lcrypt
+ 
+@@ -78,17 +82,17 @@ $(STATIC):	$(OBJ)
  
  $(DYNAMIC):	$(OBJ)
  	$Q echo "[Link (Dynamic)]"
--	$Q $(CC) -shared -Wl,-soname,libwiringPi.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPi.so.$(VERSION) -lpthread $(OBJ)
-+	$Q $(CC) $(LDFLAGS) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ)
+-	$Q $(CC) -shared -Wl,-soname,libwiringPi.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPi.so.$(VERSION) $(LIBS) $(OBJ)
++	$Q $(CC) $(LDFLAGS) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so $(OBJ) $(LIBS)
  
  .c.o:
  	$Q echo [Compile] $<
 -	$Q $(CC) -c $(CFLAGS) $< -o $@
-+	$Q $(CC) -c $(CFLAGS) -fPIC $< -o $@
++	$Q $(CC) $(CFLAGS) $(LIBS) -c $< -o $@
  
  
  .PHONY:	clean
@@ -357,7 +360,7 @@
  
  .PHONY:	tags
  tags:	$(SRC)
-@@ -110,22 +114,22 @@ tags:	$(SRC)
+@@ -99,22 +103,22 @@ tags:	$(SRC)
  .PHONY:	install
  install:	$(DYNAMIC)
  	$Q echo "[Install Headers]"
@@ -390,7 +393,7 @@
  
  .PHONY:	install-deb
  install-deb:	$(DYNAMIC)
-@@ -140,9 +144,11 @@ install-deb:	$(DYNAMIC)
+@@ -129,9 +133,11 @@ install-deb:	$(DYNAMIC)
  .PHONY:	uninstall
  uninstall:
  	$Q echo "[UnInstall]"
@@ -406,5 +409,5 @@
  
  .PHONY:	depend
 -- 
-2.1.4
+2.7.4
 
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi/0001-include-asm-ioctl.h-directly-for-_IOC_SIZEBITS.patch b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi/0001-include-asm-ioctl.h-directly-for-_IOC_SIZEBITS.patch
deleted file mode 100644
index 5de5853..0000000
--- a/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi/0001-include-asm-ioctl.h-directly-for-_IOC_SIZEBITS.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 7f65eb37a82a6d9b095d9c8f262ad9dd205acd03 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 30 Jan 2016 16:57:38 -0800
-Subject: [PATCH] include <asm/ioctl.h> directly for _IOC_SIZEBITS
-
-Fixes errors like
-| wiringPiSPI.c: In function 'wiringPiSPIDataRW':
-| wiringPiSPI.c:89:35: error: '_IOC_SIZEBITS' undeclared (first use in
-this function)
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Submitted
-
- wiringPi/wiringPi.c    | 1 +
- wiringPi/wiringPiI2C.c | 1 +
- wiringPi/wiringPiSPI.c | 1 +
- 3 files changed, 3 insertions(+)
-
-diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c
-index 32e5100..cb5db9d 100644
---- a/wiringPi/wiringPi.c
-+++ b/wiringPi/wiringPi.c
-@@ -64,6 +64,7 @@
- #include <time.h>
- #include <fcntl.h>
- #include <pthread.h>
-+#include <asm/ioctl.h>
- #include <sys/time.h>
- #include <sys/mman.h>
- #include <sys/stat.h>
-diff --git a/wiringPi/wiringPiI2C.c b/wiringPi/wiringPiI2C.c
-index c787bce..efdf53c 100644
---- a/wiringPi/wiringPiI2C.c
-+++ b/wiringPi/wiringPiI2C.c
-@@ -52,6 +52,7 @@
- #include <string.h>
- #include <fcntl.h>
- #include <sys/ioctl.h>
-+#include <asm/ioctl.h>
- 
- #include "wiringPi.h"
- #include "wiringPiI2C.h"
-diff --git a/wiringPi/wiringPiSPI.c b/wiringPi/wiringPiSPI.c
-index 453df31..ae3c7d9 100644
---- a/wiringPi/wiringPiSPI.c
-+++ b/wiringPi/wiringPiSPI.c
-@@ -27,6 +27,7 @@
- #include <fcntl.h>
- #include <errno.h>
- #include <string.h>
-+#include <asm/ioctl.h>
- #include <sys/ioctl.h>
- #include <linux/spi/spidev.h>
- 
--- 
-2.7.0
-
diff --git a/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi_git.bb b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi_git.bb
index c337b19..7953a55 100644
--- a/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi_git.bb
+++ b/import-layers/meta-raspberrypi/recipes-devtools/wiringPi/wiringpi_git.bb
@@ -4,14 +4,13 @@
 LICENSE = "LGPLv3+"
 LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02"
 
-# tag 2.32
-SRCREV = "b0a60c3302973ca1878d149d61f2f612c8f27fac"
+# tag 2.44
+SRCREV = "96344ff7125182989f98d3be8d111952a8f74e15"
 
 S = "${WORKDIR}/git"
 
 SRC_URI = "git://git.drogon.net/wiringPi \
            file://0001-Add-initial-cross-compile-support.patch \
-           file://0001-include-asm-ioctl.h-directly-for-_IOC_SIZEBITS.patch \
            "
 
 COMPATIBLE_MACHINE = "raspberrypi"
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend b/import-layers/meta-raspberrypi/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
index 7f8b600..7692133 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
+++ b/import-layers/meta-raspberrypi/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
@@ -1 +1,2 @@
 EGLINFO_DEVICE_rpi  = "raspberrypi"
+COMPATIBLE_HOST_rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', 'null', '"(.*)"', d)}"
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_%.bbappend b/import-layers/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_%.bbappend
new file mode 100644
index 0000000..7897125
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_%.bbappend
@@ -0,0 +1 @@
+PACKAGECONFIG_append_rpi = " gbm"
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0001-Allow-applications-to-set-next-resource-handle.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0001-Allow-applications-to-set-next-resource-handle.patch
index 4f72845..5861c4e 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0001-Allow-applications-to-set-next-resource-handle.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0001-Allow-applications-to-set-next-resource-handle.patch
@@ -1,7 +1,7 @@
-From 4b68419e58ef31e72abab688d0c7cc5db80efc13 Mon Sep 17 00:00:00 2001
+From e45bc677368d0f8d42720aad242f33f6e2687fb1 Mon Sep 17 00:00:00 2001
 From: Dom Cobley <dc4@broadcom.com>
 Date: Tue, 9 Jul 2013 09:26:26 -0400
-Subject: [PATCH 01/12] Allow applications to set next resource handle
+Subject: [PATCH 01/15] Allow applications to set next resource handle
 
 This patch adds provisions in userland to
 let apps callers set the next rendereing dispmanx resource.
@@ -204,5 +204,5 @@
  
  FN(void, eglIntGetColorData_impl, (EGL_SURFACE_ID_T s, KHRN_IMAGE_FORMAT_T format, uint32_t width, uint32_t height, int32_t stride, uint32_t y_offset, void *data))
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0002-wayland-Add-support-for-the-Wayland-winsys.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0002-wayland-Add-support-for-the-Wayland-winsys.patch
index 6cc8ea8..d6e6476 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0002-wayland-Add-support-for-the-Wayland-winsys.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0002-wayland-Add-support-for-the-Wayland-winsys.patch
@@ -1,7 +1,7 @@
-From e3d2d0007e1c6c32ab7d9a28f1e399d42b511333 Mon Sep 17 00:00:00 2001
+From 15fb270f438f4ef1413192b5ce1e0dc784b45d9e Mon Sep 17 00:00:00 2001
 From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
 Date: Tue, 1 Oct 2013 13:19:20 +0200
-Subject: [PATCH 02/12] wayland: Add support for the Wayland winsys
+Subject: [PATCH 02/15] wayland: Add support for the Wayland winsys
 
 * Adds EGL_WL_bind_wayland_display extension
 * Adds wayland-egl library
@@ -17,7 +17,7 @@
 private header that can be included from EGL and vc_* instead of in
 vc_vchi_dispmanx.h
 ---
- .gitignore                                         |   2 +
+ .gitignore                                         |   1 +
  CMakeLists.txt                                     |  11 +
  README.md                                          |   4 +
  buildme                                            |  10 +-
@@ -47,7 +47,7 @@
  interface/vmcs_host/vc_vchi_dispmanx.h             |  15 ++
  interface/wayland/dispmanx.xml                     | 123 +++++++++++
  makefiles/cmake/Wayland.cmake                      |  72 ++++++
- 30 files changed, 1258 insertions(+), 98 deletions(-)
+ 30 files changed, 1257 insertions(+), 98 deletions(-)
  create mode 100644 interface/khronos/common/linux/khrn_wayland.c
  copy interface/{vmcs_host/vc_vchi_dispmanx.h => khronos/common/linux/khrn_wayland.h} (56%)
  create mode 100644 interface/khronos/ext/egl_wayland.c
@@ -58,17 +58,16 @@
  create mode 100644 makefiles/cmake/Wayland.cmake
 
 diff --git a/.gitignore b/.gitignore
-index 4a88665..5da71a9 100644
+index 63570f1..1459436 100644
 --- a/.gitignore
 +++ b/.gitignore
-@@ -13,3 +13,5 @@ build/
- *.lai
- *.la
- *.a
-+
+@@ -30,3 +30,4 @@ build/
+ *.pts
+ *.ppm
+ *.mkv
 +*~
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 98252c3..d6ae907 100644
+index cfc8ae5..673a5ad 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -24,6 +24,17 @@ include(makefiles/cmake/global_settings.cmake)
@@ -102,7 +101,7 @@
 +
 +$ BUILD_WAYLAND=1 ./buildme.
 diff --git a/buildme b/buildme
-index 1061745..d0e6e54 100755
+index b8fd440..a780bb6 100755
 --- a/buildme
 +++ b/buildme
 @@ -8,6 +8,10 @@ fi
@@ -117,7 +116,7 @@
  	# Native compile on the Raspberry Pi
  	mkdir -p build/raspberry/$BUILDSUBDIR
 @@ -32,9 +36,13 @@ elif [ "$1" = "--native" ]; then
- 	make -j 6 $*
+ 	make -j `nproc` $*
  else
  	# Cross compile on a more capable machine
 +	if [ -n "$BUILD_WAYLAND" ]; then
@@ -128,7 +127,7 @@
  	pushd build/arm-linux/$BUILDSUBDIR
 -	cmake -DCMAKE_TOOLCHAIN_FILE=../../../makefiles/cmake/toolchains/arm-linux-gnueabihf.cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE ../../..
 +	cmake -DCMAKE_TOOLCHAIN_FILE=../../../makefiles/cmake/toolchains/arm-linux-gnueabihf.cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE $WAYLAND_VARS ../../..
- 	make -j 6
+ 	make -j `nproc`
  
  	if [ "$1" != "" ]; then
 diff --git a/host_applications/linux/apps/raspicam/CMakeLists.txt b/host_applications/linux/apps/raspicam/CMakeLists.txt
@@ -808,16 +807,16 @@
  /*
  TODO: do an RPC call to make sure the Khronos vll is loaded (and that it stays loaded until eglTerminate)
  Also affects global image (and possibly others?)
-@@ -451,6 +444,9 @@ EGLAPI const char EGLAPIENTRY * eglQueryString(EGLDisplay dpy, EGLint name)
+@@ -450,6 +443,9 @@ EGLAPI const char EGLAPIENTRY * eglQueryString(EGLDisplay dpy, EGLint name)
+ #ifdef EGL_KHR_fence_sync
              "EGL_KHR_fence_sync "
  #endif
- #endif
++#endif
 +#if EGL_WL_bind_wayland_display
 +            "EGL_WL_bind_wayland_display "
-+#endif
+ #endif
              ;
           break;
-       case EGL_VENDOR:
 @@ -655,8 +651,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig c
                                  false,
                                  EGL_NO_TEXTURE,
@@ -1542,7 +1541,7 @@
 +Libs: -L${libdir} -lwayland-egl
 +Cflags: -I${includedir}
 diff --git a/interface/vmcs_host/CMakeLists.txt b/interface/vmcs_host/CMakeLists.txt
-index 0b3adc9..f44d01f 100755
+index fde18da..6718215 100755
 --- a/interface/vmcs_host/CMakeLists.txt
 +++ b/interface/vmcs_host/CMakeLists.txt
 @@ -9,13 +9,24 @@ add_definitions(-fno-strict-aliasing)
@@ -1551,12 +1550,12 @@
  
 -add_library(vchostif
 -            ${VMCS_TARGET}/vcfilesys.c ${VMCS_TARGET}/vcmisc.c
--            vc_vchi_gencmd.c vc_vchi_filesys.c
+-            vc_vchi_gencmd.c vc_vchi_filesys.c vc_vchi_gpuserv.c
 -            vc_vchi_tvservice.c vc_vchi_cecservice.c
 -            vc_vchi_dispmanx.c vc_service_common.c)
 +set(VCHOSTIF_SOURCE
 +    ${VMCS_TARGET}/vcfilesys.c ${VMCS_TARGET}/vcmisc.c
-+    vc_vchi_gencmd.c vc_vchi_filesys.c
++    vc_vchi_gencmd.c vc_vchi_filesys.c vc_vchi_gpuserv.c
 +    vc_vchi_tvservice.c vc_vchi_cecservice.c
 +    vc_vchi_dispmanx.c vc_service_common.c)
  #            ${VMCS_TARGET}/vmcs_main.c
@@ -1604,7 +1603,7 @@
  }
  #endif
 diff --git a/interface/vmcs_host/vc_vchi_dispmanx.c b/interface/vmcs_host/vc_vchi_dispmanx.c
-index 133e86d..45f4cff 100755
+index 7a6cdcd..eab146e 100755
 --- a/interface/vmcs_host/vc_vchi_dispmanx.c
 +++ b/interface/vmcs_host/vc_vchi_dispmanx.c
 @@ -1319,3 +1319,45 @@ static void *dispmanx_notify_func( void *arg ) {
@@ -1885,5 +1884,5 @@
 +    set(${_sources} ${${_sources}} PARENT_SCOPE)
 +endfunction()
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0003-wayland-Add-Wayland-example.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0003-wayland-Add-Wayland-example.patch
index bbd9727..1d78755 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0003-wayland-Add-Wayland-example.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0003-wayland-Add-Wayland-example.patch
Binary files differ
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0004-wayland-egl-Add-bcm_host-to-dependencies.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0004-wayland-egl-Add-bcm_host-to-dependencies.patch
index 752b61a..d60c432 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0004-wayland-egl-Add-bcm_host-to-dependencies.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0004-wayland-egl-Add-bcm_host-to-dependencies.patch
@@ -1,7 +1,7 @@
-From 718402e1be80ff9fb9863e847e31072ec735a5eb Mon Sep 17 00:00:00 2001
+From cae4ff834eef23c8f23126ba4d630db395f13aee Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Mon, 10 Aug 2015 02:38:27 -0700
-Subject: [PATCH 04/12] wayland-egl: Add bcm_host to dependencies
+Subject: [PATCH 04/15] wayland-egl: Add bcm_host to dependencies
 
 It uses headers like vcos_platform_types.h but does not
 depend on module which should add the required include paths
@@ -24,5 +24,5 @@
  Libs: -L${libdir} -lwayland-egl
  Cflags: -I${includedir}
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0005-interface-remove-faulty-assert-to-make-weston-happy-.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0005-interface-remove-faulty-assert-to-make-weston-happy-.patch
index 05b0dfa..676f34c 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0005-interface-remove-faulty-assert-to-make-weston-happy-.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0005-interface-remove-faulty-assert-to-make-weston-happy-.patch
@@ -1,7 +1,7 @@
-From 2a6e3d53a75fe44ec6fa3ae64c8ca5664b614979 Mon Sep 17 00:00:00 2001
+From 8ee4f6eedb81e9bfe0e603a21606c52f9501e609 Mon Sep 17 00:00:00 2001
 From: "Yann E. MORIN" <yann.morin.1998@free.fr>
 Date: Sat, 24 Jan 2015 22:07:19 +0100
-Subject: [PATCH 05/12] interface: remove faulty assert() to make weston happy
+Subject: [PATCH 05/15] interface: remove faulty assert() to make weston happy
  at runtime
 
 This was removed after a discussion on IRC with the weston guys
@@ -13,7 +13,7 @@
  1 file changed, 1 deletion(-)
 
 diff --git a/interface/vmcs_host/vc_vchi_dispmanx.c b/interface/vmcs_host/vc_vchi_dispmanx.c
-index 45f4cff..5d0368c 100755
+index eab146e..29e0dee 100755
 --- a/interface/vmcs_host/vc_vchi_dispmanx.c
 +++ b/interface/vmcs_host/vc_vchi_dispmanx.c
 @@ -1306,7 +1306,6 @@ static void *dispmanx_notify_func( void *arg ) {
@@ -25,5 +25,5 @@
              }
           } else {
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0006-zero-out-wl-buffers-in-egl_surface_free.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0006-zero-out-wl-buffers-in-egl_surface_free.patch
index f4da1c1..a8f1f24 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0006-zero-out-wl-buffers-in-egl_surface_free.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0006-zero-out-wl-buffers-in-egl_surface_free.patch
@@ -1,7 +1,7 @@
-From a3d43c1b754fc0576b428d36a877b9b50dd5d1ce Mon Sep 17 00:00:00 2001
+From 789b0b0c04b741c21dd573b78eded970721d14c2 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 6 Feb 2016 11:10:47 -0800
-Subject: [PATCH 06/12] zero-out wl buffers in egl_surface_free
+Subject: [PATCH 06/15] zero-out wl buffers in egl_surface_free
 
 origins from buildroot
 
@@ -29,5 +29,5 @@
  #endif
     }
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0007-initialize-front-back-wayland-buffers.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0007-initialize-front-back-wayland-buffers.patch
index 47f633a..ad2636a 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0007-initialize-front-back-wayland-buffers.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0007-initialize-front-back-wayland-buffers.patch
@@ -1,7 +1,7 @@
-From 5b37f53cff07f37b281c25f987b9dbdacc264bf6 Mon Sep 17 00:00:00 2001
+From 762dd3156775f167ff0dfd44322dbb19a85822a7 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 6 Feb 2016 11:11:41 -0800
-Subject: [PATCH 07/12] initialize front back wayland buffers
+Subject: [PATCH 07/15] initialize front back wayland buffers
 
 origins from metrological wayland support
 
@@ -30,5 +30,5 @@
     }
  #endif
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0008-Remove-RPC_FLUSH.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0008-Remove-RPC_FLUSH.patch
index 7491842..1e66813 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0008-Remove-RPC_FLUSH.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0008-Remove-RPC_FLUSH.patch
@@ -1,7 +1,7 @@
-From 14a749a3f840e93db548373b907a7a0e664dcfdb Mon Sep 17 00:00:00 2001
+From f8929adbf95ad3d44491cf6fc8a84a686b71193e Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 6 Feb 2016 11:09:18 -0800
-Subject: [PATCH 08/12] Remove RPC_FLUSH
+Subject: [PATCH 08/15] Remove RPC_FLUSH
 
 Origins from buildroot
 
@@ -23,5 +23,5 @@
        }
  #endif
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0009-fix-cmake-dependency-race.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0009-fix-cmake-dependency-race.patch
index 3f57d1e..214d5e2 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0009-fix-cmake-dependency-race.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0009-fix-cmake-dependency-race.patch
@@ -1,7 +1,7 @@
-From b5392c39d7407a5226c9314bc01ed82877ff0539 Mon Sep 17 00:00:00 2001
+From f53e028f33f261f85883c9168977dd5486e9b47c Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 6 Feb 2016 13:12:47 -0800
-Subject: [PATCH 09/12] fix cmake dependency race
+Subject: [PATCH 09/15] fix cmake dependency race
 
 Fixes errors like
 
@@ -42,7 +42,7 @@
     add_library (vcos SHARED ${SOURCES})
     target_link_libraries (vcos pthread dl rt)
 diff --git a/interface/vmcs_host/CMakeLists.txt b/interface/vmcs_host/CMakeLists.txt
-index f44d01f..9bcc2c3 100755
+index 6718215..c415176 100755
 --- a/interface/vmcs_host/CMakeLists.txt
 +++ b/interface/vmcs_host/CMakeLists.txt
 @@ -17,14 +17,6 @@ set(VCHOSTIF_SOURCE
@@ -74,5 +74,5 @@
  	struct wl_resource *resource;
  	struct wl_dispmanx *dispmanx;
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0010-Fix-for-framerate-with-nested-composition.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0010-Fix-for-framerate-with-nested-composition.patch
index 8a34f3f..9f77920 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0010-Fix-for-framerate-with-nested-composition.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0010-Fix-for-framerate-with-nested-composition.patch
@@ -1,7 +1,7 @@
-From 098faed5e7035b51f14700fdf4cf5875aa7af97e Mon Sep 17 00:00:00 2001
+From 6559a57c66c5f55571a1aa29cf14d9130a9ef2c9 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Tue, 29 Mar 2016 20:38:30 -0700
-Subject: [PATCH 10/12] Fix for framerate with nested composition
+Subject: [PATCH 10/15] Fix for framerate with nested composition
 
 frame rate appears irregular and lower than expected when using nested composition.
 
@@ -56,5 +56,5 @@
  #ifdef ANDROID
                 CLIENT_UNLOCK();
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0011-build-shared-library-for-vchostif.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0011-build-shared-library-for-vchostif.patch
index f2455e5..5ee5cbd 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0011-build-shared-library-for-vchostif.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0011-build-shared-library-for-vchostif.patch
@@ -1,7 +1,7 @@
-From b533d784484caead1dc84c766127e1d3854d2aad Mon Sep 17 00:00:00 2001
+From 3e396f0b514f3acf90c02f5d55b3816028367a55 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 2 Apr 2016 10:37:24 -0700
-Subject: [PATCH 11/12] build shared library for vchostif
+Subject: [PATCH 11/15] build shared library for vchostif
 
 Fixes #149
 
@@ -11,7 +11,7 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/interface/vmcs_host/CMakeLists.txt b/interface/vmcs_host/CMakeLists.txt
-index 9bcc2c3..0ef753f 100755
+index c415176..d0cca1a 100755
 --- a/interface/vmcs_host/CMakeLists.txt
 +++ b/interface/vmcs_host/CMakeLists.txt
 @@ -17,7 +17,7 @@ set(VCHOSTIF_SOURCE
@@ -24,5 +24,5 @@
  #add_library(bufman            vc_vchi_bufman.c            )
  
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0012-implement-buffer-wrapping-interface-for-dispmanx.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0012-implement-buffer-wrapping-interface-for-dispmanx.patch
index aa3e0ef..48af588 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0012-implement-buffer-wrapping-interface-for-dispmanx.patch
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0012-implement-buffer-wrapping-interface-for-dispmanx.patch
@@ -1,7 +1,7 @@
-From ee5ebfcf0e030efed17f2a45fbb018a02dd421b3 Mon Sep 17 00:00:00 2001
+From f5b2263c8d65e307cb085414e08118cbbe00a94c Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 2 Apr 2016 10:54:59 -0700
-Subject: [PATCH 12/12] implement buffer wrapping interface for dispmanx
+Subject: [PATCH 12/15] implement buffer wrapping interface for dispmanx
 
 Courtesy: Zan Dobersek
 
@@ -88,5 +88,5 @@
  
  </protocol>
 -- 
-2.10.2
+2.15.0
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0013-Implement-triple-buffering-for-wayland.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0013-Implement-triple-buffering-for-wayland.patch
new file mode 100644
index 0000000..d3a9840
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0013-Implement-triple-buffering-for-wayland.patch
@@ -0,0 +1,90 @@
+From 10ba55489002c2ccdf96d221301ec059c4574811 Mon Sep 17 00:00:00 2001
+From: Jeff Wannamaker <jeff_wannamaker@cable.comcast.com>
+Date: Thu, 19 Jan 2017 18:56:07 +0000
+Subject: [PATCH 13/15] Implement triple buffering for wayland
+
+Change from double to triple buffering for wayland.
+This enables higher frame rates without tearing artifacts
+by allowing both the glFinish and the buffer release
+interlock to operate without pushing the frame period
+to two vertical intervals
+
+Signed-off-by: Jeff Wannamaker <jeff_wannamaker@cable.comcast.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ interface/khronos/egl/egl_client.c         |  3 ++-
+ interface/khronos/egl/egl_client_surface.c |  8 ++++++++
+ interface/khronos/egl/egl_client_surface.h | 11 +++++++++++
+ 3 files changed, 21 insertions(+), 1 deletion(-)
+
+diff --git a/interface/khronos/egl/egl_client.c b/interface/khronos/egl/egl_client.c
+index 13a110c..0380274 100644
+--- a/interface/khronos/egl/egl_client.c
++++ b/interface/khronos/egl/egl_client.c
+@@ -2323,7 +2323,8 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
+ 
+                   buffer_temp = surface->front_wl_buffer;
+                   surface->front_wl_buffer = surface->back_wl_buffer;
+-                  surface->back_wl_buffer = buffer_temp;
++                  surface->back_wl_buffer = surface->middle_wl_buffer;
++                  surface->middle_wl_buffer = buffer_temp;
+ 
+                   configid = egl_config_to_id(surface->config);
+                   color = egl_config_get_color_format(configid);
+diff --git a/interface/khronos/egl/egl_client_surface.c b/interface/khronos/egl/egl_client_surface.c
+index 9a9582c..10b3b04 100644
+--- a/interface/khronos/egl/egl_client_surface.c
++++ b/interface/khronos/egl/egl_client_surface.c
+@@ -402,12 +402,14 @@ EGL_SURFACE_T *egl_surface_create(
+    if (type == WINDOW && wl_display) {
+       surface->wl_egl_window = (struct wl_egl_window*)win;
+       surface->front_wl_buffer = NULL;
++      surface->middle_wl_buffer = NULL;
+       surface->back_wl_buffer = allocate_wl_buffer(
+             surface->wl_egl_window, color);
+       resource = surface->back_wl_buffer->resource;
+    } else {
+       surface->wl_egl_window = NULL;
+       surface->front_wl_buffer = NULL;
++      surface->middle_wl_buffer = NULL;
+       surface->back_wl_buffer = NULL;
+       resource = DISPMANX_NO_HANDLE;
+    }
+@@ -696,6 +698,12 @@ void egl_surface_free(EGL_SURFACE_T *surface)
+          surface->back_wl_buffer = 0;
+       }
+ 
++      if (surface->middle_wl_buffer) {
++         wl_buffer_destroy(surface->middle_wl_buffer->wl_buffer);
++         free(surface->middle_wl_buffer);
++         surface->middle_wl_buffer = 0;
++      }
++
+       if (surface->front_wl_buffer) {
+          wl_buffer_destroy(surface->front_wl_buffer->wl_buffer);
+          free(surface->front_wl_buffer);
+diff --git a/interface/khronos/egl/egl_client_surface.h b/interface/khronos/egl/egl_client_surface.h
+index e328b77..58a3184 100644
+--- a/interface/khronos/egl/egl_client_surface.h
++++ b/interface/khronos/egl/egl_client_surface.h
+@@ -312,6 +312,17 @@ typedef struct {
+    */
+    struct wl_dispmanx_client_buffer *front_wl_buffer;
+ 
++   /*
++      middle_wl_buffer
++
++      Validity:
++      type == WINDOW
++
++      Invariant:
++      client-side information about the wl_buffer in the middle
++   */
++   struct wl_dispmanx_client_buffer *middle_wl_buffer;
++
+    /*
+       back_wl_buffer
+ 
+-- 
+2.15.0
+
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0014-GLES2-gl2ext.h-Define-GL_R8_EXT-and-GL_RG8_EXT.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0014-GLES2-gl2ext.h-Define-GL_R8_EXT-and-GL_RG8_EXT.patch
new file mode 100644
index 0000000..b596056
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0014-GLES2-gl2ext.h-Define-GL_R8_EXT-and-GL_RG8_EXT.patch
@@ -0,0 +1,30 @@
+From d750c738b5c23bba24531cb713292e4ab3f2ec56 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 10 May 2017 06:39:34 +0000
+Subject: [PATCH 14/15] GLES2/gl2ext.h: Define GL_R8_EXT and GL_RG8_EXT
+
+weston code uses these defines
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ interface/khronos/include/GLES2/gl2ext.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/interface/khronos/include/GLES2/gl2ext.h b/interface/khronos/include/GLES2/gl2ext.h
+index 4eacf7f..283e3e1 100644
+--- a/interface/khronos/include/GLES2/gl2ext.h
++++ b/interface/khronos/include/GLES2/gl2ext.h
+@@ -327,6 +327,9 @@ typedef void* GLeglImageOES;
+ #define GL_RGBX_BRCM                                            0x80EE
+ #endif
+ 
++#define GL_R8_EXT                                               0x8229
++#define GL_RG8_EXT                                              0x822B
++
+ /* GL_EXT_texture_type_2_10_10_10_REV */
+ #ifndef GL_EXT_texture_type_2_10_10_10_REV
+ #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT                      0x8368
+-- 
+2.15.0
+
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0015-EGL-glplatform.h-define-EGL_CAST.patch b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0015-EGL-glplatform.h-define-EGL_CAST.patch
new file mode 100644
index 0000000..f10740b
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland/0015-EGL-glplatform.h-define-EGL_CAST.patch
@@ -0,0 +1,32 @@
+From 827907f2223df93918e680101a1ac6228ba0f07e Mon Sep 17 00:00:00 2001
+From: Andrea Galbusera <gizero@gmail.com>
+Date: Fri, 14 Jul 2017 09:52:54 +0200
+Subject: [PATCH 15/15] EGL/glplatform.h: define EGL_CAST
+
+C++ / C typecast macros for special EGL handle values: used by libepoxy code
+The definition comes from the updated version of this header in mesa.
+
+Upstream-Status: Pending
+---
+ interface/khronos/include/EGL/eglplatform.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/interface/khronos/include/EGL/eglplatform.h b/interface/khronos/include/EGL/eglplatform.h
+index 1f7c930..c39d425 100644
+--- a/interface/khronos/include/EGL/eglplatform.h
++++ b/interface/khronos/include/EGL/eglplatform.h
+@@ -202,4 +202,11 @@ EGLAPI void EGLAPIENTRY BEGL_GetDefaultDriverInterfaces(BEGL_DriverInterfaces *i
+ #include "interface/khronos/common/khrn_client_mangle.h"
+ #endif
+ 
++/* C++ / C typecast macros for special EGL handle values */
++#if defined(__cplusplus)
++#define EGL_CAST(type, value) (static_cast<type>(value))
++#else
++#define EGL_CAST(type, value) ((type) (value))
++#endif
++
+ #endif /* __eglplatform_h */
+-- 
+2.15.0
+
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland_git.bb b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland_git.bb
index a37249c..579aace 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/userland/userland_git.bb
+++ b/import-layers/meta-raspberrypi/recipes-graphics/userland/userland_git.bb
@@ -10,13 +10,13 @@
 PROVIDES = "virtual/libgles2 \
             virtual/egl"
 
-RPROVIDES_${PN} += "libgles2 libgl"
+RPROVIDES_${PN} += "libgles2 egl libegl"
 
 COMPATIBLE_MACHINE = "raspberrypi"
 
 SRCBRANCH = "master"
 SRCFORK = "raspberrypi"
-SRCREV = "bb15afe33b313fe045d52277a78653d288e04f67"
+SRCREV = "bc3c52a51315399a9f31ed24049eb4bc81fd1c60"
 
 SRC_URI = "\
     git://github.com/${SRCFORK}/userland.git;protocol=git;branch=${SRCBRANCH} \
@@ -32,6 +32,9 @@
     file://0010-Fix-for-framerate-with-nested-composition.patch \
     file://0011-build-shared-library-for-vchostif.patch \
     file://0012-implement-buffer-wrapping-interface-for-dispmanx.patch \
+    file://0013-Implement-triple-buffering-for-wayland.patch \
+    file://0014-GLES2-gl2ext.h-Define-GL_R8_EXT-and-GL_RG8_EXT.patch \
+    file://0015-EGL-glplatform.h-define-EGL_CAST.patch \
 "
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
index 6fd17da..a5a6af3 100644
--- a/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
+++ b/import-layers/meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
@@ -7,5 +7,3 @@
     ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "xwayland", "", d)} \
     ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "", d)} \
 "
-
-XSERVER_RRECOMMENDS_append = " xf86-input-libinput"
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.bin b/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.bin
new file mode 100644
index 0000000..6b955da
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.bin
Binary files differ
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.txt b/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.txt
index ea4f648..3d917a7 100644
--- a/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.txt
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.txt
@@ -1,19 +1,20 @@
-# NVRAM file for BCM943430WLPTH
+# NVRAM file for BCM943430WLSELG
 # 2.4 GHz, 20 MHz BW mode
 
 # The following parameter values are just placeholders, need to be updated.
 manfid=0x2d0
-prodid=0x0727
+prodid=0x0726
 vendid=0x14e4
 devid=0x43e2
-boardtype=0x0727
-boardrev=0x1101
+boardtype=0x0726
+boardrev=0x1202
 boardnum=22
 macaddr=00:90:4c:c5:12:38
 sromrev=11
 boardflags=0x00404201
 boardflags3=0x08000000
 xtalfreq=37400
+#xtalfreq=19200
 nocrc=1
 ag0=255
 aa2g=1
@@ -21,6 +22,7 @@
 
 pa0itssit=0x20
 extpagain2g=0
+
 #PA parameters for 2.4GHz, measured at CHIP OUTPUT
 pa2ga0=-168,7161,-820
 AvVmid_c0=0x0,0xc8
@@ -40,15 +42,9 @@
 # PAPD mode:
 papdmode=1
 papdvalidtest=1
-pacalidx2g=42
-papdepsoffset=-22
-papdendidx=58
-
-# LTECX flags
-ltecxmux=0
-ltecxpadnum=0x0102
-ltecxfnsel=0x44
-ltecxgcigpio=0x01
+pacalidx2g=32
+papdepsoffset=-36
+papdendidx=61
 
 il0macaddr=00:90:4c:c5:12:38
 wl0id=0x431b
@@ -61,6 +57,3 @@
 
 #VCO freq 326.4MHz
 spurconfig=0x3 
-
-edonthd20l=-75
-edoffthd20ul=-80
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend b/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend
index 252da22..565b735 100644
--- a/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend
@@ -1,12 +1,26 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
 
-SRC_URI += "file://brcmfmac43430-sdio.txt"
+SRC_URI += " \
+	file://brcmfmac43430-sdio.bin \
+	file://brcmfmac43430-sdio.txt \
+	"
 
 do_install_append() {
-	install -D -m 0644 ${WORKDIR}/brcmfmac43430-sdio.txt ${D}/lib/firmware/brcm/brcmfmac43430-sdio.txt
+	# Overwrite v7.45.41.26 by the one we currently provide in this layer
+	# (v7.45.41.46)
+	local _firmware="brcmfmac43430-sdio.bin"
+	local _oldmd5=9258986488eca9fe5343b0d6fe040f8e
+	if [ "$(md5sum ${D}/lib/firmware/brcm/$_firmware | awk '{print $1}')" != "$_oldmd5" ]; then
+		_firmware=""
+		bbwarn "linux-firmware stopped providing brcmfmac43430 v7.45.41.26."
+	else
+		_firmware="${WORKDIR}/$_firmware"
+	fi
+
+	mkdir -p ${D}/lib/firmware/brcm
+	install -m 0644 $_firmware ${WORKDIR}/brcmfmac43430-sdio.txt ${D}/lib/firmware/brcm
 }
 
 FILES_${PN}-bcm43430 += " \
-  /lib/firmware/brcm/brcmfmac43430-sdio.txt \
+	/lib/firmware/brcm/brcmfmac43430-sdio.txt \
 "
-
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch
deleted file mode 100644
index 5113e23..0000000
--- a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 13c8784da3dbd977f64cec740eba775b6fab11c2 Mon Sep 17 00:00:00 2001
-From: Herve Jourdain <herve.jourdain@neuf.fr>
-Date: Fri, 20 May 2016 16:02:23 +0800
-Subject: [yocto][meta-raspberrypi][PATCH v4 4/5] linux-raspberrypi_4.4.inc:
- support for .dtbo files for dtb overlays
-
-Upstream-Status: Pending
-
-Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
-Patch the kernel, which has faulty rules to generate .dtbo the way yocto does
-
-Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
----
- .../0001-fix-dtbo-rules.patch                      | 27 ++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
- create mode 100644 recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch
-
-diff --git a/arch/arm/Makefile b/arch/arm/Makefile
-index a2e7cf7..673c1cb 100644
---- a/arch/arm/Makefile
-+++ b/arch/arm/Makefile
-@@ -333,6 +333,8 @@ $(INSTALL_TARGETS):
- 
- %.dtb: | scripts
- 	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
-+%.dtbo: | scripts
-+	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
- 
- PHONY += dtbs dtbs_install
- 
-diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
-index 3079c4f..6cc3766 100644
---- a/scripts/Makefile.lib
-+++ b/scripts/Makefile.lib
-@@ -293,7 +293,8 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
- 	$(call if_changed_dep,dtc)
- 
- quiet_cmd_dtco = DTCO    $@
--cmd_dtco = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
-+cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \
-+	$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- 	$(objtree)/scripts/dtc/dtc -@ -H epapr -O dtb -o $@ -b 0 \
- 		-i $(dir $<) $(DTC_FLAGS) \
- 		-d $(depfile).dtc.tmp $(dtc-tmp) ; \
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb
new file mode 100644
index 0000000..0879bcb
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb
@@ -0,0 +1,26 @@
+python __anonymous() {
+    if "linux-raspberrypi-dev" not in d.getVar("PREFERRED_PROVIDER_virtual/kernel"):
+        msg = "Skipping linux-raspberrypi-dev as it is not the preferred " + \
+              "provider of virtual/kernel."
+        raise bb.parse.SkipRecipe(msg)
+}
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:"
+
+LINUX_VERSION ?= "4.11"
+LINUX_RPI_DEV_BRANCH ?= "rpi-4.11.y"
+
+SRCREV = "${AUTOREV}"
+SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=${LINUX_RPI_DEV_BRANCH} \
+           file://0001-build-arm64-Add-rules-for-.dtbo-files-for-dts-overla.patch \
+"
+require linux-raspberrypi.inc
+
+# A LOADADDR is needed when building a uImage format kernel. This value is not
+# set by default in rpi-4.8.y and later branches so we need to provide it
+# manually. This value unused if KERNEL_IMAGETYPE is not uImage.
+KERNEL_EXTRA_ARGS += "LOADADDR=0x00008000"
+
+# Disable version check so that we don't have to edit this recipe every time
+# upstream bumps the version
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev/0001-build-arm64-Add-rules-for-.dtbo-files-for-dts-overla.patch b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev/0001-build-arm64-Add-rules-for-.dtbo-files-for-dts-overla.patch
new file mode 100644
index 0000000..e8bc52e
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev/0001-build-arm64-Add-rules-for-.dtbo-files-for-dts-overla.patch
@@ -0,0 +1,29 @@
+From 922ce1fd0eb810b713f6ffa9a7ab97c11b6e38cf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 10 Feb 2017 17:57:08 -0800
+Subject: [PATCH] build/arm64: Add rules for .dtbo files for dts overlays
+
+We now create overlays as .dtbo files.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ arch/arm64/Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
+index 3635b8662724..822fefeb1cd0 100644
+--- a/arch/arm64/Makefile
++++ b/arch/arm64/Makefile
+@@ -113,6 +113,9 @@ zinstall install:
+ %.dtb: scripts
+ 	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
+ 
++%.dtbo: | scripts
++	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
++
+ PHONY += dtbs dtbs_install
+ 
+ dtbs: prepare scripts
+-- 
+2.11.1
+
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
index d196d8e..9265d55 100644
--- a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
@@ -21,7 +21,7 @@
 KERNEL_DEFCONFIG_raspberrypi3-64 ?= "bcmrpi3_defconfig"
 
 # CMDLINE for raspberrypi
-CMDLINE = "dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
+CMDLINE ?= "dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
 
 # Add the kernel debugger over console kernel command line option if enabled
 CMDLINE_append = ' ${@base_conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'
@@ -33,8 +33,8 @@
 # Set programmatically some variables during recipe parsing
 # See http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#anonymous-python-functions
 python __anonymous () {
-    kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
-    kerneldt = get_dts(d, d.getVar('LINUX_VERSION', True))
+    kerneltype = d.getVar('KERNEL_IMAGETYPE')
+    kerneldt = get_dts(d, d.getVar('LINUX_VERSION'))
     d.setVar("KERNEL_DEVICETREE", kerneldt)
 }
 
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bb b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bb
deleted file mode 100644
index b6be0ec..0000000
--- a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
-
-LINUX_VERSION ?= "4.4.50"
-
-SRCREV = "04c8e47067d4873c584395e5cb260b4f170a99ea"
-SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.4.y \
-           file://0001-fix-dtbo-rules.patch \
-"
-
-require linux-raspberrypi.inc
diff --git a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb
index 074f448..df28fda 100644
--- a/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb
+++ b/import-layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb
@@ -1,10 +1,10 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
 
-LINUX_VERSION ?= "4.9.27"
+LINUX_VERSION ?= "4.9.59"
 
-SRCREV = "9a5f215eda12bad29b35040dff00d0346fe517e2"
-SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.9.y \
-"
+SRCREV = "e7976b2affa8c05bd299ead0ad9c36ddaf135b9d"
+SRC_URI = "git://github.com/raspberrypi/linux.git;branch=rpi-4.9.y"
+
 require linux-raspberrypi.inc
 
 # A LOADADDR is needed when building a uImage format kernel. This value is not
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx%.bbappend b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx%.bbappend
new file mode 100644
index 0000000..67e46de
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx%.bbappend
@@ -0,0 +1,9 @@
+GSTREAMER_1_0_OMX_TARGET_rpi = "rpi"
+GSTREAMER_1_0_OMX_CORE_NAME_rpi = "${libdir}/libopenmaxil.so"
+
+
+# How to make this RPI specific?
+EXTRA_OECONF_append_rpi  = " CFLAGS="$CFLAGS -I${STAGING_DIR_TARGET}/usr/include/IL -I${STAGING_DIR_TARGET}/usr/include/interface/vcos/pthreads -I${STAGING_DIR_TARGET}/usr/include/interface/vmcs_host/linux""
+#examples only build with GL but not GLES, so disable it for RPI
+EXTRA_OECONF_append_rpi = " --disable-examples"
+
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch
similarity index 100%
rename from import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch
rename to import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0001-config-files-path.patch b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0001-config-files-path.patch
similarity index 100%
rename from import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0001-config-files-path.patch
rename to import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0001-config-files-path.patch
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0002-fix-decoder-flushing.patch b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0002-fix-decoder-flushing.patch
similarity index 100%
rename from import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0002-fix-decoder-flushing.patch
rename to import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0002-fix-decoder-flushing.patch
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0003-no-timeout-on-get-state.patch b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0003-no-timeout-on-get-state.patch
similarity index 100%
rename from import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0003-no-timeout-on-get-state.patch
rename to import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0003-no-timeout-on-get-state.patch
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0004-Properly-handle-drain-requests-while-flushing.patch b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0004-Properly-handle-drain-requests-while-flushing.patch
new file mode 100644
index 0000000..4d10f24
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0004-Properly-handle-drain-requests-while-flushing.patch
@@ -0,0 +1,30 @@
+From 80dddfd13aaf2fe7272765f8cf291215fe375e28 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Enrique=20Oca=C3=B1a=20Gonz=C3=A1lez?= <eocanha@igalia.com>
+Date: Tue, 17 Nov 2015 16:51:27 +0000
+Subject: [PATCH] Properly handle drain requests while flushing
+
+Without this commit the decoder streaming thread stops without ever attending
+the drain request, leaving the decoder input thread waiting forever.
+---
+ omx/gstomx.c         |  7 +++++++
+ omx/gstomxvideodec.c | 13 +++++++++++++
+ 2 files changed, 20 insertions(+)
+
+Index: gst-omx-1.10.2/omx/gstomx.c
+===================================================================
+--- gst-omx-1.10.2.orig/omx/gstomx.c
++++ gst-omx-1.10.2/omx/gstomx.c
+@@ -737,6 +737,13 @@ gst_omx_component_new (GstObject * paren
+ 
+   g_mutex_lock (&comp->lock);
+   gst_omx_component_handle_messages (comp);
++
++  if (err != OMX_ErrorNone && comp->last_error == OMX_ErrorNone) {
++    GST_ERROR_OBJECT (comp->parent,
++        "Last operation returned an error. Setting last_error manually.");
++    comp->last_error = err;
++  }
++
+   g_mutex_unlock (&comp->lock);
+ 
+   return comp;
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch
similarity index 100%
rename from import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch
rename to import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.10/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0004-Properly-handle-drain-requests-while-flushing.patch b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0004-Properly-handle-drain-requests-while-flushing.patch
deleted file mode 100644
index 98689f3..0000000
--- a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0004-Properly-handle-drain-requests-while-flushing.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 80dddfd13aaf2fe7272765f8cf291215fe375e28 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Enrique=20Oca=C3=B1a=20Gonz=C3=A1lez?= <eocanha@igalia.com>
-Date: Tue, 17 Nov 2015 16:51:27 +0000
-Subject: [PATCH] Properly handle drain requests while flushing
-
-Without this commit the decoder streaming thread stops without ever attending
-the drain request, leaving the decoder input thread waiting forever.
----
- omx/gstomx.c         |  7 +++++++
- omx/gstomxvideodec.c | 13 +++++++++++++
- 2 files changed, 20 insertions(+)
-
-diff --git a/omx/gstomx.c b/omx/gstomx.c
-index 69696c4..f0cd890 100644
---- a/omx/gstomx.c
-+++ b/omx/gstomx.c
-@@ -830,6 +830,13 @@ gst_omx_component_set_state (GstOMXComponent * comp, OMX_STATETYPE state)
- done:
- 
-   gst_omx_component_handle_messages (comp);
-+
-+  if (err != OMX_ErrorNone && comp->last_error == OMX_ErrorNone) {
-+    GST_ERROR_OBJECT (comp->parent,
-+        "Last operation returned an error. Setting last_error manually.");
-+    comp->last_error = err;
-+  }
-+
-   g_mutex_unlock (&comp->lock);
- 
-   if (err != OMX_ErrorNone) {
-diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
-index d531f75..a26c4a6 100644
---- a/omx/gstomxvideodec.c
-+++ b/omx/gstomxvideodec.c
-@@ -1539,9 +1539,16 @@ component_error:
- flushing:
-   {
-     GST_DEBUG_OBJECT (self, "Flushing -- stopping task");
-+
-+    g_mutex_lock (&self->drain_lock);
-+    if (self->draining) {
-+      self->draining = FALSE;
-+      g_cond_broadcast (&self->drain_cond);
-+    }
-     gst_pad_pause_task (GST_VIDEO_DECODER_SRC_PAD (self));
-     self->downstream_flow_ret = GST_FLOW_FLUSHING;
-     self->started = FALSE;
-+    g_mutex_unlock (&self->drain_lock);
-     return;
-   }
- 
-@@ -1599,8 +1606,14 @@ flow_error:
-       self->started = FALSE;
-     } else if (flow_ret == GST_FLOW_FLUSHING) {
-       GST_DEBUG_OBJECT (self, "Flushing -- stopping task");
-+      g_mutex_lock (&self->drain_lock);
-+      if (self->draining) {
-+        self->draining = FALSE;
-+        g_cond_broadcast (&self->drain_cond);
-+      }
-       gst_pad_pause_task (GST_VIDEO_DECODER_SRC_PAD (self));
-       self->started = FALSE;
-+      g_mutex_unlock (&self->drain_lock);
-     }
-     GST_VIDEO_DECODER_STREAM_UNLOCK (self);
-     return;
--- 
-1.8.3.2
-
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0006-omxvideodec-unref-allocator-after-getting-it-from-al.patch b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0006-omxvideodec-unref-allocator-after-getting-it-from-al.patch
deleted file mode 100644
index ace60a6..0000000
--- a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0006-omxvideodec-unref-allocator-after-getting-it-from-al.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From d2df0fb032c36b366a08a1355c4f4c816eb53447 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Aur=C3=A9lien=20Zanelli?= <aurelien.zanelli@darkosphere.fr>
-Date: Fri, 3 Jul 2015 00:26:48 +0200
-Subject: [PATCH] omxvideodec: unref allocator after getting it from allocation
- query
-
-Otherwise a reference will be leaked for each allocator. It only happens
-when target platform is Raspberry Pi and when we have GL support.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=751867
----
- omx/gstomxvideodec.c | 20 ++++++++++++--------
- 1 file changed, 12 insertions(+), 8 deletions(-)
-
-diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
-index cd24944..b8c3756 100644
---- a/omx/gstomxvideodec.c
-+++ b/omx/gstomxvideodec.c
-@@ -2530,14 +2530,18 @@ gst_omx_video_dec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
-         GstAllocationParams params;
- 
-         gst_query_parse_nth_allocation_param (query, i, &allocator, &params);
--        if (allocator
--            && g_strcmp0 (allocator->mem_type,
--                GST_EGL_IMAGE_MEMORY_TYPE) == 0) {
--          found = TRUE;
--          gst_query_set_nth_allocation_param (query, 0, allocator, &params);
--          while (gst_query_get_n_allocation_params (query) > 1)
--            gst_query_remove_nth_allocation_param (query, 1);
--          break;
-+        if (allocator) {
-+          if (g_strcmp0 (allocator->mem_type, GST_EGL_IMAGE_MEMORY_TYPE) == 0) {
-+            found = TRUE;
-+            gst_query_set_nth_allocation_param (query, 0, allocator, &params);
-+            while (gst_query_get_n_allocation_params (query) > 1)
-+              gst_query_remove_nth_allocation_param (query, 1);
-+          }
-+
-+          gst_object_unref (allocator);
-+
-+          if (found)
-+            break;
-         }
-       }
- 
--- 
-2.5.5
-
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0007-omxvideodec-Use-gstglmemoryegl-for-the-RPi.patch b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0007-omxvideodec-Use-gstglmemoryegl-for-the-RPi.patch
deleted file mode 100644
index ed828c3..0000000
--- a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.2.0/0007-omxvideodec-Use-gstglmemoryegl-for-the-RPi.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 1cb902edb51d8f5d95f910b79b9b4c208550a7b6 Mon Sep 17 00:00:00 2001
-From: Gwang Yoon Hwang <yoon@igalia.com>
-Date: Wed, 20 Jan 2016 03:10:38 +0900
-Subject: [PATCH] omxvideodec : Use gstglmemoryegl for the RPi
-
-Modified to use gstglmemoryegl to avoid texture creation/copy operations
-at the glupload.
----
- omx/gstomxvideodec.c | 28 ++++++++++++++--------------
- 1 file changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
-index ec97731..c9d60ff 100644
---- a/omx/gstomxvideodec.c
-+++ b/omx/gstomxvideodec.c
-@@ -38,7 +38,7 @@
- 
- #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
- #include <gst/gl/gl.h>
--#include <gst/gl/egl/gsteglimagememory.h>
-+#include <gst/gl/egl/gstglmemoryegl.h>
- #endif
- 
- #if defined (USE_OMX_TARGET_RPI) && defined(__GNUC__)
-@@ -125,7 +125,7 @@ gst_omx_video_dec_class_init (GstOMXVideoDecClass * klass)
-   klass->cdata.type = GST_OMX_COMPONENT_TYPE_FILTER;
-   klass->cdata.default_src_template_caps =
- #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
--      GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_EGL_IMAGE,
-+      GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
-       "RGBA") "; "
- #endif
-       "video/x-raw, "
-@@ -596,8 +596,8 @@ gst_omx_video_dec_allocate_output_buffers (GstOMXVideoDec * self)
-     gst_structure_free (config);
- 
- #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
--    eglimage = self->eglimage && (allocator
--        && g_strcmp0 (allocator->mem_type, GST_EGL_IMAGE_MEMORY_TYPE) == 0);
-+    eglimage = self->eglimage
-+               && (allocator && GST_IS_GL_MEMORY_EGL_ALLOCATOR (allocator));
- #else
-     /* TODO: Implement something that works for other targets too */
-     eglimage = FALSE;
-@@ -640,12 +640,12 @@ gst_omx_video_dec_allocate_output_buffers (GstOMXVideoDec * self)
-     for (i = 0; i < min; i++) {
-       GstBuffer *buffer;
-       GstMemory *mem;
-+      GstGLMemoryEGL *gl_mem;
- 
-       if (gst_buffer_pool_acquire_buffer (pool, &buffer, &params) != GST_FLOW_OK
-           || gst_buffer_n_memory (buffer) != 1
-           || !(mem = gst_buffer_peek_memory (buffer, 0))
--          || g_strcmp0 (mem->allocator->mem_type,
--              GST_EGL_IMAGE_MEMORY_TYPE) != 0) {
-+          || !GST_IS_GL_MEMORY_EGL_ALLOCATOR (mem->allocator)) {
-         GST_INFO_OBJECT (self, "Failed to allocated %d-th EGLImage", i);
-         g_list_free_full (buffers, (GDestroyNotify) gst_buffer_unref);
-         g_list_free (images);
-@@ -656,13 +656,13 @@ gst_omx_video_dec_allocate_output_buffers (GstOMXVideoDec * self)
-         err = OMX_ErrorUndefined;
-         goto done;
-       }
--
-+      gl_mem = (GstGLMemoryEGL *)mem;
-       buffers = g_list_append (buffers, buffer);
--      gst_egl_image_memory_set_orientation (mem,
-+      gst_gl_memory_egl_set_orientation (gl_mem,
-           GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_FLIP);
--      images = g_list_append (images, gst_egl_image_memory_get_image (mem));
-+      images = g_list_append (images, gst_gl_memory_egl_get_image (gl_mem));
-       if (egl_display == EGL_NO_DISPLAY)
--        egl_display = gst_egl_image_memory_get_display (mem);
-+        egl_display = gst_gl_memory_egl_get_display (gl_mem);
-     }
- 
-     GST_DEBUG_OBJECT (self, "Allocated %d EGLImages successfully", min);
-@@ -954,14 +954,14 @@ gst_omx_video_dec_reconfigure_output_port (GstOMXVideoDec * self)
-         gst_caps_unref (state->caps);
-       state->caps = gst_video_info_to_caps (&state->info);
-       gst_caps_set_features (state->caps, 0,
--          gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_EGL_IMAGE, NULL));
-+          gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, NULL));
- 
-       /* try to negotiate with caps feature */
-       if (!gst_video_decoder_negotiate (GST_VIDEO_DECODER (self))) {
- 
-         GST_DEBUG_OBJECT (self,
-             "Failed to negotiate with feature %s",
--            GST_CAPS_FEATURE_MEMORY_EGL_IMAGE);
-+            GST_CAPS_FEATURE_MEMORY_GL_MEMORY);
- 
-         if (state->caps)
-           gst_caps_replace (&state->caps, NULL);
-@@ -2554,7 +2554,7 @@ gst_omx_video_dec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
- 
-         gst_query_parse_nth_allocation_param (query, i, &allocator, &params);
-         if (allocator) {
--          if (g_strcmp0 (allocator->mem_type, GST_EGL_IMAGE_MEMORY_TYPE) == 0) {
-+          if (GST_IS_GL_MEMORY_EGL_ALLOCATOR (allocator)) {
-             found = TRUE;
-             gst_query_set_nth_allocation_param (query, 0, allocator, &params);
-             while (gst_query_get_n_allocation_params (query) > 1)
-@@ -2572,7 +2572,7 @@ gst_omx_video_dec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
-        * and if allocator is not of type memory EGLImage then fails */
-       if (feature
-           && gst_caps_features_contains (feature,
--              GST_CAPS_FEATURE_MEMORY_EGL_IMAGE) && !found) {
-+              GST_CAPS_FEATURE_MEMORY_GL_MEMORY) && !found) {
-         return FALSE;
-       }
-     }
--- 
-2.5.0
-
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.10%.bbappend b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.10%.bbappend
new file mode 100644
index 0000000..d419867
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.10%.bbappend
@@ -0,0 +1,13 @@
+#
+# Need to make this conditional to gstreamer1
+#
+SRC_URI_append_rpi = " \
+             file://0001-config-files-path.patch \
+             file://0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch \
+             file://0002-fix-decoder-flushing.patch \
+             file://0003-no-timeout-on-get-state.patch \
+             file://0004-Properly-handle-drain-requests-while-flushing.patch \
+             file://0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch \
+"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/gstreamer1.0-omx-1.10:"
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bbappend b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bbappend
deleted file mode 100644
index 1e84abe..0000000
--- a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bbappend
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Need to make this conditional to gstreamer1
-#
-SRC_URI_append_rpi = " \
-             file://0001-config-files-path.patch \
-             file://0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch \
-             file://0002-fix-decoder-flushing.patch \
-             file://0003-no-timeout-on-get-state.patch \
-             file://0004-Properly-handle-drain-requests-while-flushing.patch \
-             file://0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch \
-             file://0006-omxvideodec-unref-allocator-after-getting-it-from-al.patch \
-             file://0007-omxvideodec-Use-gstglmemoryegl-for-the-RPi.patch \
-"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/gstreamer1.0-omx-1.2.0:"
-
-GSTREAMER_1_0_OMX_TARGET_rpi = "rpi"
-GSTREAMER_1_0_OMX_CORE_NAME_rpi = "${libdir}/libopenmaxil.so"
-
-
-# How to make this RPI specific?
-EXTRA_OECONF_append_rpi  = " CFLAGS="$CFLAGS -I${STAGING_DIR_TARGET}/usr/include/IL -I${STAGING_DIR_TARGET}/usr/include/interface/vcos/pthreads -I${STAGING_DIR_TARGET}/usr/include/interface/vmcs_host/linux""
-#examples only build with GL but not GLES, so disable it for RPI
-EXTRA_OECONF_append_rpi = " --disable-examples"
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bbappend b/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bbappend
deleted file mode 100644
index a13aad7..0000000
--- a/import-layers/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bbappend
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Need to make this conditional to gstreamer1
-#
-SRC_URI_append_rpi = " \
-             file://0001-config-files-path.patch \
-             file://0002-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch \
-             file://0003-fix-decoder-flushing.patch \
-             file://0003-no-timeout-on-get-state.patch \
-             file://0004-Properly-handle-drain-requests-while-flushing.patch \
-             file://0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch \
-"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/gstreamer1.0-omx:"
-
-GSTREAMER_1_0_OMX_TARGET_rpi = "rpi"
-GSTREAMER_1_0_OMX_CORE_NAME_rpi = "${libdir}/libopenmaxil.so"
-
-
-# How to make this RPI specific?
-EXTRA_OECONF_append_rpi  = " CFLAGS="$CFLAGS -I${STAGING_DIR_TARGET}/usr/include/IL -I${STAGING_DIR_TARGET}/usr/include/interface/vcos/pthreads -I${STAGING_DIR_TARGET}/usr/include/interface/vmcs_host/linux""
-#examples only build with GL but not GLES, so disable it for RPI
-EXTRA_OECONF_append_rpi = " --disable-examples"
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/0002-Libraries-and-headers-from-ffmpeg-are-installed-in-u.patch b/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/0002-Libraries-and-headers-from-ffmpeg-are-installed-in-u.patch
index 75f7254..203f34b 100644
--- a/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/0002-Libraries-and-headers-from-ffmpeg-are-installed-in-u.patch
+++ b/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/0002-Libraries-and-headers-from-ffmpeg-are-installed-in-u.patch
@@ -14,33 +14,33 @@
  Makefile.ffmpeg | 2 +-
  2 files changed, 4 insertions(+), 4 deletions(-)
 
-diff --git a/Makefile b/Makefile
-index be97c2b..2c120fc 100644
---- a/Makefile
-+++ b/Makefile
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile
++++ git/Makefile
 @@ -1,9 +1,9 @@
  
  CFLAGS+=-std=c++0x -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG  -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST
  
--LDFLAGS+=-L./ -Lffmpeg_compiled/usr/local/lib/ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz
-+LDFLAGS+=-L./ -Lffmpeg_compiled/usr/lib/ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz
+-LDFLAGS+=-L./ -Lffmpeg_compiled/usr/local/lib/ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz -lasound
++LDFLAGS+=-L./ -Lffmpeg_compiled/usr/lib/ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz -lasound
  
 -INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include
-+INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/include/ -I=/usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include
++INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/include/ -I=/usr/include/dbus-1.0
  
  DIST ?= omxplayer-dist
  
-@@ -87,5 +87,5 @@ dist: omxplayer.bin omxplayer.1
+@@ -88,5 +88,5 @@ dist: omxplayer.bin omxplayer.1
  	cp COPYING $(DIST)/usr/share/doc/omxplayer
  	cp README.md $(DIST)/usr/share/doc/omxplayer/README
  	cp omxplayer.1 $(DIST)/usr/share/man/man1
 -	cp -P ffmpeg_compiled/usr/local/lib/*.so* $(DIST)/usr/lib/omxplayer/
 +	cp -P ffmpeg_compiled/usr/lib/*.so* $(DIST)/usr/lib/omxplayer/
  	cd $(DIST); tar -czf ../$(DIST).tgz *
-diff --git a/Makefile.ffmpeg b/Makefile.ffmpeg
-index 5ccf96f..a7ddd5f 100644
---- a/Makefile.ffmpeg
-+++ b/Makefile.ffmpeg
+Index: git/Makefile.ffmpeg
+===================================================================
+--- git.orig/Makefile.ffmpeg
++++ git/Makefile.ffmpeg
 @@ -254,5 +254,5 @@ checkout:
  .PHONY : install
  install:
@@ -48,6 +48,3 @@
 -	$(HOST)-strip ffmpeg_compiled/usr/local/lib/*.so
 +	$(HOST)-strip ffmpeg_compiled/usr/lib/*.so
  
--- 
-1.9.3
-
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/0004-Add-FFMPEG_EXTRA_CFLAGS-and-FFMPEG_EXTRA_LDFLAGS.patch b/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/0004-Add-FFMPEG_EXTRA_CFLAGS-and-FFMPEG_EXTRA_LDFLAGS.patch
index edb388e..ea8530d 100644
--- a/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/0004-Add-FFMPEG_EXTRA_CFLAGS-and-FFMPEG_EXTRA_LDFLAGS.patch
+++ b/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/0004-Add-FFMPEG_EXTRA_CFLAGS-and-FFMPEG_EXTRA_LDFLAGS.patch
@@ -12,20 +12,26 @@
  Makefile.ffmpeg | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
-diff --git a/Makefile.ffmpeg b/Makefile.ffmpeg
-index abe4b26..c9d42d7 100644
---- a/Makefile.ffmpeg
-+++ b/Makefile.ffmpeg
-@@ -22,7 +22,8 @@ configure:
+Index: git/Makefile.ffmpeg
+===================================================================
+--- git.orig/Makefile.ffmpeg
++++ git/Makefile.ffmpeg
+@@ -1,6 +1,8 @@
+ 
+ CFLAGS=-D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_HAVE_SBRK -D_LARGEFILE64_SOURCE -DHAVE_CMAKE_CONFIG -DHAVE_VMCS_CONFIG -D_REENTRANT -DUSE_VCHIQ_ARM -DVCHI_BULK_ALIGN=1 -DVCHI_BULK_GRANULARITY=1 -DEGL_SERVER_DISPMANX -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__VIDEOCORE4__ -DGRAPHICS_X_VG=1 -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG  -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DOMX -DOMX_SKIP64BIT
+ 
++FFMPEG_EXTRA_CFLAGS?=-mfpu=vfp -mfloat-abi=$(FLOAT) -mno-apcs-stack-check -mstructure-size-boundary=32 -mno-sched-prolog
++
+ WORK=$(PWD)
+ 
+ .PHONY : all
+@@ -21,7 +23,8 @@ configure:
  	CFLAGS="$(CFLAGS) ${INCLUDES}" \
  	LDFLAGS="" \
    ./configure \
 -			--extra-cflags="-mfpu=vfp -mfloat-abi=$(FLOAT) -mno-apcs-stack-check -mstructure-size-boundary=32 -mno-sched-prolog" \
-+			--extra-cflags="-mfpu=vfp -mfloat-abi=$(FLOAT) -mno-apcs-stack-check -mstructure-size-boundary=32 -mno-sched-prolog $(FFMPEG_EXTRA_CFLAGS)" \
++			--extra-cflags="$(FFMPEG_EXTRA_CFLAGS)" \
 +			--extra-ldflags="$(FFMPEG_EXTRA_LDFLAGS)" \
  			--enable-cross-compile \
  			--enable-shared \
  			--disable-static \
--- 
-2.1.0
-
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer_git.bb b/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer_git.bb
index d9460de..0e0f9ba 100644
--- a/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer_git.bb
+++ b/import-layers/meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer_git.bb
@@ -7,10 +7,10 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
-DEPENDS = "libpcre libav virtual/egl boost freetype dbus openssl samba libssh"
+DEPENDS = "libpcre libav virtual/egl boost freetype dbus openssl samba libssh libomxil coreutils-native curl-native"
 PR = "r4"
 
-SRCREV = "8466acf65f5f444dfa22631fb83c07ac759c02a5"
+SRCREV = "061425a5eabf6e9ee43229911c073a863d144038"
 SRC_URI = "git://github.com/popcornmix/omxplayer.git;protocol=git;branch=master \
            file://0001-Remove-Makefile.include-which-includes-hardcoded.patch \
            file://0002-Libraries-and-headers-from-ffmpeg-are-installed-in-u.patch \
@@ -21,7 +21,9 @@
            "
 S = "${WORKDIR}/git"
 
-COMPATIBLE_MACHINE = "raspberrypi"
+COMPATIBLE_MACHINE ?= "null"
+COMPATIBLE_MACHINE_rpi_aarch64 = "null"
+COMPATIBLE_MACHINE_rpi = "(.*)"
 
 inherit autotools-brokensep pkgconfig
 
@@ -31,9 +33,8 @@
 # Needed in Makefile.ffmpeg
 export HOST = "${HOST_SYS}"
 export WORK = "${S}"
-export FLOAT = "${@bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "hard", "softfp", d)}"
-export FFMPEG_EXTRA_CFLAGS  = "--sysroot=${STAGING_DIR_TARGET}"
-export FFMPEG_EXTRA_LDFLAGS = "--sysroot=${STAGING_DIR_TARGET}"
+export FFMPEG_EXTRA_CFLAGS  = "${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS}"
+export FFMPEG_EXTRA_LDFLAGS  = "${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS}"
 
 # Needed in top Makefile
 export LDFLAGS = "-L${S}/ffmpeg_compiled/usr/lib \
diff --git a/import-layers/meta-raspberrypi/recipes-multimedia/x264/x264_git.bbappend b/import-layers/meta-raspberrypi/recipes-multimedia/x264/x264_git.bbappend
new file mode 100644
index 0000000..c1cb3bc
--- /dev/null
+++ b/import-layers/meta-raspberrypi/recipes-multimedia/x264/x264_git.bbappend
@@ -0,0 +1 @@
+EXTRA_OECONF_append_raspberrypi = " --disable-asm"
diff --git a/import-layers/meta-raspberrypi/scripts/lib/image/canned-wks/sdimage-raspberrypi.wks b/import-layers/meta-raspberrypi/wic/sdimage-raspberrypi.wks
similarity index 100%
rename from import-layers/meta-raspberrypi/scripts/lib/image/canned-wks/sdimage-raspberrypi.wks
rename to import-layers/meta-raspberrypi/wic/sdimage-raspberrypi.wks
diff --git a/import-layers/meta-virtualization/classes/go-osarchmap.bbclass b/import-layers/meta-virtualization/classes/go-osarchmap.bbclass
deleted file mode 100644
index 4e00c7b..0000000
--- a/import-layers/meta-virtualization/classes/go-osarchmap.bbclass
+++ /dev/null
@@ -1,38 +0,0 @@
-BUILD_GOOS = "${@go_map_os(d.getVar('BUILD_OS', True), d)}"
-BUILD_GOARCH = "${@go_map_arch(d.getVar('BUILD_ARCH', True), d)}"
-BUILD_GOTUPLE = "${BUILD_GOOS}_${BUILD_GOARCH}"
-HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS', True), d)}"
-HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH', True), d)}"
-HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH', True), d.getVar('TUNE_FEATURES', True), d)}"
-HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"
-TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS', True), d)}"
-TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH', True), d)}"
-TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEATURES', True), d)}"
-TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
-GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE',True) == d.getVar('HOST_GOTUPLE',True)]}"
-
-def go_map_arch(a, d):
-    import re
-    if re.match('i.86', a):
-        return '386'
-    elif a == 'x86_64':
-        return 'amd64'
-    elif re.match('arm.*', a):
-        return 'arm'
-    elif re.match('aarch64.*', a):
-        return 'arm64'
-    elif re.match('p(pc|owerpc)(|64)', a):
-        return 'powerpc'
-    else:
-        bb.error("cannot map '%s' to a Go architecture" % a)
-
-def go_map_arm(a, f, d):
-    import re
-    if re.match('arm.*', a) and re.match('arm.*7.*', f):
-        return '7'
-    return ''
-
-def go_map_os(o, d):
-    if o.startswith('linux'):
-        return 'linux'
-    return o
diff --git a/import-layers/meta-virtualization/conf/layer.conf b/import-layers/meta-virtualization/conf/layer.conf
index f5c1b1e..be08a98 100644
--- a/import-layers/meta-virtualization/conf/layer.conf
+++ b/import-layers/meta-virtualization/conf/layer.conf
@@ -19,3 +19,6 @@
 
 # Override security flags
 require conf/distro/include/virt_security_flags.inc
+
+PREFERRED_PROVIDER_virtual/runc ?= "runc-docker"
+PREFERRED_PROVIDER_virtual/containerd ?= "containerd-docker"
diff --git a/import-layers/meta-virtualization/recipes-containers/cgroup-lite/cgroup-lite_1.11.bb b/import-layers/meta-virtualization/recipes-containers/cgroup-lite/cgroup-lite_1.11.bb
index b3af6f4..065d0ea 100644
--- a/import-layers/meta-virtualization/recipes-containers/cgroup-lite/cgroup-lite_1.11.bb
+++ b/import-layers/meta-virtualization/recipes-containers/cgroup-lite/cgroup-lite_1.11.bb
@@ -9,6 +9,7 @@
 SRC_URI[md5sum] = "b20976194ee8fdb61e6b55281fb6ead4"
 SRC_URI[sha256sum] = "a79ab9ae6fb3ff3ce0aa5539b055c0379eaffdc6c5f003af4010fcea683c1a45"
 
+inherit allarch
 inherit update-rc.d
 
 INITSCRIPT_NAME = "cgroups-init"
diff --git a/import-layers/meta-virtualization/recipes-containers/containerd/containerd-docker_git.bb b/import-layers/meta-virtualization/recipes-containers/containerd/containerd-docker_git.bb
new file mode 100644
index 0000000..f6dcaec
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/containerd/containerd-docker_git.bb
@@ -0,0 +1,10 @@
+include containerd.inc
+
+SRCREV = "03e5862ec0d8d3b3f750e19fca3ee367e13c090e"
+SRC_URI = "\
+	git://github.com/docker/containerd.git;branch=docker-1.13.x \
+	"
+CONTAINERD_VERSION = "0.2.3"
+
+PROVIDES += "virtual/containerd"
+RPROVIDES_${PN} = "virtual/containerd"
diff --git a/import-layers/meta-virtualization/recipes-containers/containerd/containerd-opencontainers_git.bb b/import-layers/meta-virtualization/recipes-containers/containerd/containerd-opencontainers_git.bb
new file mode 100644
index 0000000..37f8547
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/containerd/containerd-opencontainers_git.bb
@@ -0,0 +1,9 @@
+include containerd.inc
+
+SRCREV = "0ac3cd1be170d180b2baed755e8f0da547ceb267"
+SRC_URI = "git://github.com/docker/containerd.git;nobranch=1 \
+          "
+CONTAINERD_VERSION = "0.2.2"
+
+PROVIDES += "virtual/containerd"
+RPROVIDES_${PN} = "virtual/containerd"
diff --git a/import-layers/meta-virtualization/recipes-containers/containerd/containerd.inc b/import-layers/meta-virtualization/recipes-containers/containerd/containerd.inc
new file mode 100644
index 0000000..b143979
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/containerd/containerd.inc
@@ -0,0 +1,85 @@
+HOMEPAGE = "https://github.com/docker/containerd"
+SUMMARY = "containerd is a daemon to control runC"
+DESCRIPTION = "containerd is a daemon to control runC, built for performance and density. \
+               containerd leverages runC's advanced features such as seccomp and user namespace \
+               support as well as checkpoint and restore for cloning and live migration of containers."
+
+# Apache-2.0 for containerd
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7"
+
+S = "${WORKDIR}/git"
+
+PV = "${CONTAINERD_VERSION}+git${SRCREV}"
+
+inherit go
+
+RRECOMMENDS_${PN} = "lxc docker"
+CONTAINERD_PKG="github.com/docker/containerd"
+
+do_configure[noexec] = "1"
+
+do_compile() {
+	export GOARCH="${TARGET_ARCH}"
+	# supported amd64, 386, arm arm64
+	if [ "${TARGET_ARCH}" = "x86_64" ]; then
+		export GOARCH="amd64"
+	fi
+	if [ "${TARGET_ARCH}" = "aarch64" ]; then
+		export GOARCH="arm64"
+	fi
+	if [ "${TARGET_ARCH}" = "i586" ]; then
+		export GOARCH="386"
+	fi
+
+	# Set GOPATH. See 'PACKAGERS.md'. Don't rely on
+	# docker to download its dependencies but rather
+	# use dependencies packaged independently.
+	cd ${S}
+	rm -rf .gopath
+	mkdir -p .gopath/src/"$(dirname "${CONTAINERD_PKG}")"
+	ln -sf ../../../.. .gopath/src/"${CONTAINERD_PKG}"
+	export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
+	export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
+	cd -
+
+	# Pass the needed cflags/ldflags so that cgo
+	# can find the needed headers files and libraries
+	export CGO_ENABLED="1"
+	export CFLAGS=""
+	export LDFLAGS=""
+	export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+	export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+	export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+	export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+
+        oe_runmake static
+}
+
+# Note: disabled for now, since docker is launching containerd
+# inherit systemd
+# SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
+# SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','containerd.service','',d)}"
+
+do_install() {
+	mkdir -p ${D}/${bindir}
+
+	cp ${S}/bin/containerd ${D}/${bindir}/containerd
+	cp ${S}/bin/containerd-shim ${D}/${bindir}/containerd-shim
+        cp ${S}/bin/ctr ${D}/${bindir}/containerd-ctr
+	
+	ln -sf containerd ${D}/${bindir}/docker-containerd
+	ln -sf containerd-shim ${D}/${bindir}/docker-containerd-shim
+	ln -sf containerd-ctr ${D}/${bindir}/docker-containerd-ctr
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		install -d ${D}${systemd_unitdir}/system
+		install -m 644 ${S}/hack/containerd.service ${D}/${systemd_unitdir}/system
+	        # adjust from /usr/local/bin to /usr/bin/
+		sed -e "s:/usr/local/bin/containerd:${bindir}/docker-containerd -l \"unix\:///var/run/docker/libcontainerd/docker-containerd.sock\":g" -i ${D}/${systemd_unitdir}/system/containerd.service
+	fi
+}
+
+FILES_${PN} += "${systemd_system_unitdir}/*"
+
+INHIBIT_PACKAGE_STRIP = "1"
diff --git a/import-layers/meta-virtualization/recipes-containers/containerd/containerd_git.bb b/import-layers/meta-virtualization/recipes-containers/containerd/containerd_git.bb
deleted file mode 100644
index c2000b1..0000000
--- a/import-layers/meta-virtualization/recipes-containers/containerd/containerd_git.bb
+++ /dev/null
@@ -1,91 +0,0 @@
-HOMEPAGE = "https://github.com/docker/containerd"
-SUMMARY = "containerd is a daemon to control runC"
-DESCRIPTION = "containerd is a daemon to control runC, built for performance and density. \
-               containerd leverages runC's advanced features such as seccomp and user namespace \
-               support as well as checkpoint and restore for cloning and live migration of containers."
-
-SRCREV = "0ac3cd1be170d180b2baed755e8f0da547ceb267"
-SRC_URI = "\
-	git://github.com/docker/containerd.git;nobranch=1 \
-	"
-
-# Apache-2.0 for containerd
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7"
-
-S = "${WORKDIR}/git"
-
-CONTAINERD_VERSION = "0.2.2"
-PV = "${CONTAINERD_VERSION}+git${SRCREV}"
-
-DEPENDS = "go-cross \
-    "
-
-RRECOMMENDS_${PN} = "lxc docker"
-CONTAINERD_PKG="github.com/docker/containerd"
-
-do_configure[noexec] = "1"
-
-do_compile() {
-	export GOARCH="${TARGET_ARCH}"
-	# supported amd64, 386, arm arm64
-	if [ "${TARGET_ARCH}" = "x86_64" ]; then
-		export GOARCH="amd64"
-	fi
-	if [ "${TARGET_ARCH}" = "aarch64" ]; then
-		export GOARCH="arm64"
-	fi
-	if [ "${TARGET_ARCH}" = "i586" ]; then
-		export GOARCH="386"
-	fi
-
-	# Set GOPATH. See 'PACKAGERS.md'. Don't rely on
-	# docker to download its dependencies but rather
-	# use dependencies packaged independently.
-	cd ${S}
-	rm -rf .gopath
-	mkdir -p .gopath/src/"$(dirname "${CONTAINERD_PKG}")"
-	ln -sf ../../../.. .gopath/src/"${CONTAINERD_PKG}"
-	export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
-	cd -
-
-	# Pass the needed cflags/ldflags so that cgo
-	# can find the needed headers files and libraries
-	export CGO_ENABLED="1"
-	export CFLAGS=""
-	export LDFLAGS=""
-	export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
-	export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
-	export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
-	export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
-
-        oe_runmake static
-}
-
-# Note: disabled for now, since docker is launching containerd
-# inherit systemd
-# SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
-# SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','containerd.service','',d)}"
-
-do_install() {
-	mkdir -p ${D}/${bindir}
-
-	cp ${S}/bin/containerd ${D}/${bindir}/containerd
-	cp ${S}/bin/containerd-shim ${D}/${bindir}/containerd-shim
-        cp ${S}/bin/ctr ${D}/${bindir}/containerd-ctr
-	
-	ln -sf containerd ${D}/${bindir}/docker-containerd
-	ln -sf containerd-shim ${D}/${bindir}/docker-containerd-shim
-	ln -sf containerd-ctr ${D}/${bindir}/docker-containerd-ctr
-
-	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-		install -d ${D}${systemd_unitdir}/system
-		install -m 644 ${S}/hack/containerd.service ${D}/${systemd_unitdir}/system
-	        # adjust from /usr/local/bin to /usr/bin/
-		sed -e "s:/usr/local/bin/containerd:${bindir}/docker-containerd -l \"unix\:///var/run/docker/libcontainerd/docker-containerd.sock\":g" -i ${D}/${systemd_unitdir}/system/containerd.service
-	fi
-}
-
-FILES_${PN} += "/lib/systemd/system/*"
-
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/import-layers/meta-virtualization/recipes-containers/criu/criu_git.bb b/import-layers/meta-virtualization/recipes-containers/criu/criu_git.bb
index dc0bdbe..21dee2b 100644
--- a/import-layers/meta-virtualization/recipes-containers/criu/criu_git.bb
+++ b/import-layers/meta-virtualization/recipes-containers/criu/criu_git.bb
@@ -22,11 +22,12 @@
            file://0002-criu-Skip-documentation-install.patch \
            file://0001-criu-Change-libraries-install-directory.patch \
            ${@bb.utils.contains('PACKAGECONFIG', 'selinux', '', 'file://disable-selinux.patch', d)} \
+           file://lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \
           "
 
 COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
 
-DEPENDS += "libnl libcap protobuf-c-native protobuf-c"
+DEPENDS += "libnl libcap protobuf-c-native protobuf-c util-linux-native"
 
 S = "${WORKDIR}/git"
 
@@ -67,6 +68,7 @@
 }
 
 do_install () {
+    export INSTALL_LIB="${libdir}/${PYTHON_DIR}/site-packages"
     oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" install
 }
 
diff --git a/import-layers/meta-virtualization/recipes-containers/criu/files/disable-selinux.patch b/import-layers/meta-virtualization/recipes-containers/criu/files/disable-selinux.patch
index da881dd..5d5d035 100644
--- a/import-layers/meta-virtualization/recipes-containers/criu/files/disable-selinux.patch
+++ b/import-layers/meta-virtualization/recipes-containers/criu/files/disable-selinux.patch
@@ -1,3 +1,8 @@
+From bd2eeaddfc1f12f87184d870cc9a1adde1cf0b10 Mon Sep 17 00:00:00 2001
+From: Mark Asselstine <mark.asselstine@windriver.com>
+Date: Mon, 24 Apr 2017 13:08:48 -0400
+Subject: [PATCH] criu/Makefile.config: explicitly remove selinux support
+
 Upstream-Status: Inappropriate [disable feature]
 
 It shows warning when build crius if libselinux has been built already:
@@ -7,20 +12,28 @@
 Apply this patch to disable selinux support when 'selinux' is not in PACKAGECONF.
 
 Signed-off-by: Kai Kang <kai.kang@windriver.com>
+[MA: Context updated to apply against criu v2.5]
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ criu/Makefile.config | 5 -----
+ 1 file changed, 5 deletions(-)
 
-diff --git a/Makefile.config b/Makefile.config
-index ce4b8d8..3ac2780 100644
---- a/Makefile.config
-+++ b/Makefile.config
-@@ -8,11 +8,6 @@ ifeq ($(call try-cc,$(LIBBSD_DEV_TEST),-lbsd),y)
- 	DEFINES += -DCONFIG_HAS_LIBBSD
+diff --git a/criu/Makefile.config b/criu/Makefile.config
+index f531b3b..37216f8 100644
+--- a/criu/Makefile.config
++++ b/criu/Makefile.config
+@@ -7,11 +7,6 @@ ifeq ($(call try-cc,$(FEATURE_TEST_LIBBSD_DEV),-lbsd),true)
+         FEATURE_DEFINES	+= -DCONFIG_HAS_LIBBSD
  endif
  
 -ifeq ($(call pkg-config-check,libselinux),y)
--	LIBS := -lselinux $(LIBS)
--	DEFINES += -DCONFIG_HAS_SELINUX
+-        LIBS		+= -lselinux
+-        FEATURE_DEFINES	+= -DCONFIG_HAS_SELINUX
 -endif
 -
- $(CONFIG): scripts/utilities.mak scripts/feature-tests.mak include/config-base.h
- 	$(E) "  GEN     " $@
- 	$(Q) @echo '#ifndef __CR_CONFIG_H__' > $@
+ export DEFINES += $(FEATURE_DEFINES)
+ export CFLAGS += $(FEATURE_DEFINES)
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/meta-virtualization/recipes-containers/criu/files/lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch b/import-layers/meta-virtualization/recipes-containers/criu/files/lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch
new file mode 100644
index 0000000..8bda8c4
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/criu/files/lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch
@@ -0,0 +1,30 @@
+From 2e0c5c66786016f6443da2c1ff15ad77f018ec9b Mon Sep 17 00:00:00 2001
+From: Mark Asselstine <mark.asselstine@windriver.com>
+Date: Mon, 24 Apr 2017 16:12:05 -0400
+Subject: [PATCH] lib/Makefile: overwrite install-lib, to allow multiarch
+
+I am not sure why Yocto installs python modules in arch specific
+/usr/libXX directories but it does. Allow the recipe to pass this via
+INSTALL_LIB.
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ lib/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index f1c0821..c714d12 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -56,7 +56,7 @@ install: lib-c lib-py ../crit/crit c/criu.pc.in
+ 	$(Q) sed -e 's,@version@,$(CRIU_VERSION),' -e 's,@libdir@,$(LIBDIR),' -e 's,@includedir@,$(dir $(INCLUDEDIR)),' c/criu.pc.in > c/criu.pc
+ 	$(Q) install -m 644 c/criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig
+ 	$(E) "  INSTALL " crit
+-	$(Q) python ../scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX) --record $(CRIT_SETUP_FILES)
++	$(Q) python ../scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX) --record $(CRIT_SETUP_FILES) --install-lib=$(INSTALL_LIB)
+ .PHONY: install
+ 
+ uninstall:
+-- 
+2.7.4
+
diff --git a/import-layers/meta-virtualization/recipes-containers/docker-distribution/docker-distribution_git.bb b/import-layers/meta-virtualization/recipes-containers/docker-distribution/docker-distribution_git.bb
new file mode 100644
index 0000000..08b6d70
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/docker-distribution/docker-distribution_git.bb
@@ -0,0 +1,64 @@
+HOMEPAGE = "http://github.com/docker/distribution"
+SUMMARY = "The Docker toolset to pack, ship, store, and deliver content"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d2794c0df5b907fdace235a619d80314"
+
+SRCREV_distribution="0810eba2adf048b77621472991211924d9ec31c5"
+SRC_URI = "git://github.com/docker/distribution.git;branch=master;name=distribution;destsuffix=git/src/github.com/docker/distribution \
+           file://docker-registry.service \
+          "
+
+PACKAGES =+ "docker-registry"
+
+PV = "v2.6.0-rc+git${SRCPV}"
+S = "${WORKDIR}/git/src/github.com/docker/distribution"
+
+inherit goarch
+inherit go
+
+# This disables seccomp and apparmor, which are on by default in the
+# go package. 
+EXTRA_OEMAKE="BUILDTAGS=''"
+
+do_compile() {
+	export GOARCH="${TARGET_GOARCH}"
+	export GOPATH="${WORKDIR}/git/"
+	export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
+	# Pass the needed cflags/ldflags so that cgo
+	# can find the needed headers files and libraries
+	export CGO_ENABLED="1"
+	export CFLAGS=""
+	export LDFLAGS=""
+	export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+	export GO_GCFLAGS=""
+	export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+
+	oe_runmake binaries
+}
+
+do_install() {
+	install -d ${D}/${sbindir}
+	install ${S}/bin/registry ${D}/${sbindir}
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+	    install -d ${D}${systemd_unitdir}/system
+	    install -m 644 ${WORKDIR}/docker-registry.service ${D}/${systemd_unitdir}/system
+	fi
+
+	install -d ${D}/${sysconfdir}/docker-distribution/registry/
+	install ${S}/cmd/registry/config-example.yml ${D}/${sysconfdir}/docker-distribution/registry/config.yml
+
+	# storage for the registry containers
+	install -d ${D}/${localstatedir}/lib/registry/
+}
+
+INSANE_SKIP_${PN} += "ldflags already-stripped"
+INSANE_SKIP_docker-registry += "ldflags already-stripped"
+
+FILES_docker-registry = "${sbindir}/*"
+FILES_docker-registry += "${systemd_unitdir}/system/docker-registry.service"
+FILES_docker-registry += "${sysconfdir}/docker-distribution/*"
+FILES_docker-registry += "${localstatedir}/lib/registry/"
+
+SYSTEMD_SERVICE_docker-registry = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker-registry.service','',d)}"
+SYSTEMD_AUTO_ENABLE_docker-registry = "enable"
diff --git a/import-layers/meta-virtualization/recipes-containers/docker-distribution/files/docker-registry.service b/import-layers/meta-virtualization/recipes-containers/docker-distribution/files/docker-registry.service
new file mode 100644
index 0000000..15460c7a
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/docker-distribution/files/docker-registry.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=v2 Registry server for Docker
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/registry serve /etc/docker-distribution/registry/config.yml
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-virtualization/recipes-containers/docker-registry/docker-registry_git.bb b/import-layers/meta-virtualization/recipes-containers/docker-registry/docker-registry_git.bb
deleted file mode 100644
index e94e985..0000000
--- a/import-layers/meta-virtualization/recipes-containers/docker-registry/docker-registry_git.bb
+++ /dev/null
@@ -1,93 +0,0 @@
-HOMEPAGE = "https://github.com/docker/docker-registry"
-SUMMARY = "Registry server for Docker"
-DESCRIPTION = "\
- This is the classic python docker-registry. \
- . \
- hosting/delivering of repositories and images \
- "
-
-SRCREV = "fd8c0c114985547b69088e0f1526e58bfe2ff914"
-SRC_URI = "\
-	git://github.com/docker/docker-registry.git \
-	file://docker-registry.conf \
-	file://docker-registry.service \
-	file://config.yml \
-	file://change_sqlalchemy_rqt.patch \
-	"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=35e8e5305c1b7b4a5761f9de5d44e5f4"
-
-S = "${WORKDIR}/git"
-
-PV = "0.9.1+git${SRCREV}"
-
-RDEPENDS_${PN} += "\
-  docker \
-  gunicorn (>= 19.1.1) \
-  python-pip \
-  python-distribute \
-  python-m2crypto (>= 0.22.3) \
-  python-pyyaml (>= 3.11) \
-  python-flask (>= 0.10.1) \
-  python-gevent (>= 1.0.1) \
-  python-requests \
-  python-sqlalchemy (>= 0.9.4) \
-  python-blinker (>= 1.3) \
-  python-backports-lzma (>= 0.0.3) \
-  python-flask-cors (>= 1.10.3) \
-  python-bugsnag (>= 2.0.2) \
-  python-docker-registry-core (>= 2.0.3) \
-  python-newrelic (>= 2.22.0.19) \
-  python-itsdangerous (>= 0.21) \
-  python-jinja2 (>= 2.4) \
-  python-werkzeug (>= 0.7) \
-  python-simplejson (>= 3.6.2) \
-  python-redis (>= 2.10.3) \
-  python-boto (>= 2.34.0) \
-  python-webob \
-  "
-# OFFICIAL REQ:
-# docker-registry-core>=2,<3
-# blinker==1.3
-# backports.lzma==0.0.3,!=0.0.4
-
-# Flask==0.10.1
-# gevent==1.0.1
-# gunicorn==19.1.1
-# PyYAML==3.11
-# requests==2.3.0
-# M2Crypto==0.22.3
-# sqlalchemy==0.9.4
-# setuptools==5.8
-# 
-# [bugsnag]
-# bugsnag>=2.0,<2.1
-# 
-# [cors]
-# Flask-cors>=1.8,<2.0
-# 
-# [newrelic]
-# newrelic>=2.22,<2.23
-
-
-inherit setuptools systemd
-
-SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
-SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker-registry.service','',d)}"
-
-do_install_append() {
-	mkdir -p ${D}/etc/default/
-	cp ${WORKDIR}/docker-registry.conf ${D}/etc/default/docker-registry
-
-	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-		install -d ${D}${systemd_unitdir}/system
-		install -m 644 ${WORKDIR}/docker-registry.service ${D}/${systemd_unitdir}/system
-		sed -i "s|#WORKDIR#|${PYTHON_SITEPACKAGES_DIR}/docker_registry|" ${D}/${systemd_unitdir}/system/docker-registry.service
-	fi
-	# based on config_mirror.yml - uses /var/docker-registry instead of /tmp for files
-	install ${WORKDIR}/config.yml ${D}/etc/docker-registry.yml
-	mkdir -p ${D}/var/docker-registry
-}
-
-FILES_${PN} += "/etc/default /var/docker-registry /etc/ /etc/default/volatiles"
diff --git a/import-layers/meta-virtualization/recipes-containers/docker-registry/files/change_sqlalchemy_rqt.patch b/import-layers/meta-virtualization/recipes-containers/docker-registry/files/change_sqlalchemy_rqt.patch
deleted file mode 100644
index 75cbd6d..0000000
--- a/import-layers/meta-virtualization/recipes-containers/docker-registry/files/change_sqlalchemy_rqt.patch
+++ /dev/null
@@ -1,13 +0,0 @@
----
- requirements/main.txt |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/requirements/main.txt
-+++ b/requirements/main.txt
-@@ -5,5 +5,5 @@
- PyYAML==3.11
- requests==2.3.0
- M2Crypto==0.22.3
--sqlalchemy==0.9.4
-+sqlalchemy>=0.9.4
- setuptools==5.8
diff --git a/import-layers/meta-virtualization/recipes-containers/docker-registry/files/config.yml b/import-layers/meta-virtualization/recipes-containers/docker-registry/files/config.yml
deleted file mode 100644
index 8b33766..0000000
--- a/import-layers/meta-virtualization/recipes-containers/docker-registry/files/config.yml
+++ /dev/null
@@ -1,228 +0,0 @@
-# All other flavors inherit the `common' config snippet
-common: &common
-    issue: '"docker-registry server"'
-    # Default log level is info
-    loglevel: _env:LOGLEVEL:info
-    # Enable debugging (additional informations in the output of the _ping endpoint)
-    debug: _env:DEBUG:false
-    # By default, the registry acts standalone (eg: doesn't query the index)
-    standalone: _env:STANDALONE:true
-    # The default endpoint to use (if NOT standalone) is index.docker.io
-    index_endpoint: _env:INDEX_ENDPOINT:https://index.docker.io
-    # Storage redirect is disabled
-    storage_redirect: _env:STORAGE_REDIRECT
-    # Token auth is enabled (if NOT standalone)
-    disable_token_auth: _env:DISABLE_TOKEN_AUTH
-    # No priv key
-    privileged_key: _env:PRIVILEGED_KEY
-    # No search backend
-    search_backend: _env:SEARCH_BACKEND
-    # SQLite search backend
-    sqlalchemy_index_database: _env:SQLALCHEMY_INDEX_DATABASE:sqlite:////var/docker-registry/docker-registry.db
-
-    # Mirroring is not enabled
-    mirroring:
-        source: _env:MIRROR_SOURCE # https://registry-1.docker.io
-        source_index: _env:MIRROR_SOURCE_INDEX # https://index.docker.io
-        tags_cache_ttl: _env:MIRROR_TAGS_CACHE_TTL:172800 # seconds
-
-    cache:
-        host: _env:CACHE_REDIS_HOST
-        port: _env:CACHE_REDIS_PORT
-        db: _env:CACHE_REDIS_DB:0
-        password: _env:CACHE_REDIS_PASSWORD
-
-    # Enabling LRU cache for small files
-    # This speeds up read/write on small files
-    # when using a remote storage backend (like S3).
-    cache_lru:
-        host: _env:CACHE_LRU_REDIS_HOST
-        port: _env:CACHE_LRU_REDIS_PORT
-        db: _env:CACHE_LRU_REDIS_DB:0
-        password: _env:CACHE_LRU_REDIS_PASSWORD
-
-    # Enabling these options makes the Registry send an email on each code Exception
-    email_exceptions:
-        smtp_host: _env:SMTP_HOST
-        smtp_port: _env:SMTP_PORT:25
-        smtp_login: _env:SMTP_LOGIN
-        smtp_password: _env:SMTP_PASSWORD
-        smtp_secure: _env:SMTP_SECURE:false
-        from_addr: _env:SMTP_FROM_ADDR:docker-registry@localdomain.local
-        to_addr: _env:SMTP_TO_ADDR:noise+dockerregistry@localdomain.local
-
-    # Enable bugsnag (set the API key)
-    bugsnag: _env:BUGSNAG
-
-    # CORS support is not enabled by default
-    cors:
-        origins: _env:CORS_ORIGINS
-        methods: _env:CORS_METHODS
-        headers: _env:CORS_HEADERS:[Content-Type]
-        expose_headers: _env:CORS_EXPOSE_HEADERS
-        supports_credentials: _env:CORS_SUPPORTS_CREDENTIALS
-        max_age: _env:CORS_MAX_AGE
-        send_wildcard: _env:CORS_SEND_WILDCARD
-        always_send: _env:CORS_ALWAYS_SEND
-        automatic_options: _env:CORS_AUTOMATIC_OPTIONS
-        vary_header: _env:CORS_VARY_HEADER
-        resources: _env:CORS_RESOURCES
-
-local: &local
-    <<: *common
-    storage: local
-    storage_path: _env:STORAGE_PATH:/var/docker-registry
-
-
-s3: &s3
-    <<: *common
-    storage: s3
-    s3_region: _env:AWS_REGION
-    s3_bucket: _env:AWS_BUCKET
-    boto_bucket: _env:AWS_BUCKET
-    storage_path: _env:STORAGE_PATH:/registry
-    s3_encrypt: _env:AWS_ENCRYPT:true
-    s3_secure: _env:AWS_SECURE:true
-    s3_access_key: _env:AWS_KEY
-    s3_secret_key: _env:AWS_SECRET
-    s3_use_sigv4: _env:AWS_USE_SIGV4
-    boto_host: _env:AWS_HOST
-    boto_port: _env:AWS_PORT
-    boto_calling_format: _env:AWS_CALLING_FORMAT
-
-cloudfronts3: &cloudfronts3
-    <<: *s3
-    cloudfront:
-        base: _env:CF_BASE_URL
-        keyid: _env:CF_KEYID
-        keysecret: _env:CF_KEYSECRET
-
-azureblob: &azureblob
-    <<: *common
-    storage: azureblob
-    azure_storage_account_name: _env:AZURE_STORAGE_ACCOUNT_NAME
-    azure_storage_account_key: _env:AZURE_STORAGE_ACCOUNT_KEY
-    azure_storage_container: _env:AZURE_STORAGE_CONTAINER:registry
-    azure_use_https: _env:AZURE_USE_HTTPS:true
-
-# Ceph Object Gateway Configuration
-# See http://ceph.com/docs/master/radosgw/ for details on installing this service.
-ceph-s3: &ceph-s3
-    <<: *common
-    storage: s3
-    s3_region: ~
-    s3_bucket: _env:AWS_BUCKET
-    s3_encrypt: _env:AWS_ENCRYPT:false
-    s3_secure: _env:AWS_SECURE:false
-    storage_path: _env:STORAGE_PATH:/registry
-    s3_access_key: _env:AWS_KEY
-    s3_secret_key: _env:AWS_SECRET
-    boto_bucket: _env:AWS_BUCKET
-    boto_host: _env:AWS_HOST
-    boto_port: _env:AWS_PORT
-    boto_debug: _env:AWS_DEBUG:0
-    boto_calling_format: _env:AWS_CALLING_FORMAT
-
-# Google Cloud Storage Configuration
-# See:
-# https://developers.google.com/storage/docs/reference/v1/getting-startedv1#keys
-# for details on access and secret keys.
-gcs:
-    <<: *common
-    storage: gcs
-    boto_bucket: _env:GCS_BUCKET
-    storage_path: _env:STORAGE_PATH:/registry
-    gs_secure: _env:GCS_SECURE:true
-    gs_access_key: _env:GCS_KEY
-    gs_secret_key: _env:GCS_SECRET
-    # OAuth 2.0 authentication with the storage.
-    # oauth2 can be set to true or false. If it is set to true, gs_access_key,
-    # gs_secret_key and gs_secure are not needed.
-    # Client ID and Client Secret must be set into OAUTH2_CLIENT_ID and
-    # OAUTH2_CLIENT_SECRET environment variables.
-    # See: https://developers.google.com/accounts/docs/OAuth2.
-    oauth2: _env:GCS_OAUTH2:false
-
-# This flavor is for storing images in Openstack Swift
-swift: &swift
-    <<: *common
-    storage: swift
-    storage_path: _env:STORAGE_PATH:/registry
-    # keystone authorization
-    swift_authurl: _env:OS_AUTH_URL
-    swift_container: _env:OS_CONTAINER
-    swift_user: _env:OS_USERNAME
-    swift_password: _env:OS_PASSWORD
-    swift_tenant_name: _env:OS_TENANT_NAME
-    swift_region_name: _env:OS_REGION_NAME
-
-# This flavor stores the images in Glance (to integrate with openstack)
-# See also: https://github.com/docker/openstack-docker
-glance: &glance
-    <<: *common
-    storage: glance
-    storage_alternate: _env:GLANCE_STORAGE_ALTERNATE:file
-    storage_path: _env:STORAGE_PATH:/var/docker-registry
-
-openstack:
-    <<: *glance
-
-# This flavor stores the images in Glance (to integrate with openstack)
-# and tags in Swift.
-glance-swift: &glance-swift
-    <<: *swift
-    storage: glance
-    storage_alternate: swift
-
-openstack-swift:
-    <<: *glance-swift
-
-elliptics:
-    <<: *common
-    storage: elliptics
-    elliptics_nodes: _env:ELLIPTICS_NODES
-    elliptics_wait_timeout: _env:ELLIPTICS_WAIT_TIMEOUT:60
-    elliptics_check_timeout: _env:ELLIPTICS_CHECK_TIMEOUT:60
-    elliptics_io_thread_num: _env:ELLIPTICS_IO_THREAD_NUM:2
-    elliptics_net_thread_num: _env:ELLIPTICS_NET_THREAD_NUM:2
-    elliptics_nonblocking_io_thread_num: _env:ELLIPTICS_NONBLOCKING_IO_THREAD_NUM:2
-    elliptics_groups: _env:ELLIPTICS_GROUPS
-    elliptics_verbosity: _env:ELLIPTICS_VERBOSITY:4
-    elliptics_logfile: _env:ELLIPTICS_LOGFILE:/dev/stderr
-    elliptics_addr_family: _env:ELLIPTICS_ADDR_FAMILY:2
-
-# This flavor stores the images in Aliyun OSS
-# See:
-# https://i.aliyun.com/access_key/
-# for details on access and secret keys.
-oss: &oss
-    <<: *common
-    storage: oss
-    storage_path: _env:STORAGE_PATH:/registry/
-    oss_host: _env:OSS_HOST
-    oss_bucket: _env:OSS_BUCKET
-    oss_accessid: _env:OSS_KEY
-    oss_accesskey: _env:OSS_SECRET
-
-
-
-# This is the default configuration when no flavor is specified
-dev: &dev
-    <<: *local
-    loglevel: _env:LOGLEVEL:debug
-    debug: _env:DEBUG:true
-    search_backend: _env:SEARCH_BACKEND:sqlalchemy
-
-# This flavor is used by unit tests
-test:
-    <<: *dev
-    index_endpoint: https://registry-stage.hub.docker.com
-    standalone: true
-    storage_path: _env:STORAGE_PATH:./tmp/test
-
-# To specify another flavor, set the environment variable SETTINGS_FLAVOR
-# $ export SETTINGS_FLAVOR=prod
-prod:
-    <<: *s3
-    storage_path: _env:STORAGE_PATH:/prod
-
diff --git a/import-layers/meta-virtualization/recipes-containers/docker-registry/files/docker-registry.conf b/import-layers/meta-virtualization/recipes-containers/docker-registry/files/docker-registry.conf
deleted file mode 100644
index 940ece1..0000000
--- a/import-layers/meta-virtualization/recipes-containers/docker-registry/files/docker-registry.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-# The Docker registry configuration file
-DOCKER_REGISTRY_CONFIG=/etc/docker-registry.yml
-
-# The configuration to use from DOCKER_REGISTRY_CONFIG file
-SETTINGS_FLAVOR=local
-
-# Address to bind the registry to
-REGISTRY_ADDRESS=0.0.0.0
-
-# Port to bind the registry to
-REGISTRY_PORT=5000
-
-# Number of workers to handle the connections
-GUNICORN_WORKERS=4
-
-STANDALONE=true
-
-MIRROR_SOURCE=https://registry-1.docker.io
-MIRROR_SOURCE_INDEX=https://index.docker.io
diff --git a/import-layers/meta-virtualization/recipes-containers/docker-registry/files/docker-registry.service b/import-layers/meta-virtualization/recipes-containers/docker-registry/files/docker-registry.service
deleted file mode 100644
index 4f4cfe7..0000000
--- a/import-layers/meta-virtualization/recipes-containers/docker-registry/files/docker-registry.service
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=Registry server for Docker
-After=docker.service
-Requires=docker.service
-
-[Service]
-Type=simple
-Environment=DOCKER_REGISTRY_CONFIG=/etc/docker-registry.yml
-EnvironmentFile=-/etc/default/docker-registry
-WorkingDirectory=#WORKDIR#
-ExecStart=/usr/bin/gunicorn --access-logfile /var/log/docker-registry-access.log --error-logfile /var/log/docker-registry-error.log --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b ${REGISTRY_ADDRESS}:${REGISTRY_PORT} -w ${GUNICORN_WORKERS} docker_registry.wsgi:application
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
diff --git a/import-layers/meta-virtualization/recipes-containers/docker/docker_git.bb b/import-layers/meta-virtualization/recipes-containers/docker/docker_git.bb
index 04dc76d..74170cb 100644
--- a/import-layers/meta-virtualization/recipes-containers/docker/docker_git.bb
+++ b/import-layers/meta-virtualization/recipes-containers/docker/docker_git.bb
@@ -18,12 +18,14 @@
  subtle and/or glaring issues. \
  "
 
-SRCREV = "7392c3b0ce0f9d3e918a321c66668c5d1ef4f689"
+SRCREV_docker = "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
+SRCREV_libnetwork="0f534354b813003a754606689722fe253101bc4e"
 SRC_URI = "\
-	git://github.com/docker/docker.git;nobranch=1 \
-	file://docker.service \
+	git://github.com/docker/docker.git;nobranch=1;name=docker \
+	git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=libnetwork \
 	file://docker.init \
 	file://hi.Dockerfile \
+	file://context-use-golang.org-x-net-pkg-until-we-move-to-go.patch \
 	"
 
 # Apache-2.0 for docker
@@ -32,11 +34,10 @@
 
 S = "${WORKDIR}/git"
 
-DOCKER_VERSION = "1.12.5"
-PV = "${DOCKER_VERSION}+git${SRCREV}"
+DOCKER_VERSION = "1.13.0"
+PV = "${DOCKER_VERSION}+git${SRCREV_docker}"
 
 DEPENDS = " \
-    go-cross \
     go-cli \
     go-pty \
     go-context \
@@ -50,45 +51,32 @@
     go-systemd \
     btrfs-tools \
     sqlite3 \
-    go-distribution-digest \
+    go-distribution \
+    compose-file \
+    go-connections \
+    notary \
+    grpc-go \
     "
 
-DEPENDS_append_class-target = "lvm2"
+PACKAGES =+ "${PN}-contrib"
+
+DEPENDS_append_class-target = " lvm2"
 RDEPENDS_${PN} = "curl aufs-util git util-linux iptables \
                   ${@bb.utils.contains('DISTRO_FEATURES','systemd','','cgroup-lite',d)} \
                  "
-RDEPENDS_${PN} += "containerd runc"
+RDEPENDS_${PN} += "virtual/containerd virtual/runc"
+
 RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat"
-RSUGGESTS_${PN} = "lxc docker-registry rt-tests"
+RSUGGESTS_${PN} = "lxc rt-tests"
 DOCKER_PKG="github.com/docker/docker"
 
+inherit systemd update-rc.d
+inherit go
+inherit goarch
+
 do_configure[noexec] = "1"
 
 do_compile() {
-	case "${TARGET_ARCH}" in
-		arm)
-			GOARCH=arm
-			case "${TUNE_PKGARCH}" in
-				cortexa*)
-					export GOARM=7
-				;;
-			esac
-		;;
-		aarch64)
-			GOARCH=arm64
-		;;
-		i586|i686)
-			GOARCH=386
-		;;
-		x86_64)
-			GOARCH=amd64
-		;;
-		*)
-			GOARCH="${TARGET_ARCH}"
-		;;
-	esac
-	export GOARCH
-
 	# Set GOPATH. See 'PACKAGERS.md'. Don't rely on
 	# docker to download its dependencies but rather
 	# use dependencies packaged independently.
@@ -96,6 +84,10 @@
 	rm -rf .gopath
 	mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")"
 	ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}"
+
+	mkdir -p .gopath/src/github.com/docker
+	ln -sf ../../../../../libnetwork .gopath/src/github.com/docker/libnetwork
+
 	export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
 	export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
 	cd -
@@ -113,42 +105,50 @@
 	# to build this:
 	DOCKER_GITCOMMIT="${SRCREV}" \
 	  ./hack/make.sh dynbinary
-}
 
-inherit systemd update-rc.d
+	# build the proxy
+	go build -o ${S}/docker-proxy github.com/docker/libnetwork/cmd/proxy
+}
 
 SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
 SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}"
 
+SYSTEMD_AUTO_ENABLE_${PN} = "enable"
+
 INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}"
 INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}"
-INITSCRIPT_PARAMS_${PN} = "defaults"
+INITSCRIPT_PARAMS_${PN} = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
 
 do_install() {
 	mkdir -p ${D}/${bindir}
 	cp ${S}/bundles/latest/dynbinary-client/docker ${D}/${bindir}/docker
 	cp ${S}/bundles/latest/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd
-	cp ${S}/bundles/latest/dynbinary-daemon/docker-proxy ${D}/${bindir}/docker-proxy
+	cp ${S}/docker-proxy ${D}/${bindir}/docker-proxy
 
 	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
 		install -d ${D}${systemd_unitdir}/system
 		install -m 644 ${S}/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system
 		# replaces one copied from above with one that uses the local registry for a mirror
-		install -m 644 ${WORKDIR}/docker.service ${D}/${systemd_unitdir}/system
+		install -m 644 ${S}/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system
 	else
 		install -d ${D}${sysconfdir}/init.d
 		install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
 	fi
 
-	mkdir -p ${D}/usr/share/docker/
-	cp ${WORKDIR}/hi.Dockerfile ${D}/usr/share/docker/
+	mkdir -p ${D}${datadir}/docker/
+	cp ${WORKDIR}/hi.Dockerfile ${D}${datadir}/docker/
+	install -m 0755 ${S}/contrib/check-config.sh ${D}${datadir}/docker/
 }
 
 inherit useradd
 USERADD_PACKAGES = "${PN}"
 GROUPADD_PARAM_${PN} = "-r docker"
 
-FILES_${PN} += "/lib/systemd/system/*"
+FILES_${PN} += "${systemd_unitdir}/system/*"
+
+FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
+RDEPENDS_${PN}-contrib += "bash"
 
 # DO NOT STRIP docker
 INHIBIT_PACKAGE_STRIP = "1"
+INSANE_SKIP_${PN} += "ldflags"
diff --git a/import-layers/meta-virtualization/recipes-containers/docker/files/context-use-golang.org-x-net-pkg-until-we-move-to-go.patch b/import-layers/meta-virtualization/recipes-containers/docker/files/context-use-golang.org-x-net-pkg-until-we-move-to-go.patch
new file mode 100644
index 0000000..240b744
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/docker/files/context-use-golang.org-x-net-pkg-until-we-move-to-go.patch
@@ -0,0 +1,116 @@
+From de69555afaf05efcdeea7b7c20c6f7b12f3e1bac Mon Sep 17 00:00:00 2001
+From: Mark Asselstine <mark.asselstine@windriver.com>
+Date: Fri, 20 Jan 2017 11:58:44 -0500
+Subject: [PATCH] context: use golang.org/x/net pkg until we move to go 1.7
+
+In go 1.6 the context.go is not yet integrated and as such we will get
+build errors like:
+
+walwrap.go:4:2: cannot find package "context" in any of:
+...
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ client/README.md                                                        | 2 +-
+ client/client.go                                                        | 2 +-
+ daemon/info_unix.go                                                     | 2 +-
+ integration-cli/docker_api_attach_test.go                               | 2 +-
+ integration-cli/docker_cli_save_load_unix_test.go                       | 2 +-
+ vendor/github.com/docker/swarmkit/manager/logbroker/subscription.go     | 2 +-
+ vendor/github.com/docker/swarmkit/manager/state/raft/storage/walwrap.go | 2 +-
+ 7 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/client/README.md b/client/README.md
+index 059dfb3..9de54aa 100644
+--- a/client/README.md
++++ b/client/README.md
+@@ -8,7 +8,7 @@ For example, to list running containers (the equivalent of `docker ps`):
+ package main
+ 
+ import (
+-	"context"
++	"golang.org/x/net/context"
+ 	"fmt"
+ 
+ 	"github.com/docker/docker/api/types"
+diff --git a/client/client.go b/client/client.go
+index a9bdab6..95933af 100644
+--- a/client/client.go
++++ b/client/client.go
+@@ -19,7 +19,7 @@ For example, to list running containers (the equivalent of "docker ps"):
+ 	package main
+ 
+ 	import (
+-		"context"
++		"golang.org/x/net/context"
+ 		"fmt"
+ 
+ 		"github.com/docker/docker/api/types"
+diff --git a/daemon/info_unix.go b/daemon/info_unix.go
+index 9c41c0e..57f8a7b 100644
+--- a/daemon/info_unix.go
++++ b/daemon/info_unix.go
+@@ -3,7 +3,7 @@
+ package daemon
+ 
+ import (
+-	"context"
++	"golang.org/x/net/context"
+ 	"os/exec"
+ 	"strings"
+ 
+diff --git a/integration-cli/docker_api_attach_test.go b/integration-cli/docker_api_attach_test.go
+index d43bf3a..e5802a7 100644
+--- a/integration-cli/docker_api_attach_test.go
++++ b/integration-cli/docker_api_attach_test.go
+@@ -3,7 +3,7 @@ package main
+ import (
+ 	"bufio"
+ 	"bytes"
+-	"context"
++	"golang.org/x/net/context"
+ 	"io"
+ 	"net"
+ 	"net/http"
+diff --git a/integration-cli/docker_cli_save_load_unix_test.go b/integration-cli/docker_cli_save_load_unix_test.go
+index 22445e5..d0afc8c 100644
+--- a/integration-cli/docker_cli_save_load_unix_test.go
++++ b/integration-cli/docker_cli_save_load_unix_test.go
+@@ -3,7 +3,7 @@
+ package main
+ 
+ import (
+-	"context"
++	"golang.org/x/net/context"
+ 	"fmt"
+ 	"io/ioutil"
+ 	"os"
+diff --git a/vendor/github.com/docker/swarmkit/manager/logbroker/subscription.go b/vendor/github.com/docker/swarmkit/manager/logbroker/subscription.go
+index 6b3295a..cbfcf7e 100644
+--- a/vendor/github.com/docker/swarmkit/manager/logbroker/subscription.go
++++ b/vendor/github.com/docker/swarmkit/manager/logbroker/subscription.go
+@@ -1,7 +1,7 @@
+ package logbroker
+ 
+ import (
+-	"context"
++	"golang.org/x/net/context"
+ 	"fmt"
+ 	"strings"
+ 	"sync"
+diff --git a/vendor/github.com/docker/swarmkit/manager/state/raft/storage/walwrap.go b/vendor/github.com/docker/swarmkit/manager/state/raft/storage/walwrap.go
+index 5a6c71a..efe5921 100644
+--- a/vendor/github.com/docker/swarmkit/manager/state/raft/storage/walwrap.go
++++ b/vendor/github.com/docker/swarmkit/manager/state/raft/storage/walwrap.go
+@@ -1,7 +1,7 @@
+ package storage
+ 
+ import (
+-	"context"
++	"golang.org/x/net/context"
+ 	"io"
+ 	"io/ioutil"
+ 	"os"
+-- 
+2.7.4
+
diff --git a/import-layers/meta-virtualization/recipes-containers/docker/files/docker-registry.service b/import-layers/meta-virtualization/recipes-containers/docker/files/docker-registry.service
new file mode 100644
index 0000000..7b4bc46
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/docker/files/docker-registry.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=docker private registry service
+After=docker.service
+
+[Service]
+ExecStartPre=-/usr/bin/docker kill registry
+ExecStartPre=-/usr/bin/docker rm registry
+ExecStart=/usr/bin/docker run --name registry -v /mirror/registry:/tmp/ -p 5000:5000 \
+                          -e "STANDALONE=true" \
+                          -e "MIRROR_SOURCE=https://registry-1.docker.io" \
+                          -e "MIRROR_SOURCE_INDEX=https://index.docker.io" \
+                          -e "SETTINGS_FLAVOR=local" \
+                          registry
+ExecStop=-/usr/bin/docker stop registry
+Restart=always
+RestartSec=10s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-virtualization/recipes-containers/docker/files/docker.init b/import-layers/meta-virtualization/recipes-containers/docker/files/docker.init
index 2e8eb9e..9c01c75 100644
--- a/import-layers/meta-virtualization/recipes-containers/docker/files/docker.init
+++ b/import-layers/meta-virtualization/recipes-containers/docker/files/docker.init
@@ -28,7 +28,6 @@
 pidfile="/var/run/$prog.pid"
 lockfile="/var/lock/subsys/$prog"
 logfile="/var/log/$prog"
-other_args="--registry-mirror=http://localhost:5000 --insecure-registry=http://localhost:5000 --raw-logs"
 
 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
 
@@ -39,8 +38,8 @@
 
     if ! [ -f $pidfile ]; then
         printf "Starting $prog:\t"
-        echo -e "\n$(date)\n" >> $logfile
-        "$unshare" -m -- $exec daemon $other_args &>> $logfile &
+        echo "\n$(date)\n" >> $logfile
+        "$unshare" -m -- $exec -d $other_args &>> $logfile &
         pid=$!
         touch $lockfile
         # wait up to 10 seconds for the pidfile to exist.  see
diff --git a/import-layers/meta-virtualization/recipes-containers/go-digest/go-digest_git.bb b/import-layers/meta-virtualization/recipes-containers/go-digest/go-digest_git.bb
new file mode 100644
index 0000000..a2f8cd6
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/go-digest/go-digest_git.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "Common digest package used across the container ecosystem."
+HOMEPAGE = "https://github.com/opencontainers/go-digest.git"
+SECTION = "devel/go"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE.code;md5=9cd86830b557232ce55e2a6b47387471"
+
+SRCNAME = "go-digest"
+
+PKG_NAME = "github.com/opencontainers/${SRCNAME}"
+SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "b6234c321f263c503268e3b205f3d9755f9d14ed"
+PV = "v1.0.0-rc0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE.code ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "go_digest_file_sysroot_preprocess"
+
+go_digest_file_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
+
+CLEANBROKEN = "1"
\ No newline at end of file
diff --git a/import-layers/meta-virtualization/recipes-containers/go-errors/go-errors_git.bb b/import-layers/meta-virtualization/recipes-containers/go-errors/go-errors_git.bb
new file mode 100644
index 0000000..3bb74a7
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/go-errors/go-errors_git.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "Simple error handling primitives"
+HOMEPAGE = "https://github.com/pkg/errors"
+SECTION = "devel/go"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=6fe682a02df52c6653f33bd0f7126b5a"
+
+SRCNAME = "errors"
+
+PKG_NAME = "github.com/pkg/${SRCNAME}"
+SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "248dadf4e9068a0b3e79f02ed0a610d935de5302"
+PV = "v0.8.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go" -not -path "*/.tool/*"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "go_errors_file_sysroot_preprocess"
+
+go_errors_file_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
+
+CLEANBROKEN = "1"
\ No newline at end of file
diff --git a/import-layers/meta-virtualization/recipes-containers/go-spf13-cobra/spf13-cobra_git.bb b/import-layers/meta-virtualization/recipes-containers/go-spf13-cobra/spf13-cobra_git.bb
new file mode 100644
index 0000000..e942e4e
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/go-spf13-cobra/spf13-cobra_git.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "A Commander for modern Go CLI interactions"
+HOMEPAGE = "https://github.com/spf13/cobra"
+SECTION = "devel/go"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE.txt;md5=920d76114a32b0fb75b3f2718c5a91be"
+
+SRCNAME = "cobra"
+
+PKG_NAME = "github.com/spf13/${SRCNAME}"
+SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "b5d8e8f46a2f829f755b6e33b454e25c61c935e1"
+PV = "v0.0.1+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go" -not -path "*/.tool/*"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE.txt ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "cobra_file_sysroot_preprocess"
+
+cobra_file_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
+
+CLEANBROKEN = "1"
\ No newline at end of file
diff --git a/import-layers/meta-virtualization/recipes-containers/go-spf13-pflag/spf13-pflag_git.bb b/import-layers/meta-virtualization/recipes-containers/go-spf13-pflag/spf13-pflag_git.bb
new file mode 100644
index 0000000..2fbcb43
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/go-spf13-pflag/spf13-pflag_git.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags."
+HOMEPAGE = "https://github.com/spf13/pflag"
+SECTION = "devel/go"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=1e8b7dc8b906737639131047a590f21d"
+
+SRCNAME = "pflag"
+
+PKG_NAME = "github.com/spf13/${SRCNAME}"
+SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "9ff6c6923cfffbcd502984b8e0c80539a94968b7"
+PV = "v1.0.0-rc4+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go" -not -path "*/.tool/*"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "pflag_file_sysroot_preprocess"
+
+pflag_file_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
+
+CLEANBROKEN = "1"
\ No newline at end of file
diff --git a/import-layers/meta-virtualization/recipes-containers/lxc/files/Use-AC_HEADER_MAJOR-to-detect-major-minor-makedev.patch b/import-layers/meta-virtualization/recipes-containers/lxc/files/Use-AC_HEADER_MAJOR-to-detect-major-minor-makedev.patch
new file mode 100644
index 0000000..f9cecc0
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/lxc/files/Use-AC_HEADER_MAJOR-to-detect-major-minor-makedev.patch
@@ -0,0 +1,119 @@
+From 5c957671a511441b112b137b88bf0b1f31adac20 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Sat, 21 Jan 2017 11:57:13 +0000
+Subject: [PATCH] Use AC_HEADER_MAJOR to detect major()/minor()/makedev()
+
+commit af6824fce9c9536fbcabef8d5547f6c486f55fdf from
+git://github.com/lxc/lxc.git
+
+Before the change build failed on Gentoo as:
+
+  bdev/lxclvm.c: In function 'lvm_detect':
+  bdev/lxclvm.c:140:4: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration]
+    major(statbuf.st_rdev), minor(statbuf.st_rdev));
+    ^~~~~
+  bdev/lxclvm.c:140:28: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration]
+    major(statbuf.st_rdev), minor(statbuf.st_rdev));
+                            ^~~~~
+
+glibc plans to remove <sys/sysmacros.h> from glibc's <sys/types.h>:
+    https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html
+
+Gentoo already applied glibc patch to experimental glibc-2.24
+to start preparingfor the change.
+
+Autoconf has AC_HEADER_MAJOR to find out which header defines
+reqiured macros:
+    https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Headers.html
+
+This change should also increase portability across other libcs.
+
+Bug: https://bugs.gentoo.org/604360
+Signed-off-by: Sergei Trofimovich <siarheit@google.com>
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ configure.ac           | 3 +++
+ src/lxc/bdev/lxclvm.c  | 9 +++++++++
+ src/lxc/conf.c         | 8 ++++++++
+ src/lxc/lxccontainer.c | 8 ++++++++
+ 4 files changed, 28 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 8f31c29..924baa1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -601,6 +601,9 @@ AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
+ # Check for some headers
+ AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h])
+ 
++# lookup major()/minor()/makedev()
++AC_HEADER_MAJOR
++
+ # Check for some syscalls functions
+ AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat])
+ 
+diff --git a/src/lxc/bdev/lxclvm.c b/src/lxc/bdev/lxclvm.c
+index 3d41b10..419d1c2 100644
+--- a/src/lxc/bdev/lxclvm.c
++++ b/src/lxc/bdev/lxclvm.c
+@@ -32,10 +32,19 @@
+ #include <sys/wait.h>
+ 
+ #include "bdev.h"
++#include "config.h"
+ #include "log.h"
+ #include "lxclvm.h"
+ #include "utils.h"
+ 
++/* major()/minor() */
++#ifdef MAJOR_IN_MKDEV
++#    include <sys/mkdev.h>
++#endif
++#ifdef MAJOR_IN_SYSMACROS
++#    include <sys/sysmacros.h>
++#endif
++
+ lxc_log_define(lxclvm, lxc);
+ 
+ extern char *dir_new_path(char *src, const char *oldname, const char *name,
+diff --git a/src/lxc/conf.c b/src/lxc/conf.c
+index 3b023ef..53406ca 100644
+--- a/src/lxc/conf.c
++++ b/src/lxc/conf.c
+@@ -39,6 +39,14 @@
+ #include <grp.h>
+ #include <time.h>
+ 
++/* makedev() */
++#ifdef MAJOR_IN_MKDEV
++#    include <sys/mkdev.h>
++#endif
++#ifdef MAJOR_IN_SYSMACROS
++#    include <sys/sysmacros.h>
++#endif
++
+ #ifdef HAVE_STATVFS
+ #include <sys/statvfs.h>
+ #endif
+diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
+index 9f12ca2..aa02833 100644
+--- a/src/lxc/lxccontainer.c
++++ b/src/lxc/lxccontainer.c
+@@ -61,6 +61,14 @@
+ #include "utils.h"
+ #include "version.h"
+ 
++/* major()/minor() */
++#ifdef MAJOR_IN_MKDEV
++#    include <sys/mkdev.h>
++#endif
++#ifdef MAJOR_IN_SYSMACROS
++#    include <sys/sysmacros.h>
++#endif
++
+ #if HAVE_IFADDRS_H
+ #include <ifaddrs.h>
+ #else
+-- 
+2.7.4
+
diff --git a/import-layers/meta-virtualization/recipes-containers/lxc/lxc_2.0.0.bb b/import-layers/meta-virtualization/recipes-containers/lxc/lxc_2.0.0.bb
index 53068a8..c98d1a7 100644
--- a/import-layers/meta-virtualization/recipes-containers/lxc/lxc_2.0.0.bb
+++ b/import-layers/meta-virtualization/recipes-containers/lxc/lxc_2.0.0.bb
@@ -10,6 +10,7 @@
 		libcap-bin \
 		bridge-utils \
 		dnsmasq \
+		initscripts \
 		perl-module-strict \
 		perl-module-getopt-long \
 		perl-module-vars \
@@ -18,8 +19,11 @@
 		perl-module-constant \
 		perl-module-overload \
 		perl-module-exporter-heavy \
+"
+RDEPENDS_${PN}_append_libc-glibc = "\
 		glibc-utils \
 "
+
 RDEPENDS_${PN}-ptest += "file make"
 
 SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \
@@ -30,6 +34,7 @@
 	file://lxc-fix-B-S.patch \
 	file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \
 	file://logs-optionally-use-base-filenames-to-report-src-fil.patch \
+	file://Use-AC_HEADER_MAJOR-to-detect-major-minor-makedev.patch \
 	"
 
 SRC_URI[md5sum] = "04a7245a614cd3296b0ae9ceeeb83fbb"
@@ -50,9 +55,6 @@
 
 CFLAGS_append = " -Wno-error=deprecated-declarations"
 
-# disable problematic GCC 5.2 optimizations [YOCTO #8291]
-FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns2"
-
 PACKAGECONFIG ??= "templates \
     ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
 "
@@ -63,6 +65,7 @@
 PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux"
 PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp"
 PACKAGECONFIG[python] = "--enable-python,--disable-python,python3,python3-core"
+PACKAGECONFIG[lua] = "--enable-lua,--disable-lua,lua,lua"
 
 # required by python3 to run setup.py
 export BUILD_SYS
@@ -84,17 +87,19 @@
 # For LXC the docdir only contains example configuration files and should be included in the lxc package
 FILES_${PN} += "${docdir}"
 FILES_${PN} += "${libdir}/python3*"
-FILES_${PN}-dbg += "${libexecdir}/lxc/.debug"
+FILES_${PN} += "${datadir}/lua/*"
+FILES_${PN} += "${libdir}/lua/lxc/*"
+FILES_${PN}-dbg += "${libdir}/lua/lxc/.debug"
+FILES_${PN}-dbg += "${libexecdir}/lxc/.debug ${libexecdir}/lxc/hooks/.debug"
 PACKAGES =+ "${PN}-templates ${PN}-setup ${PN}-networking"
 FILES_${PN}-templates += "${datadir}/lxc/templates"
 RDEPENDS_${PN}-templates += "bash"
 
 ALLOW_EMPTY_${PN}-networking = "1"
 
-FILES_${PN}-setup += "/etc/tmpfiles.d"
-FILES_${PN}-setup += "/lib/systemd/system"
-FILES_${PN}-setup += "/usr/lib/systemd/system"
-FILES_${PN}-setup += "/etc/init.d"
+FILES_${PN}-setup += "${sysconfdir}/tmpfiles.d"
+FILES_${PN}-setup += "${systemd_system_unitdir}"
+FILES_${PN}-setup += "${sysconfdir}/init.d"
 
 PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1"
 
diff --git a/import-layers/meta-virtualization/recipes-containers/oci-image-spec/oci-image-spec_git.bb b/import-layers/meta-virtualization/recipes-containers/oci-image-spec/oci-image-spec_git.bb
new file mode 100644
index 0000000..92a8399
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/oci-image-spec/oci-image-spec_git.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "The OCI Image Format project creates and maintains the software shipping container image format spec"
+HOMEPAGE = "https://github.com/opencontainers/image-spec"
+SECTION = "devel/go"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=27ef03aa2da6e424307f102e8b42621d"
+
+SRCNAME = "image-spec"
+
+PKG_NAME = "github.com/opencontainers/${SRCNAME}"
+SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "91d3eaabebcdc329edd9b4ff0f28f8f90022201f"
+PV = "v1.0.0-rc4+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "image_spec_file_sysroot_preprocess"
+
+image_spec_file_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
+
+CLEANBROKEN = "1"
\ No newline at end of file
diff --git a/import-layers/meta-virtualization/recipes-containers/oci-image-tools/oci-image-tools_git.bb b/import-layers/meta-virtualization/recipes-containers/oci-image-tools/oci-image-tools_git.bb
new file mode 100644
index 0000000..29a8926
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/oci-image-tools/oci-image-tools_git.bb
@@ -0,0 +1,61 @@
+HOMEPAGE = "https://github.com/opencontainers/image-tools"
+SUMMARY = "A collection of tools for working with the OCI image format specification"
+LICENSE = "Apache-2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+DEPENDS = "\
+           oci-image-spec \
+           oci-runtime-spec \
+           go-digest \
+           go-errors \
+           spf13-cobra \
+           spf13-pflag \
+          "
+
+SRC_URI = "git://github.com/opencontainers/image-tools.git"
+SRCREV = "a358e03fde4e3628bf9fb7656bf643b63f975636"
+PV = "0.1.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit goarch
+inherit go
+
+# This disables seccomp and apparmor, which are on by default in the
+# go package. 
+EXTRA_OEMAKE="BUILDTAGS=''"
+
+do_compile() {
+	export GOARCH="${TARGET_GOARCH}"
+	export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
+	# Setup vendor directory so that it can be used in GOPATH.
+	#
+	# Go looks in a src directory under any directory in GOPATH but riddler
+	# uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink.
+	#
+	# We also need to link in the ipallocator directory as that is not under
+	# a src directory.
+	ln -sfn . "${S}/vendor/src"
+	mkdir -p "${S}/vendor/src/github.com/opencontainers/image-tools/"
+	ln -sfn "${S}/image" "${S}/vendor/src/github.com/opencontainers/image-tools/image"
+	export GOPATH="${S}/vendor"
+
+	# Pass the needed cflags/ldflags so that cgo
+	# can find the needed headers files and libraries
+	export CGO_ENABLED="1"
+	export CFLAGS=""
+	export LDFLAGS=""
+	export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+	export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+
+	oe_runmake tools
+}
+
+do_install() {
+	install -d ${D}/${sbindir}
+	install ${S}/oci-create-runtime-bundle ${D}/${sbindir}/
+	install ${S}/oci-image-validate ${D}/${sbindir}/
+	install ${S}/oci-unpack ${D}/${sbindir}/
+}
+
+INSANE_SKIP_${PN} += "ldflags"
diff --git a/import-layers/meta-virtualization/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb b/import-layers/meta-virtualization/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
new file mode 100644
index 0000000..82f852f
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/oci-runtime-spec/oci-runtime-spec_git.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "The Open Container Initiative develops specifications for standards on Operating System process and application containers"
+HOMEPAGE = "https://github.com/opencontainers/runtime-spec"
+SECTION = "devel/go"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=b355a61a394a504dacde901c958f662c"
+
+SRCNAME = "runtime-spec"
+
+PKG_NAME = "github.com/opencontainers/${SRCNAME}"
+SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "4af0c72f92aacf1b43618d7986197d8209fadf0b"
+PV = "v1.0.0-rc4+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go" -not -path "*/.tool/*"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "runtime_spec_file_sysroot_preprocess"
+
+runtime_spec_file_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
+
+CLEANBROKEN = "1"
\ No newline at end of file
diff --git a/import-layers/meta-virtualization/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb b/import-layers/meta-virtualization/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
new file mode 100644
index 0000000..4f77dce
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
@@ -0,0 +1,35 @@
+HOMEPAGE = "https://github.com/opencontainers/runtime-tools"
+SUMMARY = "oci-runtime-tool is a collection of tools for working with the OCI runtime specification"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b355a61a394a504dacde901c958f662c"
+
+SRC_URI = "git://github.com/opencontainers/runtime-tools.git"
+
+SRCREV = "038b0c99b82f3c08de31f6b09e693eb24644affd"
+PV = "0.0.1+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit goarch
+inherit go
+
+do_compile() {
+	export GOARCH="${TARGET_GOARCH}"
+	export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
+	export GOPATH="${S}"
+
+	# Pass the needed cflags/ldflags so that cgo
+	# can find the needed headers files and libraries
+	export CGO_ENABLED="1"
+	export CFLAGS=""
+	export LDFLAGS=""
+	export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+	export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+
+	oe_runmake
+}
+
+do_install() {
+	install -d ${D}/${sbindir}
+	install ${S}/oci-runtime-tool ${D}/${sbindir}/oci-runtime-tool
+}
diff --git a/import-layers/meta-virtualization/recipes-containers/oci-systemd-hook/oci-systemd-hook/0001-configure-drop-selinux-support.patch b/import-layers/meta-virtualization/recipes-containers/oci-systemd-hook/oci-systemd-hook/0001-configure-drop-selinux-support.patch
new file mode 100644
index 0000000..510126e
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/oci-systemd-hook/oci-systemd-hook/0001-configure-drop-selinux-support.patch
@@ -0,0 +1,25 @@
+From 12c263703a0b0ae92566de7e5440fce7b59cd9be Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@windriver.com>
+Date: Tue, 8 Nov 2016 13:16:19 -0500
+Subject: [PATCH] configure: drop selinux support
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+---
+ configure.ac | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index c1275acb253d..eaba7fbb57e2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -8,7 +8,6 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
+ 
+ PKG_CHECK_MODULES([YAJL], [yajl >= 2.0.0])
+-PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0.0])
+ PKG_CHECK_MODULES([LIBMOUNT], [mount >= 2.23.0])
+ 
+ AC_MSG_CHECKING([whether to disable argument checking])
+-- 
+2.4.0.53.g8440f74
+
diff --git a/import-layers/meta-virtualization/recipes-containers/oci-systemd-hook/oci-systemd-hook/0001-selinux-drop-selinux-support.patch b/import-layers/meta-virtualization/recipes-containers/oci-systemd-hook/oci-systemd-hook/0001-selinux-drop-selinux-support.patch
new file mode 100644
index 0000000..507cd08
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/oci-systemd-hook/oci-systemd-hook/0001-selinux-drop-selinux-support.patch
@@ -0,0 +1,40 @@
+From 9b66394c712ec0d0fcb2052baa7f590621a53461 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@windriver.com>
+Date: Tue, 8 Nov 2016 13:15:46 -0500
+Subject: [PATCH] selinux: drop selinux support
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+---
+ src/systemdhook.c | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+diff --git a/src/systemdhook.c b/src/systemdhook.c
+index 274e5b910699..b9e8f1be376a 100644
+--- a/src/systemdhook.c
++++ b/src/systemdhook.c
+@@ -14,7 +14,6 @@
+ #include <errno.h>
+ #include <inttypes.h>
+ #include <linux/limits.h>
+-#include <selinux/selinux.h>
+ #include <yajl/yajl_tree.h>
+ 
+ #include "config.h"
+@@ -538,14 +537,6 @@ static int prestart(const char *rootfs,
+ 			}
+ 		}
+ 
+-		if (strcmp("", mount_label)) {
+-			rc = setfilecon(journal_dir, (security_context_t)mount_label);
+-			if (rc < 0) {
+-				pr_perror("Failed to set journal dir selinux context");
+-				return -1;
+-			}
+-		}
+-
+ 		if (makepath(cont_journal_dir, 0755) == -1) {
+ 			if (errno != EEXIST) {
+ 				pr_perror("Failed to mkdir container journal dir: %s", cont_journal_dir);
+-- 
+2.4.0.53.g8440f74
+
diff --git a/import-layers/meta-virtualization/recipes-containers/oci-systemd-hook/oci-systemd-hook_git.bb b/import-layers/meta-virtualization/recipes-containers/oci-systemd-hook/oci-systemd-hook_git.bb
new file mode 100644
index 0000000..872872a
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/oci-systemd-hook/oci-systemd-hook_git.bb
@@ -0,0 +1,35 @@
+DESCRIPTION = "OCI systemd hook enables users to run systemd in docker and OCI"
+SECTION = "console/utils"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d32239bcb673463ab874e80d47fae504"
+PRIORITY = "optional"
+
+DEPENDS = "yajl util-linux"
+
+SRCREV = "ca515c1f399bd0b16e94b7c34aa1ef20498beca6"
+SRC_URI = "git://github.com/projectatomic/oci-systemd-hook \
+           file://0001-selinux-drop-selinux-support.patch \
+           file://0001-configure-drop-selinux-support.patch \
+"
+
+PV = "0.0.1+git${SRCPV}"
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[selinux] = ",,libselinux"
+
+EXTRA_OECONF += "--libexecdir=${libexecdir}/oci/hooks.d"
+
+# nothing to compile, we do it all in the install task
+do_compile[noexec] = "1"
+
+do_install() {
+    # Avoid building docs, and other artifacts by surgically calling the
+    # semi-internal target of "install-exec-am"
+    oe_runmake 'DESTDIR=${D}' install-exec-am
+}
+
+FILES_${PN} += "${libexecdir}/oci/hooks.d/"
+
diff --git a/import-layers/meta-virtualization/recipes-containers/riddler/riddler_git.bb b/import-layers/meta-virtualization/recipes-containers/riddler/riddler_git.bb
new file mode 100644
index 0000000..ae6c5ec
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/riddler/riddler_git.bb
@@ -0,0 +1,48 @@
+HOMEPAGE = "https://github.com/jfrazelle/riddler"
+SUMMARY = "Convert `docker inspect` to opencontainers (OCI compatible) runc spec."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=20ce4c6a4f32d6ee4a68e3a7506db3f1"
+
+SRC_URI = "git://github.com/jfrazelle/riddler;branch=master"
+SRCREV = "23befa0b232877b5b502b828e24161d801bd67f6"
+PV = "0.1.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit goarch
+inherit go
+
+# This disables seccomp and apparmor, which are on by default in the
+# go package. 
+EXTRA_OEMAKE="BUILDTAGS=''"
+
+do_compile() {
+	export GOARCH="${TARGET_GOARCH}"
+	export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
+	# Setup vendor directory so that it can be used in GOPATH.
+	#
+	# Go looks in a src directory under any directory in GOPATH but riddler
+	# uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink.
+	#
+	# We also need to link in the ipallocator directory as that is not under
+	# a src directory.
+	ln -sfn . "${S}/vendor/src"
+	mkdir -p "${S}/vendor/src/github.com/jessfraz/riddler"
+	ln -sfn "${S}/parse" "${S}/vendor/src/github.com/jessfraz/riddler/parse"
+	export GOPATH="${S}/vendor"
+
+	# Pass the needed cflags/ldflags so that cgo
+	# can find the needed headers files and libraries
+	export CGO_ENABLED="1"
+	export CFLAGS=""
+	export LDFLAGS=""
+	export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+	export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+
+	oe_runmake static
+}
+
+do_install() {
+	install -d ${D}/${sbindir}
+	install ${S}/riddler ${D}/${sbindir}/riddler
+}
diff --git a/import-layers/meta-virtualization/recipes-containers/runc/runc-docker_git.bb b/import-layers/meta-virtualization/recipes-containers/runc/runc-docker_git.bb
new file mode 100644
index 0000000..96d48ca
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/runc/runc-docker_git.bb
@@ -0,0 +1,11 @@
+include runc.inc
+
+# Note: this rev is before the required protocol field, update when all components
+#       have been updated to match.
+SRCREV = "2f7393a47307a16f8cee44a37b262e8b81021e3e"
+SRC_URI = "git://github.com/docker/runc.git;nobranch=1 \
+          "
+
+RUNC_VERSION = "1.0.0-rc2"
+PROVIDES += "virtual/runc"
+RPROVIDES_${PN} = "virtual/runc"
diff --git a/import-layers/meta-virtualization/recipes-containers/runc/runc-opencontainers_git.bb b/import-layers/meta-virtualization/recipes-containers/runc/runc-opencontainers_git.bb
new file mode 100644
index 0000000..4a6e8cd
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/runc/runc-opencontainers_git.bb
@@ -0,0 +1,15 @@
+include runc.inc
+
+SRCREV = "75f8da7c889acc4509a0cf6f0d3a8f9584778375"
+SRC_URI = "git://github.com/opencontainers/runc;branch=master \
+          "
+RUNC_VERSION = "1.0.0-rc3"
+PROVIDES += "virtual/runc"
+RPROVIDES_${PN} = "virtual/runc"
+
+do_compile_prepend() {
+	# Go looks in a src directory under any directory in GOPATH but
+	# runc-opencontainers uses 'vendor' instead of 'vendor/src'. We can fix
+	# this with a symlink.
+	ln -sfn . "${S}/vendor/src"
+}
diff --git a/import-layers/meta-virtualization/recipes-containers/runc/runc.inc b/import-layers/meta-virtualization/recipes-containers/runc/runc.inc
new file mode 100644
index 0000000..4808547
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-containers/runc/runc.inc
@@ -0,0 +1,58 @@
+HOMEPAGE = "https://github.com/opencontainers/runc"
+SUMMARY = "runc container cli tools"
+DESCRIPTION = "runc is a CLI tool for spawning and running containers according to the OCI specification."
+
+# Apache-2.0 for containerd
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8"
+
+S = "${WORKDIR}/git"
+
+PV = "${RUNC_VERSION}+git${SRCREV}"
+
+inherit go
+RRECOMMENDS_${PN} = "lxc docker"
+
+LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer"
+
+do_configure[noexec] = "1"
+EXTRA_OEMAKE="BUILDTAGS=''"
+
+inherit goarch
+
+do_compile() {
+	export GOARCH="${TARGET_GOARCH}"
+	export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
+	# Set GOPATH. See 'PACKAGERS.md'. Don't rely on
+	# docker to download its dependencies but rather
+	# use dependencies packaged independently.
+	cd ${S}
+	rm -rf .gopath
+	dname=`dirname "${LIBCONTAINER_PACKAGE}"`
+	bname=`basename "${LIBCONTAINER_PACKAGE}"`
+	mkdir -p .gopath/src/${dname}
+
+	(cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname})
+	export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
+	export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
+	cd -
+
+	# Pass the needed cflags/ldflags so that cgo
+	# can find the needed headers files and libraries
+	export CGO_ENABLED="1"
+	export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+	export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+	export CFLAGS=""
+	export LDFLAGS=""
+
+        oe_runmake static
+}
+
+do_install() {
+	mkdir -p ${D}/${bindir}
+
+	cp ${S}/runc ${D}/${bindir}/runc
+	ln -sf runc ${D}/${bindir}/docker-runc
+}
+
+INHIBIT_PACKAGE_STRIP = "1"
diff --git a/import-layers/meta-virtualization/recipes-containers/runc/runc_git.bb b/import-layers/meta-virtualization/recipes-containers/runc/runc_git.bb
deleted file mode 100644
index 905a751..0000000
--- a/import-layers/meta-virtualization/recipes-containers/runc/runc_git.bb
+++ /dev/null
@@ -1,66 +0,0 @@
-HOMEPAGE = "https://github.com/opencontainers/runc"
-SUMMARY = "runc container cli tools"
-DESCRIPTION = "runc is a CLI tool for spawning and running containers according to the OCI specification."
-
-# Note: this rev is before the required protocol field, update when all components
-#       have been updated to match.
-SRCREV = "1cdaa709f151b61cee2bdaa09d8e5d2b58a8ba72"
-SRC_URI = "\
-	git://github.com/opencontainers/runc;branch=master \
-	"
-
-# Apache-2.0 for containerd
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8"
-
-S = "${WORKDIR}/git"
-
-RUNC_VERSION = "1.0.0-rc1"
-PV = "${RUNC_VERSION}+git${SRCREV}"
-
-DEPENDS = "go-cross \
-    "
-RRECOMMENDS_${PN} = "lxc docker"
-
-LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer"
-
-do_configure[noexec] = "1"
-EXTRA_OEMAKE="BUILDTAGS=''"
-
-inherit go-osarchmap
-
-do_compile() {
-	export GOARCH="${TARGET_GOARCH}"
-
-	# Set GOPATH. See 'PACKAGERS.md'. Don't rely on
-	# docker to download its dependencies but rather
-	# use dependencies packaged independently.
-	cd ${S}
-	rm -rf .gopath
-	dname=`dirname "${LIBCONTAINER_PACKAGE}"`
-	bname=`basename "${LIBCONTAINER_PACKAGE}"`
-	mkdir -p .gopath/src/${dname}
-
-	(cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname})
-	export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
-	cd -
-
-	# Pass the needed cflags/ldflags so that cgo
-	# can find the needed headers files and libraries
-	export CGO_ENABLED="1"
-	export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
-	export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
-	export CFLAGS=""
-	export LDFLAGS=""
-
-        oe_runmake static
-}
-
-do_install() {
-	mkdir -p ${D}/${bindir}
-
-	cp ${S}/runc ${D}/${bindir}/runc
-	ln -sf runc ${D}/${bindir}/docker-runc
-}
-
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4.inc b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4.inc
deleted file mode 100644
index a65459f..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4.inc
+++ /dev/null
@@ -1,15 +0,0 @@
-require go-common.inc
-
-PV = "1.4.3"
-GO_BASEVERSION = "1.4"
-FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
-
-SRC_URI += "\
-        file://016-armhf-elf-header.patch \
-        file://go-cross-backport-cmd-link-support-new-386-amd64-rel.patch \
-        file://syslog.patch \
-"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81"
-SRC_URI[md5sum] = "dfb604511115dd402a77a553a5923a04"
-SRC_URI[sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4/016-armhf-elf-header.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4/016-armhf-elf-header.patch
deleted file mode 100644
index 1ae53a3..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4/016-armhf-elf-header.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Description: Use correct ELF header for armhf binaries.
-Author: Adam Conrad <adconrad@ubuntu.com>
-Last-Update: 2013-07-08
-
-Index: go/src/cmd/ld/elf.c
-===================================================================
---- go.orig/src/cmd/ld/elf.c	2015-02-20 10:49:58.763451586 -0800
-+++ go/src/cmd/ld/elf.c	2015-02-20 10:49:27.895478521 -0800
-@@ -57,7 +57,11 @@
- 	case '5':
- 		// we use EABI on both linux/arm and freebsd/arm.
- 		if(HEADTYPE == Hlinux || HEADTYPE == Hfreebsd)
--			hdr.flags = 0x5000002; // has entry point, Version5 EABI
-+#ifdef __ARM_PCS_VFP
-+			hdr.flags = 0x5000402; // has entry point, Version5 EABI, hard-float ABI
-+#else
-+			hdr.flags = 0x5000202; // has entry point, Version5 EABI, soft-float ABI
-+#endif
- 		// fallthrough
- 	default:
- 		hdr.phoff = ELF32HDRSIZE;	/* Must be be ELF32HDRSIZE: first PHdr must follow ELF header */
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
deleted file mode 100644
index de3f49c..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
+++ /dev/null
@@ -1,223 +0,0 @@
-From d6eefad445831c161fca130f9bdf7b3848aac23c Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Tue, 29 Mar 2016 21:14:33 -0400
-Subject: [PATCH] go-cross: backport "cmd/link: support new 386/amd64
- relocations"
-
-Newer binutils won't support building older go-1.4.3 as per:
-
-https://github.com/golang/go/issues/13114
-
-Upstream commit 914db9f060b1fd3eb1f74d48f3bd46a73d4ae9c7 (see subj)
-was identified as the fix and nominated for 1.4.4 but that release
-never happened.  The paths in 1.4.3 aren't the same as go1.6beta1~662
-where this commit appeared, but the NetBSD folks indicated what a
-1.4.3 backport would look like here: https://gnats.netbsd.org/50777
-
-This is based on that, but without the BSD wrapper infrastructure
-layer that makes things look like patches of patches.
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-
-diff --git a/src/cmd/6l/asm.c b/src/cmd/6l/asm.c
-index 18b5aa311981..2e9d339aef87 100644
---- a/src/cmd/6l/asm.c
-+++ b/src/cmd/6l/asm.c
-@@ -118,6 +118,8 @@ adddynrel(LSym *s, Reloc *r)
- 		return;
- 	
- 	case 256 + R_X86_64_GOTPCREL:
-+	case 256 + R_X86_64_GOTPCRELX:
-+	case 256 + R_X86_64_REX_GOTPCRELX:
- 		if(targ->type != SDYNIMPORT) {
- 			// have symbol
- 			if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
-diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c
-index 98c04240374f..cff29488e8af 100644
---- a/src/cmd/8l/asm.c
-+++ b/src/cmd/8l/asm.c
-@@ -115,6 +115,7 @@ adddynrel(LSym *s, Reloc *r)
- 		return;		
- 	
- 	case 256 + R_386_GOT32:
-+	case 256 + R_386_GOT32X:
- 		if(targ->type != SDYNIMPORT) {
- 			// have symbol
- 			if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
-diff --git a/src/cmd/ld/elf.h b/src/cmd/ld/elf.h
-index e84d996f2596..bbf2cfaa3cc0 100644
---- a/src/cmd/ld/elf.h
-+++ b/src/cmd/ld/elf.h
-@@ -478,32 +478,47 @@ typedef struct {
-  * Relocation types.
-  */
- 
--#define	R_X86_64_NONE	0	/* No relocation. */
--#define	R_X86_64_64	1	/* Add 64 bit symbol value. */
--#define	R_X86_64_PC32	2	/* PC-relative 32 bit signed sym value. */
--#define	R_X86_64_GOT32	3	/* PC-relative 32 bit GOT offset. */
--#define	R_X86_64_PLT32	4	/* PC-relative 32 bit PLT offset. */
--#define	R_X86_64_COPY	5	/* Copy data from shared object. */
--#define	R_X86_64_GLOB_DAT 6	/* Set GOT entry to data address. */
--#define	R_X86_64_JMP_SLOT 7	/* Set GOT entry to code address. */
--#define	R_X86_64_RELATIVE 8	/* Add load address of shared object. */
--#define	R_X86_64_GOTPCREL 9	/* Add 32 bit signed pcrel offset to GOT. */
--#define	R_X86_64_32	10	/* Add 32 bit zero extended symbol value */
--#define	R_X86_64_32S	11	/* Add 32 bit sign extended symbol value */
--#define	R_X86_64_16	12	/* Add 16 bit zero extended symbol value */
--#define	R_X86_64_PC16	13	/* Add 16 bit signed extended pc relative symbol value */
--#define	R_X86_64_8	14	/* Add 8 bit zero extended symbol value */
--#define	R_X86_64_PC8	15	/* Add 8 bit signed extended pc relative symbol value */
--#define	R_X86_64_DTPMOD64 16	/* ID of module containing symbol */
--#define	R_X86_64_DTPOFF64 17	/* Offset in TLS block */
--#define	R_X86_64_TPOFF64 18	/* Offset in static TLS block */
--#define	R_X86_64_TLSGD	19	/* PC relative offset to GD GOT entry */
--#define	R_X86_64_TLSLD	20	/* PC relative offset to LD GOT entry */
--#define	R_X86_64_DTPOFF32 21	/* Offset in TLS block */
--#define	R_X86_64_GOTTPOFF 22	/* PC relative offset to IE GOT entry */
--#define	R_X86_64_TPOFF32 23	/* Offset in static TLS block */
--
--#define	R_X86_64_COUNT	24	/* Count of defined relocation types. */
-+#define	R_X86_64_NONE           0
-+#define	R_X86_64_64             1
-+#define	R_X86_64_PC32           2
-+#define	R_X86_64_GOT32          3
-+#define	R_X86_64_PLT32          4
-+#define	R_X86_64_COPY           5
-+#define	R_X86_64_GLOB_DAT       6
-+#define	R_X86_64_JMP_SLOT       7
-+#define	R_X86_64_RELATIVE       8
-+#define	R_X86_64_GOTPCREL       9
-+#define	R_X86_64_32             10
-+#define	R_X86_64_32S            11
-+#define	R_X86_64_16             12
-+#define	R_X86_64_PC16           13
-+#define	R_X86_64_8              14
-+#define	R_X86_64_PC8            15
-+#define	R_X86_64_DTPMOD64       16
-+#define	R_X86_64_DTPOFF64       17
-+#define	R_X86_64_TPOFF64        18
-+#define	R_X86_64_TLSGD          19
-+#define	R_X86_64_TLSLD          20
-+#define	R_X86_64_DTPOFF32       21
-+#define	R_X86_64_GOTTPOFF       22
-+#define	R_X86_64_TPOFF32        23
-+#define	R_X86_64_PC64           24
-+#define	R_X86_64_GOTOFF64       25
-+#define	R_X86_64_GOTPC32        26
-+#define	R_X86_64_GOT64          27
-+#define	R_X86_64_GOTPCREL64     28
-+#define	R_X86_64_GOTPC64        29
-+#define	R_X86_64_GOTPLT64       30
-+#define	R_X86_64_PLTOFF64       31
-+#define	R_X86_64_SIZE32         32
-+#define	R_X86_64_SIZE64         33
-+#define	R_X86_64_GOTPC32_TLSDEC 34
-+#define	R_X86_64_TLSDESC_CALL   35
-+#define	R_X86_64_TLSDESC        36
-+#define	R_X86_64_IRELATIVE      37
-+#define	R_X86_64_PC32_BND       40
-+#define	R_X86_64_GOTPCRELX      41
-+#define	R_X86_64_REX_GOTPCRELX  42
- 
- 
- #define	R_ALPHA_NONE		0	/* No reloc */
-@@ -581,39 +596,42 @@ typedef struct {
- #define	R_ARM_COUNT		38	/* Count of defined relocation types. */
- 
- 
--#define	R_386_NONE	0	/* No relocation. */
--#define	R_386_32	1	/* Add symbol value. */
--#define	R_386_PC32	2	/* Add PC-relative symbol value. */
--#define	R_386_GOT32	3	/* Add PC-relative GOT offset. */
--#define	R_386_PLT32	4	/* Add PC-relative PLT offset. */
--#define	R_386_COPY	5	/* Copy data from shared object. */
--#define	R_386_GLOB_DAT	6	/* Set GOT entry to data address. */
--#define	R_386_JMP_SLOT	7	/* Set GOT entry to code address. */
--#define	R_386_RELATIVE	8	/* Add load address of shared object. */
--#define	R_386_GOTOFF	9	/* Add GOT-relative symbol address. */
--#define	R_386_GOTPC	10	/* Add PC-relative GOT table address. */
--#define	R_386_TLS_TPOFF	14	/* Negative offset in static TLS block */
--#define	R_386_TLS_IE	15	/* Absolute address of GOT for -ve static TLS */
--#define	R_386_TLS_GOTIE	16	/* GOT entry for negative static TLS block */
--#define	R_386_TLS_LE	17	/* Negative offset relative to static TLS */
--#define	R_386_TLS_GD	18	/* 32 bit offset to GOT (index,off) pair */
--#define	R_386_TLS_LDM	19	/* 32 bit offset to GOT (index,zero) pair */
--#define	R_386_TLS_GD_32	24	/* 32 bit offset to GOT (index,off) pair */
--#define	R_386_TLS_GD_PUSH 25	/* pushl instruction for Sun ABI GD sequence */
--#define	R_386_TLS_GD_CALL 26	/* call instruction for Sun ABI GD sequence */
--#define	R_386_TLS_GD_POP 27	/* popl instruction for Sun ABI GD sequence */
--#define	R_386_TLS_LDM_32 28	/* 32 bit offset to GOT (index,zero) pair */
--#define	R_386_TLS_LDM_PUSH 29	/* pushl instruction for Sun ABI LD sequence */
--#define	R_386_TLS_LDM_CALL 30	/* call instruction for Sun ABI LD sequence */
--#define	R_386_TLS_LDM_POP 31	/* popl instruction for Sun ABI LD sequence */
--#define	R_386_TLS_LDO_32 32	/* 32 bit offset from start of TLS block */
--#define	R_386_TLS_IE_32	33	/* 32 bit offset to GOT static TLS offset entry */
--#define	R_386_TLS_LE_32	34	/* 32 bit offset within static TLS block */
--#define	R_386_TLS_DTPMOD32 35	/* GOT entry containing TLS index */
--#define	R_386_TLS_DTPOFF32 36	/* GOT entry containing TLS offset */
--#define	R_386_TLS_TPOFF32 37	/* GOT entry of -ve static TLS offset */
--
--#define	R_386_COUNT	38	/* Count of defined relocation types. */
-+#define	R_386_NONE          0
-+#define	R_386_32            1
-+#define	R_386_PC32          2
-+#define	R_386_GOT32         3
-+#define	R_386_PLT32         4
-+#define	R_386_COPY          5
-+#define	R_386_GLOB_DAT      6
-+#define	R_386_JMP_SLOT      7
-+#define	R_386_RELATIVE      8
-+#define	R_386_GOTOFF        9
-+#define	R_386_GOTPC         10
-+#define	R_386_TLS_TPOFF     14
-+#define	R_386_TLS_IE        15
-+#define	R_386_TLS_GOTIE     16
-+#define	R_386_TLS_LE        17
-+#define	R_386_TLS_GD        18
-+#define	R_386_TLS_LDM       19
-+#define	R_386_TLS_GD_32     24
-+#define	R_386_TLS_GD_PUSH   25
-+#define	R_386_TLS_GD_CALL   26
-+#define	R_386_TLS_GD_POP    27
-+#define	R_386_TLS_LDM_32    28
-+#define	R_386_TLS_LDM_PUSH  29
-+#define	R_386_TLS_LDM_CALL  30
-+#define	R_386_TLS_LDM_POP   31
-+#define	R_386_TLS_LDO_32    32
-+#define	R_386_TLS_IE_32     33
-+#define	R_386_TLS_LE_32     34
-+#define	R_386_TLS_DTPMOD32  35
-+#define	R_386_TLS_DTPOFF32  36
-+#define	R_386_TLS_TPOFF32   37
-+#define	R_386_TLS_GOTDESC   39
-+#define	R_386_TLS_DESC_CALL 40
-+#define	R_386_TLS_DESC      41
-+#define	R_386_IRELATIVE     42
-+#define	R_386_GOT32X        43
- 
- #define	R_PPC_NONE		0	/* No relocation. */
- #define	R_PPC_ADDR32		1
-diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c
-index dd5fa0d2a839..2e2fbd17377f 100644
---- a/src/cmd/ld/ldelf.c
-+++ b/src/cmd/ld/ldelf.c
-@@ -888,12 +888,15 @@ reltype(char *pn, int elftype, uchar *siz)
- 	case R('6', R_X86_64_PC32):
- 	case R('6', R_X86_64_PLT32):
- 	case R('6', R_X86_64_GOTPCREL):
-+	case R('6', R_X86_64_GOTPCRELX):
-+	case R('6', R_X86_64_REX_GOTPCRELX):
- 	case R('8', R_386_32):
- 	case R('8', R_386_PC32):
- 	case R('8', R_386_GOT32):
- 	case R('8', R_386_PLT32):
- 	case R('8', R_386_GOTOFF):
- 	case R('8', R_386_GOTPC):
-+	case R('8', R_386_GOT32X):
- 		*siz = 4;
- 		break;
- 	case R('6', R_X86_64_64):
--- 
-2.7.2
-
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4/syslog.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4/syslog.patch
deleted file mode 100644
index ce82a4f..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.4/syslog.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
---- go/src/log/syslog/syslog.go	2013-11-28 13:38:28.000000000 -0800
-+++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go	2014-10-03 11:44:37.710403200 -0700
-@@ -33,6 +33,9 @@
- const severityMask = 0x07
- const facilityMask = 0xf8
- 
-+var writeTimeout = 1 * time.Second
-+var connectTimeout = 1 * time.Second
-+
- const (
- 	// Severity.
- 
-@@ -100,6 +103,7 @@
- type serverConn interface {
- 	writeString(p Priority, hostname, tag, s, nl string) error
- 	close() error
-+	setWriteDeadline(t time.Time) error
- }
- 
- type netConn struct {
-@@ -273,7 +277,11 @@
- 		nl = "\n"
- 	}
- 
--	err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
-+	err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
-+	if err != nil {
-+		return 0, err
-+	}
-+	err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
- 	if err != nil {
- 		return 0, err
- 	}
-@@ -305,6 +313,10 @@
- 	return n.conn.Close()
- }
- 
-+func (n *netConn) setWriteDeadline(t time.Time) error {
-+	return n.conn.SetWriteDeadline(t)
-+}
-+
- // NewLogger creates a log.Logger whose output is written to
- // the system log service with the specified priority. The logFlag
- // argument is the flag set passed through to log.New to create
-diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
---- go/src/log/syslog/syslog_unix.go	2013-11-28 13:38:28.000000000 -0800
-+++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go	2014-10-03 11:44:39.010403175 -0700
-@@ -19,7 +19,7 @@
- 	logPaths := []string{"/dev/log", "/var/run/syslog"}
- 	for _, network := range logTypes {
- 		for _, path := range logPaths {
--			conn, err := net.Dial(network, path)
-+			conn, err := net.DialTimeout(network, path, connectTimeout)
- 			if err != nil {
- 				continue
- 			} else {
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5.inc b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5.inc
deleted file mode 100644
index bb91ed8..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-require go-common.inc
-
-PV = "1.5.2"
-GO_BASEVERSION = "1.5"
-FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
-
-
-SRC_URI += "\
-       file://armhf-elf-header.patch \
-       file://syslog.patch \
-       file://fix-target-cc-for-build.patch \
-       file://fix-cc-handling.patch \
-       file://split-host-and-target-build.patch \
-       file://gotooldir.patch \
-"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81"
-SRC_URI[md5sum] = "38fed22e7b80672291e7cba7fb9c3475"
-SRC_URI[sha256sum] = "f3ddd624c00461641ce3d3a8d8e3c622392384ca7699e901b370a4eac5987a74"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/armhf-elf-header.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/armhf-elf-header.patch
deleted file mode 100644
index f56869b..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/armhf-elf-header.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Index: go/src/cmd/link/internal/ld/elf.go
-===================================================================
---- go.orig/src/cmd/link/internal/ld/elf.go	2015-07-29 13:05:25.952533140 -0700
-+++ go/src/cmd/link/internal/ld/elf.go	2015-07-29 13:14:53.413112995 -0700
-@@ -780,7 +780,13 @@
- 	// 32-bit architectures
- 	case '5':
- 		// we use EABI on both linux/arm and freebsd/arm.
--		if HEADTYPE == obj.Hlinux || HEADTYPE == obj.Hfreebsd {
-+		if HEADTYPE == obj.Hlinux {
-+			if Ctxt.Goarm == 7 {
-+				ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float
-+			} else {
-+				ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float
-+			}
-+		} else if HEADTYPE == obj.Hfreebsd {
- 			ehdr.flags = 0x5000002 // has entry point, Version5 EABI
- 		}
- 		fallthrough
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/fix-cc-handling.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/fix-cc-handling.patch
deleted file mode 100644
index 85770a9..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/fix-cc-handling.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-Index: go/src/cmd/go/build.go
-===================================================================
---- go.orig/src/cmd/go/build.go	2015-07-29 14:48:40.323185807 -0700
-+++ go/src/cmd/go/build.go	2015-07-30 07:37:40.529818586 -0700
-@@ -2805,12 +2805,24 @@
- 	return b.ccompilerCmd("CC", defaultCC, objdir)
- }
- 
-+// gccCmd returns a gcc command line prefix
-+// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
-+func (b *builder) gccCmdForReal() []string {
-+	return envList("CC", defaultCC)
-+}
-+
- // gxxCmd returns a g++ command line prefix
- // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
- func (b *builder) gxxCmd(objdir string) []string {
- 	return b.ccompilerCmd("CXX", defaultCXX, objdir)
- }
- 
-+// gxxCmd returns a g++ command line prefix
-+// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
-+func (b *builder) gxxCmdForReal() []string {
-+	return envList("CXX", defaultCXX)
-+}
-+
- // ccompilerCmd returns a command line prefix for the given environment
- // variable and using the default command when the variable is empty.
- func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string {
-Index: go/src/cmd/go/env.go
-===================================================================
---- go.orig/src/cmd/go/env.go	2015-07-29 14:48:40.323185807 -0700
-+++ go/src/cmd/go/env.go	2015-07-30 07:40:54.461655721 -0700
-@@ -52,10 +52,9 @@
- 
- 	if goos != "plan9" {
- 		cmd := b.gccCmd(".")
--		env = append(env, envVar{"CC", cmd[0]})
-+		env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
- 		env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
--		cmd = b.gxxCmd(".")
--		env = append(env, envVar{"CXX", cmd[0]})
-+		env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
- 	}
- 
- 	if buildContext.CgoEnabled {
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/fix-target-cc-for-build.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/fix-target-cc-for-build.patch
deleted file mode 100644
index adfeb6b..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/fix-target-cc-for-build.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: go/src/make.bash
-===================================================================
---- go.orig/src/make.bash	2015-07-29 13:28:11.334031696 -0700
-+++ go/src/make.bash	2015-07-29 13:36:55.814465630 -0700
-@@ -158,7 +158,7 @@
- fi
- 
- echo "##### Building packages and commands for $GOOS/$GOARCH."
--CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
-+CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
- echo
- 
- rm -f "$GOTOOLDIR"/go_bootstrap
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/gotooldir.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/gotooldir.patch
deleted file mode 100644
index 473a328..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/gotooldir.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Index: go/src/go/build/build.go
-===================================================================
---- go.orig/src/go/build/build.go
-+++ go/src/go/build/build.go
-@@ -1388,7 +1388,7 @@ func init() {
- }
- 
- // ToolDir is the directory containing build tools.
--var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
-+var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
- 
- // IsLocalImport reports whether the import path is
- // a local import path, like ".", "..", "./foo", or "../foo".
-Index: go/src/cmd/go/build.go
-===================================================================
---- go.orig/src/cmd/go/build.go
-+++ go/src/cmd/go/build.go
-@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
- 		}
- 
- 		cgoExe := tool("cgo")
--		if a.cgo != nil && a.cgo.target != "" {
-+		if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
- 			cgoExe = a.cgo.target
- 		}
- 		outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/split-host-and-target-build.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/split-host-and-target-build.patch
deleted file mode 100644
index 85fb240..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/split-host-and-target-build.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Index: go/src/make.bash
-===================================================================
---- go.orig/src/make.bash
-+++ go/src/make.bash
-@@ -143,12 +143,23 @@ if [ "$1" = "--no-clean" ]; then
- 	buildall=""
- 	shift
- fi
--./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
--# Delay move of dist tool to now, because bootstrap may clear tool directory.
--mv cmd/dist/dist "$GOTOOLDIR"/dist
--echo
- 
--if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
-+do_host_build="yes"
-+do_target_build="yes"
-+if [ "$1" = "--target-only" ]; then
-+	do_host_build="no"
-+	shift
-+elif [ "$1" = "--host-only" ]; then
-+	do_target_build="no"
-+	shift
-+fi
-+
-+if [ "$do_host_build" = "yes" ]; then
-+	./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
-+	# Delay move of dist tool to now, because bootstrap may clear tool directory.
-+	mv cmd/dist/dist "$GOTOOLDIR"/dist
-+	echo
-+
- 	echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
- 	# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
- 	# use the host compiler, CC, from `cmd/dist/dist env` instead.
-@@ -157,11 +168,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
- 	echo
- fi
- 
--echo "##### Building packages and commands for $GOOS/$GOARCH."
--CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
--echo
-+if [ "$do_target_build" = "yes" ]; then
-+    GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
-+    echo "##### Building packages and commands for $GOOS/$GOARCH."
-+    if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
-+	rm -rf ./host-tools
-+	mkdir ./host-tools
-+	mv "$GOTOOLDIR"/* ./host-tools
-+	GOTOOLDIR="$PWD/host-tools"
-+    fi
-+    GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
-+    echo
- 
--rm -f "$GOTOOLDIR"/go_bootstrap
-+    rm -f "$GOTOOLDIR"/go_bootstrap
-+fi
- 
- if [ "$1" != "--no-banner" ]; then
- 	"$GOTOOLDIR"/dist banner
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/syslog.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/syslog.patch
deleted file mode 100644
index ce82a4f..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.5/syslog.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
---- go/src/log/syslog/syslog.go	2013-11-28 13:38:28.000000000 -0800
-+++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go	2014-10-03 11:44:37.710403200 -0700
-@@ -33,6 +33,9 @@
- const severityMask = 0x07
- const facilityMask = 0xf8
- 
-+var writeTimeout = 1 * time.Second
-+var connectTimeout = 1 * time.Second
-+
- const (
- 	// Severity.
- 
-@@ -100,6 +103,7 @@
- type serverConn interface {
- 	writeString(p Priority, hostname, tag, s, nl string) error
- 	close() error
-+	setWriteDeadline(t time.Time) error
- }
- 
- type netConn struct {
-@@ -273,7 +277,11 @@
- 		nl = "\n"
- 	}
- 
--	err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
-+	err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
-+	if err != nil {
-+		return 0, err
-+	}
-+	err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
- 	if err != nil {
- 		return 0, err
- 	}
-@@ -305,6 +313,10 @@
- 	return n.conn.Close()
- }
- 
-+func (n *netConn) setWriteDeadline(t time.Time) error {
-+	return n.conn.SetWriteDeadline(t)
-+}
-+
- // NewLogger creates a log.Logger whose output is written to
- // the system log service with the specified priority. The logFlag
- // argument is the flag set passed through to log.New to create
-diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
---- go/src/log/syslog/syslog_unix.go	2013-11-28 13:38:28.000000000 -0800
-+++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go	2014-10-03 11:44:39.010403175 -0700
-@@ -19,7 +19,7 @@
- 	logPaths := []string{"/dev/log", "/var/run/syslog"}
- 	for _, network := range logTypes {
- 		for _, path := range logPaths {
--			conn, err := net.Dial(network, path)
-+			conn, err := net.DialTimeout(network, path, connectTimeout)
- 			if err != nil {
- 				continue
- 			} else {
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6.inc b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6.inc
deleted file mode 100644
index 7a57eaf..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-require go-common.inc
-
-PV = "1.6.2"
-GO_BASEVERSION = "1.6"
-FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
-
-
-SRC_URI += "\
-       file://armhf-elf-header.patch \
-       file://syslog.patch \
-       file://fix-target-cc-for-build.patch \
-       file://fix-cc-handling.patch \
-       file://split-host-and-target-build.patch \
-       file://gotooldir.patch \
-"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81"
-SRC_URI[md5sum] = "d1b50fa98d9a71eeee829051411e6207"
-SRC_URI[sha256sum] = "787b0b750d037016a30c6ed05a8a70a91b2e9db4bd9b1a2453aa502a63f1bccc"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/armhf-elf-header.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/armhf-elf-header.patch
deleted file mode 100644
index 6113138..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/armhf-elf-header.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Index: go/src/cmd/link/internal/ld/elf.go
-===================================================================
---- go.orig/src/cmd/link/internal/ld/elf.go
-+++ go/src/cmd/link/internal/ld/elf.go
-@@ -827,7 +827,13 @@
- 	// 32-bit architectures
- 	case '5':
- 		// we use EABI on both linux/arm and freebsd/arm.
--		if HEADTYPE == obj.Hlinux || HEADTYPE == obj.Hfreebsd {
-+		if HEADTYPE == obj.Hlinux {
-+			if Ctxt.Goarm == 7 {
-+				ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float
-+			} else {
-+				ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float
-+			}
-+		} else if HEADTYPE == obj.Hfreebsd {
- 			// We set a value here that makes no indication of which
- 			// float ABI the object uses, because this is information
- 			// used by the dynamic linker to compare executables and
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/fix-cc-handling.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/fix-cc-handling.patch
deleted file mode 100644
index 85770a9..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/fix-cc-handling.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-Index: go/src/cmd/go/build.go
-===================================================================
---- go.orig/src/cmd/go/build.go	2015-07-29 14:48:40.323185807 -0700
-+++ go/src/cmd/go/build.go	2015-07-30 07:37:40.529818586 -0700
-@@ -2805,12 +2805,24 @@
- 	return b.ccompilerCmd("CC", defaultCC, objdir)
- }
- 
-+// gccCmd returns a gcc command line prefix
-+// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
-+func (b *builder) gccCmdForReal() []string {
-+	return envList("CC", defaultCC)
-+}
-+
- // gxxCmd returns a g++ command line prefix
- // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
- func (b *builder) gxxCmd(objdir string) []string {
- 	return b.ccompilerCmd("CXX", defaultCXX, objdir)
- }
- 
-+// gxxCmd returns a g++ command line prefix
-+// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
-+func (b *builder) gxxCmdForReal() []string {
-+	return envList("CXX", defaultCXX)
-+}
-+
- // ccompilerCmd returns a command line prefix for the given environment
- // variable and using the default command when the variable is empty.
- func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string {
-Index: go/src/cmd/go/env.go
-===================================================================
---- go.orig/src/cmd/go/env.go	2015-07-29 14:48:40.323185807 -0700
-+++ go/src/cmd/go/env.go	2015-07-30 07:40:54.461655721 -0700
-@@ -52,10 +52,9 @@
- 
- 	if goos != "plan9" {
- 		cmd := b.gccCmd(".")
--		env = append(env, envVar{"CC", cmd[0]})
-+		env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
- 		env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
--		cmd = b.gxxCmd(".")
--		env = append(env, envVar{"CXX", cmd[0]})
-+		env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
- 	}
- 
- 	if buildContext.CgoEnabled {
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/fix-target-cc-for-build.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/fix-target-cc-for-build.patch
deleted file mode 100644
index adfeb6b..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/fix-target-cc-for-build.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: go/src/make.bash
-===================================================================
---- go.orig/src/make.bash	2015-07-29 13:28:11.334031696 -0700
-+++ go/src/make.bash	2015-07-29 13:36:55.814465630 -0700
-@@ -158,7 +158,7 @@
- fi
- 
- echo "##### Building packages and commands for $GOOS/$GOARCH."
--CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
-+CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
- echo
- 
- rm -f "$GOTOOLDIR"/go_bootstrap
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/gotooldir.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/gotooldir.patch
deleted file mode 100644
index 473a328..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/gotooldir.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Index: go/src/go/build/build.go
-===================================================================
---- go.orig/src/go/build/build.go
-+++ go/src/go/build/build.go
-@@ -1388,7 +1388,7 @@ func init() {
- }
- 
- // ToolDir is the directory containing build tools.
--var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
-+var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
- 
- // IsLocalImport reports whether the import path is
- // a local import path, like ".", "..", "./foo", or "../foo".
-Index: go/src/cmd/go/build.go
-===================================================================
---- go.orig/src/cmd/go/build.go
-+++ go/src/cmd/go/build.go
-@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
- 		}
- 
- 		cgoExe := tool("cgo")
--		if a.cgo != nil && a.cgo.target != "" {
-+		if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
- 			cgoExe = a.cgo.target
- 		}
- 		outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/split-host-and-target-build.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/split-host-and-target-build.patch
deleted file mode 100644
index 85fb240..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/split-host-and-target-build.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Index: go/src/make.bash
-===================================================================
---- go.orig/src/make.bash
-+++ go/src/make.bash
-@@ -143,12 +143,23 @@ if [ "$1" = "--no-clean" ]; then
- 	buildall=""
- 	shift
- fi
--./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
--# Delay move of dist tool to now, because bootstrap may clear tool directory.
--mv cmd/dist/dist "$GOTOOLDIR"/dist
--echo
- 
--if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
-+do_host_build="yes"
-+do_target_build="yes"
-+if [ "$1" = "--target-only" ]; then
-+	do_host_build="no"
-+	shift
-+elif [ "$1" = "--host-only" ]; then
-+	do_target_build="no"
-+	shift
-+fi
-+
-+if [ "$do_host_build" = "yes" ]; then
-+	./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
-+	# Delay move of dist tool to now, because bootstrap may clear tool directory.
-+	mv cmd/dist/dist "$GOTOOLDIR"/dist
-+	echo
-+
- 	echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
- 	# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
- 	# use the host compiler, CC, from `cmd/dist/dist env` instead.
-@@ -157,11 +168,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
- 	echo
- fi
- 
--echo "##### Building packages and commands for $GOOS/$GOARCH."
--CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
--echo
-+if [ "$do_target_build" = "yes" ]; then
-+    GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
-+    echo "##### Building packages and commands for $GOOS/$GOARCH."
-+    if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
-+	rm -rf ./host-tools
-+	mkdir ./host-tools
-+	mv "$GOTOOLDIR"/* ./host-tools
-+	GOTOOLDIR="$PWD/host-tools"
-+    fi
-+    GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
-+    echo
- 
--rm -f "$GOTOOLDIR"/go_bootstrap
-+    rm -f "$GOTOOLDIR"/go_bootstrap
-+fi
- 
- if [ "$1" != "--no-banner" ]; then
- 	"$GOTOOLDIR"/dist banner
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/syslog.patch b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/syslog.patch
deleted file mode 100644
index ce82a4f..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-1.6/syslog.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
---- go/src/log/syslog/syslog.go	2013-11-28 13:38:28.000000000 -0800
-+++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go	2014-10-03 11:44:37.710403200 -0700
-@@ -33,6 +33,9 @@
- const severityMask = 0x07
- const facilityMask = 0xf8
- 
-+var writeTimeout = 1 * time.Second
-+var connectTimeout = 1 * time.Second
-+
- const (
- 	// Severity.
- 
-@@ -100,6 +103,7 @@
- type serverConn interface {
- 	writeString(p Priority, hostname, tag, s, nl string) error
- 	close() error
-+	setWriteDeadline(t time.Time) error
- }
- 
- type netConn struct {
-@@ -273,7 +277,11 @@
- 		nl = "\n"
- 	}
- 
--	err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
-+	err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
-+	if err != nil {
-+		return 0, err
-+	}
-+	err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
- 	if err != nil {
- 		return 0, err
- 	}
-@@ -305,6 +313,10 @@
- 	return n.conn.Close()
- }
- 
-+func (n *netConn) setWriteDeadline(t time.Time) error {
-+	return n.conn.SetWriteDeadline(t)
-+}
-+
- // NewLogger creates a log.Logger whose output is written to
- // the system log service with the specified priority. The logFlag
- // argument is the flag set passed through to log.New to create
-diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
---- go/src/log/syslog/syslog_unix.go	2013-11-28 13:38:28.000000000 -0800
-+++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go	2014-10-03 11:44:39.010403175 -0700
-@@ -19,7 +19,7 @@
- 	logPaths := []string{"/dev/log", "/var/run/syslog"}
- 	for _, network := range logTypes {
- 		for _, path := range logPaths {
--			conn, err := net.Dial(network, path)
-+			conn, err := net.DialTimeout(network, path, connectTimeout)
- 			if err != nil {
- 				continue
- 			} else {
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-common.inc b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-common.inc
deleted file mode 100644
index f9587ea..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-common.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-SUMMARY = "Go programming language compiler"
-DESCRIPTION = " The Go programming language is an open source project to make \
- programmers more productive. Go is expressive, concise, clean, and\
- efficient. Its concurrency mechanisms make it easy to write programs\
- that get the most out of multicore and networked machines, while its\
- novel type system enables flexible and modular program construction.\
- Go compiles quickly to machine code yet has the convenience of\
- garbage collection and the power of run-time reflection. It's a\
- fast, statically typed, compiled language that feels like a\
- dynamically typed, interpreted language."
-HOMEPAGE = " http://golang.org/"
-LICENSE = "BSD-3-Clause"
-
-inherit go-osarchmap
-
-SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz"
-S = "${WORKDIR}/go"
-B = "${S}"
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-cross.inc b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-cross.inc
deleted file mode 100644
index 3174987..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-cross.inc
+++ /dev/null
@@ -1,59 +0,0 @@
-inherit cross
-
-# libgcc is required for the target specific libraries to build properly
-DEPENDS += "go-native libgcc"
-
-# Prevent runstrip from running because you get errors when the host arch != target arch
-#INHIBIT_PACKAGE_STRIP = "1"
-STRIP = "echo"
-
-export GOHOSTOS = "${BUILD_GOOS}"
-export GOHOSTARCH = "${BUILD_GOARCH}"
-export GOOS = "${TARGET_GOOS}"
-export GOARCH = "${TARGET_GOARCH}"
-export GOARM = "${TARGET_GOARM}"
-export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
-export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
-export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
-export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
-CC = "${@d.getVar('BUILD_CC', True).strip()}"
-
-do_configure[noexec] = "1"
-
-do_compile() {
-    export GOBIN="${B}/bin"    
-    rm -rf ${GOBIN} ${B}/pkg
-    mkdir ${GOBIN}
-
-    export TMPDIR=${WORKDIR}/build-tmp
-    mkdir -p ${WORKDIR}/build-tmp
-
-    cd src
-    ./make.bash --host-only
-    # Ensure cgo.a is built with the target toolchain
-    export GOBIN="${B}/target/bin"
-    rm -rf ${GOBIN}
-    mkdir -p ${GOBIN}
-    GO_FLAGS="-a" ./make.bash
-}
-
-do_install() {
-    install -d ${D}${libdir}/go
-    cp -a ${B}/pkg ${D}${libdir}/go/
-    install -d ${D}${libdir}/go/src
-    (cd ${S}/src; for d in *; do \
-        [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
-    done)
-    install -d ${D}${bindir}
-    for f in ${B}/bin/*
-    do
-        install -m755 $f ${D}${bindir}
-    done
-}
-
-do_package[noexec] = "1"
-do_packagedata[noexec] = "1"
-do_package_write_ipk[noexec] = "1"
-do_package_write_deb[noexec] = "1"
-do_package_write_rpm[noexec] = "1"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-cross_1.5.bb b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-cross_1.5.bb
deleted file mode 100644
index 80b5a03..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-cross_1.5.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-require go-cross.inc
-require go-${PV}.inc
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-cross_1.6.bb b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-cross_1.6.bb
deleted file mode 100644
index 80b5a03..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-cross_1.6.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-require go-cross.inc
-require go-${PV}.inc
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-native.inc b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-native.inc
deleted file mode 100644
index cb2dd2a..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-native.inc
+++ /dev/null
@@ -1,54 +0,0 @@
-inherit native
-
-export GOOS = "${BUILD_GOOS}"
-export GOARCH = "${BUILD_GOARCH}"
-export GOROOT_FINAL = "${STAGING_LIBDIR_NATIVE}/go"
-export CGO_ENABLED = "1"
-
-do_configure[noexec] = "1"
-
-do_compile() {
-    export GOBIN="${B}/bin"
-    rm -rf ${GOBIN}
-    mkdir ${GOBIN}
-
-    export TMPDIR=${WORKDIR}/build-tmp
-    mkdir -p ${WORKDIR}/build-tmp
-
-    cd src
-    CGO_ENABLED=0 ./make.bash --host-only
-}
-
-
-make_wrapper() {
-    rm -f ${D}${bindir}/$2
-    cat <<END >${D}${bindir}/$2
-#!/bin/bash
-here=\`dirname \$0\`
-export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
-\$here/../lib/go/bin/$1 "\$@"
-END
-    chmod +x ${D}${bindir}/$2
-}
-
-do_install() {
-    install -d ${D}${libdir}/go
-    cp -a ${B}/pkg ${D}${libdir}/go/
-    install -d ${D}${libdir}/go/src
-    (cd ${S}/src; for d in *; do \
-        [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
-    done)
-    install -d ${D}${bindir} ${D}${libdir}/go/bin
-    for f in ${B}/bin/*
-    do
-        base=`basename $f`
-        install -m755 $f ${D}${libdir}/go/bin
-        make_wrapper $base $base
-    done
-}
-
-do_package[noexec] = "1"
-do_packagedata[noexec] = "1"
-do_package_write_ipk[noexec] = "1"
-do_package_write_deb[noexec] = "1"
-do_package_write_rpm[noexec] = "1"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-native_1.4.bb b/import-layers/meta-virtualization/recipes-devtools/go-cross/go-native_1.4.bb
deleted file mode 100644
index cf186e7..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go-cross/go-native_1.4.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-require go-native.inc
-require go-${PV}.inc
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/compose-file_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/compose-file_git.bb
new file mode 100644
index 0000000..bcf8c3d
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/go/compose-file_git.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "Parser for the Compose file format (version 3)"
+HOMEPAGE = "https://github.com/aanand/compose-file"
+SECTION = "devel/go"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=9cd86830b557232ce55e2a6b47387471"
+
+SRCNAME = "compose-file"
+
+PKG_NAME = "github.com/aanand/${SRCNAME}"
+SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "a3e58764f50597b6217fec07e9bff7225c4a1719"
+PV = "3.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "go_compose_file_sysroot_preprocess"
+
+go_compose_file_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
+
+CLEANBROKEN = "1"
\ No newline at end of file
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/go-capability_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/go-capability_git.bb
index 4f8f431..8524af6 100644
--- a/import-layers/meta-virtualization/recipes-devtools/go/go-capability_git.bb
+++ b/import-layers/meta-virtualization/recipes-devtools/go/go-capability_git.bb
@@ -9,7 +9,8 @@
 PKG_NAME = "github.com/syndtr/${SRCNAME}"
 SRC_URI = "git://${PKG_NAME}.git"
 
-SRCREV = "8e4cdcb3c22b40d5e330ade0b68cb2e2a3cf6f98"
+SRCREV = "2c00daeb6c3b45114c80ac44119e7b8801fdd852"
+PV = "0.0+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/go-connections_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/go-connections_git.bb
new file mode 100644
index 0000000..5d071b0
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/go/go-connections_git.bb
@@ -0,0 +1,39 @@
+DESCRIPTION = "Utility package to work with network connections"
+HOMEPAGE = "https://github.com/docker/connections"
+SECTION = "devel/go"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=04424bc6f5a5be60691b9824d65c2ad8"
+
+SRCNAME = "go-connections"
+
+PKG_NAME = "github.com/docker/${SRCNAME}"
+SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "4ccf312bf1d35e5dbda654e57a9be4c3f3cd0366"
+PV = "0.2.1+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "go_connections_sysroot_preprocess"
+
+go_connections_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/go-dbus_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/go-dbus_git.bb
index 092bd50..9b206a1 100644
--- a/import-layers/meta-virtualization/recipes-devtools/go/go-dbus_git.bb
+++ b/import-layers/meta-virtualization/recipes-devtools/go/go-dbus_git.bb
@@ -2,15 +2,15 @@
 HOMEPAGE = "https://github.com/godbus/dbus"
 SECTION = "devel/go"
 LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=b5ac622301483800715d770434e27e5b"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=09042bd5c6c96a2b9e45ddf1bc517eed"
 
 SRCNAME = "dbus"
 
 PKG_NAME = "github.com/godbus/${SRCNAME}"
 SRC_URI = "git://${PKG_NAME}.git"
 
-SRCREV = "88765d85c0fdadcd98a54e30694fa4e4f5b51133"
-PV = "2+git${SRCREV}"
+SRCREV = "5f6efc7ef2759c81b7ba876593971bfce311eab3"
+PV = "4.0.0+git${SRCREV}"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/go-distribution-digest_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/go-distribution-digest_git.bb
deleted file mode 100644
index 2a803da..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/go/go-distribution-digest_git.bb
+++ /dev/null
@@ -1,32 +0,0 @@
-DESCRIPTION = "The Docker toolset to pack, ship, store, and deliver content"
-HOMEPAGE = "https://github.com/docker/distribution"
-SECTION = "devel/go"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=d2794c0df5b907fdace235a619d80314"
-
-SRCNAME = "distribution"
-
-PKG_NAME = "github.com/docker/${SRCNAME}"
-SRC_URI = "git://${PKG_NAME}.git"
-
-SRCREV = "d957768537c5af40e4f4cd96871f7b2bde9e2923"
-
-S = "${WORKDIR}/git"
-
-# NO-OP the do compile rule because this recipe is source only.
-do_compile() {
-}
-
-do_install() {
-	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
-	cp -r ${S}/LICENSE ${S}/digest ${D}${prefix}/local/go/src/${PKG_NAME}/
-}
-
-SYSROOT_PREPROCESS_FUNCS += "go_distribution_digeset_sysroot_preprocess"
-
-go_distribution_digeset_sysroot_preprocess () {
-    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
-    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
-}
-
-FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/go-distribution_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/go-distribution_git.bb
new file mode 100644
index 0000000..9e3f209
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/go/go-distribution_git.bb
@@ -0,0 +1,39 @@
+DESCRIPTION = "The Docker toolset to pack, ship, store, and deliver content"
+HOMEPAGE = "https://github.com/docker/distribution"
+SECTION = "devel/go"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=d2794c0df5b907fdace235a619d80314"
+
+SRCNAME = "distribution"
+
+PKG_NAME = "github.com/docker/${SRCNAME}"
+SRC_URI = "git://${PKG_NAME}.git;branch=docker/1.13;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "28602af35aceda2f8d571bad7ca37a54cf0250bc"
+PV = "2.6.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "go_distribution_digeset_sysroot_preprocess"
+
+go_distribution_digeset_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/go-fsnotify_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/go-fsnotify_git.bb
index e18f574..e5bcf14 100644
--- a/import-layers/meta-virtualization/recipes-devtools/go/go-fsnotify_git.bb
+++ b/import-layers/meta-virtualization/recipes-devtools/go/go-fsnotify_git.bb
@@ -9,8 +9,8 @@
 PKG_NAME = "github.com/go-fsnotify/${SRCNAME}"
 SRC_URI = "git://${PKG_NAME}.git"
 
-SRCREV = "ca50e738d35a862c379baf8fffbc3bfd080b3cff"
-PV = "1.0.4+git${SRCREV}"
+SRCREV = "836bfd95fecc0f1511dd66bdbf2b5b61ab8b00b6"
+PV = "1.2.11+git${SRCREV}"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/go-libtrust_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/go-libtrust_git.bb
index f2acfb4..5565946 100644
--- a/import-layers/meta-virtualization/recipes-devtools/go/go-libtrust_git.bb
+++ b/import-layers/meta-virtualization/recipes-devtools/go/go-libtrust_git.bb
@@ -9,7 +9,8 @@
 PKG_NAME = "github.com/docker/${SRCNAME}"
 SRC_URI = "git://${PKG_NAME}.git"
 
-SRCREV = "230dfd18c2326f1e9d08238710e67a1040187d07"
+SRCREV = "9cbd2a1374f46905c68a4eb3694a130610adc62a"
+PV = "0.0+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/go-logrus_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/go-logrus_git.bb
index 082c1a6..5c0c359 100644
--- a/import-layers/meta-virtualization/recipes-devtools/go/go-logrus_git.bb
+++ b/import-layers/meta-virtualization/recipes-devtools/go/go-logrus_git.bb
@@ -9,8 +9,8 @@
 PKG_NAME = "github.com/Sirupsen/${SRCNAME}"
 SRC_URI = "git://${PKG_NAME}.git"
 
-SRCREV = "3fc34d061b9c78a70db853c7cb6b0576b6d4f32d"
-PV = "0.7.1+git${SRCREV}"
+SRCREV = "d26492970760ca5d33129d2d799e34be5c4782eb"
+PV = "0.11.0+git${SRCREV}"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/go-patricia_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/go-patricia_git.bb
index 18c188d..8c1e10d 100644
--- a/import-layers/meta-virtualization/recipes-devtools/go/go-patricia_git.bb
+++ b/import-layers/meta-virtualization/recipes-devtools/go/go-patricia_git.bb
@@ -9,8 +9,8 @@
 PKG_NAME = "github.com/tchap/${SRCNAME}"
 SRC_URI = "git://${PKG_NAME}.git"
 
-SRCREV = "f64d0a63cd3363481c898faa9339de04d12213f9"
-PV = "1.0.1+git${SRCPV}"
+SRCREV = "666120de432aea38ab06bd5c818f04f4129882c9"
+PV = "2.2.6+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/go-systemd_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/go-systemd_git.bb
index 358e6bb..5cbab92 100644
--- a/import-layers/meta-virtualization/recipes-devtools/go/go-systemd_git.bb
+++ b/import-layers/meta-virtualization/recipes-devtools/go/go-systemd_git.bb
@@ -9,8 +9,12 @@
 PKG_NAME = "github.com/coreos/go-${SRCNAME}"
 SRC_URI = "git://${PKG_NAME}.git"
 
-SRCREV = "f743bc15d6bddd23662280b4ad20f7c874cdd5ad"
-PV = "2+git${SRCREV}"
+SRCREV = "b4a58d95188dd092ae20072bac14cece0e67c388"
+PV = "4+git${SRCREV}"
+
+DEPENDS += " \
+    bash \
+"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/grpc-go_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/grpc-go_git.bb
new file mode 100644
index 0000000..48c4249
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/go/grpc-go_git.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "The Go language implementation of gRPC. HTTP/2 based RPC"
+HOMEPAGE = "https://github.com/grpc/grpc-go"
+SECTION = "devel/go"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=a4bad33881612090c6035d8393175996"
+
+SRCNAME = "grpc-go"
+
+PKG_NAME = "google.golang.org/grpc"
+SRC_URI = "git://github.com/grpc/${SRCNAME}.git;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "777daa17ff9b5daef1cfdf915088a2ada3332bf0"
+PV = "1.4.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "go_grpc_sysroot_preprocess"
+
+go_grpc_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += " \
+    ${prefix}/local/go/src/${PKG_NAME}/* \
+"
diff --git a/import-layers/meta-virtualization/recipes-devtools/go/notary_git.bb b/import-layers/meta-virtualization/recipes-devtools/go/notary_git.bb
new file mode 100644
index 0000000..d638dc1
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/go/notary_git.bb
@@ -0,0 +1,39 @@
+DESCRIPTION = "Notary is a Docker project that allows anyone to have trust over arbitrary collections of data"
+HOMEPAGE = "https://github.com/docker/notary"
+SECTION = "devel/go"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=771ddb425ba03c8fab49e5bd9854a4a2"
+
+SRCNAME = "notary"
+
+PKG_NAME = "github.com/docker/${SRCNAME}"
+SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
+
+SRCREV = "c8aa8cf53cbcda2e92def0c9291e25d770493494"
+PV = "0.4.2+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# NO-OP the do compile rule because this recipe is source only.
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
+	for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go"); do
+	    if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
+	        mkdir -p ${D}${prefix}/local/go/$(dirname $j)
+	    fi
+	    cp $j ${D}${prefix}/local/go/$j
+	done
+	cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "go_notary_sysroot_preprocess"
+
+go_notary_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
+    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
+}
+
+FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
diff --git a/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf-native_3.0.0.bb b/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf-native_3.0.0.bb
deleted file mode 100644
index 33467b3..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf-native_3.0.0.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "protobuf"
-DESCRIPTION = "Protocol Buffers are a way of encoding structured data in \
-an efficient yet extensible format. Google uses Protocol Buffers for \
-almost all of its internal RPC protocols and file formats."
-HOMEPAGE = "http://code.google.com/p/protobuf/"
-SECTION = "console/tools"
-LICENSE = "BSD-3-Clause"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=35953c752efc9299b184f91bef540095"
-
-PR = "r0"
-
-SRC_URI[md5sum] = "d4f6ca65aadc6310b3872ee421e79fa6"
-SRC_URI[sha256sum] = "f5b3563f118f1d3d6e001705fa7082e8fc3bda50038ac3dff787650795734146"
-SRC_URI = "https://github.com/google/protobuf/archive/v3.0.0.tar.gz;downloadfilename=protobuf-3.0.0.tar.gz \
-	"
-
-EXTRA_OECONF += " --with-protoc=echo --disable-shared"
-
-inherit native autotools
-
diff --git a/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf-native_3.1.0.bb b/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf-native_3.1.0.bb
new file mode 100644
index 0000000..c32f627
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf-native_3.1.0.bb
@@ -0,0 +1,19 @@
+SUMMARY = "protobuf"
+DESCRIPTION = "Protocol Buffers are a way of encoding structured data in \
+an efficient yet extensible format. Google uses Protocol Buffers for \
+almost all of its internal RPC protocols and file formats."
+HOMEPAGE = "http://code.google.com/p/protobuf/"
+SECTION = "console/tools"
+LICENSE = "BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=35953c752efc9299b184f91bef540095"
+
+SRC_URI[md5sum] = "14a532a7538551d5def317bfca41dace"
+SRC_URI[sha256sum] = "0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7"
+SRC_URI = "https://github.com/google/protobuf/archive/v3.1.0.tar.gz;downloadfilename=protobuf-3.1.0.tar.gz \
+	"
+
+EXTRA_OECONF += " --with-protoc=echo"
+
+inherit native autotools
+
diff --git a/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf_3.0.0.bb b/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf_3.0.0.bb
deleted file mode 100644
index fd81fe7..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf_3.0.0.bb
+++ /dev/null
@@ -1,98 +0,0 @@
-SUMMARY = "protobuf"
-DESCRIPTION = "Protocol Buffers are a way of encoding structured data in \
-an efficient yet extensible format. Google uses Protocol Buffers for \
-almost all of its internal RPC protocols and file formats."
-HOMEPAGE = "http://code.google.com/p/protobuf/"
-SECTION = "console/tools"
-LICENSE = "BSD-3-Clause"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=35953c752efc9299b184f91bef540095"
-
-PR = "r0"
-EXCLUDE_FROM_WORLD = "1"
-
-SRC_URI[md5sum] = "d4f6ca65aadc6310b3872ee421e79fa6"
-SRC_URI[sha256sum] = "f5b3563f118f1d3d6e001705fa7082e8fc3bda50038ac3dff787650795734146"
-SRC_URI = "https://github.com/google/protobuf/archive/v3.0.0.tar.gz;downloadfilename=protobuf-3.0.0.tar.gz\
-	        file://protobuf-allow-running-python-scripts-from-anywhere.patch \
-	        file://run-ptest \
-            "
-
-COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
-
-EXTRA_OECONF += " --with-protoc=${STAGING_BINDIR_NATIVE}/protoc"
-inherit autotools setuptools ptest
-
-DEPENDS += "protobuf-native"
-RDEPENDS_${PN}-ptest = "bash"
-
-PYTHON_SRC_DIR="python"
-TEST_SRC_DIR="examples"
-LANG_SUPPORT="cpp python"
-
-do_compile() {
-	# Compile protoc compiler
-	base_do_compile
-}
-
-do_compile_ptest() {
-	# Modify makefile to use the cross-compiler
-	sed -e "s|c++|${CXX} \$(LDFLAGS)|g" -i "${S}/${TEST_SRC_DIR}/Makefile"
-
-	mkdir -p "${B}/${TEST_SRC_DIR}"
-
-	# Add the location of the cross-compiled header and library files
-	# which haven't been installed yet.
-	cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc"
-	sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
-	sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
-	sed -e 's|Libs:|Libs: -L${B}/src/.libs|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
-	export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}"
-
-	# Save the pkgcfg sysroot variable, and update it to nothing so
-	# that it doesn't append the sysroot to the beginning of paths.
-	# The header and library files aren't installed to the target
-	# system yet.  So the absolute paths were specified above.
-	save_pkg_config_sysroot_dir=$PKG_CONFIG_SYSROOT_DIR
-	export PKG_CONFIG_SYSROOT_DIR=
-
-	# Compile the tests
-	for lang in ${LANG_SUPPORT}; do
-		oe_runmake -C "${S}/${TEST_SRC_DIR}" ${lang}
-	done
-
-	# Restore the pkgconfig sysroot variable
-	export PKG_CONFIG_SYSROOT_DIR=$save_pkg_config_sysroot_dir
-}
-
-do_install() {
-	local olddir=`pwd`
-
-	# Install protoc compiler
-	autotools_do_install
-
-	# Install header files
-	export PROTOC="${STAGING_BINDIR_NATIVE}/protoc"
-	cd "${S}/${PYTHON_SRC_DIR}"
-	distutils_do_install
-
-	cd "$olddir"
-}
-
-do_install_ptest() {
-	local olddir=`pwd`
-
-	cd "${S}/${TEST_SRC_DIR}"
-	install -d "${D}/${PTEST_PATH}"
-	for i in add_person* list_people*; do
-		if [ -x "$i" ]; then
-			install "$i" "${D}/${PTEST_PATH}"
-		fi
-	done
-	cp "${S}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}"
-	
-	cd "$olddir"
-}
-
-BBCLASSEXTEND = "nativesdk"
-
diff --git a/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf_3.1.0.bb b/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf_3.1.0.bb
new file mode 100644
index 0000000..b948e66
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/protobuf/protobuf_3.1.0.bb
@@ -0,0 +1,98 @@
+SUMMARY = "protobuf"
+DESCRIPTION = "Protocol Buffers are a way of encoding structured data in \
+an efficient yet extensible format. Google uses Protocol Buffers for \
+almost all of its internal RPC protocols and file formats."
+HOMEPAGE = "http://code.google.com/p/protobuf/"
+SECTION = "console/tools"
+LICENSE = "BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=35953c752efc9299b184f91bef540095"
+
+PR = "r0"
+EXCLUDE_FROM_WORLD = "1"
+
+SRC_URI[md5sum] = "14a532a7538551d5def317bfca41dace"
+SRC_URI[sha256sum] = "0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7"
+SRC_URI = "https://github.com/google/protobuf/archive/v3.1.0.tar.gz;downloadfilename=protobuf-3.1.0.tar.gz\
+	        file://protobuf-allow-running-python-scripts-from-anywhere.patch \
+	        file://run-ptest \
+            "
+
+COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
+
+EXTRA_OECONF += " --with-protoc=${STAGING_BINDIR_NATIVE}/protoc"
+inherit autotools setuptools ptest
+
+DEPENDS += "protobuf-native"
+RDEPENDS_${PN}-ptest = "bash"
+
+PYTHON_SRC_DIR="python"
+TEST_SRC_DIR="examples"
+LANG_SUPPORT="cpp python"
+
+do_compile() {
+	# Compile protoc compiler
+	base_do_compile
+}
+
+do_compile_ptest() {
+	# Modify makefile to use the cross-compiler
+	sed -e "s|c++|${CXX} \$(LDFLAGS)|g" -i "${S}/${TEST_SRC_DIR}/Makefile"
+
+	mkdir -p "${B}/${TEST_SRC_DIR}"
+
+	# Add the location of the cross-compiled header and library files
+	# which haven't been installed yet.
+	cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc"
+	sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
+	sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
+	sed -e 's|Libs:|Libs: -L${B}/src/.libs|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
+	export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}"
+
+	# Save the pkgcfg sysroot variable, and update it to nothing so
+	# that it doesn't append the sysroot to the beginning of paths.
+	# The header and library files aren't installed to the target
+	# system yet.  So the absolute paths were specified above.
+	save_pkg_config_sysroot_dir=$PKG_CONFIG_SYSROOT_DIR
+	export PKG_CONFIG_SYSROOT_DIR=
+
+	# Compile the tests
+	for lang in ${LANG_SUPPORT}; do
+		oe_runmake -C "${S}/${TEST_SRC_DIR}" ${lang}
+	done
+
+	# Restore the pkgconfig sysroot variable
+	export PKG_CONFIG_SYSROOT_DIR=$save_pkg_config_sysroot_dir
+}
+
+do_install() {
+	local olddir=`pwd`
+
+	# Install protoc compiler
+	autotools_do_install
+
+	# Install header files
+	export PROTOC="${STAGING_BINDIR_NATIVE}/protoc"
+	cd "${S}/${PYTHON_SRC_DIR}"
+	distutils_do_install
+
+	cd "$olddir"
+}
+
+do_install_ptest() {
+	local olddir=`pwd`
+
+	cd "${S}/${TEST_SRC_DIR}"
+	install -d "${D}/${PTEST_PATH}"
+	for i in add_person* list_people*; do
+		if [ -x "$i" ]; then
+			install "$i" "${D}/${PTEST_PATH}"
+		fi
+	done
+	cp "${S}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}"
+	
+	cd "$olddir"
+}
+
+BBCLASSEXTEND = "nativesdk"
+
diff --git a/import-layers/meta-virtualization/recipes-devtools/python/python-six_1.10.0.bb b/import-layers/meta-virtualization/recipes-devtools/python/python-six_1.10.0.bb
index a84a4c4..c279f9f 100644
--- a/import-layers/meta-virtualization/recipes-devtools/python/python-six_1.10.0.bb
+++ b/import-layers/meta-virtualization/recipes-devtools/python/python-six_1.10.0.bb
@@ -15,3 +15,5 @@
 S = "${WORKDIR}/${SRCNAME}-${PV}"
 
 inherit setuptools
+
+BBCLASSEXTEND = "native"
\ No newline at end of file
diff --git a/import-layers/meta-virtualization/recipes-devtools/python/python-sphinx_1.3.1.bb b/import-layers/meta-virtualization/recipes-devtools/python/python-sphinx_1.3.1.bb
deleted file mode 100644
index d8cef30..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/python/python-sphinx_1.3.1.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-DESCRIPTION = "Python documentation generator"
-HOMEPAGE = "http://sphinx-doc.org/"
-SECTION = "devel/python"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=6dd095eaa1e7a662b279daf80ecad7e6"
-
-PR = "r0"
-SRCNAME = "Sphinx"
-
-SRC_URI = "https://pypi.python.org/packages/source/S/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "8786a194acf9673464c5455b11fd4332"
-SRC_URI[sha256sum] = "1a6e5130c2b42d2de301693c299f78cc4bd3501e78b610c08e45efc70e2b5114"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit setuptools
diff --git a/import-layers/meta-virtualization/recipes-devtools/python/python-sphinx_1.4.1.bb b/import-layers/meta-virtualization/recipes-devtools/python/python-sphinx_1.4.1.bb
new file mode 100644
index 0000000..b4ae86b
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/python/python-sphinx_1.4.1.bb
@@ -0,0 +1,17 @@
+DESCRIPTION = "Python documentation generator"
+HOMEPAGE = "http://sphinx-doc.org/"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=72f034adc6f7b05b09bc00d1a05bb065"
+
+PR = "r0"
+SRCNAME = "Sphinx"
+
+SRC_URI = "https://pypi.python.org/packages/source/S/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "4c4988e0306a04cef8dccc384281e585"
+SRC_URI[sha256sum] = "c6871a784d24aba9270b6b28541537a57e2fcf4d7c799410eba18236bc76d6bc"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
diff --git a/import-layers/meta-virtualization/recipes-devtools/python/python-sqlalchemy_1.0.16.bb b/import-layers/meta-virtualization/recipes-devtools/python/python-sqlalchemy_1.0.16.bb
new file mode 100644
index 0000000..5eb60b5
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/python/python-sqlalchemy_1.0.16.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "Python SQL toolkit and Object Relational Mapper that gives \
+application developers the full power and flexibility of SQL"
+HOMEPAGE = "http://www.sqlalchemy.org/"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d7dba1721bc8ce05d421f7279cb87971"
+RDEPENDS_${PN} += "python-numbers"
+
+SRCNAME = "SQLAlchemy"
+SRC_URI = "https://pypi.io/packages/source/S/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "42c81726e7e145c206dac46964b4a167"
+SRC_URI[sha256sum] = "e2dfdaa0983931ac1b0522dd637f08a52cf3081746513ac79c50843277ebe463"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
diff --git a/import-layers/meta-virtualization/recipes-devtools/python/python-sqlalchemy_1.0.8.bb b/import-layers/meta-virtualization/recipes-devtools/python/python-sqlalchemy_1.0.8.bb
deleted file mode 100644
index 2d66ffd..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/python/python-sqlalchemy_1.0.8.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-DESCRIPTION = "Python SQL toolkit and Object Relational Mapper that gives \
-application developers the full power and flexibility of SQL"
-HOMEPAGE = "http://www.sqlalchemy.org/"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=cf755cb27ad4331d45dbb4db5172fd33"
-RDEPENDS_${PN} += "python-numbers"
-
-SRCNAME = "SQLAlchemy"
-SRC_URI = "https://pypi.python.org/packages/source/S/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "7cfd005be63945c96a78c67764ac3a85"
-SRC_URI[sha256sum] = "950c79c0abf9e9f99c43c627c51d40d14a946810a90c35e7cd827bfd0bffe46f"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit setuptools
diff --git a/import-layers/meta-virtualization/recipes-devtools/python/python-sqlalchemy_1.1.5.bb b/import-layers/meta-virtualization/recipes-devtools/python/python-sqlalchemy_1.1.5.bb
new file mode 100644
index 0000000..63caeb4
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/python/python-sqlalchemy_1.1.5.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "Python SQL toolkit and Object Relational Mapper that gives \
+application developers the full power and flexibility of SQL"
+HOMEPAGE = "http://www.sqlalchemy.org/"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=452f4b8adb0feba42e5be5f1fbfbf538"
+RDEPENDS_${PN} += "python-numbers"
+
+SRCNAME = "SQLAlchemy"
+SRC_URI = "https://pypi.python.org/packages/da/04/8048a5075d6e29235bbd6f1ea092a38dbe2630c670e73d4aa923a4e5521c/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "50685d97dca4b91945ae6309d03ab8c9"
+SRC_URI[sha256sum] = "68fb40049690e567ebda7b270176f5abf0d53d9fbd515fec4e43326f601119b6"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
diff --git a/import-layers/meta-virtualization/recipes-devtools/python/python-webob_1.4.1.bb b/import-layers/meta-virtualization/recipes-devtools/python/python-webob_1.4.1.bb
deleted file mode 100644
index e566363..0000000
--- a/import-layers/meta-virtualization/recipes-devtools/python/python-webob_1.4.1.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-DESCRIPTION = "WSGI request and response object"
-HOMEPAGE = "http://webob.org/"
-SECTION = "devel/python"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://docs/license.txt;md5=8ed3584bcc78c16da363747ccabc5af5"
-
-PR = "r0"
-SRCNAME = "WebOb"
-
-SRC_URI = "https://pypi.python.org/packages/source/W/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "a5c6e8ba5431756e6a5d5ec56047ec94"
-SRC_URI[sha256sum] = "12f8b98390befc47336d2c0e5bad9cc48609d808eabb3f8675dc1027a3a9e9db"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit setuptools
-
-RDEPENDS_${PN} += " \
-	python-sphinx \
-	python-nose \
-	"
-
diff --git a/import-layers/meta-virtualization/recipes-devtools/python/python-webob_1.6.0.bb b/import-layers/meta-virtualization/recipes-devtools/python/python-webob_1.6.0.bb
new file mode 100644
index 0000000..93f2acf
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-devtools/python/python-webob_1.6.0.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "WSGI request and response object"
+HOMEPAGE = "http://webob.org/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://docs/license.txt;md5=8ed3584bcc78c16da363747ccabc5af5"
+
+PR = "r0"
+SRCNAME = "WebOb"
+
+SRC_URI = "https://pypi.python.org/packages/source/W/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "089d7fc6745f175737800237c7287802"
+SRC_URI[sha256sum] = "63d262d8f61b516321f786879c9277fa2209f7f57eb47b537eeecfea383d55b7"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} += " \
+	python-sphinx \
+	python-nose \
+	"
+
diff --git a/import-layers/meta-virtualization/recipes-extended/kvmtool/files/0001-Avoid-pointers-for-address-of-packed-members.patch b/import-layers/meta-virtualization/recipes-extended/kvmtool/files/0001-Avoid-pointers-for-address-of-packed-members.patch
new file mode 100644
index 0000000..863e86a
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/kvmtool/files/0001-Avoid-pointers-for-address-of-packed-members.patch
@@ -0,0 +1,39 @@
+From 2e22df7c24dadf5e16004cd832cabca76a699d4d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 21 Mar 2017 23:32:39 -0700
+Subject: [PATCH] Avoid pointers for address of packed members
+
+Fixes Clang warning due to -Waddress-of-packed-member
+
+virtio/blk.c:161:37: error: taking address of packed member 'geometry' of class or structure 'virtio_blk_config' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
+        struct virtio_blk_geometry *geo = &conf->geometry;
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ virtio/blk.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/virtio/blk.c b/virtio/blk.c
+index c485e4f..1f7365d 100644
+--- a/virtio/blk.c
++++ b/virtio/blk.c
+@@ -158,7 +158,6 @@ static void set_guest_features(struct kvm *kvm, void *dev, u32 features)
+ {
+ 	struct blk_dev *bdev = dev;
+ 	struct virtio_blk_config *conf = &bdev->blk_config;
+-	struct virtio_blk_geometry *geo = &conf->geometry;
+ 
+ 	bdev->features = features;
+ 
+@@ -167,7 +166,7 @@ static void set_guest_features(struct kvm *kvm, void *dev, u32 features)
+ 	conf->seg_max = virtio_host_to_guest_u32(&bdev->vdev, conf->seg_max);
+ 
+ 	/* Geometry */
+-	geo->cylinders = virtio_host_to_guest_u16(&bdev->vdev, geo->cylinders);
++	conf->geometry.cylinders = virtio_host_to_guest_u16(&bdev->vdev, conf->geometry.cylinders);
+ 
+ 	conf->blk_size = virtio_host_to_guest_u32(&bdev->vdev, conf->blk_size);
+ 	conf->min_io_size = virtio_host_to_guest_u16(&bdev->vdev, conf->min_io_size);
+-- 
+2.12.0
+
diff --git a/import-layers/meta-virtualization/recipes-extended/kvmtool/kvmtool.bb b/import-layers/meta-virtualization/recipes-extended/kvmtool/kvmtool.bb
index 3f299dd..b3bf202 100644
--- a/import-layers/meta-virtualization/recipes-extended/kvmtool/kvmtool.bb
+++ b/import-layers/meta-virtualization/recipes-extended/kvmtool/kvmtool.bb
@@ -8,9 +8,10 @@
 
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git \
            file://external-crosscompiler.patch \
-    "
+           file://0001-Avoid-pointers-for-address-of-packed-members.patch \
+           "
 
-SRCREV = "0093df80d754e1a05b016e5a4ccd4b51a00c562c"
+SRCREV = "3fea89a924511f9f8fe05a892098fad77c1eca0d"
 PV = "3.18.0+git${SRCREV}"
 
 S = "${WORKDIR}/git"
diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-1.3.5/0001-Added-configure-variable-for-placing-systemd-untis-l.patch b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-1.3.5/0001-Added-configure-variable-for-placing-systemd-untis-l.patch
new file mode 100644
index 0000000..a64739c
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-1.3.5/0001-Added-configure-variable-for-placing-systemd-untis-l.patch
@@ -0,0 +1,55 @@
+From 531178d7fbb5d4b3404766cfd0fc999398cccd58 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 8 Feb 2017 18:39:48 +0200
+Subject: [PATCH] Added configure variable for placing systemd untis location
+
+Upstream-Status: Pending
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ configure.ac       | 3 +++
+ daemon/Makefile.am | 1 -
+ tools/Makefile.am  | 1 -
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0e5b8e3..5a6408c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2687,6 +2687,9 @@ AC_DEFINE_UNQUOTED([isbase64],[libvirt_gl_isbase64],[Hack to avoid symbol clash]
+ AC_DEFINE_UNQUOTED([base64_encode],[libvirt_gl_base64_encode],[Hack to avoid symbol clash])
+ AC_DEFINE_UNQUOTED([base64_encode_alloc],[libvirt_gl_base64_encode_alloc],[Hack to avoid symbol clash])
+ 
++AC_ARG_VAR(SYSTEMD_UNIT_DIR, 'location for systemd units, defautls to /lib/systemd/system')
++AS_IF([test "x$SYSTEMD_UNIT_DIR" = "x"], [SYSTEMD_UNIT_DIR="/lib/systemd/system"])
++
+ AC_CONFIG_FILES([run],
+                 [chmod +x,-w run])
+ AC_CONFIG_FILES([\
+diff --git a/daemon/Makefile.am b/daemon/Makefile.am
+index edb75e8..2ab42a6 100644
+--- a/daemon/Makefile.am
++++ b/daemon/Makefile.am
+@@ -449,7 +449,6 @@ endif ! LIBVIRT_INIT_SCRIPT_UPSTART
+ 
+ if LIBVIRT_INIT_SCRIPT_SYSTEMD
+ 
+-SYSTEMD_UNIT_DIR = /lib/systemd/system
+ BUILT_SOURCES += libvirtd.service
+ 
+ install-init-systemd: install-sysconfig libvirtd.service
+diff --git a/tools/Makefile.am b/tools/Makefile.am
+index 27ecbf1..8cefe1a 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -380,7 +380,6 @@ libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh
+ 
+ 
+ EXTRA_DIST += libvirt-guests.service.in
+-SYSTEMD_UNIT_DIR = /lib/systemd/system
+ 
+ if LIBVIRT_INIT_SCRIPT_SYSTEMD
+ install-systemd: libvirt-guests.service install-sysconfig libvirt-guests.sh
+-- 
+2.7.4
+
diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-python.inc b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-python.inc
index bc2f1de..15aa804 100644
--- a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-python.inc
+++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-python.inc
@@ -32,7 +32,7 @@
     --install-data=${datadir}"
 
 python __anonymous () {
-    pkgconfig = d.getVar('PACKAGECONFIG', True)
+    pkgconfig = d.getVar('PACKAGECONFIG')
     if ('python') in pkgconfig.split():
         d.setVar('LIBVIRT_PYTHON_ENABLE', '1')
     else:
diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt_1.3.5.bb b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt_1.3.5.bb
index fad5632..19b7567 100644
--- a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt_1.3.5.bb
+++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt_1.3.5.bb
@@ -7,7 +7,8 @@
 SECTION = "console/tools"
 
 DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \
-	   iptables dnsmasq readline libtasn1 libxslt-native"
+	   iptables dnsmasq readline libtasn1 libxslt-native acl libdevmapper \
+	   ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'shadow-native', '', d)}"
 
 # libvirt-guests.sh needs gettext.sh
 #
@@ -37,6 +38,7 @@
            file://0001-qemu-Let-empty-default-VNC-password-work-as-document.patch \
            file://0001-ptest-add-missing-test_helper-files.patch \
            file://0001-ptest-Remove-Windows-1252-check-from-esxutilstest.patch \
+	   file://0001-Added-configure-variable-for-placing-systemd-untis-l.patch \
           "
 
 SRC_URI[libvirt.md5sum] = "f9dc1e63d559eca50ae0ee798a4c6c6d"
@@ -117,7 +119,8 @@
 FILES_${PN}-virsh = "${bindir}/virsh"
 FILES_${PN} += "${libdir}/libvirt/connection-driver \
 	    ${datadir}/augeas \
-	    ${datadir}/polkit-1"
+	    ${@bb.utils.contains('PACKAGECONFIG', 'polkit', '${datadir}/polkit-1', '', d)} \
+	    "
 
 FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug"
 FILES_${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a"
@@ -208,6 +211,7 @@
 PACKAGECONFIG[fuse] = "--with-fuse,--without-fuse,fuse,"
 PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
 PACKAGECONFIG[libcap-ng] = "--with-capng,--without-capng,libcap-ng,"
+PACKAGECONFIG[wireshark] = "--with-wireshark-dissector,--without-wireshark-dissector,wireshark libwsutil,"
 
 # Enable the Python tool support
 require libvirt-python.inc
@@ -250,6 +254,15 @@
 	echo "d root root 0755 ${localstatedir}/run/libvirt/qemu none" \
 	     >> ${D}${sysconfdir}/default/volatiles/99_libvirt
 
+	# Manually set permissions and ownership to match polkit recipe
+	if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
+		install -d -m 0700 ${D}/${datadir}/polkit-1/rules.d
+		chown polkitd ${D}/${datadir}/polkit-1/rules.d
+		chgrp root ${D}/${datadir}/polkit-1/rules.d
+	else
+		rm -rf ${D}/${datadir}/polkit-1
+	fi
+
 	# Add hook support for libvirt
 	mkdir -p ${D}/etc/libvirt/hooks
 
@@ -263,7 +276,7 @@
     --with-init-script=systemd \
     "
 
-EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH}"
+EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH} SYSTEMD_UNIT_DIR=${systemd_system_unitdir}"
 
 do_compile_ptest() {
 	oe_runmake -C tests buildtest-TESTS
diff --git a/import-layers/meta-virtualization/recipes-extended/seabios/seabios_1.9.1.bb b/import-layers/meta-virtualization/recipes-extended/seabios/seabios_1.9.1.bb
index 88f2963..5c095ac 100644
--- a/import-layers/meta-virtualization/recipes-extended/seabios/seabios_1.9.1.bb
+++ b/import-layers/meta-virtualization/recipes-extended/seabios/seabios_1.9.1.bb
@@ -23,6 +23,8 @@
 EXTRA_OEMAKE += "HOSTCC='${BUILD_CC}'"
 EXTRA_OEMAKE += "CROSS_PREFIX=${TARGET_PREFIX}"
 
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
+
 do_configure() {
     oe_runmake defconfig
 }
diff --git a/import-layers/meta-virtualization/recipes-extended/xen/xen-arch.inc b/import-layers/meta-virtualization/recipes-extended/xen/xen-arch.inc
index 844d47d..fb0093e 100644
--- a/import-layers/meta-virtualization/recipes-extended/xen/xen-arch.inc
+++ b/import-layers/meta-virtualization/recipes-extended/xen/xen-arch.inc
@@ -6,7 +6,7 @@
 
 def map_xen_arch(a, d):
     import re
-    valid_archs = d.getVar('valid_xen_archs', True).split()
+    valid_archs = d.getVar('valid_xen_archs').split()
 
     if   re.match("i.86", a):        return "x86_32"
     elif re.match("x86.64", a):      return "x86_64"
diff --git a/import-layers/meta-virtualization/recipes-extended/xen/xen.inc b/import-layers/meta-virtualization/recipes-extended/xen/xen.inc
index b5c5f03..37fb4ce 100644
--- a/import-layers/meta-virtualization/recipes-extended/xen/xen.inc
+++ b/import-layers/meta-virtualization/recipes-extended/xen/xen.inc
@@ -7,7 +7,7 @@
 
 COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux'
 
-inherit autotools-brokensep gettext setuptools update-rc.d systemd deploy
+inherit autotools-brokensep setuptools update-rc.d systemd deploy
 
 require xen-arch.inc
 
@@ -22,14 +22,16 @@
 PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,virtual/libsdl,"
 PACKAGECONFIG[xsm] = "--enable-xsmpolicy,--disable-xsmpolicy,checkpolicy-native,"
 PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd,"
-PACKAGECONFIG[hvm] = "--with-system-seabios="${STAGING_DIR_HOST}/usr/share/firmware/bios.bin",--disable-seabios,seabios ipxe vgabios,"
+PACKAGECONFIG[hvm] = "--with-system-seabios="/usr/share/firmware/bios.bin",--disable-seabios,seabios ipxe vgabios,"
 
 DEPENDS = " \
     bison-native \
     dev86-native \
     flex-native \
     file-native \
+    gettext-native \
     iasl-native \
+    ncurses-native \
     util-linux-native \
     xz-native \
     bridge-utils \
@@ -178,6 +180,8 @@
     ${PN}-libxencall-dev \
     ${PN}-libxenctrl \
     ${PN}-libxenctrl-dev \
+    ${PN}-libxendevicemodel \
+    ${PN}-libxendevicemodel-dev \
     ${PN}-libxenevtchn \
     ${PN}-libxenevtchn-dev \
     ${PN}-libxenforeignmemory \
@@ -275,25 +279,52 @@
     "
 
 FILES_${PN}-libblktapctl = "${libdir}/libblktapctl.so.*"
-FILES_${PN}-libblktapctl-dev = "${libdir}/libblktapctl.so"
+FILES_${PN}-libblktapctl-dev = " \
+    ${libdir}/libblktapctl.so \
+    ${datadir}/pkgconfig/xenblktapctl.pc \
+    "
 
 FILES_${PN}-libxencall = "${libdir}/libxencall.so.*"
-FILES_${PN}-libxencall-dev = "${libdir}/libxencall.so"
+FILES_${PN}-libxencall-dev = " \
+    ${libdir}/libxencall.so \
+    ${datadir}/pkgconfig/xencall.pc \
+    "
 
 FILES_${PN}-libxenctrl = "${libdir}/libxenctrl.so.*"
-FILES_${PN}-libxenctrl-dev = "${libdir}/libxenctrl.so"
+FILES_${PN}-libxenctrl-dev = " \
+    ${libdir}/libxenctrl.so \
+    ${datadir}/pkgconfig/xencontrol.pc \
+    "
+
+FILES_${PN}-libxendevicemodel = "${libdir}/libxendevicemodel.so.*"
+FILES_${PN}-libxendevicemodel-dev = " \
+    ${libdir}/libxendevicemodel.so \
+    ${datadir}/pkgconfig/xendevicemodel.pc \
+    "
 
 FILES_${PN}-libxenevtchn = "${libdir}/libxenevtchn.so.*"
-FILES_${PN}-libxenevtchn-dev = "${libdir}/libxenevtchn.so"
+FILES_${PN}-libxenevtchn-dev = " \
+    ${libdir}/libxenevtchn.so \
+    ${datadir}/pkgconfig/xenevtchn.pc \
+    "
 
 FILES_${PN}-libxenforeignmemory = "${libdir}/libxenforeignmemory.so.*"
-FILES_${PN}-libxenforeignmemory-dev = "${libdir}/libxenforeignmemory.so"
+FILES_${PN}-libxenforeignmemory-dev = " \
+    ${libdir}/libxenforeignmemory.so \
+    ${datadir}/pkgconfig/xenforeignmemory.pc \
+    "
 
 FILES_${PN}-libxengnttab = "${libdir}/libxengnttab.so.*"
-FILES_${PN}-libxengnttab-dev = "${libdir}/libxengnttab.so"
+FILES_${PN}-libxengnttab-dev = " \
+    ${libdir}/libxengnttab.so \
+    ${datadir}/pkgconfig/xengnttab.pc \
+    "
 
 FILES_${PN}-libxenguest = "${libdir}/libxenguest.so.*"
-FILES_${PN}-libxenguest-dev = "${libdir}/libxenguest.so"
+FILES_${PN}-libxenguest-dev = " \
+    ${libdir}/libxenguest.so \
+    ${datadir}/pkgconfig/xenguest.pc \
+    "
 
 FILES_${PN}-libxenlight = "${libdir}/libxenlight.so.*"
 FILES_${PN}-libxenlight-dev = " \
@@ -302,16 +333,28 @@
     "
 
 FILES_${PN}-libxenstat = "${libdir}/libxenstat.so.*"
-FILES_${PN}-libxenstat-dev = "${libdir}/libxenstat.so"
+FILES_${PN}-libxenstat-dev = " \
+    ${libdir}/libxenstat.so \
+    ${datadir}/pkgconfig/xenstat.pc \
+    "
 
 FILES_${PN}-libxenstore = "${libdir}/libxenstore.so.*"
-FILES_${PN}-libxenstore-dev = "${libdir}/libxenstore.so"
+FILES_${PN}-libxenstore-dev = " \
+    ${libdir}/libxenstore.so \
+    ${datadir}/pkgconfig/xenstore.pc \
+    "
 
 FILES_${PN}-libxentoollog = "${libdir}/libxentoollog.so.*"
-FILES_${PN}-libxentoollog-dev = "${libdir}/libxentoollog.so"
+FILES_${PN}-libxentoollog-dev = " \
+    ${libdir}/libxentoollog.so \
+    ${datadir}/pkgconfig/xentoollog.pc \
+    "
 
 FILES_${PN}-libxenvchan = "${libdir}/libxenvchan.so.*"
-FILES_${PN}-libxenvchan-dev = "${libdir}/libxenvchan.so"
+FILES_${PN}-libxenvchan-dev = " \
+    ${libdir}/libxenvchan.so \
+    ${datadir}/pkgconfig/xenvchan.pc \
+    "
 
 FILES_${PN}-libxlutil = "${libdir}/libxlutil.so.*"
 FILES_${PN}-libxlutil-dev = " \
@@ -319,13 +362,22 @@
     ${datadir}/pkgconfig/xlutil.pc \
     "
 FILES_${PN}-libvhd = "${libdir}/libvhd.so.*"
-FILES_${PN}-libvhd-dev = "${libdir}/libvhd.so"
+FILES_${PN}-libvhd-dev = " \
+    ${libdir}/libvhd.so \
+    ${datadir}/pkgconfig/vhd.pc \
+    "
 
 FILES_${PN}-libblktap = "${libdir}/libblktap.so.*"
-FILES_${PN}-libblktap-dev = "${libdir}/libblktap.so"
+FILES_${PN}-libblktap-dev = " \
+    ${libdir}/libblktap.so \
+    ${datadir}/pkgconfig/blktap.pc \
+    "
 
 FILES_${PN}-libfsimage = "${libdir}/libfsimage.so.*"
-FILES_${PN}-libfsimage-dev = "${libdir}/libfsimage.so"
+FILES_${PN}-libfsimage-dev = " \
+    ${libdir}/libfsimage.so \
+    ${datadir}/pkgconfig/fsimage.pc \
+    "
 
 FILES_${PN}-fsimage = "${libdir}/fs/*/*fsimage.so"
 
@@ -720,7 +772,7 @@
 
 # systemd packages
 SYSTEMD_PACKAGES = "${PN}-xen-watchdog ${PN}-xencommons ${PN}-xendomains"
-SYSTEMD_SERVICE_${PN}-watchdog = "xen-watchdog.service"
+SYSTEMD_SERVICE_${PN}-xen-watchdog = "xen-watchdog.service"
 SYSTEMD_SERVICE_${PN}-xencommons = " \
     proc-xen.mount \
     var-lib-xenstored.mount \
@@ -740,12 +792,12 @@
 export STAGING_LIBDIR
 
 # specify xen hypervisor to build/target
-export XEN_TARGET_ARCH = "${@map_xen_arch(d.getVar('TARGET_ARCH', True), d)}"
-export XEN_COMPILE_ARCH = "${@map_xen_arch(d.getVar('BUILD_ARCH', True), d)}"
+export XEN_TARGET_ARCH = "${@map_xen_arch(d.getVar('TARGET_ARCH'), d)}"
+export XEN_COMPILE_ARCH = "${@map_xen_arch(d.getVar('BUILD_ARCH'), d)}"
 
 python () {
-    if d.getVar('XEN_TARGET_ARCH', True) == 'INVALID':
-        raise bb.parse.SkipPackage('Cannot map `%s` to a xen architecture' % d.getVar('TARGET_ARCH', True))
+    if d.getVar('XEN_TARGET_ARCH') == 'INVALID':
+        raise bb.parse.SkipPackage('Cannot map `%s` to a xen architecture' % d.getVar('TARGET_ARCH'))
 }
 
 # Yocto appends ${PN} to libexecdir by default and Xen appends 'xen' as well
@@ -805,7 +857,7 @@
 
 # check for XSM in package config to allow XSM_ENABLE to be set
 python () {
-    pkgconfig = d.getVar('PACKAGECONFIG', True)
+    pkgconfig = d.getVar('PACKAGECONFIG')
     if ('xsm') in pkgconfig.split():
         d.setVar('XSM_ENABLED', '1')
     else:
@@ -953,3 +1005,37 @@
 }
 
 addtask deploy after do_populate_sysroot
+
+# Enable use of menuconfig directly from bitbake and also within the devshell
+OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO"
+HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}"
+HOSTLDFLAGS = "${BUILD_LDFLAGS}"
+TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
+do_devshell[depends] += "ncurses-native:do_populate_sysroot"
+
+KCONFIG_CONFIG_COMMAND ??= "menuconfig"
+python do_menuconfig() {
+    import shutil
+
+    try:
+        mtime = os.path.getmtime("xen/.config")
+        shutil.copy("xen/.config", "xen/.config.orig")
+    except OSError:
+        mtime = 0
+
+    oe_terminal("${SHELL} -c \"cd xen; XEN_CONFIG_EXPERT=y make %s; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),
+        d.getVar('PN') + ' Configuration', d)
+
+    try:
+        newmtime = os.path.getmtime("xen/.config")
+    except OSError:
+        newmtime = 0
+
+    if newmtime > mtime:
+        bb.note("Configuration changed, recompile will be forced")
+        bb.build.write_taint('do_compile', d)
+}
+do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
+do_menuconfig[nostamp] = "1"
+do_menuconfig[dirs] = "${B}"
+addtask menuconfig after do_configure
diff --git a/import-layers/meta-virtualization/recipes-kernel/linux/linux-yocto_4.8.bbappend b/import-layers/meta-virtualization/recipes-kernel/linux/linux-yocto_4.10.bbappend
similarity index 100%
rename from import-layers/meta-virtualization/recipes-kernel/linux/linux-yocto_4.8.bbappend
rename to import-layers/meta-virtualization/recipes-kernel/linux/linux-yocto_4.10.bbappend
diff --git a/import-layers/meta-virtualization/recipes-kernel/linux/linux-yocto_4.8.bbappend b/import-layers/meta-virtualization/recipes-kernel/linux/linux-yocto_4.9.bbappend
similarity index 100%
copy from import-layers/meta-virtualization/recipes-kernel/linux/linux-yocto_4.8.bbappend
copy to import-layers/meta-virtualization/recipes-kernel/linux/linux-yocto_4.9.bbappend
diff --git a/import-layers/meta-virtualization/recipes-networking/netns/netns_git.bb b/import-layers/meta-virtualization/recipes-networking/netns/netns_git.bb
index 073022e..641d55f 100644
--- a/import-layers/meta-virtualization/recipes-networking/netns/netns_git.bb
+++ b/import-layers/meta-virtualization/recipes-networking/netns/netns_git.bb
@@ -2,19 +2,19 @@
 SUMMARY = "Runc hook for setting up default bridge networking."
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=20ce4c6a4f32d6ee4a68e3a7506db3f1"
-DEPENDS = "go-cross"
 
-SRC_URI = "git://github.com/jfrazelle/netns;branch=master"
-SRCREV = "2804050eeab661bfa75c3aa06bdcf60273b02ca7"
+SRC_URI = "git://github.com/jessfraz/netns;branch=master"
+SRCREV = "85b1ab9fcccbaa404a2636b52a48bbde02437cf7"
 PV = "0.1.0+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
-inherit go-osarchmap
+inherit goarch
+inherit go
 
 do_compile() {
 	export GOARCH="${TARGET_GOARCH}"
-
+	export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
 	# Setup vendor directory so that it can be used in GOPATH.
 	#
 	# Go looks in a src directory under any directory in GOPATH but netns
@@ -23,8 +23,8 @@
 	# We also need to link in the ipallocator directory as that is not under
 	# a src directory.
 	ln -sfn . "${S}/vendor/src"
-	mkdir -p "${S}/vendor/src/github.com/jfrazelle/netns"
-	ln -sfn "${S}/ipallocator" "${S}/vendor/src/github.com/jfrazelle/netns/ipallocator"
+	mkdir -p "${S}/vendor/src/github.com/jessfraz/netns"
+	ln -sfn "${S}/ipallocator" "${S}/vendor/src/github.com/jessfraz/netns/ipallocator"
 	export GOPATH="${S}/vendor"
 
 	# Pass the needed cflags/ldflags so that cgo
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-more-target-python-substitutions.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-more-target-python-substitutions.patch
deleted file mode 100644
index 2b87a11..0000000
--- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-more-target-python-substitutions.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From d1ab2f62a03c2c977de6fed5fca8de63e328a870 Mon Sep 17 00:00:00 2001
-Message-Id: <d1ab2f62a03c2c977de6fed5fca8de63e328a870.1391527986.git.Jim.Somerville@windriver.com>
-From: Jim Somerville <Jim.Somerville@windriver.com>
-Date: Tue, 4 Feb 2014 15:30:41 +0000
-Subject: [PATCH 1/1] openvswitch: add more target python substitutions
-
-The TARGET_PYTHON variable is used for script
-substitutions to ensure the scripts will be able to properly execute
-if the target system has a different path for the python.
-
-Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
----
- ovsdb/ovsdb-dot.in         | 2 +-
- ovsdb/ovsdb-idlc.in        | 2 +-
- utilities/ovs-dpctl-top.in | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in
-index 85c126d..402a77c 100755
---- a/ovsdb/ovsdb-dot.in
-+++ b/ovsdb/ovsdb-dot.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- 
- from datetime import date
- import ovs.db.error
-diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
-index ec1c655..f5c135f 100755
---- a/ovsdb/ovsdb-idlc.in
-+++ b/ovsdb/ovsdb-idlc.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- 
- import getopt
- import os
-diff --git a/utilities/ovs-dpctl-top.in b/utilities/ovs-dpctl-top.in
-index f43fdeb..8475118 100755
---- a/utilities/ovs-dpctl-top.in
-+++ b/utilities/ovs-dpctl-top.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- #
- # Copyright (c) 2013 Nicira, Inc.
- #
--- 
-1.8.3.4
-
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-perl-handling.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-perl-handling.patch
deleted file mode 100644
index 98224b4..0000000
--- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-perl-handling.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 569ac1066cd3046b8ac899153df9f07908d45145 Mon Sep 17 00:00:00 2001
-From: Mark Asselstine <mark.asselstine@windriver.com>
-Date: Fri, 21 Jun 2013 11:16:00 -0400
-Subject: [PATCH] openvswitch: add target perl handling
-
-Allow the build to specify a path for the perl instead of reusing
-the PERL variable which can lead to inconsistencies if we are cross
-compiling. The TARGET_PERL variable will be used for script
-substitutions to ensure the scripts will be able to properly execute
-if the target system has a different path for the perl.
-
-Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
----
- Makefile.am                  | 1 +
- configure.ac                 | 7 +++++++
- utilities/ovs-parse-leaks.in | 2 +-
- 3 files changed, 9 insertions(+), 1 deletion(-)
-
-Index: openvswitch-2.0.0/Makefile.am
-===================================================================
---- openvswitch-2.0.0.orig/Makefile.am
-+++ openvswitch-2.0.0/Makefile.am
-@@ -114,6 +114,7 @@
-                 -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
-                 -e 's,[@]DBDIR[@],$(DBDIR),g' \
-                 -e 's,[@]PERL[@],$(PERL),g' \
-+                -e 's,[@]TARGET_PERL[@],$(TARGET_PERL),g' \
-                 -e 's,[@]PYTHON[@],$(PYTHON),g' \
-                 -e 's,[@]TARGET_PYTHON[@],$(TARGET_PYTHON),g' \
-                 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
-Index: openvswitch-2.0.0/configure.ac
-===================================================================
---- openvswitch-2.0.0.orig/configure.ac
-+++ openvswitch-2.0.0/configure.ac
-@@ -115,6 +115,13 @@
- AC_SUBST(KARCH)
- OVS_CHECK_LINUX
- 
-+if test "$TARGET_PERL"; then
-+    TARGET_PERL=$TARGET_PERL
-+else
-+    TARGET_PERL=$PERL
-+fi
-+AC_SUBST(TARGET_PERL)
-+
- if test "$TARGET_PYTHON"; then
-     TARGET_PYTHON=$TARGET_PYTHON
- else
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-python-handling.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-python-handling.patch
deleted file mode 100644
index 97b352c..0000000
--- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-python-handling.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-From e8a5d34885c5fdba7d951fb1bb85131cbafca432 Mon Sep 17 00:00:00 2001
-From: Mark Asselstine <mark.asselstine@windriver.com>
-Date: Wed, 19 Jun 2013 17:25:56 -0400
-Subject: [PATCH] openvswitch: add target python handling
-
-Allow the build to specify a path for the python instead of reusing
-the PYTHON variable which can lead to inconsistencies if we are cross
-compiling. The TARGET_PYTHON variable will be used for script
-substitutions to ensure the scripts will be able to properly execute
-if the target system has a different path for the python.
-
-Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
----
- Makefile.am                        | 1 +
- configure.ac                       | 7 +++++++
- ovsdb/ovsdbmonitor/ovsdbmonitor.in | 2 +-
- utilities/bugtool/ovs-bugtool.in   | 2 +-
- utilities/ovs-check-dead-ifs.in    | 2 +-
- utilities/ovs-l3ping.in            | 2 +-
- utilities/ovs-parse-backtrace.in   | 2 +-
- utilities/ovs-pcap.in              | 2 +-
- utilities/ovs-tcpundump.in         | 2 +-
- utilities/ovs-test.in              | 2 +-
- utilities/ovs-vlan-test.in         | 2 +-
- 11 files changed, 17 insertions(+), 9 deletions(-)
-
-Index: openvswitch-2.1.2/Makefile.am
-===================================================================
---- openvswitch-2.1.2.orig/Makefile.am
-+++ openvswitch-2.1.2/Makefile.am
-@@ -125,6 +125,7 @@
-                 -e 's,[@]DBDIR[@],$(DBDIR),g' \
-                 -e 's,[@]PERL[@],$(PERL),g' \
-                 -e 's,[@]PYTHON[@],$(PYTHON),g' \
-+                -e 's,[@]TARGET_PYTHON[@],$(TARGET_PYTHON),g' \
-                 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
-                 -e 's,[@]VERSION[@],$(VERSION),g' \
-                 -e 's,[@]localstatedir[@],$(localstatedir),g' \
-Index: openvswitch-2.1.2/configure.ac
-===================================================================
---- openvswitch-2.1.2.orig/configure.ac
-+++ openvswitch-2.1.2/configure.ac
-@@ -118,6 +118,13 @@
- AC_SUBST(KARCH)
- OVS_CHECK_LINUX
- 
-+if test "$TARGET_PYTHON"; then
-+    TARGET_PYTHON=$TARGET_PYTHON
-+else
-+    TARGET_PYTHON=$PYTHON
-+fi
-+AC_SUBST(TARGET_PYTHON)
-+
- AC_CONFIG_FILES(Makefile)
- AC_CONFIG_FILES(datapath/Makefile)
- AC_CONFIG_FILES(datapath/linux/Kbuild)
-Index: openvswitch-2.1.2/utilities/bugtool/ovs-bugtool.in
-===================================================================
---- openvswitch-2.1.2.orig/utilities/bugtool/ovs-bugtool.in
-+++ openvswitch-2.1.2/utilities/bugtool/ovs-bugtool.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- 
- # This library is free software; you can redistribute it and/or
- # modify it under the terms of version 2.1 of the GNU Lesser General Public
-Index: openvswitch-2.1.2/utilities/ovs-check-dead-ifs.in
-===================================================================
---- openvswitch-2.1.2.orig/utilities/ovs-check-dead-ifs.in
-+++ openvswitch-2.1.2/utilities/ovs-check-dead-ifs.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- 
- import os
- import re
-Index: openvswitch-2.1.2/utilities/ovs-l3ping.in
-===================================================================
---- openvswitch-2.1.2.orig/utilities/ovs-l3ping.in
-+++ openvswitch-2.1.2/utilities/ovs-l3ping.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
-Index: openvswitch-2.1.2/utilities/ovs-parse-backtrace.in
-===================================================================
---- openvswitch-2.1.2.orig/utilities/ovs-parse-backtrace.in
-+++ openvswitch-2.1.2/utilities/ovs-parse-backtrace.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- #
- # Copyright (c) 2012 Nicira, Inc.
- #
-Index: openvswitch-2.1.2/utilities/ovs-pcap.in
-===================================================================
---- openvswitch-2.1.2.orig/utilities/ovs-pcap.in
-+++ openvswitch-2.1.2/utilities/ovs-pcap.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- #
- # Copyright (c) 2010 Nicira, Inc.
- #
-Index: openvswitch-2.1.2/utilities/ovs-tcpundump.in
-===================================================================
---- openvswitch-2.1.2.orig/utilities/ovs-tcpundump.in
-+++ openvswitch-2.1.2/utilities/ovs-tcpundump.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- #
- # Copyright (c) 2010 Nicira, Inc.
- #
-Index: openvswitch-2.1.2/utilities/ovs-test.in
-===================================================================
---- openvswitch-2.1.2.orig/utilities/ovs-test.in
-+++ openvswitch-2.1.2/utilities/ovs-test.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
-Index: openvswitch-2.1.2/utilities/ovs-vlan-test.in
-===================================================================
---- openvswitch-2.1.2.orig/utilities/ovs-vlan-test.in
-+++ openvswitch-2.1.2/utilities/ovs-vlan-test.in
-@@ -1,4 +1,4 @@
--#! @PYTHON@
-+#! @TARGET_PYTHON@
- #
- # Copyright (c) 2010 Nicira, Inc.
- #
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch
new file mode 100644
index 0000000..68f46ff
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch
@@ -0,0 +1,152 @@
+From 04ad1c3d9f47cfdf4ad9b5d685e953ec094326ff Mon Sep 17 00:00:00 2001
+From: Mark Asselstine <mark.asselstine@windriver.com>
+Date: Fri, 13 Jan 2017 16:12:55 -0500
+Subject: [PATCH] python: make remaining scripts use /usr/bin/env
+
+Unfortunately there is no concept of a host python vs. target python
+to facilitate cross compilation. There is only one PYTHON variable and
+this is used during building and in the header of python scripts after
+installation. The best approach for cross compilation is to thus to
+ensure python is in the path and avoid passing a path as part of
+PYTHON. To make this function smoothly all installed scripts should
+make use of /usr/bin/env to increase the chances of finding python.
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ build-aux/check-structs                  | 2 +-
+ build-aux/extract-ofp-actions            | 2 +-
+ build-aux/extract-ofp-errors             | 2 +-
+ build-aux/extract-ofp-fields             | 2 +-
+ build-aux/extract-ofp-msgs               | 2 +-
+ build-aux/xml2nroff                      | 2 +-
+ ovn/utilities/ovn-docker-overlay-driver  | 2 +-
+ ovn/utilities/ovn-docker-underlay-driver | 2 +-
+ ovsdb/ovsdb-doc                          | 2 +-
+ ovsdb/ovsdb-dot.in                       | 2 +-
+ ovsdb/ovsdb-idlc.in                      | 2 +-
+ utilities/bugtool/ovs-bugtool.in         | 2 +-
+ 12 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/build-aux/check-structs b/build-aux/check-structs
+index f79f235..c7b8730 100755
+--- a/build-aux/check-structs
++++ b/build-aux/check-structs
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#! /usr/bin/env python
+ 
+ import os.path
+ import sys
+diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions
+index 184447b..92ea18d 100755
+--- a/build-aux/extract-ofp-actions
++++ b/build-aux/extract-ofp-actions
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#! /usr/bin/env python
+ 
+ import sys
+ import os.path
+diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors
+index 9642593..11e6de7 100755
+--- a/build-aux/extract-ofp-errors
++++ b/build-aux/extract-ofp-errors
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#! /usr/bin/env python
+ 
+ import sys
+ import os.path
+diff --git a/build-aux/extract-ofp-fields b/build-aux/extract-ofp-fields
+index 498b887..5d6bcec 100755
+--- a/build-aux/extract-ofp-fields
++++ b/build-aux/extract-ofp-fields
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#! /usr/bin/env python
+ 
+ import getopt
+ import sys
+diff --git a/build-aux/extract-ofp-msgs b/build-aux/extract-ofp-msgs
+index 1813638..e9e3c25 100755
+--- a/build-aux/extract-ofp-msgs
++++ b/build-aux/extract-ofp-msgs
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#! /usr/bin/env python
+ 
+ import sys
+ import os.path
+diff --git a/build-aux/xml2nroff b/build-aux/xml2nroff
+index bd4e879..9d81503 100755
+--- a/build-aux/xml2nroff
++++ b/build-aux/xml2nroff
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#! /usr/bin/env python
+ 
+ # Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
+ #
+diff --git a/ovn/utilities/ovn-docker-overlay-driver b/ovn/utilities/ovn-docker-overlay-driver
+index 52de3db..c90f02b 100755
+--- a/ovn/utilities/ovn-docker-overlay-driver
++++ b/ovn/utilities/ovn-docker-overlay-driver
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#! /usr/bin/env python
+ # Copyright (C) 2015 Nicira, Inc.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+diff --git a/ovn/utilities/ovn-docker-underlay-driver b/ovn/utilities/ovn-docker-underlay-driver
+index 2c9c4b6..89b804c 100755
+--- a/ovn/utilities/ovn-docker-underlay-driver
++++ b/ovn/utilities/ovn-docker-underlay-driver
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#! /usr/bin/env python
+ # Copyright (C) 2015 Nicira, Inc.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+diff --git a/ovsdb/ovsdb-doc b/ovsdb/ovsdb-doc
+index 5cf26ee..f76f4bd 100755
+--- a/ovsdb/ovsdb-doc
++++ b/ovsdb/ovsdb-doc
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#! /usr/bin/env python
+ 
+ # Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
+ #
+diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in
+index 134ce22..893c408 100755
+--- a/ovsdb/ovsdb-dot.in
++++ b/ovsdb/ovsdb-dot.in
+@@ -1,4 +1,4 @@
+-#! @PYTHON@
++#! /usr/bin/env @PYTHON@
+ 
+ from datetime import date
+ import ovs.db.error
+diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
+index 721ab50..bfbcf23 100755
+--- a/ovsdb/ovsdb-idlc.in
++++ b/ovsdb/ovsdb-idlc.in
+@@ -1,4 +1,4 @@
+-#! @PYTHON@
++#! /usr/bin/env @PYTHON@
+ 
+ import getopt
+ import os
+diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in
+index 963c50c..c84d7c2 100755
+--- a/utilities/bugtool/ovs-bugtool.in
++++ b/utilities/bugtool/ovs-bugtool.in
+@@ -1,4 +1,4 @@
+-#! @PYTHON@
++#! /usr/bin/env @PYTHON@
+ 
+ # This library is free software; you can redistribute it and/or
+ # modify it under the terms of version 2.1 of the GNU Lesser General Public
+-- 
+2.7.4
+
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-8c0b419a0b9ac0141d6973dcc80306dfc6a83d31.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-8c0b419a0b9ac0141d6973dcc80306dfc6a83d31.patch
deleted file mode 100644
index 7e74044..0000000
--- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-8c0b419a0b9ac0141d6973dcc80306dfc6a83d31.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From e20556d7cf0fc8258db77c1f3e0a160cf9fd4514 Mon Sep 17 00:00:00 2001
-From: He Zhe <zhe.he@windriver.com>
-Date: Wed, 30 Mar 2016 06:23:45 -0400
-Subject: [PATCH] openvswitch: Add test-install rule to support ptest execution
-
-Signed-off-by: Radu Patriu <radu.patriu@enea.com>
-
-Fix ptest for v2.5
- - Copy certain files from srcdir since it has been different from
-   build directory.
- - Copy more necessary files for new added test cases.
- - Modify config files for running on target.
-
-Signed-off-by: He Zhe <zhe.he@windriver.com>
----
- Makefile.am |  1 +
- test.mk     | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 73 insertions(+)
- create mode 100644 test.mk
-
-diff --git a/Makefile.am b/Makefile.am
-index ed43c2f..f38d278 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -401,3 +401,4 @@ include datapath-windows/include/automake.mk
- include windows/automake.mk
- include ovn/automake.mk
- include selinux/automake.mk
-+include test.mk
-diff --git a/test.mk b/test.mk
-new file mode 100644
-index 0000000..b10a581
---- /dev/null
-+++ b/test.mk
-@@ -0,0 +1,72 @@
-+TEST_DEST ?= ${prefix}/lib/openvswitch
-+TEST_ROOT ?= ${prefix}/lib/openvswitch
-+TEST_DEPEND =
-+
-+if HAVE_OPENSSL
-+TEST_DEPEND += $(TESTPKI_FILES)
-+endif
-+
-+test-install: $(TEST_DEPEND)
-+	@list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\
-+	install -d $(TEST_DEST)/tests ;\
-+	install $(srcdir)/vtep/ovs-vtep $(TEST_DEST)/tests ;\
-+	install -d $(TEST_DEST)/python ;\
-+	install -d $(TEST_DEST)/python/ovs ;\
-+	install -d $(TEST_DEST)/python/ovs/db ;\
-+	install -d $(TEST_DEST)/python/ovs/unixctl ;\
-+	install -d $(TEST_DEST)/vswitchd ;\
-+	install $(srcdir)/vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\
-+	install vswitchd/ovs-vswitchd $(TEST_DEST)/vswitchd ;\
-+	install -d $(TEST_DEST)/debian ;\
-+	install $(srcdir)/debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\
-+	install -d $(TEST_DEST)/build-aux ;\
-+	install $(srcdir)/build-aux/check-structs $(TEST_DEST)/build-aux ;\
-+	install -d $(TEST_DEST)/xenserver ;\
-+	install $(srcdir)/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\
-+	install $(srcdir)/xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\
-+	install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\
-+	install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\
-+	install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\
-+	install -d $(TEST_DEST)/vtep ;\
-+	install $(srcdir)/vtep/vtep.ovsschema $(TEST_DEST)/vtep ;\
-+	install -d $(TEST_DEST)/ovn ;\
-+	install $(srcdir)/ovn/ovn-nb.ovsschema $(TEST_DEST)/ovn ;\
-+	install $(srcdir)/ovn/ovn-sb.ovsschema $(TEST_DEST)/ovn ;\
-+	install -d $(TEST_DEST)/utilities ;\
-+	install $(srcdir)/utilities/ovs-pcap.in $(TEST_DEST)/utilities ;\
-+	install $(srcdir)/utilities/ovs-pki.in $(TEST_DEST)/utilities ;\
-+	for p in $$list ; do \
-+	  echo $$p ;\
-+	  p=$${p#../git/} ;\
-+	  pre=$${p#tests\/} ;\
-+	  if test $$pre != $$p ; then \
-+	    echo installing $$p to $(TEST_DEST)/tests/$$pre ;\
-+	    if test -f $$p ; then \
-+	      install $$p $(TEST_DEST)/tests/$$pre ;\
-+	    else \
-+	      install $(srcdir)/$$p $(TEST_DEST)/tests/$$pre ;\
-+	    fi ;\
-+	    continue ;\
-+	  fi ;\
-+	  pre=$${p#python\/ovs\/} ;\
-+	  if test $$pre != $$p ; then \
-+	    echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\
-+	    if test -f $$p ; then \
-+	      install $$p $(TEST_DEST)/python/ovs/$$pre ;\
-+	    else \
-+	      install $(srcdir)/$$p $(TEST_DEST)/python/ovs/$$pre ;\
-+	    fi ;\
-+	    continue ;\
-+	  fi; \
-+	done ;\
-+	sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig
-+	sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig
-+	sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig
-+	sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig
-+	sed -i 's|at_srcdir=.*|at_srcdir='"'"'.'"'"'|g' $(TEST_DEST)/tests/atconfig
-+	sed -i 's|at_top_srcdir=.*|at_top_srcdir='"'"'..'"'"'|g' $(TEST_DEST)/tests/atconfig
-+	sed -i 's|at_top_build_prefix=.*|at_top_build_prefix='"'"'../'"'"'|g' $(TEST_DEST)/tests/atconfig
-+	sed -i 's|^\(.*config\.log.*\)|#\1|g' $(TEST_DEST)/tests/testsuite
-+	sed -i 's|$$srcdir|$$abs_srcdir|g' $(TEST_DEST)/tests/testsuite
-+	sed -i 's|ovs-appctl-bashcomp\.bash|/etc/bash_completion.d/ovs-appctl-bashcomp\.bash|g' $(TEST_DEST)/tests/testsuite
-+	sed -i 's|ovs-vsctl-bashcomp\.bash|/etc/bash_completion.d/ovs-vsctl-bashcomp\.bash|g' $(TEST_DEST)/tests/testsuite
--- 
-1.9.1
-
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-c298ef781c2d35d939fe163cbc2f41ea7b1cb8d1.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-c298ef781c2d35d939fe163cbc2f41ea7b1cb8d1.patch
new file mode 100644
index 0000000..47c81dd
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-c298ef781c2d35d939fe163cbc2f41ea7b1cb8d1.patch
@@ -0,0 +1,110 @@
+From a2a656e6976a60e5df3ade0d17a40b4ebdc2b41a Mon Sep 17 00:00:00 2001
+From: He Zhe <zhe.he@windriver.com>
+Date: Wed, 30 Mar 2016 06:23:45 -0400
+Subject: [PATCH] openvswitch: Add test-install rule to support ptest execution
+
+Signed-off-by: Radu Patriu <radu.patriu@enea.com>
+
+Fix ptest for v2.5
+ - Copy certain files from srcdir since it has been different from
+   build directory.
+ - Copy more necessary files for new added test cases.
+ - Modify config files for running on target.
+
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ Makefile.am |  1 +
+ test.mk     | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 73 insertions(+)
+ create mode 100644 test.mk
+
+diff --git a/Makefile.am b/Makefile.am
+index a4dd7b8..0bd32c7 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -429,3 +429,4 @@ include windows/automake.mk
+ include ovn/automake.mk
+ include selinux/automake.mk
+ include build-aux/automake.mk
++include test.mk
+diff --git a/test.mk b/test.mk
+new file mode 100644
+index 0000000..b10a581
+--- /dev/null
++++ b/test.mk
+@@ -0,0 +1,72 @@
++TEST_DEST ?= ${prefix}/lib/openvswitch
++TEST_ROOT ?= ${prefix}/lib/openvswitch
++TEST_DEPEND =
++
++if HAVE_OPENSSL
++TEST_DEPEND += $(TESTPKI_FILES)
++endif
++
++test-install: $(TEST_DEPEND)
++	@list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\
++	install -d $(TEST_DEST)/tests ;\
++	install $(srcdir)/vtep/ovs-vtep $(TEST_DEST)/tests ;\
++	install -d $(TEST_DEST)/python ;\
++	install -d $(TEST_DEST)/python/ovs ;\
++	install -d $(TEST_DEST)/python/ovs/db ;\
++	install -d $(TEST_DEST)/python/ovs/unixctl ;\
++	install -d $(TEST_DEST)/vswitchd ;\
++	install $(srcdir)/vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\
++	install vswitchd/ovs-vswitchd $(TEST_DEST)/vswitchd ;\
++	install -d $(TEST_DEST)/debian ;\
++	install $(srcdir)/debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\
++	install -d $(TEST_DEST)/build-aux ;\
++	install $(srcdir)/build-aux/check-structs $(TEST_DEST)/build-aux ;\
++	install -d $(TEST_DEST)/xenserver ;\
++	install $(srcdir)/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\
++	install $(srcdir)/xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\
++	install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\
++	install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\
++	install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\
++	install -d $(TEST_DEST)/vtep ;\
++	install $(srcdir)/vtep/vtep.ovsschema $(TEST_DEST)/vtep ;\
++	install -d $(TEST_DEST)/ovn ;\
++	install $(srcdir)/ovn/ovn-nb.ovsschema $(TEST_DEST)/ovn ;\
++	install $(srcdir)/ovn/ovn-sb.ovsschema $(TEST_DEST)/ovn ;\
++	install -d $(TEST_DEST)/utilities ;\
++	install $(srcdir)/utilities/ovs-pcap.in $(TEST_DEST)/utilities ;\
++	install $(srcdir)/utilities/ovs-pki.in $(TEST_DEST)/utilities ;\
++	for p in $$list ; do \
++	  echo $$p ;\
++	  p=$${p#../git/} ;\
++	  pre=$${p#tests\/} ;\
++	  if test $$pre != $$p ; then \
++	    echo installing $$p to $(TEST_DEST)/tests/$$pre ;\
++	    if test -f $$p ; then \
++	      install $$p $(TEST_DEST)/tests/$$pre ;\
++	    else \
++	      install $(srcdir)/$$p $(TEST_DEST)/tests/$$pre ;\
++	    fi ;\
++	    continue ;\
++	  fi ;\
++	  pre=$${p#python\/ovs\/} ;\
++	  if test $$pre != $$p ; then \
++	    echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\
++	    if test -f $$p ; then \
++	      install $$p $(TEST_DEST)/python/ovs/$$pre ;\
++	    else \
++	      install $(srcdir)/$$p $(TEST_DEST)/python/ovs/$$pre ;\
++	    fi ;\
++	    continue ;\
++	  fi; \
++	done ;\
++	sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig
++	sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig
++	sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig
++	sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig
++	sed -i 's|at_srcdir=.*|at_srcdir='"'"'.'"'"'|g' $(TEST_DEST)/tests/atconfig
++	sed -i 's|at_top_srcdir=.*|at_top_srcdir='"'"'..'"'"'|g' $(TEST_DEST)/tests/atconfig
++	sed -i 's|at_top_build_prefix=.*|at_top_build_prefix='"'"'../'"'"'|g' $(TEST_DEST)/tests/atconfig
++	sed -i 's|^\(.*config\.log.*\)|#\1|g' $(TEST_DEST)/tests/testsuite
++	sed -i 's|$$srcdir|$$abs_srcdir|g' $(TEST_DEST)/tests/testsuite
++	sed -i 's|ovs-appctl-bashcomp\.bash|/etc/bash_completion.d/ovs-appctl-bashcomp\.bash|g' $(TEST_DEST)/tests/testsuite
++	sed -i 's|ovs-vsctl-bashcomp\.bash|/etc/bash_completion.d/ovs-vsctl-bashcomp\.bash|g' $(TEST_DEST)/tests/testsuite
+-- 
+2.7.4
+
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-ptest-Fix-python-path.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-ptest-Fix-python-path.patch
deleted file mode 100644
index c75ebc5..0000000
--- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-ptest-Fix-python-path.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 2a78bddb865e0d3377f437428ed6825195af0a14 Mon Sep 17 00:00:00 2001
-From: He Zhe <zhe.he@windriver.com>
-Date: Wed, 13 Apr 2016 03:13:01 -0400
-Subject: [PATCH] openvswitch: ptest: Fix python path
-
-For now PYTHON just happens to be the same as TARGET_PYTHON so we get the right
-python binary. This patch sets PYTHON to TARGET_PYTHON since ptest is going to
-be run on target.
-
-Signed-off-by: He Zhe <zhe.he@windriver.com>
----
- tests/atlocal.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tests/atlocal.in b/tests/atlocal.in
-index 5815c6c..db2d2c9 100644
---- a/tests/atlocal.in
-+++ b/tests/atlocal.in
-@@ -5,7 +5,7 @@ EGREP='@EGREP@'
- PERL='@PERL@'
- 
- if test x"$PYTHON" = x; then
--    PYTHON='@PYTHON@'
-+    PYTHON='@TARGET_PYTHON@'
- fi
- 
- PYTHONPATH=$abs_top_srcdir/python:$abs_top_builddir/tests:$PYTHONPATH
--- 
-1.9.1
-
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch.inc b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch.inc
index 3c70703..1f0b52b 100644
--- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch.inc
+++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch.inc
@@ -11,11 +11,11 @@
 SECTION = "networking"
 LICENSE = "Apache-2"
 
-DEPENDS += "bridge-utils openssl python perl"
+DEPENDS += "bridge-utils openssl python perl python-six-native coreutils-native"
 
 RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid coreutils \
 	python perl perl-module-strict ${PN}-switch \
-        bash python-twisted"
+        bash python-twisted python-six"
 RDEPENDS_${PN}-testcontroller = "${PN} lsb ${PN}-pki"
 RDEPENDS_${PN}-switch = "${PN} openssl procps util-linux-uuidgen"
 RDEPENDS_${PN}-pki = "${PN}"
@@ -31,13 +31,12 @@
 	file://openvswitch-switch-setup \
 	file://openvswitch-testcontroller \
 	file://openvswitch-testcontroller-setup \
-	file://openvswitch-add-target-python-handling.patch \
-	file://openvswitch-add-target-perl-handling.patch \
 	"
 
 EXTRA_OECONF += "\
-	TARGET_PYTHON=${bindir}/python \
-	TARGET_PERL=${bindir}/perl \
+	PYTHON=python \
+	PYTHON3=python3 \
+	PERL=${bindir}/perl \
 	"
 CONFIGUREOPT_DEPTRACK = ""
 
@@ -61,8 +60,9 @@
 FILES_${PN}-switch = "\
 	${sysconfdir}/init.d/openvswitch-switch \
 	${sysconfdir}/default/openvswitch-switch \
+	${systemd_unitdir}/system/ovs-vswitchd.service \
 	${systemd_unitdir}/system/openvswitch.service \
-	${systemd_unitdir}/system/openvswitch-nonetwork.service \
+	${systemd_unitdir}/system/ovsdb-server.service \
 	"
 
 # silence a warning
@@ -70,12 +70,13 @@
 FILES_${PN} += "/run"
 
 FILES_${PN} += "${libdir}/python${PYTHON_BASEVERSION}/"
-inherit autotools update-rc.d systemd python-dir
+inherit autotools update-rc.d systemd pythonnative
 
 SYSTEMD_PACKAGES = "${PN}-switch"
 SYSTEMD_SERVICE_${PN}-switch = " \
-    openvswitch-nonetwork.service \
-    openvswitch-switch.service \
+    ovsdb-server.service \
+    ovs-vswitchd.service \
+    openvswitch.service \
 "
 
 INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-testcontroller"
@@ -97,10 +98,12 @@
 	true || rm -fr ${D}/${datadir}/${PN}/pki
 
 	install -d ${D}/${systemd_unitdir}/system/
+	install -m 644 ${S}/rhel/usr_lib_systemd_system_ovs-vswitchd.service \
+		${D}/${systemd_unitdir}/system/ovs-vswitchd.service
 	install -m 644 ${S}/rhel/usr_lib_systemd_system_openvswitch.service \
-		${D}/${systemd_unitdir}/system/openvswitch-switch.service
-	install -m 644 ${S}/rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
-		${D}/${systemd_unitdir}/system/openvswitch-nonetwork.service
+		${D}/${systemd_unitdir}/system/openvswitch.service
+	install -m 644 ${S}/rhel/usr_lib_systemd_system_ovsdb-server.service \
+		${D}/${systemd_unitdir}/system/ovsdb-server.service
 
 	oe_runmake modules_install INSTALL_MOD_PATH=${D}
 	install -d ${D}${libdir}/python${PYTHON_BASEVERSION}/site-packages
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb
index 5ecb29a..1fb82ae 100644
--- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb
+++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb
@@ -12,24 +12,26 @@
 	"
 
 S = "${WORKDIR}/git"
-PV = "2.5.0+${SRCREV}"
+PV = "2.7.0+${SRCREV}"
 
 FILESEXTRAPATHS_append := "${THISDIR}/${PN}-git:"
 
-SRCREV = "8c0b419a0b9ac0141d6973dcc80306dfc6a83d31"
-SRC_URI += "\
-	git://github.com/openvswitch/ovs.git;protocol=git;branch=branch-2.5 \
-	file://openvswitch-add-more-target-python-substitutions.patch \
-	file://openvswitch-add-ptest-${SRCREV}.patch \
-	file://run-ptest \
-	file://disable_m4_check.patch \
-	file://kernel_module.patch \
-	file://openvswitch-ptest-Fix-python-path.patch \
-	file://0001-use-the-linux-if_packet.h-Interface-directly.patch \
-	file://0002-Define-WAIT_ANY-if-not-provided-by-system.patch \
-	"
+SRCREV = "c298ef781c2d35d939fe163cbc2f41ea7b1cb8d1"
+SRC_URI = "file://openvswitch-switch \
+           file://openvswitch-switch-setup \
+           file://openvswitch-testcontroller \
+           file://openvswitch-testcontroller-setup \
+           git://github.com/openvswitch/ovs.git;protocol=git;branch=branch-2.7 \
+           file://openvswitch-add-ptest-${SRCREV}.patch \
+           file://run-ptest \
+           file://disable_m4_check.patch \
+           file://kernel_module.patch \
+           file://python-make-remaining-scripts-use-usr-bin-env.patch \
+           file://0001-use-the-linux-if_packet.h-Interface-directly.patch \
+           file://0002-Define-WAIT_ANY-if-not-provided-by-system.patch \
+           "
 
-LIC_FILES_CHKSUM = "file://COPYING;md5=247d8817aece26b21a8cd6791b3ea994"
+LIC_FILES_CHKSUM = "file://COPYING;md5=17b2c9d4c70853a09c0e143137754b35"
 
 PACKAGECONFIG ?= ""
 PACKAGECONFIG[dpdk] = "--with-dpdk=${STAGING_DIR_TARGET}/opt/dpdk/${TARGET_ARCH}-native-linuxapp-gcc,,dpdk,"
diff --git a/import-layers/yocto-poky/README.hardware b/import-layers/yocto-poky/README.hardware
index d7e24d2..e6ccf78 100644
--- a/import-layers/yocto-poky/README.hardware
+++ b/import-layers/yocto-poky/README.hardware
@@ -203,6 +203,75 @@
 you have left them at the factory default then you shouldn't need to do
 anything here.
 
+Note: To boot from USB disk you need u-boot that supports 'ext2load usb'
+command. You need to setup TFTP server, load u-boot from there and
+flash it to NOR flash.
+
+Beware! Flashing bootloader is potentially dangerous operation that can
+brick your device if done incorrectly. Please, make sure you understand
+what below commands mean before executing them.
+
+Load the new u-boot.bin from TFTP server to memory address 200000
+=> tftp 200000 u-boot.bin
+
+Disable flash protection
+=> protect off all
+
+Erase the old u-boot from fe000000 to fe06ffff in NOR flash.
+The size is 0x70000 (458752 bytes)
+=> erase fe000000 fe06ffff
+
+Copy the new u-boot from address 200000 to fe000000
+the size is 0x70000. It has to be greater or equal to u-boot.bin size
+=> cp.b 200000 fe000000 70000
+
+Enable flash protection again
+=> protect on all
+
+Reset the board
+=> reset
+
+--- Booting from USB disk ---
+
+ 1. Flash partitioned image to the USB disk
+
+    # dd if=core-image-minimal-mpc8315e-rdb.wic of=/dev/sdb
+
+ 2. Plug USB disk into the MPC8315 board
+
+ 3. Connect the board's first serial port to your workstation and then start up
+    your favourite serial terminal so that you will be able to interact with
+    the serial console. If you don't have a favourite, picocom is suggested:
+
+  $ picocom /dev/ttyUSB0 -b 115200
+
+ 4. Power up or reset the board and press a key on the terminal when prompted
+    to get to the U-Boot command line
+
+ 5. Optional. Load the u-boot.bin from the USB disk:
+
+ => usb start
+ => ext2load usb 0:1 200000 u-boot.bin
+
+    and flash it to NOR flash as described above.
+
+ 6. Set fdtaddr and loadaddr. This is not necessary if you set them before.
+
+ => setenv fdtaddr a00000
+ => setenv loadaddr 1000000
+
+ 7. Load the kernel and dtb from first partition of the USB disk:
+
+ => usb start
+ => ext2load usb 0:1 $loadaddr uImage
+ => ext2load usb 0:1 $fdtaddr dtb
+
+ 8. Set bootargs and boot up the device
+
+ => setenv bootargs root=/dev/sdb2 rw rootwait console=ttyS0,115200
+ => bootm $loadaddr - $fdtaddr
+
+
 --- Booting from NFS root ---
 
 Load the kernel and dtb (device tree blob), and boot the system as follows:
@@ -317,7 +386,7 @@
 
  2. Flash the image.
 
-    # dd core-image-minimal-edgerouter.wic of=/dev/sdb
+    # dd if=core-image-minimal-edgerouter.wic of=/dev/sdb
 
  3. Insert USB disk into the edgerouter and boot it.
 
diff --git a/import-layers/yocto-poky/bitbake/LICENSE b/import-layers/yocto-poky/bitbake/LICENSE
index 5d4a4c2..7d4e5f4 100644
--- a/import-layers/yocto-poky/bitbake/LICENSE
+++ b/import-layers/yocto-poky/bitbake/LICENSE
@@ -15,3 +15,5 @@
 * QUnit is redistributed under the MIT license.
 
 * Font Awesome fonts redistributed under the SIL Open Font License 1.1
+
+* simplediff is distributed under the zlib license.
diff --git a/import-layers/yocto-poky/bitbake/bin/bitbake b/import-layers/yocto-poky/bitbake/bin/bitbake
index 2a4fc72..9f5c2d4 100755
--- a/import-layers/yocto-poky/bitbake/bin/bitbake
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake
@@ -38,7 +38,7 @@
 if sys.getfilesystemencoding() != "utf-8":
     sys.exit("Please use a locale setting which supports utf-8.\nPython can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.")
 
-__version__ = "1.32.0"
+__version__ = "1.34.0"
 
 if __name__ == "__main__":
     if __version__ != bb.__version__:
diff --git a/import-layers/yocto-poky/bitbake/bin/bitbake-diffsigs b/import-layers/yocto-poky/bitbake/bin/bitbake-diffsigs
index 527d2c7..eb2f859 100755
--- a/import-layers/yocto-poky/bitbake/bin/bitbake-diffsigs
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake-diffsigs
@@ -3,7 +3,7 @@
 # bitbake-diffsigs
 # BitBake task signature data comparison utility
 #
-# Copyright (C) 2012-2013 Intel Corporation
+# Copyright (C) 2012-2013, 2017 Intel Corporation
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License version 2 as
@@ -22,7 +22,7 @@
 import sys
 import warnings
 import fnmatch
-import optparse
+import argparse
 import logging
 import pickle
 
@@ -30,29 +30,13 @@
 
 import bb.tinfoil
 import bb.siggen
+import bb.msg
 
-def logger_create(name, output=sys.stderr):
-    logger = logging.getLogger(name)
-    console = logging.StreamHandler(output)
-    format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
-    if output.isatty():
-        format.enable_color()
-    console.setFormatter(format)
-    logger.addHandler(console)
-    logger.setLevel(logging.INFO)
-    return logger
+logger = bb.msg.logger_create('bitbake-diffsigs')
 
-logger = logger_create('bitbake-diffsigs')
-
-def find_compare_task(bbhandler, pn, taskname):
+def find_compare_task(bbhandler, pn, taskname, sig1=None, sig2=None, color=False):
     """ Find the most recent signature files for the specified PN/task and compare them """
 
-    def get_hashval(siginfo):
-        if siginfo.endswith('.siginfo'):
-            return siginfo.rpartition(':')[2].partition('_')[0]
-        else:
-            return siginfo.rpartition('.')[2]
-
     if not hasattr(bb.siggen, 'find_siginfo'):
         logger.error('Metadata does not support finding signature data files')
         sys.exit(1)
@@ -60,79 +44,119 @@
     if not taskname.startswith('do_'):
         taskname = 'do_%s' % taskname
 
-    filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
-    latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-3:]
-    if not latestfiles:
-        logger.error('No sigdata files found matching %s %s' % (pn, taskname))
-        sys.exit(1)
-    elif len(latestfiles) < 2:
-        logger.error('Only one matching sigdata file found for the specified task (%s %s)' % (pn, taskname))
-        sys.exit(1)
+    if sig1 and sig2:
+        sigfiles = bb.siggen.find_siginfo(pn, taskname, [sig1, sig2], bbhandler.config_data)
+        if len(sigfiles) == 0:
+            logger.error('No sigdata files found matching %s %s matching either %s or %s' % (pn, taskname, sig1, sig2))
+            sys.exit(1)
+        elif not sig1 in sigfiles:
+            logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig1))
+            sys.exit(1)
+        elif not sig2 in sigfiles:
+            logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig2))
+            sys.exit(1)
+        latestfiles = [sigfiles[sig1], sigfiles[sig2]]
     else:
-        # It's possible that latestfiles contain 3 elements and the first two have the same hash value.
-        # In this case, we delete the second element.
-        # The above case is actually the most common one. Because we may have sigdata file and siginfo
-        # file having the same hash value. Comparing such two files makes no sense.
-        if len(latestfiles) == 3:
-            hash0 = get_hashval(latestfiles[0])
-            hash1 = get_hashval(latestfiles[1])
-            if hash0 == hash1:
-                latestfiles.pop(1)
+        filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
+        latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-3:]
+        if not latestfiles:
+            logger.error('No sigdata files found matching %s %s' % (pn, taskname))
+            sys.exit(1)
+        elif len(latestfiles) < 2:
+            logger.error('Only one matching sigdata file found for the specified task (%s %s)' % (pn, taskname))
+            sys.exit(1)
 
-        # Define recursion callback
-        def recursecb(key, hash1, hash2):
-            hashes = [hash1, hash2]
-            hashfiles = bb.siggen.find_siginfo(key, None, hashes, bbhandler.config_data)
+    # Define recursion callback
+    def recursecb(key, hash1, hash2):
+        hashes = [hash1, hash2]
+        hashfiles = bb.siggen.find_siginfo(key, None, hashes, bbhandler.config_data)
 
-            recout = []
-            if len(hashfiles) == 2:
-                out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb)
-                recout.extend(list('  ' + l for l in out2))
-            else:
-                recout.append("Unable to find matching sigdata for %s with hashes %s or %s" % (key, hash1, hash2))
+        recout = []
+        if len(hashfiles) == 0:
+            recout.append("Unable to find matching sigdata for %s with hashes %s or %s" % (key, hash1, hash2))
+        elif not hash1 in hashfiles:
+            recout.append("Unable to find matching sigdata for %s with hash %s" % (key, hash1))
+        elif not hash2 in hashfiles:
+            recout.append("Unable to find matching sigdata for %s with hash %s" % (key, hash2))
+        else:
+            out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb, color=color)
+            for change in out2:
+                for line in change.splitlines():
+                    recout.append('  ' + line)
 
-            return recout
+        return recout
 
-        # Recurse into signature comparison
-        output = bb.siggen.compare_sigfiles(latestfiles[0], latestfiles[1], recursecb)
-        if output:
-            print('\n'.join(output))
+    # Recurse into signature comparison
+    logger.debug("Signature file (previous): %s" % latestfiles[-2])
+    logger.debug("Signature file (latest): %s" % latestfiles[-1])
+    output = bb.siggen.compare_sigfiles(latestfiles[-2], latestfiles[-1], recursecb, color=color)
+    if output:
+        print('\n'.join(output))
     sys.exit(0)
 
 
 
-parser = optparse.OptionParser(
-    description = "Compares siginfo/sigdata files written out by BitBake",
-    usage = """
-  %prog -t recipename taskname
-  %prog sigdatafile1 sigdatafile2
-  %prog sigdatafile1""")
+parser = argparse.ArgumentParser(
+    description="Compares siginfo/sigdata files written out by BitBake")
 
-parser.add_option("-t", "--task",
-        help = "find the signature data files for last two runs of the specified task and compare them",
-        action="store", dest="taskargs", nargs=2, metavar='recipename taskname')
+parser.add_argument('-d', '--debug',
+                    help='Enable debug output',
+                    action='store_true')
 
-options, args = parser.parse_args(sys.argv)
+parser.add_argument('--color',
+        help='Colorize output (where %(metavar)s is %(choices)s)',
+        choices=['auto', 'always', 'never'], default='auto', metavar='color')
+
+parser.add_argument("-t", "--task",
+        help="find the signature data files for last two runs of the specified task and compare them",
+        action="store", dest="taskargs", nargs=2, metavar=('recipename', 'taskname'))
+
+parser.add_argument("-s", "--signature",
+        help="With -t/--task, specify the signatures to look for instead of taking the last two",
+        action="store", dest="sigargs", nargs=2, metavar=('fromsig', 'tosig'))
+
+parser.add_argument("sigdatafile1",
+        help="First signature file to compare (or signature file to dump, if second not specified). Not used when using -t/--task.",
+        action="store", nargs='?')
+
+parser.add_argument("sigdatafile2",
+        help="Second signature file to compare",
+        action="store", nargs='?')
+
+
+options = parser.parse_args()
+
+if options.debug:
+    logger.setLevel(logging.DEBUG)
+
+color = (options.color == 'always' or (options.color == 'auto' and sys.stdout.isatty()))
 
 if options.taskargs:
     with bb.tinfoil.Tinfoil() as tinfoil:
         tinfoil.prepare(config_only=True)
-        find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1])
+        if options.sigargs:
+            find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1], options.sigargs[0], options.sigargs[1], color=color)
+        else:
+            find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1], color=color)
 else:
-    if len(args) == 1:
-        parser.print_help()
-    else:
-        try:
-            if len(args) == 2:
-                output = bb.siggen.dump_sigfile(sys.argv[1])
-            else:
-                output = bb.siggen.compare_sigfiles(sys.argv[1], sys.argv[2])
-        except IOError as e:
-            logger.error(str(e))
+    if options.sigargs:
+        logger.error('-s/--signature can only be used together with -t/--task')
+        sys.exit(1)
+    try:
+        if options.sigdatafile1 and options.sigdatafile2:
+            output = bb.siggen.compare_sigfiles(options.sigdatafile1, options.sigdatafile2, color=color)
+        elif options.sigdatafile1:
+            output = bb.siggen.dump_sigfile(options.sigdatafile1)
+        else:
+            logger.error('Must specify signature file(s) or -t/--task')
+            parser.print_help()
             sys.exit(1)
-        except (pickle.UnpicklingError, EOFError):
-            logger.error('Invalid signature data - ensure you are specifying sigdata/siginfo files')
-            sys.exit(1)
+    except IOError as e:
+        logger.error(str(e))
+        sys.exit(1)
+    except (pickle.UnpicklingError, EOFError):
+        logger.error('Invalid signature data - ensure you are specifying sigdata/siginfo files')
+        sys.exit(1)
 
-        if output:
-            print('\n'.join(output))
+    if output:
+        print('\n'.join(output))
diff --git a/import-layers/yocto-poky/bitbake/bin/bitbake-dumpsig b/import-layers/yocto-poky/bitbake/bin/bitbake-dumpsig
index 58ba1ca..95ebd93 100755
--- a/import-layers/yocto-poky/bitbake/bin/bitbake-dumpsig
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake-dumpsig
@@ -27,39 +27,68 @@
 
 sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
 
+import bb.tinfoil
 import bb.siggen
+import bb.msg
 
-def logger_create(name, output=sys.stderr):
-    logger = logging.getLogger(name)
-    console = logging.StreamHandler(output)
-    format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
-    if output.isatty():
-        format.enable_color()
-    console.setFormatter(format)
-    logger.addHandler(console)
-    logger.setLevel(logging.INFO)
-    return logger
+logger = bb.msg.logger_create('bitbake-dumpsig')
 
-logger = logger_create('bitbake-dumpsig')
+def find_siginfo_task(bbhandler, pn, taskname):
+    """ Find the most recent signature file for the specified PN/task """
+
+    if not hasattr(bb.siggen, 'find_siginfo'):
+        logger.error('Metadata does not support finding signature data files')
+        sys.exit(1)
+
+    if not taskname.startswith('do_'):
+        taskname = 'do_%s' % taskname
+
+    filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
+    latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-1:]
+    if not latestfiles:
+        logger.error('No sigdata files found matching %s %s' % (pn, taskname))
+        sys.exit(1)
+
+    return latestfiles[0]
 
 parser = optparse.OptionParser(
     description = "Dumps siginfo/sigdata files written out by BitBake",
     usage = """
+  %prog -t recipename taskname
   %prog sigdatafile""")
 
+parser.add_option("-D", "--debug",
+        help = "enable debug",
+        action = "store_true", dest="debug", default = False)
+
+parser.add_option("-t", "--task",
+        help = "find the signature data file for the specified task",
+        action="store", dest="taskargs", nargs=2, metavar='recipename taskname')
+
 options, args = parser.parse_args(sys.argv)
 
-if len(args) == 1:
-    parser.print_help()
-else:
-    try:
-        output = bb.siggen.dump_sigfile(args[1])
-    except IOError as e:
-        logger.error(str(e))
-        sys.exit(1)
-    except (pickle.UnpicklingError, EOFError):
-        logger.error('Invalid signature data - ensure you are specifying a sigdata/siginfo file')
-        sys.exit(1)
+if options.debug:
+    logger.setLevel(logging.DEBUG)
 
-    if output:
-        print('\n'.join(output))
+if options.taskargs:
+    tinfoil = bb.tinfoil.Tinfoil()
+    tinfoil.prepare(config_only = True)
+    file = find_siginfo_task(tinfoil, options.taskargs[0], options.taskargs[1])
+    logger.debug("Signature file: %s" % file)
+elif len(args) == 1:
+    parser.print_help()
+    sys.exit(0)
+else:
+    file = args[1]
+
+try:
+    output = bb.siggen.dump_sigfile(file)
+except IOError as e:
+    logger.error(str(e))
+    sys.exit(1)
+except (pickle.UnpicklingError, EOFError):
+    logger.error('Invalid signature data - ensure you are specifying a sigdata/siginfo file')
+    sys.exit(1)
+
+if output:
+    print('\n'.join(output))
diff --git a/import-layers/yocto-poky/bitbake/bin/bitbake-layers b/import-layers/yocto-poky/bitbake/bin/bitbake-layers
index 946def2..2b05d28 100755
--- a/import-layers/yocto-poky/bitbake/bin/bitbake-layers
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake-layers
@@ -24,43 +24,19 @@
 import os
 import sys
 import argparse
+import signal
 
 bindir = os.path.dirname(__file__)
 topdir = os.path.dirname(bindir)
 sys.path[0:0] = [os.path.join(topdir, 'lib')]
 
 import bb.tinfoil
+import bb.msg
 
-
-def tinfoil_init(parserecipes):
-    import bb.tinfoil
-    tinfoil = bb.tinfoil.Tinfoil(tracking=True)
-    tinfoil.prepare(not parserecipes)
-    tinfoil.logger.setLevel(logger.getEffectiveLevel())
-    return tinfoil
-
-
-def logger_create(name, output=sys.stderr):
-    logger = logging.getLogger(name)
-    loggerhandler = logging.StreamHandler(output)
-    loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
-    logger.addHandler(loggerhandler)
-    logger.setLevel(logging.INFO)
-    return logger
-
-def logger_setup_color(logger, color='auto'):
-    from bb.msg import BBLogFormatter
-    console = logging.StreamHandler(sys.stdout)
-    formatter = BBLogFormatter("%(levelname)s: %(message)s")
-    console.setFormatter(formatter)
-    logger.handlers = [console]
-    if color == 'always' or (color == 'auto' and console.stream.isatty()):
-        formatter.enable_color()
-
-
-logger = logger_create('bitbake-layers', sys.stdout)
+logger = bb.msg.logger_create('bitbake-layers', sys.stdout)
 
 def main():
+    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
     parser = argparse.ArgumentParser(
         description="BitBake layers utility",
         epilog="Use %(prog)s <subcommand> --help to get help on a specific command",
@@ -83,13 +59,17 @@
     elif global_args.quiet:
         logger.setLevel(logging.ERROR)
 
-    logger_setup_color(logger, global_args.color)
+    # Need to re-run logger_create with color argument
+    # (will be the same logger since it has the same name)
+    bb.msg.logger_create('bitbake-layers', output=sys.stdout, color=global_args.color)
 
     plugins = []
-    tinfoil = tinfoil_init(False)
+    tinfoil = bb.tinfoil.Tinfoil(tracking=True)
+    tinfoil.logger.setLevel(logger.getEffectiveLevel())
     try:
+        tinfoil.prepare(True)
         for path in ([topdir] +
-                    tinfoil.config_data.getVar('BBPATH', True).split(':')):
+                    tinfoil.config_data.getVar('BBPATH').split(':')):
             pluginpath = os.path.join(path, 'lib', 'bblayers')
             bb.utils.load_plugins(logger, plugins, pluginpath)
 
diff --git a/import-layers/yocto-poky/bitbake/bin/bitbake-worker b/import-layers/yocto-poky/bitbake/bin/bitbake-worker
index db3c4b1..ee2d622 100755
--- a/import-layers/yocto-poky/bitbake/bin/bitbake-worker
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake-worker
@@ -95,6 +95,7 @@
             pass
         while (worker_queue_int or not worker_queue.empty()):
             try:
+                (_, ready, _) = select.select([], [worker_pipe], [], 1)
                 if not worker_queue.empty():
                     worker_queue_int = worker_queue_int + worker_queue.get()
                 written = os.write(worker_pipe, worker_queue_int)
@@ -135,7 +136,7 @@
     os.killpg(0, signal.SIGTERM)
     sys.exit()
 
-def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, appends, taskdepdata, quieterrors=False):
+def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, appends, taskdepdata, extraconfigdata, quieterrors=False, dry_run_exec=False):
     # We need to setup the environment BEFORE the fork, since
     # a fork() or exec*() activates PSEUDO...
 
@@ -151,8 +152,10 @@
         except TypeError:
              umask = taskdep['umask'][taskname]
 
+    dry_run = cfg.dry_run or dry_run_exec
+
     # We can't use the fakeroot environment in a dry run as it possibly hasn't been built
-    if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not cfg.dry_run:
+    if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not dry_run:
         envvars = (workerdata["fakerootenv"][fn] or "").split()
         for key, value in (var.split('=') for var in envvars):
             envbackup[key] = os.environ.get(key)
@@ -219,16 +222,21 @@
                 the_data = databuilder.mcdata[mc]
                 the_data.setVar("BB_WORKERCONTEXT", "1")
                 the_data.setVar("BB_TASKDEPDATA", taskdepdata)
+                if cfg.limited_deps:
+                    the_data.setVar("BB_LIMITEDDEPS", "1")
                 the_data.setVar("BUILDNAME", workerdata["buildname"])
                 the_data.setVar("DATE", workerdata["date"])
                 the_data.setVar("TIME", workerdata["time"])
+                for varname, value in extraconfigdata.items():
+                    the_data.setVar(varname, value)
+
                 bb.parse.siggen.set_taskdata(workerdata["sigdata"])
                 ret = 0
 
                 the_data = bb_cache.loadDataFull(fn, appends)
                 the_data.setVar('BB_TASKHASH', workerdata["runq_hash"][task])
 
-                bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN", True), taskname.replace("do_", "")))
+                bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN"), taskname.replace("do_", "")))
 
                 # exported_vars() returns a generator which *cannot* be passed to os.environ.update() 
                 # successfully. We also need to unset anything from the environment which shouldn't be there 
@@ -243,11 +251,11 @@
                     the_data.setVar(e, fakeenv[e])
                     the_data.setVarFlag(e, 'export', "1")
 
-                task_exports = the_data.getVarFlag(taskname, 'exports', True)
+                task_exports = the_data.getVarFlag(taskname, 'exports')
                 if task_exports:
                     for e in task_exports.split():
                         the_data.setVarFlag(e, 'export', '1')
-                        v = the_data.getVar(e, True)
+                        v = the_data.getVar(e)
                         if v is not None:
                             os.environ[e] = v
 
@@ -259,7 +267,7 @@
                     logger.critical(traceback.format_exc())
                 os._exit(1)
             try:
-                if cfg.dry_run:
+                if dry_run:
                     return 0
                 return bb.build.exec_task(fn, taskname, the_data, cfg.profile)
             except:
@@ -328,6 +336,7 @@
         self.cookercfg = None
         self.databuilder = None
         self.data = None
+        self.extraconfigdata = None
         self.build_pids = {}
         self.build_pipes = {}
     
@@ -362,6 +371,7 @@
                     pass
             if len(self.queue):
                 self.handle_item(b"cookerconfig", self.handle_cookercfg)
+                self.handle_item(b"extraconfigdata", self.handle_extraconfigdata)
                 self.handle_item(b"workerdata", self.handle_workerdata)
                 self.handle_item(b"runtask", self.handle_runtask)
                 self.handle_item(b"finishnow", self.handle_finishnow)
@@ -369,9 +379,11 @@
                 self.handle_item(b"quit", self.handle_quit)
 
             for pipe in self.build_pipes:
-                self.build_pipes[pipe].read()
+                if self.build_pipes[pipe].input in ready:
+                    self.build_pipes[pipe].read()
             if len(self.build_pids):
-                self.process_waitpid()
+                while self.process_waitpid():
+                    continue
 
 
     def handle_item(self, item, func):
@@ -388,6 +400,9 @@
         self.databuilder.parseBaseConfiguration()
         self.data = self.databuilder.data
 
+    def handle_extraconfigdata(self, data):
+        self.extraconfigdata = pickle.loads(data)
+
     def handle_workerdata(self, data):
         self.workerdata = pickle.loads(data)
         bb.msg.loggerDefaultDebugLevel = self.workerdata["logdefaultdebug"]
@@ -410,10 +425,10 @@
         sys.exit(0)
 
     def handle_runtask(self, data):
-        fn, task, taskname, quieterrors, appends, taskdepdata = pickle.loads(data)
+        fn, task, taskname, quieterrors, appends, taskdepdata, dry_run_exec = pickle.loads(data)
         workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname))
 
-        pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.databuilder, self.workerdata, fn, task, taskname, appends, taskdepdata, quieterrors)
+        pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.databuilder, self.workerdata, fn, task, taskname, appends, taskdepdata, self.extraconfigdata, quieterrors, dry_run_exec)
 
         self.build_pids[pid] = task
         self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout)
@@ -426,9 +441,9 @@
         try:
             pid, status = os.waitpid(-1, os.WNOHANG)
             if pid == 0 or os.WIFSTOPPED(status):
-                return None
+                return False
         except OSError:
-            return None
+            return False
 
         workerlog_write("Exit code of %s for pid %s\n" % (status, pid))
 
@@ -447,6 +462,8 @@
 
         worker_fire_prepickled(b"<exitcode>" + pickle.dumps((task, status)) + b"</exitcode>")
 
+        return True
+
     def handle_finishnow(self, _):
         if self.build_pids:
             logger.info("Sending SIGTERM to remaining %s tasks", len(self.build_pids))
diff --git a/import-layers/yocto-poky/bitbake/bin/toaster b/import-layers/yocto-poky/bitbake/bin/toaster
index f92d38e..61a4a0f 100755
--- a/import-layers/yocto-poky/bitbake/bin/toaster
+++ b/import-layers/yocto-poky/bitbake/bin/toaster
@@ -24,6 +24,29 @@
         [webport] Set the development server (default: localhost:8000)
 "
 
+databaseCheck()
+{
+    retval=0
+    # you can always add a superuser later via
+    # ../bitbake/lib/toaster/manage.py createsuperuser --username=<ME>
+    $MANAGE migrate --noinput || retval=1
+
+    if [ $retval -eq 1 ]; then
+        echo "Failed migrations, aborting system start" 1>&2
+        return $retval
+    fi
+    # Make sure that checksettings can pick up any value for TEMPLATECONF
+    export TEMPLATECONF
+    $MANAGE checksettings --traceback || retval=1
+
+    if [ $retval -eq 1 ]; then
+        printf "\nError while checking settings; aborting\n"
+        return $retval
+    fi
+
+    return $retval
+}
+
 webserverKillAll()
 {
     local pidfile
@@ -48,22 +71,9 @@
     fi
 
     retval=0
-    # you can always add a superuser later via
-    # ../bitbake/lib/toaster/manage.py createsuperuser --username=<ME>
-    $MANAGE migrate --noinput || retval=1
 
-    if [ $retval -eq 1 ]; then
-        echo "Failed migrations, aborting system start" 1>&2
-        return $retval
-    fi
-    # Make sure that checksettings can pick up any value for TEMPLATECONF
-    export TEMPLATECONF
-    $MANAGE checksettings --traceback || retval=1
-
-    if [ $retval -eq 1 ]; then
-        printf "\nError while checking settings; aborting\n"
-        return $retval
-    fi
+    # check the database
+    databaseCheck || return 1
 
     echo "Starting webserver..."
 
@@ -111,7 +121,7 @@
     if ! sed -n "$exp" $reqfile | python3 - ; then
         req=`grep ^Django $reqfile`
         echo "This program needs $req"
-        echo "Please install with pip install -r $reqfile"
+        echo "Please install with pip3 install -r $reqfile"
         return 2
     fi
 
@@ -151,14 +161,7 @@
 
 unset OE_ROOT
 
-# this defines the dir toaster will use for
-# 1) clones of layers (in _toaster_clones )
-# 2) the build dir (in build)
-# 3) the sqlite db if that is being used.
-# 4) pid's we need to clean up on exit/shutdown
-# note: for future. in order to make this an arbitrary directory, we need to
-# make sure that the toaster.sqlite file doesn't default to `pwd` like it currently does.
-export TOASTER_DIR=`pwd`
+
 
 WEBSERVER=1
 ADDR_PORT="localhost:8000"
@@ -214,10 +217,8 @@
 # 2) the build dir (in build)
 # 3) the sqlite db if that is being used.
 # 4) pid's we need to clean up on exit/shutdown
-# note: for future. in order to make this an arbitrary directory, we need to
-# make sure that the toaster.sqlite file doesn't default to `pwd`
-# like it currently does.
 export TOASTER_DIR=`dirname $BUILDDIR`
+export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE TOASTER_DIR"
 
 # Determine the action. If specified by arguments, fine, if not, toggle it
 if [ "$CMD" = "start" ] ; then
@@ -249,12 +250,25 @@
         line='INHERIT+="toaster buildhistory"'
         grep -q "$line" $conf || echo $line >> $conf
 
+        if [ $WEBSERVER -eq 0 ] ; then
+            # Do not update the database for "noweb" unless
+            # it does not yet exist
+            if [ ! -f "$TOASTER_DIR/toaster.sqlite" ] ; then
+                if ! databaseCheck; then
+                    echo "Failed ${CMD}."
+                  return 4
+                fi
+            fi
+        fi
         if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
             echo "Failed ${CMD}."
             return 4
         fi
         export BITBAKE_UI='toasterui'
-        $MANAGE runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
+        $MANAGE runbuilds \
+           </dev/null >>${BUILDDIR}/toaster_runbuilds.log 2>&1 \
+           & echo $! >${BUILDDIR}/.runbuilds.pid
+
         # set fail safe stop system on terminal exit
         trap stop_system SIGHUP
         echo "Successful ${CMD}."
diff --git a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml
index 2a3340b..d1ce43e 100644
--- a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml
@@ -38,7 +38,7 @@
             The code to execute the first part of this process, a fetch,
             looks something like the following:
             <literallayout class='monospaced'>
-     src_uri = (d.getVar('SRC_URI', True) or "").split()
+     src_uri = (d.getVar('SRC_URI') or "").split()
      fetcher = bb.fetch2.Fetch(src_uri, d)
      fetcher.download()
             </literallayout>
@@ -52,7 +52,7 @@
         <para>
             The instantiation of the fetch class is usually followed by:
             <literallayout class='monospaced'>
-     rootdir = l.getVar('WORKDIR', True)
+     rootdir = l.getVar('WORKDIR')
      fetcher.unpack(rootdir)
             </literallayout>
             This code unpacks the downloaded files to the
@@ -268,15 +268,6 @@
                 <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>
                 variable is used in the same way
                 <filename>PATH</filename> is used to find executables.
-                Failing that,
-                <link linkend='var-FILESDIR'><filename>FILESDIR</filename></link>
-                is used to find the appropriate relative file.
-                <note>
-                    <filename>FILESDIR</filename> is deprecated and can
-                    be replaced with <filename>FILESPATH</filename>.
-                    Because <filename>FILESDIR</filename> is likely to be
-                    removed, you should not use this variable in any new code.
-                </note>
                 If the file cannot be found, it is assumed that it is available in
                 <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
                 by the time the <filename>download()</filename> method is called.
@@ -385,7 +376,8 @@
                 The supported parameters are as follows:
                 <itemizedlist>
                     <listitem><para><emphasis>"method":</emphasis>
-                        The protocol over which to communicate with the CVS server.
+                        The protocol over which to communicate with the CVS
+                        server.
                         By default, this protocol is "pserver".
                         If "method" is set to "ext", BitBake examines the
                         "rsh" parameter and sets <filename>CVS_RSH</filename>.
@@ -469,25 +461,29 @@
                         You can think of this parameter as the top-level
                         directory of the repository data you want.
                         </para></listitem>
+                    <listitem><para><emphasis>"path_spec":</emphasis>
+                        A specific directory in which to checkout the
+                        specified svn module.
+                        </para></listitem>
                     <listitem><para><emphasis>"protocol":</emphasis>
                         The protocol to use, which defaults to "svn".
-                        Other options are "svn+ssh" and "rsh".
-                        For "rsh", the "rsh" parameter is also used.
+                        If "protocol" is set to "svn+ssh", the "ssh"
+                        parameter is also used.
                         </para></listitem>
                     <listitem><para><emphasis>"rev":</emphasis>
                         The revision of the source code to checkout.
                         </para></listitem>
-                    <listitem><para><emphasis>"date":</emphasis>
-                        The date of the source code to checkout.
-                        Specific revisions are generally much safer to checkout
-                        rather than by date as they do not involve timezones
-                        (e.g. they are much more deterministic).
-                        </para></listitem>
                     <listitem><para><emphasis>"scmdata":</emphasis>
                         Causes the “.svn” directories to be available during
                         compile-time when set to "keep".
                         By default, these directories are removed.
                         </para></listitem>
+                    <listitem><para><emphasis>"ssh":</emphasis>
+                        An optional parameter used when "protocol" is set
+                        to "svn+ssh".
+                        You can use this parameter to specify the ssh
+                        program used by svn.
+                        </para></listitem>
                     <listitem><para><emphasis>"transportuser":</emphasis>
                         When required, sets the username for the transport.
                         By default, this parameter is empty.
@@ -496,10 +492,11 @@
                         command.
                         </para></listitem>
                 </itemizedlist>
-                Following are two examples using svn:
+                Following are three examples using svn:
                 <literallayout class='monospaced'>
-     SRC_URI = "svn://svn.oe.handhelds.org/svn;module=vip;proto=http;rev=667"
-     SRC_URI = "svn://svn.oe.handhelds.org/svn/;module=opie;proto=svn+ssh;date=20060126"
+     SRC_URI = "svn://myrepos/proj1;module=vip;protocol=http;rev=667"
+     SRC_URI = "svn://myrepos/proj1;module=opie;protocol=svn+ssh"
+     SRC_URI = "svn://myrepos/proj1;module=trunk;protocol=http;path_spec=${MY_DIR}/proj1"
                 </literallayout>
             </para>
         </section>
diff --git a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
index 8b7edbf..2685c0e 100644
--- a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
@@ -134,7 +134,7 @@
                     <ulink url="http://www.mail-archive.com/yocto@yoctoproject.org/msg09379.html">Mailing List post - The BitBake equivalent of "Hello, World!"</ulink>
                     </para></listitem>
                 <listitem><para>
-                    <ulink url="http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/">Hambedded Linux blog post - From Bitbake Hello World to an Image</ulink>
+                    <ulink url="https://web.archive.org/web/20150325165911/http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/">Hambedded Linux blog post - From Bitbake Hello World to an Image</ulink>
                     </para></listitem>
             </itemizedlist>
         </note>
@@ -269,7 +269,7 @@
                 and define some key BitBake variables.
                 For more information on the <filename>bitbake.conf</filename>,
                 see
-                <ulink url='http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#an-overview-of-bitbakeconf'></ulink>
+                <ulink url='https://web.archive.org/web/20150325165911/http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#an-overview-of-bitbakeconf'></ulink>
                 </para>
                 <para>Use the following commands to create the <filename>conf</filename>
                 directory in the project directory:
@@ -354,7 +354,7 @@
                 supporting.
                 For more information on the <filename>base.bbclass</filename> file,
                 you can look at
-                <ulink url='http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#tasks'></ulink>.
+                <ulink url='https://web.archive.org/web/20150325165911/http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#tasks'></ulink>.
                 </para></listitem>
             <listitem><para><emphasis>Run Bitbake:</emphasis>
                 After making sure that the <filename>classes/base.bbclass</filename>
@@ -376,7 +376,7 @@
                 Thus, this example creates and uses a layer called "mylayer".
                 <note>
                     You can find additional information on adding a layer at
-                    <ulink url='http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#adding-an-example-layer'></ulink>.
+                    <ulink url='https://web.archive.org/web/20150325165911/http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#adding-an-example-layer'></ulink>.
                 </note>
                 </para>
                 <para>Minimally, you need a recipe file and a layer configuration
diff --git a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml
index 4d58dc4..ca7f724 100644
--- a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml
@@ -504,9 +504,19 @@
                              Read the specified file before bitbake.conf.
        -R POSTFILE, --postread=POSTFILE
                              Read the specified file after bitbake.conf.
-       -v, --verbose         Output more log message data to the terminal.
-       -D, --debug           Increase the debug level. You can specify this more
-                             than once.
+       -v, --verbose         Enable tracing of shell tasks (with 'set -x').
+                             Also print bb.note(...) messages to stdout (in
+                             addition to writing them to ${T}/log.do_&lt;task&gt;).
+       -D, --debug           Increase the debug level. You can specify this
+                             more than once. -D sets the debug level to 1,
+                             where only bb.debug(1, ...) messages are printed
+                             to stdout; -DD sets the debug level to 2, where
+                             both bb.debug(1, ...) and bb.debug(2, ...)
+                             messages are printed; etc. Without -D, no debug
+                             messages are printed. Note that -D only affects
+                             output to stdout. All debug messages are written
+                             to ${T}/log.do_taskname, regardless of the debug
+                             level.
        -n, --dry-run         Don't execute, just go through the motions.
        -S SIGNATURE_HANDLER, --dump-signatures=SIGNATURE_HANDLER
                              Dump out the signature construction information, with
@@ -529,8 +539,8 @@
        -l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS
                              Show debug logging for the specified logging domains
        -P, --profile         Profile the command and save reports.
-       -u UI, --ui=UI        The user interface to use (depexp, goggle, hob, knotty
-                             or ncurses - default knotty).
+       -u UI, --ui=UI        The user interface to use (taskexp, knotty or
+                             ncurses - default knotty).
        -t SERVERTYPE, --servertype=SERVERTYPE
                              Choose which server type to use (process or xmlrpc -
                              default process).
@@ -543,6 +553,7 @@
        -B BIND, --bind=BIND  The name/address for the bitbake server to bind to.
        --no-setscene         Do not run any setscene tasks. sstate will be ignored
                              and everything needed, built.
+       --setscene-only       Only run setscene tasks, don't run any real tasks.
        --remote-server=REMOTE_SERVER
                              Connect to the specified server.
        -m, --kill-server     Terminate the remote server.
@@ -665,21 +676,21 @@
                 </para>
 
                 <para>
-                    When you generate a dependency graph, BitBake writes four files
+                    When you generate a dependency graph, BitBake writes three files
                     to the current working directory:
                     <itemizedlist>
-                        <listitem><para><emphasis><filename>package-depends.dot</filename>:</emphasis>
-                            Shows BitBake's knowledge of dependencies between
-                            runtime targets.
+                        <listitem><para>
+                            <emphasis><filename>recipe-depends.dot</filename>:</emphasis>
+                            Shows dependencies between recipes (i.e. a collapsed version of
+                            <filename>task-depends.dot</filename>).
                             </para></listitem>
-                        <listitem><para><emphasis><filename>pn-depends.dot</filename>:</emphasis>
-                            Shows dependencies between build-time targets
-                            (i.e. recipes).
-                            </para></listitem>
-                        <listitem><para><emphasis><filename>task-depends.dot</filename>:</emphasis>
+                        <listitem><para>
+                            <emphasis><filename>task-depends.dot</filename>:</emphasis>
                             Shows dependencies between tasks.
+                            These dependencies match BitBake's internal task execution list.
                             </para></listitem>
-                        <listitem><para><emphasis><filename>pn-buildlist</filename>:</emphasis>
+                        <listitem><para>
+                            <emphasis><filename>pn-buildlist</filename>:</emphasis>
                             Shows a simple list of targets that are to be built.
                             </para></listitem>
                     </itemizedlist>
diff --git a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
index 71bb25b..1d1e5b3 100644
--- a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
@@ -61,6 +61,48 @@
             </para>
         </section>
 
+        <section id='line-joining'>
+            <title>Line Joining</title>
+
+            <para>
+                Outside of
+                <link linkend='functions'>functions</link>, BitBake joins
+                any line ending in a backslash character ("\")
+                with the following line before parsing statements.
+                The most common use for the "\" character is to split variable
+                assignments over multiple lines, as in the following example:
+                <literallayout class='monospaced'>
+     FOO = "bar \
+            baz \
+            qaz"
+                </literallayout>
+                Both the "\" character and the newline character
+                that follow it are removed when joining lines.
+                Thus, no newline characters end up in the value of
+                <filename>FOO</filename>.
+            </para>
+
+            <para>
+                Consider this additional example where the two
+                assignments both assign "barbaz" to
+                <filename>FOO</filename>:
+                <literallayout class='monospaced'>
+     FOO = "barbaz"
+
+     FOO = "bar\
+     baz"
+                </literallayout>
+                <note>
+                    BitBake does not interpret escape sequences like
+                    "\n" in variable values.
+                    For these to have an effect, the value must be passed
+                    to some utility that interprets escape sequences,
+                    such as <filename>printf</filename> or
+                    <filename>echo -n</filename>.
+                </note>
+            </para>
+        </section>
+
         <section id='variable-expansion'>
             <title>Variable Expansion</title>
 
@@ -463,14 +505,14 @@
             <title>Unseting variables</title>
 
             <para>
-                It is possible to completely remove a variable or a variable flag 
+                It is possible to completely remove a variable or a variable flag
                 from BitBake's internal data dictionary by using the "unset" keyword.
                 Here is an example:
                 <literallayout class='monospaced'>
         unset DATE
         unset do_fetch[noexec]
                 </literallayout>
-                These two statements remove the <filename>DATE</filename> and the 
+                These two statements remove the <filename>DATE</filename> and the
                 <filename>do_fetch[noexec]</filename> flag.
             </para>
 
@@ -1165,7 +1207,7 @@
                 <literallayout class='monospaced'>
      python some_python_function () {
          d.setVar("TEXT", "Hello World")
-         print d.getVar("TEXT", True)
+         print d.getVar("TEXT")
      }
                 </literallayout>
                 Because the Python "bb" and "os" modules are already
@@ -1180,7 +1222,7 @@
                     to freely set variable values to expandable expressions
                     without having them expanded prematurely.
                     If you do wish to expand a variable within a Python
-                    function, use <filename>d.getVar("X", True)</filename>.
+                    function, use <filename>d.getVar("X")</filename>.
                     Or, for more complicated expressions, use
                     <filename>d.expand()</filename>.
                 </note>
@@ -1232,7 +1274,7 @@
                 Here is an example:
                 <literallayout class='monospaced'>
      def get_depends(d):
-         if d.getVar('SOMECONDITION', True):
+         if d.getVar('SOMECONDITION'):
              return "dependencywithcond"
          else:
              return "dependency"
@@ -1367,7 +1409,7 @@
                 based on the value of  another variable:
                 <literallayout class='monospaced'>
      python () {
-         if d.getVar('SOMEVAR', True) == 'value':
+         if d.getVar('SOMEVAR') == 'value':
              d.setVar('ANOTHERVAR', 'value2')
      }
                 </literallayout>
@@ -1942,128 +1984,194 @@
         <title>Events</title>
 
         <para>
-            BitBake allows installation of event handlers within
-            recipe and class files.
-            Events are triggered at certain points during operation,
-            such as the beginning of an operation against a given recipe
-            (<filename>*.bb</filename> file), the start of a given task,
-            task failure, task success, and so forth.
+            BitBake allows installation of event handlers within recipe
+            and class files.
+            Events are triggered at certain points during operation, such
+            as the beginning of operation against a given recipe
+            (i.e. <filename>*.bb</filename>), the start of a given task,
+            a task failure, a task success, and so forth.
             The intent is to make it easy to do things like email
-            notification on build failure.
+            notification on build failures.
         </para>
 
         <para>
-            Following is an example event handler that
-            prints the name of the event and the content of
-            the <filename>FILE</filename> variable:
+            Following is an example event handler that prints the name
+            of the event and the content of the
+            <filename>FILE</filename> variable:
             <literallayout class='monospaced'>
      addhandler myclass_eventhandler
      python myclass_eventhandler() {
          from bb.event import getName
-         from bb import data
          print("The name of the Event is %s" % getName(e))
-         print("The file we run for is %s" % data.getVar('FILE', e.data, True))
+         print("The file we run for is %s" % d.getVar('FILE'))
      }
+     myclass_eventhandler[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted"
             </literallayout>
-            This event handler gets called every time an event is
-            triggered.
-            A global variable "<filename>e</filename>" is defined and
-            "<filename>e.data</filename>" contains an instance of
-            "<filename>bb.data</filename>".
-            With the <filename>getName(e)</filename> method, one can get
+            In the previous example, an eventmask has been set so that
+            the handler only sees the "BuildStarted" and "BuildCompleted"
+            events.
+            This event handler gets called every time an event matching
+            the eventmask is triggered.
+            A global variable "e" is defined, which represents the current
+            event.
+            With the <filename>getName(e)</filename> method, you can get
             the name of the triggered event.
+            The global datastore is available as "d".
+            In legacy code, you might see "e.data" used to get the datastore.
+            However, realize that "e.data" is deprecated and you should use
+            "d" going forward.
         </para>
 
         <para>
-            Because you probably are only interested in a subset of events,
-            you would likely use the <filename>[eventmask]</filename> flag
-            for your event handler to be sure that only certain events
-            trigger the handler.
-            Given the previous example, suppose you only wanted the
-            <filename>bb.build.TaskFailed</filename> event to trigger that
-            event handler.
-            Use the flag as follows:
-            <literallayout class='monospaced'>
-     addhandler myclass_eventhandler
-     myclass_eventhandler[eventmask] = "bb.build.TaskFailed"
-     python myclass_eventhandler() {
-         from bb.event import getName
-         from bb import data
-         print("The name of the Event is %s" % getName(e))
-         print("The file we run for is %s" % data.getVar('FILE', e.data, True))
-     }
-            </literallayout>
+            The context of the datastore is appropriate to the event
+            in question.
+            For example, "BuildStarted" and "BuildCompleted" events run
+            before any tasks are executed so would be in the global
+            configuration datastore namespace.
+            No recipe-specific metadata exists in that namespace.
+            The "BuildStarted" and "buildCompleted" events also run in
+            the main cooker/server process rather than any worker context.
+            Thus, any changes made to the datastore would be seen by other
+            cooker/server events within the current build but not seen
+            outside of that build or in any worker context.
+            Task events run in the actual tasks in question consequently
+            have recipe-specific and task-specific contents.
+            These events run in the worker context and are discarded at
+            the end of task execution.
         </para>
 
         <para>
-            During a standard build, the following common events might occur:
+            During a standard build, the following common events might
+            occur.
+            The following events are the most common kinds of events that
+            most metadata might have an interest in viewing:
             <itemizedlist>
                 <listitem><para>
-                    <filename>bb.event.ConfigParsed()</filename>
+                    <filename>bb.event.ConfigParsed()</filename>:
+                    Fired when the base configuration; which consists of
+                    <filename>bitbake.conf</filename>,
+                    <filename>base.bbclass</filename> and any global
+                    <filename>INHERIT</filename> statements; has been parsed.
+                    You can see multiple such events when each of the
+                    workers parse the base configuration or if the server
+                    changes configuration and reparses.
+                    Any given datastore only has one such event executed
+                    against it, however.
+                    If
+                    <link linkende='var-BB_INVALIDCONF'><filename>BB_INVALIDCONF</filename></link>
+                    is set in the datastore by the event handler, the
+                    configuration is reparsed and a new event triggered,
+                    allowing the metadata to update configuration.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.ParseStarted()</filename>
+                    <filename>bb.event.HeartbeatEvent()</filename>:
+                    Fires at regular time intervals of one second.
+                    You can configure the interval time using the
+                    <filename>BB_HEARTBEAT_EVENT</filename> variable.
+                    The event's "time" attribute is the
+                    <filename>time.time()</filename> value when the
+                    event is triggered.
+                    This event is useful for activities such as
+                    system state monitoring.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.ParseProgress()</filename>
+                    <filename>bb.event.ParseStarted()</filename>:
+                    Fired when BitBake is about to start parsing recipes.
+                    This event's "total" attribute represents the number of
+                    recipes BitBake plans to parse.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.ParseCompleted()</filename>
+                    <filename>bb.event.ParseProgress()</filename>:
+                    Fired as parsing progresses.
+                    This event's "current" attribute is the number of
+                    recipes parsed as well as the "total" attribute.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.BuildStarted()</filename>
+                    <filename>bb.event.ParseCompleted()</filename>:
+                    Fired when parsing is complete.
+                    This event's "cached", "parsed", "skipped", "virtuals",
+                    "masked", and "errors" attributes provide statistics
+                    for the parsing results.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.build.TaskStarted()</filename>
+                    <filename>bb.event.BuildStarted()</filename>:
+                    Fired when a new build starts.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.build.TaskInvalid()</filename>
+                    <filename>bb.build.TaskStarted()</filename>:
+                    Fired when a task starts.
+                    This event's "taskfile" attribute points to the recipe
+                    from which the task originates.
+                    The "taskname" attribute, which is the task's name,
+                    includes the <filename>do_</filename> prefix, and the
+                    "logfile" attribute point to where the task's output is
+                    stored.
+                    Finally, the "time" attribute is the task's execution start
+                    time.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.build.TaskFailedSilent()</filename>
+                    <filename>bb.build.TaskInvalid()</filename>:
+                    Fired if BitBake tries to execute a task that does not exist.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.build.TaskFailed()</filename>
+                    <filename>bb.build.TaskFailedSilent()</filename>:
+                    Fired for setscene tasks that fail and should not be
+                    presented to the user verbosely.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.build.TaskSucceeded()</filename>
+                    <filename>bb.build.TaskFailed()</filename>:
+                    Fired for normal tasks that fail.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.BuildCompleted()</filename>
+                    <filename>bb.build.TaskSucceeded()</filename>:
+                    Fired when a task successfully completes.
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.cooker.CookerExit()</filename>
+                    <filename>bb.event.BuildCompleted()</filename>:
+                    Fired when a build finishes.
+                    </para></listitem>
+                <listitem><para>
+                    <filename>bb.cooker.CookerExit()</filename>:
+                    Fired when the BitBake server/cooker shuts down.
+                    This event is usually only seen by the UIs as a
+                    sign they should also shutdown.
                     </para></listitem>
             </itemizedlist>
-            Here is a list of other events that occur based on specific requests
-            to the server:
+        </para>
+
+        <para>
+            This next list of example events occur based on specific
+            requests to the server.
+            These events are often used to communicate larger pieces of
+            information from the BitBake server to other parts of
+            BitBake such as user interfaces:
             <itemizedlist>
                 <listitem><para>
                     <filename>bb.event.TreeDataPreparationStarted()</filename>
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.TreeDataPreparationProgress</filename>
+                    <filename>bb.event.TreeDataPreparationProgress()</filename>
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.TreeDataPreparationCompleted</filename>
+                    <filename>bb.event.TreeDataPreparationCompleted()</filename>
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.DepTreeGenerated</filename>
+                    <filename>bb.event.DepTreeGenerated()</filename>
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.CoreBaseFilesFound</filename>
+                    <filename>bb.event.CoreBaseFilesFound()</filename>
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.ConfigFilePathFound</filename>
+                    <filename>bb.event.ConfigFilePathFound()</filename>
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.FilesMatchingFound</filename>
+                    <filename>bb.event.FilesMatchingFound()</filename>
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.ConfigFilesFound</filename>
+                    <filename>bb.event.ConfigFilesFound()</filename>
                     </para></listitem>
                 <listitem><para>
-                    <filename>bb.event.TargetsTreeGenerated</filename>
+                    <filename>bb.event.TargetsTreeGenerated()</filename>
                     </para></listitem>
             </itemizedlist>
         </para>
diff --git a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml
index 66d8f84..0e89bf2 100644
--- a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml
@@ -1539,24 +1539,6 @@
             </glossdef>
         </glossentry>
 
-        <glossentry id='var-FILESDIR'><glossterm>FILESDIR</glossterm>
-            <glossdef>
-                <para>
-                    Specifies directories BitBake uses when searching for
-                    patches and files.
-                    The "local" fetcher module uses these directories when
-                    handling <filename>file://</filename> URLs if the file
-                    was not found using
-                    <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>.
-                    <note>
-                        The <filename>FILESDIR</filename> variable is
-                        deprecated and you should use
-                        <filename>FILESPATH</filename> in all new code.
-                    </note>
-                </para>
-            </glossdef>
-        </glossentry>
-
         <glossentry id='var-FILESPATH'><glossterm>FILESPATH</glossterm>
             <glossdef>
                 <para>
diff --git a/import-layers/yocto-poky/bitbake/doc/bitbake.1 b/import-layers/yocto-poky/bitbake/doc/bitbake.1
index a6c8d97..7fc1652 100644
--- a/import-layers/yocto-poky/bitbake/doc/bitbake.1
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake.1
@@ -105,7 +105,7 @@
 profile the command and print a report
 .TP
 .B \-uUI, \-\-ui=UI
-User interface to use. Currently, hob, depexp, goggle or ncurses can be specified as UI.
+User interface to use. Currently, knotty, taskexp or ncurses can be specified as UI.
 .TP
 .B \-tSERVERTYPE, \-\-servertype=SERVERTYPE
 Choose which server to use, none, process or xmlrpc.
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/COW.py b/import-layers/yocto-poky/bitbake/lib/bb/COW.py
index 77a05cf..36ebbd9 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/COW.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/COW.py
@@ -213,11 +213,11 @@
     print()
 
     print("a", a)
-    for x in a.items():
+    for x in a.iteritems():
         print(x)
     print("--")
     print("b", b)
-    for x in b.items():
+    for x in b.iteritems():
         print(x)
     print()
 
@@ -225,11 +225,11 @@
     b['a'] = 'c'
 
     print("a", a)
-    for x in a.items():
+    for x in a.iteritems():
         print(x)
     print("--")
     print("b", b)
-    for x in b.items():
+    for x in b.iteritems():
         print(x)
     print()
 
@@ -244,22 +244,22 @@
     a['set'].add("o2")
 
     print("a", a)
-    for x in a['set'].values():
+    for x in a['set'].itervalues():
         print(x)
     print("--")
     print("b", b)
-    for x in b['set'].values():
+    for x in b['set'].itervalues():
         print(x)
     print()
 
     b['set'].add('o3')
 
     print("a", a)
-    for x in a['set'].values():
+    for x in a['set'].itervalues():
         print(x)
     print("--")
     print("b", b)
-    for x in b['set'].values():
+    for x in b['set'].itervalues():
         print(x)
     print()
 
@@ -269,7 +269,7 @@
     a['set2'].add("o2")
 
     print("a", a)
-    for x in a.items():
+    for x in a.iteritems():
         print(x)
     print("--")
     print("b", b)
@@ -289,7 +289,7 @@
         print("Yay - has_key with delete works!")
 
     print("a", a)
-    for x in a.items():
+    for x in a.iteritems():
         print(x)
     print("--")
     print("b", b)
@@ -300,7 +300,7 @@
     b.__revertitem__('b')
 
     print("a", a)
-    for x in a.items():
+    for x in a.iteritems():
         print(x)
     print("--")
     print("b", b)
@@ -310,7 +310,7 @@
 
     b.__revertitem__('dict')
     print("a", a)
-    for x in a.items():
+    for x in a.iteritems():
         print(x)
     print("--")
     print("b", b)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/__init__.py
index f019d48..bfe0ca5 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/__init__.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/__init__.py
@@ -21,7 +21,7 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-__version__ = "1.32.0"
+__version__ = "1.34.0"
 
 import sys
 if sys.version_info < (3, 4, 0):
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/build.py b/import-layers/yocto-poky/bitbake/lib/bb/build.py
index b59a49b..0d0100a 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/build.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/build.py
@@ -91,14 +91,14 @@
 
     def __init__(self, t, logfile, d):
         self._task = t
-        self._package = d.getVar("PF", True)
-        self._mc = d.getVar("BB_CURRENT_MC", True)
-        self.taskfile = d.getVar("FILE", True)
+        self._package = d.getVar("PF")
+        self._mc = d.getVar("BB_CURRENT_MC")
+        self.taskfile = d.getVar("FILE")
         self.taskname = self._task
         self.logfile = logfile
         self.time = time.time()
         event.Event.__init__(self)
-        self._message = "recipe %s: task %s: %s" % (d.getVar("PF", True), t, self.getDisplayName())
+        self._message = "recipe %s: task %s: %s" % (d.getVar("PF"), t, self.getDisplayName())
 
     def getTask(self):
         return self._task
@@ -195,13 +195,13 @@
         oldcwd = None
 
     flags = d.getVarFlags(func)
-    cleandirs = flags.get('cleandirs')
+    cleandirs = flags.get('cleandirs') if flags else None
     if cleandirs:
         for cdir in d.expand(cleandirs).split():
             bb.utils.remove(cdir, True)
             bb.utils.mkdirhier(cdir)
 
-    if dirs is None:
+    if flags and dirs is None:
         dirs = flags.get('dirs')
         if dirs:
             dirs = d.expand(dirs).split()
@@ -227,17 +227,17 @@
     else:
         lockfiles = None
 
-    tempdir = d.getVar('T', True)
+    tempdir = d.getVar('T')
 
     # or func allows items to be executed outside of the normal
     # task set, such as buildhistory
-    task = d.getVar('BB_RUNTASK', True) or func
+    task = d.getVar('BB_RUNTASK') or func
     if task == func:
         taskfunc = task
     else:
         taskfunc = "%s.%s" % (task, func)
 
-    runfmt = d.getVar('BB_RUNFMT', True) or "run.{func}.{pid}"
+    runfmt = d.getVar('BB_RUNFMT') or "run.{func}.{pid}"
     runfn = runfmt.format(taskfunc=taskfunc, task=task, func=func, pid=os.getpid())
     runfile = os.path.join(tempdir, runfn)
     bb.utils.mkdirhier(os.path.dirname(runfile))
@@ -369,7 +369,7 @@
 
     cmd = runfile
     if d.getVarFlag(func, 'fakeroot', False):
-        fakerootcmd = d.getVar('FAKEROOT', True)
+        fakerootcmd = d.getVar('FAKEROOT')
         if fakerootcmd:
             cmd = [fakerootcmd, runfile]
 
@@ -378,7 +378,7 @@
     else:
         logfile = sys.stdout
 
-    progress = d.getVarFlag(func, 'progress', True)
+    progress = d.getVarFlag(func, 'progress')
     if progress:
         if progress == 'percent':
             # Use default regex
@@ -430,7 +430,7 @@
             else:
                 break
 
-    tempdir = d.getVar('T', True)
+    tempdir = d.getVar('T')
     fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid())
     if os.path.exists(fifopath):
         os.unlink(fifopath)
@@ -443,7 +443,7 @@
                 with open(os.devnull, 'r+') as stdin:
                     bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
             except bb.process.CmdError:
-                logfn = d.getVar('BB_LOGFILE', True)
+                logfn = d.getVar('BB_LOGFILE')
                 raise FuncFailed(func, logfn)
         finally:
             os.unlink(fifopath)
@@ -474,18 +474,18 @@
     logger.debug(1, "Executing task %s", task)
 
     localdata = _task_data(fn, task, d)
-    tempdir = localdata.getVar('T', True)
+    tempdir = localdata.getVar('T')
     if not tempdir:
         bb.fatal("T variable not set, unable to build")
 
     # Change nice level if we're asked to
-    nice = localdata.getVar("BB_TASK_NICE_LEVEL", True)
+    nice = localdata.getVar("BB_TASK_NICE_LEVEL")
     if nice:
         curnice = os.nice(0)
         nice = int(nice) - curnice
         newnice = os.nice(nice)
         logger.debug(1, "Renice to %s " % newnice)
-    ionice = localdata.getVar("BB_TASK_IONICE_LEVEL", True)
+    ionice = localdata.getVar("BB_TASK_IONICE_LEVEL")
     if ionice:
         try:
             cls, prio = ionice.split(".", 1)
@@ -496,7 +496,7 @@
     bb.utils.mkdirhier(tempdir)
 
     # Determine the logfile to generate
-    logfmt = localdata.getVar('BB_LOGFMT', True) or 'log.{task}.{pid}'
+    logfmt = localdata.getVar('BB_LOGFMT') or 'log.{task}.{pid}'
     logbase = logfmt.format(task=task, pid=os.getpid())
 
     # Document the order of the tasks...
@@ -563,6 +563,7 @@
 
     localdata.setVar('BB_LOGFILE', logfn)
     localdata.setVar('BB_RUNTASK', task)
+    localdata.setVar('BB_TASK_LOGGER', bblogger)
 
     flags = localdata.getVarFlags(task)
 
@@ -628,7 +629,7 @@
             quieterr = True
 
         if profile:
-            profname = "profile-%s.log" % (d.getVar("PN", True) + "-" + task)
+            profname = "profile-%s.log" % (d.getVar("PN") + "-" + task)
             try:
                 import cProfile as profile
             except:
@@ -668,9 +669,9 @@
         stamp = d.stamp[file_name]
         extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or ""
     else:
-        stamp = d.getVar('STAMP', True)
-        file_name = d.getVar('BB_FILENAME', True)
-        extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or ""
+        stamp = d.getVar('STAMP')
+        file_name = d.getVar('BB_FILENAME')
+        extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info') or ""
 
     if baseonly:
         return stamp
@@ -704,9 +705,9 @@
         stamp = d.stampclean[file_name]
         extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or ""
     else:
-        stamp = d.getVar('STAMPCLEAN', True)
-        file_name = d.getVar('BB_FILENAME', True)
-        extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or ""
+        stamp = d.getVar('STAMPCLEAN')
+        file_name = d.getVar('BB_FILENAME')
+        extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info') or ""
 
     if not stamp:
         return []
@@ -742,7 +743,7 @@
     # as it completes
     if not task.endswith("_setscene") and task != "do_setscene" and not file_name:
         stampbase = stamp_internal(task, d, None, True)
-        file_name = d.getVar('BB_FILENAME', True)
+        file_name = d.getVar('BB_FILENAME')
         bb.parse.siggen.dump_sigtask(file_name, task, stampbase, True)
 
 def del_stamp(task, d, file_name = None):
@@ -764,7 +765,7 @@
     if file_name:
         taintfn = d.stamp[file_name] + '.' + task + '.taint'
     else:
-        taintfn = d.getVar('STAMP', True) + '.' + task + '.taint'
+        taintfn = d.getVar('STAMP') + '.' + task + '.taint'
     bb.utils.mkdirhier(os.path.dirname(taintfn))
     # The specific content of the taint file is not really important,
     # we just need it to be random, so a random UUID is used
@@ -861,3 +862,46 @@
         if task in deps:
             deps.remove(task)
             d.setVarFlag(bbtask, 'deps', deps)
+
+def preceedtask(task, with_recrdeptasks, d):
+    """
+    Returns a set of tasks in the current recipe which were specified as
+    precondition by the task itself ("after") or which listed themselves
+    as precondition ("before"). Preceeding tasks specified via the
+    "recrdeptask" are included in the result only if requested. Beware
+    that this may lead to the task itself being listed.
+    """
+    preceed = set()
+    preceed.update(d.getVarFlag(task, 'deps') or [])
+    if with_recrdeptasks:
+        recrdeptask = d.getVarFlag(task, 'recrdeptask')
+        if recrdeptask:
+            preceed.update(recrdeptask.split())
+    return preceed
+
+def tasksbetween(task_start, task_end, d):
+    """
+    Return the list of tasks between two tasks in the current recipe,
+    where task_start is to start at and task_end is the task to end at
+    (and task_end has a dependency chain back to task_start).
+    """
+    outtasks = []
+    tasks = list(filter(lambda k: d.getVarFlag(k, "task"), d.keys()))
+    def follow_chain(task, endtask, chain=None):
+        if not chain:
+            chain = []
+        chain.append(task)
+        for othertask in tasks:
+            if othertask == task:
+                continue
+            if task == endtask:
+                for ctask in chain:
+                    if ctask not in outtasks:
+                        outtasks.append(ctask)
+            else:
+                deps = d.getVarFlag(othertask, 'deps', False)
+                if task in deps:
+                    follow_chain(othertask, endtask, chain)
+        chain.pop()
+    follow_chain(task_start, task_end)
+    return outtasks
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/cache.py b/import-layers/yocto-poky/bitbake/lib/bb/cache.py
index dd9cfdf..e7eeb4f 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/cache.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/cache.py
@@ -37,7 +37,7 @@
 
 logger = logging.getLogger("BitBake.Cache")
 
-__cache_version__ = "150"
+__cache_version__ = "151"
 
 def getCacheFile(path, filename, data_hash):
     return os.path.join(path, filename + "." + data_hash)
@@ -71,7 +71,7 @@
 
     @classmethod
     def flaglist(cls, flag, varlist, metadata, squash=False):
-        out_dict = dict((var, metadata.getVarFlag(var, flag, True))
+        out_dict = dict((var, metadata.getVarFlag(var, flag))
                     for var in varlist)
         if squash:
             return dict((k,v) for (k,v) in out_dict.items() if v)
@@ -296,7 +296,7 @@
     bb_data.setVar("__BBMULTICONFIG", mc)
 
     # expand tmpdir to include this topdir
-    bb_data.setVar('TMPDIR', bb_data.getVar('TMPDIR', True) or "")
+    bb_data.setVar('TMPDIR', bb_data.getVar('TMPDIR') or "")
     bbfile_loc = os.path.abspath(os.path.dirname(bbfile))
     oldpath = os.path.abspath(os.getcwd())
     bb.parse.cached_mtime_noerror(bbfile_loc)
@@ -378,7 +378,7 @@
         # It will be used later for deciding whether we 
         # need extra cache file dump/load support 
         self.caches_array = caches_array
-        self.cachedir = data.getVar("CACHE", True)
+        self.cachedir = data.getVar("CACHE")
         self.clean = set()
         self.checked = set()
         self.depends_cache = {}
@@ -462,6 +462,10 @@
                         self.depends_cache[key] = [value]
                     # only fire events on even percentage boundaries
                     current_progress = cachefile.tell() + previous_progress
+                    if current_progress > cachesize:
+                        # we might have calculated incorrect total size because a file
+                        # might've been written out just after we checked its size
+                        cachesize = current_progress
                     current_percent = 100 * current_progress / cachesize
                     if current_percent > previous_percent:
                         previous_percent = current_percent
@@ -792,8 +796,8 @@
         self.cachedata_extras = self.create_cachedata()
 
     def init_cache(self, d, cache_file_name=None):
-        cachedir = (d.getVar("PERSISTENT_DIR", True) or
-                    d.getVar("CACHE", True))
+        cachedir = (d.getVar("PERSISTENT_DIR") or
+                    d.getVar("CACHE"))
         if cachedir in [None, '']:
             return
         bb.utils.mkdirhier(cachedir)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/codeparser.py b/import-layers/yocto-poky/bitbake/lib/bb/codeparser.py
index 5d2d440..530f44e 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/codeparser.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/codeparser.py
@@ -1,3 +1,22 @@
+"""
+BitBake code parser
+
+Parses actual code (i.e. python and shell) for functions and in-line
+expressions. Used mainly to determine dependencies on other functions
+and variables within the BitBake metadata. Also provides a cache for
+this information in order to speed up processing.
+
+(Not to be confused with the code that parses the metadata itself,
+see lib/bb/parse/ for that).
+
+NOTE: if you change how the parsers gather information you will almost
+certainly need to increment CodeParserCache.CACHE_VERSION below so that
+any existing codeparser cache gets invalidated. Additionally you'll need
+to increment __cache_version__ in cache.py in order to ensure that old
+recipe caches don't trigger "Taskhash mismatch" errors.
+
+"""
+
 import ast
 import sys
 import codegen
@@ -117,7 +136,11 @@
 
 class CodeParserCache(MultiProcessCache):
     cache_file_name = "bb_codeparser.dat"
-    CACHE_VERSION = 8
+    # NOTE: you must increment this if you change how the parsers gather information,
+    # so that an existing cache gets invalidated. Additionally you'll need
+    # to increment __cache_version__ in cache.py in order to ensure that old
+    # recipe caches don't trigger "Taskhash mismatch" errors.
+    CACHE_VERSION = 9
 
     def __init__(self):
         MultiProcessCache.__init__(self)
@@ -186,13 +209,15 @@
 
     def flush(self):
         for record in self.buffer:
-            self.target.handle(record)
+            if self.target.isEnabledFor(record.levelno):
+                self.target.handle(record)
         self.buffer = []
 
 class PythonParser():
     getvars = (".getVar", ".appendVar", ".prependVar")
     getvarflags = (".getVarFlag", ".appendVarFlag", ".prependVarFlag")
-    containsfuncs = ("bb.utils.contains", "base_contains", "bb.utils.contains_any")
+    containsfuncs = ("bb.utils.contains", "base_contains")
+    containsanyfuncs = ("bb.utils.contains_any",  "bb.utils.filter")
     execfuncs = ("bb.build.exec_func", "bb.build.exec_task")
 
     def warn(self, func, arg):
@@ -211,13 +236,17 @@
 
     def visit_Call(self, node):
         name = self.called_node_name(node.func)
-        if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs):
+        if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs or name in self.containsanyfuncs):
             if isinstance(node.args[0], ast.Str):
                 varname = node.args[0].s
                 if name in self.containsfuncs and isinstance(node.args[1], ast.Str):
                     if varname not in self.contains:
                         self.contains[varname] = set()
                     self.contains[varname].add(node.args[1].s)
+                elif name in self.containsanyfuncs and isinstance(node.args[1], ast.Str):
+                    if varname not in self.contains:
+                        self.contains[varname] = set()
+                    self.contains[varname].update(node.args[1].s.split())
                 elif name.endswith(self.getvarflags):
                     if isinstance(node.args[1], ast.Str):
                         self.references.add('%s[%s]' % (varname, node.args[1].s))
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/command.py b/import-layers/yocto-poky/bitbake/lib/bb/command.py
index caa3e4d..a919f58 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/command.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/command.py
@@ -28,8 +28,15 @@
 Commands are queued in a CommandQueue
 """
 
+from collections import OrderedDict, defaultdict
+
 import bb.event
 import bb.cooker
+import bb.remotedata
+
+class DataStoreConnectionHandle(object):
+    def __init__(self, dsindex=0):
+        self.dsindex = dsindex
 
 class CommandCompleted(bb.event.Event):
     pass
@@ -55,6 +62,7 @@
         self.cooker = cooker
         self.cmds_sync = CommandsSync()
         self.cmds_async = CommandsAsync()
+        self.remotedatastores = bb.remotedata.RemoteDatastores(cooker)
 
         # FIXME Add lock for this
         self.currentAsyncCommand = None
@@ -125,14 +133,20 @@
 
     def finishAsyncCommand(self, msg=None, code=None):
         if msg or msg == "":
-            bb.event.fire(CommandFailed(msg), self.cooker.expanded_data)
+            bb.event.fire(CommandFailed(msg), self.cooker.data)
         elif code:
-            bb.event.fire(CommandExit(code), self.cooker.expanded_data)
+            bb.event.fire(CommandExit(code), self.cooker.data)
         else:
-            bb.event.fire(CommandCompleted(), self.cooker.expanded_data)
+            bb.event.fire(CommandCompleted(), self.cooker.data)
         self.currentAsyncCommand = None
         self.cooker.finishcommand()
 
+def split_mc_pn(pn):
+    if pn.startswith("multiconfig:"):
+        _, mc, pn = pn.split(":", 2)
+        return (mc, pn)
+    return ('', pn)
+
 class CommandsSync:
     """
     A class of synchronous commands
@@ -179,6 +193,7 @@
         """
         varname = params[0]
         value = str(params[1])
+        command.cooker.extraconfigdata[varname] = value
         command.cooker.data.setVar(varname, value)
 
     def getSetVariable(self, command, params):
@@ -295,9 +310,274 @@
     def updateConfig(self, command, params):
         options = params[0]
         environment = params[1]
-        command.cooker.updateConfigOpts(options, environment)
+        cmdline = params[2]
+        command.cooker.updateConfigOpts(options, environment, cmdline)
     updateConfig.needconfig = False
 
+    def parseConfiguration(self, command, params):
+        """Instruct bitbake to parse its configuration
+        NOTE: it is only necessary to call this if you aren't calling any normal action
+        (otherwise parsing is taken care of automatically)
+        """
+        command.cooker.parseConfiguration()
+    parseConfiguration.needconfig = False
+
+    def getLayerPriorities(self, command, params):
+        ret = []
+        # regex objects cannot be marshalled by xmlrpc
+        for collection, pattern, regex, pri in command.cooker.bbfile_config_priorities:
+            ret.append((collection, pattern, regex.pattern, pri))
+        return ret
+    getLayerPriorities.readonly = True
+
+    def getRecipes(self, command, params):
+        try:
+            mc = params[0]
+        except IndexError:
+            mc = ''
+        return list(command.cooker.recipecaches[mc].pkg_pn.items())
+    getRecipes.readonly = True
+
+    def getRecipeDepends(self, command, params):
+        try:
+            mc = params[0]
+        except IndexError:
+            mc = ''
+        return list(command.cooker.recipecaches[mc].deps.items())
+    getRecipeDepends.readonly = True
+
+    def getRecipeVersions(self, command, params):
+        try:
+            mc = params[0]
+        except IndexError:
+            mc = ''
+        return command.cooker.recipecaches[mc].pkg_pepvpr
+    getRecipeVersions.readonly = True
+
+    def getRuntimeDepends(self, command, params):
+        ret = []
+        try:
+            mc = params[0]
+        except IndexError:
+            mc = ''
+        rundeps = command.cooker.recipecaches[mc].rundeps
+        for key, value in rundeps.items():
+            if isinstance(value, defaultdict):
+                value = dict(value)
+            ret.append((key, value))
+        return ret
+    getRuntimeDepends.readonly = True
+
+    def getRuntimeRecommends(self, command, params):
+        ret = []
+        try:
+            mc = params[0]
+        except IndexError:
+            mc = ''
+        runrecs = command.cooker.recipecaches[mc].runrecs
+        for key, value in runrecs.items():
+            if isinstance(value, defaultdict):
+                value = dict(value)
+            ret.append((key, value))
+        return ret
+    getRuntimeRecommends.readonly = True
+
+    def getRecipeInherits(self, command, params):
+        try:
+            mc = params[0]
+        except IndexError:
+            mc = ''
+        return command.cooker.recipecaches[mc].inherits
+    getRecipeInherits.readonly = True
+
+    def getBbFilePriority(self, command, params):
+        try:
+            mc = params[0]
+        except IndexError:
+            mc = ''
+        return command.cooker.recipecaches[mc].bbfile_priority
+    getBbFilePriority.readonly = True
+
+    def getDefaultPreference(self, command, params):
+        try:
+            mc = params[0]
+        except IndexError:
+            mc = ''
+        return command.cooker.recipecaches[mc].pkg_dp
+    getDefaultPreference.readonly = True
+
+    def getSkippedRecipes(self, command, params):
+        # Return list sorted by reverse priority order
+        import bb.cache
+        skipdict = OrderedDict(sorted(command.cooker.skiplist.items(),
+                                      key=lambda x: (-command.cooker.collection.calc_bbfile_priority(bb.cache.virtualfn2realfn(x[0])[0]), x[0])))
+        return list(skipdict.items())
+    getSkippedRecipes.readonly = True
+
+    def getOverlayedRecipes(self, command, params):
+        return list(command.cooker.collection.overlayed.items())
+    getOverlayedRecipes.readonly = True
+
+    def getFileAppends(self, command, params):
+        fn = params[0]
+        return command.cooker.collection.get_file_appends(fn)
+    getFileAppends.readonly = True
+
+    def getAllAppends(self, command, params):
+        return command.cooker.collection.bbappends
+    getAllAppends.readonly = True
+
+    def findProviders(self, command, params):
+        return command.cooker.findProviders()
+    findProviders.readonly = True
+
+    def findBestProvider(self, command, params):
+        (mc, pn) = split_mc_pn(params[0])
+        return command.cooker.findBestProvider(pn, mc)
+    findBestProvider.readonly = True
+
+    def allProviders(self, command, params):
+        try:
+            mc = params[0]
+        except IndexError:
+            mc = ''
+        return list(bb.providers.allProviders(command.cooker.recipecaches[mc]).items())
+    allProviders.readonly = True
+
+    def getRuntimeProviders(self, command, params):
+        rprovide = params[0]
+        try:
+            mc = params[1]
+        except IndexError:
+            mc = ''
+        all_p = bb.providers.getRuntimeProviders(command.cooker.recipecaches[mc], rprovide)
+        if all_p:
+            best = bb.providers.filterProvidersRunTime(all_p, rprovide,
+                            command.cooker.data,
+                            command.cooker.recipecaches[mc])[0][0]
+        else:
+            best = None
+        return all_p, best
+    getRuntimeProviders.readonly = True
+
+    def dataStoreConnectorFindVar(self, command, params):
+        dsindex = params[0]
+        name = params[1]
+        datastore = command.remotedatastores[dsindex]
+        value, overridedata = datastore._findVar(name)
+
+        if value:
+            content = value.get('_content', None)
+            if isinstance(content, bb.data_smart.DataSmart):
+                # Value is a datastore (e.g. BB_ORIGENV) - need to handle this carefully
+                idx = command.remotedatastores.check_store(content, True)
+                return {'_content': DataStoreConnectionHandle(idx),
+                        '_connector_origtype': 'DataStoreConnectionHandle',
+                        '_connector_overrides': overridedata}
+            elif isinstance(content, set):
+                return {'_content': list(content),
+                        '_connector_origtype': 'set',
+                        '_connector_overrides': overridedata}
+            else:
+                value['_connector_overrides'] = overridedata
+        else:
+            value = {}
+            value['_connector_overrides'] = overridedata
+        return value
+    dataStoreConnectorFindVar.readonly = True
+
+    def dataStoreConnectorGetKeys(self, command, params):
+        dsindex = params[0]
+        datastore = command.remotedatastores[dsindex]
+        return list(datastore.keys())
+    dataStoreConnectorGetKeys.readonly = True
+
+    def dataStoreConnectorGetVarHistory(self, command, params):
+        dsindex = params[0]
+        name = params[1]
+        datastore = command.remotedatastores[dsindex]
+        return datastore.varhistory.variable(name)
+    dataStoreConnectorGetVarHistory.readonly = True
+
+    def dataStoreConnectorExpandPythonRef(self, command, params):
+        config_data_dict = params[0]
+        varname = params[1]
+        expr = params[2]
+
+        config_data = command.remotedatastores.receive_datastore(config_data_dict)
+
+        varparse = bb.data_smart.VariableParse(varname, config_data)
+        return varparse.python_sub(expr)
+
+    def dataStoreConnectorRelease(self, command, params):
+        dsindex = params[0]
+        if dsindex <= 0:
+            raise CommandError('dataStoreConnectorRelease: invalid index %d' % dsindex)
+        command.remotedatastores.release(dsindex)
+
+    def dataStoreConnectorSetVarFlag(self, command, params):
+        dsindex = params[0]
+        name = params[1]
+        flag = params[2]
+        value = params[3]
+        datastore = command.remotedatastores[dsindex]
+        datastore.setVarFlag(name, flag, value)
+
+    def dataStoreConnectorDelVar(self, command, params):
+        dsindex = params[0]
+        name = params[1]
+        datastore = command.remotedatastores[dsindex]
+        if len(params) > 2:
+            flag = params[2]
+            datastore.delVarFlag(name, flag)
+        else:
+            datastore.delVar(name)
+
+    def dataStoreConnectorRenameVar(self, command, params):
+        dsindex = params[0]
+        name = params[1]
+        newname = params[2]
+        datastore = command.remotedatastores[dsindex]
+        datastore.renameVar(name, newname)
+
+    def parseRecipeFile(self, command, params):
+        """
+        Parse the specified recipe file (with or without bbappends)
+        and return a datastore object representing the environment
+        for the recipe.
+        """
+        fn = params[0]
+        appends = params[1]
+        appendlist = params[2]
+        if len(params) > 3:
+            config_data_dict = params[3]
+            config_data = command.remotedatastores.receive_datastore(config_data_dict)
+        else:
+            config_data = None
+
+        if appends:
+            if appendlist is not None:
+                appendfiles = appendlist
+            else:
+                appendfiles = command.cooker.collection.get_file_appends(fn)
+        else:
+            appendfiles = []
+        # We are calling bb.cache locally here rather than on the server,
+        # but that's OK because it doesn't actually need anything from
+        # the server barring the global datastore (which we have a remote
+        # version of)
+        if config_data:
+            # We have to use a different function here if we're passing in a datastore
+            # NOTE: we took a copy above, so we don't do it here again
+            envdata = bb.cache.parse_recipe(config_data, fn, appendfiles)['']
+        else:
+            # Use the standard path
+            parser = bb.cache.NoCache(command.cooker.databuilder)
+            envdata = parser.loadDataFull(fn, appendfiles)
+        idx = command.remotedatastores.store(envdata)
+        return DataStoreConnectionHandle(idx)
+    parseRecipeFile.readonly = True
+
 class CommandsAsync:
     """
     A class of asynchronous commands
@@ -311,8 +591,12 @@
         """
         bfile = params[0]
         task = params[1]
+        if len(params) > 2:
+            hidewarning = params[2]
+        else:
+            hidewarning = False
 
-        command.cooker.buildFile(bfile, task)
+        command.cooker.buildFile(bfile, task, hidewarning)
     buildFile.needcache = False
 
     def buildTargets(self, command, params):
@@ -472,3 +756,11 @@
         command.finishAsyncCommand()
     resetCooker.needcache = False
 
+    def clientComplete(self, command, params):
+        """
+        Do the right thing when the controlling client exits
+        """
+        command.cooker.clientComplete()
+        command.finishAsyncCommand()
+    clientComplete.needcache = False
+
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/cooker.py b/import-layers/yocto-poky/bitbake/lib/bb/cooker.py
index 07897be..3c9e88c 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/cooker.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/cooker.py
@@ -192,6 +192,8 @@
         bb.parse.__mtime_cache = {}
         bb.parse.BBHandler.cached_statements = {}
 
+        self.ui_cmdline = None
+
         self.initConfigurationData()
 
         # we log all events to a file if so directed
@@ -271,12 +273,15 @@
             self.inotify_modified_files.append(event.pathname)
         self.parsecache_valid = False
 
-    def add_filewatch(self, deps, watcher=None):
+    def add_filewatch(self, deps, watcher=None, dirs=False):
         if not watcher:
             watcher = self.watcher
         for i in deps:
             watcher.bbwatchedfiles.append(i[0])
-            f = os.path.dirname(i[0])
+            if dirs:
+                f = i[0]
+            else:
+                f = os.path.dirname(i[0])
             if f in watcher.bbseen:
                 continue
             watcher.bbseen.append(f)
@@ -331,7 +336,7 @@
         # Need to preserve BB_CONSOLELOG over resets
         consolelog = None
         if hasattr(self, "data"):
-            consolelog = self.data.getVar("BB_CONSOLELOG", True)
+            consolelog = self.data.getVar("BB_CONSOLELOG")
 
         if CookerFeatures.BASEDATASTORE_TRACKING in self.featureset:
             self.enableDataTracking()
@@ -358,17 +363,18 @@
         self.databuilder.parseBaseConfiguration()
         self.data = self.databuilder.data
         self.data_hash = self.databuilder.data_hash
+        self.extraconfigdata = {}
 
         if consolelog:
             self.data.setVar("BB_CONSOLELOG", consolelog)
 
+        self.data.setVar('BB_CMDLINE', self.ui_cmdline)
+
         #
         # Copy of the data store which has been expanded.
         # Used for firing events and accessing variables where expansion needs to be accounted for
         #
-        self.expanded_data = bb.data.createCopy(self.data)
-        bb.data.update_data(self.expanded_data)
-        bb.parse.init_parser(self.expanded_data)
+        bb.parse.init_parser(self.data)
 
         if CookerFeatures.BASEDATASTORE_TRACKING in self.featureset:
             self.disableDataTracking()
@@ -526,7 +532,7 @@
             bb.msg.loggerVerboseLogs = True
 
         # Change nice level if we're asked to
-        nice = self.data.getVar("BB_NICE_LEVEL", True)
+        nice = self.data.getVar("BB_NICE_LEVEL")
         if nice:
             curnice = os.nice(0)
             nice = int(nice) - curnice
@@ -539,9 +545,10 @@
         for mc in self.multiconfigs:
             self.recipecaches[mc] = bb.cache.CacheData(self.caches_array)
 
-        self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS", True))
+        self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS"))
 
-    def updateConfigOpts(self, options, environment):
+    def updateConfigOpts(self, options, environment, cmdline):
+        self.ui_cmdline = cmdline
         clean = True
         for o in options:
             if o in ['prefile', 'postfile']:
@@ -583,13 +590,12 @@
 
     def showVersions(self):
 
-        pkg_pn = self.recipecaches[''].pkg_pn
-        (latest_versions, preferred_versions) = bb.providers.findProviders(self.data, self.recipecaches[''], pkg_pn)
+        (latest_versions, preferred_versions) = self.findProviders()
 
         logger.plain("%-35s %25s %25s", "Recipe Name", "Latest Version", "Preferred Version")
         logger.plain("%-35s %25s %25s\n", "===========", "==============", "=================")
 
-        for p in sorted(pkg_pn):
+        for p in sorted(self.recipecaches[''].pkg_pn):
             pref = preferred_versions[p]
             latest = latest_versions[p]
 
@@ -619,7 +625,7 @@
             fn = self.matchFile(fn)
             fn = bb.cache.realfn2virtual(fn, cls, mc)
         elif len(pkgs_to_build) == 1:
-            ignore = self.expanded_data.getVar("ASSUME_PROVIDED", True) or ""
+            ignore = self.data.getVar("ASSUME_PROVIDED") or ""
             if pkgs_to_build[0] in set(ignore.split()):
                 bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0])
 
@@ -644,14 +650,13 @@
             logger.plain(env.getvalue())
 
         # emit variables and shell functions
-        data.update_data(envdata)
         with closing(StringIO()) as env:
             data.emit_env(env, envdata, True)
             logger.plain(env.getvalue())
 
         # emit the metadata which isnt valid shell
         data.expandKeys(envdata)
-        for e in envdata.keys():
+        for e in sorted(envdata.keys()):
             if envdata.getVarFlag(e, 'func', False) and envdata.getVarFlag(e, 'python', False):
                 logger.plain("\npython %s () {\n%s}\n", e, envdata.getVar(e, False))
 
@@ -705,7 +710,6 @@
         for mc in self.multiconfigs:
             taskdata[mc] = bb.taskdata.TaskData(abort, skiplist=self.skiplist, allowincomplete=allowincomplete)
             localdata[mc] = data.createCopy(self.databuilder.mcdata[mc])
-            bb.data.update_data(localdata[mc])
             bb.data.expandKeys(localdata[mc])
 
         current = 0
@@ -766,7 +770,7 @@
     @staticmethod
     def add_mc_prefix(mc, pn):
         if mc:
-            return "multiconfig:%s.%s" % (mc, pn)
+            return "multiconfig:%s:%s" % (mc, pn)
         return pn
 
     def buildDependTree(self, rq, taskdata):
@@ -951,62 +955,54 @@
 
         depgraph = self.generateTaskDepTreeData(pkgs_to_build, task)
 
-        # Prints a flattened form of package-depends below where subpackages of a package are merged into the main pn
-        depends_file = open('pn-depends.dot', 'w' )
-        buildlist_file = open('pn-buildlist', 'w' )
-        print("digraph depends {", file=depends_file)
-        for pn in depgraph["pn"]:
-            fn = depgraph["pn"][pn]["filename"]
-            version = depgraph["pn"][pn]["version"]
-            print('"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn), file=depends_file)
-            print("%s" % pn, file=buildlist_file)
-        buildlist_file.close()
+        with open('pn-buildlist', 'w') as f:
+            for pn in depgraph["pn"]:
+                f.write(pn + "\n")
         logger.info("PN build list saved to 'pn-buildlist'")
-        for pn in depgraph["depends"]:
-            for depend in depgraph["depends"][pn]:
-                print('"%s" -> "%s" [style=solid]' % (pn, depend), file=depends_file)
-        for pn in depgraph["rdepends-pn"]:
-            for rdepend in depgraph["rdepends-pn"][pn]:
-                print('"%s" -> "%s" [style=dashed]' % (pn, rdepend), file=depends_file)
-        print("}", file=depends_file)
-        depends_file.close()
-        logger.info("PN dependencies saved to 'pn-depends.dot'")
 
-        depends_file = open('package-depends.dot', 'w' )
-        print("digraph depends {", file=depends_file)
-        for package in depgraph["packages"]:
-            pn = depgraph["packages"][package]["pn"]
-            fn = depgraph["packages"][package]["filename"]
-            version = depgraph["packages"][package]["version"]
-            if package == pn:
-                print('"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn), file=depends_file)
-            else:
-                print('"%s" [label="%s(%s) %s\\n%s"]' % (package, package, pn, version, fn), file=depends_file)
-            for depend in depgraph["depends"][pn]:
-                print('"%s" -> "%s" [style=solid]' % (package, depend), file=depends_file)
-        for package in depgraph["rdepends-pkg"]:
-            for rdepend in depgraph["rdepends-pkg"][package]:
-                print('"%s" -> "%s" [style=dashed]' % (package, rdepend), file=depends_file)
-        for package in depgraph["rrecs-pkg"]:
-            for rdepend in depgraph["rrecs-pkg"][package]:
-                print('"%s" -> "%s" [style=dotted]' % (package, rdepend), file=depends_file)
-        print("}", file=depends_file)
-        depends_file.close()
-        logger.info("Package dependencies saved to 'package-depends.dot'")
+        # Remove old format output files to ensure no confusion with stale data
+        try:
+            os.unlink('pn-depends.dot')
+        except FileNotFoundError:
+            pass
+        try:
+            os.unlink('package-depends.dot')
+        except FileNotFoundError:
+            pass
 
-        tdepends_file = open('task-depends.dot', 'w' )
-        print("digraph depends {", file=tdepends_file)
-        for task in depgraph["tdepends"]:
-            (pn, taskname) = task.rsplit(".", 1)
-            fn = depgraph["pn"][pn]["filename"]
-            version = depgraph["pn"][pn]["version"]
-            print('"%s.%s" [label="%s %s\\n%s\\n%s"]' % (pn, taskname, pn, taskname, version, fn), file=tdepends_file)
-            for dep in depgraph["tdepends"][task]:
-                print('"%s" -> "%s"' % (task, dep), file=tdepends_file)
-        print("}", file=tdepends_file)
-        tdepends_file.close()
+        with open('task-depends.dot', 'w') as f:
+            f.write("digraph depends {\n")
+            for task in depgraph["tdepends"]:
+                (pn, taskname) = task.rsplit(".", 1)
+                fn = depgraph["pn"][pn]["filename"]
+                version = depgraph["pn"][pn]["version"]
+                f.write('"%s.%s" [label="%s %s\\n%s\\n%s"]\n' % (pn, taskname, pn, taskname, version, fn))
+                for dep in depgraph["tdepends"][task]:
+                    f.write('"%s" -> "%s"\n' % (task, dep))
+            f.write("}\n")
         logger.info("Task dependencies saved to 'task-depends.dot'")
 
+        with open('recipe-depends.dot', 'w') as f:
+            f.write("digraph depends {\n")
+            pndeps = {}
+            for task in depgraph["tdepends"]:
+                (pn, taskname) = task.rsplit(".", 1)
+                if pn not in pndeps:
+                    pndeps[pn] = set()
+                for dep in depgraph["tdepends"][task]:
+                    (deppn, deptaskname) = dep.rsplit(".", 1)
+                    pndeps[pn].add(deppn)
+            for pn in pndeps:
+                fn = depgraph["pn"][pn]["filename"]
+                version = depgraph["pn"][pn]["version"]
+                f.write('"%s" [label="%s\\n%s\\n%s"]\n' % (pn, pn, version, fn))
+                for dep in pndeps[pn]:
+                    if dep == pn:
+                        continue
+                    f.write('"%s" -> "%s"\n' % (pn, dep))
+            f.write("}\n")
+        logger.info("Flatened recipe dependencies saved to 'recipe-depends.dot'")
+
     def show_appends_with_no_recipes(self):
         # Determine which bbappends haven't been applied
 
@@ -1037,11 +1033,10 @@
 
         for mc in self.multiconfigs:
             localdata = data.createCopy(self.databuilder.mcdata[mc])
-            bb.data.update_data(localdata)
             bb.data.expandKeys(localdata)
 
             # Handle PREFERRED_PROVIDERS
-            for p in (localdata.getVar('PREFERRED_PROVIDERS', True) or "").split():
+            for p in (localdata.getVar('PREFERRED_PROVIDERS') or "").split():
                 try:
                     (providee, provider) = p.split(':')
                 except:
@@ -1052,7 +1047,7 @@
                 self.recipecaches[mc].preferred[providee] = provider
 
     def findCoreBaseFiles(self, subdir, configfile):
-        corebase = self.data.getVar('COREBASE', True) or ""
+        corebase = self.data.getVar('COREBASE') or ""
         paths = []
         for root, dirs, files in os.walk(corebase + '/' + subdir):
             for d in dirs:
@@ -1102,7 +1097,7 @@
         """
 
         matches = []
-        bbpaths = self.data.getVar('BBPATH', True).split(':')
+        bbpaths = self.data.getVar('BBPATH').split(':')
         for path in bbpaths:
             dirpath = os.path.join(path, directory)
             if os.path.exists(dirpath):
@@ -1114,6 +1109,20 @@
         if matches:
             bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.data)
 
+    def findProviders(self, mc=''):
+        return bb.providers.findProviders(self.data, self.recipecaches[mc], self.recipecaches[mc].pkg_pn)
+
+    def findBestProvider(self, pn, mc=''):
+        if pn in self.recipecaches[mc].providers:
+            filenames = self.recipecaches[mc].providers[pn]
+            eligible, foundUnique = bb.providers.filterProviders(filenames, pn, self.data, self.recipecaches[mc])
+            filename = eligible[0]
+            return None, None, None, filename
+        elif pn in self.recipecaches[mc].pkg_pn:
+            return bb.providers.findBestProvider(pn, self.data, self.recipecaches[mc], self.recipecaches[mc].pkg_pn)
+        else:
+            return None, None, None, None
+
     def findConfigFiles(self, varname):
         """
         Find config files which are appropriate values for varname.
@@ -1124,7 +1133,7 @@
 
         data = self.data
         # iterate configs
-        bbpaths = data.getVar('BBPATH', True).split(':')
+        bbpaths = data.getVar('BBPATH').split(':')
         for path in bbpaths:
             confpath = os.path.join(path, "conf", var)
             if os.path.exists(confpath):
@@ -1193,7 +1202,7 @@
                 bb.debug(1,'Processing %s in collection list' % (c))
 
                 # Get collection priority if defined explicitly
-                priority = self.data.getVar("BBFILE_PRIORITY_%s" % c, True)
+                priority = self.data.getVar("BBFILE_PRIORITY_%s" % c)
                 if priority:
                     try:
                         prio = int(priority)
@@ -1207,7 +1216,7 @@
                     collection_priorities[c] = None
 
                 # Check dependencies and store information for priority calculation
-                deps = self.data.getVar("LAYERDEPENDS_%s" % c, True)
+                deps = self.data.getVar("LAYERDEPENDS_%s" % c)
                 if deps:
                     try:
                         depDict = bb.utils.explode_dep_versions2(deps)
@@ -1216,7 +1225,7 @@
                     for dep, oplist in list(depDict.items()):
                         if dep in collection_list:
                             for opstr in oplist:
-                                layerver = self.data.getVar("LAYERVERSION_%s" % dep, True)
+                                layerver = self.data.getVar("LAYERVERSION_%s" % dep)
                                 (op, depver) = opstr.split()
                                 if layerver:
                                     try:
@@ -1237,7 +1246,7 @@
                     collection_depends[c] = []
 
                 # Check recommends and store information for priority calculation
-                recs = self.data.getVar("LAYERRECOMMENDS_%s" % c, True)
+                recs = self.data.getVar("LAYERRECOMMENDS_%s" % c)
                 if recs:
                     try:
                         recDict = bb.utils.explode_dep_versions2(recs)
@@ -1247,7 +1256,7 @@
                         if rec in collection_list:
                             if oplist:
                                 opstr = oplist[0]
-                                layerver = self.data.getVar("LAYERVERSION_%s" % rec, True)
+                                layerver = self.data.getVar("LAYERVERSION_%s" % rec)
                                 if layerver:
                                     (op, recver) = opstr.split()
                                     try:
@@ -1281,17 +1290,21 @@
             # Calculate all layer priorities using calc_layer_priority and store in bbfile_config_priorities
             for c in collection_list:
                 calc_layer_priority(c)
-                regex = self.data.getVar("BBFILE_PATTERN_%s" % c, True)
+                regex = self.data.getVar("BBFILE_PATTERN_%s" % c)
                 if regex == None:
                     parselog.error("BBFILE_PATTERN_%s not defined" % c)
                     errors = True
                     continue
-                try:
-                    cre = re.compile(regex)
-                except re.error:
-                    parselog.error("BBFILE_PATTERN_%s \"%s\" is not a valid regular expression", c, regex)
-                    errors = True
-                    continue
+                elif regex == "":
+                    parselog.debug(1, "BBFILE_PATTERN_%s is empty" % c)
+                    errors = False
+                else:
+                    try:
+                        cre = re.compile(regex)
+                    except re.error:
+                        parselog.error("BBFILE_PATTERN_%s \"%s\" is not a valid regular expression", c, regex)
+                        errors = True
+                        continue
                 self.bbfile_config_priorities.append((c, regex, cre, collection_priorities[c]))
         if errors:
             # We've already printed the actual error(s)
@@ -1316,7 +1329,7 @@
             bf = os.path.abspath(bf)
 
         self.collection = CookerCollectFiles(self.bbfile_config_priorities)
-        filelist, masked = self.collection.collect_bbfiles(self.data, self.expanded_data)
+        filelist, masked, searchdirs = self.collection.collect_bbfiles(self.data, self.data)
         try:
             os.stat(bf)
             bf = os.path.abspath(bf)
@@ -1347,15 +1360,16 @@
             raise NoSpecificMatch
         return matches[0]
 
-    def buildFile(self, buildfile, task):
+    def buildFile(self, buildfile, task, hidewarning=False):
         """
         Build the file matching regexp buildfile
         """
-        bb.event.fire(bb.event.BuildInit(), self.expanded_data)
+        bb.event.fire(bb.event.BuildInit(), self.data)
 
-        # Too many people use -b because they think it's how you normally
-        # specify a target to be built, so show a warning
-        bb.warn("Buildfile specified, dependencies will not be handled. If this is not what you want, do not use -b / --buildfile.")
+        if not hidewarning:
+            # Too many people use -b because they think it's how you normally
+            # specify a target to be built, so show a warning
+            bb.warn("Buildfile specified, dependencies will not be handled. If this is not what you want, do not use -b / --buildfile.")
 
         # Parse the configuration here. We need to do it explicitly here since
         # buildFile() doesn't use the cache
@@ -1392,6 +1406,7 @@
         item = info_array[0].pn
         self.recipecaches[mc].ignored_dependencies = set()
         self.recipecaches[mc].bbfile_priority[fn] = 1
+        self.configuration.limited_deps = True
 
         # Remove external dependencies
         self.recipecaches[mc].task_deps[fn]['depends'] = {}
@@ -1409,8 +1424,8 @@
         taskdata[mc] = bb.taskdata.TaskData(self.configuration.abort)
         taskdata[mc].add_provider(self.data, self.recipecaches[mc], item)
 
-        buildname = self.data.getVar("BUILDNAME", True)
-        bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.expanded_data)
+        buildname = self.data.getVar("BUILDNAME")
+        bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.data)
 
         # Execute the runqueue
         runlist = [[mc, item, task, fn]]
@@ -1440,7 +1455,7 @@
                 return False
 
             if not retval:
-                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, item, failures, interrupted), self.expanded_data)
+                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, item, failures, interrupted), self.data)
                 self.command.finishAsyncCommand(msg)
                 return False
             if retval is True:
@@ -1495,7 +1510,7 @@
 
         packages = [target if ':' in target else '%s:%s' % (target, task) for target in targets]
 
-        bb.event.fire(bb.event.BuildInit(packages), self.expanded_data)
+        bb.event.fire(bb.event.BuildInit(packages), self.data)
 
         taskdata, runlist = self.buildTaskData(targets, task, self.configuration.abort)
 
@@ -1528,7 +1543,7 @@
                 v = self.data.getVar(k, expand)
                 if not k.startswith("__") and not isinstance(v, bb.data_smart.DataSmart):
                     dump[k] = {
-    'v' : v ,
+    'v' : str(v) ,
     'history' : self.data.varhistory.variable(k),
                     }
                     for d in flaglist:
@@ -1627,14 +1642,18 @@
                     bb.event.fire(bb.event.SanityCheck(False), self.databuilder.mcdata[mc])
 
             for mc in self.multiconfigs:
-                ignore = self.databuilder.mcdata[mc].getVar("ASSUME_PROVIDED", True) or ""
+                ignore = self.databuilder.mcdata[mc].getVar("ASSUME_PROVIDED") or ""
                 self.recipecaches[mc].ignored_dependencies = set(ignore.split())
 
                 for dep in self.configuration.extra_assume_provided:
                     self.recipecaches[mc].ignored_dependencies.add(dep)
 
             self.collection = CookerCollectFiles(self.bbfile_config_priorities)
-            (filelist, masked) = self.collection.collect_bbfiles(self.data, self.expanded_data)
+            (filelist, masked, searchdirs) = self.collection.collect_bbfiles(self.data, self.data)
+
+            # Add inotify watches for directories searched for bb/bbappend files
+            for dirent in searchdirs:
+                self.add_filewatch([[dirent]], dirs=True)
 
             self.parser = CookerParser(self, filelist, masked)
             self.parsecache_valid = True
@@ -1668,7 +1687,7 @@
         if len(pkgs_to_build) == 0:
             raise NothingToBuild
 
-        ignore = (self.expanded_data.getVar("ASSUME_PROVIDED", True) or "").split()
+        ignore = (self.data.getVar("ASSUME_PROVIDED") or "").split()
         for pkg in pkgs_to_build:
             if pkg in ignore:
                 parselog.warning("Explicit target \"%s\" is in ASSUME_PROVIDED, ignoring" % pkg)
@@ -1688,6 +1707,15 @@
             pkgs_to_build.remove('universe')
             for mc in self.multiconfigs:
                 for t in self.recipecaches[mc].universe_target:
+                    if task:
+                        foundtask = False
+                        for provider_fn in self.recipecaches[mc].providers[t]:
+                            if task in self.recipecaches[mc].task_deps[provider_fn]['tasks']:
+                                foundtask = True
+                                break
+                        if not foundtask:
+                            bb.debug(1, "Skipping %s for universe tasks as task %s doesn't exist" % (t, task))
+                            continue
                     if mc:
                         t = "multiconfig:" + mc + ":" + t
                     pkgs_to_build.append(t)
@@ -1701,13 +1729,13 @@
         try:
             self.prhost = prserv.serv.auto_start(self.data)
         except prserv.serv.PRServiceConfigError:
-            bb.event.fire(CookerExit(), self.expanded_data)
+            bb.event.fire(CookerExit(), self.data)
             self.state = state.error
         return
 
     def post_serve(self):
         prserv.serv.auto_shutdown(self.data)
-        bb.event.fire(CookerExit(), self.expanded_data)
+        bb.event.fire(CookerExit(), self.data)
         lockfile = self.lock.name
         self.lock.close()
         self.lock = None
@@ -1745,6 +1773,8 @@
 
         if self.parser:
             self.parser.shutdown(clean=not force, force=force)
+        self.notifier.stop()
+        self.confignotifier.stop()
 
     def finishcommand(self):
         self.state = state.initial
@@ -1752,6 +1782,13 @@
     def reset(self):
         self.initConfigurationData()
 
+    def clientComplete(self):
+        """Called when the client is done using the server"""
+        if self.configuration.server_only:
+            self.finishcommand()
+        else:
+            self.shutdown(True)
+
     def lockBitbake(self):
         if not hasattr(self, 'lock'):
             self.lock = None
@@ -1838,7 +1875,7 @@
 
         collectlog.debug(1, "collecting .bb files")
 
-        files = (config.getVar( "BBFILES", True) or "").split()
+        files = (config.getVar( "BBFILES") or "").split()
         config.setVar("BBFILES", " ".join(files))
 
         # Sort files by priority
@@ -1851,30 +1888,49 @@
             collectlog.error("no recipe files to build, check your BBPATH and BBFILES?")
             bb.event.fire(CookerExit(), eventdata)
 
-        # Can't use set here as order is important
-        newfiles = []
-        for f in files:
-            if os.path.isdir(f):
-                dirfiles = self.find_bbfiles(f)
-                for g in dirfiles:
-                    if g not in newfiles:
-                        newfiles.append(g)
-            else:
-                globbed = glob.glob(f)
-                if not globbed and os.path.exists(f):
-                    globbed = [f]
-                # glob gives files in order on disk. Sort to be deterministic.
-                for g in sorted(globbed):
-                    if g not in newfiles:
-                        newfiles.append(g)
+        # We need to track where we look so that we can add inotify watches. There
+        # is no nice way to do this, this is horrid. We intercept the os.listdir()
+        # calls while we run glob().
+        origlistdir = os.listdir
+        searchdirs = []
 
-        bbmask = config.getVar('BBMASK', True)
+        def ourlistdir(d):
+            searchdirs.append(d)
+            return origlistdir(d)
+
+        os.listdir = ourlistdir
+        try:
+            # Can't use set here as order is important
+            newfiles = []
+            for f in files:
+                if os.path.isdir(f):
+                    dirfiles = self.find_bbfiles(f)
+                    for g in dirfiles:
+                        if g not in newfiles:
+                            newfiles.append(g)
+                else:
+                    globbed = glob.glob(f)
+                    if not globbed and os.path.exists(f):
+                        globbed = [f]
+                    # glob gives files in order on disk. Sort to be deterministic.
+                    for g in sorted(globbed):
+                        if g not in newfiles:
+                            newfiles.append(g)
+        finally:
+            os.listdir = origlistdir
+
+        bbmask = config.getVar('BBMASK')
 
         if bbmask:
             # First validate the individual regular expressions and ignore any
             # that do not compile
             bbmasks = []
             for mask in bbmask.split():
+                # When constructing an older style single regex, it's possible for BBMASK
+                # to end up beginning with '|', which matches and masks _everything_.
+                if mask.startswith("|"):
+                    collectlog.warn("BBMASK contains regular expression beginning with '|', fixing: %s" % mask)
+                    mask = mask[1:]
                 try:
                     re.compile(mask)
                     bbmasks.append(mask)
@@ -1921,7 +1977,7 @@
                 topfile = bbfile_seen[base]
                 self.overlayed[topfile].append(f)
 
-        return (bbfiles, masked)
+        return (bbfiles, masked, searchdirs)
 
     def get_file_appends(self, fn):
         """
@@ -1964,7 +2020,7 @@
 
         for collection, pattern, regex, _ in self.bbfile_config_priorities:
             if regex in unmatched:
-                if d.getVar('BBFILE_PATTERN_IGNORE_EMPTY_%s' % collection, True) != '1':
+                if d.getVar('BBFILE_PATTERN_IGNORE_EMPTY_%s' % collection) != '1':
                     collectlog.warning("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern))
 
         return priorities
@@ -2121,7 +2177,7 @@
         self.toparse = self.total - len(self.fromcache)
         self.progress_chunk = int(max(self.toparse / 100, 1))
 
-        self.num_processes = min(int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS", True) or
+        self.num_processes = min(int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS") or
                                  multiprocessing.cpu_count()), len(self.willparse))
 
         self.start()
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/cookerdata.py b/import-layers/yocto-poky/bitbake/lib/bb/cookerdata.py
index 98f56ac..e408a35 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/cookerdata.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/cookerdata.py
@@ -79,7 +79,7 @@
                   "prefile", "postfile"]:
             options[o] = getattr(self.options, o)
 
-        ret, error = server.runCommand(["updateConfig", options, environment])
+        ret, error = server.runCommand(["updateConfig", options, environment, sys.argv])
         if error:
                 raise Exception("Unable to update the server configuration with local parameters: %s" % error)
 
@@ -146,6 +146,9 @@
         self.tracking = False
         self.interface = []
         self.writeeventlog = False
+        self.server_only = False
+        self.limited_deps = False
+        self.runall = None
 
         self.env = {}
 
@@ -212,7 +215,7 @@
 
 def findConfigFile(configfile, data):
     search = []
-    bbpath = data.getVar("BBPATH", True)
+    bbpath = data.getVar("BBPATH")
     if bbpath:
         for i in bbpath.split(":"):
             search.append(os.path.join(i, "conf", configfile))
@@ -286,7 +289,7 @@
             self.data_hash = self.data.get_hash()
             self.mcdata[''] = self.data
 
-            multiconfig = (self.data.getVar("BBMULTICONFIG", True) or "").split()
+            multiconfig = (self.data.getVar("BBMULTICONFIG") or "").split()
             for config in multiconfig:
                 mcdata = self.parseConfigurationFiles(self.prefiles, self.postfiles, config)
                 bb.event.fire(bb.event.ConfigParsed(), mcdata)
@@ -320,7 +323,7 @@
             data.setVar("TOPDIR", os.path.dirname(os.path.dirname(layerconf)))
             data = parse_config_file(layerconf, data)
 
-            layers = (data.getVar('BBLAYERS', True) or "").split()
+            layers = (data.getVar('BBLAYERS') or "").split()
 
             data = bb.data.createCopy(data)
             approved = bb.utils.approved_variables()
@@ -343,7 +346,7 @@
             data.delVar('LAYERDIR_RE')
             data.delVar('LAYERDIR')
 
-        if not data.getVar("BBPATH", True):
+        if not data.getVar("BBPATH"):
             msg = "The BBPATH variable is not set"
             if not layerconf:
                 msg += (" and bitbake did not find a conf/bblayers.conf file in"
@@ -358,7 +361,7 @@
             data = parse_config_file(p, data)
 
         # Handle any INHERITs and inherit the base class
-        bbclasses  = ["base"] + (data.getVar('INHERIT', True) or "").split()
+        bbclasses  = ["base"] + (data.getVar('INHERIT') or "").split()
         for bbclass in bbclasses:
             data = _inherit(bbclass, data)
 
@@ -370,7 +373,7 @@
                 parselog.critical("Undefined event handler function '%s'" % var)
                 sys.exit(1)
             handlerln = int(data.getVarFlag(var, "lineno", False))
-            bb.event.register(var, data.getVar(var, False),  (data.getVarFlag(var, "eventmask", True) or "").split(), handlerfn, handlerln)
+            bb.event.register(var, data.getVar(var, False),  (data.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln)
 
         data.setVar('BBINCLUDED',bb.parse.get_file_depends(data))
 
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/data.py b/import-layers/yocto-poky/bitbake/lib/bb/data.py
index c56965c..134afaa 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/data.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/data.py
@@ -78,59 +78,6 @@
     """Non-destructive var init for data structure"""
     d.initVar(var)
 
-
-def setVar(var, value, d):
-    """Set a variable to a given value"""
-    d.setVar(var, value)
-
-
-def getVar(var, d, exp = False):
-    """Gets the value of a variable"""
-    return d.getVar(var, exp)
-
-
-def renameVar(key, newkey, d):
-    """Renames a variable from key to newkey"""
-    d.renameVar(key, newkey)
-
-def delVar(var, d):
-    """Removes a variable from the data set"""
-    d.delVar(var)
-
-def appendVar(var, value, d):
-    """Append additional value to a variable"""
-    d.appendVar(var, value)
-
-def setVarFlag(var, flag, flagvalue, d):
-    """Set a flag for a given variable to a given value"""
-    d.setVarFlag(var, flag, flagvalue)
-
-def getVarFlag(var, flag, d):
-    """Gets given flag from given var"""
-    return d.getVarFlag(var, flag, False)
-
-def delVarFlag(var, flag, d):
-    """Removes a given flag from the variable's flags"""
-    d.delVarFlag(var, flag)
-
-def setVarFlags(var, flags, d):
-    """Set the flags for a given variable
-
-    Note:
-        setVarFlags will not clear previous
-        flags. Think of this method as
-        addVarFlags
-    """
-    d.setVarFlags(var, flags)
-
-def getVarFlags(var, d):
-    """Gets a variable's flags"""
-    return d.getVarFlags(var)
-
-def delVarFlags(var, d):
-    """Removes a variable's flags"""
-    d.delVarFlags(var)
-
 def keys(d):
     """Return a list of keys in d"""
     return d.keys()
@@ -174,7 +121,7 @@
     for s in savedenv.keys():
         if s in permitted:
             try:
-                d.setVar(s, savedenv.getVar(s, True), op = 'from env')
+                d.setVar(s, savedenv.getVar(s), op = 'from env')
                 if s in exportlist:
                     d.setVarFlag(s, "export", True, op = 'auto env export')
             except TypeError:
@@ -194,7 +141,7 @@
     try:
         if all:
             oval = d.getVar(var, False)
-        val = d.getVar(var, True)
+        val = d.getVar(var)
     except (KeyboardInterrupt, bb.build.FuncFailed):
         raise
     except Exception as exc:
@@ -249,7 +196,7 @@
     keys = sorted((key for key in d.keys() if not key.startswith("__")), key=isfunc)
     grouped = groupby(keys, isfunc)
     for isfunc, keys in grouped:
-        for key in keys:
+        for key in sorted(keys):
             emit_var(key, o, d, all and not isfunc) and o.write('\n')
 
 def exported_keys(d):
@@ -261,9 +208,9 @@
     k = list(exported_keys(d))
     for key in k:
         try:
-            value = d.getVar(key, True)
+            value = d.getVar(key)
         except Exception as err:
-            bb.warn("%s: Unable to export ${%s}: %s" % (d.getVar("FILE", True), key, err))
+            bb.warn("%s: Unable to export ${%s}: %s" % (d.getVar("FILE"), key, err))
             continue
 
         if value is not None:
@@ -273,13 +220,13 @@
     """Emits all items in the data store in a format such that it can be sourced by a shell."""
 
     keys = (key for key in d.keys() if not key.startswith("__") and not d.getVarFlag(key, "func", False))
-    for key in keys:
+    for key in sorted(keys):
         emit_var(key, o, d, False)
 
     o.write('\n')
     emit_var(func, o, d, False) and o.write('\n')
-    newdeps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func, True))
-    newdeps |= set((d.getVarFlag(func, "vardeps", True) or "").split())
+    newdeps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func))
+    newdeps |= set((d.getVarFlag(func, "vardeps") or "").split())
     seen = set()
     while newdeps:
         deps = newdeps
@@ -288,8 +235,8 @@
         for dep in deps:
             if d.getVarFlag(dep, "func", False) and not d.getVarFlag(dep, "python", False):
                emit_var(dep, o, d, False) and o.write('\n')
-               newdeps |=  bb.codeparser.ShellParser(dep, logger).parse_shell(d.getVar(dep, True))
-               newdeps |= set((d.getVarFlag(dep, "vardeps", True) or "").split())
+               newdeps |=  bb.codeparser.ShellParser(dep, logger).parse_shell(d.getVar(dep))
+               newdeps |= set((d.getVarFlag(dep, "vardeps") or "").split())
         newdeps -= seen
 
 _functionfmt = """
@@ -312,7 +259,7 @@
     pp = bb.codeparser.PythonParser(func, logger)
     pp.parse_python(d.getVar(func, False))
     newdeps = pp.execs
-    newdeps |= set((d.getVarFlag(func, "vardeps", True) or "").split())
+    newdeps |= set((d.getVarFlag(func, "vardeps") or "").split())
     seen = set()
     while newdeps:
         deps = newdeps
@@ -324,7 +271,7 @@
                pp = bb.codeparser.PythonParser(dep, logger)
                pp.parse_python(d.getVar(dep, False))
                newdeps |= pp.execs
-               newdeps |= set((d.getVarFlag(dep, "vardeps", True) or "").split())
+               newdeps |= set((d.getVarFlag(dep, "vardeps") or "").split())
         newdeps -= seen
 
 def update_data(d):
@@ -348,12 +295,14 @@
         def handle_contains(value, contains, d):
             newvalue = ""
             for k in sorted(contains):
-                l = (d.getVar(k, True) or "").split()
-                for word in sorted(contains[k]):
-                    if word in l:
-                        newvalue += "\n%s{%s} = Set" %  (k, word)
+                l = (d.getVar(k) or "").split()
+                for item in sorted(contains[k]):
+                    for word in item.split():
+                        if not word in l:
+                            newvalue += "\n%s{%s} = Unset" % (k, item)
+                            break
                     else:
-                        newvalue += "\n%s{%s} = Unset" %  (k, word)
+                        newvalue += "\n%s{%s} = Set" % (k, item)
             if not newvalue:
                 return value
             if not value:
@@ -366,7 +315,7 @@
             if varflags.get("python"):
                 parser = bb.codeparser.PythonParser(key, logger)
                 if value and "\t" in value:
-                    logger.warning("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE", True)))
+                    logger.warning("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE")))
                 parser.parse_python(value, filename=varflags.get("filename"), lineno=varflags.get("lineno"))
                 deps = deps | parser.references
                 deps = deps | (keys & parser.execs)
@@ -410,6 +359,8 @@
 
         deps |= set((vardeps or "").split())
         deps -= set(varflags.get("vardepsexclude", "").split())
+    except bb.parse.SkipRecipe:
+        raise
     except Exception as e:
         bb.warn("Exception during build_dependencies for %s" % key)
         raise
@@ -421,7 +372,7 @@
 
     keys = set(key for key in d if not key.startswith("__"))
     shelldeps = set(key for key in d.getVar("__exportlist", False) if d.getVarFlag(key, "export", False) and not d.getVarFlag(key, "unexport", False))
-    varflagsexcl = d.getVar('BB_SIGNATURE_EXCLUDE_FLAGS', True)
+    varflagsexcl = d.getVar('BB_SIGNATURE_EXCLUDE_FLAGS')
 
     deps = {}
     values = {}
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/data_smart.py b/import-layers/yocto-poky/bitbake/lib/bb/data_smart.py
index 805a9a7..7dc1c68 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/data_smart.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/data_smart.py
@@ -108,7 +108,7 @@
                 varparse = self.d.expand_cache[key]
                 var = varparse.value
             else:
-                var = self.d.getVarFlag(key, "_content", True)
+                var = self.d.getVarFlag(key, "_content")
             self.references.add(key)
             if var is not None:
                 return var
@@ -116,13 +116,21 @@
                 return match.group()
 
     def python_sub(self, match):
-            code = match.group()[3:-1]
+            if isinstance(match, str):
+                code = match
+            else:
+                code = match.group()[3:-1]
+
+            if "_remote_data" in self.d:
+                connector = self.d["_remote_data"]
+                return connector.expandPythonRef(self.varname, code, self.d)
+
             codeobj = compile(code.strip(), self.varname or "<expansion>", "eval")
 
             parser = bb.codeparser.PythonParser(self.varname, logger)
             parser.parse_python(code)
             if self.varname:
-                vardeps = self.d.getVarFlag(self.varname, "vardeps", True)
+                vardeps = self.d.getVarFlag(self.varname, "vardeps")
                 if vardeps is None:
                     parser.log.flush()
             else:
@@ -146,7 +154,7 @@
         self['d'] = metadata
 
     def __missing__(self, key):
-        value = self.metadata.getVar(key, True)
+        value = self.metadata.getVar(key)
         if value is None or self.metadata.getVarFlag(key, 'func', False):
             raise KeyError(key)
         else:
@@ -222,6 +230,19 @@
         new.variables = self.variables.copy()
         return new
 
+    def __getstate__(self):
+        vardict = {}
+        for k, v in self.variables.iteritems():
+            vardict[k] = v
+        return {'dataroot': self.dataroot,
+                'variables': vardict}
+
+    def __setstate__(self, state):
+        self.dataroot = state['dataroot']
+        self.variables = COWDictBase.copy()
+        for k, v in state['variables'].items():
+            self.variables[k] = v
+
     def record(self, *kwonly, **loginfo):
         if not self.dataroot._tracking:
             return
@@ -247,10 +268,15 @@
         self.variables[var].append(loginfo.copy())
 
     def variable(self, var):
-        if var in self.variables:
-            return self.variables[var]
+        remote_connector = self.dataroot.getVar('_remote_data', False)
+        if remote_connector:
+            varhistory = remote_connector.getVarHistory(var)
         else:
-            return []
+            varhistory = []
+
+        if var in self.variables:
+            varhistory.extend(self.variables[var])
+        return varhistory
 
     def emit(self, var, oval, val, o, d):
         history = self.variable(var)
@@ -318,7 +344,7 @@
         the files in which they were added.
         """
         history = self.variable(var)
-        finalitems = (d.getVar(var, True) or '').split()
+        finalitems = (d.getVar(var) or '').split()
         filemap = {}
         isset = False
         for event in history:
@@ -426,11 +452,11 @@
             # Can end up here recursively so setup dummy values
             self.overrides = []
             self.overridesset = set()
-            self.overrides = (self.getVar("OVERRIDES", True) or "").split(":") or []
+            self.overrides = (self.getVar("OVERRIDES") or "").split(":") or []
             self.overridesset = set(self.overrides)
             self.inoverride = False
             self.expand_cache = {}
-            newoverrides = (self.getVar("OVERRIDES", True) or "").split(":") or []
+            newoverrides = (self.getVar("OVERRIDES") or "").split(":") or []
             if newoverrides == self.overrides:
                 break
             self.overrides = newoverrides
@@ -447,17 +473,22 @@
         dest = self.dict
         while dest:
             if var in dest:
-                return dest[var]
+                return dest[var], self.overridedata.get(var, None)
+
+            if "_remote_data" in dest:
+                connector = dest["_remote_data"]["_content"]
+                return connector.getVar(var)
 
             if "_data" not in dest:
                 break
             dest = dest["_data"]
+        return None, self.overridedata.get(var, None)
 
     def _makeShadowCopy(self, var):
         if var in self.dict:
             return
 
-        local_var = self._findVar(var)
+        local_var, _ = self._findVar(var)
 
         if local_var:
             self.dict[var] = copy.copy(local_var)
@@ -471,6 +502,12 @@
         if 'parsing' in loginfo:
             parsing=True
 
+        if '_remote_data' in self.dict:
+            connector = self.dict["_remote_data"]["_content"]
+            res = connector.setVar(var, value)
+            if not res:
+                return
+
         if 'op' not in loginfo:
             loginfo['op'] = "set"
         self.expand_cache = {}
@@ -509,6 +546,8 @@
                 del self.dict[var]["_append"]
             if "_prepend" in self.dict[var]:
                 del self.dict[var]["_prepend"]
+            if "_remove" in self.dict[var]:
+                del self.dict[var]["_remove"]
             if var in self.overridedata:
                 active = []
                 self.need_overrides()
@@ -541,7 +580,7 @@
             nextnew = set()
             self.overridevars.update(new)
             for i in new:
-                vardata = self.expandWithRefs(self.getVar(i, True), i)
+                vardata = self.expandWithRefs(self.getVar(i), i)
                 nextnew.update(vardata.references)
                 nextnew.update(vardata.contains.keys())
             new = nextnew
@@ -565,13 +604,19 @@
                 if len(shortvar) == 0:
                     override = None
 
-    def getVar(self, var, expand, noweakdefault=False, parsing=False):
+    def getVar(self, var, expand=True, noweakdefault=False, parsing=False):
         return self.getVarFlag(var, "_content", expand, noweakdefault, parsing)
 
     def renameVar(self, key, newkey, **loginfo):
         """
         Rename the variable key to newkey
         """
+        if '_remote_data' in self.dict:
+            connector = self.dict["_remote_data"]["_content"]
+            res = connector.renameVar(key, newkey)
+            if not res:
+                return
+
         val = self.getVar(key, 0, parsing=True)
         if val is not None:
             loginfo['variable'] = newkey
@@ -615,6 +660,12 @@
         self.setVar(var + "_prepend", value, ignore=True, parsing=True)
 
     def delVar(self, var, **loginfo):
+        if '_remote_data' in self.dict:
+            connector = self.dict["_remote_data"]["_content"]
+            res = connector.delVar(var)
+            if not res:
+                return
+
         loginfo['detail'] = ""
         loginfo['op'] = 'del'
         self.varhistory.record(**loginfo)
@@ -641,6 +692,12 @@
                          override = None
 
     def setVarFlag(self, var, flag, value, **loginfo):
+        if '_remote_data' in self.dict:
+            connector = self.dict["_remote_data"]["_content"]
+            res = connector.setVarFlag(var, flag, value)
+            if not res:
+                return
+
         self.expand_cache = {}
         if 'op' not in loginfo:
             loginfo['op'] = "set"
@@ -662,14 +719,14 @@
                 self.dict["__exportlist"]["_content"] = set()
             self.dict["__exportlist"]["_content"].add(var)
 
-    def getVarFlag(self, var, flag, expand, noweakdefault=False, parsing=False):
-        local_var = self._findVar(var)
+    def getVarFlag(self, var, flag, expand=True, noweakdefault=False, parsing=False):
+        local_var, overridedata = self._findVar(var)
         value = None
-        if flag == "_content" and var in self.overridedata and not parsing:
+        if flag == "_content" and overridedata is not None and not parsing:
             match = False
             active = {}
             self.need_overrides()
-            for (r, o) in self.overridedata[var]:
+            for (r, o) in overridedata:
                 # What about double overrides both with "_" in the name?
                 if o in self.overridesset:
                     active[o] = r
@@ -759,8 +816,14 @@
         return value
 
     def delVarFlag(self, var, flag, **loginfo):
+        if '_remote_data' in self.dict:
+            connector = self.dict["_remote_data"]["_content"]
+            res = connector.delVarFlag(var, flag)
+            if not res:
+                return
+
         self.expand_cache = {}
-        local_var = self._findVar(var)
+        local_var, _ = self._findVar(var)
         if not local_var:
             return
         if not var in self.dict:
@@ -803,7 +866,7 @@
             self.dict[var][i] = flags[i]
 
     def getVarFlags(self, var, expand = False, internalflags=False):
-        local_var = self._findVar(var)
+        local_var, _ = self._findVar(var)
         flags = {}
 
         if local_var:
@@ -845,7 +908,7 @@
         data = DataSmart()
         data.dict["_data"] = self.dict
         data.varhistory = self.varhistory.copy()
-        data.varhistory.datasmart = data
+        data.varhistory.dataroot = data
         data.inchistory = self.inchistory.copy()
 
         data._tracking = self._tracking
@@ -876,7 +939,7 @@
 
     def localkeys(self):
         for key in self.dict:
-            if key != '_data':
+            if key not in ['_data', '_remote_data']:
                 yield key
 
     def __iter__(self):
@@ -885,7 +948,7 @@
         def keylist(d):        
             klist = set()
             for key in d:
-                if key == "_data":
+                if key in ["_data", "_remote_data"]:
                     continue
                 if key in deleted:
                     continue
@@ -899,6 +962,13 @@
             if "_data" in d:
                 klist |= keylist(d["_data"])
 
+            if "_remote_data" in d:
+                connector = d["_remote_data"]["_content"]
+                for key in connector.getKeys():
+                    if key in deleted:
+                        continue
+                    klist.add(key)
+
             return klist
 
         self.need_overrides()
@@ -936,9 +1006,8 @@
         data = {}
         d = self.createCopy()
         bb.data.expandKeys(d)
-        bb.data.update_data(d)
 
-        config_whitelist = set((d.getVar("BB_HASHCONFIG_WHITELIST", True) or "").split())
+        config_whitelist = set((d.getVar("BB_HASHCONFIG_WHITELIST") or "").split())
         keys = set(key for key in iter(d) if not key.startswith("__"))
         for key in keys:
             if key in config_whitelist:
@@ -957,7 +1026,6 @@
 
         for key in ["__BBTASKS", "__BBANONFUNCS", "__BBHANDLERS"]:
             bb_list = d.getVar(key, False) or []
-            bb_list.sort()
             data.update({key:str(bb_list)})
 
             if key == "__BBANONFUNCS":
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/event.py b/import-layers/yocto-poky/bitbake/lib/bb/event.py
index 6f1cb10..6d8493b 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/event.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/event.py
@@ -48,6 +48,16 @@
     def __init__(self):
         self.pid = worker_pid
 
+
+class HeartbeatEvent(Event):
+    """Triggered at regular time intervals of 10 seconds. Other events can fire much more often
+       (runQueueTaskStarted when there are many short tasks) or not at all for long periods
+       of time (again runQueueTaskStarted, when there is just one long-running task), so this
+       event is more suitable for doing some task-independent work occassionally."""
+    def __init__(self, time):
+        Event.__init__(self)
+        self.time = time
+
 Registered        = 10
 AlreadyRegistered = 14
 
@@ -351,6 +361,17 @@
 class RecipePreFinalise(RecipeEvent):
     """ Recipe Parsing Complete but not yet finialised"""
 
+class RecipeTaskPreProcess(RecipeEvent):
+    """
+    Recipe Tasks about to be finalised
+    The list of tasks should be final at this point and handlers
+    are only able to change interdependencies
+    """
+    def __init__(self, fn, tasklist):
+        self.fn = fn
+        self.tasklist = tasklist
+        Event.__init__(self)
+
 class RecipeParsed(RecipeEvent):
     """ Recipe Parsing Complete """
 
@@ -372,7 +393,7 @@
     targets = property(getTargets)
 
 class BuildBase(Event):
-    """Base class for bbmake run events"""
+    """Base class for bitbake build events"""
 
     def __init__(self, n, p, failures = 0):
         self._name = n
@@ -417,13 +438,13 @@
         BuildBase.__init__(self, name, p)
 
 class BuildStarted(BuildBase, OperationStarted):
-    """bbmake build run started"""
+    """Event when builds start"""
     def __init__(self, n, p, failures = 0):
         OperationStarted.__init__(self, "Building Started")
         BuildBase.__init__(self, n, p, failures)
 
 class BuildCompleted(BuildBase, OperationCompleted):
-    """bbmake build run completed"""
+    """Event when builds have completed"""
     def __init__(self, total, n, p, failures=0, interrupted=0):
         if not failures:
             OperationCompleted.__init__(self, total, "Building Succeeded")
@@ -441,6 +462,23 @@
         self._free = freespace
         self._mountpoint = mountpoint
 
+class DiskUsageSample:
+    def __init__(self, available_bytes, free_bytes, total_bytes):
+        # Number of bytes available to non-root processes.
+        self.available_bytes = available_bytes
+        # Number of bytes available to root processes.
+        self.free_bytes = free_bytes
+        # Total capacity of the volume.
+        self.total_bytes = total_bytes
+
+class MonitorDiskEvent(Event):
+    """If BB_DISKMON_DIRS is set, then this event gets triggered each time disk space is checked.
+       Provides information about devices that are getting monitored."""
+    def __init__(self, disk_usage):
+        Event.__init__(self)
+        # hash of device root path -> DiskUsageSample
+        self.disk_usage = disk_usage
+
 class NoProvider(Event):
     """No Provider for an Event"""
 
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/__init__.py
index cd7362c..b853da3 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/__init__.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/__init__.py
@@ -35,9 +35,9 @@
 import collections
 import subprocess
 import pickle
+import errno
 import bb.persist_data, bb.utils
 import bb.checksum
-from bb import data
 import bb.process
 
 __version__ = "2"
@@ -355,7 +355,7 @@
     user, password, parameters).
     """
 
-    m = re.compile('(?P<type>[^:]*)://((?P<user>[^/]+)@)?(?P<location>[^;]+)(;(?P<parm>.*))?').match(url)
+    m = re.compile('(?P<type>[^:]*)://((?P<user>[^/;]+)@)?(?P<location>[^;]+)(;(?P<parm>.*))?').match(url)
     if not m:
         raise MalformedUrl(url)
 
@@ -491,7 +491,7 @@
     Calls before this must not hit the cache.
     """
     # When to drop SCM head revisions controlled by user policy
-    srcrev_policy = d.getVar('BB_SRCREV_POLICY', True) or "clear"
+    srcrev_policy = d.getVar('BB_SRCREV_POLICY') or "clear"
     if srcrev_policy == "cache":
         logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy)
     elif srcrev_policy == "clear":
@@ -537,7 +537,11 @@
     return False
 
 def mirror_from_string(data):
-    return [ i.split() for i in (data or "").replace('\\n','\n').split('\n') if i ]
+    mirrors = (data or "").replace('\\n',' ').split()
+    # Split into pairs
+    if len(mirrors) % 2 != 0:
+        bb.warn('Invalid mirror data %s, should have paired members.' % data)
+    return list(zip(*[iter(mirrors)]*2))
 
 def verify_checksum(ud, d, precomputed={}):
     """
@@ -572,7 +576,7 @@
 
     if ud.method.recommends_checksum(ud) and not ud.md5_expected and not ud.sha256_expected:
         # If strict checking enabled and neither sum defined, raise error
-        strict = d.getVar("BB_STRICT_CHECKSUM", True) or "0"
+        strict = d.getVar("BB_STRICT_CHECKSUM") or "0"
         if strict == "1":
             logger.error('No checksum specified for %s, please add at least one to the recipe:\n'
                              'SRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"' %
@@ -621,7 +625,7 @@
     Returns True, if the donestamp exists and is valid, False otherwise. When
     returning False, any existing done stamps are removed.
     """
-    if not ud.needdonestamp:
+    if not ud.needdonestamp or (origud and not origud.needdonestamp):
         return True
 
     if not os.path.exists(ud.donestamp):
@@ -718,13 +722,13 @@
 
 def get_autorev(d):
     #  only not cache src rev in autorev case
-    if d.getVar('BB_SRCREV_POLICY', True) != "cache":
+    if d.getVar('BB_SRCREV_POLICY') != "cache":
         d.setVar('BB_DONT_CACHE', '1')
     return "AUTOINC"
 
 def get_srcrev(d, method_name='sortable_revision'):
     """
-    Return the revsion string, usually for use in the version string (PV) of the current package
+    Return the revision string, usually for use in the version string (PV) of the current package
     Most packages usually only have one SCM so we just pass on the call.
     In the multi SCM case, we build a value based on SRCREV_FORMAT which must
     have been set.
@@ -737,7 +741,7 @@
     """
 
     scms = []
-    fetcher = Fetch(d.getVar('SRC_URI', True).split(), d)
+    fetcher = Fetch(d.getVar('SRC_URI').split(), d)
     urldata = fetcher.ud
     for u in urldata:
         if urldata[u].method.supports_srcrev():
@@ -757,7 +761,7 @@
     #
     # Mutiple SCMs are in SRC_URI so we resort to SRCREV_FORMAT
     #
-    format = d.getVar('SRCREV_FORMAT', True)
+    format = d.getVar('SRCREV_FORMAT')
     if not format:
         raise FetchError("The SRCREV_FORMAT variable must be set when multiple SCMs are used.")
 
@@ -819,9 +823,18 @@
     if not cleanup:
         cleanup = []
 
+    # If PATH contains WORKDIR which contains PV which contains SRCPV we
+    # can end up in circular recursion here so give the option of breaking it
+    # in a data store copy.
+    try:
+        d.getVar("PV")
+    except bb.data_smart.ExpansionError:
+        d = bb.data.createCopy(d)
+        d.setVar("PV", "fetcheravoidrecurse")
+
     origenv = d.getVar("BB_ORIGENV", False)
     for var in exportvars:
-        val = d.getVar(var, True) or (origenv and origenv.getVar(var, True))
+        val = d.getVar(var) or (origenv and origenv.getVar(var))
         if val:
             cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
 
@@ -856,12 +869,15 @@
 
     return output
 
-def check_network_access(d, info = "", url = None):
+def check_network_access(d, info, url):
     """
-    log remote network access, and error if BB_NO_NETWORK is set
+    log remote network access, and error if BB_NO_NETWORK is set or the given
+    URI is untrusted
     """
-    if d.getVar("BB_NO_NETWORK", True) == "1":
+    if d.getVar("BB_NO_NETWORK") == "1":
         raise NetworkAccess(url, info)
+    elif not trusted_network(d, url):
+        raise UntrustedUrl(url, info)
     else:
         logger.debug(1, "Fetcher accessed the network with the command %s" % info)
 
@@ -958,7 +974,7 @@
 
         # We may be obtaining a mirror tarball which needs further processing by the real fetcher
         # If that tarball is a local file:// we need to provide a symlink to it
-        dldir = ld.getVar("DL_DIR", True)
+        dldir = ld.getVar("DL_DIR")
         if origud.mirrortarball and os.path.basename(ud.localpath) == os.path.basename(origud.mirrortarball) \
                 and os.path.basename(ud.localpath) != os.path.basename(origud.localpath):
             # Create donestamp in old format to avoid triggering a re-download
@@ -967,7 +983,14 @@
                 open(ud.donestamp, 'w').close()
             dest = os.path.join(dldir, os.path.basename(ud.localpath))
             if not os.path.exists(dest):
-                os.symlink(ud.localpath, dest)
+                # In case this is executing without any file locks held (as is
+                # the case for file:// URLs), two tasks may end up here at the
+                # same time, in which case we do not want the second task to
+                # fail when the link has already been created by the first task.
+                try:
+                    os.symlink(ud.localpath, dest)
+                except FileExistsError:
+                    pass
             if not verify_donestamp(origud, ld) or origud.method.need_update(origud, ld):
                 origud.method.download(origud, ld)
                 if hasattr(origud.method,"build_mirror_data"):
@@ -979,13 +1002,23 @@
                 # Broken symbolic link
                 os.unlink(origud.localpath)
 
-            os.symlink(ud.localpath, origud.localpath)
+            # As per above, in case two tasks end up here simultaneously.
+            try:
+                os.symlink(ud.localpath, origud.localpath)
+            except FileExistsError:
+                pass
         update_stamp(origud, ld)
         return ud.localpath
 
     except bb.fetch2.NetworkAccess:
         raise
 
+    except IOError as e:
+        if e.errno in [os.errno.ESTALE]:
+            logger.warn("Stale Error Observed %s." % ud.url)
+            return False
+        raise
+
     except bb.fetch2.BBFetchException as e:
         if isinstance(e, ChecksumError):
             logger.warning("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (ud.url, origud.url))
@@ -1032,14 +1065,14 @@
     BB_ALLOWED_NETWORKS is set globally or for a specific recipe.
     Note: modifies SRC_URI & mirrors.
     """
-    if d.getVar('BB_NO_NETWORK', True) == "1":
+    if d.getVar('BB_NO_NETWORK') == "1":
         return True
 
     pkgname = d.expand(d.getVar('PN', False))
     trusted_hosts = d.getVarFlag('BB_ALLOWED_NETWORKS', pkgname, False)
 
     if not trusted_hosts:
-        trusted_hosts = d.getVar('BB_ALLOWED_NETWORKS', True)
+        trusted_hosts = d.getVar('BB_ALLOWED_NETWORKS')
 
     # Not enabled.
     if not trusted_hosts:
@@ -1071,7 +1104,7 @@
     """
 
     srcrev = None
-    pn = d.getVar("PN", True)
+    pn = d.getVar("PN")
     attempts = []
     if name != '' and pn:
         attempts.append("SRCREV_%s_pn-%s" % (name, pn))
@@ -1082,7 +1115,7 @@
     attempts.append("SRCREV")
 
     for a in attempts:
-        srcrev = d.getVar(a, True)              
+        srcrev = d.getVar(a)              
         if srcrev and srcrev != "INVALID":
             break
 
@@ -1115,7 +1148,7 @@
     """
     fetch = Fetch([], d, cache = False, localonly = True)
 
-    dl_dir = d.getVar('DL_DIR', True)
+    dl_dir = d.getVar('DL_DIR')
     filelist = []
     for u in fetch.urls:
         ud = fetch.ud[u]
@@ -1129,9 +1162,9 @@
                 if f.startswith(dl_dir):
                     # The local fetcher's behaviour is to return a path under DL_DIR if it couldn't find the file anywhere else
                     if os.path.exists(f):
-                        bb.warn("Getting checksum for %s SRC_URI entry %s: file not found except in DL_DIR" % (d.getVar('PN', True), os.path.basename(f)))
+                        bb.warn("Getting checksum for %s SRC_URI entry %s: file not found except in DL_DIR" % (d.getVar('PN'), os.path.basename(f)))
                     else:
-                        bb.warn("Unable to get checksum for %s SRC_URI entry %s: file could not be found" % (d.getVar('PN', True), os.path.basename(f)))
+                        bb.warn("Unable to get checksum for %s SRC_URI entry %s: file could not be found" % (d.getVar('PN'), os.path.basename(f)))
                 filelist.append(f + ":" + str(os.path.exists(f)))
 
     return " ".join(filelist)
@@ -1160,7 +1193,7 @@
         self.mirrortarball = None
         self.basename = None
         self.basepath = None
-        (self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(data.expand(url, d))
+        (self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(d.expand(url))
         self.date = self.getSRCDate(d)
         self.url = url
         if not self.user and "user" in self.parm:
@@ -1177,16 +1210,16 @@
             self.sha256_name = "sha256sum"
         if self.md5_name in self.parm:
             self.md5_expected = self.parm[self.md5_name]
-        elif self.type not in ["http", "https", "ftp", "ftps", "sftp"]:
+        elif self.type not in ["http", "https", "ftp", "ftps", "sftp", "s3"]:
             self.md5_expected = None
         else:
-            self.md5_expected = d.getVarFlag("SRC_URI", self.md5_name, True)
+            self.md5_expected = d.getVarFlag("SRC_URI", self.md5_name)
         if self.sha256_name in self.parm:
             self.sha256_expected = self.parm[self.sha256_name]
-        elif self.type not in ["http", "https", "ftp", "ftps", "sftp"]:
+        elif self.type not in ["http", "https", "ftp", "ftps", "sftp", "s3"]:
             self.sha256_expected = None
         else:
-            self.sha256_expected = d.getVarFlag("SRC_URI", self.sha256_name, True)
+            self.sha256_expected = d.getVarFlag("SRC_URI", self.sha256_name)
         self.ignore_checksums = False
 
         self.names = self.parm.get("name",'default').split(',')
@@ -1204,7 +1237,7 @@
             raise NonLocalMethod()
 
         if self.parm.get("proto", None) and "protocol" not in self.parm:
-            logger.warning('Consider updating %s recipe to use "protocol" not "proto" in SRC_URI.', d.getVar('PN', True))
+            logger.warning('Consider updating %s recipe to use "protocol" not "proto" in SRC_URI.', d.getVar('PN'))
             self.parm["protocol"] = self.parm.get("proto", None)
 
         if hasattr(self.method, "urldata_init"):
@@ -1217,7 +1250,7 @@
         elif self.localfile:
             self.localpath = self.method.localpath(self, d)
 
-        dldir = d.getVar("DL_DIR", True)
+        dldir = d.getVar("DL_DIR")
 
         if not self.needdonestamp:
             return
@@ -1235,7 +1268,7 @@
         self.donestamp = basepath + '.done'
         self.lockfile = basepath + '.lock'
 
-    def setup_revisons(self, d):
+    def setup_revisions(self, d):
         self.revisions = {}
         for name in self.names:
             self.revisions[name] = srcrev_internal_helper(self, d, name)
@@ -1257,12 +1290,12 @@
         if "srcdate" in self.parm:
             return self.parm['srcdate']
 
-        pn = d.getVar("PN", True)
+        pn = d.getVar("PN")
 
         if pn:
-            return d.getVar("SRCDATE_%s" % pn, True) or d.getVar("SRCDATE", True) or d.getVar("DATE", True)
+            return d.getVar("SRCDATE_%s" % pn) or d.getVar("SRCDATE") or d.getVar("DATE")
 
-        return d.getVar("SRCDATE", True) or d.getVar("DATE", True)
+        return d.getVar("SRCDATE") or d.getVar("DATE")
 
 class FetchMethod(object):
     """Base class for 'fetch'ing data"""
@@ -1282,7 +1315,7 @@
         Can also setup variables in urldata for use in go (saving code duplication
         and duplicate code execution)
         """
-        return os.path.join(data.getVar("DL_DIR", d, True), urldata.localfile)
+        return os.path.join(d.getVar("DL_DIR"), urldata.localfile)
 
     def supports_checksum(self, urldata):
         """
@@ -1382,6 +1415,10 @@
                 cmd = 'lzip -dc %s | tar x --no-same-owner -f -' % file
             elif file.endswith('.lz'):
                 cmd = 'lzip -dc %s > %s' % (file, efile)
+            elif file.endswith('.tar.7z'):
+                cmd = '7z x -so %s | tar x --no-same-owner -f -' % file
+            elif file.endswith('.7z'):
+                cmd = '7za x -y %s 1>/dev/null' % file
             elif file.endswith('.zip') or file.endswith('.jar'):
                 try:
                     dos = bb.utils.to_boolean(urldata.parm.get('dos'), False)
@@ -1413,10 +1450,6 @@
                 else:
                     raise UnpackError("Unable to unpack deb/ipk package - could not list contents", urldata.url)
                 cmd = 'ar x %s %s && tar --no-same-owner -xpf %s && rm %s' % (file, datafile, datafile, datafile)
-            elif file.endswith('.tar.7z'):
-                cmd = '7z x -so %s | tar xf - ' % file
-            elif file.endswith('.7z'):
-                cmd = '7za x -y %s 1>/dev/null' % file
 
         # If 'subdir' param exists, create a dir and use it as destination for unpack cmd
         if 'subdir' in urldata.parm:
@@ -1450,7 +1483,7 @@
         if not cmd:
             return
 
-        path = data.getVar('PATH', True)
+        path = data.getVar('PATH')
         if path:
             cmd = "PATH=\"%s\" %s" % (path, cmd)
         bb.note("Unpacking %s to %s/" % (file, unpackdir))
@@ -1507,7 +1540,7 @@
 
     def generate_revision_key(self, ud, d, name):
         key = self._revision_key(ud, d, name)
-        return "%s-%s" % (key, d.getVar("PN", True) or "")
+        return "%s-%s" % (key, d.getVar("PN") or "")
 
 class Fetch(object):
     def __init__(self, urls, d, cache = True, localonly = False, connection_cache = None):
@@ -1515,14 +1548,14 @@
             raise Exception("bb.fetch2.Fetch.__init__: cannot set cache and localonly at same time")
 
         if len(urls) == 0:
-            urls = d.getVar("SRC_URI", True).split()
+            urls = d.getVar("SRC_URI").split()
         self.urls = urls
         self.d = d
         self.ud = {}
         self.connection_cache = connection_cache
 
-        fn = d.getVar('FILE', True)
-        mc = d.getVar('__BBMULTICONFIG', True) or ""
+        fn = d.getVar('FILE')
+        mc = d.getVar('__BBMULTICONFIG') or ""
         if cache and fn and mc + fn in urldata_cache:
             self.ud = urldata_cache[mc + fn]
 
@@ -1565,8 +1598,8 @@
         if not urls:
             urls = self.urls
 
-        network = self.d.getVar("BB_NO_NETWORK", True)
-        premirroronly = (self.d.getVar("BB_FETCH_PREMIRRORONLY", True) == "1")
+        network = self.d.getVar("BB_NO_NETWORK")
+        premirroronly = (self.d.getVar("BB_FETCH_PREMIRRORONLY") == "1")
 
         for u in urls:
             ud = self.ud[u]
@@ -1584,8 +1617,17 @@
                     localpath = ud.localpath
                 elif m.try_premirror(ud, self.d):
                     logger.debug(1, "Trying PREMIRRORS")
-                    mirrors = mirror_from_string(self.d.getVar('PREMIRRORS', True))
+                    mirrors = mirror_from_string(self.d.getVar('PREMIRRORS'))
                     localpath = try_mirrors(self, self.d, ud, mirrors, False)
+                    if localpath:
+                        try:
+                            # early checksum verification so that if the checksum of the premirror
+                            # contents mismatch the fetcher can still try upstream and mirrors
+                            update_stamp(ud, self.d)
+                        except ChecksumError as e:
+                            logger.warning("Checksum failure encountered with premirror download of %s - will attempt other sources." % u)
+                            logger.debug(1, str(e))
+                            localpath = ""
 
                 if premirroronly:
                     self.d.setVar("BB_NO_NETWORK", "1")
@@ -1624,7 +1666,7 @@
                         if not verified_stamp:
                             m.clean(ud, self.d)
                         logger.debug(1, "Trying MIRRORS")
-                        mirrors = mirror_from_string(self.d.getVar('MIRRORS', True))
+                        mirrors = mirror_from_string(self.d.getVar('MIRRORS'))
                         localpath = try_mirrors(self, self.d, ud, mirrors)
 
                 if not localpath or ((not os.path.exists(localpath)) and localpath.find("*") == -1):
@@ -1634,6 +1676,11 @@
 
                 update_stamp(ud, self.d)
 
+            except IOError as e:
+                if e.errno in [os.errno.ESTALE]:
+                    logger.error("Stale Error Observed %s." % u)
+                    raise ChecksumError("Stale Error Detected")
+
             except BBFetchException as e:
                 if isinstance(e, ChecksumError):
                     logger.error("Checksum failure fetching %s" % u)
@@ -1657,7 +1704,7 @@
             m = ud.method
             logger.debug(1, "Testing URL %s", u)
             # First try checking uri, u, from PREMIRRORS
-            mirrors = mirror_from_string(self.d.getVar('PREMIRRORS', True))
+            mirrors = mirror_from_string(self.d.getVar('PREMIRRORS'))
             ret = try_mirrors(self, self.d, ud, mirrors, True)
             if not ret:
                 # Next try checking from the original uri, u
@@ -1665,7 +1712,7 @@
                     ret = m.checkstatus(self, ud, self.d)
                 except:
                     # Finally, try checking uri, u, from MIRRORS
-                    mirrors = mirror_from_string(self.d.getVar('MIRRORS', True))
+                    mirrors = mirror_from_string(self.d.getVar('MIRRORS'))
                     ret = try_mirrors(self, self.d, ud, mirrors, True)
 
             if not ret:
@@ -1763,6 +1810,7 @@
 from . import wget
 from . import ssh
 from . import sftp
+from . import s3
 from . import perforce
 from . import bzr
 from . import hg
@@ -1780,6 +1828,7 @@
 methods.append(cvs.Cvs())
 methods.append(ssh.SSH())
 methods.append(sftp.SFTP())
+methods.append(s3.S3())
 methods.append(perforce.Perforce())
 methods.append(bzr.Bzr())
 methods.append(hg.Hg())
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/bzr.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/bzr.py
index 72264af..16123f8 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/bzr.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/bzr.py
@@ -27,7 +27,6 @@
 import sys
 import logging
 import bb
-from bb import data
 from bb.fetch2 import FetchMethod
 from bb.fetch2 import FetchError
 from bb.fetch2 import runfetchcmd
@@ -43,14 +42,14 @@
         """
         # Create paths to bzr checkouts
         relpath = self._strip_leading_slashes(ud.path)
-        ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath)
+        ud.pkgdir = os.path.join(d.expand('${BZRDIR}'), ud.host, relpath)
 
-        ud.setup_revisons(d)
+        ud.setup_revisions(d)
 
         if not ud.revision:
             ud.revision = self.latest_revision(ud, d)
 
-        ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d)
+        ud.localfile = d.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision))
 
     def _buildbzrcommand(self, ud, d, command):
         """
@@ -58,7 +57,7 @@
         command is "fetch", "update", "revno"
         """
 
-        basecmd = data.expand('${FETCHCMD_bzr}', d)
+        basecmd = d.expand('${FETCHCMD_bzr}')
 
         proto =  ud.parm.get('protocol', 'http')
 
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/clearcase.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/clearcase.py
index 70e280a..36beab6a 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/clearcase.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/clearcase.py
@@ -65,7 +65,6 @@
 import sys
 import shutil
 import bb
-from   bb import data
 from   bb.fetch2 import FetchMethod
 from   bb.fetch2 import FetchError
 from   bb.fetch2 import runfetchcmd
@@ -108,13 +107,13 @@
         else:
             ud.module = ""
 
-        ud.basecmd = d.getVar("FETCHCMD_ccrc", True) or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool")
+        ud.basecmd = d.getVar("FETCHCMD_ccrc") or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool")
 
-        if data.getVar("SRCREV", d, True) == "INVALID":
+        if d.getVar("SRCREV") == "INVALID":
           raise FetchError("Set a valid SRCREV for the clearcase fetcher in your recipe, e.g. SRCREV = \"/main/LATEST\" or any other label of your choice.")
 
         ud.label = d.getVar("SRCREV", False)
-        ud.customspec = d.getVar("CCASE_CUSTOM_CONFIG_SPEC", True)
+        ud.customspec = d.getVar("CCASE_CUSTOM_CONFIG_SPEC")
 
         ud.server     = "%s://%s%s" % (ud.proto, ud.host, ud.path)
 
@@ -124,7 +123,7 @@
 
         ud.viewname         = "%s-view%s" % (ud.identifier, d.getVar("DATETIME", d, True))
         ud.csname           = "%s-config-spec" % (ud.identifier)
-        ud.ccasedir         = os.path.join(data.getVar("DL_DIR", d, True), ud.type)
+        ud.ccasedir         = os.path.join(d.getVar("DL_DIR"), ud.type)
         ud.viewdir          = os.path.join(ud.ccasedir, ud.viewname)
         ud.configspecfile   = os.path.join(ud.ccasedir, ud.csname)
         ud.localfile        = "%s.tar.gz" % (ud.identifier)
@@ -144,7 +143,7 @@
         self.debug("configspecfile  = %s" % ud.configspecfile)
         self.debug("localfile       = %s" % ud.localfile)
 
-        ud.localfile = os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
+        ud.localfile = os.path.join(d.getVar("DL_DIR"), ud.localfile)
 
     def _build_ccase_command(self, ud, command):
         """
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/cvs.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/cvs.py
index 5ff70ba..490c954 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/cvs.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/cvs.py
@@ -63,7 +63,7 @@
         if 'fullpath' in ud.parm:
             fullpath = '_fullpath'
 
-        ud.localfile = bb.data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d)
+        ud.localfile = d.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath))
 
     def need_update(self, ud, d):
         if (ud.date == "now"):
@@ -87,10 +87,10 @@
             cvsroot = ud.path
         else:
             cvsroot = ":" + method
-            cvsproxyhost = d.getVar('CVS_PROXY_HOST', True)
+            cvsproxyhost = d.getVar('CVS_PROXY_HOST')
             if cvsproxyhost:
                 cvsroot += ";proxy=" + cvsproxyhost
-            cvsproxyport = d.getVar('CVS_PROXY_PORT', True)
+            cvsproxyport = d.getVar('CVS_PROXY_PORT')
             if cvsproxyport:
                 cvsroot += ";proxyport=" + cvsproxyport
             cvsroot += ":" + ud.user
@@ -110,7 +110,7 @@
         if ud.tag:
             options.append("-r %s" % ud.tag)
 
-        cvsbasecmd = d.getVar("FETCHCMD_cvs", True)
+        cvsbasecmd = d.getVar("FETCHCMD_cvs")
         cvscmd = cvsbasecmd + " '-d" + cvsroot + "' co " + " ".join(options) + " " + ud.module
         cvsupdatecmd = cvsbasecmd + " '-d" + cvsroot + "' update -d -P " + " ".join(options)
 
@@ -120,8 +120,8 @@
 
         # create module directory
         logger.debug(2, "Fetch: checking for module directory")
-        pkg = d.getVar('PN', True)
-        pkgdir = os.path.join(d.getVar('CVSDIR', True), pkg)
+        pkg = d.getVar('PN')
+        pkgdir = os.path.join(d.getVar('CVSDIR'), pkg)
         moddir = os.path.join(pkgdir, localdir)
         workdir = None
         if os.access(os.path.join(moddir, 'CVS'), os.R_OK):
@@ -164,8 +164,8 @@
     def clean(self, ud, d):
         """ Clean CVS Files and tarballs """
 
-        pkg = d.getVar('PN', True)
-        pkgdir = os.path.join(d.getVar("CVSDIR", True), pkg)
+        pkg = d.getVar('PN')
+        pkgdir = os.path.join(d.getVar("CVSDIR"), pkg)
 
         bb.utils.remove(pkgdir, True)
         bb.utils.remove(ud.localpath)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/git.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/git.py
index 792c183..7442f84 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/git.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/git.py
@@ -50,7 +50,7 @@
    The default is "0", set nobranch=1 if needed.
 
 - usehead
-   For local git:// urls to use the current branch HEAD as the revsion for use with
+   For local git:// urls to use the current branch HEAD as the revision for use with
    AUTOREV. Implies nobranch.
 
 """
@@ -76,7 +76,6 @@
 import bb
 import errno
 import bb.progress
-from   bb    import data
 from   bb.fetch2 import FetchMethod
 from   bb.fetch2 import runfetchcmd
 from   bb.fetch2 import logger
@@ -174,19 +173,19 @@
         if len(branches) != len(ud.names):
             raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url)
         ud.branches = {}
-        for name in ud.names:
-            branch = branches[ud.names.index(name)]
+        for pos, name in enumerate(ud.names):
+            branch = branches[pos]
             ud.branches[name] = branch
             ud.unresolvedrev[name] = branch
 
         if ud.usehead:
             ud.unresolvedrev['default'] = 'HEAD'
 
-        ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git -c core.fsyncobjectfiles=0"
+        ud.basecmd = d.getVar("FETCHCMD_git") or "git -c core.fsyncobjectfiles=0"
 
-        ud.write_tarballs = ((data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) or "0") != "0") or ud.rebaseable
+        ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0") != "0") or ud.rebaseable
 
-        ud.setup_revisons(d)
+        ud.setup_revisions(d)
 
         for name in ud.names:
             # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
@@ -206,9 +205,9 @@
         if ud.rebaseable:
             for name in ud.names:
                 gitsrcname = gitsrcname + '_' + ud.revisions[name]
-        ud.mirrortarball = 'git2_%s.tar.gz' % (gitsrcname)
-        ud.fullmirror = os.path.join(d.getVar("DL_DIR", True), ud.mirrortarball)
-        gitdir = d.getVar("GITDIR", True) or (d.getVar("DL_DIR", True) + "/git2/")
+        ud.mirrortarball = 'git2_%s.tar.gz' % gitsrcname
+        ud.fullmirror = os.path.join(d.getVar("DL_DIR"), ud.mirrortarball)
+        gitdir = d.getVar("GITDIR") or (d.getVar("DL_DIR") + "/git2/")
         ud.clonedir = os.path.join(gitdir, gitsrcname)
 
         ud.localfile = ud.clonedir
@@ -229,7 +228,7 @@
     def try_premirror(self, ud, d):
         # If we don't do this, updating an existing checkout with only premirrors
         # is not possible
-        if d.getVar("BB_FETCH_PREMIRRORONLY", True) is not None:
+        if d.getVar("BB_FETCH_PREMIRRORONLY") is not None:
             return True
         if os.path.exists(ud.clonedir):
             return False
@@ -241,7 +240,7 @@
         # If the checkout doesn't exist and the mirror tarball does, extract it
         if not os.path.exists(ud.clonedir) and os.path.exists(ud.fullmirror):
             bb.utils.mkdirhier(ud.clonedir)
-            runfetchcmd("tar -xzf %s" % (ud.fullmirror), d, workdir=ud.clonedir)
+            runfetchcmd("tar -xzf %s" % ud.fullmirror, d, workdir=ud.clonedir)
 
         repourl = self._get_repo_url(ud)
 
@@ -252,7 +251,7 @@
                 repourl = repourl[7:]
             clone_cmd = "LANG=C %s clone --bare --mirror %s %s --progress" % (ud.basecmd, repourl, ud.clonedir)
             if ud.proto.lower() != 'file':
-                bb.fetch2.check_network_access(d, clone_cmd)
+                bb.fetch2.check_network_access(d, clone_cmd, ud.url)
             progresshandler = GitProgressHandler(d)
             runfetchcmd(clone_cmd, d, log=progresshandler)
 
@@ -292,15 +291,15 @@
                 os.unlink(ud.fullmirror)
 
             logger.info("Creating tarball of git repository")
-            runfetchcmd("tar -czf %s %s" % (ud.fullmirror, os.path.join(".") ), d, workdir=ud.clonedir)
-            runfetchcmd("touch %s.done" % (ud.fullmirror), d, workdir=ud.clonedir)
+            runfetchcmd("tar -czf %s ." % ud.fullmirror, d, workdir=ud.clonedir)
+            runfetchcmd("touch %s.done" % ud.fullmirror, d)
 
     def unpack(self, ud, destdir, d):
         """ unpack the downloaded src to destdir"""
 
         subdir = ud.parm.get("subpath", "")
         if subdir != "":
-            readpathspec = ":%s" % (subdir)
+            readpathspec = ":%s" % subdir
             def_destsuffix = "%s/" % os.path.basename(subdir.rstrip('/'))
         else:
             readpathspec = ""
@@ -380,14 +379,26 @@
         """
         Run git ls-remote with the specified search string
         """
-        repourl = self._get_repo_url(ud)
-        cmd = "%s ls-remote %s %s" % \
-              (ud.basecmd, repourl, search)
-        if ud.proto.lower() != 'file':
-            bb.fetch2.check_network_access(d, cmd)
-        output = runfetchcmd(cmd, d, True)
-        if not output:
-            raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, ud.url)
+        # Prevent recursion e.g. in OE if SRCPV is in PV, PV is in WORKDIR,
+        # and WORKDIR is in PATH (as a result of RSS), our call to
+        # runfetchcmd() exports PATH so this function will get called again (!)
+        # In this scenario the return call of the function isn't actually
+        # important - WORKDIR isn't needed in PATH to call git ls-remote
+        # anyway.
+        if d.getVar('_BB_GIT_IN_LSREMOTE', False):
+            return ''
+        d.setVar('_BB_GIT_IN_LSREMOTE', '1')
+        try:
+            repourl = self._get_repo_url(ud)
+            cmd = "%s ls-remote %s %s" % \
+                (ud.basecmd, repourl, search)
+            if ud.proto.lower() != 'file':
+                bb.fetch2.check_network_access(d, cmd, repourl)
+            output = runfetchcmd(cmd, d, True)
+            if not output:
+                raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, ud.url)
+        finally:
+            d.delVar('_BB_GIT_IN_LSREMOTE')
         return output
 
     def _latest_revision(self, ud, d, name):
@@ -418,7 +429,7 @@
         """
         pupver = ('', '')
 
-        tagregex = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX', True) or "(?P<pver>([0-9][\.|_]?)+)")
+        tagregex = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or "(?P<pver>([0-9][\.|_]?)+)")
         try:
             output = self._lsremote(ud, d, "refs/tags/*")
         except bb.fetch2.FetchError or bb.fetch2.NetworkAccess:
@@ -470,7 +481,7 @@
             if not os.path.exists(rev_file) or not os.path.getsize(rev_file):
                 from pipes import quote
                 commits = bb.fetch2.runfetchcmd(
-                        "git rev-list %s -- | wc -l" % (quote(rev)),
+                        "git rev-list %s -- | wc -l" % quote(rev),
                         d, quiet=True).strip().lstrip('0')
                 if commits:
                     open(rev_file, "w").write("%d\n" % int(commits))
@@ -485,5 +496,5 @@
         try:
             self._lsremote(ud, d, "")
             return True
-        except FetchError:
+        except bb.fetch2.FetchError:
             return False
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitannex.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitannex.py
index 4937a10..c66c211 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitannex.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitannex.py
@@ -22,7 +22,6 @@
 
 import os
 import bb
-from   bb import data
 from   bb.fetch2.git import Git
 from   bb.fetch2 import runfetchcmd
 from   bb.fetch2 import logger
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitsm.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitsm.py
index 6613762..a95584c 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitsm.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitsm.py
@@ -31,7 +31,6 @@
 
 import os
 import bb
-from   bb    import data
 from   bb.fetch2.git import Git
 from   bb.fetch2 import runfetchcmd
 from   bb.fetch2 import logger
@@ -108,7 +107,7 @@
         os.rename(ud.clonedir, gitdir)
         runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*true/bare = false/'", d)
         runfetchcmd(ud.basecmd + " reset --hard", d, workdir=tmpclonedir)
-        runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=tmpclonedir)
+        runfetchcmd(ud.basecmd + " checkout -f " + ud.revisions[ud.names[0]], d, workdir=tmpclonedir)
         runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=tmpclonedir)
         self._set_relative_paths(tmpclonedir)
         runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*false/bare = true/'", d, workdir=tmpclonedir)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/hg.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/hg.py
index 20df801..b5f2686 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/hg.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/hg.py
@@ -29,7 +29,6 @@
 import logging
 import bb
 import errno
-from bb import data
 from bb.fetch2 import FetchMethod
 from bb.fetch2 import FetchError
 from bb.fetch2 import MissingParameterError
@@ -67,7 +66,7 @@
         else:
             ud.proto = "hg"
 
-        ud.setup_revisons(d)
+        ud.setup_revisions(d)
 
         if 'rev' in ud.parm:
             ud.revision = ud.parm['rev']
@@ -78,15 +77,15 @@
         hgsrcname = '%s_%s_%s' % (ud.module.replace('/', '.'), \
                             ud.host, ud.path.replace('/', '.'))
         ud.mirrortarball = 'hg_%s.tar.gz' % hgsrcname
-        ud.fullmirror = os.path.join(d.getVar("DL_DIR", True), ud.mirrortarball)
+        ud.fullmirror = os.path.join(d.getVar("DL_DIR"), ud.mirrortarball)
 
-        hgdir = d.getVar("HGDIR", True) or (d.getVar("DL_DIR", True) + "/hg/")
+        hgdir = d.getVar("HGDIR") or (d.getVar("DL_DIR") + "/hg/")
         ud.pkgdir = os.path.join(hgdir, hgsrcname)
         ud.moddir = os.path.join(ud.pkgdir, ud.module)
         ud.localfile = ud.moddir
-        ud.basecmd = data.getVar("FETCHCMD_hg", d, True) or "/usr/bin/env hg"
+        ud.basecmd = d.getVar("FETCHCMD_hg") or "/usr/bin/env hg"
 
-        ud.write_tarballs = d.getVar("BB_GENERATE_MIRROR_TARBALLS", True)
+        ud.write_tarballs = d.getVar("BB_GENERATE_MIRROR_TARBALLS")
 
     def need_update(self, ud, d):
         revTag = ud.parm.get('rev', 'tip')
@@ -99,7 +98,7 @@
     def try_premirror(self, ud, d):
         # If we don't do this, updating an existing checkout with only premirrors
         # is not possible
-        if d.getVar("BB_FETCH_PREMIRRORONLY", True) is not None:
+        if d.getVar("BB_FETCH_PREMIRRORONLY") is not None:
             return True
         if os.path.exists(ud.moddir):
             return False
@@ -221,7 +220,7 @@
         """
         Compute tip revision for the url
         """
-        bb.fetch2.check_network_access(d, self._buildhgcommand(ud, d, "info"))
+        bb.fetch2.check_network_access(d, self._buildhgcommand(ud, d, "info"), ud.url)
         output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d)
         return output.strip()
 
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/local.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/local.py
index 51ca78d..a114ac1 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/local.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/local.py
@@ -29,7 +29,6 @@
 import urllib.request, urllib.parse, urllib.error
 import bb
 import bb.utils
-from   bb import data
 from   bb.fetch2 import FetchMethod, FetchError
 from   bb.fetch2 import logger
 
@@ -63,17 +62,11 @@
         newpath = path
         if path[0] == "/":
             return [path]
-        filespath = data.getVar('FILESPATH', d, True)
+        filespath = d.getVar('FILESPATH')
         if filespath:
             logger.debug(2, "Searching for %s in paths:\n    %s" % (path, "\n    ".join(filespath.split(":"))))
             newpath, hist = bb.utils.which(filespath, path, history=True)
             searched.extend(hist)
-        if not newpath:
-            filesdir = data.getVar('FILESDIR', d, True)
-            if filesdir:
-                logger.debug(2, "Searching for %s in path: %s" % (path, filesdir))
-                newpath = os.path.join(filesdir, path)
-                searched.append(newpath)
         if (not newpath or not os.path.exists(newpath)) and path.find("*") != -1:
             # For expressions using '*', best we can do is take the first directory in FILESPATH that exists
             newpath, hist = bb.utils.which(filespath, ".", history=True)
@@ -81,7 +74,7 @@
             logger.debug(2, "Searching for %s in path: %s" % (path, newpath))
             return searched
         if not os.path.exists(newpath):
-            dldirfile = os.path.join(d.getVar("DL_DIR", True), path)
+            dldirfile = os.path.join(d.getVar("DL_DIR"), path)
             logger.debug(2, "Defaulting to %s for %s" % (dldirfile, path))
             bb.utils.mkdirhier(os.path.dirname(dldirfile))
             searched.append(dldirfile)
@@ -100,13 +93,10 @@
         # no need to fetch local files, we'll deal with them in place.
         if self.supports_checksum(urldata) and not os.path.exists(urldata.localpath):
             locations = []
-            filespath = data.getVar('FILESPATH', d, True)
+            filespath = d.getVar('FILESPATH')
             if filespath:
                 locations = filespath.split(":")
-            filesdir = data.getVar('FILESDIR', d, True)
-            if filesdir:
-                locations.append(filesdir)
-            locations.append(d.getVar("DL_DIR", True))
+            locations.append(d.getVar("DL_DIR"))
 
             msg = "Unable to find file " + urldata.url + " anywhere. The paths that were searched were:\n    " + "\n    ".join(locations)
             raise FetchError(msg)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/npm.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/npm.py
index 699ae72..73a75fe 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/npm.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/npm.py
@@ -25,7 +25,6 @@
 import subprocess
 import signal
 import bb
-from   bb import data
 from   bb.fetch2 import FetchMethod
 from   bb.fetch2 import FetchError
 from   bb.fetch2 import ChecksumError
@@ -80,6 +79,7 @@
         if not ud.version:
             raise ParameterError("NPM fetcher requires a version parameter", ud.url)
         ud.bbnpmmanifest = "%s-%s.deps.json" % (ud.pkgname, ud.version)
+        ud.bbnpmmanifest = ud.bbnpmmanifest.replace('/', '-')
         ud.registry = "http://%s" % (ud.url.replace('npm://', '', 1).split(';'))[0]
         prefixdir = "npm/%s" % ud.pkgname
         ud.pkgdatadir = d.expand("${DL_DIR}/%s" % prefixdir)
@@ -87,12 +87,13 @@
             bb.utils.mkdirhier(ud.pkgdatadir)
         ud.localpath = d.expand("${DL_DIR}/npm/%s" % ud.bbnpmmanifest)
 
-        self.basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -O -t 2 -T 30 -nv --passive-ftp --no-check-certificate "
+        self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -O -t 2 -T 30 -nv --passive-ftp --no-check-certificate "
         ud.prefixdir = prefixdir
 
-        ud.write_tarballs = ((data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) or "0") != "0")
+        ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0") != "0")
         ud.mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version)
-        ud.fullmirror = os.path.join(d.getVar("DL_DIR", True), ud.mirrortarball)
+        ud.mirrortarball = ud.mirrortarball.replace('/', '-')
+        ud.fullmirror = os.path.join(d.getVar("DL_DIR"), ud.mirrortarball)
 
     def need_update(self, ud, d):
         if os.path.exists(ud.localpath):
@@ -101,8 +102,8 @@
 
     def _runwget(self, ud, d, command, quiet):
         logger.debug(2, "Fetching %s using command '%s'" % (ud.url, command))
-        bb.fetch2.check_network_access(d, command)
-        dldir = d.getVar("DL_DIR", True)
+        bb.fetch2.check_network_access(d, command, ud.url)
+        dldir = d.getVar("DL_DIR")
         runfetchcmd(command, d, quiet, workdir=dldir)
 
     def _unpackdep(self, ud, pkg, data, destdir, dldir, d):
@@ -116,7 +117,7 @@
         # Change to subdir before executing command
         if not os.path.exists(destdir):
             os.makedirs(destdir)
-        path = d.getVar('PATH', True)
+        path = d.getVar('PATH')
         if path:
             cmd = "PATH=\"%s\" %s" % (path, cmd)
         bb.note("Unpacking %s to %s/" % (file, destdir))
@@ -132,9 +133,8 @@
 
 
     def unpack(self, ud, destdir, d):
-        dldir = d.getVar("DL_DIR", True)
-        depdumpfile = "%s-%s.deps.json" % (ud.pkgname, ud.version)
-        with open("%s/npm/%s" % (dldir, depdumpfile)) as datafile:
+        dldir = d.getVar("DL_DIR")
+        with open("%s/npm/%s" % (dldir, ud.bbnpmmanifest)) as datafile:
             workobj = json.load(datafile)
         dldir = "%s/%s" % (os.path.dirname(ud.localpath), ud.pkgname)
 
@@ -182,7 +182,12 @@
             if pkg_os:
                 if not isinstance(pkg_os, list):
                     pkg_os = [pkg_os]
-                if 'linux' not in pkg_os or '!linux' in pkg_os:
+                blacklist = False
+                for item in pkg_os:
+                    if item.startswith('!'):
+                        blacklist = True
+                        break
+                if (not blacklist and 'linux' not in pkg_os) or '!linux' in pkg_os:
                     logger.debug(2, "Skipping %s since it's incompatible with Linux" % pkg)
                     return
         #logger.debug(2, "Output URL is %s - %s - %s" % (ud.basepath, ud.basename, ud.localfile))
@@ -195,6 +200,7 @@
 
         dependencies = pdata.get('dependencies', {})
         optionalDependencies = pdata.get('optionalDependencies', {})
+        dependencies.update(optionalDependencies)
         depsfound = {}
         optdepsfound = {}
         data[pkg]['deps'] = {}
@@ -251,24 +257,30 @@
         lockdown = {}
 
         if not os.listdir(ud.pkgdatadir) and os.path.exists(ud.fullmirror):
-            dest = d.getVar("DL_DIR", True)
+            dest = d.getVar("DL_DIR")
             bb.utils.mkdirhier(dest)
             runfetchcmd("tar -xJf %s" % (ud.fullmirror), d, workdir=dest)
             return
 
-        shwrf = d.getVar('NPM_SHRINKWRAP', True)
+        shwrf = d.getVar('NPM_SHRINKWRAP')
         logger.debug(2, "NPM shrinkwrap file is %s" % shwrf)
-        try:
-            with open(shwrf) as datafile:
-                shrinkobj = json.load(datafile)
-        except:
+        if shwrf:
+            try:
+                with open(shwrf) as datafile:
+                    shrinkobj = json.load(datafile)
+            except Exception as e:
+                raise FetchError('Error loading NPM_SHRINKWRAP file "%s" for %s: %s' % (shwrf, ud.pkgname, str(e)))
+        elif not ud.ignore_checksums:
             logger.warning('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname)
-        lckdf = d.getVar('NPM_LOCKDOWN', True)
+        lckdf = d.getVar('NPM_LOCKDOWN')
         logger.debug(2, "NPM lockdown file is %s" % lckdf)
-        try:
-            with open(lckdf) as datafile:
-                lockdown = json.load(datafile)
-        except:
+        if lckdf:
+            try:
+                with open(lckdf) as datafile:
+                    lockdown = json.load(datafile)
+            except Exception as e:
+                raise FetchError('Error loading NPM_LOCKDOWN file "%s" for %s: %s' % (lckdf, ud.pkgname, str(e)))
+        elif not ud.ignore_checksums:
             logger.warning('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname)
 
         if ('name' not in shrinkobj):
@@ -286,7 +298,7 @@
             if os.path.islink(ud.fullmirror):
                 os.unlink(ud.fullmirror)
 
-            dldir = d.getVar("DL_DIR", True)
+            dldir = d.getVar("DL_DIR")
             logger.info("Creating tarball of npm data")
             runfetchcmd("tar -cJf %s npm/%s npm/%s" % (ud.fullmirror, ud.bbnpmmanifest, ud.pkgname), d,
                         workdir=dldir)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/osc.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/osc.py
index 295abf9..2b4f7d9 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/osc.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/osc.py
@@ -10,7 +10,6 @@
 import  sys
 import logging
 import  bb
-from    bb       import data
 from    bb.fetch2 import FetchMethod
 from    bb.fetch2 import FetchError
 from    bb.fetch2 import MissingParameterError
@@ -34,7 +33,7 @@
 
         # Create paths to osc checkouts
         relpath = self._strip_leading_slashes(ud.path)
-        ud.pkgdir = os.path.join(d.getVar('OSCDIR', True), ud.host)
+        ud.pkgdir = os.path.join(d.getVar('OSCDIR'), ud.host)
         ud.moddir = os.path.join(ud.pkgdir, relpath, ud.module)
 
         if 'rev' in ud.parm:
@@ -47,7 +46,7 @@
             else:
                 ud.revision = ""
 
-        ud.localfile = data.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision), d)
+        ud.localfile = d.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision))
 
     def _buildosccommand(self, ud, d, command):
         """
@@ -55,7 +54,7 @@
         command is "fetch", "update", "info"
         """
 
-        basecmd = data.expand('${FETCHCMD_osc}', d)
+        basecmd = d.expand('${FETCHCMD_osc}')
 
         proto = ud.parm.get('protocol', 'ocs')
 
@@ -84,7 +83,7 @@
 
         logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
 
-        if os.access(os.path.join(d.getVar('OSCDIR', True), ud.path, ud.module), os.R_OK):
+        if os.access(os.path.join(d.getVar('OSCDIR'), ud.path, ud.module), os.R_OK):
             oscupdatecmd = self._buildosccommand(ud, d, "update")
             logger.info("Update "+ ud.url)
             # update sources there
@@ -112,7 +111,7 @@
         Generate a .oscrc to be used for this run.
         """
 
-        config_path = os.path.join(d.getVar('OSCDIR', True), "oscrc")
+        config_path = os.path.join(d.getVar('OSCDIR'), "oscrc")
         if (os.path.exists(config_path)):
             os.remove(config_path)
 
@@ -121,8 +120,8 @@
         f.write("apisrv = %s\n" % ud.host)
         f.write("scheme = http\n")
         f.write("su-wrapper = su -c\n")
-        f.write("build-root = %s\n" % d.getVar('WORKDIR', True))
-        f.write("urllist = %s\n" % d.getVar("OSCURLLIST", True))
+        f.write("build-root = %s\n" % d.getVar('WORKDIR'))
+        f.write("urllist = %s\n" % d.getVar("OSCURLLIST"))
         f.write("extra-pkgs = gzip\n")
         f.write("\n")
         f.write("[%s]\n" % ud.host)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/perforce.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/perforce.py
index 50cb479..3debad5 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/perforce.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/perforce.py
@@ -26,7 +26,6 @@
 import os
 import logging
 import bb
-from   bb import data
 from   bb.fetch2 import FetchMethod
 from   bb.fetch2 import FetchError
 from   bb.fetch2 import logger
@@ -44,13 +43,13 @@
         provided by the env, use it.  If P4PORT is specified by the recipe, use
         its values, which may override the settings in P4CONFIG.
         """
-        ud.basecmd = d.getVar('FETCHCMD_p4', True)
+        ud.basecmd = d.getVar('FETCHCMD_p4')
         if not ud.basecmd:
             ud.basecmd = "/usr/bin/env p4"
 
-        ud.dldir = d.getVar('P4DIR', True)
+        ud.dldir = d.getVar('P4DIR')
         if not ud.dldir:
-            ud.dldir = '%s/%s' % (d.getVar('DL_DIR', True), 'p4')
+            ud.dldir = '%s/%s' % (d.getVar('DL_DIR'), 'p4')
 
         path = ud.url.split('://')[1]
         path = path.split(';')[0]
@@ -62,7 +61,7 @@
             ud.path = path
 
         ud.usingp4config = False
-        p4port = d.getVar('P4PORT', True)
+        p4port = d.getVar('P4PORT')
 
         if p4port:
             logger.debug(1, 'Using recipe provided P4PORT: %s' % p4port)
@@ -71,7 +70,7 @@
             logger.debug(1, 'Trying to use P4CONFIG to automatically set P4PORT...')
             ud.usingp4config = True
             p4cmd = '%s info | grep "Server address"' % ud.basecmd
-            bb.fetch2.check_network_access(d, p4cmd)
+            bb.fetch2.check_network_access(d, p4cmd, ud.url)
             ud.host = runfetchcmd(p4cmd, d, True)
             ud.host = ud.host.split(': ')[1].strip()
             logger.debug(1, 'Determined P4PORT to be: %s' % ud.host)
@@ -87,9 +86,9 @@
         cleanedhost = ud.host.replace(':', '.')
         ud.pkgdir = os.path.join(ud.dldir, cleanedhost, cleanedpath)
 
-        ud.setup_revisons(d)
+        ud.setup_revisions(d)
 
-        ud.localfile = data.expand('%s_%s_%s.tar.gz' % (cleanedhost, cleanedpath, ud.revision), d)
+        ud.localfile = d.expand('%s_%s_%s.tar.gz' % (cleanedhost, cleanedpath, ud.revision))
 
     def _buildp4command(self, ud, d, command, depot_filename=None):
         """
@@ -140,7 +139,7 @@
         'p4 files' command, including trailing '#rev' file revision indicator
         """
         p4cmd = self._buildp4command(ud, d, 'files')
-        bb.fetch2.check_network_access(d, p4cmd)
+        bb.fetch2.check_network_access(d, p4cmd, ud.url)
         p4fileslist = runfetchcmd(p4cmd, d, True)
         p4fileslist = [f.rstrip() for f in p4fileslist.splitlines()]
 
@@ -171,7 +170,7 @@
 
         for afile in filelist:
             p4fetchcmd = self._buildp4command(ud, d, 'print', afile)
-            bb.fetch2.check_network_access(d, p4fetchcmd)
+            bb.fetch2.check_network_access(d, p4fetchcmd, ud.url)
             runfetchcmd(p4fetchcmd, d, workdir=ud.pkgdir)
 
         runfetchcmd('tar -czf %s p4' % (ud.localpath), d, cleanup=[ud.localpath], workdir=ud.pkgdir)
@@ -191,7 +190,7 @@
     def _latest_revision(self, ud, d, name):
         """ Return the latest upstream scm revision number """
         p4cmd = self._buildp4command(ud, d, "changes")
-        bb.fetch2.check_network_access(d, p4cmd)
+        bb.fetch2.check_network_access(d, p4cmd, ud.url)
         tip = runfetchcmd(p4cmd, d, True)
 
         if not tip:
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/repo.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/repo.py
index ecc6e68..1be91cc 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/repo.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/repo.py
@@ -25,7 +25,6 @@
 
 import os
 import bb
-from   bb    import data
 from   bb.fetch2 import FetchMethod
 from   bb.fetch2 import runfetchcmd
 
@@ -51,17 +50,17 @@
         if not ud.manifest.endswith('.xml'):
             ud.manifest += '.xml'
 
-        ud.localfile = data.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch), d)
+        ud.localfile = d.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch))
 
     def download(self, ud, d):
         """Fetch url"""
 
-        if os.access(os.path.join(data.getVar("DL_DIR", d, True), ud.localfile), os.R_OK):
+        if os.access(os.path.join(d.getVar("DL_DIR"), ud.localfile), os.R_OK):
             logger.debug(1, "%s already exists (or was stashed). Skipping repo init / sync.", ud.localpath)
             return
 
         gitsrcname = "%s%s" % (ud.host, ud.path.replace("/", "."))
-        repodir = data.getVar("REPODIR", d, True) or os.path.join(data.getVar("DL_DIR", d, True), "repo")
+        repodir = d.getVar("REPODIR") or os.path.join(d.getVar("DL_DIR"), "repo")
         codir = os.path.join(repodir, gitsrcname, ud.manifest)
 
         if ud.user:
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/s3.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/s3.py
new file mode 100644
index 0000000..1629288
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/s3.py
@@ -0,0 +1,98 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' implementation for Amazon AWS S3.
+
+Class for fetching files from Amazon S3 using the AWS Command Line Interface.
+The aws tool must be correctly installed and configured prior to use.
+
+"""
+
+# Copyright (C) 2017, Andre McCurdy <armccurdy@gmail.com>
+#
+# Based in part on bb.fetch2.wget:
+#    Copyright (C) 2003, 2004  Chris Larson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import os
+import bb
+import urllib.request, urllib.parse, urllib.error
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import runfetchcmd
+
+class S3(FetchMethod):
+    """Class to fetch urls via 'aws s3'"""
+
+    def supports(self, ud, d):
+        """
+        Check to see if a given url can be fetched with s3.
+        """
+        return ud.type in ['s3']
+
+    def recommends_checksum(self, urldata):
+        return True
+
+    def urldata_init(self, ud, d):
+        if 'downloadfilename' in ud.parm:
+            ud.basename = ud.parm['downloadfilename']
+        else:
+            ud.basename = os.path.basename(ud.path)
+
+        ud.localfile = d.expand(urllib.parse.unquote(ud.basename))
+
+        ud.basecmd = d.getVar("FETCHCMD_s3") or "/usr/bin/env aws s3"
+
+    def download(self, ud, d):
+        """
+        Fetch urls
+        Assumes localpath was called first
+        """
+
+        cmd = '%s cp s3://%s%s %s' % (ud.basecmd, ud.host, ud.path, ud.localpath)
+        bb.fetch2.check_network_access(d, cmd, ud.url)
+        runfetchcmd(cmd, d)
+
+        # Additional sanity checks copied from the wget class (although there
+        # are no known issues which mean these are required, treat the aws cli
+        # tool with a little healthy suspicion).
+
+        if not os.path.exists(ud.localpath):
+            raise FetchError("The aws cp command returned success for s3://%s%s but %s doesn't exist?!" % (ud.host, ud.path, ud.localpath))
+
+        if os.path.getsize(ud.localpath) == 0:
+            os.remove(ud.localpath)
+            raise FetchError("The aws cp command for s3://%s%s resulted in a zero size file?! Deleting and failing since this isn't right." % (ud.host, ud.path))
+
+        return True
+
+    def checkstatus(self, fetch, ud, d):
+        """
+        Check the status of a URL
+        """
+
+        cmd = '%s ls s3://%s%s' % (ud.basecmd, ud.host, ud.path)
+        bb.fetch2.check_network_access(d, cmd, ud.url)
+        output = runfetchcmd(cmd, d)
+
+        # "aws s3 ls s3://mybucket/foo" will exit with success even if the file
+        # is not found, so check output of the command to confirm success.
+
+        if not output:
+            raise FetchError("The aws ls command for s3://%s%s gave empty output" % (ud.host, ud.path))
+
+        return True
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/sftp.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/sftp.py
index 7989fcc..81884a6 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/sftp.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/sftp.py
@@ -62,12 +62,10 @@
 import os
 import bb
 import urllib.request, urllib.parse, urllib.error
-from bb import data
 from bb.fetch2 import URI
 from bb.fetch2 import FetchMethod
 from bb.fetch2 import runfetchcmd
 
-
 class SFTP(FetchMethod):
     """Class to fetch urls via 'sftp'"""
 
@@ -92,7 +90,7 @@
         else:
             ud.basename = os.path.basename(ud.path)
 
-        ud.localfile = data.expand(urllib.parse.unquote(ud.basename), d)
+        ud.localfile = d.expand(urllib.parse.unquote(ud.basename))
 
     def download(self, ud, d):
         """Fetch urls"""
@@ -104,7 +102,7 @@
             port = '-P %d' % urlo.port
             urlo.port = None
 
-        dldir = data.getVar('DL_DIR', d, True)
+        dldir = d.getVar('DL_DIR')
         lpath = os.path.join(dldir, ud.localfile)
 
         user = ''
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/ssh.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/ssh.py
index 56f9b7e..6047ee4 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/ssh.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/ssh.py
@@ -43,7 +43,6 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 import re, os
-from   bb import data
 from   bb.fetch2 import FetchMethod
 from   bb.fetch2 import FetchError
 from   bb.fetch2 import logger
@@ -87,11 +86,11 @@
         m = __pattern__.match(urldata.url)
         path = m.group('path')
         host = m.group('host')
-        urldata.localpath = os.path.join(d.getVar('DL_DIR', True),
+        urldata.localpath = os.path.join(d.getVar('DL_DIR'),
                 os.path.basename(os.path.normpath(path)))
 
     def download(self, urldata, d):
-        dldir = d.getVar('DL_DIR', True)
+        dldir = d.getVar('DL_DIR')
 
         m = __pattern__.match(urldata.url)
         path = m.group('path')
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/svn.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/svn.py
index 6ca79d3..3f172ee 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/svn.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/svn.py
@@ -28,7 +28,6 @@
 import logging
 import bb
 import re
-from   bb import data
 from   bb.fetch2 import FetchMethod
 from   bb.fetch2 import FetchError
 from   bb.fetch2 import MissingParameterError
@@ -50,7 +49,7 @@
         if not "module" in ud.parm:
             raise MissingParameterError('module', ud.url)
 
-        ud.basecmd = d.getVar('FETCHCMD_svn', True)
+        ud.basecmd = d.getVar('FETCHCMD_svn')
 
         ud.module = ud.parm["module"]
 
@@ -61,15 +60,15 @@
 
         # Create paths to svn checkouts
         relpath = self._strip_leading_slashes(ud.path)
-        ud.pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath)
+        ud.pkgdir = os.path.join(d.expand('${SVNDIR}'), ud.host, relpath)
         ud.moddir = os.path.join(ud.pkgdir, ud.module)
 
-        ud.setup_revisons(d)
+        ud.setup_revisions(d)
 
         if 'rev' in ud.parm:
             ud.revision = ud.parm['rev']
 
-        ud.localfile = data.expand('%s_%s_%s_%s_.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d)
+        ud.localfile = d.expand('%s_%s_%s_%s_.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision))
 
     def _buildsvncommand(self, ud, d, command):
         """
@@ -79,9 +78,9 @@
 
         proto = ud.parm.get('protocol', 'svn')
 
-        svn_rsh = None
-        if proto == "svn+ssh" and "rsh" in ud.parm:
-            svn_rsh = ud.parm["rsh"]
+        svn_ssh = None
+        if proto == "svn+ssh" and "ssh" in ud.parm:
+            svn_ssh = ud.parm["ssh"]
 
         svnroot = ud.host + ud.path
 
@@ -113,8 +112,8 @@
             else:
                 raise FetchError("Invalid svn command %s" % command, ud.url)
 
-        if svn_rsh:
-            svncmd = "svn_RSH=\"%s\" %s" % (svn_rsh, svncmd)
+        if svn_ssh:
+            svncmd = "SVN_SSH=\"%s\" %s" % (svn_ssh, svncmd)
 
         return svncmd
 
@@ -173,7 +172,7 @@
         """
         Return the latest upstream revision number
         """
-        bb.fetch2.check_network_access(d, self._buildsvncommand(ud, d, "log1"))
+        bb.fetch2.check_network_access(d, self._buildsvncommand(ud, d, "log1"), ud.url)
 
         output = runfetchcmd("LANG=C LC_ALL=C " + self._buildsvncommand(ud, d, "log1"), d, True)
 
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/wget.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/wget.py
index 23d48ac..ae0ffa8 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/wget.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/wget.py
@@ -33,7 +33,6 @@
 import bb
 import bb.progress
 import urllib.request, urllib.parse, urllib.error
-from   bb import data
 from   bb.fetch2 import FetchMethod
 from   bb.fetch2 import FetchError
 from   bb.fetch2 import logger
@@ -84,18 +83,18 @@
         else:
             ud.basename = os.path.basename(ud.path)
 
-        ud.localfile = data.expand(urllib.parse.unquote(ud.basename), d)
+        ud.localfile = d.expand(urllib.parse.unquote(ud.basename))
         if not ud.localfile:
-            ud.localfile = data.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", "."), d)
+            ud.localfile = d.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", "."))
 
-        self.basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate"
+        self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate"
 
     def _runwget(self, ud, d, command, quiet):
 
         progresshandler = WgetProgressHandler(d)
 
         logger.debug(2, "Fetching %s using command '%s'" % (ud.url, command))
-        bb.fetch2.check_network_access(d, command)
+        bb.fetch2.check_network_access(d, command, ud.url)
         runfetchcmd(command + ' --progress=dot -v', d, quiet, log=progresshandler)
 
     def download(self, ud, d):
@@ -104,7 +103,7 @@
         fetchcmd = self.basecmd
 
         if 'downloadfilename' in ud.parm:
-            dldir = d.getVar("DL_DIR", True)
+            dldir = d.getVar("DL_DIR")
             bb.utils.mkdirhier(os.path.dirname(dldir + os.sep + ud.localfile))
             fetchcmd += " -O " + dldir + os.sep + ud.localfile
 
@@ -304,12 +303,24 @@
             r = urllib.request.Request(uri)
             r.get_method = lambda: "HEAD"
 
-            if ud.user:
+            def add_basic_auth(login_str, request):
+                '''Adds Basic auth to http request, pass in login:password as string'''
                 import base64
-                encodeuser = base64.b64encode(ud.user.encode('utf-8')).decode("utf-8")
+                encodeuser = base64.b64encode(login_str.encode('utf-8')).decode("utf-8")
                 authheader =  "Basic %s" % encodeuser
                 r.add_header("Authorization", authheader)
 
+            if ud.user:
+                add_basic_auth(ud.user, r)
+
+            try:
+                import netrc, urllib.parse
+                n = netrc.netrc()
+                login, unused, password = n.authenticators(urllib.parse.urlparse(uri).hostname)
+                add_basic_auth("%s:%s" % (login, password), r)
+            except (TypeError, ImportError, IOError, netrc.NetrcParseError):
+                 pass
+
             opener.open(r)
         except urllib.error.URLError as e:
             if try_again:
@@ -534,7 +545,7 @@
 
         # src.rpm extension was added only for rpm package. Can be removed if the rpm
         # packaged will always be considered as having to be manually upgraded
-        psuffix_regex = "(tar\.gz|tgz|tar\.bz2|zip|xz|rpm|bz2|orig\.tar\.gz|tar\.xz|src\.tar\.gz|src\.tgz|svnr\d+\.tar\.bz2|stable\.tar\.gz|src\.rpm)"
+        psuffix_regex = "(tar\.gz|tgz|tar\.bz2|zip|xz|tar\.lz|rpm|bz2|orig\.tar\.gz|tar\.xz|src\.tar\.gz|src\.tgz|svnr\d+\.tar\.bz2|stable\.tar\.gz|src\.rpm)"
 
         # match name, version and archive type of a package
         package_regex_comp = re.compile("(?P<name>%s?\.?v?)(?P<pver>%s)(?P<arch>%s)?[\.-](?P<type>%s$)"
@@ -542,7 +553,7 @@
         self.suffix_regex_comp = re.compile(psuffix_regex)
 
         # compile regex, can be specific by package or generic regex
-        pn_regex = d.getVar('UPSTREAM_CHECK_REGEX', True)
+        pn_regex = d.getVar('UPSTREAM_CHECK_REGEX')
         if pn_regex:
             package_custom_regex_comp = re.compile(pn_regex)
         else:
@@ -563,7 +574,7 @@
         sanity check to ensure same name and type.
         """
         package = ud.path.split("/")[-1]
-        current_version = ['', d.getVar('PV', True), '']
+        current_version = ['', d.getVar('PV'), '']
 
         """possible to have no version in pkg name, such as spectrum-fw"""
         if not re.search("\d+", package):
@@ -578,7 +589,7 @@
         bb.debug(3, "latest_versionstring, regex: %s" % (package_regex.pattern))
 
         uri = ""
-        regex_uri = d.getVar("UPSTREAM_CHECK_URI", True)
+        regex_uri = d.getVar("UPSTREAM_CHECK_URI")
         if not regex_uri:
             path = ud.path.split(package)[0]
 
@@ -587,7 +598,7 @@
             dirver_regex = re.compile("(?P<dirver>[^/]*(\d+\.)*\d+([-_]r\d+)*)/")
             m = dirver_regex.search(path)
             if m:
-                pn = d.getVar('PN', True)
+                pn = d.getVar('PN')
                 dirver = m.group('dirver')
 
                 dirver_pn_regex = re.compile("%s\d?" % (re.escape(pn)))
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/main.py b/import-layers/yocto-poky/bitbake/lib/bb/main.py
index f2f59f6..8c948c2 100755
--- a/import-layers/yocto-poky/bitbake/lib/bb/main.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/main.py
@@ -174,13 +174,24 @@
                           help="Read the specified file after bitbake.conf.")
 
         parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
-                          help="Output more log message data to the terminal.")
+                          help="Enable tracing of shell tasks (with 'set -x'). "
+                               "Also print bb.note(...) messages to stdout (in "
+                               "addition to writing them to ${T}/log.do_<task>).")
 
         parser.add_option("-D", "--debug", action="count", dest="debug", default=0,
-                          help="Increase the debug level. You can specify this more than once.")
+                          help="Increase the debug level. You can specify this "
+                               "more than once. -D sets the debug level to 1, "
+                               "where only bb.debug(1, ...) messages are printed "
+                               "to stdout; -DD sets the debug level to 2, where "
+                               "both bb.debug(1, ...) and bb.debug(2, ...) "
+                               "messages are printed; etc. Without -D, no debug "
+                               "messages are printed. Note that -D only affects "
+                               "output to stdout. All debug messages are written "
+                               "to ${T}/log.do_taskname, regardless of the debug "
+                               "level.")
 
-        parser.add_option("-q", "--quiet", action="store_true", dest="quiet", default=False,
-                          help="Output less log message data to the terminal.")
+        parser.add_option("-q", "--quiet", action="count", dest="quiet", default=0,
+                          help="Output less log message data to the terminal. You can specify this more than once.")
 
         parser.add_option("-n", "--dry-run", action="store_true", dest="dry_run", default=False,
                           help="Don't execute, just go through the motions.")
@@ -287,6 +298,9 @@
                           help="Writes the event log of the build to a bitbake event json file. "
                                "Use '' (empty string) to assign the name automatically.")
 
+        parser.add_option("", "--runall", action="store", dest="runall",
+                          help="Run the specified task for all build targets and their dependencies.")
+
         options, targets = parser.parse_args(argv)
 
         if options.quiet and options.verbose:
@@ -367,6 +381,7 @@
         raise
     if not configParams.foreground:
         server.detach()
+        cooker.shutdown()
     cooker.lock.close()
     return server
 
@@ -389,12 +404,8 @@
     except:
         pass
 
-
     configuration.setConfigParameters(configParams)
 
-    ui_module = import_extension_module(bb.ui, configParams.ui, 'main')
-    servermodule = import_extension_module(bb.server, configParams.servertype, 'BitBakeServer')
-
     if configParams.server_only:
         if configParams.servertype != "xmlrpc":
             raise BBMainException("FATAL: If '--server-only' is defined, we must set the "
@@ -442,66 +453,11 @@
     bb.msg.init_msgconfig(configParams.verbose, configuration.debug,
                           configuration.debug_domains)
 
-    # Ensure logging messages get sent to the UI as events
-    handler = bb.event.LogHandler()
-    if not configParams.status_only:
-        # In status only mode there are no logs and no UI
-        logger.addHandler(handler)
-
-    # Clear away any spurious environment variables while we stoke up the cooker
-    cleanedvars = bb.utils.clean_environment()
-
-    featureset = []
-    if not configParams.server_only:
-        # Collect the feature set for the UI
-        featureset = getattr(ui_module, "featureSet", [])
-
-    if configParams.server_only:
-        for param in ('prefile', 'postfile'):
-            value = getattr(configParams, param)
-            if value:
-                setattr(configuration, "%s_server" % param, value)
-                param = "%s_server" % param
-
-    if not configParams.remote_server:
-        # we start a server with a given configuration
-        server = start_server(servermodule, configParams, configuration, featureset)
-        bb.event.ui_queue = []
-    else:
-        if os.getenv('BBSERVER') == 'autostart':
-            if configParams.remote_server == 'autostart' or \
-               not servermodule.check_connection(configParams.remote_server, timeout=2):
-                configParams.bind = 'localhost:0'
-                srv = start_server(servermodule, configParams, configuration, featureset)
-                configParams.remote_server = '%s:%d' % tuple(configuration.interface)
-                bb.event.ui_queue = []
-
-        # we start a stub server that is actually a XMLRPClient that connects to a real server
-        server = servermodule.BitBakeXMLRPCClient(configParams.observe_only,
-                                                  configParams.xmlrpctoken)
-        server.saveConnectionDetails(configParams.remote_server)
-
+    server, server_connection, ui_module = setup_bitbake(configParams, configuration)
+    if server_connection is None and configParams.kill_server:
+        return 0
 
     if not configParams.server_only:
-        try:
-            server_connection = server.establishConnection(featureset)
-        except Exception as e:
-            bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e)))
-
-        if configParams.kill_server:
-            server_connection.connection.terminateServer()
-            bb.event.ui_queue = []
-            return 0
-
-        server_connection.setupEventQueue()
-
-        # Restore the environment in case the UI needs it
-        for k in cleanedvars:
-            os.environ[k] = cleanedvars[k]
-
-        logger.removeHandler(handler)
-
-
         if configParams.status_only:
             server_connection.terminate()
             return 0
@@ -520,3 +476,77 @@
         return 0
 
     return 1
+
+def setup_bitbake(configParams, configuration, extrafeatures=None):
+    # Ensure logging messages get sent to the UI as events
+    handler = bb.event.LogHandler()
+    if not configParams.status_only:
+        # In status only mode there are no logs and no UI
+        logger.addHandler(handler)
+
+    # Clear away any spurious environment variables while we stoke up the cooker
+    cleanedvars = bb.utils.clean_environment()
+
+    if configParams.server_only:
+        featureset = []
+        ui_module = None
+    else:
+        ui_module = import_extension_module(bb.ui, configParams.ui, 'main')
+        # Collect the feature set for the UI
+        featureset = getattr(ui_module, "featureSet", [])
+
+    if configParams.server_only:
+        for param in ('prefile', 'postfile'):
+            value = getattr(configParams, param)
+            if value:
+                setattr(configuration, "%s_server" % param, value)
+                param = "%s_server" % param
+
+    if extrafeatures:
+        for feature in extrafeatures:
+            if not feature in featureset:
+                featureset.append(feature)
+
+    servermodule = import_extension_module(bb.server,
+                                            configParams.servertype,
+                                            'BitBakeServer')
+    if configParams.remote_server:
+        if os.getenv('BBSERVER') == 'autostart':
+            if configParams.remote_server == 'autostart' or \
+               not servermodule.check_connection(configParams.remote_server, timeout=2):
+                configParams.bind = 'localhost:0'
+                srv = start_server(servermodule, configParams, configuration, featureset)
+                configParams.remote_server = '%s:%d' % tuple(configuration.interface)
+                bb.event.ui_queue = []
+        # we start a stub server that is actually a XMLRPClient that connects to a real server
+        from bb.server.xmlrpc import BitBakeXMLRPCClient
+        server = servermodule.BitBakeXMLRPCClient(configParams.observe_only,
+                                                  configParams.xmlrpctoken)
+        server.saveConnectionDetails(configParams.remote_server)
+    else:
+        # we start a server with a given configuration
+        server = start_server(servermodule, configParams, configuration, featureset)
+        bb.event.ui_queue = []
+
+    if configParams.server_only:
+        server_connection = None
+    else:
+        try:
+            server_connection = server.establishConnection(featureset)
+        except Exception as e:
+            bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e)))
+
+        if configParams.kill_server:
+            server_connection.connection.terminateServer()
+            bb.event.ui_queue = []
+            return None, None, None
+
+        server_connection.setupEventQueue()
+
+        # Restore the environment in case the UI needs it
+        for k in cleanedvars:
+            os.environ[k] = cleanedvars[k]
+
+        logger.removeHandler(handler)
+
+    return server, server_connection, ui_module
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/monitordisk.py b/import-layers/yocto-poky/bitbake/lib/bb/monitordisk.py
index 203c405..833cd3d 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/monitordisk.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/monitordisk.py
@@ -129,7 +129,7 @@
             bb.utils.mkdirhier(path)
         dev = getMountedDev(path)
         # Use path/action as the key
-        devDict[os.path.join(path, action)] = [dev, minSpace, minInode]
+        devDict[(path, action)] = [dev, minSpace, minInode]
 
     return devDict
 
@@ -141,7 +141,7 @@
     spaceDefault = 50 * 1024 * 1024
     inodeDefault = 5 * 1024
 
-    interval = configuration.getVar("BB_DISKMON_WARNINTERVAL", True)
+    interval = configuration.getVar("BB_DISKMON_WARNINTERVAL")
     if not interval:
         return spaceDefault, inodeDefault
     else:
@@ -179,7 +179,7 @@
         self.enableMonitor = False
         self.configuration = configuration
 
-        BBDirs = configuration.getVar("BB_DISKMON_DIRS", True) or None
+        BBDirs = configuration.getVar("BB_DISKMON_DIRS") or None
         if BBDirs:
             self.devDict = getDiskData(BBDirs, configuration)
             if self.devDict:
@@ -205,18 +205,21 @@
         """ Take action for the monitor """
 
         if self.enableMonitor:
-            for k in self.devDict:
-                path = os.path.dirname(k)
-                action = os.path.basename(k)
-                dev = self.devDict[k][0]
-                minSpace = self.devDict[k][1]
-                minInode = self.devDict[k][2]
+            diskUsage = {}
+            for k, attributes in self.devDict.items():
+                path, action = k
+                dev, minSpace, minInode = attributes
 
                 st = os.statvfs(path)
 
-                # The free space, float point number
+                # The available free space, integer number
                 freeSpace = st.f_bavail * st.f_frsize
 
+                # Send all relevant information in the event.
+                freeSpaceRoot = st.f_bfree * st.f_frsize
+                totalSpace = st.f_blocks * st.f_frsize
+                diskUsage[dev] = bb.event.DiskUsageSample(freeSpace, freeSpaceRoot, totalSpace)
+
                 if minSpace and freeSpace < minSpace:
                     # Always show warning, the self.checked would always be False if the action is WARN
                     if self.preFreeS[k] == 0 or self.preFreeS[k] - freeSpace > self.spaceInterval and not self.checked[k]:
@@ -235,7 +238,7 @@
                         rq.finish_runqueue(True)
                         bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration)
 
-                # The free inodes, float point number
+                # The free inodes, integer number
                 freeInode = st.f_favail
 
                 if minInode and freeInode < minInode:
@@ -260,4 +263,6 @@
                         self.checked[k] = True
                         rq.finish_runqueue(True)
                         bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration)
+
+            bb.event.fire(bb.event.MonitorDiskEvent(diskUsage), self.configuration)
         return
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/msg.py b/import-layers/yocto-poky/bitbake/lib/bb/msg.py
index b7c39fa..90b1582 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/msg.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/msg.py
@@ -201,3 +201,18 @@
         logger = logging.getLogger("BitBake")
     logger.critical(msg)
     sys.exit(1)
+
+def logger_create(name, output=sys.stderr, level=logging.INFO, preserve_handlers=False, color='auto'):
+    """Standalone logger creation function"""
+    logger = logging.getLogger(name)
+    console = logging.StreamHandler(output)
+    format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+    if color == 'always' or (color == 'auto' and output.isatty()):
+        format.enable_color()
+    console.setFormatter(format)
+    if preserve_handlers:
+        logger.addHandler(console)
+    else:
+        logger.handlers = [console]
+    logger.setLevel(level)
+    return logger
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/parse/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/parse/__init__.py
index 26ae7ea..a2952ec 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/parse/__init__.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/parse/__init__.py
@@ -123,7 +123,7 @@
 
 def resolve_file(fn, d):
     if not os.path.isabs(fn):
-        bbpath = d.getVar("BBPATH", True)
+        bbpath = d.getVar("BBPATH")
         newfn, attempts = bb.utils.which(bbpath, fn, history=True)
         for af in attempts:
             mark_dependency(d, af)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/parse/ast.py b/import-layers/yocto-poky/bitbake/lib/bb/parse/ast.py
index fa83b18..dba4540 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/parse/ast.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/parse/ast.py
@@ -30,8 +30,6 @@
 from bb import methodpool
 from bb.parse import logger
 
-_bbversions_re = re.compile(r"\[(?P<from>[0-9]+)-(?P<to>[0-9]+)\]")
-
 class StatementGroup(list):
     def eval(self, data):
         for statement in self:
@@ -132,7 +130,6 @@
                 val = groupd["value"]
         elif "colon" in groupd and groupd["colon"] != None:
             e = data.createCopy()
-            bb.data.update_data(e)
             op = "immediate"
             val = e.expand(groupd["value"], key + "[:=]")
         elif "append" in groupd and groupd["append"] != None:
@@ -347,19 +344,18 @@
         if not handlerfn:
             bb.fatal("Undefined event handler function '%s'" % var)
         handlerln = int(d.getVarFlag(var, "lineno", False))
-        bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask", True) or "").split(), handlerfn, handlerln)
+        bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln)
 
     bb.event.fire(bb.event.RecipePreFinalise(fn), d)
 
     bb.data.expandKeys(d)
-    bb.data.update_data(d)
     code = []
     for funcname in d.getVar("__BBANONFUNCS", False) or []:
         code.append("%s(d)" % funcname)
     bb.utils.better_exec("\n".join(code), {"d": d})
-    bb.data.update_data(d)
 
     tasklist = d.getVar('__BBTASKS', False) or []
+    bb.event.fire(bb.event.RecipeTaskPreProcess(fn, list(tasklist)), d)
     bb.build.add_tasks(tasklist, d)
 
     bb.parse.siggen.finalise(fn, d, variant)
@@ -385,29 +381,8 @@
             else:
                 create_variant("%s-%s" % (variant, name), datastores[variant], name)
 
-def _expand_versions(versions):
-    def expand_one(version, start, end):
-        for i in range(start, end + 1):
-            ver = _bbversions_re.sub(str(i), version, 1)
-            yield ver
-
-    versions = iter(versions)
-    while True:
-        try:
-            version = next(versions)
-        except StopIteration:
-            break
-
-        range_ver = _bbversions_re.search(version)
-        if not range_ver:
-            yield version
-        else:
-            newversions = expand_one(version, int(range_ver.group("from")),
-                                     int(range_ver.group("to")))
-            versions = itertools.chain(newversions, versions)
-
 def multi_finalize(fn, d):
-    appends = (d.getVar("__BBAPPEND", True) or "").split()
+    appends = (d.getVar("__BBAPPEND") or "").split()
     for append in appends:
         logger.debug(1, "Appending .bbappend file %s to %s", append, fn)
         bb.parse.BBHandler.handle(append, d, True)
@@ -422,51 +397,7 @@
         d.setVar("__SKIPPED", e.args[0])
     datastores = {"": safe_d}
 
-    versions = (d.getVar("BBVERSIONS", True) or "").split()
-    if versions:
-        pv = orig_pv = d.getVar("PV", True)
-        baseversions = {}
-
-        def verfunc(ver, d, pv_d = None):
-            if pv_d is None:
-                pv_d = d
-
-            overrides = d.getVar("OVERRIDES", True).split(":")
-            pv_d.setVar("PV", ver)
-            overrides.append(ver)
-            bpv = baseversions.get(ver) or orig_pv
-            pv_d.setVar("BPV", bpv)
-            overrides.append(bpv)
-            d.setVar("OVERRIDES", ":".join(overrides))
-
-        versions = list(_expand_versions(versions))
-        for pos, version in enumerate(list(versions)):
-            try:
-                pv, bpv = version.split(":", 2)
-            except ValueError:
-                pass
-            else:
-                versions[pos] = pv
-                baseversions[pv] = bpv
-
-        if pv in versions and not baseversions.get(pv):
-            versions.remove(pv)
-        else:
-            pv = versions.pop()
-
-            # This is necessary because our existing main datastore
-            # has already been finalized with the old PV, we need one
-            # that's been finalized with the new PV.
-            d = bb.data.createCopy(safe_d)
-            verfunc(pv, d, safe_d)
-            try:
-                finalize(fn, d)
-            except bb.parse.SkipRecipe as e:
-                d.setVar("__SKIPPED", e.args[0])
-
-        _create_variants(datastores, versions, verfunc, onlyfinalise)
-
-    extended = d.getVar("BBCLASSEXTEND", True) or ""
+    extended = d.getVar("BBCLASSEXTEND") or ""
     if extended:
         # the following is to support bbextends with arguments, for e.g. multilib
         # an example is as follows:
@@ -484,7 +415,7 @@
             else:
                 extendedmap[ext] = ext
 
-        pn = d.getVar("PN", True)
+        pn = d.getVar("PN")
         def extendfunc(name, d):
             if name != extendedmap[name]:
                 d.setVar("BBEXTENDCURR", extendedmap[name])
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/BBHandler.py b/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
index c54a079..fe918a4 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -66,7 +66,7 @@
             file = os.path.join('classes', '%s.bbclass' % file)
 
         if not os.path.isabs(file):
-            bbpath = d.getVar("BBPATH", True)
+            bbpath = d.getVar("BBPATH")
             abs_fn, attempts = bb.utils.which(bbpath, file, history=True)
             for af in attempts:
                 if af != abs_fn:
@@ -87,17 +87,17 @@
     try:
         return cached_statements[absolute_filename]
     except KeyError:
-        file = open(absolute_filename, 'r')
-        statements = ast.StatementGroup()
+        with open(absolute_filename, 'r') as f:
+            statements = ast.StatementGroup()
 
-        lineno = 0
-        while True:
-            lineno = lineno + 1
-            s = file.readline()
-            if not s: break
-            s = s.rstrip()
-            feeder(lineno, s, filename, base_name, statements)
-        file.close()
+            lineno = 0
+            while True:
+                lineno = lineno + 1
+                s = f.readline()
+                if not s: break
+                s = s.rstrip()
+                feeder(lineno, s, filename, base_name, statements)
+
         if __inpython__:
             # add a blank line to close out any python definition
             feeder(lineno, "", filename, base_name, statements, eof=True)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index 875250d..f7d0cf7 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -33,7 +33,7 @@
 __config_regexp__  = re.compile( r"""
     ^
     (?P<exp>export\s*)?
-    (?P<var>[a-zA-Z0-9\-~_+.${}/]+?)
+    (?P<var>[a-zA-Z0-9\-_+.${}/~]+?)
     (\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?
 
     \s* (
@@ -56,9 +56,9 @@
     """, re.X)
 __include_regexp__ = re.compile( r"include\s+(.+)" )
 __require_regexp__ = re.compile( r"require\s+(.+)" )
-__export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" )
-__unset_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/]+)$" )
-__unset_flag_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/]+)\[([a-zA-Z0-9\-_+.${}/]+)\]$" )
+__export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/~]+)$" )
+__unset_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)$" )
+__unset_flag_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)\[([a-zA-Z0-9\-_+.]+)\]$" )
 
 def init(data):
     topdir = data.getVar('TOPDIR', False)
@@ -83,16 +83,16 @@
 
     if not os.path.isabs(fn):
         dname = os.path.dirname(parentfn)
-        bbpath = "%s:%s" % (dname, data.getVar("BBPATH", True))
+        bbpath = "%s:%s" % (dname, data.getVar("BBPATH"))
         abs_fn, attempts = bb.utils.which(bbpath, fn, history=True)
         if abs_fn and bb.parse.check_dependency(data, abs_fn):
-            logger.warning("Duplicate inclusion for %s in %s" % (abs_fn, data.getVar('FILE', True)))
+            logger.warning("Duplicate inclusion for %s in %s" % (abs_fn, data.getVar('FILE')))
         for af in attempts:
             bb.parse.mark_dependency(data, af)
         if abs_fn:
             fn = abs_fn
     elif bb.parse.check_dependency(data, fn):
-        logger.warning("Duplicate inclusion for %s in %s" % (fn, data.getVar('FILE', True)))
+        logger.warning("Duplicate inclusion for %s in %s" % (fn, data.getVar('FILE')))
 
     try:
         bb.parse.handle(fn, data, True)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/persist_data.py b/import-layers/yocto-poky/bitbake/lib/bb/persist_data.py
index bb6deca..bef7018 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/persist_data.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/persist_data.py
@@ -28,11 +28,7 @@
 import warnings
 from bb.compat import total_ordering
 from collections import Mapping
-
-try:
-    import sqlite3
-except ImportError:
-    from pysqlite2 import dbapi2 as sqlite3
+import sqlite3
 
 sqlversion = sqlite3.sqlite_version_info
 if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
@@ -207,8 +203,8 @@
 def persist(domain, d):
     """Convenience factory for SQLTable objects based upon metadata"""
     import bb.utils
-    cachedir = (d.getVar("PERSISTENT_DIR", True) or
-                d.getVar("CACHE", True))
+    cachedir = (d.getVar("PERSISTENT_DIR") or
+                d.getVar("CACHE"))
     if not cachedir:
         logger.critical("Please set the 'PERSISTENT_DIR' or 'CACHE' variable")
         sys.exit(1)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/process.py b/import-layers/yocto-poky/bitbake/lib/bb/process.py
index c62d7bc..a4a5599 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/process.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/process.py
@@ -162,9 +162,9 @@
         stdout, stderr = _logged_communicate(pipe, log, input, extrafiles)
     else:
         stdout, stderr = pipe.communicate(input)
-        if stdout:
+        if not stdout is None:
             stdout = stdout.decode("utf-8")
-        if stderr:
+        if not stderr is None:
             stderr = stderr.decode("utf-8")
 
     if pipe.returncode != 0:
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/providers.py b/import-layers/yocto-poky/bitbake/lib/bb/providers.py
index db02a0b..443187e 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/providers.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/providers.py
@@ -48,7 +48,6 @@
 
     # Need to ensure data store is expanded
     localdata = data.createCopy(cfgData)
-    bb.data.update_data(localdata)
     bb.data.expandKeys(localdata)
 
     preferred_versions = {}
@@ -123,11 +122,11 @@
 
     # pn can contain '_', e.g. gcc-cross-x86_64 and an override cannot
     # hence we do this manually rather than use OVERRIDES
-    preferred_v = cfgData.getVar("PREFERRED_VERSION_pn-%s" % pn, True)
+    preferred_v = cfgData.getVar("PREFERRED_VERSION_pn-%s" % pn)
     if not preferred_v:
-        preferred_v = cfgData.getVar("PREFERRED_VERSION_%s" % pn, True)
+        preferred_v = cfgData.getVar("PREFERRED_VERSION_%s" % pn)
     if not preferred_v:
-        preferred_v = cfgData.getVar("PREFERRED_VERSION", True)
+        preferred_v = cfgData.getVar("PREFERRED_VERSION")
 
     if preferred_v:
         m = re.match('(\d+:)*(.*)(_.*)*', preferred_v)
@@ -289,7 +288,7 @@
 
     eligible = _filterProviders(providers, item, cfgData, dataCache)
 
-    prefervar = cfgData.getVar('PREFERRED_PROVIDER_%s' % item, True)
+    prefervar = cfgData.getVar('PREFERRED_PROVIDER_%s' % item)
     if prefervar:
         dataCache.preferred[item] = prefervar
 
@@ -318,7 +317,7 @@
     eligible = _filterProviders(providers, item, cfgData, dataCache)
 
     # First try and match any PREFERRED_RPROVIDER entry
-    prefervar = cfgData.getVar('PREFERRED_RPROVIDER_%s' % item, True)
+    prefervar = cfgData.getVar('PREFERRED_RPROVIDER_%s' % item)
     foundUnique = False
     if prefervar:
         for p in eligible:
@@ -345,7 +344,7 @@
             pn = dataCache.pkg_fn[p]
             provides = dataCache.pn_provides[pn]
             for provide in provides:
-                prefervar = cfgData.getVar('PREFERRED_PROVIDER_%s' % provide, True)
+                prefervar = cfgData.getVar('PREFERRED_PROVIDER_%s' % provide)
                 #logger.debug(1, "checking PREFERRED_PROVIDER_%s (value %s) against %s", provide, prefervar, pns.keys())
                 if prefervar in pns and pns[prefervar] not in preferred:
                     var = "PREFERRED_PROVIDER_%s = %s" % (provide, prefervar)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/remotedata.py b/import-layers/yocto-poky/bitbake/lib/bb/remotedata.py
new file mode 100644
index 0000000..68ecffc
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/remotedata.py
@@ -0,0 +1,116 @@
+"""
+BitBake 'remotedata' module
+
+Provides support for using a datastore from the bitbake client
+"""
+
+# Copyright (C) 2016  Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import bb.data
+
+class RemoteDatastores:
+    """Used on the server side to manage references to server-side datastores"""
+    def __init__(self, cooker):
+        self.cooker = cooker
+        self.datastores = {}
+        self.locked = []
+        self.nextindex = 1
+
+    def __len__(self):
+        return len(self.datastores)
+
+    def __getitem__(self, key):
+        if key is None:
+            return self.cooker.data
+        else:
+            return self.datastores[key]
+
+    def items(self):
+        return self.datastores.items()
+
+    def store(self, d, locked=False):
+        """
+        Put a datastore into the collection. If locked=True then the datastore
+        is understood to be managed externally and cannot be released by calling
+        release().
+        """
+        idx = self.nextindex
+        self.datastores[idx] = d
+        if locked:
+            self.locked.append(idx)
+        self.nextindex += 1
+        return idx
+
+    def check_store(self, d, locked=False):
+        """
+        Put a datastore into the collection if it's not already in there;
+        in either case return the index
+        """
+        for key, val in self.datastores.items():
+            if val is d:
+                idx = key
+                break
+        else:
+            idx = self.store(d, locked)
+        return idx
+
+    def release(self, idx):
+        """Discard a datastore in the collection"""
+        if idx in self.locked:
+            raise Exception('Tried to release locked datastore %d' % idx)
+        del self.datastores[idx]
+
+    def receive_datastore(self, remote_data):
+        """Receive a datastore object sent from the client (as prepared by transmit_datastore())"""
+        dct = dict(remote_data)
+        d = bb.data_smart.DataSmart()
+        d.dict = dct
+        while True:
+            if '_remote_data' in dct:
+                dsindex = dct['_remote_data']['_content']
+                del dct['_remote_data']
+                if dsindex is None:
+                    dct['_data'] = self.cooker.data.dict
+                else:
+                    dct['_data'] = self.datastores[dsindex].dict
+                break
+            elif '_data' in dct:
+                idct = dict(dct['_data'])
+                dct['_data'] = idct
+                dct = idct
+            else:
+                break
+        return d
+
+    @staticmethod
+    def transmit_datastore(d):
+        """Prepare a datastore object for sending over IPC from the client end"""
+        # FIXME content might be a dict, need to turn that into a list as well
+        def copy_dicts(dct):
+            if '_remote_data' in dct:
+                dsindex = dct['_remote_data']['_content'].dsindex
+                newdct = dct.copy()
+                newdct['_remote_data'] = {'_content': dsindex}
+                return list(newdct.items())
+            elif '_data' in dct:
+                newdct = dct.copy()
+                newdata = copy_dicts(dct['_data'])
+                if newdata:
+                    newdct['_data'] = newdata
+                return list(newdct.items())
+            return None
+        main_dict = copy_dicts(d.dict)
+        return main_dict
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/runqueue.py b/import-layers/yocto-poky/bitbake/lib/bb/runqueue.py
index 9384c72..7d2ff81 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/runqueue.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/runqueue.py
@@ -36,6 +36,7 @@
 from bb import monitordisk
 import subprocess
 import pickle
+from multiprocessing import Process
 
 bblogger = logging.getLogger("BitBake")
 logger = logging.getLogger("BitBake.RunQueue")
@@ -183,6 +184,18 @@
     def newbuilable(self, task):
         self.buildable.append(task)
 
+    def describe_task(self, taskid):
+        result = 'ID %s' % taskid
+        if self.rev_prio_map:
+            result = result + (' pri %d' % self.rev_prio_map[taskid])
+        return result
+
+    def dump_prio(self, comment):
+        bb.debug(3, '%s (most important first):\n%s' %
+                 (comment,
+                  '\n'.join(['%d. %s' % (index + 1, self.describe_task(taskid)) for
+                             index, taskid in enumerate(self.prio_map)])))
+
 class RunQueueSchedulerSpeed(RunQueueScheduler):
     """
     A scheduler optimised for speed. The priority map is sorted by task weight,
@@ -212,35 +225,100 @@
 
 class RunQueueSchedulerCompletion(RunQueueSchedulerSpeed):
     """
-    A scheduler optimised to complete .bb files are quickly as possible. The
+    A scheduler optimised to complete .bb files as quickly as possible. The
     priority map is sorted by task weight, but then reordered so once a given
-    .bb file starts to build, it's completed as quickly as possible. This works
-    well where disk space is at a premium and classes like OE's rm_work are in
-    force.
+    .bb file starts to build, it's completed as quickly as possible by
+    running all tasks related to the same .bb file one after the after.
+    This works well where disk space is at a premium and classes like OE's
+    rm_work are in force.
     """
     name = "completion"
 
     def __init__(self, runqueue, rqdata):
-        RunQueueSchedulerSpeed.__init__(self, runqueue, rqdata)
+        super(RunQueueSchedulerCompletion, self).__init__(runqueue, rqdata)
 
-        #FIXME - whilst this groups all fns together it does not reorder the
-        #fn groups optimally.
+        # Extract list of tasks for each recipe, with tasks sorted
+        # ascending from "must run first" (typically do_fetch) to
+        # "runs last" (do_build). The speed scheduler prioritizes
+        # tasks that must run first before the ones that run later;
+        # this is what we depend on here.
+        task_lists = {}
+        for taskid in self.prio_map:
+            fn, taskname = taskid.rsplit(':', 1)
+            task_lists.setdefault(fn, []).append(taskname)
 
-        basemap = copy.deepcopy(self.prio_map)
-        self.prio_map = []
-        while (len(basemap) > 0):
-            entry = basemap.pop(0)
-            self.prio_map.append(entry)
-            fn = fn_from_tid(entry)
-            todel = []
-            for entry in basemap:
-                entry_fn = fn_from_tid(entry)
-                if entry_fn == fn:
-                    todel.append(basemap.index(entry))
-                    self.prio_map.append(entry)
-            todel.reverse()
-            for idx in todel:
-                del basemap[idx]
+        # Now unify the different task lists. The strategy is that
+        # common tasks get skipped and new ones get inserted after the
+        # preceeding common one(s) as they are found. Because task
+        # lists should differ only by their number of tasks, but not
+        # the ordering of the common tasks, this should result in a
+        # deterministic result that is a superset of the individual
+        # task ordering.
+        all_tasks = []
+        for recipe, new_tasks in task_lists.items():
+            index = 0
+            old_task = all_tasks[index] if index < len(all_tasks) else None
+            for new_task in new_tasks:
+                if old_task == new_task:
+                    # Common task, skip it. This is the fast-path which
+                    # avoids a full search.
+                    index += 1
+                    old_task = all_tasks[index] if index < len(all_tasks) else None
+                else:
+                    try:
+                        index = all_tasks.index(new_task)
+                        # Already present, just not at the current
+                        # place. We re-synchronized by changing the
+                        # index so that it matches again. Now
+                        # move on to the next existing task.
+                        index += 1
+                        old_task = all_tasks[index] if index < len(all_tasks) else None
+                    except ValueError:
+                        # Not present. Insert before old_task, which
+                        # remains the same (but gets shifted back).
+                        all_tasks.insert(index, new_task)
+                        index += 1
+        bb.debug(3, 'merged task list: %s'  % all_tasks)
+
+        # Now reverse the order so that tasks that finish the work on one
+        # recipe are considered more imporant (= come first). The ordering
+        # is now so that do_build is most important.
+        all_tasks.reverse()
+
+        # Group tasks of the same kind before tasks of less important
+        # kinds at the head of the queue (because earlier = lower
+        # priority number = runs earlier), while preserving the
+        # ordering by recipe. If recipe foo is more important than
+        # bar, then the goal is to work on foo's do_populate_sysroot
+        # before bar's do_populate_sysroot and on the more important
+        # tasks of foo before any of the less important tasks in any
+        # other recipe (if those other recipes are more important than
+        # foo).
+        #
+        # All of this only applies when tasks are runable. Explicit
+        # dependencies still override this ordering by priority.
+        #
+        # Here's an example why this priority re-ordering helps with
+        # minimizing disk usage. Consider a recipe foo with a higher
+        # priority than bar where foo DEPENDS on bar. Then the
+        # implicit rule (from base.bbclass) is that foo's do_configure
+        # depends on bar's do_populate_sysroot. This ensures that
+        # bar's do_populate_sysroot gets done first. Normally the
+        # tasks from foo would continue to run once that is done, and
+        # bar only gets completed and cleaned up later. By ordering
+        # bar's task that depend on bar's do_populate_sysroot before foo's
+        # do_configure, that problem gets avoided.
+        task_index = 0
+        self.dump_prio('original priorities')
+        for task in all_tasks:
+            for index in range(task_index, self.numTasks):
+                taskid = self.prio_map[index]
+                taskname = taskid.rsplit(':', 1)[1]
+                if taskname == task:
+                    del self.prio_map[index]
+                    self.prio_map.insert(task_index, taskid)
+                    task_index += 1
+        self.dump_prio('completion priorities')
 
 class RunTaskEntry(object):
     def __init__(self):
@@ -262,10 +340,11 @@
         self.rq = rq
         self.warn_multi_bb = False
 
-        self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST", True) or ""
-        self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
+        self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST") or ""
+        self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST") or "").split()
         self.setscenewhitelist = get_setscene_enforce_whitelist(cfgData)
         self.setscenewhitelist_checked = False
+        self.setscene_enforce = (cfgData.getVar('BB_SETSCENE_ENFORCE') == "1")
         self.init_progress_reporter = bb.progress.DummyMultiStageProcessProgressReporter()
 
         self.reset()
@@ -565,6 +644,8 @@
                 for (depname, idependtask) in irdepends:
                     if depname in taskData[mc].run_targets:
                         # Won't be in run_targets if ASSUME_PROVIDED
+                        if not taskData[mc].run_targets[depname]:
+                            continue
                         depdata = taskData[mc].run_targets[depname][0]
                         if depdata is not None:
                             t = depdata + ":" + idependtask
@@ -616,6 +697,9 @@
                 seendeps.add(t)
                 newdeps.add(t)
                 for i in newdeps:
+                    if i not in self.runtaskentries:
+                        # Not all recipes might have the recrdeptask task as a task
+                        continue
                     task = self.runtaskentries[i].task
                     for n in self.runtaskentries[i].depends:
                         if n not in seendeps:
@@ -722,6 +806,23 @@
 
         self.init_progress_reporter.next_stage()
 
+        if self.cooker.configuration.runall is not None:
+            runall = "do_%s" % self.cooker.configuration.runall
+            runall_tids = { k: v for k, v in self.runtaskentries.items() if taskname_from_tid(k) == runall }
+
+            # re-run the mark_active and then drop unused tasks from new list
+            runq_build = {}
+            for tid in list(runall_tids):
+                mark_active(tid,1)
+
+            for tid in list(self.runtaskentries.keys()):
+                if tid not in runq_build:
+                    del self.runtaskentries[tid]
+                    delcount += 1
+
+            if len(self.runtaskentries) == 0:
+                bb.msg.fatal("RunQueue", "No remaining tasks to run for build target %s with runall %s" % (target, runall))
+
         #
         # Step D - Sanity checks and computation
         #
@@ -976,16 +1077,22 @@
         self.cfgData = cfgData
         self.rqdata = RunQueueData(self, cooker, cfgData, dataCaches, taskData, targets)
 
-        self.stamppolicy = cfgData.getVar("BB_STAMP_POLICY", True) or "perfile"
-        self.hashvalidate = cfgData.getVar("BB_HASHCHECK_FUNCTION", True) or None
-        self.setsceneverify = cfgData.getVar("BB_SETSCENE_VERIFY_FUNCTION2", True) or None
-        self.depvalidate = cfgData.getVar("BB_SETSCENE_DEPVALID", True) or None
+        self.stamppolicy = cfgData.getVar("BB_STAMP_POLICY") or "perfile"
+        self.hashvalidate = cfgData.getVar("BB_HASHCHECK_FUNCTION") or None
+        self.setsceneverify = cfgData.getVar("BB_SETSCENE_VERIFY_FUNCTION2") or None
+        self.depvalidate = cfgData.getVar("BB_SETSCENE_DEPVALID") or None
 
         self.state = runQueuePrepare
 
         # For disk space monitor
+        # Invoked at regular time intervals via the bitbake heartbeat event
+        # while the build is running. We generate a unique name for the handler
+        # here, just in case that there ever is more than one RunQueue instance,
+        # start the handler when reaching runQueueSceneRun, and stop it when
+        # done with the build.
         self.dm = monitordisk.diskMonitor(cfgData)
-
+        self.dm_event_handler_name = '_bb_diskmonitor_' + str(id(self))
+        self.dm_event_handler_registered = False
         self.rqexe = None
         self.worker = {}
         self.fakeworker = {}
@@ -998,8 +1105,8 @@
         if fakeroot:
             magic = magic + "beef"
             mcdata = self.cooker.databuilder.mcdata[mc]
-            fakerootcmd = mcdata.getVar("FAKEROOTCMD", True)
-            fakerootenv = (mcdata.getVar("FAKEROOTBASEENV", True) or "").split()
+            fakerootcmd = mcdata.getVar("FAKEROOTCMD")
+            fakerootenv = (mcdata.getVar("FAKEROOTBASEENV") or "").split()
             env = os.environ.copy()
             for key, value in (var.split('=') for var in fakerootenv):
                 env[key] = value
@@ -1025,12 +1132,13 @@
             "logdefaultverboselogs" : bb.msg.loggerVerboseLogs,
             "logdefaultdomain" : bb.msg.loggerDefaultDomains,
             "prhost" : self.cooker.prhost,
-            "buildname" : self.cfgData.getVar("BUILDNAME", True),
-            "date" : self.cfgData.getVar("DATE", True),
-            "time" : self.cfgData.getVar("TIME", True),
+            "buildname" : self.cfgData.getVar("BUILDNAME"),
+            "date" : self.cfgData.getVar("DATE"),
+            "time" : self.cfgData.getVar("TIME"),
         }
 
         worker.stdin.write(b"<cookerconfig>" + pickle.dumps(self.cooker.configuration) + b"</cookerconfig>")
+        worker.stdin.write(b"<extraconfigdata>" + pickle.dumps(self.cooker.extraconfigdata) + b"</extraconfigdata>")
         worker.stdin.write(b"<workerdata>" + pickle.dumps(workerdata) + b"</workerdata>")
         worker.stdin.flush()
 
@@ -1208,10 +1316,12 @@
                 self.rqdata.init_progress_reporter.next_stage()
                 self.rqexe = RunQueueExecuteScenequeue(self)
 
-        if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp]:
-            self.dm.check(self)
-
         if self.state is runQueueSceneRun:
+            if not self.dm_event_handler_registered:
+                 res = bb.event.register(self.dm_event_handler_name,
+                                         lambda x: self.dm.check(self) if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp] else False,
+                                         ('bb.event.HeartbeatEvent',))
+                 self.dm_event_handler_registered = True
             retval = self.rqexe.execute()
 
         if self.state is runQueueRunInit:
@@ -1230,7 +1340,13 @@
         if self.state is runQueueCleanUp:
             retval = self.rqexe.finish()
 
-        if (self.state is runQueueComplete or self.state is runQueueFailed) and self.rqexe:
+        build_done = self.state is runQueueComplete or self.state is runQueueFailed
+
+        if build_done and self.dm_event_handler_registered:
+            bb.event.remove(self.dm_event_handler_name, None)
+            self.dm_event_handler_registered = False
+
+        if build_done and self.rqexe:
             self.teardown_workers()
             if self.rqexe.stats.failed:
                 logger.info("Tasks Summary: Attempted %d tasks of which %d didn't need to be rerun and %d failed.", self.rqexe.stats.completed + self.rqexe.stats.failed, self.rqexe.stats.skipped, self.rqexe.stats.failed)
@@ -1287,15 +1403,36 @@
         else:
             self.rqexe.finish()
 
-    def dump_signatures(self, options):
-        done = set()
-        bb.note("Reparsing files to collect dependency data")
+    def rq_dump_sigfn(self, fn, options):
         bb_cache = bb.cache.NoCache(self.cooker.databuilder)
+        the_data = bb_cache.loadDataFull(fn, self.cooker.collection.get_file_appends(fn))
+        siggen = bb.parse.siggen
+        dataCaches = self.rqdata.dataCaches
+        siggen.dump_sigfn(fn, dataCaches, options)
+
+    def dump_signatures(self, options):
+        fns = set()
+        bb.note("Reparsing files to collect dependency data")
+
         for tid in self.rqdata.runtaskentries:
             fn = fn_from_tid(tid)
-            if fn not in done:
-                the_data = bb_cache.loadDataFull(fn, self.cooker.collection.get_file_appends(fn))
-                done.add(fn)
+            fns.add(fn)
+
+        max_process = int(self.cfgData.getVar("BB_NUMBER_PARSE_THREADS") or os.cpu_count() or 1)
+        # We cannot use the real multiprocessing.Pool easily due to some local data
+        # that can't be pickled. This is a cheap multi-process solution.
+        launched = []
+        while fns:
+            if len(launched) < max_process:
+                p = Process(target=self.rq_dump_sigfn, args=(fns.pop(), options))
+                p.start()
+                launched.append(p)
+            for q in launched:
+                # The finished processes are joined when calling is_alive()
+                if not q.is_alive():
+                    launched.remove(q)
+        for p in launched:
+                p.join()
 
         bb.parse.siggen.dump_sigs(self.rqdata.dataCaches, options)
 
@@ -1326,7 +1463,7 @@
             sq_hash.append(self.rqdata.runtaskentries[tid].hash)
             sq_taskname.append(taskname)
             sq_task.append(tid)
-        locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.expanded_data }
+        locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data }
         try:
             call = self.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=True)"
             valid = bb.utils.better_eval(call, locs)
@@ -1427,8 +1564,8 @@
         self.cfgData = rq.cfgData
         self.rqdata = rq.rqdata
 
-        self.number_tasks = int(self.cfgData.getVar("BB_NUMBER_THREADS", True) or 1)
-        self.scheduler = self.cfgData.getVar("BB_SCHEDULER", True) or "speed"
+        self.number_tasks = int(self.cfgData.getVar("BB_NUMBER_THREADS") or 1)
+        self.scheduler = self.cfgData.getVar("BB_SCHEDULER") or "speed"
 
         self.runq_buildable = set()
         self.runq_running = set()
@@ -1510,7 +1647,7 @@
             pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
             taskdata[dep] = [pn, taskname, fn]
         call = self.rq.depvalidate + "(task, taskdata, notneeded, d)"
-        locs = { "task" : task, "taskdata" : taskdata, "notneeded" : self.scenequeue_notneeded, "d" : self.cooker.expanded_data }
+        locs = { "task" : task, "taskdata" : taskdata, "notneeded" : self.scenequeue_notneeded, "d" : self.cooker.data }
         valid = bb.utils.better_eval(call, locs)
         return valid
 
@@ -1578,7 +1715,7 @@
                 invalidtasks.append(tid)
 
             call = self.rq.setsceneverify + "(covered, tasknames, fns, d, invalidtasks=invalidtasks)"
-            locs = { "covered" : self.rq.scenequeue_covered, "tasknames" : tasknames, "fns" : fns, "d" : self.cooker.expanded_data, "invalidtasks" : invalidtasks }
+            locs = { "covered" : self.rq.scenequeue_covered, "tasknames" : tasknames, "fns" : fns, "d" : self.cooker.data, "invalidtasks" : invalidtasks }
             covered_remove = bb.utils.better_eval(call, locs)
 
         def removecoveredtask(tid):
@@ -1630,7 +1767,7 @@
                              if type(obj) is type and
                                 issubclass(obj, RunQueueScheduler))
 
-        user_schedulers = self.cfgData.getVar("BB_SCHEDULERS", True)
+        user_schedulers = self.cfgData.getVar("BB_SCHEDULERS")
         if user_schedulers:
             for sched in user_schedulers.split():
                 if not "." in sched:
@@ -1775,7 +1912,7 @@
                 bb.event.fire(startevent, self.cfgData)
                 self.runq_running.add(task)
                 self.stats.taskActive()
-                if not self.cooker.configuration.dry_run:
+                if not (self.cooker.configuration.dry_run or self.rqdata.setscene_enforce):
                     bb.build.make_stamp(taskname, self.rqdata.dataCaches[mc], taskfn)
                 self.task_complete(task)
                 return True
@@ -1786,7 +1923,7 @@
             taskdepdata = self.build_taskdepdata(task)
 
             taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
-            if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not self.cooker.configuration.dry_run:
+            if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not (self.cooker.configuration.dry_run or self.rqdata.setscene_enforce):
                 if not mc in self.rq.fakeworker:
                     try:
                         self.rq.start_fakeworker(self, mc)
@@ -1795,10 +1932,10 @@
                         self.rq.state = runQueueFailed
                         self.stats.taskFailed()
                         return True
-                self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, False, self.cooker.collection.get_file_appends(fn), taskdepdata)) + b"</runtask>")
+                self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, False, self.cooker.collection.get_file_appends(fn), taskdepdata, self.rqdata.setscene_enforce)) + b"</runtask>")
                 self.rq.fakeworker[mc].process.stdin.flush()
             else:
-                self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, False, self.cooker.collection.get_file_appends(taskfn), taskdepdata)) + b"</runtask>")
+                self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, False, self.cooker.collection.get_file_appends(taskfn), taskdepdata, self.rqdata.setscene_enforce)) + b"</runtask>")
                 self.rq.worker[mc].process.stdin.flush()
 
             self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True)
@@ -1839,7 +1976,8 @@
                 pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
                 deps = self.rqdata.runtaskentries[revdep].depends
                 provides = self.rqdata.dataCaches[mc].fn_provides[taskfn]
-                taskdepdata[revdep] = [pn, taskname, fn, deps, provides]
+                taskhash = self.rqdata.runtaskentries[revdep].hash
+                taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash]
                 for revdep2 in deps:
                     if revdep2 not in taskdepdata:
                         additional.append(revdep2)
@@ -1892,6 +2030,8 @@
         for tid in self.rqdata.runq_setscene_tids:
             #bb.warn("Added endpoint 2 %s" % (tid))
             for dep in self.rqdata.runtaskentries[tid].depends:
+                    if tid in sq_revdeps[dep]:
+                        sq_revdeps[dep].remove(tid)
                     if dep not in endpoints:
                         endpoints[dep] = set()
                     #bb.warn("  Added endpoint 3 %s" % (dep))
@@ -1911,12 +2051,13 @@
                 if point in self.rqdata.runq_setscene_tids:
                     sq_revdeps_new[point] = tasks
                     tasks = set()
+                    continue
                 for dep in self.rqdata.runtaskentries[point].depends:
                     if point in sq_revdeps[dep]:
                         sq_revdeps[dep].remove(point)
                     if tasks:
                         sq_revdeps_new[dep] |= tasks
-                    if (len(sq_revdeps[dep]) == 0 or len(sq_revdeps_new[dep]) != 0) and dep not in self.rqdata.runq_setscene_tids:
+                    if len(sq_revdeps[dep]) == 0 and dep not in self.rqdata.runq_setscene_tids:
                         newendpoints[dep] = task
             if len(newendpoints) != 0:
                 process_endpoints(newendpoints)
@@ -2072,7 +2213,7 @@
                 sq_taskname.append(taskname)
                 sq_task.append(tid)
             call = self.rq.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d)"
-            locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.expanded_data }
+            locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data }
             valid = bb.utils.better_eval(call, locs)
 
             valid_new = stamppresent
@@ -2199,14 +2340,16 @@
             startevent = sceneQueueTaskStarted(task, self.stats, self.rq)
             bb.event.fire(startevent, self.cfgData)
 
+            taskdepdata = self.build_taskdepdata(task)
+
             taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
             if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not self.cooker.configuration.dry_run:
                 if not mc in self.rq.fakeworker:
                     self.rq.start_fakeworker(self, mc)
-                self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), None)) + b"</runtask>")
+                self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata, False)) + b"</runtask>")
                 self.rq.fakeworker[mc].process.stdin.flush()
             else:
-                self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), None)) + b"</runtask>")
+                self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata, False)) + b"</runtask>")
                 self.rq.worker[mc].process.stdin.flush()
 
             self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True)
@@ -2241,6 +2384,44 @@
     def runqueue_process_waitpid(self, task, status):
         RunQueueExecute.runqueue_process_waitpid(self, task, status)
 
+
+    def build_taskdepdata(self, task):
+        def getsetscenedeps(tid):
+            deps = set()
+            (mc, fn, taskname, _) = split_tid_mcfn(tid)
+            realtid = tid + "_setscene"
+            idepends = self.rqdata.taskData[mc].taskentries[realtid].idepends
+            for (depname, idependtask) in idepends:
+                if depname not in self.rqdata.taskData[mc].build_targets:
+                    continue
+
+                depfn = self.rqdata.taskData[mc].build_targets[depname][0]
+                if depfn is None:
+                     continue
+                deptid = depfn + ":" + idependtask.replace("_setscene", "")
+                deps.add(deptid)
+            return deps
+
+        taskdepdata = {}
+        next = getsetscenedeps(task)
+        next.add(task)
+        while next:
+            additional = []
+            for revdep in next:
+                (mc, fn, taskname, taskfn) = split_tid_mcfn(revdep)
+                pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
+                deps = getsetscenedeps(revdep)
+                provides = self.rqdata.dataCaches[mc].fn_provides[taskfn]
+                taskhash = self.rqdata.runtaskentries[revdep].hash
+                taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash]
+                for revdep2 in deps:
+                    if revdep2 not in taskdepdata:
+                        additional.append(revdep2)
+            next = additional
+
+        #bb.note("Task %s: " % task + str(taskdepdata).replace("], ", "],\n"))
+        return taskdepdata
+
 class TaskFailure(Exception):
     """
     Exception raised when a task in a runqueue fails
@@ -2406,9 +2587,9 @@
         self.input.close()
 
 def get_setscene_enforce_whitelist(d):
-    if d.getVar('BB_SETSCENE_ENFORCE', True) != '1':
+    if d.getVar('BB_SETSCENE_ENFORCE') != '1':
         return None
-    whitelist = (d.getVar("BB_SETSCENE_ENFORCE_WHITELIST", True) or "").split()
+    whitelist = (d.getVar("BB_SETSCENE_ENFORCE_WHITELIST") or "").split()
     outlist = []
     for item in whitelist[:]:
         if item.startswith('%:'):
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/server/process.py b/import-layers/yocto-poky/bitbake/lib/bb/server/process.py
index 982fcf7..c3c1450 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/server/process.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/server/process.py
@@ -92,6 +92,8 @@
         self.event = EventAdapter(event_queue)
         self.featurelist = featurelist
         self.quit = False
+        self.heartbeat_seconds = 1 # default, BB_HEARTBEAT_EVENT will be checked once we have a datastore.
+        self.next_heartbeat = time.time()
 
         self.quitin, self.quitout = Pipe()
         self.event_handle = multiprocessing.Value("i")
@@ -101,6 +103,14 @@
             self.event_queue.put(event)
         self.event_handle.value = bb.event.register_UIHhandler(self, True)
 
+        heartbeat_event = self.cooker.data.getVar('BB_HEARTBEAT_EVENT')
+        if heartbeat_event:
+            try:
+                self.heartbeat_seconds = float(heartbeat_event)
+            except:
+                # Throwing an exception here causes bitbake to hang.
+                # Just warn about the invalid setting and continue
+                bb.warn('Ignoring invalid BB_HEARTBEAT_EVENT=%s, must be a float specifying seconds.' % heartbeat_event)
         bb.cooker.server_main(self.cooker, self.main)
 
     def main(self):
@@ -160,6 +170,21 @@
                 del self._idlefuns[function]
                 self.quit = True
 
+        # Create new heartbeat event?
+        now = time.time()
+        if now >= self.next_heartbeat:
+            # We might have missed heartbeats. Just trigger once in
+            # that case and continue after the usual delay.
+            self.next_heartbeat += self.heartbeat_seconds
+            if self.next_heartbeat <= now:
+                self.next_heartbeat = now + self.heartbeat_seconds
+            heartbeat = bb.event.HeartbeatEvent(now)
+            bb.event.fire(heartbeat, self.cooker.data)
+        if nextsleep and now + nextsleep > self.next_heartbeat:
+            # Shorten timeout so that we we wake up in time for
+            # the heartbeat.
+            nextsleep = self.next_heartbeat - now
+
         if nextsleep is not None:
             select.select(fds,[],[],nextsleep)
 
@@ -199,7 +224,6 @@
                 if isinstance(event, logging.LogRecord):
                     logger.handle(event)
 
-        signal.signal(signal.SIGINT, signal.SIG_IGN)
         self.procserver.stop()
 
         while self.procserver.is_alive():
@@ -209,6 +233,9 @@
         self.ui_channel.close()
         self.event_queue.close()
         self.event_queue.setexit()
+        # XXX: Call explicity close in _writer to avoid
+        # fd leakage because isn't called on Queue.close()
+        self.event_queue._writer.close()
 
 # Wrap Queue to provide API which isn't server implementation specific
 class ProcessEventQueue(multiprocessing.queues.Queue):
@@ -240,7 +267,6 @@
                 sys.exit(1)
             return None
 
-
 class BitBakeServer(BitBakeBaseServer):
     def initServer(self, single_use=True):
         # establish communication channels.  We use bidirectional pipes for
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/server/xmlrpc.py b/import-layers/yocto-poky/bitbake/lib/bb/server/xmlrpc.py
index 452f14b..a06007f 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/server/xmlrpc.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/server/xmlrpc.py
@@ -190,7 +190,7 @@
         self.send_header("Content-type", "text/plain")
         self.send_header("Content-length", str(len(response)))
         self.end_headers()
-        self.wfile.write(response)
+        self.wfile.write(bytes(response, 'utf-8'))
 
 
 class XMLRPCProxyServer(BaseImplServer):
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/siggen.py b/import-layers/yocto-poky/bitbake/lib/bb/siggen.py
index 542bbb9..f71190a 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/siggen.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/siggen.py
@@ -5,6 +5,8 @@
 import tempfile
 import pickle
 import bb.data
+import difflib
+import simplediff
 from bb.checksum import FileChecksumCache
 
 logger = logging.getLogger('BitBake.SigGen')
@@ -13,7 +15,7 @@
     siggens = [obj for obj in globals().values()
                       if type(obj) is type and issubclass(obj, SignatureGenerator)]
 
-    desired = d.getVar("BB_SIGNATURE_HANDLER", True) or "noop"
+    desired = d.getVar("BB_SIGNATURE_HANDLER") or "noop"
     for sg in siggens:
         if desired == sg.name:
             return sg(d)
@@ -82,10 +84,10 @@
         self.gendeps = {}
         self.lookupcache = {}
         self.pkgnameextract = re.compile("(?P<fn>.*)\..*")
-        self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST", True) or "").split())
+        self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST") or "").split())
         self.taskwhitelist = None
         self.init_rundepcheck(data)
-        checksum_cache_file = data.getVar("BB_HASH_CHECKSUM_CACHE_FILE", True)
+        checksum_cache_file = data.getVar("BB_HASH_CHECKSUM_CACHE_FILE")
         if checksum_cache_file:
             self.checksum_cache = FileChecksumCache()
             self.checksum_cache.init_cache(data, checksum_cache_file)
@@ -93,7 +95,7 @@
             self.checksum_cache = None
 
     def init_rundepcheck(self, data):
-        self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None
+        self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST") or None
         if self.taskwhitelist:
             self.twl = re.compile(self.taskwhitelist)
         else:
@@ -101,6 +103,7 @@
 
     def _build_data(self, fn, d):
 
+        ignore_mismatch = ((d.getVar("BB_HASH_IGNORE_MISMATCH") or '') == '1')
         tasklist, gendeps, lookupcache = bb.data.generate_dependencies(d)
 
         taskdeps = {}
@@ -135,7 +138,7 @@
                     data = data + str(var)
             datahash = hashlib.md5(data.encode("utf-8")).hexdigest()
             k = fn + "." + task
-            if k in self.basehash and self.basehash[k] != datahash:
+            if not ignore_mismatch and k in self.basehash and self.basehash[k] != datahash:
                 bb.error("When reparsing %s, the basehash value changed from %s to %s. The metadata is not deterministic and this needs to be fixed." % (k, self.basehash[k], datahash))
             self.basehash[k] = datahash
             taskdeps[task] = alldeps
@@ -154,13 +157,15 @@
 
         try:
             taskdeps = self._build_data(fn, d)
+        except bb.parse.SkipRecipe:
+            raise
         except:
             bb.warn("Error during finalise of %s" % fn)
             raise
 
         #Slow but can be useful for debugging mismatched basehashes
         #for task in self.taskdeps[fn]:
-        #    self.dump_sigtask(fn, task, d.getVar("STAMP", True), False)
+        #    self.dump_sigtask(fn, task, d.getVar("STAMP"), False)
 
         for task in taskdeps:
             d.setVar("BB_BASEHASH_task-%s" % task, self.basehash[fn + "." + task])
@@ -306,8 +311,8 @@
                 pass
             raise err
 
-    def dump_sigs(self, dataCaches, options):
-        for fn in self.taskdeps:
+    def dump_sigfn(self, fn, dataCaches, options):
+        if fn in self.taskdeps:
             for task in self.taskdeps[fn]:
                 tid = fn + ":" + task
                 (mc, _, _) = bb.runqueue.split_tid(tid)
@@ -345,16 +350,67 @@
 
 def dump_this_task(outfile, d):
     import bb.parse
-    fn = d.getVar("BB_FILENAME", True)
-    task = "do_" + d.getVar("BB_CURRENTTASK", True)
+    fn = d.getVar("BB_FILENAME")
+    task = "do_" + d.getVar("BB_CURRENTTASK")
     referencestamp = bb.build.stamp_internal(task, d, None, True)
     bb.parse.siggen.dump_sigtask(fn, task, outfile, "customfile:" + referencestamp)
 
+def init_colors(enable_color):
+    """Initialise colour dict for passing to compare_sigfiles()"""
+    # First set up the colours
+    colors = {'color_title':   '\033[1;37;40m',
+              'color_default': '\033[0;37;40m',
+              'color_add':     '\033[1;32;40m',
+              'color_remove':  '\033[1;31;40m',
+             }
+    # Leave all keys present but clear the values
+    if not enable_color:
+        for k in colors.keys():
+            colors[k] = ''
+    return colors
+
+def worddiff_str(oldstr, newstr, colors=None):
+    if not colors:
+        colors = init_colors(False)
+    diff = simplediff.diff(oldstr.split(' '), newstr.split(' '))
+    ret = []
+    for change, value in diff:
+        value = ' '.join(value)
+        if change == '=':
+            ret.append(value)
+        elif change == '+':
+            item = '{color_add}{{+{value}+}}{color_default}'.format(value=value, **colors)
+            ret.append(item)
+        elif change == '-':
+            item = '{color_remove}[-{value}-]{color_default}'.format(value=value, **colors)
+            ret.append(item)
+    whitespace_note = ''
+    if oldstr != newstr and ' '.join(oldstr.split()) == ' '.join(newstr.split()):
+        whitespace_note = ' (whitespace changed)'
+    return '"%s"%s' % (' '.join(ret), whitespace_note)
+
+def list_inline_diff(oldlist, newlist, colors=None):
+    if not colors:
+        colors = init_colors(False)
+    diff = simplediff.diff(oldlist, newlist)
+    ret = []
+    for change, value in diff:
+        value = ' '.join(value)
+        if change == '=':
+            ret.append("'%s'" % value)
+        elif change == '+':
+            item = '{color_add}+{value}{color_default}'.format(value=value, **colors)
+            ret.append(item)
+        elif change == '-':
+            item = '{color_remove}-{value}{color_default}'.format(value=value, **colors)
+            ret.append(item)
+    return '[%s]' % (', '.join(ret))
+
 def clean_basepath(a):
     mc = None
     if a.startswith("multiconfig:"):
         _, mc, a = a.split(":", 2)
-    b = a.rsplit("/", 2)[1] + a.rsplit("/", 2)[2]
+    b = a.rsplit("/", 2)[1] + '/' + a.rsplit("/", 2)[2]
     if a.startswith("virtual:"):
         b = b + ":" + a.rsplit(":", 1)[0]
     if mc:
@@ -373,9 +429,26 @@
         b.append(clean_basepath(x))
     return b
 
-def compare_sigfiles(a, b, recursecb = None):
+def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False):
     output = []
 
+    colors = init_colors(color)
+    def color_format(formatstr, **values):
+        """
+        Return colour formatted string.
+        NOTE: call with the format string, not an already formatted string
+        containing values (otherwise you could have trouble with { and }
+        characters)
+        """
+        if not formatstr.endswith('{color_default}'):
+            formatstr += '{color_default}'
+        # In newer python 3 versions you can pass both of these directly,
+        # but we only require 3.4 at the moment
+        formatparams = {}
+        formatparams.update(colors)
+        formatparams.update(values)
+        return formatstr.format(**formatparams)
+
     with open(a, 'rb') as f:
         p1 = pickle.Unpickler(f)
         a_data = p1.load()
@@ -429,39 +502,59 @@
         return changed, added, removed
 
     if 'basewhitelist' in a_data and a_data['basewhitelist'] != b_data['basewhitelist']:
-        output.append("basewhitelist changed from '%s' to '%s'" % (a_data['basewhitelist'], b_data['basewhitelist']))
+        output.append(color_format("{color_title}basewhitelist changed{color_default} from '%s' to '%s'") % (a_data['basewhitelist'], b_data['basewhitelist']))
         if a_data['basewhitelist'] and b_data['basewhitelist']:
             output.append("changed items: %s" % a_data['basewhitelist'].symmetric_difference(b_data['basewhitelist']))
 
     if 'taskwhitelist' in a_data and a_data['taskwhitelist'] != b_data['taskwhitelist']:
-        output.append("taskwhitelist changed from '%s' to '%s'" % (a_data['taskwhitelist'], b_data['taskwhitelist']))
+        output.append(color_format("{color_title}taskwhitelist changed{color_default} from '%s' to '%s'") % (a_data['taskwhitelist'], b_data['taskwhitelist']))
         if a_data['taskwhitelist'] and b_data['taskwhitelist']:
             output.append("changed items: %s" % a_data['taskwhitelist'].symmetric_difference(b_data['taskwhitelist']))
 
     if a_data['taskdeps'] != b_data['taskdeps']:
-        output.append("Task dependencies changed from:\n%s\nto:\n%s" % (sorted(a_data['taskdeps']), sorted(b_data['taskdeps'])))
+        output.append(color_format("{color_title}Task dependencies changed{color_default} from:\n%s\nto:\n%s") % (sorted(a_data['taskdeps']), sorted(b_data['taskdeps'])))
 
-    if a_data['basehash'] != b_data['basehash']:
-        output.append("basehash changed from %s to %s" % (a_data['basehash'], b_data['basehash']))
+    if a_data['basehash'] != b_data['basehash'] and not collapsed:
+        output.append(color_format("{color_title}basehash changed{color_default} from %s to %s") % (a_data['basehash'], b_data['basehash']))
 
     changed, added, removed = dict_diff(a_data['gendeps'], b_data['gendeps'], a_data['basewhitelist'] & b_data['basewhitelist'])
     if changed:
         for dep in changed:
-            output.append("List of dependencies for variable %s changed from '%s' to '%s'" % (dep, a_data['gendeps'][dep], b_data['gendeps'][dep]))
+            output.append(color_format("{color_title}List of dependencies for variable %s changed from '{color_default}%s{color_title}' to '{color_default}%s{color_title}'") % (dep, a_data['gendeps'][dep], b_data['gendeps'][dep]))
             if a_data['gendeps'][dep] and b_data['gendeps'][dep]:
                 output.append("changed items: %s" % a_data['gendeps'][dep].symmetric_difference(b_data['gendeps'][dep]))
     if added:
         for dep in added:
-            output.append("Dependency on variable %s was added" % (dep))
+            output.append(color_format("{color_title}Dependency on variable %s was added") % (dep))
     if removed:
         for dep in removed:
-            output.append("Dependency on Variable %s was removed" % (dep))
+            output.append(color_format("{color_title}Dependency on Variable %s was removed") % (dep))
 
 
     changed, added, removed = dict_diff(a_data['varvals'], b_data['varvals'])
     if changed:
         for dep in changed:
-            output.append("Variable %s value changed from '%s' to '%s'" % (dep, a_data['varvals'][dep], b_data['varvals'][dep]))
+            oldval = a_data['varvals'][dep]
+            newval = b_data['varvals'][dep]
+            if newval and oldval and ('\n' in oldval or '\n' in newval):
+                diff = difflib.unified_diff(oldval.splitlines(), newval.splitlines(), lineterm='')
+                # Cut off the first two lines, since we aren't interested in
+                # the old/new filename (they are blank anyway in this case)
+                difflines = list(diff)[2:]
+                if color:
+                    # Add colour to diff output
+                    for i, line in enumerate(difflines):
+                        if line.startswith('+'):
+                            line = color_format('{color_add}{line}', line=line)
+                            difflines[i] = line
+                        elif line.startswith('-'):
+                            line = color_format('{color_remove}{line}', line=line)
+                            difflines[i] = line
+                output.append(color_format("{color_title}Variable {var} value changed:{color_default}\n{diff}", var=dep, diff='\n'.join(difflines)))
+            elif newval and oldval and (' ' in oldval or ' ' in newval):
+                output.append(color_format("{color_title}Variable {var} value changed:{color_default}\n{diff}", var=dep, diff=worddiff_str(oldval, newval, colors)))
+            else:
+                output.append(color_format("{color_title}Variable {var} value changed from '{color_default}{oldval}{color_title}' to '{color_default}{newval}{color_title}'{color_default}", var=dep, oldval=oldval, newval=newval))
 
     if not 'file_checksum_values' in a_data:
          a_data['file_checksum_values'] = {}
@@ -471,32 +564,38 @@
     changed, added, removed = file_checksums_diff(a_data['file_checksum_values'], b_data['file_checksum_values'])
     if changed:
         for f, old, new in changed:
-            output.append("Checksum for file %s changed from %s to %s" % (f, old, new))
+            output.append(color_format("{color_title}Checksum for file %s changed{color_default} from %s to %s") % (f, old, new))
     if added:
         for f in added:
-            output.append("Dependency on checksum of file %s was added" % (f))
+            output.append(color_format("{color_title}Dependency on checksum of file %s was added") % (f))
     if removed:
         for f in removed:
-            output.append("Dependency on checksum of file %s was removed" % (f))
+            output.append(color_format("{color_title}Dependency on checksum of file %s was removed") % (f))
 
     if not 'runtaskdeps' in a_data:
          a_data['runtaskdeps'] = {}
     if not 'runtaskdeps' in b_data:
          b_data['runtaskdeps'] = {}
 
-    if len(a_data['runtaskdeps']) != len(b_data['runtaskdeps']):
-        changed = ["Number of task dependencies changed"]
-    else:
-        changed = []
-        for idx, task in enumerate(a_data['runtaskdeps']):
-            a = a_data['runtaskdeps'][idx]
-            b = b_data['runtaskdeps'][idx]
-            if a_data['runtaskhashes'][a] != b_data['runtaskhashes'][b]:
-                changed.append("%s with hash %s\n changed to\n%s with hash %s" % (a, a_data['runtaskhashes'][a], b, b_data['runtaskhashes'][b]))
+    if not collapsed:
+        if len(a_data['runtaskdeps']) != len(b_data['runtaskdeps']):
+            changed = ["Number of task dependencies changed"]
+        else:
+            changed = []
+            for idx, task in enumerate(a_data['runtaskdeps']):
+                a = a_data['runtaskdeps'][idx]
+                b = b_data['runtaskdeps'][idx]
+                if a_data['runtaskhashes'][a] != b_data['runtaskhashes'][b] and not collapsed:
+                    changed.append("%s with hash %s\n changed to\n%s with hash %s" % (clean_basepath(a), a_data['runtaskhashes'][a], clean_basepath(b), b_data['runtaskhashes'][b]))
 
-    if changed:
-        output.append("runtaskdeps changed from %s to %s" % (clean_basepaths_list(a_data['runtaskdeps']), clean_basepaths_list(b_data['runtaskdeps'])))
-        output.append("\n".join(changed))
+        if changed:
+            clean_a = clean_basepaths_list(a_data['runtaskdeps'])
+            clean_b = clean_basepaths_list(b_data['runtaskdeps'])
+            if clean_a != clean_b:
+                output.append(color_format("{color_title}runtaskdeps changed:{color_default}\n%s") % list_inline_diff(clean_a, clean_b, colors))
+            else:
+                output.append(color_format("{color_title}runtaskdeps changed:"))
+            output.append("\n".join(changed))
 
 
     if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data:
@@ -512,7 +611,7 @@
                             #output.append("Dependency on task %s was replaced by %s with same hash" % (dep, bdep))
                             bdep_found = True
                 if not bdep_found:
-                    output.append("Dependency on task %s was added with hash %s" % (clean_basepath(dep), b[dep]))
+                    output.append(color_format("{color_title}Dependency on task %s was added{color_default} with hash %s") % (clean_basepath(dep), b[dep]))
         if removed:
             for dep in removed:
                 adep_found = False
@@ -522,21 +621,25 @@
                             #output.append("Dependency on task %s was replaced by %s with same hash" % (adep, dep))
                             adep_found = True
                 if not adep_found:
-                    output.append("Dependency on task %s was removed with hash %s" % (clean_basepath(dep), a[dep]))
+                    output.append(color_format("{color_title}Dependency on task %s was removed{color_default} with hash %s") % (clean_basepath(dep), a[dep]))
         if changed:
             for dep in changed:
-                output.append("Hash for dependent task %s changed from %s to %s" % (clean_basepath(dep), a[dep], b[dep]))
+                if not collapsed:
+                    output.append(color_format("{color_title}Hash for dependent task %s changed{color_default} from %s to %s") % (clean_basepath(dep), a[dep], b[dep]))
                 if callable(recursecb):
-                    # If a dependent hash changed, might as well print the line above and then defer to the changes in 
-                    # that hash since in all likelyhood, they're the same changes this task also saw.
                     recout = recursecb(dep, a[dep], b[dep])
                     if recout:
-                        output = [output[-1]] + recout
+                        if collapsed:
+                            output.extend(recout)
+                        else:
+                            # If a dependent hash changed, might as well print the line above and then defer to the changes in 
+                            # that hash since in all likelyhood, they're the same changes this task also saw.
+                            output = [output[-1]] + recout
 
     a_taint = a_data.get('taint', None)
     b_taint = b_data.get('taint', None)
     if a_taint != b_taint:
-        output.append("Taint (by forced/invalidated task) changed from %s to %s" % (a_taint, b_taint))
+        output.append(color_format("{color_title}Taint (by forced/invalidated task) changed{color_default} from %s to %s") % (a_taint, b_taint))
 
     return output
 
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/taskdata.py b/import-layers/yocto-poky/bitbake/lib/bb/taskdata.py
index d8bdbca..8c96a56 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/taskdata.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/taskdata.py
@@ -89,6 +89,19 @@
 
         self.add_extra_deps(fn, dataCache)
 
+        # Common code for dep_name/depends = 'depends'/idepends and 'rdepends'/irdepends
+        def handle_deps(task, dep_name, depends, seen):
+            if dep_name in task_deps and task in task_deps[dep_name]:
+                ids = []
+                for dep in task_deps[dep_name][task].split():
+                    if dep:
+                        parts = dep.split(":")
+                        if len(parts) != 2:
+                            bb.msg.fatal("TaskData", "Error for %s:%s[%s], dependency %s in '%s' does not contain exactly one ':' character.\n Task '%s' should be specified in the form 'packagename:task'" % (fn, task, dep_name, dep, task_deps[dep_name][task], dep_name))
+                        ids.append((parts[0], parts[1]))
+                        seen(parts[0])
+                depends.extend(ids)
+
         for task in task_deps['tasks']:
 
             tid = "%s:%s" % (fn, task)
@@ -105,24 +118,8 @@
             self.taskentries[tid].tdepends.extend(parentids)
 
             # Touch all intertask dependencies
-            if 'depends' in task_deps and task in task_deps['depends']:
-                ids = []
-                for dep in task_deps['depends'][task].split():
-                    if dep:
-                        if ":" not in dep:
-                            bb.msg.fatal("TaskData", "Error for %s, dependency %s does not contain ':' character\n. Task 'depends' should be specified in the form 'packagename:task'" % (fn, dep))
-                        ids.append(((dep.split(":")[0]), dep.split(":")[1]))
-                        self.seen_build_target(dep.split(":")[0])
-                self.taskentries[tid].idepends.extend(ids)
-            if 'rdepends' in task_deps and task in task_deps['rdepends']:
-                ids = []
-                for dep in task_deps['rdepends'][task].split():
-                    if dep:
-                        if ":" not in dep:
-                            bb.msg.fatal("TaskData", "Error for %s, dependency %s does not contain ':' character\n. Task 'rdepends' should be specified in the form 'packagename:task'" % (fn, dep))
-                        ids.append(((dep.split(":")[0]), dep.split(":")[1]))
-                        self.seen_run_target(dep.split(":")[0])
-                self.taskentries[tid].irdepends.extend(ids)
+            handle_deps(task, 'depends', self.taskentries[tid].idepends, self.seen_build_target)
+            handle_deps(task, 'rdepends', self.taskentries[tid].irdepends, self.seen_run_target)
 
         # Work out build dependencies
         if not fn in self.depids:
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tests/codeparser.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/codeparser.py
index 14f0e25..e30e78c 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/tests/codeparser.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tests/codeparser.py
@@ -49,6 +49,9 @@
     def assertExecs(self, execs):
         self.assertEqual(self.execs, execs)
 
+    def assertContains(self, contains):
+        self.assertEqual(self.contains, contains)
+
 class VariableReferenceTest(ReferenceTest):
 
     def parseExpression(self, exp):
@@ -68,7 +71,7 @@
 
     def test_python_reference(self):
         self.setEmptyVars(["BAR"])
-        self.parseExpression("${@bb.data.getVar('BAR', d, True) + 'foo'}")
+        self.parseExpression("${@d.getVar('BAR') + 'foo'}")
         self.assertReferences(set(["BAR"]))
 
 class ShellReferenceTest(ReferenceTest):
@@ -201,6 +204,7 @@
 
         self.references = parsedvar.references | parser.references
         self.execs = parser.execs
+        self.contains = parser.contains
 
     @staticmethod
     def indent(value):
@@ -209,17 +213,17 @@
         return " " + value
 
     def test_getvar_reference(self):
-        self.parseExpression("bb.data.getVar('foo', d, True)")
+        self.parseExpression("d.getVar('foo')")
         self.assertReferences(set(["foo"]))
         self.assertExecs(set())
 
     def test_getvar_computed_reference(self):
-        self.parseExpression("bb.data.getVar('f' + 'o' + 'o', d, True)")
+        self.parseExpression("d.getVar('f' + 'o' + 'o')")
         self.assertReferences(set())
         self.assertExecs(set())
 
     def test_getvar_exec_reference(self):
-        self.parseExpression("eval('bb.data.getVar(\"foo\", d, True)')")
+        self.parseExpression("eval('d.getVar(\"foo\")')")
         self.assertReferences(set())
         self.assertExecs(set(["eval"]))
 
@@ -265,15 +269,35 @@
         self.assertExecs(set(["testget"]))
         del self.context["testget"]
 
+    def test_contains(self):
+        self.parseExpression('bb.utils.contains("TESTVAR", "one", "true", "false", d)')
+        self.assertContains({'TESTVAR': {'one'}})
+
+    def test_contains_multi(self):
+        self.parseExpression('bb.utils.contains("TESTVAR", "one two", "true", "false", d)')
+        self.assertContains({'TESTVAR': {'one two'}})
+
+    def test_contains_any(self):
+        self.parseExpression('bb.utils.contains_any("TESTVAR", "hello", "true", "false", d)')
+        self.assertContains({'TESTVAR': {'hello'}})
+
+    def test_contains_any_multi(self):
+        self.parseExpression('bb.utils.contains_any("TESTVAR", "one two three", "true", "false", d)')
+        self.assertContains({'TESTVAR': {'one', 'two', 'three'}})
+
+    def test_contains_filter(self):
+        self.parseExpression('bb.utils.filter("TESTVAR", "hello there world", d)')
+        self.assertContains({'TESTVAR': {'hello', 'there', 'world'}})
+
 
 class DependencyReferenceTest(ReferenceTest):
 
     pydata = """
-bb.data.getVar('somevar', d, True)
+d.getVar('somevar')
 def test(d):
     foo = 'bar %s' % 'foo'
 def test2(d):
-    d.getVar(foo, True)
+    d.getVar(foo)
     d.getVar('bar', False)
     test2(d)
 
@@ -285,9 +309,9 @@
 
 test(d)
 
-bb.data.expand(bb.data.getVar("something", False, d), d)
-bb.data.expand("${inexpand} somethingelse", d)
-bb.data.getVar(a(), d, False)
+d.expand(d.getVar("something", False))
+d.expand("${inexpand} somethingelse")
+d.getVar(a(), False)
 """
 
     def test_python(self):
@@ -370,6 +394,30 @@
 
         self.assertEqual(deps, set(["oe_libinstall"]))
 
+    def test_contains_vardeps(self):
+        expr = '${@bb.utils.filter("TESTVAR", "somevalue anothervalue", d)} \
+                ${@bb.utils.contains("TESTVAR", "testval testval2", "yetanothervalue", "", d)} \
+                ${@bb.utils.contains("TESTVAR", "testval2 testval3", "blah", "", d)} \
+                ${@bb.utils.contains_any("TESTVAR", "testval2 testval3", "lastone", "", d)}'
+        parsedvar = self.d.expandWithRefs(expr, None)
+        # Check contains
+        self.assertEqual(parsedvar.contains, {'TESTVAR': {'testval2 testval3', 'anothervalue', 'somevalue', 'testval testval2', 'testval2', 'testval3'}})
+        # Check dependencies
+        self.d.setVar('ANOTHERVAR', expr)
+        self.d.setVar('TESTVAR', 'anothervalue testval testval2')
+        deps, values = bb.data.build_dependencies("ANOTHERVAR", set(self.d.keys()), set(), set(), self.d)
+        self.assertEqual(sorted(values.splitlines()),
+                         sorted([expr,
+                          'TESTVAR{anothervalue} = Set',
+                          'TESTVAR{somevalue} = Unset',
+                          'TESTVAR{testval testval2} = Set',
+                          'TESTVAR{testval2 testval3} = Unset',
+                          'TESTVAR{testval2} = Set',
+                          'TESTVAR{testval3} = Unset'
+                          ]))
+        # Check final value
+        self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['anothervalue', 'yetanothervalue', 'lastone'])
+
     #Currently no wildcard support
     #def test_vardeps_wildcards(self):
     #    self.d.setVar("oe_libinstall", "echo test")
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tests/data.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/data.py
index b54eb06..a4a9dd3 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/tests/data.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tests/data.py
@@ -77,13 +77,13 @@
         self.assertEqual(str(val), "boo value_of_foo")
 
     def test_python_snippet_getvar(self):
-        val = self.d.expand("${@d.getVar('foo', True) + ' ${bar}'}")
+        val = self.d.expand("${@d.getVar('foo') + ' ${bar}'}")
         self.assertEqual(str(val), "value_of_foo value_of_bar")
 
     def test_python_unexpanded(self):
         self.d.setVar("bar", "${unsetvar}")
-        val = self.d.expand("${@d.getVar('foo', True) + ' ${bar}'}")
-        self.assertEqual(str(val), "${@d.getVar('foo', True) + ' ${unsetvar}'}")
+        val = self.d.expand("${@d.getVar('foo') + ' ${bar}'}")
+        self.assertEqual(str(val), "${@d.getVar('foo') + ' ${unsetvar}'}")
 
     def test_python_snippet_syntax_error(self):
         self.d.setVar("FOO", "${@foo = 5}")
@@ -99,7 +99,7 @@
         self.assertRaises(bb.data_smart.ExpansionError, self.d.getVar, "FOO", True)
 
     def test_value_containing_value(self):
-        val = self.d.expand("${@d.getVar('foo', True) + ' ${bar}'}")
+        val = self.d.expand("${@d.getVar('foo') + ' ${bar}'}")
         self.assertEqual(str(val), "value_of_foo value_of_bar")
 
     def test_reference_undefined_var(self):
@@ -109,7 +109,7 @@
     def test_double_reference(self):
         self.d.setVar("BAR", "bar value")
         self.d.setVar("FOO", "${BAR} foo ${BAR}")
-        val = self.d.getVar("FOO", True)
+        val = self.d.getVar("FOO")
         self.assertEqual(str(val), "bar value foo bar value")
 
     def test_direct_recursion(self):
@@ -129,12 +129,12 @@
 
     def test_incomplete_varexp_single_quotes(self):
         self.d.setVar("FOO", "sed -i -e 's:IP{:I${:g' $pc")
-        val = self.d.getVar("FOO", True)
+        val = self.d.getVar("FOO")
         self.assertEqual(str(val), "sed -i -e 's:IP{:I${:g' $pc")
 
     def test_nonstring(self):
         self.d.setVar("TEST", 5)
-        val = self.d.getVar("TEST", True)
+        val = self.d.getVar("TEST")
         self.assertEqual(str(val), "5")
 
     def test_rename(self):
@@ -234,19 +234,19 @@
     def test_prepend(self):
         self.d.setVar("TEST", "${VAL}")
         self.d.prependVar("TEST", "${FOO}:")
-        self.assertEqual(self.d.getVar("TEST", True), "foo:val")
+        self.assertEqual(self.d.getVar("TEST"), "foo:val")
 
     def test_append(self):
         self.d.setVar("TEST", "${VAL}")
         self.d.appendVar("TEST", ":${BAR}")
-        self.assertEqual(self.d.getVar("TEST", True), "val:bar")
+        self.assertEqual(self.d.getVar("TEST"), "val:bar")
 
     def test_multiple_append(self):
         self.d.setVar("TEST", "${VAL}")
         self.d.prependVar("TEST", "${FOO}:")
         self.d.appendVar("TEST", ":val2")
         self.d.appendVar("TEST", ":${BAR}")
-        self.assertEqual(self.d.getVar("TEST", True), "foo:val:val2:bar")
+        self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar")
 
 class TestConcatOverride(unittest.TestCase):
     def setUp(self):
@@ -258,62 +258,66 @@
     def test_prepend(self):
         self.d.setVar("TEST", "${VAL}")
         self.d.setVar("TEST_prepend", "${FOO}:")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "foo:val")
+        self.assertEqual(self.d.getVar("TEST"), "foo:val")
 
     def test_append(self):
         self.d.setVar("TEST", "${VAL}")
         self.d.setVar("TEST_append", ":${BAR}")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "val:bar")
+        self.assertEqual(self.d.getVar("TEST"), "val:bar")
 
     def test_multiple_append(self):
         self.d.setVar("TEST", "${VAL}")
         self.d.setVar("TEST_prepend", "${FOO}:")
         self.d.setVar("TEST_append", ":val2")
         self.d.setVar("TEST_append", ":${BAR}")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "foo:val:val2:bar")
+        self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar")
 
     def test_append_unset(self):
         self.d.setVar("TEST_prepend", "${FOO}:")
         self.d.setVar("TEST_append", ":val2")
         self.d.setVar("TEST_append", ":${BAR}")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "foo::val2:bar")
+        self.assertEqual(self.d.getVar("TEST"), "foo::val2:bar")
 
     def test_remove(self):
         self.d.setVar("TEST", "${VAL} ${BAR}")
         self.d.setVar("TEST_remove", "val")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "bar")
+        self.assertEqual(self.d.getVar("TEST"), "bar")
+
+    def test_remove_cleared(self):
+        self.d.setVar("TEST", "${VAL} ${BAR}")
+        self.d.setVar("TEST_remove", "val")
+        self.d.setVar("TEST", "${VAL} ${BAR}")
+        self.assertEqual(self.d.getVar("TEST"), "val bar")
+
+    # Ensure the value is unchanged if we have an inactive remove override
+    # (including that whitespace is preserved)
+    def test_remove_inactive_override(self):
+        self.d.setVar("TEST", "${VAL} ${BAR}    123")
+        self.d.setVar("TEST_remove_inactiveoverride", "val")
+        self.assertEqual(self.d.getVar("TEST"), "val bar    123")
 
     def test_doubleref_remove(self):
         self.d.setVar("TEST", "${VAL} ${BAR}")
         self.d.setVar("TEST_remove", "val")
         self.d.setVar("TEST_TEST", "${TEST} ${TEST}")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST_TEST", True), "bar bar")
+        self.assertEqual(self.d.getVar("TEST_TEST"), "bar bar")
 
     def test_empty_remove(self):
         self.d.setVar("TEST", "")
         self.d.setVar("TEST_remove", "val")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "")
+        self.assertEqual(self.d.getVar("TEST"), "")
 
     def test_remove_expansion(self):
         self.d.setVar("BAR", "Z")
         self.d.setVar("TEST", "${BAR}/X Y")
         self.d.setVar("TEST_remove", "${BAR}/X")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "Y")
+        self.assertEqual(self.d.getVar("TEST"), "Y")
 
     def test_remove_expansion_items(self):
         self.d.setVar("TEST", "A B C D")
         self.d.setVar("BAR", "B D")
         self.d.setVar("TEST_remove", "${BAR}")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "A C")
+        self.assertEqual(self.d.getVar("TEST"), "A C")
 
 class TestOverrides(unittest.TestCase):
     def setUp(self):
@@ -322,60 +326,53 @@
         self.d.setVar("TEST", "testvalue")
 
     def test_no_override(self):
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "testvalue")
+        self.assertEqual(self.d.getVar("TEST"), "testvalue")
 
     def test_one_override(self):
         self.d.setVar("TEST_bar", "testvalue2")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "testvalue2")
+        self.assertEqual(self.d.getVar("TEST"), "testvalue2")
 
     def test_one_override_unset(self):
         self.d.setVar("TEST2_bar", "testvalue2")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST2", True), "testvalue2")
+
+        self.assertEqual(self.d.getVar("TEST2"), "testvalue2")
         self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST2', 'OVERRIDES', 'TEST2_bar'])
 
     def test_multiple_override(self):
         self.d.setVar("TEST_bar", "testvalue2")
         self.d.setVar("TEST_local", "testvalue3")
         self.d.setVar("TEST_foo", "testvalue4")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "testvalue3")
+        self.assertEqual(self.d.getVar("TEST"), "testvalue3")
         self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST_foo', 'OVERRIDES', 'TEST_bar', 'TEST_local'])
 
     def test_multiple_combined_overrides(self):
         self.d.setVar("TEST_local_foo_bar", "testvalue3")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "testvalue3")
+        self.assertEqual(self.d.getVar("TEST"), "testvalue3")
 
     def test_multiple_overrides_unset(self):
         self.d.setVar("TEST2_local_foo_bar", "testvalue3")
-        bb.data.update_data(self.d)
-        self.assertEqual(self.d.getVar("TEST2", True), "testvalue3")
+        self.assertEqual(self.d.getVar("TEST2"), "testvalue3")
 
     def test_keyexpansion_override(self):
         self.d.setVar("LOCAL", "local")
         self.d.setVar("TEST_bar", "testvalue2")
         self.d.setVar("TEST_${LOCAL}", "testvalue3")
         self.d.setVar("TEST_foo", "testvalue4")
-        bb.data.update_data(self.d)
         bb.data.expandKeys(self.d)
-        self.assertEqual(self.d.getVar("TEST", True), "testvalue3")
+        self.assertEqual(self.d.getVar("TEST"), "testvalue3")
 
     def test_rename_override(self):
         self.d.setVar("ALTERNATIVE_ncurses-tools_class-target", "a")
         self.d.setVar("OVERRIDES", "class-target")
-        bb.data.update_data(self.d)
         self.d.renameVar("ALTERNATIVE_ncurses-tools", "ALTERNATIVE_lib32-ncurses-tools")
-        self.assertEqual(self.d.getVar("ALTERNATIVE_lib32-ncurses-tools", True), "a")
+        self.assertEqual(self.d.getVar("ALTERNATIVE_lib32-ncurses-tools"), "a")
 
     def test_underscore_override(self):
         self.d.setVar("TEST_bar", "testvalue2")
         self.d.setVar("TEST_some_val", "testvalue3")
         self.d.setVar("TEST_foo", "testvalue4")
         self.d.setVar("OVERRIDES", "foo:bar:some_val")
-        self.assertEqual(self.d.getVar("TEST", True), "testvalue3")
+        self.assertEqual(self.d.getVar("TEST"), "testvalue3")
 
 class TestKeyExpansion(unittest.TestCase):
     def setUp(self):
@@ -389,7 +386,7 @@
         with LogRecord() as logs:
             bb.data.expandKeys(self.d)
             self.assertTrue(logContains("Variable key VAL_${FOO} (A) replaces original key VAL_foo (B)", logs))
-        self.assertEqual(self.d.getVar("VAL_foo", True), "A")
+        self.assertEqual(self.d.getVar("VAL_foo"), "A")
 
 class TestFlags(unittest.TestCase):
     def setUp(self):
@@ -444,3 +441,167 @@
 
         self.assertFalse(bb.utils.contains_any("SOMEFLAG", "x", True, False, self.d))
         self.assertFalse(bb.utils.contains_any("SOMEFLAG", "x y z", True, False, self.d))
+
+
+class Serialize(unittest.TestCase):
+
+    def test_serialize(self):
+        import tempfile
+        import pickle
+        d = bb.data.init()
+        d.enableTracking()
+        d.setVar('HELLO', 'world')
+        d.setVarFlag('HELLO', 'other', 'planet')
+        with tempfile.NamedTemporaryFile(delete=False) as tmpfile:
+            tmpfilename = tmpfile.name
+            pickle.dump(d, tmpfile)
+
+        with open(tmpfilename, 'rb') as f:
+            newd = pickle.load(f)
+
+        os.remove(tmpfilename)
+
+        self.assertEqual(d, newd)
+        self.assertEqual(newd.getVar('HELLO'), 'world')
+        self.assertEqual(newd.getVarFlag('HELLO', 'other'), 'planet')
+
+
+# Remote datastore tests
+# These really only test the interface, since in actual usage we have a
+# tinfoil connector that does everything over RPC, and this doesn't test
+# that.
+
+class TestConnector:
+    d = None
+    def __init__(self, d):
+        self.d = d
+    def getVar(self, name):
+        return self.d._findVar(name)
+    def getKeys(self):
+        return set(self.d.keys())
+    def getVarHistory(self, name):
+        return self.d.varhistory.variable(name)
+    def expandPythonRef(self, varname, expr, d):
+        localdata = self.d.createCopy()
+        for key in d.localkeys():
+            localdata.setVar(d.getVar(key))
+        varparse = bb.data_smart.VariableParse(varname, localdata)
+        return varparse.python_sub(expr)
+    def setVar(self, name, value):
+        self.d.setVar(name, value)
+    def setVarFlag(self, name, flag, value):
+        self.d.setVarFlag(name, flag, value)
+    def delVar(self, name):
+        self.d.delVar(name)
+        return False
+    def delVarFlag(self, name, flag):
+        self.d.delVarFlag(name, flag)
+        return False
+    def renameVar(self, name, newname):
+        self.d.renameVar(name, newname)
+        return False
+
+class Remote(unittest.TestCase):
+    def test_remote(self):
+
+        d1 = bb.data.init()
+        d1.enableTracking()
+        d2 = bb.data.init()
+        d2.enableTracking()
+        connector = TestConnector(d1)
+
+        d2.setVar('_remote_data', connector)
+
+        d1.setVar('HELLO', 'world')
+        d1.setVarFlag('OTHER', 'flagname', 'flagvalue')
+        self.assertEqual(d2.getVar('HELLO'), 'world')
+        self.assertEqual(d2.expand('${HELLO}'), 'world')
+        self.assertEqual(d2.expand('${@d.getVar("HELLO")}'), 'world')
+        self.assertIn('flagname', d2.getVarFlags('OTHER'))
+        self.assertEqual(d2.getVarFlag('OTHER', 'flagname'), 'flagvalue')
+        self.assertEqual(d1.varhistory.variable('HELLO'), d2.varhistory.variable('HELLO'))
+        # Test setVar on client side affects server
+        d2.setVar('HELLO', 'other-world')
+        self.assertEqual(d1.getVar('HELLO'), 'other-world')
+        # Test setVarFlag on client side affects server
+        d2.setVarFlag('HELLO', 'flagname', 'flagvalue')
+        self.assertEqual(d1.getVarFlag('HELLO', 'flagname'), 'flagvalue')
+        # Test client side data is incorporated in python expansion (which is done on server)
+        d2.setVar('FOO', 'bar')
+        self.assertEqual(d2.expand('${@d.getVar("FOO")}'), 'bar')
+        # Test overrides work
+        d1.setVar('FOO_test', 'baz')
+        d1.appendVar('OVERRIDES', ':test')
+        self.assertEqual(d2.getVar('FOO'), 'baz')
+
+
+# Remote equivalents of local test classes
+# Note that these aren't perfect since we only test in one direction
+
+class RemoteDataExpansions(DataExpansions):
+    def setUp(self):
+        self.d1 = bb.data.init()
+        self.d = bb.data.init()
+        self.d1["foo"] = "value_of_foo"
+        self.d1["bar"] = "value_of_bar"
+        self.d1["value_of_foo"] = "value_of_'value_of_foo'"
+        connector = TestConnector(self.d1)
+        self.d.setVar('_remote_data', connector)
+
+class TestRemoteNestedExpansions(TestNestedExpansions):
+    def setUp(self):
+        self.d1 = bb.data.init()
+        self.d = bb.data.init()
+        self.d1["foo"] = "foo"
+        self.d1["bar"] = "bar"
+        self.d1["value_of_foobar"] = "187"
+        connector = TestConnector(self.d1)
+        self.d.setVar('_remote_data', connector)
+
+class TestRemoteConcat(TestConcat):
+    def setUp(self):
+        self.d1 = bb.data.init()
+        self.d = bb.data.init()
+        self.d1.setVar("FOO", "foo")
+        self.d1.setVar("VAL", "val")
+        self.d1.setVar("BAR", "bar")
+        connector = TestConnector(self.d1)
+        self.d.setVar('_remote_data', connector)
+
+class TestRemoteConcatOverride(TestConcatOverride):
+    def setUp(self):
+        self.d1 = bb.data.init()
+        self.d = bb.data.init()
+        self.d1.setVar("FOO", "foo")
+        self.d1.setVar("VAL", "val")
+        self.d1.setVar("BAR", "bar")
+        connector = TestConnector(self.d1)
+        self.d.setVar('_remote_data', connector)
+
+class TestRemoteOverrides(TestOverrides):
+    def setUp(self):
+        self.d1 = bb.data.init()
+        self.d = bb.data.init()
+        self.d1.setVar("OVERRIDES", "foo:bar:local")
+        self.d1.setVar("TEST", "testvalue")
+        connector = TestConnector(self.d1)
+        self.d.setVar('_remote_data', connector)
+
+class TestRemoteKeyExpansion(TestKeyExpansion):
+    def setUp(self):
+        self.d1 = bb.data.init()
+        self.d = bb.data.init()
+        self.d1.setVar("FOO", "foo")
+        self.d1.setVar("BAR", "foo")
+        connector = TestConnector(self.d1)
+        self.d.setVar('_remote_data', connector)
+
+class TestRemoteFlags(TestFlags):
+    def setUp(self):
+        self.d1 = bb.data.init()
+        self.d = bb.data.init()
+        self.d1.setVar("foo", "value of foo")
+        self.d1.setVarFlag("foo", "flag1", "value of flag1")
+        self.d1.setVarFlag("foo", "flag2", "value of flag2")
+        connector = TestConnector(self.d1)
+        self.d.setVar('_remote_data', connector)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tests/fetch.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/fetch.py
index 0fd2c02..5a8d892 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/tests/fetch.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tests/fetch.py
@@ -793,6 +793,7 @@
                 ud = bb.fetch2.FetchData(k[1], self.d)
                 pupver= ud.method.latest_versionstring(ud, self.d)
                 verstring = pupver[0]
+                self.assertTrue(verstring, msg="Could not find upstream version")
                 r = bb.utils.vercmp_string(v, verstring)
                 self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))
 
@@ -804,6 +805,7 @@
                 ud = bb.fetch2.FetchData(k[1], self.d)
                 pupver = ud.method.latest_versionstring(ud, self.d)
                 verstring = pupver[0]
+                self.assertTrue(verstring, msg="Could not find upstream version")
                 r = bb.utils.vercmp_string(v, verstring)
                 self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))
 
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tests/parse.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/parse.py
index 0b2706a..ab6ca90 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/tests/parse.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tests/parse.py
@@ -58,9 +58,9 @@
     def test_parse_simple(self):
         f = self.parsehelper(self.testfile)
         d = bb.parse.handle(f.name, self.d)['']
-        self.assertEqual(d.getVar("A", True), "1")
-        self.assertEqual(d.getVar("B", True), "2")
-        self.assertEqual(d.getVar("C", True), "3")
+        self.assertEqual(d.getVar("A"), "1")
+        self.assertEqual(d.getVar("B"), "2")
+        self.assertEqual(d.getVar("C"), "3")
 
     def test_parse_incomplete_function(self):
         testfileB = self.testfile.replace("}", "")
@@ -80,9 +80,9 @@
     def test_parse_unset(self):
         f = self.parsehelper(self.unsettest)
         d = bb.parse.handle(f.name, self.d)['']
-        self.assertEqual(d.getVar("A", True), None)
-        self.assertEqual(d.getVarFlag("A","flag", True), None)
-        self.assertEqual(d.getVar("B", True), "2")
+        self.assertEqual(d.getVar("A"), None)
+        self.assertEqual(d.getVarFlag("A","flag"), None)
+        self.assertEqual(d.getVar("B"), "2")
         
 
     overridetest = """
@@ -95,11 +95,11 @@
     def test_parse_overrides(self):
         f = self.parsehelper(self.overridetest)
         d = bb.parse.handle(f.name, self.d)['']
-        self.assertEqual(d.getVar("RRECOMMENDS", True), "b")
+        self.assertEqual(d.getVar("RRECOMMENDS"), "b")
         bb.data.expandKeys(d)
-        self.assertEqual(d.getVar("RRECOMMENDS", True), "b")
+        self.assertEqual(d.getVar("RRECOMMENDS"), "b")
         d.setVar("RRECOMMENDS_gtk+", "c")
-        self.assertEqual(d.getVar("RRECOMMENDS", True), "c")
+        self.assertEqual(d.getVar("RRECOMMENDS"), "c")
 
     overridetest2 = """
 EXTRA_OECONF = ""
@@ -112,7 +112,7 @@
         d = bb.parse.handle(f.name, self.d)['']
         d.appendVar("EXTRA_OECONF", " d")
         d.setVar("OVERRIDES", "class-target")
-        self.assertEqual(d.getVar("EXTRA_OECONF", True), "b c d")
+        self.assertEqual(d.getVar("EXTRA_OECONF"), "b c d")
 
     overridetest3 = """
 DESCRIPTION = "A"
@@ -124,11 +124,11 @@
         f = self.parsehelper(self.overridetest3)
         d = bb.parse.handle(f.name, self.d)['']
         bb.data.expandKeys(d)
-        self.assertEqual(d.getVar("DESCRIPTION_bc-dev", True), "A B")
+        self.assertEqual(d.getVar("DESCRIPTION_bc-dev"), "A B")
         d.setVar("DESCRIPTION", "E")
         d.setVar("DESCRIPTION_bc-dev", "C D")
         d.setVar("OVERRIDES", "bc-dev")
-        self.assertEqual(d.getVar("DESCRIPTION", True), "C D")
+        self.assertEqual(d.getVar("DESCRIPTION"), "C D")
 
 
     classextend = """
@@ -159,6 +159,6 @@
         alldata = bb.parse.handle(f.name, self.d)
         d1 = alldata['']
         d2 = alldata[cls.name]
-        self.assertEqual(d1.getVar("VAR_var", True), "B")
-        self.assertEqual(d2.getVar("VAR_var", True), None)
+        self.assertEqual(d1.getVar("VAR_var"), "B")
+        self.assertEqual(d2.getVar("VAR_var"), None)
 
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tinfoil.py b/import-layers/yocto-poky/bitbake/lib/bb/tinfoil.py
index 9fa5b5b..928333a 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/tinfoil.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tinfoil.py
@@ -1,6 +1,6 @@
 # tinfoil: a simple wrapper around cooker for bitbake-based command-line utilities
 #
-# Copyright (C) 2012 Intel Corporation
+# Copyright (C) 2012-2017 Intel Corporation
 # Copyright (C) 2011 Mentor Graphics Corporation
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,50 +17,210 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 import logging
-import warnings
 import os
 import sys
+import atexit
+import re
+from collections import OrderedDict, defaultdict
 
 import bb.cache
 import bb.cooker
 import bb.providers
+import bb.taskdata
 import bb.utils
-from bb.cooker import state, BBCooker, CookerFeatures
+import bb.command
+import bb.remotedata
 from bb.cookerdata import CookerConfiguration, ConfigParameters
+from bb.main import setup_bitbake, BitBakeConfigParameters, BBMainException
 import bb.fetch2
 
+
+# We need this in order to shut down the connection to the bitbake server,
+# otherwise the process will never properly exit
+_server_connections = []
+def _terminate_connections():
+    for connection in _server_connections:
+        connection.terminate()
+atexit.register(_terminate_connections)
+
+class TinfoilUIException(Exception):
+    """Exception raised when the UI returns non-zero from its main function"""
+    def __init__(self, returncode):
+        self.returncode = returncode
+    def __repr__(self):
+        return 'UI module main returned %d' % self.returncode
+
+class TinfoilCommandFailed(Exception):
+    """Exception raised when run_command fails"""
+
+class TinfoilDataStoreConnector:
+
+    def __init__(self, tinfoil, dsindex):
+        self.tinfoil = tinfoil
+        self.dsindex = dsindex
+    def getVar(self, name):
+        value = self.tinfoil.run_command('dataStoreConnectorFindVar', self.dsindex, name)
+        overrides = None
+        if isinstance(value, dict):
+            if '_connector_origtype' in value:
+                value['_content'] = self.tinfoil._reconvert_type(value['_content'], value['_connector_origtype'])
+                del value['_connector_origtype']
+            if '_connector_overrides' in value:
+                overrides = value['_connector_overrides']
+                del value['_connector_overrides']
+        return value, overrides
+    def getKeys(self):
+        return set(self.tinfoil.run_command('dataStoreConnectorGetKeys', self.dsindex))
+    def getVarHistory(self, name):
+        return self.tinfoil.run_command('dataStoreConnectorGetVarHistory', self.dsindex, name)
+    def expandPythonRef(self, varname, expr, d):
+        ds = bb.remotedata.RemoteDatastores.transmit_datastore(d)
+        ret = self.tinfoil.run_command('dataStoreConnectorExpandPythonRef', ds, varname, expr)
+        return ret
+    def setVar(self, varname, value):
+        if self.dsindex is None:
+            self.tinfoil.run_command('setVariable', varname, value)
+        else:
+            # Not currently implemented - indicate that setting should
+            # be redirected to local side
+            return True
+    def setVarFlag(self, varname, flagname, value):
+        if self.dsindex is None:
+            self.tinfoil.run_command('dataStoreConnectorSetVarFlag', self.dsindex, varname, flagname, value)
+        else:
+            # Not currently implemented - indicate that setting should
+            # be redirected to local side
+            return True
+    def delVar(self, varname):
+        if self.dsindex is None:
+            self.tinfoil.run_command('dataStoreConnectorDelVar', self.dsindex, varname)
+        else:
+            # Not currently implemented - indicate that setting should
+            # be redirected to local side
+            return True
+    def delVarFlag(self, varname, flagname):
+        if self.dsindex is None:
+            self.tinfoil.run_command('dataStoreConnectorDelVar', self.dsindex, varname, flagname)
+        else:
+            # Not currently implemented - indicate that setting should
+            # be redirected to local side
+            return True
+    def renameVar(self, name, newname):
+        if self.dsindex is None:
+            self.tinfoil.run_command('dataStoreConnectorRenameVar', self.dsindex, name, newname)
+        else:
+            # Not currently implemented - indicate that setting should
+            # be redirected to local side
+            return True
+
+class TinfoilCookerAdapter:
+    """
+    Provide an adapter for existing code that expects to access a cooker object via Tinfoil,
+    since now Tinfoil is on the client side it no longer has direct access.
+    """
+
+    class TinfoilCookerCollectionAdapter:
+        """ cooker.collection adapter """
+        def __init__(self, tinfoil):
+            self.tinfoil = tinfoil
+        def get_file_appends(self, fn):
+            return self.tinfoil.get_file_appends(fn)
+        def __getattr__(self, name):
+            if name == 'overlayed':
+                return self.tinfoil.get_overlayed_recipes()
+            elif name == 'bbappends':
+                return self.tinfoil.run_command('getAllAppends')
+            else:
+                raise AttributeError("%s instance has no attribute '%s'" % (self.__class__.__name__, name))
+
+    class TinfoilRecipeCacheAdapter:
+        """ cooker.recipecache adapter """
+        def __init__(self, tinfoil):
+            self.tinfoil = tinfoil
+            self._cache = {}
+
+        def get_pkg_pn_fn(self):
+            pkg_pn = defaultdict(list, self.tinfoil.run_command('getRecipes') or [])
+            pkg_fn = {}
+            for pn, fnlist in pkg_pn.items():
+                for fn in fnlist:
+                    pkg_fn[fn] = pn
+            self._cache['pkg_pn'] = pkg_pn
+            self._cache['pkg_fn'] = pkg_fn
+
+        def __getattr__(self, name):
+            # Grab these only when they are requested since they aren't always used
+            if name in self._cache:
+                return self._cache[name]
+            elif name == 'pkg_pn':
+                self.get_pkg_pn_fn()
+                return self._cache[name]
+            elif name == 'pkg_fn':
+                self.get_pkg_pn_fn()
+                return self._cache[name]
+            elif name == 'deps':
+                attrvalue = defaultdict(list, self.tinfoil.run_command('getRecipeDepends') or [])
+            elif name == 'rundeps':
+                attrvalue = defaultdict(lambda: defaultdict(list), self.tinfoil.run_command('getRuntimeDepends') or [])
+            elif name == 'runrecs':
+                attrvalue = defaultdict(lambda: defaultdict(list), self.tinfoil.run_command('getRuntimeRecommends') or [])
+            elif name == 'pkg_pepvpr':
+                attrvalue = self.tinfoil.run_command('getRecipeVersions') or {}
+            elif name == 'inherits':
+                attrvalue = self.tinfoil.run_command('getRecipeInherits') or {}
+            elif name == 'bbfile_priority':
+                attrvalue = self.tinfoil.run_command('getBbFilePriority') or {}
+            elif name == 'pkg_dp':
+                attrvalue = self.tinfoil.run_command('getDefaultPreference') or {}
+            else:
+                raise AttributeError("%s instance has no attribute '%s'" % (self.__class__.__name__, name))
+
+            self._cache[name] = attrvalue
+            return attrvalue
+
+    def __init__(self, tinfoil):
+        self.tinfoil = tinfoil
+        self.collection = self.TinfoilCookerCollectionAdapter(tinfoil)
+        self.recipecaches = {}
+        # FIXME all machines
+        self.recipecaches[''] = self.TinfoilRecipeCacheAdapter(tinfoil)
+        self._cache = {}
+    def __getattr__(self, name):
+        # Grab these only when they are requested since they aren't always used
+        if name in self._cache:
+            return self._cache[name]
+        elif name == 'skiplist':
+            attrvalue = self.tinfoil.get_skipped_recipes()
+        elif name == 'bbfile_config_priorities':
+            ret = self.tinfoil.run_command('getLayerPriorities')
+            bbfile_config_priorities = []
+            for collection, pattern, regex, pri in ret:
+                bbfile_config_priorities.append((collection, pattern, re.compile(regex), pri))
+
+            attrvalue = bbfile_config_priorities
+        else:
+            raise AttributeError("%s instance has no attribute '%s'" % (self.__class__.__name__, name))
+
+        self._cache[name] = attrvalue
+        return attrvalue
+
+    def findBestProvider(self, pn):
+        return self.tinfoil.find_best_provider(pn)
+
+
 class Tinfoil:
-    def __init__(self, output=sys.stdout, tracking=False):
-        # Needed to avoid deprecation warnings with python 2.6
-        warnings.filterwarnings("ignore", category=DeprecationWarning)
 
-        # Set up logging
+    def __init__(self, output=sys.stdout, tracking=False, setup_logging=True):
         self.logger = logging.getLogger('BitBake')
-        self._log_hdlr = logging.StreamHandler(output)
-        bb.msg.addDefaultlogFilter(self._log_hdlr)
-        format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
-        if output.isatty():
-            format.enable_color()
-        self._log_hdlr.setFormatter(format)
-        self.logger.addHandler(self._log_hdlr)
-
-        self.config = CookerConfiguration()
-        configparams = TinfoilConfigParameters(parse_only=True)
-        self.config.setConfigParameters(configparams)
-        self.config.setServerRegIdleCallback(self.register_idle_function)
-        features = []
-        if tracking:
-            features.append(CookerFeatures.BASEDATASTORE_TRACKING)
-        cleanedvars = bb.utils.clean_environment()
-        self.cooker = BBCooker(self.config, features)
-        self.config_data = self.cooker.data
-        bb.providers.logger.setLevel(logging.ERROR)
-        self.cooker_data = None
-        for k in cleanedvars:
-            os.environ[k] = cleanedvars[k]
-
-    def register_idle_function(self, function, data):
-        pass
+        self.config_data = None
+        self.cooker = None
+        self.tracking = tracking
+        self.ui_module = None
+        self.server_connection = None
+        if setup_logging:
+            # This is the *client-side* logger, nothing to do with
+            # logging messages from the server
+            bb.msg.logger_create('BitBake', output)
 
     def __enter__(self):
         return self
@@ -68,30 +228,161 @@
     def __exit__(self, type, value, traceback):
         self.shutdown()
 
-    def parseRecipes(self):
-        sys.stderr.write("Parsing recipes..")
-        self.logger.setLevel(logging.WARNING)
+    def prepare(self, config_only=False, config_params=None, quiet=0):
+        if self.tracking:
+            extrafeatures = [bb.cooker.CookerFeatures.BASEDATASTORE_TRACKING]
+        else:
+            extrafeatures = []
 
-        try:
-            while self.cooker.state in (state.initial, state.parsing):
-                self.cooker.updateCache()
-        except KeyboardInterrupt:
-            self.cooker.shutdown()
-            self.cooker.updateCache()
-            sys.exit(2)
+        if not config_params:
+            config_params = TinfoilConfigParameters(config_only=config_only, quiet=quiet)
 
-        self.logger.setLevel(logging.INFO)
-        sys.stderr.write("done.\n")
+        cookerconfig = CookerConfiguration()
+        cookerconfig.setConfigParameters(config_params)
 
-        self.cooker_data = self.cooker.recipecaches['']
+        server, self.server_connection, ui_module = setup_bitbake(config_params,
+                            cookerconfig,
+                            extrafeatures)
 
-    def prepare(self, config_only = False):
-        if not self.cooker_data:
+        self.ui_module = ui_module
+
+        # Ensure the path to bitbake's bin directory is in PATH so that things like
+        # bitbake-worker can be run (usually this is the case, but it doesn't have to be)
+        path = os.getenv('PATH').split(':')
+        bitbakebinpath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'bin'))
+        for entry in path:
+            if entry.endswith(os.sep):
+                entry = entry[:-1]
+            if os.path.abspath(entry) == bitbakebinpath:
+                break
+        else:
+            path.insert(0, bitbakebinpath)
+            os.environ['PATH'] = ':'.join(path)
+
+        if self.server_connection:
+            _server_connections.append(self.server_connection)
             if config_only:
-                self.cooker.parseConfiguration()
-                self.cooker_data = self.cooker.recipecaches['']
+                config_params.updateToServer(self.server_connection.connection, os.environ.copy())
+                self.run_command('parseConfiguration')
             else:
-                self.parseRecipes()
+                self.run_actions(config_params)
+
+            self.config_data = bb.data.init()
+            connector = TinfoilDataStoreConnector(self, None)
+            self.config_data.setVar('_remote_data', connector)
+            self.cooker = TinfoilCookerAdapter(self)
+            self.cooker_data = self.cooker.recipecaches['']
+        else:
+            raise Exception('Failed to start bitbake server')
+
+    def run_actions(self, config_params):
+        """
+        Run the actions specified in config_params through the UI.
+        """
+        ret = self.ui_module.main(self.server_connection.connection, self.server_connection.events, config_params)
+        if ret:
+            raise TinfoilUIException(ret)
+
+    def parseRecipes(self):
+        """
+        Force a parse of all recipes. Normally you should specify
+        config_only=False when calling prepare() instead of using this
+        function; this function is designed for situations where you need
+        to initialise Tinfoil and use it with config_only=True first and
+        then conditionally call this function to parse recipes later.
+        """
+        config_params = TinfoilConfigParameters(config_only=False)
+        self.run_actions(config_params)
+
+    def run_command(self, command, *params):
+        """
+        Run a command on the server (as implemented in bb.command).
+        Note that there are two types of command - synchronous and
+        asynchronous; in order to receive the results of asynchronous
+        commands you will need to set an appropriate event mask
+        using set_event_mask() and listen for the result using
+        wait_event() - with the correct event mask you'll at least get
+        bb.command.CommandCompleted and possibly other events before
+        that depending on the command.
+        """
+        if not self.server_connection:
+            raise Exception('Not connected to server (did you call .prepare()?)')
+
+        commandline = [command]
+        if params:
+            commandline.extend(params)
+        result = self.server_connection.connection.runCommand(commandline)
+        if result[1]:
+            raise TinfoilCommandFailed(result[1])
+        return result[0]
+
+    def set_event_mask(self, eventlist):
+        """Set the event mask which will be applied within wait_event()"""
+        if not self.server_connection:
+            raise Exception('Not connected to server (did you call .prepare()?)')
+        llevel, debug_domains = bb.msg.constructLogOptions()
+        ret = self.run_command('setEventMask', self.server_connection.connection.getEventHandle(), llevel, debug_domains, eventlist)
+        if not ret:
+            raise Exception('setEventMask failed')
+
+    def wait_event(self, timeout=0):
+        """
+        Wait for an event from the server for the specified time.
+        A timeout of 0 means don't wait if there are no events in the queue.
+        Returns the next event in the queue or None if the timeout was
+        reached. Note that in order to recieve any events you will
+        first need to set the internal event mask using set_event_mask()
+        (otherwise whatever event mask the UI set up will be in effect).
+        """
+        if not self.server_connection:
+            raise Exception('Not connected to server (did you call .prepare()?)')
+        return self.server_connection.events.waitEvent(timeout)
+
+    def get_overlayed_recipes(self):
+        return defaultdict(list, self.run_command('getOverlayedRecipes'))
+
+    def get_skipped_recipes(self):
+        return OrderedDict(self.run_command('getSkippedRecipes'))
+
+    def get_all_providers(self):
+        return defaultdict(list, self.run_command('allProviders'))
+
+    def find_providers(self):
+        return self.run_command('findProviders')
+
+    def find_best_provider(self, pn):
+        return self.run_command('findBestProvider', pn)
+
+    def get_runtime_providers(self, rdep):
+        return self.run_command('getRuntimeProviders', rdep)
+
+    def get_recipe_file(self, pn):
+        """
+        Get the file name for the specified recipe/target. Raises
+        bb.providers.NoProvider if there is no match or the recipe was
+        skipped.
+        """
+        best = self.find_best_provider(pn)
+        if not best or (len(best) > 3 and not best[3]):
+            skiplist = self.get_skipped_recipes()
+            taskdata = bb.taskdata.TaskData(None, skiplist=skiplist)
+            skipreasons = taskdata.get_reasons(pn)
+            if skipreasons:
+                raise bb.providers.NoProvider('%s is unavailable:\n  %s' % (pn, '  \n'.join(skipreasons)))
+            else:
+                raise bb.providers.NoProvider('Unable to find any recipe file matching "%s"' % pn)
+        return best[3]
+
+    def get_file_appends(self, fn):
+        return self.run_command('getFileAppends', fn)
+
+    def parse_recipe(self, pn):
+        """
+        Parse the specified recipe and return a datastore object
+        representing the environment for the recipe.
+        """
+        fn = self.get_recipe_file(pn)
+        return self.parse_recipe_file(fn)
 
     def parse_recipe_file(self, fn, appends=True, appendlist=None, config_data=None):
         """
@@ -110,41 +401,82 @@
         """
         if appends and appendlist == []:
             appends = False
-        if appends:
-            if appendlist:
-                appendfiles = appendlist
-            else:
-                if not hasattr(self.cooker, 'collection'):
-                    raise Exception('You must call tinfoil.prepare() with config_only=False in order to get bbappends')
-                appendfiles = self.cooker.collection.get_file_appends(fn)
-        else:
-            appendfiles = None
         if config_data:
-            # We have to use a different function here if we're passing in a datastore
-            localdata = bb.data.createCopy(config_data)
-            envdata = bb.cache.parse_recipe(localdata, fn, appendfiles)['']
+            dctr = bb.remotedata.RemoteDatastores.transmit_datastore(config_data)
+            dscon = self.run_command('parseRecipeFile', fn, appends, appendlist, dctr)
         else:
-            # Use the standard path
-            parser = bb.cache.NoCache(self.cooker.databuilder)
-            envdata = parser.loadDataFull(fn, appendfiles)
-        return envdata
+            dscon = self.run_command('parseRecipeFile', fn, appends, appendlist)
+        if dscon:
+            return self._reconvert_type(dscon, 'DataStoreConnectionHandle')
+        else:
+            return None
+
+    def build_file(self, buildfile, task):
+        """
+        Runs the specified task for just a single recipe (i.e. no dependencies).
+        This is equivalent to bitbake -b, except no warning will be printed.
+        """
+        return self.run_command('buildFile', buildfile, task, True)
 
     def shutdown(self):
-        self.cooker.shutdown(force=True)
-        self.cooker.post_serve()
-        self.cooker.unlockBitbake()
-        self.logger.removeHandler(self._log_hdlr)
+        if self.server_connection:
+            self.run_command('clientComplete')
+            _server_connections.remove(self.server_connection)
+            bb.event.ui_queue = []
+            self.server_connection.terminate()
+            self.server_connection = None
 
-class TinfoilConfigParameters(ConfigParameters):
+    def _reconvert_type(self, obj, origtypename):
+        """
+        Convert an object back to the right type, in the case
+        that marshalling has changed it (especially with xmlrpc)
+        """
+        supported_types = {
+            'set': set,
+            'DataStoreConnectionHandle': bb.command.DataStoreConnectionHandle,
+        }
 
-    def __init__(self, **options):
+        origtype = supported_types.get(origtypename, None)
+        if origtype is None:
+            raise Exception('Unsupported type "%s"' % origtypename)
+        if type(obj) == origtype:
+            newobj = obj
+        elif isinstance(obj, dict):
+            # New style class
+            newobj = origtype()
+            for k,v in obj.items():
+                setattr(newobj, k, v)
+        else:
+            # Assume we can coerce the type
+            newobj = origtype(obj)
+
+        if isinstance(newobj, bb.command.DataStoreConnectionHandle):
+            connector = TinfoilDataStoreConnector(self, newobj.dsindex)
+            newobj = bb.data.init()
+            newobj.setVar('_remote_data', connector)
+
+        return newobj
+
+
+class TinfoilConfigParameters(BitBakeConfigParameters):
+
+    def __init__(self, config_only, **options):
         self.initial_options = options
+        # Apply some sane defaults
+        if not 'parse_only' in options:
+            self.initial_options['parse_only'] = not config_only
+        #if not 'status_only' in options:
+        #    self.initial_options['status_only'] = config_only
+        if not 'ui' in options:
+            self.initial_options['ui'] = 'knotty'
+        if not 'argv' in options:
+            self.initial_options['argv'] = []
+
         super(TinfoilConfigParameters, self).__init__()
 
-    def parseCommandLine(self, argv=sys.argv):
-        class DummyOptions:
-            def __init__(self, initial_options):
-                for key, val in initial_options.items():
-                    setattr(self, key, val)
-
-        return DummyOptions(self.initial_options), None
+    def parseCommandLine(self, argv=None):
+        # We don't want any parameters parsed from the command line
+        opts = super(TinfoilConfigParameters, self).parseCommandLine([])
+        for key, val in self.initial_options.items():
+            setattr(opts[0], key, val)
+        return opts
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/buildinfohelper.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/buildinfohelper.py
index 3ddcb2a..e451c63 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/buildinfohelper.py
@@ -42,10 +42,12 @@
 from orm.models import Package, Package_File, Target_Installed_Package, Target_File
 from orm.models import Task_Dependency, Package_Dependency
 from orm.models import Recipe_Dependency, Provides
-from orm.models import Project, CustomImagePackage, CustomImageRecipe
+from orm.models import Project, CustomImagePackage
 from orm.models import signal_runbuilds
 
 from bldcontrol.models import BuildEnvironment, BuildRequest
+from bldcontrol.models import BRLayer
+from bldcontrol import bbcontroller
 
 from bb.msg import BBLogFormatter as formatter
 from django.db import models
@@ -361,11 +363,6 @@
 
     def get_update_layer_version_object(self, build_obj, layer_obj, layer_version_information):
         if isinstance(layer_obj, Layer_Version):
-            # Special case the toaster-custom-images layer which is created
-            # on the fly so don't update the values which may cause the layer
-            # to be duplicated on a future get_or_create
-            if layer_obj.layer.name == CustomImageRecipe.LAYER_NAME:
-                return layer_obj
             # We already found our layer version for this build so just
             # update it with the new build information
             logger.debug("We found our layer from toaster")
@@ -384,8 +381,8 @@
                 local_path=layer_version_information['local_path'],
             )
 
-            logger.info("created new historical layer version %d",
-                        layer_copy.pk)
+            logger.debug("Created new layer version %s for build history",
+                         layer_copy.layer.name)
 
             self.layer_version_built.append(layer_copy)
 
@@ -441,48 +438,33 @@
         else:
             br_id, be_id = brbe.split(":")
 
-            # find layer by checkout path;
-            from bldcontrol import bbcontroller
-            bc = bbcontroller.getBuildEnvironmentController(pk = be_id)
+            # Find the layer version by matching the layer event information
+            # against the metadata we have in Toaster
 
-            # we might have a race condition here, as the project layers may change between the build trigger and the actual build execution
-            # but we can only match on the layer name, so the worst thing can happen is a mis-identification of the layer, not a total failure
+            try:
+                br_layer = BRLayer.objects.get(req=br_id,
+                                               name=layer_information['name'])
+                return br_layer.layer_version
+            except (BRLayer.MultipleObjectsReturned, BRLayer.DoesNotExist):
+                # There are multiple of the same layer name or the name
+                # hasn't been determined by the toaster.bbclass layer
+                # so let's filter by the local_path
+                bc = bbcontroller.getBuildEnvironmentController(pk=be_id)
+                for br_layer in BRLayer.objects.filter(req=br_id):
+                    if br_layer.giturl and \
+                       layer_information['local_path'].endswith(
+                           bc.getGitCloneDirectory(br_layer.giturl,
+                                                   br_layer.commit)):
+                            return br_layer.layer_version
 
-            # note that this is different
-            buildrequest = BuildRequest.objects.get(pk = br_id)
-            for brl in buildrequest.brlayer_set.all():
-                if brl.local_source_dir:
-                    localdirname = os.path.join(brl.local_source_dir,
-                                                brl.dirpath)
-                else:
-                    localdirname = os.path.join(bc.getGitCloneDirectory(brl.giturl, brl.commit), brl.dirpath)
-                # we get a relative path, unless running in HEAD mode where the path is absolute
-                if not localdirname.startswith("/"):
-                    localdirname = os.path.join(bc.be.sourcedir, localdirname)
-                #logger.debug(1, "Localdirname %s lcal_path %s" % (localdirname, layer_information['local_path']))
-                if localdirname.startswith(layer_information['local_path']):
-                  # If the build request came from toaster this field
-                  # should contain the information from the layer_version
-                  # That created this build request.
-                    if brl.layer_version:
-                        return brl.layer_version
+                    if br_layer.local_source_dir == \
+                            layer_information['local_path']:
+                        return br_layer.layer_version
 
-                # This might be a local layer (i.e. no git info) so try
-                # matching local_source_dir
-                if brl.local_source_dir and brl.local_source_dir == layer_information["local_path"]:
-                    return brl.layer_version
-
-                    # we matched the BRLayer, but we need the layer_version that generated this BR; reverse of the Project.schedule_build()
-                    #logger.debug(1, "Matched %s to BRlayer %s" % (pformat(layer_information["local_path"]), localdirname))
-
-                    for pl in buildrequest.project.projectlayer_set.filter(layercommit__layer__name = brl.name):
-                        if pl.layercommit.layer.vcs_url == brl.giturl :
-                            layer = pl.layercommit.layer
-                            layer.save()
-                            return layer
-
-            raise NotExisting("Unidentified layer %s" % pformat(layer_information))
-
+        # We've reached the end of our search and couldn't find the layer
+        # we can continue but some data may be missing
+        raise NotExisting("Unidentified layer %s" %
+                          pformat(layer_information))
 
     def save_target_file_information(self, build_obj, target_obj, filedata):
         assert isinstance(build_obj, Build)
@@ -876,6 +858,12 @@
         self.pathname = None
         self.lineno = None
 
+    def getMessage(self):
+        """
+        Simulate LogRecord message return
+        """
+        return self.msg
+
 
 class BuildInfoHelper(object):
     """ This class gathers the build information from the server and sends it
@@ -983,9 +971,10 @@
         return task_information
 
     def _get_layer_version_for_dependency(self, pathRE):
-        """ Returns the layer in the toaster db that has a full regex match to the pathRE.
-        pathRE - the layer path passed as a regex in the event. It is created in
-          cooker.py as a collection for the layer priorities.
+        """ Returns the layer in the toaster db that has a full regex
+        match to the pathRE. pathRE - the layer path passed as a regex in the
+        event. It is created in cooker.py as a collection for the layer
+        priorities.
         """
         self._ensure_build()
 
@@ -993,19 +982,31 @@
             assert isinstance(layer_version, Layer_Version)
             return len(layer_version.local_path)
 
-        # we don't care if we match the trailing slashes
-        p = re.compile(re.sub("/[^/]*?$","",pathRE))
-        # Heuristics: we always match recipe to the deepest layer path in the discovered layers
-        for lvo in sorted(self.orm_wrapper.layer_version_objects, reverse=True, key=_sort_longest_path):
-            if p.fullmatch(lvo.local_path):
+        # Our paths don't append a trailing slash
+        if pathRE.endswith("/"):
+            pathRE = pathRE[:-1]
+
+        p = re.compile(pathRE)
+        path=re.sub(r'[$^]',r'',pathRE)
+        # Heuristics: we always match recipe to the deepest layer path in
+        # the discovered layers
+        for lvo in sorted(self.orm_wrapper.layer_version_objects,
+                          reverse=True, key=_sort_longest_path):
+            if p.fullmatch(os.path.abspath(lvo.local_path)):
                 return lvo
             if lvo.layer.local_source_dir:
-                if p.fullmatch(lvo.layer.local_source_dir):
+                if p.fullmatch(os.path.abspath(lvo.layer.local_source_dir)):
                     return lvo
-        #if we get here, we didn't read layers correctly; dump whatever information we have on the error log
-        logger.warning("Could not match layer dependency for path %s : %s", path, self.orm_wrapper.layer_version_objects)
+            if 0 == path.find(lvo.local_path):
+                # sub-layer path inside existing layer
+                return lvo
 
-
+        # if we get here, we didn't read layers correctly;
+        # dump whatever information we have on the error log
+        logger.warning("Could not match layer dependency for path %s : %s",
+                       pathRE,
+                       self.orm_wrapper.layer_version_objects)
+        return None
 
     def _get_layer_version_for_path(self, path):
         self._ensure_build()
@@ -1268,6 +1269,14 @@
                 candidates = [x for x in self.internal_state['taskdata'].keys() if x.endswith(identifier)]
                 if len(candidates) == 1:
                     identifier = candidates[0]
+                elif len(candidates) > 1 and hasattr(event,'_package'):
+                    if 'native-' in event._package:
+                        identifier = 'native:' + identifier
+                    if 'nativesdk-' in event._package:
+                        identifier = 'nativesdk:' + identifier
+                    candidates = [x for x in self.internal_state['taskdata'].keys() if x.endswith(identifier)]
+                    if len(candidates) == 1:
+                        identifier = candidates[0]
 
         assert identifier in self.internal_state['taskdata']
         identifierlist = identifier.split(":")
@@ -1398,9 +1407,9 @@
             for lv in event._depgraph['layer-priorities']:
                 (_, path, _, priority) = lv
                 layer_version_obj = self._get_layer_version_for_dependency(path)
-                assert layer_version_obj is not None
-                layer_version_obj.priority = priority
-                layer_version_obj.save()
+                if layer_version_obj:
+                    layer_version_obj.priority = priority
+                    layer_version_obj.save()
 
         # save recipe information
         self.internal_state['recipes'] = {}
@@ -1665,6 +1674,36 @@
                 break
         return endswith
 
+    def scan_task_artifacts(self, event):
+        """
+        The 'TaskArtifacts' event passes the manifest file content for the
+        tasks 'do_deploy', 'do_image_complete', 'do_populate_sdk', and
+        'do_populate_sdk_ext'. The first two will be implemented later.
+        """
+        task_vars = BuildInfoHelper._get_data_from_event(event)
+        task_name = task_vars['task'][task_vars['task'].find(':')+1:]
+        task_artifacts = task_vars['artifacts']
+
+        if task_name in ['do_populate_sdk', 'do_populate_sdk_ext']:
+            targets = [target for target in self.internal_state['targets'] \
+                if target.task == task_name[3:]]
+            if not targets:
+                logger.warning("scan_task_artifacts: SDK targets not found: %s\n", task_name)
+                return
+            for artifact_path in task_artifacts:
+                if not os.path.isfile(artifact_path):
+                    logger.warning("scan_task_artifacts: artifact file not found: %s\n", artifact_path)
+                    continue
+                for target in targets:
+                    # don't record the file if it's already been added
+                    # to this target
+                    matching_files = TargetSDKFile.objects.filter(
+                        target=target, file_name=artifact_path)
+                    if matching_files.count() == 0:
+                        artifact_size = os.stat(artifact_path).st_size
+                        self.orm_wrapper.save_target_sdk_file(
+                            target, artifact_path, artifact_size)
+
     def _get_image_files(self, deploy_dir_image, image_name, image_file_extensions):
         """
         Find files in deploy_dir_image whose basename starts with the
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/depexp.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/depexp.py
deleted file mode 100644
index d879e04..0000000
--- a/import-layers/yocto-poky/bitbake/lib/bb/ui/depexp.py
+++ /dev/null
@@ -1,358 +0,0 @@
-#
-# BitBake Graphical GTK based Dependency Explorer
-#
-# Copyright (C) 2007        Ross Burton
-# Copyright (C) 2007 - 2008 Richard Purdie
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-import sys
-import gi
-gi.require_version('Gtk', '3.0')
-from gi.repository import Gtk, Gdk, GObject
-from multiprocessing import Queue
-import threading
-from xmlrpc import client
-import time
-import bb
-import bb.event
-
-# Package Model
-(COL_PKG_NAME) = (0)
-
-# Dependency Model
-(TYPE_DEP, TYPE_RDEP) = (0, 1)
-(COL_DEP_TYPE, COL_DEP_PARENT, COL_DEP_PACKAGE) = (0, 1, 2)
-
-
-class PackageDepView(Gtk.TreeView):
-    def __init__(self, model, dep_type, label):
-        Gtk.TreeView.__init__(self)
-        self.current = None
-        self.dep_type = dep_type
-        self.filter_model = model.filter_new()
-        self.filter_model.set_visible_func(self._filter, data=None)
-        self.set_model(self.filter_model)
-        self.append_column(Gtk.TreeViewColumn(label, Gtk.CellRendererText(), text=COL_DEP_PACKAGE))
-
-    def _filter(self, model, iter, data):
-        this_type = model[iter][COL_DEP_TYPE]
-        package = model[iter][COL_DEP_PARENT]
-        if this_type != self.dep_type: return False
-        return package == self.current
-
-    def set_current_package(self, package):
-        self.current = package
-        self.filter_model.refilter()
-
-
-class PackageReverseDepView(Gtk.TreeView):
-    def __init__(self, model, label):
-        Gtk.TreeView.__init__(self)
-        self.current = None
-        self.filter_model = model.filter_new()
-        self.filter_model.set_visible_func(self._filter)
-        self.set_model(self.filter_model)
-        self.append_column(Gtk.TreeViewColumn(label, Gtk.CellRendererText(), text=COL_DEP_PARENT))
-
-    def _filter(self, model, iter, data):
-        package = model[iter][COL_DEP_PACKAGE]
-        return package == self.current
-
-    def set_current_package(self, package):
-        self.current = package
-        self.filter_model.refilter()
-
-
-class DepExplorer(Gtk.Window):
-    def __init__(self):
-        Gtk.Window.__init__(self)
-        self.set_title("Dependency Explorer")
-        self.set_default_size(500, 500)
-        self.connect("delete-event", Gtk.main_quit)
-
-        # Create the data models
-        self.pkg_model = Gtk.ListStore(GObject.TYPE_STRING)
-        self.pkg_model.set_sort_column_id(COL_PKG_NAME, Gtk.SortType.ASCENDING)
-        self.depends_model = Gtk.ListStore(GObject.TYPE_INT, GObject.TYPE_STRING, GObject.TYPE_STRING)
-        self.depends_model.set_sort_column_id(COL_DEP_PACKAGE, Gtk.SortType.ASCENDING)
-
-        pane = Gtk.HPaned()
-        pane.set_position(250)
-        self.add(pane)
-
-        # The master list of packages
-        scrolled = Gtk.ScrolledWindow()
-        scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
-        scrolled.set_shadow_type(Gtk.ShadowType.IN)
-
-        self.pkg_treeview = Gtk.TreeView(self.pkg_model)
-        self.pkg_treeview.get_selection().connect("changed", self.on_cursor_changed)
-        column = Gtk.TreeViewColumn("Package", Gtk.CellRendererText(), text=COL_PKG_NAME)
-        self.pkg_treeview.append_column(column)
-        pane.add1(scrolled)
-        scrolled.add(self.pkg_treeview)
-
-        box = Gtk.VBox(homogeneous=True, spacing=4)
-
-        # Runtime Depends
-        scrolled = Gtk.ScrolledWindow()
-        scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
-        scrolled.set_shadow_type(Gtk.ShadowType.IN)
-        self.rdep_treeview = PackageDepView(self.depends_model, TYPE_RDEP, "Runtime Depends")
-        self.rdep_treeview.connect("row-activated", self.on_package_activated, COL_DEP_PACKAGE)
-        scrolled.add(self.rdep_treeview)
-        box.add(scrolled)
-
-        # Build Depends
-        scrolled = Gtk.ScrolledWindow()
-        scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
-        scrolled.set_shadow_type(Gtk.ShadowType.IN)
-        self.dep_treeview = PackageDepView(self.depends_model, TYPE_DEP, "Build Depends")
-        self.dep_treeview.connect("row-activated", self.on_package_activated, COL_DEP_PACKAGE)
-        scrolled.add(self.dep_treeview)
-        box.add(scrolled)
-        pane.add2(box)
-
-        # Reverse Depends
-        scrolled = Gtk.ScrolledWindow()
-        scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
-        scrolled.set_shadow_type(Gtk.ShadowType.IN)
-        self.revdep_treeview = PackageReverseDepView(self.depends_model, "Reverse Depends")
-        self.revdep_treeview.connect("row-activated", self.on_package_activated, COL_DEP_PARENT)
-        scrolled.add(self.revdep_treeview)
-        box.add(scrolled)
-        pane.add2(box)
-
-        self.show_all()
-
-    def on_package_activated(self, treeview, path, column, data_col):
-        model = treeview.get_model()
-        package = model.get_value(model.get_iter(path), data_col)
-
-        pkg_path = []
-        def finder(model, path, iter, needle):
-            package = model.get_value(iter, COL_PKG_NAME)
-            if package == needle:
-                pkg_path.append(path)
-                return True
-            else:
-                return False
-        self.pkg_model.foreach(finder, package)
-        if pkg_path:
-            self.pkg_treeview.get_selection().select_path(pkg_path[0])
-            self.pkg_treeview.scroll_to_cell(pkg_path[0])
-
-    def on_cursor_changed(self, selection):
-        (model, it) = selection.get_selected()
-        if it is None:
-            current_package = None
-        else:
-            current_package = model.get_value(it, COL_PKG_NAME)
-        self.rdep_treeview.set_current_package(current_package)
-        self.dep_treeview.set_current_package(current_package)
-        self.revdep_treeview.set_current_package(current_package)
-
-
-    def parse(self, depgraph):
-        for package in depgraph["pn"]:
-            self.pkg_model.insert(0, (package,))
-
-        for package in depgraph["depends"]:
-            for depend in depgraph["depends"][package]:
-                self.depends_model.insert (0, (TYPE_DEP, package, depend))
-
-        for package in depgraph["rdepends-pn"]:
-            for rdepend in depgraph["rdepends-pn"][package]:
-                self.depends_model.insert (0, (TYPE_RDEP, package, rdepend))
-
-
-class gtkthread(threading.Thread):
-    quit = threading.Event()
-    def __init__(self, shutdown):
-        threading.Thread.__init__(self)
-        self.setDaemon(True)
-        self.shutdown = shutdown
-        if not Gtk.init_check()[0]:
-            sys.stderr.write("Gtk+ init failed. Make sure DISPLAY variable is set.\n")
-            gtkthread.quit.set()
-
-    def run(self):
-        GObject.threads_init()
-        Gdk.threads_init()
-        Gtk.main()
-        gtkthread.quit.set()
-
-
-def main(server, eventHandler, params):
-    shutdown = 0
-
-    gtkgui = gtkthread(shutdown)
-    gtkgui.start()
-
-    try:
-        params.updateFromServer(server)
-        cmdline = params.parseActions()
-        if not cmdline:
-            print("Nothing to do.  Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
-            return 1
-        if 'msg' in cmdline and cmdline['msg']:
-            print(cmdline['msg'])
-            return 1
-        cmdline = cmdline['action']
-        if not cmdline or cmdline[0] != "generateDotGraph":
-            print("This UI requires the -g option")
-            return 1
-        ret, error = server.runCommand(["generateDepTreeEvent", cmdline[1], cmdline[2]])
-        if error:
-            print("Error running command '%s': %s" % (cmdline, error))
-            return 1
-        elif ret != True:
-            print("Error running command '%s': returned %s" % (cmdline, ret))
-            return 1
-    except client.Fault as x:
-        print("XMLRPC Fault getting commandline:\n %s" % x)
-        return
-
-    if gtkthread.quit.isSet():
-        return
-
-    Gdk.threads_enter()
-    dep = DepExplorer()
-    bardialog = Gtk.Dialog(parent=dep,
-            flags=Gtk.DialogFlags.MODAL|Gtk.DialogFlags.DESTROY_WITH_PARENT)
-    bardialog.set_default_size(400, 50)
-    box = bardialog.get_content_area()
-    pbar = Gtk.ProgressBar()
-    box.pack_start(pbar, True, True, 0)
-    bardialog.show_all()
-    bardialog.connect("delete-event", Gtk.main_quit)
-    Gdk.threads_leave()
-
-    progress_total = 0
-    while True:
-        try:
-            event = eventHandler.waitEvent(0.25)
-            if gtkthread.quit.isSet():
-                _, error = server.runCommand(["stateForceShutdown"])
-                if error:
-                    print('Unable to cleanly stop: %s' % error)
-                break
-
-            if event is None:
-                continue
-
-            if isinstance(event, bb.event.CacheLoadStarted):
-                progress_total = event.total
-                Gdk.threads_enter()
-                bardialog.set_title("Loading Cache")
-                pbar.set_fraction(0.0)
-                Gdk.threads_leave()
-
-            if isinstance(event, bb.event.CacheLoadProgress):
-                x = event.current
-                Gdk.threads_enter()
-                pbar.set_fraction(x * 1.0 / progress_total)
-                Gdk.threads_leave()
-                continue
-
-            if isinstance(event, bb.event.CacheLoadCompleted):
-                continue
-
-            if isinstance(event, bb.event.ParseStarted):
-                progress_total = event.total
-                if progress_total == 0:
-                    continue
-                Gdk.threads_enter()
-                pbar.set_fraction(0.0)
-                bardialog.set_title("Processing recipes")
-                Gdk.threads_leave()
-
-            if isinstance(event, bb.event.ParseProgress):
-                x = event.current
-                Gdk.threads_enter()
-                pbar.set_fraction(x * 1.0 / progress_total)
-                Gdk.threads_leave()
-                continue
-
-            if isinstance(event, bb.event.ParseCompleted):
-                Gdk.threads_enter()
-                bardialog.set_title("Generating dependency tree")
-                Gdk.threads_leave()
-                continue
-
-            if isinstance(event, bb.event.DepTreeGenerated):
-                Gdk.threads_enter()
-                bardialog.hide()
-                dep.parse(event._depgraph)
-                Gdk.threads_leave()
-
-            if isinstance(event, bb.command.CommandCompleted):
-                continue
-
-            if isinstance(event, bb.event.NoProvider):
-                if event._runtime:
-                    r = "R"
-                else:
-                    r = ""
-
-                extra = ''
-                if not event._reasons:
-                    if event._close_matches:
-                        extra = ". Close matches:\n  %s" % '\n  '.join(event._close_matches)
-
-                if event._dependees:
-                    print("Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)%s" % r, event._item, ", ".join(event._dependees), r, extra)
-                else:
-                    print("Nothing %sPROVIDES '%s'%s" % (r, event._item, extra))
-                if event._reasons:
-                    for reason in event._reasons:
-                        print(reason)
-
-                _, error = server.runCommand(["stateShutdown"])
-                if error:
-                    print('Unable to cleanly shutdown: %s' % error)
-                break
-
-            if isinstance(event, bb.command.CommandFailed):
-                print("Command execution failed: %s" % event.error)
-                return event.exitcode
-
-            if isinstance(event, bb.command.CommandExit):
-                return event.exitcode
-
-            if isinstance(event, bb.cooker.CookerExit):
-                break
-
-            continue
-        except EnvironmentError as ioerror:
-            # ignore interrupted io
-            if ioerror.args[0] == 4:
-                pass
-        except KeyboardInterrupt:
-            if shutdown == 2:
-                print("\nThird Keyboard Interrupt, exit.\n")
-                break
-            if shutdown == 1:
-                print("\nSecond Keyboard Interrupt, stopping...\n")
-                _, error = server.runCommand(["stateForceShutdown"])
-                if error:
-                    print('Unable to cleanly stop: %s' % error)
-            if shutdown == 0:
-                print("\nKeyboard Interrupt, closing down...\n")
-                _, error = server.runCommand(["stateShutdown"])
-                if error:
-                    print('Unable to cleanly shutdown: %s' % error)
-            shutdown = shutdown + 1
-            pass
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/knotty.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/knotty.py
index 948f527..82aa7c4 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/ui/knotty.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/knotty.py
@@ -75,10 +75,8 @@
                 extrastr = str(extra)
                 if extrastr[0] != ' ':
                     extrastr = ' ' + extrastr
-                if extrastr[-1] != ' ':
-                    extrastr += ' '
             else:
-                extrastr = ' '
+                extrastr = ''
             self.widgets[self.extrapos] = extrastr
 
     def _need_update(self):
@@ -284,7 +282,7 @@
             content = self.main_progress.update(progress)
             print('')
         lines = 1 + int(len(content) / (self.columns + 1))
-        if not self.quiet:
+        if self.quiet == 0:
             for tasknum, task in enumerate(tasks[:(self.rows - 2)]):
                 if isinstance(task, tuple):
                     pbar, progress, rate, start_time = task
@@ -312,7 +310,7 @@
             fd = sys.stdin.fileno()
             self.termios.tcsetattr(fd, self.termios.TCSADRAIN, self.stdinbackup)
 
-def _log_settings_from_server(server):
+def _log_settings_from_server(server, observe_only):
     # Get values of variables which control our output
     includelogs, error = server.runCommand(["getVariable", "BBINCLUDELOGS"])
     if error:
@@ -322,7 +320,11 @@
     if error:
         logger.error("Unable to get the value of BBINCLUDELOGS_LINES variable: %s" % error)
         raise BaseException(error)
-    consolelogfile, error = server.runCommand(["getSetVariable", "BB_CONSOLELOG"])
+    if observe_only:
+        cmd = 'getVariable'
+    else:
+        cmd = 'getSetVariable'
+    consolelogfile, error = server.runCommand([cmd, "BB_CONSOLELOG"])
     if error:
         logger.error("Unable to get the value of BB_CONSOLELOG variable: %s" % error)
         raise BaseException(error)
@@ -340,7 +342,7 @@
 
 def main(server, eventHandler, params, tf = TerminalFilter):
 
-    includelogs, loglines, consolelogfile = _log_settings_from_server(server)
+    includelogs, loglines, consolelogfile = _log_settings_from_server(server, params.observe_only)
 
     if sys.stdin.isatty() and sys.stdout.isatty():
         log_exec_tty = True
@@ -353,10 +355,13 @@
     errconsole = logging.StreamHandler(sys.stderr)
     format_str = "%(levelname)s: %(message)s"
     format = bb.msg.BBLogFormatter(format_str)
-    if params.options.quiet:
-        bb.msg.addDefaultlogFilter(console, bb.msg.BBLogFilterStdOut, bb.msg.BBLogFormatter.WARNING)
+    if params.options.quiet == 0:
+        forcelevel = None
+    elif params.options.quiet > 2:
+        forcelevel = bb.msg.BBLogFormatter.ERROR
     else:
-        bb.msg.addDefaultlogFilter(console, bb.msg.BBLogFilterStdOut)
+        forcelevel = bb.msg.BBLogFormatter.WARNING
+    bb.msg.addDefaultlogFilter(console, bb.msg.BBLogFilterStdOut, forcelevel)
     bb.msg.addDefaultlogFilter(errconsole, bb.msg.BBLogFilterStdErr)
     console.setFormatter(format)
     errconsole.setFormatter(format)
@@ -506,35 +511,47 @@
                 logger.info(event._message)
                 continue
             if isinstance(event, bb.event.ParseStarted):
+                if params.options.quiet > 1:
+                    continue
                 if event.total == 0:
                     continue
                 parseprogress = new_progress("Parsing recipes", event.total).start()
                 continue
             if isinstance(event, bb.event.ParseProgress):
+                if params.options.quiet > 1:
+                    continue
                 if parseprogress:
                     parseprogress.update(event.current)
                 else:
                     bb.warn("Got ParseProgress event for parsing that never started?")
                 continue
             if isinstance(event, bb.event.ParseCompleted):
+                if params.options.quiet > 1:
+                    continue
                 if not parseprogress:
                     continue
                 parseprogress.finish()
                 pasreprogress = None
-                if not params.options.quiet:
+                if params.options.quiet == 0:
                     print(("Parsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
                         % ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors)))
                 continue
 
             if isinstance(event, bb.event.CacheLoadStarted):
+                if params.options.quiet > 1:
+                    continue
                 cacheprogress = new_progress("Loading cache", event.total).start()
                 continue
             if isinstance(event, bb.event.CacheLoadProgress):
+                if params.options.quiet > 1:
+                    continue
                 cacheprogress.update(event.current)
                 continue
             if isinstance(event, bb.event.CacheLoadCompleted):
+                if params.options.quiet > 1:
+                    continue
                 cacheprogress.finish()
-                if not params.options.quiet:
+                if params.options.quiet == 0:
                     print("Loaded %d entries from dependency cache." % event.num_entries)
                 continue
 
@@ -620,16 +637,22 @@
                 continue
 
             if isinstance(event, bb.event.ProcessStarted):
+                if params.options.quiet > 1:
+                    continue
                 parseprogress = new_progress(event.processname, event.total)
                 parseprogress.start(False)
                 continue
             if isinstance(event, bb.event.ProcessProgress):
+                if params.options.quiet > 1:
+                    continue
                 if parseprogress:
                     parseprogress.update(event.progress)
                 else:
                     bb.warn("Got ProcessProgress event for someting that never started?")
                 continue
             if isinstance(event, bb.event.ProcessFinished):
+                if params.options.quiet > 1:
+                    continue
                 if parseprogress:
                     parseprogress.finish()
                 parseprogress = None
@@ -647,6 +670,7 @@
                                   bb.event.OperationCompleted,
                                   bb.event.OperationProgress,
                                   bb.event.DiskFull,
+                                  bb.event.HeartbeatEvent,
                                   bb.build.TaskProgress)):
                 continue
 
@@ -700,7 +724,7 @@
         if return_value and errors:
             summary += pluralise("\nSummary: There was %s ERROR message shown, returning a non-zero exit code.",
                                  "\nSummary: There were %s ERROR messages shown, returning a non-zero exit code.", errors)
-        if summary and not params.options.quiet:
+        if summary and params.options.quiet == 0:
             print(summary)
 
         if interrupted:
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/ncurses.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/ncurses.py
index d81e413..ca845a3 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/ui/ncurses.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/ncurses.py
@@ -297,7 +297,7 @@
 #                            bb.error("log data follows (%s)" % logfile)
 #                            number_of_lines = data.getVar("BBINCLUDELOGS_LINES", d)
 #                            if number_of_lines:
-#                                subprocess.call('tail -n%s %s' % (number_of_lines, logfile), shell=True)
+#                                subprocess.check_call('tail -n%s %s' % (number_of_lines, logfile), shell=True)
 #                            else:
 #                                f = open(logfile, "r")
 #                                while True:
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/taskexp.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/taskexp.py
new file mode 100644
index 0000000..9d14ece
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/taskexp.py
@@ -0,0 +1,342 @@
+#
+# BitBake Graphical GTK based Dependency Explorer
+#
+# Copyright (C) 2007        Ross Burton
+# Copyright (C) 2007 - 2008 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import gi
+gi.require_version('Gtk', '3.0')
+from gi.repository import Gtk, Gdk, GObject
+from multiprocessing import Queue
+import threading
+from xmlrpc import client
+import time
+import bb
+import bb.event
+
+# Package Model
+(COL_PKG_NAME) = (0)
+
+# Dependency Model
+(TYPE_DEP, TYPE_RDEP) = (0, 1)
+(COL_DEP_TYPE, COL_DEP_PARENT, COL_DEP_PACKAGE) = (0, 1, 2)
+
+
+class PackageDepView(Gtk.TreeView):
+    def __init__(self, model, dep_type, label):
+        Gtk.TreeView.__init__(self)
+        self.current = None
+        self.dep_type = dep_type
+        self.filter_model = model.filter_new()
+        self.filter_model.set_visible_func(self._filter, data=None)
+        self.set_model(self.filter_model)
+        self.append_column(Gtk.TreeViewColumn(label, Gtk.CellRendererText(), text=COL_DEP_PACKAGE))
+
+    def _filter(self, model, iter, data):
+        this_type = model[iter][COL_DEP_TYPE]
+        package = model[iter][COL_DEP_PARENT]
+        if this_type != self.dep_type: return False
+        return package == self.current
+
+    def set_current_package(self, package):
+        self.current = package
+        self.filter_model.refilter()
+
+
+class PackageReverseDepView(Gtk.TreeView):
+    def __init__(self, model, label):
+        Gtk.TreeView.__init__(self)
+        self.current = None
+        self.filter_model = model.filter_new()
+        self.filter_model.set_visible_func(self._filter)
+        self.set_model(self.filter_model)
+        self.append_column(Gtk.TreeViewColumn(label, Gtk.CellRendererText(), text=COL_DEP_PARENT))
+
+    def _filter(self, model, iter, data):
+        package = model[iter][COL_DEP_PACKAGE]
+        return package == self.current
+
+    def set_current_package(self, package):
+        self.current = package
+        self.filter_model.refilter()
+
+
+class DepExplorer(Gtk.Window):
+    def __init__(self):
+        Gtk.Window.__init__(self)
+        self.set_title("Task Dependency Explorer")
+        self.set_default_size(500, 500)
+        self.connect("delete-event", Gtk.main_quit)
+
+        # Create the data models
+        self.pkg_model = Gtk.ListStore(GObject.TYPE_STRING)
+        self.pkg_model.set_sort_column_id(COL_PKG_NAME, Gtk.SortType.ASCENDING)
+        self.depends_model = Gtk.ListStore(GObject.TYPE_INT, GObject.TYPE_STRING, GObject.TYPE_STRING)
+        self.depends_model.set_sort_column_id(COL_DEP_PACKAGE, Gtk.SortType.ASCENDING)
+
+        pane = Gtk.HPaned()
+        pane.set_position(250)
+        self.add(pane)
+
+        # The master list of packages
+        scrolled = Gtk.ScrolledWindow()
+        scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
+        scrolled.set_shadow_type(Gtk.ShadowType.IN)
+
+        self.pkg_treeview = Gtk.TreeView(self.pkg_model)
+        self.pkg_treeview.get_selection().connect("changed", self.on_cursor_changed)
+        column = Gtk.TreeViewColumn("Package", Gtk.CellRendererText(), text=COL_PKG_NAME)
+        self.pkg_treeview.append_column(column)
+        pane.add1(scrolled)
+        scrolled.add(self.pkg_treeview)
+
+        box = Gtk.VBox(homogeneous=True, spacing=4)
+
+        # Task Depends
+        scrolled = Gtk.ScrolledWindow()
+        scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
+        scrolled.set_shadow_type(Gtk.ShadowType.IN)
+        self.dep_treeview = PackageDepView(self.depends_model, TYPE_DEP, "Dependencies")
+        self.dep_treeview.connect("row-activated", self.on_package_activated, COL_DEP_PACKAGE)
+        scrolled.add(self.dep_treeview)
+        box.add(scrolled)
+        pane.add2(box)
+
+        # Reverse Task Depends
+        scrolled = Gtk.ScrolledWindow()
+        scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
+        scrolled.set_shadow_type(Gtk.ShadowType.IN)
+        self.revdep_treeview = PackageReverseDepView(self.depends_model, "Dependent Tasks")
+        self.revdep_treeview.connect("row-activated", self.on_package_activated, COL_DEP_PARENT)
+        scrolled.add(self.revdep_treeview)
+        box.add(scrolled)
+        pane.add2(box)
+
+        self.show_all()
+
+    def on_package_activated(self, treeview, path, column, data_col):
+        model = treeview.get_model()
+        package = model.get_value(model.get_iter(path), data_col)
+
+        pkg_path = []
+        def finder(model, path, iter, needle):
+            package = model.get_value(iter, COL_PKG_NAME)
+            if package == needle:
+                pkg_path.append(path)
+                return True
+            else:
+                return False
+        self.pkg_model.foreach(finder, package)
+        if pkg_path:
+            self.pkg_treeview.get_selection().select_path(pkg_path[0])
+            self.pkg_treeview.scroll_to_cell(pkg_path[0])
+
+    def on_cursor_changed(self, selection):
+        (model, it) = selection.get_selected()
+        if it is None:
+            current_package = None
+        else:
+            current_package = model.get_value(it, COL_PKG_NAME)
+        self.dep_treeview.set_current_package(current_package)
+        self.revdep_treeview.set_current_package(current_package)
+
+
+    def parse(self, depgraph):
+        for task in depgraph["tdepends"]:
+            self.pkg_model.insert(0, (task,))
+            for depend in depgraph["tdepends"][task]:
+                self.depends_model.insert (0, (TYPE_DEP, task, depend))
+
+
+class gtkthread(threading.Thread):
+    quit = threading.Event()
+    def __init__(self, shutdown):
+        threading.Thread.__init__(self)
+        self.setDaemon(True)
+        self.shutdown = shutdown
+        if not Gtk.init_check()[0]:
+            sys.stderr.write("Gtk+ init failed. Make sure DISPLAY variable is set.\n")
+            gtkthread.quit.set()
+
+    def run(self):
+        GObject.threads_init()
+        Gdk.threads_init()
+        Gtk.main()
+        gtkthread.quit.set()
+
+
+def main(server, eventHandler, params):
+    shutdown = 0
+
+    gtkgui = gtkthread(shutdown)
+    gtkgui.start()
+
+    try:
+        params.updateFromServer(server)
+        cmdline = params.parseActions()
+        if not cmdline:
+            print("Nothing to do.  Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
+            return 1
+        if 'msg' in cmdline and cmdline['msg']:
+            print(cmdline['msg'])
+            return 1
+        cmdline = cmdline['action']
+        if not cmdline or cmdline[0] != "generateDotGraph":
+            print("This UI requires the -g option")
+            return 1
+        ret, error = server.runCommand(["generateDepTreeEvent", cmdline[1], cmdline[2]])
+        if error:
+            print("Error running command '%s': %s" % (cmdline, error))
+            return 1
+        elif ret != True:
+            print("Error running command '%s': returned %s" % (cmdline, ret))
+            return 1
+    except client.Fault as x:
+        print("XMLRPC Fault getting commandline:\n %s" % x)
+        return
+
+    if gtkthread.quit.isSet():
+        return
+
+    Gdk.threads_enter()
+    dep = DepExplorer()
+    bardialog = Gtk.Dialog(parent=dep,
+            flags=Gtk.DialogFlags.MODAL|Gtk.DialogFlags.DESTROY_WITH_PARENT)
+    bardialog.set_default_size(400, 50)
+    box = bardialog.get_content_area()
+    pbar = Gtk.ProgressBar()
+    box.pack_start(pbar, True, True, 0)
+    bardialog.show_all()
+    bardialog.connect("delete-event", Gtk.main_quit)
+    Gdk.threads_leave()
+
+    progress_total = 0
+    while True:
+        try:
+            event = eventHandler.waitEvent(0.25)
+            if gtkthread.quit.isSet():
+                _, error = server.runCommand(["stateForceShutdown"])
+                if error:
+                    print('Unable to cleanly stop: %s' % error)
+                break
+
+            if event is None:
+                continue
+
+            if isinstance(event, bb.event.CacheLoadStarted):
+                progress_total = event.total
+                Gdk.threads_enter()
+                bardialog.set_title("Loading Cache")
+                pbar.set_fraction(0.0)
+                Gdk.threads_leave()
+
+            if isinstance(event, bb.event.CacheLoadProgress):
+                x = event.current
+                Gdk.threads_enter()
+                pbar.set_fraction(x * 1.0 / progress_total)
+                Gdk.threads_leave()
+                continue
+
+            if isinstance(event, bb.event.CacheLoadCompleted):
+                continue
+
+            if isinstance(event, bb.event.ParseStarted):
+                progress_total = event.total
+                if progress_total == 0:
+                    continue
+                Gdk.threads_enter()
+                pbar.set_fraction(0.0)
+                bardialog.set_title("Processing recipes")
+                Gdk.threads_leave()
+
+            if isinstance(event, bb.event.ParseProgress):
+                x = event.current
+                Gdk.threads_enter()
+                pbar.set_fraction(x * 1.0 / progress_total)
+                Gdk.threads_leave()
+                continue
+
+            if isinstance(event, bb.event.ParseCompleted):
+                Gdk.threads_enter()
+                bardialog.set_title("Generating dependency tree")
+                Gdk.threads_leave()
+                continue
+
+            if isinstance(event, bb.event.DepTreeGenerated):
+                Gdk.threads_enter()
+                bardialog.hide()
+                dep.parse(event._depgraph)
+                Gdk.threads_leave()
+
+            if isinstance(event, bb.command.CommandCompleted):
+                continue
+
+            if isinstance(event, bb.event.NoProvider):
+                if event._runtime:
+                    r = "R"
+                else:
+                    r = ""
+
+                extra = ''
+                if not event._reasons:
+                    if event._close_matches:
+                        extra = ". Close matches:\n  %s" % '\n  '.join(event._close_matches)
+
+                if event._dependees:
+                    print("Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)%s" % (r, event._item, ", ".join(event._dependees), r, extra))
+                else:
+                    print("Nothing %sPROVIDES '%s'%s" % (r, event._item, extra))
+                if event._reasons:
+                    for reason in event._reasons:
+                        print(reason)
+
+                _, error = server.runCommand(["stateShutdown"])
+                if error:
+                    print('Unable to cleanly shutdown: %s' % error)
+                break
+
+            if isinstance(event, bb.command.CommandFailed):
+                print("Command execution failed: %s" % event.error)
+                return event.exitcode
+
+            if isinstance(event, bb.command.CommandExit):
+                return event.exitcode
+
+            if isinstance(event, bb.cooker.CookerExit):
+                break
+
+            continue
+        except EnvironmentError as ioerror:
+            # ignore interrupted io
+            if ioerror.args[0] == 4:
+                pass
+        except KeyboardInterrupt:
+            if shutdown == 2:
+                print("\nThird Keyboard Interrupt, exit.\n")
+                break
+            if shutdown == 1:
+                print("\nSecond Keyboard Interrupt, stopping...\n")
+                _, error = server.runCommand(["stateForceShutdown"])
+                if error:
+                    print('Unable to cleanly stop: %s' % error)
+            if shutdown == 0:
+                print("\nKeyboard Interrupt, closing down...\n")
+                _, error = server.runCommand(["stateShutdown"])
+                if error:
+                    print('Unable to cleanly shutdown: %s' % error)
+            shutdown = shutdown + 1
+            pass
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/toasterui.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/toasterui.py
index 9808f6b..71f04fa 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/ui/toasterui.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/toasterui.py
@@ -168,6 +168,9 @@
         logger.warning("buildhistory is not enabled. Please enable INHERIT += \"buildhistory\" to see image details.")
         build_history_enabled = False
 
+    if not "buildstats" in inheritlist.split(" "):
+        logger.warning("buildstats is not enabled. Please enable INHERIT += \"buildstats\" to generate build statistics.")
+
     if not params.observe_only:
         params.updateFromServer(server)
         params.updateToServer(server, os.environ.copy())
@@ -233,6 +236,9 @@
             # pylint: disable=protected-access
             # the code will look into the protected variables of the event; no easy way around this
 
+            if isinstance(event, bb.event.HeartbeatEvent):
+                continue
+
             if isinstance(event, bb.event.ParseStarted):
                 if not (build_log and build_log_file_path):
                     build_log, build_log_file_path = _open_build_log(log_dir)
@@ -432,9 +438,7 @@
                 elif event.type == "SetBRBE":
                     buildinfohelper.brbe = buildinfohelper._get_data_from_event(event)
                 elif event.type == "TaskArtifacts":
-                    # not implemented yet
-                    # see https://bugzilla.yoctoproject.org/show_bug.cgi?id=10283 for details
-                    pass
+                    buildinfohelper.scan_task_artifacts(event)
                 elif event.type == "OSErrorException":
                     logger.error(event)
                 else:
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/utils.py b/import-layers/yocto-poky/bitbake/lib/bb/utils.py
index 16fc9db..6a44db5 100644
--- a/import-layers/yocto-poky/bitbake/lib/bb/utils.py
+++ b/import-layers/yocto-poky/bitbake/lib/bb/utils.py
@@ -523,12 +523,8 @@
     """
     Return the hex string representation of the MD5 checksum of filename.
     """
-    try:
-        import hashlib
-        m = hashlib.md5()
-    except ImportError:
-        import md5
-        m = md5.new()
+    import hashlib
+    m = hashlib.md5()
 
     with open(filename, "rb") as f:
         for line in f:
@@ -538,14 +534,9 @@
 def sha256_file(filename):
     """
     Return the hex string representation of the 256-bit SHA checksum of
-    filename.  On Python 2.4 this will return None, so callers will need to
-    handle that by either skipping SHA checks, or running a standalone sha256sum
-    binary.
+    filename.
     """
-    try:
-        import hashlib
-    except ImportError:
-        return None
+    import hashlib
 
     s = hashlib.sha256()
     with open(filename, "rb") as f:
@@ -557,10 +548,7 @@
     """
     Return the hex string representation of the SHA1 checksum of the filename
     """
-    try:
-        import hashlib
-    except ImportError:
-        return None
+    import hashlib
 
     s = hashlib.sha1()
     with open(filename, "rb") as f:
@@ -665,7 +653,7 @@
     for var in bb.data.keys(d):
         export = d.getVarFlag(var, "export", False)
         if export:
-            os.environ[var] = d.getVar(var, True) or ""
+            os.environ[var] = d.getVar(var) or ""
 
 def _check_unsafe_delete_path(path):
     """
@@ -692,7 +680,7 @@
             if _check_unsafe_delete_path(path):
                 raise Exception('bb.utils.remove: called with dangerous path "%s" and recurse=True, refusing to delete!' % path)
         # shutil.rmtree(name) would be ideal but its too slow
-        subprocess.call(['rm', '-rf'] + glob.glob(path))
+        subprocess.check_call(['rm', '-rf'] + glob.glob(path))
         return
     for name in glob.glob(path):
         try:
@@ -911,11 +899,20 @@
         newmtime = sstat[stat.ST_MTIME]
     return newmtime
 
-def which(path, item, direction = 0, history = False):
+def which(path, item, direction = 0, history = False, executable=False):
     """
-    Locate a file in a PATH
+    Locate `item` in the list of paths `path` (colon separated string like $PATH).
+    If `direction` is non-zero then the list is reversed.
+    If `history` is True then the list of candidates also returned as result,history.
+    If `executable` is True then the candidate has to be an executable file,
+    otherwise the candidate simply has to exist.
     """
 
+    if executable:
+        is_candidate = lambda p: os.path.isfile(p) and os.access(p, os.X_OK)
+    else:
+        is_candidate = lambda p: os.path.exists(p)
+
     hist = []
     paths = (path or "").split(':')
     if direction != 0:
@@ -924,7 +921,7 @@
     for p in paths:
         next = os.path.join(p, item)
         hist.append(next)
-        if os.path.exists(next):
+        if is_candidate(next):
             if not os.path.isabs(next):
                 next = os.path.abspath(next)
             if history:
@@ -953,7 +950,7 @@
     Arguments:
 
     variable -- the variable name. This will be fetched and expanded (using
-    d.getVar(variable, True)) and then split into a set().
+    d.getVar(variable)) and then split into a set().
 
     checkvalues -- if this is a string it is split on whitespace into a set(),
     otherwise coerced directly into a set().
@@ -966,7 +963,7 @@
     d -- the data store.
     """
 
-    val = d.getVar(variable, True)
+    val = d.getVar(variable)
     if not val:
         return falsevalue
     val = set(val.split())
@@ -979,7 +976,7 @@
     return falsevalue
 
 def contains_any(variable, checkvalues, truevalue, falsevalue, d):
-    val = d.getVar(variable, True)
+    val = d.getVar(variable)
     if not val:
         return falsevalue
     val = set(val.split())
@@ -991,6 +988,30 @@
         return truevalue
     return falsevalue
 
+def filter(variable, checkvalues, d):
+    """Return all words in the variable that are present in the checkvalues.
+
+    Arguments:
+
+    variable -- the variable name. This will be fetched and expanded (using
+    d.getVar(variable)) and then split into a set().
+
+    checkvalues -- if this is a string it is split on whitespace into a set(),
+    otherwise coerced directly into a set().
+
+    d -- the data store.
+    """
+
+    val = d.getVar(variable)
+    if not val:
+        return ''
+    val = set(val.split())
+    if isinstance(checkvalues, str):
+        checkvalues = set(checkvalues.split())
+    else:
+        checkvalues = set(checkvalues)
+    return ' '.join(sorted(checkvalues & val))
+
 def cpu_count():
     return multiprocessing.cpu_count()
 
@@ -1378,10 +1399,10 @@
 
 def get_file_layer(filename, d):
     """Determine the collection (as defined by a layer's layer.conf file) containing the specified file"""
-    collections = (d.getVar('BBFILE_COLLECTIONS', True) or '').split()
+    collections = (d.getVar('BBFILE_COLLECTIONS') or '').split()
     collection_res = {}
     for collection in collections:
-        collection_res[collection] = d.getVar('BBFILE_PATTERN_%s' % collection, True) or ''
+        collection_res[collection] = d.getVar('BBFILE_PATTERN_%s' % collection) or ''
 
     def path_to_layer(path):
         # Use longest path so we handle nested layers
@@ -1394,7 +1415,7 @@
         return match
 
     result = None
-    bbfiles = (d.getVar('BBFILES', True) or '').split()
+    bbfiles = (d.getVar('BBFILES') or '').split()
     bbfilesmatch = False
     for bbfilesentry in bbfiles:
         if fnmatch.fnmatch(filename, bbfilesentry):
@@ -1471,7 +1492,7 @@
         if v in os.environ.keys():
             exported = True
         else:
-            v_proxy = d.getVar(v, True)
+            v_proxy = d.getVar(v)
             if v_proxy is not None:
                 os.environ[v] = v_proxy
                 exported = True
@@ -1503,3 +1524,14 @@
                 plugins.append(obj or plugin)
             else:
                 plugins.append(plugin)
+
+
+class LogCatcher(logging.Handler):
+    """Logging handler for collecting logged messages so you can check them later"""
+    def __init__(self):
+        self.messages = []
+        logging.Handler.__init__(self, logging.WARNING)
+    def emit(self, record):
+        self.messages.append(bb.build.logformatter.format(record))
+    def contains(self, message):
+        return (message in self.messages)
diff --git a/import-layers/yocto-poky/bitbake/lib/bblayers/action.py b/import-layers/yocto-poky/bitbake/lib/bblayers/action.py
index 739ae27..cf94704 100644
--- a/import-layers/yocto-poky/bitbake/lib/bblayers/action.py
+++ b/import-layers/yocto-poky/bitbake/lib/bblayers/action.py
@@ -180,7 +180,7 @@
 
         if first_regex:
             # Find the BBFILES entries that match (which will have come from this conf/layer.conf file)
-            bbfiles = str(self.tinfoil.config_data.getVar('BBFILES', True)).split()
+            bbfiles = str(self.tinfoil.config_data.getVar('BBFILES')).split()
             bbfiles_layer = []
             for item in bbfiles:
                 if first_regex.match(item):
diff --git a/import-layers/yocto-poky/bitbake/lib/bblayers/common.py b/import-layers/yocto-poky/bitbake/lib/bblayers/common.py
index b10fb4c..98515ce 100644
--- a/import-layers/yocto-poky/bitbake/lib/bblayers/common.py
+++ b/import-layers/yocto-poky/bitbake/lib/bblayers/common.py
@@ -12,7 +12,7 @@
 
     def tinfoil_init(self, tinfoil):
         self.tinfoil = tinfoil
-        self.bblayers = (self.tinfoil.config_data.getVar('BBLAYERS', True) or "").split()
+        self.bblayers = (self.tinfoil.config_data.getVar('BBLAYERS') or "").split()
         layerconfs = self.tinfoil.config_data.varhistory.get_variable_items_files('BBFILE_COLLECTIONS', self.tinfoil.config_data)
         self.bbfile_collections = {layer: os.path.dirname(os.path.dirname(path)) for layer, path in layerconfs.items()}
 
diff --git a/import-layers/yocto-poky/bitbake/lib/bblayers/layerindex.py b/import-layers/yocto-poky/bitbake/lib/bblayers/layerindex.py
index 10ad718..506c110 100644
--- a/import-layers/yocto-poky/bitbake/lib/bblayers/layerindex.py
+++ b/import-layers/yocto-poky/bitbake/lib/bblayers/layerindex.py
@@ -56,7 +56,7 @@
         r = conn.getresponse()
         if r.status != 200:
             raise Exception("Failed to read " + path + ": %d %s" % (r.status, r.reason))
-        return json.loads(r.read())
+        return json.loads(r.read().decode())
 
     def get_layer_deps(self, layername, layeritems, layerbranches, layerdependencies, branchnum, selfname=False):
         def layeritems_info_id(items_name, layeritems):
@@ -151,7 +151,7 @@
     def do_layerindex_fetch(self, args):
         """Fetches a layer from a layer index along with its dependent layers, and adds them to conf/bblayers.conf.
 """
-        apiurl = self.tinfoil.config_data.getVar('BBLAYERS_LAYERINDEX_URL', True)
+        apiurl = self.tinfoil.config_data.getVar('BBLAYERS_LAYERINDEX_URL')
         if not apiurl:
             logger.error("Cannot get BBLAYERS_LAYERINDEX_URL")
             return 1
@@ -173,8 +173,8 @@
             return 1
 
         ignore_layers = []
-        for collection in self.tinfoil.config_data.getVar('BBFILE_COLLECTIONS', True).split():
-            lname = self.tinfoil.config_data.getVar('BBLAYERS_LAYERINDEX_NAME_%s' % collection, True)
+        for collection in self.tinfoil.config_data.getVar('BBFILE_COLLECTIONS').split():
+            lname = self.tinfoil.config_data.getVar('BBLAYERS_LAYERINDEX_NAME_%s' % collection)
             if lname:
                 ignore_layers.append(lname)
 
@@ -225,7 +225,7 @@
             printedlayers.append(dependency)
 
         if repourls:
-            fetchdir = self.tinfoil.config_data.getVar('BBLAYERS_FETCH_DIR', True)
+            fetchdir = self.tinfoil.config_data.getVar('BBLAYERS_FETCH_DIR')
             if not fetchdir:
                 logger.error("Cannot get BBLAYERS_FETCH_DIR")
                 return 1
diff --git a/import-layers/yocto-poky/bitbake/lib/bblayers/query.py b/import-layers/yocto-poky/bitbake/lib/bblayers/query.py
index ee1e7c8..bef3af3 100644
--- a/import-layers/yocto-poky/bitbake/lib/bblayers/query.py
+++ b/import-layers/yocto-poky/bitbake/lib/bblayers/query.py
@@ -5,8 +5,6 @@
 import os
 import re
 
-import bb.cache
-import bb.providers
 import bb.utils
 
 from bblayers.common import LayerPlugin
@@ -62,7 +60,7 @@
         # factor - however, each layer.conf is free to either prepend or append to
         # BBPATH (or indeed do crazy stuff with it). Thus the order in BBPATH might
         # not be exactly the order present in bblayers.conf either.
-        bbpath = str(self.tinfoil.config_data.getVar('BBPATH', True))
+        bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
         overlayed_class_found = False
         for (classfile, classdirs) in classes.items():
             if len(classdirs) > 1:
@@ -114,7 +112,7 @@
 
     def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_multi_provider_only, inherits):
         if inherits:
-            bbpath = str(self.tinfoil.config_data.getVar('BBPATH', True))
+            bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
             for classname in inherits:
                 classfile = 'classes/%s.bbclass' % classname
                 if not bb.utils.which(bbpath, classfile, history=False):
@@ -122,15 +120,13 @@
                     sys.exit(1)
 
         pkg_pn = self.tinfoil.cooker.recipecaches[''].pkg_pn
-        (latest_versions, preferred_versions) = bb.providers.findProviders(self.tinfoil.config_data, self.tinfoil.cooker.recipecaches[''], pkg_pn)
-        allproviders = bb.providers.allProviders(self.tinfoil.cooker.recipecaches[''])
+        (latest_versions, preferred_versions) = self.tinfoil.find_providers()
+        allproviders = self.tinfoil.get_all_providers()
 
         # Ensure we list skipped recipes
         # We are largely guessing about PN, PV and the preferred version here,
         # but we have no choice since skipped recipes are not fully parsed
         skiplist = list(self.tinfoil.cooker.skiplist.keys())
-        skiplist.sort( key=lambda fileitem: self.tinfoil.cooker.collection.calc_bbfile_priority(fileitem) )
-        skiplist.reverse()
         for fn in skiplist:
             recipe_parts = os.path.splitext(os.path.basename(fn))[0].split('_')
             p = recipe_parts[0]
@@ -158,7 +154,7 @@
                     logger.plain("%s:", pn)
                 logger.plain("  %s %s%s", layer.ljust(20), ver, skipped)
 
-        global_inherit = (self.tinfoil.config_data.getVar('INHERIT', True) or "").split()
+        global_inherit = (self.tinfoil.config_data.getVar('INHERIT') or "").split()
         cls_re = re.compile('classes/')
 
         preffiles = []
@@ -246,17 +242,22 @@
 
 Lists recipes with the bbappends that apply to them as subitems.
 """
-
-        logger.plain('=== Appended recipes ===')
+        if args.pnspec:
+            logger.plain('=== Matched appended recipes ===')
+        else:
+            logger.plain('=== Appended recipes ===')
 
         pnlist = list(self.tinfoil.cooker_data.pkg_pn.keys())
         pnlist.sort()
         appends = False
         for pn in pnlist:
+            if args.pnspec and pn != args.pnspec:
+                continue
+
             if self.show_appends_for_pn(pn):
                 appends = True
 
-        if self.show_appends_for_skipped():
+        if not args.pnspec and self.show_appends_for_skipped():
             appends = True
 
         if not appends:
@@ -265,10 +266,7 @@
     def show_appends_for_pn(self, pn):
         filenames = self.tinfoil.cooker_data.pkg_pn[pn]
 
-        best = bb.providers.findBestProvider(pn,
-                                             self.tinfoil.config_data,
-                                             self.tinfoil.cooker_data,
-                                             self.tinfoil.cooker_data.pkg_pn)
+        best = self.tinfoil.find_best_provider(pn)
         best_filename = os.path.basename(best[3])
 
         return self.show_appends_output(filenames, best_filename)
@@ -319,12 +317,12 @@
         ignore_layers = (args.ignore or '').split(',')
 
         pkg_fn = self.tinfoil.cooker_data.pkg_fn
-        bbpath = str(self.tinfoil.config_data.getVar('BBPATH', True))
+        bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
         self.require_re = re.compile(r"require\s+(.+)")
         self.include_re = re.compile(r"include\s+(.+)")
         self.inherit_re = re.compile(r"inherit\s+(.+)")
 
-        global_inherit = (self.tinfoil.config_data.getVar('INHERIT', True) or "").split()
+        global_inherit = (self.tinfoil.config_data.getVar('INHERIT') or "").split()
 
         # The bb's DEPENDS and RDEPENDS
         for f in pkg_fn:
@@ -336,10 +334,7 @@
             deps = self.tinfoil.cooker_data.deps[f]
             for pn in deps:
                 if pn in self.tinfoil.cooker_data.pkg_pn:
-                    best = bb.providers.findBestProvider(pn,
-                            self.tinfoil.config_data,
-                            self.tinfoil.cooker_data,
-                            self.tinfoil.cooker_data.pkg_pn)
+                    best = self.tinfoil.find_best_provider(pn)
                     self.check_cross_depends("DEPENDS", layername, f, best[3], args.filenames, ignore_layers)
 
             # The RDPENDS
@@ -352,14 +347,11 @@
                     sorted_rdeps[k2] = 1
             all_rdeps = sorted_rdeps.keys()
             for rdep in all_rdeps:
-                all_p = bb.providers.getRuntimeProviders(self.tinfoil.cooker_data, rdep)
+                all_p, best = self.tinfoil.get_runtime_providers(rdep)
                 if all_p:
                     if f in all_p:
                         # The recipe provides this one itself, ignore
                         continue
-                    best = bb.providers.filterProvidersRunTime(all_p, rdep,
-                                    self.tinfoil.config_data,
-                                    self.tinfoil.cooker_data)[0][0]
                     self.check_cross_depends("RDEPENDS", layername, f, best, args.filenames, ignore_layers)
 
             # The RRECOMMENDS
@@ -372,14 +364,11 @@
                     sorted_rrecs[k2] = 1
             all_rrecs = sorted_rrecs.keys()
             for rrec in all_rrecs:
-                all_p = bb.providers.getRuntimeProviders(self.tinfoil.cooker_data, rrec)
+                all_p, best = self.tinfoil.get_runtime_providers(rrec)
                 if all_p:
                     if f in all_p:
                         # The recipe provides this one itself, ignore
                         continue
-                    best = bb.providers.filterProvidersRunTime(all_p, rrec,
-                                    self.tinfoil.config_data,
-                                    self.tinfoil.cooker_data)[0][0]
                     self.check_cross_depends("RRECOMMENDS", layername, f, best, args.filenames, ignore_layers)
 
             # The inherit class
@@ -493,7 +482,8 @@
         parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class', metavar='CLASS', default='')
         parser_show_recipes.add_argument('pnspec', nargs='?', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')
 
-        self.add_command(sp, 'show-appends', self.do_show_appends)
+        parser_show_appends = self.add_command(sp, 'show-appends', self.do_show_appends)
+        parser_show_appends.add_argument('pnspec', nargs='?', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')
 
         parser_show_cross_depends = self.add_command(sp, 'show-cross-depends', self.do_show_cross_depends)
         parser_show_cross_depends.add_argument('-f', '--filenames', help='show full file path', action='store_true')
diff --git a/import-layers/yocto-poky/bitbake/lib/prserv/serv.py b/import-layers/yocto-poky/bitbake/lib/prserv/serv.py
index cafcc82..a7efa58 100644
--- a/import-layers/yocto-poky/bitbake/lib/prserv/serv.py
+++ b/import-layers/yocto-poky/bitbake/lib/prserv/serv.py
@@ -5,12 +5,7 @@
 import queue
 import socket
 import io
-
-try:
-    import sqlite3
-except ImportError:
-    from pysqlite2 import dbapi2 as sqlite3
-
+import sqlite3
 import bb.server.xmlrpc
 import prserv
 import prserv.db
@@ -242,12 +237,25 @@
 
         sys.stdout.flush()
         sys.stderr.flush()
+
+        # We could be called from a python thread with io.StringIO as
+        # stdout/stderr or it could be 'real' unix fd forking where we need
+        # to physically close the fds to prevent the program launching us from
+        # potentially hanging on a pipe. Handle both cases.
         si = open('/dev/null', 'r')
+        try:
+            os.dup2(si.fileno(),sys.stdin.fileno())
+        except (AttributeError, io.UnsupportedOperation):
+            sys.stdin = si
         so = open(self.logfile, 'a+')
-        se = so
-        os.dup2(si.fileno(),sys.stdin.fileno())
-        os.dup2(so.fileno(),sys.stdout.fileno())
-        os.dup2(se.fileno(),sys.stderr.fileno())
+        try:
+            os.dup2(so.fileno(),sys.stdout.fileno())
+        except (AttributeError, io.UnsupportedOperation):
+            sys.stdout = so
+        try:
+            os.dup2(so.fileno(),sys.stderr.fileno())
+        except (AttributeError, io.UnsupportedOperation):
+            sys.stderr = so
 
         # Clear out all log handlers prior to the fork() to avoid calling
         # event handlers not part of the PRserver
@@ -420,7 +428,7 @@
 def auto_start(d):
     global singleton
 
-    host_params = list(filter(None, (d.getVar('PRSERV_HOST', True) or '').split(':')))
+    host_params = list(filter(None, (d.getVar('PRSERV_HOST') or '').split(':')))
     if not host_params:
         return None
 
@@ -431,7 +439,7 @@
 
     if is_local_special(host_params[0], int(host_params[1])) and not singleton:
         import bb.utils
-        cachedir = (d.getVar("PERSISTENT_DIR", True) or d.getVar("CACHE", True))
+        cachedir = (d.getVar("PERSISTENT_DIR") or d.getVar("CACHE"))
         if not cachedir:
             logger.critical("Please set the 'PERSISTENT_DIR' or 'CACHE' variable")
             raise PRServiceConfigError
diff --git a/import-layers/yocto-poky/bitbake/lib/simplediff/LICENSE b/import-layers/yocto-poky/bitbake/lib/simplediff/LICENSE
new file mode 100644
index 0000000..8242dde
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/simplediff/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2008 - 2013 Paul Butler and contributors
+
+This sofware may be used under a zlib/libpng-style license:
+
+This software is provided 'as-is', without any express or implied warranty. In
+no event will the authors be held liable for any damages arising from the use
+of this software.
+
+Permission is granted to anyone to use this software for any purpose, including
+commercial applications, and to alter it and redistribute it freely, subject to
+the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim
+that you wrote the original software. If you use this software in a product, an
+acknowledgment in the product documentation would be appreciated but is not
+required.
+
+2. Altered source versions must be plainly marked as such, and must not be
+misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source distribution.
+
diff --git a/import-layers/yocto-poky/bitbake/lib/simplediff/__init__.py b/import-layers/yocto-poky/bitbake/lib/simplediff/__init__.py
new file mode 100644
index 0000000..57ee3c5
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/simplediff/__init__.py
@@ -0,0 +1,198 @@
+'''
+Simple Diff for Python version 1.0
+
+Annotate two versions of a list with the values that have been
+changed between the versions, similar to unix's `diff` but with
+a dead-simple Python interface.
+
+(C) Paul Butler 2008-2012 <http://www.paulbutler.org/>
+May be used and distributed under the zlib/libpng license
+<http://www.opensource.org/licenses/zlib-license.php>
+'''
+
+__all__ = ['diff', 'string_diff', 'html_diff']
+__version__ = '1.0'
+
+
+def diff(old, new):
+    '''
+    Find the differences between two lists. Returns a list of pairs, where the
+    first value is in ['+','-','='] and represents an insertion, deletion, or
+    no change for that list. The second value of the pair is the list
+    of elements.
+
+    Params:
+        old     the old list of immutable, comparable values (ie. a list
+                of strings)
+        new     the new list of immutable, comparable values
+   
+    Returns:
+        A list of pairs, with the first part of the pair being one of three
+        strings ('-', '+', '=') and the second part being a list of values from
+        the original old and/or new lists. The first part of the pair
+        corresponds to whether the list of values is a deletion, insertion, or
+        unchanged, respectively.
+
+    Examples:
+        >>> diff([1,2,3,4],[1,3,4])
+        [('=', [1]), ('-', [2]), ('=', [3, 4])]
+
+        >>> diff([1,2,3,4],[2,3,4,1])
+        [('-', [1]), ('=', [2, 3, 4]), ('+', [1])]
+
+        >>> diff('The quick brown fox jumps over the lazy dog'.split(),
+        ...      'The slow blue cheese drips over the lazy carrot'.split())
+        ... # doctest: +NORMALIZE_WHITESPACE
+        [('=', ['The']),
+         ('-', ['quick', 'brown', 'fox', 'jumps']),
+         ('+', ['slow', 'blue', 'cheese', 'drips']),
+         ('=', ['over', 'the', 'lazy']),
+         ('-', ['dog']),
+         ('+', ['carrot'])]
+
+    '''
+
+    # Create a map from old values to their indices
+    old_index_map = dict()
+    for i, val in enumerate(old):
+        old_index_map.setdefault(val,list()).append(i)
+
+    # Find the largest substring common to old and new.
+    # We use a dynamic programming approach here.
+    # 
+    # We iterate over each value in the `new` list, calling the
+    # index `inew`. At each iteration, `overlap[i]` is the
+    # length of the largest suffix of `old[:i]` equal to a suffix
+    # of `new[:inew]` (or unset when `old[i]` != `new[inew]`).
+    #
+    # At each stage of iteration, the new `overlap` (called
+    # `_overlap` until the original `overlap` is no longer needed)
+    # is built from the old one.
+    #
+    # If the length of overlap exceeds the largest substring
+    # seen so far (`sub_length`), we update the largest substring
+    # to the overlapping strings.
+
+    overlap = dict()
+    # `sub_start_old` is the index of the beginning of the largest overlapping
+    # substring in the old list. `sub_start_new` is the index of the beginning
+    # of the same substring in the new list. `sub_length` is the length that
+    # overlaps in both.
+    # These track the largest overlapping substring seen so far, so naturally
+    # we start with a 0-length substring.
+    sub_start_old = 0
+    sub_start_new = 0
+    sub_length = 0
+
+    for inew, val in enumerate(new):
+        _overlap = dict()
+        for iold in old_index_map.get(val,list()):
+            # now we are considering all values of iold such that
+            # `old[iold] == new[inew]`.
+            _overlap[iold] = (iold and overlap.get(iold - 1, 0)) + 1
+            if(_overlap[iold] > sub_length):
+                # this is the largest substring seen so far, so store its
+                # indices
+                sub_length = _overlap[iold]
+                sub_start_old = iold - sub_length + 1
+                sub_start_new = inew - sub_length + 1
+        overlap = _overlap
+
+    if sub_length == 0:
+        # If no common substring is found, we return an insert and delete...
+        return (old and [('-', old)] or []) + (new and [('+', new)] or [])
+    else:
+        # ...otherwise, the common substring is unchanged and we recursively
+        # diff the text before and after that substring
+        return diff(old[ : sub_start_old], new[ : sub_start_new]) + \
+               [('=', new[sub_start_new : sub_start_new + sub_length])] + \
+               diff(old[sub_start_old + sub_length : ],
+                       new[sub_start_new + sub_length : ])
+
+
+def string_diff(old, new):
+    '''
+    Returns the difference between the old and new strings when split on
+    whitespace. Considers punctuation a part of the word
+
+    This function is intended as an example; you'll probably want
+    a more sophisticated wrapper in practice.
+
+    Params:
+        old     the old string
+        new     the new string
+
+    Returns:
+        the output of `diff` on the two strings after splitting them
+        on whitespace (a list of change instructions; see the docstring
+        of `diff`)
+
+    Examples:
+        >>> string_diff('The quick brown fox', 'The fast blue fox')
+        ... # doctest: +NORMALIZE_WHITESPACE
+        [('=', ['The']),
+         ('-', ['quick', 'brown']),
+         ('+', ['fast', 'blue']),
+         ('=', ['fox'])]
+
+    '''
+    return diff(old.split(), new.split())
+
+
+def html_diff(old, new):
+    '''
+    Returns the difference between two strings (as in stringDiff) in
+    HTML format. HTML code in the strings is NOT escaped, so you
+    will get weird results if the strings contain HTML.
+
+    This function is intended as an example; you'll probably want
+    a more sophisticated wrapper in practice.
+
+    Params:
+        old     the old string
+        new     the new string
+
+    Returns:
+        the output of the diff expressed with HTML <ins> and <del>
+        tags.
+
+    Examples:
+        >>> html_diff('The quick brown fox', 'The fast blue fox')
+        'The <del>quick brown</del> <ins>fast blue</ins> fox'
+    '''
+    con = {'=': (lambda x: x),
+           '+': (lambda x: "<ins>" + x + "</ins>"),
+           '-': (lambda x: "<del>" + x + "</del>")}
+    return " ".join([(con[a])(" ".join(b)) for a, b in string_diff(old, new)])
+
+
+def check_diff(old, new):
+    '''
+    This tests that diffs returned by `diff` are valid. You probably won't
+    want to use this function, but it's provided for documentation and
+    testing.
+
+    A diff should satisfy the property that the old input is equal to the
+    elements of the result annotated with '-' or '=' concatenated together.
+    Likewise, the new input is equal to the elements of the result annotated
+    with '+' or '=' concatenated together. This function compares `old`,
+    `new`, and the results of `diff(old, new)` to ensure this is true.
+
+    Tests:
+        >>> check_diff('ABCBA', 'CBABA')
+        >>> check_diff('Foobarbaz', 'Foobarbaz')
+        >>> check_diff('Foobarbaz', 'Boobazbam')
+        >>> check_diff('The quick brown fox', 'Some quick brown car')
+        >>> check_diff('A thick red book', 'A quick blue book')
+        >>> check_diff('dafhjkdashfkhasfjsdafdasfsda', 'asdfaskjfhksahkfjsdha')
+        >>> check_diff('88288822828828288282828', '88288882882828282882828')
+        >>> check_diff('1234567890', '24689')
+    '''
+    old = list(old)
+    new = list(new)
+    result = diff(old, new)
+    _old = [val for (a, vals) in result if (a in '=-') for val in vals]
+    assert old == _old, 'Expected %s, got %s' % (old, _old)
+    _new = [val for (a, vals) in result if (a in '=+') for val in vals]
+    assert new == _new, 'Expected %s, got %s' % (new, _new)
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index e5f7c98..1207102 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -27,7 +27,7 @@
 from django.db import transaction
 from django.db.models import Q
 from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake
-from orm.models import CustomImageRecipe, Layer, Layer_Version, ProjectLayer
+from orm.models import CustomImageRecipe, Layer, Layer_Version, ProjectLayer, ToasterSetting
 import subprocess
 
 from toastermain import settings
@@ -200,72 +200,93 @@
 
         logger.debug("localhostbecontroller: current layer list %s " % pformat(layerlist))
 
+        if self.pokydirname is None and os.path.exists(os.path.join(self.be.sourcedir, "oe-init-build-env")):
+            logger.debug("localhostbecontroller: selected poky dir name %s" % self.be.sourcedir)
+            self.pokydirname = self.be.sourcedir
+
         # 5. create custom layer and add custom recipes to it
-        layerpath = os.path.join(self.be.builddir,
-                                 CustomImageRecipe.LAYER_NAME)
         for target in targets:
             try:
-                customrecipe = CustomImageRecipe.objects.get(name=target.target,
-                                                             project=bitbake.req.project)
+                customrecipe = CustomImageRecipe.objects.get(
+                    name=target.target,
+                    project=bitbake.req.project)
+
+                custom_layer_path = self.setup_custom_image_recipe(
+                    customrecipe, layers)
+
+                if os.path.isdir(custom_layer_path):
+                    layerlist.append(custom_layer_path)
+
             except CustomImageRecipe.DoesNotExist:
-                continue # not a custom recipe, skip
+                continue  # not a custom recipe, skip
 
-            # create directory structure
-            for name in ("conf", "recipes"):
-                path = os.path.join(layerpath, name)
-                if not os.path.isdir(path):
-                    os.makedirs(path)
-
-            # create layer.oonf
-            config = os.path.join(layerpath, "conf", "layer.conf")
-            if not os.path.isfile(config):
-                with open(config, "w") as conf:
-                    conf.write('BBPATH .= ":${LAYERDIR}"\nBBFILES += "${LAYERDIR}/recipes/*.bb"\n')
-
-            # Update the Layer_Version dirpath that has our base_recipe in
-            # to be able to read the base recipe to then  generate the
-            # custom recipe.
-            br_layer_base_recipe = layers.get(
-                layer_version=customrecipe.base_recipe.layer_version)
-
-            br_layer_base_dirpath = \
-                    os.path.join(self.be.sourcedir,
-                                 self.getGitCloneDirectory(
-                                     br_layer_base_recipe.giturl,
-                                     br_layer_base_recipe.commit),
-                                 customrecipe.base_recipe.layer_version.dirpath
-                                )
-
-            customrecipe.base_recipe.layer_version.dirpath = \
-                         br_layer_base_dirpath
-
-            customrecipe.base_recipe.layer_version.save()
-
-            # create recipe
-            recipe_path = \
-                    os.path.join(layerpath, "recipes", "%s.bb" % target.target)
-            with open(recipe_path, "w") as recipef:
-                recipef.write(customrecipe.generate_recipe_file_contents())
-
-            # Update the layer and recipe objects
-            customrecipe.layer_version.dirpath = layerpath
-            customrecipe.layer_version.save()
-
-            customrecipe.file_path = recipe_path
-            customrecipe.save()
-
-            # create *Layer* objects needed for build machinery to work
-            BRLayer.objects.get_or_create(req=target.req,
-                                          name=layer.name,
-                                          dirpath=layerpath,
-                                          giturl="file://%s" % layerpath)
-        if os.path.isdir(layerpath):
-            layerlist.append(layerpath)
-
-        self.islayerset = True
         layerlist.extend(nongitlayerlist)
+        logger.debug("\n\nset layers gives this list %s" % pformat(layerlist))
+        self.islayerset = True
         return layerlist
 
+    def setup_custom_image_recipe(self, customrecipe, layers):
+        """ Set up toaster-custom-images layer and recipe files """
+        layerpath = os.path.join(self.be.builddir,
+                                 CustomImageRecipe.LAYER_NAME)
+
+        # create directory structure
+        for name in ("conf", "recipes"):
+            path = os.path.join(layerpath, name)
+            if not os.path.isdir(path):
+                os.makedirs(path)
+
+        # create layer.conf
+        config = os.path.join(layerpath, "conf", "layer.conf")
+        if not os.path.isfile(config):
+            with open(config, "w") as conf:
+                conf.write('BBPATH .= ":${LAYERDIR}"\nBBFILES += "${LAYERDIR}/recipes/*.bb"\n')
+
+        # Update the Layer_Version dirpath that has our base_recipe in
+        # to be able to read the base recipe to then  generate the
+        # custom recipe.
+        br_layer_base_recipe = layers.get(
+            layer_version=customrecipe.base_recipe.layer_version)
+
+        # If the layer is one that we've cloned we know where it lives
+        if br_layer_base_recipe.giturl and br_layer_base_recipe.commit:
+            layer_path = self.getGitCloneDirectory(
+                br_layer_base_recipe.giturl,
+                br_layer_base_recipe.commit)
+        # Otherwise it's a local layer
+        elif br_layer_base_recipe.local_source_dir:
+            layer_path = br_layer_base_recipe.local_source_dir
+        else:
+            logger.error("Unable to workout the dir path for the custom"
+                         " image recipe")
+
+        br_layer_base_dirpath = os.path.join(
+            self.be.sourcedir,
+            layer_path,
+            customrecipe.base_recipe.layer_version.dirpath)
+
+        customrecipe.base_recipe.layer_version.dirpath = br_layer_base_dirpath
+
+        customrecipe.base_recipe.layer_version.save()
+
+        # create recipe
+        recipe_path = os.path.join(layerpath, "recipes", "%s.bb" %
+                                   customrecipe.name)
+        with open(recipe_path, "w") as recipef:
+            recipef.write(customrecipe.generate_recipe_file_contents())
+
+        # Update the layer and recipe objects
+        customrecipe.layer_version.dirpath = layerpath
+        customrecipe.layer_version.layer.local_source_dir = layerpath
+        customrecipe.layer_version.layer.save()
+        customrecipe.layer_version.save()
+
+        customrecipe.file_path = recipe_path
+        customrecipe.save()
+
+        return layerpath
+
+
     def readServerLogFile(self):
         return open(os.path.join(self.be.builddir, "toaster_server.log"), "r").read()
 
@@ -277,23 +298,17 @@
         builddir = '%s-toaster-%d' % (self.be.builddir, bitbake.req.project.id)
         oe_init = os.path.join(self.pokydirname, 'oe-init-build-env')
         # init build environment
-        self._shellcmd("bash -c 'source %s %s'" % (oe_init, builddir),
+        try:
+            custom_script = ToasterSetting.objects.get(name="CUSTOM_BUILD_INIT_SCRIPT").value
+            custom_script = custom_script.replace("%BUILDDIR%" ,builddir)
+            self._shellcmd("bash -c 'source %s'" % (custom_script))
+        except ToasterSetting.DoesNotExist:
+            self._shellcmd("bash -c 'source %s %s'" % (oe_init, builddir),
                        self.be.sourcedir)
 
         # update bblayers.conf
-        bblconfpath = os.path.join(builddir, "conf/bblayers.conf")
-        conflines = open(bblconfpath, "r").readlines()
-        skip = False
+        bblconfpath = os.path.join(builddir, "conf/toaster-bblayers.conf")
         with open(bblconfpath, 'w') as bblayers:
-            for line in conflines:
-                if line.startswith("# line added by toaster"):
-                    skip = True
-                    continue
-                if skip:
-                    skip = False
-                else:
-                    bblayers.write(line)
-
             bblayers.write('# line added by toaster build control\n'
                            'BBLAYERS = "%s"' % ' '.join(layers))
 
@@ -306,9 +321,10 @@
 
         # run bitbake server from the clone
         bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake')
-        self._shellcmd('bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s '
+        toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf")
+        self._shellcmd('bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s '
                        '--server-only -t xmlrpc -B 0.0.0.0:0\"' % (oe_init,
-                       builddir, bitbake, confpath), self.be.sourcedir)
+                       builddir, bitbake, confpath, toasterlayers), self.be.sourcedir)
 
         # read port number from bitbake.lock
         self.be.bbport = ""
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
index 7f7a5a9..df11f9d 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -11,9 +11,11 @@
 import logging
 import traceback
 import signal
+import os
 
 logger = logging.getLogger("toaster")
 
+
 class Command(NoArgsCommand):
     args = ""
     help = "Schedules and executes build requests as possible. "\
@@ -50,7 +52,7 @@
                 logger.debug("runbuilds: No build env")
                 return
 
-            logger.info("runbuilds: starting build %s, environment %s" % \
+            logger.info("runbuilds: starting build %s, environment %s" %
                         (br, bec.be))
 
             # let the build request know where it is being executed
@@ -80,7 +82,7 @@
 
     def archive(self):
         for br in BuildRequest.objects.filter(state=BuildRequest.REQ_ARCHIVE):
-            if br.build == None:
+            if br.build is None:
                 br.state = BuildRequest.REQ_FAILED
             else:
                 br.state = BuildRequest.REQ_COMPLETED
@@ -99,10 +101,10 @@
             Q(updated__lt=timezone.now() - timedelta(seconds=30))
         ).update(lock=BuildEnvironment.LOCK_FREE)
 
-
         # update all Builds that were in progress and failed to start
-        for br in BuildRequest.objects.filter(state=BuildRequest.REQ_FAILED,
-                                              build__outcome=Build.IN_PROGRESS):
+        for br in BuildRequest.objects.filter(
+                state=BuildRequest.REQ_FAILED,
+                build__outcome=Build.IN_PROGRESS):
             # transpose the launch errors in ToasterExceptions
             br.build.outcome = Build.FAILED
             for brerror in br.brerror_set.all():
@@ -117,7 +119,6 @@
             br.environment.lock = BuildEnvironment.LOCK_FREE
             br.environment.save()
 
-
         # update all BuildRequests without a build created
         for br in BuildRequest.objects.filter(build=None):
             br.build = Build.objects.create(project=br.project,
@@ -144,7 +145,7 @@
 
         # Make sure the LOCK is removed for builds which have been fully
         # cancelled
-        for br in BuildRequest.objects.filter(\
+        for br in BuildRequest.objects.filter(
                       Q(build__outcome=Build.CANCELLED) &
                       Q(state=BuildRequest.REQ_CANCELLING) &
                       ~Q(environment=None)):
@@ -168,6 +169,12 @@
             logger.warn("runbuilds: schedule exception %s" % str(e))
 
     def handle_noargs(self, **options):
+        pidfile_path = os.path.join(os.environ.get("BUILDDIR", "."),
+                                    ".runbuilds.pid")
+
+        with open(pidfile_path, 'w') as pidfile:
+            pidfile.write("%s" % os.getpid())
+
         self.runbuild()
 
         signal.signal(signal.SIGUSR1, lambda sig, frame: None)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/tests.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/tests.py
deleted file mode 100644
index 475ac0a..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/tests.py
+++ /dev/null
@@ -1,141 +0,0 @@
-"""
-This file demonstrates writing tests using the unittest module. These will pass
-when you run "manage.py test".
-
-Replace this with more appropriate tests for your application.
-"""
-
-from django.test import TestCase
-
-from bldcontrol.bbcontroller import BitbakeController, BuildSetupException
-from bldcontrol.localhostbecontroller import LocalhostBEController
-from bldcontrol.models import BuildEnvironment, BuildRequest
-from bldcontrol.management.commands.runbuilds import Command
-
-import socket
-import subprocess
-import os
-
-# standard poky data hardcoded for testing
-BITBAKE_LAYER = type('bitbake_info', (object,), { "giturl": "git://git.yoctoproject.org/poky.git", "dirpath": "", "commit": "HEAD"})
-POKY_LAYERS = [
-    type('poky_info', (object,), { "name": "meta", "giturl": "git://git.yoctoproject.org/poky.git", "dirpath": "meta", "commit": "HEAD"}),
-    type('poky_info', (object,), { "name": "meta-yocto", "giturl": "git://git.yoctoproject.org/poky.git", "dirpath": "meta-yocto", "commit": "HEAD"}),
-    type('poky_info', (object,), { "name": "meta-yocto-bsp", "giturl": "git://git.yoctoproject.org/poky.git", "dirpath": "meta-yocto-bsp", "commit": "HEAD"}),
-    ]
-
-
-
-# we have an abstract test class designed to ensure that the controllers use a single interface
-# specific controller tests only need to override the _getBuildEnvironment() method
-
-test_sourcedir = os.getenv("TTS_SOURCE_DIR")
-test_builddir = os.getenv("TTS_BUILD_DIR")
-test_address = os.getenv("TTS_TEST_ADDRESS", "localhost")
-
-if test_sourcedir == None or test_builddir == None or test_address == None:
-    raise Exception("Please set TTTS_SOURCE_DIR, TTS_BUILD_DIR and TTS_TEST_ADDRESS")
-
-# The bb server will expect a toaster-pre.conf file to exist. If it doesn't exit then we make
-# an empty one here.
-open(test_builddir + 'conf/toaster-pre.conf', 'a').close()
-
-class BEControllerTests(object):
-
-    def _serverForceStop(self, bc):
-        err = bc._shellcmd("netstat  -tapn 2>/dev/null | grep 8200 | awk '{print $7}' | sort -fu | cut -d \"/\" -f 1 | grep -v -- - | tee /dev/fd/2 | xargs -r kill")
-        self.assertTrue(err == '', "bitbake server pid %s not stopped" % err)
-
-    def test_serverStartAndStop(self):
-        obe =  self._getBuildEnvironment()
-        bc = self._getBEController(obe)
-        try:
-            # setting layers, skip any layer info
-            bc.setLayers(BITBAKE_LAYER, POKY_LAYERS)
-        except NotImplementedError:
-            print("Test skipped due to command not implemented yet")
-            return True
-        # We are ok with the exception as we're handling the git already exists
-        except BuildSetupException:
-            pass
-
-        bc.pokydirname = test_sourcedir
-        bc.islayerset = True
-
-        hostname = test_address.split("@")[-1]
-
-        # test start server and stop
-        bc.startBBServer()
-
-        self.assertFalse(socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex((hostname, int(bc.be.bbport))), "Server not answering")
-
-        self._serverForceStop(bc)
-
-    def test_getBBController(self):
-        obe = self._getBuildEnvironment()
-        bc = self._getBEController(obe)
-        layerSet = False
-        try:
-            # setting layers, skip any layer info
-            layerSet = bc.setLayers(BITBAKE_LAYER, POKY_LAYERS)
-        except NotImplementedError:
-            print("Test skipped due to command not implemented yet")
-            return True
-        # We are ok with the exception as we're handling the git already exists
-        except BuildSetupException:
-            pass
-
-        bc.pokydirname = test_sourcedir
-        bc.islayerset = True
-
-        bbc = bc.getBBController()
-        self.assertTrue(isinstance(bbc, BitbakeController))
-
-        self._serverForceStop(bc)
-
-class LocalhostBEControllerTests(TestCase, BEControllerTests):
-    def __init__(self, *args):
-        super(LocalhostBEControllerTests, self).__init__(*args)
-
-
-    def _getBuildEnvironment(self):
-        return BuildEnvironment.objects.create(
-                lock = BuildEnvironment.LOCK_FREE,
-                betype = BuildEnvironment.TYPE_LOCAL,
-                address = test_address,
-                sourcedir = test_sourcedir,
-                builddir = test_builddir )
-
-    def _getBEController(self, obe):
-        return LocalhostBEController(obe)
-
-class RunBuildsCommandTests(TestCase):
-    def test_bec_select(self):
-        """
-        Tests that we can find and lock a build environment
-        """
-
-        obe = BuildEnvironment.objects.create(lock = BuildEnvironment.LOCK_FREE, betype = BuildEnvironment.TYPE_LOCAL)
-        command = Command()
-        bec = command._selectBuildEnvironment()
-
-        # make sure we select the object we've just built
-        self.assertTrue(bec.be.id == obe.id, "Environment is not properly selected")
-        # we have a locked environment
-        self.assertTrue(bec.be.lock == BuildEnvironment.LOCK_LOCK, "Environment is not locked")
-        # no more selections possible here
-        self.assertRaises(IndexError, command._selectBuildEnvironment)
-
-    def test_br_select(self):
-        from orm.models import Project, Release, BitbakeVersion, Branch
-        p = Project.objects.create_project("test", Release.objects.get_or_create(name = "HEAD", bitbake_version = BitbakeVersion.objects.get_or_create(name="HEAD", branch=Branch.objects.get_or_create(name="HEAD"))[0])[0])
-        obr = BuildRequest.objects.create(state = BuildRequest.REQ_QUEUED, project = p)
-        command = Command()
-        br = command._selectBuildRequest()
-
-        # make sure we select the object we've just built
-        self.assertTrue(obr.id == br.id, "Request is not properly selected")
-        # we have a locked environment
-        self.assertTrue(br.state == BuildRequest.REQ_INPROGRESS, "Request is not updated")
-        # no more selections possible here
-        self.assertRaises(IndexError, command._selectBuildRequest)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/README b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/README
deleted file mode 100644
index 46d0ff0..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/README
+++ /dev/null
@@ -1,6 +0,0 @@
-contrib directory for toaster
-
-This directory holds code that works with Toaster, without being an integral part of the Toaster project.
-It is intended for testing code, testing fixtures, tools for Toaster, etc.
-
-NOTE: This directory is NOT a Python module.
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/README b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/README
deleted file mode 100644
index 22fa567..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/README
+++ /dev/null
@@ -1,41 +0,0 @@
-
-Toaster Testing Framework
-Yocto Project
-
-
-Rationale
-------------
-As Toaster contributions grow with the number of people that contribute code, verifying each patch prior to submitting upstream becomes a hard-to-scale problem for humans. We devised this system in order to run patch-level validation, trying to eliminate common problems from submitted patches, in an automated fashion.
-
-The Toaster Testing Framework is a set of Python scripts that provides an extensible way to write smoke and regression tests that will be run on each patch set sent for review on the toaster mailing list.
-
-
-Usage
-------------
-There are three main executable scripts in this directory.
-    *    runner.py  is designed to be run from the command line. It requires, as mandatory parameter, a branch name on poky-contrib, branch which contains the patches to be tested. The program will auto-discover the available tests residing in this directory by looking for unittest classes, and will run the tests on the branch dumping the output to the standard output. Optionally, it can take parameters inhibiting the branch checkout, or specifying a single test to be run, for debugging purposes.
-    *    launcher.py  is a designed to be run from a crontab or similar scheduling mechanism. It looks up a backlog file containing branches-to-test (named tasks in the source code), select the first one in FIFO manner, and launch runner.py on it. It will await for completion, and email the standard output and standard error dumps from the runner.py execution
-    *    recv.py  is an email receiver, designed to be called as a pipe from a .forward file. It is used to monitor a mailing list, for example, and add tasks to the backlog based on review requests coming on the mailing list.
-
-
-Installation
-------------
-As prerequisite, we expect a functioning email system on a machine with Python2.
-
-The broad steps to installation
-* set up the .forward on the receiving email account to pipe to the recv.py file
-* edit config.py and settings.json to alter for local installation settings
-* on email receive, verify backlog.txt to see that the tasks are received and marked for processing
-* execute launcher.py in command line to verify that a test occurs with no problems, and that the outgoing email is delivered
-* add launcher.py
-
-
-
-Contribute
-------------
-What we need are tests. Add your own tests to either tests.py file, or to a new file.
-Use "config.logger" to write logs that will make it to email.
-
-Commonly used code should be going to shellutils, and configuration to config.py.
-
-Contribute code by emailing patches to the list: toaster@yoctoproject.org (membership required)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/TODO b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/TODO
deleted file mode 100644
index 1171921..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/TODO
+++ /dev/null
@@ -1,9 +0,0 @@
-We need to implement tests:
-
-automated link checker; currently
-$ linkchecker -t 1000 -F csv http://localhost:8000/
-
-integrate the w3c-validation service; currently
-$ python urlcheck.py
-
-
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/config.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/config.py
deleted file mode 100644
index 87b427c..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/config.py
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/python
-
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# Copyright (C) 2015 Alexandru Damian for Intel Corp.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-# This is the configuration/single module for tts
-# everything that would be a global variable goes here
-
-import os, sys, logging
-import socket
-
-LOGDIR = "log"
-SETTINGS_FILE = os.path.join(os.path.dirname(__file__), "settings.json")
-TEST_DIR_NAME = "tts_testdir"
-
-DEBUG = True
-
-OWN_PID = os.getpid()
-
-W3C_VALIDATOR = "http://icarus.local/w3c-validator/check?doctype=HTML5&uri="
-
-TOASTER_PORT = 56789
-
-TESTDIR = None
-
-#we parse the w3c URL to know where to connect
-
-import urlparse
-
-def get_public_ip():
-    temp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-    parsed_url = urlparse.urlparse("http://icarus.local/w3c-validator/check?doctype=HTML5&uri=")
-    temp_socket.connect((parsed_url.netloc, 80 if parsed_url.port is None else parsed_url.port))
-    public_ip = temp_socket.getsockname()[0]
-    temp_socket.close()
-    return public_ip
-
-TOASTER_BASEURL = "http://%s:%d/" % (get_public_ip(), TOASTER_PORT)
-
-
-OWN_EMAIL_ADDRESS = "Toaster Testing Framework <alexandru.damian@intel.com>"
-REPORT_EMAIL_ADDRESS = "alexandru.damian@intel.com"
-
-# make sure we have the basic logging infrastructure
-
-#pylint: disable=invalid-name
-# we disable the invalid name because the module-level "logger" is used througout bitbake
-logger = logging.getLogger("toastertest")
-__console__ = logging.StreamHandler(sys.stdout)
-__console__.setFormatter(logging.Formatter("%(asctime)s %(levelname)s: %(message)s"))
-logger.addHandler(__console__)
-logger.setLevel(logging.DEBUG)
-
-
-# singleton file names
-LOCKFILE = "/tmp/ttf.lock"
-BACKLOGFILE = os.path.join(os.path.dirname(__file__), "backlog.txt")
-
-# task states
-def enum(*sequential, **named):
-    enums = dict(zip(sequential, range(len(sequential))), **named)
-    reverse = dict((value, key) for key, value in enums.items())
-    enums['reverse_mapping'] = reverse
-    return type('Enum', (), enums)
-
-
-class TASKS(object):
-    #pylint: disable=too-few-public-methods
-    PENDING = "PENDING"
-    INPROGRESS = "INPROGRESS"
-    DONE = "DONE"
-
-    @staticmethod
-    def next_task(task):
-        if task == TASKS.PENDING:
-            return TASKS.INPROGRESS
-        if task == TASKS.INPROGRESS:
-            return TASKS.DONE
-        raise Exception("Invalid next task state for %s" % task)
-
-# TTS specific
-CONTRIB_REPO = "git@git.yoctoproject.org:poky-contrib"
-
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/launcher.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/launcher.py
deleted file mode 100755
index e5794c1..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/launcher.py
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/python
-
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# Copyright (C) 2015 Alexandru Damian for Intel Corp.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-# Program to run the next task listed from the backlog.txt; designed to be
-# run from crontab.
-
-from __future__ import print_function
-import sys, os, config, shellutils
-from shellutils import ShellCmdException
-
-# Import smtplib for the actual sending function
-import smtplib
-
-# Import the email modules we'll need
-from email.mime.text import MIMEText
-
-def _take_lockfile():
-    return shellutils.lockfile(shellutils.mk_lock_filename())
-
-
-def read_next_task_by_state(task_state, task_name=None):
-    if not os.path.exists(os.path.join(os.path.dirname(__file__), config.BACKLOGFILE)):
-        return None
-    os.rename(config.BACKLOGFILE, config.BACKLOGFILE + ".tmp")
-    task = None
-    with open(config.BACKLOGFILE + ".tmp", "r") as f_in:
-        with open(config.BACKLOGFILE, "w") as f_out:
-            for line in f_in.readlines():
-                if task is None:
-                    fields = line.strip().split("|", 2)
-                    if fields[1] == task_state:
-                        if task_name is None or task_name == fields[0]:
-                            task = fields[0]
-                            print("Updating %s %s to %s" % (task, task_state, config.TASKS.next_task(task_state)))
-                            line = "%s|%s\n" % (task, config.TASKS.next_task(task_state))
-                f_out.write(line)
-    os.remove(config.BACKLOGFILE + ".tmp")
-    return task
-
-def send_report(task_name, plaintext, errtext=None):
-    if errtext is None:
-        msg = MIMEText(plaintext)
-    else:
-        if plaintext is None:
-            plaintext = ""
-        msg = MIMEText("--STDOUT dump--\n\n%s\n\n--STDERR dump--\n\n%s" % (plaintext, errtext))
-
-    msg['Subject'] = "[review-request] %s - smoke test results" % task_name
-    msg['From'] = config.OWN_EMAIL_ADDRESS
-    msg['To'] = config.REPORT_EMAIL_ADDRESS
-
-    smtp_connection = smtplib.SMTP("localhost")
-    smtp_connection.sendmail(config.OWN_EMAIL_ADDRESS, [config.REPORT_EMAIL_ADDRESS], msg.as_string())
-    smtp_connection.quit()
-
-def main():
-    # we don't do anything if we have another instance of us running
-    lock_file = _take_lockfile()
-
-    if lock_file is None:
-        if config.DEBUG:
-            print("Concurrent script in progress, exiting")
-        sys.exit(1)
-
-    next_task = read_next_task_by_state(config.TASKS.PENDING)
-    if next_task is not None:
-        print("Next task is", next_task)
-        errtext = None
-        out = None
-        try:
-            out = shellutils.run_shell_cmd("%s %s" % (os.path.join(os.path.dirname(__file__), "runner.py"), next_task))
-        except ShellCmdException as exc:
-            print("Failed while running the test runner: %s", exc)
-            errtext = exc.__str__()
-        send_report(next_task, out, errtext)
-        read_next_task_by_state(config.TASKS.INPROGRESS, next_task)
-    else:
-        print("No task")
-
-    shellutils.unlockfile(lock_file)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/log/.create b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/log/.create
deleted file mode 100644
index e69de29..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/log/.create
+++ /dev/null
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/recv.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/recv.py
deleted file mode 100755
index 07efdac..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/recv.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/python
-
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# Copyright (C) 2015 Alexandru Damian for Intel Corp.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-# Program to receive review requests by email and log tasks to backlog.txt
-# Designed to be run by the email system from a .forward file:
-#
-# cat .forward
-# |[full/path]/recv.py
-
-from __future__ import print_function
-import sys, config, shellutils
-
-from email.parser import Parser
-
-def recv_mail(datastring):
-    headers = Parser().parsestr(datastring)
-    return headers['subject']
-
-def main():
-    lock_file = shellutils.lockfile(shellutils.mk_lock_filename(), retry=True)
-
-    if lock_file is None:
-        if config.DEBUG:
-            print("Concurrent script in progress, exiting")
-        sys.exit(1)
-
-    subject = recv_mail(sys.stdin.read())
-
-    subject_parts = subject.split()
-    if "[review-request]" in subject_parts:
-        task_name = subject_parts[subject_parts.index("[review-request]") + 1]
-        with open(config.BACKLOGFILE, "a") as fout:
-            line = "%s|%s\n" % (task_name, config.TASKS.PENDING)
-            fout.write(line)
-
-    shellutils.unlockfile(lock_file)
-
-if __name__ == "__main__":
-    main()
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/runner.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/runner.py
deleted file mode 100755
index d01386a..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/runner.py
+++ /dev/null
@@ -1,222 +0,0 @@
-#!/usr/bin/python
-
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# Copyright (C) 2015 Alexandru Damian for Intel Corp.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
-# This is the main test execution controller. It is designed to be run
-# manually from the command line, or to be called from a different program
-# that schedules test execution.
-#
-# Execute   runner.py -h   for help.
-
-
-
-from __future__ import print_function
-import sys, os
-import unittest, importlib
-import logging, pprint, json
-import re
-from shellutils import ShellCmdException, mkdirhier, run_shell_cmd
-
-import config
-
-# we also log to a file, in addition to console, because our output is important
-__log_file_name__ = os.path.join(os.path.dirname(__file__), "log/tts_%d.log" % config.OWN_PID)
-mkdirhier(os.path.dirname(__log_file_name__))
-__log_file__ = open(__log_file_name__, "w")
-__file_handler__ = logging.StreamHandler(__log_file__)
-__file_handler__.setFormatter(logging.Formatter("%(asctime)s %(levelname)s: %(message)s"))
-
-config.logger.addHandler(__file_handler__)
-
-# set up log directory
-try:
-    if not os.path.exists(config.LOGDIR):
-        os.mkdir(config.LOGDIR)
-    else:
-        if not os.path.isdir(config.LOGDIR):
-            raise Exception("Expected log dir '%s' is not actually a directory." % config.LOGDIR)
-except OSError as exc:
-    raise exc
-
-# creates the under-test-branch as a separate directory
-def set_up_test_branch(settings, branch_name):
-    testdir = "%s/%s.%d" % (settings['workdir'], config.TEST_DIR_NAME, config.OWN_PID)
-
-    # creates the host dir
-    if os.path.exists(testdir):
-        raise Exception("Test dir '%s'is already there, aborting" % testdir)
-
-    # may raise OSError, is to be handled by the caller
-    os.makedirs(testdir)
-
-
-    # copies over the .git from the localclone
-    run_shell_cmd("cp -a '%s'/.git '%s'" % (settings['localclone'], testdir))
-
-    # add the remote if it doesn't exist
-    crt_remotes = run_shell_cmd("git remote -v", cwd=testdir)
-    remotes = [word for line in crt_remotes.split("\n") for word in line.split()]
-    if not config.CONTRIB_REPO in remotes:
-        remote_name = "tts_contrib"
-        run_shell_cmd("git remote add %s %s" % (remote_name, config.CONTRIB_REPO), cwd=testdir)
-    else:
-        remote_name = remotes[remotes.index(config.CONTRIB_REPO) - 1]
-
-    # do the fetch
-    run_shell_cmd("git fetch %s -p" % remote_name, cwd=testdir)
-
-    # do the checkout
-    run_shell_cmd("git checkout origin/master && git branch -D %s; git checkout %s/%s -b %s && git reset --hard" % (branch_name, remote_name, branch_name, branch_name), cwd=testdir)
-
-    return testdir
-
-
-def __search_for_tests():
-    # we find all classes that can run, and run them
-    tests = []
-    for _, _, files_list in os.walk(os.path.dirname(os.path.abspath(__file__))):
-        for module_file in [f[:-3] for f in files_list if f.endswith(".py") and not f.startswith("__init__")]:
-            config.logger.debug("Inspecting module %s", module_file)
-            current_module = importlib.import_module(module_file)
-            crtclass_names = vars(current_module)
-            for name in crtclass_names:
-                tested_value = crtclass_names[name]
-                if isinstance(tested_value, type(unittest.TestCase)) and issubclass(tested_value, unittest.TestCase):
-                    tests.append((module_file, name))
-        break
-    return tests
-
-
-# boilerplate to self discover tests and run them
-def execute_tests(dir_under_test, testname):
-
-    if testname is not None and "." in testname:
-        tests = []
-        tests.append(tuple(testname.split(".", 2)))
-    else:
-        tests = __search_for_tests()
-
-    # let's move to the directory under test
-    crt_dir = os.getcwd()
-    os.chdir(dir_under_test)
-
-    # execute each module
-    # pylint: disable=broad-except
-    # we disable the broad-except because we want to actually catch all possible exceptions
-    try:
-        # sorting the tests by the numeric order in the class name
-        tests = sorted(tests, key=lambda x: int(re.search(r"[0-9]+", x[1]).group(0)))
-        config.logger.debug("Discovered test clases: %s", pprint.pformat(tests))
-        unittest.installHandler()
-        suite = unittest.TestSuite()
-        loader = unittest.TestLoader()
-        result = unittest.TestResult()
-        result.failfast = True
-        for module_file, test_name in tests:
-            suite.addTest(loader.loadTestsFromName("%s.%s" % (module_file, test_name)))
-        config.logger.info("Running %d test(s)", suite.countTestCases())
-        suite.run(result)
-
-        for error in result.errors:
-            config.logger.error("Exception on test: %s\n%s", error[0],
-                                "\n".join(["-- %s" % x for x in error[1].split("\n")]))
-
-        for failure in result.failures:
-            config.logger.error("Failed test: %s:\n%s\n", failure[0],
-                                "\n".join(["--  %s" % x for x in failure[1].split("\n")]))
-
-        config.logger.info("Test results: %d ran, %d errors, %d failures", result.testsRun, len(result.errors), len(result.failures))
-
-    except Exception as exc:
-        import traceback
-        config.logger.error("Exception while running test. Tracedump: \n%s", traceback.format_exc())
-    finally:
-        os.chdir(crt_dir)
-    return len(result.failures)
-
-# verify that we had a branch-under-test name as parameter
-def validate_args():
-    from optparse import OptionParser
-    parser = OptionParser(usage="usage: %prog [options] branch_under_test")
-
-    parser.add_option("-t", "--test-dir", dest="testdir", default=None, help="Use specified directory to run tests, inhibits the checkout.")
-    parser.add_option("-s", "--single", dest="singletest", default=None, help="Run only the specified test")
-
-    (options, args) = parser.parse_args()
-    if len(args) < 1:
-        raise Exception("Please specify the branch to run on. Use option '-h' when in doubt.")
-    return (options, args)
-
-
-
-
-# load the configuration options
-def read_settings():
-    if not os.path.exists(config.SETTINGS_FILE) or not os.path.isfile(config.SETTINGS_FILE):
-        raise Exception("Config file '%s' cannot be openend" % config.SETTINGS_FILE)
-    return json.loads(open(config.SETTINGS_FILE, "r").read())
-
-
-# cleanup !
-def clean_up(testdir):
-    run_shell_cmd("rm -rf -- '%s'" % testdir)
-
-def dump_info(settings, options, args):
-    """ detailed information about current run configuration, for debugging purposes.
-    """
-    config.logger.debug("Settings:\n%s\nOptions:\n%s\nArguments:\n%s\n", settings, options, args)
-
-def main():
-    (options, args) = validate_args()
-
-    settings = read_settings()
-    need_cleanup = False
-
-    # dump debug info
-    dump_info(settings, options, args)
-
-    testdir = None
-    no_failures = 1
-    try:
-        if options.testdir is not None and os.path.exists(options.testdir):
-            testdir = os.path.abspath(options.testdir)
-            config.logger.info("No checkout, using %s", testdir)
-        else:
-            need_cleanup = True
-            testdir = set_up_test_branch(settings, args[0]) # we expect a branch name as first argument
-
-        config.TESTDIR = testdir    # we let tests know where to run
-
-        # ensure that the test dir only contains no *.pyc leftovers
-        run_shell_cmd("find '%s' -type f -name *.pyc -exec rm {} \\;" % testdir)
-
-        no_failures = execute_tests(testdir, options.singletest)
-
-    except ShellCmdException as exc:
-        import traceback
-        config.logger.error("Error while setting up testing. Traceback: \n%s", traceback.format_exc())
-    finally:
-        if need_cleanup and testdir is not None:
-            clean_up(testdir)
-
-    sys.exit(no_failures)
-
-if __name__ == "__main__":
-    main()
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/settings.json b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/settings.json
deleted file mode 100644
index bb671ea..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/settings.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-	"repo": "git@git.yoctoproject.org:poky-contrib",
-	"localclone": "/home/ddalex/ssd/yocto/poky",
-	"workdir": "/home/ddalex/ssd/yocto"
-}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/shellutils.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/shellutils.py
deleted file mode 100644
index ce64c06..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/shellutils.py
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/usr/bin/python
-
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# Copyright (C) 2015 Alexandru Damian for Intel Corp.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-# Utilities shared by tests and other common bits of code.
-
-import sys, os, subprocess, fcntl, errno
-import config
-from config import logger
-
-
-# License warning; this code is copied from the BitBake project, file bitbake/lib/bb/utils.py
-# The code is originally licensed GPL-2.0, and we redistribute it under still GPL-2.0
-
-# End of copy is marked with #ENDOFCOPY marker
-
-def mkdirhier(directory):
-    """Create a directory like 'mkdir -p', but does not complain if
-    directory already exists like os.makedirs
-    """
-
-    try:
-        os.makedirs(directory)
-    except OSError as exc:
-        if exc.errno != errno.EEXIST:
-            raise exc
-
-def lockfile(name, shared=False, retry=True):
-    """
-    Use the file fn as a lock file, return when the lock has been acquired.
-    Returns a variable to pass to unlockfile().
-    """
-    config.logger.debug("take lockfile %s", name)
-    dirname = os.path.dirname(name)
-    mkdirhier(dirname)
-
-    if not os.access(dirname, os.W_OK):
-        logger.error("Unable to acquire lock '%s', directory is not writable",
-                     name)
-        sys.exit(1)
-
-    operation = fcntl.LOCK_EX
-    if shared:
-        operation = fcntl.LOCK_SH
-    if not retry:
-        operation = operation | fcntl.LOCK_NB
-
-    while True:
-        # If we leave the lockfiles lying around there is no problem
-        # but we should clean up after ourselves. This gives potential
-        # for races though. To work around this, when we acquire the lock
-        # we check the file we locked was still the lock file on disk.
-        # by comparing inode numbers. If they don't match or the lockfile
-        # no longer exists, we start again.
-
-        # This implementation is unfair since the last person to request the
-        # lock is the most likely to win it.
-
-        # pylint: disable=broad-except
-        # we disable the broad-except because we want to actually catch all possible exceptions
-        try:
-            lock_file = open(name, 'a+')
-            fileno = lock_file.fileno()
-            fcntl.flock(fileno, operation)
-            statinfo = os.fstat(fileno)
-            if os.path.exists(lock_file.name):
-                statinfo2 = os.stat(lock_file.name)
-                if statinfo.st_ino == statinfo2.st_ino:
-                    return lock_file
-            lock_file.close()
-        except Exception as exc:
-            try:
-                lock_file.close()
-            except Exception as exc2:
-                config.logger.error("Failed to close the lockfile: %s", exc2)
-            config.logger.error("Failed to acquire the lockfile: %s", exc)
-        if not retry:
-            return None
-
-def unlockfile(lock_file):
-    """
-    Unlock a file locked using lockfile()
-    """
-    try:
-        # If we had a shared lock, we need to promote to exclusive before
-        # removing the lockfile. Attempt this, ignore failures.
-        fcntl.flock(lock_file.fileno(), fcntl.LOCK_EX|fcntl.LOCK_NB)
-        os.unlink(lock_file.name)
-    except (IOError, OSError):
-        pass
-    fcntl.flock(lock_file.fileno(), fcntl.LOCK_UN)
-    lock_file.close()
-
-#ENDOFCOPY
-
-
-def mk_lock_filename():
-    our_name = os.path.basename(__file__)
-    our_name = ".%s" % ".".join(reversed(our_name.split(".")))
-    return config.LOCKFILE + our_name
-
-
-
-class ShellCmdException(Exception):
-    pass
-
-def run_shell_cmd(command, cwd=None):
-    if cwd is None:
-        cwd = os.getcwd()
-
-    config.logger.debug("_shellcmd: (%s) %s", cwd, command)
-    process = subprocess.Popen(command, cwd=cwd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-    (out, err) = process.communicate()
-    process.wait()
-    if process.returncode:
-        if len(err) == 0:
-            err = "command: %s \n%s" % (command, out)
-        else:
-            err = "command: %s \n%s" % (command, err)
-        config.logger.warning("_shellcmd: error \n%s\n%s", out, err)
-        raise ShellCmdException(err)
-    else:
-        #config.logger.debug("localhostbecontroller: shellcmd success\n%s" % out)
-        return out
-
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/tests.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/tests.py
deleted file mode 100644
index c510ebb..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/tests.py
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/usr/bin/python
-
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# Copyright (C) 2015 Alexandru Damian for Intel Corp.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
-# Test definitions. The runner will look for and auto-discover the tests
-# no matter what they file are they in, as long as they are in the same directory
-# as this file.
-
-import unittest
-from shellutils import run_shell_cmd, ShellCmdException
-import config
-
-import pexpect
-import sys, os, signal, time
-
-class Test00PyCompilable(unittest.TestCase):
-    ''' Verifies that all Python files are syntactically correct '''
-    def test_compile_file(self):
-        try:
-            run_shell_cmd("find . -name *py -type f -print0 | xargs -0 -n1 -P20 python -m py_compile", config.TESTDIR)
-        except ShellCmdException as exc:
-            self.fail("Error compiling python files: %s" % (exc))
-
-    def test_pylint_file(self):
-        try:
-            run_shell_cmd(r"find . -iname \"*\.py\" -type f -print0 | PYTHONPATH=${PYTHONPATH}:. xargs -r -0 -n1 pylint --load-plugins pylint_django -E --reports=n 2>&1", cwd=config.TESTDIR + "/bitbake/lib/toaster")
-        except ShellCmdException as exc:
-            self.fail("Pylint fails: %s\n" % exc)
-
-class Test01PySystemStart(unittest.TestCase):
-    ''' Attempts to start Toaster, verify that it is succesfull, and stop it '''
-    def setUp(self):
-        run_shell_cmd("bash -c 'rm -f build/*log'")
-
-    def test_start_interactive_mode(self):
-        try:
-            run_shell_cmd("bash -c 'source %s/oe-init-build-env && source toaster start webport=%d && source toaster stop'" % (config.TESTDIR, config.TOASTER_PORT), config.TESTDIR)
-        except ShellCmdException as exc:
-            self.fail("Failed starting interactive mode: %s" % (exc))
-
-    def test_start_managed_mode(self):
-        try:
-            run_shell_cmd("%s/bitbake/bin/toaster webport=%d nobrowser & sleep 10 && curl http://localhost:%d/ && kill -2 %%1" % (config.TESTDIR, config.TOASTER_PORT, config.TOASTER_PORT), config.TESTDIR)
-        except ShellCmdException as exc:
-            self.fail("Failed starting managed mode: %s" % (exc))
-
-class Test02HTML5Compliance(unittest.TestCase):
-    def setUp(self):
-        self.origdir = os.getcwd()
-        self.crtdir = os.path.dirname(config.TESTDIR)
-        self.cleanup_database = False
-        os.chdir(self.crtdir)
-        if not os.path.exists(os.path.join(self.crtdir, "toaster.sqlite")):
-            self.cleanup_database = True
-            run_shell_cmd("%s/bitbake/lib/toaster/manage.py syncdb --noinput" % config.TESTDIR)
-            run_shell_cmd("%s/bitbake/lib/toaster/manage.py migrate orm" % config.TESTDIR)
-            run_shell_cmd("%s/bitbake/lib/toaster/manage.py migrate bldcontrol" % config.TESTDIR)
-            run_shell_cmd("%s/bitbake/lib/toaster/manage.py loadconf %s/meta-yocto/conf/toasterconf.json" % (config.TESTDIR, config.TESTDIR))
-            run_shell_cmd("%s/bitbake/lib/toaster/manage.py lsupdates" % config.TESTDIR)
-
-            setup = pexpect.spawn("%s/bitbake/lib/toaster/manage.py checksettings" % config.TESTDIR)
-            setup.logfile = sys.stdout
-            setup.expect(r".*or type the full path to a different directory: ")
-            setup.sendline('')
-            setup.sendline('')
-            setup.expect(r".*or type the full path to a different directory: ")
-            setup.sendline('')
-            setup.expect(r"Enter your option: ")
-            setup.sendline('0')
-
-        self.child = pexpect.spawn("bash", ["%s/bitbake/bin/toaster" % config.TESTDIR, "webport=%d" % config.TOASTER_PORT, "nobrowser"], cwd=self.crtdir)
-        self.child.logfile = sys.stdout
-        self.child.expect("Toaster is now running. You can stop it with Ctrl-C")
-
-    def test_html5_compliance(self):
-        import urllist, urlcheck
-        results = {}
-        for url in urllist.URLS:
-            results[url] = urlcheck.validate_html5(config.TOASTER_BASEURL + url)
-
-        failed = []
-        for url in results:
-            if results[url][1] != 0:
-                failed.append((url, results[url]))
-
-
-        self.assertTrue(len(failed) == 0, "Not all URLs validate: \n%s " % "\n".join(["".join(str(x)) for x in failed]))
-
-        #(config.TOASTER_BASEURL + url, status, errors, warnings))
-
-    def tearDown(self):
-        while self.child.isalive():
-            self.child.kill(signal.SIGINT)
-            time.sleep(1)
-        os.chdir(self.origdir)
-        toaster_sqlite_path = os.path.join(self.crtdir, "toaster.sqlite")
-        if self.cleanup_database and os.path.exists(toaster_sqlite_path):
-            os.remove(toaster_sqlite_path)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/run_toastertests.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/run_toastertests.py
deleted file mode 100755
index 8ca45a8..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/run_toastertests.py
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/usr/bin/python
-
-# Copyright
-
-# DESCRIPTION
-# This is script for running all selected toaster cases on
-# selected web browsers manifested in toaster_test.cfg.
-
-# 1. How to start toaster in yocto:
-# $ source poky/oe-init-build-env
-# $ source toaster start
-# $ bitbake core-image-minimal
-
-# 2. How to install selenium on Ubuntu:
-# $ sudo apt-get install scrot python-pip
-# $ sudo pip install selenium
-
-# 3. How to install selenium addon in firefox:
-# Download the lastest firefox addon from http://release.seleniumhq.org/selenium-ide/
-# Then install it. You can also install firebug and firepath addon
-
-# 4. How to start writing a new case:
-# All you need to do is to implement the function test_xxx() and  pile it on.
-
-# 5. How to test with Chrome browser
-# Download/install chrome on host
-# Download chromedriver from https://code.google.com/p/chromedriver/downloads/list  according to your host type
-# put chromedriver in PATH, (e.g. /usr/bin/, bear in mind to chmod)
-# For windows host, you may put chromedriver.exe in the same directory as chrome.exe
-
-import unittest, sys, os, platform
-import ConfigParser
-import argparse
-from toaster_automation_test import toaster_cases
-
-
-def get_args_parser():
-    description = "Script that runs toaster auto tests."
-    parser = argparse.ArgumentParser(description=description)
-    parser.add_argument('--run-all-tests', required=False, action="store_true", dest="run_all_tests", default=False,
-                       help='Run all tests.')
-    parser.add_argument('--run-suite', required=False, dest='run_suite', default=False,
-                       help='run suite (defined in cfg file)')
-
-    return parser
-
-
-def get_tests():
-    testslist = []
-
-    prefix = 'toaster_automation_test.toaster_cases'
-
-    for t in dir(toaster_cases):
-        if t.startswith('test_'):
-            testslist.append('.'.join((prefix, t)))
-
-    return testslist
-
-
-def get_tests_from_cfg(suite=None):
-
-    testslist = []
-    config = ConfigParser.SafeConfigParser()
-    config.read('toaster_test.cfg')
-
-    if suite is not None:
-        target_suite = suite.lower()
-
-        # TODO: if suite is valid suite
-
-    else:
-        target_suite = platform.system().lower()
-
-    try:
-        tests_from_cfg = eval(config.get('toaster_test_' + target_suite, 'test_cases'))
-    except:
-        print('Failed to get test cases from cfg file. Make sure the format is correct.')
-        return None
-
-    prefix = 'toaster_automation_test.toaster_cases.test_'
-    for t in tests_from_cfg:
-        testslist.append(prefix + str(t))
-
-    return testslist
-
-def main():
-
-    # In case this script is called from other directory
-    os.chdir(os.path.abspath(sys.path[0]))
-
-    parser = get_args_parser()
-    args = parser.parse_args()
-
-    if args.run_all_tests:
-        testslist = get_tests()
-    elif args.run_suite:
-        testslist = get_tests_from_cfg(args.run_suite)
-        os.environ['TOASTER_SUITE'] = args.run_suite
-    else:
-        testslist = get_tests_from_cfg()
-
-    if not testslist:
-        print('Failed to get test cases.')
-        exit(1)
-
-    suite = unittest.TestSuite()
-    loader = unittest.TestLoader()
-    loader.sortTestMethodsUsing = None
-    runner = unittest.TextTestRunner(verbosity=2, resultclass=buildResultClass(args))
-
-    for test in testslist:
-        try:
-            suite.addTests(loader.loadTestsFromName(test))
-        except:
-            return 1
-
-    result = runner.run(suite)
-
-    if result.wasSuccessful():
-        return 0
-    else:
-        return 1
-
-
-def buildResultClass(args):
-    """Build a Result Class to use in the testcase execution"""
-
-    class StampedResult(unittest.TextTestResult):
-        """
-        Custom TestResult that prints the time when a test starts.  As toaster-auto
-        can take a long time (ie a few hours) to run, timestamps help us understand
-        what tests are taking a long time to execute.
-        """
-        def startTest(self, test):
-            import time
-            self.stream.write(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + " - ")
-            super(StampedResult, self).startTest(test)
-
-    return StampedResult
-
-
-if __name__ == "__main__":
-
-    try:
-        ret = main()
-    except:
-        ret = 1
-        import traceback
-        traceback.print_exc()
-    finally:
-        if os.getenv('TOASTER_SUITE'):
-            del os.environ['TOASTER_SUITE']
-    sys.exit(ret)
-
-
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py
deleted file mode 100755
index 1a786fa..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py
+++ /dev/null
@@ -1,2376 +0,0 @@
-#!/usr/bin/python
-# Copyright
-
-# DESCRIPTION
-# This is toaster automation base class and test cases file
-
-# History:
-# 2015.03.09  inital version
-# 2015.03.23  adding toaster_test.cfg, run_toastertest.py so we can run case by case from outside
-
-# Briefs:
-# This file is comprised of 3 parts:
-# I:   common utils like sorting, getting attribute.. etc
-# II:  base class part, which complies with unittest frame work and
-#      contains class selenium-based functions
-# III: test cases
-#      to add new case: just implement new test_xxx() function in class toaster_cases
-
-# NOTES for cases:
-# case 946:
-# step 6 - 8 needs to be observed using screenshots
-# case 956:
-# step 2 - 3 needs to be run manually
-
-import unittest, time, re, sys, getopt, os, logging, string, errno, exceptions
-import shutil, argparse, ConfigParser, platform, json
-from selenium import webdriver
-from selenium.common.exceptions import NoSuchElementException
-from selenium import selenium
-from selenium.webdriver.common.by import By
-from selenium.webdriver.common.keys import Keys
-from selenium.webdriver.support.ui import Select
-import sqlite3 as sqlite
-
-
-###########################################
-#                                         #
-# PART I: utils stuff                     #
-#                                         #
-###########################################
-
-class Listattr(object):
-    """
-    Set of list attribute. This is used to determine what the list content is.
-    Later on we may add more attributes here.
-    """
-    NULL = "null"
-    NUMBERS = "numbers"
-    STRINGS = "strings"
-    PERCENT = "percentage"
-    SIZE = "size"
-    UNKNOWN = "unknown"
-
-
-def get_log_root_dir():
-    max_depth = 5
-    parent_dir = '../'
-    for number in range(0, max_depth):
-        if os.path.isdir(sys.path[0] + os.sep + (os.pardir + os.sep)*number + 'log'):
-            log_root_dir = os.path.abspath(sys.path[0] + os.sep + (os.pardir + os.sep)*number + 'log')
-            break
-
-    if number == (max_depth - 1):
-        print('No log dir found. Please check')
-        raise Exception
-
-    return log_root_dir
-
-
-def mkdir_p(dir):
-    try:
-        os.makedirs(dir)
-    except OSError as exc:
-        if exc.errno == errno.EEXIST and os.path.isdir(dir):
-            pass
-        else:
-            raise
-
-
-def get_list_attr(testlist):
-    """
-    To determine the list content
-    """
-    if not testlist:
-        return Listattr.NULL
-    listtest = testlist[:]
-    try:
-        listtest.remove('')
-    except ValueError:
-        pass
-    pattern_percent = re.compile(r"^([0-9])+(\.)?([0-9])*%$")
-    pattern_size = re.compile(r"^([0-9])+(\.)?([0-9])*( )*(K)*(M)*(G)*B$")
-    pattern_number = re.compile(r"^([0-9])+(\.)?([0-9])*$")
-    def get_patterned_number(pattern, tlist):
-        count = 0
-        for item in tlist:
-            if re.search(pattern, item):
-                count += 1
-        return count
-    if get_patterned_number(pattern_percent, listtest) == len(listtest):
-        return Listattr.PERCENT
-    elif get_patterned_number(pattern_size, listtest) == len(listtest):
-        return Listattr.SIZE
-    elif get_patterned_number(pattern_number, listtest) == len(listtest):
-        return Listattr.NUMBERS
-    else:
-        return Listattr.STRINGS
-
-
-def is_list_sequenced(testlist):
-    """
-    Function to tell if list is sequenced
-    Currently we may have list made up of: Strings ; numbers ; percentage ; time; size
-    Each has respective way to determine if it's sequenced.
-    """
-    test_list = testlist[:]
-    try:
-        test_list.remove('')
-    except ValueError:
-        pass
-
-    if get_list_attr(testlist) == Listattr.NULL :
-        return True
-
-    elif get_list_attr(testlist) == Listattr.STRINGS :
-        return (sorted(test_list) == test_list)
-
-    elif get_list_attr(testlist) == Listattr.NUMBERS :
-        list_number = []
-        for item in test_list:
-            list_number.append(eval(item))
-        return (sorted(list_number) == list_number)
-
-    elif get_list_attr(testlist) == Listattr.PERCENT :
-        list_number = []
-        for item in test_list:
-            list_number.append(eval(item.strip('%')))
-        return (sorted(list_number) == list_number)
-
-    elif get_list_attr(testlist) == Listattr.SIZE :
-        list_number = []
-        # currently SIZE is splitted by space
-        for item in test_list:
-            if item.split()[1].upper() == "KB":
-                list_number.append(1024 * eval(item.split()[0]))
-            elif item.split()[1].upper() == "MB":
-                list_number.append(1024 * 1024 * eval(item.split()[0]))
-            elif item.split()[1].upper() == "GB":
-                list_number.append(1024 * 1024 * 1024 * eval(item.split()[0]))
-            else:
-                list_number.append(eval(item.split()[0]))
-        return (sorted(list_number) == list_number)
-
-    else:
-        print('Unrecognized list type, please check')
-        return False
-
-
-def is_list_inverted(testlist):
-    """
-    Function to tell if list is inverted
-    Currently we may have list made up of: Strings ; numbers ; percentage ; time; size
-    Each has respective way to determine if it's inverted.
-    """
-    test_list = testlist[:]
-    try:
-        test_list.remove('')
-    except ValueError:
-        pass
-
-    if get_list_attr(testlist) == Listattr.NULL :
-        return True
-
-    elif get_list_attr(testlist) == Listattr.STRINGS :
-        return (sorted(test_list, reverse = True) == test_list)
-
-    elif get_list_attr(testlist) == Listattr.NUMBERS :
-        list_number = []
-        for item in test_list:
-            list_number.append(eval(item))
-        return (sorted(list_number, reverse = True) == list_number)
-
-    elif get_list_attr(testlist) == Listattr.PERCENT :
-        list_number = []
-        for item in test_list:
-            list_number.append(eval(item.strip('%')))
-        return (sorted(list_number, reverse = True) == list_number)
-
-    elif get_list_attr(testlist) == Listattr.SIZE :
-        list_number = []
-        # currently SIZE is splitted by space. such as 0 B; 1 KB; 2 MB
-        for item in test_list:
-            if item.split()[1].upper() == "KB":
-                list_number.append(1024 * eval(item.split()[0]))
-            elif item.split()[1].upper() == "MB":
-                list_number.append(1024 * 1024 * eval(item.split()[0]))
-            elif item.split()[1].upper() == "GB":
-                list_number.append(1024 * 1024 * 1024 * eval(item.split()[0]))
-            else:
-                list_number.append(eval(item.split()[0]))
-        return (sorted(list_number, reverse = True) == list_number)
-
-    else:
-        print('Unrecognized list type, please check')
-        return False
-
-def replace_file_content(filename, item, option):
-    f = open(filename)
-    lines = f.readlines()
-    f.close()
-    output = open(filename, 'w')
-    for line in lines:
-        if line.startswith(item):
-            output.write(item + " = '" + option + "'\n")
-        else:
-            output.write(line)
-    output.close()
-
-def extract_number_from_string(s):
-    """
-    extract the numbers in a string. return type is 'list'
-    """
-    return re.findall(r'([0-9]+)', s)
-
-# Below is decorator derived from toaster backend test code
-class NoParsingFilter(logging.Filter):
-    def filter(self, record):
-        return record.levelno == 100
-
-def LogResults(original_class):
-    orig_method = original_class.run
-
-    from time import strftime, gmtime
-    caller = 'toaster'
-    timestamp = strftime('%Y%m%d%H%M%S',gmtime())
-    logfile = os.path.join(os.getcwd(),'results-'+caller+'.'+timestamp+'.log')
-    linkfile = os.path.join(os.getcwd(),'results-'+caller+'.log')
-
-    #rewrite the run method of unittest.TestCase to add testcase logging
-    def run(self, result, *args, **kws):
-        orig_method(self, result, *args, **kws)
-        passed = True
-        testMethod = getattr(self, self._testMethodName)
-        #if test case is decorated then use it's number, else use it's name
-        try:
-            test_case = testMethod.test_case
-        except AttributeError:
-            test_case = self._testMethodName
-
-        class_name = str(testMethod.im_class).split("'")[1]
-
-        #create custom logging level for filtering.
-        custom_log_level = 100
-        logging.addLevelName(custom_log_level, 'RESULTS')
-
-        def results(self, message, *args, **kws):
-            if self.isEnabledFor(custom_log_level):
-                self.log(custom_log_level, message, *args, **kws)
-        logging.Logger.results = results
-
-        logging.basicConfig(filename=logfile,
-                            filemode='w',
-                            format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
-                            datefmt='%H:%M:%S',
-                            level=custom_log_level)
-        for handler in logging.root.handlers:
-            handler.addFilter(NoParsingFilter())
-        local_log = logging.getLogger(caller)
-
-        #check status of tests and record it
-
-        for (name, msg) in result.errors:
-            if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
-                local_log.results("Testcase "+str(test_case)+": ERROR")
-                local_log.results("Testcase "+str(test_case)+":\n"+msg)
-                passed = False
-        for (name, msg) in result.failures:
-            if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
-                local_log.results("Testcase "+str(test_case)+": FAILED")
-                local_log.results("Testcase "+str(test_case)+":\n"+msg)
-                passed = False
-        for (name, msg) in result.skipped:
-            if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
-                local_log.results("Testcase "+str(test_case)+": SKIPPED")
-                passed = False
-        if passed:
-            local_log.results("Testcase "+str(test_case)+": PASSED")
-
-        # Create symlink to the current log
-        if os.path.exists(linkfile):
-            os.remove(linkfile)
-        os.symlink(logfile, linkfile)
-
-    original_class.run = run
-
-    return original_class
-
-
-###########################################
-#                                         #
-# PART II: base class                     #
-#                                         #
-###########################################
-
-@LogResults
-class toaster_cases_base(unittest.TestCase):
-
-    @classmethod
-    def setUpClass(cls):
-        cls.log = cls.logger_create()
-
-    def setUp(self):
-        self.screenshot_sequence = 1
-        self.verificationErrors = []
-        self.accept_next_alert = True
-        self.host_os = platform.system().lower()
-        if os.getenv('TOASTER_SUITE'):
-            self.target_suite = os.getenv('TOASTER_SUITE')
-        else:
-            self.target_suite = self.host_os
-
-        self.parser = ConfigParser.SafeConfigParser()
-        self.parser.read('toaster_test.cfg')
-        self.base_url = eval(self.parser.get('toaster_test_' + self.target_suite, 'toaster_url'))
-
-        # create log dir . Currently , we put log files in log/tmp. After all
-        # test cases are done, move them to log/$datetime dir
-        self.log_tmp_dir = os.path.abspath(sys.path[0]) + os.sep + 'log' + os.sep + 'tmp'
-        try:
-            mkdir_p(self.log_tmp_dir)
-        except OSError :
-            logging.error("%(asctime)s Cannot create tmp dir under log, please check your privilege")
-        # self.log = self.logger_create()
-        # driver setup
-        self.setup_browser()
-
-    @staticmethod
-    def logger_create():
-        log_file = "toaster-auto-" + time.strftime("%Y%m%d%H%M%S") + ".log"
-        if os.path.exists("toaster-auto.log"): os.remove("toaster-auto.log")
-        os.symlink(log_file, "toaster-auto.log")
-
-        log = logging.getLogger("toaster")
-        log.setLevel(logging.DEBUG)
-
-        fh = logging.FileHandler(filename=log_file, mode='w')
-        fh.setLevel(logging.DEBUG)
-
-        ch = logging.StreamHandler(sys.stdout)
-        ch.setLevel(logging.INFO)
-
-        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
-        fh.setFormatter(formatter)
-        ch.setFormatter(formatter)
-
-        log.addHandler(fh)
-        log.addHandler(ch)
-
-        return log
-
-
-    def setup_browser(self, *browser_path):
-        self.browser = eval(self.parser.get('toaster_test_' + self.target_suite, 'test_browser'))
-        print(self.browser)
-        if self.browser == "firefox":
-            driver = webdriver.Firefox()
-        elif self.browser == "chrome":
-            driver = webdriver.Chrome()
-        elif self.browser == "ie":
-            driver = webdriver.Ie()
-        else:
-            driver = None
-            print("unrecognized browser type, please check")
-        self.driver = driver
-        self.driver.implicitly_wait(30)
-        return self.driver
-
-
-    def save_screenshot(self,  **log_args):
-        """
-        This function is used to save screen either by os interface or selenium interface.
-        How to use:
-        self.save_screenshot(screenshot_type = 'native'/'selenium', log_sub_dir = 'xxx',
-                             append_name = 'stepx')
-        where native means screenshot func provided by OS,
-        selenium means screenshot func provided by selenium webdriver
-        """
-        types = [log_args.get('screenshot_type')]
-        # when no screenshot_type is specified
-        if types == [None]:
-            types = ['native', 'selenium']
-        # normally append_name is used to specify which step..
-        add_name = log_args.get('append_name')
-        if not add_name:
-            add_name = '-'
-        # normally there's no need to specify sub_dir
-        sub_dir = log_args.get('log_sub_dir')
-        if not sub_dir:
-            # use casexxx as sub_dir name
-            sub_dir = 'case' + str(self.case_no)
-        for item in types:
-            log_dir = self.log_tmp_dir + os.sep + sub_dir
-            mkdir_p(log_dir)
-            log_path = log_dir + os.sep +  self.browser + '-' +\
-                    item + '-' + add_name + '-' + str(self.screenshot_sequence) + '.png'
-            if item == 'native':
-                if self.host_os == "linux":
-                    os.system("scrot " + log_path)
-                elif self.host_os=="darwin":
-                    os.system("screencapture -x " + log_path)
-            elif item == 'selenium':
-                self.driver.get_screenshot_as_file(log_path)
-            self.screenshot_sequence += 1
-
-    def browser_delay(self):
-        """
-        currently this is a workaround for some chrome test.
-        Sometimes we need a delay to accomplish some operation.
-        But for firefox, mostly we don't need this.
-        To be discussed
-        """
-        if self.browser == "chrome":
-            time.sleep(1)
-        return
-
-
-# these functions are not contained in WebDriver class..
-    def find_element_by_text(self, string):
-        return self.driver.find_element_by_xpath("//*[text()='" + string + "']")
-
-
-    def find_elements_by_text(self, string):
-        return self.driver.find_elements_by_xpath("//*[text()='" + string + "']")
-
-
-    def find_element_by_text_in_table(self, table_id, text_string):
-        """
-        This is used to search some certain 'text' in certain table
-        """
-        try:
-            table_element = self.get_table_element(table_id)
-            element = table_element.find_element_by_xpath("//*[text()='" + text_string + "']")
-        except NoSuchElementException as e:
-            print('no element found')
-            raise
-        return element
-
-
-    def find_element_by_link_text_in_table(self, table_id, link_text):
-        """
-        Assume there're multiple suitable "find_element_by_link_text".
-        In this circumstance we need to specify "table".
-        """
-        try:
-            table_element = self.get_table_element(table_id)
-            element = table_element.find_element_by_link_text(link_text)
-        except NoSuchElementException as e:
-            print('no element found')
-            raise
-        return element
-
-
-    def find_elements_by_link_text_in_table(self, table_id, link_text):
-        """
-        Search link-text in certain table. This helps to narrow down search area.
-        """
-        try:
-            table_element = self.get_table_element(table_id)
-            element_list = table_element.find_elements_by_link_text(link_text)
-        except NoSuchElementException as e:
-            print('no element found')
-            raise
-        return element_list
-
-
-    def find_element_by_partial_link_text_in_table(self, table_id, link_text):
-        """
-        Search element by partial link text in certain table.
-        """
-        try:
-            table_element = self.get_table_element(table_id)
-            element = table_element.find_element_by_partial_link_text(link_text)
-            return element
-        except NoSuchElementException as e:
-            print('no element found')
-            raise
-
-
-    def find_elements_by_partial_link_text_in_table(self, table_id, link_text):
-        """
-        Assume there're multiple suitable "find_partial_element_by_link_text".
-        """
-        try:
-            table_element = self.get_table_element(table_id)
-            element_list = table_element.find_elements_by_partial_link_text(link_text)
-            return element_list
-        except NoSuchElementException as e:
-            print('no element found')
-            raise
-
-
-    def find_element_by_xpath_in_table(self, table_id, xpath):
-        """
-        This helps to narrow down search area. Especially useful when dealing with pop-up form.
-        """
-        try:
-            table_element = self.get_table_element(table_id)
-            element = table_element.find_element_by_xpath(xpath)
-        except NoSuchElementException as e:
-            print('no element found')
-            raise
-        return element
-
-
-    def find_elements_by_xpath_in_table(self, table_id, xpath):
-        """
-        This helps to narrow down search area. Especially useful when dealing with pop-up form.
-        """
-        try:
-            table_element = self.get_table_element(table_id)
-            element_list = table_element.find_elements_by_xpath(xpath)
-        except NoSuchElementException as e:
-            print('no elements found')
-            raise
-        return element_list
-
-
-    def shortest_xpath(self, pname, pvalue):
-        return "//*[@" + pname + "='" + pvalue + "']"
-
-
-#usually elements in the same column are with same class name. for instance: class="outcome" .TBD
-    def get_table_column_text(self, attr_name, attr_value):
-        c_xpath = self.shortest_xpath(attr_name, attr_value)
-        elements = self.driver.find_elements_by_xpath(c_xpath)
-        c_list = []
-        for element in elements:
-            c_list.append(element.text)
-        return c_list
-
-
-    def get_table_column_text_by_column_number(self, table_id, column_number):
-        c_xpath = "//*[@id='" + table_id + "']//td[" + str(column_number) + "]"
-        elements = self.driver.find_elements_by_xpath(c_xpath)
-        c_list = []
-        for element in elements:
-            c_list.append(element.text)
-        return c_list
-
-
-    def get_table_head_text(self, *table_id):
-#now table_id is a tuple...
-        if table_id:
-            thead_xpath = "//*[@id='" + table_id[0] + "']//thead//th[text()]"
-            elements = self.driver.find_elements_by_xpath(thead_xpath)
-            c_list = []
-            for element in elements:
-                if element.text:
-                    c_list.append(element.text)
-            return c_list
-#default table on page
-        else:
-            return self.driver.find_element_by_xpath("//*/table/thead").text
-
-
-
-    def get_table_element(self, table_id, *coordinate):
-        if len(coordinate) == 0:
-#return whole-table element
-            element_xpath = "//*[@id='" + table_id + "']"
-            try:
-                element = self.driver.find_element_by_xpath(element_xpath)
-            except NoSuchElementException as e:
-                raise
-            return element
-        row = coordinate[0]
-
-        if len(coordinate) == 1:
-#return whole-row element
-            element_xpath = "//*[@id='" + table_id + "']/tbody/tr[" + str(row) + "]"
-            try:
-                element = self.driver.find_element_by_xpath(element_xpath)
-            except NoSuchElementException as e:
-                return False
-            return element
-#now we are looking for an element with specified X and Y
-        column = coordinate[1]
-
-        element_xpath = "//*[@id='" + table_id + "']/tbody/tr[" + str(row) + "]/td[" + str(column) + "]"
-        try:
-            element = self.driver.find_element_by_xpath(element_xpath)
-        except NoSuchElementException as e:
-            return False
-        return element
-
-
-    def get_table_data(self, table_id, row_count, column_count):
-        row = 1
-        Lists = []
-        while row <= row_count:
-            column = 1
-            row_content=[]
-            while column <= column_count:
-                s= "//*[@id='" + table_id + "']/tbody/tr[" + str(row) +"]/td[" + str(column) + "]"
-                v = self.driver.find_element_by_xpath(s).text
-                row_content.append(v)
-                column = column + 1
-                print("row_content=",row_content)
-            Lists.extend(row_content)
-            print(Lists[row-1][0])
-            row = row + 1
-        return Lists
-
-    # The is_xxx_present functions only returns True/False
-    # All the log work is done in test procedure, so we can easily trace back
-    # using logging
-    def is_text_present (self, patterns):
-        for pattern in patterns:
-            if str(pattern) not in self.driver.page_source:
-                print('Text "'+pattern+'" is missing')
-                return False
-        return True
-
-
-    def is_element_present(self, how, what):
-        try:
-            self.driver.find_element(how, what)
-        except NoSuchElementException as e:
-            print('Could not find element '+str(what)+' by ' + str(how))
-            return False
-        return True
-
-
-    def is_alert_present(self):
-        try: self.driver.switch_to_alert()
-        except NoAlertPresentException as e: return False
-        return True
-
-
-    def close_alert_and_get_its_text(self):
-        try:
-            alert = self.driver.switch_to_alert()
-            alert_text = alert.text
-            if self.accept_next_alert:
-                alert.accept()
-            else:
-                alert.dismiss()
-            return alert_text
-        finally: self.accept_next_alert = True
-
-
-    def get_case_number(self):
-        """
-        what case are we running now
-        """
-        funcname = sys._getframe(1).f_code.co_name
-        caseno_str = funcname.strip('test_')
-        try:
-            caseno = int(caseno_str)
-        except ValueError:
-            print("get case number error! please check if func name is test_xxx")
-            return False
-        return caseno
-
-
-    def tearDown(self):
-        self.log.info(' END: CASE %s log \n\n' % str(self.case_no))
-        self.driver.quit()
-        self.assertEqual([], self.verificationErrors)
-
-
-###################################################################
-#                                                                 #
-# PART III: test cases                                            #
-# please refer to                                                 #
-# https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=xxx  #
-#                                                                 #
-###################################################################
-
-# Note: to comply with the unittest framework, we call these test_xxx functions
-# from run_toastercases.py to avoid calling setUp() and tearDown() multiple times
-
-
-class toaster_cases(toaster_cases_base):
-        ##############
-        #  CASE 901  #
-        ##############
-    def test_901(self):
-        # the reason why get_case_number is not in setUp function is that
-        # otherwise it returns "setUp" instead of "test_xxx"
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        # open all columns
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # adding explicitly wait for chromedriver..-_-
-        self.browser_delay()
-        self.driver.find_element_by_id("started_on").click()
-        self.browser_delay()
-        self.driver.find_element_by_id("time").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # dict: {lint text name : actual class name}
-        table_head_dict = {'Outcome':'outcome', 'Recipe':'target', 'Machine':'machine', 'Started on':'started_on', 'Completed on':'completed_on', \
-                'Errors':'errors_no', 'Warnings':'warnings_no', 'Time':'time'}
-        for key in table_head_dict:
-            try:
-                self.driver.find_element_by_link_text(key).click()
-            except Exception as e:
-                self.log.error("%s cannot be found on page" % key)
-                raise
-            column_list = self.get_table_column_text("class", table_head_dict[key])
-            # after 1st click, the list should be either sequenced or inverted, but we don't have a "default order" here
-            # the point is, after another click, it should be another order
-            if is_list_inverted(column_list):
-                self.driver.find_element_by_link_text(key).click()
-                column_list = self.get_table_column_text("class", table_head_dict[key])
-                self.assertTrue(is_list_sequenced(column_list), msg=("%s column not in order" % key))
-            else:
-                self.assertTrue(is_list_sequenced(column_list), msg=("%s column not sequenced" % key))
-                self.driver.find_element_by_link_text(key).click()
-                column_list = self.get_table_column_text("class", table_head_dict[key])
-                self.assertTrue(is_list_inverted(column_list), msg=("%s column not inverted" % key))
-        self.log.info("case passed")
-
-
-        ##############
-        #  CASE 902  #
-        ##############
-    def test_902(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        # Could add more test patterns here in the future. Also, could search some items other than target column in future..
-        patterns = ["minimal", "sato"]
-        for pattern in patterns:
-            ori_target_column_texts = self.get_table_column_text("class", "target")
-            print(ori_target_column_texts)
-            self.driver.find_element_by_id("search").clear()
-            self.driver.find_element_by_id("search").send_keys(pattern)
-            self.driver.find_element_by_id("search-button").click()
-            new_target_column_texts = self.get_table_column_text("class", "target")
-            # if nothing found, we still count it as "pass"
-            if new_target_column_texts:
-                for text in new_target_column_texts:
-                    self.assertTrue(text.find(pattern), msg=("%s item doesn't exist " % pattern))
-            self.driver.find_element_by_css_selector("i.icon-remove").click()
-            target_column_texts = self.get_table_column_text("class", "target")
-            self.assertTrue(ori_target_column_texts == target_column_texts, msg=("builds changed after operations"))
-
-
-        ##############
-        #  CASE 903  #
-        ##############
-    def test_903(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        # when opening a new page, "started_on" is not displayed by default
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # currently all the delay are for chrome driver -_-
-        self.browser_delay()
-        self.driver.find_element_by_id("started_on").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # step 4
-        items = ["Outcome", "Completed on", "Started on"]
-        for item in items:
-            try:
-                temp_element = self.find_element_by_text_in_table('otable', item)
-                # this is how we find "filter icon" in the same level as temp_element(where "a" means clickable, "i" means icon)
-                self.assertTrue(temp_element.find_element_by_xpath("..//*/a/i[@class='icon-filter filtered']"))
-            except Exception as e:
-                self.assertFalse(True, msg=(" %s cannot be found! %s" % (item, e)))
-                raise
-        # step 5-6
-        temp_element = self.find_element_by_link_text_in_table('otable', 'Outcome')
-        temp_element.find_element_by_xpath("..//*/a/i[@class='icon-filter filtered']").click()
-        self.browser_delay()
-        # the 2nd option, whatever it is
-        self.driver.find_element_by_xpath("(//input[@name='filter'])[2]").click()
-        # click "Apply" button
-        self.driver.find_element_by_xpath("//*[@id='filter_outcome']//*[text()='Apply']").click()
-        # save screen here
-        time.sleep(1)
-        self.save_screenshot(screenshot_type='selenium', append_name='step5')
-        temp_element = self.find_element_by_link_text_in_table('otable', 'Completed on')
-        temp_element.find_element_by_xpath("..//*/a/i[@class='icon-filter filtered']").click()
-        self.browser_delay()
-        self.driver.find_element_by_xpath("//*[@id='filter_completed_on']//*[text()='Apply']").click()
-        # save screen here to compare to previous one
-        # please note that for chrome driver, need a little break before saving
-        # screen here -_-
-        self.browser_delay()
-        self.save_screenshot(screenshot_type='selenium', append_name='step6')
-        self.driver.find_element_by_id("search").clear()
-        self.driver.find_element_by_id("search").send_keys("core-image")
-        self.driver.find_element_by_id("search-button").click()
-
-
-        ##############
-        #  CASE 904  #
-        ##############
-    def test_904(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_partial_link_text("core-image").click()
-        self.driver.find_element_by_link_text("Tasks").click()
-        self.table_name = 'otable'
-        # This is how we find the "default" rows-number!
-        rows_displayed = int(Select(self.driver.find_element_by_css_selector("select.pagesize")).first_selected_option.text)
-        print(rows_displayed)
-        self.assertTrue(self.get_table_element(self.table_name, rows_displayed), msg=("not enough rows displayed"))
-        self.assertFalse(self.get_table_element(self.table_name, rows_displayed + 1), \
-                         msg=("more rows displayed than expected"))
-        # Search text box background text is "Search tasks"
-        self.assertTrue(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search tasks']"),\
-                        msg=("background text doesn't exist"))
-
-        self.driver.find_element_by_id("search").clear()
-        self.driver.find_element_by_id("search").send_keys("busybox")
-        self.driver.find_element_by_id("search-button").click()
-        self.browser_delay()
-        self.save_screenshot(screenshot_type='selenium', append_name='step5')
-        self.driver.find_element_by_css_selector("i.icon-remove").click()
-        # Save screen here
-        self.save_screenshot(screenshot_type='selenium', append_name='step5_2')
-        self.driver.find_element_by_id("edit-columns-button").click()
-        self.driver.find_element_by_id("cpu_used").click()
-        self.driver.find_element_by_id("disk_io").click()
-        self.driver.find_element_by_id("recipe_version").click()
-        self.driver.find_element_by_id("time_taken").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # The operation is the same as case901
-        # dict: {lint text name : actual class name}
-        table_head_dict = {'Order':'order', 'Recipe':'recipe_name', 'Task':'task_name', 'Executed':'executed', \
-                           'Outcome':'outcome', 'Cache attempt':'cache_attempt', 'Time (secs)':'time_taken', 'CPU usage':'cpu_used', \
-                           'Disk I/O (ms)':'disk_io'}
-        for key in table_head_dict:
-        # This is tricky here: we are doing so because there may be more than 1
-        # same-name link_text in one page. So we only find element inside the table
-            self.find_element_by_link_text_in_table(self.table_name, key).click()
-            column_list = self.get_table_column_text("class", table_head_dict[key])
-        # after 1st click, the list should be either sequenced or inverted, but we don't have a "default order" here
-        # the point is, after another click, it should be another order
-        # the first case is special:this means every item in column_list is the same, so
-        # after one click, either sequenced or inverted will be fine
-            if (is_list_inverted(column_list) and is_list_sequenced(column_list)) \
-                or (not column_list) :
-                self.find_element_by_link_text_in_table(self.table_name, key).click()
-                column_list = self.get_table_column_text("class", table_head_dict[key])
-                self.assertTrue(is_list_sequenced(column_list) or is_list_inverted(column_list), \
-                                msg=("%s column not in any order" % key))
-            elif is_list_inverted(column_list):
-                self.find_element_by_link_text_in_table(self.table_name, key).click()
-                column_list = self.get_table_column_text("class", table_head_dict[key])
-                self.assertTrue(is_list_sequenced(column_list), msg=("%s column not in order" % key))
-            else:
-                self.assertTrue(is_list_sequenced(column_list), msg=("%s column not in order" % key))
-                self.find_element_by_link_text_in_table(self.table_name, key).click()
-                column_list = self.get_table_column_text("class", table_head_dict[key])
-                self.assertTrue(is_list_inverted(column_list), msg=("%s column not inverted" % key))
-        # step 8-10
-        # filter dict: {link text name : filter table name in xpath}
-        filter_dict = {'Executed':'filter_executed', 'Outcome':'filter_outcome', 'Cache attempt':'filter_cache_attempt'}
-        for key in filter_dict:
-            temp_element = self.find_element_by_link_text_in_table(self.table_name, key)
-            # find the filter icon besides it.
-            # And here we must have break (1 sec) to get the popup stuff
-            temp_element.find_element_by_xpath("..//*[@class='icon-filter filtered']").click()
-            self.browser_delay()
-            avail_options = self.driver.find_elements_by_xpath("//*[@id='" + filter_dict[key] + "']//*[@name='filter'][not(@disabled)]")
-            for number in range(0, len(avail_options)):
-                avail_options[number].click()
-                self.browser_delay()
-                # click "Apply"
-                self.driver.find_element_by_xpath("//*[@id='" + filter_dict[key]  + "']//*[@type='submit']").click()
-                # insert screen capture here
-                self.browser_delay()
-                self.save_screenshot(screenshot_type='selenium', append_name='step8')
-                # after the last option was clicked, we don't need operation below anymore
-                if number < len(avail_options)-1:
-                     try:
-                        temp_element = self.find_element_by_link_text_in_table(self.table_name, key)
-                        temp_element.find_element_by_xpath("..//*[@class='icon-filter filtered']").click()
-                        avail_options = self.driver.find_elements_by_xpath("//*[@id='" + filter_dict[key] + "']//*[@name='filter'][not(@disabled)]")
-                     except:
-                        print("in exception")
-                        self.find_element_by_text("Show all tasks").click()
-#                        self.driver.find_element_by_xpath("//*[@id='searchform']/button[2]").click()
-                        temp_element = self.find_element_by_link_text_in_table(self.table_name, key)
-                        temp_element.find_element_by_xpath("..//*[@class='icon-filter filtered']").click()
-                        avail_options = self.driver.find_elements_by_xpath("//*[@id='" + filter_dict[key] + "']//*[@name='filter'][not(@disabled)]")
-                     self.browser_delay()
-        # step 11
-        for item in ['order', 'task_name', 'executed', 'outcome', 'recipe_name', 'recipe_version']:
-            try:
-                self.find_element_by_xpath_in_table(self.table_name, "./tbody/tr[1]/*[@class='" + item + "']/a").click()
-            except NoSuchElementException as e:
-            # let it go...
-                print('no item in the colum' + item)
-            # insert screen shot here
-            self.save_screenshot(screenshot_type='selenium', append_name='step11')
-            self.driver.back()
-        # step 12-14
-        # about test_dict: please refer to testcase 904 requirement step 12-14
-        test_dict = {
-            'Time':{
-                'class':'time_taken',
-                'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'Time (secs)'],
-                'check_column_list':['cpu_used', 'cache_attempt', 'disk_io', 'order', 'recipe_version']
-            },
-            'CPU usage':{
-                'class':'cpu_used',
-                'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'CPU usage'],
-                'check_column_list':['cache_attempt', 'disk_io', 'order', 'recipe_version', 'time_taken']
-            },
-            'Disk I/O':{
-                'class':'disk_io',
-                'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'Disk I/O (ms)'],
-                'check_column_list':['cpu_used', 'cache_attempt', 'order', 'recipe_version', 'time_taken']
-            }
-        }
-        for key in test_dict:
-            self.find_element_by_partial_link_text_in_table('nav', 'core-image').click()
-            self.find_element_by_link_text_in_table('nav', key).click()
-            head_list = self.get_table_head_text('otable')
-            for item in test_dict[key]['check_head_list']:
-                self.assertTrue(item in head_list, msg=("%s not in head row" % item))
-            column_list = self.get_table_column_text('class', test_dict[key]['class'])
-            self.assertTrue(is_list_inverted(column_list), msg=("%s column not inverted" % key))
-
-            self.driver.find_element_by_id("edit-columns-button").click()
-            for item2 in test_dict[key]['check_column_list']:
-                self.driver.find_element_by_id(item2).click()
-            self.driver.find_element_by_id("edit-columns-button").click()
-            # TBD: save screen here
-
-
-        ##############
-        #  CASE 906  #
-        ##############
-    def test_906(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.find_element_by_link_text_in_table('nav', 'Packages').click()
-        # find "bash" in first column (Packages)
-        self.driver.find_element_by_xpath("//*[@id='otable']//td[1]//*[text()='bash']").click()
-        # save sceen here to observe...
-        # step 6
-        self.driver.find_element_by_partial_link_text("Generated files").click()
-        head_list = self.get_table_head_text('otable')
-        for item in ['File', 'Size']:
-            self.assertTrue(item in head_list, msg=("%s not in head row" % item))
-        c_list = self.get_table_column_text('class', 'path')
-        self.assertTrue(is_list_sequenced(c_list), msg=("column not in order"))
-        # step 7
-        self.driver.find_element_by_partial_link_text("Runtime dependencies").click()
-        # save sceen here to observe...
-        # note that here table name is not 'otable'
-        head_list = self.get_table_head_text('dependencies')
-        for item in ['Package', 'Version', 'Size']:
-            self.assertTrue(item in head_list, msg=("%s not in head row" % item))
-        c_list = self.get_table_column_text_by_column_number('dependencies', 1)
-        self.assertTrue(is_list_sequenced(c_list), msg=("list not in order"))
-        texts = ['Size', 'License', 'Recipe', 'Recipe version', 'Layer', \
-                     'Layer commit']
-        self.failUnless(self.is_text_present(texts))
-
-
-        ##############
-        #  CASE 910  #
-        ##############
-    def test_910(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        image_type="core-image-minimal"
-        test_package1="busybox"
-        test_package2="lib"
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text(image_type).click()
-        self.driver.find_element_by_link_text("Recipes").click()
-        self.save_screenshot(screenshot_type='selenium', append_name='step3')
-
-        self.table_name = 'otable'
-        # This is how we find the "default" rows-number!
-        rows_displayed = int(Select(self.driver.find_element_by_css_selector("select.pagesize")).first_selected_option.text)
-        print(rows_displayed)
-        self.assertTrue(self.get_table_element(self.table_name, rows_displayed))
-        self.assertFalse(self.get_table_element(self.table_name, rows_displayed + 1))
-
-        # Check the default table is sorted by Recipe
-        tasks_column_count = len(self.driver.find_elements_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]"))
-        print(tasks_column_count)
-        default_column_list = self.get_table_column_text_by_column_number(self.table_name, 1)
-        #print default_column_list
-
-        self.assertTrue(is_list_sequenced(default_column_list))
-
-        # Search text box background text is "Search recipes"
-        self.assertTrue(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']"))
-
-        self.driver.find_element_by_id("search").clear()
-        self.driver.find_element_by_id("search").send_keys(test_package1)
-        self.driver.find_element_by_id("search-button").click()
-        # Save screen here
-        self.save_screenshot(screenshot_type='selenium', append_name='step4')
-        self.driver.find_element_by_css_selector("i.icon-remove").click()
-        self.save_screenshot(screenshot_type='selenium', append_name='step4_2')
-
-        self.driver.find_element_by_id("edit-columns-button").click()
-        self.driver.find_element_by_id("depends_on").click()
-        self.driver.find_element_by_id("layer_version__branch").click()
-        self.driver.find_element_by_id("layer_version__layer__commit").click()
-        self.driver.find_element_by_id("depends_by").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-
-        self.find_element_by_link_text_in_table(self.table_name, 'Recipe').click()
-        # Check the inverted table by Recipe
-        # Recipe doesn't have class name
-        #inverted_tasks_column_count = len(self.driver.find_elements_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]"))
-        #print inverted_tasks_column_count
-        #inverted_column_list = self.get_table_column_text_by_column_number(self.table_name, 1)
-        #print inverted_column_list
-
-        #self.driver.find_element_by_partial_link_text("zlib").click()
-        #self.driver.back()
-        #self.assertTrue(is_list_inverted(inverted_column_list))
-        #self.find_element_by_link_text_in_table(self.table_name, 'Recipe').click()
-
-        table_head_dict = {'Recipe':'recipe__name', 'Recipe file':'recipe_file', 'Section':'recipe_section', \
-                'License':'recipe_license', 'Layer':'layer_version__layer__name', \
-                'Layer branch':'layer_version__branch'}
-        for key in table_head_dict:
-            self.find_element_by_link_text_in_table(self.table_name, key).click()
-            column_list = self.get_table_column_text("class", table_head_dict[key])
-            if (is_list_inverted(column_list) and is_list_sequenced(column_list)) \
-                    or (not column_list) :
-                self.find_element_by_link_text_in_table(self.table_name, key).click()
-                column_list = self.get_table_column_text("class", table_head_dict[key])
-                self.assertTrue(is_list_sequenced(column_list) or is_list_inverted(column_list))
-                self.driver.find_element_by_partial_link_text("acl").click()
-                self.driver.back()
-                self.assertTrue(is_list_sequenced(column_list) or is_list_inverted(column_list))
-                # Search text box background text is "Search recipes"
-                self.assertTrue(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']"))
-                self.driver.find_element_by_id("search").clear()
-                self.driver.find_element_by_id("search").send_keys(test_package2)
-                self.driver.find_element_by_id("search-button").click()
-                column_search_list = self.get_table_column_text("class", table_head_dict[key])
-                self.assertTrue(is_list_sequenced(column_search_list) or is_list_inverted(column_search_list))
-                self.driver.find_element_by_css_selector("i.icon-remove").click()
-            elif is_list_inverted(column_list):
-                self.find_element_by_link_text_in_table(self.table_name, key).click()
-                column_list = self.get_table_column_text("class", table_head_dict[key])
-                self.assertTrue(is_list_sequenced(column_list))
-                self.driver.find_element_by_partial_link_text("acl").click()
-                self.driver.back()
-                self.assertTrue(is_list_sequenced(column_list))
-                # Search text box background text is "Search recipes"
-                self.assertTrue(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']"))
-                self.driver.find_element_by_id("search").clear()
-                self.driver.find_element_by_id("search").send_keys(test_package2)
-                self.driver.find_element_by_id("search-button").click()
-                column_search_list = self.get_table_column_text("class", table_head_dict[key])
-                self.assertTrue(is_list_sequenced(column_search_list))
-                self.driver.find_element_by_css_selector("i.icon-remove").click()
-            else:
-                self.assertTrue(is_list_sequenced(column_list),  msg=("list %s not sequenced" % key))
-                self.find_element_by_link_text_in_table(self.table_name, key).click()
-                column_list = self.get_table_column_text("class", table_head_dict[key])
-                self.assertTrue(is_list_inverted(column_list))
-                try:
-                    self.driver.find_element_by_partial_link_text("acl").click()
-                except:
-                    self.driver.find_element_by_partial_link_text("zlib").click()
-                self.driver.back()
-                self.assertTrue(is_list_inverted(column_list))
-                # Search text box background text is "Search recipes"
-                self.assertTrue(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']"))
-                self.driver.find_element_by_id("search").clear()
-                self.driver.find_element_by_id("search").send_keys(test_package2)
-                self.driver.find_element_by_id("search-button").click()
-                column_search_list = self.get_table_column_text("class", table_head_dict[key])
-                #print column_search_list
-                self.assertTrue(is_list_inverted(column_search_list))
-                self.driver.find_element_by_css_selector("i.icon-remove").click()
-
-        # Bug 5919
-        for key in table_head_dict:
-            print(key)
-            self.find_element_by_link_text_in_table(self.table_name, key).click()
-            self.driver.find_element_by_id("edit-columns-button").click()
-            self.driver.find_element_by_id(table_head_dict[key]).click()
-            self.driver.find_element_by_id("edit-columns-button").click()
-            self.browser_delay()
-            # After hide the column, the default table should be sorted by Recipe
-            tasks_column_count = len(self.driver.find_elements_by_partial_link_text("acl"))
-            #print tasks_column_count
-            default_column_list = self.get_table_column_text_by_column_number(self.table_name, 1)
-            #print default_column_list
-            self.assertTrue(is_list_sequenced(default_column_list))
-
-        self.driver.find_element_by_id("edit-columns-button").click()
-        self.driver.find_element_by_id("recipe_file").click()
-        self.driver.find_element_by_id("recipe_section").click()
-        self.driver.find_element_by_id("recipe_license").click()
-        self.driver.find_element_by_id("layer_version__layer__name").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-
-
-        ##############
-        #  CASE 911  #
-        ##############
-    def test_911(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.find_element_by_link_text_in_table('nav', 'Recipes').click()
-        # step 3-5
-        self.driver.find_element_by_id("search").clear()
-        self.driver.find_element_by_id("search").send_keys("lib")
-        self.driver.find_element_by_id("search-button").click()
-        # save screen here for observation
-        self.save_screenshot(screenshot_type='selenium', append_name='step5')
-        # step 6
-        self.driver.find_element_by_css_selector("i.icon-remove").click()
-        self.driver.find_element_by_id("search").clear()
-        # we deliberately want "no result" here
-        self.driver.find_element_by_id("search").send_keys("no such input")
-        self.driver.find_element_by_id("search-button").click()
-        try:
-            self.find_element_by_text("Show all recipes").click()
-        except:
-            self.fail(msg='Could not identify blank page elements')
-
-        ##############
-        #  CASE 912  #
-        ##############
-    def test_912(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.find_element_by_link_text_in_table('nav', 'Recipes').click()
-        # step 3
-        head_list = self.get_table_head_text('otable')
-        for item in ['Recipe', 'Recipe version', 'Recipe file', 'Section', 'License', 'Layer']:
-            self.assertTrue(item in head_list, msg=("item %s not in head row" % item))
-        self.driver.find_element_by_id("edit-columns-button").click()
-        self.driver.find_element_by_id("depends_on").click()
-        self.driver.find_element_by_id("layer_version__branch").click()
-        self.driver.find_element_by_id("layer_version__layer__commit").click()
-        self.driver.find_element_by_id("depends_by").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # check if columns selected above is shown
-        check_list = ['Dependencies', 'Layer branch', 'Layer commit', 'Reverse dependencies']
-        head_list = self.get_table_head_text('otable')
-        time.sleep(2)
-        print(head_list)
-        for item in check_list:
-            self.assertTrue(item in head_list, msg=("item %s not in head row" % item))
-        # un-check 'em all
-        self.driver.find_element_by_id("edit-columns-button").click()
-        self.driver.find_element_by_id("depends_on").click()
-        self.driver.find_element_by_id("layer_version__branch").click()
-        self.driver.find_element_by_id("layer_version__layer__commit").click()
-        self.driver.find_element_by_id("depends_by").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # don't exist any more
-        head_list = self.get_table_head_text('otable')
-        for item in check_list:
-            self.assertFalse(item in head_list, msg=("item %s should not be in head row" % item))
-
-
-        ##############
-        #  CASE 913  #
-        ##############
-    def test_913(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.find_element_by_link_text_in_table('nav', 'Recipes').click()
-        # step 3
-        head_list = self.get_table_head_text('otable')
-        for item in ['Recipe', 'Recipe version', 'Recipe file', 'Section', 'License', 'Layer']:
-            self.assertTrue(item in head_list, msg=("item %s not in head row" % item))
-        # step 4
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # save screen
-        self.browser_delay()
-        self.save_screenshot(screenshot_type='selenium', append_name='step4')
-        self.driver.find_element_by_id("edit-columns-button").click()
-
-
-        ##############
-        #  CASE 914  #
-        ##############
-    def test_914(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        image_type="core-image-minimal"
-        test_package1="busybox"
-        test_package2="gdbm"
-        test_package3="gettext-native"
-        driver = self.driver
-        driver.maximize_window()
-        driver.get(self.base_url)
-        driver.find_element_by_link_text(image_type).click()
-        driver.find_element_by_link_text("Recipes").click()
-        driver.find_element_by_link_text(test_package1).click()
-
-        self.table_name = 'information'
-
-        tasks_row_count = len(driver.find_elements_by_xpath("//*[@id='"+self.table_name+"']/table/tbody/tr/td[1]"))
-        tasks_column_count = len(driver.find_elements_by_xpath("//*[@id='"+self.table_name+"']/table/tbody/tr[1]/td"))
-        print('rows: '+str(tasks_row_count))
-        print('columns: '+str(tasks_column_count))
-
-        Tasks_column = self.get_table_column_text_by_column_number(self.table_name, 2)
-        print ("Tasks_column=", Tasks_column)
-
-        key_tasks=["do_fetch", "do_unpack",  "do_patch", "do_configure", "do_compile", "do_install", "do_package", "do_build"]
-        i = 0
-        while i < len(key_tasks):
-            if key_tasks[i] not in Tasks_column:
-                print ("Error! Missing key task: %s" % key_tasks[i])
-            else:
-                print ("%s is in tasks" % key_tasks[i])
-            i = i + 1
-
-        if Tasks_column.index(key_tasks[0]) != 0:
-            print ("Error! %s is not in the right position" % key_tasks[0])
-        else:
-            print ("%s is in right position" % key_tasks[0])
-
-        if Tasks_column[-1] != key_tasks[-1]:
-            print ("Error! %s is not in the right position" % key_tasks[-1])
-        else:
-            print ("%s is in right position" % key_tasks[-1])
-
-        driver.find_element_by_partial_link_text("Packages (").click()
-        packages_name = driver.find_element_by_partial_link_text("Packages (").text
-        print(packages_name)
-        packages_num = int(filter(str.isdigit, repr(packages_name)))
-        print(packages_num)
-
-        #switch the table to show more than 10 rows at a time
-        self.driver.find_element_by_xpath("//*[@id='packages-built']/div[1]/div/select").click()
-        Select(driver.find_element_by_xpath("//*[@id='packages-built']/div[1]/div/select")).select_by_value('150')
-        self.driver.find_element_by_xpath("//*[@id='packages-built']/div[1]/div/select").send_keys(Keys.ENTER)
-
-        packages_row_count = len(driver.find_elements_by_xpath("//*[@id='otable']/tbody/tr/td[1]"))
-        print(packages_row_count)
-
-        if packages_num != packages_row_count:
-            print ("Error! The packages number is not correct")
-        else:
-            print ("The packages number is correct")
-
-        driver.find_element_by_partial_link_text("Build dependencies (").click()
-        depends_name = driver.find_element_by_partial_link_text("Build dependencies (").text
-        print(depends_name)
-        depends_num = int(list(filter(str.isdigit, repr(depends_name))))
-        print(depends_num)
-
-        if depends_num == 0:
-            depends_message = repr(driver.find_element_by_css_selector("div.alert.alert-info").text)
-            print(depends_message)
-            if depends_message.find("has no build dependencies.") < 0:
-                print ("Error! The message isn't expected.")
-            else:
-                print ("The message is expected")
-        else:
-            depends_row_count = len(driver.find_elements_by_xpath("//*[@id='dependencies']/table/tbody/tr/td[1]"))
-            print(depends_row_count)
-            if depends_num != depends_row_count:
-                print ("Error! The dependent packages number is not correct")
-            else:
-                print ("The dependent packages number is correct")
-
-        driver.find_element_by_partial_link_text("Reverse build dependencies (").click()
-        rdepends_name = driver.find_element_by_partial_link_text("Reverse build dependencies (").text
-        print(rdepends_name)
-        rdepends_num = int(filter(str.isdigit, repr(rdepends_name)))
-        print(rdepends_num)
-
-        if rdepends_num == 0:
-            rdepends_message = repr(driver.find_element_by_css_selector("#brought-in-by > div.alert.alert-info").text)
-            print(rdepends_message)
-            if rdepends_message.find("has no reverse build dependencies.") < 0:
-                print ("Error! The message isn't expected.")
-            else:
-                print ("The message is expected")
-        else:
-            print ("The reverse dependent packages number is correct")
-
-        driver.find_element_by_link_text("Recipes").click()
-        driver.find_element_by_link_text(test_package2).click()
-        driver.find_element_by_partial_link_text("Packages (").click()
-        driver.find_element_by_partial_link_text("Build dependencies (").click()
-        driver.find_element_by_partial_link_text("Reverse build dependencies (").click()
-
-
-        driver.find_element_by_link_text("Recipes").click()
-        driver.find_element_by_link_text(test_package3).click()
-
-        native_tasks_row_count = len(driver.find_elements_by_xpath("//*[@id='information']/table/tbody/tr/td[1]"))
-        native_tasks_column_count = len(driver.find_elements_by_xpath("//*[@id='information']/table/tbody/tr[1]/td"))
-        print(native_tasks_row_count)
-        print(native_tasks_column_count)
-
-        Native_Tasks_column = self.get_table_column_text_by_column_number(self.table_name, 2)
-        print ("Native_Tasks_column=", Native_Tasks_column)
-
-        native_key_tasks=["do_fetch", "do_unpack",  "do_patch", "do_configure", "do_compile", "do_install", "do_build"]
-        i = 0
-        while i < len(native_key_tasks):
-            if native_key_tasks[i] not in Native_Tasks_column:
-                print ("Error! Missing key task: %s" % native_key_tasks[i])
-            else:
-                print ("%s is in tasks" % native_key_tasks[i])
-            i = i + 1
-
-        if Native_Tasks_column.index(native_key_tasks[0]) != 0:
-            print ("Error! %s is not in the right position" % native_key_tasks[0])
-        else:
-            print ("%s is in right position" % native_key_tasks[0])
-
-        if Native_Tasks_column[-1] != native_key_tasks[-1]:
-            print ("Error! %s is not in the right position" % native_key_tasks[-1])
-        else:
-            print ("%s is in right position" % native_key_tasks[-1])
-
-        driver.find_element_by_partial_link_text("Packages (").click()
-        native_packages_name = driver.find_element_by_partial_link_text("Packages (").text
-        print(native_packages_name)
-        native_packages_num = int(filter(str.isdigit, repr(native_packages_name)))
-        print(native_packages_num)
-
-        if native_packages_num != 0:
-            print ("Error! Native task shouldn't have any packages.")
-        else:
-            native_package_message = repr(driver.find_element_by_css_selector("#packages-built > div.alert.alert-info").text)
-            print(native_package_message)
-            if native_package_message.find("does not build any packages.") < 0:
-                print ("Error! The message for native task isn't expected.")
-            else:
-                print ("The message for native task is expected.")
-
-        driver.find_element_by_partial_link_text("Build dependencies (").click()
-        native_depends_name = driver.find_element_by_partial_link_text("Build dependencies (").text
-        print(native_depends_name)
-        native_depends_num = int(filter(str.isdigit, repr(native_depends_name)))
-        print(native_depends_num)
-
-        native_depends_row_count = len(driver.find_elements_by_xpath("//*[@id='dependencies']/table/tbody/tr/td[1]"))
-        print(native_depends_row_count)
-
-        if native_depends_num != native_depends_row_count:
-            print ("Error! The dependent packages number is not correct")
-        else:
-            print ("The dependent packages number is correct")
-
-        driver.find_element_by_partial_link_text("Reverse build dependencies (").click()
-        native_rdepends_name = driver.find_element_by_partial_link_text("Reverse build dependencies (").text
-        print(native_rdepends_name)
-        native_rdepends_num = int(filter(str.isdigit, repr(native_rdepends_name)))
-        print(native_rdepends_num)
-
-        native_rdepends_row_count = len(driver.find_elements_by_xpath("//*[@id='brought-in-by']/table/tbody/tr/td[1]"))
-        print(native_rdepends_row_count)
-
-        if native_rdepends_num != native_rdepends_row_count:
-            print ("Error! The reverse dependent packages number is not correct")
-        else:
-            print ("The reverse dependent packages number is correct")
-
-        driver.find_element_by_link_text("Recipes").click()
-
-
-        ##############
-        #  CASE 915  #
-        ##############
-    def test_915(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        # step 3
-        self.find_element_by_link_text_in_table('nav', 'Configuration').click()
-        self.driver.find_element_by_link_text("BitBake variables").click()
-        # step 4
-        self.driver.find_element_by_id("search").clear()
-        self.driver.find_element_by_id("search").send_keys("lib")
-        self.driver.find_element_by_id("search-button").click()
-        # save screen to see result
-        self.browser_delay()
-        self.save_screenshot(screenshot_type='selenium', append_name='step4')
-        # step 5
-        self.driver.find_element_by_css_selector("i.icon-remove").click()
-        head_list = self.get_table_head_text('otable')
-        print(head_list)
-        print(len(head_list))
-        self.assertTrue(head_list == ['Variable', 'Value', 'Set in file', 'Description'], \
-                        msg=("head row contents wrong"))
-        # step 8
-        # search other string. and click "Variable" to re-sort, check if table
-        # head is still the same
-        self.driver.find_element_by_id("search").clear()
-        self.driver.find_element_by_id("search").send_keys("poky")
-        self.driver.find_element_by_id("search-button").click()
-        self.find_element_by_link_text_in_table('otable', 'Variable').click()
-        head_list = self.get_table_head_text('otable')
-        self.assertTrue(head_list == ['Variable', 'Value', 'Set in file', 'Description'], \
-                        msg=("head row contents wrong"))
-        self.find_element_by_link_text_in_table('otable', 'Variable').click()
-        head_list = self.get_table_head_text('otable')
-        self.assertTrue(head_list == ['Variable', 'Value', 'Set in file', 'Description'], \
-                        msg=("head row contents wrong"))
-
-
-        ##############
-        #  CASE 916  #
-        ##############
-    def test_916(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        # step 2-3
-        self.find_element_by_link_text_in_table('nav', 'Configuration').click()
-        self.driver.find_element_by_link_text("BitBake variables").click()
-        variable_list = self.get_table_column_text('class', 'variable_name')
-        self.assertTrue(is_list_sequenced(variable_list), msg=("list not in order"))
-        # step 4
-        self.find_element_by_link_text_in_table('otable', 'Variable').click()
-        variable_list = self.get_table_column_text('class', 'variable_name')
-        self.assertTrue(is_list_inverted(variable_list), msg=("list not inverted"))
-        self.find_element_by_link_text_in_table('otable', 'Variable').click()
-        # step 5
-        # searching won't change the sequentiality
-        self.driver.find_element_by_id("search").clear()
-        self.driver.find_element_by_id("search").send_keys("lib")
-        self.driver.find_element_by_id("search-button").click()
-        variable_list = self.get_table_column_text('class', 'variable_name')
-        self.assertTrue(is_list_sequenced(variable_list), msg=("list not in order"))
-
-
-        ##############
-        #  CASE 923  #
-        ##############
-    def test_923(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        # Step 2
-        # default sequence in "Completed on" column is inverted
-        c_list = self.get_table_column_text('class', 'completed_on')
-        self.assertTrue(is_list_inverted(c_list), msg=("list not inverted"))
-        # step 3
-        self.driver.find_element_by_id("edit-columns-button").click()
-        self.driver.find_element_by_id("started_on").click()
-        self.driver.find_element_by_id("time").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        head_list = self.get_table_head_text('otable')
-        for item in ['Outcome', 'Recipe', 'Machine', 'Started on', 'Completed on', 'Failed tasks', 'Errors', 'Warnings', 'Time', "Image files", "Project"]:
-            self.failUnless(item in head_list, msg=item+' is missing from table head.')
-
-
-        ##############
-        #  CASE 924  #
-        ##############
-    def test_924(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        # Please refer to case 924 requirement
-        # default sequence in "Completed on" column is inverted
-        c_list = self.get_table_column_text('class', 'completed_on')
-        self.assertTrue(is_list_inverted(c_list), msg=("list not inverted"))
-        # Step 4
-        # click Errors , order in "Completed on" should be disturbed. Then hide
-        # error column to check if order in "Completed on" can be restored
-#THIS TEST IS NO LONGER VALID DUE TO DESIGN CHANGES. LEAVING IN PENDING UPDATES TO DESIGN
-        #self.find_element_by_link_text_in_table('otable', 'Errors').click()
-        #self.driver.find_element_by_id("edit-columns-button").click()
-        #self.driver.find_element_by_id("errors_no").click()
-        #self.driver.find_element_by_id("edit-columns-button").click()
-        # Note: without time.sleep here, there'll be unpredictable error..TBD
-        time.sleep(1)
-        c_list = self.get_table_column_text('class', 'completed_on')
-        self.assertTrue(is_list_inverted(c_list), msg=("list not inverted"))
-
-
-        ##############
-        #  CASE 940  #
-        ##############
-    def test_940(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        # Step 2-3
-        self.find_element_by_link_text_in_table('nav', 'Packages').click()
-        check_head_list = ['Package', 'Package version', 'Size', 'Recipe']
-        head_list = self.get_table_head_text('otable')
-        self.assertTrue(head_list == check_head_list, msg=("head row not as expected"))
-        # Step 4
-        # pulldown menu
-        option_ids = ['recipe__layer_version__layer__name', 'recipe__layer_version__branch', \
-                      'recipe__layer_version__layer__commit', 'license', 'recipe__version']
-        self.driver.find_element_by_id("edit-columns-button").click()
-        for item in option_ids:
-            if not self.driver.find_element_by_id(item).is_selected():
-                self.driver.find_element_by_id(item).click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # save screen here to observe that 'Package' and 'Package version' is
-        # not selectable
-        self.browser_delay()
-        self.save_screenshot(screenshot_type='selenium', append_name='step4')
-
-
-        ##############
-        #  CASE 941  #
-        ##############
-    def test_941(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        # Step 2-3
-        self.find_element_by_link_text_in_table('nav', 'Packages').click()
-        # column -- Package
-        column_list = self.get_table_column_text_by_column_number('otable', 1)
-        self.assertTrue(is_list_sequenced(column_list), msg=("list not in order"))
-        self.find_element_by_link_text_in_table('otable', 'Size').click()
-
-
-        ##############
-        #  CASE 942  #
-        ##############
-    def test_942(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.driver.find_element_by_link_text("Packages").click()
-        #get initial table header
-        head_list = self.get_table_head_text('otable')
-        #remove the Recipe column from table header
-        self.driver.find_element_by_id("edit-columns-button").click()
-        self.driver.find_element_by_id("recipe__name").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        #get modified table header
-        new_head = self.get_table_head_text('otable')
-        self.assertTrue(head_list > new_head)
-
-        ##############
-        #  CASE 943  #
-        ##############
-    def test_943(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.driver.find_element_by_link_text("Packages").click()
-        #search for the "bash" package -> this should definitely be present
-        self.driver.find_element_by_id("search").clear()
-        self.driver.find_element_by_id("search").send_keys("bash")
-        self.driver.find_element_by_id("search-button").click()
-        #check for the search result message "XX packages found"
-        self.assertTrue(self.is_text_present("packages found"), msg=("no packages found text"))
-
-
-        ##############
-        #  CASE 944  #
-        ##############
-    def test_944(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        # step 1: test Recipes page stuff
-        self.driver.find_element_by_link_text("Recipes").click()
-        # for these 3 items, default status is not-checked
-        self.driver.find_element_by_id("edit-columns-button").click()
-        self.driver.find_element_by_id("layer_version__branch").click()
-        self.driver.find_element_by_id("layer_version__layer__commit").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # otable is the recipes table here
-        otable_head_text = self.get_table_head_text('otable')
-        for item in ["Layer", "Layer branch", "Layer commit"]:
-            self.failIf(item not in otable_head_text, msg=item+' not in table head.')
-        # click the fist recipe, whatever it is
-        self.get_table_element("otable", 1, 1).click()
-        self.assertTrue(self.is_text_present(["Layer", "Layer branch", "Layer commit", "Recipe file"]), \
-                        msg=("text not in web page"))
-
-        # step 2: test Packages page stuff. almost same as above
-        self.driver.back()
-        self.browser_delay()
-        self.driver.find_element_by_link_text("Packages").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        self.driver.find_element_by_id("recipe__layer_version__layer__name").click()
-        self.driver.find_element_by_id("recipe__layer_version__branch").click()
-        self.driver.find_element_by_id("recipe__layer_version__layer__commit").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        otable_head_text = self.get_table_head_text("otable")
-        for item in ["Layer", "Layer branch", "Layer commit"]:
-            self.assertFalse(item not in otable_head_text, msg=("item %s should be in head row" % item))
-        # click the fist recipe, whatever it is
-        self.get_table_element("otable", 1, 1).click()
-        self.assertTrue(self.is_text_present(["Layer", "Layer branch", "Layer commit"]), \
-                        msg=("text not in web page"))
-
-        # step 3: test Packages core-image-minimal(images) stuff. almost same as above. Note when future element-id changes...
-        self.driver.back()
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        self.driver.find_element_by_id("layer_name").click()
-        self.driver.find_element_by_id("layer_branch").click()
-        self.driver.find_element_by_id("layer_commit").click()
-        self.driver.find_element_by_id("edit-columns-button").click()
-        otable_head_text = self.get_table_head_text("otable")
-        for item in ["Layer", "Layer branch", "Layer commit"]:
-            self.assertFalse(item not in otable_head_text, msg=("item %s should be in head row" % item))
-        # click the fist recipe, whatever it is
-        self.get_table_element("otable", 1, 1).click()
-        self.assertTrue(self.is_text_present(["Layer", "Layer branch", "Layer commit"]), \
-                        msg=("text not in web page"))
-
-        # step 4: check Configuration page
-        self.driver.back()
-        self.driver.find_element_by_link_text("Configuration").click()
-        otable_head_text = self.get_table_head_text()
-        self.assertTrue(self.is_text_present(["Layer", "Layer branch", "Layer commit"]), \
-                        msg=("text not in web page"))
-
-
-        ##############
-        #  CASE 945  #
-        ##############
-    def test_945(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        for item in ["Packages", "Recipes", "Tasks"]:
-            self.driver.get(self.base_url)
-            self.driver.find_element_by_link_text("core-image-minimal").click()
-            self.driver.find_element_by_link_text(items).click()
-
-            # this may be page specific. If future page content changes, try to replace it with new xpath
-            xpath_showrows = "/html/body/div[4]/div/div/div[2]/div[2]/div[2]/div/div/div[2]/select"
-            xpath_table = "html/body/div[4]/div/div/div[2]/div[2]/table/tbody"#"id=('otable')/tbody"
-            self.driver.find_element_by_xpath(xpath_showrows).click()
-            rows_displayed = int(self.driver.find_element_by_xpath(xpath_showrows + "/option[2]").text)
-
-            # not sure if this is a Selenium Select bug: If page is not refreshed here, "select(by visible text)" operation will go back to 100-row page
-            # Sure we can use driver.get(url) to refresh page, but since page will vary, we use click link text here
-            self.driver.find_element_by_link_text(items).click()
-            Select(self.driver.find_element_by_css_selector("select.pagesize")).select_by_visible_text(str(rows_displayed))
-            self.failUnless(self.is_element_present(By.XPATH, xpath_table + "/tr[" + str(rows_displayed) +"]"))
-            self.failIf(self.is_element_present(By.XPATH, xpath_table + "/tr[" + str(rows_displayed+1) +"]"))
-
-            # click 1st package, then go back to check if it's still those rows shown.
-            self.driver.find_element_by_xpath(xpath_otable + "/tr[1]/td[1]/a").click()
-            time.sleep(3)
-            self.driver.find_element_by_link_text(item).click()
-            self.assertTrue(self.is_element_present(By.XPATH, xpath_otable + "/tr[" + str(option_tobeselected) +"]"),\
-                            msg=("Row %d should exist" %option_tobeselected))
-            self.assertFalse(self.is_element_present(By.XPATH, xpath_otable + "/tr[" + str(option_tobeselected+1) +"]"),\
-                            msg=("Row %d should not exist" %(option_tobeselected+1)))
-
-
-
-        ##############
-        #  CASE 946  #
-        ##############
-    def test_946(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.driver.find_element_by_link_text("Configuration").click()
-        # step 3-4
-        check_list = ["Summary", "BitBake variables"]
-        for item in check_list:
-            if not self.is_element_present(how=By.LINK_TEXT, what=item):
-                self.log.error("%s not found" %item)
-        if not self.is_text_present(['Layers', 'Layer', 'Layer branch', 'Layer commit']):
-            self.log.error("text not found")
-        # step 5
-        self.driver.find_element_by_link_text("BitBake variables").click()
-        if not self.is_text_present(['Variable', 'Value', 'Set in file', 'Description']):
-            self.log.error("text not found")
-        # This may be unstable because it's page-specific
-        # step 6: this is how we find filter beside "Set in file"
-        temp_element = self.find_element_by_text_in_table('otable', "Set in file")
-        temp_element.find_element_by_xpath("..//*/a/i[@class='icon-filter filtered']").click()
-        self.browser_delay()
-        self.driver.find_element_by_xpath("(//input[@name='filter'])[3]").click()
-        btns = self.driver.find_elements_by_css_selector("button.btn.btn-primary")
-        for btn in btns:
-            try:
-                btn.click()
-                break
-            except:
-                pass
-        # save screen here
-        self.browser_delay()
-        self.save_screenshot(screenshot_type='selenium', append_name='step6')
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # save screen here
-        # step 7
-        # we should manually check the step 6-8 result using screenshot
-        self.browser_delay()
-        self.save_screenshot(screenshot_type='selenium', append_name='step7')
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # step 9
-        # click the 1st item, no matter what it is
-        self.driver.find_element_by_xpath("//*[@id='otable']/tbody/tr[1]/td[1]/a").click()
-        # give it 1 sec so the pop-up becomes the "active_element"
-        time.sleep(1)
-        element = self.driver.switch_to.active_element
-        check_list = ['Order', 'Configuration file', 'Operation', 'Line number']
-        for item in check_list:
-            if item not in element.text:
-                self.log.error("%s not found" %item)
-        # any better way to close this pop-up? ... TBD
-        element.find_element_by_class_name("close").click()
-        # step 10 : need to manually check "Yocto Manual" in saved screen
-        self.driver.find_element_by_css_selector("i.icon-share.get-info").click()
-        # save screen here
-        time.sleep(5)
-        self.save_screenshot(screenshot_type='native', append_name='step10')
-
-
-        ##############
-        #  CASE 947  #
-        ##############
-    def test_947(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.find_element_by_link_text_in_table('nav', 'Configuration').click()
-        # step 2
-        self.driver.find_element_by_link_text("BitBake variables").click()
-        # step 3
-        def xpath_option(column_name):
-            # return xpath of options under "Edit columns" button
-            return self.shortest_xpath('id', 'navTab') + self.shortest_xpath('id', 'editcol') \
-                + self.shortest_xpath('id', column_name)
-        self.driver.find_element_by_id('edit-columns-button').click()
-        # by default, option "Description" and "Set in file" were checked
-        self.driver.find_element_by_xpath(xpath_option('description')).click()
-        self.driver.find_element_by_xpath(xpath_option('file')).click()
-        self.driver.find_element_by_id('edit-columns-button').click()
-        check_list = ['Description', 'Set in file']
-        head_list = self.get_table_head_text('otable')
-        for item in check_list:
-            self.assertFalse(item in head_list, msg=("item %s should not be in head row" % item))
-        # check these 2 options and verify again
-        self.driver.find_element_by_id('edit-columns-button').click()
-        self.driver.find_element_by_xpath(xpath_option('description')).click()
-        self.driver.find_element_by_xpath(xpath_option('file')).click()
-        self.driver.find_element_by_id('edit-columns-button').click()
-        head_list = self.get_table_head_text('otable')
-        for item in check_list:
-            self.assertTrue(item in head_list, msg=("item %s not in head row" % item))
-
-
-        ##############
-        #  CASE 948  #
-        ##############
-    def test_948(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.find_element_by_link_text_in_table('nav', 'Configuration').click()
-        self.driver.find_element_by_link_text("BitBake variables").click()
-        #get number of variables visible by default
-        number_before_search = self.driver.find_element_by_class_name('page-header').text
-        # search for a while...
-        self.driver.find_element_by_id("search").clear()
-        self.driver.find_element_by_id("search").send_keys("BB")
-        self.driver.find_element_by_id("search-button").click()
-        #get number of variables visible after search
-        number_after_search = self.driver.find_element_by_class_name('page-header').text
-        self.assertTrue(number_before_search > number_after_search, msg=("items should be less after search"))
-
-
-        ##############
-        #  CASE 949  #
-        ##############
-    def test_949(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        self.find_element_by_link_text_in_table('nav', 'core-image-minimal').click()
-        # step 3
-        try:
-            self.driver.find_element_by_partial_link_text("Packages included")
-            self.driver.find_element_by_partial_link_text("Directory structure")
-        except Exception as e:
-            self.log.error(e)
-            self.assertFalse(True)
-        # step 4
-        head_list = self.get_table_head_text('otable')
-        for item in ['Package', 'Package version', 'Size', 'Dependencies', 'Reverse dependencies', 'Recipe']:
-            self.assertTrue(item in head_list, msg=("item %s not in head row" % item))
-        # step 5-6
-        self.driver.find_element_by_id("edit-columns-button").click()
-        selectable_class = 'checkbox'
-        # minimum-table : means unselectable items
-        unselectable_class = 'checkbox muted'
-        selectable_check_list = ['Dependencies', 'Layer', 'Layer branch', 'Layer commit', \
-                                 'License', 'Recipe', 'Recipe version', 'Reverse dependencies', \
-                                 'Size', 'Size over total (%)']
-        unselectable_check_list = ['Package', 'Package version']
-        selectable_list = list()
-        unselectable_list = list()
-        selectable_elements = self.driver.find_elements_by_xpath("//*[@id='editcol']//*[@class='" + selectable_class + "']")
-        unselectable_elements = self.driver.find_elements_by_xpath("//*[@id='editcol']//*[@class='" + unselectable_class + "']")
-        for element in selectable_elements:
-            selectable_list.append(element.text)
-        for element in unselectable_elements:
-            unselectable_list.append(element.text)
-        # check them
-        for item in selectable_check_list:
-            self.assertTrue(item in selectable_list, msg=("%s not found in dropdown menu" % item))
-        for item in unselectable_check_list:
-            self.assertTrue(item in unselectable_list, msg=("%s not found in dropdown menu" % item))
-        self.driver.find_element_by_id("edit-columns-button").click()
-        # step 7
-        self.driver.find_element_by_partial_link_text("Directory structure").click()
-        head_list = self.get_table_head_text('dirtable')
-        for item in ['Directory / File', 'Symbolic link to', 'Source package', 'Size', 'Permissions', 'Owner', 'Group']:
-            self.assertTrue(item in head_list, msg=("%s not found in Directory structure table head" % item))
-
-        ##############
-        #  CASE 950  #
-        ##############
-    def test_950(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        # step3&4: so far we're not sure if there's "successful build" or "failed
-        # build".If either of them doesn't exist, we can still go on other steps
-        check_list = ['Configuration', 'Tasks', 'Recipes', 'Packages', 'Time', 'CPU usage', 'Disk I/O']
-        has_successful_build = 1
-        has_failed_build = 1
-        try:
-            pass_icon = self.driver.find_element_by_xpath("//*[@class='icon-ok-sign success']")
-        except Exception:
-            self.log.info("no successful build exists")
-            has_successful_build = 0
-            pass
-        if has_successful_build:
-            pass_icon.click()
-            # save screen here to check if it matches requirement.
-            self.browser_delay()
-            self.save_screenshot(screenshot_type='selenium', append_name='step3_1')
-            for item in check_list:
-                try:
-                    self.find_element_by_link_text_in_table('nav', item)
-                except Exception:
-                    self.assertFalse(True, msg=("link  %s cannot be found in the page" % item))
-            # step 6
-            check_list_2 = ['Packages included', 'Total package size', \
-                      'License manifest', 'Image files']
-            self.assertTrue(self.is_text_present(check_list_2), msg=("text not in web page"))
-            self.driver.back()
-        try:
-            fail_icon = self.driver.find_element_by_xpath("//*[@class='icon-minus-sign error']")
-        except Exception:
-            has_failed_build = 0
-            self.log.info("no failed build exists")
-            pass
-        if has_failed_build:
-            fail_icon.click()
-            # save screen here to check if it matches requirement.
-            self.browser_delay()
-            self.save_screenshot(screenshot_type='selenium', append_name='step3_2')
-            for item in check_list:
-                try:
-                    self.find_element_by_link_text_in_table('nav', item)
-                except Exception:
-                    self.assertFalse(True, msg=("link  %s cannot be found in the page" % item))
-            # step 7 involved
-            check_list_3 = ['Machine', 'Distro', 'Layers', 'Total number of tasks', 'Tasks executed', \
-                      'Tasks not executed', 'Reuse', 'Recipes built', 'Packages built']
-            self.assertTrue(self.is_text_present(check_list_3), msg=("text not in web page"))
-            self.driver.back()
-
-
-        ##############
-        #  CASE 951  #
-        ##############
-    def test_951(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        # currently test case itself isn't responsible for creating "1 successful and
-        # 1 failed build"
-        has_successful_build = 1
-        has_failed_build = 1
-        try:
-            fail_icon = self.driver.find_element_by_xpath("//*[@class='icon-minus-sign error']")
-        except Exception:
-            has_failed_build = 0
-            self.log.info("no failed build exists")
-            pass
-        # if there's failed build, we can proceed
-        if has_failed_build:
-            self.driver.find_element_by_partial_link_text("error").click()
-            self.driver.back()
-        # not sure if there "must be" some warnings, so here save a screen
-        self.browser_delay()
-        self.save_screenshot(screenshot_type='selenium', append_name='step4')
-
-
-        ##############
-        #  CASE 955  #
-        ##############
-    def test_955(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.log.info(" You should manually create all images before test starts!")
-        # So far the case itself is not responsable for creating all sorts of images.
-        # So assuming they are already there
-        # step 2
-        self.driver.find_element_by_link_text("core-image-minimal").click()
-        # save screen here to see the page component
-
-
-        ##############
-        #  CASE 956  #
-        ##############
-    def test_956(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        # step 2-3 need to run manually
-        self.log.info("step 2-3: checking the help message when you hover on help icon of target,\
-                       tasks, recipes, packages need to run manually")
-        self.driver.find_element_by_partial_link_text("Manual").click()
-        if not self.is_text_present("Manual"):
-            self.log.error("please check [Toaster manual] link on page")
-            self.failIf(True)
-
-####################################################################################################
-# Starting backend tests ###########################################################################
-####################################################################################################
-
-        ##############
-        #  CASE 1066 #
-        ##############
-    def test_1066(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select count(name) from orm_project a, auth_user b where a.user_id = b.id and b.username='_anonuser';"
-        cursor.execute(query)
-        data = cursor.fetchone()
-        self.failUnless(data >= 1)
-
-
-        ##############
-        #  CASE 1071 #
-        ##############
-    def test_1071(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select name from orm_release;"
-        cursor.execute(query)
-        data = cursor.fetchall()
-        for i in range(0,4):
-            data[i] = data[i][0]
-        data.sort()
-        print(data)
-        json_parse = json.loads(open('toasterconf.json').read())
-        json_data = []
-        for i in range (0,4):
-            json_data.append(json_parse['releases'][i]['name'])
-        json_data.sort()
-        print(json_data)
-        self.failUnless(data == json_data)
-
-        ##############
-        #  CASE 1072 #
-        ##############
-    def test_1072(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select value from orm_toastersetting where name like 'DEFCONF%';"
-        cursor.execute(query)
-        data = cursor.fetchall()
-        for i in range(0,6):
-            data[i] = data[i][0]
-        print(data)
-        json_parse = json.loads(open('toasterconf.json').read())
-        json_data=json_parse['config']
-        json_data = json_data.values()
-        print(json_data)
-        self.failUnless(data == json_data)
-
-
-        ##############
-        #  CASE 1074 #
-        ##############
-    def test_1074(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select name from orm_layersource;"
-        cursor.execute(query)
-        data = cursor.fetchall()
-        for i in range(0,3):
-            data[i] = data[i][0]
-        print(data)
-        json_parse = json.loads(open('toasterconf.json').read())
-        json_data = []
-        for i in range(0,3):
-            json_data.append(json_parse['layersources'][i]['name'])
-        print(json_data)
-        self.failUnless(set(data) == set(json_data))
-
-        ##############
-        #  CASE 1075 #
-        ##############
-    def test_1075(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select value from orm_toastersetting where name like 'DEFAULT_RELEASE';"
-        cursor.execute(query)
-        data = cursor.fetchall()
-        data = data[0][0]
-        print(data)
-        json_parse = json.loads(open('toasterconf.json').read())
-        json_data = json_parse['defaultrelease']
-        print(json_data)
-        self.failUnless(set(data) == set(json_data))
-
-        ##############
-        #  CASE 1076 #
-        ##############
-    def test_1076(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-
-        print('Checking branches for "Local Yocto Project"')
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select name from orm_branch where layer_source_id=1;"
-        cursor.execute(query)
-        data = cursor.fetchall()
-        lenght = len(data)
-        try:
-            for i in range(0,lenght):
-                data[i] = data[i][0]
-        except:
-            pass
-        print(data)
-        json_parse = json.loads(open('toasterconf.json').read())
-        json_location = json_parse['layersources'][0]['name']
-        print(json_location)
-        json_data = json_parse['layersources'][0]['branches']
-        print(json_data)
-        self.failUnless(set(data) == set(json_data))
-
-        print('Checking branches for "OpenEmbedded"')
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select name from orm_branch where layer_source_id=3;"
-        cursor.execute(query)
-        data = cursor.fetchall()
-        lenght = len(data)
-        for i in range(0,lenght):
-            data[i] = data[i][0]
-        print(data)
-        json_parse = json.loads(open('toasterconf.json').read())
-        json_location = json_parse['layersources'][1]['name']
-        print(json_location)
-        json_data = json_parse['layersources'][1]['branches']
-        print(json_data)
-        self.failUnless(set(data) == set(json_data))
-
-        print('Checking branches for "Imported layers"')
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select name from orm_branch where layer_source_id=2;"
-        cursor.execute(query)
-        data = cursor.fetchall()
-        lenght = len(data)
-        for i in range(0,lenght):
-            data[i] = data[i][0]
-        print(data)
-        json_parse = json.loads(open('toasterconf.json').read())
-        json_location = json_parse['layersources'][2]['name']
-        print(json_location)
-        json_data = json_parse['layersources'][2]['branches']
-        print(json_data)
-        self.failUnless(set(data) == set(json_data))
-
-
-        ##############
-        #  CASE 1077 #
-        ##############
-    def test_1077(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select name from orm_bitbakeversion;"
-        cursor.execute(query)
-        data = cursor.fetchall()
-        for i in range(0,4):
-            data[i] = data[i][0]
-        print(data)
-        json_parse = json.loads(open('toasterconf.json').read())
-        json_data = []
-        for i in range(0,4):
-            json_data.append(json_parse['bitbake'][i]['name'])
-        print(json_data)
-        self.failUnless(set(data) == set(json_data))
-
-        ##############
-        #  CASE 1083 #
-        ##############
-    def test_1083(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_id("new-project-button").click()
-        self.driver.find_element_by_id("new-project-name").send_keys("new-test-project")
-        self.driver.find_element_by_id("create-project-button").click()
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select count(name) from orm_project where name = 'new-test-project';"
-        cursor.execute(query)
-        data = cursor.fetchone()
-        print('data: %s' % data)
-        self.failUnless(data >= 1)
-
-        ##############
-        #  CASE 1084 #
-        ##############
-    def test_1084(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_id("new-project-button").click()
-        self.driver.find_element_by_id("new-project-name").send_keys("new-default-project")
-        self.driver.find_element_by_id("create-project-button").click()
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select a.name from orm_release a, orm_project b where a.id = b.release_id and b.name = 'new-default-project' limit 1;"
-        cursor.execute(query)
-        db_data = str(cursor.fetchone()[0])
-        json_parse = json.loads(open('toasterconf.json').read())
-        json_data = str(json_parse['defaultrelease'])
-        self.failUnless(db_data == json_data)
-
-        ##############
-        #  CASE 1088 #
-        ##############
-    def test_1088(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_css_selector("a[href='/toastergui/projects/']").click()
-        self.driver.find_element_by_link_text('new-default-project').click()
-        self.driver.find_element_by_id('project-change-form-toggle').click()
-        self.driver.find_element_by_id('project-name-change-input').clear()
-        self.driver.find_element_by_id('project-name-change-input').send_keys('new-name')
-        self.driver.find_element_by_id('project-name-change-btn').click()
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select count(name) from orm_project where name = 'new-name';"
-        cursor.execute(query)
-        data = cursor.fetchone()[0]
-        self.failUnless(data == 1)
-        #reseting project name
-        self.driver.find_element_by_id('project-change-form-toggle').click()
-        self.driver.find_element_by_id('project-name-change-input').clear()
-        self.driver.find_element_by_id('project-name-change-input').send_keys('new-default-project')
-        self.driver.find_element_by_id('project-name-change-btn').click()
-
-
-        ##############
-        #  CASE 1089 #
-        ##############
-    def test_1089(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_css_selector("a[href='/toastergui/projects/']").click()
-        self.driver.find_element_by_link_text('new-default-project').click()
-        self.driver.find_element_by_id('change-machine-toggle').click()
-        self.driver.find_element_by_id('machine-change-input').clear()
-        self.driver.find_element_by_id('machine-change-input').send_keys('qemuarm64')
-#        self.driver.find_element_by_id('machine-change-input').send_keys(Keys.RETURN)
-        self.driver.find_element_by_id('machine-change-btn').click()
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select count(id) from orm_projectvariable where name like 'machine' and value like 'qemuarm64';"
-        cursor.execute(query)
-        data = cursor.fetchone()[0]
-        self.failUnless(data == 1)
-        #resetting machine to default value
-        self.driver.find_element_by_id('change-machine-toggle').click()
-        self.driver.find_element_by_id('machine-change-input').clear()
-        self.driver.find_element_by_id('machine-change-input').send_keys('qemux86')
-        self.driver.find_element_by_id('machine-change-input').send_keys(Keys.RETURN)
-        self.driver.find_element_by_id('machine-change-btn').click()
-
-        ##############
-        #  CASE 1090 #
-        ##############
-    def test_1090(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select username from auth_user where is_superuser = 1;"
-        cursor.execute(query)
-        data = cursor.fetchall()
-        try:
-            data = data[0][0]
-        except:
-            pass
-        print(data)
-        self.failUnless(data == 'toaster_admin')
-
-        ##############
-        #  CASE 1091 #
-        ##############
-    def test_1091(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        self.driver.get(self.base_url)
-        self.driver.find_element_by_css_selector("a[href='/toastergui/projects/']").click()
-        self.driver.find_element_by_link_text('new-default-project').click()
-        self.driver.find_element_by_id('release-change-toggle').click()
-        dropdown = self.driver.find_element_by_css_selector('select')
-        for option in dropdown.find_elements_by_tag_name('option'):
-            if option.text == 'Local Yocto Project':
-                option.click()
-        self.driver.find_element_by_id('change-release-btn').click()
-        #wait for the changes to register in the DB
-        time.sleep(1)
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select count(*) from orm_layer_version a, orm_projectlayer b, orm_project c where a.\"commit\"=\"HEAD\" and a.id = b.layercommit_id and b.project_id=c.id and c.name='new-default-project';"
-        cursor.execute(query)
-        data = cursor.fetchone()[0]
-        #resetting release to default
-        self.driver.find_element_by_id('release-change-toggle').click()
-        dropdown = self.driver.find_element_by_css_selector('select')
-        for option in dropdown.find_elements_by_tag_name('option'):
-            if option.text == 'Yocto Project master':
-                option.click()
-        self.driver.find_element_by_id('change-release-btn').click()
-        #wait for the changes to register in the DB
-        time.sleep(1)
-        self.failUnless(data == 3)
-
-        ##############
-        #  CASE 1092 #
-        ##############
-    def test_1092(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-        self.driver.maximize_window()
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select a.name, a.value from orm_projectvariable a, orm_project b where a.project_id = b.id and b.name = 'new-default-project';"
-        cursor.execute(query)
-        data = dict(cursor.fetchall())
-        print(data)
-        default_values = {u'IMAGE_INSTALL_append': u'', u'PACKAGE_CLASSES': u'package_rpm', u'MACHINE': u'qemux86', u'SDKMACHINE': u'x86_64', u'DISTRO': u'poky', u'IMAGE_FSTYPES': u'ext3 jffs2 tar.bz2'}
-        self.failUnless(data == default_values)
-
-        ##############
-        #  CASE 1093 #
-        ##############
-    def test_1093(self):
-        self.case_no = self.get_case_number()
-        self.log.info(' CASE %s log: ' % str(self.case_no))
-
-        #get initial values
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select layercommit_id from orm_projectlayer a, orm_project b where a.project_id=b.id and b.name='new-default-project';"
-        cursor.execute(query)
-        data_initial = cursor.fetchall()
-        print(data_initial)
-
-        self.driver.maximize_window()
-        self.driver.get('localhost:8000')#self.base_url)
-        self.driver.find_element_by_css_selector("a[href='/toastergui/projects/']").click()
-        self.driver.find_element_by_link_text('new-default-project').click()
-        self.driver.find_element_by_id('release-change-toggle').click()
-        dropdown = self.driver.find_element_by_css_selector('select')
-        for option in dropdown.find_elements_by_tag_name('option'):
-            if option.text == 'Local Yocto Project':
-                option.click()
-        self.driver.find_element_by_id('change-release-btn').click()
-        #wait for the changes to register in the DB
-        time.sleep(1)
-
-        #get changed values
-        con=sqlite.connect('toaster.sqlite')
-        cursor = con.cursor()
-        query = "select layercommit_id from orm_projectlayer a, orm_project b where a.project_id=b.id and b.name='new-default-project';"
-        cursor.execute(query)
-        data_changed = cursor.fetchall()
-        print(data_changed)
-
-        #resetting release to default
-        self.driver.find_element_by_id('release-change-toggle').click()
-        dropdown = self.driver.find_element_by_css_selector('select')
-        for option in dropdown.find_elements_by_tag_name('option'):
-            if option.text == 'Yocto Project master':
-                option.click()
-        self.driver.find_element_by_id('change-release-btn').click()
-        #wait for the changes to register in the DB
-        time.sleep(1)
-        self.failUnless(data_initial != data_changed)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_test.cfg b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_test.cfg
deleted file mode 100644
index 685a9ee..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_test.cfg
+++ /dev/null
@@ -1,25 +0,0 @@
-# Configuration file for toaster_test
-# Sorted by different host type
-
-# test browser could be: firefox; chrome; ie(still under development)
-# logging_level could be: CRITICAL; ERROR; WARNING; INFO; DEBUG; NOTSET
-
-
-[toaster_test_linux]
-toaster_url = 'http://127.0.0.1:8000'
-test_browser = 'firefox'
-test_cases = [946]
-logging_level = 'INFO'
-
-
-[toaster_test_windows]
-toaster_url = 'http://127.0.0.1:8000'
-test_browser = ['ie', 'firefox', 'chrome']
-test_cases = [901, 902, 903]
-logging_level = 'DEBUG'
-
-[toaster_test_darwin]
-toaster_url = 'http://127.0.0.1:8000'
-test_browser = 'firefox'
-test_cases = [901, 902, 903, 904, 906, 910, 911, 912, 913, 914, 915, 916, 923, 924, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 955, 956]
-logging_level = 'INFO'
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urlcheck.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urlcheck.py
deleted file mode 100644
index 001fcee..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urlcheck.py
+++ /dev/null
@@ -1,53 +0,0 @@
-from __future__ import print_function
-import sys
-
-import httplib2
-import config
-import urllist
-
-
-config.logger.info("Testing %s with %s", config.TOASTER_BASEURL, config.W3C_VALIDATOR)
-
-def validate_html5(url):
-    http_client = httplib2.Http(None)
-    status = "Failed"
-    errors = -1
-    warnings = -1
-
-    urlrequest = config.W3C_VALIDATOR+url
-
-    # pylint: disable=broad-except
-    # we disable the broad-except because we want to actually catch all possible exceptions
-    try:
-        resp, _ = http_client.request(urlrequest, "HEAD")
-        if resp['x-w3c-validator-status'] != "Abort":
-            status = resp['x-w3c-validator-status']
-            errors = int(resp['x-w3c-validator-errors'])
-            warnings = int(resp['x-w3c-validator-warnings'])
-
-            if status == 'Invalid':
-                config.logger.warning("Failed %s is %s\terrors %s warnings %s (check at %s)", url, status, errors, warnings, urlrequest)
-            else:
-                config.logger.debug("OK! %s", url)
-
-    except Exception as exc:
-        config.logger.warning("Failed validation call: %s", exc)
-    return (status, errors, warnings)
-
-
-def print_validation(url):
-    status, errors, warnings = validate_html5(url)
-    config.logger.error("url %s is %s\terrors %s warnings %s (check at %s)", url, status, errors, warnings, config.W3C_VALIDATOR+url)
-
-
-def main():
-    print("Testing %s with %s" % (config.TOASTER_BASEURL, config.W3C_VALIDATOR))
-
-    if len(sys.argv) > 1:
-        print_validation(sys.argv[1])
-    else:
-        for url in urllist.URLS:
-            print_validation(config.TOASTER_BASEURL+url)
-
-if __name__ == "__main__":
-    main()
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urllist.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urllist.py
deleted file mode 100644
index 6db9ffc..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urllist.py
+++ /dev/null
@@ -1,39 +0,0 @@
-URLS = [
-    'toastergui/landing/',
-    'toastergui/builds/',
-    'toastergui/build/1',
-    'toastergui/build/1/tasks/',
-    'toastergui/build/1/tasks/1/',
-    'toastergui/build/1/task/1',
-    'toastergui/build/1/recipes/',
-    'toastergui/build/1/recipe/1/active_tab/1',
-    'toastergui/build/1/recipe/1',
-    'toastergui/build/1/recipe_packages/1',
-    'toastergui/build/1/packages/',
-    'toastergui/build/1/package/1',
-    'toastergui/build/1/package_built_dependencies/1',
-    'toastergui/build/1/package_included_detail/1/1',
-    'toastergui/build/1/package_included_dependencies/1/1',
-    'toastergui/build/1/package_included_reverse_dependencies/1/1',
-    'toastergui/build/1/target/1',
-    'toastergui/build/1/target/1/targetpkg',
-    'toastergui/build/1/target/1/dirinfo',
-    'toastergui/build/1/target/1/dirinfo_filepath/_/bin/bash',
-    'toastergui/build/1/configuration',
-    'toastergui/build/1/configvars',
-    'toastergui/build/1/buildtime',
-    'toastergui/build/1/cpuusage',
-    'toastergui/build/1/diskio',
-    'toastergui/build/1/target/1/packagefile/1',
-    'toastergui/newproject/',
-    'toastergui/projects/',
-    'toastergui/project/1',
-    'toastergui/project/1/configuration',
-    'toastergui/project/1/builds/',
-    'toastergui/project/1/layers/',
-    'toastergui/project/1/layer/1',
-    'toastergui/project/1/importlayer',
-    'toastergui/project/1/targets/',
-    'toastergui/project/1/machines/',
-    'toastergui/',
-]
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/oe-core.xml b/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/oe-core.xml
index a6c834f..66c3595 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/oe-core.xml
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/oe-core.xml
@@ -8,21 +8,28 @@
 
   <!-- Bitbake versions which correspond to the metadata release -->
   <object model="orm.bitbakeversion" pk="1">
-    <field type="CharField" name="name">morty</field>
+    <field type="CharField" name="name">pyro</field>
     <field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field>
-    <field type="CharField" name="branch">1.32</field>
+    <field type="CharField" name="branch">1.34</field>
   </object>
   <object model="orm.bitbakeversion" pk="2">
     <field type="CharField" name="name">HEAD</field>
+    <field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field>
+    <field type="CharField" name="branch">HEAD</field>
+  </object>
+  <object model="orm.bitbakeversion" pk="3">
+    <field type="CharField" name="name">master</field>
+    <field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field>
+    <field type="CharField" name="branch">master</field>
   </object>
 
   <!-- Releases available -->
   <object model="orm.release" pk="1">
-    <field type="CharField" name="name">morty</field>
-    <field type="CharField" name="description">Openembedded Morty</field>
+    <field type="CharField" name="name">pyro</field>
+    <field type="CharField" name="description">Openembedded Pyro</field>
     <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">1</field>
-    <field type="CharField" name="branch_name">morty</field>
-    <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href=\"http://cgit.openembedded.org/openembedded-core/log/?h=morty\"&gt;OpenEmbedded Morty&lt;/a&gt; branch.</field>
+    <field type="CharField" name="branch_name">pyro</field>
+    <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href=\"http://cgit.openembedded.org/openembedded-core/log/?h=pyro\"&gt;OpenEmbedded Pyro&lt;/a&gt; branch.</field>
   </object>
   <object model="orm.release" pk="2">
     <field type="CharField" name="name">local</field>
@@ -31,21 +38,36 @@
     <field type="CharField" name="branch_name">HEAD</field>
     <field type="TextField" name="helptext">Toaster will run your builds with the version of OpenEmbedded that you have cloned or downloaded to your computer.</field>
   </object>
+  <object model="orm.release" pk="3">
+    <field type="CharField" name="name">master</field>
+    <field type="CharField" name="description">OpenEmbedded core master</field>
+    <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">3</field>
+    <field type="CharField" name="branch_name">master</field>
+    <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href=\"http://cgit.openembedded.org/openembedded-core/log/\"&gt;OpenEmbedded master&lt;/a&gt; branch.</field>
+  </object>
 
   <!-- Default layers for each release -->
   <object model="orm.releasedefaultlayer" pk="1">
     <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
     <field type="CharField" name="layer_name">openembedded-core</field>
   </object>
-  <object model="orm.releasedefaultlayer" pk="4">
+  <object model="orm.releasedefaultlayer" pk="2">
     <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
     <field type="CharField" name="layer_name">openembedded-core</field>
   </object>
+  <object model="orm.releasedefaultlayer" pk="3">
+    <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+    <field type="CharField" name="layer_name">openembedded-core</field>
+  </object>
 
-  <!-- TYPE_LOCAL = 0 Layers for the Local release -->
+
+  <!-- Layer for the Local release -->
   <object model="orm.layer" pk="1">
     <field type="CharField" name="name">openembedded-core</field>
     <field type="CharField" name="vcs_url">git://git.openembedded.org/openembedded-core</field>
+    <field type="CharField" name="vcs_web_url">http://cgit.openembedded.org/openembedded-core</field>
+    <field type="CharField" name="vcs_web_tree_base_url">http://cgit.openembedded.org/openembedded-core/tree/%path%?h=%branch%</field>
+    <field type="CharField" name="vcs_web_file_base_url">http://cgit.openembedded.org/openembedded-core/tree/%path%?h=%branch%</field>
   </object>
   <object model="orm.layer_version" pk="1">
     <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/poky.xml b/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/poky.xml
index c192baa..7827aac 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/poky.xml
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/poky.xml
@@ -8,9 +8,9 @@
 
   <!-- Bitbake versions which correspond to the metadata release -->
   <object model="orm.bitbakeversion" pk="1">
-    <field type="CharField" name="name">morty</field>
+    <field type="CharField" name="name">pyro</field>
     <field type="CharField" name="giturl">git://git.yoctoproject.org/poky</field>
-    <field type="CharField" name="branch">morty</field>
+    <field type="CharField" name="branch">pyro</field>
     <field type="CharField" name="dirpath">bitbake</field>
   </object>
   <object model="orm.bitbakeversion" pk="2">
@@ -19,14 +19,21 @@
     <field type="CharField" name="branch">HEAD</field>
     <field type="CharField" name="dirpath">bitbake</field>
   </object>
+  <object model="orm.bitbakeversion" pk="3">
+    <field type="CharField" name="name">master</field>
+    <field type="CharField" name="giturl">git://git.yoctoproject.org/poky</field>
+    <field type="CharField" name="branch">master</field>
+    <field type="CharField" name="dirpath">bitbake</field>
+  </object>
+
 
   <!-- Releases available -->
   <object model="orm.release" pk="1">
-    <field type="CharField" name="name">morty</field>
-    <field type="CharField" name="description">Yocto Project 2.2 "Morty"</field>
+    <field type="CharField" name="name">pyro</field>
+    <field type="CharField" name="description">Yocto Project 2.3 "Pyro"</field>
     <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">1</field>
-    <field type="CharField" name="branch_name">morty</field>
-    <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=morty"&gt;Yocto Project Morty branch&lt;/a&gt;.</field>
+    <field type="CharField" name="branch_name">pyro</field>
+    <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=pyro"&gt;Yocto Project Pyro branch&lt;/a&gt;.</field>
   </object>
   <object model="orm.release" pk="2">
     <field type="CharField" name="name">local</field>
@@ -35,8 +42,15 @@
     <field type="CharField" name="branch_name">HEAD</field>
     <field type="TextField" name="helptext">Toaster will run your builds with the version of the Yocto Project you have cloned or downloaded to your computer.</field>
   </object>
+  <object model="orm.release" pk="3">
+    <field type="CharField" name="name">master</field>
+    <field type="CharField" name="description">Yocto Project master</field>
+    <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">3</field>
+    <field type="CharField" name="branch_name">master</field>
+    <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/"&gt;Yocto Project Master branch&lt;/a&gt;.</field>
+  </object>
 
-  <!-- Default layers for each release -->
+  <!-- Default project layers for each release -->
   <object model="orm.releasedefaultlayer" pk="1">
     <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
     <field type="CharField" name="layer_name">openembedded-core</field>
@@ -61,31 +75,71 @@
     <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
     <field type="CharField" name="layer_name">meta-yocto-bsp</field>
   </object>
+  <object model="orm.releasedefaultlayer" pk="7">
+    <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+    <field type="CharField" name="layer_name">openembedded-core</field>
+  </object>
+  <object model="orm.releasedefaultlayer" pk="8">
+    <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+    <field type="CharField" name="layer_name">meta-poky</field>
+  </object>
+  <object model="orm.releasedefaultlayer" pk="9">
+    <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+    <field type="CharField" name="layer_name">meta-yocto-bsp</field>
+  </object>
 
-  <!-- Layers for the Local release
-       layersource TYPE_LOCAL = 0
+  <!-- Default layers provided by poky
+       openembedded-core
+       meta-poky
+       meta-yocto-bsp
   -->
   <object model="orm.layer" pk="1">
     <field type="CharField" name="name">openembedded-core</field>
     <field type="CharField" name="layer_index_url"></field>
     <field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
+    <field type="CharField" name="vcs_web_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky</field>
+    <field type="CharField" name="vcs_web_tree_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
+    <field type="CharField" name="vcs_web_file_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
   </object>
   <object model="orm.layer_version" pk="1">
     <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
     <field type="IntegerField" name="layer_source">0</field>
+    <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
+    <field type="CharField" name="branch">pyro</field>
+    <field type="CharField" name="dirpath">meta</field>
+  </object>
+  <object model="orm.layer_version" pk="2">
+    <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
+    <field type="IntegerField" name="layer_source">0</field>
     <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
     <field type="CharField" name="branch">HEAD</field>
     <field type="CharField" name="commit">HEAD</field>
     <field type="CharField" name="dirpath">meta</field>
   </object>
-
+  <object model="orm.layer_version" pk="3">
+    <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
+    <field type="IntegerField" name="layer_source">0</field>
+    <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+    <field type="CharField" name="branch">master</field>
+    <field type="CharField" name="dirpath">meta</field>
+  </object>
 
   <object model="orm.layer" pk="2">
     <field type="CharField" name="name">meta-poky</field>
     <field type="CharField" name="layer_index_url"></field>
     <field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
+    <field type="CharField" name="vcs_web_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky</field>
+    <field type="CharField" name="vcs_web_tree_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
+    <field type="CharField" name="vcs_web_file_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
   </object>
-  <object model="orm.layer_version" pk="2">
+  <object model="orm.layer_version" pk="4">
+    <field rel="ManyToOneRel" to="orm.layer" name="layer">2</field>
+    <field type="IntegerField" name="layer_source">0</field>
+    <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
+    <field type="CharField" name="branch">pyro</field>
+    <field type="CharField" name="dirpath">meta-poky</field>
+  </object>
+  <object model="orm.layer_version" pk="5">
     <field rel="ManyToOneRel" to="orm.layer" name="layer">2</field>
     <field type="IntegerField" name="layer_source">0</field>
     <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
@@ -93,14 +147,30 @@
     <field type="CharField" name="commit">HEAD</field>
     <field type="CharField" name="dirpath">meta-poky</field>
   </object>
-
+  <object model="orm.layer_version" pk="6">
+    <field rel="ManyToOneRel" to="orm.layer" name="layer">2</field>
+    <field type="IntegerField" name="layer_source">0</field>
+    <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+    <field type="CharField" name="branch">master</field>
+    <field type="CharField" name="dirpath">meta-poky</field>
+  </object>
 
   <object model="orm.layer" pk="3">
     <field type="CharField" name="name">meta-yocto-bsp</field>
     <field type="CharField" name="layer_index_url"></field>
     <field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
+    <field type="CharField" name="vcs_web_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky</field>
+    <field type="CharField" name="vcs_web_tree_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
+    <field type="CharField" name="vcs_web_file_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
   </object>
-  <object model="orm.layer_version" pk="3">
+  <object model="orm.layer_version" pk="7">
+    <field rel="ManyToOneRel" to="orm.layer" name="layer">3</field>
+    <field type="IntegerField" name="layer_source">0</field>
+    <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
+    <field type="CharField" name="branch">pyro</field>
+    <field type="CharField" name="dirpath">meta-yocto-bsp</field>
+  </object>
+  <object model="orm.layer_version" pk="8">
     <field rel="ManyToOneRel" to="orm.layer" name="layer">3</field>
     <field type="IntegerField" name="layer_source">0</field>
     <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
@@ -108,4 +178,11 @@
     <field type="CharField" name="commit">HEAD</field>
     <field type="CharField" name="dirpath">meta-yocto-bsp</field>
   </object>
+  <object model="orm.layer_version" pk="9">
+    <field rel="ManyToOneRel" to="orm.layer" name="layer">3</field>
+    <field type="IntegerField" name="layer_source">0</field>
+    <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+    <field type="CharField" name="branch">master</field>
+    <field type="CharField" name="dirpath">meta-yocto-bsp</field>
+  </object>
 </django-objects>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/settings.xml b/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/settings.xml
index ee6a202..78c0fdc 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/settings.xml
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/fixtures/settings.xml
@@ -4,7 +4,7 @@
   <!-- pk=1 is DISTRO -->
   <object model="orm.toastersetting" pk="2">
     <field type="CharField" name="name">DEFAULT_RELEASE</field>
-    <field type="CharField" name="value">morty</field>
+    <field type="CharField" name="value">master</field>
   </object>
   <object model="orm.toastersetting" pk="3">
     <field type="CharField" name="name">DEFCONF_PACKAGE_CLASSES</field>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py
index 8ff120e..482908d 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py
@@ -90,7 +90,6 @@
             from urlparse import urlparse
 
         proxy_settings = os.environ.get("http_proxy", None)
-        oe_core_layer = 'openembedded-core'
 
         def _get_json_response(apiurl=DEFAULT_LAYERINDEX_SERVER):
             http_progress = Spinner()
@@ -154,41 +153,19 @@
 
         total = len(layers_info)
         for i, li in enumerate(layers_info):
-            # Special case for the openembedded-core layer
-            if li['name'] == oe_core_layer:
-                try:
-                    # If we have an existing openembedded-core for example
-                    # from the toasterconf.json augment the info using the
-                    # layerindex rather than duplicate it
-                    oe_core_l = Layer.objects.get(name=oe_core_layer)
-                    # Take ownership of the layer as now coming from the
-                    # layerindex
-                    oe_core_l.summary = li['summary']
-                    oe_core_l.description = li['description']
-                    oe_core_l.vcs_web_url = li['vcs_web_url']
-                    oe_core_l.vcs_web_tree_base_url = \
-                        li['vcs_web_tree_base_url']
-                    oe_core_l.vcs_web_file_base_url = \
-                        li['vcs_web_file_base_url']
-
-                    oe_core_l.save()
-                    li_layer_id_to_toaster_layer_id[li['id']] = oe_core_l.pk
-                    self.mini_progress("layers", i, total)
-                    continue
-
-                except Layer.DoesNotExist:
-                    pass
-
             try:
-                l, created = Layer.objects.get_or_create(name=li['name'],
-                                                         vcs_url=li['vcs_url'])
+                l, created = Layer.objects.get_or_create(name=li['name'])
                 l.up_date = li['updated']
-                l.vcs_url = li['vcs_url']
-                l.vcs_web_url = li['vcs_web_url']
-                l.vcs_web_tree_base_url = li['vcs_web_tree_base_url']
-                l.vcs_web_file_base_url = li['vcs_web_file_base_url']
                 l.summary = li['summary']
                 l.description = li['description']
+
+                if created:
+                    # predefined layers in the fixtures (for example poky.xml)
+                    # always preempt the Layer Index for these values
+                    l.vcs_url = li['vcs_url']
+                    l.vcs_web_url = li['vcs_web_url']
+                    l.vcs_web_tree_base_url = li['vcs_web_tree_base_url']
+                    l.vcs_web_file_base_url = li['vcs_web_file_base_url']
                 l.save()
             except Layer.MultipleObjectsReturned:
                 logger.info("Skipped %s as we found multiple layers and "
@@ -211,12 +188,14 @@
 
         total = len(layerbranches_info)
         for i, lbi in enumerate(layerbranches_info):
+            # release as defined by toaster map to layerindex branch
+            release = li_branch_id_to_toaster_release[lbi['branch']]
 
             try:
                 lv, created = Layer_Version.objects.get_or_create(
-                    layer_source=LayerSource.TYPE_LAYERINDEX,
                     layer=Layer.objects.get(
-                        pk=li_layer_id_to_toaster_layer_id[lbi['layer']])
+                        pk=li_layer_id_to_toaster_layer_id[lbi['layer']]),
+                    release=release
                 )
             except KeyError:
                 logger.warning(
@@ -224,11 +203,12 @@
                     lbi['layer'])
                 continue
 
-            lv.release = li_branch_id_to_toaster_release[lbi['branch']]
-            lv.up_date = lbi['updated']
-            lv.commit = lbi['actual_branch']
-            lv.dirpath = lbi['vcs_subdir']
-            lv.save()
+            if created:
+                lv.release = li_branch_id_to_toaster_release[lbi['branch']]
+                lv.up_date = lbi['updated']
+                lv.commit = lbi['actual_branch']
+                lv.dirpath = lbi['vcs_subdir']
+                lv.save()
 
             li_layer_branch_id_to_toaster_lv_id[lbi['id']] =\
                 lv.pk
@@ -255,9 +235,8 @@
                 layer_id = li_layer_id_to_toaster_layer_id[ldi['dependency']]
 
                 dependlist[lv].append(
-                    Layer_Version.objects.get(
-                        layer_source=LayerSource.TYPE_LAYERINDEX,
-                        layer__pk=layer_id))
+                    Layer_Version.objects.get(layer__pk=layer_id,
+                                              release=lv.release))
 
             except Layer_Version.DoesNotExist:
                 logger.warning("Cannot find layer version (ls:%s),"
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/orm/models.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/models.py
index a7de57c..a49f9a4 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/orm/models.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/models.py
@@ -38,6 +38,7 @@
 import itertools
 from signal import SIGUSR1
 
+
 import logging
 logger = logging.getLogger("toaster")
 
@@ -178,24 +179,27 @@
         else:
             return projects[0]
 
+
 class Project(models.Model):
-    search_allowed_fields = ['name', 'short_description', 'release__name', 'release__branch_name']
+    search_allowed_fields = ['name', 'short_description', 'release__name',
+                             'release__branch_name']
     name = models.CharField(max_length=100)
     short_description = models.CharField(max_length=50, blank=True)
     bitbake_version = models.ForeignKey('BitbakeVersion', null=True)
-    release     = models.ForeignKey("Release", null=True)
-    created     = models.DateTimeField(auto_now_add = True)
-    updated     = models.DateTimeField(auto_now = True)
+    release = models.ForeignKey("Release", null=True)
+    created = models.DateTimeField(auto_now_add=True)
+    updated = models.DateTimeField(auto_now=True)
     # This is a horrible hack; since Toaster has no "User" model available when
     # running in interactive mode, we can't reference the field here directly
-    # Instead, we keep a possible null reference to the User id, as not to force
+    # Instead, we keep a possible null reference to the User id,
+    # as not to force
     # hard links to possibly missing models
-    user_id     = models.IntegerField(null = True)
-    objects     = ProjectManager()
+    user_id = models.IntegerField(null=True)
+    objects = ProjectManager()
 
     # set to True for the project which is the default container
     # for builds initiated by the command line etc.
-    is_default  = models.BooleanField(default = False)
+    is_default= models.BooleanField(default=False)
 
     def __unicode__(self):
         return "%s (Release %s, BBV %s)" % (self.name, self.release, self.bitbake_version)
@@ -221,16 +225,16 @@
             return( -1 )
 
     def get_last_outcome(self):
-        build_id = self.get_last_build_id
+        build_id = self.get_last_build_id()
         if (-1 == build_id):
             return( "" )
         try:
-            return Build.objects.filter( id = self.get_last_build_id )[ 0 ].outcome
+            return Build.objects.filter( id = build_id )[ 0 ].outcome
         except (Build.DoesNotExist,IndexError):
             return( "not_found" )
 
     def get_last_target(self):
-        build_id = self.get_last_build_id
+        build_id = self.get_last_build_id()
         if (-1 == build_id):
             return( "" )
         try:
@@ -239,7 +243,7 @@
             return( "not_found" )
 
     def get_last_errors(self):
-        build_id = self.get_last_build_id
+        build_id = self.get_last_build_id()
         if (-1 == build_id):
             return( 0 )
         try:
@@ -248,7 +252,7 @@
             return( "not_found" )
 
     def get_last_warnings(self):
-        build_id = self.get_last_build_id
+        build_id = self.get_last_build_id()
         if (-1 == build_id):
             return( 0 )
         try:
@@ -265,7 +269,7 @@
         return last_build.get_image_file_extensions()
 
     def get_last_imgfiles(self):
-        build_id = self.get_last_build_id
+        build_id = self.get_last_build_id()
         if (-1 == build_id):
             return( "" )
         try:
@@ -333,20 +337,45 @@
 
         return queryset
 
-
     def schedule_build(self):
-        from bldcontrol.models import BuildRequest, BRTarget, BRLayer, BRVariable, BRBitbake
-        br = BuildRequest.objects.create(project = self)
-        try:
 
-            BRBitbake.objects.create(req = br,
-                giturl = self.bitbake_version.giturl,
-                commit = self.bitbake_version.branch,
-                dirpath = self.bitbake_version.dirpath)
+        from bldcontrol.models import BuildRequest, BRTarget, BRLayer
+        from bldcontrol.models import BRBitbake, BRVariable
+
+        try:
+            now = timezone.now()
+            build = Build.objects.create(project=self,
+                                         completed_on=now,
+                                         started_on=now)
+
+            br = BuildRequest.objects.create(project=self,
+                                             state=BuildRequest.REQ_QUEUED,
+                                             build=build)
+            BRBitbake.objects.create(req=br,
+                                     giturl=self.bitbake_version.giturl,
+                                     commit=self.bitbake_version.branch,
+                                     dirpath=self.bitbake_version.dirpath)
+
+            for t in self.projecttarget_set.all():
+                BRTarget.objects.create(req=br, target=t.target, task=t.task)
+                Target.objects.create(build=br.build, target=t.target,
+                                      task=t.task)
+                # If we're about to build a custom image recipe make sure
+                # that layer is currently in the project before we create the
+                # BRLayer objects
+                customrecipe = CustomImageRecipe.objects.filter(
+                    name=t.target,
+                    project=self).first()
+                if customrecipe:
+                    ProjectLayer.objects.get_or_create(
+                        project=self,
+                        layercommit=customrecipe.layer_version,
+                        optional=False)
 
             for l in self.projectlayer_set.all().order_by("pk"):
                 commit = l.layercommit.get_vcs_reference()
-                print("ii Building layer ", l.layercommit.layer.name, " at vcs point ", commit)
+                logger.debug("Adding layer to build %s" %
+                             l.layercommit.layer.name)
                 BRLayer.objects.create(
                     req=br,
                     name=l.layercommit.layer.name,
@@ -357,25 +386,16 @@
                     local_source_dir=l.layercommit.layer.local_source_dir
                 )
 
-            br.state = BuildRequest.REQ_QUEUED
-            now = timezone.now()
-            br.build = Build.objects.create(project = self,
-                                completed_on=now,
-                                started_on=now,
-                                )
-            for t in self.projecttarget_set.all():
-                BRTarget.objects.create(req = br, target = t.target, task = t.task)
-                Target.objects.create(build = br.build, target = t.target, task = t.task)
-
             for v in self.projectvariable_set.all():
-                BRVariable.objects.create(req = br, name = v.name, value = v.value)
-
+                BRVariable.objects.create(req=br, name=v.name, value=v.value)
 
             try:
-                br.build.machine = self.projectvariable_set.get(name = 'MACHINE').value
+                br.build.machine = self.projectvariable_set.get(
+                    name='MACHINE').value
                 br.build.save()
             except ProjectVariable.DoesNotExist:
                 pass
+
             br.save()
             signal_runbuilds()
 
@@ -882,7 +902,7 @@
         'ext4.gz', 'ext3', 'ext3.gz', 'hdddirect', 'hddimg', 'iso', 'jffs2',
         'jffs2.sum', 'multiubi', 'qcow2', 'squashfs', 'squashfs-lzo',
         'squashfs-xz', 'tar', 'tar.bz2', 'tar.gz', 'tar.lz4', 'tar.xz', 'ubi',
-        'ubifs', 'vdi', 'vmdk', 'wic', 'wic.bz2', 'wic.gz', 'wic.lzma'
+        'ubifs', 'vdi', 'vmdk', 'wic', 'wic.bmap', 'wic.bz2', 'wic.gz', 'wic.lzma'
     }
 
     target = models.ForeignKey(Target)
@@ -1365,7 +1385,7 @@
     name = models.CharField(max_length=100)
     layer_index_url = models.URLField()
     vcs_url = GitURLField(default=None, null=True)
-    local_source_dir = models.TextField(null = True, default = None)
+    local_source_dir = models.TextField(null=True, default=None)
     vcs_web_url = models.URLField(null=True, default=None)
     vcs_web_tree_base_url = models.URLField(null=True, default=None)
     vcs_web_file_base_url = models.URLField(null=True, default=None)
@@ -1473,22 +1493,33 @@
             return self.commit
         return 'N/A'
 
-    def get_detailspage_url(self, project_id):
+    def get_detailspage_url(self, project_id=None):
+        """ returns the url to the layer details page uses own project
+        field if project_id is not specified """
+
+        if project_id is None:
+            project_id = self.project.pk
+
         return reverse('layerdetails', args=(project_id, self.pk))
 
     def get_alldeps(self, project_id):
         """Get full list of unique layer dependencies."""
-        def gen_layerdeps(lver, project):
+        def gen_layerdeps(lver, project, depth):
+            if depth == 0:
+                return
             for ldep in lver.dependencies.all():
                 yield ldep.depends_on
                 # get next level of deps recursively calling gen_layerdeps
-                for subdep in gen_layerdeps(ldep.depends_on, project):
+                for subdep in gen_layerdeps(ldep.depends_on, project, depth-1):
                     yield subdep
 
         project = Project.objects.get(pk=project_id)
         result = []
-        projectlvers = [player.layercommit for player in project.projectlayer_set.all()]
-        for dep in gen_layerdeps(self, project):
+        projectlvers = [player.layercommit for player in
+                        project.projectlayer_set.all()]
+        # protect against infinite layer dependency loops
+        maxdepth = 20
+        for dep in gen_layerdeps(self, project, maxdepth):
             # filter out duplicates and layers already belonging to the project
             if dep not in result + projectlvers:
                 result.append(dep)
@@ -1631,7 +1662,8 @@
         if base_recipe_path:
             base_recipe = open(base_recipe_path, 'r').read()
         else:
-            raise IOError("Based on recipe file not found")
+            raise IOError("Based on recipe file not found: %s" %
+                          base_recipe_path)
 
         # Add a special case for when the recipe we have based a custom image
         # recipe on requires another recipe.
@@ -1741,8 +1773,12 @@
 
 def signal_runbuilds():
     """Send SIGUSR1 to runbuilds process"""
-    with open(os.path.join(os.getenv('BUILDDIR'), '.runbuilds.pid')) as pidf:
-        os.kill(int(pidf.read()), SIGUSR1)
+    try:
+        with open(os.path.join(os.getenv('BUILDDIR', '.'),
+                               '.runbuilds.pid')) as pidf:
+            os.kill(int(pidf.read()), SIGUSR1)
+    except FileNotFoundError:
+        logger.info("Stopping existing runbuilds: no current process found")
 
 django.db.models.signals.post_save.connect(invalidate_cache)
 django.db.models.signals.post_delete.connect(invalidate_cache)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/README b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/README
index 6b09d20..352c4fe 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/README
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/README
@@ -2,9 +2,9 @@
 
 These tests require Selenium to be installed in your Python environment.
 
-The simplest way to install this is via pip:
+The simplest way to install this is via pip3:
 
-  pip install selenium==2.53.2
+  pip3 install selenium==2.53.2
 
 Note that if you use other versions of Selenium, some of the tests (such as
 tests.browser.test_js_unit_tests.TestJsUnitTests) may fail, as these rely on
@@ -18,7 +18,7 @@
 * On Windows, put chromedriver.exe in the same directory as chrome.exe
 
 To run tests against PhantomJS (headless):
-
+--NOTE - Selenium seems to be deprecating support for this mode ---
 * Download and install PhantomJS:
   http://phantomjs.org/download.html
 * On *nix systems, put phantomjs on PATH
@@ -43,13 +43,30 @@
 The test cases will instantiate a Selenium driver set by the
 TOASTER_TESTS_BROWSER environment variable, or Chrome if this is not specified.
 
+To run tests against the Selenium Firefox Docker container:
+More explanation is located at https://wiki.yoctoproject.org/wiki/TipsAndTricks/TestingToasterWithContainers
+* Run the Selenium container:
+  ** docker run -it --rm=true -p 5900:5900 -p 4444:4444 --name=selenium selenium/standalone-firefox-debug:2.53.0
+  *** 5900 is the default vnc port. If you are runing a vnc server on your machine map a different port e.g. -p 6900:5900 and connect vnc client to 127.0.0.1:6900
+  *** 4444 is the default selenium sever port.
+* Run the tests
+  ** TOASTER_TESTS_BROWSER=http://127.0.0.1:4444/wd/hub TOASTER_TESTS_URL=http://172.17.0.1:8000 ./bitbake/lib/toaster/manage.py test --liveserver=172.17.0.1:8000 tests.browser
+  ** TOASTER_TESTS_BROWSER=remote TOASTER_REMOTE_HUB=http://127.0.0.1:4444/wd/hub ./bitbake/lib/toaster/manage.py test --liveserver=172.17.0.1:8000 tests.browser
+  *** TOASTER_REMOTE_HUB - This is the address for the Selenium Remote Web Driver hub. Assuming you ran the contianer with -p 4444:4444 it will be http://127.0.0.1:4444/wd/hub.
+  ***  --liveserver=xxx tells Django to run the test server on an interface and port reachable by both host and container.
+  **** 172.17.0.1 is the default docker bridge on linux, viewable from inside and outside the contianers. Find it with "ip -4 addr show dev docker0"
+* connect to the vnc server to see the tests if you would like
+   ** xtightvncviewer 127.0.0.1:5900
+   ** note, you need to wait for the test container to come up before this can connect.
+
 Available drivers:
 
 * chrome (default)
 * firefox
 * marionette (for newer Firefoxes)
 * ie
-* phantomjs
+* phantomjs (deprecated)
+* remote
 
 e.g. to run the test suite with phantomjs where you have phantomjs installed
 in /home/me/apps/phantomjs:
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
index 14e9c15..156d639 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
@@ -39,7 +39,7 @@
 from selenium.common.exceptions import NoSuchElementException, \
         StaleElementReferenceException, TimeoutException
 
-def create_selenium_driver(browser='chrome'):
+def create_selenium_driver(cls,browser='chrome'):
     # set default browser string based on env (if available)
     env_browser = os.environ.get('TOASTER_TESTS_BROWSER')
     if env_browser:
@@ -59,6 +59,15 @@
         return webdriver.Ie()
     elif browser == 'phantomjs':
         return webdriver.PhantomJS()
+    elif browser == 'remote':
+        # if we were to add yet another env variable like TOASTER_REMOTE_BROWSER
+        # we could let people pick firefox or chrome, left for later
+        remote_hub= os.environ.get('TOASTER_REMOTE_HUB')
+        driver = webdriver.Remote(remote_hub,
+                                  webdriver.DesiredCapabilities.FIREFOX.copy())
+
+        driver.get("http://%s:%s"%(cls.server_thread.host,cls.server_thread.port))
+        return driver
     else:
         msg = 'Selenium driver for browser %s is not available' % browser
         raise RuntimeError(msg)
@@ -135,7 +144,7 @@
 
         # instantiate the Selenium webdriver once for all the test methods
         # in this test case
-        cls.driver = create_selenium_driver()
+        cls.driver = create_selenium_driver(cls)
         cls.driver.maximize_window()
 
     @classmethod
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
index 6392d1e..f24fb09 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -91,9 +91,10 @@
         for btn in self.find_all("dd .glyphicon-edit"):
             btn.click()
 
-        # Wait for the inputs to become visible
+        # Wait for the inputs to become visible after animation
         self.wait_until_visible("#layer-git input[type=text]")
         self.wait_until_visible("dd textarea")
+        self.wait_until_visible("dd .change-btn")
 
         # Edit each value
         for inputs in self.find_all("#layer-git input[type=text]") + \
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/builds/buildtest.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/builds/buildtest.py
index fc7bd5b..5a56a11 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/tests/builds/buildtest.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/builds/buildtest.py
@@ -24,82 +24,115 @@
 import time
 import unittest
 
-from orm.models import Project, Release, ProjectTarget, Build
+from orm.models import Project, Release, ProjectTarget, Build, ProjectVariable
 from bldcontrol.models import BuildEnvironment
 
-from bldcontrol.management.commands.loadconf import Command\
-    as LoadConfigCommand
-
 from bldcontrol.management.commands.runbuilds import Command\
     as RunBuildsCommand
 
+from django.core.management import call_command
+
 import subprocess
+import logging
+
+logger = logging.getLogger("toaster")
 
 # We use unittest.TestCase instead of django.test.TestCase because we don't
 # want to wrap everything in a database transaction as an external process
 # (bitbake needs access to the database)
 
+def load_build_environment():
+    call_command('loaddata', 'settings.xml', app_label="orm")
+    call_command('loaddata', 'poky.xml', app_label="orm")
+
+    current_builddir = os.environ.get("BUILDDIR")
+    if current_builddir:
+        BuildTest.BUILDDIR = current_builddir
+    else:
+        # Setup a builddir based on default layout
+        # bitbake inside openebedded-core
+        oe_init_build_env_path = os.path.join(
+            os.path.dirname(os.path.abspath(__file__)),
+            os.pardir,
+            os.pardir,
+            os.pardir,
+            os.pardir,
+            os.pardir,
+            'oe-init-build-env'
+        )
+        if not os.path.exists(oe_init_build_env_path):
+            raise Exception("We had no BUILDDIR set and couldn't "
+                            "find oe-init-build-env to set this up "
+                            "ourselves please run oe-init-build-env "
+                            "before running these tests")
+
+        oe_init_build_env_path = os.path.realpath(oe_init_build_env_path)
+        cmd = "bash -c 'source oe-init-build-env %s'" % BuildTest.BUILDDIR
+        p = subprocess.Popen(
+            cmd,
+            cwd=os.path.dirname(oe_init_build_env_path),
+            shell=True,
+            stdout=subprocess.PIPE,
+            stderr=subprocess.PIPE)
+
+        output, err = p.communicate()
+        p.wait()
+
+        logger.info("oe-init-build-env %s %s" % (output, err))
+
+        os.environ['BUILDDIR'] = BuildTest.BUILDDIR
+
+    # Setup the path to bitbake we know where to find this
+    bitbake_path = os.path.join(
+        os.path.dirname(os.path.abspath(__file__)),
+        os.pardir,
+        os.pardir,
+        os.pardir,
+        os.pardir,
+        'bin',
+        'bitbake')
+    if not os.path.exists(bitbake_path):
+        raise Exception("Could not find bitbake at the expected path %s"
+                        % bitbake_path)
+
+    os.environ['BBBASEDIR'] = bitbake_path
 
 class BuildTest(unittest.TestCase):
 
     PROJECT_NAME = "Testbuild"
+    BUILDDIR = "/tmp/build/"
 
     def build(self, target):
         # So that the buildinfo helper uses the test database'
         self.assertEqual(
             os.environ.get('DJANGO_SETTINGS_MODULE', ''),
-            'toastermain.settings-test',
+            'toastermain.settings_test',
             "Please initialise django with the tests settings:  "
-            "DJANGO_SETTINGS_MODULE='toastermain.settings-test'")
+            "DJANGO_SETTINGS_MODULE='toastermain.settings_test'")
 
-        if self.target_already_built(target):
-            return
+        built = self.target_already_built(target)
+        if built:
+            return built
 
-        # Take a guess at the location of the toasterconf
-        poky_toaster_conf = '../../../meta-poky/conf/toasterconf.json'
-        oe_toaster_conf = '../../../meta/conf/toasterconf.json'
-        env_toaster_conf = os.environ.get('TOASTER_CONF')
-
-        config_file = None
-        if env_toaster_conf:
-            config_file = env_toaster_conf
-        else:
-            if os.path.exists(poky_toaster_conf):
-                config_file = poky_toaster_conf
-            elif os.path.exists(oe_toaster_conf):
-                config_file = oe_toaster_conf
-
-        self.assertIsNotNone(config_file,
-                             "Default locations for toasterconf not found"
-                             "please set $TOASTER_CONF manually")
-
-        # Setup the release information and default layers
-        print("\nImporting file: %s" % config_file)
-        os.environ['TOASTER_CONF'] = config_file
-        LoadConfigCommand()._import_layer_config(config_file)
-
-        os.environ['TOASTER_DIR'] = \
-            os.path.abspath(os.environ['BUILDDIR'] + "/../")
-
-        os.environ['BBBASEDIR'] = \
-            subprocess.check_output('which bitbake', shell=True)
+        load_build_environment()
 
         BuildEnvironment.objects.get_or_create(
             betype=BuildEnvironment.TYPE_LOCAL,
-            sourcedir=os.environ['TOASTER_DIR'],
-            builddir=os.environ['BUILDDIR']
+            sourcedir=BuildTest.BUILDDIR,
+            builddir=BuildTest.BUILDDIR
         )
 
         release = Release.objects.get(name='local')
 
         # Create a project for this build to run in
-        try:
-            project = Project.objects.get(name=BuildTest.PROJECT_NAME)
-        except Project.DoesNotExist:
-            project = Project.objects.create_project(
-                name=BuildTest.PROJECT_NAME,
-                release=release
-            )
+        project = Project.objects.create_project(name=BuildTest.PROJECT_NAME,
+                                                 release=release)
+
+        if os.environ.get("TOASTER_TEST_USE_SSTATE_MIRROR"):
+            ProjectVariable.objects.get_or_create(
+                name="SSTATE_MIRRORS",
+                value="file://.* http://autobuilder.yoctoproject.org/pub/sstate/PATH;downloadfilename=PATH",
+                project=project)
 
         ProjectTarget.objects.create(project=project,
                                      target=target,
@@ -118,9 +151,11 @@
             sys.stdout.flush()
             time.sleep(1)
 
-        self.assertNotEqual(build_request.build.outcome,
-                            Build.SUCCEEDED, "Build did not SUCCEEDED")
-        print("\nBuild finished")
+        self.assertEqual(Build.objects.get(pk=build_pk).outcome,
+                         Build.SUCCEEDED,
+                         "Build did not SUCCEEDED")
+
+        logger.info("\nBuild finished %s" % build_request.build.outcome)
         return build_request.build
 
     def target_already_built(self, target):
@@ -129,6 +164,6 @@
                 project__name=BuildTest.PROJECT_NAME):
             targets = build.target_set.values_list('target', flat=True)
             if target in targets:
-                return True
+                return build
 
-        return False
+        return None
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/builds/test_core_image_min.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/builds/test_core_image_min.py
index dec0bfa..586f4a8 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/tests/builds/test_core_image_min.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/builds/test_core_image_min.py
@@ -31,14 +31,14 @@
 from orm.models import Task_Dependency, Package, Target, Recipe
 from orm.models import CustomImagePackage
 
-from buildtest import BuildTest
+from tests.builds.buildtest import BuildTest
 
 
 class BuildCoreImageMinimal(BuildTest):
     """Build core-image-minimal and test the results"""
 
     def setUp(self):
-        self.build("core-image-minimal")
+        self.completed_build = self.build("core-image-minimal")
 
     # Check if build name is unique - tc_id=795
     def test_Build_Unique_Name(self):
@@ -59,38 +59,29 @@
 
     # Check if task order is unique for one build - tc=824
     def test_Task_Unique_Order(self):
-        builds = Build.objects.values('id')
-        cnt_err = []
+        total_task_order = Task.objects.filter(
+            build=self.built).values('order').count()
+        distinct_task_order = Task.objects.filter(
+            build=self.completed_build).values('order').distinct().count()
 
-        for build in builds:
-            total_task_order = Task.objects.filter(
-                build=build['id']).values('order').count()
-            distinct_task_order = Task.objects.filter(
-                build=build['id']).values('order').distinct().count()
-
-            if (total_task_order != distinct_task_order):
-                cnt_err.append(build['id'])
-
-        self.assertEqual(len(cnt_err),
-                         0,
-                         msg='Errors for build id: %s' % cnt_err)
+        self.assertEqual(total_task_order,
+                         distinct_task_order,
+                         msg='Errors task order is not unique')
 
     # Check task order sequence for one build - tc=825
     def test_Task_Order_Sequence(self):
-        builds = builds = Build.objects.values('id')
         cnt_err = []
-        for build in builds:
-            tasks = Task.objects.filter(
-                Q(build=build['id']),
-                ~Q(order=None),
-                ~Q(task_name__contains='_setscene')
-            ).values('id', 'order').order_by("order")
+        tasks = Task.objects.filter(
+            Q(build=self.completed_build),
+            ~Q(order=None),
+            ~Q(task_name__contains='_setscene')
+        ).values('id', 'order').order_by("order")
 
-            cnt_tasks = 0
-            for task in tasks:
-                cnt_tasks += 1
-                if (task['order'] != cnt_tasks):
-                    cnt_err.append(task['id'])
+        cnt_tasks = 0
+        for task in tasks:
+            cnt_tasks += 1
+            if (task['order'] != cnt_tasks):
+                cnt_err.append(task['id'])
         self.assertEqual(
             len(cnt_err), 0, msg='Errors for task id: %s' % cnt_err)
 
@@ -126,8 +117,7 @@
                     task['sstate_result'] != Task.SSTATE_MISS):
                 cnt_err.append({'id': task['id'],
                                 'name': task['task_name'],
-                                'sstate_result': task['sstate_result'],
-                               })
+                                'sstate_result': task['sstate_result']})
 
         self.assertEqual(len(cnt_err),
                          0,
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/__init__.py
similarity index 100%
copy from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
copy to import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/test_loaddata.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/test_loaddata.py
new file mode 100644
index 0000000..951f6ff
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/test_loaddata.py
@@ -0,0 +1,61 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.test import TestCase
+from django.core import management
+
+from orm.models import Layer_Version, Layer, Release, ToasterSetting
+
+
+class TestLoadDataFixtures(TestCase):
+    """ Test loading our 3 provided fixtures """
+    def test_run_loaddata_poky_command(self):
+        management.call_command('loaddata', 'poky')
+
+        num_releases = Release.objects.count()
+
+        self.assertTrue(
+            Layer_Version.objects.filter(
+                layer__name="meta-poky").count() == num_releases,
+            "Loaded poky fixture but don't have a meta-poky for all releases"
+            " defined")
+
+    def test_run_loaddata_oecore_command(self):
+        management.call_command('loaddata', 'oe-core')
+
+        # We only have the one layer for oe-core setup
+        self.assertTrue(
+            Layer.objects.filter(name="openembedded-core").count() > 0,
+            "Loaded oe-core fixture but still have no openemebedded-core"
+            " layer")
+
+    def test_run_loaddata_settings_command(self):
+        management.call_command('loaddata', 'settings')
+
+        self.assertTrue(
+            ToasterSetting.objects.filter(name="DEFAULT_RELEASE").count() > 0,
+            "Loaded settings but have no DEFAULT_RELEASE")
+
+        self.assertTrue(
+            ToasterSetting.objects.filter(
+                name__startswith="DEFCONF").count() > 0,
+            "Loaded settings but have no DEFCONF (default project "
+            "configuration values)")
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/test_lsupdates.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/test_lsupdates.py
new file mode 100644
index 0000000..49897a4
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/test_lsupdates.py
@@ -0,0 +1,45 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.test import TestCase
+from django.core import management
+
+from orm.models import Layer_Version, Machine, Recipe
+
+
+class TestLayerIndexUpdater(TestCase):
+    def test_run_lsupdates_command(self):
+        # Load some release information for us to fetch from the layer index
+        management.call_command('loaddata', 'poky')
+
+        old_layers_count = Layer_Version.objects.count()
+        old_recipes_count = Recipe.objects.count()
+        old_machines_count = Machine.objects.count()
+
+        # Now fetch the metadata from the layer index
+        management.call_command('lsupdates')
+
+        self.assertTrue(Layer_Version.objects.count() > old_layers_count,
+                        "lsupdates ran but we still have no more layers!")
+        self.assertTrue(Recipe.objects.count() > old_recipes_count,
+                        "lsupdates ran but we still have no more Recipes!")
+        self.assertTrue(Machine.objects.count() > old_machines_count,
+                        "lsupdates ran but we still have no more Machines!")
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/test_runbuilds.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/test_runbuilds.py
new file mode 100644
index 0000000..3e63483
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/commands/test_runbuilds.py
@@ -0,0 +1,88 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+
+from django.test import TestCase
+from django.core import management
+
+from orm.models import signal_runbuilds
+
+import threading
+import time
+import subprocess
+import signal
+
+
+class KillRunbuilds(threading.Thread):
+    """ Kill the runbuilds process after an amount of time """
+    def __init__(self, *args, **kwargs):
+        super(KillRunbuilds, self).__init__(*args, **kwargs)
+        self.setDaemon(True)
+
+    def run(self):
+        time.sleep(5)
+        signal_runbuilds()
+        time.sleep(1)
+
+        pidfile_path = os.path.join(os.environ.get("BUILDDIR", "."),
+                                    ".runbuilds.pid")
+
+        with open(pidfile_path) as pidfile:
+            pid = pidfile.read()
+            os.kill(int(pid), signal.SIGTERM)
+
+
+class TestCommands(TestCase):
+    """ Sanity test that runbuilds executes OK """
+
+    def setUp(self):
+        os.environ.setdefault("DJANGO_SETTINGS_MODULE",
+                              "toastermain.settings_test")
+        os.environ.setdefault("BUILDDIR",
+                              "/tmp/")
+
+        # Setup a real database if needed for runbuilds process
+        # to connect to
+        management.call_command('migrate')
+
+    def test_runbuilds_command(self):
+        kill_runbuilds = KillRunbuilds()
+        kill_runbuilds.start()
+
+        manage_py = os.path.join(
+            os.path.dirname(os.path.abspath(__file__)),
+            os.pardir,
+            os.pardir,
+            "manage.py")
+
+        command = "%s runbuilds" % manage_py
+
+        process = subprocess.Popen(command,
+                                   shell=True,
+                                   stdout=subprocess.PIPE,
+                                   stderr=subprocess.PIPE)
+
+        (out, err) = process.communicate()
+        process.wait()
+
+        self.assertNotEqual(process.returncode, 1,
+                            "Runbuilds returned an error %s" % err)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/eventreplay/README b/import-layers/yocto-poky/bitbake/lib/toaster/tests/eventreplay/README
new file mode 100644
index 0000000..8c5bb64
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/eventreplay/README
@@ -0,0 +1,22 @@
+# Running eventreplay tests
+
+These tests use event log files produced by bitbake <target> -w <event log file>
+You need to have event log files produced before running this tests.
+
+At the moment of writing this document tests use 2 event log files: zlib.events
+and core-image-minimal.events. They're not provided with the tests due to their
+significant size.
+
+Here is how to produce them:
+
+$ . oe-init-build-env
+$ rm -r tmp sstate-cache
+$ bitbake core-image-minimal -w core-image-minimal.events
+$ rm -rf tmp sstate-cache
+$ bitbake zlib -w zlib.events
+
+After that it should be possible to run eventreplay tests this way:
+
+$ EVENTREPLAY_DIR=./ DJANGO_SETTINGS_MODULE=toastermain.settings_test ../bitbake/lib/toaster/manage.py test -v2 tests.eventreplay
+
+Note that environment variable EVENTREPLAY_DIR should point to the directory with event log files.
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/eventreplay/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/eventreplay/__init__.py
new file mode 100644
index 0000000..6956619
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/eventreplay/__init__.py
@@ -0,0 +1,97 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Tests were part of openembedded-core oe selftest Authored by: Lucian Musat
+# Ionut Chisanovici, Paul Eggleton and Cristian Iorga
+
+"""
+Test toaster backend by playing build event log files
+using toaster-eventreplay script
+"""
+
+import os
+
+from subprocess import getstatusoutput
+from pathlib import Path
+
+from django.test import TestCase
+
+from orm.models import Target_Installed_Package, Package, Build
+
+class EventReplay(TestCase):
+    """Base class for eventreplay test cases"""
+
+    def setUp(self):
+        """
+        Setup build environment:
+            - set self.script to toaster-eventreplay path
+            - set self.eventplay_dir to the value of EVENTPLAY_DIR env variable
+        """
+        bitbake_dir = Path(__file__.split('lib/toaster')[0])
+        self.script = bitbake_dir /  'bin' / 'toaster-eventreplay'
+        self.assertTrue(self.script.exists(), "%s doesn't exist")
+        self.eventplay_dir = os.getenv("EVENTREPLAY_DIR")
+        self.assertTrue(self.eventplay_dir,
+                        "Environment variable EVENTREPLAY_DIR is not set")
+
+    def _replay(self, eventfile):
+        """Run toaster-eventplay <eventfile>"""
+        eventpath = Path(self.eventplay_dir) / eventfile
+        status, output = getstatusoutput('%s %s' % (self.script, eventpath))
+        if status:
+            print(output)
+
+        self.assertEqual(status, 0)
+
+class CoreImageMinimalEventReplay(EventReplay):
+    """Replay core-image-minimal events"""
+
+    def test_installed_packages(self):
+        """Test if all required packages have been installed"""
+
+        self._replay('core-image-minimal.events')
+
+        # test installed packages
+        packages = sorted(Target_Installed_Package.objects.\
+                          values_list('package__name', flat=True))
+        self.assertEqual(packages, ['base-files', 'base-passwd', 'busybox',
+                                    'busybox-hwclock', 'busybox-syslog',
+                                    'busybox-udhcpc', 'eudev', 'glibc',
+                                    'init-ifupdown', 'initscripts',
+                                    'initscripts-functions', 'kernel-base',
+                                    'kernel-module-uvesafb', 'libkmod',
+                                    'modutils-initscripts', 'netbase',
+                                    'packagegroup-core-boot', 'run-postinsts',
+                                    'sysvinit', 'sysvinit-inittab',
+                                    'sysvinit-pidof', 'udev-cache',
+                                    'update-alternatives-opkg',
+                                    'update-rc.d', 'util-linux-libblkid',
+                                    'util-linux-libuuid', 'v86d', 'zlib'])
+
+class ZlibEventReplay(EventReplay):
+    """Replay zlib events"""
+
+    def test_replay_zlib(self):
+        """Test if zlib build and package are in the database"""
+        self._replay("zlib.events")
+
+        self.assertEqual(Build.objects.last().target_set.last().target, "zlib")
+        self.assertTrue('zlib' in Package.objects.values_list('name', flat=True))
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/functional/__init__.py
similarity index 100%
copy from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
copy to import-layers/yocto-poky/bitbake/lib/toaster/tests/functional/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/functional/functional_helpers.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/functional/functional_helpers.py
new file mode 100644
index 0000000..486078a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/functional/functional_helpers.py
@@ -0,0 +1,122 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster functional tests implementation
+#
+# Copyright (C) 2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import logging
+import subprocess
+import signal
+import time
+import re
+
+from tests.browser.selenium_helpers_base import SeleniumTestCaseBase
+from tests.builds.buildtest import load_build_environment
+
+logger = logging.getLogger("toaster")
+
+class SeleniumFunctionalTestCase(SeleniumTestCaseBase):
+    wait_toaster_time = 5
+
+    @classmethod
+    def setUpClass(cls):
+        # So that the buildinfo helper uses the test database'
+        if os.environ.get('DJANGO_SETTINGS_MODULE', '') != \
+            'toastermain.settings_test':
+            raise RuntimeError("Please initialise django with the tests settings:  " \
+                "DJANGO_SETTINGS_MODULE='toastermain.settings_test'")
+
+        load_build_environment()
+
+        # start toaster
+        cmd = "bash -c 'source toaster start'"
+        p = subprocess.Popen(
+            cmd,
+            cwd=os.environ.get("BUILDDIR"),
+            shell=True)
+        if p.wait() != 0:
+            raise RuntimeError("Can't initialize toaster")
+
+        super(SeleniumFunctionalTestCase, cls).setUpClass()
+        cls.live_server_url = 'http://localhost:8000/'
+
+    @classmethod
+    def tearDownClass(cls):
+        super(SeleniumFunctionalTestCase, cls).tearDownClass()
+
+        # XXX: source toaster stop gets blocked, to review why?
+        # from now send SIGTERM by hand
+        time.sleep(cls.wait_toaster_time)
+        builddir = os.environ.get("BUILDDIR")
+
+        with open(os.path.join(builddir, '.toastermain.pid'), 'r') as f:
+            toastermain_pid = int(f.read())
+            os.kill(toastermain_pid, signal.SIGTERM)
+        with open(os.path.join(builddir, '.runbuilds.pid'), 'r') as f:
+            runbuilds_pid = int(f.read())
+            os.kill(runbuilds_pid, signal.SIGTERM)
+
+
+    def get_URL(self):
+         rc=self.get_page_source()
+         project_url=re.search("(projectPageUrl\s:\s\")(.*)(\",)",rc)
+         return project_url.group(2)
+
+
+    def find_element_by_link_text_in_table(self, table_id, link_text):
+        """
+        Assume there're multiple suitable "find_element_by_link_text".
+        In this circumstance we need to specify "table".
+        """
+        try:
+            table_element = self.get_table_element(table_id)
+            element = table_element.find_element_by_link_text(link_text)
+        except NoSuchElementException as e:
+            print('no element found')
+            raise
+        return element
+
+    def get_table_element(self, table_id, *coordinate):
+        if len(coordinate) == 0:
+#return whole-table element
+            element_xpath = "//*[@id='" + table_id + "']"
+            try:
+                element = self.driver.find_element_by_xpath(element_xpath)
+            except NoSuchElementException as e:
+                raise
+            return element
+        row = coordinate[0]
+
+        if len(coordinate) == 1:
+#return whole-row element
+            element_xpath = "//*[@id='" + table_id + "']/tbody/tr[" + str(row) + "]"
+            try:
+                element = self.driver.find_element_by_xpath(element_xpath)
+            except NoSuchElementException as e:
+                return False
+            return element
+#now we are looking for an element with specified X and Y
+        column = coordinate[1]
+
+        element_xpath = "//*[@id='" + table_id + "']/tbody/tr[" + str(row) + "]/td[" + str(column) + "]"
+        try:
+            element = self.driver.find_element_by_xpath(element_xpath)
+        except NoSuchElementException as e:
+            return False
+        return element
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/functional/test_functional_basic.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/functional/test_functional_basic.py
new file mode 100644
index 0000000..cfa2b0f
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/functional/test_functional_basic.py
@@ -0,0 +1,243 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster functional tests implementation
+#
+# Copyright (C) 2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import time
+import re
+from tests.functional.functional_helpers import SeleniumFunctionalTestCase
+from orm.models import Project
+
+class FuntionalTestBasic(SeleniumFunctionalTestCase):
+
+#   testcase (1514)
+    def test_create_slenium_project(self):
+        project_name = 'selenium-project'
+        self.get('')
+        self.driver.find_element_by_link_text("To start building, create your first Toaster project").click()
+        self.driver.find_element_by_id("new-project-name").send_keys(project_name)
+        self.driver.find_element_by_id('projectversion').click()
+        self.driver.find_element_by_id("create-project-button").click()
+        element = self.wait_until_visible('#project-created-notification')
+        self.assertTrue(self.element_exists('#project-created-notification'),'Project creation notification not shown')
+        self.assertTrue(project_name in element.text,
+                        "New project name not in new project notification")
+        self.assertTrue(Project.objects.filter(name=project_name).count(),
+                        "New project not found in database")
+
+ #  testcase (1515)
+    def test_verify_left_bar_menu(self):
+        self.get('')
+        self.wait_until_visible('#projectstable')
+        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+        self.assertTrue(self.element_exists('#config-nav'),'Configuration Tab does not exist')
+        project_URL=self.get_URL()
+        self.driver.find_element_by_xpath('//a[@href="'+project_URL+'"]').click()
+
+        try:
+            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'customimages/"'+"]").click()
+            self.assertTrue(re.search("Custom images",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'Custom images information is not loading properly')
+        except:
+            self.fail(msg='No Custom images tab available')
+
+        try:
+            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'images/"'+"]").click()
+            self.assertTrue(re.search("Compatible image recipes",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Compatible image recipes information is not loading properly')
+        except:
+            self.fail(msg='No Compatible image tab available')
+
+        try:
+            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'softwarerecipes/"'+"]").click()
+            self.assertTrue(re.search("Compatible software recipes",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Compatible software recipe information is not loading properly')
+        except:
+            self.fail(msg='No Compatible software recipe tab available')
+
+        try:
+            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'machines/"'+"]").click()
+            self.assertTrue(re.search("Compatible machines",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Compatible machine information is not loading properly')
+        except:
+            self.fail(msg='No Compatible machines tab available')
+
+        try:
+            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'layers/"'+"]").click()
+            self.assertTrue(re.search("Compatible layers",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Compatible layer information is not loading properly')
+        except:
+            self.fail(msg='No Compatible layers tab available')
+
+        try:
+            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'configuration"'+"]").click()
+            self.assertTrue(re.search("Bitbake variables",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Bitbake variables information is not loading properly')
+        except:
+            self.fail(msg='No Bitbake variables tab available')
+
+#   testcase (1516)
+    def test_review_configuration_information(self):
+        self.get('')
+        self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+        self.wait_until_visible('#projectstable')
+        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+        project_URL=self.get_URL()
+
+        try:
+           self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist')
+           self.assertTrue(re.search("qemux86",self.driver.find_element_by_xpath("//span[@id='project-machine-name']").text),'The machine type is not assigned')
+           self.driver.find_element_by_xpath("//span[@id='change-machine-toggle']").click()
+           self.wait_until_visible('#select-machine-form')
+           self.wait_until_visible('#cancel-machine-change')
+           self.driver.find_element_by_xpath("//form[@id='select-machine-form']/a[@id='cancel-machine-change']").click()
+        except:
+           self.fail(msg='The machine information is wrong in the configuration page')
+
+        try:
+           self.driver.find_element_by_id('no-most-built')
+        except:
+           self.fail(msg='No Most built information in project detail page')
+
+        try:
+           self.assertTrue(re.search("Yocto Project master",self.driver.find_element_by_xpath("//span[@id='project-release-title']").text),'The project release is not defined')
+        except:
+           self.fail(msg='No project release title information in project detail page')
+
+        try:
+           self.driver.find_element_by_xpath("//div[@id='layer-container']")
+           self.assertTrue(re.search("3",self.driver.find_element_by_id("project-layers-count").text),'There should be 3 layers listed in the layer count')
+           layer_list = self.driver.find_element_by_id("layers-in-project-list")
+           layers = layer_list.find_elements_by_tag_name("li")
+           for layer in layers:
+               if re.match ("openembedded-core",layer.text):
+                    print ("openembedded-core layer is a default layer in the project configuration")
+               elif re.match ("meta-poky",layer.text):
+                  print ("meta-poky layer is a default layer in the project configuration")
+               elif re.match ("meta-yocto-bsp",layer.text):
+                  print ("meta-yocto-bsp is a default layer in the project configuratoin")
+               else:
+                  self.fail(msg='default layers are missing from the project configuration')
+        except:
+           self.fail(msg='No Layer information in project detail page')
+
+#   testcase (1517)
+    def test_verify_machine_information(self):
+        self.get('')
+        self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+        self.wait_until_visible('#projectstable')
+        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+
+        try:
+            self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist')
+            self.assertTrue(re.search("qemux86",self.driver.find_element_by_id("project-machine-name").text),'The machine type is not assigned')
+            self.driver.find_element_by_id("change-machine-toggle").click()
+            self.wait_until_visible('#select-machine-form')
+            self.wait_until_visible('#cancel-machine-change')
+            self.driver.find_element_by_id("cancel-machine-change").click()
+        except:
+            self.fail(msg='The machine information is wrong in the configuration page')
+
+#   testcase (1518)
+    def test_verify_most_built_recipes_information(self):
+        self.get('')
+        self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+        self.wait_until_visible('#projectstable')
+        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+        project_URL=self.get_URL()
+
+        try:
+            self.assertTrue(re.search("You haven't built any recipes yet",self.driver.find_element_by_id("no-most-built").text),'Default message of no builds is not present')
+            self.driver.find_element_by_xpath("//div[@id='no-most-built']/p/a[@href="+'"'+project_URL+'images/"'+"]").click()
+            self.assertTrue(re.search("Compatible image recipes",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Choose a recipe to build link  is not working  properly')
+        except:
+            self.fail(msg='No Most built information in project detail page')
+
+#   testcase (1519)
+    def test_verify_project_release_information(self):
+        self.get('')
+        self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+        self.wait_until_visible('#projectstable')
+        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+
+        try:
+            self.assertTrue(re.search("Yocto Project master",self.driver.find_element_by_id("project-release-title").text),'The project release is not defined')
+        except:
+            self.fail(msg='No project release title information in project detail page')
+
+#   testcase (1520)
+    def test_verify_layer_information(self):
+        self.get('')
+        self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+        self.wait_until_visible('#projectstable')
+        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+        project_URL=self.get_URL()
+
+        try:
+           self.driver.find_element_by_xpath("//div[@id='layer-container']")
+           self.assertTrue(re.search("3",self.driver.find_element_by_id("project-layers-count").text),'There should be 3 layers listed in the layer count')
+           layer_list = self.driver.find_element_by_id("layers-in-project-list")
+           layers = layer_list.find_elements_by_tag_name("li")
+
+           for layer in layers:
+               if re.match ("openembedded-core",layer.text):
+                    print ("openembedded-core layer is a default layer in the project configuration")
+               elif re.match ("meta-poky",layer.text):
+                  print ("meta-poky layer is a default layer in the project configuration")
+               elif re.match ("meta-yocto-bsp",layer.text):
+                  print ("meta-yocto-bsp is a default layer in the project configuratoin")
+               else:
+                  self.fail(msg='default layers are missing from the project configuration')
+
+           self.driver.find_element_by_xpath("//input[@id='layer-add-input']")
+           self.driver.find_element_by_xpath("//button[@id='add-layer-btn']")
+           self.driver.find_element_by_xpath("//div[@id='layer-container']/form[@class='form-inline']/p/a[@id='view-compatible-layers']")
+           self.driver.find_element_by_xpath("//div[@id='layer-container']/form[@class='form-inline']/p/a[@href="+'"'+project_URL+'importlayer"'+"]")
+        except:
+            self.fail(msg='No Layer information in project detail page')
+
+#   testcase (1521)
+    def test_verify_project_detail_links(self):
+        self.get('')
+        self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+        self.wait_until_visible('#projectstable')
+        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+        project_URL=self.get_URL()
+
+        self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li[@id='topbar-configuration-tab']/a[@href="+'"'+project_URL+'"'+"]").click()
+        self.assertTrue(re.search("Configuration",self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li[@id='topbar-configuration-tab']/a[@href="+'"'+project_URL+'"'+"]").text), 'Configuration tab in project topbar is misspelled')
+
+        try:
+            self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").click()
+            self.assertTrue(re.search("Builds",self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").text), 'Builds tab in project topbar is misspelled')
+            self.driver.find_element_by_xpath("//div[@id='empty-state-projectbuildstable']")
+        except:
+            self.fail(msg='Builds tab information is not present')
+
+        try:
+            self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").click()
+            self.assertTrue(re.search("Import layer",self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").text), 'Import layer tab in project topbar is misspelled')
+            self.driver.find_element_by_xpath("//fieldset[@id='repo-select']")
+            self.driver.find_element_by_xpath("//fieldset[@id='git-repo']")
+        except:
+            self.fail(msg='Import layer tab not loading properly')
+
+        try:
+            self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").click()
+            self.assertTrue(re.search("New custom image",self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").text), 'New custom image tab in project topbar is misspelled')
+            self.assertTrue(re.search("Select the image recipe you want to customise",self.driver.find_element_by_xpath("//div[@class='col-md-12']/h2").text),'The new custom image tab is not loading correctly')
+        except:
+            self.fail(msg='New custom image tab not loading properly')
+
+
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/views/README b/import-layers/yocto-poky/bitbake/lib/toaster/tests/views/README
new file mode 100644
index 0000000..950c7c9
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/views/README
@@ -0,0 +1,4 @@
+
+Django unit tests to verify classes and functions based on django Views
+
+To run just these tests use ./manage.py test tests.views
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/views/__init__.py
similarity index 100%
copy from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
copy to import-layers/yocto-poky/bitbake/lib/toaster/tests/views/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/views/test_views.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/views/test_views.py
new file mode 100644
index 0000000..1463077
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/views/test_views.py
@@ -0,0 +1,540 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""Test cases for Toaster GUI and ReST."""
+
+from django.test import TestCase
+from django.test.client import RequestFactory
+from django.core.urlresolvers import reverse
+from django.db.models import Q
+
+from orm.models import Project, Package
+from orm.models import Layer_Version, Recipe
+from orm.models import CustomImageRecipe
+from orm.models import CustomImagePackage
+
+import inspect
+import toastergui
+
+from toastergui.tables import SoftwareRecipesTable
+import json
+from bs4 import BeautifulSoup
+import string
+
+PROJECT_NAME = "test project"
+PROJECT_NAME2 = "test project 2"
+CLI_BUILDS_PROJECT_NAME = 'Command line builds'
+
+
+class ViewTests(TestCase):
+    """Tests to verify view APIs."""
+
+    fixtures = ['toastergui-unittest-data']
+
+    def setUp(self):
+
+        self.project = Project.objects.first()
+        self.recipe1 = Recipe.objects.get(pk=2)
+        self.customr = CustomImageRecipe.objects.first()
+        self.cust_package = CustomImagePackage.objects.first()
+        self.package = Package.objects.first()
+        self.lver = Layer_Version.objects.first()
+
+    def test_get_base_call_returns_html(self):
+        """Basic test for all-projects view"""
+        response = self.client.get(reverse('all-projects'), follow=True)
+        self.assertEqual(response.status_code, 200)
+        self.assertTrue(response['Content-Type'].startswith('text/html'))
+        self.assertTemplateUsed(response, "projects-toastertable.html")
+
+    def test_get_json_call_returns_json(self):
+        """Test for all projects output in json format"""
+        url = reverse('all-projects')
+        response = self.client.get(url, {"format": "json"}, follow=True)
+        self.assertEqual(response.status_code, 200)
+        self.assertTrue(response['Content-Type'].startswith(
+            'application/json'))
+
+        data = json.loads(response.content.decode('utf-8'))
+
+        self.assertTrue("error" in data)
+        self.assertEqual(data["error"], "ok")
+        self.assertTrue("rows" in data)
+
+        name_found = False
+        for row in data["rows"]:
+            name_found = row['name'].find(self.project.name)
+
+        self.assertTrue(name_found,
+                        "project name not found in projects table")
+
+    def test_typeaheads(self):
+        """Test typeahead ReST API"""
+        layers_url = reverse('xhr_layerstypeahead', args=(self.project.id,))
+        prj_url = reverse('xhr_projectstypeahead')
+
+        urls = [layers_url,
+                prj_url,
+                reverse('xhr_recipestypeahead', args=(self.project.id,)),
+                reverse('xhr_machinestypeahead', args=(self.project.id,))]
+
+        def basic_reponse_check(response, url):
+            """Check data structure of http response."""
+            self.assertEqual(response.status_code, 200)
+            self.assertTrue(response['Content-Type'].startswith(
+                'application/json'))
+
+            data = json.loads(response.content.decode('utf-8'))
+
+            self.assertTrue("error" in data)
+            self.assertEqual(data["error"], "ok")
+            self.assertTrue("results" in data)
+
+            # We got a result so now check the fields
+            if len(data['results']) > 0:
+                result = data['results'][0]
+
+                self.assertTrue(len(result['name']) > 0)
+                self.assertTrue("detail" in result)
+                self.assertTrue(result['id'] > 0)
+
+                # Special check for the layers typeahead's extra fields
+                if url == layers_url:
+                    self.assertTrue(len(result['layerdetailurl']) > 0)
+                    self.assertTrue(len(result['vcs_url']) > 0)
+                    self.assertTrue(len(result['vcs_reference']) > 0)
+                # Special check for project typeahead extra fields
+                elif url == prj_url:
+                    self.assertTrue(len(result['projectPageUrl']) > 0)
+
+                return True
+
+            return False
+
+        for url in urls:
+            results = False
+
+            for typeing in list(string.ascii_letters):
+                response = self.client.get(url, {'search': typeing})
+                results = basic_reponse_check(response, url)
+                if results:
+                    break
+
+            # After "typeing" the alpabet we should have result true
+            # from each of the urls
+            self.assertTrue(results)
+
+    def test_xhr_add_layer(self):
+        """Test xhr_add API"""
+        # Test for importing an already existing layer
+        api_url = reverse('xhr_layer', args=(self.project.id,))
+
+        layer_data = {'vcs_url': "git://git.example.com/test",
+                      'name': "base-layer",
+                      'git_ref': "c12b9596afd236116b25ce26dbe0d793de9dc7ce",
+                      'project_id': self.project.id,
+                      'local_source_dir': "",
+                      'add_to_project': True,
+                      'dir_path': "/path/in/repository"}
+
+        layer_data_json = json.dumps(layer_data)
+
+        response = self.client.put(api_url, layer_data_json)
+        data = json.loads(response.content.decode('utf-8'))
+        self.assertEqual(response.status_code, 200)
+        self.assertEqual(data["error"], "ok")
+
+        self.assertTrue(
+            layer_data['name'] in
+            self.project.get_all_compatible_layer_versions().values_list(
+                'layer__name',
+                flat=True),
+            "Could not find imported layer in project's all layers list"
+        )
+
+        # Empty data passed
+        response = self.client.put(api_url, "{}")
+        data = json.loads(response.content.decode('utf-8'))
+        self.assertNotEqual(data["error"], "ok")
+
+    def test_custom_ok(self):
+        """Test successful return from ReST API xhr_customrecipe"""
+        url = reverse('xhr_customrecipe')
+        params = {'name': 'custom', 'project': self.project.id,
+                  'base': self.recipe1.id}
+        response = self.client.post(url, params)
+        self.assertEqual(response.status_code, 200)
+        data = json.loads(response.content.decode('utf-8'))
+        self.assertEqual(data['error'], 'ok')
+        self.assertTrue('url' in data)
+        # get recipe from the database
+        recipe = CustomImageRecipe.objects.get(project=self.project,
+                                               name=params['name'])
+        args = (self.project.id, recipe.id,)
+        self.assertEqual(reverse('customrecipe', args=args), data['url'])
+
+    def test_custom_incomplete_params(self):
+        """Test not passing all required parameters to xhr_customrecipe"""
+        url = reverse('xhr_customrecipe')
+        for params in [{}, {'name': 'custom'},
+                       {'name': 'custom', 'project': self.project.id}]:
+            response = self.client.post(url, params)
+            self.assertEqual(response.status_code, 200)
+            data = json.loads(response.content.decode('utf-8'))
+            self.assertNotEqual(data["error"], "ok")
+
+    def test_xhr_custom_wrong_project(self):
+        """Test passing wrong project id to xhr_customrecipe"""
+        url = reverse('xhr_customrecipe')
+        params = {'name': 'custom', 'project': 0, "base": self.recipe1.id}
+        response = self.client.post(url, params)
+        self.assertEqual(response.status_code, 200)
+        data = json.loads(response.content.decode('utf-8'))
+        self.assertNotEqual(data["error"], "ok")
+
+    def test_xhr_custom_wrong_base(self):
+        """Test passing wrong base recipe id to xhr_customrecipe"""
+        url = reverse('xhr_customrecipe')
+        params = {'name': 'custom', 'project': self.project.id, "base": 0}
+        response = self.client.post(url, params)
+        self.assertEqual(response.status_code, 200)
+        data = json.loads(response.content.decode('utf-8'))
+        self.assertNotEqual(data["error"], "ok")
+
+    def test_xhr_custom_details(self):
+        """Test getting custom recipe details"""
+        url = reverse('xhr_customrecipe_id', args=(self.customr.id,))
+        response = self.client.get(url)
+        self.assertEqual(response.status_code, 200)
+        expected = {"error": "ok",
+                    "info": {'id': self.customr.id,
+                             'name': self.customr.name,
+                             'base_recipe_id': self.recipe1.id,
+                             'project_id': self.project.id}}
+        self.assertEqual(json.loads(response.content.decode('utf-8')),
+                         expected)
+
+    def test_xhr_custom_del(self):
+        """Test deleting custom recipe"""
+        name = "to be deleted"
+        recipe = CustomImageRecipe.objects.create(
+                     name=name, project=self.project,
+                     base_recipe=self.recipe1,
+                     file_path="/tmp/testing",
+                     layer_version=self.customr.layer_version)
+        url = reverse('xhr_customrecipe_id', args=(recipe.id,))
+        response = self.client.delete(url)
+        self.assertEqual(response.status_code, 200)
+
+        gotoUrl = reverse('projectcustomimages', args=(self.project.pk,))
+
+        self.assertEqual(json.loads(response.content.decode('utf-8')),
+                         {"error": "ok",
+                          "gotoUrl": gotoUrl})
+
+        # try to delete not-existent recipe
+        url = reverse('xhr_customrecipe_id', args=(recipe.id,))
+        response = self.client.delete(url)
+        self.assertEqual(response.status_code, 200)
+        self.assertNotEqual(json.loads(
+            response.content.decode('utf-8'))["error"], "ok")
+
+    def test_xhr_custom_packages(self):
+        """Test adding and deleting package to a custom recipe"""
+        # add self.package to recipe
+        response = self.client.put(reverse('xhr_customrecipe_packages',
+                                           args=(self.customr.id,
+                                                 self.cust_package.id)))
+
+        self.assertEqual(response.status_code, 200)
+        self.assertEqual(json.loads(response.content.decode('utf-8')),
+                         {"error": "ok"})
+        self.assertEqual(self.customr.appends_set.first().name,
+                         self.cust_package.name)
+        # delete it
+        to_delete = self.customr.appends_set.first().pk
+        del_url = reverse('xhr_customrecipe_packages',
+                          args=(self.customr.id, to_delete))
+
+        response = self.client.delete(del_url)
+        self.assertEqual(response.status_code, 200)
+        self.assertEqual(json.loads(response.content.decode('utf-8')),
+                         {"error": "ok"})
+        all_packages = self.customr.get_all_packages().values_list('pk',
+                                                                   flat=True)
+
+        self.assertFalse(to_delete in all_packages)
+        # delete invalid package to test error condition
+        del_url = reverse('xhr_customrecipe_packages',
+                          args=(self.customr.id,
+                                99999))
+
+        response = self.client.delete(del_url)
+        self.assertEqual(response.status_code, 200)
+        self.assertNotEqual(json.loads(
+            response.content.decode('utf-8'))["error"], "ok")
+
+    def test_xhr_custom_packages_err(self):
+        """Test error conditions of xhr_customrecipe_packages"""
+        # test calls with wrong recipe id and wrong package id
+        for args in [(0, self.package.id), (self.customr.id, 0)]:
+            url = reverse('xhr_customrecipe_packages', args=args)
+            # test put and delete methods
+            for method in (self.client.put, self.client.delete):
+                response = method(url)
+                self.assertEqual(response.status_code, 200)
+                self.assertNotEqual(json.loads(
+                    response.content.decode('utf-8')),
+                    {"error": "ok"})
+
+    def test_download_custom_recipe(self):
+        """Download the recipe file generated for the custom image"""
+
+        # Create a dummy recipe file for the custom image generation to read
+        open("/tmp/a_recipe.bb", 'a').close()
+        response = self.client.get(reverse('customrecipedownload',
+                                           args=(self.project.id,
+                                                 self.customr.id)))
+
+        self.assertEqual(response.status_code, 200)
+
+    def test_software_recipes_table(self):
+        """Test structure returned for Software RecipesTable"""
+        table = SoftwareRecipesTable()
+        request = RequestFactory().get('/foo/', {'format': 'json'})
+        response = table.get(request, pid=self.project.id)
+        data = json.loads(response.content.decode('utf-8'))
+
+        recipes = Recipe.objects.filter(Q(is_image=False))
+        self.assertTrue(len(recipes) > 1,
+                        "Need more than one software recipe to test "
+                        "SoftwareRecipesTable")
+
+        recipe1 = recipes[0]
+        recipe2 = recipes[1]
+
+        rows = data['rows']
+        row1 = next(x for x in rows if x['name'] == recipe1.name)
+        row2 = next(x for x in rows if x['name'] == recipe2.name)
+
+        self.assertEqual(response.status_code, 200, 'should be 200 OK status')
+
+        # check other columns have been populated correctly
+        self.assertTrue(recipe1.name in row1['name'])
+        self.assertTrue(recipe1.version in row1['version'])
+        self.assertTrue(recipe1.description in
+                        row1['get_description_or_summary'])
+
+        self.assertTrue(recipe1.layer_version.layer.name in
+                        row1['layer_version__layer__name'])
+
+        self.assertTrue(recipe2.name in row2['name'])
+        self.assertTrue(recipe2.version in row2['version'])
+        self.assertTrue(recipe2.description in
+                        row2['get_description_or_summary'])
+
+        self.assertTrue(recipe2.layer_version.layer.name in
+                        row2['layer_version__layer__name'])
+
+    def test_toaster_tables(self):
+        """Test all ToasterTables instances"""
+
+        def get_data(table, options={}):
+            """Send a request and parse the json response"""
+            options['format'] = "json"
+            options['nocache'] = "true"
+            request = RequestFactory().get('/', options)
+
+            # This is the image recipe needed for a package list for
+            # PackagesTable do this here to throw a non exist exception
+            image_recipe = Recipe.objects.get(pk=4)
+
+            # Add any kwargs that are needed by any of the possible tables
+            args = {'pid': self.project.id,
+                    'layerid': self.lver.pk,
+                    'recipeid': self.recipe1.pk,
+                    'recipe_id': image_recipe.pk,
+                    'custrecipeid': self.customr.pk,
+                    'build_id': 1,
+                    'target_id': 1}
+
+            response = table.get(request, **args)
+            return json.loads(response.content.decode('utf-8'))
+
+        def get_text_from_td(td):
+            """If we have html in the td then extract the text portion"""
+            # just so we don't waste time parsing non html
+            if "<" not in td:
+                ret = td
+            else:
+                ret = BeautifulSoup(td, "html.parser").text
+
+            if len(ret):
+                return "0"
+            else:
+                return ret
+
+        # Get a list of classes in tables module
+        tables = inspect.getmembers(toastergui.tables, inspect.isclass)
+        tables.extend(inspect.getmembers(toastergui.buildtables,
+                                         inspect.isclass))
+
+        for name, table_cls in tables:
+            # Filter out the non ToasterTables from the tables module
+            if not issubclass(table_cls, toastergui.widgets.ToasterTable) or \
+                table_cls == toastergui.widgets.ToasterTable or \
+               'Mixin' in name:
+                continue
+
+            # Get the table data without any options, this also does the
+            # initialisation of the table i.e. setup_columns,
+            # setup_filters and setup_queryset that we can use later
+            table = table_cls()
+            all_data = get_data(table)
+
+            self.assertTrue(len(all_data['rows']) > 1,
+                            "Cannot test on a %s table with < 1 row" % name)
+
+            if table.default_orderby:
+                row_one = get_text_from_td(
+                    all_data['rows'][0][table.default_orderby.strip("-")])
+                row_two = get_text_from_td(
+                    all_data['rows'][1][table.default_orderby.strip("-")])
+
+                if '-' in table.default_orderby:
+                    self.assertTrue(row_one >= row_two,
+                                    "Default ordering not working on %s"
+                                    " '%s' should be >= '%s'" %
+                                    (name, row_one, row_two))
+                else:
+                    self.assertTrue(row_one <= row_two,
+                                    "Default ordering not working on %s"
+                                    " '%s' should be <= '%s'" %
+                                    (name, row_one, row_two))
+
+            # Test the column ordering and filtering functionality
+            for column in table.columns:
+                if column['orderable']:
+                    # If a column is orderable test it in both order
+                    # directions ordering on the columns field_name
+                    ascending = get_data(table_cls(),
+                                         {"orderby": column['field_name']})
+
+                    row_one = get_text_from_td(
+                        ascending['rows'][0][column['field_name']])
+                    row_two = get_text_from_td(
+                        ascending['rows'][1][column['field_name']])
+
+                    self.assertTrue(row_one <= row_two,
+                                    "Ascending sort applied but row 0: \"%s\""
+                                    " is less than row 1: \"%s\" "
+                                    "%s %s " %
+                                    (row_one, row_two,
+                                     column['field_name'], name))
+
+                    descending = get_data(table_cls(),
+                                          {"orderby":
+                                           '-'+column['field_name']})
+
+                    row_one = get_text_from_td(
+                        descending['rows'][0][column['field_name']])
+                    row_two = get_text_from_td(
+                        descending['rows'][1][column['field_name']])
+
+                    self.assertTrue(row_one >= row_two,
+                                    "Descending sort applied but row 0: %s"
+                                    "is greater than row 1: %s"
+                                    "field %s table %s" %
+                                    (row_one,
+                                     row_two,
+                                     column['field_name'], name))
+
+                    # If the two start rows are the same we haven't actually
+                    # changed the order
+                    self.assertNotEqual(ascending['rows'][0],
+                                        descending['rows'][0],
+                                        "An orderby %s has not changed the "
+                                        "order of the data in table %s" %
+                                        (column['field_name'], name))
+
+                if column['filter_name']:
+                    # If a filter is available for the column get the filter
+                    # info. This contains what filter actions are defined.
+                    filter_info = get_data(table_cls(),
+                                           {"cmd": "filterinfo",
+                                            "name": column['filter_name']})
+                    self.assertTrue(len(filter_info['filter_actions']) > 0,
+                                    "Filter %s was defined but no actions "
+                                    "added to it" % column['filter_name'])
+
+                    for filter_action in filter_info['filter_actions']:
+                        # filter string to pass as the option
+                        # This is the name of the filter:action
+                        # e.g. project_filter:not_in_project
+                        filter_string = "%s:%s" % (
+                            column['filter_name'],
+                            filter_action['action_name'])
+                        # Now get the data with the filter applied
+                        filtered_data = get_data(table_cls(),
+                                                 {"filter": filter_string})
+
+                        # date range filter actions can't specify the
+                        # number of results they return, so their count is 0
+                        if filter_action['count'] is not None:
+                            self.assertEqual(
+                                len(filtered_data['rows']),
+                                int(filter_action['count']),
+                                "We added a table filter for %s but "
+                                "the number of rows returned was not "
+                                "what the filter info said there "
+                                "would be" % name)
+
+            # Test search functionality on the table
+            something_found = False
+            for search in list(string.ascii_letters):
+                search_data = get_data(table_cls(), {'search': search})
+
+                if len(search_data['rows']) > 0:
+                    something_found = True
+                    break
+
+            self.assertTrue(something_found,
+                            "We went through the whole alphabet and nothing"
+                            " was found for the search of table %s" % name)
+
+            # Test the limit functionality on the table
+            limited_data = get_data(table_cls(), {'limit': "1"})
+            self.assertEqual(len(limited_data['rows']),
+                             1,
+                             "Limit 1 set on table %s but not 1 row returned"
+                             % name)
+
+            # Test the pagination functionality on the table
+            page_one_data = get_data(table_cls(), {'limit': "1",
+                                                   "page": "1"})['rows'][0]
+
+            page_two_data = get_data(table_cls(), {'limit': "1",
+                                                   "page": "2"})['rows'][0]
+
+            self.assertNotEqual(page_one_data,
+                                page_two_data,
+                                "Changed page on table %s but first row is"
+                                " the same as the previous page" % name)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/api.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/api.py
index ae1f150..1a6507c 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/api.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/api.py
@@ -20,6 +20,7 @@
 
 import re
 import logging
+import json
 from collections import Counter
 
 from orm.models import Project, ProjectTarget, Build, Layer_Version
@@ -136,14 +137,63 @@
 
 
 class XhrLayer(View):
-    """ Get and Update Layer information """
+    """ Delete, Get, Add and Update Layer information
+
+        Methods: GET POST DELETE PUT
+    """
+
+    def get(self, request, *args, **kwargs):
+        """
+        Get layer information
+
+        Method: GET
+        Entry point: /xhr_layer/<project id>/<layerversion_id>
+        """
+
+        try:
+            layer_version = Layer_Version.objects.get(
+                pk=kwargs['layerversion_id'])
+
+            project = Project.objects.get(pk=kwargs['pid'])
+
+            project_layers = ProjectLayer.objects.filter(
+                project=project).values_list("layercommit_id",
+                                             flat=True)
+
+            ret = {
+                'error': 'ok',
+                'id': layer_version.pk,
+                'name': layer_version.layer.name,
+                'layerdetailurl':
+                layer_version.get_detailspage_url(project.pk),
+                'vcs_ref': layer_version.get_vcs_reference(),
+                'vcs_url': layer_version.layer.vcs_url,
+                'local_source_dir': layer_version.layer.local_source_dir,
+                'layerdeps': {
+                    "list": [
+                        {
+                            "id": dep.id,
+                            "name": dep.layer.name,
+                            "layerdetailurl":
+                            dep.get_detailspage_url(project.pk),
+                            "vcs_url": dep.layer.vcs_url,
+                            "vcs_reference": dep.get_vcs_reference()
+                        }
+                        for dep in layer_version.get_alldeps(project.id)]
+                },
+                'projectlayers': list(project_layers)
+            }
+
+            return JsonResponse(ret)
+        except Layer_Version.DoesNotExist:
+            error_response("No such layer")
 
     def post(self, request, *args, **kwargs):
         """
           Update a layer
 
-          Entry point: /xhr_layer/<layerversion_id>
           Method: POST
+          Entry point: /xhr_layer/<layerversion_id>
 
           Args:
               vcs_url, dirpath, commit, up_branch, summary, description,
@@ -201,9 +251,100 @@
             return error_response("Could not update layer version entry: %s"
                                   % e)
 
-        return JsonResponse({"error": "ok"})
+        return error_response("ok")
+
+    def put(self, request, *args, **kwargs):
+        """ Add a new layer
+
+        Method: PUT
+        Entry point: /xhr_layer/<project id>/
+        Args:
+            project_id, name,
+            [vcs_url, dir_path, git_ref], [local_source_dir], [layer_deps
+            (csv)]
+
+        """
+        try:
+            project = Project.objects.get(pk=kwargs['pid'])
+
+            layer_data = json.loads(request.body.decode('utf-8'))
+
+            # We require a unique layer name as otherwise the lists of layers
+            # becomes very confusing
+            existing_layers = \
+                project.get_all_compatible_layer_versions().values_list(
+                    "layer__name",
+                    flat=True)
+
+            add_to_project = False
+            layer_deps_added = []
+            if 'add_to_project' in layer_data:
+                add_to_project = True
+
+            if layer_data['name'] in existing_layers:
+                return JsonResponse({"error": "layer-name-exists"})
+
+            layer = Layer.objects.create(name=layer_data['name'])
+
+            layer_version = Layer_Version.objects.create(
+                layer=layer,
+                project=project,
+                layer_source=LayerSource.TYPE_IMPORTED)
+
+            # Local layer
+            if ('local_source_dir' in layer_data) and layer.local_source_dir:
+                layer.local_source_dir = layer_data['local_source_dir']
+            # git layer
+            elif 'vcs_url' in layer_data:
+                layer.vcs_url = layer_data['vcs_url']
+                layer_version.dirpath = layer_data['dir_path']
+                layer_version.commit = layer_data['git_ref']
+                layer_version.branch = layer_data['git_ref']
+
+            layer.save()
+            layer_version.save()
+
+            if add_to_project:
+                ProjectLayer.objects.get_or_create(
+                    layercommit=layer_version, project=project)
+
+            # Add the layer dependencies
+            if 'layer_deps' in layer_data:
+                for layer_dep_id in layer_data['layer_deps'].split(","):
+                    layer_dep = Layer_Version.objects.get(pk=layer_dep_id)
+                    LayerVersionDependency.objects.get_or_create(
+                        layer_version=layer_version, depends_on=layer_dep)
+
+                    # Add layer deps to the project if specified
+                    if add_to_project:
+                        created, pl = ProjectLayer.objects.get_or_create(
+                            layercommit=layer_dep, project=project)
+                        layer_deps_added.append(
+                            {'name': layer_dep.layer.name,
+                             'layerdetailurl':
+                             layer_dep.get_detailspage_url(project.pk)})
+
+        except Layer_Version.DoesNotExist:
+            return error_response("layer-dep-not-found")
+        except Project.DoesNotExist:
+            return error_response("project-not-found")
+        except KeyError:
+            return error_response("incorrect-parameters")
+
+        return JsonResponse({'error': "ok",
+                             'imported_layer': {
+                                 'name': layer.name,
+                                 'layerdetailurl':
+                                 layer_version.get_detailspage_url()},
+                             'deps_added': layer_deps_added})
 
     def delete(self, request, *args, **kwargs):
+        """ Delete an imported layer
+
+        Method: DELETE
+        Entry point: /xhr_layer/<projed id>/<layerversion_id>
+
+        """
         try:
             # We currently only allow Imported layers to be deleted
             layer_version = Layer_Version.objects.get(
@@ -291,10 +432,13 @@
                 return error_response("recipe-already-exists")
 
             # create layer 'Custom layer' and verion if needed
-            layer = Layer.objects.get_or_create(
+            layer, l_created = Layer.objects.get_or_create(
                 name=CustomImageRecipe.LAYER_NAME,
-                summary="Layer for custom recipes",
-                vcs_url="file:///toaster_created_layer")[0]
+                summary="Layer for custom recipes")
+
+            if l_created:
+                layer.local_source_dir = "toaster_created_layer"
+                layer.save()
 
             # Check if we have a layer version already
             # We don't use get_or_create here because the dirpath will change
@@ -303,9 +447,10 @@
                                                 Q(layer=layer) &
                                                 Q(build=None)).last()
             if lver is None:
-                lver, created = Layer_Version.objects.get_or_create(
+                lver, lv_created = Layer_Version.objects.get_or_create(
                     project=params['project'],
                     layer=layer,
+                    layer_source=LayerSource.TYPE_LOCAL,
                     dirpath="toaster_created_layer")
 
             # Add a dependency on our layer to the base recipe's layer
@@ -319,7 +464,7 @@
                                                optional=False)
 
             # Create the actual recipe
-            recipe, created = CustomImageRecipe.objects.get_or_create(
+            recipe, r_created = CustomImageRecipe.objects.get_or_create(
                 name=request.POST["name"],
                 base_recipe=params["base"],
                 project=params["project"],
@@ -329,7 +474,7 @@
             # If we created the object then setup these fields. They may get
             # overwritten later on and cause the get_or_create to create a
             # duplicate if they've changed.
-            if created:
+            if r_created:
                 recipe.file_path = request.POST["name"]
                 recipe.license = "MIT"
                 recipe.version = "0.1"
@@ -789,6 +934,9 @@
                 "url": layer.layercommit.layer.layer_index_url,
                 "layerdetailurl": layer.layercommit.get_detailspage_url(
                     project.pk),
+                "xhrLayerUrl": reverse("xhr_layer",
+                                       args=(project.pk,
+                                             layer.layercommit.pk)),
                 "layersource": layer.layercommit.layer_source
             })
 
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/buildtables.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/buildtables.py
index dd0a690..755a7c2 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/buildtables.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/buildtables.py
@@ -571,6 +571,7 @@
         super(BuildTimeTable, self).setup_columns(**kwargs)
 
         self.columns[self.toggle_columns['order']]['hidden'] = True
+        self.columns[self.toggle_columns['order']]['hideable'] = True
         self.columns[self.toggle_columns['sstate_result']]['hidden'] = True
         self.columns[self.toggle_columns['elapsed_time']]['hidden'] = False
 
@@ -586,6 +587,7 @@
         super(BuildCPUTimeTable, self).setup_columns(**kwargs)
 
         self.columns[self.toggle_columns['order']]['hidden'] = True
+        self.columns[self.toggle_columns['order']]['hideable'] = True
         self.columns[self.toggle_columns['sstate_result']]['hidden'] = True
         self.columns[self.toggle_columns['cpu_time_sys']]['hidden'] = False
         self.columns[self.toggle_columns['cpu_time_user']]['hidden'] = False
@@ -602,5 +604,6 @@
         super(BuildIOTable, self).setup_columns(**kwargs)
 
         self.columns[self.toggle_columns['order']]['hidden'] = True
+        self.columns[self.toggle_columns['order']]['hideable'] = True
         self.columns[self.toggle_columns['sstate_result']]['hidden'] = True
         self.columns[self.toggle_columns['disk_io']]['hidden'] = False
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/default.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/default.css
index ff24e8c..5cd7e211 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/default.css
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/default.css
@@ -210,7 +210,6 @@
 #import-layer-name,
 #layer-subdir { width: 20%; }
 #layer-git-repo-url { width: 40%; }
-#layer-git-ref { width: 32%; }
 #local-dir-path { width: 45%; }
 #layer-dependency { width: 16em; }
 #layer-deps-list { margin-top: 0; }
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/prettify.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/prettify.css
deleted file mode 100755
index b317a7c..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/prettify.css
+++ /dev/null
@@ -1 +0,0 @@
-.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
index 9ea9602..8b1c190 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
@@ -312,5 +312,11 @@
     });
   });
 
+ /* Stop the download link from working if it is in disabled state
+  * http://getbootstrap.com/css/#forms-disabled-fieldsets
+  */
+ $("a[disabled=disabled]").click(function(e){
+   e.preventDefault();
+ });
 
 }
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/highlight.pack.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/highlight.pack.js
new file mode 100644
index 0000000..8cc886f
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/highlight.pack.js
@@ -0,0 +1,2 @@
+/*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */
+!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return w(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||w(i))return i}function o(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset<r[0].offset?e:r:"start"===r[0].event?e:r:e.length?e:r}function o(e){function r(e){return" "+e.nodeName+'="'+n(e.value).replace('"',"&quot;")+'"'}s+="<"+t(e)+E.map.call(e.attributes,r).join("")+">"}function u(e){s+="</"+t(e)+">"}function c(e){("start"===e.event?o:u)(e.node)}for(var l=0,s="",f=[];e.length||r.length;){var g=i();if(s+=n(a.substring(l,g[0].offset)),l=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===l);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return s+n(a.substr(l))}function l(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(n){return o(e,{v:null},n)})),e.cached_variants||e.eW&&[o(e)]||[e]}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");o[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?u("keyword",a.k):x(a.k).forEach(function(e){u(e,a.k[e])}),a.k=o}a.lR=t(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]),a.c=Array.prototype.concat.apply([],a.c.map(function(e){return l("self"===e?a:e)})),a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var c=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=c.length?t(c.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!a&&r(n.iR,e)}function l(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function p(e,n,t,r){var a=r?"":I.classPrefix,i='<span class="'+a,o=t?"":C;return i+=e+'">',i+n+o}function h(){var e,t,r,a;if(!E.k)return n(k);for(a="",t=0,E.lR.lastIndex=0,r=E.lR.exec(k);r;)a+=n(k.substring(t,r.index)),e=l(E,r),e?(B+=e[1],a+=p(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(k);return a+n(k.substr(t))}function d(){var e="string"==typeof E.sL;if(e&&!y[E.sL])return n(k);var t=e?f(E.sL,k,!0,x[E.sL]):g(k,E.sL.length?E.sL:void 0);return E.r>0&&(B+=t.r),e&&(x[E.sL]=t.top),p(t.language,t.value,!1,!0)}function b(){L+=null!=E.sL?d():h(),k=""}function v(e){L+=e.cN?p(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(k+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?k+=n:(t.eB&&(k+=n),b(),t.rB||t.eB||(k=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?k+=n:(a.rE||a.eE||(k+=n),b(),a.eE&&(k=n));do E.cN&&(L+=C),E.skip||(B+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,""),a.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"<unnamed>")+'"');return k+=n,n.length||1}var N=w(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var R,E=i||N,x={},L="";for(R=E;R!==N;R=R.parent)R.cN&&(L=p(R.cN,"",!0)+L);var k="",B=0;try{for(var M,j,O=0;;){if(E.t.lastIndex=O,M=E.t.exec(t),!M)break;j=m(t.substring(O,M.index),M[0]),O=M.index+j}for(m(t.substr(O)),R=E;R.parent;R=R.parent)R.cN&&(L+=C);return{r:B,value:L,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf("Illegal"))return{r:0,value:n(t)};throw T}}function g(e,t){t=t||I.languages||x(y);var r={r:0,value:n(e)},a=r;return t.filter(w).forEach(function(n){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function p(e){return I.tabReplace||I.useBR?e.replace(M,function(e,n){return I.useBR&&"\n"===e?"<br>":I.tabReplace?n.replace(/\t/g,I.tabReplace):""}):e}function h(e,n,t){var r=n?L[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function d(e){var n,t,r,o,l,s=i(e);a(s)||(I.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")):n=e,l=n.textContent,r=s?f(s,l,!0):g(l),t=u(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=c(t,u(o),l)),r.value=p(r.value),e.innerHTML=r.value,e.className=h(e.className,s,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function b(e){I=o(I,e)}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll("pre code");E.forEach.call(e,d)}}function m(){addEventListener("DOMContentLoaded",v,!1),addEventListener("load",v,!1)}function N(n,t){var r=y[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function R(){return x(y)}function w(e){return e=(e||"").toLowerCase(),y[e]||y[L[e]]}var E=[],x=Object.keys,y={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\blang(?:uage)?-([\w-]+)\b/i,M=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,C="</span>",I={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};return e.highlight=f,e.highlightAuto=g,e.fixMarkup=p,e.highlightBlock=d,e.configure=b,e.initHighlighting=v,e.initHighlightingOnLoad=m,e.registerLanguage=N,e.listLanguages=R,e.getLanguage=w,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("sql",function(e){var t=e.C("--","$");return{cI:!0,i:/[<>{}*#]/,c:[{bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment",e:/;/,eW:!0,l:/[\w\.]+/,k:{keyword:"abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select self sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text varchar varying void"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}});hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},s={b:"->{",e:"}"},n={v:[{b:/\$\d/},{b:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{b:/[\$%@][^\s\w{]/,r:0}]},i=[e.BE,r,n],o=[n,e.HCM,e.C("^\\=\\w","\\=cut",{eW:!0}),s,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"function",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",eE:!0,r:5,c:[e.TM]},{b:"-\\w\\b",r:0},{b:"^__DATA__$",e:"^__END__$",sL:"mojolicious",c:[{b:"^@@.*",e:"$",cN:"comment"}]}];return r.c=o,s.c=o,{aliases:["pl","pm"],l:/[\w\.]+/,k:t,c:o}});hljs.registerLanguage("ini",function(e){var b={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"section",b:/^\s*\[+/,e:/\]+/},{b:/^[a-z0-9\[\]_-]+\s*=\s*/,e:"$",rB:!0,c:[{cN:"attr",b:/[a-z0-9\[\]_-]+/},{b:/=/,eW:!0,r:0,c:[{cN:"literal",b:/\bon|off|true|false|yes|no\b/},{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},b,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM]}]}]}});hljs.registerLanguage("diff",function(e){return{aliases:["patch"],c:[{cN:"meta",r:10,v:[{b:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"comment",v:[{b:/Index: /,e:/$/},{b:/={3,}/,e:/$/},{b:/^\-{3}/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+{3}/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"addition",b:"^\\!",e:"$"}]}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/\b-?[a-z\._]+\b/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,s,a,t]}});hljs.registerLanguage("php",function(e){var c={b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},i={cN:"meta",b:/<\?(php)?|\?>/},t={cN:"string",c:[e.BE,i],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},a={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.HCM,e.C("//","$",{c:[i]}),e.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:/<<<['"]?\w+['"]?$/,e:/^\w+;?$/,c:[e.BE,{cN:"subst",v:[{b:/\$\w+/},{b:/\{\$/,e:/\}/}]}]},i,{cN:"keyword",b:/\$this\b/},c,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",c,e.CBCM,t,a]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},t,a]}});hljs.registerLanguage("python",function(e){var r={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},b={cN:"meta",b:/^(>>>|\.\.\.) /},c={cN:"subst",b:/\{/,e:/\}/,k:r,i:/#/},a={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[b],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[b],r:10},{b:/(fr|rf|f)'''/,e:/'''/,c:[b,c]},{b:/(fr|rf|f)"""/,e:/"""/,c:[b,c]},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},{b:/(fr|rf|f)'/,e:/'/,c:[c]},{b:/(fr|rf|f)"/,e:/"/,c:[c]},e.ASM,e.QSM]},s={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},i={cN:"params",b:/\(/,e:/\)/,c:["self",b,s,a]};return c.c=[a,s,b],{aliases:["py","gyp"],k:r,i:/(<\/|->|\?)|=>/,c:[b,s,a,e.HCM,{v:[{cN:"function",bK:"def"},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,i,{b:/->/,eW:!0,k:"None"}]},{cN:"meta",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("coffeescript",function(e){var c={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",built_in:"npm require console print module global window document"},n="[A-Za-z$_][0-9A-Za-z$_]*",r={cN:"subst",b:/#\{/,e:/}/,k:c},i=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,r]},{b:/"/,e:/"/,c:[e.BE,r]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[r,e.HCM]},{b:"//[gim]*",r:0},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{b:"@"+n},{sL:"javascript",eB:!0,eE:!0,v:[{b:"```",e:"```"},{b:"`",e:"`"}]}];r.c=i;var s=e.inherit(e.TM,{b:n}),t="(\\(.*\\))?\\s*\\B[-=]>",o={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:c,c:["self"].concat(i)}]};return{aliases:["coffee","cson","iced"],k:c,i:/\/\*/,c:i.concat([e.C("###","###"),e.HCM,{cN:"function",b:"^\\s*"+n+"\\s*=\\s*"+t,e:"[-=]>",rB:!0,c:[s,o]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:t,e:"[-=]>",rB:!0,c:[o]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[s]},s]},{b:n+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("cpp",function(t){var e={cN:"keyword",b:"\\b[a-z\\d_]*_t\\b"},r={cN:"string",v:[{b:'(u8?|U)?L?"',e:'"',i:"\\n",c:[t.BE]},{b:'(u8?|U)?R"',e:'"',c:[t.BE]},{b:"'\\\\?.",e:"'",i:"."}]},s={cN:"number",v:[{b:"\\b(0b[01']+)"},{b:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],r:0},i={cN:"meta",b:/#\s*[a-z]+\b/,e:/$/,k:{"meta-keyword":"if else elif endif define undef warning error line pragma ifdef ifndef include"},c:[{b:/\\\n/,r:0},t.inherit(r,{cN:"meta-string"}),{cN:"meta-string",b:/<[^\n>]*>/,e:/$/,i:"\\n"},t.CLCM,t.CBCM]},a=t.IR+"\\s*\\(",c={keyword:"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not",built_in:"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr",literal:"true false nullptr NULL"},n=[e,t.CLCM,t.CBCM,s,r];return{aliases:["c","cc","h","c++","h++","hpp"],k:c,i:"</",c:n.concat([i,{b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:c,c:["self",e]},{b:t.IR+"::",k:c},{v:[{b:/=/,e:/;/},{b:/\(/,e:/\)/},{bK:"new throw return else",e:/;/}],k:c,c:n.concat([{b:/\(/,e:/\)/,k:c,c:n.concat(["self"]),r:0}]),r:0},{cN:"function",b:"("+t.IR+"[\\*&\\s]+)+"+a,rB:!0,e:/[{;=]/,eE:!0,k:c,i:/[^\w\s\*&]/,c:[{b:a,rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:c,r:0,c:[t.CLCM,t.CBCM,r,s,e]},t.CLCM,t.CBCM,i]},{cN:"class",bK:"class struct",e:/[{;:]/,c:[{b:/</,e:/>/,c:["self"]},t.TM]}]),exports:{preprocessor:i,strings:r,k:c}}});hljs.registerLanguage("cs",function(e){var i={keyword:"abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long nameof object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield",literal:"null false true"},t={cN:"string",b:'@"',e:'"',c:[{b:'""'}]},r=e.inherit(t,{i:/\n/}),a={cN:"subst",b:"{",e:"}",k:i},c=e.inherit(a,{i:/\n/}),n={cN:"string",b:/\$"/,e:'"',i:/\n/,c:[{b:"{{"},{b:"}}"},e.BE,c]},s={cN:"string",b:/\$@"/,e:'"',c:[{b:"{{"},{b:"}}"},{b:'""'},a]},o=e.inherit(s,{i:/\n/,c:[{b:"{{"},{b:"}}"},{b:'""'},c]});a.c=[s,n,t,e.ASM,e.QSM,e.CNM,e.CBCM],c.c=[o,n,r,e.ASM,e.QSM,e.CNM,e.inherit(e.CBCM,{i:/\n/})];var l={v:[s,n,t,e.ASM,e.QSM]},b=e.IR+"(<"+e.IR+"(\\s*,\\s*"+e.IR+")*>)?(\\[\\])?";return{aliases:["csharp"],k:i,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"doctag",v:[{b:"///",r:0},{b:"<!--|-->"},{b:"</?",e:">"}]}]}),e.CLCM,e.CBCM,{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},l,e.CNM,{bK:"class interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"namespace",e:/[{;=]/,i:/[^\s:]/,c:[e.inherit(e.TM,{b:"[a-zA-Z](\\.?\\w)*"}),e.CLCM,e.CBCM]},{cN:"meta",b:"^\\s*\\[",eB:!0,e:"\\]",eE:!0,c:[{cN:"meta-string",b:/"/,e:/"/}]},{bK:"new return throw await else",r:0},{cN:"function",b:"("+b+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:i,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:i,r:0,c:[l,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("shell",function(s){return{aliases:["console"],c:[{cN:"meta",b:"^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]",starts:{e:"$",sL:"bash"}}]}});hljs.registerLanguage("ruby",function(e){var b="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},c={cN:"doctag",b:"@[A-Za-z]+"},a={b:"#<",e:">"},s=[e.C("#","$",{c:[c]}),e.C("^\\=begin","^\\=end",{c:[c],r:10}),e.C("^__END__","\\n$")],n={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{b:/<<(-?)\w+$/,e:/^\s*\w+$/}]},i={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(s)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:b}),i].concat(s)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[t,{b:b}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:r},{b:"("+e.RSR+"|unless)\\s*",k:"unless",c:[a,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(s),r:0}].concat(s);n.c=d,i.c=d;var l="[>?]>",o="[\\w#]+\\(\\w+\\):\\d+:\\d+>",u="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",w=[{b:/^\s*=>/,starts:{e:"$",c:d}},{cN:"meta",b:"^("+l+"|"+o+"|"+u+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:s.concat(w).concat(d)}});hljs.registerLanguage("nginx",function(e){var r={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},b={eW:!0,l:"[a-z/_]+",k:{literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,r],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[r]},{cN:"regexp",c:[e.BE,r],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},r]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s+{",rB:!0,e:"{",c:[{cN:"section",b:e.UIR}],r:0},{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"attribute",b:e.UIR,starts:b}],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",t={b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\w-]+\(/,rB:!0,c:[{cN:"built_in",b:/[\w-]+/},{b:/\(/,e:/\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"number",b:"#[0-9A-Fa-f]+"},{cN:"meta",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,{cN:"selector-id",b:/#[A-Za-z0-9_-]+/},{cN:"selector-class",b:/\.[A-Za-z0-9_-]+/},{cN:"selector-attr",b:/\[/,e:/\]/,i:"$"},{cN:"selector-pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{b:"@",e:"[{;]",i:/:/,c:[{cN:"keyword",b:/\w+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:"selector-tag",b:c,r:0},{b:"{",e:"}",i:/\S/,c:[e.CBCM,t]}]}});hljs.registerLanguage("makefile",function(e){var i={cN:"variable",v:[{b:"\\$\\("+e.UIR+"\\)",c:[e.BE]},{b:/\$[@%<?\^\+\*]/}]},r={cN:"string",b:/"/,e:/"/,c:[e.BE,i]},a={cN:"variable",b:/\$\([\w-]+\s/,e:/\)/,k:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},c:[i]},n={b:"^"+e.UIR+"\\s*[:+?]?=",i:"\\n",rB:!0,c:[{b:"^"+e.UIR,e:"[:+?]?=",eE:!0}]},t={cN:"meta",b:/^\.PHONY:/,e:/$/,k:{"meta-keyword":".PHONY"},l:/[\.\w]+/},l={cN:"section",b:/^[^\s]+:/,e:/$/,c:[i]};return{aliases:["mk","mak"],k:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath",l:/[\w-]+/,c:[e.HCM,i,r,a,n,t,l]}});hljs.registerLanguage("java",function(e){var a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",t=a+"(<"+a+"(\\s*,\\s*"+a+")*>)?",r="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",s="\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",c={cN:"number",b:s,r:0};return{aliases:["jsp"],k:r,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},c,{cN:"meta",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("http",function(e){var t="HTTP/[0-9\\.]+";return{aliases:["https"],i:"\\S",c:[{b:"^"+t,e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{b:"^[A-Z]+ (.*?) "+t+"$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0},{b:t},{cN:"keyword",b:"[A-Z]+"}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{e:"$",r:0}},{b:"\\n\\n",starts:{sL:[],eW:!0}}]}});hljs.registerLanguage("objectivec",function(e){var t={cN:"built_in",b:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},_={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["mm","objc","obj-c"],k:_,l:i,i:"</",c:[t,e.CLCM,e.CBCM,e.CNM,e.QSM,{cN:"string",v:[{b:'@"',e:'"',i:"\\n",c:[e.BE]},{b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"}]},{cN:"meta",b:"#",e:"$",c:[{cN:"meta-string",v:[{b:'"',e:'"'},{b:"<",e:">"}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:i,c:[e.UTM]},{b:"\\."+e.UIR,r:0}]}});hljs.registerLanguage("javascript",function(e){var r="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},n={cN:"subst",b:"\\$\\{",e:"\\}",k:t,c:[]},c={cN:"string",b:"`",e:"`",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:["js","jsx"],k:t,c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\s*/,r:0,c:[{b:r+"\\s*:",rB:!0,r:0,c:[{cN:"attr",b:r,r:0}]}]},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{cN:"function",b:"(\\(.*?\\)|"+r+")\\s*=>",rB:!0,e:"\\s*=>",c:[{cN:"params",v:[{b:r},{b:/\(\s*\)/},{b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b:/</,e:/(\/\w+|\w+\/)>/,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:[{b:/<\w+\s*\/>/,skip:!0},"self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:s}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor",e:/\{/,eE:!0}],i:/#(?!!)/}});hljs.registerLanguage("apache",function(e){var r={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"section",b:"</?",e:">"},{cN:"attribute",b:/\w+/,r:0,k:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"meta",b:"\\s\\[",e:"\\]$"},{cN:"variable",b:"[\\$%]\\{",e:"\\}",c:["self",r]},r,e.QSM]}}],i:/\S/}});hljs.registerLanguage("xml",function(s){var e="[A-Za-z0-9\\._:-]+",t={eW:!0,i:/</,r:0,c:[{cN:"attr",b:e,r:0},{b:/=\s*/,r:0,c:[{cN:"string",endsParent:!0,v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s"'=<>`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},s.C("<!--","-->",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0}]},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{name:"style"},c:[t],starts:{e:"</style>",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{name:"script"},c:[t],starts:{e:"</script>",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"meta",v:[{b:/<\?xml/,e:/\?>/,r:10},{b:/<\?\w+/,e:/\?>/}]},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"name",b:/[^\/><\s]+/,r:0},t]}]}});hljs.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"section",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"quote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"^```w*s*$",e:"^```s*$"},{b:"`.+?`"},{b:"^( {4}|	)",e:"$",r:0}]},{b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:/^\[[^\n]+\]:/,rB:!0,c:[{cN:"symbol",b:/\[/,e:/\]/,eB:!0,eE:!0},{cN:"link",b:/:\s*/,e:/$/,eB:!0}]}]}});hljs.registerLanguage("json",function(e){var i={literal:"true false null"},n=[e.QSM,e.CNM],r={e:",",eW:!0,eE:!0,c:n,k:i},t={b:"{",e:"}",c:[{cN:"attr",b:/"/,e:/"/,c:[e.BE],i:"\\n"},e.inherit(r,{b:/:/})],i:"\\S"},c={b:"\\[",e:"\\]",c:[e.inherit(r)],i:"\\S"};return n.splice(n.length,0,t,c),{c:n,k:i,i:"\\S"}});
\ No newline at end of file
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js
index 30dc282..2964839 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js
@@ -45,7 +45,7 @@
     function(layer) {
     if (layer.results.length > 0) {
       currentLayerDepSelection = layer.results[0];
-      layerDepBtn.click();
+        layerDepBtn.click();
     }
   });
 
@@ -158,6 +158,7 @@
         project_id: libtoaster.ctx.projectId,
         layer_deps: layerDepsCsv,
         local_source_dir: $('#local-dir-path').val(),
+        add_to_project: true,
       };
 
       if ($('input[name=repo]:checked').val() == "git") {
@@ -168,13 +169,15 @@
       }
 
       $.ajax({
-          type: "POST",
-          url: ctx.xhrImportLayerUrl,
-          data: layerData,
+          type: "PUT",
+          url: ctx.xhrLayerUrl,
+          data: JSON.stringify(layerData),
           headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
           success: function (data) {
             if (data.error != "ok") {
               console.log(data.error);
+              /* let the user know why nothing happened */
+              alert(data.error)
             } else {
               createImportedNotification(data);
               window.location.replace(libtoaster.ctx.projectPageUrl);
@@ -243,9 +246,18 @@
         enable_import_btn(true);
       }
 
-      if ($("#git-repo-radio").prop("checked") &&
-          vcsURLInput.val().length > 0 && gitRefInput.val().length > 0) {
-        enable_import_btn(true);
+      if ($("#git-repo-radio").prop("checked")) {
+        if (gitRefInput.val().length > 0 &&
+            gitRefInput.val() == 'HEAD') {
+          $('#invalid-layer-revision-hint').show();
+          $('#layer-revision-ctrl').addClass('has-error');
+          enable_import_btn(false);
+        } else if (vcsURLInput.val().length > 0 &&
+                   gitRefInput.val().length > 0) {
+          $('#invalid-layer-revision-hint').hide();
+          $('#layer-revision-ctrl').removeClass('has-error');
+          enable_import_btn(true);
+        }
       }
     }
 
@@ -332,19 +344,36 @@
     check_form();
   });
 
-  /* Have a guess at the layer name */
+  /* Setup 'blank' typeahead */
+  libtoaster.makeTypeahead(gitRefInput,
+                           ctx.xhrGitRevTypeAheadUrl,
+                           { git_url: null }, function(){});
+
+
   vcsURLInput.focusout(function (){
+    if (!$(this).val())
+      return;
+
     /* If we a layer name specified don't overwrite it or if there isn't a
      * url typed in yet return
      */
-    if (layerNameInput.val() || !$(this).val())
-      return;
-
-    if ($(this).val().search("/")){
+    if (!layerNameInput.val() && $(this).val().search("/")){
       var urlPts = $(this).val().split("/");
+      /* Add a suggestion of the layer name */
       var suggestion = urlPts[urlPts.length-1].replace(".git","");
       layerNameInput.val(suggestion);
     }
+
+    /* Now actually setup the typeahead properly with the git url entered */
+    gitRefInput._typeahead('destroy');
+
+    libtoaster.makeTypeahead(gitRefInput,
+                             ctx.xhrGitRevTypeAheadUrl,
+                             { git_url: $(this).val() },
+                             function(selected){
+                               gitRefInput._typeahead("close");
+                             });
+
   });
 
   function radioDisplay() {
@@ -389,7 +418,7 @@
       var input = $(this);
       var reBeginWithSlash = /^\//;
       var reCheckVariable = /^\$/;
-      var re = /([ <>\\|":\.%\?\*]+)/;
+      var re = /([ <>\\|":%\?\*]+)/;
 
       var invalidDir = re.test(input.val());
       var invalidSlash = reBeginWithSlash.test(input.val());
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
index 86662b7..6f9b5d0 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -274,9 +274,13 @@
   }
 
   function _addRmLayer(layerObj, add, doneCb){
+    if (layerObj.xhrLayerUrl === undefined){
+      throw("xhrLayerUrl is undefined")
+    }
+
     if (add === true) {
       /* If adding get the deps for this layer */
-      libtoaster.getLayerDepsForProject(layerObj.layerdetailurl,
+      libtoaster.getLayerDepsForProject(layerObj.xhrLayerUrl,
         function (layers) {
 
         /* got result for dependencies */
@@ -542,11 +546,9 @@
     }
 
     /*
-     * PrettyPrint plugin.
-     *
+     * highlight plugin.
      */
-    // Init
-    prettyPrint();
+    hljs.initHighlightingOnLoad();
 
     // Prevent invalid links from jumping page scroll
     $('a[href=#]').click(function() {
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/prettify.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/prettify.js
deleted file mode 100755
index eef5ad7..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/prettify.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
-(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
-[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
-f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
-(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
-{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
-t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
-"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
-l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
-q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
-q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
-"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
-a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
-for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
-m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
-a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
-j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
-"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
-H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
-J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
-I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
-["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
-/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
-["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
-hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
-!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
-250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
-PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
index 4536703..21adf81 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
@@ -12,6 +12,8 @@
   var machineChangeFormToggle = $("#change-machine-toggle");
   var machineNameTitle = $("#project-machine-name");
   var machineChangeCancel = $("#cancel-machine-change");
+  var machineInputForm = $("#machine-input-form");
+  var invalidMachineNameHelp = $("#invalid-machine-name-help");
 
   var freqBuildBtn =  $("#freq-build-btn");
   var freqBuildList = $("#freq-build-list");
@@ -208,8 +210,23 @@
 
 
   /* Change machine functionality */
+  machineChangeInput.keyup(function(){
+    if ($(this).val().indexOf(' ') >= 0) {
+        machineChangeBtn.attr("disabled", "disabled");
+        invalidMachineNameHelp.show();
+        machineInputForm.addClass('has-error');
+    } else {
+        machineChangeBtn.removeAttr("disabled");
+        invalidMachineNameHelp.hide();
+        machineInputForm.removeClass('has-error');
+    }
+  });
 
   machineChangeFormToggle.click(function(){
+    machineChangeInput.val(machineNameTitle.text());
+    machineChangeBtn.removeAttr("disabled");
+    invalidMachineNameHelp.hide();
+    machineInputForm.removeClass('has-error');
     machineForm.slideDown();
     machineNameTitle.hide();
     $(this).hide();
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/table.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/table.js
index 176ce57..abcb5ca 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/table.js
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/table.js
@@ -39,6 +39,8 @@
                               ', .show-all-'+ctx.tableName);
 
   function loadData(tableParams){
+    table.trigger("table-loading");
+
     $.ajax({
         type: "GET",
         url: ctx.url,
@@ -200,6 +202,7 @@
     }
 
     /* Add table header and column toggle menu */
+    var column_edit_entries = [];
     for (var i in tableData.columns){
       var col = tableData.columns[i];
       if (col.displayable === false) {
@@ -291,9 +294,17 @@
         defaultHiddenCols.push(col.field_name);
       }
 
-      editColMenu.append(toggler);
+      /* Gather the Edit Column entries */
+      column_edit_entries.push({'title':col.title,'html':toggler});
+
     } /* End for each column */
 
+    /* Append the sorted Edit Column toggler entries */
+    column_edit_entries.sort(function(a,b) {return (a.title > b.title) ? 1 : ((b.title > a.title) ? -1 : 0);} );
+    for (var col in column_edit_entries){
+      editColMenu.append(column_edit_entries[col].html);
+    }
+
     tableChromeDone = true;
   }
 
@@ -835,4 +846,12 @@
 
     $('#filter-modal-'+ctx.tableName).modal('hide');
   });
+
+  table.on("table-loading", function(){
+    table.css("opacity", 0.5);
+  });
+
+  table.on("table-done", function(){
+    table.css("opacity", 1);
+  })
 }
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js
index d7953de..4a4c83f 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js
@@ -5,6 +5,7 @@
 QUnit.test("Layer alert notification", function(assert) {
   var layer = {
     "layerdetailurl":"/toastergui/project/1/layer/22",
+    "xhrLayerUrl":"/toastergui/xhr_layer/1/9",
     "vcs_url":"git://example.com/example.git",
     "detail":"[ git://example.com/example.git | master ]",
     "vcs_reference":"master",
@@ -15,6 +16,7 @@
   var layerDepsList = [
     {
     "layerdetailurl":"/toastergui/project/1/layer/9",
+    "xhrLayerUrl":"/toastergui/xhr_layer/1/9",
     "vcs_url":"git://example.com/example.git",
     "detail":"[ git://example.com/example.git | master ]",
     "vcs_reference":"master",
@@ -23,6 +25,7 @@
     },
     {
     "layerdetailurl":"/toastergui/project/1/layer/9",
+    "xhrLayerUrl":"/toastergui/xhr_layer/1/9",
     "vcs_url":"git://example.com/example.git",
     "detail":"[ git://example.com/example.git | master ]",
     "vcs_reference":"master",
@@ -66,7 +69,8 @@
 var layer = {
   "id": 1,
   "name":  "meta-testing",
-  "layerdetailurl": "/toastergui/project/1/layer/1"
+  "layerdetailurl": "/toastergui/project/1/layer/1",
+  "xhrLayerUrl": "/toastergui/xhr_layer/1/1"
 };
 
 QUnit.test("Add layer", function(assert){
@@ -144,7 +148,7 @@
 /* Page init functions */
 
 QUnit.test("Import layer page init", function(assert){
-  assert.throws(importLayerPageInit());
+  assert.throws(importLayerPageInit({ xhrGitRevTypeAheadUrl: "url" }));
 });
 
 QUnit.test("Project page init", function(assert){
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html
index 496dd6e..32b4979 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html
@@ -24,7 +24,7 @@
     </script>
     <script src="{% static 'js/jsrender.min.js' %}">
     </script>
-    <script src="{% static 'js/prettify.js' %}">
+    <script src="{% static 'js/highlight.pack.js' %}">
     </script>
     <script src="{% static 'js/libtoaster.js' %}">
     </script>
@@ -100,7 +100,8 @@
         <div class="collapse navbar-collapse" id="global-nav">
             <ul class="nav navbar-nav">
             {% if request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %}
-              <li {% if request.resolver_match.url_name == 'all-builds' %}
+              <li id="navbar-all-builds"
+              {% if request.resolver_match.url_name == 'all-builds' %}
               class="active"
               {% endif %}>
               <a href="{% url 'all-builds' %}">
@@ -108,7 +109,8 @@
                 All builds
               </a>
               </li>
-              <li {% if request.resolver_match.url_name == 'all-projects'  %}
+              <li id="navbar-all-projects"
+              {% if request.resolver_match.url_name == 'all-projects'  %}
               class="active"
               {% endif %}>
               <a href="{% url 'all-projects' %}">
@@ -117,7 +119,7 @@
               </a>
               </li>
             {% endif %}
-              <li>
+              <li id="navbar-docs">
               <a target="_blank" href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html">
                 <i class="glyphicon glyphicon-book"></i>
                 Documentation
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
index f5eee96..a41911f 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
@@ -132,16 +132,16 @@
           {% endif %}
           <li class="nav-header">Build</li>
             <li id="menu-configuration"><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
-            <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
-            <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
-            <li><a href="{% url 'packages' build.pk %}">Packages</a></li>
+            <li id="menu-tasks"><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+            <li id="menu-recipes"><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+            <li id="menu-packages"><a href="{% url 'packages' build.pk %}">Packages</a></li>
             <li class="nav-header">Performance</li>
-            <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
-            <li><a href="{% url 'cputime' build.pk %}">CPU usage</a></li>
-            <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+            <li id="menu-time"><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+            <li id="menu-cpu-time"><a href="{% url 'cputime' build.pk %}">CPU usage</a></li>
+            <li id="menu-disk-io"><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
 
           <li class="nav-header">Actions</li>
-          <li>
+          <li id="menu-download-build-log">
             <a href="{% url 'build_artifact' build.id 'cookerlog' build.id %}">
               <span class="glyphicon glyphicon-download-alt"></span>
             Download build log
@@ -151,7 +151,7 @@
           {% with build.get_custom_image_recipes as custom_image_recipes %}
             {% if custom_image_recipes.count > 0 %}
               <!-- edit custom image built during this build -->
-              <li>
+              <li id="menu-edit-custom-image">
                 <a href="#" data-role="edit-custom-image-trigger">
                   <span class="glyphicon glyphicon-edit"></span>
                   Edit custom image
@@ -186,7 +186,7 @@
 
             <!-- new custom image from image recipe in this build -->
             {% if build.has_image_recipes %}
-            <li>
+            <li id="menu-new-custom-image">
               <a href="#"  data-role="new-custom-image-trigger">
                 <span class="glyphicon glyphicon-plus"></span>
                 New custom image
@@ -216,7 +216,7 @@
               </script>
             {% endif %}
 
-            <li>
+            <li  id="menu-delete-build">
             <a href="#delete-build-modal" id="delete-build" data-toggle="modal" data-target="#delete-build-modal" class="text-danger">
               <span class="glyphicon glyphicon-trash"></span>
               Delete build
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/importlayer.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/importlayer.html
index 1f42696..97d52c7 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/importlayer.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/importlayer.html
@@ -13,7 +13,8 @@
   <script>
   $(document).ready(function (){
     var ctx = {
-      xhrImportLayerUrl : "{% url 'xhr_importlayer' %}",
+      xhrLayerUrl : "{% url 'xhr_layer' project.id %}",
+      xhrGitRevTypeAheadUrl : "{% url 'xhr_gitrevtypeahead' %}",
     };
 
     try {
@@ -112,8 +113,10 @@
           Git revision
           <span class="glyphicon glyphicon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span>
         </label>
-        <input type="text" class="form-control" id="layer-git-ref" required>
-        <span class="help-inline" style="display:none;" id="invalid-layer-revision-hint"></span>
+        <span style="display: block">
+        <input type="text" class="form-control" id="layer-git-ref" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" required>
+        </span>
+        <span class="help-block has-error" style="display:none;" id="invalid-layer-revision-hint">The "HEAD" branch is reserved (only allowed for the "Local Yocto Project" layers)</span>
       </div>
     </fieldset>
 
@@ -123,7 +126,7 @@
         <label for="local-dir-path" class="control-label">Enter the absolute path to the layer directory</label>
         <input type="text" class="form-control" id="local-dir-path" required/>
         <p class="help-block" id="hintError-dir-path-starts-with-slash" style="display:none;">The absolute path must start with "/".</p>
-        <p class="help-block" id="hintError-dir-path" style="display:none;">The directory path cannot include spaces or any of these characters: . \ ? % * : | " " &lt; &gt;</p>
+        <p class="help-block" id="hintError-dir-path" style="display:none;">The directory path cannot include spaces or any of these characters: \ ? % * : | " " &lt; &gt;</p>
       </div>
     </fieldset>
 
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html
index 94ad4f8..ca24896 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html
@@ -14,7 +14,7 @@
 <script src="{% static 'js/bootstrap.min.js' %}"></script>
 <script src="{% static 'js/filtersnippet.js' %}"></script>
 <script src="{% static 'js/importlayer.js' %}"></script>
-<script src="{% static 'js/prettify.js' %}"></script>
+<script src="{% static 'js/highlight.pack.js' %}"></script>
 <script src="{% static 'js/layerBtn.js' %}"></script>
 <script src="{% static 'js/layerDepsModal.js' %}"></script>
 <script src="{% static 'js/projectpage.js' %}"></script>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html
index b2f73eb..1580991 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html
@@ -1,4 +1,9 @@
-<a class="btn btn-danger btn-block layer-exists-{{data.pk}} layerbtn"  data-layer='{ "id": {{data.pk}}, "name":  "{{data.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.pk%}"}' data-directive="remove"
+<a class="btn btn-danger btn-block layer-exists-{{data.pk}} layerbtn"  data-layer='{
+   "id": {{data.pk}},
+   "name":  "{{data.layer.name}}",
+   "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.pk %}",
+   "layerdetailurl": "{% url 'layerdetails' extra.pid data.pk %}"
+   }' data-directive="remove"
     {% if data.pk not in extra.current_layers %}
     style="display:none;"
     {% endif %}
@@ -6,7 +11,12 @@
   <span class="glyphicon glyphicon-trash"></span>
   Remove layer
 </a>
-<a class="btn btn-default btn-block layer-add-{{data.pk}} layerbtn" data-layer='{ "id": {{data.pk}}, "name":  "{{data.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.pk%}"}' data-directive="add"
+<a class="btn btn-default btn-block layer-add-{{data.pk}} layerbtn"
+   data-layer='{ "id": {{data.pk}},
+   "name":  "{{data.layer.name}}",
+   "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.pk %}",
+   "layerdetailurl": "{%url "layerdetails" extra.pid data.pk %}"
+   }' data-directive="add"
     {% if data.pk in extra.current_layers %}
     style="display:none;"
     {% endif %}
@@ -14,4 +24,3 @@
   <span class="glyphicon glyphicon-plus"></span>
   Add layer
 </a>
-
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html
index f1569bd..e0069db 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html
@@ -71,6 +71,7 @@
           inCurrentPrj : false,
           {% endif %}
           layerdetailurl : "{% url 'layerdetails' project.id layerversion.id  %}",
+          xhrLayerUrl: "{% url 'xhr_layer' project.id layerversion.id  %}",
           layer_source: {{layerversion.layer_source|json}},
         },
         layerSourceTypes: {{layer_source|json}},
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html
index 5d93d7a..6debe65 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html
@@ -4,7 +4,12 @@
     {% endif %}
 >
   Select machine</a>
-<a class="btn btn-default btn-block layerbtn layer-add-{{data.layer_version.id}}" data-layer='{ "id": {{data.layer_version.id}}, "name":  "{{data.layer_version.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.id %}"}' data-directive="add"
+<a class="btn btn-default btn-block layerbtn
+layer-add-{{data.layer_version.id}}" data-layer='{ "id":
+   {{data.layer_version.id}}, "name":  "{{data.layer_version.layer.name}}",
+   "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.id %}",
+   "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.layer_version.id %}"
+   }' data-directive="add"
     {% if data.layer_version.pk in extra.current_layers %}
     style="display:none;"
     {% endif %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/project.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/project.html
index 5abe241..ab7e665 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/project.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/project.html
@@ -67,11 +67,12 @@
 
       <form id="select-machine-form" style="display:none;" class="form-inline">
         <span class="help-block">Machine suggestions come from the list of layers added to your project. If you don't see the machine you are looking for, <a href="{% url 'projectmachines' project.id %}">check the full list of machines</a></span>
-        <div class="form-group">
+        <div class="form-group" id="machine-input-form">
           <input class="form-control" id="machine-change-input" autocomplete="off" value="" data-provide="typeahead" data-minlength="1" data-autocomplete="off" type="text">
         </div>
         <button id="machine-change-btn" class="btn btn-default" type="button">Save</button>
         <a href="#" id="cancel-machine-change" class="btn btn-link">Cancel</a>
+        <span class="help-block text-danger" id="invalid-machine-name-help" style="display:none">A valid machine name cannot include spaces.</span>
         <p class="form-link"><a href="{% url 'projectmachines' project.id %}">View compatible machines</a></p>
       </form>
     </div>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectconf.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectconf.html
index fcf6df2..933c588 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectconf.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectconf.html
@@ -41,7 +41,7 @@
       </div>
       <button id="apply-change-dl_dir" class="btn btn-default" type="button">Save</button>
       <button id="cancel-change-dl_dir" type="button" class="btn btn-link">Cancel</button>
-      <p class="help-block" id="hintError-dl_dir" style="display:none;">The directory path cannot include spaces or any of these characters: . \ ? % * : | " " &lt; &gt;</p>
+      <p class="help-block" id="hintError-dl_dir" style="display:none;">The directory path cannot include spaces or any of these characters: \ ? % * : | " " &lt; &gt;</p>
       <p class="help-block" id="hintError-initialChar-dl_dir" style="display:none;">The directory path should either start with a /, e.g. /home/toaster/downloads; or with a variable, e.g. ${TOPDIR}/downloads.</p>
     </form>
     </dd>
@@ -63,6 +63,7 @@
         <button id="cancel-change-image_fstypes" type="button" class="btn btn-link">Cancel</button>
       </div>
       <p class="help-block text-danger" style="display:none;" id="hintError-image-fs_type">A valid image type cannot include underscores</p>
+      <p class="help-block text-danger" style="display:none;" id="fstypes-error-message">You must select at least one image type</p>
       <label>Or choose from known image types:</label>
       <input id="filter-image_fstypes" type="text" placeholder="Search image types" class="form-control">
       <div id="all-image_fstypes" class="scrolling"></div>
@@ -150,7 +151,7 @@
       </div>
       <button id="apply-change-sstate_dir" class="btn btn-default" type="button">Save</button>
       <button id="cancel-change-sstate_dir" type="button" class="btn btn-link">Cancel</button>
-      <p class="help-block" id="hintError-sstate_dir" style="display:none;">The directory path cannot include spaces or any of these characters: . \ ? % * : | " " &lt; &gt;</p>
+      <p class="help-block" id="hintError-sstate_dir" style="display:none;">The directory path cannot include spaces or any of these characters: \ ? % * : | " " &lt; &gt;</p>
       <p class="help-block" id="hintError-initialChar-sstate_dir" style="display:none;">The directory path should either start with a /, e.g. /home/toaster/sstate-cache; or with a variable, e.g. ${TOPDIR}/sstate-cache.</p>
     </form>
     </dd>
@@ -593,7 +594,7 @@
       var input = $(this);
       var reBeginWithSlash = /^\//;
       var reCheckVariable = /^\$/;
-      var re = /([ <>\\|":\.%\?\*]+)/;
+      var re = /([ <>\\|":%\?\*]+)/;
       var invalidDir = re.test(input.val());
       var invalidSlash = reBeginWithSlash.test(input.val());
       var invalidVar = reCheckVariable.test(input.val());
@@ -716,8 +717,10 @@
     }
     if ($('#new-imagefs_types').val().length === 0) {
       $("#apply-change-image_fstypes").prop("disabled", true);
+      $('#fstypes-error-message').show();
     } else {
       $("#apply-change-image_fstypes").prop("disabled", false);
+      $('#fstypes-error-message').hide();
     }
   });
 
@@ -958,7 +961,7 @@
       var input = $(this);
       var reBeginWithSlash = /^\//;
       var reCheckVariable = /^\$/;
-      var re = /([ <>\\|":\.%\?\*]+)/;
+      var re = /([ <>\\|":%\?\*]+)/;
       var invalidDir = re.test(input.val());
       var invalidSlash = reBeginWithSlash.test(input.val());
       var invalidVar = reCheckVariable.test(input.val());
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
index e372964..0ee0ba5 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
@@ -5,7 +5,13 @@
  >
   Build recipe
 </a>
-<a class="btn btn-default btn-block layerbtn layer-add-{{data.layer_version.pk}}" data-layer='{ "id": {{data.layer_version.pk}}, "name":  "{{data.layer_version.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.pk%}"}' data-directive="add"
+<a class="btn btn-default btn-block layerbtn layer-add-{{data.layer_version.pk}}" 
+  data-layer='{
+  "id": {{data.layer_version.pk}},
+  "name":  "{{data.layer_version.layer.name}}",
+  "layerdetailurl": "{%url "layerdetails" extra.pid data.layer_version.pk%}",
+   "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.layer_version.pk %}"
+   }' data-directive="add"
     {% if data.layer_version.pk in extra.current_layers %}
      style="display:none;"
     {% endif %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tests.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tests.py
deleted file mode 100644
index 2b5894f..0000000
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tests.py
+++ /dev/null
@@ -1,540 +0,0 @@
-#! /usr/bin/env python
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# BitBake Toaster Implementation
-#
-# Copyright (C) 2013-2015 Intel Corporation
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-"""Test cases for Toaster GUI and ReST."""
-
-from django.test import TestCase
-from django.test.client import RequestFactory
-from django.core.urlresolvers import reverse
-from django.utils import timezone
-from django.db.models import Q
-
-from orm.models import Project, Release, BitbakeVersion, Package, LogMessage
-from orm.models import LayerSource, Layer, Build
-from orm.models import Layer_Version, Recipe, Machine, ProjectLayer, Target
-from orm.models import CustomImageRecipe, ProjectVariable
-from orm.models import CustomImagePackage
-
-import toastermain
-import inspect
-import toastergui
-
-from toastergui.tables import SoftwareRecipesTable
-import json
-from datetime import timedelta
-from bs4 import BeautifulSoup
-import re
-import string
-import json
-
-PROJECT_NAME = "test project"
-PROJECT_NAME2 = "test project 2"
-CLI_BUILDS_PROJECT_NAME = 'Command line builds'
-
-class ViewTests(TestCase):
-    """Tests to verify view APIs."""
-
-    fixtures = ['toastergui-unittest-data']
-
-    def setUp(self):
-
-        self.project = Project.objects.first()
-        self.recipe1 = Recipe.objects.get(pk=2)
-        self.customr = CustomImageRecipe.objects.first()
-        self.cust_package = CustomImagePackage.objects.first()
-        self.package = Package.objects.first()
-        self.lver = Layer_Version.objects.first()
-
-    def test_get_base_call_returns_html(self):
-        """Basic test for all-projects view"""
-        response = self.client.get(reverse('all-projects'), follow=True)
-        self.assertEqual(response.status_code, 200)
-        self.assertTrue(response['Content-Type'].startswith('text/html'))
-        self.assertTemplateUsed(response, "projects-toastertable.html")
-
-    def test_get_json_call_returns_json(self):
-        """Test for all projects output in json format"""
-        url = reverse('all-projects')
-        response = self.client.get(url, {"format": "json"}, follow=True)
-        self.assertEqual(response.status_code, 200)
-        self.assertTrue(response['Content-Type'].startswith('application/json'))
-
-        data = json.loads(response.content.decode('utf-8'))
-
-        self.assertTrue("error" in data)
-        self.assertEqual(data["error"], "ok")
-        self.assertTrue("rows" in data)
-
-        name_found = False
-        for row in data["rows"]:
-            name_found = row['name'].find(self.project.name)
-
-        self.assertTrue(name_found,
-                        "project name not found in projects table")
-
-    def test_typeaheads(self):
-        """Test typeahead ReST API"""
-        layers_url = reverse('xhr_layerstypeahead', args=(self.project.id,))
-        prj_url = reverse('xhr_projectstypeahead')
-
-        urls = [layers_url,
-                prj_url,
-                reverse('xhr_recipestypeahead', args=(self.project.id,)),
-                reverse('xhr_machinestypeahead', args=(self.project.id,)),
-               ]
-
-        def basic_reponse_check(response, url):
-            """Check data structure of http response."""
-            self.assertEqual(response.status_code, 200)
-            self.assertTrue(response['Content-Type'].startswith('application/json'))
-
-            data = json.loads(response.content.decode('utf-8'))
-
-            self.assertTrue("error" in data)
-            self.assertEqual(data["error"], "ok")
-            self.assertTrue("results" in data)
-
-            # We got a result so now check the fields
-            if len(data['results']) > 0:
-                result = data['results'][0]
-
-                self.assertTrue(len(result['name']) > 0)
-                self.assertTrue("detail" in result)
-                self.assertTrue(result['id'] > 0)
-
-                # Special check for the layers typeahead's extra fields
-                if url == layers_url:
-                    self.assertTrue(len(result['layerdetailurl']) > 0)
-                    self.assertTrue(len(result['vcs_url']) > 0)
-                    self.assertTrue(len(result['vcs_reference']) > 0)
-                # Special check for project typeahead extra fields
-                elif url == prj_url:
-                    self.assertTrue(len(result['projectPageUrl']) > 0)
-
-                return True
-
-            return False
-
-
-        for url in urls:
-            results = False
-
-            for typeing in list(string.ascii_letters):
-                response = self.client.get(url, {'search': typeing})
-                results = basic_reponse_check(response, url)
-                if results:
-                    break
-
-            # After "typeing" the alpabet we should have result true
-            # from each of the urls
-            self.assertTrue(results)
-
-    def test_xhr_import_layer(self):
-        """Test xhr_importlayer API"""
-        #Test for importing an already existing layer
-        args = {'vcs_url' : "git://git.example.com/test",
-                'name' : "base-layer",
-                'git_ref': "c12b9596afd236116b25ce26dbe0d793de9dc7ce",
-                'project_id': self.project.id,
-                'local_source_dir': "",
-                'dir_path' : "/path/in/repository"}
-        response = self.client.post(reverse('xhr_importlayer'), args)
-        data = json.loads(response.content.decode('utf-8'))
-        self.assertEqual(response.status_code, 200)
-        self.assertEqual(data["error"], "ok")
-
-        #Test to verify import of a layer successful
-        args['name'] = "meta-oe"
-        response = self.client.post(reverse('xhr_importlayer'), args)
-        data = json.loads(response.content.decode('utf-8'))
-        self.assertTrue(data["error"], "ok")
-
-        #Test for html tag in the data
-        args['<'] = "testing html tag"
-        response = self.client.post(reverse('xhr_importlayer'), args)
-        data = json.loads(response.content.decode('utf-8'))
-        self.assertNotEqual(data["error"], "ok")
-
-        #Empty data passed
-        args = {}
-        response = self.client.post(reverse('xhr_importlayer'), args)
-        data = json.loads(response.content.decode('utf-8'))
-        self.assertNotEqual(data["error"], "ok")
-
-    def test_custom_ok(self):
-        """Test successful return from ReST API xhr_customrecipe"""
-        url = reverse('xhr_customrecipe')
-        params = {'name': 'custom', 'project': self.project.id,
-                  'base': self.recipe1.id}
-        response = self.client.post(url, params)
-        self.assertEqual(response.status_code, 200)
-        data = json.loads(response.content.decode('utf-8'))
-        self.assertEqual(data['error'], 'ok')
-        self.assertTrue('url' in data)
-        # get recipe from the database
-        recipe = CustomImageRecipe.objects.get(project=self.project,
-                                               name=params['name'])
-        args = (self.project.id, recipe.id,)
-        self.assertEqual(reverse('customrecipe', args=args), data['url'])
-
-    def test_custom_incomplete_params(self):
-        """Test not passing all required parameters to xhr_customrecipe"""
-        url = reverse('xhr_customrecipe')
-        for params in [{}, {'name': 'custom'},
-                       {'name': 'custom', 'project': self.project.id}]:
-            response = self.client.post(url, params)
-            self.assertEqual(response.status_code, 200)
-            data = json.loads(response.content.decode('utf-8'))
-            self.assertNotEqual(data["error"], "ok")
-
-    def test_xhr_custom_wrong_project(self):
-        """Test passing wrong project id to xhr_customrecipe"""
-        url = reverse('xhr_customrecipe')
-        params = {'name': 'custom', 'project': 0, "base": self.recipe1.id}
-        response = self.client.post(url, params)
-        self.assertEqual(response.status_code, 200)
-        data = json.loads(response.content.decode('utf-8'))
-        self.assertNotEqual(data["error"], "ok")
-
-    def test_xhr_custom_wrong_base(self):
-        """Test passing wrong base recipe id to xhr_customrecipe"""
-        url = reverse('xhr_customrecipe')
-        params = {'name': 'custom', 'project': self.project.id, "base": 0}
-        response = self.client.post(url, params)
-        self.assertEqual(response.status_code, 200)
-        data = json.loads(response.content.decode('utf-8'))
-        self.assertNotEqual(data["error"], "ok")
-
-    def test_xhr_custom_details(self):
-        """Test getting custom recipe details"""
-        url = reverse('xhr_customrecipe_id', args=(self.customr.id,))
-        response = self.client.get(url)
-        self.assertEqual(response.status_code, 200)
-        expected = {"error": "ok",
-                    "info": {'id': self.customr.id,
-                             'name': self.customr.name,
-                             'base_recipe_id': self.recipe1.id,
-                             'project_id': self.project.id,
-                            }
-                   }
-        self.assertEqual(json.loads(response.content.decode('utf-8')), expected)
-
-    def test_xhr_custom_del(self):
-        """Test deleting custom recipe"""
-        name = "to be deleted"
-        recipe = CustomImageRecipe.objects.create(\
-                     name=name, project=self.project,
-                     base_recipe=self.recipe1,
-                     file_path="/tmp/testing",
-                     layer_version=self.customr.layer_version)
-        url = reverse('xhr_customrecipe_id', args=(recipe.id,))
-        response = self.client.delete(url)
-        self.assertEqual(response.status_code, 200)
-
-        gotoUrl = reverse('projectcustomimages', args=(self.project.pk,))
-
-        self.assertEqual(json.loads(response.content.decode('utf-8')),
-                         {"error": "ok",
-                          "gotoUrl": gotoUrl})
-
-        # try to delete not-existent recipe
-        url = reverse('xhr_customrecipe_id', args=(recipe.id,))
-        response = self.client.delete(url)
-        self.assertEqual(response.status_code, 200)
-        self.assertNotEqual(json.loads(response.content.decode('utf-8'))["error"], "ok")
-
-    def test_xhr_custom_packages(self):
-        """Test adding and deleting package to a custom recipe"""
-        # add self.package to recipe
-        response = self.client.put(reverse('xhr_customrecipe_packages',
-                                           args=(self.customr.id,
-                                                 self.cust_package.id)))
-
-        self.assertEqual(response.status_code, 200)
-        self.assertEqual(json.loads(response.content.decode('utf-8')),
-                         {"error": "ok"})
-        self.assertEqual(self.customr.appends_set.first().name,
-                         self.cust_package.name)
-        # delete it
-        to_delete = self.customr.appends_set.first().pk
-        del_url = reverse('xhr_customrecipe_packages',
-                          args=(self.customr.id, to_delete))
-
-        response = self.client.delete(del_url)
-        self.assertEqual(response.status_code, 200)
-        self.assertEqual(json.loads(response.content.decode('utf-8')), {"error": "ok"})
-        all_packages = self.customr.get_all_packages().values_list('pk',
-                                                                   flat=True)
-
-        self.assertFalse(to_delete in all_packages)
-        # delete invalid package to test error condition
-        del_url = reverse('xhr_customrecipe_packages',
-                          args=(self.customr.id,
-                                99999))
-
-        response = self.client.delete(del_url)
-        self.assertEqual(response.status_code, 200)
-        self.assertNotEqual(json.loads(response.content.decode('utf-8'))["error"], "ok")
-
-    def test_xhr_custom_packages_err(self):
-        """Test error conditions of xhr_customrecipe_packages"""
-        # test calls with wrong recipe id and wrong package id
-        for args in [(0, self.package.id), (self.customr.id, 0)]:
-            url = reverse('xhr_customrecipe_packages', args=args)
-            # test put and delete methods
-            for method in (self.client.put, self.client.delete):
-                response = method(url)
-                self.assertEqual(response.status_code, 200)
-                self.assertNotEqual(json.loads(response.content.decode('utf-8')),
-                                    {"error": "ok"})
-
-    def test_download_custom_recipe(self):
-        """Download the recipe file generated for the custom image"""
-
-        # Create a dummy recipe file for the custom image generation to read
-        open("/tmp/a_recipe.bb", 'a').close()
-        response = self.client.get(reverse('customrecipedownload',
-                                           args=(self.project.id,
-                                                 self.customr.id)))
-
-        self.assertEqual(response.status_code, 200)
-
-    def test_software_recipes_table(self):
-        """Test structure returned for Software RecipesTable"""
-        table = SoftwareRecipesTable()
-        request = RequestFactory().get('/foo/', {'format': 'json'})
-        response = table.get(request, pid=self.project.id)
-        data = json.loads(response.content.decode('utf-8'))
-
-        recipes = Recipe.objects.filter(Q(is_image=False))
-        self.assertTrue(len(recipes) > 1,
-                        "Need more than one software recipe to test "
-                        "SoftwareRecipesTable")
-
-        recipe1 = recipes[0]
-        recipe2 = recipes[1]
-
-        rows = data['rows']
-        row1 = next(x for x in rows if x['name'] == recipe1.name)
-        row2 = next(x for x in rows if x['name'] == recipe2.name)
-
-        self.assertEqual(response.status_code, 200, 'should be 200 OK status')
-
-        # check other columns have been populated correctly
-        self.assertTrue(recipe1.name in row1['name'])
-        self.assertTrue(recipe1.version in row1['version'])
-        self.assertTrue(recipe1.description in
-                        row1['get_description_or_summary'])
-
-        self.assertTrue(recipe1.layer_version.layer.name in
-                        row1['layer_version__layer__name'])
-
-        self.assertTrue(recipe2.name in row2['name'])
-        self.assertTrue(recipe2.version in row2['version'])
-        self.assertTrue(recipe2.description in
-                        row2['get_description_or_summary'])
-
-        self.assertTrue(recipe2.layer_version.layer.name in
-                        row2['layer_version__layer__name'])
-
-    def test_toaster_tables(self):
-        """Test all ToasterTables instances"""
-
-        def get_data(table, options={}):
-            """Send a request and parse the json response"""
-            options['format'] = "json"
-            options['nocache'] = "true"
-            request = RequestFactory().get('/', options)
-
-            # This is the image recipe needed for a package list for
-            # PackagesTable do this here to throw a non exist exception
-            image_recipe = Recipe.objects.get(pk=4)
-
-            # Add any kwargs that are needed by any of the possible tables
-            args = {'pid': self.project.id,
-                    'layerid': self.lver.pk,
-                    'recipeid': self.recipe1.pk,
-                    'recipe_id': image_recipe.pk,
-                    'custrecipeid': self.customr.pk,
-                    'build_id': 1,
-                    'target_id': 1}
-
-            response = table.get(request, **args)
-            return json.loads(response.content.decode('utf-8'))
-
-        def get_text_from_td(td):
-            """If we have html in the td then extract the text portion"""
-            # just so we don't waste time parsing non html
-            if "<" not in td:
-                ret = td
-            else:
-                ret = BeautifulSoup(td, "html.parser").text
-
-            if len(ret):
-                return "0"
-            else:
-                return ret
-
-        # Get a list of classes in tables module
-        tables = inspect.getmembers(toastergui.tables, inspect.isclass)
-        tables.extend(inspect.getmembers(toastergui.buildtables,
-                                         inspect.isclass))
-
-        for name, table_cls in tables:
-            # Filter out the non ToasterTables from the tables module
-            if not issubclass(table_cls, toastergui.widgets.ToasterTable) or \
-                table_cls == toastergui.widgets.ToasterTable or \
-               'Mixin' in name:
-                continue
-
-            # Get the table data without any options, this also does the
-            # initialisation of the table i.e. setup_columns,
-            # setup_filters and setup_queryset that we can use later
-            table = table_cls()
-            all_data = get_data(table)
-
-            self.assertTrue(len(all_data['rows']) > 1,
-                            "Cannot test on a %s table with < 1 row" % name)
-
-            if table.default_orderby:
-                row_one = get_text_from_td(
-                    all_data['rows'][0][table.default_orderby.strip("-")])
-                row_two = get_text_from_td(
-                    all_data['rows'][1][table.default_orderby.strip("-")])
-
-                if '-' in table.default_orderby:
-                    self.assertTrue(row_one >= row_two,
-                                    "Default ordering not working on %s"
-                                    " '%s' should be >= '%s'" %
-                                    (name, row_one, row_two))
-                else:
-                    self.assertTrue(row_one <= row_two,
-                                    "Default ordering not working on %s"
-                                    " '%s' should be <= '%s'" %
-                                    (name, row_one, row_two))
-
-            # Test the column ordering and filtering functionality
-            for column in table.columns:
-                if column['orderable']:
-                    # If a column is orderable test it in both order
-                    # directions ordering on the columns field_name
-                    ascending = get_data(table_cls(),
-                                         {"orderby": column['field_name']})
-
-                    row_one = get_text_from_td(
-                        ascending['rows'][0][column['field_name']])
-                    row_two = get_text_from_td(
-                        ascending['rows'][1][column['field_name']])
-
-                    self.assertTrue(row_one <= row_two,
-                                    "Ascending sort applied but row 0: \"%s\""
-                                    " is less than row 1: \"%s\" "
-                                    "%s %s " %
-                                    (row_one, row_two,
-                                     column['field_name'], name))
-
-                    descending = get_data(table_cls(),
-                                          {"orderby":
-                                           '-'+column['field_name']})
-
-                    row_one = get_text_from_td(
-                        descending['rows'][0][column['field_name']])
-                    row_two = get_text_from_td(
-                        descending['rows'][1][column['field_name']])
-
-                    self.assertTrue(row_one >= row_two,
-                                    "Descending sort applied but row 0: %s"
-                                    "is greater than row 1: %s"
-                                    "field %s table %s" %
-                                    (row_one,
-                                     row_two,
-                                     column['field_name'], name))
-
-                    # If the two start rows are the same we haven't actually
-                    # changed the order
-                    self.assertNotEqual(ascending['rows'][0],
-                                        descending['rows'][0],
-                                        "An orderby %s has not changed the "
-                                        "order of the data in table %s" %
-                                        (column['field_name'], name))
-
-                if column['filter_name']:
-                    # If a filter is available for the column get the filter
-                    # info. This contains what filter actions are defined.
-                    filter_info = get_data(table_cls(),
-                                           {"cmd": "filterinfo",
-                                            "name": column['filter_name']})
-                    self.assertTrue(len(filter_info['filter_actions']) > 0,
-                                    "Filter %s was defined but no actions "
-                                    "added to it" % column['filter_name'])
-
-                    for filter_action in filter_info['filter_actions']:
-                        # filter string to pass as the option
-                        # This is the name of the filter:action
-                        # e.g. project_filter:not_in_project
-                        filter_string = "%s:%s" % (column['filter_name'],
-                                                   filter_action['action_name'])
-                        # Now get the data with the filter applied
-                        filtered_data = get_data(table_cls(),
-                                                 {"filter" : filter_string})
-
-                        # date range filter actions can't specify the
-                        # number of results they return, so their count is 0
-                        if filter_action['count'] != None:
-                            self.assertEqual(len(filtered_data['rows']),
-                                             int(filter_action['count']),
-                                             "We added a table filter for %s but "
-                                             "the number of rows returned was not "
-                                             "what the filter info said there "
-                                             "would be" % name)
-
-
-            # Test search functionality on the table
-            something_found = False
-            for search in list(string.ascii_letters):
-                search_data = get_data(table_cls(), {'search' : search})
-
-                if len(search_data['rows']) > 0:
-                    something_found = True
-                    break
-
-            self.assertTrue(something_found,
-                            "We went through the whole alphabet and nothing"
-                            " was found for the search of table %s" % name)
-
-            # Test the limit functionality on the table
-            limited_data = get_data(table_cls(), {'limit' : "1"})
-            self.assertEqual(len(limited_data['rows']),
-                             1,
-                             "Limit 1 set on table %s but not 1 row returned"
-                             % name)
-
-            # Test the pagination functionality on the table
-            page_one_data = get_data(table_cls(), {'limit' : "1",
-                                                   "page": "1"})['rows'][0]
-
-            page_two_data = get_data(table_cls(), {'limit' : "1",
-                                                   "page": "2"})['rows'][0]
-
-            self.assertNotEqual(page_one_data,
-                                page_two_data,
-                                "Changed page on table %s but first row is the "
-                                "same as the previous page" % name)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py
index 4ded9ac..58c650f 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py
@@ -16,15 +16,17 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+import subprocess
+
 from toastergui.widgets import ToasterTypeAhead
 from orm.models import Project
 from django.core.urlresolvers import reverse
+from django.core.cache import cache
+
 
 class LayersTypeAhead(ToasterTypeAhead):
     """ Typeahead for layers available and not added in the current project's
     configuration """
-    def __init__(self):
-      super(LayersTypeAhead, self).__init__()
 
     def apply_search(self, search_term, prj, request):
         layers = prj.get_all_compatible_layer_versions()
@@ -33,13 +35,15 @@
         # Unlike the other typeaheads we also don't want to show suggestions
         # for layers already in the project unless required such as when adding
         # layerdeps to a new layer.
-        if ("include_added" in request.GET and
-                request.GET['include_added'] != "true"):
+        if "include_added" in request.GET and \
+           request.GET['include_added'] != "true":
             layers = layers.exclude(
                 pk__in=prj.get_project_layer_versions(pk=True))
 
         primary_results = layers.filter(layer__name__istartswith=search_term)
-        secondary_results = layers.filter(layer__name__icontains=search_term).exclude(pk__in=primary_results)
+        secondary_results = layers.filter(
+            layer__name__icontains=search_term).exclude(
+                pk__in=primary_results)
 
         results = []
 
@@ -49,99 +53,129 @@
             detail = "[ %s | %s ]" % (layer_version.layer.vcs_url,
                                       vcs_reference)
             needed_fields = {
-                'id' : layer_version.pk,
-                'name' : layer_version.layer.name,
-                'layerdetailurl' : layer_version.get_detailspage_url(prj.pk),
-                'vcs_url' : layer_version.layer.vcs_url,
-                'vcs_reference' : vcs_reference,
-                'detail' : detail,
-                'local_source_dir' : layer_version.layer.local_source_dir,
+                'id': layer_version.pk,
+                'name': layer_version.layer.name,
+                'layerdetailurl': layer_version.get_detailspage_url(prj.pk),
+                'xhrLayerUrl': reverse('xhr_layer',
+                                       args=(prj.pk, layer_version.pk)),
+                'vcs_url': layer_version.layer.vcs_url,
+                'vcs_reference': vcs_reference,
+                'detail': detail,
+                'local_source_dir': layer_version.layer.local_source_dir,
             }
 
             results.append(needed_fields)
 
         return results
 
+
 class MachinesTypeAhead(ToasterTypeAhead):
     """ Typeahead for all the machines available in the current project's
     configuration """
-    def __init__(self):
-        super(MachinesTypeAhead, self).__init__()
 
     def apply_search(self, search_term, prj, request):
         machines = prj.get_available_machines()
         machines = machines.order_by("name")
 
         primary_results = machines.filter(name__istartswith=search_term)
-        secondary_results = machines.filter(name__icontains=search_term).exclude(pk__in=primary_results)
-        tertiary_results = machines.filter(layer_version__layer__name__icontains=search_term).exclude(pk__in=primary_results).exclude(pk__in=secondary_results)
+        secondary_results = machines.filter(
+            name__icontains=search_term).exclude(pk__in=primary_results)
+        tertiary_results = machines.filter(
+            layer_version__layer__name__icontains=search_term).exclude(
+                pk__in=primary_results).exclude(pk__in=secondary_results)
 
         results = []
 
-        for machine in list(primary_results) + list(secondary_results) + list(tertiary_results):
+        for machine in list(primary_results) + list(secondary_results) + \
+                list(tertiary_results):
 
             detail = "[ %s ]" % (machine.layer_version.layer.name)
             needed_fields = {
-                'id' : machine.pk,
-                'name' : machine.name,
-                'detail' : detail,
+                'id': machine.pk,
+                'name': machine.name,
+                'detail': detail,
             }
 
             results.append(needed_fields)
-
         return results
 
+
 class RecipesTypeAhead(ToasterTypeAhead):
     """ Typeahead for all the recipes available in the current project's
     configuration """
-    def __init__(self):
-        super(RecipesTypeAhead, self).__init__()
-
     def apply_search(self, search_term, prj, request):
         recipes = prj.get_available_recipes()
         recipes = recipes.order_by("name")
 
-
         primary_results = recipes.filter(name__istartswith=search_term)
-        secondary_results = recipes.filter(name__icontains=search_term).exclude(pk__in=primary_results)
-        tertiary_results = recipes.filter(layer_version__layer__name__icontains=search_term).exclude(pk__in=primary_results).exclude(pk__in=secondary_results)
+        secondary_results = recipes.filter(
+            name__icontains=search_term).exclude(pk__in=primary_results)
+        tertiary_results = recipes.filter(
+            layer_version__layer__name__icontains=search_term).exclude(
+                pk__in=primary_results).exclude(pk__in=secondary_results)
 
         results = []
 
-        for recipe in list(primary_results) + list(secondary_results) + list(tertiary_results):
+        for recipe in list(primary_results) + list(secondary_results) + \
+                list(tertiary_results):
 
             detail = "[ %s ]" % (recipe.layer_version.layer.name)
             needed_fields = {
-                'id' : recipe.pk,
-                'name' : recipe.name,
-                'detail' : detail,
+                'id': recipe.pk,
+                'name': recipe.name,
+                'detail': detail,
             }
 
             results.append(needed_fields)
 
         return results
 
+
 class ProjectsTypeAhead(ToasterTypeAhead):
     """ Typeahead for all the projects, except for command line builds """
-    def __init__(self):
-        super(ProjectsTypeAhead, self).__init__()
-
     def apply_search(self, search_term, prj, request):
         projects = Project.objects.exclude(is_default=True).order_by("name")
 
         primary_results = projects.filter(name__istartswith=search_term)
-        secondary_results = projects.filter(name__icontains=search_term).exclude(pk__in=primary_results)
+        secondary_results = projects.filter(
+            name__icontains=search_term).exclude(pk__in=primary_results)
 
         results = []
 
         for project in list(primary_results) + list(secondary_results):
             needed_fields = {
-                'id' : project.pk,
-                'name' : project.name,
-                'detail' : "",
-                'projectPageUrl' : reverse('project', args=(project.pk,))
+                'id': project.pk,
+                'name': project.name,
+                'detail': "",
+                'projectPageUrl': reverse('project', args=(project.pk,))
             }
 
             results.append(needed_fields)
 
         return results
+
+
+class GitRevisionTypeAhead(ToasterTypeAhead):
+    def apply_search(self, search_term, prj, request):
+        results = []
+        git_url = request.GET.get('git_url')
+        ls_remote = cache.get(git_url)
+
+        if ls_remote is None:
+            ls_remote = subprocess.check_output(['git', 'ls-remote', git_url],
+                                                universal_newlines=True)
+            ls_remote = ls_remote.splitlines()
+            # Avoid fetching the list of git refs on each new input
+            cache.set(git_url, ls_remote, 120)
+
+        for rev in ls_remote:
+            git_rev = str(rev).split("/")[-1:][0]
+            # "HEAD" has a special meaning in Toaster...  YOCTO #9924
+            if "HEAD" in git_rev:
+                continue
+
+            if git_rev.startswith(search_term):
+                results.append({'name': git_rev,
+                                'detail': '[ %s ]' % str(rev)})
+
+        return results
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/urls.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/urls.py
index ece9ac1..d92f190 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/urls.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/urls.py
@@ -182,20 +182,23 @@
             typeaheads.RecipesTypeAhead.as_view(), name='xhr_recipestypeahead'),
         url(r'^xhr_typeahead/projects$',
             typeaheads.ProjectsTypeAhead.as_view(), name='xhr_projectstypeahead'),
-
-
+        url(r'^xhr_typeahead/gitrev$',
+            typeaheads.GitRevisionTypeAhead.as_view(),
+            name='xhr_gitrevtypeahead'),
 
         url(r'^xhr_testreleasechange/(?P<pid>\d+)$', 'xhr_testreleasechange',
             name='xhr_testreleasechange'),
         url(r'^xhr_configvaredit/(?P<pid>\d+)$', 'xhr_configvaredit',
             name='xhr_configvaredit'),
 
-        url(r'^xhr_importlayer/$', 'xhr_importlayer', name='xhr_importlayer'),
-
         url(r'^xhr_layer/(?P<pid>\d+)/(?P<layerversion_id>\d+)$',
             api.XhrLayer.as_view(),
             name='xhr_layer'),
 
+        url(r'^xhr_layer/(?P<pid>\d+)$',
+            api.XhrLayer.as_view(),
+            name='xhr_layer'),
+
         # JS Unit tests
         url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'),
 
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/views.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/views.py
index 2efb0fd..75c5911 100755
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/views.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/views.py
@@ -120,32 +120,6 @@
         raise TypeError("Unserializable object %s (%s) of type %s" % ( obj, dir(obj), type(obj)))
 
 
-def _template_renderer(template):
-    def func_wrapper(view):
-        def returned_wrapper(request, *args, **kwargs):
-            try:
-                context = view(request, *args, **kwargs)
-            except RedirectException as e:
-                return e.get_redirect_response()
-
-            if request.GET.get('format', None) == 'json':
-                # objects is a special keyword - it's a Page, but we need the actual objects here
-                # in XHR, the objects come in the "rows" property
-                if "objects" in context:
-                    context["rows"] = context["objects"].object_list
-                    del context["objects"]
-
-                # we're about to return; to keep up with the XHR API, we set the error to OK
-                context["error"] = "ok"
-
-                return HttpResponse(jsonfilter(context, default=objtojson ),
-                            content_type = "application/json; charset=utf-8")
-            else:
-                return render(request, template, context)
-        return returned_wrapper
-    return func_wrapper
-
-
 def _lv_to_dict(prj, x = None):
     if x is None:
         def wrapper(x):
@@ -1509,121 +1483,6 @@
             return HttpResponse(json.dumps({"error":str(e) + "\n" + traceback.format_exc()}), content_type = "application/json")
 
 
-    def xhr_importlayer(request):
-        if ('vcs_url' not in request.POST or
-            'name' not in request.POST or
-            'git_ref' not in request.POST or
-            'project_id' not in request.POST):
-          return HttpResponse(jsonfilter({"error": "Missing parameters; requires vcs_url, name, git_ref and project_id"}), content_type = "application/json")
-
-        layers_added = [];
-
-        # Rudimentary check for any possible html tags
-        for val in request.POST.values():
-            if "<" in val:
-                return HttpResponse(jsonfilter(
-                    {"error": "Invalid character <"}),
-                    content_type="application/json")
-
-        prj = Project.objects.get(pk=request.POST['project_id'])
-
-        # Strip trailing/leading whitespace from all values
-        # put into a new dict because POST one is immutable.
-        post_data = dict()
-        for key,val in request.POST.items():
-          post_data[key] = val.strip()
-
-
-        try:
-            layer, layer_created = Layer.objects.get_or_create(name=post_data['name'])
-        except MultipleObjectsReturned:
-            return HttpResponse(jsonfilter({"error": "hint-layer-exists"}), content_type = "application/json")
-
-        if layer:
-            if layer_created:
-                layer.vcs_url = post_data.get('vcs_url')
-                layer.local_source_dir = post_data.get('local_source_dir')
-                layer.up_date = timezone.now()
-                layer.save()
-            else:
-                # We have an existing layer by this name, let's see if the git
-                # url is the same, if it is then we can just create a new layer
-                # version for this layer. Otherwise we need to bail out.
-                if layer.vcs_url != post_data['vcs_url']:
-                    return HttpResponse(jsonfilter({"error": "hint-layer-exists-with-different-url" , "current_url" : layer.vcs_url, "current_id": layer.id }), content_type = "application/json")
-
-            layer_version, version_created = \
-                Layer_Version.objects.get_or_create(
-                        layer_source=LayerSource.TYPE_IMPORTED,
-                        layer=layer, project=prj,
-                        release=prj.release,
-                        branch=post_data['git_ref'],
-                        commit=post_data['git_ref'],
-                        dirpath=post_data['dir_path'])
-
-            if layer_version:
-                if not version_created:
-                    return HttpResponse(jsonfilter({"error":
-                                                    "hint-layer-version-exists",
-                                                    "existing_layer_version":
-                                                    layer_version.id }),
-                                        content_type = "application/json")
-
-                layer_version.layer_source = LayerSource.TYPE_IMPORTED
-
-                layer_version.up_date = timezone.now()
-                layer_version.save()
-
-                # Add the dependencies specified for this new layer
-                if ('layer_deps' in post_data and
-                    version_created and
-                    len(post_data["layer_deps"]) > 0):
-                    for layer_dep_id in post_data["layer_deps"].split(","):
-
-                        layer_dep_obj = Layer_Version.objects.get(pk=layer_dep_id)
-                        LayerVersionDependency.objects.get_or_create(layer_version=layer_version, depends_on=layer_dep_obj)
-                        # Now add them to the project, we could get an execption
-                        # if the project now contains the exact
-                        # dependency already (like modified on another page)
-                        try:
-                            prj_layer, prj_layer_created = ProjectLayer.objects.get_or_create(layercommit=layer_dep_obj, project=prj)
-                        except IntegrityError as e:
-                            logger.warning("Integrity error while saving Project Layers: %s (original %s)" % (e, e.__cause__))
-                            continue
-
-                        if prj_layer_created:
-                            layerdepdetailurl = reverse('layerdetails', args=(prj.id, layer_dep_obj.pk))
-                            layers_added.append({'id': layer_dep_obj.id, 'name': Layer.objects.get(id=layer_dep_obj.layer_id).name, 'layerdetailurl': layerdepdetailurl })
-
-
-                # If an old layer version exists in our project then remove it
-                for prj_layers in ProjectLayer.objects.filter(project=prj):
-                    dup_layer_v = Layer_Version.objects.filter(id=prj_layers.layercommit_id, layer_id=layer.id)
-                    if len(dup_layer_v) >0 :
-                        prj_layers.delete()
-
-                # finally add the imported layer (version id) to the project
-                ProjectLayer.objects.create(layercommit=layer_version, project=prj,optional=1)
-
-            else:
-                # We didn't create a layer version so back out now and clean up.
-                if layer_created:
-                    layer.delete()
-
-                return HttpResponse(jsonfilter({"error": "Uncaught error: Could not create layer version"}), content_type = "application/json")
-
-        layerdetailurl = reverse('layerdetails', args=(prj.id, layer_version.pk))
-
-        json_response = {"error": "ok",
-                         "imported_layer" : {
-                           "name" : layer.name,
-                           "id": layer_version.id,
-                           "layerdetailurl": layerdetailurl,
-                         },
-                         "deps_added": layers_added }
-
-        return HttpResponse(jsonfilter(json_response), content_type = "application/json")
-
     def customrecipe_download(request, pid, recipe_id):
         recipe = get_object_or_404(CustomImageRecipe, pk=recipe_id)
 
@@ -1643,8 +1502,6 @@
         }
         return render(request, template, context)
 
-    # TODO merge with api pseudo api here is used for deps modal
-    @_template_renderer('layerdetails.html')
     def layerdetails(request, pid, layerid):
         project = Project.objects.get(pk=pid)
         layer_version = Layer_Version.objects.get(pk=layerid)
@@ -1672,7 +1529,7 @@
             'projectlayers': list(project_layers)
         }
 
-        return context
+        return render(request, 'layerdetails.html', context)
 
 
     def get_project_configvars_context():
@@ -1692,7 +1549,6 @@
 
         return(vars_managed,sorted(vars_fstypes),vars_blacklist)
 
-    @_template_renderer("projectconf.html")
     def projectconf(request, pid):
 
         try:
@@ -1763,7 +1619,7 @@
         except (ProjectVariable.DoesNotExist, BuildEnvironment.DoesNotExist):
             pass
 
-        return context
+        return render(request, "projectconf.html", context)
 
     def _file_names_for_artifact(build, artifact_type, artifact_id):
         """
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/widgets.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/widgets.py
index 026903d..6b7b981 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/widgets.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/widgets.py
@@ -42,6 +42,8 @@
 import collections
 import re
 
+from toastergui.tablefilter import TableFilterMap
+
 try:
     from urllib import unquote_plus
 except ImportError:
@@ -50,8 +52,6 @@
 import logging
 logger = logging.getLogger("toaster")
 
-from toastergui.tablefilter import TableFilterMap
-
 
 class NoFieldOrDataName(Exception):
     pass
@@ -259,9 +259,9 @@
                     queries = query
 
             if search_queries:
-               search_queries &= queries
+                search_queries &= queries
             else:
-               search_queries = queries
+                search_queries = queries
 
         self.queryset = self.queryset.filter(search_queries)
 
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings.py
index aec9dbb..1fd649c 100644
--- a/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings.py
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings.py
@@ -38,8 +38,7 @@
 
 MANAGERS = ADMINS
 
-TOASTER_SQLITE_DEFAULT_DIR = os.path.join(os.environ.get('TOASTER_DIR', ''),
-                                          'build')
+TOASTER_SQLITE_DEFAULT_DIR = os.environ.get('TOASTER_DIR')
 
 DATABASES = {
     'default': {
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings_production_example.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings_production_example.py
new file mode 100644
index 0000000..61a2888
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings_production_example.py
@@ -0,0 +1,58 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016        Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# See Django documentation for more information about deployment
+# https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
+
+# Toaster production settings example overlay
+# To use this copy this example to "settings_production.py" and set in your
+# environment DJANGO_SETTINGS_MODULE=toastermain.settings_production
+# This can be permanently set in a new .wsgi file
+
+from toastermain.settings import *  # NOQA
+
+# Set this value!
+SECRET_KEY = None
+
+# Switch off any debugging
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+DATABASES = {
+     'default': {
+         'ENGINE': 'django.db.backends.mysql',
+         'NAME': 'toaster_data',
+         'USER': 'toaster',
+         'PASSWORD': 'yourpasswordhere',
+         'HOST': '127.0.0.1',
+         'PORT': '3306',
+     }
+}
+
+# Location where static files will be placed by "manage.py collectstatic"
+STATIC_ROOT = '/var/www/static-toaster/'
+
+# URL prefix for static files.
+STATIC_URL = '/static-toaster/'
+
+# Hosts that Django will serve
+# https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-ALLOWED_HOSTS
+ALLOWED_HOSTS = ['toaster-example.example.com']
diff --git a/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide.xml b/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide.xml
index bf6a6f8..f0ee399 100644
--- a/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide.xml
+++ b/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide.xml
@@ -114,14 +114,29 @@
                 <revremark>Released with the Yocto Project 2.2 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.1</revnumber>
-                <date>January 2017</date>
-                <revremark>Released with the Yocto Project 2.2.1 Release.</revremark>
+                <revnumber>2.3</revnumber>
+                <date>May 2017</date>
+                <revremark>Released with the Yocto Project 2.3 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.2</revnumber>
+                <revnumber>2.3.1</revnumber>
                 <date>June 2017</date>
-                <revremark>Released with the Yocto Project 2.2.2 Release.</revremark>
+                <revremark>Released with the Yocto Project 2.3.1 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.2</revnumber>
+                <date>September 2017</date>
+                <revremark>Released with the Yocto Project 2.3.2 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.3</revnumber>
+                <date>January 2018</date>
+                <revremark>Released with the Yocto Project 2.3.3 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.4</revnumber>
+                <date>April 2018</date>
+                <revremark>Released with the Yocto Project 2.3.4 Release.</revremark>
             </revision>
         </revhistory>
 
@@ -135,12 +150,34 @@
         Permission is granted to copy, distribute and/or modify this document under
         the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
       </para>
-      <note>
-          For the latest version of this manual associated with this
-          Yocto Project release, see the
-          <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>
-          from the Yocto Project website.
-      </note>
+            <note><title>Manual Notes</title>
+                <itemizedlist>
+                    <listitem><para>
+                        For the latest version of the Yocto Project Board
+                        Support Package (BSP) Developer's Guide associated with
+                        this Yocto Project release (version
+                        &YOCTO_DOC_VERSION;),
+                        see the Yocto Project Board Support Package (BSP)
+                        Developer's Guide from the
+                        <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+                        </para></listitem>
+                    <listitem><para>
+                        This version of the manual is version
+                        &YOCTO_DOC_VERSION;.
+                        For later releases of the Yocto Project (if they exist),
+                        go to the
+                        <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+                        and use the drop-down "Active Releases" button
+                        and choose the Yocto Project version for which you want
+                        the manual.
+                        </para></listitem>
+                    <listitem><para>
+                        For an in-development version of the Yocto Project
+                        Board Support Package (BSP) Developer's Guide, see
+                        <ulink url='&YOCTO_DOCS_URL;/latest/bsp-guide/bsp-guide.html'></ulink>.
+                        </para></listitem>
+                </itemizedlist>
+            </note>
     </legalnotice>
 
     </bookinfo>
diff --git a/import-layers/yocto-poky/documentation/bsp-guide/bsp.xml b/import-layers/yocto-poky/documentation/bsp-guide/bsp.xml
index 4d0ace0..a92e611 100644
--- a/import-layers/yocto-poky/documentation/bsp-guide/bsp.xml
+++ b/import-layers/yocto-poky/documentation/bsp-guide/bsp.xml
@@ -352,135 +352,139 @@
             </para>
 
             <section id="bsp-filelayout-license">
-            <title>License Files</title>
+                <title>License Files</title>
 
-            <para>
-                You can find these files in the BSP Layer at:
-                <literallayout class='monospaced'>
+                <para>
+                    You can find these files in the BSP Layer at:
+                    <literallayout class='monospaced'>
      meta-<replaceable>bsp_name</replaceable>/<replaceable>bsp_license_file</replaceable>
-                </literallayout>
-            </para>
+                    </literallayout>
+                </para>
 
-            <para>
-                These optional files satisfy licensing requirements for the BSP.
-                The type or types of files here can vary depending on the licensing requirements.
-                For example, in the Raspberry Pi BSP all licensing requirements are handled with the
-                <filename>COPYING.MIT</filename> file.
-            </para>
+                <para>
+                    These optional files satisfy licensing requirements for the BSP.
+                    The type or types of files here can vary depending on the licensing requirements.
+                    For example, in the Raspberry Pi BSP all licensing requirements are handled with the
+                    <filename>COPYING.MIT</filename> file.
+                </para>
 
-            <para>
-                Licensing files can be MIT, BSD, GPLv*, and so forth.
-                These files are recommended for the BSP but are optional and totally up to the BSP developer.
-            </para>
+                <para>
+                    Licensing files can be MIT, BSD, GPLv*, and so forth.
+                    These files are recommended for the BSP but are optional and totally up to the BSP developer.
+                </para>
             </section>
 
             <section id="bsp-filelayout-readme">
-            <title>README File</title>
-            <para>
-                You can find this file in the BSP Layer at:
-                <literallayout class='monospaced'>
+                <title>README File</title>
+
+                <para>
+                    You can find this file in the BSP Layer at:
+                    <literallayout class='monospaced'>
      meta-<replaceable>bsp_name</replaceable>/README
-                </literallayout>
-            </para>
+                    </literallayout>
+                </para>
 
-            <para>
-                This file provides information on how to boot the live images that are optionally
-                included in the <filename>binary/</filename> directory.
-                The <filename>README</filename> file also provides special information needed for
-                building the image.
-            </para>
+                <para>
+                    This file provides information on how to boot the live images that are optionally
+                    included in the <filename>binary/</filename> directory.
+                    The <filename>README</filename> file also provides special information needed for
+                    building the image.
+                </para>
 
-            <para>
-                At a minimum, the <filename>README</filename> file must
-                contain a list of dependencies, such as the names of
-                any other layers on which the BSP depends and the name of
-                the BSP maintainer with his or her contact information.
-            </para>
+                <para>
+                    At a minimum, the <filename>README</filename> file must
+                    contain a list of dependencies, such as the names of
+                    any other layers on which the BSP depends and the name of
+                    the BSP maintainer with his or her contact information.
+                </para>
             </section>
 
             <section id="bsp-filelayout-readme-sources">
-            <title>README.sources File</title>
-            <para>
-                You can find this file in the BSP Layer at:
-                <literallayout class='monospaced'>
-     meta-<replaceable>bsp_name</replaceable>/README.sources
-                </literallayout>
-            </para>
+                <title>README.sources File</title>
 
-            <para>
-                This file provides information on where to locate the BSP
-                source files used to build the images (if any) that reside in
-                <filename>meta-<replaceable>bsp_name</replaceable>/binary</filename>.
-                Images in the <filename>binary</filename> would be images
-                released with the BSP.
-                The information in the <filename>README.sources</filename>
-                file also helps you find the
-                <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
-                used to generate the images that ship with the BSP.
-                <note>
-                    If the BSP's <filename>binary</filename> directory is
-                    missing or the directory has no images, an existing
-                    <filename>README.sources</filename> file is
-                    meaningless.
-                </note>
-            </para>
+                <para>
+                    You can find this file in the BSP Layer at:
+                    <literallayout class='monospaced'>
+     meta-<replaceable>bsp_name</replaceable>/README.sources
+                    </literallayout>
+                </para>
+
+                <para>
+                    This file provides information on where to locate the BSP
+                    source files used to build the images (if any) that reside in
+                    <filename>meta-<replaceable>bsp_name</replaceable>/binary</filename>.
+                    Images in the <filename>binary</filename> would be images
+                    released with the BSP.
+                    The information in the <filename>README.sources</filename>
+                    file also helps you find the
+                    <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+                    used to generate the images that ship with the BSP.
+                    <note>
+                        If the BSP's <filename>binary</filename> directory is
+                        missing or the directory has no images, an existing
+                        <filename>README.sources</filename> file is
+                        meaningless.
+                    </note>
+                </para>
             </section>
 
             <section id="bsp-filelayout-binary">
-            <title>Pre-built User Binaries</title>
-            <para>
-                You can find these files in the BSP Layer at:
-                <literallayout class='monospaced'>
+                <title>Pre-built User Binaries</title>
+
+                <para>
+                    You can find these files in the BSP Layer at:
+                    <literallayout class='monospaced'>
      meta-<replaceable>bsp_name</replaceable>/binary/<replaceable>bootable_images</replaceable>
-                </literallayout>
-            </para>
+                    </literallayout>
+                </para>
 
-            <para>
-                This optional area contains useful pre-built kernels and
-                user-space filesystem images released with the BSP that are
-                appropriate to the target system.
-                This directory typically contains graphical (e.g. Sato) and
-                minimal live images when the BSP tarball has been created and
-                made available in the
-                <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
-                You can use these kernels and images to get a system running
-                and quickly get started on development tasks.
-            </para>
+                <para>
+                    This optional area contains useful pre-built kernels and
+                    user-space filesystem images released with the BSP that are
+                    appropriate to the target system.
+                    This directory typically contains graphical (e.g. Sato) and
+                    minimal live images when the BSP tarball has been created and
+                    made available in the
+                    <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
+                    You can use these kernels and images to get a system running
+                    and quickly get started on development tasks.
+                </para>
 
-            <para>
-                The exact types of binaries present are highly
-                hardware-dependent.
-                The <filename>README</filename> file should be present in the
-                BSP Layer and it will explain how to use the images with the
-                target hardware.
-                Additionally, the <filename>README.sources</filename> file
-                should be present to locate the sources used to build the
-                images and provide information on the Metadata.
-            </para>
+                <para>
+                    The exact types of binaries present are highly
+                    hardware-dependent.
+                    The <filename>README</filename> file should be present in the
+                    BSP Layer and it will explain how to use the images with the
+                    target hardware.
+                    Additionally, the <filename>README.sources</filename> file
+                    should be present to locate the sources used to build the
+                    images and provide information on the Metadata.
+                </para>
             </section>
 
             <section id='bsp-filelayout-layer'>
-            <title>Layer Configuration File</title>
-            <para>
-                You can find this file in the BSP Layer at:
-                <literallayout class='monospaced'>
+                <title>Layer Configuration File</title>
+
+                <para>
+                    You can find this file in the BSP Layer at:
+                    <literallayout class='monospaced'>
      meta-<replaceable>bsp_name</replaceable>/conf/layer.conf
-                </literallayout>
-            </para>
+                    </literallayout>
+                </para>
 
-            <para>
-                The <filename>conf/layer.conf</filename> file identifies the file structure as a
-                layer, identifies the
-                contents of the layer, and contains information about how the build
-                system should use it.
-                Generally, a standard boilerplate file such as the following works.
-                In the following example, you would replace "<replaceable>bsp</replaceable>" and
-                "<replaceable>_bsp</replaceable>" with the actual name
-                of the BSP (i.e. <replaceable>bsp_name</replaceable> from the example template).
-            </para>
+                <para>
+                    The <filename>conf/layer.conf</filename> file identifies the file structure as a
+                    layer, identifies the
+                    contents of the layer, and contains information about how the build
+                    system should use it.
+                    Generally, a standard boilerplate file such as the following works.
+                    In the following example, you would replace "<replaceable>bsp</replaceable>" and
+                    "<replaceable>_bsp</replaceable>" with the actual name
+                    of the BSP (i.e. <replaceable>bsp_name</replaceable> from the example template).
+                </para>
 
-            <para>
-               <literallayout class='monospaced'>
+                <para>
+                   <literallayout class='monospaced'>
      # We have a conf and classes directory, add to BBPATH
      BBPATH .= ":${LAYERDIR}"
 
@@ -493,13 +497,13 @@
      BBFILE_PRIORITY_<replaceable>bsp</replaceable> = "6"
 
      LAYERDEPENDS_<replaceable>bsp</replaceable> = "intel"
-                </literallayout>
-            </para>
+                    </literallayout>
+                </para>
 
-            <para>
-                To illustrate the string substitutions, here are the corresponding statements
-                from the Raspberry Pi <filename>conf/layer.conf</filename> file:
-               <literallayout class='monospaced'>
+                <para>
+                    To illustrate the string substitutions, here are the corresponding statements
+                    from the Raspberry Pi <filename>conf/layer.conf</filename> file:
+                   <literallayout class='monospaced'>
      # We have a conf and classes directory, append to BBPATH
      BBPATH .= ":${LAYERDIR}"
 
@@ -513,316 +517,196 @@
 
      # Additional license directories.
      LICENSE_PATH += "${LAYERDIR}/files/custom-licenses"
-                </literallayout>
-            </para>
+                    </literallayout>
+                </para>
 
-            <para>
-                This file simply makes
-                <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>
-                aware of the recipes and configuration directories.
-                The file must exist so that the OpenEmbedded build system can recognize the BSP.
-            </para>
+                <para>
+                    This file simply makes
+                    <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>
+                    aware of the recipes and configuration directories.
+                    The file must exist so that the OpenEmbedded build system can recognize the BSP.
+                </para>
             </section>
 
             <section id="bsp-filelayout-machine">
-            <title>Hardware Configuration Options</title>
-            <para>
-                You can find these files in the BSP Layer at:
-                <literallayout class='monospaced'>
+                <title>Hardware Configuration Options</title>
+
+                <para>
+                    You can find these files in the BSP Layer at:
+                    <literallayout class='monospaced'>
      meta-<replaceable>bsp_name</replaceable>/conf/machine/*.conf
-                </literallayout>
-            </para>
+                    </literallayout>
+                </para>
 
-            <para>
-                The machine files bind together all the information contained elsewhere
-                in the BSP into a format that the build system can understand.
-                If the BSP supports multiple machines, multiple machine configuration files
-                can be present.
-                These filenames correspond to the values to which users have set the
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> variable.
-            </para>
+                <para>
+                    The machine files bind together all the information contained elsewhere
+                    in the BSP into a format that the build system can understand.
+                    If the BSP supports multiple machines, multiple machine configuration files
+                    can be present.
+                    These filenames correspond to the values to which users have set the
+                    <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> variable.
+                </para>
 
-            <para>
-                These files define things such as the kernel package to use
-                (<ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></ulink>
-                of virtual/kernel), the hardware drivers to
-                include in different types of images, any special software components
-                that are needed, any bootloader information, and also any special image
-                format requirements.
-            </para>
+                <para>
+                    These files define things such as the kernel package to use
+                    (<ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></ulink>
+                    of virtual/kernel), the hardware drivers to
+                    include in different types of images, any special software components
+                    that are needed, any bootloader information, and also any special image
+                    format requirements.
+                </para>
 
-            <para>
-                Each BSP Layer requires at least one machine file.
-                However, you can supply more than one file.
-            </para>
+                <para>
+                    Each BSP Layer requires at least one machine file.
+                    However, you can supply more than one file.
+                </para>
 
-            <para>
-                This configuration file could also include a hardware "tuning"
-                file that is commonly used to define the package architecture
-                and specify optimization flags, which are carefully chosen
-                to give best performance on a given processor.
-            </para>
+                <para>
+                    This configuration file could also include a hardware "tuning"
+                    file that is commonly used to define the package architecture
+                    and specify optimization flags, which are carefully chosen
+                    to give best performance on a given processor.
+                </para>
 
-            <para>
-                Tuning files are found in the <filename>meta/conf/machine/include</filename>
-                directory within the
-                <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
-                For example, the <filename>ia32-base.inc</filename> file resides in the
-                <filename>meta/conf/machine/include</filename> directory.
-            </para>
+                <para>
+                    Tuning files are found in the <filename>meta/conf/machine/include</filename>
+                    directory within the
+                    <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+                    For example, the <filename>ia32-base.inc</filename> file resides in the
+                    <filename>meta/conf/machine/include</filename> directory.
+                </para>
 
-            <para>
-                To use an include file, you simply include them in the
-                machine configuration file.
-                For example, the Raspberry Pi BSP
-                <filename>raspberrypi3.conf</filename> contains the
-                following statement:
-                <literallayout class='monospaced'>
+                <para>
+                    To use an include file, you simply include them in the
+                    machine configuration file.
+                    For example, the Raspberry Pi BSP
+                    <filename>raspberrypi3.conf</filename> contains the
+                    following statement:
+                    <literallayout class='monospaced'>
      include conf/machine/raspberrypi2.conf
-                </literallayout>
-            </para>
+                    </literallayout>
+                </para>
             </section>
 
             <section id='bsp-filelayout-misc-recipes'>
-            <title>Miscellaneous BSP-Specific Recipe Files</title>
-            <para>
-                You can find these files in the BSP Layer at:
-                <literallayout class='monospaced'>
-     meta-<replaceable>bsp_name</replaceable>/recipes-bsp/*
-                </literallayout>
-            </para>
+                <title>Miscellaneous BSP-Specific Recipe Files</title>
 
-            <para>
-                This optional directory contains miscellaneous recipe files for
-                the BSP.
-                Most notably would be the formfactor files.
-                For example, in the Raspberry Pi BSP there is the
-                <filename>formfactor_0.0.bbappend</filename> file, which is an
-                append file used to augment the recipe that starts the build.
-                Furthermore, there are machine-specific settings used during
-                the build that are defined by the
-                <filename>machconfig</filename> file further down in the
-                directory.
-                Here is the <filename>machconfig</filename>
-                file for the Raspberry Pi BSP:
-                <literallayout class='monospaced'>
+                <para>
+                    You can find these files in the BSP Layer at:
+                    <literallayout class='monospaced'>
+     meta-<replaceable>bsp_name</replaceable>/recipes-bsp/*
+                    </literallayout>
+                </para>
+
+                <para>
+                    This optional directory contains miscellaneous recipe files for
+                    the BSP.
+                    Most notably would be the formfactor files.
+                    For example, in the Raspberry Pi BSP there is the
+                    <filename>formfactor_0.0.bbappend</filename> file, which is an
+                    append file used to augment the recipe that starts the build.
+                    Furthermore, there are machine-specific settings used during
+                    the build that are defined by the
+                    <filename>machconfig</filename> file further down in the
+                    directory.
+                    Here is the <filename>machconfig</filename>
+                    file for the Raspberry Pi BSP:
+                    <literallayout class='monospaced'>
      HAVE_TOUCHSCREEN=0
      HAVE_KEYBOARD=1
 
      DISPLAY_CAN_ROTATE=0
      DISPLAY_ORIENTATION=0
      DISPLAY_DPI=133
-                </literallayout>
-            </para>
+                    </literallayout>
+                </para>
 
-            <note><para>
-                If a BSP does not have a formfactor entry, defaults are established according to
-                the formfactor configuration file that is installed by the main
-                formfactor recipe
-                <filename>meta/recipes-bsp/formfactor/formfactor_0.0.bb</filename>,
-                which is found in the
-                <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
-            </para></note>
+                <note><para>
+                    If a BSP does not have a formfactor entry, defaults are established according to
+                    the formfactor configuration file that is installed by the main
+                    formfactor recipe
+                    <filename>meta/recipes-bsp/formfactor/formfactor_0.0.bb</filename>,
+                    which is found in the
+                    <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+                </para></note>
             </section>
 
             <section id='bsp-filelayout-recipes-graphics'>
-            <title>Display Support Files</title>
-            <para>
-                You can find these files in the BSP Layer at:
-                <literallayout class='monospaced'>
-     meta-<replaceable>bsp_name</replaceable>/recipes-graphics/*
-                </literallayout>
-            </para>
+                <title>Display Support Files</title>
 
-            <para>
-                This optional directory contains recipes for the BSP if it has
-                special requirements for graphics support.
-                All files that are needed for the BSP to support a display are
-                kept here.
-            </para>
+                <para>
+                    You can find these files in the BSP Layer at:
+                    <literallayout class='monospaced'>
+     meta-<replaceable>bsp_name</replaceable>/recipes-graphics/*
+                    </literallayout>
+                </para>
+
+                <para>
+                    This optional directory contains recipes for the BSP if it has
+                    special requirements for graphics support.
+                    All files that are needed for the BSP to support a display are
+                    kept here.
+                </para>
             </section>
 
             <section id='bsp-filelayout-kernel'>
-            <title>Linux Kernel Configuration</title>
-            <para>
-                You can find these files in the BSP Layer at:
-                <literallayout class='monospaced'>
-     meta-<replaceable>bsp_name</replaceable>/recipes-kernel/linux/linux-yocto*.bbappend
-                </literallayout>
-            </para>
+                <title>Linux Kernel Configuration</title>
 
-            <para>
-                These files append your specific changes to the main kernel recipe you are using.
-            </para>
-            <para>
-                For your BSP, you typically want to use an existing Yocto Project kernel recipe found in the
-                <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
-                at <filename>meta/recipes-kernel/linux</filename>.
-                You can append your specific changes to the kernel recipe by using a
-                similarly named append file, which is located in the BSP Layer (e.g.
-                the <filename>meta-<replaceable>bsp_name</replaceable>/recipes-kernel/linux</filename> directory).
-            </para>
-            <para>
-                Suppose you are using the <filename>linux-yocto_4.4.bb</filename> recipe to build
-                the kernel.
-                In other words, you have selected the kernel in your
-                <replaceable>bsp_name</replaceable><filename>.conf</filename> file by adding these types
-                of statements:
-                <literallayout class='monospaced'>
+                <para>
+                    You can find these files in the BSP Layer at:
+                    <literallayout class='monospaced'>
+     meta-<replaceable>bsp_name</replaceable>/recipes-kernel/linux/linux-yocto*.bbappend
+                    </literallayout>
+                </para>
+
+                <para>
+                    These files append machine-specific changes to the main
+                    kernel recipe you are using.
+                </para>
+
+                <para>
+                    For your BSP, you typically want to use an existing Yocto
+                    Project kernel recipe found in the
+                    <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+                    at <filename>meta/recipes-kernel/linux</filename>.
+                    You can append machine-specific changes to the kernel recipe
+                    by using a similarly named append file, which is located in
+                    the BSP Layer for your target device (e.g. the
+                    <filename>meta-<replaceable>bsp_name</replaceable>/recipes-kernel/linux</filename> directory).
+                </para>
+
+                <para>
+                    Suppose you are using the <filename>linux-yocto_4.4.bb</filename>
+                    recipe to build the kernel.
+                    In other words, you have selected the kernel in your
+                    <replaceable>bsp_name</replaceable><filename>.conf</filename>
+                    file by adding
+                    <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></ulink>
+                    and
+                    <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></ulink>
+                    statements as follows:
+                    <literallayout class='monospaced'>
      PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
      PREFERRED_VERSION_linux-yocto ?= "4.4%"
-                </literallayout>
-                <note>
-                    When the preferred provider is assumed by default, the
-                    <filename>PREFERRED_PROVIDER</filename> statement does not appear in the
-                    <replaceable>bsp_name</replaceable><filename>.conf</filename> file.
-                </note>
-                You would use the <filename>linux-yocto_4.4.bbappend</filename>
-                file to append specific BSP settings to the kernel, thus
-                configuring the kernel for your particular BSP.
-            </para>
-
-            <para>
-                As an example, consider the following append file
-                used by the BSPs in <filename>meta-yocto-bsp</filename>:
-                <literallayout class='monospaced'>
-     meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.4.bbappend
-                </literallayout>
-                The following listing shows the file.
-                Be aware that the actual commit ID strings in this
-                example listing might be different than the actual strings
-                in the file from the <filename>meta-yocto-bsp</filename>
-                layer upstream.
-                <literallayout class='monospaced'>
-     KBRANCH_genericx86  = "standard/base"
-     KBRANCH_genericx86-64  = "standard/base"
-
-     KMACHINE_genericx86 ?= "common-pc"
-     KMACHINE_genericx86-64 ?= "common-pc-64"
-     KBRANCH_edgerouter = "standard/edgerouter"
-     KBRANCH_beaglebone = "standard/beaglebone"
-     KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
-
-     SRCREV_machine_genericx86    ?= "ff4c4ef15b51f45b9106d71bf1f62fe7c02e63c2"
-     SRCREV_machine_genericx86-64 ?= "ff4c4ef15b51f45b9106d71bf1f62fe7c02e63c2"
-     SRCREV_machine_edgerouter ?= "ff4c4ef15b51f45b9106d71bf1f62fe7c02e63c2"
-     SRCREV_machine_beaglebone ?= "ff4c4ef15b51f45b9106d71bf1f62fe7c02e63c2"
-     SRCREV_machine_mpc8315e-rdb ?= "df00877ef9387b38b9601c82db57de2a1b23ce53"
-
-     COMPATIBLE_MACHINE_genericx86 = "genericx86"
-     COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
-     COMPATIBLE_MACHINE_edgerouter = "edgerouter"
-     COMPATIBLE_MACHINE_beaglebone = "beaglebone"
-     COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
-
-     LINUX_VERSION_genericx86 = "4.4.3"
-     LINUX_VERSION_genericx86-64 = "4.4.3"
-                </literallayout>
-                This append file contains statements used to support
-                several BSPs that ship with the Yocto Project.
-                The file defines machines using the
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></ulink>
-                variable and uses the
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>
-                variable to ensure the machine name used by the OpenEmbedded
-                build system maps to the machine name used by the Linux Yocto
-                kernel.
-                The file also uses the optional
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink>
-                variable to ensure the build process uses the
-                appropriate kernel branch.
-            </para>
-
-            <para>
-                Although this particular example does not use it, the
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink>
-                variable could be used to enable features specific to
-                the kernel.
-                The append file points to specific commits in the
-                <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
-                Git repository and the <filename>meta</filename> Git repository
-                branches to identify the exact kernel needed to build the
-                BSP.
-            </para>
-
-            <para>
-                One thing missing in this particular BSP, which you will
-                typically need when developing a BSP, is the kernel configuration
-                file (<filename>.config</filename>) for your BSP.
-                When developing a BSP, you probably have a kernel configuration
-                file or a set of kernel configuration files that, when taken
-                together, define the kernel configuration for your BSP.
-                You can accomplish this definition by putting the configurations
-                in a file or a set of files inside a directory located at the
-                same level as your kernel's append file and having the same
-                name as the kernel's main recipe file.
-                With all these conditions met, simply reference those files in the
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
-                statement in the append file.
-            </para>
-
-            <para>
-                For example, suppose you had some configuration options
-                in a file called <filename>network_configs.cfg</filename>.
-                You can place that file inside a directory named
-                <filename>linux-yocto</filename> and then add
-                a <filename>SRC_URI</filename> statement such as the
-                following to the append file.
-                When the OpenEmbedded build system builds the kernel, the
-                configuration options are picked up and applied.
-                <literallayout class='monospaced'>
-     SRC_URI += "file://network_configs.cfg"
-                </literallayout>
-            </para>
-
-            <para>
-                To group related configurations into multiple files, you
-                perform a similar procedure.
-                Here is an example that groups separate configurations
-                specifically for Ethernet and graphics into their own
-                files and adds the configurations by using a
-                <filename>SRC_URI</filename> statement like the following
-                in your append file:
-                <literallayout class='monospaced'>
-     SRC_URI += "file://myconfig.cfg \
-                 file://eth.cfg \
-                 file://gfx.cfg"
-                </literallayout>
-            </para>
-
-            <para>
-                Another variable you can use in your kernel recipe append
-                file is the
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
-                variable.
-                When you use this statement, you are extending the locations
-                used by the OpenEmbedded system to look for files and
-                patches as the recipe is processed.
-            </para>
-
-            <note>
-                <para>
-                    Other methods exist to accomplish grouping and defining configuration options.
-                    For example, if you are working with a local clone of the kernel repository,
-                    you could checkout the kernel's <filename>meta</filename> branch, make your changes,
-                    and then push the changes to the local bare clone of the kernel.
-                    The result is that you directly add configuration options to the
-                    <filename>meta</filename> branch for your BSP.
-                    The configuration options will likely end up in that location anyway if the BSP gets
-                    added to the Yocto Project.
+                    </literallayout>
+                    <note>
+                        When the preferred provider is assumed by default, the
+                        <filename>PREFERRED_PROVIDER</filename>
+                        statement does not appear in the
+                        <replaceable>bsp_name</replaceable><filename>.conf</filename> file.
+                    </note>
+                    You would use the <filename>linux-yocto_4.4.bbappend</filename>
+                    file to append specific BSP settings to the kernel, thus
+                    configuring the kernel for your particular BSP.
                 </para>
 
                 <para>
-                    In general, however, the Yocto Project maintainers take care of moving the
-                    <filename>SRC_URI</filename>-specified
-                    configuration options to the kernel's <filename>meta</filename> branch.
-                    Not only is it easier for BSP developers to not have to worry about putting those
-                   configurations in the branch, but having the maintainers do it allows them to apply
-                    'global' knowledge about the kinds of common configuration options multiple BSPs in
-                    the tree are typically using.
-                    This allows for promotion of common configurations into common features.
+                    You can find more information on what your append file
+                    should contain in the
+                    "<ulink url='&YOCTO_DOCS_KERNEL_URL;#creating-the-append-file'>Creating the Append File</ulink>"
+                    section in the Yocto Project Linux Kernel Development
+                    Manual.
                 </para>
-            </note>
             </section>
         </section>
 
@@ -1052,7 +936,7 @@
                    <listitem><para>Create a <filename>.bbappend</filename>
                        file for the modified recipe.
                        For information on using append files, see the
-                       "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files</ulink>"
+                       "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>"
                        section in the Yocto Project Development Manual.
                        </para></listitem>
                    <listitem><para>
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml
index b2a2e32..598f877 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml
@@ -45,6 +45,10 @@
             You can accomplish this through a recipe that is a BitBake append
             (<filename>.bbappend</filename>) file, which is described later
             in this section.
+            <note>
+                For general information on BSP layer structure, see the
+                <ulink url='&YOCTO_DOCS_BSP_URL;#bsp'>Board Support Packages (BSP) - Developer's Guide</ulink>.
+            </note>
         </para>
 
         <para>
@@ -108,7 +112,7 @@
             </para>
 
             <para>
-                Follow these general steps to create your layer:
+                Follow these general steps to create your layer without the aid of a script:
                 <orderedlist>
                     <listitem><para><emphasis>Check Existing Layers:</emphasis>
                         Before creating a new layer, you should be sure someone
@@ -233,7 +237,18 @@
                         <note>In order to be compliant with the Yocto Project,
                             a layer must contain a
                             <ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout-readme'>README file.</ulink>
-                            </note></para></listitem>
+                        </note>
+                        </para></listitem>
+                    <listitem><para>
+                        <emphasis>Optionally Test for Compatibility:</emphasis>
+                        If you want permission to use the Yocto Project
+                        Compatibility logo with your layer or application that
+                        uses your layer, perform the steps to apply for
+                        compatibility.
+                        See the
+                        "<link linkend='making-sure-your-layer-is-compatible-with-yocto-project'>Making Sure Your Layer is Compatible With Yocto Project</link>"
+                        section for more information.
+                        </para></listitem>
                 </orderedlist>
             </para>
         </section>
@@ -408,6 +423,14 @@
                 <para>
                     We also recommend the following:
                     <itemizedlist>
+                        <listitem><para>If you want permission to use the
+                            Yocto Project Compatibility logo with your layer
+                            or application that uses your layer, perform the
+                            steps to apply for compatibility.
+                            See the
+                            "<link linkend='making-sure-your-layer-is-compatible-with-yocto-project'>Making Sure Your Layer is Compatible With Yocto Project</link>"
+                            section for more information.
+                            </para></listitem>
                         <listitem><para>Store custom layers in a Git repository
                             that uses the
                             <filename>meta-<replaceable>layer_name</replaceable></filename> format.
@@ -424,6 +447,204 @@
             </section>
         </section>
 
+        <section id='making-sure-your-layer-is-compatible-with-yocto-project'>
+            <title>Making Sure Your Layer is Compatible With Yocto Project</title>
+
+            <para>
+                When you create a layer used with the Yocto Project, it is
+                advantageous to make sure that the layer interacts well with
+                existing Yocto Project layers (i.e. the layer is compatible
+                with the Yocto Project).
+                Ensuring compatibility makes the layer easy to be consumed
+                by others in the Yocto Project community and allows you
+                permission to use the Yocto Project Compatibility logo.
+            </para>
+
+            <para>
+                Version 1.0 of the Yocto Project Compatibility Program has
+                been in existence for a number of releases.
+                This version of the program consists of the layer application
+                process that requests permission to use the Yocto Project
+                Compatibility logo for your layer and application.
+                You can find version 1.0 of the form at
+                <ulink url='https://www.yoctoproject.org/webform/yocto-project-compatible-registration'></ulink>.
+                To be granted permission to use the logo, you need to be able
+                to answer "Yes" to the questions or have an acceptable
+                explanation for any questions answered "No".
+            </para>
+
+            <para>
+                A second version (2.0) of the Yocto Project Compatibility
+                Program is currently under development.
+                Included as part of version 2.0 (and currently available) is
+                the <filename>yocto-compat-layer.py</filename> script.
+                When run against a layer, this script tests the layer against
+                tighter constraints based on experiences of how layers have
+                worked in the real world and where pitfalls have been found.
+            </para>
+
+            <para>
+                Part of the 2.0 version of the program that is not currently
+                available but is in development is an updated compatibility
+                application form.
+                This updated form, among other questions, specifically
+                asks if your layer has passed the test using the
+                <filename>yocto-compat-layer.py</filename> script.
+                <note><title>Tip</title>
+                    Even though the updated application form is currently
+                    unavailable for version 2.0 of the Yocto Project
+                    Compatibility Program, the
+                    <filename>yocto-compat-layer.py</filename> script is
+                    available in OE-Core.
+                    You can use the script to assess the status of your
+                    layers in advance of the 2.0 release of the program.
+                </note>
+            </para>
+
+            <para>
+                The remainder of this section presents information on the
+                version 1.0 registration form and on the
+                <filename>yocto-compat-layer.py</filename> script.
+            </para>
+
+            <section id='yocto-project-compatibility-program-application'>
+                <title>Yocto Project Compatibility Program Application</title>
+
+                <para>
+                    Use the 1.0 version of the form to apply for your
+                    layer's compatibility approval.
+                    Upon successful application, you can use the Yocto
+                    Project Compatibility logo with your layer and the
+                    application that uses your layer.
+                </para>
+
+                <para>
+                    To access the form, use this link:
+                    <ulink url='https://www.yoctoproject.org/webform/yocto-project-compatible-registration'></ulink>.
+                    Follow the instructions on the form to complete your
+                    application.
+                </para>
+
+                <para>
+                    The application consists of the following sections:
+                    <itemizedlist>
+                        <listitem><para>
+                            <emphasis>Contact Information:</emphasis>
+                            Provide your contact information as the fields
+                            require.
+                            Along with your information, provide the
+                            released versions of the Yocto Project for which
+                            your layer is compatible.
+                            </para></listitem>
+                        <listitem><para>
+                            <emphasis>Acceptance Criteria:</emphasis>
+                            Provide "Yes" or "No" answers for each of the
+                            items in the checklist.
+                            Space exists at the bottom of the form for any
+                            explanations for items for which you answered "No".
+                            </para></listitem>
+                        <listitem><para>
+                            <emphasis>Recommendations:</emphasis>
+                            Provide answers for the questions regarding Linux
+                            kernel use and build success.
+                            </para></listitem>
+                    </itemizedlist>
+                </para>
+            </section>
+
+            <section id='yocto-compat-layer-py-script'>
+                <title><filename>yocto-compat-layer.py</filename> Script</title>
+
+                <para>
+                    The <filename>yocto-compat-layer.py</filename> script,
+                    which is currently available, provides you a way to
+                    assess how compatible your layer is with the Yocto
+                    Project.
+                    You should run this script prior to using the form to
+                    apply for compatibility as described in the previous
+                    section.
+                    <note>
+                        Because the script is part of the 2.0 release of the
+                        Yocto Project Compatibility Program, you are not
+                        required to successfully run your layer against it
+                        in order to be granted compatibility status.
+                        However, it is a good idea as it promotes
+                        well-behaved layers and gives you an idea of where your
+                        layer stands regarding compatibility.
+                    </note>
+                </para>
+
+                <para>
+                    The script divides tests into three areas: COMMON, BSD,
+                    and DISTRO.
+                    For example, given a distribution layer (DISTRO), the
+                    layer must pass both the COMMON and DISTRO related tests.
+                    Furthermore, if your layer is a BSP layer, the layer must
+                    pass the COMMON and BSP set of tests.
+                </para>
+
+                <para>
+                    To execute the script, enter the following commands from
+                    your build directory:
+                    <literallayout class='monospaced'>
+     $ source oe-init-build-env
+     $ yocto-compat-layer.py <replaceable>your_layer_directory</replaceable>
+                    </literallayout>
+                    Be sure to provide the actual directory for your layer
+                    as part of the command.
+                </para>
+
+                <para>
+                    Entering the command causes the script to determine the
+                    type of layer and then to execute a set of specific
+                    tests against the layer.
+                    The following list overviews the test:
+                    <itemizedlist>
+                        <listitem><para>
+                            <filename>common.test_readme</filename>:
+                            Tests if a <filename>README</filename> file
+                            exists in the layer and the file is not empty.
+                            </para></listitem>
+                        <listitem><para>
+                            <filename>common.test_parse</filename>:
+                            Tests to make sure that BitBake can parse the
+                            files without error (i.e.
+                            <filename>bitbake -p</filename>).
+                            </para></listitem>
+                        <listitem><para>
+                            <filename>common.test_show_environment</filename>:
+                            Tests that the global or per-recipe environment
+                            is in order without errors (i.e.
+                            <filename>bitbake -e</filename>).
+                            </para></listitem>
+                        <listitem><para>
+                            <filename>common.test_signatures</filename>:
+                            Tests to be sure that BSP and DISTRO layers do not
+                            come with recipes that change signatures.
+                            </para></listitem>
+                        <listitem><para>
+                            <filename>bsp.test_bsp_defines_machines</filename>:
+                            Tests if a BSP layer has machine configurations.
+                            </para></listitem>
+                        <listitem><para>
+                            <filename>bsp.test_bsp_no_set_machine</filename>:
+                            Tests to ensure a BSP layer does not set the
+                            machine when the layer is added.
+                            </para></listitem>
+                        <listitem><para>
+                            <filename>distro.test_distro_defines_distros</filename>:
+                            Tests if a DISTRO layer has distro configurations.
+                            </para></listitem>
+                        <listitem><para>
+                            <filename>distro.test_distro_no_set_distro</filename>:
+                            Tests to ensure a DISTRO layer does not set the
+                            distribution when the layer is added.
+                            </para></listitem>
+                    </itemizedlist>
+                </para>
+            </section>
+        </section>
+
         <section id='enabling-your-layer'>
             <title>Enabling Your Layer</title>
 
@@ -464,37 +685,46 @@
         </section>
 
         <section id='using-bbappend-files'>
-            <title>Using .bbappend Files</title>
+            <title>Using .bbappend Files in Your Layer</title>
 
             <para>
-                Recipes used to append Metadata to other recipes are called
-                BitBake append files.
-                BitBake append files use the <filename>.bbappend</filename> file
-                type suffix, while the corresponding recipes to which Metadata
-                is being appended use the <filename>.bb</filename> file type
-                suffix.
+                A recipe that appends Metadata to another recipe is called a
+                BitBake append file.
+                A BitBake append file uses the <filename>.bbappend</filename>
+                file type suffix, while the corresponding recipe to which
+                Metadata is being appended uses the <filename>.bb</filename>
+                file type suffix.
             </para>
 
             <para>
-                A <filename>.bbappend</filename> file allows your layer to make
-                additions or changes to the content of another layer's recipe
-                without having to copy the other recipe into your layer.
+                You can use a <filename>.bbappend</filename> file in your
+                layer to make additions or changes to the content of another
+                layer's recipe without having to copy the other layer's
+                recipe into your layer.
                 Your <filename>.bbappend</filename> file resides in your layer,
                 while the main <filename>.bb</filename> recipe file to
                 which you are appending Metadata resides in a different layer.
             </para>
 
             <para>
-                Append files must have the same root names as their corresponding
-                recipes.
+                Being able to append information to an existing recipe not only
+                avoids duplication, but also automatically applies recipe
+                changes from a different layer into your layer.
+                If you were copying recipes, you would have to manually merge
+                changes as they occur.
+            </para>
+
+            <para>
+                When you create an append file, you must use the same root
+                name as the corresponding recipe file.
                 For example, the append file
                 <filename>someapp_&DISTRO;.bbappend</filename> must apply to
                 <filename>someapp_&DISTRO;.bb</filename>.
-                This means the original recipe and append file names are version
-                number-specific.
+                This means the original recipe and append file names are
+                version number-specific.
                 If the corresponding recipe is renamed to update to a newer
-                version, the corresponding <filename>.bbappend</filename> file must
-                be renamed (and possibly updated) as well.
+                version, you must also rename and possibly update
+                the corresponding <filename>.bbappend</filename> as well.
                 During the build process, BitBake displays an error on starting
                 if it detects a <filename>.bbappend</filename> file that does
                 not have a corresponding recipe with a matching name.
@@ -504,14 +734,6 @@
             </para>
 
             <para>
-                Being able to append information to an existing recipe not only
-                avoids duplication, but also automatically applies recipe
-                changes in a different layer to your layer.
-                If you were copying recipes, you would have to manually merge
-                changes as they occur.
-            </para>
-
-            <para>
                 As an example, consider the main formfactor recipe and a
                 corresponding formfactor append file both from the
                 <link linkend='source-directory'>Source Directory</link>.
@@ -523,8 +745,7 @@
      SUMMARY = "Device formfactor information"
      SECTION = "base"
      LICENSE = "MIT"
-     LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+     LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
      PR = "r45"
 
      SRC_URI = "file://config file://machconfig"
@@ -540,8 +761,7 @@
 	     if [ -s "${S}/machconfig" ]; then
 	             install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/
 	     fi
-     }
-                </literallayout>
+     }                </literallayout>
                 In the main recipe, note the
                 <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
                 variable, which tells the OpenEmbedded build system where to
@@ -553,7 +773,8 @@
                 <filename>formfactor_0.0.bbappend</filename> and is from the
                 Raspberry Pi BSP Layer named
                 <filename>meta-raspberrypi</filename>.
-                The file is in <filename>recipes-bsp/formfactor</filename>:
+                The file is in the layer at
+                <filename>recipes-bsp/formfactor</filename>:
                 <literallayout class='monospaced'>
      FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
                 </literallayout>
@@ -573,12 +794,13 @@
             </para>
 
             <para>
-                The statement in this example extends the directories to include
+                The statement in this example extends the directories to
+                include
                 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-THISDIR'><filename>THISDIR</filename></ulink><filename>}/${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>,
                 which resolves to a directory named
                 <filename>formfactor</filename> in the same directory
                 in which the append file resides (i.e.
-                <filename>meta-raspberrypi/recipes-bsp/formfactor/formfactor</filename>.
+                <filename>meta-raspberrypi/recipes-bsp/formfactor</filename>.
                 This implies that you must have the supporting directory
                 structure set up that will contain any files or patches you
                 will be including from the layer.
@@ -586,8 +808,8 @@
 
             <para>
                 Using the immediate expansion assignment operator
-                <filename>:=</filename> is important because of the reference to
-                <filename>THISDIR</filename>.
+                <filename>:=</filename> is important because of the reference
+                to <filename>THISDIR</filename>.
                 The trailing colon character is important as it ensures that
                 items in the list remain colon-separated.
                 <note>
@@ -2470,6 +2692,93 @@
             </para>
         </section>
 
+        <section id='new-recipe-using-headers-to-interface-with-devices'>
+            <title>Using Headers to Interface with Devices</title>
+
+            <para>
+                If your recipe builds an application that needs to
+                communicate with some device or needs an API into a custom
+                kernel, you will need to provide appropriate header files.
+                Under no circumstances should you ever modify the existing
+                <filename>meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc</filename>
+                file.
+                These headers are used to build <filename>libc</filename> and
+                must not be compromised with custom or machine-specific
+                header information.
+                If you customize <filename>libc</filename> through modified
+                headers all other applications that use
+                <filename>libc</filename> thus become affected.
+                <note><title>Warning</title>
+                    Never copy and customize the <filename>libc</filename>
+                    header file (i.e.
+                    <filename>meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc</filename>).
+                </note>
+                The correct way to interface to a device or custom kernel is
+                to use a separate package that provides the additional headers
+                for the driver or other unique interfaces.
+                When doing so, your application also becomes responsible for
+                creating a dependency on that specific provider.
+            </para>
+
+            <para>
+                Consider the following:
+                <itemizedlist>
+                    <listitem><para>
+                        Never modify
+                        <filename>linux-libc-headers.inc</filename>.
+                        Consider that file to be part of the
+                        <filename>libc</filename> system, and not something
+                        you use to access the kernel directly.
+                        You should access <filename>libc</filename> through
+                        specific <filename>libc</filename> calls.
+                        </para></listitem>
+                    <listitem><para>
+                        Applications that must talk directly to devices
+                        should either provide necessary headers themselves,
+                        or establish a dependency on a special headers package
+                        that is specific to that driver.
+                        </para></listitem>
+                </itemizedlist>
+            </para>
+
+            <para>
+                For example, suppose you want to modify an existing header
+                that adds I/O control or network support.
+                If the modifications are used by a small number programs,
+                providing a unique version of a header is easy and has little
+                impact.
+                When doing so, bear in mind the guidelines in the previous
+                list.
+                <note>
+                    If for some reason your changes need to modify the behavior
+                    of the <filename>libc</filename>, and subsequently all
+                    other applications on the system, use a
+                    <filename>.bbappend</filename> to modify the
+                    <filename>linux-kernel-headers.inc</filename> file.
+                    However, take care to not make the changes
+                    machine specific.
+                </note>
+            </para>
+
+            <para>
+                Consider a case where your kernel is older and you need
+                an older <filename>libc</filename> ABI.
+                The headers installed by your recipe should still be a
+                standard mainline kernel, not your own custom one.
+            </para>
+
+            <para>
+                When you use custom kernel headers you need to get them from
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_KERNEL_DIR'><filename>STAGING_KERNEL_DIR</filename></ulink>,
+                which is the directory with kernel headers that are
+                required to build out-of-tree modules.
+                Your recipe will also need the following:
+                <literallayout class='monospaced'>
+     do_configure[depends] += "virtual/kernel:do_shared_workdir"
+                </literallayout>
+            </para>
+        </section>
+
         <section id='new-recipe-compilation'>
             <title>Compilation</title>
 
@@ -2883,15 +3192,16 @@
                 the build host.
                 For example, an application linking to a common library needs
                 access to the library itself and its associated headers.
-                The way this access is accomplished is by populating sysroot
+                The way this access is accomplished is by populating a sysroot
                 with files.
-                One sysroot exists per "machine" for which the image is
-                being built.
-                In practical terms, this means a sysroot exists for the target
-                machine, and a sysroot exists for the build host.
+                Each recipe has two sysroots in its work directory, one for
+                target files
+                (<filename>recipe-sysroot</filename>) and one for files that
+                are native to the build host
+                (<filename>recipe-sysroot-native</filename>).
                 <note>
                     You could find the term "staging" used within the Yocto
-                    project regarding files populating sysroot (e.g. the
+                    project regarding files populating sysroots (e.g. the
                     <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_DIR'><filename>STAGING_DIR</filename></ulink>
                     variable).
                 </note>
@@ -2906,12 +3216,6 @@
                 task within the
                 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink><filename>}</filename>
                 directory.
-            </para>
-
-            <para>
-                A subset of these files, as defined by the
-                the <ulink url='&YOCTO_DOCS_REF_URL;#var-SYSROOT_DIRS'><filename>SYSROOT_DIRS</filename></ulink>
-                variable, automatically populates the sysroot.
                 The reason for this limitation is that almost all files that
                 populate the sysroot are cataloged in manifests in order to
                 ensure the files can be removed later when a recipe is either
@@ -2920,24 +3224,29 @@
             </para>
 
             <para>
+                A subset of the files installed by the
+                <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+                task are used by the
+                <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></ulink>
+                task as defined by the the
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-SYSROOT_DIRS'><filename>SYSROOT_DIRS</filename></ulink>
+                variable to automatically populate the sysroot.
                 It is possible to modify the list of directories that populate
                 the sysroot.
                 The following example shows how you could add the
                 <filename>/opt</filename> directory to the list of
-                directories:
+                directories within a recipe:
                 <literallayout class='monospaced'>
      SYSROOT_DIRS += "/opt"
                 </literallayout>
             </para>
 
             <para>
-                For information on variables you can use to help control how
-                files sysroot is populated, see the
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-SYSROOT_DIRS'><filename>SYSROOT_DIRS</filename></ulink>,
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-SYSROOT_DIRS_NATIVE'><filename>SYSROOT_DIRS_NATIVE</filename></ulink>,
-                and
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-SYSROOT_DIRS_BLACKLIST'><filename>SYSROOT_DIRS_BLACKLIST</filename></ulink>
-                variables.
+                For a more complete description of the
+                <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></ulink>
+                task and its associated functions, see the
+                <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-staging'><filename>staging</filename></ulink>
+                class.
             </para>
         </section>
 
@@ -2986,21 +3295,21 @@
                 a package on the target or during image creation when a
                 package is included in an image.
                 To add a post-installation script to a package, add a
-                <filename>pkg_postinst_PACKAGENAME()</filename> function to
+                <filename>pkg_postinst_</filename><replaceable>PACKAGENAME</replaceable><filename>()</filename> function to
                 the recipe file (<filename>.bb</filename>) and replace
-                <filename>PACKAGENAME</filename> with the name of the package
+                <replaceable>PACKAGENAME</replaceable> with the name of the package
                 you want to attach to the <filename>postinst</filename>
                 script.
                 To apply the post-installation script to the main package
                 for the recipe, which is usually what is required, specify
                 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>
-                in place of <filename>PACKAGENAME</filename>.
+                in place of <replaceable>PACKAGENAME</replaceable>.
             </para>
 
             <para>
                 A post-installation function has the following structure:
                 <literallayout class='monospaced'>
-     pkg_postinst_PACKAGENAME() {
+     pkg_postinst_<replaceable>PACKAGENAME</replaceable>() {
      # Commands to carry out
      }
                 </literallayout>
@@ -3029,7 +3338,7 @@
                 To delay script execution until boot time, use the following
                 structure in the post-installation script:
                 <literallayout class='monospaced'>
-     pkg_postinst_PACKAGENAME() {
+     pkg_postinst_<replaceable>PACKAGENAME</replaceable>() {
      if [ x"$D" = "x" ]; then
           # Actions to carry out on the device go here
      else
@@ -3047,6 +3356,20 @@
                 when executed on the first boot.
             </para>
 
+            <para>
+                If you have recipes that use <filename>pkg_postinst</filename>
+                scripts and they require the use of non-standard native
+                tools that have dependencies during rootfs construction, you
+                need to use the
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_WRITE_DEPS'><filename>PACKAGE_WRITE_DEPS</filename></ulink>
+                variable in your recipe to list these tools.
+                If you do not use this variable, the tools might be missing and
+                execution of the post-installation script is deferred until
+                first boot.
+                Deferring the script to first boot is undesirable and for
+                read-only rootfs impossible.
+            </para>
+
             <note>
                 Equivalent support for pre-install, pre-uninstall, and
                 post-uninstall scripts exist by way of
@@ -4475,7 +4798,7 @@
                         <listitem><para>
                             Wic is a completely independent
                             standalone utility that initially provides
-                            easier-to-use and more flexible replacements for a
+                            easier-to-use and more flexible replacements for an
                             existing functionality in OE Core's
                             <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-image-live'><filename>image-live</filename></ulink>
                             class and <filename>mkefidisk.sh</filename> script.
@@ -4786,7 +5109,7 @@
      Creating image(s)...
 
      Info: The new image(s) can be found here:
-      /var/tmp/wic/build/mkefidisk-201310230946-sda.direct
+      <replaceable>current_directory</replaceable>/build/mkefidisk-201310230946-sda.direct
 
      The following build artifacts were used to create the image(s):
       ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/minnow-poky-linux/core-image-minimal/1.0-r0/rootfs
@@ -4811,7 +5134,8 @@
 
                     <para>
                         The output specifies the exact image created as well as
-                        where it was created.
+                        where it was created, which is in the current
+                        directory by default.
                         The output also names the artifacts used and the exact
                         <filename>.wks</filename> script that was used to
                         generate the image.
@@ -4823,18 +5147,26 @@
                     </para>
 
                     <para>
-                        Continuing with the example, you can now directly
-                        <filename>dd</filename> the image to a USB stick, or
-                        whatever media for which you built your image,
-                        and boot the resulting media:
+                        Continuing with the example, you can now write the
+                        image to a USB stick, or whatever media for which you
+                        built your image, and boot the resulting media.
+                        You can write the image by using
+                        <filename>bmaptool</filename> or
+                        <filename>dd</filename>:
                         <literallayout class='monospaced'>
-     $ sudo dd if=/var/tmp/wic/build/mkefidisk-201310230946-sda.direct of=/dev/sdb
-     [sudo] password for trz:
-     182274+0 records in
-     182274+0 records out
-     93324288 bytes (93 MB) copied, 14.4777 s, 6.4 MB/s
-     [trz at empanada ~]$ sudo eject /dev/sdb
+     $ oe-run-native bmaptool copy build/mkefidisk-201310230946-sda.direct /dev/sd<replaceable>X</replaceable>
                         </literallayout>
+                        or
+                        <literallayout class='monospaced'>
+     $ sudo dd if=build/mkefidisk-201310230946-sda.direct of=/dev/sd<replaceable>X</replaceable>
+                        </literallayout>
+                        <note>
+                            For more information on how to use the
+                            <filename>bmaptool</filename> to flash a device
+                            with an image, see the
+                            "<link linkend='flashing-images-using-bmaptool'>Flashing Images Using <filename>bmaptool</filename></link>"
+                            section.
+                        </note>
                     </para>
                 </section>
 
@@ -4910,7 +5242,7 @@
      Creating image(s)...
 
      Info: The new image(s) can be found here:
-      /var/tmp/wic/build/directdisksdb-201310231131-sdb.direct
+      <replaceable>current_directory</replaceable>/build/directdisksdb-201310231131-sdb.direct
 
      The following build artifacts were used to create the image(s):
 
@@ -4927,7 +5259,7 @@
                         whatever media for which you built your image,
                         and boot the resulting media:
                         <literallayout class='monospaced'>
-     $ sudo dd if=/var/tmp/wic/build/directdisksdb-201310231131-sdb.direct of=/dev/sdb
+     $ sudo dd if=build/directdisksdb-201310231131-sdb.direct of=/dev/sdb
      86018+0 records in
      86018+0 records out
      44041216 bytes (44 MB) copied, 13.0734 s, 3.4 MB/s
@@ -4954,7 +5286,7 @@
      Creating image(s)...
 
      Info: The new image(s) can be found here:
-      /var/tmp/wic/build/directdisk-201309252350-sda.direct
+      <replaceable>current_directory</replaceable>/build/directdisk-201309252350-sda.direct
 
      The following build artifacts were used to create the image(s):
 
@@ -4977,8 +5309,8 @@
                         (runs in Raw Mode) and uses a modified kickstart file.
                         The example also uses the <filename>-o</filename> option
                         to cause Wic to create the output
-                        somewhere other than the default
-                        <filename>/var/tmp/wic</filename> directory:
+                        somewhere other than the default output directory,
+                        which is the current directory:
                         <literallayout class='monospaced'>
      $ wic create ~/test.wks -o /home/trz/testwic --rootfs-dir \
           /home/trz/yocto/yocto-image/build/tmp/work/crownbay_noemgd-poky-linux/core-image-minimal/1.0-r0/rootfs \
@@ -5030,6 +5362,14 @@
                     <filename>--source</filename> keyword to a
                     particular plug-in implementation that populates a
                     corresponding partition.
+                    <note>
+                        If you use plug-ins that have build-time dependencies
+                        (e.g. native tools, bootloaders, and so forth)
+                        when building a Wic image, you need to specify those
+                        dependencies using the
+                        <ulink url='&YOCTO_DOCS_REF_URL;#var-WKS_FILE_DEPENDS'><filename>WKS_FILE_DEPENDS</filename></ulink>
+                        variable.
+                    </note>
                 </para>
 
                 <para>
@@ -5224,9 +5564,7 @@
                         <itemizedlist>
                             <listitem><para>
                                 <filename>/<replaceable>path</replaceable></filename>:
-                                For example, <filename>/</filename>,
-                                <filename>/usr</filename>, or
-                                <filename>/home</filename>
+                                For example, "/", "/usr", or "/home"
                                 </para></listitem>
                             <listitem><para>
                                 <filename>swap</filename>:
@@ -6234,7 +6572,7 @@
                         and <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
                         statements enable the OpenEmbedded build system to find the patch file.
                         For more information on using append files, see the
-                        "<link linkend='using-bbappend-files'>Using .bbappend Files</link>"
+                        "<link linkend='using-bbappend-files'>Using .bbappend Files in Your Layer</link>"
                         section.
                         </para></listitem>
                     <listitem><para><emphasis>Put the patch file in your layer</emphasis>:
@@ -6713,7 +7051,7 @@
                         <listitem><para>Add a <filename>psplash</filename>
                             append file for a branded splash screen.
                             For information on append files, see the
-                            "<link linkend='using-bbappend-files'>Using .bbappend Files</link>"
+                            "<link linkend='using-bbappend-files'>Using .bbappend Files in Your Layer</link>"
                             section.</para></listitem>
                         <listitem><para>Add any other append files to make
                             custom changes that are specific to individual
@@ -6994,7 +7332,7 @@
                         section of the Yocto Project Linux Kernel Development
                         Manual and the "<link linkend='creating-config-fragments'>Creating Configuration Fragments</link>"
                         section, which is in this manual.</para></listitem>
-                    <listitem><para><filename>bitbake -u depexp -g <replaceable>bitbake_target</replaceable></filename>:
+                    <listitem><para><filename>bitbake -u taskexp -g <replaceable>bitbake_target</replaceable></filename>:
                         Using the BitBake command with these options brings up
                         a Dependency Explorer from which you can view file
                         dependencies.
@@ -7042,7 +7380,7 @@
                 the Dependency Explorer UI with the BitBake command:
                 <literallayout class='monospaced'>
      $ cd <replaceable>image-directory</replaceable>
-     $ bitbake -u depexp -g <replaceable>image</replaceable>
+     $ bitbake -u taskexp -g <replaceable>image</replaceable>
                 </literallayout>
                 Use the interface to select potential packages you wish to
                 eliminate and see their dependency relationships.
@@ -7277,7 +7615,7 @@
             you much of a performance difference across the other systems
             as compared to using a more general tuning across all the builds
             (e.g. setting
-            <ulink url='var-DEFAULTTUNE'><filename>DEFAULTTUNE</filename></ulink>
+            <ulink url='&YOCTO_DOCS_REF_URL;#var-DEFAULTTUNE'><filename>DEFAULTTUNE</filename></ulink>
             specifically for each machine's build).
             Rather than "max out" each build's tunings, you can take steps that
             cause the OpenEmbedded build system to reuse software across the
@@ -7456,7 +7794,7 @@
                     <link linkend='excluding-packages-from-an-image'>Excluding packages from an image</link>
                     </para></listitem>
                 <listitem><para>
-                    <link linkend='incrementing-a-package-revision-number'>Incrementing a package revision number</link>
+                    <link linkend='incrementing-a-binary-package-version'>Incrementing a binary package version</link>
                     </para></listitem>
                 <listitem><para>
                     <link linkend='handling-optional-module-packaging'>Handling optional module packaging</link>
@@ -7514,37 +7852,104 @@
             </para>
         </section>
 
-        <section id='incrementing-a-package-revision-number'>
-            <title>Incrementing a Package Revision Number</title>
+        <section id='incrementing-a-binary-package-version'>
+            <title>Incrementing a Package Version</title>
 
             <para>
-                If a committed change results in changing the package output,
-                then the value of the
-                <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
-                variable needs to be increased (or "bumped").
-                Increasing <filename>PR</filename> occurs one of two ways:
+                This section provides some background on how binary package
+                versioning is accomplished and presents some of the services,
+                variables, and terminology involved.
+            </para>
+
+            <para>
+                In order to understand binary package versioning, you need
+                to consider the following:
                 <itemizedlist>
-                    <listitem><para>Automatically using a Package Revision
-                        Service (PR Service).</para></listitem>
-                    <listitem><para>Manually incrementing the
-                        <filename>PR</filename> variable.</para></listitem>
+                    <listitem><para>
+                        Binary Package:  The binary package that is eventually
+                        built and installed into an image.
+                        </para></listitem>
+                    <listitem><para>
+                        Binary Package Version:  The binary package version
+                        is composed of two components - a version and a
+                        revision.
+                        <note>
+                            Technically, a third component, the "epoch" (i.e.
+                            <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>)
+                            is involved but this discussion for the most part
+                            ignores <filename>PE</filename>.
+                        </note>
+                        The version and revision are taken from the
+                        <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
+                        and
+                        <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
+                        variables, respectively.
+                        </para></listitem>
+                    <listitem><para>
+                        <filename>PV</filename>:  The recipe version.
+                        <filename>PV</filename> represents the version of the
+                        software being packaged.
+                        Do not confuse <filename>PV</filename> with the
+                        binary package version.
+                        </para></listitem>
+                    <listitem><para>
+                        <filename>PR</filename>:  The recipe revision.
+                        </para></listitem>
+                    <listitem><para>
+                        <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCPV'><filename>SRCPV</filename></ulink>:
+                        The OpenEmbedded build system uses this string
+                        to help define the value of <filename>PV</filename>
+                        when the source code revision needs to be included
+                        in it.
+                        </para></listitem>
+                    <listitem><para>
+                        <ulink url='https://wiki.yoctoproject.org/wiki/PR_Service'>PR Service</ulink>:
+                        A network-based service that helps automate keeping
+                        package feeds compatible with existing package
+                        manager applications such as RPM, APT, and OPKG.
+                        </para></listitem>
                 </itemizedlist>
             </para>
 
             <para>
-                Given that one of the challenges any build system and its
-                users face is how to maintain a package feed that is compatible
-                with existing package manager applications such as
-                RPM, APT, and OPKG, using an automated system is much
-                preferred over a manual system.
-                In either system, the main requirement is that version
-                numbering increases in a linear fashion and that a number of
-                version components exist that support that linear progression.
+                Whenever the binary package content changes, the binary package
+                version must change.
+                Changing the binary package version is accomplished by changing
+                or "bumping" the <filename>PR</filename> and/or
+                <filename>PV</filename> values.
+                Increasing these values occurs one of two ways:
+                <itemizedlist>
+                    <listitem><para>Automatically using a Package Revision
+                        Service (PR Service).
+                        </para></listitem>
+                    <listitem><para>Manually incrementing the
+                        <filename>PR</filename> and/or
+                        <filename>PV</filename> variables.
+                        </para></listitem>
+                </itemizedlist>
             </para>
 
             <para>
-                The following two sections provide information on the PR Service
-                and on manual <filename>PR</filename> bumping.
+                Given a primary challenge of any build system and its users
+                is how to maintain a package feed that is compatible with
+                existing package manager applications such as RPM, APT, and
+                OPKG, using an automated system is much preferred over a
+                manual system.
+                In either system, the main requirement is that binary package
+                version numbering increases in a linear fashion and that a
+                number of version components exist that support that linear
+                progression.
+                For information on how to ensure package revisioning remains
+                linear, see the
+                "<link linkend='automatically-incrementing-a-binary-package-revision-number'>Automatically Incrementing a Binary Package Revision Number</link>"
+                section.
+            </para>
+
+            <para>
+                The following three sections provide related information on the
+                PR Service, the manual method for "bumping"
+                <filename>PR</filename> and/or <filename>PV</filename>, and
+                on how to ensure binary package revisioning remains linear.
             </para>
 
             <section id='working-with-a-pr-service'>
@@ -7585,9 +7990,10 @@
                     All the inputs into a given task are represented by a
                     signature, which can trigger a rebuild when different.
                     Thus, the build system itself does not rely on the
-                    <filename>PR</filename> numbers to trigger a rebuild.
+                    <filename>PR</filename>, <filename>PV</filename>, and
+                    <filename>PE</filename> numbers to trigger a rebuild.
                     The signatures, however, can be used to generate
-                    <filename>PR</filename> values.
+                    these values.
                 </para>
 
                 <para>
@@ -7632,7 +8038,7 @@
                     </literallayout>
                     Once the service is started, packages will automatically
                     get increasing <filename>PR</filename> values and
-                    BitBake will take care of starting and stopping the server.
+                    BitBake takes care of starting and stopping the server.
                 </para>
 
                 <para>
@@ -7653,8 +8059,8 @@
 
                 <para>
                     It is also recommended you use build history, which adds
-                    some sanity checks to package versions, in conjunction with
-                    the server that is running the PR Service.
+                    some sanity checks to binary package versions, in
+                    conjunction with the server that is running the PR Service.
                     To enable build history, add the following to each building
                     system's <filename>local.conf</filename> file:
                     <literallayout class='monospaced'>
@@ -7668,18 +8074,23 @@
                 </para>
 
                 <note>
-                    <para>The OpenEmbedded build system does not maintain
-                    <filename>PR</filename> information as part of the
-                    shared state (sstate) packages.
-                    If you maintain an sstate feed, its expected that either
-                    all your building systems that contribute to the sstate
-                    feed use a shared PR Service, or you do not run a PR
-                    Service on any of your building systems.
-                    Having some systems use a PR Service while others do
-                    not leads to obvious problems.</para>
-                    <para>For more information on shared state, see the
-                    "<ulink url='&YOCTO_DOCS_REF_URL;#shared-state-cache'>Shared State Cache</ulink>"
-                    section in the Yocto Project Reference Manual.</para>
+                    <para>
+                        The OpenEmbedded build system does not maintain
+                        <filename>PR</filename> information as part of the
+                        shared state (sstate) packages.
+                        If you maintain an sstate feed, its expected that either
+                        all your building systems that contribute to the sstate
+                         feed use a shared PR Service, or you do not run a PR
+                        Service on any of your building systems.
+                        Having some systems use a PR Service while others do
+                        not leads to obvious problems.
+                    </para>
+
+                    <para>
+                        For more information on shared state, see the
+                        "<ulink url='&YOCTO_DOCS_REF_URL;#shared-state-cache'>Shared State Cache</ulink>"
+                        section in the Yocto Project Reference Manual.
+                    </para>
                 </note>
             </section>
 
@@ -7688,7 +8099,7 @@
 
                 <para>
                     The alternative to setting up a PR Service is to manually
-                    bump the
+                    "bump" the
                     <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
                     variable.
                 </para>
@@ -7722,7 +8133,7 @@
                 </para>
 
                 <para>
-                    When upgrading the version of a package, assuming the
+                    When upgrading the version of a binary package, assuming the
                     <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'>PV</ulink></filename>
                     changes, the <filename>PR</filename> variable should be
                     reset to "r0" (or "${INC_PR}.0" if you are using
@@ -7730,7 +8141,7 @@
                 </para>
 
                 <para>
-                    Usually, version increases occur only to packages.
+                    Usually, version increases occur only to binary packages.
                     However, if for some reason <filename>PV</filename> changes
                     but does not increase, you can increase the
                     <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PE'>PE</ulink></filename>
@@ -7739,13 +8150,89 @@
                 </para>
 
                 <para>
-                    Version numbering strives to follow the
+                    Binary package version numbering strives to follow the
                     <ulink url='http://www.debian.org/doc/debian-policy/ch-controlfields.html'>
                     Debian Version Field Policy Guidelines</ulink>.
                     These guidelines define how versions are compared and what
                     "increasing" a version means.
                 </para>
             </section>
+
+            <section id='automatically-incrementing-a-binary-package-revision-number'>
+                <title>Automatically Incrementing a Package Version Number</title>
+
+                <para>
+                    When fetching a repository, BitBake uses the
+                    <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
+                    variable to determine the specific source code revision
+                    from which to build.
+                    You set the <filename>SRCREV</filename> variable to
+                    <ulink url='&YOCTO_DOCS_REF_URL;#var-AUTOREV'><filename>AUTOREV</filename></ulink>
+                    to cause the OpenEmbedded build system to automatically use the
+                    latest revision of the software:
+                    <literallayout class='monospaced'>
+     SRCREV = "${AUTOREV}"
+                    </literallayout>
+                </para>
+
+                <para>
+                    Furthermore, you need to reference <filename>SRCPV</filename>
+                    in <filename>PV</filename> in order to automatically update
+                    the version whenever the revision of the source code
+                    changes.
+                    Here is an example:
+                    <literallayout class='monospaced'>
+     PV = "1.0+git${SRCPV}"
+                    </literallayout>
+                    The OpenEmbedded build system substitutes
+                    <filename>SRCPV</filename> with the following:
+                    <literallayout class='monospaced'>
+     AUTOINC+<replaceable>source_code_revision</replaceable>
+                    </literallayout>
+                    The build system replaces the <filename>AUTOINC</filename> with
+                    a number.
+                    The number used depends on the state of the PR Service:
+                    <itemizedlist>
+                        <listitem><para>
+                            If PR Service is enabled, the build system increments
+                            the number, which is similar to the behavior of
+                            <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>.
+                            This behavior results in linearly increasing package
+                            versions, which is desirable.
+                            Here is an example:
+                            <literallayout class='monospaced'>
+     hello-world-git_0.0+git0+b6558dd387-r0.0_armv7a-neon.ipk
+     hello-world-git_0.0+git1+dd2f5c3565-r0.0_armv7a-neon.ipk
+                            </literallayout>
+                            </para></listitem>
+                        <listitem><para>
+                            If PR Service is not enabled, the build system
+                            replaces the <filename>AUTOINC</filename>
+                            placeholder with zero (i.e. "0").
+                            This results in changing the package version since
+                            the source revision is included.
+                            However, package versions are not increased linearly.
+                            Here is an example:
+                            <literallayout class='monospaced'>
+     hello-world-git_0.0+git0+b6558dd387-r0.0_armv7a-neon.ipk
+     hello-world-git_0.0+git0+dd2f5c3565-r0.0_armv7a-neon.ipk
+                            </literallayout>
+                            </para></listitem>
+                    </itemizedlist>
+                </para>
+
+                <para>
+                    In summary, the OpenEmbedded build system does not track the
+                    history of binary package versions for this purpose.
+                    <filename>AUTOINC</filename>, in this case, is comparable to
+                    <filename>PR</filename>.
+                    If PR server is not enabled, <filename>AUTOINC</filename>
+                    in the package version is simply replaced by "0".
+                    If PR server is enabled, the build system keeps track of the
+                    package versions and bumps the number when the package
+                    revision changes.
+                </para>
+            </section>
         </section>
 
         <section id='handling-optional-module-packaging'>
@@ -8226,13 +8713,14 @@
                     <title>Using RPM</title>
 
                     <para>
-                        The <filename>smart</filename> application performs
+                        The <filename>dnf</filename> application performs
                         runtime package management of RPM packages.
                         You must perform an initial setup for
-                        <filename>smart</filename> on the target machine
+                        <filename>dnf</filename> on the target machine
                         if the
                         <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></ulink>,
-                        <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></ulink>, and
+                        <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></ulink>,
+                        and
                         <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></ulink>
                         variables have not been set or the target image was
                         built before the variables were set.
@@ -8244,21 +8732,26 @@
                         <filename>all</filename>, <filename>i586</filename>,
                         and <filename>qemux86</filename> from a server named
                         <filename>my.server</filename>.
-                        You must inform <filename>smart</filename> of the
-                        availability of these databases by issuing the
-                        following commands on the target:
+                        You must inform <filename>dnf</filename> of the
+                        availability of these databases by creating a
+                        <filename>/etc/yum.repos.d/oe-packages.repo</filename>
+                        file with the following content:
                         <literallayout class='monospaced'>
-     # smart channel --add i585 type=rpm-md baseurl=http://my.server/rpm/i586
-     # smart channel --add qemux86 type=rpm-md baseurl=http://my.server/rpm/qemux86
-     # smart channel --add all type=rpm-md baseurl=http://my.server/rpm/all
+     [oe-packages]
+     baseurl="http://my.server/rpm/i586 http://my.server/rpm/qemux86 http://my.server/rpm/all"
                         </literallayout>
                         From the target machine, fetch the repository:
                         <literallayout class='monospaced'>
-     # smart update
+     # dnf makecache
                         </literallayout>
-                        After everything is set up, <filename>smart</filename>
+                        After everything is set up, <filename>dnf</filename>
                         is able to find, install, and upgrade packages from
                         the specified repository.
+                        <note>
+                            See the
+                            <ulink url='http://dnf.readthedocs.io/en/latest/'>DNF documentation</ulink>
+                            for additional information.
+                        </note>
                     </para>
                 </section>
 
@@ -8364,6 +8857,127 @@
             </section>
         </section>
 
+        <section id='generating-and-using-signed-packages'>
+            <title>Generating and Using Signed Packages</title>
+            <para>
+                In order to add security to RPM packages used during a build,
+                you can take steps to securely sign them.
+                Once a signature is verified, the OpenEmbedded build system
+                can use the package in the build.
+                If security fails for a signed package, the build system
+                aborts the build.
+            </para>
+
+            <para>
+                This section describes how to sign RPM packages during a build
+                and how to use signed package feeds (repositories) when
+                doing a build.
+            </para>
+
+            <section id='signing-rpm-packages'>
+                <title>Signing RPM Packages</title>
+
+                <para>
+                    To enable signing RPM packages, you must set up the
+                    following configurations in either your
+                    <filename>local.config</filename> or
+                    <filename>distro.config</filename> file:
+                    <literallayout class='monospaced'>
+     # Inherit sign_rpm.bbclass to enable signing functionality
+     INHERIT += " sign_rpm"
+     # Define the GPG key that will be used for signing.
+     RPM_GPG_NAME = "<replaceable>key_name</replaceable>"
+     # Provide passphrase for the key
+     RPM_GPG_PASSPHRASE = "<replaceable>passphrase</replaceable>"
+                    </literallayout>
+                    <note>
+                        Be sure to supply appropriate values for both
+                        <replaceable>key_name</replaceable> and
+                        <replaceable>passphrase</replaceable>
+                    </note>
+                    Aside from the
+                    <filename>RPM_GPG_NAME</filename> and
+                    <filename>RPM_GPG_PASSPHRASE</filename> variables in the
+                    previous example, two optional variables related to signing
+                    exist:
+                    <itemizedlist>
+                        <listitem><para>
+                            <emphasis><filename>GPG_BIN</filename>:</emphasis>
+                            Specifies a <filename>gpg</filename> binary/wrapper
+                            that is executed when the package is signed.
+                            </para></listitem>
+                        <listitem><para>
+                            <emphasis><filename>GPG_PATH</filename>:</emphasis>
+                            Specifies the <filename>gpg</filename> home
+                            directory used when the package is signed.
+                            </para></listitem>
+                    </itemizedlist>
+                </para>
+            </section>
+
+            <section id='processing-package-feeds'>
+                <title>Processing Package Feeds</title>
+
+                <para>
+                    In addition to being able to sign RPM packages, you can
+                    also enable the OpenEmbedded build system to be able to
+                    handle previously signed package feeds for IPK
+                    packages.
+                    <note>
+                        The OpenEmbedded build system does not currently
+                        support signed DPKG or RPM package feeds.
+                    </note>
+                    The steps you need to take to enable signed package feed
+                    use are similar to the steps used to sign RPM packages.
+                    You must define the following in your
+                    <filename>local.config</filename> or
+                    <filename>distro.config</filename> file:
+                    <literallayout class='monospaced'>
+     INHERIT += "sign_package_feed"
+     PACKAGE_FEED_GPG_NAME = "<replaceable>key_name</replaceable>"
+     PACKAGE_FEED_GPG_PASSPHRASE_FILE = "<replaceable>path_to_file_containing_passphrase</replaceable>"
+                    </literallayout>
+                    For signed package feeds, the passphrase must exist in a
+                    separate file, which is pointed to by the
+                    <filename>PACKAGE_FEED_GPG_PASSPHRASE_FILE</filename>
+                    variable.
+                    Regarding security, keeping a plain text passphrase out of
+                    the configuration is more secure.
+                </para>
+
+                <para>
+                    Aside from the
+                    <filename>PACKAGE_FEED_GPG_NAME</filename> and
+                    <filename>PACKAGE_FEED_GPG_PASSPHRASE_FILE</filename>
+                    variables, three optional variables related to signed
+                    package feeds exist:
+                    <itemizedlist>
+                        <listitem><para>
+                            <emphasis><filename>GPG_BIN</filename>:</emphasis>
+                            Specifies a <filename>gpg</filename> binary/wrapper
+                            that is executed when the package is signed.
+                            </para></listitem>
+                        <listitem><para>
+                            <emphasis><filename>GPG_PATH</filename>:</emphasis>
+                            Specifies the <filename>gpg</filename> home
+                            directory used when the package is signed.
+                            </para></listitem>
+                        <listitem><para>
+                            <emphasis><filename>PACKAGE_FEED_GPG_SIGNATURE_TYPE</filename>:</emphasis>
+                            Specifies the type of <filename>gpg</filename>
+                            signature.
+                            This variable applies only to RPM and IPK package
+                            feeds.
+                            Allowable values for the
+                            <filename>PACKAGE_FEED_GPG_SIGNATURE_TYPE</filename>
+                            are "ASC", which is the default and specifies ascii
+                            armored, and "BIN", which specifies binary.
+                            </para></listitem>
+                    </itemizedlist>
+                </para>
+            </section>
+        </section>
+
         <section id='testing-packages-with-ptest'>
             <title>Testing Packages With ptest</title>
 
@@ -9129,6 +9743,13 @@
             tests, run available tests, and write and add your own tests.
         </para>
 
+        <para>
+            For information on the test and QA infrastructure available
+            within the Yocto Project, see the
+            "<ulink url='&YOCTO_DOCS_REF_URL;#testing-and-quality-assurance'>Testing and Quality Assurance</ulink>"
+            section in the Yocto Project Reference Manual.
+        </para>
+
         <section id='enabling-tests'>
             <title>Enabling Tests</title>
 
@@ -9182,12 +9803,13 @@
                         <listitem><para><emphasis>Be sure your host's firewall
                             accepts incoming connections from
                             192.168.7.0/24:</emphasis>
-                            Some of the tests (in particular smart tests) start an
-                            HTTP server on a random high number port, which is
-                            used to serve files to the target.
-                            The smart module serves
-                            <filename>${DEPLOY_DIR}/rpm</filename> so it can run
-                            smart channel commands. That means your host's firewall
+                            Some of the tests (in particular DNF tests) start
+                            an HTTP server on a random high number port,
+                            which is used to serve files to the target.
+                            The DNF module serves
+                            <filename>${WORKDIR}/oe-rootfs-repo</filename>
+                            so it can run DNF channel commands.
+                            That means your host's firewall
                             must accept incoming connections from 192.168.7.0/24,
                             which is the default IP range used for tap devices
                             by <filename>runqemu</filename>.</para></listitem>
@@ -9687,7 +10309,7 @@
                     <listitem><para>The default tests for the image are defined
                         as:
                         <literallayout class='monospaced'>
-     DEFAULT_TEST_SUITES_pn-<replaceable>image</replaceable> = "ping ssh df connman syslog xorg scp vnc date rpm smart dmesg"
+     DEFAULT_TEST_SUITES_pn-<replaceable>image</replaceable> = "ping ssh df connman syslog xorg scp vnc date rpm dnf dmesg"
                         </literallayout></para></listitem>
                     <listitem><para>Add your own test to the list of the
                         by using the following:
@@ -9885,7 +10507,7 @@
                                             </para></listitem>
                                         <listitem><para><emphasis><filename>server_ip</filename>:</emphasis>
                                             The host's IP address, which is
-                                            usually used by the "smart" test
+                                            usually used by the DNF test
                                             suite.
                                             </para></listitem>
                                         <listitem><para><emphasis><filename>run(cmd, timeout=None)</filename>:</emphasis>
@@ -10044,16 +10666,16 @@
         </para>
 
         <para>
-            To help get past the previously mentioned constraints, you can use Gdbserver.
-            Gdbserver runs on the remote target and does not load any debugging information
-            from the debugged process.
+            To help get past the previously mentioned constraints, you can use
+            gdbserver, which runs on the remote target and does not load any
+            debugging information from the debugged process.
             Instead, a GDB instance processes the debugging information that is run on a
             remote computer - the host GDB.
-            The host GDB then sends control commands to Gdbserver to make it stop or start the debugged
+            The host GDB then sends control commands to gdbserver to make it stop or start the debugged
             program, as well as read or write memory regions of that debugged program.
             All the debugging information loaded and processed as well
             as all the heavy debugging is done by the host GDB.
-            Offloading these processes gives the Gdbserver running on the target a chance to remain
+            Offloading these processes gives the gdbserver running on the target a chance to remain
             small and fast.
         </para>
 
@@ -10064,7 +10686,7 @@
             with their debugging information and also be sure the target is compiled with no optimizations.
             The host GDB must also have local access to all the libraries used by the
             debugged program.
-            Because Gdbserver does not need any local debugging information, the binaries on
+            Because gdbserver does not need any local debugging information, the binaries on
             the remote target can remain stripped.
             However, the binaries must also be compiled without optimization
             so they match the host's binaries.
@@ -10107,7 +10729,7 @@
                     the partial filesystem with the full filesystem.
                     </para></listitem>
                 <listitem><para>
-                    <emphasis>Configure the system to include Gdbserver in
+                    <emphasis>Configure the system to include gdbserver in
                     the target filesystem:</emphasis></para>
 
                     <para>Make the following addition in either your
@@ -10204,18 +10826,18 @@
                 <listitem><para>
                     <emphasis>Debug a program:</emphasis></para>
 
-                    <para>Debugging a program involves running Gdbserver
+                    <para>Debugging a program involves running gdbserver
                     on the target and then running Gdb on the host.
                     The example in this step debugs
                     <filename>gzip</filename>:
                     <literallayout class='monospaced'>
      root@qemux86:~# gdbserver localhost:1234 /bin/gzip —help
                     </literallayout>
-                    For additional Gdbserver options, see the
-                    <ulink url='https://www.gnu.org/software/gdb/documentation/'>Gdb Server Documentation</ulink>.
+                    For additional gdbserver options, see the
+                    <ulink url='https://www.gnu.org/software/gdb/documentation/'>GDB Server Documentation</ulink>.
                     </para>
 
-                    <para>After running Gdbserver on the target, you need
+                    <para>After running gdbserver on the target, you need
                     to run Gdb on the host and configure it and connect to
                     the target.
                     Use these commands:
@@ -10285,10 +10907,10 @@
         </section>
 
         <section id="platdev-gdb-remotedebug-launch-gdbserver">
-            <title>Launch Gdbserver on the Target</title>
+            <title>Launch gdbserver on the Target</title>
 
             <para>
-                Make sure Gdbserver is installed on the target.
+                Make sure gdbserver is installed on the target.
                 If it is not, install the package
                 <filename>gdbserver</filename>, which needs the
                 <filename>libthread-db1</filename> package.
@@ -10296,15 +10918,15 @@
 
             <para>
                 Here is an example, that when entered from the host,
-                connects to the target and launches Gdbserver in order to
+                connects to the target and launches gdbserver in order to
                 "debug" a binary named <filename>helloworld</filename>:
                 <literallayout class='monospaced'>
      $ gdbserver localhost:2345 /usr/bin/helloworld
                 </literallayout>
-                Gdbserver should now be listening on port 2345 for debugging
+                gdbserver should now be listening on port 2345 for debugging
                 commands coming from a remote GDB process that is running on
                 the host computer.
-                Communication between Gdbserver and the host GDB are done
+                Communication between gdbserver and the host GDB are done
                 using TCP.
                 To use other communication protocols, please refer to the
                 <ulink url='http://www.gnu.org/software/gdb/'>Gdbserver documentation</ulink>.
@@ -10876,10 +11498,11 @@
 
             <para>
                 Before you employ <filename>DL_DIR</filename> or the
-                archiver class, you need to decide how you choose to
-                provide source.
-                The source archiver class can generate tarballs and SRPMs
-                and can create them with various levels of compliance in mind.
+                <filename>archiver</filename> class, you need to decide how
+                you choose to provide source.
+                The source <filename>archiver</filename> class can generate
+                tarballs and SRPMs and can create them with various levels of
+                compliance in mind.
             </para>
 
             <para>
@@ -10974,9 +11597,9 @@
                     <ulink url='&YOCTO_DOCS_REF_URL;#var-COPY_LIC_DIRS'><filename>COPY_LIC_DIRS</filename></ulink>
                     and
                     <ulink url='&YOCTO_DOCS_REF_URL;#var-COPY_LIC_MANIFEST'><filename>COPY_LIC_MANIFEST</filename></ulink>
-                    add a copy of the license when the image is built but do not
-                    offer a path for adding licenses for newly installed packages
-                    to an image.
+                    add a copy of the license when the image is built but do
+                    not offer a path for adding licenses for newly installed
+                    packages to an image.
                     <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE_CREATE_PACKAGE'><filename>LICENSE_CREATE_PACKAGE</filename></ulink>
                     adds a separate package and an upgrade path for adding
                     licenses to an image.</para>
@@ -10984,7 +11607,8 @@
             </para>
 
             <para>
-                As the source archiver has already archived the original
+                As the source <filename>archiver</filename> class has already
+                archived the original
                 unmodified source that contains the license files,
                 you would have already met the requirements for inclusion
                 of the license information with source as defined by the GPL
@@ -10996,7 +11620,7 @@
             <title>Providing Compilation Scripts and Source Code Modifications</title>
 
             <para>
-                At this point, we have addressed all we need to address
+                At this point, we have addressed all we need to
                 prior to generating the image.
                 The next two requirements are addressed during the final
                 packaging of the release.
@@ -11015,7 +11639,7 @@
                 and a distro layer, and those those layers are used to patch,
                 compile, package, or modify (in any way) any open source
                 software included in your released images, you
-                might be required to to release those layers under section 3 of
+                might be required to release those layers under section 3 of
                 GPLv2 or section 1 of GPLv3.
                 One way of doing that is with a clean
                 checkout of the version of the Yocto Project and layers used
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml
index caa066e..49148ab 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml
@@ -158,6 +158,7 @@
                     Toaster, which is a web interface to the Yocto Project's
                     <link linkend='build-system-term'>OpenEmbedded Build System</link>.
                     </para></listitem>
+<!--
                 <listitem><para><emphasis>
                     <ulink url='http://www.youtube.com/watch?v=3ZlOu-gLsh0'>
                     Eclipse IDE Yocto Plug-in</ulink>:</emphasis>
@@ -165,6 +166,13 @@
                     demonstrates how an application developer uses Yocto Plug-in features within
                     the Eclipse IDE.
                     </para></listitem>
+-->
+                <listitem><para><emphasis>
+                    <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-appendix-latest-yp-eclipse-plug-in'>Eclipse IDE Yocto Plug-in</ulink>:</emphasis>
+                    Instructions that demonstrate how an application developer
+                    uses the Eclipse Yocto Project Plug-in feature within
+                    the Eclipse IDE.
+                    </para></listitem>
                 <listitem><para><emphasis>
                     <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>FAQ</ulink>:</emphasis>
                     A list of commonly asked questions and their answers.
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml
index 75c992f..ad32ac6 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml
@@ -1394,83 +1394,182 @@
         can be reviewed and merged by the appropriate maintainer.
     </para>
 
-    <para>
-        Before submitting any change, be sure to find out who you should be
-        notifying.
-        Several methods exist through which you find out who you should be copying
-        or notifying:
-        <itemizedlist>
-            <listitem><para><emphasis>Maintenance File:</emphasis>
-                Examine the <filename>maintainers.inc</filename> file, which is
-                located in the
-                <link linkend='source-directory'>Source Directory</link>
-                at <filename>meta-poky/conf/distro/include</filename>, to
-                see who is responsible for code.
-                </para></listitem>
-            <listitem><para><emphasis>Board Support Package (BSP) README Files:</emphasis>
-                For BSP maintainers of supported BSPs, you can examine
-                individual BSP <filename>README</filename> files.
-                In addition, some layers (such as the <filename>meta-intel</filename> layer),
-                include a <filename>MAINTAINERS</filename> file which contains
-                a list of all supported BSP maintainers for that layer.
-                </para></listitem>
-            <listitem><para><emphasis>Search by File:</emphasis>
-                Using <link linkend='git'>Git</link>, you can enter the
-                following command to bring up a short list of all commits
-                against a specific file:
-                <literallayout class='monospaced'>
+    <section id='submit-change-overview'>
+        <title>Overview</title>
+
+        <para>
+            The Yocto Project uses a mailing list and patch-based workflow
+            that is similar to the Linux kernel but contains important
+            differences.
+            In general, a mailing list exists through which you can submit
+            patches.
+            The specific mailing list you need to use depends on the
+            location of the code you are changing.
+            Each component (e.g. layer) should have a
+            <filename>README</filename> file that indicates where to send
+            the changes and which process to follow.
+        </para>
+
+        <para>
+            You can send the patch to the mailing list using whichever approach
+            you feel comfortable with to generate the patch.
+            Once sent, the patch is usually reviewed by the community at large.
+            If somebody has concerns with the patch, they will usually voice
+            their concern over the mailing list.
+            If a patch does not receive any negative reviews, the maintainer of
+            the affected layer typically takes the patch, tests it, and then
+            based on successful testing, merges the patch.
+        </para>
+
+        <para>
+            Specific to OpenEmbedded-Core, two commonly used testing trees
+            exist:
+            <itemizedlist>
+                <listitem><para>
+                    <emphasis>"ross/mut" branch:</emphasis>
+                    The "mut" (master-under-test) tree
+                    exists in the <filename>poky-contrib</filename> repository
+                    in the
+                    <ulink url='&YOCTO_GIT_URL;'>Yocto Project source repositories</ulink>.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>"master-next" branch:</emphasis>
+                    This branch is part of the main
+                    "poky" repository in the Yocto Project source repositories.
+                    </para></listitem>
+            </itemizedlist>
+            Maintainers use these branches to test submissions prior to merging
+            patches.
+            Thus, you can get an idea of the status of a patch based on
+            whether the patch has been merged into one of these branches.
+        </para>
+
+        <para>
+            This system is imperfect and patches can sometimes get lost in the
+            flow.
+            Asking about the status of a patch is reasonable if the patch
+            has been idle for a while with no feedback.
+            The Yocto Project does have plans to use
+            <ulink url='https://en.wikipedia.org/wiki/Patchwork_(software)'>Patchwork</ulink>
+            to track the status of patches and also to automatically preview
+            patches.
+        </para>
+
+        <para>
+            The following sections provide general instructions for both
+            pushing changes upstream and for submitting changes as patches.
+        </para>
+    </section>
+
+    <section id='submit-change-submissions-to-poky'>
+        <title>Submissions to Poky</title>
+
+        <para>
+            The "poky" repository, which is the Yocto Project's reference build
+            environment, is a hybrid repository that contains several
+            individual pieces (e.g. BitBake, OpenEmbedded-Core, meta-yocto,
+            documentation, and so forth) built using the combo-layer tool.
+            The upstream location used for submitting changes varies by
+            component:
+            <itemizedlist>
+                <listitem><para>
+                    <emphasis>Core Metadata:</emphasis>
+                    Send your patch to the
+                    <ulink url='http://lists.openembedded.org/mailman/listinfo/openembedded-core'>openembedded-core</ulink>
+                    mailing list.  For example, a change to anything under
+                    the <filename>meta</filename> or
+                    <filename>scripts</filename> directories should be sent
+                    to this mailing list.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>BitBake:</emphasis>
+                    For changes to BitBake (i.e. anything under the
+                    <filename>bitbake</filename> directory), send your patch
+                    to the
+                    <ulink url='http://lists.openembedded.org/mailman/listinfo/bitbake-devel'>bitbake-devel</ulink>
+                    mailing list.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>"meta-yocto-bsp" and "meta-poky" trees:</emphasis>
+                    These trees are
+                    part of the "meta-yocto" repository in the Yocto Project
+                    source repositories.
+                    Use the
+                    <ulink url='https://lists.yoctoproject.org/listinfo/poky'>poky</ulink>
+                    mailing list.
+                    </para></listitem>
+            </itemizedlist>
+        </para>
+    </section>
+
+    <section id='submit-change-submissions-to-other-layers'>
+        <title>Submissions to Other Layers</title>
+
+        <para>
+            For changes to other layers hosted in the Yocto Project source
+            repositories (i.e. <filename>yoctoproject.org</filename>), tools,
+            and the Yocto Project documentation, use the
+            <ulink url='https://lists.yoctoproject.org/listinfo/yocto'>Yocto Project</ulink>
+            general mailing list.
+            <note>
+                Sometimes a layer's documentation specifies to use a
+                particular mailing list.
+                If so, use that list.
+            </note>
+            For additional recipes that do not fit into the core Metadata, you
+            should determine which layer the recipe should go into and submit
+            the change in the manner recommended by the documentation (e.g.
+            the <filename>README</filename> file) supplied with the layer.
+            If in doubt, please ask on the Yocto general mailing list or on
+            the openembedded-devel mailing list.
+        </para>
+    </section>
+
+    <section id='submit-change-patch-submission-details'>
+        <title>Patch Submission Details</title>
+
+        <para>
+            When submitting any change, you can check who you should be
+            notifying.
+            Use either of these methods to find out:
+            <itemizedlist>
+                <listitem><para>
+                    <emphasis>Maintenance File:</emphasis>
+                    Examine the <filename>maintainers.inc</filename> file, which is
+                    located in the
+                    <link linkend='source-directory'>Source Directory</link>
+                    at <filename>meta-poky/conf/distro/include</filename>, to
+                    see who is responsible for code.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>Search by File:</emphasis>
+                    Using <link linkend='git'>Git</link>, you can enter the
+                    following command to bring up a short list of all commits
+                    against a specific file:
+                    <literallayout class='monospaced'>
      git shortlog -- <replaceable>filename</replaceable>
-                </literallayout>
-                Just provide the name of the file for which you are interested.
-                The information returned is not ordered by history but does
-                include a list of all committers grouped by name.
-                From the list, you can see who is responsible for the bulk of
-                the changes against the file.
-                </para></listitem>
-        </itemizedlist>
-    </para>
+                    </literallayout>
+                    Just provide the name of the file for which you are interested.
+                    The information returned is not ordered by history but does
+                    include a list of all committers grouped by name.
+                    From the list, you can see who is responsible for the bulk of
+                    the changes against the file.
+                    </para></listitem>
+            </itemizedlist>
+        </para>
 
-    <para>
-        For a list of the Yocto Project and related mailing lists, see the
-        "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>" section in
-        the Yocto Project Reference Manual.
-    </para>
+        <para>
+            For a list of the Yocto Project and related mailing lists, see the
+            "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>"
+            section in the Yocto Project Reference Manual.
+        </para>
 
-    <para>
-        Here is some guidance on which mailing list to use for what type of change:
-        <itemizedlist>
-            <listitem><para>For changes to the core
-                <link linkend='metadata'>Metadata</link>, send your patch to the
-                <ulink url='&OE_LISTS_URL;/listinfo/openembedded-core'>openembedded-core</ulink> mailing list.
-                For example, a change to anything under the <filename>meta</filename> or
-                <filename>scripts</filename> directories
-                should be sent to this mailing list.</para></listitem>
-            <listitem><para>For changes to BitBake (anything under the <filename>bitbake</filename>
-                directory), send your patch to the
-                <ulink url='&OE_LISTS_URL;/listinfo/bitbake-devel'>bitbake-devel</ulink> mailing list.</para></listitem>
-            <listitem><para>For changes to <filename>meta-poky</filename>, send your patch to the
-                <ulink url='&YOCTO_LISTS_URL;/listinfo/poky'>poky</ulink> mailing list.</para></listitem>
-            <listitem><para>For changes to other layers hosted on
-                <filename>yoctoproject.org</filename> (unless the
-                layer's documentation specifies otherwise), tools, and Yocto Project
-                documentation, use the
-                <ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'>yocto</ulink> mailing list.</para></listitem>
-            <listitem><para>For additional recipes that do not fit into the core Metadata,
-                you should determine which layer the recipe should go into and submit the
-                change in the manner recommended by the documentation (e.g. README) supplied
-                with the layer. If in doubt, please ask on the
-                <ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'>yocto</ulink> or
-                <ulink url='&OE_LISTS_URL;/listinfo/openembedded-devel'>openembedded-devel</ulink>
-                mailing lists.</para></listitem>
-        </itemizedlist>
-    </para>
-
-    <para>
-        When you send a patch, be sure to include a "Signed-off-by:"
-        line in the same style as required by the Linux kernel.
-        Adding this line signifies that you, the submitter, have agreed to the Developer's Certificate of Origin 1.1
-        as follows:
-        <literallayout class='monospaced'>
+        <para>
+            When you send a patch, be sure to include a "Signed-off-by:"
+            line in the same style as required by the Linux kernel.
+            Adding this line signifies that you, the submitter, have agreed
+            to the Developer's Certificate of Origin 1.1 as follows:
+            <literallayout class='monospaced'>
      Developer's Certificate of Origin 1.1
 
      By making a contribution to this project, I certify that:
@@ -1496,68 +1595,76 @@
          personal information I submit with it, including my sign-off) is
          maintained indefinitely and may be redistributed consistent with
          this project or the open source license(s) involved.
-        </literallayout>
-    </para>
+            </literallayout>
+        </para>
 
-    <para>
-        In a collaborative environment, it is necessary to have some sort of standard
-        or method through which you submit changes.
-        Otherwise, things could get quite chaotic.
-        One general practice to follow is to make small, controlled changes.
-        Keeping changes small and isolated aids review, makes merging/rebasing easier
-        and keeps the change history clean when anyone needs to refer to it in future.
-    </para>
+        <para>
+            In a collaborative environment, it is necessary to have some sort
+            of standard or method through which you submit changes.
+            Otherwise, things could get quite chaotic.
+            One general practice to follow is to make small, controlled changes.
+            Keeping changes small and isolated aids review, makes
+            merging/rebasing easier and keeps the change history clean should
+            anyone need to refer to it in future.
+        </para>
 
-    <para>
-        When you make a commit, you must follow certain standards established by the
-        OpenEmbedded and Yocto Project development teams.
-        For each commit, you must provide a single-line summary of the change and you
-        should almost always provide a more detailed description of what you did (i.e.
-        the body of the commit message).
-        The only exceptions for not providing a detailed description would be if your
-        change is a simple, self-explanatory change that needs no further description
-        beyond the summary.
-        Here are the guidelines for composing a commit message:
-        <itemizedlist>
-            <listitem><para>Provide a single-line, short summary of the change.
-                This summary is typically viewable in the "shortlist" of changes.
-                Thus, providing something short and descriptive that gives the reader
-                a summary of the change is useful when viewing a list of many commits.
-                This short description should be prefixed by the recipe name (if changing a recipe), or
-                else the short form path to the file being changed.
-                </para></listitem>
-            <listitem><para>For the body of the commit message, provide detailed information
-                that describes what you changed, why you made the change, and the approach
-                you used. It may also be helpful if you mention how you tested the change.
-                Provide as much detail as you can in the body of the commit message.
-                </para></listitem>
-            <listitem><para>
-                If the change addresses a specific bug or issue that is
-                associated with a bug-tracking ID, include a reference to that
-                ID in your detailed description.
-                For example, the Yocto Project uses a specific convention for
-                bug references - any commit that addresses a specific bug should
-                use the following form for the detailed description:
-                <literallayout class='monospaced'>
+        <para>
+            When you make a commit, you must follow certain standards
+            established by the OpenEmbedded and Yocto Project development teams.
+            For each commit, you must provide a single-line summary of the
+            change and you should almost always provide a more detailed
+            description of what you did (i.e. the body of the commit message).
+            The only exceptions for not providing a detailed description would
+            be if your change is a simple, self-explanatory change that needs
+            no further description beyond the summary.
+            Here are the guidelines for composing a commit message:
+            <itemizedlist>
+                <listitem><para>
+                    Provide a single-line, short summary of the change.
+                    This summary is typically viewable in the "shortlist" of
+                    changes.
+                    Thus, providing something short and descriptive that
+                    gives the reader a summary of the change is useful when
+                    viewing a list of many commits.
+                    You should prefix this short description with the recipe
+                    name (if changing a recipe), or else with the short form
+                    path to the file being changed.
+                    </para></listitem>
+                <listitem><para>
+                    For the body of the commit message, provide detailed
+                    information that describes what you changed, why you made
+                    the change, and the approach you used.
+                    It might also be helpful if you mention how you tested
+                    the change.
+                    Provide as much detail as you can in the body of the
+                    commit message.
+                    </para></listitem>
+                <listitem><para>
+                    If the change addresses a specific bug or issue that is
+                    associated with a bug-tracking ID, include a reference
+                    to that ID in your detailed description.
+                    For example, the Yocto Project uses a specific convention
+                    for bug references - any commit that addresses a specific
+                    bug should use the following form for the detailed
+                    description.
+                    Be sure to use the actual bug-tracking ID from
+                    Bugzilla for
+                    <replaceable>bug-id</replaceable>:
+                    <literallayout class='monospaced'>
      Fixes [YOCTO #<replaceable>bug-id</replaceable>]
 
      <replaceable>detailed description of change</replaceable>
-                </literallayout></para></listitem>
-                Where <replaceable>bug-id</replaceable> is replaced with the
-                specific bug ID from the Yocto Project Bugzilla instance.
-        </itemizedlist>
-    </para>
+                    </literallayout>
+                    </para></listitem>
+            </itemizedlist>
+        </para>
 
-    <para>
-        You can find more guidance on creating well-formed commit messages at this OpenEmbedded
-        wiki page:
-        <ulink url='&OE_HOME_URL;/wiki/Commit_Patch_Message_Guidelines'></ulink>.
-    </para>
-
-    <para>
-        The next two sections describe general instructions for both pushing
-        changes upstream and for submitting changes as patches.
-    </para>
+        <para>
+            You can find more guidance on creating well-formed commit messages
+            at this OpenEmbedded wiki page:
+            <ulink url='&OE_HOME_URL;/wiki/Commit_Patch_Message_Guidelines'></ulink>.
+        </para>
+    </section>
 
     <section id='pushing-a-change-upstream'>
         <title>Using Scripts to Push a Change Upstream and Request a Pull</title>
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml
index b59f54b..b8527f6 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml
@@ -278,7 +278,7 @@
                 applications using the Eclipse Integrated Development Environment (IDE),
                 you will need this plug-in.
                 See the
-                "<ulink url='&YOCTO_DOCS_SDK_URL;#setting-up-the-eclipse-ide'>Setting up the Eclipse IDE</ulink>"
+                "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-appendix-latest-yp-eclipse-plug-in'>Using Eclipse</ulink>"
                 section in the Yocto Project Software Development Kit (SDK)
                 Developer's Guide for more information.</para></listitem>
         </itemizedlist>
@@ -328,6 +328,96 @@
     </para>
 </section>
 
+<section id='flashing-images-using-bmaptool'>
+    <title>Flashing Images Using <filename>bmaptool</filename></title>
+
+    <para>
+        An easy way to flash an image to a bootable device is to use
+        <filename>bmaptool</filename>, which is integrated into the
+        OpenEmbedded build system.
+    </para>
+
+    <para>
+        Following, is an example that shows how to flash a Wic image.
+        <note>
+            You can use <filename>bmaptool</filename> to flash any
+            type of image.
+        </note>
+        Use these steps to flash an image using
+        <filename>bmaptool</filename>:
+        <note>
+            Unless you are able to install the
+            <filename>bmap-tools</filename> package as mentioned in the note
+            in the second bullet of step 3 further down, you will need to build
+            <filename>bmaptool</filename> before using it.
+            Build the tool using the following command:
+            <literallayout class='monospaced'>
+     $ bitbake bmap-tools-native
+            </literallayout>
+        </note>
+        <orderedlist>
+            <listitem><para>
+                Add the following to your <filename>local.conf</filename>
+                file:
+                <literallayout class='monospaced'>
+     IMAGE_FSTYPES += "wic wic.bmap"
+                </literallayout>
+                </para></listitem>
+            <listitem><para>
+                Either have your image ready (pre-built) or take the step
+                build the image:
+                <literallayout class='monospaced'>
+     $ bitbake <replaceable>image</replaceable>
+                </literallayout>
+                </para></listitem>
+            <listitem><para>
+                Flash the image to the media by using
+                <filename>bmaptool</filename> depending on your particular
+                setup:
+                <itemizedlist>
+                    <listitem><para>
+                        If you have write access to the media,
+                        use this command form:
+                        <literallayout class='monospaced'>
+     $ oe-run-native bmaptool copy ./tmp/deploy/images/qemux86-64/core-image-minimal-<replaceable>machine</replaceable>.wic /dev/sd<replaceable>X</replaceable>
+                        </literallayout>
+                        </para></listitem>
+                    <listitem><para>
+                        If you do not have write access to
+                        the media, use the following
+                        commands:
+                        <literallayout class='monospaced'>
+     $ sudo bash
+     $ PATH=tmp/sysroots/x86_64-linux/usr/bin/ bmaptool copy ./tmp/deploy/images/qemux86-64/core-image-minimal-<replaceable>machine</replaceable>.wic /dev/sd<replaceable>X</replaceable>
+                        </literallayout>
+                        <note>
+                            If you are using Ubuntu or Debian distributions,
+                            you can install the
+                            <filename>bmap-tools</filename> package using the
+                            following command and then use the tool
+                            without specifying
+                            <filename>PATH</filename> even from the
+                            root account:
+                            <literallayout class='monospaced'>
+     $ sudo apt-get install bmap-tools
+                            </literallayout>
+                        </note>
+                        </para></listitem>
+                </itemizedlist>
+                </para></listitem>
+        </orderedlist>
+    </para>
+
+    <para>
+        For help on the <filename>bmaptool</filename> command, use either of
+        the following commands:
+        <literallayout class='monospaced'>
+     $ bmaptool --help
+     $ oe-run-native bmaptool --help
+        </literallayout>
+    </para>
+</section>
+
 <section id='using-pre-built-binaries-and-qemu'>
     <title>Using Pre-Built Binaries and QEMU</title>
 
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml
index 2ce1652..26ee974 100644
--- a/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml
@@ -92,14 +92,29 @@
                 <revremark>Released with the Yocto Project 2.2 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.1</revnumber>
-                <date>January 2017</date>
-                <revremark>Released with the Yocto Project 2.2.1 Release.</revremark>
+                <revnumber>2.3</revnumber>
+                <date>May 2017</date>
+                <revremark>Released with the Yocto Project 2.3 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.2</revnumber>
+                <revnumber>2.3.1</revnumber>
                 <date>June 2017</date>
-                <revremark>Released with the Yocto Project 2.2.2 Release.</revremark>
+                <revremark>Released with the Yocto Project 2.3.1 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.2</revnumber>
+                <date>September 2017</date>
+                <revremark>Released with the Yocto Project 2.3.2 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.3</revnumber>
+                <date>January 2018</date>
+                <revremark>Released with the Yocto Project 2.3.3 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.4</revnumber>
+                <date>April 2018</date>
+                <revremark>Released with the Yocto Project 2.3.4 Release.</revremark>
             </revision>
         </revhistory>
 
@@ -116,12 +131,32 @@
           Creative Commons.
       </para>
 
-      <note>
-          For the latest version of this manual associated with this
-          Yocto Project release, see the
-          <ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Manual</ulink>
-          from the Yocto Project website.
-      </note>
+            <note><title>Manual Notes</title>
+                <itemizedlist>
+                    <listitem><para>
+                        For the latest version of the Yocto Project Development
+                        Manual associated with this Yocto Project release
+                        (version &YOCTO_DOC_VERSION;),
+                        see the Yocto Project Development Manual from the
+                        <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+                        </para></listitem>
+                    <listitem><para>
+                        This version of the manual is version
+                        &YOCTO_DOC_VERSION;.
+                        For later releases of the Yocto Project (if they exist),
+                        go to the
+                        <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+                        and use the drop-down "Active Releases" button
+                        and choose the Yocto Project version for which you want
+                        the manual.
+                        </para></listitem>
+                    <listitem><para>
+                        For an in-development version of the Yocto Project
+                        Development Manual, see
+                        <ulink url='&YOCTO_DOCS_URL;/latest/dev-manual/dev-manual.html'></ulink>.
+                        </para></listitem>
+                </itemizedlist>
+            </note>
     </legalnotice>
 
     </bookinfo>
diff --git a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-advanced.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-advanced.xml
index 9e15f17..a5ccfdc 100644
--- a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-advanced.xml
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-advanced.xml
@@ -83,13 +83,14 @@
         The linux-yocto style recipes can optionally define the following
         variables:
         <literallayout class='monospaced'>
-     <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'>KERNEL_FEATURES</ulink>
-     <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'>LINUX_KERNEL_TYPE</ulink>
+     KERNEL_FEATURES
+     LINUX_KERNEL_TYPE
         </literallayout>
     </para>
 
     <para>
-        <filename>LINUX_KERNEL_TYPE</filename> defines the kernel type to be
+        <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink>
+        defines the kernel type to be
         used in assembling the configuration.
         If you do not specify a <filename>LINUX_KERNEL_TYPE</filename>,
         it defaults to "standard".
@@ -134,7 +135,9 @@
     </para>
 
     <para>
-        You can use the <filename>KERNEL_FEATURES</filename> variable
+        You can use the
+        <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink>
+        variable
         to include features (configuration fragments, patches, or both) that
         are not already included by the <filename>KMACHINE</filename> and
         <filename>LINUX_KERNEL_TYPE</filename> variable combination.
@@ -167,175 +170,6 @@
     </para>
 </section>
 
-<section id='kernel-metadata-location'>
-    <title>Kernel Metadata Location</title>
-
-    <para>
-        Kernel Metadata always exists outside of the kernel tree either
-        defined in a kernel recipe (recipe-space) or outside of the recipe.
-        Where you choose to define the Metadata depends on what you want
-        to do and how you intend to work.
-        Regardless of where you define the kernel Metadata, the syntax used
-        applies equally.
-    </para>
-
-    <para>
-        If you are unfamiliar with the Linux kernel and only wish
-        to apply a configuration and possibly a couple of patches provided to
-        you by others, the recipe-space method is recommended.
-        This method is also a good approach if you are working with Linux kernel
-        sources you do not control or if you just do not want to maintain a
-        Linux kernel Git repository on your own.
-        For partial information on how you can define kernel Metadata in
-        the recipe-space, see the
-        "<link linkend='modifying-an-existing-recipe'>Modifying an Existing Recipe</link>"
-        section.
-    </para>
-
-    <para>
-        Conversely, if you are actively developing a kernel and are already
-        maintaining a Linux kernel Git repository of your own, you might find
-        it more convenient to work with kernel Metadata kept outside the
-        recipe-space.
-        Working with Metadata in this area can make iterative development of
-        the Linux kernel more efficient outside of the BitBake environment.
-    </para>
-
-    <section id='recipe-space-metadata'>
-        <title>Recipe-Space Metadata</title>
-
-        <para>
-            When stored in recipe-space, the kernel Metadata files reside in a
-            directory hierarchy below
-            <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>.
-            For a linux-yocto recipe or for a Linux kernel recipe derived
-            by copying and modifying
-            <filename>oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb</filename>
-            to a recipe in your layer, <filename>FILESEXTRAPATHS</filename>
-            is typically set to
-            <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-THISDIR'><filename>THISDIR</filename></ulink><filename>}/${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>.
-            See the "<link linkend='modifying-an-existing-recipe'>Modifying an Existing Recipe</link>"
-            section for more information.
-        </para>
-
-        <para>
-            Here is an example that shows a trivial tree of kernel Metadata
-            stored in recipe-space within a BSP layer:
-            <literallayout class='monospaced'>
-     meta-<replaceable>my_bsp_layer</replaceable>/
-     `-- recipes-kernel
-         `-- linux
-             `-- linux-yocto
-                 |-- bsp-standard.scc
-                 |-- bsp.cfg
-                 `-- standard.cfg
-            </literallayout>
-        </para>
-
-        <para>
-            When the Metadata is stored in recipe-space, you must take
-            steps to ensure BitBake has the necessary information to decide
-            what files to fetch and when they need to be fetched again.
-            It is only necessary to specify the <filename>.scc</filename>
-            files on the
-            <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>.
-            BitBake parses them and fetches any files referenced in the
-            <filename>.scc</filename> files by the <filename>include</filename>,
-            <filename>patch</filename>, or <filename>kconf</filename> commands.
-            Because of this, it is necessary to bump the recipe
-            <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
-            value when changing the content of files not explicitly listed
-            in the <filename>SRC_URI</filename>.
-        </para>
-    </section>
-
-    <section id='metadata-outside-the-recipe-space'>
-        <title>Metadata Outside the Recipe-Space</title>
-
-        <para>
-            When stored outside of the recipe-space, the kernel Metadata
-            files reside in a separate repository.
-            The OpenEmbedded build system adds the Metadata to the build as
-            a "ktype=meta" repository through the
-            <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
-            variable.
-            As an example, consider the following <filename>SRC_URI</filename>
-            statement from the <filename>linux-yocto_4.4.bb</filename>
-            kernel recipe:
-            <literallayout class='monospaced'>
-     SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;name=machine;branch=${KBRANCH}; \
-                git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA}"
-            </literallayout>
-            <filename>${KMETA}</filename>, in this context, is simply used to
-            name the directory into which the Git fetcher places the Metadata.
-            This behavior is no different than any multi-repository
-            <filename>SRC_URI</filename> statement used in a recipe.
-        </para>
-
-        <para>
-            You can keep kernel Metadata in a "kernel-cache", which is a
-            directory containing configuration fragments.
-            As with any Metadata kept outside the recipe-space, you simply
-            need to use the <filename>SRC_URI</filename> statement with the
-            "type=kmeta" attribute.
-            Doing so makes the kernel Metadata available during the
-            configuration phase.
-        </para>
-
-<!--
-
-
-        <para>
-            Following is an example that shows how a trivial tree of Metadata
-            is stored in a custom Linux kernel Git repository:
-            <literallayout class='monospaced'>
-     meta/
-     `&dash;&dash; cfg
-         `&dash;&dash; kernel-cache
-             |&dash;&dash; bsp-standard.scc
-             |&dash;&dash; bsp.cfg
-             `&dash;&dash; standard.cfg
-            </literallayout>
-        </para>
-
-        <para>
-            To use a branch different from where the sources reside,
-            specify the branch in the <filename>KMETA</filename> variable
-            in your Linux kernel recipe.
-            Here is an example:
-            <literallayout class='monospaced'>
-     KMETA = "meta"
-            </literallayout>
-            To use the same branch as the sources, set
-            <filename>KMETA</filename> to an empty string:
-            <literallayout class='monospaced'>
-     KMETA = ""
-            </literallayout>
-            If you are working with your own sources and want to create an
-            orphan <filename>meta</filename> branch, use these commands
-            from within your Linux kernel Git repository:
-            <literallayout class='monospaced'>
-     $ git checkout &dash;&dash;orphan meta
-     $ git rm -rf .
-     $ git commit &dash;&dash;allow-empty -m "Create orphan meta branch"
-            </literallayout>
-        </para>
--->
-
-        <para>
-            If you modify the Metadata, you must not forget to update the
-            <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
-            statements in the kernel's recipe.
-            In particular, you need to update the
-            <filename>SRCREV_meta</filename> variable to match the commit in
-            the <filename>KMETA</filename> branch you wish to use.
-            Changing the data in these branches and not updating the
-            <filename>SRCREV</filename> statements to match will cause the
-            build to fetch an older commit.
-        </para>
-    </section>
-</section>
-
 <section id='kernel-metadata-syntax'>
     <title>Kernel Metadata Syntax</title>
 
@@ -690,170 +524,219 @@
         <title>BSP Descriptions</title>
 
         <para>
-            BSP descriptions combine kernel types with hardware-specific
-            features.
-            The hardware-specific portion is typically defined
-            independently, and then aggregated with each supported kernel
-            type.
-            Consider this simple BSP description that supports the
-            <replaceable>mybsp</replaceable> machine:
-            <literallayout class='monospaced'>
-     <replaceable>mybsp</replaceable>.scc:
-        define KMACHINE <replaceable>mybsp</replaceable>
-        define KTYPE standard
-        define KARCH i386
-
-        kconf <replaceable>mybsp</replaceable>.cfg
-            </literallayout>
-            Every BSP description should define the
-            <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>,
-            <ulink url='&YOCTO_DOCS_REF_URL;#var-KTYPE'><filename>KTYPE</filename></ulink>,
-            and <ulink url='&YOCTO_DOCS_REF_URL;#var-KARCH'><filename>KARCH</filename></ulink>
-            variables.
-            These variables allow the OpenEmbedded build system to identify
-            the description as meeting the criteria set by the recipe being
-            built.
-            This simple example supports the "mybsp" machine for the "standard"
-            kernel and the "i386" architecture.
-        </para>
-
-        <para>
-            Be aware that a hard link between the
-            <filename>KTYPE</filename> variable and a kernel type
-            description file does not exist.
-            Thus, if you do not have kernel types defined in your kernel
-            Metadata, you only need to ensure that the kernel recipe's
-            <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink>
-            variable and the <filename>KTYPE</filename> variable in the
-            BSP description file match.
+            BSP descriptions (i.e. <filename>*.scc</filename> files)
+            combine kernel types with hardware-specific features.
+            The hardware-specific Metadata is typically defined
+            independently in the BSP layer, and then aggregated with each
+            supported kernel type.
             <note>
-                Future versions of the tooling make the specification of
-                <filename>KTYPE</filename> in the BSP optional.
+                For BSPs supported by the Yocto Project, the BSP description
+                files are located in the <filename>bsp</filename> directory
+                of the <filename>yocto-kernel-cache</filename> repository
+                organized under the "Yocto Linux Kernel" heading in the
+                <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi'>Yocto Project Source Repositories</ulink>.
             </note>
         </para>
 
         <para>
-            If you did want to separate your kernel policy from your
-            hardware configuration, you could do so by specifying a kernel
-            type, such as "standard" and including that description file
-            in the BSP description file.
-            See the "<link linkend='kernel-types'>Kernel Types</link>" section
-            for more information.
+            This section provides a BSP description structural overview along
+            with aggregation concepts as well as a detailed example using
+            a BSP supported by the Yocto Project (i.e. Minnow Board).
         </para>
 
-        <para>
-            You might also have multiple hardware configurations that you
-            aggregate into a single hardware description file that you
-            could include in the BSP description file, rather than referencing
-            a single <filename>.cfg</filename> file.
-            Consider the following:
-            <literallayout class='monospaced'>
-     <replaceable>mybsp</replaceable>.scc:
-        define KMACHINE mybsp
-        define KTYPE standard
-        define KARCH i386
+        <section id='bsp-description-file-overview'>
+            <title>Overview</title>
 
-        include standard.scc
-        include <replaceable>mybsp</replaceable>-hw.scc
-            </literallayout>
-        </para>
+            <para>
+                For simplicity, consider the following top-level BSP
+                description file.
+                Top-level BSP descriptions files employ both a structure
+                and naming convention for consistency.
+                The naming convention for the file is as follows:
+                <literallayout class='monospaced'>
+     <replaceable>bsp_name</replaceable>-<replaceable>kernel_type</replaceable>.scc
+                </literallayout>
+                Here are some example top-level BSP filenames for the
+                Minnow Board BSP, which is supported by the Yocto Project:
+                <literallayout class='monospaced'>
+     minnow-standard.scc
+     minnow-preempt-rt.scc
+     minnow-tiny.scc
+                </literallayout>
+                Each file uses the BSP name followed by the kernel type.
+            </para>
 
-        <para>
-            In the above example, <filename>standard.scc</filename>
-            aggregates all the configuration fragments, patches, and
-            features that make up your standard kernel policy whereas
-            <replaceable>mybsp</replaceable><filename>-hw.scc</filename>
-            aggregates all those necessary
-            to support the hardware available on the
-            <replaceable>mybsp</replaceable> machine.
-            For information on how to break a complete
-            <filename>.config</filename> file into the various
-            configuration fragments, see the
-            "<link linkend='generating-configuration-files'>Generating Configuration Files</link>"
-            section.
-        </para>
+            <para>
+                is simple BSP description file whose name has the
+                form
+                <replaceable>mybsp</replaceable><filename>-standard</filename>
+                and supports the <replaceable>mybsp</replaceable> machine using
+                a standard kernel:
+                <literallayout class='monospaced'>
+     define KMACHINE <replaceable>mybsp</replaceable>
+     define KTYPE standard
+     define KARCH i386
 
-        <para>
-            Many real-world examples are more complex.
-            Like any other <filename>.scc</filename> file, BSP
-            descriptions can aggregate features.
-            Consider the Minnow BSP definition from the
-            <filename>linux-yocto-3.19</filename>
-            Git repository:
-            <literallayout class='monospaced'>
+     include ktypes/standard
+
+     include <replaceable>mybsp</replaceable>.scc
+
+     kconf hardware <replaceable>mybsp</replaceable>-<replaceable>extra</replaceable>.cfg
+                </literallayout>
+                Every top-level BSP description file should define the
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>,
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-KTYPE'><filename>KTYPE</filename></ulink>,
+                and <ulink url='&YOCTO_DOCS_REF_URL;#var-KARCH'><filename>KARCH</filename></ulink>
+                variables.
+                These variables allow the OpenEmbedded build system to identify
+                the description as meeting the criteria set by the recipe being
+                built.
+                This simple example supports the "mybsp" machine for the "standard"
+                kernel and the "i386" architecture.
+            </para>
+
+            <para>
+                Be aware that a hard link between the
+                <filename>KTYPE</filename> variable and a kernel type description
+                file does not exist.
+                Thus, if you do not have kernel types defined in your kernel
+                Metadata, you only need to ensure that the kernel recipe's
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink>
+                variable and the <filename>KTYPE</filename> variable in the
+                BSP description file match.
+                <note>
+                    Future versions of the tooling make the specification of
+                    <filename>KTYPE</filename> in the BSP optional.
+                </note>
+            </para>
+
+            <para>
+                To separate your kernel policy from your hardware configuration,
+                you include a kernel type (<filename>ktype</filename>), such as
+                "standard".
+                In the previous example, this is done using the following:
+                <literallayout class='monospaced'>
+     include ktypes/standard
+                </literallayout>
+                In the previous example, <filename>ktypes/standard.scc</filename>
+                aggregates all the configuration fragments, patches, and
+                features that make up your standard kernel policy.
+                See the "<link linkend='kernel-types'>Kernel Types</link>" section
+                for more information.
+            </para>
+
+            <para>
+                To aggregate common configurations and features specific to the
+                kernel for <replaceable>mybsp</replaceable>, use the following:
+                <literallayout class='monospaced'>
+     include <replaceable>mybsp</replaceable>.scc
+                </literallayout>
+                For information on how to break a complete
+                <filename>.config</filename> file into the various
+                configuration fragments, see the
+                "<link linkend='generating-configuration-files'>Generating Configuration Files</link>"
+                section.
+            </para>
+
+            <para>
+                Finally, if you have any configurations specific to the
+                hardware that are not in a <filename>*.scc</filename> file,
+                you can include them as follows:
+                <literallayout class='monospaced'>
+     kconf hardware <replaceable>mybsp</replaceable>-<replaceable>extra</replaceable>.cfg
+                </literallayout>
+            </para>
+        </section>
+
+        <section id='bsp-description-file-example-minnow'>
+            <title>Example</title>
+
+            <para>
+                Many real-world examples are more complex.
+                Like any other <filename>.scc</filename> file, BSP
+                descriptions can aggregate features.
+                Consider the Minnow BSP definition from the
+                <filename>linux-yocto-4.4</filename> in the
+                Yocto Project
+                <ulink url='&YOCTO_DOCS_DEV_URL;#source-repositories'>Source Repositories</ulink>
+                (i.e.
+                <filename>yocto-kernel-cache/bsp/minnow</filename>):
+                <literallayout class='monospaced'>
      minnow.scc:
-        include cfg/x86.scc
-        include features/eg20t/eg20t.scc
-        include cfg/dmaengine.scc
-        include features/power/intel.scc
-        include cfg/efi.scc
-        include features/usb/ehci-hcd.scc
-        include features/usb/ohci-hcd.scc
-        include features/usb/usb-gadgets.scc
-        include features/usb/touchscreen-composite.scc
-        include cfg/timer/hpet.scc
-        include cfg/timer/rtc.scc
-        include features/leds/leds.scc
-        include features/spi/spidev.scc
-        include features/i2c/i2cdev.scc
+         include cfg/x86.scc
+         include features/eg20t/eg20t.scc
+         include cfg/dmaengine.scc
+         include features/power/intel.scc
+         include cfg/efi.scc
+         include features/usb/ehci-hcd.scc
+         include features/usb/ohci-hcd.scc
+         include features/usb/usb-gadgets.scc
+         include features/usb/touchscreen-composite.scc
+         include cfg/timer/hpet.scc
+         include features/leds/leds.scc
+         include features/spi/spidev.scc
+         include features/i2c/i2cdev.scc
+         include features/mei/mei-txe.scc
 
-        # Earlyprintk and port debug requires 8250
-        kconf hardware cfg/8250.cfg
+         # Earlyprintk and port debug requires 8250
+         kconf hardware cfg/8250.cfg
 
-        kconf hardware minnow.cfg
-        kconf hardware minnow-dev.cfg
-            </literallayout>
-        </para>
+         kconf hardware minnow.cfg
+         kconf hardware minnow-dev.cfg
+                </literallayout>
+            </para>
 
-        <para>
-            The <filename>minnow.scc</filename> description file includes
-            a hardware configuration fragment
-            (<filename>minnow.cfg</filename>) specific to the Minnow
-            BSP as well as several more general configuration
-            fragments and features enabling hardware found on the
-            machine.
-            This description file is then included in each of the three
-            "minnow" description files for the supported kernel types
-            (i.e. "standard", "preempt-rt", and "tiny").
-            Consider the "minnow" description for the "standard" kernel
-            type:
-            <literallayout class='monospaced'>
+            <para>
+                The <filename>minnow.scc</filename> description file includes
+                a hardware configuration fragment
+                (<filename>minnow.cfg</filename>) specific to the Minnow
+                BSP as well as several more general configuration
+                fragments and features enabling hardware found on the
+                machine.
+                This <filename>minnow.scc</filename> description file is then
+                included in each of the three
+                "minnow" description files for the supported kernel types
+                (i.e. "standard", "preempt-rt", and "tiny").
+                Consider the "minnow" description for the "standard" kernel
+                type:
+                <literallayout class='monospaced'>
      minnow-standard.scc:
-        define KMACHINE minnow
-        define KTYPE standard
-        define KARCH i386
+         define KMACHINE minnow
+         define KTYPE standard
+         define KARCH i386
 
-        include ktypes/standard
+         include ktypes/standard
 
-        include minnow.scc
+         include minnow.scc
 
-        # Extra minnow configs above the minimal defined in minnow.scc
-        include cfg/efi-ext.scc
-        include features/media/media-all.scc
-        include features/sound/snd_hda_intel.scc
+         # Extra minnow configs above the minimal defined in minnow.scc
+         include cfg/efi-ext.scc
+         include features/media/media-all.scc
+         include features/sound/snd_hda_intel.scc
 
-        # The following should really be in standard.scc
-        # USB live-image support
-        include cfg/usb-mass-storage.scc
-        include cfg/boot-live.scc
+         # The following should really be in standard.scc
+         # USB live-image support
+         include cfg/usb-mass-storage.scc
+         include cfg/boot-live.scc
 
-        # Basic profiling
-        include features/latencytop/latencytop.scc
-        include features/profiling/profiling.scc
+         # Basic profiling
+         include features/latencytop/latencytop.scc
+         include features/profiling/profiling.scc
 
-        # Requested drivers that don't have an existing scc
-        kconf hardware minnow-drivers-extra.cfg
-            </literallayout>
-            The <filename>include</filename> command midway through the file
-            includes the <filename>minnow.scc</filename> description that
-            defines all hardware enablements for the BSP that is common to all
-            kernel types.
-            Using this command significantly reduces duplication.
-        </para>
+         # Requested drivers that don't have an existing scc
+         kconf hardware minnow-drivers-extra.cfg
+                </literallayout>
+                The <filename>include</filename> command midway through the file
+                includes the <filename>minnow.scc</filename> description that
+                defines all enabled hardware for the BSP that is common to
+                all kernel types.
+                Using this command significantly reduces duplication.
+            </para>
 
-        <para>
-            Now consider the "minnow" description for the "tiny" kernel type:
-            <literallayout class='monospaced'>
+            <para>
+                Now consider the "minnow" description for the "tiny" kernel
+                type:
+                <literallayout class='monospaced'>
      minnow-tiny.scc:
         define KMACHINE minnow
         define KTYPE tiny
@@ -862,21 +745,205 @@
         include ktypes/tiny
 
         include minnow.scc
-            </literallayout>
-            As you might expect, the "tiny" description includes quite a
-            bit less.
-            In fact, it includes only the minimal policy defined by the
-            "tiny" kernel type and the hardware-specific configuration required
-            for booting the machine along with the most basic functionality of
-            the system as defined in the base "minnow" description file.
+                </literallayout>
+                As you might expect, the "tiny" description includes quite a
+                bit less.
+                In fact, it includes only the minimal policy defined by the
+                "tiny" kernel type and the hardware-specific configuration
+                required for booting the machine along with the most basic
+                functionality of the system as defined in the base "minnow"
+                description file.
+            </para>
+
+            <para>
+                Notice again the three critical variables:
+                <filename>KMACHINE</filename>, <filename>KTYPE</filename>,
+                and <filename>KARCH</filename>.
+                Of these variables, only the <filename>KTYPE</filename> has changed.
+                It is now set to "tiny".
+            </para>
+        </section>
+    </section>
+</section>
+
+<section id='kernel-metadata-location'>
+    <title>Kernel Metadata Location</title>
+
+    <para>
+        Kernel Metadata always exists outside of the kernel tree either
+        defined in a kernel recipe (recipe-space) or outside of the recipe.
+        Where you choose to define the Metadata depends on what you want
+        to do and how you intend to work.
+        Regardless of where you define the kernel Metadata, the syntax used
+        applies equally.
+    </para>
+
+    <para>
+        If you are unfamiliar with the Linux kernel and only wish
+        to apply a configuration and possibly a couple of patches provided to
+        you by others, the recipe-space method is recommended.
+        This method is also a good approach if you are working with Linux kernel
+        sources you do not control or if you just do not want to maintain a
+        Linux kernel Git repository on your own.
+        For partial information on how you can define kernel Metadata in
+        the recipe-space, see the
+        "<link linkend='modifying-an-existing-recipe'>Modifying an Existing Recipe</link>"
+        section.
+    </para>
+
+    <para>
+        Conversely, if you are actively developing a kernel and are already
+        maintaining a Linux kernel Git repository of your own, you might find
+        it more convenient to work with kernel Metadata kept outside the
+        recipe-space.
+        Working with Metadata in this area can make iterative development of
+        the Linux kernel more efficient outside of the BitBake environment.
+    </para>
+
+    <section id='recipe-space-metadata'>
+        <title>Recipe-Space Metadata</title>
+
+        <para>
+            When stored in recipe-space, the kernel Metadata files reside in a
+            directory hierarchy below
+            <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>.
+            For a linux-yocto recipe or for a Linux kernel recipe derived
+            by copying and modifying
+            <filename>oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb</filename>
+            to a recipe in your layer, <filename>FILESEXTRAPATHS</filename>
+            is typically set to
+            <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-THISDIR'><filename>THISDIR</filename></ulink><filename>}/${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>.
+            See the "<link linkend='modifying-an-existing-recipe'>Modifying an Existing Recipe</link>"
+            section for more information.
         </para>
 
         <para>
-            Notice again the three critical variables:
-            <filename>KMACHINE</filename>, <filename>KTYPE</filename>,
-            and <filename>KARCH</filename>.
-            Of these variables, only the <filename>KTYPE</filename> has changed.
-            It is now set to "tiny".
+            Here is an example that shows a trivial tree of kernel Metadata
+            stored in recipe-space within a BSP layer:
+            <literallayout class='monospaced'>
+     meta-<replaceable>my_bsp_layer</replaceable>/
+     `-- recipes-kernel
+         `-- linux
+             `-- linux-yocto
+                 |-- bsp-standard.scc
+                 |-- bsp.cfg
+                 `-- standard.cfg
+            </literallayout>
+        </para>
+
+        <para>
+            When the Metadata is stored in recipe-space, you must take
+            steps to ensure BitBake has the necessary information to decide
+            what files to fetch and when they need to be fetched again.
+            It is only necessary to specify the <filename>.scc</filename>
+            files on the
+            <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>.
+            BitBake parses them and fetches any files referenced in the
+            <filename>.scc</filename> files by the <filename>include</filename>,
+            <filename>patch</filename>, or <filename>kconf</filename> commands.
+            Because of this, it is necessary to bump the recipe
+            <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
+            value when changing the content of files not explicitly listed
+            in the <filename>SRC_URI</filename>.
+        </para>
+
+        <para>
+            If the BSP description is in recipe space, you cannot simply list
+            the <filename>*.scc</filename> in the <filename>SRC_URI</filename>
+            statement.
+            You need to use the following form from your kernel append file:
+            <literallayout class='monospaced'>
+     SRC_URI_append_<replaceable>myplatform</replaceable> = " \
+        file://<replaceable>myplatform</replaceable>;type=kmeta;destsuffix=<replaceable>myplatform</replaceable> \
+        "
+            </literallayout>
+        </para>
+    </section>
+
+    <section id='metadata-outside-the-recipe-space'>
+        <title>Metadata Outside the Recipe-Space</title>
+
+        <para>
+            When stored outside of the recipe-space, the kernel Metadata
+            files reside in a separate repository.
+            The OpenEmbedded build system adds the Metadata to the build as
+            a "ktype=meta" repository through the
+            <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+            variable.
+            As an example, consider the following <filename>SRC_URI</filename>
+            statement from the <filename>linux-yocto_4.4.bb</filename>
+            kernel recipe:
+            <literallayout class='monospaced'>
+     SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;name=machine;branch=${KBRANCH}; \
+                git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA}"
+            </literallayout>
+            <filename>${KMETA}</filename>, in this context, is simply used to
+            name the directory into which the Git fetcher places the Metadata.
+            This behavior is no different than any multi-repository
+            <filename>SRC_URI</filename> statement used in a recipe (e.g.
+            see the previous section).
+        </para>
+
+        <para>
+            You can keep kernel Metadata in a "kernel-cache", which is a
+            directory containing configuration fragments.
+            As with any Metadata kept outside the recipe-space, you simply
+            need to use the <filename>SRC_URI</filename> statement with the
+            "type=kmeta" attribute.
+            Doing so makes the kernel Metadata available during the
+            configuration phase.
+        </para>
+
+<!--
+
+
+        <para>
+            Following is an example that shows how a trivial tree of Metadata
+            is stored in a custom Linux kernel Git repository:
+            <literallayout class='monospaced'>
+     meta/
+     `&dash;&dash; cfg
+         `&dash;&dash; kernel-cache
+             |&dash;&dash; bsp-standard.scc
+             |&dash;&dash; bsp.cfg
+             `&dash;&dash; standard.cfg
+            </literallayout>
+        </para>
+
+        <para>
+            To use a branch different from where the sources reside,
+            specify the branch in the <filename>KMETA</filename> variable
+            in your Linux kernel recipe.
+            Here is an example:
+            <literallayout class='monospaced'>
+     KMETA = "meta"
+            </literallayout>
+            To use the same branch as the sources, set
+            <filename>KMETA</filename> to an empty string:
+            <literallayout class='monospaced'>
+     KMETA = ""
+            </literallayout>
+            If you are working with your own sources and want to create an
+            orphan <filename>meta</filename> branch, use these commands
+            from within your Linux kernel Git repository:
+            <literallayout class='monospaced'>
+     $ git checkout &dash;&dash;orphan meta
+     $ git rm -rf .
+     $ git commit &dash;&dash;allow-empty -m "Create orphan meta branch"
+            </literallayout>
+        </para>
+-->
+
+        <para>
+            If you modify the Metadata, you must not forget to update the
+            <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
+            statements in the kernel's recipe.
+            In particular, you need to update the
+            <filename>SRCREV_meta</filename> variable to match the commit in
+            the <filename>KMETA</filename> branch you wish to use.
+            Changing the data in these branches and not updating the
+            <filename>SRCREV</filename> statements to match will cause the
+            build to fetch an older commit.
         </para>
     </section>
 </section>
diff --git a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-common.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-common.xml
index a9aafd3..aa40fc8 100644
--- a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-common.xml
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-common.xml
@@ -31,15 +31,19 @@
             (<filename>.bbappend</filename>) and provides a convenient
             mechanism to create your own recipe files
             (<filename>.bb</filename>).
-            For details on how to create and work with layers, see the following
-            sections in the Yocto Project Development Manual:
-            <itemizedlist>
-                <listitem><para>"<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>" for
-                    general information on layers and how to create layers.</para></listitem>
-                <listitem><para>"<ulink url='&YOCTO_DOCS_DEV_URL;#set-up-your-layer-for-the-build'>Set Up Your Layer for the Build</ulink>" for
-                    specific instructions on setting up a layer for kernel
-                    development.</para></listitem>
-            </itemizedlist>
+            For details on how to create and work with layers, see the
+            "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+            section in the Yocto Project Development Manual.
+            <note><title>Tip</title>
+                The Yocto Project comes with many tools that simplify
+                tasks you need to perform.
+                One such tool is the <filename>yocto-layer create</filename>
+                script, which simplifies creating a new layer.
+                See the
+                "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</ulink>"
+                section in the Yocto Project Development Manual for more
+                information.
+            </note>
         </para>
     </section>
 
@@ -84,11 +88,11 @@
                 You also name it accordingly based on the linux-yocto recipe
                 you are using.
                 For example, if you are modifying the
-                <filename>meta/recipes-kernel/linux/linux-yocto_3.19.bb</filename>
+                <filename>meta/recipes-kernel/linux/linux-yocto_4.4.bb</filename>
                 recipe, the append file will typically be located as follows
                 within your custom layer:
                 <literallayout class='monospaced'>
-     <replaceable>your-layer</replaceable>/recipes-kernel/linux/linux-yocto_3.19.bbappend
+     <replaceable>your-layer</replaceable>/recipes-kernel/linux/linux-yocto_4.4.bbappend
                 </literallayout>
                 The append file should initially extend the
                 <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
@@ -114,6 +118,151 @@
                     <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
                 </note>
             </para>
+
+            <para>
+                As an example, consider the following append file
+                used by the BSPs in <filename>meta-yocto-bsp</filename>:
+                <literallayout class='monospaced'>
+     meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.4.bbappend
+                </literallayout>
+                The following listing shows the file.
+                Be aware that the actual commit ID strings in this
+                example listing might be different than the actual strings
+                in the file from the <filename>meta-yocto-bsp</filename>
+                layer upstream.
+                <literallayout class='monospaced'>
+     KBRANCH_genericx86  = "standard/base"
+     KBRANCH_genericx86-64  = "standard/base"
+
+     KMACHINE_genericx86 ?= "common-pc"
+     KMACHINE_genericx86-64 ?= "common-pc-64"
+     KBRANCH_edgerouter = "standard/edgerouter"
+     KBRANCH_beaglebone = "standard/beaglebone"
+     KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
+
+     SRCREV_machine_genericx86    ?= "ad8b1d659ddd2699ebf7d50ef9de8940b157bfc2"
+     SRCREV_machine_genericx86-64 ?= "ad8b1d659ddd2699ebf7d50ef9de8940b157bfc2"
+     SRCREV_machine_edgerouter ?= "cebe1ad56aebd89e0de29412e19433fb441bf13c"
+     SRCREV_machine_beaglebone ?= "cebe1ad56aebd89e0de29412e19433fb441bf13c"
+     SRCREV_machine_mpc8315e-rdb ?= "06c0dbdcba374ca7f92a53d69292d6bb7bc9b0f3"
+
+     COMPATIBLE_MACHINE_genericx86 = "genericx86"
+     COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
+     COMPATIBLE_MACHINE_edgerouter = "edgerouter"
+     COMPATIBLE_MACHINE_beaglebone = "beaglebone"
+     COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
+
+     LINUX_VERSION_genericx86 = "4.4.41"
+     LINUX_VERSION_genericx86-64 = "4.4.41"
+     LINUX_VERSION_edgerouter = "4.4.53"
+     LINUX_VERSION_beaglebone = "4.4.53"
+     LINUX_VERSION_mpc8315e-rdb = "4.4.53"
+                </literallayout>
+                This append file contains statements used to support
+                several BSPs that ship with the Yocto Project.
+                The file defines machines using the
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></ulink>
+                variable and uses the
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>
+                variable to ensure the machine name used by the OpenEmbedded
+                build system maps to the machine name used by the Linux Yocto
+                kernel.
+                The file also uses the optional
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink>
+                variable to ensure the build process uses the
+                appropriate kernel branch.
+            </para>
+
+            <para>
+                Although this particular example does not use it, the
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink>
+                variable could be used to enable features specific to
+                the kernel.
+                The append file points to specific commits in the
+                <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+                Git repository and the <filename>meta</filename> Git repository
+                branches to identify the exact kernel needed to build the
+                BSP.
+            </para>
+
+            <para>
+                One thing missing in this particular BSP, which you will
+                typically need when developing a BSP, is the kernel configuration
+                file (<filename>.config</filename>) for your BSP.
+                When developing a BSP, you probably have a kernel configuration
+                file or a set of kernel configuration files that, when taken
+                together, define the kernel configuration for your BSP.
+                You can accomplish this definition by putting the configurations
+                in a file or a set of files inside a directory located at the
+                same level as your kernel's append file and having the same
+                name as the kernel's main recipe file.
+                With all these conditions met, simply reference those files in the
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+                statement in the append file.
+            </para>
+
+            <para>
+                For example, suppose you had some configuration options
+                in a file called <filename>network_configs.cfg</filename>.
+                You can place that file inside a directory named
+                <filename>linux-yocto</filename> and then add
+                a <filename>SRC_URI</filename> statement such as the
+                following to the append file.
+                When the OpenEmbedded build system builds the kernel, the
+                configuration options are picked up and applied.
+                <literallayout class='monospaced'>
+     SRC_URI += "file://network_configs.cfg"
+                </literallayout>
+            </para>
+
+            <para>
+                To group related configurations into multiple files, you
+                perform a similar procedure.
+                Here is an example that groups separate configurations
+                specifically for Ethernet and graphics into their own
+                files and adds the configurations by using a
+                <filename>SRC_URI</filename> statement like the following
+                in your append file:
+                <literallayout class='monospaced'>
+     SRC_URI += "file://myconfig.cfg \
+                 file://eth.cfg \
+                 file://gfx.cfg"
+                </literallayout>
+            </para>
+
+            <para>
+                Another variable you can use in your kernel recipe append
+                file is the
+                <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+                variable.
+                When you use this statement, you are extending the locations
+                used by the OpenEmbedded system to look for files and
+                patches as the recipe is processed.
+            </para>
+
+            <note>
+                <para>
+                    Other methods exist to accomplish grouping and defining configuration options.
+                    For example, if you are working with a local clone of the kernel repository,
+                    you could checkout the kernel's <filename>meta</filename> branch, make your changes,
+                    and then push the changes to the local bare clone of the kernel.
+                    The result is that you directly add configuration options to the
+                    <filename>meta</filename> branch for your BSP.
+                    The configuration options will likely end up in that location anyway if the BSP gets
+                    added to the Yocto Project.
+                </para>
+
+                <para>
+                    In general, however, the Yocto Project maintainers take care of moving the
+                    <filename>SRC_URI</filename>-specified
+                    configuration options to the kernel's <filename>meta</filename> branch.
+                    Not only is it easier for BSP developers to not have to worry about putting those
+                    configurations in the branch, but having the maintainers do it allows them to apply
+                    'global' knowledge about the kinds of common configuration options multiple BSPs in
+                    the tree are typically using.
+                    This allows for promotion of common configurations into common features.
+                </para>
+            </note>
         </section>
 
         <section id='applying-patches'>
diff --git a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-faq.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-faq.xml
index 2b99ad2..9e0517d 100644
--- a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-faq.xml
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-faq.xml
@@ -72,7 +72,7 @@
                         <filename>RDEPENDS_kernel-base</filename> to include or not
                         include "kernel-image".</para>
                         <para>See the
-                        "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files</ulink>"
+                        "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>"
                         section in the Yocto Project Development Manual for information on
                         how to use an append file to override metadata.
                     </para>
diff --git a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev.xml
index b96acd6..28a3364 100644
--- a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev.xml
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev.xml
@@ -77,14 +77,29 @@
                 <revremark>Released with the Yocto Project 2.2 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.1</revnumber>
-                <date>January 2017</date>
-                <revremark>Released with the Yocto Project 2.2.1 Release.</revremark>
+                <revnumber>2.3</revnumber>
+                <date>May 2017</date>
+                <revremark>Released with the Yocto Project 2.3 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.2</revnumber>
+                <revnumber>2.3.1</revnumber>
                 <date>June 2017</date>
-                <revremark>Released with the Yocto Project 2.2.2 Release.</revremark>
+                <revremark>Released with the Yocto Project 2.3.1 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.2</revnumber>
+                <date>September 2017</date>
+                <revremark>Released with the Yocto Project 2.3.2 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.3</revnumber>
+                <date>January 2018</date>
+                <revremark>Released with the Yocto Project 2.3.3 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.4</revnumber>
+                <date>April 2018</date>
+                <revremark>Released with the Yocto Project 2.3.4 Release.</revremark>
             </revision>
         </revhistory>
 
@@ -98,12 +113,33 @@
         Permission is granted to copy, distribute and/or modify this document under
         the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
       </para>
-      <note>
-          For the latest version of this manual associated with this
-          Yocto Project release, see the
-          <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>
-          from the Yocto Project website.
-      </note>
+           <note><title>Manual Notes</title>
+               <itemizedlist>
+                   <listitem><para>
+                       For the latest version of the Yocto Project Linux
+                       Kernel Development Manual associated with this Yocto
+                       Project release (version &YOCTO_DOC_VERSION;),
+                       see the Yocto Project Linux Kernel Development
+                       Manual from the
+                       <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+                       </para></listitem>
+                   <listitem><para>
+                       This version of the manual is version
+                       &YOCTO_DOC_VERSION;.
+                       For later releases of the Yocto Project (if they exist),
+                       go to the
+                       <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+                       and use the drop-down "Active Releases" button
+                       and choose the Yocto Project version for which you want
+                       the manual.
+                       </para></listitem>
+                   <listitem><para>
+                        For an in-development version of the Yocto Project
+                        Linux Kernel Development Manual, see
+                        <ulink url='&YOCTO_DOCS_URL;/latest/kernel-dev/kernel-dev.html'></ulink>.
+                        </para></listitem>
+                </itemizedlist>
+            </note>
     </legalnotice>
 
     </bookinfo>
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment.png b/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment.png
index 82b7a55..3596903 100644
--- a/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment.png
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/mega-manual.xml b/import-layers/yocto-poky/documentation/mega-manual/mega-manual.xml
index 157feac..d06f851 100644
--- a/import-layers/yocto-poky/documentation/mega-manual/mega-manual.xml
+++ b/import-layers/yocto-poky/documentation/mega-manual/mega-manual.xml
@@ -61,14 +61,29 @@
                 <revremark>Released with the Yocto Project 2.2 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.1</revnumber>
-                <date>January 2017</date>
-                <revremark>Released with the Yocto Project 2.2.1 Release.</revremark>
+                <revnumber>2.3</revnumber>
+                <date>May 2017</date>
+                <revremark>Released with the Yocto Project 2.3 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.2</revnumber>
+                <revnumber>2.3.1</revnumber>
                 <date>June 2017</date>
-                <revremark>Released with the Yocto Project 2.2.2 Release.</revremark>
+                <revremark>Released with the Yocto Project 2.3.1 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.2</revnumber>
+                <date>September 2017</date>
+                <revremark>Released with the Yocto Project 2.3.2 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.3</revnumber>
+                <date>January 2018</date>
+                <revremark>Released with the Yocto Project 2.3.3 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.4</revnumber>
+                <date>April 2018</date>
+                <revremark>Released with the Yocto Project 2.3.4 Release.</revremark>
             </revision>
        </revhistory>
 
@@ -82,12 +97,32 @@
         Permission is granted to copy, distribute and/or modify this document under
         the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
       </para>
-      <note>
-          For the latest version of this manual associated with this
-          Yocto Project release, see the
-          <ulink url='&YOCTO_DOCS_MM_URL;'>Yocto Project Mega-Manual</ulink>
-          from the Yocto Project website.
-      </note>
+           <note><title>Manual Notes</title>
+               <itemizedlist>
+                   <listitem><para>
+                       For the latest version of the Yocto Project
+                       Mega-Manual associated with this Yocto Project release
+                       (version &YOCTO_DOC_VERSION;),
+                       see the Yocto Project Mega-Manual from the
+                       <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+                       </para></listitem>
+                   <listitem><para>
+                       This version of the manual is version
+                       &YOCTO_DOC_VERSION;.
+                       For later releases of the Yocto Project (if they exist),
+                       go to the
+                       <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+                       and use the drop-down "Active Releases" button
+                       and choose the Yocto Project version for which you want
+                       the manual.
+                       </para></listitem>
+                   <listitem><para>
+                       For an in-development version of the Yocto Project
+                       Mega-Manual, see
+                       <ulink url='&YOCTO_DOCS_URL;/latest/mega-manual/mega-manual.html'></ulink>.
+                       </para></listitem>
+               </itemizedlist>
+           </note>
 
     </legalnotice>
 
@@ -200,6 +235,9 @@
         xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/technical-details.xml"/>
 
     <xi:include
+        xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-release-process.xml"/>
+
+    <xi:include
         xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/migration.xml"/>
 
     <xi:include
diff --git a/import-layers/yocto-poky/documentation/poky.ent b/import-layers/yocto-poky/documentation/poky.ent
index 3640207..14d67e5 100644
--- a/import-layers/yocto-poky/documentation/poky.ent
+++ b/import-layers/yocto-poky/documentation/poky.ent
@@ -1,12 +1,12 @@
-<!ENTITY DISTRO "2.2.2">
-<!ENTITY DISTRO_COMPRESSED "222">
-<!ENTITY DISTRO_NAME_NO_CAP "morty">
-<!ENTITY DISTRO_NAME "Morty">
-<!ENTITY YOCTO_DOC_VERSION "2.2.2">
-<!ENTITY POKYVERSION "17.0.1">
-<!ENTITY POKYVERSION_COMPRESSED "1702">
+<!ENTITY DISTRO "2.3.4">
+<!ENTITY DISTRO_COMPRESSED "234">
+<!ENTITY DISTRO_NAME_NO_CAP "pyro">
+<!ENTITY DISTRO_NAME "Pyro">
+<!ENTITY YOCTO_DOC_VERSION "2.3.4">
+<!ENTITY POKYVERSION "18.0.4">
+<!ENTITY POKYVERSION_COMPRESSED "1804">
 <!ENTITY YOCTO_POKY "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;">
-<!ENTITY COPYRIGHT_YEAR "2010-2017">
+<!ENTITY COPYRIGHT_YEAR "2010-2018">
 <!ENTITY YOCTO_DL_URL "http://downloads.yoctoproject.org">
 <!ENTITY YOCTO_HOME_URL "http://www.yoctoproject.org">
 <!ENTITY YOCTO_LISTS_URL "http://lists.yoctoproject.org">
@@ -61,15 +61,18 @@
 <!ENTITY OE_INIT_PATH "&YOCTO_POKY;/oe-init-build-env">
 <!ENTITY OE_INIT_FILE "oe-init-build-env">
 <!ENTITY UBUNTU_HOST_PACKAGES_ESSENTIAL "gawk wget git-core diffstat unzip texinfo gcc-multilib \
-     build-essential chrpath socat cpio python python3 python3-pip python3-pexpect">
+     build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
+     xz-utils debianutils iputils-ping">
 <!ENTITY FEDORA_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python3 unzip perl patch \
      diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
      ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat \
-     findutils which file cpio python python3-pip python3-pexpect">
+     python3-pexpect findutils which file cpio python python3-pip xz">
 <!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \
      diffstat makeinfo python-curses patch socat python3 python3-curses tar python3-pip \
-     python3-pexpect">
-<!ENTITY CENTOS_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python unzip perl patch \
+     python3-pexpect xz which">
+<!ENTITY CENTOS_HOST_PACKAGES_ESSENTIAL "-y epel-release
+     $ sudo yum makecache
+     $ sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
      diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \
-     perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python3-pip python3-pexpect">
-
+     perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python34-pip xz \
+     which">
diff --git a/import-layers/yocto-poky/documentation/profile-manual/profile-manual.xml b/import-layers/yocto-poky/documentation/profile-manual/profile-manual.xml
index a88934f..b668fd4 100644
--- a/import-layers/yocto-poky/documentation/profile-manual/profile-manual.xml
+++ b/import-layers/yocto-poky/documentation/profile-manual/profile-manual.xml
@@ -77,14 +77,29 @@
                 <revremark>Released with the Yocto Project 2.2 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.1</revnumber>
-                <date>January 2017</date>
-                <revremark>Released with the Yocto Project 2.2.1 Release.</revremark>
+                <revnumber>2.3</revnumber>
+                <date>May 2017</date>
+                <revremark>Released with the Yocto Project 2.3 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.2</revnumber>
+                <revnumber>2.3.1</revnumber>
                 <date>June 2017</date>
-                <revremark>Released with the Yocto Project 2.2.2 Release.</revremark>
+                <revremark>Released with the Yocto Project 2.3.1 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.2</revnumber>
+                <date>September 2017</date>
+                <revremark>Released with the Yocto Project 2.3.2 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.3</revnumber>
+                <date>January 2018</date>
+                <revremark>Released with the Yocto Project 2.3.3 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.4</revnumber>
+                <date>April 2018</date>
+                <revremark>Released with the Yocto Project 2.3.4 Release.</revremark>
             </revision>
         </revhistory>
 
@@ -101,12 +116,33 @@
           Creative Commons.
       </para>
 
-      <note>
-          For the latest version of this manual associated with this
-          Yocto Project release, see the
-          <ulink url='&YOCTO_DOCS_PROF_URL;'>Yocto Project Profiling and Tracing Manual</ulink>
-          from the Yocto Project website.
-      </note>
+            <note><title>Manual Notes</title>
+                <itemizedlist>
+                    <listitem><para>
+                        For the latest version of the Yocto Project Profiling
+                        and Tracing Manual associated with this Yocto Project
+                        release (version &YOCTO_DOC_VERSION;),
+                        see the Yocto Project Profiling and Tracing Manual
+                        from the
+                        <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+                        </para></listitem>
+                    <listitem><para>
+                        This version of the manual is version
+                        &YOCTO_DOC_VERSION;.
+                        For later releases of the Yocto Project (if they exist),
+                        go to the
+                        <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+                        and use the drop-down "Active Releases" button
+                        and choose the Yocto Project version for which you want
+                        the manual.
+                        </para></listitem>
+                    <listitem><para>
+                        For an in-development version of the Yocto Project
+                        Profiling and Tracing Manual, see
+                        <ulink url='&YOCTO_DOCS_URL;/latest/profile-manual/profile-manual.html'></ulink>.
+                        </para></listitem>
+                </itemizedlist>
+            </note>
     </legalnotice>
 
     </bookinfo>
diff --git a/import-layers/yocto-poky/documentation/ref-manual/closer-look.xml b/import-layers/yocto-poky/documentation/ref-manual/closer-look.xml
index b73e59c..923ed21 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/closer-look.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/closer-look.xml
@@ -867,6 +867,19 @@
             <para>
                 This step in the build process consists of three tasks:
                 <itemizedlist>
+                    <listitem><para>
+                        <emphasis><link linkend='ref-tasks-prepare_recipe_sysroot'><filename>do_prepare_recipe_sysroot</filename></link>:</emphasis>
+                        This task sets up the two sysroots in
+                        <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}</filename>
+                        (i.e. <filename>recipe-sysroot</filename> and
+                        <filename>recipe-sysroot-native</filename>) so that
+                        the sysroots contain the contents of the
+                        <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+                        tasks of the recipes on which the recipe
+                        containing the tasks depends.
+                        A sysroot exists for both the target and for the native
+                        binaries, which run on the host system.
+                        </para></listitem>
                     <listitem><para><emphasis><filename>do_configure</filename>:</emphasis>
                         This task configures the source by enabling and
                         disabling any build-time and configuration options for
@@ -1054,7 +1067,7 @@
 
             <para>
                 Package installation is under control of the package manager
-                (e.g. smart/rpm, opkg, or apt/dpkg) regardless of whether or
+                (e.g. dnf/rpm, opkg, or apt/dpkg) regardless of whether or
                 not package management is enabled for the target.
                 At the end of the process, if package management is not
                 enabled for the target, the package manager's data files
@@ -1392,17 +1405,6 @@
                 relationship the function needs to be passed.
                 The function returns a True or False value.
             </para>
-
-            <para>
-                Once the setscene process completes, the OpenEmbedded build
-                system has a list of tasks that it believes it can "accelerate"
-                and therefore does not need to run.
-                There is a final function call to the function specified by the
-                <ulink url='&YOCTO_DOCS_BB_URL;#var-BB_SETSCENE_VERIFY_FUNCTION2'><filename>BB_SETSCENE_VERIFY_FUNCTION2</filename></ulink>
-                variable that is able to require the tasks to be run that
-                that the OpenEmbedded build system initially was going to
-                skip.
-            </para>
         </section>
     </section>
 
@@ -1521,23 +1523,26 @@
             the environment before using the tools.
         </para>
 
-        <note>
-            <para>
-                The Yocto Project supports several methods by which you can
-                set up this cross-development environment.
-                These methods include downloading pre-built SDK installers
-                or building and installing your own SDK installer.
-            </para>
-
-            <para>
-                For background information on cross-development toolchains
-                in the Yocto Project development environment, see the
-                "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
-                section.
-                For information on setting up a cross-development
-                environment, see the
-                <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
-            </para>
+        <note><title>Notes</title>
+            <itemizedlist>
+                <listitem><para>
+                    The Yocto Project supports several methods by which you can
+                    set up this cross-development environment.
+                    These methods include downloading pre-built SDK installers
+                    or building and installing your own SDK installer.
+                    </para></listitem>
+                <listitem><para>
+                    For background information on cross-development toolchains
+                    in the Yocto Project development environment, see the
+                    "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
+                    section.
+                    </para></listitem>
+                <listitem><para>
+                    For information on setting up a cross-development
+                    environment, see the
+                    <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+                    </para></listitem>
+            </itemizedlist>
         </note>
 
         <para>
diff --git a/import-layers/yocto-poky/documentation/ref-manual/introduction.xml b/import-layers/yocto-poky/documentation/ref-manual/introduction.xml
index ddf6a86..eec6cb3 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/introduction.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/introduction.xml
@@ -296,7 +296,7 @@
                         Yocto Project documentation manuals:
                         <literallayout class='monospaced'>
      $ sudo dnf install make docbook-style-dsssl docbook-style-xsl \
-     docbook-dtds docbook-utils fop libxslt dblatex xmlto xsltproc
+     docbook-dtds docbook-utils fop libxslt dblatex xmlto
                         </literallayout></para></listitem>
                     <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
                         Packages needed if you are going to run
@@ -333,7 +333,7 @@
                         Packages needed if you are going to build out the
                         Yocto Project documentation manuals:
                         <literallayout class='monospaced'>
-     $ sudo zypper install make fop xsltproc dblatex xmlto
+     $ sudo zypper install make dblatex xmlto
                         </literallayout></para></listitem>
                     <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
                         Packages needed if you are going to run
@@ -351,25 +351,33 @@
             <para>
                 The following list shows the required packages by function
                 given a supported CentOS Linux distribution:
-                <note>
-                    For CentOS 6.x, some of the versions of the components
-                    provided by the distribution are too old (e.g. Git, Python,
-                    and tar).
-                    It is recommended that you install the buildtools in order
-                    to provide versions that will work with the OpenEmbedded
-                    build system.
-                    For information on how to install the buildtools tarball,
-                    see the
-                    "<link linkend='required-git-tar-and-python-versions'>Required Git, Tar, and Python Versions</link>"
-                    section.
-                </note>
                 <itemizedlist>
                     <listitem><para><emphasis>Essentials:</emphasis>
                         Packages needed to build an image for a headless
                         system:
                         <literallayout class='monospaced'>
-     $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL;
-                        </literallayout></para></listitem>
+     $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
+                        </literallayout>
+                        <note><title>Notes</title>
+                            <itemizedlist>
+                                <listitem><para>
+                                    Extra Packages for Enterprise Linux
+                                    (i.e. <filename>epel-release</filename>)
+                                    is a collection of packages from Fedora
+                                    built on RHEL/CentOS for easy installation
+                                    of packages not included in enterprise
+                                    Linux by default.
+                                    You need to install these packages
+                                    separately.
+                                    </para></listitem>
+                                <listitem><para>
+                                    The <filename>makecache</filename> command
+                                    consumes additional Metadata from
+                                    <filename>epel-release</filename>.
+                                    </para></listitem>
+                            </itemizedlist>
+                        </note>
+                        </para></listitem>
                     <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
                         Packages recommended if the host system has graphics
                         support or if you are going to use the Eclipse
@@ -382,7 +390,7 @@
                         Yocto Project documentation manuals:
                         <literallayout class='monospaced'>
      $ sudo yum install make docbook-style-dsssl docbook-style-xsl \
-     docbook-dtds docbook-utils fop libxslt dblatex xmlto xsltproc
+     docbook-dtds docbook-utils fop libxslt dblatex xmlto
                         </literallayout></para></listitem>
                     <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
                         Packages needed if you are going to run
diff --git a/import-layers/yocto-poky/documentation/ref-manual/migration.xml b/import-layers/yocto-poky/documentation/ref-manual/migration.xml
index 2bdb542..7ca929c 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/migration.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/migration.xml
@@ -3689,7 +3689,7 @@
                     by <filename>BB_SETSCENE_VERIFY_FUNCTION</filename>
                     needed to change signature.
                     Consequently, a new variable named
-                    <ulink url='&YOCTO_DOCS_BB_URL;#var-BB_SETSCENE_VERIFY_FUNCTION2'><filename>BB_SETSCENE_VERIFY_FUNCTION2</filename></ulink>
+                    <filename>BB_SETSCENE_VERIFY_FUNCTION2</filename>
                     has been added allowing multiple versions of BitBake
                     to work with suitably written metadata, which includes
                     OpenEmbedded-Core and Poky.
@@ -3955,6 +3955,768 @@
     </section>
 </section>
 
+<section id='moving-to-the-yocto-project-2.3-release'>
+    <title>Moving to the Yocto Project 2.3 Release</title>
+
+    <para>
+        This section provides migration information for moving to the
+        Yocto Project 2.3 Release from the prior release.
+    </para>
+
+    <section id='migration-2.3-recipe-specific-sysroots'>
+        <title>Recipe-specific Sysroots</title>
+
+        <para>
+            The OpenEmbedded build system now uses one sysroot per
+            recipe to resolve long-standing issues with configuration
+            script auto-detection of undeclared dependencies.
+            Consequently, you might find that some of your previously
+            written custom recipes are missing declared dependencies,
+            particularly those dependencies that are incidentally built
+            earlier in a typical build process and thus are already likely
+            to be present in the shared sysroot in previous releases.
+        </para>
+
+        <para>
+            Consider the following:
+            <itemizedlist>
+                <listitem><para>
+                    <emphasis>Declare Build-Time Dependencies:</emphasis>
+                    Because of this new feature, you must explicitly
+                    declare all build-time dependencies for your recipe.
+                    If you do not declare these dependencies, they are not
+                    populated into the sysroot for the recipe.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>Specify Pre-Installation and Post-Installation
+                    Native Tool Dependencies:</emphasis>
+                    You must specifically specify any special native tool
+                    dependencies of <filename>pkg_preinst</filename> and
+                    <filename>pkg_postinst</filename> scripts by using the
+                    <link linkend='var-PACKAGE_WRITE_DEPS'><filename>PACKAGE_WRITE_DEPS</filename></link>
+                    variable.
+                    Specifying these dependencies ensures that these tools
+                    are available if these scripts need to be run on the
+                    build host during the
+                    <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+                    task.</para>
+
+                    <para>As an example, see the <filename>dbus</filename>
+                    recipe.
+                    You will see that this recipe has a
+                    <filename>pkg_postinst</filename> that calls
+                    <filename>systemctl</filename> if "systemd" is in
+                    <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
+                    In the example,
+                    <filename>systemd-systemctl-native</filename> is added to
+                    <filename>PACKAGE_WRITE_DEPS</filename>, which is also
+                    conditional on "systemd" being in
+                    <filename>DISTRO_FEATURES</filename>.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>Examine Recipes that Use
+                    <filename>SSTATEPOSTINSTFUNCS</filename>:</emphasis>
+                    You need to examine any recipe that uses
+                    <filename>SSTATEPOSTINSTFUNCS</filename> and determine
+                    steps to take.</para>
+
+                    <para>Functions added to
+                    <filename>SSTATEPOSTINSTFUNCS</filename> are still
+                    called as they were in previous Yocto Project releases.
+                    However, since a separate sysroot is now being populated
+                    for every recipe and if existing functions being called
+                    through <filename>SSTATEPOSTINSTFUNCS</filename> are
+                    doing relocation, then you will need to change these
+                    to use a post-installation script that is installed by a
+                    function added to
+                    <link linkend='var-SYSROOT_PREPROCESS_FUNCS'><filename>SYSROOT_PREPROCESS_FUNCS</filename></link>.
+                    </para>
+
+                    <para>For an example, see the
+                    <filename>pixbufcache</filename> class in
+                    <filename>meta/classes/</filename> in the Yocto Project
+                    <ulink url='&YOCTO_DOCS_DEV_URL;#source-repositories'>Source Repositories</ulink>.
+                    <note>
+                        The <filename>SSTATEPOSTINSTFUNCS</filename> variable
+                        itself is now deprecated in favor of the
+                        <filename>do_populate_sysroot[postfuncs]</filename>
+                        task.
+                        Consequently, if you do still have any function or
+                        functions that need to be called after the sysroot
+                        component is created for a recipe, then you would be
+                        well advised to take steps to use a post installation
+                        script as described previously.
+                        Taking these steps prepares your code for when
+                        <filename>SSTATEPOSTINSTFUNCS</filename> is
+                        removed in a future Yocto Project release.
+                    </note>
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>Specify the Sysroot when Using Certain
+                    External Scripts:</emphasis>
+                    Because the shared sysroot is now gone, the scripts
+                    <filename>oe-find-native-sysroot</filename> and
+                    <filename>oe-run-native</filename> have been changed such
+                    that you need to specify which recipe's
+                    <link linkend='var-STAGING_DIR_NATIVE'><filename>STAGING_DIR_NATIVE</filename></link>
+                    is used.
+                    </para></listitem>
+            </itemizedlist>
+            <note>
+                You can find more information on how recipe-specific sysroots
+                work in the
+                "<link linkend='ref-classes-staging'><filename>staging.bbclass</filename></link>"
+                section.
+            </note>
+        </para>
+    </section>
+
+    <section id='migration-2.3-path-variable'>
+        <title><filename>PATH</filename> Variable</title>
+
+        <para>
+            Within the environment used to run build tasks, the environment
+            variable <filename>PATH</filename> is now sanitized such that
+            the normal native binary paths
+            (<filename>/bin</filename>, <filename>/sbin</filename>,
+            <filename>/usr/bin</filename> and so forth) are
+            removed and a directory containing symbolic links linking only
+            to the binaries from the host mentioned in the
+            <link linkend='var-HOSTTOOLS'><filename>HOSTTOOLS</filename></link>
+            and
+            <link linkend='var-HOSTTOOLS_NONFATAL'><filename>HOSTTOOLS_NONFATAL</filename></link>
+            variables is added to <filename>PATH</filename>.
+        </para>
+
+        <para>
+            Consequently, any native binaries provided by the host that you
+            need to call needs to be in one of these two variables at
+            the configuration level.
+        </para>
+
+        <para>
+            Alternatively, you can add a native recipe (i.e.
+            <filename>-native</filename>) that provides the
+            binary to the recipe's
+            <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+            value.
+            <note>
+                <filename>PATH</filename> is not sanitized in the same way
+                within <filename>devshell</filename>.
+                If it were, you would have difficulty running host tools for
+                development and debugging within the shell.
+            </note>
+        </para>
+    </section>
+
+    <section id='migration-2.3-scripts'>
+        <title>Changes to Scripts</title>
+
+        <para>
+            The following changes to scripts took place:
+            <itemizedlist>
+                <listitem><para>
+                    <emphasis><filename>oe-find-native-sysroot</filename>:</emphasis>
+                    The usage for the
+                    <filename>oe-find-native-sysroot</filename> script has
+                    changed to the following:
+                    <literallayout class='monospaced'>
+     $ . oe-find-native-sysroot <replaceable>recipe</replaceable>
+                    </literallayout>
+                    You must now supply a recipe for
+                    <replaceable>recipe</replaceable> as part of the command.
+                    Prior to the Yocto Project &DISTRO; release, it was not
+                    necessary to provide the script with the command.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis><filename>oe-run-native</filename>:</emphasis>
+                    The usage for the
+                    <filename>oe-run-native</filename> script has changed
+                    to the following:
+                    <literallayout class='monospaced'>
+     $ oe-run-native <replaceable>native_recipe</replaceable> <replaceable>tool</replaceable>
+                    </literallayout>
+                    You must supply the name of the native recipe and the tool
+                    you want to run as part of the command.
+                    Prior to the Yocto Project &DISTRO; release, it was not
+                    necessary to provide the native recipe with the command.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis><filename>cleanup-workdir</filename>:</emphasis>
+                    The <filename>cleanup-workdir</filename> script has been
+                    removed because the script was found to be deleting
+                    files it should not have, which lead to broken build
+                    trees.
+                    Rather than trying to delete portions of
+                    <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+                    and getting it wrong, it is recommended that you
+                    delete <filename>TMPDIR</filename> and have it restored
+                    from shared state (sstate) on subsequent builds.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis><filename>wipe-sysroot</filename>:</emphasis>
+                    The <filename>wipe-sysroot</filename> script has been
+                    removed as it is no longer needed with recipe-specific
+                    sysroots.
+                    </para></listitem>
+            </itemizedlist>
+        </para>
+    </section>
+
+    <section id='migration-2.3-functions'>
+        <title>Changes to Functions</title>
+
+        <para>
+            The previously deprecated
+            <filename>bb.data.getVar()</filename>,
+            <filename>bb.data.setVar()</filename>, and
+            related functions have been removed in favor of
+            <filename>d.getVar()</filename>,
+            <filename>d.setVar()</filename>, and so forth.
+        </para>
+
+        <para>
+            You need to fix any references to these old functions.
+        </para>
+    </section>
+
+    <section id='migration-2.3-bitbake-changes'>
+        <title>BitBake Changes</title>
+
+        <para>
+            The following changes took place for BitBake:
+            <itemizedlist>
+                <listitem><para>
+                    <emphasis>BitBake's Graphical Dependency Explorer UI Replaced:</emphasis>
+                    BitBake's graphical dependency explorer UI
+                    <filename>depexp</filename> was replaced by
+                    <filename>taskexp</filename> ("Task Explorer"), which
+                    provides a graphical way of exploring the
+                    <filename>task-depends.dot</filename> file.
+                    The data presented by Task Explorer is much more
+                    accurate than the data that was presented by
+                    <filename>depexp</filename>.
+                    Being able to visualize the data is an often requested
+                    feature as standard <filename>*.dot</filename> file
+                    viewers cannot usual cope with the size of
+                    the <filename>task-depends.dot</filename> file.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>BitBake "-g" Output Changes:</emphasis>
+                    The <filename>package-depends.dot</filename> and
+                    <filename>pn-depends.dot</filename> files as previously
+                    generated using the <filename>bitbake -g</filename> command
+                    have been removed.
+                    A <filename>recipe-depends.dot</filename> file
+                    is now generated as a collapsed version of
+                    <filename>task-depends.dot</filename> instead.
+                    </para>
+
+                    <para>The reason for this change is because
+                    <filename>package-depends.dot</filename> and
+                    <filename>pn-depends.dot</filename> largely date back
+                    to a time before task-based execution and do not take
+                    into account task-level dependencies between recipes,
+                    which could be misleading.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>Mirror Variable Splitting Changes:</emphasis>
+                    Mirror variables including
+                    <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>,
+                    <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>,
+                    and
+                    <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link>
+                    can now separate values entirely with spaces.
+                    Consequently, you no longer need "\\n".
+                    BitBake looks for pairs of values, which simplifies usage.
+                    There should be no change required to existing mirror
+                    variable values themselves.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>The Subversion (SVN) Fetcher Uses an "ssh" Parameter and Not an "rsh" Parameter:</emphasis>
+                    The SVN fetcher now takes an "ssh" parameter instead of an
+                    "rsh" parameter.
+                    This new optional parameter is used when the "protocol"
+                    parameter is set to "svn+ssh".
+                    You can only use the new parameter to specify the
+                    <filename>ssh</filename> program used by SVN.
+                    The SVN fetcher passes the new parameter through the
+                    <filename>SVN_SSH</filename> environment variable during
+                    the
+                    <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>
+                    task.</para>
+
+                    <para>See the
+                    "<ulink url='&YOCTO_DOCS_BB_URL;#svn-fetcher'>Subversion (SVN) Fetcher (svn://)</ulink>"
+                    section in the Yocto Project BitBake User Manual for
+                    additional information.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis><filename>BB_SETSCENE_VERIFY_FUNCTION</filename>
+                    and <filename>BB_SETSCENE_VERIFY_FUNCTION2</filename>
+                    Removed:</emphasis>
+                    Because the mechanism they were part of is no longer
+                    necessary with recipe-specific sysroots, the
+                    <filename>BB_SETSCENE_VERIFY_FUNCTION</filename> and
+                    <filename>BB_SETSCENE_VERIFY_FUNCTION2</filename>
+                    variables have been removed.
+                    </para></listitem>
+            </itemizedlist>
+        </para>
+    </section>
+
+    <section id='migration-2.3-absolute-symlinks'>
+        <title>Absolute Symbolic Links</title>
+
+        <para>
+            Absolute symbolic links (symlinks) within staged files are no
+            longer permitted and now trigger an error.
+            Any explicit creation of symlinks can use the
+            <filename>lnr</filename> script, which is a replacement for
+            <filename>ln -r</filename>.
+        </para>
+
+        <para>
+            If the build scripts in the software that the recipe is building
+            are creating a number of absolute symlinks that need to be
+            corrected, you can inherit
+            <filename>relative_symlinks</filename> within the recipe to turn
+            those absolute symlinks into relative symlinks.
+        </para>
+    </section>
+
+    <section id='migration-2.3-gplv2-and-gplv3-moves'>
+        <title>GPLv2 Versions of GPLv3 Recipes Moved</title>
+
+        <para>
+            Older GPLv2 versions of GPLv3 recipes have moved to a
+            separate <filename>meta-gplv2</filename> layer.
+        </para>
+
+        <para>
+            If you use
+            <link linkend='var-INCOMPATIBLE_LICENSE'><filename>INCOMPATIBLE_LICENSE</filename></link>
+            to exclude GPLv3 or set
+            <link linkend='var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></link>
+            to substitute a GPLv2 version of a GPLv3 recipe, then you must add
+            the <filename>meta-gplv2</filename> layer to your configuration.
+            <note>
+                You can find <filename>meta-gplv2</filename> layer in the
+                OpenEmbedded layer index at
+                <ulink url='https://layers.openembedded.org/layerindex/branch/master/layer/meta-gplv2/'></ulink>.
+            </note>
+        </para>
+
+        <para>
+            These relocated GPLv2 recipes do not receive the same level of
+            maintenance as other core recipes.
+            The recipes do not get security fixes and upstream no longer
+            maintains them.
+            In fact, the upstream community is actively hostile towards people
+            that use the old versions of the recipes.
+            Moving these recipes into a separate layer both makes the different
+            needs of the recipes clearer and clearly identifies the number of
+            these recipes.
+            <note>
+                The long-term solution might be to move to BSD-licensed
+                replacements of the GPLv3 components for those that need to
+                exclude GPLv3-licensed components from the target system.
+                This solution will be investigated for future Yocto
+                Project releases.
+            </note>
+        </para>
+    </section>
+
+    <section id='migration-2.3-package-management-changes'>
+        <title>Package Management Changes</title>
+
+        <para>
+            The following package management changes took place:
+            <itemizedlist>
+                <listitem><para>
+                    Smart package manager is replaced by DNF package manager.
+                    Smart has become unmaintained upstream, is not ported
+                    to Python 3.x.
+                    Consequently, Smart needed to be replaced.
+                    DNF is the only feasible candidate.</para>
+                    <para>The change in functionality is that the on-target
+                    runtime package management from remote package feeds is
+                    now done with a different tool that has a
+                    different set of command-line options.
+                    If you have scripts that call the
+                    tool directly, or use its API, they need to be fixed.</para>
+                    <para>For more information, see the
+                    <ulink url='http://dnf.readthedocs.io/en/latest/'>DNF Documentation</ulink>.
+                    </para></listitem>
+                <listitem><para>
+                    Rpm 5.x is replaced with Rpm 4.x.
+                    This is done for two major reasons:
+                    <itemizedlist>
+                        <listitem><para>
+                            DNF is API-incompatible with Rpm 5.x and porting
+                            it and maintaining the port is non-trivial.
+                            </para></listitem>
+                        <listitem><para>
+                            Rpm 5.x itself has limited maintenance upstream,
+                            and the Yocto Project is one of the very few
+                            remaining users.
+                            </para></listitem>
+                    </itemizedlist>
+                    </para></listitem>
+                <listitem><para>
+                    Berkeley DB 6.x is removed and Berkeley DB 5.x becomes
+                    the default:
+                    <itemizedlist>
+                        <listitem><para>
+                            Version 6.x of Berkeley DB has largely been
+                            rejected by the open source community due to its
+                            AGPLv3 license.
+                            As a result, most mainstream open source projects
+                            that require DB are still developed and tested with
+                            DB 5.x.
+                            </para></listitem>
+                        <listitem><para>
+                            In OE-core, the only thing that was requiring
+                            DB 6.x was Rpm 5.x.
+                            Thus, no reason exists to continue carrying DB 6.x
+                            in OE-core.
+                            </para></listitem>
+                    </itemizedlist>
+                    </para></listitem>
+                <listitem><para>
+                    <filename>createrepo</filename> is replaced with
+                    <filename>createrepo_c</filename>.</para>
+                    <para><filename>createrepo_c</filename> is the current
+                    incarnation of the tool that generates remote repository
+                    metadata.
+                    It is written in C as compared to
+                    <filename>createrepo</filename>, which is written in
+                    Python.
+                    <filename>createrepo_c</filename> is faster and is
+                    maintained.
+                    </para></listitem>
+                <listitem><para>
+                    Architecture-independent RPM packages are "noarch"
+                    instead of "all".</para>
+                    <para>This change was made because too many places in
+                    DNF/RPM4 stack already make that assumption.
+                    Only the filenames and the architecture tag has changed.
+                    Nothing else has changed in OE-core system, particularly
+                    in the
+                    <link linkend='ref-classes-allarch'><filename>allarch.bbclass</filename></link>
+                    class.
+                    </para></listitem>
+                <listitem><para>
+                    Signing of remote package feeds using
+                    <filename>PACKAGE_FEED_SIGN</filename>
+                    is not currently supported.
+                    This issue will be fully addressed in a future
+                    Yocto Project release.
+                    See <ulink url='https://bugzilla.yoctoproject.org/show_bug.cgi?id=11209'>defect 11209</ulink>
+                    for more information on a solution to package feed
+                    signing with RPM in the Yocto Project 2.3 release.
+                    </para></listitem>
+                <listitem><para>
+                    OPKG now uses the libsolv backend for resolving package
+                    dependencies by default.
+                    This is vastly superior to OPKG's internal ad-hoc solver
+                    that was previously used.
+                    This change does have a small impact on disk (around
+                    500 KB) and memory footprint.
+                    <note>
+                        For further details on this change, see the
+                        <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?
+id=f4d4f99cfbc2396e49c1613a7d237b9e57f06f81'>commit message</ulink>.
+                    </note>
+                    </para></listitem>
+            </itemizedlist>
+        </para>
+    </section>
+
+    <section id='migration-2.3-removed-recipes'>
+        <title>Removed Recipes</title>
+
+        <para>
+            The following recipes have been removed:
+            <itemizedlist>
+                <listitem><para>
+                    <emphasis><filename>linux-yocto 4.8:</filename></emphasis>
+                    Version 4.8 has been removed.
+                    Versions 4.1 (LTSI), 4.4 (LTS), 4.9 (LTS/LTSI) and 4.10
+                    are now present.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis><filename>python-smartpm:</filename></emphasis>
+                    Functionally replaced by <filename>dnf</filename>.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis><filename>createrepo:</filename></emphasis>
+                    Replaced by the <filename>createrepo-c</filename> recipe.
+                    </para></listitem>
+                 <listitem><para>
+                    <emphasis><filename>rpmresolve:</filename></emphasis>
+                    No longer needed with the move to RPM 4 as RPM itself is
+                    used instead.
+                    </para></listitem>
+                 <listitem><para>
+                    <emphasis><filename>gstreamer:</filename></emphasis>
+                    Removed the GStreamer Git version recipes as they have
+                    been stale.
+                    <filename>1.10.</filename><replaceable>x</replaceable>
+                    recipes are still present.
+                    </para></listitem>
+                 <listitem><para>
+                    <emphasis><filename>alsa-conf-base:</filename></emphasis>
+                    Merged into <filename>alsa-conf</filename> since
+                    <filename>libasound</filename> depended on both.
+                    Essentially, no way existed to install only one of these.
+                    </para></listitem>
+                 <listitem><para>
+                    <emphasis><filename>tremor:</filename></emphasis>
+                    Moved to <filename>meta-multimedia</filename>.
+                    Fixed-integer Vorbis decoding is not
+                    needed by current hardware.
+                    Thus, GStreamer's ivorbis plugin has been disabled
+                    by default eliminating the need for the
+                    <filename>tremor</filename> recipe in OE-Core.
+                    </para></listitem>
+                 <listitem><para>
+                    <emphasis><filename>gummiboot:</filename></emphasis>
+                    Replaced by <filename>systemd-boot</filename>.
+                    </para></listitem>
+           </itemizedlist>
+        </para>
+    </section>
+
+    <section id='migration-2.3-wic-changes'>
+        <title>Wic Changes</title>
+
+        <para>
+            The following changes have been made to Wic:
+            <note>
+                For more information on Wic, see the
+                "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-partitioned-images'>Creating Partitioned Images</ulink>"
+                section in the Yocto Project Development Manual.
+            </note>
+            <itemizedlist>
+                <listitem><para>
+                    <emphasis>Default Output Directory Changed:</emphasis>
+                    Wic's default output directory is now the current directory
+                    by default instead of the unusual
+                    <filename>/var/tmp/wic</filename>.</para>
+
+                    <para>The "-o" and "--outdir" options remain unchanged
+                    and are used to specify your preferred output directory
+                    if you do not want to use the default directory.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis>fsimage Plug-in Removed:</emphasis>
+                    The Wic fsimage plug-in has been removed as it duplicates
+                    functionality of the rawcopy plug-in.
+                    </para></listitem>
+            </itemizedlist>
+        </para>
+    </section>
+
+    <section id='migration-2.3-qa-changes'>
+        <title>QA Changes</title>
+
+        <para>
+            The following QA checks have changed:
+            <itemizedlist>
+                <listitem><para>
+                    <emphasis><filename>unsafe-references-in-binaries</filename>:</emphasis>
+                    The <filename>unsafe-references-in-binaries</filename>
+                    QA check, which was disabled by default, has now been
+                    removed.
+                    This check was intended to detect binaries in
+                    <filename>/bin</filename> that link to libraries in
+                    <filename>/usr/lib</filename> and have the case where
+                    the user has <filename>/usr</filename> on a separate
+                    filesystem to <filename>/</filename>.</para>
+
+                    <para>The removed QA check was buggy.
+                    Additionally, <filename>/usr</filename> residing on a
+                    separate partition from <filename>/</filename> is now
+                    a rare configuration.
+                    Consequently,
+                    <filename>unsafe-references-in-binaries</filename> was
+                    removed.
+                    </para></listitem>
+                <listitem><para>
+                    <emphasis><filename>file-rdeps</filename>:</emphasis>
+                    The <filename>file-rdeps</filename> QA check is now an
+                    error by default instead of a warning.
+                    Because it is an error instead of a warning, you need to
+                    address missing runtime dependencies.</para>
+
+                    <para>For additional information, see the
+                    <link linkend='ref-classes-insane'><filename>insane</filename></link>
+                    class and the
+                    "<link linkend='qa-errors-and-warnings'>Errors and Warnings</link>"
+                    section.
+                    </para></listitem>
+            </itemizedlist>
+        </para>
+    </section>
+
+    <section id='migration-2.3-miscellaneous-changes'>
+        <title>Miscellaneous Changes</title>
+
+        <para>
+            The following miscellaneous changes have occurred:
+            <itemizedlist>
+                <listitem><para>
+                    In this release, a number of recipes have been changed to
+                    ignore the <filename>largefile</filename>
+                    <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+                    item, enabling large file support unconditionally.
+                    This feature has always been enabled by default.
+                    Disabling the feature has not been widely tested.
+                    <note>
+                        Future releases of the Yocto Project will remove
+                        entirely the ability to disable the
+                        <filename>largefile</filename> feature,
+                        which would make it unconditionally enabled everywhere.
+                    </note>
+                    </para></listitem>
+                <listitem><para>
+                    If the
+                    <link linkend='var-DISTRO_VERSION'><filename>DISTRO_VERSION</filename></link>
+                    value contains the value of the
+                    <link linkend='var-DATE'><filename>DATE</filename></link>
+                    variable, which is the default between Poky releases,
+                    the <filename>DATE</filename> value is explicitly excluded
+                    from <filename>/etc/issue</filename> and
+                    <filename>/etc/issue.net</filename>, which is displayed at
+                    the login prompt, in order to avoid conflicts with
+                    Multilib enabled.
+                    Regardless, the <filename>DATE</filename> value is
+                    inaccurate if the <filename>base-files</filename>
+                    recipe is restored from shared state (sstate) rather
+                    than rebuilt.</para>
+
+                    <para>If you need the build date recorded in
+                    <filename>/etc/issue*</filename> or anywhere else in your
+                    image, a better method is to define a post-processing
+                    function to do it and have the function called from
+                    <link linkend='var-ROOTFS_POSTPROCESS_COMMAND'><filename>ROOTFS_POSTPROCESS_COMMAND</filename></link>.
+                    Doing so ensures the value is always up-to-date with the
+                    created image.
+                    </para></listitem>
+                <listitem><para>
+                    Dropbear's <filename>init</filename> script now disables
+                    DSA host keys by default.
+                    This change is in line with the systemd service
+                    file, which supports RSA keys only, and with recent
+                    versions of OpenSSH, which deprecates DSA host keys.
+                    </para></listitem>
+                <listitem><para>
+                    The
+                    <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link>
+                    class now correctly uses tabs as separators between all
+                    columns in <filename>installed-package-sizes.txt</filename>
+                    in order to aid import into other tools.
+                    </para></listitem>
+                <listitem><para>
+                    The <filename>USE_LDCONFIG</filename> variable has been
+                    replaced with the "ldconfig"
+                    <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+                    feature.
+                    Distributions that previously set:
+                    <literallayout class='monospaced'>
+     USE_LDCONFIG = "0"
+                    </literallayout>
+                    should now instead use the following:
+                    <literallayout class='monospaced'>
+     DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " ldconfig"
+                    </literallayout>
+                    </para></listitem>
+                <listitem><para>
+                    The default value of
+                    <link linkend='var-COPYLEFT_LICENSE_INCLUDE'><filename>COPYLEFT_LICENSE_INCLUDE</filename></link>
+                    now includes all versions of AGPL licenses in addition
+                    to GPL and LGPL.
+                    <note>
+                        The default list is not intended to be guaranteed
+                        as a complete safe list.
+                        You should seek legal advice based on what you are
+                        distributing if you are unsure.
+                    </note>
+                    </para></listitem>
+                <listitem><para>
+                    Kernel module packages are now suffixed with the kernel
+                    version in order to allow module packages from multiple
+                    kernel versions to co-exist on a target system.
+                    If you wish to return to the previous naming scheme
+                    that does not include the version suffix, use the
+                    following:
+                    <literallayout class='monospaced'>
+     KERNEL_MODULE_PACKAGE_SUFFIX to ""
+                    </literallayout>
+                    </para></listitem>
+                <listitem><para>
+                    Removal of <filename>libtool</filename>
+                    <filename>*.la</filename> files is now enabled by default.
+                    The <filename>*.la</filename> files are not actually
+                    needed on Linux and relocating them is an unnecessary
+                    burden.</para>
+
+                    <para>If you need to preserve these
+                    <filename>.la</filename> files (e.g. in a custom
+                    distribution), you must change
+                    <link linkend='var-INHERIT_DISTRO'><filename>INHERIT_DISTRO</filename></link>
+                    such that "remove-libtool" is not included in the value.
+                    </para></listitem>
+                <listitem><para>
+                    Extensible SDKs built for GCC 5+ now refuse to install on a
+                    distribution where the host GCC version is 4.8 or 4.9.
+                    This change resulted from the fact that the installation
+                    is known to fail due to the way the
+                    <filename>uninative</filename> shared state (sstate)
+                    package is built.
+                    See the
+                    <link linkend='ref-classes-uninative'><filename>uninative</filename></link>
+                    class for additional information.
+                    </para></listitem>
+                <listitem><para>
+                    All native and nativesdk recipes now use a separate
+                    <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+                    value instead of sharing the value used by recipes for the
+                    target, in order to avoid unnecessary rebuilds.</para>
+
+                    <para>The <filename>DISTRO_FEATURES</filename> for
+                    <filename>native</filename> recipes is
+                    <link linkend='var-DISTRO_FEATURES_NATIVE'><filename>DISTRO_FEATURES_NATIVE</filename></link>
+                    added to an intersection of
+                    <filename>DISTRO_FEATURES</filename> and
+                    <link linkend='var-DISTRO_FEATURES_FILTER_NATIVE'><filename>DISTRO_FEATURES_FILTER_NATIVE</filename></link>.
+                    </para>
+
+                    <para>For nativesdk recipes, the
+                    corresponding variables are
+                    <link linkend='var-DISTRO_FEATURES_NATIVESDK'><filename>DISTRO_FEATURES_NATIVESDK</filename></link>
+                    and
+                    <link linkend='var-DISTRO_FEATURES_FILTER_NATIVESDK'><filename>DISTRO_FEATURES_FILTER_NATIVESDK</filename></link>.
+                    </para></listitem>
+                <listitem><para>
+                    The <filename>FILESDIR</filename>
+                    variable, which was previously deprecated and rarely used,
+                    has now been removed.
+                    You should change any recipes that set
+                    <filename>FILESDIR</filename> to set
+                    <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>
+                    instead.
+                    </para></listitem>
+                <listitem><para>
+                    The <filename>MULTIMACH_HOST_SYS</filename>
+                    variable has been removed as it is no longer needed
+                    with recipe-specific sysroots.
+                    </para></listitem>
+            </itemizedlist>
+        </para>
+    </section>
+</section>
 </chapter>
 <!--
 vim: expandtab tw=80 ts=4
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-bitbake.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-bitbake.xml
index 1de1148..2f36e16 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/ref-bitbake.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-bitbake.xml
@@ -414,7 +414,7 @@
   -l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS
                         Show debug logging for the specified logging domains
   -P, --profile         Profile the command and save reports.
-  -u UI, --ui=UI        The user interface to use (e.g. knotty and depexp).
+  -u UI, --ui=UI        The user interface to use (e.g. knotty and taskexp).
   -t SERVERTYPE, --servertype=SERVERTYPE
                         Choose which server to use, process or xmlrpc.
   --revisions-changed   Set the exit code depending on whether upstream
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-classes.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-classes.xml
index f7b1126..c88162b 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/ref-classes.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-classes.xml
@@ -1301,19 +1301,27 @@
     <title><filename>image-live.bbclass</filename></title>
 
     <para>
-        The <filename>image-live</filename> class supports building "live"
-        images.
+        This class controls building "live" (i.e. HDDIMG and ISO) images.
+        Live images contain syslinux for legacy booting, as well as the
+        bootloader specified by
+        <link linkend='var-EFI_PROVIDER'><filename>EFI_PROVIDER</filename></link>
+        if
+        <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link>
+        contains "efi".
     </para>
 
     <para>
         Normally, you do not use this class directly.
         Instead, you add "live" to
         <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>.
+        You can selectively build just one of these types through the
+        <link linkend='var-NOISO'><filename>NOISO</filename></link>
+        and
+        <link linkend='var-NOHDD'><filename>NOHDD</filename></link> variables.
         For example, if you were building an ISO image, you would add "live"
         to <filename>IMAGE_FSTYPES</filename>, set the
-        <link linkend='var-NOISO'><filename>NOISO</filename></link> variable to
-        "0" and the build system would use the <filename>image-live</filename>
-        class to build the ISO image.
+        <filename>NOISO</filename> variable to "0" and the build system would
+        use the <filename>image-live</filename> class to build the ISO image.
     </para>
 </section>
 
@@ -1755,6 +1763,9 @@
                 <link linkend='qa-issue-textrel'><filename>ELF binary</filename></link>
                 message for more information regarding runtime performance issues.
                 </para></listitem>
+<!--
+This check was removed for YP 2.3 release
+
             <listitem><para><emphasis><filename>unsafe-references-in-binaries:</filename></emphasis>
                 Reports when a binary installed in
                 <filename>${base_libdir}</filename>,
@@ -1776,6 +1787,7 @@
                     <filename>/usr</filename>.
                 </note>
                 </para></listitem>
+-->
             <listitem><para><emphasis><filename>unsafe-references-in-scripts:</filename></emphasis>
                 Reports when a script file installed in
                 <filename>${base_libdir}</filename>,
@@ -2216,6 +2228,14 @@
                 functionality specific to the respective native or target
                 case.</para></listitem>
         </itemizedlist>
+        <note><title>Warning</title>
+            When creating a recipe, you must follow this naming convention:
+            <literallayout class='monospaced'>
+     native-<replaceable>myrecipe</replaceable>.bb
+            </literallayout>
+            Not doing so can lead to subtle problems because code exists
+            that depends on the naming convention.
+        </note>
     </para>
 
     <para>
@@ -2258,6 +2278,14 @@
                 functionality specific to the respective SDK machine or target
                 case.</para></listitem>
         </itemizedlist>
+        <note><title>Warning</title>
+            When creating a recipe, you must follow this naming convention:
+            <literallayout class='monospaced'>
+     nativesdk-<replaceable>myrecipe</replaceable>.bb
+            </literallayout>
+            Not doing so can lead to subtle problems because code exists
+            that depends on the naming convention.
+        </note>
     </para>
 
     <para>
@@ -2374,7 +2402,7 @@
 
     <para>
         If you take the optional step to set up a repository (package feed)
-        on the development host that can be used by Smart, you can
+        on the development host that can be used by DNF, you can
         install packages from the feed while you are running the image
         on the target (i.e. runtime installation of packages).
         For more information, see the
@@ -3190,13 +3218,144 @@
     <title><filename>staging.bbclass</filename></title>
 
     <para>
-        The <filename>staging</filename> class provides the
-        <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
-        task, which stages files into the sysroot to make them available to
-        other recipes at build time.
-        The class is enabled by default because it is inherited by the
-        <link linkend='ref-classes-base'><filename>base</filename></link>
-        class.
+        The <filename>staging</filename> class installs files into individual
+        recipe work directories for sysroots.
+        The class contains the following key tasks:
+        <itemizedlist>
+            <listitem><para>
+                The
+                <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+                task, which is responsible for handing the files that end up
+                in the recipe sysroots.
+                </para></listitem>
+            <listitem><para>
+                The
+                <link linkend='ref-tasks-prepare_recipe_sysroot'><filename>do_prepare_recipe_sysroot</filename></link>
+                task (a "partner" task to the
+                <filename>populate_sysroot</filename> task), which installs
+                the files into the individual recipe work directories (i.e.
+                <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>).
+                </para></listitem>
+        </itemizedlist>
+    </para>
+
+    <para>
+        The code in the <filename>staging</filename> class is complex and
+        basically works in two stages:
+        <itemizedlist>
+            <listitem><para>
+                <emphasis>Stage One:</emphasis>
+                The first stage addresses recipes that have files they want
+                to share with other recipes that have dependencies on the
+                originating recipe.
+                Normally these dependencies are installed through the
+                <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+                task into
+                <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>.
+                The <filename>do_populate_sysroot</filename> task copies
+                a subset of these files into
+                <filename>${SYSROOT_DESTDIR}</filename>.
+                This subset of files is controlled by the
+                <link linkend='var-SYSROOT_DIRS'><filename>SYSROOT_DIRS</filename></link>,
+                <link linkend='var-SYSROOT_DIRS_NATIVE'><filename>SYSROOT_DIRS_NATIVE</filename></link>,
+                and
+                <link linkend='var-SYSROOT_DIRS_BLACKLIST'><filename>SYSROOT_DIRS_BLACKLIST</filename></link>
+                variables.
+                <note>
+                    Additionally, a recipe can customize the files further by
+                declaring a processing function in the
+                    <link linkend='var-SYSROOT_PREPROCESS_FUNCS'><filename>SYSROOT_PREPROCESS_FUNCS</filename></link>
+                    variable.
+                </note>
+                </para>
+
+                <para>
+                A shared state (sstate) object is built from these files
+                and the files are placed into a subdirectory of
+                <link linkend='structure-build-tmp-sysroots-components'><filename>tmp/sysroots-components/</filename></link>.
+                The files are scanned for hardcoded paths to the original
+                installation location.
+                If the location is found in text files, the hardcoded
+                locations are replaced by tokens and a list of the files
+                needing such replacements is created.
+                These adjustments are referred to as "FIXMEs".
+                The list of files that are scanned for paths is controlled by
+                the
+                <link linkend='var-SSTATE_SCAN_FILES'><filename>SSTATE_SCAN_FILES</filename></link>
+                variable.
+                </para></listitem>
+            <listitem><para>
+                <emphasis>Stage Two:</emphasis>
+                The second stage addresses recipes that want to use something
+                from another recipe and declare a dependency on that recipe
+                through the
+                <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+                variable.
+                The recipe will have a
+                <link linkend='ref-tasks-prepare_recipe_sysroot'><filename>do_prepare_recipe_sysroot</filename></link>
+                task and when
+                this task executes, it creates the
+                <filename>recipe-sysroot</filename> and
+                <filename>recipe-sysroot-native</filename> in the recipe
+                work directory (i.e.
+                <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>).
+                The OpenEmbedded build system creates hard links to copies of the
+                relevant files from <filename>sysroots-components</filename>
+                into the recipe work directory.
+                <note>
+                    If hard links are not possible, the build system uses
+                    actual copies.
+                </note>
+                The build system then addresses any "FIXMEs" to paths as
+                defined from the list created in the first stage.
+                </para>
+
+                <para>
+                Finally, any files in <filename>${bindir}</filename>
+                within the sysroot that have the prefix
+                "<filename>postinst-</filename>" are executed.
+                <note>
+                    Although such sysroot post installation scripts are not
+                    recommended for general use, the files do allow some issues
+                    such as user creation and module indexes to be addressed.
+                </note>
+                </para>
+
+                <para>
+                Because recipes can have other dependencies outside of
+                <filename>DEPENDS</filename> (e.g.
+                <filename>do_unpack[depends] += "tar-native:do_populate_sysroot"</filename>),
+                the sysroot creation function
+                <filename>extend_recipe_sysroot</filename> is also added as
+                a pre-function for those tasks whose dependencies are not
+                through <filename>DEPENDS</filename> but operate similarly.
+                </para>
+
+                <para>
+                When installing dependencies into the sysroot, the code
+                traverses the dependency graph and processes dependencies
+                in exactly the same way as the dependencies would or would not
+                be when installed from sstate.
+                This processing means, for example, a native tool would have
+                its native dependencies added but a target library would not
+                have its dependencies traversed or installed.
+                The same sstate dependency code is used so that
+                builds should be identical regardless of whether sstate
+                was used or not.
+                For a closer look, see the
+                <filename>setscene_depvalid()</filename> function in the
+                <link linkend='ref-classes-sstate'><filename>sstate</filename></link>
+                class.
+                </para>
+
+                <para>
+                The build system is careful to maintain manifests of the files
+                it installs so that any given dependency can be installed as
+                needed.
+                The sstate hash of the installed item is also stored so that
+                if it changes, the build system can reinstall it.
+                </para></listitem>
+        </itemizedlist>
     </para>
 </section>
 
@@ -3532,6 +3691,14 @@
         For an example, see the
         <filename>meta/conf/distro/include/yocto-uninative.inc</filename>.
     </para>
+
+    <para>
+        The <filename>uninative</filename> class is also used unconditionally
+        by the extensible SDK.
+        When building the extensible SDK,
+        <filename>uninative-tarball</filename> is built and the resulting
+        tarball is included within the SDK.
+    </para>
 </section>
 
 <section id='ref-classes-update-alternatives'>
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-devtool-reference.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-devtool-reference.xml
index 1764f01..99d5a52 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/ref-devtool-reference.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-devtool-reference.xml
@@ -215,6 +215,17 @@
             The <filename>.bbappend</filename> file is created to point
             to the external source tree.
         </para>
+
+        <note>
+            If your recipe has runtime dependencies defined, you must be sure
+            that these packages exist on the target hardware before attempting
+            to run your application.
+            If dependent packages (e.g. libraries) do not exist on the target,
+            your application, when run, will fail to find those functions.
+            For more information, see the
+            "<link linkend='devtool-deploying-your-software-on-the-target-machine'>Deploying Your Software on the Target Machine</link>"
+            section.
+        </note>
     </section>
 
     <section id='devtool-extracting-the-source-for-an-existing-recipe'>
@@ -501,6 +512,40 @@
                 </para>
             </note>
         </para>
+
+        <para>
+            Some conditions exist that could prevent a deployed application
+            from behaving as expected.
+            When both of the following conditions exist, your application has
+            the potential to not behave correctly when run on the target:
+            <itemizedlist>
+                <listitem><para>
+                    You are deploying a new application to the target and
+                    the recipe you used to build the application had
+                    correctly defined runtime dependencies.
+                    </para></listitem>
+                <listitem><para>
+                    The target does not physically have the packages on which
+                    the application depends installed.
+                    </para></listitem>
+            </itemizedlist>
+            If both of these conditions exist, your application will not
+            behave as expected.
+            The reason for this misbehavior is because the
+            <filename>devtool deploy-target</filename> command does not deploy
+            the packages (e.g. libraries) on which your new application
+            depends.
+            The assumption is that the packages are already on the target.
+            Consequently, when a runtime call is made in the application
+            for a dependent function (e.g. a library call), the function
+            cannot be found.
+        </para>
+
+        <para>
+            To be sure you have all the dependencies local to the target, you
+            need to be sure that the packages are pre-deployed (installed)
+            on the target before attempting to run your application.
+        </para>
     </section>
 
     <section id='devtool-removing-your-software-from-the-target-machine'>
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-features.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-features.xml
index 282a517..7e1c5ef 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/ref-features.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-features.xml
@@ -195,6 +195,10 @@
                 <listitem><para><emphasis>keyboard:</emphasis> Include keyboard
                     support (e.g. keymaps will be loaded during boot).
                     </para></listitem>
+                <listitem><para><emphasis>ldconfig:</emphasis>
+                    Include support for ldconfig and
+                    <filename>ld.so.conf</filename> on the target.
+                    </para></listitem>
                 <listitem><para><emphasis>nfs:</emphasis> Include NFS client
                     support (for mounting NFS exports on device).
                     </para></listitem>
@@ -297,6 +301,12 @@
                     Enables logging postinstall script runs to
                     the <filename>/var/log/postinstall.log</filename> file
                     on first boot of the image on the target system.
+                    <note>
+                        To make the <filename>/var/log</filename> directory
+                        on the target persistent, use the
+                        <ulink url='&YOCTO_DOCS_REF_URL;#var-VOLATILE_LOG_DIR'><filename>VOLATILE_LOG_DIR</filename></ulink>
+                        variable by setting it to "no".
+                    </note>
                     </para></listitem>
                 <listitem><para><emphasis>ptest-pkgs:</emphasis>
                     Installs ptest packages for all ptest-enabled recipes.
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-images.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-images.xml
index 69b58f6..f220968 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/ref-images.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-images.xml
@@ -54,9 +54,6 @@
             <listitem><para><filename>core-image-clutter</filename>:
                 An image with support for the Open GL-based toolkit Clutter, which enables development of
                 rich and animated graphical user interfaces.</para></listitem>
-            <listitem><para><filename>core-image-directfb</filename>:
-                An image that uses <filename>directfb</filename> instead of X11.
-                </para></listitem>
             <listitem><para><filename>core-image-full-cmdline</filename>:
                 A console-only image with more full-featured Linux system
                 functionality installed.</para></listitem>
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-manual.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-manual.xml
index 47f6476..752b210 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/ref-manual.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-manual.xml
@@ -108,14 +108,29 @@
                 <revremark>Released with the Yocto Project 2.2 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.1</revnumber>
-                <date>January 2017</date>
-                <revremark>Released with the Yocto Project 2.2.1 Release.</revremark>
+                <revnumber>2.3</revnumber>
+                <date>May 2017</date>
+                <revremark>Released with the Yocto Project 2.3 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.2</revnumber>
+                <revnumber>2.3.1</revnumber>
                 <date>June 2017</date>
-                <revremark>Released with the Yocto Project 2.2.2 Release.</revremark>
+                <revremark>Released with the Yocto Project 2.3.1 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.2</revnumber>
+                <date>September 2017</date>
+                <revremark>Released with the Yocto Project 2.3.2 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.3</revnumber>
+                <date>January 2018</date>
+                <revremark>Released with the Yocto Project 2.3.3 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.4</revnumber>
+                <date>April 2018</date>
+                <revremark>Released with the Yocto Project 2.3.4 Release.</revremark>
             </revision>
         </revhistory>
 
@@ -129,12 +144,32 @@
         Permission is granted to copy, distribute and/or modify this document under
         the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
       </para>
-      <note>
-          For the latest version of this manual associated with this
-          Yocto Project release, see the
-          <ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink>
-          from the Yocto Project website.
-      </note>
+           <note><title>Manual Notes</title>
+               <itemizedlist>
+                   <listitem><para>
+                       For the latest version of the Yocto Project Reference
+                       Manual associated with this Yocto Project release
+                       (version &YOCTO_DOC_VERSION;),
+                       see the Yocto Project Reference Manual from the
+                       <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+                       </para></listitem>
+                   <listitem><para>
+                       This version of the manual is version
+                       &YOCTO_DOC_VERSION;.
+                       For later releases of the Yocto Project (if they exist),
+                       go to the
+                       <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+                       and use the drop-down "Active Releases" button
+                       and choose the Yocto Project version for which you want
+                       the manual.
+                       </para></listitem>
+                   <listitem><para>
+                       For an in-development version of the Yocto Project
+                       Reference Manual, see
+                        <ulink url='&YOCTO_DOCS_URL;/latest/ref-manual/ref-manual.html'></ulink>.
+                        </para></listitem>
+                </itemizedlist>
+            </note>
     </legalnotice>
 
     </bookinfo>
@@ -147,6 +182,8 @@
 
     <xi:include href="technical-details.xml"/>
 
+    <xi:include href="ref-release-process.xml"/>
+
     <xi:include href="migration.xml"/>
 
     <xi:include href="ref-structure.xml"/>
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-qa-checks.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-qa-checks.xml
index 86456bd..515106a 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/ref-qa-checks.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-qa-checks.xml
@@ -1170,45 +1170,6 @@
             </listitem>
         </itemizedlist>
     </para>
-
-<!--
-Here are some messages that might be documented in the future.
-Right now we are not documenting them because the QA checks are not
-enabled by default:
-
-    <para>
-        <itemizedlist>
-            <listitem><para>
-                <literallayout class='monospaced'>
-     Desktop file issue: &lt;error&gt; [desktop]
-                </literallayout>
-                NEED A DESCRIPTION AND SOLUTION
-                </para></listitem>
-        </itemizedlist>
-    </para>
-
-    <para>
-        <itemizedlist>
-            <listitem><para>
-                <literallayout class='monospaced'>
-     &lt;packagename&gt;: &lt;file&gt;, installed in the base_prefix, requires a shared library under exec_prefix (&lt;exec_prefix&t;g) [unsafe-references-in-binaries]
-                </literallayout>
-                NEED A DESCRIPTION AND SOLUTION
-                </para></listitem>
-        </itemizedlist>
-    </para>
-
-    <para>
-        <itemizedlist>
-            <listitem><para>
-                <literallayout class='monospaced'>
-     &lt;packagename&gt;: Found a reference to &lt;exec_prefix&gt;/ in &lt;path&gt; - Shell scripts in base_bindir and base_sbindir should not reference anything in exec_prefix [unsafe-references-in-scripts]
-                </literallayout>
-                NEED A DESCRIPTION AND SOLUTION
-                </para></listitem>
-        </itemizedlist>
-    </para>
--->
 </section>
 
 <section id='configuring-and-disabling-qa-checks'>
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-release-process.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-release-process.xml
new file mode 100644
index 0000000..fe3ba09
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-release-process.xml
@@ -0,0 +1,254 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-release-process'>
+<title>Yocto Project Releases and the Stable Release Process</title>
+
+<para>
+    The Yocto Project release process is predictable and consists of both
+    major and minor (point) releases.
+    This brief chapter provides information on how releases are named, their
+    life cycle, and their stability.
+</para>
+
+<section id='major-and-minor-release-cadence'>
+    <title>Major and Minor Release Cadence</title>
+
+    <para>
+        The Yocto Project delivers major releases (e.g. &DISTRO;) using a six
+        month cadence roughly timed each April and October of the year.
+        Following are examples of some major YP releases with their codenames
+        also shown.
+        See the
+        "<link linkend='major-release-codenames'>Major Release Codenames</link>"
+        section for information on codenames used with major releases.
+        <literallayout class='monospaced'>
+    2.2 (Morty)
+    2.1 (Krogoth)
+    2.0 (Jethro)
+        </literallayout>
+        While the cadence is never perfect, this timescale facilitates
+        regular releases that have strong QA cycles while not overwhelming
+        users with too many new releases.
+        The cadence is predictable and avoids many major holidays in various
+        geographies.
+    </para>
+
+    <para>
+        The Yocto project delivers minor (point) releases on an unscheduled
+        basis and are usually driven by the accumulation of enough significant
+        fixes or enhancements to the associated major release.
+        Following are some example past point releases:
+        <literallayout class='monospaced'>
+    2.1.1
+    2.1.2
+    2.2.1
+        </literallayout>
+        The point release indicates a point in the major release branch where
+        a full QA cycle and release process validates the content of the new
+        branch.
+        <note>
+            Realize that there can be patches merged onto the stable release
+            branches as and when they become available.
+        </note>
+    </para>
+</section>
+
+<section id='major-release-codenames'>
+    <title>Major Release Codenames</title>
+
+    <para>
+        Each major release receives a codename that identifies the release in
+        the
+        <ulink url='&YOCTO_DOCS_DEV_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>.
+        The concept is that branches of
+        <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+        with the same codename are likely to be compatible and thus
+        work together.
+        <note>
+            Codenames are associated with major releases because a Yocto
+            Project release number (e.g. &DISTRO;) could conflict with
+            a given layer or company versioning scheme.
+            Codenames are unique, interesting, and easily identifiable.
+        </note>
+        Releases are given a nominal release version as well but the codename
+        is used in repositories for this reason.
+        You can find information on Yocto Project releases and codenames at
+        <ulink url='https://wiki.yoctoproject.org/wiki/Releases'></ulink>.
+    </para>
+</section>
+
+<section id='stable-release-process'>
+    <title>Stable Release Process</title>
+
+    <para>
+        Once released, the release enters the stable release process at which
+        time a person is assigned as the maintainer for that stable release.
+        This maintainer monitors activity for the release by investigating
+        and handling nominated patches and backport activity.
+        Only fixes and enhancements that have first been applied on the
+        "master" branch (i.e. the current, in-development branch) are
+        considered for backporting to a stable release.
+        <note>
+            The current Yocto Project policy regarding backporting is to
+            consider bug fixes and security fixes only.
+            Policy dictates that features are not backported to a stable
+            release.
+            This policy means generic recipe version upgrades are unlikely to
+            be accepted for backporting.
+            The exception to this policy occurs when a strong reason exists
+            such as the fix happens to also be the preferred upstream approach.
+        </note>
+    </para>
+
+    <para>
+        Stable release branches have strong maintenance for about a year after
+        their initial release.
+        Should significant issues be found for any release regardless of its
+        age, fixes could be backported to older releases.
+        For issues that are not backported given an older release,
+        Community LTS trees and branches exist where
+        community members share patches for older releases.
+        However, these types of patches do not go through the same release
+        process as do point releases.
+        You can find more information about stable branch maintenance at
+        <ulink url='https://wiki.yoctoproject.org/wiki/Stable_branch_maintenance'></ulink>.
+    </para>
+</section>
+
+<section id='testing-and-quality-assurance'>
+    <title>Testing and Quality Assurance</title>
+
+    <para>
+        Part of the Yocto Project development and release process is quality
+        assurance through the execution of test strategies.
+        Test strategies provide the Yocto Project team a way to ensure a
+        release is validated.
+        Additionally, because the test strategies are visible to you as a
+        developer, you can validate your projects.
+        This section overviews the available test infrastructure used in the
+        Yocto Project.
+        For information on how to run available tests on your projects, see the
+        "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
+        section in the Yocto Project Development Manual.
+    </para>
+
+    <para>
+        The QA/testing infrastructure is woven into the project to the point
+        where core developers take some of it for granted.
+        The infrastructure consists of the following pieces:
+        <itemizedlist>
+            <listitem><para>
+                <filename>bitbake-selftest</filename>:
+                A standalone command that runs unit tests on key pieces of
+                BitBake and its fetchers.
+                </para></listitem>
+            <listitem><para>
+                <link linkend='ref-classes-sanity'><filename>sanity.bbclass</filename></link>:
+                This automatically included class checks the build environment
+                for missing tools (e.g. <filename>gcc</filename>) or common
+                misconfigurations such as
+                <link linkend='var-MACHINE'><filename>MACHINE</filename></link>
+                set incorrectly.
+                </para></listitem>
+            <listitem><para>
+                <link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>:
+                This class checks the generated output from builds for sanity.
+                For example, if building for an ARM target, did the build
+                produce ARM binaries.
+                If, for example, the build produced PPC binaries then there
+                is a problem.
+                </para></listitem>
+            <listitem><para>
+                <link linkend='ref-classes-testimage*'><filename>testimage.bbclass</filename></link>:
+                This class performs runtime testing of images after they are
+                built.
+                The tests are usually used with
+                <ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-qemu'>QEMU</ulink>
+                to boot the images and check the combined runtime result
+                boot operation and functions.
+                However, the test can also use the IP address of a machine to
+                test.
+                </para></listitem>
+            <listitem><para>
+                <ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'><filename>ptest</filename></ulink>:
+                Runs tests against packages produced during the build for a
+                given piece of software.
+                The test allows the packages to be be run within a target
+                image.
+                </para></listitem>
+            <listitem><para>
+                <filename>oe-selftest</filename>:
+                Tests combination BitBake invocations.
+                These tests operate outside the OpenEmbedded build system
+                itself.
+                The <filename>oe-selftest</filename> can run all tests by
+                default or can run selected tests or test suites.
+                <note>
+                    Running <filename>oe-selftest</filename> requires
+                    host packages beyond the "Essential" grouping.
+                    See the
+                    "<link linkend='required-packages-for-the-host-development-system'>Required Packages for the Host Development System</link>"
+                    section for more information.
+                </note>
+                </para></listitem>
+        </itemizedlist>
+    </para>
+
+    <para>
+        Originally, much of this testing was done manually.
+        However, significant effort has been made to automate the tests so
+        that more people can use them and the Yocto Project development team
+        can run them faster and more efficiently.
+    </para>
+
+    <para>
+        The Yocto Project's main Autobuilder
+        (<filename>autobuilder.yoctoproject.org</filename>) publicly tests
+        each Yocto Project release's code in the OE-Core, Poky, and BitBake
+        repositories.
+        The testing occurs for both the current state of the
+        "master" branch and also for submitted patches.
+        Testing for submitted patches usually occurs in the
+        "ross/mut" branch in the <filename>poky-contrib</filename> repository
+        (i.e. the master-under-test branch) or in the "master-next" branch
+        in the <filename>poky</filename> repository.
+        <note>
+            You can find all these branches in the Yocto Project
+            <ulink url='&YOCTO_DOCS_DEV_URL;#source-repositories'>Source Repositories</ulink>.
+        </note>
+        Testing within these public branches ensures in a publicly visible way
+        that all of the main supposed architectures and recipes in OE-Core
+        successfully build and behave properly.
+    </para>
+
+    <para>
+        Various features such as <filename>multilib</filename>, sub
+        architectures (e.g. <filename>x32</filename>,
+        <filename>poky-tiny</filename>, <filename>musl</filename>,
+        <filename>no-x11</filename> and and so forth),
+        <filename>bitbake-selftest</filename>, and
+        <filename>oe-selftest</filename> are tested as part of
+        the QA process of a release.
+        Complete testing and validation for a release takes the Autobuilder
+        workers several hours.
+        <note>
+            The Autobuilder workers are non-homogeneous, which means regular
+            testing across a variety of Linux distributions occurs.
+            The Autobuilder is limited to only testing QEMU-based setups and
+            not real hardware.
+        </note>
+    </para>
+
+    <para>
+        Finally, in addition to the Autobuilder's tests, the Yocto Project
+        QA team also performs testing on a variety of platforms, which includes
+        actual hardware, to ensure expected results.
+    </para>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-structure.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-structure.xml
index 541a47e..9b2701c 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/ref-structure.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-structure.xml
@@ -797,15 +797,47 @@
         </para>
     </section>
 
+    <section id='structure-build-tmp-sysroots-components'>
+        <title><filename>build/tmp/sysroots-components/</filename></title>
+
+        <para>
+            This directory is the location of the sysroot contents that the
+            task
+            <link linkend='ref-tasks-prepare_recipe_sysroot'><filename>do_prepare_recipe_sysroot</filename></link>
+            links or copies into the recipe-specific sysroot for each
+            recipe listed in
+            <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>.
+            Population of this directory is handled through shared state, while
+            the path is specified by the <filename>COMPONENTS_DIR</filename>
+            variable. Apart from a few unusual circumstances, handling of the
+            <filename>sysroots-components</filename> directory should be
+            automatic, and recipes should not directly reference
+            <filename>build/tmp/sysroots-components</filename>.
+        </para>
+    </section>
+
     <section id='structure-build-tmp-sysroots'>
         <title><filename>build/tmp/sysroots/</filename></title>
 
         <para>
-            This directory contains shared header files and libraries as well as other shared
-            data.
-            Packages that need to share output with other packages do so within this directory.
-            The directory is subdivided by architecture so multiple builds can run within
-            the one Build Directory.
+            Previous versions of the OpenEmbedded build system used to
+            create a global shared sysroot per machine along with a native
+            sysroot.
+            Beginning with the &DISTRO; version of the Yocto Project,
+            sysroots exist in recipe-specific
+            <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
+            directories.
+            Thus, the <filename>build/tmp/sysroots/</filename> directory
+            is unused.
+            <note>
+                The <filename>build/tmp/sysroots/</filename> directory
+                can still be populated using the
+                <filename>bitbake build-sysroots</filename> command and can
+                be used for compatibility in some cases.
+                However, in general it is not recommended to populate
+                this directory.
+                Individual recipe-specific sysroots should be used.
+            </note>
         </para>
     </section>
 
@@ -894,6 +926,101 @@
         </para>
     </section>
 
+    <section id='structure-build-tmp-work-tunearch-recipename-version'>
+        <title><filename>build/tmp/work/<replaceable>tunearch</replaceable>/<replaceable>recipename</replaceable>/<replaceable>version</replaceable>/</filename></title>
+
+        <para>
+            The recipe work directory - <filename>${WORKDIR}</filename>.
+        </para>
+
+        <para>
+            As described earlier in the
+            "<link linkend='structure-build-tmp-sysroots'><filename>build/tmp/sysroots/</filename></link>"
+            section, beginning with the &DISTRO; release of the Yocto
+            Project, the OpenEmbedded build system builds each recipe in its
+            own work directory (i.e.
+            <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>).
+            The path to the work directory is constructed using the
+            architecture of the given build (e.g.
+            <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link>,
+            <link linkend='var-MACHINE_ARCH'><filename>MACHINE_ARCH</filename></link>,
+            or "allarch"), the recipe name, and the version of the recipe (i.e.
+            <link linkend='var-PE'><filename>PE</filename></link><filename>:</filename><link linkend='var-PV'><filename>PV</filename></link><filename>-</filename><link linkend='var-PR'><filename>PR</filename></link>).
+        </para>
+
+        <para>
+            A number of key subdirectories exist within each recipe
+            work directory:
+            <itemizedlist>
+                <listitem><para>
+                    <filename>${WORKDIR}/temp</filename>:
+                    Contains the log files of each task executed for this
+                    recipe, the "run" files for each executed task, which
+                    contain the code run, and a
+                    <filename>log.task_order</filename> file, which lists the
+                    order in which tasks were executed.
+                   </para></listitem>
+                <listitem><para>
+                    <filename>${WORKDIR}/image</filename>:
+                    Contains the output of the
+                    <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+                    task, which corresponds to the
+                    <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>
+                    variable in that task.
+                   </para></listitem>
+                <listitem><para>
+                    <filename>${WORKDIR}/pseudo</filename>:
+                    Contains the pseudo database and log for any tasks executed
+                    under pseudo for the recipe.
+                   </para></listitem>
+                <listitem><para>
+                    <filename>${WORKDIR}/sysroot-destdir</filename>:
+                    Contains the output of the
+                    <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+                    task.
+                   </para></listitem>
+                <listitem><para>
+                    <filename>${WORKDIR}/package</filename>:
+                    Contains the output of the
+                    <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+                    task before the output is split into individual packages.
+                   </para></listitem>
+                <listitem><para>
+                    <filename>${WORKDIR}/packages-split</filename>:
+                    Contains the output of the <filename>do_package</filename>
+                    task after the output has been split into individual
+                    packages.
+                    Subdirectories exist for each individual package created
+                    by the recipe.
+                   </para></listitem>
+                <listitem><para>
+                    <filename>${WORKDIR}/recipe-sysroot</filename>:
+                    A directory populated with the target dependencies of the
+                    recipe.
+                    This directory looks like the target filesystem and
+                    contains libraries that the recipe might need to link
+                    against (e.g. the C library).
+                   </para></listitem>
+                <listitem><para>
+                    <filename>${WORKDIR}/recipe-sysroot-native</filename>:
+                    A directory populated with the native dependencies of the
+                    recipe.
+                    This directory contains the tools the recipe needs to build
+                    (e.g. the compiler, Autoconf, libtool, and so forth).
+                   </para></listitem>
+                <listitem><para>
+                    <filename>${WORKDIR}/build</filename>:
+                    This subdirectory applies only to recipes that support
+                    builds where the source is separate from the
+                    build artifacts.
+                    The OpenEmbedded build system uses this directory as a
+                    separate build directory (i.e.
+                    <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>).
+                   </para></listitem>
+            </itemizedlist>
+        </para>
+    </section>
+
     <section id='structure-build-work-shared'>
         <title><filename>build/tmp/work-shared/</filename></title>
 
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-tasks.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-tasks.xml
index e9859c1..87ddb98 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/ref-tasks.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-tasks.xml
@@ -490,6 +490,21 @@
         </para>
     </section>
 
+    <section id='ref-tasks-prepare_recipe_sysroot'>
+        <title><filename>do_prepare_recipe_sysroot</filename></title>
+
+        <para>
+            Installs the files into the individual recipe specific sysroots
+            (i.e.
+            <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}</filename>
+            based upon the dependencies specified by
+            <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>.
+            See the
+            "<link linkend='ref-classes-staging'><filename>staging</filename></link>"
+            class for more information.
+        </para>
+    </section>
+
     <section id='ref-tasks-rm_work'>
         <title><filename>do_rm_work</filename></title>
 
@@ -853,7 +868,10 @@
         <title><filename>do_compile_kernelmodules</filename></title>
 
         <para>
-            Compiles loadable modules for the Linux kernel.
+            Runs the step that builds the kernel modules (if needed).
+            Building a kernel consists of two steps: 1) the kernel
+            (<filename>vmlinux</filename>) is built, and 2) the modules
+            are built (i.e. <filename>make modules</filename>).
         </para>
     </section>
 
@@ -861,9 +879,21 @@
         <title><filename>do_diffconfig</filename></title>
 
         <para>
-            Compares the old and new config files after running the
-            <link linkend='ref-tasks-menuconfig'><filename>do_menuconfig</filename></link>
-            task for the kernel.
+            When invoked by the user, this task creates a file containing the
+            differences between the original config as produced by
+            <link linkend='ref-tasks-kernel_configme'><filename>do_kernel_configme</filename></link>
+            task and the changes made by the user with other methods
+            (i.e. using
+            (<link linkend='ref-tasks-kernel_menuconfig'><filename>do_kernel_menuconfig</filename></link>).
+            Once the file of differences is created, it can be used to create
+            a config fragment that only contains the differences.
+            You can invoke this task from the command line as follows:
+            <literallayout class='monospaced'>
+     $ bitbake linux-yocto -c diffconfig
+            </literallayout>
+            For more information, see the
+            "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'>Generating Configuration Files</ulink>"
+            section in the Yocto Project Linux Kernel Development Manual.
         </para>
     </section>
 
@@ -871,7 +901,12 @@
         <title><filename>do_kernel_checkout</filename></title>
 
         <para>
-            Checks out source/meta branches for a linux-yocto style kernel.
+            Converts the newly unpacked kernel source into a form with which
+            the OpenEmbedded build system can work.
+            Because the kernel source can be fetched in several different ways,
+            the <filename>do_kernel_checkout</filename> task makes sure that
+            subsequent tasks are given a clean working tree copy of the kernel
+            with the correct branches checked out.
         </para>
     </section>
 
@@ -879,7 +914,21 @@
         <title><filename>do_kernel_configcheck</filename></title>
 
         <para>
-            Validates the kernel configuration for a linux-yocto style kernel.
+            Validates the configuration produced by the
+            <link linkend='ref-tasks-kernel_menuconfig'><filename>do_kernel_menuconfig</filename></link>
+            task.
+            The <filename>do_kernel_configcheck</filename> task produces
+            warnings when a requested configuration does not appear in the
+            final <filename>.config</filename> file or when you override a
+            policy configuration in a hardware configuration fragment.
+            You can run this task explicitly and view the output by using
+            the following command:
+            <literallayout class='monospaced'>
+     $ bitbake linux-yocto -c kernel_configcheck -f
+            </literallayout>
+            For more information, see the
+            "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'>Generating Configuration Files</ulink>"
+            section in the Yocto Project Linux Kernel Development Manual.
         </para>
     </section>
 
@@ -887,17 +936,41 @@
         <title><filename>do_kernel_configme</filename></title>
 
         <para>
-            Assembles the kernel configuration for a linux-yocto style kernel.
+            After the kernel is patched by the
+            <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>
+            task, the <filename>do_kernel_configme</filename> task assembles
+            and merges all the kernel config fragments into a merged
+            configuration that can then be passed to the kernel configuration
+            phase proper.
+            This is also the time during which user-specified defconfigs
+            are applied if present, and where configuration modes such as
+            <filename>--allnoconfig</filename> are applied.
         </para>
     </section>
 
-    <section id='ref-tasks-kernel_link_vmlinux'>
-        <title><filename>do_kernel_link_vmlinux</filename></title>
+    <section id='ref-tasks-kernel_menuconfig'>
+        <title><filename>do_kernel_menuconfig</filename></title>
 
         <para>
-            Creates a symbolic link in
-            <filename>arch/$arch/boot</filename> for vmlinux kernel
-            images.
+            Invoked by the user to manipulate the
+            <filename>.config</filename> file used to build a linux-yocto
+            recipe.
+            This task starts the Linux kernel configuration tool, which you
+            then use to modify the kernel configuration.
+            <note>
+                You can also invoke this tool from the command line as
+                follows:
+                <literallayout class='monospaced'>
+     $ bitbake linux-yocto -c menuconfig
+                </literallayout>
+            </note>
+            See the
+            "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'>Generating Configuration Files</ulink>"
+            section in the Yocto Project Linux Kernel Development Manual
+            for more information on this configuration tool.
+            You can also reference the
+            "<ulink url='&YOCTO_DOCS_DEV_URL;#using-menuconfig'>Using <filename>menuconfig</filename></ulink>"
+            section in the Yocto Project Development Manual.
         </para>
     </section>
 
@@ -905,8 +978,16 @@
         <title><filename>do_kernel_metadata</filename></title>
 
         <para>
-            Collects kernel metadata for a
-            <filename>linux-yocto</filename> style kernel.
+            Collects all the features required for a given kernel build,
+            whether the features come from
+            <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+            or from Git repositories.
+            After collection, the <filename>do_kernel_metadata</filename> task
+            processes the features into a series of config fragments and
+            patches, which can then be applied by subsequent tasks such as
+            <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>
+            and
+            <link linkend='ref-tasks-kernel_configme'><filename>do_kernel_configme</filename></link>.
         </para>
     </section>
 
@@ -925,7 +1006,17 @@
         <title><filename>do_savedefconfig</filename></title>
 
         <para>
-            Creates a minimal Linux kernel configuration file.
+            When invoked by the user, creates a defconfig file that can be
+            used instead of the default defconfig.
+            The saved defconfig contains the differences between the default
+            defconfig and the changes made by the user using other methods
+            (i.e. the
+            <link linkend='ref-tasks-kernel_menuconfig'><filename>do_kernel_menuconfig</filename></link>
+            task.
+            You can invoke the task using the following command:
+            <literallayout class='monospaced'>
+     $ bitbake linux-yocto -c savedefconfig
+            </literallayout>
         </para>
     </section>
 
@@ -933,7 +1024,14 @@
         <title><filename>do_shared_workdir</filename></title>
 
         <para>
-            Creates the shared working directory for the kernel.
+            After the kernel has been compiled but before the kernel modules
+            have been compiled, this task copies files required for module
+            builds and which are generated from the  kernel build into the
+            shared work directory.
+            With these copies successfully copied, the
+            <link linkend='ref-tasks-compile_kernelmodules'><filename>do_compile_kernelmodules</filename></link>
+            task can successfully build the kernel modules in the next step
+            of the build.
         </para>
     </section>
 
@@ -941,9 +1039,12 @@
         <title><filename>do_sizecheck</filename></title>
 
         <para>
-            Checks the size of the kernel image against
-            <link linkend='var-KERNEL_IMAGE_MAXSIZE'><filename>KERNEL_IMAGE_MAXSIZE</filename></link>
-            when set.
+            After the kernel has been built, this task checks the size of the
+            stripped kernel image against
+            <link linkend='var-KERNEL_IMAGE_MAXSIZE'><filename>KERNEL_IMAGE_MAXSIZE</filename></link>.
+            If that variable was set and the size of the stripped kernel
+            exceeds that size, the kernel build produces a warning to that
+            effect.
         </para>
     </section>
 
@@ -951,15 +1052,13 @@
         <title><filename>do_strip</filename></title>
 
         <para>
-            Strips unneeded sections out of the Linux kernel image.
-        </para>
-    </section>
-
-    <section id='ref-tasks-uboot_mkimage'>
-        <title><filename>do_uboot_mkimage</filename></title>
-
-        <para>
-            Creates a uImage file from the kernel for the U-Boot bootloader.
+            If
+            <filename>KERNEL_IMAGE_STRIP_EXTRA_SECTIONS</filename> is defined,
+            this task strips the sections named in that variable from
+            <filename>vmlinux</filename>.
+            This stripping is typically used to remove nonessential sections
+            such as <filename>.comment</filename> sections from a
+            size-sensitive configuration.
         </para>
     </section>
 
@@ -967,10 +1066,14 @@
         <title><filename>do_validate_branches</filename></title>
 
         <para>
-            Ensures that the source, metadata (or both) branches are on the
-            locations specified by their
-            <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
-            values for a linux-yocto style kernel.
+            After the kernel is unpacked but before it is patched, this task
+            makes sure that the machine and metadata branches as specified
+            by the <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
+            variables actually exist on the specified branches.
+            If these branches do not exist and
+            <link linkend='var-AUTOREV'><filename>AUTOREV</filename></link>
+            is not being used, the <filename>do_validate_branches</filename>
+            task fails during the build.
         </para>
     </section>
 </section>
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-variables.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-variables.xml
index 807e242..ad10139 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/ref-variables.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-variables.xml
@@ -37,7 +37,7 @@
        <link linkend='var-S'>S</link>
        <link linkend='var-T'>T</link>
        <link linkend='var-UBOOT_CONFIG'>U</link>
-<!--               <link linkend='var-glossary-v'>V</link> -->
+       <link linkend='var-VOLATILE_LOG_DIR'>V</link>
        <link linkend='var-WARN_QA'>W</link>
        <link linkend='var-XSERVER'>X</link>
 <!--               <link linkend='var-glossary-y'>Y</link> -->
@@ -484,6 +484,12 @@
                     in your recipe so that it does contain
                     <filename>${SRCPV}</filename>.
                 </para>
+
+                <para>
+                    For more information see the
+                    "<ulink url='&YOCTO_DOCS_DEV_URL;#automatically-incrementing-a-binary-package-revision-number'>Automatically Incrementing a Binary Package Revision Number</ulink>"
+                    section in the Yocto Project Development Manual.
+                    </para>
             </glossdef>
         </glossentry>
 
@@ -2364,6 +2370,160 @@
             </glossdef>
         </glossentry>
 
+        <glossentry id='var-COPYLEFT_LICENSE_EXCLUDE'><glossterm>COPYLEFT_LICENSE_EXCLUDE</glossterm>
+            <info>
+                COPYLEFT_LICENSE_EXCLUDE[doc] = "Licenses to exclude in the source archived by the archiver class."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    A space-separated list of licenses to exclude from the
+                    source archived by the
+                    <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+                    class.
+                    In other words, if a license in a recipe's
+                    <link linkend='var-LICENSE'><filename>LICENSE</filename></link>
+                    value is in the value of
+                    <filename>COPYLEFT_LICENSE_EXCLUDE</filename>, then its
+                    source is not archived by the class.
+                    <note>
+                        The <filename>COPYLEFT_LICENSE_EXCLUDE</filename>
+                        variable takes precedence over the
+                        <link linkend='var-COPYLEFT_LICENSE_INCLUDE'><filename>COPYLEFT_LICENSE_INCLUDE</filename></link>
+                        variable.
+                    </note>
+                    The default value, which is "CLOSED Proprietary", for
+                    <filename>COPYLEFT_LICENSE_EXCLUDE</filename> is set
+                    by the
+                    <link linkend='ref-classes-copyleft_filter'><filename>copyleft_filter</filename></link>
+                    class, which is inherited by the
+                    <filename>archiver</filename> class.
+                </para>
+            </glossdef>
+        </glossentry>
+
+        <glossentry id='var-COPYLEFT_LICENSE_INCLUDE'><glossterm>COPYLEFT_LICENSE_INCLUDE</glossterm>
+            <info>
+                COPYLEFT_LICENSE_INCLUDE[doc] = "Licenses to include in the source archived by the archiver class."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    A space-separated list of licenses to include in the
+                    source archived by the
+                    <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+                    class.
+                    In other words, if a license in a recipe's
+                    <link linkend='var-LICENSE'><filename>LICENSE</filename></link>
+                    value is in the value of
+                    <filename>COPYLEFT_LICENSE_INCLUDE</filename>, then its
+                    source is archived by the class.
+                </para>
+
+                <para>
+                    The default value is set by the
+                    <link linkend='ref-classes-copyleft_filter'><filename>copyleft_filter</filename></link>
+                    class, which is inherited by the
+                    <filename>archiver</filename> class.
+                    The default value includes "GPL*", "LGPL*", and "AGPL*".
+                </para>
+            </glossdef>
+        </glossentry>
+
+        <glossentry id='var-COPYLEFT_PN_EXCLUDE'><glossterm>COPYLEFT_PN_EXCLUDE</glossterm>
+            <info>
+                COPYLEFT_PN_EXCLUDE[doc] = "Recipes to exclude in the source archived by the archiver class."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    A list of recipes to exclude in the source archived
+                    by the
+                    <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+                    class.
+                    The <filename>COPYLEFT_PN_EXCLUDE</filename> variable
+                    overrides the license inclusion and exclusion caused
+                    through the
+                    <link linkend='var-COPYLEFT_LICENSE_INCLUDE'><filename>COPYLEFT_LICENSE_INCLUDE</filename></link>
+                    and
+                    <link linkend='var-COPYLEFT_LICENSE_EXCLUDE'><filename>COPYLEFT_LICENSE_EXCLUDE</filename></link>
+                    variables, respectively.
+                </para>
+
+                <para>
+                    The default value, which is "" indicating to not explicitly
+                    exclude any recipes by name, for
+                    <filename>COPYLEFT_PN_EXCLUDE</filename> is set
+                    by the
+                    <link linkend='ref-classes-copyleft_filter'><filename>copyleft_filter</filename></link>
+                    class, which is inherited by the
+                    <filename>archiver</filename> class.
+                </para>
+            </glossdef>
+        </glossentry>
+
+        <glossentry id='var-COPYLEFT_PN_INCLUDE'><glossterm>COPYLEFT_PN_INCLUDE</glossterm>
+            <info>
+                COPYLEFT_PN_INCLUDE[doc] = "Recipes to include in the source archived by the archiver class."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    A list of recipes to include in the source archived
+                    by the
+                    <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+                    class.
+                    The <filename>COPYLEFT_PN_INCLUDE</filename> variable
+                    overrides the license inclusion and exclusion caused
+                    through the
+                    <link linkend='var-COPYLEFT_LICENSE_INCLUDE'><filename>COPYLEFT_LICENSE_INCLUDE</filename></link>
+                    and
+                    <link linkend='var-COPYLEFT_LICENSE_EXCLUDE'><filename>COPYLEFT_LICENSE_EXCLUDE</filename></link>
+                    variables, respectively.
+                </para>
+
+                <para>
+                    The default value, which is "" indicating to not explicitly
+                    include any recipes by name, for
+                    <filename>COPYLEFT_PN_INCLUDE</filename> is set
+                    by the
+                    <link linkend='ref-classes-copyleft_filter'><filename>copyleft_filter</filename></link>
+                    class, which is inherited by the
+                    <filename>archiver</filename> class.
+                </para>
+            </glossdef>
+        </glossentry>
+
+        <glossentry id='var-COPYLEFT_RECIPE_TYPES'><glossterm>COPYLEFT_RECIPE_TYPES</glossterm>
+            <info>
+                COPYLEFT_RECIPE_TYPES[doc] = "Recipe types to include in the source archived by the archiver class."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    A space-separated list of recipe types to include
+                    in the source archived by the
+                    <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+                    class.
+                    Recipe types are <filename>target</filename>,
+                    <filename>native</filename>,
+                    <filename>nativesdk</filename>,
+                    <filename>cross</filename>,
+                    <filename>crosssdk</filename>, and
+                    <filename>cross-canadian</filename>.
+                </para>
+
+                <para>
+                    The default value, which is "target*", for
+                    <filename>COPYLEFT_RECIPE_TYPES</filename> is set
+                    by the
+                    <link linkend='ref-classes-copyleft_filter'><filename>copyleft_filter</filename></link>
+                    class, which is inherited by the
+                    <filename>archiver</filename> class.
+                </para>
+            </glossdef>
+        </glossentry>
+
         <glossentry id='var-COPY_LIC_DIRS'><glossterm>COPY_LIC_DIRS</glossterm>
             <info>
                 COPY_LIC_DIRS[doc] = "If set to "1" along with the COPY_LIC_MANIFEST variable, the OpenEmbedded build system copies into the image the license files, which are located in /usr/share/common-licenses, for each package."
@@ -3463,6 +3623,47 @@
             </glossdef>
         </glossentry>
 
+        <glossentry id='var-DISTRO_FEATURES_FILTER_NATIVE'><glossterm>DISTRO_FEATURES_FILTER_NATIVE</glossterm>
+            <info>
+                DISTRO_FEATURES_FILTER_NATIVE[doc] = "Specifies a list of features that if present in the target DISTRO_FEATURES value should be included in DISTRO_FEATURES when building native recipes."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    Specifies a list of features that if present in
+                    the target
+                    <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+                    value should be included in
+                    <filename>DISTRO_FEATURES</filename> when building native
+                    recipes.
+                    This variable is used in addition to the features
+                    filtered using the
+                    <link linkend='var-DISTRO_FEATURES_NATIVE'><filename>DISTRO_FEATURES_NATIVE</filename></link>
+                    variable.
+               </para>
+            </glossdef>
+        </glossentry>
+
+        <glossentry id='var-DISTRO_FEATURES_FILTER_NATIVESDK'><glossterm>DISTRO_FEATURES_FILTER_NATIVESDK</glossterm>
+            <info>
+                DISTRO_FEATURES_FILTER_NATIVESDK[doc] = "Specifies a list of features that if present in the target DISTRO_FEATURES value should be included in DISTRO_FEATURES when building nativesdk recipes."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    Specifies a list of features that if present in the target
+                    <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+                    value should be included in
+                    <filename>DISTRO_FEATURES</filename> when building
+                    nativesdk recipes.
+                    This variable is used in addition to the features
+                    filtered using the
+                    <link linkend='var-DISTRO_FEATURES_NATIVESDK'><filename>DISTRO_FEATURES_NATIVESDK</filename></link>
+                    variable.
+               </para>
+            </glossdef>
+        </glossentry>
+
         <glossentry id='var-DISTRO_FEATURES_LIBC'><glossterm>DISTRO_FEATURES_LIBC</glossterm>
             <info>
                 DISTRO_FEATURES_LIBC[doc] = "Specifies the list of distro features that are specific to the C library (libc)."
@@ -3480,6 +3681,42 @@
             </glossdef>
         </glossentry>
 
+        <glossentry id='var-DISTRO_FEATURES_NATIVE'><glossterm>DISTRO_FEATURES_NATIVE</glossterm>
+            <info>
+                DISTRO_FEATURES_NATIVE[doc] = "Specifies a list of features that should be included in DISTRO_FEATURES when building native recipes."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    Specifies a list of features that should be included in
+                    <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+                    when building native recipes.
+                    This variable is used in addition to the features
+                    filtered using the
+                    <link linkend='var-DISTRO_FEATURES_FILTER_NATIVE'><filename>DISTRO_FEATURES_FILTER_NATIVE</filename></link>
+                    variable.
+                </para>
+            </glossdef>
+        </glossentry>
+
+        <glossentry id='var-DISTRO_FEATURES_NATIVESDK'><glossterm>DISTRO_FEATURES_NATIVESDK</glossterm>
+            <info>
+                DISTRO_FEATURES_NATIVESDK[doc] = "Specifies a list of features that should be included in DISTRO_FEATURES when building nativesdk recipes."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    Specifies a list of features that should be included in
+                    <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+                    when building nativesdk recipes.
+                    This variable is used in addition to the features
+                    filtered using the
+                    <link linkend='var-DISTRO_FEATURES_FILTER_NATIVESDK'><filename>DISTRO_FEATURES_FILTER_NATIVESDK</filename></link>
+                    variable.
+                </para>
+            </glossdef>
+        </glossentry>
+
         <glossentry id='var-DISTRO_NAME'><glossterm>DISTRO_NAME</glossterm>
             <info>
                 DISTRO_NAME[doc] = "The long name of the distribution."
@@ -3643,7 +3880,9 @@
                 <para>
                     See the
                     <link linkend='ref-classes-systemd-boot'><filename>systemd-boot</filename></link>
-                    class for more information.
+                    and
+                    <link linkend='ref-classes-image-live'><filename>image-live</filename></link>
+                    classes for more information.
                 </para>
             </glossdef>
         </glossentry>
@@ -4954,6 +5193,53 @@
             </glossdef>
         </glossentry>
 
+        <glossentry id='var-HOSTTOOLS'><glossterm>HOSTTOOLS</glossterm>
+            <info>
+                HOSTTOOLS[doc] = "A space-separated list (filter) of tools on the build host that should be allowed to be called from within build tasks."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    A space-separated list (filter) of tools on the build host
+                    that should be allowed to be called from within build tasks.
+                    Using this filter helps reduce the possibility of host
+                    contamination.
+                    If a tool specified in the value of
+                    <filename>HOSTTOOLS</filename> is not found on the
+                    build host, the OpenEmbedded build system produces
+                    an error and the build is not started.
+                </para>
+
+                <para>
+                    For additional information, see
+                    <link linkend='var-HOSTTOOLS_NONFATAL'><filename>HOSTTOOLS_NONFATAL</filename></link>.
+                </para>
+            </glossdef>
+        </glossentry>
+
+        <glossentry id='var-HOSTTOOLS_NONFATAL'><glossterm>HOSTTOOLS_NONFATAL</glossterm>
+            <info>
+                HOSTTOOLS_NONFATAL[doc] = "A space-separated list (filter) of tools on the build host that should be allowed to be called from within build tasks."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    A space-separated list (filter) of tools on the build host
+                    that should be allowed to be called from within build tasks.
+                    Using this filter helps reduce the possibility of host
+                    contamination.
+                    Unlike
+                    <link linkend='var-HOSTTOOLS'><filename>HOSTTOOLS</filename></link>,
+                    the OpenEmbedded build system does not produce and error
+                    if a tool specified in the value of
+                    <filename>HOSTTOOLS_NONFATAL</filename> is not found on the
+                    build host.
+                    Thus, you can use <filename>HOSTTOOLS_NONFATAL</filename>
+                    to filter optional host tools.
+                </para>
+            </glossdef>
+        </glossentry>
+
         <glossentry id='var-HOST_VENDOR'><glossterm>HOST_VENDOR</glossterm>
             <info>
                 HOST_VENDOR[doc] = "The name of the vendor. Normally same as the TARGET_VENDOR."
@@ -6030,14 +6316,24 @@
 
         <glossentry id='var-INHERIT'><glossterm>INHERIT</glossterm>
             <info>
-                INHERIT[doc] = "Causes the named class to be inherited at this point during parsing. The variable is only valid in configuration files."
+                INHERIT[doc] = "Causes the named class or classes to be inherited globally."
             </info>
             <glossdef>
                 <para role="glossdeffirst">
 <!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
-                    Causes the named class to be inherited at
-                    this point during parsing.
-                    The variable is only valid in configuration files.
+                    Causes the named class or classes to be inherited globally.
+                    Anonymous functions in the class or classes
+                    are not executed for the
+                    base configuration and in each individual recipe.
+                    The OpenEmbedded build system ignores changes to
+                    <filename>INHERIT</filename> in individual recipes.
+                </para>
+
+                <para>
+                    For more information on <filename>INHERIT</filename>, see
+                    the
+                    "<ulink url="&YOCTO_DOCS_BB_URL;#inherit-configuration-directive"><filename>INHERIT</filename> Configuration Directive</ulink>"
+                    section in the Yocto Project Bitbake User Manual.
                 </para>
             </glossdef>
         </glossentry>
@@ -7145,21 +7441,30 @@
 
         <glossentry id='var-LAYERDEPENDS'><glossterm>LAYERDEPENDS</glossterm>
             <info>
-                LAYERDEPENDS[doc] = "Lists the layers, separated by spaces, upon which this recipe depends. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer."
+                LAYERDEPENDS[doc] = "Lists the layers, separated by spaces, on which this recipe depends. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer."
             </info>
             <glossdef>
                 <para role="glossdeffirst">
 <!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
-                    Lists the layers that this recipe depends upon, separated by spaces.
-                    Optionally, you can specify a specific layer version for a dependency
-                    by adding it to the end of the layer name with a colon, (e.g. "anotherlayer:3"
-                    to be compared against
-                    <link linkend='var-LAYERVERSION'><filename>LAYERVERSION</filename></link><filename>_anotherlayer</filename>
-                    in this case).
-                    An error will be produced if any dependency is missing or
-                    the version numbers do not match exactly (if specified).
-                    This variable is used in the <filename>conf/layer.conf</filename> file
-                    and must be suffixed with the name of the specific layer (e.g.
+                    Lists the layers, separated by spaces, on which this
+                    recipe depends.
+                    Optionally, you can specify a specific layer version for a
+                    dependency by adding it to the end of the layer name.
+                    Here is an example:
+                    <literallayout class='monospaced'>
+     LAYERDEPENDS_mylayer = "anotherlayer (=3)"
+                    </literallayout>
+                    In this previous example, version 3 of "anotherlayer"
+                    is compared against
+                    <link linkend='var-LAYERVERSION'><filename>LAYERVERSION</filename></link><filename>_anotherlayer</filename>.
+                </para>
+
+                <para>
+                    An error is produced if any dependency is missing or
+                    the version numbers (if specified) do not match exactly.
+                    This variable is used in the
+                    <filename>conf/layer.conf</filename> file and must be
+                    suffixed with the name of the specific layer (e.g.
                     <filename>LAYERDEPENDS_mylayer</filename>).
                 </para>
             </glossdef>
@@ -7180,6 +7485,39 @@
             </glossdef>
         </glossentry>
 
+        <glossentry id='var-LAYERRECOMMENDS'><glossterm>LAYERRECOMMENDS</glossterm>
+            <info>
+                LAYERRECOMMENDS[doc] = "Lists the layers, separated by spaces, recommended for use with this layer."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    Lists the layers, separated by spaces, recommended for
+                    use with this layer.
+                </para>
+
+                <para>
+                    Optionally, you can specify a specific layer version for a
+                    recommendation by adding the version to the end of the
+                    layer name.
+                    Here is an example:
+                    <literallayout class='monospaced'>
+     LAYERRECOMMENDS_mylayer = "anotherlayer (=3)"
+                    </literallayout>
+                    In this previous example, version 3 of "anotherlayer" is
+                    compared against
+                    <filename>LAYERVERSION_anotherlayer</filename>.
+                </para>
+
+                <para>
+                    This variable is used in the
+                    <filename>conf/layer.conf</filename> file and must be
+                    suffixed with the name of the specific layer (e.g.
+                    <filename>LAYERRECOMMENDS_mylayer</filename>).
+                </para>
+            </glossdef>
+        </glossentry>
+
         <glossentry id='var-LAYERVERSION'><glossterm>LAYERVERSION</glossterm>
             <info>
                 LAYERVERSION[doc] = "Optionally specifies the version of a layer as a single number. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer."
@@ -8198,13 +8536,16 @@
             </glossdef>
         </glossentry>
 
+<!--
         <glossentry id='var-MULTIMACH_HOST_SYS'><glossterm>MULTIMACH_HOST_SYS</glossterm>
             <info>
                 MULTIMACH_HOST_SYS[doc] = "Separates files for different machines such that you can build for multiple host machines using the same output directories."
             </info>
             <glossdef>
                 <para role="glossdeffirst">
+-->
 <!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+<!--
                     Serves the same purpose as
                     <link linkend='var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></link>,
                     but for the "HOST" system, in situations that involve a
@@ -8222,6 +8563,7 @@
                 </para>
             </glossdef>
         </glossentry>
+-->
 
         <glossentry id='var-MULTIMACH_TARGET_SYS'><glossterm>MULTIMACH_TARGET_SYS</glossterm>
             <info>
@@ -8251,9 +8593,6 @@
                     See the
                     <link linkend='var-STAMP'><filename>STAMP</filename></link>
                     variable for an example.
-                    <link linkend='var-MULTIMACH_HOST_SYS'><filename>MULTIMACH_HOST_SYS</filename></link>
-                    is the corresponding variable for the host system in
-                    situations that involve a "HOST" and a "TARGET" system.
                     See the
                     <link linkend='var-STAGING_DIR_TARGET'><filename>STAGING_DIR_TARGET</filename></link>
                     variable for more information.
@@ -8332,7 +8671,7 @@
                     <filename>local.conf</filename> file or you can attach it to
                     a specific image recipe by using the recipe name override:
                     <literallayout class='monospaced'>
-     NO_RECOMMENDATIONS_pn-<replaceable>target_image</replaceable> = "<replaceable>package_name</replaceable>"
+     NO_RECOMMENDATIONS_pn-<replaceable>target_image</replaceable> = "1"
                     </literallayout>
                 </para>
 
@@ -9163,6 +9502,31 @@
             </glossdef>
         </glossentry>
 
+        <glossentry id='var-PACKAGE_WRITE_DEPS'><glossterm>PACKAGE_WRITE_DEPS</glossterm>
+            <info>
+                PACKAGE_WRITE_DEPS[doc] = "Specifies post-installation and pre-installation script dependencies on native/cross tools."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    Specifies a list of dependencies for post-installation and
+                    pre-installation scripts on native/cross tools.
+                    If your post-installation or pre-installation script can
+                    execute at rootfs creation time rather than on the
+                    target but depends on a native tool in order to execute,
+                    you need to list the tools in
+                    <filename>PACKAGE_WRITE_DEPENDS</filename>.
+                </para>
+
+                <para>
+                    For information on running post-installation scripts, see
+                    the
+                    "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-post-installation-scripts'>Post-Installation Scripts</ulink>"
+                    section in the Yocto Project Development Manual.
+                </para>
+            </glossdef>
+        </glossentry>
+
         <glossentry id='var-PACKAGECONFIG'><glossterm>PACKAGECONFIG</glossterm>
             <info>
                 PACKAGECONFIG[doc] = "This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis."
@@ -9299,29 +9663,22 @@
                     from the
                     <link linkend='var-PACKAGECONFIG'><filename>PACKAGECONFIG</filename></link>
                     setting.
-                    This list of options helps other classes and
-                    recipes take advantage of the
-                    <filename>PACKAGECONFIG</filename> mechanism without
-                    having to include options from
-                    <link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link>.
                 </para>
 
                 <para>
-                    To illustrate how to use
-                    <filename>PACKAGECONFIG_CONFARGS</filename>, consider the
-                    following example:
-                    <literallayout class='monospaced'>
-     PACKAGECONFIG_CONFARGS = " \
-          -prefix ${prefix} \
-          -sysroot ${STAGING_DIR_NATIVE} \
-          -no-gcc-sysroot
-          "
-                    </literallayout>
-                    In the previous example,
-                    <filename>PACKAGECONFIG_CONFARGS</filename> is set with
-                    three configuration options that can be passed using the
-                    <filename>PACKAGECONFIG</filename> mechanism, thus
-                    avoiding having to use <filename>EXTRA_OECONF</filename>.
+                    Classes such as
+                    <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+                    and
+                    <link linkend='ref-classes-cmake'><filename>cmake</filename></link>
+                    use <filename>PACKAGECONFIG_CONFARGS</filename> to pass
+                    <link linkend='var-PACKAGECONFIG'><filename>PACKAGECONFIG</filename></link>
+                    options to <filename>configure</filename> and
+                    <filename>cmake</filename>, respectively.
+                    If you are using
+                    <filename>PACKAGECONFIG</filename> but not a class that
+                    handles the <filename>do_configure</filename> task, then
+                    you need to use
+                    <filename>PACKAGECONFIG_CONFARGS</filename> appropriately.
                 </para>
 
                 <para>
@@ -12499,15 +12856,17 @@
                     every time BitBake parses your recipe, you should specify
                     a <filename>SRCREV</filename> that is a
                     full revision identifier and not just a tag.
+                    <note>
+                        For information on limitations when inheriting the
+                        latest revision of software using
+                        <filename>SRCREV</filename>, see the
+                        <link linkend='var-AUTOREV'><filename>AUTOREV</filename></link>
+                        variable description and the
+                        "<ulink url='&YOCTO_DOCS_DEV_URL;#automatically-incrementing-a-binary-package-revision-number'>Automatically Incrementing a Binary Package Revision Number</ulink>"
+                        section, which is in the Yocto Project Development Manual.
+                    </note>
                 </para>
 
-                <note>
-                    For information on limitations when inheriting the latest
-                    revision of software using <filename>SRCREV</filename>,
-                    see the
-                    <link linkend='var-AUTOREV'><filename>AUTOREV</filename></link>
-                    variable description.
-                </note>
             </glossdef>
         </glossentry>
 
@@ -12588,6 +12947,41 @@
             </glossdef>
         </glossentry>
 
+        <glossentry id='var-SSTATE_SCAN_FILES'><glossterm>SSTATE_SCAN_FILES</glossterm>
+            <info>
+                SSTATE_SCAN_FILES[doc] = "Controls the list of files the OpenEmbedded build system scans for hardcoded installation paths."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    Controls the list of files the OpenEmbedded build system
+                    scans for hardcoded installation paths. The variable uses a
+                    space-separated list of filenames (not paths) with standard
+                    wildcard characters allowed.
+                </para>
+
+                <para>
+                    During a build, the OpenEmbedded build system creates a
+                    shared state (sstate) object during the first stage of
+                    preparing the sysroots. That object is scanned for
+                    hardcoded paths for original installation locations.
+                    The list of files that are scanned for paths is controlled
+                    by the <filename>SSTATE_SCAN_FILES</filename> variable.
+                    Typically, recipes add files they want to be scanned to the
+                    value of <filename>SSTATE_SCAN_FILES</filename> rather than
+                    the variable being comprehensively set. The
+                    <link linkend='ref-classes-sstate'><filename>sstate</filename></link>
+                    class specifies the default list of files.
+                </para>
+
+                <para>
+                    For details on the process, see the
+                    <link linkend='ref-classes-staging'><filename>staging</filename></link>
+                    class.
+                </para>
+            </glossdef>
+        </glossentry>
+
         <glossentry id='var-STAGING_BASE_LIBDIR_NATIVE'><glossterm>STAGING_BASE_LIBDIR_NATIVE</glossterm>
             <info>
                 STAGING_BASE_LIBDIR_NATIVE[doc] = "Specifies the path to the /lib subdirectory of the sysroot directory for the build host."
@@ -12801,12 +13195,7 @@
                                 they make use of host headers and libraries.
                                 </para>
                                 </note>
-                           </para></listitem>
-                        <listitem><para>For native SDK
-                           recipes that build for the SDK
-                           (<filename>nativesdk</filename>), the value is
-                           "${STAGING_DIR}/${<link linkend='var-MULTIMACH_HOST_SYS'>MULTIMACH_HOST_SYS</link>}".
-                           </para></listitem>
+                            </para></listitem>
                     </itemizedlist>
                 </para>
             </glossdef>
@@ -13185,6 +13574,28 @@
             </glossdef>
         </glossentry>
 
+        <glossentry id='var-SYSROOT_DESTDIR'><glossterm>SYSROOT_DESTDIR</glossterm>
+            <info>
+                SYSROOT_DESTDIR[doc] = "Points to the temporary work directory (default ${WORKDIR}/sysroot-destdir) where the files that will be populated into the sysroot are assembled during the do_populate_sysroot task."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    Points to the temporary directory under the work directory
+                    (default
+                    <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}/sysroot-destidir</filename>)
+                    where the files
+                    that will be populated into the sysroot are assembled
+                    during the
+                    <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+                    task.
+                    <literallayout class='monospaced'>
+     SYSROOT_DESTDIR ?= "console=ttyS0,115200"
+                    </literallayout>
+                </para>
+            </glossdef>
+        </glossentry>
+
         <glossentry id='var-SYSROOT_DIRS'><glossterm>SYSROOT_DIRS</glossterm>
             <info>
                 SYSROOT_DIRS[doc] = "Directories that are staged into the sysroot by the do_populate_sysroot task."
@@ -14197,8 +14608,9 @@
                     <note>
                         The <filename>TEST_SERVER_IP</filename> variable
                         is only used for a small number of tests such as
-                        the "smart" test suite, which needs to download
-                        packages from <filename>DEPLOY_DIR/rpm</filename>.
+                        the "dnf" test suite, which needs to download
+                        packages from
+                        <filename>WORKDIR/oe-rootfs-repo</filename>.
                     </note>
                 </para>
             </glossdef>
@@ -15544,8 +15956,30 @@
 
     </glossdiv>
 
-<!--            <glossdiv id='var-glossary-v'><title>V</title>-->
-<!--            </glossdiv>-->
+    <glossdiv id='var-glossary-v'><title>V</title>
+
+        <glossentry id='var-VOLATILE_LOG_DIR'><glossterm>VOLATILE_LOG_DIR</glossterm>
+            <info>
+               VOLATILE_LOG_DIR[doc] = "Specifies the persistence of the target's /var/log directory, which is used to house postinstall target log files."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    Specifies the persistence of the target's
+                    <filename>/var/log</filename> directory, which is used to
+                    house postinstall target log files.
+                </para>
+
+                <para>
+                    By default, <filename>VOLATILE_LOG_DIR</filename> is set
+                    to "yes", which means the file is not persistent.
+                    You can override this setting by setting the
+                    variable to "no" to make the log directory persistent.
+                </para>
+            </glossdef>
+        </glossentry>
+
+    </glossdiv>
 
     <glossdiv id='var-glossary-w'><title>W</title>
 
@@ -15568,6 +16002,50 @@
             </glossdef>
         </glossentry>
 
+        <glossentry id='var-WKS_FILE_DEPENDS'><glossterm>WKS_FILE_DEPENDS</glossterm>
+            <info>
+               WKS_FILE_DEPENDS[doc] = "Lists a recipe's build-time dependencies specific to Wic."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+                    When placed in the recipe that builds your image, this
+                    variable lists build-time dependencies.
+                    The <filename>WKS_FILE_DEPENDS</filename> variable is only
+                    applicable when Wic images are active (i.e. when
+                    <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+                    contains entries related to Wic).
+                    If your recipe does not create Wic images, the variable
+                    has no effect.
+                </para>
+
+                <para>
+                    The <filename>WKS_FILE_DEPENDS</filename> variable is
+                    similar to the
+                    <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+                    variable.
+                    When you use the variable in your recipe that builds the
+                    Wic image, dependencies you list in the
+                    <filename>WIC_FILE_DEPENDS</filename> variable are added to
+                    the <filename>DEPENDS</filename> variable.
+                </para>
+
+                <para>
+                    With the <filename>WKS_FILE_DEPENDS</filename> variable,
+                    you have the possibility to specify a list of additional
+                    dependencies (e.g. native tools, bootloaders, and so forth),
+                    that are required to build Wic images.
+                    Following is an example:
+                    <literallayout class='monospaced'>
+     WKS_FILE_DEPENDS = "<replaceable>some-native-tool</replaceable>"
+                    </literallayout>
+                    In the previous example,
+                    <replaceable>some-native-tool</replaceable> would be
+                    replaced with an actual native tool on which the build
+                    would depend.
+                </para>
+            </glossdef>
+        </glossentry>
+
         <glossentry id='var-WKS_FILE'><glossterm>WKS_FILE</glossterm>
             <info>
                WKS_FILE[doc] = "Specifies the name of the wic kickstart file."
diff --git a/import-layers/yocto-poky/documentation/ref-manual/technical-details.xml b/import-layers/yocto-poky/documentation/ref-manual/technical-details.xml
index 9bb09fb..1964a9a 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/technical-details.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/technical-details.xml
@@ -432,7 +432,7 @@
         For information on how the OpenEmbedded build system
         works with packages and can
         track incrementing <filename>PR</filename> information, see the
-        "<ulink url='&YOCTO_DOCS_DEV_URL;#incrementing-a-package-revision-number'>Incrementing a Package Revision Number</ulink>"
+        "<ulink url='&YOCTO_DOCS_DEV_URL;#automatically-incrementing-a-binary-package-revision-number'>Automatically Incrementing a Binary Package Revision Number</ulink>"
         section.
     </note>
 
@@ -1445,14 +1445,33 @@
 
             <para>
                 The <filename>LIC_FILES_CHKSUM</filename>
-                variable contains checksums of the license text in the source code for the recipe.
-                Following is an example of how to specify <filename>LIC_FILES_CHKSUM</filename>:
+                variable contains checksums of the license text in the source
+                code for the recipe.
+                Following is an example of how to specify
+                <filename>LIC_FILES_CHKSUM</filename>:
                 <literallayout class='monospaced'>
      LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx \
                          file://licfile1.txt;beginline=5;endline=29;md5=yyyy \
                          file://licfile2.txt;endline=50;md5=zzzz \
                          ..."
                 </literallayout>
+                <note><title>Notes</title>
+                    <itemizedlist>
+                        <listitem><para>
+                            When using "beginline" and "endline", realize that
+                            line numbering begins with one and not zero.
+                            Also, the included lines are inclusive (i.e. lines
+                            five through and including 29 in the previous
+                            example for <filename>licfile1.txt</filename>).
+                            </para></listitem>
+                        <listitem><para>
+                            When a license check fails, the selected license
+                            text is included as part of the QA message.
+                            Using this output, you can determine the exact
+                            start and finish for the needed license text.
+                            </para></listitem>
+                    </itemizedlist>
+                </note>
             </para>
 
             <para>
@@ -1474,7 +1493,8 @@
 
             <para>
                 The first line locates a file in
-                <filename>${S}/src/ls.c</filename>.
+                <filename>${S}/src/ls.c</filename> and isolates lines five
+                through 16 as license text.
                 The second line refers to a file in
                 <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>.
             </para>
diff --git a/import-layers/yocto-poky/documentation/ref-manual/usingpoky.xml b/import-layers/yocto-poky/documentation/ref-manual/usingpoky.xml
index f734554..d080316 100644
--- a/import-layers/yocto-poky/documentation/ref-manual/usingpoky.xml
+++ b/import-layers/yocto-poky/documentation/ref-manual/usingpoky.xml
@@ -69,6 +69,39 @@
             <literallayout class='monospaced'>
      $ bitbake <replaceable>target</replaceable>
             </literallayout>
+            <note>
+                <para>
+                    If you experience a build error due to resources
+                    temporarily being unavailable and it appears you
+                    should not be having this issue, it might be due
+                    to the combination of a 4.3+ Linux kernel and
+                    <filename>systemd</filename> version 228+
+                    (i.e. see this
+                    <ulink url='http://unix.stackexchange.com/questions/253903/creating-threads-fails-with-resource-temporarily-unavailable-with-4-3-kernel'>link</ulink>
+                    for information).
+                </para>
+
+                <para>
+                    To work around this issue, you can try either
+                    of the following:
+                    <itemizedlist>
+                        <listitem><para>
+                            Try the build again.
+                            </para></listitem>
+                        <listitem><para>
+                            Modify the "DefaultTasksMax"
+                            <filename>systemd</filename> parameter
+                            by uncommenting it and setting it to
+                            "infinity".
+                            You can find this parameter in the
+                            <filename>system.conf</filename> file
+                            located in
+                            <filename>/etc/systemd</filename>
+                            on most systems.
+                            </para></listitem>
+                    </itemizedlist>
+                </para>
+            </note>
         </para>
 
         <para>
@@ -392,14 +425,6 @@
                     are not listed.
                     </para></listitem>
                 <listitem><para>
-                    <filename>pn-depends.dot</filename>: A graph showing
-                    dependencies between build-time targets (recipes).
-                    </para></listitem>
-                <listitem><para>
-                    <filename>package-depends.dot</filename>: A graph showing
-                    known dependencies between runtime targets.
-                    </para></listitem>
-                <listitem><para>
                     <filename>task-depends.dot</filename>: A graph showing
                     dependencies between tasks.
                     </para></listitem>
@@ -455,7 +480,7 @@
             You can use a different method to view dependency information
             by using the following command:
             <literallayout class='monospaced'>
-     $ bitbake -g -u depexp <replaceable>recipename</replaceable>
+     $ bitbake -g -u taskexp <replaceable>recipename</replaceable>
             </literallayout>
             This command displays a GUI window from which you can view
             build-time and runtime dependencies for the recipes involved in
@@ -711,79 +736,6 @@
         </para>
     </section>
 
-    <section id='checking-for-missing-build-time-dependencies'>
-        <title>Checking for Missing Build-Time Dependencies</title>
-
-        <para>
-            A recipe might build successfully even though some of its
-            build-time dependencies are missing from
-            <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>.
-            Following are the two most common ways in which that can happen:
-            <itemizedlist>
-                <listitem><para>
-                    The build-time dependency just happens to already exist in
-                    the staging sysroot
-                    (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>)
-                    by the time the recipe is built.
-                    This situation occurs when the build-time dependency is
-                    built earlier during recipe processing.
-                    </para></listitem>
-                <listitem><para>
-                    The component built by the recipe conditionally enables
-                    functionality depending on whether it can find the
-                    build-time dependency in the staging sysroot.
-                    If the build-time dependency is missing, the corresponding
-                    functionality is disabled.
-                    This condition is known as a "floating dependency".
-                    </para></listitem>
-            </itemizedlist>
-        </para>
-
-        <para>
-            Because dealing with the second case is more complex, focus will
-            be on the first case.
-            The
-            <link linkend='ref-classes-insane'><filename>build-deps</filename></link>
-            QA check checks that every library the component linked against is
-            declared as a build-time dependency.
-            If that is not the case, then the first situation described in the
-            previous list exists, and <filename>build-deps</filename> reports
-            a missing build-time dependency.
-        </para>
-
-        <para>
-            Another, more manual, way to check a recipe for missing build-time
-            dependencies of the first type is to build with an empty staging
-            sysroot.
-            This method can also find missing build-time dependencies
-            that are not in the form of libraries, which the
-            <filename>build-deps</filename> QA check is unable to find.
-        </para>
-
-        <para>
-            An easy way to empty the staging sysroots is to simply remove
-            <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>,
-            which is usually
-            <filename>${</filename><link linkend='var-BUILDDIR'><filename>BUILDDIR</filename></link><filename>}/tmp</filename>,
-            as it includes the staging sysroots.
-            Another, faster method to empty the staging sysroots is to use the
-            <filename>scripts/wipe-sysroot</filename> script,
-            which removes just the staging sysroots and keeps everything else
-            in <filename>TMPDIR</filename>.
-            <note>
-                The <filename>scripts/</filename> directory appears in
-                <filename>PATH</filename> after running the build environment
-                initialization script (i.e.
-                <link linkend='structure-core-script'><filename>oe-init-build-env</filename></link>
-                or
-                <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>),
-                which results in the ability to to run
-                <filename>wipe-sysroot</filename> immediately.
-            </note>
-        </para>
-
-    </section>
-
     <section id='usingpoky-debugging-bitbake'>
         <title>General BitBake Problems</title>
 
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-mars.xml b/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-mars.xml
index 521f682..9957057 100644
--- a/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-mars.xml
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-mars.xml
@@ -2,7 +2,7 @@
 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
 [<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
 
-<appendix id='sdk-appendix-mars'>
+<appendix id='sdk-appendix-latest-yp-eclipse-plug-in'>
     <title>Using Eclipse Mars</title>
 
     <para>
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-obtain.xml b/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-obtain.xml
index 3156f77..d0cbf9c 100644
--- a/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-obtain.xml
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-obtain.xml
@@ -96,16 +96,16 @@
                 <listitem><para>
                     By default, this toolchain does not build static binaries.
                     If you want to use the toolchain to build these types of
-                    libraries, you need to be sure your image has the
+                    libraries, you need to be sure your SDK has the
                     appropriate static development libraries.
                     Use the
-                    <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>
+                    <ulink url='&YOCTO_DOCS_REF_URL;#var-TOOLCHAIN_TARGET_TASK'><filename>TOOLCHAIN_TARGET_TASK</filename></ulink>
                     variable inside your <filename>local.conf</filename> file
-                    to install the appropriate library packages.
-                    Following is an example using <filename>glibc</filename>
+                    to install the appropriate library packages in the SDK.
+                    Following is an example using <filename>libc</filename>
                     static development libraries:
                     <literallayout class='monospaced'>
-     IMAGE_INSTALL_append = " glibc-staticdev"
+     TOOLCHAIN_TARGET_TASK_append = " libc-staticdev"
                     </literallayout>
                     </para></listitem>
                 <listitem><para>
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual.xml b/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual.xml
index c322189..5c28e34 100644
--- a/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual.xml
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual.xml
@@ -42,14 +42,29 @@
                 <revremark>Released with the Yocto Project 2.2 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.1</revnumber>
-                <date>January 2017</date>
-                <revremark>Released with the Yocto Project 2.2.1 Release.</revremark>
+                <revnumber>2.3</revnumber>
+                <date>May 2017</date>
+                <revremark>Released with the Yocto Project 2.3 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.2</revnumber>
+                <revnumber>2.3.1</revnumber>
                 <date>June 2017</date>
-                <revremark>Released with the Yocto Project 2.2.2 Release.</revremark>
+                <revremark>Released with the Yocto Project 2.3.1 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.2</revnumber>
+                <date>September 2017</date>
+                <revremark>Released with the Yocto Project 2.3.2 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.3</revnumber>
+                <date>January 2018</date>
+                <revremark>Released with the Yocto Project 2.3.3 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.4</revnumber>
+                <date>April 2018</date>
+                <revremark>Released with the Yocto Project 2.3.4 Release.</revremark>
             </revision>
        </revhistory>
 
@@ -63,12 +78,33 @@
         Permission is granted to copy, distribute and/or modify this document under
         the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
       </para>
-      <note>
-          For the latest version of this manual associated with this
-          Yocto Project release, see the
-          <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>
-          from the Yocto Project website.
-      </note>
+           <note><title>Manual Notes</title>
+               <itemizedlist>
+                   <listitem><para>
+                       For the latest version of the Yocto Project Software
+                       Development Kit (SDK) Developer's Guide associated with
+                       this Yocto Project release (version &YOCTO_DOC_VERSION;),
+                       see the Yocto Project Software Development Kit (SDK)
+                       Developer's Guide from the
+                       <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+                       </para></listitem>
+                   <listitem><para>
+                       This version of the manual is version
+                       &YOCTO_DOC_VERSION;.
+                       For later releases of the Yocto Project (if they exist),
+                       go to the
+                       <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+                       and use the drop-down "Active Releases" button
+                       and choose the Yocto Project version for which you want
+                       the manual.
+                       </para></listitem>
+                   <listitem><para>
+                       For an in-development version of the Yocto Project
+                       Software Development Kit (SDK) Developer's Guide, see
+                       <ulink url='&YOCTO_DOCS_URL;/latest/sdk-manual/sdk-manual.html'></ulink>.
+                       </para></listitem>
+               </itemizedlist>
+           </note>
 
     </legalnotice>
 
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/sdk-working-projects.xml b/import-layers/yocto-poky/documentation/sdk-manual/sdk-working-projects.xml
index df24aef..54bc4d7 100644
--- a/import-layers/yocto-poky/documentation/sdk-manual/sdk-working-projects.xml
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-working-projects.xml
@@ -459,7 +459,7 @@
                     release with the Yocto Project.
                     For information on how to use the Mars version of Eclipse
                     with the Yocto Project, see
-                    "<link linkend='sdk-appendix-mars'>Appendix C</link>.
+                    "<link linkend='sdk-appendix-latest-yp-eclipse-plug-in'>Appendix C</link>.
                 </note>
             </para>
 
@@ -501,7 +501,7 @@
                             <listitem><para>
                                 <emphasis>Locate the Neon Download:</emphasis>
                                 Open a browser and go to
-                                <ulink url='http://www.eclipse.org/mars/'>http://www.eclipse.org/neon/</ulink>.
+                                <ulink url='http://www.eclipse.org/neon/'>http://www.eclipse.org/neon/</ulink>.
                                 </para></listitem>
                             <listitem><para>
                                 <emphasis>Download the Tarball:</emphasis>
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual.xml b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual.xml
index 05efb1f..c7a7fcd 100644
--- a/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual.xml
+++ b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual.xml
@@ -52,14 +52,29 @@
                 <revremark>Released with the Yocto Project 2.2 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.1</revnumber>
-                <date>January 2017</date>
-                <revremark>Released with the Yocto Project 2.2.1 Release.</revremark>
+                <revnumber>2.3</revnumber>
+                <date>May 2017</date>
+                <revremark>Released with the Yocto Project 2.3 Release.</revremark>
             </revision>
             <revision>
-                <revnumber>2.2.2</revnumber>
+                <revnumber>2.3.1</revnumber>
                 <date>June 2017</date>
-                <revremark>Released with the Yocto Project 2.2.2 Release.</revremark>
+                <revremark>Released with the Yocto Project 2.3.1 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.2</revnumber>
+                <date>September 2017</date>
+                <revremark>Released with the Yocto Project 2.3.2 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.3</revnumber>
+                <date>January 2018</date>
+                <revremark>Released with the Yocto Project 2.3.3 Release.</revremark>
+            </revision>
+            <revision>
+                <revnumber>2.3.4</revnumber>
+                <date>April 2018</date>
+                <revremark>Released with the Yocto Project 2.3.4 Release.</revremark>
             </revision>
        </revhistory>
 
@@ -73,12 +88,32 @@
         Permission is granted to copy, distribute and/or modify this document under
         the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
       </para>
-      <note>
-          For the latest version of this manual associated with this
-          Yocto Project release, see the
-          <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>
-          from the Yocto Project website.
-      </note>
+           <note><title>Manual Notes</title>
+               <itemizedlist>
+                   <listitem><para>
+                       For the latest version of the Yocto Project Toaster
+                       User Manual associated with this Yocto Project release
+                       (version &YOCTO_DOC_VERSION;),
+                       see the Yocto Project Toaster User Manual from the
+                       <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+                       </para></listitem>
+                   <listitem><para>
+                       This version of the manual is version
+                       &YOCTO_DOC_VERSION;.
+                       For later releases of the Yocto Project (if they exist),
+                       go to the
+                       <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+                       and use the drop-down "Active Releases" button
+                       and choose the Yocto Project version for which you want
+                       the manual.
+                       </para></listitem>
+                   <listitem><para>
+                       For an in-development version of the Yocto Project
+                       Toaster User Manual, see
+                       <ulink url='&YOCTO_DOCS_URL;/latest/toaster-manual/toaster-manual.html'></ulink>.
+                       </para></listitem>
+               </itemizedlist>
+           </note>
 
     </legalnotice>
 
diff --git a/import-layers/yocto-poky/documentation/tools/mega-manual.sed b/import-layers/yocto-poky/documentation/tools/mega-manual.sed
index 8aea1ce..936b109 100644
--- a/import-layers/yocto-poky/documentation/tools/mega-manual.sed
+++ b/import-layers/yocto-poky/documentation/tools/mega-manual.sed
@@ -2,32 +2,32 @@
 # This style is for manual folders like "yocto-project-qs" and "poky-ref-manual".
 # This is the old way that did it.  Can't do that now that we have "bitbake-user-manual" strings
 # in the mega-manual.
-# s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/[a-z]*-[a-z]*-[a-z]*\/[a-z]*-[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
-s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/yocto-project-qs\/yocto-project-qs.html#/\"link\" href=\"#/g
-s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/poky-ref-manual\/poky-ref-manual.html#/\"link\" href=\"#/g
+# s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/[a-z]*-[a-z]*-[a-z]*\/[a-z]*-[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/yocto-project-qs\/yocto-project-qs.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/poky-ref-manual\/poky-ref-manual.html#/\"link\" href=\"#/g
 
 # Processes all other manuals (<word>-<word> style) except for the BitBake User Manual because
 # it is not included in the mega-manual.
 # This style is for manual folders that use two word, which is the standard now (e.g. "ref-manual").
 # This was the one-liner that worked before we introduced the BitBake User Manual, which is
 # not in the mega-manual.
-# s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/[a-z]*-[a-z]*\/[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
+# s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/[a-z]*-[a-z]*\/[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
 
-s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/sdk-manual\/sdk-manual.html#/\"link\" href=\"#/g
-s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/bsp-guide\/bsp-guide.html#/\"link\" href=\"#/g
-s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/dev-manual\/dev-manual.html#/\"link\" href=\"#/g
-s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/kernel-dev\/kernel-dev.html#/\"link\" href=\"#/g
-s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/profile-manual\/profile-manual.html#/\"link\" href=\"#/g
-s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/ref-manual\/ref-manual.html#/\"link\" href=\"#/g
-s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/toaster-manual\/toaster-manual.html#/\"link\" href=\"#/g
-s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/yocto-project-qs\/yocto-project-qs.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/sdk-manual\/sdk-manual.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/bsp-guide\/bsp-guide.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/dev-manual\/dev-manual.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/kernel-dev\/kernel-dev.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/profile-manual\/profile-manual.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/ref-manual\/ref-manual.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/toaster-manual\/toaster-manual.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/yocto-project-qs\/yocto-project-qs.html#/\"link\" href=\"#/g
 
 # Process cases where just an external manual is referenced without an id anchor
-s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/yocto-project-qs\/yocto-project-qs.html\" target=\"_top\">Yocto Project Quick Start<\/a>/Yocto Project Quick Start/g
-s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/dev-manual\/dev-manual.html\" target=\"_top\">Yocto Project Development Manual<\/a>/Yocto Project Development Manual/g
-s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/sdk-manual\/sdk-manual.html\" target=\"_top\">Yocto Project Software Development Kit (SDK) Developer's Guide<\/a>/Yocto Project Software Development Kit (SDK) Developer's Guide/g
-s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/bsp-guide\/bsp-guide.html\" target=\"_top\">Yocto Project Board Support Package (BSP) Developer's Guide<\/a>/Yocto Project Board Support Package (BSP) Developer's Guide/g
-s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/profile-manual\/profile-manual.html\" target=\"_top\">Yocto Project Profiling and Tracing Manual<\/a>/Yocto Project Profiling and Tracing Manual/g
-s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/kernel-dev\/kernel-dev.html\" target=\"_top\">Yocto Project Linux Kernel Development Manual<\/a>/Yocto Project Linux Kernel Development Manual/g
-s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/ref-manual\/ref-manual.html\" target=\"_top\">Yocto Project Reference Manual<\/a>/Yocto Project Reference Manual/g
-s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.2.2\/toaster-manual\/toaster-manual.html\" target=\"_top\">Toaster User Manual<\/a>/Toaster User Manual/g
+s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/yocto-project-qs\/yocto-project-qs.html\" target=\"_top\">Yocto Project Quick Start<\/a>/Yocto Project Quick Start/g
+s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/dev-manual\/dev-manual.html\" target=\"_top\">Yocto Project Development Manual<\/a>/Yocto Project Development Manual/g
+s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/sdk-manual\/sdk-manual.html\" target=\"_top\">Yocto Project Software Development Kit (SDK) Developer's Guide<\/a>/Yocto Project Software Development Kit (SDK) Developer's Guide/g
+s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/bsp-guide\/bsp-guide.html\" target=\"_top\">Yocto Project Board Support Package (BSP) Developer's Guide<\/a>/Yocto Project Board Support Package (BSP) Developer's Guide/g
+s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/profile-manual\/profile-manual.html\" target=\"_top\">Yocto Project Profiling and Tracing Manual<\/a>/Yocto Project Profiling and Tracing Manual/g
+s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/kernel-dev\/kernel-dev.html\" target=\"_top\">Yocto Project Linux Kernel Development Manual<\/a>/Yocto Project Linux Kernel Development Manual/g
+s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/ref-manual\/ref-manual.html\" target=\"_top\">Yocto Project Reference Manual<\/a>/Yocto Project Reference Manual/g
+s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.3.4\/toaster-manual\/toaster-manual.html\" target=\"_top\">Toaster User Manual<\/a>/Toaster User Manual/g
diff --git a/import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-environment.png b/import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-environment.png
index 82b7a55..3596903 100644
--- a/import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-environment.png
+++ b/import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-environment.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs.xml b/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs.xml
index 950a4ff..b4b3f4b 100644
--- a/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs.xml
+++ b/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs.xml
@@ -16,11 +16,31 @@
                 Permission is granted to copy, distribute and/or modify this document under
                 the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
             </para>
-            <note>
-                For the latest version of this manual associated with this
-                Yocto Project release, see the
-                <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>
-                from the Yocto Project website.
+            <note><title>Manual Notes</title>
+                <itemizedlist>
+                    <listitem><para>
+                        For the latest version of the Yocto Project Quick
+                        Start associated with this Yocto Project release
+                        (version &YOCTO_DOC_VERSION;),
+                        see the Yocto Project Quick Start from the
+                        <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
+                        </para></listitem>
+                    <listitem><para>
+                        This version of the manual is version
+                        &YOCTO_DOC_VERSION;.
+                        For later releases of the Yocto Project (if they exist),
+                        go to the
+                        <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+                        and use the drop-down "Active Releases" button
+                        and choose the Yocto Project version for which you want
+                        the manual.
+                        </para></listitem>
+                    <listitem><para>
+                        For an in-development version of the Yocto Project
+                        Quick Start, see
+                        <ulink url='&YOCTO_DOCS_URL;/latest/yocto-project-qs/yocto-project-qs.html'></ulink>.
+                        </para></listitem>
+                </itemizedlist>
             </note>
         </legalnotice>
 
@@ -44,7 +64,8 @@
             tool, to construct complete Linux images.
             The BitBake and OE components are combined together to form
             a reference build host, historically known as
-            <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>.
+            <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>
+            (<emphasis>Pah</emphasis>-key).
         </para>
 
         <para>
@@ -125,11 +146,8 @@
         <mediaobject>
             <imageobject>
                 <imagedata fileref="figures/yocto-environment.png"
-                    format="PNG" align='center' scalefit='1' width="100%"/>
+                    format="PNG" align='center' width="8in"/>
             </imageobject>
-            <caption>
-                <para>The Yocto Project Development Environment</para>
-            </caption>
          </mediaobject>
 
         <para>
@@ -302,8 +320,7 @@
                 <itemizedlist>
                     <listitem><para><emphasis>Ubuntu and Debian</emphasis>
                         <literallayout class='monospaced'>
-     $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; \
-     libsdl1.2-dev xterm
+     $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; libsdl1.2-dev xterm
                         </literallayout>
                         </para></listitem>
                     <listitem><para><emphasis>Fedora</emphasis>
@@ -313,22 +330,31 @@
                         </para></listitem>
                     <listitem><para><emphasis>OpenSUSE</emphasis>
                         <literallayout class='monospaced'>
-     $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL; \
-     libSDL-devel xterm
+     $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL; libSDL-devel xterm
                         </literallayout>
                         </para></listitem>
                     <listitem><para><emphasis>CentOS</emphasis>
                         <literallayout class='monospaced'>
-     $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; \
-     SDL-devel xterm
+     $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
                         </literallayout>
-                        <note>
-                            CentOS 6.x users need to ensure that the required
-                            versions of Git, tar and Python are available.
-                            For details, See the
-                            "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
-                            section in the Yocto Project Reference Manual for
-                            information.
+                        <note><title>Notes</title>
+                            <itemizedlist>
+                                <listitem><para>
+                                    Extra Packages for Enterprise Linux
+                                    (i.e. <filename>epel-release</filename>)
+                                    is a collection of packages from Fedora
+                                    built on RHEL/CentOS for easy installation
+                                    of packages not included in enterprise
+                                    Linux by default.
+                                    You need to install these packages
+                                    separately.
+                                    </para></listitem>
+                                <listitem><para>
+                                    The <filename>makecache</filename> command
+                                    consumes additional Metadata from
+                                    <filename>epel-release</filename>.
+                                    </para></listitem>
+                            </itemizedlist>
                         </note>
                         </para></listitem>
                 </itemizedlist>
@@ -357,11 +383,12 @@
                 <literallayout class='monospaced'>
      $ git clone git://git.yoctoproject.org/poky
      Cloning into 'poky'...
-     remote: Counting objects: 226790, done.
-     remote: Compressing objects: 100% (57465/57465), done.
-     remote: Total 226790 (delta 165212), reused 225887 (delta 164327)
-     Receiving objects: 100% (226790/226790), 100.98 MiB | 263 KiB/s, done.
-     Resolving deltas: 100% (165212/165212), done.
+     remote: Counting objects: 361782, done.
+     remote: Compressing objects: 100% (87100/87100), done.
+     remote: Total 361782 (delta 268619), reused 361439 (delta 268277)
+     Receiving objects: 100% (361782/361782), 131.94 MiB | 6.88 MiB/s, done.
+     Resolving deltas: 100% (268619/268619), done.
+     Checking connectivity... done.
      $ git checkout &DISTRO_NAME_NO_CAP;
                 </literallayout>
                 You can also get the Yocto Project Files by downloading
@@ -569,14 +596,47 @@
                         <note>
                             Depending on the number of processors and cores, the
                             amount of RAM, the speed of your Internet connection
-                            and other factors, the build process could take several
-                            hours the first time you run it.
+                            and other factors, the build process could take
+                            several hours the first time you run it.
                             Subsequent builds run much faster since parts of the
                             build are cached.
                         </note>
                         <literallayout class='monospaced'>
      $ bitbake core-image-sato
                         </literallayout>
+                        <note>
+                            <para>
+                                If you experience a build error due to resources
+                                temporarily being unavailable and it appears you
+                                should not be having this issue, it might be due
+                                to the combination of a 4.3+ Linux kernel and
+                                <filename>systemd</filename> version 228+
+                                (i.e. see this
+                                <ulink url='http://unix.stackexchange.com/questions/253903/creating-threads-fails-with-resource-temporarily-unavailable-with-4-3-kernel'>link</ulink>
+                                for information).
+                            </para>
+
+                            <para>
+                                To work around this issue, you can try either
+                                of the following:
+                                <itemizedlist>
+                                    <listitem><para>
+                                        Try the build again.
+                                        </para></listitem>
+                                    <listitem><para>
+                                        Modify the "DefaultTasksMax"
+                                        <filename>systemd</filename> parameter
+                                        by uncommenting it and setting it to
+                                        "infinity".
+                                        You can find this parameter in the
+                                        <filename>system.conf</filename> file
+                                        located in
+                                        <filename>/etc/systemd</filename>
+                                        on most systems.
+                                        </para></listitem>
+                                </itemizedlist>
+                            </para>
+                        </note>
                         For information on using the
                         <filename>bitbake</filename> command, see the
                         "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>"
@@ -599,8 +659,8 @@
                         </para></listitem>
                     <listitem><para><emphasis>Exit QEMU:</emphasis>
                         Exit QEMU by either clicking on the shutdown icon or by
-                        opening a terminal, typing
-                        <filename>poweroff</filename>, and then pressing "Enter".
+                        typing <filename>Ctrl-C</filename> in the QEMU
+                        transcript window from which you evoked QEMU.
                         </para></listitem>
                 </orderedlist>
             </para>
@@ -639,11 +699,11 @@
      $ cd $HOME/poky
      $ git clone git://git.yoctoproject.org/meta-intel
      Cloning into 'meta-intel'...
-     remote: Counting objects: 11988, done.
-     remote: Compressing objects: 100% (3884/3884), done.
-     Receiving objects: 100% (11988/11988), 2.93 MiB | 2.51 MiB/s, done.
-     remote: Total 11988 (delta 6881), reused 11752 (delta 6645)
-     Resolving deltas: 100% (6881/6881), done.
+     remote: Counting objects: 14039, done.
+     remote: Compressing objects: 100% (4471/4471), done.
+     remote: Total 14039 (delta 8130), reused 13837 (delta 7947)
+     Receiving objects: 100% (14039/14039), 4.27 MiB | 3.98 MiB/s, done.
+     Resolving deltas: 100% (8130/8130), done.
      Checking connectivity... done.
                         </literallayout>
                         By default when you clone a Git repository, the
@@ -727,6 +787,39 @@
                         <literallayout class='monospaced'>
      $ bitbake core-image-base
                         </literallayout>
+                        <note>
+                            <para>
+                                If you experience a build error due to resources
+                                temporarily being unavailable and it appears you
+                                should not be having this issue, it might be due
+                                to the combination of a 4.3+ Linux kernel and
+                                <filename>systemd</filename> version 228+
+                                (i.e. see this
+                                <ulink url='http://unix.stackexchange.com/questions/253903/creating-threads-fails-with-resource-temporarily-unavailable-with-4-3-kernel'>link</ulink>
+                                for information).
+                            </para>
+
+                            <para>
+                                To work around this issue, you can try either
+                                of the following:
+                                <itemizedlist>
+                                    <listitem><para>
+                                        Try the build again.
+                                        </para></listitem>
+                                    <listitem><para>
+                                        Modify the "DefaultTasksMax"
+                                        <filename>systemd</filename> parameter
+                                        by uncommenting it and setting it to
+                                        "infinity".
+                                        You can find this parameter in the
+                                        <filename>system.conf</filename> file
+                                        located in
+                                        <filename>/etc/systemd</filename>
+                                        on most systems.
+                                        </para></listitem>
+                                </itemizedlist>
+                            </para>
+                        </note>
                         Once the build completes, the resulting console-only image
                         is located in the Build Directory here:
                         <literallayout class='monospaced'>
diff --git a/import-layers/yocto-poky/meta-poky/conf/distro/include/maintainers.inc b/import-layers/yocto-poky/meta-poky/conf/distro/include/maintainers.inc
index db95111..261c8f3 100644
--- a/import-layers/yocto-poky/meta-poky/conf/distro/include/maintainers.inc
+++ b/import-layers/yocto-poky/meta-poky/conf/distro/include/maintainers.inc
@@ -61,13 +61,13 @@
 RECIPE_MAINTAINER_pn-bash-completion = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-bc = "Jose Lamego <jose.a.lamego@linux.intel.com>"
 RECIPE_MAINTAINER_pn-bdwgc = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-beecrypt = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-beecrypt = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-bigreqsproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-bind = "Robert Yang <liezhi.yang@windriver.com>"
-RECIPE_MAINTAINER_pn-binutils = "Robert Yang <liezhi.yang@windriver.com>"
-RECIPE_MAINTAINER_pn-binutils-cross = "Robert Yang <liezhi.yang@windriver.com>"
-RECIPE_MAINTAINER_pn-binutils-cross-canadian = "Robert Yang <liezhi.yang@windriver.com>"
-RECIPE_MAINTAINER_pn-binutils-crosssdk = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-bind = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-binutils = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-binutils-cross = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-binutils-cross-canadian = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-binutils-crosssdk = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-bison = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-bjam-native = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-blktool = "Dengke Du <dengke.du@windriver.com>"
@@ -82,9 +82,9 @@
 RECIPE_MAINTAINER_pn-build-compare = "Randy Witt <randy.e.witt@linux.intel.com>"
 RECIPE_MAINTAINER_pn-builder = "Cristian Iorga <cristian.iorga@intel.com>"
 RECIPE_MAINTAINER_pn-buildtools-tarball = "Cristian Iorga <cristian.iorga@intel.com>"
-RECIPE_MAINTAINER_pn-busybox = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-busybox = "Armin Kuster <akuster808@gmail.com>"
 RECIPE_MAINTAINER_pn-byacc = "Chen Qi <Qi.Chen@windriver.com>"
-RECIPE_MAINTAINER_pn-bzip2 = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-bzip2 = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-ca-certificates = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-cairo = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-calibrateproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
@@ -97,8 +97,8 @@
 RECIPE_MAINTAINER_pn-clutter-1.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-clutter-gst-3.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-clutter-gtk-1.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-cmake = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-cmake-native = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-cmake = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-cmake-native = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
 RECIPE_MAINTAINER_pn-cogl-1.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-compositeproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-connman = "Maxin B. John <maxin.john@intel.com>"
@@ -108,7 +108,6 @@
 RECIPE_MAINTAINER_pn-consolekit = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-core-image-base = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-core-image-clutter = "Ross Burton <ross.burton@intel.com>"
-RECIPE_MAINTAINER_pn-core-image-directfb = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-core-image-full-cmdline = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-core-image-kernel-dev = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-core-image-lsb = "Ross Burton <ross.burton@intel.com>"
@@ -129,8 +128,8 @@
 RECIPE_MAINTAINER_pn-core-image-weston = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-core-image-x11 = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-coreutils = "Chen Qi <Qi.Chen@windriver.com>"
-RECIPE_MAINTAINER_pn-cpio = "Chen Qi <Qi.Chen@windriver.com>"
-RECIPE_MAINTAINER_pn-cracklib = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-cpio = "Denys Dmytriyenko <denis@denix.org>"
+RECIPE_MAINTAINER_pn-cracklib = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-createrepo = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER_pn-cronie = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
 RECIPE_MAINTAINER_pn-cross-localedef-native = "Khem Raj <raj.khem@gmail.com>"
@@ -138,7 +137,8 @@
 RECIPE_MAINTAINER_pn-cryptodev-module = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-cryptodev-tests = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-cups = "Chen Qi <Qi.Chen@windriver.com>"
-RECIPE_MAINTAINER_pn-curl = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-curl = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-cve-check-tool = "Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>"
 RECIPE_MAINTAINER_pn-cwautomacros = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-damageproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-db = "Mark Hatle <mark.hatle@windriver.com>"
@@ -158,11 +158,6 @@
 RECIPE_MAINTAINER_pn-distcc-config = "Dengke Du <dengke.du@windriver.com>"
 RECIPE_MAINTAINER_pn-dmidecode = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-dmxproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-docbook-dsssl-stylesheets-native = "Dengke Du <dengke.du@windriver.com>"
-RECIPE_MAINTAINER_pn-docbook-sgml-dtd-3.1-native = "Dengke Du <dengke.du@windriver.com>"
-RECIPE_MAINTAINER_pn-docbook-sgml-dtd-4.1-native = "Dengke Du <dengke.du@windriver.com>"
-RECIPE_MAINTAINER_pn-docbook-sgml-dtd-4.5-native = "Dengke Du <dengke.du@windriver.com>"
-RECIPE_MAINTAINER_pn-docbook-utils-native = "Dengke Du <dengke.du@windriver.com>"
 RECIPE_MAINTAINER_pn-docbook-xml-dtd4 = "Dengke Du <dengke.du@windriver.com>"
 RECIPE_MAINTAINER_pn-docbook-xsl-stylesheets = "Dengke Du <dengke.du@windriver.com>"
 RECIPE_MAINTAINER_pn-dosfstools = "Dengke Du <dengke.du@windriver.com>"
@@ -202,21 +197,21 @@
 RECIPE_MAINTAINER_pn-fstests = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-fts = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-gawk = "Chen Qi <Qi.Chen@windriver.com>"
-RECIPE_MAINTAINER_pn-gcc = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gcc-cross = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gcc-cross-canadian = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gcc-cross-initial = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gcc-crosssdk = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gcc-crosssdk-initial = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gcc-runtime = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gcc-sanitizers = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gcc-source = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gccmakedep = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-gcc = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-cross = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-cross-canadian = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-cross-initial = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-crosssdk = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-crosssdk-initial = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-runtime = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-sanitizers = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-source = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gccmakedep = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-gconf = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-gcr = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-gdb = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gdb-cross = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-gdb-cross-canadian = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-gdb = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gdb-cross = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gdb-cross-canadian = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-gdbm = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-gdk-pixbuf = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-gettext = "Robert Yang <liezhi.yang@windriver.com>"
@@ -226,13 +221,13 @@
 RECIPE_MAINTAINER_pn-glew = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-glib-2.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-glib-networking = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-glibc = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-glibc-initial = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-glibc-locale = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-glibc-mtrace = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-glibc-scripts = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-glibc = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-glibc-initial = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-glibc-locale = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-glibc-mtrace = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-glibc-scripts = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-glproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-gmp = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-gmp = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-gnome-common = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-gnome-desktop-testing = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-gnome-desktop3 = "Alexander Kanavin <alexander.kanavin@intel.com>"
@@ -241,12 +236,13 @@
 RECIPE_MAINTAINER_pn-gnu-config = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-gnu-efi = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-gnupg = "Hongxu Jia <hongxu.jia@windriver.com>"
-RECIPE_MAINTAINER_pn-gnutls = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gnutls = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-gobject-introspection = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-go-native = "Armin Kuster <akuster808@gmail.com>"
 RECIPE_MAINTAINER_pn-gperf = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-gpgme = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER_pn-gptfdisk = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-grep = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-grep = "Denys Dmytriyenko <denis@denix.org>"
 RECIPE_MAINTAINER_pn-groff = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER_pn-grub = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-grub-efi = "Alexander Kanavin <alexander.kanavin@intel.com>"
@@ -270,9 +266,9 @@
 RECIPE_MAINTAINER_pn-guile = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-guilt-native = "Bruce Ashfield <bruce.ashfield@windriver.com>"
 RECIPE_MAINTAINER_pn-gummiboot = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-gzip = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-gzip = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-harfbuzz = "Maxin B. John <maxin.john@intel.com>"
-RECIPE_MAINTAINER_pn-hdparm = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-hdparm = "Denys Dmytriyenko <denis@denix.org>"
 RECIPE_MAINTAINER_pn-help2man-native = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER_pn-hicolor-icon-theme = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-hostap-conf = "Maxin B. John <maxin.john@intel.com>"
@@ -284,8 +280,8 @@
 RECIPE_MAINTAINER_pn-icu = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-ifupdown = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-init-ifupdown = "Maxin B. John <maxin.john@intel.com>"
-RECIPE_MAINTAINER_pn-initramfs-boot = "Ross Burton <ross.burton@intel.com>"
-RECIPE_MAINTAINER_pn-initramfs-framework = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-boot = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-initramfs-framework = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
 RECIPE_MAINTAINER_pn-initramfs-live-boot = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-initramfs-live-install = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-initramfs-live-install-efi = "Ross Burton <ross.burton@intel.com>"
@@ -294,8 +290,8 @@
 RECIPE_MAINTAINER_pn-initscripts = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-inputproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-intltool = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-iproute2 = "Maxin B. John <maxin.john@intel.com>"
-RECIPE_MAINTAINER_pn-iptables = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-iproute2 = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-iptables = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-iputils = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-irda-utils = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-iso-codes = "Alexander Kanavin <alexander.kanavin@intel.com>"
@@ -309,7 +305,7 @@
 RECIPE_MAINTAINER_pn-kern-tools-native = "Bruce Ashfield <bruce.ashfield@windriver.com>"
 RECIPE_MAINTAINER_pn-kernelshark = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-kernel-devsrc = "Bruce Ashfield <bruce.ashfield@windriver.com>"
-RECIPE_MAINTAINER_pn-kexec-tools = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-kexec-tools = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-keymaps = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-kmod = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-kmod-native = "Chen Qi <Qi.Chen@windriver.com>"
@@ -321,9 +317,9 @@
 RECIPE_MAINTAINER_pn-liba52 = "Tanu Kaskinen <tanuk@iki.fi>"
 RECIPE_MAINTAINER_pn-libacpi = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-libaio = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-libarchive = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libarchive = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
 RECIPE_MAINTAINER_pn-libart-lgpl = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-libassuan = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libassuan = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-libatomic-ops = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-libav = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-libbsd = "Robert Yang <liezhi.yang@windriver.com>"
@@ -336,7 +332,7 @@
 RECIPE_MAINTAINER_pn-libcroco = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-libdaemon = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-libdmx = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-libdrm = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libdrm = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
 RECIPE_MAINTAINER_pn-libdumpvalue-perl = "Aníbal Limón <anibal.limon@linux.intel.com>"
 RECIPE_MAINTAINER_pn-libenv-perl = "Aníbal Limón <anibal.limon@linux.intel.com>"
 RECIPE_MAINTAINER_pn-libepoxy = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
@@ -351,10 +347,10 @@
 RECIPE_MAINTAINER_pn-libfm = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-libfm-extra = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-libfontenc = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-libgcc = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-libgcc-initial = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-libgcc = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-libgcc-initial = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-libgcrypt = "Hongxu Jia <hongxu.jia@windriver.com>"
-RECIPE_MAINTAINER_pn-libgfortran = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-libgfortran = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-libglade = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-libglu = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-libgpg-error = "Hongxu Jia <hongxu.jia@windriver.com>"
@@ -369,7 +365,7 @@
 RECIPE_MAINTAINER_pn-libjson = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-libksba = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-libmatchbox = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-libmpc = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-libmpc = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-libnewt = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER_pn-libnewt-python = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER_pn-libnfsidmap = "Maxin B. John <maxin.john@intel.com>"
@@ -383,6 +379,7 @@
 RECIPE_MAINTAINER_pn-libpcap = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-libpciaccess = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-libpcre = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-libpcre2 = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-libpfm4 = "Matthew McClintock <msm@freescale.com>"
 RECIPE_MAINTAINER_pn-libpng = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-libpng12 = "Maxin B. John <maxin.john@intel.com>"
@@ -414,7 +411,6 @@
 RECIPE_MAINTAINER_pn-libuser = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-libvorbis = "Tanu Kaskinen <tanuk@iki.fi>"
 RECIPE_MAINTAINER_pn-libwebp = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-libwnck3 = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-libx11 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-libx11-diet = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-libxau = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
@@ -458,13 +454,12 @@
 RECIPE_MAINTAINER_pn-libyaml = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-lighttpd = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-linux-dummy = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-linux-firmware = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-linux-firmware = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
 RECIPE_MAINTAINER_pn-linux-libc-headers = "Bruce Ashfield <bruce.ashfield@windriver.com>"
 RECIPE_MAINTAINER_pn-linux-yocto = "Bruce Ashfield <bruce.ashfield@windriver.com>"
 RECIPE_MAINTAINER_pn-linux-yocto-dev = "Bruce Ashfield <bruce.ashfield@windriver.com>"
 RECIPE_MAINTAINER_pn-linux-yocto-rt = "Bruce Ashfield <bruce.ashfield@windriver.com>"
 RECIPE_MAINTAINER_pn-linux-yocto-tiny = "Bruce Ashfield <bruce.ashfield@windriver.com>"
-RECIPE_MAINTAINER_pn-linuxdoc-tools-native = "Dengke Du <dengke.du@windriver.com>"
 RECIPE_MAINTAINER_pn-logrotate = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-lrzsz = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-lsb = "Hongxu Jia <hongxu.jia@windriver.com>"
@@ -476,8 +471,8 @@
 RECIPE_MAINTAINER_pn-lttng-tools = "Richard Purdie <richard.purdie@linuxfoundation.org>"
 RECIPE_MAINTAINER_pn-lttng-ust = "Richard Purdie <richard.purdie@linuxfoundation.org>"
 RECIPE_MAINTAINER_pn-lz4 = "Armin Kuster <akuster808@gmail.com>"
-RECIPE_MAINTAINER_pn-lzo = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-lzop = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-lzo = "Armin Kuster <akuster808@gmail.com>"
+RECIPE_MAINTAINER_pn-lzop = "Armin Kuster <akuster808@gmail.com>"
 RECIPE_MAINTAINER_pn-m4 = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-m4-native = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-mailx = "Robert Yang <liezhi.yang@windriver.com>"
@@ -499,9 +494,9 @@
 RECIPE_MAINTAINER_pn-mc = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-mdadm = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-menu-cache = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-mesa = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-mesa-demos = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-mesa-gl = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-mesa = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-mesa-demos = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-mesa-gl = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
 RECIPE_MAINTAINER_pn-meta-environment = "Richard Purdie <richard.purdie@linuxfoundation.org>"
 RECIPE_MAINTAINER_pn-meta-environment-extsdk = "Richard Purdie <richard.purdie@linuxfoundation.org>"
 RECIPE_MAINTAINER_pn-meta-extsdk-toolchain = "Richard Purdie <richard.purdie@linuxfoundation.org>"
@@ -520,10 +515,10 @@
 RECIPE_MAINTAINER_pn-mobile-broadband-provider-info = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-modutils-initscripts = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-mpeg2dec = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-mpfr = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-mpfr = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-mpg123 = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-msmtp = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-mtd-utils = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-mtd-utils = "Denys Dmytriyenko <denis@denix.org>"
 RECIPE_MAINTAINER_pn-mtdev = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-mtools = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-musl = "Khem Raj <raj.khem@gmail.com>"
@@ -537,20 +532,18 @@
 RECIPE_MAINTAINER_pn-ncurses = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER_pn-neard = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-neon = "Maxin B. John <maxin.john@intel.com>"
-RECIPE_MAINTAINER_pn-net-tools = "Maxin B. John <maxin.john@intel.com>"
-RECIPE_MAINTAINER_pn-netbase = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-net-tools = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-netbase = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-nettle = "Armin Kuster <akuster808@gmail.com>"
 RECIPE_MAINTAINER_pn-nfs-export-root = "Robert Yang <liezhi.yang@windriver.com>"
-RECIPE_MAINTAINER_pn-nfs-utils = "Mariano Lopez <mariano.lopez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-nfs-utils = "Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>"
 RECIPE_MAINTAINER_pn-npth = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-nspr = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-nss = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-nspr = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-nss = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-nss-myhostname = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-ofono = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-oh-puzzles = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-openjade-native = "Dengke Du <dengke.du@windriver.com>"
-RECIPE_MAINTAINER_pn-opensp = "Dengke Du <dengke.du@windriver.com>"
-RECIPE_MAINTAINER_pn-openssh = "Dengke Du <dengke.du@windriver.com>"
+RECIPE_MAINTAINER_pn-openssh = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-openssl = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-opkg = "Alejandro del Castillo <alejandro.delcastillo@ni.com>"
 RECIPE_MAINTAINER_pn-opkg-arch-config = "Alejandro del Castillo <alejandro.delcastillo@ni.com>"
@@ -591,9 +584,9 @@
 RECIPE_MAINTAINER_pn-patchelf = "Richard Purdie <richard.purdie@linuxfoundation.org>"
 RECIPE_MAINTAINER_pn-pax = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER_pn-pax-utils = "Hongxu Jia <hongxu.jia@windriver.com>"
-RECIPE_MAINTAINER_pn-pbzip2 = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-pbzip2 = "Armin Kuster <akuster@mvista.com>"
 RECIPE_MAINTAINER_pn-pciutils = "Chen Qi <Qi.Chen@windriver.com>"
-RECIPE_MAINTAINER_pn-pcmanfm = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
+RECIPE_MAINTAINER_pn-pcmanfm = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-pcmciautils = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-perf = "Bruce Ashfield <bruce.ashfield@windriver.com>"
 RECIPE_MAINTAINER_pn-perl = "Aníbal Limón <anibal.limon@linux.intel.com>"
@@ -602,7 +595,7 @@
 RECIPE_MAINTAINER_pn-pigz = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER_pn-pinentry = "Armin Kuster <akuster808@gmail.com>"
 RECIPE_MAINTAINER_pn-pixman = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-pixz = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-pixz = "Armin Kuster <akuster808@gmail.com>"
 RECIPE_MAINTAINER_pn-pkgconfig = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-pm-utils = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-pointercal = "Alexander Kanavin <alexander.kanavin@intel.com>"
@@ -633,7 +626,7 @@
 RECIPE_MAINTAINER_pn-python-mako = "Jose Lamego <jose.a.lamego@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python-nose = "Jose Lamego <jose.a.lamego@linux.intel.com>"
-RECIPE_MAINTAINER_pn-python-numpy = "Jose Lamego <jose.a.lamego@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-numpy = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python-pexpect = "Jose Lamego <jose.a.lamego@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python-ptyprocess = "Jose Lamego <jose.a.lamego@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python-pycairo = "Jose Lamego <jose.a.lamego@linux.intel.com>"
@@ -642,7 +635,7 @@
 RECIPE_MAINTAINER_pn-python-pyrex = "Jose Lamego <jose.a.lamego@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python-scons = "Jose Lamego <jose.a.lamego@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python-scons-native = "Jose Lamego <jose.a.lamego@linux.intel.com>"
-RECIPE_MAINTAINER_pn-python-setuptools = "Jose Lamego <jose.a.lamego@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-setuptools = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python-six = "Jose Lamego <jose.a.lamego@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python-smartpm = "Jose Lamego <jose.a.lamego@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python-smmap = "Jose Lamego <jose.a.lamego@linux.intel.com>"
@@ -651,9 +644,9 @@
 RECIPE_MAINTAINER_pn-python3-dbus = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python3-distribute = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python3-docutils = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
-RECIPE_MAINTAINER_pn-python3-git = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python3-git = "Jose Lamego <jose.a.lamego@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python3-gitdb = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
-RECIPE_MAINTAINER_pn-python3-mako = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python3-mako = "Jose Lamego <jose.a.lamego@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python3-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python3-nose = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
 RECIPE_MAINTAINER_pn-python3-numpy = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
@@ -694,10 +687,6 @@
 RECIPE_MAINTAINER_pn-serf = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-setserial = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-settings-daemon = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-sgml-common = "Dengke Du <dengke.du@windriver.com>"
-RECIPE_MAINTAINER_pn-sgml-common-native = "Dengke Du <dengke.du@windriver.com>"
-RECIPE_MAINTAINER_pn-sgmlspl = "Dengke Du <dengke.du@windriver.com>"
-RECIPE_MAINTAINER_pn-sgmlspl-native = "Dengke Du <dengke.du@windriver.com>"
 RECIPE_MAINTAINER_pn-shadow = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-shadow-securetty = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-shadow-sysroot = "Chen Qi <Qi.Chen@windriver.com>"
@@ -706,6 +695,7 @@
 RECIPE_MAINTAINER_pn-signing-keys = "Richard Purdie <richard.purdie@linuxfoundation.org>"
 RECIPE_MAINTAINER_pn-slang = "Robert Yang <liezhi.yang@windriver.com>"
 RECIPE_MAINTAINER_pn-socat = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-source-highlight = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-speex = "Tanu Kaskinen <tanuk@iki.fi>"
 RECIPE_MAINTAINER_pn-speexdsp = "Tanu Kaskinen <tanuk@iki.fi>"
 RECIPE_MAINTAINER_pn-sqlite3 = "Maxin B. John <maxin.john@intel.com>"
@@ -748,20 +738,18 @@
 RECIPE_MAINTAINER_pn-trace-cmd = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-tremor = "Tanu Kaskinen <tanuk@iki.fi>"
 RECIPE_MAINTAINER_pn-tslib = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-ttf-bitstream-vera = "Mariano Lopez <mariano.lopez@linux.intel.com>"
-RECIPE_MAINTAINER_pn-tzcode-native = "Robert Yang <liezhi.yang@windriver.com>"
-RECIPE_MAINTAINER_pn-tzdata = "Robert Yang <liezhi.yang@windriver.com>"
-RECIPE_MAINTAINER_pn-u-boot = "Denys Dmytriyenko <denis@denix.org>"
-RECIPE_MAINTAINER_pn-u-boot-fw-utils = "Denys Dmytriyenko <denis@denix.org>"
-RECIPE_MAINTAINER_pn-u-boot-mkimage = "Denys Dmytriyenko <denis@denix.org>"
+RECIPE_MAINTAINER_pn-ttf-bitstream-vera = "Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-tzcode-native = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-tzdata = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-u-boot = "Marek Vasut <marek.vasut@gmail.com>"
+RECIPE_MAINTAINER_pn-u-boot-fw-utils = "Marek Vasut <marek.vasut@gmail.com>"
+RECIPE_MAINTAINER_pn-u-boot-mkimage = "Marek Vasut <marek.vasut@gmail.com>"
 RECIPE_MAINTAINER_pn-ubootchart = "Ross Burton <ross.burton@intel.com>"
-RECIPE_MAINTAINER_pn-uclibc = "Khem Raj <raj.khem@gmail.com>"
-RECIPE_MAINTAINER_pn-uclibc-initial = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER_pn-udev-extraconf = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-unfs3 = "Randy Witt <randy.e.witt@linux.intel.com>"
 RECIPE_MAINTAINER_pn-unifdef = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-uninative-tarball = "Richard Purdie <richard.purdie@linuxfoundation.org>"
-RECIPE_MAINTAINER_pn-unzip = "Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>"
+RECIPE_MAINTAINER_pn-unzip = "Armin Kuster <akuster808@gmail.com>"
 RECIPE_MAINTAINER_pn-update-rc.d = "Ross Burton <ross.burton@intel.com>"
 RECIPE_MAINTAINER_pn-usbinit = "Alexander Kanavin <alexander.kanavin@intel.com>"
 RECIPE_MAINTAINER_pn-usbutils = "Alexander Kanavin <alexander.kanavin@intel.com>"
@@ -773,15 +761,17 @@
 RECIPE_MAINTAINER_pn-videoproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-volatile-binds = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER_pn-vte = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-vulkan = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-waffle = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-watchdog = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-wayland = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-wayland-protocols = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-watchdog-config = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-wayland = "Denys Dmytriyenko <denis@denix.org>"
+RECIPE_MAINTAINER_pn-wayland-protocols = "Denys Dmytriyenko <denis@denix.org>"
 RECIPE_MAINTAINER_pn-webkitgtk = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-weston = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-weston-init = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-weston = "Denys Dmytriyenko <denis@denix.org>"
+RECIPE_MAINTAINER_pn-weston-init = "Denys Dmytriyenko <denis@denix.org>"
 RECIPE_MAINTAINER_pn-wget = "Robert Yang <liezhi.yang@windriver.com>"
-RECIPE_MAINTAINER_pn-which = "Mariano Lopez <mariano.lopez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-which = "Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>"
 RECIPE_MAINTAINER_pn-wireless-tools = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-wpa-supplicant = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-x11-common = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
@@ -843,8 +833,8 @@
 RECIPE_MAINTAINER_pn-xvideo-tests = "Maxin B. John <maxin.john@intel.com>"
 RECIPE_MAINTAINER_pn-xvinfo = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
 RECIPE_MAINTAINER_pn-xwininfo = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
-RECIPE_MAINTAINER_pn-xz = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-xz = "Armin Kuster <akuster808@gmail.com>"
 RECIPE_MAINTAINER_pn-yasm = "Dengke Du <dengke.du@windriver.com>"
-RECIPE_MAINTAINER_pn-zip = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-zip = "Armin Kuster <akuster808@gmail.com>"
 RECIPE_MAINTAINER_pn-zisofs-tools-native = "Alexander Kanavin <alexander.kanavin@intel.com>"
-RECIPE_MAINTAINER_pn-zlib = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-zlib = "Armin Kuster <akuster808@gmail.com>"
diff --git a/import-layers/yocto-poky/meta-poky/conf/distro/include/poky-world-exclude.inc b/import-layers/yocto-poky/meta-poky/conf/distro/include/poky-world-exclude.inc
index 5194ff1..a6635b6 100644
--- a/import-layers/yocto-poky/meta-poky/conf/distro/include/poky-world-exclude.inc
+++ b/import-layers/yocto-poky/meta-poky/conf/distro/include/poky-world-exclude.inc
@@ -4,3 +4,5 @@
 
 # qwt from meta-qt4, has poky-lsb QA warnings, qt4 for lsb only
 EXCLUDE_FROM_WORLD_pn-qwt = "1"
+# python-pyqt from meta-qt4 requires sip from meta-oe
+EXCLUDE_FROM_WORLD_pn-python-pyqt = "1"
diff --git a/import-layers/yocto-poky/meta-poky/conf/distro/poky-tiny.conf b/import-layers/yocto-poky/meta-poky/conf/distro/poky-tiny.conf
index 08bd497..561566e 100644
--- a/import-layers/yocto-poky/meta-poky/conf/distro/poky-tiny.conf
+++ b/import-layers/yocto-poky/meta-poky/conf/distro/poky-tiny.conf
@@ -30,6 +30,7 @@
 
 require conf/distro/poky.conf
 DISTRO = "poky-tiny"
+DISTROOVERRIDES = "poky:poky-tiny"
 TCLIBC = "musl"
 # FIXME: consider adding a new "tiny" feature
 #DISTRO_FEATURES_append = " tiny"
@@ -37,7 +38,7 @@
 # Distro config is evaluated after the machine config, so we have to explicitly
 # set the kernel provider to override a machine config.
 PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-tiny"
-PREFERRED_VERSION_linux-yocto-tiny ?= "4.4%"
+PREFERRED_VERSION_linux-yocto-tiny ?= "4.9%"
 
 # We can use packagegroup-core-boot, but in the future we may need a new packagegroup-core-tiny
 #POKY_DEFAULT_EXTRA_RDEPENDS += "packagegroup-core-boot"
@@ -115,7 +116,6 @@
 PNBLACKLIST[build-appliance-image] = "not buildable with poky-tiny"
 PNBLACKLIST[core-image-base] = "not buildable with poky-tiny"
 PNBLACKLIST[core-image-clutter] = "not buildable with poky-tiny"
-PNBLACKLIST[core-image-directfb] = "not buildable with poky-tiny"
 PNBLACKLIST[core-image-full-cmdline] = "not buildable with poky-tiny"
 PNBLACKLIST[core-image-lsb] = "not buildable with poky-tiny"
 PNBLACKLIST[core-image-lsb-dev] = "not buildable with poky-tiny"
diff --git a/import-layers/yocto-poky/meta-poky/conf/distro/poky.conf b/import-layers/yocto-poky/meta-poky/conf/distro/poky.conf
index aca38c3..621d845 100644
--- a/import-layers/yocto-poky/meta-poky/conf/distro/poky.conf
+++ b/import-layers/yocto-poky/meta-poky/conf/distro/poky.conf
@@ -1,7 +1,7 @@
 DISTRO = "poky"
 DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
-DISTRO_VERSION = "2.2.2"
-DISTRO_CODENAME = "morty"
+DISTRO_VERSION = "2.3.3"
+DISTRO_CODENAME = "pyro"
 SDK_VENDOR = "-pokysdk"
 SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
 
@@ -21,13 +21,13 @@
 
 DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} ${POKY_DEFAULT_DISTRO_FEATURES}"
 
-PREFERRED_VERSION_linux-yocto ?= "4.8%"
-PREFERRED_VERSION_linux-yocto_qemux86 ?= "4.8%"
-PREFERRED_VERSION_linux-yocto_qemux86-64 ?= "4.8%"
-PREFERRED_VERSION_linux-yocto_qemuarm ?= "4.8%"
-PREFERRED_VERSION_linux-yocto_qemumips ?= "4.8%"
-PREFERRED_VERSION_linux-yocto_qemumips64 ?= "4.8%"
-PREFERRED_VERSION_linux-yocto_qemuppc ?= "4.8%"
+PREFERRED_VERSION_linux-yocto ?= "4.10%"
+PREFERRED_VERSION_linux-yocto_qemux86 ?= "4.10%"
+PREFERRED_VERSION_linux-yocto_qemux86-64 ?= "4.10%"
+PREFERRED_VERSION_linux-yocto_qemuarm ?= "4.10%"
+PREFERRED_VERSION_linux-yocto_qemumips ?= "4.10%"
+PREFERRED_VERSION_linux-yocto_qemumips64 ?= "4.10%"
+PREFERRED_VERSION_linux-yocto_qemuppc ?= "4.10%"
 
 SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}"
 SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"
@@ -45,8 +45,8 @@
 
 TCLIBCAPPEND = ""
 
-QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 ppc x86_64"
-# Other QEMU_TARGETS "mips64el sh4"
+QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc x86_64"
+# Other QEMU_TARGETS "sh4"
 
 PREMIRRORS ??= "\
 bzr://.*/.*   http://downloads.yoctoproject.org/mirror/sources/ \n \
@@ -70,22 +70,17 @@
 CONNECTIVITY_CHECK_URIS ?= "https://www.example.com/"
 
 SANITY_TESTED_DISTROS ?= " \
-            poky-1.8 \n \
-            poky-2.0 \n \
-            poky-2.1 \n \
             poky-2.2 \n \
-            Ubuntu-14.04 \n \
-            Ubuntu-14.10 \n \
-            Ubuntu-15.04 \n \
-            Ubuntu-15.10 \n \
-            Ubuntu-16.04 \n \
-            Fedora-22 \n \
-            Fedora-23 \n \
-            Fedora-24 \n \
-            CentOSLinux-7.* \n \
-            Debian-8.* \n \
-            openSUSE-13.2 \n \
-            SUSELINUX-42.1 \n \
+            poky-2.3 \n \
+            ubuntu-15.04 \n \
+            ubuntu-16.04 \n \
+            ubuntu-16.10 \n \
+            fedora-24 \n \
+            fedora-25 \n \
+            centos-7 \n \
+            debian-8 \n \
+            opensuse-42.1 \n \
+            opensuse-42.2 \n \
             "
 #
 # OELAYOUT_ABI allows us to notify users when the format of TMPDIR changes in 
@@ -93,7 +88,7 @@
 # that breaks the format and have been previously discussed on the mailing list 
 # with general agreement from the core team.
 #
-OELAYOUT_ABI = "11"
+OELAYOUT_ABI = "12"
 
 # add poky sanity bbclass
 INHERIT += "poky-sanity"
diff --git a/import-layers/yocto-poky/meta-poky/conf/local.conf.sample b/import-layers/yocto-poky/meta-poky/conf/local.conf.sample
index 365b6eb..304ee01 100644
--- a/import-layers/yocto-poky/meta-poky/conf/local.conf.sample
+++ b/import-layers/yocto-poky/meta-poky/conf/local.conf.sample
@@ -191,7 +191,7 @@
 # files and damages the build in ways which may not be easily recoverable.
 # It's necesary to monitor /tmp, if there is no space left the build will fail
 # with very exotic errors.
-BB_DISKMON_DIRS = "\
+BB_DISKMON_DIRS ??= "\
     STOPTASKS,${TMPDIR},1G,100K \
     STOPTASKS,${DL_DIR},1G,100K \
     STOPTASKS,${SSTATE_DIR},1G,100K \
diff --git a/import-layers/yocto-poky/meta-poky/conf/local.conf.sample.extended b/import-layers/yocto-poky/meta-poky/conf/local.conf.sample.extended
index d407ffb..0560de8 100644
--- a/import-layers/yocto-poky/meta-poky/conf/local.conf.sample.extended
+++ b/import-layers/yocto-poky/meta-poky/conf/local.conf.sample.extended
@@ -47,6 +47,13 @@
 # less than 128MB RAM.
 #ENABLE_BINARY_LOCALE_GENERATION = "1"
 
+# If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert
+# glibc-binary-localedata-XX-YY to be a meta package depending on
+# glibc-binary-localedata-XX-YY-lc-address and so on. This enables
+# saving quite some space if someone doesn't need LC_COLLATE for
+# example.
+#GLIBC_SPLIT_LC_PACKAGES = "1"
+
 # Set GLIBC_GENERATE_LOCALES to the locales you wish to generate should you not
 # wish to perform the time-consuming step of generating all LIBC locales.
 # NOTE: If removing en_US.UTF-8 you will also need to uncomment, and set
diff --git a/import-layers/yocto-poky/meta-poky/conf/toasterconf.json b/import-layers/yocto-poky/meta-poky/conf/toasterconf.json
deleted file mode 100644
index 93fb929..0000000
--- a/import-layers/yocto-poky/meta-poky/conf/toasterconf.json
+++ /dev/null
@@ -1,90 +0,0 @@
-{
-    "config": {
-        "MACHINE"      : "qemux86",
-        "DISTRO"       : "poky",
-        "DL_DIR"       : "${TOPDIR}/../downloads",
-        "IMAGE_FSTYPES": "ext3 jffs2 tar.bz2",
-        "IMAGE_INSTALL_append": "",
-        "PACKAGE_CLASSES": "package_rpm",
-        "SSTATE_DIR"   : "${TOPDIR}/../sstate-cache"
-    },
-    "layersources": [
-        {
-            "name": "Local Yocto Project",
-            "sourcetype": "local",
-            "apiurl": "../../",
-            "branches": ["HEAD" ],
-            "layers": [
-                {
-                    "name": "openembedded-core",
-                    "local_path": "meta",
-                    "vcs_url": "remote:origin",
-                    "dirpath": "meta"
-                },
-                {
-                    "name": "meta-poky",
-                    "local_path": "meta-poky",
-                    "vcs_url": "remote:origin",
-                    "dirpath": "meta-poky"
-                },
-                {
-                    "name": "meta-yocto-bsp",
-                    "local_path": "meta-yocto-bsp",
-                    "vcs_url": "remote:origin",
-                    "dirpath": "meta-yocto-bsp"
-                }
-
-            ]
-        },
-        {
-            "name": "OpenEmbedded",
-            "sourcetype": "layerindex",
-            "apiurl": "http://layers.openembedded.org/layerindex/api/",
-            "branches": ["master"]
-        },
-        {
-            "name": "Imported layers",
-            "sourcetype": "imported",
-            "apiurl": "",
-            "branches": ["master", "HEAD"]
-
-        }
-    ],
-    "bitbake" : [
-        {
-            "name": "master",
-            "giturl": "remote:origin",
-            "branch": "master",
-            "dirpath": "bitbake"
-        },
-        {
-            "name": "HEAD",
-            "giturl": "remote:origin",
-            "branch": "HEAD",
-            "dirpath": "bitbake"
-        }
-    ],
-
-    "defaultrelease": "master",
-
-    "releases": [
-        {
-            "name": "master",
-            "description": "Yocto Project master",
-            "bitbake": "master",
-            "branch": "master",
-            "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
-            "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" :  0 },
-            "helptext": "Toaster will run your builds using the tip of the <a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/\">Yocto Project master branch</a>, where active development takes place. This is not a stable branch, so your builds might not work as expected."
-        },
-        {
-            "name": "local",
-            "description": "Local Yocto Project",
-            "bitbake": "HEAD",
-            "branch": "HEAD",
-            "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
-            "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" :  0 },
-            "helptext": "Toaster will run your builds with the version of the Yocto Project you have cloned or downloaded to your computer."
-        }
-    ]
-}
diff --git a/import-layers/yocto-poky/meta-selftest/lib/devtool/bbpath.py b/import-layers/yocto-poky/meta-selftest/lib/devtool/bbpath.py
new file mode 100644
index 0000000..5e8ffb3
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/lib/devtool/bbpath.py
@@ -0,0 +1,44 @@
+import argparse
+
+already_loaded = False
+kept_context = None
+
+def plugin_name(filename):
+    return os.path.splitext(os.path.basename(filename))[0]
+
+def plugin_init(plugins):
+    global already_loaded
+    already_loaded = plugin_name(__file__) in (plugin_name(p.__name__) for p in plugins)
+
+def print_name(args, config, basepath, workspace):
+    print (__file__)
+
+def print_bbdir(args, config, basepath, workspace):
+    print (__file__.replace('/lib/devtool/bbpath.py',''))
+
+def print_registered(args, config, basepath, workspace):
+    global kept_context
+    print(kept_context.loaded)
+
+def multiloaded(args, config, basepath, workspace):
+    global already_loaded
+    print("yes" if already_loaded else "no")
+
+def register_commands(subparsers, context):
+    global kept_context
+    kept_context = context
+    if 'loaded' in context.__dict__:
+        context.loaded += 1
+    else:
+        context.loaded = 1
+
+    def addparser(name, helptxt, func):
+        parser = subparsers.add_parser(name, help=helptxt,
+                                       formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+        parser.set_defaults(func=func)
+        return parser
+
+    addparser('pluginfile', 'Print the filename of this plugin', print_name)
+    addparser('bbdir', 'Print the BBPATH directory of this plugin', print_bbdir)
+    addparser('count', 'How many times have this plugin been registered.', print_registered)
+    addparser('multiloaded', 'How many times have this plugin been initialized', multiloaded)
diff --git a/import-layers/yocto-poky/meta-selftest/lib/oeqa/runtime/selftest.json b/import-layers/yocto-poky/meta-selftest/lib/oeqa/runtime/cases/selftest.json
similarity index 100%
rename from import-layers/yocto-poky/meta-selftest/lib/oeqa/runtime/selftest.json
rename to import-layers/yocto-poky/meta-selftest/lib/oeqa/runtime/cases/selftest.json
diff --git a/import-layers/yocto-poky/meta-selftest/lib/oeqa/runtime/cases/selftest.py b/import-layers/yocto-poky/meta-selftest/lib/oeqa/runtime/cases/selftest.py
new file mode 100644
index 0000000..e4985a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/lib/oeqa/runtime/cases/selftest.py
@@ -0,0 +1,73 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.runtime.cases.dnf import DnfTest
+from oeqa.utils.httpserver import HTTPService
+
+class Selftest(OERuntimeTestCase):
+
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_install_package(self):
+        """
+        Summary: Check basic package installation functionality.
+        Expected: 1. Before the test socat must be installed using scp.
+                  2. After the test socat must be uninstalled using ssh.
+                     This can't be checked in this test.
+        Product: oe-core
+        Author: Mariano Lopez <mariano.lopez@intel.com>
+        """
+
+        (status, output) = self.target.run("socat -V")
+        self.assertEqual(status, 0, msg="socat is not installed")
+
+    @OETestDepends(['selftest.Selftest.test_install_package'])
+    def test_verify_uninstall(self):
+        """
+        Summary: Check basic package installation functionality.
+        Expected: 1. test_install_package must uninstall socat.
+                     This test is just to verify that.
+        Product: oe-core
+        Author: Mariano Lopez <mariano.lopez@intel.com>
+        """
+
+        (status, output) = self.target.run("socat -V")
+        self.assertNotEqual(status, 0, msg="socat is still installed")
+
+
+class DnfSelftest(DnfTest):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.repo_server = HTTPService(os.path.join(cls.tc.td['WORKDIR'], 'oe-rootfs-repo'),
+                                      cls.tc.target.server_ip)
+        cls.repo_server.start()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.repo_server.stop()
+
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_verify_package_feeds(self):
+        """
+        Summary: Check correct setting of PACKAGE_FEED_URIS var
+        Expected: 1. Feeds were correctly set for dnf
+                  2. Update recovers packages from host's repo
+        Author: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
+        Author: Alexander Kanavin <alexander.kanavin@intel.com>
+        """
+        # When we created an image, we had to supply fake ip and port
+        # for the feeds. Now we can patch the real ones into the config file.
+        import tempfile
+        temp_file = tempfile.TemporaryDirectory(prefix="oeqa-remotefeeds-").name
+        self.tc.target.copyFrom("/etc/yum.repos.d/oe-remote-repo.repo", temp_file)
+        fixed_config = open(temp_file, "r").read().replace("bogus_ip", self.tc.target.server_ip).replace("bogus_port", str(self.repo_server.port))
+        open(temp_file, "w").write(fixed_config)
+        self.tc.target.copyTo(temp_file, "/etc/yum.repos.d/oe-remote-repo.repo")
+
+        import re
+        output_makecache = self.dnf('makecache')
+        self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg = "dnf makecache failed: %s" %(output_makecache))
+
+        output_repoinfo = self.dnf('repoinfo')
+        matchobj = re.match(r".*Repo-pkgs\s*:\s*(?P<n_pkgs>[0-9]+)", output_repoinfo, re.DOTALL)
+        self.assertTrue(matchobj is not None, msg = "Could not find the amount of packages in dnf repoinfo output: %s" %(output_repoinfo))
+        self.assertTrue(int(matchobj.group('n_pkgs')) > 0, msg = "Amount of remote packages is not more than zero: %s\n" %(output_repoinfo))
diff --git a/import-layers/yocto-poky/meta-selftest/lib/oeqa/runtime/selftest.py b/import-layers/yocto-poky/meta-selftest/lib/oeqa/runtime/selftest.py
deleted file mode 100644
index a7e58ab..0000000
--- a/import-layers/yocto-poky/meta-selftest/lib/oeqa/runtime/selftest.py
+++ /dev/null
@@ -1,55 +0,0 @@
-import os
-
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.commands import runCmd
-from oeqa.utils.decorators import *
-
-class Selftest(oeRuntimeTest):
-
-    @skipUnlessPassed("test_ssh")
-    @tag("selftest_package_install")
-    def test_install_package(self):
-        """
-        Summary: Check basic package installation functionality.
-        Expected: 1. Before the test socat must be installed using scp.
-                  2. After the test socat must be unistalled using ssh.
-                     This can't be checked in this test.
-        Product: oe-core
-        Author: Mariano Lopez <mariano.lopez@intel.com>
-        """
-
-        (status, output) = self.target.run("socat -V")
-        self.assertEqual(status, 0, msg="socat is not installed")
-
-    @skipUnlessPassed("test_install_package")
-    @tag("selftest_package_install")
-    def test_verify_unistall(self):
-        """
-        Summary: Check basic package installation functionality.
-        Expected: 1. test_install_package must unistall socat.
-                     This test is just to verify that.
-        Product: oe-core
-        Author: Mariano Lopez <mariano.lopez@intel.com>
-        """
-
-        (status, output) = self.target.run("socat -V")
-        self.assertNotEqual(status, 0, msg="socat is still installed")
-
-    @tag("selftest_sdk")
-    def test_sdk(self):
-
-        result = runCmd("env -0")
-        sdk_path = search_sdk_path(result.output)
-        self.assertTrue(sdk_path, msg="Can't find SDK path")
-
-        tar_cmd = os.path.join(sdk_path, "tar")
-        result = runCmd("%s --help" % tar_cmd)
-
-def search_sdk_path(env):
-    for line in env.split("\0"):
-        (key, _, value) = line.partition("=")
-        if key == "PATH":
-            for path in value.split(":"):
-                if "pokysdk" in path:
-                    return path
-    return ""
diff --git a/import-layers/yocto-poky/meta-selftest/lib/recipetool/bbpath.py b/import-layers/yocto-poky/meta-selftest/lib/recipetool/bbpath.py
new file mode 100644
index 0000000..783b2dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/lib/recipetool/bbpath.py
@@ -0,0 +1,41 @@
+import argparse
+
+already_loaded = False
+register_count = 0
+
+def plugin_name(filename):
+    return os.path.splitext(os.path.basename(filename))[0]
+
+def plugin_init(plugins):
+    global already_loaded
+    already_loaded = plugin_name(__file__) in (plugin_name(p.__name__) for p in plugins)
+
+def print_name(opts):
+    print (__file__)
+
+def print_bbdir(opts):
+    print (__file__.replace('/lib/recipetool/bbpath.py',''))
+
+def print_registered(opts):
+    #global kept_context
+    #print(kept_context.loaded)
+    print ("1")
+
+def multiloaded(opts):
+    global already_loaded
+    print("yes" if already_loaded else "no")
+
+def register_commands(subparsers):
+    global register_count
+    register_count += 1
+
+    def addparser(name, helptxt, func):
+        parser = subparsers.add_parser(name, help=helptxt,
+                                       formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+        parser.set_defaults(func=func)
+        return parser
+
+    addparser('pluginfile', 'Print the filename of this plugin', print_name)
+    addparser('bbdir', 'Print the BBPATH directory of this plugin', print_bbdir)
+    addparser('count', 'How many times have this plugin been registered.', print_registered)
+    addparser('multiloaded', 'How many times have this plugin been initialized', multiloaded)
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb
index 20a0ab7..073cf56 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb
@@ -14,6 +14,8 @@
 SRC_URI[md5sum] = "e66a9c9af6a60dc46134fdacf6ce97d7"
 SRC_URI[sha256sum] = "f52583a83a63633701c5f71db3dc40aab87b7f76b29723aeb27941eff42df6e1"
 
+EXCLUDE_FROM_WORLD = "1"
+
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses"
 
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/container-image/container-image-testpkg.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/container-image/container-image-testpkg.bb
new file mode 100644
index 0000000..f8dd229
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/container-image/container-image-testpkg.bb
@@ -0,0 +1,8 @@
+LICENSE = "MIT"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_install_append() {
+    install -d ${D}${bindir}
+    touch ${D}${bindir}/theapp
+}
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/container-image/container-test-image.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/container-image/container-test-image.bb
new file mode 100644
index 0000000..d5f939c
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/container-image/container-test-image.bb
@@ -0,0 +1,8 @@
+IMAGE_INSTALL += "container-image-testpkg"
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "container"
+IMAGE_LINGUAS = ""
+
+inherit core-image
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb
new file mode 100644
index 0000000..3f7123c
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb
@@ -0,0 +1,7 @@
+LICENSE = "CLOSED"
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "file://file1 \
+           file://file2"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1 b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1
new file mode 100644
index 0000000..f4bdcfc
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1
@@ -0,0 +1 @@
+The first file
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2 b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2
new file mode 100644
index 0000000..a7e2414
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2
@@ -0,0 +1 @@
+The second file
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb
new file mode 100644
index 0000000..e45ee9f
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb
@@ -0,0 +1,17 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "libxres libxext virtual/libx11 ncurses"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/xrestop/xrestop-0.4.tar.gz \
+           file://readme.patch.gz \
+           "
+
+S = "${WORKDIR}/xrestop-0.4"
+
+SRC_URI[md5sum] = "d8a54596cbaf037e62b80c4585a3ca9b"
+SRC_URI[sha256sum] = "67c2fc94a7ecedbaae0d1837e82e93d1d98f4a6d759828860e552119af3ce257"
+
+inherit autotools pkgconfig
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz
new file mode 100644
index 0000000..4752492
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb
new file mode 100644
index 0000000..3f69565
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb
@@ -0,0 +1,9 @@
+LICENSE = "CLOSED"
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "file://devtool-test-subdir.tar.gz \
+           file://testfile;subdir=${BPN}"
+
+S = "${WORKDIR}/${BPN}"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz
new file mode 100644
index 0000000..3d44f80
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile
new file mode 100644
index 0000000..12b519c
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile
@@ -0,0 +1 @@
+Modified version
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb
index e93b0d5..4049be2 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb
@@ -12,5 +12,7 @@
 
 S = "${WORKDIR}/pv-${PV}"
 
+EXCLUDE_FROM_WORLD = "1"
+
 inherit autotools
 
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded
index afcc4aa..42c0705 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded
@@ -10,5 +10,7 @@
 
 S = "${WORKDIR}/pv-${PV}"
 
+EXCLUDE_FROM_WORLD = "1"
+
 inherit autotools
 
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb
index 9bfce0a..450636e 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb
@@ -15,4 +15,6 @@
 
 S = "${WORKDIR}/git"
 
+EXCLUDE_FROM_WORLD = "1"
+
 inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded
index 9b947ed..0d2e19e 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded
@@ -14,4 +14,6 @@
 
 S = "${WORKDIR}/git"
 
+EXCLUDE_FROM_WORLD = "1"
+
 inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/error/error.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/error/error.bb
index a7bdecf..3c22e7c 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/error/error.bb
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/error/error.bb
@@ -1,7 +1,6 @@
 SUMMARY = "Error Test case that fails on do_compile"
 DESCRIPTION = "This generates a compile time error to be used to for testing."
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 INHIBIT_DEFAULT_DEPS = "1"                                                                                                                                                                  
 EXCLUDE_FROM_WORLD = "1"
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/images/oe-selftest-image.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/images/oe-selftest-image.bb
index f17094c..5d4d10e 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/images/oe-selftest-image.bb
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/images/oe-selftest-image.bb
@@ -1,6 +1,6 @@
 SUMMARY = "An image used during oe-selftest tests"
 
-IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} dropbear"
+IMAGE_INSTALL = "packagegroup-core-boot dropbear"
 IMAGE_FEATURES = "debug-tweaks"
 
 IMAGE_LINGUAS = " "
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.bb
index 9e93b8e..e1da203 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.bb
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.bb
@@ -2,18 +2,14 @@
 
 SRC_URI = "file://${FILE_DIRNAME}/${BPN}.wks"
 
-IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP}"
+IMAGE_INSTALL = "packagegroup-core-boot"
 
 IMAGE_FSTYPES = "wic"
 
-DEPENDS = "syslinux syslinux-native dosfstools-native mtools-native gptfdisk-native"
+WKS_FILE_DEPENDS = "syslinux syslinux-native dosfstools-native mtools-native gptfdisk-native"
 
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
-# core-image-minimal is referenced in .wks, so we need its rootfs
-# to be ready before our rootfs
-do_rootfs[depends] += "core-image-minimal:do_image core-image-minimal:do_rootfs_wicenv"
-
 IMAGE_ROOTFS_EXTRA_SPACE = "2000"
 
 inherit image
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks b/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks
index d55075d..9410b68 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks
@@ -2,9 +2,8 @@
 # long-description: This image contains boot partition and 3 rootfs partitions
 # created from core-image-minimal and wic-image-minimal image recipes.
 
-part /boot --source bootimg-pcbios --ondisk vda --label boot --active --align 1024
-part / --source rootfs --ondisk vda --fstype=ext4 --label platform --align 1024 --use-uuid
-part /mnt --source rootfs --rootfs-dir=core-image-minimal --ondisk vda --fstype=ext4 --label core --align 1024
-part backup --source rootfs --rootfs-dir=wic-image-minimal --ondisk vda --fstype=ext4 --label backup --align 1024
+part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+part /mnt --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label core --align 1024
 
 bootloader --ptable gpt --timeout=0  --append="rootwait console=tty0"
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/m4/m4_1.4.17.bbappend b/import-layers/yocto-poky/meta-selftest/recipes-test/m4/m4_%.bbappend
similarity index 100%
rename from import-layers/yocto-poky/meta-selftest/recipes-test/m4/m4_1.4.17.bbappend
rename to import-layers/yocto-poky/meta-selftest/recipes-test/m4/m4_%.bbappend
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb
new file mode 100644
index 0000000..6d49734
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb
@@ -0,0 +1,126 @@
+LICENSE = "MIT"
+ALLOW_EMPTY_${PN}-at-rootfs = "1"
+ALLOW_EMPTY_${PN}-delayed-a = "1"
+ALLOW_EMPTY_${PN}-delayed-b = "1"
+ALLOW_EMPTY_${PN}-delayed-d = "1"
+ALLOW_EMPTY_${PN}-delayed-p = "1"
+ALLOW_EMPTY_${PN}-delayed-t = "1"
+
+PACKAGES += "${PN}-at-rootfs ${PN}-delayed-a ${PN}-delayed-b ${PN}-delayed-d ${PN}-delayed-p ${PN}-delayed-t"
+PROVIDES += "${PN}-at-rootfs ${PN}-delayed-a ${PN}-delayed-b ${PN}-delayed-d ${PN}-delayed-p ${PN}-delayed-t"
+FILES_${PN}-delayed-a = ""
+FILES_${PN}-delayed-b = ""
+FILES_${PN}-delayed-d = ""
+FILES_${PN}-delayed-p = ""
+FILES_${PN}-delayed-t = ""
+
+# Runtime dependencies
+RDEPENDS_${PN}-delayed-a = "${PN}-at-rootfs"
+RDEPENDS_${PN}-delayed-b = "${PN}-delayed-a"
+RDEPENDS_${PN}-delayed-d = "${PN}-delayed-b"
+RDEPENDS_${PN}-delayed-p = "${PN}-delayed-d"
+RDEPENDS_${PN}-delayed-t = "${PN}-delayed-p"
+
+# Main recipe post-install
+pkg_postinst_${PN}-at-rootfs () {
+    tfile="/etc/postinsta-test"
+    touch "$D"/this-was-created-at-rootfstime
+    if test "x$D" != "x" then
+        # Need to run on first boot
+        exit 1
+    else
+        echo "lets write postinst" > $tfile
+    fi
+}
+
+# Dependency recipes post-installs
+pkg_postinst_${PN}-delayed-a () {
+    efile="/etc/postinst-test"
+    tfile="/etc/postinsta-test"
+    rdeps="postinst"
+
+    if test "x$D" != "x"; then
+      # Need to run on first boot
+      exit 1
+    else
+      touch /etc/this-was-created-at-first-boot
+      if test -e $efile ; then
+        echo 'success' > $tfile
+      else
+        echo 'fail to install $rdeps first!' >&2
+        exit 1
+      fi
+   fi
+}
+
+pkg_postinst_${PN}-delayed-b () {
+    efile="/etc/postinsta-test"
+    tfile="/etc/postinstb-test"
+    rdeps="postinsta"
+
+    if test "x$D" != "x"; then
+      # Need to run on first boot
+      exit 1
+    else
+      if test -e $efile ; then
+        echo 'success' > $tfile
+      else
+        echo 'fail to install $rdeps first!' >&2
+        exit 1
+      fi
+   fi
+}
+
+pkg_postinst_${PN}-delayed-d () {
+    efile="/etc/postinstb-test"
+    tfile="/etc/postinstd-test"
+    rdeps="postinstb"
+
+    if test "x$D" != "x"; then
+      # Need to run on first boot
+      exit 1
+    else
+      if test -e $efile ; then
+        echo 'success' > $tfile
+      else
+        echo 'fail to install $rdeps first!' >&2
+        exit 1
+      fi
+   fi
+}
+
+pkg_postinst_${PN}-delayed-p () {
+    efile="/etc/postinstd-test"
+    tfile="/etc/postinstp-test"
+    rdeps="postinstd"
+
+    if test "x$D" != "x"; then
+      # Need to run on first boot
+      exit 1
+    else
+      if test -e $efile ; then
+        echo 'success' > $tfile
+      else
+        echo 'fail to install $rdeps first!' >&2
+        exit 1
+      fi
+   fi
+}
+
+pkg_postinst_${PN}-delayed-t () {
+    efile="/etc/postinstp-test"
+    tfile="/etc/postinstt-test"
+    rdeps="postinstp"
+
+    if test "x$D" != "x"; then
+      # Need to run on first boot
+      exit 1
+    else
+      if test -e $efile ; then
+          echo 'success' > $tfile
+      else
+          echo 'fail to install $rdeps first!' >&2
+          exit 1
+      fi
+   fi
+}
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb
index 7d0a040..7375c47 100644
--- a/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb
@@ -15,6 +15,8 @@
            file://selftest-replaceme-inst-todir-globfile \
            file://selftest-replaceme-inst-func"
 
+EXCLUDE_FROM_WORLD = "1"
+
 install_extrafunc() {
 	install -m 0644 ${WORKDIR}/selftest-replaceme-inst-func ${D}${datadir}/selftest-replaceme-inst-func
 }
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb
new file mode 100644
index 0000000..8e0d1cd
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Line-oriented text editor -- selftest GPLv2 version"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6ddd5335ef96fb858a138230af773710 \
+                    file://main.c;beginline=1;endline=17;md5=36d4b85e5ae9028e918d1cc775c2475e"
+
+PR = "r2"
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/ed/ed-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "4ee21e9dcc9b5b6012c23038734e1632"
+SRC_URI[sha256sum] = "edef2bbde0fbf0d88232782a0eded323f483a0519d6fde9a3b1809056fd35f3e"
+
+inherit autotools texinfo
+
+S = "${WORKDIR}/ed-${PV}"
+
+EXTRA_OECONF = "'CC=${CC}' 'CXX=${CXX}' 'CFLAGS=${CFLAGS}' 'CXXFLAGS=${CXXFLAGS}' 'CPPFLAGS=${CPPFLAGS}' 'LDFLAGS=${LDFLAGS}'"
+
+CONFIGUREOPTS_remove = "--disable-dependency-tracking"
+CONFIGUREOPTS_remove = "--disable-silent-rules"
+EXTRA_OECONF_remove = "--disable-static"
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb
new file mode 100644
index 0000000..62931c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Line-oriented text editor -- selftest variant"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7 \
+                    file://ed.h;endline=20;md5=4e36b7a40e137f42aee718165590d125 \
+                    file://main.c;endline=17;md5=c5b8f78f115df187af76868a2aead16a"
+
+SECTION = "base"
+
+# LSB states that ed should be in /bin/
+bindir = "${base_bindir}"
+
+SRC_URI = "${GNU_MIRROR}/ed/ed-${PV}.tar.lz"
+
+SRC_URI[md5sum] = "7f4a54fa7f366479f03654b8af645fd0"
+SRC_URI[sha256sum] = "ffb97eb8f2a2b5a71a9b97e3872adce953aa1b8958e04c5b7bf11d556f32552a"
+
+S = "${WORKDIR}/ed-${PV}"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+inherit texinfo
+
+do_configure() {
+	${S}/configure
+}
+
+do_install() {
+	oe_runmake 'DESTDIR=${D}' install
+	# Info dir listing isn't interesting at this point so remove it if it exists.
+	if [ -e "${D}${infodir}/dir" ]; then
+		rm -f ${D}${infodir}/dir
+	fi
+}
diff --git a/import-layers/yocto-poky/meta-selftest/wic/test_rawcopy_plugin.wks.in b/import-layers/yocto-poky/meta-selftest/wic/test_rawcopy_plugin.wks.in
new file mode 100644
index 0000000..83be4be
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/wic/test_rawcopy_plugin.wks.in
@@ -0,0 +1,6 @@
+# short-description: This file is used in oe-selftest wic module to test rawcopy plugin
+
+part /boot --active --source bootimg-pcbios
+part / --source rawcopy --sourceparams="file=core-image-minimal-${MACHINE}.ext4" --use-uuid
+
+bootloader  --timeout=0 --append="console=ttyS0,115200n8"
diff --git a/import-layers/yocto-poky/meta-selftest/wic/wictestdisk.wks b/import-layers/yocto-poky/meta-selftest/wic/wictestdisk.wks
new file mode 100644
index 0000000..d4de24d
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/wic/wictestdisk.wks
@@ -0,0 +1,7 @@
+# short-description: image for use in machine agnostic wic test cases
+
+# /boot is intentionally an empty partition
+part /boot --ondisk sda --label boot --active --align 1024 --size 16
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+
+# bootloader is intentionally left out
diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
index d3c02d5..7c5b9d0 100644
--- a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
+++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
@@ -3,8 +3,7 @@
 SECTION = "examples"
 PR = "r1"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 SRC_URI = "file://file1 \
            file://file2 \
@@ -15,6 +14,8 @@
 
 PACKAGES =+ "${PN}-user3"
 
+EXCLUDE_FROM_WORLD = "1"
+
 inherit useradd
 
 # You must set USERADD_PACKAGES when you inherit useradd. This
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/beaglebone.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/beaglebone.conf
index c487bd8..4a90ba5 100644
--- a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/beaglebone.conf
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/beaglebone.conf
@@ -4,10 +4,8 @@
 
 PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
 XSERVER ?= "xserver-xorg \
-           xf86-input-evdev \
-           xf86-input-mouse \
            xf86-video-modesetting \
-           xf86-input-keyboard"
+           "
 
 MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree"
 
@@ -16,16 +14,16 @@
 DEFAULTTUNE ?= "cortexa8hf-neon"
 include conf/machine/include/tune-cortexa8.inc
 
-IMAGE_FSTYPES += "tar.bz2 jffs2 wic"
+IMAGE_FSTYPES += "tar.bz2 jffs2 wic wic.bmap"
 EXTRA_IMAGECMD_jffs2 = "-lnp "
-WKS_FILE = "sdimage-bootpart.wks"
+WKS_FILE ?= "beaglebone.wks"
 IMAGE_INSTALL_append = " kernel-devicetree kernel-image-zimage"
 do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
 
 SERIAL_CONSOLE = "115200 ttyO0"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
-PREFERRED_VERSION_linux-yocto ?= "4.8%"
+PREFERRED_VERSION_linux-yocto ?= "4.12%"
 
 KERNEL_IMAGETYPE = "zImage"
 KERNEL_DEVICETREE = "am335x-bone.dtb am335x-boneblack.dtb"
@@ -33,7 +31,7 @@
 
 SPL_BINARY = "MLO"
 UBOOT_SUFFIX = "img"
-UBOOT_MACHINE = "am335x_evm_config"
+UBOOT_MACHINE = "am335x_boneblack_config"
 UBOOT_ENTRYPOINT = "0x80008000"
 UBOOT_LOADADDRESS = "0x80008000"
 
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/edgerouter.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/edgerouter.conf
index 720a947..ab5a6fc 100644
--- a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/edgerouter.conf
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/edgerouter.conf
@@ -11,16 +11,16 @@
 KERNEL_IMAGE_STRIP_EXTRA_SECTIONS  = ".comment"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
-PREFERRED_VERSION_linux-yocto ?= "4.8%"
+PREFERRED_VERSION_linux-yocto ?= "4.12%"
 
 SERIAL_CONSOLE = "115200 ttyS0"
 USE_VT ?= "0"
 
 MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
 
-IMAGE_FSTYPES ?= "jffs2 tar.bz2 wic"
+IMAGE_FSTYPES ?= "jffs2 tar.bz2 wic wic.bmap"
 JFFS2_ERASEBLOCK = "0x10000"
 
-WKS_FILE ?= "sdimage-bootpart.wks"
+WKS_FILE ?= "edgerouter.wks"
 IMAGE_BOOT_FILES ?= "vmlinux;vmlinux.64"
 do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86-64.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86-64.conf
index d843fd2..bfedd84 100644
--- a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86-64.conf
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86-64.conf
@@ -7,6 +7,6 @@
 require conf/machine/include/tune-core2.inc
 require conf/machine/include/genericx86-common.inc
 
-PREFERRED_VERSION_linux-yocto_genericx86-64 ?= "4.8%"
+PREFERRED_VERSION_linux-yocto ?= "4.10%"
 
 SERIAL_CONSOLES_CHECK = "ttyS0"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86.conf
index 04a7e0b..af03b86 100644
--- a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86.conf
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86.conf
@@ -9,4 +9,4 @@
 
 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "gma500-gfx-check"
 
-PREFERRED_VERSION_linux-yocto_genericx86 ?= "4.8%"
+PREFERRED_VERSION_linux-yocto ?= "4.10%"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc
index 2e59a95..e35685c 100644
--- a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc
@@ -3,7 +3,6 @@
 MACHINE_FEATURES += "wifi efi pcbios"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
-PREFERRED_VERSION_linux-yocto ?= "4.4%"
 PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
 XSERVER ?= "${XSERVER_X86_BASE} \
             ${XSERVER_X86_EXT} \
@@ -20,7 +19,7 @@
 
 EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi"
 
-IMAGE_FSTYPES += "wic"
-WKS_FILE ?= "mkefidisk.wks"
+IMAGE_FSTYPES += "wic wic.bmap"
+WKS_FILE ?= "genericx86.wks"
 do_image_wic[depends] += "gptfdisk-native:do_populate_sysroot"
 do_image_wic[recrdeptask] += "do_bootimg"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf
index a2ff07c..6e2d316 100644
--- a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf
@@ -8,18 +8,17 @@
 KERNEL_IMAGETYPE = "uImage"
 
 EXTRA_IMAGEDEPENDS += "u-boot"
-UBOOT_MACHINE_mpc8315e-rdb = "MPC8315ERDB_config"
+UBOOT_MACHINE = "MPC8315ERDB_config"
 
 SERIAL_CONSOLE = "115200 ttyS0"
 
 MACHINE_FEATURES = "keyboard pci ext2 ext3 serial"
 
-PREFERRED_VERSION_linux-yocto ?= "4.8%"
+PREFERRED_VERSION_linux-yocto ?= "4.12%"
 PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
 
 PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
 XSERVER ?= "xserver-xorg \
-            xf86-input-evdev \
             xf86-video-fbdev"
 
 UBOOT_ENTRYPOINT = "0x00000000"
@@ -30,3 +29,7 @@
 
 IMAGE_FSTYPES ?= "jffs2 tar.bz2"
 JFFS2_ERASEBLOCK = "0x4000"
+
+IMAGE_FSTYPES += "wic"
+WKS_FILE ?= 'mpc8315e-rdb.wks'
+IMAGE_BOOT_FILES ?= "u-boot.bin uImage uImage-mpc8315erdb.dtb;dtb"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py
deleted file mode 100644
index 00aa36f..0000000
--- a/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py
+++ /dev/null
@@ -1,83 +0,0 @@
-from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
-from oeqa.utils.decorators import testcase
-import re
-import os
-import sys
-import logging
-
-
-class Gummiboot(oeSelfTest):
-
-    def _common_setup(self):
-        """
-        Common setup for test cases: 1101, 1103
-        """
-
-        # Set EFI_PROVIDER = "gummiboot" and MACHINE = "genericx86-64" in conf/local.conf
-        features = 'EFI_PROVIDER = "gummiboot"\n'
-        features += 'MACHINE = "genericx86-64"'
-        self.append_config(features)
-
-    def _common_build(self):
-        """
-        Common build for test cases: 1101, 1103
-        """
-
-        # Build a genericx86-64/efi gummiboot image
-        bitbake('syslinux syslinux-native parted-native dosfstools-native mtools-native core-image-minimal')
-
-
-    @testcase(1101)
-    def test_efi_gummiboot_images_can_be_built(self):
-        """
-        Summary:     Check if efi/gummiboot images can be built
-        Expected:    1. File gummibootx64.efi should be available in build/tmp/deploy/images/genericx86-64
-                     2. Efi/gummiboot images can be built
-        Product:     oe-core
-        Author:      Ionut Chisanovici <ionutx.chisanovici@intel.com>
-        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
-        """
-
-        # We'd use DEPLOY_DIR_IMAGE here, except that we need its value for
-        # MACHINE="genericx86-64 which is probably not the one configured
-        gummibootfile = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 'genericx86-64', 'gummibootx64.efi')
-
-        self._common_setup()
-
-        # Ensure we're actually testing that this gets built and not that
-        # it was around from an earlier build
-        bitbake('-c cleansstate gummiboot')
-        runCmd('rm -f %s' % gummibootfile)
-
-        self._common_build()
-
-        found = os.path.isfile(gummibootfile)
-        self.assertTrue(found, 'Gummiboot file %s not found' % gummibootfile)
-
-    @testcase(1103)
-    def test_wic_command_can_create_efi_gummiboot_installation_images(self):
-        """
-        Summary:     Check that wic command can create efi/gummiboot installation images
-        Expected:    A .direct file in folder /var/tmp/wic/ must be created.
-        Product:     oe-core
-        Author:      Ionut Chisanovici <ionutx.chisanovici@intel.com>
-        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
-        """
-
-        self._common_setup()
-        self._common_build()
-
-        # Create efi/gummiboot installation images
-        wic_create_cmd = 'wic create mkgummidisk -e core-image-minimal'
-        result = runCmd(wic_create_cmd)
-
-        # Find file written by wic from output
-        res = re.search('(/var/tmp/wic/.*\.direct)', result.output)
-        if res:
-            direct_file = res.group(1)
-            # Check it actually exists
-            if not os.path.exists(direct_file):
-                self.fail('wic reported direct file "%s" does not exist; wic output:\n%s' % (direct_file, result.output))
-        else:
-            self.fail('No .direct file reported in wic output:\n%s' % result.output)
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/beaglebone/xorg.conf b/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/beaglebone/xorg.conf
new file mode 100644
index 0000000..2f40dae
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/beaglebone/xorg.conf
@@ -0,0 +1,20 @@
+Section "Monitor"
+        Identifier      "Builtin Default Monitor"
+EndSection
+
+Section "Device"
+        Identifier      "Builtin Default fbdev Device 0"
+        Driver  "modesetting"
+EndSection
+
+Section "Screen"
+        Identifier      "Builtin Default fbdev Screen 0"
+        DefaultDepth    16
+        Device  "Builtin Default fbdev Device 0"
+        Monitor "Builtin Default Monitor"
+EndSection
+
+Section "ServerLayout"
+        Identifier      "Builtin Default Layout"
+        Screen  "Builtin Default fbdev Screen 0"
+EndSection
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.1.bbappend
index 68bae2c..c55f925 100644
--- a/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.1.bbappend
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -7,11 +7,11 @@
 KMACHINE_genericx86 ?= "common-pc"
 KMACHINE_genericx86-64 ?= "common-pc-64"
 
-SRCREV_machine_genericx86    ?= "fec49247816d7045aa8abe0047bcd4737af9a853"
-SRCREV_machine_genericx86-64 ?= "fec49247816d7045aa8abe0047bcd4737af9a853"
-SRCREV_machine_edgerouter ?= "fec49247816d7045aa8abe0047bcd4737af9a853"
-SRCREV_machine_beaglebone ?= "938cc4ac8d36f166c9e2e0517d6ffd6d278fe631"
-SRCREV_machine_mpc8315e-rdb ?= "fec49247816d7045aa8abe0047bcd4737af9a853"
+SRCREV_machine_genericx86    ?= "782133d8166ac71ef1ffaba58b7cf81ec9e532a1"
+SRCREV_machine_genericx86-64 ?= "782133d8166ac71ef1ffaba58b7cf81ec9e532a1"
+SRCREV_machine_edgerouter ?= "782133d8166ac71ef1ffaba58b7cf81ec9e532a1"
+SRCREV_machine_beaglebone ?= "ce38fdb820476e496579f2481be977c0f35509f4"
+SRCREV_machine_mpc8315e-rdb ?= "782133d8166ac71ef1ffaba58b7cf81ec9e532a1"
 
 COMPATIBLE_MACHINE_genericx86 = "genericx86"
 COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
@@ -19,8 +19,8 @@
 COMPATIBLE_MACHINE_beaglebone = "beaglebone"
 COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
 
-LINUX_VERSION_genericx86 = "4.1.36"
-LINUX_VERSION_genericx86-64 = "4.1.36"
-LINUX_VERSION_edgerouter = "4.1.36"
-LINUX_VERSION_beaglebone = "4.1.36"
-LINUX_VERSION_mpc8315e-rdb = "4.1.36"
+LINUX_VERSION_genericx86 = "4.1.43"
+LINUX_VERSION_genericx86-64 = "4.1.43"
+LINUX_VERSION_edgerouter = "4.1.43"
+LINUX_VERSION_beaglebone = "4.1.43"
+LINUX_VERSION_mpc8315e-rdb = "4.1.43"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.10.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.10.bbappend
new file mode 100644
index 0000000..e1f359c
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.10.bbappend
@@ -0,0 +1,26 @@
+KBRANCH_genericx86  = "standard/base"
+KBRANCH_genericx86-64  = "standard/base"
+
+KMACHINE_genericx86 ?= "common-pc"
+KMACHINE_genericx86-64 ?= "common-pc-64"
+KBRANCH_edgerouter = "standard/edgerouter"
+KBRANCH_beaglebone = "standard/beaglebone"
+KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
+
+SRCREV_machine_genericx86    ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_machine_genericx86-64 ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_machine_edgerouter ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_machine_beaglebone ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_machine_mpc8315e-rdb ?= "c388fdfc9a1e06b22ca3533a023f4d67a6fc1e9b"
+
+COMPATIBLE_MACHINE_genericx86 = "genericx86"
+COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
+COMPATIBLE_MACHINE_edgerouter = "edgerouter"
+COMPATIBLE_MACHINE_beaglebone = "beaglebone"
+COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
+
+LINUX_VERSION_genericx86 = "4.10.17"
+LINUX_VERSION_genericx86-64 = "4.10.17"
+LINUX_VERSION_edgerouter = "4.10.17"
+LINUX_VERSION_beaglebone = "4.10.17"
+LINUX_VERSION_mpc8315e-rdb = "4.10.17"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.4.bbappend
index a0efb15..427af4c 100644
--- a/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.4.bbappend
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -7,11 +7,11 @@
 KBRANCH_beaglebone = "standard/beaglebone"
 KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
 
-SRCREV_machine_genericx86    ?= "35482df5d5ba0807eb8a7c40b554bd657e3f9987"
-SRCREV_machine_genericx86-64 ?= "35482df5d5ba0807eb8a7c40b554bd657e3f9987"
-SRCREV_machine_edgerouter ?= "35482df5d5ba0807eb8a7c40b554bd657e3f9987"
-SRCREV_machine_beaglebone ?= "35482df5d5ba0807eb8a7c40b554bd657e3f9987"
-SRCREV_machine_mpc8315e-rdb ?= "772f071dbdd4b813c921058ddf9cba207237228b"
+SRCREV_machine_genericx86    ?= "b71c7b786aed26c0a1e4eca66f1d874ec017d699"
+SRCREV_machine_genericx86-64 ?= "b71c7b786aed26c0a1e4eca66f1d874ec017d699"
+SRCREV_machine_edgerouter ?= "b71c7b786aed26c0a1e4eca66f1d874ec017d699"
+SRCREV_machine_beaglebone ?= "b71c7b786aed26c0a1e4eca66f1d874ec017d699"
+SRCREV_machine_mpc8315e-rdb ?= "b4daa4e9d68862e559d726b0b66b7be605889b9e"
 
 COMPATIBLE_MACHINE_genericx86 = "genericx86"
 COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
@@ -19,8 +19,8 @@
 COMPATIBLE_MACHINE_beaglebone = "beaglebone"
 COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
 
-LINUX_VERSION_genericx86 = "4.4.36"
-LINUX_VERSION_genericx86-64 = "4.4.36"
-LINUX_VERSION_edgerouter = "4.4.36"
-LINUX_VERSION_beaglebone = "4.4.36"
-LINUX_VERSION_mpc8315e-rdb = "4.4.36"
+LINUX_VERSION_genericx86 = "4.4.87"
+LINUX_VERSION_genericx86-64 = "4.4.87"
+LINUX_VERSION_edgerouter = "4.4.87"
+LINUX_VERSION_beaglebone = "4.4.87"
+LINUX_VERSION_mpc8315e-rdb = "4.4.87"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.8.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.8.bbappend
deleted file mode 100644
index 761e6e0..0000000
--- a/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.8.bbappend
+++ /dev/null
@@ -1,26 +0,0 @@
-KBRANCH_genericx86  = "standard/base"
-KBRANCH_genericx86-64  = "standard/base"
-
-KMACHINE_genericx86 ?= "common-pc"
-KMACHINE_genericx86-64 ?= "common-pc-64"
-KBRANCH_edgerouter = "standard/edgerouter"
-KBRANCH_beaglebone = "standard/beaglebone"
-KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
-
-SRCREV_machine_genericx86    ?= "021b4aef55b44597587a1ce5879be642b3dca155"
-SRCREV_machine_genericx86-64 ?= "021b4aef55b44597587a1ce5879be642b3dca155"
-SRCREV_machine_edgerouter ?= "6076f16536329465b62bd2037b8582a5e18f85d1"
-SRCREV_machine_beaglebone ?= "85dc85153cd7e3b72d34f967c4c0edde590c79a8"
-SRCREV_machine_mpc8315e-rdb ?= "f73222eb3bbd07a45564397a88dec554e848da7d"
-
-COMPATIBLE_MACHINE_genericx86 = "genericx86"
-COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
-COMPATIBLE_MACHINE_edgerouter = "edgerouter"
-COMPATIBLE_MACHINE_beaglebone = "beaglebone"
-COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
-
-LINUX_VERSION_genericx86 = "4.8.12"
-LINUX_VERSION_genericx86-64 = "4.8.12"
-LINUX_VERSION_edgerouter = "4.8.12"
-LINUX_VERSION_beaglebone = "4.8.12"
-LINUX_VERSION_mpc8315e-rdb = "4.8.12"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.9.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.9.bbappend
new file mode 100644
index 0000000..b3b5cd5
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.9.bbappend
@@ -0,0 +1,26 @@
+KBRANCH_genericx86  = "standard/base"
+KBRANCH_genericx86-64  = "standard/base"
+
+KMACHINE_genericx86 ?= "common-pc"
+KMACHINE_genericx86-64 ?= "common-pc-64"
+KBRANCH_edgerouter = "standard/edgerouter"
+KBRANCH_beaglebone = "standard/beaglebone"
+KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
+
+SRCREV_machine_genericx86    ?= "480ee599fb8df712c10dcf4b7aa6398b79f7d404"
+SRCREV_machine_genericx86-64 ?= "480ee599fb8df712c10dcf4b7aa6398b79f7d404"
+SRCREV_machine_edgerouter ?= "480ee599fb8df712c10dcf4b7aa6398b79f7d404"
+SRCREV_machine_beaglebone ?= "480ee599fb8df712c10dcf4b7aa6398b79f7d404"
+SRCREV_machine_mpc8315e-rdb ?= "88a703b15a7564704c3dc5d3c1237e0859897655"
+
+COMPATIBLE_MACHINE_genericx86 = "genericx86"
+COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
+COMPATIBLE_MACHINE_edgerouter = "edgerouter"
+COMPATIBLE_MACHINE_beaglebone = "beaglebone"
+COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
+
+LINUX_VERSION_genericx86 = "4.9.49"
+LINUX_VERSION_genericx86-64 = "4.9.49"
+LINUX_VERSION_edgerouter = "4.9.49"
+LINUX_VERSION_beaglebone = "4.9.49"
+LINUX_VERSION_mpc8315e-rdb = "4.9.49"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/wic/beaglebone.wks b/import-layers/yocto-poky/meta-yocto-bsp/wic/beaglebone.wks
new file mode 100644
index 0000000..0c09a95
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/wic/beaglebone.wks
@@ -0,0 +1,6 @@
+# short-description: Create SD card image for Beaglebone
+# long-description: Creates a partitioned SD card image for Beaglebone.
+# Boot files are located in the first vfat partition.
+
+part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4 --size 16
+part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/wic/edgerouter.wks b/import-layers/yocto-poky/meta-yocto-bsp/wic/edgerouter.wks
new file mode 100644
index 0000000..7176fe4
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/wic/edgerouter.wks
@@ -0,0 +1,4 @@
+# short-description: Create SD card image for Edgerouter
+# long-description: Create a partitioned SD card image for MIPS64 Edgerouter reference hardware.
+part /boot --source bootimg-partition --ondisk sda --fstype=vfat --label boot --active --align 4 --size 16
+part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 4
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/wic/genericx86.wks b/import-layers/yocto-poky/meta-yocto-bsp/wic/genericx86.wks
new file mode 100644
index 0000000..dab719c
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/wic/genericx86.wks
@@ -0,0 +1,7 @@
+# short-description: Create an EFI disk image for genericx86*
+# long-description: Creates a partitioned EFI disk image for genericx86* machines
+part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/wic/mpc8315e-rdb.wks b/import-layers/yocto-poky/meta-yocto-bsp/wic/mpc8315e-rdb.wks
new file mode 100644
index 0000000..d0cb607
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/wic/mpc8315e-rdb.wks
@@ -0,0 +1,4 @@
+# short-description: Create SD card image for MPC8315E-RDB
+# long-description: Create a partitioned SD card image for Freescale MPC8315E-RDB reference hardware.
+part /boot --source bootimg-partition --ondisk sdb --fstype=ext3 --label boot
+part / --source rootfs --ondisk sdb --fstype=ext3 --label root
diff --git a/import-layers/yocto-poky/meta/classes/allarch.bbclass b/import-layers/yocto-poky/meta/classes/allarch.bbclass
index ddc2a85..a7ce024 100644
--- a/import-layers/yocto-poky/meta/classes/allarch.bbclass
+++ b/import-layers/yocto-poky/meta/classes/allarch.bbclass
@@ -2,16 +2,12 @@
 # This class is used for architecture independent recipes/data files (usually scripts)
 #
 
-# Expand STAGING_DIR_HOST since for cross-canadian/native/nativesdk, this will
-# point elsewhere after these changes.
-STAGING_DIR_HOST := "${STAGING_DIR_HOST}"
-
 PACKAGE_ARCH = "all"
 
 python () {
     # Allow this class to be included but overridden - only set
     # the values if we're still "all" package arch.
-    if d.getVar("PACKAGE_ARCH", True) == "all":
+    if d.getVar("PACKAGE_ARCH") == "all":
         # No need for virtual/libc or a cross compiler
         d.setVar("INHIBIT_DEFAULT_DEPS","1")
 
@@ -25,13 +21,16 @@
         d.setVar("TARGET_AS_ARCH", "none")
         d.setVar("TARGET_FPU", "")
         d.setVar("TARGET_PREFIX", "")
-        d.setVar("PACKAGE_EXTRA_ARCHS", "")
+        # Expand PACKAGE_EXTRA_ARCHS since the staging code needs this
+        # (this removes any dependencies from the hash perspective)
+        d.setVar("PACKAGE_EXTRA_ARCHS", d.getVar("PACKAGE_EXTRA_ARCHS"))
         d.setVar("SDK_ARCH", "none")
         d.setVar("SDK_CC_ARCH", "none")
         d.setVar("TARGET_CPPFLAGS", "none")
         d.setVar("TARGET_CFLAGS", "none")
         d.setVar("TARGET_CXXFLAGS", "none")
         d.setVar("TARGET_LDFLAGS", "none")
+        d.setVar("POPULATESYSROOTDEPS", "")
 
         # Avoid this being unnecessarily different due to nuances of
         # the target machine that aren't important for "all" arch
@@ -47,6 +46,6 @@
         d.setVarFlag("emit_pkgdata", "vardepsexclude", "MULTILIB_VARIANTS")
         d.setVarFlag("write_specfile", "vardepsexclude", "MULTILIBS")
     elif bb.data.inherits_class('packagegroup', d) and not bb.data.inherits_class('nativesdk', d):
-        bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE", True))
+        bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE"))
 }
 
diff --git a/import-layers/yocto-poky/meta/classes/archiver.bbclass b/import-layers/yocto-poky/meta/classes/archiver.bbclass
index 188f8c0..18c5b96 100644
--- a/import-layers/yocto-poky/meta/classes/archiver.bbclass
+++ b/import-layers/yocto-poky/meta/classes/archiver.bbclass
@@ -52,10 +52,10 @@
 
 
 python () {
-    pn = d.getVar('PN', True)
-    assume_provided = (d.getVar("ASSUME_PROVIDED", True) or "").split()
+    pn = d.getVar('PN')
+    assume_provided = (d.getVar("ASSUME_PROVIDED") or "").split()
     if pn in assume_provided:
-        for p in d.getVar("PROVIDES", True).split():
+        for p in d.getVar("PROVIDES").split():
             if p != pn:
                 pn = p
                 break
@@ -67,18 +67,29 @@
     else:
         bb.debug(1, 'archiver: %s is included: %s' % (pn, reason))
 
+
+    # glibc-locale: do_fetch, do_unpack and do_patch tasks have been deleted,
+    # so avoid archiving source here.
+    if pn.startswith('glibc-locale'):
+        return
+
     # We just archive gcc-source for all the gcc related recipes
-    if d.getVar('BPN', True) in ['gcc', 'libgcc'] \
+    if d.getVar('BPN') in ['gcc', 'libgcc'] \
             and not pn.startswith('gcc-source'):
         bb.debug(1, 'archiver: %s is excluded, covered by gcc-source' % pn)
         return
 
-    ar_src = d.getVarFlag('ARCHIVER_MODE', 'src', True)
-    ar_dumpdata = d.getVarFlag('ARCHIVER_MODE', 'dumpdata', True)
-    ar_recipe = d.getVarFlag('ARCHIVER_MODE', 'recipe', True)
+    ar_src = d.getVarFlag('ARCHIVER_MODE', 'src')
+    ar_dumpdata = d.getVarFlag('ARCHIVER_MODE', 'dumpdata')
+    ar_recipe = d.getVarFlag('ARCHIVER_MODE', 'recipe')
 
     if ar_src == "original":
         d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_original' % pn)
+        # 'patched' and 'configured' invoke do_unpack_and_patch because
+        # do_ar_patched resp. do_ar_configured depend on it, but for 'original'
+        # we have to add it explicitly.
+        if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1':
+            d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_unpack_and_patch' % pn)
     elif ar_src == "patched":
         d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_patched' % pn)
     elif ar_src == "configured":
@@ -104,9 +115,9 @@
         d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_recipe' % pn)
 
     # Output the srpm package
-    ar_srpm = d.getVarFlag('ARCHIVER_MODE', 'srpm', True)
+    ar_srpm = d.getVarFlag('ARCHIVER_MODE', 'srpm')
     if ar_srpm == "1":
-        if d.getVar('PACKAGES', True) != '' and d.getVar('IMAGE_PKGTYPE', True) == 'rpm':
+        if d.getVar('PACKAGES') != '' and d.getVar('IMAGE_PKGTYPE') == 'rpm':
             d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_package_write_rpm' % pn)
             if ar_dumpdata == "1":
                 d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_dumpdata' % pn)
@@ -127,12 +138,12 @@
 
     import shutil, tempfile
 
-    if d.getVarFlag('ARCHIVER_MODE', 'src', True) != "original":
+    if d.getVarFlag('ARCHIVER_MODE', 'src') != "original":
         return
 
-    ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+    ar_outdir = d.getVar('ARCHIVER_OUTDIR')
     bb.note('Archiving the original source...')
-    urls = d.getVar("SRC_URI", True).split()
+    urls = d.getVar("SRC_URI").split()
     # destsuffix (git fetcher) and subdir (everything else) are allowed to be
     # absolute paths (for example, destsuffix=${S}/foobar).
     # That messes with unpacking inside our tmpdir below, because the fetchers
@@ -157,7 +168,7 @@
         if os.path.isfile(local):
             shutil.copy(local, ar_outdir)
         elif os.path.isdir(local):
-            tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR', True))
+            tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR'))
             fetch.unpack(tmpdir, (url,))
             # To handle recipes with more than one source, we add the "name"
             # URL parameter as suffix. We treat it as an error when
@@ -166,12 +177,18 @@
             # to be set when using the git fetcher, otherwise SRCREV cannot
             # be set separately for each URL.
             params = bb.fetch2.decodeurl(url)[5]
+            type = bb.fetch2.decodeurl(url)[0]
+            location = bb.fetch2.decodeurl(url)[2]
             name = params.get('name', '')
-            if name in tarball_suffix:
-                if not name:
-                    bb.fatal("Cannot determine archive names for original source because 'name' URL parameter is unset in more than one URL. Add it to at least one of these: %s %s" % (tarball_suffix[name], url))
-                else:
-                    bb.fatal("Cannot determine archive names for original source because 'name=' URL parameter '%s' is used twice. Make it unique in: %s %s" % (tarball_suffix[name], url))
+            if type.lower() == 'file':
+                name_tmp = location.rstrip("*").rstrip("/")
+                name = os.path.basename(name_tmp)
+            else:
+                if name in tarball_suffix:
+                    if not name:
+                        bb.fatal("Cannot determine archive names for original source because 'name' URL parameter is unset in more than one URL. Add it to at least one of these: %s %s" % (tarball_suffix[name], url))
+                    else:
+                        bb.fatal("Cannot determine archive names for original source because 'name=' URL parameter '%s' is used twice. Make it unique in: %s %s" % (tarball_suffix[name], url))
             tarball_suffix[name] = url
             create_tarball(d, tmpdir + '/.', name, ar_outdir)
 
@@ -191,28 +208,32 @@
 
 python do_ar_patched() {
 
-    if d.getVarFlag('ARCHIVER_MODE', 'src', True) != 'patched':
+    if d.getVarFlag('ARCHIVER_MODE', 'src') != 'patched':
         return
 
     # Get the ARCHIVER_OUTDIR before we reset the WORKDIR
-    ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
-    ar_workdir = d.getVar('ARCHIVER_WORKDIR', True)
+    ar_outdir = d.getVar('ARCHIVER_OUTDIR')
+    ar_workdir = d.getVar('ARCHIVER_WORKDIR')
     bb.note('Archiving the patched source...')
     d.setVar('WORKDIR', ar_workdir)
-    create_tarball(d, d.getVar('S', True), 'patched', ar_outdir)
+    create_tarball(d, d.getVar('S'), 'patched', ar_outdir)
 }
 
 python do_ar_configured() {
     import shutil
 
-    ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
-    if d.getVarFlag('ARCHIVER_MODE', 'src', True) == 'configured':
+    # Forcibly expand the sysroot paths as we're about to change WORKDIR
+    d.setVar('RECIPE_SYSROOT', d.getVar('RECIPE_SYSROOT'))
+    d.setVar('RECIPE_SYSROOT_NATIVE', d.getVar('RECIPE_SYSROOT_NATIVE'))
+
+    ar_outdir = d.getVar('ARCHIVER_OUTDIR')
+    if d.getVarFlag('ARCHIVER_MODE', 'src') == 'configured':
         bb.note('Archiving the configured source...')
-        pn = d.getVar('PN', True)
+        pn = d.getVar('PN')
         # "gcc-source-${PV}" recipes don't have "do_configure"
         # task, so we need to run "do_preconfigure" instead
         if pn.startswith("gcc-source-"):
-            d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR', True))
+            d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR'))
             bb.build.exec_func('do_preconfigure', d)
 
         # The libtool-native's do_configure will remove the
@@ -221,26 +242,26 @@
         # instead of.
         elif pn != 'libtool-native':
             # Change the WORKDIR to make do_configure run in another dir.
-            d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR', True))
+            d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR'))
             if bb.data.inherits_class('kernel-yocto', d):
                 bb.build.exec_func('do_kernel_configme', d)
             if bb.data.inherits_class('cmake', d):
                 bb.build.exec_func('do_generate_toolchain_file', d)
-            prefuncs = d.getVarFlag('do_configure', 'prefuncs', True)
+            prefuncs = d.getVarFlag('do_configure', 'prefuncs')
             for func in (prefuncs or '').split():
                 if func != "sysroot_cleansstate":
                     bb.build.exec_func(func, d)
             bb.build.exec_func('do_configure', d)
-            postfuncs = d.getVarFlag('do_configure', 'postfuncs', True)
+            postfuncs = d.getVarFlag('do_configure', 'postfuncs')
             for func in (postfuncs or '').split():
                 if func != "do_qa_configure":
                     bb.build.exec_func(func, d)
-        srcdir = d.getVar('S', True)
-        builddir = d.getVar('B', True)
+        srcdir = d.getVar('S')
+        builddir = d.getVar('B')
         if srcdir != builddir:
             if os.path.exists(builddir):
                 oe.path.copytree(builddir, os.path.join(srcdir, \
-                    'build.%s.ar_configured' % d.getVar('PF', True)))
+                    'build.%s.ar_configured' % d.getVar('PF')))
         create_tarball(d, srcdir, 'configured', ar_outdir)
 }
 
@@ -251,14 +272,14 @@
     import tarfile
 
     # Make sure we are only creating a single tarball for gcc sources
-    if (d.getVar('SRC_URI', True) == ""):
+    if (d.getVar('SRC_URI') == ""):
         return
 
     bb.utils.mkdirhier(ar_outdir)
     if suffix:
-        filename = '%s-%s.tar.gz' % (d.getVar('PF', True), suffix)
+        filename = '%s-%s.tar.gz' % (d.getVar('PF'), suffix)
     else:
-        filename = '%s.tar.gz' % d.getVar('PF', True)
+        filename = '%s.tar.gz' % d.getVar('PF')
     tarname = os.path.join(ar_outdir, filename)
 
     bb.note('Creating %s' % tarname)
@@ -279,57 +300,78 @@
     # exclude.
     src_patched = src + '.patched'
     oe.path.copyhardlinktree(src, src_patched)
-    for i in d.getVarFlag('ARCHIVER_MODE', 'diff-exclude', True).split():
+    for i in d.getVarFlag('ARCHIVER_MODE', 'diff-exclude').split():
         bb.utils.remove(os.path.join(src_orig, i), recurse=True)
         bb.utils.remove(os.path.join(src_patched, i), recurse=True)
 
     dirname = os.path.dirname(src)
     basename = os.path.basename(src)
-    os.chdir(dirname)
-    out_file = os.path.join(ar_outdir, '%s-diff.gz' % d.getVar('PF', True))
-    diff_cmd = 'diff -Naur %s.orig %s.patched | gzip -c > %s' % (basename, basename, out_file)
-    subprocess.call(diff_cmd, shell=True)
-    bb.utils.remove(src_patched, recurse=True)
+    bb.utils.mkdirhier(ar_outdir)
+    cwd = os.getcwd()
+    try:
+        os.chdir(dirname)
+        out_file = os.path.join(ar_outdir, '%s-diff.gz' % d.getVar('PF'))
+        diff_cmd = 'diff -Naur %s.orig %s.patched | gzip -c > %s' % (basename, basename, out_file)
+        subprocess.check_call(diff_cmd, shell=True)
+        bb.utils.remove(src_patched, recurse=True)
+    finally:
+        os.chdir(cwd)
 
 # Run do_unpack and do_patch
 python do_unpack_and_patch() {
-    if d.getVarFlag('ARCHIVER_MODE', 'src', True) not in \
+    if d.getVarFlag('ARCHIVER_MODE', 'src') not in \
             [ 'patched', 'configured'] and \
-            d.getVarFlag('ARCHIVER_MODE', 'diff', True) != '1':
+            d.getVarFlag('ARCHIVER_MODE', 'diff') != '1':
         return
-    ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
-    ar_workdir = d.getVar('ARCHIVER_WORKDIR', True)
-    pn = d.getVar('PN', True)
+    ar_outdir = d.getVar('ARCHIVER_OUTDIR')
+    ar_workdir = d.getVar('ARCHIVER_WORKDIR')
+    ar_sysroot_native = d.getVar('STAGING_DIR_NATIVE')
+    pn = d.getVar('PN')
 
     # The kernel class functions require it to be on work-shared, so we dont change WORKDIR
     if not (bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc-source')):
         # Change the WORKDIR to make do_unpack do_patch run in another dir.
         d.setVar('WORKDIR', ar_workdir)
+        # Restore the original path to recipe's native sysroot (it's relative to WORKDIR).
+        d.setVar('STAGING_DIR_NATIVE', ar_sysroot_native)
 
         # The changed 'WORKDIR' also caused 'B' changed, create dir 'B' for the
         # possibly requiring of the following tasks (such as some recipes's
         # do_patch required 'B' existed).
-        bb.utils.mkdirhier(d.getVar('B', True))
+        bb.utils.mkdirhier(d.getVar('B'))
 
         bb.build.exec_func('do_unpack', d)
 
     # Save the original source for creating the patches
-    if d.getVarFlag('ARCHIVER_MODE', 'diff', True) == '1':
-        src = d.getVar('S', True).rstrip('/')
+    if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1':
+        src = d.getVar('S').rstrip('/')
         src_orig = '%s.orig' % src
         oe.path.copytree(src, src_orig)
 
     # Make sure gcc and kernel sources are patched only once
-    if not (d.getVar('SRC_URI', True) == "" or (bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc-source'))):
+    if not (d.getVar('SRC_URI') == "" or (bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc-source'))):
         bb.build.exec_func('do_patch', d)
 
     # Create the patches
-    if d.getVarFlag('ARCHIVER_MODE', 'diff', True) == '1':
+    if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1':
         bb.note('Creating diff gz...')
         create_diff_gz(d, src_orig, src, ar_outdir)
         bb.utils.remove(src_orig, recurse=True)
 }
 
+# BBINCLUDED is special (excluded from basehash signature
+# calculation). Using it in a task signature can cause "basehash
+# changed" errors.
+#
+# Depending on BBINCLUDED also causes do_ar_recipe to run again
+# for unrelated changes, like adding or removing buildhistory.bbclass.
+#
+# For these reasons we ignore the dependency completely. The versioning
+# of the output file ensures that we create it each time the recipe
+# gets rebuilt, at least as long as a PR server is used. We also rely
+# on that mechanism to catch changes in the file content, because the
+# file content is not part of of the task signature either.
+do_ar_recipe[vardepsexclude] += "BBINCLUDED"
 python do_ar_recipe () {
     """
     archive the recipe, including .bb and .inc.
@@ -339,14 +381,14 @@
 
     require_re = re.compile( r"require\s+(.+)" )
     include_re = re.compile( r"include\s+(.+)" )
-    bbfile = d.getVar('FILE', True)
-    outdir = os.path.join(d.getVar('WORKDIR', True), \
-            '%s-recipe' % d.getVar('PF', True))
+    bbfile = d.getVar('FILE')
+    outdir = os.path.join(d.getVar('WORKDIR'), \
+            '%s-recipe' % d.getVar('PF'))
     bb.utils.mkdirhier(outdir)
     shutil.copy(bbfile, outdir)
 
-    pn = d.getVar('PN', True)
-    bbappend_files = d.getVar('BBINCLUDED', True).split()
+    pn = d.getVar('PN')
+    bbappend_files = d.getVar('BBINCLUDED').split()
     # If recipe name is aa, we need to match files like aa.bbappend and aa_1.1.bbappend
     # Files like aa1.bbappend or aa1_1.1.bbappend must be excluded.
     bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" % re.escape(pn))
@@ -356,7 +398,7 @@
             shutil.copy(file, outdir)
 
     dirname = os.path.dirname(bbfile)
-    bbpath = '%s:%s' % (dirname, d.getVar('BBPATH', True))
+    bbpath = '%s:%s' % (dirname, d.getVar('BBPATH'))
     f = open(bbfile, 'r')
     for line in f.readlines():
         incfile = None
@@ -365,12 +407,12 @@
         elif include_re.match(line):
             incfile = include_re.match(line).group(1)
         if incfile:
-            incfile = bb.data.expand(incfile, d)
+            incfile = d.expand(incfile)
             incfile = bb.utils.which(bbpath, incfile)
             if incfile:
                 shutil.copy(incfile, outdir)
 
-    create_tarball(d, outdir, 'recipe', d.getVar('ARCHIVER_OUTDIR', True))
+    create_tarball(d, outdir, 'recipe', d.getVar('ARCHIVER_OUTDIR'))
     bb.utils.remove(outdir, recurse=True)
 }
 
@@ -379,8 +421,8 @@
     dump environment data to ${PF}-showdata.dump
     """
 
-    dumpfile = os.path.join(d.getVar('ARCHIVER_OUTDIR', True), \
-        '%s-showdata.dump' % d.getVar('PF', True))
+    dumpfile = os.path.join(d.getVar('ARCHIVER_OUTDIR'), \
+        '%s-showdata.dump' % d.getVar('PF'))
     bb.note('Dumping metadata into %s' % dumpfile)
     with open(dumpfile, "w") as f:
         # emit variables and shell functions
@@ -419,7 +461,10 @@
 }
 
 python () {
-    # Add tasks in the correct order, specifically for linux-yocto to avoid race condition
+    # Add tasks in the correct order, specifically for linux-yocto to avoid race condition.
+    # sstatesig.py:sstate_rundepfilter has special support that excludes this dependency
+    # so that do_kernel_configme does not need to run again when do_unpack_and_patch
+    # gets added or removed (by adding or removing archiver.bbclass).
     if bb.data.inherits_class('kernel-yocto', d):
         bb.build.addtask('do_kernel_configme', 'do_configure', 'do_unpack_and_patch', d)
 }
diff --git a/import-layers/yocto-poky/meta/classes/autotools.bbclass b/import-layers/yocto-poky/meta/classes/autotools.bbclass
index c43ea9a..ac04a07 100644
--- a/import-layers/yocto-poky/meta/classes/autotools.bbclass
+++ b/import-layers/yocto-poky/meta/classes/autotools.bbclass
@@ -1,8 +1,8 @@
 def autotools_dep_prepend(d):
-    if d.getVar('INHIBIT_AUTOTOOLS_DEPS', True):
+    if d.getVar('INHIBIT_AUTOTOOLS_DEPS'):
         return ''
 
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
     deps = ''
 
     if pn in ['autoconf-native', 'automake-native', 'help2man-native']:
@@ -14,7 +14,7 @@
         if not bb.data.inherits_class('native', d) \
                         and not bb.data.inherits_class('nativesdk', d) \
                         and not bb.data.inherits_class('cross', d) \
-                        and not d.getVar('INHIBIT_DEFAULT_DEPS', True):
+                        and not d.getVar('INHIBIT_DEFAULT_DEPS'):
             deps += 'libtool-cross '
 
     return deps + 'gnu-config-native '
@@ -27,7 +27,7 @@
 # results for autoconf tests we cannot run at build time.
 export CONFIG_SITE = "${@siteinfo_get_files(d)}"
 
-acpaths = "default"
+acpaths ?= "default"
 EXTRA_AUTORECONF = "--exclude=autopoint"
 
 export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir}"
@@ -131,133 +131,18 @@
 
 EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
 
-do_configure[prefuncs] += "autotools_preconfigure autotools_copy_aclocals ${EXTRACONFFUNCS}"
+do_configure[prefuncs] += "autotools_preconfigure autotools_aclocals ${EXTRACONFFUNCS}"
 do_configure[postfuncs] += "autotools_postconfigure"
 
-ACLOCALDIR = "${WORKDIR}/aclocal-copy"
+ACLOCALDIR = "${STAGING_DATADIR}/aclocal"
+ACLOCALEXTRAPATH = ""
+ACLOCALEXTRAPATH_class-target = " -I ${STAGING_DATADIR_NATIVE}/aclocal/"
+ACLOCALEXTRAPATH_class-nativesdk = " -I ${STAGING_DATADIR_NATIVE}/aclocal/"
 
-python autotools_copy_aclocals () {
-    import copy
-
-    s = d.getVar("AUTOTOOLS_SCRIPT_PATH", True)
-    if not os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"):
-        if not d.getVar("AUTOTOOLS_COPYACLOCAL", False):
-            return
-
-    taskdepdata = d.getVar("BB_TASKDEPDATA", False)
-    #bb.warn(str(taskdepdata))
-    pn = d.getVar("PN", True)
-    aclocaldir = d.getVar("ACLOCALDIR", True)
-    oe.path.remove(aclocaldir)
-    bb.utils.mkdirhier(aclocaldir)
-    start = None
-    configuredeps = []
-    # Detect bitbake -b usage
-    # Everything but quilt-native would have dependencies
-    nodeps = (pn != "quilt-native")
-
-    for dep in taskdepdata:
-        data = taskdepdata[dep]
-        if data[1] == "do_configure" and data[0] == pn:
-            start = dep
-        if not nodeps and start:
-            break
-        if nodeps and data[0] != pn:
-            nodeps = False
-    if start is None:
-        bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
-
-    # We need to figure out which m4 files we need to expose to this do_configure task.
-    # This needs to match what would get restored from sstate, which is controlled 
-    # ultimately by calls from bitbake to setscene_depvalid().
-    # That function expects a setscene dependency tree. We build a dependency tree 
-    # condensed to do_populate_sysroot -> do_populate_sysroot dependencies, similar to 
-    # that used by setscene tasks. We can then call into setscene_depvalid() and decide
-    # which dependencies we can "see" and should expose the m4 files for.
-    setscenedeps = copy.deepcopy(taskdepdata)
-
-    start = set([start])
-
-    # Create collapsed do_populate_sysroot -> do_populate_sysroot tree
-    for dep in taskdepdata:
-        data = setscenedeps[dep]        
-        if data[1] != "do_populate_sysroot":
-            for dep2 in setscenedeps:
-                data2 = setscenedeps[dep2]
-                if dep in data2[3]:
-                    data2[3].update(setscenedeps[dep][3])
-                    data2[3].remove(dep)
-            if dep in start:
-                start.update(setscenedeps[dep][3])
-                start.remove(dep)
-            del setscenedeps[dep]
-
-    # Remove circular references
-    for dep in setscenedeps:
-        if dep in setscenedeps[dep][3]:
-            setscenedeps[dep][3].remove(dep)
-
-    # Direct dependencies should be present and can be depended upon
-    for dep in start:
-        configuredeps.append(setscenedeps[dep][0])
-
-    # Call into setscene_depvalid for each sub-dependency and only copy m4 files
-    # for ones that would be restored from sstate.
-    done = list(start)
-    next = list(start)
-    while next:
-        new = []
-        for dep in next:
-            data = setscenedeps[dep]
-            for datadep in data[3]:
-                if datadep in done:
-                    continue
-                taskdeps = {}
-                taskdeps[dep] = setscenedeps[dep][:2]
-                taskdeps[datadep] = setscenedeps[datadep][:2]
-                retval = setscene_depvalid(datadep, taskdeps, [], d)
-                if retval:
-                    bb.note("Skipping setscene dependency %s for m4 macro copying" % datadep)
-                    continue
-                done.append(datadep)
-                new.append(datadep)
-                configuredeps.append(setscenedeps[datadep][0])
-        next = new
-
-    cp = []
-    if nodeps:
-        bb.warn("autotools: Unable to find task dependencies, -b being used? Pulling in all m4 files")
-        for l in [d.expand("${STAGING_DATADIR_NATIVE}/aclocal/"), d.expand("${STAGING_DATADIR}/aclocal/")]:
-            cp.extend(os.path.join(l, f) for f in os.listdir(l))
-
-    for c in configuredeps:
-        if c.endswith("-native"):
-            manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}-%s.populate_sysroot" % c)
-        elif c.startswith("nativesdk-"):
-            manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${SDK_ARCH}_${SDK_OS}-%s.populate_sysroot" % c)
-        elif "-cross-" in c or "-crosssdk" in c:
-            continue
-        else:
-            manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${MACHINE}-%s.populate_sysroot" % c)
-        try:
-            f = open(manifest, "r")
-            for l in f:
-                if "/aclocal/" in l and l.strip().endswith(".m4"):
-                    cp.append(l.strip())
-                elif "config_site.d/" in l:
-                    cp.append(l.strip())
-        except:
-            bb.warn("%s not found" % manifest)
-
-    for c in cp:
-        t = os.path.join(aclocaldir, os.path.basename(c))
-        if not os.path.exists(t):
-            os.symlink(c, t)
-
+python autotools_aclocals () {
     # Refresh variable with cache files
     d.setVar("CONFIG_SITE", siteinfo_get_files(d, aclocalcache=True))
 }
-autotools_copy_aclocals[vardepsexclude] += "MACHINE SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA"
 
 CONFIGURE_FILES = "${S}/configure.in ${S}/configure.ac ${S}/config.h.in ${S}/acinclude.m4 Makefile.am"
 
@@ -279,6 +164,7 @@
 	if [ -e ${AUTOTOOLS_SCRIPT_PATH}/configure.in -o -e ${AUTOTOOLS_SCRIPT_PATH}/configure.ac ]; then
 		olddir=`pwd`
 		cd ${AUTOTOOLS_SCRIPT_PATH}
+		mkdir -p ${ACLOCALDIR}
 		ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/"
 		if [ x"${acpaths}" = xdefault ]; then
 			acpaths=
@@ -289,6 +175,7 @@
 		else
 			acpaths="${acpaths}"
 		fi
+		acpaths="$acpaths ${ACLOCALEXTRAPATH}"
 		AUTOV=`automake --version | sed -e '1{s/.* //;s/\.[0-9]\+$//};q'`
 		automake --version
 		echo "AUTOV is $AUTOV"
@@ -306,14 +193,14 @@
 		else
 			CONFIGURE_AC=configure.ac
 		fi
-		if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
-			if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
+		if grep -q "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC; then
+			if grep -q "sed.*POTFILES" $CONFIGURE_AC; then
 				: do nothing -- we still have an old unmodified configure.ac
 	    		else
 				bbnote Executing glib-gettextize --force --copy
 				echo "no" | glib-gettextize --force --copy
 			fi
-		elif grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
+		elif grep -q "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC; then
 			# We'd call gettextize here if it wasn't so broken...
 			cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
 			if [ -d ${S}/po/ ]; then
@@ -325,7 +212,7 @@
 			PRUNE_M4="$PRUNE_M4 gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4"
 		fi
 		mkdir -p m4
-		if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
+		if grep -q "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC; then
 			if ! echo "${DEPENDS}" | grep -q intltool-native; then
 				bbwarn "Missing DEPENDS on intltool-native"
 			fi
diff --git a/import-layers/yocto-poky/meta/classes/base.bbclass b/import-layers/yocto-poky/meta/classes/base.bbclass
index 024fe43..d95afb7 100644
--- a/import-layers/yocto-poky/meta/classes/base.bbclass
+++ b/import-layers/yocto-poky/meta/classes/base.bbclass
@@ -10,13 +10,13 @@
 inherit metadata_scm
 inherit logging
 
-OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath"
+OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license"
 OE_IMPORTS[type] = "list"
 
 def oe_import(d):
     import sys
 
-    bbpath = d.getVar("BBPATH", True).split(":")
+    bbpath = d.getVar("BBPATH").split(":")
     sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath]
 
     def inject(name, value):
@@ -37,7 +37,7 @@
 OE_IMPORTED := "${@oe_import(d)}"
 
 def lsb_distro_identifier(d):
-    adjust = d.getVar('LSB_DISTRO_ADJUST', True)
+    adjust = d.getVar('LSB_DISTRO_ADJUST')
     adjust_func = None
     if adjust:
         try:
@@ -72,7 +72,7 @@
     # we need that built is the responsibility of the patch function / class, not
     # the application.
     if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
-        if (d.getVar('HOST_SYS', True) != d.getVar('BUILD_SYS', True)):
+        if (d.getVar('HOST_SYS') != d.getVar('BUILD_SYS')):
             deps += " virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc "
     return deps
 
@@ -83,11 +83,11 @@
 FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}"
 # THISDIR only works properly with imediate expansion as it has to run
 # in the context of the location its used (:=)
-THISDIR = "${@os.path.dirname(d.getVar('FILE', True))}"
+THISDIR = "${@os.path.dirname(d.getVar('FILE'))}"
 
 def extra_path_elements(d):
     path = ""
-    elements = (d.getVar('EXTRANATIVEPATH', True) or "").split()
+    elements = (d.getVar('EXTRANATIVEPATH') or "").split()
     for e in elements:
         path = path + "${STAGING_BINDIR_NATIVE}/" + e + ":"
     return path
@@ -96,8 +96,11 @@
 
 def get_lic_checksum_file_list(d):
     filelist = []
-    lic_files = d.getVar("LIC_FILES_CHKSUM", True) or ''
-    tmpdir = d.getVar("TMPDIR", True)
+    lic_files = d.getVar("LIC_FILES_CHKSUM") or ''
+    tmpdir = d.getVar("TMPDIR")
+    s = d.getVar("S")
+    b = d.getVar("B")
+    workdir = d.getVar("WORKDIR")
 
     urls = lic_files.split()
     for url in urls:
@@ -109,13 +112,32 @@
                 raise bb.fetch.MalformedUrl(url)
 
             if path[0] == '/':
-                if path.startswith(tmpdir):
+                if path.startswith((tmpdir, s, b, workdir)):
                     continue
                 filelist.append(path + ":" + str(os.path.exists(path)))
         except bb.fetch.MalformedUrl:
-            bb.fatal(d.getVar('PN', True) + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
+            bb.fatal(d.getVar('PN') + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
     return " ".join(filelist)
 
+def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
+    tools = d.getVar(toolsvar).split()
+    origbbenv = d.getVar("BB_ORIGENV", False)
+    path = origbbenv.getVar("PATH")
+    bb.utils.mkdirhier(dest)
+    notfound = []
+    for tool in tools:
+        desttool = os.path.join(dest, tool)
+        if not os.path.exists(desttool):
+            srctool = bb.utils.which(path, tool, executable=True)
+            if "ccache" in srctool:
+                srctool = bb.utils.which(path, tool, executable=True, direction=1)
+            if srctool:
+                os.symlink(srctool, desttool)
+            else:
+                notfound.append(tool)
+    if notfound and fatal:
+        bb.fatal("The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:\n  %s" % " ".join(notfound))
+
 addtask fetch
 do_fetch[dirs] = "${DL_DIR}"
 do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
@@ -123,7 +145,7 @@
 do_fetch[vardeps] += "SRCREV"
 python base_do_fetch() {
 
-    src_uri = (d.getVar('SRC_URI', True) or "").split()
+    src_uri = (d.getVar('SRC_URI') or "").split()
     if len(src_uri) == 0:
         return
 
@@ -138,31 +160,31 @@
 do_unpack[dirs] = "${WORKDIR}"
 
 python () {
-    if d.getVar('S', True) != d.getVar('WORKDIR', True):
+    if d.getVar('S') != d.getVar('WORKDIR'):
         d.setVarFlag('do_unpack', 'cleandirs', '${S}')
     else:
         d.setVarFlag('do_unpack', 'cleandirs', os.path.join('${S}', 'patches'))
 }
 python base_do_unpack() {
-    src_uri = (d.getVar('SRC_URI', True) or "").split()
+    src_uri = (d.getVar('SRC_URI') or "").split()
     if len(src_uri) == 0:
         return
 
     try:
         fetcher = bb.fetch2.Fetch(src_uri, d)
-        fetcher.unpack(d.getVar('WORKDIR', True))
+        fetcher.unpack(d.getVar('WORKDIR'))
     except bb.fetch2.BBFetchException as e:
         bb.fatal(str(e))
 }
 
 def pkgarch_mapping(d):
     # Compatibility mappings of TUNE_PKGARCH (opt in)
-    if d.getVar("PKGARCHCOMPAT_ARMV7A", True):
-        if d.getVar("TUNE_PKGARCH", True) == "armv7a-vfp-neon":
+    if d.getVar("PKGARCHCOMPAT_ARMV7A"):
+        if d.getVar("TUNE_PKGARCH") == "armv7a-vfp-neon":
             d.setVar("TUNE_PKGARCH", "armv7a")
 
 def get_layers_branch_rev(d):
-    layers = (d.getVar("BBLAYERS", True) or "").split()
+    layers = (d.getVar("BBLAYERS") or "").split()
     layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
         base_get_metadata_git_branch(i, None).strip(), \
         base_get_metadata_git_revision(i, None)) \
@@ -189,7 +211,7 @@
 def buildcfg_vars(d):
     statusvars = oe.data.typed_value('BUILDCFG_VARS', d)
     for var in statusvars:
-        value = d.getVar(var, True)
+        value = d.getVar(var)
         if value is not None:
             yield '%-17s = "%s"' % (var, value)
 
@@ -197,7 +219,7 @@
     needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", d)
     pesteruser = []
     for v in needed_vars:
-        val = d.getVar(v, True)
+        val = d.getVar(v)
         if not val or val == 'INVALID':
             pesteruser.append(v)
 
@@ -216,10 +238,12 @@
         pkgarch_mapping(e.data)
         oe.utils.features_backfill("DISTRO_FEATURES", e.data)
         oe.utils.features_backfill("MACHINE_FEATURES", e.data)
+        # Works with the line in layer.conf which changes PATH to point here
+        setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS', d)
+        setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS_NONFATAL', d, fatal=False)
 
     if isinstance(e, bb.event.BuildStarted):
         localdata = bb.data.createCopy(e.data)
-        bb.data.update_data(localdata)
         statuslines = []
         for func in oe.data.typed_value('BUILDCFG_FUNCS', localdata):
             g = globals()
@@ -230,7 +254,7 @@
                 if flines:
                     statuslines.extend(flines)
 
-        statusheader = e.data.getVar('BUILDCFG_HEADER', True)
+        statusheader = e.data.getVar('BUILDCFG_HEADER')
         if statusheader:
             bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
 
@@ -238,7 +262,7 @@
     # target ones and we'd see dulpicate key names overwriting each other
     # for various PREFERRED_PROVIDERS
     if isinstance(e, bb.event.RecipePreFinalise):
-        if e.data.getVar("TARGET_PREFIX", True) == e.data.getVar("SDK_PREFIX", True):
+        if e.data.getVar("TARGET_PREFIX") == e.data.getVar("SDK_PREFIX"):
             e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils")
             e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial")
             e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc")
@@ -264,14 +288,14 @@
         # sysroot since they're now "unreachable". This makes switching virtual/kernel work in 
         # particular.
         #
-        pn = d.getVar('PN', True)
+        pn = d.getVar('PN')
         source_mirror_fetch = d.getVar('SOURCE_MIRROR_FETCH', False)
         if not source_mirror_fetch:
-            provs = (d.getVar("PROVIDES", True) or "").split()
-            multiwhitelist = (d.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
+            provs = (d.getVar("PROVIDES") or "").split()
+            multiwhitelist = (d.getVar("MULTI_PROVIDER_WHITELIST") or "").split()
             for p in provs:
                 if p.startswith("virtual/") and p not in multiwhitelist:
-                    profprov = d.getVar("PREFERRED_PROVIDER_" + p, True)
+                    profprov = d.getVar("PREFERRED_PROVIDER_" + p)
                     if profprov and pn != profprov:
                         raise bb.parse.SkipPackage("PREFERRED_PROVIDER_%s set to %s, not %s" % (p, profprov, pn))
 }
@@ -281,7 +305,7 @@
 
 addtask configure after do_patch
 do_configure[dirs] = "${B}"
-do_configure[deptask] = "do_populate_sysroot"
+do_prepare_recipe_sysroot[deptask] = "do_populate_sysroot"
 base_do_configure() {
 	if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
 		if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" ]; then
@@ -333,9 +357,9 @@
     tos = []
     tvs = []
 
-    archs.append(d.getVar("PACKAGE_ARCHS", True).split())
-    tos.append(d.getVar("TARGET_OS", True))
-    tvs.append(d.getVar("TARGET_VENDOR", True))
+    archs.append(d.getVar("PACKAGE_ARCHS").split())
+    tos.append(d.getVar("TARGET_OS"))
+    tvs.append(d.getVar("TARGET_VENDOR"))
 
     def settriplet(d, varname, archs, tos, tvs):
         triplets = []
@@ -347,16 +371,15 @@
 
     settriplet(d, "PKGTRIPLETS", archs, tos, tvs)
 
-    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+    variants = d.getVar("MULTILIB_VARIANTS") or ""
     for item in variants.split():
         localdata = bb.data.createCopy(d)
         overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
         localdata.setVar("OVERRIDES", overrides)
-        bb.data.update_data(localdata)
 
-        archs.append(localdata.getVar("PACKAGE_ARCHS", True).split())
-        tos.append(localdata.getVar("TARGET_OS", True))
-        tvs.append(localdata.getVar("TARGET_VENDOR", True))
+        archs.append(localdata.getVar("PACKAGE_ARCHS").split())
+        tos.append(localdata.getVar("TARGET_OS"))
+        tvs.append(localdata.getVar("TARGET_VENDOR"))
 
     settriplet(d, "PKGMLTRIPLETS", archs, tos, tvs)
 
@@ -371,10 +394,10 @@
     # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends"
     pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
     if pkgconfigflags:
-        pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
-        pn = d.getVar("PN", True)
+        pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
+        pn = d.getVar("PN")
 
-        mlprefix = d.getVar("MLPREFIX", True)
+        mlprefix = d.getVar("MLPREFIX")
 
         def expandFilter(appends, extension, prefix):
             appends = bb.utils.explode_deps(d.expand(" ".join(appends)))
@@ -416,7 +439,7 @@
             num = len(items)
             if num > 4:
                 bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend can be specified!"
-                    % (d.getVar('PN', True), flag))
+                    % (d.getVar('PN'), flag))
 
             if flag in pkgconfig:
                 if num >= 3 and items[2]:
@@ -431,8 +454,8 @@
         appendVar('RDEPENDS_${PN}', extrardeps)
         appendVar('PACKAGECONFIG_CONFARGS', extraconf)
 
-    pn = d.getVar('PN', True)
-    license = d.getVar('LICENSE', True)
+    pn = d.getVar('PN')
+    license = d.getVar('LICENSE')
     if license == "INVALID":
         bb.fatal('This recipe does not have the LICENSE field set (%s)' % pn)
 
@@ -462,26 +485,26 @@
         d.setVarFlag('do_devshell', 'fakeroot', '1')
         d.appendVarFlag('do_devshell', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
 
-    need_machine = d.getVar('COMPATIBLE_MACHINE', True)
+    need_machine = d.getVar('COMPATIBLE_MACHINE')
     if need_machine:
         import re
-        compat_machines = (d.getVar('MACHINEOVERRIDES', True) or "").split(":")
+        compat_machines = (d.getVar('MACHINEOVERRIDES') or "").split(":")
         for m in compat_machines:
             if re.match(need_machine, m):
                 break
         else:
-            raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % d.getVar('MACHINE', True))
+            raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % d.getVar('MACHINE'))
 
     source_mirror_fetch = d.getVar('SOURCE_MIRROR_FETCH', False)
     if not source_mirror_fetch:
-        need_host = d.getVar('COMPATIBLE_HOST', True)
+        need_host = d.getVar('COMPATIBLE_HOST')
         if need_host:
             import re
-            this_host = d.getVar('HOST_SYS', True)
+            this_host = d.getVar('HOST_SYS')
             if not re.match(need_host, this_host):
                 raise bb.parse.SkipPackage("incompatible with host %s (not in COMPATIBLE_HOST)" % this_host)
 
-        bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE', True) or "").split()
+        bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split()
 
         check_license = False if pn.startswith("nativesdk-") else True
         for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}",
@@ -500,21 +523,21 @@
             for lic in bad_licenses:
                 spdx_license = return_spdx(d, lic)
                 for w in ["LGPLv2_WHITELIST_", "WHITELIST_"]:
-                    whitelist.extend((d.getVar(w + lic, True) or "").split())
+                    whitelist.extend((d.getVar(w + lic) or "").split())
                     if spdx_license:
-                        whitelist.extend((d.getVar(w + spdx_license, True) or "").split())
+                        whitelist.extend((d.getVar(w + spdx_license) or "").split())
                     '''
                     We need to track what we are whitelisting and why. If pn is
                     incompatible we need to be able to note that the image that
                     is created may infact contain incompatible licenses despite
                     INCOMPATIBLE_LICENSE being set.
                     '''
-                    incompatwl.extend((d.getVar(w + lic, True) or "").split())
+                    incompatwl.extend((d.getVar(w + lic) or "").split())
                     if spdx_license:
-                        incompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
+                        incompatwl.extend((d.getVar(w + spdx_license) or "").split())
 
             if not pn in whitelist:
-                pkgs = d.getVar('PACKAGES', True).split()
+                pkgs = d.getVar('PACKAGES').split()
                 skipped_pkgs = []
                 unskipped_pkgs = []
                 for pkg in pkgs:
@@ -526,13 +549,13 @@
                 if unskipped_pkgs:
                     for pkg in skipped_pkgs:
                         bb.debug(1, "SKIPPING the package " + pkg + " at do_rootfs because it's " + license)
-                        mlprefix = d.getVar('MLPREFIX', True)
+                        mlprefix = d.getVar('MLPREFIX')
                         d.setVar('LICENSE_EXCLUSION-' + mlprefix + pkg, 1)
                     for pkg in unskipped_pkgs:
                         bb.debug(1, "INCLUDING the package " + pkg)
                 elif all_skipped or incompatible_license(d, bad_licenses):
                     bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, license))
-                    raise bb.parse.SkipPackage("incompatible with license %s" % license)
+                    raise bb.parse.SkipPackage("it has an incompatible license: %s" % license)
             elif pn in whitelist:
                 if pn in incompatwl:
                     bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
@@ -542,8 +565,8 @@
         # matching of license expressions - just check that all license strings
         # in LICENSE_<pkg> are found in LICENSE.
         license_set = oe.license.list_licenses(license)
-        for pkg in d.getVar('PACKAGES', True).split():
-            pkg_license = d.getVar('LICENSE_' + pkg, True)
+        for pkg in d.getVar('PACKAGES').split():
+            pkg_license = d.getVar('LICENSE_' + pkg)
             if pkg_license:
                 unlisted = oe.license.list_licenses(pkg_license) - license_set
                 if unlisted:
@@ -551,7 +574,7 @@
                             "listed in LICENSE" % (pkg, ' '.join(unlisted)))
 
     needsrcrev = False
-    srcuri = d.getVar('SRC_URI', True)
+    srcuri = d.getVar('SRC_URI')
     for uri in srcuri.split():
         (scheme, _ , path) = bb.fetch.decodeurl(uri)[:3]
 
@@ -611,8 +634,8 @@
     set_packagetriplet(d)
 
     # 'multimachine' handling
-    mach_arch = d.getVar('MACHINE_ARCH', True)
-    pkg_arch = d.getVar('PACKAGE_ARCH', True)
+    mach_arch = d.getVar('MACHINE_ARCH')
+    pkg_arch = d.getVar('PACKAGE_ARCH')
 
     if (pkg_arch == mach_arch):
         # Already machine specific - nothing further to do
@@ -622,11 +645,11 @@
     # We always try to scan SRC_URI for urls with machine overrides
     # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
     #
-    override = d.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', True)
+    override = d.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH')
     if override != '0':
         paths = []
-        fpaths = (d.getVar('FILESPATH', True) or '').split(':')
-        machine = d.getVar('MACHINE', True)
+        fpaths = (d.getVar('FILESPATH') or '').split(':')
+        machine = d.getVar('MACHINE')
         for p in fpaths:
             if os.path.basename(p) == machine and os.path.isdir(p):
                 paths.append(p)
@@ -643,16 +666,16 @@
                         d.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}")
                         return
 
-    packages = d.getVar('PACKAGES', True).split()
+    packages = d.getVar('PACKAGES').split()
     for pkg in packages:
-        pkgarch = d.getVar("PACKAGE_ARCH_%s" % pkg, True)
+        pkgarch = d.getVar("PACKAGE_ARCH_%s" % pkg)
 
         # We could look for != PACKAGE_ARCH here but how to choose
         # if multiple differences are present?
         # Look through PACKAGE_ARCHS for the priority order?
         if pkgarch and pkgarch == mach_arch:
             d.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}")
-            bb.warn("Recipe %s is marked as only being architecture specific but seems to have machine specific packages?! The recipe may as well mark itself as machine specific directly." % d.getVar("PN", True))
+            bb.warn("Recipe %s is marked as only being architecture specific but seems to have machine specific packages?! The recipe may as well mark itself as machine specific directly." % d.getVar("PN"))
 }
 
 addtask cleansstate after do_clean
@@ -663,7 +686,7 @@
 do_cleansstate[nostamp] = "1"
 
 python do_cleanall() {
-    src_uri = (d.getVar('SRC_URI', True) or "").split()
+    src_uri = (d.getVar('SRC_URI') or "").split()
     if len(src_uri) == 0:
         return
 
diff --git a/import-layers/yocto-poky/meta/classes/binconfig-disabled.bbclass b/import-layers/yocto-poky/meta/classes/binconfig-disabled.bbclass
index 602a669..096b670 100644
--- a/import-layers/yocto-poky/meta/classes/binconfig-disabled.bbclass
+++ b/import-layers/yocto-poky/meta/classes/binconfig-disabled.bbclass
@@ -15,6 +15,7 @@
 		echo "echo 'ERROR: $x should not be used, use an alternative such as pkg-config' >&2" >> ${D}$x
 		echo "echo '--should-not-have-used-$x'" >> ${D}$x
 		echo "exit 1" >> ${D}$x
+		chmod +x ${D}$x
 	done
 }
 
diff --git a/import-layers/yocto-poky/meta/classes/binconfig.bbclass b/import-layers/yocto-poky/meta/classes/binconfig.bbclass
index cbc4173..39c3e2b 100644
--- a/import-layers/yocto-poky/meta/classes/binconfig.bbclass
+++ b/import-layers/yocto-poky/meta/classes/binconfig.bbclass
@@ -13,16 +13,16 @@
         s += " -e 's:=%s${exec_prefix}/:=\\1OEEXECPREFIX/:'" % optional_quote
         s += " -e 's:-L${libdir}:-LOELIBDIR:;'"
         s += " -e 's:-I${includedir}:-IOEINCDIR:;'"
+        s += " -e 's:-L${WORKDIR}:-LOELIBDIR:'"
+        s += " -e 's:-I${WORKDIR}:-IOEINCDIR:'"
         s += " -e 's:OEBASELIBDIR:${STAGING_BASELIBDIR}:;'"
         s += " -e 's:OELIBDIR:${STAGING_LIBDIR}:;'"
         s += " -e 's:OEINCDIR:${STAGING_INCDIR}:;'"
         s += " -e 's:OEDATADIR:${STAGING_DATADIR}:'"
         s += " -e 's:OEPREFIX:${STAGING_DIR_HOST}${prefix}:'"
         s += " -e 's:OEEXECPREFIX:${STAGING_DIR_HOST}${exec_prefix}:'"
-        s += " -e 's:-I${WORKDIR}:-I${STAGING_INCDIR}:'"
-        s += " -e 's:-L${WORKDIR}:-L${STAGING_LIBDIR}:'"
-        if bb.data.getVar("OE_BINCONFIG_EXTRA_MANGLE", d):
-            s += bb.data.getVar("OE_BINCONFIG_EXTRA_MANGLE", d)
+        if d.getVar("OE_BINCONFIG_EXTRA_MANGLE", False):
+            s += d.getVar("OE_BINCONFIG_EXTRA_MANGLE")
 
     return s
 
diff --git a/import-layers/yocto-poky/meta/classes/blacklist.bbclass b/import-layers/yocto-poky/meta/classes/blacklist.bbclass
index a0141a8..e58564c 100644
--- a/import-layers/yocto-poky/meta/classes/blacklist.bbclass
+++ b/import-layers/yocto-poky/meta/classes/blacklist.bbclass
@@ -12,33 +12,8 @@
 #   PNBLACKLIST[pn] = "message"
 #
 
-# Cope with PNBLACKLIST flags for multilib case
-addhandler blacklist_multilib_eventhandler
-blacklist_multilib_eventhandler[eventmask] = "bb.event.ConfigParsed"
-python blacklist_multilib_eventhandler() {
-    multilibs = e.data.getVar('MULTILIBS', True)
-    if not multilibs:
-        return
-
-    # this block has been copied from base.bbclass so keep it in sync
-    prefixes = []
-    for ext in multilibs.split():
-        eext = ext.split(':')
-        if len(eext) > 1 and eext[0] == 'multilib':
-            prefixes.append(eext[1])
-
-    blacklists = e.data.getVarFlags('PNBLACKLIST') or {}
-    for pkg, reason in blacklists.items():
-        if pkg.endswith(("-native", "-crosssdk")) or pkg.startswith(("nativesdk-", "virtual/nativesdk-")) or 'cross-canadian' in pkg:
-            continue
-        for p in prefixes:
-            newpkg = p + "-" + pkg
-            if not e.data.getVarFlag('PNBLACKLIST', newpkg, True):
-                e.data.setVarFlag('PNBLACKLIST', newpkg, reason)
-}
-
 python () {
-    blacklist = d.getVarFlag('PNBLACKLIST', d.getVar('PN', True), True)
+    blacklist = d.getVarFlag('PNBLACKLIST', d.getVar('PN'))
 
     if blacklist:
         raise bb.parse.SkipPackage("Recipe is blacklisted: %s" % (blacklist))
diff --git a/import-layers/yocto-poky/meta/classes/bugzilla.bbclass b/import-layers/yocto-poky/meta/classes/bugzilla.bbclass
index 3fc8956..8909c27 100644
--- a/import-layers/yocto-poky/meta/classes/bugzilla.bbclass
+++ b/import-layers/yocto-poky/meta/classes/bugzilla.bbclass
@@ -110,14 +110,14 @@
         return
 
     if name == "TaskFailed":
-        xmlrpc  = data.getVar("BUGZILLA_XMLRPC", True)
-        user    = data.getVar("BUGZILLA_USER", True)
-        passw   = data.getVar("BUGZILLA_PASS", True)
-        product = data.getVar("BUGZILLA_PRODUCT", True)
-        compon  = data.getVar("BUGZILLA_COMPONENT", True)
-        version = data.getVar("BUGZILLA_VERSION", True)
+        xmlrpc  = data.getVar("BUGZILLA_XMLRPC")
+        user    = data.getVar("BUGZILLA_USER")
+        passw   = data.getVar("BUGZILLA_PASS")
+        product = data.getVar("BUGZILLA_PRODUCT")
+        compon  = data.getVar("BUGZILLA_COMPONENT")
+        version = data.getVar("BUGZILLA_VERSION")
 
-        proxy   = data.getVar('http_proxy', True )
+        proxy   = data.getVar('http_proxy')
         if (proxy):
             import urllib2
             s, u, p, hostport = urllib2._parse_proxy(proxy)
@@ -133,14 +133,14 @@
             'component': compon}
 
         # evil hack to figure out what is going on
-        debug_file = open(os.path.join(data.getVar("TMPDIR", True),"..","bugzilla-log"),"a")
+        debug_file = open(os.path.join(data.getVar("TMPDIR"),"..","bugzilla-log"),"a")
 
         file = None
-        bugname = "%(package)s-%(pv)s-autobuild" % { "package" : data.getVar("PN", True),
-                                                           "pv"      : data.getVar("PV", True),
+        bugname = "%(package)s-%(pv)s-autobuild" % { "package" : data.getVar("PN"),
+                                                           "pv"      : data.getVar("PV"),
                                                            }
-        log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T', True), event.task))
-        text     = "The %s step in %s failed at %s for machine %s" % (e.task, data.getVar("PN", True), data.getVar('DATETIME', True), data.getVar( 'MACHINE', True ) )
+        log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T'), event.task))
+        text     = "The %s step in %s failed at %s for machine %s" % (e.task, data.getVar("PN"), data.getVar('DATETIME'), data.getVar('MACHINE') )
         if len(log_file) != 0:
             print >> debug_file, "Adding log file %s" % log_file[0]
             file = open(log_file[0], 'r')
@@ -168,7 +168,7 @@
 
         if bug_number and log:
             print >> debug_file, "The bug is known as '%s'" % bug_number
-            desc = "Build log for machine %s" % (data.getVar('MACHINE', True))
+            desc = "Build log for machine %s" % (data.getVar('MACHINE'))
             if not bugzilla_create_attachment(debug_file, server, args.copy(), bug_number, text, log_file[0], log, desc):
                  print >> debug_file, "Failed to attach the build log for bug #%s" % bug_number
             else:
diff --git a/import-layers/yocto-poky/meta/classes/buildhistory.bbclass b/import-layers/yocto-poky/meta/classes/buildhistory.bbclass
index 3a5bc2c..3823c66 100644
--- a/import-layers/yocto-poky/meta/classes/buildhistory.bbclass
+++ b/import-layers/yocto-poky/meta/classes/buildhistory.bbclass
@@ -47,6 +47,11 @@
 # then the value added to SSTATEPOSTINSTFUNCS:
 SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory"
 
+# Similarly for our function that gets the output signatures
+SSTATEPOSTUNPACKFUNCS_append = " buildhistory_emit_outputsigs"
+sstate_installpkgdir[vardepsexclude] += "buildhistory_emit_outputsigs"
+SSTATEPOSTUNPACKFUNCS[vardepvalueexclude] .= "| buildhistory_emit_outputsigs"
+
 # All items excepts those listed here will be removed from a recipe's
 # build history directory by buildhistory_emit_pkghistory(). This is
 # necessary because some of these items (package directories, files that
@@ -64,18 +69,18 @@
 # Write out metadata about this package for comparison when writing future packages
 #
 python buildhistory_emit_pkghistory() {
-    if not d.getVar('BB_CURRENTTASK', True) in ['packagedata', 'packagedata_setscene']:
+    if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']:
         return 0
 
-    if not "package" in (d.getVar('BUILDHISTORY_FEATURES', True) or "").split():
+    if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
         return 0
 
     import re
     import json
     import errno
 
-    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
-    oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE', True)
+    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
+    oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE')
 
     class RecipeInfo:
         def __init__(self, name):
@@ -86,6 +91,7 @@
             self.depends = ""
             self.packages = ""
             self.srcrev = ""
+            self.layer = ""
 
 
     class PackageInfo:
@@ -182,12 +188,13 @@
         items.sort()
         return ' '.join(items)
 
-    pn = d.getVar('PN', True)
-    pe = d.getVar('PE', True) or "0"
-    pv = d.getVar('PV', True)
-    pr = d.getVar('PR', True)
+    pn = d.getVar('PN')
+    pe = d.getVar('PE') or "0"
+    pv = d.getVar('PV')
+    pr = d.getVar('PR')
+    layer = bb.utils.get_file_layer(d.getVar('FILE', True), d)
 
-    pkgdata_dir = d.getVar('PKGDATA_DIR', True)
+    pkgdata_dir = d.getVar('PKGDATA_DIR')
     packages = ""
     try:
         with open(os.path.join(pkgdata_dir, pn)) as f:
@@ -203,7 +210,7 @@
             raise
 
     packagelist = packages.split()
-    preserve = d.getVar('BUILDHISTORY_PRESERVE', True).split()
+    preserve = d.getVar('BUILDHISTORY_PRESERVE').split()
     if not os.path.exists(pkghistdir):
         bb.utils.mkdirhier(pkghistdir)
     else:
@@ -223,11 +230,12 @@
     rcpinfo.pe = pe
     rcpinfo.pv = pv
     rcpinfo.pr = pr
-    rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS', True) or ""))
+    rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS') or ""))
     rcpinfo.packages = packages
+    rcpinfo.layer = layer
     write_recipehistory(rcpinfo, d)
 
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
     for pkg in packagelist:
         pkgdata = {}
         with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
@@ -289,11 +297,46 @@
     bb.build.exec_func("buildhistory_list_pkg_files", d)
 }
 
+python buildhistory_emit_outputsigs() {
+    if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
+        return
+
+    import hashlib
+
+    taskoutdir = os.path.join(d.getVar('BUILDHISTORY_DIR'), 'task', 'output')
+    bb.utils.mkdirhier(taskoutdir)
+    currenttask = d.getVar('BB_CURRENTTASK')
+    pn = d.getVar('PN')
+    taskfile = os.path.join(taskoutdir, '%s.%s' % (pn, currenttask))
+
+    cwd = os.getcwd()
+    filesigs = {}
+    for root, _, files in os.walk(cwd):
+        for fname in files:
+            if fname == 'fixmepath':
+                continue
+            fullpath = os.path.join(root, fname)
+            try:
+                if os.path.islink(fullpath):
+                    sha256 = hashlib.sha256(os.readlink(fullpath).encode('utf-8')).hexdigest()
+                elif os.path.isfile(fullpath):
+                    sha256 = bb.utils.sha256_file(fullpath)
+                else:
+                    continue
+            except OSError:
+                bb.warn('buildhistory: unable to read %s to get output signature' % fullpath)
+                continue
+            filesigs[os.path.relpath(fullpath, cwd)] = sha256
+    with open(taskfile, 'w') as f:
+        for fpath, fsig in sorted(filesigs.items(), key=lambda item: item[0]):
+            f.write('%s %s\n' % (fpath, fsig))
+}
+
 
 def write_recipehistory(rcpinfo, d):
     bb.debug(2, "Writing recipe history")
 
-    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
 
     infofile = os.path.join(pkghistdir, "latest")
     with open(infofile, "w") as f:
@@ -303,12 +346,13 @@
         f.write(u"PR = %s\n" %  rcpinfo.pr)
         f.write(u"DEPENDS = %s\n" %  rcpinfo.depends)
         f.write(u"PACKAGES = %s\n" %  rcpinfo.packages)
+        f.write(u"LAYER = %s\n" %  rcpinfo.layer)
 
 
 def write_pkghistory(pkginfo, d):
     bb.debug(2, "Writing package history for package %s" % pkginfo.name)
 
-    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
 
     pkgpath = os.path.join(pkghistdir, pkginfo.name)
     if not os.path.exists(pkgpath):
@@ -369,7 +413,7 @@
         pkgs = sdk_list_installed_packages(d, rootfs_type == "sdk_target")
 
     for output_type, output_file in process_list:
-        output_file_full = os.path.join(d.getVar('WORKDIR', True), output_file)
+        output_file_full = os.path.join(d.getVar('WORKDIR'), output_file)
 
         with open(output_file_full, 'w') as output:
             output.write(format_pkg_list(pkgs, output_type))
@@ -402,19 +446,26 @@
 
 	# Produce dependency graph
 	# First, quote each name to handle characters that cause issues for dot
-	sed 's:\([^| ]*\):"\1":g' ${WORKDIR}/bh_installed_pkgs_deps.txt > $1/depends.tmp && \
+	sed 's:\([^| ]*\):"\1":g' ${WORKDIR}/bh_installed_pkgs_deps.txt > $1/depends.tmp &&
 		rm ${WORKDIR}/bh_installed_pkgs_deps.txt
-	# Change delimiter from pipe to -> and set style for recommend lines
-	sed -i -e 's:|: -> :' -e 's:"\[REC\]":[style=dotted]:' -e 's:$:;:' $1/depends.tmp
+	# Remove lines with rpmlib(...) and config(...) dependencies, change the
+	# delimiter from pipe to "->", set the style for recommend lines and
+	# turn versioned dependencies into edge labels.
+	sed -i -e '/rpmlib(/d' \
+	       -e '/config(/d' \
+	       -e 's:|: -> :' \
+	       -e 's:"\[REC\]":[style=dotted]:' \
+	       -e 's:"\([<>=]\+\)" "\([^"]*\)":[label="\1 \2"]:' \
+		$1/depends.tmp
 	# Add header, sorted and de-duped contents and footer and then delete the temp file
 	printf "digraph depends {\n    node [shape=plaintext]\n" > $1/depends.dot
-	cat $1/depends.tmp | sort | uniq >> $1/depends.dot
+	cat $1/depends.tmp | sort -u >> $1/depends.dot
 	echo "}" >>  $1/depends.dot
 	rm $1/depends.tmp
 
 	# Produce installed package sizes list
 	oe-pkgdata-util -p ${PKGDATA_DIR} read-value "PKGSIZE" -n -f $pkgcache > $1/installed-package-sizes.tmp
-	cat $1/installed-package-sizes.tmp | awk '{print $2 "\tKiB " $1}' | sort -n -r > $1/installed-package-sizes.txt
+	cat $1/installed-package-sizes.tmp | awk '{print $2 "\tKiB\t" $1}' | sort -n -r > $1/installed-package-sizes.txt
 	rm $1/installed-package-sizes.tmp
 
 	# We're now done with the cache, delete it
@@ -550,7 +601,9 @@
 python buildhistory_get_extra_sdkinfo() {
     import operator
     import math
-    if d.getVar('BB_CURRENTTASK', True) == 'populate_sdk_ext':
+
+    if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext' and \
+            "sdk" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
         tasksizes = {}
         filesizes = {}
         for root, _, files in os.walk(d.expand('${SDK_OUTPUT}/${SDKPATH}/sstate-cache')):
@@ -573,10 +626,14 @@
 
 # By using ROOTFS_POSTUNINSTALL_COMMAND we get in after uninstallation of
 # unneeded packages but before the removal of packaging files
-ROOTFS_POSTUNINSTALL_COMMAND += " buildhistory_list_installed_image ;\
-                                buildhistory_get_image_installed ; "
+ROOTFS_POSTUNINSTALL_COMMAND += "buildhistory_list_installed_image ;"
+ROOTFS_POSTUNINSTALL_COMMAND += "buildhistory_get_image_installed ;"
+ROOTFS_POSTUNINSTALL_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_image ;| buildhistory_get_image_installed ;"
+ROOTFS_POSTUNINSTALL_COMMAND[vardepsexclude] += "buildhistory_list_installed_image buildhistory_get_image_installed"
 
-IMAGE_POSTPROCESS_COMMAND += " buildhistory_get_imageinfo ; "
+IMAGE_POSTPROCESS_COMMAND += "buildhistory_get_imageinfo ;"
+IMAGE_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_imageinfo ;"
+IMAGE_POSTPROCESS_COMMAND[vardepsexclude] += "buildhistory_get_imageinfo"
 
 # We want these to be the last run so that we get called after complementary package installation
 POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_target;"
@@ -590,11 +647,21 @@
 SDK_POSTPROCESS_COMMAND_append = " buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; "
 SDK_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; "
 
+python buildhistory_write_sigs() {
+    if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
+        return
+
+    # Create sigs file
+    if hasattr(bb.parse.siggen, 'dump_siglist'):
+        taskoutdir = os.path.join(d.getVar('BUILDHISTORY_DIR'), 'task')
+        bb.utils.mkdirhier(taskoutdir)
+        bb.parse.siggen.dump_siglist(os.path.join(taskoutdir, 'tasksigs.txt'))
+}
+
 def buildhistory_get_build_id(d):
-    if d.getVar('BB_WORKERCONTEXT', True) != '1':
+    if d.getVar('BB_WORKERCONTEXT') != '1':
         return ""
     localdata = bb.data.createCopy(d)
-    bb.data.update_data(localdata)
     statuslines = []
     for func in oe.data.typed_value('BUILDCFG_FUNCS', localdata):
         g = globals()
@@ -605,12 +672,12 @@
             if flines:
                 statuslines.extend(flines)
 
-    statusheader = d.getVar('BUILDCFG_HEADER', True)
+    statusheader = d.getVar('BUILDCFG_HEADER')
     return('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
 
 def buildhistory_get_metadata_revs(d):
     # We want an easily machine-readable format here, so get_layers_branch_rev isn't quite what we want
-    layers = (d.getVar("BBLAYERS", True) or "").split()
+    layers = (d.getVar("BBLAYERS") or "").split()
     medadata_revs = ["%-17s = %s:%s" % (os.path.basename(i), \
         base_get_metadata_git_branch(i, None).strip(), \
         base_get_metadata_git_revision(i, None)) \
@@ -622,7 +689,7 @@
     listvars = listvars.split()
     ret = ""
     for var in vars:
-        value = d.getVar(var, True) or ""
+        value = d.getVar(var) or ""
         if var in listvars:
             # Squash out spaces
             value = oe.utils.squashspaces(value)
@@ -630,17 +697,17 @@
     return ret.rstrip('\n')
 
 def buildhistory_get_imagevars(d):
-    if d.getVar('BB_WORKERCONTEXT', True) != '1':
+    if d.getVar('BB_WORKERCONTEXT') != '1':
         return ""
     imagevars = "DISTRO DISTRO_VERSION USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE ROOTFS_POSTPROCESS_COMMAND IMAGE_POSTPROCESS_COMMAND"
     listvars = "USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS PACKAGE_EXCLUDE"
     return outputvars(imagevars, listvars, d)
 
 def buildhistory_get_sdkvars(d):
-    if d.getVar('BB_WORKERCONTEXT', True) != '1':
+    if d.getVar('BB_WORKERCONTEXT') != '1':
         return ""
     sdkvars = "DISTRO DISTRO_VERSION SDK_NAME SDK_VERSION SDKMACHINE SDKIMAGE_FEATURES BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE"
-    if d.getVar('BB_CURRENTTASK', True) == 'populate_sdk_ext':
+    if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext':
         # Extensible SDK uses some additional variables
         sdkvars += " SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST SDK_UPDATE_URL SDK_EXT_TYPE SDK_RECRDEP_TASKS SDK_INCLUDE_PKGDATA SDK_INCLUDE_TOOLCHAIN"
     listvars = "SDKIMAGE_FEATURES BAD_RECOMMENDATIONS PACKAGE_EXCLUDE SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST"
@@ -735,16 +802,16 @@
 }
 
 python buildhistory_eventhandler() {
-    if e.data.getVar('BUILDHISTORY_FEATURES', True).strip():
-        reset = e.data.getVar("BUILDHISTORY_RESET", True)
-        olddir = e.data.getVar("BUILDHISTORY_OLD_DIR", True)
+    if e.data.getVar('BUILDHISTORY_FEATURES').strip():
+        reset = e.data.getVar("BUILDHISTORY_RESET")
+        olddir = e.data.getVar("BUILDHISTORY_OLD_DIR")
         if isinstance(e, bb.event.BuildStarted):
             if reset:
                 import shutil
                 # Clean up after potentially interrupted build.
                 if os.path.isdir(olddir):
                     shutil.rmtree(olddir)
-                rootdir = e.data.getVar("BUILDHISTORY_DIR", True)
+                rootdir = e.data.getVar("BUILDHISTORY_DIR")
                 entries = [ x for x in os.listdir(rootdir) if not x.startswith('.') ]
                 bb.utils.mkdirhier(olddir)
                 for entry in entries:
@@ -754,8 +821,9 @@
             if reset:
                 import shutil
                 shutil.rmtree(olddir)
-            if e.data.getVar("BUILDHISTORY_COMMIT", True) == "1":
+            if e.data.getVar("BUILDHISTORY_COMMIT") == "1":
                 bb.note("Writing buildhistory")
+                bb.build.exec_func("buildhistory_write_sigs", d)
                 localdata = bb.data.createCopy(e.data)
                 localdata.setVar('BUILDHISTORY_BUILD_FAILURES', str(e._failures))
                 interrupted = getattr(e, '_interrupted', 0)
@@ -774,7 +842,7 @@
     """
 
     scms = []
-    fetcher = bb.fetch.Fetch(d.getVar('SRC_URI', True).split(), d)
+    fetcher = bb.fetch.Fetch(d.getVar('SRC_URI').split(), d)
     urldata = fetcher.ud
     for u in urldata:
         if urldata[u].method.supports_srcrev():
@@ -806,7 +874,7 @@
 do_fetch[postfuncs] += "write_srcrev"
 do_fetch[vardepsexclude] += "write_srcrev"
 python write_srcrev() {
-    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
     srcrevfile = os.path.join(pkghistdir, 'latest_srcrev')
 
     srcrevs, tag_srcrevs = _get_srcrev_values(d)
@@ -833,12 +901,12 @@
                         f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev))
                     f.write('SRCREV_%s = "%s"\n' % (name, srcrev))
             else:
-                f.write('SRCREV = "%s"\n' % srcrevs.values())
+                f.write('SRCREV = "%s"\n' % next(iter(srcrevs.values())))
             if len(tag_srcrevs) > 0:
                 for name, srcrev in tag_srcrevs.items():
                     f.write('# tag_%s = "%s"\n' % (name, srcrev))
                     if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev:
-                        pkg = d.getVar('PN', True)
+                        pkg = d.getVar('PN')
                         bb.warn("Revision for tag %s in package %s was changed since last build (from %s to %s)" % (name, pkg, old_tag_srcrevs[name], srcrev))
 
     else:
diff --git a/import-layers/yocto-poky/meta/classes/buildstats-summary.bbclass b/import-layers/yocto-poky/meta/classes/buildstats-summary.bbclass
index b86abcc..f9b241b 100644
--- a/import-layers/yocto-poky/meta/classes/buildstats-summary.bbclass
+++ b/import-layers/yocto-poky/meta/classes/buildstats-summary.bbclass
@@ -7,7 +7,7 @@
     if not os.path.exists(bsdir):
         return
 
-    sstatetasks = (e.data.getVar('SSTATETASKS', True) or '').split()
+    sstatetasks = (e.data.getVar('SSTATETASKS') or '').split()
     built = collections.defaultdict(lambda: [set(), set()])
     for pf in os.listdir(bsdir):
         taskdir = os.path.join(bsdir, pf)
diff --git a/import-layers/yocto-poky/meta/classes/buildstats.bbclass b/import-layers/yocto-poky/meta/classes/buildstats.bbclass
index 599a219..960653c 100644
--- a/import-layers/yocto-poky/meta/classes/buildstats.bbclass
+++ b/import-layers/yocto-poky/meta/classes/buildstats.bbclass
@@ -31,6 +31,11 @@
                 i = f.readline().strip()
                 if not i:
                     break
+                if not ":" in i:
+                    # one more extra line is appended (empty or containing "0")
+                    # most probably due to race condition in kernel while
+                    # updating IO stats
+                    break
                 i = i.split(": ")
                 iostats[i[0]] = i[1]
     resources = resource.getrusage(resource.RUSAGE_SELF)
@@ -75,13 +80,13 @@
     return timediff, cpuperc
 
 def write_task_data(status, logfile, e, d):
-    bn = d.getVar('BUILDNAME', True)
-    bsdir = os.path.join(d.getVar('BUILDSTATS_BASE', True), bn)
+    bn = d.getVar('BUILDNAME')
+    bsdir = os.path.join(d.getVar('BUILDSTATS_BASE'), bn)
     with open(os.path.join(logfile), "a") as f:
         elapsedtime = get_timedata("__timedata_task", d, e.time)
         if elapsedtime:
-            f.write(d.expand("${PF}: %s: Elapsed time: %0.2f seconds \n" %
-                                    (e.task, elapsedtime)))
+            f.write(d.expand("${PF}: %s\n" % e.task))
+            f.write(d.expand("Elapsed time: %0.2f seconds\n" % elapsedtime))
             cpu, iostats, resources, childres = get_process_cputime(os.getpid())
             if cpu:
                 f.write("utime: %s\n" % cpu['utime'])
@@ -106,9 +111,9 @@
     import bb.event
     import time, subprocess, platform
 
-    bn = d.getVar('BUILDNAME', True)
-    bsdir = os.path.join(d.getVar('BUILDSTATS_BASE', True), bn)
-    taskdir = os.path.join(bsdir, d.getVar('PF', True))
+    bn = d.getVar('BUILDNAME')
+    bsdir = os.path.join(d.getVar('BUILDSTATS_BASE'), bn)
+    taskdir = os.path.join(bsdir, d.getVar('PF'))
 
     if isinstance(e, bb.event.BuildStarted):
         ########################################################################
@@ -162,7 +167,7 @@
         if e.task == "do_rootfs":
             bs = os.path.join(bsdir, "build_stats")
             with open(bs, "a") as f:
-                rootfs = d.getVar('IMAGE_ROOTFS', True)
+                rootfs = d.getVar('IMAGE_ROOTFS')
                 if os.path.isdir(rootfs):
                     try:
                         rootfs_size = subprocess.check_output(["du", "-sh", rootfs],
@@ -188,3 +193,27 @@
 addhandler run_buildstats
 run_buildstats[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted bb.build.TaskStarted bb.build.TaskSucceeded bb.build.TaskFailed"
 
+python runqueue_stats () {
+    import buildstats
+    from bb import event, runqueue
+    # We should not record any samples before the first task has started,
+    # because that's the first activity shown in the process chart.
+    # Besides, at that point we are sure that the build variables
+    # are available that we need to find the output directory.
+    # The persistent SystemStats is stored in the datastore and
+    # closed when the build is done.
+    system_stats = d.getVar('_buildstats_system_stats', False)
+    if not system_stats and isinstance(e, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted)):
+        system_stats = buildstats.SystemStats(d)
+        d.setVar('_buildstats_system_stats', system_stats)
+    if system_stats:
+        # Ensure that we sample at important events.
+        done = isinstance(e, bb.event.BuildCompleted)
+        system_stats.sample(e, force=done)
+        if done:
+            system_stats.close()
+            d.delVar('_buildstats_system_stats')
+}
+
+addhandler runqueue_stats
+runqueue_stats[eventmask] = "bb.runqueue.sceneQueueTaskStarted bb.runqueue.runQueueTaskStarted bb.event.HeartbeatEvent bb.event.BuildCompleted bb.event.MonitorDiskEvent"
diff --git a/import-layers/yocto-poky/meta/classes/ccache.bbclass b/import-layers/yocto-poky/meta/classes/ccache.bbclass
index 2e9837c..d58c8f6 100644
--- a/import-layers/yocto-poky/meta/classes/ccache.bbclass
+++ b/import-layers/yocto-poky/meta/classes/ccache.bbclass
@@ -1,6 +1,15 @@
-CCACHE = "${@bb.utils.which(d.getVar('PATH', True), 'ccache') and 'ccache '}"
-export CCACHE_DIR ?= "${TMPDIR}/ccache/${MULTIMACH_HOST_SYS}/${PN}"
+CCACHE = "${@bb.utils.which(d.getVar('PATH'), 'ccache') and 'ccache '}"
+export CCACHE_DIR ?= "${TMPDIR}/ccache/${MULTIMACH_TARGET_SYS}/${PN}"
 CCACHE_DISABLE[unexport] = "1"
 
+# We need to stop ccache considering the current directory or the
+# debug-prefix-map target directory to be significant when calculating
+# its hash. Without this the cache would be invalidated every time
+# ${PV} or ${PR} change.
+export CCACHE_NOHASHDIR ?= "1"
+
+DEPENDS_append_class-target = " ccache-native"
+DEPENDS[vardepvalueexclude] = " ccache-native"
+
 do_configure[dirs] =+ "${CCACHE_DIR}"
 do_kernel_configme[dirs] =+ "${CCACHE_DIR}"
diff --git a/import-layers/yocto-poky/meta/classes/chrpath.bbclass b/import-layers/yocto-poky/meta/classes/chrpath.bbclass
index 3b5cd37..ad3c397 100644
--- a/import-layers/yocto-poky/meta/classes/chrpath.bbclass
+++ b/import-layers/yocto-poky/meta/classes/chrpath.bbclass
@@ -17,19 +17,24 @@
     # Throw away everything other than the rpath list
     curr_rpath = out.partition("RPATH=")[2]
     #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip()))
-    rpaths = curr_rpath.split(":")
+    rpaths = curr_rpath.strip().split(":")
     new_rpaths = []
     modified = False
     for rpath in rpaths:
         # If rpath is already dynamic copy it to new_rpath and continue
         if rpath.find("$ORIGIN") != -1:
-            new_rpaths.append(rpath.strip())
+            new_rpaths.append(rpath)
             continue
         rpath =  os.path.normpath(rpath)
         if baseprefix not in rpath and tmpdir not in rpath:
-            new_rpaths.append(rpath.strip())
+            # Skip standard search paths
+            if rpath in ['/lib', '/usr/lib', '/lib64/', '/usr/lib64']:
+                bb.warn("Skipping RPATH %s as is a standard search path for %s" % (rpath, fpath))
+                modified = True
+                continue
+            new_rpaths.append(rpath)
             continue
-        new_rpaths.append("$ORIGIN/" + os.path.relpath(rpath.strip(), os.path.dirname(fpath.replace(rootdir, "/"))))
+        new_rpaths.append("$ORIGIN/" + os.path.relpath(rpath, os.path.dirname(fpath.replace(rootdir, "/"))))
         modified = True
 
     # if we have modified some rpaths call chrpath to update the binary
@@ -39,7 +44,7 @@
         p = sub.Popen([cmd, '-r', args, fpath],stdout=sub.PIPE,stderr=sub.PIPE)
         out, err = p.communicate()
         if p.returncode != 0:
-            bb.fatal("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN', True), p.returncode, out, err))
+            bb.fatal("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN'), p.returncode, out, err))
 
 def process_file_darwin(cmd, fpath, rootdir, baseprefix, tmpdir, d):
     import subprocess as sub
@@ -67,7 +72,7 @@
     cmd = d.expand('${CHRPATH_BIN}')
     tmpdir = os.path.normpath(d.getVar('TMPDIR', False))
     baseprefix = os.path.normpath(d.expand('${base_prefix}'))
-    hostos = d.getVar("HOST_OS", True)
+    hostos = d.getVar("HOST_OS")
 
     #bb.debug("Checking %s for binaries to process" % directory)
     if not os.path.exists(directory):
diff --git a/import-layers/yocto-poky/meta/classes/cmake.bbclass b/import-layers/yocto-poky/meta/classes/cmake.bbclass
index fad0baa..12df617 100644
--- a/import-layers/yocto-poky/meta/classes/cmake.bbclass
+++ b/import-layers/yocto-poky/meta/classes/cmake.bbclass
@@ -1,5 +1,5 @@
 # Path to the CMake file to process.
-OECMAKE_SOURCEPATH ?= "${S}"
+OECMAKE_SOURCEPATH ??= "${S}"
 
 DEPENDS_prepend = "cmake-native "
 B = "${WORKDIR}/build"
@@ -42,11 +42,15 @@
     return target_arch
 
 cmake_do_generate_toolchain_file() {
+	if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
+		cmake_crosscompiling="set( CMAKE_CROSSCOMPILING FALSE )"
+	fi
 	cat > ${WORKDIR}/toolchain.cmake <<EOF
 # CMake system name must be something like "Linux".
 # This is important for cross-compiling.
+$cmake_crosscompiling
 set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` )
-set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH', True))} )
+set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH'))} )
 set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )
 set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} )
 set( CMAKE_ASM_COMPILER ${OECMAKE_C_COMPILER} )
@@ -103,24 +107,24 @@
 
 	# Just like autotools cmake can use a site file to cache result that need generated binaries to run
 	if [ -e ${WORKDIR}/site-file.cmake ] ; then
-		OECMAKE_SITEFILE=" -C ${WORKDIR}/site-file.cmake"
+		oecmake_sitefile="-C ${WORKDIR}/site-file.cmake"
 	else
-		OECMAKE_SITEFILE=""
+		oecmake_sitefile=
 	fi
 
 	cmake \
-	  ${OECMAKE_SITEFILE} \
+	  $oecmake_sitefile \
 	  ${OECMAKE_SOURCEPATH} \
 	  -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
-	  -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir', True), d.getVar('prefix', True))} \
-	  -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir', True), d.getVar('prefix', True))} \
-	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir', True), d.getVar('prefix', True))} \
+	  -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix'))} \
+	  -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix'))} \
+	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix'))} \
 	  -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
-	  -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir', True), d.  getVar('prefix', True))} \
+	  -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d.  getVar('prefix'))} \
 	  -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
-	  -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir', True), d.getVar('prefix', True))} \
-	  -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir', True), d.getVar('prefix', True))} \
-	  -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir', True), d.getVar('prefix', True))} \
+	  -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix'))} \
+	  -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix'))} \
+	  -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix'))} \
 	  -DCMAKE_INSTALL_SO_NO_EXE=0 \
 	  -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
 	  -DCMAKE_VERBOSE_MAKEFILE=1 \
diff --git a/import-layers/yocto-poky/meta/classes/cml1.bbclass b/import-layers/yocto-poky/meta/classes/cml1.bbclass
index 5834806..38e6613 100644
--- a/import-layers/yocto-poky/meta/classes/cml1.bbclass
+++ b/import-layers/yocto-poky/meta/classes/cml1.bbclass
@@ -26,8 +26,8 @@
     except OSError:
         mtime = 0
 
-    oe_terminal("${SHELL} -c \"make %s; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND', True),
-                d.getVar('PN', True ) + ' Configuration', d)
+    oe_terminal("${SHELL} -c \"make %s; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),
+                d.getVar('PN') + ' Configuration', d)
 
     # FIXME this check can be removed when the minimum bitbake version has been bumped
     if hasattr(bb.build, 'write_taint'):
@@ -49,7 +49,7 @@
     import shutil
     import subprocess
 
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
     fragment = workdir + '/fragment.cfg'
     configorig = '.config.orig'
     config = '.config'
diff --git a/import-layers/yocto-poky/meta/classes/compress_doc.bbclass b/import-layers/yocto-poky/meta/classes/compress_doc.bbclass
index 8073c17..069d534 100644
--- a/import-layers/yocto-poky/meta/classes/compress_doc.bbclass
+++ b/import-layers/yocto-poky/meta/classes/compress_doc.bbclass
@@ -31,25 +31,25 @@
 
 PACKAGE_PREPROCESS_FUNCS += "package_do_compress_doc compress_doc_updatealternatives"
 python package_do_compress_doc() {
-    compress_mode = d.getVar('DOC_COMPRESS', True)
-    compress_list = (d.getVar('DOC_COMPRESS_LIST', True) or '').split()
+    compress_mode = d.getVar('DOC_COMPRESS')
+    compress_list = (d.getVar('DOC_COMPRESS_LIST') or '').split()
     if compress_mode not in compress_list:
         bb.fatal('Compression policy %s not supported (not listed in %s)\n' % (compress_mode, compress_list))
 
-    dvar = d.getVar('PKGD', True)
+    dvar = d.getVar('PKGD')
     compress_cmds = {}
     decompress_cmds = {}
     for mode in compress_list:
-        compress_cmds[mode] = d.getVarFlag('DOC_COMPRESS_CMD', mode, True)
-        decompress_cmds[mode] = d.getVarFlag('DOC_DECOMPRESS_CMD', mode, True)
+        compress_cmds[mode] = d.getVarFlag('DOC_COMPRESS_CMD', mode)
+        decompress_cmds[mode] = d.getVarFlag('DOC_DECOMPRESS_CMD', mode)
 
-    mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir", True))
+    mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir"))
     if os.path.exists(mandir):
         # Decompress doc files which format is not compress_mode
         decompress_doc(mandir, compress_mode, decompress_cmds)
         compress_doc(mandir, compress_mode, compress_cmds)
 
-    infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir", True))
+    infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir"))
     if os.path.exists(infodir):
         # Decompress doc files which format is not compress_mode
         decompress_doc(infodir, compress_mode, decompress_cmds)
@@ -218,18 +218,18 @@
     if not bb.data.inherits_class('update-alternatives', d):
         return
 
-    mandir = d.getVar("mandir", True)
-    infodir = d.getVar("infodir", True)
-    compress_mode = d.getVar('DOC_COMPRESS', True)
-    for pkg in (d.getVar('PACKAGES', True) or "").split():
-        old_names = (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split()
+    mandir = d.getVar("mandir")
+    infodir = d.getVar("infodir")
+    compress_mode = d.getVar('DOC_COMPRESS')
+    for pkg in (d.getVar('PACKAGES') or "").split():
+        old_names = (d.getVar('ALTERNATIVE_%s' % pkg) or "").split()
         new_names = []
         for old_name in old_names:
-            old_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', old_name, True)
-            old_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name, True) or \
-                d.getVarFlag('ALTERNATIVE_TARGET', old_name, True) or \
-                d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or \
-                d.getVar('ALTERNATIVE_TARGET', True) or \
+            old_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', old_name)
+            old_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name) or \
+                d.getVarFlag('ALTERNATIVE_TARGET', old_name) or \
+                d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or \
+                d.getVar('ALTERNATIVE_TARGET') or \
                 old_link
             # Sometimes old_target is specified as relative to the link name.
             old_target   = os.path.join(os.path.dirname(old_link), old_target)
@@ -241,15 +241,15 @@
                 new_target = old_target + '.' + compress_mode
                 d.delVarFlag('ALTERNATIVE_LINK_NAME', old_name)
                 d.setVarFlag('ALTERNATIVE_LINK_NAME', new_name, new_link)
-                if d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name, True):
+                if d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name):
                     d.delVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name)
                     d.setVarFlag('ALTERNATIVE_TARGET_%s' % pkg, new_name, new_target)
-                elif d.getVarFlag('ALTERNATIVE_TARGET', old_name, True):
+                elif d.getVarFlag('ALTERNATIVE_TARGET', old_name):
                     d.delVarFlag('ALTERNATIVE_TARGET', old_name)
                     d.setVarFlag('ALTERNATIVE_TARGET', new_name, new_target)
-                elif d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True):
+                elif d.getVar('ALTERNATIVE_TARGET_%s' % pkg):
                     d.setVar('ALTERNATIVE_TARGET_%s' % pkg, new_target)
-                elif d.getVar('ALTERNATIVE_TARGET', old_name, True):
+                elif d.getVar('ALTERNATIVE_TARGET'):
                     d.setVar('ALTERNATIVE_TARGET', new_target)
 
                 new_names.append(new_name)
diff --git a/import-layers/yocto-poky/meta/classes/copyleft_compliance.bbclass b/import-layers/yocto-poky/meta/classes/copyleft_compliance.bbclass
index 907c183..eabf12c 100644
--- a/import-layers/yocto-poky/meta/classes/copyleft_compliance.bbclass
+++ b/import-layers/yocto-poky/meta/classes/copyleft_compliance.bbclass
@@ -13,7 +13,7 @@
     import os.path
     import shutil
 
-    p = d.getVar('P', True)
+    p = d.getVar('P')
     included, reason = copyleft_should_include(d)
     if not included:
         bb.debug(1, 'copyleft: %s is excluded: %s' % (p, reason))
@@ -21,13 +21,13 @@
     else:
         bb.debug(1, 'copyleft: %s is included: %s' % (p, reason))
 
-    sources_dir = d.getVar('COPYLEFT_SOURCES_DIR', True)
-    dl_dir = d.getVar('DL_DIR', True)
-    src_uri = d.getVar('SRC_URI', True).split()
+    sources_dir = d.getVar('COPYLEFT_SOURCES_DIR')
+    dl_dir = d.getVar('DL_DIR')
+    src_uri = d.getVar('SRC_URI').split()
     fetch = bb.fetch2.Fetch(src_uri, d)
     ud = fetch.ud
 
-    pf = d.getVar('PF', True)
+    pf = d.getVar('PF')
     dest = os.path.join(sources_dir, pf)
     shutil.rmtree(dest, ignore_errors=True)
     bb.utils.mkdirhier(dest)
diff --git a/import-layers/yocto-poky/meta/classes/copyleft_filter.bbclass b/import-layers/yocto-poky/meta/classes/copyleft_filter.bbclass
index 46be7f7..c36bce4 100644
--- a/import-layers/yocto-poky/meta/classes/copyleft_filter.bbclass
+++ b/import-layers/yocto-poky/meta/classes/copyleft_filter.bbclass
@@ -6,7 +6,7 @@
 #
 # vi:sts=4:sw=4:et
 
-COPYLEFT_LICENSE_INCLUDE ?= 'GPL* LGPL*'
+COPYLEFT_LICENSE_INCLUDE ?= 'GPL* LGPL* AGPL*'
 COPYLEFT_LICENSE_INCLUDE[type] = 'list'
 COPYLEFT_LICENSE_INCLUDE[doc] = 'Space separated list of globs which include licenses'
 
@@ -47,32 +47,32 @@
     import oe.license
     from fnmatch import fnmatchcase as fnmatch
 
-    included, motive = False, 'recipe did not match anything'
-
-    recipe_type = d.getVar('COPYLEFT_RECIPE_TYPE', True)
+    recipe_type = d.getVar('COPYLEFT_RECIPE_TYPE')
     if recipe_type not in oe.data.typed_value('COPYLEFT_RECIPE_TYPES', d):
-        include, motive = False, 'recipe type "%s" is excluded' % recipe_type
-
-    include = oe.data.typed_value('COPYLEFT_LICENSE_INCLUDE', d)
-    exclude = oe.data.typed_value('COPYLEFT_LICENSE_EXCLUDE', d)
-
-    try:
-        is_included, reason = oe.license.is_included(d.getVar('LICENSE', True), include, exclude)
-    except oe.license.LicenseError as exc:
-        bb.fatal('%s: %s' % (d.getVar('PF', True), exc))
+        included, motive = False, 'recipe type "%s" is excluded' % recipe_type
     else:
-        if is_included:
-            if reason:
-                included, motive = True, 'recipe has included licenses: %s' % ', '.join(reason)
-            else:
-                included, motive = False, 'recipe does not include a copyleft license'
-        else:
-            included, motive = False, 'recipe has excluded licenses: %s' % ', '.join(reason)
+        included, motive = False, 'recipe did not match anything'
 
-    if any(fnmatch(d.getVar('PN', True), name) \
+        include = oe.data.typed_value('COPYLEFT_LICENSE_INCLUDE', d)
+        exclude = oe.data.typed_value('COPYLEFT_LICENSE_EXCLUDE', d)
+
+        try:
+            is_included, reason = oe.license.is_included(d.getVar('LICENSE'), include, exclude)
+        except oe.license.LicenseError as exc:
+            bb.fatal('%s: %s' % (d.getVar('PF'), exc))
+        else:
+            if is_included:
+                if reason:
+                    included, motive = True, 'recipe has included licenses: %s' % ', '.join(reason)
+                else:
+                    included, motive = False, 'recipe does not include a copyleft license'
+            else:
+                included, motive = False, 'recipe has excluded licenses: %s' % ', '.join(reason)
+
+    if any(fnmatch(d.getVar('PN'), name) \
             for name in oe.data.typed_value('COPYLEFT_PN_INCLUDE', d)):
         included, motive =  True, 'recipe included by name'
-    if any(fnmatch(d.getVar('PN', True), name) \
+    if any(fnmatch(d.getVar('PN'), name) \
             for name in oe.data.typed_value('COPYLEFT_PN_EXCLUDE', d)):
         included, motive = False, 'recipe excluded by name'
 
diff --git a/import-layers/yocto-poky/meta/classes/core-image.bbclass b/import-layers/yocto-poky/meta/classes/core-image.bbclass
index 8431440..a9a2cec 100644
--- a/import-layers/yocto-poky/meta/classes/core-image.bbclass
+++ b/import-layers/yocto-poky/meta/classes/core-image.bbclass
@@ -24,11 +24,15 @@
 # - hwcodecs            - Install hardware acceleration codecs
 # - package-management  - installs package management tools and preserves the package manager database
 # - debug-tweaks        - makes an image suitable for development, e.g. allowing passwordless root logins
+#   - empty-root-password
+#   - allow-empty-password
+#   - post-install-logging
 # - dev-pkgs            - development packages (headers, etc.) for all installed packages in the rootfs
 # - dbg-pkgs            - debug symbol packages for all installed packages in the rootfs
 # - doc-pkgs            - documentation packages for all installed packages in the rootfs
 # - ptest-pkgs          - ptest packages for all ptest-enabled recipes
 # - read-only-rootfs    - tweaks an image to support read-only rootfs
+# - splash              - bootup splash screen
 #
 FEATURE_PACKAGES_x11 = "packagegroup-core-x11"
 FEATURE_PACKAGES_x11-base = "packagegroup-core-x11-base"
diff --git a/import-layers/yocto-poky/meta/classes/cpan-base.bbclass b/import-layers/yocto-poky/meta/classes/cpan-base.bbclass
index 55ac052..577fcd6 100644
--- a/import-layers/yocto-poky/meta/classes/cpan-base.bbclass
+++ b/import-layers/yocto-poky/meta/classes/cpan-base.bbclass
@@ -7,27 +7,7 @@
 DEPENDS  += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
 RDEPENDS_${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
 
-PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
-
-# Determine the staged version of perl from the perl configuration file
-# Assign vardepvalue, because otherwise signature is changed before and after
-# perl is built (from None to real version in config.sh).
-get_perl_version[vardepvalue] = "${PERL_OWN_DIR}"
-def get_perl_version(d):
-    import re
-    cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh')
-    try:
-        f = open(cfg, 'r')
-    except IOError:
-        return None
-    l = f.readlines();
-    f.close();
-    r = re.compile("^version='(\d*\.\d*\.\d*)'")
-    for s in l:
-        m = r.match(s)
-        if m:
-            return m.group(1)
-    return None
+inherit perl-version
 
 def is_target(d):
     if not bb.data.inherits_class('native', d):
@@ -36,5 +16,3 @@
 
 PERLLIBDIRS = "${libdir}/perl"
 PERLLIBDIRS_class-native = "${libdir}/perl-native"
-PERLVERSION := "${@get_perl_version(d)}"
-PERLVERSION[vardepvalue] = ""
diff --git a/import-layers/yocto-poky/meta/classes/cross-canadian.bbclass b/import-layers/yocto-poky/meta/classes/cross-canadian.bbclass
index 21921b3..49388d4 100644
--- a/import-layers/yocto-poky/meta/classes/cross-canadian.bbclass
+++ b/import-layers/yocto-poky/meta/classes/cross-canadian.bbclass
@@ -20,25 +20,25 @@
 CANADIANEXTRAVENDOR = ""
 MODIFYTOS ??= "1"
 python () {
-    archs = d.getVar('PACKAGE_ARCHS', True).split()
+    archs = d.getVar('PACKAGE_ARCHS').split()
     sdkarchs = []
     for arch in archs:
         sdkarchs.append(arch + '-${SDKPKGSUFFIX}')
     d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs))
 
     # Allow the following code segment to be disabled, e.g. meta-environment
-    if d.getVar("MODIFYTOS", True) != "1":
+    if d.getVar("MODIFYTOS") != "1":
         return
 
-    if d.getVar("TCLIBC", True) == "baremetal":
+    if d.getVar("TCLIBC") == "baremetal":
         return
 
-    tos = d.getVar("TARGET_OS", True)
+    tos = d.getVar("TARGET_OS")
     whitelist = []
     extralibcs = [""]
-    if "uclibc" in d.getVar("BASECANADIANEXTRAOS", True):
+    if "uclibc" in d.getVar("BASECANADIANEXTRAOS"):
         extralibcs.append("uclibc")
-    if "musl" in d.getVar("BASECANADIANEXTRAOS", True):
+    if "musl" in d.getVar("BASECANADIANEXTRAOS"):
         extralibcs.append("musl")
     for variant in ["", "spe", "x32", "eabi", "n32"]:
         for libc in extralibcs:
@@ -51,33 +51,33 @@
                 entry = entry + "-" + libc
             whitelist.append(entry)
     if tos not in whitelist:
-        bb.fatal("Building cross-candian for an unknown TARGET_SYS (%s), please update cross-canadian.bbclass" % d.getVar("TARGET_SYS", True))
+        bb.fatal("Building cross-candian for an unknown TARGET_SYS (%s), please update cross-canadian.bbclass" % d.getVar("TARGET_SYS"))
 
     for n in ["PROVIDES", "DEPENDS"]:
-        d.setVar(n, d.getVar(n, True))
-    d.setVar("STAGING_BINDIR_TOOLCHAIN", d.getVar("STAGING_BINDIR_TOOLCHAIN", True))
+        d.setVar(n, d.getVar(n))
+    d.setVar("STAGING_BINDIR_TOOLCHAIN", d.getVar("STAGING_BINDIR_TOOLCHAIN"))
     for prefix in ["AR", "AS", "DLLTOOL", "CC", "CXX", "GCC", "LD", "LIPO", "NM", "OBJDUMP", "RANLIB", "STRIP", "WINDRES"]:
         n = prefix + "_FOR_TARGET"
-        d.setVar(n, d.getVar(n, True))
+        d.setVar(n, d.getVar(n))
     # This is a bit ugly. We need to zero LIBC/ABI extension which will change TARGET_OS
     # however we need the old value in some variables. We expand those here first.
-    tarch = d.getVar("TARGET_ARCH", True)
+    tarch = d.getVar("TARGET_ARCH")
     if tarch == "x86_64":
         d.setVar("LIBCEXTENSION", "")
         d.setVar("ABIEXTENSION", "")
         d.appendVar("CANADIANEXTRAOS", " linux-gnux32")
-        for extraos in d.getVar("BASECANADIANEXTRAOS", True).split():
+        for extraos in d.getVar("BASECANADIANEXTRAOS").split():
             d.appendVar("CANADIANEXTRAOS", " " + extraos + "x32")
     elif tarch == "powerpc":
         # PowerPC can build "linux" and "linux-gnuspe"
         d.setVar("LIBCEXTENSION", "")
         d.setVar("ABIEXTENSION", "")
         d.appendVar("CANADIANEXTRAOS", " linux-gnuspe")
-        for extraos in d.getVar("BASECANADIANEXTRAOS", True).split():
+        for extraos in d.getVar("BASECANADIANEXTRAOS").split():
             d.appendVar("CANADIANEXTRAOS", " " + extraos + "spe")
     elif tarch == "mips64":
         d.appendVar("CANADIANEXTRAOS", " linux-gnun32")
-        for extraos in d.getVar("BASECANADIANEXTRAOS", True).split():
+        for extraos in d.getVar("BASECANADIANEXTRAOS").split():
             d.appendVar("CANADIANEXTRAOS", " " + extraos + "n32")
     if tarch == "arm" or tarch == "armeb":
         d.appendVar("CANADIANEXTRAOS", " linux-gnueabi linux-musleabi linux-uclibceabi")
@@ -86,10 +86,10 @@
         d.setVar("TARGET_OS", "linux")
 
     # Also need to handle multilib target vendors
-    vendors = d.getVar("CANADIANEXTRAVENDOR", True)
+    vendors = d.getVar("CANADIANEXTRAVENDOR")
     if not vendors:
         vendors = all_multilib_tune_values(d, 'TARGET_VENDOR')
-    origvendor = d.getVar("TARGET_VENDOR_MULTILIB_ORIGINAL", True)
+    origvendor = d.getVar("TARGET_VENDOR_MULTILIB_ORIGINAL")
     if origvendor:
         d.setVar("TARGET_VENDOR", origvendor)
         if origvendor not in vendors.split():
@@ -100,9 +100,9 @@
 
 INHIBIT_DEFAULT_DEPS = "1"
 
-STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
+STAGING_DIR_HOST = "${RECIPE_SYSROOT}"
 
-TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
+TOOLCHAIN_OPTIONS = " --sysroot=${RECIPE_SYSROOT}"
 
 PATH_append = ":${TMPDIR}/sysroots/${HOST_ARCH}/${bindir_cross}"
 PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/"
@@ -115,8 +115,13 @@
 HOST_LD_ARCH = "${SDK_LD_ARCH}"
 HOST_AS_ARCH = "${SDK_AS_ARCH}"
 
+TARGET_CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+TARGET_CFLAGS = "${BUILDSDK_CFLAGS}"
+TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
+TARGET_LDFLAGS = "${BUILDSDK_LDFLAGS}"
+
 #assign DPKG_ARCH
-DPKG_ARCH = "${@debian_arch_map(d.getVar('SDK_ARCH', True), '')}"
+DPKG_ARCH = "${@debian_arch_map(d.getVar('SDK_ARCH'), '')}"
 
 CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
 CFLAGS = "${BUILDSDK_CFLAGS}"
@@ -169,6 +174,7 @@
 # and not any particular tune that is enabled.
 TARGET_ARCH[vardepsexclude] = "TUNE_ARCH"
 
+PKGDATA_DIR = "${TMPDIR}/pkgdata/${SDK_SYS}"
 # If MLPREFIX is set by multilib code, shlibs
 # points to the wrong place so force it
 SHLIBSDIRS = "${PKGDATA_DIR}/nativesdk-shlibs2"
diff --git a/import-layers/yocto-poky/meta/classes/cross.bbclass b/import-layers/yocto-poky/meta/classes/cross.bbclass
index 01b0933..4feb01e 100644
--- a/import-layers/yocto-poky/meta/classes/cross.bbclass
+++ b/import-layers/yocto-poky/meta/classes/cross.bbclass
@@ -19,15 +19,20 @@
 
 export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir} /lib /lib64 /usr/lib /usr/lib64"
 
-STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
+STAGING_DIR_HOST = "${RECIPE_SYSROOT_NATIVE}"
 
 PACKAGE_ARCH = "${BUILD_ARCH}"
 
-MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
+MULTIMACH_TARGET_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
 
 export PKG_CONFIG_DIR = "${exec_prefix}/lib/pkgconfig"
 export PKG_CONFIG_SYSROOT_DIR = ""
 
+TARGET_CPPFLAGS = ""
+TARGET_CFLAGS = ""
+TARGET_CXXFLAGS = ""
+TARGET_LDFLAGS = ""
+
 CPPFLAGS = "${BUILD_CPPFLAGS}"
 CFLAGS = "${BUILD_CFLAGS}"
 CXXFLAGS = "${BUILD_CFLAGS}"
@@ -38,6 +43,10 @@
 
 DEPENDS_GETTEXT = "gettext-native"
 
+# This class encodes staging paths into its scripts data so can only be
+# reused if we manipulate the paths.
+SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
+
 # Path mangling needed by the cross packaging
 # Note that we use := here to ensure that libdir and includedir are
 # target paths.
diff --git a/import-layers/yocto-poky/meta/classes/crosssdk.bbclass b/import-layers/yocto-poky/meta/classes/crosssdk.bbclass
index 7315c38..ddb98d2 100644
--- a/import-layers/yocto-poky/meta/classes/crosssdk.bbclass
+++ b/import-layers/yocto-poky/meta/classes/crosssdk.bbclass
@@ -5,12 +5,15 @@
 PACKAGE_ARCH = "${SDK_ARCH}"
 python () {
 	# set TUNE_PKGARCH to SDK_ARCH
-	d.setVar('TUNE_PKGARCH', d.getVar('SDK_ARCH', True))
+	d.setVar('TUNE_PKGARCH', d.getVar('SDK_ARCH'))
 }
 
-STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}"
 STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
 
+# This class encodes staging paths into its scripts data so can only be
+# reused if we manipulate the paths.
+SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
+
 TARGET_ARCH = "${SDK_ARCH}"
 TARGET_VENDOR = "${SDK_VENDOR}"
 TARGET_OS = "${SDK_OS}"
@@ -18,8 +21,13 @@
 TARGET_CC_ARCH = "${SDK_CC_ARCH}"
 TARGET_LD_ARCH = "${SDK_LD_ARCH}"
 TARGET_AS_ARCH = "${SDK_AS_ARCH}"
+TARGET_CPPFLAGS = "${BUILD_CPPFLAGS}"
+TARGET_CFLAGS = "${BUILD_CFLAGS}"
+TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}"
+TARGET_LDFLAGS = "${BUILD_LDFLAGS}"
 TARGET_FPU = ""
 
+
 target_libdir = "${SDKPATHNATIVE}${libdir_nativesdk}"
 target_includedir = "${SDKPATHNATIVE}${includedir_nativesdk}"
 target_base_libdir = "${SDKPATHNATIVE}${base_libdir_nativesdk}"
diff --git a/import-layers/yocto-poky/meta/classes/cve-check.bbclass b/import-layers/yocto-poky/meta/classes/cve-check.bbclass
index 75b8fa9..13ec62e 100644
--- a/import-layers/yocto-poky/meta/classes/cve-check.bbclass
+++ b/import-layers/yocto-poky/meta/classes/cve-check.bbclass
@@ -22,7 +22,7 @@
 
 # The product name that the CVE database uses.  Defaults to BPN, but may need to
 # be overriden per recipe (for example tiff.bb sets CVE_PRODUCT=libtiff).
-CVE_PRODUCT ?= "${BPN}"
+CVE_PRODUCT ??= "${BPN}"
 
 CVE_CHECK_DB_DIR ?= "${DL_DIR}/CVE_CHECK"
 CVE_CHECK_DB_FILE ?= "${CVE_CHECK_DB_DIR}/nvd.db"
@@ -51,7 +51,7 @@
     Check recipe for patched and unpatched CVEs
     """
 
-    if os.path.exists(d.getVar("CVE_CHECK_TMP_FILE", True)):
+    if os.path.exists(d.getVar("CVE_CHECK_TMP_FILE")):
         patched_cves = get_patches_cves(d)
         patched, unpatched = check_cves(d, patched_cves)
         if patched or unpatched:
@@ -62,7 +62,7 @@
 }
 
 addtask cve_check after do_unpack before do_build
-do_cve_check[depends] = "cve-check-tool-native:do_populate_cve_db"
+do_cve_check[depends] = "cve-check-tool-native:do_populate_sysroot cve-check-tool-native:do_populate_cve_db"
 do_cve_check[nostamp] = "1"
 
 python cve_check_cleanup () {
@@ -70,7 +70,7 @@
     Delete the file used to gather all the CVE information.
     """
 
-    bb.utils.remove(e.data.getVar("CVE_CHECK_TMP_FILE", True))
+    bb.utils.remove(e.data.getVar("CVE_CHECK_TMP_FILE"))
 }
 
 addhandler cve_check_cleanup
@@ -83,12 +83,12 @@
 
     import shutil
 
-    if os.path.exists(d.getVar("CVE_CHECK_TMP_FILE", True)):
+    if os.path.exists(d.getVar("CVE_CHECK_TMP_FILE")):
         bb.note("Writing rootfs CVE manifest")
-        deploy_dir = d.getVar("DEPLOY_DIR_IMAGE", True)
-        link_name = d.getVar("IMAGE_LINK_NAME", True)
-        manifest_name = d.getVar("CVE_CHECK_MANIFEST", True)
-        cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE", True)
+        deploy_dir = d.getVar("DEPLOY_DIR_IMAGE")
+        link_name = d.getVar("IMAGE_LINK_NAME")
+        manifest_name = d.getVar("CVE_CHECK_MANIFEST")
+        cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
 
         shutil.copyfile(cve_tmp_file, manifest_name)
 
@@ -101,7 +101,7 @@
             bb.plain("Image CVE report stored in: %s" % manifest_name)
 }
 
-ROOTFS_POSTPROCESS_COMMAND_prepend = "${@'cve_check_write_rootfs_manifest; ' if d.getVar('CVE_CHECK_CREATE_MANIFEST', True) == '1' else ''}"
+ROOTFS_POSTPROCESS_COMMAND_prepend = "${@'cve_check_write_rootfs_manifest; ' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}"
 
 def get_patches_cves(d):
     """
@@ -110,7 +110,7 @@
 
     import re
 
-    pn = d.getVar("PN", True)
+    pn = d.getVar("PN")
     cve_match = re.compile("CVE:( CVE\-\d{4}\-\d+)+")
     patched_cves = set()
     bb.debug(2, "Looking for patches that solves CVEs for %s" % pn)
@@ -149,15 +149,15 @@
     cves_patched = []
     cves_unpatched = []
     bpn = d.getVar("CVE_PRODUCT")
-    pv = d.getVar("PV", True).split("git+")[0]
+    pv = d.getVar("PV").split("git+")[0]
     cves = " ".join(patched_cves)
-    cve_db_dir = d.getVar("CVE_CHECK_DB_DIR", True)
-    cve_whitelist = ast.literal_eval(d.getVar("CVE_CHECK_CVE_WHITELIST", True))
+    cve_db_dir = d.getVar("CVE_CHECK_DB_DIR")
+    cve_whitelist = ast.literal_eval(d.getVar("CVE_CHECK_CVE_WHITELIST"))
     cve_cmd = "cve-check-tool"
     cmd = [cve_cmd, "--no-html", "--csv", "--not-affected", "-t", "faux", "-d", cve_db_dir]
 
     # If the recipe has been whitlisted we return empty lists
-    if d.getVar("PN", True) in d.getVar("CVE_CHECK_PN_WHITELIST", True).split():
+    if d.getVar("PN") in d.getVar("CVE_CHECK_PN_WHITELIST").split():
         bb.note("Recipe has been whitelisted, skipping check")
         return ([], [])
 
@@ -210,7 +210,7 @@
         from pysqlite2 import dbapi2 as sqlite3
 
     cve_data = {}
-    db_file = d.getVar("CVE_CHECK_DB_FILE", True)
+    db_file = d.getVar("CVE_CHECK_DB_FILE")
     placeholder = ",".join("?" * len(cves))
     query = "SELECT * FROM NVD WHERE id IN (%s)" % placeholder
     conn = sqlite3.connect(db_file)
@@ -231,39 +231,40 @@
     CVE manifest if enabled.
     """
 
-    cve_file = d.getVar("CVE_CHECK_LOCAL_FILE", True)
+    cve_file = d.getVar("CVE_CHECK_LOCAL_FILE")
     nvd_link = "https://web.nvd.nist.gov/view/vuln/detail?vulnId="
     write_string = ""
-    first_alert = True
-    bb.utils.mkdirhier(d.getVar("CVE_CHECK_LOCAL_DIR", True))
+    unpatched_cves = []
+    bb.utils.mkdirhier(d.getVar("CVE_CHECK_LOCAL_DIR"))
 
     for cve in sorted(cve_data):
-        write_string += "PACKAGE NAME: %s\n" % d.getVar("PN", True)
-        write_string += "PACKAGE VERSION: %s\n" % d.getVar("PV", True)
+        write_string += "PACKAGE NAME: %s\n" % d.getVar("PN")
+        write_string += "PACKAGE VERSION: %s\n" % d.getVar("PV")
         write_string += "CVE: %s\n" % cve
         if cve in patched:
             write_string += "CVE STATUS: Patched\n"
         else:
+            unpatched_cves.append(cve)
             write_string += "CVE STATUS: Unpatched\n"
-            if first_alert:
-                bb.warn("Found unpatched CVE, for more information check %s" % cve_file)
-                first_alert = False
         write_string += "CVE SUMMARY: %s\n" % cve_data[cve]["summary"]
         write_string += "CVSS v2 BASE SCORE: %s\n" % cve_data[cve]["score"]
         write_string += "VECTOR: %s\n" % cve_data[cve]["vector"]
         write_string += "MORE INFORMATION: %s%s\n\n" % (nvd_link, cve)
 
+    if unpatched_cves:
+        bb.warn("Found unpatched CVE (%s), for more information check %s" % (" ".join(unpatched_cves),cve_file))
+
     with open(cve_file, "w") as f:
         bb.note("Writing file %s with CVE information" % cve_file)
         f.write(write_string)
 
-    if d.getVar("CVE_CHECK_COPY_FILES", True) == "1":
-        cve_dir = d.getVar("CVE_CHECK_DIR", True)
+    if d.getVar("CVE_CHECK_COPY_FILES") == "1":
+        cve_dir = d.getVar("CVE_CHECK_DIR")
         bb.utils.mkdirhier(cve_dir)
-        deploy_file = os.path.join(cve_dir, d.getVar("PN", True))
+        deploy_file = os.path.join(cve_dir, d.getVar("PN"))
         with open(deploy_file, "w") as f:
             f.write(write_string)
 
-    if d.getVar("CVE_CHECK_CREATE_MANIFEST", True) == "1":
-        with open(d.getVar("CVE_CHECK_TMP_FILE", True), "a") as f:
+    if d.getVar("CVE_CHECK_CREATE_MANIFEST") == "1":
+        with open(d.getVar("CVE_CHECK_TMP_FILE"), "a") as f:
             f.write("%s" % write_string)
diff --git a/import-layers/yocto-poky/meta/classes/debian.bbclass b/import-layers/yocto-poky/meta/classes/debian.bbclass
index be7cacc..8124558 100644
--- a/import-layers/yocto-poky/meta/classes/debian.bbclass
+++ b/import-layers/yocto-poky/meta/classes/debian.bbclass
@@ -20,17 +20,17 @@
 do_package_write_rpm[rdeptask] = "${DEBIANRDEP}"
 
 python () {
-    if not d.getVar("PACKAGES", True):
+    if not d.getVar("PACKAGES"):
         d.setVar("DEBIANRDEP", "")
 }
 
 python debian_package_name_hook () {
     import glob, copy, stat, errno, re
 
-    pkgdest = d.getVar('PKGDEST', True)
-    packages = d.getVar('PACKAGES', True)
-    bin_re = re.compile(".*/s?" + os.path.basename(d.getVar("bindir", True)) + "$")
-    lib_re = re.compile(".*/" + os.path.basename(d.getVar("libdir", True)) + "$")
+    pkgdest = d.getVar('PKGDEST')
+    packages = d.getVar('PACKAGES')
+    bin_re = re.compile(".*/s?" + os.path.basename(d.getVar("bindir")) + "$")
+    lib_re = re.compile(".*/" + os.path.basename(d.getVar("libdir")) + "$")
     so_re = re.compile("lib.*\.so")
 
     def socrunch(s):
@@ -53,11 +53,11 @@
         return (s[stat.ST_MODE] & stat.S_IEXEC)
 
     def add_rprovides(pkg, d):
-        newpkg = d.getVar('PKG_' + pkg, True)
+        newpkg = d.getVar('PKG_' + pkg)
         if newpkg and newpkg != pkg:
-            provs = (d.getVar('RPROVIDES_' + pkg, True) or "").split()
+            provs = (d.getVar('RPROVIDES_' + pkg) or "").split()
             if pkg not in provs:
-                d.appendVar('RPROVIDES_' + pkg, " " + pkg + " (=" + d.getVar("PKGV", True) + ")")
+                d.appendVar('RPROVIDES_' + pkg, " " + pkg + " (=" + d.getVar("PKGV") + ")")
 
     def auto_libname(packages, orig_pkg):
         sonames = []
@@ -70,7 +70,7 @@
             if lib_re.match(root):
                 has_libs = 1
                 if so_re.match(os.path.basename(file)):
-                    cmd = (d.getVar('TARGET_PREFIX', True) or "") + "objdump -p " + file + " 2>/dev/null"
+                    cmd = (d.getVar('TARGET_PREFIX') or "") + "objdump -p " + file + " 2>/dev/null"
                     fd = os.popen(cmd)
                     lines = fd.readlines()
                     fd.close()
@@ -84,7 +84,7 @@
         if len(sonames) == 1:
             soname = sonames[0]
         elif len(sonames) > 1:
-            lead = d.getVar('LEAD_SONAME', True)
+            lead = d.getVar('LEAD_SONAME')
             if lead:
                 r = re.compile(lead)
                 filtered = []
@@ -115,7 +115,7 @@
                         newpkg = pkgname
                     else:
                         newpkg = pkg.replace(orig_pkg, devname, 1)
-                    mlpre=d.getVar('MLPREFIX', True)
+                    mlpre=d.getVar('MLPREFIX')
                     if mlpre:
                         if not newpkg.find(mlpre) == 0:
                             newpkg = mlpre + newpkg
@@ -131,7 +131,7 @@
     # and later
     # DEBUG: LIBNAMES: pkgname libtic5 devname libtic pkg ncurses-libticw orig_pkg ncurses-libtic debian_pn None newpkg libticw
     # so we need to handle ncurses-libticw->libticw5 before ncurses-libtic->libtic5
-    for pkg in sorted((d.getVar('AUTO_LIBNAME_PKGS', True) or "").split(), reverse=True):
+    for pkg in sorted((d.getVar('AUTO_LIBNAME_PKGS') or "").split(), reverse=True):
         auto_libname(packages, pkg)
 }
 
diff --git a/import-layers/yocto-poky/meta/classes/devshell.bbclass b/import-layers/yocto-poky/meta/classes/devshell.bbclass
index be71aff..4de7ea6 100644
--- a/import-layers/yocto-poky/meta/classes/devshell.bbclass
+++ b/import-layers/yocto-poky/meta/classes/devshell.bbclass
@@ -3,16 +3,16 @@
 DEVSHELL = "${SHELL}"
 
 python do_devshell () {
-    if d.getVarFlag("do_devshell", "manualfakeroot", True):
+    if d.getVarFlag("do_devshell", "manualfakeroot"):
        d.prependVar("DEVSHELL", "pseudo ")
-       fakeenv = d.getVar("FAKEROOTENV", True).split()
+       fakeenv = d.getVar("FAKEROOTENV").split()
        for f in fakeenv:
             k = f.split("=")
             d.setVar(k[0], k[1])           
             d.appendVar("OE_TERMINAL_EXPORTS", " " + k[0])
        d.delVarFlag("do_devshell", "fakeroot")
 
-    oe_terminal(d.getVar('DEVSHELL', True), 'OpenEmbedded Developer Shell', d)
+    oe_terminal(d.getVar('DEVSHELL'), 'OpenEmbedded Developer Shell', d)
 }
 
 addtask devshell after do_patch
@@ -27,7 +27,7 @@
 # be done as the normal user. We therfore carefully construct the envionment
 # manually
 python () {
-    if d.getVarFlag("do_devshell", "fakeroot", True):
+    if d.getVarFlag("do_devshell", "fakeroot"):
        # We need to signal our code that we want fakeroot however we
        # can't manipulate the environment and variables here yet (see YOCTO #4795)
        d.setVarFlag("do_devshell", "manualfakeroot", "1")
@@ -82,7 +82,7 @@
         more = False
 
         i = code.InteractiveInterpreter(locals=_context)
-        print("OE PyShell (PN = %s)\n" % d.getVar("PN", True))
+        print("OE PyShell (PN = %s)\n" % d.getVar("PN"))
 
         def prompt(more):
             if more:
diff --git a/import-layers/yocto-poky/meta/classes/devupstream.bbclass b/import-layers/yocto-poky/meta/classes/devupstream.bbclass
new file mode 100644
index 0000000..7780c54
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/devupstream.bbclass
@@ -0,0 +1,48 @@
+# Class for use in BBCLASSEXTEND to make it easier to have a single recipe that
+# can build both stable tarballs and snapshots from upstream source
+# repositories.
+#
+# Usage:
+# BBCLASSEXTEND = "devupstream:target"
+# SRC_URI_class-devupstream = "git://git.example.com/example"
+# SRCREV_class-devupstream = "abcdef"
+#
+# If the first entry in SRC_URI is a git: URL then S is rewritten to
+# WORKDIR/git.
+#
+# There are a few caveats that remain to be solved:
+# - You can't build native or nativesdk recipes using for example
+#   devupstream:native, you can only build target recipes.
+# - If the fetcher requires native tools (such as subversion-native) then
+#   bitbake won't be able to add them automatically.
+
+CLASSOVERRIDE .= ":class-devupstream"
+
+python devupstream_virtclass_handler () {
+    # Do nothing if this is inherited, as it's for BBCLASSEXTEND
+    if "devupstream" not in (d.getVar('BBCLASSEXTEND') or ""):
+        bb.error("Don't inherit devupstream, use BBCLASSEXTEND")
+        return
+
+    variant = d.getVar("BBEXTENDVARIANT")
+    if variant not in ("target"):
+        bb.error("Pass the variant when using devupstream, for example devupstream:target")
+        return
+
+    # Develpment releases are never preferred by default
+    d.setVar("DEFAULT_PREFERENCE", "-1")
+
+    uri = bb.fetch2.URI(d.getVar("SRC_URI").split()[0])
+
+    if uri.scheme == "git":
+        d.setVar("S", "${WORKDIR}/git")
+
+    # Modify the PV if the recipe hasn't already overridden it
+    pv = d.getVar("PV")
+    proto_marker = "+" + uri.scheme
+    if proto_marker not in pv:
+        d.setVar("PV", pv + proto_marker + "${SRCPV}")
+}
+
+addhandler devupstream_virtclass_handler
+devupstream_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
diff --git a/import-layers/yocto-poky/meta/classes/distro_features_check.bbclass b/import-layers/yocto-poky/meta/classes/distro_features_check.bbclass
index 7e91dbc..e74d3c0 100644
--- a/import-layers/yocto-poky/meta/classes/distro_features_check.bbclass
+++ b/import-layers/yocto-poky/meta/classes/distro_features_check.bbclass
@@ -11,15 +11,15 @@
 
 python () {
     # Assume at least one var is set.
-    distro_features = (d.getVar('DISTRO_FEATURES', True) or "").split()
+    distro_features = (d.getVar('DISTRO_FEATURES') or "").split()
 
-    any_of_distro_features = d.getVar('ANY_OF_DISTRO_FEATURES', True)
+    any_of_distro_features = d.getVar('ANY_OF_DISTRO_FEATURES')
     if any_of_distro_features:
         any_of_distro_features = any_of_distro_features.split()
         if set.isdisjoint(set(any_of_distro_features),set(distro_features)):
             raise bb.parse.SkipPackage("one of '%s' needs to be in DISTRO_FEATURES" % any_of_distro_features)
 
-    required_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES', True)
+    required_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES')
     if required_distro_features:
         required_distro_features = required_distro_features.split()
         for f in required_distro_features:
@@ -28,7 +28,7 @@
             else:
                 raise bb.parse.SkipPackage("missing required distro feature '%s' (not in DISTRO_FEATURES)" % f)
 
-    conflict_distro_features = d.getVar('CONFLICT_DISTRO_FEATURES', True)
+    conflict_distro_features = d.getVar('CONFLICT_DISTRO_FEATURES')
     if conflict_distro_features:
         conflict_distro_features = conflict_distro_features.split()
         for f in conflict_distro_features:
diff --git a/import-layers/yocto-poky/meta/classes/distrodata.bbclass b/import-layers/yocto-poky/meta/classes/distrodata.bbclass
index fbb7402..5e34441 100644
--- a/import-layers/yocto-poky/meta/classes/distrodata.bbclass
+++ b/import-layers/yocto-poky/meta/classes/distrodata.bbclass
@@ -25,75 +25,70 @@
 do_distrodata_np[nostamp] = "1"
 python do_distrodata_np() {
         localdata = bb.data.createCopy(d)
-        pn = d.getVar("PN", True)
+        pn = d.getVar("PN")
         bb.note("Package Name: %s" % pn)
 
         import oe.distro_check as dist_check
-        tmpdir = d.getVar('TMPDIR', True)
+        tmpdir = d.getVar('TMPDIR')
         distro_check_dir = os.path.join(tmpdir, "distro_check")
-        datetime = localdata.getVar('DATETIME', True)
+        datetime = localdata.getVar('DATETIME')
         dist_check.update_distro_data(distro_check_dir, datetime, localdata)
 
         if pn.find("-native") != -1:
             pnstripped = pn.split("-native")
             bb.note("Native Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
         if pn.find("-cross") != -1:
             pnstripped = pn.split("-cross")
             bb.note("cross Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
         if pn.find("-crosssdk") != -1:
             pnstripped = pn.split("-crosssdk")
             bb.note("cross Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
         if pn.startswith("nativesdk-"):
             pnstripped = pn.replace("nativesdk-", "")
             bb.note("NativeSDK Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES'))
 
 
         if pn.find("-initial") != -1:
             pnstripped = pn.split("-initial")
             bb.note("initial Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
         """generate package information from .bb file"""
-        pname = localdata.getVar('PN', True)
-        pcurver = localdata.getVar('PV', True)
-        pdesc = localdata.getVar('DESCRIPTION', True)
+        pname = localdata.getVar('PN')
+        pcurver = localdata.getVar('PV')
+        pdesc = localdata.getVar('DESCRIPTION')
         if pdesc is not None:
                 pdesc = pdesc.replace(',','')
                 pdesc = pdesc.replace('\n','')
 
-        pgrp = localdata.getVar('SECTION', True)
-        plicense = localdata.getVar('LICENSE', True).replace(',','_')
+        pgrp = localdata.getVar('SECTION')
+        plicense = localdata.getVar('LICENSE').replace(',','_')
 
-        rstatus = localdata.getVar('RECIPE_COLOR', True)
+        rstatus = localdata.getVar('RECIPE_COLOR')
         if rstatus is not None:
                 rstatus = rstatus.replace(',','')
 
-        pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION', True)
+        pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION')
         if pcurver == pupver:
                 vermatch="1"
         else:
                 vermatch="0"
-        noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON', True)
+        noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON')
         if noupdate_reason is None:
                 noupdate="0"
         else:
                 noupdate="1"
                 noupdate_reason = noupdate_reason.replace(',','')
 
-        maintainer = localdata.getVar('RECIPE_MAINTAINER', True)
-        rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE', True)
+        maintainer = localdata.getVar('RECIPE_MAINTAINER')
+        rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE')
         result = dist_check.compare_in_distro_packages_list(distro_check_dir, localdata)
 
         bb.note("DISTRO: %s,%s,%s,%s,%s,%s,%s,%s,%s\n" % \
@@ -109,80 +104,75 @@
 do_distrodata[nostamp] = "1"
 python do_distrodata() {
         import csv
-        logpath = d.getVar('LOG_DIR', True)
+        logpath = d.getVar('LOG_DIR')
         bb.utils.mkdirhier(logpath)
         logfile = os.path.join(logpath, "distrodata.csv")
 
         import oe.distro_check as dist_check
         localdata = bb.data.createCopy(d)
-        tmpdir = d.getVar('TMPDIR', True)
+        tmpdir = d.getVar('TMPDIR')
         distro_check_dir = os.path.join(tmpdir, "distro_check")
-        datetime = localdata.getVar('DATETIME', True)
+        datetime = localdata.getVar('DATETIME')
         dist_check.update_distro_data(distro_check_dir, datetime, localdata)
 
-        pn = d.getVar("PN", True)
+        pn = d.getVar("PN")
         bb.note("Package Name: %s" % pn)
 
         if pn.find("-native") != -1:
             pnstripped = pn.split("-native")
             bb.note("Native Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
         if pn.startswith("nativesdk-"):
             pnstripped = pn.replace("nativesdk-", "")
             bb.note("NativeSDK Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES'))
 
         if pn.find("-cross") != -1:
             pnstripped = pn.split("-cross")
             bb.note("cross Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
         if pn.find("-crosssdk") != -1:
             pnstripped = pn.split("-crosssdk")
             bb.note("cross Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
         if pn.find("-initial") != -1:
             pnstripped = pn.split("-initial")
             bb.note("initial Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
         """generate package information from .bb file"""
-        pname = localdata.getVar('PN', True)
-        pcurver = localdata.getVar('PV', True)
-        pdesc = localdata.getVar('DESCRIPTION', True)
+        pname = localdata.getVar('PN')
+        pcurver = localdata.getVar('PV')
+        pdesc = localdata.getVar('DESCRIPTION')
         if pdesc is not None:
                 pdesc = pdesc.replace(',','')
                 pdesc = pdesc.replace('\n','')
 
-        pgrp = localdata.getVar('SECTION', True)
-        plicense = localdata.getVar('LICENSE', True).replace(',','_')
+        pgrp = localdata.getVar('SECTION')
+        plicense = localdata.getVar('LICENSE').replace(',','_')
 
-        rstatus = localdata.getVar('RECIPE_COLOR', True)
+        rstatus = localdata.getVar('RECIPE_COLOR')
         if rstatus is not None:
                 rstatus = rstatus.replace(',','')
 
-        pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION', True)
+        pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION')
         if pcurver == pupver:
                 vermatch="1"
         else:
                 vermatch="0"
 
-        noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON', True)
+        noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON')
         if noupdate_reason is None:
                 noupdate="0"
         else:
                 noupdate="1"
                 noupdate_reason = noupdate_reason.replace(',','')
 
-        maintainer = localdata.getVar('RECIPE_MAINTAINER', True)
-        rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE', True)
+        maintainer = localdata.getVar('RECIPE_MAINTAINER')
+        rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE')
         # do the comparison
         result = dist_check.compare_in_distro_packages_list(distro_check_dir, localdata)
 
@@ -272,60 +262,56 @@
         from bb.fetch2 import FetchError, NoMethodError, decodeurl
 
         """first check whether a uri is provided"""
-        src_uri = (d.getVar('SRC_URI', True) or '').split()
+        src_uri = (d.getVar('SRC_URI') or '').split()
         if src_uri:
             uri_type, _, _, _, _, _ = decodeurl(src_uri[0])
         else:
             uri_type = "none"
 
         """initialize log files."""
-        logpath = d.getVar('LOG_DIR', True)
+        logpath = d.getVar('LOG_DIR')
         bb.utils.mkdirhier(logpath)
         logfile = os.path.join(logpath, "checkpkg.csv")
 
         """generate package information from .bb file"""
-        pname = d.getVar('PN', True)
+        pname = d.getVar('PN')
 
         if pname.find("-native") != -1:
-            if d.getVar('BBCLASSEXTEND', True):
+            if d.getVar('BBCLASSEXTEND'):
                     return
             pnstripped = pname.split("-native")
             bb.note("Native Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
         if pname.startswith("nativesdk-"):
-            if d.getVar('BBCLASSEXTEND', True):
+            if d.getVar('BBCLASSEXTEND'):
                     return
             pnstripped = pname.replace("nativesdk-", "")
             bb.note("NativeSDK Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES'))
 
         if pname.find("-cross") != -1:
             pnstripped = pname.split("-cross")
             bb.note("cross Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
         if pname.find("-initial") != -1:
             pnstripped = pname.split("-initial")
             bb.note("initial Split: %s" % pnstripped)
-            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-            bb.data.update_data(localdata)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
 
-        pdesc = localdata.getVar('DESCRIPTION', True)
-        pgrp = localdata.getVar('SECTION', True)
-        pversion = localdata.getVar('PV', True)
-        plicense = localdata.getVar('LICENSE', True)
-        psection = localdata.getVar('SECTION', True)
-        phome = localdata.getVar('HOMEPAGE', True)
-        prelease = localdata.getVar('PR', True)
-        pdepends = localdata.getVar('DEPENDS', True)
-        pbugtracker = localdata.getVar('BUGTRACKER', True)
-        ppe = localdata.getVar('PE', True)
-        psrcuri = localdata.getVar('SRC_URI', True)
-        maintainer = localdata.getVar('RECIPE_MAINTAINER', True)
+        pdesc = localdata.getVar('DESCRIPTION')
+        pgrp = localdata.getVar('SECTION')
+        pversion = localdata.getVar('PV')
+        plicense = localdata.getVar('LICENSE')
+        psection = localdata.getVar('SECTION')
+        phome = localdata.getVar('HOMEPAGE')
+        prelease = localdata.getVar('PR')
+        pdepends = localdata.getVar('DEPENDS')
+        pbugtracker = localdata.getVar('BUGTRACKER')
+        ppe = localdata.getVar('PE')
+        psrcuri = localdata.getVar('SRC_URI')
+        maintainer = localdata.getVar('RECIPE_MAINTAINER')
 
         """ Get upstream version version """
         pupver = ""
@@ -362,7 +348,7 @@
             psrcuri = "none"
         pdepends = "".join(pdepends.split("\t"))
         pdesc = "".join(pdesc.split("\t"))
-        no_upgr_reason = d.getVar('RECIPE_NO_UPDATE_REASON', True)
+        no_upgr_reason = d.getVar('RECIPE_NO_UPDATE_REASON')
         lf = bb.utils.lockfile("%s.lock" % logfile)
         with open(logfile, "a") as f:
             writer = csv.writer(f, delimiter='\t')
@@ -392,6 +378,7 @@
 
 addtask distro_check
 do_distro_check[nostamp] = "1"
+do_distro_check[vardepsexclude] += "DATETIME"
 python do_distro_check() {
     """checks if the package is present in other public Linux distros"""
     import oe.distro_check as dc
@@ -400,13 +387,12 @@
         return
 
     localdata = bb.data.createCopy(d)
-    bb.data.update_data(localdata)
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
     distro_check_dir = os.path.join(tmpdir, "distro_check")
-    logpath = d.getVar('LOG_DIR', True)
+    logpath = d.getVar('LOG_DIR')
     bb.utils.mkdirhier(logpath)
     result_file = os.path.join(logpath, "distrocheck.csv")
-    datetime = localdata.getVar('DATETIME', True)
+    datetime = localdata.getVar('DATETIME')
     dc.update_distro_data(distro_check_dir, datetime, localdata)
 
     # do the comparison
@@ -449,12 +435,12 @@
 python do_checklicense() {
     import csv
     import shutil
-    logpath = d.getVar('LOG_DIR', True)
+    logpath = d.getVar('LOG_DIR')
     bb.utils.mkdirhier(logpath)
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
     logfile = os.path.join(logpath, "missinglicense.csv")
-    generic_directory = d.getVar('COMMON_LICENSE_DIR', True)
-    license_types = d.getVar('LICENSE', True)
+    generic_directory = d.getVar('COMMON_LICENSE_DIR')
+    license_types = d.getVar('LICENSE')
     for license_type in ((license_types.replace('+', '').replace('|', '&')
                           .replace('(', '').replace(')', '').replace(';', '')
                           .replace(',', '').replace(" ", "").split("&"))):
@@ -475,5 +461,3 @@
 do_checklicenseall() {
         :
 }
-
-
diff --git a/import-layers/yocto-poky/meta/classes/distutils-base.bbclass b/import-layers/yocto-poky/meta/classes/distutils-base.bbclass
index aa18e8b..9f398d7 100644
--- a/import-layers/yocto-poky/meta/classes/distutils-base.bbclass
+++ b/import-layers/yocto-poky/meta/classes/distutils-base.bbclass
@@ -1,4 +1,4 @@
-DEPENDS  += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES', True) == '')]}"
+DEPENDS  += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES') == '')]}"
 RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
 
 inherit distutils-common-base pythonnative
diff --git a/import-layers/yocto-poky/meta/classes/distutils-tools.bbclass b/import-layers/yocto-poky/meta/classes/distutils-tools.bbclass
index 3ef9cc5..6f2880e 100644
--- a/import-layers/yocto-poky/meta/classes/distutils-tools.bbclass
+++ b/import-layers/yocto-poky/meta/classes/distutils-tools.bbclass
@@ -63,7 +63,7 @@
         #
         # FIXME: Bandaid against wrong datadir computation
         #
-        if test -e ${D}${datadir}/share; then
+        if [ -e ${D}${datadir}/share ]; then
             mv -f ${D}${datadir}/share/* ${D}${datadir}/
         fi
 }
diff --git a/import-layers/yocto-poky/meta/classes/distutils.bbclass b/import-layers/yocto-poky/meta/classes/distutils.bbclass
index 857572d..1930c35 100644
--- a/import-layers/yocto-poky/meta/classes/distutils.bbclass
+++ b/import-layers/yocto-poky/meta/classes/distutils.bbclass
@@ -44,16 +44,16 @@
         if test -e ${D}${bindir} ; then	
             for i in ${D}${bindir}/* ; do \
                 if [ ${PN} != "${BPN}-native" ]; then
-                	sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i
+			sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${USRBINPATH}/env\ python:g $i
 		fi
                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
             done
         fi
 
-        if test -e ${D}${sbindir}; then
+        if [ -e ${D}${sbindir} ]; then
             for i in ${D}${sbindir}/* ; do \
                 if [ ${PN} != "${BPN}-native" ]; then
-                	sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i
+			sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${USRBINPATH}/env\ python:g $i
 		fi
                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
             done
@@ -65,13 +65,13 @@
         #
         # FIXME: Bandaid against wrong datadir computation
         #
-        if test -e ${D}${datadir}/share; then
+        if [ -e ${D}${datadir}/share ]; then
             mv -f ${D}${datadir}/share/* ${D}${datadir}/
             rmdir ${D}${datadir}/share
         fi
 
 	# Fix backport modules
-	if test -e ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/backports/__init__.py && test -e ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py; then
+	if [ -e ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/backports/__init__.py ] && [ -e ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py ]; then
 	   rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py;
 	   rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.pyc;
 	fi
diff --git a/import-layers/yocto-poky/meta/classes/distutils3-base.bbclass b/import-layers/yocto-poky/meta/classes/distutils3-base.bbclass
index 82ab6a3..7dbf07a 100644
--- a/import-layers/yocto-poky/meta/classes/distutils3-base.bbclass
+++ b/import-layers/yocto-poky/meta/classes/distutils3-base.bbclass
@@ -1,4 +1,4 @@
-DEPENDS  += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES', True) == '')]}"
+DEPENDS  += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES') == '')]}"
 RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
 
 inherit distutils-common-base python3native
diff --git a/import-layers/yocto-poky/meta/classes/distutils3.bbclass b/import-layers/yocto-poky/meta/classes/distutils3.bbclass
index a6720c5..6c30306 100644
--- a/import-layers/yocto-poky/meta/classes/distutils3.bbclass
+++ b/import-layers/yocto-poky/meta/classes/distutils3.bbclass
@@ -47,14 +47,14 @@
 
         if test -e ${D}${bindir} ; then	
             for i in ${D}${bindir}/* ; do \
-                sed -i -e s:${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}:${bindir}/env\ ${PYTHON_PN}:g $i
+                sed -i -e s:${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}:${USRBINPATH}/env\ ${PYTHON_PN}:g $i
                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
             done
         fi
 
         if test -e ${D}${sbindir}; then
             for i in ${D}${sbindir}/* ; do \
-                sed -i -e s:${STAGING_BINDIR_NATIVE}/python-${PYTHON_PN}/${PYTHON_PN}:${bindir}/env\ ${PYTHON_PN}:g $i
+                sed -i -e s:${STAGING_BINDIR_NATIVE}/python-${PYTHON_PN}/${PYTHON_PN}:${USRBINPATH}/env\ ${PYTHON_PN}:g $i
                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
             done
         fi
@@ -64,7 +64,7 @@
         #
         # FIXME: Bandaid against wrong datadir computation
         #
-        if test -e ${D}${datadir}/share; then
+        if [ -e ${D}${datadir}/share ]; then
             mv -f ${D}${datadir}/share/* ${D}${datadir}/
             rmdir ${D}${datadir}/share
         fi
diff --git a/import-layers/yocto-poky/meta/classes/externalsrc.bbclass b/import-layers/yocto-poky/meta/classes/externalsrc.bbclass
index 31908c3..d64af6a 100644
--- a/import-layers/yocto-poky/meta/classes/externalsrc.bbclass
+++ b/import-layers/yocto-poky/meta/classes/externalsrc.bbclass
@@ -4,7 +4,7 @@
 # Copyright (C) 2009 Chris Larson <clarson@kergoth.com>
 # Released under the MIT license (see COPYING.MIT for the terms)
 #
-# externalsrc.bbclass enables use of an existing source tree, usually external to 
+# externalsrc.bbclass enables use of an existing source tree, usually external to
 # the build system to build a piece of software rather than the usual fetch/unpack/patch
 # process.
 #
@@ -28,34 +28,34 @@
 EXTERNALSRC_SYMLINKS ?= "oe-workdir:${WORKDIR} oe-logs:${T}"
 
 python () {
-    externalsrc = d.getVar('EXTERNALSRC', True)
+    externalsrc = d.getVar('EXTERNALSRC')
 
     # If this is the base recipe and EXTERNALSRC is set for it or any of its
     # derivatives, then enable BB_DONT_CACHE to force the recipe to always be
     # re-parsed so that the file-checksums function for do_compile is run every
     # time.
-    bpn = d.getVar('BPN', True)
-    if bpn == d.getVar('PN', True):
-        classextend = (d.getVar('BBCLASSEXTEND', True) or '').split()
+    bpn = d.getVar('BPN')
+    if bpn == d.getVar('PN'):
+        classextend = (d.getVar('BBCLASSEXTEND') or '').split()
         if (externalsrc or
                 ('native' in classextend and
-                 d.getVar('EXTERNALSRC_pn-%s-native' % bpn, True)) or
+                 d.getVar('EXTERNALSRC_pn-%s-native' % bpn)) or
                 ('nativesdk' in classextend and
-                 d.getVar('EXTERNALSRC_pn-nativesdk-%s' % bpn, True)) or
+                 d.getVar('EXTERNALSRC_pn-nativesdk-%s' % bpn)) or
                 ('cross' in classextend and
-                 d.getVar('EXTERNALSRC_pn-%s-cross' % bpn, True))):
+                 d.getVar('EXTERNALSRC_pn-%s-cross' % bpn))):
             d.setVar('BB_DONT_CACHE', '1')
 
     if externalsrc:
         d.setVar('S', externalsrc)
-        externalsrcbuild = d.getVar('EXTERNALSRC_BUILD', True)
+        externalsrcbuild = d.getVar('EXTERNALSRC_BUILD')
         if externalsrcbuild:
             d.setVar('B', externalsrcbuild)
         else:
             d.setVar('B', '${WORKDIR}/${BPN}-${PV}/')
 
         local_srcuri = []
-        fetch = bb.fetch2.Fetch((d.getVar('SRC_URI', True) or '').split(), d)
+        fetch = bb.fetch2.Fetch((d.getVar('SRC_URI') or '').split(), d)
         for url in fetch.urls:
             url_data = fetch.ud[url]
             parm = url_data.parm
@@ -69,7 +69,7 @@
             # Dummy value because the default function can't be called with blank SRC_URI
             d.setVar('SRCPV', '999')
 
-        tasks = filter(lambda k: d.getVarFlag(k, "task", True), d.keys())
+        tasks = filter(lambda k: d.getVarFlag(k, "task"), d.keys())
 
         for task in tasks:
             if task.endswith("_setscene"):
@@ -94,7 +94,7 @@
         # Note that we cannot use d.appendVarFlag() here because deps is expected to be a list object, not a string
         d.setVarFlag('do_configure', 'deps', (d.getVarFlag('do_configure', 'deps', False) or []) + ['do_unpack'])
 
-        for task in d.getVar("SRCTREECOVEREDTASKS", True).split():
+        for task in d.getVar("SRCTREECOVEREDTASKS").split():
             if local_srcuri and task in fetch_tasks:
                 continue
             bb.build.deltask(task, d)
@@ -106,24 +106,31 @@
         d.setVarFlag('do_configure', 'file-checksums', '${@srctree_configure_hash_files(d)}')
 
         # We don't want the workdir to go away
-        d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN', True))
+        d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN'))
+
+        bb.build.addtask('do_buildclean',
+                         'do_clean' if d.getVar('S') == d.getVar('B') else None,
+                         None, d)
 
         # If B=S the same builddir is used even for different architectures.
         # Thus, use a shared CONFIGURESTAMPFILE and STAMP directory so that
         # change of do_configure task hash is correctly detected and stamps are
         # invalidated if e.g. MACHINE changes.
-        if d.getVar('S', True) == d.getVar('B', True):
+        if d.getVar('S') == d.getVar('B'):
             configstamp = '${TMPDIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}/configure.sstate'
             d.setVar('CONFIGURESTAMPFILE', configstamp)
             d.setVar('STAMP', '${STAMPS_DIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}')
+            d.setVar('STAMPCLEAN', '${STAMPS_DIR}/work-shared/${PN}/*-*')
 }
 
 python externalsrc_configure_prefunc() {
+    s_dir = d.getVar('S')
     # Create desired symlinks
-    symlinks = (d.getVar('EXTERNALSRC_SYMLINKS', True) or '').split()
+    symlinks = (d.getVar('EXTERNALSRC_SYMLINKS') or '').split()
+    newlinks = []
     for symlink in symlinks:
         symsplit = symlink.split(':', 1)
-        lnkfile = os.path.join(d.getVar('S', True), symsplit[0])
+        lnkfile = os.path.join(s_dir, symsplit[0])
         target = d.expand(symsplit[1])
         if len(symsplit) > 1:
             if os.path.islink(lnkfile):
@@ -135,19 +142,43 @@
                 # File/dir exists with same name as link, just leave it alone
                 continue
             os.symlink(target, lnkfile)
+            newlinks.append(symsplit[0])
+    # Hide the symlinks from git
+    try:
+        git_exclude_file = os.path.join(s_dir, '.git/info/exclude')
+        if os.path.exists(git_exclude_file):
+            with open(git_exclude_file, 'r+') as efile:
+                elines = efile.readlines()
+                for link in newlinks:
+                    if link in elines or '/'+link in elines:
+                        continue
+                    efile.write('/' + link + '\n')
+    except IOError as ioe:
+        bb.note('Failed to hide EXTERNALSRC_SYMLINKS from git')
 }
 
 python externalsrc_compile_prefunc() {
     # Make it obvious that this is happening, since forgetting about it could lead to much confusion
-    bb.plain('NOTE: %s: compiling from external source tree %s' % (d.getVar('PN', True), d.getVar('EXTERNALSRC', True)))
+    bb.plain('NOTE: %s: compiling from external source tree %s' % (d.getVar('PN'), d.getVar('EXTERNALSRC')))
 }
 
-def srctree_hash_files(d):
+do_buildclean[dirs] = "${S} ${B}"
+do_buildclean[nostamp] = "1"
+do_buildclean[doc] = "Call 'make clean' or equivalent in ${B}"
+externalsrc_do_buildclean() {
+	if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then
+		oe_runmake clean || die "make failed"
+	else
+		bbnote "nothing to do - no makefile found"
+	fi
+}
+
+def srctree_hash_files(d, srcdir=None):
     import shutil
     import subprocess
     import tempfile
 
-    s_dir = d.getVar('EXTERNALSRC', True)
+    s_dir = srcdir or d.getVar('EXTERNALSRC')
     git_dir = os.path.join(s_dir, '.git')
     oe_hash_file = os.path.join(git_dir, 'oe-devtool-tree-sha1')
 
@@ -159,13 +190,13 @@
             # Update our custom index
             env = os.environ.copy()
             env['GIT_INDEX_FILE'] = tmp_index.name
-            subprocess.check_output(['git', 'add', '.'], cwd=s_dir, env=env)
+            subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env)
             sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8")
         with open(oe_hash_file, 'w') as fobj:
             fobj.write(sha1)
         ret = oe_hash_file + ':True'
     else:
-        ret = d.getVar('EXTERNALSRC', True) + '/*:True'
+        ret = s_dir + '/*:True'
     return ret
 
 def srctree_configure_hash_files(d):
@@ -173,7 +204,7 @@
     Get the list of files that should trigger do_configure to re-execute,
     based on the value of CONFIGURE_FILES
     """
-    in_files = (d.getVar('CONFIGURE_FILES', True) or '').split()
+    in_files = (d.getVar('CONFIGURE_FILES') or '').split()
     out_items = []
     search_files = []
     for entry in in_files:
@@ -182,9 +213,11 @@
         else:
             search_files.append(entry)
     if search_files:
-        s_dir = d.getVar('EXTERNALSRC', True)
+        s_dir = d.getVar('EXTERNALSRC')
         for root, _, files in os.walk(s_dir):
             for f in files:
                 if f in search_files:
                     out_items.append('%s:True' % os.path.join(root, f))
     return ' '.join(out_items)
+
+EXPORT_FUNCTIONS do_buildclean
diff --git a/import-layers/yocto-poky/meta/classes/extrausers.bbclass b/import-layers/yocto-poky/meta/classes/extrausers.bbclass
index 43900f3..7709407 100644
--- a/import-layers/yocto-poky/meta/classes/extrausers.bbclass
+++ b/import-layers/yocto-poky/meta/classes/extrausers.bbclass
@@ -15,7 +15,7 @@
 
 inherit useradd_base
 
-IMAGE_INSTALL_append = " ${@['', 'base-passwd shadow'][bool(d.getVar('EXTRA_USERS_PARAMS', True))]}"
+PACKAGE_INSTALL_append = " ${@['', 'base-passwd shadow'][bool(d.getVar('EXTRA_USERS_PARAMS'))]}"
 
 # Image level user / group settings
 ROOTFS_POSTPROCESS_COMMAND_append = " set_user_group;"
@@ -63,3 +63,7 @@
 		remaining=`echo $remaining | cut -d ';' -f2-`
 	done
 }
+
+USERADDEXTENSION ?= ""
+
+inherit ${USERADDEXTENSION}
diff --git a/import-layers/yocto-poky/meta/classes/fontcache.bbclass b/import-layers/yocto-poky/meta/classes/fontcache.bbclass
index 8ebdfc4..e763311 100644
--- a/import-layers/yocto-poky/meta/classes/fontcache.bbclass
+++ b/import-layers/yocto-poky/meta/classes/fontcache.bbclass
@@ -3,7 +3,7 @@
 # packages.
 #
 
-DEPENDS += "qemu-native"
+PACKAGE_WRITE_DEPS += "qemu-native"
 inherit qemu
 
 FONT_PACKAGES ??= "${PN}"
@@ -30,26 +30,26 @@
 }
 
 python () {
-    font_pkgs = d.getVar('FONT_PACKAGES', True).split()
-    deps = d.getVar("FONT_EXTRA_RDEPENDS", True)
+    font_pkgs = d.getVar('FONT_PACKAGES').split()
+    deps = d.getVar("FONT_EXTRA_RDEPENDS")
 
     for pkg in font_pkgs:
         if deps: d.appendVar('RDEPENDS_' + pkg, ' '+deps)
 }
 
 python add_fontcache_postinsts() {
-    for pkg in d.getVar('FONT_PACKAGES', True).split():
+    for pkg in d.getVar('FONT_PACKAGES').split():
         bb.note("adding fonts postinst and postrm scripts to %s" % pkg)
-        postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
+        postinst = d.getVar('pkg_postinst_%s' % pkg) or d.getVar('pkg_postinst')
         if not postinst:
             postinst = '#!/bin/sh\n'
-        postinst += d.getVar('fontcache_common', True)
+        postinst += d.getVar('fontcache_common')
         d.setVar('pkg_postinst_%s' % pkg, postinst)
 
-        postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
+        postrm = d.getVar('pkg_postrm_%s' % pkg) or d.getVar('pkg_postrm')
         if not postrm:
             postrm = '#!/bin/sh\n'
-        postrm += d.getVar('fontcache_common', True)
+        postrm += d.getVar('fontcache_common')
         d.setVar('pkg_postrm_%s' % pkg, postrm)
 }
 
diff --git a/import-layers/yocto-poky/meta/classes/fs-uuid.bbclass b/import-layers/yocto-poky/meta/classes/fs-uuid.bbclass
index bd2613c..9b53dfb 100644
--- a/import-layers/yocto-poky/meta/classes/fs-uuid.bbclass
+++ b/import-layers/yocto-poky/meta/classes/fs-uuid.bbclass
@@ -3,7 +3,7 @@
 # on ext file systems and depends on tune2fs.
 def get_rootfs_uuid(d):
     import subprocess
-    rootfs = d.getVar('ROOTFS', True)
+    rootfs = d.getVar('ROOTFS')
     output = subprocess.check_output(['tune2fs', '-l', rootfs])
     for line in output.split('\n'):
         if line.startswith('Filesystem UUID:'):
@@ -13,7 +13,7 @@
     bb.fatal('Could not determine filesystem UUID of %s' % rootfs)
 
 # Replace the special <<uuid-of-rootfs>> inside a string (like the
-# root= APPEND string in a syslinux.cfg or gummiboot entry) with the
+# root= APPEND string in a syslinux.cfg or systemd-boot entry) with the
 # actual UUID of the rootfs. Does nothing if the special string
 # is not used.
 def replace_rootfs_uuid(d, string):
diff --git a/import-layers/yocto-poky/meta/classes/gconf.bbclass b/import-layers/yocto-poky/meta/classes/gconf.bbclass
index d7afa72..4e0ee2e 100644
--- a/import-layers/yocto-poky/meta/classes/gconf.bbclass
+++ b/import-layers/yocto-poky/meta/classes/gconf.bbclass
@@ -1,4 +1,5 @@
-DEPENDS += "gconf gconf-native"
+DEPENDS += "gconf"
+PACKAGE_WRITE_DEPS += "gconf-native"
 
 # These are for when gconftool is used natively and the prefix isn't necessarily
 # the sysroot.  TODO: replicate the postinst logic for -native packages going
@@ -42,8 +43,8 @@
 
 python populate_packages_append () {
     import re
-    packages = d.getVar('PACKAGES', True).split()
-    pkgdest =  d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES').split()
+    pkgdest =  d.getVar('PKGDEST')
     
     for pkg in packages:
         schema_dir = '%s/%s/etc/gconf/schemas' % (pkgdest, pkg)
@@ -56,15 +57,15 @@
         if schemas != []:
             bb.note("adding gconf postinst and prerm scripts to %s" % pkg)
             d.setVar('SCHEMA_FILES', " ".join(schemas))
-            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            postinst = d.getVar('pkg_postinst_%s' % pkg)
             if not postinst:
                 postinst = '#!/bin/sh\n'
-            postinst += d.getVar('gconf_postinst', True)
+            postinst += d.getVar('gconf_postinst')
             d.setVar('pkg_postinst_%s' % pkg, postinst)
-            prerm = d.getVar('pkg_prerm_%s' % pkg, True)
+            prerm = d.getVar('pkg_prerm_%s' % pkg)
             if not prerm:
                 prerm = '#!/bin/sh\n'
-            prerm += d.getVar('gconf_prerm', True)
+            prerm += d.getVar('gconf_prerm')
             d.setVar('pkg_prerm_%s' % pkg, prerm)
             d.appendVar("RDEPENDS_%s" % pkg, ' ' + d.getVar('MLPREFIX', False) + 'gconf')
 }
diff --git a/import-layers/yocto-poky/meta/classes/gettext.bbclass b/import-layers/yocto-poky/meta/classes/gettext.bbclass
index 03b89b2..0be1424 100644
--- a/import-layers/yocto-poky/meta/classes/gettext.bbclass
+++ b/import-layers/yocto-poky/meta/classes/gettext.bbclass
@@ -1,15 +1,15 @@
 def gettext_dependencies(d):
-    if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'):
+    if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
         return ""
-    if d.getVar('USE_NLS', True) == 'no':
+    if d.getVar('USE_NLS') == 'no':
         return "gettext-minimal-native"
     return d.getVar('DEPENDS_GETTEXT', False)
 
 def gettext_oeconf(d):
-    if d.getVar('USE_NLS', True) == 'no':
+    if d.getVar('USE_NLS') == 'no':
         return '--disable-nls'
     # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set
-    if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'):
+    if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
         return '--disable-nls'
     return "--enable-nls"
 
diff --git a/import-layers/yocto-poky/meta/classes/gio-module-cache.bbclass b/import-layers/yocto-poky/meta/classes/gio-module-cache.bbclass
index 91461b1..a8190b7 100644
--- a/import-layers/yocto-poky/meta/classes/gio-module-cache.bbclass
+++ b/import-layers/yocto-poky/meta/classes/gio-module-cache.bbclass
@@ -1,4 +1,4 @@
-DEPENDS += "qemu-native"
+PACKAGE_WRITE_DEPS += "qemu-native"
 inherit qemu
 
 GIO_MODULE_PACKAGES ??= "${PN}"
@@ -17,21 +17,21 @@
 }
 
 python populate_packages_append () {
-    packages = d.getVar('GIO_MODULE_PACKAGES', True).split()
+    packages = d.getVar('GIO_MODULE_PACKAGES').split()
 
     for pkg in packages:
         bb.note("adding gio-module-cache postinst and postrm scripts to %s" % pkg)
 
-        postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+        postinst = d.getVar('pkg_postinst_%s' % pkg)
         if not postinst:
             postinst = '#!/bin/sh\n'
-        postinst += d.getVar('gio_module_cache_common', True)
+        postinst += d.getVar('gio_module_cache_common')
         d.setVar('pkg_postinst_%s' % pkg, postinst)
 
-        postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+        postrm = d.getVar('pkg_postrm_%s' % pkg)
         if not postrm:
             postrm = '#!/bin/sh\n'
-        postrm += d.getVar('gio_module_cache_common', True)
+        postrm += d.getVar('gio_module_cache_common')
         d.setVar('pkg_postrm_%s' % pkg, postrm)
 }
 
diff --git a/import-layers/yocto-poky/meta/classes/go.bbclass b/import-layers/yocto-poky/meta/classes/go.bbclass
new file mode 100644
index 0000000..85f71a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/go.bbclass
@@ -0,0 +1,77 @@
+inherit goarch
+
+# x32 ABI is not supported on go compiler so far
+COMPATIBLE_HOST_linux-gnux32 = "null"
+# ppc32 is not supported in go compilers
+COMPATIBLE_HOST_powerpc = "null"
+
+GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go"
+GOROOT = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
+GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin"
+GOBIN_FINAL = "${GOROOT_FINAL}/bin/${GOOS}_${GOARCH}"
+
+export GOOS = "${TARGET_GOOS}"
+export GOARCH = "${TARGET_GOARCH}"
+export GOARM = "${TARGET_GOARM}"
+export CGO_ENABLED = "1"
+export GOROOT
+export GOROOT_FINAL = "${libdir}/${TARGET_SYS}/go"
+export GOBIN_FINAL
+export GOPKG_FINAL = "${GOROOT_FINAL}/pkg/${GOOS}_${GOARCH}"
+export GOSRC_FINAL = "${GOROOT_FINAL}/src"
+export GO_GCFLAGS = "${TARGET_CFLAGS}"
+export GO_LDFLAGS = "${TARGET_LDFLAGS}"
+export CGO_CFLAGS = "${TARGET_CC_ARCH}${TOOLCHAIN_OPTIONS} ${TARGET_CFLAGS}"
+export CGO_CPPFLAGS = "${TARGET_CPPFLAGS}"
+export CGO_CXXFLAGS = "${TARGET_CC_ARCH}${TOOLCHAIN_OPTIONS} ${TARGET_CXXFLAGS}"
+export CGO_LDFLAGS = "${TARGET_CC_ARCH}${TOOLCHAIN_OPTIONS} ${TARGET_LDFLAGS}"
+
+DEPENDS += "go-cross-${TARGET_ARCH}"
+DEPENDS_class-native += "go-native"
+
+FILES_${PN}-staticdev += "${GOSRC_FINAL}/${GO_IMPORT}"
+FILES_${PN}-staticdev += "${GOPKG_FINAL}/${GO_IMPORT}*"
+
+GO_INSTALL ?= "${GO_IMPORT}/..."
+
+do_go_compile() {
+	GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go env
+	if [ -n "${GO_INSTALL}" ]; then
+		GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install -v ${GO_INSTALL}
+	fi
+}
+
+do_go_install() {
+	rm -rf ${WORKDIR}/staging
+	install -d ${WORKDIR}/staging${GOROOT_FINAL} ${D}${GOROOT_FINAL}
+	tar -C ${S} -cf - . | tar -C ${WORKDIR}/staging${GOROOT_FINAL} -xpvf -
+
+	find ${WORKDIR}/staging${GOROOT_FINAL} \( \
+		-name \*.indirectionsymlink -o \
+		-name .git\* -o                \
+		-name .hg -o                   \
+		-name .svn -o                  \
+		-name .pc\* -o                 \
+		-name patches\*                \
+		\) -print0 | \
+	xargs -r0 rm -rf
+
+	tar -C ${WORKDIR}/staging${GOROOT_FINAL} -cf - . | \
+	tar -C ${D}${GOROOT_FINAL} -xpvf -
+
+	chown -R root:root "${D}${GOROOT_FINAL}"
+
+	if [ -e "${D}${GOBIN_FINAL}" ]; then
+		install -d -m 0755 "${D}${bindir}"
+		find "${D}${GOBIN_FINAL}" ! -type d -print0 | xargs -r0 mv --target-directory="${D}${bindir}"
+		rmdir -p "${D}${GOBIN_FINAL}" || true
+	fi
+}
+
+do_compile() {
+	do_go_compile
+}
+
+do_install() {
+	do_go_install
+}
diff --git a/import-layers/yocto-poky/meta/classes/goarch.bbclass b/import-layers/yocto-poky/meta/classes/goarch.bbclass
new file mode 100644
index 0000000..12df88f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/goarch.bbclass
@@ -0,0 +1,53 @@
+BUILD_GOOS = "${@go_map_os(d.getVar('BUILD_OS', True), d)}"
+BUILD_GOARCH = "${@go_map_arch(d.getVar('BUILD_ARCH', True), d)}"
+BUILD_GOTUPLE = "${BUILD_GOOS}_${BUILD_GOARCH}"
+HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS', True), d)}"
+HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH', True), d)}"
+HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH', True), d.getVar('TUNE_FEATURES', True), d)}"
+HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"
+TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS', True), d)}"
+TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH', True), d)}"
+TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEATURES', True), d)}"
+TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
+GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE',True) == d.getVar('HOST_GOTUPLE',True)]}"
+
+def go_map_arch(a, d):
+    import re
+    if re.match('i.86', a):
+        return '386'
+    elif a == 'x86_64':
+        return 'amd64'
+    elif re.match('arm.*', a):
+        return 'arm'
+    elif re.match('aarch64.*', a):
+        return 'arm64'
+    elif re.match('mips64el*', a):
+        return 'mips64le'
+    elif re.match('mips64*', a):
+        return 'mips64'
+    elif re.match('mipsel*', a):
+        return 'mipsle'
+    elif re.match('mips*', a):
+        return 'mips'
+    elif re.match('p(pc|owerpc)(64)', a):
+        return 'ppc64'
+    elif re.match('p(pc|owerpc)(64el)', a):
+        return 'ppc64le'
+    else:
+        raise bb.parse.SkipPackage("Unsupported CPU architecture: %s" % a)
+
+def go_map_arm(a, f, d):
+    import re
+    if re.match('arm.*', a):
+        if 'armv7' in f:
+            return '7'
+        elif 'armv6' in f:
+            return '6'
+    return ''
+
+def go_map_os(o, d):
+    if o.startswith('linux'):
+        return 'linux'
+    return o
+
+
diff --git a/import-layers/yocto-poky/meta/classes/gobject-introspection.bbclass b/import-layers/yocto-poky/meta/classes/gobject-introspection.bbclass
index 37389cb..b6160b8 100644
--- a/import-layers/yocto-poky/meta/classes/gobject-introspection.bbclass
+++ b/import-layers/yocto-poky/meta/classes/gobject-introspection.bbclass
@@ -17,7 +17,7 @@
 
 # Generating introspection data depends on a combination of native and target
 # introspection tools, and qemu to run the target tools.
-DEPENDS_append_class-target = " gobject-introspection gobject-introspection-native qemu-native"
+DEPENDS_append_class-target = " gobject-introspection gobject-introspection-native qemu-native prelink-native"
 
 # Even though introspection is disabled on -native, gobject-introspection package is still
 # needed for m4 macros.
diff --git a/import-layers/yocto-poky/meta/classes/grub-efi.bbclass b/import-layers/yocto-poky/meta/classes/grub-efi.bbclass
index 17417ba..df7fe18 100644
--- a/import-layers/yocto-poky/meta/classes/grub-efi.bbclass
+++ b/import-layers/yocto-poky/meta/classes/grub-efi.bbclass
@@ -40,13 +40,15 @@
 
 	install -d ${DEST}${EFIDIR}
 
-	GRUB_IMAGE="bootia32.efi"
+	GRUB_IMAGE="grub-efi-bootia32.efi"
+	DEST_IMAGE="bootia32.efi"
 	if [ "${TARGET_ARCH}" = "x86_64" ]; then
-		GRUB_IMAGE="bootx64.efi"
+		GRUB_IMAGE="grub-efi-bootx64.efi"
+		DEST_IMAGE="bootx64.efi"
 	fi
-	install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR}
+	install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR}/${DEST_IMAGE}
 	EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
-	printf 'fs0:%s\%s\n' "$EFIPATH" "$GRUB_IMAGE" >${DEST}/startup.nsh
+	printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_IMAGE" >${DEST}/startup.nsh
 
 	install -m 0644 ${GRUB_CFG} ${DEST}${EFIDIR}/grub.cfg
 }
@@ -72,14 +74,14 @@
 python build_efi_cfg() {
     import sys
 
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
     if not workdir:
         bb.error("WORKDIR not defined, unable to package")
         return
 
-    gfxserial = d.getVar('GRUB_GFXSERIAL', True) or ""
+    gfxserial = d.getVar('GRUB_GFXSERIAL') or ""
 
-    labels = d.getVar('LABELS', True)
+    labels = d.getVar('LABELS')
     if not labels:
         bb.debug(1, "LABELS not defined, nothing to do")
         return
@@ -88,7 +90,7 @@
         bb.debug(1, "No labels, nothing to do")
         return
 
-    cfile = d.getVar('GRUB_CFG', True)
+    cfile = d.getVar('GRUB_CFG')
     if not cfile:
         bb.fatal('Unable to read GRUB_CFG')
 
@@ -99,39 +101,38 @@
 
     cfgfile.write('# Automatically created by OE\n')
 
-    opts = d.getVar('GRUB_OPTS', True)
+    opts = d.getVar('GRUB_OPTS')
     if opts:
         for opt in opts.split(';'):
             cfgfile.write('%s\n' % opt)
 
     cfgfile.write('default=%s\n' % (labels.split()[0]))
 
-    timeout = d.getVar('GRUB_TIMEOUT', True)
+    timeout = d.getVar('GRUB_TIMEOUT')
     if timeout:
         cfgfile.write('timeout=%s\n' % timeout)
     else:
         cfgfile.write('timeout=50\n')
 
-    root = d.getVar('GRUB_ROOT', True)
+    root = d.getVar('GRUB_ROOT')
     if not root:
         bb.fatal('GRUB_ROOT not defined')
 
     if gfxserial == "1":
         btypes = [ [ " graphics console", "" ],
-            [ " serial console", d.getVar('GRUB_SERIAL', True) or "" ] ]
+            [ " serial console", d.getVar('GRUB_SERIAL') or "" ] ]
     else:
         btypes = [ [ "", "" ] ]
 
     for label in labels.split():
         localdata = d.createCopy()
 
-        overrides = localdata.getVar('OVERRIDES', True)
+        overrides = localdata.getVar('OVERRIDES')
         if not overrides:
             bb.fatal('OVERRIDES not defined')
 
         for btype in btypes:
             localdata.setVar('OVERRIDES', label + ':' + overrides)
-            bb.data.update_data(localdata)
 
             cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
             lb = label
@@ -141,8 +142,8 @@
 
             cfgfile.write(' %s' % replace_rootfs_uuid(d, root))
 
-            append = localdata.getVar('APPEND', True)
-            initrd = localdata.getVar('INITRD', True)
+            append = localdata.getVar('APPEND')
+            initrd = localdata.getVar('INITRD')
 
             if append:
                 append = replace_rootfs_uuid(d, append)
diff --git a/import-layers/yocto-poky/meta/classes/gsettings.bbclass b/import-layers/yocto-poky/meta/classes/gsettings.bbclass
index dec5abc..eae3dc7 100644
--- a/import-layers/yocto-poky/meta/classes/gsettings.bbclass
+++ b/import-layers/yocto-poky/meta/classes/gsettings.bbclass
@@ -7,31 +7,32 @@
 
 # TODO use a trigger so that this runs once per package operation run
 
-DEPENDS += "glib-2.0-native"
 
 RDEPENDS_${PN} += "glib-2.0-utils"
 
 FILES_${PN} += "${datadir}/glib-2.0/schemas"
 
+PACKAGE_WRITE_DEPS += "glib-2.0-native"
+
 gsettings_postinstrm () {
 	glib-compile-schemas $D${datadir}/glib-2.0/schemas
 }
 
 python populate_packages_append () {
-    pkg = d.getVar('PN', True)
+    pkg = d.getVar('PN')
     bb.note("adding gsettings postinst scripts to %s" % pkg)
 
-    postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
+    postinst = d.getVar('pkg_postinst_%s' % pkg) or d.getVar('pkg_postinst')
     if not postinst:
         postinst = '#!/bin/sh\n'
-    postinst += d.getVar('gsettings_postinstrm', True)
+    postinst += d.getVar('gsettings_postinstrm')
     d.setVar('pkg_postinst_%s' % pkg, postinst)
 
     bb.note("adding gsettings postrm scripts to %s" % pkg)
 
-    postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
+    postrm = d.getVar('pkg_postrm_%s' % pkg) or d.getVar('pkg_postrm')
     if not postrm:
         postrm = '#!/bin/sh\n'
-    postrm += d.getVar('gsettings_postinstrm', True)
+    postrm += d.getVar('gsettings_postinstrm')
     d.setVar('pkg_postrm_%s' % pkg, postrm)
 }
diff --git a/import-layers/yocto-poky/meta/classes/gtk-doc.bbclass b/import-layers/yocto-poky/meta/classes/gtk-doc.bbclass
index 297eac6..0ae2729 100644
--- a/import-layers/yocto-poky/meta/classes/gtk-doc.bbclass
+++ b/import-layers/yocto-poky/meta/classes/gtk-doc.bbclass
@@ -50,7 +50,7 @@
 
 GIR_EXTRA_LIBS_PATH=\`find ${B} -name .libs| tr '\n' ':'\`\$GIR_EXTRA_LIBS_PATH
 
-if test -d ".libs"; then
+if [ -d ".libs" ]; then
     $qemu_binary ".libs/\$@"
 else
     $qemu_binary "\$@"
diff --git a/import-layers/yocto-poky/meta/classes/gtk-icon-cache.bbclass b/import-layers/yocto-poky/meta/classes/gtk-icon-cache.bbclass
index 0f1052b..d87167a 100644
--- a/import-layers/yocto-poky/meta/classes/gtk-icon-cache.bbclass
+++ b/import-layers/yocto-poky/meta/classes/gtk-icon-cache.bbclass
@@ -2,6 +2,8 @@
 
 DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk-icon-utils-native"
 
+PACKAGE_WRITE_DEPS += "gtk-icon-utils-native gdk-pixbuf-native"
+
 gtk_icon_cache_postinst() {
 if [ "x$D" != "x" ]; then
 	$INTERCEPT_DIR/postinst_intercept update_icon_cache ${PKG} \
@@ -35,11 +37,11 @@
 }
 
 python populate_packages_append () {
-    packages = d.getVar('PACKAGES', True).split()
-    pkgdest =  d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES').split()
+    pkgdest =  d.getVar('PKGDEST')
     
     for pkg in packages:
-        icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, d.getVar('datadir', True))
+        icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, d.getVar('datadir'))
         if not os.path.exists(icon_dir):
             continue
 
@@ -49,16 +51,16 @@
     
         bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg)
         
-        postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+        postinst = d.getVar('pkg_postinst_%s' % pkg)
         if not postinst:
             postinst = '#!/bin/sh\n'
-        postinst += d.getVar('gtk_icon_cache_postinst', True)
+        postinst += d.getVar('gtk_icon_cache_postinst')
         d.setVar('pkg_postinst_%s' % pkg, postinst)
 
-        postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+        postrm = d.getVar('pkg_postrm_%s' % pkg)
         if not postrm:
             postrm = '#!/bin/sh\n'
-        postrm += d.getVar('gtk_icon_cache_postrm', True)
+        postrm += d.getVar('gtk_icon_cache_postrm')
         d.setVar('pkg_postrm_%s' % pkg, postrm)
 }
 
diff --git a/import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass b/import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass
index ebbc9de..3d82dbe 100644
--- a/import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass
+++ b/import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass
@@ -2,7 +2,7 @@
 #
 # Usage: Set GTKIMMODULES_PACKAGES to the packages that needs to update the inputmethod modules
 
-DEPENDS =+ "qemu-native"
+PACKAGE_WRITE_DEPS += "qemu-native"
 
 inherit qemu
 
@@ -61,21 +61,21 @@
 }
 
 python populate_packages_append () {
-    gtkimmodules_pkgs = d.getVar('GTKIMMODULES_PACKAGES', True).split()
+    gtkimmodules_pkgs = d.getVar('GTKIMMODULES_PACKAGES').split()
 
     for pkg in gtkimmodules_pkgs:
             bb.note("adding gtk-immodule-cache postinst and postrm scripts to %s" % pkg)
 
-            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            postinst = d.getVar('pkg_postinst_%s' % pkg)
             if not postinst:
                 postinst = '#!/bin/sh\n'
-            postinst += d.getVar('gtk_immodule_cache_postinst', True)
+            postinst += d.getVar('gtk_immodule_cache_postinst')
             d.setVar('pkg_postinst_%s' % pkg, postinst)
 
-            postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+            postrm = d.getVar('pkg_postrm_%s' % pkg)
             if not postrm:
                 postrm = '#!/bin/sh\n'
-            postrm += d.getVar('gtk_immodule_cache_postrm', True)
+            postrm += d.getVar('gtk_immodule_cache_postrm')
             d.setVar('pkg_postrm_%s' % pkg, postrm)
 }
 
diff --git a/import-layers/yocto-poky/meta/classes/gummiboot.bbclass b/import-layers/yocto-poky/meta/classes/gummiboot.bbclass
deleted file mode 100644
index 4f2dea6..0000000
--- a/import-layers/yocto-poky/meta/classes/gummiboot.bbclass
+++ /dev/null
@@ -1,121 +0,0 @@
-# Copyright (C) 2014 Intel Corporation
-#
-# Released under the MIT license (see COPYING.MIT)
-
-# gummiboot.bbclass - equivalent of grub-efi.bbclass
-# Set EFI_PROVIDER = "gummiboot" to use gummiboot on your live images instead of grub-efi
-# (images built by image-live.bbclass or image-vm.bbclass)
-
-do_bootimg[depends] += "${MLPREFIX}gummiboot:do_deploy"
-do_bootdirectdisk[depends] += "${MLPREFIX}gummiboot:do_deploy"
-
-EFIDIR = "/EFI/BOOT"
-
-GUMMIBOOT_CFG ?= "${S}/loader.conf"
-GUMMIBOOT_ENTRIES ?= ""
-GUMMIBOOT_TIMEOUT ?= "10"
-
-# Need UUID utility code.
-inherit fs-uuid
-
-efi_populate() {
-        DEST=$1
-
-        EFI_IMAGE="gummibootia32.efi"
-        DEST_EFI_IMAGE="bootia32.efi"
-        if [ "${TARGET_ARCH}" = "x86_64" ]; then
-            EFI_IMAGE="gummibootx64.efi"
-            DEST_EFI_IMAGE="bootx64.efi"
-        fi
-
-        install -d ${DEST}${EFIDIR}
-        # gummiboot requires these paths for configuration files
-        # they are not customizable so no point in new vars
-        install -d ${DEST}/loader
-        install -d ${DEST}/loader/entries
-        install -m 0644 ${DEPLOY_DIR_IMAGE}/${EFI_IMAGE} ${DEST}${EFIDIR}/${DEST_EFI_IMAGE}
-        EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
-        printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_EFI_IMAGE" >${DEST}/startup.nsh
-        install -m 0644 ${GUMMIBOOT_CFG} ${DEST}/loader/loader.conf
-        for i in ${GUMMIBOOT_ENTRIES}; do
-            install -m 0644 ${i} ${DEST}/loader/entries
-        done
-}
-
-efi_iso_populate() {
-        iso_dir=$1
-        efi_populate $iso_dir
-        mkdir -p ${EFIIMGDIR}/${EFIDIR}
-        cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
-        cp $iso_dir/vmlinuz ${EFIIMGDIR}
-        EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
-        echo "fs0:${EFIPATH}\\${DEST_EFI_IMAGE}" > ${EFIIMGDIR}/startup.nsh
-        if [ -f "$iso_dir/initrd" ] ; then
-            cp $iso_dir/initrd ${EFIIMGDIR}
-        fi
-}
-
-efi_hddimg_populate() {
-        efi_populate $1
-}
-
-python build_efi_cfg() {
-    s = d.getVar("S", True)
-    labels = d.getVar('LABELS', True)
-    if not labels:
-        bb.debug(1, "LABELS not defined, nothing to do")
-        return
-
-    if labels == []:
-        bb.debug(1, "No labels, nothing to do")
-        return
-
-    cfile = d.getVar('GUMMIBOOT_CFG', True)
-    try:
-         cfgfile = open(cfile, 'w')
-    except OSError:
-        bb.fatal('Unable to open %s' % cfile)
-
-    cfgfile.write('# Automatically created by OE\n')
-    cfgfile.write('default %s\n' % (labels.split()[0]))
-    timeout = d.getVar('GUMMIBOOT_TIMEOUT', True)
-    if timeout:
-        cfgfile.write('timeout %s\n' % timeout)
-    else:
-        cfgfile.write('timeout 10\n')
-    cfgfile.close()
-
-    for label in labels.split():
-        localdata = d.createCopy()
-
-        overrides = localdata.getVar('OVERRIDES', True)
-        if not overrides:
-            bb.fatal('OVERRIDES not defined')
-
-        entryfile = "%s/%s.conf" % (s, label)
-        d.appendVar("GUMMIBOOT_ENTRIES", " " + entryfile)
-        try:
-            entrycfg = open(entryfile, "w")
-        except OSError:
-            bb.fatal('Unable to open %s' % entryfile)
-        localdata.setVar('OVERRIDES', label + ':' + overrides)
-        bb.data.update_data(localdata)
-
-        entrycfg.write('title %s\n' % label)
-        entrycfg.write('linux /vmlinuz\n')
-
-        append = localdata.getVar('APPEND', True)
-        initrd = localdata.getVar('INITRD', True)
-
-        if initrd:
-            entrycfg.write('initrd /initrd\n')
-        lb = label
-        if label == "install":
-            lb = "install-efi"
-        entrycfg.write('options LABEL=%s ' % lb)
-        if append:
-            append = replace_rootfs_uuid(d, append)
-            entrycfg.write('%s' % append)
-        entrycfg.write('\n')
-        entrycfg.close()
-}
diff --git a/import-layers/yocto-poky/meta/classes/gzipnative.bbclass b/import-layers/yocto-poky/meta/classes/gzipnative.bbclass
deleted file mode 100644
index 326cbbb..0000000
--- a/import-layers/yocto-poky/meta/classes/gzipnative.bbclass
+++ /dev/null
@@ -1,5 +0,0 @@
-EXTRANATIVEPATH += "pigz-native gzip-native"
-DEPENDS += "gzip-native"
-
-# tar may get run by do_unpack or do_populate_lic which could call gzip
-do_unpack[depends] += "gzip-native:do_populate_sysroot"
diff --git a/import-layers/yocto-poky/meta/classes/icecc.bbclass b/import-layers/yocto-poky/meta/classes/icecc.bbclass
index c572571..77bf611 100644
--- a/import-layers/yocto-poky/meta/classes/icecc.bbclass
+++ b/import-layers/yocto-poky/meta/classes/icecc.bbclass
@@ -101,7 +101,7 @@
     if icecc_is_allarch(bb, d):
         return "no"
 
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
 
     system_class_blacklist = []
     user_class_blacklist = (d.getVar('ICECC_USER_CLASS_BL', False) or "none").split()
@@ -140,7 +140,7 @@
     return "yes"
 
 def icecc_is_allarch(bb, d):
-    return d.getVar("PACKAGE_ARCH", True) == "all" or bb.data.inherits_class('allarch', d)
+    return d.getVar("PACKAGE_ARCH") == "all" or bb.data.inherits_class('allarch', d)
 
 def icecc_is_kernel(bb, d):
     return \
diff --git a/import-layers/yocto-poky/meta/classes/image-buildinfo.bbclass b/import-layers/yocto-poky/meta/classes/image-buildinfo.bbclass
index 3003f5d..213fb9c 100644
--- a/import-layers/yocto-poky/meta/classes/image-buildinfo.bbclass
+++ b/import-layers/yocto-poky/meta/classes/image-buildinfo.bbclass
@@ -12,14 +12,17 @@
 # Desired variables to display 
 IMAGE_BUILDINFO_VARS ?= "DISTRO DISTRO_VERSION"
 
+# Desired location of the output file in the image.
+IMAGE_BUILDINFO_FILE ??= "${sysconfdir}/build"
+
 # From buildhistory.bbclass
 def image_buildinfo_outputvars(vars, listvars, d): 
     vars = vars.split()
     listvars = listvars.split()
     ret = ""
     for var in vars:
-        value = d.getVar(var, True) or ""
-        if (d.getVarFlag(var, 'type', True) == "list"):
+        value = d.getVar(var) or ""
+        if (d.getVarFlag(var, 'type') == "list"):
             value = oe.utils.squashspaces(value)
         ret += "%s = %s\n" % (var, value)
     return ret.rstrip('\n')
@@ -28,7 +31,9 @@
 def get_layer_git_status(path):
     import subprocess
     try:
-        subprocess.check_output("cd %s; PSEUDO_UNLOAD=1 git diff --quiet --no-ext-diff" % path,
+        subprocess.check_output("""cd %s; export PSEUDO_UNLOAD=1; set -e;
+                                git diff --quiet --no-ext-diff
+                                git diff --quiet --no-ext-diff --cached""" % path,
                                 shell=True,
                                 stderr=subprocess.STDOUT)
         return ""
@@ -40,7 +45,7 @@
 
 # Returns layer revisions along with their respective status
 def get_layer_revs(d):
-    layers = (d.getVar("BBLAYERS", True) or "").split()
+    layers = (d.getVar("BBLAYERS") or "").split()
     medadata_revs = ["%-17s = %s:%s %s" % (os.path.basename(i), \
         base_get_metadata_git_branch(i, None).strip(), \
         base_get_metadata_git_revision(i, None), \
@@ -50,16 +55,16 @@
 
 def buildinfo_target(d):
         # Get context
-        if d.getVar('BB_WORKERCONTEXT', True) != '1':
+        if d.getVar('BB_WORKERCONTEXT') != '1':
                 return ""
         # Single and list variables to be read
-        vars = (d.getVar("IMAGE_BUILDINFO_VARS", True) or "")
-        listvars = (d.getVar("IMAGE_BUILDINFO_LVARS", True) or "")
+        vars = (d.getVar("IMAGE_BUILDINFO_VARS") or "")
+        listvars = (d.getVar("IMAGE_BUILDINFO_LVARS") or "")
         return image_buildinfo_outputvars(vars, listvars, d)
 
 # Write build information to target filesystem
 python buildinfo () {
-    with open(d.expand('${IMAGE_ROOTFS}${sysconfdir}/build'), 'w') as build:
+    with open(d.expand('${IMAGE_ROOTFS}${IMAGE_BUILDINFO_FILE}'), 'w') as build:
         build.writelines((
             '''-----------------------
 Build Configuration:  |
diff --git a/import-layers/yocto-poky/meta/classes/image-container.bbclass b/import-layers/yocto-poky/meta/classes/image-container.bbclass
new file mode 100644
index 0000000..f002858
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/image-container.bbclass
@@ -0,0 +1,21 @@
+ROOTFS_BOOTSTRAP_INSTALL = ""
+IMAGE_TYPES_MASKED += "container"
+IMAGE_TYPEDEP_container = "tar.bz2"
+
+python __anonymous() {
+    if "container" in d.getVar("IMAGE_FSTYPES") and \
+       d.getVar("IMAGE_CONTAINER_NO_DUMMY") != "1" and \
+       "linux-dummy" not in d.getVar("PREFERRED_PROVIDER_virtual/kernel"):
+        msg = '"container" is in IMAGE_FSTYPES, but ' \
+              'PREFERRED_PROVIDER_virtual/kernel is not "linux-dummy". ' \
+              'Unless a particular kernel is needed, using linux-dummy will ' \
+              'prevent a kernel from being built, which can reduce ' \
+              'build times. If you don\'t want to use "linux-dummy", set ' \
+              '"IMAGE_CONTAINER_NO_DUMMY" to "1".'
+
+        # Raising skip recipe was Paul's clever idea. It causes the error to
+        # only be shown for the recipes actually requested to build, rather
+        # than bb.fatal which would appear for all recipes inheriting the
+        # class.
+        raise bb.parse.SkipRecipe(msg)
+}
diff --git a/import-layers/yocto-poky/meta/classes/image-live.bbclass b/import-layers/yocto-poky/meta/classes/image-live.bbclass
index 4a634dc..a3d1b4e 100644
--- a/import-layers/yocto-poky/meta/classes/image-live.bbclass
+++ b/import-layers/yocto-poky/meta/classes/image-live.bbclass
@@ -51,8 +51,8 @@
 IMAGE_TYPES_MASKED += "live hddimg iso"
 
 python() {
-    image_b = d.getVar('IMAGE_BASENAME', True)
-    initrd_i = d.getVar('INITRD_IMAGE_LIVE', True)
+    image_b = d.getVar('IMAGE_BASENAME')
+    initrd_i = d.getVar('INITRD_IMAGE_LIVE')
     if image_b == initrd_i:
         bb.error('INITRD_IMAGE_LIVE %s cannot use image live, hddimg or iso.' % initrd_i)
         bb.fatal('Check IMAGE_FSTYPES and INITRAMFS_FSTYPES settings.')
@@ -264,9 +264,9 @@
 
 python do_bootimg() {
     set_live_vm_vars(d, 'LIVE')
-    if d.getVar("PCBIOS", True) == "1":
+    if d.getVar("PCBIOS") == "1":
         bb.build.exec_func('build_syslinux_cfg', d)
-    if d.getVar("EFI", True) == "1":
+    if d.getVar("EFI") == "1":
         bb.build.exec_func('build_efi_cfg', d)
     bb.build.exec_func('build_hddimg', d)
     bb.build.exec_func('build_iso', d)
diff --git a/import-layers/yocto-poky/meta/classes/image-vm.bbclass b/import-layers/yocto-poky/meta/classes/image-vm.bbclass
index 2f35d6b..98bd920 100644
--- a/import-layers/yocto-poky/meta/classes/image-vm.bbclass
+++ b/import-layers/yocto-poky/meta/classes/image-vm.bbclass
@@ -93,7 +93,7 @@
 
 	parted $IMAGE print
 
-	awk "BEGIN { printf \"$(echo ${DISK_SIGNATURE} | fold -w 2 | tac | paste -sd '' | sed 's/\(..\)/\\x&/g')\" }" | \
+	awk "BEGIN { printf \"$(echo ${DISK_SIGNATURE} | sed 's/\(..\)\(..\)\(..\)\(..\)/\\x\4\\x\3\\x\2\\x\1/')\" }" | \
 		dd of=$IMAGE bs=1 seek=440 conv=notrunc
 
 	OFFSET=`expr $END2 / 512`
@@ -112,9 +112,9 @@
 python do_bootdirectdisk() {
     validate_disk_signature(d)
     set_live_vm_vars(d, 'VM')
-    if d.getVar("PCBIOS", True) == "1":
+    if d.getVar("PCBIOS") == "1":
         bb.build.exec_func('build_syslinux_cfg', d)
-    if d.getVar("EFI", True) == "1":
+    if d.getVar("EFI") == "1":
         bb.build.exec_func('build_efi_cfg', d)
     bb.build.exec_func('build_boot_dd', d)
 }
@@ -132,7 +132,7 @@
 def validate_disk_signature(d):
     import re
 
-    disk_signature = d.getVar("DISK_SIGNATURE", True)
+    disk_signature = d.getVar("DISK_SIGNATURE")
 
     if not re.match(r'^[0-9a-fA-F]{8}$', disk_signature):
         bb.fatal("DISK_SIGNATURE '%s' must be an 8 digit hex string" % disk_signature)
@@ -158,11 +158,11 @@
 }
 
 python do_vmimg() {
-    if 'vmdk' in d.getVar('IMAGE_FSTYPES', True):
+    if 'vmdk' in d.getVar('IMAGE_FSTYPES'):
         bb.build.exec_func('create_vmdk_image', d)
-    if 'vdi' in d.getVar('IMAGE_FSTYPES', True):
+    if 'vdi' in d.getVar('IMAGE_FSTYPES'):
         bb.build.exec_func('create_vdi_image', d)
-    if 'qcow2' in d.getVar('IMAGE_FSTYPES', True):
+    if 'qcow2' in d.getVar('IMAGE_FSTYPES'):
         bb.build.exec_func('create_qcow2_image', d)
 }
 
diff --git a/import-layers/yocto-poky/meta/classes/image.bbclass b/import-layers/yocto-poky/meta/classes/image.bbclass
index a9ab2fa..4bcfb87 100644
--- a/import-layers/yocto-poky/meta/classes/image.bbclass
+++ b/import-layers/yocto-poky/meta/classes/image.bbclass
@@ -1,19 +1,17 @@
 inherit rootfs_${IMAGE_PKGTYPE}
 
-# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk
+# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base
 # in the non-Linux SDK_OS case, such as mingw32
-SDKEXTCLASS ?= "${@['populate_sdk', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS", True)]}"
+SDKEXTCLASS ?= "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
 inherit ${SDKEXTCLASS}
 
 TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
 TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}"
 POPULATE_SDK_POST_TARGET_COMMAND += "rootfs_sysroot_relativelinks; "
 
-inherit gzipnative
-
 LICENSE = "MIT"
 PACKAGES = ""
-DEPENDS += "${MLPREFIX}qemuwrapper-cross ${MLPREFIX}depmodwrapper-cross"
+DEPENDS += "${MLPREFIX}qemuwrapper-cross depmodwrapper-cross"
 RDEPENDS += "${PACKAGE_INSTALL} ${LINGUAS_INSTALL}"
 RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}"
 
@@ -31,7 +29,7 @@
 IMAGE_GEN_DEBUGFS ?= "0"
 
 # rootfs bootstrap install
-ROOTFS_BOOTSTRAP_INSTALL = "${@bb.utils.contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"
+ROOTFS_BOOTSTRAP_INSTALL = "run-postinsts"
 
 # These packages will be removed from a read-only rootfs after all other
 # packages have been installed
@@ -51,7 +49,7 @@
 IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}'
 
 def check_image_features(d):
-    valid_features = (d.getVarFlag('IMAGE_FEATURES', 'validitems', True) or "").split()
+    valid_features = (d.getVarFlag('IMAGE_FEATURES', 'validitems') or "").split()
     valid_features += d.getVarFlags('COMPLEMENTARY_GLOB').keys()
     for var in d:
        if var.startswith("PACKAGE_GROUP_"):
@@ -133,7 +131,7 @@
     if bb.utils.contains("IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg
         d.setVar('NOISO', bb.utils.contains('IMAGE_FSTYPES', "iso", "0", "1", d))
         d.setVar('NOHDD', bb.utils.contains('IMAGE_FSTYPES', "hddimg", "0", "1", d))
-        if d.getVar('NOISO', True) == "0" or d.getVar('NOHDD', True) == "0":
+        if d.getVar('NOISO') == "0" or d.getVar('NOHDD') == "0":
             return "image-live"
         return ""
     return "image-live"
@@ -144,37 +142,39 @@
 IMAGE_TYPE_vm = '${@bb.utils.contains_any("IMAGE_FSTYPES", ["vmdk", "vdi", "qcow2", "hdddirect"], "image-vm", "", d)}'
 inherit ${IMAGE_TYPE_vm}
 
+IMAGE_TYPE_container = '${@bb.utils.contains("IMAGE_FSTYPES", "container", "image-container", "", d)}'
+inherit ${IMAGE_TYPE_container}
+
+IMAGE_TYPE_wic = "image_types_wic"
+inherit ${IMAGE_TYPE_wic}
+
 python () {
     deps = " " + imagetypes_getdepends(d)
     d.appendVarFlag('do_rootfs', 'depends', deps)
 
     deps = ""
-    for dep in (d.getVar('EXTRA_IMAGEDEPENDS', True) or "").split():
+    for dep in (d.getVar('EXTRA_IMAGEDEPENDS') or "").split():
         deps += " %s:do_populate_sysroot" % dep
-    d.appendVarFlag('do_build', 'depends', deps)
+    d.appendVarFlag('do_image_complete', 'depends', deps)
 
     #process IMAGE_FEATURES, we must do this before runtime_mapping_rename
     #Check for replaces image features
     features = set(oe.data.typed_value('IMAGE_FEATURES', d))
     remain_features = features.copy()
     for feature in features:
-        replaces = set((d.getVar("IMAGE_FEATURES_REPLACES_%s" % feature, True) or "").split())
+        replaces = set((d.getVar("IMAGE_FEATURES_REPLACES_%s" % feature) or "").split())
         remain_features -= replaces
 
     #Check for conflict image features
     for feature in remain_features:
-        conflicts = set((d.getVar("IMAGE_FEATURES_CONFLICTS_%s" % feature, True) or "").split())
+        conflicts = set((d.getVar("IMAGE_FEATURES_CONFLICTS_%s" % feature) or "").split())
         temp = conflicts & remain_features
         if temp:
-            bb.fatal("%s contains conflicting IMAGE_FEATURES %s %s" % (d.getVar('PN', True), feature, ' '.join(list(temp))))
+            bb.fatal("%s contains conflicting IMAGE_FEATURES %s %s" % (d.getVar('PN'), feature, ' '.join(list(temp))))
 
     d.setVar('IMAGE_FEATURES', ' '.join(sorted(list(remain_features))))
 
     check_image_features(d)
-    initramfs_image = d.getVar('INITRAMFS_IMAGE', True) or ""
-    if initramfs_image != "":
-        d.appendVarFlag('do_build', 'depends', " %s:do_bundle_initramfs" %  d.getVar('PN', True))
-        d.appendVarFlag('do_bundle_initramfs', 'depends', " %s:do_image_complete" % initramfs_image)
 }
 
 IMAGE_CLASSES += "image_types"
@@ -185,7 +185,7 @@
 # some default locales
 IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
 
-LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS', True).split()))}"
+LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS').split()))}"
 
 # Prefer image, but use the fallback files for lookups if the image ones
 # aren't yet available.
@@ -199,6 +199,14 @@
 fakeroot python do_rootfs () {
     from oe.rootfs import create_rootfs
     from oe.manifest import create_manifest
+    import logging
+
+    logger = d.getVar('BB_TASK_LOGGER', False)
+    if logger:
+        logcatcher = bb.utils.LogCatcher()
+        logger.addHandler(logcatcher)
+    else:
+        logcatcher = None
 
     # NOTE: if you add, remove or significantly refactor the stages of this
     # process then you should recalculate the weightings here. This is quite
@@ -212,20 +220,20 @@
     progress_reporter.next_stage()
 
     # Handle package exclusions
-    excl_pkgs = d.getVar("PACKAGE_EXCLUDE", True).split()
-    inst_pkgs = d.getVar("PACKAGE_INSTALL", True).split()
-    inst_attempt_pkgs = d.getVar("PACKAGE_INSTALL_ATTEMPTONLY", True).split()
+    excl_pkgs = d.getVar("PACKAGE_EXCLUDE").split()
+    inst_pkgs = d.getVar("PACKAGE_INSTALL").split()
+    inst_attempt_pkgs = d.getVar("PACKAGE_INSTALL_ATTEMPTONLY").split()
 
     d.setVar('PACKAGE_INSTALL_ORIG', ' '.join(inst_pkgs))
     d.setVar('PACKAGE_INSTALL_ATTEMPTONLY', ' '.join(inst_attempt_pkgs))
 
     for pkg in excl_pkgs:
         if pkg in inst_pkgs:
-            bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL (%s).  It will be removed from the list." % (pkg, d.getVar('PN', True), inst_pkgs))
+            bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL (%s).  It will be removed from the list." % (pkg, d.getVar('PN'), inst_pkgs))
             inst_pkgs.remove(pkg)
 
         if pkg in inst_attempt_pkgs:
-            bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL_ATTEMPTONLY (%s).  It will be removed from the list." % (pkg, d.getVar('PN', True), inst_pkgs))
+            bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL_ATTEMPTONLY (%s).  It will be removed from the list." % (pkg, d.getVar('PN'), inst_pkgs))
             inst_attempt_pkgs.remove(pkg)
 
     d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs))
@@ -235,7 +243,7 @@
     # We have to delay the runtime_mapping_rename until just before rootfs runs
     # otherwise, the multilib renaming could step in and squash any fixups that
     # may have occurred.
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
     runtime_mapping_rename("PACKAGE_INSTALL", pn, d)
     runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", pn, d)
     runtime_mapping_rename("BAD_RECOMMENDATIONS", pn, d)
@@ -246,19 +254,19 @@
     progress_reporter.next_stage()
 
     # generate rootfs
-    create_rootfs(d, progress_reporter=progress_reporter)
+    create_rootfs(d, progress_reporter=progress_reporter, logcatcher=logcatcher)
 
     progress_reporter.finish()
 }
 do_rootfs[dirs] = "${TOPDIR}"
 do_rootfs[cleandirs] += "${S} ${IMGDEPLOYDIR}"
 do_rootfs[umask] = "022"
-addtask rootfs before do_build
+addtask rootfs before do_build after do_prepare_recipe_sysroot
 
 fakeroot python do_image () {
     from oe.utils import execute_pre_post_process
 
-    pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND", True)
+    pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND")
 
     execute_pre_post_process(d, pre_process_cmds)
 }
@@ -269,7 +277,7 @@
 fakeroot python do_image_complete () {
     from oe.utils import execute_pre_post_process
 
-    post_process_cmds = d.getVar("IMAGE_POSTPROCESS_COMMAND", True)
+    post_process_cmds = d.getVar("IMAGE_POSTPROCESS_COMMAND")
 
     execute_pre_post_process(d, post_process_cmds)
 }
@@ -292,7 +300,7 @@
 fakeroot python do_image_qa () {
     from oe.utils import ImageQAFailed
 
-    qa_cmds = (d.getVar('IMAGE_QA_COMMANDS', True) or '').split()
+    qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split()
     qamsg = ""
 
     for cmd in qa_cmds:
@@ -307,40 +315,17 @@
             qamsg = qamsg + '\n'
 
     if qamsg:
-        imgname = d.getVar('IMAGE_NAME', True)
+        imgname = d.getVar('IMAGE_NAME')
         bb.fatal("QA errors found whilst validating image: %s\n%s" % (imgname, qamsg))
 }
 addtask do_image_qa after do_image_complete before do_build
 
-#
-# Write environment variables used by wic
-# to tmp/sysroots/<machine>/imgdata/<image>.env
-#
-python do_rootfs_wicenv () {
-    wicvars = d.getVar('WICVARS', True)
-    if not wicvars:
-        return
-
-    stdir = d.getVar('STAGING_DIR_TARGET', True)
-    outdir = os.path.join(stdir, 'imgdata')
-    bb.utils.mkdirhier(outdir)
-    basename = d.getVar('IMAGE_BASENAME', True)
-    with open(os.path.join(outdir, basename) + '.env', 'w') as envf:
-        for var in wicvars.split():
-            value = d.getVar(var, True)
-            if value:
-                envf.write('%s="%s"\n' % (var, value.strip()))
-}
-addtask do_rootfs_wicenv after do_image before do_image_wic
-do_rootfs_wicenv[vardeps] += "${WICVARS}"
-do_rootfs_wicenv[prefuncs] = 'set_image_size'
-
 def setup_debugfs_variables(d):
     d.appendVar('IMAGE_ROOTFS', '-dbg')
     d.appendVar('IMAGE_LINK_NAME', '-dbg')
     d.appendVar('IMAGE_NAME','-dbg')
     d.setVar('IMAGE_BUILDING_DEBUGFS', 'true')
-    debugfs_image_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True)
+    debugfs_image_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS')
     if debugfs_image_fstypes:
         d.setVar('IMAGE_FSTYPES', debugfs_image_fstypes)
 
@@ -358,7 +343,7 @@
     #
     # Without de-duplication, gen_conversion_cmds() below
     # would create the same compression command multiple times.
-    ctypes = set(d.getVar('CONVERSIONTYPES', True).split())
+    ctypes = set(d.getVar('CONVERSIONTYPES').split())
     old_overrides = d.getVar('OVERRIDES', False)
 
     def _image_base_type(type):
@@ -375,11 +360,11 @@
         return basetype
 
     basetypes = {}
-    alltypes = d.getVar('IMAGE_FSTYPES', True).split()
+    alltypes = d.getVar('IMAGE_FSTYPES').split()
     typedeps = {}
 
-    if d.getVar('IMAGE_GEN_DEBUGFS', True) == "1":
-        debugfs_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True).split()
+    if d.getVar('IMAGE_GEN_DEBUGFS') == "1":
+        debugfs_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS').split()
         for t in debugfs_fstypes:
             alltypes.append("debugfs_" + t)
 
@@ -394,7 +379,7 @@
         if t.startswith("debugfs_"):
             t = t[8:]
             debug = "debugfs_"
-        deps = (d.getVar('IMAGE_TYPEDEP_' + t, True) or "").split()
+        deps = (d.getVar('IMAGE_TYPEDEP_' + t) or "").split()
         vardeps.add('IMAGE_TYPEDEP_' + t)
         if baset not in typedeps:
             typedeps[baset] = set()
@@ -414,7 +399,7 @@
 
     d.appendVarFlag('do_image', 'vardeps', ' '.join(vardeps))
 
-    maskedtypes = (d.getVar('IMAGE_TYPES_MASKED', True) or "").split()
+    maskedtypes = (d.getVar('IMAGE_TYPES_MASKED') or "").split()
     maskedtypes = [dbg + t for t in maskedtypes for dbg in ("", "debugfs_")]
 
     for t in basetypes:
@@ -433,16 +418,17 @@
             debug = "setup_debugfs "
             realt = t[8:]
         localdata.setVar('OVERRIDES', '%s:%s' % (realt, old_overrides))
-        bb.data.update_data(localdata)
         localdata.setVar('type', realt)
         # Delete DATETIME so we don't expand any references to it now
         # This means the task's hash can be stable rather than having hardcoded
         # date/time values. It will get expanded at execution time.
         # Similarly TMPDIR since otherwise we see QA stamp comparision problems
+        # Expand PV else it can trigger get_srcrev which can fail due to these variables being unset
+        localdata.setVar('PV', d.getVar('PV'))
         localdata.delVar('DATETIME')
         localdata.delVar('TMPDIR')
 
-        image_cmd = localdata.getVar("IMAGE_CMD", True)
+        image_cmd = localdata.getVar("IMAGE_CMD")
         vardeps.add('IMAGE_CMD_' + realt)
         if image_cmd:
             cmds.append("\t" + image_cmd)
@@ -464,7 +450,7 @@
                     # Create input image first.
                     gen_conversion_cmds(type)
                     localdata.setVar('type', type)
-                    cmd = "\t" + (localdata.getVar("CONVERSION_CMD_" + ctype, True) or localdata.getVar("COMPRESS_CMD_" + ctype, True))
+                    cmd = "\t" + (localdata.getVar("CONVERSION_CMD_" + ctype) or localdata.getVar("COMPRESS_CMD_" + ctype))
                     if cmd not in cmds:
                         cmds.append(cmd)
                     vardeps.add('CONVERSION_CMD_' + ctype)
@@ -515,17 +501,17 @@
 def get_rootfs_size(d):
     import subprocess
 
-    rootfs_alignment = int(d.getVar('IMAGE_ROOTFS_ALIGNMENT', True))
-    overhead_factor = float(d.getVar('IMAGE_OVERHEAD_FACTOR', True))
-    rootfs_req_size = int(d.getVar('IMAGE_ROOTFS_SIZE', True))
-    rootfs_extra_space = eval(d.getVar('IMAGE_ROOTFS_EXTRA_SPACE', True))
-    rootfs_maxsize = d.getVar('IMAGE_ROOTFS_MAXSIZE', True)
-    image_fstypes = d.getVar('IMAGE_FSTYPES', True) or ''
-    initramfs_fstypes = d.getVar('INITRAMFS_FSTYPES', True) or ''
-    initramfs_maxsize = d.getVar('INITRAMFS_MAXSIZE', True)
+    rootfs_alignment = int(d.getVar('IMAGE_ROOTFS_ALIGNMENT'))
+    overhead_factor = float(d.getVar('IMAGE_OVERHEAD_FACTOR'))
+    rootfs_req_size = int(d.getVar('IMAGE_ROOTFS_SIZE'))
+    rootfs_extra_space = eval(d.getVar('IMAGE_ROOTFS_EXTRA_SPACE'))
+    rootfs_maxsize = d.getVar('IMAGE_ROOTFS_MAXSIZE')
+    image_fstypes = d.getVar('IMAGE_FSTYPES') or ''
+    initramfs_fstypes = d.getVar('INITRAMFS_FSTYPES') or ''
+    initramfs_maxsize = d.getVar('INITRAMFS_MAXSIZE')
 
     output = subprocess.check_output(['du', '-ks',
-                                      d.getVar('IMAGE_ROOTFS', True)])
+                                      d.getVar('IMAGE_ROOTFS')])
     size_kb = int(output.split()[0])
     base_size = size_kb * overhead_factor
     base_size = max(base_size, rootfs_req_size) + rootfs_extra_space
@@ -541,7 +527,7 @@
     # Do not check image size of the debugfs image. This is not supposed
     # to be deployed, etc. so it doesn't make sense to limit the size
     # of the debug.
-    if (d.getVar('IMAGE_BUILDING_DEBUGFS', True) or "") == "true":
+    if (d.getVar('IMAGE_BUILDING_DEBUGFS') or "") == "true":
         return base_size
 
     # Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (if set)
@@ -572,13 +558,13 @@
 #
 python create_symlinks() {
 
-    deploy_dir = d.getVar('IMGDEPLOYDIR', True)
-    img_name = d.getVar('IMAGE_NAME', True)
-    link_name = d.getVar('IMAGE_LINK_NAME', True)
-    manifest_name = d.getVar('IMAGE_MANIFEST', True)
-    taskname = d.getVar("BB_CURRENTTASK", True)
+    deploy_dir = d.getVar('IMGDEPLOYDIR')
+    img_name = d.getVar('IMAGE_NAME')
+    link_name = d.getVar('IMAGE_LINK_NAME')
+    manifest_name = d.getVar('IMAGE_MANIFEST')
+    taskname = d.getVar("BB_CURRENTTASK")
     subimages = (d.getVarFlag("do_" + taskname, 'subimages', False) or "").split()
-    imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix', True) or d.expand("${IMAGE_NAME_SUFFIX}.")
+    imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix') or d.expand("${IMAGE_NAME_SUFFIX}.")
 
     if not link_name:
         return
@@ -604,19 +590,11 @@
 do_configure[noexec] = "1"
 do_compile[noexec] = "1"
 do_install[noexec] = "1"
-do_populate_sysroot[noexec] = "1"
+deltask do_populate_sysroot
 do_package[noexec] = "1"
-do_package_qa[noexec] = "1"
+deltask do_package_qa
 do_packagedata[noexec] = "1"
 do_package_write_ipk[noexec] = "1"
 do_package_write_deb[noexec] = "1"
 do_package_write_rpm[noexec] = "1"
 
-# Allow the kernel to be repacked with the initramfs and boot image file as a single file
-do_bundle_initramfs[depends] += "virtual/kernel:do_bundle_initramfs"
-do_bundle_initramfs[nostamp] = "1"
-do_bundle_initramfs[noexec] = "1"
-do_bundle_initramfs () {
-	:
-}
-addtask bundle_initramfs after do_image_complete
diff --git a/import-layers/yocto-poky/meta/classes/image_types.bbclass b/import-layers/yocto-poky/meta/classes/image_types.bbclass
index 3bfa60b..8db18ac 100644
--- a/import-layers/yocto-poky/meta/classes/image_types.bbclass
+++ b/import-layers/yocto-poky/meta/classes/image_types.bbclass
@@ -23,22 +23,22 @@
         types = typestring.split(".")
         return types[0], types[1:]
 
-    fstypes = set((d.getVar('IMAGE_FSTYPES', True) or "").split())
-    fstypes |= set((d.getVar('IMAGE_FSTYPES_DEBUGFS', True) or "").split())
+    fstypes = set((d.getVar('IMAGE_FSTYPES') or "").split())
+    fstypes |= set((d.getVar('IMAGE_FSTYPES_DEBUGFS') or "").split())
 
     deps = set()
     for typestring in fstypes:
         basetype, resttypes = split_types(typestring)
-        adddep(d.getVar('IMAGE_DEPENDS_%s' % basetype, True) , deps)
+        adddep(d.getVar('IMAGE_DEPENDS_%s' % basetype) , deps)
 
-        for typedepends in (d.getVar("IMAGE_TYPEDEP_%s" % basetype, True) or "").split():
+        for typedepends in (d.getVar("IMAGE_TYPEDEP_%s" % basetype) or "").split():
             base, rest = split_types(typedepends)
-            adddep(d.getVar('IMAGE_DEPENDS_%s' % base, True) , deps)
+            adddep(d.getVar('IMAGE_DEPENDS_%s' % base) , deps)
             resttypes += rest
 
         for ctype in resttypes:
-            adddep(d.getVar("CONVERSION_DEPENDS_%s" % ctype, True), deps)
-            adddep(d.getVar("COMPRESS_DEPENDS_%s" % ctype, True), deps)
+            adddep(d.getVar("CONVERSION_DEPENDS_%s" % ctype), deps)
+            adddep(d.getVar("COMPRESS_DEPENDS_%s" % ctype), deps)
 
     # Sort the set so that ordering is consistant
     return " ".join(sorted(deps))
@@ -74,6 +74,8 @@
 	# Create a sparse image block
 	dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024
 	mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype -d ${IMAGE_ROOTFS}
+	# Error codes 0-3 indicate successfull operation of fsck (no errors or errors corrected)
+	fsck.$fstype -pvfD ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype || [ $? -le 3 ]
 }
 
 IMAGE_CMD_ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}"
@@ -82,12 +84,13 @@
 
 MIN_BTRFS_SIZE ?= "16384"
 IMAGE_CMD_btrfs () {
-	if [ ${ROOTFS_SIZE} -gt ${MIN_BTRFS_SIZE} ]; then
-		dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs count=${ROOTFS_SIZE} bs=1024
-		mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs
-	else
-		bbfatal "Rootfs is too small for BTRFS (Rootfs Actual Size: ${ROOTFS_SIZE}, BTRFS Minimum Size: ${MIN_BTRFS_SIZE})"
+	size=${ROOTFS_SIZE}
+	if [ ${size} -lt ${MIN_BTRFS_SIZE} ] ; then
+		size=${MIN_BTRFS_SIZE}
+		bbwarn "Rootfs size is too small for BTRFS. Filesystem will be extended to ${size}K"
 	fi
+	dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs count=${size} bs=1024
+	mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs
 }
 
 IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs ${EXTRA_IMAGECMD} -noappend"
@@ -192,95 +195,9 @@
 
 IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ubifs ${MKUBIFS_ARGS}"
 
-WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks"
-WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks"
-WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l in '${BBPATH}:${COREBASE}'.split(':'))}"
-WKS_FULL_PATH = "${@wks_search('${WKS_FILES}'.split(), '${WKS_SEARCH_PATH}') or ''}"
-
-def wks_search(files, search_path):
-    for f in files:
-        if os.path.isabs(f):
-            if os.path.exists(f):
-                return f
-        else:
-            searched = bb.utils.which(search_path, f)
-            if searched:
-                return searched
-
-WIC_CREATE_EXTRA_ARGS ?= ""
-
-IMAGE_CMD_wic () {
-	out="${IMGDEPLOYDIR}/${IMAGE_NAME}"
-	wks="${WKS_FULL_PATH}"
-	if [ -z "$wks" ]; then
-		bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately."
-	fi
-
-	BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR_TARGET}/imgdata/" -e "${IMAGE_BASENAME}" -o "$out/" ${WIC_CREATE_EXTRA_ARGS}
-	mv "$out/build/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic"
-	rm -rf "$out/"
-}
-IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES"
-
-# Rebuild when the wks file or vars in WICVARS change
-USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}"
-WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
-do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
-
-python () {
-    if d.getVar('USING_WIC', True) and 'do_bootimg' in d:
-        bb.build.addtask('do_image_wic', '', 'do_bootimg', d)
-}
-
-python do_write_wks_template () {
-    """Write out expanded template contents to WKS_FULL_PATH."""
-    import re
-
-    template_body = d.getVar('_WKS_TEMPLATE', True)
-
-    # Remove any remnant variable references left behind by the expansion
-    # due to undefined variables
-    expand_var_regexp = re.compile(r"\${[^{}@\n\t :]+}")
-    while True:
-        new_body = re.sub(expand_var_regexp, '', template_body)
-        if new_body == template_body:
-            break
-        else:
-            template_body = new_body
-
-    wks_file = d.getVar('WKS_FULL_PATH', True)
-    with open(wks_file, 'w') as f:
-        f.write(template_body)
-}
-
-python () {
-    if d.getVar('USING_WIC', True):
-        wks_file_u = d.getVar('WKS_FULL_PATH', False)
-        wks_file = d.expand(wks_file_u)
-        base, ext = os.path.splitext(wks_file)
-        if ext == '.in' and os.path.exists(wks_file):
-            wks_out_file = os.path.join(d.getVar('WORKDIR', True), os.path.basename(base))
-            d.setVar('WKS_FULL_PATH', wks_out_file)
-            d.setVar('WKS_TEMPLATE_PATH', wks_file_u)
-            d.setVar('WKS_FILE_CHECKSUM', '${WKS_TEMPLATE_PATH}:True')
-
-            try:
-                with open(wks_file, 'r') as f:
-                    body = f.read()
-            except (IOError, OSError) as exc:
-                pass
-            else:
-                # Previously, I used expandWithRefs to get the dependency list
-                # and add it to WICVARS, but there's no point re-parsing the
-                # file in process_wks_template as well, so just put it in
-                # a variable and let the metadata deal with the deps.
-                d.setVar('_WKS_TEMPLATE', body)
-                bb.build.addtask('do_write_wks_template', 'do_image_wic', None, d)
-}
-
 EXTRA_IMAGECMD = ""
 
-inherit siteinfo
+inherit siteinfo kernel-arch
 JFFS2_ENDIANNESS ?= "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '-l', '-b', d)}"
 JFFS2_ERASEBLOCK ?= "0x40000"
 EXTRA_IMAGECMD_jffs2 ?= "--pad ${JFFS2_ENDIANNESS} --eraseblock=${JFFS2_ERASEBLOCK} --no-cleanmarkers"
@@ -328,6 +245,7 @@
     hdddirect \
     elf \
     wic wic.gz wic.bz2 wic.lzma \
+    container \
 "
 
 # Compression is a special case of conversion. The old variable
@@ -336,12 +254,14 @@
 # CONVERSION_CMD/DEPENDS.
 COMPRESSIONTYPES ?= ""
 
-CONVERSIONTYPES = "gz bz2 lzma xz lz4 zip sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap ${COMPRESSIONTYPES}"
+CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot ${COMPRESSIONTYPES}"
 CONVERSION_CMD_lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
 CONVERSION_CMD_gz = "gzip -f -9 -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz"
 CONVERSION_CMD_bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
 CONVERSION_CMD_xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_THREADS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.xz"
-CONVERSION_CMD_lz4 = "lz4c -9 -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4"
+CONVERSION_CMD_lz4 = "lz4 -9 -z ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4"
+CONVERSION_CMD_lz4_legacy = "lz4 -9 -z -l ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4"
+CONVERSION_CMD_lzo = "lzop -9 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
 CONVERSION_CMD_zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zip ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
 CONVERSION_CMD_sum = "sumtool -i ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"
 CONVERSION_CMD_md5sum = "md5sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.md5sum"
@@ -351,14 +271,17 @@
 CONVERSION_CMD_sha384sum = "sha384sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha384sum"
 CONVERSION_CMD_sha512sum = "sha512sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha512sum"
 CONVERSION_CMD_bmap = "bmaptool create ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.bmap"
+CONVERSION_CMD_u-boot = "mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C none -n ${IMAGE_NAME} -d ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.u-boot"
 CONVERSION_DEPENDS_lzma = "xz-native"
-CONVERSION_DEPENDS_gz = ""
+CONVERSION_DEPENDS_gz = "pigz-native"
 CONVERSION_DEPENDS_bz2 = "pbzip2-native"
 CONVERSION_DEPENDS_xz = "xz-native"
 CONVERSION_DEPENDS_lz4 = "lz4-native"
+CONVERSION_DEPENDS_lzo = "lzop-native"
 CONVERSION_DEPENDS_zip = "zip-native"
 CONVERSION_DEPENDS_sum = "mtd-utils-native"
 CONVERSION_DEPENDS_bmap = "bmap-tools-native"
+CONVERSION_DEPENDS_u-boot = "u-boot-mkimage-native"
 
 RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4"
 RUNNABLE_MACHINE_PATTERNS ?= "qemu"
@@ -371,7 +294,3 @@
 # The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES,
 # images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc.
 IMAGE_TYPES_MASKED ?= ""
-
-# The WICVARS variable is used to define list of bitbake variables used in wic code
-# variables from this list is written to <image>.env file
-WICVARS ?= "BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE HDDDIR IMAGE_BASENAME IMAGE_BOOT_FILES IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD ISODIR MACHINE_ARCH ROOTFS_SIZE STAGING_DATADIR STAGING_DIR_NATIVE STAGING_LIBDIR TARGET_SYS"
diff --git a/import-layers/yocto-poky/meta/classes/image_types_uboot.bbclass b/import-layers/yocto-poky/meta/classes/image_types_uboot.bbclass
deleted file mode 100644
index 933fa4d..0000000
--- a/import-layers/yocto-poky/meta/classes/image_types_uboot.bbclass
+++ /dev/null
@@ -1,23 +0,0 @@
-inherit image_types kernel-arch
-
-oe_mkimage () {
-    mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C $2 -n ${IMAGE_NAME} \
-        -d ${IMGDEPLOYDIR}/$1 ${IMGDEPLOYDIR}/$1.u-boot
-}
-
-CONVERSIONTYPES += "gz.u-boot bz2.u-boot lzma.u-boot u-boot"
-
-CONVERSION_DEPENDS_u-boot = "u-boot-mkimage-native"
-CONVERSION_CMD_u-boot      = "oe_mkimage ${IMAGE_NAME}.rootfs.${type} none"
-
-CONVERSION_DEPENDS_gz.u-boot = "u-boot-mkimage-native"
-CONVERSION_CMD_gz.u-boot      = "${CONVERSION_CMD_gz}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.gz gzip"
-
-CONVERSION_DEPENDS_bz2.u-boot = "u-boot-mkimage-native"
-CONVERSION_CMD_bz2.u-boot      = "${CONVERSION_CMD_bz2}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.bz2 bzip2"
-
-CONVERSION_DEPENDS_lzma.u-boot = "u-boot-mkimage-native"
-CONVERSION_CMD_lzma.u-boot      = "${CONVERSION_CMD_lzma}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.lzma lzma"
-
-IMAGE_TYPES += "ext2.u-boot ext2.gz.u-boot ext2.bz2.u-boot ext2.lzma.u-boot ext3.gz.u-boot ext4.gz.u-boot cpio.gz.u-boot"
-
diff --git a/import-layers/yocto-poky/meta/classes/image_types_wic.bbclass b/import-layers/yocto-poky/meta/classes/image_types_wic.bbclass
new file mode 100644
index 0000000..68f251c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/image_types_wic.bbclass
@@ -0,0 +1,117 @@
+# The WICVARS variable is used to define list of bitbake variables used in wic code
+# variables from this list is written to <image>.env file
+WICVARS ?= "\
+           BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE FAKEROOTCMD IMAGE_BASENAME IMAGE_BOOT_FILES \
+           IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD INITRD_LIVE ISODIR RECIPE_SYSROOT_NATIVE \
+           ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TARGET_SYS TRANSLATED_TARGET_ARCH"
+
+WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks"
+WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks"
+WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/wic' % p for p in '${BBPATH}'.split(':'))}:${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l in '${BBPATH}:${COREBASE}'.split(':'))}"
+WKS_FULL_PATH = "${@wks_search(d.getVar('WKS_FILES').split(), d.getVar('WKS_SEARCH_PATH')) or ''}"
+
+def wks_search(files, search_path):
+    for f in files:
+        if os.path.isabs(f):
+            if os.path.exists(f):
+                return f
+        else:
+            searched = bb.utils.which(search_path, f)
+            if searched:
+                return searched
+
+WIC_CREATE_EXTRA_ARGS ?= ""
+
+IMAGE_CMD_wic () {
+	out="${IMGDEPLOYDIR}/${IMAGE_NAME}"
+	wks="${WKS_FULL_PATH}"
+	if [ -z "$wks" ]; then
+		bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately."
+	fi
+
+	BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$out/" ${WIC_CREATE_EXTRA_ARGS}
+	mv "$out/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic"
+	rm -rf "$out/"
+}
+IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR"
+
+# Rebuild when the wks file or vars in WICVARS change
+USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}"
+WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
+do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
+do_image_wic[depends] += "wic-tools:do_populate_sysroot"
+WKS_FILE_DEPENDS ??= ''
+DEPENDS += "${@ '${WKS_FILE_DEPENDS}' if d.getVar('USING_WIC') else '' }"
+
+python do_write_wks_template () {
+    """Write out expanded template contents to WKS_FULL_PATH."""
+    import re
+
+    template_body = d.getVar('_WKS_TEMPLATE')
+
+    # Remove any remnant variable references left behind by the expansion
+    # due to undefined variables
+    expand_var_regexp = re.compile(r"\${[^{}@\n\t :]+}")
+    while True:
+        new_body = re.sub(expand_var_regexp, '', template_body)
+        if new_body == template_body:
+            break
+        else:
+            template_body = new_body
+
+    wks_file = d.getVar('WKS_FULL_PATH')
+    with open(wks_file, 'w') as f:
+        f.write(template_body)
+}
+
+python () {
+    if d.getVar('USING_WIC'):
+        wks_file_u = d.getVar('WKS_FULL_PATH', False)
+        wks_file = d.expand(wks_file_u)
+        base, ext = os.path.splitext(wks_file)
+        if ext == '.in' and os.path.exists(wks_file):
+            wks_out_file = os.path.join(d.getVar('WORKDIR'), os.path.basename(base))
+            d.setVar('WKS_FULL_PATH', wks_out_file)
+            d.setVar('WKS_TEMPLATE_PATH', wks_file_u)
+            d.setVar('WKS_FILE_CHECKSUM', '${WKS_TEMPLATE_PATH}:True')
+
+            # We need to re-parse each time the file changes, and bitbake
+            # needs to be told about that explicitly.
+            bb.parse.mark_dependency(d, wks_file)
+
+            try:
+                with open(wks_file, 'r') as f:
+                    body = f.read()
+            except (IOError, OSError) as exc:
+                pass
+            else:
+                # Previously, I used expandWithRefs to get the dependency list
+                # and add it to WICVARS, but there's no point re-parsing the
+                # file in process_wks_template as well, so just put it in
+                # a variable and let the metadata deal with the deps.
+                d.setVar('_WKS_TEMPLATE', body)
+                bb.build.addtask('do_write_wks_template', 'do_image_wic', None, d)
+}
+
+#
+# Write environment variables used by wic
+# to tmp/sysroots/<machine>/imgdata/<image>.env
+#
+python do_rootfs_wicenv () {
+    wicvars = d.getVar('WICVARS')
+    if not wicvars:
+        return
+
+    stdir = d.getVar('STAGING_DIR')
+    outdir = os.path.join(stdir, d.getVar('MACHINE'), 'imgdata')
+    bb.utils.mkdirhier(outdir)
+    basename = d.getVar('IMAGE_BASENAME')
+    with open(os.path.join(outdir, basename) + '.env', 'w') as envf:
+        for var in wicvars.split():
+            value = d.getVar(var)
+            if value:
+                envf.write('%s="%s"\n' % (var, value.strip()))
+}
+addtask do_rootfs_wicenv after do_image before do_image_wic
+do_rootfs_wicenv[vardeps] += "${WICVARS}"
+do_rootfs_wicenv[prefuncs] = 'set_image_size'
diff --git a/import-layers/yocto-poky/meta/classes/insane.bbclass b/import-layers/yocto-poky/meta/classes/insane.bbclass
index 7bbe8b6..0c11c36 100644
--- a/import-layers/yocto-poky/meta/classes/insane.bbclass
+++ b/import-layers/yocto-poky/meta/classes/insane.bbclass
@@ -30,7 +30,7 @@
 WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
             textrel already-stripped incompatible-license files-invalid \
             installed-vs-shipped compile-host-path install-host-path \
-            pn-overrides infodir build-deps file-rdeps \
+            pn-overrides infodir build-deps \
             unknown-configure-option symlink-to-sysroot multilib \
             invalid-packageconfig host-user-contaminated \
             "
@@ -38,7 +38,7 @@
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
             split-strip packages-list pkgv-undefined var-undefined \
             version-going-backwards expanded-d invalid-chars \
-            license-checksum dev-elf \
+            license-checksum dev-elf file-rdeps \
             "
 FAKEROOT_QA = "host-user-contaminated"
 FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \
@@ -138,6 +138,7 @@
                         "microblaze":  (189,     0,    0,          False,         32),
                         "microblazeeb":(189,     0,    0,          False,         32),
                         "microblazeel":(189,     0,    0,          True,          32),
+                        "sh4":        (  42,     0,    0,          True,          32),
                       },
             "uclinux-uclibc" : {
                         "bfin":       ( 106,     0,    0,          True,         32),
@@ -173,12 +174,14 @@
             "linux-gnun32" :       {
                         "mips64":       ( 8,     0,    0,          False,         32),
                         "mips64el":     ( 8,     0,    0,          True,          32),
+                        "mipsisa64r6":  ( 8,     0,    0,          False,         32),
+                        "mipsisa64r6el":( 8,     0,    0,          True,          32),
                       },
         }
 
     # Add in any extra user supplied data which may come from a BSP layer, removing the
     # need to always change this class directly
-    extra_machdata = (d.getVar("PACKAGEQA_EXTRA_MACHDEFFUNCS", True) or "").split()
+    extra_machdata = (d.getVar("PACKAGEQA_EXTRA_MACHDEFFUNCS") or "").split()
     for m in extra_machdata:
         call = m + "(machdata, d)"
         locs = { "machdata" : machdata, "d" : d}
@@ -193,23 +196,23 @@
     TMPDIR is stripped, otherwise PKGDEST/pkg is stripped.
     """
     if pkg:
-        path = path.replace(os.path.join(d.getVar("PKGDEST", True), pkg), "/")
-    return path.replace(d.getVar("TMPDIR", True), "/").replace("//", "/")
+        path = path.replace(os.path.join(d.getVar("PKGDEST"), pkg), "/")
+    return path.replace(d.getVar("TMPDIR"), "/").replace("//", "/")
 
 def package_qa_write_error(type, error, d):
-    logfile = d.getVar('QA_LOGFILE', True)
+    logfile = d.getVar('QA_LOGFILE')
     if logfile:
-        p = d.getVar('P', True)
+        p = d.getVar('P')
         with open(logfile, "a+") as f:
             f.write("%s: %s [%s]\n" % (p, error, type))
 
 def package_qa_handle_error(error_class, error_msg, d):
     package_qa_write_error(error_class, error_msg, d)
-    if error_class in (d.getVar("ERROR_QA", True) or "").split():
+    if error_class in (d.getVar("ERROR_QA") or "").split():
         bb.error("QA Issue: %s [%s]" % (error_msg, error_class))
         d.setVar("QA_SANE", False)
         return False
-    elif error_class in (d.getVar("WARN_QA", True) or "").split():
+    elif error_class in (d.getVar("WARN_QA") or "").split():
         bb.warn("QA Issue: %s [%s]" % (error_msg, error_class))
     else:
         bb.note("QA Issue: %s [%s]" % (error_msg, error_class))
@@ -225,7 +228,7 @@
 def package_qa_check_libexec(path,name, d, elf, messages):
 
     # Skip the case where the default is explicitly /usr/libexec
-    libexec = d.getVar('libexecdir', True)
+    libexec = d.getVar('libexecdir')
     if libexec == "/usr/libexec":
         return True
 
@@ -246,7 +249,7 @@
     if os.path.islink(file):
         return
 
-    bad_dirs = [d.getVar('BASE_WORKDIR', True), d.getVar('STAGING_DIR_TARGET', True)]
+    bad_dirs = [d.getVar('BASE_WORKDIR'), d.getVar('STAGING_DIR_TARGET')]
 
     phdrs = elf.run_objdump("-p", d)
 
@@ -274,8 +277,8 @@
     if os.path.islink(file):
         return
 
-    libdir = d.getVar("libdir", True)
-    base_libdir = d.getVar("base_libdir", True)
+    libdir = d.getVar("libdir")
+    base_libdir = d.getVar("base_libdir")
 
     phdrs = elf.run_objdump("-p", d)
 
@@ -332,11 +335,11 @@
     """
     import re
 
-    pkgdest = d.getVar('PKGDEST', True)
-    base_libdir = d.getVar("base_libdir",True) + os.sep
-    libdir = d.getVar("libdir", True) + os.sep
-    libexecdir = d.getVar("libexecdir", True) + os.sep
-    exec_prefix = d.getVar("exec_prefix", True) + os.sep
+    pkgdest = d.getVar('PKGDEST')
+    base_libdir = d.getVar("base_libdir") + os.sep
+    libdir = d.getVar("libdir") + os.sep
+    libexecdir = d.getVar("libexecdir") + os.sep
+    exec_prefix = d.getVar("exec_prefix") + os.sep
 
     messages = []
 
@@ -351,10 +354,10 @@
             # Skip subdirectories for any packages with libdir in INSANE_SKIP
             skippackages = []
             for package in dirs:
-                if 'libdir' in (d.getVar('INSANE_SKIP_' + package, True) or "").split():
+                if 'libdir' in (d.getVar('INSANE_SKIP_' + package) or "").split():
                     bb.note("Package %s skipping libdir QA test" % (package))
                     skippackages.append(package)
-                elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == 'debug-file-directory' and package.endswith("-dbg"):
+                elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-file-directory' and package.endswith("-dbg"):
                     bb.note("Package %s skipping libdir QA test for PACKAGE_DEBUG_SPLIT_STYLE equals debug-file-directory" % (package))
                     skippackages.append(package)
             for package in skippackages:
@@ -395,7 +398,7 @@
 
     if not "-dbg" in name and not "-ptest" in name:
         if '.debug' in path.split(os.path.sep):
-            messages("debug-files", "non debug package contains .debug directory: %s path %s" % \
+            package_qa_add_message(messages, "debug-files", "non debug package contains .debug directory: %s path %s" % \
                      (name, package_qa_clean_path(path,d)))
 
 QAPATHTEST[perms] = "package_qa_check_perm"
@@ -405,7 +408,6 @@
     """
     return
 
-
 QAPATHTEST[unsafe-references-in-scripts] = "package_qa_check_unsafe_references_in_scripts"
 def package_qa_check_unsafe_references_in_scripts(path, name, d, elf, messages):
     """
@@ -417,13 +419,13 @@
     if not elf:
         import stat
         import subprocess
-        pn = d.getVar('PN', True)
+        pn = d.getVar('PN')
 
         # Ensure we're checking an executable script
         statinfo = os.stat(path)
         if bool(statinfo.st_mode & stat.S_IXUSR):
             # grep shell scripts for possible references to /exec_prefix/
-            exec_prefix = d.getVar('exec_prefix', True)
+            exec_prefix = d.getVar('exec_prefix')
             statement = "grep -e '%s/[^ :]\{1,\}/[^ :]\{1,\}' %s > /dev/null" % (exec_prefix, path)
             if subprocess.call(statement, shell=True) == 0:
                 error_msg = pn + ": Found a reference to %s/ in %s" % (exec_prefix, path)
@@ -447,19 +449,19 @@
         return True
 
     # Skip unusual rootfs layouts which make these tests irrelevant
-    exec_prefix = d.getVar('exec_prefix', True)
+    exec_prefix = d.getVar('exec_prefix')
     if exec_prefix == "":
         return True
 
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
     pkgdest = pkgdest + "/" + name
     pkgdest = os.path.abspath(pkgdest)
-    base_bindir = pkgdest + d.getVar('base_bindir', True)
-    base_sbindir = pkgdest + d.getVar('base_sbindir', True)
-    base_libdir = pkgdest + d.getVar('base_libdir', True)
-    bindir = pkgdest + d.getVar('bindir', True)
-    sbindir = pkgdest + d.getVar('sbindir', True)
-    libdir = pkgdest + d.getVar('libdir', True)
+    base_bindir = pkgdest + d.getVar('base_bindir')
+    base_sbindir = pkgdest + d.getVar('base_sbindir')
+    base_libdir = pkgdest + d.getVar('base_libdir')
+    bindir = pkgdest + d.getVar('bindir')
+    sbindir = pkgdest + d.getVar('sbindir')
+    libdir = pkgdest + d.getVar('libdir')
 
     if base_bindir == bindir and base_sbindir == sbindir and base_libdir == libdir:
         return True
@@ -481,13 +483,13 @@
     if not elf:
         return
 
-    target_os   = d.getVar('TARGET_OS', True)
-    target_arch = d.getVar('TARGET_ARCH', True)
-    provides = d.getVar('PROVIDES', True)
-    bpn = d.getVar('BPN', True)
+    target_os   = d.getVar('TARGET_OS')
+    target_arch = d.getVar('TARGET_ARCH')
+    provides = d.getVar('PROVIDES')
+    bpn = d.getVar('BPN')
 
     if target_arch == "allarch":
-        pn = d.getVar('PN', True)
+        pn = d.getVar('PN')
         package_qa_add_message(messages, "arch", pn + ": Recipe inherits the allarch class, but has packaged architecture-specific binaries")
         return
 
@@ -507,7 +509,7 @@
 
     # Check the architecture and endiannes of the binary
     is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \
-            (target_os == "linux-gnux32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE', True)))
+            (target_os == "linux-gnux32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE')))
     if not ((machine == elf.machine()) or is_32):
         package_qa_add_message(messages, "arch", "Architecture did not match (%s, expected %s) on %s" % \
                  (oe.qa.elf_machine_to_string(elf.machine()), oe.qa.elf_machine_to_string(machine), package_qa_clean_path(path,d)))
@@ -524,7 +526,7 @@
     Run all desktop files through desktop-file-validate.
     """
     if path.endswith(".desktop"):
-        desktop_file_validate = os.path.join(d.getVar('STAGING_BINDIR_NATIVE',True),'desktop-file-validate')
+        desktop_file_validate = os.path.join(d.getVar('STAGING_BINDIR_NATIVE'),'desktop-file-validate')
         output = os.popen("%s %s" % (desktop_file_validate, path))
         # This only produces output on errors
         for l in output:
@@ -566,9 +568,9 @@
     if os.path.islink(path):
         return
 
-    gnu_hash = "--hash-style=gnu" in d.getVar('LDFLAGS', True)
+    gnu_hash = "--hash-style=gnu" in d.getVar('LDFLAGS')
     if not gnu_hash:
-        gnu_hash = "--hash-style=both" in d.getVar('LDFLAGS', True)
+        gnu_hash = "--hash-style=both" in d.getVar('LDFLAGS')
     if not gnu_hash:
         return
 
@@ -607,7 +609,7 @@
     if path.find(name + "/CONTROL/") != -1 or path.find(name + "/DEBIAN/") != -1:
         return
 
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
     with open(path, 'rb') as f:
         file_content = f.read().decode('utf-8', errors='ignore')
         if tmpdir in file_content:
@@ -626,8 +628,8 @@
 
     driverdir = d.expand("${libdir}/xorg/modules/drivers/")
     if driverdir in path and path.endswith(".so"):
-        mlprefix = d.getVar('MLPREFIX', True) or ''
-        for rdep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + name, True) or ""):
+        mlprefix = d.getVar('MLPREFIX') or ''
+        for rdep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + name) or ""):
             if rdep.startswith("%sxorg-abi-" % mlprefix):
                 return
         package_qa_add_message(messages, "xorg-driver-abi", "Package %s contains Xorg driver (%s) but no xorg-abi- dependencies" % (name, os.path.basename(path)))
@@ -650,9 +652,9 @@
     if os.path.islink(path):
         target = os.readlink(path)
         if os.path.isabs(target):
-            tmpdir = d.getVar('TMPDIR', True)
+            tmpdir = d.getVar('TMPDIR')
             if target.startswith(tmpdir):
-                trimmed = path.replace(os.path.join (d.getVar("PKGDEST", True), name), "")
+                trimmed = path.replace(os.path.join (d.getVar("PKGDEST"), name), "")
                 package_qa_add_message(messages, "symlink-to-sysroot", "Symlink %s in %s points to TMPDIR" % (trimmed, name))
 
 # Check license variables
@@ -664,17 +666,17 @@
     import tempfile
     sane = True
 
-    lic_files = d.getVar('LIC_FILES_CHKSUM', True) or ''
-    lic = d.getVar('LICENSE', True)
-    pn = d.getVar('PN', True)
+    lic_files = d.getVar('LIC_FILES_CHKSUM') or ''
+    lic = d.getVar('LICENSE')
+    pn = d.getVar('PN')
 
     if lic == "CLOSED":
         return
 
-    if not lic_files and d.getVar('SRC_URI', True):
+    if not lic_files and d.getVar('SRC_URI'):
         sane = package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d)
 
-    srcdir = d.getVar('S', True)
+    srcdir = d.getVar('S')
 
     for url in lic_files.split():
         try:
@@ -696,17 +698,21 @@
 
         if (not beginline) and (not endline):
             md5chksum = bb.utils.md5_file(srclicfile)
+            with open(srclicfile, 'rb') as f:
+                license = f.read()
         else:
             fi = open(srclicfile, 'rb')
             fo = tempfile.NamedTemporaryFile(mode='wb', prefix='poky.', suffix='.tmp', delete=False)
             tmplicfile = fo.name;
             lineno = 0
             linesout = 0
+            license = []
             for line in fi:
                 lineno += 1
                 if (lineno >= beginline):
                     if ((lineno <= endline) or not endline):
                         fo.write(line)
+                        license.append(line)
                         linesout += 1
                     else:
                         break
@@ -714,6 +720,7 @@
             fo.close()
             fi.close()
             md5chksum = bb.utils.md5_file(tmplicfile)
+            license = b''.join(license)
             os.unlink(tmplicfile)
 
         if recipemd5 == md5chksum:
@@ -722,6 +729,30 @@
             if recipemd5:
                 msg = pn + ": The LIC_FILES_CHKSUM does not match for " + url
                 msg = msg + "\n" + pn + ": The new md5 checksum is " + md5chksum
+                try:
+                    license_lines = license.decode('utf-8').split('\n')
+                except:
+                    # License text might not be valid UTF-8, in which
+                    # case we don't know how to include it in our output
+                    # and have to skip it.
+                    pass
+                else:
+                    max_lines = int(d.getVar('QA_MAX_LICENSE_LINES') or 20)
+                    if not license_lines or license_lines[-1] != '':
+                        # Ensure that our license text ends with a line break
+                        # (will be added with join() below).
+                        license_lines.append('')
+                    remove = len(license_lines) - max_lines
+                    if remove > 0:
+                        start = max_lines // 2
+                        end = start + remove - 1
+                        del license_lines[start:end]
+                        license_lines.insert(start, '...')
+                    msg = msg + "\n" + pn + ": Here is the selected license text:" + \
+                          "\n" + \
+                          "{:v^70}".format(" beginline=%d " % beginline if beginline else "") + \
+                          "\n" + "\n".join(license_lines) + \
+                          "{:^^70}".format(" endline=%d " % endline if endline else "")
                 if beginline:
                     if endline:
                         srcfiledesc = "%s (lines %d through to %d)" % (srclicfile, beginline, endline)
@@ -752,8 +783,9 @@
     """
 
     sane = True
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
     workdir = os.path.join(tmpdir, "work")
+    recipesysroot = d.getVar("RECIPE_SYSROOT")
 
     if bb.data.inherits_class("native", d) or bb.data.inherits_class("cross", d):
         pkgconfigcheck = workdir
@@ -769,12 +801,14 @@
             if file.endswith(".la"):
                 with open(path) as f:
                     file_content = f.read()
+                    file_content = file_content.replace(recipesysroot, "")
                     if workdir in file_content:
                         error_msg = "%s failed sanity test (workdir) in path %s" % (file,root)
                         sane = package_qa_handle_error("la", error_msg, d)
             elif file.endswith(".pc"):
                 with open(path) as f:
                     file_content = f.read()
+                    file_content = file_content.replace(recipesysroot, "")
                     if pkgconfigcheck in file_content:
                         error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root)
                         sane = package_qa_handle_error("pkgconfig", error_msg, d)
@@ -803,8 +837,8 @@
     import oe.qa
 
     #if this will throw an exception, then fix the dict above
-    target_os   = d.getVar('TARGET_OS', True)
-    target_arch = d.getVar('TARGET_ARCH', True)
+    target_os   = d.getVar('TARGET_OS')
+    target_arch = d.getVar('TARGET_ARCH')
 
     warnings = {}
     errors = {}
@@ -833,11 +867,10 @@
 
     if not "-dbg" in pkg and not "packagegroup-" in pkg and not "-image" in pkg:
         localdata = bb.data.createCopy(d)
-        localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', True) + ':' + pkg)
-        bb.data.update_data(localdata)
+        localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES') + ':' + pkg)
 
         # Now check the RDEPENDS
-        rdepends = bb.utils.explode_deps(localdata.getVar('RDEPENDS', True) or "")
+        rdepends = bb.utils.explode_deps(localdata.getVar('RDEPENDS') or "")
 
         # Now do the sanity check!!!
         if "build-deps" not in skip:
@@ -853,7 +886,7 @@
                     if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps:
                         continue
                     if not rdep_data or not 'PN' in rdep_data:
-                        pkgdata_dir = d.getVar("PKGDATA_DIR", True)
+                        pkgdata_dir = d.getVar("PKGDATA_DIR")
                         try:
                             possibles = os.listdir("%s/runtime-rprovides/%s/" % (pkgdata_dir, rdepend))
                         except OSError:
@@ -873,14 +906,15 @@
         if "file-rdeps" not in skip:
             ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env', 'rtld(GNU_HASH)'])
             if bb.data.inherits_class('nativesdk', d):
-                ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl'])
+                ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl', 'perl'])
             # For Saving the FILERDEPENDS
             filerdepends = {}
             rdep_data = oe.packagedata.read_subpkgdata(pkg, d)
             for key in rdep_data:
                 if key.startswith("FILERDEPENDS_"):
-                    for subkey in rdep_data[key].split():
-                        if subkey not in ignored_file_rdeps:
+                    for subkey in bb.utils.explode_deps(rdep_data[key]):
+                        if subkey not in ignored_file_rdeps and \
+                                not subkey.startswith('perl('):
                             # We already know it starts with FILERDEPENDS_
                             filerdepends[subkey] = key[13:]
 
@@ -895,11 +929,10 @@
                         sub_rdeps = rdep_data.get("RDEPENDS_" + rdep)
                         if not sub_rdeps:
                             continue
-                        for sub_rdep in sub_rdeps.split():
+                        for sub_rdep in bb.utils.explode_deps(sub_rdeps):
                             if sub_rdep in done:
                                 continue
-                            if not sub_rdep.startswith('(') and \
-                                    oe.packagedata.has_subpkgdata(sub_rdep, d):
+                            if oe.packagedata.has_subpkgdata(sub_rdep, d):
                                 # It's a new rdep
                                 done.append(sub_rdep)
                                 new.append(sub_rdep)
@@ -912,16 +945,20 @@
                 # The python is not a package, but python-core provides it, so
                 # skip checking /usr/bin/python if python is in the rdeps, in
                 # case there is a RDEPENDS_pkg = "python" in the recipe.
-                for py in [ d.getVar('MLPREFIX', True) + "python", "python" ]:
+                for py in [ d.getVar('MLPREFIX') + "python", "python" ]:
                     if py in done:
                         filerdepends.pop("/usr/bin/python",None)
                         done.remove(py)
                 for rdep in done:
+                    # The file dependencies may contain package names, e.g.,
+                    # perl
+                    filerdepends.pop(rdep,None)
+
                     # For Saving the FILERPROVIDES, RPROVIDES and FILES_INFO
                     rdep_data = oe.packagedata.read_subpkgdata(rdep, d)
                     for key in rdep_data:
                         if key.startswith("FILERPROVIDES_") or key.startswith("RPROVIDES_"):
-                            for subkey in rdep_data[key].split():
+                            for subkey in bb.utils.explode_deps(rdep_data[key]):
                                 filerdepends.pop(subkey,None)
                         # Add the files list to the rprovides
                         if key == "FILES_INFO":
@@ -935,17 +972,16 @@
                 for key in filerdepends:
                     error_msg = "%s contained in package %s requires %s, but no providers found in RDEPENDS_%s?" % \
                             (filerdepends[key].replace("_%s" % pkg, "").replace("@underscore@", "_"), pkg, key, pkg)
-                package_qa_handle_error("file-rdeps", error_msg, d)
+                    package_qa_handle_error("file-rdeps", error_msg, d)
 
 def package_qa_check_deps(pkg, pkgdest, skip, d):
 
     localdata = bb.data.createCopy(d)
     localdata.setVar('OVERRIDES', pkg)
-    bb.data.update_data(localdata)
 
     def check_valid_deps(var):
         try:
-            rvar = bb.utils.explode_dep_versions2(localdata.getVar(var, True) or "")
+            rvar = bb.utils.explode_dep_versions2(localdata.getVar(var) or "")
         except ValueError as e:
             bb.fatal("%s_%s: %s" % (var, pkg, e))
         for dep in rvar:
@@ -968,10 +1004,10 @@
     variables, warn the user to use it correctly.
     """
     sane = True
-    expanded_d = d.getVar('D', True)
+    expanded_d = d.getVar('D')
 
     for var in 'FILES','pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm':
-        bbvar = d.getVar(var + "_" + package, True) or ""
+        bbvar = d.getVar(var + "_" + package) or ""
         if expanded_d in bbvar:
             if var == 'FILES':
                 package_qa_add_message(messages, "expanded-d", "FILES in %s recipe should not contain the ${D} variable as it references the local build directory not the target filesystem, best solution is to remove the ${D} reference" % package)
@@ -984,7 +1020,7 @@
 def package_qa_check_encoding(keys, encode, d):
     def check_encoding(key, enc):
         sane = True
-        value = d.getVar(key, True)
+        value = d.getVar(key)
         if value:
             try:
                 s = value.encode(enc)
@@ -1009,8 +1045,8 @@
     if not os.path.lexists(path):
         return
 
-    dest = d.getVar('PKGDEST', True)
-    pn = d.getVar('PN', True)
+    dest = d.getVar('PKGDEST')
+    pn = d.getVar('PN')
     home = os.path.join(dest, 'home')
     if path == home or path.startswith(home + os.sep):
         return
@@ -1023,12 +1059,12 @@
             raise
     else:
         rootfs_path = path[len(dest):]
-        check_uid = int(d.getVar('HOST_USER_UID', True))
+        check_uid = int(d.getVar('HOST_USER_UID'))
         if stat.st_uid == check_uid:
             package_qa_add_message(messages, "host-user-contaminated", "%s: %s is owned by uid %d, which is the same as the user running bitbake. This may be due to host contamination" % (pn, rootfs_path, check_uid))
             return False
 
-        check_gid = int(d.getVar('HOST_USER_GID', True))
+        check_gid = int(d.getVar('HOST_USER_GID'))
         if stat.st_gid == check_gid:
             package_qa_add_message(messages, "host-user-contaminated", "%s: %s is owned by gid %d, which is the same as the user running bitbake. This may be due to host contamination" % (pn, rootfs_path, check_gid))
             return False
@@ -1046,8 +1082,8 @@
     # Check non UTF-8 characters on recipe's metadata
     package_qa_check_encoding(['DESCRIPTION', 'SUMMARY', 'LICENSE', 'SECTION'], 'utf-8', d)
 
-    logdir = d.getVar('T', True)
-    pkg = d.getVar('PN', True)
+    logdir = d.getVar('T')
+    pkg = d.getVar('PN')
 
     # Check the compile log for host contamination
     compilelog = os.path.join(logdir,"log.do_compile")
@@ -1070,8 +1106,8 @@
             package_qa_handle_error("install-host-path", msg, d)
 
     # Scan the packages...
-    pkgdest = d.getVar('PKGDEST', True)
-    packages = set((d.getVar('PACKAGES', True) or '').split())
+    pkgdest = d.getVar('PKGDEST')
+    packages = set((d.getVar('PACKAGES') or '').split())
 
     cpath = oe.cachedpath.CachedPath()
     global pkgfiles
@@ -1100,7 +1136,7 @@
             testmatrix = d.getVarFlags(matrix_name) or {}
             g = globals()
             warnchecks = []
-            for w in (d.getVar("WARN_QA", True) or "").split():
+            for w in (d.getVar("WARN_QA") or "").split():
                 if w in skip:
                    continue
                 if w in testmatrix and testmatrix[w] in g:
@@ -1109,7 +1145,7 @@
                     oe.utils.write_ld_so_conf(d)
 
             errorchecks = []
-            for e in (d.getVar("ERROR_QA", True) or "").split():
+            for e in (d.getVar("ERROR_QA") or "").split():
                 if e in skip:
                    continue
                 if e in testmatrix and testmatrix[e] in g:
@@ -1118,7 +1154,8 @@
                     oe.utils.write_ld_so_conf(d)
             return warnchecks, errorchecks
 
-        skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split()
+        skip = set((d.getVar('INSANE_SKIP') or "").split() +
+                   (d.getVar('INSANE_SKIP_' + package) or "").split())
         if skip:
             bb.note("Package %s skipping QA tests: %s" % (package, str(skip)))
 
@@ -1138,15 +1175,18 @@
         package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d)
         package_qa_check_deps(package, pkgdest, skip, d)
 
-    if 'libdir' in d.getVar("ALL_QA", True).split():
+    if 'libdir' in d.getVar("ALL_QA").split():
         package_qa_check_libdir(d)
 
-    qa_sane = d.getVar("QA_SANE", True)
+    qa_sane = d.getVar("QA_SANE")
     if not qa_sane:
         bb.fatal("QA run found fatal errors. Please consider fixing them.")
     bb.note("DONE with PACKAGE QA")
 }
 
+# binutils is used for most checks, so need to set as dependency
+# POPULATESYSROOTDEPS is defined in staging class.
+do_package_qa[depends] += "${POPULATESYSROOTDEPS}"
 do_package_qa[vardepsexclude] = "BB_TASKDEPDATA"
 do_package_qa[rdeptask] = "do_packagedata"
 addtask do_package_qa after do_packagedata do_package before do_build
@@ -1174,7 +1214,7 @@
     ###########################################################################
 
     configs = []
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
 
     if bb.data.inherits_class('autotools', d):
         bb.note("Checking autotools environment for common misconfiguration")
@@ -1195,16 +1235,16 @@
     # Check gettext configuration and dependencies are correct
     ###########################################################################
 
-    cnf = d.getVar('EXTRA_OECONF', True) or ""
-    if "gettext" not in d.getVar('P', True) and "gcc-runtime" not in d.getVar('P', True) and "--disable-nls" not in cnf:
-        ml = d.getVar("MLPREFIX", True) or ""
+    cnf = d.getVar('EXTRA_OECONF') or ""
+    if "gettext" not in d.getVar('P') and "gcc-runtime" not in d.getVar('P') and "--disable-nls" not in cnf:
+        ml = d.getVar("MLPREFIX") or ""
         if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk', d):
             gt = "gettext-native"
         elif bb.data.inherits_class('cross-canadian', d):
             gt = "nativesdk-gettext"
         else:
             gt = "virtual/" + ml + "gettext"
-        deps = bb.utils.explode_deps(d.getVar('DEPENDS', True) or "")
+        deps = bb.utils.explode_deps(d.getVar('DEPENDS') or "")
         if gt not in deps:
             for config in configs:
                 gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config
@@ -1219,40 +1259,40 @@
         bb.note("Checking configure output for unrecognised options")
         try:
             flag = "WARNING: unrecognized options:"
-            log = os.path.join(d.getVar('B', True), 'config.log')
+            log = os.path.join(d.getVar('B'), 'config.log')
             output = subprocess.check_output(['grep', '-F', flag, log]).decode("utf-8").replace(', ', ' ')
             options = set()
             for line in output.splitlines():
                 options |= set(line.partition(flag)[2].split())
-            whitelist = set(d.getVar("UNKNOWN_CONFIGURE_WHITELIST", True).split())
+            whitelist = set(d.getVar("UNKNOWN_CONFIGURE_WHITELIST").split())
             options -= whitelist
             if options:
-                pn = d.getVar('PN', True)
+                pn = d.getVar('PN')
                 error_msg = pn + ": configure was passed unrecognised options: " + " ".join(options)
                 package_qa_handle_error("unknown-configure-option", error_msg, d)
         except subprocess.CalledProcessError:
             pass
 
     # Check invalid PACKAGECONFIG
-    pkgconfig = (d.getVar("PACKAGECONFIG", True) or "").split()
+    pkgconfig = (d.getVar("PACKAGECONFIG") or "").split()
     if pkgconfig:
         pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
         for pconfig in pkgconfig:
             if pconfig not in pkgconfigflags:
-                pn = d.getVar('PN', True)
+                pn = d.getVar('PN')
                 error_msg = "%s: invalid PACKAGECONFIG: %s" % (pn, pconfig)
                 package_qa_handle_error("invalid-packageconfig", error_msg, d)
 
-    qa_sane = d.getVar("QA_SANE", True)
+    qa_sane = d.getVar("QA_SANE")
     if not qa_sane:
         bb.fatal("Fatal QA errors found, failing task.")
 }
 
 python do_qa_unpack() {
-    src_uri = d.getVar('SRC_URI', True)
-    s_dir = d.getVar('S', True)
+    src_uri = d.getVar('SRC_URI')
+    s_dir = d.getVar('S')
     if src_uri and not os.path.exists(s_dir):
-        bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN', True), d.getVar('S', False), s_dir))
+        bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN'), d.getVar('S', False), s_dir))
 }
 
 # The Staging Func, to check all staging
@@ -1268,7 +1308,7 @@
 do_unpack[postfuncs] += "do_qa_unpack"
 
 python () {
-    tests = d.getVar('ALL_QA', True).split()
+    tests = d.getVar('ALL_QA').split()
     if "desktop" in tests:
         d.appendVar("PACKAGE_DEPENDS", " desktop-file-utils-native")
 
@@ -1277,7 +1317,7 @@
     ###########################################################################
 
     # Checking ${FILESEXTRAPATHS}
-    extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "")
+    extrapaths = (d.getVar("FILESEXTRAPATHS") or "")
     if '__default' not in extrapaths.split(":"):
         msg = "FILESEXTRAPATHS-variable, must always use _prepend (or _append)\n"
         msg += "type of assignment, and don't forget the colon.\n"
@@ -1289,29 +1329,29 @@
         msg += "%s\n" % extrapaths
         bb.warn(msg)
 
-    overrides = d.getVar('OVERRIDES', True).split(':')
-    pn = d.getVar('PN', True)
+    overrides = d.getVar('OVERRIDES').split(':')
+    pn = d.getVar('PN')
     if pn in overrides:
-        msg = 'Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE", True), pn)
+        msg = 'Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE"), pn)
         package_qa_handle_error("pn-overrides", msg, d)
 
     issues = []
-    if (d.getVar('PACKAGES', True) or "").split():
-        for dep in (d.getVar('QADEPENDS', True) or "").split():
+    if (d.getVar('PACKAGES') or "").split():
+        for dep in (d.getVar('QADEPENDS') or "").split():
             d.appendVarFlag('do_package_qa', 'depends', " %s:do_populate_sysroot" % dep)
         for var in 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RCONFLICTS', 'RPROVIDES', 'RREPLACES', 'FILES', 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm', 'ALLOW_EMPTY':
             if d.getVar(var, False):
                 issues.append(var)
 
-        fakeroot_tests = d.getVar('FAKEROOT_QA', True).split()
+        fakeroot_tests = d.getVar('FAKEROOT_QA').split()
         if set(tests) & set(fakeroot_tests):
             d.setVarFlag('do_package_qa', 'fakeroot', '1')
             d.appendVarFlag('do_package_qa', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
     else:
         d.setVarFlag('do_package_qa', 'rdeptask', '')
     for i in issues:
-        package_qa_handle_error("pkgvarcheck", "%s: Variable %s is set as not being package specific, please fix this." % (d.getVar("FILE", True), i), d)
-    qa_sane = d.getVar("QA_SANE", True)
+        package_qa_handle_error("pkgvarcheck", "%s: Variable %s is set as not being package specific, please fix this." % (d.getVar("FILE"), i), d)
+    qa_sane = d.getVar("QA_SANE")
     if not qa_sane:
         bb.fatal("Fatal QA errors found, failing task.")
 }
diff --git a/import-layers/yocto-poky/meta/classes/kernel-arch.bbclass b/import-layers/yocto-poky/meta/classes/kernel-arch.bbclass
index ea976c6..d036fcf 100644
--- a/import-layers/yocto-poky/meta/classes/kernel-arch.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernel-arch.bbclass
@@ -19,7 +19,7 @@
 def map_kernel_arch(a, d):
     import re
 
-    valid_archs = d.getVar('valid_archs', True).split()
+    valid_archs = d.getVar('valid_archs').split()
 
     if   re.match('(i.86|athlon|x86.64)$', a):  return 'x86'
     elif re.match('armeb$', a):                 return 'arm'
@@ -32,9 +32,11 @@
     elif re.match('microblazee[bl]', a):        return 'microblaze'
     elif a in valid_archs:                      return a
     else:
+        if not d.getVar("TARGET_OS").startswith("linux"):
+            return a
         bb.error("cannot map '%s' to a linux kernel architecture" % a)
 
-export ARCH = "${@map_kernel_arch(d.getVar('TARGET_ARCH', True), d)}"
+export ARCH = "${@map_kernel_arch(d.getVar('TARGET_ARCH'), d)}"
 
 def map_uboot_arch(a, d):
     import re
@@ -43,7 +45,7 @@
     elif re.match('i.86$', a): return 'x86'
     return a
 
-export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH', True), d)}"
+export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH'), d)}"
 
 # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
 # specific options necessary for building the kernel and modules.
@@ -57,4 +59,5 @@
 KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd"
 KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
 KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
+TOOLCHAIN = "gcc"
 
diff --git a/import-layers/yocto-poky/meta/classes/kernel-fitimage.bbclass b/import-layers/yocto-poky/meta/classes/kernel-fitimage.bbclass
index 05be1f0..179185b 100644
--- a/import-layers/yocto-poky/meta/classes/kernel-fitimage.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernel-fitimage.bbclass
@@ -1,13 +1,15 @@
 inherit kernel-uboot uboot-sign
 
 python __anonymous () {
-    kerneltypes = d.getVar('KERNEL_IMAGETYPES', True) or ""
+    kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
     if 'fitImage' in kerneltypes.split():
-        depends = d.getVar("DEPENDS", True)
+        depends = d.getVar("DEPENDS")
         depends = "%s u-boot-mkimage-native dtc-native" % depends
         d.setVar("DEPENDS", depends)
 
-        if d.getVar("UBOOT_ARCH", True) == "x86":
+        if d.getVar("UBOOT_ARCH") == "mips":
+            replacementtype = "vmlinuz.bin"
+        elif d.getVar("UBOOT_ARCH") == "x86":
             replacementtype = "bzImage"
         else:
             replacementtype = "zImage"
@@ -15,19 +17,19 @@
 	# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
 	# to kernel.bbclass . We have to override it, since we pack zImage
 	# (at least for now) into the fitImage .
-        typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE", True) or ""
+        typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
         if 'fitImage' in typeformake.split():
             d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', replacementtype))
 
-        image = d.getVar('INITRAMFS_IMAGE', True)
+        image = d.getVar('INITRAMFS_IMAGE')
         if image:
             d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
 
         # Verified boot will sign the fitImage and append the public key to
-        # U-boot dtb. We ensure the U-Boot dtb is deployed before assembling
+        # U-Boot dtb. We ensure the U-Boot dtb is deployed before assembling
         # the fitImage:
-        if d.getVar('UBOOT_SIGN_ENABLE', True):
-            uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot', True) or 'u-boot'
+        if d.getVar('UBOOT_SIGN_ENABLE') == "1":
+            uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'
             d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_deploy' % uboot_pn)
 }
 
@@ -96,9 +98,9 @@
 	kernel_csum="sha1"
 
 	ENTRYPOINT=${UBOOT_ENTRYPOINT}
-	if test -n "${UBOOT_ENTRYSYMBOL}"; then
-		ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
-			awk '$4=="${UBOOT_ENTRYSYMBOL}" {print $2}'`
+	if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
+		ENTRYPOINT=`${HOST_PREFIX}nm vmlinux | \
+			awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
 	fi
 
 	cat << EOF >> ${1}
@@ -229,9 +231,10 @@
 #
 # $1 ... .its filename
 # $2 ... Linux kernel ID
-# $3 ... DTB image ID
+# $3 ... DTB image name
 # $4 ... ramdisk ID
 # $5 ... config ID
+# $6 ... default flag
 fitimage_emit_section_config() {
 
 	conf_csum="sha1"
@@ -244,6 +247,8 @@
 	kernel_line="kernel = \"kernel@${2}\";"
 	fdt_line=""
 	ramdisk_line=""
+	setup_line=""
+	default_line=""
 
 	if [ -n "${3}" ]; then
 		conf_desc="${conf_desc}, FDT blob"
@@ -260,10 +265,14 @@
 		setup_line="setup = \"setup@${5}\";"
 	fi
 
+	if [ "${6}" = "1" ]; then
+		default_line="default = \"conf@${3}\";"
+	fi
+
 	cat << EOF >> ${1}
-                default = "conf@1";
-                conf@1 {
-                        description = "${conf_desc}";
+                ${default_line}
+                conf@${3} {
+			description = "${6} ${conf_desc}";
 			${kernel_line}
 			${fdt_line}
 			${ramdisk_line}
@@ -314,6 +323,7 @@
 fitimage_assemble() {
 	kernelcount=1
 	dtbcount=""
+	DTBS=""
 	ramdiskcount=${3}
 	setupcount=""
 	rm -f ${1} arch/${ARCH}/boot/${2}
@@ -331,7 +341,7 @@
 	#
 	# Step 2: Prepare a DTB image section
 	#
-	if test -n "${KERNEL_DEVICETREE}"; then
+	if [ -n "${KERNEL_DEVICETREE}" ]; then
 		dtbcount=1
 		for DTB in ${KERNEL_DEVICETREE}; do
 			if echo ${DTB} | grep -q '/dts/'; then
@@ -343,15 +353,16 @@
 				DTB_PATH="arch/${ARCH}/boot/${DTB}"
 			fi
 
-			fitimage_emit_section_dtb ${1} ${dtbcount} ${DTB_PATH}
-			dtbcount=`expr ${dtbcount} + 1`
+			DTB=$(echo "${DTB}" | tr '/' '_')
+			DTBS="${DTBS} ${DTB}"
+			fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
 		done
 	fi
 
 	#
 	# Step 3: Prepare a setup section. (For x86)
 	#
-	if test -e arch/${ARCH}/boot/setup.bin ; then
+	if [ -e arch/${ARCH}/boot/setup.bin ]; then
 		setupcount=1
 		fitimage_emit_section_setup ${1} "${setupcount}" arch/${ARCH}/boot/setup.bin
 	fi
@@ -362,7 +373,7 @@
 	if [ "x${ramdiskcount}" = "x1" ] ; then
 		# Find and use the first initramfs image archive type we find
 		for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do
-			initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${img}"
+			initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
 			echo "Using $initramfs_path"
 			if [ -e "${initramfs_path}" ]; then
 				fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}"
@@ -375,7 +386,7 @@
 
 	# Force the first Kernel and DTB in the default config
 	kernelcount=1
-	if test -n "${dtbcount}"; then
+	if [ -n "${dtbcount}" ]; then
 		dtbcount=1
 	fi
 
@@ -384,7 +395,13 @@
 	#
 	fitimage_emit_section_maint ${1} confstart
 
-	fitimage_emit_section_config ${1} "${kernelcount}" "${dtbcount}" "${ramdiskcount}" "${setupcount}"
+	if [ -n "${DTBS}" ]; then
+		i=1
+		for DTB in ${DTBS}; do
+			fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
+			i=`expr ${i} + 1`
+		done
+	fi
 
 	fitimage_emit_section_maint ${1} sectend
 
@@ -445,11 +462,11 @@
 
 		if [ -n "${INITRAMFS_IMAGE}" ]; then
 			echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..."
-			its_initramfs_base_name="fitImage-its-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
-			its_initramfs_symlink_name=fitImage-its-${INITRAMFS_IMAGE}-${MACHINE}
+			its_initramfs_base_name="fitImage-its-${INITRAMFS_IMAGE_NAME}-${PV}-${PR}-${DATETIME}"
+			its_initramfs_symlink_name=fitImage-its-${INITRAMFS_IMAGE_NAME}
 			install -m 0644 fit-image-${INITRAMFS_IMAGE}.its ${DEPLOYDIR}/${its_initramfs_base_name}.its
-			fit_initramfs_base_name="fitImage-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
-			fit_initramfs_symlink_name=fitImage-${INITRAMFS_IMAGE}-${MACHINE}
+			fit_initramfs_base_name="fitImage-${INITRAMFS_IMAGE_NAME}-${PV}-${PR}-${DATETIME}"
+			fit_initramfs_symlink_name=fitImage-${INITRAMFS_IMAGE_NAME}
 			install -m 0644 arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} ${DEPLOYDIR}/${fit_initramfs_base_name}.bin
 		fi
 
diff --git a/import-layers/yocto-poky/meta/classes/kernel-grub.bbclass b/import-layers/yocto-poky/meta/classes/kernel-grub.bbclass
index f7dcc07..5d92f3b 100644
--- a/import-layers/yocto-poky/meta/classes/kernel-grub.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernel-grub.bbclass
@@ -92,7 +92,7 @@
 	fi
 '''
 
-    imagetypes = d.getVar('KERNEL_IMAGETYPES', True)
+    imagetypes = d.getVar('KERNEL_IMAGETYPES')
     imagetypes = re.sub(r'\.gz$', '', imagetypes)
 
     for type in imagetypes.split():
diff --git a/import-layers/yocto-poky/meta/classes/kernel-module-split.bbclass b/import-layers/yocto-poky/meta/classes/kernel-module-split.bbclass
index 08d2262..5e10dcf 100644
--- a/import-layers/yocto-poky/meta/classes/kernel-module-split.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernel-module-split.bbclass
@@ -22,6 +22,8 @@
 fi
 }
 
+PACKAGE_WRITE_DEPS += "kmod-native depmodwrapper-cross"
+
 do_install_append() {
 	install -d ${D}${sysconfdir}/modules-load.d/ ${D}${sysconfdir}/modprobe.d/
 }
@@ -31,6 +33,8 @@
 KERNEL_MODULES_META_PACKAGE ?= "kernel-modules"
 
 KERNEL_MODULE_PACKAGE_PREFIX ?= ""
+KERNEL_MODULE_PACKAGE_SUFFIX ?= "-${KERNEL_VERSION}"
+KERNEL_MODULE_PROVIDE_VIRTUAL ?= "1"
 
 python split_kernel_module_packages () {
     import re
@@ -39,10 +43,10 @@
 
     def extract_modinfo(file):
         import tempfile, subprocess
-        tempfile.tempdir = d.getVar("WORKDIR", True)
+        tempfile.tempdir = d.getVar("WORKDIR")
         tf = tempfile.mkstemp()
         tmpfile = tf[1]
-        cmd = "%sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("HOST_PREFIX", True) or "", file, tmpfile)
+        cmd = "%sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("HOST_PREFIX") or "", file, tmpfile)
         subprocess.call(cmd, shell=True)
         f = open(tmpfile)
         l = f.read().split("\000")
@@ -60,12 +64,12 @@
     def frob_metadata(file, pkg, pattern, format, basename):
         vals = extract_modinfo(file)
 
-        dvar = d.getVar('PKGD', True)
+        dvar = d.getVar('PKGD')
 
         # If autoloading is requested, output /etc/modules-load.d/<name>.conf and append
         # appropriate modprobe commands to the postinst
-        autoloadlist = (d.getVar("KERNEL_MODULE_AUTOLOAD", True) or "").split()
-        autoload = d.getVar('module_autoload_%s' % basename, True)
+        autoloadlist = (d.getVar("KERNEL_MODULE_AUTOLOAD") or "").split()
+        autoload = d.getVar('module_autoload_%s' % basename)
         if autoload and autoload == basename:
             bb.warn("module_autoload_%s was replaced by KERNEL_MODULE_AUTOLOAD for cases where basename == module name, please drop it" % basename)
         if autoload and basename not in autoloadlist:
@@ -79,15 +83,15 @@
             else:
                 f.write('%s\n' % basename)
             f.close()
-            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            postinst = d.getVar('pkg_postinst_%s' % pkg)
             if not postinst:
                 bb.fatal("pkg_postinst_%s not defined" % pkg)
-            postinst += d.getVar('autoload_postinst_fragment', True) % (autoload or basename)
+            postinst += d.getVar('autoload_postinst_fragment') % (autoload or basename)
             d.setVar('pkg_postinst_%s' % pkg, postinst)
 
         # Write out any modconf fragment
-        modconflist = (d.getVar("KERNEL_MODULE_PROBECONF", True) or "").split()
-        modconf = d.getVar('module_conf_%s' % basename, True)
+        modconflist = (d.getVar("KERNEL_MODULE_PROBECONF") or "").split()
+        modconf = d.getVar('module_conf_%s' % basename)
         if modconf and basename in modconflist:
             name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename)
             f = open(name, 'w')
@@ -96,15 +100,15 @@
         elif modconf:
             bb.error("Please ensure module %s is listed in KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename))
 
-        files = d.getVar('FILES_%s' % pkg, True)
+        files = d.getVar('FILES_%s' % pkg)
         files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename)
         d.setVar('FILES_%s' % pkg, files)
 
         if "description" in vals:
-            old_desc = d.getVar('DESCRIPTION_' + pkg, True) or ""
+            old_desc = d.getVar('DESCRIPTION_' + pkg) or ""
             d.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"])
 
-        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or "")
+        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg) or "")
         modinfo_deps = []
         if "depends" in vals and vals["depends"] != "":
             for dep in vals["depends"].split(","):
@@ -119,26 +123,33 @@
         # Avoid automatic -dev recommendations for modules ending with -dev.
         d.setVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs', 1)
 
+        # Provide virtual package without postfix
+        providevirt = d.getVar('KERNEL_MODULE_PROVIDE_VIRTUAL')
+        if providevirt == "1":
+           postfix = format.split('%s')[1]
+           d.setVar('RPROVIDES_' + pkg, pkg.replace(postfix, ''))
+
     module_regex = '^(.*)\.k?o$'
 
-    module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX', True)
-    module_pattern = module_pattern_prefix + 'kernel-module-%s'
+    module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
+    module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
+    module_pattern = module_pattern_prefix + 'kernel-module-%s' + module_pattern_suffix
 
-    postinst = d.getVar('pkg_postinst_modules', True)
-    postrm = d.getVar('pkg_postrm_modules', True)
+    postinst = d.getVar('pkg_postinst_modules')
+    postrm = d.getVar('pkg_postrm_modules')
 
-    modules = do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION", True)))
+    modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION")))
     if modules:
-        metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE', True)
+        metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
         d.appendVar('RDEPENDS_' + metapkg, ' '+' '.join(modules))
 
     # If modules-load.d and modprobe.d are empty at this point, remove them to
     # avoid warnings. removedirs only raises an OSError if an empty
     # directory cannot be removed.
-    dvar = d.getVar('PKGD', True)
+    dvar = d.getVar('PKGD')
     for dir in ["%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar), "%s/etc" % (dvar)]:
         if len(os.listdir(dir)) == 0:
             os.rmdir(dir)
 }
 
-do_package[vardeps] += '${@" ".join(map(lambda s: "module_conf_" + s, (d.getVar("KERNEL_MODULE_PROBECONF", True) or "").split()))}'
+do_package[vardeps] += '${@" ".join(map(lambda s: "module_conf_" + s, (d.getVar("KERNEL_MODULE_PROBECONF") or "").split()))}'
diff --git a/import-layers/yocto-poky/meta/classes/kernel-uboot.bbclass b/import-layers/yocto-poky/meta/classes/kernel-uboot.bbclass
index 345e7f5..87f0265 100644
--- a/import-layers/yocto-poky/meta/classes/kernel-uboot.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernel-uboot.bbclass
@@ -1,15 +1,21 @@
 uboot_prep_kimage() {
-	if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
+	if [ -e arch/${ARCH}/boot/compressed/vmlinux ]; then
 		vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
 		linux_suffix=""
 		linux_comp="none"
+	elif [ -e arch/${ARCH}/boot/vmlinuz.bin ]; then
+		rm -f linux.bin
+		cp -l arch/${ARCH}/boot/vmlinuz.bin linux.bin
+		vmlinux_path=""
+		linux_suffix=""
+		linux_comp="none"
 	else
 		vmlinux_path="vmlinux"
 		linux_suffix=".gz"
 		linux_comp="gzip"
 	fi
 
-	${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
+	[ -n "${vmlinux_path}" ] && ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
 
 	if [ "${linux_comp}" != "none" ] ; then
 		gzip -9 linux.bin
diff --git a/import-layers/yocto-poky/meta/classes/kernel-uimage.bbclass b/import-layers/yocto-poky/meta/classes/kernel-uimage.bbclass
index 340503a..1d8656e 100644
--- a/import-layers/yocto-poky/meta/classes/kernel-uimage.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernel-uimage.bbclass
@@ -1,8 +1,8 @@
 inherit kernel-uboot
 
 python __anonymous () {
-    if "uImage" in (d.getVar('KERNEL_IMAGETYPES', True) or "").split():
-        depends = d.getVar("DEPENDS", True)
+    if "uImage" in (d.getVar('KERNEL_IMAGETYPES') or "").split():
+        depends = d.getVar("DEPENDS")
         depends = "%s u-boot-mkimage-native" % depends
         d.setVar("DEPENDS", depends)
 
@@ -11,27 +11,25 @@
         # to build uImage using the kernel build system if and only if
         # KEEPUIMAGE == yes. Otherwise, we pack compressed vmlinux into
         # the uImage .
-        if d.getVar("KEEPUIMAGE", True) != 'yes':
-            typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE", True) or ""
+        if d.getVar("KEEPUIMAGE") != 'yes':
+            typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
             if "uImage" in typeformake.split():
                 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('uImage', 'vmlinux'))
+
+            # Enable building of uImage with mkimage
+            bb.build.addtask('do_uboot_mkimage', 'do_install', 'do_kernel_link_images', d)
 }
 
+do_uboot_mkimage[dirs] += "${B}"
 do_uboot_mkimage() {
-	if echo "${KERNEL_IMAGETYPES}" | grep -wq "uImage"; then
-		if test "x${KEEPUIMAGE}" != "xyes" ; then
-			uboot_prep_kimage
+	uboot_prep_kimage
 
-			ENTRYPOINT=${UBOOT_ENTRYPOINT}
-			if test -n "${UBOOT_ENTRYSYMBOL}"; then
-				ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
-					awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
-			fi
-
-			uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage
-			rm -f linux.bin
-		fi
+	ENTRYPOINT=${UBOOT_ENTRYPOINT}
+	if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
+		ENTRYPOINT=`${HOST_PREFIX}nm ${B}/vmlinux | \
+			awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
 	fi
-}
 
-addtask uboot_mkimage before do_install after do_compile
+	uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage
+	rm -f linux.bin
+}
diff --git a/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass b/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass
index a60327a..1ca0756 100644
--- a/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass
@@ -148,7 +148,8 @@
 	# run1: pull all the configuration fragments, no matter where they come from
 	elements="`echo -n ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}`"
 	if [ -n "${elements}" ]; then
-		scc --force -o ${S}/${meta_dir}:cfg,meta ${includes} ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}
+		echo "${bsp_definition}" > ${S}/${meta_dir}/bsp_definition
+		scc --force -o ${S}/${meta_dir}:cfg,merge,meta ${includes} ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}
 		if [ $? -ne 0 ]; then
 			bbfatal_log "Could not generate configuration queue for ${KMACHINE}."
 		fi
@@ -165,6 +166,7 @@
 }
 
 do_patch() {
+	set +e
 	cd ${S}
 
 	check_git_config
@@ -177,6 +179,19 @@
 			bbfatal_log "Patch failures can be resolved in the linux source directory ${S})"
 		fi
 	fi
+
+	if [ -f "${meta_dir}/merge.queue" ]; then
+		# we need to merge all these branches
+		for b in $(cat ${meta_dir}/merge.queue); do
+			git show-ref --verify --quiet refs/heads/${b}
+			if [ $? -eq 0 ]; then
+				bbnote "Merging branch ${b}"
+				git merge -q --no-ff -m "Merge branch ${b}" ${b}
+			else
+				bbfatal "branch ${b} does not exist, cannot merge"
+			fi
+		done
+	fi
 }
 
 do_kernel_checkout() {
@@ -240,6 +255,7 @@
 addtask kernel_checkout before do_kernel_metadata after do_unpack
 addtask kernel_metadata after do_validate_branches do_unpack before do_patch
 do_kernel_metadata[depends] = "kern-tools-native:do_populate_sysroot"
+do_validate_branches[depends] = "kern-tools-native:do_populate_sysroot"
 
 do_kernel_configme[dirs] += "${S} ${B}"
 do_kernel_configme() {
@@ -265,7 +281,8 @@
 
 	meta_dir=$(kgit --meta)
 	configs="$(scc --configs -o ${meta_dir})"
-	if [ -z "${configs}" ]; then
+	if [ $? -ne 0 ]; then
+		bberror "${configs}"
 		bbfatal_log "Could not find configuration queue (${meta_dir}/config.queue)"
 	fi
 
@@ -286,11 +303,11 @@
     # if KMETA isn't set globally by a recipe using this routine, we need to
     # set the default to 'meta'. Otherwise, kconf_check is not passed a valid
     # meta-series for processing
-    kmeta = d.getVar( "KMETA", True ) or "meta"
+    kmeta = d.getVar("KMETA") or "meta"
     if not os.path.exists(kmeta):
         kmeta = "." + kmeta
 
-    pathprefix = "export PATH=%s:%s; " % (d.getVar('PATH', True), "${S}/scripts/util/")
+    pathprefix = "export PATH=%s:%s; " % (d.getVar('PATH'), "${S}/scripts/util/")
 
     cmd = d.expand("scc --configs -o ${S}/.kernel-meta")
     ret, configs = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd))
@@ -298,8 +315,8 @@
     cmd = d.expand("cd ${S}; kconf_check --report -o ${S}/%s/cfg/ ${B}/.config ${S} %s" % (kmeta,configs))
     ret, result = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd))
 
-    config_check_visibility = int(d.getVar( "KCONF_AUDIT_LEVEL", True ) or 0)
-    bsp_check_visibility = int(d.getVar( "KCONF_BSP_AUDIT_LEVEL", True ) or 0)
+    config_check_visibility = int(d.getVar("KCONF_AUDIT_LEVEL") or 0)
+    bsp_check_visibility = int(d.getVar("KCONF_BSP_AUDIT_LEVEL") or 0)
 
     # if config check visibility is non-zero, report dropped configuration values
     mismatch_file = d.expand("${S}/%s/cfg/mismatch.txt" % kmeta)
@@ -350,6 +367,10 @@
 			current_branch=`git rev-parse --abbrev-ref HEAD`
 			git branch "$current_branch-orig"
 			git reset --hard ${force_srcrev}
+			# We've checked out HEAD, make sure we cleanup kgit-s2q fence post check
+			# so the patches are applied as expected otherwise no patching
+			# would be done in some corner cases.
+			kgit-s2q --clean
 		fi
 	fi
 }
diff --git a/import-layers/yocto-poky/meta/classes/kernel.bbclass b/import-layers/yocto-poky/meta/classes/kernel.bbclass
index eefe574..ce2cab6 100644
--- a/import-layers/yocto-poky/meta/classes/kernel.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernel.bbclass
@@ -1,7 +1,12 @@
 inherit linux-kernel-base kernel-module-split
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native lzop-native"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native lzop-native"
+PACKAGE_WRITE_DEPS += "depmodwrapper-cross virtual/update-alternatives-native"
+
+do_deploy[depends] += "depmodwrapper-cross:do_populate_sysroot"
+
+CVE_PRODUCT ?= "linux_kernel"
 
 S = "${STAGING_KERNEL_DIR}"
 B = "${WORKDIR}/build"
@@ -13,6 +18,7 @@
 
 KERNEL_IMAGETYPE ?= "zImage"
 INITRAMFS_IMAGE ?= ""
+INITRAMFS_IMAGE_NAME ?= "${@['${INITRAMFS_IMAGE}-${MACHINE}', ''][d.getVar('INITRAMFS_IMAGE') == '']}"
 INITRAMFS_TASK ?= ""
 INITRAMFS_IMAGE_BUNDLE ?= ""
 
@@ -22,33 +28,36 @@
 # number and cause kernel to be rebuilt. To avoid this, make
 # KERNEL_VERSION_NAME and KERNEL_VERSION_PKG_NAME depend on
 # LINUX_VERSION which is a constant.
-KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION', True) or ""}"
+KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION') or ""}"
 KERNEL_VERSION_NAME[vardepvalue] = "${LINUX_VERSION}"
-KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION', True))}"
+KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
 KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}"
 
 python __anonymous () {
-    import re
 
     # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
-    type = d.getVar('KERNEL_IMAGETYPE', True) or ""
-    alttype = d.getVar('KERNEL_ALT_IMAGETYPE', True) or ""
-    types = d.getVar('KERNEL_IMAGETYPES', True) or ""
+    type = d.getVar('KERNEL_IMAGETYPE') or ""
+    alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or ""
+    types = d.getVar('KERNEL_IMAGETYPES') or ""
     if type not in types.split():
         types = (type + ' ' + types).strip()
     if alttype not in types.split():
         types = (alttype + ' ' + types).strip()
     d.setVar('KERNEL_IMAGETYPES', types)
 
-    typeformake = re.sub(r'\.gz', '', types)
+    # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz
+    # typeformake lists only valid kernel make targets, and post processing can be done after the kernel
+    # is built (such as using gzip to compress vmlinux)
+    typeformake = types.replace('vmlinux.gz', 'vmlinux')
     d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake)
 
     for type in types.split():
         typelower = type.lower()
+        imagedest = d.getVar('KERNEL_IMAGEDEST')
 
         d.appendVar('PACKAGES', ' ' + 'kernel-image-' + typelower)
 
-        d.setVar('FILES_kernel-image-' + typelower, '/boot/' + type + '-${KERNEL_VERSION_NAME}')
+        d.setVar('FILES_kernel-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}')
 
         d.appendVar('RDEPENDS_kernel-image', ' ' + 'kernel-image-' + typelower)
 
@@ -56,15 +65,14 @@
 
         d.setVar('ALLOW_EMPTY_kernel-image-' + typelower, '1')
 
-        imagedest = d.getVar('KERNEL_IMAGEDEST', True)
-        priority = d.getVar('KERNEL_PRIORITY', True)
-        postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n'
+        priority = d.getVar('KERNEL_PRIORITY')
+        postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n'
         d.setVar('pkg_postinst_kernel-image-' + typelower, postinst)
 
         postrm = '#!/bin/sh\n' + 'update-alternatives --remove' + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} || true' + '\n'
         d.setVar('pkg_postrm_kernel-image-' + typelower, postrm)
 
-    image = d.getVar('INITRAMFS_IMAGE', True)
+    image = d.getVar('INITRAMFS_IMAGE')
     if image:
         d.appendVarFlag('do_bundle_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
 
@@ -72,7 +80,7 @@
     #       The preferred method is to set INITRAMFS_IMAGE, because
     #       this INITRAMFS_TASK has circular dependency problems
     #       if the initramfs requires kernel modules
-    image_task = d.getVar('INITRAMFS_TASK', True)
+    image_task = d.getVar('INITRAMFS_TASK')
     if image_task:
         d.appendVarFlag('do_configure', 'depends', ' ${INITRAMFS_TASK}')
 }
@@ -101,15 +109,15 @@
 do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
 do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
 base_do_unpack_append () {
-    s = d.getVar("S", True)
+    s = d.getVar("S")
     if s[-1] == '/':
         # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail
         s=s[:-1]
-    kernsrc = d.getVar("STAGING_KERNEL_DIR", True)
+    kernsrc = d.getVar("STAGING_KERNEL_DIR")
     if s != kernsrc:
         bb.utils.mkdirhier(kernsrc)
         bb.utils.remove(kernsrc, recurse=True)
-        if d.getVar("EXTERNALSRC", True):
+        if d.getVar("EXTERNALSRC"):
             # With EXTERNALSRC S will not be wiped so we can symlink to it
             os.symlink(s, kernsrc)
         else:
@@ -126,10 +134,12 @@
 
 export OS = "${TARGET_OS}"
 export CROSS_COMPILE = "${TARGET_PREFIX}"
+export KBUILD_BUILD_USER = "oe-user"
+export KBUILD_BUILD_HOST = "oe-host"
 
-KERNEL_PRIORITY ?= "${@int(d.getVar('PV', True).split('-')[0].split('+')[0].split('.')[0]) * 10000 + \
-                       int(d.getVar('PV', True).split('-')[0].split('+')[0].split('.')[1]) * 100 + \
-                       int(d.getVar('PV', True).split('-')[0].split('+')[0].split('.')[-1])}"
+KERNEL_PRIORITY ?= "${@int(d.getVar('PV').split('-')[0].split('+')[0].split('.')[0]) * 10000 + \
+                       int(d.getVar('PV').split('-')[0].split('+')[0].split('.')[1]) * 100 + \
+                       int(d.getVar('PV').split('-')[0].split('+')[0].split('.')[-1])}"
 
 KERNEL_RELEASE ?= "${KERNEL_VERSION}"
 
@@ -140,7 +150,7 @@
 #
 # configuration
 #
-export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE", True) or "ttyS0"}"
+export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE") or "ttyS0"}"
 
 KERNEL_VERSION = "${@get_kernelversion_headers('${B}')}"
 
@@ -164,34 +174,34 @@
 	# In case the directory is not created yet from the first pass compile:
 	mkdir -p ${B}/usr
 	# Find and use the first initramfs image archive type we find
-	rm -f ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio
+	rm -f ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
 	for img in cpio cpio.gz cpio.lz4 cpio.lzo cpio.lzma cpio.xz; do
-		if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" ]; then
-			cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img ${B}/usr/.
+		if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img" ]; then
+			cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img ${B}/usr/.
 			case $img in
 			*gz)
 				echo "gzip decompressing image"
-				gunzip -f ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+				gunzip -f ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
 				break
 				;;
 			*lz4)
 				echo "lz4 decompressing image"
-				lz4 -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+				lz4 -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
 				break
 				;;
 			*lzo)
 				echo "lzo decompressing image"
-				lzop -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+				lzop -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
 				break
 				;;
 			*lzma)
 				echo "lzma decompressing image"
-				lzma -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+				lzma -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
 				break
 				;;
 			*xz)
 				echo "xz decompressing image"
-				xz -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+				xz -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
 				break
 				;;
 			esac
@@ -219,7 +229,7 @@
 				tmp_path=$tmp_path" "$type"##"
 			fi
 		done
-		use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio
+		use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
 		kernel_do_compile
 		# Restoring kernel image
 		for tp in $tmp_path ; do
@@ -258,18 +268,16 @@
 		# The old style way of copying an prebuilt image and building it
 		# is turned on via INTIRAMFS_TASK != ""
 		copy_initramfs
-		use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio
+		use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
 	fi
 	for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do
 		oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
-		for type in ${KERNEL_IMAGETYPES} ; do
-			if test "${typeformake}.gz" = "${type}"; then
-				mkdir -p "${KERNEL_OUTPUT_DIR}"
-				gzip -9c < "${typeformake}" > "${KERNEL_OUTPUT_DIR}/${type}"
-				break;
-			fi
-		done
 	done
+	# vmlinux.gz is not built by kernel
+	if (echo "${KERNEL_IMAGETYPES}" | grep -wq "vmlinux\.gz"); then
+		mkdir -p "${KERNEL_OUTPUT_DIR}"
+		gzip -9c < ${B}/vmlinux > "${KERNEL_OUTPUT_DIR}/vmlinux.gz"
+	fi
 }
 
 do_compile_kernelmodules() {
@@ -296,11 +304,11 @@
 	#
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-		oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
-		rm "${D}/lib/modules/${KERNEL_VERSION}/build"
-		rm "${D}/lib/modules/${KERNEL_VERSION}/source"
+		oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
+		rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
+		rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
 		# If the kernel/ directory is empty remove it to prevent QA issues
-		rmdir --ignore-fail-on-non-empty "${D}/lib/modules/${KERNEL_VERSION}/kernel"
+		rmdir --ignore-fail-on-non-empty "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel"
 	else
 		bbnote "no modules to install"
 	fi
@@ -324,6 +332,10 @@
 
 # Must be ran no earlier than after do_kernel_checkout or else Makefile won't be in ${S}/Makefile
 do_kernel_version_sanity_check() {
+	if [ "x${KERNEL_VERSION_SANITY_SKIP}" = "x1" ]; then
+		exit 0
+	fi
+
 	# The Makefile determines the kernel version shown at runtime
 	# Don't use KERNEL_VERSION because the headers it grabs the version from aren't generated until do_compile
 	VERSION=$(grep "^VERSION =" ${S}/Makefile | sed s/.*=\ *//)
@@ -347,7 +359,7 @@
 	reg="${reg}${EXTRAVERSION}"
 
 	if [ -z `echo ${PV} | grep -E "${reg}"` ]; then
-		bbfatal "Package Version (${PV}) does not match of kernel being built (${vers}). Please update the PV variable to match the kernel source."
+		bbfatal "Package Version (${PV}) does not match of kernel being built (${vers}). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP=\"1\" in your recipe."
 	fi
 	exit 0
 }
@@ -430,14 +442,14 @@
 KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} oldnoconfig || yes '' | oe_runmake -C ${S} O=${B} oldconfig"
 
 python check_oldest_kernel() {
-    oldest_kernel = d.getVar('OLDEST_KERNEL', True)
-    kernel_version = d.getVar('KERNEL_VERSION', True)
-    tclibc = d.getVar('TCLIBC', True)
+    oldest_kernel = d.getVar('OLDEST_KERNEL')
+    kernel_version = d.getVar('KERNEL_VERSION')
+    tclibc = d.getVar('TCLIBC')
     if tclibc == 'glibc':
         kernel_version = kernel_version.split('-', 1)[0]
         if oldest_kernel and kernel_version:
             if bb.utils.vercmp_string(kernel_version, oldest_kernel) < 0:
-                bb.warn('%s: OLDEST_KERNEL is "%s" but the version of the kernel you are building is "%s" - therefore %s as built may not be compatible with this kernel. Either set OLDEST_KERNEL to an older version, or build a newer kernel.' % (d.getVar('PN', True), oldest_kernel, kernel_version, tclibc))
+                bb.warn('%s: OLDEST_KERNEL is "%s" but the version of the kernel you are building is "%s" - therefore %s as built may not be compatible with this kernel. Either set OLDEST_KERNEL to an older version, or build a newer kernel.' % (d.getVar('PN'), oldest_kernel, kernel_version, tclibc))
 }
 
 check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION"
@@ -478,9 +490,9 @@
 # kernel-image becomes kernel-image-${KERNEL_VERSION}
 PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-modules"
 FILES_${PN} = ""
-FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin"
+FILES_kernel-base = "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.order ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin"
 FILES_kernel-image = ""
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
 FILES_kernel-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
 FILES_kernel-modules = ""
 RDEPENDS_kernel = "kernel-base"
@@ -511,7 +523,7 @@
 PACKAGESPLITFUNCS_prepend = "split_kernel_packages "
 
 python split_kernel_packages () {
-    do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
+    do_split_packages(d, root='${nonarch_base_libdir}/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
 }
 
 # Many scripts want to look in arch/$arch/boot for the bootable
@@ -527,7 +539,11 @@
 	if [ -f ../../../vmlinuz ]; then
 		ln -sf ../../../vmlinuz
 	fi
+	if [ -f ../../../vmlinuz.bin ]; then
+		ln -sf ../../../vmlinuz.bin
+	fi
 }
+addtask kernel_link_images after do_compile before do_strip
 
 do_strip() {
 	if [ -n "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}" ]; then
@@ -556,7 +572,7 @@
 }
 do_strip[dirs] = "${B}"
 
-addtask do_strip before do_sizecheck after do_kernel_link_images
+addtask strip before do_sizecheck after do_kernel_link_images
 
 # Support checking the kernel size since some kernels need to reside in partitions
 # with a fixed length or there is a limit in transferring the kernel to memory
@@ -623,6 +639,6 @@
 do_deploy[dirs] = "${DEPLOYDIR} ${B}"
 do_deploy[prefuncs] += "package_get_auto_pr"
 
-addtask deploy after do_populate_sysroot
+addtask deploy after do_populate_sysroot do_packagedata
 
 EXPORT_FUNCTIONS do_deploy
diff --git a/import-layers/yocto-poky/meta/classes/kernelsrc.bbclass b/import-layers/yocto-poky/meta/classes/kernelsrc.bbclass
index 9efd46a..675d40e 100644
--- a/import-layers/yocto-poky/meta/classes/kernelsrc.bbclass
+++ b/import-layers/yocto-poky/meta/classes/kernelsrc.bbclass
@@ -1,7 +1,7 @@
 S = "${STAGING_KERNEL_DIR}"
-do_fetch[noexec] = "1"
-do_unpack[depends] += "virtual/kernel:do_patch"
-do_unpack[noexec] = "1"
+deltask do_fetch
+deltask do_unpack
+do_patch[depends] += "virtual/kernel:do_patch"
 do_patch[noexec] = "1"
 do_package[depends] += "virtual/kernel:do_populate_sysroot"
 KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}"
diff --git a/import-layers/yocto-poky/meta/classes/libc-common.bbclass b/import-layers/yocto-poky/meta/classes/libc-common.bbclass
index 11b0065..9ea2c03 100644
--- a/import-layers/yocto-poky/meta/classes/libc-common.bbclass
+++ b/import-layers/yocto-poky/meta/classes/libc-common.bbclass
@@ -17,15 +17,15 @@
 }
 
 def get_libc_fpu_setting(bb, d):
-    if d.getVar('TARGET_FPU', True) in [ 'soft', 'ppc-efd' ]:
+    if d.getVar('TARGET_FPU') in [ 'soft', 'ppc-efd' ]:
         return "--without-fp"
     return ""
 
 python populate_packages_prepend () {
-    if d.getVar('DEBIAN_NAMES', True):
-        pkgs = d.getVar('PACKAGES', True).split()
-        bpn = d.getVar('BPN', True)
-        prefix = d.getVar('MLPREFIX', True) or ""
+    if d.getVar('DEBIAN_NAMES'):
+        pkgs = d.getVar('PACKAGES').split()
+        bpn = d.getVar('BPN')
+        prefix = d.getVar('MLPREFIX') or ""
         # Set the base package...
         d.setVar('PKG_' + prefix + bpn, prefix + 'libc6')
         libcprefix = prefix + bpn + '-'
diff --git a/import-layers/yocto-poky/meta/classes/libc-package.bbclass b/import-layers/yocto-poky/meta/classes/libc-package.bbclass
index 2dc90c4..739adce 100644
--- a/import-layers/yocto-poky/meta/classes/libc-package.bbclass
+++ b/import-layers/yocto-poky/meta/classes/libc-package.bbclass
@@ -9,25 +9,27 @@
 
 GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice"
 
-python __anonymous () {
-    enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True)
+GLIBC_SPLIT_LC_PACKAGES ?= "0"
 
-    pn = d.getVar("PN", True)
+python __anonymous () {
+    enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION")
+
+    pn = d.getVar("PN")
     if pn.endswith("-initial"):
         enabled = False
 
     if enabled and int(enabled):
         import re
 
-        target_arch = d.getVar("TARGET_ARCH", True)
-        binary_arches = d.getVar("BINARY_LOCALE_ARCHES", True) or ""
-        use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", True) or ""
+        target_arch = d.getVar("TARGET_ARCH")
+        binary_arches = d.getVar("BINARY_LOCALE_ARCHES") or ""
+        use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF") or ""
 
         for regexp in binary_arches.split(" "):
             r = re.compile(regexp)
 
             if r.match(target_arch):
-                depends = d.getVar("DEPENDS", True)
+                depends = d.getVar("DEPENDS")
                 if use_cross_localedef == "1" :
                     depends = "%s cross-localedef-native" % depends
                 else:
@@ -92,21 +94,21 @@
 
 python package_do_split_gconvs () {
     import re
-    if (d.getVar('PACKAGE_NO_GCONV', True) == '1'):
+    if (d.getVar('PACKAGE_NO_GCONV') == '1'):
         bb.note("package requested not splitting gconvs")
         return
 
-    if not d.getVar('PACKAGES', True):
+    if not d.getVar('PACKAGES'):
         return
 
-    mlprefix = d.getVar("MLPREFIX", True) or ""
+    mlprefix = d.getVar("MLPREFIX") or ""
 
-    bpn = d.getVar('BPN', True)
-    libdir = d.getVar('libdir', True)
+    bpn = d.getVar('BPN')
+    libdir = d.getVar('libdir')
     if not libdir:
         bb.error("libdir not defined")
         return
-    datadir = d.getVar('datadir', True)
+    datadir = d.getVar('datadir')
     if not datadir:
         bb.error("datadir not defined")
         return
@@ -114,7 +116,7 @@
     gconv_libdir = base_path_join(libdir, "gconv")
     charmap_dir = base_path_join(datadir, "i18n", "charmaps")
     locales_dir = base_path_join(datadir, "i18n", "locales")
-    binary_locales_dir = d.getVar('localedir', True)
+    binary_locales_dir = d.getVar('localedir')
 
     def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group):
         deps = []
@@ -181,13 +183,13 @@
         description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
     d.setVar('PACKAGES', d.getVar('PACKAGES', False) + ' ' + d.getVar('MLPREFIX', False) + bpn + '-gconv')
 
-    use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", True)
+    use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE")
 
     dot_re = re.compile("(.*)\.(.*)")
 
     # Read in supported locales and associated encodings
     supported = {}
-    with open(base_path_join(d.getVar('WORKDIR', True), "SUPPORTED")) as f:
+    with open(base_path_join(d.getVar('WORKDIR'), "SUPPORTED")) as f:
         for line in f.readlines():
             try:
                 locale, charset = line.rstrip().split()
@@ -196,7 +198,7 @@
             supported[locale] = charset
 
     # GLIBC_GENERATE_LOCALES var specifies which locales to be generated. empty or "all" means all locales
-    to_generate = d.getVar('GLIBC_GENERATE_LOCALES', True)
+    to_generate = d.getVar('GLIBC_GENERATE_LOCALES')
     if not to_generate or to_generate == 'all':
         to_generate = sorted(supported.keys())
     else:
@@ -213,33 +215,32 @@
     def output_locale_source(name, pkgname, locale, encoding):
         d.setVar('RDEPENDS_%s' % pkgname, '%slocaledef %s-localedata-%s %s-charmap-%s' % \
         (mlprefix, mlprefix+bpn, legitimize_package_name(locale), mlprefix+bpn, legitimize_package_name(encoding)))
-        d.setVar('pkg_postinst_%s' % pkgname, d.getVar('locale_base_postinst', True) \
+        d.setVar('pkg_postinst_%s' % pkgname, d.getVar('locale_base_postinst') \
         % (locale, encoding, locale))
-        d.setVar('pkg_postrm_%s' % pkgname, d.getVar('locale_base_postrm', True) % \
+        d.setVar('pkg_postrm_%s' % pkgname, d.getVar('locale_base_postrm') % \
         (locale, encoding, locale))
 
     def output_locale_binary_rdepends(name, pkgname, locale, encoding):
-        m = re.match("(.*)\.(.*)", name)
-        if m:
-            libc_name = "%s.%s" % (m.group(1), m.group(2).lower())
-        else:
-            libc_name = name
-        d.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \
-            % (mlprefix+bpn, libc_name)))
+        dep = legitimize_package_name('%s-binary-localedata-%s' % (bpn, name))
+        lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES')
+        if lcsplit and int(lcsplit):
+            d.appendVar('PACKAGES', ' ' + dep)
+            d.setVar('ALLOW_EMPTY_%s' % dep, '1')
+        d.setVar('RDEPENDS_%s' % pkgname, mlprefix + dep)
 
     commands = {}
 
     def output_locale_binary(name, pkgname, locale, encoding):
-        treedir = base_path_join(d.getVar("WORKDIR", True), "locale-tree")
-        ldlibdir = base_path_join(treedir, d.getVar("base_libdir", True))
-        path = d.getVar("PATH", True)
+        treedir = base_path_join(d.getVar("WORKDIR"), "locale-tree")
+        ldlibdir = base_path_join(treedir, d.getVar("base_libdir"))
+        path = d.getVar("PATH")
         i18npath = base_path_join(treedir, datadir, "i18n")
         gconvpath = base_path_join(treedir, "iconvdata")
         outputpath = base_path_join(treedir, binary_locales_dir)
 
-        use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", True) or "0"
+        use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF") or "0"
         if use_cross_localedef == "1":
-            target_arch = d.getVar('TARGET_ARCH', True)
+            target_arch = d.getVar('TARGET_ARCH')
             locale_arch_options = { \
                 "arm":     " --uint32-align=4 --little-endian ", \
                 "armeb":   " --uint32-align=4 --big-endian ",    \
@@ -278,7 +279,7 @@
                 --inputfile=%s/i18n/locales/%s --charmap=%s %s" \
                 % (treedir, datadir, locale, encoding, name)
 
-            qemu_options = d.getVar('QEMU_OPTIONS', True)
+            qemu_options = d.getVar('QEMU_OPTIONS')
 
             cmd = "PSEUDO_RELOADED=YES PATH=\"%s\" I18NPATH=\"%s\" %s -L %s \
                 -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % \
@@ -291,7 +292,7 @@
     def output_locale(name, locale, encoding):
         pkgname = d.getVar('MLPREFIX', False) + 'locale-base-' + legitimize_package_name(name)
         d.setVar('ALLOW_EMPTY_%s' % pkgname, '1')
-        d.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES', True)))
+        d.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES')))
         rprovides = ' %svirtual-locale-%s' % (mlprefix, legitimize_package_name(name))
         m = re.match("(.*)_(.*)", name)
         if m:
@@ -310,8 +311,8 @@
         bb.note("preparing tree for binary locale generation")
         bb.build.exec_func("do_prep_locale_tree", d)
 
-    utf8_only = int(d.getVar('LOCALE_UTF8_ONLY', True) or 0)
-    utf8_is_default = int(d.getVar('LOCALE_UTF8_IS_DEFAULT', True) or 0)
+    utf8_only = int(d.getVar('LOCALE_UTF8_ONLY') or 0)
+    utf8_is_default = int(d.getVar('LOCALE_UTF8_IS_DEFAULT') or 0)
 
     encodings = {}
     for locale in to_generate:
@@ -337,8 +338,13 @@
             else:
                 output_locale('%s.%s' % (base, charset), base, charset)
 
+    def metapkg_hook(file, pkg, pattern, format, basename):
+        name = basename.split('/', 1)[0]
+        metapkg = legitimize_package_name('%s-binary-localedata-%s' % (mlprefix+bpn, name))
+        d.appendVar('RDEPENDS_%s' % metapkg, ' ' + pkg)
+
     if use_bin == "compile":
-        makefile = base_path_join(d.getVar("WORKDIR", True), "locale-tree", "Makefile")
+        makefile = base_path_join(d.getVar("WORKDIR"), "locale-tree", "Makefile")
         m = open(makefile, "w")
         m.write("all: %s\n\n" % " ".join(commands.keys()))
         for cmd in commands:
@@ -350,13 +356,18 @@
         bb.build.exec_func("oe_runmake", d)
         bb.note("collecting binary locales from locale tree")
         bb.build.exec_func("do_collect_bins_from_locale_tree", d)
-        do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
-            output_pattern=bpn+'-binary-localedata-%s', \
-            description='binary locale definition for %s', extra_depends='', allow_dirs=True)
-    elif use_bin == "precompiled":
-        do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
-            output_pattern=bpn+'-binary-localedata-%s', \
-            description='binary locale definition for %s', extra_depends='', allow_dirs=True)
+
+    if use_bin in ('compile', 'precompiled'):
+        lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES')
+        if lcsplit and int(lcsplit):
+            do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \
+                output_pattern=bpn+'-binary-localedata-%s', \
+                description='binary locale definition for %s', recursive=True,
+                hook=metapkg_hook, extra_depends='', allow_dirs=True, match_path=True)
+        else:
+            do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
+                output_pattern=bpn+'-binary-localedata-%s', \
+                description='binary locale definition for %s', extra_depends='', allow_dirs=True)
     else:
         bb.note("generation of binary locales disabled. this may break i18n!")
 
diff --git a/import-layers/yocto-poky/meta/classes/license.bbclass b/import-layers/yocto-poky/meta/classes/license.bbclass
index 721343d..b1fffe7 100644
--- a/import-layers/yocto-poky/meta/classes/license.bbclass
+++ b/import-layers/yocto-poky/meta/classes/license.bbclass
@@ -37,13 +37,13 @@
     import oe.packagedata
     from oe.rootfs import image_list_installed_packages
 
-    build_images_from_feeds = d.getVar('BUILD_IMAGES_FROM_FEEDS', True)
+    build_images_from_feeds = d.getVar('BUILD_IMAGES_FROM_FEEDS')
     if build_images_from_feeds == "1":
         return 0
 
     pkg_dic = {}
     for pkg in sorted(image_list_installed_packages(d)):
-        pkg_info = os.path.join(d.getVar('PKGDATA_DIR', True),
+        pkg_info = os.path.join(d.getVar('PKGDATA_DIR'),
                                 'runtime-reverse', pkg)
         pkg_name = os.path.basename(os.readlink(pkg_info))
 
@@ -52,15 +52,15 @@
             pkg_lic_name = "LICENSE_" + pkg_name
             pkg_dic[pkg_name]["LICENSE"] = pkg_dic[pkg_name][pkg_lic_name]
 
-    rootfs_license_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY', True),
-                        d.getVar('IMAGE_NAME', True), 'license.manifest')
+    rootfs_license_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY'),
+                        d.getVar('IMAGE_NAME'), 'license.manifest')
     write_license_files(d, rootfs_license_manifest, pkg_dic)
 }
 
 def write_license_files(d, license_manifest, pkg_dic):
     import re
 
-    bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE", True) or "").split()
+    bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE") or "").split()
     bad_licenses = map(lambda l: canonical_license(d, l), bad_licenses)
     bad_licenses = expand_wildcard_licenses(d, bad_licenses)
 
@@ -72,7 +72,7 @@
                         oe.license.manifest_licenses(pkg_dic[pkg]["LICENSE"],
                         bad_licenses, canonical_license, d)
                 except oe.license.LicenseError as exc:
-                    bb.fatal('%s: %s' % (d.getVar('P', True), exc))
+                    bb.fatal('%s: %s' % (d.getVar('P'), exc))
             else:
                 pkg_dic[pkg]["LICENSES"] = re.sub('[|&()*]', ' ', pkg_dic[pkg]["LICENSE"])
                 pkg_dic[pkg]["LICENSES"] = re.sub('  *', ' ', pkg_dic[pkg]["LICENSES"])
@@ -98,7 +98,7 @@
                 license_file.write("FILES: %s\n\n" % pkg_dic[pkg]["FILES"])
 
             for lic in pkg_dic[pkg]["LICENSES"]:
-                lic_file = os.path.join(d.getVar('LICENSE_DIRECTORY', True),
+                lic_file = os.path.join(d.getVar('LICENSE_DIRECTORY'),
                                         pkg_dic[pkg]["PN"], "generic_%s" % 
                                         re.sub('\+', '', lic))
                 # add explicity avoid of CLOSED license because isn't generic
@@ -114,10 +114,10 @@
     # - Just copy the manifest
     # - Copy the manifest and the license directories
     # With both options set we see a .5 M increase in core-image-minimal
-    copy_lic_manifest = d.getVar('COPY_LIC_MANIFEST', True)
-    copy_lic_dirs = d.getVar('COPY_LIC_DIRS', True)
+    copy_lic_manifest = d.getVar('COPY_LIC_MANIFEST')
+    copy_lic_dirs = d.getVar('COPY_LIC_DIRS')
     if copy_lic_manifest == "1":
-        rootfs_license_dir = os.path.join(d.getVar('IMAGE_ROOTFS', 'True'), 
+        rootfs_license_dir = os.path.join(d.getVar('IMAGE_ROOTFS'), 
                                 'usr', 'share', 'common-licenses')
         bb.utils.mkdirhier(rootfs_license_dir)
         rootfs_license_manifest = os.path.join(rootfs_license_dir,
@@ -129,8 +129,12 @@
             for pkg in sorted(pkg_dic):
                 pkg_rootfs_license_dir = os.path.join(rootfs_license_dir, pkg)
                 bb.utils.mkdirhier(pkg_rootfs_license_dir)
-                pkg_license_dir = os.path.join(d.getVar('LICENSE_DIRECTORY', True),
+                pkg_license_dir = os.path.join(d.getVar('LICENSE_DIRECTORY'),
                                             pkg_dic[pkg]["PN"]) 
+
+                pkg_manifest_licenses = [canonical_license(d, lic) \
+                        for lic in pkg_dic[pkg]["LICENSES"]]
+
                 licenses = os.listdir(pkg_license_dir)
                 for lic in licenses:
                     rootfs_license = os.path.join(rootfs_license_dir, lic)
@@ -138,9 +142,18 @@
                     pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic)
 
                     if re.match("^generic_.*$", lic):
-                        generic_lic = re.search("^generic_(.*)$", lic).group(1)
-                        if oe.license.license_ok(canonical_license(d,
-                            generic_lic), bad_licenses) == False:
+                        generic_lic = canonical_license(d,
+                                re.search("^generic_(.*)$", lic).group(1))
+
+                        # Do not copy generic license into package if isn't
+                        # declared into LICENSES of the package.
+                        if not re.sub('\+$', '', generic_lic) in \
+                                [re.sub('\+', '', lic) for lic in \
+                                 pkg_manifest_licenses]:
+                            continue
+
+                        if oe.license.license_ok(generic_lic,
+                                bad_licenses) == False:
                             continue
 
                         if not os.path.exists(rootfs_license):
@@ -166,7 +179,7 @@
 
     dep_dic = {}
     man_dic = {}
-    lic_dir = d.getVar("LICENSE_DIRECTORY", True)
+    lic_dir = d.getVar("LICENSE_DIRECTORY")
 
     dep_dic = get_deployed_dependencies(d)
     for dep in dep_dic.keys():
@@ -181,8 +194,8 @@
                 key,val = line.split(": ", 1)
                 man_dic[dep][key] = val[:-1]
 
-    lic_manifest_dir = os.path.join(d.getVar('LICENSE_DIRECTORY', True),
-                                    d.getVar('IMAGE_NAME', True))
+    lic_manifest_dir = os.path.join(d.getVar('LICENSE_DIRECTORY'),
+                                    d.getVar('IMAGE_NAME'))
     bb.utils.mkdirhier(lic_manifest_dir)
     image_license_manifest = os.path.join(lic_manifest_dir, 'image_license.manifest')
     write_license_files(d, image_license_manifest, man_dic)
@@ -202,7 +215,7 @@
     depends = list(set([dep[0] for dep
                     in list(taskdata.values())
                     if not dep[0].endswith("-native")]))
-    extra_depends = d.getVar("EXTRA_IMAGEDEPENDS", True)
+    extra_depends = d.getVar("EXTRA_IMAGEDEPENDS")
     boot_depends = get_boot_dependencies(d)
     depends.extend(extra_depends.split())
     depends.extend(boot_depends)
@@ -212,13 +225,13 @@
     # the SSTATE_MANIFESTS for "deploy" task.
     # The manifest file name contains the arch. Because we are not running
     # in the recipe context it is necessary to check every arch used.
-    sstate_manifest_dir = d.getVar("SSTATE_MANIFESTS", True)
-    sstate_archs = d.getVar("SSTATE_ARCHS", True)
-    extra_archs = d.getVar("PACKAGE_EXTRA_ARCHS", True)
+    sstate_manifest_dir = d.getVar("SSTATE_MANIFESTS")
+    sstate_archs = d.getVar("SSTATE_ARCHS")
+    extra_archs = d.getVar("PACKAGE_EXTRA_ARCHS")
     archs = list(set(("%s %s" % (sstate_archs, extra_archs)).split()))
     for dep in depends:
         # Some recipes have an arch on their own, so we try that first.
-        special_arch = d.getVar("PACKAGE_ARCH_pn-%s" % dep, True)
+        special_arch = d.getVar("PACKAGE_ARCH_pn-%s" % dep)
         if special_arch:
             sstate_manifest_file = os.path.join(sstate_manifest_dir,
                     "manifest-%s-%s.deploy" % (special_arch, dep))
@@ -249,12 +262,12 @@
 
     for task in boot_tasks:
         boot_depends_string = "%s %s" % (boot_depends_string,
-                d.getVarFlag(task, "depends", True) or "")
+                d.getVarFlag(task, "depends") or "")
     boot_depends = [dep.split(":")[0] for dep
                 in boot_depends_string.split()
                 if not dep.split(":")[0].endswith("-native")]
     for dep in boot_depends:
-        info_file = os.path.join(d.getVar("LICENSE_DIRECTORY", True),
+        info_file = os.path.join(d.getVar("LICENSE_DIRECTORY"),
                 dep, "recipeinfo")
         # If the recipe and dependency name is the same
         if os.path.exists(info_file):
@@ -265,7 +278,7 @@
                 # The fifth field contains what the task provides
                 if dep in taskdep[4]:
                     info_file = os.path.join(
-                            d.getVar("LICENSE_DIRECTORY", True),
+                            d.getVar("LICENSE_DIRECTORY"),
                             taskdep[0], "recipeinfo")
                     if os.path.exists(info_file):
                         depends.append(taskdep[0])
@@ -295,7 +308,7 @@
     lic_files_paths = find_license_files(d)
 
     # The base directory we wrangle licenses to
-    destdir = os.path.join(d.getVar('LICSSTATEDIR', True), d.getVar('PN', True))
+    destdir = os.path.join(d.getVar('LICSSTATEDIR'), d.getVar('PN'))
     copy_license_files(lic_files_paths, destdir)
     info = get_recipe_info(d)
     with open(os.path.join(destdir, "recipeinfo"), "w") as f:
@@ -306,11 +319,11 @@
 # it would be better to copy them in do_install_append, but find_license_filesa is python
 python perform_packagecopy_prepend () {
     enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d)
-    if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
+    if d.getVar('CLASSOVERRIDE') == 'class-target' and enabled:
         lic_files_paths = find_license_files(d)
 
         # LICENSE_FILES_DIRECTORY starts with '/' so os.path.join cannot be used to join D and LICENSE_FILES_DIRECTORY
-        destdir = d.getVar('D', True) + os.path.join(d.getVar('LICENSE_FILES_DIRECTORY', True), d.getVar('PN', True))
+        destdir = d.getVar('D') + os.path.join(d.getVar('LICENSE_FILES_DIRECTORY'), d.getVar('PN'))
         copy_license_files(lic_files_paths, destdir)
         add_package_and_files(d)
 }
@@ -318,15 +331,15 @@
 
 def get_recipe_info(d):
     info = {}
-    info["PV"] = d.getVar("PV", True)
-    info["PR"] = d.getVar("PR", True)
-    info["LICENSE"] = d.getVar("LICENSE", True)
+    info["PV"] = d.getVar("PV")
+    info["PR"] = d.getVar("PR")
+    info["LICENSE"] = d.getVar("LICENSE")
     return info
 
 def add_package_and_files(d):
-    packages = d.getVar('PACKAGES', True)
-    files = d.getVar('LICENSE_FILES_DIRECTORY', True)
-    pn = d.getVar('PN', True)
+    packages = d.getVar('PACKAGES')
+    files = d.getVar('LICENSE_FILES_DIRECTORY')
+    pn = d.getVar('PN')
     pn_lic = "%s%s" % (pn, d.getVar('LICENSE_PACKAGE_SUFFIX', False))
     if pn_lic in packages:
         bb.warn("%s package already existed in %s." % (pn_lic, pn))
@@ -334,7 +347,7 @@
         # first in PACKAGES to be sure that nothing else gets LICENSE_FILES_DIRECTORY
         d.setVar('PACKAGES', "%s %s" % (pn_lic, packages))
         d.setVar('FILES_' + pn_lic, files)
-        rrecommends_pn = d.getVar('RRECOMMENDS_' + pn, True)
+        rrecommends_pn = d.getVar('RRECOMMENDS_' + pn)
         if rrecommends_pn:
             d.setVar('RRECOMMENDS_' + pn, "%s %s" % (pn_lic, rrecommends_pn))
         else:
@@ -345,7 +358,7 @@
     import errno
 
     bb.utils.mkdirhier(destdir)
-    for (basename, path) in lic_files_paths:
+    for (basename, path, beginline, endline) in lic_files_paths:
         try:
             src = path
             dst = os.path.join(destdir, basename)
@@ -353,7 +366,7 @@
                 os.remove(dst)
             if os.path.islink(src):
                 src = os.path.realpath(src)
-            canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev)
+            canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev) and beginline is None and endline is None
             if canlink:
                 try:
                     os.link(src, dst)
@@ -364,20 +377,19 @@
                         canlink = False
                     else:
                         raise
-                try:
-                    if canlink:
-                        os.chown(dst,0,0)
-                except OSError as err:
-                    if err.errno in (errno.EPERM, errno.EINVAL):
-                        # Suppress "Operation not permitted" error, as
-                        # sometimes this function is not executed under pseudo.
-                        # Also ignore "Invalid argument" errors that happen in
-                        # some (unprivileged) container environments (no root).
-                        pass
-                    else:
-                        raise
+                # Only chown if we did hardling, and, we're running under pseudo
+                if canlink and os.environ.get('PSEUDO_DISABLED') == '0':
+                    os.chown(dst,0,0)
             if not canlink:
-                shutil.copyfile(src, dst)
+                begin_idx = int(beginline)-1 if beginline is not None else None
+                end_idx = int(endline) if endline is not None else None
+                if begin_idx is None and end_idx is None:
+                    shutil.copyfile(src, dst)
+                else:
+                    with open(src, 'rb') as src_f:
+                        with open(dst, 'wb') as dst_f:
+                            dst_f.write(b''.join(src_f.readlines()[begin_idx:end_idx]))
+
         except Exception as e:
             bb.warn("Could not copy license file %s to %s: %s" % (src, dst, e))
 
@@ -390,20 +402,22 @@
     from collections import defaultdict, OrderedDict
 
     # All the license files for the package
-    lic_files = d.getVar('LIC_FILES_CHKSUM', True)
-    pn = d.getVar('PN', True)
+    lic_files = d.getVar('LIC_FILES_CHKSUM') or ""
+    pn = d.getVar('PN')
     # The license files are located in S/LIC_FILE_CHECKSUM.
-    srcdir = d.getVar('S', True)
+    srcdir = d.getVar('S')
     # Directory we store the generic licenses as set in the distro configuration
-    generic_directory = d.getVar('COMMON_LICENSE_DIR', True)
+    generic_directory = d.getVar('COMMON_LICENSE_DIR')
     # List of basename, path tuples
     lic_files_paths = []
+    # hash for keep track generic lics mappings
+    non_generic_lics = {}
     # Entries from LIC_FILES_CHKSUM
     lic_chksums = {}
     license_source_dirs = []
     license_source_dirs.append(generic_directory)
     try:
-        additional_lic_dirs = d.getVar('LICENSE_PATH', True).split()
+        additional_lic_dirs = d.getVar('LICENSE_PATH').split()
         for lic_dir in additional_lic_dirs:
             license_source_dirs.append(lic_dir)
     except:
@@ -431,10 +445,10 @@
         # unless NO_GENERIC_LICENSE is set.
         for lic_dir in license_source_dirs:
             if not os.path.isfile(os.path.join(lic_dir, license_type)):
-                if d.getVarFlag('SPDXLICENSEMAP', license_type, True) != None:
+                if d.getVarFlag('SPDXLICENSEMAP', license_type) != None:
                     # Great, there is an SPDXLICENSEMAP. We can copy!
                     bb.debug(1, "We need to use a SPDXLICENSEMAP for %s" % (license_type))
-                    spdx_generic = d.getVarFlag('SPDXLICENSEMAP', license_type, True)
+                    spdx_generic = d.getVarFlag('SPDXLICENSEMAP', license_type)
                     license_source = lic_dir
                     break
             elif os.path.isfile(os.path.join(lic_dir, license_type)):
@@ -442,23 +456,25 @@
                 license_source = lic_dir
                 break
 
-        non_generic_lic = d.getVarFlag('NO_GENERIC_LICENSE', license_type, True)
+        non_generic_lic = d.getVarFlag('NO_GENERIC_LICENSE', license_type)
         if spdx_generic and license_source:
             # we really should copy to generic_ + spdx_generic, however, that ends up messing the manifest
             # audit up. This should be fixed in emit_pkgdata (or, we actually got and fix all the recipes)
 
-            lic_files_paths.append(("generic_" + license_type, os.path.join(license_source, spdx_generic)))
+            lic_files_paths.append(("generic_" + license_type, os.path.join(license_source, spdx_generic),
+                                    None, None))
 
             # The user may attempt to use NO_GENERIC_LICENSE for a generic license which doesn't make sense
             # and should not be allowed, warn the user in this case.
-            if d.getVarFlag('NO_GENERIC_LICENSE', license_type, True):
+            if d.getVarFlag('NO_GENERIC_LICENSE', license_type):
                 bb.warn("%s: %s is a generic license, please don't use NO_GENERIC_LICENSE for it." % (pn, license_type))
 
         elif non_generic_lic and non_generic_lic in lic_chksums:
             # if NO_GENERIC_LICENSE is set, we copy the license files from the fetched source
             # of the package rather than the license_source_dirs.
             lic_files_paths.append(("generic_" + license_type,
-                                    os.path.join(srcdir, non_generic_lic)))
+                                    os.path.join(srcdir, non_generic_lic), None, None))
+            non_generic_lics[non_generic_lic] = license_type
         else:
             # Add explicity avoid of CLOSED license because this isn't generic
             if license_type != 'CLOSED':
@@ -469,41 +485,40 @@
     if not generic_directory:
         bb.fatal("COMMON_LICENSE_DIR is unset. Please set this in your distro config")
 
-    if not lic_files:
-        # No recipe should have an invalid license file. This is checked else
-        # where, but let's be pedantic
-        bb.note(pn + ": Recipe file does not have license file information.")
-        return lic_files_paths
-
     for url in lic_files.split():
         try:
             (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
         except bb.fetch.MalformedUrl:
-            bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL:  %s" % (d.getVar('PF', True), url))
+            bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL:  %s" % (d.getVar('PF'), url))
         # We want the license filename and path
-        chksum = parm['md5'] if 'md5' in parm else parm['sha256']
-        lic_chksums[path] = chksum
+        chksum = parm.get('md5', None)
+        beginline = parm.get('beginline')
+        endline = parm.get('endline')
+        lic_chksums[path] = (chksum, beginline, endline)
 
     v = FindVisitor()
     try:
-        v.visit_string(d.getVar('LICENSE', True))
+        v.visit_string(d.getVar('LICENSE'))
     except oe.license.InvalidLicense as exc:
-        bb.fatal('%s: %s' % (d.getVar('PF', True), exc))
+        bb.fatal('%s: %s' % (d.getVar('PF'), exc))
     except SyntaxError:
-        bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF', True)))
-
+        bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF')))
     # Add files from LIC_FILES_CHKSUM to list of license files
     lic_chksum_paths = defaultdict(OrderedDict)
-    for path, chksum in lic_chksums.items():
-        lic_chksum_paths[os.path.basename(path)][chksum] = os.path.join(srcdir, path)
+    for path, data in sorted(lic_chksums.items()):
+        lic_chksum_paths[os.path.basename(path)][data] = (os.path.join(srcdir, path), data[1], data[2])
     for basename, files in lic_chksum_paths.items():
         if len(files) == 1:
-            lic_files_paths.append((basename, list(files.values())[0]))
+            # Don't copy again a LICENSE already handled as non-generic
+            if basename in non_generic_lics:
+                continue
+            data = list(files.values())[0]
+            lic_files_paths.append(tuple([basename] + list(data)))
         else:
             # If there are multiple different license files with identical
             # basenames we rename them to <file>.0, <file>.1, ...
-            for i, path in enumerate(files.values()):
-                lic_files_paths.append(("%s.%d" % (basename, i), path))
+            for i, data in enumerate(files.values()):
+                lic_files_paths.append(tuple(["%s.%d" % (basename, i)] + list(data)))
 
     return lic_files_paths
 
@@ -511,7 +526,7 @@
     """
     This function returns the spdx mapping of a license if it exists.
      """
-    return d.getVarFlag('SPDXLICENSEMAP', license, True)
+    return d.getVarFlag('SPDXLICENSEMAP', license)
 
 def canonical_license(d, license):
     """
@@ -520,9 +535,9 @@
     'X' if availabel and the tailing '+' (so GPLv3+ becomes GPL-3.0+), 
     or the passed license if there is no canonical form.
     """
-    lic = d.getVarFlag('SPDXLICENSEMAP', license, True) or ""
+    lic = d.getVarFlag('SPDXLICENSEMAP', license) or ""
     if not lic and license.endswith('+'):
-        lic = d.getVarFlag('SPDXLICENSEMAP', license.rstrip('+'), True)
+        lic = d.getVarFlag('SPDXLICENSEMAP', license.rstrip('+'))
         if lic:
             lic += '+'
     return lic or license
@@ -537,7 +552,7 @@
     spdxmapkeys = d.getVarFlags('SPDXLICENSEMAP').keys()
     for wld_lic in wildcard_licenses:
         spdxflags = fnmatch.filter(spdxmapkeys, wld_lic)
-        licenses += [d.getVarFlag('SPDXLICENSEMAP', flag, True) for flag in spdxflags]
+        licenses += [d.getVarFlag('SPDXLICENSEMAP', flag) for flag in spdxflags]
 
     spdx_lics = (d.getVar('SRC_DISTRIBUTE_LICENSES', False) or '').split()
     for wld_lic in wildcard_licenses:
@@ -548,7 +563,7 @@
 
 def incompatible_license_contains(license, truevalue, falsevalue, d):
     license = canonical_license(d, license)
-    bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE', True) or "").split()
+    bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split()
     bad_licenses = expand_wildcard_licenses(d, bad_licenses)
     return truevalue if license in bad_licenses else falsevalue
 
@@ -559,9 +574,9 @@
     as canonical (SPDX) names.
     """
     import oe.license
-    license = d.getVar("LICENSE_%s" % package, True) if package else None
+    license = d.getVar("LICENSE_%s" % package) if package else None
     if not license:
-        license = d.getVar('LICENSE', True)
+        license = d.getVar('LICENSE')
 
     # Handles an "or" or two license sets provided by
     # flattened_licenses(), pick one that works if possible.
@@ -572,7 +587,7 @@
     try:
         licenses = oe.license.flattened_licenses(license, choose_lic_set)
     except oe.license.LicenseError as exc:
-        bb.fatal('%s: %s' % (d.getVar('P', True), exc))
+        bb.fatal('%s: %s' % (d.getVar('P'), exc))
     return any(not oe.license.license_ok(canonical_license(d, l), \
 		dont_want_licenses) for l in licenses)
 
@@ -620,16 +635,16 @@
 
     def all_license_flags_match(license_flags, whitelist):
         """ Return first unmatched flag, None if all flags match """
-        pn = d.getVar('PN', True)
+        pn = d.getVar('PN')
         split_whitelist = whitelist.split()
         for flag in license_flags.split():
             if not license_flag_matches(flag, split_whitelist, pn):
                 return flag
         return None
 
-    license_flags = d.getVar('LICENSE_FLAGS', True)
+    license_flags = d.getVar('LICENSE_FLAGS')
     if license_flags:
-        whitelist = d.getVar('LICENSE_FLAGS_WHITELIST', True)
+        whitelist = d.getVar('LICENSE_FLAGS_WHITELIST')
         if not whitelist:
             return license_flags
         unmatched_flag = all_license_flags_match(license_flags, whitelist)
@@ -643,8 +658,8 @@
         Validate operators in LICENSES.
         No spaces are allowed between LICENSES.
     """
-    pn = d.getVar('PN', True)
-    licenses = d.getVar('LICENSE', True)
+    pn = d.getVar('PN')
+    licenses = d.getVar('LICENSE')
     from oe.license import license_operator, license_operator_chars, license_pattern
 
     elements = list(filter(lambda x: x.strip(), license_operator.split(licenses)))
diff --git a/import-layers/yocto-poky/meta/classes/live-vm-common.bbclass b/import-layers/yocto-poky/meta/classes/live-vm-common.bbclass
index 734697f..27b137d 100644
--- a/import-layers/yocto-poky/meta/classes/live-vm-common.bbclass
+++ b/import-layers/yocto-poky/meta/classes/live-vm-common.bbclass
@@ -4,11 +4,11 @@
     vars = ['GRUB_CFG', 'SYSLINUX_CFG', 'ROOT', 'LABELS', 'INITRD']
     for var in vars:
         var_with_suffix = var + '_' + suffix
-        if d.getVar(var, True):
+        if d.getVar(var):
             bb.warn('Found potential conflicted var %s, please use %s rather than %s' % \
                 (var, var_with_suffix, var))
-        elif d.getVar(var_with_suffix, True):
-            d.setVar(var, d.getVar(var_with_suffix, True))
+        elif d.getVar(var_with_suffix):
+            d.setVar(var, d.getVar(var_with_suffix))
 
 
 EFI = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "1", "0", d)}"
@@ -25,7 +25,7 @@
     return pcbios
 
 PCBIOS = "${@pcbios(d)}"
-PCBIOS_CLASS = "${@['','syslinux'][d.getVar('PCBIOS', True) == '1']}"
+PCBIOS_CLASS = "${@['','syslinux'][d.getVar('PCBIOS') == '1']}"
 
 inherit ${EFI_CLASS}
 inherit ${PCBIOS_CLASS}
diff --git a/import-layers/yocto-poky/meta/classes/manpages.bbclass b/import-layers/yocto-poky/meta/classes/manpages.bbclass
new file mode 100644
index 0000000..d16237b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/manpages.bbclass
@@ -0,0 +1,5 @@
+# Inherit this class to enable or disable building and installation of manpages
+# depending on whether 'api-documentation' is in DISTRO_FEATURES. Such building
+# tends to pull in the entire XML stack and other tools, so it's not enabled
+# by default.
+PACKAGECONFIG_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'manpages', '', d)}"
diff --git a/import-layers/yocto-poky/meta/classes/metadata_scm.bbclass b/import-layers/yocto-poky/meta/classes/metadata_scm.bbclass
index 2e6fac2..fa791f0 100644
--- a/import-layers/yocto-poky/meta/classes/metadata_scm.bbclass
+++ b/import-layers/yocto-poky/meta/classes/metadata_scm.bbclass
@@ -26,7 +26,7 @@
     return "<unknown>"
 
 def base_get_scmbasepath(d):
-    return os.path.join(d.getVar('COREBASE', True), 'meta')
+    return os.path.join(d.getVar('COREBASE'), 'meta')
 
 def base_get_metadata_monotone_branch(path, d):
     monotone_branch = "<unknown>"
diff --git a/import-layers/yocto-poky/meta/classes/migrate_localcount.bbclass b/import-layers/yocto-poky/meta/classes/migrate_localcount.bbclass
index aa0df8b..810a541 100644
--- a/import-layers/yocto-poky/meta/classes/migrate_localcount.bbclass
+++ b/import-layers/yocto-poky/meta/classes/migrate_localcount.bbclass
@@ -6,12 +6,12 @@
     if not e.data:
         return
 
-    pv = e.data.getVar('PV', True)
+    pv = e.data.getVar('PV')
     if not 'AUTOINC' in pv:
         return
 
     localcounts = bb.persist_data.persist('BB_URI_LOCALCOUNT', e.data)
-    pn = e.data.getVar('PN', True)
+    pn = e.data.getVar('PN')
     revs = localcounts.get_by_pattern('%%-%s_rev' % pn)
     counts = localcounts.get_by_pattern('%%-%s_count' % pn)
     if not revs or not counts:
@@ -21,10 +21,10 @@
         bb.warn("The number of revs and localcounts don't match in %s" % pn)
         return
 
-    version = e.data.getVar('PRAUTOINX', True)
+    version = e.data.getVar('PRAUTOINX')
     srcrev = bb.fetch2.get_srcrev(e.data)
     base_ver = 'AUTOINC-%s' % version[:version.find(srcrev)]
-    pkgarch = e.data.getVar('PACKAGE_ARCH', True)
+    pkgarch = e.data.getVar('PACKAGE_ARCH')
     value = max(int(count) for count in counts)
 
     if len(revs) == 1:
@@ -33,8 +33,8 @@
     else:
         value += 1
 
-    bb.utils.mkdirhier(e.data.getVar('PRSERV_DUMPDIR', True))
-    df = e.data.getVar('LOCALCOUNT_DUMPFILE', True)
+    bb.utils.mkdirhier(e.data.getVar('PRSERV_DUMPDIR'))
+    df = e.data.getVar('LOCALCOUNT_DUMPFILE')
     flock = bb.utils.lockfile("%s.lock" % df)
     with open(df, 'a') as fd:
         fd.write('PRAUTO$%s$%s$%s = "%s"\n' %
diff --git a/import-layers/yocto-poky/meta/classes/mime.bbclass b/import-layers/yocto-poky/meta/classes/mime.bbclass
index 721c73f..0df1583 100644
--- a/import-layers/yocto-poky/meta/classes/mime.bbclass
+++ b/import-layers/yocto-poky/meta/classes/mime.bbclass
@@ -1,4 +1,5 @@
-DEPENDS += "shared-mime-info-native shared-mime-info"
+DEPENDS += "shared-mime-info"
+PACKAGE_WRITE_DEPS += "shared-mime-info-native"
 
 mime_postinst() {
 if [ "$1" = configure ]; then
@@ -28,8 +29,8 @@
 
 python populate_packages_append () {
     import re
-    packages = d.getVar('PACKAGES', True).split()
-    pkgdest =  d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES').split()
+    pkgdest =  d.getVar('PKGDEST')
 
     for pkg in packages:
         mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg)
@@ -41,15 +42,15 @@
                     mimes.append(f)
         if mimes:
             bb.note("adding mime postinst and postrm scripts to %s" % pkg)
-            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            postinst = d.getVar('pkg_postinst_%s' % pkg)
             if not postinst:
                 postinst = '#!/bin/sh\n'
-            postinst += d.getVar('mime_postinst', True)
+            postinst += d.getVar('mime_postinst')
             d.setVar('pkg_postinst_%s' % pkg, postinst)
-            postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+            postrm = d.getVar('pkg_postrm_%s' % pkg)
             if not postrm:
                 postrm = '#!/bin/sh\n'
-            postrm += d.getVar('mime_postrm', True)
+            postrm += d.getVar('mime_postrm')
             d.setVar('pkg_postrm_%s' % pkg, postrm)
             bb.note("adding shared-mime-info-data dependency to %s" % pkg)
             d.appendVar('RDEPENDS_' + pkg, " shared-mime-info-data")
diff --git a/import-layers/yocto-poky/meta/classes/mirrors.bbclass b/import-layers/yocto-poky/meta/classes/mirrors.bbclass
index 2cdc71b..4ad814f 100644
--- a/import-layers/yocto-poky/meta/classes/mirrors.bbclass
+++ b/import-layers/yocto-poky/meta/classes/mirrors.bbclass
@@ -27,7 +27,7 @@
 ftp://dante.ctan.org/tex-archive ftp://ftp.fu-berlin.de/tex/CTAN \n \
 ftp://dante.ctan.org/tex-archive http://sunsite.sut.ac.jp/pub/archives/ctan/ \n \
 ftp://dante.ctan.org/tex-archive http://ctan.unsw.edu.au/ \n \
-ftp://ftp.gnutls.org/gcrypt/gnutls ${GNUPG_MIRROR} \n \
+ftp://ftp.gnutls.org/gcrypt/gnutls ${GNUPG_MIRROR}/gnutls \n \
 http://ftp.info-zip.org/pub/infozip/src/ http://mirror.switch.ch/ftp/mirror/infozip/src/ \n \
 http://ftp.info-zip.org/pub/infozip/src/ ftp://sunsite.icm.edu.pl/pub/unix/archiving/info-zip/src/ \n \
 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/ \n \
@@ -54,7 +54,7 @@
 osc://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
 https?$://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
 ftp://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
-npm://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
+npm://.*/?.*    http://downloads.yoctoproject.org/mirror/sources/ \n \
 cvs://.*/.*     http://sources.openembedded.org/ \n \
 svn://.*/.*     http://sources.openembedded.org/ \n \
 git://.*/.*     http://sources.openembedded.org/ \n \
@@ -64,7 +64,18 @@
 osc://.*/.*     http://sources.openembedded.org/ \n \
 https?$://.*/.* http://sources.openembedded.org/ \n \
 ftp://.*/.*     http://sources.openembedded.org/ \n \
-npm://.*/.*     http://sources.openembedded.org/ \n \
+npm://.*/?.*    http://sources.openembedded.org/ \n \
 ${CPAN_MIRROR}  http://cpan.metacpan.org/ \n \
 ${CPAN_MIRROR}  http://search.cpan.org/CPAN/ \n \
 "
+
+# Use MIRRORS to provide git repo fallbacks using the https protocol, for cases
+# where git native protocol fetches may fail due to local firewall rules, etc.
+
+MIRRORS += "\
+git://anonscm.debian.org/.*   git://anonscm.debian.org/git/PATH;protocol=https \n \
+git://git.gnome.org/.*        git://git.gnome.org/browse/PATH;protocol=https \n \
+git://git.savannah.gnu.org/.* git://git.savannah.gnu.org/git/PATH;protocol=https \n \
+git://git.yoctoproject.org/.* git://git.yoctoproject.org/git/PATH;protocol=https \n \
+git://.*/.*                   git://HOST/PATH;protocol=https \n \
+"
diff --git a/import-layers/yocto-poky/meta/classes/module.bbclass b/import-layers/yocto-poky/meta/classes/module.bbclass
index 68e3d34..802476b 100644
--- a/import-layers/yocto-poky/meta/classes/module.bbclass
+++ b/import-layers/yocto-poky/meta/classes/module.bbclass
@@ -1,15 +1,16 @@
-inherit module-base kernel-module-split
+inherit module-base kernel-module-split pkgconfig
 
-addtask make_scripts after do_patch before do_compile
+addtask make_scripts after do_prepare_recipe_sysroot before do_compile
 do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
 do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
 
 EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}"
 
 MODULES_INSTALL_TARGET ?= "modules_install"
+MODULES_MODULE_SYMVERS_LOCATION ?= ""
 
 python __anonymous () {
-    depends = d.getVar('DEPENDS', True)
+    depends = d.getVar('DEPENDS')
     extra_symbols = []
     for dep in depends.split():
         if dep.startswith("kernel-module-"):
@@ -30,15 +31,22 @@
 
 module_do_install() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-	oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" \
+	oe_runmake DEPMOD=echo MODLIB="${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}" \
 	           CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
 	           O=${STAGING_KERNEL_BUILDDIR} \
 	           ${MODULES_INSTALL_TARGET}
 
-	install -d -m0755 ${D}${includedir}/${BPN}
-	cp -a --no-preserve=ownership ${B}/Module.symvers ${D}${includedir}/${BPN}
-	# it doesn't actually seem to matter which path is specified here
-	sed -e 's:${B}/::g' -i ${D}${includedir}/${BPN}/Module.symvers
+	if [ ! -e "${B}/${MODULES_MODULE_SYMVERS_LOCATION}/Module.symvers" ] ; then
+		bbwarn "Module.symvers not found in ${B}/${MODULES_MODULE_SYMVERS_LOCATION}"
+		bbwarn "Please consider setting MODULES_MODULE_SYMVERS_LOCATION to a"
+		bbwarn "directory below B to get correct inter-module dependencies"
+	else
+		install -Dm0644 "${B}/${MODULES_MODULE_SYMVERS_LOCATION}"/Module.symvers ${D}${includedir}/${BPN}/Module.symvers
+		# Module.symvers contains absolute path to the build directory.
+		# While it doesn't actually seem to matter which path is specified,
+		# clear them out to avoid confusion
+		sed -e 's:${B}/::g' -i ${D}${includedir}/${BPN}/Module.symvers
+	fi
 }
 
 EXPORT_FUNCTIONS do_compile do_install
diff --git a/import-layers/yocto-poky/meta/classes/multilib.bbclass b/import-layers/yocto-poky/meta/classes/multilib.bbclass
index d5a3128..ab04597 100644
--- a/import-layers/yocto-poky/meta/classes/multilib.bbclass
+++ b/import-layers/yocto-poky/meta/classes/multilib.bbclass
@@ -1,20 +1,20 @@
 python multilib_virtclass_handler () {
-    cls = e.data.getVar("BBEXTENDCURR", True)
-    variant = e.data.getVar("BBEXTENDVARIANT", True)
+    cls = e.data.getVar("BBEXTENDCURR")
+    variant = e.data.getVar("BBEXTENDVARIANT")
     if cls != "multilib" or not variant:
         return
 
-    e.data.setVar('STAGING_KERNEL_DIR', e.data.getVar('STAGING_KERNEL_DIR', True))
+    e.data.setVar('STAGING_KERNEL_DIR', e.data.getVar('STAGING_KERNEL_DIR'))
 
     # There should only be one kernel in multilib configs
     # We also skip multilib setup for module packages.
-    provides = (e.data.getVar("PROVIDES", True) or "").split()
+    provides = (e.data.getVar("PROVIDES") or "").split()
     if "virtual/kernel" in provides or bb.data.inherits_class('module-base', e.data):
         raise bb.parse.SkipPackage("We shouldn't have multilib variants for the kernel")
 
-    save_var_name=e.data.getVar("MULTILIB_SAVE_VARNAME", True) or ""
+    save_var_name=e.data.getVar("MULTILIB_SAVE_VARNAME") or ""
     for name in save_var_name.split():
-        val=e.data.getVar(name, True)
+        val=e.data.getVar(name)
         if val:
             e.data.setVar(name + "_MULTILIB_ORIGINAL", val)
 
@@ -26,7 +26,7 @@
     if bb.data.inherits_class('image', e.data):
         e.data.setVar("MLPREFIX", variant + "-")
         e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
-        e.data.setVar('SDKTARGETSYSROOT', e.data.getVar('SDKTARGETSYSROOT', True))
+        e.data.setVar('SDKTARGETSYSROOT', e.data.getVar('SDKTARGETSYSROOT'))
         target_vendor = e.data.getVar("TARGET_VENDOR_" + "virtclass-multilib-" + variant, False)
         if target_vendor:
             e.data.setVar("TARGET_VENDOR", target_vendor)
@@ -36,7 +36,6 @@
         e.data.setVar("MLPREFIX", variant + "-")
         override = ":virtclass-multilib-" + variant
         e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
-        bb.data.update_data(e.data)
         return
 
     if bb.data.inherits_class('native', e.data):
@@ -50,17 +49,23 @@
 
 
     # Expand this since this won't work correctly once we set a multilib into place
-    e.data.setVar("ALL_MULTILIB_PACKAGE_ARCHS", e.data.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True))
+    e.data.setVar("ALL_MULTILIB_PACKAGE_ARCHS", e.data.getVar("ALL_MULTILIB_PACKAGE_ARCHS"))
  
     override = ":virtclass-multilib-" + variant
 
+    blacklist = e.data.getVarFlag('PNBLACKLIST', e.data.getVar('PN'))
+    if blacklist:
+        pn_new = variant + "-" + e.data.getVar('PN')
+        if not e.data.getVarFlag('PNBLACKLIST', pn_new):
+            e.data.setVarFlag('PNBLACKLIST', pn_new, blacklist)
+
     e.data.setVar("MLPREFIX", variant + "-")
     e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
     e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
 
     # Expand the WHITELISTs with multilib prefix
     for whitelist in ["WHITELIST_GPL-3.0", "LGPLv2_WHITELIST_GPL-3.0"]:
-        pkgs = e.data.getVar(whitelist, True)
+        pkgs = e.data.getVar(whitelist)
         for pkg in pkgs.split():
             pkgs += " " + variant + "-" + pkg
         e.data.setVar(whitelist, pkgs)
@@ -78,7 +83,7 @@
 STAGINGCC_prepend = "${BBEXTENDVARIANT}-"
 
 python __anonymous () {
-    variant = d.getVar("BBEXTENDVARIANT", True)
+    variant = d.getVar("BBEXTENDVARIANT")
 
     import oe.classextend
 
@@ -88,7 +93,7 @@
         clsextend.map_depends_variable("PACKAGE_INSTALL")
         clsextend.map_depends_variable("LINGUAS_INSTALL")
         clsextend.map_depends_variable("RDEPENDS")
-        pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True)
+        pinstall = d.getVar("LINGUAS_INSTALL") + " " + d.getVar("PACKAGE_INSTALL")
         d.setVar("PACKAGE_INSTALL", pinstall)
         d.setVar("LINGUAS_INSTALL", "")
         # FIXME, we need to map this to something, not delete it!
@@ -104,7 +109,7 @@
         return
 
     clsextend.rename_packages()
-    clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
+    clsextend.rename_package_variables((d.getVar("PACKAGEVARS") or "").split())
 
     clsextend.map_packagevars()
     clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
@@ -119,7 +124,7 @@
 python do_package_qa_multilib() {
 
     def check_mlprefix(pkg, var, mlprefix):
-        values = bb.utils.explode_deps(d.getVar('%s_%s' % (var, pkg), True) or d.getVar(var, True) or "")
+        values = bb.utils.explode_deps(d.getVar('%s_%s' % (var, pkg)) or d.getVar(var) or "")
         candidates = []
         for i in values:
             if i.startswith('virtual/'):
@@ -130,14 +135,14 @@
                 candidates.append(i)
         if len(candidates) > 0:
             msg = "%s package %s - suspicious values '%s' in %s" \
-                   % (d.getVar('PN', True), pkg, ' '.join(candidates), var)
+                   % (d.getVar('PN'), pkg, ' '.join(candidates), var)
             package_qa_handle_error("multilib", msg, d)
 
-    ml = d.getVar('MLPREFIX', True)
+    ml = d.getVar('MLPREFIX')
     if not ml:
         return
 
-    packages = d.getVar('PACKAGES', True)
+    packages = d.getVar('PACKAGES')
     for pkg in packages.split():
         check_mlprefix(pkg, 'RDEPENDS', ml)
         check_mlprefix(pkg, 'RPROVIDES', ml)
diff --git a/import-layers/yocto-poky/meta/classes/multilib_global.bbclass b/import-layers/yocto-poky/meta/classes/multilib_global.bbclass
index 11ae268..fd0bfe1 100644
--- a/import-layers/yocto-poky/meta/classes/multilib_global.bbclass
+++ b/import-layers/yocto-poky/meta/classes/multilib_global.bbclass
@@ -1,7 +1,7 @@
 def preferred_ml_updates(d):
     # If any PREFERRED_PROVIDER or PREFERRED_VERSION are set,
     # we need to mirror these variables in the multilib case;
-    multilibs = d.getVar('MULTILIBS', True) or ""
+    multilibs = d.getVar('MULTILIBS') or ""
     if not multilibs:
         return
 
@@ -29,7 +29,6 @@
                 localdata = bb.data.createCopy(d)
                 override = ":virtclass-multilib-" + p
                 localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
-                bb.data.update_data(localdata)
                 if "-canadian-" in pkg:
                     newname = localdata.expand(v)
                 else:
@@ -57,7 +56,6 @@
                 localdata = bb.data.createCopy(d)
                 override = ":virtclass-multilib-" + p
                 localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
-                bb.data.update_data(localdata)
                 newname = localdata.expand(prov)
                 if newname != prov:
                     newval = localdata.expand(val)
@@ -80,7 +78,6 @@
             localdata = bb.data.createCopy(d)
             override = ":virtclass-multilib-" + p
             localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
-            bb.data.update_data(localdata)
             newname = localdata.expand(prov)
             if newname != prov and not d.getVar(newname, False):
                 d.setVar(newname, localdata.expand(newval))
@@ -102,7 +99,7 @@
         prov = prov.replace("virtual/", "")
         return "virtual/" + prefix + "-" + prov
 
-    mp = (d.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
+    mp = (d.getVar("MULTI_PROVIDER_WHITELIST") or "").split()
     extramp = []
     for p in mp:
         if p.endswith("-native") or "-crosssdk-" in p or p.startswith(("nativesdk-", "virtual/nativesdk-")) or 'cross-canadian' in p:
@@ -111,14 +108,14 @@
             extramp.append(translate_provide(pref, p))
     d.setVar("MULTI_PROVIDER_WHITELIST", " ".join(mp + extramp))
 
-    abisafe = (d.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE", True) or "").split()
+    abisafe = (d.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split()
     extras = []
     for p in prefixes:
         for a in abisafe:
             extras.append(p + "-" + a)
     d.appendVar("SIGGEN_EXCLUDERECIPES_ABISAFE", " " + " ".join(extras))
 
-    siggen_exclude = (d.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS", True) or "").split()
+    siggen_exclude = (d.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS") or "").split()
     extras = []
     for p in prefixes:
         for a in siggen_exclude:
@@ -128,7 +125,7 @@
 
 python multilib_virtclass_handler_vendor () {
     if isinstance(e, bb.event.ConfigParsed):
-        for v in e.data.getVar("MULTILIB_VARIANTS", True).split():
+        for v in e.data.getVar("MULTILIB_VARIANTS").split():
             if e.data.getVar("TARGET_VENDOR_virtclass-multilib-" + v, False) is None:
                 e.data.setVar("TARGET_VENDOR_virtclass-multilib-" + v, e.data.getVar("TARGET_VENDOR", False) + "ml" + v)
         preferred_ml_updates(e.data)
@@ -137,17 +134,15 @@
 multilib_virtclass_handler_vendor[eventmask] = "bb.event.ConfigParsed"
 
 python multilib_virtclass_handler_global () {
-    if not e.data:
+    variant = e.data.getVar("BBEXTENDVARIANT")
+    if variant:
         return
 
-    variant = e.data.getVar("BBEXTENDVARIANT", True)
-
-    if isinstance(e, bb.event.RecipeParsed) and not variant:
-        if bb.data.inherits_class('kernel', e.data) or \
+    if bb.data.inherits_class('kernel', e.data) or \
             bb.data.inherits_class('module-base', e.data) or \
             (bb.data.inherits_class('allarch', e.data) and\
              not bb.data.inherits_class('packagegroup', e.data)):
-            variants = (e.data.getVar("MULTILIB_VARIANTS", True) or "").split()
+            variants = (e.data.getVar("MULTILIB_VARIANTS") or "").split()
 
             import oe.classextend
             clsextends = []
@@ -155,21 +150,21 @@
                 clsextends.append(oe.classextend.ClassExtender(variant, e.data))
 
             # Process PROVIDES
-            origprovs = provs = e.data.getVar("PROVIDES", True) or ""
+            origprovs = provs = e.data.getVar("PROVIDES") or ""
             for clsextend in clsextends:
                 provs = provs + " " + clsextend.map_variable("PROVIDES", setvar=False)
             e.data.setVar("PROVIDES", provs)
 
             # Process RPROVIDES
-            origrprovs = rprovs = e.data.getVar("RPROVIDES", True) or ""
+            origrprovs = rprovs = e.data.getVar("RPROVIDES") or ""
             for clsextend in clsextends:
                 rprovs = rprovs + " " + clsextend.map_variable("RPROVIDES", setvar=False)
             if rprovs.strip():
                 e.data.setVar("RPROVIDES", rprovs)
 
 	    # Process RPROVIDES_${PN}...
-            for pkg in (e.data.getVar("PACKAGES", True) or "").split():
-                origrprovs = rprovs = e.data.getVar("RPROVIDES_%s" % pkg, True) or ""
+            for pkg in (e.data.getVar("PACKAGES") or "").split():
+                origrprovs = rprovs = e.data.getVar("RPROVIDES_%s" % pkg) or ""
                 for clsextend in clsextends:
                     rprovs = rprovs + " " + clsextend.map_variable("RPROVIDES_%s" % pkg, setvar=False)
                     rprovs = rprovs + " " + clsextend.extname + "-" + pkg
@@ -177,5 +172,5 @@
 }
 
 addhandler multilib_virtclass_handler_global
-multilib_virtclass_handler_global[eventmask] = "bb.event.RecipePreFinalise bb.event.RecipeParsed"
+multilib_virtclass_handler_global[eventmask] = "bb.event.RecipeParsed"
 
diff --git a/import-layers/yocto-poky/meta/classes/multilib_header.bbclass b/import-layers/yocto-poky/meta/classes/multilib_header.bbclass
index 304c28e..e03f5b1 100644
--- a/import-layers/yocto-poky/meta/classes/multilib_header.bbclass
+++ b/import-layers/yocto-poky/meta/classes/multilib_header.bbclass
@@ -13,13 +13,9 @@
 		;;
 	*)
 	esac
-        # We use
-        # For ARM: We don't support multilib builds.
         # For MIPS: "n32" is a special case, which needs to be
         # distinct from both 64-bit and 32-bit.
         case ${TARGET_ARCH} in
-        arm*)   return
-                ;;
         mips*)  case "${MIPSPKGSFX_ABI}" in
                 "-n32")
                        ident=n32   
@@ -31,9 +27,6 @@
                 ;;
         *)      ident=${SITEINFO_BITS}
         esac
-	if echo ${TARGET_ARCH} | grep -q arm; then
-	    return
-	fi
 	for each_header in "$@" ; do
 	   if [ ! -f "${D}/${includedir}/$each_header" ]; then
 	      bberror "oe_multilib_header: Unable to find header $each_header."
diff --git a/import-layers/yocto-poky/meta/classes/native.bbclass b/import-layers/yocto-poky/meta/classes/native.bbclass
index 143f8a9..6b7f3dd 100644
--- a/import-layers/yocto-poky/meta/classes/native.bbclass
+++ b/import-layers/yocto-poky/meta/classes/native.bbclass
@@ -95,7 +95,7 @@
 libexecdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
 
 do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}/"
-do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_NATIVE}/"
+do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
 
 # Since we actually install these into situ there is no staging prefix
 STAGING_DIR_HOST = ""
@@ -112,22 +112,33 @@
 LIBCOVERRIDE = ""
 CLASSOVERRIDE = "class-native"
 MACHINEOVERRIDES = ""
+MACHINE_FEATURES = ""
 
 PATH_prepend = "${COREBASE}/scripts/native-intercept:"
 
+# This class encodes staging paths into its scripts data so can only be
+# reused if we manipulate the paths.
+SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
+
 python native_virtclass_handler () {
-    classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
-    if "native" not in classextend:
+    pn = e.data.getVar("PN")
+    if not pn.endswith("-native"):
         return
 
-    pn = e.data.getVar("PN", True)
-    if not pn.endswith("-native"):
+    # Set features here to prevent appends and distro features backfill
+    # from modifying native distro features
+    features = set(d.getVar("DISTRO_FEATURES_NATIVE").split())
+    filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVE"), d).split())
+    d.setVar("DISTRO_FEATURES", " ".join(sorted(features | filtered)))
+
+    classextend = e.data.getVar('BBCLASSEXTEND') or ""
+    if "native" not in classextend:
         return
 
     def map_dependencies(varname, d, suffix = ""):
         if suffix:
             varname = varname + "_" + suffix
-        deps = d.getVar(varname, True)
+        deps = d.getVar(varname)
         if not deps:
             return
         deps = bb.utils.explode_deps(deps)
@@ -146,14 +157,14 @@
     e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-native")
 
     map_dependencies("DEPENDS", e.data)
-    for pkg in [e.data.getVar("PN", True), "", "${PN}"]:
+    for pkg in [e.data.getVar("PN"), "", "${PN}"]:
         map_dependencies("RDEPENDS", e.data, pkg)
         map_dependencies("RRECOMMENDS", e.data, pkg)
         map_dependencies("RSUGGESTS", e.data, pkg)
         map_dependencies("RPROVIDES", e.data, pkg)
         map_dependencies("RREPLACES", e.data, pkg)
 
-    provides = e.data.getVar("PROVIDES", True)
+    provides = e.data.getVar("PROVIDES")
     nprovides = []
     for prov in provides.split():
         if prov.find(pn) != -1:
@@ -170,6 +181,11 @@
 addhandler native_virtclass_handler
 native_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
 
+python do_addto_recipe_sysroot () {
+    bb.build.exec_func("extend_recipe_sysroot", d)
+}
+addtask addto_recipe_sysroot after do_populate_sysroot
+
 inherit nopackages
 
 do_packagedata[stamp-extra-info] = ""
diff --git a/import-layers/yocto-poky/meta/classes/nativesdk.bbclass b/import-layers/yocto-poky/meta/classes/nativesdk.bbclass
index 31dde4a..69fb45c 100644
--- a/import-layers/yocto-poky/meta/classes/nativesdk.bbclass
+++ b/import-layers/yocto-poky/meta/classes/nativesdk.bbclass
@@ -25,9 +25,7 @@
 DEPENDS_append = " chrpath-replacement-native"
 EXTRANATIVEPATH += "chrpath-native"
 
-STAGING_DIR_HOST = "${STAGING_DIR}/${MULTIMACH_HOST_SYS}"
-STAGING_DIR_TARGET = "${STAGING_DIR}/${MULTIMACH_TARGET_SYS}"
-PKGDATA_DIR = "${STAGING_DIR_HOST}/pkgdata"
+PKGDATA_DIR = "${TMPDIR}/pkgdata/${SDK_SYS}"
 
 HOST_ARCH = "${SDK_ARCH}"
 HOST_VENDOR = "${SDK_VENDOR}"
@@ -45,6 +43,10 @@
 TARGET_CC_ARCH = "${SDK_CC_ARCH}"
 TARGET_LD_ARCH = "${SDK_LD_ARCH}"
 TARGET_AS_ARCH = "${SDK_AS_ARCH}"
+TARGET_CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+TARGET_CFLAGS = "${BUILDSDK_CFLAGS}"
+TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
+TARGET_LDFLAGS = "${BUILDSDK_LDFLAGS}"
 TARGET_FPU = ""
 EXTRA_OECONF_GCC_FLOAT = ""
 
@@ -64,17 +66,23 @@
 export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
 
 python nativesdk_virtclass_handler () {
-    pn = e.data.getVar("PN", True)
+    pn = e.data.getVar("PN")
     if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
         return
 
+    # Set features here to prevent appends and distro features backfill
+    # from modifying nativesdk distro features
+    features = set(d.getVar("DISTRO_FEATURES_NATIVESDK").split())
+    filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVESDK"), d).split())
+    d.setVar("DISTRO_FEATURES", " ".join(sorted(features | filtered)))
+
     e.data.setVar("MLPREFIX", "nativesdk-")
-    e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN", True).replace("-nativesdk", "").replace("nativesdk-", ""))
+    e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-nativesdk", "").replace("nativesdk-", ""))
     e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk")
 }
 
 python () {
-    pn = d.getVar("PN", True)
+    pn = d.getVar("PN")
     if not pn.startswith("nativesdk-"):
         return
 
@@ -82,7 +90,7 @@
 
     clsextend = oe.classextend.NativesdkClassExtender("nativesdk", d)
     clsextend.rename_packages()
-    clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
+    clsextend.rename_package_variables((d.getVar("PACKAGEVARS") or "").split())
 
     clsextend.map_depends_variable("DEPENDS")
     clsextend.map_packagevars()
diff --git a/import-layers/yocto-poky/meta/classes/npm.bbclass b/import-layers/yocto-poky/meta/classes/npm.bbclass
index fce4c11..a69bedb 100644
--- a/import-layers/yocto-poky/meta/classes/npm.bbclass
+++ b/import-layers/yocto-poky/meta/classes/npm.bbclass
@@ -13,7 +13,8 @@
     elif re.match('arm64$', target_arch): return 'arm'
     return target_arch
 
-NPM_ARCH ?= "${@npm_oe_arch_map(d.getVar('TARGET_ARCH', True), d)}"
+NPM_ARCH ?= "${@npm_oe_arch_map(d.getVar('TARGET_ARCH'), d)}"
+NPM_INSTALL_DEV = "0"
 
 npm_do_compile() {
 	# Copy in any additionally fetched modules
@@ -23,17 +24,32 @@
 	# changing the home directory to the working directory, the .npmrc will
 	# be created in this directory
 	export HOME=${WORKDIR}
-	npm config set dev false
+	if [  "${NPM_INSTALL_DEV}" = "1" ]; then
+		npm config set dev true
+	else
+		npm config set dev false
+	fi
 	npm set cache ${WORKDIR}/npm_cache
 	# clear cache before every build
 	npm cache clear
 	# Install pkg into ${S} without going to the registry
-	npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry install
+	if [  "${NPM_INSTALL_DEV}" = "1" ]; then
+		npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --no-registry install
+	else
+		npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry install
+	fi
 }
 
 npm_do_install() {
+	# changing the home directory to the working directory, the .npmrc will
+	# be created in this directory
+	export HOME=${WORKDIR}
 	mkdir -p ${NPM_INSTALLDIR}/
-	cp -a ${S}/* ${NPM_INSTALLDIR}/ --no-preserve=ownership
+	npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry
+	if [ -d ${D}${prefix}/etc ] ; then
+		# This will be empty
+		rmdir ${D}${prefix}/etc
+	fi
 }
 
 python populate_packages_prepend () {
@@ -55,7 +71,7 @@
             description = pdata.get('description', None)
             if description:
                 d.setVar('SUMMARY_%s' % expanded_pkgname, description.replace(u"\u2018", "'").replace(u"\u2019", "'"))
-    d.appendVar('RDEPENDS_%s' % d.getVar('PN', True), ' %s' % ' '.join(pkgnames).replace('_', '-'))
+    d.appendVar('RDEPENDS_%s' % d.getVar('PN'), ' %s' % ' '.join(pkgnames).replace('_', '-'))
 }
 
 FILES_${PN} += " \
diff --git a/import-layers/yocto-poky/meta/classes/oelint.bbclass b/import-layers/yocto-poky/meta/classes/oelint.bbclass
index c4febc2..2589d34 100644
--- a/import-layers/yocto-poky/meta/classes/oelint.bbclass
+++ b/import-layers/yocto-poky/meta/classes/oelint.bbclass
@@ -1,7 +1,7 @@
 addtask lint before do_build
 do_lint[nostamp] = "1"
 python do_lint() {
-    pkgname = d.getVar("PN", True)
+    pkgname = d.getVar("PN")
 
     ##############################
     # Test that DESCRIPTION exists
@@ -35,7 +35,7 @@
     # Check that all patches have Signed-off-by and Upstream-Status
     #
     srcuri = d.getVar("SRC_URI", False).split()
-    fpaths = (d.getVar('FILESPATH', True) or '').split(':')
+    fpaths = (d.getVar('FILESPATH') or '').split(':')
 
     def findPatch(patchname):
         for dir in fpaths:
diff --git a/import-layers/yocto-poky/meta/classes/own-mirrors.bbclass b/import-layers/yocto-poky/meta/classes/own-mirrors.bbclass
index 12b4267..0296d54 100644
--- a/import-layers/yocto-poky/meta/classes/own-mirrors.bbclass
+++ b/import-layers/yocto-poky/meta/classes/own-mirrors.bbclass
@@ -9,5 +9,5 @@
 osc://.*/.*     ${SOURCE_MIRROR_URL}
 https?$://.*/.* ${SOURCE_MIRROR_URL}
 ftp://.*/.*     ${SOURCE_MIRROR_URL}
-npm://.*/.*     ${SOURCE_MIRROR_URL}
+npm://.*/?.*    ${SOURCE_MIRROR_URL}
 }
diff --git a/import-layers/yocto-poky/meta/classes/package.bbclass b/import-layers/yocto-poky/meta/classes/package.bbclass
index a6f0a7a..a03c05b 100644
--- a/import-layers/yocto-poky/meta/classes/package.bbclass
+++ b/import-layers/yocto-poky/meta/classes/package.bbclass
@@ -54,6 +54,14 @@
 # rpm is used for the per-file dependency identification
 PACKAGE_DEPENDS += "rpm-native"
 
+
+# If your postinstall can execute at rootfs creation time rather than on
+# target but depends on a native/cross tool in order to execute, you need to
+# list that tool in PACKAGE_WRITE_DEPENDS. Target package dependencies belong
+# in the package dependencies as normal, this is just for native/cross support
+# tools at rootfs build time.
+PACKAGE_WRITE_DEPS ??= ""
+
 def legitimize_package_name(s):
     """
     Make sure package names are legitimate strings
@@ -120,7 +128,7 @@
 
     """
 
-    dvar = d.getVar('PKGD', True)
+    dvar = d.getVar('PKGD')
     root = d.expand(root)
     output_pattern = d.expand(output_pattern)
     extra_depends = d.expand(extra_depends)
@@ -130,7 +138,7 @@
     if not os.path.exists(dvar + root):
         return []
 
-    ml = d.getVar("MLPREFIX", True)
+    ml = d.getVar("MLPREFIX")
     if ml:
         if not output_pattern.startswith(ml):
             output_pattern = ml + output_pattern
@@ -145,7 +153,7 @@
             extra_depends = " ".join(newdeps)
 
 
-    packages = d.getVar('PACKAGES', True).split()
+    packages = d.getVar('PACKAGES').split()
     split_packages = set()
 
     if postinst:
@@ -163,7 +171,7 @@
                     objs.append(relpath)
 
     if extra_depends == None:
-        extra_depends = d.getVar("PN", True)
+        extra_depends = d.getVar("PN")
 
     if not summary:
         summary = description
@@ -189,7 +197,7 @@
                 packages = [pkg] + packages
             else:
                 packages.append(pkg)
-        oldfiles = d.getVar('FILES_' + pkg, True)
+        oldfiles = d.getVar('FILES_' + pkg)
         newfile = os.path.join(root, o)
         # These names will be passed through glob() so if the filename actually
         # contains * or ? (rare, but possible) we need to handle that specially
@@ -214,9 +222,9 @@
             d.setVar('FILES_' + pkg, oldfiles + " " + newfile)
         if extra_depends != '':
             d.appendVar('RDEPENDS_' + pkg, ' ' + extra_depends)
-        if not d.getVar('DESCRIPTION_' + pkg, True):
+        if not d.getVar('DESCRIPTION_' + pkg):
             d.setVar('DESCRIPTION_' + pkg, description % on)
-        if not d.getVar('SUMMARY_' + pkg, True):
+        if not d.getVar('SUMMARY_' + pkg):
             d.setVar('SUMMARY_' + pkg, summary % on)
         if postinst:
             d.setVar('pkg_postinst_' + pkg, postinst)
@@ -231,9 +239,9 @@
 PACKAGE_DEPENDS += "file-native"
 
 python () {
-    if d.getVar('PACKAGES', True) != '':
+    if d.getVar('PACKAGES') != '':
         deps = ""
-        for dep in (d.getVar('PACKAGE_DEPENDS', True) or "").split():
+        for dep in (d.getVar('PACKAGE_DEPENDS') or "").split():
             deps += " %s:do_populate_sysroot" % dep
         d.appendVarFlag('do_package', 'depends', deps)
 
@@ -286,14 +294,14 @@
 
 # Called in package_<rpm,ipk,deb>.bbclass to get the correct list of configuration files
 def get_conffiles(pkg, d):
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
     root = os.path.join(pkgdest, pkg)
     cwd = os.getcwd()
     os.chdir(root)
 
-    conffiles = d.getVar('CONFFILES_%s' % pkg, True);
+    conffiles = d.getVar('CONFFILES_%s' % pkg);
     if conffiles == None:
-        conffiles = d.getVar('CONFFILES', True)
+        conffiles = d.getVar('CONFFILES')
     if conffiles == None:
         conffiles = ""
     conffiles = conffiles.split()
@@ -318,7 +326,7 @@
     return conf_list
 
 def checkbuildpath(file, d):
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
     with open(file) as f:
         file_content = f.read()
         if tmpdir in file_content:
@@ -335,9 +343,9 @@
 
     import stat
 
-    dvar = d.getVar('PKGD', True)
-    objcopy = d.getVar("OBJCOPY", True)
-    debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
+    dvar = d.getVar('PKGD')
+    objcopy = d.getVar("OBJCOPY")
+    debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/debugedit")
 
     # We ignore kernel modules, we don't generate debug info files.
     if file.find("/lib/modules/") != -1 and file.endswith(".ko"):
@@ -382,11 +390,11 @@
 
     sourcefile = d.expand("${WORKDIR}/debugsources.list")
     if debugsrcdir and os.path.isfile(sourcefile):
-        dvar = d.getVar('PKGD', True)
-        strip = d.getVar("STRIP", True)
-        objcopy = d.getVar("OBJCOPY", True)
+        dvar = d.getVar('PKGD')
+        strip = d.getVar("STRIP")
+        objcopy = d.getVar("OBJCOPY")
         debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
-        workdir = d.getVar("WORKDIR", True)
+        workdir = d.getVar("WORKDIR")
         workparentdir = os.path.dirname(os.path.dirname(workdir))
         workbasedir = os.path.basename(os.path.dirname(workdir)) + "/" + os.path.basename(workdir)
 
@@ -406,7 +414,8 @@
         bb.utils.mkdirhier(basepath)
         cpath.updatecache(basepath)
 
-        processdebugsrc =  "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | "
+        # Ignore files from the recipe sysroots (target and native)
+        processdebugsrc =  "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '((<internal>|<built-in>)$|/.*recipe-sysroot.*/)' | "
         # We need to ignore files that are not actually ours
         # we do this by only paying attention to items from this package
         processdebugsrc += "fgrep -zw '%s' | "
@@ -462,26 +471,23 @@
         if d.getVar(key, False) is None:
             continue
         d.setVarFlag(key, "type", "list")
-        if d.getVarFlag(key, "separator", True) is None:
+        if d.getVarFlag(key, "separator") is None:
             d.setVarFlag(key, "separator", "\\n")
         metadata_fields = [field.strip() for field in oe.data.typed_value(key, d)]
         return "\n".join(metadata_fields).strip()
 
 def runtime_mapping_rename (varname, pkg, d):
-    #bb.note("%s before: %s" % (varname, d.getVar(varname, True)))
-
-    if bb.data.inherits_class('packagegroup', d):
-        return
+    #bb.note("%s before: %s" % (varname, d.getVar(varname)))
 
     new_depends = {}
-    deps = bb.utils.explode_dep_versions2(d.getVar(varname, True) or "")
+    deps = bb.utils.explode_dep_versions2(d.getVar(varname) or "")
     for depend in deps:
         new_depend = get_package_mapping(depend, pkg, d)
         new_depends[new_depend] = deps[depend]
 
     d.setVar(varname, bb.utils.join_deps(new_depends, commasep=False))
 
-    #bb.note("%s after: %s" % (varname, d.getVar(varname, True)))
+    #bb.note("%s after: %s" % (varname, d.getVar(varname)))
 
 #
 # Package functions suitable for inclusion in PACKAGEFUNCS
@@ -492,34 +498,34 @@
     import re
 
     # Support per recipe PRSERV_HOST
-    pn = d.getVar('PN', True)
-    host = d.getVar("PRSERV_HOST_" + pn, True)
+    pn = d.getVar('PN')
+    host = d.getVar("PRSERV_HOST_" + pn)
     if not (host is None):
         d.setVar("PRSERV_HOST", host)
 
-    pkgv = d.getVar("PKGV", True)
+    pkgv = d.getVar("PKGV")
 
     # PR Server not active, handle AUTOINC
-    if not d.getVar('PRSERV_HOST', True):
+    if not d.getVar('PRSERV_HOST'):
         if 'AUTOINC' in pkgv:
             d.setVar("PKGV", pkgv.replace("AUTOINC", "0"))
         return
 
     auto_pr = None
-    pv = d.getVar("PV", True)
-    version = d.getVar("PRAUTOINX", True)
-    pkgarch = d.getVar("PACKAGE_ARCH", True)
-    checksum = d.getVar("BB_TASKHASH", True)
+    pv = d.getVar("PV")
+    version = d.getVar("PRAUTOINX")
+    pkgarch = d.getVar("PACKAGE_ARCH")
+    checksum = d.getVar("BB_TASKHASH")
 
-    if d.getVar('PRSERV_LOCKDOWN', True):
-        auto_pr = d.getVar('PRAUTO_' + version + '_' + pkgarch, True) or d.getVar('PRAUTO_' + version, True) or None
+    if d.getVar('PRSERV_LOCKDOWN'):
+        auto_pr = d.getVar('PRAUTO_' + version + '_' + pkgarch) or d.getVar('PRAUTO_' + version) or None
         if auto_pr is None:
             bb.fatal("Can NOT get PRAUTO from lockdown exported file")
         d.setVar('PRAUTO',str(auto_pr))
         return
 
     try:
-        conn = d.getVar("__PRSERV_CONN", True)
+        conn = d.getVar("__PRSERV_CONN")
         if conn is None:
             conn = oe.prservice.prserv_make_conn(d)
         if conn is not None:
@@ -540,19 +546,19 @@
 LOCALEBASEPN ??= "${PN}"
 
 python package_do_split_locales() {
-    if (d.getVar('PACKAGE_NO_LOCALE', True) == '1'):
+    if (d.getVar('PACKAGE_NO_LOCALE') == '1'):
         bb.debug(1, "package requested not splitting locales")
         return
 
-    packages = (d.getVar('PACKAGES', True) or "").split()
+    packages = (d.getVar('PACKAGES') or "").split()
 
-    datadir = d.getVar('datadir', True)
+    datadir = d.getVar('datadir')
     if not datadir:
         bb.note("datadir not defined")
         return
 
-    dvar = d.getVar('PKGD', True)
-    pn = d.getVar('LOCALEBASEPN', True)
+    dvar = d.getVar('PKGD')
+    pn = d.getVar('LOCALEBASEPN')
 
     if pn + '-locale' in packages:
         packages.remove(pn + '-locale')
@@ -565,10 +571,10 @@
 
     locales = os.listdir(localedir)
 
-    summary = d.getVar('SUMMARY', True) or pn
-    description = d.getVar('DESCRIPTION', True) or ""
-    locale_section = d.getVar('LOCALE_SECTION', True)
-    mlprefix = d.getVar('MLPREFIX', True) or ""
+    summary = d.getVar('SUMMARY') or pn
+    description = d.getVar('DESCRIPTION') or ""
+    locale_section = d.getVar('LOCALE_SECTION')
+    mlprefix = d.getVar('MLPREFIX') or ""
     for l in sorted(locales):
         ln = legitimize_package_name(l)
         pkg = pn + '-locale-' + ln
@@ -589,14 +595,14 @@
     # glibc-localedata-translit* won't install as a dependency
     # for some other package which breaks meta-toolchain
     # Probably breaks since virtual-locale- isn't provided anywhere
-    #rdep = (d.getVar('RDEPENDS_%s' % pn, True) or "").split()
+    #rdep = (d.getVar('RDEPENDS_%s' % pn) or "").split()
     #rdep.append('%s-locale*' % pn)
     #d.setVar('RDEPENDS_%s' % pn, ' '.join(rdep))
 }
 
 python perform_packagecopy () {
-    dest = d.getVar('D', True)
-    dvar = d.getVar('PKGD', True)
+    dest = d.getVar('D')
+    dvar = d.getVar('PKGD')
 
     # Start by package population by taking a copy of the installed
     # files to operate on
@@ -730,8 +736,8 @@
     # paths are resolved via BBPATH
     def get_fs_perms_list(d):
         str = ""
-        bbpath = d.getVar('BBPATH', True)
-        fs_perms_tables = d.getVar('FILESYSTEM_PERMS_TABLES', True)
+        bbpath = d.getVar('BBPATH')
+        fs_perms_tables = d.getVar('FILESYSTEM_PERMS_TABLES')
         if not fs_perms_tables:
             fs_perms_tables = 'files/fs-perms.txt'
         for conf_file in fs_perms_tables.split():
@@ -740,7 +746,7 @@
 
 
 
-    dvar = d.getVar('PKGD', True)
+    dvar = d.getVar('PKGD')
 
     fs_perms_table = {}
     fs_link_table = {}
@@ -769,10 +775,10 @@
                 'oldincludedir' ]
 
     for path in target_path_vars:
-        dir = d.getVar(path, True) or ""
+        dir = d.getVar(path) or ""
         if dir == "":
             continue
-        fs_perms_table[dir] = fs_perms_entry(bb.data.expand("%s 0755 root root false - - -" % (dir), d))
+        fs_perms_table[dir] = fs_perms_entry(d.expand("%s 0755 root root false - - -" % (dir)))
 
     # Now we actually load from the configuration files
     for conf in get_fs_perms_list(d).split():
@@ -854,20 +860,20 @@
 python split_and_strip_files () {
     import stat, errno
 
-    dvar = d.getVar('PKGD', True)
-    pn = d.getVar('PN', True)
+    dvar = d.getVar('PKGD')
+    pn = d.getVar('PN')
 
     oldcwd = os.getcwd()
     os.chdir(dvar)
 
     # We default to '.debug' style
-    if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == 'debug-file-directory':
+    if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-file-directory':
         # Single debug-file-directory style debug info
         debugappend = ".debug"
         debugdir = ""
         debuglibdir = "/usr/lib/debug"
         debugsrcdir = "/usr/src/debug"
-    elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == 'debug-without-src':
+    elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-without-src':
         # Original OE-core, a.k.a. ".debug", style debug info, but without sources in /usr/src/debug
         debugappend = ""
         debugdir = "/.debug"
@@ -918,10 +924,10 @@
     symlinks = {}
     kernmods = []
     inodes = {}
-    libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir", True))
-    baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir", True))
-    if (d.getVar('INHIBIT_PACKAGE_STRIP', True) != '1' or \
-            d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT', True) != '1'):
+    libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir"))
+    baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir"))
+    if (d.getVar('INHIBIT_PACKAGE_STRIP') != '1' or \
+            d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT') != '1'):
         for root, dirs, files in cpath.walk(dvar):
             for f in files:
                 file = os.path.join(root, f)
@@ -962,7 +968,7 @@
                     elf_file = isELF(file)
                     if elf_file & 1:
                         if elf_file & 2:
-                            if 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn, True) or "").split():
+                            if 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn) or "").split():
                                 bb.note("Skipping file %s from %s for already-stripped QA test" % (file[len(dvar):], pn))
                             else:
                                 msg = "File '%s' from %s was already stripped, this will prevent future debugging!" % (file[len(dvar):], pn)
@@ -991,7 +997,7 @@
     #
     # First lets process debug splitting
     #
-    if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT', True) != '1'):
+    if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT') != '1'):
         for file in elffiles:
             src = file[len(dvar):]
             dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
@@ -1054,8 +1060,8 @@
     #
     # Now lets go back over things and strip them
     #
-    if (d.getVar('INHIBIT_PACKAGE_STRIP', True) != '1'):
-        strip = d.getVar("STRIP", True)
+    if (d.getVar('INHIBIT_PACKAGE_STRIP') != '1'):
+        strip = d.getVar("STRIP")
         sfiles = []
         for file in elffiles:
             elf_file = int(elffiles[file])
@@ -1075,16 +1081,16 @@
 python populate_packages () {
     import glob, re
 
-    workdir = d.getVar('WORKDIR', True)
-    outdir = d.getVar('DEPLOY_DIR', True)
-    dvar = d.getVar('PKGD', True)
-    packages = d.getVar('PACKAGES', True)
-    pn = d.getVar('PN', True)
+    workdir = d.getVar('WORKDIR')
+    outdir = d.getVar('DEPLOY_DIR')
+    dvar = d.getVar('PKGD')
+    packages = d.getVar('PACKAGES')
+    pn = d.getVar('PN')
 
     bb.utils.mkdirhier(outdir)
     os.chdir(dvar)
     
-    autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG", True) or False)
+    autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG") or False)
 
     # Sanity check PACKAGES for duplicates
     # Sanity should be moved to sanity.bbclass once we have the infrastucture
@@ -1099,7 +1105,7 @@
         else:
             package_list.append(pkg)
     d.setVar('PACKAGES', ' '.join(package_list))
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
 
     seen = []
 
@@ -1120,7 +1126,7 @@
         root = os.path.join(pkgdest, pkg)
         bb.utils.mkdirhier(root)
 
-        filesvar = d.getVar('FILES_%s' % pkg, True) or ""
+        filesvar = d.getVar('FILES_%s' % pkg) or ""
         if "//" in filesvar:
             msg = "FILES variable for package %s contains '//' which is invalid. Attempting to fix this but you should correct the metadata.\n" % pkg
             package_qa_handle_error("files-invalid", msg, d)
@@ -1188,7 +1194,7 @@
     # Handle LICENSE_EXCLUSION
     package_list = []
     for pkg in packages.split():
-        if d.getVar('LICENSE_EXCLUSION-' + pkg, True):
+        if d.getVar('LICENSE_EXCLUSION-' + pkg):
             msg = "%s has an incompatible license. Excluding from packaging." % pkg
             package_qa_handle_error("incompatible-license", msg, d)
         else:
@@ -1207,7 +1213,7 @@
 
     if unshipped != []:
         msg = pn + ": Files/directories were installed but not shipped in any package:"
-        if "installed-vs-shipped" in (d.getVar('INSANE_SKIP_' + pn, True) or "").split():
+        if "installed-vs-shipped" in (d.getVar('INSANE_SKIP_' + pn) or "").split():
             bb.note("Package %s skipping QA tests: installed-vs-shipped" % pn)
         else:
             for f in unshipped:
@@ -1220,7 +1226,7 @@
 
 python package_fixsymlinks () {
     import errno
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
     packages = d.getVar("PACKAGES", False).split()
 
     dangling_links = {}
@@ -1255,7 +1261,7 @@
                 bb.note("%s contains dangling symlink to %s" % (pkg, l))
 
     for pkg in newrdepends:
-        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or "")
+        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg) or "")
         for p in newrdepends[pkg]:
             if p not in rdepends:
                 rdepends[p] = []
@@ -1286,11 +1292,11 @@
             c = codecs.getencoder("unicode_escape")
             return c(str)[0].decode("latin1")
 
-        val = d.getVar('%s_%s' % (var, pkg), True)
+        val = d.getVar('%s_%s' % (var, pkg))
         if val:
             f.write('%s_%s: %s\n' % (var, pkg, encode(val)))
             return val
-        val = d.getVar('%s' % (var), True)
+        val = d.getVar('%s' % (var))
         if val:
             f.write('%s: %s\n' % (var, encode(val)))
         return val
@@ -1309,9 +1315,9 @@
                 with open(subdata_file, 'w') as fd:
                     fd.write("PKG_%s: %s" % (ml_pkg, pkg))
 
-    packages = d.getVar('PACKAGES', True)
-    pkgdest = d.getVar('PKGDEST', True)
-    pkgdatadir = d.getVar('PKGDESTWORK', True)
+    packages = d.getVar('PACKAGES')
+    pkgdest = d.getVar('PKGDEST')
+    pkgdatadir = d.getVar('PKGDESTWORK')
 
     # Take shared lock since we're only reading, not writing
     lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
@@ -1321,9 +1327,9 @@
     f.write("PACKAGES: %s\n" % packages)
     f.close()
 
-    pn = d.getVar('PN', True)
-    global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS', True) or "").split()
-    variants = (d.getVar('MULTILIB_VARIANTS', True) or "").split()
+    pn = d.getVar('PN')
+    global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS') or "").split()
+    variants = (d.getVar('MULTILIB_VARIANTS') or "").split()
 
     if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
         write_extra_pkgs(variants, pn, packages, pkgdatadir)
@@ -1331,10 +1337,10 @@
     if (bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d)):
         write_extra_pkgs(global_variants, pn, packages, pkgdatadir)
 
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
 
     for pkg in packages.split():
-        pkgval = d.getVar('PKG_%s' % pkg, True)
+        pkgval = d.getVar('PKG_%s' % pkg)
         if pkgval is None:
             pkgval = pkg
             d.setVar('PKG_%s' % pkg, pkg)
@@ -1342,11 +1348,14 @@
         pkgdestpkg = os.path.join(pkgdest, pkg)
         files = {}
         total_size = 0
+        seen = set()
         for f in pkgfiles[pkg]:
             relpth = os.path.relpath(f, pkgdestpkg)
             fstat = os.lstat(f)
-            total_size += fstat.st_size
             files[os.sep + relpth] = fstat.st_size
+            if fstat.st_ino not in seen:
+                seen.add(fstat.st_ino)
+                total_size += fstat.st_size
         d.setVar('FILES_INFO', json.dumps(files))
 
         subdata_file = pkgdatadir + "/runtime/%s" % pkg
@@ -1371,17 +1380,18 @@
         write_if_exists(sf, pkg, 'PKG')
         write_if_exists(sf, pkg, 'ALLOW_EMPTY')
         write_if_exists(sf, pkg, 'FILES')
+        write_if_exists(sf, pkg, 'CONFFILES')
         write_if_exists(sf, pkg, 'pkg_postinst')
         write_if_exists(sf, pkg, 'pkg_postrm')
         write_if_exists(sf, pkg, 'pkg_preinst')
         write_if_exists(sf, pkg, 'pkg_prerm')
         write_if_exists(sf, pkg, 'FILERPROVIDESFLIST')
         write_if_exists(sf, pkg, 'FILES_INFO')
-        for dfile in (d.getVar('FILERPROVIDESFLIST_' + pkg, True) or "").split():
+        for dfile in (d.getVar('FILERPROVIDESFLIST_' + pkg) or "").split():
             write_if_exists(sf, pkg, 'FILERPROVIDES_' + dfile)
 
         write_if_exists(sf, pkg, 'FILERDEPENDSFLIST')
-        for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg, True) or "").split():
+        for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg) or "").split():
             write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile)
 
         sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size))
@@ -1394,9 +1404,9 @@
                 bb.utils.mkdirhier(os.path.dirname(subdata_sym))
                 oe.path.symlink("../../runtime/%s" % pkg, subdata_sym, True)
 
-        allow_empty = d.getVar('ALLOW_EMPTY_%s' % pkg, True)
+        allow_empty = d.getVar('ALLOW_EMPTY_%s' % pkg)
         if not allow_empty:
-            allow_empty = d.getVar('ALLOW_EMPTY', True)
+            allow_empty = d.getVar('ALLOW_EMPTY')
         root = "%s/%s" % (pkgdest, pkg)
         os.chdir(root)
         g = glob('*')
@@ -1424,7 +1434,13 @@
 fi
 }
 
-RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/bin/rpmdeps-oecore --macros ${STAGING_LIBDIR_NATIVE}/rpm/macros --define '_rpmfc_magic_path ${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc' --rpmpopt ${STAGING_LIBDIR_NATIVE}/rpm/rpmpopt"
+# In Morty and earlier releases, and on master (Rocko), the RPM file
+# dependencies are always enabled. However, since they were broken with the
+# release of Pyro and enabling them may cause build problems for some packages,
+# they are not enabled by default in Pyro. Setting ENABLE_RPM_FILEDEPS_FOR_PYRO
+# to "1" will enable them again.
+ENABLE_RPM_FILEDEPS_FOR_PYRO ??= "0"
+RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/rpmdeps${@' --alldeps' if d.getVar('ENABLE_RPM_FILEDEPS_FOR_PYRO') == '1' else ''}"
 
 # Collect perfile run-time dependency metadata
 # Output:
@@ -1435,19 +1451,19 @@
 #  FILERDEPENDS_filepath_pkg - per file dep
 
 python package_do_filedeps() {
-    if d.getVar('SKIP_FILEDEPS', True) == '1':
+    if d.getVar('SKIP_FILEDEPS') == '1':
         return
 
-    pkgdest = d.getVar('PKGDEST', True)
-    packages = d.getVar('PACKAGES', True)
-    rpmdeps = d.getVar('RPMDEPS', True)
+    pkgdest = d.getVar('PKGDEST')
+    packages = d.getVar('PACKAGES')
+    rpmdeps = d.getVar('RPMDEPS')
 
     def chunks(files, n):
         return [files[i:i+n] for i in range(0, len(files), n)]
 
     pkglist = []
     for pkg in packages.split():
-        if d.getVar('SKIP_FILEDEPS_' + pkg, True) == '1':
+        if d.getVar('SKIP_FILEDEPS_' + pkg) == '1':
             continue
         if pkg.endswith('-dbg') or pkg.endswith('-doc') or pkg.find('-locale-') != -1 or pkg.find('-localedata-') != -1 or pkg.find('-gconv-') != -1 or pkg.find('-charmap-') != -1 or pkg.startswith('kernel-module-'):
             continue
@@ -1496,22 +1512,22 @@
         return
 
     lib_re = re.compile("^.*\.so")
-    libdir_re = re.compile(".*/%s$" % d.getVar('baselib', True))
+    libdir_re = re.compile(".*/%s$" % d.getVar('baselib'))
 
-    packages = d.getVar('PACKAGES', True)
-    targetos = d.getVar('TARGET_OS', True)
+    packages = d.getVar('PACKAGES')
+    targetos = d.getVar('TARGET_OS')
 
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
 
-    ver = d.getVar('PKGV', True)
+    ver = d.getVar('PKGV')
     if not ver:
         msg = "PKGV not defined"
         package_qa_handle_error("pkgv-undefined", msg, d)
         return
 
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
 
-    shlibswork_dir = d.getVar('SHLIBSWORKDIR', True)
+    shlibswork_dir = d.getVar('SHLIBSWORKDIR')
 
     # Take shared lock since we're only reading, not writing
     lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"))
@@ -1519,7 +1535,7 @@
     def linux_so(file, needed, sonames, renames, pkgver):
         needs_ldconfig = False
         ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
-        cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null"
+        cmd = d.getVar('OBJDUMP') + " -p " + pipes.quote(file) + " 2>/dev/null"
         fd = os.popen(cmd)
         lines = fd.readlines()
         fd.close()
@@ -1601,28 +1617,44 @@
                 if name and name not in needed[pkg]:
                      needed[pkg].append((name, file, []))
 
-    if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS', True) == "1":
+    def mingw_dll(file, needed, sonames, renames, pkgver):
+        if not os.path.exists(file):
+            return
+
+        if file.endswith(".dll"):
+            # assume all dlls are shared objects provided by the package
+            sonames.append((os.path.basename(file), os.path.dirname(file).replace(pkgdest + "/" + pkg, ''), pkgver))
+
+        if (file.endswith(".dll") or file.endswith(".exe")):
+            # use objdump to search for "DLL Name: .*\.dll"
+            p = sub.Popen([d.expand("${HOST_PREFIX}objdump"), "-p", file], stdout = sub.PIPE, stderr= sub.PIPE)
+            out, err = p.communicate()
+            # process the output, grabbing all .dll names
+            if p.returncode == 0:
+                for m in re.finditer("DLL Name: (.*?\.dll)$", out.decode(), re.MULTILINE | re.IGNORECASE):
+                    dllname = m.group(1)
+                    if dllname:
+                        needed[pkg].append((dllname, file, []))
+
+    if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS') == "1":
         snap_symlinks = True
     else:
         snap_symlinks = False
 
-    if (d.getVar('USE_LDCONFIG', True) or "1") == "1":
-        use_ldconfig = True
-    else:
-        use_ldconfig = False
+    use_ldconfig = bb.utils.contains('DISTRO_FEATURES', 'ldconfig', True, False, d)
 
     needed = {}
     shlib_provider = oe.package.read_shlib_providers(d)
 
     for pkg in packages.split():
-        private_libs = d.getVar('PRIVATE_LIBS_' + pkg, True) or d.getVar('PRIVATE_LIBS', True) or ""
+        private_libs = d.getVar('PRIVATE_LIBS_' + pkg) or d.getVar('PRIVATE_LIBS') or ""
         private_libs = private_libs.split()
         needs_ldconfig = False
         bb.debug(2, "calculating shlib provides for %s" % pkg)
 
-        pkgver = d.getVar('PKGV_' + pkg, True)
+        pkgver = d.getVar('PKGV_' + pkg)
         if not pkgver:
-            pkgver = d.getVar('PV_' + pkg, True)
+            pkgver = d.getVar('PV_' + pkg)
         if not pkgver:
             pkgver = ver
 
@@ -1635,6 +1667,8 @@
                     continue
                 if targetos == "darwin" or targetos == "darwin8":
                     darwin_so(file, needed, sonames, renames, pkgver)
+                elif targetos.startswith("mingw"):
+                    mingw_dll(file, needed, sonames, renames, pkgver)
                 elif os.access(file, os.X_OK) or lib_re.match(file):
                     ldconfig = linux_so(file, needed, sonames, renames, pkgver)
                     needs_ldconfig = needs_ldconfig or ldconfig
@@ -1659,18 +1693,18 @@
             fd.close()
         if needs_ldconfig and use_ldconfig:
             bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
-            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            postinst = d.getVar('pkg_postinst_%s' % pkg)
             if not postinst:
                 postinst = '#!/bin/sh\n'
-            postinst += d.getVar('ldconfig_postinst_fragment', True)
+            postinst += d.getVar('ldconfig_postinst_fragment')
             d.setVar('pkg_postinst_%s' % pkg, postinst)
         bb.debug(1, 'LIBNAMES: pkg %s sonames %s' % (pkg, sonames))
 
     bb.utils.unlockfile(lf)
 
-    assumed_libs = d.getVar('ASSUME_SHLIBS', True)
+    assumed_libs = d.getVar('ASSUME_SHLIBS')
     if assumed_libs:
-        libdir = d.getVar("libdir", True)
+        libdir = d.getVar("libdir")
         for e in assumed_libs.split():
             l, dep_pkg = e.split(":")
             lib_ver = None
@@ -1682,7 +1716,7 @@
                 shlib_provider[l] = {}
             shlib_provider[l][libdir] = (dep_pkg, lib_ver)
 
-    libsearchpath = [d.getVar('libdir', True), d.getVar('base_libdir', True)]
+    libsearchpath = [d.getVar('libdir'), d.getVar('base_libdir')]
 
     for pkg in packages.split():
         bb.debug(2, "calculating shlib requirements for %s" % pkg)
@@ -1736,12 +1770,12 @@
 python package_do_pkgconfig () {
     import re
 
-    packages = d.getVar('PACKAGES', True)
-    workdir = d.getVar('WORKDIR', True)
-    pkgdest = d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES')
+    workdir = d.getVar('WORKDIR')
+    pkgdest = d.getVar('PKGDEST')
 
-    shlibs_dirs = d.getVar('SHLIBSDIRS', True).split()
-    shlibswork_dir = d.getVar('SHLIBSWORKDIR', True)
+    shlibs_dirs = d.getVar('SHLIBSDIRS').split()
+    shlibswork_dir = d.getVar('SHLIBSWORKDIR')
 
     pc_re = re.compile('(.*)\.pc$')
     var_re = re.compile('(.*)=(.*)')
@@ -1773,7 +1807,7 @@
                         m = field_re.match(l)
                         if m:
                             hdr = m.group(1)
-                            exp = bb.data.expand(m.group(2), pd)
+                            exp = pd.expand(m.group(2))
                             if hdr == 'Requires':
                                 pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
 
@@ -1826,7 +1860,7 @@
 
 def read_libdep_files(d):
     pkglibdeps = {}
-    packages = d.getVar('PACKAGES', True).split()
+    packages = d.getVar('PACKAGES').split()
     for pkg in packages:
         pkglibdeps[pkg] = {}
         for extension in ".shlibdeps", ".pcdeps", ".clilibdeps":
@@ -1846,9 +1880,9 @@
 python read_shlibdeps () {
     pkglibdeps = read_libdep_files(d)
 
-    packages = d.getVar('PACKAGES', True).split()
+    packages = d.getVar('PACKAGES').split()
     for pkg in packages:
-        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or "")
+        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg) or "")
         for dep in pkglibdeps[pkg]:
             # Add the dep if it's not already there, or if no comparison is set
             if dep not in rdepends:
@@ -1873,14 +1907,14 @@
     package.
     """
 
-    packages  = d.getVar('PACKAGES', True)
-    postfixes = (d.getVar('DEPCHAIN_POST', True) or '').split()
-    prefixes  = (d.getVar('DEPCHAIN_PRE', True) or '').split()
+    packages  = d.getVar('PACKAGES')
+    postfixes = (d.getVar('DEPCHAIN_POST') or '').split()
+    prefixes  = (d.getVar('DEPCHAIN_PRE') or '').split()
 
     def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d):
 
         #bb.note('depends for %s is %s' % (base, depends))
-        rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg, True) or "")
+        rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg) or "")
 
         for depend in depends:
             if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'):
@@ -1901,7 +1935,7 @@
     def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d):
 
         #bb.note('rdepends for %s is %s' % (base, rdepends))
-        rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg, True) or "")
+        rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg) or "")
 
         for depend in rdepends:
             if depend.find('virtual-locale-') != -1:
@@ -1924,12 +1958,12 @@
             list.append(dep)
 
     depends = []
-    for dep in bb.utils.explode_deps(d.getVar('DEPENDS', True) or ""):
+    for dep in bb.utils.explode_deps(d.getVar('DEPENDS') or ""):
         add_dep(depends, dep)
 
     rdepends = []
     for pkg in packages.split():
-        for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + pkg, True) or ""):
+        for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + pkg) or ""):
             add_dep(rdepends, dep)
 
     #bb.note('rdepends is %s' % rdepends)
@@ -1959,11 +1993,11 @@
         for pkg in pkglibdeps:
             for k in pkglibdeps[pkg]:
                 add_dep(pkglibdeplist, k)
-        dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS', True) == '1') or (bb.data.inherits_class('packagegroup', d)))
+        dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS') == '1') or (bb.data.inherits_class('packagegroup', d)))
 
     for suffix in pkgs:
         for pkg in pkgs[suffix]:
-            if d.getVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs', True):
+            if d.getVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs'):
                 continue
             (base, func) = pkgs[suffix][pkg]
             if suffix == "-dev":
@@ -1976,19 +2010,19 @@
                 pkg_addrrecs(pkg, base, suffix, func, rdepends, d)
             else:
                 rdeps = []
-                for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + base, True) or ""):
+                for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + base) or ""):
                     add_dep(rdeps, dep)
                 pkg_addrrecs(pkg, base, suffix, func, rdeps, d)
 }
 
 # Since bitbake can't determine which variables are accessed during package
 # iteration, we need to list them here:
-PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE"
+PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE SKIP_FILEDEPS PRIVATE_LIBS"
 
 def gen_packagevar(d):
     ret = []
-    pkgs = (d.getVar("PACKAGES", True) or "").split()
-    vars = (d.getVar("PACKAGEVARS", True) or "").split()
+    pkgs = (d.getVar("PACKAGES") or "").split()
+    vars = (d.getVar("PACKAGEVARS") or "").split()
     for p in pkgs:
         for v in vars:
             ret.append(v + "_" + p)
@@ -2036,16 +2070,16 @@
     # Sanity test the setup
     ###########################################################################
 
-    packages = (d.getVar('PACKAGES', True) or "").split()
+    packages = (d.getVar('PACKAGES') or "").split()
     if len(packages) < 1:
         bb.debug(1, "No packages to build, skipping do_package")
         return
 
-    workdir = d.getVar('WORKDIR', True)
-    outdir = d.getVar('DEPLOY_DIR', True)
-    dest = d.getVar('D', True)
-    dvar = d.getVar('PKGD', True)
-    pn = d.getVar('PN', True)
+    workdir = d.getVar('WORKDIR')
+    outdir = d.getVar('DEPLOY_DIR')
+    dest = d.getVar('D')
+    dvar = d.getVar('PKGD')
+    pn = d.getVar('PN')
 
     if not workdir or not outdir or not dest or not dvar or not pn:
         msg = "WORKDIR, DEPLOY_DIR, D, PN and PKGD all must be defined, unable to package"
@@ -2063,7 +2097,7 @@
     # code pre-expands some frequently used variables
 
     def expandVar(x, d):
-        d.setVar(x, d.getVar(x, True))
+        d.setVar(x, d.getVar(x))
 
     for x in 'PN', 'PV', 'BPN', 'TARGET_SYS', 'EXTENDPRAUTO':
         expandVar(x, d)
@@ -2072,7 +2106,7 @@
     # Setup PKGD (from D)
     ###########################################################################
 
-    for f in (d.getVar('PACKAGEBUILDPKGD', True) or '').split():
+    for f in (d.getVar('PACKAGEBUILDPKGD') or '').split():
         bb.build.exec_func(f, d)
 
     ###########################################################################
@@ -2081,7 +2115,7 @@
 
     cpath = oe.cachedpath.CachedPath()
 
-    for f in (d.getVar('PACKAGESPLITFUNCS', True) or '').split():
+    for f in (d.getVar('PACKAGESPLITFUNCS') or '').split():
         bb.build.exec_func(f, d)
 
     ###########################################################################
@@ -2091,18 +2125,18 @@
     # Build global list of files in each split package
     global pkgfiles
     pkgfiles = {}
-    packages = d.getVar('PACKAGES', True).split()
-    pkgdest = d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES').split()
+    pkgdest = d.getVar('PKGDEST')
     for pkg in packages:
         pkgfiles[pkg] = []
         for walkroot, dirs, files in cpath.walk(pkgdest + "/" + pkg):
             for file in files:
                 pkgfiles[pkg].append(walkroot + os.sep + file)
 
-    for f in (d.getVar('PACKAGEFUNCS', True) or '').split():
+    for f in (d.getVar('PACKAGEFUNCS') or '').split():
         bb.build.exec_func(f, d)
 
-    qa_sane = d.getVar("QA_SANE", True)
+    qa_sane = d.getVar("QA_SANE")
     if not qa_sane:
         bb.fatal("Fatal QA errors found, failing task.")
 }
@@ -2149,7 +2183,7 @@
     Rewrite variables to account for package renaming in things
     like debian.bbclass or manual PKG variable name changes
     """
-    pkg = d.getVar("PKG", True)
+    pkg = d.getVar("PKG")
     runtime_mapping_rename("RDEPENDS", pkg, d)
     runtime_mapping_rename("RRECOMMENDS", pkg, d)
     runtime_mapping_rename("RSUGGESTS", pkg, d)
diff --git a/import-layers/yocto-poky/meta/classes/package_deb.bbclass b/import-layers/yocto-poky/meta/classes/package_deb.bbclass
index fb6034c..eacabcd 100644
--- a/import-layers/yocto-poky/meta/classes/package_deb.bbclass
+++ b/import-layers/yocto-poky/meta/classes/package_deb.bbclass
@@ -6,17 +6,19 @@
 
 IMAGE_PKGTYPE ?= "deb"
 
-DPKG_ARCH ?= "${@debian_arch_map(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEATURES', True))}"
+DPKG_ARCH ?= "${@debian_arch_map(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'))}"
 DPKG_ARCH[vardepvalue] = "${DPKG_ARCH}"
 
 PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
 
 APTCONF_TARGET = "${WORKDIR}"
 
-APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
+APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
 
 def debian_arch_map(arch, tune):
     tune_features = tune.split()
+    if arch == "allarch":
+        return "all"
     if arch in ["i586", "i686"]:
         return "i386"
     if arch == "x86_64":
@@ -53,25 +55,26 @@
     import textwrap
     import subprocess
     import collections
+    import codecs
 
     oldcwd = os.getcwd()
 
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
     if not workdir:
         bb.error("WORKDIR not defined, unable to package")
         return
 
-    outdir = d.getVar('PKGWRITEDIRDEB', True)
+    outdir = d.getVar('PKGWRITEDIRDEB')
     if not outdir:
         bb.error("PKGWRITEDIRDEB not defined, unable to package")
         return
 
-    packages = d.getVar('PACKAGES', True)
+    packages = d.getVar('PACKAGES')
     if not packages:
         bb.debug(1, "PACKAGES not defined, nothing to package")
         return
 
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
 
     if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK):
         os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"))
@@ -80,7 +83,7 @@
         bb.debug(1, "No packages; nothing to do")
         return
 
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
 
     def cleanupcontrol(root):
         for p in ['CONTROL', 'DEBIAN']:
@@ -96,17 +99,16 @@
 
         localdata.setVar('ROOT', '')
         localdata.setVar('ROOT_%s' % pkg, root)
-        pkgname = localdata.getVar('PKG_%s' % pkg, True)
+        pkgname = localdata.getVar('PKG_%s' % pkg)
         if not pkgname:
             pkgname = pkg
         localdata.setVar('PKG', pkgname)
 
         localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
 
-        bb.data.update_data(localdata)
         basedir = os.path.join(os.path.dirname(root))
 
-        pkgoutdir = os.path.join(outdir, localdata.getVar('PACKAGE_ARCH', True))
+        pkgoutdir = os.path.join(outdir, localdata.getVar('PACKAGE_ARCH'))
         bb.utils.mkdirhier(pkgoutdir)
 
         os.chdir(root)
@@ -114,22 +116,18 @@
         from glob import glob
         g = glob('*')
         if not g and localdata.getVar('ALLOW_EMPTY', False) != "1":
-            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True)))
+            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR')))
             bb.utils.unlockfile(lf)
             continue
 
         controldir = os.path.join(root, 'DEBIAN')
         bb.utils.mkdirhier(controldir)
         os.chmod(controldir, 0o755)
-        try:
-            import codecs
-            ctrlfile = codecs.open(os.path.join(controldir, 'control'), 'w', 'utf-8')
-        except OSError:
-            bb.utils.unlockfile(lf)
-            bb.fatal("unable to open control file for writing")
+
+        ctrlfile = codecs.open(os.path.join(controldir, 'control'), 'w', 'utf-8')
 
         fields = []
-        pe = d.getVar('PKGE', True)
+        pe = d.getVar('PKGE')
         if pe and int(pe) > 0:
             fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
         else:
@@ -141,7 +139,7 @@
         fields.append(["Architecture: %s\n", ['DPKG_ARCH']])
         fields.append(["OE: %s\n", ['PN']])
         fields.append(["PackageArch: %s\n", ['PACKAGE_ARCH']])
-        if d.getVar('HOMEPAGE', True):
+        if d.getVar('HOMEPAGE'):
             fields.append(["Homepage: %s\n", ['HOMEPAGE']])
 
         # Package, Version, Maintainer, Description - mandatory
@@ -151,10 +149,10 @@
         def pullData(l, d):
             l2 = []
             for i in l:
-                data = d.getVar(i, True)
+                data = d.getVar(i)
                 if data is None:
-                    raise KeyError(f)
-                if i == 'DPKG_ARCH' and d.getVar('PACKAGE_ARCH', True) == 'all':
+                    raise KeyError(i)
+                if i == 'DPKG_ARCH' and d.getVar('PACKAGE_ARCH') == 'all':
                     data = 'all'
                 elif i == 'PACKAGE_ARCH' or i == 'DPKG_ARCH':
                    # The params in deb package control don't allow character
@@ -165,44 +163,31 @@
             return l2
 
         ctrlfile.write("Package: %s\n" % pkgname)
-        if d.getVar('PACKAGE_ARCH', True) == "all":
+        if d.getVar('PACKAGE_ARCH') == "all":
             ctrlfile.write("Multi-Arch: foreign\n")
         # check for required fields
-        try:
-            for (c, fs) in fields:
-                for f in fs:
-                     if localdata.getVar(f, False) is None:
-                         raise KeyError(f)
-                # Special behavior for description...
-                if 'DESCRIPTION' in fs:
-                     summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "."
-                     ctrlfile.write('Description: %s\n' % summary)
-                     description = localdata.getVar('DESCRIPTION', True) or "."
-                     description = textwrap.dedent(description).strip()
-                     if '\\n' in description:
-                         # Manually indent
-                         for t in description.split('\\n'):
-                             # We don't limit the width when manually indent, but we do
-                             # need the textwrap.fill() to set the initial_indent and
-                             # subsequent_indent, so set a large width
-                             ctrlfile.write('%s\n' % textwrap.fill(t, width=100000, initial_indent=' ', subsequent_indent=' '))
-                     else:
-                         # Auto indent
-                         ctrlfile.write('%s\n' % textwrap.fill(description.strip(), width=74, initial_indent=' ', subsequent_indent=' '))
+        for (c, fs) in fields:
+            # Special behavior for description...
+            if 'DESCRIPTION' in fs:
+                 summary = localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or "."
+                 ctrlfile.write('Description: %s\n' % summary)
+                 description = localdata.getVar('DESCRIPTION') or "."
+                 description = textwrap.dedent(description).strip()
+                 if '\\n' in description:
+                     # Manually indent
+                     for t in description.split('\\n'):
+                         ctrlfile.write(' %s\n' % (t.strip() or '.'))
+                 else:
+                     # Auto indent
+                     ctrlfile.write('%s\n' % textwrap.fill(description.strip(), width=74, initial_indent=' ', subsequent_indent=' '))
 
-                else:
-                     ctrlfile.write(c % tuple(pullData(fs, localdata)))
-        except KeyError:
-            import sys
-            (type, value, traceback) = sys.exc_info()
-            bb.utils.unlockfile(lf)
-            ctrlfile.close()
-            bb.fatal("Missing field for deb generation: %s" % value)
+            else:
+                 ctrlfile.write(c % tuple(pullData(fs, localdata)))
 
         # more fields
 
         custom_fields_chunk = get_package_additional_metadata("deb", localdata)
-        if custom_fields_chunk is not None:
+        if custom_fields_chunk:
             ctrlfile.write(custom_fields_chunk)
             ctrlfile.write("\n")
 
@@ -231,7 +216,7 @@
                     elif (v or "").startswith("> "):
                         var[dep][i] = var[dep][i].replace("> ", ">> ")
 
-        rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS", True) or "")
+        rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") or "")
         debian_cmp_remap(rdepends)
         for dep in list(rdepends.keys()):
                 if dep == pkg:
@@ -239,20 +224,24 @@
                         continue
                 if '*' in dep:
                         del rdepends[dep]
-        rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "")
+        rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS") or "")
         debian_cmp_remap(rrecommends)
         for dep in list(rrecommends.keys()):
                 if '*' in dep:
                         del rrecommends[dep]
-        rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS", True) or "")
+        rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS") or "")
         debian_cmp_remap(rsuggests)
         # Deliberately drop version information here, not wanted/supported by deb
-        rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES", True) or ""), [])
+        rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES") or ""), [])
+        # Remove file paths if any from rprovides, debian does not support custom providers
+        for key in list(rprovides.keys()):
+            if key.startswith('/'):
+                del rprovides[key]
         rprovides = collections.OrderedDict(sorted(rprovides.items(), key=lambda x: x[0]))
         debian_cmp_remap(rprovides)
-        rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES", True) or "")
+        rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES") or "")
         debian_cmp_remap(rreplaces)
-        rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
+        rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS") or "")
         debian_cmp_remap(rconflicts)
         if rdepends:
             ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
@@ -269,15 +258,11 @@
         ctrlfile.close()
 
         for script in ["preinst", "postinst", "prerm", "postrm"]:
-            scriptvar = localdata.getVar('pkg_%s' % script, True)
+            scriptvar = localdata.getVar('pkg_%s' % script)
             if not scriptvar:
                 continue
             scriptvar = scriptvar.strip()
-            try:
-                scriptfile = open(os.path.join(controldir, script), 'w')
-            except OSError:
-                bb.utils.unlockfile(lf)
-                bb.fatal("unable to open %s script file for writing" % script)
+            scriptfile = open(os.path.join(controldir, script), 'w')
 
             if scriptvar.startswith("#!"):
                 pos = scriptvar.find("\n") + 1
@@ -297,21 +282,14 @@
 
         conffiles_str = ' '.join(get_conffiles(pkg, d))
         if conffiles_str:
-            try:
-                conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
-            except OSError:
-                bb.utils.unlockfile(lf)
-                bb.fatal("unable to open conffiles for writing")
+            conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
             for f in conffiles_str.split():
                 if os.path.exists(oe.path.join(root, f)):
                     conffiles.write('%s\n' % f)
             conffiles.close()
 
         os.chdir(basedir)
-        ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True)
-        if ret != 0:
-            bb.utils.unlockfile(lf)
-            bb.fatal("dpkg-deb execution failed")
+        subprocess.check_output("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH"), root, pkgoutdir), shell=True)
 
         cleanupcontrol(root)
         bb.utils.unlockfile(lf)
@@ -328,7 +306,7 @@
 do_package_write_deb[sstate-outputdirs] = "${DEPLOY_DIR_DEB}"
 
 python do_package_write_deb_setscene () {
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
 
     if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK):
         os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"))
@@ -338,7 +316,7 @@
 addtask do_package_write_deb_setscene
 
 python () {
-    if d.getVar('PACKAGES', True) != '':
+    if d.getVar('PACKAGES') != '':
         deps = ' dpkg-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
         d.appendVarFlag('do_package_write_deb', 'depends', deps)
         d.setVarFlag('do_package_write_deb', 'fakeroot', "1")
@@ -351,6 +329,7 @@
 do_package_write_deb[dirs] = "${PKGWRITEDIRDEB}"
 do_package_write_deb[cleandirs] = "${PKGWRITEDIRDEB}"
 do_package_write_deb[umask] = "022"
+do_package_write_deb[depends] += "${@oe.utils.build_depends_string(d.getVar('PACKAGE_WRITE_DEPS'), 'do_populate_sysroot')}"
 addtask package_write_deb after do_packagedata do_package
 
 
diff --git a/import-layers/yocto-poky/meta/classes/package_ipk.bbclass b/import-layers/yocto-poky/meta/classes/package_ipk.bbclass
index e7e7d49..a1e51ee 100644
--- a/import-layers/yocto-poky/meta/classes/package_ipk.bbclass
+++ b/import-layers/yocto-poky/meta/classes/package_ipk.bbclass
@@ -11,8 +11,8 @@
 OPKGBUILDCMD ??= "opkg-build"
 
 OPKG_ARGS += "--force_postinstall --prefer-arch-to-version"
-OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
-OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE', True) or "").split())][(d.getVar("PACKAGE_EXCLUDE", True) or "") != ""]}"
+OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
+OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "") != ""]}"
 
 OPKGLIBDIR = "${localstatedir}/lib"
 
@@ -24,15 +24,15 @@
 
     oldcwd = os.getcwd()
 
-    workdir = d.getVar('WORKDIR', True)
-    outdir = d.getVar('PKGWRITEDIRIPK', True)
-    tmpdir = d.getVar('TMPDIR', True)
-    pkgdest = d.getVar('PKGDEST', True)
+    workdir = d.getVar('WORKDIR')
+    outdir = d.getVar('PKGWRITEDIRIPK')
+    tmpdir = d.getVar('TMPDIR')
+    pkgdest = d.getVar('PKGDEST')
     if not workdir or not outdir or not tmpdir:
         bb.error("Variables incorrectly set, unable to package")
         return
 
-    packages = d.getVar('PACKAGES', True)
+    packages = d.getVar('PACKAGES')
     if not packages or packages == '':
         bb.debug(1, "No packages; nothing to do")
         return
@@ -48,7 +48,7 @@
             if os.path.exists(p):
                 bb.utils.prunedir(p)
 
-    recipesource = os.path.basename(d.getVar('FILE', True))
+    recipesource = os.path.basename(d.getVar('FILE'))
 
     for pkg in packages.split():
         localdata = bb.data.createCopy(d)
@@ -58,16 +58,15 @@
 
         localdata.setVar('ROOT', '')
         localdata.setVar('ROOT_%s' % pkg, root)
-        pkgname = localdata.getVar('PKG_%s' % pkg, True)
+        pkgname = localdata.getVar('PKG_%s' % pkg)
         if not pkgname:
             pkgname = pkg
         localdata.setVar('PKG', pkgname)
 
         localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
 
-        bb.data.update_data(localdata)
         basedir = os.path.join(os.path.dirname(root))
-        arch = localdata.getVar('PACKAGE_ARCH', True)
+        arch = localdata.getVar('PACKAGE_ARCH')
 
         if localdata.getVar('IPK_HIERARCHICAL_FEED', False) == "1":
             # Spread packages across subdirectories so each isn't too crowded
@@ -100,20 +99,16 @@
         from glob import glob
         g = glob('*')
         if not g and localdata.getVar('ALLOW_EMPTY', False) != "1":
-            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True)))
+            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR')))
             bb.utils.unlockfile(lf)
             continue
 
         controldir = os.path.join(root, 'CONTROL')
         bb.utils.mkdirhier(controldir)
-        try:
-            ctrlfile = open(os.path.join(controldir, 'control'), 'w')
-        except OSError:
-            bb.utils.unlockfile(lf)
-            bb.fatal("unable to open control file for writing")
+        ctrlfile = open(os.path.join(controldir, 'control'), 'w')
 
         fields = []
-        pe = d.getVar('PKGE', True)
+        pe = d.getVar('PKGE')
         if pe and int(pe) > 0:
             fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
         else:
@@ -125,46 +120,43 @@
         fields.append(["License: %s\n", ['LICENSE']])
         fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']])
         fields.append(["OE: %s\n", ['PN']])
-        if d.getVar('HOMEPAGE', True):
+        if d.getVar('HOMEPAGE'):
             fields.append(["Homepage: %s\n", ['HOMEPAGE']])
 
         def pullData(l, d):
             l2 = []
             for i in l:
-                l2.append(d.getVar(i, True))
+                l2.append(d.getVar(i))
             return l2
 
         ctrlfile.write("Package: %s\n" % pkgname)
         # check for required fields
-        try:
-            for (c, fs) in fields:
-                for f in fs:
-                    if localdata.getVar(f, False) is None:
-                        raise KeyError(f)
-                # Special behavior for description...
-                if 'DESCRIPTION' in fs:
-                    summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "."
-                    ctrlfile.write('Description: %s\n' % summary)
-                    description = localdata.getVar('DESCRIPTION', True) or "."
-                    description = textwrap.dedent(description).strip()
-                    if '\\n' in description:
-                        # Manually indent
-                        for t in description.split('\\n'):
-                            # We don't limit the width when manually indent, but we do
-                            # need the textwrap.fill() to set the initial_indent and
-                            # subsequent_indent, so set a large width
-                            ctrlfile.write('%s\n' % textwrap.fill(t.strip(), width=100000, initial_indent=' ', subsequent_indent=' '))
-                    else:
-                        # Auto indent
-                        ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))
+        for (c, fs) in fields:
+            for f in fs:
+                if localdata.getVar(f, False) is None:
+                    raise KeyError(f)
+            # Special behavior for description...
+            if 'DESCRIPTION' in fs:
+                summary = localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or "."
+                ctrlfile.write('Description: %s\n' % summary)
+                description = localdata.getVar('DESCRIPTION') or "."
+                description = textwrap.dedent(description).strip()
+                if '\\n' in description:
+                    # Manually indent
+                    for t in description.split('\\n'):
+                        # We don't limit the width when manually indent, but we do
+                        # need the textwrap.fill() to set the initial_indent and
+                        # subsequent_indent, so set a large width
+                        line = textwrap.fill(t.strip(),
+                                             width=100000,
+                                             initial_indent=' ',
+                                             subsequent_indent=' ') or '.'
+                        ctrlfile.write('%s\n' % line)
                 else:
-                    ctrlfile.write(c % tuple(pullData(fs, localdata)))
-        except KeyError:
-            import sys
-            (type, value, traceback) = sys.exc_info()
-            ctrlfile.close()
-            bb.utils.unlockfile(lf)
-            bb.fatal("Missing field for ipk generation: %s" % value)
+                    # Auto indent
+                    ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))
+            else:
+                ctrlfile.write(c % tuple(pullData(fs, localdata)))
         # more fields
 
         custom_fields_chunk = get_package_additional_metadata("ipk", localdata)
@@ -187,19 +179,19 @@
                     elif (v or "").startswith("> "):
                         var[dep][i] = var[dep][i].replace("> ", ">> ")
 
-        rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS", True) or "")
+        rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") or "")
         debian_cmp_remap(rdepends)
-        rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "")
+        rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS") or "")
         debian_cmp_remap(rrecommends)
-        rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS", True) or "")
+        rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS") or "")
         debian_cmp_remap(rsuggests)
         # Deliberately drop version information here, not wanted/supported by ipk
-        rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES", True) or ""), [])
+        rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES") or ""), [])
         rprovides = collections.OrderedDict(sorted(rprovides.items(), key=lambda x: x[0]))
         debian_cmp_remap(rprovides)
-        rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES", True) or "")
+        rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES") or "")
         debian_cmp_remap(rreplaces)
-        rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
+        rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS") or "")
         debian_cmp_remap(rconflicts)
 
         if rdepends:
@@ -218,40 +210,29 @@
         ctrlfile.close()
 
         for script in ["preinst", "postinst", "prerm", "postrm"]:
-            scriptvar = localdata.getVar('pkg_%s' % script, True)
+            scriptvar = localdata.getVar('pkg_%s' % script)
             if not scriptvar:
                 continue
-            try:
-                scriptfile = open(os.path.join(controldir, script), 'w')
-            except OSError:
-                bb.utils.unlockfile(lf)
-                bb.fatal("unable to open %s script file for writing" % script)
+            scriptfile = open(os.path.join(controldir, script), 'w')
             scriptfile.write(scriptvar)
             scriptfile.close()
             os.chmod(os.path.join(controldir, script), 0o755)
 
         conffiles_str = ' '.join(get_conffiles(pkg, d))
         if conffiles_str:
-            try:
-                conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
-            except OSError:
-                bb.utils.unlockfile(lf)
-                bb.fatal("unable to open conffiles for writing")
+            conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
             for f in conffiles_str.split():
                 if os.path.exists(oe.path.join(root, f)):
                     conffiles.write('%s\n' % f)
             conffiles.close()
 
         os.chdir(basedir)
-        ret = subprocess.call("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH", True),
-                                                          d.getVar("OPKGBUILDCMD", True), pkg, pkgoutdir), shell=True)
-        if ret != 0:
-            bb.utils.unlockfile(lf)
-            bb.fatal("opkg-build execution failed")
+        subprocess.check_output("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH"),
+                                                          d.getVar("OPKGBUILDCMD"), pkg, pkgoutdir), shell=True)
 
-        if d.getVar('IPK_SIGN_PACKAGES', True) == '1':
-            ipkver = "%s-%s" % (d.getVar('PKGV', True), d.getVar('PKGR', True))
-            ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, d.getVar('PACKAGE_ARCH', True))
+        if d.getVar('IPK_SIGN_PACKAGES') == '1':
+            ipkver = "%s-%s" % (d.getVar('PKGV'), d.getVar('PKGR'))
+            ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, d.getVar('PACKAGE_ARCH'))
             sign_ipk(d, ipk_to_sign)
 
         cleanupcontrol(root)
@@ -267,7 +248,7 @@
 do_package_write_ipk[sstate-outputdirs] = "${DEPLOY_DIR_IPK}"
 
 python do_package_write_ipk_setscene () {
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
 
     if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
         os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
@@ -277,7 +258,7 @@
 addtask do_package_write_ipk_setscene
 
 python () {
-    if d.getVar('PACKAGES', True) != '':
+    if d.getVar('PACKAGES') != '':
         deps = ' opkg-utils-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
         d.appendVarFlag('do_package_write_ipk', 'depends', deps)
         d.setVarFlag('do_package_write_ipk', 'fakeroot', "1")
@@ -290,6 +271,7 @@
 do_package_write_ipk[dirs] = "${PKGWRITEDIRIPK}"
 do_package_write_ipk[cleandirs] = "${PKGWRITEDIRIPK}"
 do_package_write_ipk[umask] = "022"
+do_package_write_ipk[depends] += "${@oe.utils.build_depends_string(d.getVar('PACKAGE_WRITE_DEPS'), 'do_populate_sysroot')}"
 addtask package_write_ipk after do_packagedata do_package
 
 PACKAGEINDEXDEPS += "opkg-utils-native:do_populate_sysroot"
diff --git a/import-layers/yocto-poky/meta/classes/package_rpm.bbclass b/import-layers/yocto-poky/meta/classes/package_rpm.bbclass
index c431545..1deaf83 100644
--- a/import-layers/yocto-poky/meta/classes/package_rpm.bbclass
+++ b/import-layers/yocto-poky/meta/classes/package_rpm.bbclass
@@ -7,15 +7,33 @@
 
 PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms"
 
-# Maintaining the perfile dependencies has singificant overhead when writing the 
+# Maintaining the perfile dependencies has singificant overhead when writing the
 # packages. When set, this value merges them for efficiency.
 MERGEPERFILEDEPS = "1"
 
+# Filter dependencies based on a provided function.
+def filter_deps(var, f):
+    import collections
+
+    depends_dict = bb.utils.explode_dep_versions2(var)
+    newdeps_dict = collections.OrderedDict()
+    for dep in depends_dict:
+        if f(dep):
+            newdeps_dict[dep] = depends_dict[dep]
+    return bb.utils.join_deps(newdeps_dict, commasep=False)
+
+# Filter out absolute paths (typically /bin/sh and /usr/bin/env) and any perl
+# dependencies for nativesdk packages.
+def filter_nativesdk_deps(srcname, var):
+    if var and srcname.startswith("nativesdk-"):
+        var = filter_deps(var, lambda dep: not dep.startswith('/') and dep != 'perl' and not dep.startswith('perl('))
+    return var
+
 # Construct per file dependencies file
 def write_rpm_perfiledata(srcname, d):
-    workdir = d.getVar('WORKDIR', True)
-    packages = d.getVar('PACKAGES', True)
-    pkgd = d.getVar('PKGD', True)
+    workdir = d.getVar('WORKDIR')
+    packages = d.getVar('PACKAGES')
+    pkgd = d.getVar('PKGD')
 
     def dump_filerdeps(varname, outfile, d):
         outfile.write("#!/usr/bin/env python\n\n")
@@ -23,10 +41,11 @@
         outfile.write('deps = {\n')
         for pkg in packages.split():
             dependsflist_key = 'FILE' + varname + 'FLIST' + "_" + pkg
-            dependsflist = (d.getVar(dependsflist_key, True) or "")
+            dependsflist = (d.getVar(dependsflist_key) or "")
             for dfile in dependsflist.split():
                 key = "FILE" + varname + "_" + dfile + "_" + pkg
-                depends_dict = bb.utils.explode_dep_versions(d.getVar(key, True) or "")
+                deps = filter_nativesdk_deps(srcname, d.getVar(key) or "")
+                depends_dict = bb.utils.explode_dep_versions(deps)
                 file = dfile.replace("@underscore@", "_")
                 file = file.replace("@closebrace@", "]")
                 file = file.replace("@openbrace@", "[")
@@ -55,10 +74,7 @@
     # OE-core dependencies a.k.a. RPM requires
     outdepends = workdir + "/" + srcname + ".requires"
 
-    try:
-        dependsfile = open(outdepends, 'w')
-    except OSError:
-        bb.fatal("unable to open spec file for writing")
+    dependsfile = open(outdepends, 'w')
 
     dump_filerdeps('RDEPENDS', dependsfile, d)
 
@@ -68,10 +84,7 @@
     # OE-core / RPM Provides
     outprovides = workdir + "/" + srcname + ".provides"
 
-    try:
-        providesfile = open(outprovides, 'w')
-    except OSError:
-        bb.fatal("unable to open spec file for writing")
+    providesfile = open(outprovides, 'w')
 
     dump_filerdeps('RPROVIDES', providesfile, d)
 
@@ -86,15 +99,15 @@
 
     # append information for logs and patches to %prep
     def add_prep(d,spec_files_bottom):
-        if d.getVarFlag('ARCHIVER_MODE', 'srpm', True) == '1' and bb.data.inherits_class('archiver', d):
-            spec_files_bottom.append('%%prep -n %s' % d.getVar('PN', True) )
+        if d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and bb.data.inherits_class('archiver', d):
+            spec_files_bottom.append('%%prep -n %s' % d.getVar('PN') )
             spec_files_bottom.append('%s' % "echo \"include logs and patches, Please check them in SOURCES\"")
             spec_files_bottom.append('')
 
     # append the name of tarball to key word 'SOURCE' in xxx.spec.
     def tail_source(d):
-        if d.getVarFlag('ARCHIVER_MODE', 'srpm', True) == '1' and bb.data.inherits_class('archiver', d):
-            ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+        if d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and bb.data.inherits_class('archiver', d):
+            ar_outdir = d.getVar('ARCHIVER_OUTDIR')
             if not os.path.exists(ar_outdir):
                 return
             source_list = os.listdir(ar_outdir)
@@ -107,27 +120,6 @@
                 os.chown(f, 0, 0)
                 spec_preamble_top.append('Source%s: %s' % (source_number, source))
                 source_number += 1
-    # We need a simple way to remove the MLPREFIX from the package name,
-    # and dependency information...
-    def strip_multilib(name, d):
-        multilibs = d.getVar('MULTILIBS', True) or ""
-        for ext in multilibs.split():
-            eext = ext.split(':')
-            if len(eext) > 1 and eext[0] == 'multilib' and name and name.find(eext[1] + '-') >= 0:
-                name = "".join(name.split(eext[1] + '-'))
-        return name
-
-    def strip_multilib_deps(deps, d):
-        depends = bb.utils.explode_dep_versions2(deps or "")
-        newdeps = {}
-        for dep in depends:
-            newdeps[strip_multilib(dep, d)] = depends[dep]
-        return bb.utils.join_deps(newdeps)
-
-#        ml = d.getVar("MLPREFIX", True)
-#        if ml and name and len(ml) != 0 and name.find(ml) == 0:
-#            return ml.join(name.split(ml, 1)[1:])
-#        return name
 
     # In RPM, dependencies are of the format: pkg <>= Epoch:Version-Release
     # This format is similar to OE, however there are restrictions on the
@@ -144,7 +136,7 @@
     # after renaming we cannot look up the dependencies in the packagedata
     # store.
     def translate_vers(varname, d):
-        depends = d.getVar(varname, True)
+        depends = d.getVar(varname)
         if depends:
             depends_dict = bb.utils.explode_dep_versions2(depends)
             newdeps_dict = {}
@@ -197,6 +189,8 @@
             if path.endswith("DEBIAN") or path.endswith("CONTROL"):
                 continue
             path = path.replace("%", "%%%%%%%%")
+            path = path.replace("[", "?")
+            path = path.replace("]", "?")
 
             # Treat all symlinks to directories as normal files.
             # os.walk() lists them as directories.
@@ -216,6 +210,8 @@
                     if dir == "CONTROL" or dir == "DEBIAN":
                         continue
                     dir = dir.replace("%", "%%%%%%%%")
+                    dir = dir.replace("[", "?")
+                    dir = dir.replace("]", "?")
                     # All packages own the directories their files are in...
                     target.append('%dir "' + path + '/' + dir + '"')
             else:
@@ -230,6 +226,8 @@
                 if file == "CONTROL" or file == "DEBIAN":
                     continue
                 file = file.replace("%", "%%%%%%%%")
+                file = file.replace("[", "?")
+                file = file.replace("]", "?")
                 if conffiles.count(path + '/' + file):
                     target.append('%config "' + path + '/' + file + '"')
                 else:
@@ -248,10 +246,10 @@
     def get_perfile(varname, pkg, d):
         deps = []
         dependsflist_key = 'FILE' + varname + 'FLIST' + "_" + pkg
-        dependsflist = (d.getVar(dependsflist_key, True) or "")
+        dependsflist = (d.getVar(dependsflist_key) or "")
         for dfile in dependsflist.split():
             key = "FILE" + varname + "_" + dfile + "_" + pkg
-            depends = d.getVar(key, True)
+            depends = d.getVar(key)
             if depends:
                 deps.append(depends)
         return " ".join(deps)
@@ -269,33 +267,33 @@
         else:
             spec_preamble.append('%s' % textwrap.fill(dedent_text, width=75))
 
-    packages = d.getVar('PACKAGES', True)
+    packages = d.getVar('PACKAGES')
     if not packages or packages == '':
         bb.debug(1, "No packages; nothing to do")
         return
 
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
     if not pkgdest:
         bb.fatal("No PKGDEST")
 
-    outspecfile = d.getVar('OUTSPECFILE', True)
+    outspecfile = d.getVar('OUTSPECFILE')
     if not outspecfile:
         bb.fatal("No OUTSPECFILE")
 
     # Construct the SPEC file...
-    srcname    = strip_multilib(d.getVar('PN', True), d)
-    srcsummary = (d.getVar('SUMMARY', True) or d.getVar('DESCRIPTION', True) or ".")
-    srcversion = d.getVar('PKGV', True).replace('-', '+')
-    srcrelease = d.getVar('PKGR', True)
-    srcepoch   = (d.getVar('PKGE', True) or "")
-    srclicense = d.getVar('LICENSE', True)
-    srcsection = d.getVar('SECTION', True)
-    srcmaintainer  = d.getVar('MAINTAINER', True)
-    srchomepage    = d.getVar('HOMEPAGE', True)
-    srcdescription = d.getVar('DESCRIPTION', True) or "."
+    srcname    = d.getVar('PN')
+    srcsummary = (d.getVar('SUMMARY') or d.getVar('DESCRIPTION') or ".")
+    srcversion = d.getVar('PKGV').replace('-', '+')
+    srcrelease = d.getVar('PKGR')
+    srcepoch   = (d.getVar('PKGE') or "")
+    srclicense = d.getVar('LICENSE')
+    srcsection = d.getVar('SECTION')
+    srcmaintainer  = d.getVar('MAINTAINER')
+    srchomepage    = d.getVar('HOMEPAGE')
+    srcdescription = d.getVar('DESCRIPTION') or "."
     srccustomtagschunk = get_package_additional_metadata("rpm", d)
 
-    srcdepends     = strip_multilib_deps(d.getVar('DEPENDS', True), d)
+    srcdepends     = d.getVar('DEPENDS')
     srcrdepends    = []
     srcrrecommends = []
     srcrsuggests   = []
@@ -318,8 +316,8 @@
     spec_files_top = []
     spec_files_bottom = []
 
-    perfiledeps = (d.getVar("MERGEPERFILEDEPS", True) or "0") == "0"
-    extra_pkgdata = (d.getVar("RPM_EXTRA_PKGDATA", True) or "0") == "1"
+    perfiledeps = (d.getVar("MERGEPERFILEDEPS") or "0") == "0"
+    extra_pkgdata = (d.getVar("RPM_EXTRA_PKGDATA") or "0") == "1"
 
     for pkg in packages.split():
         localdata = bb.data.createCopy(d)
@@ -328,29 +326,27 @@
 
         localdata.setVar('ROOT', '')
         localdata.setVar('ROOT_%s' % pkg, root)
-        pkgname = localdata.getVar('PKG_%s' % pkg, True)
+        pkgname = localdata.getVar('PKG_%s' % pkg)
         if not pkgname:
             pkgname = pkg
         localdata.setVar('PKG', pkgname)
 
         localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
 
-        bb.data.update_data(localdata)
-
         conffiles = get_conffiles(pkg, d)
-        dirfiles = localdata.getVar('DIRFILES', True)
+        dirfiles = localdata.getVar('DIRFILES')
         if dirfiles is not None:
             dirfiles = dirfiles.split()
 
-        splitname    = strip_multilib(pkgname, d)
+        splitname    = pkgname
 
-        splitsummary = (localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or ".")
-        splitversion = (localdata.getVar('PKGV', True) or "").replace('-', '+')
-        splitrelease = (localdata.getVar('PKGR', True) or "")
-        splitepoch   = (localdata.getVar('PKGE', True) or "")
-        splitlicense = (localdata.getVar('LICENSE', True) or "")
-        splitsection = (localdata.getVar('SECTION', True) or "")
-        splitdescription = (localdata.getVar('DESCRIPTION', True) or ".")
+        splitsummary = (localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or ".")
+        splitversion = (localdata.getVar('PKGV') or "").replace('-', '+')
+        splitrelease = (localdata.getVar('PKGR') or "")
+        splitepoch   = (localdata.getVar('PKGE') or "")
+        splitlicense = (localdata.getVar('LICENSE') or "")
+        splitsection = (localdata.getVar('SECTION') or "")
+        splitdescription = (localdata.getVar('DESCRIPTION') or ".")
         splitcustomtagschunk = get_package_additional_metadata("rpm", localdata)
 
         translate_vers('RDEPENDS', localdata)
@@ -363,18 +359,18 @@
         # Map the dependencies into their final form
         mapping_rename_hook(localdata)
 
-        splitrdepends    = strip_multilib_deps(localdata.getVar('RDEPENDS', True), d)
-        splitrrecommends = strip_multilib_deps(localdata.getVar('RRECOMMENDS', True), d)
-        splitrsuggests   = strip_multilib_deps(localdata.getVar('RSUGGESTS', True), d)
-        splitrprovides   = strip_multilib_deps(localdata.getVar('RPROVIDES', True), d)
-        splitrreplaces   = strip_multilib_deps(localdata.getVar('RREPLACES', True), d)
-        splitrconflicts  = strip_multilib_deps(localdata.getVar('RCONFLICTS', True), d)
+        splitrdepends    = localdata.getVar('RDEPENDS')
+        splitrrecommends = localdata.getVar('RRECOMMENDS')
+        splitrsuggests   = localdata.getVar('RSUGGESTS')
+        splitrprovides   = localdata.getVar('RPROVIDES')
+        splitrreplaces   = localdata.getVar('RREPLACES')
+        splitrconflicts  = localdata.getVar('RCONFLICTS')
         splitrobsoletes  = []
 
-        splitrpreinst  = localdata.getVar('pkg_preinst', True)
-        splitrpostinst = localdata.getVar('pkg_postinst', True)
-        splitrprerm    = localdata.getVar('pkg_prerm', True)
-        splitrpostrm   = localdata.getVar('pkg_postrm', True)
+        splitrpreinst  = localdata.getVar('pkg_preinst')
+        splitrpostinst = localdata.getVar('pkg_postinst')
+        splitrprerm    = localdata.getVar('pkg_prerm')
+        splitrpostrm   = localdata.getVar('pkg_postrm')
 
 
         if not perfiledeps:
@@ -382,6 +378,8 @@
             splitrdepends = splitrdepends + " " + get_perfile('RDEPENDS', pkg, d)
             splitrprovides = splitrprovides + " " + get_perfile('RPROVIDES', pkg, d)
 
+        splitrdepends = filter_nativesdk_deps(srcname, splitrdepends)
+
         # Gather special src/first package data
         if srcname == splitname:
             srcrdepends    = splitrdepends
@@ -452,25 +450,10 @@
         if splitrpostrm:
             print_deps(splitrdepends, "Requires(postun)", spec_preamble_bottom, d)
 
-        # Suggests in RPM are like recommends in OE-core!
-        print_deps(splitrrecommends, "Suggests", spec_preamble_bottom, d)
-        # While there is no analog for suggests... (So call them recommends for now)
-        print_deps(splitrsuggests,  "Recommends", spec_preamble_bottom, d)
+        print_deps(splitrrecommends, "Recommends", spec_preamble_bottom, d)
+        print_deps(splitrsuggests,  "Suggests", spec_preamble_bottom, d)
         print_deps(splitrprovides,  "Provides", spec_preamble_bottom, d)
         print_deps(splitrobsoletes, "Obsoletes", spec_preamble_bottom, d)
-
-        # conflicts can not be in a provide!  We will need to filter it.
-        if splitrconflicts:
-            depends_dict = bb.utils.explode_dep_versions2(splitrconflicts)
-            newdeps_dict = {}
-            for dep in depends_dict:
-                if dep not in splitrprovides:
-                    newdeps_dict[dep] = depends_dict[dep]
-            if newdeps_dict:
-                splitrconflicts = bb.utils.join_deps(newdeps_dict)
-            else:
-                splitrconflicts = ""
-
         print_deps(splitrconflicts,  "Conflicts", spec_preamble_bottom, d)
 
         spec_preamble_bottom.append('')
@@ -562,25 +545,10 @@
     if srcrpostrm:
         print_deps(srcrdepends, "Requires(postun)", spec_preamble_top, d)
 
-    # Suggests in RPM are like recommends in OE-core!
-    print_deps(srcrrecommends, "Suggests", spec_preamble_top, d)
-    # While there is no analog for suggests... (So call them recommends for now)
-    print_deps(srcrsuggests, "Recommends", spec_preamble_top, d)
-    print_deps(srcrprovides, "Provides", spec_preamble_top, d)
+    print_deps(srcrrecommends, "Recommends", spec_preamble_top, d)
+    print_deps(srcrsuggests, "Suggests", spec_preamble_top, d)
+    print_deps(srcrprovides + (" /bin/sh" if srcname.startswith("nativesdk-") else ""), "Provides", spec_preamble_top, d)
     print_deps(srcrobsoletes, "Obsoletes", spec_preamble_top, d)
-    
-    # conflicts can not be in a provide!  We will need to filter it.
-    if srcrconflicts:
-        depends_dict = bb.utils.explode_dep_versions2(srcrconflicts)
-        newdeps_dict = {}
-        for dep in depends_dict:
-            if dep not in srcrprovides:
-                newdeps_dict[dep] = depends_dict[dep]
-        if newdeps_dict:
-            srcrconflicts = bb.utils.join_deps(newdeps_dict)
-        else:
-            srcrconflicts = ""
-
     print_deps(srcrconflicts, "Conflicts", spec_preamble_top, d)
 
     spec_preamble_top.append('')
@@ -614,14 +582,11 @@
         spec_scriptlets_top.append('')
 
     # Write the SPEC file
-    try:
-        specfile = open(outspecfile, 'w')
-    except OSError:
-        bb.fatal("unable to open spec file for writing")
+    specfile = open(outspecfile, 'w')
 
     # RPMSPEC_PREAMBLE is a way to add arbitrary text to the top
     # of the generated spec file
-    external_preamble = d.getVar("RPMSPEC_PREAMBLE", True)
+    external_preamble = d.getVar("RPMSPEC_PREAMBLE")
     if external_preamble:
         specfile.write(external_preamble + "\n")
 
@@ -649,23 +614,15 @@
 write_specfile[vardepsexclude] = "OVERRIDES"
 
 python do_package_rpm () {
-    # We need a simple way to remove the MLPREFIX from the package name,
-    # and dependency information...
-    def strip_multilib(name, d):
-        ml = d.getVar("MLPREFIX", True)
-        if ml and name and len(ml) != 0 and name.find(ml) >= 0:
-            return "".join(name.split(ml))
-        return name
-
-    workdir = d.getVar('WORKDIR', True)
-    tmpdir = d.getVar('TMPDIR', True)
-    pkgd = d.getVar('PKGD', True)
-    pkgdest = d.getVar('PKGDEST', True)
+    workdir = d.getVar('WORKDIR')
+    tmpdir = d.getVar('TMPDIR')
+    pkgd = d.getVar('PKGD')
+    pkgdest = d.getVar('PKGDEST')
     if not workdir or not pkgd or not tmpdir:
         bb.error("Variables incorrectly set, unable to package")
         return
 
-    packages = d.getVar('PACKAGES', True)
+    packages = d.getVar('PACKAGES')
     if not packages or packages == '':
         bb.debug(1, "No packages; nothing to do")
         return
@@ -674,42 +631,43 @@
     # If the spec file already exist, and has not been stored into 
     # pseudo's files.db, it maybe cause rpmbuild src.rpm fail,
     # so remove it before doing rpmbuild src.rpm.
-    srcname    = strip_multilib(d.getVar('PN', True), d)
+    srcname    = d.getVar('PN')
     outspecfile = workdir + "/" + srcname + ".spec"
     if os.path.isfile(outspecfile):
         os.remove(outspecfile)
     d.setVar('OUTSPECFILE', outspecfile)
     bb.build.exec_func('write_specfile', d)
 
-    perfiledeps = (d.getVar("MERGEPERFILEDEPS", True) or "0") == "0"
+    perfiledeps = (d.getVar("MERGEPERFILEDEPS") or "0") == "0"
     if perfiledeps:
         outdepends, outprovides = write_rpm_perfiledata(srcname, d)
 
     # Setup the rpmbuild arguments...
-    rpmbuild = d.getVar('RPMBUILD', True)
-    targetsys = d.getVar('TARGET_SYS', True)
-    targetvendor = d.getVar('HOST_VENDOR', True)
-    package_arch = (d.getVar('PACKAGE_ARCH', True) or "").replace("-", "_")
-    sdkpkgsuffix = (d.getVar('SDKPKGSUFFIX', True) or "nativesdk").replace("-", "_")
-    if package_arch not in "all any noarch".split() and not package_arch.endswith(sdkpkgsuffix):
-        ml_prefix = (d.getVar('MLPREFIX', True) or "").replace("-", "_")
-        d.setVar('PACKAGE_ARCH_EXTEND', ml_prefix + package_arch)
-    else:
-        d.setVar('PACKAGE_ARCH_EXTEND', package_arch)
+    rpmbuild = d.getVar('RPMBUILD')
+    targetsys = d.getVar('TARGET_SYS')
+    targetvendor = d.getVar('HOST_VENDOR')
+    # Too many places in dnf stack assume that arch-independent packages are "noarch".
+    # Let's not fight against this.
+    package_arch = (d.getVar('PACKAGE_ARCH') or "").replace("-", "_").replace("all", "noarch")
+    sdkpkgsuffix = (d.getVar('SDKPKGSUFFIX') or "nativesdk").replace("-", "_")
+    d.setVar('PACKAGE_ARCH_EXTEND', package_arch)
     pkgwritedir = d.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH_EXTEND}')
     d.setVar('RPM_PKGWRITEDIR', pkgwritedir)
-    bb.debug(1, 'PKGWRITEDIR: %s' % d.getVar('RPM_PKGWRITEDIR', True))
-    pkgarch = d.expand('${PACKAGE_ARCH_EXTEND}${HOST_VENDOR}-${HOST_OS}')
-    magicfile = d.expand('${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc')
+    bb.debug(1, 'PKGWRITEDIR: %s' % d.getVar('RPM_PKGWRITEDIR'))
+    pkgarch = d.expand('${PACKAGE_ARCH_EXTEND}${HOST_VENDOR}-linux')
     bb.utils.mkdirhier(pkgwritedir)
     os.chmod(pkgwritedir, 0o755)
 
     cmd = rpmbuild
-    cmd = cmd + " --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd
+    cmd = cmd + " --noclean --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd
     cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'"
-    cmd = cmd + " --define '_builddir " + d.getVar('S', True) + "'"
+    cmd = cmd + " --define '_builddir " + d.getVar('S') + "'"
     cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'"
     cmd = cmd + " --define '_use_internal_dependency_generator 0'"
+    cmd = cmd + " --define '_binaries_in_noarch_packages_terminate_build 0'"
+    cmd = cmd + " --define '_build_id_links none'"
+    cmd = cmd + " --define '_binary_payload w6T.xzdio'"
+    cmd = cmd + " --define '_source_payload w6T.xzdio'"
     if perfiledeps:
         cmd = cmd + " --define '__find_requires " + outdepends + "'"
         cmd = cmd + " --define '__find_provides " + outprovides + "'"
@@ -718,11 +676,10 @@
         cmd = cmd + " --define '__find_provides %{nil}'"
     cmd = cmd + " --define '_unpackaged_files_terminate_build 0'"
     cmd = cmd + " --define 'debug_package %{nil}'"
-    cmd = cmd + " --define '_rpmfc_magic_path " + magicfile + "'"
     cmd = cmd + " --define '_tmppath " + workdir + "'"
-    if d.getVarFlag('ARCHIVER_MODE', 'srpm', True) == '1' and bb.data.inherits_class('archiver', d):
-        cmd = cmd + " --define '_sourcedir " + d.getVar('ARCHIVER_OUTDIR', True) + "'"
-        cmdsrpm = cmd + " --define '_srcrpmdir " + d.getVar('ARCHIVER_OUTDIR', True) + "'"
+    if d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and bb.data.inherits_class('archiver', d):
+        cmd = cmd + " --define '_sourcedir " + d.getVar('ARCHIVER_OUTDIR') + "'"
+        cmdsrpm = cmd + " --define '_srcrpmdir " + d.getVar('ARCHIVER_OUTDIR') + "'"
         cmdsrpm = cmdsrpm + " -bs " + outspecfile
         # Build the .src.rpm
         d.setVar('SBUILDSPEC', cmdsrpm + "\n")
@@ -730,17 +687,20 @@
         bb.build.exec_func('SBUILDSPEC', d)
     cmd = cmd + " -bb " + outspecfile
 
+    # rpm 4 creates various empty directories in _topdir, let's clean them up
+    cleanupcmd = "rm -rf %s/BUILDROOT %s/SOURCES %s/SPECS %s/SRPMS" % (workdir, workdir, workdir, workdir)
+
     # Build the rpm package!
-    d.setVar('BUILDSPEC', cmd + "\n")
+    d.setVar('BUILDSPEC', cmd + "\n" + cleanupcmd + "\n")
     d.setVarFlag('BUILDSPEC', 'func', '1')
     bb.build.exec_func('BUILDSPEC', d)
 
-    if d.getVar('RPM_SIGN_PACKAGES', True) == '1':
+    if d.getVar('RPM_SIGN_PACKAGES') == '1':
         bb.build.exec_func("sign_rpm", d)
 }
 
 python () {
-    if d.getVar('PACKAGES', True) != '':
+    if d.getVar('PACKAGES') != '':
         deps = ' rpm-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
         d.appendVarFlag('do_package_write_rpm', 'depends', deps)
         d.setVarFlag('do_package_write_rpm', 'fakeroot', '1')
@@ -766,9 +726,10 @@
 do_package_write_rpm[dirs] = "${PKGWRITEDIRRPM}"
 do_package_write_rpm[cleandirs] = "${PKGWRITEDIRRPM}"
 do_package_write_rpm[umask] = "022"
+do_package_write_rpm[depends] += "${@oe.utils.build_depends_string(d.getVar('PACKAGE_WRITE_DEPS'), 'do_populate_sysroot')}"
 addtask package_write_rpm after do_packagedata do_package
 
 PACKAGEINDEXDEPS += "rpm-native:do_populate_sysroot"
-PACKAGEINDEXDEPS += "createrepo-native:do_populate_sysroot"
+PACKAGEINDEXDEPS += "createrepo-c-native:do_populate_sysroot"
 
 do_build[recrdeptask] += "do_package_write_rpm"
diff --git a/import-layers/yocto-poky/meta/classes/package_tar.bbclass b/import-layers/yocto-poky/meta/classes/package_tar.bbclass
index e217814..ce3ab4c 100644
--- a/import-layers/yocto-poky/meta/classes/package_tar.bbclass
+++ b/import-layers/yocto-poky/meta/classes/package_tar.bbclass
@@ -7,27 +7,27 @@
 
     oldcwd = os.getcwd()
 
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
     if not workdir:
         bb.error("WORKDIR not defined, unable to package")
         return
 
-    outdir = d.getVar('DEPLOY_DIR_TAR', True)
+    outdir = d.getVar('DEPLOY_DIR_TAR')
     if not outdir:
         bb.error("DEPLOY_DIR_TAR not defined, unable to package")
         return
 
-    dvar = d.getVar('D', True)
+    dvar = d.getVar('D')
     if not dvar:
         bb.error("D not defined, unable to package")
         return
 
-    packages = d.getVar('PACKAGES', True)
+    packages = d.getVar('PACKAGES')
     if not packages:
         bb.debug(1, "PACKAGES not defined, nothing to package")
         return
 
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
 
     bb.utils.mkdirhier(outdir)
     bb.utils.mkdirhier(dvar)
@@ -38,7 +38,6 @@
 
         overrides = localdata.getVar('OVERRIDES', False)
         localdata.setVar('OVERRIDES', '%s:%s' % (overrides, pkg))
-        bb.data.update_data(localdata)
 
         bb.utils.mkdirhier(root)
         basedir = os.path.dirname(root)
@@ -46,7 +45,7 @@
         os.chdir(root)
         dlist = os.listdir(root)
         if not dlist:
-            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True)))
+            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR')))
             continue
         args = "tar -cz --exclude=CONTROL --exclude=DEBIAN -f".split()
         ret = subprocess.call(args + [tarfn] + dlist)
@@ -57,8 +56,8 @@
 }
 
 python () {
-    if d.getVar('PACKAGES', True) != '':
-        deps = (d.getVarFlag('do_package_write_tar', 'depends', True) or "").split()
+    if d.getVar('PACKAGES') != '':
+        deps = (d.getVarFlag('do_package_write_tar', 'depends') or "").split()
         deps.append('tar-native:do_populate_sysroot')
         deps.append('virtual/fakeroot-native:do_populate_sysroot')
         d.setVarFlag('do_package_write_tar', 'depends', " ".join(deps))
diff --git a/import-layers/yocto-poky/meta/classes/packagedata.bbclass b/import-layers/yocto-poky/meta/classes/packagedata.bbclass
index 3397f1e..a903e5c 100644
--- a/import-layers/yocto-poky/meta/classes/packagedata.bbclass
+++ b/import-layers/yocto-poky/meta/classes/packagedata.bbclass
@@ -2,10 +2,10 @@
     import oe.packagedata
 
     vars = {
-        "PN" : d.getVar('PN', True), 
-        "PE" : d.getVar('PE', True), 
-        "PV" : d.getVar('PV', True),
-        "PR" : d.getVar('PR', True),
+        "PN" : d.getVar('PN'), 
+        "PE" : d.getVar('PE'), 
+        "PV" : d.getVar('PV'),
+        "PR" : d.getVar('PR'),
     }
 
     data = oe.packagedata.read_pkgdata(vars["PN"], d)
@@ -13,7 +13,7 @@
     for key in data.keys():
         d.setVar(key, data[key])
 
-    for pkg in d.getVar('PACKAGES', True).split():
+    for pkg in d.getVar('PACKAGES').split():
         sdata = oe.packagedata.read_subpkgdata(pkg, d)
         for key in sdata.keys():
             if key in vars:
diff --git a/import-layers/yocto-poky/meta/classes/packagefeed-stability.bbclass b/import-layers/yocto-poky/meta/classes/packagefeed-stability.bbclass
index aa01def..c0e9be5 100644
--- a/import-layers/yocto-poky/meta/classes/packagefeed-stability.bbclass
+++ b/import-layers/yocto-poky/meta/classes/packagefeed-stability.bbclass
@@ -31,7 +31,7 @@
     # This assumes that the package_write task is called package_write_<pkgtype>
     # and that the directory in which packages should be written is
     # pointed to by the variable DEPLOY_DIR_<PKGTYPE>
-    for pkgclass in (d.getVar('PACKAGE_CLASSES', True) or '').split():
+    for pkgclass in (d.getVar('PACKAGE_CLASSES') or '').split():
         if pkgclass.startswith('package_'):
             pkgtype = pkgclass.split('_', 1)[1]
             pkgwritefunc = 'do_package_write_%s' % pkgtype
@@ -51,7 +51,7 @@
 
             d.appendVarFlag('do_build', 'recrdeptask', ' ' + pkgcomparefunc)
 
-            if d.getVarFlag(pkgwritefunc, 'noexec', True) or not d.getVarFlag(pkgwritefunc, 'task', True):
+            if d.getVarFlag(pkgwritefunc, 'noexec') or not d.getVarFlag(pkgwritefunc, 'task'):
                 # Packaging is disabled for this recipe, we shouldn't do anything
                 continue
 
@@ -71,7 +71,7 @@
 # This isn't the real task function - it's a template that we use in the
 # anonymous python code above
 fakeroot python do_package_compare () {
-    currenttask = d.getVar('BB_CURRENTTASK', True)
+    currenttask = d.getVar('BB_CURRENTTASK')
     pkgtype = currenttask.rsplit('_', 1)[1]
     package_compare_impl(pkgtype, d)
 }
@@ -83,12 +83,12 @@
     import subprocess
     import oe.sstatesig
 
-    pn = d.getVar('PN', True)
-    deploydir = d.getVar('DEPLOY_DIR_%s' % pkgtype.upper(), True)
+    pn = d.getVar('PN')
+    deploydir = d.getVar('DEPLOY_DIR_%s' % pkgtype.upper())
     prepath = deploydir + '-prediff/'
 
     # Find out PKGR values are
-    pkgdatadir = d.getVar('PKGDATA_DIR', True)
+    pkgdatadir = d.getVar('PKGDATA_DIR')
     packages = []
     try:
         with open(os.path.join(pkgdatadir, pn), 'r') as f:
@@ -138,7 +138,7 @@
     files = []
     docopy = False
     manifest, _ = oe.sstatesig.sstate_get_manifest_filename(pkgwritetask, d)
-    mlprefix = d.getVar('MLPREFIX', True)
+    mlprefix = d.getVar('MLPREFIX')
     # Copy recipe's all packages if one of the packages are different to make
     # they have the same PR.
     with open(manifest, 'r') as f:
@@ -215,7 +215,7 @@
                 # multilib), they're identical in theory, but sstate.bbclass
                 # copies it again, so keep align with that.
                 if os.path.exists(destpath) and pkgtype == 'rpm' \
-                        and d.getVar('PACKAGE_ARCH', True) == 'all':
+                        and d.getVar('PACKAGE_ARCH') == 'all':
                     os.unlink(destpath)
                 if (os.stat(srcpath).st_dev == os.stat(destdir).st_dev):
                     # Use a hard link to save space
@@ -229,10 +229,10 @@
 do_cleansstate[postfuncs] += "pfs_cleanpkgs"
 python pfs_cleanpkgs () {
     import errno
-    for pkgclass in (d.getVar('PACKAGE_CLASSES', True) or '').split():
+    for pkgclass in (d.getVar('PACKAGE_CLASSES') or '').split():
         if pkgclass.startswith('package_'):
             pkgtype = pkgclass.split('_', 1)[1]
-            deploydir = d.getVar('DEPLOY_DIR_%s' % pkgtype.upper(), True)
+            deploydir = d.getVar('DEPLOY_DIR_%s' % pkgtype.upper())
             prepath = deploydir + '-prediff'
             pcmanifest = os.path.join(prepath, d.expand('pkg-compare-manifest-${MULTIMACH_TARGET_SYS}-${PN}'))
             try:
diff --git a/import-layers/yocto-poky/meta/classes/packagegroup.bbclass b/import-layers/yocto-poky/meta/classes/packagegroup.bbclass
index 3928c8a..eea2e5b 100644
--- a/import-layers/yocto-poky/meta/classes/packagegroup.bbclass
+++ b/import-layers/yocto-poky/meta/classes/packagegroup.bbclass
@@ -16,15 +16,15 @@
 
 LICENSE ?= "MIT"
 
-inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED', True) == 'all', 'allarch', '')}
+inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')}
 
 # This automatically adds -dbg and -dev flavours of all PACKAGES
 # to the list. Their dependencies (RRECOMMENDS) are handled as usual
 # by package_depchains in a following step.
 # Also mark all packages as ALLOW_EMPTY
 python () {
-    packages = d.getVar('PACKAGES', True).split()
-    if d.getVar('PACKAGEGROUP_DISABLE_COMPLEMENTARY', True) != '1':
+    packages = d.getVar('PACKAGES').split()
+    if d.getVar('PACKAGEGROUP_DISABLE_COMPLEMENTARY') != '1':
         types = ['', '-dbg', '-dev']
         if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
             types.append('-ptest')
@@ -40,16 +40,18 @@
 DEPCHAIN_DBGDEFAULTDEPS = "1"
 
 # We only need the packaging tasks - disable the rest
-do_fetch[noexec] = "1"
-do_unpack[noexec] = "1"
-do_patch[noexec] = "1"
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
-do_install[noexec] = "1"
-do_populate_sysroot[noexec] = "1"
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_install
+deltask do_populate_sysroot
 
 python () {
-    initman = d.getVar("VIRTUAL-RUNTIME_init_manager", True)
+    if bb.data.inherits_class('nativesdk', d):
+        return
+    initman = d.getVar("VIRTUAL-RUNTIME_init_manager")
     if initman and initman in ['sysvinit', 'systemd'] and not bb.utils.contains('DISTRO_FEATURES', initman, True, False, d):
         bb.fatal("Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (%s) matches the entries enabled in DISTRO_FEATURES" % initman)
 }
diff --git a/import-layers/yocto-poky/meta/classes/patch.bbclass b/import-layers/yocto-poky/meta/classes/patch.bbclass
index 1f6927b..8f35cb4 100644
--- a/import-layers/yocto-poky/meta/classes/patch.bbclass
+++ b/import-layers/yocto-poky/meta/classes/patch.bbclass
@@ -10,110 +10,65 @@
 
 inherit terminal
 
-def src_patches(d, all = False ):
-    workdir = d.getVar('WORKDIR', True)
-    fetch = bb.fetch2.Fetch([], d)
-    patches = []
-    sources = []
-    for url in fetch.urls:
-        local = patch_path(url, fetch, workdir)
-        if not local:
-            if all:
-                local = fetch.localpath(url)
-                sources.append(local)
-            continue
+python () {
+    if d.getVar('PATCHTOOL') == 'git' and d.getVar('PATCH_COMMIT_FUNCTIONS') == '1':
+        extratasks = bb.build.tasksbetween('do_unpack', 'do_patch', d)
+        try:
+            extratasks.remove('do_unpack')
+        except ValueError:
+            # For some recipes do_unpack doesn't exist, ignore it
+            pass
 
-        urldata = fetch.ud[url]
-        parm = urldata.parm
-        patchname = parm.get('pname') or os.path.basename(local)
+        d.appendVarFlag('do_patch', 'prefuncs', ' patch_task_patch_prefunc')
+        for task in extratasks:
+            d.appendVarFlag(task, 'postfuncs', ' patch_task_postfunc')
+}
 
-        apply, reason = should_apply(parm, d)
-        if not apply:
-            if reason:
-                bb.note("Patch %s %s" % (patchname, reason))
-            continue
+python patch_task_patch_prefunc() {
+    # Prefunc for do_patch
+    func = d.getVar('BB_RUNTASK')
+    srcsubdir = d.getVar('S')
 
-        patchparm = {'patchname': patchname}
-        if "striplevel" in parm:
-            striplevel = parm["striplevel"]
-        elif "pnum" in parm:
-            #bb.msg.warn(None, "Deprecated usage of 'pnum' url parameter in '%s', please use 'striplevel'" % url)
-            striplevel = parm["pnum"]
+    patchdir = os.path.join(srcsubdir, 'patches')
+    if os.path.exists(patchdir):
+        if os.listdir(patchdir):
+            d.setVar('PATCH_HAS_PATCHES_DIR', '1')
         else:
-            striplevel = '1'
-        patchparm['striplevel'] = striplevel
+            os.rmdir(patchdir)
+}
 
-        patchdir = parm.get('patchdir')
-        if patchdir:
-            patchparm['patchdir'] = patchdir
+python patch_task_postfunc() {
+    # Prefunc for task functions between do_unpack and do_patch
+    import oe.patch
+    import shutil
+    func = d.getVar('BB_RUNTASK')
+    srcsubdir = d.getVar('S')
 
-        localurl = bb.fetch.encodeurl(('file', '', local, '', '', patchparm))
-        patches.append(localurl)
+    if os.path.exists(srcsubdir):
+        if func == 'do_patch':
+            haspatches = (d.getVar('PATCH_HAS_PATCHES_DIR') == '1')
+            patchdir = os.path.join(srcsubdir, 'patches')
+            if os.path.exists(patchdir):
+                shutil.rmtree(patchdir)
+                if haspatches:
+                    stdout, _ = bb.process.run('git status --porcelain patches', cwd=srcsubdir)
+                    if stdout:
+                        bb.process.run('git checkout patches', cwd=srcsubdir)
+        stdout, _ = bb.process.run('git status --porcelain .', cwd=srcsubdir)
+        if stdout:
+            useroptions = []
+            oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d)
+            bb.process.run('git add .; git %s commit -a -m "Committing changes from %s\n\n%s"' % (' '.join(useroptions), func, oe.patch.GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir)
+}
 
-    if all:
-        return sources
-
-    return patches
-
-def patch_path(url, fetch, workdir):
-    """Return the local path of a patch, or None if this isn't a patch"""
-
-    local = fetch.localpath(url)
-    base, ext = os.path.splitext(os.path.basename(local))
-    if ext in ('.gz', '.bz2', '.Z'):
-        local = os.path.join(workdir, base)
-        ext = os.path.splitext(base)[1]
-
-    urldata = fetch.ud[url]
-    if "apply" in urldata.parm:
-        apply = oe.types.boolean(urldata.parm["apply"])
-        if not apply:
-            return
-    elif ext not in (".diff", ".patch"):
-        return
-
-    return local
+def src_patches(d, all=False, expand=True):
+    import oe.patch
+    return oe.patch.src_patches(d, all, expand)
 
 def should_apply(parm, d):
     """Determine if we should apply the given patch"""
-
-    if "mindate" in parm or "maxdate" in parm:
-        pn = d.getVar('PN', True)
-        srcdate = d.getVar('SRCDATE_%s' % pn, True)
-        if not srcdate:
-            srcdate = d.getVar('SRCDATE', True)
-
-        if srcdate == "now":
-            srcdate = d.getVar('DATE', True)
-
-        if "maxdate" in parm and parm["maxdate"] < srcdate:
-            return False, 'is outdated'
-
-        if "mindate" in parm and parm["mindate"] > srcdate:
-            return False, 'is predated'
-
-
-    if "minrev" in parm:
-        srcrev = d.getVar('SRCREV', True)
-        if srcrev and srcrev < parm["minrev"]:
-            return False, 'applies to later revisions'
-
-    if "maxrev" in parm:
-        srcrev = d.getVar('SRCREV', True)
-        if srcrev and srcrev > parm["maxrev"]:
-            return False, 'applies to earlier revisions'
-
-    if "rev" in parm:
-        srcrev = d.getVar('SRCREV', True)
-        if srcrev and parm["rev"] not in srcrev:
-            return False, "doesn't apply to revision"
-
-    if "notrev" in parm:
-        srcrev = d.getVar('SRCREV', True)
-        if srcrev and parm["notrev"] in srcrev:
-            return False, "doesn't apply to revision"
-
-    return True, None
+    import oe.patch
+    return oe.patch.should_apply(parm, d)
 
 should_apply[vardepsexclude] = "DATE SRCDATE"
 
@@ -126,20 +81,20 @@
         "git": oe.patch.GitApplyTree,
     }
 
-    cls = patchsetmap[d.getVar('PATCHTOOL', True) or 'quilt']
+    cls = patchsetmap[d.getVar('PATCHTOOL') or 'quilt']
 
     resolvermap = {
         "noop": oe.patch.NOOPResolver,
         "user": oe.patch.UserResolver,
     }
 
-    rcls = resolvermap[d.getVar('PATCHRESOLVE', True) or 'user']
+    rcls = resolvermap[d.getVar('PATCHRESOLVE') or 'user']
 
     classes = {}
 
-    s = d.getVar('S', True)
+    s = d.getVar('S')
 
-    os.putenv('PATH', d.getVar('PATH', True))
+    os.putenv('PATH', d.getVar('PATH'))
 
     # We must use one TMPDIR per process so that the "patch" processes
     # don't generate the same temp file name.
diff --git a/import-layers/yocto-poky/meta/classes/perl-version.bbclass b/import-layers/yocto-poky/meta/classes/perl-version.bbclass
new file mode 100644
index 0000000..fafe68a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/perl-version.bbclass
@@ -0,0 +1,24 @@
+PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
+
+# Determine the staged version of perl from the perl configuration file
+# Assign vardepvalue, because otherwise signature is changed before and after
+# perl is built (from None to real version in config.sh).
+get_perl_version[vardepvalue] = "${PERL_OWN_DIR}"
+def get_perl_version(d):
+    import re
+    cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh')
+    try:
+        f = open(cfg, 'r')
+    except IOError:
+        return None
+    l = f.readlines();
+    f.close();
+    r = re.compile("^version='(\d*\.\d*\.\d*)'")
+    for s in l:
+        m = r.match(s)
+        if m:
+            return m.group(1)
+    return None
+
+PERLVERSION := "${@get_perl_version(d)}"
+PERLVERSION[vardepvalue] = ""
diff --git a/import-layers/yocto-poky/meta/classes/pixbufcache.bbclass b/import-layers/yocto-poky/meta/classes/pixbufcache.bbclass
index 3f48a0f..b3e507f 100644
--- a/import-layers/yocto-poky/meta/classes/pixbufcache.bbclass
+++ b/import-layers/yocto-poky/meta/classes/pixbufcache.bbclass
@@ -8,6 +8,8 @@
 
 PIXBUF_PACKAGES ??= "${PN}"
 
+PACKAGE_WRITE_DEPS += "qemu-native gdk-pixbuf-native"
+
 pixbufcache_common() {
 if [ "x$D" != "x" ]; then
 	$INTERCEPT_DIR/postinst_intercept update_pixbuf_cache ${PKG} mlprefix=${MLPREFIX} libdir=${libdir} \
@@ -28,42 +30,35 @@
 }
 
 python populate_packages_append() {
-    pixbuf_pkgs = d.getVar('PIXBUF_PACKAGES', True).split()
+    pixbuf_pkgs = d.getVar('PIXBUF_PACKAGES').split()
 
     for pkg in pixbuf_pkgs:
         bb.note("adding pixbuf postinst and postrm scripts to %s" % pkg)
-        postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
+        postinst = d.getVar('pkg_postinst_%s' % pkg) or d.getVar('pkg_postinst')
         if not postinst:
             postinst = '#!/bin/sh\n'
-        postinst += d.getVar('pixbufcache_common', True)
+        postinst += d.getVar('pixbufcache_common')
         d.setVar('pkg_postinst_%s' % pkg, postinst)
 
-        postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
+        postrm = d.getVar('pkg_postrm_%s' % pkg) or d.getVar('pkg_postrm')
         if not postrm:
             postrm = '#!/bin/sh\n'
-        postrm += d.getVar('pixbufcache_common', True)
+        postrm += d.getVar('pixbufcache_common')
         d.setVar('pkg_postrm_%s' % pkg, postrm)
 }
 
 gdkpixbuf_complete() {
-	GDK_PIXBUF_FATAL_LOADER=1 ${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache || exit 1
+GDK_PIXBUF_FATAL_LOADER=1 ${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache || exit 1
 }
 
-#
-# Add an sstate postinst hook to update the cache for native packages.
-# An error exit during populate_sysroot_setscene allows bitbake to
-# try to recover by re-building the package.
-#
 DEPENDS_append_class-native = " gdk-pixbuf-native"
-SSTATEPOSTINSTFUNCS_append_class-native = " pixbufcache_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " pixbufcache_sstate_postinst"
 
 # See base.bbclass for the other half of this
 pixbufcache_sstate_postinst() {
-	if [ "${BB_CURRENTTASK}" = "populate_sysroot" ]; then
-		${gdkpixbuf_complete}
-	elif [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]; then
-		if [ -x ${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders ]; then
-			echo "${gdkpixbuf_complete}" >> ${STAGING_DIR}/sstatecompletions
-		fi
-	fi
+	mkdir -p ${SYSROOT_DESTDIR}${bindir}
+	dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}
+        echo '#!/bin/sh' > $dest
+	echo "${gdkpixbuf_complete}" >> $dest
+	chmod 0755 $dest
 }
diff --git a/import-layers/yocto-poky/meta/classes/populate_sdk_base.bbclass b/import-layers/yocto-poky/meta/classes/populate_sdk_base.bbclass
index 69aae26..563582e 100644
--- a/import-layers/yocto-poky/meta/classes/populate_sdk_base.bbclass
+++ b/import-layers/yocto-poky/meta/classes/populate_sdk_base.bbclass
@@ -11,13 +11,13 @@
 def complementary_globs(featurevar, d):
     all_globs = d.getVarFlags('COMPLEMENTARY_GLOB')
     globs = []
-    features = set((d.getVar(featurevar, True) or '').split())
+    features = set((d.getVar(featurevar) or '').split())
     for name, glob in all_globs.items():
         if name in features:
             globs.append(glob)
     return ' '.join(globs)
 
-SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs"
+SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'doc-pkgs', '', d)}"
 SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}'
 
 inherit rootfs_${IMAGE_PKGTYPE}
@@ -34,10 +34,7 @@
 
 TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host packagegroup-cross-canadian-${MACHINE}"
 TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
-TOOLCHAIN_TARGET_TASK ?= " \
-    ${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \
-    ${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target-dbg')} \
-    "
+TOOLCHAIN_TARGET_TASK ?= "${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')}"
 TOOLCHAIN_TARGET_TASK_ATTEMPTONLY ?= ""
 TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}"
 
@@ -57,34 +54,41 @@
 SDK_POST_INSTALL_COMMAND ?= ""
 SDK_RELOCATE_AFTER_INSTALL ?= "1"
 
-SDKEXTPATH ?= "~/${@d.getVar('DISTRO', True)}_sdk"
-SDK_TITLE ?= "${@d.getVar('DISTRO_NAME', True) or d.getVar('DISTRO', True)} SDK"
+SDKEXTPATH ?= "~/${@d.getVar('DISTRO')}_sdk"
+SDK_TITLE ?= "${@d.getVar('DISTRO_NAME') or d.getVar('DISTRO')} SDK"
 
 SDK_TARGET_MANIFEST = "${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.target.manifest"
 SDK_HOST_MANIFEST = "${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.host.manifest"
 python write_target_sdk_manifest () {
     from oe.sdk import sdk_list_installed_packages
     from oe.utils import format_pkg_list
-    sdkmanifestdir = os.path.dirname(d.getVar("SDK_TARGET_MANIFEST", True))
+    sdkmanifestdir = os.path.dirname(d.getVar("SDK_TARGET_MANIFEST"))
     pkgs = sdk_list_installed_packages(d, True)
     if not os.path.exists(sdkmanifestdir):
         bb.utils.mkdirhier(sdkmanifestdir)
-    with open(d.getVar('SDK_TARGET_MANIFEST', True), 'w') as output:
+    with open(d.getVar('SDK_TARGET_MANIFEST'), 'w') as output:
         output.write(format_pkg_list(pkgs, 'ver'))
 }
 
+python write_sdk_test_data() {
+    from oe.data import export2json
+    testdata = "%s/%s.testdata.json" % (d.getVar('SDKDEPLOYDIR'), d.getVar('TOOLCHAIN_OUTPUTNAME'))
+    bb.utils.mkdirhier(os.path.dirname(testdata))
+    export2json(d, testdata)
+}
+
 python write_host_sdk_manifest () {
     from oe.sdk import sdk_list_installed_packages
     from oe.utils import format_pkg_list
-    sdkmanifestdir = os.path.dirname(d.getVar("SDK_HOST_MANIFEST", True))
+    sdkmanifestdir = os.path.dirname(d.getVar("SDK_HOST_MANIFEST"))
     pkgs = sdk_list_installed_packages(d, False)
     if not os.path.exists(sdkmanifestdir):
         bb.utils.mkdirhier(sdkmanifestdir)
-    with open(d.getVar('SDK_HOST_MANIFEST', True), 'w') as output:
+    with open(d.getVar('SDK_HOST_MANIFEST'), 'w') as output:
         output.write(format_pkg_list(pkgs, 'ver'))
 }
 
-POPULATE_SDK_POST_TARGET_COMMAND_append = " write_target_sdk_manifest ; "
+POPULATE_SDK_POST_TARGET_COMMAND_append = " write_target_sdk_manifest ; write_sdk_test_data ; "
 POPULATE_SDK_POST_HOST_COMMAND_append = " write_host_sdk_manifest; "
 SDK_PACKAGING_COMMAND = "${@'${SDK_PACKAGING_FUNC};' if '${SDK_PACKAGING_FUNC}' else ''}"
 SDK_POSTPROCESS_COMMAND = " create_sdk_files; check_sdk_sysroots; tar_sdk; ${SDK_PACKAGING_COMMAND} "
@@ -93,7 +97,7 @@
     from oe.sdk import populate_sdk
     from oe.manifest import create_manifest, Manifest
 
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
     runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d)
     runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d)
 
@@ -101,13 +105,13 @@
     ld.setVar("PKGDATA_DIR", "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}/pkgdata")
     runtime_mapping_rename("TOOLCHAIN_HOST_TASK", pn, ld)
     runtime_mapping_rename("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", pn, ld)
-    d.setVar("TOOLCHAIN_HOST_TASK", ld.getVar("TOOLCHAIN_HOST_TASK", True))
-    d.setVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", ld.getVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", True))
+    d.setVar("TOOLCHAIN_HOST_TASK", ld.getVar("TOOLCHAIN_HOST_TASK"))
+    d.setVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", ld.getVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY"))
     
     # create target/host SDK manifests
-    create_manifest(d, manifest_dir=d.getVar('SDK_DIR', True),
+    create_manifest(d, manifest_dir=d.getVar('SDK_DIR'),
                     manifest_type=Manifest.MANIFEST_TYPE_SDK_HOST)
-    create_manifest(d, manifest_dir=d.getVar('SDK_DIR', True),
+    create_manifest(d, manifest_dir=d.getVar('SDK_DIR'),
                     manifest_type=Manifest.MANIFEST_TYPE_SDK_TARGET)
 
     populate_sdk(d)
@@ -134,7 +138,7 @@
 python check_sdk_sysroots() {
     # Fails build if there are broken or dangling symlinks in SDK sysroots
 
-    if d.getVar('CHECK_SDK_SYSROOTS', True) != '1':
+    if d.getVar('CHECK_SDK_SYSROOTS') != '1':
         # disabled, bail out
         return
 
@@ -142,8 +146,8 @@
         return os.path.abspath(path)
 
     # Get scan root
-    SCAN_ROOT = norm_path("%s/%s/sysroots/" % (d.getVar('SDK_OUTPUT', True),
-                                               d.getVar('SDKPATH', True)))
+    SCAN_ROOT = norm_path("%s/%s/sysroots/" % (d.getVar('SDK_OUTPUT'),
+                                               d.getVar('SDKPATH')))
 
     bb.note('Checking SDK sysroots at ' + SCAN_ROOT)
 
@@ -218,10 +222,11 @@
 		-e 's#@SDKEXTPATH@#${SDKEXTPATH}#g' \
 		-e 's#@OLDEST_KERNEL@#${SDK_OLDEST_KERNEL}#g' \
 		-e 's#@REAL_MULTIMACH_TARGET_SYS@#${REAL_MULTIMACH_TARGET_SYS}#g' \
-		-e 's#@SDK_TITLE@#${@d.getVar("SDK_TITLE", True).replace('&', '\&')}#g' \
+		-e 's#@SDK_TITLE@#${@d.getVar("SDK_TITLE").replace('&', '\&')}#g' \
 		-e 's#@SDK_VERSION@#${SDK_VERSION}#g' \
 		-e '/@SDK_PRE_INSTALL_COMMAND@/d' \
 		-e '/@SDK_POST_INSTALL_COMMAND@/d' \
+		-e 's#@SDK_GCC_VER@#${@oe.utils.host_gcc_version(d)}#g' \
 		${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
 
 	# add execution permission
@@ -241,8 +246,7 @@
 
 		echo "log_check: Using $lf_path as logfile"
 
-		if test -e "$lf_path"
-		then
+		if [ -e "$lf_path" ]; then
 			${IMAGE_PKGTYPE}_log_check $target $lf_path
 		else
 			echo "Cannot find logfile [$lf_path]"
@@ -268,7 +272,7 @@
                                     ${COREBASE}/meta/files/toolchain-shar-extract.sh:True"
 
 do_populate_sdk[dirs] = "${PKGDATA_DIR} ${TOPDIR}"
-do_populate_sdk[depends] += "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_DEPENDS', True).split()])}  ${@d.getVarFlag('do_rootfs', 'depends', False)}"
-do_populate_sdk[rdepends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_RDEPENDS', True).split()])}"
+do_populate_sdk[depends] += "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_DEPENDS').split()])}  ${@d.getVarFlag('do_rootfs', 'depends', False)}"
+do_populate_sdk[rdepends] = "${@' '.join([x + ':do_package_write_${IMAGE_PKGTYPE} ' + x + ':do_packagedata' for x in d.getVar('SDK_RDEPENDS').split()])}"
 do_populate_sdk[recrdeptask] += "do_packagedata do_package_write_rpm do_package_write_ipk do_package_write_deb"
 addtask populate_sdk
diff --git a/import-layers/yocto-poky/meta/classes/populate_sdk_ext.bbclass b/import-layers/yocto-poky/meta/classes/populate_sdk_ext.bbclass
index 39f6142..8b8a341 100644
--- a/import-layers/yocto-poky/meta/classes/populate_sdk_ext.bbclass
+++ b/import-layers/yocto-poky/meta/classes/populate_sdk_ext.bbclass
@@ -11,8 +11,6 @@
 
 TOOLCHAIN_TARGET_TASK_task-populate-sdk-ext = ""
 
-SDK_RDEPENDS_append_task-populate-sdk-ext = " ${SDK_TARGETS}"
-
 SDK_RELOCATE_AFTER_INSTALL_task-populate-sdk-ext = "0"
 
 SDK_EXT = ""
@@ -21,7 +19,7 @@
 # Options are full or minimal
 SDK_EXT_TYPE ?= "full"
 SDK_INCLUDE_PKGDATA ?= "0"
-SDK_INCLUDE_TOOLCHAIN ?= "${@'1' if d.getVar('SDK_EXT_TYPE', True) == 'full' else '0'}"
+SDK_INCLUDE_TOOLCHAIN ?= "${@'1' if d.getVar('SDK_EXT_TYPE') == 'full' else '0'}"
 
 SDK_RECRDEP_TASKS ?= ""
 
@@ -43,19 +41,21 @@
 
 def get_sdk_install_targets(d, images_only=False):
     sdk_install_targets = ''
-    if images_only or d.getVar('SDK_EXT_TYPE', True) != 'minimal':
-        sdk_install_targets = d.getVar('SDK_TARGETS', True)
+    if images_only or d.getVar('SDK_EXT_TYPE') != 'minimal':
+        sdk_install_targets = d.getVar('SDK_TARGETS')
 
         depd = d.getVar('BB_TASKDEPDATA', False)
+        tasklist = bb.build.tasksbetween('do_image_complete', 'do_build', d)
+        tasklist.remove('do_build')
         for v in depd.values():
-            if v[1] == 'do_image_complete':
+            if v[1] in tasklist:
                 if v[0] not in sdk_install_targets:
                     sdk_install_targets += ' {}'.format(v[0])
 
     if not images_only:
-        if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1':
+        if d.getVar('SDK_INCLUDE_PKGDATA') == '1':
             sdk_install_targets += ' meta-world-pkgdata:do_allpackagedata'
-        if d.getVar('SDK_INCLUDE_TOOLCHAIN', True) == '1':
+        if d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1':
             sdk_install_targets += ' meta-extsdk-toolchain:do_populate_sysroot'
 
     return sdk_install_targets
@@ -77,13 +77,13 @@
 
 SDK_DIR_task-populate-sdk-ext = "${WORKDIR}/sdk-ext"
 B_task-populate-sdk-ext = "${SDK_DIR}"
-TOOLCHAINEXT_OUTPUTNAME = "${SDK_NAME}-toolchain-ext-${SDK_VERSION}"
+TOOLCHAINEXT_OUTPUTNAME ?= "${SDK_NAME}-toolchain-ext-${SDK_VERSION}"
 TOOLCHAIN_OUTPUTNAME_task-populate-sdk-ext = "${TOOLCHAINEXT_OUTPUTNAME}"
 
 SDK_EXT_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest"
 SDK_EXT_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.host.manifest"
 
-SDK_TITLE_task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME', True) or d.getVar('DISTRO', True)} Extensible SDK"
+SDK_TITLE_task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME') or d.getVar('DISTRO')} Extensible SDK"
 
 def clean_esdk_builddir(d, sdkbasepath):
     """Clean up traces of the fake build for create_filtered_tasklist()"""
@@ -110,10 +110,11 @@
     try:
         with open(sdkbasepath + '/conf/local.conf', 'a') as f:
             # Force the use of sstate from the build system
-            f.write('\nSSTATE_DIR_forcevariable = "%s"\n' % d.getVar('SSTATE_DIR', True))
+            f.write('\nSSTATE_DIR_forcevariable = "%s"\n' % d.getVar('SSTATE_DIR'))
             f.write('SSTATE_MIRRORS_forcevariable = ""\n')
             # Ensure TMPDIR is the default so that clean_esdk_builddir() can delete it
             f.write('TMPDIR_forcevariable = "${TOPDIR}/tmp"\n')
+            f.write('TCLIBCAPPEND_forcevariable = ""\n')
             # Drop uninative if the build isn't using it (or else NATIVELSBSTRING will
             # be different and we won't be able to find our native sstate)
             if not bb.data.inherits_class('uninative', d):
@@ -121,7 +122,7 @@
 
         # Unfortunately the default SDKPATH (or even a custom value) may contain characters that bitbake
         # will not allow in its COREBASE path, so we need to rename the directory temporarily
-        temp_sdkbasepath = d.getVar('SDK_OUTPUT', True) + '/tmp-renamed-sdk'
+        temp_sdkbasepath = d.getVar('SDK_OUTPUT') + '/tmp-renamed-sdk'
         # Delete any existing temp dir
         try:
             shutil.rmtree(temp_sdkbasepath)
@@ -130,7 +131,7 @@
         os.rename(sdkbasepath, temp_sdkbasepath)
         try:
             cmdprefix = '. %s .; ' % conf_initpath
-            logfile = d.getVar('WORKDIR', True) + '/tasklist_bb_log.txt'
+            logfile = d.getVar('WORKDIR') + '/tasklist_bb_log.txt'
             try:
                 oe.copy_buildsystem.check_sstate_task_list(d, get_sdk_install_targets(d), tasklistfile, cmdprefix=cmdprefix, cwd=temp_sdkbasepath, logfile=logfile)
             except bb.process.ExecutionError as e:
@@ -152,7 +153,7 @@
     import glob
     import oe.copy_buildsystem
 
-    oe_init_env_script = d.getVar('OE_INIT_ENV_SCRIPT', True)
+    oe_init_env_script = d.getVar('OE_INIT_ENV_SCRIPT')
 
     conf_bbpath = ''
     conf_initpath = ''
@@ -160,10 +161,10 @@
 
     # Copy in all metadata layers + bitbake (as repositories)
     buildsystem = oe.copy_buildsystem.BuildSystem('extensible SDK', d)
-    baseoutpath = d.getVar('SDK_OUTPUT', True) + '/' + d.getVar('SDKPATH', True)
+    baseoutpath = d.getVar('SDK_OUTPUT') + '/' + d.getVar('SDKPATH')
 
     # Determine if we're building a derivative extensible SDK (from devtool build-sdk)
-    derivative = (d.getVar('SDK_DERIVATIVE', True) or '') == '1'
+    derivative = (d.getVar('SDK_DERIVATIVE') or '') == '1'
     if derivative:
         workspace_name = 'orig-workspace'
     else:
@@ -171,7 +172,7 @@
     layers_copied = buildsystem.copy_bitbake_and_layers(baseoutpath + '/layers', workspace_name)
 
     sdkbblayers = []
-    corebase = os.path.basename(d.getVar('COREBASE', True))
+    corebase = os.path.basename(d.getVar('COREBASE'))
     for layer in layers_copied:
         if corebase == os.path.basename(layer):
             conf_bbpath = os.path.join('layers', layer, 'bitbake')
@@ -202,8 +203,8 @@
     config.set('General', 'init_path', conf_initpath)
     config.set('General', 'core_meta_subdir', core_meta_subdir)
     config.add_section('SDK')
-    config.set('SDK', 'sdk_targets', d.getVar('SDK_TARGETS', True))
-    updateurl = d.getVar('SDK_UPDATE_URL', True)
+    config.set('SDK', 'sdk_targets', d.getVar('SDK_TARGETS'))
+    updateurl = d.getVar('SDK_UPDATE_URL')
     if updateurl:
         config.set('SDK', 'updateserver', updateurl)
     bb.utils.mkdirhier(os.path.join(baseoutpath, 'conf'))
@@ -215,7 +216,7 @@
         pass
 
     # Create a layer for new recipes / appends
-    bbpath = d.getVar('BBPATH', True)
+    bbpath = d.getVar('BBPATH')
     bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--create-only', os.path.join(baseoutpath, 'workspace')])
 
     # Create bblayers.conf
@@ -242,22 +243,25 @@
 
     # Copy uninative tarball
     # For now this is where uninative.bbclass expects the tarball
-    uninative_file = d.expand('${SDK_DEPLOY}/${BUILD_ARCH}-nativesdk-libc.tar.bz2')
-    uninative_checksum = bb.utils.sha256_file(uninative_file)
-    uninative_outdir = '%s/downloads/uninative/%s' % (baseoutpath, uninative_checksum)
-    bb.utils.mkdirhier(uninative_outdir)
-    shutil.copy(uninative_file, uninative_outdir)
+    if bb.data.inherits_class('uninative', d):
+        uninative_file = d.expand('${UNINATIVE_DLDIR}/' + d.getVarFlag("UNINATIVE_CHECKSUM", d.getVar("BUILD_ARCH")) + '/${UNINATIVE_TARBALL}')
+        uninative_checksum = bb.utils.sha256_file(uninative_file)
+        uninative_outdir = '%s/downloads/uninative/%s' % (baseoutpath, uninative_checksum)
+        bb.utils.mkdirhier(uninative_outdir)
+        shutil.copy(uninative_file, uninative_outdir)
 
-    env_whitelist = (d.getVar('BB_ENV_EXTRAWHITE', True) or '').split()
+    env_whitelist = (d.getVar('BB_ENV_EXTRAWHITE') or '').split()
     env_whitelist_values = {}
 
     # Create local.conf
-    builddir = d.getVar('TOPDIR', True)
+    builddir = d.getVar('TOPDIR')
+    if derivative and os.path.exists(builddir + '/conf/auto.conf'):
+        shutil.copyfile(builddir + '/conf/auto.conf', baseoutpath + '/conf/auto.conf')
     if derivative:
         shutil.copyfile(builddir + '/conf/local.conf', baseoutpath + '/conf/local.conf')
     else:
-        local_conf_whitelist = (d.getVar('SDK_LOCAL_CONF_WHITELIST', True) or '').split()
-        local_conf_blacklist = (d.getVar('SDK_LOCAL_CONF_BLACKLIST', True) or '').split()
+        local_conf_whitelist = (d.getVar('SDK_LOCAL_CONF_WHITELIST') or '').split()
+        local_conf_blacklist = (d.getVar('SDK_LOCAL_CONF_BLACKLIST') or '').split()
         def handle_var(varname, origvalue, op, newlines):
             if varname in local_conf_blacklist or (origvalue.strip().startswith('/') and not varname in local_conf_whitelist):
                 newlines.append('# Removed original setting of %s\n' % varname)
@@ -267,8 +271,12 @@
                     env_whitelist_values[varname] = origvalue
                 return origvalue, op, 0, True
         varlist = ['[^#=+ ]*']
+        oldlines = []
+        if os.path.exists(builddir + '/conf/auto.conf'):
+            with open(builddir + '/conf/auto.conf', 'r') as f:
+                oldlines += f.readlines()
         with open(builddir + '/conf/local.conf', 'r') as f:
-            oldlines = f.readlines()
+            oldlines += f.readlines()
         (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
 
         with open(baseoutpath + '/conf/local.conf', 'w') as f:
@@ -282,10 +290,12 @@
             # Write a newline just in case there's none at the end of the original
             f.write('\n')
 
+            f.write('TMPDIR = "${TOPDIR}/tmp"\n')
+            f.write('TCLIBCAPPEND = ""\n')
             f.write('DL_DIR = "${TOPDIR}/downloads"\n')
 
             f.write('INHERIT += "%s"\n' % 'uninative')
-            f.write('UNINATIVE_CHECKSUM[%s] = "%s"\n\n' % (d.getVar('BUILD_ARCH', True), uninative_checksum))
+            f.write('UNINATIVE_CHECKSUM[%s] = "%s"\n\n' % (d.getVar('BUILD_ARCH'), uninative_checksum))
             f.write('CONF_VERSION = "%s"\n\n' % d.getVar('CONF_VERSION', False))
 
             # Some classes are not suitable for SDK, remove them from INHERIT
@@ -305,13 +315,13 @@
             f.write('SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "warn"\n\n')
 
             # Set up whitelist for run on install
-            f.write('BB_SETSCENE_ENFORCE_WHITELIST = "%:* *:do_shared_workdir *:do_rm_work *:do_package"\n\n')
+            f.write('BB_SETSCENE_ENFORCE_WHITELIST = "%:* *:do_shared_workdir *:do_rm_work wic-tools:* *:do_addto_recipe_sysroot"\n\n')
 
             # Hide the config information from bitbake output (since it's fixed within the SDK)
             f.write('BUILDCFG_HEADER = ""\n\n')
 
             # Map gcc-dependent uninative sstate cache for installer usage
-            f.write('SSTATE_MIRRORS = "file://universal/(.*) file://universal-4.9/\\1\\nfile://universal-4.9/(.*) file://universal-4.8/\\1"\n\n')
+            f.write('SSTATE_MIRRORS += " file://universal/(.*) file://universal-4.9/\\1 file://universal-4.9/(.*) file://universal-4.8/\\1"\n\n')
 
             # Allow additional config through sdk-extra.conf
             fn = bb.cookerdata.findConfigFile('sdk-extra.conf', d)
@@ -322,7 +332,7 @@
 
             # If you define a sdk_extraconf() function then it can contain additional config
             # (Though this is awkward; sdk-extra.conf should probably be used instead)
-            extraconf = (d.getVar('sdk_extraconf', True) or '').strip()
+            extraconf = (d.getVar('sdk_extraconf') or '').strip()
             if extraconf:
                 # Strip off any leading / trailing spaces
                 for line in extraconf.splitlines():
@@ -331,22 +341,6 @@
             f.write('require conf/locked-sigs.inc\n')
             f.write('require conf/unlocked-sigs.inc\n')
 
-    if os.path.exists(builddir + '/conf/auto.conf'):
-        if derivative:
-            shutil.copyfile(builddir + '/conf/auto.conf', baseoutpath + '/conf/auto.conf')
-        else:
-            with open(builddir + '/conf/auto.conf', 'r') as f:
-                oldlines = f.readlines()
-            (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
-            with open(baseoutpath + '/conf/auto.conf', 'w') as f:
-                f.write('# WARNING: this configuration has been automatically generated and in\n')
-                f.write('# most cases should not be edited. If you need more flexibility than\n')
-                f.write('# this configuration provides, it is strongly suggested that you set\n')
-                f.write('# up a proper instance of the full build system and use that instead.\n\n')
-                for line in newlines:
-                    if line.strip() and not line.startswith('#'):
-                        f.write(line)
-
     # Write a templateconf.cfg
     with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f:
         f.write('meta/conf\n')
@@ -355,7 +349,7 @@
     # BB_ENV_EXTRAWHITE) are set in the SDK's configuration
     extralines = []
     for name, value in env_whitelist_values.items():
-        actualvalue = d.getVar(name, True) or ''
+        actualvalue = d.getVar(name) or ''
         if value != actualvalue:
             extralines.append('%s = "%s"\n' % (name, actualvalue))
     if extralines:
@@ -368,7 +362,7 @@
 
     # Filter the locked signatures file to just the sstate tasks we are interested in
     excluded_targets = get_sdk_install_targets(d, images_only=True)
-    sigfile = d.getVar('WORKDIR', True) + '/locked-sigs.inc'
+    sigfile = d.getVar('WORKDIR') + '/locked-sigs.inc'
     lockedsigs_pruned = baseoutpath + '/conf/locked-sigs.inc'
     oe.copy_buildsystem.prune_lockedsigs([],
                                          excluded_targets.split(),
@@ -381,36 +375,36 @@
     # uninative.bbclass sets NATIVELSBSTRING to 'universal%s' % oe.utils.host_gcc_version(d)
     fixedlsbstring = "universal%s" % oe.utils.host_gcc_version(d)
 
-    sdk_include_toolchain = (d.getVar('SDK_INCLUDE_TOOLCHAIN', True) == '1')
-    sdk_ext_type = d.getVar('SDK_EXT_TYPE', True)
+    sdk_include_toolchain = (d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1')
+    sdk_ext_type = d.getVar('SDK_EXT_TYPE')
     if sdk_ext_type != 'minimal' or sdk_include_toolchain or derivative:
         # Create the filtered task list used to generate the sstate cache shipped with the SDK
-        tasklistfn = d.getVar('WORKDIR', True) + '/tasklist.txt'
+        tasklistfn = d.getVar('WORKDIR') + '/tasklist.txt'
         create_filtered_tasklist(d, baseoutpath, tasklistfn, conf_initpath)
     else:
         tasklistfn = None
 
     # Add packagedata if enabled
-    if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1':
-        lockedsigs_base = d.getVar('WORKDIR', True) + '/locked-sigs-base.inc'
-        lockedsigs_copy = d.getVar('WORKDIR', True) + '/locked-sigs-copy.inc'
+    if d.getVar('SDK_INCLUDE_PKGDATA') == '1':
+        lockedsigs_base = d.getVar('WORKDIR') + '/locked-sigs-base.inc'
+        lockedsigs_copy = d.getVar('WORKDIR') + '/locked-sigs-copy.inc'
         shutil.move(lockedsigs_pruned, lockedsigs_base)
         oe.copy_buildsystem.merge_lockedsigs(['do_packagedata'],
                                              lockedsigs_base,
-                                             d.getVar('STAGING_DIR_HOST', True) + '/world-pkgdata/locked-sigs-pkgdata.inc',
+                                             d.getVar('STAGING_DIR_HOST') + '/world-pkgdata/locked-sigs-pkgdata.inc',
                                              lockedsigs_pruned,
                                              lockedsigs_copy)
 
     if sdk_include_toolchain:
-        lockedsigs_base = d.getVar('WORKDIR', True) + '/locked-sigs-base2.inc'
-        lockedsigs_toolchain = d.getVar('STAGING_DIR_HOST', True) + '/locked-sigs/locked-sigs-extsdk-toolchain.inc'
+        lockedsigs_base = d.getVar('WORKDIR') + '/locked-sigs-base2.inc'
+        lockedsigs_toolchain = d.expand("${STAGING_DIR}/${TUNE_PKGARCH}/meta-extsdk-toolchain/locked-sigs/locked-sigs-extsdk-toolchain.inc")
         shutil.move(lockedsigs_pruned, lockedsigs_base)
         oe.copy_buildsystem.merge_lockedsigs([],
                                              lockedsigs_base,
                                              lockedsigs_toolchain,
                                              lockedsigs_pruned)
         oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_toolchain,
-                                                       d.getVar('SSTATE_DIR', True),
+                                                       d.getVar('SSTATE_DIR'),
                                                        sstate_out, d,
                                                        fixedlsbstring,
                                                        filterfile=tasklistfn)
@@ -420,22 +414,22 @@
             # Assume the user is not going to set up an additional sstate
             # mirror, thus we need to copy the additional artifacts (from
             # workspace recipes) into the derivative SDK
-            lockedsigs_orig = d.getVar('TOPDIR', True) + '/conf/locked-sigs.inc'
+            lockedsigs_orig = d.getVar('TOPDIR') + '/conf/locked-sigs.inc'
             if os.path.exists(lockedsigs_orig):
-                lockedsigs_extra = d.getVar('WORKDIR', True) + '/locked-sigs-extra.inc'
+                lockedsigs_extra = d.getVar('WORKDIR') + '/locked-sigs-extra.inc'
                 oe.copy_buildsystem.merge_lockedsigs(None,
                                                      lockedsigs_orig,
                                                      lockedsigs_pruned,
                                                      None,
                                                      lockedsigs_extra)
                 oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_extra,
-                                                               d.getVar('SSTATE_DIR', True),
+                                                               d.getVar('SSTATE_DIR'),
                                                                sstate_out, d,
                                                                fixedlsbstring,
                                                                filterfile=tasklistfn)
     else:
         oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_pruned,
-                                                       d.getVar('SSTATE_DIR', True),
+                                                       d.getVar('SSTATE_DIR'),
                                                        sstate_out, d,
                                                        fixedlsbstring,
                                                        filterfile=tasklistfn)
@@ -466,24 +460,24 @@
 def get_current_buildtools(d):
     """Get the file name of the current buildtools installer"""
     import glob
-    btfiles = glob.glob(os.path.join(d.getVar('SDK_DEPLOY', True), '*-buildtools-nativesdk-standalone-*.sh'))
+    btfiles = glob.glob(os.path.join(d.getVar('SDK_DEPLOY'), '*-buildtools-nativesdk-standalone-*.sh'))
     btfiles.sort(key=os.path.getctime)
     return os.path.basename(btfiles[-1])
 
 def get_sdk_required_utilities(buildtools_fn, d):
     """Find required utilities that aren't provided by the buildtools"""
-    sanity_required_utilities = (d.getVar('SANITY_REQUIRED_UTILITIES', True) or '').split()
+    sanity_required_utilities = (d.getVar('SANITY_REQUIRED_UTILITIES') or '').split()
     sanity_required_utilities.append(d.expand('${BUILD_PREFIX}gcc'))
     sanity_required_utilities.append(d.expand('${BUILD_PREFIX}g++'))
-    buildtools_installer = os.path.join(d.getVar('SDK_DEPLOY', True), buildtools_fn)
+    buildtools_installer = os.path.join(d.getVar('SDK_DEPLOY'), buildtools_fn)
     filelist, _ = bb.process.run('%s -l' % buildtools_installer)
     localdata = bb.data.createCopy(d)
     localdata.setVar('SDKPATH', '.')
-    sdkpathnative = localdata.getVar('SDKPATHNATIVE', True)
-    sdkbindirs = [localdata.getVar('bindir_nativesdk', True),
-                  localdata.getVar('sbindir_nativesdk', True),
-                  localdata.getVar('base_bindir_nativesdk', True),
-                  localdata.getVar('base_sbindir_nativesdk', True)]
+    sdkpathnative = localdata.getVar('SDKPATHNATIVE')
+    sdkbindirs = [localdata.getVar('bindir_nativesdk'),
+                  localdata.getVar('sbindir_nativesdk'),
+                  localdata.getVar('base_bindir_nativesdk'),
+                  localdata.getVar('base_sbindir_nativesdk')]
     for line in filelist.splitlines():
         splitline = line.split()
         if len(splitline) > 5:
@@ -510,9 +504,10 @@
 	done
 	# We can't use the same method as above because files in the sysroot won't exist at this point
 	# (they get populated from sstate on installation)
-	if [ "${SDK_INCLUDE_TOOLCHAIN}" == "1" ] ; then
-		binrelpath=${@os.path.relpath(d.getVar('STAGING_BINDIR_NATIVE',True), d.getVar('TOPDIR', True))}
-		lnr ${SDK_OUTPUT}/${SDKPATH}/$binrelpath/unfsd ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/unfsd
+	unfsd_path="${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/unfsd"
+	if [ "${SDK_INCLUDE_TOOLCHAIN}" = "1" -a ! -e $unfsd_path ] ; then
+		binrelpath=${@os.path.relpath(d.getVar('STAGING_BINDIR_NATIVE'), d.getVar('TMPDIR'))}
+		lnr ${SDK_OUTPUT}/${SDKPATH}/tmp/$binrelpath/unfsd $unfsd_path
 	fi
 	touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase
 
@@ -583,6 +578,8 @@
 
 	# Allow bitbake environment setup to be ran as part of this sdk.
 	echo "export OE_SKIP_SDK_CHECK=1" >> $env_setup_script
+	# Work around runqemu not knowing how to get this information within the eSDK
+	echo "export DEPLOY_DIR_IMAGE=$target_sdk_dir/tmp/${@os.path.relpath(d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('TMPDIR'))}" >> $env_setup_script
 
 	# A bit of another hack, but we need this in the path only for devtool
 	# so put it at the end of $PATH.
@@ -613,8 +610,8 @@
 fakeroot python do_populate_sdk_ext() {
     # FIXME hopefully we can remove this restriction at some point, but uninative
     # currently forces this upon us
-    if d.getVar('SDK_ARCH', True) != d.getVar('BUILD_ARCH', True):
-        bb.fatal('The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is set to %s (likely via setting SDKMACHINE) which is different from the architecture of the build machine (%s). Unable to continue.' % (d.getVar('SDK_ARCH', True), d.getVar('BUILD_ARCH', True)))
+    if d.getVar('SDK_ARCH') != d.getVar('BUILD_ARCH'):
+        bb.fatal('The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is set to %s (likely via setting SDKMACHINE) which is different from the architecture of the build machine (%s). Unable to continue.' % (d.getVar('SDK_ARCH'), d.getVar('BUILD_ARCH')))
 
     d.setVar('SDK_INSTALL_TARGETS', get_sdk_install_targets(d))
     buildtools_fn = get_current_buildtools(d)
@@ -628,10 +625,12 @@
 def get_ext_sdk_depends(d):
     # Note: the deps varflag is a list not a string, so we need to specify expand=False
     deps = d.getVarFlag('do_image_complete', 'deps', False)
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
     deplist = ['%s:%s' % (pn, dep) for dep in deps]
-    for task in ['do_image_complete', 'do_rootfs', 'do_build']:
-        deplist.extend((d.getVarFlag(task, 'depends', True) or '').split())
+    tasklist = bb.build.tasksbetween('do_image_complete', 'do_build', d)
+    tasklist.append('do_rootfs')
+    for task in tasklist:
+        deplist.extend((d.getVarFlag(task, 'depends') or '').split())
     return ' '.join(deplist)
 
 python do_sdk_depends() {
@@ -639,13 +638,13 @@
     # dependencies we don't need to (e.g. buildtools-tarball) and bringing those
     # into the SDK's sstate-cache
     import oe.copy_buildsystem
-    sigfile = d.getVar('WORKDIR', True) + '/locked-sigs.inc'
+    sigfile = d.getVar('WORKDIR') + '/locked-sigs.inc'
     oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
 }
 addtask sdk_depends
 
 do_sdk_depends[dirs] = "${WORKDIR}"
-do_sdk_depends[depends] = "${@get_ext_sdk_depends(d)}"
+do_sdk_depends[depends] = "${@get_ext_sdk_depends(d)} meta-extsdk-toolchain:do_populate_sysroot"
 do_sdk_depends[recrdeptask] = "${@d.getVarFlag('do_populate_sdk', 'recrdeptask', False)}"
 do_sdk_depends[recrdeptask] += "do_populate_lic do_package_qa do_populate_sysroot do_deploy ${SDK_RECRDEP_TASKS}"
 do_sdk_depends[rdepends] = "${@get_sdk_ext_rdepends(d)}"
@@ -653,17 +652,21 @@
 def get_sdk_ext_rdepends(d):
     localdata = d.createCopy()
     localdata.appendVar('OVERRIDES', ':task-populate-sdk-ext')
-    bb.data.update_data(localdata)
-    return localdata.getVarFlag('do_populate_sdk', 'rdepends', True)
+    return localdata.getVarFlag('do_populate_sdk', 'rdepends')
 
 do_populate_sdk_ext[dirs] = "${@d.getVarFlag('do_populate_sdk', 'dirs', False)}"
 
 do_populate_sdk_ext[depends] = "${@d.getVarFlag('do_populate_sdk', 'depends', False)} \
-                                buildtools-tarball:do_populate_sdk uninative-tarball:do_populate_sdk \
-                                ${@'meta-world-pkgdata:do_collect_packagedata' if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1' else ''} \
-                                ${@'meta-extsdk-toolchain:do_locked_sigs' if d.getVar('SDK_INCLUDE_TOOLCHAIN', True) == '1' else ''}"
+                                buildtools-tarball:do_populate_sdk \
+                                ${@'meta-world-pkgdata:do_collect_packagedata' if d.getVar('SDK_INCLUDE_PKGDATA') == '1' else ''} \
+                                ${@'meta-extsdk-toolchain:do_locked_sigs' if d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1' else ''}"
 
-do_populate_sdk_ext[rdepends] += "${@' '.join([x + ':do_build' for x in d.getVar('SDK_TARGETS', True).split()])}"
+# We must avoid depending on do_build here if rm_work.bbclass is active,
+# because otherwise do_rm_work may run before do_populate_sdk_ext itself.
+# We can't mark do_populate_sdk_ext and do_sdk_depends as having to
+# run before do_rm_work, because then they would also run as part
+# of normal builds.
+do_populate_sdk_ext[rdepends] += "${@' '.join([x + ':' + (d.getVar('RM_WORK_BUILD_WITHOUT') or 'do_build') for x in d.getVar('SDK_TARGETS').split()])}"
 
 # Make sure code changes can result in rebuild
 do_populate_sdk_ext[vardeps] += "copy_buildsystem \
@@ -678,7 +681,7 @@
 
 SSTATETASKS += "do_populate_sdk_ext"
 SSTATE_SKIP_CREATION_task-populate-sdk-ext = '1'
-do_populate_sdk_ext[cleandirs] = "${SDKDEPLOYDIR}"
+do_populate_sdk_ext[cleandirs] = "${SDKEXTDEPLOYDIR}"
 do_populate_sdk_ext[sstate-inputdirs] = "${SDKEXTDEPLOYDIR}"
 do_populate_sdk_ext[sstate-outputdirs] = "${SDK_DEPLOY}"
 do_populate_sdk_ext[stamp-extra-info] = "${MACHINE}"
diff --git a/import-layers/yocto-poky/meta/classes/prexport.bbclass b/import-layers/yocto-poky/meta/classes/prexport.bbclass
index 809ec10..6dcf99e 100644
--- a/import-layers/yocto-poky/meta/classes/prexport.bbclass
+++ b/import-layers/yocto-poky/meta/classes/prexport.bbclass
@@ -15,7 +15,7 @@
     if isinstance(e, bb.event.RecipeParsed):
         import oe.prservice
         #get all PR values for the current PRAUTOINX
-        ver = e.data.getVar('PRSERV_DUMPOPT_VERSION', True)
+        ver = e.data.getVar('PRSERV_DUMPOPT_VERSION')
         ver = ver.replace('%','-')
         retval = oe.prservice.prserv_dump_db(e.data)
         if not retval:
@@ -40,7 +40,7 @@
         import oe.prservice
         oe.prservice.prserv_check_avail(e.data)
         #remove dumpfile
-        bb.utils.remove(e.data.getVar('PRSERV_DUMPFILE', True))
+        bb.utils.remove(e.data.getVar('PRSERV_DUMPFILE'))
     elif isinstance(e, bb.event.ParseCompleted):
         import oe.prservice
         #dump meta info of tables
diff --git a/import-layers/yocto-poky/meta/classes/ptest.bbclass b/import-layers/yocto-poky/meta/classes/ptest.bbclass
index fa3561e..c19f65b 100644
--- a/import-layers/yocto-poky/meta/classes/ptest.bbclass
+++ b/import-layers/yocto-poky/meta/classes/ptest.bbclass
@@ -2,7 +2,7 @@
 DESCRIPTION_${PN}-ptest ?= "${DESCRIPTION}  \
 This package contains a test directory ${PTEST_PATH} for package test purposes."
 
-PTEST_PATH ?= "${libdir}/${PN}/ptest"
+PTEST_PATH ?= "${libdir}/${BPN}/ptest"
 FILES_${PN}-ptest = "${PTEST_PATH}"
 SECTION_${PN}-ptest = "devel"
 ALLOW_EMPTY_${PN}-ptest = "1"
@@ -61,7 +61,7 @@
         d.setVarFlag('do_install_ptest_base', 'fakeroot', '1')
 
     # Remove all '*ptest_base' tasks when ptest is not enabled
-    if not(d.getVar('PTEST_ENABLED', True) == "1"):
+    if not(d.getVar('PTEST_ENABLED') == "1"):
         for i in ['do_configure_ptest_base', 'do_compile_ptest_base', 'do_install_ptest_base']:
             bb.build.deltask(i, d)
 }
diff --git a/import-layers/yocto-poky/meta/classes/qemu.bbclass b/import-layers/yocto-poky/meta/classes/qemu.bbclass
index f2d4d1c..f5c5780 100644
--- a/import-layers/yocto-poky/meta/classes/qemu.bbclass
+++ b/import-layers/yocto-poky/meta/classes/qemu.bbclass
@@ -4,12 +4,12 @@
 #
 
 def qemu_target_binary(data):
-    package_arch = data.getVar("PACKAGE_ARCH", True)
-    qemu_target_binary = (data.getVar("QEMU_TARGET_BINARY_%s" % package_arch, True) or "")
+    package_arch = data.getVar("PACKAGE_ARCH")
+    qemu_target_binary = (data.getVar("QEMU_TARGET_BINARY_%s" % package_arch) or "")
     if qemu_target_binary:
         return qemu_target_binary
 
-    target_arch = data.getVar("TARGET_ARCH", True)
+    target_arch = data.getVar("TARGET_ARCH")
     if target_arch in ("i486", "i586", "i686"):
         target_arch = "i386"
     elif target_arch == "powerpc":
@@ -26,7 +26,7 @@
     if qemu_binary == "qemu-allarch":
         qemu_binary = "qemuwrapper"
 
-    qemu_options = data.getVar("QEMU_OPTIONS", True)    
+    qemu_options = data.getVar("QEMU_OPTIONS")    
 
     return "PSEUDO_UNLOAD=1 " + qemu_binary + " " + qemu_options + " -L " + rootfs_path\
             + " -E LD_LIBRARY_PATH=" + ":".join(library_paths) + " "
@@ -52,7 +52,7 @@
 # this dance). For others (e.g. arm) a -cpu option is not necessary, since the
 # qemu-arm default CPU supports all required architecture levels.
 
-QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH', True), True) or ""}"
+QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) or ""}"
 QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
 
 QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
diff --git a/import-layers/yocto-poky/meta/classes/qemuboot.bbclass b/import-layers/yocto-poky/meta/classes/qemuboot.bbclass
index b5cc93d..3468d1c 100644
--- a/import-layers/yocto-poky/meta/classes/qemuboot.bbclass
+++ b/import-layers/yocto-poky/meta/classes/qemuboot.bbclass
@@ -3,30 +3,52 @@
 # boot by runqemu:
 #
 # QB_SYSTEM_NAME: qemu name, e.g., "qemu-system-i386"
+#
 # QB_OPT_APPEND: options to append to qemu, e.g., "-show-cursor"
+#
 # QB_DEFAULT_KERNEL: default kernel to boot, e.g., "bzImage"
+#
 # QB_DEFAULT_FSTYPE: default FSTYPE to boot, e.g., "ext4"
+#
 # QB_MEM: memory, e.g., "-m 512"
+#
 # QB_MACHINE: qemu machine, e.g., "-machine virt"
+#
 # QB_CPU: qemu cpu, e.g., "-cpu qemu32"
+#
 # QB_CPU_KVM: the similar to QB_CPU, but used when kvm, e.g., '-cpu kvm64',
 #             set it when support kvm.
+#
 # QB_KERNEL_CMDLINE_APPEND: options to append to kernel's -append
 #                           option, e.g., "console=ttyS0 console=tty"
+#
 # QB_DTB: qemu dtb name
+#
 # QB_AUDIO_DRV: qemu audio driver, e.g., "alsa", set it when support audio
+#
 # QB_AUDIO_OPT: qemu audio option, e.g., "-soundhw ac97,es1370", used
 #               when QB_AUDIO_DRV is set.
+#
 # QB_KERNEL_ROOT: kernel's root, e.g., /dev/vda
+#
+# QB_NETWORK_DEVICE: network device, e.g., "-device virtio-net-pci,netdev=net0,mac=@MAC@",
+#                    it needs work with QB_TAP_OPT and QB_SLIRP_OPT.
+#                    Note, runqemu will replace @MAC@ with a predefined mac, you can set
+#                    a custom one, but that may cause conflicts when multiple qemus are
+#                    running on the same host.
+#
 # QB_TAP_OPT: netowrk option for 'tap' mode, e.g.,
-#             "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -device virtio-net-device,netdev=net0"
+#             "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
 #              Note, runqemu will replace "@TAP@" with the one which is used, such as tap0, tap1 ...
-# QB_SLIRP_OPT: network option for SLIRP mode, e.g.,
-#             "-netdev user,id=net0 -device virtio-net-device,netdev=net0"
+#
+# QB_SLIRP_OPT: network option for SLIRP mode, e.g., -netdev user,id=net0"
+#
 # QB_ROOTFS_OPT: used as rootfs, e.g.,
 #               "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
 #              Note, runqemu will replace "@ROOTFS@" with the one which is used, such as core-image-minimal-qemuarm64.ext4.
+#
 # QB_SERIAL_OPT: serial port, e.g., "-serial mon:stdio"
+#
 # QB_TCPSERIAL_OPT: tcp serial port option, e.g.,
 #                   " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
 #                   Note, runqemu will replace "@PORT@" with the port number which is used.
@@ -40,36 +62,53 @@
 QB_DEFAULT_KERNEL ?= "${KERNEL_IMAGETYPE}"
 QB_DEFAULT_FSTYPE ?= "ext4"
 QB_OPT_APPEND ?= "-show-cursor"
+QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@"
+
+# This should be kept align with ROOT_VM
+QB_DRIVE_TYPE ?= "/dev/sd"
 
 # Create qemuboot.conf
-ROOTFS_POSTPROCESS_COMMAND += "write_qemuboot_conf; "
+addtask do_write_qemuboot_conf after do_rootfs before do_image
+IMGDEPLOYDIR ?= "${WORKDIR}/deploy-${PN}-image-complete"
 
-python write_qemuboot_conf() {
+def qemuboot_vars(d):
+    build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',
+                'KERNEL_IMAGETYPE', 'IMAGE_NAME', 'IMAGE_LINK_NAME',
+                'STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE',
+                'STAGING_DIR_HOST']
+    return build_vars + [k for k in d.keys() if k.startswith('QB_')]
+
+do_write_qemuboot_conf[vardeps] += "${@' '.join(qemuboot_vars(d))}"
+do_write_qemuboot_conf[vardepsexclude] += "TOPDIR"
+python do_write_qemuboot_conf() {
     import configparser
 
-    build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE', \
-                'KERNEL_IMAGETYPE', 'IMAGE_NAME', 'IMAGE_LINK_NAME', \
-                'STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE', \
-                'STAGING_DIR_HOST']
-
-    # Vars from bsp
-    qb_vars = []
-    for k in d.keys():
-        if k.startswith('QB_'):
-            qb_vars.append(k)
-
-    qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_NAME', True))
-    qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_LINK_NAME', True))
+    qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_NAME'))
+    qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_LINK_NAME'))
+    topdir="%s/"%(d.getVar('TOPDIR')).replace("//","/")
     cf = configparser.ConfigParser()
     cf.add_section('config_bsp')
-    for k in build_vars + qb_vars:
-        cf.set('config_bsp', k, '%s' % d.getVar(k, True))
+    for k in qemuboot_vars(d):
+        # qemu-helper-native sysroot is not removed by rm_work and
+        # contains all tools required by runqemu
+        if k == 'STAGING_BINDIR_NATIVE':
+            val = os.path.join(d.getVar('BASE_WORKDIR'), d.getVar('BUILD_SYS'),
+                               'qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/')
+        else:
+            val = d.getVar(k)
+        # we only want to write out relative paths so that we can relocate images
+        # and still run them
+        val=val.replace(topdir,"")
+        cf.set('config_bsp', k, '%s' % val)
 
     # QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink
     # to the kernel file, which hinders relocatability of the qb conf.
     # Read the link and replace it with the full filename of the target.
-    kernel_link = os.path.join(d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('QB_DEFAULT_KERNEL', True))
+    kernel_link = os.path.join(d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('QB_DEFAULT_KERNEL'))
     kernel = os.path.realpath(kernel_link)
+    # we only want to write out relative paths so that we can relocate images
+    # and still run them
+    kernel=kernel.replace(topdir,"")
     cf.set('config_bsp', 'QB_DEFAULT_KERNEL', kernel)
 
     bb.utils.mkdirhier(os.path.dirname(qemuboot))
diff --git a/import-layers/yocto-poky/meta/classes/recipe_sanity.bbclass b/import-layers/yocto-poky/meta/classes/recipe_sanity.bbclass
index add34df..7fa4a84 100644
--- a/import-layers/yocto-poky/meta/classes/recipe_sanity.bbclass
+++ b/import-layers/yocto-poky/meta/classes/recipe_sanity.bbclass
@@ -1,5 +1,5 @@
 def __note(msg, d):
-    bb.note("%s: recipe_sanity: %s" % (d.getVar("P", True), msg))
+    bb.note("%s: recipe_sanity: %s" % (d.getVar("P"), msg))
 
 __recipe_sanity_badruntimevars = "RDEPENDS RPROVIDES RRECOMMENDS RCONFLICTS"
 def bad_runtime_vars(cfgdata, d):
@@ -7,7 +7,7 @@
             bb.data.inherits_class("cross", d):
         return
 
-    for var in d.getVar("__recipe_sanity_badruntimevars", True).split():
+    for var in d.getVar("__recipe_sanity_badruntimevars").split():
         val = d.getVar(var, False)
         if val and val != cfgdata.get(var):
             __note("%s should be %s_${PN}" % (var, var), d)
@@ -15,11 +15,11 @@
 __recipe_sanity_reqvars = "DESCRIPTION"
 __recipe_sanity_reqdiffvars = ""
 def req_vars(cfgdata, d):
-    for var in d.getVar("__recipe_sanity_reqvars", True).split():
+    for var in d.getVar("__recipe_sanity_reqvars").split():
         if not d.getVar(var, False):
             __note("%s should be set" % var, d)
 
-    for var in d.getVar("__recipe_sanity_reqdiffvars", True).split():
+    for var in d.getVar("__recipe_sanity_reqdiffvars").split():
         val = d.getVar(var, False)
         cfgval = cfgdata.get(var)
 
@@ -38,11 +38,11 @@
 def incorrect_nonempty_PACKAGES(cfgdata, d):
     if bb.data.inherits_class("native", d) or \
             bb.data.inherits_class("cross", d):
-        if d.getVar("PACKAGES", True):
+        if d.getVar("PACKAGES"):
             return True
 
 def can_use_autotools_base(cfgdata, d):
-    cfg = d.getVar("do_configure", True)
+    cfg = d.getVar("do_configure")
     if not bb.data.inherits_class("autotools", d):
         return False
 
@@ -61,7 +61,7 @@
     expected = cfgdata.get("FILESPATH")
     expectedpaths = d.expand(expected)
     unexpanded = d.getVar("FILESPATH", False)
-    filespath = d.getVar("FILESPATH", True).split(":")
+    filespath = d.getVar("FILESPATH").split(":")
     filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)]
     for fp in filespath:
         if not fp in expectedpaths:
@@ -70,22 +70,6 @@
             return False
     return expected != unexpanded
 
-def can_delete_FILESDIR(cfgdata, d):
-    expected = cfgdata.get("FILESDIR")
-    #expected = "${@bb.utils.which(d.getVar('FILESPATH', True), '.')}"
-    unexpanded = d.getVar("FILESDIR", False)
-    if unexpanded is None:
-        return False
-
-    expanded = os.path.normpath(d.getVar("FILESDIR", True))
-    filespath = d.getVar("FILESPATH", True).split(":")
-    filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)]
-
-    return unexpanded != expected and \
-           os.path.exists(expanded) and \
-           (expanded in filespath or
-            expanded == d.expand(expected))
-
 def can_delete_others(p, cfgdata, d):
     for k in ["S", "PV", "PN", "DESCRIPTION", "DEPENDS",
               "SECTION", "PACKAGES", "EXTRA_OECONF", "EXTRA_OEMAKE"]:
@@ -96,7 +80,7 @@
             continue
 
         try:
-            expanded = d.getVar(k, True)
+            expanded = d.getVar(k)
             cfgexpanded = d.expand(cfgunexpanded)
         except bb.fetch.ParameterError:
             continue
@@ -108,11 +92,10 @@
                        (p, cfgunexpanded, unexpanded, expanded))
 
 python do_recipe_sanity () {
-    p = d.getVar("P", True)
-    p = "%s %s %s" % (d.getVar("PN", True), d.getVar("PV", True), d.getVar("PR", True))
+    p = d.getVar("P")
+    p = "%s %s %s" % (d.getVar("PN"), d.getVar("PV"), d.getVar("PR"))
 
     sanitychecks = [
-        (can_delete_FILESDIR, "candidate for removal of FILESDIR"),
         (can_delete_FILESPATH, "candidate for removal of FILESPATH"),
         #(can_use_autotools_base, "candidate for use of autotools_base"),
         (incorrect_nonempty_PACKAGES, "native or cross recipe with non-empty PACKAGES"),
diff --git a/import-layers/yocto-poky/meta/classes/relative_symlinks.bbclass b/import-layers/yocto-poky/meta/classes/relative_symlinks.bbclass
new file mode 100644
index 0000000..3157737
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/relative_symlinks.bbclass
@@ -0,0 +1,5 @@
+do_install[postfuncs] += "install_relative_symlinks"
+
+python install_relative_symlinks () {
+    oe.path.replace_absolute_symlinks(d.getVar('D'), d)
+}
diff --git a/import-layers/yocto-poky/meta/classes/relocatable.bbclass b/import-layers/yocto-poky/meta/classes/relocatable.bbclass
index 4ca9981..582812c 100644
--- a/import-layers/yocto-poky/meta/classes/relocatable.bbclass
+++ b/import-layers/yocto-poky/meta/classes/relocatable.bbclass
@@ -1,7 +1,18 @@
 inherit chrpath
 
-SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess"
+SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles"
 
 python relocatable_binaries_preprocess() {
     rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
 }
+
+relocatable_native_pcfiles () {
+	if [ -d ${SYSROOT_DESTDIR}${libdir}/pkgconfig ]; then
+		rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('libdir') + "/pkgconfig")}
+		sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${libdir}/pkgconfig/*.pc
+	fi
+	if [ -d ${SYSROOT_DESTDIR}${datadir}/pkgconfig ]; then
+		rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('datadir') + "/pkgconfig")}
+		sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${datadir}/pkgconfig/*.pc
+	fi
+}
diff --git a/import-layers/yocto-poky/meta/classes/report-error.bbclass b/import-layers/yocto-poky/meta/classes/report-error.bbclass
index 5bb231e..d6fdd36 100644
--- a/import-layers/yocto-poky/meta/classes/report-error.bbclass
+++ b/import-layers/yocto-poky/meta/classes/report-error.bbclass
@@ -10,7 +10,7 @@
 
 def errorreport_getdata(e):
     import codecs
-    logpath = e.data.getVar('ERR_REPORT_DIR', True)
+    logpath = e.data.getVar('ERR_REPORT_DIR')
     datafile = os.path.join(logpath, "error-report.txt")
     with codecs.open(datafile, 'r', 'utf-8') as f:
         data = f.read()
@@ -19,7 +19,7 @@
 def errorreport_savedata(e, newdata, file):
     import json
     import codecs
-    logpath = e.data.getVar('ERR_REPORT_DIR', True)
+    logpath = e.data.getVar('ERR_REPORT_DIR')
     datafile = os.path.join(logpath, file)
     with codecs.open(datafile, 'w', 'utf-8') as f:
         json.dump(newdata, f, indent=4, sort_keys=True)
@@ -29,18 +29,18 @@
         import json
         import codecs
 
-        logpath = e.data.getVar('ERR_REPORT_DIR', True)
+        logpath = e.data.getVar('ERR_REPORT_DIR')
         datafile = os.path.join(logpath, "error-report.txt")
 
         if isinstance(e, bb.event.BuildStarted):
             bb.utils.mkdirhier(logpath)
             data = {}
-            machine = e.data.getVar("MACHINE", True)
+            machine = e.data.getVar("MACHINE")
             data['machine'] = machine
-            data['build_sys'] = e.data.getVar("BUILD_SYS", True)
-            data['nativelsb'] = e.data.getVar("NATIVELSBSTRING", True)
-            data['distro'] = e.data.getVar("DISTRO", True)
-            data['target_sys'] = e.data.getVar("TARGET_SYS", True)
+            data['build_sys'] = e.data.getVar("BUILD_SYS")
+            data['nativelsb'] = e.data.getVar("NATIVELSBSTRING")
+            data['distro'] = e.data.getVar("DISTRO")
+            data['target_sys'] = e.data.getVar("TARGET_SYS")
             data['failures'] = []
             data['component'] = " ".join(e.getPkgs())
             data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data))
@@ -51,7 +51,7 @@
         elif isinstance(e, bb.build.TaskFailed):
             task = e.task
             taskdata={}
-            log = e.data.getVar('BB_LOGFILE', True)
+            log = e.data.getVar('BB_LOGFILE')
             taskdata['package'] = e.data.expand("${PF}")
             taskdata['task'] = task
             if log:
@@ -61,7 +61,7 @@
 
                     # Replace host-specific paths so the logs are cleaner
                     for d in ("TOPDIR", "TMPDIR"):
-                        s = e.data.getVar(d, True)
+                        s = e.data.getVar(d)
                         if s:
                             logdata = logdata.replace(s, d)
 
@@ -92,7 +92,7 @@
             bb.utils.unlockfile(lock)
             failures = jsondata['failures']
             if(len(failures) > 0):
-                filename = "error_report_" + e.data.getVar("BUILDNAME", True)+".txt"
+                filename = "error_report_" + e.data.getVar("BUILDNAME")+".txt"
                 datafile = errorreport_savedata(e, jsondata, filename)
                 bb.note("The errors for this build are stored in %s\nYou can send the errors to a reports server by running:\n  send-error-report %s [-s server]" % (datafile, datafile))
                 bb.note("The contents of these logs will be posted in public if you use the above command with the default server. Please ensure you remove any identifying or proprietary information when prompted before sending.")
diff --git a/import-layers/yocto-poky/meta/classes/rm_work.bbclass b/import-layers/yocto-poky/meta/classes/rm_work.bbclass
index 64b6981..badeaeb 100644
--- a/import-layers/yocto-poky/meta/classes/rm_work.bbclass
+++ b/import-layers/yocto-poky/meta/classes/rm_work.bbclass
@@ -10,6 +10,14 @@
 #
 # RM_WORK_EXCLUDE += "icu-native icu busybox"
 #
+# Recipes can also configure which entries in their ${WORKDIR}
+# are preserved besides temp, which already gets excluded by default
+# because it contains logs:
+# do_install_append () {
+#     echo "bar" >${WORKDIR}/foo
+# }
+# RM_WORK_EXCLUDE_ITEMS += "foo"
+RM_WORK_EXCLUDE_ITEMS = "temp"
 
 # Use the completion scheduler by default when rm_work is active
 # to try and reduce disk usage
@@ -18,9 +26,6 @@
 # Run the rm_work task in the idle scheduling class
 BB_TASK_IONICE_LEVEL_task-rm_work = "3.0"
 
-RMWORK_ORIG_TASK := "${BB_DEFAULT_TASK}"
-BB_DEFAULT_TASK = "rm_work_all"
-
 do_rm_work () {
     # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe.
     for p in ${RM_WORK_EXCLUDE}; do
@@ -37,7 +42,7 @@
         # failures of removing pseudo folers on NFS2/3 server.
         if [ $dir = 'pseudo' ]; then
             rm -rf $dir 2> /dev/null || true
-        elif [ $dir != 'temp' ]; then
+        elif ! echo '${RM_WORK_EXCLUDE_ITEMS}' | grep -q -w "$dir"; then
             rm -rf $dir
         fi
     done
@@ -66,7 +71,7 @@
                 i=dummy
                 break
                 ;;
-            *do_rootfs*|*do_image*|*do_bootimg*|*do_bootdirectdisk*|*do_vmimg*)
+            *do_rootfs*|*do_image*|*do_bootimg*|*do_bootdirectdisk*|*do_vmimg*|*do_write_qemuboot_conf*)
                 i=dummy
                 break
                 ;;
@@ -97,13 +102,12 @@
         rm -f $i
     done
 }
-addtask rm_work after do_${RMWORK_ORIG_TASK}
-
 do_rm_work_all () {
     :
 }
 do_rm_work_all[recrdeptask] = "do_rm_work"
-addtask rm_work_all after do_rm_work
+do_rm_work_all[noexec] = "1"
+addtask rm_work_all after before do_build
 
 do_populate_sdk[postfuncs] += "rm_work_populatesdk"
 rm_work_populatesdk () {
@@ -117,13 +121,52 @@
 }
 rm_work_rootfs[cleandirs] = "${WORKDIR}/rootfs"
 
-python () {
+# This task can be used instead of do_build to trigger building
+# without also invoking do_rm_work. It only exists when rm_work.bbclass
+# is active, otherwise do_build needs to be used.
+#
+# The intended usage is
+# ${@ d.getVar('RM_WORK_BUILD_WITHOUT') or 'do_build'}
+# in places that previously used just 'do_build'.
+RM_WORK_BUILD_WITHOUT = "do_build_without_rm_work"
+do_build_without_rm_work () {
+    :
+}
+do_build_without_rm_work[noexec] = "1"
+
+# We have to add these tasks already now, because all tasks are
+# meant to be defined before the RecipeTaskPreProcess event triggers.
+# The inject_rm_work event handler then merely changes task dependencies.
+addtask do_rm_work
+addtask do_build_without_rm_work
+addhandler inject_rm_work
+inject_rm_work[eventmask] = "bb.event.RecipeTaskPreProcess"
+python inject_rm_work() {
     if bb.data.inherits_class('kernel', d):
-        d.appendVar("RM_WORK_EXCLUDE", ' ' + d.getVar("PN", True))
+        d.appendVar("RM_WORK_EXCLUDE", ' ' + d.getVar("PN"))
     # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe.
-    excludes = (d.getVar("RM_WORK_EXCLUDE", True) or "").split()
-    pn = d.getVar("PN", True)
+    excludes = (d.getVar("RM_WORK_EXCLUDE") or "").split()
+    pn = d.getVar("PN")
+
+    # Determine what do_build depends upon, without including do_build
+    # itself or our own special do_rm_work_all.
+    deps = set(bb.build.preceedtask('do_build', True, d))
+    deps.difference_update(('do_build', 'do_rm_work_all'))
+
     if pn in excludes:
         d.delVarFlag('rm_work_rootfs', 'cleandirs')
         d.delVarFlag('rm_work_populatesdk', 'cleandirs')
+    else:
+        # Inject do_rm_work into the tasks of the current recipe such that do_build
+        # depends on it and that it runs after all other tasks that block do_build,
+        # i.e. after all work on the current recipe is done. The reason for taking
+        # this approach instead of making do_rm_work depend on do_build is that
+        # do_build inherits additional runtime dependencies on
+        # other recipes and thus will typically run much later than completion of
+        # work in the recipe itself.
+        # In practice, addtask() here merely updates the dependencies.
+        bb.build.addtask('do_rm_work', 'do_build', ' '.join(deps), d)
+
+    # Always update do_build_without_rm_work dependencies.
+    bb.build.addtask('do_build_without_rm_work', '', ' '.join(deps), d)
 }
diff --git a/import-layers/yocto-poky/meta/classes/rm_work_and_downloads.bbclass b/import-layers/yocto-poky/meta/classes/rm_work_and_downloads.bbclass
new file mode 100644
index 0000000..7c00bea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/rm_work_and_downloads.bbclass
@@ -0,0 +1,33 @@
+# Author:       Patrick Ohly <patrick.ohly@intel.com>
+# Copyright:    Copyright (C) 2015 Intel Corporation
+#
+# This file is licensed under the MIT license, see COPYING.MIT in
+# this source distribution for the terms.
+
+# This class is used like rm_work:
+# INHERIT += "rm_work_and_downloads"
+#
+# In addition to removing local build directories of a recipe, it also
+# removes the downloaded source. This is achieved by making the DL_DIR
+# recipe-specific. While reducing disk usage, it increases network usage (for
+# example, compiling the same source for target and host implies downloading
+# the source twice).
+#
+# Because the "do_fetch" task does not get re-run after removing the downloaded
+# sources, this class is also not suitable for incremental builds.
+#
+# Where it works well is in well-connected build environments with limited
+# disk space (like TravisCI).
+
+inherit rm_work
+
+# This would ensure that the existing do_rm_work() removes the downloads,
+# but does not work because some recipes have a circular dependency between
+# WORKDIR and DL_DIR (via ${SRCPV}?).
+# DL_DIR = "${WORKDIR}/downloads"
+
+# Instead go up one level and remove ourself.
+DL_DIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/downloads"
+do_rm_work_append () {
+    rm -rf ${DL_DIR}
+}
diff --git a/import-layers/yocto-poky/meta/classes/rootfs-postcommands.bbclass b/import-layers/yocto-poky/meta/classes/rootfs-postcommands.bbclass
index 0c7ceea..c19ff87 100644
--- a/import-layers/yocto-poky/meta/classes/rootfs-postcommands.bbclass
+++ b/import-layers/yocto-poky/meta/classes/rootfs-postcommands.bbclass
@@ -14,6 +14,9 @@
 # Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled
 ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}'
 
+# Generates test data file with data store variables expanded in json format
+ROOTFS_POSTPROCESS_COMMAND += "write_image_test_data ; "
+
 # Write manifest
 IMAGE_MANIFEST = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.manifest"
 ROOTFS_POSTUNINSTALL_COMMAND =+ "write_image_manifest ; "
@@ -30,6 +33,23 @@
 SSH_DISABLE_DNS_LOOKUP ?= " ssh_disable_dns_lookup ; "
 ROOTFS_POSTPROCESS_COMMAND_append_qemuall = "${SSH_DISABLE_DNS_LOOKUP}"
 
+# Sort the user and group entries in /etc by ID in order to make the content
+# deterministic. Package installs are not deterministic, causing the ordering
+# of entries to change between builds. In case that this isn't desired,
+# the command can be overridden.
+#
+# Note that useradd-staticids.bbclass has to be used to ensure that
+# the numeric IDs of dynamically created entries remain stable.
+#
+# We want this to run as late as possible, in particular after
+# systemd_sysusers_create and set_user_group. Using _append is not
+# enough for that, set_user_group is added that way and would end
+# up running after us.
+SORT_PASSWD_POSTPROCESS_COMMAND ??= " sort_passwd; "
+python () {
+    d.appendVar('ROOTFS_POSTPROCESS_COMMAND', '${SORT_PASSWD_POSTPROCESS_COMMAND}')
+}
+
 systemd_create_users () {
 	for conffile in ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do
 		[ -e $conffile ] || continue
@@ -71,10 +91,10 @@
 	# and the keys under /var/run/ssh.
 	if [ -d ${IMAGE_ROOTFS}/etc/ssh ]; then
 		if [ -e ${IMAGE_ROOTFS}/etc/ssh/ssh_host_rsa_key ]; then
-			echo "SYSCONFDIR=/etc/ssh" >> ${IMAGE_ROOTFS}/etc/default/ssh
+			echo "SYSCONFDIR=\${SYSCONFDIR:-/etc/ssh}" >> ${IMAGE_ROOTFS}/etc/default/ssh
 			echo "SSHD_OPTS=" >> ${IMAGE_ROOTFS}/etc/default/ssh
 		else
-			echo "SYSCONFDIR=/var/run/ssh" >> ${IMAGE_ROOTFS}/etc/default/ssh
+			echo "SYSCONFDIR=\${SYSCONFDIR:-/var/run/ssh}" >> ${IMAGE_ROOTFS}/etc/default/ssh
 			echo "SSHD_OPTS='-f /etc/ssh/sshd_config_readonly'" >> ${IMAGE_ROOTFS}/etc/default/ssh
 		fi
 	fi
@@ -112,7 +132,7 @@
 	if [ -e ${IMAGE_ROOTFS}/etc/passwd ]; then
 		sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/passwd
 	fi
-} 
+}
 
 #
 # allow dropbear/openssh to accept root logins and logins from accounts with an empty password string
@@ -136,7 +156,10 @@
 	fi
 
 	if [ -d ${IMAGE_ROOTFS}${sysconfdir}/pam.d ] ; then
-		sed -i 's/nullok_secure/nullok/' ${IMAGE_ROOTFS}${sysconfdir}/pam.d/*
+		for f in `find ${IMAGE_ROOTFS}${sysconfdir}/pam.d/* -type f -exec test -e {} \; -print`
+		do
+			sed -i 's/nullok_secure/nullok/' $f
+		done
 	fi
 }
 
@@ -146,6 +169,11 @@
 	fi
 }
 
+python sort_passwd () {
+    import rootfspostcommands
+    rootfspostcommands.sort_passwd(d.expand('${IMAGE_ROOTFS}${sysconfdir}'))
+}
+
 #
 # Enable postinst logging if debug-tweaks is enabled
 #
@@ -195,31 +223,13 @@
 	fi
 }
 
-insert_feed_uris () {
-	
-	echo "Building feeds for [${DISTRO}].."
-
-	for line in ${FEED_URIS}
-	do
-		# strip leading and trailing spaces/tabs, then split into name and uri
-		line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`"
-		feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`"
-		feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`"
-		
-		echo "Added $feed_name feed with URL $feed_uri"
-		
-		# insert new feed-sources
-		echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/opkg/${feed_name}-feed.conf
-	done
-}
-
 python write_image_manifest () {
     from oe.rootfs import image_list_installed_packages
     from oe.utils import format_pkg_list
 
-    deploy_dir = d.getVar('IMGDEPLOYDIR', True)
-    link_name = d.getVar('IMAGE_LINK_NAME', True)
-    manifest_name = d.getVar('IMAGE_MANIFEST', True)
+    deploy_dir = d.getVar('IMGDEPLOYDIR')
+    link_name = d.getVar('IMAGE_LINK_NAME')
+    manifest_name = d.getVar('IMAGE_MANIFEST')
 
     if not manifest_name:
         return
@@ -236,7 +246,7 @@
         os.symlink(os.path.basename(manifest_name), manifest_link)
 }
 
-# Can be use to create /etc/timestamp during image construction to give a reasonably 
+# Can be use to create /etc/timestamp during image construction to give a reasonably
 # sane default time setting
 rootfs_update_timestamp () {
 	date -u +%4Y%2m%2d%2H%2M%2S >${IMAGE_ROOTFS}/etc/timestamp
@@ -278,3 +288,33 @@
 rootfs_sysroot_relativelinks () {
 	sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT}
 }
+
+# Generated test data json file
+python write_image_test_data() {
+    from oe.data import export2json
+
+    testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_NAME'))
+    testdata_link = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))
+
+    bb.utils.mkdirhier(os.path.dirname(testdata))
+    searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
+    export2json(d, testdata,searchString=searchString,replaceString="")
+
+    if testdata_link != testdata:
+        if os.path.lexists(testdata_link):
+           os.remove(testdata_link)
+        os.symlink(os.path.basename(testdata), testdata_link)
+}
+write_image_test_data[vardepsexclude] += "TOPDIR"
+
+# Check for unsatisfied recommendations (RRECOMMENDS)
+python rootfs_log_check_recommends() {
+    log_path = d.expand("${T}/log.do_rootfs")
+    with open(log_path, 'r') as log:
+        for line in log:
+            if 'log_check' in line:
+                continue
+
+            if 'unsatisfied recommendation for' in line:
+                bb.warn('[log_check] %s: %s' % (d.getVar('PN', True), line))
+}
diff --git a/import-layers/yocto-poky/meta/classes/rootfs_deb.bbclass b/import-layers/yocto-poky/meta/classes/rootfs_deb.bbclass
index f79fca6..262e3d5 100644
--- a/import-layers/yocto-poky/meta/classes/rootfs_deb.bbclass
+++ b/import-layers/yocto-poky/meta/classes/rootfs_deb.bbclass
@@ -3,7 +3,6 @@
 #
 
 ROOTFS_PKGMANAGE = "dpkg apt"
-ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
 
 do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
 do_populate_sdk[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot bzip2-native:do_populate_sysroot"
@@ -12,9 +11,10 @@
 
 do_rootfs[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
 do_populate_sdk[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
+do_populate_sdk_ext[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
 
 python rootfs_deb_bad_recommendations() {
-    if d.getVar("BAD_RECOMMENDATIONS", True):
+    if d.getVar("BAD_RECOMMENDATIONS"):
         bb.warn("Debian package install does not support BAD_RECOMMENDATIONS")
 }
 do_rootfs[prefuncs] += "rootfs_deb_bad_recommendations"
@@ -25,7 +25,7 @@
 
 python () {
     # Map TARGET_ARCH to Debian's ideas about architectures
-    darch = d.getVar('SDK_ARCH', True)
+    darch = d.getVar('SDK_ARCH')
     if darch in ["x86", "i486", "i586", "i686", "pentium"]:
          d.setVar('DEB_SDK_ARCH', 'i386')
     elif darch == "x86_64":
diff --git a/import-layers/yocto-poky/meta/classes/rootfs_ipk.bbclass b/import-layers/yocto-poky/meta/classes/rootfs_ipk.bbclass
index d5c38fe..52b468d 100644
--- a/import-layers/yocto-poky/meta/classes/rootfs_ipk.bbclass
+++ b/import-layers/yocto-poky/meta/classes/rootfs_ipk.bbclass
@@ -7,7 +7,6 @@
 
 EXTRAOPKGCONFIG ?= ""
 ROOTFS_PKGMANAGE = "opkg ${EXTRAOPKGCONFIG}"
-ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
 
 do_rootfs[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
 do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
@@ -16,6 +15,7 @@
 
 do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
 do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock"
+do_populate_sdk_ext[lockfiles] += "${WORKDIR}/ipk.lock"
 
 OPKG_PREPROCESS_COMMANDS = ""
 
@@ -27,8 +27,8 @@
 
 python () {
 
-    if d.getVar('BUILD_IMAGES_FROM_FEEDS', True):
-        flags = d.getVarFlag('do_rootfs', 'recrdeptask', True)
+    if d.getVar('BUILD_IMAGES_FROM_FEEDS'):
+        flags = d.getVarFlag('do_rootfs', 'recrdeptask')
         flags = flags.replace("do_package_write_ipk", "")
         flags = flags.replace("do_deploy", "")
         flags = flags.replace("do_populate_sysroot", "")
diff --git a/import-layers/yocto-poky/meta/classes/rootfs_rpm.bbclass b/import-layers/yocto-poky/meta/classes/rootfs_rpm.bbclass
index 37730a7..7f305f5 100644
--- a/import-layers/yocto-poky/meta/classes/rootfs_rpm.bbclass
+++ b/import-layers/yocto-poky/meta/classes/rootfs_rpm.bbclass
@@ -2,20 +2,22 @@
 # Creates a root filesystem out of rpm packages
 #
 
-ROOTFS_PKGMANAGE = "rpm smartpm"
-ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
+ROOTFS_PKGMANAGE = "rpm dnf"
 
-# Add 100Meg of extra space for Smart
-IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("PACKAGE_INSTALL", "smartpm", " + 102400", "" ,d)}"
+# dnf is using our custom distutils, and so will fail without these
+export STAGING_INCDIR
+export STAGING_LIBDIR
 
-# Smart is python based, so be sure python-native is available to us.
-EXTRANATIVEPATH += "python-native"
+# Add 100Meg of extra space for dnf
+IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("PACKAGE_INSTALL", "dnf", " + 102400", "" ,d)}"
+
+# Dnf is python based, so be sure python3-native is available to us.
+EXTRANATIVEPATH += "python3-native"
 
 # opkg is needed for update-alternatives
 RPMROOTFSDEPENDS = "rpm-native:do_populate_sysroot \
-    rpmresolve-native:do_populate_sysroot \
-    python-smartpm-native:do_populate_sysroot \
-    createrepo-native:do_populate_sysroot \
+    dnf-native:do_populate_sysroot \
+    createrepo-c-native:do_populate_sysroot \
     opkg-native:do_populate_sysroot"
 
 do_rootfs[depends] += "${RPMROOTFSDEPENDS}"
@@ -25,8 +27,8 @@
 do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
 
 python () {
-    if d.getVar('BUILD_IMAGES_FROM_FEEDS', True):
-        flags = d.getVarFlag('do_rootfs', 'recrdeptask', True)
+    if d.getVar('BUILD_IMAGES_FROM_FEEDS'):
+        flags = d.getVarFlag('do_rootfs', 'recrdeptask')
         flags = flags.replace("do_package_write_rpm", "")
         flags = flags.replace("do_deploy", "")
         flags = flags.replace("do_populate_sysroot", "")
@@ -35,7 +37,3 @@
         d.setVar('RPM_POSTPROCESS_COMMANDS', '')
 
 }
-# Smart is python based, so be sure python-native is available to us.
-EXTRANATIVEPATH += "python-native"
-
-rpmlibdir = "/var/lib/rpm"
diff --git a/import-layers/yocto-poky/meta/classes/sanity.bbclass b/import-layers/yocto-poky/meta/classes/sanity.bbclass
index a11b581..e8064ac 100644
--- a/import-layers/yocto-poky/meta/classes/sanity.bbclass
+++ b/import-layers/yocto-poky/meta/classes/sanity.bbclass
@@ -3,10 +3,10 @@
 #
 
 SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar \
-    gzip gawk chrpath wget cpio perl file"
+    gzip gawk chrpath wget cpio perl file which"
 
 def bblayers_conf_file(d):
-    return os.path.join(d.getVar('TOPDIR', True), 'conf/bblayers.conf')
+    return os.path.join(d.getVar('TOPDIR'), 'conf/bblayers.conf')
 
 def sanity_conf_read(fn):
     with open(fn, 'r') as f:
@@ -39,8 +39,8 @@
 SANITY_LOCALCONF_SAMPLE ?= "${COREBASE}/meta*/conf/local.conf.sample"
 python oecore_update_localconf() {
     # Check we are using a valid local.conf
-    current_conf  = d.getVar('CONF_VERSION', True)
-    conf_version =  d.getVar('LOCALCONF_VERSION', True)
+    current_conf  = d.getVar('CONF_VERSION')
+    conf_version =  d.getVar('LOCALCONF_VERSION')
 
     failmsg = """Your version of local.conf was generated from an older/newer version of 
 local.conf.sample and there have been updates made to this file. Please compare the two 
@@ -59,8 +59,8 @@
 SANITY_SITECONF_SAMPLE ?= "${COREBASE}/meta*/conf/site.conf.sample"
 python oecore_update_siteconf() {
     # If we have a site.conf, check it's valid
-    current_sconf = d.getVar('SCONF_VERSION', True)
-    sconf_version = d.getVar('SITE_CONF_VERSION', True)
+    current_sconf = d.getVar('SCONF_VERSION')
+    sconf_version = d.getVar('SITE_CONF_VERSION')
 
     failmsg = """Your version of site.conf was generated from an older version of 
 site.conf.sample and there have been updates made to this file. Please compare the two 
@@ -80,8 +80,8 @@
 python oecore_update_bblayers() {
     # bblayers.conf is out of date, so see if we can resolve that
 
-    current_lconf = int(d.getVar('LCONF_VERSION', True))
-    lconf_version = int(d.getVar('LAYER_CONF_VERSION', True))
+    current_lconf = int(d.getVar('LCONF_VERSION'))
+    lconf_version = int(d.getVar('LAYER_CONF_VERSION'))
 
     failmsg = """Your version of bblayers.conf has the wrong LCONF_VERSION (has ${LCONF_VERSION}, expecting ${LAYER_CONF_VERSION}).
 Please compare your file against bblayers.conf.sample and merge any changes before continuing.
@@ -141,7 +141,7 @@
         # Handle rename of meta-yocto -> meta-poky
         # This marks the start of separate version numbers but code is needed in OE-Core
         # for the migration, one last time.
-        layers = d.getVar('BBLAYERS', True).split()
+        layers = d.getVar('BBLAYERS').split()
         layers = [ os.path.basename(path) for path in layers ]
         if 'meta-yocto' in layers:
             found = False
@@ -172,7 +172,7 @@
 }
 
 def raise_sanity_error(msg, d, network_error=False):
-    if d.getVar("SANITY_USE_EVENTS", True) == "1":
+    if d.getVar("SANITY_USE_EVENTS") == "1":
         try:
             bb.event.fire(bb.event.SanityCheckFailed(msg, network_error), d)
         except TypeError:
@@ -198,8 +198,8 @@
     return found_errors
 
 def check_toolchain_args_present(data, tune, multilib, tune_errors, which):
-    args_set = (data.getVar("TUNE_%s" % which, True) or "").split()
-    args_wanted = (data.getVar("TUNEABI_REQUIRED_%s_tune-%s" % (which, tune), True) or "").split()
+    args_set = (data.getVar("TUNE_%s" % which) or "").split()
+    args_wanted = (data.getVar("TUNEABI_REQUIRED_%s_tune-%s" % (which, tune)) or "").split()
     args_missing = []
 
     # If no args are listed/required, we are done.
@@ -226,9 +226,8 @@
         # Apply the overrides so we can look at the details.
         overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + multilib
         localdata.setVar("OVERRIDES", overrides)
-    bb.data.update_data(localdata)
     bb.debug(2, "Sanity-checking tuning '%s' (%s) features:" % (tune, multilib))
-    features = (localdata.getVar("TUNE_FEATURES_tune-%s" % tune, True) or "").split()
+    features = (localdata.getVar("TUNE_FEATURES_tune-%s" % tune) or "").split()
     if not features:
         return "Tuning '%s' has no defined features, and cannot be used." % tune
     valid_tunes = localdata.getVarFlags('TUNEVALID') or {}
@@ -248,9 +247,9 @@
             bb.debug(2, "  %s: %s" % (feature, valid_tunes[feature]))
         else:
             tune_errors.append("Feature '%s' is not defined." % feature)
-    whitelist = localdata.getVar("TUNEABI_WHITELIST", True)
+    whitelist = localdata.getVar("TUNEABI_WHITELIST")
     if whitelist:
-        tuneabi = localdata.getVar("TUNEABI_tune-%s" % tune, True)
+        tuneabi = localdata.getVar("TUNEABI_tune-%s" % tune)
         if not tuneabi:
             tuneabi = tune
         if True not in [x in whitelist.split() for x in tuneabi.split()]:
@@ -264,13 +263,13 @@
 
 def check_toolchain(data):
     tune_error_set = []
-    deftune = data.getVar("DEFAULTTUNE", True)
+    deftune = data.getVar("DEFAULTTUNE")
     tune_errors = check_toolchain_tune(data, deftune, 'default')
     if tune_errors:
         tune_error_set.append(tune_errors)
 
-    multilibs = (data.getVar("MULTILIB_VARIANTS", True) or "").split()
-    global_multilibs = (data.getVar("MULTILIB_GLOBAL_VARIANTS", True) or "").split()
+    multilibs = (data.getVar("MULTILIB_VARIANTS") or "").split()
+    global_multilibs = (data.getVar("MULTILIB_GLOBAL_VARIANTS") or "").split()
 
     if multilibs:
         seen_libs = []
@@ -282,7 +281,7 @@
                 seen_libs.append(lib)
             if not lib in global_multilibs:
                 tune_error_set.append("Multilib %s is not present in MULTILIB_GLOBAL_VARIANTS" % lib)
-            tune = data.getVar("DEFAULTTUNE_virtclass-multilib-%s" % lib, True)
+            tune = data.getVar("DEFAULTTUNE_virtclass-multilib-%s" % lib)
             if tune in seen_tunes:
                 tune_error_set.append("The tuning '%s' appears in more than one multilib." % tune)
             else:
@@ -360,27 +359,34 @@
     # URI's to check can be set in the CONNECTIVITY_CHECK_URIS variable
     # using the same syntax as for SRC_URI. If the variable is not set
     # the check is skipped
-    test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS', True) or "").split()
+    test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS') or "").split()
     retval = ""
 
+    bbn = d.getVar('BB_NO_NETWORK')
+    if bbn not in (None, '0', '1'):
+        return 'BB_NO_NETWORK should be "0" or "1", but it is "%s"' % bbn
+
     # Only check connectivity if network enabled and the
     # CONNECTIVITY_CHECK_URIS are set
-    network_enabled = not d.getVar('BB_NO_NETWORK', True)
+    network_enabled = not (bbn == '1')
     check_enabled = len(test_uris)
-    # Take a copy of the data store and unset MIRRORS and PREMIRRORS
-    data = bb.data.createCopy(d)
-    data.delVar('PREMIRRORS')
-    data.delVar('MIRRORS')
     if check_enabled and network_enabled:
+        # Take a copy of the data store and unset MIRRORS and PREMIRRORS
+        data = bb.data.createCopy(d)
+        data.delVar('PREMIRRORS')
+        data.delVar('MIRRORS')
         try:
             fetcher = bb.fetch2.Fetch(test_uris, data)
             fetcher.checkstatus()
         except Exception as err:
             # Allow the message to be configured so that users can be
             # pointed to a support mechanism.
-            msg = data.getVar('CONNECTIVITY_CHECK_MSG', True) or ""
+            msg = data.getVar('CONNECTIVITY_CHECK_MSG') or ""
             if len(msg) == 0:
-                msg = "%s. Please ensure your network is configured correctly.\n" % err
+                msg = "%s.\n" % err
+                msg += "    Please ensure your host's network is configured correctly,\n"
+                msg += "    or set BB_NO_NETWORK = \"1\" to disable network access if\n"
+                msg += "    all required sources are on local disk.\n"
             retval = msg
 
     return retval
@@ -388,7 +394,7 @@
 def check_supported_distro(sanity_data):
     from fnmatch import fnmatch
 
-    tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS', True)
+    tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS')
     if not tested_distros:
         return
 
@@ -411,17 +417,17 @@
     messages = ""
 
     # Check TUNE_ARCH is set
-    if sanity_data.getVar('TUNE_ARCH', True) == 'INVALID':
+    if sanity_data.getVar('TUNE_ARCH') == 'INVALID':
         messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n'
 
     # Check TARGET_OS is set
-    if sanity_data.getVar('TARGET_OS', True) == 'INVALID':
+    if sanity_data.getVar('TARGET_OS') == 'INVALID':
         messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n'
 
     # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS
-    pkgarchs = sanity_data.getVar('PACKAGE_ARCHS', True)
-    tunepkg = sanity_data.getVar('TUNE_PKGARCH', True)
-    defaulttune = sanity_data.getVar('DEFAULTTUNE', True)
+    pkgarchs = sanity_data.getVar('PACKAGE_ARCHS')
+    tunepkg = sanity_data.getVar('TUNE_PKGARCH')
+    defaulttune = sanity_data.getVar('DEFAULTTUNE')
     tunefound = False
     seen = {}
     dups = []
@@ -448,7 +454,7 @@
     message = ""
 
     # Check if -march not in BUILD_CFLAGS
-    if sanity_data.getVar("BUILD_CFLAGS",True).find("-march") < 0:
+    if sanity_data.getVar("BUILD_CFLAGS").find("-march") < 0:
         result = False
 
         # Construct a test file
@@ -469,7 +475,7 @@
                 result = True;
 
         if not result:
-            build_arch = sanity_data.getVar('BUILD_ARCH', True)
+            build_arch = sanity_data.getVar('BUILD_ARCH')
             status,res = oe.utils.getstatusoutput(sanity_data.expand("${BUILD_CC} -march=%s gcc_test.c -o gcc_test" % build_arch))
             if status == 0:
                 message = "BUILD_CFLAGS_append = \" -march=%s\"" % build_arch
@@ -557,15 +563,15 @@
     return None
 
 def sanity_check_conffiles(d):
-    funcs = d.getVar('BBLAYERS_CONF_UPDATE_FUNCS', True).split()
+    funcs = d.getVar('BBLAYERS_CONF_UPDATE_FUNCS').split()
     for func in funcs:
         conffile, current_version, required_version, func = func.split(":")
-        if check_conf_exists(conffile, d) and d.getVar(current_version, True) is not None and \
-                d.getVar(current_version, True) != d.getVar(required_version, True):
+        if check_conf_exists(conffile, d) and d.getVar(current_version) is not None and \
+                d.getVar(current_version) != d.getVar(required_version):
             try:
                 bb.build.exec_func(func, d, pythonexception=True)
             except NotImplementedError as e:
-                bb.fatal(e)
+                bb.fatal(str(e))
             d.setVar("BB_INVALIDCONF", True)
 
 def sanity_handle_abichanges(status, d):
@@ -574,55 +580,16 @@
     #
     import subprocess
 
-    current_abi = d.getVar('OELAYOUT_ABI', True)
-    abifile = d.getVar('SANITY_ABIFILE', True)
+    current_abi = d.getVar('OELAYOUT_ABI')
+    abifile = d.getVar('SANITY_ABIFILE')
     if os.path.exists(abifile):
         with open(abifile, "r") as f:
             abi = f.read().strip()
         if not abi.isdigit():
             with open(abifile, "w") as f:
                 f.write(current_abi)
-        elif abi == "2" and current_abi == "3":
-            bb.note("Converting staging from layout version 2 to layout version 3")
-            subprocess.call(d.expand("mv ${TMPDIR}/staging ${TMPDIR}/sysroots"), shell=True)
-            subprocess.call(d.expand("ln -s sysroots ${TMPDIR}/staging"), shell=True)
-            subprocess.call(d.expand("cd ${TMPDIR}/stamps; for i in */*do_populate_staging; do new=`echo $i | sed -e 's/do_populate_staging/do_populate_sysroot/'`; mv $i $new; done"), shell=True)
-            with open(abifile, "w") as f:
-                f.write(current_abi)
-        elif abi == "3" and current_abi == "4":
-            bb.note("Converting staging layout from version 3 to layout version 4")
-            if os.path.exists(d.expand("${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS}")):
-                subprocess.call(d.expand("mv ${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS} ${STAGING_BINDIR_CROSS}"), shell=True)
-                subprocess.call(d.expand("ln -s ${STAGING_BINDIR_CROSS} ${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS}"), shell=True)
-            with open(abifile, "w") as f:
-                f.write(current_abi)
-        elif abi == "4":
-            status.addresult("Staging layout has changed. The cross directory has been deprecated and cross packages are now built under the native sysroot.\nThis requires a rebuild.\n")
-        elif abi == "5" and current_abi == "6":
-            bb.note("Converting staging layout from version 5 to layout version 6")
-            subprocess.call(d.expand("mv ${TMPDIR}/pstagelogs ${SSTATE_MANIFESTS}"), shell=True)
-            with open(abifile, "w") as f:
-                f.write(current_abi)
-        elif abi == "7" and current_abi == "8":
-            status.addresult("Your configuration is using stamp files including the sstate hash but your build directory was built with stamp files that do not include this.\nTo continue, either rebuild or switch back to the OEBasic signature handler with BB_SIGNATURE_HANDLER = 'OEBasic'.\n")
-        elif (abi != current_abi and current_abi == "9"):
-            status.addresult("The layout of the TMPDIR STAMPS directory has changed. Please clean out TMPDIR and rebuild (sstate will be still be valid and reused)\n")
-        elif (abi != current_abi and current_abi == "10" and (abi == "8" or abi == "9")):
-            bb.note("Converting staging layout from version 8/9 to layout version 10")
-            cmd = d.expand("grep -r -l sysroot-providers/virtual_kernel ${SSTATE_MANIFESTS}")
-            ret, result = oe.utils.getstatusoutput(cmd)
-            result = result.split()
-            for f in result:
-                bb.note("Uninstalling manifest file %s" % f)
-                sstate_clean_manifest(f, d)
-            with open(abifile, "w") as f:
-                f.write(current_abi)
-        elif abi == "10" and current_abi == "11":
-            bb.note("Converting staging layout from version 10 to layout version 11")
-            # Files in xf86-video-modesetting moved to xserver-xorg and bitbake can't currently handle that:
-            subprocess.call(d.expand("rm ${TMPDIR}/sysroots/*/usr/lib/xorg/modules/drivers/modesetting_drv.so ${TMPDIR}/sysroots/*/pkgdata/runtime/xf86-video-modesetting* ${TMPDIR}/sysroots/*/pkgdata/runtime-reverse/xf86-video-modesetting* ${TMPDIR}/sysroots/*/pkgdata/shlibs2/xf86-video-modesetting*"), shell=True)
-            with open(abifile, "w") as f:
-                f.write(current_abi)
+        elif int(abi) <= 11 and current_abi == "12":
+            status.addresult("The layout of TMPDIR changed for Recipe Specific Sysroots.\nConversion doesn't make sense and this change will rebuild everything so please delete TMPDIR (%s).\n" % d.getVar("TMPDIR"))
         elif (abi != current_abi):
             # Code to convert from one ABI to another could go here if possible.
             status.addresult("Error, TMPDIR has changed its layout version number (%s to %s) and you need to either rebuild, revert or adjust it at your own risk.\n" % (abi, current_abi))
@@ -670,12 +637,12 @@
         missing = missing + "GNU make,"
 
     if not check_app_exists('${BUILD_CC}', d):
-        missing = missing + "C Compiler (%s)," % d.getVar("BUILD_CC", True)
+        missing = missing + "C Compiler (%s)," % d.getVar("BUILD_CC")
 
     if not check_app_exists('${BUILD_CXX}', d):
-        missing = missing + "C++ Compiler (%s)," % d.getVar("BUILD_CXX", True)
+        missing = missing + "C++ Compiler (%s)," % d.getVar("BUILD_CXX")
 
-    required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES', True)
+    required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES')
 
     for util in required_utilities.split():
         if not check_app_exists(util, d):
@@ -685,7 +652,7 @@
         missing = missing.rstrip(',')
         status.addresult("Please install the following missing utilities: %s\n" % missing)
 
-    assume_provided = d.getVar('ASSUME_PROVIDED', True).split()
+    assume_provided = d.getVar('ASSUME_PROVIDED').split()
     # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf
     if "diffstat-native" not in assume_provided:
         status.addresult('Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n')
@@ -708,7 +675,7 @@
         status.addresult("        __sync_bool_compare_and_swap (&atomic, 2, 3);\n")
 
     # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
     status.addresult(check_create_long_filename(tmpdir, "TMPDIR"))
     tmpdirmode = os.stat(tmpdir).st_mode
     if (tmpdirmode & stat.S_ISGID):
@@ -732,7 +699,7 @@
     if netcheck:
         status.network_error = True
 
-    nolibs = d.getVar('NO32LIBS', True)
+    nolibs = d.getVar('NO32LIBS')
     if not nolibs:
         lib32path = '/lib'
         if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ):
@@ -741,7 +708,7 @@
         if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'):
             status.addresult("You have a 32-bit libc, but no 32-bit headers.  You must install the 32-bit libc headers.\n")
 
-    bbpaths = d.getVar('BBPATH', True).split(":")
+    bbpaths = d.getVar('BBPATH').split(":")
     if ("." in bbpaths or "./" in bbpaths or "" in bbpaths):
         status.addresult("BBPATH references the current directory, either through "    \
                 "an empty entry, a './' or a '.'.\n\t This is unsafe and means your "\
@@ -751,7 +718,7 @@
                 "references.\n" \
                 "Parsed BBPATH is" + str(bbpaths));
 
-    oes_bb_conf = d.getVar( 'OES_BITBAKE_CONF', True)
+    oes_bb_conf = d.getVar( 'OES_BITBAKE_CONF')
     if not oes_bb_conf:
         status.addresult('You are not using the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n')
 
@@ -786,26 +753,26 @@
 
     # Check the bitbake version meets minimum requirements
     from distutils.version import LooseVersion
-    minversion = d.getVar('BB_MIN_VERSION', True)
+    minversion = d.getVar('BB_MIN_VERSION')
     if (LooseVersion(bb.__version__) < LooseVersion(minversion)):
         status.addresult('Bitbake version %s is required and version %s was found\n' % (minversion, bb.__version__))
 
     sanity_check_locale(d)
 
-    paths = d.getVar('PATH', True).split(":")
+    paths = d.getVar('PATH').split(":")
     if "." in paths or "./" in paths or "" in paths:
         status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
 
     # Check that the DISTRO is valid, if set
     # need to take into account DISTRO renaming DISTRO
-    distro = d.getVar('DISTRO', True)
+    distro = d.getVar('DISTRO')
     if distro and distro != "nodistro":
         if not ( check_conf_exists("conf/distro/${DISTRO}.conf", d) or check_conf_exists("conf/distro/include/${DISTRO}.inc", d) ):
-            status.addresult("DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % d.getVar("DISTRO", True))
+            status.addresult("DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % d.getVar("DISTRO"))
 
     # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't 
     # set, since so much relies on it being set.
-    dldir = d.getVar('DL_DIR', True)
+    dldir = d.getVar('DL_DIR')
     if not dldir:
         status.addresult("DL_DIR is not set. Your environment is misconfigured, check that DL_DIR is set, and if the directory exists, that it is writable. \n")
     if os.path.exists(dldir) and not os.access(dldir, os.W_OK):
@@ -814,9 +781,9 @@
 
     # Check that the MACHINE is valid, if it is set
     machinevalid = True
-    if d.getVar('MACHINE', True):
+    if d.getVar('MACHINE'):
         if not check_conf_exists("conf/machine/${MACHINE}.conf", d):
-            status.addresult('Please set a valid MACHINE in your local.conf or environment\n')
+            status.addresult('MACHINE=%s is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file.\n' % (d.getVar('MACHINE')))
             machinevalid = False
         else:
             status.addresult(check_sanity_validmachine(d))
@@ -827,7 +794,7 @@
         status.addresult(check_toolchain(d))
 
     # Check that the SDKMACHINE is valid, if it is set
-    if d.getVar('SDKMACHINE', True):
+    if d.getVar('SDKMACHINE'):
         if not check_conf_exists("conf/machine-sdk/${SDKMACHINE}.conf", d):
             status.addresult('Specified SDKMACHINE value is not valid\n')
         elif d.getVar('SDK_ARCH', False) == "${BUILD_ARCH}":
@@ -840,7 +807,7 @@
         status.addresult("Please use a umask which allows a+rx and u+rwx\n")
     os.umask(omask)
 
-    if d.getVar('TARGET_ARCH', True) == "arm":
+    if d.getVar('TARGET_ARCH') == "arm":
         # This path is no longer user-readable in modern (very recent) Linux
         try:
             if os.path.exists("/proc/sys/vm/mmap_min_addr"):
@@ -853,7 +820,7 @@
         except:
             pass
 
-    oeroot = d.getVar('COREBASE', True)
+    oeroot = d.getVar('COREBASE')
     if oeroot.find('+') != -1:
         status.addresult("Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include any + characters.")
     if oeroot.find('@') != -1:
@@ -866,20 +833,18 @@
     mirror_vars = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS']
     protocols = ['http', 'ftp', 'file', 'https', \
                  'git', 'gitsm', 'hg', 'osc', 'p4', 'svn', \
-                 'bzr', 'cvs', 'npm', 'sftp', 'ssh']
+                 'bzr', 'cvs', 'npm', 'sftp', 'ssh', 's3' ]
     for mirror_var in mirror_vars:
-        mirrors = (d.getVar(mirror_var, True) or '').replace('\\n', '\n').split('\n')
-        for mirror_entry in mirrors:
-            mirror_entry = mirror_entry.strip()
-            if not mirror_entry:
-                # ignore blank lines
-                continue
+        mirrors = (d.getVar(mirror_var) or '').replace('\\n', ' ').split()
 
-            try:
-                pattern, mirror = mirror_entry.split()
-            except ValueError:
-                bb.warn('Invalid %s: %s, should be 2 members.' % (mirror_var, mirror_entry.strip()))
-                continue
+        # Split into pairs
+        if len(mirrors) % 2 != 0:
+            bb.warn('Invalid mirror variable value for %s: %s, should contain paired members.' % (mirror_var, mirrors.strip()))
+            continue
+        mirrors = list(zip(*[iter(mirrors)]*2))
+
+        for mirror_entry in mirrors:
+            pattern, mirror = mirror_entry
 
             decoded = bb.fetch2.decodeurl(pattern)
             try:
@@ -907,7 +872,7 @@
                     check_symlink(mirror_base, d)
 
     # Check that TMPDIR hasn't changed location since the last time we were run
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
     checkfile = os.path.join(tmpdir, "saved_tmpdir")
     if os.path.exists(checkfile):
         with open(checkfile, "r") as f:
@@ -946,8 +911,8 @@
 
     status = SanityStatus()
 
-    tmpdir = sanity_data.getVar('TMPDIR', True)
-    sstate_dir = sanity_data.getVar('SSTATE_DIR', True)
+    tmpdir = sanity_data.getVar('TMPDIR')
+    sstate_dir = sanity_data.getVar('SSTATE_DIR')
 
     check_symlink(sstate_dir, sanity_data)
 
@@ -971,7 +936,7 @@
 
     check_sanity_everybuild(status, sanity_data)
     
-    sanity_version = int(sanity_data.getVar('SANITY_VERSION', True) or 1)
+    sanity_version = int(sanity_data.getVar('SANITY_VERSION') or 1)
     network_error = False
     # NATIVELSBSTRING var may have been overridden with "universal", so
     # get actual host distribution id and version
diff --git a/import-layers/yocto-poky/meta/classes/sign_ipk.bbclass b/import-layers/yocto-poky/meta/classes/sign_ipk.bbclass
index a481f6d..e5057b7 100644
--- a/import-layers/yocto-poky/meta/classes/sign_ipk.bbclass
+++ b/import-layers/yocto-poky/meta/classes/sign_ipk.bbclass
@@ -29,10 +29,10 @@
 python () {
     # Check configuration
     for var in ('IPK_GPG_NAME', 'IPK_GPG_PASSPHRASE_FILE'):
-        if not d.getVar(var, True):
+        if not d.getVar(var):
             raise_sanity_error("You need to define %s in the config" % var, d)
 
-    sigtype = d.getVar("IPK_GPG_SIGNATURE_TYPE", True)
+    sigtype = d.getVar("IPK_GPG_SIGNATURE_TYPE")
     if sigtype.upper() != "ASC" and sigtype.upper() != "BIN":
         raise_sanity_error("Bad value for IPK_GPG_SIGNATURE_TYPE (%s), use either ASC or BIN" % sigtype)
 }
@@ -42,11 +42,11 @@
 
     bb.debug(1, 'Signing ipk: %s' % ipk_to_sign)
 
-    signer = get_signer(d, d.getVar('IPK_GPG_BACKEND', True))
-    sig_type = d.getVar('IPK_GPG_SIGNATURE_TYPE', True)
+    signer = get_signer(d, d.getVar('IPK_GPG_BACKEND'))
+    sig_type = d.getVar('IPK_GPG_SIGNATURE_TYPE')
     is_ascii_sig = (sig_type.upper() != "BIN")
 
     signer.detach_sign(ipk_to_sign,
-                       d.getVar('IPK_GPG_NAME', True),
-                       d.getVar('IPK_GPG_PASSPHRASE_FILE', True),
+                       d.getVar('IPK_GPG_NAME'),
+                       d.getVar('IPK_GPG_PASSPHRASE_FILE'),
                        armor=is_ascii_sig)
diff --git a/import-layers/yocto-poky/meta/classes/sign_package_feed.bbclass b/import-layers/yocto-poky/meta/classes/sign_package_feed.bbclass
index 31a6e9b..71df03b 100644
--- a/import-layers/yocto-poky/meta/classes/sign_package_feed.bbclass
+++ b/import-layers/yocto-poky/meta/classes/sign_package_feed.bbclass
@@ -31,10 +31,10 @@
 python () {
     # Check sanity of configuration
     for var in ('PACKAGE_FEED_GPG_NAME', 'PACKAGE_FEED_GPG_PASSPHRASE_FILE'):
-        if not d.getVar(var, True):
+        if not d.getVar(var):
             raise_sanity_error("You need to define %s in the config" % var, d)
 
-    sigtype = d.getVar("PACKAGE_FEED_GPG_SIGNATURE_TYPE", True)
+    sigtype = d.getVar("PACKAGE_FEED_GPG_SIGNATURE_TYPE")
     if sigtype.upper() != "ASC" and sigtype.upper() != "BIN":
         raise_sanity_error("Bad value for PACKAGE_FEED_GPG_SIGNATURE_TYPE (%s), use either ASC or BIN" % sigtype)
 }
diff --git a/import-layers/yocto-poky/meta/classes/sign_rpm.bbclass b/import-layers/yocto-poky/meta/classes/sign_rpm.bbclass
index a8ea75f..bc2e947 100644
--- a/import-layers/yocto-poky/meta/classes/sign_rpm.bbclass
+++ b/import-layers/yocto-poky/meta/classes/sign_rpm.bbclass
@@ -22,31 +22,24 @@
 
 
 python () {
-    if d.getVar('RPM_GPG_PASSPHRASE_FILE', True):
+    if d.getVar('RPM_GPG_PASSPHRASE_FILE'):
         raise_sanity_error('RPM_GPG_PASSPHRASE_FILE is replaced by RPM_GPG_PASSPHRASE', d)
     # Check configuration
     for var in ('RPM_GPG_NAME', 'RPM_GPG_PASSPHRASE'):
-        if not d.getVar(var, True):
+        if not d.getVar(var):
             raise_sanity_error("You need to define %s in the config" % var, d)
-
-    # Set the expected location of the public key
-    d.setVar('RPM_GPG_PUBKEY', os.path.join(d.getVar('STAGING_DIR_TARGET', False),
-                                            d.getVar('sysconfdir', False),
-                                            'pki',
-                                            'rpm-gpg',
-                                            'RPM-GPG-KEY-${DISTRO_VERSION}'))
 }
 
 python sign_rpm () {
     import glob
     from oe.gpg_sign import get_signer
 
-    signer = get_signer(d, d.getVar('RPM_GPG_BACKEND', True))
-    rpms = glob.glob(d.getVar('RPM_PKGWRITEDIR', True) + '/*')
+    signer = get_signer(d, d.getVar('RPM_GPG_BACKEND'))
+    rpms = glob.glob(d.getVar('RPM_PKGWRITEDIR') + '/*')
 
     signer.sign_rpms(rpms,
-                     d.getVar('RPM_GPG_NAME', True),
-                     d.getVar('RPM_GPG_PASSPHRASE', True))
+                     d.getVar('RPM_GPG_NAME'),
+                     d.getVar('RPM_GPG_PASSPHRASE'))
 }
 
 do_package_index[depends] += "signing-keys:do_deploy"
diff --git a/import-layers/yocto-poky/meta/classes/siteconfig.bbclass b/import-layers/yocto-poky/meta/classes/siteconfig.bbclass
index 45dce48..bb491d2 100644
--- a/import-layers/yocto-poky/meta/classes/siteconfig.bbclass
+++ b/import-layers/yocto-poky/meta/classes/siteconfig.bbclass
@@ -2,12 +2,12 @@
 	shared_state = sstate_state_fromvars(d)
 	if shared_state['task'] != 'populate_sysroot':
 		return
-	if not os.path.isdir(os.path.join(d.getVar('FILE_DIRNAME', True), 'site_config')):
+	if not os.path.isdir(os.path.join(d.getVar('FILE_DIRNAME'), 'site_config')):
 		bb.debug(1, "No site_config directory, skipping do_siteconfig")
 		return
+	sstate_install(shared_state, d)
 	bb.build.exec_func('do_siteconfig_gencache', d)
 	sstate_clean(shared_state, d)
-	sstate_install(shared_state, d)
 }
 
 EXTRASITECONFIG ?= ""
diff --git a/import-layers/yocto-poky/meta/classes/siteinfo.bbclass b/import-layers/yocto-poky/meta/classes/siteinfo.bbclass
index 6eca004..2c33732 100644
--- a/import-layers/yocto-poky/meta/classes/siteinfo.bbclass
+++ b/import-layers/yocto-poky/meta/classes/siteinfo.bbclass
@@ -89,6 +89,8 @@
         "mips64el-linux-musl": "mips64el-linux",
         "mips64-linux-gnun32": "mips-linux bit-32",
         "mips64el-linux-gnun32": "mipsel-linux bit-32",
+        "mipsisa64r6-linux-gnun32": "mipsisa32r6-linux bit-32",
+        "mipsisa64r6el-linux-gnun32": "mipsisa32r6el-linux bit-32",
         "powerpc-linux": "powerpc32-linux",
         "powerpc-linux-musl": "powerpc-linux powerpc32-linux",
         "powerpc-linux-uclibc": "powerpc-linux powerpc32-linux",
@@ -113,14 +115,14 @@
 
     # Add in any extra user supplied data which may come from a BSP layer, removing the
     # need to always change this class directly
-    extra_siteinfo = (d.getVar("SITEINFO_EXTRA_DATAFUNCS", True) or "").split()
+    extra_siteinfo = (d.getVar("SITEINFO_EXTRA_DATAFUNCS") or "").split()
     for m in extra_siteinfo:
         call = m + "(archinfo, osinfo, targetinfo, d)"
         locs = { "archinfo" : archinfo, "osinfo" : osinfo, "targetinfo" : targetinfo, "d" : d}
         archinfo, osinfo, targetinfo = bb.utils.better_eval(call, locs)
 
-    hostarch = d.getVar("HOST_ARCH", True)
-    hostos = d.getVar("HOST_OS", True)
+    hostarch = d.getVar("HOST_ARCH")
+    hostos = d.getVar("HOST_OS")
     target = "%s-%s" % (hostarch, hostos)
 
     sitedata = []
@@ -144,7 +146,7 @@
         d.setVar("SITEINFO_ENDIANNESS", "be")
     else:
         bb.error("Unable to determine endianness for architecture '%s'" %
-                 d.getVar("HOST_ARCH", True))
+                 d.getVar("HOST_ARCH"))
         bb.fatal("Please add your architecture to siteinfo.bbclass")
 
     if "bit-32" in sitedata:
@@ -153,14 +155,14 @@
         d.setVar("SITEINFO_BITS", "64")
     else:
         bb.error("Unable to determine bit size for architecture '%s'" %
-                 d.getVar("HOST_ARCH", True))
+                 d.getVar("HOST_ARCH"))
         bb.fatal("Please add your architecture to siteinfo.bbclass")
 }
 
 def siteinfo_get_files(d, aclocalcache = False):
     sitedata = siteinfo_data(d)
     sitefiles = ""
-    for path in d.getVar("BBPATH", True).split(":"):
+    for path in d.getVar("BBPATH").split(":"):
         for element in sitedata:
             filename = os.path.join(path, "site", element)
             if os.path.exists(filename):
@@ -177,7 +179,7 @@
     # issues and the directory being created/removed whilst this code executes. This can happen
     # when a multilib recipe is parsed along with its base variant which may be running at the time
     # causing rare but nasty failures
-    path_siteconfig = d.getVar('ACLOCALDIR', True)
+    path_siteconfig = d.getVar('ACLOCALDIR')
     if path_siteconfig and os.path.isdir(path_siteconfig):
         for i in os.listdir(path_siteconfig):
             if not i.endswith("_config"):
diff --git a/import-layers/yocto-poky/meta/classes/spdx.bbclass b/import-layers/yocto-poky/meta/classes/spdx.bbclass
index 89394d3..c5f544d 100644
--- a/import-layers/yocto-poky/meta/classes/spdx.bbclass
+++ b/import-layers/yocto-poky/meta/classes/spdx.bbclass
@@ -26,20 +26,20 @@
     import json, shutil
 
     info = {} 
-    info['workdir'] = d.getVar('WORKDIR', True)
-    info['sourcedir'] = d.getVar('SPDX_S', True)
-    info['pn'] = d.getVar('PN', True)
-    info['pv'] = d.getVar('PV', True)
-    info['spdx_version'] = d.getVar('SPDX_VERSION', True)
-    info['data_license'] = d.getVar('DATA_LICENSE', True)
+    info['workdir'] = d.getVar('WORKDIR')
+    info['sourcedir'] = d.getVar('SPDX_S')
+    info['pn'] = d.getVar('PN')
+    info['pv'] = d.getVar('PV')
+    info['spdx_version'] = d.getVar('SPDX_VERSION')
+    info['data_license'] = d.getVar('DATA_LICENSE')
 
-    sstatedir = d.getVar('SPDXSSTATEDIR', True)
+    sstatedir = d.getVar('SPDXSSTATEDIR')
     sstatefile = os.path.join(sstatedir, info['pn'] + info['pv'] + ".spdx")
 
-    manifest_dir = d.getVar('SPDX_MANIFEST_DIR', True)
+    manifest_dir = d.getVar('SPDX_MANIFEST_DIR')
     info['outfile'] = os.path.join(manifest_dir, info['pn'] + ".spdx" )
 
-    info['spdx_temp_dir'] = d.getVar('SPDX_TEMP_DIR', True)
+    info['spdx_temp_dir'] = d.getVar('SPDX_TEMP_DIR')
     info['tar_file'] = os.path.join(info['workdir'], info['pn'] + ".tar.gz" )
 
     # Make sure important dirs exist
@@ -74,9 +74,9 @@
         foss_license_info = cached_spdx['Licenses']
     else:
         ## setup fossology command
-        foss_server = d.getVar('FOSS_SERVER', True)
-        foss_flags = d.getVar('FOSS_WGET_FLAGS', True)
-        foss_full_spdx = d.getVar('FOSS_FULL_SPDX', True) == "true" or False
+        foss_server = d.getVar('FOSS_SERVER')
+        foss_flags = d.getVar('FOSS_WGET_FLAGS')
+        foss_full_spdx = d.getVar('FOSS_FULL_SPDX') == "true" or False
         foss_command = "wget %s --post-file=%s %s"\
             % (foss_flags, info['tar_file'], foss_server)
         
diff --git a/import-layers/yocto-poky/meta/classes/sstate.bbclass b/import-layers/yocto-poky/meta/classes/sstate.bbclass
index 5b92c54..0a12935 100644
--- a/import-layers/yocto-poky/meta/classes/sstate.bbclass
+++ b/import-layers/yocto-poky/meta/classes/sstate.bbclass
@@ -11,7 +11,7 @@
 SSTATE_PKGARCH    = "${PACKAGE_ARCH}"
 SSTATE_PKGSPEC    = "sstate:${PN}:${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}:${PV}:${PR}:${SSTATE_PKGARCH}:${SSTATE_VERSION}:"
 SSTATE_SWSPEC     = "sstate:${PN}::${PV}:${PR}::${SSTATE_VERSION}:"
-SSTATE_PKGNAME    = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC', True), d.getVar('BB_TASKHASH', True), d)}"
+SSTATE_PKGNAME    = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC'), d.getVar('BB_TASKHASH'), d)}"
 SSTATE_PKG        = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
 SSTATE_EXTRAPATH   = ""
 SSTATE_EXTRAPATHWILDCARD = ""
@@ -25,14 +25,15 @@
 SSTATE_EXTRAPATH[vardepvalue] = ""
 
 # For multilib rpm the allarch packagegroup files can overwrite (in theory they're identical)
-SSTATE_DUPWHITELIST = "${DEPLOY_DIR_IMAGE}/ ${DEPLOY_DIR}/licenses/ ${DEPLOY_DIR_RPM}/all/"
+SSTATE_DUPWHITELIST = "${DEPLOY_DIR_IMAGE}/ ${DEPLOY_DIR}/licenses/ ${DEPLOY_DIR_RPM}/noarch/"
 # Avoid docbook/sgml catalog warnings for now
 SSTATE_DUPWHITELIST += "${STAGING_ETCDIR_NATIVE}/sgml ${STAGING_DATADIR_NATIVE}/sgml"
 # Archive the sources for many architectures in one deploy folder
 SSTATE_DUPWHITELIST += "${DEPLOY_DIR_SRC}"
 
-SSTATE_SCAN_FILES ?= "*.la *-config *_config"
-SSTATE_SCAN_CMD ?= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES", True).split())}" \) -type f'
+SSTATE_SCAN_FILES ?= "*.la *-config *_config postinst-*"
+SSTATE_SCAN_CMD ??= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES").split())}" \) -type f'
+SSTATE_SCAN_CMD_NATIVE ??= 'grep -Irl -e ${RECIPE_SYSROOT} -e ${RECIPE_SYSROOT_NATIVE} -e ${HOSTTOOLS_DIR} ${SSTATE_BUILDDIR}'
 
 BB_HASHFILENAME = "False ${SSTATE_PKGSPEC} ${SSTATE_SWSPEC}"
 
@@ -53,7 +54,7 @@
 SSTATEPREINSTFUNCS = ""
 SSTATEPOSTUNPACKFUNCS = "sstate_hardcode_path_unpack"
 SSTATEPOSTINSTFUNCS = ""
-EXTRA_STAGING_FIXMES ?= ""
+EXTRA_STAGING_FIXMES ?= "HOSTTOOLS_DIR"
 SSTATECLEANFUNCS = ""
 
 # Check whether sstate exists for tasks that support sstate and are in the
@@ -82,7 +83,7 @@
         d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${SDK_OS}"))
     elif bb.data.inherits_class('cross-canadian', d):
         d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${PACKAGE_ARCH}"))
-    elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH", True) == "all":
+    elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH") == "all":
         d.setVar('SSTATE_PKGARCH', "allarch")
     else:
         d.setVar('SSTATE_MANMACH', d.expand("${PACKAGE_ARCH}"))
@@ -92,13 +93,7 @@
         d.setVar('BB_HASHFILENAME', "True ${SSTATE_PKGSPEC} ${SSTATE_SWSPEC}")
         d.setVar('SSTATE_EXTRAPATHWILDCARD', "*/")
 
-    # These classes encode staging paths into their scripts data so can only be
-    # reused if we manipulate the paths
-    if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d) or bb.data.inherits_class('crosssdk', d):
-        scan_cmd = "grep -Irl ${STAGING_DIR} ${SSTATE_BUILDDIR}"
-        d.setVar('SSTATE_SCAN_CMD', scan_cmd)
-
-    unique_tasks = sorted(set((d.getVar('SSTATETASKS', True) or "").split()))
+    unique_tasks = sorted(set((d.getVar('SSTATETASKS') or "").split()))
     d.setVar('SSTATETASKS', " ".join(unique_tasks))
     for task in unique_tasks:
         d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ")
@@ -116,19 +111,20 @@
 
 def sstate_state_fromvars(d, task = None):
     if task is None:
-        task = d.getVar('BB_CURRENTTASK', True)
+        task = d.getVar('BB_CURRENTTASK')
         if not task:
             bb.fatal("sstate code running without task context?!")
         task = task.replace("_setscene", "")
 
     if task.startswith("do_"):
         task = task[3:]
-    inputs = (d.getVarFlag("do_" + task, 'sstate-inputdirs', True) or "").split()
-    outputs = (d.getVarFlag("do_" + task, 'sstate-outputdirs', True) or "").split()
-    plaindirs = (d.getVarFlag("do_" + task, 'sstate-plaindirs', True) or "").split()
-    lockfiles = (d.getVarFlag("do_" + task, 'sstate-lockfile', True) or "").split()
-    lockfilesshared = (d.getVarFlag("do_" + task, 'sstate-lockfile-shared', True) or "").split()
-    interceptfuncs = (d.getVarFlag("do_" + task, 'sstate-interceptfuncs', True) or "").split()
+    inputs = (d.getVarFlag("do_" + task, 'sstate-inputdirs') or "").split()
+    outputs = (d.getVarFlag("do_" + task, 'sstate-outputdirs') or "").split()
+    plaindirs = (d.getVarFlag("do_" + task, 'sstate-plaindirs') or "").split()
+    lockfiles = (d.getVarFlag("do_" + task, 'sstate-lockfile') or "").split()
+    lockfilesshared = (d.getVarFlag("do_" + task, 'sstate-lockfile-shared') or "").split()
+    interceptfuncs = (d.getVarFlag("do_" + task, 'sstate-interceptfuncs') or "").split()
+    fixmedir = d.getVarFlag("do_" + task, 'sstate-fixmedir') or ""
     if not task or len(inputs) != len(outputs):
         bb.fatal("sstate variables not setup correctly?!")
 
@@ -144,6 +140,7 @@
     ss['lockfiles-shared'] = lockfilesshared
     ss['plaindirs'] = plaindirs
     ss['interceptfuncs'] = interceptfuncs
+    ss['fixmedir'] = fixmedir
     return ss
 
 def sstate_add(ss, source, dest, d):
@@ -193,15 +190,18 @@
                 srcdir = os.path.join(walkroot, dir)
                 dstdir = srcdir.replace(state[1], state[2])
                 #bb.debug(2, "Staging %s to %s" % (srcdir, dstdir))
+                if os.path.islink(srcdir):
+                    sharedfiles.append(dstdir)
+                    continue
                 if not dstdir.endswith("/"):
                     dstdir = dstdir + "/"
                 shareddirs.append(dstdir)
 
     # Check the file list for conflicts against files which already exist
-    whitelist = (d.getVar("SSTATE_DUPWHITELIST", True) or "").split()
+    whitelist = (d.getVar("SSTATE_DUPWHITELIST") or "").split()
     match = []
     for f in sharedfiles:
-        if os.path.exists(f):
+        if os.path.exists(f) and not os.path.islink(f):
             f = os.path.normpath(f)
             realmatch = True
             for w in whitelist:
@@ -211,25 +211,27 @@
                     break
             if realmatch:
                 match.append(f)
-                sstate_search_cmd = "grep -rl '%s' %s --exclude=master.list | sed -e 's:^.*/::' -e 's:\.populate-sysroot::'" % (f, d.expand("${SSTATE_MANIFESTS}"))
+                sstate_search_cmd = "grep -rlF '%s' %s --exclude=master.list | sed -e 's:^.*/::'" % (f, d.expand("${SSTATE_MANIFESTS}"))
                 search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
-                if search_output != "":
-                    match.append("Matched in %s" % search_output.rstrip())
+                if search_output:
+                    match.append("  (matched in %s)" % search_output.decode('utf-8').rstrip())
+                else:
+                    match.append("  (not matched to any task)")
     if match:
         bb.error("The recipe %s is trying to install files into a shared " \
           "area when those files already exist. Those files and their manifest " \
-          "location are:\n   %s\nPlease verify which recipe should provide the " \
-          "above files.\nThe build has stopped as continuing in this scenario WILL " \
-          "break things, if not now, possibly in the future (we've seen builds fail " \
+          "location are:\n  %s\nPlease verify which recipe should provide the " \
+          "above files.\n\nThe build has stopped, as continuing in this scenario WILL " \
+          "break things - if not now, possibly in the future (we've seen builds fail " \
           "several months later). If the system knew how to recover from this " \
-          "automatically it would however there are several different scenarios " \
+          "automatically it would, however there are several different scenarios " \
           "which can result in this and we don't know which one this is. It may be " \
           "you have switched providers of something like virtual/kernel (e.g. from " \
           "linux-yocto to linux-yocto-dev), in that case you need to execute the " \
           "clean task for both recipes and it will resolve this error. It may be " \
           "you changed DISTRO_FEATURES from systemd to udev or vice versa. Cleaning " \
-          "those recipes should again resolve this error however switching " \
-          "DISTRO_FEATURES on an existing build directory is not supported, you " \
+          "those recipes should again resolve this error, however switching " \
+          "DISTRO_FEATURES on an existing build directory is not supported - you " \
           "should really clean out tmp and rebuild (reusing sstate should be safe). " \
           "It could be the overlapping files detected are harmless in which case " \
           "adding them to SSTATE_DUPWHITELIST may be the correct solution. It could " \
@@ -237,9 +239,13 @@
           "things (e.g. bluez 4 and bluez 5 and the correct solution for that would " \
           "be to resolve the conflict. If in doubt, please ask on the mailing list, " \
           "sharing the error and filelist above." % \
-          (d.getVar('PN', True), "\n ".join(match)))
+          (d.getVar('PN'), "\n  ".join(match)))
         bb.fatal("If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.")
 
+    if ss['fixmedir'] and os.path.exists(ss['fixmedir'] + "/fixmepath.cmd"):
+        sharedfiles.append(ss['fixmedir'] + "/fixmepath.cmd")
+        sharedfiles.append(ss['fixmedir'] + "/fixmepath")
+
     # Write out the manifest
     f = open(manifest, "w")
     for file in sharedfiles:
@@ -258,7 +264,7 @@
 
     i = d2.expand("${SSTATE_MANIFESTS}/index-${SSTATE_MANMACH}")
     l = bb.utils.lockfile(i + ".lock")
-    filedata = d.getVar("STAMP", True) + " " + d2.getVar("SSTATE_MANFILEPREFIX", True) + " " + d.getVar("WORKDIR", True) + "\n"
+    filedata = d.getVar("STAMP") + " " + d2.getVar("SSTATE_MANFILEPREFIX") + " " + d.getVar("WORKDIR") + "\n"
     manifests = []
     if os.path.exists(i):
         with open(i, "r") as f:
@@ -273,7 +279,7 @@
         if os.path.exists(state[1]):
             oe.path.copyhardlinktree(state[1], state[2])
 
-    for postinst in (d.getVar('SSTATEPOSTINSTFUNCS', True) or '').split():
+    for postinst in (d.getVar('SSTATEPOSTINSTFUNCS') or '').split():
         # All hooks should run in the SSTATE_INSTDIR
         bb.build.exec_func(postinst, d, (sstateinst,))
 
@@ -284,20 +290,11 @@
 sstate_install[vardeps] += "${SSTATEPOSTINSTFUNCS}"
 
 def sstate_installpkg(ss, d):
-    import oe.path
-    import subprocess
     from oe.gpg_sign import get_signer
 
-    def prepdir(dir):
-        # remove dir if it exists, ensure any parent directories do exist
-        if os.path.exists(dir):
-            oe.path.remove(dir)
-        bb.utils.mkdirhier(dir)
-        oe.path.remove(dir)
-
     sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['task'])
-    sstatefetch = d.getVar('SSTATE_PKGNAME', True) + '_' + ss['task'] + ".tgz"
-    sstatepkg = d.getVar('SSTATE_PKG', True) + '_' + ss['task'] + ".tgz"
+    sstatefetch = d.getVar('SSTATE_PKGNAME') + '_' + ss['task'] + ".tgz"
+    sstatepkg = d.getVar('SSTATE_PKG') + '_' + ss['task'] + ".tgz"
 
     if not os.path.exists(sstatepkg):
         pstaging_fetch(sstatefetch, sstatepkg, d)
@@ -311,22 +308,52 @@
     d.setVar('SSTATE_INSTDIR', sstateinst)
     d.setVar('SSTATE_PKG', sstatepkg)
 
-    if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG", True), False):
+    if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False):
         signer = get_signer(d, 'local')
         if not signer.verify(sstatepkg + '.sig'):
             bb.warn("Cannot verify signature on sstate package %s" % sstatepkg)
 
-    for f in (d.getVar('SSTATEPREINSTFUNCS', True) or '').split() + ['sstate_unpack_package'] + (d.getVar('SSTATEPOSTUNPACKFUNCS', True) or '').split():
+    # Empty sstateinst directory, ensure its clean
+    if os.path.exists(sstateinst):
+        oe.path.remove(sstateinst)
+    bb.utils.mkdirhier(sstateinst)
+
+    sstateinst = d.getVar("SSTATE_INSTDIR")
+    d.setVar('SSTATE_FIXMEDIR', ss['fixmedir'])
+
+    for f in (d.getVar('SSTATEPREINSTFUNCS') or '').split() + ['sstate_unpack_package']:
         # All hooks should run in the SSTATE_INSTDIR
         bb.build.exec_func(f, d, (sstateinst,))
 
+    return sstate_installpkgdir(ss, d)
+
+def sstate_installpkgdir(ss, d):
+    import oe.path
+    import subprocess
+
+    sstateinst = d.getVar("SSTATE_INSTDIR")
+    d.setVar('SSTATE_FIXMEDIR', ss['fixmedir'])
+
+    for f in (d.getVar('SSTATEPOSTUNPACKFUNCS') or '').split():
+        # All hooks should run in the SSTATE_INSTDIR
+        bb.build.exec_func(f, d, (sstateinst,))
+
+    def prepdir(dir):
+        # remove dir if it exists, ensure any parent directories do exist
+        if os.path.exists(dir):
+            oe.path.remove(dir)
+        bb.utils.mkdirhier(dir)
+        oe.path.remove(dir)
+
     for state in ss['dirs']:
+        if d.getVar('SSTATE_SKIP_CREATION') == '1':
+            continue
         prepdir(state[1])
         os.rename(sstateinst + state[0], state[1])
     sstate_install(ss, d)
 
     for plain in ss['plaindirs']:
-        workdir = d.getVar('WORKDIR', True)
+        workdir = d.getVar('WORKDIR')
         src = sstateinst + "/" + plain.replace(workdir, '')
         dest = plain
         bb.utils.mkdirhier(src)
@@ -342,28 +369,40 @@
     # sstate_hardcode_path(d)
     import subprocess
 
-    sstateinst = d.getVar('SSTATE_INSTDIR', True)
-    fixmefn =  sstateinst + "fixmepath"
+    sstateinst = d.getVar('SSTATE_INSTDIR')
+    sstatefixmedir = d.getVar('SSTATE_FIXMEDIR')
+    fixmefn = sstateinst + "fixmepath"
     if os.path.isfile(fixmefn):
-        staging = d.getVar('STAGING_DIR', True)
-        staging_target = d.getVar('STAGING_DIR_TARGET', True)
-        staging_host = d.getVar('STAGING_DIR_HOST', True)
+        staging_target = d.getVar('RECIPE_SYSROOT')
+        staging_host = d.getVar('RECIPE_SYSROOT_NATIVE')
 
-        if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d):
-            sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIR:%s:g'" % (staging)
-        elif bb.data.inherits_class('cross', d):
-            sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIR:%s:g'" % (staging_target, staging)
-        else:
+        if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross-canadian', d):
             sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRHOST:%s:g'" % (staging_host)
+        elif bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d):
+            sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (staging_target, staging_host)
+        else:
+            sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g'" % (staging_target)
 
-        extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES', True) or ''
+        extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES') or ''
         for fixmevar in extra_staging_fixmes.split():
-            fixme_path = d.getVar(fixmevar, True)
+            fixme_path = d.getVar(fixmevar)
             sstate_sed_cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path)
 
         # Add sstateinst to each filename in fixmepath, use xargs to efficiently call sed
         sstate_hardcode_cmd = "sed -e 's:^:%s:g' %s | xargs %s" % (sstateinst, fixmefn, sstate_sed_cmd)
 
+        # Defer do_populate_sysroot relocation command
+        if sstatefixmedir:
+            bb.utils.mkdirhier(sstatefixmedir)
+            with open(sstatefixmedir + "/fixmepath.cmd", "w") as f:
+                sstate_hardcode_cmd = sstate_hardcode_cmd.replace(fixmefn, sstatefixmedir + "/fixmepath")
+                sstate_hardcode_cmd = sstate_hardcode_cmd.replace(sstateinst, "FIXMEFINALSSTATEINST")
+                sstate_hardcode_cmd = sstate_hardcode_cmd.replace(staging_host, "FIXMEFINALSSTATEHOST")
+                sstate_hardcode_cmd = sstate_hardcode_cmd.replace(staging_target, "FIXMEFINALSSTATETARGET")
+                f.write(sstate_hardcode_cmd)
+            bb.utils.copyfile(fixmefn, sstatefixmedir + "/fixmepath")
+            return
+
         bb.note("Replacing fixme paths in sstate package: %s" % (sstate_hardcode_cmd))
         subprocess.call(sstate_hardcode_cmd, shell=True)
 
@@ -375,17 +414,17 @@
 def sstate_clean_cachefile(ss, d):
     import oe.path
 
-    sstatepkgfile = d.getVar('SSTATE_PATHSPEC', True) + "*_" + ss['task'] + ".tgz*"
+    sstatepkgfile = d.getVar('SSTATE_PATHSPEC') + "*_" + ss['task'] + ".tgz*"
     bb.note("Removing %s" % sstatepkgfile)
     oe.path.remove(sstatepkgfile)
 
 def sstate_clean_cachefiles(d):
-    for task in (d.getVar('SSTATETASKS', True) or "").split():
+    for task in (d.getVar('SSTATETASKS') or "").split():
         ld = d.createCopy()
         ss = sstate_state_fromvars(ld, task)
         sstate_clean_cachefile(ss, ld)
 
-def sstate_clean_manifest(manifest, d):
+def sstate_clean_manifest(manifest, d, prefix=None):
     import oe.path
 
     mfile = open(manifest)
@@ -394,6 +433,8 @@
 
     for entry in entries:
         entry = entry.strip()
+        if prefix and not entry.startswith("/"):
+            entry = prefix + "/" + entry
         bb.debug(2, "Removing manifest: %s" % entry)
         # We can race against another package populating directories as we're removing them
         # so we ignore errors here.
@@ -404,7 +445,7 @@
                 elif os.path.exists(entry) and len(os.listdir(entry)) == 0:
                     os.rmdir(entry[:-1])
             else:
-                oe.path.remove(entry)
+                os.remove(entry)
         except OSError:
             pass
 
@@ -422,8 +463,8 @@
     import glob
 
     d2 = d.createCopy()
-    stamp_clean = d.getVar("STAMPCLEAN", True)
-    extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
+    stamp_clean = d.getVar("STAMPCLEAN")
+    extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info')
     if extrainf:
         d2.setVar("SSTATE_MANMACH", extrainf)
         wildcard_stfile = "%s.do_%s*.%s" % (stamp_clean, ss['task'], extrainf)
@@ -465,7 +506,7 @@
             oe.path.remove(stfile)
 
     # Removes the users/groups created by the package
-    for cleanfunc in (d.getVar('SSTATECLEANFUNCS', True) or '').split():
+    for cleanfunc in (d.getVar('SSTATECLEANFUNCS') or '').split():
         bb.build.exec_func(cleanfunc, d)
 
 sstate_clean[vardepsexclude] = "SSTATE_MANFILEPREFIX"
@@ -473,13 +514,13 @@
 CLEANFUNCS += "sstate_cleanall"
 
 python sstate_cleanall() {
-    bb.note("Removing shared state for package %s" % d.getVar('PN', True))
+    bb.note("Removing shared state for package %s" % d.getVar('PN'))
 
-    manifest_dir = d.getVar('SSTATE_MANIFESTS', True)
+    manifest_dir = d.getVar('SSTATE_MANIFESTS')
     if not os.path.exists(manifest_dir):
         return
 
-    tasks = d.getVar('SSTATETASKS', True).split()
+    tasks = d.getVar('SSTATETASKS').split()
     for name in tasks:
         ld = d.createCopy()
         shared_state = sstate_state_fromvars(ld, name)
@@ -495,29 +536,29 @@
     # Note: the logic in this function needs to match the reverse logic
     # in sstate_installpkg(ss, d)
 
-    staging = d.getVar('STAGING_DIR', True)
-    staging_target = d.getVar('STAGING_DIR_TARGET', True)
-    staging_host = d.getVar('STAGING_DIR_HOST', True)
-    sstate_builddir = d.getVar('SSTATE_BUILDDIR', True)
+    staging_target = d.getVar('RECIPE_SYSROOT')
+    staging_host = d.getVar('RECIPE_SYSROOT_NATIVE')
+    sstate_builddir = d.getVar('SSTATE_BUILDDIR')
 
-    if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d):
-        sstate_grep_cmd = "grep -l -e '%s'" % (staging)
-        sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIR:g'" % (staging)
-    elif bb.data.inherits_class('cross', d):
-        sstate_grep_cmd = "grep -l -e '%s' -e '%s'" % (staging_target, staging)
-        sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g; s:%s:FIXMESTAGINGDIR:g'" % (staging_target, staging)
-    else:
+    if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross-canadian', d):
         sstate_grep_cmd = "grep -l -e '%s'" % (staging_host)
         sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % (staging_host)
+    elif bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d):
+        sstate_grep_cmd = "grep -l -e '%s' -e '%s'" % (staging_target, staging_host)
+        sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g; s:%s:FIXMESTAGINGDIRHOST:g'" % (staging_target, staging_host)
+    else:
+        sstate_grep_cmd = "grep -l -e '%s'" % (staging_target)
+        sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g'" % (staging_target)
 
-    extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES', True) or ''
+    extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES') or ''
     for fixmevar in extra_staging_fixmes.split():
-        fixme_path = d.getVar(fixmevar, True)
+        fixme_path = d.getVar(fixmevar)
         sstate_sed_cmd += " -e 's:%s:FIXME_%s:g'" % (fixme_path, fixmevar)
+        sstate_grep_cmd += " -e '%s'" % (fixme_path)
 
     fixmefn =  sstate_builddir + "fixmepath"
 
-    sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True)
+    sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD')
     sstate_filelist_cmd = "tee %s" % (fixmefn)
 
     # fixmepath file needs relative paths, drop sstate_builddir prefix
@@ -532,96 +573,81 @@
     sstate_hardcode_cmd = "%s | xargs %s | %s | xargs %s %s" % (sstate_scan_cmd, sstate_grep_cmd, sstate_filelist_cmd, xargs_no_empty_run_cmd, sstate_sed_cmd)
 
     bb.note("Removing hardcoded paths from sstate package: '%s'" % (sstate_hardcode_cmd))
-    subprocess.call(sstate_hardcode_cmd, shell=True)
+    subprocess.check_output(sstate_hardcode_cmd, shell=True, cwd=sstate_builddir)
 
         # If the fixmefn is empty, remove it..
     if os.stat(fixmefn).st_size == 0:
         os.remove(fixmefn)
     else:
         bb.note("Replacing absolute paths in fixmepath file: '%s'" % (sstate_filelist_relative_cmd))
-        subprocess.call(sstate_filelist_relative_cmd, shell=True)
+        subprocess.check_output(sstate_filelist_relative_cmd, shell=True)
 }
 
 def sstate_package(ss, d):
     import oe.path
 
-    def make_relative_symlink(path, outputpath, d):
-        # Replace out absolute TMPDIR paths in symlinks with relative ones
-        if not os.path.islink(path):
-            return
-        link = os.readlink(path)
-        if not os.path.isabs(link):
-            return
-        if not link.startswith(tmpdir):
-            return
-
-        depth = outputpath.rpartition(tmpdir)[2].count('/')
-        base = link.partition(tmpdir)[2].strip()
-        while depth > 1:
-            base = "/.." + base
-            depth -= 1
-        base = "." + base
-
-        bb.debug(2, "Replacing absolute path %s with relative path %s for %s" % (link, base, outputpath))
-        os.remove(path)
-        os.symlink(base, path)
-
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
 
     sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" % ss['task'])
-    sstatepkg = d.getVar('SSTATE_PKG', True) + '_'+ ss['task'] + ".tgz"
+    sstatepkg = d.getVar('SSTATE_PKG') + '_'+ ss['task'] + ".tgz"
     bb.utils.remove(sstatebuild, recurse=True)
     bb.utils.mkdirhier(sstatebuild)
     bb.utils.mkdirhier(os.path.dirname(sstatepkg))
     for state in ss['dirs']:
         if not os.path.exists(state[1]):
             continue
-        if d.getVar('SSTATE_SKIP_CREATION', True) == '1':
+        if d.getVar('SSTATE_SKIP_CREATION') == '1':
             continue
         srcbase = state[0].rstrip("/").rsplit('/', 1)[0]
+        # Find and error for absolute symlinks. We could attempt to relocate but its not
+        # clear where the symlink is relative to in this context. We could add that markup
+        # to sstate tasks but there aren't many of these so better just avoid them entirely.
         for walkroot, dirs, files in os.walk(state[1]):
-            for file in files:
+            for file in files + dirs:
                 srcpath = os.path.join(walkroot, file)
-                dstpath = srcpath.replace(state[1], state[2])
-                make_relative_symlink(srcpath, dstpath, d)
-            for dir in dirs:
-                srcpath = os.path.join(walkroot, dir)
-                dstpath = srcpath.replace(state[1], state[2])
-                make_relative_symlink(srcpath, dstpath, d)
+                if not os.path.islink(srcpath):
+                    continue
+                link = os.readlink(srcpath)
+                if not os.path.isabs(link):
+                    continue
+                if not link.startswith(tmpdir):
+                    continue
+                bb.error("sstate found an absolute path symlink %s pointing at %s. Please replace this with a relative link." % (srcpath, link))
         bb.debug(2, "Preparing tree %s for packaging at %s" % (state[1], sstatebuild + state[0]))
-        oe.path.copyhardlinktree(state[1], sstatebuild + state[0])
+        os.rename(state[1], sstatebuild + state[0])
 
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
     for plain in ss['plaindirs']:
         pdir = plain.replace(workdir, sstatebuild)
         bb.utils.mkdirhier(plain)
         bb.utils.mkdirhier(pdir)
-        oe.path.copyhardlinktree(plain, pdir)
+        os.rename(plain, pdir)
 
     d.setVar('SSTATE_BUILDDIR', sstatebuild)
     d.setVar('SSTATE_PKG', sstatepkg)
 
-    for f in (d.getVar('SSTATECREATEFUNCS', True) or '').split() + \
+    for f in (d.getVar('SSTATECREATEFUNCS') or '').split() + \
              ['sstate_create_package', 'sstate_sign_package'] + \
-             (d.getVar('SSTATEPOSTCREATEFUNCS', True) or '').split():
+             (d.getVar('SSTATEPOSTCREATEFUNCS') or '').split():
         # All hooks should run in SSTATE_BUILDDIR.
         bb.build.exec_func(f, d, (sstatebuild,))
 
     bb.siggen.dump_this_task(sstatepkg + ".siginfo", d)
 
+    d.setVar('SSTATE_INSTDIR', sstatebuild)
+
     return
 
 def pstaging_fetch(sstatefetch, sstatepkg, d):
     import bb.fetch2
 
     # Only try and fetch if the user has configured a mirror
-    mirrors = d.getVar('SSTATE_MIRRORS', True)
+    mirrors = d.getVar('SSTATE_MIRRORS')
     if not mirrors:
         return
 
     # Copy the data object and override DL_DIR and SRC_URI
     localdata = bb.data.createCopy(d)
-    bb.data.update_data(localdata)
 
     dldir = localdata.expand("${SSTATE_DIR}")
     bb.utils.mkdirhier(dldir)
@@ -633,14 +659,14 @@
 
     # if BB_NO_NETWORK is set but we also have SSTATE_MIRROR_ALLOW_NETWORK,
     # we'll want to allow network access for the current set of fetches.
-    if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1":
+    if localdata.getVar('BB_NO_NETWORK') == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK') == "1":
         localdata.delVar('BB_NO_NETWORK')
 
     # Try a fetch from the sstate mirror, if it fails just return and
     # we will build the package
     uris = ['file://{0};downloadfilename={0}'.format(sstatefetch),
             'file://{0}.siginfo;downloadfilename={0}.siginfo'.format(sstatefetch)]
-    if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG", True), False):
+    if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False):
         uris += ['file://{0}.sig;downloadfilename={0}.sig'.format(sstatefetch)]
 
     for srcuri in uris:
@@ -667,14 +693,21 @@
 python sstate_task_postfunc () {
     shared_state = sstate_state_fromvars(d)
 
-    sstate_install(shared_state, d)
     for intercept in shared_state['interceptfuncs']:
-        bb.build.exec_func(intercept, d, (d.getVar("WORKDIR", True),))
+        bb.build.exec_func(intercept, d, (d.getVar("WORKDIR"),))
+
     omask = os.umask(0o002)
     if omask != 0o002:
        bb.note("Using umask 0o002 (not %0o) for sstate packaging" % omask)
     sstate_package(shared_state, d)
     os.umask(omask)
+
+    sstateinst = d.getVar("SSTATE_INSTDIR")
+    d.setVar('SSTATE_FIXMEDIR', shared_state['fixmedir'])
+
+    sstate_installpkgdir(shared_state, d)
+
+    bb.utils.remove(d.getVar("SSTATE_BUILDDIR"), recurse=True)
 }
 sstate_task_postfunc[dirs] = "${WORKDIR}"
 
@@ -699,21 +732,18 @@
 	fi
 	chmod 0664 $TFILE
 	mv -f $TFILE ${SSTATE_PKG}
-
-	cd ${WORKDIR}
-	rm -rf ${SSTATE_BUILDDIR}
 }
 
 python sstate_sign_package () {
     from oe.gpg_sign import get_signer
 
-    if d.getVar('SSTATE_SIG_KEY', True):
+    if d.getVar('SSTATE_SIG_KEY'):
         signer = get_signer(d, 'local')
-        sstate_pkg = d.getVar('SSTATE_PKG', True)
+        sstate_pkg = d.getVar('SSTATE_PKG')
         if os.path.exists(sstate_pkg + '.sig'):
             os.unlink(sstate_pkg + '.sig')
         signer.detach_sign(sstate_pkg, d.getVar('SSTATE_SIG_KEY', False), None,
-                           d.getVar('SSTATE_SIG_PASSPHRASE', True), armor=False)
+                           d.getVar('SSTATE_SIG_PASSPHRASE'), armor=False)
 }
 
 #
@@ -736,7 +766,6 @@
 
     ret = []
     missed = []
-    missing = []
     extension = ".tgz"
     if siginfo:
         extension = extension + ".siginfo"
@@ -746,7 +775,7 @@
         splithashfn = sq_hashfn[task].split(" ")
         spec = splithashfn[1]
         if splithashfn[0] == "True":
-            extrapath = d.getVar("NATIVELSBSTRING", True) + "/"
+            extrapath = d.getVar("NATIVELSBSTRING") + "/"
         else:
             extrapath = ""
 
@@ -758,18 +787,6 @@
 
         return spec, extrapath, tname
 
-    def sstate_pkg_to_pn(pkg, d):
-        """
-        Translate an sstate filename to a PN value by way of SSTATE_PKGSPEC. This is slightly hacky but
-        we don't have access to everything in this context.
-        """
-        pkgspec = d.getVar('SSTATE_PKGSPEC', False)
-        try:
-            idx = pkgspec.split(':').index('${PN}')
-        except ValueError:
-            bb.fatal('Unable to find ${PN} in SSTATE_PKGSPEC')
-        return pkg.split(':')[idx]
-
 
     for task in range(len(sq_fn)):
 
@@ -785,11 +802,10 @@
             missed.append(task)
             bb.debug(2, "SState: Looked for but didn't find file %s" % sstatefile)
 
-    mirrors = d.getVar("SSTATE_MIRRORS", True)
+    mirrors = d.getVar("SSTATE_MIRRORS")
     if mirrors:
         # Copy the data object and override DL_DIR and SRC_URI
         localdata = bb.data.createCopy(d)
-        bb.data.update_data(localdata)
 
         dldir = localdata.expand("${SSTATE_DIR}")
         localdata.delVar('MIRRORS')
@@ -801,11 +817,9 @@
 
         # if BB_NO_NETWORK is set but we also have SSTATE_MIRROR_ALLOW_NETWORK,
         # we'll want to allow network access for the current set of fetches.
-        if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1":
+        if localdata.getVar('BB_NO_NETWORK') == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK') == "1":
             localdata.delVar('BB_NO_NETWORK')
 
-        whitelist = bb.runqueue.get_setscene_enforce_whitelist(d)
-
         from bb.fetch2 import FetchConnectionCache
         def checkstatus_init(thread_worker):
             thread_worker.connection_cache = FetchConnectionCache()
@@ -832,12 +846,6 @@
             except:
                 missed.append(task)
                 bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
-                if whitelist:
-                    pn = sstate_pkg_to_pn(sstatefile, d)
-                    taskname = sq_task[task]
-                    if not bb.runqueue.check_setscene_enforce_whitelist(pn, taskname, whitelist):
-                        missing.append(task)
-                        bb.error('Sstate artifact unavailable for %s.%s' % (pn, taskname))
                 pass
             bb.event.fire(bb.event.ProcessProgress("Checking sstate mirror object availability", len(tasklist) - thread_worker.tasks.qsize()), d)
 
@@ -865,10 +873,8 @@
             bb.event.disable_threadlock()
 
             bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d)
-            if whitelist and missing:
-                bb.fatal('Required artifacts were unavailable - exiting')
 
-    inheritlist = d.getVar("INHERIT", True)
+    inheritlist = d.getVar("INHERIT")
     if "toaster" in inheritlist:
         evdata = {'missed': [], 'found': []};
         for task in missed:
@@ -888,24 +894,31 @@
 
 BB_SETSCENE_DEPVALID = "setscene_depvalid"
 
-def setscene_depvalid(task, taskdependees, notneeded, d):
+def setscene_depvalid(task, taskdependees, notneeded, d, log=None):
     # taskdependees is a dict of tasks which depend on task, each being a 3 item list of [PN, TASKNAME, FILENAME]
     # task is included in taskdependees too
+    # Return - False - We need this dependency
+    #        - True - We can skip this dependency
 
-    bb.debug(2, "Considering setscene task: %s" % (str(taskdependees[task])))
+    def logit(msg, log):
+        if log is not None:
+            log.append(msg)
+        else:
+            bb.debug(2, msg)
+
+    logit("Considering setscene task: %s" % (str(taskdependees[task])), log)
 
     def isNativeCross(x):
-        return x.endswith("-native") or "-cross-" in x or "-crosssdk" in x
-
-    def isPostInstDep(x):
-        if x in ["qemu-native", "gdk-pixbuf-native", "qemuwrapper-cross", "depmodwrapper-cross", "systemd-systemctl-native", "gtk-icon-utils-native", "ca-certificates-native"]:
-            return True
-        return False
+        return x.endswith("-native") or "-cross-" in x or "-crosssdk" in x or x.endswith("-cross")
 
     # We only need to trigger populate_lic through direct dependencies
     if taskdependees[task][1] == "do_populate_lic":
         return True
 
+    # stash_locale and gcc_stash_builddir are never needed as a dependency for built objects
+    if taskdependees[task][1] == "do_stash_locale" or taskdependees[task][1] == "do_gcc_stash_builddir":
+        return True
+
     # We only need to trigger packagedata through direct dependencies
     # but need to preserve packagedata on packagedata links
     if taskdependees[task][1] == "do_packagedata":
@@ -915,7 +928,7 @@
         return True
 
     for dep in taskdependees:
-        bb.debug(2, "  considering dependency: %s" % (str(taskdependees[dep])))
+        logit("  considering dependency: %s" % (str(taskdependees[dep])), log)
         if task == dep:
             continue
         if dep in notneeded:
@@ -923,10 +936,11 @@
         # do_package_write_* and do_package doesn't need do_package
         if taskdependees[task][1] == "do_package" and taskdependees[dep][1] in ['do_package', 'do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata', 'do_package_qa']:
             continue
-        # do_package_write_* and do_package doesn't need do_populate_sysroot, unless is a postinstall dependency
-        if taskdependees[task][1] == "do_populate_sysroot" and taskdependees[dep][1] in ['do_package', 'do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata', 'do_package_qa']:
-            if isPostInstDep(taskdependees[task][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']:
-                return False
+        # do_package_write_* need do_populate_sysroot as they're mainly postinstall dependencies
+        if taskdependees[task][1] == "do_populate_sysroot" and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']:
+            return False
+        # do_package/packagedata/package_qa don't need do_populate_sysroot
+        if taskdependees[task][1] == "do_populate_sysroot" and taskdependees[dep][1] in ['do_package', 'do_packagedata', 'do_package_qa']:
             continue
         # Native/Cross packages don't exist and are noexec anyway
         if isNativeCross(taskdependees[dep][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata', 'do_package', 'do_package_qa']:
@@ -968,7 +982,7 @@
 
 
         # Safe fallthrough default
-        bb.debug(2, " Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep])))
+        logit(" Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep])), log)
         return False
     return True
 
@@ -977,15 +991,15 @@
 python sstate_eventhandler() {
     d = e.data
     # When we write an sstate package we rewrite the SSTATE_PKG
-    spkg = d.getVar('SSTATE_PKG', True)
+    spkg = d.getVar('SSTATE_PKG')
     if not spkg.endswith(".tgz"):
-        taskname = d.getVar("BB_RUNTASK", True)[3:]
-        spec = d.getVar('SSTATE_PKGSPEC', True)
-        swspec = d.getVar('SSTATE_SWSPEC', True)
+        taskname = d.getVar("BB_RUNTASK")[3:]
+        spec = d.getVar('SSTATE_PKGSPEC')
+        swspec = d.getVar('SSTATE_SWSPEC')
         if taskname in ["fetch", "unpack", "patch", "populate_lic", "preconfigure"] and swspec:
             d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}")
             d.setVar("SSTATE_EXTRAPATH", "")
-        sstatepkg = d.getVar('SSTATE_PKG', True)
+        sstatepkg = d.getVar('SSTATE_PKG')
         bb.siggen.dump_this_task(sstatepkg + '_' + taskname + ".tgz" ".siginfo", d)
 }
 
@@ -1004,7 +1018,7 @@
     stamps = e.stamps.values()
     removeworkdir = (d.getVar("SSTATE_PRUNE_OBSOLETEWORKDIR", False) == "1")
     seen = []
-    for a in d.getVar("SSTATE_ARCHS", True).split():
+    for a in d.getVar("SSTATE_ARCHS").split():
         toremove = []
         i = d.expand("${SSTATE_MANIFESTS}/index-" + a)
         if not os.path.exists(i):
diff --git a/import-layers/yocto-poky/meta/classes/staging.bbclass b/import-layers/yocto-poky/meta/classes/staging.bbclass
index bfabd06..984051d 100644
--- a/import-layers/yocto-poky/meta/classes/staging.bbclass
+++ b/import-layers/yocto-poky/meta/classes/staging.bbclass
@@ -31,6 +31,7 @@
     ${datadir}/applications \
     ${datadir}/fonts \
     ${datadir}/pixmaps \
+    ${libdir}/${PN}/ptest \
 "
 
 sysroot_stage_dir() {
@@ -69,8 +70,8 @@
 python sysroot_strip () {
     import stat, errno
 
-    dvar = d.getVar('SYSROOT_DESTDIR', True)
-    pn = d.getVar('PN', True)
+    dvar = d.getVar('SYSROOT_DESTDIR')
+    pn = d.getVar('PN')
 
     os.chdir(dvar)
 
@@ -103,9 +104,9 @@
 
     elffiles = {}
     inodes = {}
-    libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir", True))
-    baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir", True))
-    if (d.getVar('INHIBIT_SYSROOT_STRIP', True) != '1'):
+    libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir"))
+    baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir"))
+    if (d.getVar('INHIBIT_SYSROOT_STRIP') != '1'):
         #
         # First lets figure out all of the files we may have to process
         #
@@ -136,7 +137,7 @@
                     elf_file = isELF(file)
                     if elf_file & 1:
                         if elf_file & 2:
-                            if 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn, True) or "").split():
+                            if 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn) or "").split():
                                 bb.note("Skipping file %s from %s for already-stripped QA test" % (file[len(dvar):], pn))
                             else:
                                 bb.warn("File '%s' from %s was already stripped, this will prevent future debugging!" % (file[len(dvar):], pn))
@@ -154,7 +155,7 @@
         #
         # Now strip them (in parallel)
         #
-        strip = d.getVar("STRIP", True)
+        strip = d.getVar("STRIP")
         sfiles = []
         for file in elffiles:
             elf_file = int(elffiles[file])
@@ -172,52 +173,16 @@
 SYSROOT_PREPROCESS_FUNCS ?= ""
 SYSROOT_DESTDIR = "${WORKDIR}/sysroot-destdir"
 
-# We clean out any existing sstate from the sysroot if we rerun configure
-python sysroot_cleansstate () {
-    ss = sstate_state_fromvars(d, "populate_sysroot")
-    sstate_clean(ss, d)
-}
-do_configure[prefuncs] += "sysroot_cleansstate"
-
-
-BB_SETSCENE_VERIFY_FUNCTION2 = "sysroot_checkhashes2"
-
-def sysroot_checkhashes2(covered, tasknames, fns, d, invalidtasks):
-    problems = set()
-    configurefns = set()
-    for tid in invalidtasks:
-        if tasknames[tid] == "do_configure" and tid not in covered:
-            configurefns.add(fns[tid])
-    for tid in covered:
-        if tasknames[tid] == "do_populate_sysroot" and fns[tid] in configurefns:
-            problems.add(tid)
-    return problems
-
-BB_SETSCENE_VERIFY_FUNCTION = "sysroot_checkhashes"
-
-def sysroot_checkhashes(covered, tasknames, fnids, fns, d, invalidtasks = None):
-    problems = set()
-    configurefnids = set()
-    if not invalidtasks:
-        invalidtasks = range(len(tasknames))
-    for task in invalidtasks:
-        if tasknames[task] == "do_configure" and task not in covered:
-            configurefnids.add(fnids[task])
-    for task in covered:
-        if tasknames[task] == "do_populate_sysroot" and fnids[task] in configurefnids:
-            problems.add(task)
-    return problems
-
 python do_populate_sysroot () {
     bb.build.exec_func("sysroot_stage_all", d)
     bb.build.exec_func("sysroot_strip", d)
-    for f in (d.getVar('SYSROOT_PREPROCESS_FUNCS', True) or '').split():
+    for f in (d.getVar('SYSROOT_PREPROCESS_FUNCS') or '').split():
         bb.build.exec_func(f, d)
-    pn = d.getVar("PN", True)
-    multiprov = d.getVar("MULTI_PROVIDER_WHITELIST", True).split()
+    pn = d.getVar("PN")
+    multiprov = d.getVar("MULTI_PROVIDER_WHITELIST").split()
     provdir = d.expand("${SYSROOT_DESTDIR}${base_prefix}/sysroot-providers/")
     bb.utils.mkdirhier(provdir)
-    for p in d.getVar("PROVIDES", True).split():
+    for p in d.getVar("PROVIDES").split():
         if p in multiprov:
             continue
         p = p.replace("/", "_")
@@ -228,15 +193,483 @@
 do_populate_sysroot[vardeps] += "${SYSROOT_PREPROCESS_FUNCS}"
 do_populate_sysroot[vardepsexclude] += "MULTI_PROVIDER_WHITELIST"
 
+POPULATESYSROOTDEPS = ""
+POPULATESYSROOTDEPS_class-target = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot"
+POPULATESYSROOTDEPS_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot"
+do_populate_sysroot[depends] += "${POPULATESYSROOTDEPS}"
+
 SSTATETASKS += "do_populate_sysroot"
 do_populate_sysroot[cleandirs] = "${SYSROOT_DESTDIR}"
 do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}"
-do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST}/"
-do_populate_sysroot[stamp-extra-info] = "${MACHINE}"
+do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
+do_populate_sysroot[sstate-fixmedir] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
 
 python do_populate_sysroot_setscene () {
     sstate_setscene(d)
 }
 addtask do_populate_sysroot_setscene
 
+def staging_copyfile(c, target, dest, postinsts, seendirs):
+    import errno
+
+    destdir = os.path.dirname(dest)
+    if destdir not in seendirs:
+        bb.utils.mkdirhier(destdir)
+        seendirs.add(destdir)
+    if "/usr/bin/postinst-" in c:
+        postinsts.append(dest)
+    if os.path.islink(c):
+        linkto = os.readlink(c)
+        if os.path.lexists(dest):
+            if not os.path.islink(dest):
+                raise OSError(errno.EEXIST, "Link %s already exists as a file" % dest, dest)
+            if os.readlink(dest) == linkto:
+                return dest
+            raise OSError(errno.EEXIST, "Link %s already exists to a different location? (%s vs %s)" % (dest, os.readlink(dest), linkto), dest)
+        os.symlink(linkto, dest)
+        #bb.warn(c)
+    else:
+        try:
+            os.link(c, dest)
+        except OSError as err:
+            if err.errno == errno.EXDEV:
+                bb.utils.copyfile(c, dest)
+            else:
+                raise
+    return dest
+
+def staging_copydir(c, target, dest, seendirs):
+    if dest not in seendirs:
+        bb.utils.mkdirhier(dest)
+        seendirs.add(dest)
+
+def staging_processfixme(fixme, target, recipesysroot, recipesysrootnative, d):
+    import subprocess
+
+    if not fixme:
+        return
+    cmd = "sed -e 's:^[^/]*/:%s/:g' %s | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (target, " ".join(fixme), recipesysroot, recipesysrootnative)
+    for fixmevar in ['COMPONENTS_DIR', 'HOSTTOOLS_DIR', 'PKGDATA_DIR', 'PSEUDO_LOCALSTATEDIR', 'LOGFIFO']:
+        fixme_path = d.getVar(fixmevar)
+        cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path)
+    bb.debug(2, cmd)
+    subprocess.check_output(cmd, shell=True)
+
+
+def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d):
+    import glob
+    import subprocess
+
+    fixme = []
+    postinsts = []
+    seendirs = set()
+    stagingdir = d.getVar("STAGING_DIR")
+    if native:
+        pkgarchs = ['${BUILD_ARCH}', '${BUILD_ARCH}_*']
+        targetdir = nativesysroot
+    else:
+        pkgarchs = ['${MACHINE_ARCH}']
+        pkgarchs = pkgarchs + list(reversed(d.getVar("PACKAGE_EXTRA_ARCHS").split()))
+        pkgarchs.append('allarch')
+        targetdir = targetsysroot
+
+    bb.utils.mkdirhier(targetdir)
+    for pkgarch in pkgarchs:
+        for manifest in glob.glob(d.expand("${SSTATE_MANIFESTS}/manifest-%s-*.populate_sysroot" % pkgarch)):
+            if manifest.endswith("-initial.populate_sysroot"):
+                # skip glibc-initial and libgcc-initial due to file overlap
+                continue
+            tmanifest = targetdir + "/" + os.path.basename(manifest)
+            if os.path.exists(tmanifest):
+                continue
+            try:
+                os.link(manifest, tmanifest)
+            except OSError as err:
+                if err.errno == errno.EXDEV:
+                    bb.utils.copyfile(manifest, tmanifest)
+                else:
+                    raise
+            with open(manifest, "r") as f:
+                for l in f:
+                    l = l.strip()
+                    if l.endswith("/fixmepath"):
+                        fixme.append(l)
+                        continue
+                    if l.endswith("/fixmepath.cmd"):
+                        continue
+                    dest = l.replace(stagingdir, "")
+                    dest = targetdir + "/" + "/".join(dest.split("/")[3:])
+                    if l.endswith("/"):
+                        staging_copydir(l, targetdir, dest, seendirs)
+                        continue
+                    try:
+                        staging_copyfile(l, targetdir, dest, postinsts, seendirs)
+                    except FileExistsError:
+                        continue
+
+    staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d)
+    for p in postinsts:
+        subprocess.check_output(p, shell=True)
+
+#
+# Manifests here are complicated. The main sysroot area has the unpacked sstate
+# which us unrelocated and tracked by the main sstate manifests. Each recipe
+# specific sysroot has manifests for each dependency that is installed there.
+# The task hash is used to tell whether the data needs to be reinstalled. We
+# use a symlink to point to the currently installed hash. There is also a
+# "complete" stamp file which is used to mark if installation completed. If
+# something fails (e.g. a postinst), this won't get written and we would
+# remove and reinstall the dependency. This also means partially installed
+# dependencies should get cleaned up correctly.
+#
+
+python extend_recipe_sysroot() {
+    import copy
+    import subprocess
+    import errno
+    import collections
+    import glob
+
+    taskdepdata = d.getVar("BB_TASKDEPDATA", False)
+    mytaskname = d.getVar("BB_RUNTASK")
+    if mytaskname.endswith("_setscene"):
+        mytaskname = mytaskname.replace("_setscene", "")
+    workdir = d.getVar("WORKDIR")
+    #bb.warn(str(taskdepdata))
+    pn = d.getVar("PN")
+
+    stagingdir = d.getVar("STAGING_DIR")
+    sharedmanifests = d.getVar("COMPONENTS_DIR") + "/manifests"
+    recipesysroot = d.getVar("RECIPE_SYSROOT")
+    recipesysrootnative = d.getVar("RECIPE_SYSROOT_NATIVE")
+    current_variant = d.getVar("BBEXTENDVARIANT")
+
+    # Detect bitbake -b usage
+    nodeps = d.getVar("BB_LIMITEDDEPS") or False
+    if nodeps:
+        lock = bb.utils.lockfile(recipesysroot + "/sysroot.lock")
+        staging_populate_sysroot_dir(recipesysroot, recipesysrootnative, True, d)
+        staging_populate_sysroot_dir(recipesysroot, recipesysrootnative, False, d)
+        bb.utils.unlockfile(lock)
+        return
+
+    start = None
+    configuredeps = []
+    for dep in taskdepdata:
+        data = taskdepdata[dep]
+        if data[1] == mytaskname and data[0] == pn:
+            start = dep
+            break
+    if start is None:
+        bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
+
+    # We need to figure out which sysroot files we need to expose to this task.
+    # This needs to match what would get restored from sstate, which is controlled
+    # ultimately by calls from bitbake to setscene_depvalid().
+    # That function expects a setscene dependency tree. We build a dependency tree
+    # condensed to inter-sstate task dependencies, similar to that used by setscene
+    # tasks. We can then call into setscene_depvalid() and decide
+    # which dependencies we can "see" and should expose in the recipe specific sysroot.
+    setscenedeps = copy.deepcopy(taskdepdata)
+
+    start = set([start])
+
+    sstatetasks = d.getVar("SSTATETASKS").split()
+
+    def print_dep_tree(deptree):
+        data = ""
+        for dep in deptree:
+            deps = "    " + "\n    ".join(deptree[dep][3]) + "\n"
+            data = "%s:\n  %s\n  %s\n%s  %s\n  %s\n" % (deptree[dep][0], deptree[dep][1], deptree[dep][2], deps, deptree[dep][4], deptree[dep][5])
+        return data
+
+    #bb.note("Full dep tree is:\n%s" % print_dep_tree(taskdepdata))
+
+    #bb.note(" start2 is %s" % str(start))
+
+    # If start is an sstate task (like do_package) we need to add in its direct dependencies
+    # else the code below won't recurse into them.
+    for dep in set(start):
+        for dep2 in setscenedeps[dep][3]:
+            start.add(dep2)
+        start.remove(dep)
+
+    #bb.note(" start3 is %s" % str(start))
+
+    # Create collapsed do_populate_sysroot -> do_populate_sysroot tree
+    for dep in taskdepdata:
+        data = setscenedeps[dep]
+        if data[1] not in sstatetasks:
+            for dep2 in setscenedeps:
+                data2 = setscenedeps[dep2]
+                if dep in data2[3]:
+                    data2[3].update(setscenedeps[dep][3])
+                    data2[3].remove(dep)
+            if dep in start:
+                start.update(setscenedeps[dep][3])
+                start.remove(dep)
+            del setscenedeps[dep]
+
+    # Remove circular references
+    for dep in setscenedeps:
+        if dep in setscenedeps[dep][3]:
+            setscenedeps[dep][3].remove(dep)
+
+    #bb.note("Computed dep tree is:\n%s" % print_dep_tree(setscenedeps))
+    #bb.note(" start is %s" % str(start))
+
+    # Direct dependencies should be present and can be depended upon
+    for dep in set(start):
+        if setscenedeps[dep][1] == "do_populate_sysroot":
+            if dep not in configuredeps:
+                configuredeps.append(dep)
+    bb.note("Direct dependencies are %s" % str(configuredeps))
+    #bb.note(" or %s" % str(start))
+
+    msgbuf = []
+    # Call into setscene_depvalid for each sub-dependency and only copy sysroot files
+    # for ones that would be restored from sstate.
+    done = list(start)
+    next = list(start)
+    while next:
+        new = []
+        for dep in next:
+            data = setscenedeps[dep]
+            for datadep in data[3]:
+                if datadep in done:
+                    continue
+                taskdeps = {}
+                taskdeps[dep] = setscenedeps[dep][:2]
+                taskdeps[datadep] = setscenedeps[datadep][:2]
+                retval = setscene_depvalid(datadep, taskdeps, [], d, msgbuf)
+                if retval:
+                    msgbuf.append("Skipping setscene dependency %s for installation into the sysroot" % datadep)
+                    continue
+                done.append(datadep)
+                new.append(datadep)
+                if datadep not in configuredeps and setscenedeps[datadep][1] == "do_populate_sysroot":
+                    configuredeps.append(datadep)
+                    msgbuf.append("Adding dependency on %s" % setscenedeps[datadep][0])
+                else:
+                    msgbuf.append("Following dependency on %s" % setscenedeps[datadep][0])
+        next = new
+
+    bb.note("\n".join(msgbuf))
+
+    depdir = recipesysrootnative + "/installeddeps"
+    bb.utils.mkdirhier(depdir)
+    bb.utils.mkdirhier(sharedmanifests)
+
+    lock = bb.utils.lockfile(recipesysroot + "/sysroot.lock")
+
+    fixme = {}
+    fixme[''] = []
+    fixme['native'] = []
+    seendirs = set()
+    postinsts = []
+    multilibs = {}
+    manifests = {}
+
+    for f in os.listdir(depdir):
+        if not f.endswith(".complete"):
+            continue
+        f = depdir + "/" + f
+        if os.path.islink(f) and not os.path.exists(f):
+            bb.note("%s no longer exists, removing from sysroot" % f)
+            lnk = os.readlink(f.replace(".complete", ""))
+            sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+            os.unlink(f)
+            os.unlink(f.replace(".complete", ""))
+
+    installed = []
+    for dep in configuredeps:
+        c = setscenedeps[dep][0]
+        if mytaskname in ["do_sdk_depends", "do_populate_sdk_ext"] and c.endswith("-initial"):
+            bb.note("Skipping initial setscene dependency %s for installation into the sysroot" % c)
+            continue
+        installed.append(c)
+
+    # We want to remove anything which this task previously installed but is no longer a dependency
+    taskindex = depdir + "/" + "index." + mytaskname
+    if os.path.exists(taskindex):
+        potential = []
+        with open(taskindex, "r") as f:
+            for l in f:
+                l = l.strip()
+                if l not in installed:
+                    fl = depdir + "/" + l
+                    if not os.path.exists(fl):
+                        # Was likely already uninstalled
+                        continue
+                    potential.append(l)
+        # We need to ensure not other task needs this dependency. We hold the sysroot
+        # lock so we ca search the indexes to check
+        if potential:
+            for i in glob.glob(depdir + "/index.*"):
+                if i.endswith("." + mytaskname):
+                    continue
+                with open(i, "r") as f:
+                    for l in f:
+                        l = l.strip()
+                        if l in potential:
+                            potential.remove(l)
+        for l in potential:
+            fl = depdir + "/" + l
+            bb.note("Task %s no longer depends on %s, removing from sysroot" % (mytaskname, l))
+            lnk = os.readlink(fl)
+            sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+            os.unlink(fl)
+            os.unlink(fl + ".complete")
+
+    for dep in configuredeps:
+        c = setscenedeps[dep][0]
+        if c not in installed:
+            continue
+        taskhash = setscenedeps[dep][5]
+        taskmanifest = depdir + "/" + c + "." + taskhash
+
+        if os.path.exists(depdir + "/" + c):
+            lnk = os.readlink(depdir + "/" + c)
+            if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"):
+                bb.note("%s exists in sysroot, skipping" % c)
+                continue
+            else:
+                bb.note("%s exists in sysroot, but is stale (%s vs. %s), removing." % (c, lnk, c + "." + taskhash))
+                sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+                os.unlink(depdir + "/" + c)
+                if os.path.lexists(depdir + "/" + c + ".complete"):
+                    os.unlink(depdir + "/" + c + ".complete")
+        elif os.path.lexists(depdir + "/" + c):
+            os.unlink(depdir + "/" + c)
+
+        os.symlink(c + "." + taskhash, depdir + "/" + c)
+
+        d2 = d
+        destsysroot = recipesysroot
+        variant = ''
+        if setscenedeps[dep][2].startswith("virtual:multilib"):
+            variant = setscenedeps[dep][2].split(":")[2]
+            if variant != current_variant:
+                if variant not in multilibs:
+                    multilibs[variant] = get_multilib_datastore(variant, d)
+                d2 = multilibs[variant]
+                destsysroot = d2.getVar("RECIPE_SYSROOT")
+
+        native = False
+        if c.endswith("-native"):
+            manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}-%s.populate_sysroot" % c)
+            native = True
+        elif c.startswith("nativesdk-"):
+            manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${SDK_ARCH}_${SDK_OS}-%s.populate_sysroot" % c)
+        elif "-cross-" in c:
+            manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}_${TARGET_ARCH}-%s.populate_sysroot" % c)
+            native = True
+        elif "-crosssdk" in c:
+            manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS}-%s.populate_sysroot" % c)
+            native = True
+        else:
+            pkgarchs = ['${MACHINE_ARCH}']
+            pkgarchs = pkgarchs + list(reversed(d2.getVar("PACKAGE_EXTRA_ARCHS").split()))
+            pkgarchs.append('allarch')
+            for pkgarch in pkgarchs:
+                manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-%s-%s.populate_sysroot" % (pkgarch, c))
+                if os.path.exists(manifest):
+                    break
+        if not os.path.exists(manifest):
+            bb.warn("Manifest %s not found?" % manifest)
+        else:
+            newmanifest = collections.OrderedDict()
+            if native:
+                fm = fixme['native']
+                targetdir = recipesysrootnative
+            else:
+                fm = fixme['']
+                targetdir = destsysroot
+            with open(manifest, "r") as f:
+                manifests[dep] = manifest
+                for l in f:
+                    l = l.strip()
+                    if l.endswith("/fixmepath"):
+                        fm.append(l)
+                        continue
+                    if l.endswith("/fixmepath.cmd"):
+                        continue
+                    dest = l.replace(stagingdir, "")
+                    dest = targetdir + "/" + "/".join(dest.split("/")[3:])
+                    newmanifest[l] = dest
+            # Having multiple identical manifests in each sysroot eats diskspace so
+            # create a shared pool of them and hardlink if we can.
+            # We create the manifest in advance so that if something fails during installation,
+            # or the build is interrupted, subsequent exeuction can cleanup.
+            sharedm = sharedmanifests + "/" + os.path.basename(taskmanifest)
+            if not os.path.exists(sharedm):
+                smlock = bb.utils.lockfile(sharedm + ".lock")
+                # Can race here. You'd think it just means we may not end up with all copies hardlinked to each other
+                # but python can lose file handles so we need to do this under a lock.
+                if not os.path.exists(sharedm):
+                    with open(sharedm, 'w') as m:
+                       for l in newmanifest:
+                           dest = newmanifest[l]
+                           m.write(dest.replace(workdir + "/", "") + "\n")
+                bb.utils.unlockfile(smlock)
+            try:
+                os.link(sharedm, taskmanifest)
+            except OSError as err:
+                if err.errno == errno.EXDEV:
+                    bb.utils.copyfile(sharedm, taskmanifest)
+                else:
+                    raise
+            # Finally actually install the files
+            for l in newmanifest:
+                    dest = newmanifest[l]
+                    if l.endswith("/"):
+                        staging_copydir(l, targetdir, dest, seendirs)
+                        continue
+                    staging_copyfile(l, targetdir, dest, postinsts, seendirs)
+
+    for f in fixme:
+        if f == '':
+            staging_processfixme(fixme[f], recipesysroot, recipesysroot, recipesysrootnative, d)
+        elif f == 'native':
+            staging_processfixme(fixme[f], recipesysrootnative, recipesysroot, recipesysrootnative, d)
+        else:
+            staging_processfixme(fixme[f], multilibs[f].getVar("RECIPE_SYSROOT"), recipesysroot, recipesysrootnative, d)
+
+    for p in postinsts:
+        subprocess.check_output(p, shell=True)
+
+    for dep in manifests:
+        c = setscenedeps[dep][0]
+        os.symlink(manifests[dep], depdir + "/" + c + ".complete")
+
+    with open(taskindex, "w") as f:
+        for l in sorted(installed):
+            f.write(l + "\n")
+
+    bb.utils.unlockfile(lock)
+}
+extend_recipe_sysroot[vardepsexclude] += "MACHINE_ARCH PACKAGE_EXTRA_ARCHS SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA"
+
+python do_prepare_recipe_sysroot () {
+    bb.build.exec_func("extend_recipe_sysroot", d)
+}
+addtask do_prepare_recipe_sysroot before do_configure after do_fetch
+
+# Clean out the recipe specific sysroots before do_fetch
+# (use a prefunc so we can order before extend_recipe_sysroot if it gets added)
+python clean_recipe_sysroot() {
+    return
+}
+clean_recipe_sysroot[cleandirs] += "${RECIPE_SYSROOT} ${RECIPE_SYSROOT_NATIVE}"
+do_fetch[prefuncs] += "clean_recipe_sysroot"
+
+python staging_taskhandler() {
+    bbtasks = e.tasklist
+    for task in bbtasks:
+        deps = d.getVarFlag(task, "depends")
+        if deps and "populate_sysroot" in deps:
+            d.appendVarFlag(task, "prefuncs", " extend_recipe_sysroot")
+}
+staging_taskhandler[eventmask] = "bb.event.RecipeTaskPreProcess"
+addhandler staging_taskhandler
 
diff --git a/import-layers/yocto-poky/meta/classes/syslinux.bbclass b/import-layers/yocto-poky/meta/classes/syslinux.bbclass
index 7778fd7..d6f8824 100644
--- a/import-layers/yocto-poky/meta/classes/syslinux.bbclass
+++ b/import-layers/yocto-poky/meta/classes/syslinux.bbclass
@@ -84,12 +84,12 @@
     import copy
     import sys
 
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
     if not workdir:
         bb.error("WORKDIR not defined, unable to package")
         return
         
-    labels = d.getVar('LABELS', True)
+    labels = d.getVar('LABELS')
     if not labels:
         bb.debug(1, "LABELS not defined, nothing to do")
         return
@@ -98,7 +98,7 @@
         bb.debug(1, "No labels, nothing to do")
         return
 
-    cfile = d.getVar('SYSLINUX_CFG', True)
+    cfile = d.getVar('SYSLINUX_CFG')
     if not cfile:
         bb.fatal('Unable to read SYSLINUX_CFG')
 
@@ -109,39 +109,39 @@
 
     cfgfile.write('# Automatically created by OE\n')
 
-    opts = d.getVar('SYSLINUX_OPTS', True)
+    opts = d.getVar('SYSLINUX_OPTS')
 
     if opts:
         for opt in opts.split(';'):
             cfgfile.write('%s\n' % opt)
 
-    allowoptions = d.getVar('SYSLINUX_ALLOWOPTIONS', True)
+    allowoptions = d.getVar('SYSLINUX_ALLOWOPTIONS')
     if allowoptions:
         cfgfile.write('ALLOWOPTIONS %s\n' % allowoptions)
     else:
         cfgfile.write('ALLOWOPTIONS 1\n')
 
-    syslinux_default_console = d.getVar('SYSLINUX_DEFAULT_CONSOLE', True)
-    syslinux_serial_tty = d.getVar('SYSLINUX_SERIAL_TTY', True)
-    syslinux_serial = d.getVar('SYSLINUX_SERIAL', True)
+    syslinux_default_console = d.getVar('SYSLINUX_DEFAULT_CONSOLE')
+    syslinux_serial_tty = d.getVar('SYSLINUX_SERIAL_TTY')
+    syslinux_serial = d.getVar('SYSLINUX_SERIAL')
     if syslinux_serial:
         cfgfile.write('SERIAL %s\n' % syslinux_serial)
 
-    menu = (d.getVar('AUTO_SYSLINUXMENU', True) == "1")
+    menu = (d.getVar('AUTO_SYSLINUXMENU') == "1")
 
     if menu and syslinux_serial:
         cfgfile.write('DEFAULT Graphics console %s\n' % (labels.split()[0]))
     else:
         cfgfile.write('DEFAULT %s\n' % (labels.split()[0]))
 
-    timeout = d.getVar('SYSLINUX_TIMEOUT', True)
+    timeout = d.getVar('SYSLINUX_TIMEOUT')
 
     if timeout:
         cfgfile.write('TIMEOUT %s\n' % timeout)
     else:
         cfgfile.write('TIMEOUT 50\n')
 
-    prompt = d.getVar('SYSLINUX_PROMPT', True)
+    prompt = d.getVar('SYSLINUX_PROMPT')
     if prompt:
         cfgfile.write('PROMPT %s\n' % prompt)
     else:
@@ -151,38 +151,37 @@
         cfgfile.write('ui vesamenu.c32\n')
         cfgfile.write('menu title Select kernel options and boot kernel\n')
         cfgfile.write('menu tabmsg Press [Tab] to edit, [Return] to select\n')
-        splash = d.getVar('SYSLINUX_SPLASH', True)
+        splash = d.getVar('SYSLINUX_SPLASH')
         if splash:
             cfgfile.write('menu background splash.lss\n')
     
     for label in labels.split():
         localdata = bb.data.createCopy(d)
 
-        overrides = localdata.getVar('OVERRIDES', True)
+        overrides = localdata.getVar('OVERRIDES')
         if not overrides:
             bb.fatal('OVERRIDES not defined')
 
         localdata.setVar('OVERRIDES', label + ':' + overrides)
-        bb.data.update_data(localdata)
     
         btypes = [ [ "", syslinux_default_console ] ]
         if menu and syslinux_serial:
             btypes = [ [ "Graphics console ", syslinux_default_console  ],
                 [ "Serial console ", syslinux_serial_tty ] ]
 
-        root= d.getVar('SYSLINUX_ROOT', True)
+        root= d.getVar('SYSLINUX_ROOT')
         if not root:
             bb.fatal('SYSLINUX_ROOT not defined')
 
         for btype in btypes:
             cfgfile.write('LABEL %s%s\nKERNEL /vmlinuz\n' % (btype[0], label))
 
-            exargs = d.getVar('SYSLINUX_KERNEL_ARGS', True)
+            exargs = d.getVar('SYSLINUX_KERNEL_ARGS')
             if exargs:
                 btype[1] += " " + exargs
 
-            append = localdata.getVar('APPEND', True)
-            initrd = localdata.getVar('INITRD', True)
+            append = localdata.getVar('APPEND')
+            initrd = localdata.getVar('INITRD')
 
             append = root + " " + append
             cfgfile.write('APPEND ')
diff --git a/import-layers/yocto-poky/meta/classes/systemd-boot.bbclass b/import-layers/yocto-poky/meta/classes/systemd-boot.bbclass
index 05244c7..9597759 100644
--- a/import-layers/yocto-poky/meta/classes/systemd-boot.bbclass
+++ b/import-layers/yocto-poky/meta/classes/systemd-boot.bbclass
@@ -4,9 +4,7 @@
 
 # systemd-boot.bbclass - The "systemd-boot" is essentially the gummiboot merged into systemd.
 #                        The original standalone gummiboot project is dead without any more
-#                        maintenance. As a start point, we replace all gummitboot occurrences
-#                        with systemd-boot in gummiboot.bbclass to have a base version of this
-#                        systemd-boot.bbclass.
+#                        maintenance.
 #
 # Set EFI_PROVIDER = "systemd-boot" to use systemd-boot on your live images instead of grub-efi
 # (images built by image-live.bbclass or image-vm.bbclass)
@@ -39,6 +37,8 @@
         install -d ${DEST}/loader
         install -d ${DEST}/loader/entries
         install -m 0644 ${DEPLOY_DIR_IMAGE}/${EFI_IMAGE} ${DEST}${EFIDIR}/${DEST_EFI_IMAGE}
+        EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
+        printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_EFI_IMAGE" >${DEST}/startup.nsh
         install -m 0644 ${SYSTEMD_BOOT_CFG} ${DEST}/loader/loader.conf
         for i in ${SYSTEMD_BOOT_ENTRIES}; do
             install -m 0644 ${i} ${DEST}/loader/entries
@@ -50,6 +50,7 @@
         efi_populate $iso_dir
         mkdir -p ${EFIIMGDIR}/${EFIDIR}
         cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
+        cp -r $iso_dir/loader ${EFIIMGDIR}
         cp $iso_dir/vmlinuz ${EFIIMGDIR}
         EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
         echo "fs0:${EFIPATH}\\${DEST_EFI_IMAGE}" > ${EFIIMGDIR}/startup.nsh
@@ -63,8 +64,8 @@
 }
 
 python build_efi_cfg() {
-    s = d.getVar("S", True)
-    labels = d.getVar('LABELS', True)
+    s = d.getVar("S")
+    labels = d.getVar('LABELS')
     if not labels:
         bb.debug(1, "LABELS not defined, nothing to do")
         return
@@ -73,7 +74,10 @@
         bb.debug(1, "No labels, nothing to do")
         return
 
-    cfile = d.getVar('SYSTEMD_BOOT_CFG', True)
+    cfile = d.getVar('SYSTEMD_BOOT_CFG')
+    cdir = os.path.dirname(cfile)
+    if not os.path.exists(cdir):
+        os.makedirs(cdir)
     try:
          cfgfile = open(cfile, 'w')
     except OSError:
@@ -81,7 +85,7 @@
 
     cfgfile.write('# Automatically created by OE\n')
     cfgfile.write('default %s\n' % (labels.split()[0]))
-    timeout = d.getVar('SYSTEMD_BOOT_TIMEOUT', True)
+    timeout = d.getVar('SYSTEMD_BOOT_TIMEOUT')
     if timeout:
         cfgfile.write('timeout %s\n' % timeout)
     else:
@@ -91,7 +95,7 @@
     for label in labels.split():
         localdata = d.createCopy()
 
-        overrides = localdata.getVar('OVERRIDES', True)
+        overrides = localdata.getVar('OVERRIDES')
         if not overrides:
             bb.fatal('OVERRIDES not defined')
 
@@ -102,13 +106,12 @@
         except OSError:
             bb.fatal('Unable to open %s' % entryfile)
         localdata.setVar('OVERRIDES', label + ':' + overrides)
-        bb.data.update_data(localdata)
 
         entrycfg.write('title %s\n' % label)
         entrycfg.write('linux /vmlinuz\n')
 
-        append = localdata.getVar('APPEND', True)
-        initrd = localdata.getVar('INITRD', True)
+        append = localdata.getVar('APPEND')
+        initrd = localdata.getVar('INITRD')
 
         if initrd:
             entrycfg.write('initrd /initrd\n')
diff --git a/import-layers/yocto-poky/meta/classes/systemd.bbclass b/import-layers/yocto-poky/meta/classes/systemd.bbclass
index 4ea1f45..c4b4bb9 100644
--- a/import-layers/yocto-poky/meta/classes/systemd.bbclass
+++ b/import-layers/yocto-poky/meta/classes/systemd.bbclass
@@ -17,6 +17,7 @@
     # files.
     if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
         d.appendVar("DEPENDS", " systemd-systemctl-native")
+        d.appendVar("PACKAGE_WRITE_DEPS", " systemd-systemctl-native")
         if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
             d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
@@ -29,6 +30,10 @@
 fi
 
 if type systemctl >/dev/null 2>/dev/null; then
+	if [ -z "$D" ]; then
+		systemctl daemon-reload
+	fi
+
 	systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
 
 	if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
@@ -65,14 +70,14 @@
         return
 
     def get_package_var(d, var, pkg):
-        val = (d.getVar('%s_%s' % (var, pkg), True) or "").strip()
+        val = (d.getVar('%s_%s' % (var, pkg)) or "").strip()
         if val == "":
-            val = (d.getVar(var, True) or "").strip()
+            val = (d.getVar(var) or "").strip()
         return val
 
     # Check if systemd-packages already included in PACKAGES
     def systemd_check_package(pkg_systemd):
-        packages = d.getVar('PACKAGES', True)
+        packages = d.getVar('PACKAGES')
         if not pkg_systemd in packages.split():
             bb.error('%s does not appear in package list, please add it' % pkg_systemd)
 
@@ -84,25 +89,24 @@
         # variable.
         localdata = d.createCopy()
         localdata.prependVar("OVERRIDES", pkg + ":")
-        bb.data.update_data(localdata)
 
-        postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+        postinst = d.getVar('pkg_postinst_%s' % pkg)
         if not postinst:
             postinst = '#!/bin/sh\n'
-        postinst += localdata.getVar('systemd_postinst', True)
+        postinst += localdata.getVar('systemd_postinst')
         d.setVar('pkg_postinst_%s' % pkg, postinst)
 
-        prerm = d.getVar('pkg_prerm_%s' % pkg, True)
+        prerm = d.getVar('pkg_prerm_%s' % pkg)
         if not prerm:
             prerm = '#!/bin/sh\n'
-        prerm += localdata.getVar('systemd_prerm', True)
+        prerm += localdata.getVar('systemd_prerm')
         d.setVar('pkg_prerm_%s' % pkg, prerm)
 
 
     # Add files to FILES_*-systemd if existent and not already done
     def systemd_append_file(pkg_systemd, file_append):
         appended = False
-        if os.path.exists(oe.path.join(d.getVar("D", True), file_append)):
+        if os.path.exists(oe.path.join(d.getVar("D"), file_append)):
             var_name = "FILES_" + pkg_systemd
             files = d.getVar(var_name, False) or ""
             if file_append not in files.split():
@@ -114,7 +118,7 @@
     def systemd_add_files_and_parse(pkg_systemd, path, service, keys):
         # avoid infinite recursion
         if systemd_append_file(pkg_systemd, oe.path.join(path, service)):
-            fullpath = oe.path.join(d.getVar("D", True), path, service)
+            fullpath = oe.path.join(d.getVar("D"), path, service)
             if service.find('.service') != -1:
                 # for *.service add *@.service
                 service_base = service.replace('.service', '')
@@ -137,9 +141,9 @@
 
     # Check service-files and call systemd_add_files_and_parse for each entry
     def systemd_check_services():
-        searchpaths = [oe.path.join(d.getVar("sysconfdir", True), "systemd", "system"),]
-        searchpaths.append(d.getVar("systemd_system_unitdir", True))
-        systemd_packages = d.getVar('SYSTEMD_PACKAGES', True)
+        searchpaths = [oe.path.join(d.getVar("sysconfdir"), "systemd", "system"),]
+        searchpaths.append(d.getVar("systemd_system_unitdir"))
+        systemd_packages = d.getVar('SYSTEMD_PACKAGES')
 
         keys = 'Also'
         # scan for all in SYSTEMD_SERVICE[]
@@ -154,11 +158,11 @@
                     base = re.sub('@[^.]+.', '@.', service)
 
                 for path in searchpaths:
-                    if os.path.exists(oe.path.join(d.getVar("D", True), path, service)):
+                    if os.path.exists(oe.path.join(d.getVar("D"), path, service)):
                         path_found = path
                         break
                     elif base is not None:
-                        if os.path.exists(oe.path.join(d.getVar("D", True), path, base)):
+                        if os.path.exists(oe.path.join(d.getVar("D"), path, base)):
                             path_found = path
                             break
 
@@ -168,10 +172,10 @@
                     bb.fatal("SYSTEMD_SERVICE_%s value %s does not exist" % (pkg_systemd, service))
 
     # Run all modifications once when creating package
-    if os.path.exists(d.getVar("D", True)):
-        for pkg in d.getVar('SYSTEMD_PACKAGES', True).split():
+    if os.path.exists(d.getVar("D")):
+        for pkg in d.getVar('SYSTEMD_PACKAGES').split():
             systemd_check_package(pkg)
-            if d.getVar('SYSTEMD_SERVICE_' + pkg, True):
+            if d.getVar('SYSTEMD_SERVICE_' + pkg):
                 systemd_generate_package_scripts(pkg)
         systemd_check_services()
 }
@@ -181,7 +185,7 @@
 python rm_systemd_unitdir (){
     import shutil
     if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
-        systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True))
+        systemd_unitdir = oe.path.join(d.getVar("D"), d.getVar('systemd_unitdir'))
         if os.path.exists(systemd_unitdir):
             shutil.rmtree(systemd_unitdir)
         systemd_libdir = os.path.dirname(systemd_unitdir)
@@ -192,12 +196,12 @@
 
 python rm_sysvinit_initddir (){
     import shutil
-    sysv_initddir = oe.path.join(d.getVar("D", True), (d.getVar('INIT_D_DIR', True) or "/etc/init.d"))
+    sysv_initddir = oe.path.join(d.getVar("D"), (d.getVar('INIT_D_DIR') or "/etc/init.d"))
 
     if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
         not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
         os.path.exists(sysv_initddir):
-        systemd_system_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_system_unitdir', True))
+        systemd_system_unitdir = oe.path.join(d.getVar("D"), d.getVar('systemd_system_unitdir'))
 
         # If systemd_system_unitdir contains anything, delete sysv_initddir
         if (os.path.exists(systemd_system_unitdir) and os.listdir(systemd_system_unitdir)):
diff --git a/import-layers/yocto-poky/meta/classes/terminal.bbclass b/import-layers/yocto-poky/meta/classes/terminal.bbclass
index a94f755..a27e10c 100644
--- a/import-layers/yocto-poky/meta/classes/terminal.bbclass
+++ b/import-layers/yocto-poky/meta/classes/terminal.bbclass
@@ -3,7 +3,7 @@
 OE_TERMINAL[choices] = 'auto none \
                         ${@oe_terminal_prioritized()}'
 
-OE_TERMINAL_EXPORTS += 'EXTRA_OEMAKE'
+OE_TERMINAL_EXPORTS += 'EXTRA_OEMAKE CACHED_CONFIGUREVARS CONFIGUREOPTS EXTRA_OECONF'
 OE_TERMINAL_EXPORTS[type] = 'list'
 
 XAUTHORITY ?= "${HOME}/.Xauthority"
@@ -19,9 +19,9 @@
     envdata.setVar(cmd_func, 'exec ' + command)
     envdata.setVarFlag(cmd_func, 'func', '1')
 
-    runfmt = d.getVar('BB_RUNFMT', True) or "run.{func}.{pid}"
+    runfmt = d.getVar('BB_RUNFMT') or "run.{func}.{pid}"
     runfile = runfmt.format(func=cmd_func, task=cmd_func, taskfunc=cmd_func, pid=os.getpid())
-    runfile = os.path.join(d.getVar('T', True), runfile)
+    runfile = os.path.join(d.getVar('T'), runfile)
     bb.utils.mkdirhier(os.path.dirname(runfile))
 
     with open(runfile, 'w') as script:
@@ -44,7 +44,7 @@
         envdata.setVarFlag(v, 'export', '1')
 
     for export in oe.data.typed_value('OE_TERMINAL_EXPORTS', d):
-        value = d.getVar(export, True)
+        value = d.getVar(export)
         if value is not None:
             os.environ[export] = str(value)
             envdata.setVar(export, str(value))
@@ -60,12 +60,17 @@
     for key in origbbenv:
         if key in envdata:
             continue
-        value = origbbenv.getVar(key, True)
+        value = origbbenv.getVar(key)
         if value is not None:
             os.environ[key] = str(value)
             envdata.setVar(key, str(value))
             envdata.setVarFlag(key, 'export', '1')
 
+    # Use original PATH as a fallback
+    path = d.getVar('PATH') + ":" + origbbenv.getVar('PATH')
+    os.environ['PATH'] = path
+    envdata.setVar('PATH', path)
+
     # A complex PS1 might need more escaping of chars.
     # Lets not export PS1 instead.
     envdata.delVar("PS1")
@@ -88,8 +93,12 @@
 
     try:
         oe.terminal.spawn_preferred(command, title, None, d)
-    except oe.terminal.NoSupportedTerminals:
-        bb.fatal('No valid terminal found, unable to open devshell')
+    except oe.terminal.NoSupportedTerminals as nosup:
+        nosup.terms.remove("false")
+        cmds = '\n\t'.join(nosup.terms).replace("{command}",
+                    "do_terminal").replace("{title}", title)
+        bb.fatal('No valid terminal found, unable to open devshell.\n' +
+                'Tried the following commands:\n\t%s' % cmds)
     except oe.terminal.ExecutionError as exc:
         bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
 
diff --git a/import-layers/yocto-poky/meta/classes/testexport.bbclass b/import-layers/yocto-poky/meta/classes/testexport.bbclass
index 5147020..56edda9 100644
--- a/import-layers/yocto-poky/meta/classes/testexport.bbclass
+++ b/import-layers/yocto-poky/meta/classes/testexport.bbclass
@@ -33,162 +33,136 @@
 TEST_EXPORT_DEPENDS += "${@bb.utils.contains('TEST_EXPORT_SDK_ENABLED', '1', 'testexport-tarball:do_populate_sdk', '', d)}"
 TEST_EXPORT_LOCK = "${TMPDIR}/testimage.lock"
 
-python do_testexport() {
-    testexport_main(d)
-}
-
 addtask testexport
 do_testexport[nostamp] = "1"
 do_testexport[depends] += "${TEST_EXPORT_DEPENDS} ${TESTIMAGEDEPENDS}"
 do_testexport[lockfiles] += "${TEST_EXPORT_LOCK}"
 
-def exportTests(d,tc):
+python do_testexport() {
+    testexport_main(d)
+}
+
+def testexport_main(d):
     import json
+    import logging
+
+    from oeqa.runtime.context import OERuntimeTestContext
+    from oeqa.runtime.context import OERuntimeTestContextExecutor
+
+    image_name = ("%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'),
+                             d.getVar('IMAGE_LINK_NAME')))
+
+    tdname = "%s.testdata.json" % image_name
+    td = json.load(open(tdname, "r"))
+
+    logger = logging.getLogger("BitBake")
+
+    target = OERuntimeTestContextExecutor.getTarget(
+        d.getVar("TEST_TARGET"), None, d.getVar("TEST_TARGET_IP"),
+        d.getVar("TEST_SERVER_IP"))
+
+    host_dumper = OERuntimeTestContextExecutor.getHostDumper(
+        d.getVar("testimage_dump_host"), d.getVar("TESTIMAGE_DUMP_DIR"))
+
+    image_manifest = "%s.manifest" % image_name
+    image_packages = OERuntimeTestContextExecutor.readPackagesManifest(image_manifest)
+
+    extract_dir = d.getVar("TEST_EXTRACTED_DIR")
+
+    tc = OERuntimeTestContext(td, logger, target, host_dumper,
+                              image_packages, extract_dir)
+
+    copy_needed_files(d, tc)
+
+def copy_needed_files(d, tc):
     import shutil
-    import pkgutil
-    import re
     import oe.path
 
-    exportpath = d.getVar("TEST_EXPORT_DIR", True)
+    from oeqa.utils.package_manager import _get_json_file
+    from oeqa.core.utils.test import getSuiteCasesFiles
 
-    savedata = {}
-    savedata["d"] = {}
-    savedata["target"] = {}
-    savedata["target"]["ip"] = tc.target.ip or d.getVar("TEST_TARGET_IP", True)
-    savedata["target"]["server_ip"] = tc.target.server_ip or d.getVar("TEST_SERVER_IP", True)
+    export_path = d.getVar('TEST_EXPORT_DIR')
+    corebase_path = d.getVar('COREBASE')
 
-    keys = [ key for key in d.keys() if not key.startswith("_") and not key.startswith("BB") \
-            and not key.startswith("B_pn") and not key.startswith("do_") and not d.getVarFlag(key, "func", True)]
-    for key in keys:
-        try:
-            savedata["d"][key] = d.getVar(key, True)
-        except bb.data_smart.ExpansionError:
-            # we don't care about those anyway
-            pass
+    # Clean everything before starting
+    oe.path.remove(export_path)
+    bb.utils.mkdirhier(os.path.join(export_path, 'lib', 'oeqa'))
 
-    json_file = os.path.join(exportpath, "testdata.json")
-    with open(json_file, "w") as f:
-            json.dump(savedata, f, skipkeys=True, indent=4, sort_keys=True)
+    # The source of files to copy are relative to 'COREBASE' directory
+    # The destination is relative to 'TEST_EXPORT_DIR'
+    # Because we are squashing the libraries, we need to remove
+    # the layer/script directory
+    files_to_copy = [ os.path.join('meta', 'lib', 'oeqa', 'core'),
+                      os.path.join('meta', 'lib', 'oeqa', 'runtime'),
+                      os.path.join('meta', 'lib', 'oeqa', 'files'),
+                      os.path.join('meta', 'lib', 'oeqa', 'utils'),
+                      os.path.join('scripts', 'oe-test'),
+                      os.path.join('scripts', 'lib', 'argparse_oe.py'),
+                      os.path.join('scripts', 'lib', 'scriptutils.py'), ]
 
-    # Replace absolute path with relative in the file
-    exclude_path = os.path.join(d.getVar("COREBASE", True),'meta','lib','oeqa')
-    f1 = open(json_file,'r').read()
-    f2 = open(json_file,'w')
-    m = f1.replace(exclude_path,'oeqa')
-    f2.write(m)
-    f2.close()
+    for f in files_to_copy:
+        src = os.path.join(corebase_path, f)
+        dst = os.path.join(export_path, f.split('/', 1)[-1])
+        if os.path.isdir(src):
+            oe.path.copytree(src, dst)
+        else:
+            shutil.copy2(src, dst)
 
-    # now start copying files
-    # we'll basically copy everything under meta/lib/oeqa, with these exceptions
-    #  - oeqa/targetcontrol.py - not needed
-    #  - oeqa/selftest - something else
-    # That means:
-    #   - all tests from oeqa/runtime defined in TEST_SUITES (including from other layers)
-    #   - the contents of oeqa/utils and oeqa/runtime/files
-    #   - oeqa/oetest.py and oeqa/runexport.py (this will get copied to exportpath not exportpath/oeqa)
-    #   - __init__.py files
-    bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/runtime/files"))
-    bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/utils"))
-    # copy test modules, this should cover tests in other layers too
-    bbpath = d.getVar("BBPATH", True).split(':')
-    for t in tc.testslist:
-        isfolder = False
-        if re.search("\w+\.\w+\.test_\S+", t):
-            t = '.'.join(t.split('.')[:3])
-        mod = pkgutil.get_loader(t)
-        # More depth than usual?
-        if (t.count('.') > 2):
-            for p in bbpath:
-                foldername = os.path.join(p, 'lib',  os.sep.join(t.split('.')).rsplit(os.sep, 1)[0])
-                if os.path.isdir(foldername):
-                    isfolder = True
-                    target_folder = os.path.join(exportpath, "oeqa", "runtime", os.path.basename(foldername))
-                    if not os.path.exists(target_folder):
-                        oe.path.copytree(foldername, target_folder)
-        if not isfolder:
-            shutil.copy2(mod.path, os.path.join(exportpath, "oeqa/runtime"))
-            json_file = "%s.json" % mod.path.rsplit(".", 1)[0]
-            if os.path.isfile(json_file):
-                shutil.copy2(json_file, os.path.join(exportpath, "oeqa/runtime"))
-    # Get meta layer
-    for layer in d.getVar("BBLAYERS", True).split():
-        if os.path.basename(layer) == "meta":
-            meta_layer = layer
-            break
-    # copy oeqa/oetest.py and oeqa/runexported.py
-    oeqadir = os.path.join(meta_layer, "lib/oeqa")
-    shutil.copy2(os.path.join(oeqadir, "oetest.py"), os.path.join(exportpath, "oeqa"))
-    shutil.copy2(os.path.join(oeqadir, "runexported.py"), exportpath)
-    # copy oeqa/utils/*.py
-    for root, dirs, files in os.walk(os.path.join(oeqadir, "utils")):
-        for f in files:
-            if f.endswith(".py"):
-                shutil.copy2(os.path.join(root, f), os.path.join(exportpath, "oeqa/utils"))
-    # copy oeqa/runtime/files/*
-    for root, dirs, files in os.walk(os.path.join(oeqadir, "runtime/files")):
-        for f in files:
-            shutil.copy2(os.path.join(root, f), os.path.join(exportpath, "oeqa/runtime/files"))
+    # Remove cases and just copy the ones specified
+    cases_path = os.path.join(export_path, 'lib', 'oeqa', 'runtime', 'cases')
+    oe.path.remove(cases_path)
+    bb.utils.mkdirhier(cases_path)
+    test_paths = get_runtime_paths(d)
+    test_modules = d.getVar('TEST_SUITES')
+    tc.loadTests(test_paths, modules=test_modules)
+    for f in getSuiteCasesFiles(tc.suites):
+        shutil.copy2(f, cases_path)
+        json_file = _get_json_file(f)
+        if json_file:
+            shutil.copy2(json_file, cases_path)
+
+    # Copy test data
+    image_name = ("%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'),
+                            d.getVar('IMAGE_LINK_NAME')))
+    image_manifest = "%s.manifest" % image_name
+    tdname = "%s.testdata.json" % image_name
+    test_data_path = os.path.join(export_path, 'data')
+    bb.utils.mkdirhier(test_data_path)
+    shutil.copy2(image_manifest, os.path.join(test_data_path, 'manifest'))
+    shutil.copy2(tdname, os.path.join(test_data_path, 'testdata.json'))
 
     # Create tar file for common parts of testexport
-    create_tarball(d, "testexport.tar.gz", d.getVar("TEST_EXPORT_DIR", True))
+    create_tarball(d, "testexport.tar.gz", d.getVar("TEST_EXPORT_DIR"))
 
     # Copy packages needed for runtime testing
-    test_pkg_dir = d.getVar("TEST_NEEDED_PACKAGES_DIR", True)
-    if os.listdir(test_pkg_dir):
-        export_pkg_dir = os.path.join(d.getVar("TEST_EXPORT_DIR", True), "packages")
+    package_extraction(d, tc.suites)
+    test_pkg_dir = d.getVar("TEST_NEEDED_PACKAGES_DIR")
+    if os.path.isdir(test_pkg_dir) and os.listdir(test_pkg_dir):
+        export_pkg_dir = os.path.join(d.getVar("TEST_EXPORT_DIR"), "packages")
         oe.path.copytree(test_pkg_dir, export_pkg_dir)
         # Create tar file for packages needed by the DUT
-        create_tarball(d, "testexport_packages_%s.tar.gz" % d.getVar("MACHINE", True), export_pkg_dir)
+        create_tarball(d, "testexport_packages_%s.tar.gz" % d.getVar("MACHINE"), export_pkg_dir)
 
     # Copy SDK
-    if d.getVar("TEST_EXPORT_SDK_ENABLED", True) == "1":
-        sdk_deploy = d.getVar("SDK_DEPLOY", True)
-        tarball_name = "%s.sh" % d.getVar("TEST_EXPORT_SDK_NAME", True)
+    if d.getVar("TEST_EXPORT_SDK_ENABLED") == "1":
+        sdk_deploy = d.getVar("SDK_DEPLOY")
+        tarball_name = "%s.sh" % d.getVar("TEST_EXPORT_SDK_NAME")
         tarball_path = os.path.join(sdk_deploy, tarball_name)
-        export_sdk_dir = os.path.join(d.getVar("TEST_EXPORT_DIR", True),
-                                      d.getVar("TEST_EXPORT_SDK_DIR", True))
+        export_sdk_dir = os.path.join(d.getVar("TEST_EXPORT_DIR"),
+                                      d.getVar("TEST_EXPORT_SDK_DIR"))
         bb.utils.mkdirhier(export_sdk_dir)
         shutil.copy2(tarball_path, export_sdk_dir)
 
         # Create tar file for the sdk
-        create_tarball(d, "testexport_sdk_%s.tar.gz" % d.getVar("SDK_ARCH", True), export_sdk_dir)
+        create_tarball(d, "testexport_sdk_%s.tar.gz" % d.getVar("SDK_ARCH"), export_sdk_dir)
 
-    bb.plain("Exported tests to: %s" % exportpath)
-
-def testexport_main(d):
-    from oeqa.oetest import ExportTestContext
-    from oeqa.targetcontrol import get_target_controller
-    from oeqa.utils.dump import get_host_dumper
-
-    test_create_extract_dirs(d)
-    export_dir = d.getVar("TEST_EXPORT_DIR", True)
-    bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
-    bb.utils.remove(export_dir, recurse=True)
-    bb.utils.mkdirhier(export_dir)
-
-    # the robot dance
-    target = get_target_controller(d)
-
-    # test context
-    tc = ExportTestContext(d, target)
-
-    # this is a dummy load of tests
-    # we are doing that to find compile errors in the tests themselves
-    # before booting the image
-    try:
-        tc.loadTests()
-    except Exception as e:
-        import traceback
-        bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
-
-    tc.extract_packages()
-    exportTests(d,tc)
+    bb.plain("Exported tests to: %s" % export_path)
 
 def create_tarball(d, tar_name, src_dir):
 
     import tarfile
 
-    tar_path = os.path.join(d.getVar("TEST_EXPORT_DIR", True), tar_name)
+    tar_path = os.path.join(d.getVar("TEST_EXPORT_DIR"), tar_name)
     current_dir = os.getcwd()
     src_dir = src_dir.rstrip('/')
     dir_name = os.path.dirname(src_dir)
@@ -200,7 +174,4 @@
     tar.close()
     os.chdir(current_dir)
 
-
-testexport_main[vardepsexclude] =+ "BB_ORIGENV"
-
 inherit testimage
diff --git a/import-layers/yocto-poky/meta/classes/testimage.bbclass b/import-layers/yocto-poky/meta/classes/testimage.bbclass
index 6b6781d..fb21460 100644
--- a/import-layers/yocto-poky/meta/classes/testimage.bbclass
+++ b/import-layers/yocto-poky/meta/classes/testimage.bbclass
@@ -35,9 +35,10 @@
 TEST_EXTRACTED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/extracted"
 TEST_PACKAGED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/packaged"
 
-RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'smart rpm', '', d)}"
+RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'dnf rpm', '', d)}"
+SYSTEMDSUITE = "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 MINTESTSUITE = "ping"
-NETTESTSUITE = "${MINTESTSUITE} ssh df date scp syslog"
+NETTESTSUITE = "${MINTESTSUITE} ssh df date scp oe_syslog ${SYSTEMDSUITE}"
 DEVTESTSUITE = "gcc kernelmodule ldd"
 
 DEFAULT_TEST_SUITES = "${MINTESTSUITE} auto"
@@ -48,11 +49,11 @@
 DEFAULT_TEST_SUITES_pn-core-image-lsb = "${NETTESTSUITE} pam parselogs ${RPMTESTSUITE}"
 DEFAULT_TEST_SUITES_pn-core-image-sato = "${NETTESTSUITE} connman xorg parselogs ${RPMTESTSUITE} \
     ${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python', '', d)}"
-DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} connman xorg perl python \
-    ${DEVTESTSUITE} parselogs ${RPMTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} buildcpio buildiptables buildgalculator \
+    connman ${DEVTESTSUITE} logrotate perl parselogs python ${RPMTESTSUITE} xorg"
 DEFAULT_TEST_SUITES_pn-core-image-lsb-dev = "${NETTESTSUITE} pam perl python parselogs ${RPMTESTSUITE}"
-DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcvs buildiptables buildgalculator \
-    connman ${DEVTESTSUITE} pam perl python parselogs ${RPMTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcpio buildiptables buildgalculator \
+    connman ${DEVTESTSUITE} logrotate pam parselogs perl python ${RPMTESTSUITE}"
 DEFAULT_TEST_SUITES_pn-meta-toolchain = "auto"
 
 # aarch64 has no graphics
@@ -60,7 +61,7 @@
 
 # qemumips is quite slow and has reached the timeout limit several times on the YP build cluster,
 # mitigate this by removing build tests for qemumips machines.
-MIPSREMOVE ??= "buildcvs buildiptables buildgalculator"
+MIPSREMOVE ??= "buildcpio buildiptables buildgalculator"
 DEFAULT_TEST_SUITES_remove_qemumips = "${MIPSREMOVE}"
 DEFAULT_TEST_SUITES_remove_qemumips64 = "${MIPSREMOVE}"
 
@@ -70,20 +71,22 @@
 TEST_TARGET ?= "qemu"
 
 TESTIMAGEDEPENDS = ""
-TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot"
+TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot"
 TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
 TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
-TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-native:do_populate_sysroot', '', d)}"
-TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python-smartpm-native:do_populate_sysroot', '', d)}"
+TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}"
+TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'dnf-native:do_populate_sysroot', '', d)}"
 TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'ipk', 'opkg-utils-native:do_populate_sysroot', '', d)}"
 TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'deb', 'apt-native:do_populate_sysroot', '', d)}"
-
+TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}"
 
 TESTIMAGELOCK = "${TMPDIR}/testimage.lock"
 TESTIMAGELOCK_qemuall = ""
 
 TESTIMAGE_DUMP_DIR ?= "/tmp/oe-saved-tests/"
 
+TESTIMAGE_UPDATE_VARS ?= "DL_DIR WORKDIR DEPLOY_DIR"
+
 testimage_dump_target () {
     top -bn1
     ps
@@ -112,6 +115,13 @@
 }
 
 python do_testimage() {
+
+    testimage_sanity(d)
+
+    if (d.getVar('IMAGE_PKGTYPE') == 'rpm'
+       and 'dnf' in d.getVar('TEST_SUITES')):
+        create_rpm_index(d)
+
     testimage_main(d)
 }
 
@@ -120,72 +130,244 @@
 do_testimage[depends] += "${TESTIMAGEDEPENDS}"
 do_testimage[lockfiles] += "${TESTIMAGELOCK}"
 
-def testimage_main(d):
-    import unittest
-    import os
-    import oeqa.runtime
-    import time
-    import signal
-    from oeqa.oetest import ImageTestContext
-    from oeqa.targetcontrol import get_target_controller
-    from oeqa.utils.dump import get_host_dumper
+def testimage_sanity(d):
+    if (d.getVar('TEST_TARGET') == 'simpleremote'
+        and (not d.getVar('TEST_TARGET_IP')
+             or not d.getVar('TEST_SERVER_IP'))):
+        bb.fatal('When TEST_TARGET is set to "simpleremote" '
+                 'TEST_TARGET_IP and TEST_SERVER_IP are needed too.')
 
-    pn = d.getVar("PN", True)
-    bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
-    test_create_extract_dirs(d)
+def testimage_main(d):
+    import os
+    import json
+    import signal
+    import logging
+
+    from bb.utils import export_proxies
+    from oeqa.core.utils.misc import updateTestData
+    from oeqa.runtime.context import OERuntimeTestContext
+    from oeqa.runtime.context import OERuntimeTestContextExecutor
+    from oeqa.core.target.qemu import supported_fstypes
+    from oeqa.core.utils.test import getSuiteCases
+    from oeqa.utils import make_logger_bitbake_compatible
+
+    def sigterm_exception(signum, stackframe):
+        """
+        Catch SIGTERM from worker in order to stop qemu.
+        """
+        raise RuntimeError
+
+    logger = make_logger_bitbake_compatible(logging.getLogger("BitBake"))
+    pn = d.getVar("PN")
+
+    bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR"))
+
+    image_name = ("%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'),
+                             d.getVar('IMAGE_LINK_NAME')))
+
+    tdname = "%s.testdata.json" % image_name
+    try:
+        td = json.load(open(tdname, "r"))
+    except (FileNotFoundError) as err:
+         bb.fatal('File %s Not Found. Have you built the image with INHERIT+="testimage" in the conf/local.conf?' % tdname)
+
+    # Some variables need to be updates (mostly paths) with the
+    # ones of the current environment because some tests require them.
+    updateTestData(d, td, d.getVar('TESTIMAGE_UPDATE_VARS').split())
+
+    image_manifest = "%s.manifest" % image_name
+    image_packages = OERuntimeTestContextExecutor.readPackagesManifest(image_manifest)
+
+    extract_dir = d.getVar("TEST_EXTRACTED_DIR")
+
+    # Get machine
+    machine = d.getVar("MACHINE")
+
+    # Get rootfs
+    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')
+                  if fs in supported_fstypes]
+    if not fstypes:
+        bb.fatal('Unsupported image type built. Add a comptible image to '
+                 'IMAGE_FSTYPES. Supported types: %s' %
+                 ', '.join(supported_fstypes))
+    rootfs = '%s.%s' % (image_name, fstypes[0])
+
+    # Get tmpdir (not really used, just for compatibility)
+    tmpdir = d.getVar("TMPDIR")
+
+    # Get deploy_dir_image (not really used, just for compatibility)
+    dir_image = d.getVar("DEPLOY_DIR_IMAGE")
+
+    # Get bootlog
+    bootlog = os.path.join(d.getVar("TEST_LOG_DIR"),
+                           'qemu_boot_log.%s' % d.getVar('DATETIME'))
+
+    # Get display
+    display = d.getVar("BB_ORIGENV").getVar("DISPLAY")
+
+    # Get kernel
+    kernel_name = ('%s-%s.bin' % (d.getVar("KERNEL_IMAGETYPE"), machine))
+    kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), kernel_name)
+
+    # Get boottime
+    boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT"))
+
+    # Get use_kvm
+    qemu_use_kvm = d.getVar("QEMU_USE_KVM")
+    if qemu_use_kvm and \
+       (qemu_use_kvm == 'True' and 'x86' in machine or \
+        d.getVar('MACHINE') in qemu_use_kvm.split()):
+        kvm = True
+    else:
+        kvm = False
+
+    # TODO: We use the current implementatin of qemu runner because of
+    # time constrains, qemu runner really needs a refactor too.
+    target_kwargs = { 'machine'     : machine,
+                      'rootfs'      : rootfs,
+                      'tmpdir'      : tmpdir,
+                      'dir_image'   : dir_image,
+                      'display'     : display,
+                      'kernel'      : kernel,
+                      'boottime'    : boottime,
+                      'bootlog'     : bootlog,
+                      'kvm'         : kvm,
+                    }
+
+    # TODO: Currently BBPATH is needed for custom loading of targets.
+    # It would be better to find these modules using instrospection.
+    target_kwargs['target_modules_path'] = d.getVar('BBPATH')
+
+    # runtime use network for download projects for build
+    export_proxies(d)
 
     # we need the host dumper in test context
-    host_dumper = get_host_dumper(d)
+    host_dumper = OERuntimeTestContextExecutor.getHostDumper(
+        d.getVar("testimage_dump_host"),
+        d.getVar("TESTIMAGE_DUMP_DIR"))
 
     # the robot dance
-    target = get_target_controller(d)
+    target = OERuntimeTestContextExecutor.getTarget(
+        d.getVar("TEST_TARGET"), None, d.getVar("TEST_TARGET_IP"),
+        d.getVar("TEST_SERVER_IP"), **target_kwargs)
 
     # test context
-    tc = ImageTestContext(d, target, host_dumper)
+    tc = OERuntimeTestContext(td, logger, target, host_dumper,
+                              image_packages, extract_dir)
 
-    # this is a dummy load of tests
-    # we are doing that to find compile errors in the tests themselves
-    # before booting the image
-    try:
-        tc.loadTests()
-    except Exception as e:
-        import traceback
-        bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
+    # Load tests before starting the target
+    test_paths = get_runtime_paths(d)
+    test_modules = d.getVar('TEST_SUITES')
+    tc.loadTests(test_paths, modules=test_modules)
 
-    tc.extract_packages()
-    target.deploy()
+    if not getSuiteCases(tc.suites):
+        bb.fatal('Empty test suite, please verify TEST_SUITES variable')
+
+    package_extraction(d, tc.suites)
+
+    bootparams = None
+    if d.getVar('VIRTUAL-RUNTIME_init_manager', '') == 'systemd':
+        # Add systemd.log_level=debug to enable systemd debug logging
+        bootparams = 'systemd.log_target=console'
+
+    results = None
+    orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
     try:
-        bootparams = None
-        if d.getVar('VIRTUAL-RUNTIME_init_manager', '') == 'systemd':
-            bootparams = 'systemd.log_level=debug systemd.log_target=console'
-        target.start(extra_bootparams=bootparams)
-        starttime = time.time()
-        result = tc.runTests()
-        stoptime = time.time()
-        if result.wasSuccessful():
-            bb.plain("%s - Ran %d test%s in %.3fs" % (pn, result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime))
-            msg = "%s - OK - All required tests passed" % pn
-            skipped = len(result.skipped)
-            if skipped:
-                msg += " (skipped=%d)" % skipped
-            bb.plain(msg)
+        # We need to check if runqemu ends unexpectedly
+        # or if the worker send us a SIGTERM
+        tc.target.start(extra_bootparams=bootparams)
+        results = tc.runTests()
+    except (RuntimeError, BlockingIOError) as err:
+        if isinstance(err, RuntimeError):
+            bb.error('testimage received SIGTERM, shutting down...')
         else:
-            bb.fatal("%s - FAILED - check the task log and the ssh log" % pn)
+            bb.error('runqemu failed, shutting down...')
+        if results:
+            results.stop()
+            results = None
     finally:
-        signal.signal(signal.SIGTERM, tc.origsigtermhandler)
-        target.stop()
+        signal.signal(signal.SIGTERM, orig_sigterm_handler)
+        tc.target.stop()
 
-def test_create_extract_dirs(d):
-    install_path = d.getVar("TEST_INSTALL_TMP_DIR", True)
-    package_path = d.getVar("TEST_PACKAGED_DIR", True)
-    extracted_path = d.getVar("TEST_EXTRACTED_DIR", True)
-    bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
-    bb.utils.remove(package_path, recurse=True)
-    bb.utils.mkdirhier(install_path)
-    bb.utils.mkdirhier(package_path)
-    bb.utils.mkdirhier(extracted_path)
+    # Show results (if we have them)
+    if not results:
+        bb.fatal('%s - FAILED - tests were interrupted during execution' % pn)
+    tc.logSummary(results, pn)
+    tc.logDetails()
+    if not results.wasSuccessful():
+        bb.fatal('%s - FAILED - check the task log and the ssh log' % pn)
 
+def get_runtime_paths(d):
+    """
+    Returns a list of paths where runtime test must reside.
 
-testimage_main[vardepsexclude] =+ "BB_ORIGENV"
+    Runtime tests are expected in <LAYER_DIR>/lib/oeqa/runtime/cases/
+    """
+    paths = []
+
+    for layer in d.getVar('BBLAYERS').split():
+        path = os.path.join(layer, 'lib/oeqa/runtime/cases')
+        if os.path.isdir(path):
+            paths.append(path)
+    return paths
+
+def create_index(arg):
+    import subprocess
+
+    index_cmd = arg
+    try:
+        bb.note("Executing '%s' ..." % index_cmd)
+        result = subprocess.check_output(index_cmd,
+                                        stderr=subprocess.STDOUT,
+                                        shell=True)
+        result = result.decode('utf-8')
+    except subprocess.CalledProcessError as e:
+        return("Index creation command '%s' failed with return code "
+               '%d:\n%s' % (e.cmd, e.returncode, e.output.decode("utf-8")))
+    if result:
+        bb.note(result)
+    return None
+
+def create_rpm_index(d):
+    # Index RPMs
+    rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
+    index_cmds = []
+    archs = (d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or '').replace('-', '_')
+
+    for arch in archs.split():
+        rpm_dir = os.path.join(d.getVar('DEPLOY_DIR_RPM'), arch)
+        idx_path = os.path.join(d.getVar('WORKDIR'), 'oe-testimage-repo', arch)
+
+        if not os.path.isdir(rpm_dir):
+            continue
+
+        lockfilename = os.path.join(d.getVar('DEPLOY_DIR_RPM'), 'rpm.lock')
+        lf = bb.utils.lockfile(lockfilename, False)
+        oe.path.copyhardlinktree(rpm_dir, idx_path)
+        # Full indexes overload a 256MB image so reduce the number of rpms
+        # in the feed. Filter to r* since we use the run-postinst packages and
+        # this leaves some allarch and machine arch packages too.
+        bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+        bb.utils.unlockfile(lf)
+        cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
+
+        # Create repodata
+        result = create_index(cmd)
+        if result:
+            bb.fatal('%s' % ('\n'.join(result)))
+
+def package_extraction(d, test_suites):
+    from oeqa.utils.package_manager import find_packages_to_extract
+    from oeqa.utils.package_manager import extract_packages
+
+    bb.utils.remove(d.getVar("TEST_NEEDED_PACKAGES_DIR"), recurse=True)
+    packages = find_packages_to_extract(test_suites)
+    if packages:
+        bb.utils.mkdirhier(d.getVar("TEST_INSTALL_TMP_DIR"))
+        bb.utils.mkdirhier(d.getVar("TEST_PACKAGED_DIR"))
+        bb.utils.mkdirhier(d.getVar("TEST_EXTRACTED_DIR"))
+        extract_packages(d, packages)
+
+testimage_main[vardepsexclude] += "BB_ORIGENV DATETIME"
 
 inherit testsdk
diff --git a/import-layers/yocto-poky/meta/classes/testsdk.bbclass b/import-layers/yocto-poky/meta/classes/testsdk.bbclass
index 43342b1..6a201aa 100644
--- a/import-layers/yocto-poky/meta/classes/testsdk.bbclass
+++ b/import-layers/yocto-poky/meta/classes/testsdk.bbclass
@@ -14,66 +14,72 @@
 #
 # where "<image-name>" is an image like core-image-sato.
 
-TEST_LOG_DIR ?= "${WORKDIR}/testimage"
-TESTSDKLOCK = "${TMPDIR}/testsdk.lock"
+def testsdk_main(d):
+    import os
+    import subprocess
+    import json
+    import logging
 
-def run_test_context(CTestContext, d, testdir, tcname, pn, *args):
-    import glob
-    import time
+    from bb.utils import export_proxies
+    from oeqa.core.runner import OEStreamLogger
+    from oeqa.sdk.context import OESDKTestContext, OESDKTestContextExecutor
+    from oeqa.utils import make_logger_bitbake_compatible
 
-    targets = glob.glob(d.expand(testdir + "/tc/environment-setup-*"))
-    for sdkenv in targets:
-        bb.plain("Testing %s" % sdkenv)
-        tc = CTestContext(d, testdir, sdkenv, tcname, args)
+    pn = d.getVar("PN")
+    logger = make_logger_bitbake_compatible(logging.getLogger("BitBake"))
 
-        # this is a dummy load of tests
-        # we are doing that to find compile errors in the tests themselves
-        # before booting the image
+    # sdk use network for download projects for build
+    export_proxies(d)
+
+    tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh")
+    if not os.path.exists(tcname):
+        bb.fatal("The toolchain %s is not built. Build it before running the tests: 'bitbake <image> -c populate_sdk' ." % tcname)
+
+    tdname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.testdata.json")
+    test_data = json.load(open(tdname, "r"))
+
+    target_pkg_manifest = OESDKTestContextExecutor._load_manifest(
+        d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.target.manifest"))
+    host_pkg_manifest = OESDKTestContextExecutor._load_manifest(
+        d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.host.manifest"))
+
+    sdk_dir = d.expand("${WORKDIR}/testimage-sdk/")
+    bb.utils.remove(sdk_dir, True)
+    bb.utils.mkdirhier(sdk_dir)
+    try:
+        subprocess.check_output("cd %s; %s <<EOF\n./\nY\nEOF" % (sdk_dir, tcname), shell=True)
+    except subprocess.CalledProcessError as e:
+        bb.fatal("Couldn't install the SDK:\n%s" % e.output.decode("utf-8"))
+
+    fail = False
+    sdk_envs = OESDKTestContextExecutor._get_sdk_environs(sdk_dir)
+    for s in sdk_envs:
+        sdk_env = sdk_envs[s]
+        bb.plain("SDK testing environment: %s" % s)
+        tc = OESDKTestContext(td=test_data, logger=logger, sdk_dir=sdk_dir,
+            sdk_env=sdk_env, target_pkg_manifest=target_pkg_manifest,
+            host_pkg_manifest=host_pkg_manifest)
+
         try:
-            tc.loadTests()
+            tc.loadTests(OESDKTestContextExecutor.default_cases)
         except Exception as e:
             import traceback
             bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
 
-        starttime = time.time()
         result = tc.runTests()
-        stoptime = time.time()
-        if result.wasSuccessful():
-            bb.plain("%s SDK(%s):%s - Ran %d test%s in %.3fs" % (pn, os.path.basename(tcname), os.path.basename(sdkenv),result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime))
-            msg = "%s - OK - All required tests passed" % pn
-            skipped = len(result.skipped)
-            if skipped:
-                msg += " (skipped=%d)" % skipped
-            bb.plain(msg)
-        else:
-            bb.fatal("%s - FAILED - check the task log and the commands log" % pn)
 
-def testsdk_main(d):
-    import os
-    import oeqa.sdk
-    import subprocess
-    from oeqa.oetest import SDKTestContext
+        component = "%s %s" % (pn, OESDKTestContextExecutor.name)
+        context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env))
 
-    pn = d.getVar("PN", True)
-    bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
+        tc.logSummary(result, component, context_msg)
+        tc.logDetails()
 
-    tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh")
-    if not os.path.exists(tcname):
-        bb.fatal("The toolchain is not built. Build it before running the tests: 'bitbake <image> -c populate_sdk' .")
+        if not result.wasSuccessful():
+            fail = True
 
-    sdktestdir = d.expand("${WORKDIR}/testimage-sdk/")
-    bb.utils.remove(sdktestdir, True)
-    bb.utils.mkdirhier(sdktestdir)
-    try:
-        subprocess.check_output("cd %s; %s <<EOF\n./tc\nY\nEOF" % (sdktestdir, tcname), shell=True)
-    except subprocess.CalledProcessError as e:
-        bb.fatal("Couldn't install the SDK:\n%s" % e.output.decode("utf-8"))
-
-    try:
-        run_test_context(SDKTestContext, d, sdktestdir, tcname, pn)
-    finally:
-        bb.utils.remove(sdktestdir, True)
-
+    if fail:
+        bb.fatal("%s - FAILED - check the task log and the commands log" % pn)
+  
 testsdk_main[vardepsexclude] =+ "BB_ORIGENV"
 
 python do_testsdk() {
@@ -81,46 +87,52 @@
 }
 addtask testsdk
 do_testsdk[nostamp] = "1"
-do_testsdk[lockfiles] += "${TESTSDKLOCK}"
-
-TEST_LOG_SDKEXT_DIR ?= "${WORKDIR}/testsdkext"
-TESTSDKEXTLOCK = "${TMPDIR}/testsdkext.lock"
 
 def testsdkext_main(d):
     import os
-    import oeqa.sdkext
+    import json
     import subprocess
-    from bb.utils import export_proxies
-    from oeqa.oetest import SDKTestContext, SDKExtTestContext
-    from oeqa.utils import avoid_paths_in_environ
+    import logging
 
+    from bb.utils import export_proxies
+    from oeqa.utils import avoid_paths_in_environ, make_logger_bitbake_compatible, subprocesstweak
+    from oeqa.sdkext.context import OESDKExtTestContext, OESDKExtTestContextExecutor
+
+    pn = d.getVar("PN")
+    logger = make_logger_bitbake_compatible(logging.getLogger("BitBake"))
 
     # extensible sdk use network
     export_proxies(d)
 
+    subprocesstweak.errors_have_output()
+
     # extensible sdk can be contaminated if native programs are
     # in PATH, i.e. use perl-native instead of eSDK one.
-    paths_to_avoid = [d.getVar('STAGING_DIR', True),
-                      d.getVar('BASE_WORKDIR', True)]
+    paths_to_avoid = [d.getVar('STAGING_DIR'),
+                      d.getVar('BASE_WORKDIR')]
     os.environ['PATH'] = avoid_paths_in_environ(paths_to_avoid)
 
-    pn = d.getVar("PN", True)
-    bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True))
-
     tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh")
     if not os.path.exists(tcname):
-        bb.fatal("The toolchain ext is not built. Build it before running the" \
-                 " tests: 'bitbake <image> -c populate_sdk_ext' .")
+        bb.fatal("The toolchain ext %s is not built. Build it before running the" \
+                 " tests: 'bitbake <image> -c populate_sdk_ext' ." % tcname)
 
-    testdir = d.expand("${WORKDIR}/testsdkext/")
-    bb.utils.remove(testdir, True)
-    bb.utils.mkdirhier(testdir)
-    sdkdir = os.path.join(testdir, 'tc')
+    tdname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.testdata.json")
+    test_data = json.load(open(tdname, "r"))
+
+    target_pkg_manifest = OESDKExtTestContextExecutor._load_manifest(
+        d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest"))
+    host_pkg_manifest = OESDKExtTestContextExecutor._load_manifest(
+        d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.host.manifest"))
+
+    sdk_dir = d.expand("${WORKDIR}/testsdkext/")
+    bb.utils.remove(sdk_dir, True)
+    bb.utils.mkdirhier(sdk_dir)
     try:
-        subprocess.check_output("%s -y -d %s" % (tcname, sdkdir), shell=True)
+        subprocess.check_output("%s -y -d %s" % (tcname, sdk_dir), shell=True)
     except subprocess.CalledProcessError as e:
         msg = "Couldn't install the extensible SDK:\n%s" % e.output.decode("utf-8")
-        logfn = os.path.join(sdkdir, 'preparing_build_system.log')
+        logfn = os.path.join(sdk_dir, 'preparing_build_system.log')
         if os.path.exists(logfn):
             msg += '\n\nContents of preparing_build_system.log:\n'
             with open(logfn, 'r') as f:
@@ -128,19 +140,47 @@
                     msg += line
         bb.fatal(msg)
 
-    try:
-        bb.plain("Running SDK Compatibility tests ...")
-        run_test_context(SDKExtTestContext, d, testdir, tcname, pn, True)
-    finally:
-        pass
+    fail = False
+    sdk_envs = OESDKExtTestContextExecutor._get_sdk_environs(sdk_dir)
+    for s in sdk_envs:
+        bb.plain("Extensible SDK testing environment: %s" % s)
 
-    try:
-        bb.plain("Running Extensible SDK tests ...")
-        run_test_context(SDKExtTestContext, d, testdir, tcname, pn)
-    finally:
-        pass
+        sdk_env = sdk_envs[s]
 
-    bb.utils.remove(testdir, True)
+        # Use our own SSTATE_DIR and DL_DIR so that updates to the eSDK come from our sstate cache
+        # and we don't spend hours downloading kernels for the kernel module test
+        # Abuse auto.conf since local.conf would be overwritten by the SDK
+        with open(os.path.join(sdk_dir, 'conf', 'auto.conf'), 'a+') as f:
+            f.write('SSTATE_MIRRORS += " \\n file://.* file://%s/PATH"\n' % test_data.get('SSTATE_DIR'))
+            f.write('SOURCE_MIRROR_URL = "file://%s"\n' % test_data.get('DL_DIR'))
+            f.write('INHERIT += "own-mirrors"')
+
+        # We need to do this in case we have a minimal SDK
+        subprocess.check_output(". %s > /dev/null; devtool sdk-install meta-extsdk-toolchain" % sdk_env, cwd=sdk_dir, shell=True)
+
+        tc = OESDKExtTestContext(td=test_data, logger=logger, sdk_dir=sdk_dir,
+            sdk_env=sdk_env, target_pkg_manifest=target_pkg_manifest,
+            host_pkg_manifest=host_pkg_manifest)
+
+        try:
+            tc.loadTests(OESDKExtTestContextExecutor.default_cases)
+        except Exception as e:
+            import traceback
+            bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
+
+        result = tc.runTests()
+
+        component = "%s %s" % (pn, OESDKExtTestContextExecutor.name)
+        context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env))
+
+        tc.logSummary(result, component, context_msg)
+        tc.logDetails()
+
+        if not result.wasSuccessful():
+            fail = True
+
+    if fail:
+        bb.fatal("%s - FAILED - check the task log and the commands log" % pn)
 
 testsdkext_main[vardepsexclude] =+ "BB_ORIGENV"
 
@@ -149,4 +189,4 @@
 }
 addtask testsdkext
 do_testsdkext[nostamp] = "1"
-do_testsdkext[lockfiles] += "${TESTSDKEXTLOCK}"
+
diff --git a/import-layers/yocto-poky/meta/classes/texinfo.bbclass b/import-layers/yocto-poky/meta/classes/texinfo.bbclass
index 92efbcc..6b0def0 100644
--- a/import-layers/yocto-poky/meta/classes/texinfo.bbclass
+++ b/import-layers/yocto-poky/meta/classes/texinfo.bbclass
@@ -1,10 +1,10 @@
 # This class is inherited by recipes whose upstream packages invoke the
 # texinfo utilities at build-time. Native and cross recipes are made to use the
-# dummy scripts provided by texinfo-dummy-native, for improved performance. 
-# Target architecture recipes use the genuine Texinfo utilities. By default, 
+# dummy scripts provided by texinfo-dummy-native, for improved performance.
+# Target architecture recipes use the genuine Texinfo utilities. By default,
 # they use the Texinfo utilities on the host system. If you want to use the
-# Texinfo recipe shipped with yoco, you can remove texinfo-native from 
-# ASSUME_PROVIDED and makeinfo from SANITY_REQUIRED_UTILITIES.
+# Texinfo recipe, you can remove texinfo-native from ASSUME_PROVIDED and
+# makeinfo from SANITY_REQUIRED_UTILITIES.
 
 TEXDEP = "texinfo-native"
 TEXDEP_class-native = "texinfo-dummy-native"
@@ -13,3 +13,6 @@
 PATH_prepend_class-native = "${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:"
 PATH_prepend_class-cross = "${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:"
 
+# libtool-cross doesn't inherit cross
+TEXDEP_pn-libtool-cross = "texinfo-dummy-native"
+PATH_prepend_pn-libtool-cross = "${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:"
diff --git a/import-layers/yocto-poky/meta/classes/tinderclient.bbclass b/import-layers/yocto-poky/meta/classes/tinderclient.bbclass
index 917b74d..00f453c 100644
--- a/import-layers/yocto-poky/meta/classes/tinderclient.bbclass
+++ b/import-layers/yocto-poky/meta/classes/tinderclient.bbclass
@@ -55,22 +55,22 @@
 
     # the variables we will need to send on this form post
     variables =  {
-        "tree"         : d.getVar('TINDER_TREE', True),
-        "machine_name" : d.getVar('TINDER_MACHINE', True),
+        "tree"         : d.getVar('TINDER_TREE'),
+        "machine_name" : d.getVar('TINDER_MACHINE'),
         "os"           : os.uname()[0],
         "os_version"   : os.uname()[2],
         "compiler"     : "gcc",
-        "clobber"      : d.getVar('TINDER_CLOBBER', True) or "0",
-        "srcdate"      : d.getVar('SRCDATE', True),
-        "PN"           : d.getVar('PN', True),
-        "PV"           : d.getVar('PV', True),
-        "PR"           : d.getVar('PR', True),
-        "FILE"         : d.getVar('FILE', True) or "N/A",
-        "TARGETARCH"   : d.getVar('TARGET_ARCH', True),
-        "TARGETFPU"    : d.getVar('TARGET_FPU', True) or "Unknown",
-        "TARGETOS"     : d.getVar('TARGET_OS', True) or "Unknown",
-        "MACHINE"      : d.getVar('MACHINE', True) or "Unknown",
-        "DISTRO"       : d.getVar('DISTRO', True) or "Unknown",
+        "clobber"      : d.getVar('TINDER_CLOBBER') or "0",
+        "srcdate"      : d.getVar('SRCDATE'),
+        "PN"           : d.getVar('PN'),
+        "PV"           : d.getVar('PV'),
+        "PR"           : d.getVar('PR'),
+        "FILE"         : d.getVar('FILE') or "N/A",
+        "TARGETARCH"   : d.getVar('TARGET_ARCH'),
+        "TARGETFPU"    : d.getVar('TARGET_FPU') or "Unknown",
+        "TARGETOS"     : d.getVar('TARGET_OS') or "Unknown",
+        "MACHINE"      : d.getVar('MACHINE') or "Unknown",
+        "DISTRO"       : d.getVar('DISTRO') or "Unknown",
         "zecke-rocks"  : "sure",
     }
 
@@ -82,7 +82,7 @@
     # we only need on build_status.pl but sending it
     # always does not hurt
     try:
-        f = open(d.getVar('TMPDIR',True)+'/tinder-machine.id', 'r')
+        f = open(d.getVar('TMPDIR')+'/tinder-machine.id', 'r')
         id = f.read()
         variables['machine_id'] = id
     except:
@@ -106,8 +106,8 @@
 
     # get the body and type
     content_type, body = tinder_format_http_post(d,None,None)
-    server = d.getVar('TINDER_HOST', True )
-    url    = d.getVar('TINDER_URL', True )
+    server = d.getVar('TINDER_HOST')
+    url    = d.getVar('TINDER_URL')
 
     selector = url + "/xml/build_start.pl"
 
@@ -127,7 +127,7 @@
 
     # now we will need to save the machine number
     # we will override any previous numbers
-    f = open(d.getVar('TMPDIR', True)+"/tinder-machine.id", 'w')
+    f = open(d.getVar('TMPDIR')+"/tinder-machine.id", 'w')
     f.write(report)
 
 
@@ -137,8 +137,8 @@
     """
 
     # get the body and type
-    server = d.getVar('TINDER_HOST', True)
-    url    = d.getVar('TINDER_URL', True)
+    server = d.getVar('TINDER_HOST')
+    url    = d.getVar('TINDER_URL')
 
     selector = url + "/xml/build_status.pl"
 
@@ -163,16 +163,16 @@
     time    = tinder_time_string()
     ops     = os.uname()[0]
     version = os.uname()[2]
-    url     = d.getVar( 'TINDER_URL' , True )
-    tree    = d.getVar( 'TINDER_TREE', True )
-    branch  = d.getVar( 'TINDER_BRANCH', True )
-    srcdate = d.getVar( 'SRCDATE', True )
-    machine = d.getVar( 'MACHINE', True )
-    distro  = d.getVar( 'DISTRO', True )
-    bbfiles = d.getVar( 'BBFILES', True )
-    tarch   = d.getVar( 'TARGET_ARCH', True )
-    fpu     = d.getVar( 'TARGET_FPU', True )
-    oerev   = d.getVar( 'OE_REVISION', True ) or "unknown"
+    url     = d.getVar('TINDER_URL')
+    tree    = d.getVar('TINDER_TREE')
+    branch  = d.getVar('TINDER_BRANCH')
+    srcdate = d.getVar('SRCDATE')
+    machine = d.getVar('MACHINE')
+    distro  = d.getVar('DISTRO')
+    bbfiles = d.getVar('BBFILES')
+    tarch   = d.getVar('TARGET_ARCH')
+    fpu     = d.getVar('TARGET_FPU')
+    oerev   = d.getVar('OE_REVISION') or "unknown"
 
     # there is a bug with tipple quoted strings
     # i will work around but will fix the original
@@ -278,7 +278,7 @@
 
         try:
             # truncate the tinder log file
-            f = open(event.data.getVar('TINDER_LOG', True), 'w')
+            f = open(event.data.getVar('TINDER_LOG'), 'w')
             f.write("")
             f.close()
         except:
@@ -287,7 +287,7 @@
         try:
             # write a status to the file. This is needed for the -k option
             # of BitBake
-            g = open(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w')
+            g = open(event.data.getVar('TMPDIR')+"/tinder-status", 'w')
             g.write("")
             g.close()
         except IOError:
@@ -296,10 +296,10 @@
     # Append the Task-Log (compile,configure...) to the log file
     # we will send to the server
     if name == "TaskSucceeded" or name == "TaskFailed":
-        log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T', True), event.task))
+        log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T'), event.task))
 
         if len(log_file) != 0:
-            to_file  = event.data.getVar('TINDER_LOG', True)
+            to_file  = event.data.getVar('TINDER_LOG')
             log     += "".join(open(log_file[0], 'r').readlines())
 
     # set the right 'HEADER'/Summary for the TinderBox
@@ -310,23 +310,23 @@
     elif name == "TaskFailed":
         log += "<--- TINDERBOX Task %s failed (FAILURE)\n" % event.task
     elif name == "PkgStarted":
-        log += "---> TINDERBOX Package %s started\n" % event.data.getVar('PF', True)
+        log += "---> TINDERBOX Package %s started\n" % event.data.getVar('PF')
     elif name == "PkgSucceeded":
-        log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % event.data.getVar('PF', True)
+        log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % event.data.getVar('PF')
     elif name == "PkgFailed":
-        if not event.data.getVar('TINDER_AUTOBUILD', True) == "0":
+        if not event.data.getVar('TINDER_AUTOBUILD') == "0":
             build.exec_task('do_clean', event.data)
-        log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % event.data.getVar('PF', True)
+        log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % event.data.getVar('PF')
         status = 200
         # remember the failure for the -k case
-        h = open(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w')
+        h = open(event.data.getVar('TMPDIR')+"/tinder-status", 'w')
         h.write("200")
     elif name == "BuildCompleted":
         log += "Build Completed\n"
         status = 100
         # Check if we have a old status...
         try:
-            h = open(event.data.getVar('TMPDIR',True)+'/tinder-status', 'r')
+            h = open(event.data.getVar('TMPDIR')+'/tinder-status', 'r')
             status = int(h.read())
         except:
             pass
@@ -342,7 +342,7 @@
         log += "Error:Was Runtime: %d\n" % event.isRuntime()
         status = 200
         # remember the failure for the -k case
-        h = open(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w')
+        h = open(event.data.getVar('TMPDIR')+"/tinder-status", 'w')
         h.write("200")
 
     # now post the log
@@ -360,7 +360,7 @@
     if e.data is None or bb.event.getName(e) == "MsgNote":
         return
 
-    do_tinder_report = e.data.getVar('TINDER_REPORT', True)
+    do_tinder_report = e.data.getVar('TINDER_REPORT')
     if do_tinder_report and do_tinder_report == "1":
         tinder_do_tinder_report(e)
 
diff --git a/import-layers/yocto-poky/meta/classes/toaster.bbclass b/import-layers/yocto-poky/meta/classes/toaster.bbclass
index 4bddf34..6cef0b8 100644
--- a/import-layers/yocto-poky/meta/classes/toaster.bbclass
+++ b/import-layers/yocto-poky/meta/classes/toaster.bbclass
@@ -80,7 +80,7 @@
         return layer_info
 
 
-    bblayers = e.data.getVar("BBLAYERS", True)
+    bblayers = e.data.getVar("BBLAYERS")
 
     llayerinfo = {}
 
@@ -119,10 +119,10 @@
     """
 
     # No need to try and dumpdata if the recipe isn't generating packages
-    if not d.getVar('PACKAGES', True):
+    if not d.getVar('PACKAGES'):
         return
 
-    pkgdatadir = d.getVar('PKGDESTWORK', True)
+    pkgdatadir = d.getVar('PKGDESTWORK')
     lpkgdata = {}
     datadir = os.path.join(pkgdatadir, 'runtime')
 
@@ -142,7 +142,7 @@
     """
 
     event_data = {
-      "TOOLCHAIN_OUTPUTNAME": d.getVar("TOOLCHAIN_OUTPUTNAME", True)
+      "TOOLCHAIN_OUTPUTNAME": d.getVar("TOOLCHAIN_OUTPUTNAME")
     }
 
     bb.event.fire(bb.event.MetadataEvent("SDKArtifactInfo", event_data), d)
@@ -157,11 +157,11 @@
     import bb.utils
     import os
 
-    toaster_statlist_file = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), "toasterstatlist")
-
-    if not e.data.getVar('BUILDSTATS_BASE', True):
+    if not e.data.getVar('BUILDSTATS_BASE'):
         return  # if we don't have buildstats, we cannot collect stats
 
+    toaster_statlist_file = os.path.join(e.data.getVar('BUILDSTATS_BASE'), "toasterstatlist")
+
     def stat_to_float(value):
         return float(value.strip('% \n\r'))
 
@@ -246,7 +246,7 @@
     import re
     BUILDHISTORY_DIR = e.data.expand("${TOPDIR}/buildhistory")
     BUILDHISTORY_DIR_IMAGE_BASE = e.data.expand("%s/images/${MACHINE_ARCH}/${TCLIBC}/"% BUILDHISTORY_DIR)
-    pkgdata_dir = e.data.getVar("PKGDATA_DIR", True)
+    pkgdata_dir = e.data.getVar("PKGDATA_DIR")
 
 
     # scan the build targets for this build
@@ -265,28 +265,33 @@
             with open("%s/installed-package-sizes.txt" % installed_img_path, "r") as fin:
                 for line in fin:
                     line = line.rstrip(";")
-                    psize, px = line.split("\t")
-                    punit, pname = px.split(" ")
+                    psize, punit, pname = line.split()
                     # this size is "installed-size" as it measures how much space it takes on disk
                     images[target][pname.strip()] = {'size':int(psize)*1024, 'depends' : []}
 
             with open("%s/depends.dot" % installed_img_path, "r") as fin:
-                p = re.compile(r' -> ')
-                dot = re.compile(r'.*style=dotted')
+                p = re.compile(r'\s*"(?P<name>[^"]+)"\s*->\s*"(?P<dep>[^"]+)"(?P<rec>.*?\[style=dotted\])?')
                 for line in fin:
-                    line = line.rstrip(';')
-                    linesplit = p.split(line)
-                    if len(linesplit) == 2:
-                        pname = linesplit[0].rstrip('"').strip('"')
-                        dependsname = linesplit[1].split(" ")[0].strip().strip(";").strip('"').rstrip('"')
-                        deptype = "depends"
-                        if dot.match(line):
-                            deptype = "recommends"
-                        if not pname in images[target]:
-                            images[target][pname] = {'size': 0, 'depends' : []}
-                        if not dependsname in images[target]:
-                            images[target][dependsname] = {'size': 0, 'depends' : []}
-                        images[target][pname]['depends'].append((dependsname, deptype))
+                    m = p.match(line)
+                    if not m:
+                        continue
+                    pname = m.group('name')
+                    dependsname = m.group('dep')
+                    deptype = 'recommends' if m.group('rec') else 'depends'
+
+                    # If RPM is used for packaging, then there may be
+                    # dependencies such as "/bin/sh", which will confuse
+                    # _toaster_load_pkgdatafile() later on. While at it, ignore
+                    # any dependencies that contain parentheses, e.g.,
+                    # "libc.so.6(GLIBC_2.7)".
+                    if dependsname.startswith('/') or '(' in dependsname:
+                        continue
+
+                    if not pname in images[target]:
+                        images[target][pname] = {'size': 0, 'depends' : []}
+                    if not dependsname in images[target]:
+                        images[target][dependsname] = {'size': 0, 'depends' : []}
+                    images[target][pname]['depends'].append((dependsname, deptype))
 
             # files-in-image.txt is only generated if an image file is created,
             # so the file entries ('syms', 'dirs', 'files') for a target will be
@@ -329,8 +334,18 @@
     if e.taskname in ["do_deploy", "do_image_complete", "do_populate_sdk", "do_populate_sdk_ext"]:
         d2 = d.createCopy()
         d2.setVar('FILE', e.taskfile)
-        d2.setVar('SSTATE_MANMACH', d2.expand("${MACHINE}"))
+        # Use 'stamp-extra-info' if present, else use workaround
+        # to determine 'SSTATE_MANMACH'
+        extrainf = d2.getVarFlag(e.taskname, 'stamp-extra-info')
+        if extrainf:
+            d2.setVar('SSTATE_MANMACH', extrainf)
+        else:
+            if "do_populate_sdk" == e.taskname:
+                d2.setVar('SSTATE_MANMACH', d2.expand("${MACHINE}${SDKMACHINE}"))
+            else:
+                d2.setVar('SSTATE_MANMACH', d2.expand("${MACHINE}"))
         manifest = oe.sstatesig.sstate_get_manifest_filename(e.taskname[3:], d2)[0]
+
         if os.access(manifest, os.R_OK):
             with open(manifest) as fmanifest:
                 artifacts = [fname.strip() for fname in fmanifest]
@@ -357,8 +372,9 @@
 do_package[postfuncs] += "toaster_package_dumpdata "
 do_package[vardepsexclude] += "toaster_package_dumpdata "
 
-do_populate_sdk[postfuncs] += "toaster_artifact_dumpdata "
-do_populate_sdk[vardepsexclude] += "toaster_artifact_dumpdata "
+#do_populate_sdk[postfuncs] += "toaster_artifact_dumpdata "
+#do_populate_sdk[vardepsexclude] += "toaster_artifact_dumpdata "
 
-do_populate_sdk_ext[postfuncs] += "toaster_artifact_dumpdata "
-do_populate_sdk_ext[vardepsexclude] += "toaster_artifact_dumpdata "
\ No newline at end of file
+#do_populate_sdk_ext[postfuncs] += "toaster_artifact_dumpdata "
+#do_populate_sdk_ext[vardepsexclude] += "toaster_artifact_dumpdata "
+
diff --git a/import-layers/yocto-poky/meta/classes/toolchain-scripts.bbclass b/import-layers/yocto-poky/meta/classes/toolchain-scripts.bbclass
index 0e11f2d..260ece9 100644
--- a/import-layers/yocto-poky/meta/classes/toolchain-scripts.bbclass
+++ b/import-layers/yocto-poky/meta/classes/toolchain-scripts.bbclass
@@ -31,7 +31,6 @@
 		EXTRAPATH="$EXTRAPATH:$sdkpathnative$bindir/${TARGET_ARCH}${TARGET_VENDOR}-$i"
 	done
 	echo "export PATH=$sdkpathnative$bindir:$sdkpathnative$sbindir:$sdkpathnative$base_bindir:$sdkpathnative$base_sbindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':$PATH' >> $script
-	echo "export CCACHE_PATH=$sdkpathnative$bindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':$CCACHE_PATH' >> $script
 	echo 'export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT' >> $script
 	echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig:$SDKTARGETSYSROOT'"$prefix"'/share/pkgconfig' >> $script
 	echo 'export CONFIG_SITE=${SDKPATH}/site-config-'"${multimach_target_sys}" >> $script
@@ -50,7 +49,6 @@
 	rm -f $script
 	touch $script
 	echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${PATH}' >> $script
-	echo 'export CCACHE_PATH=${STAGING_DIR_NATIVE}/usr/bin:${CCACHE_PATH}' >> $script
 	echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script
 	echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script
 	echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script
@@ -108,6 +106,7 @@
 TOOLCHAIN_CONFIGSITE_NOCACHE = "${@siteinfo_get_files(d)}"
 TOOLCHAIN_CONFIGSITE_SYSROOTCACHE = "${STAGING_DIR}/${MLPREFIX}${MACHINE}/${target_datadir}/${TARGET_SYS}_config_site.d"
 TOOLCHAIN_NEED_CONFIGSITE_CACHE ??= "virtual/${MLPREFIX}libc ncurses"
+DEPENDS += "${TOOLCHAIN_NEED_CONFIGSITE_CACHE}"
 
 #This function create a site config file
 toolchain_create_sdk_siteconfig () {
@@ -139,9 +138,9 @@
 python __anonymous () {
     import oe.classextend
     deps = ""
-    for dep in (d.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE', True) or "").split():
+    for dep in (d.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE') or "").split():
         deps += " %s:do_populate_sysroot" % dep
-        for variant in (d.getVar('MULTILIB_VARIANTS', True) or "").split():
+        for variant in (d.getVar('MULTILIB_VARIANTS') or "").split():
             clsextend = oe.classextend.ClassExtender(variant, d)
             newdep = clsextend.extend_name(dep)
             deps += " %s:do_populate_sysroot" % newdep
diff --git a/import-layers/yocto-poky/meta/classes/typecheck.bbclass b/import-layers/yocto-poky/meta/classes/typecheck.bbclass
index 6bff7c7..72da932 100644
--- a/import-layers/yocto-poky/meta/classes/typecheck.bbclass
+++ b/import-layers/yocto-poky/meta/classes/typecheck.bbclass
@@ -5,7 +5,7 @@
 python check_types() {
     import oe.types
     for key in e.data.keys():
-        if e.data.getVarFlag(key, "type", True):
+        if e.data.getVarFlag(key, "type"):
             oe.data.typed_value(key, e.data)
 }
 addhandler check_types
diff --git a/import-layers/yocto-poky/meta/classes/uboot-config.bbclass b/import-layers/yocto-poky/meta/classes/uboot-config.bbclass
index 3f760f2..10013b7 100644
--- a/import-layers/yocto-poky/meta/classes/uboot-config.bbclass
+++ b/import-layers/yocto-poky/meta/classes/uboot-config.bbclass
@@ -14,19 +14,19 @@
 UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}"
 
 python () {
-    ubootmachine = d.getVar("UBOOT_MACHINE", True)
+    ubootmachine = d.getVar("UBOOT_MACHINE")
     ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
-    ubootbinary = d.getVar('UBOOT_BINARY', True)
-    ubootbinaries = d.getVar('UBOOT_BINARIES', True)
+    ubootbinary = d.getVar('UBOOT_BINARY')
+    ubootbinaries = d.getVar('UBOOT_BINARIES')
     # The "doc" varflag is special, we don't want to see it here
     ubootconfigflags.pop('doc', None)
 
     if not ubootmachine and not ubootconfigflags:
-        PN = d.getVar("PN", True)
-        FILE = os.path.basename(d.getVar("FILE", True))
+        PN = d.getVar("PN")
+        FILE = os.path.basename(d.getVar("FILE"))
         bb.debug(1, "To build %s, see %s for instructions on \
                  setting up your machine config" % (PN, FILE))
-        raise bb.parse.SkipPackage("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE", True))
+        raise bb.parse.SkipPackage("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE"))
 
     if ubootmachine and ubootconfigflags:
         raise bb.parse.SkipPackage("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.")
@@ -37,7 +37,7 @@
     if not ubootconfigflags:
         return
 
-    ubootconfig = (d.getVar('UBOOT_CONFIG', True) or "").split()
+    ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
     if len(ubootconfig) > 0:
         for config in ubootconfig:
             for f, v in ubootconfigflags.items():
diff --git a/import-layers/yocto-poky/meta/classes/uboot-extlinux-config.bbclass b/import-layers/yocto-poky/meta/classes/uboot-extlinux-config.bbclass
index df91386..8447a04 100644
--- a/import-layers/yocto-poky/meta/classes/uboot-extlinux-config.bbclass
+++ b/import-layers/yocto-poky/meta/classes/uboot-extlinux-config.bbclass
@@ -12,10 +12,15 @@
 # UBOOT_EXTLINUX_KERNEL_ARGS       - Add additional kernel arguments.
 # UBOOT_EXTLINUX_KERNEL_IMAGE      - Kernel image name.
 # UBOOT_EXTLINUX_FDTDIR            - Device tree directory.
+# UBOOT_EXTLINUX_FDT               - Device tree file.
 # UBOOT_EXTLINUX_INITRD            - Indicates a list of filesystem images to
 #                                    concatenate and use as an initrd (optional).
 # UBOOT_EXTLINUX_MENU_DESCRIPTION  - Name to use as description.
 # UBOOT_EXTLINUX_ROOT              - Root kernel cmdline.
+# UBOOT_EXTLINUX_TIMEOUT           - Timeout before DEFAULT selection is made.
+#                                    Measured in 1/10 of a second.
+# UBOOT_EXTLINUX_DEFAULT_LABEL     - Target to be selected by default after
+#                                    the timeout period
 #
 # If there's only one label system will boot automatically and menu won't be
 # created. If you want to use more than one labels, e.g linux and alternate,
@@ -25,6 +30,9 @@
 #
 # UBOOT_EXTLINUX_LABELS ??= "default fallback"
 #
+# UBOOT_EXTLINUX_DEFAULT_LABEL ??= "Linux Default"
+# UBOOT_EXTLINUX_TIMEOUT ??= "30"
+#
 # UBOOT_EXTLINUX_KERNEL_IMAGE_default ??= "../zImage"
 # UBOOT_EXTLINUX_MENU_DESCRIPTION_default ??= "Linux Default"
 #
@@ -34,6 +42,8 @@
 # Results:
 #
 # menu title Select the boot mode
+# TIMEOUT 30
+# DEFAULT Linux Default
 # LABEL Linux Default
 #   KERNEL ../zImage
 #   FDTDIR ../
@@ -50,6 +60,7 @@
 # a console=...some_tty...
 UBOOT_EXTLINUX_CONSOLE ??= "console=${console}"
 UBOOT_EXTLINUX_LABELS ??= "linux"
+UBOOT_EXTLINUX_FDT ??= ""
 UBOOT_EXTLINUX_FDTDIR ??= "../"
 UBOOT_EXTLINUX_KERNEL_IMAGE ??= "../${KERNEL_IMAGETYPE}"
 UBOOT_EXTLINUX_KERNEL_ARGS ??= "rootwait rw"
@@ -58,23 +69,25 @@
 UBOOT_EXTLINUX_CONFIG = "${B}/extlinux.conf"
 
 python create_extlinux_config() {
-    if d.getVar("UBOOT_EXTLINUX", True) != "1":
+    if d.getVar("UBOOT_EXTLINUX") != "1":
       return
 
-    if not d.getVar('WORKDIR', True):
+    if not d.getVar('WORKDIR'):
         bb.error("WORKDIR not defined, unable to package")
 
-    labels = d.getVar('UBOOT_EXTLINUX_LABELS', True)
+    labels = d.getVar('UBOOT_EXTLINUX_LABELS')
     if not labels:
         bb.fatal("UBOOT_EXTLINUX_LABELS not defined, nothing to do")
 
     if not labels.strip():
         bb.fatal("No labels, nothing to do")
 
-    cfile = d.getVar('UBOOT_EXTLINUX_CONFIG', True)
+    cfile = d.getVar('UBOOT_EXTLINUX_CONFIG')
     if not cfile:
         bb.fatal('Unable to read UBOOT_EXTLINUX_CONFIG')
 
+    localdata = bb.data.createCopy(d)
+
     try:
         with open(cfile, 'w') as cfgfile:
             cfgfile.write('# Generic Distro Configuration file generated by OpenEmbedded\n')
@@ -82,37 +95,50 @@
             if len(labels.split()) > 1:
                 cfgfile.write('menu title Select the boot mode\n')
 
-            for label in labels.split():
-                localdata = bb.data.createCopy(d)
+            timeout =  localdata.getVar('UBOOT_EXTLINUX_TIMEOUT')
+            if timeout:
+                cfgfile.write('TIMEOUT %s\n' % (timeout))
 
-                overrides = localdata.getVar('OVERRIDES', True)
+            if len(labels.split()) > 1:
+                default = localdata.getVar('UBOOT_EXTLINUX_DEFAULT_LABEL')
+                if default:
+                    cfgfile.write('DEFAULT %s\n' % (default))
+
+            for label in labels.split():
+
+                overrides = localdata.getVar('OVERRIDES')
                 if not overrides:
                     bb.fatal('OVERRIDES not defined')
 
                 localdata.setVar('OVERRIDES', label + ':' + overrides)
-                bb.data.update_data(localdata)
 
-                extlinux_console = localdata.getVar('UBOOT_EXTLINUX_CONSOLE', True)
+                extlinux_console = localdata.getVar('UBOOT_EXTLINUX_CONSOLE')
 
-                menu_description = localdata.getVar('UBOOT_EXTLINUX_MENU_DESCRIPTION', True)
+                menu_description = localdata.getVar('UBOOT_EXTLINUX_MENU_DESCRIPTION')
                 if not menu_description:
                     menu_description = label
 
-                root = localdata.getVar('UBOOT_EXTLINUX_ROOT', True)
+                root = localdata.getVar('UBOOT_EXTLINUX_ROOT')
                 if not root:
                     bb.fatal('UBOOT_EXTLINUX_ROOT not defined')
 
-                kernel_image = localdata.getVar('UBOOT_EXTLINUX_KERNEL_IMAGE', True)
-                fdtdir = localdata.getVar('UBOOT_EXTLINUX_FDTDIR', True)
-                if fdtdir:
+                kernel_image = localdata.getVar('UBOOT_EXTLINUX_KERNEL_IMAGE')
+                fdtdir = localdata.getVar('UBOOT_EXTLINUX_FDTDIR')
+
+                fdt = localdata.getVar('UBOOT_EXTLINUX_FDT')
+
+                if fdt:
+                    cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDT %s\n' %
+                                 (menu_description, kernel_image, fdt))
+                elif fdtdir:
                     cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDTDIR %s\n' %
                                  (menu_description, kernel_image, fdtdir))
                 else:
                     cfgfile.write('LABEL %s\n\tKERNEL %s\n' % (menu_description, kernel_image))
 
-                kernel_args = localdata.getVar('UBOOT_EXTLINUX_KERNEL_ARGS', True)
+                kernel_args = localdata.getVar('UBOOT_EXTLINUX_KERNEL_ARGS')
 
-                initrd = localdata.getVar('UBOOT_EXTLINUX_INITRD', True)
+                initrd = localdata.getVar('UBOOT_EXTLINUX_INITRD')
                 if initrd:
                     cfgfile.write('\tINITRD %s\n'% initrd)
 
diff --git a/import-layers/yocto-poky/meta/classes/uboot-sign.bbclass b/import-layers/yocto-poky/meta/classes/uboot-sign.bbclass
index cef26b1..8ee904e 100644
--- a/import-layers/yocto-poky/meta/classes/uboot-sign.bbclass
+++ b/import-layers/yocto-poky/meta/classes/uboot-sign.bbclass
@@ -25,7 +25,7 @@
 #   u-boot:do_concat_dtb
 #   u-boot:do_install
 #
-# For more details on signature process, please refer to U-boot documentation.
+# For more details on signature process, please refer to U-Boot documentation.
 
 # Signature activation.
 UBOOT_SIGN_ENABLE ?= "0"
@@ -80,9 +80,9 @@
 }
 
 python () {
-	uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot', True) or 'u-boot'
-	if d.getVar('UBOOT_SIGN_ENABLE', True) == '1' and d.getVar('PN', True) == uboot_pn:
-		kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel', True)
+	uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'
+	if d.getVar('UBOOT_SIGN_ENABLE') == '1' and d.getVar('PN') == uboot_pn:
+		kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel')
 
 		# u-boot.dtb and u-boot-nodtb.bin are deployed _before_ do_deploy
 		# Thus, do_deploy_setscene will also populate them in DEPLOY_IMAGE_DIR
diff --git a/import-layers/yocto-poky/meta/classes/uninative.bbclass b/import-layers/yocto-poky/meta/classes/uninative.bbclass
index 9754669..8f34483 100644
--- a/import-layers/yocto-poky/meta/classes/uninative.bbclass
+++ b/import-layers/yocto-poky/meta/classes/uninative.bbclass
@@ -20,11 +20,11 @@
     loader isn't already present.
     """
 
-    chksum = d.getVarFlag("UNINATIVE_CHECKSUM", d.getVar("BUILD_ARCH", True), True)
+    chksum = d.getVarFlag("UNINATIVE_CHECKSUM", d.getVar("BUILD_ARCH"))
     if not chksum:
-        bb.fatal("Uninative selected but not configured correctly, please set UNINATIVE_CHECKSUM[%s]" % d.getVar("BUILD_ARCH", True))
+        bb.fatal("Uninative selected but not configured correctly, please set UNINATIVE_CHECKSUM[%s]" % d.getVar("BUILD_ARCH"))
 
-    loader = d.getVar("UNINATIVE_LOADER", True)
+    loader = d.getVar("UNINATIVE_LOADER")
     loaderchksum = loader + ".chksum"
     if os.path.exists(loader) and os.path.exists(loaderchksum):
         with open(loaderchksum, "r") as f:
@@ -37,13 +37,13 @@
         # Save and restore cwd as Fetch.download() does a chdir()
         olddir = os.getcwd()
 
-        tarball = d.getVar("UNINATIVE_TARBALL", True)
-        tarballdir = os.path.join(d.getVar("UNINATIVE_DLDIR", True), chksum)
+        tarball = d.getVar("UNINATIVE_TARBALL")
+        tarballdir = os.path.join(d.getVar("UNINATIVE_DLDIR"), chksum)
         tarballpath = os.path.join(tarballdir, tarball)
 
         if not os.path.exists(tarballpath):
             bb.utils.mkdirhier(tarballdir)
-            if d.getVar("UNINATIVE_URL", True) == "unset":
+            if d.getVar("UNINATIVE_URL") == "unset":
                 bb.fatal("Uninative selected but not configured, please set UNINATIVE_URL")
 
             localdata = bb.data.createCopy(d)
@@ -59,8 +59,17 @@
             if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath):
                     os.symlink(localpath, tarballpath)
 
-        cmd = d.expand("mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; cd ${UNINATIVE_STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/%s/${UNINATIVE_TARBALL}; ${UNINATIVE_STAGING_DIR}-uninative/relocate_sdk.py ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux${base_libdir_native}/libc*.so" % chksum)
-        subprocess.check_call(cmd, shell=True)
+        cmd = d.expand("\
+mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; \
+cd ${UNINATIVE_STAGING_DIR}-uninative; \
+tar -xjf ${UNINATIVE_DLDIR}/%s/${UNINATIVE_TARBALL}; \
+${UNINATIVE_STAGING_DIR}-uninative/relocate_sdk.py \
+  ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux \
+  ${UNINATIVE_LOADER} \
+  ${UNINATIVE_LOADER} \
+  ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative \
+  ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux${base_libdir_native}/libc*.so" % chksum)
+        subprocess.check_output(cmd, shell=True)
 
         with open(loaderchksum, "w") as f:
             f.write(chksum)
@@ -86,12 +95,13 @@
 }
 
 def enable_uninative(d):
-    loader = d.getVar("UNINATIVE_LOADER", True)
+    loader = d.getVar("UNINATIVE_LOADER")
     if os.path.exists(loader):
         bb.debug(2, "Enabling uninative")
         d.setVar("NATIVELSBSTRING", "universal%s" % oe.utils.host_gcc_version(d))
         d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
-        d.prependVar("PATH", "${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")
+        d.appendVarFlag("SSTATEPOSTUNPACKFUNCS", "vardepvalueexclude", "| uninative_changeinterp")
+        d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")
 
 python uninative_changeinterp () {
     import subprocess
@@ -101,7 +111,7 @@
     if not (bb.data.inherits_class('native', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross', d)):
         return
 
-    sstateinst = d.getVar('SSTATE_INSTDIR', True)
+    sstateinst = d.getVar('SSTATE_INSTDIR')
     for walkroot, dirs, files in os.walk(sstateinst):
         for file in files:
             if file.endswith(".so") or ".so." in file:
@@ -120,11 +130,5 @@
             if not elf.isDynamic():
                 continue
 
-            try:
-                subprocess.check_output(("patchelf-uninative", "--set-interpreter",
-                                         d.getVar("UNINATIVE_LOADER", True), f),
-                                        stderr=subprocess.STDOUT)
-            except subprocess.CalledProcessError as e:
-                bb.fatal("'%s' failed with exit code %d and the following output:\n%s" %
-                         (e.cmd, e.returncode, e.output))
+            subprocess.check_output(("patchelf-uninative", "--set-interpreter", d.getVar("UNINATIVE_LOADER"), f), stderr=subprocess.STDOUT)
 }
diff --git a/import-layers/yocto-poky/meta/classes/update-alternatives.bbclass b/import-layers/yocto-poky/meta/classes/update-alternatives.bbclass
index 65929e5..4bba76c 100644
--- a/import-layers/yocto-poky/meta/classes/update-alternatives.bbclass
+++ b/import-layers/yocto-poky/meta/classes/update-alternatives.bbclass
@@ -65,9 +65,11 @@
 # and include that vairable in the set.
 UPDALTVARS  = "ALTERNATIVE ALTERNATIVE_LINK_NAME ALTERNATIVE_TARGET ALTERNATIVE_PRIORITY"
 
+PACKAGE_WRITE_DEPS += "virtual/update-alternatives-native"
+
 def gen_updatealternativesvardeps(d):
-    pkgs = (d.getVar("PACKAGES", True) or "").split()
-    vars = (d.getVar("UPDALTVARS", True) or "").split()
+    pkgs = (d.getVar("PACKAGES") or "").split()
+    vars = (d.getVar("UPDALTVARS") or "").split()
 
     # First compute them for non_pkg versions
     for v in vars:
@@ -84,7 +86,7 @@
                 d.appendVar('%s_VARDEPS_%s' % (v,p), ' %s:%s' % (flag, d.getVarFlag('%s_%s' % (v,p), flag, False)))
 
 def ua_extend_depends(d):
-    if not 'virtual/update-alternatives' in d.getVar('PROVIDES', True):
+    if not 'virtual/update-alternatives' in d.getVar('PROVIDES'):
         d.appendVar('DEPENDS', ' virtual/${MLPREFIX}update-alternatives')
 
 python __anonymous() {
@@ -94,6 +96,10 @@
        bb.data.inherits_class('cross-canadian', d):
         return
 
+    # Disable when targeting mingw32 (no target support)
+    if d.getVar("TARGET_OS") == "mingw32":
+        return
+
     # compute special vardeps
     gen_updatealternativesvardeps(d)
 
@@ -103,8 +109,8 @@
 
 def gen_updatealternativesvars(d):
     ret = []
-    pkgs = (d.getVar("PACKAGES", True) or "").split()
-    vars = (d.getVar("UPDALTVARS", True) or "").split()
+    pkgs = (d.getVar("PACKAGES") or "").split()
+    vars = (d.getVar("UPDALTVARS") or "").split()
 
     for v in vars:
         ret.append(v + "_VARDEPS")
@@ -123,23 +129,23 @@
 # place.
 python perform_packagecopy_append () {
     # Check for deprecated usage...
-    pn = d.getVar('BPN', True)
-    if d.getVar('ALTERNATIVE_LINKS', True) != None:
+    pn = d.getVar('BPN')
+    if d.getVar('ALTERNATIVE_LINKS') != None:
         bb.fatal('%s: Use of ALTERNATIVE_LINKS/ALTERNATIVE_PATH/ALTERNATIVE_NAME is no longer supported, please convert to the updated syntax, see update-alternatives.bbclass for more info.' % pn)
 
     # Do actual update alternatives processing
-    pkgdest = d.getVar('PKGD', True)
-    for pkg in (d.getVar('PACKAGES', True) or "").split():
+    pkgdest = d.getVar('PKGD')
+    for pkg in (d.getVar('PACKAGES') or "").split():
         # If the src == dest, we know we need to rename the dest by appending ${BPN}
         link_rename = {}
-        for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split():
-            alt_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
+        for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
+            alt_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
             if not alt_link:
-                alt_link = "%s/%s" % (d.getVar('bindir', True), alt_name)
+                alt_link = "%s/%s" % (d.getVar('bindir'), alt_name)
                 d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link)
 
-            alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
-            alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) or alt_link
+            alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
+            alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link
             # Sometimes alt_target is specified as relative to the link name.
             alt_target   = os.path.join(os.path.dirname(alt_link), alt_target)
 
@@ -189,23 +195,23 @@
 PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
 
 python populate_packages_updatealternatives () {
-    pn = d.getVar('BPN', True)
+    pn = d.getVar('BPN')
 
     # Do actual update alternatives processing
-    pkgdest = d.getVar('PKGD', True)
-    for pkg in (d.getVar('PACKAGES', True) or "").split():
+    pkgdest = d.getVar('PKGD')
+    for pkg in (d.getVar('PACKAGES') or "").split():
         # Create post install/removal scripts
         alt_setup_links = "# Begin section update-alternatives\n"
         alt_remove_links = "# Begin section update-alternatives\n"
-        for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split():
-            alt_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
-            alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
-            alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) or alt_link
+        for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
+            alt_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
+            alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
+            alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link
             # Sometimes alt_target is specified as relative to the link name.
             alt_target   = os.path.join(os.path.dirname(alt_link), alt_target)
 
-            alt_priority = d.getVarFlag('ALTERNATIVE_PRIORITY_%s' % pkg,  alt_name, True) or d.getVarFlag('ALTERNATIVE_PRIORITY',  alt_name, True)
-            alt_priority = alt_priority or d.getVar('ALTERNATIVE_PRIORITY_%s' % pkg, True) or d.getVar('ALTERNATIVE_PRIORITY', True)
+            alt_priority = d.getVarFlag('ALTERNATIVE_PRIORITY_%s' % pkg,  alt_name) or d.getVarFlag('ALTERNATIVE_PRIORITY',  alt_name)
+            alt_priority = alt_priority or d.getVar('ALTERNATIVE_PRIORITY_%s' % pkg) or d.getVar('ALTERNATIVE_PRIORITY')
 
             # This shouldn't trigger, as it should have been resolved earlier!
             if alt_link == alt_target:
@@ -227,14 +233,14 @@
 
         if len(alt_setup_links.splitlines()) > 2:
             # RDEPENDS setup
-            provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives', True)
+            provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives')
             if provider:
                 #bb.note('adding runtime requirement for update-alternatives for %s' % pkg)
                 d.appendVar('RDEPENDS_%s' % pkg, ' ' + d.getVar('MLPREFIX', False) + provider)
 
             bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg)
             bb.note('%s' % alt_setup_links)
-            postinst = d.getVar('pkg_postinst_%s' % pkg, True) or '#!/bin/sh\n'
+            postinst = d.getVar('pkg_postinst_%s' % pkg) or '#!/bin/sh\n'
             postinst = postinst.splitlines(True)
             try:
                 index = postinst.index('# Begin section update-rc.d\n')
@@ -245,7 +251,7 @@
             d.setVar('pkg_postinst_%s' % pkg, postinst)
 
             bb.note('%s' % alt_remove_links)
-            prerm = d.getVar('pkg_prerm_%s' % pkg, True) or '#!/bin/sh\n'
+            prerm = d.getVar('pkg_prerm_%s' % pkg) or '#!/bin/sh\n'
             prerm = prerm.splitlines(True)
             try:
                 index = prerm.index('# End section update-rc.d\n')
@@ -257,14 +263,14 @@
 }
 
 python package_do_filedeps_append () {
-    pn = d.getVar('BPN', True)
-    pkgdest = d.getVar('PKGDEST', True)
+    pn = d.getVar('BPN')
+    pkgdest = d.getVar('PKGDEST')
 
     for pkg in packages.split():
-        for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split():
-            alt_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
-            alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
-            alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) or alt_link
+        for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
+            alt_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
+            alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
+            alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link
 
             if alt_link == alt_target:
                 bb.warn('%s: alt_link == alt_target: %s == %s' % (pn, alt_link, alt_target))
@@ -276,7 +282,7 @@
             # Add file provide
             trans_target = oe.package.file_translate(alt_target)
             d.appendVar('FILERPROVIDES_%s_%s' % (trans_target, pkg), " " + alt_link)
-            if not trans_target in (d.getVar('FILERPROVIDESFLIST_%s' % pkg, True) or ""):
+            if not trans_target in (d.getVar('FILERPROVIDESFLIST_%s' % pkg) or ""):
                 d.appendVar('FILERPROVIDESFLIST_%s' % pkg, " " + trans_target)
 }
 
diff --git a/import-layers/yocto-poky/meta/classes/update-rc.d.bbclass b/import-layers/yocto-poky/meta/classes/update-rc.d.bbclass
index 18df2dc..9ba3dac 100644
--- a/import-layers/yocto-poky/meta/classes/update-rc.d.bbclass
+++ b/import-layers/yocto-poky/meta/classes/update-rc.d.bbclass
@@ -1,6 +1,6 @@
 UPDATERCPN ?= "${PN}"
 
-DEPENDS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', ' update-rc.d-native update-rc.d initscripts', '', d)}"
+DEPENDS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', ' update-rc.d initscripts', '', d)}"
 
 UPDATERCD = "update-rc.d"
 UPDATERCD_class-cross = ""
@@ -11,11 +11,20 @@
 
 INIT_D_DIR = "${sysconfdir}/init.d"
 
+def use_updatercd(d):
+    # If the distro supports both sysvinit and systemd, and the current recipe
+    # supports systemd, only call update-rc.d on rootfs creation or if systemd
+    # is not running. That's because systemctl enable/disable will already call
+    # update-rc.d if it detects initscripts.
+    if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and bb.data.inherits_class('systemd', d):
+        return '[ -n "$D" -o ! -d /run/systemd/system ]'
+    return 'true'
+
 updatercd_preinst() {
-if [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
+if ${@use_updatercd(d)} && [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
 	${INIT_D_DIR}/${INITSCRIPT_NAME} stop || :
 fi
-if type update-rc.d >/dev/null 2>/dev/null; then
+if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
 	if [ -n "$D" ]; then
 		OPT="-f -r $D"
 	else
@@ -25,9 +34,11 @@
 fi
 }
 
+PACKAGE_WRITE_DEPS += "update-rc.d-native"
+
 updatercd_postinst() {
 # Begin section update-rc.d
-if type update-rc.d >/dev/null 2>/dev/null; then
+if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
 	if [ -n "$D" ]; then
 		OPT="-r $D"
 	else
@@ -40,14 +51,14 @@
 
 updatercd_prerm() {
 # Begin section update-rc.d
-if [ -z "$D" -a -x "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
+if ${@use_updatercd(d)} && [ -z "$D" -a -x "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
 	${INIT_D_DIR}/${INITSCRIPT_NAME} stop || :
 fi
 # End section update-rc.d
 }
 
 updatercd_postrm() {
-if type update-rc.d >/dev/null 2>/dev/null; then
+if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
 	if [ -n "$D" ]; then
 		OPT="-f -r $D"
 	else
@@ -84,64 +95,63 @@
             return
         statement = "grep -q -w '/etc/init.d/functions' %s" % path
         if subprocess.call(statement, shell=True) == 0:
-            mlprefix = d.getVar('MLPREFIX', True) or ""
+            mlprefix = d.getVar('MLPREFIX') or ""
             d.appendVar('RDEPENDS_' + pkg, ' %sinitscripts-functions' % (mlprefix))
 
     def update_rcd_package(pkg):
         bb.debug(1, 'adding update-rc.d calls to preinst/postinst/prerm/postrm for %s' % pkg)
 
         localdata = bb.data.createCopy(d)
-        overrides = localdata.getVar("OVERRIDES", True)
+        overrides = localdata.getVar("OVERRIDES")
         localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides))
-        bb.data.update_data(localdata)
 
         update_rcd_auto_depend(pkg)
 
-        preinst = d.getVar('pkg_preinst_%s' % pkg, True)
+        preinst = d.getVar('pkg_preinst_%s' % pkg)
         if not preinst:
             preinst = '#!/bin/sh\n'
-        preinst += localdata.getVar('updatercd_preinst', True)
+        preinst += localdata.getVar('updatercd_preinst')
         d.setVar('pkg_preinst_%s' % pkg, preinst)
 
-        postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+        postinst = d.getVar('pkg_postinst_%s' % pkg)
         if not postinst:
             postinst = '#!/bin/sh\n'
         postinst = postinst.splitlines(True)
         try:
             index = postinst.index('# End section update-alternatives\n')
-            postinst.insert(index + 1, localdata.getVar('updatercd_postinst', True))
+            postinst.insert(index + 1, localdata.getVar('updatercd_postinst'))
         except ValueError:
-            postinst.append(localdata.getVar('updatercd_postinst', True))
+            postinst.append(localdata.getVar('updatercd_postinst'))
         postinst = ''.join(postinst)
         d.setVar('pkg_postinst_%s' % pkg, postinst)
 
-        prerm = d.getVar('pkg_prerm_%s' % pkg, True)
+        prerm = d.getVar('pkg_prerm_%s' % pkg)
         if not prerm:
             prerm = '#!/bin/sh\n'
         prerm = prerm.splitlines(True)
         try:
             index = prerm.index('# Begin section update-alternatives\n')
-            prerm.insert(index, localdata.getVar('updatercd_prerm', True))
+            prerm.insert(index, localdata.getVar('updatercd_prerm'))
         except ValueError:
-            prerm.append(localdata.getVar('updatercd_prerm', True))
+            prerm.append(localdata.getVar('updatercd_prerm'))
         prerm = ''.join(prerm)
         d.setVar('pkg_prerm_%s' % pkg, prerm)
 
-        postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+        postrm = d.getVar('pkg_postrm_%s' % pkg)
         if not postrm:
                 postrm = '#!/bin/sh\n'
-        postrm += localdata.getVar('updatercd_postrm', True)
+        postrm += localdata.getVar('updatercd_postrm')
         d.setVar('pkg_postrm_%s' % pkg, postrm)
 
         d.appendVar('RRECOMMENDS_' + pkg, " ${MLPREFIX}${UPDATERCD}")
 
     # Check that this class isn't being inhibited (generally, by
     # systemd.bbclass) before doing any work.
-    if not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
-        pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
+    if not d.getVar("INHIBIT_UPDATERCD_BBCLASS"):
+        pkgs = d.getVar('INITSCRIPT_PACKAGES')
         if pkgs == None:
-            pkgs = d.getVar('UPDATERCPN', True)
-            packages = (d.getVar('PACKAGES', True) or "").split()
+            pkgs = d.getVar('UPDATERCPN')
+            packages = (d.getVar('PACKAGES') or "").split()
             if not pkgs in packages and packages != []:
                 pkgs = packages[0]
         for pkg in pkgs.split():
diff --git a/import-layers/yocto-poky/meta/classes/upstream-version-is-even.bbclass b/import-layers/yocto-poky/meta/classes/upstream-version-is-even.bbclass
index 89556ed..256c752 100644
--- a/import-layers/yocto-poky/meta/classes/upstream-version-is-even.bbclass
+++ b/import-layers/yocto-poky/meta/classes/upstream-version-is-even.bbclass
@@ -2,4 +2,4 @@
 # accepts even minor versions (i.e. 3.0.x, 3.2.x, 3.4.x, etc.)
 # This scheme is used by Gnome and a number of other projects
 # to signify stable releases vs development releases.
-UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.(\d*[02468])+(\.\d+)+)"
+UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>\d+\.(\d*[02468])+(\.\d+)+)\.tar"
diff --git a/import-layers/yocto-poky/meta/classes/useradd-staticids.bbclass b/import-layers/yocto-poky/meta/classes/useradd-staticids.bbclass
index afb580a..6ebf760 100644
--- a/import-layers/yocto-poky/meta/classes/useradd-staticids.bbclass
+++ b/import-layers/yocto-poky/meta/classes/useradd-staticids.bbclass
@@ -8,11 +8,11 @@
 
     class myArgumentParser( argparse.ArgumentParser ):
         def _print_message(self, message, file=None):
-            bb.warn("%s - %s: %s" % (d.getVar('PN', True), pkg, message))
+            bb.warn("%s - %s: %s" % (d.getVar('PN'), pkg, message))
 
         # This should never be called...
         def exit(self, status=0, message=None):
-            message = message or ("%s - %s: useradd.bbclass: Argument parsing exited" % (d.getVar('PN', True), pkg))
+            message = message or ("%s - %s: useradd.bbclass: Argument parsing exited" % (d.getVar('PN'), pkg))
             error(message)
 
         def error(self, message):
@@ -52,14 +52,13 @@
 
     def handle_missing_id(id, type, pkg):
         # For backwards compatibility we accept "1" in addition to "error"
-        if d.getVar('USERADD_ERROR_DYNAMIC', True) == 'error' or d.getVar('USERADD_ERROR_DYNAMIC', True) == '1':
-            #bb.error("Skipping recipe %s, package %s which adds %sname %s does not have a static ID defined." % (d.getVar('PN', True),  pkg, type, id))
-            bb.fatal("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
-        elif d.getVar('USERADD_ERROR_DYNAMIC', True) == 'warn':
-            bb.warn("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
+        if d.getVar('USERADD_ERROR_DYNAMIC') == 'error' or d.getVar('USERADD_ERROR_DYNAMIC') == '1':
+            raise NotImplementedError("%s - %s: %sname %s does not have a static ID defined. Skipping it." % (d.getVar('PN'), pkg, type, id))
+        elif d.getVar('USERADD_ERROR_DYNAMIC') == 'warn':
+            bb.warn("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN'), pkg, type, id))
 
     # We parse and rewrite the useradd components
-    def rewrite_useradd(params):
+    def rewrite_useradd(params, is_pkg):
         # The following comes from --help on useradd from shadow
         parser = myArgumentParser(prog='useradd')
         parser.add_argument("-b", "--base-dir", metavar="BASE_DIR", help="base directory for the home directory of the new account")
@@ -78,6 +77,7 @@
         parser.add_argument("-N", "--no-user-group", dest="user_group", help="do not create a group with the same name as the user", action="store_const", const=False)
         parser.add_argument("-o", "--non-unique", help="allow to create users with duplicate (non-unique UID)", action="store_true")
         parser.add_argument("-p", "--password", metavar="PASSWORD", help="encrypted password of the new account")
+        parser.add_argument("-P", "--clear-password", metavar="CLEAR_PASSWORD", help="use this clear password for the new account")
         parser.add_argument("-R", "--root", metavar="CHROOT_DIR", help="directory to chroot into")
         parser.add_argument("-r", "--system", help="create a system account", action="store_true")
         parser.add_argument("-s", "--shell", metavar="SHELL", help="login shell of the new account")
@@ -90,8 +90,8 @@
         # paths are resolved via BBPATH
         def get_passwd_list(d):
             str = ""
-            bbpath = d.getVar('BBPATH', True)
-            passwd_tables = d.getVar('USERADD_UID_TABLES', True)
+            bbpath = d.getVar('BBPATH')
+            passwd_tables = d.getVar('USERADD_UID_TABLES')
             if not passwd_tables:
                 passwd_tables = 'files/passwd'
             for conf_file in passwd_tables.split():
@@ -107,7 +107,7 @@
             try:
                 uaargs = parser.parse_args(re.split('''[ \t]+(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
             except:
-                bb.fatal("%s: Unable to parse arguments for USERADD_PARAM_%s: '%s'" % (d.getVar('PN', True), pkg, param))
+                bb.fatal("%s: Unable to parse arguments for USERADD_PARAM_%s: '%s'" % (d.getVar('PN'), pkg, param))
 
             # Read all passwd files specified in USERADD_UID_TABLES or files/passwd
             # Use the standard passwd layout:
@@ -124,14 +124,14 @@
                 users = merge_files(get_passwd_list(d), 7)
 
             if uaargs.LOGIN not in users:
-                if not uaargs.uid or not uaargs.uid.isdigit() or not uaargs.gid:
-                    handle_missing_id(uaargs.LOGIN, 'user', pkg)
+                handle_missing_id(uaargs.LOGIN, 'user', pkg)
+                newparams.append(param)
                 continue
 
             field = users[uaargs.LOGIN]
 
             if uaargs.uid and field[2] and (uaargs.uid != field[2]):
-                bb.warn("%s: Changing username %s's uid from (%s) to (%s), verify configuration files!" % (d.getVar('PN', True), uaargs.LOGIN, uaargs.uid, field[2]))
+                bb.warn("%s: Changing username %s's uid from (%s) to (%s), verify configuration files!" % (d.getVar('PN'), uaargs.LOGIN, uaargs.uid, field[2]))
             uaargs.uid = field[2] or uaargs.uid
 
             # Determine the possible groupname
@@ -141,9 +141,13 @@
             # So if the implicit username-group creation is on, then the implicit groupname (LOGIN)
             # is used, and we disable the user_group option.
             #
-            user_group = uaargs.user_group is None or uaargs.user_group is True
-            uaargs.groupname = uaargs.LOGIN if user_group else uaargs.gid
-            uaargs.groupid = field[3] or uaargs.gid or uaargs.groupname
+            if uaargs.gid:
+                uaargs.groupname = uaargs.gid
+            elif uaargs.user_group is not False:
+                uaargs.groupname = uaargs.LOGIN
+            else:
+                uaargs.groupname = 'users'
+            uaargs.groupid = field[3] or uaargs.groupname
 
             if uaargs.groupid and uaargs.gid != uaargs.groupid:
                 newgroup = None
@@ -159,14 +163,16 @@
                     # We want to add a group, but we don't know it's name... so we can't add the group...
                     # We have to assume the group has previously been added or we'll fail on the adduser...
                     # Note: specifying the actual gid is very rare in OE, usually the group name is specified.
-                    bb.warn("%s: Changing gid for login %s to %s, verify configuration files!" % (d.getVar('PN', True), uaargs.LOGIN, uaargs.groupid))
+                    bb.warn("%s: Changing gid for login %s to %s, verify configuration files!" % (d.getVar('PN'), uaargs.LOGIN, uaargs.groupid))
 
                 uaargs.gid = uaargs.groupid
                 uaargs.user_group = None
-                if newgroup:
-                    groupadd = d.getVar("GROUPADD_PARAM_%s" % pkg, True)
+                if newgroup and is_pkg:
+                    groupadd = d.getVar("GROUPADD_PARAM_%s" % pkg)
                     if groupadd:
-                        d.setVar("GROUPADD_PARAM_%s" % pkg, "%s; %s" % (groupadd, newgroup))
+                        # Only add the group if not already specified
+                        if not uaargs.groupname in groupadd:
+                            d.setVar("GROUPADD_PARAM_%s" % pkg, "%s; %s" % (groupadd, newgroup))
                     else:
                         d.setVar("GROUPADD_PARAM_%s" % pkg, newgroup)
 
@@ -183,7 +189,7 @@
             newparam += ['', ' --base-dir %s' % uaargs.base_dir][uaargs.base_dir != None]
             newparam += ['', ' --comment %s' % uaargs.comment][uaargs.comment != None]
             newparam += ['', ' --home-dir %s' % uaargs.home_dir][uaargs.home_dir != None]
-            newparam += ['', ' --expiredata %s' % uaargs.expiredate][uaargs.expiredate != None]
+            newparam += ['', ' --expiredate %s' % uaargs.expiredate][uaargs.expiredate != None]
             newparam += ['', ' --inactive %s' % uaargs.inactive][uaargs.inactive != None]
             newparam += ['', ' --gid %s' % uaargs.gid][uaargs.gid != None]
             newparam += ['', ' --groups %s' % uaargs.groups][uaargs.groups != None]
@@ -194,7 +200,10 @@
             newparam += ['', ' --no-create-home'][uaargs.create_home is False]
             newparam += ['', ' --no-user-group'][uaargs.user_group is False]
             newparam += ['', ' --non-unique'][uaargs.non_unique]
-            newparam += ['', ' --password %s' % uaargs.password][uaargs.password != None]
+            if uaargs.password != None:
+                newparam += ['', ' --password %s' % uaargs.password][uaargs.password != None]
+            elif uaargs.clear_password:
+                newparam += ['', ' --clear-password %s' % uaargs.clear_password][uaargs.clear_password != None]
             newparam += ['', ' --root %s' % uaargs.root][uaargs.root != None]
             newparam += ['', ' --system'][uaargs.system]
             newparam += ['', ' --shell %s' % uaargs.shell][uaargs.shell != None]
@@ -207,7 +216,7 @@
         return ";".join(newparams).strip()
 
     # We parse and rewrite the groupadd components
-    def rewrite_groupadd(params):
+    def rewrite_groupadd(params, is_pkg):
         # The following comes from --help on groupadd from shadow
         parser = myArgumentParser(prog='groupadd')
         parser.add_argument("-f", "--force", help="exit successfully if the group already exists, and cancel -g if the GID is already used", action="store_true")
@@ -215,6 +224,7 @@
         parser.add_argument("-K", "--key", metavar="KEY=VALUE", help="override /etc/login.defs defaults")
         parser.add_argument("-o", "--non-unique", help="allow to create groups with duplicate (non-unique) GID", action="store_true")
         parser.add_argument("-p", "--password", metavar="PASSWORD", help="use this encrypted password for the new group")
+        parser.add_argument("-P", "--clear-password", metavar="CLEAR_PASSWORD", help="use this clear password for the new group")
         parser.add_argument("-R", "--root", metavar="CHROOT_DIR", help="directory to chroot into")
         parser.add_argument("-r", "--system", help="create a system account", action="store_true")
         parser.add_argument("GROUP", help="Group name of the new group")
@@ -224,8 +234,8 @@
         # paths are resolved via BBPATH
         def get_group_list(d):
             str = ""
-            bbpath = d.getVar('BBPATH', True)
-            group_tables = d.getVar('USERADD_GID_TABLES', True)
+            bbpath = d.getVar('BBPATH')
+            group_tables = d.getVar('USERADD_GID_TABLES')
             if not group_tables:
                 group_tables = 'files/group'
             for conf_file in group_tables.split():
@@ -242,7 +252,7 @@
                 # If we're processing multiple lines, we could have left over values here...
                 gaargs = parser.parse_args(re.split('''[ \t]+(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
             except:
-                bb.fatal("%s: Unable to parse arguments for GROUPADD_PARAM_%s: '%s'" % (d.getVar('PN', True), pkg, param))
+                bb.fatal("%s: Unable to parse arguments for GROUPADD_PARAM_%s: '%s'" % (d.getVar('PN'), pkg, param))
 
             # Read all group files specified in USERADD_GID_TABLES or files/group
             # Use the standard group layout:
@@ -257,15 +267,15 @@
                 groups = merge_files(get_group_list(d), 4)
 
             if gaargs.GROUP not in groups:
-                if not gaargs.gid or not gaargs.gid.isdigit():
-                    handle_missing_id(gaargs.GROUP, 'group', pkg)
+                handle_missing_id(gaargs.GROUP, 'group', pkg)
+                newparams.append(param)
                 continue
 
             field = groups[gaargs.GROUP]
 
             if field[2]:
                 if gaargs.gid and (gaargs.gid != field[2]):
-                    bb.warn("%s: Changing groupname %s's gid from (%s) to (%s), verify configuration files!" % (d.getVar('PN', True), gaargs.GROUP, gaargs.gid, field[2]))
+                    bb.warn("%s: Changing groupname %s's gid from (%s) to (%s), verify configuration files!" % (d.getVar('PN'), gaargs.GROUP, gaargs.gid, field[2]))
                 gaargs.gid = field[2]
 
             if not gaargs.gid or not gaargs.gid.isdigit():
@@ -276,7 +286,10 @@
             newparam += ['', ' --gid %s' % gaargs.gid][gaargs.gid != None]
             newparam += ['', ' --key %s' % gaargs.key][gaargs.key != None]
             newparam += ['', ' --non-unique'][gaargs.non_unique]
-            newparam += ['', ' --password %s' % gaargs.password][gaargs.password != None]
+            if gaargs.password != None:
+                newparam += ['', ' --password %s' % gaargs.password][gaargs.password != None]
+            elif gaargs.clear_password:
+                newparam += ['', ' --clear-password %s' % gaargs.clear_password][gaargs.clear_password != None]
             newparam += ['', ' --root %s' % gaargs.root][gaargs.root != None]
             newparam += ['', ' --system'][gaargs.system]
             newparam += ' %s' % gaargs.GROUP
@@ -289,33 +302,58 @@
     # the files listed in USERADD_UID/GID_TABLES. We need to tell bitbake
     # about that explicitly to trigger re-parsing and thus re-execution of
     # this code when the files change.
-    bbpath = d.getVar('BBPATH', True)
+    bbpath = d.getVar('BBPATH')
     for varname, default in (('USERADD_UID_TABLES', 'files/passwd'),
                              ('USERADD_GID_TABLES', 'files/group')):
-        tables = d.getVar(varname, True)
+        tables = d.getVar(varname)
         if not tables:
             tables = default
         for conf_file in tables.split():
             bb.parse.mark_dependency(d, bb.utils.which(bbpath, conf_file))
 
     # Load and process the users and groups, rewriting the adduser/addgroup params
-    useradd_packages = d.getVar('USERADD_PACKAGES', True)
+    useradd_packages = d.getVar('USERADD_PACKAGES') or ""
 
     for pkg in useradd_packages.split():
         # Groupmems doesn't have anything we might want to change, so simply validating
         # is a bit of a waste -- only process useradd/groupadd
-        useradd_param = d.getVar('USERADD_PARAM_%s' % pkg, True)
+        useradd_param = d.getVar('USERADD_PARAM_%s' % pkg)
         if useradd_param:
             #bb.warn("Before: 'USERADD_PARAM_%s' - '%s'" % (pkg, useradd_param))
-            d.setVar('USERADD_PARAM_%s' % pkg, rewrite_useradd(useradd_param))
-            #bb.warn("After:  'USERADD_PARAM_%s' - '%s'" % (pkg, d.getVar('USERADD_PARAM_%s' % pkg, True)))
+            d.setVar('USERADD_PARAM_%s' % pkg, rewrite_useradd(useradd_param, True))
+            #bb.warn("After:  'USERADD_PARAM_%s' - '%s'" % (pkg, d.getVar('USERADD_PARAM_%s' % pkg)))
 
-        groupadd_param = d.getVar('GROUPADD_PARAM_%s' % pkg, True)
+        groupadd_param = d.getVar('GROUPADD_PARAM_%s' % pkg)
         if groupadd_param:
             #bb.warn("Before: 'GROUPADD_PARAM_%s' - '%s'" % (pkg, groupadd_param))
-            d.setVar('GROUPADD_PARAM_%s' % pkg, rewrite_groupadd(groupadd_param))
-            #bb.warn("After:  'GROUPADD_PARAM_%s' - '%s'" % (pkg, d.getVar('GROUPADD_PARAM_%s' % pkg, True)))
+            d.setVar('GROUPADD_PARAM_%s' % pkg, rewrite_groupadd(groupadd_param, True))
+            #bb.warn("After:  'GROUPADD_PARAM_%s' - '%s'" % (pkg, d.getVar('GROUPADD_PARAM_%s' % pkg)))
 
+    # Load and process extra users and groups, rewriting only adduser/addgroup params
+    pkg = d.getVar('PN')
+    extrausers = d.getVar('EXTRA_USERS_PARAMS') or ""
+
+    #bb.warn("Before:  'EXTRA_USERS_PARAMS' - '%s'" % (d.getVar('EXTRA_USERS_PARAMS')))
+    new_extrausers = []
+    for cmd in re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', extrausers):
+        cmd = cmd.strip()
+        if not cmd:
+            continue
+
+        if re.match('''useradd (.*)''', cmd):
+            useradd_param = re.match('''useradd (.*)''', cmd).group(1)
+            useradd_param = rewrite_useradd(useradd_param, False)
+            cmd = 'useradd %s' % useradd_param
+        elif re.match('''groupadd (.*)''', cmd):
+            groupadd_param = re.match('''groupadd (.*)''', cmd).group(1)
+            groupadd_param = rewrite_groupadd(groupadd_param, False)
+            cmd = 'groupadd %s' % groupadd_param
+
+        new_extrausers.append(cmd)
+
+    new_extrausers.append('')
+    d.setVar('EXTRA_USERS_PARAMS', ';'.join(new_extrausers))
+    #bb.warn("After:  'EXTRA_USERS_PARAMS' - '%s'" % (d.getVar('EXTRA_USERS_PARAMS')))
 
 
 python __anonymous() {
@@ -323,7 +361,7 @@
         and not bb.data.inherits_class('native', d):
         try:
             update_useradd_static_config(d)
-        except bb.build.FuncFailed as f:
-            bb.debug(1, "Skipping recipe %s: %s" % (d.getVar('PN', True), f))
+        except NotImplementedError as f:
+            bb.debug(1, "Skipping recipe %s: %s" % (d.getVar('PN'), f))
             raise bb.parse.SkipPackage(f)
 }
diff --git a/import-layers/yocto-poky/meta/classes/useradd.bbclass b/import-layers/yocto-poky/meta/classes/useradd.bbclass
index 3cff08e..0f551b5 100644
--- a/import-layers/yocto-poky/meta/classes/useradd.bbclass
+++ b/import-layers/yocto-poky/meta/classes/useradd.bbclass
@@ -3,7 +3,8 @@
 # base-passwd-cross provides the default passwd and group files in the
 # target sysroot, and shadow -native and -sysroot provide the utilities
 # and support files needed to add and modify user and group accounts
-DEPENDS_append_class-target = " base-files shadow-native shadow-sysroot shadow"
+DEPENDS_append_class-target = " base-files shadow-native shadow-sysroot shadow base-passwd"
+PACKAGE_WRITE_DEPS += "shadow-native"
 
 # This preinstall function can be run in four different contexts:
 #
@@ -31,7 +32,7 @@
 	fi
 
 	# user/group lookups should match useradd/groupadd --root
-	export PSEUDO_PASSWD="$SYSROOT:${STAGING_DIR_NATIVE}"
+	export PSEUDO_PASSWD="$SYSROOT"
 fi
 
 # If we're not doing a special SSTATE/SYSROOT install
@@ -96,15 +97,30 @@
 }
 
 useradd_sysroot () {
-	# Pseudo may (do_install) or may not (do_populate_sysroot_setscene) be running 
+	# Pseudo may (do_prepare_recipe_sysroot) or may not (do_populate_sysroot_setscene) be running 
 	# at this point so we're explicit about the environment so pseudo can load if 
 	# not already present.
-	export PSEUDO="${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${STAGING_DIR_TARGET}${localstatedir}/pseudo ${STAGING_DIR_NATIVE}${bindir_native}/pseudo"
+	export PSEUDO="${FAKEROOTENV} ${PSEUDO_SYSROOT}${bindir_native}/pseudo"
 
 	# Explicitly set $D since it isn't set to anything
-	# before do_install
+	# before do_prepare_recipe_sysroot
 	D=${STAGING_DIR_TARGET}
 
+	# base-passwd's postinst may not have run yet in which case we'll get called later, just exit.
+	# Beware that in some cases we might see the fake pseudo passwd here, in which case we also must
+	# exit.
+	if [ ! -f $D${sysconfdir}/passwd ] ||
+			grep -q this-is-the-pseudo-passwd $D${sysconfdir}/passwd; then
+		exit 0
+	fi
+
+	# It is also possible we may be in a recipe which doesn't have useradd dependencies and hence the
+	# useradd/groupadd tools are unavailable. If there is no dependency, we assume we don't want to
+	# create users in the sysroot
+	if ! command -v useradd; then
+		exit 0
+	fi
+
 	# Add groups and users defined for all recipe packages
 	GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}"
 	USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}"
@@ -116,49 +132,43 @@
 	useradd_preinst
 }
 
-useradd_sysroot_sstate () {
-	if [ "${BB_CURRENTTASK}" = "package_setscene" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
-	then
-		useradd_sysroot
-	fi
+# The export of PSEUDO in useradd_sysroot() above contains references to
+# ${COMPONENTS_DIR} and ${PSEUDO_LOCALSTATEDIR}. Additionally, the logging
+# shell functions use ${LOGFIFO}. These need to be handled when restoring
+# postinst-useradd-${PN} from the sstate cache.
+EXTRA_STAGING_FIXMES += "COMPONENTS_DIR PSEUDO_LOCALSTATEDIR LOGFIFO"
+
+python useradd_sysroot_sstate () {
+    task = d.getVar("BB_CURRENTTASK")
+    if task == "package_setscene":
+        bb.build.exec_func("useradd_sysroot", d)
+    elif task == "prepare_recipe_sysroot":
+        # Used to update this recipe's own sysroot so the user/groups are available to do_install
+        scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}")
+        bb.utils.mkdirhier(os.path.dirname(scriptfile))
+        with open(scriptfile, 'w') as script:
+            script.write("#!/bin/sh\n")
+            bb.data.emit_func("useradd_sysroot", script, d)
+            script.write("useradd_sysroot\n")
+        os.chmod(scriptfile, 0o755)
+        bb.build.exec_func("useradd_sysroot", d)
+    elif task == "populate_sysroot":
+        # Used when installed in dependent task sysroots
+        scriptfile = d.expand("${SYSROOT_DESTDIR}${bindir}/postinst-useradd-${PN}")
+        bb.utils.mkdirhier(os.path.dirname(scriptfile))
+        with open(scriptfile, 'w') as script:
+            script.write("#!/bin/sh\n")
+            bb.data.emit_func("useradd_sysroot", script, d)
+            script.write("useradd_sysroot\n")
+        os.chmod(scriptfile, 0o755)
 }
 
-userdel_sysroot_sstate () {
-if test "x${STAGING_DIR_TARGET}" != "x"; then
-    if [ "${BB_CURRENTTASK}" = "clean" ]; then
-        export PSEUDO="${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${STAGING_DIR_TARGET}${localstatedir}/pseudo ${STAGING_DIR_NATIVE}${bindir_native}/pseudo"
-        OPT="--root ${STAGING_DIR_TARGET}"
-
-        # Remove groups and users defined for package
-        GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}"
-        USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}"
-
-        user=`echo "$USERADD_PARAM" | cut -d ';' -f 1 | awk '{ print $NF }'`
-        remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2- -s | sed -e 's#[ \t]*$##'`
-        while test "x$user" != "x"; do
-            perform_userdel "${STAGING_DIR_TARGET}" "$OPT $user"
-            user=`echo "$remaining" | cut -d ';' -f 1 | awk '{ print $NF }'`
-            remaining=`echo "$remaining" | cut -d ';' -f 2- -s | sed -e 's#[ \t]*$##'`
-        done
-
-        user=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | awk '{ print $NF }'`
-        remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2- -s | sed -e 's#[ \t]*$##'`
-        while test "x$user" != "x"; do
-            perform_groupdel "${STAGING_DIR_TARGET}" "$OPT $user"
-            user=`echo "$remaining" | cut -d ';' -f 1 | awk '{ print $NF }'`
-            remaining=`echo "$remaining" | cut -d ';' -f 2- -s | sed -e 's#[ \t]*$##'`
-        done
-
-    fi
-fi
-}
-
-SSTATECLEANFUNCS_append_class-target = " userdel_sysroot_sstate"
-
-do_install[prefuncs] += "${SYSROOTFUNC}"
-SYSROOTFUNC_class-target = "useradd_sysroot"
+do_prepare_recipe_sysroot[postfuncs] += "${SYSROOTFUNC}"
+SYSROOTFUNC_class-target = "useradd_sysroot_sstate"
 SYSROOTFUNC = ""
 
+SYSROOT_PREPROCESS_FUNCS += "${SYSROOTFUNC}"
+
 SSTATEPREINSTFUNCS_append_class-target = " useradd_sysroot_sstate"
 
 do_package_setscene[depends] += "${USERADDSETSCENEDEPS}"
@@ -168,13 +178,13 @@
 
 # Recipe parse-time sanity checks
 def update_useradd_after_parse(d):
-    useradd_packages = d.getVar('USERADD_PACKAGES', True)
+    useradd_packages = d.getVar('USERADD_PACKAGES')
 
     if not useradd_packages:
         bb.fatal("%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE', False))
 
     for pkg in useradd_packages.split():
-        if not d.getVar('USERADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPMEMS_PARAM_%s' % pkg, True):
+        if not d.getVar('USERADD_PARAM_%s' % pkg) and not d.getVar('GROUPADD_PARAM_%s' % pkg) and not d.getVar('GROUPMEMS_PARAM_%s' % pkg):
             bb.fatal("%s inherits useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or GROUPMEMS_PARAM for package %s" % (d.getVar('FILE', False), pkg))
 
 python __anonymous() {
@@ -191,9 +201,9 @@
     param_type = cmd_type.upper() + "_PARAM_%s"
     params = []
 
-    useradd_packages = d.getVar('USERADD_PACKAGES', True) or ""
+    useradd_packages = d.getVar('USERADD_PACKAGES') or ""
     for pkg in useradd_packages.split():
-        param = d.getVar(param_type % pkg, True)
+        param = d.getVar(param_type % pkg)
         if param:
             params.append(param.rstrip(" ;"))
 
@@ -209,20 +219,20 @@
         required to execute on the target. Not doing so may cause
         useradd preinst to be invoked twice, causing unwanted warnings.
         """
-        preinst = d.getVar('pkg_preinst_%s' % pkg, True) or d.getVar('pkg_preinst', True)
+        preinst = d.getVar('pkg_preinst_%s' % pkg) or d.getVar('pkg_preinst')
         if not preinst:
             preinst = '#!/bin/sh\n'
         preinst += 'bbnote () {\n\techo "NOTE: $*"\n}\n'
         preinst += 'bbwarn () {\n\techo "WARNING: $*"\n}\n'
         preinst += 'bbfatal () {\n\techo "ERROR: $*"\n\texit 1\n}\n'
-        preinst += 'perform_groupadd () {\n%s}\n' % d.getVar('perform_groupadd', True)
-        preinst += 'perform_useradd () {\n%s}\n' % d.getVar('perform_useradd', True)
-        preinst += 'perform_groupmems () {\n%s}\n' % d.getVar('perform_groupmems', True)
-        preinst += d.getVar('useradd_preinst', True)
+        preinst += 'perform_groupadd () {\n%s}\n' % d.getVar('perform_groupadd')
+        preinst += 'perform_useradd () {\n%s}\n' % d.getVar('perform_useradd')
+        preinst += 'perform_groupmems () {\n%s}\n' % d.getVar('perform_groupmems')
+        preinst += d.getVar('useradd_preinst')
         d.setVar('pkg_preinst_%s' % pkg, preinst)
 
         # RDEPENDS setup
-        rdepends = d.getVar("RDEPENDS_%s" % pkg, True) or ""
+        rdepends = d.getVar("RDEPENDS_%s" % pkg) or ""
         rdepends += ' ' + d.getVar('MLPREFIX', False) + 'base-passwd'
         rdepends += ' ' + d.getVar('MLPREFIX', False) + 'shadow'
         # base-files is where the default /etc/skel is packaged
@@ -233,7 +243,7 @@
     # to packages specified by USERADD_PACKAGES
     if not bb.data.inherits_class('nativesdk', d) \
         and not bb.data.inherits_class('native', d):
-        useradd_packages = d.getVar('USERADD_PACKAGES', True) or ""
+        useradd_packages = d.getVar('USERADD_PACKAGES') or ""
         for pkg in useradd_packages.split():
             update_useradd_package(pkg)
 }
diff --git a/import-layers/yocto-poky/meta/classes/useradd_base.bbclass b/import-layers/yocto-poky/meta/classes/useradd_base.bbclass
index ba87edc..551c82c 100644
--- a/import-layers/yocto-poky/meta/classes/useradd_base.bbclass
+++ b/import-layers/yocto-poky/meta/classes/useradd_base.bbclass
@@ -69,11 +69,21 @@
 	bbnote "${PN}: Performing groupdel with [$opts]"
 	local groupname=`echo "$opts" | awk '{ print $NF }'`
 	local group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+
 	if test "x$group_exists" != "x"; then
-		eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO groupdel \$opts\" || true
-		group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
-		if test "x$group_exists" != "x"; then
-			bbfatal "${PN}: groupdel command did not succeed."
+		local awk_input='BEGIN {FS=":"}; $1=="'$groupname'" { print $3 }'
+		local groupid=`echo "$awk_input" | awk -f- $rootdir/etc/group`
+		local awk_check_users='BEGIN {FS=":"}; $4=="'$groupid'" {print $1}'
+		local other_users=`echo "$awk_check_users" | awk -f- $rootdir/etc/passwd`
+
+		if test "x$other_users" = "x"; then
+			eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO groupdel \$opts\" || true
+			group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+			if test "x$group_exists" != "x"; then
+				bbfatal "${PN}: groupdel command did not succeed."
+			fi
+		else
+			bbnote "${PN}: '$groupname' is primary group for users '$other_users', not removing it"
 		fi
 	else
 		bbnote "${PN}: group $groupname doesn't exist, not removing it"
diff --git a/import-layers/yocto-poky/meta/classes/utility-tasks.bbclass b/import-layers/yocto-poky/meta/classes/utility-tasks.bbclass
index 7ba56e2..587bfd4 100644
--- a/import-layers/yocto-poky/meta/classes/utility-tasks.bbclass
+++ b/import-layers/yocto-poky/meta/classes/utility-tasks.bbclass
@@ -4,12 +4,12 @@
     taskdescs = {}
     maxlen = 0
     for e in d.keys():
-        if d.getVarFlag(e, 'task', True):
+        if d.getVarFlag(e, 'task'):
             maxlen = max(maxlen, len(e))
             if e.endswith('_setscene'):
-                desc = "%s (setscene version)" % (d.getVarFlag(e[:-9], 'doc', True) or '')
+                desc = "%s (setscene version)" % (d.getVarFlag(e[:-9], 'doc') or '')
             else:
-                desc = d.getVarFlag(e, 'doc', True) or ''
+                desc = d.getVarFlag(e, 'doc') or ''
             taskdescs[e] = desc
 
     tasks = sorted(taskdescs.keys())
@@ -28,18 +28,18 @@
     bb.note("Removing " + dir)
     oe.path.remove(dir)
 
-    dir = "%s.*" % bb.data.expand(d.getVar('STAMP', False), d)
+    dir = "%s.*" % d.getVar('STAMP')
     bb.note("Removing " + dir)
     oe.path.remove(dir)
 
-    for f in (d.getVar('CLEANFUNCS', True) or '').split():
+    for f in (d.getVar('CLEANFUNCS') or '').split():
         bb.build.exec_func(f, d)
 }
 
 addtask checkuri
 do_checkuri[nostamp] = "1"
 python do_checkuri() {
-    src_uri = (d.getVar('SRC_URI', True) or "").split()
+    src_uri = (d.getVar('SRC_URI') or "").split()
     if len(src_uri) == 0:
         return
 
diff --git a/import-layers/yocto-poky/meta/classes/utils.bbclass b/import-layers/yocto-poky/meta/classes/utils.bbclass
index dbb5e4c..96463ab 100644
--- a/import-layers/yocto-poky/meta/classes/utils.bbclass
+++ b/import-layers/yocto-poky/meta/classes/utils.bbclass
@@ -41,9 +41,9 @@
 
 def machine_paths(d):
     """List any existing machine specific filespath directories"""
-    machine = d.getVar("MACHINE", True)
-    filespathpkg = d.getVar("FILESPATHPKG", True).split(":")
-    for basepath in d.getVar("FILESPATHBASE", True).split(":"):
+    machine = d.getVar("MACHINE")
+    filespathpkg = d.getVar("FILESPATHPKG").split(":")
+    for basepath in d.getVar("FILESPATHBASE").split(":"):
         for pkgpath in filespathpkg:
             machinepath = os.path.join(basepath, pkgpath, machine)
             if os.path.isdir(machinepath):
@@ -52,7 +52,7 @@
 def is_machine_specific(d):
     """Determine whether the current recipe is machine specific"""
     machinepaths = set(machine_paths(d))
-    srcuri = d.getVar("SRC_URI", True).split()
+    srcuri = d.getVar("SRC_URI").split()
     for url in srcuri:
         fetcher = bb.fetch2.Fetch([srcuri], d)
         if url.startswith("file://"):
@@ -264,10 +264,17 @@
 
 	mv $cmd $cmd.real
 	cmdname=`basename $cmd`
+	dirname=`dirname $cmd`
+	cmdoptions=$@
+	if [ "${base_prefix}" != "" ]; then
+		relpath=`python3 -c "import os; print(os.path.relpath('${D}${base_prefix}', '$dirname'))"`
+		cmdoptions=`echo $@ | sed -e "s:${base_prefix}:\\$realdir/$relpath:g"`
+	fi
 	cat <<END >$cmd
 #!/bin/bash
 realpath=\`readlink -fn \$0\`
-exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real $@ "\$@"
+realdir=\`dirname \$realpath\`
+exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real $cmdoptions "\$@"
 END
 	chmod +x $cmd
 }
@@ -287,10 +294,17 @@
 
 	mv $cmd $cmd.real
 	cmdname=`basename $cmd`
+	dirname=`dirname $cmd`
+	exportstring=$@
+	if [ "${base_prefix}" != "" ]; then
+		relpath=`python3 -c "import os; print(os.path.relpath('${D}${base_prefix}', '$dirname'))"`
+		exportstring=`echo $@ | sed -e "s:${base_prefix}:\\$realdir/$relpath:g"`
+	fi
 	cat <<END >$cmd
 #!/bin/bash
 realpath=\`readlink -fn \$0\`
-export $@
+realdir=\`dirname \$realpath\`
+export $exportstring
 exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real "\$@"
 END
 	chmod +x $cmd
@@ -307,7 +321,7 @@
 
 def check_app_exists(app, d):
     app = d.expand(app).strip()
-    path = d.getVar('PATH', d, True)
+    path = d.getVar('PATH')
     return bool(bb.utils.which(path, app))
 
 def explode_deps(s):
@@ -315,14 +329,14 @@
 
 def base_set_filespath(path, d):
     filespath = []
-    extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "")
+    extrapaths = (d.getVar("FILESEXTRAPATHS") or "")
     # Remove default flag which was used for checking
     extrapaths = extrapaths.replace("__default:", "")
     # Don't prepend empty strings to the path list
     if extrapaths != "":
         path = extrapaths.split(":") + path
     # The ":" ensures we have an 'empty' override
-    overrides = (":" + (d.getVar("FILESOVERRIDES", True) or "")).split(":")
+    overrides = (":" + (d.getVar("FILESOVERRIDES") or "")).split(":")
     overrides.reverse()
     for o in overrides:
         for p in path:
@@ -333,7 +347,7 @@
 def extend_variants(d, var, extend, delim=':'):
     """Return a string of all bb class extend variants for the given extend"""
     variants = []
-    whole = d.getVar(var, True) or ""
+    whole = d.getVar(var) or ""
     for ext in whole.split():
         eext = ext.split(delim)
         if len(eext) > 1 and eext[0] == extend:
@@ -341,7 +355,7 @@
     return " ".join(variants)
 
 def multilib_pkg_extend(d, pkg):
-    variants = (d.getVar("MULTILIB_VARIANTS", True) or "").split()
+    variants = (d.getVar("MULTILIB_VARIANTS") or "").split()
     if not variants:
         return pkg
     pkgs = pkg
@@ -349,24 +363,27 @@
         pkgs = pkgs + " " + v + "-" + pkg
     return pkgs
 
+def get_multilib_datastore(variant, d):
+    localdata = bb.data.createCopy(d)
+    overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + variant
+    localdata.setVar("OVERRIDES", overrides)
+    localdata.setVar("MLPREFIX", variant + "-")
+    return localdata
+
 def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' '):
     """Return a string of all ${var} in all multilib tune configuration"""
     values = []
-    value = d.getVar(var, True) or ""
+    value = d.getVar(var) or ""
     if value != "":
         if need_split:
             for item in value.split(delim):
                 values.append(item)
         else:
             values.append(value)
-    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+    variants = d.getVar("MULTILIB_VARIANTS") or ""
     for item in variants.split():
-        localdata = bb.data.createCopy(d)
-        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
-        localdata.setVar("OVERRIDES", overrides)
-        localdata.setVar("MLPREFIX", item + "-")
-        bb.data.update_data(localdata)
-        value = localdata.getVar(var, True) or ""
+        localdata = get_multilib_datastore(item, d)
+        value = localdata.getVar(var) or ""
         if value != "":
             if need_split:
                 for item in value.split(delim):
@@ -402,21 +419,16 @@
             newoverrides.append(o)
     localdata.setVar("OVERRIDES", ":".join(newoverrides))
     localdata.setVar("MLPREFIX", "")
-    origdefault = localdata.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL", True)
+    origdefault = localdata.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL")
     if origdefault:
         localdata.setVar("DEFAULTTUNE", origdefault)
-    bb.data.update_data(localdata)
     values['ml'] = ['']
     for v in vars:
-        values[v].append(localdata.getVar(v, True))
-    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+        values[v].append(localdata.getVar(v))
+    variants = d.getVar("MULTILIB_VARIANTS") or ""
     for item in variants.split():
-        localdata = bb.data.createCopy(d)
-        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
-        localdata.setVar("OVERRIDES", overrides)
-        localdata.setVar("MLPREFIX", item + "-")
-        bb.data.update_data(localdata)
-        values[v].append(localdata.getVar(v, True))
+        localdata = get_multilib_datastore(item, d)
+        values[v].append(localdata.getVar(v))
         values['ml'].append(item)
     return values
 
diff --git a/import-layers/yocto-poky/meta/classes/waf.bbclass b/import-layers/yocto-poky/meta/classes/waf.bbclass
index 5e55833..c4698e9 100644
--- a/import-layers/yocto-poky/meta/classes/waf.bbclass
+++ b/import-layers/yocto-poky/meta/classes/waf.bbclass
@@ -1,8 +1,10 @@
 # avoids build breaks when using no-static-libs.inc
 DISABLE_STATIC = ""
 
+EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
+
 def get_waf_parallel_make(d):
-    pm = d.getVar('PARALLEL_MAKE', True)
+    pm = d.getVar('PARALLEL_MAKE')
     if pm:
         # look for '-j' and throw other options (e.g. '-l') away
         # because they might have different meaning in bjam
diff --git a/import-layers/yocto-poky/meta/conf/abi_version.conf b/import-layers/yocto-poky/meta/conf/abi_version.conf
index a829687..4964880 100644
--- a/import-layers/yocto-poky/meta/conf/abi_version.conf
+++ b/import-layers/yocto-poky/meta/conf/abi_version.conf
@@ -4,4 +4,4 @@
 # that breaks the format and have been previously discussed on the mailing list 
 # with general agreement from the core team.
 #
-OELAYOUT_ABI = "11"
+OELAYOUT_ABI = "12"
diff --git a/import-layers/yocto-poky/meta/conf/bitbake.conf b/import-layers/yocto-poky/meta/conf/bitbake.conf
index 6e767b1..2dac3a1 100644
--- a/import-layers/yocto-poky/meta/conf/bitbake.conf
+++ b/import-layers/yocto-poky/meta/conf/bitbake.conf
@@ -123,7 +123,7 @@
 TARGET_ARCH = "${TUNE_ARCH}"
 TARGET_OS = "linux${LIBCEXTENSION}${ABIEXTENSION}"
 TARGET_VENDOR = "-oe"
-TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + d.getVar('TARGET_OS', True), ''][d.getVar('TARGET_OS', True) == ('' or 'custom')]}"
+TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + d.getVar('TARGET_OS'), ''][d.getVar('TARGET_OS') == ('' or 'custom')]}"
 TARGET_PREFIX = "${TARGET_SYS}-"
 TARGET_CC_ARCH = "${TUNE_CCARGS}"
 TARGET_LD_ARCH = "${TUNE_LDARGS}"
@@ -132,7 +132,7 @@
 SDKMACHINE ??= "x86_64"
 SDK_OS = "${BUILD_OS}"
 SDK_VENDOR = "-oesdk"
-SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS', True), ''][d.getVar('SDK_OS', True) == ('' or 'custom')]}"
+SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS'), ''][d.getVar('SDK_OS') == ('' or 'custom')]}"
 SDK_PREFIX = "${SDK_SYS}-"
 SDK_CC_ARCH = "${BUILD_CC_ARCH}"
 SDKPKGSUFFIX = "nativesdk"
@@ -142,7 +142,7 @@
 
 TUNE_PKGARCH ??= ""
 PACKAGE_ARCH ??= "${TUNE_PKGARCH}"
-MACHINE_ARCH = "${@[d.getVar('TUNE_PKGARCH', True), d.getVar('MACHINE', True)][bool(d.getVar('MACHINE', True))].replace('-', '_')}"
+MACHINE_ARCH = "${@[d.getVar('TUNE_PKGARCH'), d.getVar('MACHINE')][bool(d.getVar('MACHINE'))].replace('-', '_')}"
 PACKAGE_EXTRA_ARCHS ??= "${PACKAGE_EXTRA_ARCHS_tune-${DEFAULTTUNE}}"
 PACKAGE_ARCHS = "all any noarch ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
 # MACHINE_ARCH shouldn't be included here as a variable dependency
@@ -150,7 +150,6 @@
 PACKAGE_ARCHS[vardepsexclude] = "MACHINE_ARCH"
 
 MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
-MULTIMACH_HOST_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}"
 
 ##################################################################
 # Date/time variables.
@@ -197,24 +196,24 @@
 PR = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
 PE = ""
 PF = "${PN}-${EXTENDPE}${PV}-${PR}"
-EXTENDPE = "${@['','${PE}_'][int(d.getVar('PE', True) or 0) > 0]}"
+EXTENDPE = "${@['','${PE}_'][int(d.getVar('PE') or 0) > 0]}"
 P = "${PN}-${PV}"
 
 PRAUTO = ""
-EXTENDPRAUTO = "${@['.${PRAUTO}', ''][not d.getVar('PRAUTO', True)]}"
+EXTENDPRAUTO = "${@['.${PRAUTO}', ''][not d.getVar('PRAUTO')]}"
 PRAUTOINX = "${PF}"
 
 PKGV ?= "${PV}"
 PKGR ?= "${PR}${EXTENDPRAUTO}"
-PKGE ?= "${@['','${PE}'][int(d.getVar('PE', True) or 0) > 0]}"
-EXTENDPKGEVER = "${@['','${PKGE}:'][d.getVar('PKGE', True).strip() != '']}"
+PKGE ?= "${@['','${PE}'][int(d.getVar('PE') or 0) > 0]}"
+EXTENDPKGEVER = "${@['','${PKGE}:'][d.getVar('PKGE').strip() != '']}"
 EXTENDPKGV ?= "${EXTENDPKGEVER}${PKGV}-${PKGR}"
 
 # Base package name
 # Automatically derives "foo" from "foo-native", "foo-cross" or "foo-initial"
 # otherwise it is the same as PN and P
 SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -crosssdk -cross-canadian"
-BPN = "${@base_prune_suffix(d.getVar('PN', True), d.getVar('SPECIAL_PKGSUFFIX', True).split(), d)}"
+BPN = "${@base_prune_suffix(d.getVar('PN'), d.getVar('SPECIAL_PKGSUFFIX').split(), d)}"
 BP = "${BPN}-${PV}"
 
 # Package info.
@@ -330,7 +329,7 @@
 ##################################################################
 
 TMPDIR ?= "${TOPDIR}/tmp"
-CACHE = "${TMPDIR}/cache${@['', '/' + str(d.getVar('MACHINE', True))][bool(d.getVar('MACHINE', True))]}${@['', '/' + str(d.getVar('SDKMACHINE', True))][bool(d.getVar('SDKMACHINE', True))]}"
+CACHE = "${TMPDIR}/cache${@['', '/' + str(d.getVar('MACHINE'))][bool(d.getVar('MACHINE'))]}${@['', '/' + str(d.getVar('SDKMACHINE'))][bool(d.getVar('SDKMACHINE'))]}"
 # The persistent cache should be shared by all builds
 PERSISTENT_DIR = "${TOPDIR}/cache"
 LOG_DIR = "${TMPDIR}/log"
@@ -352,8 +351,11 @@
 B = "${S}"
 
 STAGING_DIR = "${TMPDIR}/sysroots"
+COMPONENTS_DIR = "${STAGING_DIR}-components"
+RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
+RECIPE_SYSROOT_NATIVE = "${WORKDIR}/recipe-sysroot-native"
 
-STAGING_DIR_NATIVE = "${STAGING_DIR}/${BUILD_SYS}"
+STAGING_DIR_NATIVE = "${RECIPE_SYSROOT_NATIVE}"
 STAGING_BINDIR_NATIVE = "${STAGING_DIR_NATIVE}${bindir_native}"
 STAGING_BINDIR_CROSS = "${STAGING_BINDIR}/crossscripts"
 STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
@@ -365,7 +367,7 @@
 STAGING_ETCDIR_NATIVE = "${STAGING_DIR_NATIVE}${sysconfdir_native}"
 STAGING_DATADIR_NATIVE = "${STAGING_DIR_NATIVE}${datadir_native}"
 
-STAGING_DIR_HOST = "${STAGING_DIR}/${MACHINE}"
+STAGING_DIR_HOST = "${RECIPE_SYSROOT}"
 STAGING_BINDIR = "${STAGING_DIR_HOST}${bindir}"
 STAGING_LIBDIR = "${STAGING_DIR_HOST}${libdir}"
 STAGING_LIBEXECDIR = "${STAGING_DIR_HOST}${libexecdir}"
@@ -376,8 +378,7 @@
 STAGING_LOADER_DIR = "${STAGING_DIR_HOST}/loader"
 STAGING_FIRMWARE_DIR = "${STAGING_DIR_HOST}/firmware"
 
-STAGING_DIR_TARGET = "${STAGING_DIR}/${MACHINE}"
-STAGING_DIR_TCBOOTSTRAP = "${STAGING_DIR_TARGET}-tcbootstrap"
+STAGING_DIR_TARGET = "${RECIPE_SYSROOT}"
 
 # Setting DEPLOY_DIR outside of TMPDIR is helpful, when you are using
 # packaged staging and/or multimachine.
@@ -389,7 +390,7 @@
 DEPLOY_DIR_IMAGE ?= "${DEPLOY_DIR}/images/${MACHINE}"
 DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools"
 
-PKGDATA_DIR = "${STAGING_DIR_HOST}/pkgdata"
+PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}"
 
 ##################################################################
 # SDK variables.
@@ -452,10 +453,37 @@
 # Build utility info.
 ##################################################################
 
+# Directory where host tools are copied
+HOSTTOOLS_DIR = "${TMPDIR}/hosttools"
+
+# Tools needed to run builds with OE-Core
+HOSTTOOLS += " \
+    [ ar as awk basename bash bzip2 cat chgrp chmod chown chrpath cmp cp cpio \
+    cpp cut date dd diff diffstat dirname du echo egrep env expand expr false \
+    fgrep file find flock g++ gawk gcc getconf getopt git grep gunzip gzip \
+    head hostname install ld ldd ln ls make makeinfo md5sum mkdir mknod \
+    mktemp mv nm objcopy objdump od patch perl pod2man pr printf pwd python python2 \
+    python2.7 python3 ranlib readelf readlink rm rmdir rpcgen sed sh sha256sum \
+    sleep sort split stat strings strip tail tar tee test touch tr true uname \
+    uniq wc wget which xargs \
+"
+
+# Tools needed to run testimage runtime image testing
+HOSTTOOLS += "ip ping ps scp ssh stty"
+
+# Link to these if present
+HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc sftp socat sudo"
+
+# Temporary add few more detected in bitbake world
+HOSTTOOLS_NONFATAL += "join nl size yes zcat"
+
+# Used by bzr fetcher
+HOSTTOOLS_NONFATAL += "bzr"
+
 CCACHE ??= ""
 # Disable ccache explicitly if CCACHE is null since gcc may be a symlink
 # of ccache some distributions (e.g., Fedora 17).
-export CCACHE_DISABLE ??= "${@[0,1][d.getVar('CCACHE', True) == '']}"
+export CCACHE_DISABLE ??= "${@[0,1][d.getVar('CCACHE') == '']}"
 # ccache < 3.1.10 will create CCACHE_DIR on startup even if disabled, and
 # autogen sets HOME=/dev/null so in certain situations builds can fail.
 # Explicitly export CCACHE_DIR until we can assume ccache >3.1.10 on the host.
@@ -533,18 +561,9 @@
 
 LINKER_HASH_STYLE ??= "gnu"
 # mips does not support GNU hash style therefore we override
-LINKER_HASH_STYLE_mips = "sysv"
-LINKER_HASH_STYLE_mipsel = "sysv"
-LINKER_HASH_STYLE_mips64 = "sysv"
-LINKER_HASH_STYLE_mips64el = "sysv"
-LINKER_HASH_STYLE_mips64n32 = "sysv"
-LINKER_HASH_STYLE_mips64eln32 = "sysv"
-LINKER_HASH_STYLE_mipsisa32r6 = "sysv"
-LINKER_HASH_STYLE_mipsisa32r6el = "sysv"
-LINKER_HASH_STYLE_mipsisa64r6 = "sysv"
-LINKER_HASH_STYLE_mipsisa64r6el = "sysv"
+LINKER_HASH_STYLE_mipsarch = "sysv"
 
-TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE', True) != 'gnu']}"
+TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE') != 'gnu']}"
 
 export LDFLAGS = "${TARGET_LDFLAGS}"
 export TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE}"
@@ -570,7 +589,7 @@
 # Disabled until the option works properly -feliminate-dwarf2-dups
 FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
 DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
-SELECTED_OPTIMIZATION = "${@d.getVar(['FULL_OPTIMIZATION', 'DEBUG_OPTIMIZATION'][d.getVar('DEBUG_BUILD', True) == '1'], True)}"
+SELECTED_OPTIMIZATION = "${@d.getVar(['FULL_OPTIMIZATION', 'DEBUG_OPTIMIZATION'][d.getVar('DEBUG_BUILD') == '1'])}"
 SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION"
 BUILD_OPTIMIZATION = "-O2 -pipe"
 
@@ -592,7 +611,7 @@
 GNU_MIRROR = "http://ftp.gnu.org/gnu"
 GNUPG_MIRROR = "https://www.gnupg.org/ftp/gcrypt"
 GPE_MIRROR = "http://gpe.linuxtogo.org/download/source"
-KERNELORG_MIRROR = "http://kernel.org/pub"
+KERNELORG_MIRROR = "http://cdn.kernel.org/pub"
 SOURCEFORGE_MIRROR = "http://downloads.sourceforge.net"
 XLIBS_MIRROR = "http://xlibs.freedesktop.org/release"
 XORG_MIRROR = "http://xorg.freedesktop.org/releases"
@@ -639,14 +658,15 @@
 
 # Use pseudo as the fakeroot implementation
 PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
-PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${STAGING_DIR_NATIVE}"
+PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${PSEUDO_SYSROOT}"
+PSEUDO_SYSROOT = "${COMPONENTS_DIR}/${BUILD_ARCH}/pseudo-native"
 export PSEUDO_DISABLED = "1"
 #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
 #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
 #export PSEUDO_LIBDIR = "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib
-FAKEROOTBASEENV = "PSEUDO_BINDIR=${STAGING_BINDIR_NATIVE} PSEUDO_LIBDIR=${STAGING_BINDIR_NATIVE}/../lib/pseudo/lib PSEUDO_PREFIX=${STAGING_BINDIR_NATIVE}/../../ PSEUDO_DISABLED=1"
-FAKEROOTCMD = "${STAGING_BINDIR_NATIVE}/pseudo"
-FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
+FAKEROOTBASEENV = "PSEUDO_BINDIR=${PSEUDO_SYSROOT}${bindir_native} PSEUDO_LIBDIR=${PSEUDO_SYSROOT}${prefix_native}/lib/pseudo/lib PSEUDO_PREFIX=${PSEUDO_SYSROOT}${prefix_native} PSEUDO_DISABLED=1"
+FAKEROOTCMD = "${PSEUDO_SYSROOT}${bindir_native}/pseudo"
+FAKEROOTENV = "PSEUDO_PREFIX=${PSEUDO_SYSROOT}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
 FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
 FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
 PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
@@ -696,7 +716,7 @@
 OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}:forcevariable"
 OVERRIDES[vardepsexclude] = "MACHINEOVERRIDES"
 CLASSOVERRIDE ?= "class-target"
-DISTROOVERRIDES ?= "${@d.getVar('DISTRO', True) or ''}"
+DISTROOVERRIDES ?= "${@d.getVar('DISTRO') or ''}"
 MACHINEOVERRIDES ?= "${MACHINE}"
 MACHINEOVERRIDES[vardepsexclude] = "MACHINE"
 
@@ -710,11 +730,11 @@
 include conf/site.conf
 include conf/auto.conf
 include conf/local.conf
-include conf/multiconfig/${BB_CURRENT_MC}.conf
+require conf/multiconfig/${BB_CURRENT_MC}.conf
 include conf/build/${BUILD_SYS}.conf
-include conf/target/${TARGET_SYS}.conf
 include conf/machine/${MACHINE}.conf
 include conf/machine-sdk/${SDKMACHINE}.conf
+include conf/target/${TARGET_SYS}.conf
 include conf/distro/${DISTRO}.conf
 include conf/distro/defaultsetup.conf
 include conf/documentation.conf
@@ -776,14 +796,24 @@
 EXTRA_IMAGE_FEATURES ??= ""
 IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
 
-DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-introspection-data"
+# Native distro features (will always be used for -native, even if they
+# are not enabled for target)
+DISTRO_FEATURES_NATIVE ?= "x11"
+DISTRO_FEATURES_NATIVESDK ?= "x11 libc-charsets libc-locales libc-locale-code"
+
+# Normally target distro features will not be applied to native builds:
+# Native distro features on this list will use the target feature value
+DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation"
+DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation"
+
+DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-introspection-data ldconfig"
 MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
 
 COMBINED_FEATURES = "${@oe.utils.set_intersect('DISTRO_FEATURES', 'MACHINE_FEATURES', d)}"
 COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES"
 
 SERIAL_CONSOLE ??= ""
-SERIAL_CONSOLES ??= "${@d.getVar('SERIAL_CONSOLE', True).replace(' ', ';')}"
+SERIAL_CONSOLES ??= "${@d.getVar('SERIAL_CONSOLE').replace(' ', ';')}"
 
 NO_RECOMMENDATIONS ?= ""
 BAD_RECOMMENDATIONS ?= ""
@@ -807,7 +837,7 @@
 SHELL[unexport] = "1"
 
 # Used by canadian-cross to handle string conversions on TARGET_ARCH where needed
-TRANSLATED_TARGET_ARCH ??= "${@d.getVar('TARGET_ARCH', True).replace("_", "-")}"
+TRANSLATED_TARGET_ARCH ??= "${@d.getVar('TARGET_ARCH').replace("_", "-")}"
 
 # Complete output from bitbake
 BB_CONSOLELOG ?= "${LOG_DIR}/cooker/${MACHINE}/${DATETIME}.log"
@@ -820,7 +850,7 @@
     PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
     CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_DISABLE LICENSE_PATH SDKPKGSUFFIX \
     WARN_QA ERROR_QA WORKDIR STAMPCLEAN PKGDATA_DIR BUILD_ARCH SSTATE_PKGARCH \
-    BB_WORKERCONTEXT"
+    BB_WORKERCONTEXT BB_LIMITEDDEPS extend_recipe_sysroot DEPLOY_DIR"
 BB_HASHCONFIG_WHITELIST ?= "${BB_HASHBASE_WHITELIST} DATE TIME SSH_AGENT_PID \
     SSH_AUTH_SOCK PSEUDO_BUILD BB_ENV_EXTRAWHITE DISABLE_SANITY_CHECKS \
     PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \
diff --git a/import-layers/yocto-poky/meta/conf/distro/defaultsetup.conf b/import-layers/yocto-poky/meta/conf/distro/defaultsetup.conf
index aa21345..ca2f917 100644
--- a/import-layers/yocto-poky/meta/conf/distro/defaultsetup.conf
+++ b/import-layers/yocto-poky/meta/conf/distro/defaultsetup.conf
@@ -15,10 +15,10 @@
 TCLIBCAPPEND ?= "-${TCLIBC}"
 TMPDIR .= "${TCLIBCAPPEND}"
 
-CACHE = "${TMPDIR}/cache/${TCMODE}-${TCLIBC}${@['', '/' + str(d.getVar('MACHINE', True))][bool(d.getVar('MACHINE', True))]}${@['', '/' + str(d.getVar('SDKMACHINE', True))][bool(d.getVar('SDKMACHINE', True))]}"
+CACHE = "${TMPDIR}/cache/${TCMODE}-${TCLIBC}${@['', '/' + str(d.getVar('MACHINE'))][bool(d.getVar('MACHINE'))]}${@['', '/' + str(d.getVar('SDKMACHINE'))][bool(d.getVar('SDKMACHINE'))]}"
 
 USER_CLASSES ?= ""
 PACKAGE_CLASSES ?= "package_ipk"
 INHERIT_BLACKLIST = "blacklist"
-INHERIT_DISTRO ?= "debian devshell sstate license"
+INHERIT_DISTRO ?= "debian devshell sstate license remove-libtool"
 INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO} ${INHERIT_BLACKLIST}"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/default-distrovars.inc b/import-layers/yocto-poky/meta/conf/distro/include/default-distrovars.inc
index f7ed943..08542a7 100644
--- a/import-layers/yocto-poky/meta/conf/distro/include/default-distrovars.inc
+++ b/import-layers/yocto-poky/meta/conf/distro/include/default-distrovars.inc
@@ -9,7 +9,7 @@
 LOCALE_UTF8_ONLY ?= "0"
 LOCALE_UTF8_IS_DEFAULT ?= "1"
 
-DISTRO_FEATURES_DEFAULT ?= "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11"
+DISTRO_FEATURES_DEFAULT ?= "acl alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11"
 DISTRO_FEATURES_LIBC_DEFAULT ?= "ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt \
 					libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse \
 					libc-getlogin libc-idn libc-inet-anl libc-libm libc-locales libc-locale-code \
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/default-versions.inc b/import-layers/yocto-poky/meta/conf/distro/include/default-versions.inc
index cc8c533..d976508 100644
--- a/import-layers/yocto-poky/meta/conf/distro/include/default-versions.inc
+++ b/import-layers/yocto-poky/meta/conf/distro/include/default-versions.inc
@@ -5,6 +5,3 @@
 # Force the older version of liberation-fonts until we fix the fontforge issue
 PREFERRED_VERSION_liberation-fonts ?= "1.04"
 
-# Force db-native's version to keep sync with db while
-# 'AGPL-3.0' in ${INCOMPATIBLE_LICENSE} blacklist
-PREFERRED_VERSION_db-native = "${@incompatible_license_contains('AGPL-3.0', '5.%', '6.%', d)}"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/distro_alias.inc b/import-layers/yocto-poky/meta/conf/distro/include/distro_alias.inc
index 10efb09..489f5ea 100644
--- a/import-layers/yocto-poky/meta/conf/distro/include/distro_alias.inc
+++ b/import-layers/yocto-poky/meta/conf/distro/include/distro_alias.inc
@@ -135,7 +135,7 @@
 DISTRO_PN_ALIAS_pn-gtk-engines = "Fedora=gtk2-engines OpenSuSE=gtk2-engines Ubuntu=gtk2-engines Mandriva=gtk-engines2 Debian=gtk2-engines"
 DISTRO_PN_ALIAS_pn-gtk-sato-engine = "OpenedHand"
 DISTRO_PN_ALIAS_pn-gtk-icon-utils-native = "OSPDT"
-DISTRO_PN_ALIAS_pn-gummiboot = "Debian=gummiboot Fedora=gummiboot"
+DISTRO_PN_ALIAS_pn-systemd-boot = "Ubuntu=systemd-boot Fedora=systemd-boot"
 DISTRO_PN_ALIAS_pn-hello-mod = "OE-Core"
 DISTRO_PN_ALIAS_pn-hostap-conf = "OE-Core"
 DISTRO_PN_ALIAS_pn-hwlatdetect = "OSPDT"
@@ -400,7 +400,6 @@
 DISTRO_PN_ALIAS_pn-weston-init = "OE-Core"
 DISTRO_PN_ALIAS_pn-which = "Mandriva=which Fedora=which"
 DISTRO_PN_ALIAS_pn-wpa-supplicant = "Meego=wpa_supplicant Fedora=wpa_supplicant OpenSuSE=wpa_supplicant Ubuntu=wpasupplicant Mandriva=wpa_supplicant Debian=wpasupplicant"
-DISTRO_PN_ALIAS_pn-x11-common = "OE-Core"
 DISTRO_PN_ALIAS_pn-x11perf = "Fedora=xorg-x11-apps Ubuntu=x11-apps"
 DISTRO_PN_ALIAS_pn-xcb-util-image = "Debian=xcb-util Fedora=xcb-util"
 DISTRO_PN_ALIAS_pn-xcb-util-keysyms = "Debian=xcb-util Fedora=xcb-util"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/no-static-libs.inc b/import-layers/yocto-poky/meta/conf/distro/include/no-static-libs.inc
index 13a7918..f8d8c09 100644
--- a/import-layers/yocto-poky/meta/conf/distro/include/no-static-libs.inc
+++ b/import-layers/yocto-poky/meta/conf/distro/include/no-static-libs.inc
@@ -32,4 +32,8 @@
 
 EXTRA_OECONF_append = "${DISABLE_STATIC}"
 
-EXTRA_OECMAKE_append_pn-libical = "-DSHARED_ONLY=True"
+EXTRA_OECMAKE_append_pn-libical = " -DSHARED_ONLY=True"
+
+EXCONFIG_ARGS_append_pn-ncurses = " --without-normal"
+EXCONFIG_ARGS_append_pn-ncurses-native = " --without-normal"
+EXCONFIG_ARGS_append_pn-nativesdk-ncurses = " --without-normal"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/security_flags.inc b/import-layers/yocto-poky/meta/conf/distro/include/security_flags.inc
index eca835e..e162abe 100644
--- a/import-layers/yocto-poky/meta/conf/distro/include/security_flags.inc
+++ b/import-layers/yocto-poky/meta/conf/distro/include/security_flags.inc
@@ -45,6 +45,7 @@
 SECURITY_CFLAGS_pn-gdb = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-gmp = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-gnutls = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gpgme = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-grub = ""
 SECURITY_CFLAGS_pn-grub-efi = ""
 SECURITY_CFLAGS_pn-grub-efi-native = ""
@@ -72,13 +73,12 @@
 SECURITY_CFLAGS_pn-ppp = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-python = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-python-pycurl = "${SECURITY_NO_PIE_CFLAGS}"
-SECURITY_CFLAGS_pn-python-smartpm = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-python-numpy = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-python3-numpy = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-python3-pycairo = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python3-pycurl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python3-pygpgme = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-python3 = "${SECURITY_NO_PIE_CFLAGS}"
-# Revert RPM to using internally supported values
-SECURITY_CFLAGS_pn-rpm = "${lcl_maybe_fortify} -fstack-protector"
 SECURITY_CFLAGS_pn-syslinux = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-slang = "${SECURITY_NO_PIE_CFLAGS}"
 SECURITY_CFLAGS_pn-source-highlight = "${SECURITY_NO_PIE_CFLAGS}"
@@ -91,12 +91,7 @@
 
 # Recipes which fail to compile when elevating -Wformat-security to an error
 SECURITY_STRINGFORMAT_pn-busybox = ""
-SECURITY_STRINGFORMAT_pn-console-tools = ""
-SECURITY_STRINGFORMAT_pn-cmake = ""
-SECURITY_STRINGFORMAT_pn-expect = ""
 SECURITY_STRINGFORMAT_pn-gcc = ""
-SECURITY_STRINGFORMAT_pn-gettext = ""
-SECURITY_STRINGFORMAT_pn-kexec-tools = ""
 SECURITY_STRINGFORMAT_pn-oh-puzzles = ""
 
 TARGET_CFLAGS_append_class-target = " ${SECURITY_CFLAGS}"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/tclibc-glibc.inc b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-glibc.inc
index 649918f..ad8000f 100644
--- a/import-layers/yocto-poky/meta/conf/distro/include/tclibc-glibc.inc
+++ b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-glibc.inc
@@ -2,7 +2,7 @@
 # glibc specific configuration
 #
 
-LIBCEXTENSION = "${@['', '-gnu'][(d.getVar('ABIEXTENSION', True) or '') != '']}"
+LIBCEXTENSION = "${@['', '-gnu'][(d.getVar('ABIEXTENSION') or '') != '']}"
 
 # Add glibc overrides to the overrides for glibc.
 LIBCOVERRIDE = ":libc-glibc"
@@ -34,7 +34,7 @@
 	glibc-gconv-iso8859-15"
 
 def get_libc_locales_dependencies(d):
-    if 'libc-locales' in (d.getVar('DISTRO_FEATURES', True) or '').split() :
-        return d.getVar('LIBC_LOCALE_DEPENDENCIES', True) or ''
+    if 'libc-locales' in (d.getVar('DISTRO_FEATURES') or '').split() :
+        return d.getVar('LIBC_LOCALE_DEPENDENCIES') or ''
     else:
         return ''
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/tclibc-musl.inc b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-musl.inc
index e6b10f9..3d3f6ac 100644
--- a/import-layers/yocto-poky/meta/conf/distro/include/tclibc-musl.inc
+++ b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-musl.inc
@@ -4,7 +4,7 @@
 
 LIBCEXTENSION = "-musl"
 
-# Add uclibc overrides to the overrides.
+# Add musl libc overrides to the overrides.
 LIBCOVERRIDE = ":libc-musl"
 OVERRIDES .= "${LIBCOVERRIDE}"
 
@@ -25,7 +25,3 @@
     musl-dbg \
     musl-dev \
     "
-
-# GLib binaries trigger assertion failures and crash under qemu
-# when musl is in use
-DISTRO_FEATURES_BACKFILL_CONSIDERED += "gobject-introspection-data"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/tcmode-default.inc b/import-layers/yocto-poky/meta/conf/distro/include/tcmode-default.inc
index ca3c5ec..3db16e8 100644
--- a/import-layers/yocto-poky/meta/conf/distro/include/tcmode-default.inc
+++ b/import-layers/yocto-poky/meta/conf/distro/include/tcmode-default.inc
@@ -22,13 +22,13 @@
 PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial ?= "nativesdk-glibc-initial"
 PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
 
-GCCVERSION ?= "6.2%"
+GCCVERSION ?= "6.3%"
 SDKGCCVERSION ?= "${GCCVERSION}"
-BINUVERSION ?= "2.27%"
-GDBVERSION ?= "7.11%"
-GLIBCVERSION ?= "2.24"
+BINUVERSION ?= "2.28%"
+GDBVERSION ?= "7.12%"
+GLIBCVERSION ?= "2.25"
 UCLIBCVERSION ?= "1.0%"
-LINUXLIBCVERSION ?= "4.8%"
+LINUXLIBCVERSION ?= "4.10%"
 
 PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
 PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/uninative-flags.inc b/import-layers/yocto-poky/meta/conf/distro/include/uninative-flags.inc
index e9f82c3..b6a944e 100644
--- a/import-layers/yocto-poky/meta/conf/distro/include/uninative-flags.inc
+++ b/import-layers/yocto-poky/meta/conf/distro/include/uninative-flags.inc
@@ -7,3 +7,11 @@
 # icu configure defaults to CXX11 if no -std= option is passed in CXXFLAGS
 # therefore pass one
 BUILD_CXXFLAGS_append_pn-icu-native = " -std=c++98"
+
+# Some distros (ubuntu 16.10, debian-testing) default to gcc configured with
+# --enable-default-pie (see gcc -v). This breaks e.g. prelink-native on a pie
+# default system if binutils-native was built on a system which is not pie default
+# We therefore enable pie unconditionally for native recipes where static libs are
+# used such as libiberty from binutils, for now, until our minimum distro set is
+# all default pie.
+BUILD_CFLAGS_append_pn-binutils-native = " -pie -fpie"
diff --git a/import-layers/yocto-poky/meta/conf/documentation.conf b/import-layers/yocto-poky/meta/conf/documentation.conf
index 06527cb..35b9103 100644
--- a/import-layers/yocto-poky/meta/conf/documentation.conf
+++ b/import-layers/yocto-poky/meta/conf/documentation.conf
@@ -415,7 +415,7 @@
 TARGET_OS[doc] = "Specifies the target's operating system."
 TARGET_PREFIX[doc] = "The prefix for the cross-compile toolchain (e.g. arm-linux-)."
 TARGET_SYS[doc] = "The target system is comprised of TARGET_ARCH,TARGET_VENDOR and TARGET_OS."
-TCLIBC[doc] = "Specifies GNU standard C library (libc) variant to use during the build process. You can select 'glibc' or 'uclibc'."
+TCLIBC[doc] = "Specifies C library (libc) variant to use during the build process. You can select 'baremetal', 'glibc' or 'musl'."
 TCMODE[doc] = "Enables an external toolchain (where provided by an additional layer) if set to a value other than 'default'."
 TEST_IMAGE[doc] = "Enables test booting of virtual machine images under the QEMU emulator after any root filesystems are created and runs tests against those images."
 TEST_QEMUBOOT_TIMEOUT[doc] = "The time in seconds allowed for an image to boot before automated runtime tests begin to run against an image."
diff --git a/import-layers/yocto-poky/meta/conf/layer.conf b/import-layers/yocto-poky/meta/conf/layer.conf
index 24b4df0..fc16502 100644
--- a/import-layers/yocto-poky/meta/conf/layer.conf
+++ b/import-layers/yocto-poky/meta/conf/layer.conf
@@ -9,7 +9,7 @@
 
 # This should only be incremented on significant changes that will
 # cause compatibility issues with other layers
-LAYERVERSION_core = "9"
+LAYERVERSION_core = "10"
 
 BBLAYERS_LAYERINDEX_NAME_core = "openembedded-core"
 
@@ -59,3 +59,5 @@
   oprofile->virtual/kernel \
 "
 
+# We need to keep bitbake tools in PATH
+PATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}:${HOSTTOOLS_DIR}"
diff --git a/import-layers/yocto-poky/meta/conf/licenses.conf b/import-layers/yocto-poky/meta/conf/licenses.conf
index 9917c40..d210a0e 100644
--- a/import-layers/yocto-poky/meta/conf/licenses.conf
+++ b/import-layers/yocto-poky/meta/conf/licenses.conf
@@ -133,11 +133,10 @@
 # You can set option to control if the copyright information will be skipped
 # during the identification process.
 #
-# It is defined as [FOSS_COPYRIGHT] in ./meta/conf/licenses.conf.
-# FOSS_COPYRIGHT = "true"
+# FOSS_NO_COPYRIGHT = "true"
 #   NO copyright will be processed. That means only license information will be
 #   identified and output to SPDX file
-# FOSS_COPYRIGHT = "false"
+# FOSS_NO_COPYRIGHT = "false"
 #   Copyright will be identified and output to SPDX file along with license
 #   information. The process will take more time than not processing copyright
 #   information.
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm.inc
index 2e3127c..99625d8 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm.inc
@@ -13,4 +13,4 @@
 
 ABIEXTENSION = "eabi"
 
-TARGET_FPU = "${@d.getVar('TUNE_CCARGS_MFLOAT', True) or 'soft'}"
+TARGET_FPU = "${@d.getVar('TUNE_CCARGS_MFLOAT') or 'soft'}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm64.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm64.inc
index 9eeffac..5f90763 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm64.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm64.inc
@@ -28,7 +28,7 @@
 TUNE_ARCH_32 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'armeb', 'arm', d)}"
 TUNE_PKGARCH_32 = "${ARMPKGARCH}${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}"
 ABIEXTENSION_32 = "eabi"
-TARGET_FPU_32 = "${@d.getVar('TUNE_CCARGS_MFLOAT', True) or 'soft'}"
+TARGET_FPU_32 = "${@d.getVar('TUNE_CCARGS_MFLOAT') or 'soft'}"
 
 TUNE_ARCH = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TUNE_ARCH_64}', '${TUNE_ARCH_32}' ,d)}"
 TUNE_PKGARCH = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TUNE_PKGARCH_64}', '${TUNE_PKGARCH_32}' ,d)}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc
index f204920..1f16085 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc
@@ -7,9 +7,9 @@
 AVAILTUNES += "armv5e armv5te"
 ARMPKGARCH_tune-armv5e  ?= "armv5"
 ARMPKGARCH_tune-armv5te ?= "armv5"
-TUNE_FEATURES_tune-armv5e  = "${TUNE_FEATURES_tune-armv5}  dsp"
+TUNE_FEATURES_tune-armv5e  = "${TUNE_FEATURES_tune-armv5} dsp"
 TUNE_FEATURES_tune-armv5te = "${TUNE_FEATURES_tune-armv5t} dsp"
-PACKAGE_EXTRA_ARCHS_tune-armv5e  = "${PACKAGE_EXTRA_ARCHS_tune-armv5}  armv5e"
+PACKAGE_EXTRA_ARCHS_tune-armv5e  = "${PACKAGE_EXTRA_ARCHS_tune-armv5} armv5e"
 PACKAGE_EXTRA_ARCHS_tune-armv5te = "${PACKAGE_EXTRA_ARCHS_tune-armv5t} armv5e armv5te"
 
 # Little Endian + VFP/DSP
@@ -18,22 +18,22 @@
 ARMPKGARCH_tune-armv5te-vfp   ?= "armv5"
 ARMPKGARCH_tune-armv5ehf-vfp  ?= "armv5"
 ARMPKGARCH_tune-armv5tehf-vfp ?= "armv5"
-TUNE_FEATURES_tune-armv5e-vfp    = "${TUNE_FEATURES_tune-armv5e}      vfp"
-TUNE_FEATURES_tune-armv5te-vfp   = "${TUNE_FEATURES_tune-armv5te}     vfp"
-TUNE_FEATURES_tune-armv5ehf-vfp  = "${TUNE_FEATURES_tune-armv5e-vfp}  callconvention-hard"
+TUNE_FEATURES_tune-armv5e-vfp    = "${TUNE_FEATURES_tune-armv5e} vfp"
+TUNE_FEATURES_tune-armv5te-vfp   = "${TUNE_FEATURES_tune-armv5te} vfp"
+TUNE_FEATURES_tune-armv5ehf-vfp  = "${TUNE_FEATURES_tune-armv5e-vfp} callconvention-hard"
 TUNE_FEATURES_tune-armv5tehf-vfp = "${TUNE_FEATURES_tune-armv5te-vfp} callconvention-hard"
-PACKAGE_EXTRA_ARCHS_tune-armv5e-vfp    = "${PACKAGE_EXTRA_ARCHS_tune-armv5-vfp}    armv5e armv5e-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv5te-vfp   = "${PACKAGE_EXTRA_ARCHS_tune-armv5t-vfp}   armv5e armv5te armv5e-vfp armv5te-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv5ehf-vfp  = "${PACKAGE_EXTRA_ARCHS_tune-armv5hf-vfp}  armv5ehf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5e-vfp    = "${PACKAGE_EXTRA_ARCHS_tune-armv5-vfp} armv5e armv5e-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5te-vfp   = "${PACKAGE_EXTRA_ARCHS_tune-armv5t-vfp} armv5e armv5te armv5e-vfp armv5te-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5ehf-vfp  = "${PACKAGE_EXTRA_ARCHS_tune-armv5hf-vfp} armv5ehf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv5tehf-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5thf-vfp} armv5ehf-vfp armv5tehf-vfp"
 
 # Big Endian
 AVAILTUNES += "armv5eb armv5teb"
 ARMPKGARCH_tune-armv5eb  ?= "armv5"
 ARMPKGARCH_tune-armv5teb ?= "armv5"
-TUNE_FEATURES_tune-armv5eb  = "${TUNE_FEATURES_tune-armv5e}  bigendian"
+TUNE_FEATURES_tune-armv5eb  = "${TUNE_FEATURES_tune-armv5e} bigendian"
 TUNE_FEATURES_tune-armv5teb = "${TUNE_FEATURES_tune-armv5te} bigendian"
-PACKAGE_EXTRA_ARCHS_tune-armv5eb  = "${PACKAGE_EXTRA_ARCHS_tune-armv5b}  armv5eb"
+PACKAGE_EXTRA_ARCHS_tune-armv5eb  = "${PACKAGE_EXTRA_ARCHS_tune-armv5b} armv5eb"
 PACKAGE_EXTRA_ARCHS_tune-armv5teb = "${PACKAGE_EXTRA_ARCHS_tune-armv5tb} armv5eb armv5teb"
 
 # Big Endian + VFP/DSP
@@ -42,11 +42,11 @@
 ARMPKGARCH_tune-armv5teb-vfp   ?= "armv5"
 ARMPKGARCH_tune-armv5ehfb-vfp  ?= "armv5"
 ARMPKGARCH_tune-armv5tehfb-vfp ?= "armv5"
-TUNE_FEATURES_tune-armv5eb-vfp    = "${TUNE_FEATURES_tune-armv5e-vfp}    bigendian"
-TUNE_FEATURES_tune-armv5teb-vfp   = "${TUNE_FEATURES_tune-armv5te-vfp}   bigendian"
-TUNE_FEATURES_tune-armv5ehfb-vfp  = "${TUNE_FEATURES_tune-armv5ehf-vfp}  bigendian"
+TUNE_FEATURES_tune-armv5eb-vfp    = "${TUNE_FEATURES_tune-armv5e-vfp} bigendian"
+TUNE_FEATURES_tune-armv5teb-vfp   = "${TUNE_FEATURES_tune-armv5te-vfp} bigendian"
+TUNE_FEATURES_tune-armv5ehfb-vfp  = "${TUNE_FEATURES_tune-armv5ehf-vfp} bigendian"
 TUNE_FEATURES_tune-armv5tehfb-vfp = "${TUNE_FEATURES_tune-armv5tehf-vfp} bigendian"
-PACKAGE_EXTRA_ARCHS_tune-armv5eb-vfp    = "${PACKAGE_EXTRA_ARCHS_tune-armv5b-vfp}  armv5eb armv5eb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5eb-vfp    = "${PACKAGE_EXTRA_ARCHS_tune-armv5b-vfp} armv5eb armv5eb-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv5teb-vfp   = "${PACKAGE_EXTRA_ARCHS_tune-armv5tb-vfp} armv5eb armv5teb armv5eb-vfp armv5teb-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv5ehfb-vfp  = "${PACKAGE_EXTRA_ARCHS_tune-armv5hfb-vfp}  armv5ehfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5ehfb-vfp  = "${PACKAGE_EXTRA_ARCHS_tune-armv5hfb-vfp} armv5ehfb-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv5tehfb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5thfb-vfp} armv5ehfb-vfp armv5tehfb-vfp"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5.inc
index e6ff902..46f631c 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5.inc
@@ -14,7 +14,7 @@
 ARMPKGARCH_tune-armv5t ?= "armv5"
 TUNE_FEATURES_tune-armv5  = "arm armv5"
 TUNE_FEATURES_tune-armv5t = "${TUNE_FEATURES_tune-armv5} thumb"
-PACKAGE_EXTRA_ARCHS_tune-armv5  = "${PACKAGE_EXTRA_ARCHS_tune-armv4}  armv5"
+PACKAGE_EXTRA_ARCHS_tune-armv5  = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv5"
 PACKAGE_EXTRA_ARCHS_tune-armv5t = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} armv5 armv5t"
 
 # Little Endian + VFP/DSP
@@ -23,11 +23,11 @@
 ARMPKGARCH_tune-armv5t-vfp   ?= "armv5"
 ARMPKGARCH_tune-armv5hf-vfp  ?= "armv5"
 ARMPKGARCH_tune-armv5thf-vfp ?= "armv5"
-TUNE_FEATURES_tune-armv5-vfp    = "${TUNE_FEATURES_tune-armv5}      vfp"
-TUNE_FEATURES_tune-armv5t-vfp   = "${TUNE_FEATURES_tune-armv5t}     vfp"
-TUNE_FEATURES_tune-armv5hf-vfp  = "${TUNE_FEATURES_tune-armv5-vfp}  callconvention-hard"
+TUNE_FEATURES_tune-armv5-vfp    = "${TUNE_FEATURES_tune-armv5} vfp"
+TUNE_FEATURES_tune-armv5t-vfp   = "${TUNE_FEATURES_tune-armv5t} vfp"
+TUNE_FEATURES_tune-armv5hf-vfp  = "${TUNE_FEATURES_tune-armv5-vfp} callconvention-hard"
 TUNE_FEATURES_tune-armv5thf-vfp = "${TUNE_FEATURES_tune-armv5t-vfp} callconvention-hard"
-PACKAGE_EXTRA_ARCHS_tune-armv5-vfp     = "${PACKAGE_EXTRA_ARCHS_tune-armv5}  armv5-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5-vfp     = "${PACKAGE_EXTRA_ARCHS_tune-armv5} armv5-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv5t-vfp    = "${PACKAGE_EXTRA_ARCHS_tune-armv5t} armv5-vfp armv5t-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv5hf-vfp   = "armv5hf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv5thf-vfp  = "armv5hf-vfp armv5thf-vfp"
@@ -36,9 +36,9 @@
 AVAILTUNES += "armv5b armv5tb"
 ARMPKGARCH_tune-armv5b  ?= "armv5"
 ARMPKGARCH_tune-armv5tb ?= "armv5"
-TUNE_FEATURES_tune-armv5b  = "${TUNE_FEATURES_tune-armv5}  bigendian"
+TUNE_FEATURES_tune-armv5b  = "${TUNE_FEATURES_tune-armv5} bigendian"
 TUNE_FEATURES_tune-armv5tb = "${TUNE_FEATURES_tune-armv5t} bigendian"
-PACKAGE_EXTRA_ARCHS_tune-armv5b  = "${PACKAGE_EXTRA_ARCHS_tune-armv4b}  armv5b"
+PACKAGE_EXTRA_ARCHS_tune-armv5b  = "${PACKAGE_EXTRA_ARCHS_tune-armv4b} armv5b"
 PACKAGE_EXTRA_ARCHS_tune-armv5tb = "${PACKAGE_EXTRA_ARCHS_tune-armv4tb} armv5b armv5tb"
 
 # Big Endian + VFP/DSP
@@ -47,11 +47,11 @@
 ARMPKGARCH_tune-armv5tb-vfp   ?= "armv5"
 ARMPKGARCH_tune-armv5hfb-vfp  ?= "armv5"
 ARMPKGARCH_tune-armv5thfb-vfp ?= "armv5"
-TUNE_FEATURES_tune-armv5b-vfp    = "${TUNE_FEATURES_tune-armv5-vfp}    bigendian"
-TUNE_FEATURES_tune-armv5tb-vfp   = "${TUNE_FEATURES_tune-armv5t-vfp}   bigendian"
-TUNE_FEATURES_tune-armv5hfb-vfp  = "${TUNE_FEATURES_tune-armv5hf-vfp}  bigendian"
+TUNE_FEATURES_tune-armv5b-vfp    = "${TUNE_FEATURES_tune-armv5-vfp} bigendian"
+TUNE_FEATURES_tune-armv5tb-vfp   = "${TUNE_FEATURES_tune-armv5t-vfp} bigendian"
+TUNE_FEATURES_tune-armv5hfb-vfp  = "${TUNE_FEATURES_tune-armv5hf-vfp} bigendian"
 TUNE_FEATURES_tune-armv5thfb-vfp = "${TUNE_FEATURES_tune-armv5thf-vfp} bigendian"
-PACKAGE_EXTRA_ARCHS_tune-armv5b-vfp    = "${PACKAGE_EXTRA_ARCHS_tune-armv5b}  armv5b-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5b-vfp    = "${PACKAGE_EXTRA_ARCHS_tune-armv5b} armv5b-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv5tb-vfp   = "${PACKAGE_EXTRA_ARCHS_tune-armv5tb} armv5b-vfp armv5tb-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv5hfb-vfp  = "armv5hfb-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv5thfb-vfp = "armv5hfb-vfp armv5thfb-vfp"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv6.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv6.inc
index 4c93f2c..6c838e9 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv6.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv6.inc
@@ -1,4 +1,4 @@
-DEFAULTTUNE ?= "armv6"
+DEFAULTTUNE ?= "armv6hf"
 
 TUNEVALID[armv6] = "Enable instructions for ARMv6"
 TUNECONFLICTS[armv6] = "armv4 armv5"
@@ -16,16 +16,16 @@
 ARMPKGARCH_tune-armv6hf      ?= "armv6"
 ARMPKGARCH_tune-armv6thf     ?= "armv6"
 TUNE_FEATURES_tune-armv6-novfp  = "arm armv6"
-TUNE_FEATURES_tune-armv6t-novfp = "${TUNE_FEATURES_tune-armv6-novfp}  thumb"
-TUNE_FEATURES_tune-armv6        = "${TUNE_FEATURES_tune-armv6-novfp}  vfp"
+TUNE_FEATURES_tune-armv6t-novfp = "${TUNE_FEATURES_tune-armv6-novfp} thumb"
+TUNE_FEATURES_tune-armv6        = "${TUNE_FEATURES_tune-armv6-novfp} vfp"
 TUNE_FEATURES_tune-armv6t       = "${TUNE_FEATURES_tune-armv6t-novfp} vfp"
-TUNE_FEATURES_tune-armv6hf      = "${TUNE_FEATURES_tune-armv6}        callconvention-hard"
-TUNE_FEATURES_tune-armv6thf     = "${TUNE_FEATURES_tune-armv6t}       callconvention-hard"
-PACKAGE_EXTRA_ARCHS_tune-armv6-novfp  = "${PACKAGE_EXTRA_ARCHS_tune-armv5e}  armv6"
+TUNE_FEATURES_tune-armv6hf      = "${TUNE_FEATURES_tune-armv6} callconvention-hard"
+TUNE_FEATURES_tune-armv6thf     = "${TUNE_FEATURES_tune-armv6t} callconvention-hard"
+PACKAGE_EXTRA_ARCHS_tune-armv6-novfp  = "${PACKAGE_EXTRA_ARCHS_tune-armv5e} armv6"
 PACKAGE_EXTRA_ARCHS_tune-armv6t-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5te} armv6 armv6t"
-PACKAGE_EXTRA_ARCHS_tune-armv6        = "${PACKAGE_EXTRA_ARCHS_tune-armv5e-vfp}  armv6 armv6-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6        = "${PACKAGE_EXTRA_ARCHS_tune-armv5e-vfp} armv6 armv6-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv6t       = "${PACKAGE_EXTRA_ARCHS_tune-armv5te-vfp} armv6 armv6t armv6-vfp armv6t-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv6hf      = "${PACKAGE_EXTRA_ARCHS_tune-armv5ehf-vfp}  armv6hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6hf      = "${PACKAGE_EXTRA_ARCHS_tune-armv5ehf-vfp} armv6hf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv6thf     = "${PACKAGE_EXTRA_ARCHS_tune-armv5tehf-vfp} armv6hf-vfp armv6thf-vfp"
 
 # Big Endian
@@ -36,15 +36,15 @@
 ARMPKGARCH_tune-armv6tb       ?= "armv6"
 ARMPKGARCH_tune-armv6hfb      ?= "armv6"
 ARMPKGARCH_tune-armv6thfb     ?= "armv6"
-TUNE_FEATURES_tune-armv6b-novfp  = "${TUNE_FEATURES_tune-armv6-novfp}  bigendian"
+TUNE_FEATURES_tune-armv6b-novfp  = "${TUNE_FEATURES_tune-armv6-novfp} bigendian"
 TUNE_FEATURES_tune-armv6tb-novfp = "${TUNE_FEATURES_tune-armv6t-novfp} bigendian"
-TUNE_FEATURES_tune-armv6b =        "${TUNE_FEATURES_tune-armv6}        bigendian"
-TUNE_FEATURES_tune-armv6tb =       "${TUNE_FEATURES_tune-armv6t}       bigendian"
-TUNE_FEATURES_tune-armv6hfb =      "${TUNE_FEATURES_tune-armv6hf}      bigendian"
-TUNE_FEATURES_tune-armv6thfb =     "${TUNE_FEATURES_tune-armv6thf}     bigendian"
-PACKAGE_EXTRA_ARCHS_tune-armv6b-novfp  = "${PACKAGE_EXTRA_ARCHS_tune-armv5eb}  armv6b"
+TUNE_FEATURES_tune-armv6b =        "${TUNE_FEATURES_tune-armv6} bigendian"
+TUNE_FEATURES_tune-armv6tb =       "${TUNE_FEATURES_tune-armv6t} bigendian"
+TUNE_FEATURES_tune-armv6hfb =      "${TUNE_FEATURES_tune-armv6hf} bigendian"
+TUNE_FEATURES_tune-armv6thfb =     "${TUNE_FEATURES_tune-armv6thf} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv6b-novfp  = "${PACKAGE_EXTRA_ARCHS_tune-armv5eb} armv6b"
 PACKAGE_EXTRA_ARCHS_tune-armv6tb-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb} armv6b armv6tb"
-PACKAGE_EXTRA_ARCHS_tune-armv6b        = "${PACKAGE_EXTRA_ARCHS_tune-armv5eb-vfp}  armv6b armv6b-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6b        = "${PACKAGE_EXTRA_ARCHS_tune-armv5eb-vfp} armv6b armv6b-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv6tb       = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb-vfp} armv6b armv6tb armv6b-vfp armv6tb-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv6hfb      = "${PACKAGE_EXTRA_ARCHS_tune-armv5ehfb-vfp}  armv6hfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6hfb      = "${PACKAGE_EXTRA_ARCHS_tune-armv5ehfb-vfp} armv6hfb-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv6thfb     = "${PACKAGE_EXTRA_ARCHS_tune-armv5tehfb-vfp} armv6hfb-vfp armv6thfb-vfp"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7a.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7a.inc
index 1f2e071..bad1c27 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7a.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7a.inc
@@ -1,4 +1,4 @@
-DEFAULTTUNE ?= "armv7a"
+DEFAULTTUNE ?= "armv7athf"
 
 TUNEVALID[armv7a] = "Enable instructions for ARMv7-a"
 TUNECONFLICTS[armv7a] = "armv4 armv5 armv6 armv7"
@@ -22,23 +22,23 @@
 ARMPKGARCH_tune-armv7at-neon-vfpv4 ?= "armv7a"
 TUNE_FEATURES_tune-armv7a             = "arm armv7a vfp"
 TUNE_FEATURES_tune-armv7at            = "${TUNE_FEATURES_tune-armv7a} thumb"
-TUNE_FEATURES_tune-armv7a-vfpv3d16    = "${TUNE_FEATURES_tune-armv7a}  vfpv3d16"
+TUNE_FEATURES_tune-armv7a-vfpv3d16    = "${TUNE_FEATURES_tune-armv7a} vfpv3d16"
 TUNE_FEATURES_tune-armv7at-vfpv3d16   = "${TUNE_FEATURES_tune-armv7at} vfpv3d16"
-TUNE_FEATURES_tune-armv7a-vfpv3       = "${TUNE_FEATURES_tune-armv7a-vfpv3d16}  vfpv3"
+TUNE_FEATURES_tune-armv7a-vfpv3       = "${TUNE_FEATURES_tune-armv7a-vfpv3d16} vfpv3"
 TUNE_FEATURES_tune-armv7at-vfpv3      = "${TUNE_FEATURES_tune-armv7at-vfpv3d16} vfpv3"
-TUNE_FEATURES_tune-armv7a-neon        = "${TUNE_FEATURES_tune-armv7a}  neon"
+TUNE_FEATURES_tune-armv7a-neon        = "${TUNE_FEATURES_tune-armv7a} neon"
 TUNE_FEATURES_tune-armv7at-neon       = "${TUNE_FEATURES_tune-armv7at} neon"
-TUNE_FEATURES_tune-armv7a-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7a-neon}  vfpv4"
+TUNE_FEATURES_tune-armv7a-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7a-neon} vfpv4"
 TUNE_FEATURES_tune-armv7at-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7at-neon} vfpv4"
-PACKAGE_EXTRA_ARCHS_tune-armv7a             = "${PACKAGE_EXTRA_ARCHS_tune-armv6}  armv7a armv7a-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7a             = "${PACKAGE_EXTRA_ARCHS_tune-armv6} armv7a armv7a-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv7at            = "${PACKAGE_EXTRA_ARCHS_tune-armv6t} armv7a armv7a-vfp armv7at2-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7a}  armv7a-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} armv7a-vfpv3d16"
 PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3d16   = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7a-vfpv3d16 armv7at2-vfpv3d16"
-PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3d16}  armv7a-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3d16} armv7a-vfpv3"
 PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3      = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3d16} armv7a-vfpv3 armv7at2-vfpv3"
-PACKAGE_EXTRA_ARCHS_tune-armv7a-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7a}  armv7a-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} armv7a-neon"
 PACKAGE_EXTRA_ARCHS_tune-armv7at-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7a-neon armv7at2-neon"
-PACKAGE_EXTRA_ARCHS_tune-armv7a-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon}  armv7a-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} armv7a-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-armv7at-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} armv7a-neon-vfpv4 armv7at2-neon-vfpv4"
 
 # HF Tunes
@@ -53,25 +53,25 @@
 ARMPKGARCH_tune-armv7athf-neon       ?= "armv7a"
 ARMPKGARCH_tune-armv7ahf-neon-vfpv4  ?= "armv7a"
 ARMPKGARCH_tune-armv7athf-neon-vfpv4 ?= "armv7a"
-TUNE_FEATURES_tune-armv7ahf             = "${TUNE_FEATURES_tune-armv7a}             callconvention-hard"
-TUNE_FEATURES_tune-armv7athf            = "${TUNE_FEATURES_tune-armv7at}            callconvention-hard"
-TUNE_FEATURES_tune-armv7ahf-vfpv3d16    = "${TUNE_FEATURES_tune-armv7a-vfpv3d16}    callconvention-hard"
-TUNE_FEATURES_tune-armv7athf-vfpv3d16   = "${TUNE_FEATURES_tune-armv7at-vfpv3d16}   callconvention-hard"
-TUNE_FEATURES_tune-armv7ahf-vfpv3       = "${TUNE_FEATURES_tune-armv7a-vfpv3}       callconvention-hard"
-TUNE_FEATURES_tune-armv7athf-vfpv3      = "${TUNE_FEATURES_tune-armv7at-vfpv3}      callconvention-hard"
-TUNE_FEATURES_tune-armv7ahf-neon        = "${TUNE_FEATURES_tune-armv7a-neon}        callconvention-hard"
-TUNE_FEATURES_tune-armv7athf-neon       = "${TUNE_FEATURES_tune-armv7at-neon}       callconvention-hard"
-TUNE_FEATURES_tune-armv7ahf-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7a-neon-vfpv4}  callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf             = "${TUNE_FEATURES_tune-armv7a} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf            = "${TUNE_FEATURES_tune-armv7at} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-vfpv3d16    = "${TUNE_FEATURES_tune-armv7a-vfpv3d16} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf-vfpv3d16   = "${TUNE_FEATURES_tune-armv7at-vfpv3d16} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-vfpv3       = "${TUNE_FEATURES_tune-armv7a-vfpv3} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf-vfpv3      = "${TUNE_FEATURES_tune-armv7at-vfpv3} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-neon        = "${TUNE_FEATURES_tune-armv7a-neon} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf-neon       = "${TUNE_FEATURES_tune-armv7at-neon} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7a-neon-vfpv4} callconvention-hard"
 TUNE_FEATURES_tune-armv7athf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7at-neon-vfpv4} callconvention-hard"
-PACKAGE_EXTRA_ARCHS_tune-armv7ahf             = "${PACKAGE_EXTRA_ARCHS_tune-armv6hf}  armv7ahf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf             = "${PACKAGE_EXTRA_ARCHS_tune-armv6hf} armv7ahf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv7athf            = "${PACKAGE_EXTRA_ARCHS_tune-armv6thf} armv7ahf-vfp armv7at2hf-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf}  armv7ahf-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} armv7ahf-vfpv3d16"
 PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3d16   = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} armv7ahf-vfpv3d16 armv7at2hf-vfpv3d16"
-PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3d16}  armv7ahf-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3d16} armv7ahf-vfpv3"
 PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3      = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3d16} armv7ahf-vfpv3 armv7at2hf-vfpv3"
-PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf}  armv7ahf-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} armv7ahf-neon"
 PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} armv7ahf-neon armv7at2hf-neon"
-PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon}  armv7ahf-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} armv7ahf-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} armv7ahf-neon-vfpv4 armv7at2hf-neon-vfpv4"
 
 # Big Endian
@@ -86,25 +86,25 @@
 ARMPKGARCH_tune-armv7atb-neon       ?= "armv7a"
 ARMPKGARCH_tune-armv7ab-neon-vfpv4  ?= "armv7a"
 ARMPKGARCH_tune-armv7atb-neon-vfpv4 ?= "armv7a"
-TUNE_FEATURES_tune-armv7ab             = "${TUNE_FEATURES_tune-armv7a}             bigendian"
-TUNE_FEATURES_tune-armv7atb            = "${TUNE_FEATURES_tune-armv7at}            bigendian"
-TUNE_FEATURES_tune-armv7ab-vfpv3d16    = "${TUNE_FEATURES_tune-armv7a-vfpv3d16}    bigendian"
-TUNE_FEATURES_tune-armv7atb-vfpv3d16   = "${TUNE_FEATURES_tune-armv7at-vfpv3d16}   bigendian"
-TUNE_FEATURES_tune-armv7ab-vfpv3       = "${TUNE_FEATURES_tune-armv7a-vfpv3}       bigendian"
-TUNE_FEATURES_tune-armv7atb-vfpv3      = "${TUNE_FEATURES_tune-armv7at-vfpv3}      bigendian"
-TUNE_FEATURES_tune-armv7ab-neon        = "${TUNE_FEATURES_tune-armv7a-neon}        bigendian"
-TUNE_FEATURES_tune-armv7atb-neon       = "${TUNE_FEATURES_tune-armv7at-neon}       bigendian"
-TUNE_FEATURES_tune-armv7ab-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7a-neon-vfpv4}  bigendian"
+TUNE_FEATURES_tune-armv7ab             = "${TUNE_FEATURES_tune-armv7a} bigendian"
+TUNE_FEATURES_tune-armv7atb            = "${TUNE_FEATURES_tune-armv7at} bigendian"
+TUNE_FEATURES_tune-armv7ab-vfpv3d16    = "${TUNE_FEATURES_tune-armv7a-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7atb-vfpv3d16   = "${TUNE_FEATURES_tune-armv7at-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7ab-vfpv3       = "${TUNE_FEATURES_tune-armv7a-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7atb-vfpv3      = "${TUNE_FEATURES_tune-armv7at-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7ab-neon        = "${TUNE_FEATURES_tune-armv7a-neon} bigendian"
+TUNE_FEATURES_tune-armv7atb-neon       = "${TUNE_FEATURES_tune-armv7at-neon} bigendian"
+TUNE_FEATURES_tune-armv7ab-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7a-neon-vfpv4} bigendian"
 TUNE_FEATURES_tune-armv7atb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7at-neon-vfpv4} bigendian"
-PACKAGE_EXTRA_ARCHS_tune-armv7ab             = "${PACKAGE_EXTRA_ARCHS_tune-armv6b}  armv7ab-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab             = "${PACKAGE_EXTRA_ARCHS_tune-armv6b} armv7ab-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv7atb            = "${PACKAGE_EXTRA_ARCHS_tune-armv6tb} armv7ab-vfp armv7at2b-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab}  armv7ab-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab} armv7ab-vfpv3d16"
 PACKAGE_EXTRA_ARCHS_tune-armv7atb-vfpv3d16   = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb} armv7ab-vfpv3d16 armv7at2b-vfpv3d16"
-PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3d16}  armv7ab-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3d16} armv7ab-vfpv3"
 PACKAGE_EXTRA_ARCHS_tune-armv7atb-vfpv3      = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb-vfpv3d16} armv7ab-vfpv3 armv7at2b-vfpv3"
-PACKAGE_EXTRA_ARCHS_tune-armv7ab-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab}  armv7ab-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab} armv7ab-neon"
 PACKAGE_EXTRA_ARCHS_tune-armv7atb-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb} armv7ab-neon armv7at2b-neon"
-PACKAGE_EXTRA_ARCHS_tune-armv7ab-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab-neon}  armv7ab-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab-neon} armv7ab-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-armv7atb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb-neon} armv7ab-neon-vfpv4 armv7at2b-neon-vfpv4"
 
 # Big Endian + HF
@@ -119,23 +119,23 @@
 ARMPKGARCH_tune-armv7athfb-neon       ?= "armv7a"
 ARMPKGARCH_tune-armv7ahfb-neon-vfpv4  ?= "armv7a"
 ARMPKGARCH_tune-armv7athfb-neon-vfpv4 ?= "armv7a"
-TUNE_FEATURES_tune-armv7ahfb             = "${TUNE_FEATURES_tune-armv7ahf}             bigendian"
-TUNE_FEATURES_tune-armv7athfb            = "${TUNE_FEATURES_tune-armv7athf}            bigendian"
-TUNE_FEATURES_tune-armv7ahfb-vfpv3d16    = "${TUNE_FEATURES_tune-armv7ahf-vfpv3d16}    bigendian"
-TUNE_FEATURES_tune-armv7athfb-vfpv3d16   = "${TUNE_FEATURES_tune-armv7athf-vfpv3d16}   bigendian"
-TUNE_FEATURES_tune-armv7ahfb-vfpv3       = "${TUNE_FEATURES_tune-armv7ahf-vfpv3}       bigendian"
-TUNE_FEATURES_tune-armv7athfb-vfpv3      = "${TUNE_FEATURES_tune-armv7athf-vfpv3}      bigendian"
-TUNE_FEATURES_tune-armv7ahfb-neon        = "${TUNE_FEATURES_tune-armv7ahf-neon}        bigendian"
-TUNE_FEATURES_tune-armv7athfb-neon       = "${TUNE_FEATURES_tune-armv7athf-neon}       bigendian"
-TUNE_FEATURES_tune-armv7ahfb-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ahf-neon-vfpv4}  bigendian"
+TUNE_FEATURES_tune-armv7ahfb             = "${TUNE_FEATURES_tune-armv7ahf} bigendian"
+TUNE_FEATURES_tune-armv7athfb            = "${TUNE_FEATURES_tune-armv7athf} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-vfpv3d16    = "${TUNE_FEATURES_tune-armv7ahf-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7athfb-vfpv3d16   = "${TUNE_FEATURES_tune-armv7athf-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-vfpv3       = "${TUNE_FEATURES_tune-armv7ahf-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7athfb-vfpv3      = "${TUNE_FEATURES_tune-armv7athf-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-neon        = "${TUNE_FEATURES_tune-armv7ahf-neon} bigendian"
+TUNE_FEATURES_tune-armv7athfb-neon       = "${TUNE_FEATURES_tune-armv7athf-neon} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ahf-neon-vfpv4} bigendian"
 TUNE_FEATURES_tune-armv7athfb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7athf-neon-vfpv4} bigendian"
-PACKAGE_EXTRA_ARCHS_tune-armv7ahfb             = "${PACKAGE_EXTRA_ARCHS_tune-armv6hfb}  armv7ahfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb             = "${PACKAGE_EXTRA_ARCHS_tune-armv6hfb} armv7ahfb-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv7athfb            = "${PACKAGE_EXTRA_ARCHS_tune-armv6thfb} armv7ahfb-vfp armv7at2hfb-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb}  armv7ahfb-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb} armv7ahfb-vfpv3d16"
 PACKAGE_EXTRA_ARCHS_tune-armv7athfb-vfpv3d16   = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb} armv7ahfb-vfpv3d16 armv7at2hfb-vfpv3d16"
-PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3d16}  armv7ahfb-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3d16} armv7ahfb-vfpv3"
 PACKAGE_EXTRA_ARCHS_tune-armv7athfb-vfpv3      = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb-vfpv3d16} armv7ahfb-vfpv3 armv7at2hfb-vfpv3"
-PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb}  armv7ahfb-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb} armv7ahfb-neon"
 PACKAGE_EXTRA_ARCHS_tune-armv7athfb-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb} armv7ahfb-neon armv7at2hfb-neon"
-PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-neon}  armv7ahfb-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-neon} armv7ahfb-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-armv7athfb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb-neon} armv7ahfb-neon-vfpv4 armv7at2hfb-neon-vfpv4"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7ve.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7ve.inc
index e13156c..4d9260f 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7ve.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7ve.inc
@@ -1,4 +1,4 @@
-DEFAULTTUNE ?= "armv7ve"
+DEFAULTTUNE ?= "armv7vethf"
 
 TUNEVALID[armv7ve] = "Enable instructions for ARMv7ve"
 TUNECONFLICTS[armv7ve] = "armv4 armv5 armv6 armv7 armv7a"
@@ -21,23 +21,23 @@
 ARMPKGARCH_tune-armv7vet-neon-vfpv4 ?= "armv7ve"
 TUNE_FEATURES_tune-armv7ve             = "arm armv7ve vfp"
 TUNE_FEATURES_tune-armv7vet            = "${TUNE_FEATURES_tune-armv7ve} thumb"
-TUNE_FEATURES_tune-armv7ve-vfpv3d16    = "${TUNE_FEATURES_tune-armv7ve}  vfpv3d16"
+TUNE_FEATURES_tune-armv7ve-vfpv3d16    = "${TUNE_FEATURES_tune-armv7ve} vfpv3d16"
 TUNE_FEATURES_tune-armv7vet-vfpv3d16   = "${TUNE_FEATURES_tune-armv7vet} vfpv3d16"
-TUNE_FEATURES_tune-armv7ve-vfpv3       = "${TUNE_FEATURES_tune-armv7ve-vfpv3d16}  vfpv3"
+TUNE_FEATURES_tune-armv7ve-vfpv3       = "${TUNE_FEATURES_tune-armv7ve-vfpv3d16} vfpv3"
 TUNE_FEATURES_tune-armv7vet-vfpv3      = "${TUNE_FEATURES_tune-armv7vet-vfpv3d16} vfpv3"
-TUNE_FEATURES_tune-armv7ve-neon        = "${TUNE_FEATURES_tune-armv7ve}  neon"
+TUNE_FEATURES_tune-armv7ve-neon        = "${TUNE_FEATURES_tune-armv7ve} neon"
 TUNE_FEATURES_tune-armv7vet-neon       = "${TUNE_FEATURES_tune-armv7vet} neon"
-TUNE_FEATURES_tune-armv7ve-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon}  vfpv4"
+TUNE_FEATURES_tune-armv7ve-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon} vfpv4"
 TUNE_FEATURES_tune-armv7vet-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon} vfpv4"
-PACKAGE_EXTRA_ARCHS_tune-armv7ve             = "${PACKAGE_EXTRA_ARCHS_tune-armv7a}  armv7ve armv7ve-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ve             = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} armv7ve armv7ve-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv7vet            = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7ve armv7ve-vfp armv7vet2-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv7ve-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve}  armv7ve-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ve-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve} armv7ve-vfpv3d16"
 PACKAGE_EXTRA_ARCHS_tune-armv7vet-vfpv3d16   = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet} armv7ve-vfpv3d16 armv7vet2-vfpv3d16"
-PACKAGE_EXTRA_ARCHS_tune-armv7ve-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-vfpv3d16}  armv7ve-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ve-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-vfpv3d16} armv7ve-vfpv3"
 PACKAGE_EXTRA_ARCHS_tune-armv7vet-vfpv3      = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-vfpv3d16} armv7ve-vfpv3 armv7vet2-vfpv3"
-PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve}  armv7ve-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve} armv7ve-neon"
 PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet} armv7ve-neon armv7vet2-neon"
-PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon}  armv7ve-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon} armv7ve-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon} armv7ve-neon-vfpv4 armv7vet2-neon-vfpv4"
 
 # HF Tunes
@@ -52,25 +52,25 @@
 ARMPKGARCH_tune-armv7vethf-neon       ?= "armv7ve"
 ARMPKGARCH_tune-armv7vehf-neon-vfpv4  ?= "armv7ve"
 ARMPKGARCH_tune-armv7vethf-neon-vfpv4 ?= "armv7ve"
-TUNE_FEATURES_tune-armv7vehf             = "${TUNE_FEATURES_tune-armv7ve}             callconvention-hard"
-TUNE_FEATURES_tune-armv7vethf            = "${TUNE_FEATURES_tune-armv7vet}            callconvention-hard"
-TUNE_FEATURES_tune-armv7vehf-vfpv3d16    = "${TUNE_FEATURES_tune-armv7ve-vfpv3d16}    callconvention-hard"
-TUNE_FEATURES_tune-armv7vethf-vfpv3d16   = "${TUNE_FEATURES_tune-armv7vet-vfpv3d16}   callconvention-hard"
-TUNE_FEATURES_tune-armv7vehf-vfpv3       = "${TUNE_FEATURES_tune-armv7ve-vfpv3}       callconvention-hard"
-TUNE_FEATURES_tune-armv7vethf-vfpv3      = "${TUNE_FEATURES_tune-armv7vet-vfpv3}      callconvention-hard"
-TUNE_FEATURES_tune-armv7vehf-neon        = "${TUNE_FEATURES_tune-armv7ve-neon}        callconvention-hard"
-TUNE_FEATURES_tune-armv7vethf-neon       = "${TUNE_FEATURES_tune-armv7vet-neon}       callconvention-hard"
-TUNE_FEATURES_tune-armv7vehf-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4}  callconvention-hard"
+TUNE_FEATURES_tune-armv7vehf             = "${TUNE_FEATURES_tune-armv7ve} callconvention-hard"
+TUNE_FEATURES_tune-armv7vethf            = "${TUNE_FEATURES_tune-armv7vet} callconvention-hard"
+TUNE_FEATURES_tune-armv7vehf-vfpv3d16    = "${TUNE_FEATURES_tune-armv7ve-vfpv3d16} callconvention-hard"
+TUNE_FEATURES_tune-armv7vethf-vfpv3d16   = "${TUNE_FEATURES_tune-armv7vet-vfpv3d16} callconvention-hard"
+TUNE_FEATURES_tune-armv7vehf-vfpv3       = "${TUNE_FEATURES_tune-armv7ve-vfpv3} callconvention-hard"
+TUNE_FEATURES_tune-armv7vethf-vfpv3      = "${TUNE_FEATURES_tune-armv7vet-vfpv3} callconvention-hard"
+TUNE_FEATURES_tune-armv7vehf-neon        = "${TUNE_FEATURES_tune-armv7ve-neon} callconvention-hard"
+TUNE_FEATURES_tune-armv7vethf-neon       = "${TUNE_FEATURES_tune-armv7vet-neon} callconvention-hard"
+TUNE_FEATURES_tune-armv7vehf-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4} callconvention-hard"
 TUNE_FEATURES_tune-armv7vethf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon-vfpv4} callconvention-hard"
-PACKAGE_EXTRA_ARCHS_tune-armv7vehf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf}  armv7vehf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} armv7vehf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv7vethf            = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} armv7vehf-vfp armv7vet2hf-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv7vehf-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf}  armv7vehf-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehf-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf} armv7vehf-vfpv3d16"
 PACKAGE_EXTRA_ARCHS_tune-armv7vethf-vfpv3d16   = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf} armv7vehf-vfpv3d16 armv7vet2hf-vfpv3d16"
-PACKAGE_EXTRA_ARCHS_tune-armv7vehf-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-vfpv3d16}  armv7vehf-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehf-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-vfpv3d16} armv7vehf-vfpv3"
 PACKAGE_EXTRA_ARCHS_tune-armv7vethf-vfpv3      = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-vfpv3d16} armv7vehf-vfpv3 armv7vet2hf-vfpv3"
-PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf}  armv7vehf-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf} armv7vehf-neon"
 PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf} armv7vehf-neon armv7vet2hf-neon"
-PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon}  armv7vehf-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon} armv7vehf-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon} armv7vehf-neon-vfpv4 armv7vet2hf-neon-vfpv4"
 
 # Big Endian
@@ -85,25 +85,25 @@
 ARMPKGARCH_tune-armv7vetb-neon       ?= "armv7ve"
 ARMPKGARCH_tune-armv7veb-neon-vfpv4  ?= "armv7ve"
 ARMPKGARCH_tune-armv7vetb-neon-vfpv4 ?= "armv7ve"
-TUNE_FEATURES_tune-armv7veb             = "${TUNE_FEATURES_tune-armv7ve}             bigendian"
-TUNE_FEATURES_tune-armv7vetb            = "${TUNE_FEATURES_tune-armv7vet}            bigendian"
-TUNE_FEATURES_tune-armv7veb-vfpv3d16    = "${TUNE_FEATURES_tune-armv7ve-vfpv3d16}    bigendian"
-TUNE_FEATURES_tune-armv7vetb-vfpv3d16   = "${TUNE_FEATURES_tune-armv7vet-vfpv3d16}   bigendian"
-TUNE_FEATURES_tune-armv7veb-vfpv3       = "${TUNE_FEATURES_tune-armv7ve-vfpv3}       bigendian"
-TUNE_FEATURES_tune-armv7vetb-vfpv3      = "${TUNE_FEATURES_tune-armv7vet-vfpv3}      bigendian"
-TUNE_FEATURES_tune-armv7veb-neon        = "${TUNE_FEATURES_tune-armv7ve-neon}        bigendian"
-TUNE_FEATURES_tune-armv7vetb-neon       = "${TUNE_FEATURES_tune-armv7vet-neon}       bigendian"
-TUNE_FEATURES_tune-armv7veb-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4}  bigendian"
+TUNE_FEATURES_tune-armv7veb             = "${TUNE_FEATURES_tune-armv7ve} bigendian"
+TUNE_FEATURES_tune-armv7vetb            = "${TUNE_FEATURES_tune-armv7vet} bigendian"
+TUNE_FEATURES_tune-armv7veb-vfpv3d16    = "${TUNE_FEATURES_tune-armv7ve-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7vetb-vfpv3d16   = "${TUNE_FEATURES_tune-armv7vet-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7veb-vfpv3       = "${TUNE_FEATURES_tune-armv7ve-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7vetb-vfpv3      = "${TUNE_FEATURES_tune-armv7vet-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7veb-neon        = "${TUNE_FEATURES_tune-armv7ve-neon} bigendian"
+TUNE_FEATURES_tune-armv7vetb-neon       = "${TUNE_FEATURES_tune-armv7vet-neon} bigendian"
+TUNE_FEATURES_tune-armv7veb-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4} bigendian"
 TUNE_FEATURES_tune-armv7vetb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon-vfpv4} bigendian"
-PACKAGE_EXTRA_ARCHS_tune-armv7veb             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab}  armv7veb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7veb             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab} armv7veb-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv7vetb            = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb} armv7veb-vfp armv7vet2b-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv7veb-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb}  armv7veb-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7veb-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb} armv7veb-vfpv3d16"
 PACKAGE_EXTRA_ARCHS_tune-armv7vetb-vfpv3d16   = "${PACKAGE_EXTRA_ARCHS_tune-armv7vetb} armv7veb-vfpv3d16 armv7vet2b-vfpv3d16"
-PACKAGE_EXTRA_ARCHS_tune-armv7veb-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb-vfpv3d16}  armv7veb-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7veb-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb-vfpv3d16} armv7veb-vfpv3"
 PACKAGE_EXTRA_ARCHS_tune-armv7vetb-vfpv3      = "${PACKAGE_EXTRA_ARCHS_tune-armv7vetb-vfpv3d16} armv7veb-vfpv3 armv7vet2b-vfpv3"
-PACKAGE_EXTRA_ARCHS_tune-armv7veb-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb}  armv7veb-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7veb-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb} armv7veb-neon"
 PACKAGE_EXTRA_ARCHS_tune-armv7vetb-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vetb} armv7veb-neon armv7vet2b-neon"
-PACKAGE_EXTRA_ARCHS_tune-armv7veb-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb-neon}  armv7veb-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7veb-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb-neon} armv7veb-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-armv7vetb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vetb-neon} armv7veb-neon-vfpv4 armv7vet2b-neon-vfpv4"
 
 # Big Endian + HF
@@ -118,23 +118,23 @@
 ARMPKGARCH_tune-armv7vethfb-neon       ?= "armv7ve"
 ARMPKGARCH_tune-armv7vehfb-neon-vfpv4  ?= "armv7ve"
 ARMPKGARCH_tune-armv7vethfb-neon-vfpv4 ?= "armv7ve"
-TUNE_FEATURES_tune-armv7vehfb             = "${TUNE_FEATURES_tune-armv7vehf}             bigendian"
-TUNE_FEATURES_tune-armv7vethfb            = "${TUNE_FEATURES_tune-armv7vethf}            bigendian"
-TUNE_FEATURES_tune-armv7vehfb-vfpv3d16    = "${TUNE_FEATURES_tune-armv7vehf-vfpv3d16}    bigendian"
-TUNE_FEATURES_tune-armv7vethfb-vfpv3d16   = "${TUNE_FEATURES_tune-armv7vethf-vfpv3d16}   bigendian"
-TUNE_FEATURES_tune-armv7vehfb-vfpv3       = "${TUNE_FEATURES_tune-armv7vehf-vfpv3}       bigendian"
-TUNE_FEATURES_tune-armv7vethfb-vfpv3      = "${TUNE_FEATURES_tune-armv7vethf-vfpv3}      bigendian"
-TUNE_FEATURES_tune-armv7vehfb-neon        = "${TUNE_FEATURES_tune-armv7vehf-neon}        bigendian"
-TUNE_FEATURES_tune-armv7vethfb-neon       = "${TUNE_FEATURES_tune-armv7vethf-neon}       bigendian"
-TUNE_FEATURES_tune-armv7vehfb-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4}  bigendian"
+TUNE_FEATURES_tune-armv7vehfb             = "${TUNE_FEATURES_tune-armv7vehf} bigendian"
+TUNE_FEATURES_tune-armv7vethfb            = "${TUNE_FEATURES_tune-armv7vethf} bigendian"
+TUNE_FEATURES_tune-armv7vehfb-vfpv3d16    = "${TUNE_FEATURES_tune-armv7vehf-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7vethfb-vfpv3d16   = "${TUNE_FEATURES_tune-armv7vethf-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7vehfb-vfpv3       = "${TUNE_FEATURES_tune-armv7vehf-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7vethfb-vfpv3      = "${TUNE_FEATURES_tune-armv7vethf-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7vehfb-neon        = "${TUNE_FEATURES_tune-armv7vehf-neon} bigendian"
+TUNE_FEATURES_tune-armv7vethfb-neon       = "${TUNE_FEATURES_tune-armv7vethf-neon} bigendian"
+TUNE_FEATURES_tune-armv7vehfb-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4} bigendian"
 TUNE_FEATURES_tune-armv7vethfb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vethf-neon-vfpv4} bigendian"
-PACKAGE_EXTRA_ARCHS_tune-armv7vehfb             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb}  armv7vehfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehfb             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb} armv7vehfb-vfp"
 PACKAGE_EXTRA_ARCHS_tune-armv7vethfb            = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb} armv7vehfb-vfp armv7vet2hfb-vfp"
-PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb}  armv7vehfb-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-vfpv3d16    = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb} armv7vehfb-vfpv3d16"
 PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-vfpv3d16   = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethfb} armv7vehfb-vfpv3d16 armv7vet2hfb-vfpv3d16"
-PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-vfpv3d16}  armv7vehfb-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-vfpv3       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-vfpv3d16} armv7vehfb-vfpv3"
 PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-vfpv3      = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-vfpv3d16} armv7vehfb-vfpv3 armv7vet2hfb-vfpv3"
-PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb}  armv7vehfb-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb} armv7vehfb-neon"
 PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethfb} armv7vehfb-neon armv7vet2hfb-neon"
-PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-neon}  armv7vehfb-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-neon} armv7vehfb-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-neon} armv7vehfb-neon-vfpv4 armv7vet2hfb-neon-vfpv4"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-thumb.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-thumb.inc
index 1faebf7..0b47cca 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-thumb.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-thumb.inc
@@ -1,33 +1,30 @@
-TUNEVALID[thumb] = "Use thumb instructions instead of ARM"
-ARM_THUMB_OPT = "${@['arm', 'thumb'][d.getVar('ARM_INSTRUCTION_SET', True) == 'thumb']}"
-ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv4',  't',  '', d)}"
-ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv5',  't',  '', d)}"
-ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv6',  't',  '', d)}"
-ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7a', 't2', '', d)}"
-ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7r', 't2', '', d)}"
-ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7m', 't2', '', d)}"
-ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7ve', 't2', '', d)}"
+
+TUNEVALID[thumb] = "Support Thumb instructions"
+
+ARM_THUMB_SUFFIX = "${@bb.utils.contains_any('TUNE_FEATURES', 'armv4 armv5 armv6', 't', 't2', d)}"
 
 # If the device supports ARM, then respect ARM_THUMB_OPT (which can be "arm" or "thumb")
-# If the defice doesn't support ARM, then always set "thumb" even when
+# If the device doesn't support ARM, then always set "thumb" even when
 # some recipe explicitly sets ARM_INSTRUCTION_SET to "arm"
+ARM_THUMB_OPT = "${@['arm', 'thumb'][d.getVar('ARM_INSTRUCTION_SET') == 'thumb']}"
 ARM_M_OPT = "${@bb.utils.contains('TUNE_FEATURES', 'arm', '${ARM_THUMB_OPT}', 'thumb', d)}"
+
 python () {
     if bb.utils.contains('TUNE_FEATURES', 'thumb', False, True, d):
         return
-    selected = d.getVar('ARM_INSTRUCTION_SET', True)
+    selected = d.getVar('ARM_INSTRUCTION_SET')
     if selected == None:
         return
-    used = d.getVar('ARM_M_OPT', True)
+    used = d.getVar('ARM_M_OPT')
     if selected != used:
-        pn = d.getVar('PN', True)
+        pn = d.getVar('PN')
         bb.warn("Recipe '%s' selects ARM_INSTRUCTION_SET to be '%s', but tune configuration overrides it to '%s'" % (pn, selected, used))
 }
 
 TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' -m${ARM_M_OPT}', '', d)}"
 
 # Add suffix from ARM_THUMB_SUFFIX only if after all this we still set ARM_M_OPT to thumb
-ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', '${ARM_THUMB_SUFFIX}', '', d) if d.getVar('ARM_M_OPT', True) == 'thumb' else ''}"
+ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', '${ARM_THUMB_SUFFIX}', '', d) if d.getVar('ARM_M_OPT') == 'thumb' else ''}"
 
 # what about armv7m devices which don't support -marm (e.g. Cortex-M3)?
 TARGET_CC_KERNEL_ARCH += "${@bb.utils.contains('TUNE_FEATURES', 'thumb', '-mno-thumb-interwork -marm', '', d)}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-vfp.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-vfp.inc
index 9ef31e7..667b609 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-vfp.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-vfp.inc
@@ -5,10 +5,10 @@
 TUNEVALID[vfp] = "Enable Vector Floating Point (vfp) unit."
 TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', 'vfp', ' vfp', '', d)}"
 
-TUNE_CCARGS  .= "${@ (' -mfpu=%s ' % d.getVar('TUNE_CCARGS_MFPU', True).split()[-1]) if (d.getVar('TUNE_CCARGS_MFPU', True) != '') else ''}"
-ARMPKGSFX_FPU = "${@ ('-%s'        % d.getVar('TUNE_CCARGS_MFPU', True).split()[-1].replace('vfpv3-d16', 'vfpv3d16')) if (d.getVar('TUNE_CCARGS_MFPU', True) != '') else ''}"
+TUNE_CCARGS  .= "${@ (' -mfpu=%s ' % d.getVar('TUNE_CCARGS_MFPU').split()[-1]) if (d.getVar('TUNE_CCARGS_MFPU') != '') else ''}"
+ARMPKGSFX_FPU = "${@ ('-%s'        % d.getVar('TUNE_CCARGS_MFPU').split()[-1].replace('vfpv3-d16', 'vfpv3d16')) if (d.getVar('TUNE_CCARGS_MFPU') != '') else ''}"
 
 TUNEVALID[callconvention-hard] = "Enable EABI hard float call convention, requires VFP."
-TUNE_CCARGS_MFLOAT = "${@ bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'hard', 'softfp', d) if (d.getVar('TUNE_CCARGS_MFPU', True) != '') else '' }"
-TUNE_CCARGS   .= "${@ ' -mfloat-abi=${TUNE_CCARGS_MFLOAT}' if (d.getVar('TUNE_CCARGS_MFLOAT', True) != '')     else ''}"
-ARMPKGSFX_EABI = "${@ 'hf'                                 if (d.getVar('TUNE_CCARGS_MFLOAT', True) == 'hard') else ''}"
+TUNE_CCARGS_MFLOAT = "${@ bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'hard', 'softfp', d) if (d.getVar('TUNE_CCARGS_MFPU') != '') else '' }"
+TUNE_CCARGS   .= "${@ ' -mfloat-abi=${TUNE_CCARGS_MFLOAT}' if (d.getVar('TUNE_CCARGS_MFLOAT') != '')     else ''}"
+ARMPKGSFX_EABI = "${@ 'hf'                                 if (d.getVar('TUNE_CCARGS_MFLOAT') == 'hard') else ''}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/mips/README b/import-layers/yocto-poky/meta/conf/machine/include/mips/README
index 62fa156..f36e87b 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/mips/README
+++ b/import-layers/yocto-poky/meta/conf/machine/include/mips/README
@@ -32,6 +32,9 @@
 MIPSPKGSFX_ENDIAN - For bigendian hardware this is blank, otherwise it's
 defined as "el".
 
+MIPSPKGSFX_ENDIAN2 - For bigendian hardware this is "eb", otherwise it's
+defined as "el".
+
 MIPSPKGSFX_VARIANT_tune-<tune> - In the default tunings it is set to the
 same value as TUNE_ARCH.  In custom, optimized tunings, the value should
 be modified to more precisely describe the tuning.
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/mips/arch-mips.inc b/import-layers/yocto-poky/meta/conf/machine/include/mips/arch-mips.inc
index 6069ca1..2f62511 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/mips/arch-mips.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/mips/arch-mips.inc
@@ -17,7 +17,7 @@
 
 TUNEVALID[n32] = "MIPS64 n32 ABI"
 TUNECONFLICTS[n32] = "o32 n64"
-ABIEXTENSION .= "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'n32', '' ,d)}"
+ABIEXTENSION .= "${@bb.utils.filter('TUNE_FEATURES', 'n32' ,d)}"
 TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n32', ' -mabi=n32', '', d)}"
 
 # user mode qemu doesn't support mips64 n32: "Invalid ELF image for this architecture"
@@ -39,17 +39,29 @@
 
 # Package naming
 MIPSPKGSFX_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el', d)}"
+MIPSPKGSFX_ENDIAN2 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'eb', 'el', d)}"
 MIPSPKGSFX_BYTE = "${@bb.utils.contains('TUNE_FEATURES', 'n64' , '64', '', d)}"
 MIPSPKGSFX_BYTE .= "${@bb.utils.contains('TUNE_FEATURES', 'n32' , '64', '', d)}"
 MIPSPKGSFX_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard' , '', '-nf', d)}"
 MIPSPKGSFX_ABI = "${@bb.utils.contains('TUNE_FEATURES', 'n32', '-n32', '', d)}"
-MIPSPKGSFX_R6 = "${@bb.utils.contains('TUNE_FEATURES', 'r6', 'r6', '', d)}"
+MIPSPKGSFX_R6 = "${@bb.utils.filter('TUNE_FEATURES', 'r6', d)}"
 MIPSPKGSFX_64R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', 'isa', '', d)}"
 MIPSPKGSFX_32R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa32r6', 'isa32', '', d)}"
 
 TUNE_ARCH = "mips${MIPSPKGSFX_32R6}${MIPSPKGSFX_64R6}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}"
 TUNE_PKGARCH = "${MIPSPKGSFX_VARIANT_tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPSPKGSFX_ABI}"
 
+# Various Global Machine Overrides
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64${MIPSPKGSFX_ENDIAN2}:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32${MIPSPKGSFX_ENDIAN2}:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32${MIPSPKGSFX_ENDIAN2}:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'r6', 'mipsarchr6:', '' ,d)}"
+MACHINEOVERRIDES =. "mipsarch${MIPSPKGSFX_ENDIAN2}:"
+MACHINEOVERRIDES =. "mipsarch:"
+
 # Base tunes
 AVAILTUNES += "mips mips64-n32 mips64 mipsel mips64el-n32 mips64el mips-nf mips64-nf-n32 mips64-nf mipsel-nf mips64el-nf-n32 mips64el-nf"
 TUNE_FEATURES_tune-mips = "o32 bigendian fpu-hard"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/mips/feature-mips-mips16e.inc b/import-layers/yocto-poky/meta/conf/machine/include/mips/feature-mips-mips16e.inc
index 05011de..101d533 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/mips/feature-mips-mips16e.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/mips/feature-mips-mips16e.inc
@@ -1,8 +1,8 @@
 TUNEVALID[mips16e] = "Build target packages with MIPS16e ASE instructions"
-MIPS_MIPS16E_OPT = "${@['mno-mips16', 'mips16'][d.getVar('MIPS_INSTRUCTION_SET', True) == 'mips16e']}"
+MIPS_MIPS16E_OPT = "${@['mno-mips16', 'mips16'][d.getVar('MIPS_INSTRUCTION_SET') == 'mips16e']}"
 TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'mips16e', ' -${MIPS_MIPS16E_OPT}', '', d)}"
 
-MIPSPKGSFX_MIPS16E .= "${@bb.utils.contains('TUNE_FEATURES', 'mips16e', '-m16', '', d) if d.getVar('MIPS_MIPS16E_OPT', True) == 'mips16' else ''}"
+MIPSPKGSFX_MIPS16E .= "${@bb.utils.contains('TUNE_FEATURES', 'mips16e', '-m16', '', d) if d.getVar('MIPS_MIPS16E_OPT') == 'mips16' else ''}"
 
 # Whether to compile with code to allow interworking between the two
 # instruction sets. This allows mips16e code to be executed on a primarily
@@ -14,4 +14,4 @@
 OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'mips16e', ':mips16e', '', d)}"
 
 # show status (if compiling in MIPS16e mode)
-BUILDCFG_VARS += "${@['', 'MIPS_INSTRUCTION_SET'][d.getVar('MIPS_INSTRUCTION_SET', True) == 'mips16e']}"
+BUILDCFG_VARS += "${@['', 'MIPS_INSTRUCTION_SET'][d.getVar('MIPS_INSTRUCTION_SET') == 'mips16e']}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/qemu.inc b/import-layers/yocto-poky/meta/conf/machine/include/qemu.inc
index 2bc4dc2..0e4103b 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/qemu.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/qemu.inc
@@ -6,10 +6,8 @@
 
 XSERVER ?= "xserver-xorg \
             ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \
-            xf86-input-evdev \
-            xf86-input-mouse \
             xf86-video-fbdev \
-            xf86-input-keyboard"
+            "
 
 MACHINE_FEATURES = "alsa bluetooth usbgadget screen"
 
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/qemuboot-x86.inc b/import-layers/yocto-poky/meta/conf/machine/include/qemuboot-x86.inc
index 06ac983..acf9d55 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/qemuboot-x86.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/qemuboot-x86.inc
@@ -1,15 +1,20 @@
 # For runqemu
 IMAGE_CLASSES += "qemuboot"
 QB_SYSTEM_NAME_x86 = "qemu-system-i386"
-QB_CPU_x86 = "-cpu qemu32"
-QB_CPU_KVM_x86 = "-cpu kvm32"
+QB_CPU_x86 = "-cpu pentium2"
+QB_CPU_KVM_x86 = "-cpu pentium2"
 
 QB_SYSTEM_NAME_x86-64 = "qemu-system-x86_64"
 QB_CPU_x86-64 = "-cpu core2duo"
-QB_CPU_KVM_x86-64 = "-cpu kvm64"
+QB_CPU_KVM_x86-64 = "-cpu core2duo"
 
 QB_AUDIO_DRV = "alsa"
 QB_AUDIO_OPT = "-soundhw ac97,es1370"
-QB_KERNEL_CMDLINE_APPEND = "vga=0 uvesafb.mode_option=640x480-32 oprofile.timer=1 uvesafb.task_timeout=-1"
+QB_KERNEL_CMDLINE_APPEND = "vga=0 uvesafb.mode_option=${UVESA_MODE} oprofile.timer=1 uvesafb.task_timeout=-1"
 # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
 QB_OPT_APPEND = "-vga vmware -show-cursor -usb -usbdevice tablet -device virtio-rng-pci"
+
+KERNEL_MODULE_AUTOLOAD += "uvesafb"
+KERNEL_MODULE_PROBECONF += "uvesafb"
+UVESA_MODE ?= "640x480-32"
+module_conf_uvesafb = "options uvesafb mode_option=${UVESA_MODE}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-arm1136jf-s.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-arm1136jf-s.inc
index 53994ef..c5de63e 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-arm1136jf-s.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-arm1136jf-s.inc
@@ -1,4 +1,4 @@
-DEFAULTTUNE ?= "armv6"
+DEFAULTTUNE ?= "armv6hf"
 
 require conf/machine/include/arm/arch-armv6.inc
 
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa15.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa15.inc
index a33b27f..25e99f9 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa15.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa15.inc
@@ -1,4 +1,4 @@
-DEFAULTTUNE ?= "armv7ve-neon"
+DEFAULTTUNE ?= "armv7vethf-neon"
 
 require conf/machine/include/arm/arch-armv7ve.inc
 
@@ -13,17 +13,17 @@
 ARMPKGARCH_tune-cortexa15t-neon       = "cortexa15"
 ARMPKGARCH_tune-cortexa15-neon-vfpv4  = "cortexa15"
 ARMPKGARCH_tune-cortexa15t-neon-vfpv4 = "cortexa15"
-TUNE_FEATURES_tune-cortexa15             = "${TUNE_FEATURES_tune-armv7ve}             cortexa15"
-TUNE_FEATURES_tune-cortexa15t            = "${TUNE_FEATURES_tune-armv7vet}            cortexa15"
-TUNE_FEATURES_tune-cortexa15-neon        = "${TUNE_FEATURES_tune-armv7ve-neon}        cortexa15"
-TUNE_FEATURES_tune-cortexa15t-neon       = "${TUNE_FEATURES_tune-armv7vet-neon}       cortexa15"
-TUNE_FEATURES_tune-cortexa15-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4}  cortexa15"
+TUNE_FEATURES_tune-cortexa15             = "${TUNE_FEATURES_tune-armv7ve} cortexa15"
+TUNE_FEATURES_tune-cortexa15t            = "${TUNE_FEATURES_tune-armv7vet} cortexa15"
+TUNE_FEATURES_tune-cortexa15-neon        = "${TUNE_FEATURES_tune-armv7ve-neon} cortexa15"
+TUNE_FEATURES_tune-cortexa15t-neon       = "${TUNE_FEATURES_tune-armv7vet-neon} cortexa15"
+TUNE_FEATURES_tune-cortexa15-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4} cortexa15"
 TUNE_FEATURES_tune-cortexa15t-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon-vfpv4} cortexa15"
-PACKAGE_EXTRA_ARCHS_tune-cortexa15             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve}  cortexa15-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve} cortexa15-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa15t            = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet} cortexa15-vfp cortexa15t2-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa15-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon}  cortexa15-vfp cortexa15-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon} cortexa15-vfp cortexa15-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa15t-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon} cortexa15-vfp cortexa15-neon cortexa15t2-vfp cortexa15t2-neon"
-PACKAGE_EXTRA_ARCHS_tune-cortexa15-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4}  cortexa15-vfp cortexa15-neon cortexa15-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4} cortexa15-vfp cortexa15-neon cortexa15-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-cortexa15t-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon-vfpv4} cortexa15-vfp cortexa15-neon cortexa15-neon-vfpv4 cortexa15t2-vfp cortexa15t2-neon cortexa15t2-neon-vfpv4"
 
 # HF Tunes
@@ -34,15 +34,15 @@
 ARMPKGARCH_tune-cortexa15thf-neon       = "cortexa15"
 ARMPKGARCH_tune-cortexa15hf-neon-vfpv4  = "cortexa15"
 ARMPKGARCH_tune-cortexa15thf-neon-vfpv4 = "cortexa15"
-TUNE_FEATURES_tune-cortexa15hf             = "${TUNE_FEATURES_tune-armv7vehf}             cortexa15"
-TUNE_FEATURES_tune-cortexa15thf            = "${TUNE_FEATURES_tune-armv7vethf}            cortexa15"
-TUNE_FEATURES_tune-cortexa15hf-neon        = "${TUNE_FEATURES_tune-armv7vehf-neon}        cortexa15"
-TUNE_FEATURES_tune-cortexa15thf-neon       = "${TUNE_FEATURES_tune-armv7vethf-neon}       cortexa15"
-TUNE_FEATURES_tune-cortexa15hf-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4}  cortexa15"
+TUNE_FEATURES_tune-cortexa15hf             = "${TUNE_FEATURES_tune-armv7vehf} cortexa15"
+TUNE_FEATURES_tune-cortexa15thf            = "${TUNE_FEATURES_tune-armv7vethf} cortexa15"
+TUNE_FEATURES_tune-cortexa15hf-neon        = "${TUNE_FEATURES_tune-armv7vehf-neon} cortexa15"
+TUNE_FEATURES_tune-cortexa15thf-neon       = "${TUNE_FEATURES_tune-armv7vethf-neon} cortexa15"
+TUNE_FEATURES_tune-cortexa15hf-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4} cortexa15"
 TUNE_FEATURES_tune-cortexa15thf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vethf-neon-vfpv4} cortexa15"
-PACKAGE_EXTRA_ARCHS_tune-cortexa15hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf}  cortexa15hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf} cortexa15hf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa15thf            = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf} cortexa15hf-vfp cortexa15t2hf-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa15hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon}  cortexa15hf-vfp cortexa15hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon} cortexa15hf-vfp cortexa15hf-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa15thf-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon} cortexa15hf-vfp cortexa15hf-neon cortexa15t2hf-vfp cortexa15t2hf-neon"
-PACKAGE_EXTRA_ARCHS_tune-cortexa15hf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4}  cortexa15hf-vfp cortexa15hf-neon cortexa15hf-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15hf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4} cortexa15hf-vfp cortexa15hf-neon cortexa15hf-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-cortexa15thf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon-vfpv4} cortexa15hf-vfp cortexa15hf-neon cortexa15hf-neon-vfpv4 cortexa15t2hf-vfp cortexa15t2hf-neon cortexa15t2hf-neon-vfpv4"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa17.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa17.inc
index d08b002..40392f9 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa17.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa17.inc
@@ -1,4 +1,4 @@
-DEFAULTTUNE ?= "armv7ve-neon"
+DEFAULTTUNE ?= "armv7vethf-neon"
 
 require conf/machine/include/arm/arch-armv7ve.inc
 
@@ -13,17 +13,17 @@
 ARMPKGARCH_tune-cortexa17t-neon       = "cortexa17"
 ARMPKGARCH_tune-cortexa17-neon-vfpv4  = "cortexa17"
 ARMPKGARCH_tune-cortexa17t-neon-vfpv4 = "cortexa17"
-TUNE_FEATURES_tune-cortexa17             = "${TUNE_FEATURES_tune-armv7ve}             cortexa17"
-TUNE_FEATURES_tune-cortexa17t            = "${TUNE_FEATURES_tune-armv7vet}            cortexa17"
-TUNE_FEATURES_tune-cortexa17-neon        = "${TUNE_FEATURES_tune-armv7ve-neon}        cortexa17"
-TUNE_FEATURES_tune-cortexa17t-neon       = "${TUNE_FEATURES_tune-armv7vet-neon}       cortexa17"
-TUNE_FEATURES_tune-cortexa17-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4}  cortexa17"
+TUNE_FEATURES_tune-cortexa17             = "${TUNE_FEATURES_tune-armv7ve} cortexa17"
+TUNE_FEATURES_tune-cortexa17t            = "${TUNE_FEATURES_tune-armv7vet} cortexa17"
+TUNE_FEATURES_tune-cortexa17-neon        = "${TUNE_FEATURES_tune-armv7ve-neon} cortexa17"
+TUNE_FEATURES_tune-cortexa17t-neon       = "${TUNE_FEATURES_tune-armv7vet-neon} cortexa17"
+TUNE_FEATURES_tune-cortexa17-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4} cortexa17"
 TUNE_FEATURES_tune-cortexa17t-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon-vfpv4} cortexa17"
-PACKAGE_EXTRA_ARCHS_tune-cortexa17             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve}  cortexa17-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve} cortexa17-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa17t            = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet} cortexa17-vfp cortexa17t2-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa17-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon}  cortexa17-vfp cortexa17-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon} cortexa17-vfp cortexa17-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa17t-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon} cortexa17-vfp cortexa17-neon cortexa17t2-vfp cortexa17t2-neon"
-PACKAGE_EXTRA_ARCHS_tune-cortexa17-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4}  cortexa17-vfp cortexa17-neon cortexa17-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4} cortexa17-vfp cortexa17-neon cortexa17-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-cortexa17t-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon-vfpv4} cortexa17-vfp cortexa17-neon cortexa17-neon-vfpv4 cortexa17t2-vfp cortexa17t2-neon cortexa17t2-neon-vfpv4"
 
 # HF Tunes
@@ -34,15 +34,15 @@
 ARMPKGARCH_tune-cortexa17thf-neon       = "cortexa17"
 ARMPKGARCH_tune-cortexa17hf-neon-vfpv4  = "cortexa17"
 ARMPKGARCH_tune-cortexa17thf-neon-vfpv4 = "cortexa17"
-TUNE_FEATURES_tune-cortexa17hf             = "${TUNE_FEATURES_tune-armv7vehf}             cortexa17"
-TUNE_FEATURES_tune-cortexa17thf            = "${TUNE_FEATURES_tune-armv7vethf}            cortexa17"
-TUNE_FEATURES_tune-cortexa17hf-neon        = "${TUNE_FEATURES_tune-armv7vehf-neon}        cortexa17"
-TUNE_FEATURES_tune-cortexa17thf-neon       = "${TUNE_FEATURES_tune-armv7vethf-neon}       cortexa17"
-TUNE_FEATURES_tune-cortexa17hf-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4}  cortexa17"
+TUNE_FEATURES_tune-cortexa17hf             = "${TUNE_FEATURES_tune-armv7vehf} cortexa17"
+TUNE_FEATURES_tune-cortexa17thf            = "${TUNE_FEATURES_tune-armv7vethf} cortexa17"
+TUNE_FEATURES_tune-cortexa17hf-neon        = "${TUNE_FEATURES_tune-armv7vehf-neon} cortexa17"
+TUNE_FEATURES_tune-cortexa17thf-neon       = "${TUNE_FEATURES_tune-armv7vethf-neon} cortexa17"
+TUNE_FEATURES_tune-cortexa17hf-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4} cortexa17"
 TUNE_FEATURES_tune-cortexa17thf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vethf-neon-vfpv4} cortexa17"
-PACKAGE_EXTRA_ARCHS_tune-cortexa17hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf}  cortexa17hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf} cortexa17hf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa17thf            = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf} cortexa17hf-vfp cortexa17t2hf-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa17hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon}  cortexa17hf-vfp cortexa17hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon} cortexa17hf-vfp cortexa17hf-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa17thf-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon} cortexa17hf-vfp cortexa17hf-neon cortexa17t2hf-vfp cortexa17t2hf-neon"
-PACKAGE_EXTRA_ARCHS_tune-cortexa17hf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4}  cortexa17hf-vfp cortexa17hf-neon cortexa17hf-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17hf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4} cortexa17hf-vfp cortexa17hf-neon cortexa17hf-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-cortexa17thf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon-vfpv4} cortexa17hf-vfp cortexa17hf-neon cortexa17hf-neon-vfpv4 cortexa17t2hf-vfp cortexa17t2hf-neon cortexa17t2hf-neon-vfpv4"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa5.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa5.inc
index c7e5ab9..1f0cda6 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa5.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa5.inc
@@ -1,4 +1,4 @@
-DEFAULTTUNE ?= "armv7a-neon"
+DEFAULTTUNE ?= "armv7athf-neon"
 
 require conf/machine/include/arm/arch-armv7a.inc
 
@@ -11,13 +11,13 @@
 ARMPKGARCH_tune-cortexa5t            = "cortexa5"
 ARMPKGARCH_tune-cortexa5-neon        = "cortexa5"
 ARMPKGARCH_tune-cortexa5t-neon       = "cortexa5"
-TUNE_FEATURES_tune-cortexa5             = "${TUNE_FEATURES_tune-armv7a}             cortexa5"
-TUNE_FEATURES_tune-cortexa5t            = "${TUNE_FEATURES_tune-armv7at}            cortexa5"
-TUNE_FEATURES_tune-cortexa5-neon        = "${TUNE_FEATURES_tune-armv7a-neon}        cortexa5"
-TUNE_FEATURES_tune-cortexa5t-neon       = "${TUNE_FEATURES_tune-armv7at-neon}       cortexa5"
-PACKAGE_EXTRA_ARCHS_tune-cortexa5             = "${PACKAGE_EXTRA_ARCHS_tune-armv7a}  cortexa5-vfp"
+TUNE_FEATURES_tune-cortexa5             = "${TUNE_FEATURES_tune-armv7a} cortexa5"
+TUNE_FEATURES_tune-cortexa5t            = "${TUNE_FEATURES_tune-armv7at} cortexa5"
+TUNE_FEATURES_tune-cortexa5-neon        = "${TUNE_FEATURES_tune-armv7a-neon} cortexa5"
+TUNE_FEATURES_tune-cortexa5t-neon       = "${TUNE_FEATURES_tune-armv7at-neon} cortexa5"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5             = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa5-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa5t            = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa5-vfp cortexa5t2-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa5-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon}  cortexa5-vfp cortexa5-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa5-vfp cortexa5-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa5t-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa5-vfp cortexa5-neon cortexa5t2-vfp cortexa5t2-neon"
 
 # HF Tunes
@@ -26,11 +26,11 @@
 ARMPKGARCH_tune-cortexa5thf            = "cortexa5"
 ARMPKGARCH_tune-cortexa5hf-neon        = "cortexa5"
 ARMPKGARCH_tune-cortexa5thf-neon       = "cortexa5"
-TUNE_FEATURES_tune-cortexa5hf             = "${TUNE_FEATURES_tune-armv7ahf}             cortexa5"
-TUNE_FEATURES_tune-cortexa5thf            = "${TUNE_FEATURES_tune-armv7athf}            cortexa5"
-TUNE_FEATURES_tune-cortexa5hf-neon        = "${TUNE_FEATURES_tune-armv7ahf-neon}        cortexa5"
-TUNE_FEATURES_tune-cortexa5thf-neon       = "${TUNE_FEATURES_tune-armv7athf-neon}       cortexa5"
-PACKAGE_EXTRA_ARCHS_tune-cortexa5hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf}  cortexa5hf-vfp"
+TUNE_FEATURES_tune-cortexa5hf             = "${TUNE_FEATURES_tune-armv7ahf} cortexa5"
+TUNE_FEATURES_tune-cortexa5thf            = "${TUNE_FEATURES_tune-armv7athf} cortexa5"
+TUNE_FEATURES_tune-cortexa5hf-neon        = "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa5"
+TUNE_FEATURES_tune-cortexa5thf-neon       = "${TUNE_FEATURES_tune-armv7athf-neon} cortexa5"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa5hf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa5thf            = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa5hf-vfp cortexa5t2hf-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa5hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon}  cortexa5hf-vfp cortexa5hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa5hf-vfp cortexa5hf-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa5thf-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa5hf-vfp cortexa5hf-neon cortexa5t2hf-vfp cortexa5t2hf-neon"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa7.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa7.inc
index 10b6ea7..52415d9 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa7.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa7.inc
@@ -1,4 +1,4 @@
-DEFAULTTUNE ?= "armv7ve-neon"
+DEFAULTTUNE ?= "armv7vethf-neon"
 
 require conf/machine/include/arm/arch-armv7ve.inc
 
@@ -13,17 +13,17 @@
 ARMPKGARCH_tune-cortexa7t-neon       = "cortexa7"
 ARMPKGARCH_tune-cortexa7-neon-vfpv4  = "cortexa7"
 ARMPKGARCH_tune-cortexa7t-neon-vfpv4 = "cortexa7"
-TUNE_FEATURES_tune-cortexa7             = "${TUNE_FEATURES_tune-armv7ve}             cortexa7"
-TUNE_FEATURES_tune-cortexa7t            = "${TUNE_FEATURES_tune-armv7vet}            cortexa7"
-TUNE_FEATURES_tune-cortexa7-neon        = "${TUNE_FEATURES_tune-armv7ve-neon}        cortexa7"
-TUNE_FEATURES_tune-cortexa7t-neon       = "${TUNE_FEATURES_tune-armv7vet-neon}       cortexa7"
-TUNE_FEATURES_tune-cortexa7-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4}  cortexa7"
+TUNE_FEATURES_tune-cortexa7             = "${TUNE_FEATURES_tune-armv7ve} cortexa7"
+TUNE_FEATURES_tune-cortexa7t            = "${TUNE_FEATURES_tune-armv7vet} cortexa7"
+TUNE_FEATURES_tune-cortexa7-neon        = "${TUNE_FEATURES_tune-armv7ve-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7t-neon       = "${TUNE_FEATURES_tune-armv7vet-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4} cortexa7"
 TUNE_FEATURES_tune-cortexa7t-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon-vfpv4} cortexa7"
-PACKAGE_EXTRA_ARCHS_tune-cortexa7             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve}  cortexa7-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve} cortexa7-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa7t            = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet} cortexa7-vfp cortexa7t2-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa7-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon}  cortexa7-vfp cortexa7-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon} cortexa7-vfp cortexa7-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa7t-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon} cortexa7-vfp cortexa7-neon cortexa7t2-vfp cortexa7t2-neon"
-PACKAGE_EXTRA_ARCHS_tune-cortexa7-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4}  cortexa7-vfp cortexa7-neon cortexa7-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4} cortexa7-vfp cortexa7-neon cortexa7-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-cortexa7t-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon-vfpv4} cortexa7-vfp cortexa7-neon cortexa7-neon-vfpv4 cortexa7t2-vfp cortexa7t2-neon cortexa7t2-neon-vfpv4"
 
 # HF Tunes
@@ -34,15 +34,15 @@
 ARMPKGARCH_tune-cortexa7thf-neon       = "cortexa7"
 ARMPKGARCH_tune-cortexa7hf-neon-vfpv4  = "cortexa7"
 ARMPKGARCH_tune-cortexa7thf-neon-vfpv4 = "cortexa7"
-TUNE_FEATURES_tune-cortexa7hf             = "${TUNE_FEATURES_tune-armv7vehf}             cortexa7"
-TUNE_FEATURES_tune-cortexa7thf            = "${TUNE_FEATURES_tune-armv7vethf}            cortexa7"
-TUNE_FEATURES_tune-cortexa7hf-neon        = "${TUNE_FEATURES_tune-armv7vehf-neon}        cortexa7"
-TUNE_FEATURES_tune-cortexa7thf-neon       = "${TUNE_FEATURES_tune-armv7vethf-neon}       cortexa7"
-TUNE_FEATURES_tune-cortexa7hf-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4}  cortexa7"
+TUNE_FEATURES_tune-cortexa7hf             = "${TUNE_FEATURES_tune-armv7vehf} cortexa7"
+TUNE_FEATURES_tune-cortexa7thf            = "${TUNE_FEATURES_tune-armv7vethf} cortexa7"
+TUNE_FEATURES_tune-cortexa7hf-neon        = "${TUNE_FEATURES_tune-armv7vehf-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7thf-neon       = "${TUNE_FEATURES_tune-armv7vethf-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7hf-neon-vfpv4  = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4} cortexa7"
 TUNE_FEATURES_tune-cortexa7thf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vethf-neon-vfpv4} cortexa7"
-PACKAGE_EXTRA_ARCHS_tune-cortexa7hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf}  cortexa7hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf} cortexa7hf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa7thf            = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf} cortexa7hf-vfp cortexa7t2hf-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa7hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon}  cortexa7hf-vfp cortexa7hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon} cortexa7hf-vfp cortexa7hf-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa7thf-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon} cortexa7hf-vfp cortexa7hf-neon cortexa7t2hf-vfp cortexa7t2hf-neon"
-PACKAGE_EXTRA_ARCHS_tune-cortexa7hf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4}  cortexa7hf-vfp cortexa7hf-neon cortexa7hf-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7hf-neon-vfpv4  = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4} cortexa7hf-vfp cortexa7hf-neon cortexa7hf-neon-vfpv4"
 PACKAGE_EXTRA_ARCHS_tune-cortexa7thf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon-vfpv4} cortexa7hf-vfp cortexa7hf-neon cortexa7hf-neon-vfpv4 cortexa7t2hf-vfp cortexa7t2hf-neon cortexa7t2hf-neon-vfpv4"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa8.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa8.inc
index c8ce021..8ee8de9 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa8.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa8.inc
@@ -1,4 +1,4 @@
-DEFAULTTUNE ?= "armv7a-neon"
+DEFAULTTUNE ?= "armv7athf-neon"
 
 require conf/machine/include/arm/arch-armv7a.inc
 
@@ -11,13 +11,13 @@
 ARMPKGARCH_tune-cortexa8t            = "cortexa8"
 ARMPKGARCH_tune-cortexa8-neon        = "cortexa8"
 ARMPKGARCH_tune-cortexa8t-neon       = "cortexa8"
-TUNE_FEATURES_tune-cortexa8             = "${TUNE_FEATURES_tune-armv7a}             cortexa8"
-TUNE_FEATURES_tune-cortexa8t            = "${TUNE_FEATURES_tune-armv7at}            cortexa8"
-TUNE_FEATURES_tune-cortexa8-neon        = "${TUNE_FEATURES_tune-armv7a-neon}        cortexa8"
-TUNE_FEATURES_tune-cortexa8t-neon       = "${TUNE_FEATURES_tune-armv7at-neon}       cortexa8"
-PACKAGE_EXTRA_ARCHS_tune-cortexa8             = "${PACKAGE_EXTRA_ARCHS_tune-armv7a}  cortexa8-vfp"
+TUNE_FEATURES_tune-cortexa8             = "${TUNE_FEATURES_tune-armv7a} cortexa8"
+TUNE_FEATURES_tune-cortexa8t            = "${TUNE_FEATURES_tune-armv7at} cortexa8"
+TUNE_FEATURES_tune-cortexa8-neon        = "${TUNE_FEATURES_tune-armv7a-neon} cortexa8"
+TUNE_FEATURES_tune-cortexa8t-neon       = "${TUNE_FEATURES_tune-armv7at-neon} cortexa8"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8             = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa8-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa8t            = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa8-vfp cortexa8t2-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa8-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon}  cortexa8-vfp cortexa8-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa8-vfp cortexa8-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa8t-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa8-vfp cortexa8-neon cortexa8t2-vfp cortexa8t2-neon"
 
 # HF Tunes
@@ -26,11 +26,11 @@
 ARMPKGARCH_tune-cortexa8thf            = "cortexa8"
 ARMPKGARCH_tune-cortexa8hf-neon        = "cortexa8"
 ARMPKGARCH_tune-cortexa8thf-neon       = "cortexa8"
-TUNE_FEATURES_tune-cortexa8hf             = "${TUNE_FEATURES_tune-armv7ahf}             cortexa8"
-TUNE_FEATURES_tune-cortexa8thf            = "${TUNE_FEATURES_tune-armv7athf}            cortexa8"
-TUNE_FEATURES_tune-cortexa8hf-neon        = "${TUNE_FEATURES_tune-armv7ahf-neon}        cortexa8"
-TUNE_FEATURES_tune-cortexa8thf-neon       = "${TUNE_FEATURES_tune-armv7athf-neon}       cortexa8"
-PACKAGE_EXTRA_ARCHS_tune-cortexa8hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf}  cortexa8hf-vfp"
+TUNE_FEATURES_tune-cortexa8hf             = "${TUNE_FEATURES_tune-armv7ahf} cortexa8"
+TUNE_FEATURES_tune-cortexa8thf            = "${TUNE_FEATURES_tune-armv7athf} cortexa8"
+TUNE_FEATURES_tune-cortexa8hf-neon        = "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa8"
+TUNE_FEATURES_tune-cortexa8thf-neon       = "${TUNE_FEATURES_tune-armv7athf-neon} cortexa8"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa8hf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa8thf            = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa8hf-vfp cortexa8t2hf-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa8hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon}  cortexa8hf-vfp cortexa8hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa8hf-vfp cortexa8hf-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa8thf-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa8hf-vfp cortexa8hf-neon cortexa8t2hf-vfp cortexa8t2hf-neon"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa9.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa9.inc
index 3d8dc1d..0cf323c 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa9.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa9.inc
@@ -1,4 +1,4 @@
-DEFAULTTUNE ?= "armv7a-neon"
+DEFAULTTUNE ?= "armv7athf-neon"
 
 require conf/machine/include/arm/arch-armv7a.inc
 
@@ -11,13 +11,13 @@
 ARMPKGARCH_tune-cortexa9t            = "cortexa9"
 ARMPKGARCH_tune-cortexa9-neon        = "cortexa9"
 ARMPKGARCH_tune-cortexa9t-neon       = "cortexa9"
-TUNE_FEATURES_tune-cortexa9             = "${TUNE_FEATURES_tune-armv7a}             cortexa9"
-TUNE_FEATURES_tune-cortexa9t            = "${TUNE_FEATURES_tune-armv7at}            cortexa9"
-TUNE_FEATURES_tune-cortexa9-neon        = "${TUNE_FEATURES_tune-armv7a-neon}        cortexa9"
-TUNE_FEATURES_tune-cortexa9t-neon       = "${TUNE_FEATURES_tune-armv7at-neon}       cortexa9"
-PACKAGE_EXTRA_ARCHS_tune-cortexa9             = "${PACKAGE_EXTRA_ARCHS_tune-armv7a}  cortexa9-vfp"
+TUNE_FEATURES_tune-cortexa9             = "${TUNE_FEATURES_tune-armv7a} cortexa9"
+TUNE_FEATURES_tune-cortexa9t            = "${TUNE_FEATURES_tune-armv7at} cortexa9"
+TUNE_FEATURES_tune-cortexa9-neon        = "${TUNE_FEATURES_tune-armv7a-neon} cortexa9"
+TUNE_FEATURES_tune-cortexa9t-neon       = "${TUNE_FEATURES_tune-armv7at-neon} cortexa9"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9             = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa9-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa9t            = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa9-vfp cortexa9t2-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa9-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon}  cortexa9-vfp cortexa9-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa9-vfp cortexa9-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa9t-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa9-vfp cortexa9-neon cortexa9t2-vfp cortexa9t2-neon"
 
 # HF Tunes
@@ -26,13 +26,13 @@
 ARMPKGARCH_tune-cortexa9thf            = "cortexa9"
 ARMPKGARCH_tune-cortexa9hf-neon        = "cortexa9"
 ARMPKGARCH_tune-cortexa9thf-neon       = "cortexa9"
-TUNE_FEATURES_tune-cortexa9hf             = "${TUNE_FEATURES_tune-armv7ahf}             cortexa9"
-TUNE_FEATURES_tune-cortexa9thf            = "${TUNE_FEATURES_tune-armv7athf}            cortexa9"
-TUNE_FEATURES_tune-cortexa9hf-neon        = "${TUNE_FEATURES_tune-armv7ahf-neon}        cortexa9"
-TUNE_FEATURES_tune-cortexa9thf-neon       = "${TUNE_FEATURES_tune-armv7athf-neon}       cortexa9"
-PACKAGE_EXTRA_ARCHS_tune-cortexa9hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf}  cortexa9hf-vfp"
+TUNE_FEATURES_tune-cortexa9hf             = "${TUNE_FEATURES_tune-armv7ahf} cortexa9"
+TUNE_FEATURES_tune-cortexa9thf            = "${TUNE_FEATURES_tune-armv7athf} cortexa9"
+TUNE_FEATURES_tune-cortexa9hf-neon        = "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa9"
+TUNE_FEATURES_tune-cortexa9thf-neon       = "${TUNE_FEATURES_tune-armv7athf-neon} cortexa9"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9hf             = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa9hf-vfp"
 PACKAGE_EXTRA_ARCHS_tune-cortexa9thf            = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa9hf-vfp cortexa9t2hf-vfp"
-PACKAGE_EXTRA_ARCHS_tune-cortexa9hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon}  cortexa9hf-vfp cortexa9hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9hf-neon        = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa9hf-vfp cortexa9hf-neon"
 PACKAGE_EXTRA_ARCHS_tune-cortexa9thf-neon       = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa9hf-vfp cortexa9hf-neon cortexa9t2hf-vfp cortexa9t2hf-neon"
 
 # VFPv3 Tunes
@@ -41,11 +41,11 @@
 ARMPKGARCH_tune-cortexa9t-vfpv3         = "cortexa9"
 ARMPKGARCH_tune-cortexa9hf-vfpv3        = "cortexa9"
 ARMPKGARCH_tune-cortexa9thf-vfpv3       = "cortexa9"
-TUNE_FEATURES_tune-cortexa9-vfpv3           = "${TUNE_FEATURES_tune-armv7a-vfpv3}          cortexa9"
-TUNE_FEATURES_tune-cortexa9t-vfpv3          = "${TUNE_FEATURES_tune-armv7at-vfpv3}         cortexa9"
-TUNE_FEATURES_tune-cortexa9hf-vfpv3         = "${TUNE_FEATURES_tune-armv7ahf-vfpv3}        cortexa9"
-TUNE_FEATURES_tune-cortexa9thf-vfpv3        = "${TUNE_FEATURES_tune-armv7athf-vfpv3}       cortexa9"
-PACKAGE_EXTRA_ARCHS_tune-cortexa9-vfpv3           = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3}  cortexa9-vfp cortexa9-vfpv3"
+TUNE_FEATURES_tune-cortexa9-vfpv3           = "${TUNE_FEATURES_tune-armv7a-vfpv3} cortexa9"
+TUNE_FEATURES_tune-cortexa9t-vfpv3          = "${TUNE_FEATURES_tune-armv7at-vfpv3} cortexa9"
+TUNE_FEATURES_tune-cortexa9hf-vfpv3         = "${TUNE_FEATURES_tune-armv7ahf-vfpv3} cortexa9"
+TUNE_FEATURES_tune-cortexa9thf-vfpv3        = "${TUNE_FEATURES_tune-armv7athf-vfpv3} cortexa9"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9-vfpv3           = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3} cortexa9-vfp cortexa9-vfpv3"
 PACKAGE_EXTRA_ARCHS_tune-cortexa9t-vfpv3          = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3} cortexa9-vfp cortexa9-vfpv3 cortexa9t2-vfp cortexa9t2-vfpv3"
-PACKAGE_EXTRA_ARCHS_tune-cortexa9hf-vfpv3         = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3}  cortexa9hf-vfp cortexa9hf-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9hf-vfpv3         = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3} cortexa9hf-vfp cortexa9hf-vfpv3"
 PACKAGE_EXTRA_ARCHS_tune-cortexa9thf-vfpv3        = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3} cortexa9hf-vfp cortexa9hf-vfpv3 cortexa9t2hf-vfp cortexa9t2hf-vfpv3"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-mips32r6.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-mips32r6.inc
index 4721319..dea33ea 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-mips32r6.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-mips32r6.inc
@@ -9,21 +9,21 @@
 # Base Tunes
 AVAILTUNES += "mipsisa32r6 mipsisa32r6el"
 
-TUNE_FEATURES_tune-mipsisa32r6 = "bigendian mipsisa32r6 fpu-hard r6"
+TUNE_FEATURES_tune-mipsisa32r6 = "o32 bigendian mipsisa32r6 fpu-hard r6"
 MIPSPKGSFX_VARIANT_tune-mipsisa32r6 = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mipsisa32r6 = "mipsisa32r6"
 
-TUNE_FEATURES_tune-mipsisa32r6el = "fpu-hard mipsisa32r6 r6"
+TUNE_FEATURES_tune-mipsisa32r6el = "o32 fpu-hard mipsisa32r6 r6"
 MIPSPKGSFX_VARIANT_tune-mipsisa32r6el = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mipsisa32r6el = "mipsisa32r6el"
 
 # Soft Float
 AVAILTUNES += "mipsisa32r6-nf mipsisa32r6el-nf"
 
-TUNE_FEATURES_tune-mipsisa32r6-nf = "bigendian mipsisa32r6 r6"
+TUNE_FEATURES_tune-mipsisa32r6-nf = "o32 bigendian mipsisa32r6 r6"
 MIPSPKGSFX_VARIANT_tune-mipsisa32r6-nf = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mipsisa32r6-nf = "mipsisa32r6-nf"
 
-TUNE_FEATURES_tune-mipsisa32r6el-nf = "mipsisa32r6 r6"
+TUNE_FEATURES_tune-mipsisa32r6el-nf = "o32 mipsisa32r6 r6"
 MIPSPKGSFX_VARIANT_tune-mipsisa32r6el-nf = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mipsisa32r6el-nf = "mipsisa32r6el-nf"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-mips64r6.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-mips64r6.inc
index f0ad564..4fe3eed 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-mips64r6.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-mips64r6.inc
@@ -30,3 +30,29 @@
 MIPSPKGSFX_VARIANT_tune-mipsisa64r6el-nf = "${TUNE_ARCH}"
 BASE_LIB_tune-mipsisa64r6el-nf = "lib64"
 PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6el-nf = "mipsisa64r6el-nf"
+
+# MIPS 64r6 n32
+AVAILTUNES += "mipsisa64r6-n32 mipsisa64r6el-n32"
+
+TUNE_FEATURES_tune-mipsisa64r6-n32 = "bigendian fpu-hard r6 n32 mipsisa64r6"
+BASE_LIB_tune-mipsisa64r6-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6-n32 = "mipsisa64r6-n32"
+
+TUNE_FEATURES_tune-mipsisa64r6el-n32 = "fpu-hard r6 n32 mipsisa64r6"
+BASE_LIB_tune-mipsisa64r6el-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6el-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6el-n32 = "mipsisa64r6el-n32"
+
+# MIPS 64r6 n32 and Soft Float
+AVAILTUNES += "mipsisa64r6-nf-n32 mipsisa64r6el-nf-n32"
+
+TUNE_FEATURES_tune-mipsisa64r6-nf-n32 = "bigendian r6 n32 mipsisa64r6"
+BASE_LIB_tune-mipsisa64r6-nf-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6-nf-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6-nf-n32 = "mipsisa64r6-nf-n32"
+
+TUNE_FEATURES_tune-mipsisa64r6el-nf-n32 = "r6 n32 mipsisa64r6"
+BASE_LIB_tune-mipsisa64r6el-nf-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6el-nf-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6el-nf-n32 = "mipsisa64r6el-nf-n32"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500.inc
index 96073d2..89ec3f3 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500.inc
@@ -11,7 +11,7 @@
 
 # spe is defined potentially in two places, so we want to be sure it will
 # only write spe once to the ABIEXTENSIONS field.
-SPEABIEXTENSION = "${@bb.utils.contains('TUNE_FEATURES', 'spe', 'spe', '', d)}"
+SPEABIEXTENSION = "${@bb.utils.filter('TUNE_FEATURES', 'spe', d)}"
 ABIEXTENSION .= "${SPEABIEXTENSION}"
 
 AVAILTUNES += "ppce500"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500v2.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500v2.inc
index 20a5f25..3a006e2 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500v2.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500v2.inc
@@ -11,7 +11,7 @@
 
 # spe is defined potentially in two places, so we want to be sure it will
 # only write spe once to the ABIEXTENSIONS field.
-SPEABIEXTENSION = "${@bb.utils.contains('TUNE_FEATURES', 'spe', 'spe', '', d)}"
+SPEABIEXTENSION = "${@bb.utils.filter('TUNE_FEATURES', 'spe', d)}"
 ABIEXTENSION .= "${SPEABIEXTENSION}"
 
 AVAILTUNES += "ppce500v2"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/x86-base.inc b/import-layers/yocto-poky/meta/conf/machine/include/x86-base.inc
index 479e89e..7365953 100644
--- a/import-layers/yocto-poky/meta/conf/machine/include/x86-base.inc
+++ b/import-layers/yocto-poky/meta/conf/machine/include/x86-base.inc
@@ -20,16 +20,12 @@
 # kernel-related variables
 #
 PREFERRED_PROVIDER_virtual/kernel ??= "linux-yocto"
-PREFERRED_VERSION_linux-yocto ??= "4.8%"
+PREFERRED_VERSION_linux-yocto ??= "4.10%"
 
 #
 # XSERVER subcomponents, used to build the XSERVER variable
 #
 XSERVER_X86_BASE = "xserver-xorg \
-           xf86-input-mouse \
-           xf86-input-keyboard \
-           xf86-input-evdev \
-           xf86-input-synaptics \
            "
 
 XSERVER_X86_EXT = " \
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemuarm.conf b/import-layers/yocto-poky/meta/conf/machine/qemuarm.conf
index f9d6dd7..6b875e4 100644
--- a/import-layers/yocto-poky/meta/conf/machine/qemuarm.conf
+++ b/import-layers/yocto-poky/meta/conf/machine/qemuarm.conf
@@ -16,5 +16,5 @@
 QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0,115200 console=tty"
 # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
 QB_OPT_APPEND = "-show-cursor -usb -usbdevice tablet -device virtio-rng-pci"
-PREFERRED_VERSION_linux-yocto ??= "4.8%"
+PREFERRED_VERSION_linux-yocto ??= "4.10%"
 QB_DTB = "${@base_version_less_or_equal('PREFERRED_VERSION_linux-yocto', '4.7', '', 'zImage-versatile-pb.dtb', d)}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemuarm64.conf b/import-layers/yocto-poky/meta/conf/machine/qemuarm64.conf
index e70538a..242889a 100644
--- a/import-layers/yocto-poky/meta/conf/machine/qemuarm64.conf
+++ b/import-layers/yocto-poky/meta/conf/machine/qemuarm64.conf
@@ -17,8 +17,8 @@
 QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0,38400"
 # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
 QB_OPT_APPEND = "-show-cursor -device virtio-rng-pci -monitor null"
-QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -device virtio-net-device,netdev=net0,mac=@MAC@"
-QB_SLIRP_OPT = "-netdev user,id=net0 -device virtio-net-device,netdev=net0"
+QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
+QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
 QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
 QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
 QB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemuppc.conf b/import-layers/yocto-poky/meta/conf/machine/qemuppc.conf
index 9d174bc..a9ef64b 100644
--- a/import-layers/yocto-poky/meta/conf/machine/qemuppc.conf
+++ b/import-layers/yocto-poky/meta/conf/machine/qemuppc.conf
@@ -18,4 +18,4 @@
 QB_KERNEL_CMDLINE_APPEND = "console=tty console=ttyS0"
 # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
 QB_OPT_APPEND = "-show-cursor -usb -usbdevice tablet -device virtio-rng-pci"
-QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -device virtio-net-pci,netdev=net0,mac=@MAC@"
+QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemux86-64.conf b/import-layers/yocto-poky/meta/conf/machine/qemux86-64.conf
index 4f30033..10189cb 100644
--- a/import-layers/yocto-poky/meta/conf/machine/qemux86-64.conf
+++ b/import-layers/yocto-poky/meta/conf/machine/qemux86-64.conf
@@ -18,9 +18,6 @@
 
 XSERVER = "xserver-xorg \
            ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \
-           xf86-input-vmmouse \
-           xf86-input-keyboard \
-           xf86-input-evdev \
            xf86-video-cirrus \
            xf86-video-fbdev \
            xf86-video-vmware \
@@ -33,4 +30,4 @@
 MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
 
 WKS_FILE ?= "directdisk.wks"
-do_image_wic[depends] += "syslinux:do_build syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
+do_image_wic[depends] += "syslinux:do_populate_sysroot syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemux86.conf b/import-layers/yocto-poky/meta/conf/machine/qemux86.conf
index e232947..c26dda2 100644
--- a/import-layers/yocto-poky/meta/conf/machine/qemux86.conf
+++ b/import-layers/yocto-poky/meta/conf/machine/qemux86.conf
@@ -17,9 +17,6 @@
 
 XSERVER = "xserver-xorg \
            ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \
-           xf86-input-vmmouse \
-           xf86-input-keyboard \
-           xf86-input-evdev \
            xf86-video-cirrus \
            xf86-video-fbdev \
            xf86-video-vmware \
@@ -31,5 +28,5 @@
 
 MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
 
-WKS_FILE = "directdisk.wks"
-do_image_wic[depends] += "syslinux:do_build syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
+WKS_FILE ?= "directdisk.wks"
+do_image_wic[depends] += "syslinux:do_populate_sysroot syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/meta/conf/multiconfig/default.conf
similarity index 100%
copy from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
copy to import-layers/yocto-poky/meta/conf/multiconfig/default.conf
diff --git a/import-layers/yocto-poky/meta/conf/multilib.conf b/import-layers/yocto-poky/meta/conf/multilib.conf
index 1403a03..e74dec8 100644
--- a/import-layers/yocto-poky/meta/conf/multilib.conf
+++ b/import-layers/yocto-poky/meta/conf/multilib.conf
@@ -1,14 +1,14 @@
 
-baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) or 'INVALID'), True) or d.getVar('BASELIB', True)}"
+baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE') or 'INVALID')) or d.getVar('BASELIB')}"
 
 MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}"
 MULTILIB_SAVE_VARNAME = "DEFAULTTUNE TARGET_ARCH TARGET_SYS TARGET_VENDOR"
 
 MULTILIBS ??= "multilib:lib32"
 
-STAGING_DIR_HOST = "${STAGING_DIR}/${MLPREFIX}${MACHINE}"
-STAGING_DIR_TARGET = "${STAGING_DIR}/${MLPREFIX}${MACHINE}"
-PKGDATA_DIR = "${STAGING_DIR}/${MACHINE}/pkgdata"
+STAGING_DIR_HOST = "${WORKDIR}/${MLPREFIX}recipe-sysroot"
+STAGING_DIR_TARGET = "${WORKDIR}/${MLPREFIX}recipe-sysroot"
+RECIPE_SYSROOT = "${WORKDIR}/${MLPREFIX}recipe-sysroot"
 
 INHERIT += "multilib_global"
 
@@ -23,6 +23,6 @@
 # find an allarch pkgconfig file will fail as the PKG_CONFIG_PATH only looks
 # inside the multilib sysroot.  Fix this by explicitly adding the MACHINE's
 # architecture-independent pkgconfig location to PKG_CONFIG_PATH.
-PKG_CONFIG_PATH .= ":${STAGING_DIR}/${MACHINE}${datadir}/pkgconfig"
-PKG_CONFIG_PATH[vardepsexclude] = "MACHINE datadir STAGING_DIR"
-PKG_CONFIG_PATH[vardepvalueexclude] = ":${STAGING_DIR}/${MACHINE}${datadir}/pkgconfig"
+PKG_CONFIG_PATH .= ":${WORKDIR}/recipe-sysroot/${datadir}/pkgconfig"
+PKG_CONFIG_PATH[vardepsexclude] = "datadir WORKDIR"
+PKG_CONFIG_PATH[vardepvalueexclude] = ":${WORKDIR}/recipe-sysroot/${datadir}/pkgconfig"
diff --git a/import-layers/yocto-poky/meta/conf/sanity.conf b/import-layers/yocto-poky/meta/conf/sanity.conf
index dcf60b7..46bdbeb 100644
--- a/import-layers/yocto-poky/meta/conf/sanity.conf
+++ b/import-layers/yocto-poky/meta/conf/sanity.conf
@@ -3,7 +3,7 @@
 # See sanity.bbclass
 #
 # Expert users can confirm their sanity with "touch conf/sanity.conf"
-BB_MIN_VERSION = "1.31.2"
+BB_MIN_VERSION = "1.33.4"
 
 SANITY_ABIFILE = "${TMPDIR}/abi_version"
 
diff --git a/import-layers/yocto-poky/meta/conf/toasterconf.json b/import-layers/yocto-poky/meta/conf/toasterconf.json
deleted file mode 100644
index 796125b..0000000
--- a/import-layers/yocto-poky/meta/conf/toasterconf.json
+++ /dev/null
@@ -1,77 +0,0 @@
-{
-    "config": {
-        "MACHINE"      : "qemux86",
-        "DISTRO"       : "nodistro",
-        "DL_DIR"       : "${TOPDIR}/../downloads",
-        "IMAGE_FSTYPES": "ext4 jffs2 tar.bz2",
-        "IMAGE_INSTALL_append": "",
-        "PACKAGE_CLASSES": "package_rpm",
-        "SSTATE_DIR"   : "${TOPDIR}/../sstate-cache"
-    },
-    "layersources": [
-        {
-            "name": "Local OpenEmbedded",
-            "sourcetype": "local",
-            "apiurl": "../../",
-            "branches": ["HEAD", "master"],
-            "layers": [
-                {
-                    "name": "openembedded-core",
-                    "local_path": "meta",
-                    "vcs_url": "remote:origin",
-                    "dirpath": "meta"
-                }
-            ]
-        },
-        {
-            "name": "OpenEmbedded",
-            "sourcetype": "layerindex",
-            "apiurl": "http://layers.openembedded.org/layerindex/api/",
-            "branches": ["master"]
-        },
-        {
-            "name": "Imported layers",
-            "sourcetype": "imported",
-            "apiurl": "",
-            "branches": ["master", "HEAD"]
-
-        }
-    ],
-    "bitbake" : [
-        {
-            "name": "master",
-            "giturl": "git://git.openembedded.org/bitbake",
-            "branch": "master",
-            "dirpath": ""
-        },
-        {
-            "name": "HEAD",
-            "giturl": "git://git.openembedded.org/bitbake",
-            "branch": "HEAD",
-            "dirpath": ""
-        }
-    ],
-
-    "defaultrelease": "master",
-
-    "releases": [
-        {
-            "name": "master",
-            "description": "OpenEmbedded master",
-            "bitbake": "master",
-            "branch": "master",
-            "defaultlayers": [ "openembedded-core" ],
-            "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" :  0 },
-            "helptext": "Toaster will run your builds using the tip of the <a href=\"http://cgit.openembedded.org/openembedded-core/log/\">OpenEmbedded master</a> branch, where active development takes place. This is not a stable branch, so your builds might not work as expected."
-        },
-        {
-            "name": "local",
-            "description": "Local OpenEmbedded",
-            "bitbake": "HEAD",
-            "branch": "HEAD",
-            "defaultlayers": [ "openembedded-core" ],
-            "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" :  0 },
-            "helptext": "Toaster will run your builds with the version of OpenEmbedded that you have cloned or downloaded to your computer."
-        }
-    ]
-}
diff --git a/import-layers/yocto-poky/meta/files/ext-sdk-prepare.py b/import-layers/yocto-poky/meta/files/ext-sdk-prepare.py
index 78c1d16..96c5212 100644
--- a/import-layers/yocto-poky/meta/files/ext-sdk-prepare.py
+++ b/import-layers/yocto-poky/meta/files/ext-sdk-prepare.py
@@ -53,6 +53,8 @@
         logf.write('Preparing SDK for %s...\n' % ', '.join(sdk_targets))
 
         ret = run_command_interruptible('BB_SETSCENE_ENFORCE=1 bitbake --quiet %s' % ' '.join(sdk_targets))
+        if not ret:
+            ret = run_command_interruptible('bitbake --quiet build-sysroots')
         lastlog = get_last_consolelog()
         if lastlog:
             with open(lastlog, 'r') as f:
diff --git a/import-layers/yocto-poky/meta/files/fs-perms.txt b/import-layers/yocto-poky/meta/files/fs-perms.txt
index 3d00e86..c8c3ac5 100644
--- a/import-layers/yocto-poky/meta/files/fs-perms.txt
+++ b/import-layers/yocto-poky/meta/files/fs-perms.txt
@@ -63,8 +63,5 @@
 # Set 0700
 ${ROOT_HOME}			0700	root	root	false - - -
 
-# Set 755-lsb
-/srv				0755	root	root	false - - -
-
 # Set 2775-lsb
-/var/mail			02775	root	mail	false - - -
+${localstatedir}/mail		02775	root	mail	false - - -
diff --git a/import-layers/yocto-poky/meta/files/toolchain-shar-extract.sh b/import-layers/yocto-poky/meta/files/toolchain-shar-extract.sh
index 9295ddc..91804ec 100644
--- a/import-layers/yocto-poky/meta/files/toolchain-shar-extract.sh
+++ b/import-layers/yocto-poky/meta/files/toolchain-shar-extract.sh
@@ -8,9 +8,26 @@
 [ -f /etc/environment ] && . /etc/environment
 export PATH=`echo "$PATH" | sed -e 's/:\.//' -e 's/::/:/'`
 
+tweakpath () {
+    case ":${PATH}:" in
+        *:"$1":*)
+            ;;
+        *)
+            PATH=$PATH:$1
+    esac
+}
+
+# Some systems don't have /usr/sbin or /sbin in the cleaned environment PATH but we make need it 
+# for the system's host tooling checks
+tweakpath /usr/sbin
+tweakpath /sbin
+
 INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
 SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
 
+INST_GCC_VER=$(gcc --version | sed -ne 's/.* \([0-9]\+\.[0-9]\+\)\.[0-9]\+.*/\1/p')
+SDK_GCC_VER='@SDK_GCC_VER@'
+
 verlte () {
 	[  "$1" = "`printf "$1\n$2" | sort -V | head -n1`" ]
 }
@@ -112,6 +129,11 @@
 # SDK_EXTENSIBLE is exposed from the SDK_PRE_INSTALL_COMMAND above
 if [ "$SDK_EXTENSIBLE" = "1" ]; then
 	DEFAULT_INSTALL_DIR="@SDKEXTPATH@"
+	if [ "$INST_GCC_VER" = '4.8' -a "$SDK_GCC_VER" = '4.9' ] || [ "$INST_GCC_VER" = '4.8' -a "$SDK_GCC_VER" = '' ] || \
+		[ "$INST_GCC_VER" = '4.9' -a "$SDK_GCC_VER" = '' ]; then
+		echo "Error: Incompatible SDK installer! Your host gcc version is $INST_GCC_VER and this SDK was built by gcc higher version."
+		exit 1
+	fi
 fi
 
 if [ "$target_sdk_dir" = "" ]; then
diff --git a/import-layers/yocto-poky/meta/lib/buildstats.py b/import-layers/yocto-poky/meta/lib/buildstats.py
new file mode 100644
index 0000000..c5d4c73
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/buildstats.py
@@ -0,0 +1,158 @@
+# Implements system state sampling. Called by buildstats.bbclass.
+# Because it is a real Python module, it can hold persistent state,
+# like open log files and the time of the last sampling.
+
+import time
+import re
+import bb.event
+
+class SystemStats:
+    def __init__(self, d):
+        bn = d.getVar('BUILDNAME')
+        bsdir = os.path.join(d.getVar('BUILDSTATS_BASE'), bn)
+        bb.utils.mkdirhier(bsdir)
+
+        self.proc_files = []
+        for filename, handler in (
+                ('diskstats', self._reduce_diskstats),
+                ('meminfo', self._reduce_meminfo),
+                ('stat', self._reduce_stat),
+        ):
+            # The corresponding /proc files might not exist on the host.
+            # For example, /proc/diskstats is not available in virtualized
+            # environments like Linux-VServer. Silently skip collecting
+            # the data.
+            if os.path.exists(os.path.join('/proc', filename)):
+                # In practice, this class gets instantiated only once in
+                # the bitbake cooker process.  Therefore 'append' mode is
+                # not strictly necessary, but using it makes the class
+                # more robust should two processes ever write
+                # concurrently.
+                destfile = os.path.join(bsdir, '%sproc_%s.log' % ('reduced_' if handler else '', filename))
+                self.proc_files.append((filename, open(destfile, 'ab'), handler))
+        self.monitor_disk = open(os.path.join(bsdir, 'monitor_disk.log'), 'ab')
+        # Last time that we sampled /proc data resp. recorded disk monitoring data.
+        self.last_proc = 0
+        self.last_disk_monitor = 0
+        # Minimum number of seconds between recording a sample. This
+        # becames relevant when we get called very often while many
+        # short tasks get started. Sampling during quiet periods
+        # depends on the heartbeat event, which fires less often.
+        self.min_seconds = 1
+
+        self.meminfo_regex = re.compile(b'^(MemTotal|MemFree|Buffers|Cached|SwapTotal|SwapFree):\s*(\d+)')
+        self.diskstats_regex = re.compile(b'^([hsv]d.|mtdblock\d|mmcblk\d|cciss/c\d+d\d+.*)$')
+        self.diskstats_ltime = None
+        self.diskstats_data = None
+        self.stat_ltimes = None
+
+    def close(self):
+        self.monitor_disk.close()
+        for _, output, _ in self.proc_files:
+            output.close()
+
+    def _reduce_meminfo(self, time, data):
+        """
+        Extracts 'MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree'
+        and writes their values into a single line, in that order.
+        """
+        values = {}
+        for line in data.split(b'\n'):
+            m = self.meminfo_regex.match(line)
+            if m:
+                values[m.group(1)] = m.group(2)
+        if len(values) == 6:
+            return (time,
+                    b' '.join([values[x] for x in
+                               (b'MemTotal', b'MemFree', b'Buffers', b'Cached', b'SwapTotal', b'SwapFree')]) + b'\n')
+
+    def _diskstats_is_relevant_line(self, linetokens):
+        if len(linetokens) != 14:
+            return False
+        disk = linetokens[2]
+        return self.diskstats_regex.match(disk)
+
+    def _reduce_diskstats(self, time, data):
+        relevant_tokens = filter(self._diskstats_is_relevant_line, map(lambda x: x.split(), data.split(b'\n')))
+        diskdata = [0] * 3
+        reduced = None
+        for tokens in relevant_tokens:
+            # rsect
+            diskdata[0] += int(tokens[5])
+            # wsect
+            diskdata[1] += int(tokens[9])
+            # use
+            diskdata[2] += int(tokens[12])
+        if self.diskstats_ltime:
+            # We need to compute information about the time interval
+            # since the last sampling and record the result as sample
+            # for that point in the past.
+            interval = time - self.diskstats_ltime
+            if interval > 0:
+                sums = [ a - b for a, b in zip(diskdata, self.diskstats_data) ]
+                readTput = sums[0] / 2.0 * 100.0 / interval
+                writeTput = sums[1] / 2.0 * 100.0 / interval
+                util = float( sums[2] ) / 10 / interval
+                util = max(0.0, min(1.0, util))
+                reduced = (self.diskstats_ltime, (readTput, writeTput, util))
+
+        self.diskstats_ltime = time
+        self.diskstats_data = diskdata
+        return reduced
+
+
+    def _reduce_nop(self, time, data):
+        return (time, data)
+
+    def _reduce_stat(self, time, data):
+        if not data:
+            return None
+        # CPU times {user, nice, system, idle, io_wait, irq, softirq} from first line
+        tokens = data.split(b'\n', 1)[0].split()
+        times = [ int(token) for token in tokens[1:] ]
+        reduced = None
+        if self.stat_ltimes:
+            user = float((times[0] + times[1]) - (self.stat_ltimes[0] + self.stat_ltimes[1]))
+            system = float((times[2] + times[5] + times[6]) - (self.stat_ltimes[2] + self.stat_ltimes[5] + self.stat_ltimes[6]))
+            idle = float(times[3] - self.stat_ltimes[3])
+            iowait = float(times[4] - self.stat_ltimes[4])
+
+            aSum = max(user + system + idle + iowait, 1)
+            reduced = (time, (user/aSum, system/aSum, iowait/aSum))
+
+        self.stat_ltimes = times
+        return reduced
+
+    def sample(self, event, force):
+        now = time.time()
+        if (now - self.last_proc > self.min_seconds) or force:
+            for filename, output, handler in self.proc_files:
+                with open(os.path.join('/proc', filename), 'rb') as input:
+                    data = input.read()
+                    if handler:
+                        reduced = handler(now, data)
+                    else:
+                        reduced = (now, data)
+                    if reduced:
+                        if isinstance(reduced[1], bytes):
+                            # Use as it is.
+                            data = reduced[1]
+                        else:
+                            # Convert to a single line.
+                            data = (' '.join([str(x) for x in reduced[1]]) + '\n').encode('ascii')
+                        # Unbuffered raw write, less overhead and useful
+                        # in case that we end up with concurrent writes.
+                        os.write(output.fileno(),
+                                 ('%.0f\n' % reduced[0]).encode('ascii') +
+                                 data +
+                                 b'\n')
+            self.last_proc = now
+
+        if isinstance(event, bb.event.MonitorDiskEvent) and \
+           ((now - self.last_disk_monitor > self.min_seconds) or force):
+            os.write(self.monitor_disk.fileno(),
+                     ('%.0f\n' % now).encode('ascii') +
+                     ''.join(['%s: %d\n' % (dev, sample.total_bytes - sample.free_bytes)
+                              for dev, sample in event.disk_usage.items()]).encode('ascii') +
+                     b'\n')
+            self.last_disk_monitor = now
diff --git a/import-layers/yocto-poky/meta/lib/oe/buildhistory_analysis.py b/import-layers/yocto-poky/meta/lib/oe/buildhistory_analysis.py
index b6c0265..3a5b7b6 100644
--- a/import-layers/yocto-poky/meta/lib/oe/buildhistory_analysis.py
+++ b/import-layers/yocto-poky/meta/lib/oe/buildhistory_analysis.py
@@ -1,6 +1,6 @@
 # Report significant differences in the buildhistory repository since a specific revision
 #
-# Copyright (C) 2012 Intel Corporation
+# Copyright (C) 2012-2013, 2016-2017 Intel Corporation
 # Author: Paul Eggleton <paul.eggleton@linux.intel.com>
 #
 # Note: requires GitPython 0.3.1+
@@ -13,7 +13,10 @@
 import difflib
 import git
 import re
+import hashlib
+import collections
 import bb.utils
+import bb.tinfoil
 
 
 # How to display fields
@@ -69,7 +72,22 @@
                     pkglist.append(k)
             return pkglist
 
+        def detect_renamed_dirs(aitems, bitems):
+            adirs = set(map(os.path.dirname, aitems))
+            bdirs = set(map(os.path.dirname, bitems))
+            files_ab = [(name, sorted(os.path.basename(item) for item in aitems if os.path.dirname(item) == name)) \
+                                for name in adirs - bdirs]
+            files_ba = [(name, sorted(os.path.basename(item) for item in bitems if os.path.dirname(item) == name)) \
+                                for name in bdirs - adirs]
+            renamed_dirs = [(dir1, dir2) for dir1, files1 in files_ab for dir2, files2 in files_ba if files1 == files2]
+            # remove files that belong to renamed dirs from aitems and bitems
+            for dir1, dir2 in renamed_dirs:
+                aitems = [item for item in aitems if os.path.dirname(item) not in (dir1, dir2)]
+                bitems = [item for item in bitems if os.path.dirname(item) not in (dir1, dir2)]
+            return renamed_dirs, aitems, bitems
+
         if self.fieldname in list_fields or self.fieldname in list_order_fields:
+            renamed_dirs = []
             if self.fieldname in ['RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RREPLACES', 'RCONFLICTS']:
                 (depvera, depverb) = compare_pkg_lists(self.oldvalue, self.newvalue)
                 aitems = pkglist_combine(depvera)
@@ -77,16 +95,29 @@
             else:
                 aitems = self.oldvalue.split()
                 bitems = self.newvalue.split()
+                if self.fieldname == 'FILELIST':
+                    renamed_dirs, aitems, bitems = detect_renamed_dirs(aitems, bitems)
+
             removed = list(set(aitems) - set(bitems))
             added = list(set(bitems) - set(aitems))
 
+            lines = []
+            if renamed_dirs:
+                for dfrom, dto in renamed_dirs:
+                    lines.append('directory renamed %s -> %s' % (dfrom, dto))
             if removed or added:
                 if removed and not bitems:
-                    out = '%s: removed all items "%s"' % (self.fieldname, ' '.join(removed))
+                    lines.append('removed all items "%s"' % ' '.join(removed))
                 else:
-                    out = '%s:%s%s' % (self.fieldname, ' removed "%s"' % ' '.join(removed) if removed else '', ' added "%s"' % ' '.join(added) if added else '')
+                    if removed:
+                        lines.append('removed "%s"' % ' '.join(removed))
+                    if added:
+                        lines.append('added "%s"' % ' '.join(added))
             else:
-                out = '%s changed order' % self.fieldname
+                lines.append('changed order')
+
+            out = '%s: %s' % (self.fieldname, ', '.join(lines))
+
         elif self.fieldname in numeric_fields:
             aval = int(self.oldvalue or 0)
             bval = int(self.newvalue or 0)
@@ -382,13 +413,115 @@
     return changes
 
 
-def process_changes(repopath, revision1, revision2='HEAD', report_all=False, report_ver=False):
+def compare_siglists(a_blob, b_blob, taskdiff=False):
+    # FIXME collapse down a recipe's tasks?
+    alines = a_blob.data_stream.read().decode('utf-8').splitlines()
+    blines = b_blob.data_stream.read().decode('utf-8').splitlines()
+    keys = []
+    pnmap = {}
+    def readsigs(lines):
+        sigs = {}
+        for line in lines:
+            linesplit = line.split()
+            if len(linesplit) > 2:
+                sigs[linesplit[0]] = linesplit[2]
+                if not linesplit[0] in keys:
+                    keys.append(linesplit[0])
+                pnmap[linesplit[1]] = linesplit[0].rsplit('.', 1)[0]
+        return sigs
+    adict = readsigs(alines)
+    bdict = readsigs(blines)
+    out = []
+
+    changecount = 0
+    addcount = 0
+    removecount = 0
+    if taskdiff:
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=True)
+
+            changes = collections.OrderedDict()
+
+            def compare_hashfiles(pn, taskname, hash1, hash2):
+                hashes = [hash1, hash2]
+                hashfiles = bb.siggen.find_siginfo(pn, taskname, hashes, tinfoil.config_data)
+
+                if not taskname:
+                    (pn, taskname) = pn.rsplit('.', 1)
+                    pn = pnmap.get(pn, pn)
+                desc = '%s.%s' % (pn, taskname)
+
+                if len(hashfiles) == 0:
+                    out.append("Unable to find matching sigdata for %s with hashes %s or %s" % (desc, hash1, hash2))
+                elif not hash1 in hashfiles:
+                    out.append("Unable to find matching sigdata for %s with hash %s" % (desc, hash1))
+                elif not hash2 in hashfiles:
+                    out.append("Unable to find matching sigdata for %s with hash %s" % (desc, hash2))
+                else:
+                    out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb, collapsed=True)
+                    for line in out2:
+                        m = hashlib.sha256()
+                        m.update(line.encode('utf-8'))
+                        entry = changes.get(m.hexdigest(), (line, []))
+                        if desc not in entry[1]:
+                            changes[m.hexdigest()] = (line, entry[1] + [desc])
+
+            # Define recursion callback
+            def recursecb(key, hash1, hash2):
+                compare_hashfiles(key, None, hash1, hash2)
+                return []
+
+            for key in keys:
+                siga = adict.get(key, None)
+                sigb = bdict.get(key, None)
+                if siga is not None and sigb is not None and siga != sigb:
+                    changecount += 1
+                    (pn, taskname) = key.rsplit('.', 1)
+                    compare_hashfiles(pn, taskname, siga, sigb)
+                elif siga is None:
+                    addcount += 1
+                elif sigb is None:
+                    removecount += 1
+        for key, item in changes.items():
+            line, tasks = item
+            if len(tasks) == 1:
+                desc = tasks[0]
+            elif len(tasks) == 2:
+                desc = '%s and %s' % (tasks[0], tasks[1])
+            else:
+                desc = '%s and %d others' % (tasks[-1], len(tasks)-1)
+            out.append('%s: %s' % (desc, line))
+    else:
+        for key in keys:
+            siga = adict.get(key, None)
+            sigb = bdict.get(key, None)
+            if siga is not None and sigb is not None and siga != sigb:
+                out.append('%s changed from %s to %s' % (key, siga, sigb))
+                changecount += 1
+            elif siga is None:
+                out.append('%s was added' % key)
+                addcount += 1
+            elif sigb is None:
+                out.append('%s was removed' % key)
+                removecount += 1
+    out.append('Summary: %d tasks added, %d tasks removed, %d tasks modified (%.1f%%)' % (addcount, removecount, changecount, (changecount / float(len(bdict)) * 100)))
+    return '\n'.join(out)
+
+
+def process_changes(repopath, revision1, revision2='HEAD', report_all=False, report_ver=False, sigs=False, sigsdiff=False):
     repo = git.Repo(repopath)
     assert repo.bare == False
     commit = repo.commit(revision1)
     diff = commit.diff(revision2)
 
     changes = []
+
+    if sigs or sigsdiff:
+        for d in diff.iter_change_type('M'):
+            if d.a_blob.path == 'siglist.txt':
+                changes.append(compare_siglists(d.a_blob, d.b_blob, taskdiff=sigsdiff))
+        return changes
+
     for d in diff.iter_change_type('M'):
         path = os.path.dirname(d.a_blob.path)
         if path.startswith('packages/'):
diff --git a/import-layers/yocto-poky/meta/lib/oe/classextend.py b/import-layers/yocto-poky/meta/lib/oe/classextend.py
index 4c8a000..d2eeaf0 100644
--- a/import-layers/yocto-poky/meta/lib/oe/classextend.py
+++ b/import-layers/yocto-poky/meta/lib/oe/classextend.py
@@ -25,7 +25,7 @@
         return name
 
     def map_variable(self, varname, setvar = True):
-        var = self.d.getVar(varname, True)
+        var = self.d.getVar(varname)
         if not var:
             return ""
         var = var.split()
@@ -38,7 +38,7 @@
         return newdata
 
     def map_regexp_variable(self, varname, setvar = True):
-        var = self.d.getVar(varname, True)
+        var = self.d.getVar(varname)
         if not var:
             return ""
         var = var.split()
@@ -60,7 +60,7 @@
             return dep
         else:
             # Do not extend for that already have multilib prefix
-            var = self.d.getVar("MULTILIB_VARIANTS", True)
+            var = self.d.getVar("MULTILIB_VARIANTS")
             if var:
                 var = var.split()
                 for v in var:
@@ -74,7 +74,7 @@
             varname = varname + "_" + suffix
         orig = self.d.getVar("EXTENDPKGV", False)
         self.d.setVar("EXTENDPKGV", "EXTENDPKGV")
-        deps = self.d.getVar(varname, True)
+        deps = self.d.getVar(varname)
         if not deps:
             self.d.setVar("EXTENDPKGV", orig)
             return
@@ -87,7 +87,7 @@
         self.d.setVar("EXTENDPKGV", orig)
 
     def map_packagevars(self):
-        for pkg in (self.d.getVar("PACKAGES", True).split() + [""]):
+        for pkg in (self.d.getVar("PACKAGES").split() + [""]):
             self.map_depends_variable("RDEPENDS", pkg)
             self.map_depends_variable("RRECOMMENDS", pkg)
             self.map_depends_variable("RSUGGESTS", pkg)
@@ -97,7 +97,7 @@
             self.map_depends_variable("PKG", pkg)
 
     def rename_packages(self):
-        for pkg in (self.d.getVar("PACKAGES", True) or "").split():
+        for pkg in (self.d.getVar("PACKAGES") or "").split():
             if pkg.startswith(self.extname):
                self.pkgs_mapping.append([pkg.split(self.extname + "-")[1], pkg])
                continue
diff --git a/import-layers/yocto-poky/meta/lib/oe/classutils.py b/import-layers/yocto-poky/meta/lib/oe/classutils.py
index e7856c8..45cd524 100644
--- a/import-layers/yocto-poky/meta/lib/oe/classutils.py
+++ b/import-layers/yocto-poky/meta/lib/oe/classutils.py
@@ -36,7 +36,7 @@
     @classmethod
     def prioritized(tcls):
         return sorted(list(tcls.registry.values()),
-                      key=lambda v: v.priority, reverse=True)
+                      key=lambda v: (v.priority, v.name), reverse=True)
 
     def unregister(cls):
         for key in cls.registry.keys():
diff --git a/import-layers/yocto-poky/meta/lib/oe/copy_buildsystem.py b/import-layers/yocto-poky/meta/lib/oe/copy_buildsystem.py
index 29ac6d4..a372904 100644
--- a/import-layers/yocto-poky/meta/lib/oe/copy_buildsystem.py
+++ b/import-layers/yocto-poky/meta/lib/oe/copy_buildsystem.py
@@ -21,8 +21,8 @@
     def __init__(self, context, d):
         self.d = d
         self.context = context
-        self.layerdirs = [os.path.abspath(pth) for pth in d.getVar('BBLAYERS', True).split()]
-        self.layers_exclude = (d.getVar('SDK_LAYERS_EXCLUDE', True) or "").split()
+        self.layerdirs = [os.path.abspath(pth) for pth in d.getVar('BBLAYERS').split()]
+        self.layers_exclude = (d.getVar('SDK_LAYERS_EXCLUDE') or "").split()
 
     def copy_bitbake_and_layers(self, destdir, workspace_name=None):
         # Copy in all metadata layers + bitbake (as repositories)
@@ -30,7 +30,7 @@
         bb.utils.mkdirhier(destdir)
         layers = list(self.layerdirs)
 
-        corebase = os.path.abspath(self.d.getVar('COREBASE', True))
+        corebase = os.path.abspath(self.d.getVar('COREBASE'))
         layers.append(corebase)
 
         # Exclude layers
@@ -46,7 +46,7 @@
                 extranum += 1
                 workspace_newname = '%s-%d' % (workspace_name, extranum)
 
-        corebase_files = self.d.getVar('COREBASE_FILES', True).split()
+        corebase_files = self.d.getVar('COREBASE_FILES').split()
         corebase_files = [corebase + '/' +x for x in corebase_files]
         # Make sure bitbake goes in
         bitbake_dir = bb.__file__.rsplit('/', 3)[0]
@@ -100,7 +100,7 @@
                 # Drop all bbappends except the one for the image the SDK is being built for
                 # (because of externalsrc, the workspace bbappends will interfere with the
                 # locked signatures if present, and we don't need them anyway)
-                image_bbappend = os.path.splitext(os.path.basename(self.d.getVar('FILE', True)))[0] + '.bbappend'
+                image_bbappend = os.path.splitext(os.path.basename(self.d.getVar('FILE')))[0] + '.bbappend'
                 appenddir = os.path.join(layerdestpath, 'appends')
                 if os.path.isdir(appenddir):
                     for fn in os.listdir(appenddir):
@@ -208,7 +208,7 @@
     import shutil
     bb.note('Generating sstate-cache...')
 
-    nativelsbstring = d.getVar('NATIVELSBSTRING', True)
+    nativelsbstring = d.getVar('NATIVELSBSTRING')
     bb.process.run("gen-lockedsig-cache %s %s %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache, nativelsbstring, filterfile or ''))
     if fixedlsbstring and nativelsbstring != fixedlsbstring:
         nativedir = output_sstate_cache + '/' + nativelsbstring
diff --git a/import-layers/yocto-poky/meta/lib/oe/data.py b/import-layers/yocto-poky/meta/lib/oe/data.py
index ee48950..b8901e6 100644
--- a/import-layers/yocto-poky/meta/lib/oe/data.py
+++ b/import-layers/yocto-poky/meta/lib/oe/data.py
@@ -1,9 +1,10 @@
+import json
 import oe.maketype
 
 def typed_value(key, d):
     """Construct a value for the specified metadata variable, using its flags
     to determine the type and parameters for construction."""
-    var_type = d.getVarFlag(key, 'type', True)
+    var_type = d.getVarFlag(key, 'type')
     flags = d.getVarFlags(key)
     if flags is not None:
         flags = dict((flag, d.expand(value))
@@ -12,6 +13,35 @@
         flags = {}
 
     try:
-        return oe.maketype.create(d.getVar(key, True) or '', var_type, **flags)
+        return oe.maketype.create(d.getVar(key) or '', var_type, **flags)
     except (TypeError, ValueError) as exc:
         bb.msg.fatal("Data", "%s: %s" % (key, str(exc)))
+
+def export2json(d, json_file, expand=True, searchString="",replaceString=""):
+    data2export = {}
+    keys2export = []
+
+    for key in d.keys():
+        if key.startswith("_"):
+            continue
+        elif key.startswith("BB"):
+            continue
+        elif key.startswith("B_pn"):
+            continue
+        elif key.startswith("do_"):
+            continue
+        elif d.getVarFlag(key, "func"):
+            continue
+
+        keys2export.append(key)
+
+    for key in keys2export:
+        try:
+            data2export[key] = d.getVar(key, expand).replace(searchString,replaceString)
+        except bb.data_smart.ExpansionError:
+            data2export[key] = ''
+        except AttributeError:
+            pass
+
+    with open(json_file, "w") as f:
+        json.dump(data2export, f, skipkeys=True, indent=4, sort_keys=True)
diff --git a/import-layers/yocto-poky/meta/lib/oe/distro_check.py b/import-layers/yocto-poky/meta/lib/oe/distro_check.py
index 87c52fa..37f04ed 100644
--- a/import-layers/yocto-poky/meta/lib/oe/distro_check.py
+++ b/import-layers/yocto-poky/meta/lib/oe/distro_check.py
@@ -1,32 +1,17 @@
-from contextlib import contextmanager
-
-from bb.utils import export_proxies
-
 def create_socket(url, d):
     import urllib
+    from bb.utils import export_proxies
 
-    socket = None
-    try:
-        export_proxies(d)
-        socket = urllib.request.urlopen(url)
-    except:
-        bb.warn("distro_check: create_socket url %s can't access" % url)
-
-    return socket
+    export_proxies(d)
+    return urllib.request.urlopen(url)
 
 def get_links_from_url(url, d):
     "Return all the href links found on the web location"
 
     from bs4 import BeautifulSoup, SoupStrainer
 
+    soup = BeautifulSoup(create_socket(url,d), "html.parser", parse_only=SoupStrainer("a"))
     hyperlinks = []
-
-    webpage = ''
-    sock = create_socket(url,d)
-    if sock:
-        webpage = sock.read()
-
-    soup = BeautifulSoup(webpage, "html.parser", parse_only=SoupStrainer("a"))
     for line in soup.find_all('a', href=True):
         hyperlinks.append(line['href'].strip('/'))
     return hyperlinks
@@ -37,6 +22,7 @@
     maxstr=""
     for link in get_links_from_url(url, d):
         try:
+            # TODO use LooseVersion
             release = float(link)
         except:
             release = 0
@@ -47,144 +33,112 @@
 
 def is_src_rpm(name):
     "Check if the link is pointing to a src.rpm file"
-    if name[-8:] == ".src.rpm":
-        return True
-    else:
-        return False
+    return name.endswith(".src.rpm")
 
 def package_name_from_srpm(srpm):
     "Strip out the package name from the src.rpm filename"
-    strings = srpm.split('-')
-    package_name = strings[0]
-    for i in range(1, len (strings) - 1):
-        str = strings[i]
-        if not str[0].isdigit():
-            package_name += '-' + str
-    return package_name
 
-def clean_package_list(package_list):
-    "Removes multiple entries of packages and sorts the list"
-    set = {}
-    map(set.__setitem__, package_list, [])
-    return set.keys()
-
-
-def get_latest_released_meego_source_package_list(d):
-    "Returns list of all the name os packages in the latest meego distro"
-
-    package_names = []
-    try:
-        f = open("/tmp/Meego-1.1", "r")
-        for line in f:
-            package_names.append(line[:-1] + ":" + "main") # Also strip the '\n' at the end
-    except IOError: pass
-    package_list=clean_package_list(package_names)
-    return "1.0", package_list
+    # ca-certificates-2016.2.7-1.0.fc24.src.rpm
+    # ^name           ^ver     ^release^removed
+    (name, version, release) = srpm.replace(".src.rpm", "").rsplit("-", 2)
+    return name
 
 def get_source_package_list_from_url(url, section, d):
     "Return a sectioned list of package names from a URL list"
 
     bb.note("Reading %s: %s" % (url, section))
     links = get_links_from_url(url, d)
-    srpms = list(filter(is_src_rpm, links))
-    names_list = list(map(package_name_from_srpm, srpms))
+    srpms = filter(is_src_rpm, links)
+    names_list = map(package_name_from_srpm, srpms)
 
-    new_pkgs = []
+    new_pkgs = set()
     for pkgs in names_list:
-       new_pkgs.append(pkgs + ":" + section)
-
+       new_pkgs.add(pkgs + ":" + section)
     return new_pkgs
 
+def get_source_package_list_from_url_by_letter(url, section, d):
+    import string
+    from urllib.error import HTTPError
+    packages = set()
+    for letter in (string.ascii_lowercase + string.digits):
+        # Not all subfolders may exist, so silently handle 404
+        try:
+            packages |= get_source_package_list_from_url(url + "/" + letter, section, d)
+        except HTTPError as e:
+            if e.code != 404: raise
+    return packages
+
 def get_latest_released_fedora_source_package_list(d):
     "Returns list of all the name os packages in the latest fedora distro"
     latest = find_latest_numeric_release("http://archive.fedoraproject.org/pub/fedora/linux/releases/", d)
-
-    package_names = get_source_package_list_from_url("http://archive.fedoraproject.org/pub/fedora/linux/releases/%s/Fedora/source/SRPMS/" % latest, "main", d)
-
-#    package_names += get_source_package_list_from_url("http://download.fedora.redhat.com/pub/fedora/linux/releases/%s/Everything/source/SPRMS/" % latest, "everything")
-    package_names += get_source_package_list_from_url("http://archive.fedoraproject.org/pub/fedora/linux/updates/%s/SRPMS/" % latest, "updates", d)
-
-    package_list=clean_package_list(package_names)
-        
-    return latest, package_list
+    package_names = get_source_package_list_from_url_by_letter("http://archive.fedoraproject.org/pub/fedora/linux/releases/%s/Everything/source/tree/Packages/" % latest, "main", d)
+    package_names |= get_source_package_list_from_url_by_letter("http://archive.fedoraproject.org/pub/fedora/linux/updates/%s/SRPMS/" % latest, "updates", d)
+    return latest, package_names
 
 def get_latest_released_opensuse_source_package_list(d):
     "Returns list of all the name os packages in the latest opensuse distro"
     latest = find_latest_numeric_release("http://download.opensuse.org/source/distribution/",d)
 
     package_names = get_source_package_list_from_url("http://download.opensuse.org/source/distribution/%s/repo/oss/suse/src/" % latest, "main", d)
-    package_names += get_source_package_list_from_url("http://download.opensuse.org/update/%s/rpm/src/" % latest, "updates", d)
-
-    package_list=clean_package_list(package_names)
-    return latest, package_list
+    package_names |= get_source_package_list_from_url("http://download.opensuse.org/update/%s/src/" % latest, "updates", d)
+    return latest, package_names
 
 def get_latest_released_mandriva_source_package_list(d):
     "Returns list of all the name os packages in the latest mandriva distro"
     latest = find_latest_numeric_release("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/", d)
     package_names = get_source_package_list_from_url("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/%s/SRPMS/main/release/" % latest, "main", d)
-#    package_names += get_source_package_list_from_url("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/%s/SRPMS/contrib/release/" % latest, "contrib")
-    package_names += get_source_package_list_from_url("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/%s/SRPMS/main/updates/" % latest, "updates", d)
+    package_names |= get_source_package_list_from_url("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/%s/SRPMS/main/updates/" % latest, "updates", d)
+    return latest, package_names
 
-    package_list=clean_package_list(package_names)
-    return latest, package_list
+def get_latest_released_clear_source_package_list(d):
+    latest = find_latest_numeric_release("https://download.clearlinux.org/releases/", d)
+    package_names = get_source_package_list_from_url("https://download.clearlinux.org/releases/%s/clear/source/SRPMS/" % latest, "main", d)
+    return latest, package_names
 
 def find_latest_debian_release(url, d):
     "Find the latest listed debian release on the given url"
 
-    releases = []
-    for link in get_links_from_url(url, d):
-        if link[:6] == "Debian":
-            if ';' not in link:
-                releases.append(link)
+    releases = [link.replace("Debian", "")
+                for link in get_links_from_url(url, d)
+                if link.startswith("Debian")]
     releases.sort()
     try:
-        return releases.pop()[6:]
+        return releases[-1]
     except:
         return "_NotFound_"
 
 def get_debian_style_source_package_list(url, section, d):
     "Return the list of package-names stored in the debian style Sources.gz file"
-    import tempfile
     import gzip
 
-    webpage = ''
-    sock = create_socket(url,d)
-    if sock:
-        webpage = sock.read()
-
-    tmpfile = tempfile.NamedTemporaryFile(mode='wb', prefix='oecore.', suffix='.tmp', delete=False)
-    tmpfilename=tmpfile.name
-    tmpfile.write(sock.read())
-    tmpfile.close()
-    bb.note("Reading %s: %s" % (url, section))
-
-    f = gzip.open(tmpfilename)
-    package_names = []
-    for line in f:
-        if line[:9] == "Package: ":
-            package_names.append(line[9:-1] + ":" + section) # Also strip the '\n' at the end
-    os.unlink(tmpfilename)
-
+    package_names = set()
+    for line in gzip.open(create_socket(url, d), mode="rt"):
+        if line.startswith("Package:"):
+            pkg = line.split(":", 1)[1].strip()
+            package_names.add(pkg + ":" + section)
     return package_names
 
 def get_latest_released_debian_source_package_list(d):
-    "Returns list of all the name os packages in the latest debian distro"
+    "Returns list of all the name of packages in the latest debian distro"
     latest = find_latest_debian_release("http://ftp.debian.org/debian/dists/", d)
-    url = "http://ftp.debian.org/debian/dists/stable/main/source/Sources.gz" 
+    url = "http://ftp.debian.org/debian/dists/stable/main/source/Sources.gz"
     package_names = get_debian_style_source_package_list(url, "main", d)
-#    url = "http://ftp.debian.org/debian/dists/stable/contrib/source/Sources.gz" 
-#    package_names += get_debian_style_source_package_list(url, "contrib")
-    url = "http://ftp.debian.org/debian/dists/stable-proposed-updates/main/source/Sources.gz" 
-    package_names += get_debian_style_source_package_list(url, "updates", d)
-    package_list=clean_package_list(package_names)
-    return latest, package_list
+    url = "http://ftp.debian.org/debian/dists/stable-proposed-updates/main/source/Sources.gz"
+    package_names |= get_debian_style_source_package_list(url, "updates", d)
+    return latest, package_names
 
 def find_latest_ubuntu_release(url, d):
-    "Find the latest listed ubuntu release on the given url"
+    """
+    Find the latest listed Ubuntu release on the given ubuntu/dists/ URL.
+
+    To avoid matching development releases look for distributions that have
+    updates, so the resulting distro could be any supported release.
+    """
     url += "?C=M;O=D" # Descending Sort by Last Modified
     for link in get_links_from_url(url, d):
-        if link[-8:] == "-updates":
-            return link[:-8]
+        if "-updates" in link:
+            distro = link.replace("-updates", "")
+            return distro
     return "_NotFound_"
 
 def get_latest_released_ubuntu_source_package_list(d):
@@ -192,52 +146,45 @@
     latest = find_latest_ubuntu_release("http://archive.ubuntu.com/ubuntu/dists/", d)
     url = "http://archive.ubuntu.com/ubuntu/dists/%s/main/source/Sources.gz" % latest
     package_names = get_debian_style_source_package_list(url, "main", d)
-#    url = "http://archive.ubuntu.com/ubuntu/dists/%s/multiverse/source/Sources.gz" % latest
-#    package_names += get_debian_style_source_package_list(url, "multiverse")
-#    url = "http://archive.ubuntu.com/ubuntu/dists/%s/universe/source/Sources.gz" % latest
-#    package_names += get_debian_style_source_package_list(url, "universe")
     url = "http://archive.ubuntu.com/ubuntu/dists/%s-updates/main/source/Sources.gz" % latest
-    package_names += get_debian_style_source_package_list(url, "updates", d)
-    package_list=clean_package_list(package_names)
-    return latest, package_list
+    package_names |= get_debian_style_source_package_list(url, "updates", d)
+    return latest, package_names
 
 def create_distro_packages_list(distro_check_dir, d):
+    import shutil
+
     pkglst_dir = os.path.join(distro_check_dir, "package_lists")
-    if not os.path.isdir (pkglst_dir):
-        os.makedirs(pkglst_dir)
-    # first clear old stuff
-    for file in os.listdir(pkglst_dir):
-        os.unlink(os.path.join(pkglst_dir, file))
- 
-    per_distro_functions = [
-                            ["Debian", get_latest_released_debian_source_package_list],
-                            ["Ubuntu", get_latest_released_ubuntu_source_package_list],
-                            ["Fedora", get_latest_released_fedora_source_package_list],
-                            ["OpenSuSE", get_latest_released_opensuse_source_package_list],
-                            ["Mandriva", get_latest_released_mandriva_source_package_list],
-                            ["Meego", get_latest_released_meego_source_package_list]
-                           ]
- 
-    from datetime import datetime
-    begin = datetime.now()
-    for distro in per_distro_functions:
-        name = distro[0]
-        release, package_list = distro[1](d)
+    bb.utils.remove(pkglst_dir, True)
+    bb.utils.mkdirhier(pkglst_dir)
+
+    per_distro_functions = (
+                            ("Debian", get_latest_released_debian_source_package_list),
+                            ("Ubuntu", get_latest_released_ubuntu_source_package_list),
+                            ("Fedora", get_latest_released_fedora_source_package_list),
+                            ("OpenSuSE", get_latest_released_opensuse_source_package_list),
+                            ("Mandriva", get_latest_released_mandriva_source_package_list),
+                            ("Clear", get_latest_released_clear_source_package_list),
+                           )
+
+    for name, fetcher_func in per_distro_functions:
+        try:
+            release, package_list = fetcher_func(d)
+        except Exception as e:
+            bb.warn("Cannot fetch packages for %s: %s" % (name, e))
         bb.note("Distro: %s, Latest Release: %s, # src packages: %d" % (name, release, len(package_list)))
+        if len(package_list) == 0:
+            bb.error("Didn't fetch any packages for %s %s" % (name, release))
+
         package_list_file = os.path.join(pkglst_dir, name + "-" + release)
-        f = open(package_list_file, "w+b")
-        for pkg in package_list:
-            f.write(pkg + "\n")
-        f.close()
-    end = datetime.now()
-    delta = end - begin
-    bb.note("package_list generatiosn took this much time: %d seconds" % delta.seconds)
+        with open(package_list_file, 'w') as f:
+            for pkg in sorted(package_list):
+                f.write(pkg + "\n")
 
 def update_distro_data(distro_check_dir, datetime, d):
     """
-        If distro packages list data is old then rebuild it.
-        The operations has to be protected by a lock so that
-        only one thread performes it at a time.
+    If distro packages list data is old then rebuild it.
+    The operations has to be protected by a lock so that
+    only one thread performes it at a time.
     """
     if not os.path.isdir (distro_check_dir):
         try:
@@ -264,71 +211,59 @@
             f.seek(0)
             f.write(datetime)
 
-    except OSError:
-        raise Exception('Unable to read/write this file: %s' % (datetime_file))
+    except OSError as e:
+        raise Exception('Unable to open timestamp: %s' % e)
     finally:
         fcntl.lockf(f, fcntl.LOCK_UN)
         f.close()
- 
+
 def compare_in_distro_packages_list(distro_check_dir, d):
     if not os.path.isdir(distro_check_dir):
         raise Exception("compare_in_distro_packages_list: invalid distro_check_dir passed")
-        
+
     localdata = bb.data.createCopy(d)
     pkglst_dir = os.path.join(distro_check_dir, "package_lists")
     matching_distros = []
-    pn = d.getVar('PN', True)
-    recipe_name = d.getVar('PN', True)
+    pn = recipe_name = d.getVar('PN')
     bb.note("Checking: %s" % pn)
 
-    trim_dict = dict({"-native":"-native", "-cross":"-cross", "-initial":"-initial"})
-
     if pn.find("-native") != -1:
         pnstripped = pn.split("-native")
-        localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-        bb.data.update_data(localdata)
+        localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
         recipe_name = pnstripped[0]
 
     if pn.startswith("nativesdk-"):
         pnstripped = pn.split("nativesdk-")
-        localdata.setVar('OVERRIDES', "pn-" + pnstripped[1] + ":" + d.getVar('OVERRIDES', True))
-        bb.data.update_data(localdata)
+        localdata.setVar('OVERRIDES', "pn-" + pnstripped[1] + ":" + d.getVar('OVERRIDES'))
         recipe_name = pnstripped[1]
 
     if pn.find("-cross") != -1:
         pnstripped = pn.split("-cross")
-        localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-        bb.data.update_data(localdata)
+        localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
         recipe_name = pnstripped[0]
 
     if pn.find("-initial") != -1:
         pnstripped = pn.split("-initial")
-        localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
-        bb.data.update_data(localdata)
+        localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
         recipe_name = pnstripped[0]
 
     bb.note("Recipe: %s" % recipe_name)
-    tmp = localdata.getVar('DISTRO_PN_ALIAS', True)
 
     distro_exceptions = dict({"OE-Core":'OE-Core', "OpenedHand":'OpenedHand', "Intel":'Intel', "Upstream":'Upstream', "Windriver":'Windriver', "OSPDT":'OSPDT Approved', "Poky":'poky'})
-
-    if tmp:
-        list = tmp.split(' ')
-        for str in list:
-            if str and str.find("=") == -1 and distro_exceptions[str]:
-                matching_distros.append(str)
+    tmp = localdata.getVar('DISTRO_PN_ALIAS') or ""
+    for str in tmp.split():
+        if str and str.find("=") == -1 and distro_exceptions[str]:
+            matching_distros.append(str)
 
     distro_pn_aliases = {}
-    if tmp:
-        list = tmp.split(' ')
-        for str in list:
-            if str.find("=") != -1:
-                (dist, pn_alias) = str.split('=')
-                distro_pn_aliases[dist.strip().lower()] = pn_alias.strip()
- 
+    for str in tmp.split():
+        if "=" in str:
+            (dist, pn_alias) = str.split('=')
+            distro_pn_aliases[dist.strip().lower()] = pn_alias.strip()
+
     for file in os.listdir(pkglst_dir):
         (distro, distro_release) = file.split("-")
-        f = open(os.path.join(pkglst_dir, file), "rb")
+        f = open(os.path.join(pkglst_dir, file), "r")
         for line in f:
             (pkg, section) = line.split(":")
             if distro.lower() in distro_pn_aliases:
@@ -341,38 +276,34 @@
                 break
         f.close()
 
-    
-    if tmp != None:
-        list = tmp.split(' ')
-        for item in list:
-            matching_distros.append(item)
+    for item in tmp.split():
+        matching_distros.append(item)
     bb.note("Matching: %s" % matching_distros)
     return matching_distros
 
 def create_log_file(d, logname):
-    import subprocess
-    logpath = d.getVar('LOG_DIR', True)
+    logpath = d.getVar('LOG_DIR')
     bb.utils.mkdirhier(logpath)
     logfn, logsuffix = os.path.splitext(logname)
-    logfile = os.path.join(logpath, "%s.%s%s" % (logfn, d.getVar('DATETIME', True), logsuffix))
+    logfile = os.path.join(logpath, "%s.%s%s" % (logfn, d.getVar('DATETIME'), logsuffix))
     if not os.path.exists(logfile):
             slogfile = os.path.join(logpath, logname)
             if os.path.exists(slogfile):
                     os.remove(slogfile)
-            subprocess.call("touch %s" % logfile, shell=True)
+            open(logfile, 'w+').close()
             os.symlink(logfile, slogfile)
             d.setVar('LOG_FILE', logfile)
     return logfile
 
 
 def save_distro_check_result(result, datetime, result_file, d):
-    pn = d.getVar('PN', True)
-    logdir = d.getVar('LOG_DIR', True)
+    pn = d.getVar('PN')
+    logdir = d.getVar('LOG_DIR')
     if not logdir:
         bb.error("LOG_DIR variable is not defined, can't write the distro_check results")
         return
-    if not os.path.isdir(logdir):
-        os.makedirs(logdir)
+    bb.utils.mkdirhier(logdir)
+
     line = pn
     for i in result:
         line = line + "," + i
diff --git a/import-layers/yocto-poky/meta/lib/oe/gpg_sign.py b/import-layers/yocto-poky/meta/lib/oe/gpg_sign.py
index ba61f98..7ce767e 100644
--- a/import-layers/yocto-poky/meta/lib/oe/gpg_sign.py
+++ b/import-layers/yocto-poky/meta/lib/oe/gpg_sign.py
@@ -7,11 +7,11 @@
 class LocalSigner(object):
     """Class for handling local (on the build host) signing"""
     def __init__(self, d):
-        self.gpg_bin = d.getVar('GPG_BIN', True) or \
+        self.gpg_bin = d.getVar('GPG_BIN') or \
                   bb.utils.which(os.getenv('PATH'), 'gpg')
-        self.gpg_path = d.getVar('GPG_PATH', True)
+        self.gpg_path = d.getVar('GPG_PATH')
         self.gpg_version = self.get_gpg_version()
-        self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpm")
+        self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmsign")
 
     def export_pubkey(self, output_file, keyid, armor=True):
         """Export GPG public key to a file"""
@@ -31,9 +31,10 @@
         """Sign RPM files"""
 
         cmd = self.rpm_bin + " --addsign --define '_gpg_name %s'  " % keyid
-        cmd += "--define '_gpg_passphrase %s' " % passphrase
+        gpg_args = '--batch --passphrase=%s' % passphrase
         if self.gpg_version > (2,1,):
-            cmd += "--define '_gpg_sign_cmd_extra_args --pinentry-mode=loopback' "
+            gpg_args += ' --pinentry-mode=loopback'
+        cmd += "--define '_gpg_sign_cmd_extra_args %s' " % gpg_args
         if self.gpg_bin:
             cmd += "--define '%%__gpg %s' " % self.gpg_bin
         if self.gpg_path:
diff --git a/import-layers/yocto-poky/meta/lib/oe/lsb.py b/import-layers/yocto-poky/meta/lib/oe/lsb.py
index e0bdfba..3a945e0 100644
--- a/import-layers/yocto-poky/meta/lib/oe/lsb.py
+++ b/import-layers/yocto-poky/meta/lib/oe/lsb.py
@@ -1,26 +1,54 @@
-def release_dict():
-    """Return the output of lsb_release -ir as a dictionary"""
+def release_dict_osr():
+    """ Populate a dict with pertinent values from /etc/os-release """
+    if not os.path.exists('/etc/os-release'):
+        return None
+
+    data = {}
+    with open('/etc/os-release') as f:
+        for line in f:
+            try:
+                key, val = line.rstrip().split('=', 1)
+            except ValueError:
+                continue
+            if key == 'ID':
+                data['DISTRIB_ID'] = val.strip('"')
+            if key == 'VERSION_ID':
+                data['DISTRIB_RELEASE'] = val.strip('"')
+
+    return data
+
+def release_dict_lsb():
+    """ Return the output of lsb_release -ir as a dictionary """
     from subprocess import PIPE
 
     try:
         output, err = bb.process.run(['lsb_release', '-ir'], stderr=PIPE)
     except bb.process.CmdError as exc:
-        return None
+        return {}
+
+    lsb_map = { 'Distributor ID': 'DISTRIB_ID',
+                'Release': 'DISTRIB_RELEASE'}
+    lsb_keys = lsb_map.keys()
 
     data = {}
     for line in output.splitlines():
-        if line.startswith("-e"): line = line[3:]
+        if line.startswith("-e"):
+            line = line[3:]
         try:
             key, value = line.split(":\t", 1)
         except ValueError:
             continue
-        else:
-            data[key] = value
+        if key in lsb_keys:
+            data[lsb_map[key]] = value
+
+    if len(data.keys()) != 2:
+        return None
+
     return data
 
 def release_dict_file():
-    """ Try to gather LSB release information manually when lsb_release tool is unavailable """
-    data = None
+    """ Try to gather release information manually when other methods fail """
+    data = {}
     try:
         if os.path.exists('/etc/lsb-release'):
             data = {}
@@ -37,14 +65,6 @@
             if match:
                 data['DISTRIB_ID'] = match.group(1)
                 data['DISTRIB_RELEASE'] = match.group(2)
-        elif os.path.exists('/etc/os-release'):
-            data = {}
-            with open('/etc/os-release') as f:
-                for line in f:
-                    if line.startswith('NAME='):
-                        data['DISTRIB_ID'] = line[5:].rstrip().strip('"')
-                    if line.startswith('VERSION_ID='):
-                        data['DISTRIB_RELEASE'] = line[11:].rstrip().strip('"')
         elif os.path.exists('/etc/SuSE-release'):
             data = {}
             data['DISTRIB_ID'] = 'SUSE LINUX'
@@ -55,7 +75,7 @@
                         break
 
     except IOError:
-        return None
+        return {}
     return data
 
 def distro_identifier(adjust_hook=None):
@@ -64,15 +84,17 @@
 
     import re
 
-    lsb_data = release_dict()
-    if lsb_data:
-        distro_id, release = lsb_data['Distributor ID'], lsb_data['Release']
-    else:
-        lsb_data_file = release_dict_file()
-        if lsb_data_file:
-            distro_id, release = lsb_data_file['DISTRIB_ID'], lsb_data_file.get('DISTRIB_RELEASE', None)
-        else:
-            distro_id, release = None, None
+    # Try /etc/os-release first, then the output of `lsb_release -ir` and
+    # finally fall back on parsing various release files in order to determine
+    # host distro name and version.
+    distro_data = release_dict_osr()
+    if not distro_data:
+        distro_data = release_dict_lsb()
+    if not distro_data:
+        distro_data = release_dict_file()
+
+    distro_id = distro_data.get('DISTRIB_ID', '')
+    release = distro_data.get('DISTRIB_RELEASE', '')
 
     if adjust_hook:
         distro_id, release = adjust_hook(distro_id, release)
@@ -82,7 +104,7 @@
     distro_id = re.sub(r'\W', '', distro_id)
 
     if release:
-        id_str = '{0}-{1}'.format(distro_id, release)
+        id_str = '{0}-{1}'.format(distro_id.lower(), release)
     else:
         id_str = distro_id
     return id_str.replace(' ','-').replace('/','-')
diff --git a/import-layers/yocto-poky/meta/lib/oe/manifest.py b/import-layers/yocto-poky/meta/lib/oe/manifest.py
index 95f8eb2..60c49be 100644
--- a/import-layers/yocto-poky/meta/lib/oe/manifest.py
+++ b/import-layers/yocto-poky/meta/lib/oe/manifest.py
@@ -59,9 +59,9 @@
 
         if manifest_dir is None:
             if manifest_type != self.MANIFEST_TYPE_IMAGE:
-                self.manifest_dir = self.d.getVar('SDK_DIR', True)
+                self.manifest_dir = self.d.getVar('SDK_DIR')
             else:
-                self.manifest_dir = self.d.getVar('WORKDIR', True)
+                self.manifest_dir = self.d.getVar('WORKDIR')
         else:
             self.manifest_dir = manifest_dir
 
@@ -82,7 +82,7 @@
     This will be used for testing until the class is implemented properly!
     """
     def _create_dummy_initial(self):
-        image_rootfs = self.d.getVar('IMAGE_ROOTFS', True)
+        image_rootfs = self.d.getVar('IMAGE_ROOTFS')
         pkg_list = dict()
         if image_rootfs.find("core-image-sato-sdk") > 0:
             pkg_list[self.PKG_TYPE_MUST_INSTALL] = \
@@ -104,7 +104,7 @@
             pkg_list['lgp'] = \
                 "locale-base-en-us locale-base-en-gb"
         elif image_rootfs.find("core-image-minimal") > 0:
-            pkg_list[self.PKG_TYPE_MUST_INSTALL] = "run-postinsts packagegroup-core-boot"
+            pkg_list[self.PKG_TYPE_MUST_INSTALL] = "packagegroup-core-boot"
 
         with open(self.initial_manifest, "w+") as manifest:
             manifest.write(self.initial_manifest_file_header)
@@ -195,7 +195,7 @@
         for pkg in pkg_list.split():
             pkg_type = self.PKG_TYPE_MUST_INSTALL
 
-            ml_variants = self.d.getVar('MULTILIB_VARIANTS', True).split()
+            ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
 
             for ml_variant in ml_variants:
                 if pkg.startswith(ml_variant + '-'):
@@ -216,13 +216,13 @@
 
             for var in self.var_maps[self.manifest_type]:
                 if var in self.vars_to_split:
-                    split_pkgs = self._split_multilib(self.d.getVar(var, True))
+                    split_pkgs = self._split_multilib(self.d.getVar(var))
                     if split_pkgs is not None:
                         pkgs = dict(list(pkgs.items()) + list(split_pkgs.items()))
                 else:
-                    pkg_list = self.d.getVar(var, True)
+                    pkg_list = self.d.getVar(var)
                     if pkg_list is not None:
-                        pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var, True)
+                        pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var)
 
             for pkg_type in pkgs:
                 for pkg in pkgs[pkg_type].split():
@@ -245,7 +245,7 @@
         for pkg in pkg_list.split():
             pkg_type = self.PKG_TYPE_MUST_INSTALL
 
-            ml_variants = self.d.getVar('MULTILIB_VARIANTS', True).split()
+            ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
 
             for ml_variant in ml_variants:
                 if pkg.startswith(ml_variant + '-'):
@@ -266,13 +266,13 @@
 
             for var in self.var_maps[self.manifest_type]:
                 if var in self.vars_to_split:
-                    split_pkgs = self._split_multilib(self.d.getVar(var, True))
+                    split_pkgs = self._split_multilib(self.d.getVar(var))
                     if split_pkgs is not None:
                         pkgs = dict(list(pkgs.items()) + list(split_pkgs.items()))
                 else:
-                    pkg_list = self.d.getVar(var, True)
+                    pkg_list = self.d.getVar(var)
                     if pkg_list is not None:
-                        pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var, True)
+                        pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var)
 
             for pkg_type in pkgs:
                 for pkg in pkgs[pkg_type].split():
@@ -310,7 +310,7 @@
             manifest.write(self.initial_manifest_file_header)
 
             for var in self.var_maps[self.manifest_type]:
-                pkg_list = self.d.getVar(var, True)
+                pkg_list = self.d.getVar(var)
 
                 if pkg_list is None:
                     continue
@@ -332,7 +332,7 @@
                     'ipk': OpkgManifest,
                     'deb': DpkgManifest}
 
-    manifest = manifest_map[d.getVar('IMAGE_PKGTYPE', True)](d, manifest_dir, manifest_type)
+    manifest = manifest_map[d.getVar('IMAGE_PKGTYPE')](d, manifest_dir, manifest_type)
 
     if final_manifest:
         manifest.create_final()
diff --git a/import-layers/yocto-poky/meta/lib/oe/package.py b/import-layers/yocto-poky/meta/lib/oe/package.py
index 02642f2..4797e7d 100644
--- a/import-layers/yocto-poky/meta/lib/oe/package.py
+++ b/import-layers/yocto-poky/meta/lib/oe/package.py
@@ -18,23 +18,24 @@
         newmode = origmode | stat.S_IWRITE | stat.S_IREAD
         os.chmod(file, newmode)
 
-    extraflags = ""
+    stripcmd = [strip]
 
     # kernel module    
     if elftype & 16:
-        extraflags = "--strip-debug --remove-section=.comment --remove-section=.note --preserve-dates"
+        stripcmd.extend(["--strip-debug", "--remove-section=.comment",
+            "--remove-section=.note", "--preserve-dates"])
     # .so and shared library
     elif ".so" in file and elftype & 8:
-        extraflags = "--remove-section=.comment --remove-section=.note --strip-unneeded"
+        stripcmd.extend(["--remove-section=.comment", "--remove-section=.note", "--strip-unneeded"])
     # shared or executable:
     elif elftype & 8 or elftype & 4:
-        extraflags = "--remove-section=.comment --remove-section=.note"
+        stripcmd.extend(["--remove-section=.comment", "--remove-section=.note"])
 
-    stripcmd = "'%s' %s '%s'" % (strip, extraflags, file)
+    stripcmd.append(file)
     bb.debug(1, "runstrip: %s" % stripcmd)
 
     try:
-        output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT, shell=True)
+        output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT)
     except subprocess.CalledProcessError as e:
         bb.error("runstrip: '%s' strip command failed with %s (%s)" % (stripcmd, e.returncode, e.output))
 
@@ -60,32 +61,59 @@
     provides = {}
     requires = {}
 
-    r = re.compile(r'[<>=]+ +[^ ]*')
+    file_re = re.compile(r'\s+\d+\s(.*)')
+    dep_re = re.compile(r'\s+(\S)\s+(.*)')
+    r = re.compile(r'[<>=]+\s+\S*')
 
     def process_deps(pipe, pkg, pkgdest, provides, requires):
+        file = None
         for line in pipe:
-            f = line.decode("utf-8").split(" ", 1)[0].strip()
-            line = line.decode("utf-8").split(" ", 1)[1].strip()
+            line = line.decode("utf-8")
 
-            if line.startswith("Requires:"):
+            m = file_re.match(line)
+            if m:
+                file = m.group(1)
+                file = file.replace(pkgdest + "/" + pkg, "")
+                file = file_translate(file)
+                continue
+
+            m = dep_re.match(line)
+            if not m or not file:
+                continue
+
+            type, dep = m.groups()
+
+            if type == 'R':
                 i = requires
-            elif line.startswith("Provides:"):
+            elif type == 'P':
                 i = provides
             else:
+               continue
+
+            if dep.startswith("python("):
                 continue
 
-            file = f.replace(pkgdest + "/" + pkg, "")
-            file = file_translate(file)
-            value = line.split(":", 1)[1].strip()
-            value = r.sub(r'(\g<0>)', value)
+            # Ignore all perl(VMS::...) and perl(Mac::...) dependencies. These
+            # are typically used conditionally from the Perl code, but are
+            # generated as unconditional dependencies.
+            if dep.startswith('perl(VMS::') or dep.startswith('perl(Mac::'):
+                continue
 
-            if value.startswith("rpmlib("):
+            # Ignore perl dependencies on .pl files.
+            if dep.startswith('perl(') and dep.endswith('.pl)'):
                 continue
-            if value == "python":
-                continue
+
+            # Remove perl versions and perl module versions since they typically
+            # do not make sense when used as package versions.
+            if dep.startswith('perl') and r.search(dep):
+                dep = dep.split()[0]
+
+            # Put parentheses around any version specifications.
+            dep = r.sub(r'(\g<0>)',dep)
+
             if file not in i:
                 i[file] = []
-            i[file].append(value)
+            i[file].append(dep)
 
         return provides, requires
 
@@ -103,7 +131,7 @@
     import re
 
     shlib_provider = {}
-    shlibs_dirs = d.getVar('SHLIBSDIRS', True).split()
+    shlibs_dirs = d.getVar('SHLIBSDIRS').split()
     list_re = re.compile('^(.*)\.list$')
     # Go from least to most specific since the last one found wins
     for dir in reversed(shlibs_dirs):
@@ -149,6 +177,7 @@
                         continue
                     pkgitems.append(pathitem)
                 pkgname = '-'.join(pkgitems).replace('_', '-')
+                pkgname = pkgname.replace('@', '')
                 pkgfile = os.path.join(root, dn, 'package.json')
                 data = None
                 if os.path.exists(pkgfile):
diff --git a/import-layers/yocto-poky/meta/lib/oe/package_manager.py b/import-layers/yocto-poky/meta/lib/oe/package_manager.py
index 13577b1..3a2daad 100644
--- a/import-layers/yocto-poky/meta/lib/oe/package_manager.py
+++ b/import-layers/yocto-poky/meta/lib/oe/package_manager.py
@@ -102,108 +102,14 @@
 
 
 class RpmIndexer(Indexer):
-    def get_ml_prefix_and_os_list(self, arch_var=None, os_var=None):
-        package_archs = collections.OrderedDict()
-        target_os = collections.OrderedDict()
-
-        if arch_var is not None and os_var is not None:
-            package_archs['default'] = self.d.getVar(arch_var, True).split()
-            package_archs['default'].reverse()
-            target_os['default'] = self.d.getVar(os_var, True).strip()
-        else:
-            package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split()
-            # arch order is reversed.  This ensures the -best- match is
-            # listed first!
-            package_archs['default'].reverse()
-            target_os['default'] = self.d.getVar("TARGET_OS", True).strip()
-            multilibs = self.d.getVar('MULTILIBS', True) or ""
-            for ext in multilibs.split():
-                eext = ext.split(':')
-                if len(eext) > 1 and eext[0] == 'multilib':
-                    localdata = bb.data.createCopy(self.d)
-                    default_tune_key = "DEFAULTTUNE_virtclass-multilib-" + eext[1]
-                    default_tune = localdata.getVar(default_tune_key, False)
-                    if default_tune is None:
-                        default_tune_key = "DEFAULTTUNE_ML_" + eext[1]
-                        default_tune = localdata.getVar(default_tune_key, False)
-                    if default_tune:
-                        localdata.setVar("DEFAULTTUNE", default_tune)
-                        bb.data.update_data(localdata)
-                        package_archs[eext[1]] = localdata.getVar('PACKAGE_ARCHS',
-                                                                  True).split()
-                        package_archs[eext[1]].reverse()
-                        target_os[eext[1]] = localdata.getVar("TARGET_OS",
-                                                              True).strip()
-
-        ml_prefix_list = collections.OrderedDict()
-        for mlib in package_archs:
-            if mlib == 'default':
-                ml_prefix_list[mlib] = package_archs[mlib]
-            else:
-                ml_prefix_list[mlib] = list()
-                for arch in package_archs[mlib]:
-                    if arch in ['all', 'noarch', 'any']:
-                        ml_prefix_list[mlib].append(arch)
-                    else:
-                        ml_prefix_list[mlib].append(mlib + "_" + arch)
-
-        return (ml_prefix_list, target_os)
-
     def write_index(self):
-        sdk_pkg_archs = (self.d.getVar('SDK_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
-        all_mlb_pkg_archs = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
+        if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
+            raise NotImplementedError('Package feed signing not yet implementd for rpm')
 
-        mlb_prefix_list = self.get_ml_prefix_and_os_list()[0]
-
-        archs = set()
-        for item in mlb_prefix_list:
-            archs = archs.union(set(i.replace('-', '_') for i in mlb_prefix_list[item]))
-
-        if len(archs) == 0:
-            archs = archs.union(set(all_mlb_pkg_archs))
-
-        archs = archs.union(set(sdk_pkg_archs))
-
-        rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo")
-        if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
-            signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND', True))
-        else:
-            signer = None
-        index_cmds = []
-        repomd_files = []
-        rpm_dirs_found = False
-        for arch in archs:
-            dbpath = os.path.join(self.d.getVar('WORKDIR', True), 'rpmdb', arch)
-            if os.path.exists(dbpath):
-                bb.utils.remove(dbpath, True)
-            arch_dir = os.path.join(self.deploy_dir, arch)
-            if not os.path.isdir(arch_dir):
-                continue
-
-            index_cmds.append("%s --dbpath %s --update -q %s" % \
-                             (rpm_createrepo, dbpath, arch_dir))
-            repomd_files.append(os.path.join(arch_dir, 'repodata', 'repomd.xml'))
-
-            rpm_dirs_found = True
-
-        if not rpm_dirs_found:
-            bb.note("There are no packages in %s" % self.deploy_dir)
-            return
-
-        # Create repodata
-        result = oe.utils.multiprocess_exec(index_cmds, create_index)
+        createrepo_c = bb.utils.which(os.environ['PATH'], "createrepo_c")
+        result = create_index("%s --update -q %s" % (createrepo_c, self.deploy_dir))
         if result:
-            bb.fatal('%s' % ('\n'.join(result)))
-        # Sign repomd
-        if signer:
-            for repomd in repomd_files:
-                feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE', True)
-                is_ascii_sig = (feed_sig_type.upper() != "BIN")
-                signer.detach_sign(repomd,
-                                   self.d.getVar('PACKAGE_FEED_GPG_NAME', True),
-                                   self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True),
-                                   armor=is_ascii_sig)
-
+            bb.fatal(result)
 
 class OpkgIndexer(Indexer):
     def write_index(self):
@@ -212,8 +118,8 @@
                      "MULTILIB_ARCHS"]
 
         opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index")
-        if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
-            signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND', True))
+        if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
+            signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
         else:
             signer = None
 
@@ -223,7 +129,7 @@
         index_cmds = set()
         index_sign_files = set()
         for arch_var in arch_vars:
-            archs = self.d.getVar(arch_var, True)
+            archs = self.d.getVar(arch_var)
             if archs is None:
                 continue
 
@@ -251,12 +157,12 @@
             bb.fatal('%s' % ('\n'.join(result)))
 
         if signer:
-            feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE', True)
+            feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
             is_ascii_sig = (feed_sig_type.upper() != "BIN")
             for f in index_sign_files:
                 signer.detach_sign(f,
-                                   self.d.getVar('PACKAGE_FEED_GPG_NAME', True),
-                                   self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True),
+                                   self.d.getVar('PACKAGE_FEED_GPG_NAME'),
+                                   self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
                                    armor=is_ascii_sig)
 
 
@@ -290,16 +196,16 @@
 
         os.environ['APT_CONFIG'] = self.apt_conf_file
 
-        pkg_archs = self.d.getVar('PACKAGE_ARCHS', True)
+        pkg_archs = self.d.getVar('PACKAGE_ARCHS')
         if pkg_archs is not None:
             arch_list = pkg_archs.split()
-        sdk_pkg_archs = self.d.getVar('SDK_PACKAGE_ARCHS', True)
+        sdk_pkg_archs = self.d.getVar('SDK_PACKAGE_ARCHS')
         if sdk_pkg_archs is not None:
             for a in sdk_pkg_archs.split():
                 if a not in pkg_archs:
                     arch_list.append(a)
 
-        all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").split()
+        all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or "").split()
         arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in arch_list)
 
         apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive")
@@ -332,7 +238,7 @@
         result = oe.utils.multiprocess_exec(index_cmds, create_index)
         if result:
             bb.fatal('%s' % ('\n'.join(result)))
-        if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
+        if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
             raise NotImplementedError('Package feed signing not implementd for dpkg')
 
 
@@ -346,119 +252,9 @@
     def list_pkgs(self):
         pass
 
-
 class RpmPkgsList(PkgsList):
-    def __init__(self, d, rootfs_dir, arch_var=None, os_var=None):
-        super(RpmPkgsList, self).__init__(d, rootfs_dir)
-
-        self.rpm_cmd = bb.utils.which(os.getenv('PATH'), "rpm")
-        self.image_rpmlib = os.path.join(self.rootfs_dir, 'var/lib/rpm')
-
-        self.ml_prefix_list, self.ml_os_list = \
-            RpmIndexer(d, rootfs_dir).get_ml_prefix_and_os_list(arch_var, os_var)
-
-        # Determine rpm version
-        cmd = "%s --version" % self.rpm_cmd
-        try:
-            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
-        except subprocess.CalledProcessError as e:
-            bb.fatal("Getting rpm version failed. Command '%s' "
-                     "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
-
-    '''
-    Translate the RPM/Smart format names to the OE multilib format names
-    '''
-    def _pkg_translate_smart_to_oe(self, pkg, arch):
-        new_pkg = pkg
-        new_arch = arch
-        fixed_arch = arch.replace('_', '-')
-        found = 0
-        for mlib in self.ml_prefix_list:
-            for cmp_arch in self.ml_prefix_list[mlib]:
-                fixed_cmp_arch = cmp_arch.replace('_', '-')
-                if fixed_arch == fixed_cmp_arch:
-                    if mlib == 'default':
-                        new_pkg = pkg
-                        new_arch = cmp_arch
-                    else:
-                        new_pkg = mlib + '-' + pkg
-                        # We need to strip off the ${mlib}_ prefix on the arch
-                        new_arch = cmp_arch.replace(mlib + '_', '')
-
-                    # Workaround for bug 3565. Simply look to see if we
-                    # know of a package with that name, if not try again!
-                    filename = os.path.join(self.d.getVar('PKGDATA_DIR', True),
-                                            'runtime-reverse',
-                                            new_pkg)
-                    if os.path.exists(filename):
-                        found = 1
-                        break
-
-            if found == 1 and fixed_arch == fixed_cmp_arch:
-                break
-        #bb.note('%s, %s -> %s, %s' % (pkg, arch, new_pkg, new_arch))
-        return new_pkg, new_arch
-
-    def _list_pkg_deps(self):
-        cmd = [bb.utils.which(os.getenv('PATH'), "rpmresolve"),
-               "-t", self.image_rpmlib]
-
-        try:
-            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip().decode("utf-8")
-        except subprocess.CalledProcessError as e:
-            bb.fatal("Cannot get the package dependencies. Command '%s' "
-                     "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
-
-        return output
-
     def list_pkgs(self):
-        cmd = self.rpm_cmd + ' --root ' + self.rootfs_dir
-        cmd += ' -D "_dbpath /var/lib/rpm" -qa'
-        cmd += " --qf '[%{NAME} %{ARCH} %{VERSION} %{PACKAGEORIGIN}\n]'"
-
-        try:
-            # bb.note(cmd)
-            tmp_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip().decode("utf-8")
-        except subprocess.CalledProcessError as e:
-            bb.fatal("Cannot get the installed packages list. Command '%s' "
-                     "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
-
-        output = dict()
-        deps = dict()
-        dependencies = self._list_pkg_deps()
-
-        # Populate deps dictionary for better manipulation
-        for line in dependencies.splitlines():
-            try:
-                pkg, dep = line.split("|")
-                if not pkg in deps:
-                    deps[pkg] = list()
-                if not dep in deps[pkg]:
-                    deps[pkg].append(dep)
-            except:
-                # Ignore any other lines they're debug or errors
-                pass
-
-        for line in tmp_output.split('\n'):
-            if len(line.strip()) == 0:
-                continue
-            pkg = line.split()[0]
-            arch = line.split()[1]
-            ver = line.split()[2]
-            dep = deps.get(pkg, [])
-
-            # Skip GPG keys
-            if pkg == 'gpg-pubkey':
-                continue
-
-            pkgorigin = line.split()[3]
-            new_pkg, new_arch = self._pkg_translate_smart_to_oe(pkg, arch)
-
-            output[new_pkg] = {"arch":new_arch, "ver":ver,
-                        "filename":pkgorigin, "deps":dep}
-
-        return output
-
+        return RpmPM(self.d, self.rootfs_dir, self.d.getVar('TARGET_VENDOR')).list_installed()
 
 class OpkgPkgsList(PkgsList):
     def __init__(self, d, rootfs_dir, config_file):
@@ -466,7 +262,7 @@
 
         self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
         self.opkg_args = "-f %s -o %s " % (config_file, rootfs_dir)
-        self.opkg_args += self.d.getVar("OPKG_ARGS", True)
+        self.opkg_args += self.d.getVar("OPKG_ARGS")
 
     def list_pkgs(self, format=None):
         cmd = "%s %s status" % (self.opkg_cmd, self.opkg_args)
@@ -514,9 +310,6 @@
         self.d = d
         self.deploy_dir = None
         self.deploy_lock = None
-        self.feed_uris = self.d.getVar('PACKAGE_FEED_URIS', True) or ""
-        self.feed_base_paths = self.d.getVar('PACKAGE_FEED_BASE_PATHS', True) or ""
-        self.feed_archs = self.d.getVar('PACKAGE_FEED_ARCHS', True)
 
     """
     Update the package manager package database.
@@ -556,8 +349,24 @@
     def list_installed(self):
         pass
 
+    """
+    Returns the path to a tmpdir where resides the contents of a package.
+
+    Deleting the tmpdir is responsability of the caller.
+
+    """
     @abstractmethod
-    def insert_feeds_uris(self):
+    def extract(self, pkg):
+        pass
+
+    """
+    Add remote package feeds into repository manager configuration. The parameters
+    for the feeds are set by feed_uris, feed_base_paths and feed_archs.
+    See http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-PACKAGE_FEED_URIS
+    for their description.
+    """
+    @abstractmethod
+    def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
         pass
 
     """
@@ -568,20 +377,11 @@
     installation
     """
     def install_complementary(self, globs=None):
-        # we need to write the list of installed packages to a file because the
-        # oe-pkgdata-util reads it from a file
-        installed_pkgs_file = os.path.join(self.d.getVar('WORKDIR', True),
-                                           "installed_pkgs.txt")
-        with open(installed_pkgs_file, "w+") as installed_pkgs:
-            pkgs = self.list_installed()
-            output = oe.utils.format_pkg_list(pkgs, "arch")
-            installed_pkgs.write(output)
-
         if globs is None:
-            globs = self.d.getVar('IMAGE_INSTALL_COMPLEMENTARY', True)
+            globs = self.d.getVar('IMAGE_INSTALL_COMPLEMENTARY')
             split_linguas = set()
 
-            for translation in self.d.getVar('IMAGE_LINGUAS', True).split():
+            for translation in self.d.getVar('IMAGE_LINGUAS').split():
                 split_linguas.add(translation)
                 split_linguas.add(translation.split('-')[0])
 
@@ -593,22 +393,29 @@
         if globs is None:
             return
 
-        cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
-               "-p", self.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file,
-               globs]
-        exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY', True)
-        if exclude:
-            cmd.extend(['--exclude=' + '|'.join(exclude.split())])
-        try:
-            bb.note("Installing complementary packages ...")
-            bb.note('Running %s' % cmd)
-            complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
-        except subprocess.CalledProcessError as e:
-            bb.fatal("Could not compute complementary packages list. Command "
-                     "'%s' returned %d:\n%s" %
-                     (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
-        self.install(complementary_pkgs.split(), attempt_only=True)
-        os.remove(installed_pkgs_file)
+        # we need to write the list of installed packages to a file because the
+        # oe-pkgdata-util reads it from a file
+        with tempfile.NamedTemporaryFile(mode="w+", prefix="installed-pkgs") as installed_pkgs:
+            pkgs = self.list_installed()
+            output = oe.utils.format_pkg_list(pkgs, "arch")
+            installed_pkgs.write(output)
+            installed_pkgs.flush()
+
+            cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
+                   "-p", self.d.getVar('PKGDATA_DIR'), "glob", installed_pkgs.name,
+                   globs]
+            exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY')
+            if exclude:
+                cmd.extend(['--exclude=' + '|'.join(exclude.split())])
+            try:
+                bb.note("Installing complementary packages ...")
+                bb.note('Running %s' % cmd)
+                complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
+            except subprocess.CalledProcessError as e:
+                bb.fatal("Could not compute complementary packages list. Command "
+                         "'%s' returned %d:\n%s" %
+                         (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
+            self.install(complementary_pkgs.split(), attempt_only=True)
 
     def deploy_dir_lock(self):
         if self.deploy_dir is None:
@@ -654,829 +461,299 @@
                  task_name='target',
                  providename=None,
                  arch_var=None,
-                 os_var=None):
+                 os_var=None,
+                 rpm_repo_workdir="oe-rootfs-repo"):
         super(RpmPM, self).__init__(d)
         self.target_rootfs = target_rootfs
         self.target_vendor = target_vendor
         self.task_name = task_name
-        self.providename = providename
-        self.fullpkglist = list()
-        self.deploy_dir = self.d.getVar('DEPLOY_DIR_RPM', True)
-        self.etcrpm_dir = os.path.join(self.target_rootfs, "etc/rpm")
-        self.install_dir_name = "oe_install"
-        self.install_dir_path = os.path.join(self.target_rootfs, self.install_dir_name)
-        self.rpm_cmd = bb.utils.which(os.getenv('PATH'), "rpm")
-        self.smart_cmd = bb.utils.which(os.getenv('PATH'), "smart")
-        # 0 = default, only warnings
-        # 1 = --log-level=info (includes information about executing scriptlets and their output)
-        # 2 = --log-level=debug
-        # 3 = --log-level=debug plus dumps of scriplet content and command invocation
-        self.debug_level = int(d.getVar('ROOTFS_RPM_DEBUG', True) or "0")
-        self.smart_opt = "--log-level=%s --data-dir=%s" % \
-                         ("warning" if self.debug_level == 0 else
-                          "info" if self.debug_level == 1 else
-                          "debug",
-                          os.path.join(target_rootfs, 'var/lib/smart'))
-        self.scriptlet_wrapper = self.d.expand('${WORKDIR}/scriptlet_wrapper')
+        if arch_var == None:
+            self.archs = self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS').replace("-","_")
+        else:
+            self.archs = self.d.getVar(arch_var).replace("-","_")
+        if task_name == "host":
+            self.primary_arch = self.d.getVar('SDK_ARCH')
+        else:
+            self.primary_arch = self.d.getVar('MACHINE_ARCH')
+
+        self.rpm_repo_dir = oe.path.join(self.d.getVar('WORKDIR'), rpm_repo_workdir)
+        bb.utils.mkdirhier(self.rpm_repo_dir)
+        oe.path.symlink(self.d.getVar('DEPLOY_DIR_RPM'), oe.path.join(self.rpm_repo_dir, "rpm"), True)
+
+        self.saved_packaging_data = self.d.expand('${T}/saved_packaging_data/%s' % self.task_name)
+        if not os.path.exists(self.d.expand('${T}/saved_packaging_data')):
+            bb.utils.mkdirhier(self.d.expand('${T}/saved_packaging_data'))
+        self.packaging_data_dirs = ['var/lib/rpm', 'var/lib/dnf', 'var/cache/dnf']
         self.solution_manifest = self.d.expand('${T}/saved/%s_solution' %
                                                self.task_name)
-        self.saved_rpmlib = self.d.expand('${T}/saved/%s' % self.task_name)
-        self.image_rpmlib = os.path.join(self.target_rootfs, 'var/lib/rpm')
-
         if not os.path.exists(self.d.expand('${T}/saved')):
             bb.utils.mkdirhier(self.d.expand('${T}/saved'))
 
-        packageindex_dir = os.path.join(self.d.getVar('WORKDIR', True), 'rpms')
-        self.indexer = RpmIndexer(self.d, packageindex_dir)
-        self.pkgs_list = RpmPkgsList(self.d, self.target_rootfs, arch_var, os_var)
+    def _configure_dnf(self):
+        # libsolv handles 'noarch' internally, we don't need to specify it explicitly
+        archs = [i for i in reversed(self.archs.split()) if i not in ["any", "all", "noarch"]]
+        # This prevents accidental matching against libsolv's built-in policies
+        if len(archs) <= 1:
+            archs = archs + ["bogusarch"]
+        confdir = "%s/%s" %(self.target_rootfs, "etc/dnf/vars/")
+        bb.utils.mkdirhier(confdir)
+        open(confdir + "arch", 'w').write(":".join(archs))
+        distro_codename = self.d.getVar('DISTRO_CODENAME')
+        open(confdir + "releasever", 'w').write(distro_codename if distro_codename is not None else '')
 
-        self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var)
+        open(oe.path.join(self.target_rootfs, "etc/dnf/dnf.conf"), 'w').write("")
 
-    def insert_feeds_uris(self):
-        if self.feed_uris == "":
-            return
 
-        arch_list = []
-        if self.feed_archs is not None:
-            # User define feed architectures
-            arch_list = self.feed_archs.split()
+    def _configure_rpm(self):
+        # We need to configure rpm to use our primary package architecture as the installation architecture,
+        # and to make it compatible with other package architectures that we use.
+        # Otherwise it will refuse to proceed with packages installation.
+        platformconfdir = "%s/%s" %(self.target_rootfs, "etc/rpm/")
+        rpmrcconfdir = "%s/%s" %(self.target_rootfs, "etc/")
+        bb.utils.mkdirhier(platformconfdir)
+        open(platformconfdir + "platform", 'w').write("%s-pc-linux" % self.primary_arch)
+        open(rpmrcconfdir + "rpmrc", 'w').write("arch_compat: %s: %s\n" % (self.primary_arch, self.archs if len(self.archs) > 0 else self.primary_arch))
+
+        open(platformconfdir + "macros", 'w').write("%_transaction_color 7\n")
+        if self.d.getVar('RPM_PREFER_ELF_ARCH'):
+            open(platformconfdir + "macros", 'a').write("%%_prefer_color %s" % (self.d.getVar('RPM_PREFER_ELF_ARCH')))
         else:
-            # List must be prefered to least preferred order
-            default_platform_extra = list()
-            platform_extra = list()
-            bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or ""
-            for mlib in self.ml_os_list:
-                for arch in self.ml_prefix_list[mlib]:
-                    plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib]
-                    if mlib == bbextendvariant:
-                        if plt not in default_platform_extra:
-                            default_platform_extra.append(plt)
-                    else:
-                        if plt not in platform_extra:
-                            platform_extra.append(plt)
-            platform_extra = default_platform_extra + platform_extra
+            open(platformconfdir + "macros", 'a').write("%_prefer_color 7")
 
-            for canonical_arch in platform_extra:
-                arch = canonical_arch.split('-')[0]
-                if not os.path.exists(os.path.join(self.deploy_dir, arch)):
-                    continue
-                arch_list.append(arch)
+        if self.d.getVar('RPM_SIGN_PACKAGES') == '1':
+            signer = get_signer(self.d, self.d.getVar('RPM_GPG_BACKEND'))
+            pubkey_path = oe.path.join(self.d.getVar('B'), 'rpm-key')
+            signer.export_pubkey(pubkey_path, self.d.getVar('RPM_GPG_NAME'))
+            rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmkeys")
+            cmd = [rpm_bin, '--root=%s' % self.target_rootfs, '--import', pubkey_path]
+            try:
+                subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+            except subprocess.CalledProcessError as e:
+                bb.fatal("Importing GPG key failed. Command '%s' "
+                        "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
 
-        feed_uris = self.construct_uris(self.feed_uris.split(), self.feed_base_paths.split())
-
-        uri_iterator = 0
-        channel_priority = 10 + 5 * len(feed_uris) * (len(arch_list) if arch_list else 1)
-
-        for uri in feed_uris:
-            if arch_list:
-                for arch in arch_list:
-                    bb.note('Adding Smart channel url%d%s (%s)' %
-                            (uri_iterator, arch, channel_priority))
-                    self._invoke_smart('channel --add url%d-%s type=rpm-md baseurl=%s/%s -y'
-                                       % (uri_iterator, arch, uri, arch))
-                    self._invoke_smart('channel --set url%d-%s priority=%d' %
-                                       (uri_iterator, arch, channel_priority))
-                    channel_priority -= 5
-            else:
-                bb.note('Adding Smart channel url%d (%s)' %
-                        (uri_iterator, channel_priority))
-                self._invoke_smart('channel --add url%d type=rpm-md baseurl=%s -y'
-                                   % (uri_iterator, uri))
-                self._invoke_smart('channel --set url%d priority=%d' %
-                                   (uri_iterator, channel_priority))
-                channel_priority -= 5
-
-            uri_iterator += 1
-
-    '''
-    Create configs for rpm and smart, and multilib is supported
-    '''
     def create_configs(self):
-        target_arch = self.d.getVar('TARGET_ARCH', True)
-        platform = '%s%s-%s' % (target_arch.replace('-', '_'),
-                                self.target_vendor,
-                                self.ml_os_list['default'])
-
-        # List must be prefered to least preferred order
-        default_platform_extra = list()
-        platform_extra = list()
-        bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or ""
-        for mlib in self.ml_os_list:
-            for arch in self.ml_prefix_list[mlib]:
-                plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib]
-                if mlib == bbextendvariant:
-                    if plt not in default_platform_extra:
-                        default_platform_extra.append(plt)
-                else:
-                    if plt not in platform_extra:
-                        platform_extra.append(plt)
-        platform_extra = default_platform_extra + platform_extra
-
-        self._create_configs(platform, platform_extra)
-
-    def _invoke_smart(self, args):
-        cmd = "%s %s %s" % (self.smart_cmd, self.smart_opt, args)
-        # bb.note(cmd)
-        try:
-            complementary_pkgs = subprocess.check_output(cmd,
-                                                         stderr=subprocess.STDOUT,
-                                                         shell=True).decode("utf-8")
-            # bb.note(complementary_pkgs)
-            return complementary_pkgs
-        except subprocess.CalledProcessError as e:
-            bb.fatal("Could not invoke smart. Command "
-                     "'%s' returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
-
-    def _search_pkg_name_in_feeds(self, pkg, feed_archs):
-        for arch in feed_archs:
-            arch = arch.replace('-', '_')
-            regex_match = re.compile(r"^%s-[^-]*-[^-]*@%s$" % \
-                (re.escape(pkg), re.escape(arch)))
-            for p in self.fullpkglist:
-                if regex_match.match(p) is not None:
-                    # First found is best match
-                    # bb.note('%s -> %s' % (pkg, pkg + '@' + arch))
-                    return pkg + '@' + arch
-
-        # Search provides if not found by pkgname.
-        bb.note('Not found %s by name, searching provides ...' % pkg)
-        cmd = "%s %s query --provides %s --show-format='$name-$version'" % \
-                (self.smart_cmd, self.smart_opt, pkg)
-        cmd += " | sed -ne 's/ *Provides://p'"
-        bb.note('cmd: %s' % cmd)
-        output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
-        # Found a provider
-        if output:
-            bb.note('Found providers for %s: %s' % (pkg, output))
-            for p in output.split():
-                for arch in feed_archs:
-                    arch = arch.replace('-', '_')
-                    if p.rstrip().endswith('@' + arch):
-                        return p
-
-        return ""
-
-    '''
-    Translate the OE multilib format names to the RPM/Smart format names
-    It searched the RPM/Smart format names in probable multilib feeds first,
-    and then searched the default base feed.
-    '''
-    def _pkg_translate_oe_to_smart(self, pkgs, attempt_only=False):
-        new_pkgs = list()
-
-        for pkg in pkgs:
-            new_pkg = pkg
-            # Search new_pkg in probable multilibs first
-            for mlib in self.ml_prefix_list:
-                # Jump the default archs
-                if mlib == 'default':
-                    continue
-
-                subst = pkg.replace(mlib + '-', '')
-                # if the pkg in this multilib feed
-                if subst != pkg:
-                    feed_archs = self.ml_prefix_list[mlib]
-                    new_pkg = self._search_pkg_name_in_feeds(subst, feed_archs)
-                    if not new_pkg:
-                        # Failed to translate, package not found!
-                        err_msg = '%s not found in the %s feeds (%s) in %s.' % \
-                                  (pkg, mlib, " ".join(feed_archs), self.d.getVar('DEPLOY_DIR_RPM', True))
-                        if not attempt_only:
-                            bb.error(err_msg)
-                            bb.fatal("This is often caused by an empty package declared " \
-                                     "in a recipe's PACKAGES variable. (Empty packages are " \
-                                     "not constructed unless ALLOW_EMPTY_<pkg> = '1' is used.)")
-                        bb.warn(err_msg)
-                    else:
-                        new_pkgs.append(new_pkg)
-
-                    break
-
-            # Apparently not a multilib package...
-            if pkg == new_pkg:
-                # Search new_pkg in default archs
-                default_archs = self.ml_prefix_list['default']
-                new_pkg = self._search_pkg_name_in_feeds(pkg, default_archs)
-                if not new_pkg:
-                    err_msg = '%s not found in the feeds (%s) in %s.' % \
-                                  (pkg, " ".join(default_archs), self.d.getVar('DEPLOY_DIR_RPM', True))
-                    if not attempt_only:
-                        bb.error(err_msg)
-                        bb.fatal("This is often caused by an empty package declared " \
-                                 "in a recipe's PACKAGES variable. (Empty packages are " \
-                                 "not constructed unless ALLOW_EMPTY_<pkg> = '1' is used.)")
-                    bb.warn(err_msg)
-                else:
-                    new_pkgs.append(new_pkg)
-
-        return new_pkgs
-
-    def _create_configs(self, platform, platform_extra):
-        # Setup base system configuration
-        bb.note("configuring RPM platform settings")
-
-        # Configure internal RPM environment when using Smart
-        os.environ['RPM_ETCRPM'] = self.etcrpm_dir
-        bb.utils.mkdirhier(self.etcrpm_dir)
-
-        # Setup temporary directory -- install...
-        if os.path.exists(self.install_dir_path):
-            bb.utils.remove(self.install_dir_path, True)
-        bb.utils.mkdirhier(os.path.join(self.install_dir_path, 'tmp'))
-
-        channel_priority = 5
-        platform_dir = os.path.join(self.etcrpm_dir, "platform")
-        sdkos = self.d.getVar("SDK_OS", True)
-        with open(platform_dir, "w+") as platform_fd:
-            platform_fd.write(platform + '\n')
-            for pt in platform_extra:
-                channel_priority += 5
-                if sdkos:
-                    tmp = re.sub("-%s$" % sdkos, "-%s\n" % sdkos, pt)
-                tmp = re.sub("-linux.*$", "-linux.*\n", tmp)
-                platform_fd.write(tmp)
-
-        # Tell RPM that the "/" directory exist and is available
-        bb.note("configuring RPM system provides")
-        sysinfo_dir = os.path.join(self.etcrpm_dir, "sysinfo")
-        bb.utils.mkdirhier(sysinfo_dir)
-        with open(os.path.join(sysinfo_dir, "Dirnames"), "w+") as dirnames:
-            dirnames.write("/\n")
-
-        if self.providename:
-            providename_dir = os.path.join(sysinfo_dir, "Providename")
-            if not os.path.exists(providename_dir):
-                providename_content = '\n'.join(self.providename)
-                providename_content += '\n'
-                open(providename_dir, "w+").write(providename_content)
-
-        # Configure RPM... we enforce these settings!
-        bb.note("configuring RPM DB settings")
-        # After change the __db.* cache size, log file will not be
-        # generated automatically, that will raise some warnings,
-        # so touch a bare log for rpm write into it.
-        rpmlib_log = os.path.join(self.image_rpmlib, 'log', 'log.0000000001')
-        if not os.path.exists(rpmlib_log):
-            bb.utils.mkdirhier(os.path.join(self.image_rpmlib, 'log'))
-            open(rpmlib_log, 'w+').close()
-
-        DB_CONFIG_CONTENT = "# ================ Environment\n" \
-            "set_data_dir .\n" \
-            "set_create_dir .\n" \
-            "set_lg_dir ./log\n" \
-            "set_tmp_dir ./tmp\n" \
-            "set_flags db_log_autoremove on\n" \
-            "\n" \
-            "# -- thread_count must be >= 8\n" \
-            "set_thread_count 64\n" \
-            "\n" \
-            "# ================ Logging\n" \
-            "\n" \
-            "# ================ Memory Pool\n" \
-            "set_cachesize 0 1048576 0\n" \
-            "set_mp_mmapsize 268435456\n" \
-            "\n" \
-            "# ================ Locking\n" \
-            "set_lk_max_locks 16384\n" \
-            "set_lk_max_lockers 16384\n" \
-            "set_lk_max_objects 16384\n" \
-            "mutex_set_max 163840\n" \
-            "\n" \
-            "# ================ Replication\n"
-
-        db_config_dir = os.path.join(self.image_rpmlib, 'DB_CONFIG')
-        if not os.path.exists(db_config_dir):
-            open(db_config_dir, 'w+').write(DB_CONFIG_CONTENT)
-
-        # Create database so that smart doesn't complain (lazy init)
-        opt = "-qa"
-        cmd = "%s --root %s --dbpath /var/lib/rpm %s > /dev/null" % (
-              self.rpm_cmd, self.target_rootfs, opt)
-        try:
-            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
-        except subprocess.CalledProcessError as e:
-            bb.fatal("Create rpm database failed. Command '%s' "
-                     "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
-        # Import GPG key to RPM database of the target system
-        if self.d.getVar('RPM_SIGN_PACKAGES', True) == '1':
-            pubkey_path = self.d.getVar('RPM_GPG_PUBKEY', True)
-            cmd = "%s --root %s --dbpath /var/lib/rpm --import %s > /dev/null" % (
-                  self.rpm_cmd, self.target_rootfs, pubkey_path)
-            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
-
-        # Configure smart
-        bb.note("configuring Smart settings")
-        bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
-                        True)
-        self._invoke_smart('config --set rpm-root=%s' % self.target_rootfs)
-        self._invoke_smart('config --set rpm-dbpath=/var/lib/rpm')
-        self._invoke_smart('config --set rpm-extra-macros._var=%s' %
-                           self.d.getVar('localstatedir', True))
-        cmd = "config --set rpm-extra-macros._tmppath=/%s/tmp" % (self.install_dir_name)
-
-        prefer_color = self.d.getVar('RPM_PREFER_ELF_ARCH', True)
-        if prefer_color:
-            if prefer_color not in ['0', '1', '2', '4']:
-                bb.fatal("Invalid RPM_PREFER_ELF_ARCH: %s, it should be one of:\n"
-                        "\t1: ELF32 wins\n"
-                        "\t2: ELF64 wins\n"
-                        "\t4: ELF64 N32 wins (mips64 or mips64el only)" %
-                        prefer_color)
-            if prefer_color == "4" and self.d.getVar("TUNE_ARCH", True) not in \
-                                    ['mips64', 'mips64el']:
-                bb.fatal("RPM_PREFER_ELF_ARCH = \"4\" is for mips64 or mips64el "
-                         "only.")
-            self._invoke_smart('config --set rpm-extra-macros._prefer_color=%s'
-                        % prefer_color)
-
-        self._invoke_smart(cmd)
-        self._invoke_smart('config --set rpm-ignoresize=1')
-
-        # Write common configuration for host and target usage
-        self._invoke_smart('config --set rpm-nolinktos=1')
-        self._invoke_smart('config --set rpm-noparentdirs=1')
-        check_signature = self.d.getVar('RPM_CHECK_SIGNATURES', True)
-        if check_signature and check_signature.strip() == "0":
-            self._invoke_smart('config --set rpm-check-signatures=false')
-        for i in self.d.getVar('BAD_RECOMMENDATIONS', True).split():
-            self._invoke_smart('flag --set ignore-recommends %s' % i)
-
-        # Do the following configurations here, to avoid them being
-        # saved for field upgrade
-        if self.d.getVar('NO_RECOMMENDATIONS', True).strip() == "1":
-            self._invoke_smart('config --set ignore-all-recommends=1')
-        pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE', True) or ""
-        for i in pkg_exclude.split():
-            self._invoke_smart('flag --set exclude-packages %s' % i)
-
-        # Optional debugging
-        # self._invoke_smart('config --set rpm-log-level=debug')
-        # cmd = 'config --set rpm-log-file=/tmp/smart-debug-logfile'
-        # self._invoke_smart(cmd)
-        ch_already_added = []
-        for canonical_arch in platform_extra:
-            arch = canonical_arch.split('-')[0]
-            arch_channel = os.path.join(self.d.getVar('WORKDIR', True), 'rpms', arch)
-            oe.path.remove(arch_channel)
-            deploy_arch_dir = os.path.join(self.deploy_dir, arch)
-            if not os.path.exists(deploy_arch_dir):
-                    continue
-
-            lockfilename = self.d.getVar('DEPLOY_DIR_RPM', True) + "/rpm.lock"
-            lf = bb.utils.lockfile(lockfilename, False)
-            oe.path.copyhardlinktree(deploy_arch_dir, arch_channel)
-            bb.utils.unlockfile(lf)
-
-            if not arch in ch_already_added:
-                bb.note('Adding Smart channel %s (%s)' %
-                        (arch, channel_priority))
-                self._invoke_smart('channel --add %s type=rpm-md baseurl=%s -y'
-                                   % (arch, arch_channel))
-                self._invoke_smart('channel --set %s priority=%d' %
-                                   (arch, channel_priority))
-                channel_priority -= 5
-
-                ch_already_added.append(arch)
-
-        bb.note('adding Smart RPM DB channel')
-        self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
-
-        # Construct install scriptlet wrapper.
-        # Scripts need to be ordered when executed, this ensures numeric order.
-        # If we ever run into needing more the 899 scripts, we'll have to.
-        # change num to start with 1000.
-        #
-        scriptletcmd = "$2 $1/$3 $4\n"
-        scriptpath = "$1/$3"
-
-        # When self.debug_level >= 3, also dump the content of the
-        # executed scriptlets and how they get invoked.  We have to
-        # replace "exit 1" and "ERR" because printing those as-is
-        # would trigger a log analysis failure.
-        if self.debug_level >= 3:
-            dump_invocation = 'echo "Executing ${name} ${kind} with: ' + scriptletcmd + '"\n'
-            dump_script = 'cat ' + scriptpath + '| sed -e "s/exit 1/exxxit 1/g" -e "s/ERR/IRR/g"; echo\n'
-        else:
-            dump_invocation = 'echo "Executing ${name} ${kind}"\n'
-            dump_script = ''
-
-        SCRIPTLET_FORMAT = "#!/bin/bash\n" \
-            "\n" \
-            "export PATH=%s\n" \
-            "export D=%s\n" \
-            'export OFFLINE_ROOT="$D"\n' \
-            'export IPKG_OFFLINE_ROOT="$D"\n' \
-            'export OPKG_OFFLINE_ROOT="$D"\n' \
-            "export INTERCEPT_DIR=%s\n" \
-            "export NATIVE_ROOT=%s\n" \
-            "\n" \
-            "name=`head -1 " + scriptpath + " | cut -d\' \' -f 2`\n" \
-            "kind=`head -1 " + scriptpath + " | cut -d\' \' -f 4`\n" \
-            + dump_invocation \
-            + dump_script \
-            + scriptletcmd + \
-            "ret=$?\n" \
-            "echo Result of ${name} ${kind}: ${ret}\n" \
-            "if [ ${ret} -ne 0 ]; then\n" \
-            "  if [ $4 -eq 1 ]; then\n" \
-            "    mkdir -p $1/etc/rpm-postinsts\n" \
-            "    num=100\n" \
-            "    while [ -e $1/etc/rpm-postinsts/${num}-* ]; do num=$((num + 1)); done\n" \
-            '    echo "#!$2" > $1/etc/rpm-postinsts/${num}-${name}\n' \
-            '    echo "# Arg: $4" >> $1/etc/rpm-postinsts/${num}-${name}\n' \
-            "    cat " + scriptpath + " >> $1/etc/rpm-postinsts/${num}-${name}\n" \
-            "    chmod +x $1/etc/rpm-postinsts/${num}-${name}\n" \
-            '    echo "Info: deferring ${name} ${kind} install scriptlet to first boot"\n' \
-            "  else\n" \
-            '    echo "Error: ${name} ${kind} remove scriptlet failed"\n' \
-            "  fi\n" \
-            "fi\n"
-
-        intercept_dir = self.d.expand('${WORKDIR}/intercept_scripts')
-        native_root = self.d.getVar('STAGING_DIR_NATIVE', True)
-        scriptlet_content = SCRIPTLET_FORMAT % (os.environ['PATH'],
-                                                self.target_rootfs,
-                                                intercept_dir,
-                                                native_root)
-        open(self.scriptlet_wrapper, 'w+').write(scriptlet_content)
-
-        bb.note("configuring RPM cross-install scriptlet_wrapper")
-        os.chmod(self.scriptlet_wrapper, 0o755)
-        cmd = 'config --set rpm-extra-macros._cross_scriptlet_wrapper=%s' % \
-              self.scriptlet_wrapper
-        self._invoke_smart(cmd)
-
-        # Debug to show smart config info
-        # bb.note(self._invoke_smart('config --show'))
-
-    def update(self):
-        self._invoke_smart('update rpmsys')
-
-    def get_rdepends_recursively(self, pkgs):
-        # pkgs will be changed during the loop, so use [:] to make a copy.
-        for pkg in pkgs[:]:
-            sub_data = oe.packagedata.read_subpkgdata(pkg, self.d)
-            sub_rdep = sub_data.get("RDEPENDS_" + pkg)
-            if not sub_rdep:
-                continue
-            done = list(bb.utils.explode_dep_versions2(sub_rdep).keys())
-            next = done
-            # Find all the rdepends on dependency chain
-            while next:
-                new = []
-                for sub_pkg in next:
-                    sub_data = oe.packagedata.read_subpkgdata(sub_pkg, self.d)
-                    sub_pkg_rdep = sub_data.get("RDEPENDS_" + sub_pkg)
-                    if not sub_pkg_rdep:
-                        continue
-                    for p in bb.utils.explode_dep_versions2(sub_pkg_rdep):
-                        # Already handled, skip it.
-                        if p in done or p in pkgs:
-                            continue
-                        # It's a new dep
-                        if oe.packagedata.has_subpkgdata(p, self.d):
-                            done.append(p)
-                            new.append(p)
-                next = new
-            pkgs.extend(done)
-        return pkgs
-
-    '''
-    Install pkgs with smart, the pkg name is oe format
-    '''
-    def install(self, pkgs, attempt_only=False):
-
-        if not pkgs:
-            bb.note("There are no packages to install")
-            return
-        bb.note("Installing the following packages: %s" % ' '.join(pkgs))
-        if not attempt_only:
-            # Pull in multilib requires since rpm may not pull in them
-            # correctly, for example,
-            # lib32-packagegroup-core-standalone-sdk-target requires
-            # lib32-libc6, but rpm may pull in libc6 rather than lib32-libc6
-            # since it doesn't know mlprefix (lib32-), bitbake knows it and
-            # can handle it well, find out the RDEPENDS on the chain will
-            # fix the problem. Both do_rootfs and do_populate_sdk have this
-            # issue.
-            # The attempt_only packages don't need this since they are
-            # based on the installed ones.
-            #
-            # Separate pkgs into two lists, one is multilib, the other one
-            # is non-multilib.
-            ml_pkgs = []
-            non_ml_pkgs = pkgs[:]
-            for pkg in pkgs:
-                for mlib in (self.d.getVar("MULTILIB_VARIANTS", True) or "").split():
-                    if pkg.startswith(mlib + '-'):
-                        ml_pkgs.append(pkg)
-                        non_ml_pkgs.remove(pkg)
-
-            if len(ml_pkgs) > 0 and len(non_ml_pkgs) > 0:
-                # Found both foo and lib-foo
-                ml_pkgs = self.get_rdepends_recursively(ml_pkgs)
-                non_ml_pkgs = self.get_rdepends_recursively(non_ml_pkgs)
-                # Longer list makes smart slower, so only keep the pkgs
-                # which have the same BPN, and smart can handle others
-                # correctly.
-                pkgs_new = []
-                for pkg in non_ml_pkgs:
-                    for mlib in (self.d.getVar("MULTILIB_VARIANTS", True) or "").split():
-                        mlib_pkg = mlib + "-" + pkg
-                        if mlib_pkg in ml_pkgs:
-                            pkgs_new.append(pkg)
-                            pkgs_new.append(mlib_pkg)
-                for pkg in pkgs:
-                    if pkg not in pkgs_new:
-                        pkgs_new.append(pkg)
-                pkgs = pkgs_new
-                new_depends = {}
-                deps = bb.utils.explode_dep_versions2(" ".join(pkgs))
-                for depend in deps:
-                    data = oe.packagedata.read_subpkgdata(depend, self.d)
-                    key = "PKG_%s" % depend
-                    if key in data:
-                        new_depend = data[key]
-                    else:
-                        new_depend = depend
-                    new_depends[new_depend] = deps[depend]
-                pkgs = bb.utils.join_deps(new_depends, commasep=True).split(', ')
-        pkgs = self._pkg_translate_oe_to_smart(pkgs, attempt_only)
-        if not pkgs:
-            bb.note("There are no packages to install")
-            return
-        if not attempt_only:
-            bb.note('to be installed: %s' % ' '.join(pkgs))
-            cmd = "%s %s install -y %s" % \
-                  (self.smart_cmd, self.smart_opt, ' '.join(pkgs))
-            bb.note(cmd)
-        else:
-            bb.note('installing attempt only packages...')
-            bb.note('Attempting %s' % ' '.join(pkgs))
-            cmd = "%s %s install --attempt -y %s" % \
-                  (self.smart_cmd, self.smart_opt, ' '.join(pkgs))
-        try:
-            output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT).decode("utf-8")
-            bb.note(output)
-        except subprocess.CalledProcessError as e:
-            bb.fatal("Unable to install packages. Command '%s' "
-                     "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
-
-    '''
-    Remove pkgs with smart, the pkg name is smart/rpm format
-    '''
-    def remove(self, pkgs, with_dependencies=True):
-        bb.note('to be removed: ' + ' '.join(pkgs))
-
-        if not with_dependencies:
-            cmd = "%s -e --nodeps " % self.rpm_cmd
-            cmd += "--root=%s " % self.target_rootfs
-            cmd += "--dbpath=/var/lib/rpm "
-            cmd += "--define='_cross_scriptlet_wrapper %s' " % \
-                   self.scriptlet_wrapper
-            cmd += "--define='_tmppath /%s/tmp' %s" % (self.install_dir_name, ' '.join(pkgs))
-        else:
-            # for pkg in pkgs:
-            #   bb.note('Debug: What required: %s' % pkg)
-            #   bb.note(self._invoke_smart('query %s --show-requiredby' % pkg))
-
-            cmd = "%s %s remove -y %s" % (self.smart_cmd,
-                                          self.smart_opt,
-                                          ' '.join(pkgs))
-
-        try:
-            bb.note(cmd)
-            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
-            bb.note(output)
-        except subprocess.CalledProcessError as e:
-            bb.note("Unable to remove packages. Command '%s' "
-                    "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
-
-    def upgrade(self):
-        bb.note('smart upgrade')
-        self._invoke_smart('upgrade')
+        self._configure_dnf()
+        self._configure_rpm()
 
     def write_index(self):
-        result = self.indexer.write_index()
+        lockfilename = self.d.getVar('DEPLOY_DIR_RPM') + "/rpm.lock"
+        lf = bb.utils.lockfile(lockfilename, False)
+        RpmIndexer(self.d, self.rpm_repo_dir).write_index()
+        bb.utils.unlockfile(lf)
 
-        if result is not None:
-            bb.fatal(result)
+    def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+        from urllib.parse import urlparse
+
+        if feed_uris == "":
+            return
+
+        bb.utils.mkdirhier(oe.path.join(self.target_rootfs, "etc", "yum.repos.d"))
+        remote_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
+        for uri in remote_uris:
+            repo_base = "oe-remote-repo" + "-".join(urlparse(uri).path.split("/"))
+            if feed_archs is not None:
+                for arch in feed_archs.split():
+                    repo_uri = uri + "/" + arch
+                    repo_id   = "oe-remote-repo"  + "-".join(urlparse(repo_uri).path.split("/"))
+                    repo_name = "OE Remote Repo:" + " ".join(urlparse(repo_uri).path.split("/"))
+                    open(oe.path.join(self.target_rootfs, "etc", "yum.repos.d", repo_base + ".repo"), 'a').write(
+                             "[%s]\nname=%s\nbaseurl=%s\n\n" % (repo_id, repo_name, repo_uri))
+            else:
+                repo_name = "OE Remote Repo:" + " ".join(urlparse(uri).path.split("/"))
+                repo_uri = uri
+                open(oe.path.join(self.target_rootfs, "etc", "yum.repos.d", repo_base + ".repo"), 'w').write(
+                             "[%s]\nname=%s\nbaseurl=%s\n" % (repo_base, repo_name, repo_uri))
+
+    def _prepare_pkg_transaction(self):
+        os.environ['D'] = self.target_rootfs
+        os.environ['OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['INTERCEPT_DIR'] = oe.path.join(self.d.getVar('WORKDIR'),
+                                                   "intercept_scripts")
+        os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE')
+
+
+    def install(self, pkgs, attempt_only = False):
+        if len(pkgs) == 0:
+            return
+        self._prepare_pkg_transaction()
+
+        bad_recommendations = self.d.getVar('BAD_RECOMMENDATIONS')
+        package_exclude = self.d.getVar('PACKAGE_EXCLUDE')
+        exclude_pkgs = (bad_recommendations.split() if bad_recommendations else []) + (package_exclude.split() if package_exclude else [])
+
+        output = self._invoke_dnf((["--skip-broken"] if attempt_only else []) +
+                         (["-x", ",".join(exclude_pkgs)] if len(exclude_pkgs) > 0 else []) +
+                         (["--setopt=install_weak_deps=False"] if self.d.getVar('NO_RECOMMENDATIONS') == "1" else []) +
+                         (["--nogpgcheck"] if self.d.getVar('RPM_SIGN_PACKAGES') != '1' else ["--setopt=gpgcheck=True"]) +
+                         ["install"] +
+                         pkgs)
+
+        failed_scriptlets_pkgnames = collections.OrderedDict()
+        for line in output.splitlines():
+            if line.startswith("Non-fatal POSTIN scriptlet failure in rpm package"):
+                failed_scriptlets_pkgnames[line.split()[-1]] = True
+
+        for pkg in failed_scriptlets_pkgnames.keys():
+            self.save_rpmpostinst(pkg)
+
+    def remove(self, pkgs, with_dependencies = True):
+        if len(pkgs) == 0:
+            return
+        self._prepare_pkg_transaction()
+
+        if with_dependencies:
+            self._invoke_dnf(["remove"] + pkgs)
+        else:
+            cmd = bb.utils.which(os.getenv('PATH'), "rpm")
+            args = ["-e", "--nodeps", "--root=%s" %self.target_rootfs]
+
+            try:
+                output = subprocess.check_output([cmd] + args + pkgs, stderr=subprocess.STDOUT).decode("utf-8")
+            except subprocess.CalledProcessError as e:
+                bb.fatal("Could not invoke rpm. Command "
+                     "'%s' returned %d:\n%s" % (' '.join([cmd] + args + pkgs), e.returncode, e.output.decode("utf-8")))
+
+    def upgrade(self):
+        self._prepare_pkg_transaction()
+        self._invoke_dnf(["upgrade"])
+
+    def autoremove(self):
+        self._prepare_pkg_transaction()
+        self._invoke_dnf(["autoremove"])
 
     def remove_packaging_data(self):
-        bb.utils.remove(self.image_rpmlib, True)
-        bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
-                        True)
-        bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/opkg'), True)
-
-        # remove temp directory
-        bb.utils.remove(self.install_dir_path, True)
+        self._invoke_dnf(["clean", "all"])
+        for dir in self.packaging_data_dirs:
+            bb.utils.remove(oe.path.join(self.target_rootfs, dir), True)
 
     def backup_packaging_data(self):
-        # Save the rpmlib for increment rpm image generation
-        if os.path.exists(self.saved_rpmlib):
-            bb.utils.remove(self.saved_rpmlib, True)
-        shutil.copytree(self.image_rpmlib,
-                        self.saved_rpmlib,
-                        symlinks=True)
+        # Save the packaging dirs for increment rpm image generation
+        if os.path.exists(self.saved_packaging_data):
+            bb.utils.remove(self.saved_packaging_data, True)
+        for i in self.packaging_data_dirs:
+            source_dir = oe.path.join(self.target_rootfs, i)
+            target_dir = oe.path.join(self.saved_packaging_data, i)
+            shutil.copytree(source_dir, target_dir, symlinks=True)
 
     def recovery_packaging_data(self):
         # Move the rpmlib back
-        if os.path.exists(self.saved_rpmlib):
-            if os.path.exists(self.image_rpmlib):
-                bb.utils.remove(self.image_rpmlib, True)
-
-            bb.note('Recovery packaging data')
-            shutil.copytree(self.saved_rpmlib,
-                            self.image_rpmlib,
+        if os.path.exists(self.saved_packaging_data):
+            for i in self.packaging_data_dirs:
+                target_dir = oe.path.join(self.target_rootfs, i)
+                if os.path.exists(target_dir):
+                    bb.utils.remove(target_dir, True)
+                source_dir = oe.path.join(self.saved_packaging_data, i)
+                shutil.copytree(source_dir,
+                            target_dir,
                             symlinks=True)
 
     def list_installed(self):
-        return self.pkgs_list.list_pkgs()
+        output = self._invoke_dnf(["repoquery", "--installed", "--queryformat", "Package: %{name} %{arch} %{version} %{name}-%{version}-%{release}.%{arch}.rpm\nDependencies:\n%{requires}\nRecommendations:\n%{recommends}\nDependenciesEndHere:\n"],
+                                  print_output = False)
+        packages = {}
+        current_package = None
+        current_deps = None
+        current_state = "initial"
+        for line in output.splitlines():
+            if line.startswith("Package:"):
+                package_info = line.split(" ")[1:]
+                current_package = package_info[0]
+                package_arch = package_info[1]
+                package_version = package_info[2]
+                package_rpm = package_info[3]
+                packages[current_package] = {"arch":package_arch, "ver":package_version, "filename":package_rpm}
+                current_deps = []
+            elif line.startswith("Dependencies:"):
+                current_state = "dependencies"
+            elif line.startswith("Recommendations"):
+                current_state = "recommendations"
+            elif line.startswith("DependenciesEndHere:"):
+                current_state = "initial"
+                packages[current_package]["deps"] = current_deps
+            elif len(line) > 0:
+                if current_state == "dependencies":
+                    current_deps.append(line)
+                elif current_state == "recommendations":
+                    current_deps.append("%s [REC]" % line)
 
-    '''
-    If incremental install, we need to determine what we've got,
-    what we need to add, and what to remove...
-    The dump_install_solution will dump and save the new install
-    solution.
-    '''
+        return packages
+
+    def update(self):
+        self._invoke_dnf(["makecache"])
+
+    def _invoke_dnf(self, dnf_args, fatal = True, print_output = True ):
+        os.environ['RPM_ETCCONFIGDIR'] = self.target_rootfs
+
+        dnf_cmd = bb.utils.which(os.getenv('PATH'), "dnf")
+        standard_dnf_args = (["-v", "--rpmverbosity=debug"] if self.d.getVar('ROOTFS_RPM_DEBUG') else []) + ["-y",
+                             "-c", oe.path.join(self.target_rootfs, "etc/dnf/dnf.conf"),
+                             "--setopt=reposdir=%s" %(oe.path.join(self.target_rootfs, "etc/yum.repos.d")),
+                             "--repofrompath=oe-repo,%s" % (self.rpm_repo_dir),
+                             "--installroot=%s" % (self.target_rootfs),
+                             "--setopt=logdir=%s" % (self.d.getVar('T'))
+                            ]
+        cmd = [dnf_cmd] + standard_dnf_args + dnf_args
+        try:
+            output = subprocess.check_output(cmd,stderr=subprocess.STDOUT).decode("utf-8")
+            if print_output:
+                bb.note(output)
+            return output
+        except subprocess.CalledProcessError as e:
+            if print_output:
+                (bb.note, bb.fatal)[fatal]("Could not invoke dnf. Command "
+                     "'%s' returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
+            else:
+                (bb.note, bb.fatal)[fatal]("Could not invoke dnf. Command "
+                     "'%s' returned %d:" % (' '.join(cmd), e.returncode))
+            return e.output.decode("utf-8")
+
     def dump_install_solution(self, pkgs):
-        bb.note('creating new install solution for incremental install')
-        if len(pkgs) == 0:
-            return
+        open(self.solution_manifest, 'w').write(" ".join(pkgs))
+        return pkgs
 
-        pkgs = self._pkg_translate_oe_to_smart(pkgs, False)
-        install_pkgs = list()
-
-        cmd = "%s %s install -y --dump %s 2>%s" %  \
-              (self.smart_cmd,
-               self.smart_opt,
-               ' '.join(pkgs),
-               self.solution_manifest)
-        try:
-            # Disable rpmsys channel for the fake install
-            self._invoke_smart('channel --disable rpmsys')
-
-            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
-            with open(self.solution_manifest, 'r') as manifest:
-                for pkg in manifest.read().split('\n'):
-                    if '@' in pkg:
-                        install_pkgs.append(pkg)
-        except subprocess.CalledProcessError as e:
-            bb.note("Unable to dump install packages. Command '%s' "
-                    "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
-        # Recovery rpmsys channel
-        self._invoke_smart('channel --enable rpmsys')
-        return install_pkgs
-
-    '''
-    If incremental install, we need to determine what we've got,
-    what we need to add, and what to remove...
-    The load_old_install_solution will load the previous install
-    solution
-    '''
     def load_old_install_solution(self):
-        bb.note('load old install solution for incremental install')
-        installed_pkgs = list()
         if not os.path.exists(self.solution_manifest):
-            bb.note('old install solution not exist')
-            return installed_pkgs
+            return []
 
-        with open(self.solution_manifest, 'r') as manifest:
-            for pkg in manifest.read().split('\n'):
-                if '@' in pkg:
-                    installed_pkgs.append(pkg.strip())
+        return open(self.solution_manifest, 'r').read().split()
 
-        return installed_pkgs
-
-    '''
-    Dump all available packages in feeds, it should be invoked after the
-    newest rpm index was created
-    '''
-    def dump_all_available_pkgs(self):
-        available_manifest = self.d.expand('${T}/saved/available_pkgs.txt')
-        available_pkgs = list()
-        cmd = "%s %s query --output %s" %  \
-              (self.smart_cmd, self.smart_opt, available_manifest)
-        try:
-            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
-            with open(available_manifest, 'r') as manifest:
-                for pkg in manifest.read().split('\n'):
-                    if '@' in pkg:
-                        available_pkgs.append(pkg.strip())
-        except subprocess.CalledProcessError as e:
-            bb.note("Unable to list all available packages. Command '%s' "
-                    "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
-
-        self.fullpkglist = available_pkgs
-
-        return
+    def _script_num_prefix(self, path):
+        files = os.listdir(path)
+        numbers = set()
+        numbers.add(99)
+        for f in files:
+            numbers.add(int(f.split("-")[0]))
+        return max(numbers) + 1
 
     def save_rpmpostinst(self, pkg):
-        mlibs = (self.d.getVar('MULTILIB_GLOBAL_VARIANTS', False) or "").split()
-
-        new_pkg = pkg
-        # Remove any multilib prefix from the package name
-        for mlib in mlibs:
-            if mlib in pkg:
-                new_pkg = pkg.replace(mlib + '-', '')
-                break
-
-        bb.note('  * postponing %s' % new_pkg)
-        saved_dir = self.target_rootfs + self.d.expand('${sysconfdir}/rpm-postinsts/') + new_pkg
-
-        cmd = self.rpm_cmd + ' -q --scripts --root ' + self.target_rootfs
-        cmd += ' --dbpath=/var/lib/rpm ' + new_pkg
-        cmd += ' | sed -n -e "/^postinstall scriptlet (using .*):$/,/^.* scriptlet (using .*):$/ {/.*/p}"'
-        cmd += ' | sed -e "/postinstall scriptlet (using \(.*\)):$/d"'
-        cmd += ' -e "/^.* scriptlet (using .*):$/d" > %s' % saved_dir
+        bb.note("Saving postinstall script of %s" % (pkg))
+        cmd = bb.utils.which(os.getenv('PATH'), "rpm")
+        args = ["-q", "--root=%s" % self.target_rootfs, "--queryformat", "%{postin}", pkg]
 
         try:
-            bb.note(cmd)
-            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip().decode("utf-8")
-            bb.note(output)
-            os.chmod(saved_dir, 0o755)
+            output = subprocess.check_output([cmd] + args,stderr=subprocess.STDOUT).decode("utf-8")
         except subprocess.CalledProcessError as e:
-            bb.fatal("Invoke save_rpmpostinst failed. Command '%s' "
-                     "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+            bb.fatal("Could not invoke rpm. Command "
+                     "'%s' returned %d:\n%s" % (' '.join([cmd] + args), e.returncode, e.output.decode("utf-8")))
 
-    '''Write common configuration for target usage'''
-    def rpm_setup_smart_target_config(self):
-        bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
-                        True)
+        # may need to prepend #!/bin/sh to output
 
-        self._invoke_smart('config --set rpm-nolinktos=1')
-        self._invoke_smart('config --set rpm-noparentdirs=1')
-        for i in self.d.getVar('BAD_RECOMMENDATIONS', True).split():
-            self._invoke_smart('flag --set ignore-recommends %s' % i)
-        self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
+        target_path = oe.path.join(self.target_rootfs, self.d.expand('${sysconfdir}/rpm-postinsts/'))
+        bb.utils.mkdirhier(target_path)
+        num = self._script_num_prefix(target_path)
+        saved_script_name = oe.path.join(target_path, "%d-%s" % (num, pkg))
+        open(saved_script_name, 'w').write(output)
+        os.chmod(saved_script_name, 0o755)
 
-    '''
-    The rpm db lock files were produced after invoking rpm to query on
-    build system, and they caused the rpm on target didn't work, so we
-    need to unlock the rpm db by removing the lock files.
-    '''
-    def unlock_rpm_db(self):
-        # Remove rpm db lock files
-        rpm_db_locks = glob.glob('%s/var/lib/rpm/__db.*' % self.target_rootfs)
-        for f in rpm_db_locks:
-            bb.utils.remove(f, True)
-
-    """
-    Returns a dictionary with the package info.
-    """
-    def package_info(self, pkg):
-        cmd = "%s %s info --urls %s" % (self.smart_cmd, self.smart_opt, pkg)
-        try:
-            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
-        except subprocess.CalledProcessError as e:
-            bb.fatal("Unable to list available packages. Command '%s' "
-                     "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
-
-        # Set default values to avoid UnboundLocalError
-        arch = ""
-        ver = ""
-        filename = ""
-
-        #Parse output
-        for line in output.splitlines():
-            line = line.rstrip()
-            if line.startswith("Name:"):
-                pkg = line.split(": ")[1]
-            elif line.startswith("Version:"):
-                tmp_str = line.split(": ")[1]
-                ver, arch = tmp_str.split("@")
-                break
-
-        # Get filename
-        index = re.search("^URLs", output, re.MULTILINE)
-        tmp_str = output[index.end():]
-        for line in tmp_str.splitlines():
-            if "/" in line:
-                line = line.lstrip()
-                filename = line.split(" ")[0]
-                break
-
-        # To have the same data type than other package_info methods
-        filepath = os.path.join(self.deploy_dir, arch, filename)
-        pkg_dict = {}
-        pkg_dict[pkg] = {"arch":arch, "ver":ver, "filename":filename,
-                         "filepath": filepath}
-
-        return pkg_dict
-
-    """
-    Returns the path to a tmpdir where resides the contents of a package.
-
-    Deleting the tmpdir is responsability of the caller.
-
-    """
     def extract(self, pkg):
-        pkg_info = self.package_info(pkg)
-        if not pkg_info:
-            bb.fatal("Unable to get information for package '%s' while "
-                     "trying to extract the package."  % pkg)
-
-        pkg_path = pkg_info[pkg]["filepath"]
+        output = self._invoke_dnf(["repoquery", "--queryformat", "%{location}", pkg])
+        pkg_name = output.splitlines()[-1]
+        if not pkg_name.endswith(".rpm"):
+            bb.fatal("dnf could not find package %s in repository: %s" %(pkg, output))
+        pkg_path = oe.path.join(self.rpm_repo_dir, pkg_name)
 
         cpio_cmd = bb.utils.which(os.getenv("PATH"), "cpio")
         rpm2cpio_cmd = bb.utils.which(os.getenv("PATH"), "rpm2cpio")
@@ -1548,20 +825,24 @@
         tmp_dir = tempfile.mkdtemp()
         current_dir = os.getcwd()
         os.chdir(tmp_dir)
+        if self.d.getVar('IMAGE_PKGTYPE') == 'deb':
+            data_tar = 'data.tar.xz'
+        else:
+            data_tar = 'data.tar.gz'
 
         try:
-            cmd = "%s x %s" % (ar_cmd, pkg_path)
-            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
-            cmd = "%s xf data.tar.*" % tar_cmd
-            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+            cmd = [ar_cmd, 'x', pkg_path]
+            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+            cmd = [tar_cmd, 'xf', data_tar]
+            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
         except subprocess.CalledProcessError as e:
             bb.utils.remove(tmp_dir, recurse=True)
             bb.fatal("Unable to extract %s package. Command '%s' "
-                     "returned %d:\n%s" % (pkg_path, cmd, e.returncode, e.output.decode("utf-8")))
+                     "returned %d:\n%s" % (pkg_path, ' '.join(cmd), e.returncode, e.output.decode("utf-8")))
         except OSError as e:
             bb.utils.remove(tmp_dir, recurse=True)
             bb.fatal("Unable to extract %s package. Command '%s' "
-                     "returned %d:\n%s at %s" % (pkg_path, cmd, e.errno, e.strerror, e.filename))
+                     "returned %d:\n%s at %s" % (pkg_path, ' '.join(cmd), e.errno, e.strerror, e.filename))
 
         bb.note("Extracted %s to %s" % (pkg_path, tmp_dir))
         bb.utils.remove(os.path.join(tmp_dir, "debian-binary"))
@@ -1580,13 +861,13 @@
         self.pkg_archs = archs
         self.task_name = task_name
 
-        self.deploy_dir = self.d.getVar("DEPLOY_DIR_IPK", True)
+        self.deploy_dir = self.d.getVar("DEPLOY_DIR_IPK")
         self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock")
         self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
         self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs)
-        self.opkg_args += self.d.getVar("OPKG_ARGS", True)
+        self.opkg_args += self.d.getVar("OPKG_ARGS")
 
-        opkg_lib_dir = self.d.getVar('OPKGLIBDIR', True)
+        opkg_lib_dir = self.d.getVar('OPKGLIBDIR')
         if opkg_lib_dir[0] == "/":
             opkg_lib_dir = opkg_lib_dir[1:]
 
@@ -1598,7 +879,7 @@
         if not os.path.exists(self.d.expand('${T}/saved')):
             bb.utils.mkdirhier(self.d.expand('${T}/saved'))
 
-        self.from_feeds = (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") == "1"
+        self.from_feeds = (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") == "1"
         if self.from_feeds:
             self._create_custom_config()
         else:
@@ -1643,7 +924,7 @@
                 config_file.write("arch %s %d\n" % (arch, priority))
                 priority += 5
 
-            for line in (self.d.getVar('IPK_FEED_URIS', True) or "").split():
+            for line in (self.d.getVar('IPK_FEED_URIS') or "").split():
                 feed_match = re.match("^[ \t]*(.*)##([^ \t]*)[ \t]*$", line)
 
                 if feed_match is not None:
@@ -1660,29 +941,29 @@
             specified as compatible for the current machine.
             NOTE: Development-helper feature, NOT a full-fledged feed.
             """
-            if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True) or "") != "":
+            if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI') or "") != "":
                 for arch in self.pkg_archs.split():
                     cfg_file_name = os.path.join(self.target_rootfs,
-                                                 self.d.getVar("sysconfdir", True),
+                                                 self.d.getVar("sysconfdir"),
                                                  "opkg",
                                                  "local-%s-feed.conf" % arch)
 
                     with open(cfg_file_name, "w+") as cfg_file:
                         cfg_file.write("src/gz local-%s %s/%s" %
                                        (arch,
-                                        self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True),
+                                        self.d.getVar('FEED_DEPLOYDIR_BASE_URI'),
                                         arch))
 
-                        if self.d.getVar('OPKGLIBDIR', True) != '/var/lib':
+                        if self.d.getVar('OPKGLIBDIR') != '/var/lib':
                             # There is no command line option for this anymore, we need to add
                             # info_dir and status_file to config file, if OPKGLIBDIR doesn't have
                             # the default value of "/var/lib" as defined in opkg:
                             # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_LISTS_DIR     VARDIR "/lib/opkg/lists"
                             # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR      VARDIR "/lib/opkg/info"
                             # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE   VARDIR "/lib/opkg/status"
-                            cfg_file.write("option info_dir     %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info'))
-                            cfg_file.write("option lists_dir    %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'lists'))
-                            cfg_file.write("option status_file  %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'status'))
+                            cfg_file.write("option info_dir     %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
+                            cfg_file.write("option lists_dir    %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists'))
+                            cfg_file.write("option status_file  %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
 
 
     def _create_config(self):
@@ -1700,33 +981,33 @@
                     config_file.write("src oe-%s file:%s\n" %
                                       (arch, pkgs_dir))
 
-            if self.d.getVar('OPKGLIBDIR', True) != '/var/lib':
+            if self.d.getVar('OPKGLIBDIR') != '/var/lib':
                 # There is no command line option for this anymore, we need to add
                 # info_dir and status_file to config file, if OPKGLIBDIR doesn't have
                 # the default value of "/var/lib" as defined in opkg:
                 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_LISTS_DIR     VARDIR "/lib/opkg/lists"
                 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR      VARDIR "/lib/opkg/info"
                 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE   VARDIR "/lib/opkg/status"
-                config_file.write("option info_dir     %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info'))
-                config_file.write("option lists_dir    %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'lists'))
-                config_file.write("option status_file  %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'status'))
+                config_file.write("option info_dir     %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
+                config_file.write("option lists_dir    %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists'))
+                config_file.write("option status_file  %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
 
-    def insert_feeds_uris(self):
-        if self.feed_uris == "":
+    def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+        if feed_uris == "":
             return
 
         rootfs_config = os.path.join('%s/etc/opkg/base-feeds.conf'
                                   % self.target_rootfs)
 
-        feed_uris = self.construct_uris(self.feed_uris.split(), self.feed_base_paths.split())
-        archs = self.pkg_archs.split() if self.feed_archs is None else self.feed_archs.split()
+        feed_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
+        archs = self.pkg_archs.split() if feed_archs is None else feed_archs.split()
 
         with open(rootfs_config, "w+") as config_file:
             uri_iterator = 0
             for uri in feed_uris:
                 if archs:
                     for arch in archs:
-                        if (self.feed_archs is None) and (not os.path.exists(os.path.join(self.deploy_dir, arch))):
+                        if (feed_archs is None) and (not os.path.exists(oe.path.join(self.deploy_dir, arch))):
                             continue
                         bb.note('Adding opkg feed url-%s-%d (%s)' %
                             (arch, uri_iterator, uri))
@@ -1764,9 +1045,9 @@
         os.environ['OFFLINE_ROOT'] = self.target_rootfs
         os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
         os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
-        os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR', True),
+        os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR'),
                                                    "intercept_scripts")
-        os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE', True)
+        os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE')
 
         try:
             bb.note("Installing the following packages: %s" % ' '.join(pkgs))
@@ -1817,7 +1098,7 @@
         return OpkgPkgsList(self.d, self.target_rootfs, self.config_file).list_pkgs()
 
     def handle_bad_recommendations(self):
-        bad_recommendations = self.d.getVar("BAD_RECOMMENDATIONS", True) or ""
+        bad_recommendations = self.d.getVar("BAD_RECOMMENDATIONS") or ""
         if bad_recommendations.strip() == "":
             return
 
@@ -1871,7 +1152,7 @@
         bb.utils.mkdirhier(temp_opkg_dir)
 
         opkg_args = "-f %s -o %s " % (self.config_file, temp_rootfs)
-        opkg_args += self.d.getVar("OPKG_ARGS", True)
+        opkg_args += self.d.getVar("OPKG_ARGS")
 
         cmd = "%s %s update" % (self.opkg_cmd, opkg_args)
         try:
@@ -1947,7 +1228,7 @@
     def __init__(self, d, target_rootfs, archs, base_archs, apt_conf_dir=None):
         super(DpkgPM, self).__init__(d)
         self.target_rootfs = target_rootfs
-        self.deploy_dir = self.d.getVar('DEPLOY_DIR_DEB', True)
+        self.deploy_dir = self.d.getVar('DEPLOY_DIR_DEB')
         if apt_conf_dir is None:
             self.apt_conf_dir = self.d.expand("${APTCONF_TARGET}/apt")
         else:
@@ -1956,10 +1237,10 @@
         self.apt_get_cmd = bb.utils.which(os.getenv('PATH'), "apt-get")
         self.apt_cache_cmd = bb.utils.which(os.getenv('PATH'), "apt-cache")
 
-        self.apt_args = d.getVar("APT_ARGS", True)
+        self.apt_args = d.getVar("APT_ARGS")
 
         self.all_arch_list = archs.split()
-        all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").split()
+        all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or "").split()
         self.all_arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in self.all_arch_list)
 
         self._create_configs(archs, base_archs)
@@ -2000,7 +1281,10 @@
     """
     def run_pre_post_installs(self, package_name=None):
         info_dir = self.target_rootfs + "/var/lib/dpkg/info"
-        suffixes = [(".preinst", "Preinstall"), (".postinst", "Postinstall")]
+        ControlScript = collections.namedtuple("ControlScript", ["suffix", "name", "argument"])
+        control_scripts = [
+                ControlScript(".preinst", "Preinstall", "install"),
+                ControlScript(".postinst", "Postinstall", "configure")]
         status_file = self.target_rootfs + "/var/lib/dpkg/status"
         installed_pkgs = []
 
@@ -2017,22 +1301,25 @@
         os.environ['OFFLINE_ROOT'] = self.target_rootfs
         os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
         os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
-        os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR', True),
+        os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR'),
                                                    "intercept_scripts")
-        os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE', True)
+        os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE')
 
         failed_pkgs = []
         for pkg_name in installed_pkgs:
-            for suffix in suffixes:
-                p_full = os.path.join(info_dir, pkg_name + suffix[0])
+            for control_script in control_scripts:
+                p_full = os.path.join(info_dir, pkg_name + control_script.suffix)
                 if os.path.exists(p_full):
                     try:
                         bb.note("Executing %s for package: %s ..." %
-                                 (suffix[1].lower(), pkg_name))
-                        subprocess.check_output(p_full, stderr=subprocess.STDOUT)
+                                 (control_script.name.lower(), pkg_name))
+                        output = subprocess.check_output([p_full, control_script.argument],
+                                stderr=subprocess.STDOUT).decode("utf-8")
+                        bb.note(output)
                     except subprocess.CalledProcessError as e:
                         bb.note("%s for package %s failed with %d:\n%s" %
-                                (suffix[1], pkg_name, e.returncode, e.output.decode("utf-8")))
+                                (control_script.name, pkg_name, e.returncode,
+                                    e.output.decode("utf-8")))
                         failed_pkgs.append(pkg_name)
                         break
 
@@ -2112,23 +1399,23 @@
         if result is not None:
             bb.fatal(result)
 
-    def insert_feeds_uris(self):
-        if self.feed_uris == "":
+    def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+        if feed_uris == "":
             return
 
         sources_conf = os.path.join("%s/etc/apt/sources.list"
                                     % self.target_rootfs)
         arch_list = []
 
-        if self.feed_archs is None:
+        if feed_archs is None:
             for arch in self.all_arch_list:
                 if not os.path.exists(os.path.join(self.deploy_dir, arch)):
                     continue
                 arch_list.append(arch)
         else:
-            arch_list = self.feed_archs.split()
+            arch_list = feed_archs.split()
 
-        feed_uris = self.construct_uris(self.feed_uris.split(), self.feed_base_paths.split())
+        feed_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
 
         with open(sources_conf, "w+") as sources_file:
             for uri in feed_uris:
@@ -2168,7 +1455,7 @@
 
                 priority += 5
 
-            pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE', True) or ""
+            pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE') or ""
             for pkg in pkg_exclude.split():
                 prefs_file.write(
                     "Package: %s\n"
@@ -2183,14 +1470,13 @@
                                    os.path.join(self.deploy_dir, arch))
 
         base_arch_list = base_archs.split()
-        multilib_variants = self.d.getVar("MULTILIB_VARIANTS", True);
+        multilib_variants = self.d.getVar("MULTILIB_VARIANTS");
         for variant in multilib_variants.split():
             localdata = bb.data.createCopy(self.d)
             variant_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + variant, False)
-            orig_arch = localdata.getVar("DPKG_ARCH", True)
+            orig_arch = localdata.getVar("DPKG_ARCH")
             localdata.setVar("DEFAULTTUNE", variant_tune)
-            bb.data.update_data(localdata)
-            variant_arch = localdata.getVar("DPKG_ARCH", True)
+            variant_arch = localdata.getVar("DPKG_ARCH")
             if variant_arch not in base_arch_list:
                 base_arch_list.append(variant_arch)
 
@@ -2221,7 +1507,7 @@
 
     def remove_packaging_data(self):
         bb.utils.remove(os.path.join(self.target_rootfs,
-                                     self.d.getVar('opkglibdir', True)), True)
+                                     self.d.getVar('opkglibdir')), True)
         bb.utils.remove(self.target_rootfs + "/var/lib/dpkg/", True)
 
     def fix_broken_dependencies(self):
@@ -2269,12 +1555,12 @@
         return tmp_dir
 
 def generate_index_files(d):
-    classes = d.getVar('PACKAGE_CLASSES', True).replace("package_", "").split()
+    classes = d.getVar('PACKAGE_CLASSES').replace("package_", "").split()
 
     indexer_map = {
-        "rpm": (RpmIndexer, d.getVar('DEPLOY_DIR_RPM', True)),
-        "ipk": (OpkgIndexer, d.getVar('DEPLOY_DIR_IPK', True)),
-        "deb": (DpkgIndexer, d.getVar('DEPLOY_DIR_DEB', True))
+        "rpm": (RpmIndexer, d.getVar('DEPLOY_DIR_RPM')),
+        "ipk": (OpkgIndexer, d.getVar('DEPLOY_DIR_IPK')),
+        "deb": (DpkgIndexer, d.getVar('DEPLOY_DIR_DEB'))
     }
 
     result = None
diff --git a/import-layers/yocto-poky/meta/lib/oe/packagedata.py b/import-layers/yocto-poky/meta/lib/oe/packagedata.py
index 21d4de9..32e5c82 100644
--- a/import-layers/yocto-poky/meta/lib/oe/packagedata.py
+++ b/import-layers/yocto-poky/meta/lib/oe/packagedata.py
@@ -57,7 +57,7 @@
 def _pkgmap(d):
     """Return a dictionary mapping package to recipe name."""
 
-    pkgdatadir = d.getVar("PKGDATA_DIR", True)
+    pkgdatadir = d.getVar("PKGDATA_DIR")
 
     pkgmap = {}
     try:
diff --git a/import-layers/yocto-poky/meta/lib/oe/packagegroup.py b/import-layers/yocto-poky/meta/lib/oe/packagegroup.py
index 9781927..4bc5d3e 100644
--- a/import-layers/yocto-poky/meta/lib/oe/packagegroup.py
+++ b/import-layers/yocto-poky/meta/lib/oe/packagegroup.py
@@ -1,17 +1,17 @@
 import itertools
 
 def is_optional(feature, d):
-    packages = d.getVar("FEATURE_PACKAGES_%s" % feature, True)
+    packages = d.getVar("FEATURE_PACKAGES_%s" % feature)
     if packages:
-        return bool(d.getVarFlag("FEATURE_PACKAGES_%s" % feature, "optional", True))
+        return bool(d.getVarFlag("FEATURE_PACKAGES_%s" % feature, "optional"))
     else:
-        return bool(d.getVarFlag("PACKAGE_GROUP_%s" % feature, "optional", True))
+        return bool(d.getVarFlag("PACKAGE_GROUP_%s" % feature, "optional"))
 
 def packages(features, d):
     for feature in features:
-        packages = d.getVar("FEATURE_PACKAGES_%s" % feature, True)
+        packages = d.getVar("FEATURE_PACKAGES_%s" % feature)
         if not packages:
-            packages = d.getVar("PACKAGE_GROUP_%s" % feature, True)
+            packages = d.getVar("PACKAGE_GROUP_%s" % feature)
         for pkg in (packages or "").split():
             yield pkg
 
diff --git a/import-layers/yocto-poky/meta/lib/oe/patch.py b/import-layers/yocto-poky/meta/lib/oe/patch.py
index 0332f10..f1ab3dd 100644
--- a/import-layers/yocto-poky/meta/lib/oe/patch.py
+++ b/import-layers/yocto-poky/meta/lib/oe/patch.py
@@ -81,7 +81,7 @@
                 patch[param] = PatchSet.defaults[param]
 
         if patch.get("remote"):
-            patch["file"] = bb.data.expand(bb.fetch2.localpath(patch["remote"], self.d), self.d)
+            patch["file"] = self.d.expand(bb.fetch2.localpath(patch["remote"], self.d))
 
         patch["filemd5"] = bb.utils.md5_file(patch["file"])
 
@@ -281,8 +281,8 @@
 
     def __init__(self, dir, d):
         PatchTree.__init__(self, dir, d)
-        self.commituser = d.getVar('PATCH_GIT_USER_NAME', True)
-        self.commitemail = d.getVar('PATCH_GIT_USER_EMAIL', True)
+        self.commituser = d.getVar('PATCH_GIT_USER_NAME')
+        self.commitemail = d.getVar('PATCH_GIT_USER_EMAIL')
 
     @staticmethod
     def extractPatchHeader(patchfile):
@@ -371,8 +371,8 @@
     @staticmethod
     def gitCommandUserOptions(cmd, commituser=None, commitemail=None, d=None):
         if d:
-            commituser = d.getVar('PATCH_GIT_USER_NAME', True)
-            commitemail = d.getVar('PATCH_GIT_USER_EMAIL', True)
+            commituser = d.getVar('PATCH_GIT_USER_NAME')
+            commitemail = d.getVar('PATCH_GIT_USER_EMAIL')
         if commituser:
             cmd += ['-c', 'user.name="%s"' % commituser]
         if commitemail:
@@ -428,6 +428,7 @@
     def extractPatches(tree, startcommit, outdir, paths=None):
         import tempfile
         import shutil
+        import re
         tempdir = tempfile.mkdtemp(prefix='oepatch')
         try:
             shellcmd = ["git", "format-patch", startcommit, "-o", tempdir]
@@ -443,10 +444,13 @@
                         try:
                             with open(srcfile, 'r', encoding=encoding) as f:
                                 for line in f:
-                                    if line.startswith(GitApplyTree.patch_line_prefix):
+                                    checkline = line
+                                    if checkline.startswith('Subject: '):
+                                        checkline = re.sub(r'\[.+?\]\s*', '', checkline[9:])
+                                    if checkline.startswith(GitApplyTree.patch_line_prefix):
                                         outfile = line.split()[-1].strip()
                                         continue
-                                    if line.startswith(GitApplyTree.ignore_commit_prefix):
+                                    if checkline.startswith(GitApplyTree.ignore_commit_prefix):
                                         continue
                                     patchlines.append(line)
                         except UnicodeDecodeError:
@@ -547,7 +551,7 @@
 
 class QuiltTree(PatchSet):
     def _runcmd(self, args, run = True):
-        quiltrc = self.d.getVar('QUILTRCFILE', True)
+        quiltrc = self.d.getVar('QUILTRCFILE')
         if not run:
             return ["quilt"] + ["--quiltrc"] + [quiltrc] + args
         runcmd(["quilt"] + ["--quiltrc"] + [quiltrc] + args, self.dir)
@@ -723,7 +727,7 @@
             # Patch application failed
             patchcmd = self.patchset.Push(True, False, False)
 
-            t = self.patchset.d.getVar('T', True)
+            t = self.patchset.d.getVar('T')
             if not t:
                 bb.msg.fatal("Build", "T not set")
             bb.utils.mkdirhier(t)
@@ -765,3 +769,110 @@
             os.chdir(olddir)
             raise
         os.chdir(olddir)
+
+
+def patch_path(url, fetch, workdir, expand=True):
+    """Return the local path of a patch, or None if this isn't a patch"""
+
+    local = fetch.localpath(url)
+    base, ext = os.path.splitext(os.path.basename(local))
+    if ext in ('.gz', '.bz2', '.xz', '.Z'):
+        if expand:
+            local = os.path.join(workdir, base)
+        ext = os.path.splitext(base)[1]
+
+    urldata = fetch.ud[url]
+    if "apply" in urldata.parm:
+        apply = oe.types.boolean(urldata.parm["apply"])
+        if not apply:
+            return
+    elif ext not in (".diff", ".patch"):
+        return
+
+    return local
+
+def src_patches(d, all=False, expand=True):
+    workdir = d.getVar('WORKDIR')
+    fetch = bb.fetch2.Fetch([], d)
+    patches = []
+    sources = []
+    for url in fetch.urls:
+        local = patch_path(url, fetch, workdir, expand)
+        if not local:
+            if all:
+                local = fetch.localpath(url)
+                sources.append(local)
+            continue
+
+        urldata = fetch.ud[url]
+        parm = urldata.parm
+        patchname = parm.get('pname') or os.path.basename(local)
+
+        apply, reason = should_apply(parm, d)
+        if not apply:
+            if reason:
+                bb.note("Patch %s %s" % (patchname, reason))
+            continue
+
+        patchparm = {'patchname': patchname}
+        if "striplevel" in parm:
+            striplevel = parm["striplevel"]
+        elif "pnum" in parm:
+            #bb.msg.warn(None, "Deprecated usage of 'pnum' url parameter in '%s', please use 'striplevel'" % url)
+            striplevel = parm["pnum"]
+        else:
+            striplevel = '1'
+        patchparm['striplevel'] = striplevel
+
+        patchdir = parm.get('patchdir')
+        if patchdir:
+            patchparm['patchdir'] = patchdir
+
+        localurl = bb.fetch.encodeurl(('file', '', local, '', '', patchparm))
+        patches.append(localurl)
+
+    if all:
+        return sources
+
+    return patches
+
+
+def should_apply(parm, d):
+    if "mindate" in parm or "maxdate" in parm:
+        pn = d.getVar('PN')
+        srcdate = d.getVar('SRCDATE_%s' % pn)
+        if not srcdate:
+            srcdate = d.getVar('SRCDATE')
+
+        if srcdate == "now":
+            srcdate = d.getVar('DATE')
+
+        if "maxdate" in parm and parm["maxdate"] < srcdate:
+            return False, 'is outdated'
+
+        if "mindate" in parm and parm["mindate"] > srcdate:
+            return False, 'is predated'
+
+
+    if "minrev" in parm:
+        srcrev = d.getVar('SRCREV')
+        if srcrev and srcrev < parm["minrev"]:
+            return False, 'applies to later revisions'
+
+    if "maxrev" in parm:
+        srcrev = d.getVar('SRCREV')
+        if srcrev and srcrev > parm["maxrev"]:
+            return False, 'applies to earlier revisions'
+
+    if "rev" in parm:
+        srcrev = d.getVar('SRCREV')
+        if srcrev and parm["rev"] not in srcrev:
+            return False, "doesn't apply to revision"
+
+    if "notrev" in parm:
+        srcrev = d.getVar('SRCREV')
+        if srcrev and parm["notrev"] in srcrev:
+            return False, "doesn't apply to revision"
+
+    return True, None
+
diff --git a/import-layers/yocto-poky/meta/lib/oe/path.py b/import-layers/yocto-poky/meta/lib/oe/path.py
index ed7fd1e..448a2b9 100644
--- a/import-layers/yocto-poky/meta/lib/oe/path.py
+++ b/import-layers/yocto-poky/meta/lib/oe/path.py
@@ -50,9 +50,30 @@
     os.remove(path)
     os.symlink(base, path)
 
+def replace_absolute_symlinks(basedir, d):
+    """
+    Walk basedir looking for absolute symlinks and replacing them with relative ones.
+    The absolute links are assumed to be relative to basedir
+    (compared to make_relative_symlink above which tries to compute common ancestors
+    using pattern matching instead)
+    """
+    for walkroot, dirs, files in os.walk(basedir):
+        for file in files + dirs:
+            path = os.path.join(walkroot, file)
+            if not os.path.islink(path):
+                continue
+            link = os.readlink(path)
+            if not os.path.isabs(link):
+                continue
+            walkdir = os.path.dirname(path.rpartition(basedir)[2])
+            base = os.path.relpath(link, walkdir)
+            bb.debug(2, "Replacing absolute path %s with relative path %s" % (link, base))
+            os.remove(path)
+            os.symlink(base, path)
+
 def format_display(path, metadata):
     """ Prepare a path for display to the user. """
-    rel = relative(metadata.getVar("TOPDIR", True), path)
+    rel = relative(metadata.getVar("TOPDIR"), path)
     if len(rel) > len(path):
         return path
     else:
@@ -81,7 +102,6 @@
         subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
         source = ''
         if os.path.isdir(src):
-            import glob
             if len(glob.glob('%s/.??*' % src)) > 0:
                 source = './.??* '
             source += './*'
@@ -95,7 +115,14 @@
         copytree(src, dst)
 
 def remove(path, recurse=True):
-    """Equivalent to rm -f or rm -rf"""
+    """
+    Equivalent to rm -f or rm -rf
+    NOTE: be careful about passing paths that may contain filenames with
+    wildcards in them (as opposed to passing an actual wildcarded path) -
+    since we use glob.glob() to expand the path. Filenames containing
+    square brackets are particularly problematic since the they may not
+    actually expand to match the original filename.
+    """
     for name in glob.glob(path):
         try:
             os.unlink(name)
diff --git a/import-layers/yocto-poky/meta/lib/oe/prservice.py b/import-layers/yocto-poky/meta/lib/oe/prservice.py
index 0054f95..32dfc15 100644
--- a/import-layers/yocto-poky/meta/lib/oe/prservice.py
+++ b/import-layers/yocto-poky/meta/lib/oe/prservice.py
@@ -1,7 +1,7 @@
 
 def prserv_make_conn(d, check = False):
     import prserv.serv
-    host_params = list([_f for _f in (d.getVar("PRSERV_HOST", True) or '').split(':') if _f])
+    host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f])
     try:
         conn = None
         conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1]))
@@ -15,11 +15,11 @@
     return conn
 
 def prserv_dump_db(d):
-    if not d.getVar('PRSERV_HOST', True):
+    if not d.getVar('PRSERV_HOST'):
         bb.error("Not using network based PR service")
         return None
 
-    conn = d.getVar("__PRSERV_CONN", True)
+    conn = d.getVar("__PRSERV_CONN")
     if conn is None:
         conn = prserv_make_conn(d)
         if conn is None:
@@ -27,18 +27,18 @@
             return None
 
     #dump db
-    opt_version = d.getVar('PRSERV_DUMPOPT_VERSION', True)
-    opt_pkgarch = d.getVar('PRSERV_DUMPOPT_PKGARCH', True)
-    opt_checksum = d.getVar('PRSERV_DUMPOPT_CHECKSUM', True)
-    opt_col = ("1" == d.getVar('PRSERV_DUMPOPT_COL', True))
+    opt_version = d.getVar('PRSERV_DUMPOPT_VERSION')
+    opt_pkgarch = d.getVar('PRSERV_DUMPOPT_PKGARCH')
+    opt_checksum = d.getVar('PRSERV_DUMPOPT_CHECKSUM')
+    opt_col = ("1" == d.getVar('PRSERV_DUMPOPT_COL'))
     return conn.export(opt_version, opt_pkgarch, opt_checksum, opt_col)
 
 def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksum=None):
-    if not d.getVar('PRSERV_HOST', True):
+    if not d.getVar('PRSERV_HOST'):
         bb.error("Not using network based PR service")
         return None
 
-    conn = d.getVar("__PRSERV_CONN", True)
+    conn = d.getVar("__PRSERV_CONN")
     if conn is None:
         conn = prserv_make_conn(d)
         if conn is None:
@@ -58,7 +58,7 @@
                (filter_checksum and filter_checksum != checksum):
                continue
             try:
-                value = int(d.getVar(remain + '$' + version + '$' + pkgarch + '$' + checksum, True))
+                value = int(d.getVar(remain + '$' + version + '$' + pkgarch + '$' + checksum))
             except BaseException as exc:
                 bb.debug("Not valid value of %s:%s" % (v,str(exc)))
                 continue
@@ -72,8 +72,8 @@
 def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False):
     import bb.utils
     #initilize the output file
-    bb.utils.mkdirhier(d.getVar('PRSERV_DUMPDIR', True))
-    df = d.getVar('PRSERV_DUMPFILE', True)
+    bb.utils.mkdirhier(d.getVar('PRSERV_DUMPDIR'))
+    df = d.getVar('PRSERV_DUMPFILE')
     #write data
     lf = bb.utils.lockfile("%s.lock" % df)
     f = open(df, "a")
@@ -114,7 +114,7 @@
     bb.utils.unlockfile(lf)
 
 def prserv_check_avail(d):
-    host_params = list([_f for _f in (d.getVar("PRSERV_HOST", True) or '').split(':') if _f])
+    host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f])
     try:
         if len(host_params) != 2:
             raise TypeError
diff --git a/import-layers/yocto-poky/meta/lib/oe/qa.py b/import-layers/yocto-poky/meta/lib/oe/qa.py
index 22d76dc..3231e60 100644
--- a/import-layers/yocto-poky/meta/lib/oe/qa.py
+++ b/import-layers/yocto-poky/meta/lib/oe/qa.py
@@ -129,11 +129,11 @@
         if cmd in self.objdump_output:
             return self.objdump_output[cmd]
 
-        objdump = d.getVar('OBJDUMP', True)
+        objdump = d.getVar('OBJDUMP')
 
         env = os.environ.copy()
         env["LC_ALL"] = "C"
-        env["PATH"] = d.getVar('PATH', True)
+        env["PATH"] = d.getVar('PATH')
 
         try:
             bb.note("%s %s %s" % (objdump, cmd, self.name))
diff --git a/import-layers/yocto-poky/meta/lib/oe/recipeutils.py b/import-layers/yocto-poky/meta/lib/oe/recipeutils.py
index 58e4028..a7fdd36 100644
--- a/import-layers/yocto-poky/meta/lib/oe/recipeutils.py
+++ b/import-layers/yocto-poky/meta/lib/oe/recipeutils.py
@@ -29,18 +29,9 @@
 
 def pn_to_recipe(cooker, pn, mc=''):
     """Convert a recipe name (PN) to the path to the recipe file"""
-    import bb.providers
 
-    if pn in cooker.recipecaches[mc].pkg_pn:
-        best = bb.providers.findBestProvider(pn, cooker.data, cooker.recipecaches[mc], cooker.recipecaches[mc].pkg_pn)
-        return best[3]
-    elif pn in cooker.recipecaches[mc].providers:
-        filenames = cooker.recipecaches[mc].providers[pn]
-        eligible, foundUnique = bb.providers.filterProviders(filenames, pn, cooker.expanded_data, cooker.recipecaches[mc])
-        filename = eligible[0]
-        return filename
-    else:
-        return None
+    best = cooker.findBestProvider(pn, mc)
+    return best[3]
 
 
 def get_unavailable_reasons(cooker, pn):
@@ -61,28 +52,6 @@
     return envdata
 
 
-def parse_recipe_simple(cooker, pn, d, appends=True):
-    """
-    Parse a recipe and optionally all bbappends that apply to it
-    in the current configuration.
-    """
-    import bb.providers
-
-    recipefile = pn_to_recipe(cooker, pn)
-    if not recipefile:
-        skipreasons = get_unavailable_reasons(cooker, pn)
-        # We may as well re-use bb.providers.NoProvider here
-        if skipreasons:
-            raise bb.providers.NoProvider(skipreasons)
-        else:
-            raise bb.providers.NoProvider('Unable to find any recipe file matching %s' % pn)
-    if appends:
-        appendfiles = cooker.collection.get_file_appends(recipefile)
-    else:
-        appendfiles = None
-    return parse_recipe(cooker, recipefile, appendfiles)
-
-
 def get_var_files(fn, varlist, d):
     """Find the file in which each of a list of variables is set.
     Note: requires variable history to be enabled when parsing.
@@ -359,16 +328,16 @@
 
     # FIXME need a warning if the unexpanded SRC_URI value contains variable references
 
-    uris = (d.getVar('SRC_URI', True) or "").split()
+    uris = (d.getVar('SRC_URI') or "").split()
     fetch = bb.fetch2.Fetch(uris, d)
     if download:
         fetch.download()
 
     # Copy local files to target directory and gather any remote files
-    bb_dir = os.path.dirname(d.getVar('FILE', True)) + os.sep
+    bb_dir = os.path.dirname(d.getVar('FILE')) + os.sep
     remotes = []
     copied = []
-    includes = [path for path in d.getVar('BBINCLUDED', True).split() if
+    includes = [path for path in d.getVar('BBINCLUDED').split() if
                 path.startswith(bb_dir) and os.path.exists(path)]
     for path in fetch.localpaths() + includes:
         # Only import files that are under the meta directory
@@ -389,15 +358,21 @@
     return copied, remotes
 
 
-def get_recipe_local_files(d, patches=False):
+def get_recipe_local_files(d, patches=False, archives=False):
     """Get a list of local files in SRC_URI within a recipe."""
-    uris = (d.getVar('SRC_URI', True) or "").split()
+    import oe.patch
+    uris = (d.getVar('SRC_URI') or "").split()
     fetch = bb.fetch2.Fetch(uris, d)
+    # FIXME this list should be factored out somewhere else (such as the
+    # fetcher) though note that this only encompasses actual container formats
+    # i.e. that can contain multiple files as opposed to those that only
+    # contain a compressed stream (i.e. .tar.gz as opposed to just .gz)
+    archive_exts = ['.tar', '.tgz', '.tar.gz', '.tar.Z', '.tbz', '.tbz2', '.tar.bz2', '.tar.xz', '.tar.lz', '.zip', '.jar', '.rpm', '.srpm', '.deb', '.ipk', '.tar.7z', '.7z']
     ret = {}
     for uri in uris:
         if fetch.ud[uri].type == 'file':
             if (not patches and
-                    bb.utils.exec_flat_python_func('patch_path', uri, fetch, '')):
+                    oe.patch.patch_path(uri, fetch, '', expand=False)):
                 continue
             # Skip files that are referenced by absolute path
             fname = fetch.ud[uri].basepath
@@ -409,16 +384,22 @@
                 if os.path.isabs(subdir):
                     continue
                 fname = os.path.join(subdir, fname)
-            ret[fname] = fetch.localpath(uri)
+            localpath = fetch.localpath(uri)
+            if not archives:
+                # Ignore archives that will be unpacked
+                if localpath.endswith(tuple(archive_exts)):
+                    unpack = fetch.ud[uri].parm.get('unpack', True)
+                    if unpack:
+                        continue
+            ret[fname] = localpath
     return ret
 
 
 def get_recipe_patches(d):
     """Get a list of the patches included in SRC_URI within a recipe."""
+    import oe.patch
+    patches = oe.patch.src_patches(d, expand=False)
     patchfiles = []
-    # Execute src_patches() defined in patch.bbclass - this works since that class
-    # is inherited globally
-    patches = bb.utils.exec_flat_python_func('src_patches', d)
     for patch in patches:
         _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
         patchfiles.append(local)
@@ -435,14 +416,12 @@
         change mode ('A' for add, 'D' for delete or 'M' for modify)
     """
     import oe.patch
-    # Execute src_patches() defined in patch.bbclass - this works since that class
-    # is inherited globally
-    patches = bb.utils.exec_flat_python_func('src_patches', d)
+    patches = oe.patch.src_patches(d, expand=False)
     patchedfiles = {}
     for patch in patches:
         _, _, patchfile, _, _, parm = bb.fetch.decodeurl(patch)
         striplevel = int(parm['striplevel'])
-        patchedfiles[patchfile] = oe.patch.PatchSet.getPatchedFiles(patchfile, striplevel, os.path.join(d.getVar('S', True), parm.get('patchdir', '')))
+        patchedfiles[patchfile] = oe.patch.PatchSet.getPatchedFiles(patchfile, striplevel, os.path.join(d.getVar('S'), parm.get('patchdir', '')))
     return patchedfiles
 
 
@@ -480,9 +459,9 @@
     confdata.setVar('LAYERDIR', destlayerdir)
     destlayerconf = os.path.join(destlayerdir, "conf", "layer.conf")
     confdata = bb.cookerdata.parse_config_file(destlayerconf, confdata)
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
 
-    bbfilespecs = (confdata.getVar('BBFILES', True) or '').split()
+    bbfilespecs = (confdata.getVar('BBFILES') or '').split()
     if destdir == destlayerdir:
         for bbfilespec in bbfilespecs:
             if not bbfilespec.endswith('.bbappend'):
@@ -495,8 +474,8 @@
 
     # Try to make up a path that matches BBFILES
     # this is a little crude, but better than nothing
-    bpn = d.getVar('BPN', True)
-    recipefn = os.path.basename(d.getVar('FILE', True))
+    bpn = d.getVar('BPN')
+    recipefn = os.path.basename(d.getVar('FILE'))
     pathoptions = [destdir]
     if extrapathhint:
         pathoptions.append(os.path.join(destdir, extrapathhint))
@@ -520,7 +499,7 @@
     import bb.cookerdata
 
     destlayerdir = os.path.abspath(destlayerdir)
-    recipefile = d.getVar('FILE', True)
+    recipefile = d.getVar('FILE')
     recipefn = os.path.splitext(os.path.basename(recipefile))[0]
     if wildcardver and '_' in recipefn:
         recipefn = recipefn.split('_', 1)[0] + '_%'
@@ -540,7 +519,7 @@
     appendpath = os.path.join(destlayerdir, os.path.relpath(os.path.dirname(recipefile), origlayerdir), appendfn)
     closepath = ''
     pathok = True
-    for bbfilespec in confdata.getVar('BBFILES', True).split():
+    for bbfilespec in confdata.getVar('BBFILES').split():
         if fnmatch.fnmatchcase(appendpath, bbfilespec):
             # Our append path works, we're done
             break
@@ -613,7 +592,7 @@
 
     # FIXME check if the bbappend doesn't get overridden by a higher priority layer?
 
-    layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS', True).split()]
+    layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
     if not os.path.abspath(destlayerdir) in layerdirs:
         bb.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active')
 
@@ -649,7 +628,7 @@
         else:
             bbappendlines.append((varname, op, value))
 
-    destsubdir = rd.getVar('PN', True)
+    destsubdir = rd.getVar('PN')
     if srcfiles:
         bbappendlines.append(('FILESEXTRAPATHS_prepend', ':=', '${THISDIR}/${PN}:'))
 
@@ -668,7 +647,7 @@
                 srcurientry = 'file://%s' % srcfile
                 # Double-check it's not there already
                 # FIXME do we care if the entry is added by another bbappend that might go away?
-                if not srcurientry in rd.getVar('SRC_URI', True).split():
+                if not srcurientry in rd.getVar('SRC_URI').split():
                     if machine:
                         appendline('SRC_URI_append%s' % appendoverride, '=', ' ' + srcurientry)
                     else:
@@ -786,7 +765,11 @@
         for newfile, srcfile in copyfiles.items():
             filedest = os.path.join(appenddir, destsubdir, os.path.basename(srcfile))
             if os.path.abspath(newfile) != os.path.abspath(filedest):
-                bb.note('Copying %s to %s' % (newfile, filedest))
+                if newfile.startswith(tempfile.gettempdir()):
+                    newfiledisp = os.path.basename(newfile)
+                else:
+                    newfiledisp = newfile
+                bb.note('Copying %s to %s' % (newfiledisp, filedest))
                 bb.utils.mkdirhier(os.path.dirname(filedest))
                 shutil.copyfile(newfile, filedest)
 
@@ -813,7 +796,7 @@
     # Sort by length so we get the variables we're interested in first
     for var in sorted(list(d.keys()), key=len):
         if var.endswith('dir') and var.lower() == var:
-            value = d.getVar(var, True)
+            value = d.getVar(var)
             if value.startswith('/') and not '\n' in value and value not in dirvars:
                 dirvars[value] = var
     for dirpath in sorted(list(dirvars.keys()), reverse=True):
@@ -867,12 +850,12 @@
     ru['type'] = 'U'
     ru['datetime'] = ''
 
-    pv = rd.getVar('PV', True)
+    pv = rd.getVar('PV')
 
     # XXX: If don't have SRC_URI means that don't have upstream sources so
     # returns the current recipe version, so that upstream version check
     # declares a match.
-    src_uris = rd.getVar('SRC_URI', True)
+    src_uris = rd.getVar('SRC_URI')
     if not src_uris:
         ru['version'] = pv
         ru['type'] = 'M'
@@ -883,13 +866,13 @@
     src_uri = src_uris.split()[0]
     uri_type, _, _, _, _, _ =  decodeurl(src_uri)
 
-    manual_upstream_version = rd.getVar("RECIPE_UPSTREAM_VERSION", True)
+    manual_upstream_version = rd.getVar("RECIPE_UPSTREAM_VERSION")
     if manual_upstream_version:
         # manual tracking of upstream version.
         ru['version'] = manual_upstream_version
         ru['type'] = 'M'
 
-        manual_upstream_date = rd.getVar("CHECK_DATE", True)
+        manual_upstream_date = rd.getVar("CHECK_DATE")
         if manual_upstream_date:
             date = datetime.strptime(manual_upstream_date, "%b %d, %Y")
         else:
diff --git a/import-layers/yocto-poky/meta/lib/oe/rootfs.py b/import-layers/yocto-poky/meta/lib/oe/rootfs.py
index f967883..96591f3 100644
--- a/import-layers/yocto-poky/meta/lib/oe/rootfs.py
+++ b/import-layers/yocto-poky/meta/lib/oe/rootfs.py
@@ -15,12 +15,13 @@
     This is an abstract class. Do not instantiate this directly.
     """
 
-    def __init__(self, d, progress_reporter=None):
+    def __init__(self, d, progress_reporter=None, logcatcher=None):
         self.d = d
         self.pm = None
-        self.image_rootfs = self.d.getVar('IMAGE_ROOTFS', True)
-        self.deploydir = self.d.getVar('IMGDEPLOYDIR', True)
+        self.image_rootfs = self.d.getVar('IMAGE_ROOTFS')
+        self.deploydir = self.d.getVar('IMGDEPLOYDIR')
         self.progress_reporter = progress_reporter
+        self.logcatcher = logcatcher
 
         self.install_order = Manifest.INSTALL_ORDER
 
@@ -53,6 +54,8 @@
         messages = []
         with open(log_path, 'r') as log:
             for line in log:
+                if self.logcatcher and self.logcatcher.contains(line.rstrip()):
+                    continue
                 for ee in excludes:
                     m = ee.search(line)
                     if m:
@@ -69,7 +72,7 @@
             else:
                 msg = '%d %s messages' % (len(messages), type)
             msg = '[log_check] %s: found %s in the logfile:\n%s' % \
-                (self.d.getVar('PN', True), msg, ''.join(messages))
+                (self.d.getVar('PN'), msg, ''.join(messages))
             if type == 'error':
                 bb.fatal(msg)
             else:
@@ -84,7 +87,10 @@
     def _insert_feed_uris(self):
         if bb.utils.contains("IMAGE_FEATURES", "package-management",
                          True, False, self.d):
-            self.pm.insert_feeds_uris()
+            self.pm.insert_feeds_uris(self.d.getVar('PACKAGE_FEED_URIS') or "",
+                self.d.getVar('PACKAGE_FEED_BASE_PATHS') or "",
+                self.d.getVar('PACKAGE_FEED_ARCHS'))
+
 
     @abstractmethod
     def _handle_intercept_failure(self, failed_script):
@@ -100,7 +106,7 @@
         pass
 
     def _setup_dbg_rootfs(self, dirs):
-        gen_debugfs = self.d.getVar('IMAGE_GEN_DEBUGFS', True) or '0'
+        gen_debugfs = self.d.getVar('IMAGE_GEN_DEBUGFS') or '0'
         if gen_debugfs != '1':
            return
 
@@ -153,7 +159,7 @@
         os.rename(self.image_rootfs + '-orig', self.image_rootfs)
 
     def _exec_shell_cmd(self, cmd):
-        fakerootcmd = self.d.getVar('FAKEROOT', True)
+        fakerootcmd = self.d.getVar('FAKEROOT')
         if fakerootcmd is not None:
             exec_cmd = [fakerootcmd, cmd]
         else:
@@ -168,14 +174,14 @@
 
     def create(self):
         bb.note("###### Generate rootfs #######")
-        pre_process_cmds = self.d.getVar("ROOTFS_PREPROCESS_COMMAND", True)
-        post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND", True)
-        rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND', True)
+        pre_process_cmds = self.d.getVar("ROOTFS_PREPROCESS_COMMAND")
+        post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND")
+        rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND')
 
-        postinst_intercepts_dir = self.d.getVar("POSTINST_INTERCEPTS_DIR", True)
+        postinst_intercepts_dir = self.d.getVar("POSTINST_INTERCEPTS_DIR")
         if not postinst_intercepts_dir:
             postinst_intercepts_dir = self.d.expand("${COREBASE}/scripts/postinst-intercepts")
-        intercepts_dir = os.path.join(self.d.getVar('WORKDIR', True),
+        intercepts_dir = os.path.join(self.d.getVar('WORKDIR'),
                                       "intercept_scripts")
 
         bb.utils.remove(intercepts_dir, True)
@@ -194,10 +200,10 @@
         # call the package manager dependent create method
         self._create()
 
-        sysconfdir = self.image_rootfs + self.d.getVar('sysconfdir', True)
+        sysconfdir = self.image_rootfs + self.d.getVar('sysconfdir')
         bb.utils.mkdirhier(sysconfdir)
         with open(sysconfdir + "/version", "w+") as ver:
-            ver.write(self.d.getVar('BUILDNAME', True) + "\n")
+            ver.write(self.d.getVar('BUILDNAME') + "\n")
 
         execute_pre_post_process(self.d, rootfs_post_install_cmds)
 
@@ -216,7 +222,7 @@
                          "offline and rootfs is read-only: %s" %
                          delayed_postinsts)
 
-        if self.d.getVar('USE_DEVFS', True) != "1":
+        if self.d.getVar('USE_DEVFS') != "1":
             self._create_devfs()
 
         self._uninstall_unneeded()
@@ -228,7 +234,7 @@
 
         self._run_ldconfig()
 
-        if self.d.getVar('USE_DEPMOD', True) != "0":
+        if self.d.getVar('USE_DEPMOD') != "0":
             self._generate_kernel_module_deps()
 
         self._cleanup()
@@ -244,18 +250,23 @@
         if delayed_postinsts is None:
             if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts")):
                 self._exec_shell_cmd(["update-rc.d", "-f", "-r",
-                                      self.d.getVar('IMAGE_ROOTFS', True),
+                                      self.d.getVar('IMAGE_ROOTFS'),
                                       "run-postinsts", "remove"])
 
         image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
                                         True, False, self.d)
-        image_rorfs_force = self.d.getVar('FORCE_RO_REMOVE', True)
+        image_rorfs_force = self.d.getVar('FORCE_RO_REMOVE')
 
         if image_rorfs or image_rorfs_force == "1":
             # Remove components that we don't need if it's a read-only rootfs
-            unneeded_pkgs = self.d.getVar("ROOTFS_RO_UNNEEDED", True).split()
+            unneeded_pkgs = self.d.getVar("ROOTFS_RO_UNNEEDED").split()
             pkgs_installed = image_list_installed_packages(self.d)
-            pkgs_to_remove = [pkg for pkg in pkgs_installed if pkg in unneeded_pkgs]
+            # Make sure update-alternatives is last on the command line, so
+            # that it is removed last. This makes sure that its database is
+            # available while uninstalling packages, allowing alternative
+            # symlinks of packages to be uninstalled to be managed correctly.
+            provider = self.d.getVar("VIRTUAL-RUNTIME_update-alternatives")
+            pkgs_to_remove = sorted([pkg for pkg in pkgs_installed if pkg in unneeded_pkgs], key=lambda x: x == provider)
 
             if len(pkgs_to_remove) > 0:
                 self.pm.remove(pkgs_to_remove, False)
@@ -266,7 +277,7 @@
                 bb.warn("There are post install scripts "
                         "in a read-only rootfs")
 
-        post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND", True)
+        post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND")
         execute_pre_post_process(self.d, post_uninstall_cmds)
 
         runtime_pkgmanage = bb.utils.contains("IMAGE_FEATURES", "package-management",
@@ -276,12 +287,12 @@
             self.pm.remove_packaging_data()
 
     def _run_intercepts(self):
-        intercepts_dir = os.path.join(self.d.getVar('WORKDIR', True),
+        intercepts_dir = os.path.join(self.d.getVar('WORKDIR'),
                                       "intercept_scripts")
 
         bb.note("Running intercept scripts:")
         os.environ['D'] = self.image_rootfs
-        os.environ['STAGING_DIR_NATIVE'] = self.d.getVar('STAGING_DIR_NATIVE', True)
+        os.environ['STAGING_DIR_NATIVE'] = self.d.getVar('STAGING_DIR_NATIVE')
         for script in os.listdir(intercepts_dir):
             script_full = os.path.join(intercepts_dir, script)
 
@@ -291,10 +302,10 @@
             bb.note("> Executing %s intercept ..." % script)
 
             try:
-                subprocess.check_call(script_full)
+                subprocess.check_output(script_full)
             except subprocess.CalledProcessError as e:
-                bb.warn("The postinstall intercept hook '%s' failed (exit code: %d)! See log for details!" %
-                        (script, e.returncode))
+                bb.warn("The postinstall intercept hook '%s' failed (exit code: %d)! See log for details! (Output: %s)" %
+                        (script, e.returncode, e.output))
 
                 with open(script_full) as intercept:
                     registered_pkgs = None
@@ -313,7 +324,7 @@
                         self._handle_intercept_failure(registered_pkgs)
 
     def _run_ldconfig(self):
-        if self.d.getVar('LDCONFIGDEPEND', True):
+        if self.d.getVar('LDCONFIGDEPEND'):
             bb.note("Executing: ldconfig -r" + self.image_rootfs + "-c new -v")
             self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c',
                                   'new', '-v'])
@@ -333,7 +344,7 @@
             bb.note("No Kernel Modules found, not running depmod")
             return
 
-        kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR', True), "kernel-depmod",
+        kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR'), "kernel-depmod",
                                            'kernel-abiversion')
         if not os.path.exists(kernel_abi_ver_file):
             bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file)
@@ -355,15 +366,15 @@
     """
     def _create_devfs(self):
         devtable_list = []
-        devtable = self.d.getVar('IMAGE_DEVICE_TABLE', True)
+        devtable = self.d.getVar('IMAGE_DEVICE_TABLE')
         if devtable is not None:
             devtable_list.append(devtable)
         else:
-            devtables = self.d.getVar('IMAGE_DEVICE_TABLES', True)
+            devtables = self.d.getVar('IMAGE_DEVICE_TABLES')
             if devtables is None:
                 devtables = 'files/device_table-minimal.txt'
             for devtable in devtables.split():
-                devtable_list.append("%s" % bb.utils.which(self.d.getVar('BBPATH', True), devtable))
+                devtable_list.append("%s" % bb.utils.which(self.d.getVar('BBPATH'), devtable))
 
         for devtable in devtable_list:
             self._exec_shell_cmd(["makedevs", "-r",
@@ -371,24 +382,24 @@
 
 
 class RpmRootfs(Rootfs):
-    def __init__(self, d, manifest_dir, progress_reporter=None):
-        super(RpmRootfs, self).__init__(d, progress_reporter)
+    def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None):
+        super(RpmRootfs, self).__init__(d, progress_reporter, logcatcher)
         self.log_check_regex = '(unpacking of archive failed|Cannot find package'\
                                '|exit 1|ERROR: |Error: |Error |ERROR '\
                                '|Failed |Failed: |Failed$|Failed\(\d+\):)'
         self.manifest = RpmManifest(d, manifest_dir)
 
         self.pm = RpmPM(d,
-                        d.getVar('IMAGE_ROOTFS', True),
-                        self.d.getVar('TARGET_VENDOR', True)
+                        d.getVar('IMAGE_ROOTFS'),
+                        self.d.getVar('TARGET_VENDOR')
                         )
 
-        self.inc_rpm_image_gen = self.d.getVar('INC_RPM_IMAGE_GEN', True)
+        self.inc_rpm_image_gen = self.d.getVar('INC_RPM_IMAGE_GEN')
         if self.inc_rpm_image_gen != "1":
             bb.utils.remove(self.image_rootfs, True)
         else:
             self.pm.recovery_packaging_data()
-        bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS', True), True)
+        bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True)
 
         self.pm.create_configs()
 
@@ -420,10 +431,12 @@
                 bb.note('incremental removed: %s' % ' '.join(pkg_to_remove))
                 self.pm.remove(pkg_to_remove)
 
+            self.pm.autoremove()
+
     def _create(self):
         pkgs_to_install = self.manifest.parse_initial_manifest()
-        rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS', True)
-        rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS', True)
+        rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS')
+        rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS')
 
         # update PM index files
         self.pm.write_index()
@@ -433,8 +446,6 @@
         if self.progress_reporter:
             self.progress_reporter.next_stage()
 
-        self.pm.dump_all_available_pkgs()
-
         if self.inc_rpm_image_gen == "1":
             self._create_incremental(pkgs_to_install)
 
@@ -469,15 +480,13 @@
         if self.progress_reporter:
             self.progress_reporter.next_stage()
 
-        self._setup_dbg_rootfs(['/etc/rpm', '/var/lib/rpm', '/var/lib/smart'])
+        self._setup_dbg_rootfs(['/etc', '/var/lib/rpm', '/var/cache/dnf', '/var/lib/dnf'])
 
         execute_pre_post_process(self.d, rpm_post_process_cmds)
 
         if self.inc_rpm_image_gen == "1":
             self.pm.backup_packaging_data()
 
-        self.pm.rpm_setup_smart_target_config()
-
         if self.progress_reporter:
             self.progress_reporter.next_stage()
 
@@ -515,19 +524,11 @@
             self.pm.save_rpmpostinst(pkg)
 
     def _cleanup(self):
-        # during the execution of postprocess commands, rpm is called several
-        # times to get the files installed, dependencies, etc. This creates the
-        # __db.00* (Berkeley DB files that hold locks, rpm specific environment
-        # settings, etc.), that should not get into the final rootfs
-        self.pm.unlock_rpm_db()
-        if os.path.isdir(self.pm.install_dir_path + "/tmp") and not os.listdir(self.pm.install_dir_path + "/tmp"):
-           bb.utils.remove(self.pm.install_dir_path + "/tmp", True)
-        if os.path.isdir(self.pm.install_dir_path) and not os.listdir(self.pm.install_dir_path):
-           bb.utils.remove(self.pm.install_dir_path, True)
+        pass
 
 class DpkgOpkgRootfs(Rootfs):
-    def __init__(self, d, progress_reporter=None):
-        super(DpkgOpkgRootfs, self).__init__(d, progress_reporter)
+    def __init__(self, d, progress_reporter=None, logcatcher=None):
+        super(DpkgOpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
 
     def _get_pkgs_postinsts(self, status_file):
         def _get_pkg_depends_list(pkg_depends):
@@ -594,7 +595,7 @@
         pkg_list = []
 
         pkgs = None
-        if not self.d.getVar('PACKAGE_INSTALL', True).strip():
+        if not self.d.getVar('PACKAGE_INSTALL').strip():
             bb.note("Building empty image")
         else:
             pkgs = self._get_pkgs_postinsts(status_file)
@@ -621,8 +622,8 @@
             num += 1
 
 class DpkgRootfs(DpkgOpkgRootfs):
-    def __init__(self, d, manifest_dir, progress_reporter=None):
-        super(DpkgRootfs, self).__init__(d, progress_reporter)
+    def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None):
+        super(DpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
         self.log_check_regex = '^E:'
         self.log_check_expected_regexes = \
         [
@@ -630,17 +631,17 @@
         ]
 
         bb.utils.remove(self.image_rootfs, True)
-        bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS', True), True)
+        bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True)
         self.manifest = DpkgManifest(d, manifest_dir)
-        self.pm = DpkgPM(d, d.getVar('IMAGE_ROOTFS', True),
-                         d.getVar('PACKAGE_ARCHS', True),
-                         d.getVar('DPKG_ARCH', True))
+        self.pm = DpkgPM(d, d.getVar('IMAGE_ROOTFS'),
+                         d.getVar('PACKAGE_ARCHS'),
+                         d.getVar('DPKG_ARCH'))
 
 
     def _create(self):
         pkgs_to_install = self.manifest.parse_initial_manifest()
-        deb_pre_process_cmds = self.d.getVar('DEB_PREPROCESS_COMMANDS', True)
-        deb_post_process_cmds = self.d.getVar('DEB_POSTPROCESS_COMMANDS', True)
+        deb_pre_process_cmds = self.d.getVar('DEB_PREPROCESS_COMMANDS')
+        deb_post_process_cmds = self.d.getVar('DEB_POSTPROCESS_COMMANDS')
 
         alt_dir = self.d.expand("${IMAGE_ROOTFS}/var/lib/dpkg/alternatives")
         bb.utils.mkdirhier(alt_dir)
@@ -713,15 +714,15 @@
 
 
 class OpkgRootfs(DpkgOpkgRootfs):
-    def __init__(self, d, manifest_dir, progress_reporter=None):
-        super(OpkgRootfs, self).__init__(d, progress_reporter)
+    def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None):
+        super(OpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
         self.log_check_regex = '(exit 1|Collected errors)'
 
         self.manifest = OpkgManifest(d, manifest_dir)
-        self.opkg_conf = self.d.getVar("IPKGCONF_TARGET", True)
-        self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True)
+        self.opkg_conf = self.d.getVar("IPKGCONF_TARGET")
+        self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS")
 
-        self.inc_opkg_image_gen = self.d.getVar('INC_IPK_IMAGE_GEN', True) or ""
+        self.inc_opkg_image_gen = self.d.getVar('INC_IPK_IMAGE_GEN') or ""
         if self._remove_old_rootfs():
             bb.utils.remove(self.image_rootfs, True)
             self.pm = OpkgPM(d,
@@ -735,7 +736,7 @@
                              self.pkg_archs)
             self.pm.recover_packaging_data()
 
-        bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS', True), True)
+        bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True)
 
     def _prelink_file(self, root_dir, filename):
         bb.note('prelink %s in %s' % (filename, root_dir))
@@ -790,7 +791,7 @@
     """
     def _multilib_sanity_test(self, dirs):
 
-        allow_replace = self.d.getVar("MULTILIBRE_ALLOW_REP", True)
+        allow_replace = self.d.getVar("MULTILIBRE_ALLOW_REP")
         if allow_replace is None:
             allow_replace = ""
 
@@ -822,12 +823,12 @@
                         files[key] = item
 
     def _multilib_test_install(self, pkgs):
-        ml_temp = self.d.getVar("MULTILIB_TEMP_ROOTFS", True)
+        ml_temp = self.d.getVar("MULTILIB_TEMP_ROOTFS")
         bb.utils.mkdirhier(ml_temp)
 
         dirs = [self.image_rootfs]
 
-        for variant in self.d.getVar("MULTILIB_VARIANTS", True).split():
+        for variant in self.d.getVar("MULTILIB_VARIANTS").split():
             ml_target_rootfs = os.path.join(ml_temp, variant)
 
             bb.utils.remove(ml_target_rootfs, True)
@@ -887,9 +888,9 @@
             old_vars_list = open(vars_list_file, 'r+').read()
 
         new_vars_list = '%s:%s:%s\n' % \
-                ((self.d.getVar('BAD_RECOMMENDATIONS', True) or '').strip(),
-                 (self.d.getVar('NO_RECOMMENDATIONS', True) or '').strip(),
-                 (self.d.getVar('PACKAGE_EXCLUDE', True) or '').strip())
+                ((self.d.getVar('BAD_RECOMMENDATIONS') or '').strip(),
+                 (self.d.getVar('NO_RECOMMENDATIONS') or '').strip(),
+                 (self.d.getVar('PACKAGE_EXCLUDE') or '').strip())
         open(vars_list_file, 'w+').write(new_vars_list)
 
         if old_vars_list != new_vars_list:
@@ -899,11 +900,11 @@
 
     def _create(self):
         pkgs_to_install = self.manifest.parse_initial_manifest()
-        opkg_pre_process_cmds = self.d.getVar('OPKG_PREPROCESS_COMMANDS', True)
-        opkg_post_process_cmds = self.d.getVar('OPKG_POSTPROCESS_COMMANDS', True)
+        opkg_pre_process_cmds = self.d.getVar('OPKG_PREPROCESS_COMMANDS')
+        opkg_post_process_cmds = self.d.getVar('OPKG_POSTPROCESS_COMMANDS')
 
         # update PM index files, unless users provide their own feeds
-        if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1":
+        if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") != "1":
             self.pm.write_index()
 
         execute_pre_post_process(self.d, opkg_pre_process_cmds)
@@ -945,9 +946,9 @@
         if self.progress_reporter:
             self.progress_reporter.next_stage()
 
-        opkg_lib_dir = self.d.getVar('OPKGLIBDIR', True)
+        opkg_lib_dir = self.d.getVar('OPKGLIBDIR')
         opkg_dir = os.path.join(opkg_lib_dir, 'opkg')
-        self._setup_dbg_rootfs(['/etc', opkg_dir, '/usr/lib/ssl'])
+        self._setup_dbg_rootfs([opkg_dir])
 
         execute_pre_post_process(self.d, opkg_post_process_cmds)
 
@@ -963,7 +964,7 @@
 
     def _get_delayed_postinsts(self):
         status_file = os.path.join(self.image_rootfs,
-                                   self.d.getVar('OPKGLIBDIR', True).strip('/'),
+                                   self.d.getVar('OPKGLIBDIR').strip('/'),
                                    "opkg", "status")
         return self._get_delayed_postinsts_common(status_file)
 
@@ -988,20 +989,20 @@
             "deb": DpkgRootfs}[imgtype]
 
 def variable_depends(d, manifest_dir=None):
-    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    img_type = d.getVar('IMAGE_PKGTYPE')
     cls = get_class_for_type(img_type)
     return cls._depends_list()
 
-def create_rootfs(d, manifest_dir=None, progress_reporter=None):
+def create_rootfs(d, manifest_dir=None, progress_reporter=None, logcatcher=None):
     env_bkp = os.environ.copy()
 
-    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    img_type = d.getVar('IMAGE_PKGTYPE')
     if img_type == "rpm":
-        RpmRootfs(d, manifest_dir, progress_reporter).create()
+        RpmRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
     elif img_type == "ipk":
-        OpkgRootfs(d, manifest_dir, progress_reporter).create()
+        OpkgRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
     elif img_type == "deb":
-        DpkgRootfs(d, manifest_dir, progress_reporter).create()
+        DpkgRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
 
     os.environ.clear()
     os.environ.update(env_bkp)
@@ -1009,13 +1010,13 @@
 
 def image_list_installed_packages(d, rootfs_dir=None):
     if not rootfs_dir:
-        rootfs_dir = d.getVar('IMAGE_ROOTFS', True)
+        rootfs_dir = d.getVar('IMAGE_ROOTFS')
 
-    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    img_type = d.getVar('IMAGE_PKGTYPE')
     if img_type == "rpm":
         return RpmPkgsList(d, rootfs_dir).list_pkgs()
     elif img_type == "ipk":
-        return OpkgPkgsList(d, rootfs_dir, d.getVar("IPKGCONF_TARGET", True)).list_pkgs()
+        return OpkgPkgsList(d, rootfs_dir, d.getVar("IPKGCONF_TARGET")).list_pkgs()
     elif img_type == "deb":
         return DpkgPkgsList(d, rootfs_dir).list_pkgs()
 
diff --git a/import-layers/yocto-poky/meta/lib/oe/sdk.py b/import-layers/yocto-poky/meta/lib/oe/sdk.py
index c74525f..9fe1687 100644
--- a/import-layers/yocto-poky/meta/lib/oe/sdk.py
+++ b/import-layers/yocto-poky/meta/lib/oe/sdk.py
@@ -11,16 +11,16 @@
 class Sdk(object, metaclass=ABCMeta):
     def __init__(self, d, manifest_dir):
         self.d = d
-        self.sdk_output = self.d.getVar('SDK_OUTPUT', True)
-        self.sdk_native_path = self.d.getVar('SDKPATHNATIVE', True).strip('/')
-        self.target_path = self.d.getVar('SDKTARGETSYSROOT', True).strip('/')
-        self.sysconfdir = self.d.getVar('sysconfdir', True).strip('/')
+        self.sdk_output = self.d.getVar('SDK_OUTPUT')
+        self.sdk_native_path = self.d.getVar('SDKPATHNATIVE').strip('/')
+        self.target_path = self.d.getVar('SDKTARGETSYSROOT').strip('/')
+        self.sysconfdir = self.d.getVar('sysconfdir').strip('/')
 
         self.sdk_target_sysroot = os.path.join(self.sdk_output, self.target_path)
         self.sdk_host_sysroot = self.sdk_output
 
         if manifest_dir is None:
-            self.manifest_dir = self.d.getVar("SDK_DIR", True)
+            self.manifest_dir = self.d.getVar("SDK_DIR")
         else:
             self.manifest_dir = manifest_dir
 
@@ -40,12 +40,12 @@
 
         # Don't ship any libGL in the SDK
         self.remove(os.path.join(self.sdk_output, self.sdk_native_path,
-                         self.d.getVar('libdir_nativesdk', True).strip('/'),
+                         self.d.getVar('libdir_nativesdk').strip('/'),
                          "libGL*"))
 
         # Fix or remove broken .la files
         self.remove(os.path.join(self.sdk_output, self.sdk_native_path,
-                         self.d.getVar('libdir_nativesdk', True).strip('/'),
+                         self.d.getVar('libdir_nativesdk').strip('/'),
                          "*.la"))
 
         # Link the ld.so.cache file into the hosts filesystem
@@ -54,7 +54,7 @@
         self.mkdirhier(os.path.dirname(link_name))
         os.symlink("/etc/ld.so.cache", link_name)
 
-        execute_pre_post_process(self.d, self.d.getVar('SDK_POSTPROCESS_COMMAND', True))
+        execute_pre_post_process(self.d, self.d.getVar('SDK_POSTPROCESS_COMMAND'))
 
     def movefile(self, sourcefile, destdir):
         try:
@@ -85,7 +85,7 @@
             bb.warn("cannot remove SDK dir: %s" % path)
 
 class RpmSdk(Sdk):
-    def __init__(self, d, manifest_dir=None):
+    def __init__(self, d, manifest_dir=None, rpm_workdir="oe-sdk-repo"):
         super(RpmSdk, self).__init__(d, manifest_dir)
 
         self.target_manifest = RpmManifest(d, self.manifest_dir,
@@ -100,11 +100,17 @@
                               'pkgconfig'
                               ]
 
+        rpm_repo_workdir = "oe-sdk-repo"
+        if "sdk_ext" in d.getVar("BB_RUNTASK"):
+            rpm_repo_workdir = "oe-sdk-ext-repo"
+
+
         self.target_pm = RpmPM(d,
                                self.sdk_target_sysroot,
-                               self.d.getVar('TARGET_VENDOR', True),
+                               self.d.getVar('TARGET_VENDOR'),
                                'target',
-                               target_providename
+                               target_providename,
+                               rpm_repo_workdir=rpm_repo_workdir
                                )
 
         sdk_providename = ['/bin/sh',
@@ -118,11 +124,12 @@
 
         self.host_pm = RpmPM(d,
                              self.sdk_host_sysroot,
-                             self.d.getVar('SDK_VENDOR', True),
+                             self.d.getVar('SDK_VENDOR'),
                              'host',
                              sdk_providename,
                              "SDK_PACKAGE_ARCHS",
-                             "SDK_OS"
+                             "SDK_OS",
+                             rpm_repo_workdir=rpm_repo_workdir
                              )
 
     def _populate_sysroot(self, pm, manifest):
@@ -130,7 +137,6 @@
 
         pm.create_configs()
         pm.write_index()
-        pm.dump_all_available_pkgs()
         pm.update()
 
         pkgs = []
@@ -149,9 +155,9 @@
         bb.note("Installing TARGET packages")
         self._populate_sysroot(self.target_pm, self.target_manifest)
 
-        self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY', True))
+        self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
 
-        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND", True))
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
 
         if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
             self.target_pm.remove_packaging_data()
@@ -159,7 +165,7 @@
         bb.note("Installing NATIVESDK packages")
         self._populate_sysroot(self.host_pm, self.host_manifest)
 
-        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND", True))
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
 
         if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
             self.host_pm.remove_packaging_data()
@@ -167,7 +173,7 @@
         # Move host RPM library data
         native_rpm_state_dir = os.path.join(self.sdk_output,
                                             self.sdk_native_path,
-                                            self.d.getVar('localstatedir_nativesdk', True).strip('/'),
+                                            self.d.getVar('localstatedir_nativesdk').strip('/'),
                                             "lib",
                                             "rpm"
                                             )
@@ -188,7 +194,9 @@
                                                         True).strip('/'),
                                           )
         self.mkdirhier(native_sysconf_dir)
-        for f in glob.glob(os.path.join(self.sdk_output, "etc", "*")):
+        for f in glob.glob(os.path.join(self.sdk_output, "etc", "rpm*")):
+            self.movefile(f, native_sysconf_dir)
+        for f in glob.glob(os.path.join(self.sdk_output, "etc", "dnf", "*")):
             self.movefile(f, native_sysconf_dir)
         self.remove(os.path.join(self.sdk_output, "etc"), True)
 
@@ -197,8 +205,8 @@
     def __init__(self, d, manifest_dir=None):
         super(OpkgSdk, self).__init__(d, manifest_dir)
 
-        self.target_conf = self.d.getVar("IPKGCONF_TARGET", True)
-        self.host_conf = self.d.getVar("IPKGCONF_SDK", True)
+        self.target_conf = self.d.getVar("IPKGCONF_TARGET")
+        self.host_conf = self.d.getVar("IPKGCONF_SDK")
 
         self.target_manifest = OpkgManifest(d, self.manifest_dir,
                                             Manifest.MANIFEST_TYPE_SDK_TARGET)
@@ -206,15 +214,15 @@
                                           Manifest.MANIFEST_TYPE_SDK_HOST)
 
         self.target_pm = OpkgPM(d, self.sdk_target_sysroot, self.target_conf,
-                                self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True))
+                                self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS"))
 
         self.host_pm = OpkgPM(d, self.sdk_host_sysroot, self.host_conf,
-                              self.d.getVar("SDK_PACKAGE_ARCHS", True))
+                              self.d.getVar("SDK_PACKAGE_ARCHS"))
 
     def _populate_sysroot(self, pm, manifest):
         pkgs_to_install = manifest.parse_initial_manifest()
 
-        if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1":
+        if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") != "1":
             pm.write_index()
 
         pm.update()
@@ -228,9 +236,9 @@
         bb.note("Installing TARGET packages")
         self._populate_sysroot(self.target_pm, self.target_manifest)
 
-        self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY', True))
+        self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
 
-        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND", True))
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
 
         if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
             self.target_pm.remove_packaging_data()
@@ -238,7 +246,7 @@
         bb.note("Installing NATIVESDK packages")
         self._populate_sysroot(self.host_pm, self.host_manifest)
 
-        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND", True))
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
 
         if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
             self.host_pm.remove_packaging_data()
@@ -257,7 +265,7 @@
                               os.path.basename(self.host_conf)), 0o644)
 
         native_opkg_state_dir = os.path.join(self.sdk_output, self.sdk_native_path,
-                                             self.d.getVar('localstatedir_nativesdk', True).strip('/'),
+                                             self.d.getVar('localstatedir_nativesdk').strip('/'),
                                              "lib", "opkg")
         self.mkdirhier(native_opkg_state_dir)
         for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "opkg", "*")):
@@ -270,8 +278,8 @@
     def __init__(self, d, manifest_dir=None):
         super(DpkgSdk, self).__init__(d, manifest_dir)
 
-        self.target_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET", True), "apt")
-        self.host_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET", True), "apt-sdk")
+        self.target_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), "apt")
+        self.host_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), "apt-sdk")
 
         self.target_manifest = DpkgManifest(d, self.manifest_dir,
                                             Manifest.MANIFEST_TYPE_SDK_TARGET)
@@ -279,17 +287,17 @@
                                           Manifest.MANIFEST_TYPE_SDK_HOST)
 
         self.target_pm = DpkgPM(d, self.sdk_target_sysroot,
-                                self.d.getVar("PACKAGE_ARCHS", True),
-                                self.d.getVar("DPKG_ARCH", True),
+                                self.d.getVar("PACKAGE_ARCHS"),
+                                self.d.getVar("DPKG_ARCH"),
                                 self.target_conf_dir)
 
         self.host_pm = DpkgPM(d, self.sdk_host_sysroot,
-                              self.d.getVar("SDK_PACKAGE_ARCHS", True),
-                              self.d.getVar("DEB_SDK_ARCH", True),
+                              self.d.getVar("SDK_PACKAGE_ARCHS"),
+                              self.d.getVar("DEB_SDK_ARCH"),
                               self.host_conf_dir)
 
     def _copy_apt_dir_to(self, dst_dir):
-        staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE", True)
+        staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE")
 
         self.remove(dst_dir, True)
 
@@ -310,9 +318,9 @@
         bb.note("Installing TARGET packages")
         self._populate_sysroot(self.target_pm, self.target_manifest)
 
-        self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY', True))
+        self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
 
-        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND", True))
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
 
         self._copy_apt_dir_to(os.path.join(self.sdk_target_sysroot, "etc", "apt"))
 
@@ -322,7 +330,7 @@
         bb.note("Installing NATIVESDK packages")
         self._populate_sysroot(self.host_pm, self.host_manifest)
 
-        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND", True))
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
 
         self._copy_apt_dir_to(os.path.join(self.sdk_output, self.sdk_native_path,
                                            "etc", "apt"))
@@ -341,26 +349,26 @@
 
 def sdk_list_installed_packages(d, target, rootfs_dir=None):
     if rootfs_dir is None:
-        sdk_output = d.getVar('SDK_OUTPUT', True)
-        target_path = d.getVar('SDKTARGETSYSROOT', True).strip('/')
+        sdk_output = d.getVar('SDK_OUTPUT')
+        target_path = d.getVar('SDKTARGETSYSROOT').strip('/')
 
         rootfs_dir = [sdk_output, os.path.join(sdk_output, target_path)][target is True]
 
-    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    img_type = d.getVar('IMAGE_PKGTYPE')
     if img_type == "rpm":
         arch_var = ["SDK_PACKAGE_ARCHS", None][target is True]
         os_var = ["SDK_OS", None][target is True]
-        return RpmPkgsList(d, rootfs_dir, arch_var, os_var).list_pkgs()
+        return RpmPkgsList(d, rootfs_dir).list_pkgs()
     elif img_type == "ipk":
         conf_file_var = ["IPKGCONF_SDK", "IPKGCONF_TARGET"][target is True]
-        return OpkgPkgsList(d, rootfs_dir, d.getVar(conf_file_var, True)).list_pkgs()
+        return OpkgPkgsList(d, rootfs_dir, d.getVar(conf_file_var)).list_pkgs()
     elif img_type == "deb":
         return DpkgPkgsList(d, rootfs_dir).list_pkgs()
 
 def populate_sdk(d, manifest_dir=None):
     env_bkp = os.environ.copy()
 
-    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    img_type = d.getVar('IMAGE_PKGTYPE')
     if img_type == "rpm":
         RpmSdk(d, manifest_dir).populate()
     elif img_type == "ipk":
diff --git a/import-layers/yocto-poky/meta/lib/oe/sstatesig.py b/import-layers/yocto-poky/meta/lib/oe/sstatesig.py
index 8224e3a..b8dd4c8 100644
--- a/import-layers/yocto-poky/meta/lib/oe/sstatesig.py
+++ b/import-layers/yocto-poky/meta/lib/oe/sstatesig.py
@@ -20,8 +20,12 @@
     def isImage(fn):
         return "/image.bbclass" in " ".join(dataCache.inherits[fn])
 
-    # Always include our own inter-task dependencies
+    # (Almost) always include our own inter-task dependencies.
+    # The exception is the special do_kernel_configme->do_unpack_and_patch
+    # dependency from archiver.bbclass.
     if recipename == depname:
+        if task == "do_kernel_configme" and dep.endswith(".do_unpack_and_patch"):
+            return False
         return True
 
     # Quilt (patch application) changing isn't likely to affect anything
@@ -63,10 +67,10 @@
 
 def sstate_lockedsigs(d):
     sigs = {}
-    types = (d.getVar("SIGGEN_LOCKEDSIGS_TYPES", True) or "").split()
+    types = (d.getVar("SIGGEN_LOCKEDSIGS_TYPES") or "").split()
     for t in types:
         siggen_lockedsigs_var = "SIGGEN_LOCKEDSIGS_%s" % t
-        lockedsigs = (d.getVar(siggen_lockedsigs_var, True) or "").split()
+        lockedsigs = (d.getVar(siggen_lockedsigs_var) or "").split()
         for ls in lockedsigs:
             pn, task, h = ls.split(":", 2)
             if pn not in sigs:
@@ -77,8 +81,8 @@
 class SignatureGeneratorOEBasic(bb.siggen.SignatureGeneratorBasic):
     name = "OEBasic"
     def init_rundepcheck(self, data):
-        self.abisaferecipes = (data.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE", True) or "").split()
-        self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS", True) or "").split()
+        self.abisaferecipes = (data.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split()
+        self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS") or "").split()
         pass
     def rundep_check(self, fn, recipename, task, dep, depname, dataCache = None):
         return sstate_rundepfilter(self, fn, recipename, task, dep, depname, dataCache)
@@ -86,15 +90,15 @@
 class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
     name = "OEBasicHash"
     def init_rundepcheck(self, data):
-        self.abisaferecipes = (data.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE", True) or "").split()
-        self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS", True) or "").split()
+        self.abisaferecipes = (data.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split()
+        self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS") or "").split()
         self.lockedsigs = sstate_lockedsigs(data)
         self.lockedhashes = {}
         self.lockedpnmap = {}
         self.lockedhashfn = {}
-        self.machine = data.getVar("MACHINE", True)
+        self.machine = data.getVar("MACHINE")
         self.mismatch_msgs = []
-        self.unlockedrecipes = (data.getVar("SIGGEN_UNLOCKED_RECIPES", True) or
+        self.unlockedrecipes = (data.getVar("SIGGEN_UNLOCKED_RECIPES") or
                                 "").split()
         self.unlockedrecipes = { k: "" for k in self.unlockedrecipes }
         pass
@@ -197,7 +201,8 @@
             types[t].append(k)
 
         with open(sigfile, "w") as f:
-            for t in types:
+            l = sorted(types)
+            for t in l:
                 f.write('SIGGEN_LOCKEDSIGS_%s = "\\\n' % t)
                 types[t].sort()
                 sortedk = sorted(types[t], key=lambda k: self.lockedpnmap[k.rsplit(".",1)[0]])
@@ -208,7 +213,17 @@
                         continue
                     f.write("    " + self.lockedpnmap[fn] + ":" + task + ":" + self.taskhash[k] + " \\\n")
                 f.write('    "\n')
-            f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(list(types.keys()))))
+            f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(l)))
+
+    def dump_siglist(self, sigfile):
+        with open(sigfile, "w") as f:
+            tasks = []
+            for taskitem in self.taskhash:
+                (fn, task) = taskitem.rsplit(".", 1)
+                pn = self.lockedpnmap[fn]
+                tasks.append((pn, task, fn, self.taskhash[taskitem]))
+            for (pn, task, fn, taskhash) in sorted(tasks):
+                f.write('%s.%s %s %s\n' % (pn, task, fn, taskhash))
 
     def checkhashes(self, missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d):
         warn_msgs = []
@@ -224,13 +239,13 @@
                         sstate_missing_msgs.append("Locked sig is set for %s:%s (%s) yet not in sstate cache?"
                                                % (pn, sq_task[task], sq_hash[task]))
 
-        checklevel = d.getVar("SIGGEN_LOCKEDSIGS_TASKSIG_CHECK", True)
+        checklevel = d.getVar("SIGGEN_LOCKEDSIGS_TASKSIG_CHECK")
         if checklevel == 'warn':
             warn_msgs += self.mismatch_msgs
         elif checklevel == 'error':
             error_msgs += self.mismatch_msgs
 
-        checklevel = d.getVar("SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK", True)
+        checklevel = d.getVar("SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK")
         if checklevel == 'warn':
             warn_msgs += sstate_missing_msgs
         elif checklevel == 'error':
@@ -253,9 +268,6 @@
     import fnmatch
     import glob
 
-    if taskhashlist:
-        hashfiles = {}
-
     if not taskname:
         # We have to derive pn and taskname
         key = pn
@@ -265,8 +277,15 @@
         if key.startswith('virtual:native:'):
             pn = pn + '-native'
 
+    hashfiles = {}
     filedates = {}
 
+    def get_hashval(siginfo):
+        if siginfo.endswith('.siginfo'):
+            return siginfo.rpartition(':')[2].partition('_')[0]
+        else:
+            return siginfo.rpartition('.')[2]
+
     # First search in stamps dir
     localdata = d.createCopy()
     localdata.setVar('MULTIMACH_TARGET_SYS', '*')
@@ -274,7 +293,7 @@
     localdata.setVar('PV', '*')
     localdata.setVar('PR', '*')
     localdata.setVar('EXTENDPE', '')
-    stamp = localdata.getVar('STAMP', True)
+    stamp = localdata.getVar('STAMP')
     if pn.startswith("gcc-source"):
         # gcc-source shared workdir is a special case :(
         stamp = localdata.expand("${STAMPS_DIR}/work-shared/gcc-${PV}-${PR}")
@@ -296,6 +315,8 @@
                 filedates[fullpath] = os.stat(fullpath).st_mtime
             except OSError:
                 continue
+            hashval = get_hashval(fullpath)
+            hashfiles[hashval] = fullpath
 
     if not taskhashlist or (len(filedates) < 2 and not foundall):
         # That didn't work, look in sstate-cache
@@ -309,30 +330,25 @@
             localdata.setVar('PV', '*')
             localdata.setVar('PR', '*')
             localdata.setVar('BB_TASKHASH', hashval)
-            swspec = localdata.getVar('SSTATE_SWSPEC', True)
+            swspec = localdata.getVar('SSTATE_SWSPEC')
             if taskname in ['do_fetch', 'do_unpack', 'do_patch', 'do_populate_lic', 'do_preconfigure'] and swspec:
                 localdata.setVar('SSTATE_PKGSPEC', '${SSTATE_SWSPEC}')
             elif pn.endswith('-native') or "-cross-" in pn or "-crosssdk-" in pn:
                 localdata.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/")
             sstatename = taskname[3:]
-            filespec = '%s_%s.*.siginfo' % (localdata.getVar('SSTATE_PKG', True), sstatename)
+            filespec = '%s_%s.*.siginfo' % (localdata.getVar('SSTATE_PKG'), sstatename)
 
-            if hashval != '*':
-                sstatedir = "%s/%s" % (d.getVar('SSTATE_DIR', True), hashval[:2])
-            else:
-                sstatedir = d.getVar('SSTATE_DIR', True)
-
-            for root, dirs, files in os.walk(sstatedir):
-                for fn in files:
-                    fullpath = os.path.join(root, fn)
-                    if fnmatch.fnmatch(fullpath, filespec):
-                        if taskhashlist:
-                            hashfiles[hashval] = fullpath
-                        else:
-                            try:
-                                filedates[fullpath] = os.stat(fullpath).st_mtime
-                            except:
-                                continue
+            matchedfiles = glob.glob(filespec)
+            for fullpath in matchedfiles:
+                actual_hashval = get_hashval(fullpath)
+                if actual_hashval in hashfiles:
+                    continue
+                hashfiles[hashval] = fullpath
+                if not taskhashlist:
+                    try:
+                        filedates[fullpath] = os.stat(fullpath).st_mtime
+                    except:
+                        continue
 
     if taskhashlist:
         return hashfiles
@@ -348,7 +364,7 @@
     Also returns the datastore that can be used to query related variables.
     """
     d2 = d.createCopy()
-    extrainf = d.getVarFlag("do_" + task, 'stamp-extra-info', True)
+    extrainf = d.getVarFlag("do_" + task, 'stamp-extra-info')
     if extrainf:
         d2.setVar("SSTATE_MANMACH", extrainf)
     return (d2.expand("${SSTATE_MANFILEPREFIX}.%s" % task), d2)
diff --git a/import-layers/yocto-poky/meta/lib/oe/terminal.py b/import-layers/yocto-poky/meta/lib/oe/terminal.py
index 3c8ef59..2f18ec0 100644
--- a/import-layers/yocto-poky/meta/lib/oe/terminal.py
+++ b/import-layers/yocto-poky/meta/lib/oe/terminal.py
@@ -11,7 +11,8 @@
     pass
 
 class NoSupportedTerminals(Exception):
-    pass
+    def __init__(self, terms):
+        self.terms = terms
 
 
 class Registry(oe.classutils.ClassRegistry):
@@ -61,31 +62,10 @@
         # Once fixed on the gnome-terminal project, this should be removed.
         if os.getenv('LC_ALL'): os.putenv('LC_ALL','')
 
-        # We need to know when the command completes but gnome-terminal gives us no way 
-        # to do this. We therefore write the pid to a file using a "phonehome" wrapper
-        # script, then monitor the pid until it exits. Thanks gnome!
-        import tempfile
-        pidfile = tempfile.NamedTemporaryFile(delete = False).name
-        try:
-            sh_cmd = "oe-gnome-terminal-phonehome " + pidfile + " " + sh_cmd
-            XTerminal.__init__(self, sh_cmd, title, env, d)
-            while os.stat(pidfile).st_size <= 0:
-                continue
-            with open(pidfile, "r") as f:
-                pid = int(f.readline())
-        finally:
-            os.unlink(pidfile)
-
-        import time
-        while True:
-            try:
-                os.kill(pid, 0)
-                time.sleep(0.1)
-            except OSError:
-               return
+        XTerminal.__init__(self, sh_cmd, title, env, d)
 
 class Mate(XTerminal):
-    command = 'mate-terminal -t "{title}" -x {command}'
+    command = 'mate-terminal --disable-factory -t "{title}" -x {command}'
     priority = 2
 
 class Xfce(XTerminal):
@@ -97,7 +77,7 @@
     priority = 2
 
 class Konsole(XTerminal):
-    command = 'konsole --nofork --workdir . -p tabtitle="{title}" -e {command}'
+    command = 'konsole --separate --workdir . -p tabtitle="{title}" -e {command}'
     priority = 2
 
     def __init__(self, sh_cmd, title=None, env=None, d=None):
@@ -106,6 +86,9 @@
         if vernum and LooseVersion(vernum) < '2.0.0':
             # Konsole from KDE 3.x
             self.command = 'konsole -T "{title}" -e {command}'
+        elif vernum and LooseVersion(vernum) < '16.08.1':
+            # Konsole pre 16.08.01 Has nofork
+            self.command = 'konsole --nofork --workdir . -p tabtitle="{title}" -e {command}'
         XTerminal.__init__(self, sh_cmd, title, env, d)
 
 class XTerm(XTerminal):
@@ -192,7 +175,7 @@
     priority = 3
 
     def __init__(self, sh_cmd, title=None, env=None, d=None):
-        self.command = d and d.getVar('OE_TERMINAL_CUSTOMCMD', True)
+        self.command = d and d.getVar('OE_TERMINAL_CUSTOMCMD')
         if self.command:
             if not '{command}' in self.command:
                 self.command += ' {command}'
@@ -206,6 +189,14 @@
 def prioritized():
     return Registry.prioritized()
 
+def get_cmd_list():
+    terms = Registry.prioritized()
+    cmds = []
+    for term in terms:
+        if term.command:
+            cmds.append(term.command)
+    return cmds
+
 def spawn_preferred(sh_cmd, title=None, env=None, d=None):
     """Spawn the first supported terminal, by priority"""
     for terminal in prioritized():
@@ -215,7 +206,7 @@
         except UnsupportedTerminal:
             continue
     else:
-        raise NoSupportedTerminals()
+        raise NoSupportedTerminals(get_cmd_list())
 
 def spawn(name, sh_cmd, title=None, env=None, d=None):
     """Spawn the specified terminal, by name"""
@@ -225,12 +216,36 @@
     except KeyError:
         raise UnsupportedTerminal(name)
 
-    pipe = terminal(sh_cmd, title, env, d)
-    output = pipe.communicate()[0]
-    if output:
-        output = output.decode("utf-8")
-    if pipe.returncode != 0:
-        raise ExecutionError(sh_cmd, pipe.returncode, output)
+    # We need to know when the command completes but some terminals (at least
+    # gnome and tmux) gives us no way to do this. We therefore write the pid
+    # to a file using a "phonehome" wrapper script, then monitor the pid
+    # until it exits.
+    import tempfile
+    import time
+    pidfile = tempfile.NamedTemporaryFile(delete = False).name
+    try:
+        sh_cmd = bb.utils.which(os.getenv('PATH'), "oe-gnome-terminal-phonehome") + " " + pidfile + " " + sh_cmd
+        pipe = terminal(sh_cmd, title, env, d)
+        output = pipe.communicate()[0]
+        if output:
+            output = output.decode("utf-8")
+        if pipe.returncode != 0:
+            raise ExecutionError(sh_cmd, pipe.returncode, output)
+
+        while os.stat(pidfile).st_size <= 0:
+            time.sleep(0.01)
+            continue
+        with open(pidfile, "r") as f:
+            pid = int(f.readline())
+    finally:
+        os.unlink(pidfile)
+
+    while True:
+        try:
+            os.kill(pid, 0)
+            time.sleep(0.1)
+        except OSError:
+           return
 
 def check_tmux_pane_size(tmux):
     import subprocess as sub
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/test_types.py b/import-layers/yocto-poky/meta/lib/oe/tests/test_types.py
deleted file mode 100644
index 367cc30..0000000
--- a/import-layers/yocto-poky/meta/lib/oe/tests/test_types.py
+++ /dev/null
@@ -1,62 +0,0 @@
-import unittest
-from oe.maketype import create, factory
-
-class TestTypes(unittest.TestCase):
-    def assertIsInstance(self, obj, cls):
-        return self.assertTrue(isinstance(obj, cls))
-
-    def assertIsNot(self, obj, other):
-        return self.assertFalse(obj is other)
-
-    def assertFactoryCreated(self, value, type, **flags):
-        cls = factory(type)
-        self.assertIsNot(cls, None)
-        self.assertIsInstance(create(value, type, **flags), cls)
-
-class TestBooleanType(TestTypes):
-    def test_invalid(self):
-        self.assertRaises(ValueError, create, '', 'boolean')
-        self.assertRaises(ValueError, create, 'foo', 'boolean')
-        self.assertRaises(TypeError, create, object(), 'boolean')
-
-    def test_true(self):
-        self.assertTrue(create('y', 'boolean'))
-        self.assertTrue(create('yes', 'boolean'))
-        self.assertTrue(create('1', 'boolean'))
-        self.assertTrue(create('t', 'boolean'))
-        self.assertTrue(create('true', 'boolean'))
-        self.assertTrue(create('TRUE', 'boolean'))
-        self.assertTrue(create('truE', 'boolean'))
-
-    def test_false(self):
-        self.assertFalse(create('n', 'boolean'))
-        self.assertFalse(create('no', 'boolean'))
-        self.assertFalse(create('0', 'boolean'))
-        self.assertFalse(create('f', 'boolean'))
-        self.assertFalse(create('false', 'boolean'))
-        self.assertFalse(create('FALSE', 'boolean'))
-        self.assertFalse(create('faLse', 'boolean'))
-
-    def test_bool_equality(self):
-        self.assertEqual(create('n', 'boolean'), False)
-        self.assertNotEqual(create('n', 'boolean'), True)
-        self.assertEqual(create('y', 'boolean'), True)
-        self.assertNotEqual(create('y', 'boolean'), False)
-
-class TestList(TestTypes):
-    def assertListEqual(self, value, valid, sep=None):
-        obj = create(value, 'list', separator=sep)
-        self.assertEqual(obj, valid)
-        if sep is not None:
-            self.assertEqual(obj.separator, sep)
-        self.assertEqual(str(obj), obj.separator.join(obj))
-
-    def test_list_nosep(self):
-        testlist = ['alpha', 'beta', 'theta']
-        self.assertListEqual('alpha beta theta', testlist)
-        self.assertListEqual('alpha  beta\ttheta', testlist)
-        self.assertListEqual('alpha', ['alpha'])
-
-    def test_list_usersep(self):
-        self.assertListEqual('foo:bar', ['foo', 'bar'], ':')
-        self.assertListEqual('foo:bar:baz', ['foo', 'bar', 'baz'], ':')
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/test_utils.py b/import-layers/yocto-poky/meta/lib/oe/tests/test_utils.py
deleted file mode 100644
index 5d9ac52..0000000
--- a/import-layers/yocto-poky/meta/lib/oe/tests/test_utils.py
+++ /dev/null
@@ -1,51 +0,0 @@
-import unittest
-from oe.utils import packages_filter_out_system
-
-class TestPackagesFilterOutSystem(unittest.TestCase):
-    def test_filter(self):
-        """
-        Test that oe.utils.packages_filter_out_system works.
-        """
-        try:
-            import bb
-        except ImportError:
-            self.skipTest("Cannot import bb")
-
-        d = bb.data_smart.DataSmart()
-        d.setVar("PN", "foo")
-
-        d.setVar("PACKAGES", "foo foo-doc foo-dev")
-        pkgs = packages_filter_out_system(d)
-        self.assertEqual(pkgs, [])
-
-        d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
-        pkgs = packages_filter_out_system(d)
-        self.assertEqual(pkgs, ["foo-data"])
-
-        d.setVar("PACKAGES", "foo foo-locale-en-gb")
-        pkgs = packages_filter_out_system(d)
-        self.assertEqual(pkgs, [])
-
-        d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
-        pkgs = packages_filter_out_system(d)
-        self.assertEqual(pkgs, ["foo-data"])
-
-
-class TestTrimVersion(unittest.TestCase):
-    def test_version_exception(self):
-        with self.assertRaises(TypeError):
-            trim_version(None, 2)
-        with self.assertRaises(TypeError):
-            trim_version((1, 2, 3), 2)
-
-    def test_num_exception(self):
-        with self.assertRaises(ValueError):
-            trim_version("1.2.3", 0)
-        with self.assertRaises(ValueError):
-            trim_version("1.2.3", -1)
-
-    def test_valid(self):
-        self.assertEqual(trim_version("1.2.3", 1), "1")
-        self.assertEqual(trim_version("1.2.3", 2), "1.2")
-        self.assertEqual(trim_version("1.2.3", 3), "1.2.3")
-        self.assertEqual(trim_version("1.2.3", 4), "1.2.3")
diff --git a/import-layers/yocto-poky/meta/lib/oe/utils.py b/import-layers/yocto-poky/meta/lib/oe/utils.py
index 36cf74f..330a5ff 100644
--- a/import-layers/yocto-poky/meta/lib/oe/utils.py
+++ b/import-layers/yocto-poky/meta/lib/oe/utils.py
@@ -1,9 +1,4 @@
-try:
-    # Python 2
-    import commands as cmdstatus
-except ImportError:
-    # Python 3
-    import subprocess as cmdstatus
+import subprocess
 
 def read_file(filename):
     try:
@@ -23,27 +18,27 @@
         return iffalse
 
 def conditional(variable, checkvalue, truevalue, falsevalue, d):
-    if d.getVar(variable, True) == checkvalue:
+    if d.getVar(variable) == checkvalue:
         return truevalue
     else:
         return falsevalue
 
 def less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
-    if float(d.getVar(variable, True)) <= float(checkvalue):
+    if float(d.getVar(variable)) <= float(checkvalue):
         return truevalue
     else:
         return falsevalue
 
 def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
-    result = bb.utils.vercmp_string(d.getVar(variable,True), checkvalue)
+    result = bb.utils.vercmp_string(d.getVar(variable), checkvalue)
     if result <= 0:
         return truevalue
     else:
         return falsevalue
 
 def both_contain(variable1, variable2, checkvalue, d):
-    val1 = d.getVar(variable1, True)
-    val2 = d.getVar(variable2, True)
+    val1 = d.getVar(variable1)
+    val2 = d.getVar(variable2)
     val1 = set(val1.split())
     val2 = set(val2.split())
     if isinstance(checkvalue, str):
@@ -66,8 +61,8 @@
     s3 = set_intersect(s1, s2)
     => s3 = "b c"
     """
-    val1 = set(d.getVar(variable1, True).split())
-    val2 = set(d.getVar(variable2, True).split())
+    val1 = set(d.getVar(variable1).split())
+    val2 = set(d.getVar(variable2).split())
     return " ".join(val1 & val2)
 
 def prune_suffix(var, suffixes, d):
@@ -77,7 +72,7 @@
         if var.endswith(suffix):
             var = var.replace(suffix, "")
 
-    prefix = d.getVar("MLPREFIX", True)
+    prefix = d.getVar("MLPREFIX")
     if prefix and var.startswith(prefix):
         var = var.replace(prefix, "")
 
@@ -102,6 +97,10 @@
         return False
     raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value))
 
+def build_depends_string(depends, task):
+    """Append a taskname to a string of dependencies as used by the [depends] flag"""
+    return " ".join(dep + ":" + task for dep in depends.split())
+
 def inherits(d, *classes):
     """Return True if the metadata inherits any of the specified classes"""
     return any(bb.data.inherits_class(cls, d) for cls in classes)
@@ -115,9 +114,9 @@
     # disturbing distributions that have already set DISTRO_FEATURES.
     # Distributions wanting to elide a value in DISTRO_FEATURES_BACKFILL should
     # add the feature to DISTRO_FEATURES_BACKFILL_CONSIDERED
-    features = (d.getVar(var, True) or "").split()
-    backfill = (d.getVar(var+"_BACKFILL", True) or "").split()
-    considered = (d.getVar(var+"_BACKFILL_CONSIDERED", True) or "").split()
+    features = (d.getVar(var) or "").split()
+    backfill = (d.getVar(var+"_BACKFILL") or "").split()
+    considered = (d.getVar(var+"_BACKFILL_CONSIDERED") or "").split()
 
     addfeatures = []
     for feature in backfill:
@@ -133,18 +132,18 @@
     Return a list of packages from PACKAGES with the "system" packages such as
     PN-dbg PN-doc PN-locale-eb-gb removed.
     """
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
     blacklist = [pn + suffix for suffix in ('', '-dbg', '-dev', '-doc', '-locale', '-staticdev')]
     localepkg = pn + "-locale-"
     pkgs = []
 
-    for pkg in d.getVar('PACKAGES', True).split():
+    for pkg in d.getVar('PACKAGES').split():
         if pkg not in blacklist and localepkg not in pkg:
             pkgs.append(pkg)
     return pkgs
 
 def getstatusoutput(cmd):
-    return cmdstatus.getstatusoutput(cmd)
+    return subprocess.getstatusoutput(cmd)
 
 
 def trim_version(version, num_parts=2):
@@ -233,11 +232,10 @@
 def host_gcc_version(d):
     import re, subprocess
 
-    compiler = d.getVar("BUILD_CC", True)
-
+    compiler = d.getVar("BUILD_CC")
     try:
         env = os.environ.copy()
-        env["PATH"] = d.getVar("PATH", True)
+        env["PATH"] = d.getVar("PATH")
         output = subprocess.check_output("%s --version" % compiler, shell=True, env=env).decode("utf-8")
     except subprocess.CalledProcessError as e:
         bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8")))
@@ -321,8 +319,8 @@
         bb.utils.remove(ldsoconf)
     bb.utils.mkdirhier(os.path.dirname(ldsoconf))
     with open(ldsoconf, "w") as f:
-        f.write(d.getVar("base_libdir", True) + '\n')
-        f.write(d.getVar("libdir", True) + '\n')
+        f.write(d.getVar("base_libdir") + '\n')
+        f.write(d.getVar("libdir") + '\n')
 
 class ImageQAFailed(bb.build.FuncFailed):
     def __init__(self, description, name=None, logfile=None):
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/buildperf/base.py b/import-layers/yocto-poky/meta/lib/oeqa/buildperf/base.py
index 59dd025..6e62b27 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/buildperf/base.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/buildperf/base.py
@@ -10,21 +10,22 @@
 # more details.
 #
 """Build performance test base classes and functionality"""
-import glob
 import json
 import logging
 import os
 import re
 import resource
-import shutil
 import socket
+import shutil
 import time
-import traceback
 import unittest
+import xml.etree.ElementTree as ET
+from collections import OrderedDict
 from datetime import datetime, timedelta
 from functools import partial
 from multiprocessing import Process
 from multiprocessing import SimpleQueue
+from xml.dom import minidom
 
 import oe.path
 from oeqa.utils.commands import CommandError, runCmd, get_bb_vars
@@ -35,7 +36,7 @@
 
 # Our own version of runCmd which does not raise AssertErrors which would cause
 # errors to interpreted as failures
-runCmd2 = partial(runCmd, assert_error=False)
+runCmd2 = partial(runCmd, assert_error=False, limit_exc_output=40)
 
 
 class KernelDropCaches(object):
@@ -99,50 +100,34 @@
         super(BuildPerfTestResult, self).__init__(*args, **kwargs)
 
         self.out_dir = out_dir
-        # Get Git parameters
-        try:
-            self.repo = GitRepo('.')
-        except GitError:
-            self.repo = None
-        self.git_commit, self.git_commit_count, self.git_branch = \
-                self.get_git_revision()
         self.hostname = socket.gethostname()
         self.product = os.getenv('OE_BUILDPERFTEST_PRODUCT', 'oe-core')
         self.start_time = self.elapsed_time = None
         self.successes = []
-        log.info("Using Git branch:commit %s:%s (%s)", self.git_branch,
-                 self.git_commit, self.git_commit_count)
-
-    def get_git_revision(self):
-        """Get git branch and commit under testing"""
-        commit = os.getenv('OE_BUILDPERFTEST_GIT_COMMIT')
-        commit_cnt = os.getenv('OE_BUILDPERFTEST_GIT_COMMIT_COUNT')
-        branch = os.getenv('OE_BUILDPERFTEST_GIT_BRANCH')
-        if not self.repo and (not commit or not commit_cnt or not branch):
-            log.info("The current working directory doesn't seem to be a Git "
-                     "repository clone. You can specify branch and commit "
-                     "displayed in test results with OE_BUILDPERFTEST_GIT_BRANCH, "
-                     "OE_BUILDPERFTEST_GIT_COMMIT and "
-                     "OE_BUILDPERFTEST_GIT_COMMIT_COUNT environment variables")
-        else:
-            if not commit:
-                commit = self.repo.rev_parse('HEAD^0')
-                commit_cnt = self.repo.run_cmd(['rev-list', '--count', 'HEAD^0'])
-            if not branch:
-                branch = self.repo.get_current_branch()
-                if not branch:
-                    log.debug('Currently on detached HEAD')
-        return str(commit), str(commit_cnt), str(branch)
 
     def addSuccess(self, test):
         """Record results from successful tests"""
         super(BuildPerfTestResult, self).addSuccess(test)
-        self.successes.append((test, None))
+        self.successes.append(test)
+
+    def addError(self, test, err):
+        """Record results from crashed test"""
+        test.err = err
+        super(BuildPerfTestResult, self).addError(test, err)
+
+    def addFailure(self, test, err):
+        """Record results from failed test"""
+        test.err = err
+        super(BuildPerfTestResult, self).addFailure(test, err)
+
+    def addExpectedFailure(self, test, err):
+        """Record results from expectedly failed test"""
+        test.err = err
+        super(BuildPerfTestResult, self).addExpectedFailure(test, err)
 
     def startTest(self, test):
         """Pre-test hook"""
         test.base_dir = self.out_dir
-        os.mkdir(test.out_dir)
         log.info("Executing test %s: %s", test.name, test.shortDescription())
         self.stream.write(datetime.now().strftime("[%Y-%m-%d %H:%M:%S] "))
         super(BuildPerfTestResult, self).startTest(test)
@@ -154,141 +139,113 @@
     def stopTestRun(self):
         """Pre-run hook"""
         self.elapsed_time = datetime.utcnow() - self.start_time
-        self.write_results_json()
 
     def all_results(self):
-        result_map = {'SUCCESS': self.successes,
-                      'FAIL': self.failures,
-                      'ERROR': self.errors,
-                      'EXP_FAIL': self.expectedFailures,
-                      'UNEXP_SUCCESS': self.unexpectedSuccesses,
-                      'SKIPPED': self.skipped}
-        for status, tests in result_map.items():
-            for test in tests:
-                yield (status, test)
+        compound = [('SUCCESS', t, None) for t in self.successes] + \
+                   [('FAILURE', t, m) for t, m in self.failures] + \
+                   [('ERROR', t, m) for t, m in self.errors] + \
+                   [('EXPECTED_FAILURE', t, m) for t, m in self.expectedFailures] + \
+                   [('UNEXPECTED_SUCCESS', t, None) for t in self.unexpectedSuccesses] + \
+                   [('SKIPPED', t, m) for t, m in self.skipped]
+        return sorted(compound, key=lambda info: info[1].start_time)
 
 
-    def update_globalres_file(self, filename):
-        """Write results to globalres csv file"""
-        # Map test names to time and size columns in globalres
-        # The tuples represent index and length of times and sizes
-        # respectively
-        gr_map = {'test1': ((0, 1), (8, 1)),
-                  'test12': ((1, 1), (None, None)),
-                  'test13': ((2, 1), (9, 1)),
-                  'test2': ((3, 1), (None, None)),
-                  'test3': ((4, 3), (None, None)),
-                  'test4': ((7, 1), (10, 2))}
+    def write_buildstats_json(self):
+        """Write buildstats file"""
+        buildstats = OrderedDict()
+        for _, test, _ in self.all_results():
+            for key, val in test.buildstats.items():
+                buildstats[test.name + '.' + key] = val
+        with open(os.path.join(self.out_dir, 'buildstats.json'), 'w') as fobj:
+            json.dump(buildstats, fobj, cls=ResultsJsonEncoder)
 
-        if self.repo:
-            git_tag_rev = self.repo.run_cmd(['describe', self.git_commit])
-        else:
-            git_tag_rev = self.git_commit
-
-        values = ['0'] * 12
-        for status, (test, msg) in self.all_results():
-            if status in ['ERROR', 'SKIPPED']:
-                continue
-            (t_ind, t_len), (s_ind, s_len) = gr_map[test.name]
-            if t_ind is not None:
-                values[t_ind:t_ind + t_len] = test.times
-            if s_ind is not None:
-                values[s_ind:s_ind + s_len] = test.sizes
-
-        log.debug("Writing globalres log to %s", filename)
-        with open(filename, 'a') as fobj:
-            fobj.write('{},{}:{},{},'.format(self.hostname,
-                                             self.git_branch,
-                                             self.git_commit,
-                                             git_tag_rev))
-            fobj.write(','.join(values) + '\n')
 
     def write_results_json(self):
         """Write test results into a json-formatted file"""
-        results = {'tester_host': self.hostname,
-                   'git_branch': self.git_branch,
-                   'git_commit': self.git_commit,
-                   'git_commit_count': self.git_commit_count,
-                   'product': self.product,
-                   'start_time': self.start_time,
-                   'elapsed_time': self.elapsed_time}
+        results = OrderedDict([('tester_host', self.hostname),
+                               ('start_time', self.start_time),
+                               ('elapsed_time', self.elapsed_time),
+                               ('tests', OrderedDict())])
 
-        tests = {}
-        for status, (test, reason) in self.all_results():
-            tests[test.name] = {'name': test.name,
-                                'description': test.shortDescription(),
-                                'status': status,
-                                'start_time': test.start_time,
-                                'elapsed_time': test.elapsed_time,
-                                'cmd_log_file': os.path.relpath(test.cmd_log_file,
-                                                                self.out_dir),
-                                'measurements': test.measurements}
-        results['tests'] = tests
+        for status, test, reason in self.all_results():
+            test_result = OrderedDict([('name', test.name),
+                                       ('description', test.shortDescription()),
+                                       ('status', status),
+                                       ('start_time', test.start_time),
+                                       ('elapsed_time', test.elapsed_time),
+                                       ('measurements', test.measurements)])
+            if status in ('ERROR', 'FAILURE', 'EXPECTED_FAILURE'):
+                test_result['message'] = str(test.err[1])
+                test_result['err_type'] = test.err[0].__name__
+                test_result['err_output'] = reason
+            elif reason:
+                test_result['message'] = reason
+
+            results['tests'][test.name] = test_result
 
         with open(os.path.join(self.out_dir, 'results.json'), 'w') as fobj:
-            json.dump(results, fobj, indent=4, sort_keys=True,
+            json.dump(results, fobj, indent=4,
                       cls=ResultsJsonEncoder)
 
+    def write_results_xml(self):
+        """Write test results into a JUnit XML file"""
+        top = ET.Element('testsuites')
+        suite = ET.SubElement(top, 'testsuite')
+        suite.set('name', 'oeqa.buildperf')
+        suite.set('timestamp', self.start_time.isoformat())
+        suite.set('time', str(self.elapsed_time.total_seconds()))
+        suite.set('hostname', self.hostname)
+        suite.set('failures', str(len(self.failures) + len(self.expectedFailures)))
+        suite.set('errors', str(len(self.errors)))
+        suite.set('skipped', str(len(self.skipped)))
 
-    def git_commit_results(self, repo_path, branch=None, tag=None):
-        """Commit results into a Git repository"""
-        repo = GitRepo(repo_path, is_topdir=True)
-        if not branch:
-            branch = self.git_branch
-        else:
-            # Replace keywords
-            branch = branch.format(git_branch=self.git_branch,
-                                   tester_host=self.hostname)
+        test_cnt = 0
+        for status, test, reason in self.all_results():
+            test_cnt += 1
+            testcase = ET.SubElement(suite, 'testcase')
+            testcase.set('classname', test.__module__ + '.' + test.__class__.__name__)
+            testcase.set('name', test.name)
+            testcase.set('description', test.shortDescription())
+            testcase.set('timestamp', test.start_time.isoformat())
+            testcase.set('time', str(test.elapsed_time.total_seconds()))
+            if status in ('ERROR', 'FAILURE', 'EXP_FAILURE'):
+                if status in ('FAILURE', 'EXP_FAILURE'):
+                    result = ET.SubElement(testcase, 'failure')
+                else:
+                    result = ET.SubElement(testcase, 'error')
+                result.set('message', str(test.err[1]))
+                result.set('type', test.err[0].__name__)
+                result.text = reason
+            elif status == 'SKIPPED':
+                result = ET.SubElement(testcase, 'skipped')
+                result.text = reason
+            elif status not in ('SUCCESS', 'UNEXPECTED_SUCCESS'):
+                raise TypeError("BUG: invalid test status '%s'" % status)
 
-        log.info("Committing test results into %s %s", repo_path, branch)
-        tmp_index = os.path.join(repo_path, '.git', 'index.oe-build-perf')
-        try:
-            # Create new commit object from the new results
-            env_update = {'GIT_INDEX_FILE': tmp_index,
-                          'GIT_WORK_TREE': self.out_dir}
-            repo.run_cmd('add .', env_update)
-            tree = repo.run_cmd('write-tree', env_update)
-            parent = repo.rev_parse(branch)
-            msg = "Results of {}:{}\n".format(self.git_branch, self.git_commit)
-            git_cmd = ['commit-tree', tree, '-m', msg]
-            if parent:
-                git_cmd += ['-p', parent]
-            commit = repo.run_cmd(git_cmd, env_update)
+            for data in test.measurements.values():
+                measurement = ET.SubElement(testcase, data['type'])
+                measurement.set('name', data['name'])
+                measurement.set('legend', data['legend'])
+                vals = data['values']
+                if data['type'] == BuildPerfTestCase.SYSRES:
+                    ET.SubElement(measurement, 'time',
+                                  timestamp=vals['start_time'].isoformat()).text = \
+                        str(vals['elapsed_time'].total_seconds())
+                    attrib = dict((k, str(v)) for k, v in vals['iostat'].items())
+                    ET.SubElement(measurement, 'iostat', attrib=attrib)
+                    attrib = dict((k, str(v)) for k, v in vals['rusage'].items())
+                    ET.SubElement(measurement, 'rusage', attrib=attrib)
+                elif data['type'] == BuildPerfTestCase.DISKUSAGE:
+                    ET.SubElement(measurement, 'size').text = str(vals['size'])
+                else:
+                    raise TypeError('BUG: unsupported measurement type')
 
-            # Update branch head
-            git_cmd = ['update-ref', 'refs/heads/' + branch, commit]
-            if parent:
-                git_cmd.append(parent)
-            repo.run_cmd(git_cmd)
+        suite.set('tests', str(test_cnt))
 
-            # Update current HEAD, if we're on branch 'branch'
-            if repo.get_current_branch() == branch:
-                log.info("Updating %s HEAD to latest commit", repo_path)
-                repo.run_cmd('reset --hard')
-
-            # Create (annotated) tag
-            if tag:
-                # Find tags matching the pattern
-                tag_keywords = dict(git_branch=self.git_branch,
-                                    git_commit=self.git_commit,
-                                    git_commit_count=self.git_commit_count,
-                                    tester_host=self.hostname,
-                                    tag_num='[0-9]{1,5}')
-                tag_re = re.compile(tag.format(**tag_keywords) + '$')
-                tag_keywords['tag_num'] = 0
-                for existing_tag in repo.run_cmd('tag').splitlines():
-                    if tag_re.match(existing_tag):
-                        tag_keywords['tag_num'] += 1
-
-                tag = tag.format(**tag_keywords)
-                msg = "Test run #{} of {}:{}\n".format(tag_keywords['tag_num'],
-                                                       self.git_branch,
-                                                       self.git_commit)
-                repo.run_cmd(['tag', '-a', '-m', msg, tag, commit])
-
-        finally:
-            if os.path.exists(tmp_index):
-                os.unlink(tmp_index)
+        # Use minidom for pretty-printing
+        dom_doc = minidom.parseString(ET.tostring(top, 'utf-8'))
+        with open(os.path.join(self.out_dir, 'results.xml'), 'w') as fobj:
+            dom_doc.writexml(fobj, addindent='  ', newl='\n', encoding='utf-8')
 
 
 class BuildPerfTestCase(unittest.TestCase):
@@ -303,7 +260,10 @@
         self.base_dir = None
         self.start_time = None
         self.elapsed_time = None
-        self.measurements = []
+        self.measurements = OrderedDict()
+        self.buildstats = OrderedDict()
+        # self.err is supposed to be a tuple from sys.exc_info()
+        self.err = None
         self.bb_vars = get_bb_vars()
         # TODO: remove 'times' and 'sizes' arrays when globalres support is
         # removed
@@ -311,18 +271,23 @@
         self.sizes = []
 
     @property
-    def out_dir(self):
-        return os.path.join(self.base_dir, self.name)
+    def tmp_dir(self):
+        return os.path.join(self.base_dir, self.name + '.tmp')
 
-    @property
-    def cmd_log_file(self):
-        return os.path.join(self.out_dir, 'commands.log')
+    def shortDescription(self):
+        return super(BuildPerfTestCase, self).shortDescription() or ""
 
     def setUp(self):
         """Set-up fixture for each test"""
+        if not os.path.isdir(self.tmp_dir):
+            os.mkdir(self.tmp_dir)
         if self.build_target:
-            self.log_cmd_output(['bitbake', self.build_target,
-                                 '-c', 'fetchall'])
+            self.run_cmd(['bitbake', self.build_target, '-c', 'fetchall'])
+
+    def tearDown(self):
+        """Tear-down fixture for each test"""
+        if os.path.isdir(self.tmp_dir):
+            shutil.rmtree(self.tmp_dir)
 
     def run(self, *args, **kwargs):
         """Run test"""
@@ -330,17 +295,23 @@
         super(BuildPerfTestCase, self).run(*args, **kwargs)
         self.elapsed_time = datetime.now() - self.start_time
 
-    def log_cmd_output(self, cmd):
-        """Run a command and log it's output"""
+    def run_cmd(self, cmd):
+        """Convenience method for running a command"""
         cmd_str = cmd if isinstance(cmd, str) else ' '.join(cmd)
         log.info("Logging command: %s", cmd_str)
         try:
-            with open(self.cmd_log_file, 'a') as fobj:
-                runCmd2(cmd, stdout=fobj)
+            runCmd2(cmd)
         except CommandError as err:
             log.error("Command failed: %s", err.retcode)
             raise
 
+    def _append_measurement(self, measurement):
+        """Simple helper for adding measurements results"""
+        if measurement['name'] in self.measurements:
+            raise ValueError('BUG: two measurements with the same name in {}'.format(
+                self.__class__.__name__))
+        self.measurements[measurement['name']] = measurement
+
     def measure_cmd_resources(self, cmd, name, legend, save_bs=False):
         """Measure system resource usage of a command"""
         def _worker(data_q, cmd, **kwargs):
@@ -350,12 +321,12 @@
                 ret = runCmd2(cmd, **kwargs)
                 etime = datetime.now() - start_time
                 rusage_struct = resource.getrusage(resource.RUSAGE_CHILDREN)
-                iostat = {}
+                iostat = OrderedDict()
                 with open('/proc/{}/io'.format(os.getpid())) as fobj:
                     for line in fobj.readlines():
                         key, val = line.split(':')
                         iostat[key] = int(val)
-                rusage = {}
+                rusage = OrderedDict()
                 # Skip unused fields, (i.e. 'ru_ixrss', 'ru_idrss', 'ru_isrss',
                 # 'ru_nswap', 'ru_msgsnd', 'ru_msgrcv' and 'ru_nsignals')
                 for key in ['ru_utime', 'ru_stime', 'ru_maxrss', 'ru_minflt',
@@ -374,33 +345,28 @@
         log.info("Timing command: %s", cmd_str)
         data_q = SimpleQueue()
         try:
-            with open(self.cmd_log_file, 'a') as fobj:
-                proc = Process(target=_worker, args=(data_q, cmd,),
-                               kwargs={'stdout': fobj})
-                proc.start()
-                data = data_q.get()
-                proc.join()
+            proc = Process(target=_worker, args=(data_q, cmd,))
+            proc.start()
+            data = data_q.get()
+            proc.join()
             if isinstance(data, Exception):
                 raise data
         except CommandError:
-            log.error("Command '%s' failed, see %s for more details", cmd_str,
-                      self.cmd_log_file)
+            log.error("Command '%s' failed", cmd_str)
             raise
         etime = data['elapsed_time']
 
-        measurement = {'type': self.SYSRES,
-                       'name': name,
-                       'legend': legend}
-        measurement['values'] = {'start_time': data['start_time'],
-                                 'elapsed_time': etime,
-                                 'rusage': data['rusage'],
-                                 'iostat': data['iostat']}
+        measurement = OrderedDict([('type', self.SYSRES),
+                                   ('name', name),
+                                   ('legend', legend)])
+        measurement['values'] = OrderedDict([('start_time', data['start_time']),
+                                             ('elapsed_time', etime),
+                                             ('rusage', data['rusage']),
+                                             ('iostat', data['iostat'])])
         if save_bs:
-            bs_file = self.save_buildstats(legend)
-            measurement['values']['buildstats_file'] = \
-                    os.path.relpath(bs_file, self.base_dir)
+            self.save_buildstats(name)
 
-        self.measurements.append(measurement)
+        self._append_measurement(measurement)
 
         # Append to 'times' array for globalres log
         e_sec = etime.total_seconds()
@@ -418,15 +384,15 @@
         ret = runCmd2(cmd)
         size = int(ret.output.split()[0])
         log.debug("Size of %s path is %s", path, size)
-        measurement = {'type': self.DISKUSAGE,
-                       'name': name,
-                       'legend': legend}
-        measurement['values'] = {'size': size}
-        self.measurements.append(measurement)
+        measurement = OrderedDict([('type', self.DISKUSAGE),
+                                   ('name', name),
+                                   ('legend', legend)])
+        measurement['values'] = OrderedDict([('size', size)])
+        self._append_measurement(measurement)
         # Append to 'sizes' array for globalres log
         self.sizes.append(str(size))
 
-    def save_buildstats(self, label=None):
+    def save_buildstats(self, measurement_name):
         """Save buildstats"""
         def split_nevr(nevr):
             """Split name and version information from recipe "nevr" string"""
@@ -445,9 +411,9 @@
 
         def bs_to_json(filename):
             """Convert (task) buildstats file into json format"""
-            bs_json = {'iostat': {},
-                       'rusage': {},
-                       'child_rusage': {}}
+            bs_json = OrderedDict()
+            iostat = OrderedDict()
+            rusage = OrderedDict()
             with open(filename) as fobj:
                 for line in fobj.readlines():
                     key, val = line.split(':', 1)
@@ -459,7 +425,7 @@
                         end_time = datetime.utcfromtimestamp(float(val))
                     elif key.startswith('IO '):
                         split = key.split()
-                        bs_json['iostat'][split[1]] = int(val)
+                        iostat[split[1]] = int(val)
                     elif key.find('rusage') >= 0:
                         split = key.split()
                         ru_key = split[-1]
@@ -467,12 +433,12 @@
                             val = float(val)
                         else:
                             val = int(val)
-                        ru_type = 'rusage' if split[0] == 'rusage' else \
-                                                          'child_rusage'
-                        bs_json[ru_type][ru_key] = val
+                        rusage[ru_key] = rusage.get(ru_key, 0) + val
                     elif key == 'Status':
                         bs_json['status'] = val
             bs_json['elapsed_time'] = end_time - start_time
+            bs_json['rusage'] = rusage
+            bs_json['iostat'] = iostat
             return bs_json
 
         log.info('Saving buildstats in JSON format')
@@ -488,24 +454,17 @@
             if not os.path.isdir(recipe_dir):
                 continue
             name, epoch, version, revision = split_nevr(fname)
-            recipe_bs = {'name': name,
-                         'epoch': epoch,
-                         'version': version,
-                         'revision': revision,
-                         'tasks': {}}
+            recipe_bs = OrderedDict((('name', name),
+                                     ('epoch', epoch),
+                                     ('version', version),
+                                     ('revision', revision),
+                                     ('tasks', OrderedDict())))
             for task in os.listdir(recipe_dir):
                 recipe_bs['tasks'][task] = bs_to_json(os.path.join(recipe_dir,
                                                                    task))
             buildstats.append(recipe_bs)
 
-        # Write buildstats into json file
-        postfix = '.' + str_to_fn(label) if label else ''
-        postfix += '.json'
-        outfile = os.path.join(self.out_dir, 'buildstats' + postfix)
-        with open(outfile, 'w') as fobj:
-            json.dump(buildstats, fobj, indent=4, sort_keys=True,
-                      cls=ResultsJsonEncoder)
-        return outfile
+        self.buildstats[measurement_name] = buildstats
 
     def rm_tmp(self):
         """Cleanup temporary/intermediate files and directories"""
@@ -547,5 +506,5 @@
         self.out_dir = out_dir
 
     def _makeResult(self):
-       return BuildPerfTestResult(self.out_dir, self.stream, self.descriptions,
-                                  self.verbosity)
+        return BuildPerfTestResult(self.out_dir, self.stream, self.descriptions,
+                                   self.verbosity)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/buildperf/test_basic.py b/import-layers/yocto-poky/meta/lib/oeqa/buildperf/test_basic.py
index 7a48c1e..a9e4a5b 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/buildperf/test_basic.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/buildperf/test_basic.py
@@ -22,7 +22,7 @@
     build_target = 'core-image-sato'
 
     def test1(self):
-        """Measure wall clock of bitbake core-image-sato and size of tmp dir"""
+        """Build core-image-sato"""
         self.rm_tmp()
         self.rm_sstate()
         self.rm_cache()
@@ -36,10 +36,10 @@
     build_target = 'virtual/kernel'
 
     def test12(self):
-        """Measure bitbake virtual/kernel"""
+        """Build virtual/kernel"""
         # Build and cleans state in order to get all dependencies pre-built
-        self.log_cmd_output(['bitbake', self.build_target])
-        self.log_cmd_output(['bitbake', self.build_target, '-c', 'cleansstate'])
+        self.run_cmd(['bitbake', self.build_target])
+        self.run_cmd(['bitbake', self.build_target, '-c', 'cleansstate'])
 
         self.sync()
         self.measure_cmd_resources(['bitbake', self.build_target], 'build',
@@ -51,30 +51,28 @@
 
     def test13(self):
         """Build core-image-sato with rm_work enabled"""
-        postfile = os.path.join(self.out_dir, 'postfile.conf')
+        postfile = os.path.join(self.tmp_dir, 'postfile.conf')
         with open(postfile, 'w') as fobj:
             fobj.write('INHERIT += "rm_work"\n')
-        try:
-            self.rm_tmp()
-            self.rm_sstate()
-            self.rm_cache()
-            self.sync()
-            cmd = ['bitbake', '-R', postfile, self.build_target]
-            self.measure_cmd_resources(cmd, 'build',
-                                       'bitbake' + self.build_target,
-                                       save_bs=True)
-            self.measure_disk_usage(self.bb_vars['TMPDIR'], 'tmpdir', 'tmpdir')
-        finally:
-            os.unlink(postfile)
+
+        self.rm_tmp()
+        self.rm_sstate()
+        self.rm_cache()
+        self.sync()
+        cmd = ['bitbake', '-R', postfile, self.build_target]
+        self.measure_cmd_resources(cmd, 'build',
+                                   'bitbake' + self.build_target,
+                                   save_bs=True)
+        self.measure_disk_usage(self.bb_vars['TMPDIR'], 'tmpdir', 'tmpdir')
 
 
 class Test2(BuildPerfTestCase):
     build_target = 'core-image-sato'
 
     def test2(self):
-        """Measure bitbake core-image-sato -c rootfs with sstate"""
+        """Run core-image-sato do_rootfs with sstate"""
         # Build once in order to populate sstate cache
-        self.log_cmd_output(['bitbake', self.build_target])
+        self.run_cmd(['bitbake', self.build_target])
 
         self.rm_tmp()
         self.rm_cache()
@@ -86,7 +84,7 @@
 class Test3(BuildPerfTestCase):
 
     def test3(self):
-        """Parsing time metrics (bitbake -p)"""
+        """Bitbake parsing (bitbake -p)"""
         # Drop all caches and parse
         self.rm_cache()
         oe.path.remove(os.path.join(self.bb_vars['TMPDIR'], 'cache'), True)
@@ -106,8 +104,8 @@
 
     def test4(self):
         """eSDK metrics"""
-        self.log_cmd_output("bitbake {} -c do_populate_sdk_ext".format(
-            self.build_target))
+        self.run_cmd(['bitbake', '-c', 'do_populate_sdk_ext',
+                     self.build_target])
         self.bb_vars = get_bb_vars(None, self.build_target)
         tmp_dir = self.bb_vars['TMPDIR']
         installer = os.path.join(
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/controllers/masterimage.py b/import-layers/yocto-poky/meta/lib/oeqa/controllers/masterimage.py
index 9ce3bf8..07418fc 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/controllers/masterimage.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/controllers/masterimage.py
@@ -32,14 +32,14 @@
         super(MasterImageHardwareTarget, self).__init__(d)
 
         # target ip
-        addr = d.getVar("TEST_TARGET_IP", True) or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
+        addr = d.getVar("TEST_TARGET_IP") or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
         self.ip = addr.split(":")[0]
         try:
             self.port = addr.split(":")[1]
         except IndexError:
             self.port = None
         bb.note("Target IP: %s" % self.ip)
-        self.server_ip = d.getVar("TEST_SERVER_IP", True)
+        self.server_ip = d.getVar("TEST_SERVER_IP")
         if not self.server_ip:
             try:
                 self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]
@@ -49,8 +49,8 @@
 
         # test rootfs + kernel
         self.image_fstype = self.get_image_fstype(d)
-        self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype)
-        self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
+        self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype)
+        self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
         if not os.path.isfile(self.rootfs):
             # we could've checked that IMAGE_FSTYPES contains tar.gz but the config for running testimage might not be
             # the same as the config with which the image was build, ie
@@ -64,16 +64,16 @@
         # master ssh connection
         self.master = None
         # if the user knows what they are doing, then by all means...
-        self.user_cmds = d.getVar("TEST_DEPLOY_CMDS", True)
+        self.user_cmds = d.getVar("TEST_DEPLOY_CMDS")
         self.deploy_cmds = None
 
         # this is the name of the command that controls the power for a board
         # e.g: TEST_POWERCONTROL_CMD = "/home/user/myscripts/powercontrol.py ${MACHINE} what-ever-other-args-the-script-wants"
         # the command should take as the last argument "off" and "on" and "cycle" (off, on)
-        self.powercontrol_cmd = d.getVar("TEST_POWERCONTROL_CMD", True) or None
+        self.powercontrol_cmd = d.getVar("TEST_POWERCONTROL_CMD") or None
         self.powercontrol_args = d.getVar("TEST_POWERCONTROL_EXTRA_ARGS", False) or ""
 
-        self.serialcontrol_cmd = d.getVar("TEST_SERIALCONTROL_CMD", True) or None
+        self.serialcontrol_cmd = d.getVar("TEST_SERIALCONTROL_CMD") or None
         self.serialcontrol_args = d.getVar("TEST_SERIALCONTROL_EXTRA_ARGS", False) or ""
 
         self.origenv = os.environ
@@ -82,7 +82,7 @@
             # ssh + keys means we need the original user env
             bborigenv = d.getVar("BB_ORIGENV", False) or {}
             for key in bborigenv:
-                val = bborigenv.getVar(key, True)
+                val = bborigenv.getVar(key)
                 if val is not None:
                     self.origenv[key] = str(val)
 
@@ -159,10 +159,10 @@
         self.power_cycle(self.connection)
 
 
-class GummibootTarget(MasterImageHardwareTarget):
+class SystemdbootTarget(MasterImageHardwareTarget):
 
     def __init__(self, d):
-        super(GummibootTarget, self).__init__(d)
+        super(SystemdbootTarget, self).__init__(d)
         # this the value we need to set in the LoaderEntryOneShot EFI variable
         # so the system boots the 'test' bootloader label and not the default
         # The first four bytes are EFI bits, and the rest is an utf-16le string
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/README b/import-layers/yocto-poky/meta/lib/oeqa/core/README
new file mode 100644
index 0000000..0c859fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/README
@@ -0,0 +1,38 @@
+= OEQA Framework =
+
+== Introduction ==
+
+This is the new OEQA framework the base clases of the framework
+are in this module oeqa/core the subsequent components needs to
+extend this classes.
+
+A new/unique runner was created called oe-test and is under scripts/
+oe-test, this new runner scans over oeqa module searching for test
+components that supports OETestContextExecutor implemented in context
+module (i.e. oeqa/core/context.py).
+
+For execute an example:
+
+$ source oe-init-build-env
+$ oe-test core
+
+For list supported components:
+
+$ oe-test -h
+
+== Create new Test component ==
+
+Usally for add a new Test component the developer needs to extend
+OETestContext/OETestContextExecutor in context.py and OETestCase in
+case.py.
+
+== How to run the testing of the OEQA framework ==
+
+Run all tests:
+
+$ PATH=$PATH:../../ python3 -m unittest discover -s tests
+
+Run some test:
+
+$ cd tests/
+$ ./test_data.py
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/core/__init__.py
similarity index 100%
copy from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
copy to import-layers/yocto-poky/meta/lib/oeqa/core/__init__.py
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/case.py b/import-layers/yocto-poky/meta/lib/oeqa/core/case.py
new file mode 100644
index 0000000..d2dbf20
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/case.py
@@ -0,0 +1,46 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import unittest
+
+from oeqa.core.exception import OEQAMissingVariable
+
+def _validate_td_vars(td, td_vars, type_msg):
+    if td_vars:
+        for v in td_vars:
+            if not v in td:
+                raise OEQAMissingVariable("Test %s need %s variable but"\
+                        " isn't into td" % (type_msg, v))
+
+class OETestCase(unittest.TestCase):
+    # TestContext and Logger instance set by OETestLoader.
+    tc = None
+    logger = None
+
+    # td has all the variables needed by the test cases
+    # is the same across all the test cases.
+    td = None
+
+    # td_vars has the variables needed by a test class
+    # or test case instance, if some var isn't into td a
+    # OEMissingVariable exception is raised
+    td_vars = None
+
+    @classmethod
+    def _oeSetUpClass(clss):
+        _validate_td_vars(clss.td, clss.td_vars, "class")
+        clss.setUpClassMethod()
+
+    @classmethod
+    def _oeTearDownClass(clss):
+        clss.tearDownClassMethod()
+
+    def _oeSetUp(self):
+        for d in self.decorators:
+            d.setUpDecorator()
+        self.setUpMethod()
+
+    def _oeTearDown(self):
+        for d in self.decorators:
+            d.tearDownDecorator()
+        self.tearDownMethod()
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/core/cases/__init__.py
similarity index 100%
copy from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
copy to import-layers/yocto-poky/meta/lib/oeqa/core/cases/__init__.py
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/cases/example/data.json b/import-layers/yocto-poky/meta/lib/oeqa/core/cases/example/data.json
new file mode 100644
index 0000000..21d6b16
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/cases/example/data.json
@@ -0,0 +1 @@
+{"ARCH": "x86", "IMAGE": "core-image-minimal"}
\ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/cases/example/test_basic.py b/import-layers/yocto-poky/meta/lib/oeqa/core/cases/example/test_basic.py
new file mode 100644
index 0000000..11cf380
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/cases/example/test_basic.py
@@ -0,0 +1,20 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.depends import OETestDepends
+
+class OETestExample(OETestCase):
+    def test_example(self):
+        self.logger.info('IMAGE: %s' % self.td.get('IMAGE'))
+        self.assertEqual('core-image-minimal', self.td.get('IMAGE'))
+        self.logger.info('ARCH: %s' % self.td.get('ARCH'))
+        self.assertEqual('x86', self.td.get('ARCH'))
+
+class OETestExampleDepend(OETestCase):
+    @OETestDepends(['OETestExample.test_example'])
+    def test_example_depends(self):
+        pass
+
+    def test_example_no_depends(self):
+        pass
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/context.py b/import-layers/yocto-poky/meta/lib/oeqa/core/context.py
new file mode 100644
index 0000000..4476750
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/context.py
@@ -0,0 +1,243 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import json
+import time
+import logging
+import collections
+import re
+
+from oeqa.core.loader import OETestLoader
+from oeqa.core.runner import OETestRunner, OEStreamLogger, xmlEnabled
+
+class OETestContext(object):
+    loaderClass = OETestLoader
+    runnerClass = OETestRunner
+    streamLoggerClass = OEStreamLogger
+
+    files_dir = os.path.abspath(os.path.join(os.path.dirname(
+        os.path.abspath(__file__)), "../files"))
+
+    def __init__(self, td=None, logger=None):
+        if not type(td) is dict:
+            raise TypeError("td isn't dictionary type")
+
+        self.td = td
+        self.logger = logger
+        self._registry = {}
+        self._registry['cases'] = collections.OrderedDict()
+        self._results = {}
+
+    def _read_modules_from_manifest(self, manifest):
+        if not os.path.exists(manifest):
+            raise
+
+        modules = []
+        for line in open(manifest).readlines():
+            line = line.strip()
+            if line and not line.startswith("#"):
+                modules.append(line)
+
+        return modules
+
+    def loadTests(self, module_paths, modules=[], tests=[],
+            modules_manifest="", modules_required=[], filters={}):
+        if modules_manifest:
+            modules = self._read_modules_from_manifest(modules_manifest)
+
+        self.loader = self.loaderClass(self, module_paths, modules, tests,
+                modules_required, filters)
+        self.suites = self.loader.discover()
+
+    def runTests(self):
+        streamLogger = self.streamLoggerClass(self.logger)
+        self.runner = self.runnerClass(self, stream=streamLogger, verbosity=2)
+
+        self._run_start_time = time.time()
+        result = self.runner.run(self.suites)
+        self._run_end_time = time.time()
+
+        return result
+
+    def logSummary(self, result, component, context_msg=''):
+        self.logger.info("SUMMARY:")
+        self.logger.info("%s (%s) - Ran %d test%s in %.3fs" % (component,
+            context_msg, result.testsRun, result.testsRun != 1 and "s" or "",
+            (self._run_end_time - self._run_start_time)))
+
+        if result.wasSuccessful():
+            msg = "%s - OK - All required tests passed" % component
+        else:
+            msg = "%s - FAIL - Required tests failed" % component
+        skipped = len(self._results['skipped'])
+        if skipped: 
+            msg += " (skipped=%d)" % skipped
+        self.logger.info(msg)
+
+    def _getDetailsNotPassed(self, case, type, desc):
+        found = False
+
+        for (scase, msg) in self._results[type]:
+            # XXX: When XML reporting is enabled scase is
+            # xmlrunner.result._TestInfo instance instead of
+            # string.
+            if xmlEnabled:
+                if case.id() == scase.test_id:
+                    found = True
+                    break
+                scase_str = scase.test_id
+            else:
+                if case == scase:
+                    found = True
+                    break
+                scase_str = str(scase)
+
+            # When fails at module or class level the class name is passed as string
+            # so figure out to see if match
+            m = re.search("^setUpModule \((?P<module_name>.*)\)$", scase_str)
+            if m:
+                if case.__class__.__module__ == m.group('module_name'):
+                    found = True
+                    break
+
+            m = re.search("^setUpClass \((?P<class_name>.*)\)$", scase_str)
+            if m:
+                class_name = "%s.%s" % (case.__class__.__module__,
+                        case.__class__.__name__)
+
+                if class_name == m.group('class_name'):
+                    found = True
+                    break
+
+        if found:
+            return (found, msg)
+
+        return (found, None)
+
+    def logDetails(self):
+        self.logger.info("RESULTS:")
+        for case_name in self._registry['cases']:
+            case = self._registry['cases'][case_name]
+
+            result_types = ['failures', 'errors', 'skipped', 'expectedFailures']
+            result_desc = ['FAILED', 'ERROR', 'SKIPPED', 'EXPECTEDFAIL']
+
+            fail = False
+            desc = None
+            for idx, name in enumerate(result_types):
+                (fail, msg) = self._getDetailsNotPassed(case, result_types[idx],
+                        result_desc[idx])
+                if fail:
+                    desc = result_desc[idx]
+                    break
+
+            oeid = -1
+            for d in case.decorators:
+                if hasattr(d, 'oeid'):
+                    oeid = d.oeid
+            
+            if fail:
+                self.logger.info("RESULTS - %s - Testcase %s: %s" % (case.id(),
+                    oeid, desc))
+                if msg:
+                    self.logger.info(msg)
+            else:
+                self.logger.info("RESULTS - %s - Testcase %s: %s" % (case.id(),
+                    oeid, 'PASSED'))
+
+class OETestContextExecutor(object):
+    _context_class = OETestContext
+
+    name = 'core'
+    help = 'core test component example'
+    description = 'executes core test suite example'
+
+    default_cases = [os.path.join(os.path.abspath(os.path.dirname(__file__)),
+            'cases/example')]
+    default_test_data = os.path.join(default_cases[0], 'data.json')
+    default_tests = None
+
+    def register_commands(self, logger, subparsers):
+        self.parser = subparsers.add_parser(self.name, help=self.help,
+                description=self.description, group='components')
+
+        self.default_output_log = '%s-results-%s.log' % (self.name,
+                time.strftime("%Y%m%d%H%M%S"))
+        self.parser.add_argument('--output-log', action='store',
+                default=self.default_output_log,
+                help="results output log, default: %s" % self.default_output_log)
+        self.parser.add_argument('--run-tests', action='store',
+                default=self.default_tests,
+                help="tests to run in <module>[.<class>[.<name>]] format. Just works for modules now")
+
+        if self.default_test_data:
+            self.parser.add_argument('--test-data-file', action='store',
+                    default=self.default_test_data,
+                    help="data file to load, default: %s" % self.default_test_data)
+        else:
+            self.parser.add_argument('--test-data-file', action='store',
+                    help="data file to load")
+
+        if self.default_cases:
+            self.parser.add_argument('CASES_PATHS', action='store',
+                    default=self.default_cases, nargs='*',
+                    help="paths to directories with test cases, default: %s"\
+                            % self.default_cases)
+        else:
+            self.parser.add_argument('CASES_PATHS', action='store',
+                    nargs='+', help="paths to directories with test cases")
+
+        self.parser.set_defaults(func=self.run)
+
+    def _setup_logger(self, logger, args):
+        formatter = logging.Formatter('%(asctime)s - ' + self.name + \
+                ' - %(levelname)s - %(message)s')
+        sh = logger.handlers[0]
+        sh.setFormatter(formatter)
+        fh = logging.FileHandler(args.output_log)
+        fh.setFormatter(formatter)
+        logger.addHandler(fh)
+
+        return logger
+
+    def _process_args(self, logger, args):
+        self.tc_kwargs = {}
+        self.tc_kwargs['init'] = {}
+        self.tc_kwargs['load'] = {}
+        self.tc_kwargs['run'] = {}
+
+        self.tc_kwargs['init']['logger'] = self._setup_logger(logger, args)
+        if args.test_data_file:
+            self.tc_kwargs['init']['td'] = json.load(
+                    open(args.test_data_file, "r"))
+        else:
+            self.tc_kwargs['init']['td'] = {}
+
+
+        if args.run_tests:
+            self.tc_kwargs['load']['modules'] = args.run_tests.split()
+        else:
+            self.tc_kwargs['load']['modules'] = None
+
+        self.module_paths = args.CASES_PATHS
+
+    def run(self, logger, args):
+        self._process_args(logger, args)
+
+        self.tc = self._context_class(**self.tc_kwargs['init'])
+        self.tc.loadTests(self.module_paths, **self.tc_kwargs['load'])
+        rc = self.tc.runTests(**self.tc_kwargs['run'])
+        self.tc.logSummary(rc, self.name)
+        self.tc.logDetails()
+
+        output_link = os.path.join(os.path.dirname(args.output_log),
+                "%s-results.log" % self.name)
+        if os.path.exists(output_link):
+            os.remove(output_link)
+        os.symlink(args.output_log, output_link)
+
+        return rc
+
+_executor_class = OETestContextExecutor
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/__init__.py
new file mode 100644
index 0000000..855b6b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/__init__.py
@@ -0,0 +1,71 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from functools import wraps
+from abc import abstractmethod
+
+decoratorClasses = set()
+
+def registerDecorator(obj):
+    decoratorClasses.add(obj)
+    return obj
+
+class OETestDecorator(object):
+    case = None # Reference of OETestCase decorated
+    attrs = None # Attributes to be loaded by decorator implementation
+
+    def __init__(self, *args, **kwargs):
+        if not self.attrs:
+            return
+
+        for idx, attr in enumerate(self.attrs):
+            if attr in kwargs:
+                value = kwargs[attr]
+            else:
+                value = args[idx]
+            setattr(self, attr, value)
+
+    def __call__(self, func):
+        @wraps(func)
+        def wrapped_f(*args, **kwargs):
+            self.attrs = self.attrs # XXX: Enables OETestLoader discover
+            return func(*args, **kwargs)
+        return wrapped_f
+
+    # OETestLoader call it when is loading test cases.
+    # XXX: Most methods would change the registry for later
+    # processing; be aware that filtrate method needs to
+    # run later than bind, so there could be data (in the
+    # registry) of a cases that were filtered.
+    def bind(self, registry, case):
+        self.case = case
+        self.logger = case.tc.logger
+        self.case.decorators.append(self)
+
+    # OETestRunner call this method when tries to run
+    # the test case.
+    def setUpDecorator(self):
+        pass
+
+    # OETestRunner call it after a test method has been
+    # called even if the method raised an exception.
+    def tearDownDecorator(self):
+        pass
+
+class OETestDiscover(OETestDecorator):
+
+    # OETestLoader call it after discover test cases
+    # needs to return the cases to be run.
+    @staticmethod
+    def discover(registry):
+        return registry['cases']
+
+class OETestFilter(OETestDecorator):
+
+    # OETestLoader call it while loading the tests
+    # in loadTestsFromTestCase method, it needs to
+    # return a bool, True if needs to be filtered.
+    # This method must consume the filter used.
+    @abstractmethod
+    def filtrate(self, filters):
+        return False
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/data.py b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/data.py
new file mode 100644
index 0000000..ff7bdd9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/data.py
@@ -0,0 +1,98 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.exception import OEQAMissingVariable
+
+from . import OETestDecorator, registerDecorator
+
+def has_feature(td, feature):
+    """
+        Checks for feature in DISTRO_FEATURES or IMAGE_FEATURES.
+    """
+
+    if (feature in td.get('DISTRO_FEATURES', '') or
+        feature in td.get('IMAGE_FEATURES', '')):
+        return True
+    return False
+
+@registerDecorator
+class skipIfDataVar(OETestDecorator):
+    """
+        Skip test based on value of a data store's variable.
+
+        It will get the info of var from the data store and will
+        check it against value; if are equal it will skip the test
+        with msg as the reason.
+    """
+
+    attrs = ('var', 'value', 'msg')
+
+    def setUpDecorator(self):
+        msg = ('Checking if %r value is %r to skip test' %
+               (self.var, self.value))
+        self.logger.debug(msg)
+        if self.case.td.get(self.var) == self.value:
+            self.case.skipTest(self.msg)
+
+@registerDecorator
+class skipIfNotDataVar(OETestDecorator):
+    """
+        Skip test based on value of a data store's variable.
+
+        It will get the info of var from the data store and will
+        check it against value; if are not equal it will skip the
+        test with msg as the reason.
+    """
+
+    attrs = ('var', 'value', 'msg')
+
+    def setUpDecorator(self):
+        msg = ('Checking if %r value is not %r to skip test' %
+               (self.var, self.value))
+        self.logger.debug(msg)
+        if not self.case.td.get(self.var) == self.value:
+            self.case.skipTest(self.msg)
+
+@registerDecorator
+class skipIfNotInDataVar(OETestDecorator):
+    """
+        Skip test if value is not in data store's variable.
+    """
+
+    attrs = ('var', 'value', 'msg')
+    def setUpDecorator(self):
+        msg = ('Checking if %r value is in %r to run '
+              'the test' % (self.var, self.value))
+        self.logger.debug(msg)
+        if not self.value in self.case.td.get(self.var):
+            self.case.skipTest(self.msg)
+
+@registerDecorator
+class OETestDataDepends(OETestDecorator):
+    attrs = ('td_depends',)
+
+    def setUpDecorator(self):
+        for v in self.td_depends:
+            try:
+                value = self.case.td[v]
+            except KeyError:
+                raise OEQAMissingVariable("Test case need %s variable but"\
+                        " isn't into td" % v)
+
+@registerDecorator
+class skipIfNotFeature(OETestDecorator):
+    """
+        Skip test based on DISTRO_FEATURES.
+
+        value must be in distro features or it will skip the test
+        with msg as the reason.
+    """
+
+    attrs = ('value', 'msg')
+
+    def setUpDecorator(self):
+        msg = ('Checking if %s is in DISTRO_FEATURES '
+               'or IMAGE_FEATURES' % (self.value))
+        self.logger.debug(msg)
+        if not has_feature(self.case.td, self.value):
+            self.case.skipTest(self.msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/depends.py b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/depends.py
new file mode 100644
index 0000000..195711c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/depends.py
@@ -0,0 +1,94 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from unittest import SkipTest
+
+from oeqa.core.exception import OEQADependency
+
+from . import OETestDiscover, registerDecorator
+
+def _add_depends(registry, case, depends):
+    module_name = case.__module__
+    class_name = case.__class__.__name__
+
+    case_id = case.id()
+
+    for depend in depends:
+        dparts = depend.split('.')
+
+        if len(dparts) == 1:
+            depend_id = ".".join((module_name, class_name, dparts[0]))
+        elif len(dparts) == 2:
+            depend_id = ".".join((module_name, dparts[0], dparts[1]))
+        else:
+            depend_id = depend
+
+        if not case_id in registry:
+            registry[case_id] = []
+        if not depend_id in registry[case_id]:
+            registry[case_id].append(depend_id)
+
+def _validate_test_case_depends(cases, depends):
+    for case in depends:
+        if not case in cases:
+            continue
+        for dep in depends[case]:
+            if not dep in cases:
+                raise OEQADependency("TestCase %s depends on %s and isn't available"\
+                       ", cases available %s." % (case, dep, str(cases.keys())))
+
+def _order_test_case_by_depends(cases, depends):
+    def _dep_resolve(graph, node, resolved, seen):
+        seen.append(node)
+        for edge in graph[node]:
+            if edge not in resolved:
+                if edge in seen:
+                    raise OEQADependency("Test cases %s and %s have a circular" \
+                                       " dependency." % (node, edge))
+                _dep_resolve(graph, edge, resolved, seen)
+        resolved.append(node)
+
+    dep_graph = {}
+    dep_graph['__root__'] = cases.keys()
+    for case in cases:
+        if case in depends:
+            dep_graph[case] = depends[case]
+        else:
+            dep_graph[case] = []
+
+    cases_ordered = []
+    _dep_resolve(dep_graph, '__root__', cases_ordered, [])
+    cases_ordered.remove('__root__')
+
+    return [cases[case_id] for case_id in cases_ordered]
+
+def _skipTestDependency(case, depends):
+    results = case.tc._results
+    skipReasons = ['errors', 'failures', 'skipped']
+
+    for reason in skipReasons:
+        for test, _ in results[reason]:
+            if test.id() in depends:
+                raise SkipTest("Test case %s depends on %s and was in %s." \
+                        % (case.id(), test.id(), reason))
+
+@registerDecorator
+class OETestDepends(OETestDiscover):
+    attrs = ('depends',)
+
+    def bind(self, registry, case):
+        super(OETestDepends, self).bind(registry, case)
+        if not registry.get('depends'):
+            registry['depends'] = {}
+        _add_depends(registry['depends'], case, self.depends)
+
+    @staticmethod
+    def discover(registry):
+        if registry.get('depends'):
+            _validate_test_case_depends(registry['cases'], registry['depends'])
+            return _order_test_case_by_depends(registry['cases'], registry['depends'])
+        else:
+            return [registry['cases'][case_id] for case_id in registry['cases']]
+
+    def setUpDecorator(self):
+        _skipTestDependency(self.case, self.depends)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/oeid.py b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/oeid.py
new file mode 100644
index 0000000..ea8017a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/oeid.py
@@ -0,0 +1,23 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from . import OETestFilter, registerDecorator
+from oeqa.core.utils.misc import intToList
+
+def _idFilter(oeid, filters):
+     return False if oeid in filters else True
+
+@registerDecorator
+class OETestID(OETestFilter):
+    attrs = ('oeid',)
+
+    def bind(self, registry, case):
+        super(OETestID, self).bind(registry, case)
+
+    def filtrate(self, filters):
+        if filters.get('oeid'):
+            filterx = intToList(filters['oeid'], 'oeid')
+            del filters['oeid']
+            if _idFilter(self.oeid, filterx):
+                return True
+        return False
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/oetag.py b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/oetag.py
new file mode 100644
index 0000000..ad38ab7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/oetag.py
@@ -0,0 +1,24 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from . import OETestFilter, registerDecorator
+from oeqa.core.utils.misc import strToList
+
+def _tagFilter(tags, filters):
+    return False if set(tags) & set(filters) else True
+
+@registerDecorator
+class OETestTag(OETestFilter):
+    attrs = ('oetag',)
+
+    def bind(self, registry, case):
+        super(OETestTag, self).bind(registry, case)
+        self.oetag = strToList(self.oetag, 'oetag')
+
+    def filtrate(self, filters):
+        if filters.get('oetag'):
+            filterx = strToList(filters['oetag'], 'oetag')
+            del filters['oetag']
+            if _tagFilter(self.oetag, filterx):
+                return True
+        return False
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/oetimeout.py b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/oetimeout.py
new file mode 100644
index 0000000..a247583
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/decorator/oetimeout.py
@@ -0,0 +1,25 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import signal
+from . import OETestDecorator, registerDecorator
+from oeqa.core.exception import OEQATimeoutError
+
+@registerDecorator
+class OETimeout(OETestDecorator):
+    attrs = ('oetimeout',)
+
+    def setUpDecorator(self):
+        timeout = self.oetimeout
+        def _timeoutHandler(signum, frame):
+            raise OEQATimeoutError("Timed out after %s "
+                    "seconds of execution" % timeout)
+
+        self.logger.debug("Setting up a %d second(s) timeout" % self.oetimeout)
+        self.alarmSignal = signal.signal(signal.SIGALRM, _timeoutHandler)
+        signal.alarm(self.oetimeout)
+
+    def tearDownDecorator(self):
+        signal.alarm(0)
+        signal.signal(signal.SIGALRM, self.alarmSignal)
+        self.logger.debug("Removed SIGALRM handler")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/exception.py b/import-layers/yocto-poky/meta/lib/oeqa/core/exception.py
new file mode 100644
index 0000000..2dfd840
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/exception.py
@@ -0,0 +1,14 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+class OEQAException(Exception):
+    pass
+
+class OEQATimeoutError(OEQAException):
+    pass
+
+class OEQAMissingVariable(OEQAException):
+    pass
+
+class OEQADependency(OEQAException):
+    pass
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/loader.py b/import-layers/yocto-poky/meta/lib/oeqa/core/loader.py
new file mode 100644
index 0000000..63a1703
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/loader.py
@@ -0,0 +1,272 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import unittest
+
+from oeqa.core.utils.path import findFile
+from oeqa.core.utils.test import getSuiteModules, getCaseID
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator import decoratorClasses, OETestDecorator, \
+        OETestFilter, OETestDiscover
+
+def _make_failed_test(classname, methodname, exception, suiteClass):
+    """
+        When loading tests unittest framework stores the exception in a new
+        class created for be displayed into run().
+
+        For our purposes will be better to raise the exception in loading 
+        step instead of wait to run the test suite.
+    """
+    raise exception
+unittest.loader._make_failed_test = _make_failed_test
+
+def _find_duplicated_modules(suite, directory):
+    for module in getSuiteModules(suite):
+        path = findFile('%s.py' % module, directory)
+        if path:
+            raise ImportError("Duplicated %s module found in %s" % (module, path))
+
+class OETestLoader(unittest.TestLoader):
+    caseClass = OETestCase
+
+    kwargs_names = ['testMethodPrefix', 'sortTestMethodUsing', 'suiteClass',
+            '_top_level_dir']
+
+    def __init__(self, tc, module_paths, modules, tests, modules_required,
+            filters, *args, **kwargs):
+        self.tc = tc
+
+        self.modules = modules
+        self.tests = tests
+        self.modules_required = modules_required
+
+        self.filters = filters
+        self.decorator_filters = [d for d in decoratorClasses if \
+                issubclass(d, OETestFilter)]
+        self._validateFilters(self.filters, self.decorator_filters)
+        self.used_filters = [d for d in self.decorator_filters
+                             for f in self.filters
+                             if f in d.attrs]
+
+        if isinstance(module_paths, str):
+            module_paths = [module_paths]
+        elif not isinstance(module_paths, list):
+            raise TypeError('module_paths must be a str or a list of str')
+        self.module_paths = module_paths
+
+        for kwname in self.kwargs_names:
+            if kwname in kwargs:
+                setattr(self, kwname, kwargs[kwname])
+
+        self._patchCaseClass(self.caseClass)
+
+    def _patchCaseClass(self, testCaseClass):
+        # Adds custom attributes to the OETestCase class
+        setattr(testCaseClass, 'tc', self.tc)
+        setattr(testCaseClass, 'td', self.tc.td)
+        setattr(testCaseClass, 'logger', self.tc.logger)
+
+    def _validateFilters(self, filters, decorator_filters):
+        # Validate if filter isn't empty
+        for key,value in filters.items():
+            if not value:
+                raise TypeError("Filter %s specified is empty" % key)
+
+        # Validate unique attributes
+        attr_filters = [attr for clss in decorator_filters \
+                                for attr in clss.attrs]
+        dup_attr = [attr for attr in attr_filters
+                    if attr_filters.count(attr) > 1]
+        if dup_attr:
+            raise TypeError('Detected duplicated attribute(s) %s in filter'
+                            ' decorators' % ' ,'.join(dup_attr))
+
+        # Validate if filter is supported
+        for f in filters:
+            if f not in attr_filters:
+                classes = ', '.join([d.__name__ for d in decorator_filters])
+                raise TypeError('Found "%s" filter but not declared in any of '
+                                '%s decorators' % (f, classes))
+
+    def _registerTestCase(self, case):
+        case_id = case.id()
+        self.tc._registry['cases'][case_id] = case
+
+    def _handleTestCaseDecorators(self, case):
+        def _handle(obj):
+            if isinstance(obj, OETestDecorator):
+                if not obj.__class__ in decoratorClasses:
+                    raise Exception("Decorator %s isn't registered" \
+                            " in decoratorClasses." % obj.__name__)
+                obj.bind(self.tc._registry, case)
+
+        def _walk_closure(obj):
+            if hasattr(obj, '__closure__') and obj.__closure__:
+                for f in obj.__closure__:
+                    obj = f.cell_contents
+                    _handle(obj)
+                    _walk_closure(obj)
+        method = getattr(case, case._testMethodName, None)
+        _walk_closure(method)
+
+    def _filterTest(self, case):
+        """
+            Returns True if test case must be filtered, False otherwise.
+        """
+        if self.filters:
+            filters = self.filters.copy()
+            case_decorators = [cd for cd in case.decorators
+                               if cd.__class__ in self.used_filters]
+
+            # Iterate over case decorators to check if needs to be filtered.
+            for cd in case_decorators:
+                if cd.filtrate(filters):
+                    return True
+
+            # Case is missing one or more decorators for all the filters
+            # being used, so filter test case.
+            if filters:
+                return True
+
+        return False
+
+    def _getTestCase(self, testCaseClass, tcName):
+        if not hasattr(testCaseClass, '__oeqa_loader'):
+            # In order to support data_vars validation
+            # monkey patch the default setUp/tearDown{Class} to use
+            # the ones provided by OETestCase
+            setattr(testCaseClass, 'setUpClassMethod',
+                    getattr(testCaseClass, 'setUpClass'))
+            setattr(testCaseClass, 'tearDownClassMethod',
+                    getattr(testCaseClass, 'tearDownClass'))
+            setattr(testCaseClass, 'setUpClass',
+                    testCaseClass._oeSetUpClass)
+            setattr(testCaseClass, 'tearDownClass',
+                    testCaseClass._oeTearDownClass)
+
+            # In order to support decorators initialization
+            # monkey patch the default setUp/tearDown to use
+            # a setUpDecorators/tearDownDecorators that methods
+            # will call setUp/tearDown original methods.
+            setattr(testCaseClass, 'setUpMethod',
+                    getattr(testCaseClass, 'setUp')) 
+            setattr(testCaseClass, 'tearDownMethod',
+                    getattr(testCaseClass, 'tearDown'))
+            setattr(testCaseClass, 'setUp', testCaseClass._oeSetUp)
+            setattr(testCaseClass, 'tearDown', testCaseClass._oeTearDown)
+
+            setattr(testCaseClass, '__oeqa_loader', True)
+
+        case = testCaseClass(tcName)
+        setattr(case, 'decorators', [])
+
+        return case
+
+    def loadTestsFromTestCase(self, testCaseClass):
+        """
+            Returns a suite of all tests cases contained in testCaseClass.
+        """
+        if issubclass(testCaseClass, unittest.suite.TestSuite):
+            raise TypeError("Test cases should not be derived from TestSuite." \
+                                " Maybe you meant to derive %s from TestCase?" \
+                                % testCaseClass.__name__)
+        if not issubclass(testCaseClass, self.caseClass):
+            raise TypeError("Test %s is not derived from %s" % \
+                    (testCaseClass.__name__, self.caseClass.__name__))
+
+        testCaseNames = self.getTestCaseNames(testCaseClass)
+        if not testCaseNames and hasattr(testCaseClass, 'runTest'):
+            testCaseNames = ['runTest']
+
+        suite = []
+        for tcName in testCaseNames:
+            case = self._getTestCase(testCaseClass, tcName)
+            # Filer by case id
+            if not (self.tests and not 'all' in self.tests
+                    and not getCaseID(case) in self.tests):
+                self._handleTestCaseDecorators(case)
+
+                # Filter by decorators
+                if not self._filterTest(case):
+                    self._registerTestCase(case)
+                    suite.append(case)
+
+        return self.suiteClass(suite)
+
+    def discover(self):
+        big_suite = self.suiteClass()
+        for path in self.module_paths:
+            _find_duplicated_modules(big_suite, path)
+            suite = super(OETestLoader, self).discover(path,
+                    pattern='*.py', top_level_dir=path)
+            big_suite.addTests(suite)
+
+        cases = None
+        discover_classes = [clss for clss in decoratorClasses
+                            if issubclass(clss, OETestDiscover)]
+        for clss in discover_classes:
+            cases = clss.discover(self.tc._registry)
+
+        return self.suiteClass(cases) if cases else big_suite
+
+    # XXX After Python 3.5, remove backward compatibility hacks for
+    # use_load_tests deprecation via *args and **kws.  See issue 16662.
+    if sys.version_info >= (3,5):
+        def loadTestsFromModule(self, module, *args, pattern=None, **kws):
+            """
+                Returns a suite of all tests cases contained in module.
+            """
+            if module.__name__ in sys.builtin_module_names:
+                msg = 'Tried to import %s test module but is a built-in'
+                raise ImportError(msg % module.__name__)
+
+            # Normal test modules are loaded if no modules were specified,
+            # if module is in the specified module list or if 'all' is in
+            # module list.
+            # Underscore modules are loaded only if specified in module list.
+            load_module = True if not module.__name__.startswith('_') \
+                                  and (not self.modules \
+                                       or module.__name__ in self.modules \
+                                       or 'all' in self.modules) \
+                               else False
+
+            load_underscore = True if module.__name__.startswith('_') \
+                                      and module.__name__ in self.modules \
+                                   else False
+
+            if load_module or load_underscore:
+                return super(OETestLoader, self).loadTestsFromModule(
+                        module, *args, pattern=pattern, **kws)
+            else:
+                return self.suiteClass()
+    else:
+        def loadTestsFromModule(self, module, use_load_tests=True):
+            """
+                Returns a suite of all tests cases contained in module.
+            """
+            if module.__name__ in sys.builtin_module_names:
+                msg = 'Tried to import %s test module but is a built-in'
+                raise ImportError(msg % module.__name__)
+
+            # Normal test modules are loaded if no modules were specified,
+            # if module is in the specified module list or if 'all' is in
+            # module list.
+            # Underscore modules are loaded only if specified in module list.
+            load_module = True if not module.__name__.startswith('_') \
+                                  and (not self.modules \
+                                       or module.__name__ in self.modules \
+                                       or 'all' in self.modules) \
+                               else False
+
+            load_underscore = True if module.__name__.startswith('_') \
+                                      and module.__name__ in self.modules \
+                                   else False
+
+            if load_module or load_underscore:
+                return super(OETestLoader, self).loadTestsFromModule(
+                        module, use_load_tests)
+            else:
+                return self.suiteClass()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/runner.py b/import-layers/yocto-poky/meta/lib/oeqa/core/runner.py
new file mode 100644
index 0000000..44ffecb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/runner.py
@@ -0,0 +1,76 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import time
+import unittest
+import logging
+
+xmlEnabled = False
+try:
+    import xmlrunner
+    from xmlrunner.result import _XMLTestResult as _TestResult
+    from xmlrunner.runner import XMLTestRunner as _TestRunner
+    xmlEnabled = True
+except ImportError:
+    # use the base runner instead
+    from unittest import TextTestResult as _TestResult
+    from unittest import TextTestRunner as _TestRunner
+
+class OEStreamLogger(object):
+    def __init__(self, logger):
+        self.logger = logger
+        self.buffer = ""
+
+    def write(self, msg):
+        if len(msg) > 1 and msg[0] != '\n':
+            self.buffer += msg
+        else:
+            self.logger.log(logging.INFO, self.buffer.rstrip("\n"))
+            self.buffer = ""
+
+    def flush(self):
+        for handler in self.logger.handlers:
+            handler.flush()
+
+class OETestResult(_TestResult):
+    def __init__(self, tc, *args, **kwargs):
+        super(OETestResult, self).__init__(*args, **kwargs)
+
+        self.tc = tc
+
+        self.tc._results['failures'] = self.failures
+        self.tc._results['errors'] = self.errors
+        self.tc._results['skipped'] = self.skipped
+        self.tc._results['expectedFailures'] = self.expectedFailures
+
+    def startTest(self, test):
+        super(OETestResult, self).startTest(test)
+
+class OETestRunner(_TestRunner):
+    def __init__(self, tc, *args, **kwargs):
+        if xmlEnabled:
+            if not kwargs.get('output'):
+                kwargs['output'] = os.path.join(os.getcwd(),
+                        'TestResults_%s_%s' % (time.strftime("%Y%m%d%H%M%S"), os.getpid()))
+
+        super(OETestRunner, self).__init__(*args, **kwargs)
+        self.tc = tc
+        self.resultclass = OETestResult
+
+    # XXX: The unittest-xml-reporting package defines _make_result method instead
+    # of _makeResult standard on unittest.
+    if xmlEnabled:
+        def _make_result(self):
+            """
+            Creates a TestResult object which will be used to store
+            information about the executed tests.
+            """
+            # override in subclasses if necessary.
+            return self.resultclass(self.tc,
+                self.stream, self.descriptions, self.verbosity, self.elapsed_times
+            )
+    else:
+        def _makeResult(self):
+            return self.resultclass(self.tc, self.stream, self.descriptions,
+                    self.verbosity)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/target/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/core/target/__init__.py
new file mode 100644
index 0000000..d2468bc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/target/__init__.py
@@ -0,0 +1,33 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from abc import abstractmethod
+
+class OETarget(object):
+
+    def __init__(self, logger, *args, **kwargs):
+        self.logger = logger
+
+    @abstractmethod
+    def start(self):
+        pass
+
+    @abstractmethod
+    def stop(self):
+        pass
+
+    @abstractmethod
+    def run(self, cmd, timeout=None):
+        pass
+
+    @abstractmethod
+    def copyTo(self, localSrc, remoteDst):
+        pass
+
+    @abstractmethod
+    def copyFrom(self, remoteSrc, localDst):
+        pass
+
+    @abstractmethod
+    def copyDirTo(self, localSrc, remoteDst):
+        pass
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/target/qemu.py b/import-layers/yocto-poky/meta/lib/oeqa/core/target/qemu.py
new file mode 100644
index 0000000..2dc521c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/target/qemu.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import signal
+import time
+
+from .ssh import OESSHTarget
+from oeqa.utils.qemurunner import QemuRunner
+
+supported_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic', 'elf']
+
+class OEQemuTarget(OESSHTarget):
+    def __init__(self, logger, ip, server_ip, timeout=300, user='root',
+            port=None, machine='', rootfs='', kernel='', kvm=False,
+            dump_dir='', dump_host_cmds='', display='', bootlog='',
+            tmpdir='', dir_image='', boottime=60, **kwargs):
+
+        super(OEQemuTarget, self).__init__(logger, ip, server_ip, timeout,
+                user, port)
+
+        self.ip = ip
+        self.server_ip = server_ip
+        self.machine = machine
+        self.rootfs = rootfs
+        self.kernel = kernel
+        self.kvm = kvm
+
+        self.runner = QemuRunner(machine=machine, rootfs=rootfs, tmpdir=tmpdir,
+                                 deploy_dir_image=dir_image, display=display,
+                                 logfile=bootlog, boottime=boottime,
+                                 use_kvm=kvm, dump_dir=dump_dir,
+                                 dump_host_cmds=dump_host_cmds)
+
+    def start(self, params=None, extra_bootparams=None):
+        if self.runner.start(params, extra_bootparams=extra_bootparams):
+            self.ip = self.runner.ip
+            self.server_ip = self.runner.server_ip
+        else:
+            self.stop()
+            raise RuntimeError("FAILED to start qemu - check the task log and the boot log")
+
+    def stop(self):
+        self.runner.stop()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/target/ssh.py b/import-layers/yocto-poky/meta/lib/oeqa/core/target/ssh.py
new file mode 100644
index 0000000..b80939c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/target/ssh.py
@@ -0,0 +1,266 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import time
+import select
+import logging
+import subprocess
+
+from . import OETarget
+
+class OESSHTarget(OETarget):
+    def __init__(self, logger, ip, server_ip, timeout=300, user='root',
+                 port=None, **kwargs):
+        if not logger:
+            logger = logging.getLogger('target')
+            logger.setLevel(logging.INFO)
+            filePath = os.path.join(os.getcwd(), 'remoteTarget.log')
+            fileHandler = logging.FileHandler(filePath, 'w', 'utf-8')
+            formatter = logging.Formatter(
+                        '%(asctime)s.%(msecs)03d %(levelname)s: %(message)s',
+                        '%H:%M:%S')
+            fileHandler.setFormatter(formatter)
+            logger.addHandler(fileHandler)
+
+        super(OESSHTarget, self).__init__(logger)
+        self.ip = ip
+        self.server_ip = server_ip
+        self.timeout = timeout
+        self.user = user
+        ssh_options = [
+                '-o', 'UserKnownHostsFile=/dev/null',
+                '-o', 'StrictHostKeyChecking=no',
+                '-o', 'LogLevel=ERROR'
+                ]
+        self.ssh = ['ssh', '-l', self.user ] + ssh_options
+        self.scp = ['scp'] + ssh_options
+        if port:
+            self.ssh = self.ssh + [ '-p', port ]
+            self.scp = self.scp + [ '-P', port ]
+
+    def start(self, **kwargs):
+        pass
+
+    def stop(self, **kwargs):
+        pass
+
+    def _run(self, command, timeout=None, ignore_status=True):
+        """
+            Runs command in target using SSHProcess.
+        """
+        self.logger.debug("[Running]$ %s" % " ".join(command))
+
+        starttime = time.time()
+        status, output = SSHCall(command, self.logger, timeout)
+        self.logger.debug("[Command returned '%d' after %.2f seconds]"
+                 "" % (status, time.time() - starttime))
+
+        if status and not ignore_status:
+            raise AssertionError("Command '%s' returned non-zero exit "
+                                 "status %d:\n%s" % (command, status, output))
+
+        return (status, output)
+
+    def run(self, command, timeout=None):
+        """
+            Runs command in target.
+
+            command:    Command to run on target.
+            timeout:    <value>:    Kill command after <val> seconds.
+                        None:       Kill command default value seconds.
+                        0:          No timeout, runs until return.
+        """
+        targetCmd = 'export PATH=/usr/sbin:/sbin:/usr/bin:/bin; %s' % command
+        sshCmd = self.ssh + [self.ip, targetCmd]
+
+        if timeout:
+            processTimeout = timeout
+        elif timeout==0:
+            processTimeout = None
+        else:
+            processTimeout = self.timeout
+
+        status, output = self._run(sshCmd, processTimeout, True)
+        self.logger.info('\nCommand: %s\nOutput:  %s\n' % (command, output))
+        return (status, output)
+
+    def copyTo(self, localSrc, remoteDst):
+        """
+            Copy file to target.
+
+            If local file is symlink, recreate symlink in target.
+        """
+        if os.path.islink(localSrc):
+            link = os.readlink(localSrc)
+            dstDir, dstBase = os.path.split(remoteDst)
+            sshCmd = 'cd %s; ln -s %s %s' % (dstDir, link, dstBase)
+            return self.run(sshCmd)
+
+        else:
+            remotePath = '%s@%s:%s' % (self.user, self.ip, remoteDst)
+            scpCmd = self.scp + [localSrc, remotePath]
+            return self._run(scpCmd, ignore_status=False)
+
+    def copyFrom(self, remoteSrc, localDst):
+        """
+            Copy file from target.
+        """
+        remotePath = '%s@%s:%s' % (self.user, self.ip, remoteSrc)
+        scpCmd = self.scp + [remotePath, localDst]
+        return self._run(scpCmd, ignore_status=False)
+
+    def copyDirTo(self, localSrc, remoteDst):
+        """
+            Copy recursively localSrc directory to remoteDst in target.
+        """
+
+        for root, dirs, files in os.walk(localSrc):
+            # Create directories in the target as needed
+            for d in dirs:
+                tmpDir = os.path.join(root, d).replace(localSrc, "")
+                newDir = os.path.join(remoteDst, tmpDir.lstrip("/"))
+                cmd = "mkdir -p %s" % newDir
+                self.run(cmd)
+
+            # Copy files into the target
+            for f in files:
+                tmpFile = os.path.join(root, f).replace(localSrc, "")
+                dstFile = os.path.join(remoteDst, tmpFile.lstrip("/"))
+                srcFile = os.path.join(root, f)
+                self.copyTo(srcFile, dstFile)
+
+    def deleteFiles(self, remotePath, files):
+        """
+            Deletes files in target's remotePath.
+        """
+
+        cmd = "rm"
+        if not isinstance(files, list):
+            files = [files]
+
+        for f in files:
+            cmd = "%s %s" % (cmd, os.path.join(remotePath, f))
+
+        self.run(cmd)
+
+
+    def deleteDir(self, remotePath):
+        """
+            Deletes target's remotePath directory.
+        """
+
+        cmd = "rmdir %s" % remotePath
+        self.run(cmd)
+
+
+    def deleteDirStructure(self, localPath, remotePath):
+        """
+        Delete recursively localPath structure directory in target's remotePath.
+
+        This function is very usefult to delete a package that is installed in
+        the DUT and the host running the test has such package extracted in tmp
+        directory.
+
+        Example:
+            pwd: /home/user/tmp
+            tree:   .
+                    └── work
+                        ├── dir1
+                        │   └── file1
+                        └── dir2
+
+            localpath = "/home/user/tmp" and remotepath = "/home/user"
+
+            With the above variables this function will try to delete the
+            directory in the DUT in this order:
+                /home/user/work/dir1/file1
+                /home/user/work/dir1        (if dir is empty)
+                /home/user/work/dir2        (if dir is empty)
+                /home/user/work             (if dir is empty)
+        """
+
+        for root, dirs, files in os.walk(localPath, topdown=False):
+            # Delete files first
+            tmpDir = os.path.join(root).replace(localPath, "")
+            remoteDir = os.path.join(remotePath, tmpDir.lstrip("/"))
+            self.deleteFiles(remoteDir, files)
+
+            # Remove dirs if empty
+            for d in dirs:
+                tmpDir = os.path.join(root, d).replace(localPath, "")
+                remoteDir = os.path.join(remotePath, tmpDir.lstrip("/"))
+                self.deleteDir(remoteDir)
+
+def SSHCall(command, logger, timeout=None, **opts):
+
+    def run():
+        nonlocal output
+        nonlocal process
+        starttime = time.time()
+        process = subprocess.Popen(command, **options)
+        if timeout:
+            endtime = starttime + timeout
+            eof = False
+            while time.time() < endtime and not eof:
+                logger.debug('time: %s, endtime: %s' % (time.time(), endtime))
+                try:
+                    if select.select([process.stdout], [], [], 5)[0] != []:
+                        data = os.read(process.stdout.fileno(), 1024)
+                        if not data:
+                            process.stdout.close()
+                            eof = True
+                        else:
+                            data = data.decode("utf-8")
+                            output += data
+                            logger.debug('Partial data from SSH call: %s' % data)
+                            endtime = time.time() + timeout
+                except InterruptedError:
+                    continue
+
+            # process hasn't returned yet
+            if not eof:
+                process.terminate()
+                time.sleep(5)
+                try:
+                    process.kill()
+                except OSError:
+                    pass
+                endtime = time.time() - starttime
+                lastline = ("\nProcess killed - no output for %d seconds. Total"
+                            " running time: %d seconds." % (timeout, endtime))
+                logger.debug('Received data from SSH call %s ' % lastline)
+                output += lastline
+
+        else:
+            output = process.communicate()[0].decode("utf-8")
+            logger.debug('Data from SSH call: %s' % output.rstrip())
+
+    options = {
+        "stdout": subprocess.PIPE,
+        "stderr": subprocess.STDOUT,
+        "stdin": None,
+        "shell": False,
+        "bufsize": -1,
+        "preexec_fn": os.setsid,
+    }
+    options.update(opts)
+    output = ''
+    process = None
+
+    # Unset DISPLAY which means we won't trigger SSH_ASKPASS
+    env = os.environ.copy()
+    if "DISPLAY" in env:
+        del env['DISPLAY']
+    options['env'] = env
+
+    try:
+        run()
+    except:
+        # Need to guard against a SystemExit or other exception ocurring
+        # whilst running and ensure we don't leave a process behind.
+        if process.poll() is None:
+            process.kill()
+        logger.debug('Something went wrong, killing SSH process')
+        raise
+    return (process.wait(), output.rstrip())
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/__init__.py
similarity index 100%
rename from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
rename to import-layers/yocto-poky/meta/lib/oeqa/core/tests/__init__.py
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/data.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/data.py
new file mode 100644
index 0000000..88003a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/data.py
@@ -0,0 +1,20 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.oetag import OETestTag
+from oeqa.core.decorator.data import OETestDataDepends
+
+class DataTest(OETestCase):
+    data_vars = ['IMAGE', 'ARCH']
+
+    @OETestDataDepends(['MACHINE',])
+    @OETestTag('dataTestOk')
+    def testDataOk(self):
+        self.assertEqual(self.td.get('IMAGE'), 'core-image-minimal')
+        self.assertEqual(self.td.get('ARCH'), 'x86')
+        self.assertEqual(self.td.get('MACHINE'), 'qemuarm')
+
+    @OETestTag('dataTestFail')
+    def testDataFail(self):
+        pass
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/depends.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/depends.py
new file mode 100644
index 0000000..17cdd90
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/depends.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.depends import OETestDepends
+
+class DependsTest(OETestCase):
+
+    def testDependsFirst(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    @OETestDepends(['testDependsFirst'])
+    def testDependsSecond(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    @OETestDepends(['testDependsSecond'])
+    def testDependsThird(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    @OETestDepends(['testDependsSecond'])
+    def testDependsFourth(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    @OETestDepends(['testDependsThird', 'testDependsFourth'])
+    def testDependsFifth(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    @OETestDepends(['testDependsCircular3'])
+    def testDependsCircular1(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    @OETestDepends(['testDependsCircular1'])
+    def testDependsCircular2(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    @OETestDepends(['testDependsCircular2'])
+    def testDependsCircular3(self):
+        self.assertTrue(True, msg='How is this possible?')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py
new file mode 100644
index 0000000..038d445
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py
@@ -0,0 +1,15 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+
+class AnotherIDTest(OETestCase):
+
+    def testAnotherIdGood(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    def testAnotherIdOther(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    def testAnotherIdNone(self):
+        self.assertTrue(True, msg='How is this possible?')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/loader/valid/another.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/loader/valid/another.py
new file mode 100644
index 0000000..c9ffd17
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/loader/valid/another.py
@@ -0,0 +1,9 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+
+class AnotherTest(OETestCase):
+
+    def testAnother(self):
+        self.assertTrue(True, msg='How is this possible?')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/oeid.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/oeid.py
new file mode 100644
index 0000000..c2d3d32
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/oeid.py
@@ -0,0 +1,18 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.oeid import OETestID
+
+class IDTest(OETestCase):
+
+    @OETestID(101)
+    def testIdGood(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    @OETestID(102)
+    def testIdOther(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    def testIdNone(self):
+        self.assertTrue(True, msg='How is this possible?')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/oetag.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/oetag.py
new file mode 100644
index 0000000..0cae02e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/oetag.py
@@ -0,0 +1,18 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.oetag import OETestTag
+
+class TagTest(OETestCase):
+
+    @OETestTag('goodTag')
+    def testTagGood(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    @OETestTag('otherTag')
+    def testTagOther(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    def testTagNone(self):
+        self.assertTrue(True, msg='How is this possible?')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/timeout.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/timeout.py
new file mode 100644
index 0000000..870c315
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/cases/timeout.py
@@ -0,0 +1,18 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from time import sleep
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.oetimeout import OETimeout
+
+class TimeoutTest(OETestCase):
+
+    @OETimeout(1)
+    def testTimeoutPass(self):
+        self.assertTrue(True, msg='How is this possible?')
+
+    @OETimeout(1)
+    def testTimeoutFail(self):
+        sleep(2)
+        self.assertTrue(True, msg='How is this possible?')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/common.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/common.py
new file mode 100644
index 0000000..52b18a1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/common.py
@@ -0,0 +1,35 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import sys
+import os
+
+import unittest
+import logging
+import os
+
+logger = logging.getLogger("oeqa")
+logger.setLevel(logging.INFO)
+consoleHandler = logging.StreamHandler()
+formatter = logging.Formatter('OEQATest: %(message)s')
+consoleHandler.setFormatter(formatter)
+logger.addHandler(consoleHandler)
+
+def setup_sys_path():
+    directory = os.path.dirname(os.path.abspath(__file__))
+    oeqa_lib = os.path.realpath(os.path.join(directory, '../../../'))
+    if not oeqa_lib in sys.path:
+        sys.path.insert(0, oeqa_lib)
+
+class TestBase(unittest.TestCase):
+    def setUp(self):
+        self.logger = logger
+        directory = os.path.dirname(os.path.abspath(__file__))
+        self.cases_path = os.path.join(directory, 'cases')
+
+    def _testLoader(self, d={}, modules=[], tests=[], filters={}):
+        from oeqa.core.context import OETestContext
+        tc = OETestContext(d, self.logger)
+        tc.loadTests(self.cases_path, modules=modules, tests=tests,
+                     filters=filters)
+        return tc
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_data.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_data.py
new file mode 100755
index 0000000..320468c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_data.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import unittest
+import logging
+import os
+
+from common import setup_sys_path, TestBase
+setup_sys_path()
+
+from oeqa.core.exception import OEQAMissingVariable
+from oeqa.core.utils.test import getCaseMethod, getSuiteCasesNames
+
+class TestData(TestBase):
+    modules = ['data']
+
+    def test_data_fail_missing_variable(self):
+        expectedException = "oeqa.core.exception.OEQAMissingVariable"
+
+        tc = self._testLoader(modules=self.modules)
+        self.assertEqual(False, tc.runTests().wasSuccessful())
+        for test, data in tc._results['errors']:
+            expect = False
+            if expectedException in data:
+                expect = True
+
+            self.assertTrue(expect)
+
+    def test_data_fail_wrong_variable(self):
+        expectedError = 'AssertionError'
+        d = {'IMAGE' : 'core-image-sato', 'ARCH' : 'arm'}
+
+        tc = self._testLoader(d=d, modules=self.modules)
+        self.assertEqual(False, tc.runTests().wasSuccessful())
+        for test, data in tc._results['failures']:
+            expect = False
+            if expectedError in data:
+                expect = True
+
+            self.assertTrue(expect)
+
+    def test_data_ok(self):
+        d = {'IMAGE' : 'core-image-minimal', 'ARCH' : 'x86', 'MACHINE' : 'qemuarm'}
+
+        tc = self._testLoader(d=d, modules=self.modules)
+        self.assertEqual(True, tc.runTests().wasSuccessful())
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_decorators.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_decorators.py
new file mode 100755
index 0000000..f7d11e8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_decorators.py
@@ -0,0 +1,135 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import signal
+import unittest
+
+from common import setup_sys_path, TestBase
+setup_sys_path()
+
+from oeqa.core.exception import OEQADependency
+from oeqa.core.utils.test import getCaseMethod, getSuiteCasesNames, getSuiteCasesIDs
+
+class TestFilterDecorator(TestBase):
+
+    def _runFilterTest(self, modules, filters, expect, msg):
+        tc = self._testLoader(modules=modules, filters=filters)
+        test_loaded = set(getSuiteCasesNames(tc.suites))
+        self.assertEqual(expect, test_loaded, msg=msg)
+
+    def test_oetag(self):
+        # Get all cases without filtering.
+        filter_all = {}
+        test_all = {'testTagGood', 'testTagOther', 'testTagNone'}
+        msg_all = 'Failed to get all oetag cases without filtering.'
+
+        # Get cases with 'goodTag'.
+        filter_good = {'oetag':'goodTag'}
+        test_good = {'testTagGood'}
+        msg_good = 'Failed to get just one test filtering with "goodTag" oetag.'
+
+        # Get cases with an invalid tag.
+        filter_invalid = {'oetag':'invalidTag'}
+        test_invalid = set()
+        msg_invalid = 'Failed to filter all test using an invalid oetag.'
+
+        tests = ((filter_all, test_all, msg_all),
+                 (filter_good, test_good, msg_good),
+                 (filter_invalid, test_invalid, msg_invalid))
+
+        for test in tests:
+            self._runFilterTest(['oetag'], test[0], test[1], test[2])
+
+    def test_oeid(self):
+        # Get all cases without filtering.
+        filter_all = {}
+        test_all = {'testIdGood', 'testIdOther', 'testIdNone'}
+        msg_all = 'Failed to get all oeid cases without filtering.'
+
+        # Get cases with '101' oeid.
+        filter_good = {'oeid': 101}
+        test_good = {'testIdGood'}
+        msg_good = 'Failed to get just one tes filtering with "101" oeid.'
+
+        # Get cases with an invalid id.
+        filter_invalid = {'oeid':999}
+        test_invalid = set()
+        msg_invalid = 'Failed to filter all test using an invalid oeid.'
+
+        tests = ((filter_all, test_all, msg_all),
+                 (filter_good, test_good, msg_good),
+                 (filter_invalid, test_invalid, msg_invalid))
+
+        for test in tests:
+            self._runFilterTest(['oeid'], test[0], test[1], test[2])
+
+class TestDependsDecorator(TestBase):
+    modules = ['depends']
+
+    def test_depends_order(self):
+        tests =  ['depends.DependsTest.testDependsFirst',
+                  'depends.DependsTest.testDependsSecond',
+                  'depends.DependsTest.testDependsThird',
+                  'depends.DependsTest.testDependsFourth',
+                  'depends.DependsTest.testDependsFifth']
+        tests2 = list(tests)
+        tests2[2], tests2[3] = tests[3], tests[2]
+        tc = self._testLoader(modules=self.modules, tests=tests)
+        test_loaded = getSuiteCasesIDs(tc.suites)
+        result = True if test_loaded == tests or test_loaded == tests2 else False
+        msg = 'Failed to order tests using OETestDepends decorator.\nTest order:'\
+              ' %s.\nExpected:   %s\nOr:         %s' % (test_loaded, tests, tests2)
+        self.assertTrue(result, msg=msg)
+
+    def test_depends_fail_missing_dependency(self):
+        expect = "TestCase depends.DependsTest.testDependsSecond depends on "\
+                 "depends.DependsTest.testDependsFirst and isn't available"
+        tests =  ['depends.DependsTest.testDependsSecond']
+        try:
+            # Must throw OEQADependency because missing 'testDependsFirst'
+            tc = self._testLoader(modules=self.modules, tests=tests)
+            self.fail('Expected OEQADependency exception')
+        except OEQADependency as e:
+            result = True if expect in str(e) else False
+            msg = 'Expected OEQADependency exception missing testDependsFirst test'
+            self.assertTrue(result, msg=msg)
+
+    def test_depends_fail_circular_dependency(self):
+        expect = 'have a circular dependency'
+        tests =  ['depends.DependsTest.testDependsCircular1',
+                  'depends.DependsTest.testDependsCircular2',
+                  'depends.DependsTest.testDependsCircular3']
+        try:
+            # Must throw OEQADependency because circular dependency
+            tc = self._testLoader(modules=self.modules, tests=tests)
+            self.fail('Expected OEQADependency exception')
+        except OEQADependency as e:
+            result = True if expect in str(e) else False
+            msg = 'Expected OEQADependency exception having a circular dependency'
+            self.assertTrue(result, msg=msg)
+
+class TestTimeoutDecorator(TestBase):
+    modules = ['timeout']
+
+    def test_timeout(self):
+        tests = ['timeout.TimeoutTest.testTimeoutPass']
+        msg = 'Failed to run test using OETestTimeout'
+        alarm_signal = signal.getsignal(signal.SIGALRM)
+        tc = self._testLoader(modules=self.modules, tests=tests)
+        self.assertTrue(tc.runTests().wasSuccessful(), msg=msg)
+        msg = "OETestTimeout didn't restore SIGALRM"
+        self.assertIs(alarm_signal, signal.getsignal(signal.SIGALRM), msg=msg)
+
+    def test_timeout_fail(self):
+        tests = ['timeout.TimeoutTest.testTimeoutFail']
+        msg = "OETestTimeout test didn't timeout as expected"
+        alarm_signal = signal.getsignal(signal.SIGALRM)
+        tc = self._testLoader(modules=self.modules, tests=tests)
+        self.assertFalse(tc.runTests().wasSuccessful(), msg=msg)
+        msg = "OETestTimeout didn't restore SIGALRM"
+        self.assertIs(alarm_signal, signal.getsignal(signal.SIGALRM), msg=msg)
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_loader.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_loader.py
new file mode 100755
index 0000000..b79b8ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_loader.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import unittest
+
+from common import setup_sys_path, TestBase
+setup_sys_path()
+
+from oeqa.core.exception import OEQADependency
+from oeqa.core.utils.test import getSuiteModules, getSuiteCasesIDs
+
+class TestLoader(TestBase):
+
+    def test_fail_empty_filter(self):
+        filters = {'oetag' : ''}
+        expect = 'Filter oetag specified is empty'
+        msg = 'Expected TypeError exception for having invalid filter'
+        try:
+            # Must throw TypeError because empty filter
+            tc = self._testLoader(filters=filters)
+            self.fail(msg)
+        except TypeError as e:
+            result = True if expect in str(e) else False
+            self.assertTrue(result, msg=msg)
+
+    def test_fail_invalid_filter(self):
+        filters = {'invalid' : 'good'}
+        expect = 'filter but not declared in any of'
+        msg = 'Expected TypeError exception for having invalid filter'
+        try:
+            # Must throw TypeError because invalid filter
+            tc = self._testLoader(filters=filters)
+            self.fail(msg)
+        except TypeError as e:
+            result = True if expect in str(e) else False
+            self.assertTrue(result, msg=msg)
+
+    def test_fail_duplicated_module(self):
+        cases_path = self.cases_path
+        invalid_path = os.path.join(cases_path, 'loader', 'invalid')
+        self.cases_path = [self.cases_path, invalid_path]
+        expect = 'Duplicated oeid module found in'
+        msg = 'Expected ImportError exception for having duplicated module'
+        try:
+            # Must throw ImportEror because duplicated module
+            tc = self._testLoader()
+            self.fail(msg)
+        except ImportError as e:
+            result = True if expect in str(e) else False
+            self.assertTrue(result, msg=msg)
+        finally:
+            self.cases_path = cases_path
+
+    def test_filter_modules(self):
+        expected_modules = {'oeid', 'oetag'}
+        tc = self._testLoader(modules=expected_modules)
+        modules = getSuiteModules(tc.suites)
+        msg = 'Expected just %s modules' % ', '.join(expected_modules)
+        self.assertEqual(modules, expected_modules, msg=msg)
+
+    def test_filter_cases(self):
+        modules = ['oeid', 'oetag', 'data']
+        expected_cases = {'data.DataTest.testDataOk',
+                          'oetag.TagTest.testTagGood',
+                          'oeid.IDTest.testIdGood'}
+        tc = self._testLoader(modules=modules, tests=expected_cases)
+        cases = set(getSuiteCasesIDs(tc.suites))
+        msg = 'Expected just %s cases' % ', '.join(expected_cases)
+        self.assertEqual(cases, expected_cases, msg=msg)
+
+    def test_import_from_paths(self):
+        cases_path = self.cases_path
+        cases2_path = os.path.join(cases_path, 'loader', 'valid')
+        expected_modules = {'oeid', 'another'}
+        self.cases_path = [self.cases_path, cases2_path]
+        tc = self._testLoader(modules=expected_modules)
+        modules = getSuiteModules(tc.suites)
+        self.cases_path = cases_path
+        msg = 'Expected modules from two different paths'
+        self.assertEqual(modules, expected_modules, msg=msg)
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_runner.py b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_runner.py
new file mode 100755
index 0000000..a3f3861
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/tests/test_runner.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import unittest
+import logging
+import tempfile
+
+from common import setup_sys_path, TestBase
+setup_sys_path()
+
+from oeqa.core.runner import OEStreamLogger
+
+class TestRunner(TestBase):
+    def test_stream_logger(self):
+        fp = tempfile.TemporaryFile(mode='w+')
+
+        logging.basicConfig(format='%(message)s', stream=fp)
+        logger = logging.getLogger()
+        logger.setLevel(logging.INFO)
+
+        oeSL = OEStreamLogger(logger)
+
+        lines = ['init', 'bigline_' * 65535, 'morebigline_' * 65535 * 4, 'end']
+        for line in lines:
+            oeSL.write(line)
+
+        fp.seek(0)
+        fp_lines = fp.readlines()
+        for i, fp_line in enumerate(fp_lines):
+            fp_line = fp_line.strip()
+            self.assertEqual(lines[i], fp_line)
+
+        fp.close()
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/core/utils/__init__.py
similarity index 100%
copy from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
copy to import-layers/yocto-poky/meta/lib/oeqa/core/utils/__init__.py
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/utils/misc.py b/import-layers/yocto-poky/meta/lib/oeqa/core/utils/misc.py
new file mode 100644
index 0000000..0b223b5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/utils/misc.py
@@ -0,0 +1,44 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+def toList(obj, obj_type, obj_name="Object"):
+    if isinstance(obj, obj_type):
+        return [obj]
+    elif isinstance(obj, list):
+        return obj
+    else:
+        raise TypeError("%s must be %s or list" % (obj_name, obj_type))
+
+def toSet(obj, obj_type, obj_name="Object"):
+    if isinstance(obj, obj_type):
+        return {obj}
+    elif isinstance(obj, list):
+        return set(obj)
+    elif isinstance(obj, set):
+        return obj
+    else:
+        raise TypeError("%s must be %s or set" % (obj_name, obj_type))
+
+def strToList(obj, obj_name="Object"):
+    return toList(obj, str, obj_name)
+
+def strToSet(obj, obj_name="Object"):
+    return toSet(obj, str, obj_name)
+
+def intToList(obj, obj_name="Object"):
+    return toList(obj, int, obj_name)
+
+def dataStoteToDict(d, variables):
+    data = {}
+
+    for v in variables:
+        data[v] = d.getVar(v)
+
+    return data
+
+def updateTestData(d, td, variables):
+    """
+    Updates variables with values of data store to test data.
+    """
+    for var in variables:
+        td[var] = d.getVar(var)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/utils/path.py b/import-layers/yocto-poky/meta/lib/oeqa/core/utils/path.py
new file mode 100644
index 0000000..a21caad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/utils/path.py
@@ -0,0 +1,19 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+
+def findFile(file_name, directory):
+    """
+        Search for a file in directory and returns its complete path.
+    """
+    for r, d, f in os.walk(directory):
+        if file_name in f:
+            return os.path.join(r, file_name)
+    return None
+
+def remove_safe(path):
+    if os.path.exists(path):
+        os.remove(path)
+
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/core/utils/test.py b/import-layers/yocto-poky/meta/lib/oeqa/core/utils/test.py
new file mode 100644
index 0000000..88d5d13
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/core/utils/test.py
@@ -0,0 +1,86 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import inspect
+import unittest
+
+def getSuiteCases(suite):
+    """
+        Returns individual test from a test suite.
+    """
+    tests = []
+
+    if isinstance(suite, unittest.TestCase):
+        tests.append(suite)
+    elif isinstance(suite, unittest.suite.TestSuite):
+        for item in suite:
+            tests.extend(getSuiteCases(item))
+
+    return tests
+
+def getSuiteModules(suite):
+    """
+        Returns modules in a test suite.
+    """
+    modules = set()
+    for test in getSuiteCases(suite):
+        modules.add(getCaseModule(test))
+    return modules
+
+def getSuiteCasesInfo(suite, func):
+    """
+        Returns test case info from suite. Info is fetched from func.
+    """
+    tests = []
+    for test in getSuiteCases(suite):
+        tests.append(func(test))
+    return tests
+
+def getSuiteCasesNames(suite):
+    """
+        Returns test case names from suite.
+    """
+    return getSuiteCasesInfo(suite, getCaseMethod)
+
+def getSuiteCasesIDs(suite):
+    """
+        Returns test case ids from suite.
+    """
+    return getSuiteCasesInfo(suite, getCaseID)
+
+def getSuiteCasesFiles(suite):
+    """
+        Returns test case files paths from suite.
+    """
+    return getSuiteCasesInfo(suite, getCaseFile)
+
+def getCaseModule(test_case):
+    """
+        Returns test case module name.
+    """
+    return test_case.__module__
+
+def getCaseClass(test_case):
+    """
+        Returns test case class name.
+    """
+    return test_case.__class__.__name__
+
+def getCaseID(test_case):
+    """
+        Returns test case complete id.
+    """
+    return test_case.id()
+
+def getCaseFile(test_case):
+    """
+        Returns test case file path.
+    """
+    return inspect.getsourcefile(test_case.__class__)
+
+def getCaseMethod(test_case):
+    """
+        Returns test case method name.
+    """
+    return getCaseID(test_case).split('.')[-1]
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.c b/import-layers/yocto-poky/meta/lib/oeqa/files/test.c
similarity index 100%
rename from import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.c
rename to import-layers/yocto-poky/meta/lib/oeqa/files/test.c
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.cpp b/import-layers/yocto-poky/meta/lib/oeqa/files/test.cpp
similarity index 100%
rename from import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.cpp
rename to import-layers/yocto-poky/meta/lib/oeqa/files/test.cpp
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.pl b/import-layers/yocto-poky/meta/lib/oeqa/files/test.pl
similarity index 100%
rename from import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.pl
rename to import-layers/yocto-poky/meta/lib/oeqa/files/test.pl
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.py b/import-layers/yocto-poky/meta/lib/oeqa/files/test.py
similarity index 100%
rename from import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.py
rename to import-layers/yocto-poky/meta/lib/oeqa/files/test.py
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/oetest.py b/import-layers/yocto-poky/meta/lib/oeqa/oetest.py
index 95d3bf7..f717126 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/oetest.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/oetest.py
@@ -27,7 +27,6 @@
 except ImportError:
     pass
 from oeqa.utils.decorators import LogResults, gettag, getResults
-from oeqa.utils import avoid_paths_in_environ
 
 logger = logging.getLogger("BitBake")
 
@@ -107,7 +106,7 @@
         pass
 
     def tearDown(self):
-        # Unistall packages in the DUT
+        # Uninstall packages in the DUT
         self.tc.install_uninstall_packages(self.id(), False)
 
         res = getResults()
@@ -129,48 +128,6 @@
     def tearDownLocal(self):
         pass
 
-    #TODO: use package_manager.py to install packages on any type of image
-    def install_packages(self, packagelist):
-        for package in packagelist:
-            (status, result) = self.target.run("smart install -y "+package)
-            if status != 0:
-                return status
-
-class OETestCalledProcessError(subprocess.CalledProcessError):
-    def __str__(self):
-        if hasattr(self, "stderr"):
-            return "Command '%s' returned non-zero exit status %d with output %s and stderr %s" % (self.cmd, self.returncode, self.output, self.stderr)
-        else:
-            return "Command '%s' returned non-zero exit status %d with output %s" % (self.cmd, self.returncode, self.output)
-
-subprocess.CalledProcessError = OETestCalledProcessError
-
-class oeSDKTest(oeTest):
-    def __init__(self, methodName='runTest'):
-        self.sdktestdir = oeSDKTest.tc.sdktestdir
-        super(oeSDKTest, self).__init__(methodName)
-
-    @classmethod
-    def hasHostPackage(self, pkg):
-        if re.search(pkg, oeTest.tc.hostpkgmanifest):
-            return True
-        return False
-
-    def _run(self, cmd):
-        return subprocess.check_output(". %s > /dev/null; %s;" % (self.tc.sdkenv, cmd), shell=True, stderr=subprocess.STDOUT).decode("utf-8")
-
-class oeSDKExtTest(oeSDKTest):
-    def _run(self, cmd):
-        # extensible sdk shows a warning if found bitbake in the path
-        # because can cause contamination, i.e. use devtool from
-        # poky/scripts instead of eSDK one.
-        env = os.environ.copy()
-        paths_to_avoid = ['bitbake/bin', 'poky/scripts']
-        env['PATH'] = avoid_paths_in_environ(paths_to_avoid)
-
-        return subprocess.check_output(". %s > /dev/null;"\
-            " %s;" % (self.tc.sdkenv, cmd), stderr=subprocess.STDOUT, shell=True, env=env).decode("utf-8")
-
 def getmodule(pos=2):
     # stack returns a list of tuples containg frame information
     # First element of the list the is current frame, caller is 1
@@ -221,15 +178,16 @@
             path = [os.path.dirname(os.path.abspath(__file__))]
             extrapath = ""
         else:
-            path = d.getVar("BBPATH", True).split(':')
+            path = d.getVar("BBPATH").split(':')
             extrapath = "lib/oeqa"
 
         self.testslist = self._get_tests_list(path, extrapath)
         self.testsrequired = self._get_test_suites_required()
 
         self.filesdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "runtime/files")
-        self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split()
-        self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split()
+        self.corefilesdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")
+        self.imagefeatures = d.getVar("IMAGE_FEATURES").split()
+        self.distrofeatures = d.getVar("DISTRO_FEATURES").split()
 
     # get testcase list from specified file
     # if path is a relative path, then relative to build/conf/
@@ -406,9 +364,9 @@
         self.target = target
 
         self.pkgmanifest = {}
-        manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True),
-                d.getVar("IMAGE_LINK_NAME", True) + ".manifest")
-        nomanifest = d.getVar("IMAGE_NO_MANIFEST", True)
+        manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"),
+                d.getVar("IMAGE_LINK_NAME") + ".manifest")
+        nomanifest = d.getVar("IMAGE_NO_MANIFEST")
         if nomanifest is None or nomanifest != "1":
             try:
                 with open(manifest) as f:
@@ -424,19 +382,19 @@
     def _get_test_suites(self):
         testsuites = []
 
-        manifests = (self.d.getVar("TEST_SUITES_MANIFEST", True) or '').split()
+        manifests = (self.d.getVar("TEST_SUITES_MANIFEST") or '').split()
         if manifests:
             for manifest in manifests:
                 testsuites.extend(self._read_testlist(manifest,
-                                  self.d.getVar("TOPDIR", True)).split())
+                                  self.d.getVar("TOPDIR")).split())
 
         else:
-            testsuites = self.d.getVar("TEST_SUITES", True).split()
+            testsuites = self.d.getVar("TEST_SUITES").split()
 
         return testsuites
 
     def _get_test_suites_required(self):
-        return [t for t in self.d.getVar("TEST_SUITES", True).split() if t != "auto"]
+        return [t for t in self.d.getVar("TEST_SUITES").split() if t != "auto"]
 
     def loadTests(self):
         super(RuntimeTestContext, self).loadTests()
@@ -449,10 +407,10 @@
         """
 
         modules = self.getTestModules()
-        bbpaths = self.d.getVar("BBPATH", True).split(":")
+        bbpaths = self.d.getVar("BBPATH").split(":")
 
-        shutil.rmtree(self.d.getVar("TEST_EXTRACTED_DIR", True))
-        shutil.rmtree(self.d.getVar("TEST_PACKAGED_DIR", True))
+        shutil.rmtree(self.d.getVar("TEST_EXTRACTED_DIR"))
+        shutil.rmtree(self.d.getVar("TEST_PACKAGED_DIR"))
         for module in modules:
             json_file = self._getJsonFile(module)
             if json_file:
@@ -466,8 +424,8 @@
 
         import oe.path
 
-        extracted_path = self.d.getVar("TEST_EXTRACTED_DIR", True)
-        packaged_path = self.d.getVar("TEST_PACKAGED_DIR", True)
+        extracted_path = self.d.getVar("TEST_EXTRACTED_DIR")
+        packaged_path = self.d.getVar("TEST_PACKAGED_DIR")
 
         for key,value in needed_packages.items():
             packages = ()
@@ -548,7 +506,7 @@
 
         from oeqa.utils.package_manager import get_package_manager
 
-        pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR", True), pkg)
+        pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR"), pkg)
         pm = get_package_manager(self.d, pkg_path)
         extract_dir = pm.extract(pkg)
         shutil.rmtree(pkg_path)
@@ -562,8 +520,8 @@
 
         from oeqa.utils.package_manager import get_package_manager
 
-        pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR", True), pkg)
-        dst_dir = self.d.getVar("TEST_PACKAGED_DIR", True)
+        pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR"), pkg)
+        dst_dir = self.d.getVar("TEST_PACKAGED_DIR")
         pm = get_package_manager(self.d, pkg_path)
         pkg_info = pm.package_info(pkg)
         file_path = pkg_info[pkg]["filepath"]
@@ -572,7 +530,7 @@
 
     def install_uninstall_packages(self, test_id, pkg_dir, install):
         """
-        Check if the test requires a package and Install/Unistall it in the DUT
+        Check if the test requires a package and Install/Uninstall it in the DUT
         """
 
         test = test_id.split(".")[4]
@@ -585,7 +543,7 @@
 
     def _install_uninstall_packages(self, needed_packages, pkg_dir, install=True):
         """
-        Install/Unistall packages in the DUT without using a package manager
+        Install/Uninstall packages in the DUT without using a package manager
         """
 
         if isinstance(needed_packages, dict):
@@ -603,7 +561,7 @@
             if install and extract:
                 self.target.connection.copy_dir_to(src_dir, "/")
 
-            # Unistall package
+            # Uninstall package
             elif not install and rm:
                 self.target.connection.delete_dir_structure(src_dir, "/")
 
@@ -611,7 +569,7 @@
     def __init__(self, d, target, host_dumper):
         super(ImageTestContext, self).__init__(d, target)
 
-        self.tagexp = d.getVar("TEST_SUITES_TAGS", True)
+        self.tagexp = d.getVar("TEST_SUITES_TAGS")
 
         self.host_dumper = host_dumper
 
@@ -626,10 +584,10 @@
 
     def install_uninstall_packages(self, test_id, install=True):
         """
-        Check if the test requires a package and Install/Unistall it in the DUT
+        Check if the test requires a package and Install/Uninstall it in the DUT
         """
 
-        pkg_dir = self.d.getVar("TEST_EXTRACTED_DIR", True)
+        pkg_dir = self.d.getVar("TEST_EXTRACTED_DIR")
         super(ImageTestContext, self).install_uninstall_packages(test_id, pkg_dir, install)
 
 class ExportTestContext(RuntimeTestContext):
@@ -643,80 +601,16 @@
         super(ExportTestContext, self).__init__(d, target, exported)
 
         tag = parsedArgs.get("tag", None)
-        self.tagexp = tag if tag != None else d.getVar("TEST_SUITES_TAGS", True)
+        self.tagexp = tag if tag != None else d.getVar("TEST_SUITES_TAGS")
 
         self.sigterm = None
 
     def install_uninstall_packages(self, test_id, install=True):
         """
-        Check if the test requires a package and Install/Unistall it in the DUT
+        Check if the test requires a package and Install/Uninstall it in the DUT
         """
 
         export_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
-        extracted_dir = self.d.getVar("TEST_EXPORT_EXTRACTED_DIR", True)
+        extracted_dir = self.d.getVar("TEST_EXPORT_EXTRACTED_DIR")
         pkg_dir = os.path.join(export_dir, extracted_dir)
         super(ExportTestContext, self).install_uninstall_packages(test_id, pkg_dir, install)
-
-class SDKTestContext(TestContext):
-    def __init__(self, d, sdktestdir, sdkenv, tcname, *args):
-        super(SDKTestContext, self).__init__(d)
-
-        self.sdktestdir = sdktestdir
-        self.sdkenv = sdkenv
-        self.tcname = tcname
-
-        if not hasattr(self, 'target_manifest'):
-            self.target_manifest = d.getVar("SDK_TARGET_MANIFEST", True)
-        try:
-            self.pkgmanifest = {}
-            with open(self.target_manifest) as f:
-                for line in f:
-                    (pkg, arch, version) = line.strip().split()
-                    self.pkgmanifest[pkg] = (version, arch)
-        except IOError as e:
-            bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e)
-
-        if not hasattr(self, 'host_manifest'):
-            self.host_manifest = d.getVar("SDK_HOST_MANIFEST", True)
-        try:
-            with open(self.host_manifest) as f:
-                self.hostpkgmanifest = f.read()
-        except IOError as e:
-            bb.fatal("No host package manifest file found. Did you build the sdk image?\n%s" % e)
-
-    def _get_test_namespace(self):
-        return "sdk"
-
-    def _get_test_suites(self):
-        return (self.d.getVar("TEST_SUITES_SDK", True) or "auto").split()
-
-    def _get_test_suites_required(self):
-        return [t for t in (self.d.getVar("TEST_SUITES_SDK", True) or \
-                "auto").split() if t != "auto"]
-
-class SDKExtTestContext(SDKTestContext):
-    def __init__(self, d, sdktestdir, sdkenv, tcname, *args):
-        self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST", True)
-        self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST", True)
-        if args:
-            self.cm = args[0] # Compatibility mode for run SDK tests
-        else:
-            self.cm = False
-
-        super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv, tcname)
-
-        self.sdkextfilesdir = os.path.join(os.path.dirname(os.path.abspath(
-            oeqa.sdkext.__file__)), "files")
-
-    def _get_test_namespace(self):
-        if self.cm:
-            return "sdk"
-        else:
-            return "sdkext"
-
-    def _get_test_suites(self):
-        return (self.d.getVar("TEST_SUITES_SDK_EXT", True) or "auto").split()
-
-    def _get_test_suites_required(self):
-        return [t for t in (self.d.getVar("TEST_SUITES_SDK_EXT", True) or \
-                "auto").split() if t != "auto"]
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runexported.py b/import-layers/yocto-poky/meta/lib/oeqa/runexported.py
index 7e245c4..9cfea0f 100755
--- a/import-layers/yocto-poky/meta/lib/oeqa/runexported.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runexported.py
@@ -43,8 +43,8 @@
         self.ip = None
         self.server_ip = None
         self.datetime = time.strftime('%Y%m%d%H%M%S',time.gmtime())
-        self.testdir = d.getVar("TEST_LOG_DIR", True)
-        self.pn = d.getVar("PN", True)
+        self.testdir = d.getVar("TEST_LOG_DIR")
+        self.pn = d.getVar("PN")
 
     def exportStart(self):
         self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
@@ -130,8 +130,8 @@
     """
 
     export_dir = os.path.dirname(os.path.realpath(__file__))
-    tools_dir = d.getVar("TEST_EXPORT_SDK_DIR", True)
-    tarball_name = "%s.sh" % d.getVar("TEST_EXPORT_SDK_NAME", True)
+    tools_dir = d.getVar("TEST_EXPORT_SDK_DIR")
+    tarball_name = "%s.sh" % d.getVar("TEST_EXPORT_SDK_NAME")
     tarball_path = os.path.join(export_dir, tools_dir, tarball_name)
     extract_path = os.path.join(export_dir, "sysroot")
     if os.path.isfile(tarball_path):
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/_ptest.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/_ptest.py
deleted file mode 100644
index 71324d3..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/_ptest.py
+++ /dev/null
@@ -1,125 +0,0 @@
-import unittest, os, shutil
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-from oeqa.utils.logparser import *
-from oeqa.utils.httpserver import HTTPService
-import bb
-import glob
-from oe.package_manager import RpmPkgsList
-import subprocess
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("package-management"):
-        skipModule("Image doesn't have package management feature")
-    if not oeRuntimeTest.hasPackage("smartpm"):
-        skipModule("Image doesn't have smart installed")
-    if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
-        skipModule("Rpm is not the primary package manager")
-
-class PtestRunnerTest(oeRuntimeTest):
-
-    # a ptest log parser
-    def parse_ptest(self, logfile):
-        parser = Lparser(test_0_pass_regex="^PASS:(.+)", test_0_fail_regex="^FAIL:(.+)", section_0_begin_regex="^BEGIN: .*/(.+)/ptest", section_0_end_regex="^END: .*/(.+)/ptest")
-        parser.init()
-        result = Result()
-
-        with open(logfile) as f:
-            for line in f:
-                result_tuple = parser.parse_line(line)
-                if not result_tuple:
-                    continue
-                result_tuple = line_type, category, status, name = parser.parse_line(line)
-
-                if line_type == 'section' and status == 'begin':
-                    current_section = name
-                    continue
-
-                if line_type == 'section' and status == 'end':
-                    current_section = None
-                    continue
-
-                if line_type == 'test' and status == 'pass':
-                    result.store(current_section, name, status)
-                    continue
-
-                if line_type == 'test' and status == 'fail':
-                    result.store(current_section, name, status)
-                    continue
-
-        result.sort_tests()
-        return result
-
-    @classmethod
-    def setUpClass(self):
-        #note the existing channels that are on the board before creating new ones
-#        self.existingchannels = set()
-#        (status, result) = oeRuntimeTest.tc.target.run('smart channel --show | grep "\["', 0)
-#        for x in result.split("\n"):
-#            self.existingchannels.add(x)
-        self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), oeRuntimeTest.tc.target.server_ip)
-        self.repo_server.start()
-
-    @classmethod
-    def tearDownClass(self):
-        self.repo_server.stop()
-        #remove created channels to be able to repeat the tests on same image
-#        (status, result) = oeRuntimeTest.tc.target.run('smart channel --show | grep "\["', 0)
-#        for x in result.split("\n"):
-#            if x not in self.existingchannels:
-#                oeRuntimeTest.tc.target.run('smart channel --remove '+x[1:-1]+' -y', 0)
-
-    def add_smart_channel(self):
-        image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE', True)
-        deploy_url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, image_pkgtype)
-        pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS', True).replace("-","_").split()
-        for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)):
-            if arch in pkgarchs:
-                self.target.run('smart channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url), 0)
-        self.target.run('smart update', 0)
-
-    def install_complementary(self, globs=None):
-        installed_pkgs_file = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR', True),
-                                           "installed_pkgs.txt")
-        self.pkgs_list = RpmPkgsList(oeRuntimeTest.tc.d, oeRuntimeTest.tc.d.getVar('IMAGE_ROOTFS', True), oeRuntimeTest.tc.d.getVar('arch_var', True), oeRuntimeTest.tc.d.getVar('os_var', True))
-        with open(installed_pkgs_file, "w+") as installed_pkgs:
-            installed_pkgs.write(self.pkgs_list.list("arch"))
-
-        cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
-               "-p", oeRuntimeTest.tc.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file,
-               globs]
-        try:
-            bb.note("Installing complementary packages ...")
-            complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
-        except subprocess.CalledProcessError as e:
-            bb.fatal("Could not compute complementary packages list. Command "
-                     "'%s' returned %d:\n%s" %
-                     (' '.join(cmd), e.returncode, e.output))
-
-        return complementary_pkgs.split()
-
-    def setUpLocal(self):
-        self.ptest_log = os.path.join(oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR",True), "ptest-%s.log" % oeRuntimeTest.tc.d.getVar('DATETIME', True))
-
-    @skipUnlessPassed('test_ssh')
-    def test_ptestrunner(self):
-        self.add_smart_channel()
-        (runnerstatus, result) = self.target.run('which ptest-runner', 0)
-        cond = oeRuntimeTest.hasPackage("ptest-runner") and oeRuntimeTest.hasFeature("ptest") and oeRuntimeTest.hasPackageMatch("-ptest") and (runnerstatus != 0)
-        if cond:
-            self.install_packages(self.install_complementary("*-ptest"))
-            self.install_packages(['ptest-runner'])
-
-        (runnerstatus, result) = self.target.run('/usr/bin/ptest-runner > /tmp/ptest.log 2>&1', 0)
-        #exit code is !=0 even if ptest-runner executes because some ptest tests fail.
-        self.assertTrue(runnerstatus != 127, msg="Cannot execute ptest-runner!")
-        self.target.copy_from('/tmp/ptest.log', self.ptest_log)
-        shutil.copyfile(self.ptest_log, "ptest.log")
-
-        result = self.parse_ptest("ptest.log")
-        log_results_to_location = "./results"
-        if os.path.exists(log_results_to_location):
-            shutil.rmtree(log_results_to_location)
-        os.makedirs(log_results_to_location)
-
-        result.log_as_files(log_results_to_location, test_status = ['pass','fail'])
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/_qemutiny.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/_qemutiny.py
deleted file mode 100644
index a3c29f3..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/_qemutiny.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import unittest
-from oeqa.oetest import oeRuntimeTest
-from oeqa.utils.qemutinyrunner import *
-
-class QemuTinyTest(oeRuntimeTest):
-
-    def test_boot_tiny(self):
-        (status, output) = self.target.run_serial('uname -a')
-        self.assertTrue("yocto-tiny" in output, msg="Cannot detect poky tiny boot!")
\ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildcvs.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildcvs.py
deleted file mode 100644
index fe6cbfb..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildcvs.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-from oeqa.utils.targetbuild import TargetBuildProject
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("tools-sdk"):
-        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
-
-class BuildCvsTest(oeRuntimeTest):
-
-    @classmethod
-    def setUpClass(self):
-        self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
-                        "http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/cvs-1.12.13.tar.bz2")
-        self.project.download_archive()
-
-    @testcase(205)
-    @skipUnlessPassed("test_ssh")
-    def test_cvs(self):
-        self.assertEqual(self.project.run_configure(), 0,
-                        msg="Running configure failed")
-
-        self.assertEqual(self.project.run_make(), 0,
-                        msg="Running make failed")
-
-        self.assertEqual(self.project.run_install(), 0,
-                        msg="Running make install failed")
-
-    @classmethod
-    def tearDownClass(self):
-        self.project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildgalculator.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildgalculator.py
deleted file mode 100644
index 28ba29e..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildgalculator.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-from oeqa.utils.targetbuild import TargetBuildProject
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("tools-sdk"):
-        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
-
-class GalculatorTest(oeRuntimeTest):
-    @skipUnlessPassed("test_ssh")
-    def test_galculator(self):
-        try:
-            project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
-                                      "http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2")
-            project.download_archive()
-
-            self.assertEqual(project.run_configure(), 0,
-                            msg="Running configure failed")
-
-            self.assertEqual(project.run_make(), 0,
-                            msg="Running make failed")
-        finally:
-            project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildiptables.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildiptables.py
deleted file mode 100644
index bc75d0a..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildiptables.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-from oeqa.utils.targetbuild import TargetBuildProject
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("tools-sdk"):
-        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
-
-class BuildIptablesTest(oeRuntimeTest):
-
-    @classmethod
-    def setUpClass(self):
-        self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
-                        "http://downloads.yoctoproject.org/mirror/sources/iptables-1.4.13.tar.bz2")
-        self.project.download_archive()
-
-    @testcase(206)
-    @skipUnlessPassed("test_ssh")
-    def test_iptables(self):
-        self.assertEqual(self.project.run_configure(), 0,
-                        msg="Running configure failed")
-
-        self.assertEqual(self.project.run_make(), 0,
-                        msg="Running make failed")
-
-        self.assertEqual(self.project.run_install(), 0,
-                        msg="Running make install failed")
-
-    @classmethod
-    def tearDownClass(self):
-        self.project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/case.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/case.py
new file mode 100644
index 0000000..c1485c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/case.py
@@ -0,0 +1,17 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.utils.package_manager import install_package, uninstall_package
+
+class OERuntimeTestCase(OETestCase):
+    # target instance set by OERuntimeTestLoader.
+    target = None
+
+    def _oeSetUp(self):
+        super(OERuntimeTestCase, self)._oeSetUp()
+        install_package(self)
+
+    def _oeTearDown(self):
+        super(OERuntimeTestCase, self)._oeTearDown()
+        uninstall_package(self)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/_ptest.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/_ptest.py
new file mode 100644
index 0000000..aaed9a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/_ptest.py
@@ -0,0 +1,103 @@
+import os
+import shutil
+import subprocess
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotDataVar, skipIfNotFeature
+from oeqa.runtime.decorator.package import OEHasPackage
+
+from oeqa.runtime.cases.dnf import DnfTest
+from oeqa.utils.logparser import *
+from oeqa.utils.httpserver import HTTPService
+
+class PtestRunnerTest(DnfTest):
+
+    @classmethod
+    def setUpClass(cls):
+        rpm_deploy = os.path.join(cls.tc.td['DEPLOY_DIR'], 'rpm')
+        cls.repo_server = HTTPService(rpm_deploy, cls.tc.target.server_ip)
+        cls.repo_server.start()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.repo_server.stop()
+
+    # a ptest log parser
+    def parse_ptest(self, logfile):
+        parser = Lparser(test_0_pass_regex="^PASS:(.+)",
+                         test_0_fail_regex="^FAIL:(.+)",
+                         section_0_begin_regex="^BEGIN: .*/(.+)/ptest",
+                         section_0_end_regex="^END: .*/(.+)/ptest")
+        parser.init()
+        result = Result()
+
+        with open(logfile, errors='replace') as f:
+            for line in f:
+                result_tuple = parser.parse_line(line)
+                if not result_tuple:
+                    continue
+                result_tuple = line_type, category, status, name = parser.parse_line(line)
+
+                if line_type == 'section' and status == 'begin':
+                    current_section = name
+                    continue
+
+                if line_type == 'section' and status == 'end':
+                    current_section = None
+                    continue
+
+                if line_type == 'test' and status == 'pass':
+                    result.store(current_section, name, status)
+                    continue
+
+                if line_type == 'test' and status == 'fail':
+                    result.store(current_section, name, status)
+                    continue
+
+        result.sort_tests()
+        return result
+
+    def _install_ptest_packages(self):
+        # Get ptest packages that can be installed in the image.
+        packages_dir = os.path.join(self.tc.td['DEPLOY_DIR'], 'rpm')
+        ptest_pkgs = [pkg[:pkg.find('-ptest')+6]
+                          for _, _, filenames in os.walk(packages_dir)
+                          for pkg in filenames
+                          if 'ptest' in pkg
+                          and pkg[:pkg.find('-ptest')] in self.tc.image_packages]
+
+        repo_url = 'http://%s:%s' % (self.target.server_ip,
+                                     self.repo_server.port)
+        dnf_options = ('--repofrompath=oe-ptest-repo,%s '
+                       '--nogpgcheck '
+                       'install -y' % repo_url)
+        self.dnf('%s %s ptest-runner' % (dnf_options, ' '.join(ptest_pkgs)))
+
+    @skipIfNotFeature('package-management',
+                      'Test requires package-management to be in DISTRO_FEATURES')
+    @skipIfNotFeature('ptest',
+                      'Test requires package-management to be in DISTRO_FEATURES')
+    @skipIfNotDataVar('IMAGE_PKGTYPE', 'rpm',
+                      'RPM is not the primary package manager')
+    @OEHasPackage(['dnf'])
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_ptestrunner(self):
+        self.ptest_log = os.path.join(self.tc.td['TEST_LOG_DIR'],
+                                      'ptest-%s.log' % self.tc.td['DATETIME'])
+        self._install_ptest_packages()
+
+        (runnerstatus, result) = self.target.run('/usr/bin/ptest-runner > /tmp/ptest.log 2>&1', 0)
+        #exit code is !=0 even if ptest-runner executes because some ptest tests fail.
+        self.assertTrue(runnerstatus != 127, msg="Cannot execute ptest-runner!")
+        self.target.copyFrom('/tmp/ptest.log', self.ptest_log)
+        shutil.copyfile(self.ptest_log, "ptest.log")
+
+        result = self.parse_ptest("ptest.log")
+        log_results_to_location = "./results"
+        if os.path.exists(log_results_to_location):
+            shutil.rmtree(log_results_to_location)
+        os.makedirs(log_results_to_location)
+
+        result.log_as_files(log_results_to_location, test_status = ['pass','fail'])
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/_qemutiny.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/_qemutiny.py
new file mode 100644
index 0000000..7b5b481
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/_qemutiny.py
@@ -0,0 +1,8 @@
+from oeqa.runtime.case import OERuntimeTestCase
+
+class QemuTinyTest(OERuntimeTestCase):
+
+    def test_boot_tiny(self):
+        status, output = self.target.run_serial('uname -a')
+        msg = "Cannot detect poky tiny boot!"
+        self.assertTrue("yocto-tiny" in output, msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/buildcpio.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/buildcpio.py
new file mode 100644
index 0000000..59edc9c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/buildcpio.py
@@ -0,0 +1,30 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+from oeqa.runtime.utils.targetbuildproject import TargetBuildProject
+
+class BuildCpioTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        uri = 'https://ftp.gnu.org/gnu/cpio'
+        uri = '%s/cpio-2.12.tar.bz2' % uri
+        cls.project = TargetBuildProject(cls.tc.target,
+                                         uri,
+                                         dl_dir = cls.tc.td['DL_DIR'])
+        cls.project.download_archive()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.project.clean()
+
+    @OETestID(205)
+    @skipIfNotFeature('tools-sdk',
+                      'Test requires tools-sdk to be in IMAGE_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_cpio(self):
+        self.project.run_configure()
+        self.project.run_make()
+        self.project.run_install()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/buildgalculator.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/buildgalculator.py
new file mode 100644
index 0000000..7c9d4a3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/buildgalculator.py
@@ -0,0 +1,28 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+from oeqa.runtime.utils.targetbuildproject import TargetBuildProject
+
+class GalculatorTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        uri = 'http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2'
+        cls.project = TargetBuildProject(cls.tc.target,
+                                         uri,
+                                         dl_dir = cls.tc.td['DL_DIR'])
+        cls.project.download_archive()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.project.clean()
+
+    @OETestID(1526)
+    @skipIfNotFeature('tools-sdk',
+                      'Test requires tools-sdk to be in IMAGE_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_galculator(self):
+        self.project.run_configure()
+        self.project.run_make()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/buildlzip.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/buildlzip.py
new file mode 100644
index 0000000..ca3fead
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/buildlzip.py
@@ -0,0 +1,34 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+from oeqa.runtime.utils.targetbuildproject import TargetBuildProject
+
+class BuildLzipTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        uri = 'http://downloads.yoctoproject.org/mirror/sources'
+        uri = '%s/lzip-1.19.tar.gz' % uri
+        cls.project = TargetBuildProject(cls.tc.target,
+                                         uri,
+                                         dl_dir = cls.tc.td['DL_DIR'])
+        cls.project.download_archive()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.project.clean()
+
+    @OETestID(206)
+    @skipIfNotFeature('tools-sdk',
+                      'Test requires tools-sdk to be in IMAGE_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_lzip(self):
+        self.project.run_configure()
+        self.project.run_make()
+        self.project.run_install()
+
+    @classmethod
+    def tearDownClass(self):
+        self.project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/connman.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/connman.py
new file mode 100644
index 0000000..12456b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/connman.py
@@ -0,0 +1,30 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class ConnmanTest(OERuntimeTestCase):
+
+    def service_status(self, service):
+        if 'systemd' in self.tc.td['DISTRO_FEATURES']:
+            (_, output) = self.target.run('systemctl status -l %s' % service)
+            return output
+        else:
+            return "Unable to get status or logs for %s" % service
+
+    @OETestID(961)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    @OEHasPackage(["connman"])
+    def test_connmand_help(self):
+        (status, output) = self.target.run('/usr/sbin/connmand --help')
+        msg = 'Failed to get connman help. Output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(221)
+    @OETestDepends(['connman.ConnmanTest.test_connmand_help'])
+    def test_connmand_running(self):
+        cmd = '%s | grep [c]onnmand' % self.tc.target_cmds['ps']
+        (status, output) = self.target.run(cmd)
+        if status != 0:
+            self.logger.info(self.service_status("connman"))
+            self.fail("No connmand process running")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/date.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/date.py
new file mode 100644
index 0000000..ece7338
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/date.py
@@ -0,0 +1,38 @@
+import re
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+
+class DateTest(OERuntimeTestCase):
+
+    def setUp(self):
+        if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
+            self.logger.debug('Stopping systemd-timesyncd daemon')
+            self.target.run('systemctl stop systemd-timesyncd')
+
+    def tearDown(self):
+        if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
+            self.logger.debug('Starting systemd-timesyncd daemon')
+            self.target.run('systemctl start systemd-timesyncd')
+
+    @OETestID(211)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_date(self):
+        (status, output) = self.target.run('date +"%Y-%m-%d %T"')
+        msg = 'Failed to get initial date, output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+        oldDate = output
+
+        sampleDate = '"2016-08-09 10:00:00"'
+        (status, output) = self.target.run("date -s %s" % sampleDate)
+        self.assertEqual(status, 0, msg='Date set failed, output: %s' % output)
+
+        (status, output) = self.target.run("date -R")
+        p = re.match('Tue, 09 Aug 2016 10:00:.. \+0000', output)
+        msg = 'The date was not set correctly, output: %s' % output
+        self.assertTrue(p, msg=msg)
+
+        (status, output) = self.target.run('date -s "%s"' % oldDate)
+        msg = 'Failed to reset date, output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/df.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/df.py
new file mode 100644
index 0000000..aecc32d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/df.py
@@ -0,0 +1,13 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+
+class DfTest(OERuntimeTestCase):
+
+    @OETestID(234)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_df(self):
+        cmd = "df / | sed -n '2p' | awk '{print $4}'"
+        (status,output) = self.target.run(cmd)
+        msg = 'Not enough space on image. Current size is %s' % output
+        self.assertTrue(int(output)>5120, msg=msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/dnf.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/dnf.py
new file mode 100644
index 0000000..2f87296
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/dnf.py
@@ -0,0 +1,123 @@
+import os
+import re
+import subprocess
+from oeqa.utils.httpserver import HTTPService
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotDataVar, skipIfNotFeature
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class DnfTest(OERuntimeTestCase):
+
+    def dnf(self, command, expected = 0):
+        command = 'dnf %s' % command
+        status, output = self.target.run(command, 1500)
+        message = os.linesep.join([command, output])
+        self.assertEqual(status, expected, message)
+        return output
+
+class DnfBasicTest(DnfTest):
+
+    @skipIfNotFeature('package-management',
+                      'Test requires package-management to be in IMAGE_FEATURES')
+    @skipIfNotDataVar('IMAGE_PKGTYPE', 'rpm',
+                      'RPM is not the primary package manager')
+    @OEHasPackage(['dnf'])
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    @OETestID(1735)
+    def test_dnf_help(self):
+        self.dnf('--help')
+
+    @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+    @OETestID(1739)
+    def test_dnf_version(self):
+        self.dnf('--version')
+
+    @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+    @OETestID(1737)
+    def test_dnf_info(self):
+        self.dnf('info dnf')
+
+    @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+    @OETestID(1738)
+    def test_dnf_search(self):
+        self.dnf('search dnf')
+
+    @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+    @OETestID(1736)
+    def test_dnf_history(self):
+        self.dnf('history')
+
+class DnfRepoTest(DnfTest):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.repo_server = HTTPService(os.path.join(cls.tc.td['WORKDIR'], 'oe-testimage-repo'),
+                                      cls.tc.target.server_ip)
+        cls.repo_server.start()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.repo_server.stop()
+
+    def dnf_with_repo(self, command):
+        pkgarchs = os.listdir(os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo'))
+        deploy_url = 'http://%s:%s/' %(self.target.server_ip, self.repo_server.port)
+        cmdlinerepoopts = ["--repofrompath=oe-testimage-repo-%s,%s%s" %(arch, deploy_url, arch) for arch in pkgarchs]
+
+        self.dnf(" ".join(cmdlinerepoopts) + " --nogpgcheck " + command)
+
+    @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+    @OETestID(1744)
+    def test_dnf_makecache(self):
+        self.dnf_with_repo('makecache')
+
+
+# Does not work when repo is specified on the command line
+#    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+#    def test_dnf_repolist(self):
+#        self.dnf_with_repo('repolist')
+
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1746)
+    def test_dnf_repoinfo(self):
+        self.dnf_with_repo('repoinfo')
+
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1740)
+    def test_dnf_install(self):
+        self.dnf_with_repo('install -y run-postinsts-dev')
+
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_install'])
+    @OETestID(1741)
+    def test_dnf_install_dependency(self):
+        self.dnf_with_repo('remove -y run-postinsts')
+        self.dnf_with_repo('install -y run-postinsts-dev')
+
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_dependency'])
+    @OETestID(1742)
+    def test_dnf_install_from_disk(self):
+        self.dnf_with_repo('remove -y run-postinsts-dev')
+        self.dnf_with_repo('install -y --downloadonly run-postinsts-dev')
+        status, output = self.target.run('find /var/cache/dnf -name run-postinsts-dev*rpm', 1500)
+        self.assertEqual(status, 0, output)
+        self.dnf_with_repo('install -y %s' % output)
+
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_from_disk'])
+    @OETestID(1743)
+    def test_dnf_install_from_http(self):
+        output = subprocess.check_output('%s %s -name run-postinsts-dev*' % (bb.utils.which(os.getenv('PATH'), "find"),
+                                                                           os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo')), shell=True).decode("utf-8")
+        rpm_path = output.split("/")[-2] + "/" + output.split("/")[-1]
+        url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, rpm_path)
+        self.dnf_with_repo('remove -y run-postinsts-dev')
+        self.dnf_with_repo('install -y %s' % url)
+
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_install'])
+    @OETestID(1745)
+    def test_dnf_reinstall(self):
+        self.dnf_with_repo('reinstall -y run-postinsts-dev')
+
+
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/gcc.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/gcc.py
new file mode 100644
index 0000000..9110831
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/gcc.py
@@ -0,0 +1,73 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class GccCompileTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        dst = '/tmp/'
+        src = os.path.join(cls.tc.files_dir, 'test.c')
+        cls.tc.target.copyTo(src, dst)
+
+        src = os.path.join(cls.tc.runtime_files_dir, 'testmakefile')
+        cls.tc.target.copyTo(src, dst)
+
+        src = os.path.join(cls.tc.files_dir, 'test.cpp')
+        cls.tc.target.copyTo(src, dst)
+
+    @classmethod
+    def tearDownClass(cls):
+        files = '/tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile'
+        cls.tc.target.run('rm %s' % files)
+
+    @OETestID(203)
+    @skipIfNotFeature('tools-sdk',
+                      'Test requires tools-sdk to be in IMAGE_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_gcc_compile(self):
+        status, output = self.target.run('gcc /tmp/test.c -o /tmp/test -lm')
+        msg = 'gcc compile failed, output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+        status, output = self.target.run('/tmp/test')
+        msg = 'running compiled file failed, output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(200)
+    @skipIfNotFeature('tools-sdk',
+                      'Test requires tools-sdk to be in IMAGE_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_gpp_compile(self):
+        status, output = self.target.run('g++ /tmp/test.c -o /tmp/test -lm')
+        msg = 'g++ compile failed, output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+        status, output = self.target.run('/tmp/test')
+        msg = 'running compiled file failed, output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(1142)
+    @skipIfNotFeature('tools-sdk',
+                      'Test requires tools-sdk to be in IMAGE_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_gpp2_compile(self):
+        status, output = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm')
+        msg = 'g++ compile failed, output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+        status, output = self.target.run('/tmp/test')
+        msg = 'running compiled file failed, output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(204)
+    @skipIfNotFeature('tools-sdk',
+                      'Test requires tools-sdk to be in IMAGE_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_make(self):
+        status, output = self.target.run('cd /tmp; make -f testmakefile')
+        msg = 'running make failed, output %s' % output
+        self.assertEqual(status, 0, msg=msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/kernelmodule.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/kernelmodule.py
new file mode 100644
index 0000000..11ad7b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/kernelmodule.py
@@ -0,0 +1,40 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class KernelModuleTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        src = os.path.join(cls.tc.runtime_files_dir, 'hellomod.c')
+        dst = '/tmp/hellomod.c'
+        cls.tc.target.copyTo(src, dst)
+
+        src = os.path.join(cls.tc.runtime_files_dir, 'hellomod_makefile')
+        dst = '/tmp/Makefile'
+        cls.tc.target.copyTo(src, dst)
+
+    @classmethod
+    def tearDownClass(cls):
+        files = '/tmp/Makefile /tmp/hellomod.c'
+        cls.tc.target.run('rm %s' % files)
+
+    @OETestID(1541)
+    @skipIfNotFeature('tools-sdk',
+                      'Test requires tools-sdk to be in IMAGE_FEATURES')
+    @OETestDepends(['gcc.GccCompileTest.test_gcc_compile'])
+    def test_kernel_module(self):
+        cmds = [
+            'cd /usr/src/kernel && make scripts',
+            'cd /tmp && make',
+            'cd /tmp && insmod hellomod.ko',
+            'lsmod | grep hellomod',
+            'dmesg | grep Hello',
+            'rmmod hellomod', 'dmesg | grep "Cleaning up hellomod"'
+            ]
+        for cmd in cmds:
+            status, output = self.target.run(cmd, 900)
+            self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/ldd.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/ldd.py
new file mode 100644
index 0000000..c6d92fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/ldd.py
@@ -0,0 +1,25 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class LddTest(OERuntimeTestCase):
+
+    @OETestID(962)
+    @skipIfNotFeature('tools-sdk',
+                      'Test requires tools-sdk to be in IMAGE_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_ldd_exists(self):
+        status, output = self.target.run('which ldd')
+        msg = 'ldd does not exist in PATH: which ldd: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(239)
+    @OETestDepends(['ldd.LddTest.test_ldd_exists'])
+    def test_ldd_rtldlist_check(self):
+        cmd = ('for i in $(which ldd | xargs cat | grep "^RTLDLIST"| '
+              'cut -d\'=\' -f2|tr -d \'"\'); '
+              'do test -f $i && echo $i && break; done')
+        status, output = self.target.run(cmd)
+        msg = "ldd path not correct or RTLDLIST files don't exist."
+        self.assertEqual(status, 0, msg=msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/logrotate.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/logrotate.py
new file mode 100644
index 0000000..992fef2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/logrotate.py
@@ -0,0 +1,42 @@
+# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=289 testcase
+# Note that the image under test must have logrotate installed
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class LogrotateTest(OERuntimeTestCase):
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.tc.target.run('rm -rf $HOME/logrotate_dir')
+
+    @OETestID(1544)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    @OEHasPackage(['logrotate'])
+    def test_1_logrotate_setup(self):
+        status, output = self.target.run('mkdir $HOME/logrotate_dir')
+        msg = 'Could not create logrotate_dir. Output: %s' % output
+        self.assertEqual(status, 0, msg = msg)
+
+        cmd = ('sed -i "s#wtmp {#wtmp {\\n    olddir $HOME/logrotate_dir#"'
+               ' /etc/logrotate.conf')
+        status, output = self.target.run(cmd)
+        msg = ('Could not write to logrotate.conf file. Status and output: '
+               ' %s and %s' % (status, output))
+        self.assertEqual(status, 0, msg = msg)
+
+    @OETestID(1542)
+    @OETestDepends(['logrotate.LogrotateTest.test_1_logrotate_setup'])
+    def test_2_logrotate(self):
+        status, output = self.target.run('logrotate -f /etc/logrotate.conf')
+        msg = ('logrotate service could not be reloaded. Status and output: '
+                '%s and %s' % (status, output))
+        self.assertEqual(status, 0, msg = msg)
+
+        _, output = self.target.run('ls -la $HOME/logrotate_dir/ | wc -l')
+        msg = ('new logfile could not be created. List of files within log '
+               'directory: %s' % (
+                self.target.run('ls -la $HOME/logrotate_dir')[1]))
+        self.assertTrue(int(output)>=3, msg = msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/multilib.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/multilib.py
new file mode 100644
index 0000000..8c167f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/multilib.py
@@ -0,0 +1,41 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotInDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class MultilibTest(OERuntimeTestCase):
+
+    def archtest(self, binary, arch):
+        """
+        Check that ``binary`` has the ELF class ``arch`` (e.g. ELF32/ELF64).
+        """
+
+        status, output = self.target.run('readelf -h %s' % binary)
+        self.assertEqual(status, 0, 'Failed to readelf %s' % binary)
+
+        l = [l.split()[1] for l in output.split('\n') if "Class:" in l]
+        if l:
+            theclass = l[0]
+        else:
+            self.fail('Cannot parse readelf. Output:\n%s' % output)
+
+        msg = "%s isn't %s (is %s)" % (binary, arch, theclass)
+        self.assertEqual(theclass, arch, msg=msg)
+
+    @OETestID(1593)
+    @skipIfNotInDataVar('MULTILIBS', 'multilib:lib32',
+                        "This isn't a multilib:lib32 image")
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_check_multilib_libc(self):
+        """
+        Check that a multilib image has both 32-bit and 64-bit libc in.
+        """
+        self.archtest("/lib/libc.so.6", "ELF32")
+        self.archtest("/lib64/libc.so.6", "ELF64")
+
+    @OETestID(279)
+    @OETestDepends(['multilib.MultilibTest.test_check_multilib_libc'])
+    @OEHasPackage(['lib32-connman'])
+    def test_file_connman(self):
+        self.archtest("/usr/sbin/connmand", "ELF32")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/oe_syslog.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/oe_syslog.py
new file mode 100644
index 0000000..005b697
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/oe_syslog.py
@@ -0,0 +1,66 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class SyslogTest(OERuntimeTestCase):
+
+    @OETestID(201)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    @OEHasPackage(["busybox-syslog", "sysklogd"])
+    def test_syslog_running(self):
+        cmd = '%s  | grep -i [s]yslogd' % self.tc.target_cmds['ps']
+        status, output = self.target.run(cmd)
+        msg = "No syslogd process; ps output: %s" % output
+        self.assertEqual(status, 0, msg=msg)
+
+class SyslogTestConfig(OERuntimeTestCase):
+
+    @OETestID(1149)
+    @OETestDepends(['oe_syslog.SyslogTest.test_syslog_running'])
+    def test_syslog_logger(self):
+        status, output = self.target.run('logger foobar')
+        msg = "Can't log into syslog. Output: %s " % output
+        self.assertEqual(status, 0, msg=msg)
+
+        status, output = self.target.run('grep foobar /var/log/messages')
+        if status != 0:
+            if self.tc.td.get("VIRTUAL-RUNTIME_init_manager") == "systemd":
+                status, output = self.target.run('journalctl -o cat | grep foobar')
+            else:
+                status, output = self.target.run('logread | grep foobar')
+        msg = ('Test log string not found in /var/log/messages or logread.'
+               ' Output: %s ' % output)
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(1150)
+    @OETestDepends(['oe_syslog.SyslogTest.test_syslog_running'])
+    def test_syslog_restart(self):
+        if "systemd" != self.tc.td.get("VIRTUAL-RUNTIME_init_manager", ""):
+            (_, _) = self.target.run('/etc/init.d/syslog restart')
+        else:
+            (_, _) = self.target.run('systemctl restart syslog.service')
+
+
+    @OETestID(202)
+    @OETestDepends(['oe_syslog.SyslogTestConfig.test_syslog_logger'])
+    @OEHasPackage(["!sysklogd", "busybox"])
+    @skipIfDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd',
+                   'Not appropiate for systemd image')
+    def test_syslog_startup_config(self):
+        cmd = 'echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf'
+        self.target.run(cmd)
+        status, output = self.target.run('/etc/init.d/syslog restart')
+        msg = ('Could not restart syslog service. Status and output:'
+               ' %s and %s' % (status,output))
+        self.assertEqual(status, 0, msg)
+
+        cmd = 'logger foobar && grep foobar /var/log/test'
+        status,output = self.target.run(cmd)
+        msg = 'Test log string not found. Output: %s ' % output
+        self.assertEqual(status, 0, msg=msg)
+
+        cmd = "sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf"
+        self.target.run(cmd)
+        self.target.run('/etc/init.d/syslog restart')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/pam.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/pam.py
new file mode 100644
index 0000000..3654cdc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/pam.py
@@ -0,0 +1,33 @@
+# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=287 testcase
+# Note that the image under test must have "pam" in DISTRO_FEATURES
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class PamBasicTest(OERuntimeTestCase):
+
+    @OETestID(1543)
+    @skipIfNotFeature('pam', 'Test requires pam to be in DISTRO_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_pam(self):
+        status, output = self.target.run('login --help')
+        msg = ('login command does not work as expected. '
+               'Status and output:%s and %s' % (status, output))
+        self.assertEqual(status, 1, msg = msg)
+
+        status, output = self.target.run('passwd --help')
+        msg = ('passwd command does not work as expected. '
+               'Status and output:%s and %s' % (status, output))
+        self.assertEqual(status, 0, msg = msg)
+
+        status, output = self.target.run('su --help')
+        msg = ('su command does not work as expected. '
+               'Status and output:%s and %s' % (status, output))
+        self.assertEqual(status, 0, msg = msg)
+
+        status, output = self.target.run('useradd --help')
+        msg = ('useradd command does not work as expected. '
+               'Status and output:%s and %s' % (status, output))
+        self.assertEqual(status, 0, msg = msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/parselogs.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/parselogs.py
new file mode 100644
index 0000000..6e92946
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/parselogs.py
@@ -0,0 +1,359 @@
+import os
+
+from subprocess import check_output
+from shutil import rmtree
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+
+#in the future these lists could be moved outside of module
+errors = ["error", "cannot", "can\'t", "failed"]
+
+common_errors = [
+    "(WW) warning, (EE) error, (NI) not implemented, (??) unknown.",
+    "dma timeout",
+    "can\'t add hid device:",
+    "usbhid: probe of ",
+    "_OSC failed (AE_ERROR)",
+    "_OSC failed (AE_SUPPORT)",
+    "AE_ALREADY_EXISTS",
+    "ACPI _OSC request failed (AE_SUPPORT)",
+    "can\'t disable ASPM",
+    "Failed to load module \"vesa\"",
+    "Failed to load module vesa",
+    "Failed to load module \"modesetting\"",
+    "Failed to load module modesetting",
+    "Failed to load module \"glx\"",
+    "Failed to load module \"fbdev\"",
+    "Failed to load module fbdev",
+    "Failed to load module glx",
+    "[drm] Cannot find any crtc or sizes - going 1024x768",
+    "_OSC failed (AE_NOT_FOUND); disabling ASPM",
+    "Open ACPI failed (/var/run/acpid.socket) (No such file or directory)",
+    "NX (Execute Disable) protection cannot be enabled: non-PAE kernel!",
+    "hd.: possibly failed opcode",
+    'NETLINK INITIALIZATION FAILED',
+    'kernel: Cannot find map file',
+    'omap_hwmod: debugss: _wait_target_disable failed',
+    'VGA arbiter: cannot open kernel arbiter, no multi-card support',
+    'Failed to find URL:http://ipv4.connman.net/online/status.html',
+    'Online check failed for',
+    'netlink init failed',
+    'Fast TSC calibration',
+    "BAR 0-9",
+    "Failed to load module \"ati\"",
+    "controller can't do DEVSLP, turning off",
+    "stmmac_dvr_probe: warning: cannot get CSR clock",
+    "error: couldn\'t mount because of unsupported optional features",
+    "GPT: Use GNU Parted to correct GPT errors",
+    "Cannot set xattr user.Librepo.DownloadInProgress",
+    ]
+
+video_related = [
+    "uvesafb",
+]
+
+x86_common = [
+    '[drm:psb_do_init] *ERROR* Debug is',
+    'wrong ELF class',
+    'Could not enable PowerButton event',
+    'probe of LNXPWRBN:00 failed with error -22',
+    'pmd_set_huge: Cannot satisfy',
+    'failed to setup card detect gpio',
+    'amd_nb: Cannot enumerate AMD northbridges',
+    'failed to retrieve link info, disabling eDP',
+    'Direct firmware load for iwlwifi',
+] + common_errors
+
+qemux86_common = [
+    'wrong ELF class',
+    "fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.",
+    "can't claim BAR ",
+    'amd_nb: Cannot enumerate AMD northbridges',
+    'uvesafb: 5000 ms task timeout, infinitely waiting',
+    'tsc: HPET/PMTIMER calibration failed',
+] + common_errors
+
+ignore_errors = {
+    'default' : common_errors,
+    'qemux86' : [
+        'Failed to access perfctr msr (MSR',
+        'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
+        ] + qemux86_common,
+    'qemux86-64' : qemux86_common,
+    'qemumips' : [
+        'Failed to load module "glx"',
+        'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
+        ] + common_errors,
+    'qemumips64' : [
+        'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
+         ] + common_errors,
+    'qemuppc' : [
+        'PCI 0000:00 Cannot reserve Legacy IO [io  0x0000-0x0fff]',
+        'host side 80-wire cable detection failed, limiting max speed',
+        'mode "640x480" test failed',
+        'Failed to load module "glx"',
+        'can\'t handle BAR above 4GB',
+        'Cannot reserve Legacy IO',
+        ] + common_errors,
+    'qemuarm' : [
+        'mmci-pl18x: probe of fpga:05 failed with error -22',
+        'mmci-pl18x: probe of fpga:0b failed with error -22',
+        'Failed to load module "glx"',
+        'OF: amba_device_add() failed (-19) for /amba/smc@10100000',
+        'OF: amba_device_add() failed (-19) for /amba/mpmc@10110000',
+        'OF: amba_device_add() failed (-19) for /amba/sctl@101e0000',
+        'OF: amba_device_add() failed (-19) for /amba/watchdog@101e1000',
+        'OF: amba_device_add() failed (-19) for /amba/sci@101f0000',
+        'OF: amba_device_add() failed (-19) for /amba/ssp@101f4000',
+        'OF: amba_device_add() failed (-19) for /amba/fpga/sci@a000',
+        'Failed to initialize \'/amba/timer@101e3000\': -22',
+        'jitterentropy: Initialization failed with host not compliant with requirements: 2',
+        ] + common_errors,
+    'qemuarm64' : [
+        'Fatal server error:',
+        '(EE) Server terminated with error (1). Closing log file.',
+        'dmi: Firmware registration failed.',
+        'irq: type mismatch, failed to map hwirq-27 for /intc',
+        ] + common_errors,
+    'emenlow' : [
+        '[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness',
+        '(EE) Failed to load module "psb"',
+        '(EE) Failed to load module psb',
+        '(EE) Failed to load module "psbdrv"',
+        '(EE) Failed to load module psbdrv',
+        '(EE) open /dev/fb0: No such file or directory',
+        '(EE) AIGLX: reverting to software rendering',
+        ] + x86_common,
+    'intel-core2-32' : [
+        'ACPI: No _BQC method, cannot determine initial brightness',
+        '[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness',
+        '(EE) Failed to load module "psb"',
+        '(EE) Failed to load module psb',
+        '(EE) Failed to load module "psbdrv"',
+        '(EE) Failed to load module psbdrv',
+        '(EE) open /dev/fb0: No such file or directory',
+        '(EE) AIGLX: reverting to software rendering',
+        'dmi: Firmware registration failed.',
+        'ioremap error for 0x78',
+        ] + x86_common,
+    'intel-corei7-64' : [
+        'can\'t set Max Payload Size to 256',
+        'intel_punit_ipc: can\'t request region for resource',
+        '[drm] parse error at position 4 in video mode \'efifb\'',
+        'ACPI Error: Could not enable RealTimeClock event',
+        'ACPI Warning: Could not enable fixed event - RealTimeClock',
+        'hci_intel INT33E1:00: Unable to retrieve gpio',
+        'hci_intel: probe of INT33E1:00 failed',
+        'can\'t derive routing for PCI INT A',
+        'failed to read out thermal zone',
+        'Bluetooth: hci0: Setting Intel event mask failed',
+        'ttyS2 - failed to request DMA',
+        ] + x86_common,
+    'crownbay' : x86_common,
+    'genericx86' : x86_common,
+    'genericx86-64' : [
+        'Direct firmware load for i915',
+        'Failed to load firmware i915',
+        'Failed to fetch GuC',
+        'Failed to initialize GuC',
+        'Failed to load DMC firmware',
+        'The driver is built-in, so to load the firmware you need to',
+        ] + x86_common,
+    'edgerouter' : [
+        'Fatal server error:',
+        ] + common_errors,
+    'jasperforest' : [
+        'Activated service \'org.bluez\' failed:',
+        'Unable to find NFC netlink family',
+        ] + common_errors,
+}
+
+log_locations = ["/var/log/","/var/log/dmesg", "/tmp/dmesg_output.log"]
+
+class ParseLogsTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.errors = errors
+
+        # When systemd is enabled we need to notice errors on
+        # circular dependencies in units.
+        if 'systemd' in cls.td.get('DISTRO_FEATURES', ''):
+            cls.errors.extend([
+                'Found ordering cycle on',
+                'Breaking ordering cycle by deleting job',
+                'deleted to break ordering cycle',
+                'Ordering cycle found, skipping',
+                ])
+
+        cls.ignore_errors = ignore_errors
+        cls.log_locations = log_locations
+        cls.msg = ''
+        is_lsb, _ = cls.tc.target.run("which LSB_Test.sh")
+        if is_lsb == 0:
+            for machine in cls.ignore_errors:
+                cls.ignore_errors[machine] = cls.ignore_errors[machine] \
+                                             + video_related
+
+    def getMachine(self):
+        return self.td.get('MACHINE', '')
+
+    def getWorkdir(self):
+        return self.td.get('WORKDIR', '')
+
+    # Get some information on the CPU of the machine to display at the
+    # beginning of the output. This info might be useful in some cases.
+    def getHardwareInfo(self):
+        hwi = ""
+        cmd = ('cat /proc/cpuinfo | grep "model name" | head -n1 | '
+               " awk 'BEGIN{FS=\":\"}{print $2}'")
+        _, cpu_name = self.target.run(cmd)
+
+        cmd = ('cat /proc/cpuinfo | grep "cpu cores" | head -n1 | '
+               "awk {'print $4'}")
+        _, cpu_physical_cores = self.target.run(cmd)
+
+        cmd = 'cat /proc/cpuinfo | grep "processor" | wc -l'
+        _, cpu_logical_cores = self.target.run(cmd)
+
+        _, cpu_arch = self.target.run('uname -m')
+
+        hwi += 'Machine information: \n'
+        hwi += '*******************************\n'
+        hwi += 'Machine name: ' + self.getMachine() + '\n'
+        hwi += 'CPU: ' + str(cpu_name) + '\n'
+        hwi += 'Arch: ' + str(cpu_arch)+ '\n'
+        hwi += 'Physical cores: ' + str(cpu_physical_cores) + '\n'
+        hwi += 'Logical cores: ' + str(cpu_logical_cores) + '\n'
+        hwi += '*******************************\n'
+
+        return hwi
+
+    # Go through the log locations provided and if it's a folder
+    # create a list with all the .log files in it, if it's a file
+    # just add it to that list.
+    def getLogList(self, log_locations):
+        logs = []
+        for location in log_locations:
+            status, _ = self.target.run('test -f ' + str(location))
+            if status == 0:
+                logs.append(str(location))
+            else:
+                status, _ = self.target.run('test -d ' + str(location))
+                if status == 0:
+                    cmd = 'find ' + str(location) + '/*.log -maxdepth 1 -type f'
+                    status, output = self.target.run(cmd)
+                    if status == 0:
+                        output = output.splitlines()
+                        for logfile in output:
+                            logs.append(os.path.join(location, str(logfile)))
+        return logs
+
+    # Copy the log files to be parsed locally
+    def transfer_logs(self, log_list):
+        workdir = self.getWorkdir()
+        self.target_logs = workdir + '/' + 'target_logs'
+        target_logs = self.target_logs
+        if os.path.exists(target_logs):
+            rmtree(self.target_logs)
+        os.makedirs(target_logs)
+        for f in log_list:
+            self.target.copyFrom(str(f), target_logs)
+
+    # Get the local list of logs
+    def get_local_log_list(self, log_locations):
+        self.transfer_logs(self.getLogList(log_locations))
+        list_dir = os.listdir(self.target_logs)
+        dir_files = [os.path.join(self.target_logs, f) for f in list_dir]
+        logs = [f for f in dir_files if os.path.isfile(f)]
+        return logs
+
+    # Build the grep command to be used with filters and exclusions
+    def build_grepcmd(self, errors, ignore_errors, log):
+        grepcmd = 'grep '
+        grepcmd += '-Ei "'
+        for error in errors:
+            grepcmd += error + '|'
+        grepcmd = grepcmd[:-1]
+        grepcmd += '" ' + str(log) + " | grep -Eiv \'"
+
+        try:
+            errorlist = ignore_errors[self.getMachine()]
+        except KeyError:
+            self.msg += 'No ignore list found for this machine, using default\n'
+            errorlist = ignore_errors['default']
+
+        for ignore_error in errorlist:
+            ignore_error = ignore_error.replace('(', '\(')
+            ignore_error = ignore_error.replace(')', '\)')
+            ignore_error = ignore_error.replace("'", '.')
+            ignore_error = ignore_error.replace('?', '\?')
+            ignore_error = ignore_error.replace('[', '\[')
+            ignore_error = ignore_error.replace(']', '\]')
+            ignore_error = ignore_error.replace('*', '\*')
+            ignore_error = ignore_error.replace('0-9', '[0-9]')
+            grepcmd += ignore_error + '|'
+        grepcmd = grepcmd[:-1]
+        grepcmd += "\'"
+
+        return grepcmd
+
+    # Grep only the errors so that their context could be collected.
+    # Default context is 10 lines before and after the error itself
+    def parse_logs(self, errors, ignore_errors, logs,
+                   lines_before = 10, lines_after = 10):
+        results = {}
+        rez = []
+        grep_output = ''
+
+        for log in logs:
+            result = None
+            thegrep = self.build_grepcmd(errors, ignore_errors, log)
+
+            try:
+                result = check_output(thegrep, shell=True).decode('utf-8')
+            except:
+                pass
+
+            if result is not None:
+                results[log.replace('target_logs/','')] = {}
+                rez = result.splitlines()
+
+                for xrez in rez:
+                    try:
+                        cmd = ['grep', '-F', xrez, '-B', str(lines_before)]
+                        cmd += ['-A', str(lines_after), log]
+                        grep_output = check_output(cmd).decode('utf-8')
+                    except:
+                        pass
+                    results[log.replace('target_logs/','')][xrez]=grep_output
+
+        return results
+
+    # Get the output of dmesg and write it in a file.
+    # This file is added to log_locations.
+    def write_dmesg(self):
+        (status, dmesg) = self.target.run('dmesg > /tmp/dmesg_output.log')
+
+    @OETestID(1059)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_parselogs(self):
+        self.write_dmesg()
+        log_list = self.get_local_log_list(self.log_locations)
+        result = self.parse_logs(self.errors, self.ignore_errors, log_list)
+        print(self.getHardwareInfo())
+        errcount = 0
+        for log in result:
+            self.msg += 'Log: ' + log + '\n'
+            self.msg += '-----------------------\n'
+            for error in result[log]:
+                errcount += 1
+                self.msg += 'Central error: ' + str(error) + '\n'
+                self.msg +=  '***********************\n'
+                self.msg +=  result[str(log)][str(error)] + '\n'
+                self.msg +=  '***********************\n'
+        self.msg += '%s errors found in logs.' % errcount
+        self.assertEqual(errcount, 0, msg=self.msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/perl.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/perl.py
new file mode 100644
index 0000000..d0b7e8e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/perl.py
@@ -0,0 +1,37 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class PerlTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        src = os.path.join(cls.tc.files_dir, 'test.pl')
+        dst = '/tmp/test.pl'
+        cls.tc.target.copyTo(src, dst)
+
+    @classmethod
+    def tearDownClass(cls):
+        dst = '/tmp/test.pl'
+        cls.tc.target.run('rm %s' % dst)
+
+    @OETestID(1141)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    @OEHasPackage(['perl'])
+    def test_perl_exists(self):
+        status, output = self.target.run('which perl')
+        msg = 'Perl binary not in PATH or not on target.'
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(208)
+    @OETestDepends(['perl.PerlTest.test_perl_exists'])
+    def test_perl_works(self):
+        status, output = self.target.run('perl /tmp/test.pl')
+        msg = 'Exit status was not 0. Output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+        msg = 'Incorrect output: %s' % output
+        self.assertEqual(output, "the value of a is 0.01", msg=msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/ping.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/ping.py
new file mode 100644
index 0000000..02f580a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/ping.py
@@ -0,0 +1,24 @@
+from subprocess import Popen, PIPE
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.oetimeout import OETimeout
+
+class PingTest(OERuntimeTestCase):
+
+    @OETimeout(30)
+    @OETestID(964)
+    def test_ping(self):
+        output = ''
+        count = 0
+        while count < 5:
+            cmd = 'ping -c 1 %s' % self.target.ip
+            proc = Popen(cmd, shell=True, stdout=PIPE)
+            output += proc.communicate()[0].decode('utf-8')
+            if proc.poll() == 0:
+                count += 1
+            else:
+                count = 0
+        msg = ('Expected 5 consecutive, got %d.\n'
+               'ping output is:\n%s' % (count,output))
+        self.assertEqual(count, 5, msg = msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/python.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/python.py
new file mode 100644
index 0000000..bf3e179
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/python.py
@@ -0,0 +1,43 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class PythonTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        src = os.path.join(cls.tc.files_dir, 'test.py')
+        dst = '/tmp/test.py'
+        cls.tc.target.copyTo(src, dst)
+
+    @classmethod
+    def tearDownClass(cls):
+        dst = '/tmp/test.py'
+        cls.tc.target.run('rm %s' % dst)
+
+    @OETestID(1145)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    @OEHasPackage(['python-core'])
+    def test_python_exists(self):
+        status, output = self.target.run('which python')
+        msg = 'Python binary not in PATH or not on target.'
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(965)
+    @OETestDepends(['python.PythonTest.test_python_exists'])
+    def test_python_stdout(self):
+        status, output = self.target.run('python /tmp/test.py')
+        msg = 'Exit status was not 0. Output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+        msg = 'Incorrect output: %s' % output
+        self.assertEqual(output, "the value of a is 0.01", msg=msg)
+
+    @OETestID(1146)
+    @OETestDepends(['python.PythonTest.test_python_stdout'])
+    def test_python_testfile(self):
+        status, output = self.target.run('ls /tmp/testfile.python')
+        self.assertEqual(status, 0, msg='Python test file generate failed.')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/rpm.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/rpm.py
new file mode 100644
index 0000000..05b94c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/rpm.py
@@ -0,0 +1,142 @@
+import os
+import fnmatch
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+from oeqa.core.utils.path import findFile
+
+class RpmBasicTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        if cls.tc.td['PACKAGE_CLASSES'].split()[0] != 'package_rpm':
+            cls.skipTest('Tests require image to be build from rpm')
+
+    @OETestID(960)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_rpm_help(self):
+        status, output = self.target.run('rpm --help')
+        msg = 'status and output: %s and %s' % (status, output)
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(191)
+    @OETestDepends(['rpm.RpmBasicTest.test_rpm_help'])
+    def test_rpm_query(self):
+        status, output = self.target.run('rpm -q rpm')
+        msg = 'status and output: %s and %s' % (status, output)
+        self.assertEqual(status, 0, msg=msg)
+
+class RpmInstallRemoveTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        if cls.tc.td['PACKAGE_CLASSES'].split()[0] != 'package_rpm':
+            cls.skipTest('Tests require image to be build from rpm')
+
+        pkgarch = cls.td['TUNE_PKGARCH'].replace('-', '_')
+        rpmdir = os.path.join(cls.tc.td['DEPLOY_DIR'], 'rpm', pkgarch)
+        # Pick rpm-doc as a test file to get installed, because it's small
+        # and it will always be built for standard targets
+        rpm_doc = 'rpm-doc-*.%s.rpm' % pkgarch
+        for f in fnmatch.filter(os.listdir(rpmdir), rpm_doc):
+            test_file = os.path.join(rpmdir, f)
+        dst = '/tmp/rpm-doc.rpm'
+        cls.tc.target.copyTo(test_file, dst)
+
+    @classmethod
+    def tearDownClass(cls):
+        dst = '/tmp/rpm-doc.rpm'
+        cls.tc.target.run('rm -f %s' % dst)
+
+    @OETestID(192)
+    @OETestDepends(['rpm.RpmBasicTest.test_rpm_help'])
+    def test_rpm_install(self):
+        status, output = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
+        msg = 'Failed to install rpm-doc package: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(194)
+    @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_install'])
+    def test_rpm_remove(self):
+        status,output = self.target.run('rpm -e rpm-doc')
+        msg = 'Failed to remove rpm-doc package: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(1096)
+    @OETestDepends(['rpm.RpmBasicTest.test_rpm_query'])
+    def test_rpm_query_nonroot(self):
+
+        def set_up_test_user(u):
+            status, output = self.target.run('id -u %s' % u)
+            if status:
+                status, output = self.target.run('useradd %s' % u)
+                msg = 'Failed to create new user: %s' % output
+                self.assertTrue(status == 0, msg=msg)
+
+        def exec_as_test_user(u):
+            status, output = self.target.run('su -c id %s' % u)
+            msg = 'Failed to execute as new user'
+            self.assertTrue("({0})".format(u) in output, msg=msg)
+
+            status, output = self.target.run('su -c "rpm -qa" %s ' % u)
+            msg = 'status: %s. Cannot run rpm -qa: %s' % (status, output)
+            self.assertEqual(status, 0, msg=msg)
+
+        def unset_up_test_user(u):
+            status, output = self.target.run('userdel -r %s' % u)
+            msg = 'Failed to erase user: %s' % output
+            self.assertTrue(status == 0, msg=msg)
+
+        tuser = 'test1'
+
+        try:
+            set_up_test_user(tuser)
+            exec_as_test_user(tuser)
+        finally:
+            unset_up_test_user(tuser)
+
+    @OETestID(195)
+    @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_remove'])
+    def test_check_rpm_install_removal_log_file_size(self):
+        """
+        Summary:     Check that rpm writes into /var/log/messages
+        Expected:    There should be some RPM prefixed entries in the above file.
+        Product:     BSPs
+        Author:      Alexandru Georgescu <alexandru.c.georgescu@intel.com>
+        Author:      Alexander Kanavin <alexander.kanavin@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+        db_files_cmd = 'ls /var/lib/rpm/__db.*'
+        check_log_cmd = "grep RPM /var/log/messages | wc -l"
+
+        # Make sure that some database files are under /var/lib/rpm as '__db.xxx'
+        status, output = self.target.run(db_files_cmd)
+        msg =  'Failed to find database files under /var/lib/rpm/ as __db.xxx'
+        self.assertEqual(0, status, msg=msg)
+
+        # Remove the package just in case
+        self.target.run('rpm -e rpm-doc')
+
+        # Install/Remove a package 10 times
+        for i in range(10):
+            status, output = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
+            msg = 'Failed to install rpm-doc package. Reason: {}'.format(output)
+            self.assertEqual(0, status, msg=msg)
+
+            status, output = self.target.run('rpm -e rpm-doc')
+            msg = 'Failed to remove rpm-doc package. Reason: {}'.format(output)
+            self.assertEqual(0, status, msg=msg)
+
+        # if using systemd this should ensure all entries are flushed to /var
+        status, output = self.target.run("journalctl --sync")
+        # Get the amount of entries in the log file
+        status, output = self.target.run(check_log_cmd)
+        msg = 'Failed to get the final size of the log file.'
+        self.assertEqual(0, status, msg=msg)
+
+        # Check that there's enough of them
+        self.assertGreaterEqual(int(output), 80,
+                                   'Cound not find sufficient amount of rpm entries in /var/log/messages, found {} entries'.format(output))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/scanelf.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/scanelf.py
new file mode 100644
index 0000000..3ba1f78
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/scanelf.py
@@ -0,0 +1,26 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class ScanelfTest(OERuntimeTestCase):
+    scancmd = 'scanelf --quiet --recursive --mount --ldpath --path'
+
+    @OETestID(966)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    @OEHasPackage(['pax-utils'])
+    def test_scanelf_textrel(self):
+        # print TEXTREL information
+        cmd = '%s --textrel' % self.scancmd
+        status, output = self.target.run(cmd)
+        msg = '\n'.join([cmd, output])
+        self.assertEqual(output.strip(), '', msg=msg)
+
+    @OETestID(967)
+    @OETestDepends(['scanelf.ScanelfTest.test_scanelf_textrel'])
+    def test_scanelf_rpath(self):
+        # print RPATH information
+        cmd = '%s --textrel --rpath' % self.scancmd
+        status, output = self.target.run(cmd)
+        msg = '\n'.join([cmd, output])
+        self.assertEqual(output.strip(), '', msg=msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/scp.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/scp.py
new file mode 100644
index 0000000..f488a61
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/scp.py
@@ -0,0 +1,33 @@
+import os
+from tempfile import mkstemp
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+
+class ScpTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.tmp_fd, cls.tmp_path = mkstemp()
+        with os.fdopen(cls.tmp_fd, 'w') as f:
+            f.seek(2 ** 22 -1)
+            f.write(os.linesep)
+
+    @classmethod
+    def tearDownClass(cls):
+        os.remove(cls.tmp_path)
+
+    @OETestID(220)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_scp_file(self):
+        dst = '/tmp/test_scp_file'
+
+        (status, output) = self.target.copyTo(self.tmp_path, dst)
+        msg = 'File could not be copied. Output: %s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+        (status, output) = self.target.run('ls -la %s' % dst)
+        self.assertEqual(status, 0, msg = 'SCP test failed')
+
+        self.target.run('rm %s' % dst)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/skeletoninit.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/skeletoninit.py
new file mode 100644
index 0000000..4fdcf03
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/skeletoninit.py
@@ -0,0 +1,33 @@
+# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=284
+# testcase. Image under test must have meta-skeleton layer in bblayers and
+# IMAGE_INSTALL_append = " service" in local.conf
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class SkeletonBasicTest(OERuntimeTestCase):
+
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    @OEHasPackage(['service'])
+    @skipIfDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd',
+                   'Not appropiate for systemd image')
+    def test_skeleton_availability(self):
+        status, output = self.target.run('ls /etc/init.d/skeleton')
+        msg = 'skeleton init script not found. Output:\n%s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+        status, output =  self.target.run('ls /usr/sbin/skeleton-test')
+        msg = 'skeleton-test not found. Output:\n%s' % output
+        self.assertEqual(status, 0, msg=msg)
+
+    @OETestID(284)
+    @OETestDepends(['skeletoninit.SkeletonBasicTest.test_skeleton_availability'])
+    def test_skeleton_script(self):
+        output1 = self.target.run("/etc/init.d/skeleton start")[1]
+        cmd = '%s | grep [s]keleton-test' % self.tc.target_cmds['ps']
+        status, output2 = self.target.run(cmd)
+        msg = ('Skeleton script could not be started:'
+               '\n%s\n%s' % (output1, output2))
+        self.assertEqual(status, 0, msg=msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/ssh.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/ssh.py
new file mode 100644
index 0000000..eca1679
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/ssh.py
@@ -0,0 +1,15 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+
+class SSHTest(OERuntimeTestCase):
+
+    @OETestID(224)
+    @OETestDepends(['ping.PingTest.test_ping'])
+    def test_ssh(self):
+        (status, output) = self.target.run('uname -a')
+        self.assertEqual(status, 0, msg='SSH Test failed: %s' % output)
+        (status, output) = self.target.run('cat /etc/masterimage')
+        msg = "This isn't the right image  - /etc/masterimage " \
+              "shouldn't be here %s" % output
+        self.assertEqual(status, 1, msg=msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/systemd.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/systemd.py
new file mode 100644
index 0000000..db69384
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/systemd.py
@@ -0,0 +1,181 @@
+import re
+import time
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfDataVar, skipIfNotDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class SystemdTest(OERuntimeTestCase):
+
+    def systemctl(self, action='', target='', expected=0, verbose=False):
+        command = 'systemctl %s %s' % (action, target)
+        status, output = self.target.run(command)
+        message = '\n'.join([command, output])
+        if status != expected and verbose:
+            cmd = 'systemctl status --full %s' % target
+            message += self.target.run(cmd)[1]
+        self.assertEqual(status, expected, message)
+        return output
+
+    #TODO: use pyjournalctl instead
+    def journalctl(self, args='',l_match_units=None):
+        """
+        Request for the journalctl output to the current target system
+
+        Arguments:
+        -args, an optional argument pass through argument
+        -l_match_units, an optional list of units to filter the output
+        Returns:
+        -string output of the journalctl command
+        Raises:
+        -AssertionError, on remote commands that fail
+        -ValueError, on a journalctl call with filtering by l_match_units that
+        returned no entries
+        """
+
+        query_units=''
+        if l_match_units:
+            query_units = ['_SYSTEMD_UNIT='+unit for unit in l_match_units]
+            query_units = ' '.join(query_units)
+        command = 'journalctl %s %s' %(args, query_units)
+        status, output = self.target.run(command)
+        if status:
+            raise AssertionError("Command '%s' returned non-zero exit "
+                    'code %d:\n%s' % (command, status, output))
+        if len(output) == 1 and "-- No entries --" in output:
+            raise ValueError('List of units to match: %s, returned no entries'
+                    % l_match_units)
+        return output
+
+class SystemdBasicTests(SystemdTest):
+
+    def settle(self):
+        """
+        Block until systemd has finished activating any units being activated,
+        or until two minutes has elapsed.
+
+        Returns a tuple, either (True, '') if all units have finished
+        activating, or (False, message string) if there are still units
+        activating (generally, failing units that restart).
+        """
+        endtime = time.time() + (60 * 2)
+        while True:
+            status, output = self.target.run('systemctl --state=activating')
+            if "0 loaded units listed" in output:
+                return (True, '')
+            if time.time() >= endtime:
+                return (False, output)
+            time.sleep(10)
+
+    @skipIfNotFeature('systemd',
+                      'Test requires systemd to be in DISTRO_FEATURES')
+    @skipIfNotDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd',
+                      'systemd is not the init manager for this image')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_systemd_basic(self):
+        self.systemctl('--version')
+
+    @OETestID(551)
+    @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+    def test_systemd_list(self):
+        self.systemctl('list-unit-files')
+
+    @OETestID(550)
+    @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+    def test_systemd_failed(self):
+        settled, output = self.settle()
+        msg = "Timed out waiting for systemd to settle:\n%s" % output
+        self.assertTrue(settled, msg=msg)
+
+        output = self.systemctl('list-units', '--failed')
+        match = re.search('0 loaded units listed', output)
+        if not match:
+            output += self.systemctl('status --full --failed')
+        self.assertTrue(match, msg='Some systemd units failed:\n%s' % output)
+
+
+class SystemdServiceTests(SystemdTest):
+
+    @OEHasPackage(['avahi-daemon'])
+    @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+    def test_systemd_status(self):
+        self.systemctl('status --full', 'avahi-daemon.service')
+
+    @OETestID(695)
+    @OETestDepends(['systemd.SystemdServiceTests.test_systemd_status'])
+    def test_systemd_stop_start(self):
+        self.systemctl('stop', 'avahi-daemon.service')
+        self.systemctl('is-active', 'avahi-daemon.service',
+                       expected=3, verbose=True)
+        self.systemctl('start','avahi-daemon.service')
+        self.systemctl('is-active', 'avahi-daemon.service', verbose=True)
+
+    @OETestID(696)
+    @OETestDepends(['systemd.SystemdServiceTests.test_systemd_status'])
+    def test_systemd_disable_enable(self):
+        self.systemctl('disable', 'avahi-daemon.service')
+        self.systemctl('is-enabled', 'avahi-daemon.service', expected=1)
+        self.systemctl('enable', 'avahi-daemon.service')
+        self.systemctl('is-enabled', 'avahi-daemon.service')
+
+class SystemdJournalTests(SystemdTest):
+
+    @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+    def test_systemd_journal(self):
+        status, output = self.target.run('journalctl')
+        self.assertEqual(status, 0, output)
+
+    @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+    def test_systemd_boot_time(self, systemd_TimeoutStartSec=90):
+        """
+        Get the target boot time from journalctl and log it
+
+        Arguments:
+        -systemd_TimeoutStartSec, an optional argument containing systemd's
+        unit start timeout to compare against
+        """
+
+        # The expression chain that uniquely identifies the time boot message.
+        expr_items=['Startup finished', 'kernel', 'userspace','\.$']
+        try:
+            output = self.journalctl(args='-o cat --reverse')
+        except AssertionError:
+            self.fail('Error occurred while calling journalctl')
+        if not len(output):
+            self.fail('Error, unable to get startup time from systemd journal')
+
+        # Check for the regular expression items that match the startup time.
+        for line in output.split('\n'):
+            check_match = ''.join(re.findall('.*'.join(expr_items), line))
+            if check_match:
+                break
+        # Put the startup time in the test log
+        if check_match:
+            self.tc.logger.info('%s' % check_match)
+        else:
+            self.skipTest('Error at obtaining the boot time from journalctl')
+        boot_time_sec = 0
+
+        # Get the numeric values from the string and convert them to seconds
+        # same data will be placed in list and string for manipulation.
+        l_boot_time = check_match.split(' ')[-2:]
+        s_boot_time = ' '.join(l_boot_time)
+        try:
+            # Obtain the minutes it took to boot.
+            if l_boot_time[0].endswith('min') and l_boot_time[0][0].isdigit():
+                boot_time_min = s_boot_time.split('min')[0]
+                # Convert to seconds and accumulate it.
+                boot_time_sec += int(boot_time_min) * 60
+            # Obtain the seconds it took to boot and accumulate.
+            boot_time_sec += float(l_boot_time[1].split('s')[0])
+        except ValueError:
+            self.skipTest('Error when parsing time from boot string')
+
+        # Assert the target boot time against systemd's unit start timeout.
+        if boot_time_sec > systemd_TimeoutStartSec:
+            msg = ("Target boot time %s exceeds systemd's TimeoutStartSec %s"
+                    % (boot_time_sec, systemd_TimeoutStartSec))
+            self.tc.logger.info(msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/x32lib.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/x32lib.py
new file mode 100644
index 0000000..8da0154
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/x32lib.py
@@ -0,0 +1,19 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotInDataVar
+
+class X32libTest(OERuntimeTestCase):
+
+    @skipIfNotInDataVar('DEFAULTTUNE', 'x86-64-x32',
+                        'DEFAULTTUNE is not set to x86-64-x32')
+    @OETestID(281)
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_x32_file(self):
+        cmd = 'readelf -h /bin/ls | grep Class | grep ELF32'
+        status1 = self.target.run(cmd)[0]
+        cmd = 'readelf -h /bin/ls | grep Machine | grep X86-64'
+        status2 = self.target.run(cmd)[0]
+        msg = ("/bin/ls isn't an X86-64 ELF32 binary. readelf says: %s" % 
+                self.target.run("readelf -h /bin/ls")[1])
+        self.assertTrue(status1 == 0 and status2 == 0, msg=msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/xorg.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/xorg.py
new file mode 100644
index 0000000..2124813
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/cases/xorg.py
@@ -0,0 +1,17 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class XorgTest(OERuntimeTestCase):
+
+    @OETestID(1151)
+    @skipIfNotFeature('x11-base',
+                      'Test requires x11 to be in IMAGE_FEATURES')
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_xorg_running(self):
+        cmd ='%s | grep -v xinit | grep [X]org' % self.tc.target_cmds['ps']
+        status, output = self.target.run(cmd)
+        msg = ('Xorg does not appear to be running %s' %
+              self.target.run(self.tc.target_cmds['ps'])[1])
+        self.assertEqual(status, 0, msg=msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/connman.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/connman.py
deleted file mode 100644
index 003fefe..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/connman.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import unittest
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasPackage("connman"):
-        skipModule("No connman package in image")
-
-
-class ConnmanTest(oeRuntimeTest):
-
-    def service_status(self, service):
-        if oeRuntimeTest.hasFeature("systemd"):
-            (status, output) = self.target.run('systemctl status -l %s' % service)
-            return output
-        else:
-            return "Unable to get status or logs for %s" % service
-
-    @testcase(961)
-    @skipUnlessPassed('test_ssh')
-    def test_connmand_help(self):
-        (status, output) = self.target.run('/usr/sbin/connmand --help')
-        self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
-
-    @testcase(221)
-    @skipUnlessPassed('test_connmand_help')
-    def test_connmand_running(self):
-        (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand')
-        if status != 0:
-            print(self.service_status("connman"))
-            self.fail("No connmand process running")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/context.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/context.py
new file mode 100644
index 0000000..c4cd76c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/context.py
@@ -0,0 +1,220 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+
+from oeqa.core.context import OETestContext, OETestContextExecutor
+from oeqa.core.target.ssh import OESSHTarget
+from oeqa.core.target.qemu import OEQemuTarget
+from oeqa.utils.dump import HostDumper
+
+from oeqa.runtime.loader import OERuntimeTestLoader
+
+class OERuntimeTestContext(OETestContext):
+    loaderClass = OERuntimeTestLoader
+    runtime_files_dir = os.path.join(
+                        os.path.dirname(os.path.abspath(__file__)), "files")
+
+    def __init__(self, td, logger, target,
+                 host_dumper, image_packages, extract_dir):
+        super(OERuntimeTestContext, self).__init__(td, logger)
+
+        self.target = target
+        self.image_packages = image_packages
+        self.host_dumper = host_dumper
+        self.extract_dir = extract_dir
+        self._set_target_cmds()
+
+    def _set_target_cmds(self):
+        self.target_cmds = {}
+
+        self.target_cmds['ps'] = 'ps'
+        if 'procps' in self.image_packages:
+            self.target_cmds['ps'] = self.target_cmds['ps'] + ' -ef'
+
+class OERuntimeTestContextExecutor(OETestContextExecutor):
+    _context_class = OERuntimeTestContext
+
+    name = 'runtime'
+    help = 'runtime test component'
+    description = 'executes runtime tests over targets'
+
+    default_cases = os.path.join(os.path.abspath(os.path.dirname(__file__)),
+            'cases')
+    default_data = None
+    default_test_data = 'data/testdata.json'
+    default_tests = ''
+
+    default_target_type = 'simpleremote'
+    default_manifest = 'data/manifest'
+    default_server_ip = '192.168.7.1'
+    default_target_ip = '192.168.7.2'
+    default_host_dumper_dir = '/tmp/oe-saved-tests'
+    default_extract_dir = 'packages/extracted'
+
+    def register_commands(self, logger, subparsers):
+        super(OERuntimeTestContextExecutor, self).register_commands(logger, subparsers)
+
+        runtime_group = self.parser.add_argument_group('runtime options')
+
+        runtime_group.add_argument('--target-type', action='store',
+                default=self.default_target_type, choices=['simpleremote', 'qemu'],
+                help="Target type of device under test, default: %s" \
+                % self.default_target_type)
+        runtime_group.add_argument('--target-ip', action='store',
+                default=self.default_target_ip,
+                help="IP address of device under test, default: %s" \
+                % self.default_target_ip)
+        runtime_group.add_argument('--server-ip', action='store',
+                default=self.default_target_ip,
+                help="IP address of device under test, default: %s" \
+                % self.default_server_ip)
+
+        runtime_group.add_argument('--host-dumper-dir', action='store',
+                default=self.default_host_dumper_dir,
+                help="Directory where host status is dumped, if tests fails, default: %s" \
+                % self.default_host_dumper_dir)
+
+        runtime_group.add_argument('--packages-manifest', action='store',
+                default=self.default_manifest,
+                help="Package manifest of the image under testi, default: %s" \
+                % self.default_manifest)
+
+        runtime_group.add_argument('--extract-dir', action='store',
+                default=self.default_extract_dir,
+                help='Directory where extracted packages reside, default: %s' \
+                % self.default_extract_dir)
+
+        runtime_group.add_argument('--qemu-boot', action='store',
+                help="Qemu boot configuration, only needed when target_type is QEMU.")
+
+    @staticmethod
+    def getTarget(target_type, logger, target_ip, server_ip, **kwargs):
+        target = None
+
+        if target_type == 'simpleremote':
+            target = OESSHTarget(logger, target_ip, server_ip, **kwargs)
+        elif target_type == 'qemu':
+            target = OEQemuTarget(logger, target_ip, server_ip, **kwargs)
+        else:
+            # XXX: This code uses the old naming convention for controllers and
+            # targets, the idea it is to leave just targets as the controller
+            # most of the time was just a wrapper.
+            # XXX: This code tries to import modules from lib/oeqa/controllers
+            # directory and treat them as controllers, it will less error prone
+            # to use introspection to load such modules.
+            # XXX: Don't base your targets on this code it will be refactored
+            # in the near future.
+            # Custom target module loading
+            try:
+                target_modules_path = kwargs.get('target_modules_path', '')
+                controller = OERuntimeTestContextExecutor.getControllerModule(target_type, target_modules_path)
+                target = controller(logger, target_ip, server_ip, **kwargs)
+            except ImportError as e:
+                raise TypeError("Failed to import %s from available controller modules" % target_type)
+
+        return target
+
+    # Search oeqa.controllers module directory for and return a controller
+    # corresponding to the given target name.
+    # AttributeError raised if not found.
+    # ImportError raised if a provided module can not be imported.
+    @staticmethod
+    def getControllerModule(target, target_modules_path):
+        controllerslist = OERuntimeTestContextExecutor._getControllerModulenames(target_modules_path)
+        controller = OERuntimeTestContextExecutor._loadControllerFromName(target, controllerslist)
+        return controller
+
+    # Return a list of all python modules in lib/oeqa/controllers for each
+    # layer in bbpath
+    @staticmethod
+    def _getControllerModulenames(target_modules_path):
+
+        controllerslist = []
+
+        def add_controller_list(path):
+            if not os.path.exists(os.path.join(path, '__init__.py')):
+                raise OSError('Controllers directory %s exists but is missing __init__.py' % path)
+            files = sorted([f for f in os.listdir(path) if f.endswith('.py') and not f.startswith('_')])
+            for f in files:
+                module = 'oeqa.controllers.' + f[:-3]
+                if module not in controllerslist:
+                    controllerslist.append(module)
+                else:
+                    raise RuntimeError("Duplicate controller module found for %s. Layers should create unique controller module names" % module)
+
+        extpath = target_modules_path.split(':')
+        for p in extpath:
+            controllerpath = os.path.join(p, 'lib', 'oeqa', 'controllers')
+            if os.path.exists(controllerpath):
+                add_controller_list(controllerpath)
+        return controllerslist
+
+    # Search for and return a controller from given target name and
+    # set of module names.
+    # Raise AttributeError if not found.
+    # Raise ImportError if a provided module can not be imported
+    @staticmethod
+    def _loadControllerFromName(target, modulenames):
+        for name in modulenames:
+            obj = OERuntimeTestContextExecutor._loadControllerFromModule(target, name)
+            if obj:
+                return obj
+        raise AttributeError("Unable to load {0} from available modules: {1}".format(target, str(modulenames)))
+
+    # Search for and return a controller or None from given module name
+    @staticmethod
+    def _loadControllerFromModule(target, modulename):
+        obj = None
+        # import module, allowing it to raise import exception
+        try:
+            module = __import__(modulename, globals(), locals(), [target])
+        except Exception as e:
+            return obj
+        # look for target class in the module, catching any exceptions as it
+        # is valid that a module may not have the target class.
+        try:
+            obj = getattr(module, target)
+        except:
+            obj = None
+        return obj
+        
+    @staticmethod
+    def readPackagesManifest(manifest):
+        if not manifest or not os.path.exists(manifest):
+            raise OSError("Manifest file not exists: %s" % manifest)
+
+        image_packages = set()
+        with open(manifest, 'r') as f:
+            for line in f.readlines():
+                line = line.strip()
+                if line and not line.startswith("#"):
+                    image_packages.add(line.split()[0])
+
+        return image_packages
+
+    @staticmethod
+    def getHostDumper(cmds, directory):
+        return HostDumper(cmds, directory)
+
+    def _process_args(self, logger, args):
+        if not args.packages_manifest:
+            raise TypeError('Manifest file not provided')
+
+        super(OERuntimeTestContextExecutor, self)._process_args(logger, args)
+
+        target_kwargs = {}
+        target_kwargs['qemuboot'] = args.qemu_boot
+
+        self.tc_kwargs['init']['target'] = \
+                OERuntimeTestContextExecutor.getTarget(args.target_type,
+                        None, args.target_ip, args.server_ip, **target_kwargs)
+        self.tc_kwargs['init']['host_dumper'] = \
+                OERuntimeTestContextExecutor.getHostDumper(None,
+                        args.host_dumper_dir)
+        self.tc_kwargs['init']['image_packages'] = \
+                OERuntimeTestContextExecutor.readPackagesManifest(
+                        args.packages_manifest)
+        self.tc_kwargs['init']['extract_dir'] = args.extract_dir
+
+_executor_class = OERuntimeTestContextExecutor
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/date.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/date.py
deleted file mode 100644
index 447987e..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/date.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from oeqa.oetest import oeRuntimeTest
-from oeqa.utils.decorators import *
-import re
-
-class DateTest(oeRuntimeTest):
-
-    def setUpLocal(self):
-        if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
-            self.target.run('systemctl stop systemd-timesyncd')
-
-    def tearDownLocal(self):
-        if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
-            self.target.run('systemctl start systemd-timesyncd')
-
-    @testcase(211)
-    @skipUnlessPassed("test_ssh")
-    def test_date(self):
-        (status, output) = self.target.run('date +"%Y-%m-%d %T"')
-        self.assertEqual(status, 0, msg="Failed to get initial date, output: %s" % output)
-        oldDate = output
-
-        sampleDate = '"2016-08-09 10:00:00"'
-        (status, output) = self.target.run("date -s %s" % sampleDate)
-        self.assertEqual(status, 0, msg="Date set failed, output: %s" % output)
-
-        (status, output) = self.target.run("date -R")
-        p = re.match('Tue, 09 Aug 2016 10:00:.. \+0000', output)
-        self.assertTrue(p, msg="The date was not set correctly, output: %s" % output)
-
-        (status, output) = self.target.run('date -s "%s"' % oldDate)
-        self.assertEqual(status, 0, msg="Failed to reset date, output: %s" % output)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/decorator/package.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/decorator/package.py
new file mode 100644
index 0000000..aa6ecb6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/decorator/package.py
@@ -0,0 +1,53 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.decorator import OETestDecorator, registerDecorator
+from oeqa.core.utils.misc import strToSet
+
+@registerDecorator
+class OEHasPackage(OETestDecorator):
+    """
+        Checks if image has packages (un)installed.
+
+        The argument must be a string, set, or list of packages that must be
+        installed or not present in the image.
+
+        The way to tell a package must not be in an image is using an
+        exclamation point ('!') before the name of the package.
+
+        If test depends on pkg1 or pkg2 you need to use:
+        @OEHasPackage({'pkg1', 'pkg2'})
+
+        If test depends on pkg1 and pkg2 you need to use:
+        @OEHasPackage('pkg1')
+        @OEHasPackage('pkg2')
+
+        If test depends on pkg1 but pkg2 must not be present use:
+        @OEHasPackage({'pkg1', '!pkg2'})
+    """
+
+    attrs = ('need_pkgs',)
+
+    def setUpDecorator(self):
+        need_pkgs = set()
+        unneed_pkgs = set()
+        pkgs = strToSet(self.need_pkgs)
+        for pkg in pkgs:
+            if pkg.startswith('!'):
+                unneed_pkgs.add(pkg[1:])
+            else:
+                need_pkgs.add(pkg)
+
+        if unneed_pkgs:
+            msg = 'Checking if %s is not installed' % ', '.join(unneed_pkgs)
+            self.logger.debug(msg)
+            if not self.case.tc.image_packages.isdisjoint(unneed_pkgs):
+                msg = "Test can't run with %s installed" % ', or'.join(unneed_pkgs)
+                self.case.skipTest(msg)
+
+        if need_pkgs:
+            msg = 'Checking if at least one of %s is installed' % ', '.join(need_pkgs)
+            self.logger.debug(msg)
+            if self.case.tc.image_packages.isdisjoint(need_pkgs):
+                msg = "Test requires %s to be installed" % ', or'.join(need_pkgs)
+                self.case.skipTest(msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/df.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/df.py
deleted file mode 100644
index 09569d5..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/df.py
+++ /dev/null
@@ -1,12 +0,0 @@
-import unittest
-from oeqa.oetest import oeRuntimeTest
-from oeqa.utils.decorators import *
-
-
-class DfTest(oeRuntimeTest):
-
-    @testcase(234)
-    @skipUnlessPassed("test_ssh")
-    def test_df(self):
-        (status,output) = self.target.run("df / | sed -n '2p' | awk '{print $4}'")
-        self.assertTrue(int(output)>5120, msg="Not enough space on image. Current size is %s" % output)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/gcc.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/gcc.py
deleted file mode 100644
index d90cd17..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/gcc.py
+++ /dev/null
@@ -1,47 +0,0 @@
-import unittest
-import os
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("tools-sdk"):
-        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
-
-
-class GccCompileTest(oeRuntimeTest):
-
-    @classmethod
-    def setUpClass(self):
-        oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.c"), "/tmp/test.c")
-        oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "testmakefile"), "/tmp/testmakefile")
-        oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.cpp"), "/tmp/test.cpp")
-
-    @testcase(203)
-    def test_gcc_compile(self):
-        (status, output) = self.target.run('gcc /tmp/test.c -o /tmp/test -lm')
-        self.assertEqual(status, 0, msg="gcc compile failed, output: %s" % output)
-        (status, output) = self.target.run('/tmp/test')
-        self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
-
-    @testcase(200)
-    def test_gpp_compile(self):
-        (status, output) = self.target.run('g++ /tmp/test.c -o /tmp/test -lm')
-        self.assertEqual(status, 0, msg="g++ compile failed, output: %s" % output)
-        (status, output) = self.target.run('/tmp/test')
-        self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
-
-    @testcase(1142)
-    def test_gpp2_compile(self):
-        (status, output) = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm')
-        self.assertEqual(status, 0, msg="g++ compile failed, output: %s" % output)
-        (status, output) = self.target.run('/tmp/test')
-        self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
-
-    @testcase(204)
-    def test_make(self):
-        (status, output) = self.target.run('cd /tmp; make -f testmakefile')
-        self.assertEqual(status, 0, msg="running make failed, output %s" % output)
-
-    @classmethod
-    def tearDownClass(self):
-        oeRuntimeTest.tc.target.run("rm /tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/kernelmodule.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/kernelmodule.py
deleted file mode 100644
index 38ca184..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/kernelmodule.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import unittest
-import os
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("tools-sdk"):
-        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
-
-
-class KernelModuleTest(oeRuntimeTest):
-
-    def setUpLocal(self):
-        self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod.c"), "/tmp/hellomod.c")
-        self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod_makefile"), "/tmp/Makefile")
-
-    @testcase('316')
-    @skipUnlessPassed('test_ssh')
-    @skipUnlessPassed('test_gcc_compile')
-    def test_kernel_module(self):
-        cmds = [
-            'cd /usr/src/kernel && make scripts',
-            'cd /tmp && make',
-            'cd /tmp && insmod hellomod.ko',
-            'lsmod | grep hellomod',
-            'dmesg | grep Hello',
-            'rmmod hellomod', 'dmesg | grep "Cleaning up hellomod"'
-            ]
-        for cmd in cmds:
-            (status, output) = self.target.run(cmd, 900)
-            self.assertEqual(status, 0, msg="\n".join([cmd, output]))
-
-    def tearDownLocal(self):
-        self.target.run('rm -f /tmp/Makefile /tmp/hellomod.c')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/ldd.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/ldd.py
deleted file mode 100644
index 47b3885..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/ldd.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import unittest
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("tools-sdk"):
-        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
-
-class LddTest(oeRuntimeTest):
-
-    @testcase(962)
-    @skipUnlessPassed('test_ssh')
-    def test_ldd_exists(self):
-        (status, output) = self.target.run('which ldd')
-        self.assertEqual(status, 0, msg = "ldd does not exist in PATH: which ldd: %s" % output)
-
-    @testcase(239)
-    @skipUnlessPassed('test_ldd_exists')
-    def test_ldd_rtldlist_check(self):
-        (status, output) = self.target.run('for i in $(which ldd | xargs cat | grep "^RTLDLIST"|cut -d\'=\' -f2|tr -d \'"\'); do test -f $i && echo $i && break; done')
-        self.assertEqual(status, 0, msg = "ldd path not correct or RTLDLIST files don't exist. ")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/loader.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/loader.py
new file mode 100644
index 0000000..041ef97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/loader.py
@@ -0,0 +1,16 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.loader import OETestLoader
+from oeqa.runtime.case import OERuntimeTestCase
+
+class OERuntimeTestLoader(OETestLoader):
+    caseClass = OERuntimeTestCase
+
+    def _getTestCase(self, testCaseClass, tcName):
+        case = super(OERuntimeTestLoader, self)._getTestCase(testCaseClass, tcName)
+
+        # Adds custom attributes to the OERuntimeTestCase
+        setattr(case, 'target', self.tc.target)
+
+        return case
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/logrotate.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/logrotate.py
deleted file mode 100644
index de300bf..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/logrotate.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=289 testcase
-# Note that the image under test must have logrotate installed
-
-import unittest
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasPackage("logrotate"):
-        skipModule("No logrotate package in image")
-
-
-class LogrotateTest(oeRuntimeTest):
-
-    @skipUnlessPassed("test_ssh")
-    def test_1_logrotate_setup(self):
-        (status, output) = self.target.run('mkdir $HOME/logrotate_dir')
-        self.assertEqual(status, 0, msg = "Could not create logrotate_dir. Output: %s" % output)
-        (status, output) = self.target.run("sed -i \"s#wtmp {#wtmp {\\n    olddir $HOME/logrotate_dir#\" /etc/logrotate.conf")
-        self.assertEqual(status, 0, msg = "Could not write to logrotate.conf file. Status and output: %s and %s)" % (status, output))
-
-    @testcase(289)
-    @skipUnlessPassed("test_1_logrotate_setup")
-    def test_2_logrotate(self):
-        (status, output) = self.target.run('logrotate -f /etc/logrotate.conf')
-        self.assertEqual(status, 0, msg = "logrotate service could not be reloaded. Status and output: %s and %s" % (status, output))
-        output = self.target.run('ls -la $HOME/logrotate_dir/ | wc -l')[1]
-        self.assertTrue(int(output)>=3, msg = "new logfile could not be created. List of files within log directory: %s" %(self.target.run('ls -la $HOME/logrotate_dir')[1]))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/multilib.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/multilib.py
deleted file mode 100644
index 593d385..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/multilib.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import unittest
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    multilibs = oeRuntimeTest.tc.d.getVar("MULTILIBS", True) or ""
-    if "multilib:lib32" not in multilibs:
-        skipModule("this isn't a multilib:lib32 image")
-
-
-class MultilibTest(oeRuntimeTest):
-
-    def archtest(self, binary, arch):
-        """
-        Check that ``binary`` has the ELF class ``arch`` (e.g. ELF32/ELF64).
-        """
-
-        (status, output) = self.target.run("readelf -h %s" % binary)
-        self.assertEqual(status, 0, "Failed to readelf %s" % binary)
-
-        l = [l.split()[1] for l in output.split('\n') if "Class:" in l]
-        if l:
-            theclass = l[0]
-        else:
-            self.fail("Cannot parse readelf output\n" + s)
-
-        self.assertEqual(theclass, arch, msg="%s isn't %s (is %s)" % (binary, arch, theclass))
-
-    @skipUnlessPassed('test_ssh')
-    def test_check_multilib_libc(self):
-        """
-        Check that a multilib image has both 32-bit and 64-bit libc in.
-        """
-        self.archtest("/lib/libc.so.6", "ELF32")
-        self.archtest("/lib64/libc.so.6", "ELF64")
-
-    @testcase('279')
-    @skipUnlessPassed('test_check_multilib_libc')
-    def test_file_connman(self):
-        self.assertTrue(oeRuntimeTest.hasPackage('lib32-connman'), msg="This test assumes lib32-connman is installed")
-
-        self.archtest("/usr/sbin/connmand", "ELF32")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/pam.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/pam.py
deleted file mode 100644
index c8205c9..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/pam.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=287 testcase
-# Note that the image under test must have "pam" in DISTRO_FEATURES
-
-import unittest
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("pam"):
-        skipModule("target doesn't have 'pam' in DISTRO_FEATURES")
-
-
-class PamBasicTest(oeRuntimeTest):
-
-    @testcase(287)
-    @skipUnlessPassed('test_ssh')
-    def test_pam(self):
-        (status, output) = self.target.run('login --help')
-        self.assertEqual(status, 1, msg = "login command does not work as expected. Status and output:%s and %s" %(status, output))
-        (status, output) = self.target.run('passwd --help')
-        self.assertEqual(status, 0, msg = "passwd command does not work as expected. Status and output:%s and %s" %(status, output))
-        (status, output) = self.target.run('su --help')
-        self.assertEqual(status, 0, msg = "su command does not work as expected. Status and output:%s and %s" %(status, output))
-        (status, output) = self.target.run('useradd --help')
-        self.assertEqual(status, 0, msg = "useradd command does not work as expected. Status and output:%s and %s" %(status, output))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py
deleted file mode 100644
index aa5008b..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py
+++ /dev/null
@@ -1,313 +0,0 @@
-import os
-import unittest
-import subprocess
-from oeqa.oetest import oeRuntimeTest
-from oeqa.utils.decorators import *
-
-#in the future these lists could be moved outside of module
-errors = ["error", "cannot", "can\'t", "failed"]
-
-common_errors = [
-    "(WW) warning, (EE) error, (NI) not implemented, (??) unknown.",
-    "dma timeout",
-    "can\'t add hid device:",
-    "usbhid: probe of ",
-    "_OSC failed (AE_ERROR)",
-    "_OSC failed (AE_SUPPORT)",
-    "AE_ALREADY_EXISTS",
-    "ACPI _OSC request failed (AE_SUPPORT)",
-    "can\'t disable ASPM",
-    "Failed to load module \"vesa\"",
-    "Failed to load module vesa",
-    "Failed to load module \"modesetting\"",
-    "Failed to load module modesetting",
-    "Failed to load module \"glx\"",
-    "Failed to load module \"fbdev\"",
-    "Failed to load module fbdev",
-    "Failed to load module glx",
-    "[drm] Cannot find any crtc or sizes - going 1024x768",
-    "_OSC failed (AE_NOT_FOUND); disabling ASPM",
-    "Open ACPI failed (/var/run/acpid.socket) (No such file or directory)",
-    "NX (Execute Disable) protection cannot be enabled: non-PAE kernel!",
-    "hd.: possibly failed opcode",
-    'NETLINK INITIALIZATION FAILED',
-    'kernel: Cannot find map file',
-    'omap_hwmod: debugss: _wait_target_disable failed',
-    'VGA arbiter: cannot open kernel arbiter, no multi-card support',
-    'Failed to find URL:http://ipv4.connman.net/online/status.html',
-    'Online check failed for',
-    'netlink init failed',
-    'Fast TSC calibration',
-    "BAR 0-9",
-    "Failed to load module \"ati\"",
-    "controller can't do DEVSLP, turning off",
-    "stmmac_dvr_probe: warning: cannot get CSR clock",
-    "error: couldn\'t mount because of unsupported optional features",
-    "GPT: Use GNU Parted to correct GPT errors",
-    ]
-
-video_related = [
-    "uvesafb",
-]
-
-x86_common = [
-    '[drm:psb_do_init] *ERROR* Debug is',
-    'wrong ELF class',
-    'Could not enable PowerButton event',
-    'probe of LNXPWRBN:00 failed with error -22',
-    'pmd_set_huge: Cannot satisfy',
-    'failed to setup card detect gpio',
-    'amd_nb: Cannot enumerate AMD northbridges',
-    'failed to retrieve link info, disabling eDP',
-    'Direct firmware load for iwlwifi',
-] + common_errors
-
-qemux86_common = [
-    'wrong ELF class',
-    "fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.",
-    "can't claim BAR ",
-    'amd_nb: Cannot enumerate AMD northbridges',
-    'uvesafb: 5000 ms task timeout, infinitely waiting',
-    'tsc: HPET/PMTIMER calibration failed',
-] + common_errors
-
-ignore_errors = {
-    'default' : common_errors,
-    'qemux86' : [
-        'Failed to access perfctr msr (MSR',
-        'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
-        ] + qemux86_common,
-    'qemux86-64' : qemux86_common,
-    'qemumips' : [
-        'Failed to load module "glx"',
-        'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
-        ] + common_errors,
-    'qemumips64' : [
-        'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
-         ] + common_errors,
-    'qemuppc' : [
-        'PCI 0000:00 Cannot reserve Legacy IO [io  0x0000-0x0fff]',
-        'host side 80-wire cable detection failed, limiting max speed',
-        'mode "640x480" test failed',
-        'Failed to load module "glx"',
-        'can\'t handle BAR above 4GB',
-        'Cannot reserve Legacy IO',
-        ] + common_errors,
-    'qemuarm' : [
-        'mmci-pl18x: probe of fpga:05 failed with error -22',
-        'mmci-pl18x: probe of fpga:0b failed with error -22',
-        'Failed to load module "glx"',
-        'OF: amba_device_add() failed (-19) for /amba/smc@10100000',
-        'OF: amba_device_add() failed (-19) for /amba/mpmc@10110000',
-        'OF: amba_device_add() failed (-19) for /amba/sctl@101e0000',
-        'OF: amba_device_add() failed (-19) for /amba/watchdog@101e1000',
-        'OF: amba_device_add() failed (-19) for /amba/sci@101f0000',
-        'OF: amba_device_add() failed (-19) for /amba/ssp@101f4000',
-        'OF: amba_device_add() failed (-19) for /amba/fpga/sci@a000',
-        'Failed to initialize \'/amba/timer@101e3000\': -22',
-        'jitterentropy: Initialization failed with host not compliant with requirements: 2',
-        ] + common_errors,
-    'qemuarm64' : [
-        'Fatal server error:',
-        '(EE) Server terminated with error (1). Closing log file.',
-        'dmi: Firmware registration failed.',
-        'irq: type mismatch, failed to map hwirq-27 for /intc',
-        ] + common_errors,
-    'emenlow' : [
-        '[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness',
-        '(EE) Failed to load module "psb"',
-        '(EE) Failed to load module psb',
-        '(EE) Failed to load module "psbdrv"',
-        '(EE) Failed to load module psbdrv',
-        '(EE) open /dev/fb0: No such file or directory',
-        '(EE) AIGLX: reverting to software rendering',
-        ] + x86_common,
-    'intel-core2-32' : [
-        'ACPI: No _BQC method, cannot determine initial brightness',
-        '[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness',
-        '(EE) Failed to load module "psb"',
-        '(EE) Failed to load module psb',
-        '(EE) Failed to load module "psbdrv"',
-        '(EE) Failed to load module psbdrv',
-        '(EE) open /dev/fb0: No such file or directory',
-        '(EE) AIGLX: reverting to software rendering',
-        'dmi: Firmware registration failed.',
-        'ioremap error for 0x78',
-        ] + x86_common,
-    'intel-corei7-64' : x86_common,
-    'crownbay' : x86_common,
-    'genericx86' : x86_common,
-    'genericx86-64' : [
-        'Direct firmware load for i915',
-        'Failed to load firmware i915',
-        'Failed to fetch GuC',
-        'Failed to initialize GuC',
-        'Failed to load DMC firmware',
-        'The driver is built-in, so to load the firmware you need to',
-        ] + x86_common,
-    'edgerouter' : [
-        'Fatal server error:',
-        ] + common_errors,
-    'jasperforest' : [
-        'Activated service \'org.bluez\' failed:',
-        'Unable to find NFC netlink family',
-        ] + common_errors,
-}
-
-log_locations = ["/var/log/","/var/log/dmesg", "/tmp/dmesg_output.log"]
-
-class ParseLogsTest(oeRuntimeTest):
-
-    @classmethod
-    def setUpClass(self):
-        self.errors = errors
-
-        # When systemd is enabled we need to notice errors on
-        # circular dependencies in units.
-        if self.hasFeature("systemd"):
-            self.errors.extend([
-                'Found ordering cycle on',
-                'Breaking ordering cycle by deleting job',
-                'deleted to break ordering cycle',
-                'Ordering cycle found, skipping',
-                ])
-
-        self.ignore_errors = ignore_errors
-        self.log_locations = log_locations
-        self.msg = ""
-        (is_lsb, location) = oeRuntimeTest.tc.target.run("which LSB_Test.sh")
-        if is_lsb == 0:
-            for machine in self.ignore_errors:
-                self.ignore_errors[machine] = self.ignore_errors[machine] + video_related
-
-    def getMachine(self):
-        return oeRuntimeTest.tc.d.getVar("MACHINE", True)
-
-    def getWorkdir(self):
-        return oeRuntimeTest.tc.d.getVar("WORKDIR", True)
-
-    #get some information on the CPU of the machine to display at the beginning of the output. This info might be useful in some cases.
-    def getHardwareInfo(self):
-        hwi = ""
-        (status, cpu_name) = self.target.run("cat /proc/cpuinfo | grep \"model name\" | head -n1 | awk 'BEGIN{FS=\":\"}{print $2}'")
-        (status, cpu_physical_cores) = self.target.run("cat /proc/cpuinfo | grep \"cpu cores\" | head -n1 | awk {'print $4'}")
-        (status, cpu_logical_cores) = self.target.run("cat /proc/cpuinfo | grep \"processor\" | wc -l")
-        (status, cpu_arch) = self.target.run("uname -m")
-        hwi += "Machine information: \n"
-        hwi += "*******************************\n"
-        hwi += "Machine name: "+self.getMachine()+"\n"
-        hwi += "CPU: "+str(cpu_name)+"\n"
-        hwi += "Arch: "+str(cpu_arch)+"\n"
-        hwi += "Physical cores: "+str(cpu_physical_cores)+"\n"
-        hwi += "Logical cores: "+str(cpu_logical_cores)+"\n"
-        hwi += "*******************************\n"
-        return hwi
-
-    #go through the log locations provided and if it's a folder create a list with all the .log files in it, if it's a file just add
-    #it to that list
-    def getLogList(self, log_locations):
-        logs = []
-        for location in log_locations:
-            (status, output) = self.target.run("test -f "+str(location))
-            if (status == 0):
-                logs.append(str(location))
-            else:
-                (status, output) = self.target.run("test -d "+str(location))
-                if (status == 0):
-                    (status, output) = self.target.run("find "+str(location)+"/*.log -maxdepth 1 -type f")
-                    if (status == 0):
-                        output = output.splitlines()
-                        for logfile in output:
-                            logs.append(os.path.join(location,str(logfile)))
-        return logs
-
-    #copy the log files to be parsed locally
-    def transfer_logs(self, log_list):
-        workdir = self.getWorkdir()
-        self.target_logs = workdir + '/' + 'target_logs'
-        target_logs = self.target_logs
-        if not os.path.exists(target_logs):
-            os.makedirs(target_logs)
-        bb.utils.remove(self.target_logs + "/*")
-        for f in log_list:
-            self.target.copy_from(f, target_logs)
-
-    #get the local list of logs
-    def get_local_log_list(self, log_locations):
-        self.transfer_logs(self.getLogList(log_locations))
-        logs = [ os.path.join(self.target_logs, f) for f in os.listdir(self.target_logs) if os.path.isfile(os.path.join(self.target_logs, f)) ]
-        return logs
-
-    #build the grep command to be used with filters and exclusions
-    def build_grepcmd(self, errors, ignore_errors, log):
-        grepcmd = "grep "
-        grepcmd +="-Ei \""
-        for error in errors:
-            grepcmd += error+"|"
-        grepcmd = grepcmd[:-1]
-        grepcmd += "\" "+str(log)+" | grep -Eiv \'"
-        try:
-            errorlist = ignore_errors[self.getMachine()]
-        except KeyError:
-            self.msg += "No ignore list found for this machine, using default\n"
-            errorlist = ignore_errors['default']
-        for ignore_error in errorlist:
-            ignore_error = ignore_error.replace("(", "\(")
-            ignore_error = ignore_error.replace(")", "\)")
-            ignore_error = ignore_error.replace("'", ".")
-            ignore_error = ignore_error.replace("?", "\?")
-            ignore_error = ignore_error.replace("[", "\[")
-            ignore_error = ignore_error.replace("]", "\]")
-            ignore_error = ignore_error.replace("*", "\*")
-            ignore_error = ignore_error.replace("0-9", "[0-9]")
-            grepcmd += ignore_error+"|"
-        grepcmd = grepcmd[:-1]
-        grepcmd += "\'"
-        return grepcmd
-
-    #grep only the errors so that their context could be collected. Default context is 10 lines before and after the error itself
-    def parse_logs(self, errors, ignore_errors, logs, lines_before = 10, lines_after = 10):
-        results = {}
-        rez = []
-        grep_output = ''
-        for log in logs:
-            result = None
-            thegrep = self.build_grepcmd(errors, ignore_errors, log)
-            try:
-                result = subprocess.check_output(thegrep, shell=True).decode("utf-8")
-            except:
-                pass
-            if (result is not None):
-                results[log.replace('target_logs/','')] = {}
-                rez = result.splitlines()
-                for xrez in rez:
-                    try:
-                        grep_output = subprocess.check_output(['grep', '-F', xrez, '-B', str(lines_before), '-A', str(lines_after), log]).decode("utf-8")
-                    except:
-                        pass
-                    results[log.replace('target_logs/','')][xrez]=grep_output
-        return results
-
-    #get the output of dmesg and write it in a file. This file is added to log_locations.
-    def write_dmesg(self):
-        (status, dmesg) = self.target.run("dmesg > /tmp/dmesg_output.log")
-
-    @testcase(1059)
-    @skipUnlessPassed('test_ssh')
-    def test_parselogs(self):
-        self.write_dmesg()
-        log_list = self.get_local_log_list(self.log_locations)
-        result = self.parse_logs(self.errors, self.ignore_errors, log_list)
-        print(self.getHardwareInfo())
-        errcount = 0
-        for log in result:
-            self.msg += "Log: "+log+"\n"
-            self.msg += "-----------------------\n"
-            for error in result[log]:
-                errcount += 1
-                self.msg += "Central error: "+str(error)+"\n"
-                self.msg +=  "***********************\n"
-                self.msg +=  result[str(log)][str(error)]+"\n"
-                self.msg +=  "***********************\n"
-        self.msg += "%s errors found in logs." % errcount
-        self.assertEqual(errcount, 0, msg=self.msg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/perl.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/perl.py
deleted file mode 100644
index e044d0a..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/perl.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import unittest
-import os
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasPackage("perl"):
-        skipModule("No perl package in the image")
-
-
-class PerlTest(oeRuntimeTest):
-
-    @classmethod
-    def setUpClass(self):
-        oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.pl"), "/tmp/test.pl")
-
-    @testcase(1141)
-    def test_perl_exists(self):
-        (status, output) = self.target.run('which perl')
-        self.assertEqual(status, 0, msg="Perl binary not in PATH or not on target.")
-
-    @testcase(208)
-    def test_perl_works(self):
-        (status, output) = self.target.run('perl /tmp/test.pl')
-        self.assertEqual(status, 0, msg="Exit status was not 0. Output: %s" % output)
-        self.assertEqual(output, "the value of a is 0.01", msg="Incorrect output: %s" % output)
-
-    @classmethod
-    def tearDownClass(self):
-        oeRuntimeTest.tc.target.run("rm /tmp/test.pl")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/ping.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/ping.py
deleted file mode 100644
index 0f27447..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/ping.py
+++ /dev/null
@@ -1,22 +0,0 @@
-import subprocess
-import unittest
-import sys
-import time
-from oeqa.oetest import oeRuntimeTest
-from oeqa.utils.decorators import *
-
-class PingTest(oeRuntimeTest):
-
-    @testcase(964)
-    def test_ping(self):
-        output = ''
-        count = 0
-        endtime = time.time() + 60
-        while count < 5 and time.time() < endtime:
-            proc = subprocess.Popen("ping -c 1 %s" % self.target.ip, shell=True, stdout=subprocess.PIPE)
-            output += proc.communicate()[0].decode("utf-8")
-            if proc.poll() == 0:
-                count += 1
-            else:
-                count = 0
-        self.assertEqual(count, 5, msg = "Expected 5 consecutive replies, got %d.\nping output is:\n%s" % (count,output))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/python.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/python.py
deleted file mode 100644
index 29a231c..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/python.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import unittest
-import os
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasPackage("python-core"):
-        skipModule("No python package in the image")
-
-
-class PythonTest(oeRuntimeTest):
-
-    @classmethod
-    def setUpClass(self):
-        oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.py"), "/tmp/test.py")
-
-    @testcase(1145)
-    def test_python_exists(self):
-        (status, output) = self.target.run('which python')
-        self.assertEqual(status, 0, msg="Python binary not in PATH or not on target.")
-
-    @testcase(965)
-    def test_python_stdout(self):
-        (status, output) = self.target.run('python /tmp/test.py')
-        self.assertEqual(status, 0, msg="Exit status was not 0. Output: %s" % output)
-        self.assertEqual(output, "the value of a is 0.01", msg="Incorrect output: %s" % output)
-
-    @testcase(1146)
-    def test_python_testfile(self):
-        (status, output) = self.target.run('ls /tmp/testfile.python')
-        self.assertEqual(status, 0, msg="Python test file generate failed.")
-
-    @classmethod
-    def tearDownClass(self):
-        oeRuntimeTest.tc.target.run("rm /tmp/test.py /tmp/testfile.python")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/rpm.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/rpm.py
deleted file mode 100644
index 7f514ca..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/rpm.py
+++ /dev/null
@@ -1,120 +0,0 @@
-import unittest
-import os
-import fnmatch
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("package-management"):
-            skipModule("rpm module skipped: target doesn't have package-management in IMAGE_FEATURES")
-    if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
-            skipModule("rpm module skipped: target doesn't have rpm as primary package manager")
-
-
-class RpmBasicTest(oeRuntimeTest):
-
-    @testcase(960)
-    @skipUnlessPassed('test_ssh')
-    def test_rpm_help(self):
-        (status, output) = self.target.run('rpm --help')
-        self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
-
-    @testcase(191)
-    @skipUnlessPassed('test_rpm_help')
-    def test_rpm_query(self):
-        (status, output) = self.target.run('rpm -q rpm')
-        self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
-
-class RpmInstallRemoveTest(oeRuntimeTest):
-
-    @classmethod
-    def setUpClass(self):
-        pkgarch = oeRuntimeTest.tc.d.getVar('TUNE_PKGARCH', True).replace("-", "_")
-        rpmdir = os.path.join(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), "rpm", pkgarch)
-        # pick rpm-doc as a test file to get installed, because it's small and it will always be built for standard targets
-        for f in fnmatch.filter(os.listdir(rpmdir), "rpm-doc-*.%s.rpm" % pkgarch):
-            testrpmfile = f
-        oeRuntimeTest.tc.target.copy_to(os.path.join(rpmdir,testrpmfile), "/tmp/rpm-doc.rpm")
-
-    @testcase(192)
-    @skipUnlessPassed('test_rpm_help')
-    def test_rpm_install(self):
-        (status, output) = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
-        self.assertEqual(status, 0, msg="Failed to install rpm-doc package: %s" % output)
-
-    @testcase(194)
-    @skipUnlessPassed('test_rpm_install')
-    def test_rpm_remove(self):
-        (status,output) = self.target.run('rpm -e rpm-doc')
-        self.assertEqual(status, 0, msg="Failed to remove rpm-doc package: %s" % output)
-
-    @testcase(1096)
-    @skipUnlessPassed('test_ssh')
-    def test_rpm_query_nonroot(self):
-
-        def set_up_test_user(u):
-            (status, output) = self.target.run("id -u %s" % u)
-            if status == 0:
-                pass
-            else:
-                (status, output) = self.target.run("useradd %s" % u)
-                self.assertTrue(status == 0, msg="Failed to create new user: " + output)
-
-        def exec_as_test_user(u):
-            (status, output) = self.target.run("su -c id %s" % u)
-            self.assertTrue("({0})".format(u) in output, msg="Failed to execute as new user")
-            (status, output) = self.target.run("su -c \"rpm -qa\" %s " % u)
-            self.assertEqual(status, 0, msg="status: %s. Cannot run rpm -qa: %s" % (status, output))
-
-        def unset_up_test_user(u):
-            (status, output) = self.target.run("userdel -r %s" % u)
-            self.assertTrue(status == 0, msg="Failed to erase user: %s" % output)
-
-        tuser = 'test1'
-
-        try:
-            set_up_test_user(tuser)
-            exec_as_test_user(tuser)
-        finally:
-            unset_up_test_user(tuser)
-
-    @testcase(195)
-    @skipUnlessPassed('test_rpm_install')
-    def test_check_rpm_install_removal_log_file_size(self):
-        """
-        Summary:     Check rpm install/removal log file size
-        Expected:    There should be some method to keep rpm log in a small size .
-        Product:     BSPs
-        Author:      Alexandru Georgescu <alexandru.c.georgescu@intel.com>
-        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
-        """
-        db_files_cmd = 'ls /var/lib/rpm/__db.*'
-        get_log_size_cmd = "du /var/lib/rpm/log/log.* | awk '{print $1}'"
-
-        # Make sure that some database files are under /var/lib/rpm as '__db.xxx'
-        (status, output) = self.target.run(db_files_cmd)
-        self.assertEqual(0, status, 'Failed to find database files under /var/lib/rpm/ as __db.xxx')
-
-        # Remove the package just in case
-        self.target.run('rpm -e rpm-doc')
-
-        # Install/Remove a package 10 times
-        for i in range(10):
-            (status, output) = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
-            self.assertEqual(0, status, "Failed to install rpm-doc package. Reason: {}".format(output))
-
-            (status, output) = self.target.run('rpm -e rpm-doc')
-            self.assertEqual(0, status, "Failed to remove rpm-doc package. Reason: {}".format(output))
-
-        # Get the size of log file
-        (status, output) = self.target.run(get_log_size_cmd)
-        self.assertEqual(0, status, 'Failed to get the final size of the log file.')
-
-        # Compare each log size
-        for log_file_size in output:
-            self.assertLessEqual(int(log_file_size), 11264,
-                                   'Log file size is greater that expected (~10MB), found {} bytes'.format(log_file_size))
-
-    @classmethod
-    def tearDownClass(self):
-        oeRuntimeTest.tc.target.run('rm -f /tmp/rpm-doc.rpm')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/scanelf.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/scanelf.py
deleted file mode 100644
index 67e02ff..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/scanelf.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import unittest
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasPackage("pax-utils"):
-        skipModule("pax-utils package not installed")
-
-class ScanelfTest(oeRuntimeTest):
-
-    def setUpLocal(self):
-        self.scancmd = 'scanelf --quiet --recursive --mount --ldpath --path'
-
-    @testcase(966)
-    @skipUnlessPassed('test_ssh')
-    def test_scanelf_textrel(self):
-        # print TEXTREL information
-        self.scancmd += " --textrel"
-        (status, output) = self.target.run(self.scancmd)
-        self.assertEqual(output.strip(), "", "\n".join([self.scancmd, output]))
-
-    @testcase(967)
-    @skipUnlessPassed('test_ssh')
-    def test_scanelf_rpath(self):
-        # print RPATH information
-        self.scancmd += " --rpath"
-        (status, output) = self.target.run(self.scancmd)
-        self.assertEqual(output.strip(), "", "\n".join([self.scancmd, output]))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/scp.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/scp.py
deleted file mode 100644
index 48e87d2..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/scp.py
+++ /dev/null
@@ -1,22 +0,0 @@
-import os
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import skipUnlessPassed, testcase
-
-def setUpModule():
-    if not (oeRuntimeTest.hasPackage("dropbear") or oeRuntimeTest.hasPackage("openssh-sshd")):
-        skipModule("No ssh package in image")
-
-class ScpTest(oeRuntimeTest):
-
-    @testcase(220)
-    @skipUnlessPassed('test_ssh')
-    def test_scp_file(self):
-        test_log_dir = oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR", True)
-        test_file_path = os.path.join(test_log_dir, 'test_scp_file')
-        with open(test_file_path, 'w') as test_scp_file:
-            test_scp_file.seek(2 ** 22 - 1)
-            test_scp_file.write(os.linesep)
-        (status, output) = self.target.copy_to(test_file_path, '/tmp/test_scp_file')
-        self.assertEqual(status, 0, msg = "File could not be copied. Output: %s" % output)
-        (status, output) = self.target.run("ls -la /tmp/test_scp_file")
-        self.assertEqual(status, 0, msg = "SCP test failed")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/skeletoninit.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/skeletoninit.py
deleted file mode 100644
index cb0cb9b..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/skeletoninit.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=284 testcase
-# Note that the image under test must have meta-skeleton layer in bblayers and IMAGE_INSTALL_append = " service" in local.conf
-
-import unittest
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasPackage("service"):
-        skipModule("No service package in image")
-
-
-class SkeletonBasicTest(oeRuntimeTest):
-
-    @skipUnlessPassed('test_ssh')
-    @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image")
-    def test_skeleton_availability(self):
-        (status, output) = self.target.run('ls /etc/init.d/skeleton')
-        self.assertEqual(status, 0, msg = "skeleton init script not found. Output:\n%s " % output)
-        (status, output) =  self.target.run('ls /usr/sbin/skeleton-test')
-        self.assertEqual(status, 0, msg = "skeleton-test not found. Output:\n%s" % output)
-
-    @testcase(284)
-    @skipUnlessPassed('test_skeleton_availability')
-    @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image")
-    def test_skeleton_script(self):
-        output1 = self.target.run("/etc/init.d/skeleton start")[1]
-        (status, output2) = self.target.run(oeRuntimeTest.pscmd + ' | grep [s]keleton-test')
-        self.assertEqual(status, 0, msg = "Skeleton script could not be started:\n%s\n%s" % (output1, output2))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/smart.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/smart.py
deleted file mode 100644
index 6cdb10d..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/smart.py
+++ /dev/null
@@ -1,218 +0,0 @@
-import unittest
-import re
-import oe
-import subprocess
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-from oeqa.utils.httpserver import HTTPService
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("package-management"):
-        skipModule("Image doesn't have package management feature")
-    if not oeRuntimeTest.hasPackage("smartpm"):
-        skipModule("Image doesn't have smart installed")
-    if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
-        skipModule("Rpm is not the primary package manager")
-
-class SmartTest(oeRuntimeTest):
-
-    @skipUnlessPassed('test_smart_help')
-    def smart(self, command, expected = 0):
-        command = 'smart %s' % command
-        status, output = self.target.run(command, 1500)
-        message = os.linesep.join([command, output])
-        self.assertEqual(status, expected, message)
-        self.assertFalse("Cannot allocate memory" in output, message)
-        return output
-
-class SmartBasicTest(SmartTest):
-
-    @testcase(716)
-    @skipUnlessPassed('test_ssh')
-    def test_smart_help(self):
-        self.smart('--help')
-
-    @testcase(968)
-    def test_smart_version(self):
-        self.smart('--version')
-
-    @testcase(721)
-    def test_smart_info(self):
-        self.smart('info python-smartpm')
-
-    @testcase(421)
-    def test_smart_query(self):
-        self.smart('query python-smartpm')
-
-    @testcase(720)
-    def test_smart_search(self):
-        self.smart('search python-smartpm')
-
-    @testcase(722)
-    def test_smart_stats(self):
-        self.smart('stats')
-
-class SmartRepoTest(SmartTest):
-
-    @classmethod
-    def create_index(self, arg):
-        index_cmd = arg
-        try:
-            bb.note("Executing '%s' ..." % index_cmd)
-            result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
-        except subprocess.CalledProcessError as e:
-            return("Index creation command '%s' failed with return code %d:\n%s" %
-                    (e.cmd, e.returncode, e.output.decode("utf-8")))
-        if result:
-            bb.note(result)
-        return None
-
-    @classmethod
-    def setUpClass(self):
-        self.repolist = []
-
-        # Index RPMs
-        rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo")
-        index_cmds = []
-        rpm_dirs_found = False
-        archs = (oeRuntimeTest.tc.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
-        for arch in archs:
-            rpm_dir = os.path.join(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR_RPM', True), arch)
-            idx_path = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR', True), 'rpm', arch)
-            db_path = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR', True), 'rpmdb', arch)
-            if not os.path.isdir(rpm_dir):
-                continue
-            if os.path.exists(db_path):
-                bb.utils.remove(dbpath, True)
-            lockfilename = oeRuntimeTest.tc.d.getVar('DEPLOY_DIR_RPM', True) + "/rpm.lock"
-            lf = bb.utils.lockfile(lockfilename, False)
-            oe.path.copyhardlinktree(rpm_dir, idx_path)
-            # Full indexes overload a 256MB image so reduce the number of rpms
-            # in the feed. Filter to p* since we use the psplash packages and
-            # this leaves some allarch and machine arch packages too.
-            bb.utils.remove(idx_path + "*/[a-oq-z]*.rpm")
-            bb.utils.unlockfile(lf)
-            index_cmds.append("%s --dbpath %s --update -q %s" % (rpm_createrepo, db_path, idx_path))
-            rpm_dirs_found = True
-         # Create repodata¬
-        result = oe.utils.multiprocess_exec(index_cmds, self.create_index)
-        if result:
-            bb.fatal('%s' % ('\n'.join(result)))
-        self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('WORKDIR', True), oeRuntimeTest.tc.target.server_ip)
-        self.repo_server.start()
-
-    @classmethod
-    def tearDownClass(self):
-        self.repo_server.stop()
-        for i in self.repolist:
-            oeRuntimeTest.tc.target.run('smart channel -y --remove '+str(i))
-
-    @testcase(1143)
-    def test_smart_channel(self):
-        self.smart('channel', 1)
-
-    @testcase(719)
-    def test_smart_channel_add(self):
-        image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE', True)
-        deploy_url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, image_pkgtype)
-        pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS', True).replace("-","_").split()
-        for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)):
-            if arch in pkgarchs:
-                self.smart('channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url))
-                self.repolist.append(arch)
-        self.smart('update')
-
-    @testcase(969)
-    def test_smart_channel_help(self):
-        self.smart('channel --help')
-
-    @testcase(970)
-    def test_smart_channel_list(self):
-        self.smart('channel --list')
-
-    @testcase(971)
-    def test_smart_channel_show(self):
-        self.smart('channel --show')
-
-    @testcase(717)
-    def test_smart_channel_rpmsys(self):
-        self.smart('channel --show rpmsys')
-        self.smart('channel --disable rpmsys')
-        self.smart('channel --enable rpmsys')
-
-    @testcase(1144)
-    @skipUnlessPassed('test_smart_channel_add')
-    def test_smart_install(self):
-        self.smart('remove -y psplash-default')
-        self.smart('install -y psplash-default')
-
-    @testcase(728)
-    @skipUnlessPassed('test_smart_install')
-    def test_smart_install_dependency(self):
-        self.smart('remove -y psplash')
-        self.smart('install -y psplash-default')
-
-    @testcase(723)
-    @skipUnlessPassed('test_smart_channel_add')
-    def test_smart_install_from_disk(self):
-        self.smart('remove -y psplash-default')
-        self.smart('download psplash-default')
-        self.smart('install -y ./psplash-default*')
-
-    @testcase(725)
-    @skipUnlessPassed('test_smart_channel_add')
-    def test_smart_install_from_http(self):
-        output = self.smart('download --urls psplash-default')
-        url = re.search('(http://.*/psplash-default.*\.rpm)', output)
-        self.assertTrue(url, msg="Couln't find download url in %s" % output)
-        self.smart('remove -y psplash-default')
-        self.smart('install -y %s' % url.group(0))
-
-    @testcase(729)
-    @skipUnlessPassed('test_smart_install')
-    def test_smart_reinstall(self):
-        self.smart('reinstall -y psplash-default')
-
-    @testcase(727)
-    @skipUnlessPassed('test_smart_channel_add')
-    def test_smart_remote_repo(self):
-        self.smart('update')
-        self.smart('install -y psplash')
-        self.smart('remove -y psplash')
-
-    @testcase(726)
-    def test_smart_local_dir(self):
-        self.target.run('mkdir /tmp/myrpmdir')
-        self.smart('channel --add myrpmdir type=rpm-dir path=/tmp/myrpmdir -y')
-        self.target.run('cd /tmp/myrpmdir')
-        self.smart('download psplash')
-        output = self.smart('channel --list')
-        for i in output.split("\n"):
-            if ("rpmsys" != str(i)) and ("myrpmdir" != str(i)):
-                self.smart('channel --disable '+str(i))
-        self.target.run('cd $HOME')
-        self.smart('install psplash')
-        for i in output.split("\n"):
-            if ("rpmsys" != str(i)) and ("myrpmdir" != str(i)):
-                self.smart('channel --enable '+str(i))
-        self.smart('channel --remove myrpmdir -y')
-        self.target.run("rm -rf /tmp/myrpmdir")
-
-    @testcase(718)
-    def test_smart_add_rpmdir(self):
-        self.target.run('mkdir /tmp/myrpmdir')
-        self.smart('channel --add myrpmdir type=rpm-dir path=/tmp/myrpmdir -y')
-        self.smart('channel --disable myrpmdir -y')
-        output = self.smart('channel --show myrpmdir')
-        self.assertTrue("disabled = yes" in output, msg="Failed to disable rpm dir")
-        self.smart('channel --enable  myrpmdir -y')
-        output = self.smart('channel --show myrpmdir')
-        self.assertFalse("disabled = yes" in output, msg="Failed to enable rpm dir")
-        self.smart('channel --remove myrpmdir -y')
-        self.target.run("rm -rf /tmp/myrpmdir")
-
-    @testcase(731)
-    @skipUnlessPassed('test_smart_channel_add')
-    def test_smart_remove_package(self):
-        self.smart('install -y psplash')
-        self.smart('remove -y psplash')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/ssh.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/ssh.py
deleted file mode 100644
index 0e76d5d..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/ssh.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import subprocess
-import unittest
-import sys
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not (oeRuntimeTest.hasPackage("dropbear") or oeRuntimeTest.hasPackage("openssh")):
-        skipModule("No ssh package in image")
-
-class SshTest(oeRuntimeTest):
-
-    @testcase(224)
-    @skipUnlessPassed('test_ping')
-    def test_ssh(self):
-        (status, output) = self.target.run('uname -a')
-        self.assertEqual(status, 0, msg="SSH Test failed: %s" % output)
-        (status, output) = self.target.run('cat /etc/masterimage')
-        self.assertEqual(status, 1, msg="This isn't the right image  - /etc/masterimage shouldn't be here %s" % output)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/syslog.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/syslog.py
deleted file mode 100644
index 8f55032..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/syslog.py
+++ /dev/null
@@ -1,52 +0,0 @@
-import unittest
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not (oeRuntimeTest.hasPackage("busybox-syslog") or oeRuntimeTest.hasPackage("sysklogd")):
-        skipModule("No syslog package in image")
-
-class SyslogTest(oeRuntimeTest):
-
-    @testcase(201)
-    def test_syslog_running(self):
-        (status,output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -i [s]yslogd')
-        self.assertEqual(status, 0, msg="no syslogd process, ps output: %s" % self.target.run(oeRuntimeTest.pscmd)[1])
-
-class SyslogTestConfig(oeRuntimeTest):
-
-    @testcase(1149)
-    @skipUnlessPassed("test_syslog_running")
-    def test_syslog_logger(self):
-        (status, output) = self.target.run('logger foobar')
-        self.assertEqual(status, 0, msg="Can't log into syslog. Output: %s " % output)
-
-        (status, output) = self.target.run('grep foobar /var/log/messages')
-        if status != 0:
-            if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", "") == "systemd":
-                (status, output) = self.target.run('journalctl -o cat | grep foobar')
-            else:
-                (status, output) = self.target.run('logread | grep foobar')
-        self.assertEqual(status, 0, msg="Test log string not found in /var/log/messages or logread. Output: %s " % output)
-
-    @testcase(1150)
-    @skipUnlessPassed("test_syslog_running")
-    def test_syslog_restart(self):
-        if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False):
-            (status,output) = self.target.run('/etc/init.d/syslog restart')
-        else:
-            (status,output) = self.target.run('systemctl restart syslog.service')
-
-    @testcase(202)
-    @skipUnlessPassed("test_syslog_restart")
-    @skipUnlessPassed("test_syslog_logger")
-    @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image")
-    @unittest.skipIf(oeRuntimeTest.hasPackage("sysklogd") or not oeRuntimeTest.hasPackage("busybox"), "Non-busybox syslog")
-    def test_syslog_startup_config(self):
-        self.target.run('echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf')
-        (status,output) = self.target.run('/etc/init.d/syslog restart')
-        self.assertEqual(status, 0, msg="Could not restart syslog service. Status and output: %s and %s" % (status,output))
-        (status,output) = self.target.run('logger foobar && grep foobar /var/log/test')
-        self.assertEqual(status, 0, msg="Test log string not found. Output: %s " % output)
-        self.target.run("sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf")
-        self.target.run('/etc/init.d/syslog restart')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/systemd.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/systemd.py
deleted file mode 100644
index 8de799c..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/systemd.py
+++ /dev/null
@@ -1,178 +0,0 @@
-import unittest
-import re
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("systemd"):
-            skipModule("target doesn't have systemd in DISTRO_FEATURES")
-    if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True):
-            skipModule("systemd is not the init manager for this image")
-
-
-class SystemdTest(oeRuntimeTest):
-
-    def systemctl(self, action = '', target = '', expected = 0, verbose = False):
-        command = 'systemctl %s %s' % (action, target)
-        status, output = self.target.run(command)
-        message = '\n'.join([command, output])
-        if status != expected and verbose:
-            message += self.target.run('systemctl status --full %s' % target)[1]
-        self.assertEqual(status, expected, message)
-        return output
-
-    #TODO: use pyjournalctl instead
-    def journalctl(self, args='',l_match_units=[]):
-        """
-        Request for the journalctl output to the current target system
-
-        Arguments:
-        -args, an optional argument pass through argument
-        -l_match_units, an optional list of units to filter the output
-        Returns:
-        -string output of the journalctl command
-        Raises:
-        -AssertionError, on remote commands that fail
-        -ValueError, on a journalctl call with filtering by l_match_units that
-        returned no entries
-        """
-        query_units=""
-        if len(l_match_units):
-            query_units = ['_SYSTEMD_UNIT='+unit for unit in l_match_units]
-            query_units = " ".join(query_units)
-        command = 'journalctl %s %s' %(args, query_units)
-        status, output = self.target.run(command)
-        if status:
-            raise AssertionError("Command '%s' returned non-zero exit \
-                    code %d:\n%s" % (command, status, output))
-        if len(output) == 1 and "-- No entries --" in output:
-            raise ValueError("List of units to match: %s, returned no entries"
-                    % l_match_units)
-        return output
-
-class SystemdBasicTests(SystemdTest):
-
-    @skipUnlessPassed('test_ssh')
-    def test_systemd_basic(self):
-        self.systemctl('--version')
-
-    @testcase(551)
-    @skipUnlessPassed('test_systemd_basic')
-    def test_systemd_list(self):
-        self.systemctl('list-unit-files')
-
-    def settle(self):
-        """
-        Block until systemd has finished activating any units being activated,
-        or until two minutes has elapsed.
-
-        Returns a tuple, either (True, '') if all units have finished
-        activating, or (False, message string) if there are still units
-        activating (generally, failing units that restart).
-        """
-        import time
-        endtime = time.time() + (60 * 2)
-        while True:
-            status, output = self.target.run('systemctl --state=activating')
-            if "0 loaded units listed" in output:
-                return (True, '')
-            if time.time() >= endtime:
-                return (False, output)
-            time.sleep(10)
-
-    @testcase(550)
-    @skipUnlessPassed('test_systemd_basic')
-    def test_systemd_failed(self):
-        settled, output = self.settle()
-        self.assertTrue(settled, msg="Timed out waiting for systemd to settle:\n" + output)
-
-        output = self.systemctl('list-units', '--failed')
-        match = re.search("0 loaded units listed", output)
-        if not match:
-            output += self.systemctl('status --full --failed')
-        self.assertTrue(match, msg="Some systemd units failed:\n%s" % output)
-
-
-class SystemdServiceTests(SystemdTest):
-
-    def check_for_avahi(self):
-        if not self.hasPackage('avahi-daemon'):
-            raise unittest.SkipTest("Testcase dependency not met: need avahi-daemon installed on target")
-
-    @skipUnlessPassed('test_systemd_basic')
-    def test_systemd_status(self):
-        self.check_for_avahi()
-        self.systemctl('status --full', 'avahi-daemon.service')
-
-    @testcase(695)
-    @skipUnlessPassed('test_systemd_status')
-    def test_systemd_stop_start(self):
-        self.check_for_avahi()
-        self.systemctl('stop', 'avahi-daemon.service')
-        self.systemctl('is-active', 'avahi-daemon.service', expected=3, verbose=True)
-        self.systemctl('start','avahi-daemon.service')
-        self.systemctl('is-active', 'avahi-daemon.service', verbose=True)
-
-    @testcase(696)
-    @skipUnlessPassed('test_systemd_basic')
-    def test_systemd_disable_enable(self):
-        self.check_for_avahi()
-        self.systemctl('disable', 'avahi-daemon.service')
-        self.systemctl('is-enabled', 'avahi-daemon.service', expected=1)
-        self.systemctl('enable', 'avahi-daemon.service')
-        self.systemctl('is-enabled', 'avahi-daemon.service')
-
-class SystemdJournalTests(SystemdTest):
-    @skipUnlessPassed('test_ssh')
-    def test_systemd_journal(self):
-        (status, output) = self.target.run('journalctl')
-        self.assertEqual(status, 0, output)
-
-    @skipUnlessPassed('test_systemd_basic')
-    def test_systemd_boot_time(self, systemd_TimeoutStartSec=90):
-        """
-        Get the target boot time from journalctl and log it
-
-        Arguments:
-        -systemd_TimeoutStartSec, an optional argument containing systemd's
-        unit start timeout to compare against
-        """
-
-        # the expression chain that uniquely identifies the time boot message
-        expr_items=["Startup finished","kernel", "userspace","\.$"]
-        try:
-            output = self.journalctl(args="-o cat --reverse")
-        except AssertionError:
-            self.fail("Error occurred while calling journalctl")
-        if not len(output):
-            self.fail("Error, unable to get startup time from systemd journal")
-
-        # check for the regular expression items that match the startup time
-        for line in output.split('\n'):
-            check_match = "".join(re.findall(".*".join(expr_items), line))
-            if check_match: break
-        # put the startup time in the test log
-        if check_match:
-            print("%s" % check_match)
-        else:
-            self.skipTest("Error at obtaining the boot time from journalctl")
-        boot_time_sec = 0
-
-        # get the numeric values from the string and convert them to seconds
-        # same data will be placed in list and string for manipulation
-        l_boot_time = check_match.split(" ")[-2:]
-        s_boot_time = " ".join(l_boot_time)
-        try:
-            # Obtain the minutes it took to boot
-            if l_boot_time[0].endswith('min') and l_boot_time[0][0].isdigit():
-                boot_time_min = s_boot_time.split("min")[0]
-                # convert to seconds and accumulate it
-                boot_time_sec += int(boot_time_min) * 60
-            # Obtain the seconds it took to boot and accumulate
-            boot_time_sec += float(l_boot_time[1].split("s")[0])
-        except ValueError:
-            self.skipTest("Error when parsing time from boot string")
-        #Assert the target boot time against systemd's unit start timeout
-        if boot_time_sec > systemd_TimeoutStartSec:
-            print("Target boot time %s exceeds systemd's TimeoutStartSec %s"\
-                    %(boot_time_sec, systemd_TimeoutStartSec))
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/utils/__init__.py
similarity index 100%
copy from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
copy to import-layers/yocto-poky/meta/lib/oeqa/runtime/utils/__init__.py
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py
new file mode 100644
index 0000000..5af55d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py
@@ -0,0 +1,39 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.utils.buildproject import BuildProject
+
+class TargetBuildProject(BuildProject):
+
+    def __init__(self, target, uri, foldername=None, dl_dir=None):
+        self.target = target
+        self.targetdir = "~/"
+        BuildProject.__init__(self, uri, foldername, dl_dir=dl_dir)
+
+    def download_archive(self):
+        self._download_archive()
+
+        status, output = self.target.copyTo(self.localarchive, self.targetdir)
+        if status:
+            raise Exception('Failed to copy archive to target, '
+                            'output: %s' % output)
+
+        cmd = 'tar xf %s%s -C %s' % (self.targetdir,
+                                     self.archive,
+                                     self.targetdir)
+        status, output = self.target.run(cmd)
+        if status:
+            raise Exception('Failed to extract archive, '
+                            'output: %s' % output)
+
+        # Change targetdir to project folder
+        self.targetdir = self.targetdir + self.fname
+
+    # The timeout parameter of target.run is set to 0
+    # to make the ssh command run with no timeout.
+    def _run(self, cmd):
+        ret = self.target.run(cmd, 0)
+        msg = "Command %s failed with exit code %s: %s" % (cmd, ret[0], ret[1])
+        if ret[0] != 0:
+            raise Exception(msg)
+        return ret[0]
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/x32lib.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/x32lib.py
deleted file mode 100644
index ce5e214..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/x32lib.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import unittest
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-        #check if DEFAULTTUNE is set and it's value is: x86-64-x32
-        defaulttune = oeRuntimeTest.tc.d.getVar("DEFAULTTUNE", True)
-        if "x86-64-x32" not in defaulttune:
-            skipModule("DEFAULTTUNE is not set to x86-64-x32")
-
-class X32libTest(oeRuntimeTest):
-
-    @testcase(281)
-    @skipUnlessPassed("test_ssh")
-    def test_x32_file(self):
-        status1 = self.target.run("readelf -h /bin/ls | grep Class | grep ELF32")[0]
-        status2 = self.target.run("readelf -h /bin/ls | grep Machine | grep X86-64")[0]
-        self.assertTrue(status1 == 0 and status2 == 0, msg="/bin/ls isn't an X86-64 ELF32 binary. readelf says: %s" % self.target.run("readelf -h /bin/ls")[1])
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/xorg.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/xorg.py
deleted file mode 100644
index 12bcd37..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/runtime/xorg.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import unittest
-from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeRuntimeTest.hasFeature("x11-base"):
-            skipModule("target doesn't have x11 in IMAGE_FEATURES")
-
-
-class XorgTest(oeRuntimeTest):
-
-    @testcase(1151)
-    @skipUnlessPassed('test_ssh')
-    def test_xorg_running(self):
-        (status, output) = self.target.run(oeRuntimeTest.pscmd + ' |  grep -v xinit | grep [X]org')
-        self.assertEqual(status, 0, msg="Xorg does not appear to be running %s" % self.target.run(oeRuntimeTest.pscmd)[1])
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/__init__.py
index 4cf3fa7..e69de29 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/sdk/__init__.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/__init__.py
@@ -1,3 +0,0 @@
-# Enable other layers to have tests in the same named directory
-from pkgutil import extend_path
-__path__ = extend_path(__path__, __name__)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildcvs.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildcvs.py
deleted file mode 100644
index c7146fa..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildcvs.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from oeqa.oetest import oeSDKTest, skipModule
-from oeqa.utils.decorators import *
-from oeqa.utils.targetbuild import SDKBuildProject
-
-class BuildCvsTest(oeSDKTest):
-
-    @classmethod
-    def setUpClass(self):
-        self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/cvs/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
-                        "http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/cvs-1.12.13.tar.bz2")
-        self.project.download_archive()
-
-    def test_cvs(self):
-        self.assertEqual(self.project.run_configure(), 0,
-                        msg="Running configure failed")
-
-        self.assertEqual(self.project.run_make(), 0,
-                        msg="Running make failed")
-
-        self.assertEqual(self.project.run_install(), 0,
-                        msg="Running make install failed")
-
-    @classmethod
-    def tearDownClass(self):
-        self.project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildgalculator.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildgalculator.py
deleted file mode 100644
index dc2fa9c..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildgalculator.py
+++ /dev/null
@@ -1,27 +0,0 @@
-from oeqa.oetest import oeSDKTest, skipModule
-from oeqa.utils.decorators import *
-from oeqa.utils.targetbuild import SDKBuildProject
-
-def setUpModule():
-    if not (oeSDKTest.hasPackage("gtk+3") or oeSDKTest.hasPackage("libgtk-3.0")):
-        skipModule("Image doesn't have gtk+3 in manifest")
-
-class GalculatorTest(oeSDKTest):
-    def test_galculator(self):
-        try:
-            project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/galculator/",
-                                      oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
-                                      "http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2")
-
-            project.download_archive()
-
-            # regenerate configure to get support for --with-libtool-sysroot
-            legacy_preconf=("autoreconf -i -f -I ${OECORE_TARGET_SYSROOT}/usr/share/aclocal -I m4;")
-
-            self.assertEqual(project.run_configure(extra_cmds=legacy_preconf),
-                             0, msg="Running configure failed")
-
-            self.assertEqual(project.run_make(), 0,
-                            msg="Running make failed")
-        finally:
-            project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildiptables.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildiptables.py
deleted file mode 100644
index f0cb8a4..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildiptables.py
+++ /dev/null
@@ -1,26 +0,0 @@
-from oeqa.oetest import oeSDKTest
-from oeqa.utils.decorators import *
-from oeqa.utils.targetbuild import SDKBuildProject
-
-
-class BuildIptablesTest(oeSDKTest):
-
-    @classmethod
-    def setUpClass(self):
-        self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/iptables/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
-                        "http://downloads.yoctoproject.org/mirror/sources/iptables-1.4.13.tar.bz2")
-        self.project.download_archive()
-
-    def test_iptables(self):
-        self.assertEqual(self.project.run_configure(), 0,
-                        msg="Running configure failed")
-
-        self.assertEqual(self.project.run_make(), 0,
-                        msg="Running make failed")
-
-        self.assertEqual(self.project.run_install(), 0,
-                        msg="Running make install failed")
-
-    @classmethod
-    def tearDownClass(self):
-        self.project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/case.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/case.py
new file mode 100644
index 0000000..963aa8d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/case.py
@@ -0,0 +1,12 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import subprocess
+
+from oeqa.core.case import OETestCase
+
+class OESDKTestCase(OETestCase):
+    def _run(self, cmd):
+        return subprocess.check_output(". %s > /dev/null; %s;" % \
+                (self.tc.sdk_env, cmd), shell=True,
+                stderr=subprocess.STDOUT, universal_newlines=True)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/buildcpio.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/buildcpio.py
new file mode 100644
index 0000000..333dc7c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/buildcpio.py
@@ -0,0 +1,33 @@
+import unittest
+from oeqa.sdk.case import OESDKTestCase
+from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
+
+class BuildCpioTest(OESDKTestCase):
+    td_vars = ['DATETIME']
+
+    @classmethod
+    def setUpClass(self):
+        dl_dir = self.td.get('DL_DIR', None)
+
+        self.project = SDKBuildProject(self.tc.sdk_dir + "/cpio/", self.tc.sdk_env,
+                        "https://ftp.gnu.org/gnu/cpio/cpio-2.12.tar.gz",
+                        self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
+        self.project.download_archive()
+
+        machine = self.td.get("MACHINE")
+        if not self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine):
+            raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain")
+
+    def test_cpio(self):
+        self.assertEqual(self.project.run_configure(), 0,
+                        msg="Running configure failed")
+
+        self.assertEqual(self.project.run_make(), 0,
+                        msg="Running make failed")
+
+        self.assertEqual(self.project.run_install(), 0,
+                        msg="Running make install failed")
+
+    @classmethod
+    def tearDownClass(self):
+        self.project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/buildgalculator.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/buildgalculator.py
new file mode 100644
index 0000000..42e8ddb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/buildgalculator.py
@@ -0,0 +1,35 @@
+import unittest
+
+from oeqa.sdk.case import OESDKTestCase
+from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
+
+class GalculatorTest(OESDKTestCase):
+    td_vars = ['DATETIME']
+
+    @classmethod
+    def setUpClass(self):
+        if not (self.tc.hasTargetPackage("gtk+3") or\
+                self.tc.hasTargetPackage("libgtk-3.0")):
+            raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
+
+    def test_galculator(self):
+        dl_dir = self.td.get('DL_DIR', None)
+        project = None
+        try:
+            project = SDKBuildProject(self.tc.sdk_dir + "/galculator/",
+                                      self.tc.sdk_env,
+                                      "http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2",
+                                      self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
+
+            project.download_archive()
+
+            # regenerate configure to get support for --with-libtool-sysroot
+            legacy_preconf=("autoreconf -i -f -I ${OECORE_TARGET_SYSROOT}/usr/share/aclocal -I m4;")
+
+            self.assertEqual(project.run_configure(extra_cmds=legacy_preconf),
+                             0, msg="Running configure failed")
+
+            self.assertEqual(project.run_make(), 0,
+                            msg="Running make failed")
+        finally:
+            project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/buildlzip.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/buildlzip.py
new file mode 100644
index 0000000..2a53b78
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/buildlzip.py
@@ -0,0 +1,35 @@
+import unittest
+from oeqa.sdk.case import OESDKTestCase
+from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
+
+
+class BuildLzipTest(OESDKTestCase):
+    td_vars = ['DATETIME']
+
+    @classmethod
+    def setUpClass(self):
+        dl_dir = self.td.get('DL_DIR', None)
+
+        self.project = SDKBuildProject(self.tc.sdk_dir + "/lzip/", self.tc.sdk_env,
+                        "http://downloads.yoctoproject.org/mirror/sources/lzip-1.19.tar.gz",
+                        self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
+        self.project.download_archive()
+
+        machine = self.td.get("MACHINE")
+
+        if not self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine):
+            raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain")
+
+    def test_lzip(self):
+        self.assertEqual(self.project.run_configure(), 0,
+                        msg="Running configure failed")
+
+        self.assertEqual(self.project.run_make(), 0,
+                        msg="Running make failed")
+
+        self.assertEqual(self.project.run_install(), 0,
+                        msg="Running make install failed")
+
+    @classmethod
+    def tearDownClass(self):
+        self.project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/gcc.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/gcc.py
new file mode 100644
index 0000000..74ad2a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/gcc.py
@@ -0,0 +1,42 @@
+import os
+import shutil
+import unittest
+
+from oeqa.core.utils.path import remove_safe
+from oeqa.sdk.case import OESDKTestCase
+
+class GccCompileTest(OESDKTestCase):
+    td_vars = ['MACHINE']
+
+    @classmethod
+    def setUpClass(self):
+        files = {'test.c' : self.tc.files_dir, 'test.cpp' : self.tc.files_dir,
+                'testsdkmakefile' : self.tc.sdk_files_dir} 
+        for f in files:
+            shutil.copyfile(os.path.join(files[f], f),
+                    os.path.join(self.tc.sdk_dir, f))
+
+    def setUp(self):
+        machine = self.td.get("MACHINE")
+        if not self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine):
+            raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain")
+
+    def test_gcc_compile(self):
+        self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir))
+
+    def test_gpp_compile(self):
+        self._run('$CXX %s/test.c -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir))
+
+    def test_gpp2_compile(self):
+        self._run('$CXX %s/test.cpp -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir))
+
+    def test_make(self):
+        self._run('cd %s; make -f testsdkmakefile' % self.tc.sdk_dir)
+
+    @classmethod
+    def tearDownClass(self):
+        files = [os.path.join(self.tc.sdk_dir, f) \
+                for f in ['test.c', 'test.cpp', 'test.o', 'test',
+                    'testsdkmakefile']]
+        for f in files:
+            remove_safe(f)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/perl.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/perl.py
new file mode 100644
index 0000000..e1bded2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/perl.py
@@ -0,0 +1,27 @@
+import os
+import shutil
+import unittest
+
+from oeqa.core.utils.path import remove_safe
+from oeqa.sdk.case import OESDKTestCase
+
+class PerlTest(OESDKTestCase):
+    @classmethod
+    def setUpClass(self):
+        if not self.tc.hasHostPackage("nativesdk-perl"):
+            raise unittest.SkipTest("No perl package in the SDK")
+
+        for f in ['test.pl']:
+            shutil.copyfile(os.path.join(self.tc.files_dir, f),
+                    os.path.join(self.tc.sdk_dir, f))
+        self.testfile = os.path.join(self.tc.sdk_dir, "test.pl")
+
+    def test_perl_exists(self):
+        self._run('which perl')
+
+    def test_perl_works(self):
+        self._run('perl %s' % self.testfile)
+
+    @classmethod
+    def tearDownClass(self):
+        remove_safe(self.testfile)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/python.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/python.py
new file mode 100644
index 0000000..94a296f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/cases/python.py
@@ -0,0 +1,31 @@
+import os
+import shutil
+import unittest
+
+from oeqa.core.utils.path import remove_safe
+from oeqa.sdk.case import OESDKTestCase
+
+class PythonTest(OESDKTestCase):
+    @classmethod
+    def setUpClass(self):
+        if not self.tc.hasHostPackage("nativesdk-python"):
+            raise unittest.SkipTest("No python package in the SDK")
+
+        for f in ['test.py']:
+            shutil.copyfile(os.path.join(self.tc.files_dir, f),
+                   os.path.join(self.tc.sdk_dir, f))
+
+    def test_python_exists(self):
+        self._run('which python')
+
+    def test_python_stdout(self):
+        output = self._run('python %s/test.py' % self.tc.sdk_dir)
+        self.assertEqual(output.strip(), "the value of a is 0.01", msg="Incorrect output: %s" % output)
+
+    def test_python_testfile(self):
+        self._run('ls /tmp/testfile.python')
+
+    @classmethod
+    def tearDownClass(self):
+        remove_safe("%s/test.py" % self.tc.sdk_dir)
+        remove_safe("/tmp/testfile.python")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/context.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/context.py
new file mode 100644
index 0000000..0189ed8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/context.py
@@ -0,0 +1,133 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import glob
+import re
+
+from oeqa.core.context import OETestContext, OETestContextExecutor
+
+class OESDKTestContext(OETestContext):
+    sdk_files_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")
+
+    def __init__(self, td=None, logger=None, sdk_dir=None, sdk_env=None,
+            target_pkg_manifest=None, host_pkg_manifest=None):
+        super(OESDKTestContext, self).__init__(td, logger)
+
+        self.sdk_dir = sdk_dir
+        self.sdk_env = sdk_env
+        self.target_pkg_manifest = target_pkg_manifest
+        self.host_pkg_manifest = host_pkg_manifest
+
+    def _hasPackage(self, manifest, pkg):
+        for host_pkg in manifest.keys():
+            if re.search(pkg, host_pkg):
+                return True
+        return False
+
+    def hasHostPackage(self, pkg):
+        return self._hasPackage(self.host_pkg_manifest, pkg)
+
+    def hasTargetPackage(self, pkg):
+        return self._hasPackage(self.target_pkg_manifest, pkg)
+
+class OESDKTestContextExecutor(OETestContextExecutor):
+    _context_class = OESDKTestContext
+
+    name = 'sdk'
+    help = 'sdk test component'
+    description = 'executes sdk tests'
+
+    default_cases = [os.path.join(os.path.abspath(os.path.dirname(__file__)),
+            'cases')]
+    default_test_data = None
+
+    def register_commands(self, logger, subparsers):
+        import argparse_oe
+
+        super(OESDKTestContextExecutor, self).register_commands(logger, subparsers)
+
+        sdk_group = self.parser.add_argument_group('sdk options')
+        sdk_group.add_argument('--sdk-env', action='store',
+            help='sdk environment')
+        sdk_group.add_argument('--target-manifest', action='store',
+            help='sdk target manifest')
+        sdk_group.add_argument('--host-manifest', action='store',
+            help='sdk host manifest')
+
+        sdk_dgroup = self.parser.add_argument_group('sdk display options')
+        sdk_dgroup.add_argument('--list-sdk-env', action='store_true',
+            default=False, help='sdk list available environment')
+
+        # XXX this option is required but argparse_oe has a bug handling
+        # required options, seems that don't keep track of already parsed
+        # options
+        sdk_rgroup = self.parser.add_argument_group('sdk required options')
+        sdk_rgroup.add_argument('--sdk-dir', required=False, action='store', 
+            help='sdk installed directory')
+
+    @staticmethod
+    def _load_manifest(manifest):
+        pkg_manifest = {}
+        if manifest:
+            with open(manifest) as f:
+                for line in f:
+                    (pkg, arch, version) = line.strip().split()
+                    pkg_manifest[pkg] = (version, arch)
+
+        return pkg_manifest
+
+    def _process_args(self, logger, args):
+        super(OESDKTestContextExecutor, self)._process_args(logger, args)
+
+        self.tc_kwargs['init']['sdk_dir'] = args.sdk_dir
+        self.tc_kwargs['init']['sdk_env'] = self.sdk_env
+        self.tc_kwargs['init']['target_pkg_manifest'] = \
+                OESDKTestContextExecutor._load_manifest(args.target_manifest)
+        self.tc_kwargs['init']['host_pkg_manifest'] = \
+                OESDKTestContextExecutor._load_manifest(args.host_manifest)
+
+    @staticmethod
+    def _get_sdk_environs(sdk_dir):
+        sdk_env = {}
+
+        environ_pattern = sdk_dir + '/environment-setup-*'
+        full_sdk_env = glob.glob(sdk_dir + '/environment-setup-*')
+        for env in full_sdk_env:
+            m = re.search('environment-setup-(.*)', env)
+            if m:
+                sdk_env[m.group(1)] = env
+
+        return sdk_env
+
+    def _display_sdk_envs(self, log, args, sdk_envs):
+        log("Available SDK environments at directory %s:" \
+                % args.sdk_dir)
+        log("")
+        for env in sdk_envs:
+            log(env)
+
+    def run(self, logger, args):
+        if not args.sdk_dir:
+            raise argparse_oe.ArgumentUsageError("No SDK directory "\
+                   "specified please do, --sdk-dir SDK_DIR", self.name)
+
+        sdk_envs = OESDKTestContextExecutor._get_sdk_environs(args.sdk_dir)
+        if not sdk_envs:
+            raise argparse_oe.ArgumentUsageError("No available SDK "\
+                   "enviroments found at %s" % args.sdk_dir, self.name)
+
+        if args.list_sdk_env:
+            self._display_sdk_envs(logger.info, args, sdk_envs)
+            sys.exit(0)
+
+        if not args.sdk_env in sdk_envs:
+            self._display_sdk_envs(logger.error, args, sdk_envs)
+            raise argparse_oe.ArgumentUsageError("No valid SDK "\
+                   "environment (%s) specified" % args.sdk_env, self.name)
+
+        self.sdk_env = sdk_envs[args.sdk_env]
+        super(OESDKTestContextExecutor, self).run(logger, args)
+
+_executor_class = OESDKTestContextExecutor
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/testsdkmakefile b/import-layers/yocto-poky/meta/lib/oeqa/sdk/files/testsdkmakefile
similarity index 100%
rename from import-layers/yocto-poky/meta/lib/oeqa/runtime/files/testsdkmakefile
rename to import-layers/yocto-poky/meta/lib/oeqa/sdk/files/testsdkmakefile
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/gcc.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/gcc.py
deleted file mode 100644
index 8395b9b..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/sdk/gcc.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import unittest
-import os
-import shutil
-from oeqa.oetest import oeSDKTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    machine = oeSDKTest.tc.d.getVar("MACHINE", True)
-    if not oeSDKTest.hasHostPackage("packagegroup-cross-canadian-" + machine):
-        skipModule("SDK doesn't contain a cross-canadian toolchain")
-
-
-class GccCompileTest(oeSDKTest):
-
-    @classmethod
-    def setUpClass(self):
-        for f in ['test.c', 'test.cpp', 'testsdkmakefile']:
-            shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
-
-    def test_gcc_compile(self):
-        self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
-
-    def test_gpp_compile(self):
-        self._run('$CXX %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
-
-    def test_gpp2_compile(self):
-        self._run('$CXX %s/test.cpp -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
-
-    def test_make(self):
-        self._run('cd %s; make -f testsdkmakefile' % self.tc.sdktestdir)
-
-    @classmethod
-    def tearDownClass(self):
-        files = [self.tc.sdktestdir + f for f in ['test.c', 'test.cpp', 'test.o', 'test', 'testsdkmakefile']]
-        for f in files:
-            bb.utils.remove(f)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/perl.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/perl.py
deleted file mode 100644
index 45f422e..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/sdk/perl.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import unittest
-import os
-import shutil
-from oeqa.oetest import oeSDKTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeSDKTest.hasHostPackage("nativesdk-perl"):
-        skipModule("No perl package in the SDK")
-
-
-class PerlTest(oeSDKTest):
-
-    @classmethod
-    def setUpClass(self):
-        for f in ['test.pl']:
-            shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
-        self.testfile = self.tc.sdktestdir + "test.pl"
-
-    def test_perl_exists(self):
-        self._run('which perl')
-
-    def test_perl_works(self):
-        self._run('perl %s/test.pl' % self.tc.sdktestdir)
-
-    @classmethod
-    def tearDownClass(self):
-        bb.utils.remove("%s/test.pl" % self.tc.sdktestdir)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/python.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/python.py
deleted file mode 100644
index 896fab4..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/sdk/python.py
+++ /dev/null
@@ -1,32 +0,0 @@
-import unittest
-import os
-import shutil
-from oeqa.oetest import oeSDKTest, skipModule
-from oeqa.utils.decorators import *
-
-def setUpModule():
-    if not oeSDKTest.hasHostPackage("nativesdk-python"):
-        skipModule("No python package in the SDK")
-
-
-class PythonTest(oeSDKTest):
-
-    @classmethod
-    def setUpClass(self):
-        for f in ['test.py']:
-            shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
-
-    def test_python_exists(self):
-        self._run('which python')
-
-    def test_python_stdout(self):
-        output = self._run('python %s/test.py' % self.tc.sdktestdir)
-        self.assertEqual(output.strip(), "the value of a is 0.01", msg="Incorrect output: %s" % output)
-
-    def test_python_testfile(self):
-        self._run('ls /tmp/testfile.python')
-
-    @classmethod
-    def tearDownClass(self):
-        bb.utils.remove("%s/test.py" % self.tc.sdktestdir)
-        bb.utils.remove("/tmp/testfile.python")
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/utils/__init__.py
similarity index 100%
copy from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
copy to import-layers/yocto-poky/meta/lib/oeqa/sdk/utils/__init__.py
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
new file mode 100644
index 0000000..4e25114
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import subprocess
+
+from oeqa.utils.buildproject import BuildProject
+
+class SDKBuildProject(BuildProject):
+    def __init__(self, testpath, sdkenv, uri, testlogdir, builddatetime,
+            foldername=None, dl_dir=None):
+        self.sdkenv = sdkenv
+        self.testdir = testpath
+        self.targetdir = testpath
+        os.makedirs(testpath, exist_ok=True)
+        self.datetime = builddatetime
+        self.testlogdir = testlogdir
+        os.makedirs(self.testlogdir, exist_ok=True)
+        self.logfile = os.path.join(self.testlogdir, "sdk_target_log.%s" % self.datetime)
+        BuildProject.__init__(self, uri, foldername, tmpdir=testpath, dl_dir=dl_dir)
+
+    def download_archive(self):
+
+        self._download_archive()
+
+        cmd = 'tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir)
+        subprocess.check_output(cmd, shell=True)
+
+        #Change targetdir to project folder
+        self.targetdir = os.path.join(self.targetdir, self.fname)
+
+    def run_configure(self, configure_args='', extra_cmds=''):
+        return super(SDKBuildProject, self).run_configure(configure_args=(configure_args or '$CONFIGURE_FLAGS'), extra_cmds=extra_cmds)
+
+    def run_install(self, install_args=''):
+        return super(SDKBuildProject, self).run_install(install_args=(install_args or "DESTDIR=%s/../install" % self.targetdir))
+
+    def log(self, msg):
+        if self.logfile:
+            with open(self.logfile, "a") as f:
+               f.write("%s\n" % msg)
+
+    def _run(self, cmd):
+        self.log("Running . %s; " % self.sdkenv + cmd)
+        return subprocess.call(". %s; " % self.sdkenv + cmd, shell=True)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/__init__.py
index 4cf3fa7..e69de29 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/__init__.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/__init__.py
@@ -1,3 +0,0 @@
-# Enable other layers to have tests in the same named directory
-from pkgutil import extend_path
-__path__ = extend_path(__path__, __name__)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/case.py b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/case.py
new file mode 100644
index 0000000..21b7188
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/case.py
@@ -0,0 +1,21 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import subprocess
+
+from oeqa.utils import avoid_paths_in_environ
+from oeqa.sdk.case import OESDKTestCase
+
+class OESDKExtTestCase(OESDKTestCase):
+    def _run(self, cmd):
+        # extensible sdk shows a warning if found bitbake in the path
+        # because can cause contamination, i.e. use devtool from
+        # poky/scripts instead of eSDK one.
+        env = os.environ.copy()
+        paths_to_avoid = ['bitbake/bin', 'poky/scripts']
+        env['PATH'] = avoid_paths_in_environ(paths_to_avoid)
+
+        return subprocess.check_output(". %s > /dev/null;"\
+            " %s;" % (self.tc.sdk_env, cmd), stderr=subprocess.STDOUT,
+            shell=True, env=env, universal_newlines=True)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/cases/devtool.py b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/cases/devtool.py
new file mode 100644
index 0000000..a01bc0b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/cases/devtool.py
@@ -0,0 +1,97 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import shutil
+import subprocess
+
+from oeqa.sdkext.case import OESDKExtTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+
+class DevtoolTest(OESDKExtTestCase):
+    @classmethod
+    def setUpClass(cls):
+        myapp_src = os.path.join(cls.tc.esdk_files_dir, "myapp")
+        cls.myapp_dst = os.path.join(cls.tc.sdk_dir, "myapp")
+        shutil.copytree(myapp_src, cls.myapp_dst)
+
+        myapp_cmake_src = os.path.join(cls.tc.esdk_files_dir, "myapp_cmake")
+        cls.myapp_cmake_dst = os.path.join(cls.tc.sdk_dir, "myapp_cmake")
+        shutil.copytree(myapp_cmake_src, cls.myapp_cmake_dst)
+
+    @classmethod
+    def tearDownClass(cls):
+        shutil.rmtree(cls.myapp_dst)
+        shutil.rmtree(cls.myapp_cmake_dst)
+
+    def _test_devtool_build(self, directory):
+        self._run('devtool add myapp %s' % directory)
+        try:
+            self._run('devtool build myapp')
+        finally:
+            self._run('devtool reset myapp')
+
+    def _test_devtool_build_package(self, directory):
+        self._run('devtool add myapp %s' % directory)
+        try:
+            self._run('devtool package myapp')
+        finally:
+            self._run('devtool reset myapp')
+
+    def test_devtool_location(self):
+        output = self._run('which devtool')
+        self.assertEqual(output.startswith(self.tc.sdk_dir), True, \
+            msg="Seems that devtool isn't the eSDK one: %s" % output)
+
+    @OETestDepends(['test_devtool_location'])
+    def test_devtool_add_reset(self):
+        self._run('devtool add myapp %s' % self.myapp_dst)
+        self._run('devtool reset myapp')
+
+    @OETestID(1605)
+    @OETestDepends(['test_devtool_location'])
+    def test_devtool_build_make(self):
+        self._test_devtool_build(self.myapp_dst)
+
+    @OETestID(1606)
+    @OETestDepends(['test_devtool_location'])
+    def test_devtool_build_esdk_package(self):
+        self._test_devtool_build_package(self.myapp_dst)
+
+    @OETestID(1607)
+    @OETestDepends(['test_devtool_location'])
+    def test_devtool_build_cmake(self):
+        self._test_devtool_build(self.myapp_cmake_dst)
+
+    @OETestID(1608)
+    @OETestDepends(['test_devtool_location'])
+    def test_extend_autotools_recipe_creation(self):
+        req = 'https://github.com/rdfa/librdfa'
+        recipe = "librdfa"
+        self._run('devtool sdk-install libxml2')
+        self._run('devtool add %s %s' % (recipe, req) )
+        try:
+            self._run('devtool build %s' % recipe)
+        finally:
+            self._run('devtool reset %s' % recipe)
+
+    @OETestID(1609)
+    @OETestDepends(['test_devtool_location'])
+    def test_devtool_kernelmodule(self):
+        docfile = 'https://github.com/umlaeute/v4l2loopback.git'
+        recipe = 'v4l2loopback-driver'
+        self._run('devtool add %s %s' % (recipe, docfile) )
+        try:
+            self._run('devtool build %s' % recipe)
+        finally:
+            self._run('devtool reset %s' % recipe)
+
+    @OETestID(1610)
+    @OETestDepends(['test_devtool_location'])
+    def test_recipes_for_nodejs(self):
+        package_nodejs = "npm://registry.npmjs.org;name=winston;version=2.2.0"
+        self._run('devtool add %s ' % package_nodejs)
+        try:
+            self._run('devtool build %s ' % package_nodejs)
+        finally:
+            self._run('devtool reset %s '% package_nodejs)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/cases/sdk_update.py b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/cases/sdk_update.py
new file mode 100644
index 0000000..2f8598b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/cases/sdk_update.py
@@ -0,0 +1,39 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import shutil
+import subprocess
+
+from oeqa.sdkext.case import OESDKExtTestCase
+from oeqa.utils.httpserver import HTTPService
+
+class SdkUpdateTest(OESDKExtTestCase):
+    @classmethod
+    def setUpClass(self):
+        self.publish_dir = os.path.join(self.tc.sdk_dir, 'esdk_publish')
+        if os.path.exists(self.publish_dir):
+            shutil.rmtree(self.publish_dir)
+        os.mkdir(self.publish_dir)
+
+        base_tcname = "%s/%s" % (self.td.get("SDK_DEPLOY", ''),
+            self.td.get("TOOLCHAINEXT_OUTPUTNAME", ''))
+        tcname_new = "%s-new.sh" % base_tcname
+        if not os.path.exists(tcname_new):
+            tcname_new = "%s.sh" % base_tcname
+
+        cmd = 'oe-publish-sdk %s %s' % (tcname_new, self.publish_dir)
+        subprocess.check_output(cmd, shell=True)
+
+        self.http_service = HTTPService(self.publish_dir)
+        self.http_service.start()
+
+        self.http_url = "http://127.0.0.1:%d" % self.http_service.port
+
+    def test_sdk_update_http(self):
+        output = self._run("devtool sdk-update \"%s\"" % self.http_url)
+
+    @classmethod
+    def tearDownClass(self):
+        self.http_service.stop()
+        shutil.rmtree(self.publish_dir)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/context.py b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/context.py
new file mode 100644
index 0000000..65da4c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/context.py
@@ -0,0 +1,29 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+from oeqa.sdk.context import OESDKTestContext, OESDKTestContextExecutor
+
+class OESDKExtTestContext(OESDKTestContext):
+    esdk_files_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")
+
+    # FIXME - We really need to do better mapping of names here, this at
+    # least allows some tests to run
+    def hasHostPackage(self, pkg):
+        # We force a toolchain to be installed into the eSDK even if its minimal
+        if pkg.startswith("packagegroup-cross-canadian-"):
+            return True
+        return self._hasPackage(self.host_pkg_manifest, pkg)
+
+class OESDKExtTestContextExecutor(OESDKTestContextExecutor):
+    _context_class = OESDKExtTestContext
+
+    name = 'esdk'
+    help = 'esdk test component'
+    description = 'executes esdk tests'
+
+    default_cases = OESDKTestContextExecutor.default_cases + \
+            [os.path.join(os.path.abspath(os.path.dirname(__file__)), 'cases')]
+    default_test_data = None
+
+_executor_class = OESDKExtTestContextExecutor
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/devtool.py b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/devtool.py
deleted file mode 100644
index 65f41f6..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/devtool.py
+++ /dev/null
@@ -1,108 +0,0 @@
-import shutil
-import subprocess
-import urllib.request
-from oeqa.oetest import oeSDKExtTest
-from oeqa.utils.decorators import *
-
-class DevtoolTest(oeSDKExtTest):
-    @classmethod
-    def setUpClass(self):
-        self.myapp_src = os.path.join(self.tc.sdkextfilesdir, "myapp")
-        self.myapp_dst = os.path.join(self.tc.sdktestdir, "myapp")
-        shutil.copytree(self.myapp_src, self.myapp_dst)
-
-        self.myapp_cmake_src = os.path.join(self.tc.sdkextfilesdir, "myapp_cmake")
-        self.myapp_cmake_dst = os.path.join(self.tc.sdktestdir, "myapp_cmake")
-        shutil.copytree(self.myapp_cmake_src, self.myapp_cmake_dst)
-
-    def _test_devtool_build(self, directory):
-        self._run('devtool add myapp %s' % directory)
-        try:
-            self._run('devtool build myapp')
-        except Exception as e:
-            print(e.output)
-            self._run('devtool reset myapp')
-            raise e
-        self._run('devtool reset myapp')
-
-    def _test_devtool_build_package(self, directory):
-        self._run('devtool add myapp %s' % directory)
-        try:
-            self._run('devtool package myapp')
-        except Exception as e:
-            print(e.output)
-            self._run('devtool reset myapp')
-            raise e
-        self._run('devtool reset myapp')
-
-    def test_devtool_location(self):
-        output = self._run('which devtool')
-        self.assertEqual(output.startswith(self.tc.sdktestdir), True, \
-            msg="Seems that devtool isn't the eSDK one: %s" % output)
-    
-    @skipUnlessPassed('test_devtool_location')
-    def test_devtool_add_reset(self):
-        self._run('devtool add myapp %s' % self.myapp_dst)
-        self._run('devtool reset myapp')
-    
-    @testcase(1473)
-    @skipUnlessPassed('test_devtool_location')
-    def test_devtool_build_make(self):
-        self._test_devtool_build(self.myapp_dst)
-    
-    @testcase(1474)
-    @skipUnlessPassed('test_devtool_location')
-    def test_devtool_build_esdk_package(self):
-        self._test_devtool_build_package(self.myapp_dst)
-
-    @testcase(1479)
-    @skipUnlessPassed('test_devtool_location')
-    def test_devtool_build_cmake(self):
-        self._test_devtool_build(self.myapp_cmake_dst)
-    
-    @testcase(1482)
-    @skipUnlessPassed('test_devtool_location')
-    def test_extend_autotools_recipe_creation(self):
-        req = 'https://github.com/rdfa/librdfa'
-        recipe = "bbexample"
-        self._run('devtool add %s %s' % (recipe, req) )
-        try:
-            self._run('devtool build %s' % recipe)
-        except Exception as e:
-            print(e.output)
-            self._run('devtool reset %s' % recipe)
-            raise e
-        self._run('devtool reset %s' % recipe)
-
-    @testcase(1484)
-    @skipUnlessPassed('test_devtool_location')
-    def test_devtool_kernelmodule(self):
-        docfile = 'https://github.com/umlaeute/v4l2loopback.git'
-        recipe = 'v4l2loopback-driver'
-        self._run('devtool add %s %s' % (recipe, docfile) )
-        try:
-            self._run('devtool build %s' % recipe)
-        except Exception as e:
-            print(e.output)
-            self._run('devtool reset %s' % recipe)
-            raise e
-        self._run('devtool reset %s' % recipe)
-
-    @testcase(1478)
-    @skipUnlessPassed('test_devtool_location')
-    def test_recipes_for_nodejs(self):
-        package_nodejs = "npm://registry.npmjs.org;name=winston;version=2.2.0"
-        self._run('devtool add %s ' % package_nodejs)
-        try:
-            self._run('devtool build %s ' % package_nodejs)
-        except Exception as e:
-            print(e.output)
-            self._run('devtool reset %s' % package_nodejs)
-            raise e
-        self._run('devtool reset %s '% package_nodejs)
-
-
-    @classmethod
-    def tearDownClass(self):
-        shutil.rmtree(self.myapp_dst)
-        shutil.rmtree(self.myapp_cmake_dst)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/sdk_update.py b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/sdk_update.py
deleted file mode 100644
index 2ade839..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/sdk_update.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import os
-import shutil
-import subprocess
-
-from oeqa.oetest import oeSDKExtTest
-from oeqa.utils.httpserver import HTTPService
-
-class SdkUpdateTest(oeSDKExtTest):
-
-    @classmethod
-    def setUpClass(self):
-        self.publish_dir = os.path.join(self.tc.sdktestdir, 'esdk_publish')
-        if os.path.exists(self.publish_dir):
-            shutil.rmtree(self.publish_dir)
-        os.mkdir(self.publish_dir)
-
-        tcname_new = self.tc.d.expand(
-            "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}-new.sh")
-        if not os.path.exists(tcname_new):
-            tcname_new = self.tc.tcname
-
-        cmd = 'oe-publish-sdk %s %s' % (tcname_new, self.publish_dir)
-        subprocess.check_output(cmd, shell=True)
-
-        self.http_service = HTTPService(self.publish_dir)
-        self.http_service.start()
-
-        self.http_url = "http://127.0.0.1:%d" % self.http_service.port
-
-    def test_sdk_update_http(self):
-        output = self._run("devtool sdk-update \"%s\"" % self.http_url)
-
-    @classmethod
-    def tearDownClass(self):
-        self.http_service.stop()
-        shutil.rmtree(self.publish_dir)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/_toaster.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/_toaster.py
deleted file mode 100644
index 15ea9df..0000000
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/_toaster.py
+++ /dev/null
@@ -1,320 +0,0 @@
-import unittest
-import os
-import sys
-import shlex, subprocess
-import urllib.request, urllib.parse, urllib.error, subprocess, time, getpass, re, json, shlex
-
-import oeqa.utils.ftools as ftools
-from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd
-
-sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../', 'bitbake/lib/toaster')))
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toastermain.settings")
-
-import toastermain.settings
-from django.db.models import Q
-from orm.models import *
-from oeqa.utils.decorators import testcase
-
-class ToasterSetup(oeSelfTest):
-
-    def recipe_parse(self, file_path, var):
-        for line in open(file_path,'r'):
-            if line.find(var) > -1:
-                val = line.split(" = ")[1].replace("\"", "").strip()
-                return val
-
-    def fix_file_path(self, file_path):
-        if ":" in file_path:
-            file_path=file_path.split(":")[2]
-        return file_path
-
-class Toaster_DB_Tests(ToasterSetup):
-
-    # Check if build name is unique - tc_id=795
-    @testcase(795)
-    def test_Build_Unique_Name(self):
-        all_builds = Build.objects.all().count()
-        distinct_builds = Build.objects.values('id').distinct().count()
-        self.assertEqual(distinct_builds, all_builds, msg = 'Build name is not unique')
-
-    # Check if build coocker log path is unique - tc_id=819
-    @testcase(819)
-    def test_Build_Unique_Cooker_Log_Path(self):
-        distinct_path = Build.objects.values('cooker_log_path').distinct().count()
-        total_builds = Build.objects.values('id').count()
-        self.assertEqual(distinct_path, total_builds, msg = 'Build coocker log path is not unique')
-
-    # Check if task order is unique for one build - tc=824
-    @testcase(824)
-    def test_Task_Unique_Order(self):
-        builds = Build.objects.values('id')
-        cnt_err = []
-        for build in builds:
-            total_task_order = Task.objects.filter(build = build['id']).values('order').count()
-            distinct_task_order = Task.objects.filter(build = build['id']).values('order').distinct().count()
-            if (total_task_order != distinct_task_order):
-                cnt_err.append(build['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
-
-    # Check task order sequence for one build - tc=825
-    @testcase(825)
-    def test_Task_Order_Sequence(self):
-        builds = builds = Build.objects.values('id')
-        cnt_err = []
-        for build in builds:
-            tasks = Task.objects.filter(Q(build = build['id']), ~Q(order = None), ~Q(task_name__contains = '_setscene')).values('id', 'order').order_by("order")
-            cnt_tasks = 0
-            for task in tasks:
-                cnt_tasks += 1
-                if (task['order'] != cnt_tasks):
-                    cnt_err.append(task['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
-
-    # Check if disk_io matches the difference between EndTimeIO and StartTimeIO in build stats - tc=828
-    ### this needs to be updated ###
-    #def test_Task_Disk_IO_TC828(self):
-
-    # Check if outcome = 2 (SSTATE) then sstate_result must be 3 (RESTORED) - tc=832
-    @testcase(832)
-    def test_Task_If_Outcome_2_Sstate_Result_Must_Be_3(self):
-        tasks = Task.objects.filter(outcome = 2).values('id', 'sstate_result')
-        cnt_err = []
-        for task in tasks:
-            if (row['sstate_result'] != 3):
-                cnt_err.append(task['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
-
-    # Check if outcome = 1 (COVERED) or 3 (EXISTING) then sstate_result must be 0 (SSTATE_NA) - tc=833
-    @testcase(833)
-    def test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0(self):
-        tasks = Task.objects.filter(outcome__in = (1, 3)).values('id', 'sstate_result')
-        cnt_err = []
-        for task in tasks:
-            if (task['sstate_result'] != 0):
-                cnt_err.append(task['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
-
-    # Check if outcome is 0 (SUCCESS) or 4 (FAILED) then sstate_result must be 0 (NA), 1 (MISS) or 2 (FAILED) - tc=834
-    @testcase(834)
-    def test_Task_If_Outcome_0_4_Sstate_Result_Must_Be_0_1_2(self):
-        tasks = Task.objects.filter(outcome__in = (0, 4)).values('id', 'sstate_result')
-        cnt_err = []
-        for task in tasks:
-            if (task['sstate_result'] not in [0, 1, 2]):
-                cnt_err.append(task['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
-
-    # Check if task_executed = TRUE (1), script_type must be 0 (CODING_NA), 2 (CODING_PYTHON), 3 (CODING_SHELL) - tc=891
-    @testcase(891)
-    def test_Task_If_Task_Executed_True_Script_Type_0_2_3(self):
-        tasks = Task.objects.filter(task_executed = 1).values('id', 'script_type')
-        cnt_err = []
-        for task in tasks:
-            if (task['script_type'] not in [0, 2, 3]):
-                cnt_err.append(task['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
-
-    # Check if task_executed = TRUE (1), outcome must be 0 (SUCCESS) or 4 (FAILED) - tc=836
-    @testcase(836)
-    def test_Task_If_Task_Executed_True_Outcome_0_4(self):
-        tasks = Task.objects.filter(task_executed = 1).values('id', 'outcome')
-        cnt_err = []
-        for task in tasks:
-            if (task['outcome'] not in [0, 4]):
-                cnt_err.append(task['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
-
-    # Check if task_executed = FALSE (0), script_type must be 0 - tc=890
-    @testcase(890)
-    def test_Task_If_Task_Executed_False_Script_Type_0(self):
-        tasks = Task.objects.filter(task_executed = 0).values('id', 'script_type')
-        cnt_err = []
-        for task in tasks:
-            if (task['script_type'] != 0):
-                cnt_err.append(task['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
-
-    # Check if task_executed = FALSE (0) and build outcome = SUCCEEDED (0), task outcome must be 1 (COVERED), 2 (CACHED), 3 (PREBUILT), 5 (EMPTY) - tc=837
-    @testcase(837)
-    def test_Task_If_Task_Executed_False_Outcome_1_2_3_5(self):
-        builds = Build.objects.filter(outcome = 0).values('id')
-        cnt_err = []
-        for build in builds:
-            tasks = Task.objects.filter(build = build['id'], task_executed = 0).values('id', 'outcome')
-            for task in tasks:
-                if (task['outcome'] not in [1, 2, 3, 5]):
-                    cnt_err.append(task['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
-
-    # Key verification - tc=888
-    @testcase(888)
-    def test_Target_Installed_Package(self):
-        rows = Target_Installed_Package.objects.values('id', 'target_id', 'package_id')
-        cnt_err = []
-        for row in rows:
-            target = Target.objects.filter(id = row['target_id']).values('id')
-            package = Package.objects.filter(id = row['package_id']).values('id')
-            if (not target or not package):
-                cnt_err.append(row['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for target installed package id: %s' % cnt_err)
-
-    # Key verification - tc=889
-    @testcase(889)
-    def test_Task_Dependency(self):
-        rows = Task_Dependency.objects.values('id', 'task_id', 'depends_on_id')
-        cnt_err = []
-        for row in rows:
-            task_id = Task.objects.filter(id = row['task_id']).values('id')
-            depends_on_id = Task.objects.filter(id = row['depends_on_id']).values('id')
-            if (not task_id or not depends_on_id):
-                cnt_err.append(row['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task dependency id: %s' % cnt_err)
-
-    # Check if build target file_name is populated only if is_image=true AND orm_build.outcome=0 then if the file exists and its size matches the file_size value
-    ### Need to add the tc in the test run
-    @testcase(1037)
-    def test_Target_File_Name_Populated(self):
-        builds = Build.objects.filter(outcome = 0).values('id')
-        for build in builds:
-            targets = Target.objects.filter(build_id = build['id'], is_image = 1).values('id')
-            for target in targets:
-                target_files = Target_Image_File.objects.filter(target_id = target['id']).values('id', 'file_name', 'file_size')
-                cnt_err = []
-                for file_info in target_files:
-                    target_id = file_info['id']
-                    target_file_name = file_info['file_name']
-                    target_file_size = file_info['file_size']
-                    if (not target_file_name or not target_file_size):
-                        cnt_err.append(target_id)
-                    else:
-                        if (not os.path.exists(target_file_name)):
-                            cnt_err.append(target_id)
-                        else:
-                            if (os.path.getsize(target_file_name) != target_file_size):
-                                cnt_err.append(target_id)
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for target image file id: %s' % cnt_err)
-
-    # Key verification - tc=884
-    @testcase(884)
-    def test_Package_Dependency(self):
-        cnt_err = []
-        deps = Package_Dependency.objects.values('id', 'package_id', 'depends_on_id')
-        for dep in deps:
-            if (dep['package_id'] == dep['depends_on_id']):
-                cnt_err.append(dep['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package dependency id: %s' % cnt_err)
-
-    # Recipe key verification, recipe name does not depends on a recipe having the same name - tc=883
-    @testcase(883)
-    def test_Recipe_Dependency(self):
-        deps = Recipe_Dependency.objects.values('id', 'recipe_id', 'depends_on_id')
-        cnt_err = []
-        for dep in deps:
-            if (not dep['recipe_id'] or not dep['depends_on_id']):
-                cnt_err.append(dep['id'])
-            else:
-                name = Recipe.objects.filter(id = dep['recipe_id']).values('name')
-                dep_name = Recipe.objects.filter(id = dep['depends_on_id']).values('name')
-                if (name == dep_name):
-                    cnt_err.append(dep['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe dependency id: %s' % cnt_err)
-
-    # Check if package name does not start with a number (0-9) - tc=846
-    @testcase(846)
-    def test_Package_Name_For_Number(self):
-        packages = Package.objects.filter(~Q(size = -1)).values('id', 'name')
-        cnt_err = []
-        for package in packages:
-            if (package['name'][0].isdigit() is True):
-                cnt_err.append(package['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
-
-    # Check if package version starts with a number (0-9) - tc=847
-    @testcase(847)
-    def test_Package_Version_Starts_With_Number(self):
-        packages = Package.objects.filter(~Q(size = -1)).values('id', 'version')
-        cnt_err = []
-        for package in packages:
-            if (package['version'][0].isdigit() is False):
-                cnt_err.append(package['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
-
-    # Check if package revision starts with 'r' - tc=848
-    @testcase(848)
-    def test_Package_Revision_Starts_With_r(self):
-        packages = Package.objects.filter(~Q(size = -1)).values('id', 'revision')
-        cnt_err = []
-        for package in packages:
-            if (package['revision'][0].startswith("r") is False):
-                cnt_err.append(package['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
-
-    # Check the validity of the package build_id
-    ### TC must be added in test run
-    @testcase(1038)
-    def test_Package_Build_Id(self):
-        packages = Package.objects.filter(~Q(size = -1)).values('id', 'build_id')
-        cnt_err = []
-        for package in packages:
-            build_id = Build.objects.filter(id = package['build_id']).values('id')
-            if (not build_id):
-                cnt_err.append(package['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
-
-    # Check the validity of package recipe_id
-    ### TC must be added in test run
-    @testcase(1039)
-    def test_Package_Recipe_Id(self):
-        packages = Package.objects.filter(~Q(size = -1)).values('id', 'recipe_id')
-        cnt_err = []
-        for package in packages:
-            recipe_id = Recipe.objects.filter(id = package['recipe_id']).values('id')
-            if (not recipe_id):
-                cnt_err.append(package['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
-
-    # Check if package installed_size field is not null
-    ### TC must be aded in test run
-    @testcase(1040)
-    def test_Package_Installed_Size_Not_NULL(self):
-        packages = Package.objects.filter(installed_size__isnull = True).values('id')
-        cnt_err = []
-        for package in packages:
-            cnt_err.append(package['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
-
-    # Check if all layers requests return exit code is 200 - tc=843
-    @testcase(843)
-    def test_Layers_Requests_Exit_Code(self):
-        layers = Layer.objects.values('id', 'layer_index_url')
-        cnt_err = []
-        for layer in layers:
-            resp = urllib.request.urlopen(layer['layer_index_url'])
-            if (resp.getcode() != 200):
-                cnt_err.append(layer['id'])
-        self.assertEqual(len(cnt_err), 0, msg = 'Errors for layer id: %s' % cnt_err)
-
-    # Check if django server starts regardless of the timezone set on the machine - tc=905
-    @testcase(905)
-    def test_Start_Django_Timezone(self):
-        current_path = os.getcwd()
-        zonefilelist = []
-        ZONEINFOPATH = '/usr/share/zoneinfo/'
-        os.chdir("../bitbake/lib/toaster/")
-        cnt_err = 0
-        for filename in os.listdir(ZONEINFOPATH):
-            if os.path.isfile(os.path.join(ZONEINFOPATH, filename)):
-                zonefilelist.append(filename)
-        for k in range(len(zonefilelist)):
-            if k <= 5:
-                files = zonefilelist[k]
-                os.system("export TZ="+str(files)+"; python manage.py runserver > /dev/null 2>&1 &")
-                time.sleep(3)
-                pid = subprocess.check_output("ps aux | grep '[/u]sr/bin/python manage.py runserver' | awk '{print $2}'", shell = True)
-                if pid:
-                    os.system("kill -9 "+str(pid))
-                else:
-                    cnt_err.append(zonefilelist[k])
-        self.assertEqual(cnt_err, 0, msg = 'Errors django server does not start with timezone: %s' % cnt_err)
-        os.chdir(current_path)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/archiver.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/archiver.py
index f2030c4..7f01c36 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/archiver.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/archiver.py
@@ -1,5 +1,5 @@
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import bitbake, get_bb_var
+from oeqa.utils.commands import bitbake, get_bb_vars
 from oeqa.utils.decorators import testcase
 import glob
 import os
@@ -26,25 +26,94 @@
         features += 'ARCHIVER_MODE[src] = "original"\n'
         features += 'COPYLEFT_PN_INCLUDE = "%s"\n' % include_recipe
         features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % exclude_recipe
-
-        # Update local.conf
         self.write_config(features)
 
-        tmp_dir = get_bb_var('TMPDIR')
-        deploy_dir_src = get_bb_var('DEPLOY_DIR_SRC')
-        target_sys = get_bb_var('TARGET_SYS')
-        src_path = os.path.join(deploy_dir_src, target_sys)
+        bitbake('-c clean %s %s' % (include_recipe, exclude_recipe))
+        bitbake("-c deploy_archives %s %s" % (include_recipe, exclude_recipe))
 
-        # Delete tmp directory
-        shutil.rmtree(tmp_dir)
-
-        # Build core-image-minimal
-        bitbake('core-image-minimal')
+        bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS'])
+        src_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'])
 
         # Check that include_recipe was included
-        is_included = len(glob.glob(src_path + '/%s*' % include_recipe))
-        self.assertEqual(1, is_included, 'Recipe %s was not included.' % include_recipe)
+        included_present = len(glob.glob(src_path + '/%s-*' % include_recipe))
+        self.assertTrue(included_present, 'Recipe %s was not included.' % include_recipe)
 
         # Check that exclude_recipe was excluded
-        is_excluded = len(glob.glob(src_path + '/%s*' % exclude_recipe))
-        self.assertEqual(0, is_excluded, 'Recipe %s was not excluded.' % exclude_recipe)
+        excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe))
+        self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe)
+
+
+    def test_archiver_filters_by_type(self):
+        """
+        Summary:     The archiver is documented to filter on the recipe type.
+        Expected:    1. included recipe type (target) should be included
+                     2. other types should be excluded
+        Product:     oe-core
+        Author:      André Draszik <adraszik@tycoint.com>
+        """
+
+        target_recipe = 'initscripts'
+        native_recipe = 'zlib-native'
+
+        features = 'INHERIT += "archiver"\n'
+        features += 'ARCHIVER_MODE[src] = "original"\n'
+        features += 'COPYLEFT_RECIPE_TYPES = "target"\n'
+        self.write_config(features)
+
+        bitbake('-c clean %s %s' % (target_recipe, native_recipe))
+        bitbake("%s -c deploy_archives %s" % (target_recipe, native_recipe))
+
+        bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS', 'BUILD_SYS'])
+        src_path_target = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'])
+        src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS'])
+
+        # Check that target_recipe was included
+        included_present = len(glob.glob(src_path_target + '/%s-*' % target_recipe))
+        self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipe)
+
+        # Check that native_recipe was excluded
+        excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipe))
+        self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipe)
+
+    def test_archiver_filters_by_type_and_name(self):
+        """
+        Summary:     Test that the archiver archives by recipe type, taking the
+                     recipe name into account.
+        Expected:    1. included recipe type (target) should be included
+                     2. other types should be excluded
+                     3. recipe by name should be included / excluded,
+                        overriding previous decision by type
+        Product:     oe-core
+        Author:      André Draszik <adraszik@tycoint.com>
+        """
+
+        target_recipes = [ 'initscripts', 'zlib' ]
+        native_recipes = [ 'update-rc.d-native', 'zlib-native' ]
+
+        features = 'INHERIT += "archiver"\n'
+        features += 'ARCHIVER_MODE[src] = "original"\n'
+        features += 'COPYLEFT_RECIPE_TYPES = "target"\n'
+        features += 'COPYLEFT_PN_INCLUDE = "%s"\n' % native_recipes[1]
+        features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % target_recipes[1]
+        self.write_config(features)
+
+        bitbake('-c clean %s %s' % (' '.join(target_recipes), ' '.join(native_recipes)))
+        bitbake('-c deploy_archives %s %s' % (' '.join(target_recipes), ' '.join(native_recipes)))
+
+        bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS', 'BUILD_SYS'])
+        src_path_target = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'])
+        src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS'])
+
+        # Check that target_recipe[0] and native_recipes[1] were included
+        included_present = len(glob.glob(src_path_target + '/%s-*' % target_recipes[0]))
+        self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipes[0])
+
+        included_present = len(glob.glob(src_path_native + '/%s-*' % native_recipes[1]))
+        self.assertTrue(included_present, 'Recipe %s was not included.' % native_recipes[1])
+
+        # Check that native_recipes[0] and target_recipes[1] were excluded
+        excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipes[0]))
+        self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipes[0])
+
+        excluded_present = len(glob.glob(src_path_target + '/%s-*' % target_recipes[1]))
+        self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % target_recipes[1])
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/base.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/base.py
index 26c93f9..47a8ea8 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/base.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/base.py
@@ -163,7 +163,7 @@
 
     # remove data from <builddir>/conf/selftest.inc
     def remove_config(self, data):
-        self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_path, data))
+        self.log.debug("Removing from: %s\n%s\n" % (self.testinc_path, data))
         ftools.remove_from_file(self.testinc_path, data)
 
     # write to meta-sefltest/recipes-test/<recipe>/test_recipe.inc
@@ -206,7 +206,7 @@
 
     # remove data from <builddir>/conf/bblayers.inc
     def remove_bblayers_config(self, data):
-        self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_bblayers_path, data))
+        self.log.debug("Removing from: %s\n%s\n" % (self.testinc_bblayers_path, data))
         ftools.remove_from_file(self.testinc_bblayers_path, data)
 
     # write to <builddir>/conf/machine.inc
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/bblayers.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/bblayers.py
index d23675e..cd658c5 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/bblayers.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/bblayers.py
@@ -71,17 +71,12 @@
         result = runCmd('bitbake-layers show-recipes')
         self.assertIn('aspell:', result.output)
         self.assertIn('mtd-utils:', result.output)
-        self.assertIn('linux-yocto:', result.output)
         self.assertIn('core-image-minimal:', result.output)
         result = runCmd('bitbake-layers show-recipes mtd-utils')
         self.assertIn('mtd-utils:', result.output)
         self.assertNotIn('aspell:', result.output)
-        result = runCmd('bitbake-layers show-recipes -i kernel')
-        self.assertIn('linux-yocto:', result.output)
-        self.assertNotIn('mtd-utils:', result.output)
         result = runCmd('bitbake-layers show-recipes -i image')
         self.assertIn('core-image-minimal', result.output)
-        self.assertNotIn('linux-yocto:', result.output)
         self.assertNotIn('mtd-utils:', result.output)
         result = runCmd('bitbake-layers show-recipes -i cmake,pkgconfig')
         self.assertIn('libproxy:', result.output)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py
index 4ce935f..46e09f5 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py
@@ -3,7 +3,7 @@
 
 import oeqa.utils.ftools as ftools
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
 from oeqa.utils.decorators import testcase
 
 class BitbakeTests(oeSelfTest):
@@ -78,9 +78,10 @@
         # test 1 from bug 5875
         test_recipe = 'zlib'
         test_data = "Microsoft Made No Profit From Anyone's Zunes Yo"
-        image_dir = get_bb_var('D', test_recipe)
-        pkgsplit_dir = get_bb_var('PKGDEST', test_recipe)
-        man_dir = get_bb_var('mandir', test_recipe)
+        bb_vars = get_bb_vars(['D', 'PKGDEST', 'mandir'], test_recipe)
+        image_dir = bb_vars['D']
+        pkgsplit_dir = bb_vars['PKGDEST']
+        man_dir = bb_vars['mandir']
 
         bitbake('-c clean %s' % test_recipe)
         bitbake('-c package -f %s' % test_recipe)
@@ -112,17 +113,18 @@
 
     @testcase(167)
     def test_bitbake_g(self):
-        result = bitbake('-g core-image-full-cmdline')
-        for f in ['pn-buildlist', 'pn-depends.dot', 'package-depends.dot', 'task-depends.dot']:
+        result = bitbake('-g core-image-minimal')
+        for f in ['pn-buildlist', 'recipe-depends.dot', 'task-depends.dot']:
             self.addCleanup(os.remove, f)
-        self.assertTrue('NOTE: PN build list saved to \'pn-buildlist\'' in result.output, msg = "No dependency \"pn-buildlist\" file was generated for the given task target. bitbake output: %s" % result.output)
-        self.assertTrue('openssh' in ftools.read_file(os.path.join(self.builddir, 'pn-buildlist')), msg = "No \"openssh\" dependency found in pn-buildlist file.")
+        self.assertTrue('Task dependencies saved to \'task-depends.dot\'' in result.output, msg = "No task dependency \"task-depends.dot\" file was generated for the given task target. bitbake output: %s" % result.output)
+        self.assertTrue('busybox' in ftools.read_file(os.path.join(self.builddir, 'task-depends.dot')), msg = "No \"busybox\" dependency found in task-depends.dot file.")
 
     @testcase(899)
     def test_image_manifest(self):
         bitbake('core-image-minimal')
-        deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-minimal")
-        imagename = get_bb_var("IMAGE_LINK_NAME", target="core-image-minimal")
+        bb_vars = get_bb_vars(["DEPLOY_DIR_IMAGE", "IMAGE_LINK_NAME"], "core-image-minimal")
+        deploydir = bb_vars["DEPLOY_DIR_IMAGE"]
+        imagename = bb_vars["IMAGE_LINK_NAME"]
         manifest = os.path.join(deploydir, imagename + ".manifest")
         self.assertTrue(os.path.islink(manifest), msg="No manifest file created for image. It should have been created in %s" % manifest)
 
@@ -149,19 +151,21 @@
 
     @testcase(171)
     def test_rename_downloaded_file(self):
+        # TODO unique dldir instead of using cleanall
+        # TODO: need to set sstatedir?
         self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
 SSTATE_DIR = \"${TOPDIR}/download-selftest\"
 """)
         self.track_for_cleanup(os.path.join(self.builddir, "download-selftest"))
 
-        data = 'SRC_URI_append = ";downloadfilename=test-aspell.tar.gz"'
+        data = 'SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz;downloadfilename=test-aspell.tar.gz"'
         self.write_recipeinc('aspell', data)
-        bitbake('-ccleanall aspell')
-        result = bitbake('-c fetch aspell', ignore_status=True)
+        result = bitbake('-f -c fetch aspell', ignore_status=True)
         self.delete_recipeinc('aspell')
         self.assertEqual(result.status, 0, msg = "Couldn't fetch aspell. %s" % result.output)
-        self.assertTrue(os.path.isfile(os.path.join(get_bb_var("DL_DIR"), 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % str(get_bb_var("DL_DIR")))
-        self.assertTrue(os.path.isfile(os.path.join(get_bb_var("DL_DIR"), 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % str(get_bb_var("DL_DIR")))
+        dl_dir = get_bb_var("DL_DIR")
+        self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % dl_dir)
+        self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % dl_dir)
 
     @testcase(1028)
     def test_environment(self):
@@ -227,14 +231,12 @@
 
     @testcase(1119)
     def test_non_gplv3(self):
-        data = 'INCOMPATIBLE_LICENSE = "GPLv3"'
-        conf = os.path.join(self.builddir, 'conf/local.conf')
-        ftools.append_file(conf ,data)
-        self.addCleanup(ftools.remove_from_file, conf ,data)
-        result = bitbake('readline', ignore_status=True)
+        self.write_config('INCOMPATIBLE_LICENSE = "GPLv3"')
+        result = bitbake('selftest-ed', ignore_status=True)
         self.assertEqual(result.status, 0, "Bitbake failed, exit code %s, output %s" % (result.status, result.output))
-        self.assertFalse(os.path.isfile(os.path.join(self.builddir, 'tmp/deploy/licenses/readline/generic_GPLv3')))
-        self.assertTrue(os.path.isfile(os.path.join(self.builddir, 'tmp/deploy/licenses/readline/generic_GPLv2')))
+        lic_dir = get_bb_var('LICENSE_DIRECTORY')
+        self.assertFalse(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv3')))
+        self.assertTrue(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv2')))
 
     @testcase(1422)
     def test_setscene_only(self):
@@ -255,8 +257,9 @@
     def test_bbappend_order(self):
         """ Bitbake should bbappend to recipe in a predictable order """
         test_recipe = 'ed'
-        test_recipe_summary_before = get_bb_var('SUMMARY', test_recipe)
-        test_recipe_pv = get_bb_var('PV', test_recipe)
+        bb_vars = get_bb_vars(['SUMMARY', 'PV'], test_recipe)
+        test_recipe_summary_before = bb_vars['SUMMARY']
+        test_recipe_pv = bb_vars['PV']
         recipe_append_file = test_recipe + '_' + test_recipe_pv + '.bbappend'
         expected_recipe_summary = test_recipe_summary_before
 
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildhistory.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildhistory.py
index 674da62..008c39c 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildhistory.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildhistory.py
@@ -3,14 +3,15 @@
 import datetime
 
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import bitbake, get_bb_var
+from oeqa.utils.commands import bitbake, get_bb_vars
 from oeqa.utils.decorators import testcase
 
 
 class BuildhistoryBase(oeSelfTest):
 
     def config_buildhistory(self, tmp_bh_location=False):
-        if (not 'buildhistory' in get_bb_var('USER_CLASSES')) and (not 'buildhistory' in get_bb_var('INHERIT')):
+        bb_vars = get_bb_vars(['USER_CLASSES', 'INHERIT'])
+        if (not 'buildhistory' in bb_vars['USER_CLASSES']) and (not 'buildhistory' in bb_vars['INHERIT']):
             add_buildhistory_config = 'INHERIT += "buildhistory"\nBUILDHISTORY_COMMIT = "1"'
             self.append_config(add_buildhistory_config)
 
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py
index 4754955..a6e0203 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py
@@ -5,7 +5,7 @@
 import tempfile
 from oeqa.selftest.base import oeSelfTest
 from oeqa.selftest.buildhistory import BuildhistoryBase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
 import oeqa.utils.ftools as ftools
 from oeqa.utils.decorators import testcase
 
@@ -16,32 +16,38 @@
         image_pkgtype = get_bb_var("IMAGE_PKGTYPE")
         if image_pkgtype != 'rpm':
             self.skipTest('Not using RPM as main package format')
-        bitbake("-c cleanall core-image-minimal")
+        bitbake("-c clean core-image-minimal")
         self.write_config('INC_RPM_IMAGE_GEN = "1"')
         self.append_config('IMAGE_FEATURES += "ssh-server-openssh"')
         bitbake("core-image-minimal")
         log_data_file = os.path.join(get_bb_var("WORKDIR", "core-image-minimal"), "temp/log.do_rootfs")
         log_data_created = ftools.read_file(log_data_file)
-        incremental_created = re.search("NOTE: load old install solution for incremental install\nNOTE: old install solution not exist\nNOTE: creating new install solution for incremental install(\n.*)*NOTE: Installing the following packages:.*packagegroup-core-ssh-openssh", log_data_created)
+        incremental_created = re.search("Installing  : packagegroup-core-ssh-openssh", log_data_created)
         self.remove_config('IMAGE_FEATURES += "ssh-server-openssh"')
         self.assertTrue(incremental_created, msg = "Match failed in:\n%s" % log_data_created)
         bitbake("core-image-minimal")
         log_data_removed = ftools.read_file(log_data_file)
-        incremental_removed = re.search("NOTE: load old install solution for incremental install\nNOTE: creating new install solution for incremental install(\n.*)*NOTE: incremental removed:.*openssh-sshd-.*", log_data_removed)
+        incremental_removed = re.search("Erasing     : packagegroup-core-ssh-openssh", log_data_removed)
         self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % log_data_removed)
 
     @testcase(286)
     def test_ccache_tool(self):
         bitbake("ccache-native")
-        self.assertTrue(os.path.isfile(os.path.join(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native'), "ccache")), msg = "No ccache found under %s" % str(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native')))
+        bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'ccache-native')
+        p = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] + "/" + "ccache"
+        self.assertTrue(os.path.isfile(p), msg = "No ccache found (%s)" % p)
         self.write_config('INHERIT += "ccache"')
         self.add_command_to_tearDown('bitbake -c clean m4')
         bitbake("m4 -f -c compile")
-        res = runCmd("grep ccache %s" % (os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile")), ignore_status=True)
-        self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile"))
+        log_compile = os.path.join(get_bb_var("WORKDIR","m4"), "temp/log.do_compile")
+        res = runCmd("grep ccache %s" % log_compile, ignore_status=True)
+        self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % log_compile)
 
     @testcase(1435)
     def test_read_only_image(self):
+        distro_features = get_bb_var('DISTRO_FEATURES')
+        if not ('x11' in distro_features and 'opengl' in distro_features):
+            self.skipTest('core-image-sato requires x11 and opengl in distro features')
         self.write_config('IMAGE_FEATURES += "read-only-rootfs"')
         bitbake("core-image-sato")
         # do_image will fail if there are any pending postinsts
@@ -157,7 +163,6 @@
 
     @testcase(294)
     def test_buildhistory_buildtime_pr_backwards(self):
-        self.add_command_to_tearDown('cleanup-workdir')
         target = 'xcursor-transparent-theme'
         error = "ERROR:.*QA Issue: Package version for package %s went backwards which would break package feeds from (.*-r1.* to .*-r0.*)" % target
         self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
@@ -169,11 +174,11 @@
         """
         Test for archiving the work directory and exporting the source files.
         """
-        self.add_command_to_tearDown('cleanup-workdir')
         self.write_config("INHERIT += \"archiver\"\nARCHIVER_MODE[src] = \"original\"\nARCHIVER_MODE[srpm] = \"1\"")
         res = bitbake("xcursor-transparent-theme", ignore_status=True)
         self.assertEqual(res.status, 0, "\nCouldn't build xcursortransparenttheme.\nbitbake output %s" % res.output)
-        pkgs_path = g.glob(str(self.builddir) + "/tmp/deploy/sources/allarch*/xcurs*")
+        deploy_dir_src = get_bb_var('DEPLOY_DIR_SRC')
+        pkgs_path = g.glob(str(deploy_dir_src) + "/allarch*/xcurs*")
         src_file_glob = str(pkgs_path[0]) + "/xcursor*.src.rpm"
         tar_file_glob = str(pkgs_path[0]) + "/xcursor*.tar.gz"
-        self.assertTrue((g.glob(src_file_glob) and g.glob(tar_file_glob)), "Couldn't find .src.rpm and .tar.gz files under tmp/deploy/sources/allarch*/xcursor*")
+        self.assertTrue((g.glob(src_file_glob) and g.glob(tar_file_glob)), "Couldn't find .src.rpm and .tar.gz files under %s/allarch*/xcursor*" % deploy_dir_src)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/containerimage.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/containerimage.py
new file mode 100644
index 0000000..def481f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/containerimage.py
@@ -0,0 +1,83 @@
+import os
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import bitbake, get_bb_vars, runCmd
+
+# This test builds an image with using the "container" IMAGE_FSTYPE, and
+# ensures that then files in the image are only the ones expected.
+#
+# The only package added to the image is container_image_testpkg, which
+# contains one file. However, due to some other things not cleaning up during
+# rootfs creation, there is some cruft. Ideally bugs will be filed and the
+# cruft removed, but for now we whitelist some known set.
+#
+# Also for performance reasons we're only checking the cruft when using ipk.
+# When using deb, and rpm it is a bit different and we could test all
+# of them, but this test is more to catch if other packages get added by
+# default other than what is in ROOTFS_BOOTSTRAP_INSTALL.
+#
+class ContainerImageTests(oeSelfTest):
+
+    # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
+    # the conversion type bar gets added as a dep as well
+    def test_expected_files(self):
+
+        def get_each_path_part(path):
+            if path:
+                part = [ '.' + path + '/' ]
+                result = get_each_path_part(path.rsplit('/', 1)[0])
+                if result:
+                    return part + result
+                else:
+                    return part
+            else:
+                return None
+
+        self.write_config("""PREFERRED_PROVIDER_virtual/kernel = "linux-dummy"
+IMAGE_FSTYPES = "container"
+PACKAGE_CLASSES = "package_ipk"
+IMAGE_FEATURES = ""
+""")
+
+        bbvars = get_bb_vars(['bindir', 'sysconfdir', 'localstatedir',
+                              'DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'],
+                              target='container-test-image')
+        expected_files = [
+                    './',
+                    '.{bindir}/theapp',
+                    '.{sysconfdir}/default/',
+                    '.{sysconfdir}/default/postinst',
+                    '.{sysconfdir}/ld.so.cache',
+                    '.{sysconfdir}/timestamp',
+                    '.{sysconfdir}/version',
+                    './run/',
+                    '.{localstatedir}/cache/',
+                    '.{localstatedir}/cache/ldconfig/',
+                    '.{localstatedir}/cache/ldconfig/aux-cache',
+                    '.{localstatedir}/cache/opkg/',
+                    '.{localstatedir}/lib/',
+                    '.{localstatedir}/lib/opkg/'
+                ]
+
+        expected_files = [ x.format(bindir=bbvars['bindir'],
+                                    sysconfdir=bbvars['sysconfdir'],
+                                    localstatedir=bbvars['localstatedir'])
+                                    for x in expected_files ]
+
+        # Since tar lists all directories individually, make sure each element
+        # from bindir, sysconfdir, etc is added
+        expected_files += get_each_path_part(bbvars['bindir'])
+        expected_files += get_each_path_part(bbvars['sysconfdir'])
+        expected_files += get_each_path_part(bbvars['localstatedir'])
+
+        expected_files = sorted(expected_files)
+
+        # Build the image of course
+        bitbake('container-test-image')
+
+        image = os.path.join(bbvars['DEPLOY_DIR_IMAGE'],
+                             bbvars['IMAGE_LINK_NAME'] + '.tar.bz2')
+
+        # Ensure the files in the image are what we expect
+        result = runCmd("tar tf {} | sort".format(image), shell=True)
+        self.assertEqual(result.output.split('\n'), expected_files)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py
index 302ec5d..5704866 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py
@@ -45,9 +45,12 @@
                 if var and var in checkvars:
                     needvalue = checkvars.pop(var)
                     if needvalue is None:
-                        self.fail('Variable %s should not appear in recipe')
+                        self.fail('Variable %s should not appear in recipe, but value is being set to "%s"' % (var, value))
                     if isinstance(needvalue, set):
-                        value = set(value.split())
+                        if var == 'LICENSE':
+                            value = set(value.split(' & '))
+                        else:
+                            value = set(value.split())
                     self.assertEqual(value, needvalue, 'values for %s do not match' % var)
 
 
@@ -210,9 +213,10 @@
         bitbake('pv -c cleansstate')
         # Test devtool build
         result = runCmd('devtool build pv')
-        installdir = get_bb_var('D', 'pv')
+        bb_vars = get_bb_vars(['D', 'bindir'], 'pv')
+        installdir = bb_vars['D']
         self.assertTrue(installdir, 'Could not query installdir variable')
-        bindir = get_bb_var('bindir', 'pv')
+        bindir = bb_vars['bindir']
         self.assertTrue(bindir, 'Could not query bindir variable')
         if bindir[0] == '/':
             bindir = bindir[1:]
@@ -260,8 +264,6 @@
 
     @testcase(1162)
     def test_devtool_add_library(self):
-        # We don't have the ability to pick up this dependency automatically yet...
-        bitbake('libusb1')
         # Fetch source
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
         self.track_for_cleanup(tempdir)
@@ -290,13 +292,17 @@
         result = runCmd('recipetool setvar %s EXTRA_OECMAKE -- \'-DPYTHON_BINDINGS=OFF -DLIBFTDI_CMAKE_CONFIG_DIR=${datadir}/cmake/Modules\'' % recipefile)
         with open(recipefile, 'a') as f:
             f.write('\nFILES_${PN}-dev += "${datadir}/cmake/Modules"\n')
+            # We don't have the ability to pick up this dependency automatically yet...
+            f.write('\nDEPENDS += "libusb1"\n')
+            f.write('\nTESTLIBOUTPUT = "${COMPONENTS_DIR}/${TUNE_PKGARCH}/${PN}/${libdir}"\n')
         # Test devtool build
         result = runCmd('devtool build libftdi')
-        staging_libdir = get_bb_var('STAGING_LIBDIR', 'libftdi')
-        self.assertTrue(staging_libdir, 'Could not query STAGING_LIBDIR variable')
+        bb_vars = get_bb_vars(['TESTLIBOUTPUT', 'STAMP'], 'libftdi')
+        staging_libdir = bb_vars['TESTLIBOUTPUT']
+        self.assertTrue(staging_libdir, 'Could not query TESTLIBOUTPUT variable')
         self.assertTrue(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), "libftdi binary not found in STAGING_LIBDIR. Output of devtool build libftdi %s" % result.output)
         # Test devtool reset
-        stampprefix = get_bb_var('STAMP', 'libftdi')
+        stampprefix = bb_vars['STAMP']
         result = runCmd('devtool reset libftdi')
         result = runCmd('devtool status')
         self.assertNotIn('libftdi', result.output)
@@ -353,12 +359,11 @@
 
     @testcase(1161)
     def test_devtool_add_fetch_git(self):
-        # Fetch source
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
         self.track_for_cleanup(tempdir)
-        url = 'git://git.yoctoproject.org/libmatchbox'
-        checkrev = '462f0652055d89c648ddd54fd7b03f175c2c6973'
-        testrecipe = 'libmatchbox2'
+        url = 'gitsm://git.yoctoproject.org/mraa'
+        checkrev = 'ae127b19a50aa54255e4330ccfdd9a5d058e581d'
+        testrecipe = 'mraa'
         srcdir = os.path.join(tempdir, testrecipe)
         # Test devtool add
         self.track_for_cleanup(self.workspacedir)
@@ -366,7 +371,7 @@
         self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
         result = runCmd('devtool add %s %s -a -f %s' % (testrecipe, srcdir, url))
         self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created: %s' % result.output)
-        self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure.ac in source directory')
+        self.assertTrue(os.path.isfile(os.path.join(srcdir, 'imraa', 'imraa.c')), 'Unable to find imraa/imraa.c in source directory')
         # Test devtool status
         result = runCmd('devtool status')
         self.assertIn(testrecipe, result.output)
@@ -376,7 +381,7 @@
         self.assertIn('_git.bb', recipefile, 'Recipe file incorrectly named')
         checkvars = {}
         checkvars['S'] = '${WORKDIR}/git'
-        checkvars['PV'] = '1.12+git${SRCPV}'
+        checkvars['PV'] = '1.0+git${SRCPV}'
         checkvars['SRC_URI'] = url
         checkvars['SRCREV'] = '${AUTOREV}'
         self._test_recipe_contents(recipefile, checkvars, [])
@@ -385,7 +390,7 @@
         shutil.rmtree(srcdir)
         url_rev = '%s;rev=%s' % (url, checkrev)
         result = runCmd('devtool add %s %s -f "%s" -V 1.5' % (testrecipe, srcdir, url_rev))
-        self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure.ac in source directory')
+        self.assertTrue(os.path.isfile(os.path.join(srcdir, 'imraa', 'imraa.c')), 'Unable to find imraa/imraa.c in source directory')
         # Test devtool status
         result = runCmd('devtool status')
         self.assertIn(testrecipe, result.output)
@@ -430,9 +435,8 @@
 
     @testcase(1164)
     def test_devtool_modify(self):
-        # Clean up anything in the workdir/sysroot/sstate cache
-        bitbake('mdadm -c cleansstate')
-        # Try modifying a recipe
+        import oe.path
+
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
         self.track_for_cleanup(tempdir)
         self.track_for_cleanup(self.workspacedir)
@@ -443,35 +447,95 @@
         self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
         matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'mdadm_*.bbappend'))
         self.assertTrue(matches, 'bbappend not created %s' % result.output)
+
         # Test devtool status
         result = runCmd('devtool status')
         self.assertIn('mdadm', result.output)
         self.assertIn(tempdir, result.output)
-        # Check git repo
         self._check_src_repo(tempdir)
-        # Try building
-        bitbake('mdadm')
-        # Try making (minor) modifications to the source
-        result = runCmd("sed -i 's!^\.TH.*!.TH MDADM 8 \"\" v9.999-custom!' %s" % os.path.join(tempdir, 'mdadm.8.in'))
-        bitbake('mdadm -c package')
-        pkgd = get_bb_var('PKGD', 'mdadm')
+
+        bitbake('mdadm -C unpack')
+
+        def check_line(checkfile, expected, message, present=True):
+            # Check for $expected, on a line on its own, in checkfile.
+            with open(checkfile, 'r') as f:
+                if present:
+                    self.assertIn(expected + '\n', f, message)
+                else:
+                    self.assertNotIn(expected + '\n', f, message)
+
+        modfile = os.path.join(tempdir, 'mdadm.8.in')
+        bb_vars = get_bb_vars(['PKGD', 'mandir'], 'mdadm')
+        pkgd = bb_vars['PKGD']
         self.assertTrue(pkgd, 'Could not query PKGD variable')
-        mandir = get_bb_var('mandir', 'mdadm')
+        mandir = bb_vars['mandir']
         self.assertTrue(mandir, 'Could not query mandir variable')
-        if mandir[0] == '/':
-            mandir = mandir[1:]
-        with open(os.path.join(pkgd, mandir, 'man8', 'mdadm.8'), 'r') as f:
-            for line in f:
-                if line.startswith('.TH'):
-                    self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified. man searched file path: %s' % os.path.join(pkgd, mandir, 'man8', 'mdadm.8'))
-        # Test devtool reset
-        stampprefix = get_bb_var('STAMP', 'mdadm')
+        manfile = oe.path.join(pkgd, mandir, 'man8', 'mdadm.8')
+
+        check_line(modfile, 'Linux Software RAID', 'Could not find initial string')
+        check_line(modfile, 'antique pin sardine', 'Unexpectedly found replacement string', present=False)
+
+        result = runCmd("sed -i 's!^Linux Software RAID$!antique pin sardine!' %s" % modfile)
+        check_line(modfile, 'antique pin sardine', 'mdadm.8.in file not modified (sed failed)')
+
+        bitbake('mdadm -c package')
+        check_line(manfile, 'antique pin sardine', 'man file not modified. man searched file path: %s' % manfile)
+
+        result = runCmd('git checkout -- %s' % modfile, cwd=tempdir)
+        check_line(modfile, 'Linux Software RAID', 'man .in file not restored (git failed)')
+
+        bitbake('mdadm -c package')
+        check_line(manfile, 'Linux Software RAID', 'man file not updated. man searched file path: %s' % manfile)
+
         result = runCmd('devtool reset mdadm')
         result = runCmd('devtool status')
         self.assertNotIn('mdadm', result.output)
-        self.assertTrue(stampprefix, 'Unable to get STAMP value for recipe mdadm')
-        matches = glob.glob(stampprefix + '*')
-        self.assertFalse(matches, 'Stamp files exist for recipe mdadm that should have been cleaned')
+
+    def test_devtool_buildclean(self):
+        def assertFile(path, *paths):
+            f = os.path.join(path, *paths)
+            self.assertTrue(os.path.exists(f), "%r does not exist" % f)
+        def assertNoFile(path, *paths):
+            f = os.path.join(path, *paths)
+            self.assertFalse(os.path.exists(os.path.join(f)), "%r exists" % f)
+
+        # Clean up anything in the workdir/sysroot/sstate cache
+        bitbake('mdadm m4 -c cleansstate')
+        # Try modifying a recipe
+        tempdir_mdadm = tempfile.mkdtemp(prefix='devtoolqa')
+        tempdir_m4 = tempfile.mkdtemp(prefix='devtoolqa')
+        builddir_m4 = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir_mdadm)
+        self.track_for_cleanup(tempdir_m4)
+        self.track_for_cleanup(builddir_m4)
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        self.add_command_to_tearDown('bitbake -c clean mdadm m4')
+        self.write_recipeinc('m4', 'EXTERNALSRC_BUILD = "%s"\ndo_clean() {\n\t:\n}\n' % builddir_m4)
+        try:
+            runCmd('devtool modify mdadm -x %s' % tempdir_mdadm)
+            runCmd('devtool modify m4 -x %s' % tempdir_m4)
+            assertNoFile(tempdir_mdadm, 'mdadm')
+            assertNoFile(builddir_m4, 'src/m4')
+            result = bitbake('m4 -e')
+            result = bitbake('mdadm m4 -c compile')
+            self.assertEqual(result.status, 0)
+            assertFile(tempdir_mdadm, 'mdadm')
+            assertFile(builddir_m4, 'src/m4')
+            # Check that buildclean task exists and does call make clean
+            bitbake('mdadm m4 -c buildclean')
+            assertNoFile(tempdir_mdadm, 'mdadm')
+            assertNoFile(builddir_m4, 'src/m4')
+            bitbake('mdadm m4 -c compile')
+            assertFile(tempdir_mdadm, 'mdadm')
+            assertFile(builddir_m4, 'src/m4')
+            bitbake('mdadm m4 -c clean')
+            # Check that buildclean task is run before clean for B == S
+            assertNoFile(tempdir_mdadm, 'mdadm')
+            # Check that buildclean task is not run before clean for B != S
+            assertFile(builddir_m4, 'src/m4')
+        finally:
+            self.delete_recipeinc('m4')
 
     @testcase(1166)
     def test_devtool_modify_invalid(self):
@@ -594,8 +658,8 @@
     @testcase(1378)
     def test_devtool_modify_virtual(self):
         # Try modifying a virtual recipe
-        virtrecipe = 'virtual/libx11'
-        realrecipe = 'libx11'
+        virtrecipe = 'virtual/make'
+        realrecipe = 'make'
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
         self.track_for_cleanup(tempdir)
         self.track_for_cleanup(self.workspacedir)
@@ -618,8 +682,9 @@
     def test_devtool_update_recipe(self):
         # Check preconditions
         testrecipe = 'minicom'
-        recipefile = get_bb_var('FILE', testrecipe)
-        src_uri = get_bb_var('SRC_URI', testrecipe)
+        bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+        recipefile = bb_vars['FILE']
+        src_uri = bb_vars['SRC_URI']
         self.assertNotIn('git://', src_uri, 'This test expects the %s recipe to NOT be a git recipe' % testrecipe)
         self._check_repo_status(os.path.dirname(recipefile), [])
         # First, modify a recipe
@@ -650,8 +715,9 @@
     def test_devtool_update_recipe_git(self):
         # Check preconditions
         testrecipe = 'mtd-utils'
-        recipefile = get_bb_var('FILE', testrecipe)
-        src_uri = get_bb_var('SRC_URI', testrecipe)
+        bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+        recipefile = bb_vars['FILE']
+        src_uri = bb_vars['SRC_URI']
         self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
         patches = []
         for entry in src_uri.split():
@@ -670,7 +736,7 @@
         self._check_src_repo(tempdir)
         # Add a couple of commits
         # FIXME: this only tests adding, need to also test update and remove
-        result = runCmd('echo "# Additional line" >> Makefile', cwd=tempdir)
+        result = runCmd('echo "# Additional line" >> Makefile.am', cwd=tempdir)
         result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempdir)
         result = runCmd('echo "A new file" > devtool-new-file', cwd=tempdir)
         result = runCmd('git add devtool-new-file', cwd=tempdir)
@@ -719,8 +785,9 @@
     def test_devtool_update_recipe_append(self):
         # Check preconditions
         testrecipe = 'mdadm'
-        recipefile = get_bb_var('FILE', testrecipe)
-        src_uri = get_bb_var('SRC_URI', testrecipe)
+        bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+        recipefile = bb_vars['FILE']
+        src_uri = bb_vars['SRC_URI']
         self.assertNotIn('git://', src_uri, 'This test expects the %s recipe to NOT be a git recipe' % testrecipe)
         self._check_repo_status(os.path.dirname(recipefile), [])
         # First, modify a recipe
@@ -787,8 +854,9 @@
     def test_devtool_update_recipe_append_git(self):
         # Check preconditions
         testrecipe = 'mtd-utils'
-        recipefile = get_bb_var('FILE', testrecipe)
-        src_uri = get_bb_var('SRC_URI', testrecipe)
+        bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+        recipefile = bb_vars['FILE']
+        src_uri = bb_vars['SRC_URI']
         self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
         for entry in src_uri.split():
             if entry.startswith('git://'):
@@ -807,7 +875,7 @@
         # Check git repo
         self._check_src_repo(tempsrcdir)
         # Add a commit
-        result = runCmd('echo "# Additional line" >> Makefile', cwd=tempsrcdir)
+        result = runCmd('echo "# Additional line" >> Makefile.am', cwd=tempsrcdir)
         result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempsrcdir)
         self.add_command_to_tearDown('cd %s; rm -f %s/*.patch; git checkout .' % (os.path.dirname(recipefile), testrecipe))
         # Create a temporary layer
@@ -887,6 +955,8 @@
         result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
         # Check git repo
         self._check_src_repo(tempdir)
+        # Try building just to ensure we haven't broken that
+        bitbake("%s" % testrecipe)
         # Edit / commit local source
         runCmd('echo "/* Foobar */" >> oe-local-files/makedevs.c', cwd=tempdir)
         runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir)
@@ -943,6 +1013,78 @@
                            ('??', '.*/0001-Add-new-file.patch$')]
         self._check_repo_status(os.path.dirname(recipefile), expected_status)
 
+    def test_devtool_update_recipe_local_files_3(self):
+        # First, modify the recipe
+        testrecipe = 'devtool-test-localonly'
+        bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+        recipefile = bb_vars['FILE']
+        src_uri = bb_vars['SRC_URI']
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        # (don't bother with cleaning the recipe on teardown, we won't be building it)
+        result = runCmd('devtool modify %s' % testrecipe)
+        # Modify one file
+        runCmd('echo "Another line" >> file2', cwd=os.path.join(self.workspacedir, 'sources', testrecipe, 'oe-local-files'))
+        self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+        result = runCmd('devtool update-recipe %s' % testrecipe)
+        expected_status = [(' M', '.*/%s/file2$' % testrecipe)]
+        self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
+    def test_devtool_update_recipe_local_patch_gz(self):
+        # First, modify the recipe
+        testrecipe = 'devtool-test-patch-gz'
+        if get_bb_var('DISTRO') == 'poky-tiny':
+            self.skipTest("The DISTRO 'poky-tiny' does not provide the dependencies needed by %s" % testrecipe)
+        bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+        recipefile = bb_vars['FILE']
+        src_uri = bb_vars['SRC_URI']
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        # (don't bother with cleaning the recipe on teardown, we won't be building it)
+        result = runCmd('devtool modify %s' % testrecipe)
+        # Modify one file
+        srctree = os.path.join(self.workspacedir, 'sources', testrecipe)
+        runCmd('echo "Another line" >> README', cwd=srctree)
+        runCmd('git commit -a --amend --no-edit', cwd=srctree)
+        self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+        result = runCmd('devtool update-recipe %s' % testrecipe)
+        expected_status = [(' M', '.*/%s/readme.patch.gz$' % testrecipe)]
+        self._check_repo_status(os.path.dirname(recipefile), expected_status)
+        patch_gz = os.path.join(os.path.dirname(recipefile), testrecipe, 'readme.patch.gz')
+        result = runCmd('file %s' % patch_gz)
+        if 'gzip compressed data' not in result.output:
+            self.fail('New patch file is not gzipped - file reports:\n%s' % result.output)
+
+    def test_devtool_update_recipe_local_files_subdir(self):
+        # Try devtool extract on a recipe that has a file with subdir= set in
+        # SRC_URI such that it overwrites a file that was in an archive that
+        # was also in SRC_URI
+        # First, modify the recipe
+        testrecipe = 'devtool-test-subdir'
+        bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+        recipefile = bb_vars['FILE']
+        src_uri = bb_vars['SRC_URI']
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        # (don't bother with cleaning the recipe on teardown, we won't be building it)
+        result = runCmd('devtool modify %s' % testrecipe)
+        testfile = os.path.join(self.workspacedir, 'sources', testrecipe, 'testfile')
+        self.assertTrue(os.path.exists(testfile), 'Extracted source could not be found')
+        with open(testfile, 'r') as f:
+            contents = f.read().rstrip()
+        self.assertEqual(contents, 'Modified version', 'File has apparently not been overwritten as it should have been')
+        # Test devtool update-recipe without modifying any files
+        self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+        result = runCmd('devtool update-recipe %s' % testrecipe)
+        expected_status = []
+        self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
     @testcase(1163)
     def test_devtool_extract(self):
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
@@ -960,7 +1102,7 @@
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
         # Try devtool extract
         self.track_for_cleanup(tempdir)
-        result = runCmd('devtool extract virtual/libx11 %s' % tempdir)
+        result = runCmd('devtool extract virtual/make %s' % tempdir)
         self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found')
         # devtool extract shouldn't create the workspace
         self.assertFalse(os.path.exists(self.workspacedir))
@@ -1054,9 +1196,10 @@
             result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
             # Check if it deployed all of the files with the right ownership/perms
             # First look on the host - need to do this under pseudo to get the correct ownership/perms
-            installdir = get_bb_var('D', testrecipe)
-            fakerootenv = get_bb_var('FAKEROOTENV', testrecipe)
-            fakerootcmd = get_bb_var('FAKEROOTCMD', testrecipe)
+            bb_vars = get_bb_vars(['D', 'FAKEROOTENV', 'FAKEROOTCMD'], testrecipe)
+            installdir = bb_vars['D']
+            fakerootenv = bb_vars['FAKEROOTENV']
+            fakerootcmd = bb_vars['FAKEROOTCMD']
             result = runCmd('%s %s find . -type f -exec ls -l {} \;' % (fakerootenv, fakerootcmd), cwd=installdir)
             filelist1 = self._process_ls_output(result.output)
 
@@ -1207,6 +1350,49 @@
         result = runCmd("devtool --quiet selftest-reverse \"%s\"" % s)
         self.assertEqual(result.output, s[::-1])
 
+    def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths):
+        dstdir = basedstdir
+        self.assertTrue(os.path.exists(dstdir))
+        for p in paths:
+            dstdir = os.path.join(dstdir, p)
+            if not os.path.exists(dstdir):
+                os.makedirs(dstdir)
+                self.track_for_cleanup(dstdir)
+        dstfile = os.path.join(dstdir, os.path.basename(srcfile))
+        if srcfile != dstfile:
+            shutil.copy(srcfile, dstfile)
+            self.track_for_cleanup(dstfile)
+
+    def test_devtool_load_plugin(self):
+        """Test that devtool loads only the first found plugin in BBPATH."""
+
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+        devtool = runCmd("which devtool")
+        fromname = runCmd("devtool --quiet pluginfile")
+        srcfile = fromname.output
+        bbpath = get_bb_var('BBPATH')
+        searchpath = bbpath.split(':') + [os.path.dirname(devtool.output)]
+        plugincontent = []
+        with open(srcfile) as fh:
+            plugincontent = fh.readlines()
+        try:
+            self.assertIn('meta-selftest', srcfile, 'wrong bbpath plugin found')
+            for path in searchpath:
+                self._copy_file_with_cleanup(srcfile, path, 'lib', 'devtool')
+            result = runCmd("devtool --quiet count")
+            self.assertEqual(result.output, '1')
+            result = runCmd("devtool --quiet multiloaded")
+            self.assertEqual(result.output, "no")
+            for path in searchpath:
+                result = runCmd("devtool --quiet bbdir")
+                self.assertEqual(result.output, path)
+                os.unlink(os.path.join(result.output, 'lib', 'devtool', 'bbpath.py'))
+        finally:
+            with open(srcfile, 'w') as fh:
+                fh.writelines(plugincontent)
+
     def _setup_test_devtool_finish_upgrade(self):
         # Check preconditions
         self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
@@ -1362,3 +1548,149 @@
         files.remove(foundpatch)
         if files:
             self.fail('Unexpected file(s) copied next to bbappend: %s' % ', '.join(files))
+
+    def test_devtool_rename(self):
+        # Check preconditions
+        self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+        # First run devtool add
+        # We already have this recipe in OE-Core, but that doesn't matter
+        recipename = 'i2c-tools'
+        recipever = '3.1.2'
+        recipefile = os.path.join(self.workspacedir, 'recipes', recipename, '%s_%s.bb' % (recipename, recipever))
+        url = 'http://downloads.yoctoproject.org/mirror/sources/i2c-tools-%s.tar.bz2' % recipever
+        def add_recipe():
+            result = runCmd('devtool add %s' % url)
+            self.assertTrue(os.path.exists(recipefile), 'Expected recipe file not created')
+            self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'sources', recipename)), 'Source directory not created')
+            checkvars = {}
+            checkvars['S'] = None
+            checkvars['SRC_URI'] = url.replace(recipever, '${PV}')
+            self._test_recipe_contents(recipefile, checkvars, [])
+        add_recipe()
+        # Now rename it - change both name and version
+        newrecipename = 'mynewrecipe'
+        newrecipever = '456'
+        newrecipefile = os.path.join(self.workspacedir, 'recipes', newrecipename, '%s_%s.bb' % (newrecipename, newrecipever))
+        result = runCmd('devtool rename %s %s -V %s' % (recipename, newrecipename, newrecipever))
+        self.assertTrue(os.path.exists(newrecipefile), 'Recipe file not renamed')
+        self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipename)), 'Old recipe directory still exists')
+        newsrctree = os.path.join(self.workspacedir, 'sources', newrecipename)
+        self.assertTrue(os.path.exists(newsrctree), 'Source directory not renamed')
+        checkvars = {}
+        checkvars['S'] = '${WORKDIR}/%s-%s' % (recipename, recipever)
+        checkvars['SRC_URI'] = url
+        self._test_recipe_contents(newrecipefile, checkvars, [])
+        # Try again - change just name this time
+        result = runCmd('devtool reset -n %s' % newrecipename)
+        shutil.rmtree(newsrctree)
+        add_recipe()
+        newrecipefile = os.path.join(self.workspacedir, 'recipes', newrecipename, '%s_%s.bb' % (newrecipename, recipever))
+        result = runCmd('devtool rename %s %s' % (recipename, newrecipename))
+        self.assertTrue(os.path.exists(newrecipefile), 'Recipe file not renamed')
+        self.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipename)), 'Old recipe directory still exists')
+        self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'sources', newrecipename)), 'Source directory not renamed')
+        checkvars = {}
+        checkvars['S'] = '${WORKDIR}/%s-${PV}' % recipename
+        checkvars['SRC_URI'] = url.replace(recipever, '${PV}')
+        self._test_recipe_contents(newrecipefile, checkvars, [])
+        # Try again - change just version this time
+        result = runCmd('devtool reset -n %s' % newrecipename)
+        shutil.rmtree(newsrctree)
+        add_recipe()
+        newrecipefile = os.path.join(self.workspacedir, 'recipes', recipename, '%s_%s.bb' % (recipename, newrecipever))
+        result = runCmd('devtool rename %s -V %s' % (recipename, newrecipever))
+        self.assertTrue(os.path.exists(newrecipefile), 'Recipe file not renamed')
+        self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'sources', recipename)), 'Source directory no longer exists')
+        checkvars = {}
+        checkvars['S'] = '${WORKDIR}/${BPN}-%s' % recipever
+        checkvars['SRC_URI'] = url
+        self._test_recipe_contents(newrecipefile, checkvars, [])
+
+    @testcase(1577)
+    def test_devtool_virtual_kernel_modify(self):
+        """
+        Summary:        The purpose of this test case is to verify that
+                        devtool modify works correctly when building
+                        the kernel.
+        Dependencies:   NA
+        Steps:          1. Build kernel with bitbake.
+                        2. Save the config file generated.
+                        3. Clean the environment.
+                        4. Use `devtool modify virtual/kernel` to validate following:
+                           4.1 The source is checked out correctly.
+                           4.2 The resulting configuration is the same as
+                               what was get on step 2.
+                           4.3 The Kernel can be build correctly.
+                           4.4 Changes made on the source are reflected on the
+                               subsequent builds.
+                           4.5 Changes on the configuration are reflected on the
+                               subsequent builds
+         Expected:       devtool modify is able to checkout the source of the kernel
+                         and modification to the source and configurations are reflected
+                         when building the kernel.
+         """
+        #Set machine to qemxu86 to be able to modify the kernel and
+        #verify the modification.
+        features = 'MACHINE = "qemux86"\n'
+        self.write_config(features)
+        kernel_provider = get_bb_var('PREFERRED_PROVIDER_virtual/kernel')
+        # Clean up the enviroment
+        bitbake('%s -c clean' % kernel_provider)
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        self.add_command_to_tearDown('bitbake -c clean %s' % kernel_provider)
+        #Step 1
+        #Here is just generated the config file instead of all the kernel to optimize the
+        #time of executing this test case.
+        bitbake('%s -c configure' % kernel_provider)
+        bbconfig = os.path.join(get_bb_var('B', kernel_provider),'.config')
+        buildir= get_bb_var('TOPDIR')
+        #Step 2
+        runCmd('cp %s %s' % (bbconfig, buildir))
+        self.assertTrue(os.path.exists(os.path.join(buildir, '.config')),
+                        'Could not copy .config file from kernel')
+
+        tmpconfig = os.path.join(buildir, '.config')
+        #Step 3
+        bitbake('%s -c clean' % kernel_provider)
+        #Step 4.1
+        runCmd('devtool modify virtual/kernel -x %s' % tempdir)
+        self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')),
+                        'Extracted source could not be found')
+        #Step 4.2
+        configfile = os.path.join(tempdir,'.config')
+        diff = runCmd('diff %s %s' % (tmpconfig, configfile))
+        self.assertEqual(0,diff.status,'Kernel .config file is not the same using bitbake and devtool')
+        #Step 4.3
+        #NOTE: virtual/kernel is mapped to kernel_provider
+        result = runCmd('devtool build %s' % kernel_provider)
+        self.assertEqual(0,result.status,'Cannot build kernel using `devtool build`')
+        kernelfile = os.path.join(get_bb_var('KBUILD_OUTPUT', kernel_provider), 'vmlinux')
+        self.assertTrue(os.path.exists(kernelfile),'Kernel was not build correctly')
+
+        #Modify the kernel source, this is specific for qemux86
+        modfile = os.path.join(tempdir,'arch/x86/boot/header.S')
+        modstring = "use a boot loader - Devtool kernel testing"
+        modapplied = runCmd("sed -i 's/boot loader/%s/' %s" % (modstring, modfile))
+        self.assertEqual(0,modapplied.status,'Modification to %s on kernel source failed' % modfile)
+        #Modify the configuration
+        codeconfigfile = os.path.join(tempdir,'.config.new')
+        modconfopt = "CONFIG_SG_POOL=n"
+        modconf = runCmd("sed -i 's/CONFIG_SG_POOL=y/%s/' %s" % (modconfopt, codeconfigfile))
+        self.assertEqual(0,modconf.status,'Modification to %s failed' % codeconfigfile)
+        #Build again kernel with devtool
+        rebuild = runCmd('devtool build %s' % kernel_provider)
+        self.assertEqual(0,rebuild.status,'Fail to build kernel after modification of source and config')
+        #Step 4.4
+        bzimagename = 'bzImage-' + get_bb_var('KERNEL_VERSION_NAME', kernel_provider)
+        bzimagefile = os.path.join(get_bb_var('D', kernel_provider),'boot', bzimagename)
+        checkmodcode = runCmd("grep '%s' %s" % (modstring, bzimagefile))
+        self.assertEqual(0,checkmodcode.status,'Modification on kernel source failed')
+        #Step 4.5
+        checkmodconfg = runCmd("grep %s %s" % (modconfopt, codeconfigfile))
+        self.assertEqual(0,checkmodconfg.status,'Modification to configuration file failed')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/eSDK.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/eSDK.py
index 9d5c680..1596c6e 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/eSDK.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/eSDK.py
@@ -6,16 +6,15 @@
 import logging
 import subprocess
 import oeqa.utils.ftools as ftools
-from oeqa.utils.decorators import testcase 
+from oeqa.utils.decorators import testcase
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var
-from oeqa.utils.httpserver import HTTPService
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
 
 class oeSDKExtSelfTest(oeSelfTest):
     """
     # Bugzilla Test Plan: 6033
     # This code is planned to be part of the automation for eSDK containig
-    # Install libraries and headers, image generation binary feeds.
+    # Install libraries and headers, image generation binary feeds, sdk-update.
     """
 
     @staticmethod
@@ -24,7 +23,7 @@
         # what environment load oe-selftest, i586, x86_64
         pattern = os.path.join(tmpdir_eSDKQA, 'environment-setup-*')
         return glob.glob(pattern)[0]
-    
+
     @staticmethod
     def run_esdk_cmd(env_eSDK, tmpdir_eSDKQA, cmd, postconfig=None, **options):
         if postconfig:
@@ -47,53 +46,66 @@
     def get_eSDK_toolchain(image):
         pn_task = '%s -c populate_sdk_ext' % image
 
-        sdk_deploy = get_bb_var('SDK_DEPLOY', pn_task)
-        toolchain_name = get_bb_var('TOOLCHAINEXT_OUTPUTNAME', pn_task)
+        bb_vars = get_bb_vars(['SDK_DEPLOY', 'TOOLCHAINEXT_OUTPUTNAME'], pn_task)
+        sdk_deploy = bb_vars['SDK_DEPLOY']
+        toolchain_name = bb_vars['TOOLCHAINEXT_OUTPUTNAME']
         return os.path.join(sdk_deploy, toolchain_name + '.sh')
-    
+
+    @staticmethod
+    def update_configuration(cls, image, tmpdir_eSDKQA, env_eSDK, ext_sdk_path):
+        sstate_dir = os.path.join(os.environ['BUILDDIR'], 'sstate-cache')
+
+        oeSDKExtSelfTest.generate_eSDK(cls.image)
+
+        cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image)
+        runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA))
+
+        cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA)
+
+        sstate_config="""
+SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
+SSTATE_MIRRORS =  "file://.* file://%s/PATH"
+CORE_IMAGE_EXTRA_INSTALL = "perl"
+        """ % sstate_dir
+
+        with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
+            f.write(sstate_config)
 
     @classmethod
     def setUpClass(cls):
-        # Start to serve sstate dir
-        sstate_dir = os.path.join(os.environ['BUILDDIR'], 'sstate-cache')
-        cls.http_service = HTTPService(sstate_dir)
-        cls.http_service.start()
-
-        http_url = "127.0.0.1:%d" % cls.http_service.port
- 
-        image = 'core-image-minimal'
-
         cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
-        oeSDKExtSelfTest.generate_eSDK(image)
+
+        sstate_dir = get_bb_var('SSTATE_DIR')
+
+        cls.image = 'core-image-minimal'
+        oeSDKExtSelfTest.generate_eSDK(cls.image)
 
         # Install eSDK
-        ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(image)
-        runCmd("%s -y -d \"%s\"" % (ext_sdk_path, cls.tmpdir_eSDKQA))
+        cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image)
+        runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA))
 
         cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA)
 
         # Configure eSDK to use sstate mirror from poky
         sstate_config="""
 SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
-SSTATE_MIRRORS =  "file://.* http://%s/PATH"
-        """ % http_url
+SSTATE_MIRRORS =  "file://.* file://%s/PATH"
+            """ % sstate_dir
         with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
             f.write(sstate_config)
 
-      
     @classmethod
     def tearDownClass(cls):
         shutil.rmtree(cls.tmpdir_eSDKQA)
-        cls.http_service.stop()
 
-    @testcase (1471)
+    @testcase (1602)
     def test_install_libraries_headers(self):
         pn_sstate = 'bc'
         bitbake(pn_sstate)
         cmd = "devtool sdk-install %s " % pn_sstate
         oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
-    
-    @testcase(1472)
+
+    @testcase(1603)
     def test_image_generation_binary_feeds(self):
         image = 'core-image-minimal'
         cmd = "devtool build-image %s" % image
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/image_typedep.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/image_typedep.py
new file mode 100644
index 0000000..256142d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/image_typedep.py
@@ -0,0 +1,51 @@
+import os
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import bitbake
+
+class ImageTypeDepTests(oeSelfTest):
+
+    # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
+    # the conversion type bar gets added as a dep as well
+    def test_conversion_typedep_added(self):
+
+        self.write_recipeinc('emptytest', """
+# Try to empty out the default dependency list
+PACKAGE_INSTALL = ""
+DISTRO_EXTRA_RDEPENDS=""
+
+LICENSE = "MIT"
+IMAGE_FSTYPES = "testfstype"
+
+IMAGE_TYPES_MASKED += "testfstype"
+IMAGE_TYPEDEP_testfstype = "tar.bz2"
+
+inherit image
+
+""")
+        # First get the dependency that should exist for bz2, it will look
+        # like CONVERSION_DEPENDS_bz2="somedep"
+        result = bitbake('-e emptytest')
+
+        for line in result.output.split('\n'):
+            if line.startswith('CONVERSION_DEPENDS_bz2'):
+                dep = line.split('=')[1].strip('"')
+                break
+
+        # Now get the dependency task list and check for the expected task
+        # dependency
+        bitbake('-g emptytest')
+
+        taskdependsfile = os.path.join(self.builddir, 'task-depends.dot')
+        dep =  dep + ".do_populate_sysroot"
+        depfound = False
+        expectedline = '"emptytest.do_rootfs" -> "{}"'.format(dep)
+
+        with open(taskdependsfile, "r") as f:
+            for line in f:
+                if line.strip() == expectedline:
+                    depfound = True
+                    break
+
+        if not depfound:
+            raise AssertionError("\"{}\" not found".format(expectedline))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/imagefeatures.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/imagefeatures.py
index d015c49..76896c7 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/imagefeatures.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/imagefeatures.py
@@ -91,9 +91,9 @@
         AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
         """
 
-        features = 'DISTRO_FEATURES_append = " wayland"\n'
-        features += 'CORE_IMAGE_EXTRA_INSTALL += "wayland weston"'
-        self.write_config(features)
+        distro_features = get_bb_var('DISTRO_FEATURES')
+        if not ('opengl' in distro_features and 'wayland' in distro_features):
+            self.skipTest('neither opengl nor wayland present on DISTRO_FEATURES so core-image-weston cannot be built')
 
         # Build a core-image-weston
         bitbake('core-image-weston')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/layerappend.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/layerappend.py
index 4de5034..37bb32c 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/layerappend.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/layerappend.py
@@ -55,7 +55,7 @@
     @testcase(1196)
     def test_layer_appends(self):
         corebase = get_bb_var("COREBASE")
-        stagingdir = get_bb_var("STAGING_DIR_TARGET")
+
         for l in ["0", "1", "2"]:
             layer = os.path.join(corebase, "meta-layertest" + l)
             self.assertFalse(os.path.exists(layer))
@@ -83,6 +83,7 @@
 
         self.layerappend = "BBLAYERS += \"{0}/meta-layertest0 {0}/meta-layertest1 {0}/meta-layertest2\"".format(corebase)
         ftools.append_file(self.builddir + "/conf/bblayers.conf", self.layerappend)
+        stagingdir = get_bb_var("SYSROOT_DESTDIR", "layerappendtest")
         bitbake("layerappendtest")
         data = ftools.read_file(stagingdir + "/appendtest.txt")
         self.assertEqual(data, "Layer 2 test")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/liboe.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/liboe.py
index 35131eb..0b0301d 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/liboe.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/liboe.py
@@ -1,11 +1,16 @@
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import get_bb_var, bitbake, runCmd
+from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake, runCmd
 import oe.path
 import glob
 import os
 import os.path
 
 class LibOE(oeSelfTest):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.tmp_dir = get_bb_var('TMPDIR')
+
     def test_copy_tree_special(self):
         """
         Summary:    oe.path.copytree() should copy files with special character
@@ -14,8 +19,7 @@
         Product:    OE-Core
         Author:     Joshua Lock <joshua.g.lock@intel.com>
         """
-        tmp_dir = get_bb_var('TMPDIR')
-        testloc = oe.path.join(tmp_dir, 'liboetests')
+        testloc = oe.path.join(self.tmp_dir, 'liboetests')
         src = oe.path.join(testloc, 'src')
         dst = oe.path.join(testloc, 'dst')
         bb.utils.mkdirhier(testloc)
@@ -40,8 +44,7 @@
         Product:    OE-Core
         Author:     Joshua Lock <joshua.g.lock@intel.com>
         """
-        tmp_dir = get_bb_var('TMPDIR')
-        testloc = oe.path.join(tmp_dir, 'liboetests')
+        testloc = oe.path.join(self.tmp_dir, 'liboetests')
         src = oe.path.join(testloc, 'src')
         dst = oe.path.join(testloc, 'dst')
         bb.utils.mkdirhier(testloc)
@@ -50,7 +53,11 @@
 
         # ensure we have setfattr available
         bitbake("attr-native")
-        bindir = get_bb_var('STAGING_BINDIR_NATIVE')
+
+        bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'attr-native')
+        destdir = bb_vars['SYSROOT_DESTDIR']
+        bindir = bb_vars['bindir']
+        bindir = destdir + bindir
 
         # create a file with xattr and copy it
         open(oe.path.join(src, testfilename), 'w+b').close()
@@ -70,8 +77,7 @@
         Product:    OE-Core
         Author:     Joshua Lock <joshua.g.lock@intel.com>
         """
-        tmp_dir = get_bb_var('TMPDIR')
-        testloc = oe.path.join(tmp_dir, 'liboetests')
+        testloc = oe.path.join(self.tmp_dir, 'liboetests')
         src = oe.path.join(testloc, 'src')
         dst = oe.path.join(testloc, 'dst')
         bb.utils.mkdirhier(testloc)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/manifest.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/manifest.py
index 44d0404..fe6f949 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/manifest.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/manifest.py
@@ -2,7 +2,7 @@
 import os
 
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import get_bb_var, bitbake
+from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake
 from oeqa.utils.decorators import testcase
 
 class ManifestEntry:
@@ -84,9 +84,10 @@
         try:
             mdir = self.get_dir_from_bb_var('SDK_DEPLOY', self.buildtarget)
             for k in d_target.keys():
+                bb_vars = get_bb_vars(['SDK_NAME', 'SDK_VERSION'], self.buildtarget)
                 mfilename[k] = "{}-toolchain-{}.{}.manifest".format(
-                        get_bb_var("SDK_NAME", self.buildtarget),
-                        get_bb_var("SDK_VERSION", self.buildtarget),
+                        bb_vars['SDK_NAME'],
+                        bb_vars['SDK_VERSION'],
                         k)
                 mpath[k] = os.path.join(mdir, mfilename[k])
                 if not os.path.isfile(mpath[k]):
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/__init__.py
similarity index 100%
copy from import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
copy to import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/__init__.py
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/buildhistory.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/buildhistory.py
new file mode 100644
index 0000000..5ed4b02
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/buildhistory.py
@@ -0,0 +1,88 @@
+import os
+import unittest
+import tempfile
+from git import Repo
+from oeqa.utils.commands import get_bb_var
+from oe.buildhistory_analysis import blob_to_dict, compare_dict_blobs
+
+class TestBlobParsing(unittest.TestCase):
+
+    def setUp(self):
+        import time
+        self.repo_path = tempfile.mkdtemp(prefix='selftest-buildhistory',
+            dir=get_bb_var('TOPDIR'))
+
+        self.repo = Repo.init(self.repo_path)
+        self.test_file = "test"
+        self.var_map = {}
+
+    def tearDown(self):
+        import shutil
+        shutil.rmtree(self.repo_path)
+
+    def commit_vars(self, to_add={}, to_remove = [], msg="A commit message"):
+        if len(to_add) == 0 and len(to_remove) == 0:
+            return
+
+        for k in to_remove:
+            self.var_map.pop(x,None)
+        for k in to_add:
+            self.var_map[k] = to_add[k]
+
+        with open(os.path.join(self.repo_path, self.test_file), 'w') as repo_file:
+            for k in self.var_map:
+                repo_file.write("%s = %s\n" % (k, self.var_map[k]))
+
+        self.repo.git.add("--all")
+        self.repo.git.commit(message=msg)
+
+    def test_blob_to_dict(self):
+        """
+        Test convertion of git blobs to dictionary
+        """
+        valuesmap = { "foo" : "1", "bar" : "2" }
+        self.commit_vars(to_add = valuesmap)
+
+        blob = self.repo.head.commit.tree.blobs[0]
+        self.assertEqual(valuesmap, blob_to_dict(blob),
+            "commit was not translated correctly to dictionary")
+
+    def test_compare_dict_blobs(self):
+        """
+        Test comparisson of dictionaries extracted from git blobs
+        """
+        changesmap = { "foo-2" : ("2", "8"), "bar" : ("","4"), "bar-2" : ("","5")}
+
+        self.commit_vars(to_add = { "foo" : "1", "foo-2" : "2", "foo-3" : "3" })
+        blob1 = self.repo.heads.master.commit.tree.blobs[0]
+
+        self.commit_vars(to_add = { "foo-2" : "8", "bar" : "4", "bar-2" : "5" })
+        blob2 = self.repo.heads.master.commit.tree.blobs[0]
+
+        change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file),
+            blob1, blob2, False, False)
+
+        var_changes = { x.fieldname : (x.oldvalue, x.newvalue) for x in change_records}
+        self.assertEqual(changesmap, var_changes, "Changes not reported correctly")
+
+    def test_compare_dict_blobs_default(self):
+        """
+        Test default values for comparisson of git blob dictionaries
+        """
+        defaultmap = { x : ("default", "1")  for x in ["PKG", "PKGE", "PKGV", "PKGR"]}
+
+        self.commit_vars(to_add = { "foo" : "1" })
+        blob1 = self.repo.heads.master.commit.tree.blobs[0]
+
+        self.commit_vars(to_add = { "PKG" : "1", "PKGE" : "1", "PKGV" : "1", "PKGR" : "1" })
+        blob2 = self.repo.heads.master.commit.tree.blobs[0]
+
+        change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file),
+            blob1, blob2, False, False)
+
+        var_changes = {}
+        for x in change_records:
+            oldvalue = "default" if ("default" in x.oldvalue) else x.oldvalue
+            var_changes[x.fieldname] = (oldvalue, x.newvalue)
+
+        self.assertEqual(defaultmap, var_changes, "Defaults not set properly")
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/test_elf.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/elf.py
similarity index 100%
rename from import-layers/yocto-poky/meta/lib/oe/tests/test_elf.py
rename to import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/elf.py
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/test_license.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/license.py
similarity index 100%
rename from import-layers/yocto-poky/meta/lib/oe/tests/test_license.py
rename to import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/license.py
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/test_path.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/path.py
similarity index 100%
rename from import-layers/yocto-poky/meta/lib/oe/tests/test_path.py
rename to import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/path.py
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/types.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/types.py
new file mode 100644
index 0000000..4fe2746
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/types.py
@@ -0,0 +1,50 @@
+import unittest
+from oe.maketype import create
+
+class TestBooleanType(unittest.TestCase):
+    def test_invalid(self):
+        self.assertRaises(ValueError, create, '', 'boolean')
+        self.assertRaises(ValueError, create, 'foo', 'boolean')
+        self.assertRaises(TypeError, create, object(), 'boolean')
+
+    def test_true(self):
+        self.assertTrue(create('y', 'boolean'))
+        self.assertTrue(create('yes', 'boolean'))
+        self.assertTrue(create('1', 'boolean'))
+        self.assertTrue(create('t', 'boolean'))
+        self.assertTrue(create('true', 'boolean'))
+        self.assertTrue(create('TRUE', 'boolean'))
+        self.assertTrue(create('truE', 'boolean'))
+
+    def test_false(self):
+        self.assertFalse(create('n', 'boolean'))
+        self.assertFalse(create('no', 'boolean'))
+        self.assertFalse(create('0', 'boolean'))
+        self.assertFalse(create('f', 'boolean'))
+        self.assertFalse(create('false', 'boolean'))
+        self.assertFalse(create('FALSE', 'boolean'))
+        self.assertFalse(create('faLse', 'boolean'))
+
+    def test_bool_equality(self):
+        self.assertEqual(create('n', 'boolean'), False)
+        self.assertNotEqual(create('n', 'boolean'), True)
+        self.assertEqual(create('y', 'boolean'), True)
+        self.assertNotEqual(create('y', 'boolean'), False)
+
+class TestList(unittest.TestCase):
+    def assertListEqual(self, value, valid, sep=None):
+        obj = create(value, 'list', separator=sep)
+        self.assertEqual(obj, valid)
+        if sep is not None:
+            self.assertEqual(obj.separator, sep)
+        self.assertEqual(str(obj), obj.separator.join(obj))
+
+    def test_list_nosep(self):
+        testlist = ['alpha', 'beta', 'theta']
+        self.assertListEqual('alpha beta theta', testlist)
+        self.assertListEqual('alpha  beta\ttheta', testlist)
+        self.assertListEqual('alpha', ['alpha'])
+
+    def test_list_usersep(self):
+        self.assertListEqual('foo:bar', ['foo', 'bar'], ':')
+        self.assertListEqual('foo:bar:baz', ['foo', 'bar', 'baz'], ':')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/utils.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/utils.py
new file mode 100644
index 0000000..7deb10f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oelib/utils.py
@@ -0,0 +1,51 @@
+import unittest
+from oe.utils import packages_filter_out_system, trim_version
+
+class TestPackagesFilterOutSystem(unittest.TestCase):
+    def test_filter(self):
+        """
+        Test that oe.utils.packages_filter_out_system works.
+        """
+        try:
+            import bb
+        except ImportError:
+            self.skipTest("Cannot import bb")
+
+        d = bb.data_smart.DataSmart()
+        d.setVar("PN", "foo")
+
+        d.setVar("PACKAGES", "foo foo-doc foo-dev")
+        pkgs = packages_filter_out_system(d)
+        self.assertEqual(pkgs, [])
+
+        d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
+        pkgs = packages_filter_out_system(d)
+        self.assertEqual(pkgs, ["foo-data"])
+
+        d.setVar("PACKAGES", "foo foo-locale-en-gb")
+        pkgs = packages_filter_out_system(d)
+        self.assertEqual(pkgs, [])
+
+        d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
+        pkgs = packages_filter_out_system(d)
+        self.assertEqual(pkgs, ["foo-data"])
+
+
+class TestTrimVersion(unittest.TestCase):
+    def test_version_exception(self):
+        with self.assertRaises(TypeError):
+            trim_version(None, 2)
+        with self.assertRaises(TypeError):
+            trim_version((1, 2, 3), 2)
+
+    def test_num_exception(self):
+        with self.assertRaises(ValueError):
+            trim_version("1.2.3", 0)
+        with self.assertRaises(ValueError):
+            trim_version("1.2.3", -1)
+
+    def test_valid(self):
+        self.assertEqual(trim_version("1.2.3", 1), "1")
+        self.assertEqual(trim_version("1.2.3", 2), "1.2")
+        self.assertEqual(trim_version("1.2.3", 3), "1.2.3")
+        self.assertEqual(trim_version("1.2.3", 4), "1.2.3")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py
index 28345dc..29547f5 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py
@@ -10,38 +10,10 @@
 from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
 from oeqa.utils.decorators import testcase
 
-class TestScripts(oeSelfTest):
-
-    @testcase(300)
-    def test_cleanup_workdir(self):
-        path = os.path.dirname(get_bb_var('WORKDIR', 'gzip'))
-        old_version_recipe = os.path.join(get_bb_var('COREBASE'), 'meta/recipes-extended/gzip/gzip_1.3.12.bb')
-        old_version = '1.3.12'
-        bitbake("-c clean gzip")
-        bitbake("-c clean -b %s" % old_version_recipe)
-
-        if os.path.exists(path):
-            initial_contents = os.listdir(path)
-        else:
-            initial_contents = []
-
-        bitbake('gzip')
-        intermediary_contents = os.listdir(path)
-        bitbake("-b %s" % old_version_recipe)
-        runCmd('cleanup-workdir')
-        remaining_contents = os.listdir(path)
-
-        expected_contents = [x for x in intermediary_contents if x not in initial_contents]
-        remaining_not_expected = [x for x in remaining_contents if x not in expected_contents]
-        self.assertFalse(remaining_not_expected, msg="Not all necessary content has been deleted from %s: %s" % (path, ', '.join(map(str, remaining_not_expected))))
-        expected_not_remaining = [x for x in expected_contents if x not in remaining_contents]
-        self.assertFalse(expected_not_remaining, msg="The script removed extra contents from %s: %s" % (path, ', '.join(map(str, expected_not_remaining))))
-
 class BuildhistoryDiffTests(BuildhistoryBase):
 
     @testcase(295)
     def test_buildhistory_diff(self):
-        self.add_command_to_tearDown('cleanup-workdir')
         target = 'xcursor-transparent-theme'
         self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
         self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/pkgdata.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/pkgdata.py
index 5a63f89..d69c3c8 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/pkgdata.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/pkgdata.py
@@ -6,7 +6,7 @@
 
 import oeqa.utils.ftools as ftools
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
 from oeqa.utils.decorators import testcase
 
 class OePkgdataUtilTests(oeSelfTest):
@@ -16,21 +16,21 @@
         # Ensure we have the right data in pkgdata
         logger = logging.getLogger("selftest")
         logger.info('Running bitbake to generate pkgdata')
-        bitbake('glibc busybox zlib bash')
+        bitbake('busybox zlib m4')
 
     @testcase(1203)
     def test_lookup_pkg(self):
         # Forward tests
-        result = runCmd('oe-pkgdata-util lookup-pkg "glibc busybox"')
-        self.assertEqual(result.output, 'libc6\nbusybox')
+        result = runCmd('oe-pkgdata-util lookup-pkg "zlib busybox"')
+        self.assertEqual(result.output, 'libz1\nbusybox')
         result = runCmd('oe-pkgdata-util lookup-pkg zlib-dev')
         self.assertEqual(result.output, 'libz-dev')
         result = runCmd('oe-pkgdata-util lookup-pkg nonexistentpkg', ignore_status=True)
         self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
         self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
         # Reverse tests
-        result = runCmd('oe-pkgdata-util lookup-pkg -r "libc6 busybox"')
-        self.assertEqual(result.output, 'glibc\nbusybox')
+        result = runCmd('oe-pkgdata-util lookup-pkg -r "libz1 busybox"')
+        self.assertEqual(result.output, 'zlib\nbusybox')
         result = runCmd('oe-pkgdata-util lookup-pkg -r libz-dev')
         self.assertEqual(result.output, 'zlib-dev')
         result = runCmd('oe-pkgdata-util lookup-pkg -r nonexistentpkg', ignore_status=True)
@@ -41,24 +41,26 @@
     def test_read_value(self):
         result = runCmd('oe-pkgdata-util read-value PN libz1')
         self.assertEqual(result.output, 'zlib')
-        result = runCmd('oe-pkgdata-util read-value PKGSIZE bash')
+        result = runCmd('oe-pkgdata-util read-value PKG libz1')
+        self.assertEqual(result.output, 'libz1')
+        result = runCmd('oe-pkgdata-util read-value PKGSIZE m4')
         pkgsize = int(result.output.strip())
         self.assertGreater(pkgsize, 1, "Size should be greater than 1. %s" % result.output)
 
     @testcase(1198)
     def test_find_path(self):
-        result = runCmd('oe-pkgdata-util find-path /lib/libc.so.6')
-        self.assertEqual(result.output, 'glibc: /lib/libc.so.6')
-        result = runCmd('oe-pkgdata-util find-path /bin/bash')
-        self.assertEqual(result.output, 'bash: /bin/bash')
+        result = runCmd('oe-pkgdata-util find-path /lib/libz.so.1')
+        self.assertEqual(result.output, 'zlib: /lib/libz.so.1')
+        result = runCmd('oe-pkgdata-util find-path /usr/bin/m4')
+        self.assertEqual(result.output, 'm4: /usr/bin/m4')
         result = runCmd('oe-pkgdata-util find-path /not/exist', ignore_status=True)
         self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
         self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist')
 
     @testcase(1204)
     def test_lookup_recipe(self):
-        result = runCmd('oe-pkgdata-util lookup-recipe "libc6-staticdev busybox"')
-        self.assertEqual(result.output, 'glibc\nbusybox')
+        result = runCmd('oe-pkgdata-util lookup-recipe "libz-staticdev busybox"')
+        self.assertEqual(result.output, 'zlib\nbusybox')
         result = runCmd('oe-pkgdata-util lookup-recipe libz-dbg')
         self.assertEqual(result.output, 'zlib')
         result = runCmd('oe-pkgdata-util lookup-recipe nonexistentpkg', ignore_status=True)
@@ -70,12 +72,11 @@
         # No arguments
         result = runCmd('oe-pkgdata-util list-pkgs')
         pkglist = result.output.split()
-        self.assertIn('glibc-utils', pkglist, "Listed packages: %s" % result.output)
+        self.assertIn('zlib', pkglist, "Listed packages: %s" % result.output)
         self.assertIn('zlib-dev', pkglist, "Listed packages: %s" % result.output)
         # No pkgspec, runtime
         result = runCmd('oe-pkgdata-util list-pkgs -r')
         pkglist = result.output.split()
-        self.assertIn('libc6-utils', pkglist, "Listed packages: %s" % result.output)
         self.assertIn('libz-dev', pkglist, "Listed packages: %s" % result.output)
         # With recipe specified
         result = runCmd('oe-pkgdata-util list-pkgs -p zlib')
@@ -124,10 +125,11 @@
                     curpkg = line.split(':')[0]
                     files[curpkg] = []
             return files
-        base_libdir = get_bb_var('base_libdir')
-        libdir = get_bb_var('libdir')
-        includedir = get_bb_var('includedir')
-        mandir = get_bb_var('mandir')
+        bb_vars = get_bb_vars(['base_libdir', 'libdir', 'includedir', 'mandir'])
+        base_libdir = bb_vars['base_libdir']
+        libdir = bb_vars['libdir']
+        includedir = bb_vars['includedir']
+        mandir = bb_vars['mandir']
         # Test recipe-space package name
         result = runCmd('oe-pkgdata-util list-pkg-files zlib-dev zlib-doc')
         files = splitoutput(result.output)
@@ -205,11 +207,10 @@
         self.track_for_cleanup(tempdir)
         pkglistfile = os.path.join(tempdir, 'pkglist')
         with open(pkglistfile, 'w') as f:
-            f.write('libc6\n')
             f.write('libz1\n')
             f.write('busybox\n')
         result = runCmd('oe-pkgdata-util glob %s "*-dev"' % pkglistfile)
-        desiredresult = ['libc6-dev', 'libz-dev', 'busybox-dev']
+        desiredresult = ['libz-dev', 'busybox-dev']
         self.assertEqual(sorted(result.output.split()), sorted(desiredresult))
         # The following should not error (because when we use this during rootfs construction, sometimes the complementary package won't exist)
         result = runCmd('oe-pkgdata-util glob %s "*-nonexistent"' % pkglistfile)
@@ -222,5 +223,5 @@
 
     @testcase(1206)
     def test_specify_pkgdatadir(self):
-        result = runCmd('oe-pkgdata-util -p %s lookup-pkg glibc' % get_bb_var('PKGDATA_DIR'))
-        self.assertEqual(result.output, 'libc6')
+        result = runCmd('oe-pkgdata-util -p %s lookup-pkg zlib' % get_bb_var('PKGDATA_DIR'))
+        self.assertEqual(result.output, 'libz1')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py
index 0b2dfe6..34d4197 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py
@@ -12,10 +12,13 @@
 from oeqa.utils.network import get_free_port
 
 class BitbakePrTests(oeSelfTest):
- 
+
+    @classmethod
+    def setUpClass(cls):
+        cls.pkgdata_dir = get_bb_var('PKGDATA_DIR')
+
     def get_pr_version(self, package_name):
-        pkgdata_dir = get_bb_var('PKGDATA_DIR')
-        package_data_file = os.path.join(pkgdata_dir, 'runtime', package_name)
+        package_data_file = os.path.join(self.pkgdata_dir, 'runtime', package_name)
         package_data = ftools.read_file(package_data_file)
         find_pr = re.search("PKGR: r[0-9]+\.([0-9]+)", package_data)
         self.assertTrue(find_pr, "No PKG revision found in %s" % package_data_file)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py
index 9b66924..dc55a5e 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py
@@ -1,9 +1,11 @@
 import os
 import logging
+import shutil
 import tempfile
 import urllib.parse
 
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.commands import get_bb_vars, create_temp_layer
 from oeqa.utils.decorators import testcase
 from oeqa.selftest import devtool
 
@@ -24,6 +26,7 @@
 
 
 class RecipetoolBase(devtool.DevtoolBase):
+
     def setUpLocal(self):
         self.templayerdir = templayerdir
         self.tempdir = tempfile.mkdtemp(prefix='recipetoolqa')
@@ -64,12 +67,16 @@
 
 
 class RecipetoolTests(RecipetoolBase):
+
     @classmethod
     def setUpClass(cls):
         # Ensure we have the right data in shlibs/pkgdata
         logger = logging.getLogger("selftest")
         logger.info('Running bitbake to generate pkgdata')
         bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile')
+        bb_vars = get_bb_vars(['COREBASE', 'BBPATH'])
+        cls.corebase = bb_vars['COREBASE']
+        cls.bbpath = bb_vars['BBPATH']
 
     def _try_recipetool_appendfile(self, testrecipe, destfile, newfile, options, expectedlines, expectedfiles):
         cmd = 'recipetool appendfile %s %s %s %s' % (self.templayerdir, destfile, newfile, options)
@@ -103,9 +110,8 @@
         # Now try with a file we know should be an alternative
         # (this is very much a fake example, but one we know is reliably an alternative)
         self._try_recipetool_appendfile_fail('/bin/ls', self.testfile, ['ERROR: File /bin/ls is an alternative possibly provided by the following recipes:', 'coreutils', 'busybox'])
-        corebase = get_bb_var('COREBASE')
         # Need a test file - should be executable
-        testfile2 = os.path.join(corebase, 'oe-init-build-env')
+        testfile2 = os.path.join(self.corebase, 'oe-init-build-env')
         testfile2name = os.path.basename(testfile2)
         expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
                          '\n',
@@ -134,7 +140,6 @@
 
     @testcase(1173)
     def test_recipetool_appendfile_add(self):
-        corebase = get_bb_var('COREBASE')
         # Try arbitrary file add to a recipe
         expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
                          '\n',
@@ -147,7 +152,7 @@
         self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase', expectedlines, ['testfile'])
         # Try adding another file, this time where the source file is executable
         # (so we're testing that, plus modifying an existing bbappend)
-        testfile2 = os.path.join(corebase, 'oe-init-build-env')
+        testfile2 = os.path.join(self.corebase, 'oe-init-build-env')
         testfile2name = os.path.basename(testfile2)
         expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
                          '\n',
@@ -363,20 +368,22 @@
         # Try adding a recipe
         tempsrc = os.path.join(self.tempdir, 'srctree')
         os.makedirs(tempsrc)
-        recipefile = os.path.join(self.tempdir, 'logrotate_3.8.7.bb')
-        srcuri = 'https://github.com/logrotate/logrotate/archive/r3-8-7.tar.gz'
+        recipefile = os.path.join(self.tempdir, 'logrotate_3.12.3.bb')
+        srcuri = 'https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz'
         result = runCmd('recipetool create -o %s %s -x %s' % (recipefile, srcuri, tempsrc))
         self.assertTrue(os.path.isfile(recipefile))
         checkvars = {}
         checkvars['LICENSE'] = 'GPLv2'
-        checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=18810669f13b87348459e611d31ab760'
-        checkvars['SRC_URI'] = 'https://github.com/logrotate/logrotate/archive/r3-8-7.tar.gz'
-        checkvars['SRC_URI[md5sum]'] = '6b1aa0e0d07eda3c9a2526520850397a'
-        checkvars['SRC_URI[sha256sum]'] = 'dece4bfeb9d8374a0ecafa34be139b5a697db5c926dcc69a9b8715431a22e733'
+        checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263'
+        checkvars['SRC_URI'] = 'https://github.com/logrotate/logrotate/releases/download/${PV}/logrotate-${PV}.tar.xz'
+        checkvars['SRC_URI[md5sum]'] = 'a560c57fac87c45b2fc17406cdf79288'
+        checkvars['SRC_URI[sha256sum]'] = '2e6a401cac9024db2288297e3be1a8ab60e7401ba8e91225218aaf4a27e82a07'
         self._test_recipe_contents(recipefile, checkvars, [])
 
     @testcase(1194)
     def test_recipetool_create_git(self):
+        if 'x11' not in get_bb_var('DISTRO_FEATURES'):
+            self.skipTest('Test requires x11 as distro feature')
         # Ensure we have the right data in shlibs/pkgdata
         bitbake('libpng pango libx11 libxext jpeg libcheck')
         # Try adding a recipe
@@ -480,6 +487,46 @@
         inherits = ['pkgconfig', 'autotools']
         self._test_recipe_contents(recipefile, checkvars, inherits)
 
+    def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths):
+        dstdir = basedstdir
+        self.assertTrue(os.path.exists(dstdir))
+        for p in paths:
+            dstdir = os.path.join(dstdir, p)
+            if not os.path.exists(dstdir):
+                os.makedirs(dstdir)
+                self.track_for_cleanup(dstdir)
+        dstfile = os.path.join(dstdir, os.path.basename(srcfile))
+        if srcfile != dstfile:
+            shutil.copy(srcfile, dstfile)
+            self.track_for_cleanup(dstfile)
+
+    def test_recipetool_load_plugin(self):
+        """Test that recipetool loads only the first found plugin in BBPATH."""
+
+        recipetool = runCmd("which recipetool")
+        fromname = runCmd("recipetool --quiet pluginfile")
+        srcfile = fromname.output
+        searchpath = self.bbpath.split(':') + [os.path.dirname(recipetool.output)]
+        plugincontent = []
+        with open(srcfile) as fh:
+            plugincontent = fh.readlines()
+        try:
+            self.assertIn('meta-selftest', srcfile, 'wrong bbpath plugin found')
+            for path in searchpath:
+                self._copy_file_with_cleanup(srcfile, path, 'lib', 'recipetool')
+            result = runCmd("recipetool --quiet count")
+            self.assertEqual(result.output, '1')
+            result = runCmd("recipetool --quiet multiloaded")
+            self.assertEqual(result.output, "no")
+            for path in searchpath:
+                result = runCmd("recipetool --quiet bbdir")
+                self.assertEqual(result.output, path)
+                os.unlink(os.path.join(result.output, 'lib', 'recipetool', 'bbpath.py'))
+        finally:
+            with open(srcfile, 'w') as fh:
+                fh.writelines(plugincontent)
+
+
 class RecipetoolAppendsrcBase(RecipetoolBase):
     def _try_recipetool_appendsrcfile(self, testrecipe, newfile, destfile, options, expectedlines, expectedfiles):
         cmd = 'recipetool appendsrcfile %s %s %s %s %s' % (options, self.templayerdir, testrecipe, newfile, destfile)
@@ -555,20 +602,23 @@
 
         self._try_recipetool_appendsrcfiles(testrecipe, newfiles, expectedfiles=expectedfiles, destdir=destdir, options=options)
 
-        src_uri = get_bb_var('SRC_URI', testrecipe).split()
+        bb_vars = get_bb_vars(['SRC_URI', 'FILE', 'FILESEXTRAPATHS'], testrecipe)
+        src_uri = bb_vars['SRC_URI'].split()
         for f in expectedfiles:
             if destdir:
                 self.assertIn('file://%s;subdir=%s' % (f, destdir), src_uri)
             else:
                 self.assertIn('file://%s' % f, src_uri)
 
-        recipefile = get_bb_var('FILE', testrecipe)
+        recipefile = bb_vars['FILE']
         bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir)
         filesdir = os.path.join(os.path.dirname(bbappendfile), testrecipe)
-        filesextrapaths = get_bb_var('FILESEXTRAPATHS', testrecipe).split(':')
+        filesextrapaths = bb_vars['FILESEXTRAPATHS'].split(':')
         self.assertIn(filesdir, filesextrapaths)
 
 
+
+
 class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
 
     @testcase(1273)
@@ -594,8 +644,9 @@
     @testcase(1280)
     def test_recipetool_appendsrcfile_srcdir_basic(self):
         testrecipe = 'bash'
-        srcdir = get_bb_var('S', testrecipe)
-        workdir = get_bb_var('WORKDIR', testrecipe)
+        bb_vars = get_bb_vars(['S', 'WORKDIR'], testrecipe)
+        srcdir = bb_vars['S']
+        workdir = bb_vars['WORKDIR']
         subdir = os.path.relpath(srcdir, workdir)
         self._test_appendsrcfile(testrecipe, 'a-file', srcdir=subdir)
 
@@ -620,8 +671,9 @@
     def test_recipetool_appendsrcfile_replace_file_srcdir(self):
         testrecipe = 'bash'
         filepath = 'Makefile.in'
-        srcdir = get_bb_var('S', testrecipe)
-        workdir = get_bb_var('WORKDIR', testrecipe)
+        bb_vars = get_bb_vars(['S', 'WORKDIR'], testrecipe)
+        srcdir = bb_vars['S']
+        workdir = bb_vars['WORKDIR']
         subdir = os.path.relpath(srcdir, workdir)
 
         self._test_appendsrcfile(testrecipe, filepath, srcdir=subdir)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/runqemu.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/runqemu.py
new file mode 100644
index 0000000..58c6f96
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/runqemu.py
@@ -0,0 +1,140 @@
+#
+# Copyright (c) 2017 Wind River Systems, Inc.
+#
+
+import re
+import logging
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import bitbake, runqemu, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class RunqemuTests(oeSelfTest):
+    """Runqemu test class"""
+
+    image_is_ready = False
+    deploy_dir_image = ''
+
+    def setUpLocal(self):
+        self.recipe = 'core-image-minimal'
+        self.machine =  'qemux86-64'
+        self.fstypes = "ext4 iso hddimg vmdk qcow2 vdi"
+        self.cmd_common = "runqemu nographic"
+
+        # Avoid emit the same record multiple times.
+        mainlogger = logging.getLogger("BitBake.Main")
+        mainlogger.propagate = False
+
+        self.write_config(
+"""
+MACHINE = "%s"
+IMAGE_FSTYPES = "%s"
+# 10 means 1 second
+SYSLINUX_TIMEOUT = "10"
+"""
+% (self.machine, self.fstypes)
+        )
+
+        if not RunqemuTests.image_is_ready:
+            RunqemuTests.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+            bitbake(self.recipe)
+            RunqemuTests.image_is_ready = True
+
+    @testcase(2001)
+    def test_boot_machine(self):
+        """Test runqemu machine"""
+        cmd = "%s %s" % (self.cmd_common, self.machine)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
+
+    @testcase(2002)
+    def test_boot_machine_ext4(self):
+        """Test runqemu machine ext4"""
+        cmd = "%s %s ext4" % (self.cmd_common, self.machine)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            with open(qemu.qemurunnerlog) as f:
+                self.assertTrue('rootfs.ext4' in f.read(), "Failed: %s" % cmd)
+
+    @testcase(2003)
+    def test_boot_machine_iso(self):
+        """Test runqemu machine iso"""
+        cmd = "%s %s iso" % (self.cmd_common, self.machine)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            with open(qemu.qemurunnerlog) as f:
+                self.assertTrue(' -cdrom ' in f.read(), "Failed: %s" % cmd)
+
+    @testcase(2004)
+    def test_boot_recipe_image(self):
+        """Test runqemu recipe-image"""
+        cmd = "%s %s" % (self.cmd_common, self.recipe)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
+
+    @testcase(2005)
+    def test_boot_recipe_image_vmdk(self):
+        """Test runqemu recipe-image vmdk"""
+        cmd = "%s %s vmdk" % (self.cmd_common, self.recipe)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            with open(qemu.qemurunnerlog) as f:
+                self.assertTrue('format=vmdk' in f.read(), "Failed: %s" % cmd)
+
+    @testcase(2006)
+    def test_boot_recipe_image_vdi(self):
+        """Test runqemu recipe-image vdi"""
+        cmd = "%s %s vdi" % (self.cmd_common, self.recipe)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            with open(qemu.qemurunnerlog) as f:
+                self.assertTrue('format=vdi' in f.read(), "Failed: %s" % cmd)
+
+    @testcase(2007)
+    def test_boot_deploy(self):
+        """Test runqemu deploy_dir_image"""
+        cmd = "%s %s" % (self.cmd_common, self.deploy_dir_image)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
+
+    @testcase(2008)
+    def test_boot_deploy_hddimg(self):
+        """Test runqemu deploy_dir_image hddimg"""
+        cmd = "%s %s hddimg" % (self.cmd_common, self.deploy_dir_image)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            with open(qemu.qemurunnerlog) as f:
+                self.assertTrue(re.search('file=.*.hddimg', f.read()), "Failed: %s" % cmd)
+
+    @testcase(2009)
+    def test_boot_machine_slirp(self):
+        """Test runqemu machine slirp"""
+        cmd = "%s slirp %s" % (self.cmd_common, self.machine)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            with open(qemu.qemurunnerlog) as f:
+                self.assertTrue(' -netdev user' in f.read(), "Failed: %s" % cmd)
+
+    @testcase(2009)
+    def test_boot_machine_slirp_qcow2(self):
+        """Test runqemu machine slirp qcow2"""
+        cmd = "%s slirp qcow2 %s" % (self.cmd_common, self.machine)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            with open(qemu.qemurunnerlog) as f:
+                self.assertTrue('format=qcow2' in f.read(), "Failed: %s" % cmd)
+
+    @testcase(2010)
+    def test_boot_qemu_boot(self):
+        """Test runqemu /path/to/image.qemuboot.conf"""
+        qemuboot_conf = "%s-%s.qemuboot.conf" % (self.recipe, self.machine)
+        qemuboot_conf = os.path.join(self.deploy_dir_image, qemuboot_conf)
+        if not os.path.exists(qemuboot_conf):
+            self.skipTest("%s not found" % qemuboot_conf)
+        cmd = "%s %s" % (self.cmd_common, qemuboot_conf)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
+
+    @testcase(2011)
+    def test_boot_rootfs(self):
+        """Test runqemu /path/to/rootfs.ext4"""
+        rootfs = "%s-%s.ext4" % (self.recipe, self.machine)
+        rootfs = os.path.join(self.deploy_dir_image, rootfs)
+        if not os.path.exists(rootfs):
+            self.skipTest("%s not found" % rootfs)
+        cmd = "%s %s" % (self.cmd_common, rootfs)
+        with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+            self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/runtime-test.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/runtime-test.py
index c2d5b45..e498d04 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/runtime-test.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/runtime-test.py
@@ -1,10 +1,15 @@
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
 from oeqa.utils.decorators import testcase
 import os
+import re
 
 class TestExport(oeSelfTest):
 
+    @classmethod
+    def tearDownClass(cls):
+        runCmd("rm -rf /tmp/sdk")
+
     def test_testexport_basic(self):
         """
         Summary: Check basic testexport functionality with only ping test enabled.
@@ -26,22 +31,23 @@
         bitbake('core-image-minimal')
         bitbake('-c testexport core-image-minimal')
 
-        # Verify if TEST_EXPORT_DIR was created
         testexport_dir = get_bb_var('TEST_EXPORT_DIR', 'core-image-minimal')
+
+        # Verify if TEST_EXPORT_DIR was created
         isdir = os.path.isdir(testexport_dir)
         self.assertEqual(True, isdir, 'Failed to create testexport dir: %s' % testexport_dir)
 
         with runqemu('core-image-minimal') as qemu:
             # Attempt to run runexported.py to perform ping test
-            runexported_path = os.path.join(testexport_dir, "runexported.py")
-            testdata_path = os.path.join(testexport_dir, "testdata.json")
-            cmd = "%s -t %s -s %s %s" % (runexported_path, qemu.ip, qemu.server_ip, testdata_path)
+            test_path = os.path.join(testexport_dir, "oe-test")
+            data_file = os.path.join(testexport_dir, 'data', 'testdata.json')
+            manifest = os.path.join(testexport_dir, 'data', 'manifest')
+            cmd = ("%s runtime --test-data-file %s --packages-manifest %s "
+                   "--target-ip %s --server-ip %s --quiet"
+                  % (test_path, data_file, manifest, qemu.ip, qemu.server_ip))
             result = runCmd(cmd)
-            self.assertEqual(0, result.status, 'runexported.py returned a non 0 status')
-
             # Verify ping test was succesful
-            failure = True if 'FAIL' in result.output else False
-            self.assertNotEqual(True, failure, 'ping test failed')
+            self.assertEqual(0, result.status, 'oe-test runtime returned a non 0 status')
 
     def test_testexport_sdk(self):
         """
@@ -60,7 +66,6 @@
         features += 'TEST_SERVER_IP = "192.168.7.1"\n'
         features += 'TEST_TARGET_IP = "192.168.7.1"\n'
         features += 'TEST_SUITES = "ping"\n'
-        features += 'TEST_SUITES_TAGS = "selftest_sdk"\n'
         features += 'TEST_EXPORT_SDK_ENABLED = "1"\n'
         features += 'TEST_EXPORT_SDK_PACKAGES = "nativesdk-tar"\n'
         self.write_config(features)
@@ -69,19 +74,31 @@
         bitbake('core-image-minimal')
         bitbake('-c testexport core-image-minimal')
 
-        # Check for SDK
-        testexport_dir = get_bb_var('TEST_EXPORT_DIR', 'core-image-minimal')
-        sdk_dir = get_bb_var('TEST_EXPORT_SDK_DIR', 'core-image-minimal')
-        tarball_name = "%s.sh" % get_bb_var('TEST_EXPORT_SDK_NAME', 'core-image-minimal')
-        tarball_path = os.path.join(testexport_dir, sdk_dir, tarball_name)
-        self.assertEqual(os.path.isfile(tarball_path), True, "Couldn't find SDK tarball: %s" % tarball_path)
+        needed_vars = ['TEST_EXPORT_DIR', 'TEST_EXPORT_SDK_DIR', 'TEST_EXPORT_SDK_NAME']
+        bb_vars = get_bb_vars(needed_vars, 'core-image-minimal')
+        testexport_dir = bb_vars['TEST_EXPORT_DIR']
+        sdk_dir = bb_vars['TEST_EXPORT_SDK_DIR']
+        sdk_name = bb_vars['TEST_EXPORT_SDK_NAME']
 
-        # Run runexported.py
-        runexported_path = os.path.join(testexport_dir, "runexported.py")
-        testdata_path = os.path.join(testexport_dir, "testdata.json")
-        cmd = "%s %s" % (runexported_path, testdata_path)
-        result = runCmd(cmd)
-        self.assertEqual(0, result.status, 'runexported.py returned a non 0 status')
+        # Check for SDK
+        tarball_name = "%s.sh" % sdk_name
+        tarball_path = os.path.join(testexport_dir, sdk_dir, tarball_name)
+        msg = "Couldn't find SDK tarball: %s" % tarball_path
+        self.assertEqual(os.path.isfile(tarball_path), True, msg)
+
+        # Extract SDK and run tar from SDK
+        result = runCmd("%s -y -d /tmp/sdk" % tarball_path)
+        self.assertEqual(0, result.status, "Couldn't extract SDK")
+
+        env_script = result.output.split()[-1]
+        result = runCmd(". %s; which tar" % env_script, shell=True)
+        self.assertEqual(0, result.status, "Couldn't setup SDK environment")
+        is_sdk_tar = True if "/tmp/sdk" in result.output else False
+        self.assertTrue(is_sdk_tar, "Couldn't setup SDK environment")
+
+        tar_sdk = result.output
+        result = runCmd("%s --version" % tar_sdk)
+        self.assertEqual(0, result.status, "Couldn't run tar from SDK")
 
 
 class TestImage(oeSelfTest):
@@ -90,16 +107,131 @@
         """
         Summary: Check install packages functionality for testimage/testexport.
         Expected: 1. Import tests from a directory other than meta.
-                  2. Check install/unistall of socat.
+                  2. Check install/uninstall of socat.
+                  3. Check that remote package feeds can be accessed
         Product: oe-core
         Author: Mariano Lopez <mariano.lopez@intel.com>
+        Author: Alexander Kanavin <alexander.kanavin@intel.com>
         """
+        if get_bb_var('DISTRO') == 'poky-tiny':
+            self.skipTest('core-image-full-cmdline not buildable for poky-tiny')
 
         features = 'INHERIT += "testimage"\n'
         features += 'TEST_SUITES = "ping ssh selftest"\n'
-        features += 'TEST_SUITES_TAGS = "selftest_package_install"\n'
+        # We don't yet know what the server ip and port will be - they will be patched
+        # in at the start of the on-image test
+        features += 'PACKAGE_FEED_URIS = "http://bogus_ip:bogus_port"\n'
+        features += 'EXTRA_IMAGE_FEATURES += "package-management"\n'
+        features += 'PACKAGE_CLASSES = "package_rpm"'
         self.write_config(features)
 
         # Build core-image-sato and testimage
         bitbake('core-image-full-cmdline socat')
         bitbake('-c testimage core-image-full-cmdline')
+
+class Postinst(oeSelfTest):
+    @testcase(1540)
+    def test_verify_postinst(self):
+        """
+        Summary: The purpose of this test is to verify the execution order of postinst Bugzilla ID: [5319]
+        Expected :
+        1. Compile a minimal image.
+        2. The compiled image will add the created layer with the recipes postinst[ abdpt]
+        3. Run qemux86
+        4. Validate the task execution order
+        Author: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com>
+        """
+        features = 'INHERIT += "testimage"\n'
+        features += 'CORE_IMAGE_EXTRA_INSTALL += "postinst-at-rootfs \
+postinst-delayed-a \
+postinst-delayed-b \
+postinst-delayed-d \
+postinst-delayed-p \
+postinst-delayed-t \
+"\n'
+        self.write_config(features)
+
+        bitbake('core-image-minimal -f ')
+
+        postinst_list = ['100-postinst-at-rootfs',
+                         '101-postinst-delayed-a',
+                         '102-postinst-delayed-b',
+                         '103-postinst-delayed-d',
+                         '104-postinst-delayed-p',
+                         '105-postinst-delayed-t']
+        path_workdir = get_bb_var('WORKDIR','core-image-minimal')
+        workspacedir = 'testimage/qemu_boot_log'
+        workspacedir = os.path.join(path_workdir, workspacedir)
+        rexp = re.compile("^Running postinst .*/(?P<postinst>.*)\.\.\.$")
+        with runqemu('core-image-minimal') as qemu:
+            with open(workspacedir) as f:
+                found = False
+                idx = 0
+                for line in f.readlines():
+                    line = line.strip().replace("^M","")
+                    if not line: # To avoid empty lines
+                        continue
+                    m = rexp.search(line)
+                    if m:
+                        self.assertEqual(postinst_list[idx], m.group('postinst'), "Fail")
+                        idx = idx+1
+                        found = True
+                    elif found:
+                        self.assertEqual(idx, len(postinst_list), "Not found all postinsts")
+                        break
+
+    @testcase(1545)
+    def test_postinst_rootfs_and_boot(self):
+        """
+        Summary:        The purpose of this test case is to verify Post-installation
+                        scripts are called when rootfs is created and also test
+                        that script can be delayed to run at first boot.
+        Dependencies:   NA
+        Steps:          1. Add proper configuration to local.conf file
+                        2. Build a "core-image-minimal" image
+                        3. Verify that file created by postinst_rootfs recipe is
+                           present on rootfs dir.
+                        4. Boot the image created on qemu and verify that the file
+                           created by postinst_boot recipe is present on image.
+        Expected:       The files are successfully created during rootfs and boot
+                        time for 3 different package managers: rpm,ipk,deb and
+                        for initialization managers: sysvinit and systemd.
+
+        """
+        file_rootfs_name = "this-was-created-at-rootfstime"
+        fileboot_name = "this-was-created-at-first-boot"
+        rootfs_pkg = 'postinst-at-rootfs'
+        boot_pkg = 'postinst-delayed-a'
+        #Step 1
+        features = 'MACHINE = "qemux86"\n'
+        features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, boot_pkg)
+        features += 'IMAGE_FEATURES += "ssh-server-openssh"\n'
+        for init_manager in ("sysvinit", "systemd"):
+            #for sysvinit no extra configuration is needed,
+            if (init_manager is "systemd"):
+                features += 'DISTRO_FEATURES_append = " systemd"\n'
+                features += 'VIRTUAL-RUNTIME_init_manager = "systemd"\n'
+                features += 'DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"\n'
+                features += 'VIRTUAL-RUNTIME_initscripts = ""\n'
+            for classes in ("package_rpm package_deb package_ipk",
+                            "package_deb package_rpm package_ipk",
+                            "package_ipk package_deb package_rpm"):
+                features += 'PACKAGE_CLASSES = "%s"\n' % classes
+                self.write_config(features)
+
+                #Step 2
+                bitbake('core-image-minimal')
+
+                #Step 3
+                file_rootfs_created = os.path.join(get_bb_var('IMAGE_ROOTFS',"core-image-minimal"),
+                                                   file_rootfs_name)
+                found = os.path.isfile(file_rootfs_created)
+                self.assertTrue(found, "File %s was not created at rootfs time by %s" % \
+                                (file_rootfs_name, rootfs_pkg))
+
+                #Step 4
+                testcommand = 'ls /etc/'+fileboot_name
+                with runqemu('core-image-minimal') as qemu:
+                    sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+                    result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
+                    self.assertEqual(result.status, 0, 'File %s was not created at firts boot'% fileboot_name)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py
index 606bfd3..0ac3d1fa 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py
@@ -1,5 +1,5 @@
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
 import os
 import glob
 import re
@@ -27,15 +27,17 @@
         cls.pub_key_path = os.path.join(cls.testlayer_path, 'files', 'signing', "key.pub")
         cls.secret_key_path = os.path.join(cls.testlayer_path, 'files', 'signing', "key.secret")
 
-        runCmd('gpg --homedir %s --import %s %s' % (cls.gpg_dir, cls.pub_key_path, cls.secret_key_path))
+        runCmd('gpg --batch --homedir %s --import %s %s' % (cls.gpg_dir, cls.pub_key_path, cls.secret_key_path))
 
     @testcase(1362)
     def test_signing_packages(self):
         """
         Summary:     Test that packages can be signed in the package feed
         Expected:    Package should be signed with the correct key
+        Expected:    Images can be created from signed packages
         Product:     oe-core
         Author:      Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        Author:      Alexander Kanavin <alexander.kanavin@intel.com>
         AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
         """
         import oe.packagedata
@@ -49,7 +51,6 @@
         feature = 'INHERIT += "sign_rpm"\n'
         feature += 'RPM_GPG_PASSPHRASE = "test123"\n'
         feature += 'RPM_GPG_NAME = "testuser"\n'
-        feature += 'RPM_GPG_PUBKEY = "%s"\n' % self.pub_key_path
         feature += 'GPG_PATH = "%s"\n' % self.gpg_dir
 
         self.write_config(feature)
@@ -59,30 +60,38 @@
 
         self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe)
 
-        pkgdatadir = get_bb_var('PKGDATA_DIR', test_recipe)
+        needed_vars = ['PKGDATA_DIR', 'DEPLOY_DIR_RPM', 'PACKAGE_ARCH', 'STAGING_BINDIR_NATIVE']
+        bb_vars = get_bb_vars(needed_vars, test_recipe)
+        pkgdatadir = bb_vars['PKGDATA_DIR']
         pkgdata = oe.packagedata.read_pkgdatafile(pkgdatadir + "/runtime/ed")
         if 'PKGE' in pkgdata:
             pf = pkgdata['PN'] + "-" + pkgdata['PKGE'] + pkgdata['PKGV'] + '-' + pkgdata['PKGR']
         else:
             pf = pkgdata['PN'] + "-" + pkgdata['PKGV'] + '-' + pkgdata['PKGR']
-        deploy_dir_rpm = get_bb_var('DEPLOY_DIR_RPM', test_recipe)
-        package_arch = get_bb_var('PACKAGE_ARCH', test_recipe).replace('-', '_')
-        staging_bindir_native = get_bb_var('STAGING_BINDIR_NATIVE')
+        deploy_dir_rpm = bb_vars['DEPLOY_DIR_RPM']
+        package_arch = bb_vars['PACKAGE_ARCH'].replace('-', '_')
+        staging_bindir_native = bb_vars['STAGING_BINDIR_NATIVE']
 
         pkg_deploy = os.path.join(deploy_dir_rpm, package_arch, '.'.join((pf, package_arch, 'rpm')))
 
         # Use a temporary rpmdb
         rpmdb = tempfile.mkdtemp(prefix='oeqa-rpmdb')
 
-        runCmd('%s/rpm --define "_dbpath %s" --import %s' %
+        runCmd('%s/rpmkeys --define "_dbpath %s" --import %s' %
                (staging_bindir_native, rpmdb, self.pub_key_path))
 
-        ret = runCmd('%s/rpm --define "_dbpath %s" --checksig %s' %
+        ret = runCmd('%s/rpmkeys --define "_dbpath %s" --checksig %s' %
                      (staging_bindir_native, rpmdb, pkg_deploy))
         # tmp/deploy/rpm/i586/ed-1.9-r0.i586.rpm: rsa sha1 md5 OK
-        self.assertIn('rsa sha1 md5 OK', ret.output, 'Package signed incorrectly.')
+        self.assertIn('rsa sha1 (md5) pgp md5 OK', ret.output, 'Package signed incorrectly.')
         shutil.rmtree(rpmdb)
 
+        #Check that an image can be built from signed packages
+        self.add_command_to_tearDown('bitbake -c clean core-image-minimal')
+        bitbake('-c clean core-image-minimal')
+        bitbake('core-image-minimal')
+
+
     @testcase(1382)
     def test_signing_sstate_archive(self):
         """
@@ -101,13 +110,7 @@
         self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe)
         self.add_command_to_tearDown('rm -rf %s' % sstatedir)
 
-        # Determine the pub key signature
-        ret = runCmd('gpg --homedir %s --list-keys' % self.gpg_dir)
-        pub_key = re.search(r'^pub\s+\S+/(\S+)\s+', ret.output, re.M)
-        self.assertIsNotNone(pub_key, 'Failed to determine the public key signature.')
-        pub_key = pub_key.group(1)
-
-        feature = 'SSTATE_SIG_KEY ?= "%s"\n' % pub_key
+        feature = 'SSTATE_SIG_KEY ?= "testuser"\n'
         feature += 'SSTATE_SIG_PASSPHRASE ?= "test123"\n'
         feature += 'SSTATE_VERIFY_SIG ?= "1"\n'
         feature += 'GPG_PATH = "%s"\n' % self.gpg_dir
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstate.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstate.py
index 5989724..f54bc41 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstate.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstate.py
@@ -6,16 +6,24 @@
 
 import oeqa.utils.ftools as ftools
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.utils.commands import runCmd, bitbake, get_bb_vars, get_test_layer
 
 
 class SStateBase(oeSelfTest):
 
     def setUpLocal(self):
         self.temp_sstate_location = None
-        self.sstate_path = get_bb_var('SSTATE_DIR')
-        self.distro = get_bb_var('NATIVELSBSTRING')
-        self.distro_specific_sstate = os.path.join(self.sstate_path, self.distro)
+        needed_vars = ['SSTATE_DIR', 'NATIVELSBSTRING', 'TCLIBC', 'TUNE_ARCH',
+                       'TOPDIR', 'TARGET_VENDOR', 'TARGET_OS']
+        bb_vars = get_bb_vars(needed_vars)
+        self.sstate_path = bb_vars['SSTATE_DIR']
+        self.hostdistro = bb_vars['NATIVELSBSTRING']
+        self.tclibc = bb_vars['TCLIBC']
+        self.tune_arch = bb_vars['TUNE_ARCH']
+        self.topdir = bb_vars['TOPDIR']
+        self.target_vendor = bb_vars['TARGET_VENDOR']
+        self.target_os = bb_vars['TARGET_OS']
+        self.distro_specific_sstate = os.path.join(self.sstate_path, self.hostdistro)
 
     # Creates a special sstate configuration with the option to add sstate mirrors
     def config_sstate(self, temp_sstate_location=False, add_local_mirrors=[]):
@@ -26,9 +34,10 @@
             config_temp_sstate = "SSTATE_DIR = \"%s\"" % temp_sstate_path
             self.append_config(config_temp_sstate)
             self.track_for_cleanup(temp_sstate_path)
-        self.sstate_path = get_bb_var('SSTATE_DIR')
-        self.distro = get_bb_var('NATIVELSBSTRING')
-        self.distro_specific_sstate = os.path.join(self.sstate_path, self.distro)
+        bb_vars = get_bb_vars(['SSTATE_DIR', 'NATIVELSBSTRING'])
+        self.sstate_path = bb_vars['SSTATE_DIR']
+        self.hostdistro = bb_vars['NATIVELSBSTRING']
+        self.distro_specific_sstate = os.path.join(self.sstate_path, self.hostdistro)
 
         if add_local_mirrors:
             config_set_sstate_if_not_set = 'SSTATE_MIRRORS ?= ""'
@@ -42,7 +51,7 @@
     def search_sstate(self, filename_regex, distro_specific=True, distro_nonspecific=True):
         result = []
         for root, dirs, files in os.walk(self.sstate_path):
-            if distro_specific and re.search("%s/[a-z0-9]{2}$" % self.distro, root):
+            if distro_specific and re.search("%s/[a-z0-9]{2}$" % self.hostdistro, root):
                 for f in files:
                     if re.search(filename_regex, f):
                         result.append(f)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py
index f99d746..e35ddff 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py
@@ -41,22 +41,19 @@
 
     @testcase(975)
     def test_sstate_creation_distro_specific_pass(self):
-        targetarch = get_bb_var('TUNE_ARCH')
-        self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
+        self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
 
     @testcase(1374)
     def test_sstate_creation_distro_specific_fail(self):
-        targetarch = get_bb_var('TUNE_ARCH')
-        self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False)
+        self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False)
 
     @testcase(976)
     def test_sstate_creation_distro_nonspecific_pass(self):
-        self.run_test_sstate_creation(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+        self.run_test_sstate_creation(['linux-libc-headers'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
 
     @testcase(1375)
     def test_sstate_creation_distro_nonspecific_fail(self):
-        self.run_test_sstate_creation(['glibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True, should_pass=False)
-
+        self.run_test_sstate_creation(['linux-libc-headers'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True, should_pass=False)
 
     # Test the sstate files deletion part of the do_cleansstate task
     def run_test_cleansstate_task(self, targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True):
@@ -77,17 +74,19 @@
 
     @testcase(977)
     def test_cleansstate_task_distro_specific_nonspecific(self):
-        targetarch = get_bb_var('TUNE_ARCH')
-        self.run_test_cleansstate_task(['binutils-cross-' + targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
+        targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native']
+        targets.append('linux-libc-headers')
+        self.run_test_cleansstate_task(targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
 
     @testcase(1376)
     def test_cleansstate_task_distro_nonspecific(self):
-        self.run_test_cleansstate_task(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+        self.run_test_cleansstate_task(['linux-libc-headers'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
 
     @testcase(1377)
     def test_cleansstate_task_distro_specific(self):
-        targetarch = get_bb_var('TUNE_ARCH')
-        self.run_test_cleansstate_task(['binutils-cross-'+ targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
+        targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native']
+        targets.append('linux-libc-headers')
+        self.run_test_cleansstate_task(targets, distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
 
 
     # Test rebuilding of distro-specific sstate files
@@ -124,13 +123,11 @@
 
     @testcase(175)
     def test_rebuild_distro_specific_sstate_cross_native_targets(self):
-        targetarch = get_bb_var('TUNE_ARCH')
-        self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch, 'binutils-native'], temp_sstate_location=True)
+        self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + self.tune_arch, 'binutils-native'], temp_sstate_location=True)
 
     @testcase(1372)
     def test_rebuild_distro_specific_sstate_cross_target(self):
-        targetarch = get_bb_var('TUNE_ARCH')
-        self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch], temp_sstate_location=True)
+        self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + self.tune_arch], temp_sstate_location=True)
 
     @testcase(1373)
     def test_rebuild_distro_specific_sstate_native_target(self):
@@ -145,10 +142,9 @@
         self.assertTrue(len(global_config) == len(target_config), msg='Lists global_config and target_config should have the same number of elements')
         self.config_sstate(temp_sstate_location=True, add_local_mirrors=[self.sstate_path])
 
-        # If buildhistory is enabled, we need to disable version-going-backwards QA checks for this test. It may report errors otherwise.
-        if ('buildhistory' in get_bb_var('USER_CLASSES')) or ('buildhistory' in get_bb_var('INHERIT')):
-            remove_errors_config = 'ERROR_QA_remove = "version-going-backwards"'
-            self.append_config(remove_errors_config)
+        # If buildhistory is enabled, we need to disable version-going-backwards
+        # QA checks for this test. It may report errors otherwise.
+        self.append_config('ERROR_QA_remove = "version-going-backwards"')
 
         # For not this only checks if random sstate tasks are handled correctly as a group.
         # In the future we should add control over what tasks we check for.
@@ -229,8 +225,6 @@
         manually and check using bitbake -S.
         """
 
-        topdir = get_bb_var('TOPDIR')
-        targetvendor = get_bb_var('TARGET_VENDOR')
         self.write_config("""
 MACHINE = "qemux86"
 TMPDIR = "${TOPDIR}/tmp-sstatesamehash"
@@ -239,7 +233,7 @@
 SDKMACHINE = "x86_64"
 PACKAGE_CLASSES = "package_rpm package_ipk package_deb"
 """)
-        self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+        self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
         bitbake("core-image-sato -S none")
         self.write_config("""
 MACHINE = "qemux86"
@@ -249,7 +243,7 @@
 SDKMACHINE = "i686"
 PACKAGE_CLASSES = "package_rpm package_ipk package_deb"
 """)
-        self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
+        self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
         bitbake("core-image-sato -S none")
 
         def get_files(d):
@@ -262,9 +256,9 @@
                     continue
                 f.extend(os.path.join(root, name) for name in files)
             return f
-        files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/")
-        files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
-        files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash").replace("i686-linux", "x86_64-linux").replace("i686" + targetvendor + "-linux", "x86_64" + targetvendor + "-linux", ) for x in files2]
+        files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/")
+        files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/")
+        files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash").replace("i686-linux", "x86_64-linux").replace("i686" + self.target_vendor + "-linux", "x86_64" + self.target_vendor + "-linux", ) for x in files2]
         self.maxDiff = None
         self.assertCountEqual(files1, files2)
 
@@ -277,18 +271,17 @@
         builds, override the variables manually and check using bitbake -S.
         """
 
-        topdir = get_bb_var('TOPDIR')
         self.write_config("""
 TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
 NATIVELSBSTRING = \"DistroA\"
 """)
-        self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+        self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
         bitbake("core-image-sato -S none")
         self.write_config("""
 TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
 NATIVELSBSTRING = \"DistroB\"
 """)
-        self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
+        self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
         bitbake("core-image-sato -S none")
 
         def get_files(d):
@@ -296,8 +289,8 @@
             for root, dirs, files in os.walk(d):
                 f.extend(os.path.join(root, name) for name in files)
             return f
-        files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/")
-        files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
+        files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/")
+        files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/")
         files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
         self.maxDiff = None
         self.assertCountEqual(files1, files2)
@@ -346,14 +339,11 @@
 
     def sstate_allarch_samesigs(self, configA, configB):
 
-        topdir = get_bb_var('TOPDIR')
-        targetos = get_bb_var('TARGET_OS')
-        targetvendor = get_bb_var('TARGET_VENDOR')
         self.write_config(configA)
-        self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+        self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
         bitbake("world meta-toolchain -S none")
         self.write_config(configB)
-        self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
+        self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
         bitbake("world meta-toolchain -S none")
 
         def get_files(d):
@@ -367,15 +357,15 @@
                         (_, task, _, shash) = name.rsplit(".", 3)
                         f[os.path.join(os.path.basename(root), task)] = shash
             return f
-        files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/all" + targetvendor + "-" + targetos)
-        files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/all" + targetvendor + "-" + targetos)
+        files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/all" + self.target_vendor + "-" + self.target_os)
+        files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/all" + self.target_vendor + "-" + self.target_os)
         self.maxDiff = None
         self.assertEqual(files1, files2)
 
-        nativesdkdir = os.path.basename(glob.glob(topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0])
+        nativesdkdir = os.path.basename(glob.glob(self.topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0])
 
-        files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/" + nativesdkdir)
-        files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/" + nativesdkdir)
+        files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/" + nativesdkdir)
+        files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/" + nativesdkdir)
         self.maxDiff = None
         self.assertEqual(files1, files2)
 
@@ -387,9 +377,6 @@
         qemux86copy machine to test this. Also include multilibs in the test.
         """
 
-        topdir = get_bb_var('TOPDIR')
-        targetos = get_bb_var('TARGET_OS')
-        targetvendor = get_bb_var('TARGET_VENDOR')
         self.write_config("""
 TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
 MACHINE = \"qemux86\"
@@ -397,7 +384,7 @@
 MULTILIBS = "multilib:lib32"
 DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
 """)
-        self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+        self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
         bitbake("world meta-toolchain -S none")
         self.write_config("""
 TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
@@ -406,7 +393,7 @@
 MULTILIBS = "multilib:lib32"
 DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
 """)
-        self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
+        self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
         bitbake("world meta-toolchain -S none")
 
         def get_files(d):
@@ -420,8 +407,8 @@
                     if "do_build" not in name and "do_populate_sdk" not in name:
                         f.append(os.path.join(root, name))
             return f
-        files1 = get_files(topdir + "/tmp-sstatesamehash/stamps")
-        files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps")
+        files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps")
+        files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps")
         files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
         self.maxDiff = None
         self.assertCountEqual(files1, files2)
@@ -433,8 +420,6 @@
         classes inherits should be the same.
         """
 
-        topdir = get_bb_var('TOPDIR')
-        targetvendor = get_bb_var('TARGET_VENDOR')
         self.write_config("""
 TMPDIR = "${TOPDIR}/tmp-sstatesamehash"
 BB_NUMBER_THREADS = "1"
@@ -445,8 +430,8 @@
 INHERIT_remove = "buildstats-summary buildhistory uninative"
 http_proxy = ""
 """)
-        self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
-        self.track_for_cleanup(topdir + "/download1")
+        self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
+        self.track_for_cleanup(self.topdir + "/download1")
         bitbake("world meta-toolchain -S none")
         self.write_config("""
 TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
@@ -460,8 +445,8 @@
 INHERIT += "buildstats-summary buildhistory"
 http_proxy = "http://example.com/"
 """)
-        self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
-        self.track_for_cleanup(topdir + "/download2")
+        self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
+        self.track_for_cleanup(self.topdir + "/download2")
         bitbake("world meta-toolchain -S none")
 
         def get_files(d):
@@ -473,8 +458,8 @@
                     base = os.sep.join(root.rsplit(os.sep, 2)[-2:] + [name])
                     f[base] = shash
             return f
-        files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/")
-        files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
+        files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/")
+        files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/")
         # Remove items that are identical in both sets
         for k,v in files1.items() & files2.items():
             del files1[k]
@@ -487,8 +472,8 @@
             if k in files1 and k in files2:
                 print("%s differs:" % k)
                 print(subprocess.check_output(("bitbake-diffsigs",
-                                               topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k],
-                                               topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k])))
+                                               self.topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k],
+                                               self.topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k])))
             elif k in files1 and k not in files2:
                 print("%s in files1" % k)
             elif k not in files1 and k in files2:
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/tinfoil.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/tinfoil.py
new file mode 100644
index 0000000..73a0c3b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/tinfoil.py
@@ -0,0 +1,190 @@
+import unittest
+import os
+import re
+import bb.tinfoil
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd
+from oeqa.utils.decorators import testcase
+
+class TinfoilTests(oeSelfTest):
+    """ Basic tests for the tinfoil API """
+
+    @testcase(1568)
+    def test_getvar(self):
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(True)
+            machine = tinfoil.config_data.getVar('MACHINE')
+            if not machine:
+                self.fail('Unable to get MACHINE value - returned %s' % machine)
+
+    @testcase(1569)
+    def test_expand(self):
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(True)
+            expr = '${@os.getpid()}'
+            pid = tinfoil.config_data.expand(expr)
+            if not pid:
+                self.fail('Unable to expand "%s" - returned %s' % (expr, pid))
+
+    @testcase(1570)
+    def test_getvar_bb_origenv(self):
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(True)
+            origenv = tinfoil.config_data.getVar('BB_ORIGENV', False)
+            if not origenv:
+                self.fail('Unable to get BB_ORIGENV value - returned %s' % origenv)
+            self.assertEqual(origenv.getVar('HOME', False), os.environ['HOME'])
+
+    @testcase(1571)
+    def test_parse_recipe(self):
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=False, quiet=2)
+            testrecipe = 'mdadm'
+            best = tinfoil.find_best_provider(testrecipe)
+            if not best:
+                self.fail('Unable to find recipe providing %s' % testrecipe)
+            rd = tinfoil.parse_recipe_file(best[3])
+            self.assertEqual(testrecipe, rd.getVar('PN'))
+
+    @testcase(1572)
+    def test_parse_recipe_copy_expand(self):
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=False, quiet=2)
+            testrecipe = 'mdadm'
+            best = tinfoil.find_best_provider(testrecipe)
+            if not best:
+                self.fail('Unable to find recipe providing %s' % testrecipe)
+            rd = tinfoil.parse_recipe_file(best[3])
+            # Check we can get variable values
+            self.assertEqual(testrecipe, rd.getVar('PN'))
+            # Check that expanding a value that includes a variable reference works
+            self.assertEqual(testrecipe, rd.getVar('BPN'))
+            # Now check that changing the referenced variable's value in a copy gives that
+            # value when expanding
+            localdata = bb.data.createCopy(rd)
+            localdata.setVar('PN', 'hello')
+            self.assertEqual('hello', localdata.getVar('BPN'))
+
+    @testcase(1573)
+    def test_parse_recipe_initial_datastore(self):
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=False, quiet=2)
+            testrecipe = 'mdadm'
+            best = tinfoil.find_best_provider(testrecipe)
+            if not best:
+                self.fail('Unable to find recipe providing %s' % testrecipe)
+            dcopy = bb.data.createCopy(tinfoil.config_data)
+            dcopy.setVar('MYVARIABLE', 'somevalue')
+            rd = tinfoil.parse_recipe_file(best[3], config_data=dcopy)
+            # Check we can get variable values
+            self.assertEqual('somevalue', rd.getVar('MYVARIABLE'))
+
+    @testcase(1574)
+    def test_list_recipes(self):
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=False, quiet=2)
+            # Check pkg_pn
+            checkpns = ['tar', 'automake', 'coreutils', 'm4-native', 'nativesdk-gcc']
+            pkg_pn = tinfoil.cooker.recipecaches[''].pkg_pn
+            for pn in checkpns:
+                self.assertIn(pn, pkg_pn)
+            # Check pkg_fn
+            checkfns = {'nativesdk-gcc': '^virtual:nativesdk:.*', 'coreutils': '.*/coreutils_.*.bb'}
+            for fn, pn in tinfoil.cooker.recipecaches[''].pkg_fn.items():
+                if pn in checkpns:
+                    if pn in checkfns:
+                        self.assertTrue(re.match(checkfns[pn], fn), 'Entry for %s: %s did not match %s' % (pn, fn, checkfns[pn]))
+                    checkpns.remove(pn)
+            if checkpns:
+                self.fail('Unable to find pkg_fn entries for: %s' % ', '.join(checkpns))
+
+    @testcase(1575)
+    def test_wait_event(self):
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=True)
+            # Need to drain events otherwise events that will be masked will still be in the queue
+            while tinfoil.wait_event(0.25):
+                pass
+            tinfoil.set_event_mask(['bb.event.FilesMatchingFound', 'bb.command.CommandCompleted'])
+            pattern = 'conf'
+            res = tinfoil.run_command('findFilesMatchingInDir', pattern, 'conf/machine')
+            self.assertTrue(res)
+
+            eventreceived = False
+            waitcount = 5
+            while waitcount > 0:
+                event = tinfoil.wait_event(1)
+                if event:
+                    if isinstance(event, bb.command.CommandCompleted):
+                        break
+                    elif isinstance(event, bb.event.FilesMatchingFound):
+                        self.assertEqual(pattern, event._pattern)
+                        self.assertIn('qemuarm.conf', event._matches)
+                        eventreceived = True
+                    else:
+                        self.fail('Unexpected event: %s' % event)
+
+                waitcount = waitcount - 1
+
+            self.assertNotEqual(waitcount, 0, 'Timed out waiting for CommandCompleted event from bitbake server')
+            self.assertTrue(eventreceived, 'Did not receive FilesMatchingFound event from bitbake server')
+
+    @testcase(1576)
+    def test_setvariable_clean(self):
+        # First check that setVariable affects the datastore
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=True)
+            tinfoil.run_command('setVariable', 'TESTVAR', 'specialvalue')
+            self.assertEqual(tinfoil.config_data.getVar('TESTVAR'), 'specialvalue', 'Value set using setVariable is not reflected in client-side getVar()')
+
+        # Now check that the setVariable's effects are no longer present
+        # (this may legitimately break in future if we stop reinitialising
+        # the datastore, in which case we'll have to reconsider use of
+        # setVariable entirely)
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=True)
+            self.assertNotEqual(tinfoil.config_data.getVar('TESTVAR'), 'specialvalue', 'Value set using setVariable is still present!')
+
+        # Now check that setVar on the main datastore works (uses setVariable internally)
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=True)
+            tinfoil.config_data.setVar('TESTVAR', 'specialvalue')
+            value = tinfoil.run_command('getVariable', 'TESTVAR')
+            self.assertEqual(value, 'specialvalue', 'Value set using config_data.setVar() is not reflected in config_data.getVar()')
+
+    def test_datastore_operations(self):
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=True)
+            # Test setVarFlag() / getVarFlag()
+            tinfoil.config_data.setVarFlag('TESTVAR', 'flagname', 'flagval')
+            value = tinfoil.config_data.getVarFlag('TESTVAR', 'flagname')
+            self.assertEqual(value, 'flagval', 'Value set using config_data.setVarFlag() is not reflected in config_data.getVarFlag()')
+            # Test delVarFlag()
+            tinfoil.config_data.setVarFlag('TESTVAR', 'otherflag', 'othervalue')
+            tinfoil.config_data.delVarFlag('TESTVAR', 'flagname')
+            value = tinfoil.config_data.getVarFlag('TESTVAR', 'flagname')
+            self.assertEqual(value, None, 'Varflag deleted using config_data.delVarFlag() is not reflected in config_data.getVarFlag()')
+            value = tinfoil.config_data.getVarFlag('TESTVAR', 'otherflag')
+            self.assertEqual(value, 'othervalue', 'Varflag deleted using config_data.delVarFlag() caused unrelated flag to be removed')
+            # Test delVar()
+            tinfoil.config_data.setVar('TESTVAR', 'varvalue')
+            value = tinfoil.config_data.getVar('TESTVAR')
+            self.assertEqual(value, 'varvalue', 'Value set using config_data.setVar() is not reflected in config_data.getVar()')
+            tinfoil.config_data.delVar('TESTVAR')
+            value = tinfoil.config_data.getVar('TESTVAR')
+            self.assertEqual(value, None, 'Variable deleted using config_data.delVar() appears to still have a value')
+            # Test renameVar()
+            tinfoil.config_data.setVar('TESTVAROLD', 'origvalue')
+            tinfoil.config_data.renameVar('TESTVAROLD', 'TESTVARNEW')
+            value = tinfoil.config_data.getVar('TESTVAROLD')
+            self.assertEqual(value, None, 'Variable renamed using config_data.renameVar() still seems to exist')
+            value = tinfoil.config_data.getVar('TESTVARNEW')
+            self.assertEqual(value, 'origvalue', 'Variable renamed using config_data.renameVar() does not appear with new name')
+            # Test overrides
+            tinfoil.config_data.setVar('TESTVAR', 'original')
+            tinfoil.config_data.setVar('TESTVAR_overrideone', 'one')
+            tinfoil.config_data.setVar('TESTVAR_overridetwo', 'two')
+            tinfoil.config_data.appendVar('OVERRIDES', ':overrideone')
+            value = tinfoil.config_data.getVar('TESTVAR')
+            self.assertEqual(value, 'one', 'Variable overrides not functioning correctly')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py
index e652fad..726af19 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py
@@ -24,42 +24,84 @@
 """Test cases for wic."""
 
 import os
+import sys
+import unittest
 
 from glob import glob
 from shutil import rmtree
+from functools import wraps, lru_cache
+from tempfile import NamedTemporaryFile
 
 from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
 from oeqa.utils.decorators import testcase
 
 
+@lru_cache(maxsize=32)
+def get_host_arch(recipe):
+    """A cached call to get_bb_var('HOST_ARCH', <recipe>)"""
+    return get_bb_var('HOST_ARCH', recipe)
+
+
+def only_for_arch(archs, image='core-image-minimal'):
+    """Decorator for wrapping test cases that can be run only for specific target
+    architectures. A list of compatible architectures is passed in `archs`.
+    Current architecture will be determined by parsing bitbake output for
+    `image` recipe.
+    """
+    def wrapper(func):
+        @wraps(func)
+        def wrapped_f(*args, **kwargs):
+            arch = get_host_arch(image)
+            if archs and arch not in archs:
+                raise unittest.SkipTest("Testcase arch dependency not met: %s" % arch)
+            return func(*args, **kwargs)
+        wrapped_f.__name__ = func.__name__
+        return wrapped_f
+    return wrapper
+
+
 class Wic(oeSelfTest):
     """Wic test class."""
 
-    resultdir = "/var/tmp/wic/build/"
+    resultdir = "/var/tmp/wic.oe-selftest/"
     image_is_ready = False
+    native_sysroot = None
+    wicenv_cache = {}
 
     def setUpLocal(self):
         """This code is executed before each test method."""
-        self.write_config('IMAGE_FSTYPES += " hddimg"\n'
-                          'MACHINE_FEATURES_append = " efi"\n'
-                          'WKS_FILE = "wic-image-minimal"\n')
+        if not self.native_sysroot:
+            Wic.native_sysroot = get_bb_var('STAGING_DIR_NATIVE', 'wic-tools')
 
         # Do this here instead of in setUpClass as the base setUp does some
         # clean up which can result in the native tools built earlier in
         # setUpClass being unavailable.
         if not Wic.image_is_ready:
-            bitbake('syslinux syslinux-native parted-native gptfdisk-native '
-                    'dosfstools-native mtools-native bmap-tools-native')
+            if get_bb_var('USE_NLS') == 'yes':
+                bitbake('wic-tools')
+            else:
+                self.skipTest('wic-tools cannot be built due its (intltool|gettext)-native dependency and NLS disable')
+
             bitbake('core-image-minimal')
             Wic.image_is_ready = True
 
         rmtree(self.resultdir, ignore_errors=True)
 
+    def tearDownLocal(self):
+        """Remove resultdir as it may contain images."""
+        rmtree(self.resultdir, ignore_errors=True)
+
+    @testcase(1552)
+    def test_version(self):
+        """Test wic --version"""
+        self.assertEqual(0, runCmd('wic --version').status)
+
     @testcase(1208)
     def test_help(self):
-        """Test wic --help"""
+        """Test wic --help and wic -h"""
         self.assertEqual(0, runCmd('wic --help').status)
+        self.assertEqual(0, runCmd('wic -h').status)
 
     @testcase(1209)
     def test_createhelp(self):
@@ -71,44 +113,15 @@
         """Test wic list --help"""
         self.assertEqual(0, runCmd('wic list --help').status)
 
-    @testcase(1211)
-    def test_build_image_name(self):
-        """Test wic create directdisk --image-name core-image-minimal"""
-        self.assertEqual(0, runCmd("wic create directdisk "
-                                   "--image-name core-image-minimal").status)
-        self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+    @testcase(1553)
+    def test_help_create(self):
+        """Test wic help create"""
+        self.assertEqual(0, runCmd('wic help create').status)
 
-    @testcase(1212)
-    def test_build_artifacts(self):
-        """Test wic create directdisk providing all artifacts."""
-        bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
-                        for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
-                                    'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
-        status = runCmd("wic create directdisk "
-                        "-b %(staging_datadir)s "
-                        "-k %(deploy_dir_image)s "
-                        "-n %(staging_dir_native)s "
-                        "-r %(image_rootfs)s" % bbvars).status
-        self.assertEqual(0, status)
-        self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
-
-    @testcase(1157)
-    def test_gpt_image(self):
-        """Test creation of core-image-minimal with gpt table and UUID boot"""
-        self.assertEqual(0, runCmd("wic create directdisk-gpt "
-                                   "--image-name core-image-minimal").status)
-        self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
-
-    @testcase(1213)
-    def test_unsupported_subcommand(self):
-        """Test unsupported subcommand"""
-        self.assertEqual(1, runCmd('wic unsupported',
-                                   ignore_status=True).status)
-
-    @testcase(1214)
-    def test_no_command(self):
-        """Test wic without command"""
-        self.assertEqual(1, runCmd('wic', ignore_status=True).status)
+    @testcase(1554)
+    def test_help_list(self):
+        """Test wic help list"""
+        self.assertEqual(0, runCmd('wic help list').status)
 
     @testcase(1215)
     def test_help_overview(self):
@@ -125,94 +138,418 @@
         """Test wic help kickstart"""
         self.assertEqual(0, runCmd('wic help kickstart').status)
 
+    @testcase(1555)
+    def test_list_images(self):
+        """Test wic list images"""
+        self.assertEqual(0, runCmd('wic list images').status)
+
+    @testcase(1556)
+    def test_list_source_plugins(self):
+        """Test wic list source-plugins"""
+        self.assertEqual(0, runCmd('wic list source-plugins').status)
+
+    @testcase(1557)
+    def test_listed_images_help(self):
+        """Test wic listed images help"""
+        output = runCmd('wic list images').output
+        imagelist = [line.split()[0] for line in output.splitlines()]
+        for image in imagelist:
+            self.assertEqual(0, runCmd('wic list %s help' % image).status)
+
+    @testcase(1213)
+    def test_unsupported_subcommand(self):
+        """Test unsupported subcommand"""
+        self.assertEqual(1, runCmd('wic unsupported',
+                                   ignore_status=True).status)
+
+    @testcase(1214)
+    def test_no_command(self):
+        """Test wic without command"""
+        self.assertEqual(1, runCmd('wic', ignore_status=True).status)
+
+    @testcase(1211)
+    def test_build_image_name(self):
+        """Test wic create wictestdisk --image-name=core-image-minimal"""
+        cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s" % self.resultdir
+        self.assertEqual(0, runCmd(cmd).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+    @testcase(1157)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    def test_gpt_image(self):
+        """Test creation of core-image-minimal with gpt table and UUID boot"""
+        cmd = "wic create directdisk-gpt --image-name core-image-minimal -o %s" % self.resultdir
+        self.assertEqual(0, runCmd(cmd).status)
+        self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+
+    @testcase(1346)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    def test_iso_image(self):
+        """Test creation of hybrid iso image with legacy and EFI boot"""
+        config = 'INITRAMFS_IMAGE = "core-image-minimal-initramfs"\n'\
+                 'MACHINE_FEATURES_append = " efi"\n'
+        self.append_config(config)
+        bitbake('core-image-minimal')
+        self.remove_config(config)
+        cmd = "wic create mkhybridiso --image-name core-image-minimal -o %s" % self.resultdir
+        self.assertEqual(0, runCmd(cmd).status)
+        self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct")))
+        self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso")))
+
+    @testcase(1348)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    def test_qemux86_directdisk(self):
+        """Test creation of qemux-86-directdisk image"""
+        cmd = "wic create qemux86-directdisk -e core-image-minimal -o %s" % self.resultdir
+        self.assertEqual(0, runCmd(cmd).status)
+        self.assertEqual(1, len(glob(self.resultdir + "qemux86-directdisk-*direct")))
+
+    @testcase(1350)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    def test_mkefidisk(self):
+        """Test creation of mkefidisk image"""
+        cmd = "wic create mkefidisk -e core-image-minimal -o %s" % self.resultdir
+        self.assertEqual(0, runCmd(cmd).status)
+        self.assertEqual(1, len(glob(self.resultdir + "mkefidisk-*direct")))
+
+    @testcase(1385)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    def test_bootloader_config(self):
+        """Test creation of directdisk-bootloader-config image"""
+        cmd = "wic create directdisk-bootloader-config -e core-image-minimal -o %s" % self.resultdir
+        self.assertEqual(0, runCmd(cmd).status)
+        self.assertEqual(1, len(glob(self.resultdir + "directdisk-bootloader-config-*direct")))
+
+    @testcase(1560)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    def test_systemd_bootdisk(self):
+        """Test creation of systemd-bootdisk image"""
+        config = 'MACHINE_FEATURES_append = " efi"\n'
+        self.append_config(config)
+        bitbake('core-image-minimal')
+        self.remove_config(config)
+        cmd = "wic create systemd-bootdisk -e core-image-minimal -o %s" % self.resultdir
+        self.assertEqual(0, runCmd(cmd).status)
+        self.assertEqual(1, len(glob(self.resultdir + "systemd-bootdisk-*direct")))
+
+    @testcase(1561)
+    def test_sdimage_bootpart(self):
+        """Test creation of sdimage-bootpart image"""
+        cmd = "wic create sdimage-bootpart -e core-image-minimal -o %s" % self.resultdir
+        kimgtype = get_bb_var('KERNEL_IMAGETYPE', 'core-image-minimal')
+        self.write_config('IMAGE_BOOT_FILES = "%s"\n' % kimgtype)
+        self.assertEqual(0, runCmd(cmd).status)
+        self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct")))
+
+    @testcase(1562)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    def test_default_output_dir(self):
+        """Test default output location"""
+        for fname in glob("directdisk-*.direct"):
+            os.remove(fname)
+        cmd = "wic create directdisk -e core-image-minimal"
+        self.assertEqual(0, runCmd(cmd).status)
+        self.assertEqual(1, len(glob("directdisk-*.direct")))
+
+    @testcase(1212)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    def test_build_artifacts(self):
+        """Test wic create directdisk providing all artifacts."""
+        bb_vars = get_bb_vars(['STAGING_DATADIR', 'RECIPE_SYSROOT_NATIVE'],
+                              'wic-tools')
+        bb_vars.update(get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'],
+                                   'core-image-minimal'))
+        bbvars = {key.lower(): value for key, value in bb_vars.items()}
+        bbvars['resultdir'] = self.resultdir
+        status = runCmd("wic create directdisk "
+                        "-b %(staging_datadir)s "
+                        "-k %(deploy_dir_image)s "
+                        "-n %(recipe_sysroot_native)s "
+                        "-r %(image_rootfs)s "
+                        "-o %(resultdir)s" % bbvars).status
+        self.assertEqual(0, status)
+        self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+
     @testcase(1264)
     def test_compress_gzip(self):
         """Test compressing an image with gzip"""
-        self.assertEqual(0, runCmd("wic create directdisk "
+        self.assertEqual(0, runCmd("wic create wictestdisk "
                                    "--image-name core-image-minimal "
-                                   "-c gzip").status)
-        self.assertEqual(1, len(glob(self.resultdir + \
-                                         "directdisk-*.direct.gz")))
+                                   "-c gzip -o %s" % self.resultdir).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.gz")))
 
     @testcase(1265)
     def test_compress_bzip2(self):
         """Test compressing an image with bzip2"""
-        self.assertEqual(0, runCmd("wic create directdisk "
-                                   "--image-name core-image-minimal "
-                                   "-c bzip2").status)
-        self.assertEqual(1, len(glob(self.resultdir + \
-                                         "directdisk-*.direct.bz2")))
+        self.assertEqual(0, runCmd("wic create wictestdisk "
+                                   "--image-name=core-image-minimal "
+                                   "-c bzip2 -o %s" % self.resultdir).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.bz2")))
 
     @testcase(1266)
     def test_compress_xz(self):
         """Test compressing an image with xz"""
-        self.assertEqual(0, runCmd("wic create directdisk "
-                                   "--image-name core-image-minimal "
-                                   "-c xz").status)
-        self.assertEqual(1, len(glob(self.resultdir + \
-                                         "directdisk-*.direct.xz")))
+        self.assertEqual(0, runCmd("wic create wictestdisk "
+                                   "--image-name=core-image-minimal "
+                                   "--compress-with=xz -o %s" % self.resultdir).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.xz")))
 
     @testcase(1267)
     def test_wrong_compressor(self):
         """Test how wic breaks if wrong compressor is provided"""
-        self.assertEqual(2, runCmd("wic create directdisk "
-                                   "--image-name core-image-minimal "
-                                   "-c wrong", ignore_status=True).status)
+        self.assertEqual(2, runCmd("wic create wictestdisk "
+                                   "--image-name=core-image-minimal "
+                                   "-c wrong -o %s" % self.resultdir,
+                                   ignore_status=True).status)
+
+    @testcase(1558)
+    def test_debug_short(self):
+        """Test -D option"""
+        self.assertEqual(0, runCmd("wic create wictestdisk "
+                                   "--image-name=core-image-minimal "
+                                   "-D -o %s" % self.resultdir).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+    def test_debug_long(self):
+        """Test --debug option"""
+        self.assertEqual(0, runCmd("wic create wictestdisk "
+                                   "--image-name=core-image-minimal "
+                                   "--debug -o %s" % self.resultdir).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+    @testcase(1563)
+    def test_skip_build_check_short(self):
+        """Test -s option"""
+        self.assertEqual(0, runCmd("wic create wictestdisk "
+                                   "--image-name=core-image-minimal "
+                                   "-s -o %s" % self.resultdir).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+    def test_skip_build_check_long(self):
+        """Test --skip-build-check option"""
+        self.assertEqual(0, runCmd("wic create wictestdisk "
+                                   "--image-name=core-image-minimal "
+                                   "--skip-build-check "
+                                   "--outdir %s" % self.resultdir).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+    @testcase(1564)
+    def test_build_rootfs_short(self):
+        """Test -f option"""
+        self.assertEqual(0, runCmd("wic create wictestdisk "
+                                   "--image-name=core-image-minimal "
+                                   "-f -o %s" % self.resultdir).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+    def test_build_rootfs_long(self):
+        """Test --build-rootfs option"""
+        self.assertEqual(0, runCmd("wic create wictestdisk "
+                                   "--image-name=core-image-minimal "
+                                   "--build-rootfs "
+                                   "--outdir %s" % self.resultdir).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
 
     @testcase(1268)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_rootfs_indirect_recipes(self):
         """Test usage of rootfs plugin with rootfs recipes"""
-        wks = "directdisk-multi-rootfs"
-        self.assertEqual(0, runCmd("wic create %s "
-                                   "--image-name core-image-minimal "
-                                   "--rootfs rootfs1=core-image-minimal "
-                                   "--rootfs rootfs2=core-image-minimal" \
-                                   % wks).status)
-        self.assertEqual(1, len(glob(self.resultdir + "%s*.direct" % wks)))
+        status = runCmd("wic create directdisk-multi-rootfs "
+                        "--image-name=core-image-minimal "
+                        "--rootfs rootfs1=core-image-minimal "
+                        "--rootfs rootfs2=core-image-minimal "
+                        "--outdir %s" % self.resultdir).status
+        self.assertEqual(0, status)
+        self.assertEqual(1, len(glob(self.resultdir + "directdisk-multi-rootfs*.direct")))
 
     @testcase(1269)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_rootfs_artifacts(self):
         """Test usage of rootfs plugin with rootfs paths"""
-        bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
-                        for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
-                                    'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
+        bb_vars = get_bb_vars(['STAGING_DATADIR', 'RECIPE_SYSROOT_NATIVE'],
+                              'wic-tools')
+        bb_vars.update(get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'],
+                                   'core-image-minimal'))
+        bbvars = {key.lower(): value for key, value in bb_vars.items()}
         bbvars['wks'] = "directdisk-multi-rootfs"
+        bbvars['resultdir'] = self.resultdir
         status = runCmd("wic create %(wks)s "
-                        "-b %(staging_datadir)s "
-                        "-k %(deploy_dir_image)s "
-                        "-n %(staging_dir_native)s "
+                        "--bootimg-dir=%(staging_datadir)s "
+                        "--kernel-dir=%(deploy_dir_image)s "
+                        "--native-sysroot=%(recipe_sysroot_native)s "
                         "--rootfs-dir rootfs1=%(image_rootfs)s "
-                        "--rootfs-dir rootfs2=%(image_rootfs)s" \
-                        % bbvars).status
+                        "--rootfs-dir rootfs2=%(image_rootfs)s "
+                        "--outdir %(resultdir)s" % bbvars).status
         self.assertEqual(0, status)
-        self.assertEqual(1, len(glob(self.resultdir + \
-                                     "%(wks)s-*.direct" % bbvars)))
+        self.assertEqual(1, len(glob(self.resultdir + "%(wks)s-*.direct" % bbvars)))
 
-    @testcase(1346)
-    def test_iso_image(self):
-        """Test creation of hybrid iso image with legacy and EFI boot"""
-        self.assertEqual(0, runCmd("wic create mkhybridiso "
-                                   "--image-name core-image-minimal").status)
-        self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct")))
-        self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso")))
+    def test_exclude_path(self):
+        """Test --exclude-path wks option."""
+
+        oldpath = os.environ['PATH']
+        os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
+
+        try:
+            wks_file = 'temp.wks'
+            with open(wks_file, 'w') as wks:
+                rootfs_dir = get_bb_var('IMAGE_ROOTFS', 'core-image-minimal')
+                wks.write("""
+part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path usr
+part /usr --source rootfs --ondisk mmcblk0 --fstype=ext4 --rootfs-dir %s/usr
+part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --rootfs-dir %s/usr"""
+                          % (rootfs_dir, rootfs_dir))
+            self.assertEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
+                                       % (wks_file, self.resultdir)).status)
+
+            os.remove(wks_file)
+            wicout = glob(self.resultdir + "%s-*direct" % 'temp')
+            self.assertEqual(1, len(wicout))
+
+            wicimg = wicout[0]
+
+            # verify partition size with wic
+            res = runCmd("parted -m %s unit b p 2>/dev/null" % wicimg)
+            self.assertEqual(0, res.status)
+
+            # parse parted output which looks like this:
+            # BYT;\n
+            # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n
+            # 1:0.00MiB:200MiB:200MiB:ext4::;\n
+            partlns = res.output.splitlines()[2:]
+
+            self.assertEqual(3, len(partlns))
+
+            for part in [1, 2, 3]:
+                part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part)
+                partln = partlns[part-1].split(":")
+                self.assertEqual(7, len(partln))
+                start = int(partln[1].rstrip("B")) / 512
+                length = int(partln[3].rstrip("B")) / 512
+                self.assertEqual(0, runCmd("dd if=%s of=%s skip=%d count=%d" %
+                                           (wicimg, part_file, start, length)).status)
+
+            def extract_files(debugfs_output):
+                """
+                extract file names from the output of debugfs -R 'ls -p',
+                which looks like this:
+
+                 /2/040755/0/0/.//\n
+                 /2/040755/0/0/..//\n
+                 /11/040700/0/0/lost+found^M//\n
+                 /12/040755/1002/1002/run//\n
+                 /13/040755/1002/1002/sys//\n
+                 /14/040755/1002/1002/bin//\n
+                 /80/040755/1002/1002/var//\n
+                 /92/040755/1002/1002/tmp//\n
+                """
+                # NOTE the occasional ^M in file names
+                return [line.split('/')[5].strip() for line in \
+                        debugfs_output.strip().split('/\n')]
+
+            # Test partition 1, should contain the normal root directories, except
+            # /usr.
+            res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % \
+                             os.path.join(self.resultdir, "selftest_img.part1"))
+            self.assertEqual(0, res.status)
+            files = extract_files(res.output)
+            self.assertIn("etc", files)
+            self.assertNotIn("usr", files)
+
+            # Partition 2, should contain common directories for /usr, not root
+            # directories.
+            res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % \
+                             os.path.join(self.resultdir, "selftest_img.part2"))
+            self.assertEqual(0, res.status)
+            files = extract_files(res.output)
+            self.assertNotIn("etc", files)
+            self.assertNotIn("usr", files)
+            self.assertIn("share", files)
+
+            # Partition 3, should contain the same as partition 2, including the bin
+            # directory, but not the files inside it.
+            res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % \
+                             os.path.join(self.resultdir, "selftest_img.part3"))
+            self.assertEqual(0, res.status)
+            files = extract_files(res.output)
+            self.assertNotIn("etc", files)
+            self.assertNotIn("usr", files)
+            self.assertIn("share", files)
+            self.assertIn("bin", files)
+            res = runCmd("debugfs -R 'ls -p bin' %s 2>/dev/null" % \
+                             os.path.join(self.resultdir, "selftest_img.part3"))
+            self.assertEqual(0, res.status)
+            files = extract_files(res.output)
+            self.assertIn(".", files)
+            self.assertIn("..", files)
+            self.assertEqual(2, len(files))
+
+            for part in [1, 2, 3]:
+                part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part)
+                os.remove(part_file)
+
+        finally:
+            os.environ['PATH'] = oldpath
+
+    def test_exclude_path_errors(self):
+        """Test --exclude-path wks option error handling."""
+        wks_file = 'temp.wks'
+
+        # Absolute argument.
+        with open(wks_file, 'w') as wks:
+            wks.write("part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path /usr")
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
+                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        os.remove(wks_file)
+
+        # Argument pointing to parent directory.
+        with open(wks_file, 'w') as wks:
+            wks.write("part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path ././..")
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
+                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        os.remove(wks_file)
+
+    @testcase(1496)
+    def test_bmap_short(self):
+        """Test generation of .bmap file -m option"""
+        cmd = "wic create wictestdisk -e core-image-minimal -m -o %s" % self.resultdir
+        status = runCmd(cmd).status
+        self.assertEqual(0, status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap")))
+
+    def test_bmap_long(self):
+        """Test generation of .bmap file --bmap option"""
+        cmd = "wic create wictestdisk -e core-image-minimal --bmap -o %s" % self.resultdir
+        status = runCmd(cmd).status
+        self.assertEqual(0, status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap")))
+
+    def _get_image_env_path(self, image):
+        """Generate and obtain the path to <image>.env"""
+        if image not in self.wicenv_cache:
+            self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % image).status)
+            bb_vars = get_bb_vars(['STAGING_DIR', 'MACHINE'], image)
+            stdir = bb_vars['STAGING_DIR']
+            machine = bb_vars['MACHINE']
+            self.wicenv_cache[image] = os.path.join(stdir, machine, 'imgdata')
+        return self.wicenv_cache[image]
 
     @testcase(1347)
     def test_image_env(self):
         """Test generation of <image>.env files."""
         image = 'core-image-minimal'
-        self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % image).status)
-        stdir = get_bb_var('STAGING_DIR_TARGET', image)
-        imgdatadir = os.path.join(stdir, 'imgdata')
+        imgdatadir = self._get_image_env_path(image)
 
-        basename = get_bb_var('IMAGE_BASENAME', image)
+        bb_vars = get_bb_vars(['IMAGE_BASENAME', 'WICVARS'], image)
+        basename = bb_vars['IMAGE_BASENAME']
         self.assertEqual(basename, image)
         path = os.path.join(imgdatadir, basename) + '.env'
         self.assertTrue(os.path.isfile(path))
 
-        wicvars = set(get_bb_var('WICVARS', image).split())
+        wicvars = set(bb_vars['WICVARS'].split())
         # filter out optional variables
-        wicvars = wicvars.difference(('HDDDIR', 'IMAGE_BOOT_FILES',
-                                      'INITRD', 'ISODIR'))
+        wicvars = wicvars.difference(('DEPLOY_DIR_IMAGE', 'IMAGE_BOOT_FILES',
+                                      'INITRD', 'INITRD_LIVE', 'ISODIR'))
         with open(path) as envfile:
             content = dict(line.split("=", 1) for line in envfile)
             # test if variables used by wic present in the .env file
@@ -220,13 +557,41 @@
                 self.assertTrue(var in content, "%s is not in .env file" % var)
                 self.assertTrue(content[var])
 
+    @testcase(1559)
+    def test_image_vars_dir_short(self):
+        """Test image vars directory selection -v option"""
+        image = 'core-image-minimal'
+        imgenvdir = self._get_image_env_path(image)
+
+        self.assertEqual(0, runCmd("wic create wictestdisk "
+                                   "--image-name=%s -v %s -o %s"
+                                   % (image, imgenvdir, self.resultdir)).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+
+    def test_image_vars_dir_long(self):
+        """Test image vars directory selection --vars option"""
+        image = 'core-image-minimal'
+        imgenvdir = self._get_image_env_path(image)
+        self.assertEqual(0, runCmd("wic create wictestdisk "
+                                   "--image-name=%s "
+                                   "--vars %s "
+                                   "--outdir %s"
+                                   % (image, imgenvdir, self.resultdir)).status)
+        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+
     @testcase(1351)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_wic_image_type(self):
         """Test building wic images by bitbake"""
+        config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
+                 'MACHINE_FEATURES_append = " efi"\n'
+        self.append_config(config)
         self.assertEqual(0, bitbake('wic-image-minimal').status)
+        self.remove_config(config)
 
-        deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE')
-        machine = get_bb_var('MACHINE')
+        bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'])
+        deploy_dir = bb_vars['DEPLOY_DIR_IMAGE']
+        machine = bb_vars['MACHINE']
         prefix = os.path.join(deploy_dir, 'wic-image-minimal-%s.' % machine)
         # check if we have result image and manifests symlinks
         # pointing to existing files
@@ -235,68 +600,193 @@
             self.assertTrue(os.path.islink(path))
             self.assertTrue(os.path.isfile(os.path.realpath(path)))
 
-    @testcase(1348)
-    def test_qemux86_directdisk(self):
-        """Test creation of qemux-86-directdisk image"""
-        image = "qemux86-directdisk"
-        self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
-                                   % image).status)
-        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
-
-    @testcase(1349)
-    def test_mkgummidisk(self):
-        """Test creation of mkgummidisk image"""
-        image = "mkgummidisk"
-        self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
-                                   % image).status)
-        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
-
-    @testcase(1350)
-    def test_mkefidisk(self):
-        """Test creation of mkefidisk image"""
-        image = "mkefidisk"
-        self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
-                                   % image).status)
-        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
-
-    @testcase(1385)
-    def test_directdisk_bootloader_config(self):
-        """Test creation of directdisk-bootloader-config image"""
-        image = "directdisk-bootloader-config"
-        self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
-                                   % image).status)
-        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
-
     @testcase(1422)
+    @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_qemu(self):
         """Test wic-image-minimal under qemu"""
+        config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
+                 'MACHINE_FEATURES_append = " efi"\n'
+        self.append_config(config)
         self.assertEqual(0, bitbake('wic-image-minimal').status)
+        self.remove_config(config)
 
         with runqemu('wic-image-minimal', ssh=False) as qemu:
-            command = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
-            status, output = qemu.run_serial(command)
-            self.assertEqual(1, status, 'Failed to run command "%s": %s' % (command, output))
-            self.assertEqual(output, '/dev/root /\r\n/dev/vda3 /mnt')
+            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
+            status, output = qemu.run_serial(cmd)
+            self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+            self.assertEqual(output, '/dev/root /\r\n/dev/sda3 /mnt')
 
-    def test_bmap(self):
-        """Test generation of .bmap file"""
-        image = "directdisk"
-        status = runCmd("wic create %s -e core-image-minimal --bmap" % image).status
-        self.assertEqual(0, status)
-        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
-        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct.bmap" % image)))
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    def test_qemu_efi(self):
+        """Test core-image-minimal efi image under qemu"""
+        config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "mkefidisk.wks"\n'
+        self.append_config(config)
+        self.assertEqual(0, bitbake('core-image-minimal ovmf').status)
+        self.remove_config(config)
 
-    def test_systemd_bootdisk(self):
-        """Test creation of systemd-bootdisk image"""
-        image = "systemd-bootdisk"
-        self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
-                                   % image).status)
-        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
+        with runqemu('core-image-minimal', ssh=False,
+                     runqemuparams='ovmf', image_fstype='wic') as qemu:
+            cmd = "grep sda. /proc/partitions  |wc -l"
+            status, output = qemu.run_serial(cmd)
+            self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+            self.assertEqual(output, '3')
 
-    def test_sdimage_bootpart(self):
-        """Test creation of sdimage-bootpart image"""
-        image = "sdimage-bootpart"
-        self.write_config('IMAGE_BOOT_FILES = "bzImage"\n')
-        self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
-                                   % image).status)
-        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
+    @staticmethod
+    def _make_fixed_size_wks(size):
+        """
+        Create a wks of an image with a single partition. Size of the partition is set
+        using --fixed-size flag. Returns a tuple: (path to wks file, wks image name)
+        """
+        with NamedTemporaryFile("w", suffix=".wks", delete=False) as tempf:
+            wkspath = tempf.name
+            tempf.write("part " \
+                     "--source rootfs --ondisk hda --align 4 --fixed-size %d "
+                     "--fstype=ext4\n" % size)
+        wksname = os.path.splitext(os.path.basename(wkspath))[0]
+
+        return wkspath, wksname
+
+    def test_fixed_size(self):
+        """
+        Test creation of a simple image with partition size controlled through
+        --fixed-size flag
+        """
+        wkspath, wksname = Wic._make_fixed_size_wks(200)
+
+        self.assertEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
+                                   % (wkspath, self.resultdir)).status)
+        os.remove(wkspath)
+        wicout = glob(self.resultdir + "%s-*direct" % wksname)
+        self.assertEqual(1, len(wicout))
+
+        wicimg = wicout[0]
+
+        # verify partition size with wic
+        res = runCmd("parted -m %s unit mib p 2>/dev/null" % wicimg,
+                     ignore_status=True,
+                     native_sysroot=self.native_sysroot)
+        self.assertEqual(0, res.status)
+
+        # parse parted output which looks like this:
+        # BYT;\n
+        # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n
+        # 1:0.00MiB:200MiB:200MiB:ext4::;\n
+        partlns = res.output.splitlines()[2:]
+
+        self.assertEqual(1, len(partlns))
+        self.assertEqual("1:0.00MiB:200MiB:200MiB:ext4::;", partlns[0])
+
+    def test_fixed_size_error(self):
+        """
+        Test creation of a simple image with partition size controlled through
+        --fixed-size flag. The size of partition is intentionally set to 1MiB
+        in order to trigger an error in wic.
+        """
+        wkspath, wksname = Wic._make_fixed_size_wks(1)
+
+        self.assertEqual(1, runCmd("wic create %s -e core-image-minimal -o %s" \
+                                   % (wkspath, self.resultdir), ignore_status=True).status)
+        os.remove(wkspath)
+        wicout = glob(self.resultdir + "%s-*direct" % wksname)
+        self.assertEqual(0, len(wicout))
+
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    def test_rawcopy_plugin_qemu(self):
+        """Test rawcopy plugin in qemu"""
+        # build ext4 and wic images
+        for fstype in ("ext4", "wic"):
+            config = 'IMAGE_FSTYPES = "%s"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' % fstype
+            self.append_config(config)
+            self.assertEqual(0, bitbake('core-image-minimal').status)
+            self.remove_config(config)
+
+        with runqemu('core-image-minimal', ssh=False, image_fstype='wic') as qemu:
+            cmd = "grep sda. /proc/partitions  |wc -l"
+            status, output = qemu.run_serial(cmd)
+            self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+            self.assertEqual(output, '2')
+
+    def test_rawcopy_plugin(self):
+        """Test rawcopy plugin"""
+        img = 'core-image-minimal'
+        machine = get_bb_var('MACHINE', img)
+        with NamedTemporaryFile("w", suffix=".wks") as wks:
+            wks.writelines(['part /boot --active --source bootimg-pcbios\n',
+                            'part / --source rawcopy --sourceparams="file=%s-%s.ext4" --use-uuid\n'\
+                             % (img, machine),
+                            'bootloader --timeout=0 --append="console=ttyS0,115200n8"\n'])
+            wks.flush()
+            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            self.assertEqual(0, runCmd(cmd).status)
+            wksname = os.path.splitext(os.path.basename(wks.name))[0]
+            out = glob(self.resultdir + "%s-*direct" % wksname)
+            self.assertEqual(1, len(out))
+
+    def test_fs_types(self):
+        """Test filesystem types for empty and not empty partitions"""
+        img = 'core-image-minimal'
+        with NamedTemporaryFile("w", suffix=".wks") as wks:
+            wks.writelines(['part ext2   --fstype ext2     --source rootfs\n',
+                            'part btrfs  --fstype btrfs    --source rootfs --size 40M\n',
+                            'part squash --fstype squashfs --source rootfs\n',
+                            'part swap   --fstype swap --size 1M\n',
+                            'part emptyvfat   --fstype vfat   --size 1M\n',
+                            'part emptymsdos  --fstype msdos  --size 1M\n',
+                            'part emptyext2   --fstype ext2   --size 1M\n',
+                            'part emptybtrfs  --fstype btrfs  --size 100M\n'])
+            wks.flush()
+            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            self.assertEqual(0, runCmd(cmd).status)
+            wksname = os.path.splitext(os.path.basename(wks.name))[0]
+            out = glob(self.resultdir + "%s-*direct" % wksname)
+            self.assertEqual(1, len(out))
+
+    def test_kickstart_parser(self):
+        """Test wks parser options"""
+        with NamedTemporaryFile("w", suffix=".wks") as wks:
+            wks.writelines(['part / --fstype ext3 --source rootfs --system-id 0xFF '\
+                            '--overhead-factor 1.2 --size 100k\n'])
+            wks.flush()
+            cmd = "wic create %s -e core-image-minimal -o %s" % (wks.name, self.resultdir)
+            self.assertEqual(0, runCmd(cmd).status)
+            wksname = os.path.splitext(os.path.basename(wks.name))[0]
+            out = glob(self.resultdir + "%s-*direct" % wksname)
+            self.assertEqual(1, len(out))
+
+    def test_image_bootpart_globbed(self):
+        """Test globbed sources with image-bootpart plugin"""
+        img = "core-image-minimal"
+        cmd = "wic create sdimage-bootpart -e %s -o %s" % (img, self.resultdir)
+        config = 'IMAGE_BOOT_FILES = "%s*"' % get_bb_var('KERNEL_IMAGETYPE', img)
+        self.append_config(config)
+        self.assertEqual(0, runCmd(cmd).status)
+        self.remove_config(config)
+        self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct")))
+
+    def test_sparse_copy(self):
+        """Test sparse_copy with FIEMAP and SEEK_HOLE filemap APIs"""
+        libpath = os.path.join(get_bb_var('COREBASE'), 'scripts', 'lib', 'wic')
+        sys.path.insert(0, libpath)
+        from  filemap import FilemapFiemap, FilemapSeek, sparse_copy, ErrorNotSupp
+        with NamedTemporaryFile("w", suffix=".wic-sparse") as sparse:
+            src_name = sparse.name
+            src_size = 1024 * 10
+            sparse.truncate(src_size)
+            # write one byte to the file
+            with open(src_name, 'r+b') as sfile:
+                sfile.seek(1024 * 4)
+                sfile.write(b'\x00')
+            dest = sparse.name + '.out'
+            # copy src file to dest using different filemap APIs
+            for api in (FilemapFiemap, FilemapSeek, None):
+                if os.path.exists(dest):
+                    os.unlink(dest)
+                try:
+                    sparse_copy(sparse.name, dest, api=api)
+                except ErrorNotSupp:
+                    continue # skip unsupported API
+                dest_stat = os.stat(dest)
+                self.assertEqual(dest_stat.st_size, src_size)
+                # 8 blocks is 4K (physical sector size)
+                self.assertEqual(dest_stat.st_blocks, 8)
+            os.unlink(dest)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/targetcontrol.py b/import-layers/yocto-poky/meta/lib/oeqa/targetcontrol.py
index 24669f4..3255e3a 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/targetcontrol.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/targetcontrol.py
@@ -18,8 +18,10 @@
 from oeqa.controllers.testtargetloader import TestTargetLoader
 from abc import ABCMeta, abstractmethod
 
+logger = logging.getLogger('BitBake.QemuRunner')
+
 def get_target_controller(d):
-    testtarget = d.getVar("TEST_TARGET", True)
+    testtarget = d.getVar("TEST_TARGET")
     # old, simple names
     if testtarget == "qemu":
         return QemuTarget(d)
@@ -33,7 +35,7 @@
         except AttributeError:
             # nope, perhaps a layer defined one
             try:
-                bbpath = d.getVar("BBPATH", True).split(':')
+                bbpath = d.getVar("BBPATH").split(':')
                 testtargetloader = TestTargetLoader()
                 controller = testtargetloader.get_controller_module(testtarget, bbpath)
             except ImportError as e:
@@ -51,9 +53,9 @@
         self.connection = None
         self.ip = None
         self.server_ip = None
-        self.datetime = d.getVar('DATETIME', True)
-        self.testdir = d.getVar("TEST_LOG_DIR", True)
-        self.pn = d.getVar("PN", True)
+        self.datetime = d.getVar('DATETIME')
+        self.testdir = d.getVar("TEST_LOG_DIR")
+        self.pn = d.getVar("PN")
 
     @abstractmethod
     def deploy(self):
@@ -63,7 +65,7 @@
         if os.path.islink(sshloglink):
             os.unlink(sshloglink)
         os.symlink(self.sshlog, sshloglink)
-        bb.note("SSH log file: %s" %  self.sshlog)
+        logger.info("SSH log file: %s" %  self.sshlog)
 
     @abstractmethod
     def start(self, params=None, ssh=True, extra_bootparams=None):
@@ -80,7 +82,7 @@
     @classmethod
     def match_image_fstype(self, d, image_fstypes=None):
         if not image_fstypes:
-            image_fstypes = d.getVar('IMAGE_FSTYPES', True).split(' ')
+            image_fstypes = d.getVar('IMAGE_FSTYPES').split(' ')
         possible_image_fstypes = [fstype for fstype in self.supported_image_fstypes if fstype in image_fstypes]
         if possible_image_fstypes:
             return possible_image_fstypes[0]
@@ -113,20 +115,26 @@
 
     supported_image_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic']
 
-    def __init__(self, d):
+    def __init__(self, d, image_fstype=None):
 
         super(QemuTarget, self).__init__(d)
 
-        self.image_fstype = self.get_image_fstype(d)
+        self.rootfs = ''
+        self.kernel = ''
+        self.image_fstype = ''
+
+        if d.getVar('FIND_ROOTFS') == '1':
+            self.image_fstype = image_fstype or self.get_image_fstype(d)
+            self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"),  d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype)
+            self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
         self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime)
-        self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True),  d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype)
-        self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
-        dump_target_cmds = d.getVar("testimage_dump_target", True)
-        dump_host_cmds = d.getVar("testimage_dump_host", True)
-        dump_dir = d.getVar("TESTIMAGE_DUMP_DIR", True)
-        if d.getVar("QEMU_USE_KVM", False) is not None \
-           and d.getVar("QEMU_USE_KVM", False) == "True" \
-           and "x86" in d.getVar("MACHINE", True):
+        dump_target_cmds = d.getVar("testimage_dump_target")
+        dump_host_cmds = d.getVar("testimage_dump_host")
+        dump_dir = d.getVar("TESTIMAGE_DUMP_DIR")
+        qemu_use_kvm = d.getVar("QEMU_USE_KVM")
+        if qemu_use_kvm and \
+           (qemu_use_kvm == "True" and "x86" in d.getVar("MACHINE") or \
+            d.getVar("MACHINE") in qemu_use_kvm.split()):
             use_kvm = True
         else:
             use_kvm = False
@@ -135,32 +143,31 @@
         import oe.path
         bb.utils.mkdirhier(self.testdir)
         self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime)
-        logger = logging.getLogger('BitBake.QemuRunner')
         loggerhandler = logging.FileHandler(self.qemurunnerlog)
         loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
         logger.addHandler(loggerhandler)
         oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True)
 
-        if d.getVar("DISTRO", True) == "poky-tiny":
-            self.runner = QemuTinyRunner(machine=d.getVar("MACHINE", True),
+        if d.getVar("DISTRO") == "poky-tiny":
+            self.runner = QemuTinyRunner(machine=d.getVar("MACHINE"),
                             rootfs=self.rootfs,
-                            tmpdir = d.getVar("TMPDIR", True),
-                            deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE", True),
-                            display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True),
+                            tmpdir = d.getVar("TMPDIR"),
+                            deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE"),
+                            display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"),
                             logfile = self.qemulog,
                             kernel = self.kernel,
-                            boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True)))
+                            boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")))
         else:
-            self.runner = QemuRunner(machine=d.getVar("MACHINE", True),
+            self.runner = QemuRunner(machine=d.getVar("MACHINE"),
                             rootfs=self.rootfs,
-                            tmpdir = d.getVar("TMPDIR", True),
-                            deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE", True),
-                            display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True),
+                            tmpdir = d.getVar("TMPDIR"),
+                            deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE"),
+                            display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"),
                             logfile = self.qemulog,
-                            boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True)),
+                            boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")),
                             use_kvm = use_kvm,
                             dump_dir = dump_dir,
-                            dump_host_cmds = d.getVar("testimage_dump_host", True))
+                            dump_host_cmds = d.getVar("testimage_dump_host"))
 
         self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
 
@@ -172,12 +179,17 @@
             os.unlink(qemuloglink)
         os.symlink(self.qemulog, qemuloglink)
 
-        bb.note("rootfs file: %s" %  self.rootfs)
-        bb.note("Qemu log file: %s" % self.qemulog)
+        logger.info("rootfs file: %s" %  self.rootfs)
+        logger.info("Qemu log file: %s" % self.qemulog)
         super(QemuTarget, self).deploy()
 
-    def start(self, params=None, ssh=True, extra_bootparams=None):
-        if self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams):
+    def start(self, params=None, ssh=True, extra_bootparams='', runqemuparams='', launch_cmd='', discard_writes=True):
+        if launch_cmd:
+            start = self.runner.launch(get_ip=ssh, launch_cmd=launch_cmd)
+        else:
+            start = self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams, runqemuparams=runqemuparams, discard_writes=discard_writes)
+
+        if start:
             if ssh:
                 self.ip = self.runner.ip
                 self.server_ip = self.runner.server_ip
@@ -206,28 +218,28 @@
         else:
             raise bb.build.FuncFailed("%s - FAILED to re-start qemu - check the task log and the boot log" % self.pn)
 
-    def run_serial(self, command):
-        return self.runner.run_serial(command)
+    def run_serial(self, command, timeout=5):
+        return self.runner.run_serial(command, timeout=timeout)
 
 
 class SimpleRemoteTarget(BaseTarget):
 
     def __init__(self, d):
         super(SimpleRemoteTarget, self).__init__(d)
-        addr = d.getVar("TEST_TARGET_IP", True) or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
+        addr = d.getVar("TEST_TARGET_IP") or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
         self.ip = addr.split(":")[0]
         try:
             self.port = addr.split(":")[1]
         except IndexError:
             self.port = None
-        bb.note("Target IP: %s" % self.ip)
-        self.server_ip = d.getVar("TEST_SERVER_IP", True)
+        logger.info("Target IP: %s" % self.ip)
+        self.server_ip = d.getVar("TEST_SERVER_IP")
         if not self.server_ip:
             try:
                 self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]
             except Exception as e:
                 bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e)
-        bb.note("Server IP: %s" % self.server_ip)
+        logger.info("Server IP: %s" % self.server_ip)
 
     def deploy(self):
         super(SimpleRemoteTarget, self).deploy()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/__init__.py
index 8f706f3..485de03 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/utils/__init__.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/__init__.py
@@ -36,3 +36,33 @@
 
     new_path = new_path[:-1]
     return new_path
+
+def make_logger_bitbake_compatible(logger):
+    import logging
+
+    """ 
+        Bitbake logger redifines debug() in order to
+        set a level within debug, this breaks compatibility
+        with vainilla logging, so we neeed to redifine debug()
+        method again also add info() method with INFO + 1 level.
+    """
+    def _bitbake_log_debug(*args, **kwargs):
+        lvl = logging.DEBUG
+
+        if isinstance(args[0], int):
+            lvl = args[0]
+            msg = args[1]
+            args = args[2:]
+        else:
+            msg = args[0]
+            args = args[1:]
+
+        logger.log(lvl, msg, *args, **kwargs)
+    
+    def _bitbake_log_info(msg, *args, **kwargs):
+        logger.log(logging.INFO + 1, msg, *args, **kwargs)
+
+    logger.debug = _bitbake_log_debug
+    logger.info = _bitbake_log_info
+
+    return logger
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/buildproject.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/buildproject.py
new file mode 100644
index 0000000..487f08b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/buildproject.py
@@ -0,0 +1,55 @@
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Provides a class for automating build tests for projects
+
+import os
+import re
+import subprocess
+import shutil
+import tempfile
+
+from abc import ABCMeta, abstractmethod
+
+class BuildProject(metaclass=ABCMeta):
+    def __init__(self, uri, foldername=None, tmpdir=None, dl_dir=None):
+        self.uri = uri
+        self.archive = os.path.basename(uri)
+        if not tmpdir:
+            tmpdir = tempfile.mkdtemp(prefix='buildproject')
+        self.localarchive = os.path.join(tmpdir, self.archive)
+        self.dl_dir = dl_dir
+        if foldername:
+            self.fname = foldername
+        else:
+            self.fname = re.sub(r'\.tar\.bz2$|\.tar\.gz$|\.tar\.xz$', '', self.archive)
+
+    # Download self.archive to self.localarchive
+    def _download_archive(self):
+        if self.dl_dir and os.path.exists(os.path.join(self.dl_dir, self.archive)):
+            shutil.copyfile(os.path.join(self.dl_dir, self.archive), self.localarchive)
+            return
+
+        cmd = "wget -O %s %s" % (self.localarchive, self.uri)
+        subprocess.check_output(cmd, shell=True)
+
+    # This method should provide a way to run a command in the desired environment.
+    @abstractmethod
+    def _run(self, cmd):
+        pass
+
+    # The timeout parameter of target.run is set to 0 to make the ssh command
+    # run with no timeout.
+    def run_configure(self, configure_args='', extra_cmds=''):
+        return self._run('cd %s; gnu-configize; %s ./configure %s' % (self.targetdir, extra_cmds, configure_args))
+
+    def run_make(self, make_args=''):
+        return self._run('cd %s; make %s' % (self.targetdir, make_args))
+
+    def run_install(self, install_args=''):
+        return self._run('cd %s; make install %s' % (self.targetdir, install_args))
+
+    def clean(self):
+        self._run('rm -rf %s' % self.targetdir)
+        subprocess.call('rm -f %s' % self.localarchive, shell=True)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/commands.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/commands.py
index 5cd0f74..57286fc 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/utils/commands.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/commands.py
@@ -97,9 +97,17 @@
     pass
 
 
-def runCmd(command, ignore_status=False, timeout=None, assert_error=True, **options):
+def runCmd(command, ignore_status=False, timeout=None, assert_error=True,
+          native_sysroot=None, limit_exc_output=0, **options):
     result = Result()
 
+    if native_sysroot:
+        extra_paths = "%s/sbin:%s/usr/sbin:%s/usr/bin" % \
+                      (native_sysroot, native_sysroot, native_sysroot)
+        nenv = dict(options.get('env', os.environ))
+        nenv['PATH'] = extra_paths + ':' + nenv.get('PATH', '')
+        options['env'] = nenv
+
     cmd = Command(command, timeout=timeout, **options)
     cmd.run()
 
@@ -110,10 +118,16 @@
     result.pid = cmd.process.pid
 
     if result.status and not ignore_status:
+        exc_output = result.output
+        if limit_exc_output > 0:
+            split = result.output.splitlines()
+            if len(split) > limit_exc_output:
+                exc_output = "\n... (last %d lines of output)\n" % limit_exc_output + \
+                             '\n'.join(split[-limit_exc_output:])
         if assert_error:
-            raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, result.output))
+            raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
         else:
-            raise CommandError(result.status, command, result.output)
+            raise CommandError(result.status, command, exc_output)
 
     return result
 
@@ -149,7 +163,9 @@
     """Get values of multiple bitbake variables"""
     bbenv = get_bb_env(target, postconfig=postconfig)
 
-    var_re = re.compile(r'^(export )?(?P<var>\w+)="(?P<value>.*)"$')
+    if variables is not None:
+        variables = variables.copy()
+    var_re = re.compile(r'^(export )?(?P<var>\w+(_.*)?)="(?P<value>.*)"$')
     unset_re = re.compile(r'^unset (?P<var>\w+)$')
     lastline = None
     values = {}
@@ -209,21 +225,30 @@
 
 
 @contextlib.contextmanager
-def runqemu(pn, ssh=True):
+def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, qemuparams=None, overrides={}, discard_writes=True):
+    """
+    launch_cmd means directly run the command, don't need set rootfs or env vars.
+    """
 
     import bb.tinfoil
     import bb.build
 
     tinfoil = bb.tinfoil.Tinfoil()
-    tinfoil.prepare(False)
+    tinfoil.prepare(config_only=False, quiet=True)
     try:
         tinfoil.logger.setLevel(logging.WARNING)
         import oeqa.targetcontrol
         tinfoil.config_data.setVar("TEST_LOG_DIR", "${WORKDIR}/testimage")
         tinfoil.config_data.setVar("TEST_QEMUBOOT_TIMEOUT", "1000")
-        import oe.recipeutils
-        recipefile = oe.recipeutils.pn_to_recipe(tinfoil.cooker, pn)
-        recipedata = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, [])
+        # Tell QemuTarget() whether need find rootfs/kernel or not
+        if launch_cmd:
+            tinfoil.config_data.setVar("FIND_ROOTFS", '0')
+        else:
+            tinfoil.config_data.setVar("FIND_ROOTFS", '1')
+
+        recipedata = tinfoil.parse_recipe(pn)
+        for key, value in overrides.items():
+            recipedata.setVar(key, value)
 
         # The QemuRunner log is saved out, but we need to ensure it is at the right
         # log level (and then ensure that since it's a child of the BitBake logger,
@@ -231,9 +256,9 @@
         logger = logging.getLogger('BitBake.QemuRunner')
         logger.setLevel(logging.DEBUG)
         logger.propagate = False
-        logdir = recipedata.getVar("TEST_LOG_DIR", True)
+        logdir = recipedata.getVar("TEST_LOG_DIR")
 
-        qemu = oeqa.targetcontrol.QemuTarget(recipedata)
+        qemu = oeqa.targetcontrol.QemuTarget(recipedata, image_fstype)
     finally:
         # We need to shut down tinfoil early here in case we actually want
         # to run tinfoil-using utilities with the running QEMU instance.
@@ -253,7 +278,7 @@
     try:
         qemu.deploy()
         try:
-            qemu.start(ssh=ssh)
+            qemu.start(params=qemuparams, ssh=ssh, runqemuparams=runqemuparams, launch_cmd=launch_cmd, discard_writes=discard_writes)
         except bb.build.FuncFailed:
             raise Exception('Failed to start QEMU - see the logs in %s' % logdir)
 
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/decorators.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/decorators.py
index 25f9c54..d876896 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/utils/decorators.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/decorators.py
@@ -172,18 +172,19 @@
 
         #check status of tests and record it
 
+        tcid = self.id()
         for (name, msg) in result.errors:
-            if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+            if tcid == name.id():
                 local_log.results("Testcase "+str(test_case)+": ERROR")
                 local_log.results("Testcase "+str(test_case)+":\n"+msg)
                 passed = False
         for (name, msg) in result.failures:
-            if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+            if tcid == name.id():
                 local_log.results("Testcase "+str(test_case)+": FAILED")
                 local_log.results("Testcase "+str(test_case)+":\n"+msg)
                 passed = False
         for (name, msg) in result.skipped:
-            if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+            if tcid == name.id():
                 local_log.results("Testcase "+str(test_case)+": SKIPPED")
                 passed = False
         if passed:
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/dump.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/dump.py
index 71422a9..5a7edc1 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/utils/dump.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/dump.py
@@ -5,12 +5,6 @@
 import itertools
 from .commands import runCmd
 
-def get_host_dumper(d):
-    cmds = d.getVar("testimage_dump_host", True)
-    parent_dir = d.getVar("TESTIMAGE_DUMP_DIR", True)
-    return HostDumper(cmds, parent_dir)
-
-
 class BaseDumper(object):
     """ Base class to dump commands from host/target """
 
@@ -77,13 +71,12 @@
             result = runCmd(cmd, ignore_status=True)
             self._write_dump(cmd.split()[0], result.output)
 
-
 class TargetDumper(BaseDumper):
     """ Class to get dumps from target, it only works with QemuRunner """
 
-    def __init__(self, cmds, parent_dir, qemurunner):
+    def __init__(self, cmds, parent_dir, runner):
         super(TargetDumper, self).__init__(cmds, parent_dir)
-        self.runner = qemurunner
+        self.runner = runner
 
     def dump_target(self, dump_dir=""):
         if dump_dir:
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/git.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/git.py
index ae85d27..e0cb3f0 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/utils/git.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/git.py
@@ -16,8 +16,17 @@
 class GitRepo(object):
     """Class representing a Git repository clone"""
     def __init__(self, path, is_topdir=False):
-        self.top_dir = self._run_git_cmd_at(['rev-parse', '--show-toplevel'],
-                                            path)
+        git_dir = self._run_git_cmd_at(['rev-parse', '--git-dir'], path)
+        git_dir = git_dir if os.path.isabs(git_dir) else os.path.join(path, git_dir)
+        self.git_dir = os.path.realpath(git_dir)
+
+        if self._run_git_cmd_at(['rev-parse', '--is-bare-repository'], path) == 'true':
+            self.bare = True
+            self.top_dir = self.git_dir
+        else:
+            self.bare = False
+            self.top_dir = self._run_git_cmd_at(['rev-parse', '--show-toplevel'],
+                                                path)
         realpath = os.path.realpath(path)
         if is_topdir and realpath != self.top_dir:
             raise GitError("{} is not a Git top directory".format(realpath))
@@ -36,9 +45,12 @@
         return ret.output.strip()
 
     @staticmethod
-    def init(path):
+    def init(path, bare=False):
         """Initialize a new Git repository"""
-        GitRepo._run_git_cmd_at('init', cwd=path)
+        cmd = ['init']
+        if bare:
+            cmd.append('--bare')
+        GitRepo._run_git_cmd_at(cmd, cwd=path)
         return GitRepo(path, is_topdir=True)
 
     def run_cmd(self, git_args, env_update=None):
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/metadata.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/metadata.py
new file mode 100644
index 0000000..cb81155
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/metadata.py
@@ -0,0 +1,118 @@
+# Copyright (C) 2016 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+#
+# Functions to get metadata from the testing host used
+# for analytics of test results.
+
+from collections import OrderedDict
+from collections.abc import MutableMapping
+from xml.dom.minidom import parseString
+from xml.etree.ElementTree import Element, tostring
+
+from oeqa.utils.commands import runCmd, get_bb_vars
+
+def get_os_release():
+    """Get info from /etc/os-release as a dict"""
+    data = OrderedDict()
+    os_release_file = '/etc/os-release'
+    if not os.path.exists(os_release_file):
+        return None
+    with open(os_release_file) as fobj:
+        for line in fobj:
+            key, value = line.split('=', 1)
+            data[key.strip().lower()] = value.strip().strip('"')
+    return data
+
+def metadata_from_bb():
+    """ Returns test's metadata as OrderedDict.
+
+        Data will be gathered using bitbake -e thanks to get_bb_vars.
+    """
+    metadata_config_vars = ('MACHINE', 'BB_NUMBER_THREADS', 'PARALLEL_MAKE')
+
+    info_dict = OrderedDict()
+    hostname = runCmd('hostname')
+    info_dict['hostname'] = hostname.output
+    data_dict = get_bb_vars()
+
+    # Distro information
+    info_dict['distro'] = {'id': data_dict['DISTRO'],
+                           'version_id': data_dict['DISTRO_VERSION'],
+                           'pretty_name': '%s %s' % (data_dict['DISTRO'], data_dict['DISTRO_VERSION'])}
+
+    # Host distro information
+    os_release = get_os_release()
+    if os_release:
+        info_dict['host_distro'] = OrderedDict()
+        for key in ('id', 'version_id', 'pretty_name'):
+            if key in os_release:
+                info_dict['host_distro'][key] = os_release[key]
+
+    info_dict['layers'] = get_layers(data_dict['BBLAYERS'])
+    info_dict['bitbake'] = git_rev_info(os.path.dirname(bb.__file__))
+
+    info_dict['config'] = OrderedDict()
+    for var in sorted(metadata_config_vars):
+        info_dict['config'][var] = data_dict[var]
+    return info_dict
+
+def metadata_from_data_store(d):
+    """ Returns test's metadata as OrderedDict.
+
+        Data will be collected from the provided data store.
+    """
+    # TODO: Getting metadata from the data store would
+    # be useful when running within bitbake.
+    pass
+
+def git_rev_info(path):
+    """Get git revision information as a dict"""
+    from git import Repo, InvalidGitRepositoryError, NoSuchPathError
+
+    info = OrderedDict()
+    try:
+        repo = Repo(path, search_parent_directories=True)
+    except (InvalidGitRepositoryError, NoSuchPathError):
+        return info
+    info['commit'] = repo.head.commit.hexsha
+    info['commit_count'] = repo.head.commit.count()
+    try:
+        info['branch'] = repo.active_branch.name
+    except TypeError:
+        info['branch'] = '(nobranch)'
+    return info
+
+def get_layers(layers):
+    """Returns layer information in dict format"""
+    layer_dict = OrderedDict()
+    for layer in layers.split():
+        layer_name = os.path.basename(layer)
+        layer_dict[layer_name] = git_rev_info(layer)
+    return layer_dict
+
+def write_metadata_file(file_path, metadata):
+    """ Writes metadata to a XML file in directory. """
+
+    xml = dict_to_XML('metadata', metadata)
+    xml_doc = parseString(tostring(xml).decode('UTF-8'))
+    with open(file_path, 'w') as f:
+        f.write(xml_doc.toprettyxml())
+
+def dict_to_XML(tag, dictionary, **kwargs):
+    """ Return XML element converting dicts recursively. """
+
+    elem = Element(tag, **kwargs)
+    for key, val in dictionary.items():
+        if tag == 'layers':
+            child = (dict_to_XML('layer', val, name=key))
+        elif isinstance(val, MutableMapping):
+            child = (dict_to_XML(key, val))
+        else:
+            if tag == 'config':
+                child = Element('variable', name=key)
+            else:
+                child = Element(key)
+            child.text = str(val)
+        elem.append(child)
+    return elem
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/package_manager.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/package_manager.py
index 099ecc9..724afb2 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/utils/package_manager.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/package_manager.py
@@ -1,29 +1,210 @@
+import os
+import json
+import shutil
+
+from oeqa.core.utils.test import getCaseFile, getCaseMethod
+
 def get_package_manager(d, root_path):
     """
     Returns an OE package manager that can install packages in root_path.
     """
     from oe.package_manager import RpmPM, OpkgPM, DpkgPM
 
-    pkg_class = d.getVar("IMAGE_PKGTYPE", True)
+    pkg_class = d.getVar("IMAGE_PKGTYPE")
     if pkg_class == "rpm":
         pm = RpmPM(d,
                    root_path,
-                   d.getVar('TARGET_VENDOR', True))
+                   d.getVar('TARGET_VENDOR'))
         pm.create_configs()
 
     elif pkg_class == "ipk":
         pm = OpkgPM(d,
                     root_path,
-                    d.getVar("IPKGCONF_TARGET", True),
-                    d.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True))
+                    d.getVar("IPKGCONF_TARGET"),
+                    d.getVar("ALL_MULTILIB_PACKAGE_ARCHS"))
 
     elif pkg_class == "deb":
         pm = DpkgPM(d,
                     root_path,
-                    d.getVar('PACKAGE_ARCHS', True),
-                    d.getVar('DPKG_ARCH', True))
+                    d.getVar('PACKAGE_ARCHS'),
+                    d.getVar('DPKG_ARCH'))
 
     pm.write_index()
     pm.update()
 
     return pm
+
+def find_packages_to_extract(test_suite):
+    """
+    Returns packages to extract required by runtime tests.
+    """
+    from oeqa.core.utils.test import getSuiteCasesFiles
+
+    needed_packages = {}
+    files = getSuiteCasesFiles(test_suite)
+
+    for f in set(files):
+        json_file = _get_json_file(f)
+        if json_file:
+            needed_packages.update(_get_needed_packages(json_file))
+
+    return needed_packages
+
+def _get_json_file(module_path):
+    """
+    Returns the path of the JSON file for a module, empty if doesn't exitst.
+    """
+
+    json_file = '%s.json' % module_path.rsplit('.', 1)[0]
+    if os.path.isfile(module_path) and os.path.isfile(json_file):
+        return json_file
+    else:
+        return ''
+
+def _get_needed_packages(json_file, test=None):
+    """
+    Returns a dict with needed packages based on a JSON file.
+
+    If a test is specified it will return the dict just for that test.
+    """
+    needed_packages = {}
+
+    with open(json_file) as f:
+        test_packages = json.load(f)
+    for key,value in test_packages.items():
+        needed_packages[key] = value
+
+    if test:
+        if test in needed_packages:
+            needed_packages = needed_packages[test]
+        else:
+            needed_packages = {}
+
+    return needed_packages
+
+def extract_packages(d, needed_packages):
+    """
+    Extract packages that will be needed during runtime.
+    """
+
+    import bb
+    import oe.path
+
+    extracted_path = d.getVar('TEST_EXTRACTED_DIR')
+
+    for key,value in needed_packages.items():
+        packages = ()
+        if isinstance(value, dict):
+            packages = (value, )
+        elif isinstance(value, list):
+            packages = value
+        else:
+            bb.fatal('Failed to process needed packages for %s; '
+                     'Value must be a dict or list' % key)
+
+        for package in packages:
+            pkg = package['pkg']
+            rm = package.get('rm', False)
+            extract = package.get('extract', True)
+
+            if extract:
+                #logger.debug(1, 'Extracting %s' % pkg)
+                dst_dir = os.path.join(extracted_path, pkg)
+                # Same package used for more than one test,
+                # don't need to extract again.
+                if os.path.exists(dst_dir):
+                    continue
+
+                # Extract package and copy it to TEST_EXTRACTED_DIR
+                pkg_dir = _extract_in_tmpdir(d, pkg)
+                oe.path.copytree(pkg_dir, dst_dir)
+                shutil.rmtree(pkg_dir)
+
+            else:
+                #logger.debug(1, 'Copying %s' % pkg)
+                _copy_package(d, pkg)
+
+def _extract_in_tmpdir(d, pkg):
+    """"
+    Returns path to a temp directory where the package was
+    extracted without dependencies.
+    """
+
+    from oeqa.utils.package_manager import get_package_manager
+
+    pkg_path = os.path.join(d.getVar('TEST_INSTALL_TMP_DIR'), pkg)
+    pm = get_package_manager(d, pkg_path)
+    extract_dir = pm.extract(pkg)
+    shutil.rmtree(pkg_path)
+
+    return extract_dir
+
+def _copy_package(d, pkg):
+    """
+    Copy the RPM, DEB or IPK package to dst_dir
+    """
+
+    from oeqa.utils.package_manager import get_package_manager
+
+    pkg_path = os.path.join(d.getVar('TEST_INSTALL_TMP_DIR'), pkg)
+    dst_dir = d.getVar('TEST_PACKAGED_DIR')
+    pm = get_package_manager(d, pkg_path)
+    pkg_info = pm.package_info(pkg)
+    file_path = pkg_info[pkg]['filepath']
+    shutil.copy2(file_path, dst_dir)
+    shutil.rmtree(pkg_path)
+
+def install_package(test_case):
+    """
+    Installs package in DUT if required.
+    """
+    needed_packages = test_needs_package(test_case)
+    if needed_packages:
+        _install_uninstall_packages(needed_packages, test_case, True)
+
+def uninstall_package(test_case):
+    """
+    Uninstalls package in DUT if required.
+    """
+    needed_packages = test_needs_package(test_case)
+    if needed_packages:
+        _install_uninstall_packages(needed_packages, test_case, False)
+
+def test_needs_package(test_case):
+    """
+    Checks if a test case requires to install/uninstall packages.
+    """
+    test_file = getCaseFile(test_case)
+    json_file = _get_json_file(test_file)
+
+    if json_file:
+        test_method = getCaseMethod(test_case)
+        needed_packages = _get_needed_packages(json_file, test_method)
+        if needed_packages:
+            return needed_packages
+
+    return None
+
+def _install_uninstall_packages(needed_packages, test_case, install=True):
+    """
+    Install/Uninstall packages in the DUT without using a package manager
+    """
+
+    if isinstance(needed_packages, dict):
+        packages = [needed_packages]
+    elif isinstance(needed_packages, list):
+        packages = needed_packages
+
+    for package in packages:
+        pkg = package['pkg']
+        rm = package.get('rm', False)
+        extract = package.get('extract', True)
+        src_dir = os.path.join(test_case.tc.extract_dir, pkg)
+
+        # Install package
+        if install and extract:
+            test_case.tc.target.copyDirTo(src_dir, '/')
+
+        # Uninstall package
+        elif not install and rm:
+            test_case.tc.target.deleteDirStructure(src_dir, '/')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/qemurunner.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/qemurunner.py
index 8f1b5b9..ba44b96 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/utils/qemurunner.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/qemurunner.py
@@ -7,6 +7,7 @@
 
 import subprocess
 import os
+import sys
 import time
 import signal
 import re
@@ -36,10 +37,12 @@
         self.runqemu = None
         # pid of the qemu process that runqemu will start
         self.qemupid = None
-        # target ip - from the command line
+        # target ip - from the command line or runqemu output
         self.ip = None
         # host ip - where qemu is running
         self.server_ip = None
+        # target ip netmask
+        self.netmask = None
 
         self.machine = machine
         self.rootfs = rootfs
@@ -73,7 +76,7 @@
         if self.logfile:
             # It is needed to sanitize the data received from qemu
             # because is possible to have control characters
-            msg = msg.decode("utf-8")
+            msg = msg.decode("utf-8", errors='ignore')
             msg = re_control_char.sub('', msg)
             with codecs.open(self.logfile, "a", encoding="utf-8") as f:
                 f.write("%s" % msg)
@@ -94,7 +97,7 @@
                 self._dump_host()
                 raise SystemExit
 
-    def start(self, qemuparams = None, get_ip = True, extra_bootparams = None):
+    def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None, discard_writes=True):
         if self.display:
             os.environ["DISPLAY"] = self.display
             # Set this flag so that Qemu doesn't do any grabs as SDL grabs
@@ -114,6 +117,20 @@
         else:
             os.environ["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image
 
+        if not launch_cmd:
+            launch_cmd = 'runqemu %s %s ' % ('snapshot' if discard_writes else '', runqemuparams)
+            if self.use_kvm:
+                logger.info('Using kvm for runqemu')
+                launch_cmd += ' kvm'
+            else:
+                logger.info('Not using kvm for runqemu')
+            if not self.display:
+                launch_cmd += ' nographic'
+            launch_cmd += ' %s %s' % (self.machine, self.rootfs)
+
+        return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams)
+
+    def launch(self, launch_cmd, get_ip = True, qemuparams = None, extra_bootparams = None):
         try:
             threadsock, threadport = self.create_socket()
             self.server_socket, self.serverport = self.create_socket()
@@ -121,27 +138,19 @@
             logger.error("Failed to create listening socket: %s" % msg[1])
             return False
 
-
         bootparams = 'console=tty1 console=ttyS0,115200n8 printk.time=1'
         if extra_bootparams:
             bootparams = bootparams + ' ' + extra_bootparams
 
         self.qemuparams = 'bootparams="{0}" qemuparams="-serial tcp:127.0.0.1:{1}"'.format(bootparams, threadport)
-        if not self.display:
-            self.qemuparams = 'nographic ' + self.qemuparams
         if qemuparams:
             self.qemuparams = self.qemuparams[:-1] + " " + qemuparams + " " + '\"'
 
+        launch_cmd += ' tcpserial=%s %s' % (self.serverport, self.qemuparams)
+
         self.origchldhandler = signal.getsignal(signal.SIGCHLD)
         signal.signal(signal.SIGCHLD, self.handleSIGCHLD)
 
-        launch_cmd = 'runqemu snapshot '
-        if self.use_kvm:
-            logger.info('Using kvm for runqemu')
-            launch_cmd += 'kvm '
-        else:
-            logger.info('Not using kvm for runqemu')
-        launch_cmd += 'tcpserial=%s %s %s %s' % (self.serverport, self.machine, self.rootfs, self.qemuparams)
         logger.info('launchcmd=%s'%(launch_cmd))
 
         # FIXME: We pass in stdin=subprocess.PIPE here to work around stty
@@ -191,6 +200,8 @@
                     return False
             time.sleep(1)
 
+        out = self.getOutput(output)
+        netconf = False # network configuration is not required by default
         if self.is_alive():
             logger.info("qemu started - qemu procces pid is %s" % self.qemupid)
             if get_ip:
@@ -202,17 +213,27 @@
                     cmdline = re_control_char.sub('', cmdline)
                 try:
                     ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1])
-                    if not ips or len(ips) != 3:
-                        raise ValueError
-                    else:
-                        self.ip = ips[0]
-                        self.server_ip = ips[1]
+                    self.ip = ips[0]
+                    self.server_ip = ips[1]
+                    logger.info("qemu cmdline used:\n{}".format(cmdline))
                 except (IndexError, ValueError):
-                    logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used:\n%s\nand output from runqemu:\n%s" % (cmdline, self.getOutput(output)))
-                    self._dump_host()
-                    self.stop()
-                    return False
-                logger.info("qemu cmdline used:\n{}".format(cmdline))
+                    # Try to get network configuration from runqemu output
+                    match = re.match('.*Network configuration: ([0-9.]+)::([0-9.]+):([0-9.]+)$.*',
+                                     out, re.MULTILINE|re.DOTALL)
+                    if match:
+                        self.ip, self.server_ip, self.netmask = match.groups()
+                        # network configuration is required as we couldn't get it
+                        # from the runqemu command line, so qemu doesn't run kernel
+                        # and guest networking is not configured
+                        netconf = True
+                    else:
+                        logger.error("Couldn't get ip from qemu command line and runqemu output! "
+                                     "Here is the qemu command line used:\n%s\n"
+                                     "and output from runqemu:\n%s" % (cmdline, out))
+                        self._dump_host()
+                        self.stop()
+                        return False
+
                 logger.info("Target IP: %s" % self.ip)
                 logger.info("Server IP: %s" % self.server_ip)
 
@@ -221,12 +242,11 @@
             if not self.thread.connection_established.wait(self.boottime):
                 logger.error("Didn't receive a console connection from qemu. "
                              "Here is the qemu command line used:\n%s\nand "
-                             "output from runqemu:\n%s" % (cmdline,
-                                                           self.getOutput(output)))
+                             "output from runqemu:\n%s" % (cmdline, out))
                 self.stop_thread()
                 return False
 
-            logger.info("Output from runqemu:\n%s", self.getOutput(output))
+            logger.info("Output from runqemu:\n%s", out)
             logger.info("Waiting at most %d seconds for login banner" % self.boottime)
             endtime = time.time() + self.boottime
             socklist = [self.server_socket]
@@ -236,7 +256,10 @@
             bootlog = ''
             data = b''
             while time.time() < endtime and not stopread:
-                sread, swrite, serror = select.select(socklist, [], [], 5)
+                try:
+                    sread, swrite, serror = select.select(socklist, [], [], 5)
+                except InterruptedError:
+                    continue
                 for sock in sread:
                     if sock is self.server_socket:
                         qemusock, addr = self.server_socket.accept()
@@ -278,6 +301,14 @@
                 if re.search("root@[a-zA-Z0-9\-]+:~#", output):
                     self.logged = True
                     logger.info("Logged as root in serial console")
+                    if netconf:
+                        # configure guest networking
+                        cmd = "ifconfig eth0 %s netmask %s up\n" % (self.ip, self.netmask)
+                        output = self.run_serial(cmd, raw=True)[1]
+                        if re.search("root@[a-zA-Z0-9\-]+:~#", output):
+                            logger.info("configured ip address %s", self.ip)
+                        else:
+                            logger.info("Couldn't configure guest networking")
                 else:
                     logger.info("Couldn't login into serial console"
                             " as root using blank password")
@@ -295,6 +326,7 @@
 
     def stop(self):
         self.stop_thread()
+        self.stop_qemu_system()
         if hasattr(self, "origchldhandler"):
             signal.signal(signal.SIGCHLD, self.origchldhandler)
         if self.runqemu:
@@ -319,6 +351,14 @@
         self.qemupid = None
         self.ip = None
 
+    def stop_qemu_system(self):
+        if self.qemupid:
+            try:
+                # qemu-system behaves well and a SIGTERM is enough
+                os.kill(self.qemupid, signal.SIGTERM)
+            except ProcessLookupError as e:
+                logger.warn('qemu-system ended unexpectedly')
+
     def stop_thread(self):
         if self.thread and self.thread.is_alive():
             self.thread.stop()
@@ -385,7 +425,7 @@
             if "qemu-system" in basecmd and "-serial tcp" in commands[p]:
                 return [int(p),commands[p]]
 
-    def run_serial(self, command, raw=False):
+    def run_serial(self, command, raw=False, timeout=5):
         # We assume target system have echo to get command status
         if not raw:
             command = "%s; echo $?\n" % command
@@ -393,20 +433,26 @@
         data = ''
         status = 0
         self.server_socket.sendall(command.encode('utf-8'))
-        keepreading = True
-        while keepreading:
-            sread, _, _ = select.select([self.server_socket],[],[],5)
+        start = time.time()
+        end = start + timeout
+        while True:
+            now = time.time()
+            if now >= end:
+                data += "<<< run_serial(): command timed out after %d seconds without output >>>\r\n\r\n" % timeout
+                break
+            try:
+                sread, _, _ = select.select([self.server_socket],[],[], end - now)
+            except InterruptedError:
+                continue
             if sread:
                 answer = self.server_socket.recv(1024)
                 if answer:
                     data += answer.decode('utf-8')
                     # Search the prompt to stop
                     if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data):
-                        keepreading = False
+                        break
                 else:
                     raise Exception("No data on serial console socket")
-            else:
-                keepreading = False
 
         if data:
             if raw:
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/qemutinyrunner.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/qemutinyrunner.py
index d554f0d..1bf5900 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/utils/qemutinyrunner.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/qemutinyrunner.py
@@ -60,7 +60,7 @@
             with open(self.logfile, "a") as f:
                 f.write("%s" % msg)
 
-    def start(self, qemuparams = None, ssh=True, extra_bootparams=None):
+    def start(self, qemuparams = None, ssh=True, extra_bootparams=None, runqemuparams='', discard_writes=True):
 
         if self.display:
             os.environ["DISPLAY"] = self.display
@@ -107,14 +107,17 @@
 
         return self.is_alive()
 
-    def run_serial(self, command):
+    def run_serial(self, command, timeout=5):
         self.server_socket.sendall(command+'\n')
         data = ''
         status = 0
         stopread = False
-        endtime = time.time()+5
+        endtime = time.time()+timeout
         while time.time()<endtime and not stopread:
-                sread, _, _ = select.select([self.server_socket],[],[],5)
+                try:
+                        sread, _, _ = select.select([self.server_socket],[],[],1)
+                except InterruptedError:
+                        continue
                 for sock in sread:
                         answer = sock.recv(1024)
                         if answer:
@@ -124,6 +127,8 @@
                                 stopread = True
         if not data:
             status = 1
+        if not stopread:
+            data += "<<< run_serial(): command timed out after %d seconds without output >>>\r\n\r\n" % timeout
         return (status, str(data))
 
     def find_child(self,parent_pid):
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/subprocesstweak.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/subprocesstweak.py
new file mode 100644
index 0000000..1f7d11b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/subprocesstweak.py
@@ -0,0 +1,19 @@
+import subprocess
+
+class OETestCalledProcessError(subprocess.CalledProcessError):
+    def __str__(self):
+        def strify(o):
+            if isinstance(o, bytes):
+                return o.decode("utf-8", errors="replace")
+            else:
+                return o
+
+        s = "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
+        if hasattr(self, "output") and self.output:
+            s = s + "\nStandard Output: " + strify(self.output)
+        if hasattr(self, "stderr") and self.stderr:
+            s = s + "\nStandard Error: " + strify(self.stderr)
+        return s
+
+def errors_have_output():
+    subprocess.CalledProcessError = OETestCalledProcessError
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/targetbuild.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/targetbuild.py
index 59593f5..9249fa2 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/utils/targetbuild.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/targetbuild.py
@@ -8,14 +8,19 @@
 import re
 import bb.utils
 import subprocess
+import tempfile
 from abc import ABCMeta, abstractmethod
 
 class BuildProject(metaclass=ABCMeta):
 
-    def __init__(self, d, uri, foldername=None, tmpdir="/tmp/"):
+    def __init__(self, d, uri, foldername=None, tmpdir=None):
         self.d = d
         self.uri = uri
         self.archive = os.path.basename(uri)
+        if not tmpdir:
+            tmpdir = self.d.getVar('WORKDIR')
+            if not tmpdir:
+                tmpdir = tempfile.mkdtemp(prefix='buildproject')
         self.localarchive = os.path.join(tmpdir,self.archive)
         if foldername:
             self.fname = foldername
@@ -24,8 +29,7 @@
 
     # Download self.archive to self.localarchive
     def _download_archive(self):
-
-        dl_dir = self.d.getVar("DL_DIR", True)
+        dl_dir = self.d.getVar("DL_DIR")
         if dl_dir and os.path.exists(os.path.join(dl_dir, self.archive)):
             bb.utils.copyfile(os.path.join(dl_dir, self.archive), self.localarchive)
             return
@@ -40,12 +44,12 @@
 
         cmd = ''
         for var in exportvars:
-            val = self.d.getVar(var, True)
+            val = self.d.getVar(var)
             if val:
                 cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
 
         cmd = cmd + "wget -O %s %s" % (self.localarchive, self.uri)
-        subprocess.check_call(cmd, shell=True)
+        subprocess.check_output(cmd, shell=True)
 
     # This method should provide a way to run a command in the desired environment.
     @abstractmethod
@@ -73,7 +77,7 @@
     def __init__(self, target, d, uri, foldername=None):
         self.target = target
         self.targetdir = "~/"
-        BuildProject.__init__(self, d, uri, foldername, tmpdir="/tmp")
+        BuildProject.__init__(self, d, uri, foldername)
 
     def download_archive(self):
 
@@ -103,8 +107,8 @@
         self.testdir = testpath
         self.targetdir = testpath
         bb.utils.mkdirhier(testpath)
-        self.datetime = d.getVar('DATETIME', True)
-        self.testlogdir = d.getVar("TEST_LOG_DIR", True)
+        self.datetime = d.getVar('DATETIME')
+        self.testlogdir = d.getVar("TEST_LOG_DIR")
         bb.utils.mkdirhier(self.testlogdir)
         self.logfile = os.path.join(self.testlogdir, "sdk_target_log.%s" % self.datetime)
         BuildProject.__init__(self, d, uri, foldername, tmpdir=testpath)
@@ -114,7 +118,7 @@
         self._download_archive()
 
         cmd = 'tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir)
-        subprocess.check_call(cmd, shell=True)
+        subprocess.check_output(cmd, shell=True)
 
         #Change targetdir to project folder
         self.targetdir = os.path.join(self.targetdir, self.fname)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/testexport.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/testexport.py
index 57be2ca..be2a211 100644
--- a/import-layers/yocto-poky/meta/lib/oeqa/utils/testexport.py
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/testexport.py
@@ -72,9 +72,9 @@
         return extract_bin_command
 
     if determine_if_poky_env(): # machine with poky environment
-        exportpath = d.getVar("TEST_EXPORT_DIR", True) if export_env else d.getVar("DEPLOY_DIR", True)
-        rpm_deploy_dir = d.getVar("DEPLOY_DIR_RPM", True)
-        arch = get_dest_folder(d.getVar("TUNE_FEATURES", True), os.listdir(rpm_deploy_dir))
+        exportpath = d.getVar("TEST_EXPORT_DIR") if export_env else d.getVar("DEPLOY_DIR")
+        rpm_deploy_dir = d.getVar("DEPLOY_DIR_RPM")
+        arch = get_dest_folder(d.getVar("TUNE_FEATURES"), os.listdir(rpm_deploy_dir))
         arch_rpm_dir = os.path.join(rpm_deploy_dir, arch)
         extracted_bin_dir = os.path.join(exportpath,"binaries", arch, "extracted_binaries")
         packaged_bin_dir = os.path.join(exportpath,"binaries", arch, "packaged_binaries")
@@ -92,7 +92,7 @@
                     return ""
                 for item in native_rpm_file_list:# will copy all versions of package. Used version will be selected on remote machine
                     bb.plain("Copying native package file: %s" % item)
-                    sh.copy(os.path.join(rpm_deploy_dir, native_rpm_dir, item), os.path.join(d.getVar("TEST_EXPORT_DIR", True), "binaries", "native"))
+                    sh.copy(os.path.join(rpm_deploy_dir, native_rpm_dir, item), os.path.join(d.getVar("TEST_EXPORT_DIR"), "binaries", "native"))
             else: # nothing to do here; running tests under bitbake, so we asume native binaries are in sysroots dir.
                 if param_list[1] or param_list[4]:
                     bb.warn("Native binary %s %s%s. Running tests under bitbake environment. Version can't be checked except when the test itself does it"
@@ -148,7 +148,7 @@
         else: # this is for target device
             if param_list[2] == "rpm":
                 return "No need to extract, this is an .rpm file"
-            arch = get_dest_folder(d.getVar("TUNE_FEATURES", True), os.listdir(binaries_path))
+            arch = get_dest_folder(d.getVar("TUNE_FEATURES"), os.listdir(binaries_path))
             extracted_bin_path = os.path.join(binaries_path, arch, "extracted_binaries")
             extracted_bin_list = [item for item in os.listdir(extracted_bin_path)]
             packaged_bin_path = os.path.join(binaries_path, arch, "packaged_binaries")
@@ -206,9 +206,9 @@
     from oeqa.oetest import oeRuntimeTest
     param_list = params
     cleanup_list = list()
-    bins_dir = os.path.join(d.getVar("TEST_EXPORT_DIR", True), "binaries") if determine_if_poky_env() \
+    bins_dir = os.path.join(d.getVar("TEST_EXPORT_DIR"), "binaries") if determine_if_poky_env() \
                     else os.getenv("bin_dir")
-    arch = get_dest_folder(d.getVar("TUNE_FEATURES", True), os.listdir(bins_dir))
+    arch = get_dest_folder(d.getVar("TUNE_FEATURES"), os.listdir(bins_dir))
     arch_rpms_dir = os.path.join(bins_dir, arch, "packaged_binaries")
     extracted_bin_dir = os.path.join(bins_dir, arch, "extracted_binaries", param_list[0])
 
diff --git a/import-layers/yocto-poky/meta/lib/rootfspostcommands.py b/import-layers/yocto-poky/meta/lib/rootfspostcommands.py
new file mode 100644
index 0000000..4742e06
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/rootfspostcommands.py
@@ -0,0 +1,56 @@
+import os
+
+def sort_file(filename, mapping):
+    """
+    Sorts a passwd or group file based on the numeric ID in the third column.
+    If a mapping is given, the name from the first column is mapped via that
+    dictionary instead (necessary for /etc/shadow and /etc/gshadow). If not,
+    a new mapping is created on the fly and returned.
+    """
+    new_mapping = {}
+    with open(filename, 'rb+') as f:
+        lines = f.readlines()
+        # No explicit error checking for the sake of simplicity. /etc
+        # files are assumed to be well-formed, causing exceptions if
+        # not.
+        for line in lines:
+            entries = line.split(b':')
+            name = entries[0]
+            if mapping is None:
+                id = int(entries[2])
+            else:
+                id = mapping[name]
+            new_mapping[name] = id
+        # Sort by numeric id first, with entire line as secondary key
+        # (just in case that there is more than one entry for the same id).
+        lines.sort(key=lambda line: (new_mapping[line.split(b':')[0]], line))
+        # We overwrite the entire file, i.e. no truncate() necessary.
+        f.seek(0)
+        f.write(b''.join(lines))
+    return new_mapping
+
+def remove_backup(filename):
+    """
+    Removes the backup file for files like /etc/passwd.
+    """
+    backup_filename = filename + '-'
+    if os.path.exists(backup_filename):
+        os.unlink(backup_filename)
+
+def sort_passwd(sysconfdir):
+    """
+    Sorts passwd and group files in a rootfs /etc directory by ID.
+    Backup files are sometimes are inconsistent and then cannot be
+    sorted (YOCTO #11043), and more importantly, are not needed in
+    the initial rootfs, so they get deleted.
+    """
+    for main, shadow in (('passwd', 'shadow'),
+                         ('group', 'gshadow')):
+        filename = os.path.join(sysconfdir, main)
+        remove_backup(filename)
+        if os.path.exists(filename):
+            mapping = sort_file(filename, None)
+            filename = os.path.join(sysconfdir, shadow)
+            remove_backup(filename)
+            if os.path.exists(filename):
+                 sort_file(filename, mapping)
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid.inc b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid.inc
index 12ec19b..766ed4f 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid.inc
+++ b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid.inc
@@ -9,6 +9,8 @@
            file://acpid.service \
           "
 
+CVE_PRODUCT = "acpid2"
+
 inherit autotools update-rc.d systemd
 
 INITSCRIPT_NAME = "acpid"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid_2.0.27.bb b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid_2.0.27.bb
deleted file mode 100644
index 509fcfe..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid_2.0.27.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require acpid.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
-                    file://acpid.h;endline=24;md5=324a9cf225ae69ddaad1bf9d942115b5"
-
-SRC_URI[md5sum] = "e41bdf628e122edb4342fca432ea7db9"
-SRC_URI[sha256sum] = "820c223e53cc11d9d7229fb1ffc2c2205f1054082c80f83f5a4ec4df16d3a616"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid_2.0.28.bb b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid_2.0.28.bb
new file mode 100644
index 0000000..686526f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid_2.0.28.bb
@@ -0,0 +1,7 @@
+require acpid.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+                    file://acpid.h;endline=24;md5=324a9cf225ae69ddaad1bf9d942115b5"
+
+SRC_URI[md5sum] = "0432407b5ff75ae8e08afb43052fde2b"
+SRC_URI[sha256sum] = "980c3a54b0d3f2fd49fd845a0584c5c2abeaab9e9ac09fcbb68686bbb57a7110"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb
index 5c30bd5..53cf1cf 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb
@@ -1,8 +1,7 @@
 SUMMARY = "Device formfactor information"
 SECTION = "base"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 PR = "r45"
 
 SRC_URI = "file://config file://machconfig"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/0001-Mark-our-explicit-fall-through-so-Wextra-will-work-i.patch b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/0001-Mark-our-explicit-fall-through-so-Wextra-will-work-i.patch
new file mode 100644
index 0000000..d0aeb2d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/0001-Mark-our-explicit-fall-through-so-Wextra-will-work-i.patch
@@ -0,0 +1,34 @@
+From 676a8a9001f06808b4dbe0a545d76b5d9a8ebf48 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Thu, 2 Feb 2017 13:51:27 -0500
+Subject: [PATCH] Mark our explicit fall through so -Wextra will work in gcc 7
+
+gcc 7 introduces detection of fall-through behavior in switch/case
+statements, and will warn if -Wimplicit-fallthrough is present and there
+is no comment stating that the fall-through is intentional.  This is
+also triggered by -Wextra, as it enables -Wimplicit-fallthrough=1.
+
+This patch adds the comment in the one place we use fall-through.
+
+Signed-off-by: Peter Jones <pjones@redhat.com>
+---
+Upstream-Status: Pending
+
+ lib/print.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/print.c b/lib/print.c
+index b8a9d38..cb732f0 100644
+--- a/lib/print.c
++++ b/lib/print.c
+@@ -1131,6 +1131,7 @@ Returns:
+             case 'X':
+                 Item.Width = Item.Long ? 16 : 8;
+                 Item.Pad = '0';
++		/* falls through */
+             case 'x':
+                 ValueToHex (
+                     Item.Scratch,
+-- 
+2.12.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/aarch64-initplat.c-fix-const-qualifier.patch b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/aarch64-initplat.c-fix-const-qualifier.patch
deleted file mode 100644
index 965f074..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/aarch64-initplat.c-fix-const-qualifier.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From dc83b84dc8b4e71efce47143497aac6c126065cf Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Mon, 18 Jul 2016 08:40:29 -0700
-Subject: [PATCH] lib/aarch64/initplat.c: fix const qualifier
-
-Fixed:
-initplat.c:44:35: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
-     unsigned char *p = dest, *q = src;
-                                   ^~~
-cc1: all warnings being treated as errors
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- lib/aarch64/initplat.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/lib/aarch64/initplat.c b/lib/aarch64/initplat.c
-index 2ac03a7..aae7beb 100644
---- a/lib/aarch64/initplat.c
-+++ b/lib/aarch64/initplat.c
-@@ -41,7 +41,8 @@ void *memset(void *s, int c, __SIZE_TYPE__ n)
- 
- void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n)
- {
--    unsigned char *p = dest, *q = src;
-+    unsigned char *p = dest;
-+    const unsigned char *q = src;
- 
-     while (n--)
-         *p++ = *q++;
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.4.bb b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.4.bb
deleted file mode 100644
index e0d8ee7..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.4.bb
+++ /dev/null
@@ -1,54 +0,0 @@
-SUMMARY = "Libraries for producing EFI binaries"
-HOMEPAGE = "http://sourceforge.net/projects/gnu-efi/"
-SECTION = "devel"
-LICENSE = "GPLv2+ | BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \
-                    file://gnuefi/crt0-efi-aarch64.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \
-                    file://inc/efishellintf.h;beginline=13;endline=20;md5=202766b79d708eff3cc70fce15fb80c7 \
-                    file://inc/efishellparm.h;beginline=4;endline=11;md5=468b1231b05bbc84bae3a0d5774e3bb5 \
-                    file://lib/arm/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
-                    file://lib/arm/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
-                    file://lib/aarch64/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
-                    file://lib/aarch64/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
-                   "
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2 \
-           file://parallel-make-archives.patch \
-           file://lib-Makefile-fix-parallel-issue.patch \
-           file://gcc46-compatibility.patch \
-           file://aarch64-initplat.c-fix-const-qualifier.patch \
-          "
-
-SRC_URI[md5sum] = "612e0f327f31c4b8468ef55f4eeb9649"
-SRC_URI[sha256sum] = "51a00428c3ccb96db24089ed8394843c4f83cf8f42c6a4dfddb4b7c23f2bf8af"
-
-COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
-COMPATIBLE_HOST_armv4 = 'null'
-
-def gnu_efi_arch(d):
-    import re
-    tarch = d.getVar("TARGET_ARCH", True)
-    if re.match("i[3456789]86", tarch):
-        return "ia32"
-    return tarch
-
-EXTRA_OEMAKE = "'ARCH=${@gnu_efi_arch(d)}' 'CC=${CC}' 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \
-                'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' 'PREFIX=${prefix}' 'LIBDIR=${libdir}' \
-                "
-
-# gnu-efi's Makefile treats prefix as toolchain prefix, so don't
-# export it.
-prefix[unexport] = "1"
-
-do_install() {
-        oe_runmake install INSTALLROOT="${D}"
-}
-
-FILES_${PN} += "${libdir}/*.lds"
-
-BBCLASSEXTEND = "native"
-
-# It doesn't support sse, its make.defaults sets:
-# CFLAGS += -mno-mmx -mno-sse
-# So also remove -mfpmath=sse from TUNE_CCARGS
-TUNE_CCARGS_remove = "-mfpmath=sse"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.5.bb b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.5.bb
new file mode 100644
index 0000000..d6f9f53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.5.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Libraries for producing EFI binaries"
+HOMEPAGE = "http://sourceforge.net/projects/gnu-efi/"
+SECTION = "devel"
+LICENSE = "GPLv2+ | BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \
+                    file://gnuefi/crt0-efi-aarch64.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \
+                    file://inc/efishellintf.h;beginline=13;endline=20;md5=202766b79d708eff3cc70fce15fb80c7 \
+                    file://inc/efishellparm.h;beginline=4;endline=11;md5=468b1231b05bbc84bae3a0d5774e3bb5 \
+                    file://lib/arm/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
+                    file://lib/arm/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
+                    file://lib/aarch64/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
+                    file://lib/aarch64/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
+                   "
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2 \
+           file://parallel-make-archives.patch \
+           file://lib-Makefile-fix-parallel-issue.patch \
+           file://gcc46-compatibility.patch \
+           file://0001-Mark-our-explicit-fall-through-so-Wextra-will-work-i.patch \
+           "
+
+SRC_URI[md5sum] = "1f719c9c135778aa6b087b89a1cc2423"
+SRC_URI[sha256sum] = "bd8fcd5914f18fc0e4ba948ab03b00013e528504f529c60739b748f6ef130b22"
+
+COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
+COMPATIBLE_HOST_armv4 = 'null'
+
+do_configure_linux-gnux32_prepend() {
+	cp ${STAGING_INCDIR}/gnu/stubs-x32.h ${STAGING_INCDIR}/gnu/stubs-64.h
+	cp ${STAGING_INCDIR}/bits/long-double-32.h ${STAGING_INCDIR}/bits/long-double-64.h
+}
+
+def gnu_efi_arch(d):
+    import re
+    tarch = d.getVar("TARGET_ARCH")
+    if re.match("i[3456789]86", tarch):
+        return "ia32"
+    return tarch
+
+EXTRA_OEMAKE = "'ARCH=${@gnu_efi_arch(d)}' 'CC=${CC}' 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \
+                'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' 'PREFIX=${prefix}' 'LIBDIR=${libdir}' \
+                "
+
+# gnu-efi's Makefile treats prefix as toolchain prefix, so don't
+# export it.
+prefix[unexport] = "1"
+
+do_install() {
+        oe_runmake install INSTALLROOT="${D}"
+}
+
+FILES_${PN} += "${libdir}/*.lds"
+
+# 64-bit binaries are expected for EFI when targeting X32
+INSANE_SKIP_${PN}-dev_append_linux-gnux32 = " arch"
+
+BBCLASSEXTEND = "native"
+
+# It doesn't support sse, its make.defaults sets:
+# CFLAGS += -mno-mmx -mno-sse
+# So also remove -mfpmath=sse from TUNE_CCARGS
+TUNE_CCARGS_remove = "-mfpmath=sse"
+
+python () {
+    ccargs = d.getVar('TUNE_CCARGS').split()
+    if '-mx32' in ccargs:
+        # use x86_64 EFI ABI
+        ccargs.remove('-mx32')
+        ccargs.append('-m64')
+        d.setVar('TUNE_CCARGS', ' '.join(ccargs))
+}
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-btrfs-avoid-used-uninitialized-error-with-GCC7.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-btrfs-avoid-used-uninitialized-error-with-GCC7.patch
new file mode 100644
index 0000000..217a775
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-btrfs-avoid-used-uninitialized-error-with-GCC7.patch
@@ -0,0 +1,36 @@
+From 6cef7f6079550af3bf91dbff824398eaef08c3c5 Mon Sep 17 00:00:00 2001
+From: Andrei Borzenkov <arvidjaar@gmail.com>
+Date: Tue, 4 Apr 2017 19:22:32 +0300
+Subject: [PATCH 1/4] btrfs: avoid "used uninitialized" error with GCC7
+
+sblock was local and so considered new variable on every loop
+iteration.
+
+Closes: 50597
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ grub-core/fs/btrfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
+index 9cffa91..4849c1c 100644
+--- a/grub-core/fs/btrfs.c
++++ b/grub-core/fs/btrfs.c
+@@ -227,11 +227,11 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data,
+ static grub_err_t
+ read_sblock (grub_disk_t disk, struct grub_btrfs_superblock *sb)
+ {
++  struct grub_btrfs_superblock sblock;
+   unsigned i;
+   grub_err_t err = GRUB_ERR_NONE;
+   for (i = 0; i < ARRAY_SIZE (superblock_sectors); i++)
+     {
+-      struct grub_btrfs_superblock sblock;
+       /* Don't try additional superblocks beyond device size.  */
+       if (i && (grub_le_to_cpu64 (sblock.this_device.size)
+ 		>> GRUB_DISK_SECTOR_BITS) <= superblock_sectors[i])
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch
new file mode 100644
index 0000000..f95b9ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch
@@ -0,0 +1,92 @@
+From 7a5b301e3adb8e054288518a325135a1883c1c6c Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Tue, 19 Apr 2016 14:27:22 -0400
+Subject: [PATCH] build: Use AC_HEADER_MAJOR to find device macros
+
+Depending on the OS/libc, device macros are defined in different
+headers. This change ensures we include the right one.
+
+sys/types.h - BSD
+sys/mkdev.h - Sun
+sys/sysmacros.h - glibc (Linux)
+
+glibc currently pulls sys/sysmacros.h into sys/types.h, but this may
+change in a future release.
+
+https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html
+---
+Upstream-Status: Backport
+
+ configure.ac                         | 3 ++-
+ grub-core/osdep/devmapper/getroot.c  | 6 ++++++
+ grub-core/osdep/devmapper/hostdisk.c | 5 +++++
+ grub-core/osdep/linux/getroot.c      | 6 ++++++
+ grub-core/osdep/unix/getroot.c       | 4 +++-
+ 5 files changed, 22 insertions(+), 2 deletions(-)
+
+Index: grub-2.00/configure.ac
+===================================================================
+--- grub-2.00.orig/configure.ac
++++ grub-2.00/configure.ac
+@@ -326,7 +326,8 @@ fi
+ 
+ # Check for functions and headers.
+ AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent)
+-AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
++AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h)
++AC_HEADER_MAJOR
+ 
+ AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
+ #include <sys/param.h>
+Index: grub-2.00/grub-core/kern/emu/hostdisk.c
+===================================================================
+--- grub-2.00.orig/grub-core/kern/emu/hostdisk.c
++++ grub-2.00/grub-core/kern/emu/hostdisk.c
+@@ -41,6 +41,12 @@
+ #include <errno.h>
+ #include <limits.h>
+ 
++#if defined(MAJOR_IN_MKDEV)
++#include <sys/mkdev.h>
++#elif defined(MAJOR_IN_SYSMACROS)
++#include <sys/sysmacros.h>
++#endif
++
+ #ifdef __linux__
+ # include <sys/ioctl.h>         /* ioctl */
+ # include <sys/mount.h>
+Index: grub-2.00/util/getroot.c
+===================================================================
+--- grub-2.00.orig/util/getroot.c
++++ grub-2.00/util/getroot.c
+@@ -35,6 +35,13 @@
+ #ifdef HAVE_LIMITS_H
+ #include <limits.h>
+ #endif
++
++#if defined(MAJOR_IN_MKDEV)
++#include <sys/mkdev.h>
++#elif defined(MAJOR_IN_SYSMACROS)
++#include <sys/sysmacros.h>
++#endif
++
+ #include <grub/util/misc.h>
+ #include <grub/util/lvm.h>
+ #include <grub/cryptodisk.h>
+Index: grub-2.00/util/raid.c
+===================================================================
+--- grub-2.00.orig/util/raid.c
++++ grub-2.00/util/raid.c
+@@ -29,6 +29,12 @@
+ #include <errno.h>
+ #include <sys/types.h>
+ 
++#if defined(MAJOR_IN_MKDEV)
++#include <sys/mkdev.h>
++#elif defined(MAJOR_IN_SYSMACROS)
++#include <sys/sysmacros.h>
++#endif
++
+ #include <linux/types.h>
+ #include <linux/major.h>
+ #include <linux/raid/md_p.h>
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0002-i386-x86_64-ppc-fix-switch-fallthrough-cases-with-GC.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0002-i386-x86_64-ppc-fix-switch-fallthrough-cases-with-GC.patch
new file mode 100644
index 0000000..94f048c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0002-i386-x86_64-ppc-fix-switch-fallthrough-cases-with-GC.patch
@@ -0,0 +1,248 @@
+From 4bd4a88725604471fdbd86316c91967a7f4dba5a Mon Sep 17 00:00:00 2001
+From: Andrei Borzenkov <arvidjaar@gmail.com>
+Date: Tue, 4 Apr 2017 19:23:55 +0300
+Subject: [PATCH 2/4] i386, x86_64, ppc: fix switch fallthrough cases with GCC7
+
+In util/getroot and efidisk slightly modify exitsing comment to mostly
+retain it but still make GCC7 compliant with respect to fall through
+annotation.
+
+In grub-core/lib/xzembed/xz_dec_lzma2.c it adds same comments as
+upstream.
+
+In grub-core/tests/setjmp_tets.c declare functions as "noreturn" to
+suppress GCC7 warning.
+
+In grub-core/gnulib/regexec.c use new __attribute__, because existing
+annotation is not recognized by GCC7 parser (which requires that comment
+immediately precedes case statement).
+
+Otherwise add FALLTHROUGH comment.
+
+Closes: 50598
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ grub-core/commands/hdparm.c           | 1 +
+ grub-core/commands/nativedisk.c       | 1 +
+ grub-core/disk/cryptodisk.c           | 1 +
+ grub-core/disk/efi/efidisk.c          | 2 +-
+ grub-core/efiemu/mm.c                 | 1 +
+ grub-core/gdb/cstub.c                 | 1 +
+ grub-core/gnulib/regexec.c            | 3 +++
+ grub-core/lib/xzembed/xz_dec_lzma2.c  | 4 ++++
+ grub-core/lib/xzembed/xz_dec_stream.c | 6 ++++++
+ grub-core/loader/i386/linux.c         | 3 +++
+ grub-core/tests/setjmp_test.c         | 5 ++++-
+ grub-core/video/ieee1275.c            | 1 +
+ grub-core/video/readers/jpeg.c        | 1 +
+ util/getroot.c                        | 2 +-
+ util/grub-install.c                   | 1 +
+ util/grub-mkimagexx.c                 | 1 +
+ util/grub-mount.c                     | 1 +
+ 17 files changed, 32 insertions(+), 3 deletions(-)
+
+Index: grub-2.00/grub-core/commands/hdparm.c
+===================================================================
+--- grub-2.00.orig/grub-core/commands/hdparm.c
++++ grub-2.00/grub-core/commands/hdparm.c
+@@ -328,6 +328,7 @@ grub_cmd_hdparm (grub_extcmd_context_t c
+ 	  ata = ((struct grub_scsi *) disk->data)->data;
+ 	  break;
+ 	}
++      /* FALLTHROUGH */
+     default:
+       return grub_error (GRUB_ERR_IO, "not an ATA device");
+     }
+Index: grub-2.00/grub-core/disk/cryptodisk.c
+===================================================================
+--- grub-2.00.orig/grub-core/disk/cryptodisk.c
++++ grub-2.00/grub-core/disk/cryptodisk.c
+@@ -268,6 +268,7 @@ grub_cryptodisk_endecrypt (struct grub_c
+ 	  break;
+ 	case GRUB_CRYPTODISK_MODE_IV_PLAIN64:
+ 	  iv[1] = grub_cpu_to_le32 (sector >> 32);
++	  /* FALLTHROUGH */
+ 	case GRUB_CRYPTODISK_MODE_IV_PLAIN:
+ 	  iv[0] = grub_cpu_to_le32 (sector & 0xFFFFFFFF);
+ 	  break;
+Index: grub-2.00/grub-core/disk/efi/efidisk.c
+===================================================================
+--- grub-2.00.orig/grub-core/disk/efi/efidisk.c
++++ grub-2.00/grub-core/disk/efi/efidisk.c
+@@ -262,7 +262,7 @@ name_devices (struct grub_efidisk_data *
+ 	    {
+ 	    case GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE:
+ 	      is_hard_drive = 1;
+-	      /* Fall through by intention.  */
++	      /* Intentionally fall through.  */
+ 	    case GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE:
+ 	      {
+ 		struct grub_efidisk_data *parent, *parent2;
+Index: grub-2.00/grub-core/efiemu/mm.c
+===================================================================
+--- grub-2.00.orig/grub-core/efiemu/mm.c
++++ grub-2.00/grub-core/efiemu/mm.c
+@@ -410,6 +410,7 @@ grub_efiemu_mmap_fill (void)
+ 	default:
+ 	  grub_dprintf ("efiemu",
+ 			"Unknown memory type %d. Assuming unusable\n", type);
++	/* FALLTHROUGH */
+ 	case GRUB_MEMORY_RESERVED:
+ 	  return grub_efiemu_add_to_mmap (addr, size,
+ 					  GRUB_EFI_UNUSABLE_MEMORY);
+Index: grub-2.00/grub-core/gdb/cstub.c
+===================================================================
+--- grub-2.00.orig/grub-core/gdb/cstub.c
++++ grub-2.00/grub-core/gdb/cstub.c
+@@ -336,6 +336,7 @@ grub_gdb_trap (int trap_no)
+ 	/* sAA..AA: Step one instruction from AA..AA(optional).  */
+ 	case 's':
+ 	  stepping = 1;
++	  /* FALLTHROUGH */
+ 
+ 	/* cAA..AA: Continue at address AA..AA(optional).  */
+ 	case 'c':
+Index: grub-2.00/grub-core/gnulib/regexec.c
+===================================================================
+--- grub-2.00.orig/grub-core/gnulib/regexec.c
++++ grub-2.00/grub-core/gnulib/regexec.c
+@@ -4104,6 +4104,9 @@ check_node_accept (const re_match_contex
+     case OP_UTF8_PERIOD:
+       if (ch >= ASCII_CHARS)
+         return false;
++#if defined __GNUC__ && __GNUC__ >= 7
++      __attribute__ ((fallthrough));
++#endif
+       /* FALLTHROUGH */
+ #endif
+     case OP_PERIOD:
+Index: grub-2.00/grub-core/lib/xzembed/xz_dec_lzma2.c
+===================================================================
+--- grub-2.00.orig/grub-core/lib/xzembed/xz_dec_lzma2.c
++++ grub-2.00/grub-core/lib/xzembed/xz_dec_lzma2.c
+@@ -1042,6 +1042,8 @@ enum xz_ret xz_dec_lzma2_run(
+ 
+ 			s->lzma2.sequence = SEQ_LZMA_PREPARE;
+ 
++		/* Fall through */
++
+ 		case SEQ_LZMA_PREPARE:
+ 			if (s->lzma2.compressed < RC_INIT_BYTES)
+ 				return XZ_DATA_ERROR;
+@@ -1052,6 +1054,8 @@ enum xz_ret xz_dec_lzma2_run(
+ 			s->lzma2.compressed -= RC_INIT_BYTES;
+ 			s->lzma2.sequence = SEQ_LZMA_RUN;
+ 
++		/* Fall through */
++
+ 		case SEQ_LZMA_RUN:
+ 			/*
+ 			 * Set dictionary limit to indicate how much we want
+Index: grub-2.00/grub-core/lib/xzembed/xz_dec_stream.c
+===================================================================
+--- grub-2.00.orig/grub-core/lib/xzembed/xz_dec_stream.c
++++ grub-2.00/grub-core/lib/xzembed/xz_dec_stream.c
+@@ -749,6 +749,7 @@ static enum xz_ret dec_main(struct xz_de
+ 
+ 			s->sequence = SEQ_BLOCK_START;
+ 
++			/* FALLTHROUGH */
+ 		case SEQ_BLOCK_START:
+ 			/* We need one byte of input to continue. */
+ 			if (b->in_pos == b->in_size)
+@@ -772,6 +773,7 @@ static enum xz_ret dec_main(struct xz_de
+ 			s->temp.pos = 0;
+ 			s->sequence = SEQ_BLOCK_HEADER;
+ 
++			/* FALLTHROUGH */
+ 		case SEQ_BLOCK_HEADER:
+ 			if (!fill_temp(s, b))
+ 				return XZ_OK;
+@@ -782,6 +784,7 @@ static enum xz_ret dec_main(struct xz_de
+ 
+ 			s->sequence = SEQ_BLOCK_UNCOMPRESS;
+ 
++			/* FALLTHROUGH */
+ 		case SEQ_BLOCK_UNCOMPRESS:
+ 			ret = dec_block(s, b);
+ 			if (ret != XZ_STREAM_END)
+@@ -809,6 +812,7 @@ static enum xz_ret dec_main(struct xz_de
+ 
+ 			s->sequence = SEQ_BLOCK_CHECK;
+ 
++			/* FALLTHROUGH */
+ 		case SEQ_BLOCK_CHECK:
+ 			ret = hash_validate(s, b, 0);
+ 			if (ret != XZ_STREAM_END)
+@@ -863,6 +867,7 @@ static enum xz_ret dec_main(struct xz_de
+ 
+ 			s->sequence = SEQ_INDEX_CRC32;
+ 
++			/* FALLTHROUGH */
+ 		case SEQ_INDEX_CRC32:
+ 			ret = hash_validate(s, b, 1);
+ 			if (ret != XZ_STREAM_END)
+@@ -871,6 +876,7 @@ static enum xz_ret dec_main(struct xz_de
+ 			s->temp.size = STREAM_HEADER_SIZE;
+ 			s->sequence = SEQ_STREAM_FOOTER;
+ 
++			/* FALLTHROUGH */
+ 		case SEQ_STREAM_FOOTER:
+ 			if (!fill_temp(s, b))
+ 				return XZ_OK;
+Index: grub-2.00/grub-core/loader/i386/linux.c
+===================================================================
+--- grub-2.00.orig/grub-core/loader/i386/linux.c
++++ grub-2.00/grub-core/loader/i386/linux.c
+@@ -977,10 +977,13 @@ grub_cmd_linux (grub_command_t cmd __att
+ 	      {
+ 	      case 'g':
+ 		shift += 10;
++		/* FALLTHROUGH */
+ 	      case 'm':
+ 		shift += 10;
++		/* FALLTHROUGH */
+ 	      case 'k':
+ 		shift += 10;
++		/* FALLTHROUGH */
+ 	      default:
+ 		break;
+ 	      }
+Index: grub-2.00/grub-core/video/readers/jpeg.c
+===================================================================
+--- grub-2.00.orig/grub-core/video/readers/jpeg.c
++++ grub-2.00/grub-core/video/readers/jpeg.c
+@@ -701,6 +701,7 @@ grub_jpeg_decode_jpeg (struct grub_jpeg_
+ 	case JPEG_MARKER_SOS:	/* Start Of Scan.  */
+ 	  if (grub_jpeg_decode_sos (data))
+ 	    break;
++	  /* FALLTHROUGH */
+ 	case JPEG_MARKER_RST0:	/* Restart.  */
+ 	case JPEG_MARKER_RST1:
+ 	case JPEG_MARKER_RST2:
+Index: grub-2.00/util/grub-mkimagexx.c
+===================================================================
+--- grub-2.00.orig/util/grub-mkimagexx.c
++++ grub-2.00/util/grub-mkimagexx.c
+@@ -485,6 +485,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e
+ 									    + sym->st_value
+ 									    - image_target->vaddr_offset));
+ 		  }
++		/* FALLTHROUGH */
+ 		case R_IA64_LTOFF_FPTR22:
+ 		  *gpptr = grub_host_to_target64 (addend + sym_addr);
+ 		  add_value_to_slot_21 ((grub_addr_t) target,
+Index: grub-2.00/util/grub-mount.c
+===================================================================
+--- grub-2.00.orig/util/grub-mount.c
++++ grub-2.00/util/grub-mount.c
+@@ -487,6 +487,7 @@ argp_parser (int key, char *arg, struct
+       if (arg[0] != '-')
+ 	break;
+ 
++    /* FALLTHROUGH */
+     default:
+       if (!arg)
+ 	return 0;
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0003-Add-gnulib-fix-gcc7-fallthrough.diff.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0003-Add-gnulib-fix-gcc7-fallthrough.diff.patch
new file mode 100644
index 0000000..fcfbf5c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0003-Add-gnulib-fix-gcc7-fallthrough.diff.patch
@@ -0,0 +1,38 @@
+From 007f0b407f72314ec832d77e15b83ea40b160037 Mon Sep 17 00:00:00 2001
+From: Andrei Borzenkov <arvidjaar@gmail.com>
+Date: Tue, 4 Apr 2017 19:37:47 +0300
+Subject: [PATCH 3/4] Add gnulib-fix-gcc7-fallthrough.diff
+
+As long as the code is not upstream, add it as explicit patch for the
+case of gnulib refresh.
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ grub-core/gnulib-fix-gcc7-fallthrough.diff | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+ create mode 100644 grub-core/gnulib-fix-gcc7-fallthrough.diff
+
+diff --git a/grub-core/gnulib-fix-gcc7-fallthrough.diff b/grub-core/gnulib-fix-gcc7-fallthrough.diff
+new file mode 100644
+index 0000000..9802e2d
+--- /dev/null
++++ b/grub-core/gnulib-fix-gcc7-fallthrough.diff
+@@ -0,0 +1,14 @@
++diff --git grub-core/gnulib/regexec.c grub-core/gnulib/regexec.c
++index f632cd4..a7776f0 100644
++--- grub-core/gnulib/regexec.c
+++++ grub-core/gnulib/regexec.c
++@@ -4099,6 +4099,9 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
++     case OP_UTF8_PERIOD:
++       if (ch >= ASCII_CHARS)
++         return false;
+++#if defined __GNUC__ && __GNUC__ >= 7
+++      __attribute__ ((fallthrough));
+++#endif
++       /* FALLTHROUGH */
++ #endif
++     case OP_PERIOD:
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0004-Fix-remaining-cases-of-gcc-7-fallthrough-warning.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0004-Fix-remaining-cases-of-gcc-7-fallthrough-warning.patch
new file mode 100644
index 0000000..78a70a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0004-Fix-remaining-cases-of-gcc-7-fallthrough-warning.patch
@@ -0,0 +1,175 @@
+From d454509bb866d4eaefbb558d94dd0ef0228830eb Mon Sep 17 00:00:00 2001
+From: Vladimir Serbinenko <phcoder@gmail.com>
+Date: Wed, 12 Apr 2017 01:42:38 +0000
+Subject: [PATCH 4/4] Fix remaining cases of gcc 7 fallthrough warning.
+
+They are all intended, so just add the relevant comment.
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ grub-core/kern/ia64/dl.c                     | 1 +
+ grub-core/kern/mips/dl.c                     | 1 +
+ grub-core/kern/sparc64/dl.c                  | 1 +
+ grub-core/loader/i386/coreboot/chainloader.c | 1 +
+ 4 files changed, 4 insertions(+)
+
+Index: grub-2.00/grub-core/kern/ia64/dl.c
+===================================================================
+--- grub-2.00.orig/grub-core/kern/ia64/dl.c
++++ grub-2.00/grub-core/kern/ia64/dl.c
+@@ -257,6 +257,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t
+ 		  case R_IA64_LTOFF22:
+ 		    if (ELF_ST_TYPE (sym->st_info) == STT_FUNC)
+ 		      value = *(grub_uint64_t *) sym->st_value + rel->r_addend;
++		  /* Fallthrough.  */
+ 		  case R_IA64_LTOFF_FPTR22:
+ 		    *gpptr = value;
+ 		    add_value_to_slot_21 (addr, (grub_addr_t) gpptr - (grub_addr_t) gp);
+Index: grub-2.00/grub-core/disk/diskfilter.c
+===================================================================
+--- grub-2.00.orig/grub-core/disk/diskfilter.c
++++ grub-2.00/grub-core/disk/diskfilter.c
+@@ -71,10 +71,12 @@ is_lv_readable (struct grub_diskfilter_l
+ 	case GRUB_DISKFILTER_RAID6:
+ 	  if (!easily)
+ 	    need--;
++	  /* Fallthrough.  */
+ 	case GRUB_DISKFILTER_RAID4:
+ 	case GRUB_DISKFILTER_RAID5:
+ 	  if (!easily)
+ 	    need--;
++	  /* Fallthrough.  */
+ 	case GRUB_DISKFILTER_STRIPED:
+ 	  break;
+ 
+@@ -507,6 +509,7 @@ read_segment (struct grub_diskfilter_seg
+       if (seg->node_count == 1)
+ 	return grub_diskfilter_read_node (&seg->nodes[0],
+ 					  sector, size, buf);
++    /* Fallthrough.  */
+     case GRUB_DISKFILTER_MIRROR:
+     case GRUB_DISKFILTER_RAID10:
+       {
+Index: grub-2.00/grub-core/font/font.c
+===================================================================
+--- grub-2.00.orig/grub-core/font/font.c
++++ grub-2.00/grub-core/font/font.c
+@@ -1297,6 +1297,7 @@ blit_comb (const struct grub_unicode_gly
+ 	    - grub_font_get_xheight (combining_glyphs[i]->font) - 1;
+ 	  if (space <= 0)
+ 	    space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;
++        /* Fallthrough.  */
+ 
+ 	case GRUB_UNICODE_STACK_ATTACHED_ABOVE:
+ 	  do_blit (combining_glyphs[i], targetx,
+@@ -1338,6 +1339,7 @@ blit_comb (const struct grub_unicode_gly
+ 		    + combining_glyphs[i]->height);
+ 	  if (space <= 0)
+ 	    space = 1 + (grub_font_get_xheight (main_glyph->font)) / 8;
++        /* Fallthrough.  */
+ 
+ 	case GRUB_UNICODE_STACK_ATTACHED_BELOW:
+ 	  do_blit (combining_glyphs[i], targetx, -(bounds.y - space));
+Index: grub-2.00/grub-core/fs/udf.c
+===================================================================
+--- grub-2.00.orig/grub-core/fs/udf.c
++++ grub-2.00/grub-core/fs/udf.c
+@@ -970,6 +970,7 @@ grub_udf_read_symlink (grub_fshelp_node_
+ 	case 1:
+ 	  if (ptr[1])
+ 	    goto fail;
++	  break;
+ 	case 2:
+ 	  /* in 4 bytes. out: 1 byte.  */
+ 	  optr = out;
+Index: grub-2.00/grub-core/lib/legacy_parse.c
+===================================================================
+--- grub-2.00.orig/grub-core/lib/legacy_parse.c
++++ grub-2.00/grub-core/lib/legacy_parse.c
+@@ -626,6 +626,7 @@ grub_legacy_parse (const char *buf, char
+ 	  {
+ 	  case TYPE_FILE_NO_CONSUME:
+ 	    hold_arg = 1;
++	  /* Fallthrough.  */
+ 	  case TYPE_PARTITION:
+ 	  case TYPE_FILE:
+ 	    args[i] = adjust_file (curarg, curarglen);
+Index: grub-2.00/grub-core/lib/libgcrypt-grub/cipher/rijndael.c
+===================================================================
+--- grub-2.00.orig/grub-core/lib/libgcrypt-grub/cipher/rijndael.c
++++ grub-2.00/grub-core/lib/libgcrypt-grub/cipher/rijndael.c
+@@ -96,7 +96,8 @@ do_setkey (RIJNDAEL_context *ctx, const
+   static int initialized = 0;
+   static const char *selftest_failed=0;
+   int ROUNDS;
+-  int i,j, r, t, rconpointer = 0;
++  unsigned int i, t, rconpointer = 0;
++  int j, r;
+   int KC;
+   union
+   {
+Index: grub-2.00/grub-core/mmap/efi/mmap.c
+===================================================================
+--- grub-2.00.orig/grub-core/mmap/efi/mmap.c
++++ grub-2.00/grub-core/mmap/efi/mmap.c
+@@ -72,6 +72,7 @@ grub_efi_mmap_iterate (grub_memory_hook_
+ 		    GRUB_MEMORY_AVAILABLE);
+ 	      break;
+ 	    }
++	  /* Fallthrough.  */
+ 	case GRUB_EFI_RUNTIME_SERVICES_CODE:
+ 	  hook (desc->physical_start, desc->num_pages * 4096,
+ 		GRUB_MEMORY_CODE);
+@@ -86,6 +87,7 @@ grub_efi_mmap_iterate (grub_memory_hook_
+ 	  grub_printf ("Unknown memory type %d, considering reserved\n",
+ 		       desc->type);
+ 
++	  /* Fallthrough.  */
+ 	case GRUB_EFI_BOOT_SERVICES_DATA:
+ 	  if (!avoid_efi_boot_services)
+ 	    {
+@@ -93,6 +95,7 @@ grub_efi_mmap_iterate (grub_memory_hook_
+ 		    GRUB_MEMORY_AVAILABLE);
+ 	      break;
+ 	    }
++	  /* Fallthrough.  */
+ 	case GRUB_EFI_RESERVED_MEMORY_TYPE:
+ 	case GRUB_EFI_RUNTIME_SERVICES_DATA:
+ 	case GRUB_EFI_MEMORY_MAPPED_IO:
+Index: grub-2.00/grub-core/normal/charset.c
+===================================================================
+--- grub-2.00.orig/grub-core/normal/charset.c
++++ grub-2.00/grub-core/normal/charset.c
+@@ -858,6 +858,7 @@ grub_bidi_line_logical_to_visual (const
+ 	  case GRUB_BIDI_TYPE_R:
+ 	  case GRUB_BIDI_TYPE_AL:
+ 	    bidi_needed = 1;
++	  /* Fallthrough.  */
+ 	  default:
+ 	    {
+ 	      if (join_state == JOIN_FORCE)
+Index: grub-2.00/grub-core/video/bochs.c
+===================================================================
+--- grub-2.00.orig/grub-core/video/bochs.c
++++ grub-2.00/grub-core/video/bochs.c
+@@ -351,6 +351,7 @@ grub_video_bochs_setup (unsigned int wid
+     case 32:
+       framebuffer.mode_info.reserved_mask_size = 8;
+       framebuffer.mode_info.reserved_field_pos = 24;
++      /* Fallthrough.  */
+ 
+     case 24:
+       framebuffer.mode_info.red_mask_size = 8;
+Index: grub-2.00/grub-core/video/cirrus.c
+===================================================================
+--- grub-2.00.orig/grub-core/video/cirrus.c
++++ grub-2.00/grub-core/video/cirrus.c
+@@ -431,6 +431,7 @@ grub_video_cirrus_setup (unsigned int wi
+     case 32:
+       framebuffer.mode_info.reserved_mask_size = 8;
+       framebuffer.mode_info.reserved_field_pos = 24;
++      /* Fallthrough.  */
+ 
+     case 24:
+       framebuffer.mode_info.red_mask_size = 8;
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/autohell.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/autohell.patch
deleted file mode 100644
index d66207a..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/autohell.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Upstream-Status: Inappropriate [configuration]
-
----
- configure.ac |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-Index: grub-0.97/configure.ac
-===================================================================
---- grub-0.97.orig/configure.ac	2008-09-12 17:39:52.000000000 +0200
-+++ grub-0.97/configure.ac	2008-09-12 17:40:21.000000000 +0200
-@@ -60,8 +60,8 @@ AC_PROG_CC
- _AM_DEPENDENCIES(CC)
- 
- dnl Because recent automake complains about AS, set it here.
--CCAS="$CC"
--AC_SUBST(CCAS)
-+AM_PROG_AS
-+AC_SUBST(AS)
- 
- AC_ARG_WITH(binutils,
-   [  --with-binutils=DIR     search the directory DIR to find binutils])
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch
deleted file mode 100644
index d225d13..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-Upstream-Status: Inappropriate [No Longer Maintained]
-
-diff -Naur grub-0.97-800/stage2/fsys_ext2fs.c grub-0.97-810/stage2/fsys_ext2fs.c
---- grub-0.97-800/stage2/fsys_ext2fs.c	2008-07-21 00:40:21.668879475 -0600
-+++ grub-0.97-810/stage2/fsys_ext2fs.c	2008-07-21 01:01:11.063953773 -0600
-@@ -79,7 +79,52 @@
-     __u32 s_rev_level;		/* Revision level */
-     __u16 s_def_resuid;		/* Default uid for reserved blocks */
-     __u16 s_def_resgid;		/* Default gid for reserved blocks */
--    __u32 s_reserved[235];	/* Padding to the end of the block */
-+    /*
-+     * These fields are for EXT2_DYNAMIC_REV superblocks only.
-+     *
-+     * Note: the difference between the compatible feature set and
-+     * the incompatible feature set is that if there is a bit set
-+     * in the incompatible feature set that the kernel doesn't
-+     * know about, it should refuse to mount the filesystem.
-+     *
-+     * e2fsck's requirements are more strict; if it doesn't know
-+     * about a feature in either the compatible or incompatible
-+     * feature set, it must abort and not try to meddle with
-+     * things it doesn't understand...
-+     */
-+    __u32 s_first_ino;		/* First non-reserved inode */
-+    __u16 s_inode_size;		/* size of inode structure */
-+    __u16 s_block_group_nr;	/* block group # of this superblock */
-+    __u32 s_feature_compat;	/* compatible feature set */
-+    __u32 s_feature_incompat;	/* incompatible feature set */
-+    __u32 s_feature_ro_compat;	/* readonly-compatible feature set */
-+    __u8  s_uuid[16];		/* 128-bit uuid for volume */
-+    char  s_volume_name[16];	/* volume name */
-+    char  s_last_mounted[64];	/* directory where last mounted */
-+    __u32 s_algorithm_usage_bitmap; /* For compression */
-+    /*
-+     * Performance hints.  Directory preallocation should only
-+     * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on.
-+     */
-+    __u8  s_prealloc_blocks;	/* Nr of blocks to try to preallocate*/
-+    __u8  s_prealloc_dir_blocks;	/* Nr to preallocate for dirs */
-+    __u16 s_reserved_gdt_blocks;/* Per group table for online growth */
-+    /*
-+     * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.
-+     */
-+    __u8 s_journal_uuid[16];	/* uuid of journal superblock */
-+    __u32 s_journal_inum;	/* inode number of journal file */
-+    __u32 s_journal_dev;	/* device number of journal file */
-+    __u32 s_last_orphan;	/* start of list of inodes to delete */
-+    __u32 s_hash_seed[4];	/* HTREE hash seed */
-+    __u8  s_def_hash_version;	/* Default hash version to use */
-+    __u8  s_jnl_backup_type; 	/* Default type of journal backup */
-+    __u16 s_reserved_word_pad;
-+    __u32 s_default_mount_opts;
-+    __u32 s_first_meta_bg;	/* First metablock group */
-+    __u32 s_mkfs_time;		/* When the filesystem was created */
-+    __u32 s_jnl_blocks[17]; 	/* Backup of the journal inode */
-+    __u32 s_reserved[172];	/* Padding to the end of the block */
-   };
- 
- struct ext2_group_desc
-@@ -218,6 +263,14 @@
- #define EXT2_ADDR_PER_BLOCK(s)          (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
- #define EXT2_ADDR_PER_BLOCK_BITS(s)		(log2(EXT2_ADDR_PER_BLOCK(s)))
- 
-+#define EXT2_GOOD_OLD_REV   0   /* The good old (original) format */
-+#define EXT2_DYNAMIC_REV    1   /* V2 format w/ dynamic inode sizes */
-+#define EXT2_GOOD_OLD_INODE_SIZE 128
-+#define EXT2_INODE_SIZE(s)  (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
-+                 EXT2_GOOD_OLD_INODE_SIZE : \
-+                 (s)->s_inode_size)
-+#define EXT2_INODES_PER_BLOCK(s)	(EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))
-+
- /* linux/ext2_fs.h */
- #define EXT2_BLOCK_SIZE_BITS(s)        ((s)->s_log_block_size + 10)
- /* kind of from ext2/super.c */
-@@ -553,7 +606,7 @@
-       gdp = GROUP_DESC;
-       ino_blk = gdp[desc].bg_inode_table +
- 	(((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
--	 >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
-+	 >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
- #ifdef E2DEBUG
-       printf ("inode table fsblock=%d\n", ino_blk);
- #endif /* E2DEBUG */
-@@ -565,13 +618,12 @@
-       /* reset indirect blocks! */
-       mapblock2 = mapblock1 = -1;
- 
--      raw_inode = INODE +
--	((current_ino - 1)
--	 & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1));
-+      raw_inode = (struct ext2_inode *)((char *)INODE +
-+	((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) *
-+	EXT2_INODE_SIZE (SUPERBLOCK));
- #ifdef E2DEBUG
-       printf ("ipb=%d, sizeof(inode)=%d\n",
--	      (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)),
--	      sizeof (struct ext2_inode));
-+	      EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK));
-       printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode);
-       printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE);
-       for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode;
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch
deleted file mode 100644
index 0cf7dc9..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-Upstream-Status: Inappropriate
-
-Subject: [PATCH] grub: fix for automake-1.12
-
-automake 1.12 has depricated automatic de-ANSI-fication support
-
-this patch avoids these kinds of errors:
-
-| stage1/Makefile.am:2: error: 'pkglibdir' is not a legitimate directory for 'DATA'
-| stage2/Makefile.am:35: error: 'pkglibdir' is not a legitimate directory for 'DATA'
-| stage2/Makefile.am:46: error: 'pkglibdir' is not a legitimate directory for 'DATA'
-| autoreconf: automake failed with exit status: 1
-| ERROR: autoreconf execution failed.
-
-The upstream status is marked as 'Inappropriate' because this problem is not uncommon,
-it has been there for a long time and no change in upstream.
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
-
-Index: grub-0.97/stage1/Makefile.am
-===================================================================
---- a/stage1/Makefile.am
-+++ b/stage1/Makefile.am
-@@ -1,7 +1,7 @@
--pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
--nodist_pkglib_DATA = stage1
-+pkgdatadir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
-+nodist_pkgdata_DATA = stage1
- 
--CLEANFILES = $(nodist_pkglib_DATA)
-+CLEANFILES = $(nodist_pkgdata_DATA)
- 
- # We can't use builtins or standard includes.
- AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
-Index: grub-0.97/stage2/Makefile.am
-===================================================================
---- a/stage2/Makefile.am
-+++ b/stage2/Makefile.am
-@@ -27,12 +27,12 @@ libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
- 	-DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
- 
- # Stage 2 and Stage 1.5's.
--pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
-+pkgdatadir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
- 
- EXTRA_PROGRAMS = nbloader.exec pxeloader.exec diskless.exec
- 
- if DISKLESS_SUPPORT
--pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
-+pkgdata_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
- 	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
- 	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \
- 	nbgrub pxegrub
-@@ -43,7 +43,7 @@ noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
- 	reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
- 	xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec
- else
--pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
-+pkgdata_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
- 	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
- 	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
- noinst_DATA = pre_stage2 start start_eltorito
-@@ -105,7 +105,7 @@ else
- BUILT_SOURCES = stage2_size.h
- endif
- 
--CLEANFILES = $(pkglib_DATA) $(noinst_DATA) $(BUILT_SOURCES)
-+CLEANFILES = $(pkgdata_DATA) $(noinst_DATA) $(BUILT_SOURCES)
- 
- stage2_size.h: pre_stage2
- 	-rm -f stage2_size.h
--- 
-1.7.9.5
-
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
deleted file mode 100644
index 70037e4..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Upstream-Status: Inappropriate [disable feature]
-
-After the commit "tcmode-default: switch to gcc 4.6.0 for x86, x86-64 & arm",
-we got bug 1099 (http://bugzilla.yoctoproject.org/show_bug.cgi?id=1099):
-
-Running "install --stage2=/ssd/boot/grub/stage2 /boot/grub/stage1(hd0)
-     /boot/grub/stage2 p /boot/grub/menu list" failed
-Error 6: Mismatched or corrupt version of stage1/stage2
-
-This turned out to be a gcc's bug. See
-https://bugs.gentoo.org/show_bug.cgi?id=360513
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333
-
-Upstream gcc seems uninterested in the bug, so at present we can disable the
-option as a workaround. Thanks Ryan Hill for the investigation and the
-workaround patch.
-
-Dexuan Cui <dexuan.cui@intel.com>
-Wed Jun 29 20:21:39 CST 2011
-
---- grub-0.97/stage2/Makefile.am.orig
-+++ grub-0.97/stage2/Makefile.am
-@@ -79,7 +79,7 @@
- HERCULES_FLAGS =
- endif
- 
--STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
-+STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-reorder-functions -fno-builtin -nostdinc \
- 	$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
- 
- STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch
deleted file mode 100644
index bd8e0a8..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-
-This patch is from ubuntu:
-  * objcopy-absolute.diff (update): Remove .note, .comment, and
-    .note.gnu.build-id sections from images (LP: #444703).
-
-Upstream-Status: Inappropriate [no longer maintained]
-
-Index: b/acinclude.m4
-===================================================================
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -61,7 +61,7 @@
-   else
-     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
-   fi
--  if AC_TRY_COMMAND([${OBJCOPY-objcopy} -O binary conftest.exec conftest]); then :
-+  if AC_TRY_COMMAND([${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then :
-   else
-     AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files])
-   fi
-Index: b/stage1/Makefile.am
-===================================================================
---- a/stage1/Makefile.am
-+++ b/stage1/Makefile.am
-@@ -12,4 +12,4 @@
-
- SUFFIXES = .exec
- .exec:
--	$(OBJCOPY) -O binary $< $@
-+	$(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
-Index: b/stage2/Makefile.am
-===================================================================
---- a/stage2/Makefile.am
-+++ b/stage2/Makefile.am
-@@ -293,4 +293,4 @@
- # General rule for making a raw binary.
- SUFFIXES = .exec
- .exec:
--	$(OBJCOPY) -O binary $< $@
-+	$(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-efi_2.00.bb b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-efi_2.00.bb
index 5a0dc95..e12f1d7 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-efi_2.00.bb
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-efi_2.00.bb
@@ -13,13 +13,13 @@
 # Determine the target arch for the grub modules
 python __anonymous () {
     import re
-    target = d.getVar('TARGET_ARCH', True)
+    target = d.getVar('TARGET_ARCH')
     if target == "x86_64":
         grubtarget = 'x86_64'
-        grubimage = "bootx64.efi"
+        grubimage = "grub-efi-bootx64.efi"
     elif re.match('i.86', target):
         grubtarget = 'i386'
-        grubimage = "bootia32.efi"
+        grubimage = "grub-efi-bootia32.efi"
     else:
         raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target)
     d.setVar("GRUB_TARGET", grubtarget)
@@ -31,9 +31,9 @@
 CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
 EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
                 --enable-efiemu=no --program-prefix='' \
-                --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
-
-EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"
+                --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no \
+                --enable-largefile \
+"
 
 # ldm.c:114:7: error: trampoline generated for nested function 'hook' [-Werror=trampolines]
 # and many other places in the grub code when compiled with some native gcc compilers (specifically, gentoo)
@@ -65,5 +65,8 @@
                 ${datadir}/grub \
                 "
 
-BBCLASSEXTEND = "native"
+# 64-bit binaries are expected for the bootloader with an x32 userland
+INSANE_SKIP_${PN}_append_linux-gnux32 = " arch"
+INSANE_SKIP_${PN}-dbg_append_linux-gnux32 = " arch"
 
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub2.inc b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub2.inc
index b69de9f..a93c99e 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub2.inc
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub2.inc
@@ -35,6 +35,11 @@
            file://0001-Enforce-no-pie-if-the-compiler-supports-it.patch \
            file://0001-grub-core-kern-efi-mm.c-grub_efi_finish_boot_service.patch \
            file://0002-grub-core-kern-efi-mm.c-grub_efi_get_memory_map-Neve.patch \
+           file://0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch \
+           file://0001-btrfs-avoid-used-uninitialized-error-with-GCC7.patch \
+           file://0002-i386-x86_64-ppc-fix-switch-fallthrough-cases-with-GC.patch \
+           file://0003-Add-gnulib-fix-gcc7-fallthrough.diff.patch \
+           file://0004-Fix-remaining-cases-of-gcc-7-fallthrough-warning.patch \
             "
 
 DEPENDS = "flex-native bison-native autogen-native"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_0.97.bb b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_0.97.bb
deleted file mode 100644
index 997a045..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_0.97.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-SUMMARY = "GRUB is the GRand Unified Bootloader"
-DESCRIPTION = "GRUB is a GPLed bootloader intended to unify bootloading across x86 \
-operating systems. In addition to loading the Linux kernel, it implements the Multiboot \
-standard, which allows for flexible loading of multiple boot images."
-HOMEPAGE = "http://www.gnu.org/software/grub/"
-SECTION = "bootloaders"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b \
-                    file://grub/main.c;beginline=3;endline=9;md5=22a5f28d2130fff9f2a17ed54be90ed6"
-
-RDEPENDS_${PN} = "diffutils"
-PR = "r6"
-
-SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz; \
-           file://no-reorder-functions.patch \
-           file://autohell.patch \
-           file://grub_fix_for_automake-1.12.patch \
-           file://objcopy-absolute.patch \
-           file://grub-support-256byte-inode.patch \
-"
-
-SRC_URI[md5sum] = "cd3f3eb54446be6003156158d51f4884"
-SRC_URI[sha256sum] = "4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b"
-
-inherit autotools texinfo
-
-COMPATIBLE_HOST = "i.86.*-linux"
-
-EXTRA_OECONF = "--without-curses"
-
-do_install_append_vmware() {
-	mkdir -p ${D}/boot/
-	ln -sf ../usr/lib/grub/{$TARGET_ARCH}{$TARGET_VENDOR}/ ${D}/boot/grub
-}
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_2.00.bb b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_2.00.bb
index 07e1d10..c382938 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_2.00.bb
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_2.00.bb
@@ -4,9 +4,9 @@
 PR = "r1"
 
 EXTRA_OECONF = "--with-platform=pc --disable-grub-mkfont --program-prefix="" \
-               --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
-
-EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"
+                --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no \
+                --enable-largefile \
+"
 
 PACKAGES =+ "grub-editenv"
 
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_git.bb b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_git.bb
index 493b695..0a81e53 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_git.bb
@@ -6,7 +6,7 @@
 FILESEXTRAPATHS =. "${FILE_DIRNAME}/grub-git:"
 
 PV = "2.00+${SRCPV}"
-SRCREV = "7a5b301e3adb8e054288518a325135a1883c1c6c"
+SRCREV = "ce95549cc54b5d6f494608a7c390dba3aab4fba7"
 SRC_URI = "git://git.savannah.gnu.org/grub.git \
            file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
            file://autogen.sh-exclude-pc.patch \
@@ -17,8 +17,7 @@
 
 COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
 COMPATIBLE_HOST_armv7a = 'null'
-
-inherit autotools gettext texinfo
+COMPATIBLE_HOST_armv7ve = 'null'
 
 # configure.ac has code to set this automagically from the target tuple
 # but the OE freeform one (core2-foo-bar-linux) don't work with that.
@@ -28,9 +27,9 @@
 GRUBPLATFORM ??= "pc"
 
 EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
-                --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
-
-EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"
+                --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no \
+                --enable-largefile \
+"
 
 do_install_append () {
     install -d ${D}${sysconfdir}/grub.d
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/0001-console-Fix-C-syntax-errors-for-function-declaration.patch b/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/0001-console-Fix-C-syntax-errors-for-function-declaration.patch
deleted file mode 100644
index fa50bc4..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/0001-console-Fix-C-syntax-errors-for-function-declaration.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 55957faf1272c8f5f304909faeebf647a78e3701 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 9 Sep 2015 07:19:45 +0000
-Subject: [PATCH] console: Fix C syntax errors for function declaration
-
-To address this, the semicolons after the function parameters should be
-replaced by commas, and the last one should be omitted
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- src/efi/console.c | 26 +++++++++++++-------------
- 1 file changed, 13 insertions(+), 13 deletions(-)
-
-diff --git a/src/efi/console.c b/src/efi/console.c
-index 6206c80..66aa88f 100644
---- a/src/efi/console.c
-+++ b/src/efi/console.c
-@@ -27,8 +27,8 @@
- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL;
- 
- typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET_EX)(
--        struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This;
--        BOOLEAN ExtendedVerification;
-+        struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
-+        BOOLEAN ExtendedVerification
- );
- 
- typedef UINT8 EFI_KEY_TOGGLE_STATE;
-@@ -44,29 +44,29 @@ typedef struct {
- } EFI_KEY_DATA;
- 
- typedef EFI_STATUS (EFIAPI *EFI_INPUT_READ_KEY_EX)(
--        struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This;
--        EFI_KEY_DATA *KeyData;
-+        struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
-+        EFI_KEY_DATA *KeyData
- );
- 
- typedef EFI_STATUS (EFIAPI *EFI_SET_STATE)(
--        struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This;
--        EFI_KEY_TOGGLE_STATE *KeyToggleState;
-+        struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
-+        EFI_KEY_TOGGLE_STATE *KeyToggleState
- );
- 
- typedef EFI_STATUS (EFIAPI *EFI_KEY_NOTIFY_FUNCTION)(
--        EFI_KEY_DATA *KeyData;
-+        EFI_KEY_DATA *KeyData
- );
- 
- typedef EFI_STATUS (EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY)(
--        struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This;
--        EFI_KEY_DATA KeyData;
--        EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction;
--        VOID **NotifyHandle;
-+        struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
-+        EFI_KEY_DATA KeyData,
-+        EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
-+        VOID **NotifyHandle
- );
- 
- typedef EFI_STATUS (EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)(
--        struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This;
--        VOID *NotificationHandle;
-+        struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
-+        VOID *NotificationHandle
- );
- 
- typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL {
--- 
-2.5.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/fix-objcopy.patch b/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/fix-objcopy.patch
deleted file mode 100644
index 49f5593..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/fix-objcopy.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 0f7f9e3bb1d0e1b93f3ad8a1d5d7bdd3fbf27494 Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Thu, 27 Mar 2014 07:20:33 +0000
-Subject: [PATCH] Makefile.am: use objcopy from the env
-
-It uses the "objcopy" directly, which is not suitable for cross compile.
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- Makefile.am | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-Index: git/Makefile.am
-===================================================================
---- git.orig/Makefile.am
-+++ git/Makefile.am
-@@ -19,6 +19,8 @@
- ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
- AM_MAKEFLAGS = --no-print-directory
- 
-+OBJCOPY ?= objcopy
-+
- gummibootlibdir = $(prefix)/lib/gummiboot
- 
- AM_CPPFLAGS = -include config.h
-@@ -148,7 +150,7 @@ $(gummiboot_solib): $(gummiboot_objects)
- .DELETE_ON_ERROR: $(gummboot_solib)
- 
- $(gummiboot): $(gummiboot_solib)
--	$(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
-+	$(AM_V_GEN) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
- 	  -j .dynsym -j .rel -j .rela -j .reloc \
- 	  --target=efi-app-$(ARCH) $< $@
- 
-@@ -183,7 +185,7 @@ $(stub_solib): $(stub_objects)
- .DELETE_ON_ERROR: $(gummboot_solib)
- 
- $(stub): $(stub_solib)
--	$(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
-+	$(AM_V_GEN) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
- 	  -j .dynsym -j .rel -j .rela -j .reloc \
- 	  --target=efi-app-$(ARCH) $< $@
- 
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot_git.bb b/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot_git.bb
deleted file mode 100644
index 376ab54..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot_git.bb
+++ /dev/null
@@ -1,37 +0,0 @@
-SUMMARY = "Gummiboot is a simple UEFI boot manager which executes configured EFI images."
-HOMEPAGE = "http://freedesktop.org/wiki/Software/gummiboot"
-
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=4fbd65380cdd255951079008b364516c"
-
-DEPENDS = "gnu-efi util-linux"
-
-inherit autotools pkgconfig
-inherit deploy
-
-PV = "48+git${SRCPV}"
-SRCREV = "2bcd919c681c952eb867ef1bdb458f1bc49c2d55"
-SRC_URI = "git://anongit.freedesktop.org/gummiboot \
-           file://fix-objcopy.patch \
-           file://0001-console-Fix-C-syntax-errors-for-function-declaration.patch \
-          "
-
-# Note: Add COMPATIBLE_HOST here is only because it depends on gnu-efi
-# which has set the COMPATIBLE_HOST, the gummiboot itself may work on
-# more hosts.
-COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux"
-
-S = "${WORKDIR}/git"
-
-EXTRA_OECONF = "--disable-manpages --with-efi-includedir=${STAGING_INCDIR} \
-                --with-efi-ldsdir=${STAGING_LIBDIR} \
-                --with-efi-libdir=${STAGING_LIBDIR}"
-
-EXTRA_OEMAKE += "gummibootlibdir=${libdir}/gummiboot"
-
-TUNE_CCARGS_remove = "-mfpmath=sse"
-
-do_deploy () {
-        install ${B}/gummiboot*.efi ${DEPLOYDIR}
-}
-addtask deploy before do_build after do_compile
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb b/import-layers/yocto-poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb
index 5793a76..34b208c 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb
@@ -37,7 +37,7 @@
     fi
 }
 
-DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
 pkg_postinst_${PN} () {
 	if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
 		if [ -n "$D" ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils_3.5.1.bb b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils_3.5.1.bb
deleted file mode 100644
index d32b119..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils_3.5.1.bb
+++ /dev/null
@@ -1,60 +0,0 @@
-SUMMARY = "PCI utilities"
-DESCRIPTION = 'The PCI Utilities package contains a library for portable access \
-to PCI bus configuration space and several utilities based on this library.'
-HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml"
-SECTION = "console/utils"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-DEPENDS = "zlib kmod"
-
-SRC_URI = "${KERNELORG_MIRROR}/software/utils/pciutils/pciutils-${PV}.tar.xz \
-           file://configure.patch \
-           file://guess-fix.patch \
-           file://makefile.patch"
-
-SRC_URI[md5sum] = "0879a8f7ac51f4e874cfc6b3521a13cc"
-SRC_URI[sha256sum] = "2bf3a4605a562fb6b8b7673bff85a474a5cf383ed7e4bd8886b4f0939013d42f"
-
-inherit multilib_header
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'hwdb', '', d)}"
-PACKAGECONFIG[hwdb] = "HWDB=yes,HWDB=no,udev"
-
-PCI_CONF_FLAG = "ZLIB=yes DNS=yes SHARED=yes"
-
-# see configure.patch
-do_configure () {
-	(
-	  cd lib && \
-	  # PACKAGECONFIG_CONFARGS for this recipe could only possibly contain 'HWDB=yes/no',
-	  # so we put it before ./configure
-	  ${PCI_CONF_FLAG} ${PACKAGECONFIG_CONFARGS} ./configure ${PV} ${datadir} ${TARGET_OS} ${TARGET_ARCH}
-	)
-}
-
-export PREFIX = "${prefix}"
-export SBINDIR = "${sbindir}"
-export SHAREDIR = "${datadir}"
-export MANDIR = "${mandir}"
-
-EXTRA_OEMAKE = "-e MAKEFLAGS= ${PCI_CONF_FLAG}"
-
-# The configure script breaks if the HOST variable is set
-HOST[unexport] = "1"
-
-do_install () {
-	oe_runmake DESTDIR=${D} install install-lib
-
-	install -d ${D}${bindir}
-	ln -s ../sbin/lspci ${D}${bindir}/lspci
-
-	oe_multilib_header pci/config.h
-}
-
-PACKAGES =+ "${PN}-ids libpci"
-FILES_${PN}-ids = "${datadir}/pci.ids*"
-FILES_libpci = "${libdir}/libpci.so.*"
-SUMMARY_${PN}-ids = "PCI utilities - device ID database"
-DESCRIPTION_${PN}-ids = "Package providing the PCI device ID database for pciutils."
-RDEPENDS_${PN} += "${PN}-ids"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils_3.5.2.bb b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils_3.5.2.bb
new file mode 100644
index 0000000..9a7297e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils_3.5.2.bb
@@ -0,0 +1,60 @@
+SUMMARY = "PCI utilities"
+DESCRIPTION = 'The PCI Utilities package contains a library for portable access \
+to PCI bus configuration space and several utilities based on this library.'
+HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+DEPENDS = "zlib kmod"
+
+SRC_URI = "${KERNELORG_MIRROR}/software/utils/pciutils/pciutils-${PV}.tar.xz \
+           file://configure.patch \
+           file://guess-fix.patch \
+           file://makefile.patch"
+
+SRC_URI[md5sum] = "1bf5b068bd9f7512e8c68b060b25a1b2"
+SRC_URI[sha256sum] = "3a99141a9f40528d0a0035665a06dc37ddb1ae341658e51b50a76ecf86235efc"
+
+inherit multilib_header
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'hwdb', '', d)}"
+PACKAGECONFIG[hwdb] = "HWDB=yes,HWDB=no,udev"
+
+PCI_CONF_FLAG = "ZLIB=yes DNS=yes SHARED=yes"
+
+# see configure.patch
+do_configure () {
+	(
+	  cd lib && \
+	  # PACKAGECONFIG_CONFARGS for this recipe could only possibly contain 'HWDB=yes/no',
+	  # so we put it before ./configure
+	  ${PCI_CONF_FLAG} ${PACKAGECONFIG_CONFARGS} ./configure ${PV} ${datadir} ${TARGET_OS} ${TARGET_ARCH}
+	)
+}
+
+export PREFIX = "${prefix}"
+export SBINDIR = "${sbindir}"
+export SHAREDIR = "${datadir}"
+export MANDIR = "${mandir}"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS= ${PCI_CONF_FLAG}"
+
+# The configure script breaks if the HOST variable is set
+HOST[unexport] = "1"
+
+do_install () {
+	oe_runmake DESTDIR=${D} install install-lib
+
+	install -d ${D}${bindir}
+	ln -s ../sbin/lspci ${D}${bindir}/lspci
+
+	oe_multilib_header pci/config.h
+}
+
+PACKAGES =+ "${PN}-ids libpci"
+FILES_${PN}-ids = "${datadir}/pci.ids*"
+FILES_libpci = "${libdir}/libpci.so.*"
+SUMMARY_${PN}-ids = "PCI utilities - device ID database"
+DESCRIPTION_${PN}-ids = "Package providing the PCI device ID database for pciutils."
+RDEPENDS_${PN} += "${PN}-ids"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc b/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc
index 581bff4..0524980 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc
@@ -12,6 +12,8 @@
 
 S = "${WORKDIR}/pcmciautils-${PV}"
 
+inherit pkgconfig
+
 export HOSTCC = "${BUILD_CC}"
 export etcdir = "${sysconfdir}"
 export sbindir = "${base_sbindir}"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb b/import-layers/yocto-poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb
index 27cb3db..cac0910 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb
@@ -13,7 +13,9 @@
 SRC_URI[md5sum] = "1742a556089c36c3a89eb1b957da5a60"
 SRC_URI[sha256sum] = "8ed899032866d88b2933a1d34cc75e8ae42dcde20e1cc21836baaae3d4370c0b"
 
-inherit pkgconfig autotools
+inherit pkgconfig autotools manpages
+
+PACKAGECONFIG[manpages] = "--enable-doc, --disable-doc, libxslt-native xmlto-native"
 
 RDEPENDS_${PN} = "grep bash"
 
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/systemd-boot/systemd-boot.bb b/import-layers/yocto-poky/meta/recipes-bsp/systemd-boot/systemd-boot.bb
deleted file mode 100644
index 5b1164e..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/systemd-boot/systemd-boot.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-require recipes-core/systemd/systemd.inc
-
-DEPENDS = "intltool-native libcap util-linux gnu-efi"
-
-SRC_URI += "file://0001-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch"
-
-inherit autotools pkgconfig gettext
-inherit deploy
-
-EXTRA_OECONF = " --enable-gnuefi \
-                 --with-efi-includedir=${STAGING_INCDIR} \
-                 --with-efi-ldsdir=${STAGING_LIBDIR} \
-                 --with-efi-libdir=${STAGING_LIBDIR} \
-                 --disable-manpages \
-               "
-
-# Imported from gummiboot recipe
-TUNE_CCARGS_remove = "-mfpmath=sse"
-COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux"
-
-do_compile() {
-	SYSTEMD_BOOT_EFI_ARCH="ia32"
-	if [ "${TARGET_ARCH}" = "x86_64" ]; then
-		SYSTEMD_BOOT_EFI_ARCH="x64"
-	fi
-
-	oe_runmake systemd-boot${SYSTEMD_BOOT_EFI_ARCH}.efi
-}
-
-do_install() {
-	# Bypass systemd installation with a NOP
-	:
-}
-
-do_deploy () {
-	install ${B}/systemd-boot*.efi ${DEPLOYDIR}
-}
-addtask deploy before do_build after do_compile
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/systemd-boot/systemd-boot_232.bb b/import-layers/yocto-poky/meta/recipes-bsp/systemd-boot/systemd-boot_232.bb
new file mode 100644
index 0000000..0471ce2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/systemd-boot/systemd-boot_232.bb
@@ -0,0 +1,39 @@
+require recipes-core/systemd/systemd.inc
+
+DEPENDS = "intltool-native libcap util-linux gnu-efi gperf-native"
+
+SRC_URI += "file://0001-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch"
+
+inherit autotools pkgconfig gettext
+inherit deploy
+
+# Man pages are packaged through the main systemd recipe
+EXTRA_OECONF = " --enable-gnuefi \
+                 --with-efi-includedir=${STAGING_INCDIR} \
+                 --with-efi-ldsdir=${STAGING_LIBDIR} \
+                 --with-efi-libdir=${STAGING_LIBDIR} \
+                 --disable-manpages \
+               "
+
+# Imported from the old gummiboot recipe
+TUNE_CCARGS_remove = "-mfpmath=sse"
+COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux"
+
+do_compile() {
+	SYSTEMD_BOOT_EFI_ARCH="ia32"
+	if [ "${TARGET_ARCH}" = "x86_64" ]; then
+		SYSTEMD_BOOT_EFI_ARCH="x64"
+	fi
+
+	oe_runmake systemd-boot${SYSTEMD_BOOT_EFI_ARCH}.efi
+}
+
+do_install() {
+	# Bypass systemd installation with a NOP
+	:
+}
+
+do_deploy () {
+	install ${B}/systemd-boot*.efi ${DEPLOYDIR}
+}
+addtask deploy before do_build after do_compile
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/files/default-gcc.patch b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/files/default-gcc.patch
new file mode 100644
index 0000000..04184df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/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/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-common_2017.01.inc b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-common_2017.01.inc
new file mode 100644
index 0000000..df24c85
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-common_2017.01.inc
@@ -0,0 +1,14 @@
+HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
+SECTION = "bootloaders"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
+PE = "1"
+
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "a705ebc81b7f91bbd0ef7c634284208342901149"
+
+SRC_URI = "git://git.denx.de/u-boot.git"
+
+S = "${WORKDIR}/git"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb
deleted file mode 100644
index 79f1548..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb
+++ /dev/null
@@ -1,46 +0,0 @@
-SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
-SECTION = "bootloader"
-DEPENDS = "mtd-utils"
-
-# This revision corresponds to the tag "v2016.03"
-# We use the revision in order to avoid having to fetch it from the
-# repo during parse
-SRCREV = "df61a74e6845ec9bdcdd48d2aff5e9c2c6debeaa"
-
-PV = "v2016.03+git${SRCPV}"
-
-SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
-
-S = "${WORKDIR}/git"
-
-INSANE_SKIP_${PN} = "already-stripped"
-EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
-EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
-
-inherit uboot-config
-
-do_compile () {
-	oe_runmake ${UBOOT_MACHINE}
-	oe_runmake env
-}
-
-do_install () {
-	install -d ${D}${base_sbindir}
-	install -d ${D}${sysconfdir}
-	install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
-	install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
-	install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
-}
-
-do_install_class-cross () {
-	install -d ${D}${bindir_cross}
-	install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
-	install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
-}
-
-SYSROOT_DIRS_append_class-cross = " ${bindir_cross}"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-BBCLASSEXTEND = "cross"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.01.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.01.bb
new file mode 100644
index 0000000..2631499
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2017.01.bb
@@ -0,0 +1,36 @@
+require u-boot-common_${PV}.inc
+
+SRC_URI += "file://default-gcc.patch"
+
+SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
+DEPENDS = "mtd-utils"
+
+INSANE_SKIP_${PN} = "already-stripped"
+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
+
+do_compile () {
+	oe_runmake ${UBOOT_MACHINE}
+	oe_runmake env
+}
+
+do_install () {
+	install -d ${D}${base_sbindir}
+	install -d ${D}${sysconfdir}
+	install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
+	install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
+	install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
+}
+
+do_install_class-cross () {
+	install -d ${D}${bindir_cross}
+	install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
+	install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
+}
+
+SYSROOT_DIRS_append_class-cross = " ${bindir_cross}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+BBCLASSEXTEND = "cross"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2016.03.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2016.03.bb
deleted file mode 100644
index d5921a0..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2016.03.bb
+++ /dev/null
@@ -1,32 +0,0 @@
-SUMMARY = "U-Boot bootloader image creation tool"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
-SECTION = "bootloader"
-
-DEPENDS = "openssl"
-
-# This revision corresponds to the tag "v2016.03"
-# We use the revision in order to avoid having to fetch it from the
-# repo during parse
-SRCREV = "df61a74e6845ec9bdcdd48d2aff5e9c2c6debeaa"
-
-PV = "v2016.03+git${SRCPV}"
-
-SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
-
-S = "${WORKDIR}/git"
-
-EXTRA_OEMAKE = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
-
-do_compile () {
-	oe_runmake sandbox_defconfig
-	oe_runmake cross_tools NO_SDL=1
-}
-
-do_install () {
-	install -d ${D}${bindir}
-	install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage
-	ln -sf uboot-mkimage ${D}${bindir}/mkimage
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb
new file mode 100644
index 0000000..de999e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb
@@ -0,0 +1,29 @@
+require u-boot-common_${PV}.inc
+
+SRC_URI += "file://default-gcc.patch"
+
+SUMMARY = "U-Boot bootloader image creation tool"
+DEPENDS = "openssl"
+
+EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
+EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
+EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
+
+do_compile () {
+	oe_runmake sandbox_defconfig
+
+	# Disable CONFIG_CMD_LICENSE, license.h is not used by tools and
+	# generating it requires bin2header tool, which for target build
+	# is built with target tools and thus cannot be executed on host.
+	sed -i "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" .config
+
+	oe_runmake cross_tools NO_SDL=1
+}
+
+do_install () {
+	install -d ${D}${bindir}
+	install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage
+	ln -sf uboot-mkimage ${D}${bindir}/mkimage
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc
index 252aae9..aa21c0e 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc
@@ -1,14 +1,6 @@
 SUMMARY = "Universal Boot Loader for embedded devices"
-HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
-SECTION = "bootloaders"
 PROVIDES = "virtual/bootloader"
 
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
-
-SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
-
-S = "${WORKDIR}/git"
 B = "${WORKDIR}/build"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
@@ -50,7 +42,7 @@
 # deploy directory.  For those versions they can set the following variables
 # to allow packaging the SPL.
 SPL_BINARY ?= ""
-SPL_BINARYNAME ?= "${@os.path.basename(d.getVar("SPL_BINARY", True))}"
+SPL_BINARYNAME ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}"
 SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}"
 SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}"
 
@@ -72,7 +64,7 @@
 UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}"
 
 do_compile () {
-	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
 		sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk
 	fi
 
@@ -312,4 +304,4 @@
     fi
 }
 
-addtask deploy before do_build after do_compile
+addtask deploy before do_build after do_install
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2016.03.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2016.03.bb
deleted file mode 100644
index 836b0ce..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2016.03.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-require u-boot.inc
-
-DEPENDS += "dtc-native"
-
-# This revision corresponds to the tag "v2016.03"
-# We use the revision in order to avoid having to fetch it from the
-# repo during parse
-SRCREV = "df61a74e6845ec9bdcdd48d2aff5e9c2c6debeaa"
-
-PV = "v2016.03+git${SRCPV}"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2017.01.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2017.01.bb
new file mode 100644
index 0000000..37c21dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2017.01.bb
@@ -0,0 +1,4 @@
+require u-boot-common_${PV}.inc
+require u-boot.inc
+
+DEPENDS += "bc-native dtc-native"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils_008.bb b/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils_008.bb
index 75312c3..d3c5bd5 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils_008.bb
+++ b/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils_008.bb
@@ -21,5 +21,5 @@
 
 FILES_${PN}-dev += "${datadir}/pkgconfig"
 
-RDEPENDS_${PN} = "libudev"
+RRECOMMENDS_${PN} = "udev-hwdb"
 RDEPENDS_${PN}-ptest = "libboost-system libboost-thread"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/fbsetup b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/fbsetup
deleted file mode 100755
index 2a409cc..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/fbsetup
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh 
-
-/sbin/modprobe uvesafb
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/uvesafb.conf b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/uvesafb.conf
deleted file mode 100644
index 4378975..0000000
--- a/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/uvesafb.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# Load uvesafb.ko at boot
-uvesafb
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb
index 1046d63..e5f6fff 100644
--- a/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb
+++ b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb
@@ -9,23 +9,18 @@
 RRECOMMENDS_${PN} = "kernel-module-uvesafb"
 PR = "r2"
 
-SRC_URI = "http://distfiles.gentoo.org/distfiles/${BP}.tar.bz2 \
+SRC_URI = "${DEBIAN_MIRROR}/main/v/${BPN}/${BPN}_${PV}.orig.tar.gz \
            file://Update-x86emu-from-X.org.patch \
-           file://fbsetup \
-           file://uvesafb.conf \
            file://ar-from-env.patch \
            file://aarch64-host.patch \
 "
 
-SRC_URI[md5sum] = "51c792ba7b874ad8c43f0d3da4cfabe0"
-SRC_URI[sha256sum] = "634964ae18ef68c8493add2ce150e3b4502badeb0d9194b4bd81241d25e6735c"
+SRC_URI[md5sum] = "889686ec8424468fe0d205742e77a4c2"
+SRC_URI[sha256sum] = "93575c82e4307d8c4c370ec6b767f5cf87e527b2378146d652a6d8e25d5bdbc5"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
 
-INITSCRIPT_NAME = "fbsetup"
-INITSCRIPT_PARAMS = "start 0 S ."
-
 do_configure () {
 	./configure --with-x86emu
 }
@@ -37,35 +32,4 @@
 do_install () {
 	install -d ${D}${base_sbindir}
 	install v86d ${D}${base_sbindir}/
-
-        # Only install fbsetup script if 'sysvinit' is in DISTRO_FEATURES
-        if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
-            install -d ${D}${sysconfdir}/init.d/
-            install -m 0755 ${WORKDIR}/fbsetup ${D}${sysconfdir}/init.d/fbsetup
-        fi
-
-        # Install systemd related configuration file
-        if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-            install -d ${D}${sysconfdir}/modules-load.d
-            install -m 0644 ${WORKDIR}/uvesafb.conf ${D}${sysconfdir}/modules-load.d
-        fi
-}
-
-# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
-# manually to avoid unnecessary postinst/preinst generated.
-python __anonymous() {
-    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
-}
-
-inherit update-rc.d
-
-DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
-pkg_postinst_${PN} () {
-	if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
-		if [ -n "$D" ]; then
-			OPTS="--root=$D"
-		fi
-		systemctl $OPTS mask fbsetup.service
-	fi
 }
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi.inc b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi.inc
index 234646d..faa8741 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi.inc
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi.inc
@@ -54,7 +54,7 @@
              --disable-qt4 \
              --disable-python \
              --disable-doxygen-doc \
-             --disable-manpages \
+             --enable-manpages \
              ${EXTRA_OECONF_SYSVINIT} \
              ${EXTRA_OECONF_SYSTEMD} \
            "
@@ -153,13 +153,3 @@
 	killall -q -HUP dbus-daemon || true
 fi
 }
-
-pkg_postrm_avahi-daemon () {
-	deluser avahi || true
-	delgroup avahi || true
-}
-
-pkg_postrm_avahi-autoipd () {
-	deluser avahi-autoipd || true
-	delgroup avahi-autoipd || true
-}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind_9.10.3-P3.bb b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind_9.10.3-P3.bb
index 8160625..a802274 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind_9.10.3-P3.bb
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind_9.10.3-P3.bb
@@ -85,7 +85,7 @@
 	install -d "${D}${sysconfdir}/init.d"
 	install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
 	install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
-	sed -i -e '1s,#!.*python,#! /usr/bin/python3,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds
+	sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds
 
 	# Install systemd related files
 	install -d ${D}${sbindir}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5.inc b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5.inc
index ecefb7b..882873a 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5.inc
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5.inc
@@ -6,15 +6,16 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
                     file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
                     file://src/main.c;beginline=1;endline=24;md5=9bc54b93cd7e17bf03f52513f39f926e"
-DEPENDS = "udev libusb dbus-glib glib-2.0 libcheck readline"
+DEPENDS = "udev libusb dbus-glib glib-2.0 libcheck"
 PROVIDES += "bluez-hcidump"
 RPROVIDES_${PN} += "bluez-hcidump"
 
 RCONFLICTS_${PN} = "bluez4"
 
-PACKAGECONFIG ??= "obex-profiles"
+PACKAGECONFIG ??= "obex-profiles readline"
 PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
 PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental,"
+PACKAGECONFIG[readline] = "--enable-client,--disable-client,readline,"
 
 SRC_URI = "\
     ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
@@ -23,9 +24,12 @@
     file://run-ptest \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
     file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
+    file://cve-2017-1000250.patch \
 "
 S = "${WORKDIR}/bluez-${PV}"
 
+CVE_PRODUCT = "bluez"
+
 inherit autotools pkgconfig systemd update-rc.d distro_features_check ptest
 
 EXTRA_OECONF = "\
@@ -42,7 +46,7 @@
 NOINST_TOOLS_READLINE ??= ""
 NOINST_TOOLS_EXPERIMENTAL ??= ""
 NOINST_TOOLS = " \
-    ${NOINST_TOOLS_READLINE} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'readline', '${NOINST_TOOLS_READLINE}', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'experimental', '${NOINST_TOOLS_EXPERIMENTAL}', '', d)} \
 "
 
@@ -95,13 +99,13 @@
 
 def get_noinst_tools_paths (d, bb, tools):
     s = list()
-    bindir = d.getVar("bindir", True)
+    bindir = d.getVar("bindir")
     for bdp in tools.split():
         f = os.path.basename(bdp)
         s.append("%s/%s" % (bindir, f))
     return "\n".join(s)
 
-FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS', True))}"
+FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS'))}"
 
 RDEPENDS_${PN}-testtools += "python3 python3-dbus python3-pygobject"
 
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/cve-2017-1000250.patch b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/cve-2017-1000250.patch
new file mode 100644
index 0000000..9fac961
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/cve-2017-1000250.patch
@@ -0,0 +1,34 @@
+All versions of the SDP server in BlueZ 5.46 and earlier are vulnerable to an
+information disclosure vulnerability which allows remote attackers to obtain
+sensitive information from the bluetoothd process memory. This vulnerability
+lies in the processing of SDP search attribute requests.
+
+CVE: CVE-2017-1000250
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 9e009647b14e810e06626dde7f1bb9ea3c375d09 Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Date: Wed, 13 Sep 2017 10:01:40 +0300
+Subject: sdp: Fix Out-of-bounds heap read in service_search_attr_req function
+
+Check if there is enough data to continue otherwise return an error.
+---
+ src/sdpd-request.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sdpd-request.c b/src/sdpd-request.c
+index 1eefdce..318d044 100644
+--- a/src/sdpd-request.c
++++ b/src/sdpd-request.c
+@@ -917,7 +917,7 @@ static int service_search_attr_req(sdp_req_t *req, sdp_buf_t *buf)
+ 	} else {
+ 		/* continuation State exists -> get from cache */
+ 		sdp_buf_t *pCache = sdp_get_cached_rsp(cstate);
+-		if (pCache) {
++		if (pCache && cstate->cStateValue.maxBytesSent < pCache->data_size) {
+ 			uint16_t sent = MIN(max, pCache->data_size - cstate->cStateValue.maxBytesSent);
+ 			pResponse = pCache->data;
+ 			memcpy(buf->data, pResponse + cstate->cStateValue.maxBytesSent, sent);
+-- 
+cgit v1.1
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5_5.41.bb b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5_5.41.bb
deleted file mode 100644
index 522aab7..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5_5.41.bb
+++ /dev/null
@@ -1,55 +0,0 @@
-require bluez5.inc
-
-REQUIRED_DISTRO_FEATURES = "bluez5"
-
-SRC_URI[md5sum] = "318341b2188698130adb73236ee69244"
-SRC_URI[sha256sum] = "df7dc4462494dad4e60a2943240d584f6e760235dca64f5f10eba46dbab7f5f0"
-
-# noinst programs in Makefile.tools that are conditional on READLINE
-# support
-NOINST_TOOLS_READLINE ?= " \
-    attrib/gatttool \
-    tools/obex-client-tool \
-    tools/obex-server-tool \
-    tools/bluetooth-player \
-    tools/obexctl \
-    tools/btmgmt \
-"
-
-# noinst programs in Makefile.tools that are conditional on EXPERIMENTAL
-# support
-NOINST_TOOLS_EXPERIMENTAL ?= " \
-    emulator/btvirt \
-    emulator/b1ee \
-    emulator/hfp \
-    tools/3dsp \
-    tools/mgmt-tester \
-    tools/gap-tester \
-    tools/l2cap-tester \
-    tools/sco-tester \
-    tools/smp-tester \
-    tools/hci-tester \
-    tools/rfcomm-tester \
-    tools/bdaddr \
-    tools/avinfo \
-    tools/avtest \
-    tools/scotest \
-    tools/amptest \
-    tools/hwdb \
-    tools/hcieventmask \
-    tools/hcisecfilter \
-    tools/btinfo \
-    tools/btattach \
-    tools/btsnoop \
-    tools/btproxy \
-    tools/btiotest \
-    tools/mcaptest \
-    tools/cltest \
-    tools/oobtest \
-    tools/seq2bseq \
-    tools/ibeacon \
-    tools/btgatt-client \
-    tools/btgatt-server \
-    tools/gatt-service \
-    profiles/iap/iapd \
-"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5_5.43.bb b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5_5.43.bb
new file mode 100644
index 0000000..e10b82d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5_5.43.bb
@@ -0,0 +1,55 @@
+require bluez5.inc
+
+REQUIRED_DISTRO_FEATURES = "bluez5"
+
+SRC_URI[md5sum] = "698def88df96840dfbb0858bb6d73350"
+SRC_URI[sha256sum] = "16c9c05d2a1da644ce3570d975ada3643d2e60c007a955bac09c0a0efeb58d15"
+
+# noinst programs in Makefile.tools that are conditional on READLINE
+# support
+NOINST_TOOLS_READLINE ?= " \
+    attrib/gatttool \
+    tools/obex-client-tool \
+    tools/obex-server-tool \
+    tools/bluetooth-player \
+    tools/obexctl \
+    tools/btmgmt \
+"
+
+# noinst programs in Makefile.tools that are conditional on EXPERIMENTAL
+# support
+NOINST_TOOLS_EXPERIMENTAL ?= " \
+    emulator/btvirt \
+    emulator/b1ee \
+    emulator/hfp \
+    tools/3dsp \
+    tools/mgmt-tester \
+    tools/gap-tester \
+    tools/l2cap-tester \
+    tools/sco-tester \
+    tools/smp-tester \
+    tools/hci-tester \
+    tools/rfcomm-tester \
+    tools/bdaddr \
+    tools/avinfo \
+    tools/avtest \
+    tools/scotest \
+    tools/amptest \
+    tools/hwdb \
+    tools/hcieventmask \
+    tools/hcisecfilter \
+    tools/btinfo \
+    tools/btattach \
+    tools/btsnoop \
+    tools/btproxy \
+    tools/btiotest \
+    tools/mcaptest \
+    tools/cltest \
+    tools/oobtest \
+    tools/seq2bseq \
+    tools/ibeacon \
+    tools/btgatt-client \
+    tools/btgatt-server \
+    tools/gatt-service \
+    profiles/iap/iapd \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman.inc b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman.inc
index 35a7eed..64a5418 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman.inc
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman.inc
@@ -31,10 +31,8 @@
 "
 
 PACKAGECONFIG ??= "wispr \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd','systemd', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'wifi','wifi', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', '3g','3g', '', d)} \
 "
 
 # If you want ConnMan to support VPN, add following statement into
@@ -58,7 +56,7 @@
 
 python __anonymous () {
     systemd_packages = "${PN}"
-    pkgconfig = d.getVar('PACKAGECONFIG', True)
+    pkgconfig = d.getVar('PACKAGECONFIG')
     if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split():
         systemd_packages += " ${PN}-vpn"
     d.setVar('SYSTEMD_PACKAGES', systemd_packages)
@@ -116,7 +114,7 @@
 
 python populate_packages_prepend() {
     depmap = dict(pppd="ppp")
-    multilib_prefix = (d.getVar("MLPREFIX", True) or "")
+    multilib_prefix = (d.getVar("MLPREFIX") or "")
 
     hook = lambda file,pkg,x,y,z: \
         add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False)
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch
new file mode 100644
index 0000000..bf3b86d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch
@@ -0,0 +1,64 @@
+From c8bfad4ee9d2c505c00ccbb8b2139543b5ad6fcb Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 23 Jan 2017 17:41:39 +0200
+Subject: [PATCH] Fix compile on musl with kernel 4.9 headers
+
+Kernel headers break when musl defines IFF_LOWER_UP. While
+waiting for more proper fix in musl, add a hack to connman.
+
+Upstream-Status: Inappropriate [Workaround]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ src/6to4.c     | 4 ++++
+ src/firewall.c | 4 ++++
+ src/iptables.c | 4 ++++
+ 3 files changed, 12 insertions(+)
+
+diff --git a/src/6to4.c b/src/6to4.c
+index 71a2882..1938afb 100644
+--- a/src/6to4.c
++++ b/src/6to4.c
+@@ -24,6 +24,10 @@
+ #include <config.h>
+ #endif
+ 
++/* hack to make sure kernel headers understand that libc (musl)
++   does define IFF_LOWER_UP et al. */
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
++
+ #include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+diff --git a/src/firewall.c b/src/firewall.c
+index c440df6..c83def9 100644
+--- a/src/firewall.c
++++ b/src/firewall.c
+@@ -23,6 +23,10 @@
+ #include <config.h>
+ #endif
+ 
++/* hack to make sure kernel headers understand that libc (musl)
++   does define IFF_LOWER_UP et al. */
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
++
+ #include <errno.h>
+ 
+ #include <xtables.h>
+diff --git a/src/iptables.c b/src/iptables.c
+index 82e3ac4..46ad9e2 100644
+--- a/src/iptables.c
++++ b/src/iptables.c
+@@ -23,6 +23,10 @@
+ #include <config.h>
+ #endif
+ 
++/* hack to make sure kernel headers understand that libc (musl)
++   does define IFF_LOWER_UP et al. */
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
++
+ #include <getopt.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman_1.33.bb b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman_1.33.bb
index d8793ac..ee04d9b 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman_1.33.bb
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman_1.33.bb
@@ -8,7 +8,8 @@
             file://0003-stats-Fix-bad-file-descriptor-initialisation.patch \
             file://CVE-2017-12865.patch \
             "
-SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch"
+SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch \
+                             file://0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch"
 
 SRC_URI[md5sum] = "c51903fd3e7a6a371d12ac5d72a1fa01"
 SRC_URI[sha256sum] = "bc8946036fa70124d663136f9f6b6238d897ca482782df907b07a428b09df5a0"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp_4.3.4.bb b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp_4.3.4.bb
deleted file mode 100644
index 4151eb1..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp_4.3.4.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require dhcp.inc
-
-SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
-            file://link-with-lcrypto.patch \
-            file://fixsepbuild.patch \
-            file://dhclient-script-drop-resolv.conf.dhclient.patch \
-            file://replace-ifconfig-route.patch \
-            file://0001-site.h-enable-gentle-shutdown.patch \
-            file://libxml2-configure-argument.patch \
-            file://tweak-to-support-external-bind.patch \
-            file://remove-dhclient-script-bash-dependency.patch \
-           "
-
-SRC_URI[md5sum] = "0138319fe2b788cf4bdf34fbeaf9ff54"
-SRC_URI[sha256sum] = "f5115aee3dd3e6925de4ba47b80ab732ba48b481c8364b6ebade2d43698d607e"
-
-PACKAGECONFIG ?= ""
-PACKAGECONFIG[bind-httpstats] = "--with-libxml2,--without-libxml2,libxml2"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb
new file mode 100644
index 0000000..678c29a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb
@@ -0,0 +1,18 @@
+require dhcp.inc
+
+SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
+            file://link-with-lcrypto.patch \
+            file://fixsepbuild.patch \
+            file://dhclient-script-drop-resolv.conf.dhclient.patch \
+            file://replace-ifconfig-route.patch \
+            file://0001-site.h-enable-gentle-shutdown.patch \
+            file://libxml2-configure-argument.patch \
+            file://tweak-to-support-external-bind.patch \
+            file://remove-dhclient-script-bash-dependency.patch \
+           "
+
+SRC_URI[md5sum] = "2b5e5b2fa31c2e27e487039d86f83d3f"
+SRC_URI[sha256sum] = "eb95936bf15d2393c55dd505bc527d1d4408289cec5a9fa8abb99f7577e7f954"
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[bind-httpstats] = "--with-libxml2,--without-libxml2,libxml2"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc
index 63e7ca9..ce64888 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc
@@ -11,7 +11,7 @@
 
 DEPENDS = "flex-native bison-native iptables elfutils"
 
-inherit update-alternatives bash-completion
+inherit update-alternatives bash-completion pkgconfig
 
 EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"
 
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/0001-libc-compat.h-add-musl-workaround.patch b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/0001-libc-compat.h-add-musl-workaround.patch
new file mode 100644
index 0000000..3d324c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/0001-libc-compat.h-add-musl-workaround.patch
@@ -0,0 +1,41 @@
+From b7d96340c55afb7023ded0041107c63dbd886196 Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Thu, 22 Dec 2016 15:26:30 +0200
+Subject: [PATCH] libc-compat.h: add musl workaround
+
+The libc-compat.h kernel header uses glibc specific macros (__GLIBC__ and
+__USE_MISC) to solve conflicts with libc provided headers. This patch makes
+libc-compat.h work for musl libc as well.
+
+Upstream-Status: Pending
+
+Taken From:
+https://git.buildroot.net/buildroot/tree/package/iproute2/0001-Add-the-musl-workaround-to-the-libc-compat.h-copy.patch
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ include/linux/libc-compat.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/include/linux/libc-compat.h b/include/linux/libc-compat.h
+index f38571d..30f0b67 100644
+--- a/include/linux/libc-compat.h
++++ b/include/linux/libc-compat.h
+@@ -49,10 +49,12 @@
+ #define _LIBC_COMPAT_H
+ 
+ /* We have included glibc headers... */
+-#if defined(__GLIBC__)
++#if 1
++#define __USE_MISC
+ 
+ /* Coordinate with glibc net/if.h header. */
+ #if defined(_NET_IF_H) && defined(__USE_MISC)
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
+ 
+ /* GLIBC headers included first so don't define anything
+  * that would already be defined. */
+-- 
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-4.3.0-musl.patch b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-4.3.0-musl.patch
deleted file mode 100644
index 8c078f6..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-4.3.0-musl.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-Subject: [PATCH] Avoid in6_addr redefinition
-
-Due to both <netinet/in.h> and <linux/in6.h> being included, the
-in6_addr is being redefined: once from the C library headers and once
-from the kernel headers. This causes some build failures with for
-example the musl C library.
-
-In order to fix this, use just the C library header <netinet/in.h>.
-Original patch taken from
-http://git.alpinelinux.org/cgit/aports/tree/main/iproute2/musl-fixes.patch.
-
-(Refreshed the patch for 4.6 release)
-
-Upstream-Status: Pending
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
-----
-diff -Naur iproute2-4.6.0-orig/include/libiptc/ipt_kernel_headers.h iproute2-4.6.0/include/libiptc/ipt_kernel_headers.h
---- iproute2-4.6.0-orig/include/libiptc/ipt_kernel_headers.h	2016-05-23 12:03:23.821826910 +0300
-+++ iproute2-4.6.0/include/libiptc/ipt_kernel_headers.h	2016-05-23 12:04:23.714078154 +0300
-@@ -6,7 +6,6 @@
- #include <limits.h>
- 
- #include <netinet/ip.h>
--#include <netinet/in.h>
- #include <netinet/ip_icmp.h>
- #include <netinet/tcp.h>
- #include <netinet/udp.h>
-diff -Naur iproute2-4.6.0-orig/include/linux/if_bridge.h iproute2-4.6.0/include/linux/if_bridge.h
---- iproute2-4.6.0-orig/include/linux/if_bridge.h	2016-05-23 12:03:23.821826910 +0300
-+++ iproute2-4.6.0/include/linux/if_bridge.h	2016-05-23 12:04:23.716078129 +0300
-@@ -15,7 +15,6 @@
- 
- #include <linux/types.h>
- #include <linux/if_ether.h>
--#include <linux/in6.h>
- 
- #define SYSFS_BRIDGE_ATTR	"bridge"
- #define SYSFS_BRIDGE_FDB	"brforward"
-diff -Naur iproute2-4.6.0-orig/include/linux/netfilter.h iproute2-4.6.0/include/linux/netfilter.h
---- iproute2-4.6.0-orig/include/linux/netfilter.h	2016-05-23 12:03:23.821826910 +0300
-+++ iproute2-4.6.0/include/linux/netfilter.h	2016-05-23 12:04:23.717078117 +0300
-@@ -4,8 +4,6 @@
- #include <linux/types.h>
- 
- #include <linux/sysctl.h>
--#include <linux/in.h>
--#include <linux/in6.h>
- 
- /* Responses from hook functions. */
- #define NF_DROP 0
-diff -Naur iproute2-4.6.0-orig/include/linux/netfilter_ipv4/ip_tables.h iproute2-4.6.0/include/linux/netfilter_ipv4/ip_tables.h
---- iproute2-4.6.0-orig/include/linux/netfilter_ipv4/ip_tables.h	2016-05-18 21:56:02.000000000 +0300
-+++ iproute2-4.6.0/include/linux/netfilter_ipv4/ip_tables.h	2016-05-23 12:09:22.888337961 +0300
-@@ -17,7 +17,6 @@
- 
- #include <linux/types.h>
- 
--#include <linux/if.h>
- #include <linux/netfilter_ipv4.h>
- 
- #include <linux/netfilter/x_tables.h>
-diff -Naur iproute2-4.6.0-orig/include/linux/xfrm.h iproute2-4.6.0/include/linux/xfrm.h
---- iproute2-4.6.0-orig/include/linux/xfrm.h	2016-05-23 12:03:23.821826910 +0300
-+++ iproute2-4.6.0/include/linux/xfrm.h	2016-05-23 12:04:23.718078104 +0300
-@@ -1,7 +1,6 @@
- #ifndef _LINUX_XFRM_H
- #define _LINUX_XFRM_H
- 
--#include <linux/in6.h>
- #include <linux/types.h>
- 
- /* All of the structures in this file may not change size as they are
-diff -Naur iproute2-4.6.0-orig/include/utils.h iproute2-4.6.0/include/utils.h
---- iproute2-4.6.0-orig/include/utils.h	2016-05-23 12:03:23.821826910 +0300
-+++ iproute2-4.6.0/include/utils.h	2016-05-23 12:04:23.718078104 +0300
-@@ -1,6 +1,7 @@
- #ifndef __UTILS_H__
- #define __UTILS_H__ 1
- 
-+#include <sys/param.h>  /* MAXPATHLEN */
- #include <sys/types.h>
- #include <asm/types.h>
- #include <resolv.h>
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.10.0.bb b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.10.0.bb
new file mode 100644
index 0000000..a050e87
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.10.0.bb
@@ -0,0 +1,14 @@
+require iproute2.inc
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \
+           file://configure-cross.patch \
+           file://0001-iproute2-de-bash-scripts.patch \
+           file://0001-libc-compat.h-add-musl-workaround.patch \
+          "
+
+SRC_URI[md5sum] = "b94a2b0edefaeac124dc8f5d006931b9"
+SRC_URI[sha256sum] = "22b1e1c1fc704ad35837e5a66103739727b8b48ac90b48c13f79b7367ff0a9a8"
+
+# CFLAGS are computed in Makefile and reference CCOPTS
+#
+EXTRA_OEMAKE_append = " CCOPTS='${CFLAGS}'"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.7.0.bb b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.7.0.bb
deleted file mode 100644
index 426f989..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.7.0.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require iproute2.inc
-
-SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \
-           file://configure-cross.patch \
-           file://0001-iproute2-de-bash-scripts.patch \
-           file://iproute2-4.3.0-musl.patch \
-          "
-SRC_URI[md5sum] = "d4b205830cdc2702f8a0cbd6232129cd"
-SRC_URI[sha256sum] = "8f60dbcfb33a79daae0638f53bdcaa4310c0aa59ae39af8a234020dc69bb7b92"
-
-# CFLAGS are computed in Makefile and reference CCOPTS
-#
-EXTRA_OEMAKE_append = " CCOPTS='${CFLAGS}'"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw_4.7.bb b/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw_4.7.bb
deleted file mode 100644
index e9f4141..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw_4.7.bb
+++ /dev/null
@@ -1,33 +0,0 @@
-SUMMARY = "nl80211 based CLI configuration utility for wireless devices"
-DESCRIPTION = "iw is a new nl80211 based CLI configuration utility for \
-wireless devices. It supports almost all new drivers that have been added \
-to the kernel recently. "
-HOMEPAGE = "http://wireless.kernel.org/en/users/Documentation/iw"
-SECTION = "base"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=878618a5c4af25e9b93ef0be1a93f774"
-
-DEPENDS = "libnl"
-
-SRC_URI = "http://www.kernel.org/pub/software/network/iw/${BP}.tar.gz \
-           file://0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch \
-           file://separate-objdir.patch \
-"
-
-SRC_URI[md5sum] = "19d1edd276b2ac0c6cccfc7ae8d2b732"
-SRC_URI[sha256sum] = "758092229f13d691968060a0ad41364ba8eb8da4503626c20233a5b1eb33b4d9"
-
-inherit pkgconfig
-
-EXTRA_OEMAKE = "\
-    -f '${S}/Makefile' \
-    \
-    'PREFIX=${prefix}' \
-    'SBINDIR=${sbindir}' \
-    'MANDIR=${mandir}' \
-"
-B = "${WORKDIR}/build"
-
-do_install() {
-    oe_runmake 'DESTDIR=${D}' install
-}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw_4.9.bb b/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw_4.9.bb
new file mode 100644
index 0000000..6daeb07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw_4.9.bb
@@ -0,0 +1,33 @@
+SUMMARY = "nl80211 based CLI configuration utility for wireless devices"
+DESCRIPTION = "iw is a new nl80211 based CLI configuration utility for \
+wireless devices. It supports almost all new drivers that have been added \
+to the kernel recently. "
+HOMEPAGE = "http://wireless.kernel.org/en/users/Documentation/iw"
+SECTION = "base"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=878618a5c4af25e9b93ef0be1a93f774"
+
+DEPENDS = "libnl"
+
+SRC_URI = "http://www.kernel.org/pub/software/network/iw/${BP}.tar.gz \
+           file://0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch \
+           file://separate-objdir.patch \
+"
+
+SRC_URI[md5sum] = "06e96ab7a5c652f8eaed6f71533a9e0f"
+SRC_URI[sha256sum] = "12f921f3dbe0f33c309f5f2891cccf5325c94bd48dceeb102de183f5f048a9e2"
+
+inherit pkgconfig
+
+EXTRA_OEMAKE = "\
+    -f '${S}/Makefile' \
+    \
+    'PREFIX=${prefix}' \
+    'SBINDIR=${sbindir}' \
+    'MANDIR=${mandir}' \
+"
+B = "${WORKDIR}/build"
+
+do_install() {
+    oe_runmake 'DESTDIR=${D}' install
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap.inc b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap.inc
index 7b29a52..6635779 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap.inc
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap.inc
@@ -19,14 +19,14 @@
 inherit autotools binconfig-disabled pkgconfig bluetooth
 
 EXTRA_OECONF = "--with-pcap=linux"
+EXTRA_AUTORECONF += "--exclude=aclocal"
 
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
 "
 PACKAGECONFIG[bluez4] = "--enable-bluetooth,--disable-bluetooth,bluez4"
 # Add a dummy PACKAGECONFIG for bluez5 since it is not supported by libpcap.
 PACKAGECONFIG[bluez5] = ",,"
-PACKAGECONFIG[canusb] = "--enable-canusb,--enable-canusb=no,libusb"
 PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 PACKAGECONFIG[libnl] = "--with-libnl,--without-libnl,libnl"
@@ -36,8 +36,5 @@
 CXXFLAGS_prepend = "-I${S} "
 
 do_configure_prepend () {
-    if [ ! -e ${S}/acinclude.m4 ]; then
-        cat ${S}/aclocal.m4 > ${S}/acinclude.m4
-    fi
     sed -i -e's,^V_RPATH_OPT=.*$,V_RPATH_OPT=,' ${S}/pcap-config.in
 }
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch
new file mode 100644
index 0000000..edb6ae5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch
@@ -0,0 +1,41 @@
+From 64aa033a061c43fc15c711f2490ae41d23b868c3 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Thu, 17 Nov 2016 09:44:42 -0200
+Subject: [PATCH 1/2] Fix compiler_state_t.ai usage when INET6 is not defined
+Organization: O.S. Systems Software LTDA.
+
+Fix error:
+
+/
+| ../libpcap-1.8.1/gencode.c: In function 'pcap_compile':
+| ../libpcap-1.8.1/gencode.c:693:8: error: 'compiler_state_t
+| {aka struct _compiler_state}' has no member named 'ai'
+|   cstate.ai = NULL;
+\
+
+Upstream-Status: Submitted [1]
+
+[1] https://github.com/the-tcpdump-group/libpcap/pull/541
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ gencode.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gencode.c b/gencode.c
+index a887f27..e103c70 100644
+--- a/gencode.c
++++ b/gencode.c
+@@ -690,7 +690,9 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
+ 	}
+ 	initchunks(&cstate);
+ 	cstate.no_optimize = 0;
++#ifdef INET6
+ 	cstate.ai = NULL;
++#endif
+ 	cstate.ic.root = NULL;
+ 	cstate.ic.cur_mark = 0;
+ 	cstate.bpf_pcap = p;
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch
new file mode 100644
index 0000000..032b265
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch
@@ -0,0 +1,67 @@
+From 50ec0a088d5924a8305b2d70dcba71b0942dee1a Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Thu, 17 Nov 2016 09:47:29 -0200
+Subject: [PATCH 2/2] Add missing compiler_state_t parameter
+Organization: O.S. Systems Software LTDA.
+
+Fix error:
+
+/
+|../libpcap-1.8.1/gencode.c: In function 'gen_gateway':
+|../libpcap-1.8.1/gencode.c:4914:13: error: 'cstate' undeclared
+| (first use in this function)
+|    bpf_error(cstate, "direction applied to 'gateway'");
+\
+
+Upstream-Status: Submitted [1]
+
+[1] https://github.com/the-tcpdump-group/libpcap/pull/541
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ gencode.c | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/gencode.c b/gencode.c
+index e103c70..f07c0be 100644
+--- a/gencode.c
++++ b/gencode.c
+@@ -523,7 +523,7 @@ static struct block *gen_host6(compiler_state_t *, struct in6_addr *,
+     struct in6_addr *, int, int, int);
+ #endif
+ #ifndef INET6
+-static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int);
++static struct block *gen_gateway(compiler_state_t *, const u_char *, bpf_u_int32 **, int, int);
+ #endif
+ static struct block *gen_ipfrag(compiler_state_t *);
+ static struct block *gen_portatom(compiler_state_t *, int, bpf_int32);
+@@ -4904,11 +4904,12 @@ gen_host6(compiler_state_t *cstate, struct in6_addr *addr,
+ 
+ #ifndef INET6
+ static struct block *
+-gen_gateway(eaddr, alist, proto, dir)
+-	const u_char *eaddr;
+-	bpf_u_int32 **alist;
+-	int proto;
+-	int dir;
++gen_gateway(cstate, eaddr, alist, proto, dir)
++    compiler_state_t *cstate;
++    const u_char *eaddr;
++    bpf_u_int32 **alist;
++    int proto;
++    int dir;
+ {
+ 	struct block *b0, *b1, *tmp;
+ 
+@@ -6472,7 +6473,7 @@ gen_scode(compiler_state_t *cstate, const char *name, struct qual q)
+ 		alist = pcap_nametoaddr(name);
+ 		if (alist == NULL || *alist == NULL)
+ 			bpf_error(cstate, "unknown host '%s'", name);
+-		b = gen_gateway(eaddr, alist, proto, dir);
++		b = gen_gateway(cstate, eaddr, alist, proto, dir);
+ 		free(eaddr);
+ 		return b;
+ #else
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/aclocal.patch b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/aclocal.patch
deleted file mode 100644
index 2151982..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/aclocal.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-Upstream-Status: Inappropriate [configuration]
-
-diff -ruN libpcap-1.1.1-orig/aclocal.m4 libpcap-1.1.1/aclocal.m4
---- libpcap-1.1.1-orig/aclocal.m4	2010-06-29 10:46:32.815117569 +0800
-+++ libpcap-1.1.1/aclocal.m4	2010-06-29 10:49:17.150149949 +0800
-@@ -37,7 +37,7 @@
- dnl AC_LBL_C_INIT.  Now, we run AC_LBL_C_INIT_BEFORE_CC, AC_PROG_CC,
- dnl and AC_LBL_C_INIT at the top level.
- dnl
--AC_DEFUN(AC_LBL_C_INIT_BEFORE_CC,
-+AC_DEFUN([AC_LBL_C_INIT_BEFORE_CC],
- [
-     AC_BEFORE([$0], [AC_LBL_C_INIT])
-     AC_BEFORE([$0], [AC_PROG_CC])
-@@ -90,7 +90,7 @@
- dnl     LDFLAGS
- dnl     LBL_CFLAGS
- dnl
--AC_DEFUN(AC_LBL_C_INIT,
-+AC_DEFUN([AC_LBL_C_INIT],
- [
-     AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
-     AC_BEFORE([$0], [AC_LBL_DEVEL])
-@@ -217,7 +217,7 @@
- dnl	V_SONAME_OPT
- dnl	V_RPATH_OPT
- dnl
--AC_DEFUN(AC_LBL_SHLIBS_INIT,
-+AC_DEFUN([AC_LBL_SHLIBS_INIT],
-     [AC_PREREQ(2.50)
-     if test "$GCC" = yes ; then
- 	    #
-@@ -361,7 +361,7 @@
- # Make sure we use the V_CCOPT flags, because some of those might
- # disable inlining.
- #
--AC_DEFUN(AC_LBL_C_INLINE,
-+AC_DEFUN([AC_LBL_C_INLINE],
-     [AC_MSG_CHECKING(for inline)
-     save_CFLAGS="$CFLAGS"
-     CFLAGS="$V_CCOPT"
-@@ -407,7 +407,7 @@
- dnl
- dnl	AC_LBL_FIXINCLUDES
- dnl
--AC_DEFUN(AC_LBL_FIXINCLUDES,
-+AC_DEFUN([AC_LBL_FIXINCLUDES],
-     [if test "$GCC" = yes ; then
- 	    AC_MSG_CHECKING(for ANSI ioctl definitions)
- 	    AC_CACHE_VAL(ac_cv_lbl_gcc_fixincludes,
-@@ -453,7 +453,7 @@
- dnl	$2 (yacc appended)
- dnl	$3 (optional flex and bison -P prefix)
- dnl
--AC_DEFUN(AC_LBL_LEX_AND_YACC,
-+AC_DEFUN([AC_LBL_LEX_AND_YACC],
-     [AC_ARG_WITH(flex, [  --without-flex          don't use flex])
-     AC_ARG_WITH(bison, [  --without-bison         don't use bison])
-     if test "$with_flex" = no ; then
-@@ -506,7 +506,7 @@
- dnl
- dnl	DECLWAITSTATUS (defined)
- dnl
--AC_DEFUN(AC_LBL_UNION_WAIT,
-+AC_DEFUN([AC_LBL_UNION_WAIT],
-     [AC_MSG_CHECKING(if union wait is used)
-     AC_CACHE_VAL(ac_cv_lbl_union_wait,
- 	AC_TRY_COMPILE([
-@@ -535,7 +535,7 @@
- dnl
- dnl	HAVE_SOCKADDR_SA_LEN (defined)
- dnl
--AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN,
-+AC_DEFUN([AC_LBL_SOCKADDR_SA_LEN],
-     [AC_MSG_CHECKING(if sockaddr struct has the sa_len member)
-     AC_CACHE_VAL(ac_cv_lbl_sockaddr_has_sa_len,
- 	AC_TRY_COMPILE([
-@@ -560,7 +560,7 @@
- dnl
- dnl	HAVE_SOCKADDR_STORAGE (defined)
- dnl
--AC_DEFUN(AC_LBL_SOCKADDR_STORAGE,
-+AC_DEFUN([AC_LBL_SOCKADDR_STORAGE],
-     [AC_MSG_CHECKING(if sockaddr_storage struct exists)
-     AC_CACHE_VAL(ac_cv_lbl_has_sockaddr_storage,
- 	AC_TRY_COMPILE([
-@@ -593,7 +593,7 @@
- dnl won't be using code that would use that member, or we wouldn't
- dnl compile in any case).
- dnl
--AC_DEFUN(AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1,
-+AC_DEFUN([AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1],
-     [AC_MSG_CHECKING(if dl_hp_ppa_info_t struct has dl_module_id_1 member)
-     AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1,
- 	AC_TRY_COMPILE([
-@@ -619,7 +619,7 @@
- dnl
- dnl	ac_cv_lbl_have_run_path (yes or no)
- dnl
--AC_DEFUN(AC_LBL_HAVE_RUN_PATH,
-+AC_DEFUN([AC_LBL_HAVE_RUN_PATH],
-     [AC_MSG_CHECKING(for ${CC-cc} -R)
-     AC_CACHE_VAL(ac_cv_lbl_have_run_path,
- 	[echo 'main(){}' > conftest.c
-@@ -644,7 +644,7 @@
- dnl
- dnl	LBL_ALIGN (DEFINED)
- dnl
--AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
-+AC_DEFUN([AC_LBL_UNALIGNED_ACCESS],
-     [AC_MSG_CHECKING(if unaligned accesses fail)
-     AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
- 	[case "$host_cpu" in
-@@ -749,7 +749,7 @@
- dnl	HAVE_OS_PROTO_H (defined)
- dnl	os-proto.h (symlinked)
- dnl
--AC_DEFUN(AC_LBL_DEVEL,
-+AC_DEFUN([AC_LBL_DEVEL],
-     [rm -f os-proto.h
-     if test "${LBL_CFLAGS+set}" = set; then
- 	    $1="$$1 ${LBL_CFLAGS}"
-@@ -886,7 +886,7 @@
- dnl statically and happen to have a libresolv.a lying around (and no
- dnl libnsl.a).
- dnl
--AC_DEFUN(AC_LBL_LIBRARY_NET, [
-+AC_DEFUN([AC_LBL_LIBRARY_NET], [
-     # Most operating systems have gethostbyname() in the default searched
-     # libraries (i.e. libc):
-     # Some OSes (eg. Solaris) place it in libnsl
-@@ -909,7 +909,7 @@
- dnl Test for __attribute__
- dnl
- 
--AC_DEFUN(AC_C___ATTRIBUTE__, [
-+AC_DEFUN([AC_C___ATTRIBUTE__], [
- AC_MSG_CHECKING(for __attribute__)
- AC_CACHE_VAL(ac_cv___attribute__, [
- AC_COMPILE_IFELSE(
-@@ -947,7 +947,7 @@
- dnl
- dnl -Scott Barron
- dnl
--AC_DEFUN(AC_LBL_TPACKET_STATS,
-+AC_DEFUN([AC_LBL_TPACKET_STATS],
-    [AC_MSG_CHECKING(if if_packet.h has tpacket_stats defined)
-    AC_CACHE_VAL(ac_cv_lbl_tpacket_stats,
-    AC_TRY_COMPILE([
-@@ -976,7 +976,7 @@
- dnl doesn't have that member (which is OK, as either we won't be using
- dnl code that would use that member, or we wouldn't compile in any case).
- dnl
--AC_DEFUN(AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI,
-+AC_DEFUN([AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI],
-     [AC_MSG_CHECKING(if tpacket_auxdata struct has tp_vlan_tci member)
-     AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1,
- 	AC_TRY_COMPILE([
-@@ -1003,7 +1003,7 @@
- dnl 
- dnl 	HAVE_DLPI_PASSIVE (defined)
- dnl
--AC_DEFUN(AC_LBL_DL_PASSIVE_REQ_T,
-+AC_DEFUN([AC_LBL_DL_PASSIVE_REQ_T],
-         [AC_MSG_CHECKING(if dl_passive_req_t struct exists)
-        AC_CACHE_VAL(ac_cv_lbl_has_dl_passive_req_t,
-                 AC_TRY_COMPILE([
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch
new file mode 100644
index 0000000..7e1eea6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch
@@ -0,0 +1,36 @@
+Disable bits of remote capture support inherited from the WinPCAP merge
+which cause applications to FTBFS if they define HAVE_REMOTE.
+
+Patch from:
+https://anonscm.debian.org/cgit/users/rfrancoise/libpcap.git/commit/?
+id=f35949969269dfdcc3549b12fade604755e1e326
+
+Upstream-Status: Pending
+
+--- a/pcap/pcap.h
++++ b/pcap/pcap.h
+@@ -506,6 +506,11 @@
+   #define MODE_STAT 1
+   #define MODE_MON 2
+ 
++#ifdef HAVE_REMOTE
++  /* Includes most of the public stuff that is needed for the remote capture */
++  #include <remote-ext.h>
++#endif	 /* HAVE_REMOTE */
++
+ #elif defined(MSDOS)
+ 
+   /*
+@@ -526,11 +531,6 @@
+ 
+ #endif /* _WIN32/MSDOS/UN*X */
+ 
+-#ifdef HAVE_REMOTE
+-  /* Includes most of the public stuff that is needed for the remote capture */
+-  #include <remote-ext.h>
+-#endif	 /* HAVE_REMOTE */
+-
+ #ifdef __cplusplus
+ }
+ #endif
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch
new file mode 100644
index 0000000..f40e655
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch
@@ -0,0 +1,29 @@
+Fix a missing dependency that can result in:
+
+../libpcap-1.8.1/grammar.y:78:10: fatal error: scanner.h: No such file or directory
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 0dd90a6bdbce4dca14106859eee63ef643a106e2 Mon Sep 17 00:00:00 2001
+From: Alfredo Alvarez Fernandez <alfredoalvarezernandez@gmail.com>
+Date: Tue, 21 Feb 2017 11:41:43 +0100
+Subject: [PATCH] Makefile.in: Fix missing dependency
+
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 7044f043..f5d443ae 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -465,7 +465,7 @@ grammar.h: grammar.c
+ 		$(MAKE) $(MAKEFLAGS) grammar.c; \
+ 	fi
+ 
+-grammar.o: grammar.c
++grammar.o: grammar.c scanner.h
+ 	$(CC) $(FULL_CFLAGS) -c grammar.c
+ 
+ gencode.o: $(srcdir)/gencode.c grammar.h scanner.h
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
index b861513..afaa3be 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
@@ -1,25 +1,27 @@
-From 8887132e85892a72a84ca3878e60f254ad2ce939 Mon Sep 17 00:00:00 2001
-From: Joe MacDonald <joe_macdonald@mentor.com>
-Date: Tue, 24 Feb 2015 15:56:06 -0500
+From 2796129af52901dd68595e5e88a639308541def9 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Thu, 3 Nov 2016 17:56:29 -0200
 Subject: [PATCH] libpcap: pkgconfig support
+Organization: O.S. Systems Software LTDA.
 
 Adding basic structure to support pkg-config.
 
 Upstream-Status: Inappropriate [embedded specific]
 
 Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
 ---
  Makefile.in   |  5 +++++
- configure.in  |  1 +
+ configure.ac  |  1 +
  libpcap.pc.in | 10 ++++++++++
  3 files changed, 16 insertions(+)
  create mode 100644 libpcap.pc.in
 
 diff --git a/Makefile.in b/Makefile.in
-index 1c2d745..1f25faf 100644
+index e71d973..d7004ed 100644
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -60,6 +60,10 @@ V_RPATH_OPT = @V_RPATH_OPT@
+@@ -61,6 +61,10 @@ V_RPATH_OPT = @V_RPATH_OPT@
  DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
  PROG=libpcap
  
@@ -30,19 +32,19 @@
  # Standard CFLAGS
  FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS)
  
-@@ -275,6 +279,7 @@ EXTRA_DIST = \
+@@ -286,6 +290,7 @@ EXTRA_DIST = \
  	lbl/os-solaris2.h \
  	lbl/os-sunos4.h \
  	lbl/os-ultrix4.h \
 +	libpcap.pc \
+ 	missing/getopt.c \
+ 	missing/getopt.h \
  	missing/snprintf.c \
- 	mkdep \
- 	msdos/bin2c.c \
-diff --git a/configure.in b/configure.in
-index 8f5c86b..fb51b35 100644
---- a/configure.in
-+++ b/configure.in
-@@ -1700,6 +1700,7 @@ esac
+diff --git a/configure.ac b/configure.ac
+index da2f940..4fc67bf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1805,6 +1805,7 @@ fi
  AC_PROG_INSTALL
  
  AC_CONFIG_HEADER(config.h)
@@ -67,5 +69,5 @@
 +Libs: -L${libdir} -lpcap
 +Cflags: -I${includedir}
 -- 
-1.9.1
+2.1.4
 
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.7.4.bb b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.7.4.bb
deleted file mode 100644
index 8d12b25..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.7.4.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-require libpcap.inc
-
-SRC_URI += "file://aclocal.patch \
-            file://libpcap-pkgconfig-support.patch \
-           "
-SRC_URI[md5sum] = "b2e13142bbaba857ab1c6894aedaf547"
-SRC_URI[sha256sum] = "7ad3112187e88328b85e46dce7a9b949632af18ee74d97ffc3f2b41fe7f448b0"
-
-#
-# make install doesn't cover the shared lib
-# make install-shared is just broken (no symlinks)
-#
-
-do_configure_prepend () {
-    #remove hardcoded references to /usr/include
-    sed 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i ${S}/configure.in
-}
-
-do_install_prepend () {
-    install -d ${D}${libdir}
-    install -d ${D}${bindir}
-    oe_runmake install-shared DESTDIR=${D}
-    oe_libinstall -a -so libpcap ${D}${libdir}
-    sed "s|@VERSION@|${PV}|" -i ${B}/libpcap.pc
-    install -D -m 0644 libpcap.pc ${D}${libdir}/pkgconfig/libpcap.pc
-}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb
new file mode 100644
index 0000000..13dfbd6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb
@@ -0,0 +1,31 @@
+require libpcap.inc
+
+SRC_URI += " \
+    file://libpcap-pkgconfig-support.patch \
+    file://0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch \
+    file://0002-Add-missing-compiler_state_t-parameter.patch \
+    file://disable-remote.patch \
+    file://fix-grammar-deps.patch \
+"
+
+SRC_URI[md5sum] = "3d48f9cd171ff12b0efd9134b52f1447"
+SRC_URI[sha256sum] = "673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e"
+
+#
+# make install doesn't cover the shared lib
+# make install-shared is just broken (no symlinks)
+#
+
+do_configure_prepend () {
+    #remove hardcoded references to /usr/include
+    sed 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i ${S}/configure.ac
+}
+
+do_install_prepend () {
+    install -d ${D}${libdir}
+    install -d ${D}${bindir}
+    oe_runmake install-shared DESTDIR=${D}
+    oe_libinstall -a -so libpcap ${D}${libdir}
+    sed "s|@VERSION@|${PV}|" -i ${B}/libpcap.pc
+    install -D -m 0644 libpcap.pc ${D}${libdir}/pkgconfig/libpcap.pc
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/0001-Add-header-dependency-to-nciattach.o.patch b/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/0001-Add-header-dependency-to-nciattach.o.patch
new file mode 100644
index 0000000..d8e8a5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/0001-Add-header-dependency-to-nciattach.o.patch
@@ -0,0 +1,35 @@
+From affaa2021a54c30353e4e1fee09c13a4de2196be Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 17 Mar 2017 14:24:29 +0200
+Subject: [PATCH] Add header dependency to nciattach.o
+
+This can happen when compiling nciattach.o:
+
+| In file included from ../neard-0.16/tools/nciattach.c:47:0:
+| ../neard-0.16/src/near.h:30:27: fatal error: near/nfc_copy.h: No such
+file or directory
+|  #include <near/nfc_copy.h>
+
+Add the missing dependency to local headers.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Submitted [mailinglist]
+---
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index fa552ee..acef6ba 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -253,6 +253,7 @@ se/builtin.h: src/genbuiltin $(builtin_se_sources)
+ 
+ $(src_neard_OBJECTS) \
+ $(tools_nfctool_nfctool_OBJECTS) \
++$(tools_nciattach_OBJECTS) \
+ $(plugin_objects) \
+ $(se_seeld_OBJECTS) \
+ $(unit_test_ndef_parse_OBJECTS) \
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard_0.16.bb b/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard_0.16.bb
index 5433dc3..cc6af4e 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard_0.16.bb
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard_0.16.bb
@@ -9,6 +9,7 @@
            file://neard.in \
            file://Makefile.am-fix-parallel-issue.patch \
            file://Makefile.am-do-not-ship-version.h.patch \
+           file://0001-Add-header-dependency-to-nciattach.o.patch \
           "
 SRC_URI[md5sum] = "5c691fb7872856dc0d909c298bc8cb41"
 SRC_URI[sha256sum] = "eae3b11c541a988ec11ca94b7deab01080cd5b58cfef3ced6ceac9b6e6e65b36"
@@ -19,7 +20,7 @@
 
 inherit autotools pkgconfig systemd update-rc.d bluetooth
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 
 PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/ --with-systemduserunitdir=${systemd_unitdir}/user/,--disable-systemd"
 
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch
index 8500229..ede0dce 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch
@@ -9,17 +9,18 @@
 Signed-off-by: Roy Li <rongqing.li@windriver.com>
 Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
 ---
- utils/statd/start-statd | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
+ utils/statd/start-statd | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
 
 diff --git a/utils/statd/start-statd b/utils/statd/start-statd
-index ec9383b..3969b8c 100755
+index 2fd6039..f591b34 100755
 --- a/utils/statd/start-statd
 +++ b/utils/statd/start-statd
-@@ -6,6 +6,13 @@
- # site.
- PATH="/sbin:/usr/sbin:/bin:/usr/bin"
- 
+@@ -17,6 +17,14 @@ then
+     # statd already running - must have been slow to respond.
+     exit 0
+ fi
++
 +# Read config
 +DEFAULTFILE=/etc/default/nfs-common
 +NEED_IDMAPD=
@@ -28,14 +29,14 @@
 +fi
 +
  # First try systemd if it's installed.
- if systemctl --help >/dev/null 2>&1; then
+ if [ -d /run/systemd/system ]; then
      # Quit only if the call worked.
-@@ -13,4 +20,4 @@ if systemctl --help >/dev/null 2>&1; then
- fi
+@@ -25,4 +33,4 @@ fi
  
+ cd /
  # Fall back to launching it ourselves.
 -exec rpc.statd --no-notify
 +exec rpc.statd --no-notify $STATDOPTS
 -- 
-1.9.1
+2.6.6
 
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch
deleted file mode 100644
index de0b045..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-Upstream-Status: Pending
-
-Subject: nfs-utils/statd: fix a segfault caused by improper usage of RPC interface
-
-There is a hack which uses the bottom-level RPC improperly as below
-in the current statd implementation:
-insert a socket in the svc_fdset without a corresponding transport handle
-and passes the socket to the svc_getreqset subroutine, this usage causes
-a segfault of statd on a huge amount of sm-notifications.
-
-Fix the issue by separating the non-RPC-server sock from RPC dispatcher.
-
-Signed-off-by: Shan Hai <shan.hai@windriver.com>
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
----
- utils/statd/rmtcall.c | 1 -
- utils/statd/statd.c   | 5 +++--
- utils/statd/statd.h   | 2 +-
- utils/statd/svc_run.c | 8 ++++++--
- 4 files changed, 10 insertions(+), 6 deletions(-)
-
-diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c
-index fd576d9..cde091b 100644
---- a/utils/statd/rmtcall.c
-+++ b/utils/statd/rmtcall.c
-@@ -104,7 +104,6 @@ statd_get_socket(void)
- 	if (sockfd < 0)
- 		return -1;
- 
--	FD_SET(sockfd, &SVC_FDSET);
- 	return sockfd;
- }
- 
-diff --git a/utils/statd/statd.c b/utils/statd/statd.c
-index 51a016e..e21a259 100644
---- a/utils/statd/statd.c
-+++ b/utils/statd/statd.c
-@@ -247,6 +247,7 @@ int main (int argc, char **argv)
- 	int port = 0, out_port = 0;
- 	int nlm_udp = 0, nlm_tcp = 0;
- 	struct rlimit rlim;
-+	int notify_sockfd;
- 
- 	int pipefds[2] = { -1, -1};
- 	char status;
-@@ -473,7 +474,7 @@ int main (int argc, char **argv)
- 		}
- 
- 	/* Make sure we have a privilege port for calling into the kernel */
--	if (statd_get_socket() < 0)
-+	if ((notify_sockfd = statd_get_socket()) < 0)
- 		exit(1);
- 
- 	/* If sm-notify didn't take all the state files, load
-@@ -528,7 +529,7 @@ int main (int argc, char **argv)
- 		 * Handle incoming requests:  SM_NOTIFY socket requests, as
- 		 * well as callbacks from lockd.
- 		 */
--		my_svc_run();	/* I rolled my own, Olaf made it better... */
-+		my_svc_run(notify_sockfd);	/* I rolled my own, Olaf made it better... */
- 
- 		/* Only get here when simulating a crash so we should probably
- 		 * start sm-notify running again.  As we have already dropped
-diff --git a/utils/statd/statd.h b/utils/statd/statd.h
-index a1d8035..231ac7e 100644
---- a/utils/statd/statd.h
-+++ b/utils/statd/statd.h
-@@ -28,7 +28,7 @@ extern _Bool	statd_present_address(const struct sockaddr *sap, char *buf,
- __attribute__((__malloc__))
- extern char *	statd_canonical_name(const char *hostname);
- 
--extern void	my_svc_run(void);
-+extern void	my_svc_run(int);
- extern void	notify_hosts(void);
- extern void	shuffle_dirs(void);
- extern int	statd_get_socket(void);
-diff --git a/utils/statd/svc_run.c b/utils/statd/svc_run.c
-index d98ecee..28c1ad6 100644
---- a/utils/statd/svc_run.c
-+++ b/utils/statd/svc_run.c
-@@ -78,7 +78,7 @@ my_svc_exit(void)
-  * The heart of the server.  A crib from libc for the most part...
-  */
- void
--my_svc_run(void)
-+my_svc_run(int sockfd)
- {
- 	FD_SET_TYPE	readfds;
- 	int             selret;
-@@ -96,6 +96,8 @@ my_svc_run(void)
- 		}
- 
- 		readfds = SVC_FDSET;
-+		/* Set notify sockfd for waiting for reply */
-+		FD_SET(sockfd, &readfds);
- 		if (notify) {
- 			struct timeval	tv;
- 
-@@ -125,8 +127,10 @@ my_svc_run(void)
- 
- 		default:
- 			selret -= process_reply(&readfds);
--			if (selret)
-+			if (selret) {
-+				FD_CLR(sockfd, &readfds);
- 				svc_getreqset(&readfds);
-+			}
- 		}
- 	}
- }
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/fix-protocol-minor-version-fall-back.patch b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/fix-protocol-minor-version-fall-back.patch
deleted file mode 100644
index 683246c..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/fix-protocol-minor-version-fall-back.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 78bb645a42c216b37b8d930c7c849a3fa89babf8 Mon Sep 17 00:00:00 2001
-From: Takashi Iwai <tiwai@suse.com>
-Date: Sat, 16 Jan 2016 12:02:30 -0500
-Subject: [PATCH] Fix protocol minor version fall-back
-
-mount.nfs currently expects mount(2) to fail with EPROTONOSUPPORT if
-the kernel doesn't understand the requested NFS version.
-
-Unfortunately if the requested minor is not known to the kernel
-it returns -EINVAL.
-In kernels since 3.11 this can happen in nfs4_alloc_client(), if
-compiled without NFS_V4_2.
-
-More generally it can happen in in nfs_validate_text_mount_data()
-when nfs_parse_mount_options() returns 0 because
-nfs_parse_version_string()
-didn't recognise the version.
-
-EPROTONOSUPPORT is only returned if NFSv4 support is completely compiled
-out.
-
-So nfs_autonegotiate needs to check for EINVAL as well as
-EPROTONOSUPPORT.
-
-URL: https://bugzilla.opensuse.org/show_bug.cgi?id=959211
-Reported-by: Takashi Iwai <tiwai@suse.com>
-Signed-off-by: NeilBrown <neilb@suse.com>
-Signed-off-by: Steve Dickson <steved@redhat.com>
-
-
-Upstream-Status: Backport
-http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=patch;h=78bb645a42c216b37b8d930c7c849a3fa89babf8
-
-Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
----
- utils/mount/stropts.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
-index c8f5a6d..86829a9 100644
---- a/utils/mount/stropts.c
-+++ b/utils/mount/stropts.c
-@@ -841,6 +841,9 @@ check_result:
- 	case EPROTONOSUPPORT:
- 		/* A clear indication that the server or our
- 		 * client does not support NFS version 4 and minor */
-+	case EINVAL:
-+		/* A less clear indication that our client
-+		 * does not support NFSv4 minor version. */
- 		if (mi->version.v_mode == V_GENERAL &&
- 			mi->version.minor == 0)
- 				return result;
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
index 613ddc0..27ea58d 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
@@ -1,7 +1,11 @@
 [Unit]
 Description=NFS Mount Daemon
-After=rpcbind.service nfs-server.service
-Requires=rpcbind.service nfs-server.service
+DefaultDependencies=no
+Requires=proc-fs-nfsd.mount
+After=proc-fs-nfsd.mount
+After=network.target local-fs.target
+BindsTo=nfs-server.service
+ConditionPathExists=@SYSCONFDIR@/exports
 
 [Service]
 EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
index 147d7a7..6481377 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
@@ -1,7 +1,12 @@
 [Unit]
-Description=NFS Server
-Requires=rpcbind.service nfs-mountd.service
-After=rpcbind.service
+Description=NFS server and services
+DefaultDependencies=no
+Requires=network.target proc-fs-nfsd.mount
+Requires=nfs-mountd.service
+Wants=rpcbind.service
+After=local-fs.target
+After=network.target proc-fs-nfsd.mount rpcbind.service nfs-mountd.service
+ConditionPathExists=@SYSCONFDIR@/exports
 
 [Service]
 Type=oneshot
@@ -9,6 +14,7 @@
 ExecStartPre=@SBINDIR@/exportfs -r
 ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT
 ExecStop=@SBINDIR@/rpc.nfsd 0
+ExecStopPost=@SBINDIR@/exportfs -au
 ExecStopPost=@SBINDIR@/exportfs -f
 ExecReload=@SBINDIR@/exportfs -r
 StandardError=syslog
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
index 746dacf..6e196b8 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
@@ -1,8 +1,9 @@
 [Unit]
-Description=NFS file locking service
-After=rpcbind.service
-Requires=rpcbind.service
-Before=remote-fs-pre.target
+Description=NFS status monitor for NFSv2/3 locking.
+DefaultDependencies=no
+Conflicts=umount.target
+Requires=nss-lookup.target rpcbind.service
+After=network.target nss-lookup.target rpcbind.service
 
 [Service]
 EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
index 7ed93a5..d5e9c38 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
@@ -40,7 +40,7 @@
 #mountd
 start_mountd(){
 	echo -n 'starting mountd: '
-	start-stop-daemon --start --exec "$NFS_MOUNTD" -- "-f /etc/exports $@"
+	start-stop-daemon --start --exec "$NFS_MOUNTD" -- "$@"
 	echo done
 }
 stop_mountd(){
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb
deleted file mode 100644
index a2bebe0..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb
+++ /dev/null
@@ -1,151 +0,0 @@
-SUMMARY = "userspace utilities for kernel nfs"
-DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \
-NFS server and related tools."
-HOMEPAGE = "http://nfs.sourceforge.net/"
-SECTION = "console/network"
-
-LICENSE = "MIT & GPLv2+ & BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
-
-# util-linux for libblkid
-DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3 libtirpc"
-RDEPENDS_${PN}-client = "rpcbind bash"
-RDEPENDS_${PN} = "${PN}-client bash"
-RRECOMMENDS_${PN} = "kernel-module-nfsd"
-
-inherit useradd
-
-USERADD_PACKAGES = "${PN}-client"
-USERADD_PARAM_${PN}-client = "--system  --home-dir /var/lib/nfs \
-			      --shell /bin/false --user-group rpcuser"
-
-SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
-           file://0001-configure-Allow-to-explicitly-disable-nfsidmap.patch \
-           file://nfs-utils-1.2.3-sm-notify-res_init.patch \
-           file://nfsserver \
-           file://nfscommon \
-           file://nfs-utils.conf \
-           file://nfs-server.service \
-           file://nfs-mountd.service \
-           file://nfs-statd.service \
-           file://proc-fs-nfsd.mount \
-           file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
-           file://nfs-utils-debianize-start-statd.patch \
-           file://0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch \
-           file://bugfix-adjust-statd-service-name.patch \
-           file://fix-protocol-minor-version-fall-back.patch \
-"
-
-SRC_URI[md5sum] = "cd6b568c2e9301cc3bfac09d87fbbc0b"
-SRC_URI[sha256sum] = "700d689c5622c87953c34102e5befafc4d3c811e676852238f0dd79c9c0c084d"
-
-# Only kernel-module-nfsd is required here (but can be built-in)  - the nfsd module will
-# pull in the remainder of the dependencies.
-
-INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
-INITSCRIPT_NAME = "nfsserver"
-INITSCRIPT_PARAMS = "defaults"
-INITSCRIPT_NAME_${PN}-client = "nfscommon"
-INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
-
-inherit autotools-brokensep update-rc.d systemd pkgconfig
-
-SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
-SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-# --enable-uuid is need for cross-compiling
-EXTRA_OECONF = "--with-statduser=rpcuser \
-                --enable-mountconfig \
-                --enable-libmount-mount \
-                --disable-nfsv41 \
-                --enable-uuid \
-                --disable-gss \
-                --disable-nfsdcltrack \
-                --with-statdpath=/var/lib/nfs/statd \
-               "
-
-PACKAGECONFIG ??= "tcp-wrappers \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-"
-PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
-PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
-PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
-
-INHIBIT_AUTO_STAGE = "1"
-
-PACKAGES =+ "${PN}-client ${PN}-stats"
-
-CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
-			   ${localstatedir}/lib/nfs/rmtab \
-			   ${localstatedir}/lib/nfs/xtab \
-			   ${localstatedir}/lib/nfs/statd/state \
-			   ${sysconfdir}/nfsmount.conf"
-
-FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \
-		      ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
-		      ${sbindir}/showmount ${sbindir}/nfsstat \
-		      ${localstatedir}/lib/nfs \
-		      ${sysconfdir}/nfs-utils.conf \
-		      ${sysconfdir}/nfsmount.conf \
-		      ${sysconfdir}/init.d/nfscommon \
-		      ${systemd_unitdir}/system/nfs-statd.service"
-FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
-RDEPENDS_${PN}-stats = "python3-core"
-
-FILES_${PN} += "${systemd_unitdir}"
-
-do_configure_prepend() {
-        sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
-            ${S}/utils/mount/Makefile.am
-
-        sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
-            ${S}/utils/osd_login/Makefile.am
-}
-
-# Make clean needed because the package comes with
-# precompiled 64-bit objects that break the build
-do_compile_prepend() {
-	make clean
-}
-
-do_install_append () {
-	install -d ${D}${sysconfdir}/init.d
-	install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
-	install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
-
-	install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
-	install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
-
-	install -d ${D}${systemd_unitdir}/system
-	install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
-	install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
-	install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
-	sed -i -e 's,@SBINDIR@,${sbindir},g' \
-		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
-		${D}${systemd_unitdir}/system/*.service
-	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-	    install -d ${D}${sysconfdir}/modules-load.d
-	    echo "nfsd" > ${D}${sysconfdir}/modules-load.d/nfsd.conf
-	    install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
-	    install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
-	    ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
-	fi
-
-	# kernel code as of 3.8 hard-codes this path as a default
-	install -d ${D}/var/lib/nfs/v4recovery
-
-	# chown the directories and files
-	chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
-	chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
-
-	# the following are built by CC_FOR_BUILD
-	rm -f ${D}${sbindir}/rpcdebug
-	rm -f ${D}${sbindir}/rpcgen
-	rm -f ${D}${sbindir}/locktest
-
-        # Make python tools use python 3
-        sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
-
-}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb
new file mode 100644
index 0000000..4ca9ab2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.4.bb
@@ -0,0 +1,148 @@
+SUMMARY = "userspace utilities for kernel nfs"
+DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \
+NFS server and related tools."
+HOMEPAGE = "http://nfs.sourceforge.net/"
+SECTION = "console/network"
+
+LICENSE = "MIT & GPLv2+ & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
+
+# util-linux for libblkid
+DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3 libtirpc"
+RDEPENDS_${PN} = "${PN}-client bash"
+RRECOMMENDS_${PN} = "kernel-module-nfsd"
+
+inherit useradd
+
+USERADD_PACKAGES = "${PN}-client"
+USERADD_PARAM_${PN}-client = "--system  --home-dir /var/lib/nfs \
+			      --shell /bin/false --user-group rpcuser"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
+           file://0001-configure-Allow-to-explicitly-disable-nfsidmap.patch \
+           file://nfs-utils-1.2.3-sm-notify-res_init.patch \
+           file://nfsserver \
+           file://nfscommon \
+           file://nfs-utils.conf \
+           file://nfs-server.service \
+           file://nfs-mountd.service \
+           file://nfs-statd.service \
+           file://proc-fs-nfsd.mount \
+           file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
+           file://nfs-utils-debianize-start-statd.patch \
+           file://bugfix-adjust-statd-service-name.patch \
+"
+
+SRC_URI[md5sum] = "54e4119043ec8507a2a0e054cf2889a4"
+SRC_URI[sha256sum] = "b42a5bc0a8d80d04650030ceb9a11f08f4acfbcb1ee297f657fb94e339c45975"
+
+# Only kernel-module-nfsd is required here (but can be built-in)  - the nfsd module will
+# pull in the remainder of the dependencies.
+
+INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
+INITSCRIPT_NAME = "nfsserver"
+INITSCRIPT_PARAMS = "defaults"
+INITSCRIPT_NAME_${PN}-client = "nfscommon"
+INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
+
+inherit autotools-brokensep update-rc.d systemd pkgconfig
+
+SYSTEMD_PACKAGES = "${PN} ${PN}-client"
+SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
+SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
+
+# --enable-uuid is need for cross-compiling
+EXTRA_OECONF = "--with-statduser=rpcuser \
+                --enable-mountconfig \
+                --enable-libmount-mount \
+                --disable-nfsv41 \
+                --enable-uuid \
+                --disable-gss \
+                --disable-nfsdcltrack \
+                --with-statdpath=/var/lib/nfs/statd \
+               "
+
+PACKAGECONFIG ??= "tcp-wrappers \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
+PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats"
+
+CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
+			   ${localstatedir}/lib/nfs/rmtab \
+			   ${localstatedir}/lib/nfs/xtab \
+			   ${localstatedir}/lib/nfs/statd/state \
+			   ${sysconfdir}/nfsmount.conf"
+
+FILES_${PN}-client = "${sbindir}/*statd \
+		      ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
+		      ${sbindir}/showmount ${sbindir}/nfsstat \
+		      ${localstatedir}/lib/nfs \
+		      ${sysconfdir}/nfs-utils.conf \
+		      ${sysconfdir}/nfsmount.conf \
+		      ${sysconfdir}/init.d/nfscommon \
+		      ${systemd_unitdir}/system/nfs-statd.service"
+RDEPENDS_${PN}-client = "${PN}-mount rpcbind"
+
+FILES_${PN}-mount = "${base_sbindir}/*mount.nfs*"
+
+FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
+RDEPENDS_${PN}-stats = "python3-core"
+
+FILES_${PN} += "${systemd_unitdir}"
+
+do_configure_prepend() {
+        sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
+            ${S}/utils/mount/Makefile.am
+
+        sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
+            ${S}/utils/osd_login/Makefile.am
+}
+
+# Make clean needed because the package comes with
+# precompiled 64-bit objects that break the build
+do_compile_prepend() {
+	make clean
+}
+
+do_install_append () {
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
+	install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
+
+	install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
+	install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
+	install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
+	install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
+	sed -i -e 's,@SBINDIR@,${sbindir},g' \
+		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
+		${D}${systemd_unitdir}/system/*.service
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+	    install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
+	    install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
+	    ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
+	fi
+
+	# kernel code as of 3.8 hard-codes this path as a default
+	install -d ${D}/var/lib/nfs/v4recovery
+
+	# chown the directories and files
+	chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
+	chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
+
+	# the following are built by CC_FOR_BUILD
+	rm -f ${D}${sbindir}/rpcdebug
+	rm -f ${D}${sbindir}/rpcgen
+	rm -f ${D}${sbindir}/locktest
+
+        # Make python tools use python 3
+        sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
+
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono.inc b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono.inc
index 9c47c6f..676a0c0 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono.inc
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono.inc
@@ -13,7 +13,7 @@
 INITSCRIPT_PARAMS = "defaults 22"
 
 PACKAGECONFIG ??= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
     "
 PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/,--with-systemdunitdir="
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_1.18.bb b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_1.18.bb
deleted file mode 100644
index b070731..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_1.18.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-require ofono.inc
-
-SRC_URI  = "\
-  ${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
-  file://ofono \
-"
-SRC_URI[md5sum] = "0a6b37c8ace891cb2a7ca5d121043a0a"
-SRC_URI[sha256sum] = "53cdbf342913f46bce4827241c60e24255a3d43a94945edf77482ae5b312d51f"
-
-CFLAGS_append_libc-uclibc = " -D_GNU_SOURCE"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_1.19.bb b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_1.19.bb
new file mode 100644
index 0000000..adebd71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_1.19.bb
@@ -0,0 +1,10 @@
+require ofono.inc
+
+SRC_URI  = "\
+  ${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
+  file://ofono \
+"
+SRC_URI[md5sum] = "a5f8803ace110511b6ff5a2b39782e8b"
+SRC_URI[sha256sum] = "a0e09bdd8b53b8d2e4b54f1863ecd9aebe4786477a6cbf8f655496e8edb31c81"
+
+CFLAGS_append_libc-uclibc = " -D_GNU_SOURCE"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/fix-CVE-2016-8858.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/fix-CVE-2016-8858.patch
deleted file mode 100644
index b26ee81..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/fix-CVE-2016-8858.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Fix CVE-2016-8858 of openssh
-
-Backport patch from upstream and drop the change of comment which can NOT be applied.
-
-Upstream-Status: Backport [ https://anongit.mindrot.org/openssh.git/commit/?id=ec165c3 ]
-CVE: CVE-2016-8858
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From ec165c392ca54317dbe3064a8c200de6531e89ad Mon Sep 17 00:00:00 2001
-From: "markus@openbsd.org" <markus@openbsd.org>
-Date: Mon, 10 Oct 2016 19:28:48 +0000
-Subject: [PATCH] upstream commit
-
-Unregister the KEXINIT handler after message has been
-received. Otherwise an unauthenticated peer can repeat the KEXINIT and cause
-allocation of up to 128MB -- until the connection is closed. Reported by
-shilei-c at 360.cn
-
-Upstream-ID: 43649ae12a27ef94290db16d1a98294588b75c05
----
- kex.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/kex.c b/kex.c
-index 3f97f8c..6a94bc5 100644
---- a/kex.c
-+++ b/kex.c
-@@ -481,6 +481,7 @@ kex_input_kexinit(int type, u_int32_t seq, void *ctxt)
- 	if (kex == NULL)
- 		return SSH_ERR_INVALID_ARGUMENT;
- 
-+	ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL);
- 	ptr = sshpkt_ptr(ssh, &dlen);
- 	if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0)
- 		return r;
--- 
-2.10.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/init b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/init
index 1f63725..34ba0f8 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/init
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/init
@@ -19,11 +19,6 @@
 [ -z "$SYSCONFDIR" ] && SYSCONFDIR=/etc/ssh
 mkdir -p $SYSCONFDIR
 
-HOST_KEY_RSA=$SYSCONFDIR/ssh_host_rsa_key
-HOST_KEY_DSA=$SYSCONFDIR/ssh_host_dsa_key
-HOST_KEY_ECDSA=$SYSCONFDIR/ssh_host_ecdsa_key
-HOST_KEY_ED25519=$SYSCONFDIR/ssh_host_ed25519_key
-
 check_for_no_start() {
     # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
     if [ -e $SYSCONFDIR/sshd_not_to_be_run ]; then
@@ -44,33 +39,13 @@
 	/usr/sbin/sshd -t $SSHD_OPTS || exit 1
 }
 
-check_keys() {
-	# create keys if necessary
-	if [ ! -f $HOST_KEY_RSA ]; then
-		echo "  generating ssh RSA key..."
-		ssh-keygen -q -f $HOST_KEY_RSA -N '' -t rsa
-	fi
-	if [ ! -f $HOST_KEY_ECDSA ]; then
-		echo "  generating ssh ECDSA key..."
-		ssh-keygen -q -f $HOST_KEY_ECDSA -N '' -t ecdsa
-	fi
-	if [ ! -f $HOST_KEY_DSA ]; then
-		echo "  generating ssh DSA key..."
-		ssh-keygen -q -f $HOST_KEY_DSA -N '' -t dsa
-	fi
-	if [ ! -f $HOST_KEY_ED25519 ]; then
-		echo "  generating ssh ED25519 key..."
-		ssh-keygen -q -f $HOST_KEY_ED25519 -N '' -t ed25519
-	fi
-}
-
 export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
 
 case "$1" in
   start)
 	check_for_no_start
 	echo "Starting OpenBSD Secure Shell server: sshd"
-	check_keys
+	@LIBEXECDIR@/sshd_check_keys
 	check_privsep_dir
 	start-stop-daemon -S -p $PIDFILE -x /usr/sbin/sshd -- $SSHD_OPTS
         echo "done."
@@ -83,7 +58,7 @@
 
   reload|force-reload)
 	check_for_no_start
-	check_keys
+	@LIBEXECDIR@/sshd_check_keys
 	check_config
         echo -n "Reloading OpenBSD Secure Shell server's configuration"
 	start-stop-daemon -K -p $PIDFILE -s 1 -x /usr/sbin/sshd
@@ -91,7 +66,7 @@
 	;;
 
   restart)
-  	check_keys
+	@LIBEXECDIR@/sshd_check_keys
 	check_config
         echo -n "Restarting OpenBSD Secure Shell server: sshd"
 	start-stop-daemon -K -p $PIDFILE --oknodo -x /usr/sbin/sshd
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/openssh-7.1p1-conditional-compile-des-in-cipher.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/openssh-7.1p1-conditional-compile-des-in-cipher.patch
index 2773c14..1098b97 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/openssh-7.1p1-conditional-compile-des-in-cipher.patch
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/openssh-7.1p1-conditional-compile-des-in-cipher.patch
@@ -1,18 +1,19 @@
-From d7eb26785ad4f25fb09fae46726ab8ca3fe16921 Mon Sep 17 00:00:00 2001
-From: Haiqing Bai <Haiqing.Bai@windriver.com>
-Date: Mon, 22 Aug 2016 14:11:16 +0300
-Subject: [PATCH] Remove des in cipher.
+From 27740c918fe5d78441bcf69e7d2eefb23ddeca4c Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 19 Jan 2017 03:00:08 -0500
+Subject: [PATCH 1/3] Remove des in cipher.
 
 Upstream-Status: Pending
 
 Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
 Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
 ---
  cipher.c | 18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
 
 diff --git a/cipher.c b/cipher.c
-index 031bda9..6cd667a 100644
+index 2def333..59f6792 100644
 --- a/cipher.c
 +++ b/cipher.c
 @@ -53,8 +53,10 @@
@@ -25,8 +26,8 @@
 +#endif /* OPENSSL_NO_DES */
  #endif
  
- struct sshcipher {
-@@ -79,15 +81,19 @@ struct sshcipher {
+ struct sshcipher_ctx {
+@@ -88,15 +90,19 @@ struct sshcipher {
  
  static const struct sshcipher ciphers[] = {
  #ifdef WITH_SSH1
@@ -39,14 +40,14 @@
  # endif /* OPENSSL_NO_BF */
  #endif /* WITH_SSH1 */
  #ifdef WITH_OPENSSL
- 	{ "none",	SSH_CIPHER_NONE, 8, 0, 0, 0, 0, 0, EVP_enc_null },
 +#ifndef OPENSSL_NO_DES
+ 	{ "none",	SSH_CIPHER_NONE, 8, 0, 0, 0, 0, 0, EVP_enc_null },
  	{ "3des-cbc",	SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc },
 +#endif /* OPENSSL_NO_DES */
  # ifndef OPENSSL_NO_BF
  	{ "blowfish-cbc",
  			SSH_CIPHER_SSH2, 8, 16, 0, 0, 0, 1, EVP_bf_cbc },
-@@ -171,8 +177,10 @@ cipher_keylen(const struct sshcipher *c)
+@@ -180,8 +186,10 @@ cipher_keylen(const struct sshcipher *c)
  u_int
  cipher_seclen(const struct sshcipher *c)
  {
@@ -57,7 +58,7 @@
  	return cipher_keylen(c);
  }
  
-@@ -209,11 +217,13 @@ u_int
+@@ -230,11 +238,13 @@ u_int
  cipher_mask_ssh1(int client)
  {
  	u_int mask = 0;
@@ -71,7 +72,7 @@
  	return mask;
  }
  
-@@ -553,7 +563,9 @@ cipher_get_keyiv(struct sshcipher_ctx *cc, u_char *iv, u_int len)
+@@ -606,7 +616,9 @@ cipher_get_keyiv(struct sshcipher_ctx *cc, u_char *iv, u_int len)
  	switch (c->number) {
  #ifdef WITH_OPENSSL
  	case SSH_CIPHER_SSH2:
@@ -79,20 +80,20 @@
  	case SSH_CIPHER_DES:
 +#endif /* OPENSSL_NO_DES */
  	case SSH_CIPHER_BLOWFISH:
- 		evplen = EVP_CIPHER_CTX_iv_length(&cc->evp);
+ 		evplen = EVP_CIPHER_CTX_iv_length(cc->evp);
  		if (evplen == 0)
-@@ -576,8 +588,10 @@ cipher_get_keyiv(struct sshcipher_ctx *cc, u_char *iv, u_int len)
+@@ -629,8 +641,10 @@ cipher_get_keyiv(struct sshcipher_ctx *cc, u_char *iv, u_int len)
  		break;
  #endif
  #ifdef WITH_SSH1
 +#ifndef OPENSSL_NO_DES
  	case SSH_CIPHER_3DES:
- 		return ssh1_3des_iv(&cc->evp, 0, iv, 24);
+ 		return ssh1_3des_iv(cc->evp, 0, iv, 24);
 +#endif /* OPENSSL_NO_DES */
  #endif
  	default:
  		return SSH_ERR_INVALID_ARGUMENT;
-@@ -601,7 +615,9 @@ cipher_set_keyiv(struct sshcipher_ctx *cc, const u_char *iv)
+@@ -654,7 +668,9 @@ cipher_set_keyiv(struct sshcipher_ctx *cc, const u_char *iv)
  	switch (c->number) {
  #ifdef WITH_OPENSSL
  	case SSH_CIPHER_SSH2:
@@ -100,19 +101,19 @@
  	case SSH_CIPHER_DES:
 +#endif /* OPENSSL_NO_DES */
  	case SSH_CIPHER_BLOWFISH:
- 		evplen = EVP_CIPHER_CTX_iv_length(&cc->evp);
+ 		evplen = EVP_CIPHER_CTX_iv_length(cc->evp);
  		if (evplen <= 0)
-@@ -616,8 +632,10 @@ cipher_set_keyiv(struct sshcipher_ctx *cc, const u_char *iv)
+@@ -675,8 +691,10 @@ cipher_set_keyiv(struct sshcipher_ctx *cc, const u_char *iv)
  		break;
  #endif
  #ifdef WITH_SSH1
 +#ifndef OPENSSL_NO_DES
  	case SSH_CIPHER_3DES:
- 		return ssh1_3des_iv(&cc->evp, 1, (u_char *)iv, 24);
+ 		return ssh1_3des_iv(cc->evp, 1, (u_char *)iv, 24);
 +#endif /* OPENSSL_NO_DES */
  #endif
  	default:
  		return SSH_ERR_INVALID_ARGUMENT;
 -- 
-2.1.4
+2.8.1
 
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/openssh-7.1p1-conditional-compile-des-in-pkcs11.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/openssh-7.1p1-conditional-compile-des-in-pkcs11.patch
index 815af42..47dc73b 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/openssh-7.1p1-conditional-compile-des-in-pkcs11.patch
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/openssh-7.1p1-conditional-compile-des-in-pkcs11.patch
@@ -1,12 +1,12 @@
-From 04cfd84423f693d879dc3ffebb0f6fe2680c254f Mon Sep 17 00:00:00 2001
-From: Haiqing Bai <Haiqing.Bai@windriver.com>
-Date: Fri, 18 Mar 2016 15:59:21 +0800
-Subject: [PATCH 3/3] remove des in pkcs11.
+From e816fc06e4f8070b09e677ead4d21768784e4c99 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 19 Jan 2017 03:21:40 -0500
+Subject: [PATCH 2/3] remove des in pkcs11.
 
 Upstream-Status: Pending
 
 Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
-
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
 ---
  pkcs11.h | 8 ++++++++
  1 file changed, 8 insertions(+)
@@ -66,5 +66,5 @@
  #define CKM_PBE_SHA1_RC2_40_CBC		(0x3ab)
  #define CKM_PKCS5_PBKD2			(0x3b0)
 -- 
-1.9.1
+2.8.1
 
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd_check_keys b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd_check_keys
new file mode 100644
index 0000000..f5bba53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd_check_keys
@@ -0,0 +1,64 @@
+#! /bin/sh
+
+# /etc/default/ssh may set SYSCONFDIR and SSHD_OPTS
+if test -f /etc/default/ssh; then
+    . /etc/default/ssh
+fi
+
+[ -z "$SYSCONFDIR" ] && SYSCONFDIR=/etc/ssh
+mkdir -p $SYSCONFDIR
+
+# parse sshd options
+set -- ${SSHD_OPTS} --
+sshd_config=/etc/ssh/sshd_config
+while true ; do
+    case "$1" in
+    -f*) if [ "$1" = "-f" ] ; then
+            sshd_config="$2"
+            shift
+        else
+            sshd_config="${1#-f}"
+        fi
+        shift
+        ;;
+    --) shift; break;;
+    *) shift;;
+    esac
+done
+
+# parse location of keys
+HOST_KEY_RSA=$(grep ^HostKey "${sshd_config}" | grep _rsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_RSA}" ] && HOST_KEY_RSA=$(grep HostKey "${sshd_config}" | grep _rsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_RSA}" ] && HOST_KEY_RSA=$SYSCONFDIR/ssh_host_rsa_key
+HOST_KEY_DSA=$(grep ^HostKey "${sshd_config}" | grep _dsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_DSA}" ] && HOST_KEY_DSA=$(grep HostKey "${sshd_config}" | grep _dsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_DSA}" ] && HOST_KEY_DSA=$SYSCONFDIR/ssh_host_dsa_key
+HOST_KEY_ECDSA=$(grep ^HostKey "${sshd_config}" | grep _ecdsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_ECDSA}" ] && HOST_KEY_ECDSA=$(grep HostKey "${sshd_config}" | grep _ecdsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_ECDSA}" ] && HOST_KEY_ECDSA=$SYSCONFDIR/ssh_host_ecdsa_key
+HOST_KEY_ED25519=$(grep ^HostKey "${sshd_config}" | grep _ed25519_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_ED25519}" ] && HOST_KEY_ED25519=$(grep HostKey "${sshd_config}" | grep _ed25519_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_ED25519}" ] && HOST_KEY_ED25519=$SYSCONFDIR/ssh_host_ed25519_key
+
+# create keys if necessary
+if [ ! -f $HOST_KEY_RSA ]; then
+    echo "  generating ssh RSA key..."
+    mkdir -p $(dirname $HOST_KEY_RSA)
+    ssh-keygen -q -f $HOST_KEY_RSA -N '' -t rsa
+fi
+if [ ! -f $HOST_KEY_ECDSA ]; then
+    echo "  generating ssh ECDSA key..."
+    mkdir -p $(dirname $HOST_KEY_ECDSA)
+    ssh-keygen -q -f $HOST_KEY_ECDSA -N '' -t ecdsa
+fi
+if [ ! -f $HOST_KEY_DSA ]; then
+    echo "  generating ssh DSA key..."
+    mkdir -p $(dirname $HOST_KEY_DSA)
+    ssh-keygen -q -f $HOST_KEY_DSA -N '' -t dsa
+fi
+if [ ! -f $HOST_KEY_ED25519 ]; then
+    echo "  generating ssh ED25519 key..."
+    mkdir -p $(dirname $HOST_KEY_ED25519)
+    ssh-keygen -q -f $HOST_KEY_ED25519 -N '' -t ed25519
+fi
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
index 148e6ad..603c337 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
@@ -1,22 +1,8 @@
 [Unit]
 Description=OpenSSH Key Generation
 RequiresMountsFor=/var /run
-ConditionPathExists=!/var/run/ssh/ssh_host_rsa_key
-ConditionPathExists=!/var/run/ssh/ssh_host_dsa_key
-ConditionPathExists=!/var/run/ssh/ssh_host_ecdsa_key
-ConditionPathExists=!/var/run/ssh/ssh_host_ed25519_key
-ConditionPathExists=!/etc/ssh/ssh_host_rsa_key
-ConditionPathExists=!/etc/ssh/ssh_host_dsa_key
-ConditionPathExists=!/etc/ssh/ssh_host_ecdsa_key
-ConditionPathExists=!/etc/ssh/ssh_host_ed25519_key
 
 [Service]
-Environment="SYSCONFDIR=/etc/ssh"
-EnvironmentFile=-/etc/default/ssh
-ExecStart=@BASE_BINDIR@/mkdir -p $SYSCONFDIR
-ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_rsa_key -N '' -t rsa
-ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_dsa_key -N '' -t dsa
-ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ecdsa_key -N '' -t ecdsa
-ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ed25519_key -N '' -t ed25519
+ExecStart=@LIBEXECDIR@/sshd_check_keys
 Type=oneshot
 RemainAfterExit=yes
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh_7.3p1.bb b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh_7.3p1.bb
deleted file mode 100644
index 94eb0ed..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh_7.3p1.bb
+++ /dev/null
@@ -1,165 +0,0 @@
-SUMMARY = "A suite of security-related network utilities based on \
-the SSH protocol including the ssh client and sshd server"
-DESCRIPTION = "Secure rlogin/rsh/rcp/telnet replacement (OpenSSH) \
-Ssh (Secure Shell) is a program for logging into a remote machine \
-and for executing commands on a remote machine."
-HOMEPAGE = "http://www.openssh.com/"
-SECTION = "console/network"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENCE;md5=e326045657e842541d3f35aada442507"
-
-DEPENDS = "zlib openssl"
-DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
-
-SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
-           file://sshd_config \
-           file://ssh_config \
-           file://init \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
-           file://sshd.socket \
-           file://sshd@.service \
-           file://sshdgenkeys.service \
-           file://volatiles.99_sshd \
-           file://add-test-support-for-busybox.patch \
-           file://run-ptest \
-           file://openssh-7.1p1-conditional-compile-des-in-cipher.patch \
-           file://openssh-7.1p1-conditional-compile-des-in-pkcs11.patch \
-           file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \
-           file://fix-CVE-2016-8858.patch \
-           "
-
-PAM_SRC_URI = "file://sshd"
-
-SRC_URI[md5sum] = "dfadd9f035d38ce5d58a3bf130b86d08"
-SRC_URI[sha256sum] = "3ffb989a6dcaa69594c3b550d4855a5a2e1718ccdde7f5e36387b424220fbecc"
-
-inherit useradd update-rc.d update-alternatives systemd
-
-USERADD_PACKAGES = "${PN}-sshd"
-USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
-INITSCRIPT_PACKAGES = "${PN}-sshd"
-INITSCRIPT_NAME_${PN}-sshd = "sshd"
-INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
-
-SYSTEMD_PACKAGES = "${PN}-sshd"
-SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket"
-
-inherit autotools-brokensep ptest
-
-# LFS support:
-CFLAGS += "-D__FILE_OFFSET_BITS=64"
-
-# login path is hardcoded in sshd
-EXTRA_OECONF = "'LOGIN_PROGRAM=${base_bindir}/login' \
-                ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
-                --without-zlib-version-check \
-                --with-privsep-path=/var/run/sshd \
-                --sysconfdir=${sysconfdir}/ssh \
-                --with-xauth=/usr/bin/xauth \
-                --disable-strip \
-                "
-
-# Since we do not depend on libbsd, we do not want configure to use it
-# just because it finds libutil.h.  But, specifying --disable-libutil
-# causes compile errors, so...
-CACHED_CONFIGUREVARS += "ac_cv_header_bsd_libutil_h=no ac_cv_header_libutil_h=no"
-
-# passwd path is hardcoded in sshd
-CACHED_CONFIGUREVARS += "ac_cv_path_PATH_PASSWD_PROG=${bindir}/passwd"
-
-# We don't want to depend on libblockfile
-CACHED_CONFIGUREVARS += "ac_cv_header_maillock_h=no"
-
-# This is a workaround for uclibc because including stdio.h
-# pulls in pthreads.h and causes conflicts in function prototypes.
-# This results in compilation failure, so unless this is fixed,
-# disable pam for uclibc.
-EXTRA_OECONF_append_libc-uclibc=" --without-pam"
-
-do_configure_prepend () {
-	export LD="${CC}"
-	install -m 0644 ${WORKDIR}/sshd_config ${B}/
-	install -m 0644 ${WORKDIR}/ssh_config ${B}/
-	if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
-		cp aclocal.m4 acinclude.m4
-	fi
-}
-
-do_compile_ptest() {
-        # skip regress/unittests/ binaries: this will silently skip
-        # unittests in run-ptests which is good because they are so slow.
-        oe_runmake regress/modpipe regress/setuid-allowed regress/netcat
-}
-
-do_install_append () {
-	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
-		install -D -m 0644 ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd
-		sed -i -e 's:#UsePAM no:UsePAM yes:' ${D}${sysconfdir}/ssh/sshd_config
-	fi
-
-	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" = "x11" ]; then
-		sed -i -e 's:#X11Forwarding no:X11Forwarding yes:' ${D}${sysconfdir}/ssh/sshd_config
-	fi
-
-	install -d ${D}${sysconfdir}/init.d
-	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
-	rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
-	rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
-	install -d ${D}/${sysconfdir}/default/volatiles
-	install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd
-	install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir}
-
-	# Create config files for read-only rootfs
-	install -d ${D}${sysconfdir}/ssh
-	install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
-	sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly
-	echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
-	echo "HostKey /var/run/ssh/ssh_host_dsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
-	echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
-	echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
-
-	install -d ${D}${systemd_unitdir}/system
-	install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system
-	install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_unitdir}/system
-	install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_unitdir}/system
-	sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
-		-e 's,@SBINDIR@,${sbindir},g' \
-		-e 's,@BINDIR@,${bindir},g' \
-		${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service
-}
-
-do_install_ptest () {
-	sed -i -e "s|^SFTPSERVER=.*|SFTPSERVER=${libexecdir}/sftp-server|" regress/test-exec.sh
-	cp -r regress ${D}${PTEST_PATH}
-}
-
-ALLOW_EMPTY_${PN} = "1"
-
-PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
-FILES_${PN}-scp = "${bindir}/scp.${BPN}"
-FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
-FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_unitdir}/system"
-FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd ${sysconfdir}/pam.d/sshd"
-FILES_${PN}-sftp = "${bindir}/sftp"
-FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
-FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"
-FILES_${PN}-keygen = "${bindir}/ssh-keygen"
-
-RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
-RDEPENDS_${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}"
-RDEPENDS_${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make"
-
-RPROVIDES_${PN}-ssh = "ssh"
-RPROVIDES_${PN}-sshd = "sshd"
-
-RCONFLICTS_${PN} = "dropbear"
-RCONFLICTS_${PN}-sshd = "dropbear"
-RCONFLICTS_${PN}-keygen = "ssh-keygen"
-
-CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
-CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"
-
-ALTERNATIVE_PRIORITY = "90"
-ALTERNATIVE_${PN}-scp = "scp"
-ALTERNATIVE_${PN}-ssh = "ssh"
-
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh_7.4p1.bb b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh_7.4p1.bb
new file mode 100644
index 0000000..e501ead
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh_7.4p1.bb
@@ -0,0 +1,172 @@
+SUMMARY = "A suite of security-related network utilities based on \
+the SSH protocol including the ssh client and sshd server"
+DESCRIPTION = "Secure rlogin/rsh/rcp/telnet replacement (OpenSSH) \
+Ssh (Secure Shell) is a program for logging into a remote machine \
+and for executing commands on a remote machine."
+HOMEPAGE = "http://www.openssh.com/"
+SECTION = "console/network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=e326045657e842541d3f35aada442507"
+
+DEPENDS = "zlib openssl"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
+           file://sshd_config \
+           file://ssh_config \
+           file://init \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+           file://sshd.socket \
+           file://sshd@.service \
+           file://sshdgenkeys.service \
+           file://volatiles.99_sshd \
+           file://add-test-support-for-busybox.patch \
+           file://run-ptest \
+           file://openssh-7.1p1-conditional-compile-des-in-cipher.patch \
+           file://openssh-7.1p1-conditional-compile-des-in-pkcs11.patch \
+           file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \
+           file://sshd_check_keys \
+           "
+
+PAM_SRC_URI = "file://sshd"
+
+SRC_URI[md5sum] = "b2db2a83caf66a208bb78d6d287cdaa3"
+SRC_URI[sha256sum] = "1b1fc4a14e2024293181924ed24872e6f2e06293f3e8926a376b8aec481f19d1"
+
+inherit useradd update-rc.d update-alternatives systemd
+
+USERADD_PACKAGES = "${PN}-sshd"
+USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
+INITSCRIPT_PACKAGES = "${PN}-sshd"
+INITSCRIPT_NAME_${PN}-sshd = "sshd"
+INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
+
+SYSTEMD_PACKAGES = "${PN}-sshd"
+SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket"
+
+inherit autotools-brokensep ptest
+
+# LFS support:
+CFLAGS += "-D__FILE_OFFSET_BITS=64"
+
+# login path is hardcoded in sshd
+EXTRA_OECONF = "'LOGIN_PROGRAM=${base_bindir}/login' \
+                ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
+                --without-zlib-version-check \
+                --with-privsep-path=/var/run/sshd \
+                --sysconfdir=${sysconfdir}/ssh \
+                --with-xauth=/usr/bin/xauth \
+                --disable-strip \
+                "
+
+# Since we do not depend on libbsd, we do not want configure to use it
+# just because it finds libutil.h.  But, specifying --disable-libutil
+# causes compile errors, so...
+CACHED_CONFIGUREVARS += "ac_cv_header_bsd_libutil_h=no ac_cv_header_libutil_h=no"
+
+# passwd path is hardcoded in sshd
+CACHED_CONFIGUREVARS += "ac_cv_path_PATH_PASSWD_PROG=${bindir}/passwd"
+
+# We don't want to depend on libblockfile
+CACHED_CONFIGUREVARS += "ac_cv_header_maillock_h=no"
+
+# This is a workaround for uclibc because including stdio.h
+# pulls in pthreads.h and causes conflicts in function prototypes.
+# This results in compilation failure, so unless this is fixed,
+# disable pam for uclibc.
+EXTRA_OECONF_append_libc-uclibc=" --without-pam"
+
+do_configure_prepend () {
+	export LD="${CC}"
+	install -m 0644 ${WORKDIR}/sshd_config ${B}/
+	install -m 0644 ${WORKDIR}/ssh_config ${B}/
+	if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
+		cp aclocal.m4 acinclude.m4
+	fi
+}
+
+do_compile_ptest() {
+        # skip regress/unittests/ binaries: this will silently skip
+        # unittests in run-ptests which is good because they are so slow.
+        oe_runmake regress/modpipe regress/setuid-allowed regress/netcat
+}
+
+do_install_append () {
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+		install -D -m 0644 ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd
+		sed -i -e 's:#UsePAM no:UsePAM yes:' ${D}${sysconfdir}/ssh/sshd_config
+	fi
+
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
+		sed -i -e 's:#X11Forwarding no:X11Forwarding yes:' ${D}${sysconfdir}/ssh/sshd_config
+	fi
+
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
+	rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
+	rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
+	install -d ${D}/${sysconfdir}/default/volatiles
+	install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd
+	install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir}
+
+	# Create config files for read-only rootfs
+	install -d ${D}${sysconfdir}/ssh
+	install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
+	sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly
+	echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+	echo "HostKey /var/run/ssh/ssh_host_dsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+	echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+	echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+
+	install -d ${D}${systemd_unitdir}/system
+	install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system
+	install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_unitdir}/system
+	install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+		-e 's,@SBINDIR@,${sbindir},g' \
+		-e 's,@BINDIR@,${bindir},g' \
+		-e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
+		${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service
+
+	sed -i -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
+		${D}${sysconfdir}/init.d/sshd
+
+	install -D -m 0755 ${WORKDIR}/sshd_check_keys ${D}${libexecdir}/${BPN}/sshd_check_keys
+}
+
+do_install_ptest () {
+	sed -i -e "s|^SFTPSERVER=.*|SFTPSERVER=${libexecdir}/sftp-server|" regress/test-exec.sh
+	cp -r regress ${D}${PTEST_PATH}
+}
+
+ALLOW_EMPTY_${PN} = "1"
+
+PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
+FILES_${PN}-scp = "${bindir}/scp.${BPN}"
+FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
+FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_unitdir}/system"
+FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd ${sysconfdir}/pam.d/sshd"
+FILES_${PN}-sshd += "${libexecdir}/${BPN}/sshd_check_keys"
+FILES_${PN}-sftp = "${bindir}/sftp"
+FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
+FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"
+FILES_${PN}-keygen = "${bindir}/ssh-keygen"
+
+RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
+RDEPENDS_${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}"
+RDEPENDS_${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make"
+
+RPROVIDES_${PN}-ssh = "ssh"
+RPROVIDES_${PN}-sshd = "sshd"
+
+RCONFLICTS_${PN} = "dropbear"
+RCONFLICTS_${PN}-sshd = "dropbear"
+RCONFLICTS_${PN}-keygen = "ssh-keygen"
+
+CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
+CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"
+
+ALTERNATIVE_PRIORITY = "90"
+ALTERNATIVE_${PN}-scp = "scp"
+ALTERNATIVE_${PN}-ssh = "ssh"
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl.inc b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl.inc
index 2ef8b38..8f2a797 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl.inc
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl.inc
@@ -17,7 +17,6 @@
 
 PACKAGECONFIG[perl] = ",,,"
 
-AR_append = " r"
 TERMIO_libc-musl = "-DTERMIOS"
 TERMIO ?= "-DTERMIO"
 # Avoid binaries being marked as requiring an executable stack since it 
@@ -28,16 +27,17 @@
 export DIRS = "crypto ssl apps"
 export EX_LIBS = "-lgcc -ldl"
 export AS = "${CC} -c"
-EXTRA_OEMAKE = "-e MAKEFLAGS="
 
-inherit pkgconfig siteinfo multilib_header ptest
+inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
 
 PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf"
 FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
 FILES_libssl = "${libdir}/libssl${SOLIBS}"
 FILES_${PN} =+ " ${libdir}/ssl/*"
 FILES_${PN}-misc = "${libdir}/ssl/misc"
-RDEPENDS_${PN}-misc = "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}"
+RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}"
+
+PROVIDES += "openssl10"
 
 # Add the openssl.cnf file to the openssl-conf package.  Make the libcrypto
 # package RRECOMMENDS on this package.  This will enable the configuration
@@ -84,7 +84,7 @@
 		target=linux-elf-armeb
 		;;
 	linux-aarch64*)
-		target=linux-generic64
+		target=linux-aarch64
 		;;
 	linux-sh3)
 		target=debian-sh3
@@ -185,7 +185,7 @@
 	sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
 
 	oe_multilib_header openssl/opensslconf.h
-	if [ "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" = "perl" ]; then
+	if [ "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}" ]; then
 		sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl
 		sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget
 	else
@@ -206,6 +206,10 @@
 
 do_install_ptest () {
 	cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH}
+
+        # Replace the path to native perl with the path to target perl
+        sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile
+
 	cp Configure config e_os.h ${D}${PTEST_PATH}
 	cp -r -L include ${D}${PTEST_PATH}
 	ln -sf ${libdir}/libcrypto.a ${D}${PTEST_PATH}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/0001-CVE-2017-3731.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/0001-CVE-2017-3731.patch
deleted file mode 100644
index 04ef526..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/0001-CVE-2017-3731.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 0cde9a9645c949fd0acf657dadc747676245cfaf Mon Sep 17 00:00:00 2001
-From: Alexandru Moise <alexandru.moise@windriver.com>
-Date: Tue, 7 Feb 2017 11:13:19 +0200
-Subject: [PATCH 1/2] crypto/evp: harden RC4_MD5 cipher.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Originally a crash in 32-bit build was reported CHACHA20-POLY1305
-cipher. The crash is triggered by truncated packet and is result
-of excessive hashing to the edge of accessible memory (or bogus
-MAC value is produced if x86 MD5 assembly module is involved). Since
-hash operation is read-only it is not considered to be exploitable
-beyond a DoS condition.
-
-Thanks to Robert Święcki for report.
-
-CVE-2017-3731
-
-Backported from upstream commit:
-8e20499629b6bcf868d0072c7011e590b5c2294d
-
-Upstream-Status: Backport
-
-Reviewed-by: Rich Salz <rsalz@openssl.org>
-Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com>
----
- crypto/evp/e_rc4_hmac_md5.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/crypto/evp/e_rc4_hmac_md5.c b/crypto/evp/e_rc4_hmac_md5.c
-index 5e92855..3293419 100644
---- a/crypto/evp/e_rc4_hmac_md5.c
-+++ b/crypto/evp/e_rc4_hmac_md5.c
-@@ -269,6 +269,8 @@ static int rc4_hmac_md5_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
-             len = p[arg - 2] << 8 | p[arg - 1];
- 
-             if (!ctx->encrypt) {
-+		if (len < MD5_DIGEST_LENGTH)
-+                    return -1;
-                 len -= MD5_DIGEST_LENGTH;
-                 p[arg - 2] = len >> 8;
-                 p[arg - 1] = len;
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/0001-Fix-build-with-clang-using-external-assembler.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/0001-Fix-build-with-clang-using-external-assembler.patch
new file mode 100644
index 0000000..2270962
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/0001-Fix-build-with-clang-using-external-assembler.patch
@@ -0,0 +1,45 @@
+From 2f6026cb8b16cf00726e3c5625c023f196680f07 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 17 Mar 2017 12:52:08 -0700
+Subject: [PATCH] Fix build with clang using external assembler
+
+Cherry-picked from
+https://github.com/openssl/openssl/commit/11208dcfb9105e8afa37233185decefd45e89e17
+https://github.com/openssl/openssl/commit/fbab8baddef8d3346ae40ff068871e2ddaf10270
+https://github.com/openssl/openssl/commit/6cf412c473d8145562b76219ce3da73b201b3255
+
+Fixes
+
+| ghash-armv4.S: Assembler messages:
+| ghash-armv4.S:81: Error: bad instruction `ldrbpl r12,[r2,r3]'
+| ghash-armv4.S:91: Error: bad instruction `ldrbpl r8,[r0,r3]'
+| ghash-armv4.S:137: Error: bad instruction `ldrbne r12,[r2,#15]'
+| ghash-armv4.S:224: Error: bad instruction `ldrbpl r12,[r0,r3]'
+| clang-4.0: error: assembler command failed with exit code 1 (use -v to see invocation)
+| make[2]: *** [<builtin>: ghash-armv4.o] Error 1
+
+Upstream-Status: Backport
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ crypto/modes/asm/ghash-armv4.pl | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/crypto/modes/asm/ghash-armv4.pl b/crypto/modes/asm/ghash-armv4.pl
+index 8ccc963ef..442fed4da 100644
+--- a/crypto/modes/asm/ghash-armv4.pl
++++ b/crypto/modes/asm/ghash-armv4.pl
+@@ -124,7 +124,10 @@ $code=<<___;
+ #include "arm_arch.h"
+ 
+ .text
++#if defined(__thumb2__) || defined(__clang__)
++.syntax	unified
++#endif
+ .code	32
+ 
+ #ifdef __clang__
+ #define ldrplb	ldrbpl
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/0002-CVE-2017-3731.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/0002-CVE-2017-3731.patch
deleted file mode 100644
index b56b2d5..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/0002-CVE-2017-3731.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 6427f1accc54b515bb899370f1a662bfcb1caa52 Mon Sep 17 00:00:00 2001
-From: Alexandru Moise <alexandru.moise@windriver.com>
-Date: Tue, 7 Feb 2017 11:16:13 +0200
-Subject: [PATCH 2/2] crypto/evp: harden AEAD ciphers.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Originally a crash in 32-bit build was reported CHACHA20-POLY1305
-cipher. The crash is triggered by truncated packet and is result
-of excessive hashing to the edge of accessible memory. Since hash
-operation is read-only it is not considered to be exploitable
-beyond a DoS condition. Other ciphers were hardened.
-
-Thanks to Robert Święcki for report.
-
-CVE-2017-3731
-
-Backported from upstream commit:
-2198b3a55de681e1f3c23edb0586afe13f438051
-
-Upstream-Status: Backport
-
-Reviewed-by: Rich Salz <rsalz@openssl.org>
-Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com>
----
- crypto/evp/e_aes.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
-index 1734a82..16dcd10 100644
---- a/crypto/evp/e_aes.c
-+++ b/crypto/evp/e_aes.c
-@@ -1235,10 +1235,15 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
-         {
-             unsigned int len = c->buf[arg - 2] << 8 | c->buf[arg - 1];
-             /* Correct length for explicit IV */
-+	    if (len < EVP_GCM_TLS_EXPLICIT_IV_LEN)
-+	        return 0;
-             len -= EVP_GCM_TLS_EXPLICIT_IV_LEN;
-             /* If decrypting correct for tag too */
--            if (!c->encrypt)
-+            if (!c->encrypt) {
-+		if (len < EVP_GCM_TLS_TAG_LEN)
-+		    return 0;
-                 len -= EVP_GCM_TLS_TAG_LEN;
-+	    }
-             c->buf[arg - 2] = len >> 8;
-             c->buf[arg - 1] = len & 0xff;
-         }
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/CVE-2016-7055.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/CVE-2016-7055.patch
deleted file mode 100644
index 83a74cd..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/CVE-2016-7055.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 57c4b9f6a2f800b41ce2836986fe33640f6c3f8a Mon Sep 17 00:00:00 2001
-From: Andy Polyakov <appro@openssl.org>
-Date: Sun, 6 Nov 2016 18:33:17 +0100
-Subject: [PATCH] bn/asm/x86_64-mont.pl: fix for CVE-2016-7055 (Low severity).
-
-Reviewed-by: Rich Salz <rsalz@openssl.org>
-(cherry picked from commit 2fac86d9abeaa643677d1ffd0a139239fdf9406a)
-
-Upstream-Status: Backport [https://github.com/openssl/openssl/commit/57c4b9f6a2f800b41ce2836986fe33640f6c3f8a]
-CVE: CVE-2016-7055
-Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
----
- crypto/bn/asm/x86_64-mont.pl | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/crypto/bn/asm/x86_64-mont.pl b/crypto/bn/asm/x86_64-mont.pl
-index 044fd7e..80492d8 100755
---- a/crypto/bn/asm/x86_64-mont.pl
-+++ b/crypto/bn/asm/x86_64-mont.pl
-@@ -1148,18 +1148,17 @@ $code.=<<___;
- 	mulx	2*8($aptr),%r15,%r13	# ...
- 	adox	-3*8($tptr),%r11
- 	adcx	%r15,%r12
--	adox	$zero,%r12
-+	adox	-2*8($tptr),%r12
- 	adcx	$zero,%r13
-+	adox	$zero,%r13
- 
- 	mov	$bptr,8(%rsp)		# off-load &b[i]
--	.byte	0x67
- 	mov	$mi,%r15
- 	imulq	24(%rsp),$mi		# "t[0]"*n0
- 	xor	%ebp,%ebp		# xor	$zero,$zero	# cf=0, of=0
- 
- 	mulx	3*8($aptr),%rax,%r14
- 	 mov	$mi,%rdx
--	adox	-2*8($tptr),%r12
- 	adcx	%rax,%r13
- 	adox	-1*8($tptr),%r13
- 	adcx	$zero,%r14
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/soname.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/soname.patch
new file mode 100644
index 0000000..f9cdfec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/soname.patch
@@ -0,0 +1,13 @@
+Index: openssl-1.0.2d/crypto/opensslv.h
+===================================================================
+--- openssl-1.0.2d.orig/crypto/opensslv.h
++++ openssl-1.0.2d/crypto/opensslv.h
+@@ -88,7 +88,7 @@ extern "C" {
+  * should only keep the versions that are binary compatible with the current.
+  */
+ # define SHLIB_VERSION_HISTORY ""
+-# define SHLIB_VERSION_NUMBER "1.0.0"
++# define SHLIB_VERSION_NUMBER "1.0.2"
+ 
+ 
+ #ifdef  __cplusplus
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl_1.0.2j.bb b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl_1.0.2j.bb
deleted file mode 100644
index b6fb126..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl_1.0.2j.bb
+++ /dev/null
@@ -1,62 +0,0 @@
-require openssl.inc
-
-# For target side versions of openssl enable support for OCF Linux driver
-# if they are available.
-DEPENDS += "cryptodev-linux"
-
-CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
-CFLAG_append_class-native = " -fPIC"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=27ffa5d74bb5a337056c14b2ef93fbf6"
-
-export DIRS = "crypto ssl apps engines"
-export OE_LDFLAGS="${LDFLAGS}"
-
-SRC_URI += "file://find.pl;subdir=${BP}/util/ \
-            file://run-ptest \
-            file://openssl-c_rehash.sh \
-            file://configure-targets.patch \
-            file://shared-libs.patch \
-            file://oe-ldflags.patch \
-            file://engines-install-in-libdir-ssl.patch \
-            file://debian1.0.2/block_diginotar.patch \
-            file://debian1.0.2/block_digicert_malaysia.patch \
-            file://debian/ca.patch \
-            file://debian/c_rehash-compat.patch \
-            file://debian/debian-targets.patch \
-            file://debian/man-dir.patch \
-            file://debian/man-section.patch \
-            file://debian/no-rpath.patch \
-            file://debian/no-symbolic.patch \
-            file://debian/pic.patch \
-            file://debian1.0.2/version-script.patch \
-            file://openssl_fix_for_x32.patch \
-            file://fix-cipher-des-ede3-cfb1.patch \
-            file://openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch \
-            file://openssl-fix-des.pod-error.patch \
-            file://Makefiles-ptest.patch \
-            file://ptest-deps.patch \
-            file://openssl-1.0.2a-x32-asm.patch \
-            file://ptest_makefile_deps.patch  \
-            file://configure-musl-target.patch \
-            file://parallel.patch \
-            file://openssl-util-perlpath.pl-cwd.patch \
-            file://CVE-2016-7055.patch \
-            file://0001-CVE-2017-3731.patch \
-            file://0002-CVE-2017-3731.patch \
-           "
-SRC_URI[md5sum] = "96322138f0b69e61b7212bc53d5e912b"
-SRC_URI[sha256sum] = "e7aff292be21c259c6af26469c7a9b3ba26e9abaaffd325e3dccc9785256c431"
-
-PACKAGES =+ "${PN}-engines"
-FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines"
-
-# The crypto_use_bigint patch means that perl's bignum module needs to be
-# installed, but some distributions (for example Fedora 23) don't ship it by
-# default.  As the resulting error is very misleading check for bignum before
-# building.
-do_configure_prepend() {
-	if ! perl -Mbigint -e true; then
-		bbfatal "The perl module 'bignum' was not found but this is required to build openssl.  Please install this module (often packaged as perl-bignum) and re-run bitbake."
-	fi
-}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl_1.0.2k.bb b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl_1.0.2k.bb
new file mode 100644
index 0000000..83d1a50
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl_1.0.2k.bb
@@ -0,0 +1,62 @@
+require openssl.inc
+
+# For target side versions of openssl enable support for OCF Linux driver
+# if they are available.
+DEPENDS += "cryptodev-linux"
+
+CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
+CFLAG_append_class-native = " -fPIC"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=27ffa5d74bb5a337056c14b2ef93fbf6"
+
+export DIRS = "crypto ssl apps engines"
+export OE_LDFLAGS="${LDFLAGS}"
+
+SRC_URI += "file://find.pl;subdir=${BP}/util/ \
+            file://run-ptest \
+            file://openssl-c_rehash.sh \
+            file://configure-targets.patch \
+            file://shared-libs.patch \
+            file://oe-ldflags.patch \
+            file://engines-install-in-libdir-ssl.patch \
+            file://debian1.0.2/block_diginotar.patch \
+            file://debian1.0.2/block_digicert_malaysia.patch \
+            file://debian/ca.patch \
+            file://debian/c_rehash-compat.patch \
+            file://debian/debian-targets.patch \
+            file://debian/man-dir.patch \
+            file://debian/man-section.patch \
+            file://debian/no-rpath.patch \
+            file://debian/no-symbolic.patch \
+            file://debian/pic.patch \
+            file://debian1.0.2/version-script.patch \
+            file://debian1.0.2/soname.patch \
+            file://openssl_fix_for_x32.patch \
+            file://fix-cipher-des-ede3-cfb1.patch \
+            file://openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch \
+            file://openssl-fix-des.pod-error.patch \
+            file://Makefiles-ptest.patch \
+            file://ptest-deps.patch \
+            file://openssl-1.0.2a-x32-asm.patch \
+            file://ptest_makefile_deps.patch \
+            file://configure-musl-target.patch \
+            file://parallel.patch \
+            file://openssl-util-perlpath.pl-cwd.patch \
+            file://Use-SHA256-not-MD5-as-default-digest.patch \
+            file://0001-Fix-build-with-clang-using-external-assembler.patch \
+            "
+SRC_URI[md5sum] = "f965fc0bf01bf882b31314b61391ae65"
+SRC_URI[sha256sum] = "6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0"
+
+PACKAGES =+ "${PN}-engines"
+FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines"
+
+# The crypto_use_bigint patch means that perl's bignum module needs to be
+# installed, but some distributions (for example Fedora 23) don't ship it by
+# default.  As the resulting error is very misleading check for bignum before
+# building.
+do_configure_prepend() {
+	if ! perl -Mbigint -e true; then
+		bbfatal "The perl module 'bignum' was not found but this is required to build openssl.  Please install this module (often packaged as perl-bignum) and re-run bitbake."
+	fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap_6.0.bb b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap_6.0.bb
index 999b4a9..d970095 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap_6.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap_6.0.bb
@@ -4,7 +4,7 @@
 
 PR = "r9"
 
-SRC_URI = "http://www.sourcefiles.org/Networking/Tools/Miscellanenous/portmap-6.0.tgz \
+SRC_URI = "https://fossies.org/linux/misc/old/portmap-6.0.tgz \
            file://destdir-no-strip.patch \
            file://tcpd-config.patch \
            file://portmap.init \
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb b/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb
index 51a76b4..b5f6895 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb
@@ -4,8 +4,7 @@
 RDEPENDS_${PN} = "ppp"
 PR = "r8"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 SRC_URI = "file://host-peer \
            file://ppp-dialin"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch
index 8aa2d2e..ea4969b 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch
@@ -3,34 +3,14 @@
 Date: Tue, 5 Nov 2013 17:32:56 +0800
 Subject: [PATCH] ppp: Fix compilation errors in Makefile
 
-This patch fixes below issues:
-
-1. Make can't exit while compilation error occurs in subdir for plugins building.
-
-2. If build ppp with newer kernel (3.10.10), it will pick 'if_pppox.h' from sysroot-dir and
-   'if_pppol2tp.h' from its own source dir, this cause below build errors:
-
-        bitbake_build/tmp/sysroots/intel-x86-64/usr/include/linux/if_pppox.h:84:26:
-        error: field 'pppol2tp' has incomplete type
-          struct pppol2tpin6_addr pppol2tp;
-                                  ^
-        bitbake_build/tmp/sysroots/intel-x86-64/usr/include/linux/if_pppox.h:99:28:
-        error: field 'pppol2tp' has incomplete type
-          struct pppol2tpv3in6_addr pppol2tp;
-                                    ^
-
-The 'sysroot-dir/if_pppox.h' enabled ipv6 support but the 'source-dir/if_pppol2tp.h' lost
-related structure definitions, we should use both header files from sysroots to fix this
-build failure.
+Make can't exit while compilation error occurs in subdir for plugins building.
 
 Upstream-Status: Pending
 
 Signed-off-by: Lu Chong <Chong.Lu@windriver.com>
 ---
- pppd/plugins/Makefile.linux          |    2 +-
- pppd/plugins/pppol2tp/Makefile.linux |    2 +-
- pppd/plugins/rp-pppoe/Makefile.linux |    2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
+ pppd/plugins/Makefile.linux          |    1 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
 index 0a7ec7b..2a2c15a 100644
@@ -45,31 +25,6 @@
  
  %.so: %.c
  	$(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
-diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux
-index 19eff67..feb2f52 100644
---- a/pppd/plugins/pppol2tp/Makefile.linux
-+++ b/pppd/plugins/pppol2tp/Makefile.linux
-@@ -1,6 +1,6 @@
- #CC	= gcc
- COPTS	= -O2 -g
--CFLAGS	= $(COPTS) -I. -I../.. -I../../../include -fPIC
-+CFLAGS	= $(COPTS) -I. -I../.. -fPIC
- LDFLAGS	= -shared
- INSTALL	= install
- 
-diff --git a/pppd/plugins/rp-pppoe/Makefile.linux b/pppd/plugins/rp-pppoe/Makefile.linux
-index f078991..15b9118 100644
---- a/pppd/plugins/rp-pppoe/Makefile.linux
-+++ b/pppd/plugins/rp-pppoe/Makefile.linux
-@@ -26,7 +26,7 @@ INSTALL	= install
- RP_VERSION=3.8p
- 
- COPTS=-O2 -g
--CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"'
-+CFLAGS=$(COPTS) '-DRP_VERSION="$(RP_VERSION)"'
- all: rp-pppoe.so pppoe-discovery
- 
- pppoe-discovery: pppoe-discovery.o debug.o
 -- 
 1.7.9.5
 
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Remove-unneeded-include.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Remove-unneeded-include.patch
new file mode 100644
index 0000000..a32f89f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Remove-unneeded-include.patch
@@ -0,0 +1,43 @@
+commit cd90fd147844a0cfec101f1e2db7a3c59d236621
+Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date:   Wed Dec 28 14:11:22 2016 +0200
+
+pppol2tp plugin: Remove unneeded include
+
+The include is not required and will break compile on musl libc with
+    
+| In file included from pppol2tp.c:34:0:
+| /usr/include/linux/if.h:97:2: error: expected identifier before numeric constant
+|   IFF_LOWER_UP   = 1<<16, /* __volatile__ */
+
+Patch originally from Khem Raj.
+
+Upstream-Status: Pending [https://github.com/paulusmack/ppp/issues/73]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+diff --git a/pppd/plugins/pppol2tp/openl2tp.c b/pppd/plugins/pppol2tp/openl2tp.c
+index 9643b96..458316b 100644
+--- a/pppd/plugins/pppol2tp/openl2tp.c
++++ b/pppd/plugins/pppol2tp/openl2tp.c
+@@ -47,7 +47,6 @@
+ #include <linux/if_ether.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_ppp.h>
+-#include <linux/if_pppox.h>
+ #include <linux/if_pppol2tp.h>
+ 
+ #include "l2tp_event.h"
+diff --git a/pppd/plugins/pppol2tp/pppol2tp.c b/pppd/plugins/pppol2tp/pppol2tp.c
+index 0e28606..4f6d98c 100644
+--- a/pppd/plugins/pppol2tp/pppol2tp.c
++++ b/pppd/plugins/pppol2tp/pppol2tp.c
+@@ -46,7 +46,6 @@
+ #include <linux/if_ether.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_ppp.h>
+-#include <linux/if_pppox.h>
+ #include <linux/if_pppol2tp.h>
+ 
+ /* should be added to system's socket.h... */
+---
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
index 56dbd98..b2c4d4c 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
@@ -11,7 +11,7 @@
                     file://pppd/tdb.c;beginline=1;endline=27;md5=4ca3a9991b011038d085d6675ae7c4e6 \
                     file://chat/chat.c;beginline=1;endline=15;md5=0d374b8545ee5c62d7aff1acbd38add2"
 
-SRC_URI = "http://ppp.samba.org/ftp/ppp/ppp-${PV}.tar.gz \
+SRC_URI = "https://download.samba.org/pub/${BPN}/${BP}.tar.gz \
            file://makefile.patch \
            file://cifdefroute.patch \
            file://pppd-resolv-varrun.patch \
@@ -31,6 +31,7 @@
            file://ppp@.service \
            file://fix-CVE-2015-3310.patch \
            file://ppp-fix-building-with-linux-4.8.patch \
+           file://0001-ppp-Remove-unneeded-include.patch \
 "
 
 SRC_URI_append_libc-musl = "\
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat_1.7.3.1.bb b/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat_1.7.3.1.bb
deleted file mode 100644
index 4da6d39..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat_1.7.3.1.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-SUMMARY = "Multipurpose relay for bidirectional data transfer"
-DESCRIPTION = "Socat is a relay for bidirectional data \
-transfer between two independent data channels."
-HOMEPAGE = "http://www.dest-unreach.org/socat/"
-
-SECTION = "console/network"
-
-DEPENDS = "openssl readline"
-
-LICENSE = "GPL-2.0+-with-OpenSSL-exception"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://README;beginline=257;endline=287;md5=338c05eadd013872abb1d6e198e10a3f"
-
-
-SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \
-           file://Makefile.in-fix-for-parallel-build.patch \
-           file://0001-define-NETDB_INTERNAL-to-1-if-not-available.patch \
-           file://0001-Access-c_ispeed-and-c_ospeed-via-APIs.patch \
-"
-
-SRC_URI[md5sum] = "334e46924f2b386299c9db2ac22bcd36"
-SRC_URI[sha256sum] = "d2da659540c38139f388e9437bfaae16bb458d174d056cb3228432a8f489fbaa"
-
-inherit autotools
-
-EXTRA_AUTORECONF += "--exclude=autoheader"
-
-EXTRA_OECONF += "ac_cv_have_z_modifier=yes \
-        ac_cv_header_bsd_libutil_h=no \
-"
-
-PACKAGECONFIG ??= "tcp-wrappers"
-PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
-
-do_install_prepend () {
-    mkdir -p ${D}${bindir}
-    install -d ${D}${bindir} ${D}${mandir}/man1
-}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat_1.7.3.2.bb b/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat_1.7.3.2.bb
new file mode 100644
index 0000000..4dcb7b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat_1.7.3.2.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Multipurpose relay for bidirectional data transfer"
+DESCRIPTION = "Socat is a relay for bidirectional data \
+transfer between two independent data channels."
+HOMEPAGE = "http://www.dest-unreach.org/socat/"
+
+SECTION = "console/network"
+
+DEPENDS = "openssl readline"
+
+LICENSE = "GPL-2.0+-with-OpenSSL-exception"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://README;beginline=257;endline=287;md5=338c05eadd013872abb1d6e198e10a3f"
+
+
+SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \
+           file://Makefile.in-fix-for-parallel-build.patch \
+           file://0001-define-NETDB_INTERNAL-to-1-if-not-available.patch \
+           file://0001-Access-c_ispeed-and-c_ospeed-via-APIs.patch \
+"
+
+SRC_URI[md5sum] = "607a24c15bd2cb54e9328bfbbd3a1ae9"
+SRC_URI[sha256sum] = "e3561f808739383eb10fada1e5d4f26883f0311b34fd0af7837d0c95ef379251"
+
+inherit autotools
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+EXTRA_OECONF += "ac_cv_have_z_modifier=yes \
+        ac_cv_header_bsd_libutil_h=no \
+"
+
+PACKAGECONFIG_class-target ??= "tcp-wrappers"
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+
+do_install_prepend () {
+    mkdir -p ${D}${bindir}
+    install -d ${D}${bindir} ${D}${mandir}/man1
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb b/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb
index c3b8f66..0a34207 100644
--- a/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb
@@ -1,5 +1,5 @@
 SUMMARY = "Tools for the Linux Standard Wireless Extension Subsystem"
-HOMEPAGE = "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html"
+HOMEPAGE = "https://hewlettpackard.github.io/wireless-tools/Tools.html"
 LICENSE = "GPLv2 & (LGPLv2.1 | MPL-1.1 | BSD)"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
 			file://iwconfig.c;beginline=1;endline=12;md5=cf710eb1795c376eb10ea4ff04649caf \
@@ -8,7 +8,7 @@
 SECTION = "base"
 PE = "1"
 
-SRC_URI = "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools.${PV}.tar.gz \
+SRC_URI = "https://hewlettpackard.github.io/wireless-tools/wireless_tools.${PV}.tar.gz \
            file://remove.ldconfig.call.patch \
            file://man.patch \
            file://avoid_strip.patch \
@@ -17,7 +17,7 @@
 SRC_URI[md5sum] = "ca91ba7c7eff9bfff6926b1a34a4697d"
 SRC_URI[sha256sum] = "abd9c5c98abf1fdd11892ac2f8a56737544fe101e1be27c6241a564948f34c63"
 
-UPSTREAM_CHECK_URI = "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html"
+UPSTREAM_CHECK_URI = "https://hewlettpackard.github.io/wireless-tools/Tools.html"
 UPSTREAM_CHECK_REGEX = "wireless_tools\.(?P<pver>(\d+)(\..*|))\.tar\.gz"
 
 S = "${WORKDIR}/wireless_tools.30"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-Reject-psk-parameter-set-with-invalid-passphrase-cha.patch b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-Reject-psk-parameter-set-with-invalid-passphrase-cha.patch
deleted file mode 100644
index dd7d5f7..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-Reject-psk-parameter-set-with-invalid-passphrase-cha.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 73e4abb24a936014727924d8b0b2965edfc117dd Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni@qca.qualcomm.com>
-Date: Fri, 4 Mar 2016 18:46:41 +0200
-Subject: [PATCH 1/3] Reject psk parameter set with invalid passphrase
- character
-
-WPA/WPA2-Personal passphrase is not allowed to include control
-characters. Reject a passphrase configuration attempt if that passphrase
-includes an invalid passphrase.
-
-This fixes an issue where wpa_supplicant could have updated the
-configuration file psk parameter with arbitrary data from the control
-interface or D-Bus interface. While those interfaces are supposed to be
-accessible only for trusted users/applications, it may be possible that
-an untrusted user has access to a management software component that
-does not validate the passphrase value before passing it to
-wpa_supplicant.
-
-This could allow such an untrusted user to inject up to 63 characters of
-almost arbitrary data into the configuration file. Such configuration
-file could result in wpa_supplicant trying to load a library (e.g.,
-opensc_engine_path, pkcs11_engine_path, pkcs11_module_path,
-load_dynamic_eap) from user controlled location when starting again.
-This would allow code from that library to be executed under the
-wpa_supplicant process privileges.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4477
-
-Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi@windriver.com>
----
- wpa_supplicant/config.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index b1c7870..fdd9643 100644
---- a/wpa_supplicant/config.c
-+++ b/wpa_supplicant/config.c
-@@ -478,6 +478,12 @@ static int wpa_config_parse_psk(const struct parse_data *data,
- 		}
- 		wpa_hexdump_ascii_key(MSG_MSGDUMP, "PSK (ASCII passphrase)",
- 				      (u8 *) value, len);
-+		if (has_ctrl_char((u8 *) value, len)) {
-+			wpa_printf(MSG_ERROR,
-+				   "Line %d: Invalid passphrase character",
-+				   line);
-+			return -1;
-+		}
- 		if (ssid->passphrase && os_strlen(ssid->passphrase) == len &&
- 		    os_memcmp(ssid->passphrase, value, len) == 0) {
- 			/* No change to the previously configured value */
--- 
-1.9.1
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch
deleted file mode 100644
index db222e4..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From ecbb0b3dc122b0d290987cf9c84010bbe53e1022 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni@qca.qualcomm.com>
-Date: Fri, 4 Mar 2016 17:20:18 +0200
-Subject: [PATCH 1/2] WPS: Reject a Credential with invalid passphrase
-
-WPA/WPA2-Personal passphrase is not allowed to include control
-characters. Reject a Credential received from a WPS Registrar both as
-STA (Credential) and AP (AP Settings) if the credential is for WPAPSK or
-WPA2PSK authentication type and includes an invalid passphrase.
-
-This fixes an issue where hostapd or wpa_supplicant could have updated
-the configuration file PSK/passphrase parameter with arbitrary data from
-an external device (Registrar) that may not be fully trusted. Should
-such data include a newline character, the resulting configuration file
-could become invalid and fail to be parsed.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4476
-
-Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi@windriver.com>
----
- src/utils/common.c         | 12 ++++++++++++
- src/utils/common.h         |  1 +
- src/wps/wps_attr_process.c | 10 ++++++++++
- 3 files changed, 23 insertions(+)
-
-diff --git a/src/utils/common.c b/src/utils/common.c
-index 450e2c6..27b7c02 100644
---- a/src/utils/common.c
-+++ b/src/utils/common.c
-@@ -697,6 +697,18 @@ int is_hex(const u8 *data, size_t len)
- }
- 
- 
-+int has_ctrl_char(const u8 *data, size_t len)
-+{
-+	size_t i;
-+
-+	for (i = 0; i < len; i++) {
-+		if (data[i] < 32 || data[i] == 127)
-+			return 1;
-+	}
-+	return 0;
-+}
-+
-+
- size_t merge_byte_arrays(u8 *res, size_t res_len,
- 			 const u8 *src1, size_t src1_len,
- 			 const u8 *src2, size_t src2_len)
-diff --git a/src/utils/common.h b/src/utils/common.h
-index 701dbb2..a972240 100644
---- a/src/utils/common.h
-+++ b/src/utils/common.h
-@@ -488,6 +488,7 @@ const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len);
- 
- char * wpa_config_parse_string(const char *value, size_t *len);
- int is_hex(const u8 *data, size_t len);
-+int has_ctrl_char(const u8 *data, size_t len);
- size_t merge_byte_arrays(u8 *res, size_t res_len,
- 			 const u8 *src1, size_t src1_len,
- 			 const u8 *src2, size_t src2_len);
-diff --git a/src/wps/wps_attr_process.c b/src/wps/wps_attr_process.c
-index eadb22f..e8c4579 100644
---- a/src/wps/wps_attr_process.c
-+++ b/src/wps/wps_attr_process.c
-@@ -229,6 +229,16 @@ static int wps_workaround_cred_key(struct wps_credential *cred)
- 		cred->key_len--;
- #endif /* CONFIG_WPS_STRICT */
- 	}
-+
-+
-+	if (cred->auth_type & (WPS_AUTH_WPAPSK | WPS_AUTH_WPA2PSK) &&
-+	    (cred->key_len < 8 || has_ctrl_char(cred->key, cred->key_len))) {
-+		wpa_printf(MSG_INFO, "WPS: Reject credential with invalid WPA/WPA2-Personal passphrase");
-+		wpa_hexdump_ascii_key(MSG_INFO, "WPS: Network Key",
-+				      cred->key, cred->key_len);
-+		return -1;
-+	}
-+
- 	return 0;
- }
- 
---
-1.9.1
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Reject-SET_CRED-commands-with-newline-characters-in-.patch b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Reject-SET_CRED-commands-with-newline-characters-in-.patch
deleted file mode 100644
index cad7425..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Reject-SET_CRED-commands-with-newline-characters-in-.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From b166cd84a77a6717be9600bf95378a0055d6f5a5 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni@qca.qualcomm.com>
-Date: Tue, 5 Apr 2016 23:33:10 +0300
-Subject: [PATCH 2/3] Reject SET_CRED commands with newline characters in the
- string values
-
-Most of the cred block parameters are written as strings without
-filtering and if there is an embedded newline character in the value,
-unexpected configuration file data might be written.
-
-This fixes an issue where wpa_supplicant could have updated the
-configuration file cred parameter with arbitrary data from the control
-interface or D-Bus interface. While those interfaces are supposed to be
-accessible only for trusted users/applications, it may be possible that
-an untrusted user has access to a management software component that
-does not validate the credential value before passing it to
-wpa_supplicant.
-
-This could allow such an untrusted user to inject almost arbitrary data
-into the configuration file. Such configuration file could result in
-wpa_supplicant trying to load a library (e.g., opensc_engine_path,
-pkcs11_engine_path, pkcs11_module_path, load_dynamic_eap) from user
-controlled location when starting again. This would allow code from that
-library to be executed under the wpa_supplicant process privileges.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4477
-
-Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi@windriver.com>
----
- wpa_supplicant/config.c | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index eb97cd5..69152ef 100644
---- a/wpa_supplicant/config.c
-+++ b/wpa_supplicant/config.c
-@@ -2896,6 +2896,8 @@ int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
- 
- 	if (os_strcmp(var, "password") == 0 &&
- 	    os_strncmp(value, "ext:", 4) == 0) {
-+		if (has_newline(value))
-+			return -1;
- 		str_clear_free(cred->password);
- 		cred->password = os_strdup(value);
- 		cred->ext_password = 1;
-@@ -2946,9 +2948,14 @@ int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
- 	}
- 
- 	val = wpa_config_parse_string(value, &len);
--	if (val == NULL) {
-+	if (val == NULL ||
-+	    (os_strcmp(var, "excluded_ssid") != 0 &&
-+	     os_strcmp(var, "roaming_consortium") != 0 &&
-+	     os_strcmp(var, "required_roaming_consortium") != 0 &&
-+	     has_newline(val))) {
- 		wpa_printf(MSG_ERROR, "Line %d: invalid field '%s' string "
- 			   "value '%s'.", line, var, value);
-+		os_free(val);
- 		return -1;
- 	}
- 
--- 
-1.9.1
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Remove-newlines-from-wpa_supplicant-config-network-o.patch b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Remove-newlines-from-wpa_supplicant-config-network-o.patch
deleted file mode 100644
index cc7b01a..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Remove-newlines-from-wpa_supplicant-config-network-o.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 0fe5a234240a108b294a87174ad197f6b5cb38e9 Mon Sep 17 00:00:00 2001
-From: Paul Stewart <pstew@google.com>
-Date: Thu, 3 Mar 2016 15:40:19 -0800
-Subject: [PATCH 2/2] Remove newlines from wpa_supplicant config network
- output
-
-Spurious newlines output while writing the config file can corrupt the
-wpa_supplicant configuration. Avoid writing these for the network block
-parameters. This is a generic filter that cover cases that may not have
-been explicitly addressed with a more specific commit to avoid control
-characters in the psk parameter.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4476
-
-Signed-off-by: Paul Stewart <pstew@google.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi.wrs.com>
----
- src/utils/common.c      | 11 +++++++++++
- src/utils/common.h      |  1 +
- wpa_supplicant/config.c | 15 +++++++++++++--
- 3 files changed, 25 insertions(+), 2 deletions(-)
-
-diff --git a/src/utils/common.c b/src/utils/common.c
-index 27b7c02..9856463 100644
---- a/src/utils/common.c
-+++ b/src/utils/common.c
-@@ -709,6 +709,17 @@ int has_ctrl_char(const u8 *data, size_t len)
- }
- 
- 
-+int has_newline(const char *str)
-+{
-+	while (*str) {
-+		if (*str == '\n' || *str == '\r')
-+			return 1;
-+		str++;
-+	}
-+	return 0;
-+}
-+
-+
- size_t merge_byte_arrays(u8 *res, size_t res_len,
- 			 const u8 *src1, size_t src1_len,
- 			 const u8 *src2, size_t src2_len)
-diff --git a/src/utils/common.h b/src/utils/common.h
-index a972240..d19927b 100644
---- a/src/utils/common.h
-+++ b/src/utils/common.h
-@@ -489,6 +489,7 @@ const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len);
- char * wpa_config_parse_string(const char *value, size_t *len);
- int is_hex(const u8 *data, size_t len);
- int has_ctrl_char(const u8 *data, size_t len);
-+int has_newline(const char *str);
- size_t merge_byte_arrays(u8 *res, size_t res_len,
- 			 const u8 *src1, size_t src1_len,
- 			 const u8 *src2, size_t src2_len);
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index fdd9643..eb97cd5 100644
---- a/wpa_supplicant/config.c
-+++ b/wpa_supplicant/config.c
-@@ -2699,8 +2699,19 @@ char * wpa_config_get(struct wpa_ssid *ssid, const char *var)
- 
- 	for (i = 0; i < NUM_SSID_FIELDS; i++) {
- 		const struct parse_data *field = &ssid_fields[i];
--		if (os_strcmp(var, field->name) == 0)
--			return field->writer(field, ssid);
-+		if (os_strcmp(var, field->name) == 0) {
-+			char *ret = field->writer(field, ssid);
-+
-+			if (ret && has_newline(ret)) {
-+				wpa_printf(MSG_ERROR,
-+					   "Found newline in value for %s; not returning it",
-+					   var);
-+				os_free(ret);
-+				ret = NULL;
-+			}
-+
-+			return ret;
-+		}
- 	}
- 
- 	return NULL;
---
-1.9.1
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-Reject-SET-commands-with-newline-characters-in-the-s.patch b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-Reject-SET-commands-with-newline-characters-in-the-s.patch
deleted file mode 100644
index 5375db7..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-Reject-SET-commands-with-newline-characters-in-the-s.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 2a3f56502b52375c3bf113cf92adfa99bad6b488 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni@qca.qualcomm.com>
-Date: Tue, 5 Apr 2016 23:55:48 +0300
-Subject: [PATCH 3/3] Reject SET commands with newline characters in the
- string values
-
-Many of the global configuration parameters are written as strings
-without filtering and if there is an embedded newline character in the
-value, unexpected configuration file data might be written.
-
-This fixes an issue where wpa_supplicant could have updated the
-configuration file global parameter with arbitrary data from the control
-interface or D-Bus interface. While those interfaces are supposed to be
-accessible only for trusted users/applications, it may be possible that
-an untrusted user has access to a management software component that
-does not validate the value of a parameter before passing it to
-wpa_supplicant.
-
-This could allow such an untrusted user to inject almost arbitrary data
-into the configuration file. Such configuration file could result in
-wpa_supplicant trying to load a library (e.g., opensc_engine_path,
-pkcs11_engine_path, pkcs11_module_path, load_dynamic_eap) from user
-controlled location when starting again. This would allow code from that
-library to be executed under the wpa_supplicant process privileges.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4477
-
-Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi@windriver.com>
----
- wpa_supplicant/config.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index 69152ef..d9a1603 100644
---- a/wpa_supplicant/config.c
-+++ b/wpa_supplicant/config.c
-@@ -3764,6 +3764,12 @@ static int wpa_global_config_parse_str(const struct global_parse_data *data,
- 		return -1;
- 	}
- 
-+	if (has_newline(pos)) {
-+		wpa_printf(MSG_ERROR, "Line %d: invalid %s value with newline",
-+			   line, data->name);
-+		return -1;
-+	}
-+
- 	tmp = os_strdup(pos);
- 	if (tmp == NULL)
- 		return -1;
--- 
-1.9.1
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/key-replay-cve-multiple.patch b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/key-replay-cve-multiple.patch
new file mode 100644
index 0000000..436520f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/key-replay-cve-multiple.patch
@@ -0,0 +1,1025 @@
+The WPA2 four-way handshake protocol is vulnerable to replay attacks which can
+result in unauthenticated clients gaining access to the network.
+
+Backport a number of patches from upstream to fix this.
+
+CVE: CVE-2017-13077
+CVE: CVE-2017-13078
+CVE: CVE-2017-13079
+CVE: CVE-2017-13080
+CVE: CVE-2017-13081
+CVE: CVE-2017-13082
+CVE: CVE-2017-13086
+CVE: CVE-2017-13087
+CVE: CVE-2017-13088
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From cf4cab804c7afd5c45505528a8d16e46163243a2 Mon Sep 17 00:00:00 2001
+From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+Date: Fri, 14 Jul 2017 15:15:35 +0200
+Subject: [PATCH 1/8] hostapd: Avoid key reinstallation in FT handshake
+
+Do not reinstall TK to the driver during Reassociation Response frame
+processing if the first attempt of setting the TK succeeded. This avoids
+issues related to clearing the TX/RX PN that could result in reusing
+same PN values for transmitted frames (e.g., due to CCM nonce reuse and
+also hitting replay protection on the receiver) and accepting replayed
+frames on RX side.
+
+This issue was introduced by the commit
+0e84c25434e6a1f283c7b4e62e483729085b78d2 ('FT: Fix PTK configuration in
+authenticator') which allowed wpa_ft_install_ptk() to be called multiple
+times with the same PTK. While the second configuration attempt is
+needed with some drivers, it must be done only if the first attempt
+failed.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+---
+ src/ap/ieee802_11.c  | 16 +++++++++++++---
+ src/ap/wpa_auth.c    | 11 +++++++++++
+ src/ap/wpa_auth.h    |  3 ++-
+ src/ap/wpa_auth_ft.c | 10 ++++++++++
+ src/ap/wpa_auth_i.h  |  1 +
+ 5 files changed, 37 insertions(+), 4 deletions(-)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 4e04169..333035f 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -1841,6 +1841,7 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ {
+ 	struct ieee80211_ht_capabilities ht_cap;
+ 	struct ieee80211_vht_capabilities vht_cap;
++	int set = 1;
+ 
+ 	/*
+ 	 * Remove the STA entry to ensure the STA PS state gets cleared and
+@@ -1848,9 +1849,18 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ 	 * FT-over-the-DS, where a station re-associates back to the same AP but
+ 	 * skips the authentication flow, or if working with a driver that
+ 	 * does not support full AP client state.
++	 *
++	 * Skip this if the STA has already completed FT reassociation and the
++	 * TK has been configured since the TX/RX PN must not be reset to 0 for
++	 * the same key.
+ 	 */
+-	if (!sta->added_unassoc)
++	if (!sta->added_unassoc &&
++	    (!(sta->flags & WLAN_STA_AUTHORIZED) ||
++	     !wpa_auth_sta_ft_tk_already_set(sta->wpa_sm))) {
+ 		hostapd_drv_sta_remove(hapd, sta->addr);
++		wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED);
++		set = 0;
++	}
+ 
+ #ifdef CONFIG_IEEE80211N
+ 	if (sta->flags & WLAN_STA_HT)
+@@ -1873,11 +1883,11 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ 			    sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
+ 			    sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
+ 			    sta->vht_opmode, sta->p2p_ie ? 1 : 0,
+-			    sta->added_unassoc)) {
++			    set)) {
+ 		hostapd_logger(hapd, sta->addr,
+ 			       HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
+ 			       "Could not %s STA to kernel driver",
+-			       sta->added_unassoc ? "set" : "add");
++			       set ? "set" : "add");
+ 
+ 		if (sta->added_unassoc) {
+ 			hostapd_drv_sta_remove(hapd, sta->addr);
+diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
+index 3587086..707971d 100644
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -1745,6 +1745,9 @@ int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event)
+ #else /* CONFIG_IEEE80211R */
+ 		break;
+ #endif /* CONFIG_IEEE80211R */
++	case WPA_DRV_STA_REMOVED:
++		sm->tk_already_set = FALSE;
++		return 0;
+ 	}
+ 
+ #ifdef CONFIG_IEEE80211R
+@@ -3250,6 +3253,14 @@ int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm)
+ }
+ 
+ 
++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm)
++{
++	if (!sm || !wpa_key_mgmt_ft(sm->wpa_key_mgmt))
++		return 0;
++	return sm->tk_already_set;
++}
++
++
+ int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
+ 			     struct rsn_pmksa_cache_entry *entry)
+ {
+diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
+index 0de8d97..97461b0 100644
+--- a/src/ap/wpa_auth.h
++++ b/src/ap/wpa_auth.h
+@@ -267,7 +267,7 @@ void wpa_receive(struct wpa_authenticator *wpa_auth,
+ 		 u8 *data, size_t data_len);
+ enum wpa_event {
+ 	WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH,
+-	WPA_REAUTH_EAPOL, WPA_ASSOC_FT
++	WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_DRV_STA_REMOVED
+ };
+ void wpa_remove_ptk(struct wpa_state_machine *sm);
+ int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event);
+@@ -280,6 +280,7 @@ int wpa_auth_pairwise_set(struct wpa_state_machine *sm);
+ int wpa_auth_get_pairwise(struct wpa_state_machine *sm);
+ int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm);
+ int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm);
++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm);
+ int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
+ 			     struct rsn_pmksa_cache_entry *entry);
+ struct rsn_pmksa_cache_entry *
+diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c
+index 42242a5..e63b99a 100644
+--- a/src/ap/wpa_auth_ft.c
++++ b/src/ap/wpa_auth_ft.c
+@@ -780,6 +780,14 @@ void wpa_ft_install_ptk(struct wpa_state_machine *sm)
+ 		return;
+ 	}
+ 
++	if (sm->tk_already_set) {
++		/* Must avoid TK reconfiguration to prevent clearing of TX/RX
++		 * PN in the driver */
++		wpa_printf(MSG_DEBUG,
++			   "FT: Do not re-install same PTK to the driver");
++		return;
++	}
++
+ 	/* FIX: add STA entry to kernel/driver here? The set_key will fail
+ 	 * most likely without this.. At the moment, STA entry is added only
+ 	 * after association has been completed. This function will be called
+@@ -792,6 +800,7 @@ void wpa_ft_install_ptk(struct wpa_state_machine *sm)
+ 
+ 	/* FIX: MLME-SetProtection.Request(TA, Tx_Rx) */
+ 	sm->pairwise_set = TRUE;
++	sm->tk_already_set = TRUE;
+ }
+ 
+ 
+@@ -898,6 +907,7 @@ static int wpa_ft_process_auth_req(struct wpa_state_machine *sm,
+ 
+ 	sm->pairwise = pairwise;
+ 	sm->PTK_valid = TRUE;
++	sm->tk_already_set = FALSE;
+ 	wpa_ft_install_ptk(sm);
+ 
+ 	buflen = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
+diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h
+index 72b7eb3..7fd8f05 100644
+--- a/src/ap/wpa_auth_i.h
++++ b/src/ap/wpa_auth_i.h
+@@ -65,6 +65,7 @@ struct wpa_state_machine {
+ 	struct wpa_ptk PTK;
+ 	Boolean PTK_valid;
+ 	Boolean pairwise_set;
++	Boolean tk_already_set;
+ 	int keycount;
+ 	Boolean Pair;
+ 	struct wpa_key_replay_counter {
+-- 
+2.7.4
+
+From 927f891007c402fefd1ff384645b3f07597c3ede Mon Sep 17 00:00:00 2001
+From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+Date: Wed, 12 Jul 2017 16:03:24 +0200
+Subject: [PATCH 2/8] Prevent reinstallation of an already in-use group key
+
+Track the current GTK and IGTK that is in use and when receiving a
+(possibly retransmitted) Group Message 1 or WNM-Sleep Mode Response, do
+not install the given key if it is already in use. This prevents an
+attacker from trying to trick the client into resetting or lowering the
+sequence counter associated to the group key.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+---
+ src/common/wpa_common.h |  11 +++++
+ src/rsn_supp/wpa.c      | 116 ++++++++++++++++++++++++++++++------------------
+ src/rsn_supp/wpa_i.h    |   4 ++
+ 3 files changed, 87 insertions(+), 44 deletions(-)
+
+diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
+index af1d0f0..d200285 100644
+--- a/src/common/wpa_common.h
++++ b/src/common/wpa_common.h
+@@ -217,6 +217,17 @@ struct wpa_ptk {
+ 	size_t tk_len;
+ };
+ 
++struct wpa_gtk {
++	u8 gtk[WPA_GTK_MAX_LEN];
++	size_t gtk_len;
++};
++
++#ifdef CONFIG_IEEE80211W
++struct wpa_igtk {
++	u8 igtk[WPA_IGTK_MAX_LEN];
++	size_t igtk_len;
++};
++#endif /* CONFIG_IEEE80211W */
+ 
+ /* WPA IE version 1
+  * 00-50-f2:1 (OUI:OUI type)
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 3c47879..95bd7be 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -714,6 +714,15 @@ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ 	const u8 *_gtk = gd->gtk;
+ 	u8 gtk_buf[32];
+ 
++	/* Detect possible key reinstallation */
++	if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
++	    os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
++		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++			"WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
++			gd->keyidx, gd->tx, gd->gtk_len);
++		return 0;
++	}
++
+ 	wpa_hexdump_key(MSG_DEBUG, "WPA: Group Key", gd->gtk, gd->gtk_len);
+ 	wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 		"WPA: Installing GTK to the driver (keyidx=%d tx=%d len=%d)",
+@@ -748,6 +757,9 @@ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ 	}
+ 	os_memset(gtk_buf, 0, sizeof(gtk_buf));
+ 
++	sm->gtk.gtk_len = gd->gtk_len;
++	os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++
+ 	return 0;
+ }
+ 
+@@ -854,6 +866,48 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
+ }
+ 
+ 
++#ifdef CONFIG_IEEE80211W
++static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
++				       const struct wpa_igtk_kde *igtk)
++{
++	size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
++	u16 keyidx = WPA_GET_LE16(igtk->keyid);
++
++	/* Detect possible key reinstallation */
++	if (sm->igtk.igtk_len == len &&
++	    os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
++		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++			"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
++			keyidx);
++		return  0;
++	}
++
++	wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++		"WPA: IGTK keyid %d pn %02x%02x%02x%02x%02x%02x",
++		keyidx, MAC2STR(igtk->pn));
++	wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK", igtk->igtk, len);
++	if (keyidx > 4095) {
++		wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
++			"WPA: Invalid IGTK KeyID %d", keyidx);
++		return -1;
++	}
++	if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
++			   broadcast_ether_addr,
++			   keyidx, 0, igtk->pn, sizeof(igtk->pn),
++			   igtk->igtk, len) < 0) {
++		wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
++			"WPA: Failed to configure IGTK to the driver");
++		return -1;
++	}
++
++	sm->igtk.igtk_len = len;
++	os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++
++	return 0;
++}
++#endif /* CONFIG_IEEE80211W */
++
++
+ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ 			       struct wpa_eapol_ie_parse *ie)
+ {
+@@ -864,30 +918,14 @@ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ 	if (ie->igtk) {
+ 		size_t len;
+ 		const struct wpa_igtk_kde *igtk;
+-		u16 keyidx;
++
+ 		len = wpa_cipher_key_len(sm->mgmt_group_cipher);
+ 		if (ie->igtk_len != WPA_IGTK_KDE_PREFIX_LEN + len)
+ 			return -1;
++
+ 		igtk = (const struct wpa_igtk_kde *) ie->igtk;
+-		keyidx = WPA_GET_LE16(igtk->keyid);
+-		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: IGTK keyid %d "
+-			"pn %02x%02x%02x%02x%02x%02x",
+-			keyidx, MAC2STR(igtk->pn));
+-		wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK",
+-				igtk->igtk, len);
+-		if (keyidx > 4095) {
+-			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+-				"WPA: Invalid IGTK KeyID %d", keyidx);
+-			return -1;
+-		}
+-		if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
+-				   broadcast_ether_addr,
+-				   keyidx, 0, igtk->pn, sizeof(igtk->pn),
+-				   igtk->igtk, len) < 0) {
+-			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+-				"WPA: Failed to configure IGTK to the driver");
++		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
+ 			return -1;
+-		}
+ 	}
+ 
+ 	return 0;
+@@ -2307,7 +2345,7 @@ void wpa_sm_deinit(struct wpa_sm *sm)
+  */
+ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ {
+-	int clear_ptk = 1;
++	int clear_keys = 1;
+ 
+ 	if (sm == NULL)
+ 		return;
+@@ -2333,11 +2371,11 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ 		/* Prepare for the next transition */
+ 		wpa_ft_prepare_auth_request(sm, NULL);
+ 
+-		clear_ptk = 0;
++		clear_keys = 0;
+ 	}
+ #endif /* CONFIG_IEEE80211R */
+ 
+-	if (clear_ptk) {
++	if (clear_keys) {
+ 		/*
+ 		 * IEEE 802.11, 8.4.10: Delete PTK SA on (re)association if
+ 		 * this is not part of a Fast BSS Transition.
+@@ -2347,6 +2385,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ 		os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 		sm->tptk_set = 0;
+ 		os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++		os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++#ifdef CONFIG_IEEE80211W
++		os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++#endif /* CONFIG_IEEE80211W */
+ 	}
+ 
+ #ifdef CONFIG_TDLS
+@@ -2877,6 +2919,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
+ 	os_memset(sm->pmk, 0, sizeof(sm->pmk));
+ 	os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 	os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++	os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++#ifdef CONFIG_IEEE80211W
++	os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++#endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211R
+ 	os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
+ 	os_memset(sm->pmk_r0, 0, sizeof(sm->pmk_r0));
+@@ -2949,29 +2995,11 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf)
+ 		os_memset(&gd, 0, sizeof(gd));
+ #ifdef CONFIG_IEEE80211W
+ 	} else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) {
+-		struct wpa_igtk_kde igd;
+-		u16 keyidx;
+-
+-		os_memset(&igd, 0, sizeof(igd));
+-		keylen = wpa_cipher_key_len(sm->mgmt_group_cipher);
+-		os_memcpy(igd.keyid, buf + 2, 2);
+-		os_memcpy(igd.pn, buf + 4, 6);
+-
+-		keyidx = WPA_GET_LE16(igd.keyid);
+-		os_memcpy(igd.igtk, buf + 10, keylen);
+-
+-		wpa_hexdump_key(MSG_DEBUG, "Install IGTK (WNM SLEEP)",
+-				igd.igtk, keylen);
+-		if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
+-				   broadcast_ether_addr,
+-				   keyidx, 0, igd.pn, sizeof(igd.pn),
+-				   igd.igtk, keylen) < 0) {
+-			wpa_printf(MSG_DEBUG, "Failed to install the IGTK in "
+-				   "WNM mode");
+-			os_memset(&igd, 0, sizeof(igd));
++		const struct wpa_igtk_kde *igtk;
++
++		igtk = (const struct wpa_igtk_kde *) (buf + 2);
++		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
+ 			return -1;
+-		}
+-		os_memset(&igd, 0, sizeof(igd));
+ #endif /* CONFIG_IEEE80211W */
+ 	} else {
+ 		wpa_printf(MSG_DEBUG, "Unknown element id");
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index f653ba6..afc9e37 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -31,6 +31,10 @@ struct wpa_sm {
+ 	u8 rx_replay_counter[WPA_REPLAY_COUNTER_LEN];
+ 	int rx_replay_counter_set;
+ 	u8 request_counter[WPA_REPLAY_COUNTER_LEN];
++	struct wpa_gtk gtk;
++#ifdef CONFIG_IEEE80211W
++	struct wpa_igtk igtk;
++#endif /* CONFIG_IEEE80211W */
+ 
+ 	struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
+ 
+-- 
+2.7.4
+
+From 8280294e74846ea342389a0cd17215050fa5afe8 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Sun, 1 Oct 2017 12:12:24 +0300
+Subject: [PATCH 3/8] Extend protection of GTK/IGTK reinstallation of WNM-Sleep
+ Mode cases
+
+This extends the protection to track last configured GTK/IGTK value
+separately from EAPOL-Key frames and WNM-Sleep Mode frames to cover a
+corner case where these two different mechanisms may get used when the
+GTK/IGTK has changed and tracking a single value is not sufficient to
+detect a possible key reconfiguration.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/rsn_supp/wpa.c   | 53 +++++++++++++++++++++++++++++++++++++---------------
+ src/rsn_supp/wpa_i.h |  2 ++
+ 2 files changed, 40 insertions(+), 15 deletions(-)
+
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 95bd7be..7a2c68d 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -709,14 +709,17 @@ struct wpa_gtk_data {
+ 
+ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ 				      const struct wpa_gtk_data *gd,
+-				      const u8 *key_rsc)
++				      const u8 *key_rsc, int wnm_sleep)
+ {
+ 	const u8 *_gtk = gd->gtk;
+ 	u8 gtk_buf[32];
+ 
+ 	/* Detect possible key reinstallation */
+-	if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
+-	    os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
++	if ((sm->gtk.gtk_len == (size_t) gd->gtk_len &&
++	     os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) ||
++	    (sm->gtk_wnm_sleep.gtk_len == (size_t) gd->gtk_len &&
++	     os_memcmp(sm->gtk_wnm_sleep.gtk, gd->gtk,
++		       sm->gtk_wnm_sleep.gtk_len) == 0)) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
+ 			gd->keyidx, gd->tx, gd->gtk_len);
+@@ -757,8 +760,14 @@ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ 	}
+ 	os_memset(gtk_buf, 0, sizeof(gtk_buf));
+ 
+-	sm->gtk.gtk_len = gd->gtk_len;
+-	os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++	if (wnm_sleep) {
++		sm->gtk_wnm_sleep.gtk_len = gd->gtk_len;
++		os_memcpy(sm->gtk_wnm_sleep.gtk, gd->gtk,
++			  sm->gtk_wnm_sleep.gtk_len);
++	} else {
++		sm->gtk.gtk_len = gd->gtk_len;
++		os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++	}
+ 
+ 	return 0;
+ }
+@@ -852,7 +861,7 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
+ 	    (wpa_supplicant_check_group_cipher(sm, sm->group_cipher,
+ 					       gtk_len, gtk_len,
+ 					       &gd.key_rsc_len, &gd.alg) ||
+-	     wpa_supplicant_install_gtk(sm, &gd, key_rsc))) {
++	     wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0))) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"RSN: Failed to install GTK");
+ 		os_memset(&gd, 0, sizeof(gd));
+@@ -868,14 +877,18 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
+ 
+ #ifdef CONFIG_IEEE80211W
+ static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
+-				       const struct wpa_igtk_kde *igtk)
++				       const struct wpa_igtk_kde *igtk,
++				       int wnm_sleep)
+ {
+ 	size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
+ 	u16 keyidx = WPA_GET_LE16(igtk->keyid);
+ 
+ 	/* Detect possible key reinstallation */
+-	if (sm->igtk.igtk_len == len &&
+-	    os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
++	if ((sm->igtk.igtk_len == len &&
++	     os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) ||
++	    (sm->igtk_wnm_sleep.igtk_len == len &&
++	     os_memcmp(sm->igtk_wnm_sleep.igtk, igtk->igtk,
++		       sm->igtk_wnm_sleep.igtk_len) == 0)) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
+ 			keyidx);
+@@ -900,8 +913,14 @@ static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
+ 		return -1;
+ 	}
+ 
+-	sm->igtk.igtk_len = len;
+-	os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++	if (wnm_sleep) {
++		sm->igtk_wnm_sleep.igtk_len = len;
++		os_memcpy(sm->igtk_wnm_sleep.igtk, igtk->igtk,
++			  sm->igtk_wnm_sleep.igtk_len);
++	} else {
++		sm->igtk.igtk_len = len;
++		os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++	}
+ 
+ 	return 0;
+ }
+@@ -924,7 +943,7 @@ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ 			return -1;
+ 
+ 		igtk = (const struct wpa_igtk_kde *) ie->igtk;
+-		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
++		if (wpa_supplicant_install_igtk(sm, igtk, 0) < 0)
+ 			return -1;
+ 	}
+ 
+@@ -1574,7 +1593,7 @@ static void wpa_supplicant_process_1_of_2(struct wpa_sm *sm,
+ 	if (wpa_supplicant_rsc_relaxation(sm, key->key_rsc))
+ 		key_rsc = null_rsc;
+ 
+-	if (wpa_supplicant_install_gtk(sm, &gd, key_rsc) ||
++	if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0) ||
+ 	    wpa_supplicant_send_2_of_2(sm, key, ver, key_info) < 0)
+ 		goto failed;
+ 	os_memset(&gd, 0, sizeof(gd));
+@@ -2386,8 +2405,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ 		sm->tptk_set = 0;
+ 		os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ 		os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++		os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
+ #ifdef CONFIG_IEEE80211W
+ 		os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++		os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
+ #endif /* CONFIG_IEEE80211W */
+ 	}
+ 
+@@ -2920,8 +2941,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
+ 	os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 	os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ 	os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++	os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
+ #ifdef CONFIG_IEEE80211W
+ 	os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++	os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
+ #endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211R
+ 	os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
+@@ -2986,7 +3009,7 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf)
+ 
+ 		wpa_hexdump_key(MSG_DEBUG, "Install GTK (WNM SLEEP)",
+ 				gd.gtk, gd.gtk_len);
+-		if (wpa_supplicant_install_gtk(sm, &gd, key_rsc)) {
++		if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 1)) {
+ 			os_memset(&gd, 0, sizeof(gd));
+ 			wpa_printf(MSG_DEBUG, "Failed to install the GTK in "
+ 				   "WNM mode");
+@@ -2998,7 +3021,7 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf)
+ 		const struct wpa_igtk_kde *igtk;
+ 
+ 		igtk = (const struct wpa_igtk_kde *) (buf + 2);
+-		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
++		if (wpa_supplicant_install_igtk(sm, igtk, 1) < 0)
+ 			return -1;
+ #endif /* CONFIG_IEEE80211W */
+ 	} else {
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index afc9e37..9a54631 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -32,8 +32,10 @@ struct wpa_sm {
+ 	int rx_replay_counter_set;
+ 	u8 request_counter[WPA_REPLAY_COUNTER_LEN];
+ 	struct wpa_gtk gtk;
++	struct wpa_gtk gtk_wnm_sleep;
+ #ifdef CONFIG_IEEE80211W
+ 	struct wpa_igtk igtk;
++	struct wpa_igtk igtk_wnm_sleep;
+ #endif /* CONFIG_IEEE80211W */
+ 
+ 	struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
+-- 
+2.7.4
+
+From 8f82bc94e8697a9d47fa8774dfdaaede1084912c Mon Sep 17 00:00:00 2001
+From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+Date: Fri, 29 Sep 2017 04:22:51 +0200
+Subject: [PATCH 4/8] Prevent installation of an all-zero TK
+
+Properly track whether a PTK has already been installed to the driver
+and the TK part cleared from memory. This prevents an attacker from
+trying to trick the client into installing an all-zero TK.
+
+This fixes the earlier fix in commit
+ad00d64e7d8827b3cebd665a0ceb08adabf15e1e ('Fix TK configuration to the
+driver in EAPOL-Key 3/4 retry case') which did not take into account
+possibility of an extra message 1/4 showing up between retries of
+message 3/4.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+---
+ src/common/wpa_common.h | 1 +
+ src/rsn_supp/wpa.c      | 5 ++---
+ src/rsn_supp/wpa_i.h    | 1 -
+ 3 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
+index d200285..1021ccb 100644
+--- a/src/common/wpa_common.h
++++ b/src/common/wpa_common.h
+@@ -215,6 +215,7 @@ struct wpa_ptk {
+ 	size_t kck_len;
+ 	size_t kek_len;
+ 	size_t tk_len;
++	int installed; /* 1 if key has already been installed to driver */
+ };
+ 
+ struct wpa_gtk {
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 7a2c68d..0550a41 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -510,7 +510,6 @@ static void wpa_supplicant_process_1_of_4(struct wpa_sm *sm,
+ 		os_memset(buf, 0, sizeof(buf));
+ 	}
+ 	sm->tptk_set = 1;
+-	sm->tk_to_set = 1;
+ 
+ 	kde = sm->assoc_wpa_ie;
+ 	kde_len = sm->assoc_wpa_ie_len;
+@@ -615,7 +614,7 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
+ 	enum wpa_alg alg;
+ 	const u8 *key_rsc;
+ 
+-	if (!sm->tk_to_set) {
++	if (sm->ptk.installed) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Do not re-install same PTK to the driver");
+ 		return 0;
+@@ -659,7 +658,7 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
+ 
+ 	/* TK is not needed anymore in supplicant */
+ 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
+-	sm->tk_to_set = 0;
++	sm->ptk.installed = 1;
+ 
+ 	if (sm->wpa_ptk_rekey) {
+ 		eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL);
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index 9a54631..41f371f 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -24,7 +24,6 @@ struct wpa_sm {
+ 	struct wpa_ptk ptk, tptk;
+ 	int ptk_set, tptk_set;
+ 	unsigned int msg_3_of_4_ok:1;
+-	unsigned int tk_to_set:1;
+ 	u8 snonce[WPA_NONCE_LEN];
+ 	u8 anonce[WPA_NONCE_LEN]; /* ANonce from the last 1/4 msg */
+ 	int renew_snonce;
+-- 
+2.7.4
+
+From 12fac09b437a1dc8a0f253e265934a8aaf4d2f8b Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Sun, 1 Oct 2017 12:32:57 +0300
+Subject: [PATCH 5/8] Fix PTK rekeying to generate a new ANonce
+
+The Authenticator state machine path for PTK rekeying ended up bypassing
+the AUTHENTICATION2 state where a new ANonce is generated when going
+directly to the PTKSTART state since there is no need to try to
+determine the PMK again in such a case. This is far from ideal since the
+new PTK would depend on a new nonce only from the supplicant.
+
+Fix this by generating a new ANonce when moving to the PTKSTART state
+for the purpose of starting new 4-way handshake to rekey PTK.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/ap/wpa_auth.c | 24 +++++++++++++++++++++---
+ 1 file changed, 21 insertions(+), 3 deletions(-)
+
+diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
+index 707971d..bf10cc1 100644
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -1901,6 +1901,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2)
+ }
+ 
+ 
++static int wpa_auth_sm_ptk_update(struct wpa_state_machine *sm)
++{
++	if (random_get_bytes(sm->ANonce, WPA_NONCE_LEN)) {
++		wpa_printf(MSG_ERROR,
++			   "WPA: Failed to get random data for ANonce");
++		sm->Disconnect = TRUE;
++		return -1;
++	}
++	wpa_hexdump(MSG_DEBUG, "WPA: Assign new ANonce", sm->ANonce,
++		    WPA_NONCE_LEN);
++	sm->TimeoutCtr = 0;
++	return 0;
++}
++
++
+ SM_STATE(WPA_PTK, INITPMK)
+ {
+ 	u8 msk[2 * PMK_LEN];
+@@ -2458,9 +2473,12 @@ SM_STEP(WPA_PTK)
+ 		SM_ENTER(WPA_PTK, AUTHENTICATION);
+ 	else if (sm->ReAuthenticationRequest)
+ 		SM_ENTER(WPA_PTK, AUTHENTICATION2);
+-	else if (sm->PTKRequest)
+-		SM_ENTER(WPA_PTK, PTKSTART);
+-	else switch (sm->wpa_ptk_state) {
++	else if (sm->PTKRequest) {
++		if (wpa_auth_sm_ptk_update(sm) < 0)
++			SM_ENTER(WPA_PTK, DISCONNECTED);
++		else
++			SM_ENTER(WPA_PTK, PTKSTART);
++	} else switch (sm->wpa_ptk_state) {
+ 	case WPA_PTK_INITIALIZE:
+ 		break;
+ 	case WPA_PTK_DISCONNECT:
+-- 
+2.7.4
+
+From 6c4bed4f47d1960ec04981a9d50e5076aea5223d Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Fri, 22 Sep 2017 11:03:15 +0300
+Subject: [PATCH 6/8] TDLS: Reject TPK-TK reconfiguration
+
+Do not try to reconfigure the same TPK-TK to the driver after it has
+been successfully configured. This is an explicit check to avoid issues
+related to resetting the TX/RX packet number. There was already a check
+for this for TPK M2 (retries of that message are ignored completely), so
+that behavior does not get modified.
+
+For TPK M3, the TPK-TK could have been reconfigured, but that was
+followed by immediate teardown of the link due to an issue in updating
+the STA entry. Furthermore, for TDLS with any real security (i.e.,
+ignoring open/WEP), the TPK message exchange is protected on the AP path
+and simple replay attacks are not feasible.
+
+As an additional corner case, make sure the local nonce gets updated if
+the peer uses a very unlikely "random nonce" of all zeros.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/rsn_supp/tdls.c | 38 ++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 36 insertions(+), 2 deletions(-)
+
+diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
+index e424168..9eb9738 100644
+--- a/src/rsn_supp/tdls.c
++++ b/src/rsn_supp/tdls.c
+@@ -112,6 +112,7 @@ struct wpa_tdls_peer {
+ 		u8 tk[16]; /* TPK-TK; assuming only CCMP will be used */
+ 	} tpk;
+ 	int tpk_set;
++	int tk_set; /* TPK-TK configured to the driver */
+ 	int tpk_success;
+ 	int tpk_in_progress;
+ 
+@@ -192,6 +193,20 @@ static int wpa_tdls_set_key(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
+ 	u8 rsc[6];
+ 	enum wpa_alg alg;
+ 
++	if (peer->tk_set) {
++		/*
++		 * This same TPK-TK has already been configured to the driver
++		 * and this new configuration attempt (likely due to an
++		 * unexpected retransmitted frame) would result in clearing
++		 * the TX/RX sequence number which can break security, so must
++		 * not allow that to happen.
++		 */
++		wpa_printf(MSG_INFO, "TDLS: TPK-TK for the peer " MACSTR
++			   " has already been configured to the driver - do not reconfigure",
++			   MAC2STR(peer->addr));
++		return -1;
++	}
++
+ 	os_memset(rsc, 0, 6);
+ 
+ 	switch (peer->cipher) {
+@@ -209,12 +224,15 @@ static int wpa_tdls_set_key(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
+ 		return -1;
+ 	}
+ 
++	wpa_printf(MSG_DEBUG, "TDLS: Configure pairwise key for peer " MACSTR,
++		   MAC2STR(peer->addr));
+ 	if (wpa_sm_set_key(sm, alg, peer->addr, -1, 1,
+ 			   rsc, sizeof(rsc), peer->tpk.tk, key_len) < 0) {
+ 		wpa_printf(MSG_WARNING, "TDLS: Failed to set TPK to the "
+ 			   "driver");
+ 		return -1;
+ 	}
++	peer->tk_set = 1;
+ 	return 0;
+ }
+ 
+@@ -696,7 +714,7 @@ static void wpa_tdls_peer_clear(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
+ 	peer->cipher = 0;
+ 	peer->qos_info = 0;
+ 	peer->wmm_capable = 0;
+-	peer->tpk_set = peer->tpk_success = 0;
++	peer->tk_set = peer->tpk_set = peer->tpk_success = 0;
+ 	peer->chan_switch_enabled = 0;
+ 	os_memset(&peer->tpk, 0, sizeof(peer->tpk));
+ 	os_memset(peer->inonce, 0, WPA_NONCE_LEN);
+@@ -1159,6 +1177,7 @@ skip_rsnie:
+ 		wpa_tdls_peer_free(sm, peer);
+ 		return -1;
+ 	}
++	peer->tk_set = 0; /* A new nonce results in a new TK */
+ 	wpa_hexdump(MSG_DEBUG, "TDLS: Initiator Nonce for TPK handshake",
+ 		    peer->inonce, WPA_NONCE_LEN);
+ 	os_memcpy(ftie->Snonce, peer->inonce, WPA_NONCE_LEN);
+@@ -1751,6 +1770,19 @@ static int wpa_tdls_addset_peer(struct wpa_sm *sm, struct wpa_tdls_peer *peer,
+ }
+ 
+ 
++static int tdls_nonce_set(const u8 *nonce)
++{
++	int i;
++
++	for (i = 0; i < WPA_NONCE_LEN; i++) {
++		if (nonce[i])
++			return 1;
++	}
++
++	return 0;
++}
++
++
+ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
+ 				   const u8 *buf, size_t len)
+ {
+@@ -2004,7 +2036,8 @@ skip_rsn:
+ 	peer->rsnie_i_len = kde.rsn_ie_len;
+ 	peer->cipher = cipher;
+ 
+-	if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0) {
++	if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0 ||
++	    !tdls_nonce_set(peer->inonce)) {
+ 		/*
+ 		 * There is no point in updating the RNonce for every obtained
+ 		 * TPK M1 frame (e.g., retransmission due to timeout) with the
+@@ -2020,6 +2053,7 @@ skip_rsn:
+ 				"TDLS: Failed to get random data for responder nonce");
+ 			goto error;
+ 		}
++		peer->tk_set = 0; /* A new nonce results in a new TK */
+ 	}
+ 
+ #if 0
+-- 
+2.7.4
+
+From 53c5eb58e95004f86e65ee9fbfccbc291b139057 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Fri, 22 Sep 2017 11:25:02 +0300
+Subject: [PATCH 7/8] WNM: Ignore WNM-Sleep Mode Response without pending
+ request
+
+Commit 03ed0a52393710be6bdae657d1b36efa146520e5 ('WNM: Ignore WNM-Sleep
+Mode Response if WNM-Sleep Mode has not been used') started ignoring the
+response when no WNM-Sleep Mode Request had been used during the
+association. This can be made tighter by clearing the used flag when
+successfully processing a response. This adds an additional layer of
+protection against unexpected retransmissions of the response frame.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ wpa_supplicant/wnm_sta.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c
+index 1b3409c..67a07ff 100644
+--- a/wpa_supplicant/wnm_sta.c
++++ b/wpa_supplicant/wnm_sta.c
+@@ -260,7 +260,7 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_supplicant *wpa_s,
+ 
+ 	if (!wpa_s->wnmsleep_used) {
+ 		wpa_printf(MSG_DEBUG,
+-			   "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode has not been used in this association");
++			   "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode operation has not been requested");
+ 		return;
+ 	}
+ 
+@@ -299,6 +299,8 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_supplicant *wpa_s,
+ 		return;
+ 	}
+ 
++	wpa_s->wnmsleep_used = 0;
++
+ 	if (wnmsleep_ie->status == WNM_STATUS_SLEEP_ACCEPT ||
+ 	    wnmsleep_ie->status == WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) {
+ 		wpa_printf(MSG_DEBUG, "Successfully recv WNM-Sleep Response "
+-- 
+2.7.4
+
+From b372ab0b7daea719749194dc554b26e6367603f2 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Fri, 22 Sep 2017 12:06:37 +0300
+Subject: [PATCH 8/8] FT: Do not allow multiple Reassociation Response frames
+
+The driver is expected to not report a second association event without
+the station having explicitly request a new association. As such, this
+case should not be reachable. However, since reconfiguring the same
+pairwise or group keys to the driver could result in nonce reuse issues,
+be extra careful here and do an additional state check to avoid this
+even if the local driver ends up somehow accepting an unexpected
+Reassociation Response frame.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/rsn_supp/wpa.c    | 3 +++
+ src/rsn_supp/wpa_ft.c | 8 ++++++++
+ src/rsn_supp/wpa_i.h  | 1 +
+ 3 files changed, 12 insertions(+)
+
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 0550a41..2a53c6f 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -2440,6 +2440,9 @@ void wpa_sm_notify_disassoc(struct wpa_sm *sm)
+ #ifdef CONFIG_TDLS
+ 	wpa_tdls_disassoc(sm);
+ #endif /* CONFIG_TDLS */
++#ifdef CONFIG_IEEE80211R
++	sm->ft_reassoc_completed = 0;
++#endif /* CONFIG_IEEE80211R */
+ 
+ 	/* Keys are not needed in the WPA state machine anymore */
+ 	wpa_sm_drop_sa(sm);
+diff --git a/src/rsn_supp/wpa_ft.c b/src/rsn_supp/wpa_ft.c
+index 205793e..d45bb45 100644
+--- a/src/rsn_supp/wpa_ft.c
++++ b/src/rsn_supp/wpa_ft.c
+@@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
+ 	u16 capab;
+ 
+ 	sm->ft_completed = 0;
++	sm->ft_reassoc_completed = 0;
+ 
+ 	buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
+ 		2 + sm->r0kh_id_len + ric_ies_len + 100;
+@@ -681,6 +682,11 @@ int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
+ 		return -1;
+ 	}
+ 
++	if (sm->ft_reassoc_completed) {
++		wpa_printf(MSG_DEBUG, "FT: Reassociation has already been completed for this FT protocol instance - ignore unexpected retransmission");
++		return 0;
++	}
++
+ 	if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) {
+ 		wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
+ 		return -1;
+@@ -781,6 +787,8 @@ int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
+ 		return -1;
+ 	}
+ 
++	sm->ft_reassoc_completed = 1;
++
+ 	if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0)
+ 		return -1;
+ 
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index 41f371f..56f88dc 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -128,6 +128,7 @@ struct wpa_sm {
+ 	size_t r0kh_id_len;
+ 	u8 r1kh_id[FT_R1KH_ID_LEN];
+ 	int ft_completed;
++	int ft_reassoc_completed;
+ 	int over_the_ds_in_progress;
+ 	u8 target_ap[ETH_ALEN]; /* over-the-DS target AP */
+ 	int set_ptk_after_assoc;
+-- 
+2.7.4
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.5.bb b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.5.bb
deleted file mode 100644
index a4160e1..0000000
--- a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.5.bb
+++ /dev/null
@@ -1,113 +0,0 @@
-SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
-HOMEPAGE = "http://w1.fi/wpa_supplicant/"
-BUGTRACKER = "http://w1.fi/security/"
-SECTION = "network"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=36b27801447e0662ee0138d17fe93880 \
-                    file://README;beginline=1;endline=56;md5=7f393579f8b109fe91f3b9765d26c7d3 \
-                    file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=3430fda79f2ba1dd545f0b3c4d6e4d24"
-DEPENDS = "dbus libnl"
-RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
-
-PACKAGECONFIG ??= "gnutls"
-PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt"
-PACKAGECONFIG[openssl] = ",,openssl"
-
-inherit systemd
-
-SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service wpa_supplicant-nl80211@.service wpa_supplicant-wired@.service"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz  \
-           file://defconfig \
-           file://wpa-supplicant.sh \
-           file://wpa_supplicant.conf \
-           file://wpa_supplicant.conf-sane \
-           file://99_wpa_supplicant \
-           file://0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch \
-           file://0002-Remove-newlines-from-wpa_supplicant-config-network-o.patch \
-           file://0001-Reject-psk-parameter-set-with-invalid-passphrase-cha.patch \
-           file://0002-Reject-SET_CRED-commands-with-newline-characters-in-.patch \
-           file://0003-Reject-SET-commands-with-newline-characters-in-the-s.patch \
-          "
-SRC_URI[md5sum] = "96ff75c3a514f1f324560a2376f13110"
-SRC_URI[sha256sum] = "cce55bae483b364eae55c35ba567c279be442ed8bab5b80a3c7fb0d057b9b316"
-
-S = "${WORKDIR}/wpa_supplicant-${PV}"
-
-PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
-FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase"
-FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli"
-FILES_${PN} += "${datadir}/dbus-1/system-services/*"
-CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf"
-
-do_configure () {
-	${MAKE} -C wpa_supplicant clean
-	install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config
-	echo "CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
-	echo "DRV_CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
-	
-	if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then
-        	ssl=openssl
-	elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then
-        	ssl=gnutls
-	fi
-	if [ -n "$ssl" ]; then
-        	sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config
-	fi
-
-	# For rebuild
-	rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
-}
-
-export EXTRA_CFLAGS = "${CFLAGS}"
-export BINDIR = "${sbindir}"
-
-do_compile () {
-	unset CFLAGS CPPFLAGS CXXFLAGS
-	sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules
-	oe_runmake -C wpa_supplicant
-}
-
-do_install () {
-	install -d ${D}${sbindir}
-	install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir}
-	install -m 755 wpa_supplicant/wpa_cli        ${D}${sbindir}
-
-	install -d ${D}${bindir}
-	install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir}
-
-	install -d ${D}${docdir}/wpa_supplicant
-	install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
-
-	install -d ${D}${sysconfdir}
-	install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
-
-	install -d ${D}${sysconfdir}/network/if-pre-up.d/
-	install -d ${D}${sysconfdir}/network/if-post-down.d/
-	install -d ${D}${sysconfdir}/network/if-down.d/
-	install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
-	cd ${D}${sysconfdir}/network/ && \
-	ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
-
-	install -d ${D}/${sysconfdir}/dbus-1/system.d
-	install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
-	install -d ${D}/${datadir}/dbus-1/system-services
-	install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
-
-	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-		install -d ${D}/${systemd_unitdir}/system
-		install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system
-	fi
-
-	install -d ${D}/etc/default/volatiles
-	install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
-}
-
-pkg_postinst_wpa-supplicant () {
-	# If we're offline, we don't need to do this.
-	if [ "x$D" = "x" ]; then
-		killall -q -HUP dbus-daemon || true
-	fi
-
-}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.6.bb b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.6.bb
new file mode 100644
index 0000000..d6d4206
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.6.bb
@@ -0,0 +1,111 @@
+SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
+HOMEPAGE = "http://w1.fi/wpa_supplicant/"
+BUGTRACKER = "http://w1.fi/security/"
+SECTION = "network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=292eece3f2ebbaa25608eed8464018a3 \
+                    file://README;beginline=1;endline=56;md5=3f01d778be8f953962388307ee38ed2b \
+                    file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=4061612fc5715696134e3baf933e8aba"
+DEPENDS = "dbus libnl"
+RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
+
+PACKAGECONFIG ??= "gnutls"
+PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt"
+PACKAGECONFIG[openssl] = ",,openssl"
+
+inherit pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service wpa_supplicant-nl80211@.service wpa_supplicant-wired@.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz  \
+           file://defconfig \
+           file://wpa-supplicant.sh \
+           file://wpa_supplicant.conf \
+           file://wpa_supplicant.conf-sane \
+           file://99_wpa_supplicant \
+           file://key-replay-cve-multiple.patch \
+          "
+SRC_URI[md5sum] = "091569eb4440b7d7f2b4276dbfc03c3c"
+SRC_URI[sha256sum] = "b4936d34c4e6cdd44954beba74296d964bc2c9668ecaa5255e499636fe2b1450"
+
+CVE_PRODUCT = "wpa_supplicant"
+
+S = "${WORKDIR}/wpa_supplicant-${PV}"
+
+PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
+FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase"
+FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli"
+FILES_${PN} += "${datadir}/dbus-1/system-services/*"
+CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf"
+
+do_configure () {
+	${MAKE} -C wpa_supplicant clean
+	install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config
+	echo "CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
+	echo "DRV_CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
+	
+	if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then
+        	ssl=openssl
+	elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then
+        	ssl=gnutls
+	fi
+	if [ -n "$ssl" ]; then
+        	sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config
+	fi
+
+	# For rebuild
+	rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
+}
+
+export EXTRA_CFLAGS = "${CFLAGS}"
+export BINDIR = "${sbindir}"
+
+do_compile () {
+	unset CFLAGS CPPFLAGS CXXFLAGS
+	sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules
+	oe_runmake -C wpa_supplicant
+}
+
+do_install () {
+	install -d ${D}${sbindir}
+	install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir}
+	install -m 755 wpa_supplicant/wpa_cli        ${D}${sbindir}
+
+	install -d ${D}${bindir}
+	install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir}
+
+	install -d ${D}${docdir}/wpa_supplicant
+	install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
+
+	install -d ${D}${sysconfdir}
+	install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
+
+	install -d ${D}${sysconfdir}/network/if-pre-up.d/
+	install -d ${D}${sysconfdir}/network/if-post-down.d/
+	install -d ${D}${sysconfdir}/network/if-down.d/
+	install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
+	cd ${D}${sysconfdir}/network/ && \
+	ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
+
+	install -d ${D}/${sysconfdir}/dbus-1/system.d
+	install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
+	install -d ${D}/${datadir}/dbus-1/system-services
+	install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		install -d ${D}/${systemd_unitdir}/system
+		install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system
+	fi
+
+	install -d ${D}/etc/default/volatiles
+	install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
+}
+
+pkg_postinst_wpa-supplicant () {
+	# If we're offline, we don't need to do this.
+	if [ "x$D" = "x" ]; then
+		killall -q -HUP dbus-daemon || true
+	fi
+
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/profile b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/profile
index c616616..ceaf15f 100644
--- a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/profile
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/profile
@@ -6,28 +6,29 @@
 test -z "$TERM" && TERM="vt100"	# Basic terminal capab. For screen etc.
 
 if [ "$HOME" = "ROOTHOME" ]; then
-   PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
+	PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
 fi
 if [ "$PS1" ]; then
-# works for bash and ash (no other shells known to be in use here)
-   PS1='\u@\h:\w\$ '
+	# works for bash and ash (no other shells known to be in use here)
+	PS1='\u@\h:\w\$ '
 fi
 
 if [ -d /etc/profile.d ]; then
-  for i in /etc/profile.d/*.sh ; do
-    if [ -f $i -a -r $i ]; then
-      . $i
-    fi
-  done
-  unset i
+	for i in /etc/profile.d/*.sh; do
+		if [ -f $i -a -r $i ]; then
+			. $i
+		fi
+	done
+	unset i
 fi
 
-if [ -x /usr/bin/resize ] && termpath="`tty`"; then
-  # Make sure we are on a serial console (i.e. the device used starts with /dev/tty),
-  # otherwise we confuse e.g. the eclipse launcher which tries do use ssh
-  case "$termpath" in
-  /dev/tty[A-z]*) resize >/dev/null
-  esac
+if command -v resize >/dev/null && command -v tty >/dev/null; then
+	# Make sure we are on a serial console (i.e. the device used starts with
+	# /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which
+	# tries do use ssh
+	case $(tty) in
+		/dev/tty[A-z]*) resize >/dev/null;;
+	esac
 fi
 
 export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files_3.0.14.bb b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files_3.0.14.bb
index 5333110..ca7bf06 100644
--- a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -32,8 +32,9 @@
 docdir_append = "/${P}"
 dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
 dirs2775 = ""
-dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
-           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
+dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
+           ${sysconfdir} ${sysconfdir}/default \
+           ${sysconfdir}/skel ${nonarch_base_libdir} /mnt /proc ${ROOT_HOME} /run \
            ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
            ${libdir} ${sbindir} ${datadir} \
            ${datadir}/common-licenses ${datadir}/dict ${infodir} \
@@ -127,10 +128,6 @@
 	install -m 0644 ${WORKDIR}/host.conf ${D}${sysconfdir}/host.conf
 	install -m 0644 ${WORKDIR}/motd ${D}${sysconfdir}/motd
 
-	if [ "/usr/bin" != "${bindir}" ]; then
-		sed -i "s,/usr/bin/resize,${bindir}/resize," ${D}${sysconfdir}/profile
-	fi
-
 	ln -sf /proc/mounts ${D}${sysconfdir}/mtab
 }
 
@@ -145,8 +142,9 @@
 		printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
 		printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net
 		if [ -n "${DISTRO_VERSION}" ]; then
-			printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue
-			printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net
+			distro_version_nodate=${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot').replace('${DATE}','')}
+			printf "%s " $distro_version_nodate >> ${D}${sysconfdir}/issue
+			printf "%s " $distro_version_nodate >> ${D}${sysconfdir}/issue.net
 		fi
 		printf "\\\n \\\l\n" >> ${D}${sysconfdir}/issue
 		echo >> ${D}${sysconfdir}/issue
@@ -154,6 +152,7 @@
 		echo >> ${D}${sysconfdir}/issue.net
  	fi
 }
+do_install_basefilesissue[vardepsexclude] += "DATE"
 
 do_install_append_linuxstdbase() {
 	for d in ${dirs755-lsb}; do
@@ -173,5 +172,5 @@
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname', True) != '')]} ${sysconfdir}/shells"
+CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname') != '')]} ${sysconfdir}/shells"
 CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile"
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
index 10457b2..c6be1c1 100644
--- a/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -23,8 +23,6 @@
 
 inherit autotools
 
-SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst"
-
 do_install () {
 	install -d -m 755 ${D}${sbindir}
 	install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/
@@ -45,23 +43,32 @@
 	install -p -m 644 ${S}/debian/copyright ${D}${docdir}/${BPN}/
 }
 
-base_passwd_sstate_postinst() {
-	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
-	then
-		# Staging does not copy ${sysconfdir} files into the
-		# target sysroot, so we need to do so manually. We
-		# put these files in the target sysroot so they can
-		# be used by recipes which use custom user/group
-		# permissions.
-		# Install passwd.master and group.master to sysconfdir and mv
-		# them to make sure they are atomically install.
-		install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
-		for i in passwd group; do
-			install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/$i.master \
-				${STAGING_DIR_TARGET}${sysconfdir}/
-			mv ${STAGING_DIR_TARGET}${sysconfdir}/$i.master ${STAGING_DIR_TARGET}${sysconfdir}/$i
-		done
+basepasswd_sysroot_postinst() {
+#!/bin/sh
+
+# Install passwd.master and group.master to sysconfdir
+install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
+for i in passwd group; do
+	install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/\$i.master \
+		${STAGING_DIR_TARGET}${sysconfdir}/\$i
+done
+
+# Run any useradd postinsts
+for script in ${STAGING_DIR_TARGET}${bindir}/postinst-useradd-*; do
+	if [ -f \$script ]; then
+		\$script
 	fi
+done
+}
+
+SYSROOT_DIRS += "${sysconfdir}"
+SYSROOT_PREPROCESS_FUNCS += "base_passwd_tweaksysroot"
+
+base_passwd_tweaksysroot () {
+	mkdir -p ${SYSROOT_DESTDIR}${bindir}
+	dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}
+	echo "${basepasswd_sysroot_postinst}" > $dest
+	chmod 0755 $dest
 }
 
 python populate_packages_prepend() {
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox.inc b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox.inc
index b2f1960..adc6e9a 100644
--- a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox.inc
@@ -18,7 +18,6 @@
 export EXTRA_CFLAGS = "${CFLAGS}"
 export EXTRA_LDFLAGS = "${LDFLAGS}"
 
-# We don't want '-e MAKEFLAGS=' in EXTRA_OEMAKE
 EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC}' HOSTCPP='${BUILD_CPP}'"
 
 PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
@@ -63,8 +62,8 @@
 def features_to_busybox_settings(d):
 	cnf, rem = ([], [])
 	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IPV6', cnf, rem)
-	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_LFS', cnf, rem)
-	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem)
+	busybox_cfg(True, 'CONFIG_LFS', cnf, rem)
+	busybox_cfg(True, 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem)
 	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'nls', True, False, d), 'CONFIG_LOCALE_SUPPORT', cnf, rem)
 	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv4', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
 	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
@@ -141,6 +140,10 @@
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
 	if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
 	# split the .config into two parts, and make two busybox binaries
+		if [ -e .config.orig ]; then
+			# Need to guard again an interrupted do_compile - restore any backup
+			cp .config.orig .config
+		fi
 		cp .config .config.orig
 		oe_runmake busybox.cfg.suid
 		oe_runmake busybox.cfg.nosuid
@@ -331,21 +334,21 @@
 
 python () {
     if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-        pn = d.getVar('PN', True)
+        pn = d.getVar('PN')
         d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-init')
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir', True)))
-        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir')))
+        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir'), d.getVar('BPN')))
         d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-startup-conf')
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-startup-conf', '%s/syslog-startup.conf' % (d.getVar('sysconfdir', True)))
-        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-startup-conf', '%s/syslog-startup.conf.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-startup-conf', '%s/syslog-startup.conf' % (d.getVar('sysconfdir')))
+        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-startup-conf', '%s/syslog-startup.conf.%s' % (d.getVar('sysconfdir'), d.getVar('BPN')))
 }
 
 python do_package_prepend () {
     # We need to load the full set of busybox provides from the /etc/busybox.links
     # Use this to see the update-alternatives with the right information
 
-    dvar = d.getVar('D', True)
-    pn = d.getVar('PN', True)
+    dvar = d.getVar('D')
+    pn = d.getVar('PN')
     def set_alternative_vars(links, target):
         links = d.expand(links)
         target = d.expand(target)
@@ -395,6 +398,9 @@
 			fi
 		done
 	fi
+	if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links*; then
+		grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
+	fi
 }
 
 pkg_prerm_${PN} () {
@@ -419,6 +425,12 @@
 	export PATH=$PATH:$tmpdir
 }
 
+pkg_postrm_${PN} () {
+	if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links* && [ ! -e $D${base_bindir}/bash ]; then
+		printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+	fi
+}
+
 pkg_prerm_${PN}-syslog () {
 	# remove syslog
 	if test "x$D" = "x"; then
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/0001-ip-fix-an-improper-optimization-req.r.rtm_scope-may-.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/0001-ip-fix-an-improper-optimization-req.r.rtm_scope-may-.patch
new file mode 100644
index 0000000..812a507
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/0001-ip-fix-an-improper-optimization-req.r.rtm_scope-may-.patch
@@ -0,0 +1,33 @@
+From 34ecc3b7aefdd6c31e8691bd5485037bbabedbd4 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Sun, 14 Aug 2016 01:30:34 +0200
+Subject: [PATCH] ip: fix an improper optimization: req.r.rtm_scope may be
+ nonzero here
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+
+ networking/libiproute/iproute.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
+index e674e9a0d..48dc6e3d9 100644
+--- a/networking/libiproute/iproute.c
++++ b/networking/libiproute/iproute.c
+@@ -362,10 +362,9 @@ IF_FEATURE_IP_RULE(ARG_table,)
+ 		req.r.rtm_scope = RT_SCOPE_NOWHERE;
+ 
+ 	if (cmd != RTM_DELROUTE) {
++		req.r.rtm_scope = RT_SCOPE_UNIVERSE;
+ 		if (RTPROT_BOOT != 0)
+ 			req.r.rtm_protocol = RTPROT_BOOT;
+-		if (RT_SCOPE_UNIVERSE != 0)
+-			req.r.rtm_scope = RT_SCOPE_UNIVERSE;
+ 		if (RTN_UNICAST != 0)
+ 			req.r.rtm_type = RTN_UNICAST;
+ 	}
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/0001-iproute-support-scope-.-Closes-8561.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/0001-iproute-support-scope-.-Closes-8561.patch
new file mode 100644
index 0000000..66bc76e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/0001-iproute-support-scope-.-Closes-8561.patch
@@ -0,0 +1,122 @@
+From ce4bc1ed048233e89ee4cb95830bf6f01d523d1e Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Wed, 30 Dec 2015 17:32:51 +0100
+Subject: [PATCH] iproute: support "scope". Closes 8561
+
+function                                             old     new   delta
+iproute_modify                                      1051    1120     +69
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+
+Upstream-Status: Backport
+Modified patch to build against busybox 1.24.1:
+- s/invarg_1_to_2/invarg
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+---
+ networking/libiproute/iproute.c | 52 ++++++++++++++++++++++++++---------------
+ 1 file changed, 33 insertions(+), 19 deletions(-)
+
+diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
+index d232ee6fd..82827488f 100644
+--- a/networking/libiproute/iproute.c
++++ b/networking/libiproute/iproute.c
+@@ -313,12 +313,13 @@ static int FAST_FUNC print_route(const struct sockaddr_nl *who UNUSED_PARAM,
+ static int iproute_modify(int cmd, unsigned flags, char **argv)
+ {
+ 	static const char keywords[] ALIGN1 =
+-		"src\0""via\0""mtu\0""lock\0""protocol\0"IF_FEATURE_IP_RULE("table\0")
++		"src\0""via\0""mtu\0""lock\0""scope\0""protocol\0"IF_FEATURE_IP_RULE("table\0")
+ 		"dev\0""oif\0""to\0""metric\0""onlink\0";
+ 	enum {
+ 		ARG_src,
+ 		ARG_via,
+ 		ARG_mtu, PARM_lock,
++		ARG_scope,
+ 		ARG_protocol,
+ IF_FEATURE_IP_RULE(ARG_table,)
+ 		ARG_dev,
+@@ -344,6 +345,7 @@ IF_FEATURE_IP_RULE(ARG_table,)
+ 	unsigned mxlock = 0;
+ 	char *d = NULL;
+ 	smalluint ok = 0;
++	smalluint scope_ok = 0;
+ 	int arg;
+ 
+ 	memset(&req, 0, sizeof(req));
+@@ -352,15 +354,18 @@ IF_FEATURE_IP_RULE(ARG_table,)
+ 	req.n.nlmsg_flags = NLM_F_REQUEST | flags;
+ 	req.n.nlmsg_type = cmd;
+ 	req.r.rtm_family = preferred_family;
+-	if (RT_TABLE_MAIN) /* if it is zero, memset already did it */
++	if (RT_TABLE_MAIN != 0) /* if it is zero, memset already did it */
+ 		req.r.rtm_table = RT_TABLE_MAIN;
+-	if (RT_SCOPE_NOWHERE)
++	if (RT_SCOPE_NOWHERE != 0)
+ 		req.r.rtm_scope = RT_SCOPE_NOWHERE;
+ 
+ 	if (cmd != RTM_DELROUTE) {
+-		req.r.rtm_protocol = RTPROT_BOOT;
+-		req.r.rtm_scope = RT_SCOPE_UNIVERSE;
+-		req.r.rtm_type = RTN_UNICAST;
++		if (RTPROT_BOOT != 0)
++			req.r.rtm_protocol = RTPROT_BOOT;
++		if (RT_SCOPE_UNIVERSE != 0)
++			req.r.rtm_scope = RT_SCOPE_UNIVERSE;
++		if (RTN_UNICAST != 0)
++			req.r.rtm_type = RTN_UNICAST;
+ 	}
+ 
+ 	mxrta->rta_type = RTA_METRICS;
+@@ -393,6 +398,13 @@ IF_FEATURE_IP_RULE(ARG_table,)
+ 			}
+ 			mtu = get_unsigned(*argv, "mtu");
+ 			rta_addattr32(mxrta, sizeof(mxbuf), RTAX_MTU, mtu);
++		} else if (arg == ARG_scope) {
++			uint32_t scope;
++			NEXT_ARG();
++			if (rtnl_rtscope_a2n(&scope, *argv))
++				invarg(*argv, "scope");
++			req.r.rtm_scope = scope;
++			scope_ok = 1;
+ 		} else if (arg == ARG_protocol) {
+ 			uint32_t prot;
+ 			NEXT_ARG();
+@@ -469,20 +481,22 @@ IF_FEATURE_IP_RULE(ARG_table,)
+ 		addattr_l(&req.n, sizeof(req), RTA_METRICS, RTA_DATA(mxrta), RTA_PAYLOAD(mxrta));
+ 	}
+ 
+-	if (req.r.rtm_type == RTN_LOCAL || req.r.rtm_type == RTN_NAT)
+-		req.r.rtm_scope = RT_SCOPE_HOST;
+-	else
+-	if (req.r.rtm_type == RTN_BROADCAST
+-	 || req.r.rtm_type == RTN_MULTICAST
+-	 || req.r.rtm_type == RTN_ANYCAST
+-	) {
+-		req.r.rtm_scope = RT_SCOPE_LINK;
+-	}
+-	else if (req.r.rtm_type == RTN_UNICAST || req.r.rtm_type == RTN_UNSPEC) {
+-		if (cmd == RTM_DELROUTE)
+-			req.r.rtm_scope = RT_SCOPE_NOWHERE;
+-		else if (!(ok & gw_ok))
++	if (!scope_ok) {
++		if (req.r.rtm_type == RTN_LOCAL || req.r.rtm_type == RTN_NAT)
++			req.r.rtm_scope = RT_SCOPE_HOST;
++		else
++		if (req.r.rtm_type == RTN_BROADCAST
++		 || req.r.rtm_type == RTN_MULTICAST
++		 || req.r.rtm_type == RTN_ANYCAST
++		) {
+ 			req.r.rtm_scope = RT_SCOPE_LINK;
++		}
++		else if (req.r.rtm_type == RTN_UNICAST || req.r.rtm_type == RTN_UNSPEC) {
++			if (cmd == RTM_DELROUTE)
++				req.r.rtm_scope = RT_SCOPE_NOWHERE;
++			else if (!(ok & gw_ok))
++				req.r.rtm_scope = RT_SCOPE_LINK;
++		}
+ 	}
+ 
+ 	if (req.r.rtm_family == AF_UNSPEC) {
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/CVE-2016-2147_2.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/CVE-2016-2147_2.patch
index 1473d46..b8349c0 100644
--- a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/CVE-2016-2147_2.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/CVE-2016-2147_2.patch
@@ -4,7 +4,7 @@
 Subject: [PATCH] udhcpc: fix a warning in debug code
 
 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-Upsteam-Status: Backport
+Upstream-Status: Backport
 CVE: CVE-2016-2147 regression fix
 
 https://git.busybox.net/busybox/commit/?id=1b7c17
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-tar-add-IF_FEATURE_-checks.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-tar-add-IF_FEATURE_-checks.patch
new file mode 100644
index 0000000..0c3c9c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-tar-add-IF_FEATURE_-checks.patch
@@ -0,0 +1,70 @@
+From f94412f6bb49136694c5478d0aecb19118d1b08d Mon Sep 17 00:00:00 2001
+From: Ming Liu <peter.x.liu@external.atlascopco.com>
+Date: Wed, 31 May 2017 11:48:09 +0200
+Subject: [PATCH] tar: add IF_FEATURE_* checks
+
+A following linking error was observed:
+| ==========
+| archival/lib.a(tar.o): In function `tar_main':
+| archival/tar.c:1168: undefined reference to `unpack_Z_stream'
+| archival/tar.c:1168: undefined reference to `unpack_Z_stream'
+| ld: busybox_unstripped: hidden symbol `unpack_Z_stream' isn't defined
+| ld: final link failed: Bad value
+
+this happened with clang compiler, with the following configs:
+| CONFIG_TAR=y
+| # CONFIG_FEATURE_SEAMLESS_Z is not set
+
+which can be fixed by adding IF_FEATURE_* checks in.
+
+Upstream-Status: Pending [ Sent to busybox upstream on 2017-06-02 ]
+
+Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
+---
+ archival/tar.c | 25 +++++++++++++++----------
+ 1 file changed, 15 insertions(+), 10 deletions(-)
+
+diff --git a/archival/tar.c b/archival/tar.c
+index b70e00a..7598b71 100644
+--- a/archival/tar.c
++++ b/archival/tar.c
+@@ -1216,21 +1216,26 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
+ 		USE_FOR_MMU(IF_DESKTOP(long long) int FAST_FUNC (*xformer)(transformer_state_t *xstate);)
+ 		USE_FOR_NOMMU(const char *xformer_prog;)
+ 
+-		if (opt & OPT_COMPRESS)
+-			USE_FOR_MMU(xformer = unpack_Z_stream;)
++		if (opt & OPT_COMPRESS) {
++			USE_FOR_MMU(IF_FEATURE_SEAMLESS_Z(xformer = unpack_Z_stream;))
+ 			USE_FOR_NOMMU(xformer_prog = "uncompress";)
+-		if (opt & OPT_GZIP)
+-			USE_FOR_MMU(xformer = unpack_gz_stream;)
++		}
++		if (opt & OPT_GZIP) {
++			USE_FOR_MMU(IF_FEATURE_SEAMLESS_GZ(xformer = unpack_gz_stream;))
+ 			USE_FOR_NOMMU(xformer_prog = "gunzip";)
+-		if (opt & OPT_BZIP2)
+-			USE_FOR_MMU(xformer = unpack_bz2_stream;)
++		}
++		if (opt & OPT_BZIP2) {
++			USE_FOR_MMU(IF_FEATURE_SEAMLESS_BZ2(xformer = unpack_bz2_stream;))
+ 			USE_FOR_NOMMU(xformer_prog = "bunzip2";)
+-		if (opt & OPT_LZMA)
+-			USE_FOR_MMU(xformer = unpack_lzma_stream;)
++		}
++		if (opt & OPT_LZMA) {
++			USE_FOR_MMU(IF_FEATURE_SEAMLESS_LZMA(xformer = unpack_lzma_stream;))
+ 			USE_FOR_NOMMU(xformer_prog = "unlzma";)
+-		if (opt & OPT_XZ)
+-			USE_FOR_MMU(xformer = unpack_xz_stream;)
++		}
++		if (opt & OPT_XZ) {
++			USE_FOR_MMU(IF_FEATURE_SEAMLESS_XZ(xformer = unpack_xz_stream;))
+ 			USE_FOR_NOMMU(xformer_prog = "unxz";)
++		}
+ 
+ 		fork_transformer_with_sig(tar_handle->src_fd, xformer, xformer_prog);
+ 		/* Can't lseek over pipes */
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/defconfig b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/defconfig
index c0459d5..8803b52 100644
--- a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/defconfig
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/defconfig
@@ -279,7 +279,7 @@
 # CONFIG_SHA3SUM is not set
 CONFIG_SLEEP=y
 CONFIG_FEATURE_FANCY_SLEEP=y
-# CONFIG_FEATURE_FLOAT_SLEEP is not set
+CONFIG_FEATURE_FLOAT_SLEEP=y
 CONFIG_SORT=y
 CONFIG_FEATURE_SORT_BIG=y
 # CONFIG_SPLIT is not set
@@ -582,7 +582,7 @@
 # CONFIG_FDFLUSH is not set
 # CONFIG_FDFORMAT is not set
 CONFIG_FDISK=y
-# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set
+CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
 CONFIG_FEATURE_FDISK_WRITABLE=y
 # CONFIG_FEATURE_AIX_LABEL is not set
 # CONFIG_FEATURE_SGI_LABEL is not set
@@ -981,6 +981,10 @@
 # CONFIG_ENVUIDGID is not set
 # CONFIG_ENVDIR is not set
 # CONFIG_SOFTLIMIT is not set
+
+#
+#  SELinux utilities
+#
 # CONFIG_CHCON is not set
 # CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
 # CONFIG_GETENFORCE is not set
@@ -1010,7 +1014,7 @@
 CONFIG_ASH_BUILTIN_PRINTF=y
 CONFIG_ASH_BUILTIN_TEST=y
 CONFIG_ASH_HELP=y
-# CONFIG_ASH_CMDCMD is not set
+CONFIG_ASH_CMDCMD=y
 # CONFIG_ASH_MAIL is not set
 CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
 # CONFIG_ASH_RANDOM_SUPPORT is not set
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_1.24.1.bb b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_1.24.1.bb
index 400cdfe..6ccbffd 100644
--- a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_1.24.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_1.24.1.bb
@@ -38,8 +38,8 @@
            file://sha256sum.cfg \
            file://getopts.cfg \
            file://resize.cfg \
-           ${@["", "file://init.cfg"][(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'busybox')]} \
-           ${@["", "file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager', True) == 'busybox-mdev')]} \
+           ${@["", "file://init.cfg"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]} \
+           ${@["", "file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager') == 'busybox-mdev')]} \
            file://inittab \
            file://rcS \
            file://rcK \
@@ -57,6 +57,9 @@
            file://0001-libiproute-handle-table-ids-larger-than-255.patch \
            file://ifupdown-pass-interface-device-name-for-ipv6-route-c.patch \
            file://BUG9071_buffer_overflow_arp.patch \
+           file://busybox-tar-add-IF_FEATURE_-checks.patch \
+           file://0001-iproute-support-scope-.-Closes-8561.patch \
+           file://0001-ip-fix-an-improper-optimization-req.r.rtm_scope-may-.patch \
 "
 SRC_URI_append_libc-musl = " file://musl.cfg "
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_git.bb b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_git.bb
deleted file mode 100644
index c29b894..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_git.bb
+++ /dev/null
@@ -1,52 +0,0 @@
-require busybox.inc
-
-SRCREV = "1b7c17391de66502dd7a97c866e0a33681edbb1f"
-# Lookout for PV bump too when SRCREV is changed
-PV = "1.25.0+git${SRCPV}"
-
-S = "${WORKDIR}/git"
-
-SRC_URI = "git://busybox.net/busybox.git \
-           file://busybox-udhcpc-no_deconfig.patch \
-           file://find-touchscreen.sh \
-           file://busybox-cron \
-           file://busybox-httpd \
-           file://busybox-udhcpd \
-           file://default.script \
-           file://simple.script \
-           file://hwclock.sh \
-           file://mount.busybox \
-           file://syslog \
-           file://syslog-startup.conf \
-           file://syslog.conf \
-           file://busybox-syslog.default \
-           file://mdev \
-           file://mdev.conf \
-           file://mdev-mount.sh \
-           file://umount.busybox \
-           file://defconfig \
-           file://busybox-syslog.service.in \
-           file://busybox-klogd.service.in \
-           file://fail_on_no_media.patch \
-           file://run-ptest \
-           file://inetd.conf \
-           file://inetd \
-           file://login-utilities.cfg \
-           file://recognize_connmand.patch \
-           file://busybox-cross-menuconfig.patch \
-           file://0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch \
-           file://mount-via-label.cfg \
-           file://sha1sum.cfg \
-           file://sha256sum.cfg \
-           file://getopts.cfg \
-           file://resize.cfg \
-           ${@["", "file://init.cfg"][(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'busybox')]} \
-           ${@["", "file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager', True) == 'busybox-mdev')]} \
-           file://inittab \
-           file://rcS \
-           file://rcK \
-           file://runlevel \
-"
-SRC_URI_append_libc-musl = " file://musl.cfg "
-
-DEFAULT_PREFERENCE = "-1"
diff --git a/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch
new file mode 100644
index 0000000..6e72ec6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch
@@ -0,0 +1,57 @@
+Subject: Fix 'format-security' compilation error.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ kbdtools/kbd_mode.c    | 6 +++---
+ kbdtools/setmetamode.c | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/kbdtools/kbd_mode.c b/kbdtools/kbd_mode.c
+index 02dca38..8dbcd39 100644
+--- a/kbdtools/kbd_mode.c
++++ b/kbdtools/kbd_mode.c
+@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
+       /* report mode */
+       if (ioctl(fd, KDGKBMODE, &mode)) 
+ 	{
+-	  fprintf(stderr, progname);
++	  fprintf(stderr, "%s", progname);
+ 	  perror(_(": error reading keyboard mode\n"));
+ 	  exit(1);
+ 	}
+@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
+     kbd_rep.period = rate;
+     if (ioctl(fd, KDKBDREP, &kbd_rep))
+       {
+-	fprintf(stderr, progname);
++	fprintf(stderr, "%s", progname);
+ 	perror(_(": error setting keyboard repeat mode\n"));
+ 	exit(1);
+       }
+@@ -160,7 +160,7 @@ int main(int argc, char *argv[])
+   
+   if (ioctl(fd, KDSKBMODE, mode))
+     {
+-      fprintf(stderr, progname);
++      fprintf(stderr, "%s", progname);
+       perror(_(": error setting keyboard mode\n"));
+       exit(1);
+     }
+diff --git a/kbdtools/setmetamode.c b/kbdtools/setmetamode.c
+index 5bed945..0ba7676 100644
+--- a/kbdtools/setmetamode.c
++++ b/kbdtools/setmetamode.c
+@@ -42,7 +42,7 @@ void report(int meta)
+     default:
+       s = N_("Strange mode for Meta key?\n");
+     }
+-  printf(_(s));
++  printf("%s", _(s));
+ }
+ 
+ struct meta 
+-- 
+2.8.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb
index 1db8414..286c2a4 100644
--- a/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb
@@ -16,6 +16,7 @@
            file://no-dep-on-libfl.patch \
            file://0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch \
            file://0001-Cover-the-else-with-__GLIBC__.patch \
+           file://0001-Fix-format-security-compilation-error.patch \
            file://lcmessage.m4 \
            file://Makevars"
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch
deleted file mode 100644
index 5452b46..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
-
-The package is stated as being Licensed as GPLv2+.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-----
-
-When "cp -i --update old new" would do nothing because "new" is
-newer than "old", cp would nonetheless prompt for whether it is
-ok to overwrite "new".  Then, regardless of the response (because
-of the --update option), cp would do nothing.
-
-The following patch eliminates the unnecessary prompt in that case.
-
-diff --git a/src/copy.c b/src/copy.c
-index b7bf73b..0e549d2 100644
---- a/src/copy.c
-+++ b/src/copy.c
-@@ -1210,6 +1210,30 @@ copy_internal (char const *src_name, char const *dst_name,
- 	      return false;
- 	    }
-
-+	  if (!S_ISDIR (src_mode) && x->update)
-+	    {
-+	      /* When preserving time stamps (but not moving within a file
-+		 system), don't worry if the destination time stamp is
-+		 less than the source merely because of time stamp
-+		 truncation.  */
-+	      int options = ((x->preserve_timestamps
-+			      && ! (x->move_mode
-+				    && dst_sb.st_dev == src_sb.st_dev))
-+			     ? UTIMECMP_TRUNCATE_SOURCE
-+			     : 0);
-+
-+	      if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
-+		{
-+		  /* We're using --update and the destination is not older
-+		     than the source, so do not copy or move.  Pretend the
-+		     rename succeeded, so the caller (if it's mv) doesn't
-+		     end up removing the source file.  */
-+		  if (rename_succeeded)
-+		    *rename_succeeded = true;
-+		  return true;
-+		}
-+	    }
-+
- 	  /* When there is an existing destination file, we may end up
- 	     returning early, and hence not copying/moving the file.
- 	     This may be due to an interactive `negative' reply to the
-@@ -1302,30 +1326,6 @@ copy_internal (char const *src_name, char const *dst_name,
- 		      return false;
- 		    }
- 		}
--
--	      if (x->update)
--		{
--		  /* When preserving time stamps (but not moving within a file
--		     system), don't worry if the destination time stamp is
--		     less than the source merely because of time stamp
--		     truncation.  */
--		  int options = ((x->preserve_timestamps
--				  && ! (x->move_mode
--					&& dst_sb.st_dev == src_sb.st_dev))
--				 ? UTIMECMP_TRUNCATE_SOURCE
--				 : 0);
--
--		  if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
--		    {
--		      /* We're using --update and the destination is not older
--			 than the source, so do not copy or move.  Pretend the
--			 rename succeeded, so the caller (if it's mv) doesn't
--			 end up removing the source file.  */
--		      if (rename_succeeded)
--			*rename_succeeded = true;
--		      return true;
--		    }
--		}
- 	    }
-
- 	  if (x->move_mode)
-diff --git a/tests/mv/update b/tests/mv/update
-index 0c06024..6c3d149 100755
---- a/tests/mv/update
-+++ b/tests/mv/update
-@@ -1,7 +1,7 @@
- #!/bin/sh
- # make sure --update works as advertised
-
--# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
-+# Copyright (C) 2001, 2004, 2006-2007 Free Software Foundation, Inc.
-
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
-@@ -46,11 +46,16 @@ fi
-
- fail=0
-
--for cp_or_mv in cp mv; do
--  # This is a no-op.
--  $cp_or_mv --update old new || fail=1
--  case "`cat new`" in new) ;; *) fail=1 ;; esac
--  case "`cat old`" in old) ;; *) fail=1 ;; esac
-+for interactive in '' -i; do
-+  for cp_or_mv in cp mv; do
-+    # This is a no-op, with no prompt.
-+    # With coreutils-6.9 and earlier, using --update with -i would
-+    # mistakenly elicit a prompt.
-+    $cp_or_mv $interactive --update old new < /dev/null > out 2>&1 || fail=1
-+    test -s out && fail=1
-+    case "`cat new`" in new) ;; *) fail=1 ;; esac
-+    case "`cat old`" in old) ;; *) fail=1 ;; esac
-+  done
- done
-
- # This will actually perform the rename.
---
-1.5.3.rc1.16.g9d6f
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
deleted file mode 100644
index 88f61fa..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-The install command doesn't over write the dangling symlink, for
-example:
-
-$ install fileA /tmp/fileA
-
-If /tmp/fileA is a dangling symlink, there would be an error:
-
-install: cannot create regular file '/tmp/fileA': File exists
-
-This is because of the following code in copy.c:
-
-  if (!new_dst)
-    {
-      if (XSTAT (x, dst_name, &dst_sb) != 0)
-        {
-          if (errno != ENOENT)
-            {
-              error (0, errno, _("cannot stat %s"), quote (dst_name));
-              return false;
-            }
-          else
-            {
-              new_dst = true;
-            }
-        }
-
-XSTAT() use stat() for dst_name(the dangling symlink /tmp/fileA) when
-install.c invokes it, and stat will set errno to ENOENT, and then
-new_dst will be set to true which means that /tmp/fileA doesn't exist,
-then we will create /tmp/fileA without remove it first, so the error
-comes.
-
-This is fixed in a way which adds the member cmd_install in
-struct cp_options to make sure my change only affected to the install
-command and use lstat to fix the problem.
-    
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
----
- src/copy.c    |   10 +++++++++-
- src/copy.h    |    3 +++
- src/install.c |    1 +
- 3 files changed, 13 insertions(+), 1 deletions(-)
-
-diff --git a/src/copy.c b/src/copy.c
---- a/src/copy.c
-+++ b/src/copy.c
-@@ -1029,6 +1029,7 @@ copy_internal (char const *src_name, char const *dst_name,
-   bool delayed_ok;
-   bool copied_as_regular = false;
-   bool preserve_metadata;
-+  int dst_stat_result;
- 
-   if (x->move_mode && rename_succeeded)
-     *rename_succeeded = false;
-@@ -1069,7 +1070,14 @@ copy_internal (char const *src_name, char const *dst_name,
- 
-   if (!new_dst)
-     {
--      if (XSTAT (x, dst_name, &dst_sb) != 0)
-+      if ( x->cmd_install && ( x->backup_type == no_backups))
-+        dst_stat_result = lstat (dst_name, &dst_sb);
-+      else
-+        {
-+          dst_stat_result = XSTAT (x, dst_name, &dst_sb);
-+        }
-+
-+      if (dst_stat_result != 0)
- 	{
- 	  if (errno != ENOENT)
- 	    {
-diff --git a/src/copy.h b/src/copy.h
---- a/src/copy.h
-+++ b/src/copy.h
-@@ -114,6 +114,9 @@ struct cp_options
-      If that fails, then resort to copying.  */
-   bool move_mode;
- 
-+  /* For the install command */
-+  bool cmd_install;
-+
-   /* Whether this process has appropriate privileges to chown a file
-      whose owner is not the effective user ID.  */
-   bool chown_privileges;
-diff --git a/src/install.c b/src/install.c
---- a/src/install.c
-+++ b/src/install.c
-@@ -149,6 +149,7 @@ cp_option_init (struct cp_options *x)
-   x->hard_link = false;
-   x->interactive = I_UNSPECIFIED;
-   x->move_mode = false;
-+  x->cmd_install = true;
-   x->chown_privileges = chown_privileges ();
-   x->one_file_system = false;
-   x->preserve_ownership = false;
--- 
-1.7.0.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch
deleted file mode 100644
index 3ae5a2f..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch
+++ /dev/null
@@ -1,375 +0,0 @@
-From 170be4023bbf9e9698a709e03265945588ac8e01 Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Tue, 26 Nov 2013 00:21:50 +0800
-Subject: [PATCH] doc/coreutils.texi: Use '@item' instead of '@itemx'
-
-Use '@item' instead of '@itemx' in several places, as Texinfo 5 refuses
-to process an '@itemx' that is not preceded by an '@item'.  Ensure that
-node extended names in menus and sectioning are consistent, and that
-ordering and presence of nodes in menus and in the actual text are
-consistent as well.
-
-Upstream-Status: Backport [From: coreutils.7620.n7.nabble.com, bug#11828]
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- doc/coreutils.texi | 82 +++++++++++++++++++++++++++---------------------------
- 1 file changed, 41 insertions(+), 41 deletions(-)
-
-diff --git a/doc/coreutils.texi b/doc/coreutils.texi
-index 588147f..2dae3fe 100644
---- a/doc/coreutils.texi
-+++ b/doc/coreutils.texi
-@@ -555,7 +555,7 @@ symbolic link to a directory.  @xref{Target directory}.
- @end macro
- 
- @macro optSi
--@itemx --si
-+@item --si
- @opindex --si
- @cindex SI output
- Append an SI-style abbreviation to each size, such as @samp{M} for
-@@ -578,7 +578,7 @@ Use the @option{--si} option if you prefer powers of 1000.
- @end macro
- 
- @macro optStripTrailingSlashes
--@itemx @w{@kbd{--strip-trailing-slashes}}
-+@item @w{@kbd{--strip-trailing-slashes}}
- @opindex --strip-trailing-slashes
- @cindex stripping trailing slashes
- Remove any trailing slashes from each @var{source} argument.
-@@ -2496,7 +2496,7 @@ by 1048576.
- However, if @var{n} starts with a @samp{-},
- print all but the last @var{n} bytes of each file.
- 
--@itemx -n @var{n}
-+@item -n @var{n}
- @itemx --lines=@var{n}
- @opindex -n
- @opindex --lines
-@@ -2633,7 +2633,7 @@ This option is the same as @option{--follow=name --retry}.  That is, tail
- will attempt to reopen a file when it is removed.  Should this fail, tail
- will keep trying until it becomes accessible again.
- 
--@itemx --retry
-+@item --retry
- @opindex --retry
- This option is useful mainly when following by name (i.e., with
- @option{--follow=name}).
-@@ -2641,7 +2641,7 @@ Without this option, when tail encounters a file that doesn't
- exist or is otherwise inaccessible, it reports that fact and
- never checks it again.
- 
--@itemx --sleep-interval=@var{number}
-+@item --sleep-interval=@var{number}
- @opindex --sleep-interval
- Change the number of seconds to wait between iterations (the default is 1.0).
- During one iteration, every specified file is checked to see if it has
-@@ -2651,7 +2651,7 @@ Historical implementations of @command{tail} have required that
- an arbitrary floating point number (using a period before any
- fractional digits).
- 
--@itemx --pid=@var{pid}
-+@item --pid=@var{pid}
- @opindex --pid
- When following by name or by descriptor, you may specify the process ID,
- @var{pid}, of the sole writer of all @var{file} arguments.  Then, shortly
-@@ -2674,7 +2674,7 @@ terminate until long after the real writer has terminated.
- Note that @option{--pid} cannot be supported on some systems; @command{tail}
- will print a warning if this is the case.
- 
--@itemx --max-unchanged-stats=@var{n}
-+@item --max-unchanged-stats=@var{n}
- @opindex --max-unchanged-stats
- When tailing a file by name, if there have been @var{n} (default
- n=@value{DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS}) consecutive
-@@ -2686,7 +2686,7 @@ number of seconds between when tail prints the last pre-rotation lines
- and when it prints the lines that have accumulated in the new log file.
- This option is meaningful only when following by name.
- 
--@itemx -n @var{n}
-+@item -n @var{n}
- @itemx --lines=@var{n}
- @opindex -n
- @opindex --lines
-@@ -2817,7 +2817,7 @@ option.
- @opindex --numeric-suffixes
- Use digits in suffixes rather than lower-case letters.
- 
--@itemx --verbose
-+@item --verbose
- @opindex --verbose
- Write a diagnostic to standard error just before each output file is opened.
- 
-@@ -3055,7 +3055,7 @@ Print only the newline counts.
- @opindex --max-line-length
- Print only the maximum line lengths.
- 
--@itemx --files0-from=@var{FILE}
-+@item --files0-from=@var{FILE}
- @opindex --files0-from=@var{FILE}
- @cindex including files from @command{du}
- Rather than processing files named on the command line, process those
-@@ -3250,7 +3250,7 @@ an MD5 checksum inconsistent with the associated file, or if no valid
- line is found, @command{md5sum} exits with nonzero status.  Otherwise,
- it exits successfully.
- 
--@itemx --status
-+@item --status
- @opindex --status
- @cindex verifying MD5 checksums
- This option is useful only when verifying checksums.
-@@ -5837,7 +5837,7 @@ command line unless the @option{--dereference-command-line} (@option{-H}),
- If a command line argument specifies a symbolic link, show information
- for the file the link references rather than for the link itself.
- 
--@itemx --dereference-command-line-symlink-to-dir
-+@item --dereference-command-line-symlink-to-dir
- @opindex --dereference-command-line-symlink-to-dir
- @cindex symbolic links, dereferencing
- Do not dereference symbolic links, with one exception:
-@@ -7015,15 +7015,15 @@ If specified, the @var{attribute_list} must be a comma-separated list
- of one or more of the following strings:
- 
- @table @samp
--@itemx mode
-+@item mode
- Preserve the file mode bits and access control lists.
--@itemx ownership
-+@item ownership
- Preserve the owner and group.  On most modern systems,
- only users with appropriate privileges may change the owner of a file,
- and ordinary users
- may preserve the group ownership of a file only if they happen to be
- a member of the desired group.
--@itemx timestamps
-+@item timestamps
- Preserve the times of last access and last modification, when possible.
- In general, it is not possible to preserve these attributes
- when the affected file is a symbolic link.
-@@ -7031,12 +7031,12 @@ However, FreeBSD now provides the @code{lutimes} function, which makes
- it possibile even for symbolic links.  However, this implementation does
- not yet take advantage of that.
- @c FIXME: once we provide lutimes support, update the above.
--@itemx links
-+@item links
- Preserve in the destination files
- any links between corresponding source files.
- @c Give examples illustrating how hard links are preserved.
- @c Also, show how soft links map to hard links with -L and -H.
--@itemx all
-+@item all
- Preserve all file attributes.
- Equivalent to specifying all of the above.
- @end table
-@@ -7049,12 +7049,12 @@ mode bits of the corresponding source file, minus the bits set in the
- umask and minus the set-user-ID and set-group-ID bits.
- @xref{File permissions}.
- 
--@itemx @w{@kbd{--no-preserve}=@var{attribute_list}}
-+@item @w{@kbd{--no-preserve}=@var{attribute_list}}
- @cindex file information, preserving
- Do not preserve the specified attributes.  The @var{attribute_list}
- has the same form as for @option{--preserve}.
- 
--@itemx --parents
-+@item --parents
- @opindex --parents
- @cindex parent directories and @command{cp}
- Form the name of each destination file by appending to the target
-@@ -7070,7 +7070,7 @@ cp --parents a/b/c existing_dir
- copies the file @file{a/b/c} to @file{existing_dir/a/b/c}, creating
- any missing intermediate directories.
- 
--@itemx @w{@kbd{--reply}=@var{how}}
-+@item @w{@kbd{--reply}=@var{how}}
- @opindex --reply
- @cindex interactivity
- @c FIXME: remove in 2008
-@@ -7742,7 +7742,7 @@ Prompt whether to overwrite each existing destination file, regardless
- of its permissions.
- If the response is not affirmative, the file is skipped.
- 
--@itemx @w{@kbd{--reply}=@var{how}}
-+@item @w{@kbd{--reply}=@var{how}}
- @opindex --reply
- @cindex interactivity
- @c FIXME: remove in 2008
-@@ -7847,7 +7847,7 @@ files are named or if a recursive removal is requested.  Ignore any
- previous @option{--force} (@option{-f}) option.  Equivalent to
- @option{--interactive=once}.
- 
--@itemx --interactive [=@var{when}]
-+@item --interactive [=@var{when}]
- @opindex --interactive
- Specify when to issue an interactive prompt.  @var{when} may be
- omitted, or one of:
-@@ -7866,7 +7866,7 @@ removal is requested.  Equivalent to @option{-I}.
- Specifying @option{--interactive} and no @var{when} is equivalent to
- @option{--interactive=always}.
- 
--@itemx --one-file-system
-+@item --one-file-system
- @opindex --one-file-system
- @cindex one file system, restricting @command{rm} to
- When removing a hierarchy recursively, skip any directory that is on a
-@@ -7884,7 +7884,7 @@ warn about and skip directories on other file systems.
- Of course, this will not save your @file{/home} if it and your
- chroot happen to be on the same file system.
- 
--@itemx --preserve-root
-+@item --preserve-root
- @opindex --preserve-root
- @cindex root directory, disallow recursive destruction
- Fail upon any attempt to remove the root directory, @file{/},
-@@ -7892,7 +7892,7 @@ when used with the @option{--recursive} option.
- This is the default behavior.
- @xref{Treating / specially}.
- 
--@itemx --no-preserve-root
-+@item --no-preserve-root
- @opindex --no-preserve-root
- @cindex root directory, allow recursive destruction
- Do not treat @file{/} specially when removing recursively.
-@@ -8874,7 +8874,7 @@ actually changes.
- Do not print error messages about files whose ownership cannot be
- changed.
- 
--@itemx @w{@kbd{--from}=@var{old-owner}}
-+@item @w{@kbd{--from}=@var{old-owner}}
- @opindex --from
- @cindex symbolic links, changing owner
- Change a @var{file}'s ownership only if it has current attributes specified
-@@ -8928,14 +8928,14 @@ is a symbolic link.
- By default, no diagnostic is issued for symbolic links encountered
- during a recursive traversal, but see @option{--verbose}.
- 
--@itemx --preserve-root
-+@item --preserve-root
- @opindex --preserve-root
- @cindex root directory, disallow recursive modification
- Fail upon any attempt to recursively change the root directory, @file{/}.
- Without @option{--recursive}, this option has no effect.
- @xref{Treating / specially}.
- 
--@itemx --no-preserve-root
-+@item --no-preserve-root
- @opindex --no-preserve-root
- @cindex root directory, allow recursive modification
- Cancel the effect of any preceding @option{--preserve-root} option.
-@@ -9054,14 +9054,14 @@ is a symbolic link.
- By default, no diagnostic is issued for symbolic links encountered
- during a recursive traversal, but see @option{--verbose}.
- 
--@itemx --preserve-root
-+@item --preserve-root
- @opindex --preserve-root
- @cindex root directory, disallow recursive modification
- Fail upon any attempt to recursively change the root directory, @file{/}.
- Without @option{--recursive}, this option has no effect.
- @xref{Treating / specially}.
- 
--@itemx --no-preserve-root
-+@item --no-preserve-root
- @opindex --no-preserve-root
- @cindex root directory, allow recursive modification
- Cancel the effect of any preceding @option{--preserve-root} option.
-@@ -9175,14 +9175,14 @@ actually changes.
- Do not print error messages about files whose permissions cannot be
- changed.
- 
--@itemx --preserve-root
-+@item --preserve-root
- @opindex --preserve-root
- @cindex root directory, disallow recursive modification
- Fail upon any attempt to recursively change the root directory, @file{/}.
- Without @option{--recursive}, this option has no effect.
- @xref{Treating / specially}.
- 
--@itemx --no-preserve-root
-+@item --no-preserve-root
- @opindex --no-preserve-root
- @cindex root directory, allow recursive modification
- Cancel the effect of any preceding @option{--preserve-root} option.
-@@ -9603,7 +9603,7 @@ The program accepts the following options.  Also see @ref{Common options}.
- @opindex --all
- Show counts for all files, not just directories.
- 
--@itemx --apparent-size
-+@item --apparent-size
- @opindex --apparent-size
- Print apparent sizes, rather than disk usage.  The apparent size of a
- file is the number of bytes reported by @code{wc -c} on regular files,
-@@ -9654,7 +9654,7 @@ Does not affect other symbolic links.  This is helpful for finding
- out the disk usage of directories, such as @file{/usr/tmp}, which
- are often symbolic links.
- 
--@itemx --files0-from=@var{FILE}
-+@item --files0-from=@var{FILE}
- @opindex --files0-from=@var{FILE}
- @cindex including files from @command{du}
- Rather than processing files named on the command line, process those
-@@ -9733,7 +9733,7 @@ Output a null byte at the end of each line, rather than a newline.
- This option enables other programs to parse the output of @command{du}
- even when that output would contain file names with embedded newlines.
- 
--@itemx --si
-+@item --si
- @opindex --si
- @cindex SI output
- Append an SI-style abbreviation to each size, such as @samp{MB} for
-@@ -9754,13 +9754,13 @@ Display only a total for each argument.
- Report the size of each directory separately, not including the sizes
- of subdirectories.
- 
--@itemx --time
-+@item --time
- @opindex --time
- @cindex last modified dates, displaying in @command{du}
- Show time of the most recent modification of any file in the directory,
- or any of its subdirectories.
- 
--@itemx --time=ctime
-+@item --time=ctime
- @itemx --time=status
- @itemx --time=use
- @opindex --time
-@@ -9770,7 +9770,7 @@ or any of its subdirectories.
- Show the most recent status change time (the @samp{ctime} in the inode) of
- any file in the directory, instead of the modification time.
- 
--@itemx --time=atime
-+@item --time=atime
- @itemx --time=access
- @opindex --time
- @opindex atime@r{, show the most recent}
-@@ -9911,7 +9911,7 @@ $ stat --format=%d:%i / /usr
- 2057:2
- @end example
- 
--@itemx --printf=@var{format}
-+@item --printf=@var{format}
- @opindex --printf=@var{format}
- @cindex output format
- Use @var{format} rather than the default format.
-@@ -12240,7 +12240,7 @@ Overrides all other options.
- @opindex -s
- Ignored; for compatibility with other versions of @command{who}.
- 
--@itemx -u
-+@item -u
- @opindex -u
- @cindex idle time
- After the login time, print the number of hours and minutes that the
-@@ -12254,7 +12254,7 @@ user has been idle.  @samp{.} means the user was active in the last minute.
- List only the entries that correspond to processes via which the
- system is waiting for a user to login.  The user name is always @samp{LOGIN}.
- 
--@itemx --lookup
-+@item --lookup
- @opindex --lookup
- Attempt to canonicalize hostnames found in utmp through a DNS lookup.  This
- is not the default because it can cause significant delays on systems with
--- 
-1.8.3.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch
deleted file mode 100644
index 6537223..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch
+++ /dev/null
@@ -1,4051 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
-
-The package is stated as being Licensed as GPLv2+.
-
-The comment indicates that the purpose is lin18nux/lsb compliance.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
---- /dev/null	2007-03-01 09:16:39.219409909 +0000
-+++ coreutils-6.8+/tests/sort/sort-mb-tests	2007-03-01 15:08:24.000000000 +0000
-@@ -0,0 +1,58 @@
-+#! /bin/sh
-+case $# in
-+  0) xx='../../src/sort';;
-+  *) xx="$1";;
-+esac
-+test "$VERBOSE" && echo=echo || echo=:
-+$echo testing program: $xx
-+errors=0
-+test "$srcdir" || srcdir=.
-+test "$VERBOSE" && $xx --version 2> /dev/null
-+
-+export LC_ALL=en_US.UTF-8
-+locale -k LC_CTYPE 2>&1 | grep -q charmap.*UTF-8 || exit 77
-+errors=0
-+
-+$xx -t @ -k2 -n mb1.I > mb1.O
-+code=$?
-+if test $code != 0; then
-+  $echo "Test mb1 failed: $xx return code $code differs from expected value 0" 1>&2
-+  errors=`expr $errors + 1`
-+else
-+  cmp mb1.O $srcdir/mb1.X > /dev/null 2>&1
-+  case $? in
-+    0) if test "$VERBOSE"; then $echo "passed mb1"; fi;;
-+    1) $echo "Test mb1 failed: files mb1.O and $srcdir/mb1.X differ" 1>&2
-+       (diff -c mb1.O $srcdir/mb1.X) 2> /dev/null
-+       errors=`expr $errors + 1`;;
-+    2) $echo "Test mb1 may have failed." 1>&2
-+       $echo The command "cmp mb1.O $srcdir/mb1.X" failed. 1>&2
-+       errors=`expr $errors + 1`;;
-+  esac
-+fi
-+
-+$xx -t @ -k4 -n mb2.I > mb2.O
-+code=$?
-+if test $code != 0; then
-+  $echo "Test mb2 failed: $xx return code $code differs from expected value 0" 1>&2
-+  errors=`expr $errors + 1`
-+else
-+  cmp mb2.O $srcdir/mb2.X > /dev/null 2>&1
-+  case $? in
-+    0) if test "$VERBOSE"; then $echo "passed mb2"; fi;;
-+    1) $echo "Test mb2 failed: files mb2.O and $srcdir/mb2.X differ" 1>&2
-+       (diff -c mb2.O $srcdir/mb2.X) 2> /dev/null
-+       errors=`expr $errors + 1`;;
-+    2) $echo "Test mb2 may have failed." 1>&2
-+       $echo The command "cmp mb2.O $srcdir/mb2.X" failed. 1>&2
-+       errors=`expr $errors + 1`;;
-+  esac
-+fi
-+
-+if test $errors = 0; then
-+  $echo Passed all 113 tests. 1>&2
-+else
-+  $echo Failed $errors tests. 1>&2
-+fi
-+test $errors = 0 || errors=1
-+exit $errors
---- /dev/null	2007-03-01 09:16:39.219409909 +0000
-+++ coreutils-6.8+/tests/sort/mb2.I	2007-03-01 15:08:24.000000000 +0000
-@@ -0,0 +1,4 @@
-+Apple@AA10@@20
-+Banana@AA5@@30
-+Citrus@AA20@@5
-+Cherry@AA30@@10
---- /dev/null	2007-03-01 09:16:39.219409909 +0000
-+++ coreutils-6.8+/tests/sort/mb2.X	2007-03-01 15:08:24.000000000 +0000
-@@ -0,0 +1,4 @@
-+Citrus@AA20@@5
-+Cherry@AA30@@10
-+Apple@AA10@@20
-+Banana@AA5@@30
---- /dev/null	2007-03-01 09:16:39.219409909 +0000
-+++ coreutils-6.8+/tests/sort/mb1.I	2007-03-01 15:08:24.000000000 +0000
-@@ -0,0 +1,4 @@
-+Apple@10
-+Banana@5
-+Citrus@20
-+Cherry@30
---- /dev/null	2007-03-01 09:16:39.219409909 +0000
-+++ coreutils-6.8+/tests/sort/mb1.X	2007-03-01 15:08:24.000000000 +0000
-@@ -0,0 +1,4 @@
-+Banana@5
-+Apple@10
-+Citrus@20
-+Cherry@30
---- coreutils-6.8+/tests/sort/Makefile.am.i18n	2007-01-24 07:47:37.000000000 +0000
-+++ coreutils-6.8+/tests/sort/Makefile.am	2007-03-01 15:09:59.000000000 +0000
-@@ -66,15 +66,17 @@
- bigfield.O bigfield.E
- ##test-files-end
- 
--EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
--noinst_SCRIPTS = $x-tests
-+run_gen += mb1.0 mb2.0
-+
-+EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) mb1.I mb1.X mb2.I mb2.X
-+noinst_SCRIPTS = $x-tests # $x-mb-tests
- TESTS_ENVIRONMENT = \
-   CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
-   PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
- 
- editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
- 
--TESTS = $x-tests
-+TESTS = $x-tests $x-mb-tests
- 
- mk_script = $(srcdir)/../mk-script
- $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
---- coreutils-6.8+/lib/linebuffer.h.i18n	2005-05-14 07:44:24.000000000 +0100
-+++ coreutils-6.8+/lib/linebuffer.h	2007-03-01 15:08:24.000000000 +0000
-@@ -22,6 +22,11 @@
- 
- # include <stdio.h>
- 
-+/* Get mbstate_t.  */
-+# if HAVE_WCHAR_H
-+#  include <wchar.h>
-+# endif
-+
- /* A `struct linebuffer' holds a line of text. */
- 
- struct linebuffer
-@@ -29,6 +34,9 @@
-   size_t size;			/* Allocated. */
-   size_t length;		/* Used. */
-   char *buffer;
-+# if HAVE_WCHAR_H
-+  mbstate_t state;
-+# endif
- };
- 
- /* Initialize linebuffer LINEBUFFER for use. */
---- coreutils-6.8+/src/expand.c.i18n	2007-01-14 15:41:28.000000000 +0000
-+++ coreutils-6.8+/src/expand.c	2007-03-01 15:08:24.000000000 +0000
-@@ -38,11 +38,28 @@
- #include <stdio.h>
- #include <getopt.h>
- #include <sys/types.h>
-+
-+/* Get mbstate_t, mbrtowc(), wcwidth(). */
-+#if HAVE_WCHAR_H
-+# include <wchar.h>
-+#endif
-+
- #include "system.h"
- #include "error.h"
- #include "quote.h"
- #include "xstrndup.h"
- 
-+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
-+   installation; work around this configuration error.  */
-+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
-+# define MB_LEN_MAX 16
-+#endif
-+
-+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
-+#if HAVE_MBRTOWC && defined mbstate_t
-+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-+#endif
-+
- /* The official name of this program (e.g., no `g' prefix).  */
- #define PROGRAM_NAME "expand"
- 
-@@ -183,6 +200,7 @@
- 	      stops = num_start + len - 1;
- 	    }
- 	}
-+
-       else
- 	{
- 	  error (0, 0, _("tab size contains invalid character(s): %s"),
-@@ -365,6 +383,142 @@
-     }
- }
- 
-+#if HAVE_MBRTOWC
-+static void
-+expand_multibyte (void)
-+{
-+  FILE *fp;			/* Input strem. */
-+  mbstate_t i_state;		/* Current shift state of the input stream. */
-+  mbstate_t i_state_bak;	/* Back up the I_STATE. */
-+  mbstate_t o_state;		/* Current shift state of the output stream. */
-+  char buf[MB_LEN_MAX + BUFSIZ];  /* For spooling a read byte sequence. */
-+  char *bufpos;			/* Next read position of BUF. */
-+  size_t buflen = 0;		/* The length of the byte sequence in buf. */
-+  wchar_t wc;			/* A gotten wide character. */
-+  size_t mblength;		/* The byte size of a multibyte character
-+				   which shows as same character as WC. */
-+  int tab_index = 0;		/* Index in `tab_list' of next tabstop. */
-+  int column = 0;		/* Column on screen of the next char. */
-+  int next_tab_column;		/* Column the next tab stop is on. */
-+  int convert = 1;		/* If nonzero, perform translations. */
-+
-+  fp = next_file ((FILE *) NULL);
-+  if (fp == NULL)
-+    return;
-+
-+  memset (&o_state, '\0', sizeof(mbstate_t));
-+  memset (&i_state, '\0', sizeof(mbstate_t));
-+
-+  for (;;)
-+    {
-+      /* Refill the buffer BUF. */
-+      if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
-+	{
-+	  memmove (buf, bufpos, buflen);
-+	  buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
-+	  bufpos = buf;
-+	}
-+
-+      /* No character is left in BUF. */
-+      if (buflen < 1)
-+	{
-+	  fp = next_file (fp);
-+
-+	  if (fp == NULL)
-+	    break;		/* No more files. */
-+	  else
-+	    {
-+	      memset (&i_state, '\0', sizeof(mbstate_t));
-+	      continue;
-+	    }
-+	}
-+
-+      /* Get a wide character. */
-+      i_state_bak = i_state;
-+      mblength = mbrtowc (&wc, bufpos, buflen, &i_state);
-+
-+      switch (mblength)
-+	{
-+	case (size_t)-1:	/* illegal byte sequence. */
-+	case (size_t)-2:
-+	  mblength = 1;
-+	  i_state = i_state_bak;
-+	  if (convert)
-+	    {
-+	      ++column;
-+	      if (convert_entire_line == 0)
-+		convert = 0;
-+	    }
-+	  putchar (*bufpos);
-+	  break;
-+
-+	case 0:		/* null. */
-+	  mblength = 1;
-+	  if (convert && convert_entire_line == 0)
-+	    convert = 0;
-+	  putchar ('\0');
-+	  break;
-+
-+	default:
-+	  if (wc == L'\n')   /* LF. */
-+	    {
-+	      tab_index = 0;
-+	      column = 0;
-+	      convert = 1;
-+	      putchar ('\n');
-+	    }
-+	  else if (wc == L'\t' && convert)	/* Tab. */
-+	    {
-+	      if (tab_size == 0)
-+		{
-+		  /* Do not let tab_index == first_free_tab;
-+		     stop when it is 1 less. */
-+		  while (tab_index < first_free_tab - 1
-+		      && column >= tab_list[tab_index])
-+		    tab_index++;
-+		  next_tab_column = tab_list[tab_index];
-+		  if (tab_index < first_free_tab - 1)
-+		    tab_index++;
-+		  if (column >= next_tab_column)
-+		    next_tab_column = column + 1;
-+		}
-+	      else
-+		next_tab_column = column + tab_size - column % tab_size;
-+
-+	      while (column < next_tab_column)
-+		{
-+		  putchar (' ');
-+		  ++column;
-+		}
-+	    }
-+	  else  /* Others. */
-+	    {
-+	      if (convert)
-+		{
-+		  if (wc == L'\b')
-+		    {
-+		      if (column > 0)
-+			--column;
-+		    }
-+		  else
-+		    {
-+		      int width;		/* The width of WC. */
-+
-+		      width = wcwidth (wc);
-+		      column += (width > 0) ? width : 0;
-+		      if (convert_entire_line == 0)
-+			convert = 0;
-+		    }
-+		}
-+	      fwrite (bufpos, sizeof(char), mblength, stdout);
-+	    }
-+	}
-+      buflen -= mblength;
-+      bufpos += mblength;
-+    }
-+}
-+#endif
-+
- int
- main (int argc, char **argv)
- {
-@@ -429,7 +583,12 @@
- 
-   file_list = (optind < argc ? &argv[optind] : stdin_argv);
- 
--  expand ();
-+#if HAVE_MBRTOWC
-+  if (MB_CUR_MAX > 1)
-+    expand_multibyte ();
-+  else
-+#endif
-+    expand ();
- 
-   if (have_read_stdin && fclose (stdin) != 0)
-     error (EXIT_FAILURE, errno, "-");
---- coreutils-6.8+/src/join.c.i18n	2007-01-14 15:41:28.000000000 +0000
-+++ coreutils-6.8+/src/join.c	2007-03-01 15:08:24.000000000 +0000
-@@ -23,16 +23,30 @@
- #include <sys/types.h>
- #include <getopt.h>
- 
-+/* Get mbstate_t, mbrtowc(), mbrtowc(), wcwidth().  */
-+#if HAVE_WCHAR_H
-+# include <wchar.h>
-+#endif
-+
-+/* Get iswblank(), towupper.  */
-+#if HAVE_WCTYPE_H
-+# include <wctype.h>
-+#endif
-+
- #include "system.h"
- #include "error.h"
- #include "hard-locale.h"
- #include "linebuffer.h"
--#include "memcasecmp.h"
- #include "quote.h"
- #include "stdio--.h"
- #include "xmemcoll.h"
- #include "xstrtol.h"
- 
-+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
-+#if HAVE_MBRTOWC && defined mbstate_t
-+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-+#endif
-+
- /* The official name of this program (e.g., no `g' prefix).  */
- #define PROGRAM_NAME "join"
- 
-@@ -104,10 +118,12 @@
- /* Last element in `outlist', where a new element can be added.  */
- static struct outlist *outlist_end = &outlist_head;
- 
--/* Tab character separating fields.  If negative, fields are separated
--   by any nonempty string of blanks, otherwise by exactly one
--   tab character whose value (when cast to unsigned char) equals TAB.  */
--static int tab = -1;
-+/* Tab character separating fields.  If NULL, fields are separated
-+   by any nonempty string of blanks.  */
-+static char *tab = NULL;
-+
-+/* The number of bytes used for tab. */
-+static size_t tablen = 0;
- 
- static struct option const longopts[] =
- {
-@@ -190,6 +206,8 @@
- 
- /* Fill in the `fields' structure in LINE.  */
- 
-+/* Fill in the `fields' structure in LINE.  */
-+
- static void
- xfields (struct line *line)
- {
-@@ -199,10 +217,11 @@
-   if (ptr == lim)
-     return;
- 
--  if (0 <= tab)
-+  if (tab != NULL)
-     {
-+      unsigned char t = tab[0];
-       char *sep;
--      for (; (sep = memchr (ptr, tab, lim - ptr)) != NULL; ptr = sep + 1)
-+      for (; (sep = memchr (ptr, t, lim - ptr)) != NULL; ptr = sep + 1)
- 	extract_field (line, ptr, sep - ptr);
-     }
-   else
-@@ -229,6 +248,148 @@
-   extract_field (line, ptr, lim - ptr);
- }
- 
-+#if HAVE_MBRTOWC
-+static void
-+xfields_multibyte (struct line *line)
-+{
-+  char *ptr = line->buf.buffer;
-+  char const *lim = ptr + line->buf.length - 1;
-+  wchar_t wc = 0;
-+  size_t mblength = 1;
-+  mbstate_t state, state_bak;
-+
-+  memset (&state, 0, sizeof (mbstate_t));
-+
-+  if (ptr == lim)
-+    return;
-+
-+  if (tab != NULL)
-+    {
-+      unsigned char t = tab[0];
-+      char *sep = ptr;
-+      for (; ptr < lim; ptr = sep + mblength)
-+	{
-+	  sep = ptr;
-+	  while (sep < lim)
-+	    {
-+	      state_bak = state;
-+	      mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
-+
-+	      if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+		{
-+		  mblength = 1;
-+		  state = state_bak;
-+		}
-+	      mblength = (mblength < 1) ? 1 : mblength;
-+
-+	      if (mblength == tablen && !memcmp (sep, tab, mblength))
-+		break;
-+	      else
-+		{
-+		  sep += mblength;
-+		  continue;
-+		}
-+	    }
-+
-+	  if (sep == lim)
-+	    break;
-+
-+	  extract_field (line, ptr, sep - ptr);
-+	}
-+    }
-+  else
-+    {
-+      /* Skip leading blanks before the first field.  */
-+      while(ptr < lim)
-+      {
-+        state_bak = state;
-+        mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
-+
-+        if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+          {
-+            mblength = 1;
-+            state = state_bak;
-+            break;
-+          }
-+        mblength = (mblength < 1) ? 1 : mblength;
-+
-+        if (!iswblank(wc))
-+          break;
-+        ptr += mblength;
-+      }
-+
-+      do
-+	{
-+	  char *sep;
-+	  state_bak = state;
-+	  mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
-+	  if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+	    {
-+	      mblength = 1;
-+	      state = state_bak;
-+	      break;
-+	    }
-+	  mblength = (mblength < 1) ? 1 : mblength;
-+
-+	  sep = ptr + mblength;
-+	  while (sep != lim)
-+	    {
-+	      state_bak = state;
-+	      mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
-+	      if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+		{
-+		  mblength = 1;
-+		  state = state_bak;
-+		  break;
-+		}
-+	      mblength = (mblength < 1) ? 1 : mblength;
-+
-+	      if (iswblank (wc))
-+		break;
-+
-+	      sep += mblength;
-+	    }
-+
-+	  extract_field (line, ptr, sep - ptr);
-+	  if (sep == lim)
-+	    return;
-+
-+	  state_bak = state;
-+	  mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
-+	  if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+	    {
-+	      mblength = 1;
-+	      state = state_bak;
-+	      break;
-+	    }
-+	  mblength = (mblength < 1) ? 1 : mblength;
-+
-+	  ptr = sep + mblength;
-+	  while (ptr != lim)
-+	    {
-+	      state_bak = state;
-+	      mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
-+	      if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+		{
-+		  mblength = 1;
-+		  state = state_bak;
-+		  break;
-+		}
-+	      mblength = (mblength < 1) ? 1 : mblength;
-+
-+	      if (!iswblank (wc))
-+		break;
-+
-+	      ptr += mblength;
-+	    }
-+	}
-+      while (ptr != lim);
-+    }
-+
-+  extract_field (line, ptr, lim - ptr);
-+}
-+#endif
-+
- /* Read a line from FP into LINE and split it into fields.
-    Return true if successful.  */
- 
-@@ -249,6 +410,11 @@
-   line->nfields_allocated = 0;
-   line->nfields = 0;
-   line->fields = NULL;
-+#if HAVE_MBRTOWC
-+  if (MB_CUR_MAX > 1)
-+    xfields_multibyte (line);
-+  else
-+#endif
-   xfields (line);
-   return true;
- }
-@@ -303,56 +469,114 @@
- keycmp (struct line const *line1, struct line const *line2)
- {
-   /* Start of field to compare in each file.  */
--  char *beg1;
--  char *beg2;
--
--  size_t len1;
--  size_t len2;		/* Length of fields to compare.  */
-+  char *beg[2];
-+  char *copy[2];
-+  size_t len[2];	/* Length of fields to compare.  */
-   int diff;
-+  int i, j;
- 
-   if (join_field_1 < line1->nfields)
-     {
--      beg1 = line1->fields[join_field_1].beg;
--      len1 = line1->fields[join_field_1].len;
-+      beg[0] = line1->fields[join_field_1].beg;
-+      len[0] = line1->fields[join_field_1].len;
-     }
-   else
-     {
--      beg1 = NULL;
--      len1 = 0;
-+      beg[0] = NULL;
-+      len[0] = 0;
-     }
- 
-   if (join_field_2 < line2->nfields)
-     {
--      beg2 = line2->fields[join_field_2].beg;
--      len2 = line2->fields[join_field_2].len;
-+      beg[1] = line2->fields[join_field_2].beg;
-+      len[1] = line2->fields[join_field_2].len;
-     }
-   else
-     {
--      beg2 = NULL;
--      len2 = 0;
-+      beg[1] = NULL;
-+      len[1] = 0;
-     }
- 
--  if (len1 == 0)
--    return len2 == 0 ? 0 : -1;
--  if (len2 == 0)
-+  if (len[0] == 0)
-+    return len[1] == 0 ? 0 : -1;
-+  if (len[1] == 0)
-     return 1;
- 
-   if (ignore_case)
-     {
--      /* FIXME: ignore_case does not work with NLS (in particular,
--         with multibyte chars).  */
--      diff = memcasecmp (beg1, beg2, MIN (len1, len2));
-+#ifdef HAVE_MBRTOWC
-+      if (MB_CUR_MAX > 1)
-+      {
-+        size_t mblength;
-+        wchar_t wc, uwc;
-+        mbstate_t state, state_bak;
-+
-+        memset (&state, '\0', sizeof (mbstate_t));
-+
-+        for (i = 0; i < 2; i++)
-+          {
-+            copy[i] = alloca (len[i] + 1);
-+
-+            for (j = 0; j < MIN (len[0], len[1]);)
-+              {
-+                state_bak = state;
-+                mblength = mbrtowc (&wc, beg[i] + j, len[i] - j, &state);
-+
-+                switch (mblength)
-+                  {
-+                  case (size_t) -1:
-+                  case (size_t) -2:
-+                    state = state_bak;
-+                    /* Fall through */
-+                  case 0:
-+                    mblength = 1;
-+                    break;
-+
-+                  default:
-+                    uwc = towupper (wc);
-+
-+                    if (uwc != wc)
-+                      {
-+                        mbstate_t state_wc;
-+
-+                        memset (&state_wc, '\0', sizeof (mbstate_t));
-+                        wcrtomb (copy[i] + j, uwc, &state_wc);
-+                      }
-+                    else
-+                      memcpy (copy[i] + j, beg[i] + j, mblength);
-+                  }
-+                j += mblength;
-+              }
-+            copy[i][j] = '\0';
-+          }
-+      }
-+      else
-+#endif
-+      {
-+        for (i = 0; i < 2; i++)
-+          {
-+            copy[i] = alloca (len[i] + 1);
-+
-+            for (j = 0; j < MIN (len[0], len[1]); j++)
-+              copy[i][j] = toupper (beg[i][j]);
-+
-+            copy[i][j] = '\0';
-+          }
-+      }
-     }
-   else
-     {
--      if (hard_LC_COLLATE)
--	return xmemcoll (beg1, len1, beg2, len2);
--      diff = memcmp (beg1, beg2, MIN (len1, len2));
-+      copy[0] = (unsigned char *) beg[0];
-+      copy[1] = (unsigned char *) beg[1];
-     }
- 
-+  if (hard_LC_COLLATE)
-+    return xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]);
-+  diff = memcmp (copy[0], copy[1], MIN (len[0], len[1]));
-+
-   if (diff)
-     return diff;
--  return len1 < len2 ? -1 : len1 != len2;
-+  return len[0] - len[1];
- }
- 
- /* Print field N of LINE if it exists and is nonempty, otherwise
-@@ -377,11 +601,18 @@
- 
- /* Print the join of LINE1 and LINE2.  */
- 
-+#define PUT_TAB_CHAR							\
-+  do									\
-+    {									\
-+      (tab != NULL) ?							\
-+	fwrite(tab, sizeof(char), tablen, stdout) : putchar (' ');	\
-+    }									\
-+  while (0)								
-+
- static void
- prjoin (struct line const *line1, struct line const *line2)
- {
-   const struct outlist *outlist;
--  char output_separator = tab < 0 ? ' ' : tab;
- 
-   outlist = outlist_head.next;
-   if (outlist)
-@@ -397,12 +628,12 @@
- 	  if (o->file == 0)
- 	    {
- 	      if (line1 == &uni_blank)
--	        {
-+		{
- 		  line = line2;
- 		  field = join_field_2;
- 		}
- 	      else
--	        {
-+		{
- 		  line = line1;
- 		  field = join_field_1;
- 		}
-@@ -416,7 +647,7 @@
- 	  o = o->next;
- 	  if (o == NULL)
- 	    break;
--	  putchar (output_separator);
-+	  PUT_TAB_CHAR;
- 	}
-       putchar ('\n');
-     }
-@@ -434,23 +665,23 @@
-       prfield (join_field_1, line1);
-       for (i = 0; i < join_field_1 && i < line1->nfields; ++i)
- 	{
--	  putchar (output_separator);
-+	  PUT_TAB_CHAR;
- 	  prfield (i, line1);
- 	}
-       for (i = join_field_1 + 1; i < line1->nfields; ++i)
- 	{
--	  putchar (output_separator);
-+	  PUT_TAB_CHAR;
- 	  prfield (i, line1);
- 	}
- 
-       for (i = 0; i < join_field_2 && i < line2->nfields; ++i)
- 	{
--	  putchar (output_separator);
-+	  PUT_TAB_CHAR;
- 	  prfield (i, line2);
- 	}
-       for (i = join_field_2 + 1; i < line2->nfields; ++i)
- 	{
--	  putchar (output_separator);
-+	  PUT_TAB_CHAR;
- 	  prfield (i, line2);
- 	}
-       putchar ('\n');
-@@ -859,20 +1090,41 @@
- 
- 	case 't':
- 	  {
--	    unsigned char newtab = optarg[0];
--	    if (! newtab)
-+	    char *newtab;
-+	    size_t newtablen;
-+	    if (! optarg[0])
- 	      error (EXIT_FAILURE, 0, _("empty tab"));
--	    if (optarg[1])
-+	    newtab = xstrdup (optarg);
-+#if HAVE_MBRTOWC
-+	    if (MB_CUR_MAX > 1)
-+	      {
-+		mbstate_t state;
-+
-+		memset (&state, 0, sizeof (mbstate_t));
-+		newtablen = mbrtowc (NULL, newtab,
-+				     strnlen (newtab, MB_LEN_MAX),
-+				     &state);
-+		if (newtablen == (size_t) 0
-+		    || newtablen == (size_t) -1
-+		    || newtablen == (size_t) -2)
-+		  newtablen = 1;
-+	      }
-+	    else
-+#endif
-+	      newtablen = 1;
-+		
-+	    if (newtablen == 1 && newtab[1])
-+	      {
-+		if (STREQ (newtab, "\\0"))
-+		  newtab[0] = '\0';
-+	      }
-+	    if (tab != NULL && strcmp (tab, newtab))
- 	      {
--		if (STREQ (optarg, "\\0"))
--		  newtab = '\0';
--		else
--		  error (EXIT_FAILURE, 0, _("multi-character tab %s"),
--			 quote (optarg));
-+		free (newtab);
-+		error (EXIT_FAILURE, 0, _("incompatible tabs"));
- 	      }
--	    if (0 <= tab && tab != newtab)
--	      error (EXIT_FAILURE, 0, _("incompatible tabs"));
- 	    tab = newtab;
-+	    tablen = newtablen;
- 	  }
- 	  break;
- 
---- coreutils-6.8+/src/uniq.c.i18n	2007-01-14 15:41:28.000000000 +0000
-+++ coreutils-6.8+/src/uniq.c	2007-03-01 15:08:24.000000000 +0000
-@@ -23,6 +23,16 @@
- #include <getopt.h>
- #include <sys/types.h>
- 
-+/* Get mbstate_t, mbrtowc(). */
-+#if HAVE_WCHAR_H
-+# include <wchar.h>
-+#endif
-+
-+/* Get isw* functions. */
-+#if HAVE_WCTYPE_H
-+# include <wctype.h>
-+#endif
-+
- #include "system.h"
- #include "argmatch.h"
- #include "linebuffer.h"
-@@ -32,7 +42,19 @@
- #include "quote.h"
- #include "xmemcoll.h"
- #include "xstrtol.h"
--#include "memcasecmp.h"
-+#include "xmemcoll.h"
-+
-+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
-+   installation; work around this configuration error.  */
-+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
-+# define MB_LEN_MAX 16
-+#endif
-+
-+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
-+#if HAVE_MBRTOWC && defined mbstate_t
-+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-+#endif
-+
- 
- /* The official name of this program (e.g., no `g' prefix).  */
- #define PROGRAM_NAME "uniq"
-@@ -109,6 +131,10 @@
- /* Select whether/how to delimit groups of duplicate lines.  */
- static enum delimit_method delimit_groups;
- 
-+/* Function pointers. */
-+static char *
-+(*find_field) (struct linebuffer *line);
-+
- static struct option const longopts[] =
- {
-   {"count", no_argument, NULL, 'c'},
-@@ -198,7 +224,7 @@
-    return a pointer to the beginning of the line's field to be compared. */
- 
- static char *
--find_field (const struct linebuffer *line)
-+find_field_uni (struct linebuffer *line)
- {
-   size_t count;
-   char *lp = line->buffer;
-@@ -219,6 +245,83 @@
-   return lp + i;
- }
- 
-+#if HAVE_MBRTOWC
-+
-+# define MBCHAR_TO_WCHAR(WC, MBLENGTH, LP, POS, SIZE, STATEP, CONVFAIL)  \
-+  do									\
-+    {									\
-+      mbstate_t state_bak;						\
-+									\
-+      CONVFAIL = 0;							\
-+      state_bak = *STATEP;						\
-+									\
-+      MBLENGTH = mbrtowc (&WC, LP + POS, SIZE - POS, STATEP);		\
-+									\
-+      switch (MBLENGTH)							\
-+	{								\
-+	case (size_t)-2:						\
-+	case (size_t)-1:						\
-+	  *STATEP = state_bak;						\
-+	  CONVFAIL++;							\
-+	  /* Fall through */						\
-+	case 0:								\
-+	  MBLENGTH = 1;							\
-+	}								\
-+    }									\
-+  while (0)
-+
-+static char *
-+find_field_multi (struct linebuffer *line)
-+{
-+  size_t count;
-+  char *lp = line->buffer;
-+  size_t size = line->length - 1;
-+  size_t pos;
-+  size_t mblength;
-+  wchar_t wc;
-+  mbstate_t *statep;
-+  int convfail;
-+
-+  pos = 0;
-+  statep = &(line->state);
-+
-+  /* skip fields. */
-+  for (count = 0; count < skip_fields && pos < size; count++)
-+    {
-+      while (pos < size)
-+	{
-+	  MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
-+ 
-+	  if (convfail || !iswblank (wc))
-+	    {
-+	      pos += mblength;
-+	      break;
-+	    }
-+	  pos += mblength;
-+	}
-+
-+      while (pos < size)
-+	{
-+	  MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
-+
-+	  if (!convfail && iswblank (wc))
-+	    break;
-+
-+	  pos += mblength;
-+	}
-+    }
-+
-+  /* skip fields. */
-+  for (count = 0; count < skip_chars && pos < size; count++)
-+    {
-+      MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
-+      pos += mblength;
-+    }
-+
-+  return lp + pos;
-+}
-+#endif
-+
- /* Return false if two strings OLD and NEW match, true if not.
-    OLD and NEW point not to the beginnings of the lines
-    but rather to the beginnings of the fields to compare.
-@@ -227,6 +330,8 @@
- static bool
- different (char *old, char *new, size_t oldlen, size_t newlen)
- {
-+  char *copy_old, *copy_new;
-+
-   if (check_chars < oldlen)
-     oldlen = check_chars;
-   if (check_chars < newlen)
-@@ -234,14 +339,92 @@
- 
-   if (ignore_case)
-     {
--      /* FIXME: This should invoke strcoll somehow.  */
--      return oldlen != newlen || memcasecmp (old, new, oldlen);
-+      size_t i;
-+
-+      copy_old = alloca (oldlen + 1);
-+      copy_new = alloca (oldlen + 1);
-+
-+      for (i = 0; i < oldlen; i++)
-+	{
-+	  copy_old[i] = toupper (old[i]);
-+	  copy_new[i] = toupper (new[i]);
-+	}
-     }
--  else if (hard_LC_COLLATE)
--    return xmemcoll (old, oldlen, new, newlen) != 0;
-   else
--    return oldlen != newlen || memcmp (old, new, oldlen);
-+    {
-+      copy_old = (char *)old;
-+      copy_new = (char *)new;
-+    }
-+
-+  return xmemcoll (copy_old, oldlen, copy_new, newlen);
-+}
-+
-+#if HAVE_MBRTOWC
-+static int
-+different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate)
-+{
-+  size_t i, j, chars;
-+  const char *str[2];
-+  char *copy[2];
-+  size_t len[2];
-+  mbstate_t state[2];
-+  size_t mblength;
-+  wchar_t wc, uwc;
-+  mbstate_t state_bak;
-+
-+  str[0] = old;
-+  str[1] = new;
-+  len[0] = oldlen;
-+  len[1] = newlen;
-+  state[0] = oldstate;
-+  state[1] = newstate;
-+
-+  for (i = 0; i < 2; i++)
-+    {
-+      copy[i] = alloca (len[i] + 1);
-+
-+      for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++)
-+	{
-+	  state_bak = state[i];
-+	  mblength = mbrtowc (&wc, str[i] + j, len[i] - j, &(state[i]));
-+
-+	  switch (mblength)
-+	    {
-+	    case (size_t)-1:
-+	    case (size_t)-2:
-+	      state[i] = state_bak;
-+	      /* Fall through */
-+	    case 0:
-+	      mblength = 1;
-+	      break;
-+
-+	    default:
-+	      if (ignore_case)
-+		{
-+		  uwc = towupper (wc);
-+
-+		  if (uwc != wc)
-+		    {
-+		      mbstate_t state_wc;
-+
-+		      memset (&state_wc, '\0', sizeof(mbstate_t));
-+		      wcrtomb (copy[i] + j, uwc, &state_wc);
-+		    }
-+		  else
-+		    memcpy (copy[i] + j, str[i] + j, mblength);
-+		}
-+	      else
-+		memcpy (copy[i] + j, str[i] + j, mblength);
-+	    }
-+	  j += mblength;
-+	}
-+      copy[i][j] = '\0';
-+      len[i] = j;
-+    }
-+
-+  return xmemcoll (copy[0], len[0], copy[1], len[1]);
- }
-+#endif
- 
- /* Output the line in linebuffer LINE to standard output
-    provided that the switches say it should be output.
-@@ -295,15 +478,43 @@
-     {
-       char *prevfield IF_LINT (= NULL);
-       size_t prevlen IF_LINT (= 0);
-+#if HAVE_MBRTOWC
-+      mbstate_t prevstate;
-+
-+      memset (&prevstate, '\0', sizeof (mbstate_t));
-+#endif
- 
-       while (!feof (stdin))
- 	{
- 	  char *thisfield;
- 	  size_t thislen;
-+#if HAVE_MBRTOWC
-+	  mbstate_t thisstate;
-+#endif
-+
- 	  if (readlinebuffer (thisline, stdin) == 0)
- 	    break;
- 	  thisfield = find_field (thisline);
- 	  thislen = thisline->length - 1 - (thisfield - thisline->buffer);
-+#if HAVE_MBRTOWC
-+	  if (MB_CUR_MAX > 1)
-+            {
-+            thisstate = thisline->state;
-+
-+            if (prevline->length == 0 || different_multi
-+              (thisfield, prevfield, thislen, prevlen, thisstate, prevstate))
-+              {
-+                fwrite (thisline->buffer, sizeof (char),
-+                        thisline->length, stdout);
-+
-+                SWAP_LINES (prevline, thisline);
-+                prevfield = thisfield;
-+                prevlen = thislen;
-+                prevstate = thisstate;
-+              }
-+          }
-+	else
-+#endif
- 	  if (prevline->length == 0
- 	      || different (thisfield, prevfield, thislen, prevlen))
- 	    {
-@@ -322,17 +533,26 @@
-       size_t prevlen;
-       uintmax_t match_count = 0;
-       bool first_delimiter = true;
-+#if HAVE_MBRTOWC
-+      mbstate_t prevstate;
-+#endif
- 
-       if (readlinebuffer (prevline, stdin) == 0)
- 	goto closefiles;
-       prevfield = find_field (prevline);
-       prevlen = prevline->length - 1 - (prevfield - prevline->buffer);
-+#if HAVE_MBRTOWC
-+      prevstate = prevline->state;
-+#endif
- 
-       while (!feof (stdin))
- 	{
- 	  bool match;
- 	  char *thisfield;
- 	  size_t thislen;
-+#if HAVE_MBRTOWC
-+	  mbstate_t thisstate;
-+#endif
- 	  if (readlinebuffer (thisline, stdin) == 0)
- 	    {
- 	      if (ferror (stdin))
-@@ -341,6 +561,15 @@
- 	    }
- 	  thisfield = find_field (thisline);
- 	  thislen = thisline->length - 1 - (thisfield - thisline->buffer);
-+#if HAVE_MBRTOWC
-+	  if (MB_CUR_MAX > 1)
-+	    {
-+              thisstate = thisline->state;
-+              match = !different_multi (thisfield, prevfield,
-+                                thislen, prevlen, thisstate, prevstate);
-+            }
-+	  else
-+#endif
- 	  match = !different (thisfield, prevfield, thislen, prevlen);
- 	  match_count += match;
- 
-@@ -373,6 +602,9 @@
- 	      SWAP_LINES (prevline, thisline);
- 	      prevfield = thisfield;
- 	      prevlen = thislen;
-+#if HAVE_MBRTOWC
-+	      prevstate = thisstate;
-+#endif
- 	      if (!match)
- 		match_count = 0;
- 	    }
-@@ -417,6 +649,19 @@
- 
-   atexit (close_stdout);
- 
-+#if HAVE_MBRTOWC
-+  if (MB_CUR_MAX > 1)
-+    {
-+      find_field = find_field_multi;
-+    }
-+  else
-+#endif
-+    {
-+      find_field = find_field_uni;
-+    }
-+
-+
-+
-   skip_chars = 0;
-   skip_fields = 0;
-   check_chars = SIZE_MAX;
---- coreutils-6.8+/src/fold.c.i18n	2007-02-23 12:01:47.000000000 +0000
-+++ coreutils-6.8+/src/fold.c	2007-03-01 15:08:24.000000000 +0000
-@@ -23,11 +23,33 @@
- #include <getopt.h>
- #include <sys/types.h>
- 
-+/* Get mbstate_t, mbrtowc(), wcwidth().  */
-+#if HAVE_WCHAR_H
-+# include <wchar.h>
-+#endif
-+
-+/* Get iswprint(), iswblank(), wcwidth().  */
-+#if HAVE_WCTYPE_H
-+# include <wctype.h>
-+#endif
-+
- #include "system.h"
- #include "error.h"
- #include "quote.h"
- #include "xstrtol.h"
- 
-+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
-+      installation; work around this configuration error.  */
-+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
-+# undef MB_LEN_MAX
-+# define MB_LEN_MAX 16
-+#endif
-+
-+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
-+#if HAVE_MBRTOWC && defined mbstate_t
-+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-+#endif
-+
- #define TAB_WIDTH 8
- 
- /* The official name of this program (e.g., no `g' prefix).  */
-@@ -35,23 +57,44 @@
- 
- #define AUTHORS "David MacKenzie"
- 
-+#define FATAL_ERROR(Message)                                            \
-+  do                                                                    \
-+    {                                                                   \
-+      error (0, 0, (Message));                                          \
-+      usage (2);                                                        \
-+    }                                                                   \
-+  while (0)
-+
-+enum operating_mode
-+{
-+  /* Fold texts by columns that are at the given positions. */
-+  column_mode,
-+
-+  /* Fold texts by bytes that are at the given positions. */
-+  byte_mode,
-+
-+  /* Fold texts by characters that are at the given positions. */
-+  character_mode,
-+};
-+
- /* The name this program was run with. */
- char *program_name;
- 
-+/* The argument shows current mode. (Default: column_mode) */
-+static enum operating_mode operating_mode;
-+
- /* If nonzero, try to break on whitespace. */
- static bool break_spaces;
- 
--/* If nonzero, count bytes, not column positions. */
--static bool count_bytes;
--
- /* If nonzero, at least one of the files we read was standard input. */
- static bool have_read_stdin;
- 
--static char const shortopts[] = "bsw:0::1::2::3::4::5::6::7::8::9::";
-+static char const shortopts[] = "bcsw:0::1::2::3::4::5::6::7::8::9::";
- 
- static struct option const longopts[] =
- {
-   {"bytes", no_argument, NULL, 'b'},
-+  {"characters", no_argument, NULL, 'c'},
-   {"spaces", no_argument, NULL, 's'},
-   {"width", required_argument, NULL, 'w'},
-   {GETOPT_HELP_OPTION_DECL},
-@@ -81,6 +124,7 @@
- "), stdout);
-       fputs (_("\
-   -b, --bytes         count bytes rather than columns\n\
-+  -c, --characters    count characters rather than columns\n\
-   -s, --spaces        break at spaces\n\
-   -w, --width=WIDTH   use WIDTH columns instead of 80\n\
- "), stdout);
-@@ -98,7 +142,7 @@
- static size_t
- adjust_column (size_t column, char c)
- {
--  if (!count_bytes)
-+  if (operating_mode != byte_mode)
-     {
-       if (c == '\b')
- 	{
-@@ -121,30 +165,14 @@
-    to stdout, with maximum line length WIDTH.
-    Return true if successful.  */
- 
--static bool
--fold_file (char const *filename, size_t width)
-+static void
-+fold_text (FILE *istream, size_t width, int *saved_errno)
- {
--  FILE *istream;
-   int c;
-   size_t column = 0;		/* Screen column where next char will go. */
-   size_t offset_out = 0;	/* Index in `line_out' for next char. */
-   static char *line_out = NULL;
-   static size_t allocated_out = 0;
--  int saved_errno;
--
--  if (STREQ (filename, "-"))
--    {
--      istream = stdin;
--      have_read_stdin = true;
--    }
--  else
--    istream = fopen (filename, "r");
--
--  if (istream == NULL)
--    {
--      error (0, errno, "%s", filename);
--      return false;
--    }
- 
-   while ((c = getc (istream)) != EOF)
-     {
-@@ -172,6 +200,15 @@
- 	      bool found_blank = false;
- 	      size_t logical_end = offset_out;
- 
-+	      /* If LINE_OUT has no wide character,
-+		 put a new wide character in LINE_OUT
-+		 if column is bigger than width. */
-+	      if (offset_out == 0)
-+		{
-+		  line_out[offset_out++] = c;
-+		  continue;
-+		}
-+
- 	      /* Look for the last blank. */
- 	      while (logical_end)
- 		{
-@@ -218,11 +255,225 @@
-       line_out[offset_out++] = c;
-     }
- 
--  saved_errno = errno;
-+  *saved_errno = errno;
-+
-+  if (offset_out)
-+    fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
-+
-+  free(line_out);
-+}
-+
-+#if HAVE_MBRTOWC
-+static void
-+fold_multibyte_text (FILE *istream, size_t width, int *saved_errno)
-+{
-+  char buf[MB_LEN_MAX + BUFSIZ];  /* For spooling a read byte sequence. */
-+  size_t buflen = 0;	/* The length of the byte sequence in buf. */
-+  char *bufpos;         /* Next read position of BUF. */
-+  wint_t wc;		/* A gotten wide character. */
-+  size_t mblength;	/* The byte size of a multibyte character which shows
-+			   as same character as WC. */
-+  mbstate_t state, state_bak;	/* State of the stream. */
-+  int convfail;		/* 1, when conversion is failed. Otherwise 0. */
-+
-+  char *line_out = NULL;
-+  size_t offset_out = 0;	/* Index in `line_out' for next char. */
-+  size_t allocated_out = 0;
-+
-+  int increment;
-+  size_t column = 0;
-+
-+  size_t last_blank_pos;
-+  size_t last_blank_column;
-+  int is_blank_seen;
-+  int last_blank_increment;
-+  int is_bs_following_last_blank;
-+  size_t bs_following_last_blank_num;
-+  int is_cr_after_last_blank;
-+
-+#define CLEAR_FLAGS				\
-+   do						\
-+     {						\
-+	last_blank_pos = 0;			\
-+	last_blank_column = 0;			\
-+	is_blank_seen = 0;			\
-+	is_bs_following_last_blank = 0;		\
-+	bs_following_last_blank_num = 0;	\
-+	is_cr_after_last_blank = 0;		\
-+     }						\
-+   while (0)
-+
-+#define START_NEW_LINE			\
-+   do					\
-+     {					\
-+      putchar ('\n');			\
-+      column = 0;			\
-+      offset_out = 0;			\
-+      CLEAR_FLAGS;			\
-+    }					\
-+   while (0)
-+
-+  CLEAR_FLAGS;
-+  memset (&state, '\0', sizeof(mbstate_t));
-+
-+  for (;; bufpos += mblength, buflen -= mblength)
-+    {
-+      if (buflen < MB_LEN_MAX && !feof (istream) && !ferror (istream))
-+	{
-+	  memmove (buf, bufpos, buflen);
-+	  buflen += fread (buf + buflen, sizeof(char), BUFSIZ, istream);
-+	  bufpos = buf;
-+	}
-+
-+      if (buflen < 1)
-+	break;
-+
-+      /* Get a wide character. */
-+      convfail = 0;
-+      state_bak = state;
-+      mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &state);
-+
-+      switch (mblength)
-+	{
-+	case (size_t)-1:
-+	case (size_t)-2:
-+	  convfail++;
-+	  state = state_bak;
-+	  /* Fall through. */
-+
-+	case 0:
-+	  mblength = 1;
-+	  break;
-+	}
-+
-+rescan:
-+      if (operating_mode == byte_mode)			/* byte mode */
-+	increment = mblength;
-+      else if (operating_mode == character_mode)	/* character mode */
-+	increment = 1;
-+      else						/* column mode */
-+	{
-+	  if (convfail)
-+	    increment = 1;
-+	  else
-+	    {
-+	      switch (wc)
-+		{
-+		case L'\n':
-+		  fwrite (line_out, sizeof(char), offset_out, stdout);
-+		  START_NEW_LINE;
-+		  continue;
-+		  
-+		case L'\b':
-+		  increment = (column > 0) ? -1 : 0;
-+		  break;
-+
-+		case L'\r':
-+		  increment = -1 * column;
-+		  break;
-+
-+		case L'\t':
-+		  increment = 8 - column % 8;
-+		  break;
-+
-+		default:
-+		  increment = wcwidth (wc);
-+		  increment = (increment < 0) ? 0 : increment;
-+		}
-+	    }
-+	}
-+
-+      if (column + increment > width && break_spaces && last_blank_pos)
-+	{
-+	  fwrite (line_out, sizeof(char), last_blank_pos, stdout);
-+	  putchar ('\n');
-+
-+	  offset_out = offset_out - last_blank_pos;
-+	  column = column - last_blank_column + ((is_cr_after_last_blank)
-+	      ? last_blank_increment : bs_following_last_blank_num);
-+	  memmove (line_out, line_out + last_blank_pos, offset_out);
-+	  CLEAR_FLAGS;
-+	  goto rescan;
-+	}
-+
-+      if (column + increment > width && column != 0)
-+	{
-+	  fwrite (line_out, sizeof(char), offset_out, stdout);
-+	  START_NEW_LINE;
-+	  goto rescan;
-+	}
-+
-+      if (allocated_out < offset_out + mblength)
-+	{
-+	  allocated_out += 1024;
-+	  line_out = xrealloc (line_out, allocated_out);
-+	}
-+
-+      memcpy (line_out + offset_out, bufpos, mblength);
-+      offset_out += mblength;
-+      column += increment;
-+
-+      if (is_blank_seen && !convfail && wc == L'\r')
-+	is_cr_after_last_blank = 1;
-+
-+      if (is_bs_following_last_blank && !convfail && wc == L'\b')
-+	++bs_following_last_blank_num;
-+      else
-+	is_bs_following_last_blank = 0;
-+
-+      if (break_spaces && !convfail && iswblank (wc))
-+	{
-+	  last_blank_pos = offset_out;
-+	  last_blank_column = column;
-+	  is_blank_seen = 1;
-+	  last_blank_increment = increment;
-+	  is_bs_following_last_blank = 1;
-+	  bs_following_last_blank_num = 0;
-+	  is_cr_after_last_blank = 0;
-+	}
-+    }
-+
-+  *saved_errno = errno;
- 
-   if (offset_out)
-     fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
- 
-+  free(line_out);
-+}
-+#endif
-+
-+/* Fold file FILENAME, or standard input if FILENAME is "-",
-+   to stdout, with maximum line length WIDTH.
-+   Return 0 if successful, 1 if an error occurs. */
-+
-+static bool
-+fold_file (char *filename, size_t width)
-+{
-+  FILE *istream;
-+  int saved_errno;
-+
-+  if (STREQ (filename, "-"))
-+    {
-+      istream = stdin;
-+      have_read_stdin = 1;
-+    }
-+  else
-+    istream = fopen (filename, "r");
-+
-+  if (istream == NULL)
-+    {
-+      error (0, errno, "%s", filename);
-+      return 1;
-+    }
-+
-+  /* Define how ISTREAM is being folded. */
-+#if HAVE_MBRTOWC
-+  if (MB_CUR_MAX > 1)
-+    fold_multibyte_text (istream, width, &saved_errno);
-+  else
-+#endif
-+    fold_text (istream, width, &saved_errno);
-+
-   if (ferror (istream))
-     {
-       error (0, saved_errno, "%s", filename);
-@@ -255,7 +506,8 @@
- 
-   atexit (close_stdout);
- 
--  break_spaces = count_bytes = have_read_stdin = false;
-+  operating_mode = column_mode;
-+  break_spaces = have_read_stdin = false;
- 
-   while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
-     {
-@@ -264,7 +516,15 @@
-       switch (optc)
- 	{
- 	case 'b':		/* Count bytes rather than columns. */
--	  count_bytes = true;
-+	  if (operating_mode != column_mode)
-+	    FATAL_ERROR (_("only one way of folding may be specified"));
-+	  operating_mode = byte_mode;
-+	  break;
-+
-+	case 'c':
-+	  if (operating_mode != column_mode)
-+	    FATAL_ERROR (_("only one way of folding may be specified"));
-+	  operating_mode = character_mode;
- 	  break;
- 
- 	case 's':		/* Break at word boundaries. */
---- coreutils-6.8+/src/sort.c.i18n	2007-02-24 11:23:23.000000000 +0000
-+++ coreutils-6.8+/src/sort.c	2007-03-01 15:10:57.000000000 +0000
-@@ -23,10 +23,19 @@
- 
- #include <config.h>
- 
-+#include <assert.h>
- #include <getopt.h>
- #include <sys/types.h>
- #include <sys/wait.h>
- #include <signal.h>
-+#if HAVE_WCHAR_H
-+# include <wchar.h>
-+#endif
-+/* Get isw* functions. */
-+#if HAVE_WCTYPE_H
-+# include <wctype.h>
-+#endif
-+
- #include "system.h"
- #include "argmatch.h"
- #include "error.h"
-@@ -116,14 +125,38 @@
- /* Thousands separator; if -1, then there isn't one.  */
- static int thousands_sep;
- 
-+static int force_general_numcompare = 0;
-+
- /* Nonzero if the corresponding locales are hard.  */
- static bool hard_LC_COLLATE;
--#if HAVE_NL_LANGINFO
-+#if HAVE_LANGINFO_CODESET
- static bool hard_LC_TIME;
- #endif
- 
- #define NONZERO(x) ((x) != 0)
- 
-+/* get a multibyte character's byte length. */
-+#define GET_BYTELEN_OF_CHAR(LIM, PTR, MBLENGTH, STATE)			\
-+  do									\
-+    {									\
-+      wchar_t wc;							\
-+      mbstate_t state_bak;						\
-+									\
-+      state_bak = STATE;						\
-+      mblength = mbrtowc (&wc, PTR, LIM - PTR, &STATE);			\
-+									\
-+      switch (MBLENGTH)							\
-+	{								\
-+	case (size_t)-1:						\
-+	case (size_t)-2:						\
-+	  STATE = state_bak;						\
-+		/* Fall through. */					\
-+	case 0:								\
-+	  MBLENGTH = 1;							\
-+      }									\
-+    }									\
-+  while (0)
-+
- /* The kind of blanks for '-b' to skip in various options. */
- enum blanktype { bl_start, bl_end, bl_both };
- 
-@@ -261,13 +294,11 @@
-    they were read if all keys compare equal.  */
- static bool stable;
- 
--/* If TAB has this value, blanks separate fields.  */
--enum { TAB_DEFAULT = CHAR_MAX + 1 };
--
--/* Tab character separating fields.  If TAB_DEFAULT, then fields are
-+/* Tab character separating fields.  If tab_length is 0, then fields are
-    separated by the empty string between a non-blank character and a blank
-    character. */
--static int tab = TAB_DEFAULT;
-+static char tab[MB_LEN_MAX + 1];
-+static size_t tab_length = 0;
- 
- /* Flag to remove consecutive duplicate lines from the output.
-    Only the last of a sequence of equal lines will be output. */
-@@ -639,6 +670,44 @@
-     update_proc (pid);
- }
- 
-+/* Function pointers. */
-+static void
-+(*inittables) (void);
-+static char *
-+(*begfield) (const struct line*, const struct keyfield *);
-+static char *
-+(*limfield) (const struct line*, const struct keyfield *);
-+static int
-+(*getmonth) (char const *, size_t);
-+static int
-+(*keycompare) (const struct line *, const struct line *);
-+static int
-+(*numcompare) (const char *, const char *);
-+
-+/* Test for white space multibyte character.
-+   Set LENGTH the byte length of investigated multibyte character. */
-+#if HAVE_MBRTOWC
-+static int
-+ismbblank (const char *str, size_t len, size_t *length)
-+{
-+  size_t mblength;
-+  wchar_t wc;
-+  mbstate_t state;
-+
-+  memset (&state, '\0', sizeof(mbstate_t));
-+  mblength = mbrtowc (&wc, str, len, &state);
-+
-+  if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+    {
-+      *length = 1;
-+      return 0;
-+    }
-+
-+  *length = (mblength < 1) ? 1 : mblength;
-+  return iswblank (wc);
-+}
-+#endif
-+
- /* Clean up any remaining temporary files.  */
- 
- static void
-@@ -978,7 +1047,7 @@
-   free (node);
- }
- 
--#if HAVE_NL_LANGINFO
-+#if HAVE_LANGINFO_CODESET
- 
- static int
- struct_month_cmp (const void *m1, const void *m2)
-@@ -993,7 +1062,7 @@
- /* Initialize the character class tables. */
- 
- static void
--inittables (void)
-+inittables_uni (void)
- {
-   size_t i;
- 
-@@ -1005,7 +1074,7 @@
-       fold_toupper[i] = toupper (i);
-     }
- 
--#if HAVE_NL_LANGINFO
-+#if HAVE_LANGINFO_CODESET
-   /* If we're not in the "C" locale, read different names for months.  */
-   if (hard_LC_TIME)
-     {
-@@ -1031,6 +1100,64 @@
- #endif
- }
- 
-+#if HAVE_MBRTOWC
-+static void
-+inittables_mb (void)
-+{
-+  int i, j, k, l;
-+  char *name, *s;
-+  size_t s_len, mblength;
-+  char mbc[MB_LEN_MAX];
-+  wchar_t wc, pwc;
-+  mbstate_t state_mb, state_wc;
-+
-+  for (i = 0; i < MONTHS_PER_YEAR; i++)
-+    {
-+      s = (char *) nl_langinfo (ABMON_1 + i);
-+      s_len = strlen (s);
-+      monthtab[i].name = name = (char *) xmalloc (s_len + 1);
-+      monthtab[i].val = i + 1;
-+
-+      memset (&state_mb, '\0', sizeof (mbstate_t));
-+      memset (&state_wc, '\0', sizeof (mbstate_t));
-+
-+      for (j = 0; j < s_len;)
-+	{
-+	  if (!ismbblank (s + j, s_len - j, &mblength))
-+	    break;
-+	  j += mblength;
-+	}
-+
-+      for (k = 0; j < s_len;)
-+	{
-+	  mblength = mbrtowc (&wc, (s + j), (s_len - j), &state_mb);
-+	  assert (mblength != (size_t)-1 && mblength != (size_t)-2);
-+	  if (mblength == 0)
-+	    break;
-+
-+	  pwc = towupper (wc);
-+	  if (pwc == wc)
-+	    {
-+	      memcpy (mbc, s + j, mblength);
-+	      j += mblength;
-+	    }
-+	  else
-+	    {
-+	      j += mblength;
-+	      mblength = wcrtomb (mbc, pwc, &state_wc);
-+	      assert (mblength != (size_t)0 && mblength != (size_t)-1);
-+	    }
-+
-+	  for (l = 0; l < mblength; l++)
-+	    name[k++] = mbc[l];
-+	}
-+      name[k] = '\0';
-+    }
-+  qsort ((void *) monthtab, MONTHS_PER_YEAR,
-+      sizeof (struct month), struct_month_cmp);
-+}
-+#endif
-+
- /* Specify the amount of main memory to use when sorting.  */
- static void
- specify_sort_size (char const *s)
-@@ -1241,7 +1368,7 @@
-    by KEY in LINE. */
- 
- static char *
--begfield (const struct line *line, const struct keyfield *key)
-+begfield_uni (const struct line *line, const struct keyfield *key)
- {
-   char *ptr = line->text, *lim = ptr + line->length - 1;
-   size_t sword = key->sword;
-@@ -1251,10 +1378,10 @@
-   /* The leading field separator itself is included in a field when -t
-      is absent.  */
- 
--  if (tab != TAB_DEFAULT)
-+  if (tab_length)
-     while (ptr < lim && sword--)
-       {
--	while (ptr < lim && *ptr != tab)
-+	while (ptr < lim && *ptr != tab[0])
- 	  ++ptr;
- 	if (ptr < lim)
- 	  ++ptr;
-@@ -1282,11 +1409,70 @@
-   return ptr;
- }
- 
-+#if HAVE_MBRTOWC
-+static char *
-+begfield_mb (const struct line *line, const struct keyfield *key)
-+{
-+  int i;
-+  char *ptr = line->text, *lim = ptr + line->length - 1;
-+  size_t sword = key->sword;
-+  size_t schar = key->schar;
-+  size_t mblength;
-+  mbstate_t state;
-+
-+  memset (&state, '\0', sizeof(mbstate_t));
-+
-+  if (tab_length)
-+    while (ptr < lim && sword--)
-+      {
-+	while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
-+	  {
-+	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
-+	    ptr += mblength;
-+	  }
-+	if (ptr < lim)
-+	  {
-+	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
-+	    ptr += mblength;
-+	  }
-+      }
-+  else
-+    while (ptr < lim && sword--)
-+      {
-+	while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
-+	  ptr += mblength;
-+	if (ptr < lim)
-+	  {
-+	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
-+	    ptr += mblength;
-+	  }
-+	while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
-+	  ptr += mblength;
-+      }
-+
-+  if (key->skipsblanks)
-+    while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
-+      ptr += mblength;
-+
-+  for (i = 0; i < schar; i++)
-+    {
-+      GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
-+
-+      if (ptr + mblength > lim)
-+	break;
-+      else
-+	ptr += mblength;
-+    }
-+
-+  return ptr;
-+}
-+#endif
-+
- /* Return the limit of (a pointer to the first character after) the field
-    in LINE specified by KEY. */
- 
- static char *
--limfield (const struct line *line, const struct keyfield *key)
-+limfield_uni (const struct line *line, const struct keyfield *key)
- {
-   char *ptr = line->text, *lim = ptr + line->length - 1;
-   size_t eword = key->eword, echar = key->echar;
-@@ -1299,10 +1485,10 @@
-      `beginning' is the first character following the delimiting TAB.
-      Otherwise, leave PTR pointing at the first `blank' character after
-      the preceding field.  */
--  if (tab != TAB_DEFAULT)
-+  if (tab_length)
-     while (ptr < lim && eword--)
-       {
--	while (ptr < lim && *ptr != tab)
-+	while (ptr < lim && *ptr != tab[0])
- 	  ++ptr;
- 	if (ptr < lim && (eword | echar))
- 	  ++ptr;
-@@ -1348,10 +1534,10 @@
-      */
- 
-   /* Make LIM point to the end of (one byte past) the current field.  */
--  if (tab != TAB_DEFAULT)
-+  if (tab_length)
-     {
-       char *newlim;
--      newlim = memchr (ptr, tab, lim - ptr);
-+      newlim = memchr (ptr, tab[0], lim - ptr);
-       if (newlim)
- 	lim = newlim;
-     }
-@@ -1384,6 +1570,107 @@
-   return ptr;
- }
- 
-+#if HAVE_MBRTOWC
-+static char *
-+limfield_mb (const struct line *line, const struct keyfield *key)
-+{
-+  char *ptr = line->text, *lim = ptr + line->length - 1;
-+  size_t eword = key->eword, echar = key->echar;
-+  int i;
-+  size_t mblength;
-+  mbstate_t state;
-+
-+  memset (&state, '\0', sizeof(mbstate_t));
-+
-+  if (tab_length)
-+    while (ptr < lim && eword--)
-+      {
-+	while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
-+	  {
-+	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
-+	    ptr += mblength;
-+	  }
-+	if (ptr < lim && (eword | echar))
-+	  {
-+	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
-+	    ptr += mblength;
-+	  }
-+      }
-+  else
-+    while (ptr < lim && eword--)
-+      {
-+	while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
-+	  ptr += mblength;
-+	if (ptr < lim)
-+	  {
-+	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
-+	    ptr += mblength;
-+	  }
-+	while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
-+	  ptr += mblength;
-+      }
-+
-+
-+# ifdef POSIX_UNSPECIFIED
-+  /* Make LIM point to the end of (one byte past) the current field.  */
-+  if (tab_length)
-+    {
-+      char *newlim, *p;
-+
-+      newlim = NULL;
-+      for (p = ptr; p < lim;)
-+ 	{
-+	  if (memcmp (p, tab, tab_length) == 0)
-+	    {
-+	      newlim = p;
-+	      break;
-+	    }
-+
-+	  GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
-+	  p += mblength;
-+	}
-+    }
-+  else
-+    {
-+      char *newlim;
-+      newlim = ptr;
-+
-+      while (newlim < lim && ismbblank (newlim, lim - newlim, &mblength))
-+	newlim += mblength;
-+      if (ptr < lim)
-+	{
-+	  GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
-+	  ptr += mblength;
-+	}
-+      while (newlim < lim && !ismbblank (newlim, lim - newlim, &mblength))
-+	newlim += mblength;
-+      lim = newlim;
-+    }
-+# endif
-+
-+  /* If we're skipping leading blanks, don't start counting characters
-+   *      until after skipping past any leading blanks.  */
-+  if (key->skipsblanks)
-+    while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
-+      ptr += mblength;
-+
-+  memset (&state, '\0', sizeof(mbstate_t));
-+
-+  /* Advance PTR by ECHAR (if possible), but no further than LIM.  */
-+  for (i = 0; i < echar; i++)
-+    {
-+      GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
-+
-+      if (ptr + mblength > lim)
-+	break;
-+      else
-+	ptr += mblength;
-+    }
-+
-+  return ptr;
-+}
-+#endif
-+
- /* Fill BUF reading from FP, moving buf->left bytes from the end
-    of buf->buf to the beginning first.  If EOF is reached and the
-    file wasn't terminated by a newline, supply one.  Set up BUF's line
-@@ -1466,8 +1753,24 @@
- 		  else
- 		    {
- 		      if (key->skipsblanks)
--			while (blanks[to_uchar (*line_start)])
--			  line_start++;
-+			{
-+#if HAVE_MBRTOWC
-+			  if (MB_CUR_MAX > 1)
-+			    {
-+			      size_t mblength;
-+			      mbstate_t state;
-+			      memset (&state, '\0', sizeof(mbstate_t));
-+			      while (line_start < line->keylim &&
-+				     ismbblank (line_start,
-+						line->keylim - line_start,
-+						&mblength))
-+				line_start += mblength;
-+			    }
-+			  else
-+#endif
-+			  while (blanks[to_uchar (*line_start)])
-+			    line_start++;
-+			}
- 		      line->keybeg = line_start;
- 		    }
- 		}
-@@ -1500,7 +1803,7 @@
-    hideously fast. */
- 
- static int
--numcompare (const char *a, const char *b)
-+numcompare_uni (const char *a, const char *b)
- {
-   while (blanks[to_uchar (*a)])
-     a++;
-@@ -1510,6 +1813,25 @@
-   return strnumcmp (a, b, decimal_point, thousands_sep);
- }
- 
-+#if HAVE_MBRTOWC
-+static int
-+numcompare_mb (const char *a, const char *b)
-+{
-+  size_t mblength, len;
-+  len = strlen (a); /* okay for UTF-8 */
-+  while (*a && ismbblank (a, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
-+    {
-+      a += mblength;
-+      len -= mblength;
-+    }
-+  len = strlen (b); /* okay for UTF-8 */
-+  while (*b && ismbblank (b, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
-+    b += mblength;
-+
-+  return strnumcmp (a, b, decimal_point, thousands_sep);
-+}
-+#endif /* HAV_EMBRTOWC */
-+
- static int
- general_numcompare (const char *sa, const char *sb)
- {
-@@ -1543,7 +1865,7 @@
-    Return 0 if the name in S is not recognized.  */
- 
- static int
--getmonth (char const *month, size_t len)
-+getmonth_uni (char const *month, size_t len)
- {
-   size_t lo = 0;
-   size_t hi = MONTHS_PER_YEAR;
-@@ -1698,11 +2020,79 @@
-   return diff;
- }
- 
-+#if HAVE_MBRTOWC
-+static int
-+getmonth_mb (const char *s, size_t len)
-+{
-+  char *month;
-+  register size_t i;
-+  register int lo = 0, hi = MONTHS_PER_YEAR, result;
-+  char *tmp;
-+  size_t wclength, mblength;
-+  const char **pp;
-+  const wchar_t **wpp;
-+  wchar_t *month_wcs;
-+  mbstate_t state;
-+
-+  while (len > 0 && ismbblank (s, len, &mblength))
-+    {
-+      s += mblength;
-+      len -= mblength;
-+    }
-+
-+  if (len == 0)
-+    return 0;
-+
-+  month = (char *) alloca (len + 1);
-+
-+  tmp = (char *) alloca (len + 1);
-+  memcpy (tmp, s, len);
-+  tmp[len] = '\0';
-+  pp = (const char **)&tmp;
-+  month_wcs = (wchar_t *) alloca ((len + 1) * sizeof (wchar_t));
-+  memset (&state, '\0', sizeof(mbstate_t));
-+
-+  wclength = mbsrtowcs (month_wcs, pp, len + 1, &state);
-+  assert (wclength != (size_t)-1 && *pp == NULL);
-+
-+  for (i = 0; i < wclength; i++)
-+    {
-+      month_wcs[i] = towupper(month_wcs[i]);
-+      if (iswblank (month_wcs[i]))
-+	{
-+	  month_wcs[i] = L'\0';
-+	  break;
-+	}
-+    }
-+
-+  wpp = (const wchar_t **)&month_wcs;
-+
-+  mblength = wcsrtombs (month, wpp, len + 1, &state);
-+  assert (mblength != (-1) && *wpp == NULL);
-+
-+  do
-+    {
-+      int ix = (lo + hi) / 2;
-+
-+      if (strncmp (month, monthtab[ix].name, strlen (monthtab[ix].name)) < 0)
-+	hi = ix;
-+      else
-+	lo = ix;
-+    }
-+  while (hi - lo > 1);
-+
-+  result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name))
-+      ? monthtab[lo].val : 0);
-+
-+  return result;
-+}
-+#endif
-+
- /* Compare two lines A and B trying every key in sequence until there
-    are no more keys or a difference is found. */
- 
- static int
--keycompare (const struct line *a, const struct line *b)
-+keycompare_uni (const struct line *a, const struct line *b)
- {
-   struct keyfield const *key = keylist;
- 
-@@ -1875,6 +2265,179 @@
-   return key->reverse ? -diff : diff;
- }
- 
-+#if HAVE_MBRTOWC
-+static int
-+keycompare_mb (const struct line *a, const struct line *b)
-+{
-+  struct keyfield *key = keylist;
-+
-+  /* For the first iteration only, the key positions have been
-+     precomputed for us. */
-+  char *texta = a->keybeg;
-+  char *textb = b->keybeg;
-+  char *lima = a->keylim;
-+  char *limb = b->keylim;
-+
-+  size_t mblength_a, mblength_b;
-+  wchar_t wc_a, wc_b;
-+  mbstate_t state_a, state_b;
-+
-+  int diff;
-+
-+  memset (&state_a, '\0', sizeof(mbstate_t));
-+  memset (&state_b, '\0', sizeof(mbstate_t));
-+
-+  for (;;)
-+    {
-+      unsigned char *translate = (unsigned char *) key->translate;
-+      bool const *ignore = key->ignore;
-+
-+      /* Find the lengths. */
-+      size_t lena = lima <= texta ? 0 : lima - texta;
-+      size_t lenb = limb <= textb ? 0 : limb - textb;
-+
-+      /* Actually compare the fields. */
-+      if (key->random)
-+        diff = compare_random (texta, lena, textb, lenb);
-+      else if (key->numeric | key->general_numeric)
-+	{
-+	  char savea = *lima, saveb = *limb;
-+
-+	  *lima = *limb = '\0';
-+	  if (force_general_numcompare)
-+	    diff = general_numcompare (texta, textb);
-+	  else
-+	    diff = ((key->numeric ? numcompare : general_numcompare)
-+		(texta, textb));
-+	  *lima = savea, *limb = saveb;
-+	}
-+      else if (key->month)
-+	diff = getmonth (texta, lena) - getmonth (textb, lenb);
-+      else
-+	{
-+	  if (ignore || translate)
-+	    {
-+	      char *copy_a = (char *) alloca (lena + 1 + lenb + 1);
-+	      char *copy_b = copy_a + lena + 1;
-+	      size_t new_len_a, new_len_b;
-+	      size_t i, j;
-+
-+	      /* Ignore and/or translate chars before comparing.  */
-+# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE)	\
-+  do									\
-+    {									\
-+      wchar_t uwc;							\
-+      char mbc[MB_LEN_MAX];						\
-+      mbstate_t state_wc;						\
-+									\
-+      for (NEW_LEN = i = 0; i < LEN;)					\
-+	{								\
-+	  mbstate_t state_bak;						\
-+									\
-+	  state_bak = STATE;						\
-+	  MBLENGTH = mbrtowc (&WC, TEXT + i, LEN - i, &STATE);		\
-+									\
-+	  if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1		\
-+	      || MBLENGTH == 0)						\
-+	    {								\
-+	      if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1)	\
-+		STATE = state_bak;					\
-+	      if (!ignore)						\
-+		COPY[NEW_LEN++] = TEXT[i++];				\
-+	      continue;							\
-+	    }								\
-+									\
-+	  if (ignore)							\
-+	    {								\
-+	      if ((ignore == nonprinting && !iswprint (WC))		\
-+		   || (ignore == nondictionary				\
-+		       && !iswalnum (WC) && !iswblank (WC)))		\
-+		{							\
-+		  i += MBLENGTH;					\
-+		  continue;						\
-+		}							\
-+	    }								\
-+									\
-+	  if (translate)						\
-+	    {								\
-+									\
-+	      uwc = towupper(WC);					\
-+	      if (WC == uwc)						\
-+		{							\
-+		  memcpy (mbc, TEXT + i, MBLENGTH);			\
-+		  i += MBLENGTH;					\
-+		}							\
-+	      else							\
-+		{							\
-+		  i += MBLENGTH;					\
-+		  WC = uwc;						\
-+		  memset (&state_wc, '\0', sizeof (mbstate_t));		\
-+									\
-+		  MBLENGTH = wcrtomb (mbc, WC, &state_wc);		\
-+		  assert (MBLENGTH != (size_t)-1 && MBLENGTH != 0);	\
-+		}							\
-+									\
-+	      for (j = 0; j < MBLENGTH; j++)				\
-+		COPY[NEW_LEN++] = mbc[j];				\
-+	    }								\
-+	  else								\
-+	    for (j = 0; j < MBLENGTH; j++)				\
-+	      COPY[NEW_LEN++] = TEXT[i++];				\
-+	}								\
-+      COPY[NEW_LEN] = '\0';						\
-+    }									\
-+  while (0)
-+	      IGNORE_CHARS (new_len_a, lena, texta, copy_a,
-+			    wc_a, mblength_a, state_a);
-+	      IGNORE_CHARS (new_len_b, lenb, textb, copy_b,
-+			    wc_b, mblength_b, state_b);
-+	      diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b);
-+	    }
-+	  else if (lena == 0)
-+	    diff = - NONZERO (lenb);
-+	  else if (lenb == 0)
-+	    goto greater;
-+	  else
-+	    diff = xmemcoll (texta, lena, textb, lenb);
-+	}
-+
-+      if (diff)
-+	goto not_equal;
-+
-+      key = key->next;
-+      if (! key)
-+	break;
-+
-+      /* Find the beginning and limit of the next field.  */
-+      if (key->eword != -1)
-+	lima = limfield (a, key), limb = limfield (b, key);
-+      else
-+	lima = a->text + a->length - 1, limb = b->text + b->length - 1;
-+
-+      if (key->sword != -1)
-+	texta = begfield (a, key), textb = begfield (b, key);
-+      else
-+	{
-+	  texta = a->text, textb = b->text;
-+	  if (key->skipsblanks)
-+	    {
-+	      while (texta < lima && ismbblank (texta, lima - texta, &mblength_a))
-+		texta += mblength_a;
-+	      while (textb < limb && ismbblank (textb, limb - textb, &mblength_b))
-+		textb += mblength_b;
-+	    }
-+	}
-+    }
-+
-+  return 0;
-+
-+greater:
-+  diff = 1;
-+not_equal:
-+  return key->reverse ? -diff : diff;
-+}
-+#endif
-+
- /* Compare two lines A and B, returning negative, zero, or positive
-    depending on whether A compares less than, equal to, or greater than B. */
-
-@@ -2744,7 +3305,7 @@
-   initialize_exit_failure (SORT_FAILURE);
- 
-   hard_LC_COLLATE = hard_locale (LC_COLLATE);
--#if HAVE_NL_LANGINFO
-+#if HAVE_LANGINFO_CODESET
-   hard_LC_TIME = hard_locale (LC_TIME);
- #endif
- 
-@@ -2765,6 +3326,27 @@
-       thousands_sep = -1;
-   }
- 
-+#if HAVE_MBRTOWC
-+  if (MB_CUR_MAX > 1)
-+    {
-+      inittables = inittables_mb;
-+      begfield = begfield_mb;
-+      limfield = limfield_mb;
-+      getmonth = getmonth_mb;
-+      keycompare = keycompare_mb;
-+      numcompare = numcompare_mb;
-+    }
-+  else
-+#endif
-+    {
-+      inittables = inittables_uni;
-+      begfield = begfield_uni;
-+      limfield = limfield_uni;
-+      getmonth = getmonth_uni;
-+      keycompare = keycompare_uni;
-+      numcompare = numcompare_uni;
-+    }
-+
-   have_read_stdin = false;
-   inittables ();
- 
-@@ -3015,13 +3597,35 @@
- 
- 	case 't':
- 	  {
--	    char newtab = optarg[0];
--	    if (! newtab)
-+	    char newtab[MB_LEN_MAX + 1];
-+	    size_t newtab_length = 1;
-+	    strncpy (newtab, optarg, MB_LEN_MAX);
-+	    if (! newtab[0])
- 	      error (SORT_FAILURE, 0, _("empty tab"));
--	    if (optarg[1])
-+#if HAVE_MBRTOWC
-+	    if (MB_CUR_MAX > 1)
-+	      {
-+		wchar_t wc;
-+		mbstate_t state;
-+		size_t i;
-+
-+		memset (&state, '\0', sizeof (mbstate_t));
-+		newtab_length = mbrtowc (&wc, newtab, strnlen (newtab,
-+							       MB_LEN_MAX),
-+					 &state);
-+		switch (newtab_length)
-+		  {
-+		  case (size_t) -1:
-+		  case (size_t) -2:
-+		  case 0:
-+		    newtab_length = 1;
-+		  }
-+	      }
-+#endif
-+	    if (newtab_length == 1 && optarg[1])
- 	      {
- 		if (STREQ (optarg, "\\0"))
--		  newtab = '\0';
-+		  newtab[0] = '\0';
- 		else
- 		  {
- 		    /* Provoke with `sort -txx'.  Complain about
-@@ -3032,9 +3636,12 @@
- 			   quote (optarg));
- 		  }
- 	      }
--	    if (tab != TAB_DEFAULT && tab != newtab)
-+	    if (tab_length
-+		&& (tab_length != newtab_length
-+		    || memcmp (tab, newtab, tab_length) != 0))
- 	      error (SORT_FAILURE, 0, _("incompatible tabs"));
--	    tab = newtab;
-+	    memcpy (tab, newtab, newtab_length);
-+	    tab_length = newtab_length;
- 	  }
- 	  break;
- 
---- coreutils-6.8+/src/unexpand.c.i18n	2007-01-14 15:41:28.000000000 +0000
-+++ coreutils-6.8+/src/unexpand.c	2007-03-01 15:08:24.000000000 +0000
-@@ -39,11 +39,28 @@
- #include <stdio.h>
- #include <getopt.h>
- #include <sys/types.h>
-+
-+/* Get mbstate_t, mbrtowc(), wcwidth(). */
-+#if HAVE_WCHAR_H
-+# include <wchar.h>
-+#endif
-+
- #include "system.h"
- #include "error.h"
- #include "quote.h"
- #include "xstrndup.h"
- 
-+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
-+      installation; work around this configuration error.  */
-+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
-+# define MB_LEN_MAX 16
-+#endif
-+
-+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
-+#if HAVE_MBRTOWC && defined mbstate_t
-+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-+#endif
-+
- /* The official name of this program (e.g., no `g' prefix).  */
- #define PROGRAM_NAME "unexpand"
- 
-@@ -110,6 +127,208 @@
-   {NULL, 0, NULL, 0}
- };
- 
-+static FILE *next_file (FILE *fp);
-+
-+#if HAVE_MBRTOWC
-+static void
-+unexpand_multibyte (void)
-+{
-+  FILE *fp;			/* Input stream. */
-+  mbstate_t i_state;		/* Current shift state of the input stream. */
-+  mbstate_t i_state_bak;	/* Back up the I_STATE. */
-+  mbstate_t o_state;		/* Current shift state of the output stream. */
-+  char buf[MB_LEN_MAX + BUFSIZ];  /* For spooling a read byte sequence. */
-+  char *bufpos;			/* Next read position of BUF. */
-+  size_t buflen = 0;		/* The length of the byte sequence in buf. */
-+  wint_t wc;			/* A gotten wide character. */
-+  size_t mblength;		/* The byte size of a multibyte character
-+				   which shows as same character as WC. */
-+
-+  /* Index in `tab_list' of next tabstop: */
-+  int tab_index = 0;		/* For calculating width of pending tabs. */
-+  int print_tab_index = 0;	/* For printing as many tabs as possible. */
-+  unsigned int column = 0;	/* Column on screen of next char. */
-+  int next_tab_column;		/* Column the next tab stop is on. */
-+  int convert = 1;		/* If nonzero, perform translations. */
-+  unsigned int pending = 0;	/* Pending columns of blanks. */
-+
-+  fp = next_file ((FILE *) NULL);
-+  if (fp == NULL)
-+    return;
-+
-+  memset (&o_state, '\0', sizeof(mbstate_t));
-+  memset (&i_state, '\0', sizeof(mbstate_t));
-+
-+  for (;;)
-+    {
-+      if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
-+	{
-+	  memmove (buf, bufpos, buflen);
-+	  buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
-+	  bufpos = buf;
-+	}
-+
-+      /* Get a wide character. */
-+      if (buflen < 1)
-+	{
-+	  mblength = 1;
-+	  wc = WEOF;
-+	}
-+      else
-+	{
-+	  i_state_bak = i_state;
-+	  mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &i_state);
-+	}
-+
-+      if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+	{
-+	  i_state = i_state_bak;
-+	  wc = L'\0';
-+	}
-+
-+      if (wc == L' ' && convert && column < INT_MAX)
-+	{
-+	  ++pending;
-+	  ++column;
-+	}
-+      else if (wc == L'\t' && convert)
-+	{
-+	  if (tab_size == 0)
-+	    {
-+	      /* Do not let tab_index == first_free_tab;
-+		 stop when it is 1 less. */
-+	      while (tab_index < first_free_tab - 1
-+		  && column >= tab_list[tab_index])
-+		tab_index++;
-+	      next_tab_column = tab_list[tab_index];
-+	      if (tab_index < first_free_tab - 1)
-+		tab_index++;
-+	      if (column >= next_tab_column)
-+		{
-+		  convert = 0;	/* Ran out of tab stops. */
-+		  goto flush_pend_mb;
-+		}
-+	    }
-+	  else
-+	    {
-+	      next_tab_column = column + tab_size - column % tab_size;
-+	    }
-+	  pending += next_tab_column - column;
-+	  column = next_tab_column;
-+	}
-+      else
-+	{
-+flush_pend_mb:
-+	  /* Flush pending spaces.  Print as many tabs as possible,
-+	     then print the rest as spaces. */
-+	  if (pending == 1)
-+	    {
-+	      putchar (' ');
-+	      pending = 0;
-+	    }
-+	  column -= pending;
-+	  while (pending > 0)
-+	    {
-+	      if (tab_size == 0)
-+		{
-+		  /* Do not let print_tab_index == first_free_tab;
-+		     stop when it is 1 less. */
-+		  while (print_tab_index < first_free_tab - 1
-+		      && column >= tab_list[print_tab_index])
-+		    print_tab_index++;
-+		  next_tab_column = tab_list[print_tab_index];
-+		  if (print_tab_index < first_free_tab - 1)
-+		    print_tab_index++;
-+		}
-+	      else
-+		{
-+		  next_tab_column =
-+		    column + tab_size - column % tab_size;
-+		}
-+	      if (next_tab_column - column <= pending)
-+		{
-+		  putchar ('\t');
-+		  pending -= next_tab_column - column;
-+		  column = next_tab_column;
-+		}
-+	      else
-+		{
-+		  --print_tab_index;
-+		  column += pending;
-+		  while (pending != 0)
-+		    {
-+		      putchar (' ');
-+		      pending--;
-+		    }
-+		}
-+	    }
-+
-+	  if (wc == WEOF)
-+	    {
-+	      fp = next_file (fp);
-+	      if (fp == NULL)
-+		break;          /* No more files. */
-+	      else
-+		{
-+		  memset (&i_state, '\0', sizeof(mbstate_t));
-+		  continue;
-+		}
-+	    }
-+
-+	  if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+	    {
-+	      if (convert)
-+		{
-+		  ++column;
-+		  if (convert_entire_line == 0)
-+		    convert = 0;
-+		}
-+	      mblength = 1;
-+	      putchar (buf[0]);
-+	    }
-+	  else if (mblength == 0)
-+	    {
-+	      if (convert && convert_entire_line == 0)
-+		convert = 0;
-+	      mblength = 1;
-+	      putchar ('\0');
-+	    }
-+	  else
-+	    {
-+	      if (convert)
-+		{
-+		  if (wc == L'\b')
-+		    {
-+		      if (column > 0)
-+			--column;
-+		    }
-+		  else
-+		    {
-+		      int width;            /* The width of WC. */
-+
-+		      width = wcwidth (wc);
-+		      column += (width > 0) ? width : 0;
-+		      if (convert_entire_line == 0)
-+			convert = 0;
-+		    }
-+		}
-+
-+	      if (wc == L'\n')
-+		{
-+		  tab_index = print_tab_index = 0;
-+		  column = pending = 0;
-+		  convert = 1;
-+		}
-+	      fwrite (bufpos, sizeof(char), mblength, stdout);
-+	    }
-+	}
-+      buflen -= mblength;
-+      bufpos += mblength;
-+    }
-+}
-+#endif
-+
-+
- void
- usage (int status)
- {
-@@ -531,7 +750,12 @@
- 
-   file_list = (optind < argc ? &argv[optind] : stdin_argv);
- 
--  unexpand ();
-+#if HAVE_MBRTOWC
-+  if (MB_CUR_MAX > 1)
-+    unexpand_multibyte ();
-+  else
-+#endif
-+    unexpand ();
- 
-   if (have_read_stdin && fclose (stdin) != 0)
-     error (EXIT_FAILURE, errno, "-");
---- coreutils-6.8+/src/pr.c.i18n	2007-01-14 15:41:28.000000000 +0000
-+++ coreutils-6.8+/src/pr.c	2007-03-01 15:08:24.000000000 +0000
-@@ -313,6 +313,32 @@
- 
- #include <getopt.h>
- #include <sys/types.h>
-+
-+/* Get MB_LEN_MAX.  */
-+#include <limits.h>
-+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
-+   installation; work around this configuration error.  */
-+#if !defined MB_LEN_MAX || MB_LEN_MAX == 1
-+# define MB_LEN_MAX 16
-+#endif
-+
-+/* Get MB_CUR_MAX.  */
-+#include <stdlib.h>
-+
-+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
-+/* Get mbstate_t, mbrtowc(), wcwidth().  */
-+#if HAVE_WCHAR_H
-+# include <wchar.h>
-+#endif
-+
-+/* Get iswprint(). -- for wcwidth().  */
-+#if HAVE_WCTYPE_H
-+# include <wctype.h>
-+#endif
-+#if !defined iswprint && !HAVE_ISWPRINT
-+# define iswprint(wc) 1
-+#endif
-+
- #include "system.h"
- #include "error.h"
- #include "hard-locale.h"
-@@ -324,6 +350,18 @@
- #include "strftime.h"
- #include "xstrtol.h"
- 
-+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
-+#if HAVE_MBRTOWC && defined mbstate_t
-+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-+#endif
-+
-+#ifndef HAVE_DECL_WCWIDTH
-+"this configure-time declaration test was not run"
-+#endif
-+#if !HAVE_DECL_WCWIDTH
-+extern int wcwidth ();
-+#endif
-+
- /* The official name of this program (e.g., no `g' prefix).  */
- #define PROGRAM_NAME "pr"
- 
-@@ -416,7 +454,20 @@
- 
- #define NULLCOL (COLUMN *)0
- 
--static int char_to_clump (char c);
-+/* Funtion pointers to switch functions for single byte locale or for
-+   multibyte locale. If multibyte functions do not exist in your sysytem,
-+   these pointers always point the function for single byte locale. */
-+static void (*print_char) (char c);
-+static int (*char_to_clump) (char c);
-+
-+/* Functions for single byte locale. */
-+static void print_char_single (char c);
-+static int char_to_clump_single (char c);
-+
-+/* Functions for multibyte locale. */
-+static void print_char_multi (char c);
-+static int char_to_clump_multi (char c);
-+
- static bool read_line (COLUMN *p);
- static bool print_page (void);
- static bool print_stored (COLUMN *p);
-@@ -426,6 +477,7 @@
- static void pad_across_to (int position);
- static void add_line_number (COLUMN *p);
- static void getoptarg (char *arg, char switch_char, char *character,
-+		       int *character_length, int *character_width,
- 		       int *number);
- void usage (int status);
- static void print_files (int number_of_files, char **av);
-@@ -440,7 +492,6 @@
- static void pad_down (int lines);
- static void read_rest_of_line (COLUMN *p);
- static void skip_read (COLUMN *p, int column_number);
--static void print_char (char c);
- static void cleanup (void);
- static void print_sep_string (void);
- static void separator_string (const char *optarg_S);
-@@ -455,7 +506,7 @@
-    we store the leftmost columns contiguously in buff.
-    To print a line from buff, get the index of the first character
-    from line_vector[i], and print up to line_vector[i + 1]. */
--static char *buff;
-+static unsigned char *buff;
- 
- /* Index of the position in buff where the next character
-    will be stored. */
-@@ -559,7 +610,7 @@
- static bool untabify_input = false;
- 
- /* (-e) The input tab character. */
--static char input_tab_char = '\t';
-+static char input_tab_char[MB_LEN_MAX] = "\t";
- 
- /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ...
-    where the leftmost column is 1. */
-@@ -569,7 +620,10 @@
- static bool tabify_output = false;
- 
- /* (-i) The output tab character. */
--static char output_tab_char = '\t';
-+static char output_tab_char[MB_LEN_MAX] = "\t";
-+
-+/* (-i) The byte length of output tab character. */
-+static int output_tab_char_length = 1;
- 
- /* (-i) The width of the output tab. */
- static int chars_per_output_tab = 8;
-@@ -643,7 +697,13 @@
- static bool numbered_lines = false;
- 
- /* (-n) Character which follows each line number. */
--static char number_separator = '\t';
-+static char number_separator[MB_LEN_MAX] = "\t";
-+
-+/* (-n) The byte length of the character which follows each line number. */
-+static int number_separator_length = 1;
-+
-+/* (-n) The character width of the character which follows each line number. */
-+static int number_separator_width = 0;
- 
- /* (-n) line counting starts with 1st line of input file (not with 1st
-    line of 1st page printed). */
-@@ -696,6 +756,7 @@
-    -a|COLUMN|-m is a `space' and with the -J option a `tab'. */
- static char *col_sep_string = "";
- static int col_sep_length = 0;
-+static int col_sep_width = 0;
- static char *column_separator = " ";
- static char *line_separator = "\t";
- 
-@@ -852,6 +913,13 @@
-   col_sep_length = (int) strlen (optarg_S);
-   col_sep_string = xmalloc (col_sep_length + 1);
-   strcpy (col_sep_string, optarg_S);
-+
-+#if HAVE_MBRTOWC
-+  if (MB_CUR_MAX > 1)
-+    col_sep_width = mbswidth (col_sep_string, 0);
-+  else
-+#endif
-+    col_sep_width = col_sep_length;
- }
- 
- int
-@@ -877,6 +945,21 @@
- 
-   atexit (close_stdout);
- 
-+/* Define which functions are used, the ones for single byte locale or the ones
-+   for multibyte locale. */
-+#if HAVE_MBRTOWC
-+  if (MB_CUR_MAX > 1)
-+    {
-+      print_char = print_char_multi;
-+      char_to_clump = char_to_clump_multi;
-+    }
-+  else
-+#endif
-+    {
-+      print_char = print_char_single;
-+      char_to_clump = char_to_clump_single;
-+    }
-+
-   n_files = 0;
-   file_names = (argc > 1
- 		? xmalloc ((argc - 1) * sizeof (char *))
-@@ -949,8 +1032,12 @@
- 	  break;
- 	case 'e':
- 	  if (optarg)
--	    getoptarg (optarg, 'e', &input_tab_char,
--		       &chars_per_input_tab);
-+	    {
-+	      int dummy_length, dummy_width;
-+
-+	      getoptarg (optarg, 'e', input_tab_char, &dummy_length,
-+			 &dummy_width, &chars_per_input_tab);
-+	    }
- 	  /* Could check tab width > 0. */
- 	  untabify_input = true;
- 	  break;
-@@ -963,8 +1050,12 @@
- 	  break;
- 	case 'i':
- 	  if (optarg)
--	    getoptarg (optarg, 'i', &output_tab_char,
--		       &chars_per_output_tab);
-+	    {
-+	      int dummy_width;
-+
-+	      getoptarg (optarg, 'i', output_tab_char, &output_tab_char_length,
-+			 &dummy_width, &chars_per_output_tab);
-+	    }
- 	  /* Could check tab width > 0. */
- 	  tabify_output = true;
- 	  break;
-@@ -991,8 +1082,8 @@
- 	case 'n':
- 	  numbered_lines = true;
- 	  if (optarg)
--	    getoptarg (optarg, 'n', &number_separator,
--		       &chars_per_number);
-+	    getoptarg (optarg, 'n', number_separator, &number_separator_length,
-+		       &number_separator_width, &chars_per_number);
- 	  break;
- 	case 'N':
- 	  skip_count = false;
-@@ -1031,7 +1122,7 @@
- 	  old_s = false;
- 	  /* Reset an additional input of -s, -S dominates -s */
- 	  col_sep_string = "";
--	  col_sep_length = 0;
-+	  col_sep_length = col_sep_width = 0;
- 	  use_col_separator = true;
- 	  if (optarg)
- 	    separator_string (optarg);
-@@ -1188,10 +1279,45 @@
-    a number. */
- 
- static void
--getoptarg (char *arg, char switch_char, char *character, int *number)
-+getoptarg (char *arg, char switch_char, char *character, int *character_length,
-+	   int *character_width, int *number)
- {
-   if (!ISDIGIT (*arg))
--    *character = *arg++;
-+    {
-+#ifdef HAVE_MBRTOWC
-+      if (MB_CUR_MAX > 1)	/* for multibyte locale. */
-+	{
-+	  wchar_t wc;
-+	  size_t mblength;
-+	  int width;
-+	  mbstate_t state = {'\0'};
-+
-+	  mblength = mbrtowc (&wc, arg, strnlen(arg, MB_LEN_MAX), &state);
-+
-+	  if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+	    {
-+	      *character_length = 1;
-+	      *character_width = 1;
-+	    }
-+	  else
-+	    {
-+	      *character_length = (mblength < 1) ? 1 : mblength;
-+	      width = wcwidth (wc);
-+	      *character_width = (width < 0) ? 0 : width;
-+	    }
-+
-+	  strncpy (character, arg, *character_length);
-+	  arg += *character_length;
-+	}
-+      else			/* for single byte locale. */
-+#endif
-+	{
-+	  *character = *arg++;
-+	  *character_length = 1;
-+	  *character_width = 1;
-+	}
-+    }
-+
-   if (*arg)
-     {
-       long int tmp_long;
-@@ -1256,7 +1382,7 @@
- 	  else
- 	    col_sep_string = column_separator;
- 
--	  col_sep_length = 1;
-+	  col_sep_length = col_sep_width = 1;
- 	  use_col_separator = true;
- 	}
-       /* It's rather pointless to define a TAB separator with column
-@@ -1288,11 +1414,11 @@
- 	     TAB_WIDTH (chars_per_input_tab, chars_per_number);   */
- 
-       /* Estimate chars_per_text without any margin and keep it constant. */
--      if (number_separator == '\t')
-+      if (number_separator[0] == '\t')
- 	number_width = chars_per_number +
- 	  TAB_WIDTH (chars_per_default_tab, chars_per_number);
-       else
--	number_width = chars_per_number + 1;
-+	number_width = chars_per_number + number_separator_width;
- 
-       /* The number is part of the column width unless we are
- 	 printing files in parallel. */
-@@ -1307,7 +1433,7 @@
-     }
- 
-   chars_per_column = (chars_per_line - chars_used_by_number -
--		     (columns - 1) * col_sep_length) / columns;
-+		     (columns - 1) * col_sep_width) / columns;
- 
-   if (chars_per_column < 1)
-     error (EXIT_FAILURE, 0, _("page width too narrow"));
-@@ -1432,7 +1558,7 @@
- 
-   /* Enlarge p->start_position of first column to use the same form of
-      padding_not_printed with all columns. */
--  h = h + col_sep_length;
-+  h = h + col_sep_width;
- 
-   /* This loop takes care of all but the rightmost column. */
- 
-@@ -1466,7 +1592,7 @@
- 	}
-       else
- 	{
--	  h = h_next + col_sep_length;
-+	  h = h_next + col_sep_width;
- 	  h_next = h + chars_per_column;
- 	}
-     }
-@@ -1756,9 +1882,9 @@
- align_column (COLUMN *p)
- {
-   padding_not_printed = p->start_position;
--  if (padding_not_printed - col_sep_length > 0)
-+  if (padding_not_printed - col_sep_width > 0)
-     {
--      pad_across_to (padding_not_printed - col_sep_length);
-+      pad_across_to (padding_not_printed - col_sep_width);
-       padding_not_printed = ANYWHERE;
-     }
- 
-@@ -2029,13 +2155,13 @@
-       /* May be too generous. */
-       buff = X2REALLOC (buff, &buff_allocated);
-     }
--  buff[buff_current++] = c;
-+  buff[buff_current++] = (unsigned char) c;
- }
- 
- static void
- add_line_number (COLUMN *p)
- {
--  int i;
-+  int i, j;
-   char *s;
-   int left_cut;
- 
-@@ -2058,22 +2184,24 @@
-       /* Tabification is assumed for multiple columns, also for n-separators,
- 	 but `default n-separator = TAB' hasn't been given priority over
- 	 equal column_width also specified by POSIX. */
--      if (number_separator == '\t')
-+      if (number_separator[0] == '\t')
-         {
-           i = number_width - chars_per_number;
-           while (i-- > 0)
- 	    (p->char_func) (' ');
-         }
-       else
--        (p->char_func) (number_separator);
-+	for (j = 0; j < number_separator_length; j++)
-+	  (p->char_func) (number_separator[j]);
-     }
-   else
-     /* To comply with POSIX, we avoid any expansion of default TAB
-        separator with a single column output. No column_width requirement
-        has to be considered. */
-     {
--      (p->char_func) (number_separator);
--      if (number_separator == '\t')
-+      for (j = 0; j < number_separator_length; j++)
-+	(p->char_func) (number_separator[j]);
-+      if (number_separator[0] == '\t')
-         output_position = POS_AFTER_TAB (chars_per_output_tab,
- 			  output_position);
-     }
-@@ -2234,7 +2362,7 @@
-   while (goal - h_old > 1
- 	 && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
-     {
--      putchar (output_tab_char);
-+      fwrite (output_tab_char, sizeof(char), output_tab_char_length, stdout);
-       h_old = h_new;
-     }
-   while (++h_old <= goal)
-@@ -2254,6 +2382,7 @@
- {
-   char *s;
-   int l = col_sep_length;
-+  int not_space_flag;
- 
-   s = col_sep_string;
- 
-@@ -2267,6 +2396,7 @@
-     {
-       for (; separators_not_printed > 0; --separators_not_printed)
- 	{
-+	  not_space_flag = 0;
- 	  while (l-- > 0)
- 	    {
- 	      /* 3 types of sep_strings: spaces only, spaces and chars,
-@@ -2280,12 +2410,15 @@
- 		}
- 	      else
- 		{
-+		  not_space_flag = 1;
- 		  if (spaces_not_printed > 0)
- 		    print_white_space ();
- 		  putchar (*s++);
--		  ++output_position;
- 		}
- 	    }
-+	  if (not_space_flag)
-+	    output_position += col_sep_width;
-+
-           /* sep_string ends with some spaces */
- 	  if (spaces_not_printed > 0)
- 	    print_white_space ();
-@@ -2313,7 +2446,7 @@
-    required number of tabs and spaces. */
- 
- static void
--print_char (char c)
-+print_char_single (char c)
- {
-   if (tabify_output)
-     {
-@@ -2337,6 +2470,74 @@
-   putchar (c);
- }
- 
-+#ifdef HAVE_MBRTOWC
-+static void
-+print_char_multi (char c)
-+{
-+  static size_t mbc_pos = 0;
-+  static char mbc[MB_LEN_MAX] = {'\0'};
-+  static mbstate_t state = {'\0'};
-+  mbstate_t state_bak;
-+  wchar_t wc;
-+  size_t mblength;
-+  int width;
-+
-+  if (tabify_output)
-+    {
-+      state_bak = state;
-+      mbc[mbc_pos++] = c;
-+      mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
-+
-+      while (mbc_pos > 0)
-+	{
-+	  switch (mblength)
-+	    {
-+	    case (size_t)-2:
-+	      state = state_bak;
-+	      return;
-+
-+	    case (size_t)-1:
-+	      state = state_bak;
-+	      ++output_position;
-+	      putchar (mbc[0]);
-+	      memmove (mbc, mbc + 1, MB_CUR_MAX - 1);
-+	      --mbc_pos;
-+	      break;
-+
-+	    case 0:
-+	      mblength = 1;
-+
-+	    default:
-+	      if (wc == L' ')
-+		{
-+		  memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
-+		  --mbc_pos;
-+		  ++spaces_not_printed;
-+		  return;
-+		}
-+	      else if (spaces_not_printed > 0)
-+		print_white_space ();
-+
-+	      /* Nonprintables are assumed to have width 0, except L'\b'. */
-+	      if ((width = wcwidth (wc)) < 1)
-+		{
-+		  if (wc == L'\b')
-+		    --output_position;
-+		}
-+	      else
-+		output_position += width;
-+
-+	      fwrite (mbc, sizeof(char), mblength, stdout);
-+	      memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
-+	      mbc_pos -= mblength;
-+	    }
-+	}
-+      return;
-+    }
-+  putchar (c);
-+}
-+#endif
-+
- /* Skip to page PAGE before printing.
-    PAGE may be larger than total number of pages. */
- 
-@@ -2517,9 +2718,9 @@
- 	  align_empty_cols = false;
- 	}
- 
--      if (padding_not_printed - col_sep_length > 0)
-+      if (padding_not_printed - col_sep_width > 0)
- 	{
--	  pad_across_to (padding_not_printed - col_sep_length);
-+	  pad_across_to (padding_not_printed - col_sep_width);
- 	  padding_not_printed = ANYWHERE;
- 	}
- 
-@@ -2620,9 +2821,9 @@
- 	}
-     }
- 
--  if (padding_not_printed - col_sep_length > 0)
-+  if (padding_not_printed - col_sep_width > 0)
-     {
--      pad_across_to (padding_not_printed - col_sep_length);
-+      pad_across_to (padding_not_printed - col_sep_width);
-       padding_not_printed = ANYWHERE;
-     }
- 
-@@ -2635,8 +2836,8 @@
-   if (spaces_not_printed == 0)
-     {
-       output_position = p->start_position + end_vector[line];
--      if (p->start_position - col_sep_length == chars_per_margin)
--	output_position -= col_sep_length;
-+      if (p->start_position - col_sep_width == chars_per_margin)
-+	output_position -= col_sep_width;
-     }
- 
-   return true;
-@@ -2655,7 +2856,7 @@
-    number of characters is 1.) */
- 
- static int
--char_to_clump (char c)
-+char_to_clump_single (char c)
- {
-   unsigned char uc = c;
-   char *s = clump_buff;
-@@ -2665,10 +2866,10 @@
-   int chars;
-   int chars_per_c = 8;
- 
--  if (c == input_tab_char)
-+  if (c == input_tab_char[0])
-     chars_per_c = chars_per_input_tab;
- 
--  if (c == input_tab_char || c == '\t')
-+  if (c == input_tab_char[0] || c == '\t')
-     {
-       width = TAB_WIDTH (chars_per_c, input_position);
- 
-@@ -2739,6 +2940,154 @@
-   return chars;
- }
- 
-+#ifdef HAVE_MBRTOWC
-+static int
-+char_to_clump_multi (char c)
-+{
-+  static size_t mbc_pos = 0;
-+  static char mbc[MB_LEN_MAX] = {'\0'};
-+  static mbstate_t state = {'\0'};
-+  mbstate_t state_bak;
-+  wchar_t wc;
-+  size_t mblength;
-+  int wc_width;
-+  register char *s = clump_buff;
-+  register int i, j;
-+  char esc_buff[4];
-+  int width;
-+  int chars;
-+  int chars_per_c = 8;
-+
-+  state_bak = state;
-+  mbc[mbc_pos++] = c;
-+  mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
-+
-+  width = 0;
-+  chars = 0;
-+  while (mbc_pos > 0)
-+    {
-+      switch (mblength)
-+	{
-+	case (size_t)-2:
-+	  state = state_bak;
-+	  return 0;
-+
-+	case (size_t)-1:
-+	  state = state_bak;
-+	  mblength = 1;
-+
-+	  if (use_esc_sequence || use_cntrl_prefix)
-+	    {
-+	      width = +4;
-+	      chars = +4;
-+	      *s++ = '\\';
-+	      sprintf (esc_buff, "%03o", mbc[0]);
-+	      for (i = 0; i <= 2; ++i)
-+		*s++ = (int) esc_buff[i];
-+	    }
-+	  else
-+	    {
-+	      width += 1;
-+	      chars += 1;
-+	      *s++ = mbc[0];
-+	    }
-+	  break;
-+
-+	case 0:
-+	  mblength = 1;
-+		/* Fall through */
-+
-+	default:
-+	  if (memcmp (mbc, input_tab_char, mblength) == 0)
-+	    chars_per_c = chars_per_input_tab;
-+
-+	  if (memcmp (mbc, input_tab_char, mblength) == 0 || c == '\t')
-+	    {
-+	      int  width_inc;
-+
-+	      width_inc = TAB_WIDTH (chars_per_c, input_position);
-+	      width += width_inc;
-+
-+	      if (untabify_input)
-+		{
-+		  for (i = width_inc; i; --i)
-+		    *s++ = ' ';
-+		  chars += width_inc;
-+		}
-+	      else
-+		{
-+		  for (i = 0; i <  mblength; i++)
-+		    *s++ = mbc[i];
-+		  chars += mblength;
-+		}
-+	    }
-+	  else if ((wc_width = wcwidth (wc)) < 1)
-+	    {
-+	      if (use_esc_sequence)
-+		{
-+		  for (i = 0; i < mblength; i++)
-+		    {
-+		      width += 4;
-+		      chars += 4;
-+		      *s++ = '\\';
-+		      sprintf (esc_buff, "%03o", c);
-+		      for (j = 0; j <= 2; ++j)
-+			*s++ = (int) esc_buff[j];
-+		    }
-+		}
-+	      else if (use_cntrl_prefix)
-+		{
-+		  if (wc < 0200)
-+		    {
-+		      width += 2;
-+		      chars += 2;
-+		      *s++ = '^';
-+		      *s++ = wc ^ 0100;
-+		    }
-+		  else
-+		    {
-+		      for (i = 0; i < mblength; i++)
-+			{
-+			  width += 4;
-+			  chars += 4;
-+			  *s++ = '\\';
-+			  sprintf (esc_buff, "%03o", c);
-+			  for (j = 0; j <= 2; ++j)
-+			    *s++ = (int) esc_buff[j];
-+			}
-+		    }
-+		}
-+	      else if (wc == L'\b')
-+		{
-+		  width += -1;
-+		  chars += 1;
-+		  *s++ = c;
-+		}
-+	      else
-+		{
-+		  width += 0;
-+		  chars += mblength;
-+		  for (i = 0; i < mblength; i++)
-+		    *s++ = mbc[i];
-+		}
-+	    }
-+	  else
-+	    {
-+	      width += wc_width;
-+	      chars += mblength;
-+	      for (i = 0; i < mblength; i++)
-+		*s++ = mbc[i];
-+	    }
-+	}
-+      memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
-+      mbc_pos -= mblength;
-+    }
-+
-+  input_position += width;
-+  return chars;
-+}
-+#endif
-+
- /* We've just printed some files and need to clean up things before
-    looking for more options and printing the next batch of files.
- 
---- coreutils-6.8+/src/cut.c.i18n	2007-01-14 15:41:28.000000000 +0000
-+++ coreutils-6.8+/src/cut.c	2007-03-01 15:08:24.000000000 +0000
-@@ -29,6 +29,11 @@
- #include <assert.h>
- #include <getopt.h>
- #include <sys/types.h>
-+
-+/* Get mbstate_t, mbrtowc().  */
-+#if HAVE_WCHAR_H
-+# include <wchar.h>
-+#endif
- #include "system.h"
- 
- #include "error.h"
-@@ -37,6 +42,18 @@
- #include "quote.h"
- #include "xstrndup.h"
- 
-+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
-+   installation; work around this configuration error.	*/
-+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
-+# undef MB_LEN_MAX
-+# define MB_LEN_MAX 16
-+#endif
-+
-+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
-+#if HAVE_MBRTOWC && defined mbstate_t
-+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-+#endif
-+
- /* The official name of this program (e.g., no `g' prefix).  */
- #define PROGRAM_NAME "cut"
- 
-@@ -67,6 +84,52 @@
-     }							\
-   while (0)
- 
-+/* Refill the buffer BUF to get a multibyte character. */
-+#define REFILL_BUFFER(BUF, BUFPOS, BUFLEN, STREAM)			\
-+  do									\
-+    {									\
-+      if (BUFLEN < MB_LEN_MAX && !feof (STREAM) && !ferror (STREAM))	\
-+	{								\
-+	  memmove (BUF, BUFPOS, BUFLEN);				\
-+	  BUFLEN += fread (BUF + BUFLEN, sizeof(char), BUFSIZ, STREAM); \
-+	  BUFPOS = BUF;							\
-+	}								\
-+    }									\
-+  while (0)
-+
-+/* Get wide character on BUFPOS. BUFPOS is not included after that.
-+   If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */ 
-+#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \
-+  do									\
-+    {									\
-+      mbstate_t state_bak;						\
-+									\
-+      if (BUFLEN < 1)							\
-+	{								\
-+	  WC = WEOF;							\
-+	  break;							\
-+	}								\
-+									\
-+      /* Get a wide character. */					\
-+      CONVFAIL = 0;							\
-+      state_bak = STATE;						\
-+      MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE);	\
-+									\
-+      switch (MBLENGTH)							\
-+	{								\
-+	case (size_t)-1:						\
-+	case (size_t)-2:						\
-+	  CONVFAIL++;							\
-+	  STATE = state_bak;						\
-+	  /* Fall througn. */						\
-+									\
-+	case 0:								\
-+	  MBLENGTH = 1;							\
-+	  break;							\
-+	}								\
-+    }									\
-+  while (0)
-+
- struct range_pair
-   {
-     size_t lo;
-@@ -85,7 +148,7 @@
- /* The number of bytes allocated for FIELD_1_BUFFER.  */
- static size_t field_1_bufsize;
- 
--/* The largest field or byte index used as an endpoint of a closed
-+/* The largest byte, character or field index used as an endpoint of a closed
-    or degenerate range specification;  this doesn't include the starting
-    index of right-open-ended ranges.  For example, with either range spec
-    `2-5,9-', `2-3,5,9-' this variable would be set to 5.  */
-@@ -97,10 +160,11 @@
- 
- /* This is a bit vector.
-    In byte mode, which bytes to output.
-+   In character mode, which characters to output.
-    In field mode, which DELIM-separated fields to output.
--   Both bytes and fields are numbered starting with 1,
-+   Bytes, characters and fields are numbered starting with 1,
-    so the zeroth bit of this array is unused.
--   A field or byte K has been selected if
-+   A byte, character or field K has been selected if
-    (K <= MAX_RANGE_ENDPOINT and is_printable_field(K))
-     || (EOL_RANGE_START > 0 && K >= EOL_RANGE_START).  */
- static unsigned char *printable_field;
-@@ -109,9 +173,12 @@
-   {
-     undefined_mode,
- 
--    /* Output characters that are in the given bytes. */
-+    /* Output bytes that are at the given positions. */
-     byte_mode,
- 
-+    /* Output characters that are at the given positions. */
-+    character_mode,
-+
-     /* Output the given delimeter-separated fields. */
-     field_mode
-   };
-@@ -121,6 +188,13 @@
- 
- static enum operating_mode operating_mode;
- 
-+/* If nonzero, when in byte mode, don't split multibyte characters.  */
-+static int byte_mode_character_aware;
-+
-+/* If nonzero, the function for single byte locale is work
-+   if this program runs on multibyte locale. */
-+static int force_singlebyte_mode;
-+
- /* If true do not output lines containing no delimeter characters.
-    Otherwise, all such lines are printed.  This option is valid only
-    with field mode.  */
-@@ -132,6 +206,9 @@
- 
- /* The delimeter character for field mode. */
- static unsigned char delim;
-+#if HAVE_WCHAR_H
-+static wchar_t wcdelim;
-+#endif
- 
- /* True if the --output-delimiter=STRING option was specified.  */
- static bool output_delimiter_specified;
-@@ -205,7 +282,7 @@
-   -f, --fields=LIST       select only these fields;  also print any line\n\
-                             that contains no delimiter character, unless\n\
-                             the -s option is specified\n\
--  -n                      (ignored)\n\
-+  -n                      with -b: don't split multibyte characters\n\
- "), stdout);
-       fputs (_("\
-       --complement        complement the set of selected bytes, characters\n\
-@@ -362,7 +439,7 @@
- 	  in_digits = false;
- 	  /* Starting a range. */
- 	  if (dash_found)
--	    FATAL_ERROR (_("invalid byte or field list"));
-+	    FATAL_ERROR (_("invalid byte, character or field list"));
- 	  dash_found = true;
- 	  fieldstr++;
- 
-@@ -387,14 +464,16 @@
- 	      if (value == 0)
- 		{
- 		  /* `n-'.  From `initial' to end of line. */
--		  eol_range_start = initial;
-+		  if (eol_range_start == 0 ||
-+		      (eol_range_start != 0 && eol_range_start > initial))
-+		    eol_range_start = initial;
- 		  field_found = true;
- 		}
- 	      else
- 		{
- 		  /* `m-n' or `-n' (1-n). */
- 		  if (value < initial)
--		    FATAL_ERROR (_("invalid byte or field list"));
-+		    FATAL_ERROR (_("invalid byte, character or field list"));
- 
- 		  /* Is there already a range going to end of line? */
- 		  if (eol_range_start != 0)
-@@ -467,6 +546,9 @@
- 	      if (operating_mode == byte_mode)
- 		error (0, 0,
- 		       _("byte offset %s is too large"), quote (bad_num));
-+	      else if (operating_mode == character_mode)
-+		error (0, 0,
-+		       _("character offset %s is too large"), quote (bad_num));
- 	      else
- 		error (0, 0,
- 		       _("field number %s is too large"), quote (bad_num));
-@@ -477,7 +559,7 @@
- 	  fieldstr++;
- 	}
-       else
--	FATAL_ERROR (_("invalid byte or field list"));
-+	FATAL_ERROR (_("invalid byte, character or field list"));
-     }
- 
-   max_range_endpoint = 0;
-@@ -570,6 +652,63 @@
-     }
- }
- 
-+#if HAVE_MBRTOWC
-+/* This function is in use for the following case.
-+
-+   1. Read from the stream STREAM, printing to standard output any selected
-+   characters. 
-+
-+   2. Read from stream STREAM, printing to standard output any selected bytes,
-+   without splitting multibyte characters.  */
-+ 
-+static void
-+cut_characters_or_cut_bytes_no_split (FILE *stream)
-+{
-+  int idx;		/* number of bytes or characters in the line so far. */
-+  char buf[MB_LEN_MAX + BUFSIZ];  /* For spooling a read byte sequence. */
-+  char *bufpos;		/* Next read position of BUF. */
-+  size_t buflen;	/* The length of the byte sequence in buf. */
-+  wint_t wc;		/* A gotten wide character. */
-+  size_t mblength;	/* The byte size of a multibyte character which shows
-+			   as same character as WC. */
-+  mbstate_t state;	/* State of the stream. */
-+  int convfail;		/* 1, when conversion is failed. Otherwise 0. */
-+
-+  idx = 0;
-+  buflen = 0;
-+  bufpos = buf;
-+  memset (&state, '\0', sizeof(mbstate_t));
-+
-+  while (1)
-+    {
-+      REFILL_BUFFER (buf, bufpos, buflen, stream);
-+
-+      GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail);
-+
-+      if (wc == WEOF)
-+	{
-+	  if (idx > 0)
-+	    putchar ('\n');
-+	  break;
-+	}
-+      else if (wc == L'\n')
-+	{
-+	  putchar ('\n');
-+	  idx = 0;
-+	}
-+      else
-+	{
-+	  idx += (operating_mode == byte_mode) ? mblength : 1;
-+	  if (print_kth (idx, NULL))
-+	    fwrite (bufpos, mblength, sizeof(char), stdout);
-+	}
-+
-+      buflen -= mblength;
-+      bufpos += mblength;
-+    }
-+}
-+#endif
-+		   
- /* Read from stream STREAM, printing to standard output any selected fields.  */
- 
- static void
-@@ -692,13 +831,192 @@
-     }
- }
- 
-+#if HAVE_MBRTOWC
-+static void
-+cut_fields_mb (FILE *stream)
-+{
-+  int c;
-+  unsigned int field_idx;
-+  int found_any_selected_field;
-+  int buffer_first_field;
-+  int empty_input;
-+  char buf[MB_LEN_MAX + BUFSIZ];  /* For spooling a read byte sequence. */
-+  char *bufpos;		/* Next read position of BUF. */
-+  size_t buflen;	/* The length of the byte sequence in buf. */
-+  wint_t wc = 0;	/* A gotten wide character. */
-+  size_t mblength;	/* The byte size of a multibyte character which shows
-+			   as same character as WC. */
-+  mbstate_t state;	/* State of the stream. */
-+  int convfail;		/* 1, when conversion is failed. Otherwise 0. */
-+
-+  found_any_selected_field = 0;
-+  field_idx = 1;
-+  bufpos = buf;
-+  buflen = 0;
-+  memset (&state, '\0', sizeof(mbstate_t));
-+
-+  c = getc (stream);
-+  empty_input = (c == EOF);
-+  if (c != EOF)
-+    ungetc (c, stream);
-+  else
-+    wc = WEOF;
-+
-+  /* To support the semantics of the -s flag, we may have to buffer
-+     all of the first field to determine whether it is `delimited.'
-+     But that is unnecessary if all non-delimited lines must be printed
-+     and the first field has been selected, or if non-delimited lines
-+     must be suppressed and the first field has *not* been selected.
-+     That is because a non-delimited line has exactly one field.  */
-+  buffer_first_field = (suppress_non_delimited ^ !print_kth (1, NULL));
-+
-+  while (1)
-+    {
-+      if (field_idx == 1 && buffer_first_field)
-+	{
-+	  int len = 0;
-+
-+	  while (1)
-+	    {
-+	      REFILL_BUFFER (buf, bufpos, buflen, stream);
-+
-+	      GET_NEXT_WC_FROM_BUFFER
-+		(wc, bufpos, buflen, mblength, state, convfail);
-+
-+	      if (wc == WEOF)
-+		break;
-+
-+	      field_1_buffer = xrealloc (field_1_buffer, len + mblength);
-+	      memcpy (field_1_buffer + len, bufpos, mblength);
-+	      len += mblength;
-+	      buflen -= mblength;
-+	      bufpos += mblength;
-+
-+	      if (!convfail && (wc == L'\n' || wc == wcdelim))
-+		break;
-+	    }
-+
-+	  if (wc == WEOF)
-+	    break;
-+
-+	  /* If the first field extends to the end of line (it is not
-+	     delimited) and we are printing all non-delimited lines,
-+	     print this one.  */
-+	  if (convfail || (!convfail && wc != wcdelim))
-+	    {
-+	      if (suppress_non_delimited)
-+		{
-+		  /* Empty.	*/
-+		}
-+	      else
-+		{
-+		  fwrite (field_1_buffer, sizeof (char), len, stdout);
-+		  /* Make sure the output line is newline terminated.  */
-+		  if (convfail || (!convfail && wc != L'\n'))
-+		    putchar ('\n');
-+		}
-+	      continue;
-+	    }
-+
-+	  if (print_kth (1, NULL))
-+	    {
-+	      /* Print the field, but not the trailing delimiter.  */
-+	      fwrite (field_1_buffer, sizeof (char), len - 1, stdout);
-+	      found_any_selected_field = 1;
-+	    }
-+	  ++field_idx;
-+	}
-+
-+      if (wc != WEOF)
-+	{
-+	  if (print_kth (field_idx, NULL))
-+	    {
-+	      if (found_any_selected_field)
-+		{
-+		  fwrite (output_delimiter_string, sizeof (char),
-+			  output_delimiter_length, stdout);
-+		}
-+	      found_any_selected_field = 1;
-+	    }
-+
-+	  while (1)
-+	    {
-+	      REFILL_BUFFER (buf, bufpos, buflen, stream);
-+
-+	      GET_NEXT_WC_FROM_BUFFER
-+		(wc, bufpos, buflen, mblength, state, convfail);
-+
-+	      if (wc == WEOF)
-+		break;
-+	      else if (!convfail && (wc == wcdelim || wc == L'\n'))
-+		{
-+		  buflen -= mblength;
-+		  bufpos += mblength;
-+		  break;
-+		}
-+
-+	      if (print_kth (field_idx, NULL))
-+		fwrite (bufpos, mblength, sizeof(char), stdout);
-+
-+	      buflen -= mblength;
-+	      bufpos += mblength;
-+	    }
-+	}
-+
-+      if ((!convfail || wc == L'\n') && buflen < 1)
-+	wc = WEOF;
-+
-+      if (!convfail && wc == wcdelim)
-+	++field_idx;
-+      else if (wc == WEOF || (!convfail && wc == L'\n'))
-+	{
-+	  if (found_any_selected_field
-+	      || (!empty_input && !(suppress_non_delimited && field_idx == 1)))
-+	    putchar ('\n');
-+	  if (wc == WEOF)
-+	    break;
-+	  field_idx = 1;
-+	  found_any_selected_field = 0;
-+	}
-+    }
-+}
-+#endif
-+
- static void
- cut_stream (FILE *stream)
- {
--  if (operating_mode == byte_mode)
--    cut_bytes (stream);
-+#if HAVE_MBRTOWC
-+  if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
-+    {
-+      switch (operating_mode)
-+	{
-+	case byte_mode:
-+	  if (byte_mode_character_aware)
-+	    cut_characters_or_cut_bytes_no_split (stream);
-+	  else
-+	    cut_bytes (stream);
-+	  break;
-+
-+	case character_mode:
-+	  cut_characters_or_cut_bytes_no_split (stream);
-+	  break;
-+
-+	case field_mode:
-+	  cut_fields_mb (stream);
-+	  break;
-+
-+	default:
-+	  abort ();
-+	}
-+    }
-   else
--    cut_fields (stream);
-+#endif
-+    {
-+      if (operating_mode == field_mode)
-+	cut_fields (stream);
-+      else
-+	cut_bytes (stream);
-+    }
- }
- 
- /* Process file FILE to standard output.
-@@ -748,6 +1066,8 @@
-   bool ok;
-   bool delim_specified = false;
-   char *spec_list_string IF_LINT(= NULL);
-+  char mbdelim[MB_LEN_MAX + 1];
-+  size_t delimlen = 0;
- 
-   initialize_main (&argc, &argv);
-   program_name = argv[0];
-@@ -770,7 +1090,6 @@
-       switch (optc)
- 	{
- 	case 'b':
--	case 'c':
- 	  /* Build the byte list. */
- 	  if (operating_mode != undefined_mode)
- 	    FATAL_ERROR (_("only one type of list may be specified"));
-@@ -778,6 +1097,14 @@
- 	  spec_list_string = optarg;
- 	  break;
- 
-+	case 'c':
-+	  /* Build the character list. */
-+	  if (operating_mode != undefined_mode)
-+	    FATAL_ERROR (_("only one type of list may be specified"));
-+	  operating_mode = character_mode;
-+	  spec_list_string = optarg;
-+	  break;
-+
- 	case 'f':
- 	  /* Build the field list. */
- 	  if (operating_mode != undefined_mode)
-@@ -789,10 +1116,35 @@
- 	case 'd':
- 	  /* New delimiter. */
- 	  /* Interpret -d '' to mean `use the NUL byte as the delimiter.'  */
--	  if (optarg[0] != '\0' && optarg[1] != '\0')
--	    FATAL_ERROR (_("the delimiter must be a single character"));
--	  delim = optarg[0];
--	  delim_specified = true;
-+#if HAVE_MBRTOWC
-+	    {
-+	      if(MB_CUR_MAX > 1)
-+		{
-+		  mbstate_t state;
-+
-+		  memset (&state, '\0', sizeof(mbstate_t));
-+		  delimlen = mbrtowc (&wcdelim, optarg, strnlen(optarg, MB_LEN_MAX), &state);
-+
-+		  if (delimlen == (size_t)-1 || delimlen == (size_t)-2)
-+		    ++force_singlebyte_mode;
-+		  else
-+		    {
-+		      delimlen = (delimlen < 1) ? 1 : delimlen;
-+		      if (wcdelim != L'\0' && *(optarg + delimlen) != '\0')
-+			FATAL_ERROR (_("the delimiter must be a single character"));
-+		      memcpy (mbdelim, optarg, delimlen);
-+		    }
-+		}
-+
-+	      if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
-+#endif
-+		{
-+		  if (optarg[0] != '\0' && optarg[1] != '\0')
-+		    FATAL_ERROR (_("the delimiter must be a single character"));
-+		  delim = (unsigned char) optarg[0];
-+		}
-+	    delim_specified = true;
-+	  }
- 	  break;
- 
- 	case OUTPUT_DELIMITER_OPTION:
-@@ -805,6 +1157,7 @@
- 	  break;
- 
- 	case 'n':
-+	  byte_mode_character_aware = 1;
- 	  break;
- 
- 	case 's':
-@@ -827,7 +1180,7 @@
-   if (operating_mode == undefined_mode)
-     FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
- 
--  if (delim != '\0' && operating_mode != field_mode)
-+  if (delim_specified && operating_mode != field_mode)
-     FATAL_ERROR (_("an input delimiter may be specified only\
-  when operating on fields"));
- 
-@@ -854,15 +1207,34 @@
-     }
- 
-   if (!delim_specified)
--    delim = '\t';
-+    {
-+      delim = '\t';
-+#ifdef HAVE_MBRTOWC
-+      wcdelim = L'\t';
-+      mbdelim[0] = '\t';
-+      mbdelim[1] = '\0';
-+      delimlen = 1;
-+#endif
-+    }
- 
-   if (output_delimiter_string == NULL)
-     {
--      static char dummy[2];
--      dummy[0] = delim;
--      dummy[1] = '\0';
--      output_delimiter_string = dummy;
--      output_delimiter_length = 1;
-+#ifdef HAVE_MBRTOWC
-+      if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
-+	{
-+	  output_delimiter_string = xstrdup(mbdelim);
-+	  output_delimiter_length = delimlen;
-+	}
-+
-+      if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
-+#endif
-+	{
-+	  static char dummy[2]; 
-+	  dummy[0] = delim;
-+	  dummy[1] = '\0';
-+	  output_delimiter_string = dummy;
-+	  output_delimiter_length = 1;
-+	}
-     }
- 
-   if (optind == argc)
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch
deleted file mode 100644
index aba8742..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
-
-The package is stated as being Licensed as GPLv2+.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
---- coreutils-6.9/src/ls.c.ls-x	2007-06-13 14:27:36.000000000 +0100
-+++ coreutils-6.9/src/ls.c	2007-06-13 14:28:42.000000000 +0100
-@@ -4151,16 +4151,16 @@
-   size_t pos = 0;
-   size_t cols = calculate_columns (false);
-   struct column_info const *line_fmt = &column_info[cols - 1];
--  size_t name_length = length_of_file_name_and_frills (cwd_file);
-+  struct fileinfo const *f = sorted_file[0];
-+  size_t name_length = length_of_file_name_and_frills (f);
-   size_t max_name_length = line_fmt->col_arr[0];
- 
-   /* Print first entry.  */
--  print_file_name_and_frills (cwd_file);
-+  print_file_name_and_frills (f);
- 
-   /* Now the rest.  */
-   for (filesno = 1; filesno < cwd_n_used; ++filesno)
-     {
--      struct fileinfo const *f;
-       size_t col = filesno % cols;
- 
-       if (col == 0)
---- coreutils-6.9/tests/ls/Makefile.am.ls-x	2007-03-18 21:36:43.000000000 +0000
-+++ coreutils-6.9/tests/ls/Makefile.am	2007-06-13 14:28:42.000000000 +0100
-@@ -24,7 +24,7 @@
-   stat-dtype \
-   inode dangle file-type recursive dired infloop \
-   rt-1 time-1 symlink-slash follow-slink no-arg m-option \
--  stat-vs-dirent
-+  stat-vs-dirent x-option
- 
- EXTRA_DIST = $(TESTS)
- TESTS_ENVIRONMENT = \
---- /dev/null	2007-06-13 08:43:51.993263382 +0100
-+++ coreutils-6.9/tests/ls/x-option	2007-06-13 14:28:42.000000000 +0100
-@@ -0,0 +1,59 @@
-+#!/bin/sh
-+# Exercise the -x option.
-+
-+# Copyright (C) 2007 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+# 02110-1301, USA.
-+
-+if test "$VERBOSE" = yes; then
-+  set -x
-+  ls --version
-+fi
-+
-+. $srcdir/../envvar-check
-+. $srcdir/../lang-default
-+
-+pwd=`pwd`
-+t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
-+trap '(exit $?); exit $?' 1 2 13 15
-+
-+framework_failure=0
-+mkdir -p $tmp || framework_failure=1
-+cd $tmp || framework_failure=1
-+mkdir subdir || framework_failure=1
-+touch subdir/b || framework_failure=1
-+touch subdir/a || framework_failure=1
-+
-+if test $framework_failure = 1; then
-+  echo "$0: failure in testing framework" 1>&2
-+  (exit 1); exit 1
-+fi
-+
-+fail=0
-+
-+# Coreutils 6.8 and 6.9 would output this in the wrong order.
-+ls -x subdir > out || fail=1
-+ls -rx subdir >> out || fail=1
-+cat <<\EOF > exp || fail=1
-+a  b
-+b  a
-+EOF
-+
-+cmp out exp || fail=1
-+test $fail = 1 && diff out exp 2> /dev/null
-+
-+(exit $fail); exit $fail
---- coreutils-6.9/NEWS.ls-x	2007-03-22 21:19:45.000000000 +0000
-+++ coreutils-6.9/NEWS	2007-06-13 14:28:42.000000000 +0100
-@@ -13,6 +13,11 @@
-   Using pr -m -s (i.e. merging files, with TAB as the output separator)
-   no longer inserts extraneous spaces between output columns.
- 
-+** Bug fixes
-+
-+  ls -x DIR would sometimes output the wrong string in place of the
-+  first entry.  [introduced in coreutils-6.8]
-+
- 
- * Noteworthy changes in release 6.8 (2007-02-24) [not-unstable]
- 
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch
deleted file mode 100644
index 58074c0..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
-
-The package is stated as being Licensed as GPLv2+.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
---- coreutils-5.2.1/src/who.c.overflow	2005-05-25 09:59:06.000000000 +0100
-+++ coreutils-5.2.1/src/who.c	2005-05-25 10:00:31.000000000 +0100
-@@ -75,7 +75,7 @@
- # define NEW_TIME 0
- #endif
- 
--#define IDLESTR_LEN 6
-+#define IDLESTR_LEN 10
- 
- #if HAVE_STRUCT_XTMP_UT_PID
- # define PIDSTR_DECL_AND_INIT(Var, Utmp_ent) \
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch
deleted file mode 100644
index 64e5f12..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Upstream-Status: Pending
-
-automake 1.12 has depricated automatic de-ANSI-fication support
-
-this patch avoids these kinds of errors:
-
-| configure.ac:40: error: automatic de-ANSI-fication support has been removed
-| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
-| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:138: gl_CHECK_ALL_TYPES is expanded from...
-| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:24: coreutils_MACROS is expanded from...
-| configure.ac:40: the top level
-| autom4te: m4 failed with exit status: 1
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
-2012/05/04
-
-Index: coreutils-6.9/m4/jm-macros.m4
-===================================================================
---- coreutils-6.9.orig/m4/jm-macros.m4
-+++ coreutils-6.9/m4/jm-macros.m4
-@@ -142,11 +142,6 @@ AC_DEFUN([gl_CHECK_ALL_TYPES],
-   dnl whether functions and headers are available, whether they work, etc.
-   AC_REQUIRE([AC_SYS_LARGEFILE])
- 
--  dnl This test must precede tests of compiler characteristics like
--  dnl that for the inline keyword, since it may change the degree to
--  dnl which the compiler supports such features.
--  AC_REQUIRE([AM_C_PROTOTYPES])
--
-   dnl Checks for typedefs, structures, and compiler characteristics.
-   AC_REQUIRE([AC_C_BIGENDIAN])
-   AC_REQUIRE([AC_C_VOLATILE])
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
deleted file mode 100644
index e0d600a..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-Use native coreutils binaries to build manpages in cross environment.
-This avoids man page build issues like this:
-
-| Making all in man
-| make[1]: Entering directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
-| Updating man page cut.1
-| Updating man page dir.1
-| Updating man page expand.1
-| Updating man page fold.1
-| Updating man page install.1
-| Updating man page join.1
-| Updating man page pr.1
-| Updating man page ls.1
-| Updating man page sort.1
-| Updating man page unexpand.1
-| Updating man page uniq.1
-| Updating man page who.1
-| Updating man page vdir.1
-| help2man: can't get `--help' info from dir.td/dir
-| help2man: can't get `--help' info from cut.td/cut
-| make[1]: *** [dir.1] Error 126
-| make[1]: *** Waiting for unfinished jobs....
-| help2man: can't get `--help' info from fold.td/fold
-| help2man: can't get `--help' info from install.td/install
-| help2man: can't get `--help' info from expand.td/expand
-| help2man: can't get `--help' info from join.td/join
-| make[1]: *** [cut.1] Error 126
-| make[1]: *** [fold.1] Error 126
-| make[1]: *** [install.1] Error 126
-| help2man: can't get `--help' info from sort.td/sort
-| make[1]: *** [expand.1] Error 126
-| help2man: can't get `--help' info from pr.td/pr
-| make[1]: *** [join.1] Error 126
-| help2man: can't get `--help' info from ls.td/ls
-| help2man: can't get `--help' info from unexpand.td/unexpand
-| help2man: can't get `--help' info from uniq.td/uniq
-| help2man: can't get `--help' info from who.td/who
-| make[1]: *** [sort.1] Error 126
-| make[1]: *** [pr.1] Error 126
-| help2man: can't get `--help' info from vdir.td/vdir
-| make[1]: *** [ls.1] Error 126
-| make[1]: *** [uniq.1] Error 126
-| make[1]: *** [unexpand.1] Error 126
-| make[1]: *** [who.1] Error 126
-| make[1]: *** [vdir.1] Error 126
-| make[1]: Leaving directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
-| make: *** [all-recursive] Error 1
-| FATAL: oe_runmake failed
-| ERROR: Function 'do_compile' failed (see /build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/temp/log.do_compile.12780 for further information)
-NOTE: package coreutils-6.9-r0: task do_compile: Failed
-ERROR: Task 8 (/home/nitin/prj/poky.git/meta/recipes-core/coreutils/coreutils_6.9.bb, do_compile) failed with exit code '1'
-
-
-This patch is made for gplv2 coreutils the recipe
-Nitin A Kamble <nitin.a.kamble@intel.com>
-2011/03/17
-
-Index: man/Makefile.am
-===================================================================
---- a/man.orig/Makefile.am
-+++ b/man/Makefile.am
-@@ -167,7 +167,7 @@ mapped_name = `echo $*|sed 's/install/gi
- 	            $(PERL) -- $(srcdir)/help2man		\
- 	             --source='$(PACKAGE_STRING)'		\
- 	             --include=$(srcdir)/$*.x			\
--	             --output=$t/$@ $t/$*;			\
-+	             --output=$t/$@ $*;			\
- 	       }						\
- 	    && sed 's|$*\.td/||g' $t/$@ > $@			\
- 	    && chmod a-w $@					\
-Index: man/Makefile.in
-===================================================================
---- a/man.orig/Makefile.in
-+++ b/man/Makefile.in
-@@ -865,7 +865,7 @@ yes.1:		$(common_dep)	$(srcdir)/yes.x		.
- 	            $(PERL) -- $(srcdir)/help2man		\
- 	             --source='$(PACKAGE_STRING)'		\
- 	             --include=$(srcdir)/$*.x			\
--	             --output=$t/$@ $t/$*;			\
-+	             --output=$t/$@ $*;			\
- 	       }						\
- 	    && sed 's|$*\.td/||g' $t/$@ > $@			\
- 	    && chmod a-w $@					\
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
deleted file mode 100644
index 5088106..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-# coreutils uses gnulib which conflicts with newer libc header on futimens
-# this patch simply renames coreutils futimes to avoid confliction
-#
-# Signed-off-by: Kevin Tian <kevin.tian@intel.com>, 2010-08-18
-# (this patch is licensed under GPLv2)
-
-diff --git a/lib/utimens.c b/lib/utimens.c
-index 71bc510..ae870b8 100644
---- a/lib/utimens.c
-+++ b/lib/utimens.c
-@@ -75,7 +75,7 @@ struct utimbuf
-    Return 0 on success, -1 (setting errno) on failure.  */
- 
- int
--futimens (int fd ATTRIBUTE_UNUSED,
-+futimens_coreutils (int fd ATTRIBUTE_UNUSED,
- 	  char const *file, struct timespec const timespec[2])
- {
-   /* Some Linux-based NFS clients are buggy, and mishandle time stamps
-@@ -185,5 +185,5 @@ futimens (int fd ATTRIBUTE_UNUSED,
- int
- utimens (char const *file, struct timespec const timespec[2])
- {
--  return futimens (-1, file, timespec);
-+  return futimens_coreutils (-1, file, timespec);
- }
-diff --git a/lib/utimens.h b/lib/utimens.h
-index 0097aaa..13fc45a 100644
---- a/lib/utimens.h
-+++ b/lib/utimens.h
-@@ -1,3 +1,3 @@
- #include <time.h>
--int futimens (int, char const *, struct timespec const [2]);
-+int futimens_coreutils (int, char const *, struct timespec const [2]);
- int utimens (char const *, struct timespec const [2]);
-diff --git a/src/copy.c b/src/copy.c
-index 4bdb75c..04634f1 100644
---- a/src/copy.c
-+++ b/src/copy.c
-@@ -518,7 +518,7 @@ copy_reg (char const *src_name, char const *dst_name,
-       timespec[0] = get_stat_atime (src_sb);
-       timespec[1] = get_stat_mtime (src_sb);
- 
--      if (futimens (dest_desc, dst_name, timespec) != 0)
-+      if (futimens_coreutils (dest_desc, dst_name, timespec) != 0)
- 	{
- 	  error (0, errno, _("preserving times for %s"), quote (dst_name));
- 	  if (x->require_preserve)
-diff --git a/src/touch.c b/src/touch.c
-index a79c26d..6ef317d 100644
---- a/src/touch.c
-+++ b/src/touch.c
-@@ -182,7 +182,7 @@ touch (const char *file)
-       t = timespec;
-     }
- 
--  ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
-+  ok = (futimens_coreutils (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
- 
-   if (fd == STDIN_FILENO)
-     {
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
deleted file mode 100644
index 8a8ffa7..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-# remove the line to cause recursive inclusion error from autoreconf, sicne
-# newer autoconf has included this definition. Simply rename it here.
-#
-# Signed-off-by: Kevin Tian <kevin.tian@intel.com>, 2010-08-18
-# (this patch is licensed under GPLv2)
-
-diff --git a/extensions.m4 b/extensions.m4
-index 143a9e5..f6558f1 100644
---- a/m4/extensions.m4
-+++ b/m4/extensions.m4
-@@ -16,7 +16,7 @@
- # ------------------------
- # Enable extensions on systems that normally disable them,
- # typically due to standards-conformance issues.
--AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
-+AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS_DUMMY],
- [
-   AC_BEFORE([$0], [AC_COMPILE_IFELSE])
-   AC_BEFORE([$0], [AC_RUN_IFELSE])
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch
deleted file mode 100644
index c72efd4..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Remove hardcoded paths so OE's configure QA does not detect it and fail the builds
-For cross compilation is less interesting to look into host paths for target libraries anyway
-
-Upstream-Status: Inappropriate [OE Specific]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Index: coreutils-6.9/m4/getloadavg.m4
-===================================================================
---- coreutils-6.9.orig/m4/getloadavg.m4
-+++ coreutils-6.9/m4/getloadavg.m4
-@@ -49,7 +49,6 @@ if test $gl_have_func = no; then
-   # There is a commonly available library for RS/6000 AIX.
-   # Since it is not a standard part of AIX, it might be installed locally.
-   gl_getloadavg_LIBS=$LIBS
--  LIBS="-L/usr/local/lib $LIBS"
-   AC_CHECK_LIB(getloadavg, getloadavg,
- 	       [LIBS="-lgetloadavg $LIBS"], [LIBS=$gl_getloadavg_LIBS])
- fi
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
deleted file mode 100644
index 59a4fe0..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-# man page for 'touch' is generated differently from others. All other utilities
-# are provided static man source files, while for 'touch' it requires help2man
-# to invoke "touch --help" and then convert the output into the manual. Since touch
-# is with target format which can't be invoked on build system, disable building
-# 'touch' man page here.
-#
-# Signed-off-by: Kevin Tian <kevin.tian@intel.com>, 2010-08-18
-# (this patch is licensed under GPLv2)
-
-diff --git a/man/Makefile.am b/man/Makefile.am
-index 32df9d1..37b09e3 100644
---- a/man/Makefile.am
-+++ b/man/Makefile.am
-@@ -27,7 +27,7 @@ dist_man_MANS = \
-   paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
-   rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \
-   shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \
--  su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
-+  su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 tr.1 true.1 tsort.1 \
-   tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \
-   whoami.1 yes.1 $(MAN)
- optional_mans = \
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/0001-Unset-need_charset_alias-when-building-for-musl.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-Unset-need_charset_alias-when-building-for-musl.patch
rename to import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/0001-Unset-need_charset_alias-when-building-for-musl.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/0001-local.mk-fix-cross-compiling-problem.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/0001-local.mk-fix-cross-compiling-problem.patch
new file mode 100644
index 0000000..66f9a71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/0001-local.mk-fix-cross-compiling-problem.patch
@@ -0,0 +1,26 @@
+Subject: local.mk: fix cross compiling problem
+
+We meet the following error when cross compiling.
+| Makefile:3418: *** Recursive variable 'INSTALL' references itself (eventually).  Stop.
+This patch fixes this problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/local.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/local.mk b/src/local.mk
+index 36dfa4e..c5898cc 100644
+--- a/src/local.mk
++++ b/src/local.mk
+@@ -649,4 +649,4 @@ cu_install_program = @INSTALL_PROGRAM@
+ else
+ cu_install_program = src/ginstall
+ endif
+-INSTALL = $(cu_install_program) -c
++INSTALL_PROGRAM = $(cu_install_program)
+-- 
+2.1.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-uname-report-processor-and-hardware-correctly.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/0001-uname-report-processor-and-hardware-correctly.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-uname-report-processor-and-hardware-correctly.patch
rename to import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/0001-uname-report-processor-and-hardware-correctly.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/disable-ls-output-quoting.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/disable-ls-output-quoting.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/disable-ls-output-quoting.patch
rename to import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/disable-ls-output-quoting.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/fix-selinux-flask.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/fix-selinux-flask.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/fix-selinux-flask.patch
rename to import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/fix-selinux-flask.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/man-decouple-manpages-from-build.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/man-decouple-manpages-from-build.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/man-decouple-manpages-from-build.patch
rename to import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/man-decouple-manpages-from-build.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/remove-usr-local-lib-from-m4.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/remove-usr-local-lib-from-m4.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/remove-usr-local-lib-from-m4.patch
rename to import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.26/remove-usr-local-lib-from-m4.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_6.9.bb b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_6.9.bb
deleted file mode 100644
index 35700a3..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_6.9.bb
+++ /dev/null
@@ -1,107 +0,0 @@
-SUMMARY = "The basic file, shell and text manipulation utilities"
-DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
-manipulation utilities. These are the core utilities which are expected to exist on \
-every system."
-
-HOMEPAGE = "http://www.gnu.org/software/coreutils/"
-BUGTRACKER = "http://debbugs.gnu.org/coreutils"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
-                    file://src/ls.c;beginline=4;endline=16;md5=15ed60f67b1db5fedd5dbc37cf8a9543"
-PR = "r5"
-DEPENDS = "virtual/libiconv"
-
-inherit autotools gettext texinfo
-
-SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.bz2 \
-           file://gnulib_m4.patch \
-           file://futimens.patch \
-           file://coreutils-ls-x.patch \
-           file://coreutils-6.9-cp-i-u.patch \
-           file://coreutils-i18n.patch \
-           file://coreutils-overflow.patch \
-           file://coreutils-fix-install.patch \
-           file://man-touch.patch \
-           file://coreutils_fix_for_automake-1.12.patch \
-           file://coreutils-fix-texinfo.patch \
-           file://fix_for_manpage_building.patch \
-           file://loadavg.patch \
-           "
-
-SRC_URI[md5sum] = "c9607d8495f16e98906e7ed2d9751a06"
-SRC_URI[sha256sum] = "89c2895ad157de50e53298b22d91db116ee4e1dd3fdf4019260254e2e31497b0"
-
-EXTRA_OECONF += "ac_cv_func_getgroups_works=yes \
-                 ac_cv_func_strcoll_works=yes"
-
-# acl is not a default feature
-#
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
-
-# with, without, depends, rdepends
-#
-PACKAGECONFIG[acl] = "ac_cv_header_sys_acl_h=yes ac_cv_header_acl_libacl_h=yes ac_cv_search_acl_get_file=-lacl,ac_cv_header_sys_acl_h=no ac_cv_header_acl_libacl_h=no ac_cv_search_acl_get_file=,acl,"
-
-
-# [ gets a special treatment and is not included in this
-bindir_progs = "base64 basename cksum comm csplit cut dir dircolors dirname du \
-                env expand expr factor fmt fold groups head hostid id install \
-                join link logname md5sum mkfifo nice nl nohup od paste pathchk \
-                pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \
-                sha384sum sha512sum shred shuf sort split sum tac tail tee test \
-                tr tsort tty unexpand uniq unlink users vdir wc who whoami yes uptime"
-
-# hostname gets a special treatment and is not included in this
-base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
-                     mknod mv pwd rm rmdir sleep stty sync touch true uname hostname stat"
-
-sbindir_progs= "chroot"
-
-# Let aclocal use the relative path for the m4 file rather than the
-# absolute since coreutils has a lot of m4 files, otherwise there might
-# be an "Argument list too long" error when it is built in a long/deep
-# directory.
-acpaths = "-I ./m4"
-
-do_install() {
-	autotools_do_install
-
-	install -d ${D}${base_bindir}
-	[ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
-
-	install -d ${D}${sbindir}
-	[ "${bindir}" != "${sbindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i; done
-
-	# [ requires special handling because [.coreutils will cause the sed stuff
-	# in update-alternatives to fail, therefore use lbracket - the name used
-	# for the actual source file.
-	mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
-
-	# Newer versions of coreutils do not include su, to mimic this behavior
-	# we simply remove it.
-	rm -f ${D}${bindir}/su
-}
-
-inherit update-alternatives
-
-ALTERNATIVE_PRIORITY = "100"
-
-ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs}"
-
-ALTERNATIVE_${PN}-doc = "su.1 hostname.1"
-ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1"
-ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
-
-ALTERNATIVE_PRIORITY[uptime] = "10"
-ALTERNATIVE_PRIORITY[hostname] = "10"
-
-ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
-ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
-
-python __anonymous() {
-	for prog in d.getVar('base_bindir_progs', True).split():
-		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
-
-	for prog in d.getVar('sbindir_progs', True).split():
-		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog))
-}
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_8.25.bb b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_8.25.bb
deleted file mode 100644
index df6ad38..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_8.25.bb
+++ /dev/null
@@ -1,142 +0,0 @@
-SUMMARY = "The basic file, shell and text manipulation utilities"
-DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
-manipulation utilities. These are the core utilities which are expected to exist on \
-every system."
-HOMEPAGE = "http://www.gnu.org/software/coreutils/"
-BUGTRACKER = "http://debbugs.gnu.org/coreutils"
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
-                    file://src/ls.c;beginline=5;endline=16;md5=38b79785ca88537b75871782a2a3c6b8"
-DEPENDS = "gmp libcap"
-DEPENDS_class-native = ""
-
-inherit autotools gettext texinfo
-
-SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz;name=tarball \
-           http://distfiles.gentoo.org/distfiles/${BP}-man.tar.xz;name=manpages \
-           file://man-decouple-manpages-from-build.patch \
-           file://remove-usr-local-lib-from-m4.patch \
-           file://fix-selinux-flask.patch \
-           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
-           file://0001-uname-report-processor-and-hardware-correctly.patch \
-           file://disable-ls-output-quoting.patch \
-          "
-
-SRC_URI[tarball.md5sum] = "070e43ba7f618d747414ef56ab248a48"
-SRC_URI[tarball.sha256sum] = "31e67c057a5b32a582f26408c789e11c2e8d676593324849dcf5779296cdce87"
-SRC_URI[manpages.md5sum] = "415cc0552bc4e480b27ce8b2aebfdeb5"
-SRC_URI[manpages.sha256sum] = "2ee31c3a6d2276f49c5515375d4a0c1047580da6ac10536898e0f0de81707f29"
-
-EXTRA_OECONF_class-native = "--without-gmp"
-EXTRA_OECONF_class-target = "--enable-install-program=arch --libexecdir=${libdir}"
-EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch"
-
-# acl and xattr are not default features
-#
-PACKAGECONFIG_class-target ??= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)} \
-"
-
-# The lib/oe/path.py requires xattr
-PACKAGECONFIG_class-native ??= "xattr"
-
-# with, without, depends, rdepends
-#
-PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
-PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
-
-# [ df mktemp base64 gets a special treatment and is not included in this
-bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
-                env expand expr factor fmt fold groups head hostid id install \
-                join link logname md5sum mkfifo nice nl nohup nproc od paste pathchk \
-                pinky pr printenv printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
-                sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout\
-                tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
-
-# hostname gets a special treatment and is not included in this
-base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
-                     mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
-
-sbindir_progs= "chroot"
-
-# Let aclocal use the relative path for the m4 file rather than the
-# absolute since coreutils has a lot of m4 files, otherwise there might
-# be an "Argument list too long" error when it is built in a long/deep
-# directory.
-acpaths = "-I ./m4"
-
-# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
-do_compile_prepend () {
-	mkdir -p ${B}/src
-}
-
-do_install_class-native() {
-	autotools_do_install
-	# remove groups to fix conflict with shadow-native
-	rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
-	# The return is a must since native doesn't need the
-	# do_install_append() in the below.
-	return
-}
-
-do_install_append() {
-	for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
-
-	install -d ${D}${base_bindir}
-	[ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
-
-	install -d ${D}${sbindir}
-	[ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
-
-	# [ requires special handling because [.coreutils will cause the sed stuff
-	# in update-alternatives to fail, therefore use lbracket - the name used
-	# for the actual source file.
-	mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
-
-	# prebuilt man pages
-	install -d ${D}/${mandir}/man1
-	install -t ${D}/${mandir}/man1 ${S}/man/*.1
-	# prebuilt man pages don't do a separate man page for [ vs test.
-	# see comment above r.e. sed and update-alternatives
-	cp -a ${D}${mandir}/man1/test.1 ${D}${mandir}/man1/lbracket.1.${BPN}
-}
-
-inherit update-alternatives
-
-ALTERNATIVE_PRIORITY = "100"
-ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df"
-ALTERNATIVE_${PN}-doc = "base64.1 mktemp.1 df.1 lbracket.1 groups.1 kill.1 uptime.1 stat.1  hostname.1"
-
-ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
-
-ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
-ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
-ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
-
-ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
-ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
-ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
-
-ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
-ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
-ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
-
-ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
-ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
-ALTERNATIVE_LINK_NAME[lbracket.1] = "${mandir}/man1/lbracket.1"
-
-ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
-ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
-ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
-ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
-
-python __anonymous() {
-	for prog in d.getVar('base_bindir_progs', True).split():
-		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
-
-	for prog in d.getVar('sbindir_progs', True).split():
-		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog))
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_8.26.bb b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_8.26.bb
new file mode 100644
index 0000000..52ef101
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_8.26.bb
@@ -0,0 +1,142 @@
+SUMMARY = "The basic file, shell and text manipulation utilities"
+DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
+manipulation utilities. These are the core utilities which are expected to exist on \
+every system."
+HOMEPAGE = "http://www.gnu.org/software/coreutils/"
+BUGTRACKER = "http://debbugs.gnu.org/coreutils"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+                    file://src/ls.c;beginline=5;endline=16;md5=38b79785ca88537b75871782a2a3c6b8"
+DEPENDS = "gmp libcap"
+DEPENDS_class-native = ""
+
+inherit autotools gettext texinfo
+
+SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz;name=tarball \
+           http://distfiles.gentoo.org/distfiles/${BP}-man.tar.xz;name=manpages \
+           file://man-decouple-manpages-from-build.patch \
+           file://remove-usr-local-lib-from-m4.patch \
+           file://fix-selinux-flask.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           file://0001-uname-report-processor-and-hardware-correctly.patch \
+           file://disable-ls-output-quoting.patch \
+           file://0001-local.mk-fix-cross-compiling-problem.patch \
+          "
+
+SRC_URI[tarball.md5sum] = "d5aa2072f662d4118b9f4c63b94601a6"
+SRC_URI[tarball.sha256sum] = "155e94d748f8e2bc327c66e0cbebdb8d6ab265d2f37c3c928f7bf6c3beba9a8e"
+SRC_URI[manpages.md5sum] = "b58107f532f7beffcb2f38e2ac1f2da3"
+SRC_URI[manpages.sha256sum] = "9324ec412ffca3b0431e6299720c33ac98e749e430f72a7c6e65f3635c86aa29"
+
+EXTRA_OECONF_class-native = "--without-gmp"
+EXTRA_OECONF_class-target = "--enable-install-program=arch --libexecdir=${libdir}"
+EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch"
+
+# acl and xattr are not default features
+#
+PACKAGECONFIG_class-target ??= "\
+    ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
+"
+
+# The lib/oe/path.py requires xattr
+PACKAGECONFIG_class-native ??= "xattr"
+
+# with, without, depends, rdepends
+#
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+
+# [ df mktemp base64 gets a special treatment and is not included in this
+bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
+                env expand expr factor fmt fold groups head hostid id install \
+                join link logname md5sum mkfifo nice nl nohup nproc od paste pathchk \
+                pinky pr printenv printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
+                sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout\
+                tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
+
+# hostname gets a special treatment and is not included in this
+base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
+                     mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
+
+sbindir_progs= "chroot"
+
+# Let aclocal use the relative path for the m4 file rather than the
+# absolute since coreutils has a lot of m4 files, otherwise there might
+# be an "Argument list too long" error when it is built in a long/deep
+# directory.
+acpaths = "-I ./m4"
+
+# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
+do_compile_prepend () {
+	mkdir -p ${B}/src
+}
+
+do_install_class-native() {
+	autotools_do_install
+	# remove groups to fix conflict with shadow-native
+	rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
+	# The return is a must since native doesn't need the
+	# do_install_append() in the below.
+	return
+}
+
+do_install_append() {
+	for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
+
+	install -d ${D}${base_bindir}
+	[ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
+
+	install -d ${D}${sbindir}
+	[ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
+
+	# [ requires special handling because [.coreutils will cause the sed stuff
+	# in update-alternatives to fail, therefore use lbracket - the name used
+	# for the actual source file.
+	mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
+
+	# prebuilt man pages
+	install -d ${D}/${mandir}/man1
+	install -t ${D}/${mandir}/man1 ${S}/man/*.1
+	# prebuilt man pages don't do a separate man page for [ vs test.
+	# see comment above r.e. sed and update-alternatives
+	cp -a ${D}${mandir}/man1/test.1 ${D}${mandir}/man1/lbracket.1.${BPN}
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df"
+ALTERNATIVE_${PN}-doc = "base64.1 mktemp.1 df.1 lbracket.1 groups.1 kill.1 uptime.1 stat.1  hostname.1"
+
+ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
+
+ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
+ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
+ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
+
+ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
+ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
+ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
+
+ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
+ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
+ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
+
+ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
+ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
+ALTERNATIVE_LINK_NAME[lbracket.1] = "${mandir}/man1/lbracket.1"
+
+ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
+ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
+ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+python __anonymous() {
+	for prog in d.getVar('base_bindir_progs').split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
+
+	for prog in d.getVar('sbindir_progs').split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib_0.106.bb b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib_0.106.bb
deleted file mode 100644
index 0ae848e..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib_0.106.bb
+++ /dev/null
@@ -1,4 +0,0 @@
-require dbus-glib.inc
-
-SRC_URI[md5sum] = "2eea0b7f52b49f600a07abfd8535d4e4"
-SRC_URI[sha256sum] = "b38952706dcf68bad9c302999ef0f420b8cf1a2428227123f0ac4764b689c046"
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib_0.108.bb b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib_0.108.bb
new file mode 100644
index 0000000..7a9a69e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib_0.108.bb
@@ -0,0 +1,4 @@
+require dbus-glib.inc
+
+SRC_URI[md5sum] = "a66a613705870752ca9786e0359aea97"
+SRC_URI[sha256sum] = "9f340c7e2352e9cdf113893ca77ca9075d9f8d5e81476bf2bf361099383c602c"
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-test_1.10.10.bb b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-test_1.10.10.bb
deleted file mode 100644
index 650b7ab..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-test_1.10.10.bb
+++ /dev/null
@@ -1,58 +0,0 @@
-SUMMARY = "D-Bus test package (for D-bus functionality testing only)"
-HOMEPAGE = "http://dbus.freedesktop.org"
-SECTION = "base"
-LICENSE = "AFL-2 | GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
-                    file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
-
-DEPENDS = "dbus glib-2.0"
-
-RDEPENDS_${PN} += "make"
-RDEPENDS_${PN}-dev = ""
-
-SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
-           file://tmpdir.patch \
-           file://run-ptest \
-           file://python-config.patch \
-           file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
-           "
-
-SRC_URI[md5sum] = "495676d240eb982921b3ad1343526849"
-SRC_URI[sha256sum] = "9d8f1d069ab4d1a0255d7b400ea3bcef4430c42e729b1012abb2890e3f739a43"
-
-S="${WORKDIR}/dbus-${PV}"
-FILESEXTRAPATHS =. "${FILE_DIRNAME}/dbus:"
-
-inherit autotools pkgconfig gettext ptest upstream-version-is-even
-
-EXTRA_OECONF_X = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}"
-EXTRA_OECONF_X_class-native = "--without-x"
-
-EXTRA_OECONF = "--enable-tests \
-                --enable-modular-tests \
-                --enable-installed-tests \
-                --enable-checks \
-                --enable-asserts \
-                --enable-verbose-mode \
-                --disable-xml-docs \
-                --disable-doxygen-docs \
-                --disable-libaudit \
-                --disable-systemd \
-                --without-systemdsystemunitdir \
-                --with-dbus-test-dir=${PTEST_PATH} \
-                ${EXTRA_OECONF_X}"
-
-do_install() {
-    :
-}
-
-do_install_ptest() {
-	install -d ${D}${PTEST_PATH}/test
-	l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay"
-	for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
-	l="bus bus-system bus-launch-helper"
-	for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done
-	install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
-	cp -r ${B}/test/data ${D}${PTEST_PATH}/test
-}
-RDEPENDS_${PN}-ptest += "bash"
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-test_1.10.14.bb b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-test_1.10.14.bb
new file mode 100644
index 0000000..5394814
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-test_1.10.14.bb
@@ -0,0 +1,58 @@
+SUMMARY = "D-Bus test package (for D-bus functionality testing only)"
+HOMEPAGE = "http://dbus.freedesktop.org"
+SECTION = "base"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
+                    file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+
+DEPENDS = "dbus glib-2.0"
+
+RDEPENDS_${PN} += "make"
+RDEPENDS_${PN}-dev = ""
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+           file://tmpdir.patch \
+           file://run-ptest \
+           file://python-config.patch \
+           file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+           "
+
+SRC_URI[md5sum] = "3f7b013ce8f641cd4c897acda0ef3467"
+SRC_URI[sha256sum] = "23238f70353e38ce5ca183ebc9525c0d97ac00ef640ad29cf794782af6e6a083"
+
+S="${WORKDIR}/dbus-${PV}"
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/dbus:"
+
+inherit autotools pkgconfig gettext ptest upstream-version-is-even
+
+EXTRA_OECONF_X = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}"
+EXTRA_OECONF_X_class-native = "--without-x"
+
+EXTRA_OECONF = "--enable-tests \
+                --enable-modular-tests \
+                --enable-installed-tests \
+                --enable-checks \
+                --enable-asserts \
+                --enable-verbose-mode \
+                --disable-xml-docs \
+                --disable-doxygen-docs \
+                --disable-libaudit \
+                --disable-systemd \
+                --without-systemdsystemunitdir \
+                --with-dbus-test-dir=${PTEST_PATH} \
+                ${EXTRA_OECONF_X}"
+
+do_install() {
+    :
+}
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/test
+	l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay"
+	for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
+	l="bus bus-system bus-launch-helper"
+	for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done
+	install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
+	cp -r ${B}/test/data ${D}${PTEST_PATH}/test
+}
+RDEPENDS_${PN}-ptest += "bash"
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus_1.10.10.bb b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus_1.10.10.bb
deleted file mode 100644
index 4db0b9b..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus_1.10.10.bb
+++ /dev/null
@@ -1,181 +0,0 @@
-SUMMARY = "D-Bus message bus"
-DESCRIPTION = "D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a \"single instance\" application or daemon, and to launch applications and daemons on demand when their services are needed."
-HOMEPAGE = "http://dbus.freedesktop.org"
-SECTION = "base"
-LICENSE = "AFL-2 | GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
-                    file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
-DEPENDS = "expat virtual/libintl"
-RDEPENDS_dbus_class-native = ""
-RDEPENDS_dbus_class-nativesdk = ""
-PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}"
-ALLOW_EMPTY_dbus-ptest = "1"
-RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest"
-
-SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
-           file://tmpdir.patch \
-           file://dbus-1.init \
-           file://os-test.patch \
-           file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
-           file://0001-configure.ac-explicitely-check-stdint.h.patch \
-"
-
-SRC_URI[md5sum] = "495676d240eb982921b3ad1343526849"
-SRC_URI[sha256sum] = "9d8f1d069ab4d1a0255d7b400ea3bcef4430c42e729b1012abb2890e3f739a43"
-
-inherit useradd autotools pkgconfig gettext update-rc.d upstream-version-is-even
-
-INITSCRIPT_NAME = "dbus-1"
-INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
-
-python __anonymous() {
-    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
-}
-
-USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "-r netdev"
-USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
-                       --no-create-home --shell /bin/false \
-                       --user-group messagebus"
-
-CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
-
-DEBIANNAME_${PN} = "dbus-1"
-
-PACKAGES =+ "${PN}-lib"
-
-OLDPKGNAME = "dbus-x11"
-OLDPKGNAME_class-nativesdk = ""
-
-# for compatibility
-RPROVIDES_${PN} = "${OLDPKGNAME}"
-RREPLACES_${PN} += "${OLDPKGNAME}"
-
-FILES_${PN} = "${bindir}/dbus-daemon* \
-               ${bindir}/dbus-uuidgen \
-               ${bindir}/dbus-cleanup-sockets \
-               ${bindir}/dbus-send \
-               ${bindir}/dbus-monitor \
-               ${bindir}/dbus-launch \
-               ${bindir}/dbus-run-session \
-               ${bindir}/dbus-update-activation-environment \
-               ${libexecdir}/dbus* \
-               ${sysconfdir} \
-               ${localstatedir} \
-               ${datadir}/dbus-1/services \
-               ${datadir}/dbus-1/system-services \
-               ${datadir}/dbus-1/session.d \
-               ${datadir}/dbus-1/session.conf \
-               ${datadir}/dbus-1/system.d \
-               ${datadir}/dbus-1/system.conf \
-               ${systemd_system_unitdir} \
-               ${systemd_user_unitdir} \
-"
-FILES_${PN}-lib = "${libdir}/lib*.so.*"
-RRECOMMENDS_${PN}-lib = "${PN}"
-FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool"
-
-pkg_postinst_dbus() {
-	# If both systemd and sysvinit are enabled, mask the dbus-1 init script
-        if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
-		if [ -n "$D" ]; then
-			OPTS="--root=$D"
-		fi
-		systemctl $OPTS mask dbus-1.service
-	fi
-
-	if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
-		/etc/init.d/populate-volatile.sh update
-	fi
-}
-
-EXTRA_OECONF = "--disable-tests \
-                --disable-xml-docs \
-                --disable-doxygen-docs \
-                --disable-libaudit \
-                "
-
-EXTRA_OECONF_append_class-native = " --disable-selinux"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-PACKAGECONFIG_class-native = ""
-PACKAGECONFIG_class-nativesdk = ""
-
-PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
-PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
-PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
-PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
-
-do_install() {
-	autotools_do_install
-
-	if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
-		install -d ${D}${sysconfdir}/init.d
-		sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
-		install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
-	fi
-
-	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-		for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
-			install -d ${D}${systemd_system_unitdir}/$i; done
-		install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
-		cd ${D}${systemd_system_unitdir}/dbus.target.wants/
-		ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
-		ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
-		ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
-	fi
-
-	install -d ${D}${sysconfdir}/default/volatiles
-	echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
-	     > ${D}${sysconfdir}/default/volatiles/99_dbus
-
-
-	mkdir -p ${D}${localstatedir}/lib/dbus
-
-	chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
-
-	chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
-	chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
-
-	# Remove Red Hat initscript
-	rm -rf ${D}${sysconfdir}/rc.d
-
-	# Remove empty testexec directory as we don't build tests
-	rm -rf ${D}${libdir}/dbus-1.0/test
-
-	# Remove /var/run as it is created on startup
-	rm -rf ${D}${localstatedir}/run
-}
-
-do_install_class-native() {
-	autotools_do_install
-
-	# for dbus-glib-native introspection generation
-	install -d ${D}${STAGING_DATADIR_NATIVE}/dbus/
-	# N.B. is below install actually required?
-	install -m 0644 bus/session.conf ${D}${STAGING_DATADIR_NATIVE}/dbus/session.conf
-
-	# dbus-glib-native and dbus-glib need this xml file
-	./bus/dbus-daemon --introspect > ${D}${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
-	
-	# dbus-launch has no X support so lets not install it in case the host
-	# has a more featured and useful version
-	rm -f ${D}${bindir}/dbus-launch
-}
-
-do_install_class-nativesdk() {
-	autotools_do_install
-
-	# dbus-launch has no X support so lets not install it in case the host
-	# has a more featured and useful version
-	rm -f ${D}${bindir}/dbus-launch
-
-	# Remove /var/run to avoid QA error
-	rm -rf ${D}${localstatedir}/run
-}
-BBCLASSEXTEND = "native nativesdk"
-
-INSANE_SKIP_${PN}-ptest += "build-deps"
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus_1.10.14.bb b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus_1.10.14.bb
new file mode 100644
index 0000000..e1d73563
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus_1.10.14.bb
@@ -0,0 +1,180 @@
+SUMMARY = "D-Bus message bus"
+DESCRIPTION = "D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a \"single instance\" application or daemon, and to launch applications and daemons on demand when their services are needed."
+HOMEPAGE = "http://dbus.freedesktop.org"
+SECTION = "base"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
+                    file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+DEPENDS = "expat virtual/libintl"
+RDEPENDS_dbus_class-native = ""
+RDEPENDS_dbus_class-nativesdk = ""
+PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}"
+ALLOW_EMPTY_dbus-ptest = "1"
+RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+           file://tmpdir.patch \
+           file://dbus-1.init \
+           file://os-test.patch \
+           file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+           file://0001-configure.ac-explicitely-check-stdint.h.patch \
+"
+
+SRC_URI[md5sum] = "3f7b013ce8f641cd4c897acda0ef3467"
+SRC_URI[sha256sum] = "23238f70353e38ce5ca183ebc9525c0d97ac00ef640ad29cf794782af6e6a083"
+
+inherit useradd autotools pkgconfig gettext update-rc.d upstream-version-is-even
+
+INITSCRIPT_NAME = "dbus-1"
+INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
+
+python __anonymous() {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "-r netdev"
+USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
+                       --no-create-home --shell /bin/false \
+                       --user-group messagebus"
+
+CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
+
+DEBIANNAME_${PN} = "dbus-1"
+
+PACKAGES =+ "${PN}-lib"
+
+OLDPKGNAME = "dbus-x11"
+OLDPKGNAME_class-nativesdk = ""
+
+# for compatibility
+RPROVIDES_${PN} = "${OLDPKGNAME}"
+RREPLACES_${PN} += "${OLDPKGNAME}"
+
+FILES_${PN} = "${bindir}/dbus-daemon* \
+               ${bindir}/dbus-uuidgen \
+               ${bindir}/dbus-cleanup-sockets \
+               ${bindir}/dbus-send \
+               ${bindir}/dbus-monitor \
+               ${bindir}/dbus-launch \
+               ${bindir}/dbus-run-session \
+               ${bindir}/dbus-update-activation-environment \
+               ${libexecdir}/dbus* \
+               ${sysconfdir} \
+               ${localstatedir} \
+               ${datadir}/dbus-1/services \
+               ${datadir}/dbus-1/system-services \
+               ${datadir}/dbus-1/session.d \
+               ${datadir}/dbus-1/session.conf \
+               ${datadir}/dbus-1/system.d \
+               ${datadir}/dbus-1/system.conf \
+               ${systemd_system_unitdir} \
+               ${systemd_user_unitdir} \
+"
+FILES_${PN}-lib = "${libdir}/lib*.so.*"
+RRECOMMENDS_${PN}-lib = "${PN}"
+FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool"
+
+PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
+pkg_postinst_dbus() {
+	# If both systemd and sysvinit are enabled, mask the dbus-1 init script
+        if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask dbus-1.service
+	fi
+
+	if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
+		/etc/init.d/populate-volatile.sh update
+	fi
+}
+
+EXTRA_OECONF = "--disable-tests \
+                --disable-xml-docs \
+                --disable-doxygen-docs \
+                --disable-libaudit \
+                --enable-largefile \
+                "
+
+EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
+EXTRA_OECONF_append_class-native = " --disable-selinux"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)}"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
+PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
+PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
+
+do_install() {
+	autotools_do_install
+
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+		install -d ${D}${sysconfdir}/init.d
+		sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
+		install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
+	fi
+
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
+			install -d ${D}${systemd_system_unitdir}/$i; done
+		install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
+		ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
+		ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
+		ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
+	fi
+
+	install -d ${D}${sysconfdir}/default/volatiles
+	echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
+	     > ${D}${sysconfdir}/default/volatiles/99_dbus
+
+
+	mkdir -p ${D}${localstatedir}/lib/dbus
+
+	chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
+
+	chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
+	chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
+
+	# Remove Red Hat initscript
+	rm -rf ${D}${sysconfdir}/rc.d
+
+	# Remove empty testexec directory as we don't build tests
+	rm -rf ${D}${libdir}/dbus-1.0/test
+
+	# Remove /var/run as it is created on startup
+	rm -rf ${D}${localstatedir}/run
+}
+
+do_install_class-native() {
+	autotools_do_install
+
+	# for dbus-glib-native introspection generation
+	install -d ${D}${STAGING_DATADIR_NATIVE}/dbus/
+	# N.B. is below install actually required?
+	install -m 0644 bus/session.conf ${D}${STAGING_DATADIR_NATIVE}/dbus/session.conf
+
+	# dbus-glib-native and dbus-glib need this xml file
+	./bus/dbus-daemon --introspect > ${D}${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
+	
+	# dbus-launch has no X support so lets not install it in case the host
+	# has a more featured and useful version
+	rm -f ${D}${bindir}/dbus-launch
+}
+
+do_install_class-nativesdk() {
+	autotools_do_install
+
+	# dbus-launch has no X support so lets not install it in case the host
+	# has a more featured and useful version
+	rm -f ${D}${bindir}/dbus-launch
+
+	# Remove /var/run to avoid QA error
+	rm -rf ${D}${localstatedir}/run
+}
+BBCLASSEXTEND = "native nativesdk"
+
+INSANE_SKIP_${PN}-ptest += "build-deps"
diff --git a/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear.inc b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear.inc
index bda7eb8..b6b436c 100644
--- a/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear.inc
@@ -8,7 +8,7 @@
 LIC_FILES_CHKSUM = "file://LICENSE;md5=a5ec40cafba26fc4396d0b550f824e01"
 
 DEPENDS = "zlib"
-RPROVIDES_${PN} = "ssh sshd" 
+RPROVIDES_${PN} = "ssh sshd"
 
 DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 
@@ -63,7 +63,7 @@
 
 	install -m 0755 dropbearmulti ${D}${sbindir}/
 	ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient
-	
+
 	for i in ${SBINCOMMANDS}
 	do
 		ln -s ./dropbearmulti ${D}${sbindir}/$i
@@ -74,7 +74,7 @@
 		-e 's,/usr/bin,${bindir},g' \
 		-e 's,/usr,${prefix},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/dropbear
 	chmod 755 ${D}${sysconfdir}/init.d/dropbear
-	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
 		install -d ${D}${sysconfdir}/pam.d
 		install -m 0644 ${WORKDIR}/dropbear  ${D}${sysconfdir}/pam.d/
 	fi
diff --git a/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/init b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/init
index 434bd6b..f6e1c46 100755
--- a/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/init
+++ b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/init
@@ -40,49 +40,28 @@
 if [ $readonly_rootfs = "1" ]; then
   mkdir -p /var/lib/dropbear
   DROPBEAR_RSAKEY_DEFAULT="/var/lib/dropbear/dropbear_rsa_host_key"
-  DROPBEAR_DSSKEY_DEFAULT="/var/lib/dropbear/dropbear_dss_host_key"
 else
   DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key"
-  DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_host_key"
 fi
 
 test -z "$DROPBEAR_BANNER" || \
   DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
 test -n "$DROPBEAR_RSAKEY" || \
   DROPBEAR_RSAKEY=$DROPBEAR_RSAKEY_DEFAULT
-test -n "$DROPBEAR_DSSKEY" || \
-  DROPBEAR_DSSKEY=$DROPBEAR_DSSKEY_DEFAULT
-test -n "$DROPBEAR_KEYTYPES" || \
-  DROPBEAR_KEYTYPES="rsa"
 
 gen_keys() {
-for t in $DROPBEAR_KEYTYPES; do
-  case $t in
-    rsa)
-        if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
-                rm $DROPBEAR_RSAKEY || true
-        fi
-        test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY $DROPBEAR_RSAKEY_ARGS
-	;;
-    dsa)
-        if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then
-                rm $DROPBEAR_DSSKEY || true
-        fi
-        test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY $DROPBEAR_DSSKEY_ARGS
-	;;
-  esac
-done
+    if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
+        rm $DROPBEAR_RSAKEY || true
+    fi
+    test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY $DROPBEAR_RSAKEY_ARGS
 }
 
 case "$1" in
   start)
 	echo -n "Starting $DESC: "
 	gen_keys
-	KEY_ARGS=""
-	test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
-	test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
 	start-stop-daemon -S -p $PIDFILE \
-	  -x "$DAEMON" -- $KEY_ARGS \
+	  -x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
 	    -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
 	echo "$NAME."
 	;;
@@ -95,11 +74,8 @@
 	echo -n "Restarting $DESC: "
 	start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
 	sleep 1
-	KEY_ARGS=""
-	test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
-	test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
 	start-stop-daemon -S -p $PIDFILE \
-	  -x "$DAEMON" -- $KEY_ARGS \
+	  -x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
 	    -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
 	echo "$NAME."
 	;;
diff --git a/import-layers/yocto-poky/meta/recipes-core/expat/expat.inc b/import-layers/yocto-poky/meta/recipes-core/expat/expat.inc
index fe9d7e7..9fa0ca2 100644
--- a/import-layers/yocto-poky/meta/recipes-core/expat/expat.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/expat/expat.inc
@@ -7,12 +7,12 @@
 SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.bz2 \
            file://autotools.patch \
 	  "
-
-inherit autotools lib_package gzipnative
+inherit autotools lib_package
 
 # This package uses an archive format known to have issue with some
 # versions of gzip
-do_unpack[depends] += "gzip-native:do_populate_sysroot"
+DEPENDS += "pigz-native"
+do_unpack[depends] += "pigz-native:do_populate_sysroot"
 
 do_configure_prepend () {
 	rm -f ${S}/conftools/libtool.m4
diff --git a/import-layers/yocto-poky/meta/recipes-core/fts/fts.bb b/import-layers/yocto-poky/meta/recipes-core/fts/fts.bb
index 9d8230f..de9297e 100644
--- a/import-layers/yocto-poky/meta/recipes-core/fts/fts.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/fts/fts.bb
@@ -22,10 +22,7 @@
 
 do_configure[noexec] = "1"
 
-HASHSTYLE_mips = "sysv"
-HASHSTYLE_mipsel = "sysv"
-HASHSTYLE_mips64 = "sysv"
-HASHSTYLE_mips64el = "sysv"
+HASHSTYLE_mipsarch = "sysv"
 HASHSTYLE = "gnu"
 
 VER = "0"
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch
deleted file mode 100644
index e4c5f15..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-
-# Pulled from OpenEmbedded
-# 
-# Commented by: Saul Wold <saul.wold@intel.com>
-
-Upstream-Status: Inappropriate [licensing]
-
-Index: gettext-0.16.1/gettext-tools/configure.ac
-===================================================================
---- gettext-0.16.1.orig/gettext-tools/configure.ac	2006-11-27 09:02:01.000000000 -0800
-+++ gettext-0.16.1/gettext-tools/configure.ac	2011-03-16 16:55:36.111396557 -0700
-@@ -36,27 +36,15 @@
- gt_JAVA_CHOICE
- 
- gt_GCJ
--if test -n "$HAVE_GCJ" && test "$JAVA_CHOICE" = yes; then
--  BUILDJAVAEXE=yes
--else
-   BUILDJAVAEXE=no
--fi
- AC_SUBST(BUILDJAVAEXE)
- 
- gt_JAVAEXEC
- gt_JAVACOMP([1.3])
- AC_CHECK_PROG(JAR, jar, jar)
--if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
--  BUILDJAVA=yes
--else
-   BUILDJAVA=no
--fi
- AC_SUBST(BUILDJAVA)
--if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then
--  TESTJAVA=yes
--else
-   TESTJAVA=no
--fi
- AC_SUBST(TESTJAVA)
- 
- gt_CSHARPCOMP
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch
deleted file mode 100644
index 49a10f5..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-
-This patch updates the required version number from 2.61 to the 
-current 2.65 version of aclocal, this will need to be updated 
-when we update aclocal
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4
-===================================================================
---- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4	2011-03-17 02:24:36.391519775 -0700
-+++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4	2011-03-17 02:24:45.569526073 -0700
-@@ -148,7 +148,7 @@
-   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-   dnl Autoconf >= 2.61 supports dots in --with options.
--  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
-+  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.65]),[-1],[translit([$1],[.],[_])],[$1])])
-   dnl By default, look in $includedir and $libdir.
-   use_additional=yes
-   AC_LIB_WITH_FINAL_PREFIX([
-Index: gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4
-===================================================================
---- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathly/aclocal.m4	2011-03-17 02:24:36.391519775 -0700
-+++ gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4	2011-03-17 02:24:45.570526904 -0700
-@@ -11,8 +11,8 @@
- # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- # PARTICULAR PURPOSE.
- 
--m4_if(m4_PACKAGE_VERSION, [2.61],,
--[m4_fatal([this file was generated for autoconf 2.61.
-+m4_if(m4_PACKAGE_VERSION, [2.65],,
-+[m4_fatal([this file was generated for autoconf 2.65.
- You have another version of autoconf.  If you want to use that,
- you should regenerate the build system entirely.], [63])])
- 
-Index: gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4
-===================================================================
---- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathx/aclocal.m4	2011-03-17 02:24:36.391519775 -0700
-+++ gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4	2011-03-17 02:24:45.572525773 -0700
-@@ -11,8 +11,8 @@
- # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- # PARTICULAR PURPOSE.
- 
--m4_if(m4_PACKAGE_VERSION, [2.61],,
--[m4_fatal([this file was generated for autoconf 2.61.
-+m4_if(m4_PACKAGE_VERSION, [2.65],,
-+[m4_fatal([this file was generated for autoconf 2.65.
- You have another version of autoconf.  If you want to use that,
- you should regenerate the build system entirely.], [63])])
- 
-Index: gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4
-===================================================================
---- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathy/aclocal.m4	2011-03-17 02:24:36.391519775 -0700
-+++ gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4	2011-03-17 02:24:45.578394916 -0700
-@@ -11,7 +11,7 @@
- # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- # PARTICULAR PURPOSE.
- 
--m4_if(m4_PACKAGE_VERSION, [2.61],,
-+m4_if(m4_PACKAGE_VERSION, [2.65],,
- [m4_fatal([this file was generated for autoconf 2.61.
- You have another version of autoconf.  If you want to use that,
- you should regenerate the build system entirely.], [63])])
-Index: gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4
-===================================================================
---- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathz/aclocal.m4	2011-03-17 02:24:36.391519775 -0700
-+++ gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4	2011-03-17 02:24:45.586395416 -0700
-@@ -11,8 +11,8 @@
- # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- # PARTICULAR PURPOSE.
- 
--m4_if(m4_PACKAGE_VERSION, [2.61],,
--[m4_fatal([this file was generated for autoconf 2.61.
-+m4_if(m4_PACKAGE_VERSION, [2.65],,
-+[m4_fatal([this file was generated for autoconf 2.65.
- You have another version of autoconf.  If you want to use that,
- you should regenerate the build system entirely.], [63])])
- 
-Index: gettext-0.16.1/gettext-tools/aclocal.m4
-===================================================================
---- gettext-0.16.1.orig/gettext-tools/aclocal.m4	2006-11-27 09:34:32.000000000 -0800
-+++ gettext-0.16.1/gettext-tools/aclocal.m4	2011-03-17 02:27:01.135682807 -0700
-@@ -11,8 +11,8 @@
- # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- # PARTICULAR PURPOSE.
- 
--m4_if(m4_PACKAGE_VERSION, [2.61],,
--[m4_fatal([this file was generated for autoconf 2.61.
-+m4_if(m4_PACKAGE_VERSION, [2.65],,
-+[m4_fatal([this file was generated for autoconf 2.65.
- You have another version of autoconf.  If you want to use that,
- you should regenerate the build system entirely.], [63])])
- 
-Index: gettext-0.16.1/gettext-tools/examples/aclocal.m4
-===================================================================
---- gettext-0.16.1.orig/gettext-tools/examples/aclocal.m4	2006-11-27 09:16:23.000000000 -0800
-+++ gettext-0.16.1/gettext-tools/examples/aclocal.m4	2011-03-17 02:26:52.589396683 -0700
-@@ -11,8 +11,8 @@
- # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- # PARTICULAR PURPOSE.
- 
--m4_if(m4_PACKAGE_VERSION, [2.61],,
--[m4_fatal([this file was generated for autoconf 2.61.
-+m4_if(m4_PACKAGE_VERSION, [2.65],,
-+[m4_fatal([this file was generated for autoconf 2.65.
- You have another version of autoconf.  If you want to use that,
- you should regenerate the build system entirely.], [63])])
- 
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch
deleted file mode 100644
index fd5feeb..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch
+++ /dev/null
@@ -1,348 +0,0 @@
-
-This patch removes the circular dependency on AC_GNU_SOURCE in
-AC_USE_SYSTEM_EXTENSIONS.
-
-Thanks to Mark Hatle for the timely pointers and fixes.
-
-Upstream-Status: Inappropriate [licensing]
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4 gettext.patched/gettext-runtime/gnulib-m4/extensions.m4
---- gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4	2006-11-27 09:14:38.000000000 -0800
-+++ gettext.patched/gettext-runtime/gnulib-m4/extensions.m4	2011-03-16 23:54:01.711923448 -0700
-@@ -16,43 +16,47 @@
- # ------------------------
- # Enable extensions on systems that normally disable them,
- # typically due to standards-conformance issues.
--AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
--[
--  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
--  AC_BEFORE([$0], [AC_RUN_IFELSE])
--
--  AC_REQUIRE([AC_GNU_SOURCE])
--  AC_REQUIRE([AC_AIX])
--  AC_REQUIRE([AC_MINIX])
--
--  AH_VERBATIM([__EXTENSIONS__],
--[/* Enable extensions on Solaris.  */
--#ifndef __EXTENSIONS__
--# undef __EXTENSIONS__
--#endif
--#ifndef _POSIX_PTHREAD_SEMANTICS
--# undef _POSIX_PTHREAD_SEMANTICS
--#endif
--#ifndef _TANDEM_SOURCE
--# undef _TANDEM_SOURCE
--#endif])
--  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
--    [ac_cv_safe_to_define___extensions__],
--    [AC_COMPILE_IFELSE(
--       [AC_LANG_PROGRAM([
--#	  define __EXTENSIONS__ 1
--	  AC_INCLUDES_DEFAULT])],
--       [ac_cv_safe_to_define___extensions__=yes],
--       [ac_cv_safe_to_define___extensions__=no])])
--  test $ac_cv_safe_to_define___extensions__ = yes &&
--    AC_DEFINE([__EXTENSIONS__])
--  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
--  AC_DEFINE([_TANDEM_SOURCE])
--])
-+#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
-+#[
-+#  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
-+#  AC_BEFORE([$0], [AC_RUN_IFELSE])
-+#
-+#  AC_REQUIRE([AC_GNU_SOURCE])
-+#  AC_REQUIRE([AC_AIX])
-+#  AC_REQUIRE([AC_MINIX])
-+#
-+#  AH_VERBATIM([__EXTENSIONS__],
-+#[/* Enable extensions on Solaris.  */
-+##ifndef __EXTENSIONS__
-+## undef __EXTENSIONS__
-+##endif
-+##ifndef _POSIX_PTHREAD_SEMANTICS
-+## undef _POSIX_PTHREAD_SEMANTICS
-+##endif
-+##ifndef _TANDEM_SOURCE
-+## undef _TANDEM_SOURCE
-+##endif])
-+#  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
-+#    [ac_cv_safe_to_define___extensions__],
-+#    [AC_COMPILE_IFELSE(
-+#       [AC_LANG_PROGRAM([
-+##	  define __EXTENSIONS__ 1
-+#	  AC_INCLUDES_DEFAULT])],
-+#       [ac_cv_safe_to_define___extensions__=yes],
-+#       [ac_cv_safe_to_define___extensions__=no])])
-+#  test $ac_cv_safe_to_define___extensions__ = yes &&
-+#    AC_DEFINE([__EXTENSIONS__])
-+#  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
-+#  AC_DEFINE([_TANDEM_SOURCE])
-+#])
- 
- # gl_USE_SYSTEM_EXTENSIONS
- # ------------------------
- # Enable extensions on systems that normally disable them,
- # typically due to standards-conformance issues.
- AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
--  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
-+[
-+   AC_REQUIRE([AC_GNU_SOURCE])
-+
-+   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-+])
-diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4
---- gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4	2006-11-27 09:33:19.000000000 -0800
-+++ gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4	2011-03-16 23:50:17.471531838 -0700
-@@ -25,7 +25,7 @@
-   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
-   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
-   AC_REQUIRE([AC_PROG_RANLIB])
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
-   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- ])
- 
-diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4 gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4
---- gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4	2006-11-27 09:14:38.000000000 -0800
-+++ gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4	2011-03-16 23:50:10.814396529 -0700
-@@ -9,7 +9,7 @@
- 
- AC_DEFUN([gl_MBCHAR],
- [
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
-   dnl The following line is that so the user can test HAVE_WCHAR_H
-   dnl before #include "mbchar.h".
-   AC_CHECK_HEADERS_ONCE([wchar.h])
-diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4 gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4
---- gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4	2006-11-27 09:14:38.000000000 -0800
-+++ gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4	2011-03-16 23:50:08.357396247 -0700
-@@ -7,7 +7,7 @@
- AC_DEFUN([gl_FUNC_WCWIDTH],
- [
-   dnl Persuade glibc <wchar.h> to declare wcwidth().
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
- 
-   AC_REQUIRE([AC_C_INLINE])
-   AC_REQUIRE([gt_TYPE_WCHAR_T])
-diff -ru gettext-0.16.1/gettext-runtime/m4/lock.m4 gettext.patched/gettext-runtime/m4/lock.m4
---- gettext-0.16.1/gettext-runtime/m4/lock.m4	2006-10-24 13:59:59.000000000 -0700
-+++ gettext.patched/gettext-runtime/m4/lock.m4	2011-03-16 23:50:04.355891676 -0700
-@@ -35,7 +35,7 @@
-   AC_BEFORE([$0], [gl_ARGP])dnl
- 
-   AC_REQUIRE([AC_CANONICAL_HOST])
--  AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
-+  dnl AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
-   dnl Check for multithreading.
-   AC_ARG_ENABLE(threads,
- AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
-diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4 gettext.patched/gettext-tools/gnulib-m4/extensions.m4
---- gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4	2006-11-27 09:14:54.000000000 -0800
-+++ gettext.patched/gettext-tools/gnulib-m4/extensions.m4	2011-03-16 23:53:28.487671266 -0700
-@@ -16,43 +16,47 @@
- # ------------------------
- # Enable extensions on systems that normally disable them,
- # typically due to standards-conformance issues.
--AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
--[
--  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
--  AC_BEFORE([$0], [AC_RUN_IFELSE])
--
--  AC_REQUIRE([AC_GNU_SOURCE])
--  AC_REQUIRE([AC_AIX])
--  AC_REQUIRE([AC_MINIX])
--
--  AH_VERBATIM([__EXTENSIONS__],
--[/* Enable extensions on Solaris.  */
--#ifndef __EXTENSIONS__
--# undef __EXTENSIONS__
--#endif
--#ifndef _POSIX_PTHREAD_SEMANTICS
--# undef _POSIX_PTHREAD_SEMANTICS
--#endif
--#ifndef _TANDEM_SOURCE
--# undef _TANDEM_SOURCE
--#endif])
--  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
--    [ac_cv_safe_to_define___extensions__],
--    [AC_COMPILE_IFELSE(
--       [AC_LANG_PROGRAM([
--#	  define __EXTENSIONS__ 1
--	  AC_INCLUDES_DEFAULT])],
--       [ac_cv_safe_to_define___extensions__=yes],
--       [ac_cv_safe_to_define___extensions__=no])])
--  test $ac_cv_safe_to_define___extensions__ = yes &&
--    AC_DEFINE([__EXTENSIONS__])
--  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
--  AC_DEFINE([_TANDEM_SOURCE])
--])
-+#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
-+#[
-+#  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
-+#  AC_BEFORE([$0], [AC_RUN_IFELSE])
-+#
-+#  AC_REQUIRE([AC_GNU_SOURCE])
-+#  AC_REQUIRE([AC_AIX])
-+#  AC_REQUIRE([AC_MINIX])
-+#
-+#  AH_VERBATIM([__EXTENSIONS__],
-+#[/* Enable extensions on Solaris.  */
-+##ifndef __EXTENSIONS__
-+## undef __EXTENSIONS__
-+##endif
-+##ifndef _POSIX_PTHREAD_SEMANTICS
-+## undef _POSIX_PTHREAD_SEMANTICS
-+##endif
-+##ifndef _TANDEM_SOURCE
-+## undef _TANDEM_SOURCE
-+##endif])
-+#  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
-+#    [ac_cv_safe_to_define___extensions__],
-+#    [AC_COMPILE_IFELSE(
-+#       [AC_LANG_PROGRAM([
-+##	  define __EXTENSIONS__ 1
-+#	  AC_INCLUDES_DEFAULT])],
-+#       [ac_cv_safe_to_define___extensions__=yes],
-+#       [ac_cv_safe_to_define___extensions__=no])])
-+#  test $ac_cv_safe_to_define___extensions__ = yes &&
-+#    AC_DEFINE([__EXTENSIONS__])
-+#  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
-+#  AC_DEFINE([_TANDEM_SOURCE])
-+#])
- 
- # gl_USE_SYSTEM_EXTENSIONS
- # ------------------------
- # Enable extensions on systems that normally disable them,
- # typically due to standards-conformance issues.
- AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
--  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
-+[
-+   AC_REQUIRE([AC_GNU_SOURCE])
-+
-+   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-+])
-diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4 gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4
---- gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4	2006-11-27 09:14:54.000000000 -0800
-+++ gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4	2011-03-16 23:52:06.477463671 -0700
-@@ -91,7 +91,7 @@
- AC_DEFUN([gl_FUNC_FNMATCH_GNU],
- [
-   dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
- 
-   FNMATCH_H=
-   _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
-diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4 gettext.patched/gettext-tools/gnulib-m4/getdelim.m4
---- gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4	2006-11-27 09:14:54.000000000 -0800
-+++ gettext.patched/gettext-tools/gnulib-m4/getdelim.m4	2011-03-16 23:52:22.871674845 -0700
-@@ -12,7 +12,7 @@
- [
- 
-   dnl Persuade glibc <stdio.h> to declare getdelim().
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
- 
-   AC_REPLACE_FUNCS(getdelim)
-   AC_CHECK_DECLS_ONCE(getdelim)
-diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4 gettext.patched/gettext-tools/gnulib-m4/getline.m4
---- gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4	2006-11-27 09:14:54.000000000 -0800
-+++ gettext.patched/gettext-tools/gnulib-m4/getline.m4	2011-03-16 23:51:49.829971108 -0700
-@@ -16,7 +16,7 @@
- AC_DEFUN([gl_FUNC_GETLINE],
- [
-   dnl Persuade glibc <stdio.h> to declare getline().
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
- 
-   AC_CHECK_DECLS([getline])
- 
-diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4
---- gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4	2006-11-27 09:33:36.000000000 -0800
-+++ gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4	2011-03-16 23:52:18.970450488 -0700
-@@ -25,7 +25,7 @@
-   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
-   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
-   AC_REQUIRE([AC_PROG_RANLIB])
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
-   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-   AC_REQUIRE([gl_LOCK_EARLY])
- ])
-diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4 gettext.patched/gettext-tools/gnulib-m4/mbchar.m4
---- gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4	2006-11-27 09:14:55.000000000 -0800
-+++ gettext.patched/gettext-tools/gnulib-m4/mbchar.m4	2011-03-16 23:51:40.844410216 -0700
-@@ -9,7 +9,7 @@
- 
- AC_DEFUN([gl_MBCHAR],
- [
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
-   dnl The following line is that so the user can test HAVE_WCHAR_H
-   dnl before #include "mbchar.h".
-   AC_CHECK_HEADERS_ONCE([wchar.h])
-diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4
---- gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4	2006-11-27 09:14:55.000000000 -0800
-+++ gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4	2011-03-16 23:52:14.691396045 -0700
-@@ -7,7 +7,7 @@
- AC_DEFUN([gl_FUNC_STPCPY],
- [
-   dnl Persuade glibc <string.h> to declare stpcpy().
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
- 
-   AC_REPLACE_FUNCS(stpcpy)
-   if test $ac_cv_func_stpcpy = no; then
-diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4
---- gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4	2006-11-27 09:14:55.000000000 -0800
-+++ gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4	2011-03-16 23:52:10.356641459 -0700
-@@ -7,7 +7,7 @@
- AC_DEFUN([gl_FUNC_STPNCPY],
- [
-   dnl Persuade glibc <string.h> to declare stpncpy().
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
- 
-   dnl Both glibc and AIX (4.3.3, 5.1) have an stpncpy() function
-   dnl declared in <string.h>. Its side effects are the same as those
-diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4 gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4
---- gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4	2006-11-27 09:14:55.000000000 -0800
-+++ gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4	2011-03-16 23:51:08.260324221 -0700
-@@ -7,7 +7,7 @@
- AC_DEFUN([gl_FUNC_WCWIDTH],
- [
-   dnl Persuade glibc <wchar.h> to declare wcwidth().
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
- 
-   AC_REQUIRE([AC_C_INLINE])
-   AC_REQUIRE([gt_TYPE_WCHAR_T])
-diff -ru gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4
---- gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4	2006-11-27 09:33:45.000000000 -0800
-+++ gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4	2011-03-16 23:51:02.036061317 -0700
-@@ -25,7 +25,7 @@
-   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
-   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
-   AC_REQUIRE([AC_PROG_RANLIB])
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
-   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-   AC_REQUIRE([gl_LOCK_EARLY])
- ])
-diff -ru gettext-0.16.1/gettext-tools/m4/regex.m4 gettext.patched/gettext-tools/m4/regex.m4
---- gettext-0.16.1/gettext-tools/m4/regex.m4	2006-11-27 09:02:05.000000000 -0800
-+++ gettext.patched/gettext-tools/m4/regex.m4	2011-03-16 23:50:53.533477195 -0700
-@@ -116,7 +116,7 @@
-   dnl to get them.
- 
-   dnl Persuade glibc <string.h> to declare mempcpy().
--  AC_REQUIRE([AC_GNU_SOURCE])
-+  dnl AC_REQUIRE([AC_GNU_SOURCE])
- 
-   AC_REQUIRE([AC_C_RESTRICT])
-   AC_REQUIRE([AC_FUNC_ALLOCA])
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch
deleted file mode 100644
index 072fe5f..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-
-# Pulled from OpenEmbedded
-# 
-# Commented by: Saul Wold <saul.wold@intel.com>
-
-Upstream-Status: Inappropriate [licensing]
-
---- gettext-0.17/autoconf-lib-link/m4/lib-link.m4~	2009-04-17 15:12:30.000000000 -0700
-+++ gettext-0.17/autoconf-lib-link/m4/lib-link.m4	2009-04-17 15:37:39.000000000 -0700
-@@ -267,6 +267,9 @@
-               fi
-             fi
-           fi
-+          dnl Just let the compiler find the library, the compiler and user are smarter then this script
-+          dnl when cross compiling and working with a relocated install.
-+          found_dir=""
-           if test "X$found_dir" = "X"; then
-             for x in $LDFLAGS $LTLIB[]NAME; do
-               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch
deleted file mode 100644
index f09e450..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-
-# Pulled from OpenEmbedded
-# 
-# Commented by: Saul Wold <saul.wold@intel.com>
-
-Upstream-Status: Inappropriate [licensing]
-
-Index: gettext-0.16.1/gettext-runtime/intl/Makefile.in
-===================================================================
---- gettext-0.16.1.orig/gettext-runtime/intl/Makefile.in	2006-11-27 09:02:00.000000000 -0800
-+++ gettext-0.16.1/gettext-runtime/intl/Makefile.in	2011-03-16 16:04:49.175419930 -0700
-@@ -35,7 +35,7 @@
- #    'make' does the wrong thing if GNU gettext was configured with
- #    "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la
- #    files it finds in srcdir = ../../gettext-runtime/intl.
--VPATH = $(srcdir)
-+#VPATH = $(srcdir)
- 
- prefix = @prefix@
- exec_prefix = @exec_prefix@
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch
deleted file mode 100644
index 4da8dd4..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-
-This patch hardcodes in version 0.17 for the GETTEXT_MACRO_VERSION,
-the version check is only part of 0.17 and will not affect any 0.16.1
-operations
-
-Upstream-Status: Inappropriate [licensing]
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-Index: gettext-0.16.1/gettext-runtime/m4/po.m4
-===================================================================
---- gettext-0.16.1.orig/gettext-runtime/m4/po.m4	2011-03-17 02:24:28.953520231 -0700
-+++ gettext-0.16.1/gettext-runtime/m4/po.m4	2011-03-17 02:28:25.455396862 -0700
-@@ -27,6 +27,9 @@
-   AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
-   AC_REQUIRE([AM_NLS])dnl
- 
-+  dnl Hardcode the MACRO_VERSION to 0.17 for gnutls
-+  AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
-+
-   dnl Perform the following tests also if --disable-nls has been given,
-   dnl because they are needed for "make dist" to work.
- 
-Index: gettext-0.16.1/gettext-runtime/po/Makefile.in.in
-===================================================================
---- gettext-0.16.1.orig/gettext-runtime/po/Makefile.in.in	2011-03-17 02:24:28.953520231 -0700
-+++ gettext-0.16.1/gettext-runtime/po/Makefile.in.in	2011-03-17 02:28:07.574395144 -0700
-@@ -10,6 +10,9 @@
- #
- # Origin: gettext-0.16
- 
-+# Hardcode this value for gnutls building against gplv2 code
-+GETTEXT_MACRO_VERSION = 0.17
-+
- PACKAGE = @PACKAGE@
- VERSION = @VERSION@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-Index: gettext-0.16.1/gettext-tools/po/Makefile.in.in
-===================================================================
---- gettext-0.16.1.orig/gettext-tools/po/Makefile.in.in	2011-03-17 02:24:28.953520231 -0700
-+++ gettext-0.16.1/gettext-tools/po/Makefile.in.in	2011-03-17 02:28:07.574395144 -0700
-@@ -10,6 +10,9 @@
- #
- # Origin: gettext-0.16
- 
-+# Hardcode this value for gnutls building against gplv2 code
-+GETTEXT_MACRO_VERSION = 0.17
-+
- PACKAGE = @PACKAGE@
- VERSION = @VERSION@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch
deleted file mode 100644
index d921069..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch
+++ /dev/null
@@ -1,720 +0,0 @@
-
-# Pulled from OpenEmbedded
-# 
-# Commented by: Saul Wold <saul.wold@intel.com>
-
-Upstream-Status: Inappropriate [licensing]
-
-Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4
-===================================================================
---- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4	2006-11-27 09:01:58.000000000 -0800
-+++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4	2011-03-17 00:36:08.710836720 -0700
-@@ -6,12 +6,14 @@
- 
- dnl From Bruno Haible.
- 
--AC_PREREQ(2.50)
-+AC_PREREQ(2.54)
- 
- dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
- dnl the libraries corresponding to explicit and implicit dependencies.
- dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
- dnl augments the CPPFLAGS variable.
-+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
-+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
- AC_DEFUN([AC_LIB_LINKFLAGS],
- [
-   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-@@ -24,13 +26,16 @@
-     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
-     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
-     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
-+    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
-   ])
-   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
-   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
-   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
-+  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
-   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
-   AC_SUBST([LIB]NAME)
-   AC_SUBST([LTLIB]NAME)
-+  AC_SUBST([LIB]NAME[_PREFIX])
-   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
-   dnl results of this search when this library appears as a dependency.
-   HAVE_LIB[]NAME=yes
-@@ -46,6 +51,8 @@
- dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
- dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
- dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
-+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
-+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
- AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
- [
-   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-@@ -82,17 +89,24 @@
-     CPPFLAGS="$ac_save_CPPFLAGS"
-     LIB[]NAME=
-     LTLIB[]NAME=
-+    LIB[]NAME[]_PREFIX=
-+
-   fi
-   AC_SUBST([HAVE_LIB]NAME)
-   AC_SUBST([LIB]NAME)
-   AC_SUBST([LTLIB]NAME)
-+  AC_SUBST([LIB]NAME[_PREFIX])
-   undefine([Name])
-   undefine([NAME])
- ])
- 
- dnl Determine the platform dependent parameters needed to use rpath:
--dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
--dnl hardcode_direct, hardcode_minus_L.
-+dnl   acl_libext,
-+dnl   acl_shlibext,
-+dnl   acl_hardcode_libdir_flag_spec,
-+dnl   acl_hardcode_libdir_separator,
-+dnl   acl_hardcode_direct,
-+dnl   acl_hardcode_minus_L.
- AC_DEFUN([AC_LIB_RPATH],
- [
-   dnl Tell automake >= 1.10 to complain if config.rpath is missing.
-@@ -109,12 +123,14 @@
-     acl_cv_rpath=done
-   ])
-   wl="$acl_cv_wl"
--  libext="$acl_cv_libext"
--  shlibext="$acl_cv_shlibext"
--  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
--  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
--  hardcode_direct="$acl_cv_hardcode_direct"
--  hardcode_minus_L="$acl_cv_hardcode_minus_L"
-+  acl_libext="$acl_cv_libext"
-+  acl_shlibext="$acl_cv_shlibext"
-+  acl_libname_spec="$acl_cv_libname_spec"
-+  acl_library_names_spec="$acl_cv_library_names_spec"
-+  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-+  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-+  acl_hardcode_direct="$acl_cv_hardcode_direct"
-+  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
-   dnl Determine whether the user wants rpath handling at all.
-   AC_ARG_ENABLE(rpath,
-     [  --disable-rpath         do not hardcode runtime library paths],
-@@ -124,20 +140,24 @@
- dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
- dnl the libraries corresponding to explicit and implicit dependencies.
- dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
-+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
-+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
- AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
- [
-   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
-   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-+  dnl Autoconf >= 2.61 supports dots in --with options.
-+  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
-   dnl By default, look in $includedir and $libdir.
-   use_additional=yes
-   AC_LIB_WITH_FINAL_PREFIX([
-     eval additional_includedir=\"$includedir\"
-     eval additional_libdir=\"$libdir\"
-   ])
--  AC_LIB_ARG_WITH([lib$1-prefix],
--[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
--  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
-+  AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
-+[  --with-lib]N_A_M_E[-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
-+  --without-lib]N_A_M_E[-prefix     don't search for lib$1 in includedir and libdir],
- [
-     if test "X$withval" = "Xno"; then
-       use_additional=no
-@@ -158,6 +178,7 @@
-   LIB[]NAME=
-   LTLIB[]NAME=
-   INC[]NAME=
-+  LIB[]NAME[]_PREFIX=
-   rpathdirs=
-   ltrpathdirs=
-   names_already_handled=
-@@ -197,27 +218,53 @@
-           found_la=
-           found_so=
-           found_a=
-+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
-+          if test -n "$acl_shlibext"; then
-+            shrext=".$acl_shlibext"             # typically: shrext=.so
-+          else
-+            shrext=
-+          fi
-           if test $use_additional = yes; then
--            if test -n "$shlibext" \
--               && { test -f "$additional_libdir/lib$name.$shlibext" \
--                    || { test "$shlibext" = dll \
--                         && test -f "$additional_libdir/lib$name.dll.a"; }; }; then
--              found_dir="$additional_libdir"
--              if test -f "$additional_libdir/lib$name.$shlibext"; then
--                found_so="$additional_libdir/lib$name.$shlibext"
-+            dir="$additional_libdir"
-+            dnl The same code as in the loop below:
-+            dnl First look for a shared library.
-+            if test -n "$acl_shlibext"; then
-+              if test -f "$dir/$libname$shrext"; then
-+                found_dir="$dir"
-+                found_so="$dir/$libname$shrext"
-               else
--                found_so="$additional_libdir/lib$name.dll.a"
-+                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-+                  ver=`(cd "$dir" && \
-+                        for f in "$libname$shrext".*; do echo "$f"; done \
-+                        | sed -e "s,^$libname$shrext\\\\.,," \
-+                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-+                        | sed 1q ) 2>/dev/null`
-+                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-+                    found_dir="$dir"
-+                    found_so="$dir/$libname$shrext.$ver"
-+                  fi
-+                else
-+                  eval library_names=\"$acl_library_names_spec\"
-+                  for f in $library_names; do
-+                    if test -f "$dir/$f"; then
-+                      found_dir="$dir"
-+                      found_so="$dir/$f"
-+                      break
-+                    fi
-+                  done
-+                fi
-               fi
--              if test -f "$additional_libdir/lib$name.la"; then
--                found_la="$additional_libdir/lib$name.la"
-+            fi
-+            dnl Then look for a static library.
-+            if test "X$found_dir" = "X"; then
-+              if test -f "$dir/$libname.$acl_libext"; then
-+                found_dir="$dir"
-+                found_a="$dir/$libname.$acl_libext"
-               fi
--            else
--              if test -f "$additional_libdir/lib$name.$libext"; then
--                found_dir="$additional_libdir"
--                found_a="$additional_libdir/lib$name.$libext"
--                if test -f "$additional_libdir/lib$name.la"; then
--                  found_la="$additional_libdir/lib$name.la"
--                fi
-+            fi
-+            if test "X$found_dir" != "X"; then
-+              if test -f "$dir/$libname.la"; then
-+                found_la="$dir/$libname.la"
-               fi
-             fi
-           fi
-@@ -227,26 +274,44 @@
-               case "$x" in
-                 -L*)
-                   dir=`echo "X$x" | sed -e 's/^X-L//'`
--                  if test -n "$shlibext" \
--                     && { test -f "$dir/lib$name.$shlibext" \
--                          || { test "$shlibext" = dll \
--                               && test -f "$dir/lib$name.dll.a"; }; }; then
--                    found_dir="$dir"
--                    if test -f "$dir/lib$name.$shlibext"; then
--                      found_so="$dir/lib$name.$shlibext"
-+                  dnl First look for a shared library.
-+                  if test -n "$acl_shlibext"; then
-+                    if test -f "$dir/$libname$shrext"; then
-+                      found_dir="$dir"
-+                      found_so="$dir/$libname$shrext"
-                     else
--                      found_so="$dir/lib$name.dll.a"
--                    fi
--                    if test -f "$dir/lib$name.la"; then
--                      found_la="$dir/lib$name.la"
-+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-+                        ver=`(cd "$dir" && \
-+                              for f in "$libname$shrext".*; do echo "$f"; done \
-+                              | sed -e "s,^$libname$shrext\\\\.,," \
-+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-+                              | sed 1q ) 2>/dev/null`
-+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-+                          found_dir="$dir"
-+                          found_so="$dir/$libname$shrext.$ver"
-+                        fi
-+                      else
-+                        eval library_names=\"$acl_library_names_spec\"
-+                        for f in $library_names; do
-+                          if test -f "$dir/$f"; then
-+                            found_dir="$dir"
-+                            found_so="$dir/$f"
-+                            break
-+                          fi
-+                        done
-+                      fi
-                     fi
--                  else
--                    if test -f "$dir/lib$name.$libext"; then
-+                  fi
-+                  dnl Then look for a static library.
-+                  if test "X$found_dir" = "X"; then
-+                    if test -f "$dir/$libname.$acl_libext"; then
-                       found_dir="$dir"
--                      found_a="$dir/lib$name.$libext"
--                      if test -f "$dir/lib$name.la"; then
--                        found_la="$dir/lib$name.la"
--                      fi
-+                      found_a="$dir/$libname.$acl_libext"
-+                    fi
-+                  fi
-+                  if test "X$found_dir" != "X"; then
-+                    if test -f "$dir/$libname.la"; then
-+                      found_la="$dir/$libname.la"
-                     fi
-                   fi
-                   ;;
-@@ -282,12 +347,12 @@
-                   ltrpathdirs="$ltrpathdirs $found_dir"
-                 fi
-                 dnl The hardcoding into $LIBNAME is system dependent.
--                if test "$hardcode_direct" = yes; then
-+                if test "$acl_hardcode_direct" = yes; then
-                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
-                   dnl resulting binary.
-                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                 else
--                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
-+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
-                     dnl Use an explicit option to hardcode DIR into the resulting
-                     dnl binary.
-                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-@@ -318,13 +383,13 @@
-                     if test -z "$haveit"; then
-                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
-                     fi
--                    if test "$hardcode_minus_L" != no; then
-+                    if test "$acl_hardcode_minus_L" != no; then
-                       dnl FIXME: Not sure whether we should use
-                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-                       dnl here.
-                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                     else
--                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
-+                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
-                       dnl here, because this doesn't fit in flags passed to the
-                       dnl compiler. So give up. No hardcoding. This affects only
-                       dnl very old systems.
-@@ -512,18 +577,18 @@
-     done
-   done
-   if test "X$rpathdirs" != "X"; then
--    if test -n "$hardcode_libdir_separator"; then
-+    if test -n "$acl_hardcode_libdir_separator"; then
-       dnl Weird platform: only the last -rpath option counts, the user must
-       dnl pass all path elements in one option. We can arrange that for a
-       dnl single library, but not when more than one $LIBNAMEs are used.
-       alldirs=
-       for found_dir in $rpathdirs; do
--        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
-+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
-       done
--      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
-+      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
-       acl_save_libdir="$libdir"
-       libdir="$alldirs"
--      eval flag=\"$hardcode_libdir_flag_spec\"
-+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
-       libdir="$acl_save_libdir"
-       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
-     else
-@@ -531,7 +596,7 @@
-       for found_dir in $rpathdirs; do
-         acl_save_libdir="$libdir"
-         libdir="$found_dir"
--        eval flag=\"$hardcode_libdir_flag_spec\"
-+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
-         libdir="$acl_save_libdir"
-         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
-       done
-@@ -642,3 +707,79 @@
-   fi
-   AC_SUBST([$1])
- ])
-+
-+dnl For those cases where a variable contains several -L and -l options
-+dnl referring to unknown libraries and directories, this macro determines the
-+dnl necessary additional linker options for the runtime path.
-+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
-+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
-+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
-+dnl otherwise linking without libtool is assumed.
-+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
-+[
-+  AC_REQUIRE([AC_LIB_RPATH])
-+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
-+  $1=
-+  if test "$enable_rpath" != no; then
-+    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
-+      dnl Use an explicit option to hardcode directories into the resulting
-+      dnl binary.
-+      rpathdirs=
-+      next=
-+      for opt in $2; do
-+        if test -n "$next"; then
-+          dir="$next"
-+          dnl No need to hardcode the standard /usr/lib.
-+          if test "X$dir" != "X/usr/$acl_libdirstem"; then
-+            rpathdirs="$rpathdirs $dir"
-+          fi
-+          next=
-+        else
-+          case $opt in
-+            -L) next=yes ;;
-+            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
-+                 dnl No need to hardcode the standard /usr/lib.
-+                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
-+                   rpathdirs="$rpathdirs $dir"
-+                 fi
-+                 next= ;;
-+            *) next= ;;
-+          esac
-+        fi
-+      done
-+      if test "X$rpathdirs" != "X"; then
-+        if test -n ""$3""; then
-+          dnl libtool is used for linking. Use -R options.
-+          for dir in $rpathdirs; do
-+            $1="${$1}${$1:+ }-R$dir"
-+          done
-+        else
-+          dnl The linker is used for linking directly.
-+          if test -n "$acl_hardcode_libdir_separator"; then
-+            dnl Weird platform: only the last -rpath option counts, the user
-+            dnl must pass all path elements in one option.
-+            alldirs=
-+            for dir in $rpathdirs; do
-+              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
-+            done
-+            acl_save_libdir="$libdir"
-+            libdir="$alldirs"
-+            eval flag=\"$acl_hardcode_libdir_flag_spec\"
-+            libdir="$acl_save_libdir"
-+            $1="$flag"
-+          else
-+            dnl The -rpath options are cumulative.
-+            for dir in $rpathdirs; do
-+              acl_save_libdir="$libdir"
-+              libdir="$dir"
-+              eval flag=\"$acl_hardcode_libdir_flag_spec\"
-+              libdir="$acl_save_libdir"
-+              $1="${$1}${$1:+ }$flag"
-+            done
-+          fi
-+        fi
-+      fi
-+    fi
-+  fi
-+  AC_SUBST([$1])
-+])
-Index: gettext-0.16.1/autoconf-lib-link/config.rpath
-===================================================================
---- gettext-0.16.1.orig/autoconf-lib-link/config.rpath	2006-11-27 09:01:58.000000000 -0800
-+++ gettext-0.16.1/autoconf-lib-link/config.rpath	2011-03-17 00:33:23.336539490 -0700
-@@ -2,7 +2,7 @@
- # Output a system dependent set of variables, describing how to set the
- # run time search path of shared libraries in an executable.
- #
--#   Copyright 1996-2006 Free Software Foundation, Inc.
-+#   Copyright 1996-2007 Free Software Foundation, Inc.
- #   Taken from GNU libtool, 2001
- #   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
- #
-@@ -47,6 +47,18 @@
- done
- cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
- 
-+# Code taken from libtool.m4's _LT_CC_BASENAME.
-+
-+for cc_temp in $CC""; do
-+  case $cc_temp in
-+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-+    \-*) ;;
-+    *) break;;
-+  esac
-+done
-+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
-+
- # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
- 
- wl=
-@@ -64,7 +76,14 @@
-           ;;
-       esac
-       ;;
--    mingw* | pw32* | os2*)
-+    darwin*)
-+      case $cc_basename in
-+        xlc*)
-+          wl='-Wl,'
-+          ;;
-+      esac
-+      ;;
-+    mingw* | cygwin* | pw32* | os2*)
-       ;;
-     hpux9* | hpux10* | hpux11*)
-       wl='-Wl,'
-@@ -74,7 +93,7 @@
-       ;;
-     newsos6)
-       ;;
--    linux*)
-+    linux* | k*bsd*-gnu)
-       case $cc_basename in
-         icc* | ecc*)
-           wl='-Wl,'
-@@ -100,7 +119,7 @@
-     osf3* | osf4* | osf5*)
-       wl='-Wl,'
-       ;;
--    sco3.2v5*)
-+    rdos*)
-       ;;
-     solaris*)
-       wl='-Wl,'
-@@ -108,11 +127,14 @@
-     sunos4*)
-       wl='-Qoption ld '
-       ;;
--    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-+    sysv4 | sysv4.2uw2* | sysv4.3*)
-       wl='-Wl,'
-       ;;
-     sysv4*MP*)
-       ;;
-+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-+      wl='-Wl,'
-+      ;;
-     unicos*)
-       wl='-Wl,'
-       ;;
-@@ -141,6 +163,10 @@
-     # we just hope/assume this is gcc and not c89 (= MSVC++)
-     with_gnu_ld=yes
-     ;;
-+  interix*)
-+    # we just hope/assume this is gcc and not c89 (= MSVC++)
-+    with_gnu_ld=yes
-+    ;;
-   openbsd*)
-     with_gnu_ld=no
-     ;;
-@@ -189,11 +215,11 @@
-         ld_shlibs=no
-       fi
-       ;;
--    interix3*)
-+    interix[3-9]*)
-       hardcode_direct=no
-       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-       ;;
--    linux*)
-+    gnu* | linux* | k*bsd*-gnu)
-       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-         :
-       else
-@@ -280,7 +306,7 @@
-             strings "$collect2name" | grep resolve_lib_name >/dev/null
-           then
-             # We have reworked collect2
--            hardcode_direct=yes
-+            :
-           else
-             # We have old collect2
-             hardcode_direct=unsupported
-@@ -359,7 +385,7 @@
-       hardcode_direct=yes
-       hardcode_minus_L=yes
-       ;;
--    freebsd* | kfreebsd*-gnu | dragonfly*)
-+    freebsd* | dragonfly*)
-       hardcode_libdir_flag_spec='-R$libdir'
-       hardcode_direct=yes
-       ;;
-@@ -412,18 +438,22 @@
-       hardcode_libdir_separator=:
-       ;;
-     openbsd*)
--      hardcode_direct=yes
--      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
--        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-+      if test -f /usr/libexec/ld.so; then
-+        hardcode_direct=yes
-+        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-+          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-+        else
-+          case "$host_os" in
-+            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-+              hardcode_libdir_flag_spec='-R$libdir'
-+              ;;
-+            *)
-+              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-+              ;;
-+          esac
-+        fi
-       else
--        case "$host_os" in
--          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
--            hardcode_libdir_flag_spec='-R$libdir'
--            ;;
--          *)
--            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
--            ;;
--        esac
-+        ld_shlibs=no
-       fi
-       ;;
-     os2*)
-@@ -471,7 +501,7 @@
-         ld_shlibs=yes
-       fi
-       ;;
--    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
-+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* |sco3.2v5.0.[024]*)
-       ;;
-     sysv5* | sco3.2v5* | sco5v6*)
-       hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-@@ -488,33 +518,51 @@
- 
- # Check dynamic linker characteristics
- # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
-+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
-+# only about the one the linker finds when passed -lNAME. This is the last
-+# element of library_names_spec in libtool.m4, or possibly two of them if the
-+# linker has special search rules.
-+library_names_spec=      # the last element of library_names_spec in libtool.m4
- libname_spec='lib$name'
- case "$host_os" in
-   aix3*)
-+    library_names_spec='$libname.a'
-     ;;
-   aix4* | aix5*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   amigaos*)
-+    library_names_spec='$libname.a'
-     ;;
-   beos*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   bsdi[45]*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   cygwin* | mingw* | pw32*)
-     shrext=.dll
-+    library_names_spec='$libname.dll.a $libname.lib'
-     ;;
-   darwin* | rhapsody*)
-     shrext=.dylib
-+    library_names_spec='$libname$shrext'
-     ;;
-   dgux*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   freebsd1*)
-     ;;
--  kfreebsd*-gnu)
--    ;;
-   freebsd* | dragonfly*)
-+    case "$host_os" in
-+      freebsd[123]*)
-+        library_names_spec='$libname$shrext$versuffix' ;;
-+      *)
-+        library_names_spec='$libname$shrext' ;;
-+    esac
-     ;;
-   gnu*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   hpux9* | hpux10* | hpux11*)
-     case $host_cpu in
-@@ -528,10 +576,13 @@
-         shrext=.sl
-         ;;
-     esac
-+    library_names_spec='$libname$shrext'
-     ;;
--  interix3*)
-+  interix[3-9]*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   irix5* | irix6* | nonstopux*)
-+    library_names_spec='$libname$shrext'
-     case "$host_os" in
-       irix5* | nonstopux*)
-         libsuff= shlibsuff=
-@@ -548,33 +599,46 @@
-     ;;
-   linux*oldld* | linux*aout* | linux*coff*)
-     ;;
--  linux*)
-+  linux* | k*bsd*-gnu)
-+    library_names_spec='$libname$shrext'
-     ;;
-   knetbsd*-gnu)
-+    library_names_spec='$libname$shrext'
-     ;;
-   netbsd*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   newsos6)
-+    library_names_spec='$libname$shrext'
-     ;;
-   nto-qnx*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   openbsd*)
-+    library_names_spec='$libname$shrext$versuffix'
-     ;;
-   os2*)
-     libname_spec='$name'
-     shrext=.dll
-+    library_names_spec='$libname.a'
-     ;;
-   osf3* | osf4* | osf5*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   solaris*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   sunos4*)
-+    library_names_spec='$libname$shrext$versuffix'
-     ;;
-   sysv4 | sysv4.3*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   sysv4*MP*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-+    library_names_spec='$libname$shrext'
-     ;;
-   uts4*)
-     ;;
-@@ -583,6 +647,8 @@
- sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
- escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
- shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
-+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
- escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
- 
- LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
-@@ -596,6 +662,12 @@
- # Shared library suffix (normally "so").
- shlibext="$shlibext"
- 
-+# Format of library name prefix.
-+libname_spec="$escaped_libname_spec"
-+
-+# Library names that the linker finds when passed -lNAME.
-+library_names_spec="$escaped_library_names_spec"
-+
- # Flag to hardcode \$libdir into a binary during linking.
- # This must work even if \$libdir does not exist.
- hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch
new file mode 100644
index 0000000..6af1604
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch
@@ -0,0 +1,87 @@
+From e546de65a333789e83f5485757967cee29ee3681 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 19 Feb 2017 23:32:46 -0800
+Subject: [PATCH] cr-statement.c/timsort.h: fix formatting issues
+
+Fixed when compile with "-Wformat -Wformat-security -Werror=format-security":
+| gettext-tools/gnulib-lib/libcroco/cr-statement.c: In function 'cr_statement_dump_charset':
+| gettext-tools/gnulib-lib/libcroco/cr-statement.c:2661:17: error: format not a string literal and no format arguments [-Werror=format-security]
+|                  fprintf (a_fp, str) ;
+
+And:
+gettext-tools/gnulib-lib/libxml/timsort.h:326:80: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
+       fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size);
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ gettext-tools/gnulib-lib/libcroco/cr-statement.c | 10 +++++-----
+ gettext-tools/gnulib-lib/libxml/timsort.h        |  2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/gettext-tools/gnulib-lib/libcroco/cr-statement.c b/gettext-tools/gnulib-lib/libcroco/cr-statement.c
+index 617520f..100104b 100644
+--- a/gettext-tools/gnulib-lib/libcroco/cr-statement.c
++++ b/gettext-tools/gnulib-lib/libcroco/cr-statement.c
+@@ -2607,7 +2607,7 @@ cr_statement_dump_ruleset (CRStatement * a_this, FILE * a_fp, glong a_indent)
+         g_return_if_fail (a_fp && a_this);
+         str = cr_statement_ruleset_to_string (a_this, a_indent);
+         if (str) {
+-                fprintf (a_fp, str);
++                fprintf (a_fp, "%s", str);
+                 g_free (str);
+                 str = NULL;
+         }
+@@ -2658,7 +2658,7 @@ cr_statement_dump_charset (CRStatement * a_this, FILE * a_fp, gulong a_indent)
+         str = cr_statement_charset_to_string (a_this,
+                                               a_indent) ;
+         if (str) {
+-                fprintf (a_fp, str) ;
++                fprintf (a_fp, "%s", str) ;
+                 g_free (str) ;
+                 str = NULL ;
+         }
+@@ -2685,7 +2685,7 @@ cr_statement_dump_page (CRStatement * a_this, FILE * a_fp, gulong a_indent)
+ 
+         str = cr_statement_at_page_rule_to_string (a_this, a_indent) ;
+         if (str) {
+-                fprintf (a_fp, str);
++                fprintf (a_fp, "%s", str);
+                 g_free (str) ;
+                 str = NULL ; 
+         }
+@@ -2711,7 +2711,7 @@ cr_statement_dump_media_rule (CRStatement * a_this,
+ 
+         str = cr_statement_media_rule_to_string (a_this, a_indent) ;
+         if (str) {
+-                fprintf (a_fp, str) ;
++                fprintf (a_fp, "%s", str) ;
+                 g_free (str) ;
+                 str = NULL ;
+         }
+@@ -2737,7 +2737,7 @@ cr_statement_dump_import_rule (CRStatement * a_this, FILE * a_fp,
+ 
+         str = cr_statement_import_rule_to_string (a_this, a_indent) ;
+         if (str) {
+-                fprintf (a_fp, str) ;
++                fprintf (a_fp, "%s", str) ;
+                 g_free (str) ;
+                 str = NULL ;
+         }
+diff --git a/gettext-tools/gnulib-lib/libxml/timsort.h b/gettext-tools/gnulib-lib/libxml/timsort.h
+index 795f272..443918a 100644
+--- a/gettext-tools/gnulib-lib/libxml/timsort.h
++++ b/gettext-tools/gnulib-lib/libxml/timsort.h
+@@ -323,7 +323,7 @@ static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size)
+     SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
+     if (tempstore == NULL)
+     {
+-      fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size);
++      fprintf(stderr, "Error allocating temporary storage for tim sort: need %zu bytes", sizeof(SORT_TYPE) * new_size);
+       exit(1);
+     }
+     store->storage = tempstore;
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.16.1.bb b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.16.1.bb
deleted file mode 100644
index e79f4da..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.16.1.bb
+++ /dev/null
@@ -1,124 +0,0 @@
-SUMMARY = "Utilities and libraries for producing multi-lingual messages"
-DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
-HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html"
-SECTION = "libs"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=9ea3144f04c41cd2eada5d3f472e6ea5"
-
-PR = "r6"
-DEPENDS = "virtual/libiconv"
-DEPENDS_class-native = ""
-PROVIDES = "virtual/libintl virtual/gettext"
-PROVIDES_class-native = "virtual/gettext-native"
-
-SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
-           file://gettext-vpath.patch \
-           file://linklib_from_0.17.patch \
-	   file://gettext-autoconf-lib-link-no-L.patch \
-           file://disable_java.patch \
-           file://fix_aclocal_version.patch \
-           file://fix_gnu_source_circular.patch \
-           file://hardcode_macro_version.patch \
-          "
-
-SRC_URI[md5sum] = "3d9ad24301c6d6b17ec30704a13fe127"
-SRC_URI[sha256sum] = "0bf850d1a079fb5a61f0a47b1a9efd35eb44032255375e1cedb0253bc27b376d"
-
-PARALLEL_MAKE = ""
-
-LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread "
-
-inherit autotools texinfo
-
-EXTRA_OECONF += "--without-lispdir \
-                 --disable-csharp \
-                 --disable-libasprintf \
-                 --disable-java \
-                 --disable-native-java \
-                 --disable-openmp \
-                 --without-emacs \
-                "
-EXTRA_OECONF_append_libc-musl = "\
-                                 gt_cv_func_gnugettext1_libc=yes \
-                                 gt_cv_func_gnugettext2_libc=yes \
-                                "
-
-acpaths = '-I ${S}/autoconf-lib-link/m4/ \
-           -I ${S}/gettext-runtime/m4 \
-           -I ${S}/gettext-tools/m4'
-
-do_configure_prepend() {
-	rm -f ${S}/config/m4/libtool.m4
-}
-
-do_install_append_libc-musl () {
-	rm -f ${D}${libdir}/charset.alias
-}
-
-# these lack the .x behind the .so, but shouldn't be in the -dev package
-# Otherwise you get the following results:
-# 7.4M    glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
-# 25M     uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
-# because gettext depends on gettext-dev, which pulls in more -dev packages:
-# 15228   KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk
-# 1300    KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk
-# 140     KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk
-# 4       KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk
-
-PACKAGES =+ "libgettextlib libgettextsrc"
-FILES_libgettextlib = "${libdir}/libgettextlib-*.so*"
-FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*"
-
-PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-staticdev gettext-runtime-doc"
-
-FILES_${PN} += "${libdir}/${BPN}/*"
-
-FILES_gettext-runtime = "${bindir}/gettext \
-                         ${bindir}/ngettext \
-                         ${bindir}/envsubst \
-                         ${bindir}/gettext.sh \
-                         ${libdir}/libasprintf${SODEV} \
-                         ${libdir}/GNU.Gettext.dll \
-                        "
-FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \
-                                             ${libdir}/charset.alias \
-                                           "
-FILES_gettext-runtime-staticdev += "${libdir}/libasprintf.a"
-FILES_gettext-runtime-dev += "${includedir}/autosprintf.h \
-                              ${libdir}/libasprintf${SOLIBDEV}"
-FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \
-                                                 ${includedir}/libintl.h \
-                                               "
-FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
-                             ${mandir}/man1/ngettext.* \
-                             ${mandir}/man1/envsubst.* \
-                             ${mandir}/man1/.* \
-                             ${mandir}/man3/* \
-                             ${docdir}/gettext/gettext.* \
-                             ${docdir}/gettext/ngettext.* \
-                             ${docdir}/gettext/envsubst.* \
-                             ${docdir}/gettext/*.3.html \
-                             ${datadir}/gettext/ABOUT-NLS \
-                             ${docdir}/gettext/csharpdoc/* \
-                             ${docdir}/libasprintf/autosprintf.html \
-                             ${infodir}/autosprintf.info \
-                            "
-
-do_install_append() {
-    rm -f ${D}${libdir}/preloadable_libintl.so
-}
-
-do_install_append_class-native () {
-	rm ${D}${datadir}/aclocal/*
-	rm ${D}${datadir}/gettext/config.rpath
-	rm ${D}${datadir}/gettext/po/Makefile.in.in
-	rm ${D}${datadir}/gettext/po/remove-potcdate.sin
-}
-
-# Anyone inheriting gettext will have both gettext-native and gettext
-# available, and we don't want to use older macros from the target gettext in
-# a non-gplv3 build, so kill them and let dependent recipes rely on
-# gettext-native.
-SYSROOT_DIRS_BLACKLIST += "${datadir}/aclocal"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb
index 7b8c1e8..83edffe 100644
--- a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb
@@ -1,5 +1,8 @@
 SUMMARY = "Utilities and libraries for producing multi-lingual messages"
-DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
+DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. \
+These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file \
+naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and \
+a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
 HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html"
 SECTION = "libs"
 LICENSE = "GPLv3+ & LGPL-2.1+"
@@ -13,6 +16,7 @@
 SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
 	   file://parallel.patch \
 	   file://add-with-bisonlocaledir.patch \
+	   file://cr-statement.c-timsort.h-fix-formatting-issues.patch \
 "
 
 SRC_URI[md5sum] = "97e034cf8ce5ba73a28ff6c3c0638092"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Test-for-pthread_getname_np-before-using-it.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Test-for-pthread_getname_np-before-using-it.patch
new file mode 100644
index 0000000..c6e4966
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Test-for-pthread_getname_np-before-using-it.patch
@@ -0,0 +1,70 @@
+From f627fe16099a2b08d8b4e9023ae6b4f352451967 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 6 Nov 2016 08:59:08 -0800
+Subject: [PATCH] Test for pthread_getname_np before using it
+
+Its a GNU extention and not all libc implement it
+musl e.g. implements the setname API but not getname
+in any case, it seems to be safer to check for the
+function before using it.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ config.h.in         |  3 +++
+ configure.ac        | 10 ++++++++++
+ glib/tests/thread.c |  2 +-
+ 3 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/config.h.in b/config.h.in
+index 2c35ff1..da7ac30 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -326,6 +326,9 @@
+ #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP
+ 
+ /* Have function pthread_setname_np(const char*) */
++#undef HAVE_PTHREAD_GETNAME_NP
++
++/* Have function pthread_setname_np(const char*) */
+ #undef HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID
+ 
+ /* Have function pthread_setname_np(pthread_t, const char*) */
+diff --git a/configure.ac b/configure.ac
+index 4309671..209770a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2121,6 +2121,16 @@ AS_IF([ test x"$have_threads" = xposix], [
+              AC_DEFINE(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP,1,
+                 [Have function pthread_cond_timedwait_relative_np])],
+             [AC_MSG_RESULT(no)])
++        dnl gets thread names
++        AC_MSG_CHECKING(for pthread_getname_np(pthread_t, char*, size_t))
++        AC_LINK_IFELSE(
++            [AC_LANG_PROGRAM(
++                [#include <pthread.h>],
++                [pthread_getname_np(pthread_self(),"example",0)])],
++            [AC_MSG_RESULT(yes)
++             AC_DEFINE(HAVE_PTHREAD_GETNAME_NP,1,
++                [Have function pthread_setname_np(const char*)])],
++            [AC_MSG_RESULT(no)])
+         dnl Sets thread names on OS X 10.6, iOS 3.2 (and higher)
+         AC_MSG_CHECKING(for pthread_setname_np(const char*))
+         AC_LINK_IFELSE(
+diff --git a/glib/tests/thread.c b/glib/tests/thread.c
+index 5447836..2f248a6 100644
+--- a/glib/tests/thread.c
++++ b/glib/tests/thread.c
+@@ -174,7 +174,7 @@ test_thread5 (void)
+ static gpointer
+ thread6_func (gpointer data)
+ {
+-#ifdef HAVE_PTHREAD_SETNAME_NP_WITH_TID
++#if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) && defined(HAVE_PTHREAD_GETNAME_NP)
+   char name[16];
+ 
+   pthread_getname_np (pthread_self(), name, 16);
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0002-tests-Ignore-y2k-warnings.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0002-tests-Ignore-y2k-warnings.patch
deleted file mode 100644
index f61fa0a..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0002-tests-Ignore-y2k-warnings.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From b06b22fecc7deda8c65e28670562ca2371e4e725 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 16 Apr 2016 13:43:54 -0700
-Subject: [PATCH 2/2] tests: Ignore y2k warnings
-
-silences
-| ../../../../../../../../workspace/sources/glib-2.0/glib/tests/gdatetime.c: In function 'test_strftime':
-| ../../../../../../../../workspace/sources/glib-2.0/glib/tests/gdatetime.c:1338:3: error: '%c' yields only last 2 digits of year in some locales [-Werror=format-y2k]
-|    "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M "
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Submitted
-
- glib/tests/gdatetime.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
-index 16a163c..e6062fc 100644
---- a/glib/tests/gdatetime.c
-+++ b/glib/tests/gdatetime.c
-@@ -1326,6 +1326,9 @@ test_z (void)
-   g_time_zone_unref (tz);
- }
- 
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wformat-y2k"
-+
- static void
- test_strftime (void)
- {
-@@ -1351,6 +1354,7 @@ test_strftime (void)
-     }
- #endif
- }
-+#pragma GCC diagnostic pop
- 
- static void
- test_find_interval (void)
--- 
-2.8.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/gi-exclude.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/gi-exclude.patch
deleted file mode 100644
index dc62b92..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/gi-exclude.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-The autoptr types should be excluded from gobject-introspection parsing as
-they're not user-facing.
-
-Upstream-Status: Submitted
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-diff --git a/gio/gio-autocleanups.h b/gio/gio-autocleanups.h
-index a95ba65..24ccc2d 100644
---- a/gio/gio-autocleanups.h
-+++ b/gio/gio-autocleanups.h
-@@ -21,6 +21,8 @@
- #error "Only <gio/gio.h> can be included directly."
- #endif
- 
-+#ifndef __GI_SCANNER__
-+
- G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAction, g_object_unref)
- G_DEFINE_AUTOPTR_CLEANUP_FUNC(GActionMap, g_object_unref)
- G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAppInfo, g_object_unref)
-@@ -146,3 +148,5 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVolume, g_object_unref)
- G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVolumeMonitor, g_object_unref)
- G_DEFINE_AUTOPTR_CLEANUP_FUNC(GZlibCompressor, g_object_unref)
- G_DEFINE_AUTOPTR_CLEANUP_FUNC(GZlibDecompressor, g_object_unref)
-+
-+#endif
-diff --git a/glib/glib-autocleanups.h b/glib/glib-autocleanups.h
-index 6355f75..09d28be 100644
---- a/glib/glib-autocleanups.h
-+++ b/glib/glib-autocleanups.h
-@@ -21,6 +21,8 @@
- #error "Only <glib.h> can be included directly."
- #endif
- 
-+#ifndef __GI_SCANNER__
-+
- static inline void
- g_autoptr_cleanup_generic_gfree (void *p)
- {
-@@ -87,3 +89,5 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantDict, g_variant_dict_unref)
- G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantDict, g_variant_dict_clear)
- G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantType, g_variant_type_free)
- G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL)
-+
-+#endif
-diff --git a/gobject/gobject-autocleanups.h b/gobject/gobject-autocleanups.h
-index 980203f..a1d4ba1 100644
---- a/gobject/gobject-autocleanups.h
-+++ b/gobject/gobject-autocleanups.h
-@@ -21,6 +21,10 @@
- #error "Only <glib-object.h> can be included directly."
- #endif
- 
-+#ifndef __GI_SCANNER__
-+
- G_DEFINE_AUTOPTR_CLEANUP_FUNC(GObject, g_object_unref)
- G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInitiallyUnowned, g_object_unref)
- G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GValue, g_value_unset)
-+
-+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0_2.48.2.bb b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0_2.48.2.bb
deleted file mode 100644
index a45f644..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0_2.48.2.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-require glib.inc
-
-PE = "1"
-
-SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
-
-SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
-           file://configure-libtool.patch \
-           file://fix-conflicting-rand.patch \
-           file://run-ptest \
-           file://ptest-paths.patch \
-           file://uclibc_musl_translation.patch \
-           file://allow-run-media-sdX-drive-mount-if-username-root.patch \
-           file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \
-           file://Enable-more-tests-while-cross-compiling.patch \
-           file://gi-exclude.patch \
-           file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \
-           file://0001-Do-not-ignore-return-value-of-write.patch \
-           file://0002-tests-Ignore-y2k-warnings.patch \
-           "
-
-SRC_URI_append_class-native = " file://glib-gettextize-dir.patch \
-                                file://relocate-modules.patch"
-
-SRC_URI[md5sum] = "f4ac1aa2efd4f5798c37625ea697ac57"
-SRC_URI[sha256sum] = "f25e751589cb1a58826eac24fbd4186cda4518af772806b666a3f91f66e6d3f4"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0_2.50.3.bb b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0_2.50.3.bb
new file mode 100644
index 0000000..22ea347
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0_2.50.3.bb
@@ -0,0 +1,25 @@
+require glib.inc
+
+PE = "1"
+
+SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
+           file://configure-libtool.patch \
+           file://fix-conflicting-rand.patch \
+           file://run-ptest \
+           file://ptest-paths.patch \
+           file://uclibc_musl_translation.patch \
+           file://allow-run-media-sdX-drive-mount-if-username-root.patch \
+           file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \
+           file://Enable-more-tests-while-cross-compiling.patch \
+           file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \
+           file://0001-Do-not-ignore-return-value-of-write.patch \
+           file://0001-Test-for-pthread_getname_np-before-using-it.patch \
+           "
+
+SRC_URI_append_class-native = " file://glib-gettextize-dir.patch \
+                                file://relocate-modules.patch"
+
+SRC_URI[md5sum] = "381ab22934f296750d036aa55a397ded"
+SRC_URI[sha256sum] = "82ee94bf4c01459b6b00cb9db0545c2237921e3060c0b74cff13fbc020cfd999"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib.inc b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib.inc
index 906e0d4..2b30e37 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib.inc
@@ -15,6 +15,8 @@
 BUGTRACKER = "http://bugzilla.gnome.org"
 SECTION = "libs"
 
+CVE_PRODUCT = "glib"
+
 BBCLASSEXTEND = "native nativesdk"
 
 DEPENDS = "virtual/libiconv libffi zlib glib-2.0-native"
@@ -26,15 +28,17 @@
 
 LEAD_SONAME = "libglib-2.0.*"
 
-inherit autotools gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache python3native
+inherit autotools gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache python3native manpages
 
 S = "${WORKDIR}/glib-${PV}"
 
-PACKAGECONFIG ??= "system-pcre"
+PACKAGECONFIG ??= "system-pcre libmount"
 # To use the system pcre it must be configured with --enable-unicode-properties
 PACKAGECONFIG[system-pcre] = "--with-pcre=system,--with-pcre=internal,libpcre"
+PACKAGECONFIG[libmount] = "--enable-libmount,--disable-libmount,util-linux"
+PACKAGECONFIG[manpages] = "--enable-man --with-xml-catalog=${STAGING_ETCDIR_NATIVE}/xml/catalog.xml, --disable-man, libxslt-native xmlto-native"
 
-CORECONF = "--disable-dtrace --disable-fam --disable-libelf --disable-systemtap --disable-man"
+CORECONF = "--disable-dtrace --disable-fam --disable-libelf --disable-systemtap"
 
 PRINTF = "--enable-included-printf=no"
 PRINTF_darwin = "--enable-included-printf=yes"
@@ -43,6 +47,9 @@
 EXTRA_OECONF_class-native = "${CORECONF} --disable-selinux"
 EXTRA_OECONF_append_libc-uclibc = " --with-libiconv=gnu"
 
+# Tell configure that we'll have dbus-daemon on the target for the tests
+EXTRA_OECONF_class-target_append = " ${@bb.utils.contains('PTEST_ENABLED', '1', ' ac_cv_prog_DBUS_DAEMON=dbus-daemon', '', d)}"
+
 do_configure_prepend() {
 	sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
 }
@@ -90,23 +97,28 @@
 		sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/glib-mkenums
 	fi
 
+	if [ -e ${D}${libdir}/charset.alias ]; then
+		rm -f ${D}${libdir}/charset.alias
+	fi
+}
+
+do_install_append_class-target () {
+	# Tests are only installed on targets, not native builds.  Separating this out
+	# keeps glib-2.0-native from depending on ${DISTRO_FEATURES}
 	if [ -f ${D}${datadir}/installed-tests/glib/gdbus-serialization.test ]; then
 		if ${@bb.utils.contains("DISTRO_FEATURES", "x11", "false", "true", d)}; then
 			rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test
 		fi
 	fi
 
-        # Make sure gio-querymodules is unique among multilibs
-        if test "x${MLPREFIX}" != "x"; then
-                mv ${D}${libexecdir}/gio-querymodules ${D}${libexecdir}/${MLPREFIX}gio-querymodules
-        fi
-}
-
-do_install_append_libc-musl () {
-	rm -f ${D}${libdir}/charset.alias
+	# Make sure gio-querymodules is unique among multilibs
+	if test "x${MLPREFIX}" != "x"; then
+		mv ${D}${libexecdir}/gio-querymodules ${D}${libexecdir}/${MLPREFIX}gio-querymodules
+	fi
 }
 
 RDEPENDS_${PN}-ptest += "\
+            dbus \
             gnome-desktop-testing \
             tzdata \
             tzdata-americas \
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-networking/glib-networking_2.48.2.bb b/import-layers/yocto-poky/meta/recipes-core/glib-networking/glib-networking_2.48.2.bb
deleted file mode 100644
index 50d9983..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glib-networking/glib-networking_2.48.2.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-SUMMARY = "GLib networking extensions"
-DESCRIPTION = "glib-networking contains the implementations of certain GLib networking features that cannot be implemented directly in GLib itself because of their dependencies."
-HOMEPAGE = "http://git.gnome.org/browse/glib-networking/"
-BUGTRACKER = "http://bugzilla.gnome.org"
-
-LICENSE = "LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
-
-SECTION = "libs"
-DEPENDS = "glib-2.0 intltool-native"
-
-SRC_URI[archive.md5sum] = "d7cf81d52c856b0c66f7821021f40e08"
-SRC_URI[archive.sha256sum] = "925c0c49d6b2b8b5695f2e33cd952d1dbb7d18d3f2f796413577719315bb3a84"
-
-PACKAGECONFIG ??= "ca-certificates gnutls"
-
-# No explicit dependency as it works without ca-certificates installed
-PACKAGECONFIG[ca-certificates] = "--with-ca-certificates=${sysconfdir}/ssl/certs/ca-certificates.crt,--without-ca-certificates"
-PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
-PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy"
-PACKAGECONFIG[pkcs11] = "--with-pkcs11,--without-pkcs11,p11-kit"
-
-EXTRA_OECONF = "--without-gnome-proxy"
-
-inherit gnomebase gettext upstream-version-is-even gio-module-cache
-
-FILES_${PN} += "${libdir}/gio/modules/libgio*.so ${datadir}/dbus-1/services/"
-FILES_${PN}-dev += "${libdir}/gio/modules/libgio*.la"
-FILES_${PN}-staticdev += "${libdir}/gio/modules/libgio*.a"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-networking/glib-networking_2.50.0.bb b/import-layers/yocto-poky/meta/recipes-core/glib-networking/glib-networking_2.50.0.bb
new file mode 100644
index 0000000..2782bd9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-networking/glib-networking_2.50.0.bb
@@ -0,0 +1,29 @@
+SUMMARY = "GLib networking extensions"
+DESCRIPTION = "glib-networking contains the implementations of certain GLib networking features that cannot be implemented directly in GLib itself because of their dependencies."
+HOMEPAGE = "http://git.gnome.org/browse/glib-networking/"
+BUGTRACKER = "http://bugzilla.gnome.org"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+SECTION = "libs"
+DEPENDS = "glib-2.0"
+
+SRC_URI[archive.md5sum] = "4d06d0224646f274918b1cb6da9a07f6"
+SRC_URI[archive.sha256sum] = "3f1a442f3c2a734946983532ce59ed49120319fdb10c938447c373d5e5286bee"
+
+PACKAGECONFIG ??= "ca-certificates gnutls"
+
+# No explicit dependency as it works without ca-certificates installed
+PACKAGECONFIG[ca-certificates] = "--with-ca-certificates=${sysconfdir}/ssl/certs/ca-certificates.crt,--without-ca-certificates"
+PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
+PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy"
+PACKAGECONFIG[pkcs11] = "--with-pkcs11,--without-pkcs11,p11-kit"
+
+EXTRA_OECONF = "--without-gnome-proxy"
+
+inherit gnomebase gettext upstream-version-is-even gio-module-cache
+
+FILES_${PN} += "${libdir}/gio/modules/libgio*.so ${datadir}/dbus-1/services/"
+FILES_${PN}-dev += "${libdir}/gio/modules/libgio*.la"
+FILES_${PN}-staticdev += "${libdir}/gio/modules/libgio*.a"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native_2.24.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native_2.24.bb
deleted file mode 100644
index d4ccced..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native_2.24.bb
+++ /dev/null
@@ -1,52 +0,0 @@
-SUMMARY = "Cross locale generation tool for glibc"
-HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
-SECTION = "libs"
-LICENSE = "LGPL-2.1"
-
-LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
-      file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-      file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
-      file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
-
-# Tell autotools that we're working in the localedef directory
-#
-AUTOTOOLS_SCRIPT_PATH = "${S}/localedef"
-
-inherit native
-inherit autotools
-
-FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/glibc:"
-
-SRCBRANCH ?= "release/${PV}/master"
-GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
-
-SRCREV_glibc ?= "ea23815a795f72035262953dad5beb03e09c17dd"
-SRCREV_localedef ?= "29869b6dc11427c5bab839bdb155c85a7c644c71"
-
-SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
-           git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \
-           file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
-           file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
-           file://0018-eglibc-Cross-building-and-testing-instructions.patch \
-           file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
-           file://0020-eglibc-cherry-picked-from.patch \
-           file://0021-eglibc-Clear-cache-lines-on-ppc8xx.patch \
-           file://0022-eglibc-Resolve-__fpscr_values-on-SH4.patch \
-           file://0023-eglibc-Install-PIC-archives.patch \
-           file://0024-eglibc-Forward-port-cross-locale-generation-support.patch \
-           file://0025-Define-DUMMY_LOCALE_T-if-not-defined.patch \
-"
-# Makes for a rather long rev (22 characters), but...
-#
-SRCREV_FORMAT = "glibc_localedef"
-
-S = "${WORKDIR}/git"
-
-EXTRA_OECONF = "--with-glibc=${S}"
-CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'"
-
-do_install() {
-	install -d ${D}${bindir}
-	install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef
-}
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native_2.25.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native_2.25.bb
new file mode 100644
index 0000000..fae8683
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native_2.25.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Cross locale generation tool for glibc"
+HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
+SECTION = "libs"
+LICENSE = "LGPL-2.1"
+
+LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
+      file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+      file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+      file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+# Tell autotools that we're working in the localedef directory
+#
+AUTOTOOLS_SCRIPT_PATH = "${S}/localedef"
+
+inherit native
+inherit autotools
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/glibc:"
+
+SRCBRANCH ?= "release/${PV}/master"
+GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
+
+SRCREV_glibc ?= "db0242e3023436757bbc7c488a779e6e3343db04"
+SRCREV_localedef ?= "29869b6dc11427c5bab839bdb155c85a7c644c71"
+
+SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
+           git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \
+           file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
+           file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
+           file://0018-eglibc-Cross-building-and-testing-instructions.patch \
+           file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
+           file://0020-eglibc-cherry-picked-from.patch \
+           file://0021-eglibc-Clear-cache-lines-on-ppc8xx.patch \
+           file://0022-eglibc-Resolve-__fpscr_values-on-SH4.patch \
+           file://0023-eglibc-Install-PIC-archives.patch \
+           file://0024-eglibc-Forward-port-cross-locale-generation-support.patch \
+           file://0025-Define-DUMMY_LOCALE_T-if-not-defined.patch \
+           file://0001-Include-locale_t.h-compatibility-header.patch \
+"
+# Makes for a rather long rev (22 characters), but...
+#
+SRCREV_FORMAT = "glibc_localedef"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "--with-glibc=${S}"
+CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'"
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-collateral.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-collateral.inc
index 60655eb..37f27ca 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-collateral.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-collateral.inc
@@ -9,13 +9,13 @@
 # http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100679.html
 ARM_INSTRUCTION_SET = "arm"
 
-do_fetch[noexec] = "1"
-do_unpack[noexec] = "1"
-do_patch[noexec] = "1"
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
 do_configure[noexec] = "1"
 do_compile[noexec] = "1"
 
-do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot"
+do_install[depends] += "virtual/${MLPREFIX}libc:do_stash_locale"
 
 COMPATIBLE_HOST_libc-musl_class-target = "null"
 COMPATIBLE_HOST_libc-uclibc_class-target = "null"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-common.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-common.inc
index bba1568..b05e162 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-common.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-common.inc
@@ -7,3 +7,4 @@
       file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
       file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
       file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
+CVE_PRODUCT = "glibc"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial.inc
index 2e3bc81..b86e2fb 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial.inc
@@ -6,7 +6,6 @@
 
 STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
 STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
-TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
 
 do_configure () {
 	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
@@ -42,13 +41,9 @@
 	if [ -e ${B}/bits/stdio_lim.h ]; then
 		cp ${B}/bits/stdio_lim.h  ${D}${includedir}/bits/
 	fi
-	# add links to linux-libc-headers: final glibc build need this.
-	for t in linux asm asm-generic; do
-		ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
-	done
 }
 
-do_install_locale() {
+do_stash_locale() {
 	:
 }
 
@@ -56,23 +51,7 @@
 	:
 }
 
-SSTATEPOSTINSTFUNCS += "glibcinitial_sstate_postinst"
-glibcinitial_sstate_postinst() {
-	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
-	then
-		# Recreate the symlinks to ensure they point to the correct location
-		for t in linux asm asm-generic; do
-			rm -f ${STAGING_DIR_TCBOOTSTRAP}${includedir}/$t
-			ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${STAGING_DIR_TCBOOTSTRAP}${includedir}/
-		done
-	fi
-}
-
-do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
-
-# We don't install any scripts so there is nothing to evacuate
-do_evacuate_scripts () {
-	:
-}
-
 inherit nopackages
+
+# We really only want this built by things that need it, not any recrdeptask
+deltask do_build
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial_2.24.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial_2.25.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial_2.24.bb
rename to import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial_2.25.bb
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-ld.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-ld.inc
index b982368..c1d635d 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-ld.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-ld.inc
@@ -1,27 +1,14 @@
 def ld_append_if_tune_exists(d, infos, dict):
-    tune = d.getVar("DEFAULTTUNE", True) or ""
-    libdir = d.getVar("base_libdir", True) or ""
+    tune = d.getVar("DEFAULTTUNE") or ""
+    libdir = d.getVar("base_libdir") or ""
     if tune in dict:
         infos['ldconfig'].add('{"' + libdir + '/' + dict[tune][0] + '",' + dict[tune][1] + ' }')
         infos['lddrewrite'].add(libdir+'/'+dict[tune][0])
 
 def glibc_dl_info(d):
     ld_info_all = {
-        "mips": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mips64-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mips64": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mipsel": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mips64el-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mips64el": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mips-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mipsisa32r6": ["ld-linux-mipsn8.so.1", "FLAG_ELF_LIBC6"],
-        "mipsisa32r6el": ["ld-linux-mipsn8.so.1", "FLAG_ELF_LIBC6"],
-        "mips64-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mips64-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mips64el-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mips64el-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
-        "mipsisa64r6": ["ld-linux-mipsn8.so.1", "FLAG_ELF_LIBC6"],
-        "mipsisa64r6el": ["ld-linux-mipsn8.so.1", "FLAG_ELF_LIBC6"],
+        "mipsarch": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mipsarchr6": ["ld-linux-mipsn8.so.1", "FLAG_ELF_LIBC6"],
         "powerpc": ["ld.so.1", "FLAG_ELF_LIBC6"],
         "powerpc-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
         "powerpc64": ["ld64.so.1", "FLAG_ELF_LIBC6"],
@@ -39,18 +26,17 @@
     ld_append_if_tune_exists(d, infos, ld_info_all)
 
     #DEFAULTTUNE_MULTILIB_ORIGINAL
-    original_tune=d.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL",True)
+    original_tune=d.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL")
     if original_tune:
         localdata = bb.data.createCopy(d)
         localdata.setVar("DEFAULTTUNE", original_tune)
         ld_append_if_tune_exists(localdata, infos, ld_info_all)
 
-    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+    variants = d.getVar("MULTILIB_VARIANTS") or ""
     for item in variants.split():
         localdata = bb.data.createCopy(d)
         overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
         localdata.setVar("OVERRIDES", overrides)
-        bb.data.update_data(localdata)
         ld_append_if_tune_exists(localdata, infos, ld_info_all)
     infos['ldconfig'] = ','.join(infos['ldconfig'])
     infos['lddrewrite'] = ' '.join(infos['lddrewrite'])
@@ -58,4 +44,5 @@
 
 EGLIBC_KNOWN_INTERPRETER_NAMES = "${@glibc_dl_info(d)['ldconfig']}"
 RTLDLIST = "${@glibc_dl_info(d)['lddrewrite']}"
+RTLDLIST_class-nativesdk = "${base_libdir}/${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', 'ld-linux.so.2', d)}"
 glibc_dl_info[vardepsexclude] = "OVERRIDES"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale.inc
index 0a7adfc..75ababe 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale.inc
@@ -1,4 +1,4 @@
-include glibc-collateral.inc
+require glibc-collateral.inc
 
 SUMMARY = "Locale data from glibc"
 
@@ -12,6 +12,10 @@
 BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot"
 do_package[depends] += "${BINUTILSDEP}"
 
+# localedef links with libc.so and glibc-collateral.incinhibits all default deps
+# cannot add virtual/libc to DEPENDS, because it would conflict with libc-initial in RSS
+RDEPENDS_localedef += "glibc"
+
 # Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
 # is set. The idea is to avoid running localedef on the target (at first boot)
 # to decrease initial boot time and avoid localedef being killed by the OOM
@@ -41,22 +45,22 @@
 # Create a glibc-binaries package
 ALLOW_EMPTY_${BPN}-binaries = "1"
 PACKAGES += "${BPN}-binaries"
-RRECOMMENDS_${BPN}-binaries =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-binary") != -1])}"
+RRECOMMENDS_${BPN}-binaries =  "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-binary") != -1])}"
 
 # Create a glibc-charmaps package
 ALLOW_EMPTY_${BPN}-charmaps = "1"
 PACKAGES += "${BPN}-charmaps"
-RRECOMMENDS_${BPN}-charmaps =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-charmap") != -1])}"
+RRECOMMENDS_${BPN}-charmaps =  "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-charmap") != -1])}"
 
 # Create a glibc-gconvs package
 ALLOW_EMPTY_${BPN}-gconvs = "1"
 PACKAGES += "${BPN}-gconvs"
-RRECOMMENDS_${BPN}-gconvs =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-gconv") != -1])}"
+RRECOMMENDS_${BPN}-gconvs =  "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-gconv") != -1])}"
 
 # Create a glibc-localedatas package
 ALLOW_EMPTY_${BPN}-localedatas = "1"
 PACKAGES += "${BPN}-localedatas"
-RRECOMMENDS_${BPN}-localedatas =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-localedata") != -1])}"
+RRECOMMENDS_${BPN}-localedatas =  "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-localedata") != -1])}"
 
 DESCRIPTION_localedef = "glibc: compile locale definition files"
 
@@ -66,7 +70,7 @@
 FILES_${MLPREFIX}glibc-gconv = "${libdir}/gconv/*"
 FILES_localedef = "${bindir}/localedef"
 
-LOCALETREESRC = "${STAGING_INCDIR}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}"
+LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
 
 do_install () {
 	mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir}
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale_2.24.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale_2.25.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale_2.24.bb
rename to import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale_2.25.bb
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace.inc
index e12b079..d703c14 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace.inc
@@ -1,11 +1,11 @@
-include glibc-collateral.inc
+require glibc-collateral.inc
 
 SUMMARY = "mtrace utility provided by glibc"
 DESCRIPTION = "mtrace utility provided by glibc"
 RDEPENDS_${PN} = "perl"
 RPROVIDES_${PN} = "libc-mtrace"
 
-SRC = "${STAGING_INCDIR}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
+SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
 
 do_install() {
 	install -d -m 0755 ${D}${bindir}
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace_2.24.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace_2.25.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace_2.24.bb
rename to import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace_2.25.bb
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-package.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-package.inc
index bad6424..9f7fa62 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-package.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-package.inc
@@ -8,18 +8,15 @@
 
 python __anonymous () {
     import bb, re
-    uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS', True)) != None)
+    uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS')) != None)
     if uc_os:
         raise bb.parse.SkipPackage("incompatible with target %s" %
-                                   d.getVar('TARGET_OS', True))
+                                   d.getVar('TARGET_OS'))
 }
 
-# Set this to zero if you don't want ldconfig in the output package
-USE_LDCONFIG ?= "1"
-
 INHIBIT_SYSROOT_STRIP = "1"
 
-PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode ${PN}-utils glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
 
 # The ld.so in this glibc supports the GNU_HASH
 RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)"
@@ -37,7 +34,7 @@
 libc_baselibs_append_aarch64 = " /lib/ld-linux-aarch64*.so.1"
 INSANE_SKIP_${PN}_append_aarch64 = " libdir"
 
-FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${@base_conditional('USE_LDCONFIG', '1', '${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf', '', d)}"
+FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf"
 FILES_ldd = "${bindir}/ldd"
 FILES_libsegfault = "${base_libdir}/libSegFault*"
 FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*"
@@ -85,7 +82,7 @@
 		rmdir --ignore-fail-on-non-empty ${D}${libexecdir}
 	fi
 
-	oe_multilib_header bits/syscall.h
+	oe_multilib_header bits/syscall.h bits/long-double.h
 
 	if [ -f ${D}${bindir}/mtrace ]; then
 		sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace
@@ -96,8 +93,8 @@
 		rm -f ${D}${infodir}/dir
 	fi
 
-	if [ "${USE_LDCONFIG}" != "1" ]; then
-		# We won't ship these files (see FILES above) so let's not install them
+	if ! ${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', 'true', 'false', d)}; then
+		# The distro doesn't want these files so let's not install them
 		rm -f ${D}${sysconfdir}/ld.so.conf
 		rm -f ${D}${base_sbindir}/ldconfig
 		# This directory will be empty now so remove it too.
@@ -143,10 +140,30 @@
 				${D}/lib/ld-linux-aarch64_be.so.1
 		fi
 	fi
+	do_install_armmultilib
 }
 
-do_install_locale () {
-	dest=${D}/${includedir}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}
+do_install_append_arm () {
+	do_install_armmultilib
+}
+
+do_install_armmultilib () {
+
+	oe_multilib_header bits/endian.h bits/fcntl.h bits/fenv.h bits/fp-fast.h bits/hwcap.h bits/ipc.h bits/link.h bits/wordsize.h
+	oe_multilib_header bits/local_lim.h bits/mman.h bits/msq.h bits/pthreadtypes.h  bits/sem.h  bits/semaphore.h bits/setjmp.h
+	oe_multilib_header bits/shm.h bits/sigstack.h bits/stat.h bits/statfs.h bits/string.h bits/typesizes.h
+
+	oe_multilib_header fpu_control.h gnu/lib-names.h gnu/stubs.h ieee754.h
+
+	oe_multilib_header sys/elf.h sys/procfs.h sys/ptrace.h sys/ucontext.h sys/user.h
+}
+
+
+LOCALESTASH = "${WORKDIR}/stashed-locale"
+bashscripts = "mtrace sotruss xtrace"
+
+do_stash_locale () {
+	dest=${LOCALESTASH}
 	install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir}
 	if [ "${base_libdir}" != "${libdir}" ]; then
 		cp -fpPR ${D}${base_libdir}/* ${dest}${base_libdir}
@@ -166,14 +183,8 @@
 	cp -fpPR ${D}${datadir}/* ${dest}${datadir}
 	rm -rf ${D}${datadir}/locale/
 	cp -fpPR ${WORKDIR}/SUPPORTED ${dest}
-}
 
-addtask do_install_locale after do_install before do_populate_sysroot do_package
-
-bashscripts = "mtrace sotruss xtrace"
-
-do_evacuate_scripts () {
-	target=${D}${includedir}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}
+	target=${dest}/scripts
 	mkdir -p $target
 	for i in ${bashscripts}; do
 		if [ -f ${D}${bindir}/$i ]; then
@@ -182,22 +193,36 @@
 	done
 }
 
-addtask evacuate_scripts after do_install before do_populate_sysroot do_package
+addtask do_stash_locale after do_install before do_populate_sysroot do_package
+do_stash_locale[dirs] = "${B}"
+do_stash_locale[cleandirs] = "${LOCALESTASH}"
+SSTATETASKS += "do_stash_locale"
+do_stash_locale[sstate-inputdirs] = "${LOCALESTASH}"
+do_stash_locale[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
+do_stash_locale[sstate-fixmedir] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
 
-PACKAGE_PREPROCESS_FUNCS += "glibc_package_preprocess"
+python do_stash_locale_setscene () {
+    sstate_setscene(d)
+}
+addtask do_stash_locale_setscene
 
-glibc_package_preprocess () {
-	rm -rf ${PKGD}/${includedir}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}
-	rm -rf ${PKGD}/${includedir}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}
+do_poststash_install_cleanup () {
+	# Remove all files which do_stash_locale would remove (mv)
+	# since that task could have come from sstate and not get run.
 	for i in ${bashscripts}; do
-	    rm -f ${PKGD}${bindir}/$i
+	    rm -f ${D}${bindir}/$i
 	done
-	rm -rf ${PKGD}/${localedir}
+	rm -f ${D}${bindir}/localedef
+	rm -rf ${D}${datadir}/i18n
+	rm -rf ${D}${libdir}/gconv
+	rm -rf ${D}/${localedir}
+	rm -rf ${D}${datadir}/locale
 	if [ "${libdir}" != "${exec_prefix}/lib" ]; then
 		# This dir only exists to hold locales
-		rm -rf ${PKGD}${exec_prefix}/lib
+		rm -rf ${D}${exec_prefix}/lib
 	fi
 }
+addtask do_poststash_install_cleanup after do_stash_locale do_install before do_populate_sysroot do_package
 
 pkg_postinst_nscd () {
 	if [ -z "$D" ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts.inc
index bce0a42..2a2b415 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts.inc
@@ -1,10 +1,10 @@
-include glibc-collateral.inc
+require glibc-collateral.inc
 
 SUMMARY = "utility scripts provided by glibc"
 DESCRIPTION = "utility scripts provided by glibc"
 RDEPENDS_${PN} = "bash glibc-mtrace"
 
-SRC = "${STAGING_INCDIR}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
+SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
 
 bashscripts = "sotruss xtrace"
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts_2.24.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts_2.25.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts_2.24.bb
rename to import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts_2.25.bb
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc.inc
index 7bae0e9..21bbdc2 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc.inc
@@ -6,17 +6,15 @@
 STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
 PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
 
-TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
-
 python () {
     opt_effective = "-O"
-    for opt in d.getVar('SELECTED_OPTIMIZATION', True).split():
+    for opt in d.getVar('SELECTED_OPTIMIZATION').split():
         if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
             opt_effective = opt
     if opt_effective == "-O0":
-        bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN', True), opt_effective))
+        bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
     if opt_effective in ("-O", "-O1", "-Os"):
-        bb.note("%s doesn't build cleanly with %s, adding -Wno-error to SELECTED_OPTIMIZATION" % (d.getVar('PN', True), opt_effective))
+        bb.note("%s doesn't build cleanly with %s, adding -Wno-error to SELECTED_OPTIMIZATION" % (d.getVar('PN'), opt_effective))
         d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error")
 }
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-Add-atomic_exchange_relaxed.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-Add-atomic_exchange_relaxed.patch
deleted file mode 100644
index a33a135..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-Add-atomic_exchange_relaxed.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From ce74a620bf9e1a40b7ba06d35160e20633a4d8bb Mon Sep 17 00:00:00 2001
-From: Catalin Enache <catalin.enache@windriver.com>
-Date: Fri, 7 Jul 2017 13:11:16 +0300
-Subject: [PATCH 1/6] Add atomic_exchange_relaxed.
-
-* include/atomic.h (atomic_exchange_relaxed): New
-
-Upstream-Status: Backport
-
-Author: Torvald Riegel <triegel@redhat.com>
-Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
----
- ChangeLog        | 4 ++++
- include/atomic.h | 9 +++++++++
- 2 files changed, 13 insertions(+)
-
-diff --git a/ChangeLog b/ChangeLog
-index 0fbda90..cb87279 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,7 @@
-+2016-08-05  Torvald Riegel  <triegel@redhat.com>
-+
-+	* include/atomic.h (atomic_exchange_relaxed): New.
-+
- 2016-01-28  Carlos O'Donell  <carlos@redhat.com>
- 	    Alexey Makhalov <amakhalov@vmware.com>
- 	    Florian Weimer <fweimer@redhat.com>
-diff --git a/include/atomic.h b/include/atomic.h
-index ad3db25..129ee24 100644
---- a/include/atomic.h
-+++ b/include/atomic.h
-@@ -588,6 +588,9 @@ void __atomic_link_error (void);
-   __atomic_compare_exchange_n ((mem), (expected), (desired), 1,		      \
-     __ATOMIC_RELEASE, __ATOMIC_RELAXED); })
- 
-+# define atomic_exchange_relaxed(mem, desired) \
-+  ({ __atomic_check_size((mem));					      \
-+  __atomic_exchange_n ((mem), (desired), __ATOMIC_RELAXED); })
- # define atomic_exchange_acquire(mem, desired) \
-   ({ __atomic_check_size((mem));					      \
-   __atomic_exchange_n ((mem), (desired), __ATOMIC_ACQUIRE); })
-@@ -684,6 +687,12 @@ void __atomic_link_error (void);
-    *(expected) == __atg103_expected; })
- # endif
- 
-+/* XXX Fall back to acquire MO because archs do not define a weaker
-+   atomic_exchange.  */
-+# ifndef atomic_exchange_relaxed
-+#  define atomic_exchange_relaxed(mem, val) \
-+   atomic_exchange_acq ((mem), (val))
-+# endif
- # ifndef atomic_exchange_acquire
- #  define atomic_exchange_acquire(mem, val) \
-    atomic_exchange_acq ((mem), (val))
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-Include-locale_t.h-compatibility-header.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-Include-locale_t.h-compatibility-header.patch
new file mode 100644
index 0000000..a13c428
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-Include-locale_t.h-compatibility-header.patch
@@ -0,0 +1,29 @@
+From abfeb0cf4e3261a66a7a23abc9aed33c034c850d Mon Sep 17 00:00:00 2001
+From: Joshua Watt <Joshua.Watt@garmin.com>
+Date: Wed, 6 Dec 2017 13:26:19 -0600
+Subject: [PATCH] Include locale_t.h compatibility header
+
+Newer versions of glibc (since 2.26) moved the locale typedefs from
+xlocale.h to bits/types/locale_t.h. Create a compatibility header for
+these newer versions of glibc
+
+See f0be25b6336db7492e47d2e8e72eb8af53b5506d in glibc
+
+Upstream-Status: Inappropriate compatibility with newer host glibc
+Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
+
+---
+ locale/bits/types/locale_t.h | 1 +
+ 1 file changed, 1 insertion(+)
+ create mode 100644 locale/bits/types/locale_t.h
+
+diff --git a/locale/bits/types/locale_t.h b/locale/bits/types/locale_t.h
+new file mode 100644
+index 0000000000..b519a6c5f8
+--- /dev/null
++++ b/locale/bits/types/locale_t.h
+@@ -0,0 +1 @@
++#include <xlocale.h>
+-- 
+2.14.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-locale-fix-hard-coded-reference-to-gcc-E.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-locale-fix-hard-coded-reference-to-gcc-E.patch
deleted file mode 100644
index d5fce73..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-locale-fix-hard-coded-reference-to-gcc-E.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 2c0ab83eb54c0e0fccbf261726dc03803b236079 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= <jeremy.rosen@smile.fr>
-Date: Mon, 22 Aug 2016 16:09:25 +0200
-Subject: [PATCH] locale: fix hard-coded reference to gcc -E
-
-When new version of compilers are published, they may not be compatible with 
-older versions of software. This is particularly common when software is built
-with -Werror.
-
-Autotools provides a way for a user to specify the name of his compiler using a
-set of variables ($CC $CXX $CPP etc.). Those variables are used correctly when
-compiling glibc but the script used to generate transliterations in the locale/
-subdirectory directly calls the gcc binary to get the output of the 
-preprocessor instead of using the $CPP variable provided by the build 
-environment. 
-
-This patch replaces the hard-coded reference to the gcc binary with the proper
-environment variable, thus allowing a user to override it.
-
-Upstream-Status : Submitted [https://sourceware.org/ml/libc-alpha/2016-08/msg00746.html]
-
----
- locale/gen-translit.pl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl
-index 30d3f2f..7b287fa 100644
---- a/locale/gen-translit.pl
-+++ b/locale/gen-translit.pl
-@@ -1,5 +1,5 @@
- #!/usr/bin/perl -w
--open F, "cat C-translit.h.in | gcc -E - |" || die "Cannot preprocess input file";
-+open F, 'cat C-translit.h.in | ${CPP:-gcc -E} - |' || die "Cannot preprocess input file";
- 
- 
- sub cstrlen {
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
index ca33758..0553f8a 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
@@ -1,7 +1,7 @@
-From 7e11aafc3a7cb873b3f648740c8acd379597e4d1 Mon Sep 17 00:00:00 2001
+From 2727e58d1d269994de17cadb12195001b14585e7 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 01:48:24 +0000
-Subject: [PATCH 01/25] nativesdk-glibc: Look for host system ld.so.cache as
+Subject: [PATCH 01/26] nativesdk-glibc: Look for host system ld.so.cache as
  well
 
 Upstream-Status: Inappropriate [embedded specific]
@@ -31,10 +31,10 @@
  1 file changed, 8 insertions(+), 8 deletions(-)
 
 diff --git a/elf/dl-load.c b/elf/dl-load.c
-index c0d6249..2c73105 100644
+index 51fb0d0..f503dbc 100644
 --- a/elf/dl-load.c
 +++ b/elf/dl-load.c
-@@ -2094,6 +2094,14 @@ _dl_map_object (struct link_map *loader, const char *name,
+@@ -2054,6 +2054,14 @@ _dl_map_object (struct link_map *loader, const char *name,
              }
          }
  
@@ -49,7 +49,7 @@
  #ifdef USE_LDCONFIG
        if (fd == -1
  	  && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
-@@ -2152,14 +2160,6 @@ _dl_map_object (struct link_map *loader, const char *name,
+@@ -2112,14 +2120,6 @@ _dl_map_object (struct link_map *loader, const char *name,
  	}
  #endif
  
@@ -65,5 +65,5 @@
        if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
  	_dl_debug_printf ("\n");
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-Add-atomic-operations-required-by-the-new-condition-.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-Add-atomic-operations-required-by-the-new-condition-.patch
deleted file mode 100644
index c4747fa..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-Add-atomic-operations-required-by-the-new-condition-.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-From b85e30e655027132c4326d2fdde010c517165aaf Mon Sep 17 00:00:00 2001
-From: Catalin Enache <catalin.enache@windriver.com>
-Date: Fri, 30 Jun 2017 14:27:34 +0300
-Subject: [PATCH 2/6] Add atomic operations required by the new condition
- variable.
-
-    * include/atomic.h (atomic_fetch_and_relaxed,
-    atomic_fetch_and_release, atomic_fetch_or_release,
-    atomic_fetch_xor_release): New.
-
-Upstream-Status: Backport
-
-Author: Torvald Riegel <triegel@redhat.com>
-Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
----
- ChangeLog        |  6 ++++++
- include/atomic.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 53 insertions(+)
-
-diff --git a/ChangeLog b/ChangeLog
-index cb87279..96b6da2 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,9 @@
-+2016-08-09  Torvald Riegel  <triegel@redhat.com>
-+
-+	* include/atomic.h (atomic_fetch_and_relaxed,
-+	atomic_fetch_and_release, atomic_fetch_or_release,
-+	atomic_fetch_xor_release): New.
-+
- 2016-08-05  Torvald Riegel  <triegel@redhat.com>
- 
- 	* include/atomic.h (atomic_exchange_relaxed): New.
-diff --git a/include/atomic.h b/include/atomic.h
-index 129ee24..5a8e7e7 100644
---- a/include/atomic.h
-+++ b/include/atomic.h
-@@ -611,9 +611,15 @@ void __atomic_link_error (void);
-   ({ __atomic_check_size((mem));					      \
-   __atomic_fetch_add ((mem), (operand), __ATOMIC_ACQ_REL); })
- 
-+# define atomic_fetch_and_relaxed(mem, operand) \
-+  ({ __atomic_check_size((mem));					      \
-+  __atomic_fetch_and ((mem), (operand), __ATOMIC_RELAXED); })
- # define atomic_fetch_and_acquire(mem, operand) \
-   ({ __atomic_check_size((mem));					      \
-   __atomic_fetch_and ((mem), (operand), __ATOMIC_ACQUIRE); })
-+# define atomic_fetch_and_release(mem, operand) \
-+  ({ __atomic_check_size((mem));					      \
-+  __atomic_fetch_and ((mem), (operand), __ATOMIC_RELEASE); })
- 
- # define atomic_fetch_or_relaxed(mem, operand) \
-   ({ __atomic_check_size((mem));					      \
-@@ -621,6 +627,13 @@ void __atomic_link_error (void);
- # define atomic_fetch_or_acquire(mem, operand) \
-   ({ __atomic_check_size((mem));					      \
-   __atomic_fetch_or ((mem), (operand), __ATOMIC_ACQUIRE); })
-+# define atomic_fetch_or_release(mem, operand) \
-+  ({ __atomic_check_size((mem));					      \
-+  __atomic_fetch_or ((mem), (operand), __ATOMIC_RELEASE); })
-+
-+# define atomic_fetch_xor_release(mem, operand) \
-+  ({ __atomic_check_size((mem));					      \
-+  __atomic_fetch_xor ((mem), (operand), __ATOMIC_RELEASE); })
- 
- #else /* !USE_ATOMIC_COMPILER_BUILTINS  */
- 
-@@ -724,12 +737,24 @@ void __atomic_link_error (void);
-    atomic_exchange_and_add_acq ((mem), (operand)); })
- # endif
- 
-+/* XXX Fall back to acquire MO because archs do not define a weaker
-+   atomic_and_val.  */
-+# ifndef atomic_fetch_and_relaxed
-+#  define atomic_fetch_and_relaxed(mem, operand) \
-+   atomic_fetch_and_acquire ((mem), (operand))
-+# endif
- /* XXX The default for atomic_and_val has acquire semantics, but this is not
-    documented.  */
- # ifndef atomic_fetch_and_acquire
- #  define atomic_fetch_and_acquire(mem, operand) \
-    atomic_and_val ((mem), (operand))
- # endif
-+# ifndef atomic_fetch_and_release
-+/* XXX This unnecessarily has acquire MO.  */
-+#  define atomic_fetch_and_release(mem, operand) \
-+   ({ atomic_thread_fence_release ();					      \
-+   atomic_and_val ((mem), (operand)); })
-+# endif
- 
- /* XXX The default for atomic_or_val has acquire semantics, but this is not
-    documented.  */
-@@ -743,6 +768,28 @@ void __atomic_link_error (void);
- #  define atomic_fetch_or_relaxed(mem, operand) \
-    atomic_fetch_or_acquire ((mem), (operand))
- # endif
-+/* XXX Contains an unnecessary acquire MO because archs do not define a weaker
-+   atomic_or_val.  */
-+# ifndef atomic_fetch_or_release
-+#  define atomic_fetch_or_release(mem, operand) \
-+   ({ atomic_thread_fence_release ();					      \
-+   atomic_fetch_or_acquire ((mem), (operand)); })
-+# endif
-+
-+# ifndef atomic_fetch_xor_release
-+# define atomic_fetch_xor_release(mem, operand) \
-+  ({ __typeof (*(mem)) __atg104_old;					      \
-+     __typeof (mem) __atg104_memp = (mem);				      \
-+     __typeof (*(mem)) __atg104_op = (operand);				      \
-+									      \
-+     do									      \
-+       __atg104_old = (*__atg104_memp);					      \
-+     while (__builtin_expect						      \
-+	    (atomic_compare_and_exchange_bool_rel (			      \
-+		__atg104_memp, __atg104_old ^ __atg104_op, __atg104_old), 0));\
-+									      \
-+     __atg104_old; })
-+#endif
- 
- #endif /* !USE_ATOMIC_COMPILER_BUILTINS  */
- 
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
index 5428468..e5ef341 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
@@ -1,7 +1,7 @@
-From 5fd884dc28d5d84001fae8ffdd8be698bb84143e Mon Sep 17 00:00:00 2001
+From 1578f52647ec8804186d1944d4cd2095132efc39 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 01:50:00 +0000
-Subject: [PATCH 02/25] nativesdk-glibc: Fix buffer overrun with a relocated
+Subject: [PATCH 02/26] nativesdk-glibc: Fix buffer overrun with a relocated
  SDK
 
 When ld-linux-*.so.2 is relocated to a path that is longer than the
@@ -22,10 +22,10 @@
  1 file changed, 12 insertions(+)
 
 diff --git a/elf/dl-load.c b/elf/dl-load.c
-index 2c73105..c7b8797 100644
+index f503dbc..3a3d112 100644
 --- a/elf/dl-load.c
 +++ b/elf/dl-load.c
-@@ -1793,7 +1793,19 @@ open_path (const char *name, size_t namelen, int mode,
+@@ -1753,7 +1753,19 @@ open_path (const char *name, size_t namelen, int mode,
         given on the command line when rtld is run directly.  */
      return -1;
  
@@ -46,5 +46,5 @@
      {
        struct r_search_path_elem *this_dir = *dirs;
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-Add-pretty-printers-for-the-NPTL-lock-types.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-Add-pretty-printers-for-the-NPTL-lock-types.patch
deleted file mode 100644
index 9eb635d..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-Add-pretty-printers-for-the-NPTL-lock-types.patch
+++ /dev/null
@@ -1,3197 +0,0 @@
-From 246fee86fc90c57738ee282a061039f82832f4ea Mon Sep 17 00:00:00 2001
-From: Catalin Enache <catalin.enache@windriver.com>
-Date: Fri, 30 Jun 2017 13:42:04 +0300
-Subject: [PATCH 3/6] Add pretty printers for the NPTL lock types
-
-This patch adds pretty printers for the following NPTL types:
-
-- pthread_mutex_t
-- pthread_mutexattr_t
-- pthread_cond_t
-- pthread_condattr_t
-- pthread_rwlock_t
-- pthread_rwlockattr_t
-
-To load the pretty printers into your gdb session, do the following:
-
-python
-import sys
-sys.path.insert(0, '/path/to/glibc/build/nptl/pretty-printers')
-end
-
-source /path/to/glibc/source/pretty-printers/nptl-printers.py
-
-You can check which printers are registered and enabled by issuing the
-'info pretty-printer' gdb command. Printers should trigger automatically when
-trying to print a variable of one of the types mentioned above.
-
-The printers are architecture-independent, and were tested on an AMD64 running
-Ubuntu 14.04 and an x86 VM running Fedora 24.
-
-In order to work, the printers need to know the values of various flags that
-are scattered throughout pthread.h and pthreadP.h as enums and #defines. Since
-replicating these constants in the printers file itself would create a
-maintenance burden, I wrote a script called gen-py-const.awk that Makerules uses
-to extract the constants. This script is pretty much the same as gen-as-const.awk,
-except it doesn't cast the constant values to 'long' and is thorougly documented.
-The constants need only to be enumerated in a .pysym file, which is then referenced
-by a Make variable called gen-py-const-headers.
-
-As for the install directory, I discussed this with Mike Frysinger and Siddhesh
-Poyarekar, and we agreed that it can be handled in a separate patch, and shouldn't
-block merging of this one.
-
-In addition, I've written a series of test cases for the pretty printers.
-Each lock type (mutex, condvar and rwlock) has two test programs, one for itself
-and other for its related 'attributes' object. Each test program in turn has a
-PExpect-based Python script that drives gdb and compares its output to the
-expected printer's. The tests run on the glibc host, which is assumed to have
-both gdb and PExpect; if either is absent the tests will fail with code 77
-(UNSUPPORTED). For cross-testing you should use cross-test-ssh.sh as test-wrapper.
-I've tested the printers on both native builds and a cross build using a Beaglebone
-Black running Debian, with the build system's filesystem shared with the board
-through NFS.
-
-Finally, I've written a README that explains all this and more.
-
-    * INSTALL: Regenerated.
-    * Makeconfig: Add comments and whitespace to make the control flow
-    clearer.
-    (+link-printers-tests, +link-pie-printers-tests, CFLAGS-printers-tests,
-    installed-rtld-LDFLAGS, built-rtld-LDFLAGS, link-libc-rpath,
-    link-libc-tests-after-rpath-link, link-libc-printers-tests): New.
-    (rtld-LDFLAGS, rtld-tests-LDFLAGS, link-libc-tests-rpath-link,
-    link-libc-tests): Use the new variables as required.
-    * Makerules ($(py-const)): New rule.
-    generated: Add $(py-const).
-    * README.pretty-printers: New file.
-    * Rules (tests-printers-programs, tests-printers-out, py-env): New.
-    (others): Depend on $(py-const).
-    (tests): Depend on $(tests-printers-programs) or $(tests-printers-out),
-    as required.  Pass $(tests-printers) to merge-test-results.sh.
-    * manual/install.texi: Add requirements for testing the pretty printers.
-    * nptl/Makefile (gen-py-const-headers, pretty-printers, tests-printers,
-    CFLAGS-test-mutexattr-printers.c CFLAGS-test-mutex-printers.c,
-    CFLAGS-test-condattr-printers.c, CFLAGS-test-cond-printers.c,
-    CFLAGS-test-rwlockattr-printers.c CFLAGS-test-rwlock-printers.c,
-    tests-printers-libs): Define.
-    * nptl/nptl-printers.py: New file.
-    * nptl/nptl_lock_constants.pysym: Likewise.
-    * nptl/test-cond-printers.c: Likewise.
-    * nptl/test-cond-printers.py: Likewise.
-    * nptl/test-condattr-printers.c: Likewise.
-    * nptl/test-condattr-printers.py: Likewise.
-    * nptl/test-mutex-printers.c: Likewise.
-    * nptl/test-mutex-printers.py: Likewise.
-    * nptl/test-mutexattr-printers.c: Likewise.
-    * nptl/test-mutexattr-printers.py: Likewise.
-    * nptl/test-rwlock-printers.c: Likewise.
-    * nptl/test-rwlock-printers.py: Likewise.
-    * nptl/test-rwlockattr-printers.c: Likewise.
-    * nptl/test-rwlockattr-printers.py: Likewise.
-    * scripts/gen-py-const.awk: Likewise.
-    * scripts/test_printers_common.py: Likewise.
-    * scripts/test_printers_exceptions.py: Likewise.
-
-Upstream-Status: Backport
-
-Author: Martin Galvan <martin.galvan@tallertechnologies.com>
-Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
----
- ChangeLog                           |  45 +++
- INSTALL                             |  27 ++
- Makeconfig                          |  76 ++++-
- Makerules                           |  46 +++
- NEWS                                |   6 +
- README.pretty-printers              | 169 ++++++++++
- Rules                               |  44 ++-
- manual/install.texi                 |  30 ++
- nptl/Makefile                       |  18 +
- nptl/nptl-printers.py               | 633 ++++++++++++++++++++++++++++++++++++
- nptl/nptl_lock_constants.pysym      |  75 +++++
- nptl/test-cond-printers.c           |  57 ++++
- nptl/test-cond-printers.py          |  50 +++
- nptl/test-condattr-printers.c       |  94 ++++++
- nptl/test-condattr-printers.py      |  71 ++++
- nptl/test-mutex-printers.c          | 151 +++++++++
- nptl/test-mutex-printers.py         |  97 ++++++
- nptl/test-mutexattr-printers.c      | 144 ++++++++
- nptl/test-mutexattr-printers.py     | 101 ++++++
- nptl/test-rwlock-printers.c         |  78 +++++
- nptl/test-rwlock-printers.py        |  64 ++++
- nptl/test-rwlockattr-printers.c     |  98 ++++++
- nptl/test-rwlockattr-printers.py    |  73 +++++
- scripts/gen-py-const.awk            | 118 +++++++
- scripts/test_printers_common.py     | 364 +++++++++++++++++++++
- scripts/test_printers_exceptions.py |  61 ++++
- 26 files changed, 2770 insertions(+), 20 deletions(-)
- create mode 100644 README.pretty-printers
- create mode 100644 nptl/nptl-printers.py
- create mode 100644 nptl/nptl_lock_constants.pysym
- create mode 100644 nptl/test-cond-printers.c
- create mode 100644 nptl/test-cond-printers.py
- create mode 100644 nptl/test-condattr-printers.c
- create mode 100644 nptl/test-condattr-printers.py
- create mode 100644 nptl/test-mutex-printers.c
- create mode 100644 nptl/test-mutex-printers.py
- create mode 100644 nptl/test-mutexattr-printers.c
- create mode 100644 nptl/test-mutexattr-printers.py
- create mode 100644 nptl/test-rwlock-printers.c
- create mode 100644 nptl/test-rwlock-printers.py
- create mode 100644 nptl/test-rwlockattr-printers.c
- create mode 100644 nptl/test-rwlockattr-printers.py
- create mode 100644 scripts/gen-py-const.awk
- create mode 100644 scripts/test_printers_common.py
- create mode 100644 scripts/test_printers_exceptions.py
-
-diff --git a/ChangeLog b/ChangeLog
-index 96b6da2..8036c1e 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,48 @@
-+2016-12-08  Martin Galvan  <martin.galvan@tallertechnologies.com>
-+
-+	* INSTALL: Regenerated.
-+	* Makeconfig: Add comments and whitespace to make the control flow
-+	clearer.
-+	(+link-printers-tests, +link-pie-printers-tests,
-+	CFLAGS-printers-tests, installed-rtld-LDFLAGS,
-+	built-rtld-LDFLAGS, link-libc-rpath,
-+	link-libc-tests-after-rpath-link,
-+	link-libc-printers-tests): New.
-+	(rtld-LDFLAGS, rtld-tests-LDFLAGS, link-libc-tests-rpath-link,
-+	link-libc-tests): Use the new variables as required.
-+	* Makerules ($(py-const)): New rule.
-+	generated: Add $(py-const).
-+	* README.pretty-printers: New file.
-+	* Rules (tests-printers-programs, tests-printers-out, py-env): New.
-+	(others): Depend on $(py-const).
-+	(tests): Depend on $(tests-printers-programs) or
-+	$(tests-printers-out),
-+	as required.  Pass $(tests-printers) to merge-test-results.sh.
-+	* manual/install.texi: Add requirements for testing the pretty
-+	printers.
-+	* nptl/Makefile (gen-py-const-headers, pretty-printers,
-+	tests-printers, CFLAGS-test-mutexattr-printers.c
-+	CFLAGS-test-mutex-printers.c, CFLAGS-test-condattr-printers.c,
-+	CFLAGS-test-cond-printers.c, CFLAGS-test-rwlockattr-printers.c
-+	CFLAGS-test-rwlock-printers.c, tests-printers-libs): Define.
-+	* nptl/nptl-printers.py: New file.
-+	* nptl/nptl_lock_constants.pysym: Likewise.
-+	* nptl/test-cond-printers.c: Likewise.
-+	* nptl/test-cond-printers.py: Likewise.
-+	* nptl/test-condattr-printers.c: Likewise.
-+	* nptl/test-condattr-printers.py: Likewise.
-+	* nptl/test-mutex-printers.c: Likewise.
-+	* nptl/test-mutex-printers.py: Likewise.
-+	* nptl/test-mutexattr-printers.c: Likewise.
-+	* nptl/test-mutexattr-printers.py: Likewise.
-+	* nptl/test-rwlock-printers.c: Likewise.
-+	* nptl/test-rwlock-printers.py: Likewise.
-+	* nptl/test-rwlockattr-printers.c: Likewise.
-+	* nptl/test-rwlockattr-printers.py: Likewise.
-+	* scripts/gen-py-const.awk: Likewise.
-+	* scripts/test_printers_common.py: Likewise.
-+	* scripts/test_printers_exceptions.py: Likewise.
-+
- 2016-08-09  Torvald Riegel  <triegel@redhat.com>
- 
- 	* include/atomic.h (atomic_fetch_and_relaxed,
-diff --git a/INSTALL b/INSTALL
-index ec3445f..dd62c86 100644
---- a/INSTALL
-+++ b/INSTALL
-@@ -224,6 +224,33 @@ You can specify 'stop-on-test-failure=y' when running 'make check' to
- make the test run stop and exit with an error status immediately when a
- failure occurs.
- 
-+   The GNU C Library pretty printers come with their own set of scripts
-+for testing, which run together with the rest of the testsuite through
-+'make check'.  These scripts require the following tools to run
-+successfully:
-+
-+   * Python 2.7.6/3.4.3 or later
-+
-+     Python is required for running the printers' test scripts.
-+
-+   * PExpect 4.0
-+
-+     The printer tests drive GDB through test programs and compare its
-+     output to the printers'.  PExpect is used to capture the output of
-+     GDB, and should be compatible with the Python version in your
-+     system.
-+
-+   * GDB 7.8 or later with support for Python 2.7.6/3.4.3 or later
-+
-+     GDB itself needs to be configured with Python support in order to
-+     use the pretty printers.  Notice that your system having Python
-+     available doesn't imply that GDB supports it, nor that your
-+     system's Python and GDB's have the same version.
-+
-+If these tools are absent, the printer tests will report themselves as
-+'UNSUPPORTED'.  Notice that some of the printer tests require the GNU C
-+Library to be compiled with debugging symbols.
-+
-    To format the 'GNU C Library Reference Manual' for printing, type
- 'make dvi'.  You need a working TeX installation to do this.  The
- distribution builds the on-line formatted version of the manual, as Info
-diff --git a/Makeconfig b/Makeconfig
-index 03fd89c..2d92d94 100644
---- a/Makeconfig
-+++ b/Makeconfig
-@@ -416,6 +416,11 @@ $(+link-pie-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
- 			 $(+link-pie-after-libc)
- $(call after-link,$@)
- endef
-+define +link-pie-printers-tests
-+$(+link-pie-before-libc) $(built-rtld-LDFLAGS) $(link-libc-printers-tests) \
-+			 $(+link-pie-after-libc)
-+$(call after-link,$@)
-+endef
- endif
- # Command for statically linking programs with the C library.
- ifndef +link-static
-@@ -445,7 +450,8 @@ ifeq (yes,$(build-pie-default))
- no-pie-ldflag = -no-pie
- +link = $(+link-pie)
- +link-tests = $(+link-pie-tests)
--else
-++link-printers-tests = $(+link-pie-printers-tests)
-+else  # not build-pie-default
- +link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
- 	      $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
- 	      $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
-@@ -466,51 +472,87 @@ $(+link-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
- 		     $(+link-after-libc)
- $(call after-link,$@)
- endef
--endif
--else
-+define +link-printers-tests
-+$(+link-before-libc) $(built-rtld-LDFLAGS) $(link-libc-printers-tests) \
-+		     $(+link-after-libc)
-+$(call after-link,$@)
-+endef
-+endif  # build-pie-default
-+else  # build-static
- +link = $(+link-static)
- +link-tests = $(+link-static-tests)
--endif
--endif
-++link-printers-tests = $(+link-static-tests)
-+endif  # build-shared
-+endif  # +link
-+
-+# The pretty printer test programs need to be compiled without optimizations
-+# so they won't confuse gdb.  We could use either the 'GCC optimize' pragma
-+# or the 'optimize' function attribute to achieve this; however, at least on
-+# ARM, gcc always produces different debugging symbols when invoked with
-+# a -O greater than 0 than when invoked with -O0, regardless of anything else
-+# we're using to suppress optimizations.  Therefore, we need to explicitly pass
-+# -O0 to it through CFLAGS.
-+# Additionally, the build system will try to -include $(common-objpfx)/config.h
-+# when compiling the tests, which will throw an error if some special macros
-+# (such as __OPTIMIZE__ and IS_IN_build) aren't defined.  To avoid this, we
-+# tell gcc to define IS_IN_build.
-+CFLAGS-printers-tests := -O0 -ggdb3 -DIS_IN_build
-+
- ifeq (yes,$(build-shared))
-+# These indicate whether to link using the built ld.so or the installed one.
-+installed-rtld-LDFLAGS = -Wl,-dynamic-linker=$(rtlddir)/$(rtld-installed-name)
-+built-rtld-LDFLAGS = -Wl,-dynamic-linker=$(elf-objpfx)ld.so
-+
- ifndef rtld-LDFLAGS
--rtld-LDFLAGS = -Wl,-dynamic-linker=$(rtlddir)/$(rtld-installed-name)
-+rtld-LDFLAGS = $(installed-rtld-LDFLAGS)
- endif
-+
- ifndef rtld-tests-LDFLAGS
- ifeq (yes,$(build-hardcoded-path-in-tests))
--rtld-tests-LDFLAGS = -Wl,-dynamic-linker=$(elf-objpfx)ld.so
-+rtld-tests-LDFLAGS = $(built-rtld-LDFLAGS)
- else
--rtld-tests-LDFLAGS = $(rtld-LDFLAGS)
--endif
--endif
--endif
-+rtld-tests-LDFLAGS = $(installed-rtld-LDFLAGS)
-+endif  # build-hardcoded-path-in-tests
-+endif  # rtld-tests-LDFLAGS
-+
-+endif  # build-shared
-+
- ifndef link-libc
- ifeq (yes,$(build-shared))
- # We need the versioned name of libc.so in the deps of $(others) et al
- # so that the symlink to libc.so is created before anything tries to
- # run the linked programs.
-+link-libc-rpath = -Wl,-rpath=$(rpath-link)
- link-libc-rpath-link = -Wl,-rpath-link=$(rpath-link)
-+
- ifeq (yes,$(build-hardcoded-path-in-tests))
--link-libc-tests-rpath-link = -Wl,-rpath=$(rpath-link)
-+link-libc-tests-rpath-link = $(link-libc-rpath)
- else
- link-libc-tests-rpath-link = $(link-libc-rpath-link)
--endif
-+endif  # build-hardcoded-path-in-tests
-+
- link-libc-before-gnulib = $(common-objpfx)libc.so$(libc.so-version) \
- 			  $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
- 			  $(as-needed) $(elf-objpfx)ld.so \
- 			  $(no-as-needed)
- link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib)
-+
-+link-libc-tests-after-rpath-link = $(link-libc-before-gnulib) $(gnulib-tests)
- link-libc-tests = $(link-libc-tests-rpath-link) \
--		  $(link-libc-before-gnulib) $(gnulib-tests)
-+		  $(link-libc-tests-after-rpath-link)
-+# Pretty printer test programs always require rpath instead of rpath-link.
-+link-libc-printers-tests = $(link-libc-rpath) \
-+			   $(link-libc-tests-after-rpath-link)
-+
- # This is how to find at build-time things that will be installed there.
- rpath-dirs = math elf dlfcn nss nis rt resolv crypt mathvec
- rpath-link = \
- $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%)))
--else
-+else  # build-static
- link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a $(gnulib)
- link-libc-tests = $(common-objpfx)libc.a $(otherlibs) $(gnulib-tests) $(common-objpfx)libc.a $(gnulib-tests)
--endif
--endif
-+endif  # build-shared
-+endif  # link-libc
- 
- # Differences in the linkers on the various platforms.
- LDFLAGS-rpath-ORIGIN = -Wl,-rpath,'$$ORIGIN'
-diff --git a/Makerules b/Makerules
-index be3c11b..b7e0f59 100644
---- a/Makerules
-+++ b/Makerules
-@@ -214,6 +214,52 @@ sed-remove-dotdot := -e 's@  *\([^ 	\/$$][^ 	\]*\)@ $$(..)\1@g' \
- 		     -e 's@^\([^ 	\/$$][^ 	\]*\)@$$(..)\1@g'
- endif
- 
-+ifdef gen-py-const-headers
-+# We'll use a static pattern rule to match .pysym files with their
-+# corresponding generated .py files.
-+# The generated .py files go in the submodule's dir in the glibc build dir.
-+py-const-files := $(patsubst %.pysym,%.py,$(gen-py-const-headers))
-+py-const-dir := $(objpfx)
-+py-const := $(addprefix $(py-const-dir),$(py-const-files))
-+py-const-script := $(..)scripts/gen-py-const.awk
-+
-+# This is a hack we use to generate .py files with constants for Python
-+# pretty printers.  It works the same way as gen-as-const.
-+# See scripts/gen-py-const.awk for details on how the awk | gcc mechanism
-+# works.
-+#
-+# $@.tmp and $@.tmp2 are temporary files we use to store the partial contents
-+# of the target file.  We do this instead of just writing on $@ because, if the
-+# build process terminates prematurely, re-running Make wouldn't run this rule
-+# since Make would see that the target file already exists (despite it being
-+# incomplete).
-+#
-+# The sed line replaces "@name@SOME_NAME@value@SOME_VALUE@" strings from the
-+# output of 'gcc -S' with "SOME_NAME = SOME_VALUE" strings.
-+# The '-n' option, combined with the '/p' command, makes sed output only the
-+# modified lines instead of the whole input file.  The output is redirected
-+# to a .py file; we'll import it in the pretty printers file to read
-+# the constants generated by gen-py-const.awk.
-+# The regex has two capturing groups, for SOME_NAME and SOME_VALUE
-+# respectively.  Notice SOME_VALUE may be prepended by a special character,
-+# depending on the assembly syntax (e.g. immediates are prefixed by a '$'
-+# in AT&T x86, and by a '#' in ARM).  We discard it using a complemented set
-+# before the second capturing group.
-+$(py-const): $(py-const-dir)%.py: %.pysym $(py-const-script) \
-+	     $(common-before-compile)
-+	$(make-target-directory)
-+	$(AWK) -f $(py-const-script) $< \
-+	       | $(CC) -S -o $@.tmp $(CFLAGS) $(CPPFLAGS) -x c -
-+	echo '# GENERATED FILE\n' > $@.tmp2
-+	echo '# Constant definitions for pretty printers.' >> $@.tmp2
-+	echo '# See gen-py-const.awk for details.\n' >> $@.tmp2
-+	sed -n -r 's/^.*@name@([^@]+)@value@[^[:xdigit:]Xx-]*([[:xdigit:]Xx-]+)@.*/\1 = \2/p' \
-+	    $@.tmp >> $@.tmp2
-+	mv -f $@.tmp2 $@
-+	rm -f $@.tmp
-+
-+generated += $(py-const)
-+endif  # gen-py-const-headers
- 
- ifdef gen-as-const-headers
- # Generating headers for assembly constants.
-diff --git a/NEWS b/NEWS
-index b0447e7..3002773 100644
---- a/NEWS
-+++ b/NEWS
-@@ -5,6 +5,12 @@ See the end for copying conditions.
- Please send GNU C library bug reports via <http://sourceware.org/bugzilla/>
- using `glibc' in the "product" field.
- 
-+
-+* GDB pretty printers have been added for mutex and condition variable
-+  structures in POSIX Threads. When installed and loaded in gdb these pretty
-+  printers show various pthread variables in human-readable form when read
-+  using the 'print' or 'display' commands in gdb.
-+
- Version 2.24
- 
- * The minimum Linux kernel version that this version of the GNU C Library
-diff --git a/README.pretty-printers b/README.pretty-printers
-new file mode 100644
-index 0000000..8662900
---- /dev/null
-+++ b/README.pretty-printers
-@@ -0,0 +1,169 @@
-+README for the glibc Python pretty printers
-+===========================================
-+
-+Pretty printers are gdb extensions that allow it to print useful, human-readable
-+information about a program's variables.  For example, for a pthread_mutex_t
-+gdb would usually output something like this:
-+
-+(gdb) print mutex
-+$1 = {
-+  __data = {
-+    __lock = 22020096,
-+    __count = 0,
-+    __owner = 0,
-+    __nusers = 0,
-+    __kind = 576,
-+    __spins = 0,
-+    __elision = 0,
-+    __list = {
-+      __prev = 0x0,
-+      __next = 0x0
-+    }
-+  },
-+  __size = "\000\000P\001", '\000' <repeats 12 times>, "@\002", '\000' <repeats 21 times>,
-+  __align = 22020096
-+}
-+
-+However, with a pretty printer gdb will output something like this:
-+
-+(gdb) print mutex
-+$1 = pthread_mutex_t = {
-+  Type = Normal,
-+  Status = Unlocked,
-+  Robust = No,
-+  Shared = No,
-+  Protocol = Priority protect,
-+  Priority ceiling = 42
-+}
-+
-+Before printing a value, gdb will first check if there's a pretty printer
-+registered for it.  If there is, it'll use it, otherwise it'll print the value
-+as usual.  Pretty printers can be registered in various ways; for our purposes
-+we register them for the current objfile by calling
-+gdb.printing.register_pretty_printer().
-+
-+Currently our printers are based on gdb.RegexpCollectionPrettyPrinter, which
-+means they'll be triggered if the type of the variable we're printing matches
-+a given regular expression.  For example, MutexPrinter will be triggered if
-+our variable's type matches the regexp '^pthread_mutex_t$'.
-+
-+Besides the printers themselves, each module may have a constants file which the
-+printers will import.  These constants are generated from C headers during the
-+build process, and need to be in the Python search path when loading the
-+printers.
-+
-+
-+Installing and loading
-+----------------------
-+
-+The pretty printers and their constant files may be installed in different paths
-+for each distro, though gdb should be able to automatically load them by itself.
-+When in doubt, you can use the 'info pretty-printer' gdb command to list the
-+loaded pretty printers.
-+
-+If the printers aren't automatically loaded for some reason, you should add the
-+following to your .gdbinit:
-+
-+python
-+import sys
-+sys.path.insert(0, '/path/to/constants/file/directory')
-+end
-+
-+source /path/to/printers.py
-+
-+If you're building glibc manually, '/path/to/constants/file/directory' should be
-+'/path/to/glibc-build/submodule', where 'submodule' is e.g. nptl.
-+
-+
-+Testing
-+-------
-+
-+The pretty printers come with a small test suite based on PExpect, which is a
-+Python module with Expect-like features for spawning and controlling interactive
-+programs.  Each printer has a corresponding C program and a Python script
-+that uses PExpect to drive gdb through the program and compare its output to
-+the expected printer's.
-+
-+The tests run on the glibc host, which is assumed to have both gdb and PExpect;
-+if any of those is absent the tests will fail with code 77 (UNSUPPORTED).
-+Native builds can be tested simply by doing 'make check'; cross builds must use
-+cross-test-ssh.sh as test-wrapper, like this:
-+
-+make test-wrapper='/path/to/scripts/cross-test-ssh.sh user@host' check
-+
-+(Remember to share the build system's filesystem with the glibc host's through
-+NFS or something similar).
-+
-+Running 'make check' on a cross build will only compile the test programs,
-+without running the scripts.
-+
-+
-+Adding new pretty printers
-+--------------------------
-+
-+Adding new pretty printers to glibc requires following these steps:
-+
-+1. Identify which constants must be generated from C headers, and write the
-+corresponding .pysym file.  See scripts/gen-py-const.awk for more information
-+on how this works.  The name of the .pysym file must be added to the
-+'gen-py-const-headers' variable in your submodule's Makefile (without the .pysym
-+extension).
-+
-+2. Write the pretty printer code itself.  For this you can follow the gdb
-+Python API documentation, and use the existing printers as examples.  The printer
-+code must import the generated constants file (which will have the same name
-+as your .pysym file).  The names of the pretty printer files must be added
-+to the 'pretty-printers' variable in your submodule's Makefile (without the .py
-+extension).
-+
-+3. Write the unit tests for your pretty printers.  The build system calls each
-+test script passing it the paths to the test program source, the test program
-+binary, and the printer files you added to 'pretty-printers' in the previous
-+step.  The test scripts, in turn, must import scripts/test_printers_common
-+and call the init_test function passing it, among other things, the name of the
-+set of pretty printers to enable (as seen by running 'info pretty-printer').
-+You can use the existing unit tests as examples.
-+
-+4. Add the names of the pretty printer tests to the 'tests-printers' variable
-+in your submodule's Makefile (without extensions).  In addition, for each test
-+program you must define a corresponding CFLAGS-* variable and set it to
-+$(CFLAGS-printers-tests) to ensure they're compiled correctly.  For example,
-+test-foo-printer.c requires the following:
-+
-+CFLAGS-test-foo-printer.c := $(CFLAGS-printers-tests)
-+
-+Finally, if your programs need to be linked with a specific library, you can add
-+its name to the 'tests-printers-libs' variable in your submodule's Makefile.
-+
-+
-+Known issues
-+------------
-+
-+* Pretty printers are inherently coupled to the code they're targetting, thus
-+any changes to the target code must also update the corresponding printers.
-+On the plus side, the printer code itself may serve as a kind of documentation
-+for the target code.
-+
-+* Older versions of the gdb Python API have a bug where
-+gdb.RegexpCollectionPrettyPrinter would not be able to get a value's real type
-+if it was typedef'd.  This would cause gdb to ignore the pretty printers for
-+types like pthread_mutex_t, which is defined as:
-+
-+typedef union
-+{
-+  ...
-+} pthread_mutex_t;
-+
-+This was fixed in commit 1b588015839caafc608a6944a78aea170f5fb2f6, and released
-+as part of gdb 7.8.  However, typedef'ing an already typedef'd type may cause
-+a similar issue, e.g.:
-+
-+typedef pthread_mutex_t mutex;
-+mutex a_mutex;
-+
-+Here, trying to print a_mutex won't trigger the pthread_mutex_t printer.
-+
-+* The test programs must be compiled without optimizations.  This is necessary
-+because the test scripts rely on the C code structure being preserved when
-+stepping through the programs.  Things like aggressive instruction reordering
-+or optimizing variables out may make this kind of testing impossible.
-diff --git a/Rules b/Rules
-index 8306d36..10a6479 100644
---- a/Rules
-+++ b/Rules
-@@ -85,16 +85,27 @@ common-generated += dummy.o dummy.c
- 
- .PHONY: others tests bench bench-build
- 
-+# Test programs for the pretty printers.
-+tests-printers-programs := $(addprefix $(objpfx),$(tests-printers))
-+
-+# .out files with the output of running the pretty printer tests.
-+tests-printers-out := $(patsubst %,$(objpfx)%.out,$(tests-printers))
-+
- ifeq ($(build-programs),yes)
- others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs))
- else
- others: $(addprefix $(objpfx),$(extra-objs))
- endif
-+
-+# Generate constant files for Python pretty printers if required.
-+others: $(py-const)
-+
- ifeq ($(run-built-tests),no)
--tests: $(addprefix $(objpfx),$(tests) $(test-srcs)) $(tests-special)
-+tests: $(addprefix $(objpfx),$(tests) $(test-srcs)) $(tests-special) \
-+       $(tests-printers-programs)
- xtests: tests $(xtests-special)
- else
--tests: $(tests:%=$(objpfx)%.out) $(tests-special)
-+tests: $(tests:%=$(objpfx)%.out) $(tests-special) $(tests-printers-out)
- xtests: tests $(xtests:%=$(objpfx)%.out) $(xtests-special)
- endif
- 
-@@ -102,7 +113,8 @@ tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special))
- xtests-special-notdir = $(patsubst $(objpfx)%, %, $(xtests-special))
- tests:
- 	$(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \
--	  $(sort $(tests) $(tests-special-notdir:.out=)) \
-+	  $(sort $(tests) $(tests-special-notdir:.out=) \
-+	  $(tests-printers)) \
- 	  > $(objpfx)subdir-tests.sum
- xtests:
- 	$(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \
-@@ -212,6 +224,32 @@ endif
- 
- endif	# tests
- 
-+ifneq "$(strip $(tests-printers))" ""
-+# We're defining this here for now; later it'll be defined at configure time
-+# inside Makeconfig.
-+PYTHON := python
-+
-+# Static pattern rule for building the test programs for the pretty printers.
-+$(tests-printers-programs): %: %.o $(tests-printers-libs) \
-+  $(sort $(filter $(common-objpfx)lib%,$(link-libc-static-tests))) \
-+  $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
-+	$(+link-printers-tests)
-+
-+# Add the paths to the generated constants file and test_common_printers.py
-+# to PYTHONPATH so the test scripts can find them.
-+py-env := PYTHONPATH=$(py-const-dir):$(..)scripts:$${PYTHONPATH}
-+
-+# Static pattern rule that matches the test-* targets to their .c and .py
-+# prerequisites.  It'll run the corresponding test script for each test program
-+# we compiled and place its output in the corresponding .out file.
-+# The pretty printer files and test_common_printers.py must be present for all.
-+$(tests-printers-out): $(objpfx)%.out: $(objpfx)% %.py %.c $(pretty-printers) \
-+		       $(..)scripts/test_printers_common.py
-+	$(test-wrapper-env) $(py-env) \
-+	    $(PYTHON) $*.py $*.c $(objpfx)$* $(pretty-printers) > $@; \
-+	$(evaluate-test)
-+endif
-+
- 
- .PHONY: distclean realclean subdir_distclean subdir_realclean \
- 	subdir_clean subdir_mostlyclean subdir_testclean
-diff --git a/manual/install.texi b/manual/install.texi
-index 79ee45f..468479e 100644
---- a/manual/install.texi
-+++ b/manual/install.texi
-@@ -256,6 +256,36 @@ occurred.  You can specify @samp{stop-on-test-failure=y} when running
- @code{make check} to make the test run stop and exit with an error
- status immediately when a failure occurs.
- 
-+The @glibcadj{} pretty printers come with their own set of scripts for testing,
-+which run together with the rest of the testsuite through @code{make check}.
-+These scripts require the following tools to run successfully:
-+
-+@itemize @bullet
-+@item
-+Python 2.7.6/3.4.3 or later
-+
-+Python is required for running the printers' test scripts.
-+
-+@item PExpect 4.0
-+
-+The printer tests drive GDB through test programs and compare its output
-+to the printers'.  PExpect is used to capture the output of GDB, and should be
-+compatible with the Python version in your system.
-+
-+@item
-+GDB 7.8 or later with support for Python 2.7.6/3.4.3 or later
-+
-+GDB itself needs to be configured with Python support in order to use the
-+pretty printers.  Notice that your system having Python available doesn't imply
-+that GDB supports it, nor that your system's Python and GDB's have the same
-+version.
-+@end itemize
-+
-+@noindent
-+If these tools are absent, the printer tests will report themselves as
-+@code{UNSUPPORTED}.  Notice that some of the printer tests require @theglibc{}
-+to be compiled with debugging symbols.
-+
- To format the @cite{GNU C Library Reference Manual} for printing, type
- @w{@code{make dvi}}.  You need a working @TeX{} installation to do
- this.  The distribution builds the on-line formatted version of the
-diff --git a/nptl/Makefile b/nptl/Makefile
-index 7dec4ed..49f6ba6 100644
---- a/nptl/Makefile
-+++ b/nptl/Makefile
-@@ -308,6 +308,24 @@ gen-as-const-headers = pthread-errnos.sym \
- 		       unwindbuf.sym \
- 		       lowlevelrobustlock.sym pthread-pi-defines.sym
- 
-+gen-py-const-headers := nptl_lock_constants.pysym
-+pretty-printers := nptl-printers.py
-+tests-printers := test-mutexattr-printers test-mutex-printers \
-+		  test-condattr-printers test-cond-printers \
-+		  test-rwlockattr-printers test-rwlock-printers
-+
-+CFLAGS-test-mutexattr-printers.c := $(CFLAGS-printers-tests)
-+CFLAGS-test-mutex-printers.c := $(CFLAGS-printers-tests)
-+CFLAGS-test-condattr-printers.c := $(CFLAGS-printers-tests)
-+CFLAGS-test-cond-printers.c := $(CFLAGS-printers-tests)
-+CFLAGS-test-rwlockattr-printers.c := $(CFLAGS-printers-tests)
-+CFLAGS-test-rwlock-printers.c := $(CFLAGS-printers-tests)
-+
-+ifeq ($(build-shared),yes)
-+tests-printers-libs := $(shared-thread-library)
-+else
-+tests-printers-libs := $(static-thread-library)
-+endif
- 
- LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
- 
-diff --git a/nptl/nptl-printers.py b/nptl/nptl-printers.py
-new file mode 100644
-index 0000000..e402f23
---- /dev/null
-+++ b/nptl/nptl-printers.py
-@@ -0,0 +1,633 @@
-+# Pretty printers for the NPTL lock types.
-+#
-+# Copyright (C) 2016 Free Software Foundation, Inc.
-+# This file is part of the GNU C Library.
-+#
-+# The GNU C Library is free software; you can redistribute it and/or
-+# modify it under the terms of the GNU Lesser General Public
-+# License as published by the Free Software Foundation; either
-+# version 2.1 of the License, or (at your option) any later version.
-+#
-+# The GNU C Library is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+# Lesser General Public License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public
-+# License along with the GNU C Library; if not, see
-+# <http://www.gnu.org/licenses/>.
-+
-+"""This file contains the gdb pretty printers for the following types:
-+
-+    * pthread_mutex_t
-+    * pthread_mutexattr_t
-+    * pthread_cond_t
-+    * pthread_condattr_t
-+    * pthread_rwlock_t
-+    * pthread_rwlockattr_t
-+
-+You can check which printers are registered and enabled by issuing the
-+'info pretty-printer' gdb command.  Printers should trigger automatically when
-+trying to print a variable of one of the types mentioned above.
-+"""
-+
-+from __future__ import print_function
-+
-+import gdb
-+import gdb.printing
-+from nptl_lock_constants import *
-+
-+MUTEX_TYPES = {
-+    PTHREAD_MUTEX_NORMAL: ('Type', 'Normal'),
-+    PTHREAD_MUTEX_RECURSIVE: ('Type', 'Recursive'),
-+    PTHREAD_MUTEX_ERRORCHECK: ('Type', 'Error check'),
-+    PTHREAD_MUTEX_ADAPTIVE_NP: ('Type', 'Adaptive')
-+}
-+
-+class MutexPrinter(object):
-+    """Pretty printer for pthread_mutex_t."""
-+
-+    def __init__(self, mutex):
-+        """Initialize the printer's internal data structures.
-+
-+        Args:
-+            mutex: A gdb.value representing a pthread_mutex_t.
-+        """
-+
-+        data = mutex['__data']
-+        self.lock = data['__lock']
-+        self.count = data['__count']
-+        self.owner = data['__owner']
-+        self.kind = data['__kind']
-+        self.values = []
-+        self.read_values()
-+
-+    def to_string(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_mutex_t.
-+        """
-+
-+        return 'pthread_mutex_t'
-+
-+    def children(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_mutex_t.
-+        """
-+
-+        return self.values
-+
-+    def read_values(self):
-+        """Read the mutex's info and store it in self.values.
-+
-+        The data contained in self.values will be returned by the Iterator
-+        created in self.children.
-+        """
-+
-+        self.read_type()
-+        self.read_status()
-+        self.read_attributes()
-+        self.read_misc_info()
-+
-+    def read_type(self):
-+        """Read the mutex's type."""
-+
-+        mutex_type = self.kind & PTHREAD_MUTEX_KIND_MASK
-+
-+        # mutex_type must be casted to int because it's a gdb.Value
-+        self.values.append(MUTEX_TYPES[int(mutex_type)])
-+
-+    def read_status(self):
-+        """Read the mutex's status.
-+
-+        For architectures which support lock elision, this method reads
-+        whether the mutex appears as locked in memory (i.e. it may show it as
-+        unlocked even after calling pthread_mutex_lock).
-+        """
-+
-+        if self.kind == PTHREAD_MUTEX_DESTROYED:
-+            self.values.append(('Status', 'Destroyed'))
-+        elif self.kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP:
-+            self.read_status_robust()
-+        else:
-+            self.read_status_no_robust()
-+
-+    def read_status_robust(self):
-+        """Read the status of a robust mutex.
-+
-+        In glibc robust mutexes are implemented in a very different way than
-+        non-robust ones.  This method reads their locking status,
-+        whether it may have waiters, their registered owner (if any),
-+        whether the owner is alive or not, and the status of the state
-+        they're protecting.
-+        """
-+
-+        if self.lock == PTHREAD_MUTEX_UNLOCKED:
-+            self.values.append(('Status', 'Unlocked'))
-+        else:
-+            if self.lock & FUTEX_WAITERS:
-+                self.values.append(('Status', 'Locked, possibly with waiters'))
-+            else:
-+                self.values.append(('Status',
-+                                    'Locked, possibly with no waiters'))
-+
-+            if self.lock & FUTEX_OWNER_DIED:
-+                self.values.append(('Owner ID', '%d (dead)' % self.owner))
-+            else:
-+                self.values.append(('Owner ID', self.lock & FUTEX_TID_MASK))
-+
-+        if self.owner == PTHREAD_MUTEX_INCONSISTENT:
-+            self.values.append(('State protected by this mutex',
-+                                'Inconsistent'))
-+        elif self.owner == PTHREAD_MUTEX_NOTRECOVERABLE:
-+            self.values.append(('State protected by this mutex',
-+                                'Not recoverable'))
-+
-+    def read_status_no_robust(self):
-+        """Read the status of a non-robust mutex.
-+
-+        Read info on whether the mutex is locked, if it may have waiters
-+        and its owner (if any).
-+        """
-+
-+        lock_value = self.lock
-+
-+        if self.kind & PTHREAD_MUTEX_PRIO_PROTECT_NP:
-+            lock_value &= ~(PTHREAD_MUTEX_PRIO_CEILING_MASK)
-+
-+        if lock_value == PTHREAD_MUTEX_UNLOCKED:
-+            self.values.append(('Status', 'Unlocked'))
-+        else:
-+            if self.kind & PTHREAD_MUTEX_PRIO_INHERIT_NP:
-+                waiters = self.lock & FUTEX_WAITERS
-+                owner = self.lock & FUTEX_TID_MASK
-+            else:
-+                # Mutex protocol is PP or none
-+                waiters = (self.lock != PTHREAD_MUTEX_LOCKED_NO_WAITERS)
-+                owner = self.owner
-+
-+            if waiters:
-+                self.values.append(('Status', 'Locked, possibly with waiters'))
-+            else:
-+                self.values.append(('Status',
-+                                    'Locked, possibly with no waiters'))
-+
-+            self.values.append(('Owner ID', owner))
-+
-+    def read_attributes(self):
-+        """Read the mutex's attributes."""
-+
-+        if self.kind != PTHREAD_MUTEX_DESTROYED:
-+            if self.kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP:
-+                self.values.append(('Robust', 'Yes'))
-+            else:
-+                self.values.append(('Robust', 'No'))
-+
-+            # In glibc, robust mutexes always have their pshared flag set to
-+            # 'shared' regardless of what the pshared flag of their
-+            # mutexattr was.  Therefore a robust mutex will act as shared
-+            # even if it was initialized with a 'private' mutexattr.
-+            if self.kind & PTHREAD_MUTEX_PSHARED_BIT:
-+                self.values.append(('Shared', 'Yes'))
-+            else:
-+                self.values.append(('Shared', 'No'))
-+
-+            if self.kind & PTHREAD_MUTEX_PRIO_INHERIT_NP:
-+                self.values.append(('Protocol', 'Priority inherit'))
-+            elif self.kind & PTHREAD_MUTEX_PRIO_PROTECT_NP:
-+                prio_ceiling = ((self.lock & PTHREAD_MUTEX_PRIO_CEILING_MASK)
-+                                >> PTHREAD_MUTEX_PRIO_CEILING_SHIFT)
-+
-+                self.values.append(('Protocol', 'Priority protect'))
-+                self.values.append(('Priority ceiling', prio_ceiling))
-+            else:
-+                # PTHREAD_PRIO_NONE
-+                self.values.append(('Protocol', 'None'))
-+
-+    def read_misc_info(self):
-+        """Read miscellaneous info on the mutex.
-+
-+        For now this reads the number of times a recursive mutex was locked
-+        by the same thread.
-+        """
-+
-+        mutex_type = self.kind & PTHREAD_MUTEX_KIND_MASK
-+
-+        if mutex_type == PTHREAD_MUTEX_RECURSIVE and self.count > 1:
-+            self.values.append(('Times locked recursively', self.count))
-+
-+class MutexAttributesPrinter(object):
-+    """Pretty printer for pthread_mutexattr_t.
-+
-+    In the NPTL this is a type that's always casted to struct pthread_mutexattr
-+    which has a single 'mutexkind' field containing the actual attributes.
-+    """
-+
-+    def __init__(self, mutexattr):
-+        """Initialize the printer's internal data structures.
-+
-+        Args:
-+            mutexattr: A gdb.value representing a pthread_mutexattr_t.
-+        """
-+
-+        self.values = []
-+
-+        try:
-+            mutexattr_struct = gdb.lookup_type('struct pthread_mutexattr')
-+            self.mutexattr = mutexattr.cast(mutexattr_struct)['mutexkind']
-+            self.read_values()
-+        except gdb.error:
-+            # libpthread doesn't have debug symbols, thus we can't find the
-+            # real struct type.  Just print the union members.
-+            self.values.append(('__size', mutexattr['__size']))
-+            self.values.append(('__align', mutexattr['__align']))
-+
-+    def to_string(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_mutexattr_t.
-+        """
-+
-+        return 'pthread_mutexattr_t'
-+
-+    def children(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_mutexattr_t.
-+        """
-+
-+        return self.values
-+
-+    def read_values(self):
-+        """Read the mutexattr's info and store it in self.values.
-+
-+        The data contained in self.values will be returned by the Iterator
-+        created in self.children.
-+        """
-+
-+        mutexattr_type = (self.mutexattr
-+                          & ~PTHREAD_MUTEXATTR_FLAG_BITS
-+                          & ~PTHREAD_MUTEX_NO_ELISION_NP)
-+
-+        # mutexattr_type must be casted to int because it's a gdb.Value
-+        self.values.append(MUTEX_TYPES[int(mutexattr_type)])
-+
-+        if self.mutexattr & PTHREAD_MUTEXATTR_FLAG_ROBUST:
-+            self.values.append(('Robust', 'Yes'))
-+        else:
-+            self.values.append(('Robust', 'No'))
-+
-+        if self.mutexattr & PTHREAD_MUTEXATTR_FLAG_PSHARED:
-+            self.values.append(('Shared', 'Yes'))
-+        else:
-+            self.values.append(('Shared', 'No'))
-+
-+        protocol = ((self.mutexattr & PTHREAD_MUTEXATTR_PROTOCOL_MASK) >>
-+                    PTHREAD_MUTEXATTR_PROTOCOL_SHIFT)
-+
-+        if protocol == PTHREAD_PRIO_NONE:
-+            self.values.append(('Protocol', 'None'))
-+        elif protocol == PTHREAD_PRIO_INHERIT:
-+            self.values.append(('Protocol', 'Priority inherit'))
-+        elif protocol == PTHREAD_PRIO_PROTECT:
-+            self.values.append(('Protocol', 'Priority protect'))
-+
-+CLOCK_IDS = {
-+    CLOCK_REALTIME: 'CLOCK_REALTIME',
-+    CLOCK_MONOTONIC: 'CLOCK_MONOTONIC',
-+    CLOCK_PROCESS_CPUTIME_ID: 'CLOCK_PROCESS_CPUTIME_ID',
-+    CLOCK_THREAD_CPUTIME_ID: 'CLOCK_THREAD_CPUTIME_ID',
-+    CLOCK_MONOTONIC_RAW: 'CLOCK_MONOTONIC_RAW',
-+    CLOCK_REALTIME_COARSE: 'CLOCK_REALTIME_COARSE',
-+    CLOCK_MONOTONIC_COARSE: 'CLOCK_MONOTONIC_COARSE'
-+}
-+
-+class ConditionVariablePrinter(object):
-+    """Pretty printer for pthread_cond_t."""
-+
-+    def __init__(self, cond):
-+        """Initialize the printer's internal data structures.
-+
-+        Args:
-+            cond: A gdb.value representing a pthread_cond_t.
-+        """
-+
-+        # Since PTHREAD_COND_SHARED is an integer, we need to cast it to void *
-+        # to be able to compare it to the condvar's __data.__mutex member.
-+        #
-+        # While it looks like self.shared_value should be a class variable,
-+        # that would result in it having an incorrect size if we're loading
-+        # these printers through .gdbinit for a 64-bit objfile in AMD64.
-+        # This is because gdb initially assumes the pointer size to be 4 bytes,
-+        # and only sets it to 8 after loading the 64-bit objfiles.  Since
-+        # .gdbinit runs before any objfiles are loaded, this would effectively
-+        # make self.shared_value have a size of 4, thus breaking later
-+        # comparisons with pointers whose types are looked up at runtime.
-+        void_ptr_type = gdb.lookup_type('void').pointer()
-+        self.shared_value = gdb.Value(PTHREAD_COND_SHARED).cast(void_ptr_type)
-+
-+        data = cond['__data']
-+        self.total_seq = data['__total_seq']
-+        self.mutex = data['__mutex']
-+        self.nwaiters = data['__nwaiters']
-+        self.values = []
-+
-+        self.read_values()
-+
-+    def to_string(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_cond_t.
-+        """
-+
-+        return 'pthread_cond_t'
-+
-+    def children(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_cond_t.
-+        """
-+
-+        return self.values
-+
-+    def read_values(self):
-+        """Read the condvar's info and store it in self.values.
-+
-+        The data contained in self.values will be returned by the Iterator
-+        created in self.children.
-+        """
-+
-+        self.read_status()
-+        self.read_attributes()
-+        self.read_mutex_info()
-+
-+    def read_status(self):
-+        """Read the status of the condvar.
-+
-+        This method reads whether the condvar is destroyed and how many threads
-+        are waiting for it.
-+        """
-+
-+        if self.total_seq == PTHREAD_COND_DESTROYED:
-+            self.values.append(('Status', 'Destroyed'))
-+
-+        self.values.append(('Threads waiting for this condvar',
-+                            self.nwaiters >> COND_NWAITERS_SHIFT))
-+
-+    def read_attributes(self):
-+        """Read the condvar's attributes."""
-+
-+        clock_id = self.nwaiters & ((1 << COND_NWAITERS_SHIFT) - 1)
-+
-+        # clock_id must be casted to int because it's a gdb.Value
-+        self.values.append(('Clock ID', CLOCK_IDS[int(clock_id)]))
-+
-+        shared = (self.mutex == self.shared_value)
-+
-+        if shared:
-+            self.values.append(('Shared', 'Yes'))
-+        else:
-+            self.values.append(('Shared', 'No'))
-+
-+    def read_mutex_info(self):
-+        """Read the data of the mutex this condvar is bound to.
-+
-+        A pthread_cond_t's __data.__mutex member is a void * which
-+        must be casted to pthread_mutex_t *.  For shared condvars, this
-+        member isn't recorded and has a special value instead.
-+        """
-+
-+        if self.mutex and self.mutex != self.shared_value:
-+            mutex_type = gdb.lookup_type('pthread_mutex_t')
-+            mutex = self.mutex.cast(mutex_type.pointer()).dereference()
-+
-+            self.values.append(('Mutex', mutex))
-+
-+class ConditionVariableAttributesPrinter(object):
-+    """Pretty printer for pthread_condattr_t.
-+
-+    In the NPTL this is a type that's always casted to struct pthread_condattr,
-+    which has a single 'value' field containing the actual attributes.
-+    """
-+
-+    def __init__(self, condattr):
-+        """Initialize the printer's internal data structures.
-+
-+        Args:
-+            condattr: A gdb.value representing a pthread_condattr_t.
-+        """
-+
-+        self.values = []
-+
-+        try:
-+            condattr_struct = gdb.lookup_type('struct pthread_condattr')
-+            self.condattr = condattr.cast(condattr_struct)['value']
-+            self.read_values()
-+        except gdb.error:
-+            # libpthread doesn't have debug symbols, thus we can't find the
-+            # real struct type.  Just print the union members.
-+            self.values.append(('__size', condattr['__size']))
-+            self.values.append(('__align', condattr['__align']))
-+
-+    def to_string(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_condattr_t.
-+        """
-+
-+        return 'pthread_condattr_t'
-+
-+    def children(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_condattr_t.
-+        """
-+
-+        return self.values
-+
-+    def read_values(self):
-+        """Read the condattr's info and store it in self.values.
-+
-+        The data contained in self.values will be returned by the Iterator
-+        created in self.children.
-+        """
-+
-+        clock_id = self.condattr & ((1 << COND_NWAITERS_SHIFT) - 1)
-+
-+        # clock_id must be casted to int because it's a gdb.Value
-+        self.values.append(('Clock ID', CLOCK_IDS[int(clock_id)]))
-+
-+        if self.condattr & 1:
-+            self.values.append(('Shared', 'Yes'))
-+        else:
-+            self.values.append(('Shared', 'No'))
-+
-+class RWLockPrinter(object):
-+    """Pretty printer for pthread_rwlock_t."""
-+
-+    def __init__(self, rwlock):
-+        """Initialize the printer's internal data structures.
-+
-+        Args:
-+            rwlock: A gdb.value representing a pthread_rwlock_t.
-+        """
-+
-+        data = rwlock['__data']
-+        self.readers = data['__nr_readers']
-+        self.queued_readers = data['__nr_readers_queued']
-+        self.queued_writers = data['__nr_writers_queued']
-+        self.writer_id = data['__writer']
-+        self.shared = data['__shared']
-+        self.prefers_writers = data['__flags']
-+        self.values = []
-+        self.read_values()
-+
-+    def to_string(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_rwlock_t.
-+        """
-+
-+        return 'pthread_rwlock_t'
-+
-+    def children(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_rwlock_t.
-+        """
-+
-+        return self.values
-+
-+    def read_values(self):
-+        """Read the rwlock's info and store it in self.values.
-+
-+        The data contained in self.values will be returned by the Iterator
-+        created in self.children.
-+        """
-+
-+        self.read_status()
-+        self.read_attributes()
-+
-+    def read_status(self):
-+        """Read the status of the rwlock."""
-+
-+        # Right now pthread_rwlock_destroy doesn't do anything, so there's no
-+        # way to check if an rwlock is destroyed.
-+
-+        if self.writer_id:
-+            self.values.append(('Status', 'Locked (Write)'))
-+            self.values.append(('Writer ID', self.writer_id))
-+        elif self.readers:
-+            self.values.append(('Status', 'Locked (Read)'))
-+            self.values.append(('Readers', self.readers))
-+        else:
-+            self.values.append(('Status', 'Unlocked'))
-+
-+        self.values.append(('Queued readers', self.queued_readers))
-+        self.values.append(('Queued writers', self.queued_writers))
-+
-+    def read_attributes(self):
-+        """Read the attributes of the rwlock."""
-+
-+        if self.shared:
-+            self.values.append(('Shared', 'Yes'))
-+        else:
-+            self.values.append(('Shared', 'No'))
-+
-+        if self.prefers_writers:
-+            self.values.append(('Prefers', 'Writers'))
-+        else:
-+            self.values.append(('Prefers', 'Readers'))
-+
-+class RWLockAttributesPrinter(object):
-+    """Pretty printer for pthread_rwlockattr_t.
-+
-+    In the NPTL this is a type that's always casted to
-+    struct pthread_rwlockattr, which has two fields ('lockkind' and 'pshared')
-+    containing the actual attributes.
-+    """
-+
-+    def __init__(self, rwlockattr):
-+        """Initialize the printer's internal data structures.
-+
-+        Args:
-+            rwlockattr: A gdb.value representing a pthread_rwlockattr_t.
-+        """
-+
-+        self.values = []
-+
-+        try:
-+            rwlockattr_struct = gdb.lookup_type('struct pthread_rwlockattr')
-+            self.rwlockattr = rwlockattr.cast(rwlockattr_struct)
-+            self.read_values()
-+        except gdb.error:
-+            # libpthread doesn't have debug symbols, thus we can't find the
-+            # real struct type.  Just print the union members.
-+            self.values.append(('__size', rwlockattr['__size']))
-+            self.values.append(('__align', rwlockattr['__align']))
-+
-+    def to_string(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_rwlockattr_t.
-+        """
-+
-+        return 'pthread_rwlockattr_t'
-+
-+    def children(self):
-+        """gdb API function.
-+
-+        This is called from gdb when we try to print a pthread_rwlockattr_t.
-+        """
-+
-+        return self.values
-+
-+    def read_values(self):
-+        """Read the rwlockattr's info and store it in self.values.
-+
-+        The data contained in self.values will be returned by the Iterator
-+        created in self.children.
-+        """
-+
-+        rwlock_type = self.rwlockattr['lockkind']
-+        shared = self.rwlockattr['pshared']
-+
-+        if shared == PTHREAD_PROCESS_SHARED:
-+            self.values.append(('Shared', 'Yes'))
-+        else:
-+            # PTHREAD_PROCESS_PRIVATE
-+            self.values.append(('Shared', 'No'))
-+
-+        if (rwlock_type == PTHREAD_RWLOCK_PREFER_READER_NP or
-+            rwlock_type == PTHREAD_RWLOCK_PREFER_WRITER_NP):
-+            # This is a known bug.  Using PTHREAD_RWLOCK_PREFER_WRITER_NP will
-+            # still make the rwlock prefer readers.
-+            self.values.append(('Prefers', 'Readers'))
-+        elif rwlock_type == PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP:
-+            self.values.append(('Prefers', 'Writers'))
-+
-+def register(objfile):
-+    """Register the pretty printers within the given objfile."""
-+
-+    printer = gdb.printing.RegexpCollectionPrettyPrinter('glibc-pthread-locks')
-+
-+    printer.add_printer('pthread_mutex_t', r'^pthread_mutex_t$',
-+                        MutexPrinter)
-+    printer.add_printer('pthread_mutexattr_t', r'^pthread_mutexattr_t$',
-+                        MutexAttributesPrinter)
-+    printer.add_printer('pthread_cond_t', r'^pthread_cond_t$',
-+                        ConditionVariablePrinter)
-+    printer.add_printer('pthread_condattr_t', r'^pthread_condattr_t$',
-+                        ConditionVariableAttributesPrinter)
-+    printer.add_printer('pthread_rwlock_t', r'^pthread_rwlock_t$',
-+                        RWLockPrinter)
-+    printer.add_printer('pthread_rwlockattr_t', r'^pthread_rwlockattr_t$',
-+                        RWLockAttributesPrinter)
-+
-+    if objfile == None:
-+        objfile = gdb
-+
-+    gdb.printing.register_pretty_printer(objfile, printer)
-+
-+register(gdb.current_objfile())
-diff --git a/nptl/nptl_lock_constants.pysym b/nptl/nptl_lock_constants.pysym
-new file mode 100644
-index 0000000..303ec61
---- /dev/null
-+++ b/nptl/nptl_lock_constants.pysym
-@@ -0,0 +1,75 @@
-+#include <pthreadP.h>
-+
-+-- Mutex types
-+PTHREAD_MUTEX_KIND_MASK          PTHREAD_MUTEX_KIND_MASK_NP
-+PTHREAD_MUTEX_NORMAL
-+PTHREAD_MUTEX_RECURSIVE          PTHREAD_MUTEX_RECURSIVE_NP
-+PTHREAD_MUTEX_ERRORCHECK         PTHREAD_MUTEX_ERRORCHECK_NP
-+PTHREAD_MUTEX_ADAPTIVE_NP
-+
-+-- Mutex status
-+-- These are hardcoded all over the code; there are no enums/macros for them.
-+PTHREAD_MUTEX_DESTROYED         -1
-+PTHREAD_MUTEX_UNLOCKED           0
-+PTHREAD_MUTEX_LOCKED_NO_WAITERS  1
-+
-+-- For robust mutexes
-+PTHREAD_MUTEX_INCONSISTENT
-+PTHREAD_MUTEX_NOTRECOVERABLE
-+FUTEX_OWNER_DIED
-+
-+-- For robust and PI mutexes
-+FUTEX_WAITERS
-+FUTEX_TID_MASK
-+
-+-- Mutex attributes
-+PTHREAD_MUTEX_ROBUST_NORMAL_NP
-+PTHREAD_MUTEX_PRIO_INHERIT_NP
-+PTHREAD_MUTEX_PRIO_PROTECT_NP
-+PTHREAD_MUTEX_PSHARED_BIT
-+PTHREAD_MUTEX_PRIO_CEILING_SHIFT
-+PTHREAD_MUTEX_PRIO_CEILING_MASK
-+
-+-- Mutex attribute flags
-+PTHREAD_MUTEXATTR_PROTOCOL_SHIFT
-+PTHREAD_MUTEXATTR_PROTOCOL_MASK
-+PTHREAD_MUTEXATTR_PRIO_CEILING_MASK
-+PTHREAD_MUTEXATTR_FLAG_ROBUST
-+PTHREAD_MUTEXATTR_FLAG_PSHARED
-+PTHREAD_MUTEXATTR_FLAG_BITS
-+PTHREAD_MUTEX_NO_ELISION_NP
-+
-+-- Priority protocols
-+PTHREAD_PRIO_NONE
-+PTHREAD_PRIO_INHERIT
-+PTHREAD_PRIO_PROTECT
-+
-+-- These values are hardcoded as well:
-+-- Value of __mutex for shared condvars.
-+PTHREAD_COND_SHARED             (void *)~0l
-+
-+-- Value of __total_seq for destroyed condvars.
-+PTHREAD_COND_DESTROYED          -1ull
-+
-+-- __nwaiters encodes the number of threads waiting on a condvar
-+-- and the clock ID.
-+-- __nwaiters >> COND_NWAITERS_SHIFT gives us the number of waiters.
-+COND_NWAITERS_SHIFT
-+
-+-- Condvar clock IDs
-+CLOCK_REALTIME
-+CLOCK_MONOTONIC
-+CLOCK_PROCESS_CPUTIME_ID
-+CLOCK_THREAD_CPUTIME_ID
-+CLOCK_MONOTONIC_RAW
-+CLOCK_REALTIME_COARSE
-+CLOCK_MONOTONIC_COARSE
-+
-+-- Rwlock attributes
-+PTHREAD_RWLOCK_PREFER_READER_NP
-+PTHREAD_RWLOCK_PREFER_WRITER_NP
-+PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
-+
-+-- 'Shared' attribute values
-+PTHREAD_PROCESS_PRIVATE
-+PTHREAD_PROCESS_SHARED
-diff --git a/nptl/test-cond-printers.c b/nptl/test-cond-printers.c
-new file mode 100644
-index 0000000..0f2a5f4
---- /dev/null
-+++ b/nptl/test-cond-printers.c
-@@ -0,0 +1,57 @@
-+/* Helper program for testing the pthread_cond_t pretty printer.
-+
-+   Copyright (C) 2016 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
-+/* Keep the calls to the pthread_* functions on separate lines to make it easy
-+   to advance through the program using the gdb 'next' command.  */
-+
-+#include <time.h>
-+#include <pthread.h>
-+
-+#define PASS 0
-+#define FAIL 1
-+
-+static int test_status_destroyed (pthread_cond_t *condvar);
-+
-+int
-+main (void)
-+{
-+  pthread_cond_t condvar;
-+  pthread_condattr_t attr;
-+  int result = FAIL;
-+
-+  if (pthread_condattr_init (&attr) == 0
-+      && test_status_destroyed (&condvar) == PASS)
-+    result = PASS;
-+  /* Else, one of the pthread_cond* functions failed.  */
-+
-+  return result;
-+}
-+
-+/* Initializes CONDVAR, then destroys it.  */
-+static int
-+test_status_destroyed (pthread_cond_t *condvar)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_cond_init (condvar, NULL) == 0
-+      && pthread_cond_destroy (condvar) == 0)
-+    result = PASS; /* Test status (destroyed).  */
-+
-+  return result;
-+}
-diff --git a/nptl/test-cond-printers.py b/nptl/test-cond-printers.py
-new file mode 100644
-index 0000000..af0e12e
---- /dev/null
-+++ b/nptl/test-cond-printers.py
-@@ -0,0 +1,50 @@
-+# Common tests for the ConditionVariablePrinter class.
-+#
-+# Copyright (C) 2016 Free Software Foundation, Inc.
-+# This file is part of the GNU C Library.
-+#
-+# The GNU C Library is free software; you can redistribute it and/or
-+# modify it under the terms of the GNU Lesser General Public
-+# License as published by the Free Software Foundation; either
-+# version 2.1 of the License, or (at your option) any later version.
-+#
-+# The GNU C Library is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+# Lesser General Public License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public
-+# License along with the GNU C Library; if not, see
-+# <http://www.gnu.org/licenses/>.
-+
-+import sys
-+
-+from test_printers_common import *
-+
-+test_source = sys.argv[1]
-+test_bin = sys.argv[2]
-+printer_files = sys.argv[3:]
-+printer_names = ['global glibc-pthread-locks']
-+
-+try:
-+    init_test(test_bin, printer_files, printer_names)
-+    go_to_main()
-+
-+    var = 'condvar'
-+    to_string = 'pthread_cond_t'
-+
-+    break_at(test_source, 'Test status (destroyed)')
-+    continue_cmd() # Go to test_status_destroyed
-+    test_printer(var, to_string, {'Status': 'Destroyed'})
-+
-+    continue_cmd() # Exit
-+
-+except (NoLineError, pexpect.TIMEOUT) as exception:
-+    print('Error: {0}'.format(exception))
-+    result = FAIL
-+
-+else:
-+    print('Test succeeded.')
-+    result = PASS
-+
-+exit(result)
-diff --git a/nptl/test-condattr-printers.c b/nptl/test-condattr-printers.c
-new file mode 100644
-index 0000000..4db4098
---- /dev/null
-+++ b/nptl/test-condattr-printers.c
-@@ -0,0 +1,94 @@
-+/* Helper program for testing the pthread_cond_t and pthread_condattr_t
-+   pretty printers.
-+
-+   Copyright (C) 2016 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
-+/* Keep the calls to the pthread_* functions on separate lines to make it easy
-+   to advance through the program using the gdb 'next' command.  */
-+
-+#include <time.h>
-+#include <pthread.h>
-+
-+#define PASS 0
-+#define FAIL 1
-+
-+static int condvar_reinit (pthread_cond_t *condvar,
-+			   const pthread_condattr_t *attr);
-+static int test_setclock (pthread_cond_t *condvar, pthread_condattr_t *attr);
-+static int test_setpshared (pthread_cond_t *condvar, pthread_condattr_t *attr);
-+
-+/* Need these so we don't have lines longer than 79 chars.  */
-+#define SET_SHARED(attr, shared) pthread_condattr_setpshared (attr, shared)
-+
-+int
-+main (void)
-+{
-+  pthread_cond_t condvar;
-+  pthread_condattr_t attr;
-+  int result = FAIL;
-+
-+  if (pthread_condattr_init (&attr) == 0
-+      && pthread_cond_init (&condvar, NULL) == 0
-+      && test_setclock (&condvar, &attr) == PASS
-+      && test_setpshared (&condvar, &attr) == PASS)
-+    result = PASS;
-+  /* Else, one of the pthread_cond* functions failed.  */
-+
-+  return result;
-+}
-+
-+/* Destroys CONDVAR and re-initializes it using ATTR.  */
-+static int
-+condvar_reinit (pthread_cond_t *condvar, const pthread_condattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_cond_destroy (condvar) == 0
-+      && pthread_cond_init (condvar, attr) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests setting the clock ID attribute.  */
-+static int
-+test_setclock (pthread_cond_t *condvar, pthread_condattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_condattr_setclock (attr, CLOCK_REALTIME) == 0 /* Set clock.  */
-+      && condvar_reinit (condvar, attr) == PASS)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests setting whether the condvar can be shared between processes.  */
-+static int
-+test_setpshared (pthread_cond_t *condvar, pthread_condattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (SET_SHARED (attr, PTHREAD_PROCESS_SHARED) == 0 /* Set shared.  */
-+      && condvar_reinit (condvar, attr) == PASS
-+      && SET_SHARED (attr, PTHREAD_PROCESS_PRIVATE) == 0
-+      && condvar_reinit (condvar, attr) == PASS)
-+    result = PASS;
-+
-+  return result;
-+}
-diff --git a/nptl/test-condattr-printers.py b/nptl/test-condattr-printers.py
-new file mode 100644
-index 0000000..7ea01db
---- /dev/null
-+++ b/nptl/test-condattr-printers.py
-@@ -0,0 +1,71 @@
-+# Common tests for the ConditionVariablePrinter and
-+# ConditionVariableAttributesPrinter classes.
-+#
-+# Copyright (C) 2016 Free Software Foundation, Inc.
-+# This file is part of the GNU C Library.
-+#
-+# The GNU C Library is free software; you can redistribute it and/or
-+# modify it under the terms of the GNU Lesser General Public
-+# License as published by the Free Software Foundation; either
-+# version 2.1 of the License, or (at your option) any later version.
-+#
-+# The GNU C Library is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+# Lesser General Public License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public
-+# License along with the GNU C Library; if not, see
-+# <http://www.gnu.org/licenses/>.
-+
-+import sys
-+
-+from test_printers_common import *
-+
-+test_source = sys.argv[1]
-+test_bin = sys.argv[2]
-+printer_files = sys.argv[3:]
-+printer_names = ['global glibc-pthread-locks']
-+
-+try:
-+    init_test(test_bin, printer_files, printer_names)
-+    go_to_main()
-+
-+    check_debug_symbol('struct pthread_condattr')
-+
-+    condvar_var = 'condvar'
-+    condvar_to_string = 'pthread_cond_t'
-+
-+    attr_var = 'attr'
-+    attr_to_string = 'pthread_condattr_t'
-+
-+    break_at(test_source, 'Set clock')
-+    continue_cmd() # Go to test_setclock
-+    next_cmd(2)
-+    test_printer(condvar_var, condvar_to_string, {'Clock ID': 'CLOCK_REALTIME'})
-+    test_printer(attr_var, attr_to_string, {'Clock ID': 'CLOCK_REALTIME'})
-+
-+    break_at(test_source, 'Set shared')
-+    continue_cmd() # Go to test_setpshared
-+    next_cmd(2)
-+    test_printer(condvar_var, condvar_to_string, {'Shared': 'Yes'})
-+    test_printer(attr_var, attr_to_string, {'Shared': 'Yes'})
-+    next_cmd(2)
-+    test_printer(condvar_var, condvar_to_string, {'Shared': 'No'})
-+    test_printer(attr_var, attr_to_string, {'Shared': 'No'})
-+
-+    continue_cmd() # Exit
-+
-+except (NoLineError, pexpect.TIMEOUT) as exception:
-+    print('Error: {0}'.format(exception))
-+    result = FAIL
-+
-+except DebugError as exception:
-+    print(exception)
-+    result = UNSUPPORTED
-+
-+else:
-+    print('Test succeeded.')
-+    result = PASS
-+
-+exit(result)
-diff --git a/nptl/test-mutex-printers.c b/nptl/test-mutex-printers.c
-new file mode 100644
-index 0000000..b973e82
---- /dev/null
-+++ b/nptl/test-mutex-printers.c
-@@ -0,0 +1,151 @@
-+/* Helper program for testing the pthread_mutex_t pretty printer.
-+
-+   Copyright (C) 2016 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
-+/* Keep the calls to the pthread_* functions on separate lines to make it easy
-+   to advance through the program using the gdb 'next' command.  */
-+
-+#include <stdlib.h>
-+#include <errno.h>
-+#include <pthread.h>
-+
-+#define PASS 0
-+#define FAIL 1
-+
-+static int test_status_destroyed (pthread_mutex_t *mutex);
-+static int test_status_no_robust (pthread_mutex_t *mutex,
-+				  pthread_mutexattr_t *attr);
-+static int test_status_robust (pthread_mutex_t *mutex,
-+			       pthread_mutexattr_t *attr);
-+static int test_locking_state_robust (pthread_mutex_t *mutex);
-+static void *thread_func (void *arg);
-+static int test_recursive_locks (pthread_mutex_t *mutex,
-+				 pthread_mutexattr_t *attr);
-+
-+int
-+main (void)
-+{
-+  pthread_mutex_t mutex;
-+  pthread_mutexattr_t attr;
-+  int result = FAIL;
-+
-+  if (pthread_mutexattr_init (&attr) == 0
-+      && test_status_destroyed (&mutex) == PASS
-+      && test_status_no_robust (&mutex, &attr) == PASS
-+      && test_status_robust (&mutex, &attr) == PASS
-+      && test_recursive_locks (&mutex, &attr) == PASS)
-+    result = PASS;
-+  /* Else, one of the pthread_mutex* functions failed.  */
-+
-+  return result;
-+}
-+
-+/* Initializes MUTEX, then destroys it.  */
-+static int
-+test_status_destroyed (pthread_mutex_t *mutex)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_mutex_init (mutex, NULL) == 0
-+      && pthread_mutex_destroy (mutex) == 0)
-+    result = PASS; /* Test status (destroyed).  */
-+
-+  return result;
-+}
-+
-+/* Tests locking of non-robust mutexes.  */
-+static int
-+test_status_no_robust (pthread_mutex_t *mutex, pthread_mutexattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_mutexattr_setrobust (attr, PTHREAD_MUTEX_STALLED) == 0
-+      && pthread_mutex_init (mutex, attr) == 0
-+      && pthread_mutex_lock (mutex) == 0 /* Test status (non-robust).  */
-+      && pthread_mutex_unlock (mutex) == 0
-+      && pthread_mutex_destroy (mutex) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests locking of robust mutexes.  */
-+static int
-+test_status_robust (pthread_mutex_t *mutex, pthread_mutexattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_mutexattr_setrobust (attr, PTHREAD_MUTEX_ROBUST) == 0
-+      && pthread_mutex_init (mutex, attr) == 0
-+      && test_locking_state_robust (mutex) == PASS /* Test status (robust).  */
-+      && pthread_mutex_destroy (mutex) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests locking and state corruption of robust mutexes.  We'll mark it as
-+   inconsistent, then not recoverable.  */
-+static int
-+test_locking_state_robust (pthread_mutex_t *mutex)
-+{
-+  int result = FAIL;
-+  pthread_t thread;
-+
-+  if (pthread_create (&thread, NULL, thread_func, mutex) == 0 /* Create.  */
-+      && pthread_join (thread, NULL) == 0
-+      && pthread_mutex_lock (mutex) == EOWNERDEAD /* Test locking (robust).  */
-+      && pthread_mutex_unlock (mutex) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Function to be called by the child thread when testing robust mutexes.  */
-+static void *
-+thread_func (void *arg)
-+{
-+  pthread_mutex_t *mutex = (pthread_mutex_t *)arg;
-+
-+  if (pthread_mutex_lock (mutex) != 0) /* Thread function.  */
-+    exit (FAIL);
-+
-+  /* Thread terminates without unlocking the mutex, thus marking it as
-+     inconsistent.  */
-+  return NULL;
-+}
-+
-+/* Tests locking the mutex multiple times in a row.  */
-+static int
-+test_recursive_locks (pthread_mutex_t *mutex, pthread_mutexattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_mutexattr_settype (attr, PTHREAD_MUTEX_RECURSIVE) == 0
-+      && pthread_mutex_init (mutex, attr) == 0
-+      && pthread_mutex_lock (mutex) == 0
-+      && pthread_mutex_lock (mutex) == 0
-+      && pthread_mutex_lock (mutex) == 0 /* Test recursive locks.  */
-+      && pthread_mutex_unlock (mutex) == 0
-+      && pthread_mutex_unlock (mutex) == 0
-+      && pthread_mutex_unlock (mutex) == 0
-+      && pthread_mutex_destroy (mutex) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-diff --git a/nptl/test-mutex-printers.py b/nptl/test-mutex-printers.py
-new file mode 100644
-index 0000000..7f542ad
---- /dev/null
-+++ b/nptl/test-mutex-printers.py
-@@ -0,0 +1,97 @@
-+# Tests for the MutexPrinter class.
-+#
-+# Copyright (C) 2016 Free Software Foundation, Inc.
-+# This file is part of the GNU C Library.
-+#
-+# The GNU C Library is free software; you can redistribute it and/or
-+# modify it under the terms of the GNU Lesser General Public
-+# License as published by the Free Software Foundation; either
-+# version 2.1 of the License, or (at your option) any later version.
-+#
-+# The GNU C Library is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+# Lesser General Public License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public
-+# License along with the GNU C Library; if not, see
-+# <http://www.gnu.org/licenses/>.
-+
-+import sys
-+
-+from test_printers_common import *
-+
-+test_source = sys.argv[1]
-+test_bin = sys.argv[2]
-+printer_files = sys.argv[3:]
-+printer_names = ['global glibc-pthread-locks']
-+
-+try:
-+    init_test(test_bin, printer_files, printer_names)
-+    go_to_main()
-+
-+    var = 'mutex'
-+    to_string = 'pthread_mutex_t'
-+
-+    break_at(test_source, 'Test status (destroyed)')
-+    continue_cmd() # Go to test_status_destroyed
-+    test_printer(var, to_string, {'Status': 'Destroyed'})
-+
-+    break_at(test_source, 'Test status (non-robust)')
-+    continue_cmd() # Go to test_status_no_robust
-+    test_printer(var, to_string, {'Status': 'Unlocked'})
-+    next_cmd()
-+    thread_id = get_current_thread_lwpid()
-+    test_printer(var, to_string, {'Status': 'Locked, possibly with no waiters',
-+                                  'Owner ID': thread_id})
-+
-+    break_at(test_source, 'Test status (robust)')
-+    continue_cmd() # Go to test_status_robust
-+    test_printer(var, to_string, {'Status': 'Unlocked'})
-+
-+    # We'll now test the robust mutex locking states.  We'll create a new
-+    # thread that will lock a robust mutex and exit without unlocking it.
-+    break_at(test_source, 'Create')
-+    continue_cmd() # Go to test_locking_state_robust
-+    # Set a breakpoint for the new thread to hit.
-+    break_at(test_source, 'Thread function')
-+    continue_cmd()
-+    # By now the new thread is created and has hit its breakpoint.
-+    set_scheduler_locking(True)
-+    parent = 1
-+    child = 2
-+    select_thread(child)
-+    child_id = get_current_thread_lwpid()
-+    # We've got the new thread's ID.
-+    select_thread(parent)
-+    # Make the new thread finish its function while we wait.
-+    continue_cmd(thread=child)
-+    # The new thread should be dead by now.
-+    break_at(test_source, 'Test locking (robust)')
-+    continue_cmd()
-+    test_printer(var, to_string, {'Owner ID': r'{0} \(dead\)'.format(child_id)})
-+    # Try to lock and unlock the mutex.
-+    next_cmd()
-+    test_printer(var, to_string, {'Owner ID': thread_id,
-+                           'State protected by this mutex': 'Inconsistent'})
-+    next_cmd()
-+    test_printer(var, to_string, {'Status': 'Unlocked',
-+                        'State protected by this mutex': 'Not recoverable'})
-+    set_scheduler_locking(False)
-+
-+    break_at(test_source, 'Test recursive locks')
-+    continue_cmd() # Go to test_recursive_locks
-+    test_printer(var, to_string, {'Times locked recursively': '2'})
-+    next_cmd()
-+    test_printer(var, to_string, {'Times locked recursively': '3'})
-+    continue_cmd() # Exit
-+
-+except (NoLineError, pexpect.TIMEOUT) as exception:
-+    print('Error: {0}'.format(exception))
-+    result = FAIL
-+
-+else:
-+    print('Test succeeded.')
-+    result = PASS
-+
-+exit(result)
-diff --git a/nptl/test-mutexattr-printers.c b/nptl/test-mutexattr-printers.c
-new file mode 100644
-index 0000000..9ecfff7
---- /dev/null
-+++ b/nptl/test-mutexattr-printers.c
-@@ -0,0 +1,144 @@
-+/* Helper program for testing the pthread_mutex_t and pthread_mutexattr_t
-+   pretty printers.
-+
-+   Copyright (C) 2016 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
-+/* Keep the calls to the pthread_* functions on separate lines to make it easy
-+   to advance through the program using the gdb 'next' command.  */
-+
-+#include <pthread.h>
-+
-+#define PASS 0
-+#define FAIL 1
-+#define PRIOCEILING 42
-+
-+/* Need these so we don't have lines longer than 79 chars.  */
-+#define SET_TYPE(attr, type) pthread_mutexattr_settype (attr, type)
-+#define SET_ROBUST(attr, robust) pthread_mutexattr_setrobust (attr, robust)
-+#define SET_SHARED(attr, shared) pthread_mutexattr_setpshared (attr, shared)
-+#define SET_PROTOCOL(attr, protocol) \
-+	pthread_mutexattr_setprotocol (attr, protocol)
-+#define SET_PRIOCEILING(mutex, prioceiling, old_ceiling) \
-+	pthread_mutex_setprioceiling (mutex, prioceiling, old_ceiling)
-+
-+static int mutex_reinit (pthread_mutex_t *mutex,
-+			 const pthread_mutexattr_t *attr);
-+static int test_settype (pthread_mutex_t *mutex, pthread_mutexattr_t *attr);
-+static int test_setrobust (pthread_mutex_t *mutex, pthread_mutexattr_t *attr);
-+static int test_setpshared (pthread_mutex_t *mutex, pthread_mutexattr_t *attr);
-+static int test_setprotocol (pthread_mutex_t *mutex,
-+			     pthread_mutexattr_t *attr);
-+
-+int
-+main (void)
-+{
-+  pthread_mutex_t mutex;
-+  pthread_mutexattr_t attr;
-+  int result = FAIL;
-+
-+  if (pthread_mutexattr_init (&attr) == 0
-+      && pthread_mutex_init (&mutex, NULL) == 0
-+      && test_settype (&mutex, &attr) == PASS
-+      && test_setrobust (&mutex, &attr) == PASS
-+      && test_setpshared (&mutex, &attr) == PASS
-+      && test_setprotocol (&mutex, &attr) == PASS)
-+    result = PASS;
-+  /* Else, one of the pthread_mutex* functions failed.  */
-+
-+  return result;
-+}
-+
-+/* Destroys MUTEX and re-initializes it using ATTR.  */
-+static int
-+mutex_reinit (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_mutex_destroy (mutex) == 0
-+      && pthread_mutex_init (mutex, attr) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests setting the mutex type.  */
-+static int
-+test_settype (pthread_mutex_t *mutex, pthread_mutexattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (SET_TYPE (attr, PTHREAD_MUTEX_ERRORCHECK) == 0 /* Set type.  */
-+      && mutex_reinit (mutex, attr) == 0
-+      && SET_TYPE (attr, PTHREAD_MUTEX_RECURSIVE) == 0
-+      && mutex_reinit (mutex, attr) == 0
-+      && SET_TYPE (attr, PTHREAD_MUTEX_NORMAL) == 0
-+      && mutex_reinit (mutex, attr) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests setting whether the mutex is robust.  */
-+static int
-+test_setrobust (pthread_mutex_t *mutex, pthread_mutexattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (SET_ROBUST (attr, PTHREAD_MUTEX_ROBUST) == 0 /* Set robust.  */
-+      && mutex_reinit (mutex, attr) == 0
-+      && SET_ROBUST (attr, PTHREAD_MUTEX_STALLED) == 0
-+      && mutex_reinit (mutex, attr) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests setting whether the mutex can be shared between processes.  */
-+static int
-+test_setpshared (pthread_mutex_t *mutex, pthread_mutexattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (SET_SHARED (attr, PTHREAD_PROCESS_SHARED) == 0 /* Set shared.  */
-+      && mutex_reinit (mutex, attr) == 0
-+      && SET_SHARED (attr, PTHREAD_PROCESS_PRIVATE) == 0
-+      && mutex_reinit (mutex, attr) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests setting the mutex protocol and, for Priority Protect, the Priority
-+   Ceiling.  */
-+static int
-+test_setprotocol (pthread_mutex_t *mutex, pthread_mutexattr_t *attr)
-+{
-+  int result = FAIL;
-+  int old_prioceiling;
-+
-+  if (SET_PROTOCOL (attr, PTHREAD_PRIO_INHERIT) == 0 /* Set protocol.  */
-+      && mutex_reinit (mutex, attr) == 0
-+      && SET_PROTOCOL (attr, PTHREAD_PRIO_PROTECT) == 0
-+      && mutex_reinit (mutex, attr) == 0
-+      && SET_PRIOCEILING(mutex, PRIOCEILING, &old_prioceiling) == 0
-+      && SET_PROTOCOL (attr, PTHREAD_PRIO_NONE) == 0
-+      && mutex_reinit (mutex, attr) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-diff --git a/nptl/test-mutexattr-printers.py b/nptl/test-mutexattr-printers.py
-new file mode 100644
-index 0000000..4464723
---- /dev/null
-+++ b/nptl/test-mutexattr-printers.py
-@@ -0,0 +1,101 @@
-+# Common tests for the MutexPrinter and MutexAttributesPrinter classes.
-+#
-+# Copyright (C) 2016 Free Software Foundation, Inc.
-+# This file is part of the GNU C Library.
-+#
-+# The GNU C Library is free software; you can redistribute it and/or
-+# modify it under the terms of the GNU Lesser General Public
-+# License as published by the Free Software Foundation; either
-+# version 2.1 of the License, or (at your option) any later version.
-+#
-+# The GNU C Library is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+# Lesser General Public License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public
-+# License along with the GNU C Library; if not, see
-+# <http://www.gnu.org/licenses/>.
-+
-+import sys
-+
-+from test_printers_common import *
-+
-+test_source = sys.argv[1]
-+test_bin = sys.argv[2]
-+printer_files = sys.argv[3:]
-+printer_names = ['global glibc-pthread-locks']
-+PRIOCEILING = 42
-+
-+try:
-+    init_test(test_bin, printer_files, printer_names)
-+    go_to_main()
-+
-+    check_debug_symbol('struct pthread_mutexattr')
-+
-+    mutex_var = 'mutex'
-+    mutex_to_string = 'pthread_mutex_t'
-+
-+    attr_var = 'attr'
-+    attr_to_string = 'pthread_mutexattr_t'
-+
-+    break_at(test_source, 'Set type')
-+    continue_cmd() # Go to test_settype
-+    next_cmd(2)
-+    test_printer(attr_var, attr_to_string, {'Type': 'Error check'})
-+    test_printer(mutex_var, mutex_to_string, {'Type': 'Error check'})
-+    next_cmd(2)
-+    test_printer(attr_var, attr_to_string, {'Type': 'Recursive'})
-+    test_printer(mutex_var, mutex_to_string, {'Type': 'Recursive'})
-+    next_cmd(2)
-+    test_printer(attr_var, attr_to_string, {'Type': 'Normal'})
-+    test_printer(mutex_var, mutex_to_string, {'Type': 'Normal'})
-+
-+    break_at(test_source, 'Set robust')
-+    continue_cmd() # Go to test_setrobust
-+    next_cmd(2)
-+    test_printer(attr_var, attr_to_string, {'Robust': 'Yes'})
-+    test_printer(mutex_var, mutex_to_string, {'Robust': 'Yes'})
-+    next_cmd(2)
-+    test_printer(attr_var, attr_to_string, {'Robust': 'No'})
-+    test_printer(mutex_var, mutex_to_string, {'Robust': 'No'})
-+
-+    break_at(test_source, 'Set shared')
-+    continue_cmd() # Go to test_setpshared
-+    next_cmd(2)
-+    test_printer(attr_var, attr_to_string, {'Shared': 'Yes'})
-+    test_printer(mutex_var, mutex_to_string, {'Shared': 'Yes'})
-+    next_cmd(2)
-+    test_printer(attr_var, attr_to_string, {'Shared': 'No'})
-+    test_printer(mutex_var, mutex_to_string, {'Shared': 'No'})
-+
-+    break_at(test_source, 'Set protocol')
-+    continue_cmd() # Go to test_setprotocol
-+    next_cmd(2)
-+    test_printer(attr_var, attr_to_string, {'Protocol': 'Priority inherit'})
-+    test_printer(mutex_var, mutex_to_string, {'Protocol': 'Priority inherit'})
-+    next_cmd(2)
-+    test_printer(attr_var, attr_to_string, {'Protocol': 'Priority protect'})
-+    test_printer(mutex_var, mutex_to_string, {'Protocol': 'Priority protect'})
-+    next_cmd(2)
-+    test_printer(mutex_var, mutex_to_string, {'Priority ceiling':
-+                                              str(PRIOCEILING)})
-+    next_cmd()
-+    test_printer(attr_var, attr_to_string, {'Protocol': 'None'})
-+    test_printer(mutex_var, mutex_to_string, {'Protocol': 'None'})
-+
-+    continue_cmd() # Exit
-+
-+except (NoLineError, pexpect.TIMEOUT) as exception:
-+    print('Error: {0}'.format(exception))
-+    result = FAIL
-+
-+except DebugError as exception:
-+    print(exception)
-+    result = UNSUPPORTED
-+
-+else:
-+    print('Test succeeded.')
-+    result = PASS
-+
-+exit(result)
-diff --git a/nptl/test-rwlock-printers.c b/nptl/test-rwlock-printers.c
-new file mode 100644
-index 0000000..dbbe9b8
---- /dev/null
-+++ b/nptl/test-rwlock-printers.c
-@@ -0,0 +1,78 @@
-+/* Helper program for testing the pthread_rwlock_t pretty printer.
-+
-+   Copyright (C) 2016 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
-+/* Keep the calls to the pthread_* functions on separate lines to make it easy
-+   to advance through the program using the gdb 'next' command.  */
-+
-+#include <pthread.h>
-+
-+#define PASS 0
-+#define FAIL 1
-+
-+static int test_locking_reader (pthread_rwlock_t *rwlock);
-+static int test_locking_writer (pthread_rwlock_t *rwlock);
-+
-+int
-+main (void)
-+{
-+  pthread_rwlock_t rwlock;
-+
-+  int result = FAIL;
-+
-+  if (test_locking_reader (&rwlock) == PASS
-+      && test_locking_writer (&rwlock) == PASS)
-+    result = PASS;
-+  /* Else, one of the pthread_rwlock* functions failed.  */
-+
-+  return result;
-+}
-+
-+/* Tests locking the rwlock multiple times as a reader.  */
-+static int
-+test_locking_reader (pthread_rwlock_t *rwlock)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_rwlock_init (rwlock, NULL) == 0
-+      && pthread_rwlock_rdlock (rwlock) == 0 /* Test locking (reader).  */
-+      && pthread_rwlock_rdlock (rwlock) == 0
-+      && pthread_rwlock_rdlock (rwlock) == 0
-+      && pthread_rwlock_unlock (rwlock) == 0
-+      && pthread_rwlock_unlock (rwlock) == 0
-+      && pthread_rwlock_unlock (rwlock) == 0
-+      && pthread_rwlock_destroy (rwlock) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests locking the rwlock as a writer.  */
-+static int
-+test_locking_writer (pthread_rwlock_t *rwlock)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_rwlock_init (rwlock, NULL) == 0
-+      && pthread_rwlock_wrlock (rwlock) == 0 /* Test locking (writer).  */
-+      && pthread_rwlock_unlock (rwlock) == 0
-+      && pthread_rwlock_destroy (rwlock) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-diff --git a/nptl/test-rwlock-printers.py b/nptl/test-rwlock-printers.py
-new file mode 100644
-index 0000000..b972fa6
---- /dev/null
-+++ b/nptl/test-rwlock-printers.py
-@@ -0,0 +1,64 @@
-+# Common tests for the RWLockPrinter class.
-+#
-+# Copyright (C) 2016 Free Software Foundation, Inc.
-+# This file is part of the GNU C Library.
-+#
-+# The GNU C Library is free software; you can redistribute it and/or
-+# modify it under the terms of the GNU Lesser General Public
-+# License as published by the Free Software Foundation; either
-+# version 2.1 of the License, or (at your option) any later version.
-+#
-+# The GNU C Library is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+# Lesser General Public License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public
-+# License along with the GNU C Library; if not, see
-+# <http://www.gnu.org/licenses/>.
-+
-+import sys
-+
-+from test_printers_common import *
-+
-+test_source = sys.argv[1]
-+test_bin = sys.argv[2]
-+printer_files = sys.argv[3:]
-+printer_names = ['global glibc-pthread-locks']
-+
-+try:
-+    init_test(test_bin, printer_files, printer_names)
-+    go_to_main()
-+
-+    var = 'rwlock'
-+    to_string = 'pthread_rwlock_t'
-+
-+    break_at(test_source, 'Test locking (reader)')
-+    continue_cmd() # Go to test_locking_reader
-+    test_printer(var, to_string, {'Status': 'Unlocked'})
-+    next_cmd()
-+    test_printer(var, to_string, {'Status': r'Locked \(Read\)', 'Readers': '1'})
-+    next_cmd()
-+    test_printer(var, to_string, {'Readers': '2'})
-+    next_cmd()
-+    test_printer(var, to_string, {'Readers': '3'})
-+
-+    break_at(test_source, 'Test locking (writer)')
-+    continue_cmd() # Go to test_locking_writer
-+    test_printer(var, to_string, {'Status': 'Unlocked'})
-+    next_cmd()
-+    thread_id = get_current_thread_lwpid()
-+    test_printer(var, to_string, {'Status': r'Locked \(Write\)',
-+                                  'Writer ID': thread_id})
-+
-+    continue_cmd() # Exit
-+
-+except (NoLineError, pexpect.TIMEOUT) as exception:
-+    print('Error: {0}'.format(exception))
-+    result = FAIL
-+
-+else:
-+    print('Test succeeded.')
-+    result = PASS
-+
-+exit(result)
-diff --git a/nptl/test-rwlockattr-printers.c b/nptl/test-rwlockattr-printers.c
-new file mode 100644
-index 0000000..d12facf
---- /dev/null
-+++ b/nptl/test-rwlockattr-printers.c
-@@ -0,0 +1,98 @@
-+/* Helper program for testing the pthread_rwlock_t and pthread_rwlockattr_t
-+   pretty printers.
-+
-+   Copyright (C) 2016 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
-+/* Keep the calls to the pthread_* functions on separate lines to make it easy
-+   to advance through the program using the gdb 'next' command.  */
-+
-+#include <pthread.h>
-+
-+#define PASS 0
-+#define FAIL 1
-+
-+/* Need these so we don't have lines longer than 79 chars.  */
-+#define SET_KIND(attr, kind) pthread_rwlockattr_setkind_np (attr, kind)
-+#define SET_SHARED(attr, shared) pthread_rwlockattr_setpshared (attr, shared)
-+
-+static int rwlock_reinit (pthread_rwlock_t *rwlock,
-+			  const pthread_rwlockattr_t *attr);
-+static int test_setkind_np (pthread_rwlock_t *rwlock,
-+			    pthread_rwlockattr_t *attr);
-+static int test_setpshared (pthread_rwlock_t *rwlock,
-+			    pthread_rwlockattr_t *attr);
-+
-+int
-+main (void)
-+{
-+  pthread_rwlock_t rwlock;
-+  pthread_rwlockattr_t attr;
-+  int result = FAIL;
-+
-+  if (pthread_rwlockattr_init (&attr) == 0
-+      && pthread_rwlock_init (&rwlock, NULL) == 0
-+      && test_setkind_np (&rwlock, &attr) == PASS
-+      && test_setpshared (&rwlock, &attr) == PASS)
-+    result = PASS;
-+  /* Else, one of the pthread_rwlock* functions failed.  */
-+
-+  return result;
-+}
-+
-+/* Destroys RWLOCK and re-initializes it using ATTR.  */
-+static int
-+rwlock_reinit (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (pthread_rwlock_destroy (rwlock) == 0
-+      && pthread_rwlock_init (rwlock, attr) == 0)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests setting whether the rwlock prefers readers or writers.  */
-+static int
-+test_setkind_np (pthread_rwlock_t *rwlock, pthread_rwlockattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (SET_KIND (attr, PTHREAD_RWLOCK_PREFER_READER_NP) == 0 /* Set kind.  */
-+      && rwlock_reinit (rwlock, attr) == PASS
-+      && SET_KIND (attr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP) == 0
-+      && rwlock_reinit (rwlock, attr) == PASS)
-+    result = PASS;
-+
-+  return result;
-+}
-+
-+/* Tests setting whether the rwlock can be shared between processes.  */
-+static int
-+test_setpshared (pthread_rwlock_t *rwlock, pthread_rwlockattr_t *attr)
-+{
-+  int result = FAIL;
-+
-+  if (SET_SHARED (attr, PTHREAD_PROCESS_SHARED) == 0 /* Set shared.  */
-+      && rwlock_reinit (rwlock, attr) == PASS
-+      && SET_SHARED (attr, PTHREAD_PROCESS_PRIVATE) == 0
-+      && rwlock_reinit (rwlock, attr) == PASS)
-+    result = PASS;
-+
-+  return result;
-+}
-diff --git a/nptl/test-rwlockattr-printers.py b/nptl/test-rwlockattr-printers.py
-new file mode 100644
-index 0000000..1ca2dc6
---- /dev/null
-+++ b/nptl/test-rwlockattr-printers.py
-@@ -0,0 +1,73 @@
-+# Common tests for the RWLockPrinter and RWLockAttributesPrinter classes.
-+#
-+# Copyright (C) 2016 Free Software Foundation, Inc.
-+# This file is part of the GNU C Library.
-+#
-+# The GNU C Library is free software; you can redistribute it and/or
-+# modify it under the terms of the GNU Lesser General Public
-+# License as published by the Free Software Foundation; either
-+# version 2.1 of the License, or (at your option) any later version.
-+#
-+# The GNU C Library is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+# Lesser General Public License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public
-+# License along with the GNU C Library; if not, see
-+# <http://www.gnu.org/licenses/>.
-+
-+import sys
-+
-+from test_printers_common import *
-+
-+test_source = sys.argv[1]
-+test_bin = sys.argv[2]
-+printer_files = sys.argv[3:]
-+printer_names = ['global glibc-pthread-locks']
-+
-+try:
-+    init_test(test_bin, printer_files, printer_names)
-+    go_to_main()
-+
-+    check_debug_symbol('struct pthread_rwlockattr')
-+
-+    rwlock_var = 'rwlock'
-+    rwlock_to_string = 'pthread_rwlock_t'
-+
-+    attr_var = 'attr'
-+    attr_to_string = 'pthread_rwlockattr_t'
-+
-+    break_at(test_source, 'Set kind')
-+    continue_cmd() # Go to test_setkind_np
-+    next_cmd(2)
-+    test_printer(rwlock_var, rwlock_to_string, {'Prefers': 'Readers'})
-+    test_printer(attr_var, attr_to_string, {'Prefers': 'Readers'})
-+    next_cmd(2)
-+    test_printer(rwlock_var, rwlock_to_string, {'Prefers': 'Writers'})
-+    test_printer(attr_var, attr_to_string, {'Prefers': 'Writers'})
-+
-+    break_at(test_source, 'Set shared')
-+    continue_cmd() # Go to test_setpshared
-+    next_cmd(2)
-+    test_printer(rwlock_var, rwlock_to_string, {'Shared': 'Yes'})
-+    test_printer(attr_var, attr_to_string, {'Shared': 'Yes'})
-+    next_cmd(2)
-+    test_printer(rwlock_var, rwlock_to_string, {'Shared': 'No'})
-+    test_printer(attr_var, attr_to_string, {'Shared': 'No'})
-+
-+    continue_cmd() # Exit
-+
-+except (NoLineError, pexpect.TIMEOUT) as exception:
-+    print('Error: {0}'.format(exception))
-+    result = FAIL
-+
-+except DebugError as exception:
-+    print(exception)
-+    result = UNSUPPORTED
-+
-+else:
-+    print('Test succeeded.')
-+    result = PASS
-+
-+exit(result)
-diff --git a/scripts/gen-py-const.awk b/scripts/gen-py-const.awk
-new file mode 100644
-index 0000000..4586f59
---- /dev/null
-+++ b/scripts/gen-py-const.awk
-@@ -0,0 +1,118 @@
-+# Script to generate constants for Python pretty printers.
-+#
-+# Copyright (C) 2016 Free Software Foundation, Inc.
-+# This file is part of the GNU C Library.
-+#
-+# The GNU C Library is free software; you can redistribute it and/or
-+# modify it under the terms of the GNU Lesser General Public
-+# License as published by the Free Software Foundation; either
-+# version 2.1 of the License, or (at your option) any later version.
-+#
-+# The GNU C Library is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+# Lesser General Public License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public
-+# License along with the GNU C Library; if not, see
-+# <http://www.gnu.org/licenses/>.
-+
-+# This script is a smaller version of the clever gen-asm-const.awk hack used to
-+# generate ASM constants from .sym files.  We'll use this to generate constants
-+# for Python pretty printers.
-+#
-+# The input to this script are .pysym files that look like:
-+# #C_Preprocessor_Directive...
-+# NAME1
-+# NAME2 expression...
-+#
-+# A line giving just a name implies an expression consisting of just that name.
-+# Comments start with '--'.
-+#
-+# The output of this script is a 'dummy' function containing 'asm' declarations
-+# for each non-preprocessor line in the .pysym file.  The expression values
-+# will appear as input operands to the 'asm' declaration.  For example, if we
-+# have:
-+#
-+# /* header.h */
-+# #define MACRO 42
-+#
-+# struct S {
-+#     char c1;
-+#     char c2;
-+#     char c3;
-+# };
-+#
-+# enum E {
-+#     ZERO,
-+#     ONE
-+# };
-+#
-+# /* symbols.pysym */
-+# #include <stddef.h>
-+# #include "header.h"
-+# -- This is a comment
-+# MACRO
-+# C3_OFFSET offsetof(struct S, c3)
-+# E_ONE ONE
-+#
-+# the output will be:
-+#
-+# #include <stddef.h>
-+# #include "header.h"
-+# void dummy(void)
-+# {
-+#   asm ("@name@MACRO@value@%0@" : : "i" (MACRO));
-+#   asm ("@name@C3_OFFSET@value@%0@" : : "i" (offsetof(struct S, c3)));
-+#   asm ("@name@E_ONE@value@%0@" : : "i" (ONE));
-+# }
-+#
-+# We'll later feed this output to gcc -S.  Since '-S' tells gcc to compile but
-+# not assemble, gcc will output something like:
-+#
-+# dummy:
-+# 	...
-+# 	@name@MACRO@value@$42@
-+# 	@name@C3_OFFSET@value@$2@
-+# 	@name@E_ONE@value@$1@
-+#
-+# Finally, we can process that output to extract the constant values.
-+# Notice gcc may prepend a special character such as '$' to each value.
-+
-+# found_symbol indicates whether we found a non-comment, non-preprocessor line.
-+BEGIN { found_symbol = 0 }
-+
-+# C preprocessor directives go straight through.
-+/^#/ { print; next; }
-+
-+# Skip comments.
-+/--/ { next; }
-+
-+# Trim leading whitespace.
-+{ sub(/^[[:blank:]]*/, ""); }
-+
-+# If we found a non-comment, non-preprocessor line, print the 'dummy' function
-+# header.
-+NF > 0 && !found_symbol {
-+    print "void dummy(void)\n{";
-+    found_symbol = 1;
-+}
-+
-+# If the line contains just a name, duplicate it so we can use that name
-+# as the value of the expression.
-+NF == 1 { sub(/^.*$/, "& &"); }
-+
-+# If a line contains a name and an expression...
-+NF > 1 {
-+    name = $1;
-+
-+    # Remove any characters before the second field.
-+    sub(/^[^[:blank:]]+[[:blank:]]+/, "");
-+
-+    # '$0' ends up being everything that appeared after the first field
-+    # separator.
-+    printf "  asm (\"@name@%s@value@%0@\" : : \"i\" (%s));\n", name, $0;
-+}
-+
-+# Close the 'dummy' function.
-+END { if (found_symbol) print "}"; }
-diff --git a/scripts/test_printers_common.py b/scripts/test_printers_common.py
-new file mode 100644
-index 0000000..c79d7e3
---- /dev/null
-+++ b/scripts/test_printers_common.py
-@@ -0,0 +1,364 @@
-+# Common functions and variables for testing the Python pretty printers.
-+#
-+# Copyright (C) 2016 Free Software Foundation, Inc.
-+# This file is part of the GNU C Library.
-+#
-+# The GNU C Library is free software; you can redistribute it and/or
-+# modify it under the terms of the GNU Lesser General Public
-+# License as published by the Free Software Foundation; either
-+# version 2.1 of the License, or (at your option) any later version.
-+#
-+# The GNU C Library is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+# Lesser General Public License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public
-+# License along with the GNU C Library; if not, see
-+# <http://www.gnu.org/licenses/>.
-+
-+"""These tests require PExpect 4.0 or newer.
-+
-+Exported constants:
-+    PASS, FAIL, UNSUPPORTED (int): Test exit codes, as per evaluate-test.sh.
-+"""
-+
-+import os
-+import re
-+from test_printers_exceptions import *
-+
-+PASS = 0
-+FAIL = 1
-+UNSUPPORTED = 77
-+
-+gdb_bin = 'gdb'
-+gdb_options = '-q -nx'
-+gdb_invocation = '{0} {1}'.format(gdb_bin, gdb_options)
-+pexpect_min_version = 4
-+gdb_min_version = (7, 8)
-+encoding = 'utf-8'
-+
-+try:
-+    import pexpect
-+except ImportError:
-+    print('PExpect 4.0 or newer must be installed to test the pretty printers.')
-+    exit(UNSUPPORTED)
-+
-+pexpect_version = pexpect.__version__.split('.')[0]
-+
-+if int(pexpect_version) < pexpect_min_version:
-+    print('PExpect 4.0 or newer must be installed to test the pretty printers.')
-+    exit(UNSUPPORTED)
-+
-+if not pexpect.which(gdb_bin):
-+    print('gdb 7.8 or newer must be installed to test the pretty printers.')
-+    exit(UNSUPPORTED)
-+
-+timeout = 5
-+TIMEOUTFACTOR = os.environ.get('TIMEOUTFACTOR')
-+
-+if TIMEOUTFACTOR:
-+    timeout = int(TIMEOUTFACTOR)
-+
-+try:
-+    # Check the gdb version.
-+    version_cmd = '{0} --version'.format(gdb_invocation, timeout=timeout)
-+    gdb_version_out = pexpect.run(version_cmd, encoding=encoding)
-+
-+    # The gdb version string is "GNU gdb <PKGVERSION><version>", where
-+    # PKGVERSION can be any text.  We assume that there'll always be a space
-+    # between PKGVERSION and the version number for the sake of the regexp.
-+    version_match = re.search(r'GNU gdb .* ([1-9]+)\.([0-9]+)', gdb_version_out)
-+
-+    if not version_match:
-+        print('The gdb version string (gdb -v) is incorrectly formatted.')
-+        exit(UNSUPPORTED)
-+
-+    gdb_version = (int(version_match.group(1)), int(version_match.group(2)))
-+
-+    if gdb_version < gdb_min_version:
-+        print('gdb 7.8 or newer must be installed to test the pretty printers.')
-+        exit(UNSUPPORTED)
-+
-+    # Check if gdb supports Python.
-+    gdb_python_cmd = '{0} -ex "python import os" -batch'.format(gdb_invocation,
-+                                                                timeout=timeout)
-+    gdb_python_error = pexpect.run(gdb_python_cmd, encoding=encoding)
-+
-+    if gdb_python_error:
-+        print('gdb must have python support to test the pretty printers.')
-+        exit(UNSUPPORTED)
-+
-+    # If everything's ok, spawn the gdb process we'll use for testing.
-+    gdb = pexpect.spawn(gdb_invocation, echo=False, timeout=timeout,
-+                        encoding=encoding)
-+    gdb_prompt = u'\(gdb\)'
-+    gdb.expect(gdb_prompt)
-+
-+except pexpect.ExceptionPexpect as exception:
-+    print('Error: {0}'.format(exception))
-+    exit(FAIL)
-+
-+def test(command, pattern=None):
-+    """Sends 'command' to gdb and expects the given 'pattern'.
-+
-+    If 'pattern' is None, simply consumes everything up to and including
-+    the gdb prompt.
-+
-+    Args:
-+        command (string): The command we'll send to gdb.
-+        pattern (raw string): A pattern the gdb output should match.
-+
-+    Returns:
-+        string: The string that matched 'pattern', or an empty string if
-+            'pattern' was None.
-+    """
-+
-+    match = ''
-+
-+    gdb.sendline(command)
-+
-+    if pattern:
-+        # PExpect does a non-greedy match for '+' and '*'.  Since it can't look
-+        # ahead on the gdb output stream, if 'pattern' ends with a '+' or a '*'
-+        # we may end up matching only part of the required output.
-+        # To avoid this, we'll consume 'pattern' and anything that follows it
-+        # up to and including the gdb prompt, then extract 'pattern' later.
-+        index = gdb.expect([u'{0}.+{1}'.format(pattern, gdb_prompt),
-+                            pexpect.TIMEOUT])
-+
-+        if index == 0:
-+            # gdb.after now contains the whole match.  Extract the text that
-+            # matches 'pattern'.
-+            match = re.match(pattern, gdb.after, re.DOTALL).group()
-+        elif index == 1:
-+            # We got a timeout exception.  Print information on what caused it
-+            # and bail out.
-+            error = ('Response does not match the expected pattern.\n'
-+                     'Command: {0}\n'
-+                     'Expected pattern: {1}\n'
-+                     'Response: {2}'.format(command, pattern, gdb.before))
-+
-+            raise pexpect.TIMEOUT(error)
-+    else:
-+        # Consume just the the gdb prompt.
-+        gdb.expect(gdb_prompt)
-+
-+    return match
-+
-+def init_test(test_bin, printer_files, printer_names):
-+    """Loads the test binary file and the required pretty printers to gdb.
-+
-+    Args:
-+        test_bin (string): The name of the test binary file.
-+        pretty_printers (list of strings): A list with the names of the pretty
-+            printer files.
-+    """
-+
-+    # Load all the pretty printer files.  We're assuming these are safe.
-+    for printer_file in printer_files:
-+        test('source {0}'.format(printer_file))
-+
-+    # Disable all the pretty printers.
-+    test('disable pretty-printer', r'0 of [0-9]+ printers enabled')
-+
-+    # Enable only the required printers.
-+    for printer in printer_names:
-+        test('enable pretty-printer {0}'.format(printer),
-+             r'[1-9][0-9]* of [1-9]+ printers enabled')
-+
-+    # Finally, load the test binary.
-+    test('file {0}'.format(test_bin))
-+
-+def go_to_main():
-+    """Executes a gdb 'start' command, which takes us to main."""
-+
-+    test('start', r'main')
-+
-+def get_line_number(file_name, string):
-+    """Returns the number of the line in which 'string' appears within a file.
-+
-+    Args:
-+        file_name (string): The name of the file we'll search through.
-+        string (string): The string we'll look for.
-+
-+    Returns:
-+        int: The number of the line in which 'string' appears, starting from 1.
-+    """
-+    number = -1
-+
-+    with open(file_name) as src_file:
-+        for i, line in enumerate(src_file):
-+            if string in line:
-+                number = i + 1
-+                break
-+
-+    if number == -1:
-+        raise NoLineError(file_name, string)
-+
-+    return number
-+
-+def break_at(file_name, string, temporary=True, thread=None):
-+    """Places a breakpoint on the first line in 'file_name' containing 'string'.
-+
-+    'string' is usually a comment like "Stop here".  Notice this may fail unless
-+    the comment is placed inline next to actual code, e.g.:
-+
-+        ...
-+        /* Stop here */
-+        ...
-+
-+    may fail, while:
-+
-+        ...
-+        some_func(); /* Stop here */
-+        ...
-+
-+    will succeed.
-+
-+    If 'thread' isn't None, the breakpoint will be set for all the threads.
-+    Otherwise, it'll be set only for 'thread'.
-+
-+    Args:
-+        file_name (string): The name of the file we'll place the breakpoint in.
-+        string (string): A string we'll look for inside the file.
-+            We'll place a breakpoint on the line which contains it.
-+        temporary (bool): Whether the breakpoint should be automatically deleted
-+            after we reach it.
-+        thread (int): The number of the thread we'll place the breakpoint for,
-+            as seen by gdb.  If specified, it should be greater than zero.
-+    """
-+
-+    if not thread:
-+        thread_str = ''
-+    else:
-+        thread_str = 'thread {0}'.format(thread)
-+
-+    if temporary:
-+        command = 'tbreak'
-+        break_type = 'Temporary breakpoint'
-+    else:
-+        command = 'break'
-+        break_type = 'Breakpoint'
-+
-+    line_number = str(get_line_number(file_name, string))
-+
-+    test('{0} {1}:{2} {3}'.format(command, file_name, line_number, thread_str),
-+         r'{0} [0-9]+ at 0x[a-f0-9]+: file {1}, line {2}\.'.format(break_type,
-+                                                                   file_name,
-+                                                                   line_number))
-+
-+def continue_cmd(thread=None):
-+    """Executes a gdb 'continue' command.
-+
-+    If 'thread' isn't None, the command will be applied to all the threads.
-+    Otherwise, it'll be applied only to 'thread'.
-+
-+    Args:
-+        thread (int): The number of the thread we'll apply the command to,
-+            as seen by gdb.  If specified, it should be greater than zero.
-+    """
-+
-+    if not thread:
-+        command = 'continue'
-+    else:
-+        command = 'thread apply {0} continue'.format(thread)
-+
-+    test(command)
-+
-+def next_cmd(count=1, thread=None):
-+    """Executes a gdb 'next' command.
-+
-+    If 'thread' isn't None, the command will be applied to all the threads.
-+    Otherwise, it'll be applied only to 'thread'.
-+
-+    Args:
-+        count (int): The 'count' argument of the 'next' command.
-+        thread (int): The number of the thread we'll apply the command to,
-+            as seen by gdb.  If specified, it should be greater than zero.
-+    """
-+
-+    if not thread:
-+        command = 'next'
-+    else:
-+        command = 'thread apply {0} next'
-+
-+    test('{0} {1}'.format(command, count))
-+
-+def select_thread(thread):
-+    """Selects the thread indicated by 'thread'.
-+
-+    Args:
-+        thread (int): The number of the thread we'll switch to, as seen by gdb.
-+            This should be greater than zero.
-+    """
-+
-+    if thread > 0:
-+        test('thread {0}'.format(thread))
-+
-+def get_current_thread_lwpid():
-+    """Gets the current thread's Lightweight Process ID.
-+
-+    Returns:
-+        string: The current thread's LWP ID.
-+    """
-+
-+    # It's easier to get the LWP ID through the Python API than the gdb CLI.
-+    command = 'python print(gdb.selected_thread().ptid[1])'
-+
-+    return test(command, r'[0-9]+')
-+
-+def set_scheduler_locking(mode):
-+    """Executes the gdb 'set scheduler-locking' command.
-+
-+    Args:
-+        mode (bool): Whether the scheduler locking mode should be 'on'.
-+    """
-+    modes = {
-+        True: 'on',
-+        False: 'off'
-+    }
-+
-+    test('set scheduler-locking {0}'.format(modes[mode]))
-+
-+def test_printer(var, to_string, children=None, is_ptr=True):
-+    """ Tests the output of a pretty printer.
-+
-+    For a variable called 'var', this tests whether its associated printer
-+    outputs the expected 'to_string' and children (if any).
-+
-+    Args:
-+        var (string): The name of the variable we'll print.
-+        to_string (raw string): The expected output of the printer's 'to_string'
-+            method.
-+        children (map {raw string->raw string}): A map with the expected output
-+            of the printer's children' method.
-+        is_ptr (bool): Whether 'var' is a pointer, and thus should be
-+            dereferenced.
-+    """
-+
-+    if is_ptr:
-+        var = '*{0}'.format(var)
-+
-+    test('print {0}'.format(var), to_string)
-+
-+    if children:
-+        for name, value in children.items():
-+            # Children are shown as 'name = value'.
-+            test('print {0}'.format(var), r'{0} = {1}'.format(name, value))
-+
-+def check_debug_symbol(symbol):
-+    """ Tests whether a given debugging symbol exists.
-+
-+    If the symbol doesn't exist, raises a DebugError.
-+
-+    Args:
-+        symbol (string): The symbol we're going to check for.
-+    """
-+
-+    try:
-+        test('ptype {0}'.format(symbol), r'type = {0}'.format(symbol))
-+
-+    except pexpect.TIMEOUT:
-+        # The symbol doesn't exist.
-+        raise DebugError(symbol)
-diff --git a/scripts/test_printers_exceptions.py b/scripts/test_printers_exceptions.py
-new file mode 100644
-index 0000000..17034b5
---- /dev/null
-+++ b/scripts/test_printers_exceptions.py
-@@ -0,0 +1,61 @@
-+# Exception classes used when testing the Python pretty printers.
-+#
-+# Copyright (C) 2016 Free Software Foundation, Inc.
-+# This file is part of the GNU C Library.
-+#
-+# The GNU C Library is free software; you can redistribute it and/or
-+# modify it under the terms of the GNU Lesser General Public
-+# License as published by the Free Software Foundation; either
-+# version 2.1 of the License, or (at your option) any later version.
-+#
-+# The GNU C Library is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+# Lesser General Public License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public
-+# License along with the GNU C Library; if not, see
-+# <http://www.gnu.org/licenses/>.
-+
-+class NoLineError(Exception):
-+    """Custom exception to indicate that a test file doesn't contain
-+    the requested string.
-+    """
-+
-+    def __init__(self, file_name, string):
-+        """Constructor.
-+
-+        Args:
-+            file_name (string): The name of the test file.
-+            string (string): The string that was requested.
-+        """
-+
-+        super(NoLineError, self).__init__()
-+        self.file_name = file_name
-+        self.string = string
-+
-+    def __str__(self):
-+        """Shows a readable representation of the exception."""
-+
-+        return ('File {0} has no line containing the following string: {1}'
-+                .format(self.file_name, self.string))
-+
-+class DebugError(Exception):
-+    """Custom exception to indicate that a required debugging symbol is missing.
-+    """
-+
-+    def __init__(self, symbol):
-+        """Constructor.
-+
-+        Args:
-+            symbol (string): The name of the entity whose debug info is missing.
-+        """
-+
-+        super(DebugError, self).__init__()
-+        self.symbol = symbol
-+
-+    def __str__(self):
-+        """Shows a readable representation of the exception."""
-+
-+        return ('The required debugging information for {0} is missing.'
-+                .format(self.symbol))
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
index 7cba6cc..9e207e4 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
@@ -1,7 +1,7 @@
-From c99892f2018cd7fa0f37b53e6cebec99fa036472 Mon Sep 17 00:00:00 2001
+From e53968d61804b6bab32ec6e13cc0b3cd57214796 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 01:51:38 +0000
-Subject: [PATCH 03/25] nativesdk-glibc: Raise the size of arrays containing dl
+Subject: [PATCH 03/26] nativesdk-glibc: Raise the size of arrays containing dl
  paths
 
 This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings
@@ -21,13 +21,14 @@
  elf/interp.c               | 2 +-
  elf/ldconfig.c             | 3 +++
  elf/rtld.c                 | 5 +++--
+ iconv/gconv_conf.c         | 2 +-
  sysdeps/generic/dl-cache.h | 4 ----
- 6 files changed, 13 insertions(+), 9 deletions(-)
+ 7 files changed, 14 insertions(+), 10 deletions(-)
 
-Index: git/elf/dl-cache.c
-===================================================================
---- git.orig/elf/dl-cache.c
-+++ git/elf/dl-cache.c
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index cfa335e..daa12ec 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
 @@ -132,6 +132,10 @@ do									      \
  while (0)
  
@@ -39,11 +40,11 @@
  int
  internal_function
  _dl_cache_libcmp (const char *p1, const char *p2)
-Index: git/elf/dl-load.c
-===================================================================
---- git.orig/elf/dl-load.c
-+++ git/elf/dl-load.c
-@@ -106,8 +106,8 @@ static size_t max_capstrlen attribute_re
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index 3a3d112..a1410e4 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -106,8 +106,8 @@ static size_t max_capstrlen attribute_relro;
  /* Get the generated information about the trusted directories.  */
  #include "trusted-dirs.h"
  
@@ -54,10 +55,10 @@
  {
    SYSTEM_DIRS_LEN
  };
-Index: git/elf/interp.c
-===================================================================
---- git.orig/elf/interp.c
-+++ git/elf/interp.c
+diff --git a/elf/interp.c b/elf/interp.c
+index 9448802..e7e8c70 100644
+--- a/elf/interp.c
++++ b/elf/interp.c
 @@ -18,5 +18,5 @@
  
  #include <runtime-linker.h>
@@ -65,10 +66,10 @@
 -const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp")))
 +const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp")))
    = RUNTIME_LINKER;
-Index: git/elf/ldconfig.c
-===================================================================
---- git.orig/elf/ldconfig.c
-+++ git/elf/ldconfig.c
+diff --git a/elf/ldconfig.c b/elf/ldconfig.c
+index 467ca82..631a2a9 100644
+--- a/elf/ldconfig.c
++++ b/elf/ldconfig.c
 @@ -168,6 +168,9 @@ static struct argp argp =
    options, parse_opt, NULL, doc, NULL, more_help, NULL
  };
@@ -79,10 +80,10 @@
  /* Check if string corresponds to an important hardware capability or
     a platform.  */
  static int
-Index: git/elf/rtld.c
-===================================================================
---- git.orig/elf/rtld.c
-+++ git/elf/rtld.c
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 4ec25d7..e159c12 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
 @@ -99,6 +99,7 @@ uintptr_t __pointer_chk_guard_local
  strong_alias (__pointer_chk_guard_local, __pointer_chk_guard)
  #endif
@@ -91,7 +92,7 @@
  
  /* List of auditing DSOs.  */
  static struct audit_list
-@@ -873,12 +874,12 @@ of this helper program; chances are you
+@@ -854,12 +855,12 @@ of this helper program; chances are you did not intend to run this program.\n\
    --list                list all dependencies and how they are resolved\n\
    --verify              verify that given object really is a dynamically linked\n\
  			object we can handle\n\
@@ -106,10 +107,23 @@
  
        ++_dl_skip_args;
        --_dl_argc;
-Index: git/sysdeps/generic/dl-cache.h
-===================================================================
---- git.orig/sysdeps/generic/dl-cache.h
-+++ git/sysdeps/generic/dl-cache.h
+diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c
+index e235188..569f72e 100644
+--- a/iconv/gconv_conf.c
++++ b/iconv/gconv_conf.c
+@@ -36,7 +36,7 @@
+ 
+ 
+ /* This is the default path where we look for module lists.  */
+-static const char default_gconv_path[] = GCONV_PATH;
++static char default_gconv_path[4096] __attribute__ ((section (".gccrelocprefix"))) = GCONV_PATH;
+ 
+ /* The path elements, as determined by the __gconv_get_path function.
+    All path elements end in a slash.  */
+diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
+index eb2f900..505804e 100644
+--- a/sysdeps/generic/dl-cache.h
++++ b/sysdeps/generic/dl-cache.h
 @@ -27,10 +27,6 @@
    ((flags) == 1 || (flags) == _DL_CACHE_DEFAULT_ID)
  #endif
@@ -121,51 +135,6 @@
  #ifndef add_system_dir
  # define add_system_dir(dir) add_dir (dir)
  #endif
-Index: git/iconv/gconv_conf.c
-===================================================================
---- git.orig/iconv/gconv_conf.c
-+++ git/iconv/gconv_conf.c
-@@ -36,7 +36,7 @@
- 
- 
- /* This is the default path where we look for module lists.  */
--static const char default_gconv_path[] = GCONV_PATH;
-+static char default_gconv_path[4096] __attribute__ ((section (".gccrelocprefix"))) = GCONV_PATH;
- 
- /* The path elements, as determined by the __gconv_get_path function.
-    All path elements end in a slash.  */
-Index: git/locale/findlocale.c
-===================================================================
---- git.orig/locale/findlocale.c
-+++ git/locale/findlocale.c
-@@ -56,7 +56,7 @@ struct __locale_data *const _nl_C[] attr
-    which are somehow addressed.  */
- struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST];
- 
--const char _nl_default_locale_path[] attribute_hidden = COMPLOCALEDIR;
-+char _nl_default_locale_path[4096] __attribute__ ((section (".gccrelocprefix"))) attribute_hidden = COMPLOCALEDIR;
- 
- /* Checks if the name is actually present, that is, not NULL and not
-    empty.  */
-@@ -168,7 +168,7 @@ _nl_find_locale (const char *locale_path
- 
-       /* Nothing in the archive.  Set the default path to search below.  */
-       locale_path = _nl_default_locale_path;
--      locale_path_len = sizeof _nl_default_locale_path;
-+      locale_path_len = strlen(_nl_default_locale_path) + 1;
-     }
-   else
-     /* We really have to load some data.  First see whether the name is
-Index: git/locale/localeinfo.h
-===================================================================
---- git.orig/locale/localeinfo.h
-+++ git/locale/localeinfo.h
-@@ -322,7 +322,7 @@ _nl_lookup_word (locale_t l, int categor
- }
- 
- /* Default search path if no LOCPATH environment variable.  */
--extern const char _nl_default_locale_path[] attribute_hidden;
-+extern char _nl_default_locale_path[] attribute_hidden;
- 
- /* Load the locale data for CATEGORY from the file specified by *NAME.
-    If *NAME is "", use environment variables as specified by POSIX, and
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-New-condvar-implementation-that-provides-stronger-or.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-New-condvar-implementation-that-provides-stronger-or.patch
deleted file mode 100644
index 3c7bfa1..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-New-condvar-implementation-that-provides-stronger-or.patch
+++ /dev/null
@@ -1,7171 +0,0 @@
-From 27af8689a6ba8d182f3cbe6ba42cc654ceed0351 Mon Sep 17 00:00:00 2001
-From: Catalin Enache <catalin.enache@windriver.com>
-Date: Fri, 30 Jun 2017 11:56:41 +0300
-Subject: [PATCH 4/6] New condvar implementation that provides stronger
- ordering guarantees.
-
-This is a new implementation for condition variables, required
-after http://austingroupbugs.net/view.php?id=609 to fix bug 13165.  In
-essence, we need to be stricter in which waiters a signal or broadcast
-is required to wake up; this couldn't be solved using the old algorithm.
-ISO C++ made a similar clarification, so this also fixes a bug in
-current libstdc++, for example.
-
-We can't use the old algorithm anymore because futexes do not guarantee
-to wake in FIFO order.  Thus, when we wake, we can't simply let any
-waiter grab a signal, but we need to ensure that one of the waiters
-happening before the signal is woken up.  This is something the previous
-algorithm violated (see bug 13165).
-
-There's another issue specific to condvars: ABA issues on the underlying
-futexes.  Unlike mutexes that have just three states, or semaphores that
-have no tokens or a limited number of them, the state of a condvar is
-the *order* of the waiters.  A waiter on a semaphore can grab a token
-whenever one is available; a condvar waiter must only consume a signal
-if it is eligible to do so as determined by the relative order of the
-waiter and the signal.
-Therefore, this new algorithm maintains two groups of waiters: Those
-eligible to consume signals (G1), and those that have to wait until
-previous waiters have consumed signals (G2).  Once G1 is empty, G2
-becomes the new G1.  64b counters are used to avoid ABA issues.
-
-This condvar doesn't yet use a requeue optimization (ie, on a broadcast,
-waking just one thread and requeueing all others on the futex of the
-mutex supplied by the program).  I don't think doing the requeue is
-necessarily the right approach (but I haven't done real measurements
-yet):
-* If a program expects to wake many threads at the same time and make
-that scalable, a condvar isn't great anyway because of how it requires
-waiters to operate mutually exclusive (due to the mutex usage).  Thus, a
-thundering herd problem is a scalability problem with or without the
-optimization.  Using something like a semaphore might be more
-appropriate in such a case.
-* The scalability problem is actually at the mutex side; the condvar
-could help (and it tries to with the requeue optimization), but it
-should be the mutex who decides how that is done, and whether it is done
-at all.
-* Forcing all but one waiter into the kernel-side wait queue of the
-mutex prevents/avoids the use of lock elision on the mutex.  Thus, it
-prevents the only cure against the underlying scalability problem
-inherent to condvars.
-* If condvars use short critical sections (ie, hold the mutex just to
-check a binary flag or such), which they should do ideally, then forcing
-all those waiter to proceed serially with kernel-based hand-off (ie,
-futex ops in the mutex' contended state, via the futex wait queues) will
-be less efficient than just letting a scalable mutex implementation take
-care of it.  Our current mutex impl doesn't employ spinning at all, but
-if critical sections are short, spinning can be much better.
-* Doing the requeue stuff requires all waiters to always drive the mutex
-into the contended state.  This leads to each waiter having to call
-futex_wake after lock release, even if this wouldn't be necessary.
-
-    [BZ #13165]
-    * nptl/pthread_cond_broadcast.c (__pthread_cond_broadcast): Rewrite to
-    use new algorithm.
-    * nptl/pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
-    * nptl/pthread_cond_init.c (__pthread_cond_init): Likewise.
-    * nptl/pthread_cond_signal.c (__pthread_cond_signal): Likewise.
-    * nptl/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
-    (__pthread_cond_timedwait): Move here from pthread_cond_timedwait.c.
-    (__condvar_confirm_wakeup, __condvar_cancel_waiting,
-    __condvar_cleanup_waiting, __condvar_dec_grefs,
-    __pthread_cond_wait_common): New.
-    (__condvar_cleanup): Remove.
-    * npt/pthread_condattr_getclock.c (pthread_condattr_getclock): Adapt.
-    * npt/pthread_condattr_setclock.c (pthread_condattr_setclock):
-    Likewise.
-    * npt/pthread_condattr_getpshared.c (pthread_condattr_getpshared):
-    Likewise.
-    * npt/pthread_condattr_init.c (pthread_condattr_init): Likewise.
-    * nptl/tst-cond1.c: Add comment.
-    * nptl/tst-cond20.c (do_test): Adapt.
-    * nptl/tst-cond22.c (do_test): Likewise.
-    * sysdeps/aarch64/nptl/bits/pthreadtypes.h (pthread_cond_t): Adapt
-    structure.
-    * sysdeps/arm/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-    * sysdeps/ia64/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-    * sysdeps/m68k/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-    * sysdeps/microblaze/nptl/bits/pthreadtypes.h (pthread_cond_t):
-    Likewise.
-    * sysdeps/mips/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-    * sysdeps/nios2/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-    * sysdeps/s390/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-    * sysdeps/sh/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-    * sysdeps/tile/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-    * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
-    Likewise.
-    * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h (pthread_cond_t):
-    Likewise.
-    * sysdeps/x86/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-    * sysdeps/nptl/internaltypes.h (COND_NWAITERS_SHIFT): Remove.
-    (COND_CLOCK_BITS): Adapt.
-    * sysdeps/nptl/pthread.h (PTHREAD_COND_INITIALIZER): Adapt.
-    * nptl/pthreadP.h (__PTHREAD_COND_CLOCK_MONOTONIC_MASK,
-    __PTHREAD_COND_SHARED_MASK): New.
-    * nptl/nptl-printers.py (CLOCK_IDS): Remove.
-    (ConditionVariablePrinter, ConditionVariableAttributesPrinter): Adapt.
-    * nptl/nptl_lock_constants.pysym: Adapt.
-    * nptl/test-cond-printers.py: Adapt.
-    * sysdeps/unix/sysv/linux/hppa/internaltypes.h (cond_compat_clear,
-    cond_compat_check_and_clear): Adapt.
-    * sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c: Remove file ...
-    * sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c
-    (__pthread_cond_timedwait): ... and move here.
-    * nptl/DESIGN-condvar.txt: Remove file.
-    * nptl/lowlevelcond.sym: Likewise.
-    * nptl/pthread_cond_timedwait.c: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: Likewise.
-    * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: Likewise.
-    * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
-    * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
-    * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
-    * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
-
-Upstream-Status: Backport
-
-Author: Torvald Riegel <triegel@redhat.com>
-Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
----
- ChangeLog                                          |  74 ++
- nptl/DESIGN-condvar.txt                            | 134 ---
- nptl/Makefile                                      |   6 +-
- nptl/lowlevelcond.sym                              |  16 -
- nptl/nptl-printers.py                              |  70 +-
- nptl/nptl_lock_constants.pysym                     |  27 +-
- nptl/pthreadP.h                                    |   7 +
- nptl/pthread_cond_broadcast.c                      |  99 ++-
- nptl/pthread_cond_common.c                         | 466 ++++++++++
- nptl/pthread_cond_destroy.c                        |  82 +-
- nptl/pthread_cond_init.c                           |  28 +-
- nptl/pthread_cond_signal.c                         |  99 ++-
- nptl/pthread_cond_timedwait.c                      | 268 ------
- nptl/pthread_cond_wait.c                           | 754 ++++++++++++----
- nptl/pthread_condattr_getclock.c                   |   2 +-
- nptl/pthread_condattr_getpshared.c                 |   3 +-
- nptl/pthread_condattr_init.c                       |   4 +-
- nptl/pthread_condattr_setclock.c                   |  11 +-
- nptl/test-cond-printers.py                         |   2 +-
- nptl/tst-cond1.c                                   |   3 +
- nptl/tst-cond20.c                                  |   5 +-
- nptl/tst-cond22.c                                  |  18 +-
- sysdeps/aarch64/nptl/bits/pthreadtypes.h           |  31 +-
- sysdeps/arm/nptl/bits/pthreadtypes.h               |  29 +-
- sysdeps/ia64/nptl/bits/pthreadtypes.h              |  31 +-
- sysdeps/m68k/nptl/bits/pthreadtypes.h              |  32 +-
- sysdeps/microblaze/nptl/bits/pthreadtypes.h        |  29 +-
- sysdeps/mips/nptl/bits/pthreadtypes.h              |  31 +-
- sysdeps/nios2/nptl/bits/pthreadtypes.h             |  31 +-
- sysdeps/nptl/internaltypes.h                       |  17 +-
- sysdeps/nptl/pthread.h                             |   2 +-
- sysdeps/s390/nptl/bits/pthreadtypes.h              |  29 +-
- sysdeps/sh/nptl/bits/pthreadtypes.h                |  29 +-
- sysdeps/tile/nptl/bits/pthreadtypes.h              |  29 +-
- sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h  |  31 +-
- sysdeps/unix/sysv/linux/hppa/internaltypes.h       |  40 +-
- .../unix/sysv/linux/hppa/pthread_cond_timedwait.c  |  41 -
- sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c   |  13 +
- .../sysv/linux/i386/i686/pthread_cond_timedwait.S  |  20 -
- .../unix/sysv/linux/i386/pthread_cond_broadcast.S  | 241 -----
- sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S | 216 -----
- .../unix/sysv/linux/i386/pthread_cond_timedwait.S  | 974 ---------------------
- sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S   | 642 --------------
- .../unix/sysv/linux/powerpc/bits/pthreadtypes.h    |  31 +-
- .../sysv/linux/x86_64/pthread_cond_broadcast.S     | 177 ----
- .../unix/sysv/linux/x86_64/pthread_cond_signal.S   | 161 ----
- .../sysv/linux/x86_64/pthread_cond_timedwait.S     | 623 -------------
- sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S | 555 ------------
- sysdeps/x86/bits/pthreadtypes.h                    |  29 +-
- 49 files changed, 1671 insertions(+), 4621 deletions(-)
- delete mode 100644 nptl/DESIGN-condvar.txt
- delete mode 100644 nptl/lowlevelcond.sym
- create mode 100644 nptl/pthread_cond_common.c
- delete mode 100644 nptl/pthread_cond_timedwait.c
- delete mode 100644 sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c
- delete mode 100644 sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S
- delete mode 100644 sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
- delete mode 100644 sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
- delete mode 100644 sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
- delete mode 100644 sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
- delete mode 100644 sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
- delete mode 100644 sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
- delete mode 100644 sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
- delete mode 100644 sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
-
-diff --git a/ChangeLog b/ChangeLog
-index 8036c1e..c94db7b 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,77 @@
-+2016-12-31  Torvald Riegel  <triegel@redhat.com>
-+
-+	[BZ #13165]
-+	* nptl/pthread_cond_broadcast.c (__pthread_cond_broadcast): Rewrite to
-+	use new algorithm.
-+	* nptl/pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
-+	* nptl/pthread_cond_init.c (__pthread_cond_init): Likewise.
-+	* nptl/pthread_cond_signal.c (__pthread_cond_signal): Likewise.
-+	* nptl/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
-+	(__pthread_cond_timedwait): Move here from pthread_cond_timedwait.c.
-+	(__condvar_confirm_wakeup, __condvar_cancel_waiting,
-+	__condvar_cleanup_waiting, __condvar_dec_grefs,
-+	__pthread_cond_wait_common): New.
-+	(__condvar_cleanup): Remove.
-+	* npt/pthread_condattr_getclock.c (pthread_condattr_getclock): Adapt.
-+	* npt/pthread_condattr_setclock.c (pthread_condattr_setclock):
-+	Likewise.
-+	* npt/pthread_condattr_getpshared.c (pthread_condattr_getpshared):
-+	Likewise.
-+	* npt/pthread_condattr_init.c (pthread_condattr_init): Likewise.
-+	* nptl/tst-cond1.c: Add comment.
-+	* nptl/tst-cond20.c (do_test): Adapt.
-+	* nptl/tst-cond22.c (do_test): Likewise.
-+	* sysdeps/aarch64/nptl/bits/pthreadtypes.h (pthread_cond_t): Adapt
-+	structure.
-+	* sysdeps/arm/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-+	* sysdeps/ia64/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-+	* sysdeps/m68k/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-+	* sysdeps/microblaze/nptl/bits/pthreadtypes.h (pthread_cond_t):
-+	Likewise.
-+	* sysdeps/mips/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-+	* sysdeps/nios2/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-+	* sysdeps/s390/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-+	* sysdeps/sh/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-+	* sysdeps/tile/nptl/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-+	* sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
-+	Likewise.
-+	* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h (pthread_cond_t):
-+	Likewise.
-+	* sysdeps/x86/bits/pthreadtypes.h (pthread_cond_t): Likewise.
-+	* sysdeps/nptl/internaltypes.h (COND_NWAITERS_SHIFT): Remove.
-+	(COND_CLOCK_BITS): Adapt.
-+	* sysdeps/nptl/pthread.h (PTHREAD_COND_INITIALIZER): Adapt.
-+	* nptl/pthreadP.h (__PTHREAD_COND_CLOCK_MONOTONIC_MASK,
-+	__PTHREAD_COND_SHARED_MASK): New.
-+	* nptl/nptl-printers.py (CLOCK_IDS): Remove.
-+	(ConditionVariablePrinter, ConditionVariableAttributesPrinter): Adapt.
-+	* nptl/nptl_lock_constants.pysym: Adapt.
-+	* nptl/test-cond-printers.py: Adapt.
-+	* sysdeps/unix/sysv/linux/hppa/internaltypes.h (cond_compat_clear,
-+	cond_compat_check_and_clear): Adapt.
-+	* sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c: Remove file ...
-+	* sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c
-+	(__pthread_cond_timedwait): ... and move here.
-+	* nptl/DESIGN-condvar.txt: Remove file.
-+	* nptl/lowlevelcond.sym: Likewise.
-+	* nptl/pthread_cond_timedwait.c: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: Likewise.
-+	* sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: Likewise.
-+	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
-+	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
-+	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
-+	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
-+
- 2016-12-08  Martin Galvan  <martin.galvan@tallertechnologies.com>
- 
- 	* INSTALL: Regenerated.
-diff --git a/nptl/DESIGN-condvar.txt b/nptl/DESIGN-condvar.txt
-deleted file mode 100644
-index 4845251..0000000
---- a/nptl/DESIGN-condvar.txt
-+++ /dev/null
-@@ -1,134 +0,0 @@
--Conditional Variable pseudocode.
--================================
--
--       int pthread_cond_timedwait (pthread_cond_t *cv, pthread_mutex_t *mutex);
--       int pthread_cond_signal    (pthread_cond_t *cv);
--       int pthread_cond_broadcast (pthread_cond_t *cv);
--
--struct pthread_cond_t {
--
--   unsigned int cond_lock;
--
--         internal mutex
--
--   uint64_t total_seq;
--
--     Total number of threads using the conditional variable.
--
--   uint64_t wakeup_seq;
--
--     sequence number for next wakeup.
--
--   uint64_t woken_seq;
--
--     sequence number of last woken thread.
--
--   uint32_t broadcast_seq;
--
--}
--
--
--struct cv_data {
--
--   pthread_cond_t *cv;
--
--   uint32_t bc_seq
--
--}
--
--
--
--cleanup_handler(cv_data)
--{
--  cv = cv_data->cv;
--  lll_lock(cv->lock);
--
--  if (cv_data->bc_seq == cv->broadcast_seq) {
--    ++cv->wakeup_seq;
--    ++cv->woken_seq;
--  }
--
--  /* make sure no signal gets lost.  */
--  FUTEX_WAKE(cv->wakeup_seq, ALL);
--
--  lll_unlock(cv->lock);
--}
--
--
--cond_timedwait(cv, mutex, timeout):
--{
--   lll_lock(cv->lock);
--   mutex_unlock(mutex);
--
--   cleanup_push
--
--   ++cv->total_seq;
--   val = seq =  cv->wakeup_seq;
--   cv_data.bc = cv->broadcast_seq;
--   cv_data.cv = cv;
--
--   while (1) {
--
--     lll_unlock(cv->lock);
--
--     enable_async(&cv_data);
--
--     ret = FUTEX_WAIT(cv->wakeup_seq, val, timeout);
--
--     restore_async
--
--     lll_lock(cv->lock);
--
--     if (bc != cv->broadcast_seq)
--       goto bc_out;
--
--     val = cv->wakeup_seq;
--
--     if (val != seq && cv->woken_seq != val) {
--       ret = 0;
--       break;
--     }
--
--     if (ret == TIMEDOUT) {
--       ++cv->wakeup_seq;
--       break;
--     }
--   }
--
--   ++cv->woken_seq;
--
-- bc_out:
--   lll_unlock(cv->lock);
--
--   cleanup_pop
--
--   mutex_lock(mutex);
--
--   return ret;
--}
--
--cond_signal(cv)
--{
--   lll_lock(cv->lock);
--
--   if (cv->total_seq > cv->wakeup_seq) {
--     ++cv->wakeup_seq;
--     FUTEX_WAKE(cv->wakeup_seq, 1);
--   }
--
--   lll_unlock(cv->lock);
--}
--
--cond_broadcast(cv)
--{
--   lll_lock(cv->lock);
--
--   if (cv->total_seq > cv->wakeup_seq) {
--     cv->wakeup_seq = cv->total_seq;
--     cv->woken_seq = cv->total_seq;
--     ++cv->broadcast_seq;
--     FUTEX_WAKE(cv->wakeup_seq, ALL);
--   }
--
--   lll_unlock(cv->lock);
--}
-diff --git a/nptl/Makefile b/nptl/Makefile
-index 49f6ba6..1f0674c 100644
---- a/nptl/Makefile
-+++ b/nptl/Makefile
-@@ -71,7 +71,7 @@ libpthread-routines = nptl-init vars events version pt-interp \
- 		      pthread_rwlockattr_getkind_np \
- 		      pthread_rwlockattr_setkind_np \
- 		      pthread_cond_init pthread_cond_destroy \
--		      pthread_cond_wait pthread_cond_timedwait \
-+		      pthread_cond_wait \
- 		      pthread_cond_signal pthread_cond_broadcast \
- 		      old_pthread_cond_init old_pthread_cond_destroy \
- 		      old_pthread_cond_wait old_pthread_cond_timedwait \
-@@ -181,7 +181,6 @@ CFLAGS-pthread_timedjoin.c = -fexceptions -fasynchronous-unwind-tables
- CFLAGS-pthread_once.c = $(uses-callbacks) -fexceptions \
- 			-fasynchronous-unwind-tables
- CFLAGS-pthread_cond_wait.c = -fexceptions -fasynchronous-unwind-tables
--CFLAGS-pthread_cond_timedwait.c = -fexceptions -fasynchronous-unwind-tables
- CFLAGS-sem_wait.c = -fexceptions -fasynchronous-unwind-tables
- CFLAGS-sem_timedwait.c = -fexceptions -fasynchronous-unwind-tables
- 
-@@ -303,8 +302,7 @@ test-xfail-tst-once5 = yes
- # Files which must not be linked with libpthread.
- tests-nolibpthread = tst-unload
- 
--gen-as-const-headers = pthread-errnos.sym \
--		       lowlevelcond.sym lowlevelrwlock.sym \
-+gen-as-const-headers = pthread-errnos.sym lowlevelrwlock.sym \
- 		       unwindbuf.sym \
- 		       lowlevelrobustlock.sym pthread-pi-defines.sym
- 
-diff --git a/nptl/lowlevelcond.sym b/nptl/lowlevelcond.sym
-deleted file mode 100644
-index 18e1ada..0000000
---- a/nptl/lowlevelcond.sym
-+++ /dev/null
-@@ -1,16 +0,0 @@
--#include <stddef.h>
--#include <sched.h>
--#include <bits/pthreadtypes.h>
--#include <internaltypes.h>
--
----
--
--cond_lock	offsetof (pthread_cond_t, __data.__lock)
--cond_futex	offsetof (pthread_cond_t, __data.__futex)
--cond_nwaiters	offsetof (pthread_cond_t, __data.__nwaiters)
--total_seq	offsetof (pthread_cond_t, __data.__total_seq)
--wakeup_seq	offsetof (pthread_cond_t, __data.__wakeup_seq)
--woken_seq	offsetof (pthread_cond_t, __data.__woken_seq)
--dep_mutex	offsetof (pthread_cond_t, __data.__mutex)
--broadcast_seq	offsetof (pthread_cond_t, __data.__broadcast_seq)
--nwaiters_shift	COND_NWAITERS_SHIFT
-diff --git a/nptl/nptl-printers.py b/nptl/nptl-printers.py
-index e402f23..76adadd 100644
---- a/nptl/nptl-printers.py
-+++ b/nptl/nptl-printers.py
-@@ -293,16 +293,6 @@ class MutexAttributesPrinter(object):
-         elif protocol == PTHREAD_PRIO_PROTECT:
-             self.values.append(('Protocol', 'Priority protect'))
- 
--CLOCK_IDS = {
--    CLOCK_REALTIME: 'CLOCK_REALTIME',
--    CLOCK_MONOTONIC: 'CLOCK_MONOTONIC',
--    CLOCK_PROCESS_CPUTIME_ID: 'CLOCK_PROCESS_CPUTIME_ID',
--    CLOCK_THREAD_CPUTIME_ID: 'CLOCK_THREAD_CPUTIME_ID',
--    CLOCK_MONOTONIC_RAW: 'CLOCK_MONOTONIC_RAW',
--    CLOCK_REALTIME_COARSE: 'CLOCK_REALTIME_COARSE',
--    CLOCK_MONOTONIC_COARSE: 'CLOCK_MONOTONIC_COARSE'
--}
--
- class ConditionVariablePrinter(object):
-     """Pretty printer for pthread_cond_t."""
- 
-@@ -313,24 +303,8 @@ class ConditionVariablePrinter(object):
-             cond: A gdb.value representing a pthread_cond_t.
-         """
- 
--        # Since PTHREAD_COND_SHARED is an integer, we need to cast it to void *
--        # to be able to compare it to the condvar's __data.__mutex member.
--        #
--        # While it looks like self.shared_value should be a class variable,
--        # that would result in it having an incorrect size if we're loading
--        # these printers through .gdbinit for a 64-bit objfile in AMD64.
--        # This is because gdb initially assumes the pointer size to be 4 bytes,
--        # and only sets it to 8 after loading the 64-bit objfiles.  Since
--        # .gdbinit runs before any objfiles are loaded, this would effectively
--        # make self.shared_value have a size of 4, thus breaking later
--        # comparisons with pointers whose types are looked up at runtime.
--        void_ptr_type = gdb.lookup_type('void').pointer()
--        self.shared_value = gdb.Value(PTHREAD_COND_SHARED).cast(void_ptr_type)
--
-         data = cond['__data']
--        self.total_seq = data['__total_seq']
--        self.mutex = data['__mutex']
--        self.nwaiters = data['__nwaiters']
-+        self.wrefs = data['__wrefs']
-         self.values = []
- 
-         self.read_values()
-@@ -360,7 +334,6 @@ class ConditionVariablePrinter(object):
- 
-         self.read_status()
-         self.read_attributes()
--        self.read_mutex_info()
- 
-     def read_status(self):
-         """Read the status of the condvar.
-@@ -369,41 +342,22 @@ class ConditionVariablePrinter(object):
-         are waiting for it.
-         """
- 
--        if self.total_seq == PTHREAD_COND_DESTROYED:
--            self.values.append(('Status', 'Destroyed'))
--
--        self.values.append(('Threads waiting for this condvar',
--                            self.nwaiters >> COND_NWAITERS_SHIFT))
-+        self.values.append(('Threads known to still execute a wait function',
-+                            self.wrefs >> PTHREAD_COND_WREFS_SHIFT))
- 
-     def read_attributes(self):
-         """Read the condvar's attributes."""
- 
--        clock_id = self.nwaiters & ((1 << COND_NWAITERS_SHIFT) - 1)
--
--        # clock_id must be casted to int because it's a gdb.Value
--        self.values.append(('Clock ID', CLOCK_IDS[int(clock_id)]))
-+	if (self.wrefs & PTHREAD_COND_CLOCK_MONOTONIC_MASK) != 0:
-+		self.values.append(('Clock ID', 'CLOCK_MONOTONIC'))
-+	else:
-+		self.values.append(('Clock ID', 'CLOCK_REALTIME'))
- 
--        shared = (self.mutex == self.shared_value)
--
--        if shared:
-+        if (self.wrefs & PTHREAD_COND_SHARED_MASK) != 0:
-             self.values.append(('Shared', 'Yes'))
-         else:
-             self.values.append(('Shared', 'No'))
- 
--    def read_mutex_info(self):
--        """Read the data of the mutex this condvar is bound to.
--
--        A pthread_cond_t's __data.__mutex member is a void * which
--        must be casted to pthread_mutex_t *.  For shared condvars, this
--        member isn't recorded and has a special value instead.
--        """
--
--        if self.mutex and self.mutex != self.shared_value:
--            mutex_type = gdb.lookup_type('pthread_mutex_t')
--            mutex = self.mutex.cast(mutex_type.pointer()).dereference()
--
--            self.values.append(('Mutex', mutex))
--
- class ConditionVariableAttributesPrinter(object):
-     """Pretty printer for pthread_condattr_t.
- 
-@@ -453,10 +407,12 @@ class ConditionVariableAttributesPrinter(object):
-         created in self.children.
-         """
- 
--        clock_id = self.condattr & ((1 << COND_NWAITERS_SHIFT) - 1)
-+        clock_id = (self.condattr >> 1) & ((1 << COND_CLOCK_BITS) - 1)
- 
--        # clock_id must be casted to int because it's a gdb.Value
--        self.values.append(('Clock ID', CLOCK_IDS[int(clock_id)]))
-+	if clock_id != 0:
-+		self.values.append(('Clock ID', 'CLOCK_MONOTONIC'))
-+	else:
-+		self.values.append(('Clock ID', 'CLOCK_REALTIME'))
- 
-         if self.condattr & 1:
-             self.values.append(('Shared', 'Yes'))
-diff --git a/nptl/nptl_lock_constants.pysym b/nptl/nptl_lock_constants.pysym
-index 303ec61..2ab3179 100644
---- a/nptl/nptl_lock_constants.pysym
-+++ b/nptl/nptl_lock_constants.pysym
-@@ -44,26 +44,13 @@ PTHREAD_PRIO_NONE
- PTHREAD_PRIO_INHERIT
- PTHREAD_PRIO_PROTECT
- 
---- These values are hardcoded as well:
---- Value of __mutex for shared condvars.
--PTHREAD_COND_SHARED             (void *)~0l
--
---- Value of __total_seq for destroyed condvars.
--PTHREAD_COND_DESTROYED          -1ull
--
---- __nwaiters encodes the number of threads waiting on a condvar
---- and the clock ID.
---- __nwaiters >> COND_NWAITERS_SHIFT gives us the number of waiters.
--COND_NWAITERS_SHIFT
--
---- Condvar clock IDs
--CLOCK_REALTIME
--CLOCK_MONOTONIC
--CLOCK_PROCESS_CPUTIME_ID
--CLOCK_THREAD_CPUTIME_ID
--CLOCK_MONOTONIC_RAW
--CLOCK_REALTIME_COARSE
--CLOCK_MONOTONIC_COARSE
-+-- Condition variable
-+-- FIXME Why do macros prefixed with __ cannot be used directly?
-+PTHREAD_COND_SHARED_MASK          __PTHREAD_COND_SHARED_MASK
-+PTHREAD_COND_CLOCK_MONOTONIC_MASK __PTHREAD_COND_CLOCK_MONOTONIC_MASK
-+COND_CLOCK_BITS
-+-- These values are hardcoded:
-+PTHREAD_COND_WREFS_SHIFT          3
- 
- -- Rwlock attributes
- PTHREAD_RWLOCK_PREFER_READER_NP
-diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
-index 4edc74b..e9992bc 100644
---- a/nptl/pthreadP.h
-+++ b/nptl/pthreadP.h
-@@ -167,6 +167,13 @@ enum
- #define __PTHREAD_ONCE_FORK_GEN_INCR	4
- 
- 
-+/* Condition variable definitions.  See __pthread_cond_wait_common.
-+   Need to be defined here so there is one place from which
-+   nptl_lock_constants can grab them.  */
-+#define __PTHREAD_COND_CLOCK_MONOTONIC_MASK 2
-+#define __PTHREAD_COND_SHARED_MASK 1
-+
-+
- /* Internal variables.  */
- 
- 
-diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c
-index 552fd42..87c0755 100644
---- a/nptl/pthread_cond_broadcast.c
-+++ b/nptl/pthread_cond_broadcast.c
-@@ -19,72 +19,71 @@
- #include <endian.h>
- #include <errno.h>
- #include <sysdep.h>
--#include <lowlevellock.h>
-+#include <futex-internal.h>
- #include <pthread.h>
- #include <pthreadP.h>
- #include <stap-probe.h>
-+#include <atomic.h>
- 
- #include <shlib-compat.h>
--#include <kernel-features.h>
- 
-+#include "pthread_cond_common.c"
- 
-+
-+/* We do the following steps from __pthread_cond_signal in one critical
-+   section: (1) signal all waiters in G1, (2) close G1 so that it can become
-+   the new G2 and make G2 the new G1, and (3) signal all waiters in the new
-+   G1.  We don't need to do all these steps if there are no waiters in G1
-+   and/or G2.  See __pthread_cond_signal for further details.  */
- int
- __pthread_cond_broadcast (pthread_cond_t *cond)
- {
-   LIBC_PROBE (cond_broadcast, 1, cond);
- 
--  int pshared = (cond->__data.__mutex == (void *) ~0l)
--		? LLL_SHARED : LLL_PRIVATE;
--  /* Make sure we are alone.  */
--  lll_lock (cond->__data.__lock, pshared);
-+  unsigned int wrefs = atomic_load_relaxed (&cond->__data.__wrefs);
-+  if (wrefs >> 3 == 0)
-+    return 0;
-+  int private = __condvar_get_private (wrefs);
-+
-+  __condvar_acquire_lock (cond, private);
- 
--  /* Are there any waiters to be woken?  */
--  if (cond->__data.__total_seq > cond->__data.__wakeup_seq)
-+  unsigned long long int wseq = __condvar_load_wseq_relaxed (cond);
-+  unsigned int g2 = wseq & 1;
-+  unsigned int g1 = g2 ^ 1;
-+  wseq >>= 1;
-+  bool do_futex_wake = false;
-+
-+  /* Step (1): signal all waiters remaining in G1.  */
-+  if (cond->__data.__g_size[g1] != 0)
-     {
--      /* Yes.  Mark them all as woken.  */
--      cond->__data.__wakeup_seq = cond->__data.__total_seq;
--      cond->__data.__woken_seq = cond->__data.__total_seq;
--      cond->__data.__futex = (unsigned int) cond->__data.__total_seq * 2;
--      int futex_val = cond->__data.__futex;
--      /* Signal that a broadcast happened.  */
--      ++cond->__data.__broadcast_seq;
--
--      /* We are done.  */
--      lll_unlock (cond->__data.__lock, pshared);
--
--      /* Wake everybody.  */
--      pthread_mutex_t *mut = (pthread_mutex_t *) cond->__data.__mutex;
--
--      /* Do not use requeue for pshared condvars.  */
--      if (mut == (void *) ~0l
--	  || PTHREAD_MUTEX_PSHARED (mut) & PTHREAD_MUTEX_PSHARED_BIT)
--	goto wake_all;
--
--#if (defined lll_futex_cmp_requeue_pi \
--     && defined __ASSUME_REQUEUE_PI)
--      if (USE_REQUEUE_PI (mut))
--	{
--	  if (lll_futex_cmp_requeue_pi (&cond->__data.__futex, 1, INT_MAX,
--					&mut->__data.__lock, futex_val,
--					LLL_PRIVATE) == 0)
--	    return 0;
--	}
--      else
--#endif
--	/* lll_futex_requeue returns 0 for success and non-zero
--	   for errors.  */
--	if (!__builtin_expect (lll_futex_requeue (&cond->__data.__futex, 1,
--						  INT_MAX, &mut->__data.__lock,
--						  futex_val, LLL_PRIVATE), 0))
--	  return 0;
--
--wake_all:
--      lll_futex_wake (&cond->__data.__futex, INT_MAX, pshared);
--      return 0;
-+      /* Add as many signals as the remaining size of the group.  */
-+      atomic_fetch_add_relaxed (cond->__data.__g_signals + g1,
-+				cond->__data.__g_size[g1] << 1);
-+      cond->__data.__g_size[g1] = 0;
-+
-+      /* We need to wake G1 waiters before we quiesce G1 below.  */
-+      /* TODO Only set it if there are indeed futex waiters.  We could
-+	 also try to move this out of the critical section in cases when
-+	 G2 is empty (and we don't need to quiesce).  */
-+      futex_wake (cond->__data.__g_signals + g1, INT_MAX, private);
-     }
- 
--  /* We are done.  */
--  lll_unlock (cond->__data.__lock, pshared);
-+  /* G1 is complete.  Step (2) is next unless there are no waiters in G2, in
-+     which case we can stop.  */
-+  if (__condvar_quiesce_and_switch_g1 (cond, wseq, &g1, private))
-+    {
-+      /* Step (3): Send signals to all waiters in the old G2 / new G1.  */
-+      atomic_fetch_add_relaxed (cond->__data.__g_signals + g1,
-+				cond->__data.__g_size[g1] << 1);
-+      cond->__data.__g_size[g1] = 0;
-+      /* TODO Only set it if there are indeed futex waiters.  */
-+      do_futex_wake = true;
-+    }
-+
-+  __condvar_release_lock (cond, private);
-+
-+  if (do_futex_wake)
-+    futex_wake (cond->__data.__g_signals + g1, INT_MAX, private);
- 
-   return 0;
- }
-diff --git a/nptl/pthread_cond_common.c b/nptl/pthread_cond_common.c
-new file mode 100644
-index 0000000..b374396
---- /dev/null
-+++ b/nptl/pthread_cond_common.c
-@@ -0,0 +1,466 @@
-+/* pthread_cond_common -- shared code for condition variable.
-+   Copyright (C) 2016 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
-+#include <atomic.h>
-+#include <stdint.h>
-+#include <pthread.h>
-+#include <libc-internal.h>
-+
-+/* We need 3 least-significant bits on __wrefs for something else.  */
-+#define __PTHREAD_COND_MAX_GROUP_SIZE ((unsigned) 1 << 29)
-+
-+#if __HAVE_64B_ATOMICS == 1
-+
-+static uint64_t __attribute__ ((unused))
-+__condvar_load_wseq_relaxed (pthread_cond_t *cond)
-+{
-+  return atomic_load_relaxed (&cond->__data.__wseq);
-+}
-+
-+static uint64_t __attribute__ ((unused))
-+__condvar_fetch_add_wseq_acquire (pthread_cond_t *cond, unsigned int val)
-+{
-+  return atomic_fetch_add_acquire (&cond->__data.__wseq, val);
-+}
-+
-+static uint64_t __attribute__ ((unused))
-+__condvar_fetch_xor_wseq_release (pthread_cond_t *cond, unsigned int val)
-+{
-+  return atomic_fetch_xor_release (&cond->__data.__wseq, val);
-+}
-+
-+static uint64_t __attribute__ ((unused))
-+__condvar_load_g1_start_relaxed (pthread_cond_t *cond)
-+{
-+  return atomic_load_relaxed (&cond->__data.__g1_start);
-+}
-+
-+static void __attribute__ ((unused))
-+__condvar_add_g1_start_relaxed (pthread_cond_t *cond, unsigned int val)
-+{
-+  atomic_store_relaxed (&cond->__data.__g1_start,
-+      atomic_load_relaxed (&cond->__data.__g1_start) + val);
-+}
-+
-+#else
-+
-+/* We use two 64b counters: __wseq and __g1_start.  They are monotonically
-+   increasing and single-writer-multiple-readers counters, so we can implement
-+   load, fetch-and-add, and fetch-and-xor operations even when we just have
-+   32b atomics.  Values we add or xor are less than or equal to 1<<31 (*),
-+   so we only have to make overflow-and-addition atomic wrt. to concurrent
-+   load operations and xor operations.  To do that, we split each counter into
-+   two 32b values of which we reserve the MSB of each to represent an
-+   overflow from the lower-order half to the higher-order half.
-+
-+   In the common case, the state is (higher-order / lower-order half, and . is
-+   basically concatenation of the bits):
-+   0.h     / 0.l  = h.l
-+
-+   When we add a value of x that overflows (i.e., 0.l + x == 1.L), we run the
-+   following steps S1-S4 (the values these represent are on the right-hand
-+   side):
-+   S1:  0.h     / 1.L == (h+1).L
-+   S2:  1.(h+1) / 1.L == (h+1).L
-+   S3:  1.(h+1) / 0.L == (h+1).L
-+   S4:  0.(h+1) / 0.L == (h+1).L
-+   If the LSB of the higher-order half is set, readers will ignore the
-+   overflow bit in the lower-order half.
-+
-+   To get an atomic snapshot in load operations, we exploit that the
-+   higher-order half is monotonically increasing; if we load a value V from
-+   it, then read the lower-order half, and then read the higher-order half
-+   again and see the same value V, we know that both halves have existed in
-+   the sequence of values the full counter had.  This is similar to the
-+   validated reads in the time-based STMs in GCC's libitm (e.g.,
-+   method_ml_wt).
-+
-+   The xor operation needs to be an atomic read-modify-write.  The write
-+   itself is not an issue as it affects just the lower-order half but not bits
-+   used in the add operation.  To make the full fetch-and-xor atomic, we
-+   exploit that concurrently, the value can increase by at most 1<<31 (*): The
-+   xor operation is only called while having acquired the lock, so not more
-+   than __PTHREAD_COND_MAX_GROUP_SIZE waiters can enter concurrently and thus
-+   increment __wseq.  Therefore, if the xor operation observes a value of
-+   __wseq, then the value it applies the modification to later on can be
-+   derived (see below).
-+
-+   One benefit of this scheme is that this makes load operations
-+   obstruction-free because unlike if we would just lock the counter, readers
-+   can almost always interpret a snapshot of each halves.  Readers can be
-+   forced to read a new snapshot when the read is concurrent with an overflow.
-+   However, overflows will happen infrequently, so load operations are
-+   practically lock-free.
-+
-+   (*) The highest value we add is __PTHREAD_COND_MAX_GROUP_SIZE << 2 to
-+   __g1_start (the two extra bits are for the lock in the two LSBs of
-+   __g1_start).  */
-+
-+typedef struct
-+{
-+  unsigned int low;
-+  unsigned int high;
-+} _condvar_lohi;
-+
-+static uint64_t
-+__condvar_fetch_add_64_relaxed (_condvar_lohi *lh, unsigned int op)
-+{
-+  /* S1. Note that this is an atomic read-modify-write so it extends the
-+     release sequence of release MO store at S3.  */
-+  unsigned int l = atomic_fetch_add_relaxed (&lh->low, op);
-+  unsigned int h = atomic_load_relaxed (&lh->high);
-+  uint64_t result = ((uint64_t) h << 31) | l;
-+  l += op;
-+  if ((l >> 31) > 0)
-+    {
-+      /* Overflow.  Need to increment higher-order half.  Note that all
-+	 add operations are ordered in happens-before.  */
-+      h++;
-+      /* S2. Release MO to synchronize with the loads of the higher-order half
-+	 in the load operation.  See __condvar_load_64_relaxed.  */
-+      atomic_store_release (&lh->high, h | ((unsigned int) 1 << 31));
-+      l ^= (unsigned int) 1 << 31;
-+      /* S3.  See __condvar_load_64_relaxed.  */
-+      atomic_store_release (&lh->low, l);
-+      /* S4.  Likewise.  */
-+      atomic_store_release (&lh->high, h);
-+    }
-+  return result;
-+}
-+
-+static uint64_t
-+__condvar_load_64_relaxed (_condvar_lohi *lh)
-+{
-+  unsigned int h, l, h2;
-+  do
-+    {
-+      /* This load and the second one below to the same location read from the
-+	 stores in the overflow handling of the add operation or the
-+	 initializing stores (which is a simple special case because
-+	 initialization always completely happens before further use).
-+	 Because no two stores to the higher-order half write the same value,
-+	 the loop ensures that if we continue to use the snapshot, this load
-+	 and the second one read from the same store operation.  All candidate
-+	 store operations have release MO.
-+	 If we read from S2 in the first load, then we will see the value of
-+	 S1 on the next load (because we synchronize with S2), or a value
-+	 later in modification order.  We correctly ignore the lower-half's
-+	 overflow bit in this case.  If we read from S4, then we will see the
-+	 value of S3 in the next load (or a later value), which does not have
-+	 the overflow bit set anymore.
-+	  */
-+      h = atomic_load_acquire (&lh->high);
-+      /* This will read from the release sequence of S3 (i.e, either the S3
-+	 store or the read-modify-writes at S1 following S3 in modification
-+	 order).  Thus, the read synchronizes with S3, and the following load
-+	 of the higher-order half will read from the matching S2 (or a later
-+	 value).
-+	 Thus, if we read a lower-half value here that already overflowed and
-+	 belongs to an increased higher-order half value, we will see the
-+	 latter and h and h2 will not be equal.  */
-+      l = atomic_load_acquire (&lh->low);
-+      /* See above.  */
-+      h2 = atomic_load_relaxed (&lh->high);
-+    }
-+  while (h != h2);
-+  if (((l >> 31) > 0) && ((h >> 31) > 0))
-+    l ^= (unsigned int) 1 << 31;
-+  return ((uint64_t) (h & ~((unsigned int) 1 << 31)) << 31) + l;
-+}
-+
-+static uint64_t __attribute__ ((unused))
-+__condvar_load_wseq_relaxed (pthread_cond_t *cond)
-+{
-+  return __condvar_load_64_relaxed ((_condvar_lohi *) &cond->__data.__wseq32);
-+}
-+
-+static uint64_t __attribute__ ((unused))
-+__condvar_fetch_add_wseq_acquire (pthread_cond_t *cond, unsigned int val)
-+{
-+  uint64_t r = __condvar_fetch_add_64_relaxed
-+      ((_condvar_lohi *) &cond->__data.__wseq32, val);
-+  atomic_thread_fence_acquire ();
-+  return r;
-+}
-+
-+static uint64_t __attribute__ ((unused))
-+__condvar_fetch_xor_wseq_release (pthread_cond_t *cond, unsigned int val)
-+{
-+  _condvar_lohi *lh = (_condvar_lohi *) &cond->__data.__wseq32;
-+  /* First, get the current value.  See __condvar_load_64_relaxed.  */
-+  unsigned int h, l, h2;
-+  do
-+    {
-+      h = atomic_load_acquire (&lh->high);
-+      l = atomic_load_acquire (&lh->low);
-+      h2 = atomic_load_relaxed (&lh->high);
-+    }
-+  while (h != h2);
-+  if (((l >> 31) > 0) && ((h >> 31) == 0))
-+    h++;
-+  h &= ~((unsigned int) 1 << 31);
-+  l &= ~((unsigned int) 1 << 31);
-+
-+  /* Now modify.  Due to the coherence rules, the prior load will read a value
-+     earlier in modification order than the following fetch-xor.
-+     This uses release MO to make the full operation have release semantics
-+     (all other operations access the lower-order half).  */
-+  unsigned int l2 = atomic_fetch_xor_release (&lh->low, val)
-+      & ~((unsigned int) 1 << 31);
-+  if (l2 < l)
-+    /* The lower-order half overflowed in the meantime.  This happened exactly
-+       once due to the limit on concurrent waiters (see above).  */
-+    h++;
-+  return ((uint64_t) h << 31) + l2;
-+}
-+
-+static uint64_t __attribute__ ((unused))
-+__condvar_load_g1_start_relaxed (pthread_cond_t *cond)
-+{
-+  return __condvar_load_64_relaxed
-+      ((_condvar_lohi *) &cond->__data.__g1_start32);
-+}
-+
-+static void __attribute__ ((unused))
-+__condvar_add_g1_start_relaxed (pthread_cond_t *cond, unsigned int val)
-+{
-+  ignore_value (__condvar_fetch_add_64_relaxed
-+      ((_condvar_lohi *) &cond->__data.__g1_start32, val));
-+}
-+
-+#endif  /* !__HAVE_64B_ATOMICS  */
-+
-+
-+/* The lock that signalers use.  See pthread_cond_wait_common for uses.
-+   The lock is our normal three-state lock: not acquired (0) / acquired (1) /
-+   acquired-with-futex_wake-request (2).  However, we need to preserve the
-+   other bits in the unsigned int used for the lock, and therefore it is a
-+   little more complex.  */
-+static void __attribute__ ((unused))
-+__condvar_acquire_lock (pthread_cond_t *cond, int private)
-+{
-+  unsigned int s = atomic_load_relaxed (&cond->__data.__g1_orig_size);
-+  while ((s & 3) == 0)
-+    {
-+      if (atomic_compare_exchange_weak_acquire (&cond->__data.__g1_orig_size,
-+	  &s, s | 1))
-+	return;
-+      /* TODO Spinning and back-off.  */
-+    }
-+  /* We can't change from not acquired to acquired, so try to change to
-+     acquired-with-futex-wake-request and do a futex wait if we cannot change
-+     from not acquired.  */
-+  while (1)
-+    {
-+      while ((s & 3) != 2)
-+	{
-+	  if (atomic_compare_exchange_weak_acquire
-+	      (&cond->__data.__g1_orig_size, &s, (s & ~(unsigned int) 3) | 2))
-+	    {
-+	      if ((s & 3) == 0)
-+		return;
-+	      break;
-+	    }
-+	  /* TODO Back off.  */
-+	}
-+      futex_wait_simple (&cond->__data.__g1_orig_size,
-+	  (s & ~(unsigned int) 3) | 2, private);
-+      /* Reload so we see a recent value.  */
-+      s = atomic_load_relaxed (&cond->__data.__g1_orig_size);
-+    }
-+}
-+
-+/* See __condvar_acquire_lock.  */
-+static void __attribute__ ((unused))
-+__condvar_release_lock (pthread_cond_t *cond, int private)
-+{
-+  if ((atomic_fetch_and_release (&cond->__data.__g1_orig_size,
-+				 ~(unsigned int) 3) & 3)
-+      == 2)
-+    futex_wake (&cond->__data.__g1_orig_size, 1, private);
-+}
-+
-+/* Only use this when having acquired the lock.  */
-+static unsigned int __attribute__ ((unused))
-+__condvar_get_orig_size (pthread_cond_t *cond)
-+{
-+  return atomic_load_relaxed (&cond->__data.__g1_orig_size) >> 2;
-+}
-+
-+/* Only use this when having acquired the lock.  */
-+static void __attribute__ ((unused))
-+__condvar_set_orig_size (pthread_cond_t *cond, unsigned int size)
-+{
-+  /* We have acquired the lock, but might get one concurrent update due to a
-+     lock state change from acquired to acquired-with-futex_wake-request.
-+     The store with relaxed MO is fine because there will be no further
-+     changes to the lock bits nor the size, and we will subsequently release
-+     the lock with release MO.  */
-+  unsigned int s;
-+  s = (atomic_load_relaxed (&cond->__data.__g1_orig_size) & 3)
-+      | (size << 2);
-+  if ((atomic_exchange_relaxed (&cond->__data.__g1_orig_size, s) & 3)
-+      != (s & 3))
-+    atomic_store_relaxed (&cond->__data.__g1_orig_size, (size << 2) | 2);
-+}
-+
-+/* Returns FUTEX_SHARED or FUTEX_PRIVATE based on the provided __wrefs
-+   value.  */
-+static int __attribute__ ((unused))
-+__condvar_get_private (int flags)
-+{
-+  if ((flags & __PTHREAD_COND_SHARED_MASK) == 0)
-+    return FUTEX_PRIVATE;
-+  else
-+    return FUTEX_SHARED;
-+}
-+
-+/* This closes G1 (whose index is in G1INDEX), waits for all futex waiters to
-+   leave G1, converts G1 into a fresh G2, and then switches group roles so that
-+   the former G2 becomes the new G1 ending at the current __wseq value when we
-+   eventually make the switch (WSEQ is just an observation of __wseq by the
-+   signaler).
-+   If G2 is empty, it will not switch groups because then it would create an
-+   empty G1 which would require switching groups again on the next signal.
-+   Returns false iff groups were not switched because G2 was empty.  */
-+static bool __attribute__ ((unused))
-+__condvar_quiesce_and_switch_g1 (pthread_cond_t *cond, uint64_t wseq,
-+    unsigned int *g1index, int private)
-+{
-+  const unsigned int maxspin = 0;
-+  unsigned int g1 = *g1index;
-+
-+  /* If there is no waiter in G2, we don't do anything.  The expression may
-+     look odd but remember that __g_size might hold a negative value, so
-+     putting the expression this way avoids relying on implementation-defined
-+     behavior.
-+     Note that this works correctly for a zero-initialized condvar too.  */
-+  unsigned int old_orig_size = __condvar_get_orig_size (cond);
-+  uint64_t old_g1_start = __condvar_load_g1_start_relaxed (cond) >> 1;
-+  if (((unsigned) (wseq - old_g1_start - old_orig_size)
-+	  + cond->__data.__g_size[g1 ^ 1]) == 0)
-+	return false;
-+
-+  /* Now try to close and quiesce G1.  We have to consider the following kinds
-+     of waiters:
-+     * Waiters from less recent groups than G1 are not affected because
-+       nothing will change for them apart from __g1_start getting larger.
-+     * New waiters arriving concurrently with the group switching will all go
-+       into G2 until we atomically make the switch.  Waiters existing in G2
-+       are not affected.
-+     * Waiters in G1 will be closed out immediately by setting a flag in
-+       __g_signals, which will prevent waiters from blocking using a futex on
-+       __g_signals and also notifies them that the group is closed.  As a
-+       result, they will eventually remove their group reference, allowing us
-+       to close switch group roles.  */
-+
-+  /* First, set the closed flag on __g_signals.  This tells waiters that are
-+     about to wait that they shouldn't do that anymore.  This basically
-+     serves as an advance notificaton of the upcoming change to __g1_start;
-+     waiters interpret it as if __g1_start was larger than their waiter
-+     sequence position.  This allows us to change __g1_start after waiting
-+     for all existing waiters with group references to leave, which in turn
-+     makes recovery after stealing a signal simpler because it then can be
-+     skipped if __g1_start indicates that the group is closed (otherwise,
-+     we would have to recover always because waiters don't know how big their
-+     groups are).  Relaxed MO is fine.  */
-+  atomic_fetch_or_relaxed (cond->__data.__g_signals + g1, 1);
-+
-+  /* Wait until there are no group references anymore.  The fetch-or operation
-+     injects us into the modification order of __g_refs; release MO ensures
-+     that waiters incrementing __g_refs after our fetch-or see the previous
-+     changes to __g_signals and to __g1_start that had to happen before we can
-+     switch this G1 and alias with an older group (we have two groups, so
-+     aliasing requires switching group roles twice).  Note that nobody else
-+     can have set the wake-request flag, so we do not have to act upon it.
-+
-+     Also note that it is harmless if older waiters or waiters from this G1
-+     get a group reference after we have quiesced the group because it will
-+     remain closed for them either because of the closed flag in __g_signals
-+     or the later update to __g1_start.  New waiters will never arrive here
-+     but instead continue to go into the still current G2.  */
-+  unsigned r = atomic_fetch_or_release (cond->__data.__g_refs + g1, 0);
-+  while ((r >> 1) > 0)
-+    {
-+      for (unsigned int spin = maxspin; ((r >> 1) > 0) && (spin > 0); spin--)
-+	{
-+	  /* TODO Back off.  */
-+	  r = atomic_load_relaxed (cond->__data.__g_refs + g1);
-+	}
-+      if ((r >> 1) > 0)
-+	{
-+	  /* There is still a waiter after spinning.  Set the wake-request
-+	     flag and block.  Relaxed MO is fine because this is just about
-+	     this futex word.  */
-+	  r = atomic_fetch_or_relaxed (cond->__data.__g_refs + g1, 1);
-+
-+	  if ((r >> 1) > 0)
-+	    futex_wait_simple (cond->__data.__g_refs + g1, r, private);
-+	  /* Reload here so we eventually see the most recent value even if we
-+	     do not spin.   */
-+	  r = atomic_load_relaxed (cond->__data.__g_refs + g1);
-+	}
-+    }
-+  /* Acquire MO so that we synchronize with the release operation that waiters
-+     use to decrement __g_refs and thus happen after the waiters we waited
-+     for.  */
-+  atomic_thread_fence_acquire ();
-+
-+  /* Update __g1_start, which finishes closing this group.  The value we add
-+     will never be negative because old_orig_size can only be zero when we
-+     switch groups the first time after a condvar was initialized, in which
-+     case G1 will be at index 1 and we will add a value of 1.  See above for
-+     why this takes place after waiting for quiescence of the group.
-+     Relaxed MO is fine because the change comes with no additional
-+     constraints that others would have to observe.  */
-+  __condvar_add_g1_start_relaxed (cond,
-+      (old_orig_size << 1) + (g1 == 1 ? 1 : - 1));
-+
-+  /* Now reopen the group, thus enabling waiters to again block using the
-+     futex controlled by __g_signals.  Release MO so that observers that see
-+     no signals (and thus can block) also see the write __g1_start and thus
-+     that this is now a new group (see __pthread_cond_wait_common for the
-+     matching acquire MO loads).  */
-+  atomic_store_release (cond->__data.__g_signals + g1, 0);
-+
-+  /* At this point, the old G1 is now a valid new G2 (but not in use yet).
-+     No old waiter can neither grab a signal nor acquire a reference without
-+     noticing that __g1_start is larger.
-+     We can now publish the group switch by flipping the G2 index in __wseq.
-+     Release MO so that this synchronizes with the acquire MO operation
-+     waiters use to obtain a position in the waiter sequence.  */
-+  wseq = __condvar_fetch_xor_wseq_release (cond, 1) >> 1;
-+  g1 ^= 1;
-+  *g1index ^= 1;
-+
-+  /* These values are just observed by signalers, and thus protected by the
-+     lock.  */
-+  unsigned int orig_size = wseq - (old_g1_start + old_orig_size);
-+  __condvar_set_orig_size (cond, orig_size);
-+  /* Use and addition to not loose track of cancellations in what was
-+     previously G2.  */
-+  cond->__data.__g_size[g1] += orig_size;
-+
-+  /* The new G1's size may be zero because of cancellations during its time
-+     as G2.  If this happens, there are no waiters that have to receive a
-+     signal, so we do not need to add any and return false.  */
-+  if (cond->__data.__g_size[g1] == 0)
-+    return false;
-+
-+  return true;
-+}
-diff --git a/nptl/pthread_cond_destroy.c b/nptl/pthread_cond_destroy.c
-index 1acd804..5845c6a 100644
---- a/nptl/pthread_cond_destroy.c
-+++ b/nptl/pthread_cond_destroy.c
-@@ -20,66 +20,42 @@
- #include <shlib-compat.h>
- #include "pthreadP.h"
- #include <stap-probe.h>
--
--
-+#include <atomic.h>
-+#include <futex-internal.h>
-+
-+#include "pthread_cond_common.c"
-+
-+/* See __pthread_cond_wait for a high-level description of the algorithm.
-+
-+   A correct program must make sure that no waiters are blocked on the condvar
-+   when it is destroyed, and that there are no concurrent signals or
-+   broadcasts.  To wake waiters reliably, the program must signal or
-+   broadcast while holding the mutex or after having held the mutex.  It must
-+   also ensure that no signal or broadcast are still pending to unblock
-+   waiters; IOW, because waiters can wake up spuriously, the program must
-+   effectively ensure that destruction happens after the execution of those
-+   signal or broadcast calls.
-+   Thus, we can assume that all waiters that are still accessing the condvar
-+   have been woken.  We wait until they have confirmed to have woken up by
-+   decrementing __wrefs.  */
- int
- __pthread_cond_destroy (pthread_cond_t *cond)
- {
--  int pshared = (cond->__data.__mutex == (void *) ~0l)
--		? LLL_SHARED : LLL_PRIVATE;
--
-   LIBC_PROBE (cond_destroy, 1, cond);
- 
--  /* Make sure we are alone.  */
--  lll_lock (cond->__data.__lock, pshared);
--
--  if (cond->__data.__total_seq > cond->__data.__wakeup_seq)
--    {
--      /* If there are still some waiters which have not been
--	 woken up, this is an application bug.  */
--      lll_unlock (cond->__data.__lock, pshared);
--      return EBUSY;
--    }
--
--  /* Tell pthread_cond_*wait that this condvar is being destroyed.  */
--  cond->__data.__total_seq = -1ULL;
--
--  /* If there are waiters which have been already signalled or
--     broadcasted, but still are using the pthread_cond_t structure,
--     pthread_cond_destroy needs to wait for them.  */
--  unsigned int nwaiters = cond->__data.__nwaiters;
--
--  if (nwaiters >= (1 << COND_NWAITERS_SHIFT))
-+  /* Set the wake request flag.  We could also spin, but destruction that is
-+     concurrent with still-active waiters is probably neither common nor
-+     performance critical.  Acquire MO to synchronize with waiters confirming
-+     that they finished.  */
-+  unsigned int wrefs = atomic_fetch_or_acquire (&cond->__data.__wrefs, 4);
-+  int private = __condvar_get_private (wrefs);
-+  while (wrefs >> 3 != 0)
-     {
--      /* Wake everybody on the associated mutex in case there are
--	 threads that have been requeued to it.
--	 Without this, pthread_cond_destroy could block potentially
--	 for a long time or forever, as it would depend on other
--	 thread's using the mutex.
--	 When all threads waiting on the mutex are woken up, pthread_cond_wait
--	 only waits for threads to acquire and release the internal
--	 condvar lock.  */
--      if (cond->__data.__mutex != NULL
--	  && cond->__data.__mutex != (void *) ~0l)
--	{
--	  pthread_mutex_t *mut = (pthread_mutex_t *) cond->__data.__mutex;
--	  lll_futex_wake (&mut->__data.__lock, INT_MAX,
--			  PTHREAD_MUTEX_PSHARED (mut));
--	}
--
--      do
--	{
--	  lll_unlock (cond->__data.__lock, pshared);
--
--	  lll_futex_wait (&cond->__data.__nwaiters, nwaiters, pshared);
--
--	  lll_lock (cond->__data.__lock, pshared);
--
--	  nwaiters = cond->__data.__nwaiters;
--	}
--      while (nwaiters >= (1 << COND_NWAITERS_SHIFT));
-+      futex_wait_simple (&cond->__data.__wrefs, wrefs, private);
-+      /* See above.  */
-+      wrefs = atomic_load_acquire (&cond->__data.__wrefs);
-     }
--
-+  /* The memory the condvar occupies can now be reused.  */
-   return 0;
- }
- versioned_symbol (libpthread, __pthread_cond_destroy,
-diff --git a/nptl/pthread_cond_init.c b/nptl/pthread_cond_init.c
-index 9023370..c1eac5f 100644
---- a/nptl/pthread_cond_init.c
-+++ b/nptl/pthread_cond_init.c
-@@ -19,25 +19,29 @@
- #include <shlib-compat.h>
- #include "pthreadP.h"
- #include <stap-probe.h>
-+#include <string.h>
- 
- 
-+/* See __pthread_cond_wait for details.  */
- int
- __pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *cond_attr)
- {
-   struct pthread_condattr *icond_attr = (struct pthread_condattr *) cond_attr;
- 
--  cond->__data.__lock = LLL_LOCK_INITIALIZER;
--  cond->__data.__futex = 0;
--  cond->__data.__nwaiters = (icond_attr != NULL
--			     ? ((icond_attr->value >> 1)
--				& ((1 << COND_NWAITERS_SHIFT) - 1))
--			     : CLOCK_REALTIME);
--  cond->__data.__total_seq = 0;
--  cond->__data.__wakeup_seq = 0;
--  cond->__data.__woken_seq = 0;
--  cond->__data.__mutex = (icond_attr == NULL || (icond_attr->value & 1) == 0
--			  ? NULL : (void *) ~0l);
--  cond->__data.__broadcast_seq = 0;
-+  memset (cond, 0, sizeof (pthread_cond_t));
-+
-+  /* Update the pretty printers if the internal representation of icond_attr
-+     is changed.  */
-+
-+  /* Iff not equal to ~0l, this is a PTHREAD_PROCESS_PRIVATE condvar.  */
-+  if (icond_attr != NULL && (icond_attr->value & 1) != 0)
-+    cond->__data.__wrefs |= __PTHREAD_COND_SHARED_MASK;
-+  int clockid = (icond_attr != NULL
-+		 ? ((icond_attr->value >> 1) & ((1 << COND_CLOCK_BITS) - 1))
-+		 : CLOCK_REALTIME);
-+  /* If 0, CLOCK_REALTIME is used; CLOCK_MONOTONIC otherwise.  */
-+  if (clockid != CLOCK_REALTIME)
-+    cond->__data.__wrefs |= __PTHREAD_COND_CLOCK_MONOTONIC_MASK;
- 
-   LIBC_PROBE (cond_init, 2, cond, cond_attr);
- 
-diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c
-index b3a6d3d..a95d569 100644
---- a/nptl/pthread_cond_signal.c
-+++ b/nptl/pthread_cond_signal.c
-@@ -19,62 +19,79 @@
- #include <endian.h>
- #include <errno.h>
- #include <sysdep.h>
--#include <lowlevellock.h>
-+#include <futex-internal.h>
- #include <pthread.h>
- #include <pthreadP.h>
-+#include <atomic.h>
-+#include <stdint.h>
- 
- #include <shlib-compat.h>
--#include <kernel-features.h>
- #include <stap-probe.h>
- 
-+#include "pthread_cond_common.c"
- 
-+/* See __pthread_cond_wait for a high-level description of the algorithm.  */
- int
- __pthread_cond_signal (pthread_cond_t *cond)
- {
--  int pshared = (cond->__data.__mutex == (void *) ~0l)
--		? LLL_SHARED : LLL_PRIVATE;
--
-   LIBC_PROBE (cond_signal, 1, cond);
- 
--  /* Make sure we are alone.  */
--  lll_lock (cond->__data.__lock, pshared);
--
--  /* Are there any waiters to be woken?  */
--  if (cond->__data.__total_seq > cond->__data.__wakeup_seq)
-+  /* First check whether there are waiters.  Relaxed MO is fine for that for
-+     the same reasons that relaxed MO is fine when observing __wseq (see
-+     below).  */
-+  unsigned int wrefs = atomic_load_relaxed (&cond->__data.__wrefs);
-+  if (wrefs >> 3 == 0)
-+    return 0;
-+  int private = __condvar_get_private (wrefs);
-+
-+  __condvar_acquire_lock (cond, private);
-+
-+  /* Load the waiter sequence number, which represents our relative ordering
-+     to any waiters.  Relaxed MO is sufficient for that because:
-+     1) We can pick any position that is allowed by external happens-before
-+        constraints.  In particular, if another __pthread_cond_wait call
-+        happened before us, this waiter must be eligible for being woken by
-+        us.  The only way do establish such a happens-before is by signaling
-+        while having acquired the mutex associated with the condvar and
-+        ensuring that the signal's critical section happens after the waiter.
-+        Thus, the mutex ensures that we see that waiter's __wseq increase.
-+     2) Once we pick a position, we do not need to communicate this to the
-+        program via a happens-before that we set up: First, any wake-up could
-+        be a spurious wake-up, so the program must not interpret a wake-up as
-+        an indication that the waiter happened before a particular signal;
-+        second, a program cannot detect whether a waiter has not yet been
-+        woken (i.e., it cannot distinguish between a non-woken waiter and one
-+        that has been woken but hasn't resumed execution yet), and thus it
-+        cannot try to deduce that a signal happened before a particular
-+        waiter.  */
-+  unsigned long long int wseq = __condvar_load_wseq_relaxed (cond);
-+  unsigned int g1 = (wseq & 1) ^ 1;
-+  wseq >>= 1;
-+  bool do_futex_wake = false;
-+
-+  /* If G1 is still receiving signals, we put the signal there.  If not, we
-+     check if G2 has waiters, and if so, quiesce and switch G1 to the former
-+     G2; if this results in a new G1 with waiters (G2 might have cancellations
-+     already, see __condvar_quiesce_and_switch_g1), we put the signal in the
-+     new G1.  */
-+  if ((cond->__data.__g_size[g1] != 0)
-+      || __condvar_quiesce_and_switch_g1 (cond, wseq, &g1, private))
-     {
--      /* Yes.  Mark one of them as woken.  */
--      ++cond->__data.__wakeup_seq;
--      ++cond->__data.__futex;
--
--#if (defined lll_futex_cmp_requeue_pi \
--     && defined __ASSUME_REQUEUE_PI)
--      pthread_mutex_t *mut = cond->__data.__mutex;
--
--      if (USE_REQUEUE_PI (mut)
--	/* This can only really fail with a ENOSYS, since nobody can modify
--	   futex while we have the cond_lock.  */
--	  && lll_futex_cmp_requeue_pi (&cond->__data.__futex, 1, 0,
--				       &mut->__data.__lock,
--				       cond->__data.__futex, pshared) == 0)
--	{
--	  lll_unlock (cond->__data.__lock, pshared);
--	  return 0;
--	}
--      else
--#endif
--	/* Wake one.  */
--	if (! __builtin_expect (lll_futex_wake_unlock (&cond->__data.__futex,
--						       1, 1,
--						       &cond->__data.__lock,
--						       pshared), 0))
--	  return 0;
--
--      /* Fallback if neither of them work.  */
--      lll_futex_wake (&cond->__data.__futex, 1, pshared);
-+      /* Add a signal.  Relaxed MO is fine because signaling does not need to
-+	 establish a happens-before relation (see above).  We do not mask the
-+	 release-MO store when initializing a group in
-+	 __condvar_quiesce_and_switch_g1 because we use an atomic
-+	 read-modify-write and thus extend that store's release sequence.  */
-+      atomic_fetch_add_relaxed (cond->__data.__g_signals + g1, 2);
-+      cond->__data.__g_size[g1]--;
-+      /* TODO Only set it if there are indeed futex waiters.  */
-+      do_futex_wake = true;
-     }
- 
--  /* We are done.  */
--  lll_unlock (cond->__data.__lock, pshared);
-+  __condvar_release_lock (cond, private);
-+
-+  if (do_futex_wake)
-+    futex_wake (cond->__data.__g_signals + g1, 1, private);
- 
-   return 0;
- }
-diff --git a/nptl/pthread_cond_timedwait.c b/nptl/pthread_cond_timedwait.c
-deleted file mode 100644
-index 711a51d..0000000
---- a/nptl/pthread_cond_timedwait.c
-+++ /dev/null
-@@ -1,268 +0,0 @@
--/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library; if not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#include <endian.h>
--#include <errno.h>
--#include <sysdep.h>
--#include <lowlevellock.h>
--#include <pthread.h>
--#include <pthreadP.h>
--#include <sys/time.h>
--#include <kernel-features.h>
--
--#include <shlib-compat.h>
--
--#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
--# undef INTERNAL_VSYSCALL
--# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
--# undef INLINE_VSYSCALL
--# define INLINE_VSYSCALL INLINE_SYSCALL
--#else
--# include <libc-vdso.h>
--#endif
--
--/* Cleanup handler, defined in pthread_cond_wait.c.  */
--extern void __condvar_cleanup (void *arg)
--     __attribute__ ((visibility ("hidden")));
--
--struct _condvar_cleanup_buffer
--{
--  int oldtype;
--  pthread_cond_t *cond;
--  pthread_mutex_t *mutex;
--  unsigned int bc_seq;
--};
--
--int
--__pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
--			  const struct timespec *abstime)
--{
--  struct _pthread_cleanup_buffer buffer;
--  struct _condvar_cleanup_buffer cbuffer;
--  int result = 0;
--
--  /* Catch invalid parameters.  */
--  if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
--    return EINVAL;
--
--  int pshared = (cond->__data.__mutex == (void *) ~0l)
--		? LLL_SHARED : LLL_PRIVATE;
--
--#if (defined lll_futex_timed_wait_requeue_pi \
--     && defined __ASSUME_REQUEUE_PI)
--  int pi_flag = 0;
--#endif
--
--  /* Make sure we are alone.  */
--  lll_lock (cond->__data.__lock, pshared);
--
--  /* Now we can release the mutex.  */
--  int err = __pthread_mutex_unlock_usercnt (mutex, 0);
--  if (err)
--    {
--      lll_unlock (cond->__data.__lock, pshared);
--      return err;
--    }
--
--  /* We have one new user of the condvar.  */
--  ++cond->__data.__total_seq;
--  ++cond->__data.__futex;
--  cond->__data.__nwaiters += 1 << COND_NWAITERS_SHIFT;
--
--  /* Work around the fact that the kernel rejects negative timeout values
--     despite them being valid.  */
--  if (__glibc_unlikely (abstime->tv_sec < 0))
--    goto timeout;
--
--  /* Remember the mutex we are using here.  If there is already a
--     different address store this is a bad user bug.  Do not store
--     anything for pshared condvars.  */
--  if (cond->__data.__mutex != (void *) ~0l)
--    cond->__data.__mutex = mutex;
--
--  /* Prepare structure passed to cancellation handler.  */
--  cbuffer.cond = cond;
--  cbuffer.mutex = mutex;
--
--  /* Before we block we enable cancellation.  Therefore we have to
--     install a cancellation handler.  */
--  __pthread_cleanup_push (&buffer, __condvar_cleanup, &cbuffer);
--
--  /* The current values of the wakeup counter.  The "woken" counter
--     must exceed this value.  */
--  unsigned long long int val;
--  unsigned long long int seq;
--  val = seq = cond->__data.__wakeup_seq;
--  /* Remember the broadcast counter.  */
--  cbuffer.bc_seq = cond->__data.__broadcast_seq;
--
--  while (1)
--    {
--#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
--     || !defined lll_futex_timed_wait_bitset)
--      struct timespec rt;
--      {
--# ifdef __NR_clock_gettime
--	INTERNAL_SYSCALL_DECL (err);
--	(void) INTERNAL_VSYSCALL (clock_gettime, err, 2,
--				  (cond->__data.__nwaiters
--				   & ((1 << COND_NWAITERS_SHIFT) - 1)),
--				  &rt);
--	/* Convert the absolute timeout value to a relative timeout.  */
--	rt.tv_sec = abstime->tv_sec - rt.tv_sec;
--	rt.tv_nsec = abstime->tv_nsec - rt.tv_nsec;
--# else
--	/* Get the current time.  So far we support only one clock.  */
--	struct timeval tv;
--	(void) __gettimeofday (&tv, NULL);
--
--	/* Convert the absolute timeout value to a relative timeout.  */
--	rt.tv_sec = abstime->tv_sec - tv.tv_sec;
--	rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
--# endif
--      }
--      if (rt.tv_nsec < 0)
--	{
--	  rt.tv_nsec += 1000000000;
--	  --rt.tv_sec;
--	}
--      /* Did we already time out?  */
--      if (__glibc_unlikely (rt.tv_sec < 0))
--	{
--	  if (cbuffer.bc_seq != cond->__data.__broadcast_seq)
--	    goto bc_out;
--
--	  goto timeout;
--	}
--#endif
--
--      unsigned int futex_val = cond->__data.__futex;
--
--      /* Prepare to wait.  Release the condvar futex.  */
--      lll_unlock (cond->__data.__lock, pshared);
--
--      /* Enable asynchronous cancellation.  Required by the standard.  */
--      cbuffer.oldtype = __pthread_enable_asynccancel ();
--
--/* REQUEUE_PI was implemented after FUTEX_CLOCK_REALTIME, so it is sufficient
--   to check just the former.  */
--#if (defined lll_futex_timed_wait_requeue_pi \
--     && defined __ASSUME_REQUEUE_PI)
--      /* If pi_flag remained 1 then it means that we had the lock and the mutex
--	 but a spurious waker raced ahead of us.  Give back the mutex before
--	 going into wait again.  */
--      if (pi_flag)
--	{
--	  __pthread_mutex_cond_lock_adjust (mutex);
--	  __pthread_mutex_unlock_usercnt (mutex, 0);
--	}
--      pi_flag = USE_REQUEUE_PI (mutex);
--
--      if (pi_flag)
--	{
--	  unsigned int clockbit = (cond->__data.__nwaiters & 1
--				   ? 0 : FUTEX_CLOCK_REALTIME);
--	  err = lll_futex_timed_wait_requeue_pi (&cond->__data.__futex,
--						 futex_val, abstime, clockbit,
--						 &mutex->__data.__lock,
--						 pshared);
--	  pi_flag = (err == 0);
--	}
--      else
--#endif
--
--	{
--#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
--     || !defined lll_futex_timed_wait_bitset)
--	  /* Wait until woken by signal or broadcast.  */
--	  err = lll_futex_timed_wait (&cond->__data.__futex,
--				      futex_val, &rt, pshared);
--#else
--	  unsigned int clockbit = (cond->__data.__nwaiters & 1
--				   ? 0 : FUTEX_CLOCK_REALTIME);
--	  err = lll_futex_timed_wait_bitset (&cond->__data.__futex, futex_val,
--					     abstime, clockbit, pshared);
--#endif
--	}
--
--      /* Disable asynchronous cancellation.  */
--      __pthread_disable_asynccancel (cbuffer.oldtype);
--
--      /* We are going to look at shared data again, so get the lock.  */
--      lll_lock (cond->__data.__lock, pshared);
--
--      /* If a broadcast happened, we are done.  */
--      if (cbuffer.bc_seq != cond->__data.__broadcast_seq)
--	goto bc_out;
--
--      /* Check whether we are eligible for wakeup.  */
--      val = cond->__data.__wakeup_seq;
--      if (val != seq && cond->__data.__woken_seq != val)
--	break;
--
--      /* Not woken yet.  Maybe the time expired?  */
--      if (__glibc_unlikely (err == -ETIMEDOUT))
--	{
--	timeout:
--	  /* Yep.  Adjust the counters.  */
--	  ++cond->__data.__wakeup_seq;
--	  ++cond->__data.__futex;
--
--	  /* The error value.  */
--	  result = ETIMEDOUT;
--	  break;
--	}
--    }
--
--  /* Another thread woken up.  */
--  ++cond->__data.__woken_seq;
--
-- bc_out:
--
--  cond->__data.__nwaiters -= 1 << COND_NWAITERS_SHIFT;
--
--  /* If pthread_cond_destroy was called on this variable already,
--     notify the pthread_cond_destroy caller all waiters have left
--     and it can be successfully destroyed.  */
--  if (cond->__data.__total_seq == -1ULL
--      && cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT))
--    lll_futex_wake (&cond->__data.__nwaiters, 1, pshared);
--
--  /* We are done with the condvar.  */
--  lll_unlock (cond->__data.__lock, pshared);
--
--  /* The cancellation handling is back to normal, remove the handler.  */
--  __pthread_cleanup_pop (&buffer, 0);
--
--  /* Get the mutex before returning.  */
--#if (defined lll_futex_timed_wait_requeue_pi \
--     && defined __ASSUME_REQUEUE_PI)
--  if (pi_flag)
--    {
--      __pthread_mutex_cond_lock_adjust (mutex);
--      err = 0;
--    }
--  else
--#endif
--    err = __pthread_mutex_cond_lock (mutex);
--
--  return err ?: result;
--}
--
--versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
--		  GLIBC_2_3_2);
-diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
-index 3f62acc..2b43402 100644
---- a/nptl/pthread_cond_wait.c
-+++ b/nptl/pthread_cond_wait.c
-@@ -19,219 +19,655 @@
- #include <endian.h>
- #include <errno.h>
- #include <sysdep.h>
--#include <lowlevellock.h>
-+#include <futex-internal.h>
- #include <pthread.h>
- #include <pthreadP.h>
--#include <kernel-features.h>
-+#include <sys/time.h>
-+#include <atomic.h>
-+#include <stdint.h>
-+#include <stdbool.h>
- 
- #include <shlib-compat.h>
- #include <stap-probe.h>
-+#include <time.h>
-+
-+#include "pthread_cond_common.c"
-+
- 
- struct _condvar_cleanup_buffer
- {
--  int oldtype;
-+  uint64_t wseq;
-   pthread_cond_t *cond;
-   pthread_mutex_t *mutex;
--  unsigned int bc_seq;
-+  int private;
- };
- 
- 
--void
--__attribute__ ((visibility ("hidden")))
--__condvar_cleanup (void *arg)
-+/* Decrease the waiter reference count.  */
-+static void
-+__condvar_confirm_wakeup (pthread_cond_t *cond, int private)
- {
--  struct _condvar_cleanup_buffer *cbuffer =
--    (struct _condvar_cleanup_buffer *) arg;
--  unsigned int destroying;
--  int pshared = (cbuffer->cond->__data.__mutex == (void *) ~0l)
--		? LLL_SHARED : LLL_PRIVATE;
-+  /* If destruction is pending (i.e., the wake-request flag is nonzero) and we
-+     are the last waiter (prior value of __wrefs was 1 << 3), then wake any
-+     threads waiting in pthread_cond_destroy.  Release MO to synchronize with
-+     these threads.  Don't bother clearing the wake-up request flag.  */
-+  if ((atomic_fetch_add_release (&cond->__data.__wrefs, -8) >> 2) == 3)
-+    futex_wake (&cond->__data.__wrefs, INT_MAX, private);
-+}
-+
- 
--  /* We are going to modify shared data.  */
--  lll_lock (cbuffer->cond->__data.__lock, pshared);
-+/* Cancel waiting after having registered as a waiter previously.  SEQ is our
-+   position and G is our group index.
-+   The goal of cancellation is to make our group smaller if that is still
-+   possible.  If we are in a closed group, this is not possible anymore; in
-+   this case, we need to send a replacement signal for the one we effectively
-+   consumed because the signal should have gotten consumed by another waiter
-+   instead; we must not both cancel waiting and consume a signal.
-+
-+   Must not be called while still holding a reference on the group.
-+
-+   Returns true iff we consumed a signal.
-+
-+   On some kind of timeouts, we may be able to pretend that a signal we
-+   effectively consumed happened before the timeout (i.e., similarly to first
-+   spinning on signals before actually checking whether the timeout has
-+   passed already).  Doing this would allow us to skip sending a replacement
-+   signal, but this case might happen rarely because the end of the timeout
-+   must race with someone else sending a signal.  Therefore, we don't bother
-+   trying to optimize this.  */
-+static void
-+__condvar_cancel_waiting (pthread_cond_t *cond, uint64_t seq, unsigned int g,
-+			  int private)
-+{
-+  bool consumed_signal = false;
- 
--  if (cbuffer->bc_seq == cbuffer->cond->__data.__broadcast_seq)
-+  /* No deadlock with group switching is possible here because we have do
-+     not hold a reference on the group.  */
-+  __condvar_acquire_lock (cond, private);
-+
-+  uint64_t g1_start = __condvar_load_g1_start_relaxed (cond) >> 1;
-+  if (g1_start > seq)
-+    {
-+      /* Our group is closed, so someone provided enough signals for it.
-+	 Thus, we effectively consumed a signal.  */
-+      consumed_signal = true;
-+    }
-+  else
-     {
--      /* This thread is not waiting anymore.  Adjust the sequence counters
--	 appropriately.  We do not increment WAKEUP_SEQ if this would
--	 bump it over the value of TOTAL_SEQ.  This can happen if a thread
--	 was woken and then canceled.  */
--      if (cbuffer->cond->__data.__wakeup_seq
--	  < cbuffer->cond->__data.__total_seq)
-+      if (g1_start + __condvar_get_orig_size (cond) <= seq)
-+	{
-+	  /* We are in the current G2 and thus cannot have consumed a signal.
-+	     Reduce its effective size or handle overflow.  Remember that in
-+	     G2, unsigned int size is zero or a negative value.  */
-+	  if (cond->__data.__g_size[g] + __PTHREAD_COND_MAX_GROUP_SIZE > 0)
-+	    {
-+	      cond->__data.__g_size[g]--;
-+	    }
-+	  else
-+	    {
-+	      /* Cancellations would overflow the maximum group size.  Just
-+		 wake up everyone spuriously to create a clean state.  This
-+		 also means we do not consume a signal someone else sent.  */
-+	      __condvar_release_lock (cond, private);
-+	      __pthread_cond_broadcast (cond);
-+	      return;
-+	    }
-+	}
-+      else
- 	{
--	  ++cbuffer->cond->__data.__wakeup_seq;
--	  ++cbuffer->cond->__data.__futex;
-+	  /* We are in current G1.  If the group's size is zero, someone put
-+	     a signal in the group that nobody else but us can consume.  */
-+	  if (cond->__data.__g_size[g] == 0)
-+	    consumed_signal = true;
-+	  else
-+	    {
-+	      /* Otherwise, we decrease the size of the group.  This is
-+		 equivalent to atomically putting in a signal just for us and
-+		 consuming it right away.  We do not consume a signal sent
-+		 by someone else.  We also cannot have consumed a futex
-+		 wake-up because if we were cancelled or timed out in a futex
-+		 call, the futex will wake another waiter.  */
-+	      cond->__data.__g_size[g]--;
-+	    }
- 	}
--      ++cbuffer->cond->__data.__woken_seq;
-     }
- 
--  cbuffer->cond->__data.__nwaiters -= 1 << COND_NWAITERS_SHIFT;
-+  __condvar_release_lock (cond, private);
- 
--  /* If pthread_cond_destroy was called on this variable already,
--     notify the pthread_cond_destroy caller all waiters have left
--     and it can be successfully destroyed.  */
--  destroying = 0;
--  if (cbuffer->cond->__data.__total_seq == -1ULL
--      && cbuffer->cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT))
-+  if (consumed_signal)
-     {
--      lll_futex_wake (&cbuffer->cond->__data.__nwaiters, 1, pshared);
--      destroying = 1;
-+      /* We effectively consumed a signal even though we didn't want to.
-+	 Therefore, we need to send a replacement signal.
-+	 If we would want to optimize this, we could do what
-+	 pthread_cond_signal does right in the critical section above.  */
-+      __pthread_cond_signal (cond);
-     }
-+}
- 
--  /* We are done.  */
--  lll_unlock (cbuffer->cond->__data.__lock, pshared);
--
--  /* Wake everybody to make sure no condvar signal gets lost.  */
--  if (! destroying)
--    lll_futex_wake (&cbuffer->cond->__data.__futex, INT_MAX, pshared);
--
--  /* Get the mutex before returning unless asynchronous cancellation
--     is in effect.  We don't try to get the mutex if we already own it.  */
--  if (!(USE_REQUEUE_PI (cbuffer->mutex))
--      || ((cbuffer->mutex->__data.__lock & FUTEX_TID_MASK)
--	  != THREAD_GETMEM (THREAD_SELF, tid)))
--  {
--    __pthread_mutex_cond_lock (cbuffer->mutex);
--  }
--  else
--    __pthread_mutex_cond_lock_adjust (cbuffer->mutex);
-+/* Wake up any signalers that might be waiting.  */
-+static void
-+__condvar_dec_grefs (pthread_cond_t *cond, unsigned int g, int private)
-+{
-+  /* Release MO to synchronize-with the acquire load in
-+     __condvar_quiesce_and_switch_g1.  */
-+  if (atomic_fetch_add_release (cond->__data.__g_refs + g, -2) == 3)
-+    {
-+      /* Clear the wake-up request flag before waking up.  We do not need more
-+	 than relaxed MO and it doesn't matter if we apply this for an aliased
-+	 group because we wake all futex waiters right after clearing the
-+	 flag.  */
-+      atomic_fetch_and_relaxed (cond->__data.__g_refs + g, ~(unsigned int) 1);
-+      futex_wake (cond->__data.__g_refs + g, INT_MAX, private);
-+    }
- }
- 
-+/* Clean-up for cancellation of waiters waiting for normal signals.  We cancel
-+   our registration as a waiter, confirm we have woken up, and re-acquire the
-+   mutex.  */
-+static void
-+__condvar_cleanup_waiting (void *arg)
-+{
-+  struct _condvar_cleanup_buffer *cbuffer =
-+    (struct _condvar_cleanup_buffer *) arg;
-+  pthread_cond_t *cond = cbuffer->cond;
-+  unsigned g = cbuffer->wseq & 1;
- 
--int
--__pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)
-+  __condvar_dec_grefs (cond, g, cbuffer->private);
-+
-+  __condvar_cancel_waiting (cond, cbuffer->wseq >> 1, g, cbuffer->private);
-+  /* FIXME With the current cancellation implementation, it is possible that
-+     a thread is cancelled after it has returned from a syscall.  This could
-+     result in a cancelled waiter consuming a futex wake-up that is then
-+     causing another waiter in the same group to not wake up.  To work around
-+     this issue until we have fixed cancellation, just add a futex wake-up
-+     conservatively.  */
-+  futex_wake (cond->__data.__g_signals + g, 1, cbuffer->private);
-+
-+  __condvar_confirm_wakeup (cond, cbuffer->private);
-+
-+  /* XXX If locking the mutex fails, should we just stop execution?  This
-+     might be better than silently ignoring the error.  */
-+  __pthread_mutex_cond_lock (cbuffer->mutex);
-+}
-+
-+/* This condvar implementation guarantees that all calls to signal and
-+   broadcast and all of the three virtually atomic parts of each call to wait
-+   (i.e., (1) releasing the mutex and blocking, (2) unblocking, and (3) re-
-+   acquiring the mutex) happen in some total order that is consistent with the
-+   happens-before relations in the calling program.  However, this order does
-+   not necessarily result in additional happens-before relations being
-+   established (which aligns well with spurious wake-ups being allowed).
-+
-+   All waiters acquire a certain position in a 64b waiter sequence (__wseq).
-+   This sequence determines which waiters are allowed to consume signals.
-+   A broadcast is equal to sending as many signals as are unblocked waiters.
-+   When a signal arrives, it samples the current value of __wseq with a
-+   relaxed-MO load (i.e., the position the next waiter would get).  (This is
-+   sufficient because it is consistent with happens-before; the caller can
-+   enforce stronger ordering constraints by calling signal while holding the
-+   mutex.)  Only waiters with a position less than the __wseq value observed
-+   by the signal are eligible to consume this signal.
-+
-+   This would be straight-forward to implement if waiters would just spin but
-+   we need to let them block using futexes.  Futexes give no guarantee of
-+   waking in FIFO order, so we cannot reliably wake eligible waiters if we
-+   just use a single futex.  Also, futex words are 32b in size, but we need
-+   to distinguish more than 1<<32 states because we need to represent the
-+   order of wake-up (and thus which waiters are eligible to consume signals);
-+   blocking in a futex is not atomic with a waiter determining its position in
-+   the waiter sequence, so we need the futex word to reliably notify waiters
-+   that they should not attempt to block anymore because they have been
-+   already signaled in the meantime.  While an ABA issue on a 32b value will
-+   be rare, ignoring it when we are aware of it is not the right thing to do
-+   either.
-+
-+   Therefore, we use a 64b counter to represent the waiter sequence (on
-+   architectures which only support 32b atomics, we use a few bits less).
-+   To deal with the blocking using futexes, we maintain two groups of waiters:
-+   * Group G1 consists of waiters that are all eligible to consume signals;
-+     incoming signals will always signal waiters in this group until all
-+     waiters in G1 have been signaled.
-+   * Group G2 consists of waiters that arrive when a G1 is present and still
-+     contains waiters that have not been signaled.  When all waiters in G1
-+     are signaled and a new signal arrives, the new signal will convert G2
-+     into the new G1 and create a new G2 for future waiters.
-+
-+   We cannot allocate new memory because of process-shared condvars, so we
-+   have just two slots of groups that change their role between G1 and G2.
-+   Each has a separate futex word, a number of signals available for
-+   consumption, a size (number of waiters in the group that have not been
-+   signaled), and a reference count.
-+
-+   The group reference count is used to maintain the number of waiters that
-+   are using the group's futex.  Before a group can change its role, the
-+   reference count must show that no waiters are using the futex anymore; this
-+   prevents ABA issues on the futex word.
-+
-+   To represent which intervals in the waiter sequence the groups cover (and
-+   thus also which group slot contains G1 or G2), we use a 64b counter to
-+   designate the start position of G1 (inclusive), and a single bit in the
-+   waiter sequence counter to represent which group slot currently contains
-+   G2.  This allows us to switch group roles atomically wrt. waiters obtaining
-+   a position in the waiter sequence.  The G1 start position allows waiters to
-+   figure out whether they are in a group that has already been completely
-+   signaled (i.e., if the current G1 starts at a later position that the
-+   waiter's position).  Waiters cannot determine whether they are currently
-+   in G2 or G1 -- but they do not have too because all they are interested in
-+   is whether there are available signals, and they always start in G2 (whose
-+   group slot they know because of the bit in the waiter sequence.  Signalers
-+   will simply fill the right group until it is completely signaled and can
-+   be closed (they do not switch group roles until they really have to to
-+   decrease the likelihood of having to wait for waiters still holding a
-+   reference on the now-closed G1).
-+
-+   Signalers maintain the initial size of G1 to be able to determine where
-+   G2 starts (G2 is always open-ended until it becomes G1).  They track the
-+   remaining size of a group; when waiters cancel waiting (due to PThreads
-+   cancellation or timeouts), they will decrease this remaining size as well.
-+
-+   To implement condvar destruction requirements (i.e., that
-+   pthread_cond_destroy can be called as soon as all waiters have been
-+   signaled), waiters increment a reference count before starting to wait and
-+   decrement it after they stopped waiting but right before they acquire the
-+   mutex associated with the condvar.
-+
-+   pthread_cond_t thus consists of the following (bits that are used for
-+   flags and are not part of the primary value of each field but necessary
-+   to make some things atomic or because there was no space for them
-+   elsewhere in the data structure):
-+
-+   __wseq: Waiter sequence counter
-+     * LSB is index of current G2.
-+     * Waiters fetch-add while having acquire the mutex associated with the
-+       condvar.  Signalers load it and fetch-xor it concurrently.
-+   __g1_start: Starting position of G1 (inclusive)
-+     * LSB is index of current G2.
-+     * Modified by signalers while having acquired the condvar-internal lock
-+       and observed concurrently by waiters.
-+   __g1_orig_size: Initial size of G1
-+     * The two least-significant bits represent the condvar-internal lock.
-+     * Only accessed while having acquired the condvar-internal lock.
-+   __wrefs: Waiter reference counter.
-+     * Bit 2 is true if waiters should run futex_wake when they remove the
-+       last reference.  pthread_cond_destroy uses this as futex word.
-+     * Bit 1 is the clock ID (0 == CLOCK_REALTIME, 1 == CLOCK_MONOTONIC).
-+     * Bit 0 is true iff this is a process-shared condvar.
-+     * Simple reference count used by both waiters and pthread_cond_destroy.
-+     (If the format of __wrefs is changed, update nptl_lock_constants.pysym
-+      and the pretty printers.)
-+   For each of the two groups, we have:
-+   __g_refs: Futex waiter reference count.
-+     * LSB is true if waiters should run futex_wake when they remove the
-+       last reference.
-+     * Reference count used by waiters concurrently with signalers that have
-+       acquired the condvar-internal lock.
-+   __g_signals: The number of signals that can still be consumed.
-+     * Used as a futex word by waiters.  Used concurrently by waiters and
-+       signalers.
-+     * LSB is true iff this group has been completely signaled (i.e., it is
-+       closed).
-+   __g_size: Waiters remaining in this group (i.e., which have not been
-+     signaled yet.
-+     * Accessed by signalers and waiters that cancel waiting (both do so only
-+       when having acquired the condvar-internal lock.
-+     * The size of G2 is always zero because it cannot be determined until
-+       the group becomes G1.
-+     * Although this is of unsigned type, we rely on using unsigned overflow
-+       rules to make this hold effectively negative values too (in
-+       particular, when waiters in G2 cancel waiting).
-+
-+   A PTHREAD_COND_INITIALIZER condvar has all fields set to zero, which yields
-+   a condvar that has G2 starting at position 0 and a G1 that is closed.
-+
-+   Because waiters do not claim ownership of a group right when obtaining a
-+   position in __wseq but only reference count the group when using futexes
-+   to block, it can happen that a group gets closed before a waiter can
-+   increment the reference count.  Therefore, waiters have to check whether
-+   their group is already closed using __g1_start.  They also have to perform
-+   this check when spinning when trying to grab a signal from __g_signals.
-+   Note that for these checks, using relaxed MO to load __g1_start is
-+   sufficient because if a waiter can see a sufficiently large value, it could
-+   have also consume a signal in the waiters group.
-+
-+   Waiters try to grab a signal from __g_signals without holding a reference
-+   count, which can lead to stealing a signal from a more recent group after
-+   their own group was already closed.  They cannot always detect whether they
-+   in fact did because they do not know when they stole, but they can
-+   conservatively add a signal back to the group they stole from; if they
-+   did so unnecessarily, all that happens is a spurious wake-up.  To make this
-+   even less likely, __g1_start contains the index of the current g2 too,
-+   which allows waiters to check if there aliasing on the group slots; if
-+   there wasn't, they didn't steal from the current G1, which means that the
-+   G1 they stole from must have been already closed and they do not need to
-+   fix anything.
-+
-+   It is essential that the last field in pthread_cond_t is __g_signals[1]:
-+   The previous condvar used a pointer-sized field in pthread_cond_t, so a
-+   PTHREAD_COND_INITIALIZER from that condvar implementation might only
-+   initialize 4 bytes to zero instead of the 8 bytes we need (i.e., 44 bytes
-+   in total instead of the 48 we need).  __g_signals[1] is not accessed before
-+   the first group switch (G2 starts at index 0), which will set its value to
-+   zero after a harmless fetch-or whose return value is ignored.  This
-+   effectively completes initialization.
-+
-+
-+   Limitations:
-+   * This condvar isn't designed to allow for more than
-+     __PTHREAD_COND_MAX_GROUP_SIZE * (1 << 31) calls to __pthread_cond_wait.
-+   * More than __PTHREAD_COND_MAX_GROUP_SIZE concurrent waiters are not
-+     supported.
-+   * Beyond what is allowed as errors by POSIX or documented, we can also
-+     return the following errors:
-+     * EPERM if MUTEX is a recursive mutex and the caller doesn't own it.
-+     * EOWNERDEAD or ENOTRECOVERABLE when using robust mutexes.  Unlike
-+       for other errors, this can happen when we re-acquire the mutex; this
-+       isn't allowed by POSIX (which requires all errors to virtually happen
-+       before we release the mutex or change the condvar state), but there's
-+       nothing we can do really.
-+     * When using PTHREAD_MUTEX_PP_* mutexes, we can also return all errors
-+       returned by __pthread_tpp_change_priority.  We will already have
-+       released the mutex in such cases, so the caller cannot expect to own
-+       MUTEX.
-+
-+   Other notes:
-+   * Instead of the normal mutex unlock / lock functions, we use
-+     __pthread_mutex_unlock_usercnt(m, 0) / __pthread_mutex_cond_lock(m)
-+     because those will not change the mutex-internal users count, so that it
-+     can be detected when a condvar is still associated with a particular
-+     mutex because there is a waiter blocked on this condvar using this mutex.
-+*/
-+static __always_inline int
-+__pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
-+    const struct timespec *abstime)
- {
--  struct _pthread_cleanup_buffer buffer;
--  struct _condvar_cleanup_buffer cbuffer;
-+  const int maxspin = 0;
-   int err;
--  int pshared = (cond->__data.__mutex == (void *) ~0l)
--		? LLL_SHARED : LLL_PRIVATE;
--
--#if (defined lll_futex_wait_requeue_pi \
--     && defined __ASSUME_REQUEUE_PI)
--  int pi_flag = 0;
--#endif
-+  int result = 0;
- 
-   LIBC_PROBE (cond_wait, 2, cond, mutex);
- 
--  /* Make sure we are alone.  */
--  lll_lock (cond->__data.__lock, pshared);
--
--  /* Now we can release the mutex.  */
-+  /* Acquire a position (SEQ) in the waiter sequence (WSEQ).  We use an
-+     atomic operation because signals and broadcasts may update the group
-+     switch without acquiring the mutex.  We do not need release MO here
-+     because we do not need to establish any happens-before relation with
-+     signalers (see __pthread_cond_signal); modification order alone
-+     establishes a total order of waiters/signals.  We do need acquire MO
-+     to synchronize with group reinitialization in
-+     __condvar_quiesce_and_switch_g1.  */
-+  uint64_t wseq = __condvar_fetch_add_wseq_acquire (cond, 2);
-+  /* Find our group's index.  We always go into what was G2 when we acquired
-+     our position.  */
-+  unsigned int g = wseq & 1;
-+  uint64_t seq = wseq >> 1;
-+
-+  /* Increase the waiter reference count.  Relaxed MO is sufficient because
-+     we only need to synchronize when decrementing the reference count.  */
-+  unsigned int flags = atomic_fetch_add_relaxed (&cond->__data.__wrefs, 8);
-+  int private = __condvar_get_private (flags);
-+
-+  /* Now that we are registered as a waiter, we can release the mutex.
-+     Waiting on the condvar must be atomic with releasing the mutex, so if
-+     the mutex is used to establish a happens-before relation with any
-+     signaler, the waiter must be visible to the latter; thus, we release the
-+     mutex after registering as waiter.
-+     If releasing the mutex fails, we just cancel our registration as a
-+     waiter and confirm that we have woken up.  */
-   err = __pthread_mutex_unlock_usercnt (mutex, 0);
--  if (__glibc_unlikely (err))
-+  if (__glibc_unlikely (err != 0))
-     {
--      lll_unlock (cond->__data.__lock, pshared);
-+      __condvar_cancel_waiting (cond, seq, g, private);
-+      __condvar_confirm_wakeup (cond, private);
-       return err;
-     }
- 
--  /* We have one new user of the condvar.  */
--  ++cond->__data.__total_seq;
--  ++cond->__data.__futex;
--  cond->__data.__nwaiters += 1 << COND_NWAITERS_SHIFT;
--
--  /* Remember the mutex we are using here.  If there is already a
--     different address store this is a bad user bug.  Do not store
--     anything for pshared condvars.  */
--  if (cond->__data.__mutex != (void *) ~0l)
--    cond->__data.__mutex = mutex;
--
--  /* Prepare structure passed to cancellation handler.  */
--  cbuffer.cond = cond;
--  cbuffer.mutex = mutex;
--
--  /* Before we block we enable cancellation.  Therefore we have to
--     install a cancellation handler.  */
--  __pthread_cleanup_push (&buffer, __condvar_cleanup, &cbuffer);
--
--  /* The current values of the wakeup counter.  The "woken" counter
--     must exceed this value.  */
--  unsigned long long int val;
--  unsigned long long int seq;
--  val = seq = cond->__data.__wakeup_seq;
--  /* Remember the broadcast counter.  */
--  cbuffer.bc_seq = cond->__data.__broadcast_seq;
-+  /* Now wait until a signal is available in our group or it is closed.
-+     Acquire MO so that if we observe a value of zero written after group
-+     switching in __condvar_quiesce_and_switch_g1, we synchronize with that
-+     store and will see the prior update of __g1_start done while switching
-+     groups too.  */
-+  unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
- 
-   do
-     {
--      unsigned int futex_val = cond->__data.__futex;
--      /* Prepare to wait.  Release the condvar futex.  */
--      lll_unlock (cond->__data.__lock, pshared);
--
--      /* Enable asynchronous cancellation.  Required by the standard.  */
--      cbuffer.oldtype = __pthread_enable_asynccancel ();
--
--#if (defined lll_futex_wait_requeue_pi \
--     && defined __ASSUME_REQUEUE_PI)
--      /* If pi_flag remained 1 then it means that we had the lock and the mutex
--	 but a spurious waker raced ahead of us.  Give back the mutex before
--	 going into wait again.  */
--      if (pi_flag)
-+      while (1)
- 	{
--	  __pthread_mutex_cond_lock_adjust (mutex);
--	  __pthread_mutex_unlock_usercnt (mutex, 0);
-+	  /* Spin-wait first.
-+	     Note that spinning first without checking whether a timeout
-+	     passed might lead to what looks like a spurious wake-up even
-+	     though we should return ETIMEDOUT (e.g., if the caller provides
-+	     an absolute timeout that is clearly in the past).  However,
-+	     (1) spurious wake-ups are allowed, (2) it seems unlikely that a
-+	     user will (ab)use pthread_cond_wait as a check for whether a
-+	     point in time is in the past, and (3) spinning first without
-+	     having to compare against the current time seems to be the right
-+	     choice from a performance perspective for most use cases.  */
-+	  unsigned int spin = maxspin;
-+	  while (signals == 0 && spin > 0)
-+	    {
-+	      /* Check that we are not spinning on a group that's already
-+		 closed.  */
-+	      if (seq < (__condvar_load_g1_start_relaxed (cond) >> 1))
-+		goto done;
-+
-+	      /* TODO Back off.  */
-+
-+	      /* Reload signals.  See above for MO.  */
-+	      signals = atomic_load_acquire (cond->__data.__g_signals + g);
-+	      spin--;
-+	    }
-+
-+	  /* If our group will be closed as indicated by the flag on signals,
-+	     don't bother grabbing a signal.  */
-+	  if (signals & 1)
-+	    goto done;
-+
-+	  /* If there is an available signal, don't block.  */
-+	  if (signals != 0)
-+	    break;
-+
-+	  /* No signals available after spinning, so prepare to block.
-+	     We first acquire a group reference and use acquire MO for that so
-+	     that we synchronize with the dummy read-modify-write in
-+	     __condvar_quiesce_and_switch_g1 if we read from that.  In turn,
-+	     in this case this will make us see the closed flag on __g_signals
-+	     that designates a concurrent attempt to reuse the group's slot.
-+	     We use acquire MO for the __g_signals check to make the
-+	     __g1_start check work (see spinning above).
-+	     Note that the group reference acquisition will not mask the
-+	     release MO when decrementing the reference count because we use
-+	     an atomic read-modify-write operation and thus extend the release
-+	     sequence.  */
-+	  atomic_fetch_add_acquire (cond->__data.__g_refs + g, 2);
-+	  if (((atomic_load_acquire (cond->__data.__g_signals + g) & 1) != 0)
-+	      || (seq < (__condvar_load_g1_start_relaxed (cond) >> 1)))
-+	    {
-+	      /* Our group is closed.  Wake up any signalers that might be
-+		 waiting.  */
-+	      __condvar_dec_grefs (cond, g, private);
-+	      goto done;
-+	    }
-+
-+	  // Now block.
-+	  struct _pthread_cleanup_buffer buffer;
-+	  struct _condvar_cleanup_buffer cbuffer;
-+	  cbuffer.wseq = wseq;
-+	  cbuffer.cond = cond;
-+	  cbuffer.mutex = mutex;
-+	  cbuffer.private = private;
-+	  __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer);
-+
-+	  if (abstime == NULL)
-+	    {
-+	      /* Block without a timeout.  */
-+	      err = futex_wait_cancelable (
-+		  cond->__data.__g_signals + g, 0, private);
-+	    }
-+	  else
-+	    {
-+	      /* Block, but with a timeout.
-+		 Work around the fact that the kernel rejects negative timeout
-+		 values despite them being valid.  */
-+	      if (__glibc_unlikely (abstime->tv_sec < 0))
-+	        err = ETIMEDOUT;
-+
-+	      else if ((flags & __PTHREAD_COND_CLOCK_MONOTONIC_MASK) != 0)
-+		{
-+		  /* CLOCK_MONOTONIC is requested.  */
-+		  struct timespec rt;
-+		  if (__clock_gettime (CLOCK_MONOTONIC, &rt) != 0)
-+		    __libc_fatal ("clock_gettime does not support "
-+				  "CLOCK_MONOTONIC");
-+		  /* Convert the absolute timeout value to a relative
-+		     timeout.  */
-+		  rt.tv_sec = abstime->tv_sec - rt.tv_sec;
-+		  rt.tv_nsec = abstime->tv_nsec - rt.tv_nsec;
-+		  if (rt.tv_nsec < 0)
-+		    {
-+		      rt.tv_nsec += 1000000000;
-+		      --rt.tv_sec;
-+		    }
-+		  /* Did we already time out?  */
-+		  if (__glibc_unlikely (rt.tv_sec < 0))
-+		    err = ETIMEDOUT;
-+		  else
-+		    err = futex_reltimed_wait_cancelable
-+			(cond->__data.__g_signals + g, 0, &rt, private);
-+		}
-+	      else
-+		{
-+		  /* Use CLOCK_REALTIME.  */
-+		  err = futex_abstimed_wait_cancelable
-+		      (cond->__data.__g_signals + g, 0, abstime, private);
-+		}
-+	    }
-+
-+	  __pthread_cleanup_pop (&buffer, 0);
-+
-+	  if (__glibc_unlikely (err == ETIMEDOUT))
-+	    {
-+	      __condvar_dec_grefs (cond, g, private);
-+	      /* If we timed out, we effectively cancel waiting.  Note that
-+		 we have decremented __g_refs before cancellation, so that a
-+		 deadlock between waiting for quiescence of our group in
-+		 __condvar_quiesce_and_switch_g1 and us trying to acquire
-+		 the lock during cancellation is not possible.  */
-+	      __condvar_cancel_waiting (cond, seq, g, private);
-+	      result = ETIMEDOUT;
-+	      goto done;
-+	    }
-+	  else
-+	    __condvar_dec_grefs (cond, g, private);
-+
-+	  /* Reload signals.  See above for MO.  */
-+	  signals = atomic_load_acquire (cond->__data.__g_signals + g);
- 	}
--      pi_flag = USE_REQUEUE_PI (mutex);
- 
--      if (pi_flag)
-+    }
-+  /* Try to grab a signal.  Use acquire MO so that we see an up-to-date value
-+     of __g1_start below (see spinning above for a similar case).  In
-+     particular, if we steal from a more recent group, we will also see a
-+     more recent __g1_start below.  */
-+  while (!atomic_compare_exchange_weak_acquire (cond->__data.__g_signals + g,
-+						&signals, signals - 2));
-+
-+  /* We consumed a signal but we could have consumed from a more recent group
-+     that aliased with ours due to being in the same group slot.  If this
-+     might be the case our group must be closed as visible through
-+     __g1_start.  */
-+  uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
-+  if (seq < (g1_start >> 1))
-+    {
-+      /* We potentially stole a signal from a more recent group but we do not
-+	 know which group we really consumed from.
-+	 We do not care about groups older than current G1 because they are
-+	 closed; we could have stolen from these, but then we just add a
-+	 spurious wake-up for the current groups.
-+	 We will never steal a signal from current G2 that was really intended
-+	 for G2 because G2 never receives signals (until it becomes G1).  We
-+	 could have stolen a signal from G2 that was conservatively added by a
-+	 previous waiter that also thought it stole a signal -- but given that
-+	 that signal was added unnecessarily, it's not a problem if we steal
-+	 it.
-+	 Thus, the remaining case is that we could have stolen from the current
-+	 G1, where "current" means the __g1_start value we observed.  However,
-+	 if the current G1 does not have the same slot index as we do, we did
-+	 not steal from it and do not need to undo that.  This is the reason
-+	 for putting a bit with G2's index into__g1_start as well.  */
-+      if (((g1_start & 1) ^ 1) == g)
- 	{
--	  err = lll_futex_wait_requeue_pi (&cond->__data.__futex,
--					   futex_val, &mutex->__data.__lock,
--					   pshared);
--
--	  pi_flag = (err == 0);
-+	  /* We have to conservatively undo our potential mistake of stealing
-+	     a signal.  We can stop trying to do that when the current G1
-+	     changes because other spinning waiters will notice this too and
-+	     __condvar_quiesce_and_switch_g1 has checked that there are no
-+	     futex waiters anymore before switching G1.
-+	     Relaxed MO is fine for the __g1_start load because we need to
-+	     merely be able to observe this fact and not have to observe
-+	     something else as well.
-+	     ??? Would it help to spin for a little while to see whether the
-+	     current G1 gets closed?  This might be worthwhile if the group is
-+	     small or close to being closed.  */
-+	  unsigned int s = atomic_load_relaxed (cond->__data.__g_signals + g);
-+	  while (__condvar_load_g1_start_relaxed (cond) == g1_start)
-+	    {
-+	      /* Try to add a signal.  We don't need to acquire the lock
-+		 because at worst we can cause a spurious wake-up.  If the
-+		 group is in the process of being closed (LSB is true), this
-+		 has an effect similar to us adding a signal.  */
-+	      if (((s & 1) != 0)
-+		  || atomic_compare_exchange_weak_relaxed
-+		       (cond->__data.__g_signals + g, &s, s + 2))
-+		{
-+		  /* If we added a signal, we also need to add a wake-up on
-+		     the futex.  We also need to do that if we skipped adding
-+		     a signal because the group is being closed because
-+		     while __condvar_quiesce_and_switch_g1 could have closed
-+		     the group, it might stil be waiting for futex waiters to
-+		     leave (and one of those waiters might be the one we stole
-+		     the signal from, which cause it to block using the
-+		     futex).  */
-+		  futex_wake (cond->__data.__g_signals + g, 1, private);
-+		  break;
-+		}
-+	      /* TODO Back off.  */
-+	    }
- 	}
--      else
--#endif
--	  /* Wait until woken by signal or broadcast.  */
--	lll_futex_wait (&cond->__data.__futex, futex_val, pshared);
--
--      /* Disable asynchronous cancellation.  */
--      __pthread_disable_asynccancel (cbuffer.oldtype);
--
--      /* We are going to look at shared data again, so get the lock.  */
--      lll_lock (cond->__data.__lock, pshared);
--
--      /* If a broadcast happened, we are done.  */
--      if (cbuffer.bc_seq != cond->__data.__broadcast_seq)
--	goto bc_out;
--
--      /* Check whether we are eligible for wakeup.  */
--      val = cond->__data.__wakeup_seq;
-     }
--  while (val == seq || cond->__data.__woken_seq == val);
- 
--  /* Another thread woken up.  */
--  ++cond->__data.__woken_seq;
-+ done:
- 
-- bc_out:
-+  /* Confirm that we have been woken.  We do that before acquiring the mutex
-+     to allow for execution of pthread_cond_destroy while having acquired the
-+     mutex.  */
-+  __condvar_confirm_wakeup (cond, private);
- 
--  cond->__data.__nwaiters -= 1 << COND_NWAITERS_SHIFT;
--
--  /* If pthread_cond_destroy was called on this varaible already,
--     notify the pthread_cond_destroy caller all waiters have left
--     and it can be successfully destroyed.  */
--  if (cond->__data.__total_seq == -1ULL
--      && cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT))
--    lll_futex_wake (&cond->__data.__nwaiters, 1, pshared);
-+  /* Woken up; now re-acquire the mutex.  If this doesn't fail, return RESULT,
-+     which is set to ETIMEDOUT if a timeout occured, or zero otherwise.  */
-+  err = __pthread_mutex_cond_lock (mutex);
-+  /* XXX Abort on errors that are disallowed by POSIX?  */
-+  return (err != 0) ? err : result;
-+}
- 
--  /* We are done with the condvar.  */
--  lll_unlock (cond->__data.__lock, pshared);
- 
--  /* The cancellation handling is back to normal, remove the handler.  */
--  __pthread_cleanup_pop (&buffer, 0);
-+/* See __pthread_cond_wait_common.  */
-+int
-+__pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)
-+{
-+  return __pthread_cond_wait_common (cond, mutex, NULL);
-+}
- 
--  /* Get the mutex before returning.  Not needed for PI.  */
--#if (defined lll_futex_wait_requeue_pi \
--     && defined __ASSUME_REQUEUE_PI)
--  if (pi_flag)
--    {
--      __pthread_mutex_cond_lock_adjust (mutex);
--      return 0;
--    }
--  else
--#endif
--    return __pthread_mutex_cond_lock (mutex);
-+/* See __pthread_cond_wait_common.  */
-+int
-+__pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
-+    const struct timespec *abstime)
-+{
-+  /* Check parameter validity.  This should also tell the compiler that
-+     it can assume that abstime is not NULL.  */
-+  if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
-+    return EINVAL;
-+  return __pthread_cond_wait_common (cond, mutex, abstime);
- }
- 
- versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
- 		  GLIBC_2_3_2);
-+versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
-+		  GLIBC_2_3_2);
-diff --git a/nptl/pthread_condattr_getclock.c b/nptl/pthread_condattr_getclock.c
-index d156302..cecb4aa 100644
---- a/nptl/pthread_condattr_getclock.c
-+++ b/nptl/pthread_condattr_getclock.c
-@@ -23,6 +23,6 @@ int
- pthread_condattr_getclock (const pthread_condattr_t *attr, clockid_t *clock_id)
- {
-   *clock_id = (((((const struct pthread_condattr *) attr)->value) >> 1)
--	       & ((1 << COND_NWAITERS_SHIFT) - 1));
-+	       & ((1 << COND_CLOCK_BITS) - 1));
-   return 0;
- }
-diff --git a/nptl/pthread_condattr_getpshared.c b/nptl/pthread_condattr_getpshared.c
-index 5a10f3e..8147966 100644
---- a/nptl/pthread_condattr_getpshared.c
-+++ b/nptl/pthread_condattr_getpshared.c
-@@ -22,7 +22,8 @@
- int
- pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared)
- {
--  *pshared = ((const struct pthread_condattr *) attr)->value & 1;
-+  *pshared = (((const struct pthread_condattr *) attr)->value & 1
-+	      ? PTHREAD_PROCESS_SHARED : PTHREAD_PROCESS_PRIVATE);
- 
-   return 0;
- }
-diff --git a/nptl/pthread_condattr_init.c b/nptl/pthread_condattr_init.c
-index 0ce42e5..6e5168d 100644
---- a/nptl/pthread_condattr_init.c
-+++ b/nptl/pthread_condattr_init.c
-@@ -23,7 +23,9 @@
- int
- __pthread_condattr_init (pthread_condattr_t *attr)
- {
--  memset (attr, '\0', sizeof (*attr));
-+  struct pthread_condattr *iattr = (struct pthread_condattr *) attr;
-+  /* Default is not pshared and CLOCK_REALTIME.  */
-+  iattr-> value = CLOCK_REALTIME << 1;
- 
-   return 0;
- }
-diff --git a/nptl/pthread_condattr_setclock.c b/nptl/pthread_condattr_setclock.c
-index 25e2a17..3cfad84 100644
---- a/nptl/pthread_condattr_setclock.c
-+++ b/nptl/pthread_condattr_setclock.c
-@@ -18,7 +18,7 @@
- 
- #include <assert.h>
- #include <errno.h>
--#include <stdbool.h>
-+#include <futex-internal.h>
- #include <time.h>
- #include <sysdep.h>
- #include "pthreadP.h"
-@@ -33,12 +33,17 @@ pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t clock_id)
-        in the pthread_cond_t structure needs to be adjusted.  */
-     return EINVAL;
- 
-+  /* If we do not support waiting using CLOCK_MONOTONIC, return an error.  */
-+  if (clock_id == CLOCK_MONOTONIC
-+      && !futex_supports_exact_relative_timeouts())
-+    return ENOTSUP;
-+
-   /* Make sure the value fits in the bits we reserved.  */
--  assert (clock_id < (1 << COND_NWAITERS_SHIFT));
-+  assert (clock_id < (1 << COND_CLOCK_BITS));
- 
-   int *valuep = &((struct pthread_condattr *) attr)->value;
- 
--  *valuep = ((*valuep & ~(((1 << COND_NWAITERS_SHIFT) - 1) << 1))
-+  *valuep = ((*valuep & ~(((1 << COND_CLOCK_BITS) - 1) << 1))
- 	     | (clock_id << 1));
- 
-   return 0;
-diff --git a/nptl/test-cond-printers.py b/nptl/test-cond-printers.py
-index af0e12e..9e807c9 100644
---- a/nptl/test-cond-printers.py
-+++ b/nptl/test-cond-printers.py
-@@ -35,7 +35,7 @@ try:
- 
-     break_at(test_source, 'Test status (destroyed)')
-     continue_cmd() # Go to test_status_destroyed
--    test_printer(var, to_string, {'Status': 'Destroyed'})
-+    test_printer(var, to_string, {'Threads known to still execute a wait function': '0'})
- 
-     continue_cmd() # Exit
- 
-diff --git a/nptl/tst-cond1.c b/nptl/tst-cond1.c
-index 75ab9c8..509bbd0 100644
---- a/nptl/tst-cond1.c
-+++ b/nptl/tst-cond1.c
-@@ -73,6 +73,9 @@ do_test (void)
- 
-   puts ("parent: wait for condition");
- 
-+  /* This test will fail on spurious wake-ups, which are allowed; however,
-+     the current implementation shouldn't produce spurious wake-ups in the
-+     scenario we are testing here.  */
-   err = pthread_cond_wait (&cond, &mut);
-   if (err != 0)
-     error (EXIT_FAILURE, err, "parent: cannot wait fir signal");
-diff --git a/nptl/tst-cond20.c b/nptl/tst-cond20.c
-index 918c4ad..665a66a 100644
---- a/nptl/tst-cond20.c
-+++ b/nptl/tst-cond20.c
-@@ -96,7 +96,10 @@ do_test (void)
- 
-   for (i = 0; i < ROUNDS; ++i)
-     {
--      pthread_cond_wait (&cond2, &mut);
-+      /* Make sure we discard spurious wake-ups.  */
-+      do
-+	pthread_cond_wait (&cond2, &mut);
-+      while (count != N);
- 
-       if (i & 1)
-         pthread_mutex_unlock (&mut);
-diff --git a/nptl/tst-cond22.c b/nptl/tst-cond22.c
-index bd978e5..64f19ea 100644
---- a/nptl/tst-cond22.c
-+++ b/nptl/tst-cond22.c
-@@ -106,10 +106,11 @@ do_test (void)
-       status = 1;
-     }
- 
--  printf ("cond = { %d, %x, %lld, %lld, %lld, %p, %u, %u }\n",
--	  c.__data.__lock, c.__data.__futex, c.__data.__total_seq,
--	  c.__data.__wakeup_seq, c.__data.__woken_seq, c.__data.__mutex,
--	  c.__data.__nwaiters, c.__data.__broadcast_seq);
-+  printf ("cond = { %llu, %llu, %u/%u/%u, %u/%u/%u, %u, %u }\n",
-+	  c.__data.__wseq, c.__data.__g1_start,
-+	  c.__data.__g_signals[0], c.__data.__g_refs[0], c.__data.__g_size[0],
-+	  c.__data.__g_signals[1], c.__data.__g_refs[1], c.__data.__g_size[1],
-+	  c.__data.__g1_orig_size, c.__data.__wrefs);
- 
-   if (pthread_create (&th, NULL, tf, (void *) 1l) != 0)
-     {
-@@ -148,10 +149,11 @@ do_test (void)
-       status = 1;
-     }
- 
--  printf ("cond = { %d, %x, %lld, %lld, %lld, %p, %u, %u }\n",
--	  c.__data.__lock, c.__data.__futex, c.__data.__total_seq,
--	  c.__data.__wakeup_seq, c.__data.__woken_seq, c.__data.__mutex,
--	  c.__data.__nwaiters, c.__data.__broadcast_seq);
-+  printf ("cond = { %llu, %llu, %u/%u/%u, %u/%u/%u, %u, %u }\n",
-+	  c.__data.__wseq, c.__data.__g1_start,
-+	  c.__data.__g_signals[0], c.__data.__g_refs[0], c.__data.__g_size[0],
-+	  c.__data.__g_signals[1], c.__data.__g_refs[1], c.__data.__g_size[1],
-+	  c.__data.__g1_orig_size, c.__data.__wrefs);
- 
-   return status;
- }
-diff --git a/sysdeps/aarch64/nptl/bits/pthreadtypes.h b/sysdeps/aarch64/nptl/bits/pthreadtypes.h
-index 13984a7..c6fa632 100644
---- a/sysdeps/aarch64/nptl/bits/pthreadtypes.h
-+++ b/sysdeps/aarch64/nptl/bits/pthreadtypes.h
-@@ -90,17 +90,30 @@ typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
--  long int __align;
-+  __extension__ long long int __align;
- } pthread_cond_t;
- 
- typedef union
-diff --git a/sysdeps/arm/nptl/bits/pthreadtypes.h b/sysdeps/arm/nptl/bits/pthreadtypes.h
-index afb5392..53518c6 100644
---- a/sysdeps/arm/nptl/bits/pthreadtypes.h
-+++ b/sysdeps/arm/nptl/bits/pthreadtypes.h
-@@ -93,14 +93,27 @@ typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
-diff --git a/sysdeps/ia64/nptl/bits/pthreadtypes.h b/sysdeps/ia64/nptl/bits/pthreadtypes.h
-index f2e6dac..e72dbfd 100644
---- a/sysdeps/ia64/nptl/bits/pthreadtypes.h
-+++ b/sysdeps/ia64/nptl/bits/pthreadtypes.h
-@@ -90,17 +90,30 @@ typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
--  long int __align;
-+  __extension__ long long int __align;
- } pthread_cond_t;
- 
- typedef union
-diff --git a/sysdeps/m68k/nptl/bits/pthreadtypes.h b/sysdeps/m68k/nptl/bits/pthreadtypes.h
-index d8faa7a..c5e9021 100644
---- a/sysdeps/m68k/nptl/bits/pthreadtypes.h
-+++ b/sysdeps/m68k/nptl/bits/pthreadtypes.h
-@@ -88,19 +88,33 @@ typedef union
- 
- 
- /* Data structure for conditional variable handling.  The structure of
--   the attribute type is deliberately not exposed.  */
-+   the attribute type is not exposed on purpose.  */
- typedef union
- {
-   struct
-   {
--    int __lock __attribute__ ((__aligned__ (4)));
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    /* Enforce proper alignment of fields used as futex words.  */
-+    unsigned int __g_refs[2] __attribute__ ((__aligned__ (4)));
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
-diff --git a/sysdeps/microblaze/nptl/bits/pthreadtypes.h b/sysdeps/microblaze/nptl/bits/pthreadtypes.h
-index 9e9e307..b6623c2 100644
---- a/sysdeps/microblaze/nptl/bits/pthreadtypes.h
-+++ b/sysdeps/microblaze/nptl/bits/pthreadtypes.h
-@@ -91,14 +91,27 @@ typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
-diff --git a/sysdeps/mips/nptl/bits/pthreadtypes.h b/sysdeps/mips/nptl/bits/pthreadtypes.h
-index 68ed94b..7ddc7bf 100644
---- a/sysdeps/mips/nptl/bits/pthreadtypes.h
-+++ b/sysdeps/mips/nptl/bits/pthreadtypes.h
-@@ -117,19 +117,32 @@ typedef union
- 
- 
- /* Data structure for conditional variable handling.  The structure of
--   the attribute type is deliberately not exposed.  */
-+   the attribute type is not exposed on purpose.  */
- typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
-diff --git a/sysdeps/nios2/nptl/bits/pthreadtypes.h b/sysdeps/nios2/nptl/bits/pthreadtypes.h
-index 76076d0..3995e26 100644
---- a/sysdeps/nios2/nptl/bits/pthreadtypes.h
-+++ b/sysdeps/nios2/nptl/bits/pthreadtypes.h
-@@ -88,19 +88,32 @@ typedef union
- 
- 
- /* Data structure for conditional variable handling.  The structure of
--   the attribute type is deliberately not exposed.  */
-+   the attribute type is not exposed on purpose.  */
- typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
-diff --git a/sysdeps/nptl/internaltypes.h b/sysdeps/nptl/internaltypes.h
-index 203c548..31e5a43 100644
---- a/sysdeps/nptl/internaltypes.h
-+++ b/sysdeps/nptl/internaltypes.h
-@@ -68,20 +68,13 @@ struct pthread_condattr
- {
-   /* Combination of values:
- 
--     Bit 0  : flag whether conditional variable will be sharable between
--	      processes.
--
--     Bit 1-7: clock ID.  */
-+     Bit 0                : flag whether conditional variable will be
-+                            sharable between processes.
-+     Bit 1-COND_CLOCK_BITS: Clock ID.  COND_CLOCK_BITS is the number of bits
-+                            needed to represent the ID of the clock.  */
-   int value;
- };
--
--
--/* The __NWAITERS field is used as a counter and to house the number
--   of bits for other purposes.  COND_CLOCK_BITS is the number
--   of bits needed to represent the ID of the clock.  COND_NWAITERS_SHIFT
--   is the number of bits reserved for other purposes like the clock.  */
--#define COND_CLOCK_BITS		1
--#define COND_NWAITERS_SHIFT	1
-+#define COND_CLOCK_BITS	1
- 
- 
- /* Read-write lock variable attribute data structure.  */
-diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
-index fd0894e..c122446 100644
---- a/sysdeps/nptl/pthread.h
-+++ b/sysdeps/nptl/pthread.h
-@@ -183,7 +183,7 @@ enum
- 
- 
- /* Conditional variable handling.  */
--#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }
-+#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, {0, 0}, 0, 0, {0, 0} } }
- 
- 
- /* Cleanup buffers */
-diff --git a/sysdeps/s390/nptl/bits/pthreadtypes.h b/sysdeps/s390/nptl/bits/pthreadtypes.h
-index 40d10fe..4e455ab 100644
---- a/sysdeps/s390/nptl/bits/pthreadtypes.h
-+++ b/sysdeps/s390/nptl/bits/pthreadtypes.h
-@@ -142,14 +142,27 @@ typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
-diff --git a/sysdeps/sh/nptl/bits/pthreadtypes.h b/sysdeps/sh/nptl/bits/pthreadtypes.h
-index 13fbd73..065dd11 100644
---- a/sysdeps/sh/nptl/bits/pthreadtypes.h
-+++ b/sysdeps/sh/nptl/bits/pthreadtypes.h
-@@ -93,14 +93,27 @@ typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
-diff --git a/sysdeps/tile/nptl/bits/pthreadtypes.h b/sysdeps/tile/nptl/bits/pthreadtypes.h
-index 7d68650..c12737f 100644
---- a/sysdeps/tile/nptl/bits/pthreadtypes.h
-+++ b/sysdeps/tile/nptl/bits/pthreadtypes.h
-@@ -122,14 +122,27 @@ typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
-diff --git a/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
-index 1a1779b..d88b045 100644
---- a/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
-+++ b/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
-@@ -84,19 +84,32 @@ typedef union
- 
- 
- /* Data structure for conditional variable handling.  The structure of
--   the attribute type is deliberately not exposed.  */
-+   the attribute type is not exposed on purpose.  */
- typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
-diff --git a/sysdeps/unix/sysv/linux/hppa/internaltypes.h b/sysdeps/unix/sysv/linux/hppa/internaltypes.h
-index 651ce2e..d649657 100644
---- a/sysdeps/unix/sysv/linux/hppa/internaltypes.h
-+++ b/sysdeps/unix/sysv/linux/hppa/internaltypes.h
-@@ -46,32 +46,38 @@ fails because __initializer is zero, and the structure will be used as
- is correctly.  */
- 
- #define cond_compat_clear(var) \
--({											\
--  int tmp = 0;										\
--  var->__data.__lock = 0;								\
--  var->__data.__futex = 0;								\
--  var->__data.__mutex = NULL;								\
--  /* Clear __initializer last, to indicate initialization is done.  */			\
--  __asm__ __volatile__ ("stw,ma %1,0(%0)"						\
--			: : "r" (&var->__data.__initializer), "r" (tmp) : "memory");	\
-+({									\
-+  int tmp = 0;								\
-+  var->__data.__wseq = 0;						\
-+  var->__data.__signals_sent = 0;					\
-+  var->__data.__confirmed = 0;						\
-+  var->__data.__generation = 0;						\
-+  var->__data.__mutex = NULL;						\
-+  var->__data.__quiescence_waiters = 0;					\
-+  var->__data.__clockid = 0;						\
-+  /* Clear __initializer last, to indicate initialization is done.  */	\
-+  /* This synchronizes-with the acquire load below.  */			\
-+  atomic_store_release (&var->__data.__initializer, 0);			\
- })
- 
- #define cond_compat_check_and_clear(var) \
- ({								\
--  int ret;							\
--  volatile int *value = &var->__data.__initializer;		\
--  if ((ret = atomic_compare_and_exchange_val_acq(value, 2, 1)))	\
-+  int v;							\
-+  int *value = &var->__data.__initializer;			\
-+  /* This synchronizes-with the release store above.  */	\
-+  while ((v = atomic_load_acquire (value)) != 0)		\
-     {								\
--      if (ret == 1)						\
-+      if (v == 1						\
-+	  /* Relaxed MO is fine; it only matters who's first.  */        \
-+	  && atomic_compare_exchange_acquire_weak_relaxed (value, 1, 2)) \
- 	{							\
--	  /* Initialize structure.  */				\
-+	  /* We're first; initialize structure.  */		\
- 	  cond_compat_clear (var);				\
-+	  break;						\
- 	}							\
-       else							\
--        {							\
--	  /* Yield until structure is initialized.  */		\
--	  while (*value == 2) sched_yield ();			\
--        }							\
-+	/* Yield before we re-check initialization status.  */	\
-+	sched_yield ();						\
-     }								\
- })
- 
-diff --git a/sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c b/sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c
-deleted file mode 100644
-index ec6fd23..0000000
---- a/sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c
-+++ /dev/null
-@@ -1,41 +0,0 @@
--/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Carlos O'Donell <carlos@codesourcery.com>, 2009.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library.  If not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#ifndef INCLUDED_SELF
--# define INCLUDED_SELF
--# include <pthread_cond_timedwait.c>
--#else
--# include <pthread.h>
--# include <pthreadP.h>
--# include <internaltypes.h>
--# include <shlib-compat.h>
--int
--__pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
--			  const struct timespec *abstime)
--{
--  cond_compat_check_and_clear (cond);
--  return __pthread_cond_timedwait_internal (cond, mutex, abstime);
--}
--versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
--                  GLIBC_2_3_2);
--# undef versioned_symbol
--# define versioned_symbol(lib, local, symbol, version)
--# undef __pthread_cond_timedwait
--# define __pthread_cond_timedwait __pthread_cond_timedwait_internal
--# include_next <pthread_cond_timedwait.c>
--#endif
-diff --git a/sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c b/sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c
-index 8f02831..0611f7d 100644
---- a/sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c
-+++ b/sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c
-@@ -32,9 +32,22 @@ __pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)
- }
- versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
-                   GLIBC_2_3_2);
-+int
-+__pthread_cond_timedwait (cond, mutex, abstime)
-+     pthread_cond_t *cond;
-+     pthread_mutex_t *mutex;
-+     const struct timespec *abstime;
-+{
-+  cond_compat_check_and_clear (cond);
-+  return __pthread_cond_timedwait_internal (cond, mutex, abstime);
-+}
-+versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
-+                  GLIBC_2_3_2);
- # undef versioned_symbol
- # define versioned_symbol(lib, local, symbol, version)
- # undef __pthread_cond_wait
- # define __pthread_cond_wait __pthread_cond_wait_internal
-+# undef __pthread_cond_timedwait
-+# define __pthread_cond_timedwait __pthread_cond_timedwait_internal
- # include_next <pthread_cond_wait.c>
- #endif
-diff --git a/sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S b/sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S
-deleted file mode 100644
-index f697e5b..0000000
---- a/sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S
-+++ /dev/null
-@@ -1,20 +0,0 @@
--/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library; if not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#define HAVE_CMOV 1
--#include "../pthread_cond_timedwait.S"
-diff --git a/sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S b/sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
-deleted file mode 100644
-index 5996688..0000000
---- a/sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
-+++ /dev/null
-@@ -1,241 +0,0 @@
--/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library; if not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#include <sysdep.h>
--#include <shlib-compat.h>
--#include <lowlevellock.h>
--#include <lowlevelcond.h>
--#include <kernel-features.h>
--#include <pthread-pi-defines.h>
--#include <pthread-errnos.h>
--#include <stap-probe.h>
--
--	.text
--
--	/* int pthread_cond_broadcast (pthread_cond_t *cond) */
--	.globl	__pthread_cond_broadcast
--	.type	__pthread_cond_broadcast, @function
--	.align	16
--__pthread_cond_broadcast:
--	cfi_startproc
--	pushl	%ebx
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%ebx, 0)
--	pushl	%esi
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%esi, 0)
--	pushl	%edi
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%edi, 0)
--	pushl	%ebp
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%ebp, 0)
--	cfi_remember_state
--
--	movl	20(%esp), %ebx
--
--	LIBC_PROBE (cond_broadcast, 1, %edx)
--
--	/* Get internal lock.  */
--	movl	$1, %edx
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %edx, (%ebx)
--#else
--	cmpxchgl %edx, cond_lock(%ebx)
--#endif
--	jnz	1f
--
--2:	addl	$cond_futex, %ebx
--	movl	total_seq+4-cond_futex(%ebx), %eax
--	movl	total_seq-cond_futex(%ebx), %ebp
--	cmpl	wakeup_seq+4-cond_futex(%ebx), %eax
--	ja	3f
--	jb	4f
--	cmpl	wakeup_seq-cond_futex(%ebx), %ebp
--	jna	4f
--
--	/* Cause all currently waiting threads to recognize they are
--	   woken up.  */
--3:	movl	%ebp, wakeup_seq-cond_futex(%ebx)
--	movl	%eax, wakeup_seq-cond_futex+4(%ebx)
--	movl	%ebp, woken_seq-cond_futex(%ebx)
--	movl	%eax, woken_seq-cond_futex+4(%ebx)
--	addl	%ebp, %ebp
--	addl	$1, broadcast_seq-cond_futex(%ebx)
--	movl	%ebp, (%ebx)
--
--	/* Get the address of the mutex used.  */
--	movl	dep_mutex-cond_futex(%ebx), %edi
--
--	/* Unlock.  */
--	LOCK
--	subl	$1, cond_lock-cond_futex(%ebx)
--	jne	7f
--
--	/* Don't use requeue for pshared condvars.  */
--8:	cmpl	$-1, %edi
--	je	9f
--
--	/* Do not use requeue for pshared condvars.  */
--	testl	$PS_BIT, MUTEX_KIND(%edi)
--	jne	9f
--
--	/* Requeue to a non-robust PI mutex if the PI bit is set and
--	   the robust bit is not set.  */
--	movl	MUTEX_KIND(%edi), %eax
--	andl	$(ROBUST_BIT|PI_BIT), %eax
--	cmpl	$PI_BIT, %eax
--	je	81f
--
--	/* Wake up all threads.  */
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$(FUTEX_CMP_REQUEUE|FUTEX_PRIVATE_FLAG), %ecx
--#else
--	movl	%gs:PRIVATE_FUTEX, %ecx
--	orl	$FUTEX_CMP_REQUEUE, %ecx
--#endif
--	movl	$SYS_futex, %eax
--	movl	$0x7fffffff, %esi
--	movl	$1, %edx
--	/* Get the address of the futex involved.  */
--# if MUTEX_FUTEX != 0
--	addl	$MUTEX_FUTEX, %edi
--# endif
--/* FIXME: Until Ingo fixes 4G/4G vDSO, 6 arg syscalls are broken for sysenter.
--	ENTER_KERNEL  */
--	int	$0x80
--
--	/* For any kind of error, which mainly is EAGAIN, we try again
--	   with WAKE.  The general test also covers running on old
--	   kernels.  */
--	cmpl	$0xfffff001, %eax
--	jae	9f
--
--6:	xorl	%eax, %eax
--	popl	%ebp
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%ebp)
--	popl	%edi
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%edi)
--	popl	%esi
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%esi)
--	popl	%ebx
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%ebx)
--	ret
--
--	cfi_restore_state
--
--81:	movl	$(FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
--	movl	$SYS_futex, %eax
--	movl	$0x7fffffff, %esi
--	movl	$1, %edx
--	/* Get the address of the futex involved.  */
--# if MUTEX_FUTEX != 0
--	addl	$MUTEX_FUTEX, %edi
--# endif
--	int	$0x80
--
--	/* For any kind of error, which mainly is EAGAIN, we try again
--	with WAKE.  The general test also covers running on old
--	kernels.  */
--	cmpl	$0xfffff001, %eax
--	jb	6b
--	jmp	9f
--
--	/* Initial locking failed.  */
--1:
--#if cond_lock == 0
--	movl	%ebx, %edx
--#else
--	leal	cond_lock(%ebx), %edx
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_lock_wait
--	jmp	2b
--
--	.align	16
--	/* Unlock.  */
--4:	LOCK
--	subl	$1, cond_lock-cond_futex(%ebx)
--	je	6b
--
--	/* Unlock in loop requires wakeup.  */
--5:	leal	cond_lock-cond_futex(%ebx), %eax
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_futex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--	jmp	6b
--
--	/* Unlock in loop requires wakeup.  */
--7:	leal	cond_lock-cond_futex(%ebx), %eax
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_futex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--	jmp	8b
--
--9:	/* The futex requeue functionality is not available.  */
--	movl	$0x7fffffff, %edx
--#if FUTEX_PRIVATE_FLAG > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_futex(%ebx)
--	sete	%cl
--	subl	$1, %ecx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--	addl	$FUTEX_WAKE, %ecx
--	movl	$SYS_futex, %eax
--	ENTER_KERNEL
--	jmp	6b
--	cfi_endproc
--	.size	__pthread_cond_broadcast, .-__pthread_cond_broadcast
--versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
--		  GLIBC_2_3_2)
-diff --git a/sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S b/sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
-deleted file mode 100644
-index 0038775..0000000
---- a/sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
-+++ /dev/null
-@@ -1,216 +0,0 @@
--/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library; if not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#include <sysdep.h>
--#include <shlib-compat.h>
--#include <lowlevellock.h>
--#include <lowlevelcond.h>
--#include <kernel-features.h>
--#include <pthread-pi-defines.h>
--#include <pthread-errnos.h>
--#include <stap-probe.h>
--
--	.text
--
--	/* int pthread_cond_signal (pthread_cond_t *cond) */
--	.globl	__pthread_cond_signal
--	.type	__pthread_cond_signal, @function
--	.align	16
--__pthread_cond_signal:
--
--	cfi_startproc
--	pushl	%ebx
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%ebx, 0)
--	pushl	%edi
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%edi, 0)
--	cfi_remember_state
--
--	movl	12(%esp), %edi
--
--	LIBC_PROBE (cond_signal, 1, %edi)
--
--	/* Get internal lock.  */
--	movl	$1, %edx
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %edx, (%edi)
--#else
--	cmpxchgl %edx, cond_lock(%edi)
--#endif
--	jnz	1f
--
--2:	leal	cond_futex(%edi), %ebx
--	movl	total_seq+4(%edi), %eax
--	movl	total_seq(%edi), %ecx
--	cmpl	wakeup_seq+4(%edi), %eax
--#if cond_lock != 0
--	/* Must use leal to preserve the flags.  */
--	leal	cond_lock(%edi), %edi
--#endif
--	ja	3f
--	jb	4f
--	cmpl	wakeup_seq-cond_futex(%ebx), %ecx
--	jbe	4f
--
--	/* Bump the wakeup number.  */
--3:	addl	$1, wakeup_seq-cond_futex(%ebx)
--	adcl	$0, wakeup_seq-cond_futex+4(%ebx)
--	addl	$1, (%ebx)
--
--	/* Wake up one thread.  */
--	pushl	%esi
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%esi, 0)
--	pushl	%ebp
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%ebp, 0)
--
--#if FUTEX_PRIVATE_FLAG > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_futex(%ebx)
--	sete	%cl
--	je	8f
--
--	movl	dep_mutex-cond_futex(%ebx), %edx
--	/* Requeue to a non-robust PI mutex if the PI bit is set and
--	   the robust bit is not set.  */
--	movl	MUTEX_KIND(%edx), %eax
--	andl	$(ROBUST_BIT|PI_BIT), %eax
--	cmpl	$PI_BIT, %eax
--	je	9f
--
--8:	subl	$1, %ecx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--	addl	$FUTEX_WAKE_OP, %ecx
--	movl	$SYS_futex, %eax
--	movl	$1, %edx
--	movl	$1, %esi
--	movl	$FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, %ebp
--	/* FIXME: Until Ingo fixes 4G/4G vDSO, 6 arg syscalls are broken for
--	   sysenter.
--	ENTER_KERNEL  */
--	int	$0x80
--	popl	%ebp
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%ebp)
--	popl	%esi
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%esi)
--
--	/* For any kind of error, we try again with WAKE.
--	   The general test also covers running on old kernels.  */
--	cmpl	$-4095, %eax
--	jae	7f
--
--6:	xorl	%eax, %eax
--	popl	%edi
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%edi)
--	popl	%ebx
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%ebx)
--	ret
--
--	cfi_restore_state
--
--9:	movl	$(FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
--	movl	$SYS_futex, %eax
--	movl	$1, %edx
--	xorl	%esi, %esi
--	movl	dep_mutex-cond_futex(%ebx), %edi
--	movl	(%ebx), %ebp
--	/* FIXME: Until Ingo fixes 4G/4G vDSO, 6 arg syscalls are broken for
--	   sysenter.
--	ENTER_KERNEL  */
--	int	$0x80
--	popl	%ebp
--	popl	%esi
--
--	leal	-cond_futex(%ebx), %edi
--
--	/* For any kind of error, we try again with WAKE.
--	   The general test also covers running on old kernels.  */
--	cmpl	$-4095, %eax
--	jb	4f
--
--7:
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--	orl	$FUTEX_WAKE, %ecx
--
--	movl	$SYS_futex, %eax
--	/* %edx should be 1 already from $FUTEX_WAKE_OP syscall.
--	movl	$1, %edx  */
--	ENTER_KERNEL
--
--	/* Unlock.  Note that at this point %edi always points to
--	   cond_lock.  */
--4:	LOCK
--	subl	$1, (%edi)
--	je	6b
--
--	/* Unlock in loop requires wakeup.  */
--5:	movl	%edi, %eax
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_futex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--	jmp	6b
--
--	/* Initial locking failed.  */
--1:
--#if cond_lock == 0
--	movl	%edi, %edx
--#else
--	leal	cond_lock(%edi), %edx
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%edi)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_lock_wait
--	jmp	2b
--
--	cfi_endproc
--	.size	__pthread_cond_signal, .-__pthread_cond_signal
--versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal,
--		  GLIBC_2_3_2)
-diff --git a/sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S b/sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
-deleted file mode 100644
-index 6256376..0000000
---- a/sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
-+++ /dev/null
-@@ -1,974 +0,0 @@
--/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library; if not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#include <sysdep.h>
--#include <shlib-compat.h>
--#include <lowlevellock.h>
--#include <lowlevelcond.h>
--#include <pthread-errnos.h>
--#include <pthread-pi-defines.h>
--#include <kernel-features.h>
--#include <stap-probe.h>
--
--	.text
--
--/* int pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
--			       const struct timespec *abstime)  */
--	.globl	__pthread_cond_timedwait
--	.type	__pthread_cond_timedwait, @function
--	.align	16
--__pthread_cond_timedwait:
--.LSTARTCODE:
--	cfi_startproc
--#ifdef SHARED
--	cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
--			DW.ref.__gcc_personality_v0)
--	cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
--#else
--	cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
--	cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
--#endif
--
--	pushl	%ebp
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%ebp, 0)
--	pushl	%edi
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%edi, 0)
--	pushl	%esi
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%esi, 0)
--	pushl	%ebx
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%ebx, 0)
--
--	movl	20(%esp), %ebx
--	movl	28(%esp), %ebp
--
--	LIBC_PROBE (cond_timedwait, 3, %ebx, 24(%esp), %ebp)
--
--	cmpl	$1000000000, 4(%ebp)
--	movl	$EINVAL, %eax
--	jae	18f
--
--	/* Stack frame:
--
--	   esp + 32
--		    +--------------------------+
--	   esp + 24 | timeout value            |
--		    +--------------------------+
--	   esp + 20 | futex pointer            |
--		    +--------------------------+
--	   esp + 16 | pi-requeued flag         |
--		    +--------------------------+
--	   esp + 12 | old broadcast_seq value  |
--		    +--------------------------+
--	   esp +  4 | old wake_seq value       |
--		    +--------------------------+
--	   esp +  0 | old cancellation mode    |
--		    +--------------------------+
--	*/
--
--#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
--# ifdef PIC
--	LOAD_PIC_REG (cx)
--	cmpl	$0, __have_futex_clock_realtime@GOTOFF(%ecx)
--# else
--	cmpl	$0, __have_futex_clock_realtime
--# endif
--	je	.Lreltmo
--#endif
--
--	/* Get internal lock.  */
--	movl	$1, %edx
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %edx, (%ebx)
--#else
--	cmpxchgl %edx, cond_lock(%ebx)
--#endif
--	jnz	1f
--
--	/* Store the reference to the mutex.  If there is already a
--	   different value in there this is a bad user bug.  */
--2:	cmpl	$-1, dep_mutex(%ebx)
--	movl	24(%esp), %eax
--	je	17f
--	movl	%eax, dep_mutex(%ebx)
--
--	/* Unlock the mutex.  */
--17:	xorl	%edx, %edx
--	call	__pthread_mutex_unlock_usercnt
--
--	testl	%eax, %eax
--	jne	16f
--
--	addl	$1, total_seq(%ebx)
--	adcl	$0, total_seq+4(%ebx)
--	addl	$1, cond_futex(%ebx)
--	addl	$(1 << nwaiters_shift), cond_nwaiters(%ebx)
--
--#ifdef __ASSUME_FUTEX_CLOCK_REALTIME
--# define FRAME_SIZE 24
--#else
--# define FRAME_SIZE 32
--#endif
--	subl	$FRAME_SIZE, %esp
--	cfi_adjust_cfa_offset(FRAME_SIZE)
--	cfi_remember_state
--
--	/* Get and store current wakeup_seq value.  */
--	movl	wakeup_seq(%ebx), %edi
--	movl	wakeup_seq+4(%ebx), %edx
--	movl	broadcast_seq(%ebx), %eax
--	movl	%edi, 4(%esp)
--	movl	%edx, 8(%esp)
--	movl	%eax, 12(%esp)
--
--	/* Reset the pi-requeued flag.  */
--	movl	$0, 16(%esp)
--
--	cmpl	$0, (%ebp)
--	movl	$-ETIMEDOUT, %esi
--	js	6f
--
--8:	movl	cond_futex(%ebx), %edi
--	movl	%edi, 20(%esp)
--
--	/* Unlock.  */
--	LOCK
--#if cond_lock == 0
--	subl	$1, (%ebx)
--#else
--	subl	$1, cond_lock(%ebx)
--#endif
--	jne	3f
--
--.LcleanupSTART:
--4:	call	__pthread_enable_asynccancel
--	movl	%eax, (%esp)
--
--	leal	(%ebp), %esi
--#if FUTEX_PRIVATE_FLAG > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	sete	%cl
--	je	40f
--
--	movl	dep_mutex(%ebx), %edi
--	/* Requeue to a non-robust PI mutex if the PI bit is set and
--	   the robust bit is not set.  */
--	movl	MUTEX_KIND(%edi), %eax
--	andl	$(ROBUST_BIT|PI_BIT), %eax
--	cmpl	$PI_BIT, %eax
--	jne	40f
--
--	movl	$(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
--	/* The following only works like this because we only support
--	   two clocks, represented using a single bit.  */
--	testl	$1, cond_nwaiters(%ebx)
--	/* XXX Need to implement using sete instead of a jump.  */
--	jne	42f
--	orl	$FUTEX_CLOCK_REALTIME, %ecx
--
--42:	movl	20(%esp), %edx
--	addl	$cond_futex, %ebx
--.Ladd_cond_futex_pi:
--	movl	$SYS_futex, %eax
--	ENTER_KERNEL
--	subl	$cond_futex, %ebx
--.Lsub_cond_futex_pi:
--	movl	%eax, %esi
--	/* Set the pi-requeued flag only if the kernel has returned 0. The
--	   kernel does not hold the mutex on ETIMEDOUT or any other error.  */
--	cmpl	$0, %eax
--	sete	16(%esp)
--	je	41f
--
--	/* When a futex syscall with FUTEX_WAIT_REQUEUE_PI returns
--	   successfully, it has already locked the mutex for us and the
--	   pi_flag (16(%esp)) is set to denote that fact.  However, if another
--	   thread changed the futex value before we entered the wait, the
--	   syscall may return an EAGAIN and the mutex is not locked.  We go
--	   ahead with a success anyway since later we look at the pi_flag to
--	   decide if we got the mutex or not.  The sequence numbers then make
--	   sure that only one of the threads actually wake up.  We retry using
--	   normal FUTEX_WAIT only if the kernel returned ENOSYS, since normal
--	   and PI futexes don't mix.
--
--	   Note that we don't check for EAGAIN specifically; we assume that the
--	   only other error the futex function could return is EAGAIN (barring
--	   the ETIMEOUT of course, for the timeout case in futex) since
--	   anything else would mean an error in our function.  It is too
--	   expensive to do that check for every call (which is  quite common in
--	   case of a large number of threads), so it has been skipped.  */
--	cmpl	$-ENOSYS, %eax
--	jne	41f
--	xorl	%ecx, %ecx
--
--40:	subl	$1, %ecx
--	movl	$0, 16(%esp)
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--	addl	$FUTEX_WAIT_BITSET, %ecx
--	/* The following only works like this because we only support
--	   two clocks, represented using a single bit.  */
--	testl	$1, cond_nwaiters(%ebx)
--	jne	30f
--	orl	$FUTEX_CLOCK_REALTIME, %ecx
--30:
--	movl	20(%esp), %edx
--	movl	$0xffffffff, %ebp
--	addl	$cond_futex, %ebx
--.Ladd_cond_futex:
--	movl	$SYS_futex, %eax
--	ENTER_KERNEL
--	subl	$cond_futex, %ebx
--.Lsub_cond_futex:
--	movl	28+FRAME_SIZE(%esp), %ebp
--	movl	%eax, %esi
--
--41:	movl	(%esp), %eax
--	call	__pthread_disable_asynccancel
--.LcleanupEND:
--
--	/* Lock.  */
--	movl	$1, %edx
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %edx, (%ebx)
--#else
--	cmpxchgl %edx, cond_lock(%ebx)
--#endif
--	jnz	5f
--
--6:	movl	broadcast_seq(%ebx), %eax
--	cmpl	12(%esp), %eax
--	jne	23f
--
--	movl	woken_seq(%ebx), %eax
--	movl	woken_seq+4(%ebx), %ecx
--
--	movl	wakeup_seq(%ebx), %edi
--	movl	wakeup_seq+4(%ebx), %edx
--
--	cmpl	8(%esp), %edx
--	jne	7f
--	cmpl	4(%esp), %edi
--	je	15f
--
--7:	cmpl	%ecx, %edx
--	jne	9f
--	cmp	%eax, %edi
--	jne	9f
--
--15:	cmpl	$-ETIMEDOUT, %esi
--	je	28f
--
--	/* We need to go back to futex_wait.  If we're using requeue_pi, then
--	   release the mutex we had acquired and go back.  */
--	movl	16(%esp), %edx
--	test	%edx, %edx
--	jz	8b
--
--	/* Adjust the mutex values first and then unlock it.  The unlock
--	   should always succeed or else the kernel did not lock the mutex
--	   correctly.  */
--	movl	dep_mutex(%ebx), %eax
--	call	__pthread_mutex_cond_lock_adjust
--	movl	dep_mutex(%ebx), %eax
--	xorl	%edx, %edx
--	call	__pthread_mutex_unlock_usercnt
--	jmp	8b
--
--28:	addl	$1, wakeup_seq(%ebx)
--	adcl	$0, wakeup_seq+4(%ebx)
--	addl	$1, cond_futex(%ebx)
--	movl	$ETIMEDOUT, %esi
--	jmp	14f
--
--23:	xorl	%esi, %esi
--	jmp	24f
--
--9:	xorl	%esi, %esi
--14:	addl	$1, woken_seq(%ebx)
--	adcl	$0, woken_seq+4(%ebx)
--
--24:	subl	$(1 << nwaiters_shift), cond_nwaiters(%ebx)
--
--	/* Wake up a thread which wants to destroy the condvar object.  */
--	movl	total_seq(%ebx), %eax
--	andl	total_seq+4(%ebx), %eax
--	cmpl	$0xffffffff, %eax
--	jne	25f
--	movl	cond_nwaiters(%ebx), %eax
--	andl	$~((1 << nwaiters_shift) - 1), %eax
--	jne	25f
--
--	addl	$cond_nwaiters, %ebx
--	movl	$SYS_futex, %eax
--#if FUTEX_PRIVATE_FLAG > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_nwaiters(%ebx)
--	sete	%cl
--	subl	$1, %ecx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--	addl	$FUTEX_WAKE, %ecx
--	movl	$1, %edx
--	ENTER_KERNEL
--	subl	$cond_nwaiters, %ebx
--
--25:	LOCK
--#if cond_lock == 0
--	subl	$1, (%ebx)
--#else
--	subl	$1, cond_lock(%ebx)
--#endif
--	jne	10f
--
--11:	movl	24+FRAME_SIZE(%esp), %eax
--	/* With requeue_pi, the mutex lock is held in the kernel.  */
--	movl	16(%esp), %ecx
--	testl	%ecx, %ecx
--	jnz	27f
--
--	call	__pthread_mutex_cond_lock
--26:	addl	$FRAME_SIZE, %esp
--	cfi_adjust_cfa_offset(-FRAME_SIZE)
--
--	/* We return the result of the mutex_lock operation if it failed.  */
--	testl	%eax, %eax
--#ifdef HAVE_CMOV
--	cmovel	%esi, %eax
--#else
--	jne	22f
--	movl	%esi, %eax
--22:
--#endif
--
--18:	popl	%ebx
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%ebx)
--	popl	%esi
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%esi)
--	popl	%edi
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%edi)
--	popl	%ebp
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%ebp)
--
--	ret
--
--	cfi_restore_state
--
--27:	call	__pthread_mutex_cond_lock_adjust
--	xorl	%eax, %eax
--	jmp	26b
--
--	cfi_adjust_cfa_offset(-FRAME_SIZE);
--	/* Initial locking failed.  */
--1:
--#if cond_lock == 0
--	movl	%ebx, %edx
--#else
--	leal	cond_lock(%ebx), %edx
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_lock_wait
--	jmp	2b
--
--	/* The initial unlocking of the mutex failed.  */
--16:
--	LOCK
--#if cond_lock == 0
--	subl	$1, (%ebx)
--#else
--	subl	$1, cond_lock(%ebx)
--#endif
--	jne	18b
--
--	movl	%eax, %esi
--#if cond_lock == 0
--	movl	%ebx, %eax
--#else
--	leal	cond_lock(%ebx), %eax
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--
--	movl	%esi, %eax
--	jmp	18b
--
--	cfi_adjust_cfa_offset(FRAME_SIZE)
--
--	/* Unlock in loop requires wakeup.  */
--3:
--#if cond_lock == 0
--	movl	%ebx, %eax
--#else
--	leal	cond_lock(%ebx), %eax
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--	jmp	4b
--
--	/* Locking in loop failed.  */
--5:
--#if cond_lock == 0
--	movl	%ebx, %edx
--#else
--	leal	cond_lock(%ebx), %edx
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_lock_wait
--	jmp	6b
--
--	/* Unlock after loop requires wakeup.  */
--10:
--#if cond_lock == 0
--	movl	%ebx, %eax
--#else
--	leal	cond_lock(%ebx), %eax
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--	jmp	11b
--
--#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
--	cfi_adjust_cfa_offset(-FRAME_SIZE)
--.Lreltmo:
--	/* Get internal lock.  */
--	movl	$1, %edx
--	xorl	%eax, %eax
--	LOCK
--# if cond_lock == 0
--	cmpxchgl %edx, (%ebx)
--# else
--	cmpxchgl %edx, cond_lock(%ebx)
--# endif
--	jnz	101f
--
--	/* Store the reference to the mutex.  If there is already a
--	   different value in there this is a bad user bug.  */
--102:	cmpl	$-1, dep_mutex(%ebx)
--	movl	24(%esp), %eax
--	je	117f
--	movl	%eax, dep_mutex(%ebx)
--
--	/* Unlock the mutex.  */
--117:	xorl	%edx, %edx
--	call	__pthread_mutex_unlock_usercnt
--
--	testl	%eax, %eax
--	jne	16b
--
--	addl	$1, total_seq(%ebx)
--	adcl	$0, total_seq+4(%ebx)
--	addl	$1, cond_futex(%ebx)
--	addl	$(1 << nwaiters_shift), cond_nwaiters(%ebx)
--
--	subl	$FRAME_SIZE, %esp
--	cfi_adjust_cfa_offset(FRAME_SIZE)
--
--	/* Get and store current wakeup_seq value.  */
--	movl	wakeup_seq(%ebx), %edi
--	movl	wakeup_seq+4(%ebx), %edx
--	movl	broadcast_seq(%ebx), %eax
--	movl	%edi, 4(%esp)
--	movl	%edx, 8(%esp)
--	movl	%eax, 12(%esp)
--
--	/* Reset the pi-requeued flag.  */
--	movl	$0, 16(%esp)
--
--	/* Get the current time.  */
--108:	movl	%ebx, %edx
--# ifdef __NR_clock_gettime
--	/* Get the clock number.  */
--	movl	cond_nwaiters(%ebx), %ebx
--	andl	$((1 << nwaiters_shift) - 1), %ebx
--	/* Only clocks 0 and 1 are allowed so far.  Both are handled in the
--	   kernel.  */
--	leal	24(%esp), %ecx
--	movl	$__NR_clock_gettime, %eax
--	ENTER_KERNEL
--	movl	%edx, %ebx
--
--	/* Compute relative timeout.  */
--	movl	(%ebp), %ecx
--	movl	4(%ebp), %edx
--	subl	24(%esp), %ecx
--	subl	28(%esp), %edx
--# else
--	/* Get the current time.  */
--	leal	24(%esp), %ebx
--	xorl	%ecx, %ecx
--	movl	$__NR_gettimeofday, %eax
--	ENTER_KERNEL
--	movl	%edx, %ebx
--
--	/* Compute relative timeout.  */
--	movl	28(%esp), %eax
--	movl	$1000, %edx
--	mul	%edx		/* Milli seconds to nano seconds.  */
--	movl	(%ebp), %ecx
--	movl	4(%ebp), %edx
--	subl	24(%esp), %ecx
--	subl	%eax, %edx
--# endif
--	jns	112f
--	addl	$1000000000, %edx
--	subl	$1, %ecx
--112:	testl	%ecx, %ecx
--	movl	$-ETIMEDOUT, %esi
--	js	106f
--
--	/* Store relative timeout.  */
--121:	movl	%ecx, 24(%esp)
--	movl	%edx, 28(%esp)
--
--	movl	cond_futex(%ebx), %edi
--	movl	%edi, 20(%esp)
--
--	/* Unlock.  */
--	LOCK
--# if cond_lock == 0
--	subl	$1, (%ebx)
--# else
--	subl	$1, cond_lock(%ebx)
--# endif
--	jne	103f
--
--.LcleanupSTART2:
--104:	call	__pthread_enable_asynccancel
--	movl	%eax, (%esp)
--
--	leal	24(%esp), %esi
--# if FUTEX_PRIVATE_FLAG > 255
--	xorl	%ecx, %ecx
--# endif
--	cmpl	$-1, dep_mutex(%ebx)
--	sete	%cl
--	subl	$1, %ecx
--# ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--# else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--# endif
--# if FUTEX_WAIT != 0
--	addl	$FUTEX_WAIT, %ecx
--# endif
--	movl	20(%esp), %edx
--	addl	$cond_futex, %ebx
--.Ladd_cond_futex2:
--	movl	$SYS_futex, %eax
--	ENTER_KERNEL
--	subl	$cond_futex, %ebx
--.Lsub_cond_futex2:
--	movl	%eax, %esi
--
--141:	movl	(%esp), %eax
--	call	__pthread_disable_asynccancel
--.LcleanupEND2:
--
--
--	/* Lock.  */
--	movl	$1, %edx
--	xorl	%eax, %eax
--	LOCK
--# if cond_lock == 0
--	cmpxchgl %edx, (%ebx)
--# else
--	cmpxchgl %edx, cond_lock(%ebx)
--# endif
--	jnz	105f
--
--106:	movl	broadcast_seq(%ebx), %eax
--	cmpl	12(%esp), %eax
--	jne	23b
--
--	movl	woken_seq(%ebx), %eax
--	movl	woken_seq+4(%ebx), %ecx
--
--	movl	wakeup_seq(%ebx), %edi
--	movl	wakeup_seq+4(%ebx), %edx
--
--	cmpl	8(%esp), %edx
--	jne	107f
--	cmpl	4(%esp), %edi
--	je	115f
--
--107:	cmpl	%ecx, %edx
--	jne	9b
--	cmp	%eax, %edi
--	jne	9b
--
--115:	cmpl	$-ETIMEDOUT, %esi
--	je	28b
--
--	jmp	8b
--
--	cfi_adjust_cfa_offset(-FRAME_SIZE)
--	/* Initial locking failed.  */
--101:
--# if cond_lock == 0
--	movl	%ebx, %edx
--# else
--	leal	cond_lock(%ebx), %edx
--# endif
--# if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--# endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--# if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--# endif
--	call	__lll_lock_wait
--	jmp	102b
--
--	cfi_adjust_cfa_offset(FRAME_SIZE)
--
--	/* Unlock in loop requires wakeup.  */
--103:
--# if cond_lock == 0
--	movl	%ebx, %eax
--# else
--	leal	cond_lock(%ebx), %eax
--# endif
--# if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--# endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--# if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--# endif
--	call	__lll_unlock_wake
--	jmp	104b
--
--	/* Locking in loop failed.  */
--105:
--# if cond_lock == 0
--	movl	%ebx, %edx
--# else
--	leal	cond_lock(%ebx), %edx
--# endif
--# if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--# endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--# if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--# endif
--	call	__lll_lock_wait
--	jmp	106b
--#endif
--
--	.size	__pthread_cond_timedwait, .-__pthread_cond_timedwait
--versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
--		  GLIBC_2_3_2)
--
--
--	.type	__condvar_tw_cleanup2, @function
--__condvar_tw_cleanup2:
--	subl	$cond_futex, %ebx
--	.size	__condvar_tw_cleanup2, .-__condvar_tw_cleanup2
--	.type	__condvar_tw_cleanup, @function
--__condvar_tw_cleanup:
--	movl	%eax, %esi
--
--	/* Get internal lock.  */
--	movl	$1, %edx
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %edx, (%ebx)
--#else
--	cmpxchgl %edx, cond_lock(%ebx)
--#endif
--	jz	1f
--
--#if cond_lock == 0
--	movl	%ebx, %edx
--#else
--	leal	cond_lock(%ebx), %edx
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_lock_wait
--
--1:	movl	broadcast_seq(%ebx), %eax
--	cmpl	12(%esp), %eax
--	jne	3f
--
--	/* We increment the wakeup_seq counter only if it is lower than
--	   total_seq.  If this is not the case the thread was woken and
--	   then canceled.  In this case we ignore the signal.  */
--	movl	total_seq(%ebx), %eax
--	movl	total_seq+4(%ebx), %edi
--	cmpl	wakeup_seq+4(%ebx), %edi
--	jb	6f
--	ja	7f
--	cmpl	wakeup_seq(%ebx), %eax
--	jbe	7f
--
--6:	addl	$1, wakeup_seq(%ebx)
--	adcl	$0, wakeup_seq+4(%ebx)
--	addl	$1, cond_futex(%ebx)
--
--7:	addl	$1, woken_seq(%ebx)
--	adcl	$0, woken_seq+4(%ebx)
--
--3:	subl	$(1 << nwaiters_shift), cond_nwaiters(%ebx)
--
--	/* Wake up a thread which wants to destroy the condvar object.  */
--	xorl	%edi, %edi
--	movl	total_seq(%ebx), %eax
--	andl	total_seq+4(%ebx), %eax
--	cmpl	$0xffffffff, %eax
--	jne	4f
--	movl	cond_nwaiters(%ebx), %eax
--	andl	$~((1 << nwaiters_shift) - 1), %eax
--	jne	4f
--
--	addl	$cond_nwaiters, %ebx
--	movl	$SYS_futex, %eax
--#if FUTEX_PRIVATE_FLAG > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_nwaiters(%ebx)
--	sete	%cl
--	subl	$1, %ecx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--	addl	$FUTEX_WAKE, %ecx
--	movl	$1, %edx
--	ENTER_KERNEL
--	subl	$cond_nwaiters, %ebx
--	movl	$1, %edi
--
--4:	LOCK
--#if cond_lock == 0
--	subl	$1, (%ebx)
--#else
--	subl	$1, cond_lock(%ebx)
--#endif
--	je	2f
--
--#if cond_lock == 0
--	movl	%ebx, %eax
--#else
--	leal	cond_lock(%ebx), %eax
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--
--	/* Wake up all waiters to make sure no signal gets lost.  */
--2:	testl	%edi, %edi
--	jnz	5f
--	addl	$cond_futex, %ebx
--#if FUTEX_PRIVATE_FLAG > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_futex(%ebx)
--	sete	%cl
--	subl	$1, %ecx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--	addl	$FUTEX_WAKE, %ecx
--	movl	$SYS_futex, %eax
--	movl	$0x7fffffff, %edx
--	ENTER_KERNEL
--
--	/* Lock the mutex only if we don't own it already.  This only happens
--	   in case of PI mutexes, if we got cancelled after a successful
--	   return of the futex syscall and before disabling async
--	   cancellation.  */
--5:	movl	24+FRAME_SIZE(%esp), %eax
--	movl	MUTEX_KIND(%eax), %ebx
--	andl	$(ROBUST_BIT|PI_BIT), %ebx
--	cmpl	$PI_BIT, %ebx
--	jne	8f
--
--	movl	(%eax), %ebx
--	andl	$TID_MASK, %ebx
--	cmpl	%ebx, %gs:TID
--	jne	8f
--	/* We managed to get the lock.  Fix it up before returning.  */
--	call	__pthread_mutex_cond_lock_adjust
--	jmp	9f
--
--8:	call	__pthread_mutex_cond_lock
--
--9:	movl	%esi, (%esp)
--.LcallUR:
--	call	_Unwind_Resume
--	hlt
--.LENDCODE:
--	cfi_endproc
--	.size	__condvar_tw_cleanup, .-__condvar_tw_cleanup
--
--
--	.section .gcc_except_table,"a",@progbits
--.LexceptSTART:
--	.byte	DW_EH_PE_omit			# @LPStart format (omit)
--	.byte	DW_EH_PE_omit			# @TType format (omit)
--	.byte	DW_EH_PE_sdata4			# call-site format
--						# DW_EH_PE_sdata4
--	.uleb128 .Lcstend-.Lcstbegin
--.Lcstbegin:
--	.long	.LcleanupSTART-.LSTARTCODE
--	.long	.Ladd_cond_futex_pi-.LcleanupSTART
--	.long	__condvar_tw_cleanup-.LSTARTCODE
--	.uleb128  0
--	.long	.Ladd_cond_futex_pi-.LSTARTCODE
--	.long	.Lsub_cond_futex_pi-.Ladd_cond_futex_pi
--	.long	__condvar_tw_cleanup2-.LSTARTCODE
--	.uleb128  0
--	.long	.Lsub_cond_futex_pi-.LSTARTCODE
--	.long	.Ladd_cond_futex-.Lsub_cond_futex_pi
--	.long	__condvar_tw_cleanup-.LSTARTCODE
--	.uleb128  0
--	.long	.Ladd_cond_futex-.LSTARTCODE
--	.long	.Lsub_cond_futex-.Ladd_cond_futex
--	.long	__condvar_tw_cleanup2-.LSTARTCODE
--	.uleb128  0
--	.long	.Lsub_cond_futex-.LSTARTCODE
--	.long	.LcleanupEND-.Lsub_cond_futex
--	.long	__condvar_tw_cleanup-.LSTARTCODE
--	.uleb128  0
--#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
--	.long	.LcleanupSTART2-.LSTARTCODE
--	.long	.Ladd_cond_futex2-.LcleanupSTART2
--	.long	__condvar_tw_cleanup-.LSTARTCODE
--	.uleb128  0
--	.long	.Ladd_cond_futex2-.LSTARTCODE
--	.long	.Lsub_cond_futex2-.Ladd_cond_futex2
--	.long	__condvar_tw_cleanup2-.LSTARTCODE
--	.uleb128  0
--	.long	.Lsub_cond_futex2-.LSTARTCODE
--	.long	.LcleanupEND2-.Lsub_cond_futex2
--	.long	__condvar_tw_cleanup-.LSTARTCODE
--	.uleb128  0
--#endif
--	.long	.LcallUR-.LSTARTCODE
--	.long	.LENDCODE-.LcallUR
--	.long	0
--	.uleb128  0
--.Lcstend:
--
--
--#ifdef SHARED
--	.hidden DW.ref.__gcc_personality_v0
--	.weak	DW.ref.__gcc_personality_v0
--	.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
--	.align	4
--	.type	DW.ref.__gcc_personality_v0, @object
--	.size	DW.ref.__gcc_personality_v0, 4
--DW.ref.__gcc_personality_v0:
--	.long   __gcc_personality_v0
--#endif
-diff --git a/sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S b/sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
-deleted file mode 100644
-index 5016718..0000000
---- a/sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
-+++ /dev/null
-@@ -1,642 +0,0 @@
--/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library; if not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#include <sysdep.h>
--#include <shlib-compat.h>
--#include <lowlevellock.h>
--#include <lowlevelcond.h>
--#include <tcb-offsets.h>
--#include <pthread-errnos.h>
--#include <pthread-pi-defines.h>
--#include <kernel-features.h>
--#include <stap-probe.h>
--
--
--	.text
--
--/* int pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)  */
--	.globl	__pthread_cond_wait
--	.type	__pthread_cond_wait, @function
--	.align	16
--__pthread_cond_wait:
--.LSTARTCODE:
--	cfi_startproc
--#ifdef SHARED
--	cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
--			DW.ref.__gcc_personality_v0)
--	cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
--#else
--	cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
--	cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
--#endif
--
--	pushl	%ebp
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%ebp, 0)
--	pushl	%edi
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%edi, 0)
--	pushl	%esi
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%esi, 0)
--	pushl	%ebx
--	cfi_adjust_cfa_offset(4)
--	cfi_rel_offset(%ebx, 0)
--
--	xorl	%esi, %esi
--	movl	20(%esp), %ebx
--
--	LIBC_PROBE (cond_wait, 2, 24(%esp), %ebx)
--
--	/* Get internal lock.  */
--	movl	$1, %edx
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %edx, (%ebx)
--#else
--	cmpxchgl %edx, cond_lock(%ebx)
--#endif
--	jnz	1f
--
--	/* Store the reference to the mutex.  If there is already a
--	   different value in there this is a bad user bug.  */
--2:	cmpl	$-1, dep_mutex(%ebx)
--	movl	24(%esp), %eax
--	je	15f
--	movl	%eax, dep_mutex(%ebx)
--
--	/* Unlock the mutex.  */
--15:	xorl	%edx, %edx
--	call	__pthread_mutex_unlock_usercnt
--
--	testl	%eax, %eax
--	jne	12f
--
--	addl	$1, total_seq(%ebx)
--	adcl	$0, total_seq+4(%ebx)
--	addl	$1, cond_futex(%ebx)
--	addl	$(1 << nwaiters_shift), cond_nwaiters(%ebx)
--
--#define FRAME_SIZE 20
--	subl	$FRAME_SIZE, %esp
--	cfi_adjust_cfa_offset(FRAME_SIZE)
--	cfi_remember_state
--
--	/* Get and store current wakeup_seq value.  */
--	movl	wakeup_seq(%ebx), %edi
--	movl	wakeup_seq+4(%ebx), %edx
--	movl	broadcast_seq(%ebx), %eax
--	movl	%edi, 4(%esp)
--	movl	%edx, 8(%esp)
--	movl	%eax, 12(%esp)
--
--	/* Reset the pi-requeued flag.  */
--8:	movl	$0, 16(%esp)
--	movl	cond_futex(%ebx), %ebp
--
--	/* Unlock.  */
--	LOCK
--#if cond_lock == 0
--	subl	$1, (%ebx)
--#else
--	subl	$1, cond_lock(%ebx)
--#endif
--	jne	3f
--
--.LcleanupSTART:
--4:	call	__pthread_enable_asynccancel
--	movl	%eax, (%esp)
--
--	xorl	%ecx, %ecx
--	cmpl	$-1, dep_mutex(%ebx)
--	sete	%cl
--	je	18f
--
--	movl	dep_mutex(%ebx), %edi
--	/* Requeue to a non-robust PI mutex if the PI bit is set and
--	   the robust bit is not set.  */
--	movl	MUTEX_KIND(%edi), %eax
--	andl	$(ROBUST_BIT|PI_BIT), %eax
--	cmpl	$PI_BIT, %eax
--	jne	18f
--
--	movl	$(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
--	movl	%ebp, %edx
--	xorl	%esi, %esi
--	addl	$cond_futex, %ebx
--.Ladd_cond_futex_pi:
--	movl	$SYS_futex, %eax
--	ENTER_KERNEL
--	subl	$cond_futex, %ebx
--.Lsub_cond_futex_pi:
--	/* Set the pi-requeued flag only if the kernel has returned 0. The
--	   kernel does not hold the mutex on error.  */
--	cmpl	$0, %eax
--	sete	16(%esp)
--	je	19f
--
--	/* When a futex syscall with FUTEX_WAIT_REQUEUE_PI returns
--	   successfully, it has already locked the mutex for us and the
--	   pi_flag (16(%esp)) is set to denote that fact.  However, if another
--	   thread changed the futex value before we entered the wait, the
--	   syscall may return an EAGAIN and the mutex is not locked.  We go
--	   ahead with a success anyway since later we look at the pi_flag to
--	   decide if we got the mutex or not.  The sequence numbers then make
--	   sure that only one of the threads actually wake up.  We retry using
--	   normal FUTEX_WAIT only if the kernel returned ENOSYS, since normal
--	   and PI futexes don't mix.
--
--	   Note that we don't check for EAGAIN specifically; we assume that the
--	   only other error the futex function could return is EAGAIN since
--	   anything else would mean an error in our function.  It is too
--	   expensive to do that check for every call (which is 	quite common in
--	   case of a large number of threads), so it has been skipped.  */
--	cmpl	$-ENOSYS, %eax
--	jne	19f
--	xorl	%ecx, %ecx
--
--18:	subl	$1, %ecx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--#if FUTEX_WAIT != 0
--	addl	$FUTEX_WAIT, %ecx
--#endif
--	movl	%ebp, %edx
--	addl	$cond_futex, %ebx
--.Ladd_cond_futex:
--	movl	$SYS_futex, %eax
--	ENTER_KERNEL
--	subl	$cond_futex, %ebx
--.Lsub_cond_futex:
--
--19:	movl	(%esp), %eax
--	call	__pthread_disable_asynccancel
--.LcleanupEND:
--
--	/* Lock.  */
--	movl	$1, %edx
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %edx, (%ebx)
--#else
--	cmpxchgl %edx, cond_lock(%ebx)
--#endif
--	jnz	5f
--
--6:	movl	broadcast_seq(%ebx), %eax
--	cmpl	12(%esp), %eax
--	jne	16f
--
--	movl	woken_seq(%ebx), %eax
--	movl	woken_seq+4(%ebx), %ecx
--
--	movl	wakeup_seq(%ebx), %edi
--	movl	wakeup_seq+4(%ebx), %edx
--
--	cmpl	8(%esp), %edx
--	jne	7f
--	cmpl	4(%esp), %edi
--	je	22f
--
--7:	cmpl	%ecx, %edx
--	jne	9f
--	cmp	%eax, %edi
--	je	22f
--
--9:	addl	$1, woken_seq(%ebx)
--	adcl	$0, woken_seq+4(%ebx)
--
--	/* Unlock */
--16:	subl	$(1 << nwaiters_shift), cond_nwaiters(%ebx)
--
--	/* Wake up a thread which wants to destroy the condvar object.  */
--	movl	total_seq(%ebx), %eax
--	andl	total_seq+4(%ebx), %eax
--	cmpl	$0xffffffff, %eax
--	jne	17f
--	movl	cond_nwaiters(%ebx), %eax
--	andl	$~((1 << nwaiters_shift) - 1), %eax
--	jne	17f
--
--	addl	$cond_nwaiters, %ebx
--	movl	$SYS_futex, %eax
--#if FUTEX_PRIVATE_FLAG > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_nwaiters(%ebx)
--	sete	%cl
--	subl	$1, %ecx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--	addl	$FUTEX_WAKE, %ecx
--	movl	$1, %edx
--	ENTER_KERNEL
--	subl	$cond_nwaiters, %ebx
--
--17:	LOCK
--#if cond_lock == 0
--	subl	$1, (%ebx)
--#else
--	subl	$1, cond_lock(%ebx)
--#endif
--	jne	10f
--
--	/* With requeue_pi, the mutex lock is held in the kernel.  */
--11:	movl	24+FRAME_SIZE(%esp), %eax
--	movl	16(%esp), %ecx
--	testl	%ecx, %ecx
--	jnz	21f
--
--	call	__pthread_mutex_cond_lock
--20:	addl	$FRAME_SIZE, %esp
--	cfi_adjust_cfa_offset(-FRAME_SIZE);
--
--14:	popl	%ebx
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%ebx)
--	popl	%esi
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%esi)
--	popl	%edi
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%edi)
--	popl	%ebp
--	cfi_adjust_cfa_offset(-4)
--	cfi_restore(%ebp)
--
--	/* We return the result of the mutex_lock operation.  */
--	ret
--
--	cfi_restore_state
--
--21:	call	__pthread_mutex_cond_lock_adjust
--	xorl	%eax, %eax
--	jmp	20b
--
--	cfi_adjust_cfa_offset(-FRAME_SIZE);
--
--	/* We need to go back to futex_wait.  If we're using requeue_pi, then
--	   release the mutex we had acquired and go back.  */
--22:	movl	16(%esp), %edx
--	test	%edx, %edx
--	jz	8b
--
--	/* Adjust the mutex values first and then unlock it.  The unlock
--	   should always succeed or else the kernel did not lock the mutex
--	   correctly.  */
--	movl	dep_mutex(%ebx), %eax
--	call    __pthread_mutex_cond_lock_adjust
--	movl	dep_mutex(%ebx), %eax
--	xorl	%edx, %edx
--	call	__pthread_mutex_unlock_usercnt
--	jmp	8b
--
--	/* Initial locking failed.  */
--1:
--#if cond_lock == 0
--	movl	%ebx, %edx
--#else
--	leal	cond_lock(%ebx), %edx
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_lock_wait
--	jmp	2b
--
--	/* The initial unlocking of the mutex failed.  */
--12:
--	LOCK
--#if cond_lock == 0
--	subl	$1, (%ebx)
--#else
--	subl	$1, cond_lock(%ebx)
--#endif
--	jne	14b
--
--	movl	%eax, %esi
--#if cond_lock == 0
--	movl	%ebx, %eax
--#else
--	leal	cond_lock(%ebx), %eax
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--
--	movl	%esi, %eax
--	jmp	14b
--
--	cfi_adjust_cfa_offset(FRAME_SIZE)
--
--	/* Unlock in loop requires wakeup.  */
--3:
--#if cond_lock == 0
--	movl	%ebx, %eax
--#else
--	leal	cond_lock(%ebx), %eax
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--	jmp	4b
--
--	/* Locking in loop failed.  */
--5:
--#if cond_lock == 0
--	movl	%ebx, %edx
--#else
--	leal	cond_lock(%ebx), %edx
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_lock_wait
--	jmp	6b
--
--	/* Unlock after loop requires wakeup.  */
--10:
--#if cond_lock == 0
--	movl	%ebx, %eax
--#else
--	leal	cond_lock(%ebx), %eax
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--	jmp	11b
--
--	.size	__pthread_cond_wait, .-__pthread_cond_wait
--versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
--		  GLIBC_2_3_2)
--
--
--	.type	__condvar_w_cleanup2, @function
--__condvar_w_cleanup2:
--	subl	$cond_futex, %ebx
--	.size	__condvar_w_cleanup2, .-__condvar_w_cleanup2
--.LSbl4:
--	.type	__condvar_w_cleanup, @function
--__condvar_w_cleanup:
--	movl	%eax, %esi
--
--	/* Get internal lock.  */
--	movl	$1, %edx
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %edx, (%ebx)
--#else
--	cmpxchgl %edx, cond_lock(%ebx)
--#endif
--	jz	1f
--
--#if cond_lock == 0
--	movl	%ebx, %edx
--#else
--	leal	cond_lock(%ebx), %edx
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_lock_wait
--
--1:	movl	broadcast_seq(%ebx), %eax
--	cmpl	12(%esp), %eax
--	jne	3f
--
--	/* We increment the wakeup_seq counter only if it is lower than
--	   total_seq.  If this is not the case the thread was woken and
--	   then canceled.  In this case we ignore the signal.  */
--	movl	total_seq(%ebx), %eax
--	movl	total_seq+4(%ebx), %edi
--	cmpl	wakeup_seq+4(%ebx), %edi
--	jb	6f
--	ja	7f
--	cmpl	wakeup_seq(%ebx), %eax
--	jbe	7f
--
--6:	addl	$1, wakeup_seq(%ebx)
--	adcl	$0, wakeup_seq+4(%ebx)
--	addl	$1, cond_futex(%ebx)
--
--7:	addl	$1, woken_seq(%ebx)
--	adcl	$0, woken_seq+4(%ebx)
--
--3:	subl	$(1 << nwaiters_shift), cond_nwaiters(%ebx)
--
--	/* Wake up a thread which wants to destroy the condvar object.  */
--	xorl	%edi, %edi
--	movl	total_seq(%ebx), %eax
--	andl	total_seq+4(%ebx), %eax
--	cmpl	$0xffffffff, %eax
--	jne	4f
--	movl	cond_nwaiters(%ebx), %eax
--	andl	$~((1 << nwaiters_shift) - 1), %eax
--	jne	4f
--
--	addl	$cond_nwaiters, %ebx
--	movl	$SYS_futex, %eax
--#if FUTEX_PRIVATE_FLAG > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_nwaiters(%ebx)
--	sete	%cl
--	subl	$1, %ecx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--	addl	$FUTEX_WAKE, %ecx
--	movl	$1, %edx
--	ENTER_KERNEL
--	subl	$cond_nwaiters, %ebx
--	movl	$1, %edi
--
--4:	LOCK
--#if cond_lock == 0
--	subl	$1, (%ebx)
--#else
--	subl	$1, cond_lock(%ebx)
--#endif
--	je	2f
--
--#if cond_lock == 0
--	movl	%ebx, %eax
--#else
--	leal	cond_lock(%ebx), %eax
--#endif
--#if (LLL_SHARED-LLL_PRIVATE) > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex(%ebx)
--	setne	%cl
--	subl	$1, %ecx
--	andl	$(LLL_SHARED-LLL_PRIVATE), %ecx
--#if LLL_PRIVATE != 0
--	addl	$LLL_PRIVATE, %ecx
--#endif
--	call	__lll_unlock_wake
--
--	/* Wake up all waiters to make sure no signal gets lost.  */
--2:	testl	%edi, %edi
--	jnz	5f
--	addl	$cond_futex, %ebx
--#if FUTEX_PRIVATE_FLAG > 255
--	xorl	%ecx, %ecx
--#endif
--	cmpl	$-1, dep_mutex-cond_futex(%ebx)
--	sete	%cl
--	subl	$1, %ecx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %ecx
--#else
--	andl	%gs:PRIVATE_FUTEX, %ecx
--#endif
--	addl	$FUTEX_WAKE, %ecx
--	movl	$SYS_futex, %eax
--	movl	$0x7fffffff, %edx
--	ENTER_KERNEL
--
--	/* Lock the mutex only if we don't own it already.  This only happens
--	   in case of PI mutexes, if we got cancelled after a successful
--	   return of the futex syscall and before disabling async
--	   cancellation.  */
--5:	movl	24+FRAME_SIZE(%esp), %eax
--	movl	MUTEX_KIND(%eax), %ebx
--	andl	$(ROBUST_BIT|PI_BIT), %ebx
--	cmpl	$PI_BIT, %ebx
--	jne	8f
--
--	movl	(%eax), %ebx
--	andl	$TID_MASK, %ebx
--	cmpl	%ebx, %gs:TID
--	jne	8f
--	/* We managed to get the lock.  Fix it up before returning.  */
--	call	__pthread_mutex_cond_lock_adjust
--	jmp	9f
--
--8:	call	__pthread_mutex_cond_lock
--
--9:	movl	%esi, (%esp)
--.LcallUR:
--	call	_Unwind_Resume
--	hlt
--.LENDCODE:
--	cfi_endproc
--	.size	__condvar_w_cleanup, .-__condvar_w_cleanup
--
--
--	.section .gcc_except_table,"a",@progbits
--.LexceptSTART:
--	.byte	DW_EH_PE_omit			# @LPStart format (omit)
--	.byte	DW_EH_PE_omit			# @TType format (omit)
--	.byte	DW_EH_PE_sdata4			# call-site format
--						# DW_EH_PE_sdata4
--	.uleb128 .Lcstend-.Lcstbegin
--.Lcstbegin:
--	.long	.LcleanupSTART-.LSTARTCODE
--	.long	.Ladd_cond_futex_pi-.LcleanupSTART
--	.long	__condvar_w_cleanup-.LSTARTCODE
--	.uleb128  0
--	.long	.Ladd_cond_futex_pi-.LSTARTCODE
--	.long	.Lsub_cond_futex_pi-.Ladd_cond_futex_pi
--	.long	__condvar_w_cleanup2-.LSTARTCODE
--	.uleb128  0
--	.long	.Lsub_cond_futex_pi-.LSTARTCODE
--	.long	.Ladd_cond_futex-.Lsub_cond_futex_pi
--	.long	__condvar_w_cleanup-.LSTARTCODE
--	.uleb128  0
--	.long	.Ladd_cond_futex-.LSTARTCODE
--	.long	.Lsub_cond_futex-.Ladd_cond_futex
--	.long	__condvar_w_cleanup2-.LSTARTCODE
--	.uleb128  0
--	.long	.Lsub_cond_futex-.LSTARTCODE
--	.long	.LcleanupEND-.Lsub_cond_futex
--	.long	__condvar_w_cleanup-.LSTARTCODE
--	.uleb128  0
--	.long	.LcallUR-.LSTARTCODE
--	.long	.LENDCODE-.LcallUR
--	.long	0
--	.uleb128  0
--.Lcstend:
--
--#ifdef SHARED
--	.hidden DW.ref.__gcc_personality_v0
--	.weak   DW.ref.__gcc_personality_v0
--	.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
--	.align 4
--	.type   DW.ref.__gcc_personality_v0, @object
--	.size   DW.ref.__gcc_personality_v0, 4
--DW.ref.__gcc_personality_v0:
--	.long   __gcc_personality_v0
--#endif
-diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
-index 345e79a..371bc3c 100644
---- a/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
-+++ b/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
-@@ -123,19 +123,32 @@ typedef union
- 
- 
- /* Data structure for conditional variable handling.  The structure of
--   the attribute type is deliberately not exposed.  */
-+   the attribute type is not exposed on purpose.  */
- typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
-diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
-deleted file mode 100644
-index de455dd..0000000
---- a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
-+++ /dev/null
-@@ -1,177 +0,0 @@
--/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library; if not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#include <sysdep.h>
--#include <shlib-compat.h>
--#include <lowlevellock.h>
--#include <lowlevelcond.h>
--#include <kernel-features.h>
--#include <pthread-pi-defines.h>
--#include <pthread-errnos.h>
--#include <stap-probe.h>
--
--	.text
--
--	/* int pthread_cond_broadcast (pthread_cond_t *cond) */
--ENTRY(__pthread_cond_broadcast)
--
--	LIBC_PROBE (cond_broadcast, 1, %rdi)
--
--	/* Get internal lock.  */
--	movl	$1, %esi
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %esi, (%rdi)
--#else
--	cmpxchgl %esi, cond_lock(%rdi)
--#endif
--	jnz	1f
--
--2:	addq	$cond_futex, %rdi
--	movq	total_seq-cond_futex(%rdi), %r9
--	cmpq	wakeup_seq-cond_futex(%rdi), %r9
--	jna	4f
--
--	/* Cause all currently waiting threads to recognize they are
--	   woken up.  */
--	movq	%r9, wakeup_seq-cond_futex(%rdi)
--	movq	%r9, woken_seq-cond_futex(%rdi)
--	addq	%r9, %r9
--	movl	%r9d, (%rdi)
--	incl	broadcast_seq-cond_futex(%rdi)
--
--	/* Get the address of the mutex used.  */
--	mov	dep_mutex-cond_futex(%rdi), %R8_LP
--
--	/* Unlock.  */
--	LOCK
--	decl	cond_lock-cond_futex(%rdi)
--	jne	7f
--
--8:	cmp	$-1, %R8_LP
--	je	9f
--
--	/* Do not use requeue for pshared condvars.  */
--	testl	$PS_BIT, MUTEX_KIND(%r8)
--	jne	9f
--
--	/* Requeue to a PI mutex if the PI bit is set.  */
--	movl	MUTEX_KIND(%r8), %eax
--	andl	$(ROBUST_BIT|PI_BIT), %eax
--	cmpl	$PI_BIT, %eax
--	je	81f
--
--	/* Wake up all threads.  */
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$(FUTEX_CMP_REQUEUE|FUTEX_PRIVATE_FLAG), %esi
--#else
--	movl	%fs:PRIVATE_FUTEX, %esi
--	orl	$FUTEX_CMP_REQUEUE, %esi
--#endif
--	movl	$SYS_futex, %eax
--	movl	$1, %edx
--	movl	$0x7fffffff, %r10d
--	syscall
--
--	/* For any kind of error, which mainly is EAGAIN, we try again
--	   with WAKE.  The general test also covers running on old
--	   kernels.  */
--	cmpq	$-4095, %rax
--	jae	9f
--
--10:	xorl	%eax, %eax
--	retq
--
--	/* Wake up all threads.  */
--81:	movl	$(FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
--	movl	$SYS_futex, %eax
--	movl	$1, %edx
--	movl	$0x7fffffff, %r10d
--	syscall
--
--	/* For any kind of error, which mainly is EAGAIN, we try again
--	   with WAKE.  The general test also covers running on old
--	   kernels.  */
--	cmpq	$-4095, %rax
--	jb	10b
--	jmp	9f
--
--	.align	16
--	/* Unlock.  */
--4:	LOCK
--	decl	cond_lock-cond_futex(%rdi)
--	jne	5f
--
--6:	xorl	%eax, %eax
--	retq
--
--	/* Initial locking failed.  */
--1:
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_lock_wait
--#if cond_lock != 0
--	subq	$cond_lock, %rdi
--#endif
--	jmp	2b
--
--	/* Unlock in loop requires wakeup.  */
--5:	addq	$cond_lock-cond_futex, %rdi
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_unlock_wake
--	jmp	6b
--
--	/* Unlock in loop requires wakeup.  */
--7:	addq	$cond_lock-cond_futex, %rdi
--	cmp	$-1, %R8_LP
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_unlock_wake
--	subq	$cond_lock-cond_futex, %rdi
--	jmp	8b
--
--9:	/* The futex requeue functionality is not available.  */
--	cmp	$-1, %R8_LP
--	movl	$0x7fffffff, %edx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$FUTEX_WAKE, %eax
--	movl	$(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
--	cmove	%eax, %esi
--#else
--	movl	$0, %eax
--	movl	%fs:PRIVATE_FUTEX, %esi
--	cmove	%eax, %esi
--	orl	$FUTEX_WAKE, %esi
--#endif
--	movl	$SYS_futex, %eax
--	syscall
--	jmp	10b
--END(__pthread_cond_broadcast)
--
--versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
--		  GLIBC_2_3_2)
-diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
-deleted file mode 100644
-index da14bc3..0000000
---- a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
-+++ /dev/null
-@@ -1,161 +0,0 @@
--/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library; if not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#include <sysdep.h>
--#include <shlib-compat.h>
--#include <lowlevellock.h>
--#include <lowlevelcond.h>
--#include <pthread-pi-defines.h>
--#include <kernel-features.h>
--#include <pthread-errnos.h>
--#include <stap-probe.h>
--
--
--	.text
--
--ENTRY(__pthread_cond_signal)
--
--	LIBC_PROBE (cond_signal, 1, %rdi)
--
--	/* Get internal lock.  */
--	movq	%rdi, %r8
--	movl	$1, %esi
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %esi, (%rdi)
--#else
--	cmpxchgl %esi, cond_lock(%rdi)
--#endif
--	jnz	1f
--
--2:	addq	$cond_futex, %rdi
--	movq	total_seq(%r8), %rcx
--	cmpq	wakeup_seq(%r8), %rcx
--	jbe	4f
--
--	/* Bump the wakeup number.  */
--	addq	$1, wakeup_seq(%r8)
--	addl	$1, (%rdi)
--
--	/* Wake up one thread.  */
--	LP_OP(cmp) $-1, dep_mutex(%r8)
--	movl	$FUTEX_WAKE_OP, %esi
--	movl	$1, %edx
--	movl	$SYS_futex, %eax
--	je	8f
--
--	/* Get the address of the mutex used.  */
--	mov     dep_mutex(%r8), %RCX_LP
--	movl	MUTEX_KIND(%rcx), %r11d
--	andl	$(ROBUST_BIT|PI_BIT), %r11d
--	cmpl	$PI_BIT, %r11d
--	je	9f
--
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$(FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG), %esi
--#else
--	orl	%fs:PRIVATE_FUTEX, %esi
--#endif
--
--8:	movl	$1, %r10d
--#if cond_lock != 0
--	addq	$cond_lock, %r8
--#endif
--	movl	$FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, %r9d
--	syscall
--#if cond_lock != 0
--	subq	$cond_lock, %r8
--#endif
--	/* For any kind of error, we try again with WAKE.
--	   The general test also covers running on old kernels.  */
--	cmpq	$-4095, %rax
--	jae	7f
--
--	xorl	%eax, %eax
--	retq
--
--	/* Wake up one thread and requeue none in the PI Mutex case.  */
--9:	movl	$(FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
--	movq	%rcx, %r8
--	xorq	%r10, %r10
--	movl	(%rdi), %r9d	// XXX Can this be right?
--	syscall
--
--	leaq	-cond_futex(%rdi), %r8
--
--	/* For any kind of error, we try again with WAKE.
--	   The general test also covers running on old kernels.  */
--	cmpq	$-4095, %rax
--	jb	4f
--
--7:
--#ifdef __ASSUME_PRIVATE_FUTEX
--	andl	$FUTEX_PRIVATE_FLAG, %esi
--#else
--	andl	%fs:PRIVATE_FUTEX, %esi
--#endif
--	orl	$FUTEX_WAKE, %esi
--	movl	$SYS_futex, %eax
--	/* %rdx should be 1 already from $FUTEX_WAKE_OP syscall.
--	movl	$1, %edx  */
--	syscall
--
--	/* Unlock.  */
--4:	LOCK
--#if cond_lock == 0
--	decl	(%r8)
--#else
--	decl	cond_lock(%r8)
--#endif
--	jne	5f
--
--6:	xorl	%eax, %eax
--	retq
--
--	/* Initial locking failed.  */
--1:
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_lock_wait
--#if cond_lock != 0
--	subq	$cond_lock, %rdi
--#endif
--	jmp	2b
--
--	/* Unlock in loop requires wakeup.  */
--5:
--	movq	%r8, %rdi
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_unlock_wake
--	jmp	6b
--END(__pthread_cond_signal)
--
--versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal,
--		  GLIBC_2_3_2)
-diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
-deleted file mode 100644
-index 82ffa1a..0000000
---- a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
-+++ /dev/null
-@@ -1,623 +0,0 @@
--/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library; if not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#include <sysdep.h>
--#include <shlib-compat.h>
--#include <lowlevellock.h>
--#include <lowlevelcond.h>
--#include <pthread-pi-defines.h>
--#include <pthread-errnos.h>
--#include <stap-probe.h>
--
--#include <kernel-features.h>
--
--
--	.text
--
--
--/* int pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
--			       const struct timespec *abstime)  */
--	.globl	__pthread_cond_timedwait
--	.type	__pthread_cond_timedwait, @function
--	.align	16
--__pthread_cond_timedwait:
--.LSTARTCODE:
--	cfi_startproc
--#ifdef SHARED
--	cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
--			DW.ref.__gcc_personality_v0)
--	cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
--#else
--	cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
--	cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
--#endif
--
--	pushq	%r12
--	cfi_adjust_cfa_offset(8)
--	cfi_rel_offset(%r12, 0)
--	pushq	%r13
--	cfi_adjust_cfa_offset(8)
--	cfi_rel_offset(%r13, 0)
--	pushq	%r14
--	cfi_adjust_cfa_offset(8)
--	cfi_rel_offset(%r14, 0)
--	pushq	%r15
--	cfi_adjust_cfa_offset(8)
--	cfi_rel_offset(%r15, 0)
--#define FRAME_SIZE (32+8)
--	subq	$FRAME_SIZE, %rsp
--	cfi_adjust_cfa_offset(FRAME_SIZE)
--	cfi_remember_state
--
--	LIBC_PROBE (cond_timedwait, 3, %rdi, %rsi, %rdx)
--
--	cmpq	$1000000000, 8(%rdx)
--	movl	$EINVAL, %eax
--	jae	48f
--
--	/* Stack frame:
--
--	   rsp + 48
--		    +--------------------------+
--	   rsp + 32 | timeout value            |
--		    +--------------------------+
--	   rsp + 24 | old wake_seq value       |
--		    +--------------------------+
--	   rsp + 16 | mutex pointer            |
--		    +--------------------------+
--	   rsp +  8 | condvar pointer          |
--		    +--------------------------+
--	   rsp +  4 | old broadcast_seq value  |
--		    +--------------------------+
--	   rsp +  0 | old cancellation mode    |
--		    +--------------------------+
--	*/
--
--	LP_OP(cmp) $-1, dep_mutex(%rdi)
--
--	/* Prepare structure passed to cancellation handler.  */
--	movq	%rdi, 8(%rsp)
--	movq	%rsi, 16(%rsp)
--	movq	%rdx, %r13
--
--	je	22f
--	mov	%RSI_LP, dep_mutex(%rdi)
--
--22:
--	xorb	%r15b, %r15b
--
--	/* Get internal lock.  */
--	movl	$1, %esi
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %esi, (%rdi)
--#else
--	cmpxchgl %esi, cond_lock(%rdi)
--#endif
--	jnz	31f
--
--	/* Unlock the mutex.  */
--32:	movq	16(%rsp), %rdi
--	xorl	%esi, %esi
--	callq	__pthread_mutex_unlock_usercnt
--
--	testl	%eax, %eax
--	jne	46f
--
--	movq	8(%rsp), %rdi
--	incq	total_seq(%rdi)
--	incl	cond_futex(%rdi)
--	addl	$(1 << nwaiters_shift), cond_nwaiters(%rdi)
--
--	/* Get and store current wakeup_seq value.  */
--	movq	8(%rsp), %rdi
--	movq	wakeup_seq(%rdi), %r9
--	movl	broadcast_seq(%rdi), %edx
--	movq	%r9, 24(%rsp)
--	movl	%edx, 4(%rsp)
--
--	cmpq	$0, (%r13)
--	movq	$-ETIMEDOUT, %r14
--	js	36f
--
--38:	movl	cond_futex(%rdi), %r12d
--
--	/* Unlock.  */
--	LOCK
--#if cond_lock == 0
--	decl	(%rdi)
--#else
--	decl	cond_lock(%rdi)
--#endif
--	jne	33f
--
--.LcleanupSTART1:
--34:	callq	__pthread_enable_asynccancel
--	movl	%eax, (%rsp)
--
--	movq	%r13, %r10
--	movl	$FUTEX_WAIT_BITSET, %esi
--	LP_OP(cmp) $-1, dep_mutex(%rdi)
--	je	60f
--
--	mov	dep_mutex(%rdi), %R8_LP
--	/* Requeue to a non-robust PI mutex if the PI bit is set and
--	the robust bit is not set.  */
--	movl	MUTEX_KIND(%r8), %eax
--	andl	$(ROBUST_BIT|PI_BIT), %eax
--	cmpl	$PI_BIT, %eax
--	jne	61f
--
--	movl	$(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
--	xorl	%eax, %eax
--	/* The following only works like this because we only support
--	   two clocks, represented using a single bit.  */
--	testl	$1, cond_nwaiters(%rdi)
--	movl	$FUTEX_CLOCK_REALTIME, %edx
--	cmove	%edx, %eax
--	orl	%eax, %esi
--	movq	%r12, %rdx
--	addq	$cond_futex, %rdi
--	movl	$SYS_futex, %eax
--	syscall
--
--	cmpl	$0, %eax
--	sete	%r15b
--
--#ifdef __ASSUME_REQUEUE_PI
--	jmp	62f
--#else
--	je	62f
--
--	/* When a futex syscall with FUTEX_WAIT_REQUEUE_PI returns
--	   successfully, it has already locked the mutex for us and the
--	   pi_flag (%r15b) is set to denote that fact.  However, if another
--	   thread changed the futex value before we entered the wait, the
--	   syscall may return an EAGAIN and the mutex is not locked.  We go
--	   ahead with a success anyway since later we look at the pi_flag to
--	   decide if we got the mutex or not.  The sequence numbers then make
--	   sure that only one of the threads actually wake up.  We retry using
--	   normal FUTEX_WAIT only if the kernel returned ENOSYS, since normal
--	   and PI futexes don't mix.
--
--	   Note that we don't check for EAGAIN specifically; we assume that the
--	   only other error the futex function could return is EAGAIN (barring
--	   the ETIMEOUT of course, for the timeout case in futex) since
--	   anything else would mean an error in our function.  It is too
--	   expensive to do that check for every call (which is  quite common in
--	   case of a large number of threads), so it has been skipped.  */
--	cmpl    $-ENOSYS, %eax
--	jne     62f
--
--	subq	$cond_futex, %rdi
--#endif
--
--61:	movl	$(FUTEX_WAIT_BITSET|FUTEX_PRIVATE_FLAG), %esi
--60:	xorb	%r15b, %r15b
--	xorl	%eax, %eax
--	/* The following only works like this because we only support
--	   two clocks, represented using a single bit.  */
--	testl	$1, cond_nwaiters(%rdi)
--	movl	$FUTEX_CLOCK_REALTIME, %edx
--	movl	$0xffffffff, %r9d
--	cmove	%edx, %eax
--	orl	%eax, %esi
--	movq	%r12, %rdx
--	addq	$cond_futex, %rdi
--	movl	$SYS_futex, %eax
--	syscall
--62:	movq	%rax, %r14
--
--	movl	(%rsp), %edi
--	callq	__pthread_disable_asynccancel
--.LcleanupEND1:
--
--	/* Lock.  */
--	movq	8(%rsp), %rdi
--	movl	$1, %esi
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %esi, (%rdi)
--#else
--	cmpxchgl %esi, cond_lock(%rdi)
--#endif
--	jne	35f
--
--36:	movl	broadcast_seq(%rdi), %edx
--
--	movq	woken_seq(%rdi), %rax
--
--	movq	wakeup_seq(%rdi), %r9
--
--	cmpl	4(%rsp), %edx
--	jne	53f
--
--	cmpq	24(%rsp), %r9
--	jbe	45f
--
--	cmpq	%rax, %r9
--	ja	39f
--
--45:	cmpq	$-ETIMEDOUT, %r14
--	je	99f
--
--	/* We need to go back to futex_wait.  If we're using requeue_pi, then
--	   release the mutex we had acquired and go back.  */
--	test	%r15b, %r15b
--	jz	38b
--
--	/* Adjust the mutex values first and then unlock it.  The unlock
--	   should always succeed or else the kernel did not lock the
--	   mutex correctly.  */
--	movq	%r8, %rdi
--	callq	__pthread_mutex_cond_lock_adjust
--	xorl	%esi, %esi
--	callq	__pthread_mutex_unlock_usercnt
--	/* Reload cond_var.  */
--	movq	8(%rsp), %rdi
--	jmp	38b
--
--99:	incq	wakeup_seq(%rdi)
--	incl	cond_futex(%rdi)
--	movl	$ETIMEDOUT, %r14d
--	jmp	44f
--
--53:	xorq	%r14, %r14
--	jmp	54f
--
--39:	xorq	%r14, %r14
--44:	incq	woken_seq(%rdi)
--
--54:	subl	$(1 << nwaiters_shift), cond_nwaiters(%rdi)
--
--	/* Wake up a thread which wants to destroy the condvar object.  */
--	cmpq	$0xffffffffffffffff, total_seq(%rdi)
--	jne	55f
--	movl	cond_nwaiters(%rdi), %eax
--	andl	$~((1 << nwaiters_shift) - 1), %eax
--	jne	55f
--
--	addq	$cond_nwaiters, %rdi
--	LP_OP(cmp) $-1, dep_mutex-cond_nwaiters(%rdi)
--	movl	$1, %edx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$FUTEX_WAKE, %eax
--	movl	$(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
--	cmove	%eax, %esi
--#else
--	movl	$0, %eax
--	movl	%fs:PRIVATE_FUTEX, %esi
--	cmove	%eax, %esi
--	orl	$FUTEX_WAKE, %esi
--#endif
--	movl	$SYS_futex, %eax
--	syscall
--	subq	$cond_nwaiters, %rdi
--
--55:	LOCK
--#if cond_lock == 0
--	decl	(%rdi)
--#else
--	decl	cond_lock(%rdi)
--#endif
--	jne	40f
--
--	/* If requeue_pi is used the kernel performs the locking of the
--	   mutex. */
--41:	movq	16(%rsp), %rdi
--	testb	%r15b, %r15b
--	jnz	64f
--
--	callq	__pthread_mutex_cond_lock
--
--63:	testq	%rax, %rax
--	cmoveq	%r14, %rax
--
--48:	addq	$FRAME_SIZE, %rsp
--	cfi_adjust_cfa_offset(-FRAME_SIZE)
--	popq	%r15
--	cfi_adjust_cfa_offset(-8)
--	cfi_restore(%r15)
--	popq	%r14
--	cfi_adjust_cfa_offset(-8)
--	cfi_restore(%r14)
--	popq	%r13
--	cfi_adjust_cfa_offset(-8)
--	cfi_restore(%r13)
--	popq	%r12
--	cfi_adjust_cfa_offset(-8)
--	cfi_restore(%r12)
--
--	retq
--
--	cfi_restore_state
--
--64:	callq	__pthread_mutex_cond_lock_adjust
--	movq	%r14, %rax
--	jmp	48b
--
--	/* Initial locking failed.  */
--31:
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_lock_wait
--	jmp	32b
--
--	/* Unlock in loop requires wakeup.  */
--33:
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_unlock_wake
--	jmp	34b
--
--	/* Locking in loop failed.  */
--35:
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_lock_wait
--#if cond_lock != 0
--	subq	$cond_lock, %rdi
--#endif
--	jmp	36b
--
--	/* Unlock after loop requires wakeup.  */
--40:
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_unlock_wake
--	jmp	41b
--
--	/* The initial unlocking of the mutex failed.  */
--46:	movq	8(%rsp), %rdi
--	movq	%rax, (%rsp)
--	LOCK
--#if cond_lock == 0
--	decl	(%rdi)
--#else
--	decl	cond_lock(%rdi)
--#endif
--	jne	47f
--
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_unlock_wake
--
--47:	movq	(%rsp), %rax
--	jmp	48b
--
--	.size	__pthread_cond_timedwait, .-__pthread_cond_timedwait
--versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
--		  GLIBC_2_3_2)
--
--
--	.align	16
--	.type	__condvar_cleanup2, @function
--__condvar_cleanup2:
--	/* Stack frame:
--
--	   rsp + 72
--		    +--------------------------+
--	   rsp + 64 | %r12                     |
--		    +--------------------------+
--	   rsp + 56 | %r13                     |
--		    +--------------------------+
--	   rsp + 48 | %r14                     |
--		    +--------------------------+
--	   rsp + 24 | unused                   |
--		    +--------------------------+
--	   rsp + 16 | mutex pointer            |
--		    +--------------------------+
--	   rsp +  8 | condvar pointer          |
--		    +--------------------------+
--	   rsp +  4 | old broadcast_seq value  |
--		    +--------------------------+
--	   rsp +  0 | old cancellation mode    |
--		    +--------------------------+
--	*/
--
--	movq	%rax, 24(%rsp)
--
--	/* Get internal lock.  */
--	movq	8(%rsp), %rdi
--	movl	$1, %esi
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %esi, (%rdi)
--#else
--	cmpxchgl %esi, cond_lock(%rdi)
--#endif
--	jz	1f
--
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_lock_wait
--#if cond_lock != 0
--	subq	$cond_lock, %rdi
--#endif
--
--1:	movl	broadcast_seq(%rdi), %edx
--	cmpl	4(%rsp), %edx
--	jne	3f
--
--	/* We increment the wakeup_seq counter only if it is lower than
--	   total_seq.  If this is not the case the thread was woken and
--	   then canceled.  In this case we ignore the signal.  */
--	movq	total_seq(%rdi), %rax
--	cmpq	wakeup_seq(%rdi), %rax
--	jbe	6f
--	incq	wakeup_seq(%rdi)
--	incl	cond_futex(%rdi)
--6:	incq	woken_seq(%rdi)
--
--3:	subl	$(1 << nwaiters_shift), cond_nwaiters(%rdi)
--
--	/* Wake up a thread which wants to destroy the condvar object.  */
--	xorq	%r12, %r12
--	cmpq	$0xffffffffffffffff, total_seq(%rdi)
--	jne	4f
--	movl	cond_nwaiters(%rdi), %eax
--	andl	$~((1 << nwaiters_shift) - 1), %eax
--	jne	4f
--
--	LP_OP(cmp) $-1, dep_mutex(%rdi)
--	leaq	cond_nwaiters(%rdi), %rdi
--	movl	$1, %edx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$FUTEX_WAKE, %eax
--	movl	$(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
--	cmove	%eax, %esi
--#else
--	movl	$0, %eax
--	movl	%fs:PRIVATE_FUTEX, %esi
--	cmove	%eax, %esi
--	orl	$FUTEX_WAKE, %esi
--#endif
--	movl	$SYS_futex, %eax
--	syscall
--	subq	$cond_nwaiters, %rdi
--	movl	$1, %r12d
--
--4:	LOCK
--#if cond_lock == 0
--	decl	(%rdi)
--#else
--	decl	cond_lock(%rdi)
--#endif
--	je	2f
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_unlock_wake
--
--	/* Wake up all waiters to make sure no signal gets lost.  */
--2:	testq	%r12, %r12
--	jnz	5f
--	addq	$cond_futex, %rdi
--	LP_OP(cmp) $-1, dep_mutex-cond_futex(%rdi)
--	movl	$0x7fffffff, %edx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$FUTEX_WAKE, %eax
--	movl	$(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
--	cmove	%eax, %esi
--#else
--	movl	$0, %eax
--	movl	%fs:PRIVATE_FUTEX, %esi
--	cmove	%eax, %esi
--	orl	$FUTEX_WAKE, %esi
--#endif
--	movl	$SYS_futex, %eax
--	syscall
--
--	/* Lock the mutex only if we don't own it already.  This only happens
--	   in case of PI mutexes, if we got cancelled after a successful
--	   return of the futex syscall and before disabling async
--	   cancellation.  */
--5:	movq	16(%rsp), %rdi
--	movl	MUTEX_KIND(%rdi), %eax
--	andl	$(ROBUST_BIT|PI_BIT), %eax
--	cmpl	$PI_BIT, %eax
--	jne	7f
--
--	movl	(%rdi), %eax
--	andl	$TID_MASK, %eax
--	cmpl	%eax, %fs:TID
--	jne	7f
--	/* We managed to get the lock.  Fix it up before returning.  */
--	callq	__pthread_mutex_cond_lock_adjust
--	jmp	8f
--
--7:	callq	__pthread_mutex_cond_lock
--
--8:	movq	24(%rsp), %rdi
--	movq	FRAME_SIZE(%rsp), %r15
--	movq	FRAME_SIZE+8(%rsp), %r14
--	movq	FRAME_SIZE+16(%rsp), %r13
--	movq	FRAME_SIZE+24(%rsp), %r12
--.LcallUR:
--	call	_Unwind_Resume
--	hlt
--.LENDCODE:
--	cfi_endproc
--	.size	__condvar_cleanup2, .-__condvar_cleanup2
--
--
--	.section .gcc_except_table,"a",@progbits
--.LexceptSTART:
--	.byte	DW_EH_PE_omit			# @LPStart format
--	.byte	DW_EH_PE_omit			# @TType format
--	.byte	DW_EH_PE_uleb128		# call-site format
--	.uleb128 .Lcstend-.Lcstbegin
--.Lcstbegin:
--	.uleb128 .LcleanupSTART1-.LSTARTCODE
--	.uleb128 .LcleanupEND1-.LcleanupSTART1
--	.uleb128 __condvar_cleanup2-.LSTARTCODE
--	.uleb128  0
--	.uleb128 .LcallUR-.LSTARTCODE
--	.uleb128 .LENDCODE-.LcallUR
--	.uleb128 0
--	.uleb128  0
--.Lcstend:
--
--
--#ifdef SHARED
--	.hidden	DW.ref.__gcc_personality_v0
--	.weak	DW.ref.__gcc_personality_v0
--	.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
--	.align	LP_SIZE
--	.type	DW.ref.__gcc_personality_v0, @object
--	.size	DW.ref.__gcc_personality_v0, LP_SIZE
--DW.ref.__gcc_personality_v0:
--	ASM_ADDR __gcc_personality_v0
--#endif
-diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
-deleted file mode 100644
-index c82f37b..0000000
---- a/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
-+++ /dev/null
-@@ -1,555 +0,0 @@
--/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
--   This file is part of the GNU C Library.
--   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
--
--   The GNU C Library is free software; you can redistribute it and/or
--   modify it under the terms of the GNU Lesser General Public
--   License as published by the Free Software Foundation; either
--   version 2.1 of the License, or (at your option) any later version.
--
--   The GNU C Library is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--   Lesser General Public License for more details.
--
--   You should have received a copy of the GNU Lesser General Public
--   License along with the GNU C Library; if not, see
--   <http://www.gnu.org/licenses/>.  */
--
--#include <sysdep.h>
--#include <shlib-compat.h>
--#include <lowlevellock.h>
--#include <lowlevelcond.h>
--#include <tcb-offsets.h>
--#include <pthread-pi-defines.h>
--#include <pthread-errnos.h>
--#include <stap-probe.h>
--
--#include <kernel-features.h>
--
--
--	.text
--
--/* int pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)  */
--	.globl	__pthread_cond_wait
--	.type	__pthread_cond_wait, @function
--	.align	16
--__pthread_cond_wait:
--.LSTARTCODE:
--	cfi_startproc
--#ifdef SHARED
--	cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
--			DW.ref.__gcc_personality_v0)
--	cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
--#else
--	cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
--	cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
--#endif
--
--#define FRAME_SIZE (32+8)
--	leaq	-FRAME_SIZE(%rsp), %rsp
--	cfi_adjust_cfa_offset(FRAME_SIZE)
--
--	/* Stack frame:
--
--	   rsp + 32
--		    +--------------------------+
--	   rsp + 24 | old wake_seq value       |
--		    +--------------------------+
--	   rsp + 16 | mutex pointer            |
--		    +--------------------------+
--	   rsp +  8 | condvar pointer          |
--		    +--------------------------+
--	   rsp +  4 | old broadcast_seq value  |
--		    +--------------------------+
--	   rsp +  0 | old cancellation mode    |
--		    +--------------------------+
--	*/
--
--	LIBC_PROBE (cond_wait, 2, %rdi, %rsi)
--
--	LP_OP(cmp) $-1, dep_mutex(%rdi)
--
--	/* Prepare structure passed to cancellation handler.  */
--	movq	%rdi, 8(%rsp)
--	movq	%rsi, 16(%rsp)
--
--	je	15f
--	mov	%RSI_LP, dep_mutex(%rdi)
--
--	/* Get internal lock.  */
--15:	movl	$1, %esi
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %esi, (%rdi)
--#else
--	cmpxchgl %esi, cond_lock(%rdi)
--#endif
--	jne	1f
--
--	/* Unlock the mutex.  */
--2:	movq	16(%rsp), %rdi
--	xorl	%esi, %esi
--	callq	__pthread_mutex_unlock_usercnt
--
--	testl	%eax, %eax
--	jne	12f
--
--	movq	8(%rsp), %rdi
--	incq	total_seq(%rdi)
--	incl	cond_futex(%rdi)
--	addl	$(1 << nwaiters_shift), cond_nwaiters(%rdi)
--
--	/* Get and store current wakeup_seq value.  */
--	movq	8(%rsp), %rdi
--	movq	wakeup_seq(%rdi), %r9
--	movl	broadcast_seq(%rdi), %edx
--	movq	%r9, 24(%rsp)
--	movl	%edx, 4(%rsp)
--
--	/* Unlock.  */
--8:	movl	cond_futex(%rdi), %edx
--	LOCK
--#if cond_lock == 0
--	decl	(%rdi)
--#else
--	decl	cond_lock(%rdi)
--#endif
--	jne	3f
--
--.LcleanupSTART:
--4:	callq	__pthread_enable_asynccancel
--	movl	%eax, (%rsp)
--
--	xorq	%r10, %r10
--	LP_OP(cmp) $-1, dep_mutex(%rdi)
--	leaq	cond_futex(%rdi), %rdi
--	movl	$FUTEX_WAIT, %esi
--	je	60f
--
--	mov	dep_mutex-cond_futex(%rdi), %R8_LP
--	/* Requeue to a non-robust PI mutex if the PI bit is set and
--	the robust bit is not set.  */
--	movl	MUTEX_KIND(%r8), %eax
--	andl	$(ROBUST_BIT|PI_BIT), %eax
--	cmpl	$PI_BIT, %eax
--	jne	61f
--
--	movl	$(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
--	movl	$SYS_futex, %eax
--	syscall
--
--	cmpl	$0, %eax
--	sete	%r8b
--
--#ifdef __ASSUME_REQUEUE_PI
--	jmp	62f
--#else
--	je	62f
--
--	/* When a futex syscall with FUTEX_WAIT_REQUEUE_PI returns
--	   successfully, it has already locked the mutex for us and the
--	   pi_flag (%r8b) is set to denote that fact.  However, if another
--	   thread changed the futex value before we entered the wait, the
--	   syscall may return an EAGAIN and the mutex is not locked.  We go
--	   ahead with a success anyway since later we look at the pi_flag to
--	   decide if we got the mutex or not.  The sequence numbers then make
--	   sure that only one of the threads actually wake up.  We retry using
--	   normal FUTEX_WAIT only if the kernel returned ENOSYS, since normal
--	   and PI futexes don't mix.
--
--	   Note that we don't check for EAGAIN specifically; we assume that the
--	   only other error the futex function could return is EAGAIN since
--	   anything else would mean an error in our function.  It is too
--	   expensive to do that check for every call (which is 	quite common in
--	   case of a large number of threads), so it has been skipped.  */
--	cmpl	$-ENOSYS, %eax
--	jne	62f
--
--# ifndef __ASSUME_PRIVATE_FUTEX
--	movl	$FUTEX_WAIT, %esi
--# endif
--#endif
--
--61:
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$(FUTEX_WAIT|FUTEX_PRIVATE_FLAG), %esi
--#else
--	orl	%fs:PRIVATE_FUTEX, %esi
--#endif
--60:	xorb	%r8b, %r8b
--	movl	$SYS_futex, %eax
--	syscall
--
--62:	movl	(%rsp), %edi
--	callq	__pthread_disable_asynccancel
--.LcleanupEND:
--
--	/* Lock.  */
--	movq	8(%rsp), %rdi
--	movl	$1, %esi
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %esi, (%rdi)
--#else
--	cmpxchgl %esi, cond_lock(%rdi)
--#endif
--	jnz	5f
--
--6:	movl	broadcast_seq(%rdi), %edx
--
--	movq	woken_seq(%rdi), %rax
--
--	movq	wakeup_seq(%rdi), %r9
--
--	cmpl	4(%rsp), %edx
--	jne	16f
--
--	cmpq	24(%rsp), %r9
--	jbe	19f
--
--	cmpq	%rax, %r9
--	jna	19f
--
--	incq	woken_seq(%rdi)
--
--	/* Unlock */
--16:	subl	$(1 << nwaiters_shift), cond_nwaiters(%rdi)
--
--	/* Wake up a thread which wants to destroy the condvar object.  */
--	cmpq	$0xffffffffffffffff, total_seq(%rdi)
--	jne	17f
--	movl	cond_nwaiters(%rdi), %eax
--	andl	$~((1 << nwaiters_shift) - 1), %eax
--	jne	17f
--
--	addq	$cond_nwaiters, %rdi
--	LP_OP(cmp) $-1, dep_mutex-cond_nwaiters(%rdi)
--	movl	$1, %edx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$FUTEX_WAKE, %eax
--	movl	$(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
--	cmove	%eax, %esi
--#else
--	movl	$0, %eax
--	movl	%fs:PRIVATE_FUTEX, %esi
--	cmove	%eax, %esi
--	orl	$FUTEX_WAKE, %esi
--#endif
--	movl	$SYS_futex, %eax
--	syscall
--	subq	$cond_nwaiters, %rdi
--
--17:	LOCK
--#if cond_lock == 0
--	decl	(%rdi)
--#else
--	decl	cond_lock(%rdi)
--#endif
--	jne	10f
--
--	/* If requeue_pi is used the kernel performs the locking of the
--	   mutex. */
--11:	movq	16(%rsp), %rdi
--	testb	%r8b, %r8b
--	jnz	18f
--
--	callq	__pthread_mutex_cond_lock
--
--14:	leaq	FRAME_SIZE(%rsp), %rsp
--	cfi_adjust_cfa_offset(-FRAME_SIZE)
--
--	/* We return the result of the mutex_lock operation.  */
--	retq
--
--	cfi_adjust_cfa_offset(FRAME_SIZE)
--
--18:	callq	__pthread_mutex_cond_lock_adjust
--	xorl	%eax, %eax
--	jmp	14b
--
--	/* We need to go back to futex_wait.  If we're using requeue_pi, then
--	   release the mutex we had acquired and go back.  */
--19:	testb	%r8b, %r8b
--	jz	8b
--
--	/* Adjust the mutex values first and then unlock it.  The unlock
--	   should always succeed or else the kernel did not lock the mutex
--	   correctly.  */
--	movq	16(%rsp), %rdi
--	callq	__pthread_mutex_cond_lock_adjust
--	movq	%rdi, %r8
--	xorl	%esi, %esi
--	callq	__pthread_mutex_unlock_usercnt
--	/* Reload cond_var.  */
--	movq	8(%rsp), %rdi
--	jmp	8b
--
--	/* Initial locking failed.  */
--1:
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_lock_wait
--	jmp	2b
--
--	/* Unlock in loop requires wakeup.  */
--3:
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	/* The call preserves %rdx.  */
--	callq	__lll_unlock_wake
--#if cond_lock != 0
--	subq	$cond_lock, %rdi
--#endif
--	jmp	4b
--
--	/* Locking in loop failed.  */
--5:
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_lock_wait
--#if cond_lock != 0
--	subq	$cond_lock, %rdi
--#endif
--	jmp	6b
--
--	/* Unlock after loop requires wakeup.  */
--10:
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_unlock_wake
--	jmp	11b
--
--	/* The initial unlocking of the mutex failed.  */
--12:	movq	%rax, %r10
--	movq	8(%rsp), %rdi
--	LOCK
--#if cond_lock == 0
--	decl	(%rdi)
--#else
--	decl	cond_lock(%rdi)
--#endif
--	je	13f
--
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_unlock_wake
--
--13:	movq	%r10, %rax
--	jmp	14b
--
--	.size	__pthread_cond_wait, .-__pthread_cond_wait
--versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
--		  GLIBC_2_3_2)
--
--
--	.align	16
--	.type	__condvar_cleanup1, @function
--	.globl	__condvar_cleanup1
--	.hidden	__condvar_cleanup1
--__condvar_cleanup1:
--	/* Stack frame:
--
--	   rsp + 32
--		    +--------------------------+
--	   rsp + 24 | unused                   |
--		    +--------------------------+
--	   rsp + 16 | mutex pointer            |
--		    +--------------------------+
--	   rsp +  8 | condvar pointer          |
--		    +--------------------------+
--	   rsp +  4 | old broadcast_seq value  |
--		    +--------------------------+
--	   rsp +  0 | old cancellation mode    |
--		    +--------------------------+
--	*/
--
--	movq	%rax, 24(%rsp)
--
--	/* Get internal lock.  */
--	movq	8(%rsp), %rdi
--	movl	$1, %esi
--	xorl	%eax, %eax
--	LOCK
--#if cond_lock == 0
--	cmpxchgl %esi, (%rdi)
--#else
--	cmpxchgl %esi, cond_lock(%rdi)
--#endif
--	jz	1f
--
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	callq	__lll_lock_wait
--#if cond_lock != 0
--	subq	$cond_lock, %rdi
--#endif
--
--1:	movl	broadcast_seq(%rdi), %edx
--	cmpl	4(%rsp), %edx
--	jne	3f
--
--	/* We increment the wakeup_seq counter only if it is lower than
--	   total_seq.  If this is not the case the thread was woken and
--	   then canceled.  In this case we ignore the signal.  */
--	movq	total_seq(%rdi), %rax
--	cmpq	wakeup_seq(%rdi), %rax
--	jbe	6f
--	incq	wakeup_seq(%rdi)
--	incl	cond_futex(%rdi)
--6:	incq	woken_seq(%rdi)
--
--3:	subl	$(1 << nwaiters_shift), cond_nwaiters(%rdi)
--
--	/* Wake up a thread which wants to destroy the condvar object.  */
--	xorl	%ecx, %ecx
--	cmpq	$0xffffffffffffffff, total_seq(%rdi)
--	jne	4f
--	movl	cond_nwaiters(%rdi), %eax
--	andl	$~((1 << nwaiters_shift) - 1), %eax
--	jne	4f
--
--	LP_OP(cmp) $-1, dep_mutex(%rdi)
--	leaq	cond_nwaiters(%rdi), %rdi
--	movl	$1, %edx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$FUTEX_WAKE, %eax
--	movl	$(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
--	cmove	%eax, %esi
--#else
--	movl	$0, %eax
--	movl	%fs:PRIVATE_FUTEX, %esi
--	cmove	%eax, %esi
--	orl	$FUTEX_WAKE, %esi
--#endif
--	movl	$SYS_futex, %eax
--	syscall
--	subq	$cond_nwaiters, %rdi
--	movl	$1, %ecx
--
--4:	LOCK
--#if cond_lock == 0
--	decl	(%rdi)
--#else
--	decl	cond_lock(%rdi)
--#endif
--	je	2f
--#if cond_lock != 0
--	addq	$cond_lock, %rdi
--#endif
--	LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi)
--	movl	$LLL_PRIVATE, %eax
--	movl	$LLL_SHARED, %esi
--	cmovne	%eax, %esi
--	/* The call preserves %rcx.  */
--	callq	__lll_unlock_wake
--
--	/* Wake up all waiters to make sure no signal gets lost.  */
--2:	testl	%ecx, %ecx
--	jnz	5f
--	addq	$cond_futex, %rdi
--	LP_OP(cmp) $-1, dep_mutex-cond_futex(%rdi)
--	movl	$0x7fffffff, %edx
--#ifdef __ASSUME_PRIVATE_FUTEX
--	movl	$FUTEX_WAKE, %eax
--	movl	$(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), %esi
--	cmove	%eax, %esi
--#else
--	movl	$0, %eax
--	movl	%fs:PRIVATE_FUTEX, %esi
--	cmove	%eax, %esi
--	orl	$FUTEX_WAKE, %esi
--#endif
--	movl	$SYS_futex, %eax
--	syscall
--
--	/* Lock the mutex only if we don't own it already.  This only happens
--	   in case of PI mutexes, if we got cancelled after a successful
--	   return of the futex syscall and before disabling async
--	   cancellation.  */
--5:	movq	16(%rsp), %rdi
--	movl	MUTEX_KIND(%rdi), %eax
--	andl	$(ROBUST_BIT|PI_BIT), %eax
--	cmpl	$PI_BIT, %eax
--	jne	7f
--
--	movl	(%rdi), %eax
--	andl	$TID_MASK, %eax
--	cmpl	%eax, %fs:TID
--	jne	7f
--	/* We managed to get the lock.  Fix it up before returning.  */
--	callq	__pthread_mutex_cond_lock_adjust
--	jmp	8f
--
--
--7:	callq	__pthread_mutex_cond_lock
--
--8:	movq	24(%rsp), %rdi
--.LcallUR:
--	call	_Unwind_Resume
--	hlt
--.LENDCODE:
--	cfi_endproc
--	.size	__condvar_cleanup1, .-__condvar_cleanup1
--
--
--	.section .gcc_except_table,"a",@progbits
--.LexceptSTART:
--	.byte	DW_EH_PE_omit			# @LPStart format
--	.byte	DW_EH_PE_omit			# @TType format
--	.byte	DW_EH_PE_uleb128		# call-site format
--	.uleb128 .Lcstend-.Lcstbegin
--.Lcstbegin:
--	.uleb128 .LcleanupSTART-.LSTARTCODE
--	.uleb128 .LcleanupEND-.LcleanupSTART
--	.uleb128 __condvar_cleanup1-.LSTARTCODE
--	.uleb128 0
--	.uleb128 .LcallUR-.LSTARTCODE
--	.uleb128 .LENDCODE-.LcallUR
--	.uleb128 0
--	.uleb128 0
--.Lcstend:
--
--
--#ifdef SHARED
--	.hidden	DW.ref.__gcc_personality_v0
--	.weak	DW.ref.__gcc_personality_v0
--	.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
--	.align	LP_SIZE
--	.type	DW.ref.__gcc_personality_v0, @object
--	.size	DW.ref.__gcc_personality_v0, LP_SIZE
--DW.ref.__gcc_personality_v0:
--	ASM_ADDR __gcc_personality_v0
--#endif
-diff --git a/sysdeps/x86/bits/pthreadtypes.h b/sysdeps/x86/bits/pthreadtypes.h
-index 16b8f4f..a3a738f 100644
---- a/sysdeps/x86/bits/pthreadtypes.h
-+++ b/sysdeps/x86/bits/pthreadtypes.h
-@@ -140,14 +140,27 @@ typedef union
- {
-   struct
-   {
--    int __lock;
--    unsigned int __futex;
--    __extension__ unsigned long long int __total_seq;
--    __extension__ unsigned long long int __wakeup_seq;
--    __extension__ unsigned long long int __woken_seq;
--    void *__mutex;
--    unsigned int __nwaiters;
--    unsigned int __broadcast_seq;
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __wseq;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __wseq32;
-+    };
-+    __extension__ union
-+    {
-+      __extension__ unsigned long long int __g1_start;
-+      struct {
-+	unsigned int __low;
-+	unsigned int __high;
-+      } __g1_start32;
-+    };
-+    unsigned int __g_refs[2];
-+    unsigned int __g_size[2];
-+    unsigned int __g1_orig_size;
-+    unsigned int __wrefs;
-+    unsigned int __g_signals[2];
-   } __data;
-   char __size[__SIZEOF_PTHREAD_COND_T];
-   __extension__ long long int __align;
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
index 3127de6..b981f7b 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
@@ -1,7 +1,7 @@
-From a56e7aa2fd10b178b9498f88a7a2ca8aad671a53 Mon Sep 17 00:00:00 2001
+From 0b95f34207ffed3aa53fa949662bfbccc7c864a4 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Thu, 31 Dec 2015 14:35:35 -0800
-Subject: [PATCH 04/25] nativesdk-glibc: Allow 64 bit atomics for x86
+Subject: [PATCH 04/26] nativesdk-glibc: Allow 64 bit atomics for x86
 
 The fix consist of allowing 64bit atomic ops for x86.
 This should be safe for i586 and newer CPUs.
@@ -11,8 +11,6 @@
 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
-Upstream-Status: Pending
-
  sysdeps/i386/atomic-machine.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
@@ -30,5 +28,5 @@
  
  
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-Remove-__ASSUME_REQUEUE_PI.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-Remove-__ASSUME_REQUEUE_PI.patch
deleted file mode 100644
index 8d4ba41..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-Remove-__ASSUME_REQUEUE_PI.patch
+++ /dev/null
@@ -1,149 +0,0 @@
-From 27b7131d3d8133bf3a5ce72d4e4ff4dfadd71f20 Mon Sep 17 00:00:00 2001
-From: Catalin Enache <catalin.enache@windriver.com>
-Date: Fri, 30 Jun 2017 12:08:29 +0300
-Subject: [PATCH 5/6] Remove __ASSUME_REQUEUE_PI
-
-The new cond var implementation (ed19993b5b0d) removed all the
-__ASSUME_{REQUEUE_PI,FUTEX_LOCK_PI} internal usage so there is no
-need to keep defining it.  This patch removes all USE_REQUEUE_PI
-and __ASSUME_REQUEUE_PI.  It is as follow up from BZ#18463.
-
-Checked with a build for x86_64-linux-gnu, arm-linux-gnueabhf,
-m68-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu.
-
-    * nptl/pthreadP.h (USE_REQUEUE_PI): Remove ununsed macro.
-    * sysdeps/unix/sysv/linux/arm/kernel-features.h
-    (__ASSUME_REQUEUE_PI): Likewise.
-    * sysdeps/unix/sysv/linux/kernel-features.h
-    (__ASSUME_REQUEUE_PI): Likewise.
-    * sysdeps/unix/sysv/linux/m68k/kernel-features.h
-    (__ASSUME_REQUEUE_PI): Likewise.
-    * sysdeps/unix/sysv/linux/mips/kernel-features.h
-    (__ASSUME_REQUEUE_PI): Likewise.
-    * sysdeps/unix/sysv/linux/sparc/kernel-features.h
-    (__ASSUME_REQUEUE_PI): Likewise.
-
-Upstream-Status: Backport
-
-Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
----
- ChangeLog                                       | 14 ++++++++++++++
- nptl/pthreadP.h                                 | 12 ------------
- sysdeps/unix/sysv/linux/arm/kernel-features.h   |  1 -
- sysdeps/unix/sysv/linux/kernel-features.h       |  5 -----
- sysdeps/unix/sysv/linux/m68k/kernel-features.h  |  1 -
- sysdeps/unix/sysv/linux/mips/kernel-features.h  |  1 -
- sysdeps/unix/sysv/linux/sparc/kernel-features.h |  1 -
- 7 files changed, 14 insertions(+), 21 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index c94db7b..44c518b 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,17 @@
-+2017-04-04  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
-+
-+	* nptl/pthreadP.h (USE_REQUEUE_PI): Remove ununsed macro.
-+	* sysdeps/unix/sysv/linux/arm/kernel-features.h
-+	(__ASSUME_REQUEUE_PI): Likewise.
-+	* sysdeps/unix/sysv/linux/kernel-features.h
-+	(__ASSUME_REQUEUE_PI): Likewise.
-+	* sysdeps/unix/sysv/linux/m68k/kernel-features.h
-+	(__ASSUME_REQUEUE_PI): Likewise.
-+	* sysdeps/unix/sysv/linux/mips/kernel-features.h
-+	(__ASSUME_REQUEUE_PI): Likewise.
-+	* sysdeps/unix/sysv/linux/sparc/kernel-features.h
-+	(__ASSUME_REQUEUE_PI): Likewise.
-+
- 2016-12-31  Torvald Riegel  <triegel@redhat.com>
- 
- 	[BZ #13165]
-diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
-index e9992bc..730c4ad 100644
---- a/nptl/pthreadP.h
-+++ b/nptl/pthreadP.h
-@@ -594,18 +594,6 @@ extern void __wait_lookup_done (void) attribute_hidden;
- # define PTHREAD_STATIC_FN_REQUIRE(name) __asm (".globl " #name);
- #endif
- 
--/* Test if the mutex is suitable for the FUTEX_WAIT_REQUEUE_PI operation.  */
--#if (defined lll_futex_wait_requeue_pi \
--     && defined __ASSUME_REQUEUE_PI)
--# define USE_REQUEUE_PI(mut) \
--   ((mut) && (mut) != (void *) ~0l \
--    && (((mut)->__data.__kind \
--	 & (PTHREAD_MUTEX_PRIO_INHERIT_NP | PTHREAD_MUTEX_ROBUST_NORMAL_NP)) \
--	== PTHREAD_MUTEX_PRIO_INHERIT_NP))
--#else
--# define USE_REQUEUE_PI(mut) 0
--#endif
--
- /* Returns 0 if POL is a valid scheduling policy.  */
- static inline int
- check_sched_policy_attr (int pol)
-diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
-index 6ca607e..339ad45 100644
---- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
-+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
-@@ -23,7 +23,6 @@
-    futex_atomic_cmpxchg_inatomic, depending on kernel
-    configuration.  */
- #if __LINUX_KERNEL_VERSION < 0x030E03
--# undef __ASSUME_REQUEUE_PI
- # undef __ASSUME_SET_ROBUST_LIST
- #endif
- 
-diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
-index 1d3b554..9f2cf9f 100644
---- a/sysdeps/unix/sysv/linux/kernel-features.h
-+++ b/sysdeps/unix/sysv/linux/kernel-features.h
-@@ -101,11 +101,6 @@
- #define __ASSUME_PREADV	1
- #define __ASSUME_PWRITEV	1
- 
--/* Support for FUTEX_*_REQUEUE_PI was added in 2.6.31 (but some
--   architectures lack futex_atomic_cmpxchg_inatomic in some
--   configurations).  */
--#define __ASSUME_REQUEUE_PI	1
--
- /* Support for recvmmsg functionality was added in 2.6.33.  The macros
-    defined correspond to those for accept4.  */
- #if __LINUX_KERNEL_VERSION >= 0x020621
-diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
-index 46ec601..174c1c6 100644
---- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
-+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
-@@ -51,6 +51,5 @@
- 
- /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */
- #if __LINUX_KERNEL_VERSION < 0x030a00
--# undef __ASSUME_REQUEUE_PI
- # undef __ASSUME_SET_ROBUST_LIST
- #endif
-diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
-index b486d90..a795911c 100644
---- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
-+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
-@@ -24,7 +24,6 @@
- /* The MIPS kernel does not support futex_atomic_cmpxchg_inatomic if
-    emulating LL/SC.  */
- #if __mips == 1 || defined _MIPS_ARCH_R5900
--# undef __ASSUME_REQUEUE_PI
- # undef __ASSUME_SET_ROBUST_LIST
- #endif
- 
-diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
-index 69c9c7c..dd3ddf0 100644
---- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
-+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
-@@ -34,6 +34,5 @@
- /* 32-bit SPARC kernels do not support
-    futex_atomic_cmpxchg_inatomic.  */
- #if !defined __arch64__ && !defined __sparc_v9__
--# undef __ASSUME_REQUEUE_PI
- # undef __ASSUME_SET_ROBUST_LIST
- #endif
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
index dc0dfad..ee50000 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
@@ -1,7 +1,7 @@
-From 450473ce27b47cebec2c5c5b611a8c8bed41e6e8 Mon Sep 17 00:00:00 2001
+From 77a7495376c7d0c5507c0ec99bf1568150339ef4 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:01:50 +0000
-Subject: [PATCH 05/25] fsl e500/e5500/e6500/603e fsqrt implementation
+Subject: [PATCH 05/26] fsl e500/e5500/e6500/603e fsqrt implementation
 
 Upstream-Status: Pending
 Signed-off-by: Edmar Wienskoski <edmar@freescale.com>
@@ -1580,5 +1580,5 @@
 @@ -0,0 +1 @@
 +powerpc/powerpc64/e6500/fpu
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-Fix-atomic_fetch_xor_release.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-Fix-atomic_fetch_xor_release.patch
deleted file mode 100644
index 7616efa..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-Fix-atomic_fetch_xor_release.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From b671f20cc160238b62894d032a55baf85867106e Mon Sep 17 00:00:00 2001
-From: Catalin Enache <catalin.enache@windriver.com>
-Date: Fri, 30 Jun 2017 19:12:43 +0300
-Subject: [PATCH 6/6] Fix atomic_fetch_xor_release.
-
-No code uses atomic_fetch_xor_release except for the upcoming
-conditional variable rewrite. Therefore there is no user
-visible bug here. The use of atomic_compare_and_exchange_bool_rel
-is removed (since it doesn't exist anymore), and is replaced
-by atomic_compare_exchange_weak_release.
-
-We use weak_release because it provides better performance in
-the loop (the weak semantic) and because the xor is release MO
-(the release semantic). We don't reload expected in the loop
-because atomic_compare_and_exchange_weak_release does this for
-us as part of the CAS failure.
-
-It is otherwise a fairly plain conversion that fixes building
-the new condvar for 32-bit x86. Passes all regression tests
-for x86.
-
-Upstream-Status: Backport
-
-Author: Carlos O'Donell <carlos@systemhalted.org>
-Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
----
- ChangeLog        |  6 ++++++
- include/atomic.h | 19 +++++++++++--------
- 2 files changed, 17 insertions(+), 8 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 44c518b..893262d 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,9 @@
-+2016-10-26  Carlos O'Donell  <carlos@redhat.com>
-+
-+	* include/atomic.h
-+	[USE_COMPILER_ATOMIC_BUILTINS && !atomic_fetch_xor_release]
-+	(atomic_fetch_xor_release): Use	atomic_compare_exchange_weak_release.
-+
- 2017-04-04  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
- 
- 	* nptl/pthreadP.h (USE_REQUEUE_PI): Remove ununsed macro.
-diff --git a/include/atomic.h b/include/atomic.h
-index 5a8e7e7..c8b4664 100644
---- a/include/atomic.h
-+++ b/include/atomic.h
-@@ -777,18 +777,21 @@ void __atomic_link_error (void);
- # endif
- 
- # ifndef atomic_fetch_xor_release
-+/* Failing the atomic_compare_exchange_weak_release reloads the value in
-+   __atg104_expected, so we need only do the XOR again and retry.  */
- # define atomic_fetch_xor_release(mem, operand) \
--  ({ __typeof (*(mem)) __atg104_old;					      \
--     __typeof (mem) __atg104_memp = (mem);				      \
-+  ({ __typeof (mem) __atg104_memp = (mem);				      \
-+     __typeof (*(mem)) __atg104_expected = (*__atg104_memp);		      \
-+     __typeof (*(mem)) __atg104_desired;				      \
-      __typeof (*(mem)) __atg104_op = (operand);				      \
- 									      \
-      do									      \
--       __atg104_old = (*__atg104_memp);					      \
--     while (__builtin_expect						      \
--	    (atomic_compare_and_exchange_bool_rel (			      \
--		__atg104_memp, __atg104_old ^ __atg104_op, __atg104_old), 0));\
--									      \
--     __atg104_old; })
-+       __atg104_desired = __atg104_expected ^ __atg104_op;		      \
-+     while (__glibc_unlikely						      \
-+	    (atomic_compare_exchange_weak_release (			      \
-+	       __atg104_memp, &__atg104_expected, __atg104_desired)	      \
-+	     == 0));							      \
-+     __atg104_expected; })
- #endif
- 
- #endif /* !USE_ATOMIC_COMPILER_BUILTINS  */
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
index f267f66..9088d29 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
@@ -1,7 +1,7 @@
-From bb065b78e9e0d3301e64a26e37550a657c885ebc Mon Sep 17 00:00:00 2001
+From 520cb9e746af637cf01fea385b7f4ee4aadbdfdd Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:11:22 +0000
-Subject: [PATCH 06/25] readlib: Add OECORE_KNOWN_INTERPRETER_NAMES to known
+Subject: [PATCH 06/26] readlib: Add OECORE_KNOWN_INTERPRETER_NAMES to known
  names
 
 This bolts in a hook for OE to pass its own version of interpreter
@@ -29,5 +29,5 @@
  
  static struct known_names known_libs[] =
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
index 612e892..f33defe 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
@@ -1,7 +1,7 @@
-From 4a91bbdb11a15f93094695bba4e0849c421fad48 Mon Sep 17 00:00:00 2001
+From 64130262787d54e2e6695ae4ed8783bfec14ffef Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:15:07 +0000
-Subject: [PATCH 07/25] ppc/sqrt: Fix undefined reference to `__sqrt_finite'
+Subject: [PATCH 07/26] ppc/sqrt: Fix undefined reference to `__sqrt_finite'
 
 on ppc fixes the errors like below
 | ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite'
@@ -204,5 +204,5 @@
  }
 +strong_alias (__ieee754_sqrtf, __sqrtf_finite)
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
index 9e222b7..26f65c5 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
@@ -1,7 +1,7 @@
-From ce2746a1560b4430d89d114e1b65c7be225b4c2a Mon Sep 17 00:00:00 2001
+From 5afb0147e3e49c3b474404524014efe51b2bca5a Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:16:38 +0000
-Subject: [PATCH 08/25] __ieee754_sqrt{,f} are now inline functions and call
+Subject: [PATCH 08/26] __ieee754_sqrt{,f} are now inline functions and call
  out __slow versions
 
 Upstream-Status: Pending
@@ -383,5 +383,5 @@
 +
  strong_alias (__ieee754_sqrtf, __sqrtf_finite)
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
index 7aa74df..d416acd 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
@@ -1,7 +1,7 @@
-From 1b61649e545de76dd79a5e2c39bb16d0c4623160 Mon Sep 17 00:00:00 2001
+From ddd51bb4e005432cb3c0f8f33822954408a9fee1 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:20:09 +0000
-Subject: [PATCH 09/25] Quote from bug 1443 which explains what the patch does
+Subject: [PATCH 09/26] Quote from bug 1443 which explains what the patch does
  :
 
   We build some random program and link it with -lust.  When we run it,
@@ -58,5 +58,5 @@
  
  	case R_ARM_TLS_TPOFF32:
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
index 14963a3..276f1fa 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
@@ -1,7 +1,7 @@
-From 91af416408b8718b004c83d93a6daa1f34cba48d Mon Sep 17 00:00:00 2001
+From d7e74670825330f5421a55f5aa2a1ce6fda7d7fb Mon Sep 17 00:00:00 2001
 From: Ting Liu <b28495@freescale.com>
 Date: Wed, 19 Dec 2012 04:39:57 -0600
-Subject: [PATCH 10/25] eglibc: run libm-err-tab.pl with specific dirs in ${S}
+Subject: [PATCH 10/26] eglibc: run libm-err-tab.pl with specific dirs in ${S}
 
 libm-err-tab.pl will parse all the files named "libm-test-ulps"
 in the given dir recursively. To avoid parsing the one in
@@ -32,5 +32,5 @@
  	touch $@
  
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
index e92d04c..096dab5 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
@@ -1,7 +1,7 @@
-From 6a71f688471fe0c85f8ad9afc4ee0723a20aae1d Mon Sep 17 00:00:00 2001
+From d6e2076571263e45c48889896d3d94ff576df2be Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:24:46 +0000
-Subject: [PATCH 11/25] __ieee754_sqrt{,f} are now inline functions and call
+Subject: [PATCH 11/26] __ieee754_sqrt{,f} are now inline functions and call
  out __slow versions
 
 Upstream-Status: Pending
@@ -57,5 +57,5 @@
  #endif
  {
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch
index 4cba03f..7728c61 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch
@@ -1,7 +1,7 @@
-From f9d024edb158659e403b51cc9d93da9bca6e5d7b Mon Sep 17 00:00:00 2001
+From c0974c746e026650bef5d1940eb3f519765c77af Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:25:45 +0000
-Subject: [PATCH 12/25] Make ld --version output matching grok gold's output
+Subject: [PATCH 12/26] Make ld --version output matching grok gold's output
 
 adapted from from upstream branch roland/gold-vs-libc
 
@@ -14,10 +14,10 @@
  2 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/configure b/configure
-index 8fe5937..7888a3f 100755
+index 5cf3230..391f29d 100755
 --- a/configure
 +++ b/configure
-@@ -4482,7 +4482,7 @@ else
+@@ -4555,7 +4555,7 @@ else
    # Found it, now check the version.
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $LD" >&5
  $as_echo_n "checking version of $LD... " >&6; }
@@ -27,10 +27,10 @@
      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
      2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
 diff --git a/configure.ac b/configure.ac
-index 3c766b7..6908a99 100644
+index d719fad..5b5877c 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -944,7 +944,7 @@ AC_CHECK_PROG_VER(AS, $AS, --version,
+@@ -990,7 +990,7 @@ AC_CHECK_PROG_VER(AS, $AS, --version,
  		  [2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
  		  AS=: critic_missing="$critic_missing as")
  AC_CHECK_PROG_VER(LD, $LD, --version,
@@ -40,5 +40,5 @@
  		  LD=: critic_missing="$critic_missing ld")
  
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
index 6a82f8d..1c81c72 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
@@ -1,7 +1,7 @@
-From 2ece12093c8ba4cf688d235f35d36f1feb02324c Mon Sep 17 00:00:00 2001
+From 2a12eadfd7940b6b0913de8e95d851254cce7953 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:27:10 +0000
-Subject: [PATCH 13/25] sysdeps/gnu/configure.ac: handle correctly
+Subject: [PATCH 13/26] sysdeps/gnu/configure.ac: handle correctly
  $libc_cv_rootsbindir
 
 Upstream-Status:Pending
@@ -38,5 +38,5 @@
    ;;
  esac
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch
index d14a6d4..b23e104 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch
@@ -1,7 +1,7 @@
-From 9fec083dc99d2b524090e1d098e03709eed64a72 Mon Sep 17 00:00:00 2001
+From ec4f7763b30603b7ba0b70bd7750e34d442821b3 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:28:41 +0000
-Subject: [PATCH 14/25] Add unused attribute
+Subject: [PATCH 14/26] Add unused attribute
 
 Helps in avoiding gcc warning when header is is included in
 a source file which does not use both functions
@@ -30,5 +30,5 @@
  {
    int slash_count = 0;
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch
index 8ceccec..98d425a 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch
@@ -1,7 +1,7 @@
-From 1794a97cba0b09b726eebc565c783c7b7c22dfba Mon Sep 17 00:00:00 2001
+From 18d64951cbb68d8d75e8ef347cbd0e0a5c14604b Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:31:06 +0000
-Subject: [PATCH 15/25] 'yes' within the path sets wrong config variables
+Subject: [PATCH 15/26] 'yes' within the path sets wrong config variables
 
 It seems that the 'AC_EGREP_CPP(yes...' example is quite popular
 but being such a short word to grep it is likely to produce
@@ -259,5 +259,5 @@
      ], libc_cv_ppc64_def_call_elf=yes, libc_cv_ppc64_def_call_elf=no)])
    if test $libc_cv_ppc64_def_call_elf = no; then
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
index e5b5083..426a2c0 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
@@ -1,7 +1,7 @@
-From fdb5c9c88e3d1bc5ae6ef9ebcfcf560d3c42f0a6 Mon Sep 17 00:00:00 2001
+From 2bed515b9f9f613ae0db9b9607d8fa60a4afca5b Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:33:03 +0000
-Subject: [PATCH 16/25] timezone: re-written tzselect as posix sh
+Subject: [PATCH 16/26] timezone: re-written tzselect as posix sh
 
 To avoid the bash dependency.
 
@@ -41,5 +41,5 @@
  # Output one argument as-is to standard output.
  # Safer than 'echo', which can mishandle '\' or leading '-'.
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch
index c8da05d..6c2506c 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch
@@ -1,7 +1,7 @@
-From 88ad88d014a5ee68b0e044d2def5ab13743c8ae0 Mon Sep 17 00:00:00 2001
+From c8814875b362efbfd778345d0d2777478bf11a30 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Thu, 31 Dec 2015 14:33:02 -0800
-Subject: [PATCH 17/25] Remove bash dependency for nscd init script
+Subject: [PATCH 17/26] Remove bash dependency for nscd init script
 
 The nscd init script uses #! /bin/bash but only really uses one bashism
 (translated strings), so remove them and switch the shell to #!/bin/sh.
@@ -9,8 +9,6 @@
 Signed-off-by: Ross Burton <ross.burton@intel.com>
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
-Upstream-Status: Pending
-
  nscd/nscd.init | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)
 
@@ -71,5 +69,5 @@
  	;;
  esac
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
index 1750765..2ec01f0 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
@@ -1,7 +1,7 @@
-From 49c0ad7dc2e02e808ed150296a109b586c34115a Mon Sep 17 00:00:00 2001
+From df96d6b61bb60f13cd3d4989d1afc56d705f4a33 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:42:58 +0000
-Subject: [PATCH 18/25] eglibc: Cross building and testing instructions
+Subject: [PATCH 18/26] eglibc: Cross building and testing instructions
 
 Ported from eglibc
 Upstream-Status: Pending
@@ -615,5 +615,5 @@
 +  simply place copies of these libraries in the top GLIBC build
 +  directory.
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch
index f983d86..f5921bb 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch
@@ -1,7 +1,7 @@
-From e881face7a10354612bf634b44e09e3bc6462c67 Mon Sep 17 00:00:00 2001
+From 2cb7e3cae4020f431d426ad1740bb25506cde899 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:49:28 +0000
-Subject: [PATCH 19/25] eglibc: Help bootstrap cross toolchain
+Subject: [PATCH 19/26] eglibc: Help bootstrap cross toolchain
 
 Taken from EGLIBC, r1484 + r1525
 
@@ -29,10 +29,10 @@
  create mode 100644 include/stubs-bootstrap.h
 
 diff --git a/Makefile b/Makefile
-index 32748b3..6d055ba 100644
+index 1ae3281..26ab7bf 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -69,9 +69,18 @@ subdir-dirs = include
+@@ -70,9 +70,18 @@ subdir-dirs = include
  vpath %.h $(subdir-dirs)
  
  # What to install.
@@ -52,7 +52,7 @@
  ifeq (yes,$(build-shared))
  headers += gnu/lib-names.h
  endif
-@@ -151,6 +160,16 @@ others: $(common-objpfx)testrun.sh
+@@ -152,6 +161,16 @@ others: $(common-objpfx)testrun.sh
  
  subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
  
@@ -69,7 +69,7 @@
  ifndef abi-variants
  installed-stubs = $(inst_includedir)/gnu/stubs.h
  else
-@@ -177,6 +196,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force)
+@@ -178,6 +197,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force)
  
  install-others-nosubdir: $(installed-stubs)
  endif
@@ -96,5 +96,5 @@
 +   EGLIBC subdir 'stubs' make targets, on every .o file in EGLIBC, but
 +   an empty stubs.h like this will do fine for GCC.  */
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0020-eglibc-cherry-picked-from.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0020-eglibc-cherry-picked-from.patch
index 30c4c69..4344573 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0020-eglibc-cherry-picked-from.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0020-eglibc-cherry-picked-from.patch
@@ -1,7 +1,7 @@
-From 723a31d3e2627211b39fbcc08f75b3c23c4096c5 Mon Sep 17 00:00:00 2001
+From b2ed906ec864583b43379ef9ad2b5630c1232565 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Thu, 31 Dec 2015 15:10:33 -0800
-Subject: [PATCH 20/25] eglibc: cherry-picked from
+Subject: [PATCH 20/26] eglibc: cherry-picked from
 
 http://www.eglibc.org/archives/patches/msg00772.html
 
@@ -60,5 +60,5 @@
  			if (resp->nscount > 0)
  				__res_iclose (resp, true);
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0021-eglibc-Clear-cache-lines-on-ppc8xx.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0021-eglibc-Clear-cache-lines-on-ppc8xx.patch
index 8931c9e..a9a7391 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0021-eglibc-Clear-cache-lines-on-ppc8xx.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0021-eglibc-Clear-cache-lines-on-ppc8xx.patch
@@ -1,7 +1,7 @@
-From 9699873820d0347c2f377f0d86bce615d87a5e47 Mon Sep 17 00:00:00 2001
+From 000ab518aa1269714bc0a9a4633b0a538fae91d9 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Thu, 31 Dec 2015 15:15:09 -0800
-Subject: [PATCH 21/25] eglibc: Clear cache lines on ppc8xx
+Subject: [PATCH 21/26] eglibc: Clear cache lines on ppc8xx
 
 2007-06-13  Nathan Sidwell  <nathan@codesourcery.com>
             Mark Shinwell  <shinwell@codesourcery.com>
@@ -79,5 +79,5 @@
  	break;
  #ifndef SHARED
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch
index f53f5ff..c0cd5b0 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch
@@ -1,7 +1,7 @@
-From 8904f4249c930d187e19c7e9d3e73c835d11e18f Mon Sep 17 00:00:00 2001
+From a50c6e80543fb4cbc589978c11fe846bf4a94492 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 00:55:53 +0000
-Subject: [PATCH 22/25] eglibc: Resolve __fpscr_values on SH4
+Subject: [PATCH 22/26] eglibc: Resolve __fpscr_values on SH4
 
 2010-09-29  Nobuhiro Iwamatsu  <iwamatsu@nigauri.org>
             Andrew Stubbs  <ams@codesourcery.com>
@@ -52,5 +52,5 @@
 +weak_alias (___fpscr_values, __fpscr_values)
 +
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0023-eglibc-Install-PIC-archives.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0023-eglibc-Install-PIC-archives.patch
index f985f3c..c3e571f 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0023-eglibc-Install-PIC-archives.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0023-eglibc-Install-PIC-archives.patch
@@ -1,7 +1,7 @@
-From 1947f211fab4001e84bb52868cddbd401e597889 Mon Sep 17 00:00:00 2001
+From 101568daf48d99e71b280a2fdd85460fe740d583 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 01:57:01 +0000
-Subject: [PATCH 23/25] eglibc: Install PIC archives
+Subject: [PATCH 23/26] eglibc: Install PIC archives
 
 Forward port from eglibc
 
@@ -29,10 +29,10 @@
  1 file changed, 40 insertions(+), 2 deletions(-)
 
 diff --git a/Makerules b/Makerules
-index 53eabfa..1cd2a53 100644
+index 61a0240..373e628 100644
 --- a/Makerules
 +++ b/Makerules
-@@ -694,6 +694,9 @@ ifeq ($(build-shared),yes)
+@@ -762,6 +762,9 @@ ifeq ($(build-shared),yes)
  $(common-objpfx)libc.so: $(common-objpfx)libc.map
  endif
  common-generated += libc.so libc_pic.os
@@ -42,7 +42,7 @@
  ifdef libc.so-version
  $(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so
  	$(make-link)
-@@ -936,6 +939,7 @@ endif
+@@ -1004,6 +1007,7 @@ endif
  
  install: check-install-supported
  
@@ -50,7 +50,7 @@
  install: $(installed-libcs)
  $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
  	$(make-target-directory)
-@@ -964,6 +968,22 @@ versioned := $(strip $(foreach so,$(install-lib.so),\
+@@ -1032,6 +1036,22 @@ versioned := $(strip $(foreach so,$(install-lib.so),\
  install-lib.so-versioned := $(filter $(versioned), $(install-lib.so))
  install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so))
  
@@ -73,7 +73,7 @@
  # For versioned libraries, we install three files:
  #	$(inst_libdir)/libfoo.so	-- for linking, symlink or ld script
  #	$(inst_slibdir)/libfoo.so.NN	-- for loading by SONAME, symlink
-@@ -1206,9 +1226,22 @@ $(addprefix $(inst_includedir)/,$(headers-nonh)): $(inst_includedir)/%: \
+@@ -1275,9 +1295,22 @@ $(addprefix $(inst_includedir)/,$(headers-nonh)): $(inst_includedir)/%: \
  endif	# headers-nonh
  endif	# headers
  
@@ -97,7 +97,7 @@
  install-bin-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin))
  install-bin-script-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin-script))
  install-rootsbin-nosubdir: \
-@@ -1221,6 +1254,10 @@ install-data-nosubdir: $(addprefix $(inst_datadir)/,$(install-data))
+@@ -1290,6 +1323,10 @@ install-data-nosubdir: $(addprefix $(inst_datadir)/,$(install-data))
  install-headers-nosubdir: $(addprefix $(inst_includedir)/,$(headers))
  install-others-nosubdir: $(install-others)
  install-others-programs-nosubdir: $(install-others-programs)
@@ -108,7 +108,7 @@
  
  # We need all the `-nosubdir' targets so that `install' in the parent
  # doesn't depend on several things which each iterate over the subdirs.
-@@ -1230,7 +1267,8 @@ install-%:: install-%-nosubdir ;
+@@ -1299,7 +1336,8 @@ install-%:: install-%-nosubdir ;
  
  .PHONY: install install-no-libc.a-nosubdir
  install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir \
@@ -119,5 +119,5 @@
  install-no-libc.a-nosubdir: install-bin-nosubdir install-bin-script-nosubdir \
  			    install-rootsbin-nosubdir install-sbin-nosubdir \
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-cross-locale-generation-support.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-cross-locale-generation-support.patch
index c45b557..3399890 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-cross-locale-generation-support.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-cross-locale-generation-support.patch
@@ -1,7 +1,7 @@
-From 11d7633178301add26a24657e2f1596a2f7dddce Mon Sep 17 00:00:00 2001
+From 82516e3ed372f618c886a2de4f9498f597aa8a8b Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 18 Mar 2015 01:33:49 +0000
-Subject: [PATCH 24/25] eglibc: Forward port cross locale generation support
+Subject: [PATCH 24/26] eglibc: Forward port cross locale generation support
 
 Upstream-Status: Pending
 
@@ -91,7 +91,7 @@
 +    [LC_ALL] = sizeof ("LC_ALL") - 1
 +  };
 diff --git a/locale/localeinfo.h b/locale/localeinfo.h
-index 94627f3..d0db77b 100644
+index 1f4da92..7f68935 100644
 --- a/locale/localeinfo.h
 +++ b/locale/localeinfo.h
 @@ -224,7 +224,7 @@ __libc_tsd_define (extern, __locale_t, LOCALE)
@@ -363,10 +363,10 @@
    size_t bufmax = 56;
  
 diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
-index 6becd9a..8ddd080 100644
+index b4c48f1..ed08d48 100644
 --- a/locale/programs/localedef.c
 +++ b/locale/programs/localedef.c
-@@ -114,6 +114,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+@@ -108,6 +108,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
  #define OPT_LIST_ARCHIVE 309
  #define OPT_LITTLE_ENDIAN 400
  #define OPT_BIG_ENDIAN 401
@@ -374,7 +374,7 @@
  
  /* Definitions of arguments for argp functions.  */
  static const struct argp_option options[] =
-@@ -150,6 +151,8 @@ static const struct argp_option options[] =
+@@ -143,6 +144,8 @@ static const struct argp_option options[] =
      N_("Generate little-endian output") },
    { "big-endian", OPT_BIG_ENDIAN, NULL, 0,
      N_("Generate big-endian output") },
@@ -383,7 +383,7 @@
    { NULL, 0, NULL, 0, NULL }
  };
  
-@@ -239,12 +242,14 @@ main (int argc, char *argv[])
+@@ -232,12 +235,14 @@ main (int argc, char *argv[])
       ctype locale.  (P1003.2 4.35.5.2)  */
    setlocale (LC_CTYPE, "POSIX");
  
@@ -398,7 +398,7 @@
  
    /* Process charmap file.  */
    charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1);
-@@ -338,6 +343,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
+@@ -328,6 +333,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
      case OPT_BIG_ENDIAN:
        set_big_endian (true);
        break;
@@ -562,5 +562,5 @@
  # define WEAK_POSTLOAD(postload) weak_extern (postload)
  #else
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0025-Define-DUMMY_LOCALE_T-if-not-defined.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0025-Define-DUMMY_LOCALE_T-if-not-defined.patch
index 9d60d02..1f0f5d4 100644
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0025-Define-DUMMY_LOCALE_T-if-not-defined.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0025-Define-DUMMY_LOCALE_T-if-not-defined.patch
@@ -1,7 +1,7 @@
-From 89ec25290d34413ce5c8ba6c378e31dbae3a37c0 Mon Sep 17 00:00:00 2001
+From c2d8cdeab116caacdfedb35eeb3e743b44807bec Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 20 Apr 2016 21:11:00 -0700
-Subject: [PATCH 25/25] Define DUMMY_LOCALE_T if not defined
+Subject: [PATCH 25/26] Define DUMMY_LOCALE_T if not defined
 
 This is a hack to fix building the locale bits on an older
 CentOs 5.X machine
@@ -28,5 +28,5 @@
  #define PACKAGE _libc_intl_domainname
  #ifndef VERSION
 -- 
-2.8.2
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0026-build_local_scope.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0026-build_local_scope.patch
deleted file mode 100644
index 8e0cb83..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0026-build_local_scope.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 6e4ec5a3c5fe63b6458036f18d43124de4a7e724 Mon Sep 17 00:00:00 2001
-From: Mark Hatle <mark.hatle@windriver.com>
-Date: Thu, 18 Aug 2016 14:07:58 -0500
-Subject: [PATCH] elf/dl-deps.c: Make _dl_build_local_scope breadth first
-
-According to the ELF specification:
-
-When resolving symbolic references, the dynamic linker examines the symbol
-tables with a breadth-first search.
-
-This function was using a depth first search.  By doing so the conflict
-resolution reported to the prelinker (when LD_TRACE_PRELINKING=1 is set)
-was incorrect.  This caused problems when their were various circular
-dependencies between libraries.  The problem usually manifested itself by
-the wrong IFUNC being executed.
-
-[BZ# 20488]
-
-Upstream-Status: Submitted [libc-alpha]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
----
- elf/dl-deps.c | 14 ++++++++++----
- 1 file changed, 10 insertions(+), 4 deletions(-)
-
-diff --git a/elf/dl-deps.c b/elf/dl-deps.c
-index 6a82987..fc37c87 100644
---- a/elf/dl-deps.c
-+++ b/elf/dl-deps.c
-@@ -73,13 +73,19 @@ _dl_build_local_scope (struct link_map **list, struct link_map *map)
- {
-   struct link_map **p = list;
-   struct link_map **q;
-+  struct link_map **r;
- 
-   *p++ = map;
-   map->l_reserved = 1;
--  if (map->l_initfini)
--    for (q = map->l_initfini + 1; *q; ++q)
--      if (! (*q)->l_reserved)
--	p += _dl_build_local_scope (p, *q);
-+
-+  for (r = list; r < p; ++r)
-+    if ((*r)->l_initfini)
-+      for (q = (*r)->l_initfini + 1; *q; ++q)
-+	if (! (*q)->l_reserved)
-+	  {
-+	    *p++ = *q;
-+	    (*q)->l_reserved = 1;
-+	  }
-   return p - list;
- }
- 
--- 
-2.5.5
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0026-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0026-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
new file mode 100644
index 0000000..852f530
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0026-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
@@ -0,0 +1,56 @@
+From fb315c197cca61299a6f6588ea3460145c255d06 Mon Sep 17 00:00:00 2001
+From: Mark Hatle <mark.hatle@windriver.com>
+Date: Thu, 18 Aug 2016 14:07:58 -0500
+Subject: [PATCH 26/26] elf/dl-deps.c: Make _dl_build_local_scope breadth first
+
+According to the ELF specification:
+
+When resolving symbolic references, the dynamic linker examines the symbol
+tables with a breadth-first search.
+
+This function was using a depth first search.  By doing so the conflict
+resolution reported to the prelinker (when LD_TRACE_PRELINKING=1 is set)
+was incorrect.  This caused problems when their were various circular
+dependencies between libraries.  The problem usually manifested itself by
+the wrong IFUNC being executed.
+
+[BZ# 20488]
+
+Upstream-Status: Submitted [libc-alpha]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+ elf/dl-deps.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/elf/dl-deps.c b/elf/dl-deps.c
+index 6a82987..53be824 100644
+--- a/elf/dl-deps.c
++++ b/elf/dl-deps.c
+@@ -73,13 +73,19 @@ _dl_build_local_scope (struct link_map **list, struct link_map *map)
+ {
+   struct link_map **p = list;
+   struct link_map **q;
++  struct link_map **r;
+ 
+   *p++ = map;
+   map->l_reserved = 1;
+-  if (map->l_initfini)
+-    for (q = map->l_initfini + 1; *q; ++q)
+-      if (! (*q)->l_reserved)
+-	p += _dl_build_local_scope (p, *q);
++
++  for (r = list; r < p; ++r)
++    if ((*r)->l_initfini)
++      for (q = (*r)->l_initfini + 1; *q; ++q)
++	if (! (*q)->l_reserved)
++	  {
++	    *p++ = *q;
++	    (*q)->l_reserved = 1;
++	  }
+   return p - list;
+ }
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0027-locale-fix-hard-coded-reference-to-gcc-E.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0027-locale-fix-hard-coded-reference-to-gcc-E.patch
new file mode 100644
index 0000000..71c0bdc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0027-locale-fix-hard-coded-reference-to-gcc-E.patch
@@ -0,0 +1,38 @@
+From a2fc86cb8d0366171f100ebd033aeb9609fa40de Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= <jeremy.rosen@smile.fr>
+Date: Mon, 22 Aug 2016 16:09:25 +0200
+Subject: [PATCH 27/27] locale: fix hard-coded reference to gcc -E
+
+When new version of compilers are published, they may not be compatible with
+older versions of software. This is particularly common when software is built
+with -Werror.
+
+Autotools provides a way for a user to specify the name of his compiler using a
+set of variables ($CC $CXX $CPP etc.). Those variables are used correctly when
+compiling glibc but the script used to generate transliterations in the locale/
+subdirectory directly calls the gcc binary to get the output of the
+preprocessor instead of using the $CPP variable provided by the build
+environment.
+
+This patch replaces the hard-coded reference to the gcc binary with the proper
+environment variable, thus allowing a user to override it.
+
+Upstream-Status : Submitted [https://sourceware.org/ml/libc-alpha/2016-08/msg00746.html]
+---
+ locale/gen-translit.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl
+index 30d3f2f..e976530 100644
+--- a/locale/gen-translit.pl
++++ b/locale/gen-translit.pl
+@@ -1,5 +1,5 @@
+ #!/usr/bin/perl -w
+-open F, "cat C-translit.h.in | gcc -E - |" || die "Cannot preprocess input file";
++open F, 'cat C-translit.h.in | ${CPP:-gcc -E} - |' || die "Cannot preprocess input file";
+ 
+ 
+ sub cstrlen {
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch
deleted file mode 100644
index 66f1fcd..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch
+++ /dev/null
@@ -1,668 +0,0 @@
-From e7ba24f05d86acf7072e066ea6d7b235a106688c Mon Sep 17 00:00:00 2001
-From: Carlos O'Donell <carlos@redhat.com>
-Date: Sat, 28 Jan 2017 19:13:34 -0500
-Subject: [PATCH] Bug 20116: Fix use after free in pthread_create()
-
-The commit documents the ownership rules around 'struct pthread' and
-when a thread can read or write to the descriptor. With those ownership
-rules in place it becomes obvious that pd->stopped_start should not be
-touched in several of the paths during thread startup, particularly so
-for detached threads. In the case of detached threads, between the time
-the thread is created by the OS kernel and the creating thread checks
-pd->stopped_start, the detached thread might have already exited and the
-memory for pd unmapped. As a regression test we add a simple test which
-exercises this exact case by quickly creating detached threads with
-large enough stacks to ensure the thread stack cache is bypassed and the
-stacks are unmapped. Before the fix the testcase segfaults, after the
-fix it works correctly and completes without issue.
-
-For a detailed discussion see:
-https://www.sourceware.org/ml/libc-alpha/2017-01/msg00505.html
-
-(cherry-picked from commit f8bf15febcaf137bbec5a61101e88cd5a9d56ca8)
-
-Upstream-Status: Backport [master]
-Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
----
- ChangeLog                              |  23 ++++
- nptl/Makefile                          |   3 +-
- nptl/createthread.c                    |  10 +-
- nptl/pthread_create.c                  | 207 +++++++++++++++++++++++++++------
- nptl/pthread_getschedparam.c           |   1 +
- nptl/pthread_setschedparam.c           |   1 +
- nptl/pthread_setschedprio.c            |   1 +
- nptl/tpp.c                             |   2 +
- nptl/tst-create-detached.c             | 137 ++++++++++++++++++++++
- sysdeps/nacl/createthread.c            |  10 +-
- sysdeps/unix/sysv/linux/createthread.c |  16 ++-
- 11 files changed, 356 insertions(+), 55 deletions(-)
- create mode 100644 nptl/tst-create-detached.c
-
-diff --git a/ChangeLog b/ChangeLog
-index 84ae7a7af8..0fbda9020e 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,26 @@
-+2016-01-28  Carlos O'Donell  <carlos@redhat.com>
-+	    Alexey Makhalov <amakhalov@vmware.com>
-+	    Florian Weimer <fweimer@redhat.com>
-+
-+	[BZ #20116]
-+	* nptl/pthread_create.c: Document concurrency notes.
-+	Enhance thread creation notes.
-+	(create_thread): Use bool *stopped_start.
-+	(START_THREAD_DEFN): Comment ownership of PD.
-+	(__pthread_create_2_1): Add local bool stopped_start and use
-+	that instead of pd->stopped_start where appropriate.
-+	* nptl/createthread.c (create_thread): Use bool *stopped_start.
-+	* sysdeps/nacl/createthread.c (create_thread): Use bool *stopped_start.
-+	* sysdeps/unix/sysv/linux/createthread.c (create_thread): Likewise.
-+	* nptl/tst-create-detached.c: New file.
-+	* nptl/Makefile (tests): Add tst-create-detached.
-+	* nptl/pthread_getschedparam.c (__pthread_getschedparam):
-+	Reference the enhanced thread creation notes.
-+	* nptl/pthread_setschedparam.c (__pthread_setschedparam): Likewise.
-+	* nptl/pthread_setschedprio.c (pthread_setschedprio): Likewise.
-+	* nptl/tpp.c (__pthread_tpp_change_priority): Likewise.
-+	(__pthread_current_priority): Likewise.
-+
- 2016-08-04  Carlos O'Donell  <carlos@redhat.com>
- 
- 	* po/de.po: Update from Translation Project.
-diff --git a/nptl/Makefile b/nptl/Makefile
-index 0d8aadebed..7dec4edb53 100644
---- a/nptl/Makefile
-+++ b/nptl/Makefile
-@@ -290,7 +290,8 @@ tests = tst-typesizes \
- 	tst-initializers1 $(addprefix tst-initializers1-,\
- 			    c89 gnu89 c99 gnu99 c11 gnu11) \
- 	tst-bad-schedattr \
--	tst-thread_local1 tst-mutex-errorcheck tst-robust10
-+	tst-thread_local1 tst-mutex-errorcheck tst-robust10 \
-+	tst-create-detached \
- xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
- 	tst-mutexpp1 tst-mutexpp6 tst-mutexpp10
- test-srcs = tst-oddstacklimit
-diff --git a/nptl/createthread.c b/nptl/createthread.c
-index ba2f9c7167..328f85865d 100644
---- a/nptl/createthread.c
-+++ b/nptl/createthread.c
-@@ -25,16 +25,14 @@
- 
- static int
- create_thread (struct pthread *pd, const struct pthread_attr *attr,
--	       bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
-+	       bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
- {
-   /* If the implementation needs to do some tweaks to the thread after
-      it has been created at the OS level, it can set STOPPED_START here.  */
- 
--  pd->stopped_start = stopped_start;
--  if (__glibc_unlikely (stopped_start))
--    /* We make sure the thread does not run far by forcing it to get a
--       lock.  We lock it here too so that the new thread cannot continue
--       until we tell it to.  */
-+  pd->stopped_start = *stopped_start;
-+  if (__glibc_unlikely (*stopped_start))
-+    /* See CONCURRENCY NOTES in nptl/pthread_create.c.  */
-     lll_lock (pd->lock, LLL_PRIVATE);
- 
-   return ENOSYS;
-diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
-index a834063ad5..44b17bec86 100644
---- a/nptl/pthread_create.c
-+++ b/nptl/pthread_create.c
-@@ -54,25 +54,141 @@ unsigned int __nptl_nthreads = 1;
- /* Code to allocate and deallocate a stack.  */
- #include "allocatestack.c"
- 
--/* createthread.c defines this function, and two macros:
-+/* CONCURRENCY NOTES:
-+
-+   Understanding who is the owner of the 'struct pthread' or 'PD'
-+   (refers to the value of the 'struct pthread *pd' function argument)
-+   is critically important in determining exactly which operations are
-+   allowed and which are not and when, particularly when it comes to the
-+   implementation of pthread_create, pthread_join, pthread_detach, and
-+   other functions which all operate on PD.
-+
-+   The owner of PD is responsible for freeing the final resources
-+   associated with PD, and may examine the memory underlying PD at any
-+   point in time until it frees it back to the OS or to reuse by the
-+   runtime.
-+
-+   The thread which calls pthread_create is called the creating thread.
-+   The creating thread begins as the owner of PD.
-+
-+   During startup the new thread may examine PD in coordination with the
-+   owner thread (which may be itself).
-+
-+   The four cases of ownership transfer are:
-+
-+   (1) Ownership of PD is released to the process (all threads may use it)
-+       after the new thread starts in a joinable state
-+       i.e. pthread_create returns a usable pthread_t.
-+
-+   (2) Ownership of PD is released to the new thread starting in a detached
-+       state.
-+
-+   (3) Ownership of PD is dynamically released to a running thread via
-+       pthread_detach.
-+
-+   (4) Ownership of PD is acquired by the thread which calls pthread_join.
-+
-+   Implementation notes:
-+
-+   The PD->stopped_start and thread_ran variables are used to determine
-+   exactly which of the four ownership states we are in and therefore
-+   what actions can be taken.  For example after (2) we cannot read or
-+   write from PD anymore since the thread may no longer exist and the
-+   memory may be unmapped.  The most complicated cases happen during
-+   thread startup:
-+
-+   (a) If the created thread is in a detached (PTHREAD_CREATE_DETACHED),
-+       or joinable (default PTHREAD_CREATE_JOINABLE) state and
-+       STOPPED_START is true, then the creating thread has ownership of
-+       PD until the PD->lock is released by pthread_create.  If any
-+       errors occur we are in states (c), (d), or (e) below.
-+
-+   (b) If the created thread is in a detached state
-+       (PTHREAD_CREATED_DETACHED), and STOPPED_START is false, then the
-+       creating thread has ownership of PD until it invokes the OS
-+       kernel's thread creation routine.  If this routine returns
-+       without error, then the created thread owns PD; otherwise, see
-+       (c) and (e) below.
-+
-+   (c) If the detached thread setup failed and THREAD_RAN is true, then
-+       the creating thread releases ownership to the new thread by
-+       sending a cancellation signal.  All threads set THREAD_RAN to
-+       true as quickly as possible after returning from the OS kernel's
-+       thread creation routine.
-+
-+   (d) If the joinable thread setup failed and THREAD_RAN is true, then
-+       then the creating thread retains ownership of PD and must cleanup
-+       state.  Ownership cannot be released to the process via the
-+       return of pthread_create since a non-zero result entails PD is
-+       undefined and therefore cannot be joined to free the resources.
-+       We privately call pthread_join on the thread to finish handling
-+       the resource shutdown (Or at least we should, see bug 19511).
-+
-+   (e) If the thread creation failed and THREAD_RAN is false, then the
-+       creating thread retains ownership of PD and must cleanup state.
-+       No waiting for the new thread is required because it never
-+       started.
-+
-+   The nptl_db interface:
-+
-+   The interface with nptl_db requires that we enqueue PD into a linked
-+   list and then call a function which the debugger will trap.  The PD
-+   will then be dequeued and control returned to the thread.  The caller
-+   at the time must have ownership of PD and such ownership remains
-+   after control returns to thread. The enqueued PD is removed from the
-+   linked list by the nptl_db callback td_thr_event_getmsg.  The debugger
-+   must ensure that the thread does not resume execution, otherwise
-+   ownership of PD may be lost and examining PD will not be possible.
-+
-+   Note that the GNU Debugger as of (December 10th 2015) commit
-+   c2c2a31fdb228d41ce3db62b268efea04bd39c18 no longer uses
-+   td_thr_event_getmsg and several other related nptl_db interfaces. The
-+   principal reason for this is that nptl_db does not support non-stop
-+   mode where other threads can run concurrently and modify runtime
-+   structures currently in use by the debugger and the nptl_db
-+   interface.
-+
-+   Axioms:
-+
-+   * The create_thread function can never set stopped_start to false.
-+   * The created thread can read stopped_start but never write to it.
-+   * The variable thread_ran is set some time after the OS thread
-+     creation routine returns, how much time after the thread is created
-+     is unspecified, but it should be as quickly as possible.
-+
-+*/
-+
-+/* CREATE THREAD NOTES:
-+
-+   createthread.c defines the create_thread function, and two macros:
-    START_THREAD_DEFN and START_THREAD_SELF (see below).
- 
--   create_thread is obliged to initialize PD->stopped_start.  It
--   should be true if the STOPPED_START parameter is true, or if
--   create_thread needs the new thread to synchronize at startup for
--   some other implementation reason.  If PD->stopped_start will be
--   true, then create_thread is obliged to perform the operation
--   "lll_lock (PD->lock, LLL_PRIVATE)" before starting the thread.
-+   create_thread must initialize PD->stopped_start.  It should be true
-+   if the STOPPED_START parameter is true, or if create_thread needs the
-+   new thread to synchronize at startup for some other implementation
-+   reason.  If STOPPED_START will be true, then create_thread is obliged
-+   to lock PD->lock before starting the thread.  Then pthread_create
-+   unlocks PD->lock which synchronizes-with START_THREAD_DEFN in the
-+   child thread which does an acquire/release of PD->lock as the last
-+   action before calling the user entry point.  The goal of all of this
-+   is to ensure that the required initial thread attributes are applied
-+   (by the creating thread) before the new thread runs user code.  Note
-+   that the the functions pthread_getschedparam, pthread_setschedparam,
-+   pthread_setschedprio, __pthread_tpp_change_priority, and
-+   __pthread_current_priority reuse the same lock, PD->lock, for a
-+   similar purpose e.g. synchronizing the setting of similar thread
-+   attributes.  These functions are never called before the thread is
-+   created, so don't participate in startup syncronization, but given
-+   that the lock is present already and in the unlocked state, reusing
-+   it saves space.
- 
-    The return value is zero for success or an errno code for failure.
-    If the return value is ENOMEM, that will be translated to EAGAIN,
-    so create_thread need not do that.  On failure, *THREAD_RAN should
-    be set to true iff the thread actually started up and then got
--   cancelled before calling user code (*PD->start_routine), in which
--   case it is responsible for doing its own cleanup.  */
--
-+   canceled before calling user code (*PD->start_routine).  */
- static int create_thread (struct pthread *pd, const struct pthread_attr *attr,
--			  bool stopped_start, STACK_VARIABLES_PARMS,
-+			  bool *stopped_start, STACK_VARIABLES_PARMS,
- 			  bool *thread_ran);
- 
- #include <createthread.c>
-@@ -314,12 +430,19 @@ START_THREAD_DEFN
-       /* Store the new cleanup handler info.  */
-       THREAD_SETMEM (pd, cleanup_jmp_buf, &unwind_buf);
- 
-+      /* We are either in (a) or (b), and in either case we either own
-+         PD already (2) or are about to own PD (1), and so our only
-+	 restriction would be that we can't free PD until we know we
-+	 have ownership (see CONCURRENCY NOTES above).  */
-       if (__glibc_unlikely (pd->stopped_start))
- 	{
- 	  int oldtype = CANCEL_ASYNC ();
- 
- 	  /* Get the lock the parent locked to force synchronization.  */
- 	  lll_lock (pd->lock, LLL_PRIVATE);
-+
-+	  /* We have ownership of PD now.  */
-+
- 	  /* And give it up right away.  */
- 	  lll_unlock (pd->lock, LLL_PRIVATE);
- 
-@@ -378,7 +501,8 @@ START_THREAD_DEFN
- 							   pd, pd->nextevent));
- 	    }
- 
--	  /* Now call the function to signal the event.  */
-+	  /* Now call the function which signals the event.  See
-+	     CONCURRENCY NOTES for the nptl_db interface comments.  */
- 	  __nptl_death_event ();
- 	}
-     }
-@@ -642,19 +766,28 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
-      that cares whether the thread count is correct.  */
-   atomic_increment (&__nptl_nthreads);
- 
--  bool thread_ran = false;
-+  /* Our local value of stopped_start and thread_ran can be accessed at
-+     any time. The PD->stopped_start may only be accessed if we have
-+     ownership of PD (see CONCURRENCY NOTES above).  */
-+  bool stopped_start = false; bool thread_ran = false;
- 
-   /* Start the thread.  */
-   if (__glibc_unlikely (report_thread_creation (pd)))
-     {
--      /* Create the thread.  We always create the thread stopped
--	 so that it does not get far before we tell the debugger.  */
--      retval = create_thread (pd, iattr, true, STACK_VARIABLES_ARGS,
--			      &thread_ran);
-+      stopped_start = true;
-+
-+      /* We always create the thread stopped at startup so we can
-+	 notify the debugger.  */
-+      retval = create_thread (pd, iattr, &stopped_start,
-+			      STACK_VARIABLES_ARGS, &thread_ran);
-       if (retval == 0)
- 	{
--	  /* create_thread should have set this so that the logic below can
--	     test it.  */
-+	  /* We retain ownership of PD until (a) (see CONCURRENCY NOTES
-+	     above).  */
-+
-+	  /* Assert stopped_start is true in both our local copy and the
-+	     PD copy.  */
-+	  assert (stopped_start);
- 	  assert (pd->stopped_start);
- 
- 	  /* Now fill in the information about the new thread in
-@@ -671,26 +804,30 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
- 						       pd, pd->nextevent)
- 		 != 0);
- 
--	  /* Now call the function which signals the event.  */
-+	  /* Now call the function which signals the event.  See
-+	     CONCURRENCY NOTES for the nptl_db interface comments.  */
- 	  __nptl_create_event ();
- 	}
-     }
-   else
--    retval = create_thread (pd, iattr, false, STACK_VARIABLES_ARGS,
--			    &thread_ran);
-+    retval = create_thread (pd, iattr, &stopped_start,
-+			    STACK_VARIABLES_ARGS, &thread_ran);
- 
-   if (__glibc_unlikely (retval != 0))
-     {
--      /* If thread creation "failed", that might mean that the thread got
--	 created and ran a little--short of running user code--but then
--	 create_thread cancelled it.  In that case, the thread will do all
--	 its own cleanup just like a normal thread exit after a successful
--	 creation would do.  */
--
-       if (thread_ran)
--	assert (pd->stopped_start);
-+	/* State (c) or (d) and we may not have PD ownership (see
-+	   CONCURRENCY NOTES above).  We can assert that STOPPED_START
-+	   must have been true because thread creation didn't fail, but
-+	   thread attribute setting did.  */
-+	/* See bug 19511 which explains why doing nothing here is a
-+	   resource leak for a joinable thread.  */
-+	assert (stopped_start);
-       else
- 	{
-+	  /* State (e) and we have ownership of PD (see CONCURRENCY
-+	     NOTES above).  */
-+
- 	  /* Oops, we lied for a second.  */
- 	  atomic_decrement (&__nptl_nthreads);
- 
-@@ -710,10 +847,14 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
-     }
-   else
-     {
--      if (pd->stopped_start)
--	/* The thread blocked on this lock either because we're doing TD_CREATE
--	   event reporting, or for some other reason that create_thread chose.
--	   Now let it run free.  */
-+      /* We don't know if we have PD ownership.  Once we check the local
-+         stopped_start we'll know if we're in state (a) or (b) (see
-+	 CONCURRENCY NOTES above).  */
-+      if (stopped_start)
-+	/* State (a), we own PD. The thread blocked on this lock either
-+	   because we're doing TD_CREATE event reporting, or for some
-+	   other reason that create_thread chose.  Now let it run
-+	   free.  */
- 	lll_unlock (pd->lock, LLL_PRIVATE);
- 
-       /* We now have for sure more than one thread.  The main thread might
-diff --git a/nptl/pthread_getschedparam.c b/nptl/pthread_getschedparam.c
-index b887881baf..de71171a08 100644
---- a/nptl/pthread_getschedparam.c
-+++ b/nptl/pthread_getschedparam.c
-@@ -35,6 +35,7 @@ __pthread_getschedparam (pthread_t threadid, int *policy,
- 
-   int result = 0;
- 
-+  /* See CREATE THREAD NOTES in nptl/pthread_create.c.  */
-   lll_lock (pd->lock, LLL_PRIVATE);
- 
-   /* The library is responsible for maintaining the values at all
-diff --git a/nptl/pthread_setschedparam.c b/nptl/pthread_setschedparam.c
-index dfb52b9dbf..dcb520f1c8 100644
---- a/nptl/pthread_setschedparam.c
-+++ b/nptl/pthread_setschedparam.c
-@@ -36,6 +36,7 @@ __pthread_setschedparam (pthread_t threadid, int policy,
- 
-   int result = 0;
- 
-+  /* See CREATE THREAD NOTES in nptl/pthread_create.c.  */
-   lll_lock (pd->lock, LLL_PRIVATE);
- 
-   struct sched_param p;
-diff --git a/nptl/pthread_setschedprio.c b/nptl/pthread_setschedprio.c
-index cefc6481d6..8134b50560 100644
---- a/nptl/pthread_setschedprio.c
-+++ b/nptl/pthread_setschedprio.c
-@@ -38,6 +38,7 @@ pthread_setschedprio (pthread_t threadid, int prio)
-   struct sched_param param;
-   param.sched_priority = prio;
- 
-+  /* See CREATE THREAD NOTES in nptl/pthread_create.c.  */
-   lll_lock (pd->lock, LLL_PRIVATE);
- 
-   /* If the thread should have higher priority because of some
-diff --git a/nptl/tpp.c b/nptl/tpp.c
-index e175bf4d53..223bd6bbee 100644
---- a/nptl/tpp.c
-+++ b/nptl/tpp.c
-@@ -114,6 +114,7 @@ __pthread_tpp_change_priority (int previous_prio, int new_prio)
-   if (priomax == newpriomax)
-     return 0;
- 
-+  /* See CREATE THREAD NOTES in nptl/pthread_create.c.  */
-   lll_lock (self->lock, LLL_PRIVATE);
- 
-   tpp->priomax = newpriomax;
-@@ -165,6 +166,7 @@ __pthread_current_priority (void)
- 
-   int result = 0;
- 
-+  /* See CREATE THREAD NOTES in nptl/pthread_create.c.  */
-   lll_lock (self->lock, LLL_PRIVATE);
- 
-   if ((self->flags & ATTR_FLAG_SCHED_SET) == 0)
-diff --git a/nptl/tst-create-detached.c b/nptl/tst-create-detached.c
-new file mode 100644
-index 0000000000..ea93e441c7
---- /dev/null
-+++ b/nptl/tst-create-detached.c
-@@ -0,0 +1,137 @@
-+/* Bug 20116: Test rapid creation of detached threads.
-+   Copyright (C) 2017 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If
-+   not, see <http://www.gnu.org/licenses/>.  */
-+
-+/* The goal of the test is to trigger a failure if the parent touches
-+   any part of the thread descriptor after the detached thread has
-+   exited.  We test this by creating many detached threads with large
-+   stacks.  The stacks quickly fill the the stack cache and subsequent
-+   threads will start to cause the thread stacks to be immediately
-+   unmapped to satisfy the stack cache max.  With the stacks being
-+   unmapped the parent's read of any part of the thread descriptor will
-+   trigger a segfault.  That segfault is what we are trying to cause,
-+   since any segfault is a defect in the implementation.  */
-+
-+#include <pthread.h>
-+#include <stdio.h>
-+#include <errno.h>
-+#include <unistd.h>
-+#include <stdbool.h>
-+#include <sys/resource.h>
-+#include <support/xthread.h>
-+
-+/* Number of threads to create.  */
-+enum { threads_to_create = 100000 };
-+
-+/* Number of threads which should spawn other threads.  */
-+enum { creator_threads  = 2 };
-+
-+/* Counter of threads created so far.  This is incremented by all the
-+   running creator threads.  */
-+static unsigned threads_created;
-+
-+/* Thread callback which does nothing, so that the thread exits
-+   immediatedly.  */
-+static void *
-+do_nothing (void *arg)
-+{
-+  return NULL;
-+}
-+
-+/* Attribute indicating that the thread should be created in a detached
-+   fashion.  */
-+static pthread_attr_t detached;
-+
-+/* Barrier to synchronize initialization.  */
-+static pthread_barrier_t barrier;
-+
-+static void *
-+creator_thread (void *arg)
-+{
-+  int ret;
-+  xpthread_barrier_wait (&barrier);
-+
-+  while (true)
-+    {
-+      pthread_t thr;
-+      /* Thread creation will fail if the kernel does not free old
-+	 threads quickly enough, so we do not report errors.  */
-+      ret = pthread_create (&thr, &detached, do_nothing, NULL);
-+      if (ret == 0 && __atomic_add_fetch (&threads_created, 1, __ATOMIC_SEQ_CST)
-+          >= threads_to_create)
-+        break;
-+    }
-+
-+  return NULL;
-+}
-+
-+static int
-+do_test (void)
-+{
-+  /* Limit the size of the process, so that memory allocation will
-+     fail without impacting the entire system.  */
-+  {
-+    struct rlimit limit;
-+    if (getrlimit (RLIMIT_AS, &limit) != 0)
-+      {
-+        printf ("FAIL: getrlimit (RLIMIT_AS) failed: %m\n");
-+        return 1;
-+      }
-+    /* This limit, 800MB, is just a heuristic. Any value can be
-+       picked.  */
-+    long target = 800 * 1024 * 1024;
-+    if (limit.rlim_cur == RLIM_INFINITY || limit.rlim_cur > target)
-+      {
-+        limit.rlim_cur = target;
-+        if (setrlimit (RLIMIT_AS, &limit) != 0)
-+          {
-+            printf ("FAIL: setrlimit (RLIMIT_AS) failed: %m\n");
-+            return 1;
-+          }
-+      }
-+  }
-+
-+  xpthread_attr_init (&detached);
-+
-+  xpthread_attr_setdetachstate (&detached, PTHREAD_CREATE_DETACHED);
-+
-+  /* A large thread stack seems beneficial for reproducing a race
-+     condition in detached thread creation.  The goal is to reach the
-+     limit of the runtime thread stack cache such that the detached
-+     thread's stack is unmapped after exit and causes a segfault when
-+     the parent reads the thread descriptor data stored on the the
-+     unmapped stack.  */
-+  xpthread_attr_setstacksize (&detached, 16 * 1024 * 1024);
-+
-+  xpthread_barrier_init (&barrier, NULL, creator_threads);
-+
-+  pthread_t threads[creator_threads];
-+
-+  for (int i = 0; i < creator_threads; ++i)
-+    threads[i] = xpthread_create (NULL, creator_thread, NULL);
-+
-+  for (int i = 0; i < creator_threads; ++i)
-+    xpthread_join (threads[i]);
-+
-+  xpthread_attr_destroy (&detached);
-+
-+  xpthread_barrier_destroy (&barrier);
-+
-+  return 0;
-+}
-+
-+#include <support/test-driver.c>
-diff --git a/sysdeps/nacl/createthread.c b/sysdeps/nacl/createthread.c
-index 7b571c34e2..5465558cc1 100644
---- a/sysdeps/nacl/createthread.c
-+++ b/sysdeps/nacl/createthread.c
-@@ -32,15 +32,13 @@ static void start_thread (void) __attribute__ ((noreturn));
- 
- static int
- create_thread (struct pthread *pd, const struct pthread_attr *attr,
--	       bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
-+	       bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
- {
-   pd->tid = __nacl_get_tid (pd);
- 
--  pd->stopped_start = stopped_start;
--  if (__glibc_unlikely (stopped_start))
--    /* We make sure the thread does not run far by forcing it to get a
--       lock.  We lock it here too so that the new thread cannot continue
--       until we tell it to.  */
-+  pd->stopped_start = *stopped_start;
-+  if (__glibc_unlikely (*stopped_start))
-+    /* See CONCURRENCY NOTES in nptl/pthread_create.c.  */
-     lll_lock (pd->lock, LLL_PRIVATE);
- 
-   TLS_DEFINE_INIT_TP (tp, pd);
-diff --git a/sysdeps/unix/sysv/linux/createthread.c b/sysdeps/unix/sysv/linux/createthread.c
-index 6d32cece48..66ddae61d4 100644
---- a/sysdeps/unix/sysv/linux/createthread.c
-+++ b/sysdeps/unix/sysv/linux/createthread.c
-@@ -46,7 +46,7 @@ static int start_thread (void *arg) __attribute__ ((noreturn));
- 
- static int
- create_thread (struct pthread *pd, const struct pthread_attr *attr,
--	       bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
-+	       bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
- {
-   /* Determine whether the newly created threads has to be started
-      stopped since we have to set the scheduling parameters or set the
-@@ -54,13 +54,11 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
-   if (attr != NULL
-       && (__glibc_unlikely (attr->cpuset != NULL)
- 	  || __glibc_unlikely ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0)))
--    stopped_start = true;
-+    *stopped_start = true;
- 
--  pd->stopped_start = stopped_start;
--  if (__glibc_unlikely (stopped_start))
--    /* We make sure the thread does not run far by forcing it to get a
--       lock.  We lock it here too so that the new thread cannot continue
--       until we tell it to.  */
-+  pd->stopped_start = *stopped_start;
-+  if (__glibc_unlikely (*stopped_start))
-+    /* See CONCURRENCY NOTES in nptl/pthread_creat.c.  */
-     lll_lock (pd->lock, LLL_PRIVATE);
- 
-   /* We rely heavily on various flags the CLONE function understands:
-@@ -117,7 +115,7 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
-       /* Set the affinity mask if necessary.  */
-       if (attr->cpuset != NULL)
- 	{
--	  assert (stopped_start);
-+	  assert (*stopped_start);
- 
- 	  res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid,
- 				  attr->cpusetsize, attr->cpuset);
-@@ -140,7 +138,7 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
-       /* Set the scheduling parameters.  */
-       if ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0)
- 	{
--	  assert (stopped_start);
-+	  assert (*stopped_start);
- 
- 	  res = INTERNAL_SYSCALL (sched_setscheduler, err, 3, pd->tid,
- 				  pd->schedpolicy, &pd->schedparam);
--- 
-2.11.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0028-Rework-fno-omit-frame-pointer-support-on-i386.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0028-Rework-fno-omit-frame-pointer-support-on-i386.patch
new file mode 100644
index 0000000..7ed2b90
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0028-Rework-fno-omit-frame-pointer-support-on-i386.patch
@@ -0,0 +1,268 @@
+From 1ea003d4fccc4646fd1848a182405a1c7000ab18 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Sun, 8 Jan 2017 11:38:23 -0200
+Subject: [PATCH 28/28] Rework -fno-omit-frame-pointer support on i386
+
+Commit 6b1df8b27f fixed the -OS build issue on i386 (BZ#20729) by
+expliciting disabling frame pointer (-fomit-frame-pointer) on the
+faulty objects.  Although it does fix the issue, it is a subpar
+workaround that adds complexity in build process (a rule for each
+object to add the required compiler option and pontentially more
+rules for objects that call {INLINE,INTERNAL}_SYSCALL) and does not
+allow the implementations to get all the possible debug/calltrack
+information possible (used mainly in debuggers and performance
+measurement tools).
+
+This patch fixes it by adding an explicit configure check to see
+if -fno-omit-frame-pointer is set and to act accordingly (set or
+not OPTIMIZE_FOR_GCC_5).  The make rules is simplified and only
+one is required: to add libc-do-syscall on loader due mmap
+(which will be empty anyway for default build with
+-fomit-frame-pointer).
+
+Checked on i386-linux-gnu with GCC 6.2.1 with CFLAGS sets as
+'-Os', '-O2 -fno-omit-frame-pointer', and '-O2 -fomit-frame-pointer'.
+For '-Os' the testsuite issues described by BZ#19463 and BZ#15105
+still applied.
+
+It fixes BZ #21029, although it is marked as duplicated of #20729
+(I reopened to track this cleanup).
+
+	[BZ #21029]
+	* config.h.in [CAN_USE_REGISTER_ASM_EBP]: New define.
+	* sysdeps/unix/sysv/linux/i386/Makefile
+	[$(subdir) = elf] (sysdep-dl-routines): Add libc-do-syscall.
+	(uses-6-syscall-arguments): Remove.
+	[$(subdir) = misc] (CFLAGS-epoll_pwait.o): Likewise.
+	[$(subdir) = misc] (CFLAGS-epoll_pwait.os): Likewise.
+	[$(subdir) = misc] (CFLAGS-mmap.o): Likewise.
+	[$(subdir) = misc] (CFLAGS-mmap.os): Likewise.
+	[$(subdir) = misc] (CFLAGS-mmap64.o): Likewise.
+	[$(subdir) = misc] (CFLAGS-mmap64.os): Likewise.
+	[$(subdir) = misc] (CFLAGS-pselect.o): Likewise.
+	[$(subdir) = misc] (cflags-pselect.o): Likewise.
+	[$(subdir) = misc] (cflags-pselect.os): Likewise.
+	[$(subdir) = misc] (cflags-rtld-mmap.os): Likewise.
+	[$(subdir) = sysvipc] (cflags-semtimedop.o): Likewise.
+	[$(subdir) = sysvipc] (cflags-semtimedop.os): Likewise.
+	[$(subdir) = io] (CFLAGS-posix_fadvise64.o): Likewise.
+	[$(subdir) = io] (CFLAGS-posix_fadvise64.os): Likewise.
+	[$(subdir) = io] (CFLAGS-posix_fallocate.o): Likewise.
+	[$(subdir) = io] (CFLAGS-posix_fallocate.os): Likewise.
+	[$(subdir) = io] (CFLAGS-posix_fallocate64.o): Likewise.
+	[$(subdir) = io] (CFLAGS-posix_fallocate64.os): Likewise.
+	[$(subdir) = io] (CFLAGS-sync_file_range.o): Likewise.
+	[$(subdir) = io] (CFLAGS-sync_file_range.os): Likewise.
+	[$(subdir) = io] (CFLAGS-fallocate.o): Likewise.
+	[$(subdir) = io] (CFLAGS-fallocate.os): Likewise.
+	[$(subdir) = io] (CFLAGS-fallocate64.o): Likewise.
+	[$(subdir) = io] (CFLAGS-fallocate64.os): Likewise.
+	[$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrdlock.o):
+	Likewise.
+	[$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrdlock.os):
+	Likewise.
+	[$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrwlock.o):
+	Likewise.
+	[$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrwlock.os):
+	Likewise.
+	[$(subdir) = nptl] (CFLAGS-sem_wait.o): Likewise.
+	[$(subdir) = nptl] (CFLAGS-sem_wait.os): Likewise.
+	[$(subdir) = nptl] (CFLAGS-sem_timedwait.o): Likewise.
+	[$(subdir) = nptl] (CFLAGS-sem_timedwait.os): Likewise.
+	* sysdeps/unix/sysv/linux/i386/configure.ac: Add check if compiler allows
+	ebp on inline assembly.
+	* sysdeps/unix/sysv/linux/i386/configure: Regenerate.
+	* sysdeps/unix/sysv/linux/i386/sysdep.h (OPTIMIZE_FOR_GCC_5):
+	Set if CAN_USE_REGISTER_ASM_EBP is set.
+	(check_consistency): Likewise.
+
+Upstream-Status: Backport
+
+  https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=3b33d6ed6096c1d20d05a650b06026d673f7399a
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ config.h.in                               |  4 ++++
+ sysdeps/unix/sysv/linux/i386/Makefile     | 39 +------------------------------
+ sysdeps/unix/sysv/linux/i386/configure    | 39 +++++++++++++++++++++++++++++++
+ sysdeps/unix/sysv/linux/i386/configure.ac | 17 ++++++++++++++
+ sysdeps/unix/sysv/linux/i386/sysdep.h     |  6 ++---
+ 5 files changed, 64 insertions(+), 41 deletions(-)
+
+diff --git a/config.h.in b/config.h.in
+index 7bfe923..fb2cc51 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -259,4 +259,8 @@
+ /* Build glibc with tunables support.  */
+ #define HAVE_TUNABLES 0
+ 
++/* Some compiler options may now allow to use ebp in __asm__ (used mainly
++   in i386 6 argument syscall issue).  */
++#define CAN_USE_REGISTER_ASM_EBP 0
++
+ #endif
+diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
+index 9609752..6aac0df 100644
+--- a/sysdeps/unix/sysv/linux/i386/Makefile
++++ b/sysdeps/unix/sysv/linux/i386/Makefile
+@@ -1,47 +1,18 @@
+ # The default ABI is 32.
+ default-abi := 32
+ 
+-# %ebp is used to pass the 6th argument to system calls, so these
+-# system calls are incompatible with a frame pointer.
+-uses-6-syscall-arguments = -fomit-frame-pointer
+-
+ ifeq ($(subdir),misc)
+ sysdep_routines += ioperm iopl vm86
+-CFLAGS-epoll_pwait.o += $(uses-6-syscall-arguments)
+-CFLAGS-epoll_pwait.os += $(uses-6-syscall-arguments)
+-CFLAGS-mmap.o += $(uses-6-syscall-arguments)
+-CFLAGS-mmap.os += $(uses-6-syscall-arguments)
+-CFLAGS-mmap64.o += $(uses-6-syscall-arguments)
+-CFLAGS-mmap64.os += $(uses-6-syscall-arguments)
+-CFLAGS-pselect.o += $(uses-6-syscall-arguments)
+-CFLAGS-pselect.os += $(uses-6-syscall-arguments)
+-CFLAGS-rtld-mmap.os += $(uses-6-syscall-arguments)
+-endif
+-
+-ifeq ($(subdir),sysvipc)
+-CFLAGS-semtimedop.o += $(uses-6-syscall-arguments)
+-CFLAGS-semtimedop.os += $(uses-6-syscall-arguments)
+ endif
+ 
+ ifeq ($(subdir),elf)
++sysdep-dl-routines += libc-do-syscall
+ sysdep-others += lddlibc4
+ install-bin += lddlibc4
+ endif
+ 
+ ifeq ($(subdir),io)
+ sysdep_routines += libc-do-syscall
+-CFLAGS-posix_fadvise64.o += $(uses-6-syscall-arguments)
+-CFLAGS-posix_fadvise64.os += $(uses-6-syscall-arguments)
+-CFLAGS-posix_fallocate.o += $(uses-6-syscall-arguments)
+-CFLAGS-posix_fallocate.os += $(uses-6-syscall-arguments)
+-CFLAGS-posix_fallocate64.o += $(uses-6-syscall-arguments)
+-CFLAGS-posix_fallocate64.os += $(uses-6-syscall-arguments)
+-CFLAGS-sync_file_range.o += $(uses-6-syscall-arguments)
+-CFLAGS-sync_file_range.os += $(uses-6-syscall-arguments)
+-CFLAGS-fallocate.o += $(uses-6-syscall-arguments)
+-CFLAGS-fallocate.os += $(uses-6-syscall-arguments)
+-CFLAGS-fallocate64.o += $(uses-6-syscall-arguments)
+-CFLAGS-fallocate64.os += $(uses-6-syscall-arguments)
+ endif
+ 
+ ifeq ($(subdir),nptl)
+@@ -61,14 +32,6 @@ ifeq ($(subdir),nptl)
+ # pull in __syscall_error routine
+ libpthread-routines += sysdep
+ libpthread-shared-only-routines += sysdep
+-CFLAGS-pthread_rwlock_timedrdlock.o += $(uses-6-syscall-arguments)
+-CFLAGS-pthread_rwlock_timedrdlock.os += $(uses-6-syscall-arguments)
+-CFLAGS-pthread_rwlock_timedwrlock.o += $(uses-6-syscall-arguments)
+-CFLAGS-pthread_rwlock_timedwrlock.os += $(uses-6-syscall-arguments)
+-CFLAGS-sem_wait.o += $(uses-6-syscall-arguments)
+-CFLAGS-sem_wait.os += $(uses-6-syscall-arguments)
+-CFLAGS-sem_timedwait.o += $(uses-6-syscall-arguments)
+-CFLAGS-sem_timedwait.os += $(uses-6-syscall-arguments)
+ endif
+ 
+ ifeq ($(subdir),rt)
+diff --git a/sysdeps/unix/sysv/linux/i386/configure b/sysdeps/unix/sysv/linux/i386/configure
+index eb72659..ae2c356 100644
+--- a/sysdeps/unix/sysv/linux/i386/configure
++++ b/sysdeps/unix/sysv/linux/i386/configure
+@@ -3,5 +3,44 @@
+ 
+ arch_minimum_kernel=2.6.32
+ 
++# Check if CFLAGS allows compiler to use ebp register in inline assembly.
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler flags allows ebp in inline assembly" >&5
++$as_echo_n "checking if compiler flags allows ebp in inline assembly... " >&6; }
++if ${libc_cv_can_use_register_asm_ebp+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++    void foo (int i)
++    {
++      register int reg asm ("ebp") = i;
++      asm ("# %0" : : "r" (reg));
++    }
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  libc_cv_can_use_register_asm_ebp=yes
++else
++  libc_cv_can_use_register_asm_ebp=no
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_can_use_register_asm_ebp" >&5
++$as_echo "$libc_cv_can_use_register_asm_ebp" >&6; }
++if test $libc_cv_can_use_register_asm_ebp = yes; then
++  $as_echo "#define CAN_USE_REGISTER_ASM_EBP 1" >>confdefs.h
++
++fi
++
+ libc_cv_gcc_unwind_find_fde=yes
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
+diff --git a/sysdeps/unix/sysv/linux/i386/configure.ac b/sysdeps/unix/sysv/linux/i386/configure.ac
+index 1a11da6..1cd632e 100644
+--- a/sysdeps/unix/sysv/linux/i386/configure.ac
++++ b/sysdeps/unix/sysv/linux/i386/configure.ac
+@@ -3,5 +3,22 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+ 
+ arch_minimum_kernel=2.6.32
+ 
++# Check if CFLAGS allows compiler to use ebp register in inline assembly.
++AC_CACHE_CHECK([if compiler flags allows ebp in inline assembly],
++                libc_cv_can_use_register_asm_ebp, [
++AC_COMPILE_IFELSE(
++  [AC_LANG_PROGRAM([
++    void foo (int i)
++    {
++      register int reg asm ("ebp") = i;
++      asm ("# %0" : : "r" (reg));
++    }])],
++  [libc_cv_can_use_register_asm_ebp=yes],
++  [libc_cv_can_use_register_asm_ebp=no])
++])
++if test $libc_cv_can_use_register_asm_ebp = yes; then
++  AC_DEFINE(CAN_USE_REGISTER_ASM_EBP)
++fi
++
+ libc_cv_gcc_unwind_find_fde=yes
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
+diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
+index baf4642..449b23e 100644
+--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
++++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
+@@ -44,9 +44,9 @@
+ /* Since GCC 5 and above can properly spill %ebx with PIC when needed,
+    we can inline syscalls with 6 arguments if GCC 5 or above is used
+    to compile glibc.  Disable GCC 5 optimization when compiling for
+-   profiling since asm ("ebp") can't be used to put the 6th argument
+-   in %ebp for syscall.  */
+-#if __GNUC_PREREQ (5,0) && !defined PROF
++   profiling or when -fno-omit-frame-pointer is used since asm ("ebp")
++   can't be used to put the 6th argument in %ebp for syscall.  */
++#if __GNUC_PREREQ (5,0) && !defined PROF && CAN_USE_REGISTER_ASM_EBP
+ # define OPTIMIZE_FOR_GCC_5
+ #endif
+ 
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/CVE-2016-6323.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/CVE-2016-6323.patch
deleted file mode 100644
index f9b9fa5..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/CVE-2016-6323.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-glibc-2.24: Fix CVE-2016-6323
-
-[No upstream tracking] -- https://sourceware.org/bugzilla/show_bug.cgi?id=20435
-
-arm: mark __startcontext as .cantunwind, GNU
-
-Glibc bug where the makecontext function would create
-an execution context which is incompatible with the unwinder,
-causing it to hang when the generation of a backtrace is attempted.
-
-Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9e2ff6c9cc54c0b4402b8d49e4abe7000fde7617]
-CVE: CVE-2016-6323
-Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
-Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
-
-diff --git a/sysdeps/unix/sysv/linux/arm/setcontext.S b/sysdeps/unix/sysv/linux/arm/setcontext.S
-index 603e508..d1f168f 100644
---- a/sysdeps/unix/sysv/linux/arm/setcontext.S
-+++ b/sysdeps/unix/sysv/linux/arm/setcontext.S
-@@ -86,12 +86,19 @@ weak_alias(__setcontext, setcontext)
- 
- 	/* Called when a makecontext() context returns.  Start the
- 	   context in R4 or fall through to exit().  */
-+	/* Unwind descriptors are looked up based on PC - 2, so we have to
-+	   make sure to mark the instruction preceding the __startcontext
-+	   label as .cantunwind.  */
-+	.fnstart
-+	.cantunwind
-+	nop
- ENTRY(__startcontext)
- 	movs    r0, r4
- 	bne     PLTJMP(__setcontext)
- 
- 	@ New context was 0 - exit
- 	b       PLTJMP(HIDDEN_JUMPTARGET(exit))
-+	.fnend
- END(__startcontext)
- 
- #ifdef PIC
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc_2.24.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc_2.24.bb
deleted file mode 100644
index e723e03..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc_2.24.bb
+++ /dev/null
@@ -1,148 +0,0 @@
-require glibc.inc
-
-LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
-      file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-      file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
-      file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
-
-DEPENDS += "gperf-native"
-
-SRCREV ?= "ea23815a795f72035262953dad5beb03e09c17dd"
-
-SRCBRANCH ?= "release/${PV}/master"
-
-GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
-
-SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
-           file://0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \
-           file://0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
-           file://0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \
-           file://0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
-           file://0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \
-           file://0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
-           file://0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
-           file://0012-Make-ld-version-output-matching-grok-gold-s-output.patch \
-           file://0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
-           file://0014-Add-unused-attribute.patch \
-           file://0015-yes-within-the-path-sets-wrong-config-variables.patch \
-           file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
-           file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
-           file://0018-eglibc-Cross-building-and-testing-instructions.patch \
-           file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
-           file://0020-eglibc-cherry-picked-from.patch \
-           file://0021-eglibc-Clear-cache-lines-on-ppc8xx.patch \
-           file://0022-eglibc-Resolve-__fpscr_values-on-SH4.patch \
-           file://0023-eglibc-Install-PIC-archives.patch \
-           file://0024-eglibc-Forward-port-cross-locale-generation-support.patch \
-           file://0025-Define-DUMMY_LOCALE_T-if-not-defined.patch \
-           file://0026-build_local_scope.patch \
-           file://0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch \
-           file://CVE-2016-6323.patch \
-           file://0001-Add-atomic_exchange_relaxed.patch \
-           file://0002-Add-atomic-operations-required-by-the-new-condition-.patch \
-           file://0003-Add-pretty-printers-for-the-NPTL-lock-types.patch \
-           file://0004-New-condvar-implementation-that-provides-stronger-or.patch \
-           file://0005-Remove-__ASSUME_REQUEUE_PI.patch \
-           file://0006-Fix-atomic_fetch_xor_release.patch \
-"
-
-SRC_URI += "\
-           file://etc/ld.so.conf \
-           file://generate-supported.mk \
-           file://0001-locale-fix-hard-coded-reference-to-gcc-E.patch \
-           "
-
-SRC_URI_append_class-nativesdk = "\
-           file://0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
-           file://0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
-           file://0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
-           file://0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
-"
-
-S = "${WORKDIR}/git"
-B = "${WORKDIR}/build-${TARGET_SYS}"
-
-PACKAGES_DYNAMIC = ""
-
-# the -isystem in bitbake.conf screws up glibc do_stage
-BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
-TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
-
-GLIBC_BROKEN_LOCALES = ""
-#
-# We will skip parsing glibc when target system C library selection is not glibc
-# this helps in easing out parsing for non-glibc system libraries
-#
-COMPATIBLE_HOST_libc-musl_class-target = "null"
-COMPATIBLE_HOST_libc-uclibc_class-target = "null"
-
-EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
-                --without-cvs --disable-profile \
-                --disable-debug --without-gd \
-                --enable-clocale=gnu \
-                --enable-add-ons \
-                --with-headers=${STAGING_INCDIR} \
-                --without-selinux \
-                --enable-obsolete-rpc \
-                ${GLIBC_EXTRA_OECONF}"
-
-EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
-EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-inet-anl', '--enable-nscd', '--disable-nscd', d)}"
-
-
-do_patch_append() {
-    bb.build.exec_func('do_fix_readlib_c', d)
-}
-
-do_fix_readlib_c () {
-	sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
-}
-
-do_configure () {
-# override this function to avoid the autoconf/automake/aclocal/autoheader
-# calls for now
-# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
-# version check and doesn't really help with anything
-        (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
-        find ${S} -name "configure" | xargs touch
-        CPPFLAGS="" oe_runconf
-}
-
-rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
-	  yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
-	  rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
-
-do_compile () {
-	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
-	unset LDFLAGS
-	base_do_compile
-	(
-		cd ${S}/sunrpc/rpcsvc
-		for r in ${rpcsvc}; do
-			h=`echo $r|sed -e's,\.x$,.h,'`
-			rm -f $h
-			${B}/sunrpc/cross-rpcgen -h $r -o $h || bbwarn "${PN}: unable to generate header for $r"
-		done
-	)
-	echo "Adjust ldd script"
-	if [ -n "${RTLDLIST}" ]
-	then
-		prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
-		if [ "${prevrtld}" != "${RTLDLIST}" ]
-		then
-			sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
-		fi
-	fi
-
-}
-
-# Use the host locale archive when built for nativesdk so that we don't need to
-# ship a complete (100MB) locale set.
-do_compile_prepend_class-nativesdk() {
-    echo "complocaledir=/usr/lib/locale" >> ${S}/configparms
-}
-
-require glibc-package.inc
-
-BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc_2.25.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc_2.25.bb
new file mode 100644
index 0000000..0f1ec0c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc_2.25.bb
@@ -0,0 +1,141 @@
+require glibc.inc
+
+LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
+      file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+      file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+      file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS += "gperf-native"
+
+SRCREV ?= "db0242e3023436757bbc7c488a779e6e3343db04"
+
+SRCBRANCH ?= "release/${PV}/master"
+
+GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
+
+SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
+           file://etc/ld.so.conf \
+           file://generate-supported.mk \
+           \
+           ${NATIVESDKFIXES} \
+           file://0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \
+           file://0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
+           file://0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \
+           file://0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
+           file://0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \
+           file://0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
+           file://0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
+           file://0012-Make-ld-version-output-matching-grok-gold-s-output.patch \
+           file://0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
+           file://0014-Add-unused-attribute.patch \
+           file://0015-yes-within-the-path-sets-wrong-config-variables.patch \
+           file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
+           file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
+           file://0018-eglibc-Cross-building-and-testing-instructions.patch \
+           file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
+           file://0020-eglibc-cherry-picked-from.patch \
+           file://0021-eglibc-Clear-cache-lines-on-ppc8xx.patch \
+           file://0022-eglibc-Resolve-__fpscr_values-on-SH4.patch \
+           file://0023-eglibc-Install-PIC-archives.patch \
+           file://0024-eglibc-Forward-port-cross-locale-generation-support.patch \
+           file://0025-Define-DUMMY_LOCALE_T-if-not-defined.patch \
+           file://0026-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \
+           file://0027-locale-fix-hard-coded-reference-to-gcc-E.patch \
+           file://0028-Rework-fno-omit-frame-pointer-support-on-i386.patch \
+"
+
+NATIVESDKFIXES ?= ""
+NATIVESDKFIXES_class-nativesdk = "\
+           file://0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
+           file://0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
+           file://0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
+           file://0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
+"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+PACKAGES_DYNAMIC = ""
+
+# the -isystem in bitbake.conf screws up glibc do_stage
+BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
+
+GLIBC_BROKEN_LOCALES = ""
+#
+# We will skip parsing glibc when target system C library selection is not glibc
+# this helps in easing out parsing for non-glibc system libraries
+#
+COMPATIBLE_HOST_libc-musl_class-target = "null"
+COMPATIBLE_HOST_libc-uclibc_class-target = "null"
+
+EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
+                --without-cvs --disable-profile \
+                --disable-debug --without-gd \
+                --enable-clocale=gnu \
+                --enable-add-ons \
+                --with-headers=${STAGING_INCDIR} \
+                --without-selinux \
+                --enable-obsolete-rpc \
+                ${GLIBC_EXTRA_OECONF}"
+
+EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-inet-anl', '--enable-nscd', '--disable-nscd', d)}"
+
+
+do_patch_append() {
+    bb.build.exec_func('do_fix_readlib_c', d)
+}
+
+do_fix_readlib_c () {
+	sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
+}
+
+do_configure () {
+# override this function to avoid the autoconf/automake/aclocal/autoheader
+# calls for now
+# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
+# version check and doesn't really help with anything
+        (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+        find ${S} -name "configure" | xargs touch
+        CPPFLAGS="" oe_runconf
+}
+
+rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
+	  yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
+	  rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
+
+do_compile () {
+	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
+	unset LDFLAGS
+	base_do_compile
+	(
+		cd ${S}/sunrpc/rpcsvc
+		for r in ${rpcsvc}; do
+			h=`echo $r|sed -e's,\.x$,.h,'`
+			rm -f $h
+			${B}/sunrpc/cross-rpcgen -h $r -o $h || bbwarn "${PN}: unable to generate header for $r"
+		done
+	)
+	echo "Adjust ldd script"
+	if [ -n "${RTLDLIST}" ]
+	then
+		prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
+		if [ "${prevrtld}" != "${RTLDLIST}" ]
+		then
+			sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
+		fi
+	fi
+
+}
+
+# Use the host locale archive when built for nativesdk so that we don't need to
+# ship a complete (100MB) locale set.
+do_compile_prepend_class-nativesdk() {
+    echo "complocaledir=/usr/lib/locale" >> ${S}/configparms
+}
+
+require glibc-package.inc
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch b/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
index bff352e3..2013933 100644
--- a/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
@@ -1,7 +1,7 @@
-From 74152ac74a3e1ea0f3be292aa1eeca5ad1fe69c0 Mon Sep 17 00:00:00 2001
-From: Paul Gortmaker <paul.gortmaker@windriver.com>
-Date: Wed, 6 Aug 2014 15:12:11 -0400
-Subject: [PATCH 2/2] inet[6].defn: fix inverted checks for loopback
+From d88af5aa0312ea18aac791d66661da79b7bcd032 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Wed, 21 Dec 2016 15:32:07 +0200
+Subject: [PATCH] inet[6].defn: fix inverted checks for loopback
 
 Compared to the hurd link.defn for loopback, we see these
 are inverted, meaning that you would only be able to configure
@@ -11,60 +11,335 @@
 but never actually do anything for up/down, as shown below:
 
 root@localhost:~# ifconfig -s
-Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
-eth0       1500 0   7736329      0   2016 0       5289422      0      0      0 BMRU
-lo        65536 0        18      0      0 0            18      0      0      0 LRU
+Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR  TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0       1500 0   7736329      0   2016 0 5289422      0      0      0 BMRU
+lo        65536 0        18      0      0 0      18      0      0      0 LRU
 root@localhost:~# ifdown lo
 root@localhost:~# echo $?
 0
 root@localhost:~# ifconfig -s
-Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
-eth0       1500 0   7736406      0   2016 0       5289455      0      0      0 BMRU
-lo        65536 0        18      0      0 0            18      0      0      0 LRU
+Iface   MTU Met   RX-OK RX-ERR RX-DRP  RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0       1500 0   7736406      0  2016 0   5289455      0      0      0 BMRU
+lo        65536 0        18      0   0 0            18    0    0    0     LRU
 root@localhost:~# ifconfig lo down
 root@localhost:~# ifconfig -s
 Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
-eth0       1500 0   7736474      0   2016 0       5289481      0      0      0 BMRU
+eth0       1500 0   7736474 0   2016 0       5289481      0     0      0 BMRU
 root@localhost:~#
 
+Also reverted the commit:
+commit 80b878497663dae08f70b4d3cffe127b57a3cfc
+which uses absolute paths to binaries called by ifup/ifdown.
+
+Upstream-Status: Inappropriate [OE specific]
+
 Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
 ---
- inet.defn  | 12 ++++++------
- inet6.defn |  8 ++++----
- 2 files changed, 10 insertions(+), 10 deletions(-)
+ inet.defn | 148 +++++++++++++++++++++++++++++++-------------------------------
+ 1 file changed, 74 insertions(+), 74 deletions(-)
 
 diff --git a/inet.defn b/inet.defn
-index b176ab4ed03e..5fdfb14a0e1c 100644
+index 75e6744..b5f5da2 100644
 --- a/inet.defn
 +++ b/inet.defn
 @@ -6,10 +6,10 @@ method loopback
      This method may be used to define the IPv4 loopback interface.
  
    up
--    ip link set dev %iface% up if (!iface_is_lo())
+-    /bin/ip link set dev %iface% up if (!iface_is_lo())
 +    ip link set dev %iface% up if (iface_is_lo())
  
    down
--    ip link set dev %iface% down if (!iface_is_lo())
+-    /bin/ip link set dev %iface% down if (!iface_is_lo())
 +    ip link set dev %iface% down if (iface_is_lo())
  
  method static
    description
-@@ -212,11 +212,11 @@ method loopback
+@@ -36,17 +36,17 @@ method static
+     broadcast compute_v4_broadcast
  
    up
-     ifconfig %iface% 127.0.0.1 up \
+-    /bin/ip addr add %address%[[/%netmask%]] [[broadcast %broadcast%]] \
++    ip addr add %address%[[/%netmask%]] [[broadcast %broadcast%]] \
+ 	[[peer %pointopoint%]] [[scope %scope%]] dev %iface% label %iface%
+-    /bin/ip link set dev %iface% [[mtu %mtu%]] [[address %hwaddress%]] up
++    ip link set dev %iface% [[mtu %mtu%]] [[address %hwaddress%]] up
+ 
+-    [[ /bin/ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
++    [[ ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
+ 
+   down
+-    [[ /bin/ip route del default via %gateway% [[metric %metric%]] dev %iface% 2>&1 1>/dev/null || true ]]
+-    /bin/ip addr del %address%[[/%netmask%]] [[broadcast %broadcast%]] \
++    [[ ip route del default via %gateway% [[metric %metric%]] dev %iface% 2>&1 1>/dev/null || true ]]
++    ip addr del %address%[[/%netmask%]] [[broadcast %broadcast%]] \
+ 	[[peer %pointopoint%]] [[scope %scope%]] dev %iface% label %iface%
+-    /bin/ip link set dev %iface% down \
++    ip link set dev %iface% down \
+ 		if (iface_is_link())
+ 
+ method manual
+@@ -63,12 +63,12 @@ method manual
+     hwaddress cleanup_hwaddress
+ 
+   up
+-    [[/bin/ip link set dev %iface% mtu %mtu%]]
+-    [[/bin/ip link set dev %iface% address %hwaddress%]]
+-    /bin/ip link set dev %iface% up 2>/dev/null || true
++    [[ip link set dev %iface% mtu %mtu%]]
++    [[ip link set dev %iface% address %hwaddress%]]
++    ip link set dev %iface% up 2>/dev/null || true
+ 
+   down
+-    /bin/ip link set dev %iface% down 2>/dev/null || true \
++    ip link set dev %iface% down 2>/dev/null || true \
+         if (iface_is_link() && !do_all)
+ 
+ method dhcp
+@@ -93,33 +93,33 @@ method dhcp
+     hwaddress cleanup_hwaddress
+ 
+   up
+-    [[/bin/ip link set dev %iface% address %hwaddress%]]
+-    /sbin/dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++    [[ip link set dev %iface% address %hwaddress%]]
++    dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+ 	[[-e IF_METRIC=%metric%]] \
+         if (execable("/sbin/dhclient"))
+-    /sbin/pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \
++    pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \
+         elsif (execable("/sbin/pump"))
+-    /sbin/udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \
++    udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \
+         elsif (execable("/sbin/udhcpc"))
+-    /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
++    dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
+            [[-l %leasetime%]] [[-m %metric%]] %iface% \
+         elsif (execable("/sbin/dhcpcd"))
+     echo 'No DHCP client software found!' >/dev/stderr; false \
+         elsif (1)
+ 
+   down
+-    /sbin/dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++    dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+         if (execable("/sbin/dhclient"))
+-    /sbin/pump -i %iface% -r \
++    pump -i %iface% -r \
+         elsif (execable("/sbin/pump"))
+-    if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface%.pid); fi \
++    if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \
+         elsif (execable("/sbin/udhcpc"))
+-    /sbin/dhcpcd -k %iface% \
++    dhcpcd -k %iface% \
+         elsif (execable("/sbin/dhcpcd"))
+     echo 'No DHCP client software found!' >/dev/stderr; false \
+         elsif (1)
+ 
+-    /bin/ip link set dev %iface% down \
++    ip link set dev %iface% down \
+ 		if (iface_is_link())
+ 
+ method bootp
+@@ -134,11 +134,11 @@ method bootp
+                       whatever it really is.
+ 
+   up
+-    /sbin/bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
++    bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
+            [[--hwaddr %hwaddr%]] --returniffail --serverbcast
+ 
+   down
+-    /bin/ip link set dev %iface% down \
++    ip link set dev %iface% down \
+         if (iface_is_link())
+ 
+ method tunnel
+@@ -158,13 +158,13 @@ method tunnel
+     ttl time              -- TTL setting
+     mtu size              -- MTU size
+   up
+-    /bin/ip tunnel add %iface% mode %mode% remote %endpoint% [[local %local%]] \
++    ip tunnel add %iface% mode %mode% remote %endpoint% [[local %local%]] \
+        [[ttl %ttl%]]
+-    /bin/ip link set %iface% up [[mtu %mtu%]]
+-    /bin/ip addr add %address%/%netmask% dev %iface% [[peer %dstaddr%]]
+-    [[ /bin/ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
++    ip link set %iface% up [[mtu %mtu%]]
++    ip addr add %address%/%netmask% dev %iface% [[peer %dstaddr%]]
++    [[ ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
+   down
+-    /bin/ip tunnel del %iface%
++    ip tunnel del %iface%
+ 
+ method ppp
+   description
+@@ -175,9 +175,9 @@ method ppp
+     unit number    -- Use /number/ as the ppp unit number.
+     options string -- Pass /string/ as additional options to pon.
+   up
+-    /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]]
++    pon [[%provider%]] [[unit %unit%]] [[%options%]]
+   down
+-    /usr/bin/poff [[%provider%]]
++    poff [[%provider%]]
+ 
+ method wvdial
+   description
+@@ -186,10 +186,10 @@ method wvdial
+   options
+     provider name  -- Use /name/ as the provider (from /etc/wvdial.conf).
+   up
+-    /sbin/start-stop-daemon --start -x /usr/bin/wvdial \
++    start-stop-daemon --start -x /usr/bin/wvdial \
+                       -p /run/wvdial.%iface%.pid -b -m -- [[ %provider% ]]
+   down
+-    /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
++    start-stop-daemon --stop -x /usr/bin/wvdial \
+                       -p /run/wvdial.%iface%.pid -s 2
+ 
+ 
+@@ -200,9 +200,9 @@ method ipv4ll
+     known as APIPA or IPAC, and often colloquially referred to
+     as "Zeroconf address".
+   up
+-    /usr/sbin/avahi-autoipd -D %iface%
++    avahi-autoipd -D %iface%
+   down
+-    /usr/sbin/avahi-autoipd --kill %iface%
++    avahi-autoipd --kill %iface%
+ 
+ architecture kfreebsd
+ 
+@@ -211,12 +211,12 @@ method loopback
+     This method may be used to define the IPv4 loopback interface.
+ 
+   up
+-    /sbin/ifconfig %iface% 127.0.0.1 up \
 -	if (!iface_is_lo())
++    ifconfig %iface% 127.0.0.1 up \
 +	if (iface_is_lo())
  
    down
-     ifconfig %iface% down \
+-    /sbin/ifconfig %iface% down \
 -	if (!iface_is_lo())
++    ifconfig %iface% down \
 +	if (iface_is_lo())
  
  method static
    description
-@@ -371,11 +371,11 @@ method loopback
+@@ -238,15 +238,15 @@ method static
+     hwaddress cleanup_hwaddress
+ 
+   up
+-    [[ /sbin/ifconfig %iface% link %hwaddress%]]
+-    /sbin/ifconfig %iface% %address% [[netmask %netmask%]] [[broadcast %broadcast%]] \
++    [[ ifconfig %iface% link %hwaddress%]]
++    ifconfig %iface% %address% [[netmask %netmask%]] [[broadcast %broadcast%]] \
+ 	[[pointopoint %pointopoint%]] [[media %media%]] [[mtu %mtu%]] \
+ 	up
+-    [[ /sbin/route add default %gateway% ]]
++    [[ route add default %gateway% ]]
+ 
+   down
+-    [[ /sbin/route del default %gateway% 2>&1 1>/dev/null || true ]]
+-    /sbin/ifconfig %iface% down
++    [[ route del default %gateway% 2>&1 1>/dev/null || true ]]
++    ifconfig %iface% down
+ 
+ method manual
+   description
+@@ -279,30 +279,30 @@ method dhcp
+     hwaddress cleanup_hwaddress
+ 
+   up
+-    [[/sbin/ifconfig %iface% link %hwaddress%]]
+-    /sbin/dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++    [[ifconfig %iface% link %hwaddress%]]
++    dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+ 	[[-e IF_METRIC=%metric%]] \
+         if (execable("/sbin/dhclient"))
+-    /sbin/udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \
++    udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \
+            [[-c %client%]] \
+         elsif (execable("/sbin/udhcpc"))
+-    /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
++    dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
+            [[-l %leasetime%]] %iface% \
+         elsif (execable("/sbin/dhcpcd"))
+     echo 'No DHCP client software found!' >/dev/stderr; false \
+         elsif (1)
+ 
+   down
+-    /sbin/dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++    dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+         if (execable("/sbin/dhclient"))
+-    if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface%.pid); fi \
++    if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \
+         elsif (execable("/sbin/udhcpc"))
+-    /sbin/dhcpcd -k %iface% \
++    dhcpcd -k %iface% \
+         elsif (execable("/sbin/dhcpcd"))
+     echo 'No DHCP client software found!' >/dev/stderr; false \
+         elsif (1)
+ 
+-    /sbin/ifconfig %iface% down
++    ifconfig %iface% down
+ 
+ method bootp
+   description
+@@ -316,11 +316,11 @@ method bootp
+                       whatever it really is.
+ 
+   up
+-    /sbin/bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
++    bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
+            [[--hwaddr %hwaddr%]] --returniffail --serverbcast
+ 
+   down
+-    /sbin/ifconfig %iface% down
++    ifconfig %iface% down
+ 
+ method ppp
+   description
+@@ -331,9 +331,9 @@ method ppp
+     unit number    -- Use /number/ as the ppp unit number.
+     options string -- Pass /string/ as additional options to pon.
+   up
+-    /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]]
++    pon [[%provider%]] [[unit %unit%]] [[%options%]]
+   down
+-    /usr/bin/poff [[%provider%]]
++    poff [[%provider%]]
+ 
+ method wvdial
+   description
+@@ -342,10 +342,10 @@ method wvdial
+   options
+     provider name  -- Use /name/ as the provider (from /etc/wvdial.conf).
+   up
+-    /sbin/start-stop-daemon --start -x /usr/bin/wvdial \
++    start-stop-daemon --start -x /usr/bin/wvdial \
+                       -p /run/wvdial.%iface%.pid -b -m -- [[ %provider% ]]
+   down
+-    /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
++    start-stop-daemon --stop -x /usr/bin/wvdial \
+                       -p /run/wvdial.%iface%.pid -s 2
+ 
+ 
+@@ -356,9 +356,9 @@ method ipv4ll
+     known as APIPA or IPAC, and often colloquially referred to
+     as "Zeroconf address".
+   up
+-    /usr/sbin/avahi-autoipd -D %iface%
++    avahi-autoipd -D %iface%
+   down
+-    /usr/sbin/avahi-autoipd --kill %iface%
++    avahi-autoipd --kill %iface%
+ architecture hurd
+ 
+ method loopback
+@@ -367,11 +367,11 @@ method loopback
  
    up
      inetutils-ifconfig --interface %iface% --address 127.0.0.1 --up \
@@ -78,26 +353,70 @@
  
  method static
    description
-diff --git a/inet6.defn b/inet6.defn
-index 09325539cd01..4df64aff38cc 100644
---- a/inet6.defn
-+++ b/inet6.defn
-@@ -33,11 +33,11 @@ method loopback
-   description
-     This method may be used to define the IPv6 loopback interface.
-   up
--    -ip link set dev %iface% up 2>/dev/null if (!iface_is_lo())
--    -ip addr add dev %iface% ::1 2>/dev/null if (!iface_is_lo())
-+    -ip link set dev %iface% up 2>/dev/null if (iface_is_lo())
-+    -ip addr add dev %iface% ::1 2>/dev/null if (iface_is_lo())
-   down
--    -ip addr del dev %iface% ::1 2>/dev/null if (!iface_is_lo())
--    -ip link set dev %iface% down 2>/dev/null if (!iface_is_lo())
-+    -ip addr del dev %iface% ::1 2>/dev/null if (iface_is_lo())
-+    -ip link set dev %iface% down 2>/dev/null if (iface_is_lo())
+@@ -432,23 +432,23 @@ method dhcp
  
- method static
+   up
+     [[Warning: Option hwaddress: %hwaddress% not yet supported]]
+-    /sbin/dhclient -v -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
++    dhclient -v -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
+         if (execable("/sbin/dhclient"))
+-    /sbin/udhcpc -n -p /run/udhcpc.%iface///.%.pid -i %iface% [[-H %hostname%]] \
++    udhcpc -n -p /run/udhcpc.%iface///.%.pid -i %iface% [[-H %hostname%]] \
+            [[-c %client%]] \
+         elsif (execable("/sbin/udhcpc"))
+-    /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
++    dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
+            [[-l %leasetime%]] %iface% \
+         elsif (execable("/sbin/dhcpcd"))
+     echo 'No DHCP client software found!' >/dev/stderr; false \
+         elsif (1)
+ 
+   down
+-    /sbin/dhclient -v -r -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
++    dhclient -v -r -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
+         if (execable("/sbin/dhclient"))
+-    if test -f /run/udhcpc.%iface///.%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface///.%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface///.%.pid); fi \
++    if test -f /run/udhcpc.%iface///.%.pid; then kill -USR2 $(cat /run/udhcpc.%iface///.%.pid); kill -TERM $(cat /run/udhcpc.%iface///.%.pid); fi \
+         elsif (execable("/sbin/udhcpc"))
+-    /sbin/dhcpcd -k %iface% \
++    dhcpcd -k %iface% \
+         elsif (execable("/sbin/dhcpcd"))
+     echo 'No DHCP client software found!' >/dev/stderr; false \
+         elsif (1)
+@@ -482,9 +482,9 @@ method ppp
+     unit number    -- Use /number/ as the ppp unit number.
+     options string -- Pass /string/ as additional options to pon.
+   up
+-    /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]]
++    pon [[%provider%]] [[unit %unit%]] [[%options%]]
+   down
+-    /usr/bin/poff [[%provider%]]
++    poff [[%provider%]]
+ 
+ method wvdial
    description
+@@ -493,10 +493,10 @@ method wvdial
+   options
+     provider name  -- Use /name/ as the provider (from /etc/wvdial.conf).
+   up
+-    /sbin/start-stop-daemon --start -x /usr/bin/wvdial \
++    start-stop-daemon --start -x /usr/bin/wvdial \
+                       -p /run/wvdial.%iface///.%.pid -b -m -- [[ %provider% ]]
+   down
+-    /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
++    start-stop-daemon --stop -x /usr/bin/wvdial \
+                       -p /run/wvdial.%iface///.%.pid -s 2
+ 
+ 
+@@ -507,6 +507,6 @@ method ipv4ll
+     known as APIPA or IPAC, and often colloquially referred to
+     as "Zeroconf address".
+   up
+-    /usr/sbin/avahi-autoipd -D %iface%
++    avahi-autoipd -D %iface%
+   down
+-    /usr/sbin/avahi-autoipd --kill %iface%
++    avahi-autoipd --kill %iface%
 -- 
-1.9.1
+2.4.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb b/import-layers/yocto-poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb
new file mode 100644
index 0000000..5654528
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb
@@ -0,0 +1,46 @@
+SUMMARY = "ifupdown: basic ifup and ifdown used by initscripts"
+DESCRIPTION = "High level tools to configure network interfaces \
+This package provides the tools ifup and ifdown which may be used to \
+configure (or, respectively, deconfigure) network interfaces, based on \
+the file /etc/network/interfaces."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "git://anonscm.debian.org/git/collab-maint/ifupdown.git \
+	   file://defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch \
+	   file://inet-6-.defn-fix-inverted-checks-for-loopback.patch \
+	   file://99_network \
+	  "
+SRCREV = "11b9f99f7ecc7052497e6786156cfed531f11823"
+
+S = "${WORKDIR}/git"
+
+
+inherit update-alternatives
+
+do_compile () {
+	chmod a+rx *.pl *.sh
+	oe_runmake 'CC=${CC}' "CFLAGS=${CFLAGS} -Wall -W -D'IFUPDOWN_VERSION=\"${PV}\"'"
+}
+
+do_install () {
+	install -d ${D}${mandir}/man8 \
+		  ${D}${mandir}/man5 \
+		  ${D}${base_sbindir}
+
+	# If volatiles are used, then we'll also need /run/network there too.
+	install -d ${D}/etc/default/volatiles
+	install -m 0644 ${WORKDIR}/99_network ${D}/etc/default/volatiles
+
+	install -m 0755 ifup ${D}${base_sbindir}/
+	ln ${D}${base_sbindir}/ifup ${D}${base_sbindir}/ifdown
+	install -m 0644 ifup.8 ${D}${mandir}/man8
+	install -m 0644 interfaces.5 ${D}${mandir}/man5
+	cd ${D}${mandir}/man8 && ln -s ifup.8 ifdown.8
+}
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "ifup ifdown"
+
+ALTERNATIVE_LINK_NAME[ifup] = "${base_sbindir}/ifup"
+ALTERNATIVE_LINK_NAME[ifdown] = "${base_sbindir}/ifdown"
diff --git a/import-layers/yocto-poky/meta/recipes-core/ifupdown/ifupdown_0.8.2.bb b/import-layers/yocto-poky/meta/recipes-core/ifupdown/ifupdown_0.8.2.bb
deleted file mode 100644
index 9de01f9..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/ifupdown/ifupdown_0.8.2.bb
+++ /dev/null
@@ -1,49 +0,0 @@
-SUMMARY = "ifupdown: basic ifup and ifdown used by initscripts"
-DESCRIPTION = "High level tools to configure network interfaces \
-This package provides the tools ifup and ifdown which may be used to \
-configure (or, respectively, deconfigure) network interfaces, based on \
-the file /etc/network/interfaces."
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-SRC_URI = "git://anonscm.debian.org/git/collab-maint/ifupdown.git;protocol=https \
-	   file://defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch \
-	   file://inet-6-.defn-fix-inverted-checks-for-loopback.patch \
-	   file://99_network \
-	  "
-SRCREV = "05ea2fd4f49bb1201aeef2a42efbcff8f336112f"
-
-S = "${WORKDIR}/git"
-
-
-inherit update-rc.d update-alternatives
-
-do_compile () {
-	chmod a+rx *.pl *.sh
-	oe_runmake 'CC=${CC}' "CFLAGS=${CFLAGS} -Wall -W -D'IFUPDOWN_VERSION=\"${PV}\"'"
-}
-
-do_install () {
-	install -d ${D}${mandir}/man8 \
-		  ${D}${mandir}/man5 \
-		  ${D}${base_sbindir}
-
-	# If volatiles are used, then we'll also need /run/network there too.
-	install -d ${D}/etc/default/volatiles
-	install -m 0644 ${WORKDIR}/99_network ${D}/etc/default/volatiles
-
-	install -m 0755 ifup ${D}${base_sbindir}/
-	ln ${D}${base_sbindir}/ifup ${D}${base_sbindir}/ifdown
-	install -m 0644 ifup.8 ${D}${mandir}/man8
-	install -m 0644 interfaces.5 ${D}${mandir}/man5
-	cd ${D}${mandir}/man8 && ln -s ifup.8 ifdown.8
-}
-
-ALTERNATIVE_PRIORITY = "100"
-ALTERNATIVE_${PN} = "ifup ifdown"
-
-ALTERNATIVE_LINK_NAME[ifup] = "${base_sbindir}/ifup"
-ALTERNATIVE_LINK_NAME[ifdown] = "${base_sbindir}/ifdown"
-
-INITSCRIPT_NAME = "ifup"
-INITSCRIPT_PARAMS = "start 39 S . stop 39 0 6 1 ."
diff --git a/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt b/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt
new file mode 100644
index 0000000..a0aede2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt
@@ -0,0 +1,78 @@
+
+Running Toaster in VirtualBox
+=============================
+
+Toaster is launched via the command in VM:
+
+    $ source toaster start webport=<IPADDR:PORT>
+
+The interaction with Toaster web server is done via a host internet
+browser.
+The particular steps depend on the actual networking being used
+by the VirtualBox.
+
+
+Bridged Network
+===============
+
+Find out your VM network IP address:
+
+    $ ifconfig
+
+IP address is listed under eth0 inet addr.
+It should be something like:
+   inet addr:192.168.1.18
+
+Launch the Toaster web server in VM:
+
+    $ source toaster start webport=192.168.1.18:8000
+
+Interact with the Toaster web server with your host browser using URL:
+
+    http://192.168.1.18:8000
+
+
+NAT Network
+===========
+Find out your VM network IP address:
+
+    $ ifconfig
+
+IP address is listed under eth0 inet addr.
+For NAT network it should be something like:
+   inet addr:10.0.2.15
+
+When using NAT network, the VM web server can be accessed using
+Port Forwarding.
+
+Using the VirtualBox GUI, navigate to:
+    Settings->Network->Adapter1
+
+You should set:
+    Attached to: NAT
+
+Select "Advanced", click on "Port Forwarding"
+
+This will open a new dialog box "Port Forwarding Rules".
+Create a new rule that looks like this:
+
+| Name  | Protocol | Host IP | Host Port | Guest IP | Guest Port |
++-------+----------+---------+-----------+----------+------------+
+| Rule1 | TCP      |         | 8000      |          |  8000      |
+------------------------------------------------------------------
+
+Now we can launch the Toaster web server in VM:
+
+    $ source toaster start webport=10.0.2.15:8000
+
+Interact with the Toaster web server with your host browser using URL:
+
+    http://127.0.0.1:8000
+
+
+
+
+
+
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb b/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb
index 0803ddb..045781c 100644
--- a/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb
@@ -1,5 +1,5 @@
 SUMMARY = "An image containing the build system itself"
-DESCRIPTION = "An image containing the build system that you can boot and run using either VMware Player or VMware Workstation."
+DESCRIPTION = "An image containing the build system that you can boot and run using either VirtualBox, VMware Player or VMware Workstation."
 HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance"
 
 LICENSE = "MIT"
@@ -7,7 +7,8 @@
                     file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted \
-                 kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcp-client"
+                 kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcp-client \
+                 tzdata python3-pip perl-misc"
 
 IMAGE_FEATURES += "x11-base package-management splash"
 
@@ -17,16 +18,17 @@
 # Do a quiet boot with limited console messages
 APPEND += "rootfstype=ext4 quiet"
 
-DEPENDS = "zip-native"
+DEPENDS = "zip-native python3-pip-native"
 IMAGE_FSTYPES = "vmdk"
 
-inherit core-image module-base
+inherit core-image module-base setuptools3
 
-SRCREV ?= "e92165f5cea1c345672dd866df6a44d1cd8b97ce"
-SRC_URI = "git://git.yoctoproject.org/poky;branch=morty \
+SRCREV ?= "b859272ad4053185d4980cac05481b430e05345f"
+SRC_URI = "git://git.yoctoproject.org/poky;branch=pyro \
            file://Yocto_Build_Appliance.vmx \
            file://Yocto_Build_Appliance.vmxf \
            file://README_VirtualBox_Guest_Additions.txt \
+           file://README_VirtualBox_Toaster.txt \
           "
 BA_INCLUDE_SOURCES ??= "0"
 
@@ -54,7 +56,11 @@
 	# Place the README_VirtualBox_Guest_Additions file in builders home folder.
 	cp ${WORKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/
 
+	# Place the README_VirtualBox_Toaster file in builders home folder.
+	cp ${WORKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/
+
 	# Create a symlink, needed for out-of-tree kernel modules build
+	rm -f  ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
 	lnr ${IMAGE_ROOTFS}${KERNEL_SRC_PATH} ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
 
 	echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf
@@ -82,12 +88,22 @@
 	echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers
 
 	# Load tap/tun at startup
+	rm -f ${IMAGE_ROOTFS}/sbin/iptables
 	lnr ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables
 	echo "tun" >> ${IMAGE_ROOTFS}/etc/modules
 
 	# Use Clearlooks GTK+ theme
 	mkdir -p ${IMAGE_ROOTFS}/etc/gtk-2.0
 	echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc
+
+	# Install modules needed for toaster
+	export STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}
+	export STAGING_INCDIR=${STAGING_INCDIR_NATIVE}
+	export HOME=${IMAGE_ROOTFS}/home/builder
+	mkdir -p ${IMAGE_ROOTFS}/home/builder/.cache/pip
+	pip3 install --user -I -U -v -r ${IMAGE_ROOTFS}/home/builder/poky/bitbake/toaster-requirements.txt
+	chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/.local
+	chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/.cache
 }
 
 IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; "
diff --git a/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal.bb b/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal.bb
index 8dd77b3..4630026 100644
--- a/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal.bb
@@ -1,6 +1,6 @@
 SUMMARY = "A small image just capable of allowing a device to boot."
 
-IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}"
+IMAGE_INSTALL = "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}"
 
 IMAGE_LINGUAS = " "
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/images/core-image-tiny-initramfs.bb b/import-layers/yocto-poky/meta/recipes-core/images/core-image-tiny-initramfs.bb
new file mode 100644
index 0000000..184727d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/images/core-image-tiny-initramfs.bb
@@ -0,0 +1,42 @@
+# Simple initramfs image artifact generation for tiny images.
+DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \
+the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
+first 'init' program more efficiently.  core-image-tiny-initramfs doesn't \
+actually generate an image but rather generates boot and rootfs artifacts \
+into a common location that can subsequently be picked up by external image \
+generation tools such as wic."
+
+PACKAGE_INSTALL = "initramfs-live-boot packagegroup-core-boot dropbear ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "core-image-tiny-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+# don't actually generate an image, just the artifacts needed for one
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES} wic"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "0"
+
+BAD_RECOMMENDATIONS += "busybox-syslog"
+
+# Use the same restriction as initramfs-live-install
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
+
+python tinyinitrd () {
+  # Modify our init file so the user knows we drop to shell prompt on purpose
+  newinit = None
+  with open(d.expand('${IMAGE_ROOTFS}/init'), 'r') as init:
+    newinit = init.read()
+    newinit = newinit.replace('Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell ', 'Poky Tiny Reference Distribution:')
+  with open(d.expand('${IMAGE_ROOTFS}/init'), 'w') as init:
+    init.write(newinit)
+}
+
+IMAGE_PREPROCESS_COMMAND += "tinyinitrd;"
diff --git a/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
index b562109..9c4b263 100644
--- a/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
+++ b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
@@ -171,19 +171,19 @@
 fi
 
 if [ -d /run/media/$1/loader ]; then
-    GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf"
-    # copy config files for gummiboot
+    SYSTEMDBOOT_CFGS="/ssd/loader/entries/*.conf"
+    # copy config files for systemd-boot
     cp -dr /run/media/$1/loader /ssd
     # delete the install entry
     rm -f /ssd/loader/entries/install.conf
     # delete the initrd lines
-    sed -i "/initrd /d" $GUMMIBOOT_CFGS
+    sed -i "/initrd /d" $SYSTEMDBOOT_CFGS
     # delete any LABEL= strings
-    sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS
+    sed -i "s/ LABEL=[^ ]*/ /" $SYSTEMDBOOT_CFGS
     # delete any root= strings
-    sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS
+    sed -i "s/ root=[^ ]*/ /" $SYSTEMDBOOT_CFGS
     # add the root= and other standard boot options
-    sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $GUMMIBOOT_CFGS
+    sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $SYSTEMDBOOT_CFGS
     # Add the test label
     echo -ne "title test\nlinux /test-kernel\noptions root=$testfs rw $rootwait quiet\n" > /ssd/loader/entries/test.conf
 fi
diff --git a/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index 441e252..5ad3a60 100644
--- a/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -22,6 +22,8 @@
 case $live_dev_name in
     mmcblk*)
     ;;
+    nvme*)
+    ;;
     *)
         live_dev_name=${live_dev_name%%[0-9]*}
     ;;
@@ -146,7 +148,8 @@
 # 2) they are detected asynchronously (need rootwait)
 rootwait=""
 part_prefix=""
-if [ ! "${device#/dev/mmcblk}" = "${device}" ]; then
+if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \
+   [ ! "${device#/dev/nvme}" = "${device}" ]; then
     part_prefix="p"
     rootwait="rootwait"
 fi
@@ -242,19 +245,19 @@
 
 if [ -d /run/media/$1/loader ]; then
     rootuuid=$(blkid -o value -s PARTUUID ${rootfs})
-    GUMMIBOOT_CFGS="/boot/loader/entries/*.conf"
-    # copy config files for gummiboot
+    SYSTEMDBOOT_CFGS="/boot/loader/entries/*.conf"
+    # copy config files for systemd-boot
     cp -dr /run/media/$1/loader /boot
     # delete the install entry
     rm -f /boot/loader/entries/install.conf
     # delete the initrd lines
-    sed -i "/initrd /d" $GUMMIBOOT_CFGS
+    sed -i "/initrd /d" $SYSTEMDBOOT_CFGS
     # delete any LABEL= strings
-    sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS
+    sed -i "s/ LABEL=[^ ]*/ /" $SYSTEMDBOOT_CFGS
     # delete any root= strings
-    sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS
+    sed -i "s/ root=[^ ]*/ /" $SYSTEMDBOOT_CFGS
     # add the root= and other standard boot options
-    sed -i "s@options *@options root=PARTUUID=$rootuuid rw $rootwait quiet @" $GUMMIBOOT_CFGS
+    sed -i "s@options *@options root=PARTUUID=$rootuuid rw $rootwait quiet @" $SYSTEMDBOOT_CFGS
 fi
 
 umount /tgt_root
diff --git a/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install.sh b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install.sh
index 04ce5fb..572613e 100644
--- a/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -21,6 +21,8 @@
 case $live_dev_name in
     mmcblk*)
     ;;
+    nvme*)
+    ;;
     *)
         live_dev_name=${live_dev_name%%[0-9]*}
     ;;
@@ -153,7 +155,8 @@
 # 2) they are detected asynchronously (need rootwait)
 rootwait=""
 part_prefix=""
-if [ ! "${device#/dev/mmcblk}" = "${device}" ]; then
+if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \
+   [ ! "${device#/dev/nvme}" = "${device}" ]; then
     part_prefix="p"
     rootwait="rootwait"
 fi
diff --git a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
index ce4622a..22a71ec 100755
--- a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -36,7 +36,7 @@
 		[ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
 	} || {
 		if [ -z "$ROOT_DIR" ]; then
-			eval $EXEC &
+			eval $EXEC
 		else
 			# Creating some files at rootfs time may fail and should fail,
 			# but these failures should not be logged to make sure the do_rootfs
@@ -70,7 +70,7 @@
 link_file() {
 	EXEC="
 	if [ -L \"$2\" ]; then
-		[ \"\$(readlink -f \"$2\")\" != \"\$(readlink -f \"$1\")\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
+		[ \"\$(readlink -f \"$2\")\" != \"$1\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
 	elif [ -d \"$2\" ]; then
 		if awk '\$2 == \"$2\" {exit 1}' /proc/mounts; then
 			cp -a $2/* $1 2>/dev/null;
@@ -86,7 +86,7 @@
 	test "$VOLATILE_ENABLE_CACHE" = yes && echo "	$EXEC" >> /etc/volatile.cache.build
 
 	if [ -z "$ROOT_DIR" ]; then
-		eval $EXEC &
+		eval $EXEC
 	else
 		# For the same reason with create_file(), failures should
 		# not be logged.
@@ -150,9 +150,9 @@
 		return 1
 	}
 
-	cat ${CFGFILE} | grep -v "^#" | \
-		while read LINE; do
-		eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`
+	cat ${CFGFILE} | sed 's/#.*//' | \
+	while read TTYPE TUSER TGROUP TMODE TNAME TLTARGET; do
+		test -z "${TLTARGET}" && continue
 		TNAME=${ROOT_DIR}${TNAME}
 		[ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
 
@@ -187,7 +187,7 @@
 
 		case "${TTYPE}" in
 			"f")  [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-."
-				create_file "${TNAME}" &
+				create_file "${TNAME}"
 				;;
 			"d")  [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-."
 				mk_dir "${TNAME}"
diff --git a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
index 0a52c90..f5b5b99 100644
--- a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
+++ b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
@@ -22,6 +22,10 @@
   mount -t debugfs debugfs /sys/kernel/debug
 fi
 
+if [ -e /sys/kernel/config ] && grep -q configfs /proc/filesystems; then
+  mount -t configfs configfs /sys/kernel/config
+fi
+
 if ! [ -e /dev/zero ] && [ -e /dev ] && grep -q devtmpfs /proc/filesystems; then
   mount -n -t devtmpfs devtmpfs /dev
 fi
diff --git a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles
index 297245d..bc17c45 100644
--- a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles
+++ b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -1,11 +1,13 @@
 # This configuration file lists filesystem objects that should get verified
 # during startup and be created if missing.
 #
-# Every line must either be a comment starting with #
-# or a definition of format:
+# Entries have the following format:
 # <type> <owner> <group> <mode> <path> <linksource>
 # where the items are separated by whitespace !
 #
+# The # character introduces a comment lasting until end of line.
+# Blank lines are ignored.
+#
 # <type> : d|f|l : (d)irectory|(f)ile|(l)ink
 #
 # A linking example:
diff --git a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts_1.0.bb b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts_1.0.bb
index 8f110b0..2e4f7e4 100644
--- a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -44,7 +44,7 @@
 
 inherit update-alternatives
 DEPENDS_append = " update-rc.d-native"
-DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
 
 PACKAGES =+ "${PN}-functions"
 RDEPENDS_${PN} = "${PN}-functions \
diff --git a/import-layers/yocto-poky/meta/recipes-core/kbd/kbd_2.0.3.bb b/import-layers/yocto-poky/meta/recipes-core/kbd/kbd_2.0.3.bb
deleted file mode 100644
index 54d1683..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/kbd/kbd_2.0.3.bb
+++ /dev/null
@@ -1,53 +0,0 @@
-SUMMARY = "Keytable files and keyboard utilities"
-# everything minus console-fonts is GPLv2+
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a5fcc36121d93e1f69d96a313078c8b5"
-DEPENDS = "libcheck"
-
-inherit autotools gettext ptest pkgconfig
-
-RREPLACES_${PN} = "console-tools"
-RPROVIDES_${PN} = "console-tools"
-RCONFLICTS_${PN} = "console-tools"
-
-SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
-           file://run-ptest \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://set-proper-path-of-resources.patch', '', d)} \
-          "
-
-SRC_URI[md5sum] = "231b46e7142eb41ea3ae06d2ded3c208"
-SRC_URI[sha256sum] = "7a899de1c0eb75f3aea737095a736f2375e1cbfbe693fc14a3fe0bfb4649fb5e"
-
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
-PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam,"
-
-do_compile_ptest() {
-    oe_runmake -C ${B}/tests dumpkeys-fulltable alt-is-meta
-}
-
-do_install_ptest() {
-    install -D ${B}/tests/Makefile ${D}${PTEST_PATH}/tests/Makefile
-    sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
-	-e '/libkeymap_.*_SOURCES =/d' -e '/$(EXEEXT):/,/^$/d' ${D}${PTEST_PATH}/tests/Makefile
-
-    find ${B}/tests -executable -exec install {} ${D}${PTEST_PATH}/tests \;
-    find ${S}/tests \( -name \*.map -o -name \*.bin -o -name \*.output \) -exec install {} ${D}${PTEST_PATH}/tests \;
-
-    install -D -m 755 ${S}/config/test-driver ${D}${PTEST_PATH}/config/test-driver
-}
-
-PACKAGES += "${PN}-consolefonts ${PN}-keymaps ${PN}-unimaps ${PN}-consoletrans"
-
-FILES_${PN}-consolefonts = "${datadir}/consolefonts"
-FILES_${PN}-consoletrans = "${datadir}/consoletrans"
-FILES_${PN}-keymaps = "${datadir}/keymaps"
-FILES_${PN}-unimaps = "${datadir}/unimaps"
-
-RDEPENDS_${PN}-ptest = "make"
-
-inherit update-alternatives
-
-ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt"
-ALTERNATIVE_PRIORITY = "100"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-core/kbd/kbd_2.0.4.bb b/import-layers/yocto-poky/meta/recipes-core/kbd/kbd_2.0.4.bb
new file mode 100644
index 0000000..65325c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/kbd/kbd_2.0.4.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Keytable files and keyboard utilities"
+# everything minus console-fonts is GPLv2+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a5fcc36121d93e1f69d96a313078c8b5"
+DEPENDS = "libcheck"
+
+inherit autotools gettext ptest pkgconfig
+
+RREPLACES_${PN} = "console-tools"
+RPROVIDES_${PN} = "console-tools"
+RCONFLICTS_${PN} = "console-tools"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
+           file://run-ptest \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://set-proper-path-of-resources.patch', '', d)} \
+          "
+
+SRC_URI[md5sum] = "c1635a5a83b63aca7f97a3eab39ebaa6"
+SRC_URI[sha256sum] = "5fd90af6beb225a9bb9b9fb414c090fba53c9a55793e172f508cd43652e59a88"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam,"
+
+do_compile_ptest() {
+    oe_runmake -C ${B}/tests dumpkeys-fulltable alt-is-meta
+}
+
+do_install_ptest() {
+    install -D ${B}/tests/Makefile ${D}${PTEST_PATH}/tests/Makefile
+    sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
+	-e '/libkeymap_.*_SOURCES =/d' -e '/$(EXEEXT):/,/^$/d' ${D}${PTEST_PATH}/tests/Makefile
+
+    find ${B}/tests -executable -exec install {} ${D}${PTEST_PATH}/tests \;
+    find ${S}/tests \( -name \*.map -o -name \*.bin -o -name \*.output \) -exec install {} ${D}${PTEST_PATH}/tests \;
+
+    install -D -m 755 ${S}/config/test-driver ${D}${PTEST_PATH}/config/test-driver
+}
+
+PACKAGES += "${PN}-consolefonts ${PN}-keymaps ${PN}-unimaps ${PN}-consoletrans"
+
+FILES_${PN}-consolefonts = "${datadir}/consolefonts"
+FILES_${PN}-consoletrans = "${datadir}/consoletrans"
+FILES_${PN}-keymaps = "${datadir}/keymaps"
+FILES_${PN}-unimaps = "${datadir}/unimaps"
+
+RDEPENDS_${PN}-ptest = "make"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch
new file mode 100644
index 0000000..d1ad551
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch
@@ -0,0 +1,99 @@
+From 78dbd4c09d617a9cb730d796f94ee4d93840d3cc Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Fri, 9 Jun 2017 17:50:46 +0200
+Subject: [PATCH] Make ptest run the python tests if python is enabled
+
+One of the tests (tstLastError.py) needed a minor correction. It might
+be due to the fact that the tests are forced to run with Python 3.
+
+Upstream-Status: Inappropriate [OE specific]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ Makefile.am                  |  2 +-
+ python/Makefile.am           |  9 +++++++++
+ python/tests/Makefile.am     | 12 ++++++++++--
+ python/tests/tstLastError.py |  2 +-
+ 4 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index e181ee0..7960e7d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -207,9 +207,9 @@ install-ptest:
+ 	install $(noinst_PROGRAMS) $(DESTDIR))
+ 	cp -r $(srcdir)/test $(DESTDIR)
+ 	cp -r $(srcdir)/result $(DESTDIR)
+-	cp -r $(srcdir)/python $(DESTDIR)
+ 	cp Makefile $(DESTDIR)
+ 	sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
++	$(MAKE) -C python install-ptest
+ 
+ runtests:
+ 	[ -d test   ] || $(LN_S) $(srcdir)/test   .
+diff --git a/python/Makefile.am b/python/Makefile.am
+index 34aed96..ba3ec6a 100644
+--- a/python/Makefile.am
++++ b/python/Makefile.am
+@@ -48,7 +48,16 @@ GENERATED = libxml2class.py libxml2class.txt $(BUILT_SOURCES)
+ 
+ $(GENERATED): $(srcdir)/generator.py $(API_DESC)
+ 	$(PYTHON) $(srcdir)/generator.py $(srcdir)
++
++install-ptest:
++	cp -r $(srcdir) $(DESTDIR)
++	sed -e 's|^Makefile:|_Makefile:|' \
++	    -e 's|^\(tests test:\) all|\1|' Makefile >$(DESTDIR)/python/Makefile
++	$(MAKE) -C tests install-ptest
++else
++install-ptest:
+ endif
+ 
++.PHONY: tests test
+ tests test: all
+ 	cd tests && $(MAKE) tests
+diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am
+index 95ebead..418e21e 100644
+--- a/python/tests/Makefile.am
++++ b/python/tests/Makefile.am
+@@ -59,6 +59,11 @@ XMLS=		\
+ CLEANFILES = core tmp.xml *.pyc
+ 
+ if WITH_PYTHON
++install-ptest:
++	cp -r $(srcdir) $(DESTDIR)/python
++	sed -e 's|^Makefile:|_Makefile:|' \
++	    -e 's|^\(srcdir = \).*|\1.|' Makefile >$(DESTDIR)/python/tests/Makefile
++
+ tests: $(PYTESTS)
+ 	@for f in $(XMLS) ; do test -f $$f || $(LN_S) $(srcdir)/$$f . ; done
+ 	@echo "## running Python regression tests"
+@@ -68,8 +73,11 @@ tests: $(PYTESTS)
+ 	   export LD_LIBRARY_PATH; \
+ 	   for test in $(PYTESTS) ; \
+ 	   do log=`$(PYTHON) $(srcdir)/$$test` ; \
+-	   if [ "`echo $$log | grep OK`" = "" ] ; then \
+-	   echo "-- $$test" ; echo "$$log" ; fi ; done)
++	   if [ "`echo $$log | grep OK`" ]; then \
++	   echo "PASS: $$test"; else \
++	   echo "$$log"; echo "FAIL: $$test"; fi; done)
+ else
++install-ptest:
++
+ tests:
+ endif
+diff --git a/python/tests/tstLastError.py b/python/tests/tstLastError.py
+index d5f9be7..3e5bef8 100755
+--- a/python/tests/tstLastError.py
++++ b/python/tests/tstLastError.py
+@@ -25,7 +25,7 @@ class TestCase(unittest.TestCase):
+         when the exception is raised, check the libxml2.lastError for
+         expected values."""
+         # disable the default error handler
+-        libxml2.registerErrorHandler(None,None)
++        libxml2.registerErrorHandler(lambda ctx,str: None,None)
+         try:
+             f(*args)
+         except exc:
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/CVE-2016-9318.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/CVE-2016-9318.patch
deleted file mode 100644
index 3581ab8..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/CVE-2016-9318.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-From 7fa1cd31552d52d50a9101f07c816ff6dd2d9f19 Mon Sep 17 00:00:00 2001
-From: Doran Moppert <dmoppert@redhat.com>
-Date: Fri, 7 Apr 2017 16:45:56 +0200
-Subject: [PATCH] Add an XML_PARSE_NOXXE flag to block all entities loading
- even local
-
-For https://bugzilla.gnome.org/show_bug.cgi?id=772726
-
-* include/libxml/parser.h: Add a new parser flag XML_PARSE_NOXXE
-* elfgcchack.h, xmlIO.h, xmlIO.c: associated loading routine
-* include/libxml/xmlerror.h: new error raised
-* xmllint.c: adds --noxxe flag to activate the option
-
-Upstream-Status: Backport
-CVE: CVE-2016-9318
-
-Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
----
- elfgcchack.h              | 10 ++++++++++
- include/libxml/parser.h   |  3 ++-
- include/libxml/xmlIO.h    |  8 ++++++++
- include/libxml/xmlerror.h |  1 +
- parser.c                  |  4 ++++
- xmlIO.c                   | 40 +++++++++++++++++++++++++++++++++++-----
- xmllint.c                 |  5 +++++
- 7 files changed, 65 insertions(+), 6 deletions(-)
-
-diff --git a/elfgcchack.h b/elfgcchack.h
-index 8c52884..1b81dcd 100644
---- a/elfgcchack.h
-+++ b/elfgcchack.h
-@@ -6547,6 +6547,16 @@ extern __typeof (xmlNoNetExternalEntityLoader) xmlNoNetExternalEntityLoader__int
- #endif
- #endif
- 
-+#ifdef bottom_xmlIO
-+#undef xmlNoXxeExternalEntityLoader
-+extern __typeof (xmlNoXxeExternalEntityLoader) xmlNoXxeExternalEntityLoader __attribute((alias("xmlNoXxeExternalEntityLoader__internal_alias")));
-+#else
-+#ifndef xmlNoXxeExternalEntityLoader
-+extern __typeof (xmlNoXxeExternalEntityLoader) xmlNoXxeExternalEntityLoader__internal_alias __attribute((visibility("hidden")));
-+#define xmlNoXxeExternalEntityLoader xmlNoXxeExternalEntityLoader__internal_alias
-+#endif
-+#endif
-+
- #ifdef bottom_tree
- #undef xmlNodeAddContent
- extern __typeof (xmlNodeAddContent) xmlNodeAddContent __attribute((alias("xmlNodeAddContent__internal_alias")));
-diff --git a/include/libxml/parser.h b/include/libxml/parser.h
-index 47fbec0..63ca1b9 100644
---- a/include/libxml/parser.h
-+++ b/include/libxml/parser.h
-@@ -1111,7 +1111,8 @@ typedef enum {
-     XML_PARSE_HUGE      = 1<<19,/* relax any hardcoded limit from the parser */
-     XML_PARSE_OLDSAX    = 1<<20,/* parse using SAX2 interface before 2.7.0 */
-     XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */
--    XML_PARSE_BIG_LINES = 1<<22 /* Store big lines numbers in text PSVI field */
-+    XML_PARSE_BIG_LINES = 1<<22,/* Store big lines numbers in text PSVI field */
-+    XML_PARSE_NOXXE	= 1<<23 /* Forbid any external entity loading */
- } xmlParserOption;
- 
- XMLPUBFUN void XMLCALL
-diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h
-index 3e41744..8d3fdef 100644
---- a/include/libxml/xmlIO.h
-+++ b/include/libxml/xmlIO.h
-@@ -300,6 +300,14 @@ XMLPUBFUN xmlParserInputPtr XMLCALL
- 					 xmlParserCtxtPtr ctxt);
- 
- /*
-+ * A predefined entity loader external entity expansion
-+ */
-+XMLPUBFUN xmlParserInputPtr XMLCALL
-+	xmlNoXxeExternalEntityLoader	(const char *URL,
-+					 const char *ID,
-+					 xmlParserCtxtPtr ctxt);
-+
-+/*
-  * xmlNormalizeWindowsPath is obsolete, don't use it.
-  * Check xmlCanonicPath in uri.h for a better alternative.
-  */
-diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h
-index 037c16d..3036062 100644
---- a/include/libxml/xmlerror.h
-+++ b/include/libxml/xmlerror.h
-@@ -470,6 +470,7 @@ typedef enum {
-     XML_IO_EADDRINUSE, /* 1554 */
-     XML_IO_EALREADY, /* 1555 */
-     XML_IO_EAFNOSUPPORT, /* 1556 */
-+    XML_IO_ILLEGAL_XXE, /* 1557 */
-     XML_XINCLUDE_RECURSION=1600,
-     XML_XINCLUDE_PARSE_VALUE, /* 1601 */
-     XML_XINCLUDE_ENTITY_DEF_MISMATCH, /* 1602 */
-diff --git a/parser.c b/parser.c
-index 53a6b7f..609a270 100644
---- a/parser.c
-+++ b/parser.c
-@@ -15350,6 +15350,10 @@ xmlCtxtUseOptionsInternal(xmlParserCtxtPtr ctxt, int options, const char *encodi
- 	ctxt->options |= XML_PARSE_NONET;
-         options -= XML_PARSE_NONET;
-     }
-+    if (options & XML_PARSE_NOXXE) {
-+	ctxt->options |= XML_PARSE_NOXXE;
-+        options -= XML_PARSE_NOXXE;
-+    }
-     if (options & XML_PARSE_COMPACT) {
- 	ctxt->options |= XML_PARSE_COMPACT;
-         options -= XML_PARSE_COMPACT;
-diff --git a/xmlIO.c b/xmlIO.c
-index 1a79c09..304f822 100644
---- a/xmlIO.c
-+++ b/xmlIO.c
-@@ -210,6 +210,7 @@ static const char *IOerr[] = {
-     "adddress in use",		/* EADDRINUSE */
-     "already in use",		/* EALREADY */
-     "unknown address familly",	/* EAFNOSUPPORT */
-+    "Attempt to load external entity %s", /* XML_IO_ILLEGAL_XXE */
- };
- 
- #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
-@@ -4053,13 +4054,22 @@ xmlDefaultExternalEntityLoader(const char *URL, const char *ID,
-     xmlGenericError(xmlGenericErrorContext,
-                     "xmlDefaultExternalEntityLoader(%s, xxx)\n", URL);
- #endif
--    if ((ctxt != NULL) && (ctxt->options & XML_PARSE_NONET)) {
-+    if (ctxt != NULL) {
-         int options = ctxt->options;
- 
--	ctxt->options -= XML_PARSE_NONET;
--        ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
--	ctxt->options = options;
--	return(ret);
-+        if (options & XML_PARSE_NOXXE) {
-+            ctxt->options -= XML_PARSE_NOXXE;
-+            ret = xmlNoXxeExternalEntityLoader(URL, ID, ctxt);
-+            ctxt->options = options;
-+            return(ret);
-+        }
-+ 
-+        if (options & XML_PARSE_NONET) {
-+            ctxt->options -= XML_PARSE_NONET;
-+            ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
-+            ctxt->options = options;
-+            return(ret);
-+        }
-     }
- #ifdef LIBXML_CATALOG_ENABLED
-     resource = xmlResolveResourceFromCatalog(URL, ID, ctxt);
-@@ -4160,6 +4170,13 @@ xmlNoNetExternalEntityLoader(const char *URL, const char *ID,
-     xmlParserInputPtr input = NULL;
-     xmlChar *resource = NULL;
- 
-+    if (ctxt == NULL) {
-+        return(NULL);
-+    }
-+    if (ctxt->input_id == 1) {
-+        return xmlDefaultExternalEntityLoader((const char *) URL, ID, ctxt);
-+    }
-+
- #ifdef LIBXML_CATALOG_ENABLED
-     resource = xmlResolveResourceFromCatalog(URL, ID, ctxt);
- #endif
-@@ -4182,5 +4199,18 @@ xmlNoNetExternalEntityLoader(const char *URL, const char *ID,
-     return(input);
- }
- 
-+xmlParserInputPtr
-+xmlNoXxeExternalEntityLoader(const char *URL, const char *ID,
-+                          xmlParserCtxtPtr ctxt) {
-+    if (ctxt == NULL) {
-+        return(NULL);
-+    }
-+    if (ctxt->input_id == 1) {
-+        return xmlDefaultExternalEntityLoader((const char *) URL, ID, ctxt);
-+    }
-+    xmlIOErr(XML_IO_ILLEGAL_XXE, (const char *) URL);
-+    return(NULL);
-+}
-+
- #define bottom_xmlIO
- #include "elfgcchack.h"
-diff --git a/xmllint.c b/xmllint.c
-index 67f7adb..d9368c1 100644
---- a/xmllint.c
-+++ b/xmllint.c
-@@ -3019,6 +3019,7 @@ static void usage(const char *name) {
-     printf("\t--path 'paths': provide a set of paths for resources\n");
-     printf("\t--load-trace : print trace of all external entities loaded\n");
-     printf("\t--nonet : refuse to fetch DTDs or entities over network\n");
-+    printf("\t--noxxe : forbid any external entity loading\n");
-     printf("\t--nocompact : do not generate compact text nodes\n");
-     printf("\t--htmlout : output results as HTML\n");
-     printf("\t--nowrap : do not put HTML doc wrapper\n");
-@@ -3461,6 +3462,10 @@ main(int argc, char **argv) {
-                    (!strcmp(argv[i], "--nonet"))) {
- 	    options |= XML_PARSE_NONET;
- 	    xmlSetExternalEntityLoader(xmlNoNetExternalEntityLoader);
-+        } else if ((!strcmp(argv[i], "-noxxe")) ||
-+                   (!strcmp(argv[i], "--noxxe"))) {
-+	    options |= XML_PARSE_NOXXE;
-+	    xmlSetExternalEntityLoader(xmlNoXxeExternalEntityLoader);
-         } else if ((!strcmp(argv[i], "-nocompact")) ||
-                    (!strcmp(argv[i], "--nocompact"))) {
- 	    options &= ~XML_PARSE_COMPACT;
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-0663.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-0663.patch
new file mode 100644
index 0000000..0108265
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-0663.patch
@@ -0,0 +1,40 @@
+libxml2: Fix CVE-2017-0663
+
+[No upstream tracking] -- https://bugzilla.gnome.org/show_bug.cgi?id=780228
+
+valid: Fix type confusion in xmlValidateOneNamespace
+
+Comment out code that casts xmlNsPtr to xmlAttrPtr. ID types
+on namespace declarations make no practical sense anyway.
+
+Fixes bug 780228
+
+Upstream-Status: Backport [https://git.gnome.org/browse/libxml2/commit/?id=92b9e8c8b3787068565a1820ba575d042f9eec66]
+CVE: CVE-2017-0663
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/valid.c b/valid.c
+index 19f84b8..e03d35e 100644
+--- a/valid.c
++++ b/valid.c
+@@ -4621,6 +4621,12 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
+ 	}
+     }
+ 
++    /*
++     * Casting ns to xmlAttrPtr is wrong. We'd need separate functions
++     * xmlAddID and xmlAddRef for namespace declarations, but it makes
++     * no practical sense to use ID types anyway.
++     */
++#if 0
+     /* Validity Constraint: ID uniqueness */
+     if (attrDecl->atype == XML_ATTRIBUTE_ID) {
+         if (xmlAddID(ctxt, doc, value, (xmlAttrPtr) ns) == NULL)
+@@ -4632,6 +4638,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
+         if (xmlAddRef(ctxt, doc, value, (xmlAttrPtr) ns) == NULL)
+ 	    ret = 0;
+     }
++#endif
+ 
+     /* Validity Constraint: Notation Attributes */
+     if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-5969.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-5969.patch
new file mode 100644
index 0000000..571b05c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-5969.patch
@@ -0,0 +1,62 @@
+libxml2-2.9.4: Fix CVE-2017-5969
+
+[No upstream tracking] -- https://bugzilla.gnome.org/show_bug.cgi?id=758422
+
+valid: Fix NULL pointer deref in xmlDumpElementContent
+
+Can only be triggered in recovery mode.
+
+Fixes bug 758422
+
+Upstream-Status: Backport - [https://git.gnome.org/browse/libxml2/commit/?id=94691dc884d1a8ada39f073408b4bb92fe7fe882]
+CVE: CVE-2017-5969
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/valid.c b/valid.c
+index 19f84b8..0a8e58a 100644
+--- a/valid.c
++++ b/valid.c
+@@ -1172,29 +1172,33 @@ xmlDumpElementContent(xmlBufferPtr buf, xmlElementContentPtr content, int glob)
+ 	    xmlBufferWriteCHAR(buf, content->name);
+ 	    break;
+ 	case XML_ELEMENT_CONTENT_SEQ:
+-	    if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
+-	        (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
++	    if ((content->c1 != NULL) &&
++	        ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
++	         (content->c1->type == XML_ELEMENT_CONTENT_SEQ)))
+ 		xmlDumpElementContent(buf, content->c1, 1);
+ 	    else
+ 		xmlDumpElementContent(buf, content->c1, 0);
+             xmlBufferWriteChar(buf, " , ");
+-	    if ((content->c2->type == XML_ELEMENT_CONTENT_OR) ||
+-	        ((content->c2->type == XML_ELEMENT_CONTENT_SEQ) &&
+-		 (content->c2->ocur != XML_ELEMENT_CONTENT_ONCE)))
++	    if ((content->c2 != NULL) &&
++	        ((content->c2->type == XML_ELEMENT_CONTENT_OR) ||
++	         ((content->c2->type == XML_ELEMENT_CONTENT_SEQ) &&
++		  (content->c2->ocur != XML_ELEMENT_CONTENT_ONCE))))
+ 		xmlDumpElementContent(buf, content->c2, 1);
+ 	    else
+ 		xmlDumpElementContent(buf, content->c2, 0);
+ 	    break;
+ 	case XML_ELEMENT_CONTENT_OR:
+-	    if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
+-	        (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
++	    if ((content->c1 != NULL) &&
++	        ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
++	         (content->c1->type == XML_ELEMENT_CONTENT_SEQ)))
+ 		xmlDumpElementContent(buf, content->c1, 1);
+ 	    else
+ 		xmlDumpElementContent(buf, content->c1, 0);
+             xmlBufferWriteChar(buf, " | ");
+-	    if ((content->c2->type == XML_ELEMENT_CONTENT_SEQ) ||
+-	        ((content->c2->type == XML_ELEMENT_CONTENT_OR) &&
+-		 (content->c2->ocur != XML_ELEMENT_CONTENT_ONCE)))
++	    if ((content->c2 != NULL) &&
++	        ((content->c2->type == XML_ELEMENT_CONTENT_SEQ) ||
++	         ((content->c2->type == XML_ELEMENT_CONTENT_OR) &&
++		  (content->c2->ocur != XML_ELEMENT_CONTENT_ONCE))))
+ 		xmlDumpElementContent(buf, content->c2, 1);
+ 	    else
+ 		xmlDumpElementContent(buf, content->c2, 0);
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-8872.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-8872.patch
new file mode 100644
index 0000000..26779aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-8872.patch
@@ -0,0 +1,37 @@
+From d2f873a541c72b0f67e15562819bf98b884b30b7 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 23 Aug 2017 16:04:49 +0800
+Subject: [PATCH] fix CVE-2017-8872
+
+this makes xmlHaltParser "empty" the buffer, as it resets cur and ava
+il too here.
+
+this seems to cure this specific issue, and also passes the testsuite
+
+Signed-off-by: Marcus Meissner <meissner@suse.de>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=775200
+Upstream-Status: Backport [https://bugzilla.gnome.org/attachment.cgi?id=355527&action=diff]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ parser.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/parser.c b/parser.c
+index 9506ead..6c07ffd 100644
+--- a/parser.c
++++ b/parser.c
+@@ -12664,6 +12664,10 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
+ 	}
+ 	ctxt->input->cur = BAD_CAST"";
+ 	ctxt->input->base = ctxt->input->cur;
++	if (ctxt->input->buf) {
++		xmlBufEmpty (ctxt->input->buf->buffer);
++	} else
++		ctxt->input->length = 0;
+     }
+ }
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-9047_CVE-2017-9048.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-9047_CVE-2017-9048.patch
new file mode 100644
index 0000000..8b03456
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-9047_CVE-2017-9048.patch
@@ -0,0 +1,103 @@
+libxml2-2.9.4: Fix CVE-2017-9047 and CVE-2017-9048
+
+[No upstream tracking] -- https://bugzilla.gnome.org/show_bug.cgi?id=781333
+ -- https://bugzilla.gnome.org/show_bug.cgi?id=781701
+
+valid: Fix buffer size checks in xmlSnprintfElementContent
+
+xmlSnprintfElementContent failed to correctly check the available
+buffer space in two locations.
+
+Fixes bug 781333 and bug 781701
+
+Upstream-Status: Backport [https://git.gnome.org/browse/libxml2/commit/?id=932cc9896ab41475d4aa429c27d9afd175959d74]
+CVE: CVE-2017-9047 CVE-2017-9048
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/result/valid/781333.xml b/result/valid/781333.xml
+new file mode 100644
+index 0000000..01baf11
+--- /dev/null
++++ b/result/valid/781333.xml
+@@ -0,0 +1,5 @@
++<?xml version="1.0"?>
++<!DOCTYPE a [
++<!ELEMENT a (pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp:llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll)>
++]>
++<a/>
+diff --git a/result/valid/781333.xml.err b/result/valid/781333.xml.err
+new file mode 100644
+index 0000000..2176200
+--- /dev/null
++++ b/result/valid/781333.xml.err
+@@ -0,0 +1,3 @@
++./test/valid/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got 
++<a/>
++    ^
+diff --git a/result/valid/781333.xml.err.rdr b/result/valid/781333.xml.err.rdr
+new file mode 100644
+index 0000000..1195a04
+--- /dev/null
++++ b/result/valid/781333.xml.err.rdr
+@@ -0,0 +1,6 @@
++./test/valid/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got 
++<a/>
++    ^
++./test/valid/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more child
++
++^
+diff --git a/test/valid/781333.xml b/test/valid/781333.xml
+new file mode 100644
+index 0000000..bceac9c
+--- /dev/null
++++ b/test/valid/781333.xml
+@@ -0,0 +1,4 @@
++<!DOCTYPE a [
++    <!ELEMENT a (pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp:llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll)>
++]>
++<a/>
+diff --git a/valid.c b/valid.c
+index 19f84b8..aaa30f6 100644
+--- a/valid.c
++++ b/valid.c
+@@ -1262,22 +1262,23 @@ xmlSnprintfElementContent(char *buf, int size, xmlElementContentPtr content, int
+         case XML_ELEMENT_CONTENT_PCDATA:
+             strcat(buf, "#PCDATA");
+ 	    break;
+-	case XML_ELEMENT_CONTENT_ELEMENT:
++	case XML_ELEMENT_CONTENT_ELEMENT: {
++            int qnameLen = xmlStrlen(content->name);
++
++	    if (content->prefix != NULL)
++                qnameLen += xmlStrlen(content->prefix) + 1;
++	    if (size - len < qnameLen + 10) {
++		strcat(buf, " ...");
++		return;
++	    }
+ 	    if (content->prefix != NULL) {
+-		if (size - len < xmlStrlen(content->prefix) + 10) {
+-		    strcat(buf, " ...");
+-		    return;
+-		}
+ 		strcat(buf, (char *) content->prefix);
+ 		strcat(buf, ":");
+ 	    }
+-	    if (size - len < xmlStrlen(content->name) + 10) {
+-		strcat(buf, " ...");
+-		return;
+-	    }
+ 	    if (content->name != NULL)
+ 		strcat(buf, (char *) content->name);
+ 	    break;
++	}
+ 	case XML_ELEMENT_CONTENT_SEQ:
+ 	    if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
+ 	        (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
+@@ -1319,6 +1320,7 @@ xmlSnprintfElementContent(char *buf, int size, xmlElementContentPtr content, int
+ 		xmlSnprintfElementContent(buf, size, content->c2, 0);
+ 	    break;
+     }
++    if (size - strlen(buf) <= 2) return;
+     if (englob)
+         strcat(buf, ")");
+     switch (content->ocur) {
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-9049_CVE-2017-9050.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-9049_CVE-2017-9050.patch
new file mode 100644
index 0000000..591075d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-CVE-2017-9049_CVE-2017-9050.patch
@@ -0,0 +1,291 @@
+libxml2-2.9.4: Fix CVE-2017-9049 and CVE-2017-9050
+
+[No upstream tracking] -- https://bugzilla.gnome.org/show_bug.cgi?id=781205
+ -- https://bugzilla.gnome.org/show_bug.cgi?id=781361
+
+parser: Fix handling of parameter-entity references
+
+There were two bugs where parameter-entity references could lead to an
+unexpected change of the input buffer in xmlParseNameComplex and
+xmlDictLookup being called with an invalid pointer.
+
+Percent sign in DTD Names
+=========================
+
+The NEXTL macro used to call xmlParserHandlePEReference. When parsing
+"complex" names inside the DTD, this could result in entity expansion
+which created a new input buffer. The fix is to simply remove the call
+to xmlParserHandlePEReference from the NEXTL macro. This is safe because
+no users of the macro require expansion of parameter entities.
+
+- xmlParseNameComplex
+- xmlParseNCNameComplex
+- xmlParseNmtoken
+
+The percent sign is not allowed in names, which are grammatical tokens.
+
+- xmlParseEntityValue
+
+Parameter-entity references in entity values are expanded but this
+happens in a separate step in this function.
+
+- xmlParseSystemLiteral
+
+Parameter-entity references are ignored in the system literal.
+
+- xmlParseAttValueComplex
+- xmlParseCharDataComplex
+- xmlParseCommentComplex
+- xmlParsePI
+- xmlParseCDSect
+
+Parameter-entity references are ignored outside the DTD.
+
+- xmlLoadEntityContent
+
+This function is only called from xmlStringLenDecodeEntities and
+entities are replaced in a separate step immediately after the function
+call.
+
+This bug could also be triggered with an internal subset and double
+entity expansion.
+
+This fixes bug 766956 initially reported by Wei Lei and independently by
+Chromium's ClusterFuzz, Hanno Böck, and Marco Grassi. Thanks to everyone
+involved.
+
+xmlParseNameComplex with XML_PARSE_OLD10
+========================================
+
+When parsing Names inside an expanded parameter entity with the
+XML_PARSE_OLD10 option, xmlParseNameComplex would call xmlGROW via the
+GROW macro if the input buffer was exhausted. At the end of the
+parameter entity's replacement text, this function would then call
+xmlPopInput which invalidated the input buffer.
+
+There should be no need to invoke GROW in this situation because the
+buffer is grown periodically every XML_PARSER_CHUNK_SIZE characters and,
+at least for UTF-8, in xmlCurrentChar. This also matches the code path
+executed when XML_PARSE_OLD10 is not set.
+
+This fixes bugs 781205 (CVE-2017-9049) and 781361 (CVE-2017-9050).
+Thanks to Marcel Böhme and Thuan Pham for the report.
+
+Additional hardening
+====================
+
+A separate check was added in xmlParseNameComplex to validate the
+buffer size.
+
+Fixes bug 781205 and bug 781361
+
+Upstream-Status: Backport [https://git.gnome.org/browse/libxml2/commit/?id=932cc9896ab41475d4aa429c27d9afd175959d74]
+CVE: CVE-2017-9049 CVE-2017-9050
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index 9f988b0..dab15a4 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -422,6 +422,24 @@ Errtests : xmllint$(EXEEXT)
+ 	      if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
+ 	      rm result.$$name error.$$name ; \
+ 	  fi ; fi ; done)
++	@echo "## Error cases regression tests (old 1.0)"
++	-@(for i in $(srcdir)/test/errors10/*.xml ; do \
++	  name=`basename $$i`; \
++	  if [ ! -d $$i ] ; then \
++	  if [ ! -f $(srcdir)/result/errors10/$$name ] ; then \
++	      echo New test file $$name ; \
++	      $(CHECKER) $(top_builddir)/xmllint --oldxml10 $$i \
++	         2> $(srcdir)/result/errors10/$$name.err \
++		 > $(srcdir)/result/errors10/$$name ; \
++	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
++	  else \
++	      log=`$(CHECKER) $(top_builddir)/xmllint --oldxml10 $$i 2> error.$$name > result.$$name ; \
++	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0"; \
++	      diff $(srcdir)/result/errors10/$$name result.$$name ; \
++	      diff $(srcdir)/result/errors10/$$name.err error.$$name` ; \
++	      if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
++	      rm result.$$name error.$$name ; \
++	  fi ; fi ; done)
+ 	@echo "## Error cases stream regression tests"
+ 	-@(for i in $(srcdir)/test/errors/*.xml ; do \
+ 	  name=`basename $$i`; \
+diff --git a/parser.c b/parser.c
+index 609a270..8e11c12 100644
+--- a/parser.c
++++ b/parser.c
+@@ -2115,7 +2115,6 @@ static void xmlGROW (xmlParserCtxtPtr ctxt) {
+ 	ctxt->input->line++; ctxt->input->col = 1;			\
+     } else ctxt->input->col++;						\
+     ctxt->input->cur += l;				\
+-    if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt);	\
+   } while (0)
+ 
+ #define CUR_CHAR(l) xmlCurrentChar(ctxt, &l)
+@@ -3406,13 +3405,6 @@ xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
+ 	    len += l;
+ 	    NEXTL(l);
+ 	    c = CUR_CHAR(l);
+-	    if (c == 0) {
+-		count = 0;
+-		GROW;
+-                if (ctxt->instate == XML_PARSER_EOF)
+-                    return(NULL);
+-		c = CUR_CHAR(l);
+-	    }
+ 	}
+     }
+     if ((len > XML_MAX_NAME_LENGTH) &&
+@@ -3420,6 +3412,16 @@ xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
+         xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
+         return(NULL);
+     }
++    if (ctxt->input->cur - ctxt->input->base < len) {
++        /*
++         * There were a couple of bugs where PERefs lead to to a change
++         * of the buffer. Check the buffer size to avoid passing an invalid
++         * pointer to xmlDictLookup.
++         */
++        xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
++                    "unexpected change of input buffer");
++        return (NULL);
++    }
+     if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
+         return(xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len));
+     return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
+diff --git a/result/errors10/781205.xml b/result/errors10/781205.xml
+new file mode 100644
+index 0000000..e69de29
+diff --git a/result/errors10/781205.xml.err b/result/errors10/781205.xml.err
+new file mode 100644
+index 0000000..da15c3f
+--- /dev/null
++++ b/result/errors10/781205.xml.err
+@@ -0,0 +1,21 @@
++Entity: line 1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
++
++ %a; 
++    ^
++Entity: line 1: 
++<:0000
++^
++Entity: line 1: parser error : DOCTYPE improperly terminated
++ %a; 
++    ^
++Entity: line 1: 
++<:0000
++^
++namespace error : Failed to parse QName ':0000'
++ %a; 
++    ^
++<:0000
++      ^
++./test/errors10/781205.xml:4: parser error : Couldn't find end of Start Tag :0000 line 1
++
++^
+diff --git a/result/errors10/781361.xml b/result/errors10/781361.xml
+new file mode 100644
+index 0000000..e69de29
+diff --git a/result/errors10/781361.xml.err b/result/errors10/781361.xml.err
+new file mode 100644
+index 0000000..655f41a
+--- /dev/null
++++ b/result/errors10/781361.xml.err
+@@ -0,0 +1,13 @@
++./test/errors10/781361.xml:4: parser error : xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected
++
++^
++./test/errors10/781361.xml:4: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
++
++
++^
++./test/errors10/781361.xml:4: parser error : DOCTYPE improperly terminated
++
++^
++./test/errors10/781361.xml:4: parser error : Start tag expected, '<' not found
++
++^
+diff --git a/result/valid/766956.xml b/result/valid/766956.xml
+new file mode 100644
+index 0000000..e69de29
+diff --git a/result/valid/766956.xml.err b/result/valid/766956.xml.err
+new file mode 100644
+index 0000000..34b1dae
+--- /dev/null
++++ b/result/valid/766956.xml.err
+@@ -0,0 +1,9 @@
++test/valid/dtds/766956.dtd:2: parser error : PEReference: expecting ';'
++%ä%ent;
++   ^
++Entity: line 1: parser error : Content error in the external subset
++ %ent; 
++      ^
++Entity: line 1: 
++value
++^
+diff --git a/result/valid/766956.xml.err.rdr b/result/valid/766956.xml.err.rdr
+new file mode 100644
+index 0000000..7760346
+--- /dev/null
++++ b/result/valid/766956.xml.err.rdr
+@@ -0,0 +1,10 @@
++test/valid/dtds/766956.dtd:2: parser error : PEReference: expecting ';'
++%ä%ent;
++   ^
++Entity: line 1: parser error : Content error in the external subset
++ %ent; 
++      ^
++Entity: line 1: 
++value
++^
++./test/valid/766956.xml : failed to parse
+diff --git a/runtest.c b/runtest.c
+index bb74d2a..63e8c20 100644
+--- a/runtest.c
++++ b/runtest.c
+@@ -4202,6 +4202,9 @@ testDesc testDescriptions[] = {
+     { "Error cases regression tests",
+       errParseTest, "./test/errors/*.xml", "result/errors/", "", ".err",
+       0 },
++    { "Error cases regression tests (old 1.0)",
++      errParseTest, "./test/errors10/*.xml", "result/errors10/", "", ".err",
++      XML_PARSE_OLD10 },
+ #ifdef LIBXML_READER_ENABLED
+     { "Error cases stream regression tests",
+       streamParseTest, "./test/errors/*.xml", "result/errors/", NULL, ".str",
+diff --git a/test/errors10/781205.xml b/test/errors10/781205.xml
+new file mode 100644
+index 0000000..d9e9e83
+--- /dev/null
++++ b/test/errors10/781205.xml
+@@ -0,0 +1,3 @@
++<!DOCTYPE D [
++  <!ENTITY % a "<:0000">
++  %a;
+diff --git a/test/errors10/781361.xml b/test/errors10/781361.xml
+new file mode 100644
+index 0000000..67476bc
+--- /dev/null
++++ b/test/errors10/781361.xml
+@@ -0,0 +1,3 @@
++<!DOCTYPE doc [
++  <!ENTITY % elem "<!ELEMENT e0000000000">
++  %elem;
+diff --git a/test/valid/766956.xml b/test/valid/766956.xml
+new file mode 100644
+index 0000000..19a95a0
+--- /dev/null
++++ b/test/valid/766956.xml
+@@ -0,0 +1,2 @@
++<!DOCTYPE test SYSTEM "dtds/766956.dtd">
++<test/>
+diff --git a/test/valid/dtds/766956.dtd b/test/valid/dtds/766956.dtd
+new file mode 100644
+index 0000000..dddde68
+--- /dev/null
++++ b/test/valid/dtds/766956.dtd
+@@ -0,0 +1,2 @@
++<!ENTITY % ent "value">
++%ä%ent;
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-fix_and_simplify_xmlParseStartTag2.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-fix_and_simplify_xmlParseStartTag2.patch
new file mode 100644
index 0000000..faa5770
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml2-fix_and_simplify_xmlParseStartTag2.patch
@@ -0,0 +1,590 @@
+libxml2-2.9.4: Avoid reparsing and simplify control flow in xmlParseStartTag2
+
+[No upstream tracking]
+
+parser: Avoid reparsing in xmlParseStartTag2
+
+The code in xmlParseStartTag2 must handle the case that the input
+buffer was grown and reallocated which can invalidate pointers to
+attribute values. Before, this was handled by detecting changes of
+the input buffer "base" pointer and, in case of a change, jumping
+back to the beginning of the function and reparsing the start tag.
+
+The major problem of this approach is that whether an input buffer is
+reallocated is nondeterministic, resulting in seemingly random test
+failures. See the mailing list thread "runtest mystery bug: name2.xml
+error case regression test" from 2012, for example.
+
+If a reallocation was detected, the code also made no attempts to
+continue parsing in case of errors which makes a difference in
+the lax "recover" mode.
+
+Now we store the current input buffer "base" pointer for each (not
+separately allocated) attribute in the namespace URI field, which isn't
+used until later. After the whole start tag was parsed, the pointers to
+the attribute values are reconstructed using the offset between the
+new and the old input buffer. This relies on arithmetic on dangling
+pointers which is technically undefined behavior. But it seems like
+the easiest and most efficient fix and a similar approach is used in
+xmlParserInputGrow.
+
+This changes the error output of several tests, typically making it
+more verbose because we try harder to continue parsing in case of errors.
+
+(Another possible solution is to check not only the "base" pointer
+but the size of the input buffer as well. But this would result in
+even more reparsing.)
+
+Remove some goto labels and deduplicate a bit of code after handling
+namespaces.
+
+There were two bugs where parameter-entity references could lead to an
+unexpected change of the input buffer in xmlParseNameComplex and
+xmlDictLookup being called with an invalid pointer.
+
+
+Upstream-Status: Backport
+ - [https://git.gnome.org/browse/libxml2/commit/?id=07b7428b69c368611d215a140fe630b2d1e61349]
+ - [https://git.gnome.org/browse/libxml2/commit/?id=855c19efb7cd30d927d673b3658563c4959ca6f0]
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/parser.c b/parser.c
+index 609a270..74016e3 100644
+--- a/parser.c
++++ b/parser.c
+@@ -43,6 +43,7 @@
+ #include <limits.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stddef.h>
+ #include <libxml/xmlmemory.h>
+ #include <libxml/threads.h>
+ #include <libxml/globals.h>
+@@ -9377,8 +9378,7 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
+     const xmlChar **atts = ctxt->atts;
+     int maxatts = ctxt->maxatts;
+     int nratts, nbatts, nbdef;
+-    int i, j, nbNs, attval, oldline, oldcol, inputNr;
+-    const xmlChar *base;
++    int i, j, nbNs, attval;
+     unsigned long cur;
+     int nsNr = ctxt->nsNr;
+ 
+@@ -9392,13 +9392,8 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
+      *       The Shrinking is only possible once the full set of attribute
+      *       callbacks have been done.
+      */
+-reparse:
+     SHRINK;
+-    base = ctxt->input->base;
+     cur = ctxt->input->cur - ctxt->input->base;
+-    inputNr = ctxt->inputNr;
+-    oldline = ctxt->input->line;
+-    oldcol = ctxt->input->col;
+     nbatts = 0;
+     nratts = 0;
+     nbdef = 0;
+@@ -9422,8 +9417,6 @@ reparse:
+      */
+     SKIP_BLANKS;
+     GROW;
+-    if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr))
+-        goto base_changed;
+ 
+     while (((RAW != '>') &&
+ 	   ((RAW != '/') || (NXT(1) != '>')) &&
+@@ -9434,203 +9427,174 @@ reparse:
+ 
+ 	attname = xmlParseAttribute2(ctxt, prefix, localname,
+ 	                             &aprefix, &attvalue, &len, &alloc);
+-	if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr)) {
+-	    if ((attvalue != NULL) && (alloc != 0))
+-	        xmlFree(attvalue);
+-	    attvalue = NULL;
+-	    goto base_changed;
+-	}
+-        if ((attname != NULL) && (attvalue != NULL)) {
+-	    if (len < 0) len = xmlStrlen(attvalue);
+-            if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
+-	        const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len);
+-		xmlURIPtr uri;
+-
+-                if (URL == NULL) {
+-		    xmlErrMemory(ctxt, "dictionary allocation failure");
+-		    if ((attvalue != NULL) && (alloc != 0))
+-			xmlFree(attvalue);
+-		    return(NULL);
+-		}
+-                if (*URL != 0) {
+-		    uri = xmlParseURI((const char *) URL);
+-		    if (uri == NULL) {
+-			xmlNsErr(ctxt, XML_WAR_NS_URI,
+-			         "xmlns: '%s' is not a valid URI\n",
+-					   URL, NULL, NULL);
+-		    } else {
+-			if (uri->scheme == NULL) {
+-			    xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
+-				      "xmlns: URI %s is not absolute\n",
+-				      URL, NULL, NULL);
+-			}
+-			xmlFreeURI(uri);
+-		    }
+-		    if (URL == ctxt->str_xml_ns) {
+-			if (attname != ctxt->str_xml) {
+-			    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+-			 "xml namespace URI cannot be the default namespace\n",
+-				     NULL, NULL, NULL);
+-			}
+-			goto skip_default_ns;
+-		    }
+-		    if ((len == 29) &&
+-			(xmlStrEqual(URL,
+-				 BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
+-			xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+-			     "reuse of the xmlns namespace name is forbidden\n",
+-				 NULL, NULL, NULL);
+-			goto skip_default_ns;
+-		    }
+-		}
+-		/*
+-		 * check that it's not a defined namespace
+-		 */
+-		for (j = 1;j <= nbNs;j++)
+-		    if (ctxt->nsTab[ctxt->nsNr - 2 * j] == NULL)
+-			break;
+-		if (j <= nbNs)
+-		    xmlErrAttributeDup(ctxt, NULL, attname);
+-		else
+-		    if (nsPush(ctxt, NULL, URL) > 0) nbNs++;
+-skip_default_ns:
+-		if ((attvalue != NULL) && (alloc != 0)) {
+-		    xmlFree(attvalue);
+-		    attvalue = NULL;
+-		}
+-		if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
+-		    break;
+-		if (!IS_BLANK_CH(RAW)) {
+-		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
+-				   "attributes construct error\n");
+-		    break;
+-		}
+-		SKIP_BLANKS;
+-		if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr))
+-		    goto base_changed;
+-		continue;
+-	    }
+-            if (aprefix == ctxt->str_xmlns) {
+-	        const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len);
+-		xmlURIPtr uri;
+-
+-                if (attname == ctxt->str_xml) {
+-		    if (URL != ctxt->str_xml_ns) {
+-		        xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+-			         "xml namespace prefix mapped to wrong URI\n",
+-			         NULL, NULL, NULL);
+-		    }
+-		    /*
+-		     * Do not keep a namespace definition node
+-		     */
+-		    goto skip_ns;
+-		}
++        if ((attname == NULL) || (attvalue == NULL))
++            goto next_attr;
++	if (len < 0) len = xmlStrlen(attvalue);
++
++        if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
++            const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len);
++            xmlURIPtr uri;
++
++            if (URL == NULL) {
++                xmlErrMemory(ctxt, "dictionary allocation failure");
++                if ((attvalue != NULL) && (alloc != 0))
++                    xmlFree(attvalue);
++                return(NULL);
++            }
++            if (*URL != 0) {
++                uri = xmlParseURI((const char *) URL);
++                if (uri == NULL) {
++                    xmlNsErr(ctxt, XML_WAR_NS_URI,
++                             "xmlns: '%s' is not a valid URI\n",
++                                       URL, NULL, NULL);
++                } else {
++                    if (uri->scheme == NULL) {
++                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
++                                  "xmlns: URI %s is not absolute\n",
++                                  URL, NULL, NULL);
++                    }
++                    xmlFreeURI(uri);
++                }
+                 if (URL == ctxt->str_xml_ns) {
+-		    if (attname != ctxt->str_xml) {
+-		        xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+-			         "xml namespace URI mapped to wrong prefix\n",
+-			         NULL, NULL, NULL);
+-		    }
+-		    goto skip_ns;
+-		}
+-                if (attname == ctxt->str_xmlns) {
+-		    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+-			     "redefinition of the xmlns prefix is forbidden\n",
+-			     NULL, NULL, NULL);
+-		    goto skip_ns;
+-		}
+-		if ((len == 29) &&
+-		    (xmlStrEqual(URL,
+-		                 BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
+-		    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+-			     "reuse of the xmlns namespace name is forbidden\n",
+-			     NULL, NULL, NULL);
+-		    goto skip_ns;
+-		}
+-		if ((URL == NULL) || (URL[0] == 0)) {
+-		    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+-		             "xmlns:%s: Empty XML namespace is not allowed\n",
+-			          attname, NULL, NULL);
+-		    goto skip_ns;
+-		} else {
+-		    uri = xmlParseURI((const char *) URL);
+-		    if (uri == NULL) {
+-			xmlNsErr(ctxt, XML_WAR_NS_URI,
+-			     "xmlns:%s: '%s' is not a valid URI\n",
+-					   attname, URL, NULL);
+-		    } else {
+-			if ((ctxt->pedantic) && (uri->scheme == NULL)) {
+-			    xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
+-				      "xmlns:%s: URI %s is not absolute\n",
+-				      attname, URL, NULL);
+-			}
+-			xmlFreeURI(uri);
+-		    }
+-		}
+-
+-		/*
+-		 * check that it's not a defined namespace
+-		 */
+-		for (j = 1;j <= nbNs;j++)
+-		    if (ctxt->nsTab[ctxt->nsNr - 2 * j] == attname)
+-			break;
+-		if (j <= nbNs)
+-		    xmlErrAttributeDup(ctxt, aprefix, attname);
+-		else
+-		    if (nsPush(ctxt, attname, URL) > 0) nbNs++;
+-skip_ns:
+-		if ((attvalue != NULL) && (alloc != 0)) {
+-		    xmlFree(attvalue);
+-		    attvalue = NULL;
+-		}
+-		if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
+-		    break;
+-		if (!IS_BLANK_CH(RAW)) {
+-		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
+-				   "attributes construct error\n");
+-		    break;
+-		}
+-		SKIP_BLANKS;
+-		if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr))
+-		    goto base_changed;
+-		continue;
+-	    }
++                    if (attname != ctxt->str_xml) {
++                        xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
++                     "xml namespace URI cannot be the default namespace\n",
++                                 NULL, NULL, NULL);
++                    }
++                    goto next_attr;
++                }
++                if ((len == 29) &&
++                    (xmlStrEqual(URL,
++                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
++                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
++                         "reuse of the xmlns namespace name is forbidden\n",
++                             NULL, NULL, NULL);
++                    goto next_attr;
++                }
++            }
++            /*
++             * check that it's not a defined namespace
++             */
++            for (j = 1;j <= nbNs;j++)
++                if (ctxt->nsTab[ctxt->nsNr - 2 * j] == NULL)
++                    break;
++            if (j <= nbNs)
++                xmlErrAttributeDup(ctxt, NULL, attname);
++            else
++                if (nsPush(ctxt, NULL, URL) > 0) nbNs++;
++
++        } else if (aprefix == ctxt->str_xmlns) {
++            const xmlChar *URL = xmlDictLookup(ctxt->dict, attvalue, len);
++            xmlURIPtr uri;
++
++            if (attname == ctxt->str_xml) {
++                if (URL != ctxt->str_xml_ns) {
++                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
++                             "xml namespace prefix mapped to wrong URI\n",
++                             NULL, NULL, NULL);
++                }
++                /*
++                 * Do not keep a namespace definition node
++                 */
++                goto next_attr;
++            }
++            if (URL == ctxt->str_xml_ns) {
++                if (attname != ctxt->str_xml) {
++                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
++                             "xml namespace URI mapped to wrong prefix\n",
++                             NULL, NULL, NULL);
++                }
++                goto next_attr;
++            }
++            if (attname == ctxt->str_xmlns) {
++                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
++                         "redefinition of the xmlns prefix is forbidden\n",
++                         NULL, NULL, NULL);
++                goto next_attr;
++            }
++            if ((len == 29) &&
++                (xmlStrEqual(URL,
++                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
++                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
++                         "reuse of the xmlns namespace name is forbidden\n",
++                         NULL, NULL, NULL);
++                goto next_attr;
++            }
++            if ((URL == NULL) || (URL[0] == 0)) {
++                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
++                         "xmlns:%s: Empty XML namespace is not allowed\n",
++                              attname, NULL, NULL);
++                goto next_attr;
++            } else {
++                uri = xmlParseURI((const char *) URL);
++                if (uri == NULL) {
++                    xmlNsErr(ctxt, XML_WAR_NS_URI,
++                         "xmlns:%s: '%s' is not a valid URI\n",
++                                       attname, URL, NULL);
++                } else {
++                    if ((ctxt->pedantic) && (uri->scheme == NULL)) {
++                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
++                                  "xmlns:%s: URI %s is not absolute\n",
++                                  attname, URL, NULL);
++                    }
++                    xmlFreeURI(uri);
++                }
++            }
+ 
+-	    /*
+-	     * Add the pair to atts
+-	     */
+-	    if ((atts == NULL) || (nbatts + 5 > maxatts)) {
+-	        if (xmlCtxtGrowAttrs(ctxt, nbatts + 5) < 0) {
+-		    if (attvalue[len] == 0)
+-			xmlFree(attvalue);
+-		    goto failed;
+-		}
+-	        maxatts = ctxt->maxatts;
+-		atts = ctxt->atts;
+-	    }
+-	    ctxt->attallocs[nratts++] = alloc;
+-	    atts[nbatts++] = attname;
+-	    atts[nbatts++] = aprefix;
+-	    atts[nbatts++] = NULL; /* the URI will be fetched later */
+-	    atts[nbatts++] = attvalue;
+-	    attvalue += len;
+-	    atts[nbatts++] = attvalue;
+-	    /*
+-	     * tag if some deallocation is needed
+-	     */
+-	    if (alloc != 0) attval = 1;
+-	} else {
+-	    if ((attvalue != NULL) && (attvalue[len] == 0))
+-		xmlFree(attvalue);
+-	}
++            /*
++             * check that it's not a defined namespace
++             */
++            for (j = 1;j <= nbNs;j++)
++                if (ctxt->nsTab[ctxt->nsNr - 2 * j] == attname)
++                    break;
++            if (j <= nbNs)
++                xmlErrAttributeDup(ctxt, aprefix, attname);
++            else
++                if (nsPush(ctxt, attname, URL) > 0) nbNs++;
++
++        } else {
++            /*
++             * Add the pair to atts
++             */
++            if ((atts == NULL) || (nbatts + 5 > maxatts)) {
++                if (xmlCtxtGrowAttrs(ctxt, nbatts + 5) < 0) {
++                    goto next_attr;
++                }
++                maxatts = ctxt->maxatts;
++                atts = ctxt->atts;
++            }
++            ctxt->attallocs[nratts++] = alloc;
++            atts[nbatts++] = attname;
++            atts[nbatts++] = aprefix;
++            /*
++             * The namespace URI field is used temporarily to point at the
++             * base of the current input buffer for non-alloced attributes.
++             * When the input buffer is reallocated, all the pointers become
++             * invalid, but they can be reconstructed later.
++             */
++            if (alloc)
++                atts[nbatts++] = NULL;
++            else
++                atts[nbatts++] = ctxt->input->base;
++            atts[nbatts++] = attvalue;
++            attvalue += len;
++            atts[nbatts++] = attvalue;
++            /*
++             * tag if some deallocation is needed
++             */
++            if (alloc != 0) attval = 1;
++            attvalue = NULL; /* moved into atts */
++        }
+ 
+-failed:
++next_attr:
++        if ((attvalue != NULL) && (alloc != 0)) {
++            xmlFree(attvalue);
++            attvalue = NULL;
++        }
+ 
+ 	GROW
+         if (ctxt->instate == XML_PARSER_EOF)
+             break;
+-	if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr))
+-	    goto base_changed;
+ 	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
+ 	    break;
+ 	if (!IS_BLANK_CH(RAW)) {
+@@ -9646,8 +9610,20 @@ failed:
+ 	    break;
+ 	}
+         GROW;
+-	if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr))
+-	    goto base_changed;
++    }
++
++    /* Reconstruct attribute value pointers. */
++    for (i = 0, j = 0; j < nratts; i += 5, j++) {
++        if (atts[i+2] != NULL) {
++            /*
++             * Arithmetic on dangling pointers is technically undefined
++             * behavior, but well...
++             */
++            ptrdiff_t offset = ctxt->input->base - atts[i+2];
++            atts[i+2]  = NULL;    /* Reset repurposed namespace URI */
++            atts[i+3] += offset;  /* value */
++            atts[i+4] += offset;  /* valuend */
++        }
+     }
+ 
+     /*
+@@ -9804,34 +9780,6 @@ failed:
+     }
+ 
+     return(localname);
+-
+-base_changed:
+-    /*
+-     * the attribute strings are valid iif the base didn't changed
+-     */
+-    if (attval != 0) {
+-	for (i = 3,j = 0; j < nratts;i += 5,j++)
+-	    if ((ctxt->attallocs[j] != 0) && (atts[i] != NULL))
+-	        xmlFree((xmlChar *) atts[i]);
+-    }
+-
+-    /*
+-     * We can't switch from one entity to another in the middle
+-     * of a start tag
+-     */
+-    if (inputNr != ctxt->inputNr) {
+-        xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY,
+-		    "Start tag doesn't start and stop in the same entity\n");
+-	return(NULL);
+-    }
+-
+-    ctxt->input->cur = ctxt->input->base + cur;
+-    ctxt->input->line = oldline;
+-    ctxt->input->col = oldcol;
+-    if (ctxt->wellFormed == 1) {
+-	goto reparse;
+-    }
+-    return(NULL);
+ }
+ 
+ /**
+diff --git a/result/errors/759398.xml.err b/result/errors/759398.xml.err
+index e08d9bf..f6036a3 100644
+--- a/result/errors/759398.xml.err
++++ b/result/errors/759398.xml.err
+@@ -1,9 +1,12 @@
+ ./test/errors/759398.xml:210: parser error : StartTag: invalid element name
+ need to worry about parsers whi<! don't expand PErefs finding
+                                 ^
+-./test/errors/759398.xml:309: parser error : Opening and ending tag mismatch: spec line 50 and termdef
++./test/errors/759398.xml:309: parser error : Opening and ending tag mismatch: №№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№m line 308 and termdef
+ and provide access to their content and structure.</termdef> <termdef
+                                                             ^
+-./test/errors/759398.xml:309: parser error : Extra content at the end of the document
+-and provide access to their content and structure.</termdef> <termdef
+-                                                             ^
++./test/errors/759398.xml:314: parser error : Opening and ending tag mismatch: spec line 50 and p
++data and the information it must provide to the application.</p>
++                                                                ^
++./test/errors/759398.xml:316: parser error : Extra content at the end of the document
++<div2 id='sec-origin-goals'>
++^
+diff --git a/result/errors/attr1.xml.err b/result/errors/attr1.xml.err
+index 4f08538..c4c4fc8 100644
+--- a/result/errors/attr1.xml.err
++++ b/result/errors/attr1.xml.err
+@@ -1,6 +1,9 @@
+ ./test/errors/attr1.xml:2: parser error : AttValue: ' expected
+ 
+ ^
+-./test/errors/attr1.xml:1: parser error : Extra content at the end of the document
+-<foo foo="oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
+- ^
++./test/errors/attr1.xml:2: parser error : attributes construct error
++
++^
++./test/errors/attr1.xml:2: parser error : Couldn't find end of Start Tag foo line 1
++
++^
+diff --git a/result/errors/attr2.xml.err b/result/errors/attr2.xml.err
+index c8a9c7d..77e342e 100644
+--- a/result/errors/attr2.xml.err
++++ b/result/errors/attr2.xml.err
+@@ -1,6 +1,9 @@
+ ./test/errors/attr2.xml:2: parser error : AttValue: ' expected
+ 
+ ^
+-./test/errors/attr2.xml:1: parser error : Extra content at the end of the document
+-<foo foo=">ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
+- ^
++./test/errors/attr2.xml:2: parser error : attributes construct error
++
++^
++./test/errors/attr2.xml:2: parser error : Couldn't find end of Start Tag foo line 1
++
++^
+diff --git a/result/errors/name2.xml.err b/result/errors/name2.xml.err
+index a6649a1..8a6acee 100644
+--- a/result/errors/name2.xml.err
++++ b/result/errors/name2.xml.err
+@@ -1,6 +1,9 @@
+ ./test/errors/name2.xml:2: parser error : Specification mandate value for attribute foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
+ 
+ ^
+-./test/errors/name2.xml:1: parser error : Extra content at the end of the document
+-<foo foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
+- ^
++./test/errors/name2.xml:2: parser error : attributes construct error
++
++^
++./test/errors/name2.xml:2: parser error : Couldn't find end of Start Tag foo line 1
++
++^
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/runtest.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/runtest.patch
index 397ab20..6e56857 100644
--- a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/runtest.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/runtest.patch
@@ -2,12 +2,13 @@
 Print a standard result line for each test.
 
 Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
-Upstream-Status: Pending
+Signed-off-by: Andrej Valek <andrej.valek@enea.com>
+Upstream-Status: Backport
 
 diff -uNr a/Makefile.am b/Makefile.am
---- a/Makefile.am	2013-04-17 14:51:42.633386477 +0200
-+++ b/Makefile.am	2013-04-19 14:47:51.544720568 +0200
-@@ -202,10 +202,19 @@
+--- a/Makefile.am	2016-05-22 03:49:02.000000000 +0200
++++ b/Makefile.am	2017-06-14 10:38:43.381305385 +0200
+@@ -202,10 +202,24 @@
  #testOOM_DEPENDENCIES = $(DEPS)
  #testOOM_LDADD= $(LDADDS)
  
@@ -24,10 +25,24 @@
  	[ -d test   ] || $(LN_S) $(srcdir)/test   .
  	[ -d result ] || $(LN_S) $(srcdir)/result .
 -	$(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
-+	./runtest$(EXEEXT) ; ./testrecurse$(EXEEXT) ; ./testapi$(EXEEXT) ; ./testchar$(EXEEXT) ; ./testdict$(EXEEXT) ; ./runxmlconf$(EXEEXT)
++	$(CHECKER) ./runtest$(EXEEXT) && \
++	    $(CHECKER) ./testrecurse$(EXEEXT) && \
++	    ASAN_OPTIONS="$$ASAN_OPTIONS:detect_leaks=0" $(CHECKER) ./testapi$(EXEEXT) && \
++	    $(CHECKER) ./testchar$(EXEEXT) && \
++	    $(CHECKER) ./testdict$(EXEEXT) && \
++	    $(CHECKER) ./runxmlconf$(EXEEXT)
  	@(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
  	    $(MAKE) tests ; fi)
  
+@@ -229,7 +243,7 @@
+ 
+ APItests: testapi$(EXEEXT)
+ 	@echo "## Running the API regression tests this may take a little while"
+-	-@($(CHECKER) $(top_builddir)/testapi -q)
++	-@(ASAN_OPTIONS="$$ASAN_OPTIONS:detect_leaks=0" $(CHECKER) $(top_builddir)/testapi -q)
+ 
+ HTMLtests : testHTML$(EXEEXT)
+ 	@(echo > .memdump)
 diff -uNr a/runsuite.c b/runsuite.c
 --- a/runsuite.c	2013-04-12 16:17:11.462823238 +0200
 +++ b/runsuite.c	2013-04-17 14:07:24.352693211 +0200
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2_2.9.4.bb b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2_2.9.4.bb
index c2c3c93..107539b 100644
--- a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2_2.9.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2_2.9.4.bb
@@ -23,8 +23,14 @@
            file://libxml2-CVE-2016-5131.patch \
            file://libxml2-CVE-2016-4658.patch \
            file://libxml2-fix_NULL_pointer_derefs.patch \
-           file://CVE-2016-9318.patch \
-          "
+           file://libxml2-fix_and_simplify_xmlParseStartTag2.patch \
+           file://libxml2-CVE-2017-9047_CVE-2017-9048.patch \
+           file://libxml2-CVE-2017-9049_CVE-2017-9050.patch \
+           file://libxml2-CVE-2017-5969.patch \
+           file://libxml2-CVE-2017-0663.patch \
+           file://libxml2-CVE-2017-8872.patch \
+           file://0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch \
+           "
 
 SRC_URI[libtar.md5sum] = "ae249165c173b1ff386ee8ad676815f5"
 SRC_URI[libtar.sha256sum] = "ffb911191e509b966deb55de705387f14156e1a56b21824357cdf0053233633c"
@@ -33,22 +39,24 @@
 
 BINCONFIG = "${bindir}/xml2-config"
 
-inherit autotools pkgconfig binconfig-disabled pythonnative ptest
+PACKAGECONFIG ??= "python \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
-RDEPENDS_${PN}-ptest += "python-core"
+inherit autotools pkgconfig binconfig-disabled ptest
 
-RDEPENDS_${PN}-python += "python-core"
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)}
+
+RDEPENDS_${PN}-ptest += "make ${@bb.utils.contains('PACKAGECONFIG', 'python', 'libgcc python3-core python3-argparse python3-logging python3-shell python3-signal python3-stringold python3-threading python3-unittest ${PN}-python', '', d)}"
+
+RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}"
 
 RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-ebcdic-us glibc-gconv-ibm1141"
 
 export PYTHON_SITE_PACKAGES="${PYTHON_SITEPACKAGES_DIR}"
 
-PACKAGECONFIG ??= "python \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-"
-PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
-
 # WARNING: zlib is require for RPM use
 EXTRA_OECONF = "--without-debug --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions"
 EXTRA_OECONF_class-native = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib"
@@ -57,7 +65,7 @@
 
 python populate_packages_prepend () {
     # autonamer would call this libxml2-2, but we don't want that
-    if d.getVar('DEBIAN_NAMES', True):
+    if d.getVar('DEBIAN_NAMES'):
         d.setVar('PKG_libxml2', '${MLPREFIX}libxml2')
 }
 
@@ -75,6 +83,17 @@
 
 do_install_ptest () {
 	cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH}
+	if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then
+		sed -i -e 's|^\(PYTHON = \).*|\1${USRBINPATH}/${PYTHON_PN}|' \
+		    ${D}${PTEST_PATH}/python/tests/Makefile
+		grep -lrZ '#!/usr/bin/python' ${D}${PTEST_PATH}/python |
+			xargs -0 sed -i -e 's|/usr/bin/python|${USRBINPATH}/${PYTHON_PN}|'
+	fi
+}
+
+do_install_append_class-native () {
+	# Docs are not needed in the native case
+	rm ${D}${datadir}/gtk-doc -rf
 }
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/build-sysroots.bb b/import-layers/yocto-poky/meta/recipes-core/meta/build-sysroots.bb
new file mode 100644
index 0000000..7a712e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/build-sysroots.bb
@@ -0,0 +1,38 @@
+INHIBIT_DEFAULT_DEPS = "1"
+LICENSE = "MIT"
+
+STANDALONE_SYSROOT = "${STAGING_DIR}/${MACHINE}"
+STANDALONE_SYSROOT_NATIVE = "${STAGING_DIR}/${BUILD_ARCH}"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+EXCLUDE_FROM_WORLD = "1"
+
+inherit nopackages
+deltask fetch
+deltask unpack
+deltask patch
+deltask prepare_recipe_sysroot
+deltask populate_lic
+deltask configure
+deltask compile
+deltask install
+deltask populate_sysroot
+
+python do_build_native_sysroot () {
+    targetsysroot = d.getVar("STANDALONE_SYSROOT")
+    nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE")
+    staging_populate_sysroot_dir(targetsysroot, nativesysroot, True, d)
+}
+do_build_native_sysroot[cleandirs] = "${STANDALONE_SYSROOT_NATIVE}"
+do_build_native_sysroot[nostamp] = "1"
+addtask do_build_native_sysroot before do_build
+
+python do_build_target_sysroot () {
+    targetsysroot = d.getVar("STANDALONE_SYSROOT")
+    nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE")
+    staging_populate_sysroot_dir(targetsysroot, nativesysroot, False, d)
+}
+do_build_target_sysroot[cleandirs] = "${STANDALONE_SYSROOT}"
+do_build_target_sysroot[nostamp] = "1"
+addtask do_build_target_sysroot before do_build
+
+do_clean[cleandirs] += "${STANDALONE_SYSROOT} ${STANDALONE_SYSROOT_NATIVE}"
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/buildtools-tarball.bb b/import-layers/yocto-poky/meta/recipes-core/meta/buildtools-tarball.bb
index 5808c95..abdc7fe 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/buildtools-tarball.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/buildtools-tarball.bb
@@ -2,8 +2,6 @@
                tarball can be used to run bitbake builds on systems which don't meet the usual version requirements."
 SUMMARY = "Standalone tarball for running builds on systems with inadequate software"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 TOOLCHAIN_TARGET_TASK ?= ""
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment-extsdk.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment-extsdk.bb
index d9e5961..2076b56 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment-extsdk.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment-extsdk.bb
@@ -5,8 +5,8 @@
 PN = "meta-environment-extsdk-${MACHINE}"
 
 create_sdk_files_append() {
-	local sysroot=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_TARGET', True), d.getVar('TOPDIR', True))}
-	local sdkpathnative=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_NATIVE',True), d.getVar('TOPDIR', True))}
+	local sysroot=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR'), d.getVar('TMPDIR'))}/${MACHINE}
+	local sdkpathnative=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR'), d.getVar('TMPDIR'))}/${BUILD_ARCH}
 
 	toolchain_create_sdk_env_script '' '' $sysroot '' ${bindir_native} ${prefix_native} $sdkpathnative
 }
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment.bb
index d9e045f..29da121 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment.bb
@@ -1,6 +1,4 @@
 SUMMARY = "Package of environment files for SDK"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 LICENSE = "MIT"
 PR = "r8"
 
@@ -23,27 +21,28 @@
 
 do_generate_content[cleandirs] = "${SDK_OUTPUT}"
 do_generate_content[dirs] = "${SDK_OUTPUT}/${SDKPATH}"
+# Need to ensure we have the virtual mappings and site files for all multtilib variants
+do_generate_content[depends] = "${@oe.utils.build_depends_string(all_multilib_tune_values(d, 'TOOLCHAIN_NEED_CONFIGSITE_CACHE'), 'do_populate_sysroot')}"
 python do_generate_content() {
     # Handle multilibs in the SDK environment, siteconfig, etc files...
     localdata = bb.data.createCopy(d)
 
     # make sure we only use the WORKDIR value from 'd', or it can change
-    localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
+    localdata.setVar('WORKDIR', d.getVar('WORKDIR'))
 
     # make sure we only use the SDKTARGETSYSROOT value from 'd'
-    localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT', True))
+    localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT'))
     localdata.setVar('libdir', d.getVar('target_libdir', False))
 
     # Process DEFAULTTUNE
     bb.build.exec_func("create_sdk_files", localdata)
 
-    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+    variants = d.getVar("MULTILIB_VARIANTS") or ""
     for item in variants.split():
         # Load overrides from 'd' to avoid having to reset the value...
         overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
         localdata.setVar("OVERRIDES", overrides)
         localdata.setVar("MLPREFIX", item + "-")
-        bb.data.update_data(localdata)
         bb.build.exec_func("create_sdk_files", localdata)
 }
 addtask generate_content before do_install after do_compile
@@ -69,9 +68,9 @@
     ${SDKPATH}/* \
     "
 
-do_fetch[noexec] = "1"
-do_unpack[noexec] = "1"
-do_patch[noexec] = "1"
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
-do_populate_sysroot[noexec] = "1"
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_populate_sysroot
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb
index 2bd9a5b..235d6ec 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb
@@ -1,8 +1,6 @@
 SUMMARY = "Extensible SDK toolchain meta-recipe"
 DESCRIPTION = "Meta-recipe for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
 
@@ -12,16 +10,16 @@
 # within sstate.bbclass, so if you copy or rename this and expect the same
 # functionality you'll need to modify that as well.
 
-LOCKED_SIGS_INDIR = "${D}/locked-sigs"
+LOCKED_SIGS_INDIR = "${WORKDIR}/locked-sigs"
 
 addtask do_locked_sigs after do_populate_sysroot
 SSTATETASKS += "do_locked_sigs"
 do_locked_sigs[sstate-inputdirs] = "${LOCKED_SIGS_INDIR}"
-do_locked_sigs[sstate-outputdirs] = "${STAGING_DIR_HOST}/locked-sigs"
+do_locked_sigs[sstate-outputdirs] = "${STAGING_DIR}/${PACKAGE_ARCH}/${PN}/locked-sigs"
 
 python do_locked_sigs() {
     import oe.copy_buildsystem
-    outdir = os.path.join(d.getVar('LOCKED_SIGS_INDIR', True))
+    outdir = os.path.join(d.getVar('LOCKED_SIGS_INDIR'))
     bb.utils.mkdirhier(outdir)
     sigfile = os.path.join(outdir, 'locked-sigs-extsdk-toolchain.inc')
     oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/meta-ide-support.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-ide-support.bb
index c4ddcfc..0692ec8 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/meta-ide-support.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/meta-ide-support.bb
@@ -1,11 +1,10 @@
 SUMMARY = "Integrated Development Environment support"
 DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
 PR = "r3"
+RM_WORK_EXCLUDE += "${PN}"
 
 inherit meta toolchain-scripts nopackages
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/meta-toolchain.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-toolchain.bb
index ba9fd88..b02b066 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/meta-toolchain.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/meta-toolchain.bb
@@ -3,7 +3,4 @@
 
 PR = "r7"
 
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
 inherit populate_sdk
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/meta-world-pkgdata.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-world-pkgdata.bb
index 81c8647..02abd8a 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/meta-world-pkgdata.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/meta-world-pkgdata.bb
@@ -19,20 +19,20 @@
 
 python do_collect_packagedata() {
     import oe.copy_buildsystem
-    outdir = os.path.join(d.getVar('WORLD_PKGDATADIR', True))
+    outdir = os.path.join(d.getVar('WORLD_PKGDATADIR'))
     bb.utils.mkdirhier(outdir)
     sigfile = os.path.join(outdir, 'locked-sigs-pkgdata.inc')
     oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
 }
 
-do_fetch[noexec] = "1"
-do_unpack[noexec] = "1"
-do_patch[noexec] = "1"
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
-do_install[noexec] = "1"
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_install
 
-do_configure[deptask] = ""
+do_prepare_recipe_sysroot[deptask] = ""
 
 WORLD_PKGDATA_EXCLUDE ?= ""
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb b/import-layers/yocto-poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
index 2b96111..0b58a02 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
@@ -1,6 +1,5 @@
 SUMMARY = "Dummy package which ensures perl is excluded from buildtools"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 
 inherit allarch
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/package-index.bb b/import-layers/yocto-poky/meta/recipes-core/meta/package-index.bb
index 3c46b49..fe022ff 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/package-index.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/package-index.bb
@@ -4,18 +4,18 @@
 INHIBIT_DEFAULT_DEPS = "1"
 PACKAGES = ""
 
-do_fetch[noexec] = "1"
-do_unpack[noexec] = "1"
-do_patch[noexec] = "1"
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
-do_install[noexec] = "1"
-do_package[noexec] = "1"
-do_packagedata[noexec] = "1"
-do_package_write_ipk[noexec] = "1"
-do_package_write_rpm[noexec] = "1"
-do_package_write_deb[noexec] = "1"
-do_populate_sysroot[noexec] = "1"
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_install
+deltask do_package
+deltask do_packagedata
+deltask do_package_write_ipk
+deltask do_package_write_rpm
+deltask do_package_write_deb
+deltask do_populate_sysroot
 
 do_package_index[nostamp] = "1"
 do_package_index[depends] += "${PACKAGEINDEXDEPS}"
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/signing-keys.bb b/import-layers/yocto-poky/meta/recipes-core/meta/signing-keys.bb
index 3779037..aaa01d0 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/signing-keys.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/signing-keys.bb
@@ -3,8 +3,6 @@
 
 SUMMARY = "Makes public keys of the signing keys available"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 
 inherit allarch deploy
@@ -23,23 +21,23 @@
 python do_get_public_keys () {
     from oe.gpg_sign import get_signer
 
-    if d.getVar("RPM_SIGN_PACKAGES", True):
+    if d.getVar("RPM_SIGN_PACKAGES"):
         # Export public key of the rpm signing key
-        signer = get_signer(d, d.getVar('RPM_GPG_BACKEND', True))
+        signer = get_signer(d, d.getVar('RPM_GPG_BACKEND'))
         signer.export_pubkey(os.path.join(d.expand('${B}'), 'rpm-key'),
-                             d.getVar('RPM_GPG_NAME', True))
+                             d.getVar('RPM_GPG_NAME'))
 
-    if d.getVar("IPK_SIGN_PACKAGES", True):
+    if d.getVar("IPK_SIGN_PACKAGES"):
         # Export public key of the ipk signing key
-        signer = get_signer(d, d.getVar('IPK_GPG_BACKEND', True))
+        signer = get_signer(d, d.getVar('IPK_GPG_BACKEND'))
         signer.export_pubkey(os.path.join(d.expand('${B}'), 'ipk-key'),
-                             d.getVar('IPK_GPG_NAME', True))
+                             d.getVar('IPK_GPG_NAME'))
 
-    if d.getVar('PACKAGE_FEED_SIGN', True) == '1':
+    if d.getVar('PACKAGE_FEED_SIGN') == '1':
         # Export public key of the feed signing key
-        signer = get_signer(d, d.getVar('PACKAGE_FEED_GPG_BACKEND', True))
+        signer = get_signer(d, d.getVar('PACKAGE_FEED_GPG_BACKEND'))
         signer.export_pubkey(os.path.join(d.expand('${B}'), 'pf-key'),
-                             d.getVar('PACKAGE_FEED_GPG_NAME', True))
+                             d.getVar('PACKAGE_FEED_GPG_NAME'))
 }
 do_get_public_keys[cleandirs] = "${B}"
 addtask get_public_keys before do_install
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/testexport-tarball.bb b/import-layers/yocto-poky/meta/recipes-core/meta/testexport-tarball.bb
index d9861c4..72f5531 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/testexport-tarball.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/testexport-tarball.bb
@@ -3,8 +3,6 @@
                This recipe is almost the same as buildtools-tarball"
 SUMMARY = "Standalone tarball for test systems with missing software"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 TEST_EXPORT_SDK_PACKAGES ??= ""
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/uninative-tarball.bb b/import-layers/yocto-poky/meta/recipes-core/meta/uninative-tarball.bb
index e203a83..f3fc1eb 100644
--- a/import-layers/yocto-poky/meta/recipes-core/meta/uninative-tarball.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/uninative-tarball.bb
@@ -1,16 +1,17 @@
 SUMMARY = "libc and patchelf tarball for use with uninative.bbclass"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 TOOLCHAIN_TARGET_TASK = ""
 
 # ibm850 - mcopy from mtools
 # iso8859-1 - guile
+# utf-16, cp1252 - binutils-windres
 TOOLCHAIN_HOST_TASK = "\
     nativesdk-glibc \
     nativesdk-glibc-gconv-ibm850 \
     nativesdk-glibc-gconv-iso8859-1 \
+    nativesdk-glibc-gconv-utf-16 \
+    nativesdk-glibc-gconv-cp1252 \
     nativesdk-patchelf \
     "
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/wic-tools.bb b/import-layers/yocto-poky/meta/recipes-core/meta/wic-tools.bb
new file mode 100644
index 0000000..cd494ec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/wic-tools.bb
@@ -0,0 +1,32 @@
+SUMMARY = "A meta recipe to build native tools used by wic."
+
+LICENSE = "MIT"
+
+DEPENDS = "\
+           parted-native syslinux-native gptfdisk-native dosfstools-native \
+           mtools-native bmap-tools-native grub-efi-native cdrtools-native \
+           btrfs-tools-native squashfs-tools-native \
+           "
+DEPENDS_append_x86 = " syslinux grub-efi systemd-boot"
+DEPENDS_append_x86-64 = " syslinux grub-efi systemd-boot"
+
+INHIBIT_DEFAULT_DEPS = "1"
+inherit nopackages
+
+# The sysroot of wic-tools is needed for wic, but if rm_work is enabled, it will
+# be removed before wic has a chance to use it, hence the exclusion below.
+RM_WORK_EXCLUDE += "${PN}"
+
+python do_build_sysroot () {
+    bb.build.exec_func("extend_recipe_sysroot", d)
+
+    # Write environment variables used by wic
+    # to tmp/sysroots/<machine>/imgdata/wictools.env
+    outdir = os.path.join(d.getVar('STAGING_DIR'), d.getVar('MACHINE'), 'imgdata')
+    bb.utils.mkdirhier(outdir)
+    with open(os.path.join(outdir, "wic-tools.env"), 'w') as envf:
+        for var in ('RECIPE_SYSROOT_NATIVE', 'STAGING_DATADIR', 'STAGING_LIBDIR'):
+            envf.write('%s="%s"\n' % (var, d.getVar(var).strip()))
+
+}
+addtask do_build_sysroot after do_prepare_recipe_sysroot before do_build
diff --git a/import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
index 5490b1c..462d338 100644
--- a/import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
@@ -1,6 +1,6 @@
-From 94c0b97b62125d8bbc92dce0694e387d5b2ad181 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jan 2016 12:14:02 -0800
+From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 18 Jan 2017 16:14:37 +0200
 Subject: [PATCH] Make dynamic linker a relative symlink to libc
 
 absolute symlink into $(libdir) fails to load in a cross build
@@ -9,26 +9,68 @@
 can be computed during cross builds, qemu in usermode often comes to aid
 in such situations to feed into cross builds.
 
+V2:
+ Make use of 'ln -r' to create relative symlinks, as most fo the distros
+ shipping coreutils 8.16+
+
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
 ---
 Upstream-Status: Pending
-
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+---
+ Makefile         | 2 +-
+ tools/install.sh | 8 +++++---
+ 2 files changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index b2226fa..0d71f7f 100644
+index 8246b78..d1dbe39 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -189,7 +189,7 @@ $(DESTDIR)$(includedir)/%: include/%
+@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/include/%
  	$(INSTALL) -D -m 644 $< $@
  
  $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
 -	$(INSTALL) -D -l $(libdir)/libc.so $@ || true
-+	$(INSTALL) -D -l ..$(libdir)/libc.so $@ || true
++	$(INSTALL) -D -r $(DESTDIR)$(libdir)/libc.so $@ || true
  
  install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
  
+diff --git a/tools/install.sh b/tools/install.sh
+index d913b60..b6a7f79 100755
+--- a/tools/install.sh
++++ b/tools/install.sh
+@@ -6,18 +6,20 @@
+ #
+ 
+ usage() {
+-printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
++printf "usage: %s [-D] [-l] [-r] [-m mode] src dest\n" "$0" 1>&2
+ exit 1
+ }
+ 
+ mkdirp=
+ symlink=
++symlinkflags="-s"
+ mode=755
+ 
+-while getopts Dlm: name ; do
++while getopts Dlrm: name ; do
+ case "$name" in
+ D) mkdirp=yes ;;
+ l) symlink=yes ;;
++r) symlink=yes; symlinkflags="$symlinkflags -r" ;;
+ m) mode=$OPTARG ;;
+ ?) usage ;;
+ esac
+@@ -48,7 +50,7 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
+ umask 077
+ 
+ if test "$symlink" ; then
+-ln -s "$1" "$tmp"
++ln $symlinkflags "$1" "$tmp"
+ else
+ cat < "$1" > "$tmp"
+ chmod "$mode" "$tmp"
 -- 
-2.7.0
+2.7.4
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/musl/musl.inc b/import-layers/yocto-poky/meta/recipes-core/musl/musl.inc
index 7ed931c..56c9d7f 100644
--- a/import-layers/yocto-poky/meta/recipes-core/musl/musl.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/musl/musl.inc
@@ -12,7 +12,6 @@
 LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=7928b7ad32ceda04932478e330e52f7f"
 
 PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
-TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb b/import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb
index c07101b..a88bc4d 100644
--- a/import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb
@@ -3,9 +3,9 @@
 
 require musl.inc
 
-SRCREV = "39494a273eaa6b714e0fa0c59ce7a1f5fbc80a1e"
+SRCREV = "54807d47acecab778498ced88ce8f62bfa16e379"
 
-PV = "1.1.15+git${SRCPV}"
+PV = "1.1.16+git${SRCPV}"
 
 # mirror is at git://github.com/kraj/musl.git
 
@@ -49,7 +49,7 @@
 	oe_runmake install DESTDIR='${D}'
 
 	install -d ${D}${bindir}
-	ln -s ../../${libdir}/libc.so ${D}${bindir}/ldd
+	lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
 	for l in crypt dl m pthread resolv rt util xnet
 	do
 		ln -s libc.so ${D}${libdir}/lib$l.so
diff --git a/import-layers/yocto-poky/meta/recipes-core/ncurses/files/configure-reproducible.patch b/import-layers/yocto-poky/meta/recipes-core/ncurses/files/configure-reproducible.patch
new file mode 100644
index 0000000..54a8bdc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ncurses/files/configure-reproducible.patch
@@ -0,0 +1,20 @@
+"configure" enforces -U for ar flags, breaking deterministic builds.
+The flag was added to fix some vaguely specified "recent POSIX binutil
+build problems" in 2015. 
+
+Upstream-Status: Pending
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+diff --git a/configure b/configure
+index 7f31208..aa80911 100755
+--- a/configure
++++ b/configure
+@@ -4428,7 +4428,7 @@ if test "${cf_cv_ar_flags+set}" = set; then
+ else
+ 
+ 	cf_cv_ar_flags=unknown
+-	for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
++	for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
+ 	do
+ 
+ 		# check if $ARFLAGS already contains this choice
diff --git a/import-layers/yocto-poky/meta/recipes-core/ncurses/files/fix-cflags-mangle.patch b/import-layers/yocto-poky/meta/recipes-core/ncurses/files/fix-cflags-mangle.patch
new file mode 100644
index 0000000..e9447c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ncurses/files/fix-cflags-mangle.patch
@@ -0,0 +1,18 @@
+configure has a piece of logic to detect users "abusing" CC to hold compiler
+flags (which we do).  It also has logic to "correct" this by moving the flags
+from CC to CFLAGS, but the sed only handles a single argument in CC.
+
+Replace the sed with awk to filter out all words that start with a hyphen.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure b/configure
+index 7f31208..1a29cfc 100755
+--- a/configure
++++ b/configure
+@@ -2191,2 +2191,2 @@ echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/C
+-	cf_flags=`echo "$CC" | sed -e 's/^.*[ 	]\(-[^ 	]\)/\1/'`
+-	CC=`echo "$CC " | sed -e 's/[ 	]-[^ 	].*$//' -e 's/[ 	]*$//'`
++	cf_flags=`echo "$CC" | awk  'BEGIN{ORS=" ";RS=" "} /^-.+/ {print $1}'`
++	CC=`echo "$CC " | awk  'BEGIN{ORS=" ";RS=" "} /^[^-].+/ {print $1}'`
diff --git a/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses.inc b/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses.inc
index ff0117b..1f21cd4 100644
--- a/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses.inc
@@ -7,7 +7,8 @@
 DEPENDS = "ncurses-native"
 DEPENDS_class-native = ""
 
-BINCONFIG = "${bindir}/ncurses5-config ${bindir}/ncursesw5-config"
+BINCONFIG = "${bindir}/ncurses5-config ${bindir}/ncursesw5-config \
+	${bindir}/ncurses6-config ${bindir}/ncursesw6-config"
 
 inherit autotools binconfig-disabled multilib_header pkgconfig
 
@@ -17,6 +18,8 @@
 EXTRA_AUTORECONF = "-I m4"
 CONFIG_SITE =+ "${WORKDIR}/config.cache"
 
+EXTRASITECONFIG = "CFLAGS='${CFLAGS} -I${SYSROOT_DESTDIR}${includedir}'"
+
 # Whether to enable separate widec libraries; must be 'true' or 'false'
 #
 # TODO: remove this variable when widec is supported in every setup?
@@ -65,7 +68,6 @@
 	cd $1
 	shift
 	oe_runconf \
-	        --disable-static \
 	        --without-debug \
 	        --without-ada \
 	        --without-gpm \
@@ -278,6 +280,8 @@
   ${bindir}/tset \
   ${bindir}/ncurses5-config \
   ${bindir}/ncursesw5-config \
+  ${bindir}/ncurses6-config \
+  ${bindir}/ncursesw6-config \
   ${datadir}/tabset \
 "
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses_6.0+20160625.bb b/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses_6.0+20160625.bb
deleted file mode 100644
index 6514613..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses_6.0+20160625.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-require ncurses.inc
-
-SRC_URI += "file://tic-hang.patch \
-            file://config.cache \
-"
-# commit id corresponds to the revision in package version
-SRCREV = "63dd558cb8e888d6fab5f00bbf7842736a2356b9"
-S = "${WORKDIR}/git"
-EXTRA_OECONF += "--with-abi-version=5"
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+(\+\d+)*)"
diff --git a/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses_6.0+20161126.bb b/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses_6.0+20161126.bb
new file mode 100644
index 0000000..ace3108
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses_6.0+20161126.bb
@@ -0,0 +1,12 @@
+require ncurses.inc
+
+SRC_URI += "file://tic-hang.patch \
+            file://fix-cflags-mangle.patch \
+            file://config.cache \
+            file://configure-reproducible.patch \
+"
+# commit id corresponds to the revision in package version
+SRCREV = "3db0bd19cb50e3d9b4f2cf15b7a102fe11302068"
+S = "${WORKDIR}/git"
+EXTRA_OECONF += "--with-abi-version=5"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+(\+\d+)*)"
diff --git a/import-layers/yocto-poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch b/import-layers/yocto-poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
index 35ce21e..56c8d5b 100644
--- a/import-layers/yocto-poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
+++ b/import-layers/yocto-poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
@@ -1,4 +1,7 @@
-netbase: add rpcbind as an alias to sunrpc
+From 76989205a1411f16d7ab09ff9d279539a73dc259 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Thu, 12 Jan 2017 16:50:58 +0200
+Subject: [PATCH] netbase: add rpcbind as an alias to sunrpc
 
 the patch comes from:
 https://bugs.archlinux.org/task/20273
@@ -6,9 +9,10 @@
 Upstream-Status: Pending
 
 Signed-off-by: Li Wang <li.wang@windriver.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
 ---
- etc-rpc      |    2 +-
- etc-services |    4 ++--
+ etc-rpc      | 2 +-
+ etc-services | 4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/etc-rpc b/etc-rpc
@@ -25,20 +29,20 @@
  rusersd		100002	rusers
  nfs		100003	nfsprog
 diff --git a/etc-services b/etc-services
-index 9d64a52..a19f7c8 100644
+index e3202ec..a039d7e 100644
 --- a/etc-services
 +++ b/etc-services
-@@ -72,8 +72,8 @@ pop2		109/tcp		postoffice pop-2 # POP version 2
- pop2		109/udp		pop-2
+@@ -64,8 +64,8 @@ csnet-ns	105/udp		cso-ns
+ rtelnet		107/tcp				# Remote Telnet
+ rtelnet		107/udp
  pop3		110/tcp		pop-3		# POP version 3
- pop3		110/udp		pop-3
 -sunrpc		111/tcp		portmapper	# RPC 4.0 portmapper
 -sunrpc		111/udp		portmapper
-+sunrpc		111/tcp		portmapper rpcbind	# RPC 4.0 portmapper
++sunrpc		111/tcp		portmapper rpcbind # RPC 4.0 portmapper
 +sunrpc		111/udp		portmapper rpcbind
  auth		113/tcp		authentication tap ident
  sftp		115/tcp
- uucp-path	117/tcp
+ nntp		119/tcp		readnews untp	# USENET News Transfer Protocol
 -- 
-1.7.9.5
+2.4.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/netbase/netbase_5.3.bb b/import-layers/yocto-poky/meta/recipes-core/netbase/netbase_5.3.bb
deleted file mode 100644
index 543596a..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/netbase/netbase_5.3.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-SUMMARY = "Basic TCP/IP networking support"
-DESCRIPTION = "This package provides the necessary infrastructure for basic TCP/IP based networking"
-HOMEPAGE = "http://packages.debian.org/netbase"
-SECTION = "base"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
-PE = "1"
-
-SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/n/${BPN}/${BPN}_${PV}.tar.xz \
-           file://netbase-add-rpcbind-as-an-alias-to-sunrpc.patch \
-           file://hosts"
-
-SRC_URI[md5sum] = "2637a27fd3de02a278d2b5be7e6558c1"
-SRC_URI[sha256sum] = "81f6c69795044d62b8ad959cf9daf049d0545fd466c52860ad3f933b1e97b88b"
-
-UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netbase/"
-do_install () {
-	install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
-	install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
-	install -m 0644 etc-rpc ${D}${sysconfdir}/rpc
-	install -m 0644 etc-protocols ${D}${sysconfdir}/protocols
-	install -m 0644 etc-services ${D}${sysconfdir}/services
-}
-
-CONFFILES_${PN} = "${sysconfdir}/hosts"
diff --git a/import-layers/yocto-poky/meta/recipes-core/netbase/netbase_5.4.bb b/import-layers/yocto-poky/meta/recipes-core/netbase/netbase_5.4.bb
new file mode 100644
index 0000000..5ab0c58
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/netbase/netbase_5.4.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Basic TCP/IP networking support"
+DESCRIPTION = "This package provides the necessary infrastructure for basic TCP/IP based networking"
+HOMEPAGE = "http://packages.debian.org/netbase"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
+PE = "1"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20170112T093812Z/pool/main/n/${BPN}/${BPN}_${PV}.tar.xz \
+           file://netbase-add-rpcbind-as-an-alias-to-sunrpc.patch \
+           file://hosts"
+
+SRC_URI[md5sum] = "117cb70c55ef3c1c002f127812b114c1"
+SRC_URI[sha256sum] = "66ff73d2d162e2d49db43988d8b8cd328cf7fffca042db73397f14c71825e80d"
+
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netbase/"
+do_install () {
+	install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
+	install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
+	install -m 0644 etc-rpc ${D}${sysconfdir}/rpc
+	install -m 0644 etc-protocols ${D}${sysconfdir}/protocols
+	install -m 0644 etc-services ${D}${sysconfdir}/services
+}
+
+CONFFILES_${PN} = "${sysconfdir}/hosts"
diff --git a/import-layers/yocto-poky/meta/recipes-core/os-release/os-release.bb b/import-layers/yocto-poky/meta/recipes-core/os-release/os-release.bb
index f519add..f988704 100644
--- a/import-layers/yocto-poky/meta/recipes-core/os-release/os-release.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/os-release/os-release.bb
@@ -3,7 +3,6 @@
 SUMMARY = "Operating system identification"
 DESCRIPTION = "The /etc/os-release file contains operating system identification data."
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 INHIBIT_DEFAULT_DEPS = "1"
 
 do_fetch[noexec] = "1"
@@ -33,8 +32,8 @@
 python do_compile () {
     import shutil
     with open(d.expand('${B}/os-release'), 'w') as f:
-        for field in d.getVar('OS_RELEASE_FIELDS', True).split():
-            value = d.getVar(field, True)
+        for field in d.getVar('OS_RELEASE_FIELDS').split():
+            value = d.getVar(field)
             if value and field == 'VERSION_ID':
                 value = sanitise_version(value)
             if value:
diff --git a/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf-shell-image.bb b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf-shell-image.bb
new file mode 100644
index 0000000..029547b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf-shell-image.bb
@@ -0,0 +1,17 @@
+DESCRIPTION = "boot image with UEFI shell and tools"
+
+# For this image recipe, only the wic format with a
+# single vfat partition makes sense.
+IMAGE_FSTYPES_forcevariable = 'wic'
+
+WKS_FILE = "ovmf/ovmf-shell-image.wks"
+inherit image
+
+# We want a minimal image with just ovmf-shell-efi unpacked in it. We
+# avoid installing unnecessary stuff as much as possible, but some
+# things still get through and need to be removed.
+PACKAGE_INSTALL = "ovmf-shell-efi"
+LINGUAS_INSTALL = ""
+do_image () {
+    rm -rf `ls -d ${IMAGE_ROOTFS}/* | grep -v efi`
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0001-MdeModulePkg-UefiHiiLib-Fix-incorrect-comparison-exp.patch b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0001-MdeModulePkg-UefiHiiLib-Fix-incorrect-comparison-exp.patch
new file mode 100644
index 0000000..fcd7a46
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0001-MdeModulePkg-UefiHiiLib-Fix-incorrect-comparison-exp.patch
@@ -0,0 +1,39 @@
+From 73692710d50da1f421b0e6ddff784ca3135389b3 Mon Sep 17 00:00:00 2001
+From: Dandan Bi <dandan.bi@intel.com>
+Date: Sat, 1 Apr 2017 10:31:14 +0800
+Subject: [PATCH] MdeModulePkg/UefiHiiLib:Fix incorrect comparison expression
+
+Fix the incorrect comparison between pointer and constant zero character.
+
+https://bugzilla.tianocore.org/show_bug.cgi?id=416
+
+V2: The pointer StringPtr points to a string returned
+by ExtractConfig/ExportConfig, if it is NULL, function
+InternalHiiIfrValueAction will return FALSE. So in
+current usage model, the StringPtr can not be NULL before
+using it, so we can add ASSERT here.
+
+Cc: Eric Dong <eric.dong@intel.com>
+Cc: Liming Gao <liming.gao@intel.com>
+Contributed-under: TianoCore Contribution Agreement 1.0
+Signed-off-by: Dandan Bi <dandan.bi@intel.com>
+Reviewed-by: Eric Dong <eric.dong@intel.com>
+---
+Upstream-Status: Backport
+
+ MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+Index: git/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+===================================================================
+--- git.orig/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
++++ git/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+@@ -2180,6 +2180,8 @@ InternalHiiIfrValueAction (
+   }

+   

+   StringPtr = ConfigAltResp;

++
++  ASSERT (StringPtr != NULL);

+   

+   while (StringPtr != L'\0') {

+     //

diff --git a/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch
new file mode 100644
index 0000000..94029a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch
@@ -0,0 +1,32 @@
+From 9e632e3f9edd09632cc877dff6ea57608f979aab Mon Sep 17 00:00:00 2001
+From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
+Date: Thu, 9 Jun 2016 02:23:01 -0700
+Subject: [PATCH] ovmf: update path to native BaseTools
+
+BaseTools is a set of utilities to build EDK-based firmware. These utilities
+are used during the build process. Thus, they need to be built natively.
+When cross-compiling, we need to provide a path to the location of these
+tools. The BBAKE_EDK_TOOLS_PATH string is used as a pattern to be replaced
+with the appropriate location before building.
+
+Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
+---
+ OvmfPkg/build.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh
+index eb5eb73..9058fca 100755
+--- a/OvmfPkg/build.sh
++++ b/OvmfPkg/build.sh
+@@ -30,7 +30,7 @@ then
+ # this assumes svn pulls have the same root dir
+ #  export EDK_TOOLS_PATH=`pwd`/../BaseTools
+ # This version is for the tools source in edk2
+-  export EDK_TOOLS_PATH=`pwd`/BaseTools
++  export EDK_TOOLS_PATH=BBAKE_EDK_TOOLS_PATH/BaseTools
+   echo $EDK_TOOLS_PATH
+   source edksetup.sh BaseTools
+ else
+-- 
+2.8.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch
new file mode 100644
index 0000000..0fdc278
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch
@@ -0,0 +1,39 @@
+From 2320650c6d381b914fe91b2dedaa5870279a8bcf Mon Sep 17 00:00:00 2001
+From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
+Date: Sun, 27 Nov 2016 18:42:55 -0800
+Subject: [PATCH] BaseTools: makefile: adjust to build in under bitbake
+
+Prepend the build flags with those of bitbake. This is to build
+using the bitbake native sysroot include and library directories.
+
+Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com>
+---
+ BaseTools/Source/C/Makefiles/header.makefile | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
+index 821d114..fe0f08b 100644
+--- a/BaseTools/Source/C/Makefiles/header.makefile
++++ b/BaseTools/Source/C/Makefiles/header.makefile
+@@ -44,14 +44,14 @@ ARCH_INCLUDE = -I $(MAKEROOT)/Include/AArch64/
+ endif

+ 

+ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) 

+-BUILD_CPPFLAGS = $(INCLUDE) -O2

++BUILD_CPPFLAGS := $(BUILD_CPPFLAGS) $(INCLUDE) -O2

+ ifeq ($(DARWIN),Darwin)

+ # assume clang or clang compatible flags on OS X

+-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g

++BUILD_CFLAGS := $(BUILD_CFLAGS) -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g

+ else

+-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g

++BUILD_CFLAGS := $(BUILD_CFLAGS) -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g

+ endif

+-BUILD_LFLAGS =

++BUILD_LFLAGS := $(LDFLAGS)

+ BUILD_CXXFLAGS =

+ 

+ ifeq ($(ARCH), IA32)

+-- 
+2.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch
new file mode 100644
index 0000000..3aa6cc4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch
@@ -0,0 +1,1124 @@
+From: Laszlo Ersek <lersek@redhat.com>
+Date: Mon, 6 Jul 2015 20:22:02 +0200
+Subject: [PATCH] OvmfPkg: EnrollDefaultKeys: application for enrolling default
+ keys
+
+(A port of the <https://bugzilla.redhat.com/show_bug.cgi?id=1148296> patch
+to Gerd's public RPMs.)
+
+This application is meant to be invoked by the management layer, after
+booting the UEFI shell and getting a shell prompt on the serial console.
+The app enrolls a number of certificates (see below), and then reports
+status to the serial console as well. The expected output is "info:
+success":
+
+> Shell> EnrollDefaultKeys.efi
+> info: SetupMode=1 SecureBoot=0 SecureBootEnable=0 CustomMode=0 VendorKeys=1
+> info: SetupMode=0 SecureBoot=1 SecureBootEnable=1 CustomMode=0 VendorKeys=0
+> info: success
+> Shell>
+
+In case of success, the management layer can force off or reboot the VM
+(for example with the "reset -s" or "reset -c" UEFI shell commands,
+respectively), and start the guest installation with SecureBoot enabled.
+
+PK:
+- A unique, static, ad-hoc certificate whose private half has been
+  destroyed (more precisely, never saved) and is therefore unusable for
+  signing. (The command for creating this certificate is saved in the
+  source code.)
+
+KEK:
+- same ad-hoc certificate as used for the PK,
+- "Microsoft Corporation KEK CA 2011" -- the dbx data in Fedora's dbxtool
+  package is signed (indirectly, through a chain) with this; enrolling
+  such a KEK should allow guests to install those updates.
+
+DB:
+- "Microsoft Windows Production PCA 2011" -- to load Windows 8 and Windows
+  Server 2012 R2,
+- "Microsoft Corporation UEFI CA 2011" -- to load Linux and signed PCI
+  oproms.
+
+Contributed-under: TianoCore Contribution Agreement 1.0
+Signed-off-by: Laszlo Ersek <lersek@redhat.com>
+Upstream-Status: Inappropriate [not author]
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c   | 960 ++++++++++++++++++++++++
+ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf |  51 ++
+ OvmfPkg/OvmfPkgIa32.dsc                         |   4 +
+ OvmfPkg/OvmfPkgIa32X64.dsc                      |   4 +
+ OvmfPkg/OvmfPkgX64.dsc                          |   4 +
+ 5 files changed, 1023 insertions(+)
+ create mode 100644 OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+ create mode 100644 OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
+
+diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+new file mode 100644
+index 0000000..081212b
+--- /dev/null
++++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+@@ -0,0 +1,960 @@
++/** @file
++  Enroll default PK, KEK, DB.
++
++  Copyright (C) 2014, Red Hat, Inc.
++
++  This program and the accompanying materials are licensed and made available
++  under the terms and conditions of the BSD License which accompanies this
++  distribution. The full text of the license may be found at
++  http://opensource.org/licenses/bsd-license.
++
++  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
++  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
++**/
++#include <Guid/AuthenticatedVariableFormat.h>    // gEfiCustomModeEnableGuid
++#include <Guid/GlobalVariable.h>                 // EFI_SETUP_MODE_NAME
++#include <Guid/ImageAuthentication.h>            // EFI_IMAGE_SECURITY_DATABASE
++#include <Library/BaseMemoryLib.h>               // CopyGuid()
++#include <Library/DebugLib.h>                    // ASSERT()
++#include <Library/MemoryAllocationLib.h>         // FreePool()
++#include <Library/ShellCEntryLib.h>              // ShellAppMain()
++#include <Library/UefiLib.h>                     // AsciiPrint()
++#include <Library/UefiRuntimeServicesTableLib.h> // gRT
++
++//
++// The example self-signed certificate below, which we'll use for both Platform
++// Key, and first Key Exchange Key, has been generated with the following
++// non-interactive openssl command. The passphrase is read from /dev/urandom,
++// and not saved, and the private key is written to /dev/null. In other words,
++// we can't sign anything else against this certificate, which is our purpose.
++//
++/*
++   openssl req \
++     -passout file:<(head -c 16 /dev/urandom) \
++     -x509 \
++     -newkey rsa:2048 \
++     -keyout /dev/null \
++     -outform DER \
++     -subj $(
++       printf /C=US
++       printf /ST=TestStateOrProvince
++       printf /L=TestLocality
++       printf /O=TestOrganization
++       printf /OU=TestOrganizationalUnit
++       printf /CN=TestCommonName
++       printf /emailAddress=test@example.com
++     ) \
++     2>/dev/null \
++   | xxd -i
++*/
++STATIC CONST UINT8 ExampleCert[] = {
++  0x30, 0x82, 0x04, 0x45, 0x30, 0x82, 0x03, 0x2d, 0xa0, 0x03, 0x02, 0x01, 0x02,
++  0x02, 0x09, 0x00, 0xcf, 0x9f, 0x51, 0xa3, 0x07, 0xdb, 0x54, 0xa1, 0x30, 0x0d,
++  0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00,
++  0x30, 0x81, 0xb8, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
++  0x02, 0x55, 0x53, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c,
++  0x13, 0x54, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x50,
++  0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03,
++  0x55, 0x04, 0x07, 0x0c, 0x0c, 0x54, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x63, 0x61,
++  0x6c, 0x69, 0x74, 0x79, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0a,
++  0x0c, 0x10, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a,
++  0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04,
++  0x0b, 0x0c, 0x16, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69,
++  0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x31,
++  0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0e, 0x54, 0x65, 0x73,
++  0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x31, 0x1f,
++  0x30, 0x1d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01,
++  0x16, 0x10, 0x74, 0x65, 0x73, 0x74, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c,
++  0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x34, 0x31, 0x30,
++  0x30, 0x39, 0x31, 0x33, 0x32, 0x38, 0x32, 0x32, 0x5a, 0x17, 0x0d, 0x31, 0x34,
++  0x31, 0x31, 0x30, 0x38, 0x31, 0x33, 0x32, 0x38, 0x32, 0x32, 0x5a, 0x30, 0x81,
++  0xb8, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55,
++  0x53, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x13, 0x54,
++  0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x50, 0x72, 0x6f,
++  0x76, 0x69, 0x6e, 0x63, 0x65, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
++  0x07, 0x0c, 0x0c, 0x54, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69,
++  0x74, 0x79, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x10,
++  0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74,
++  0x69, 0x6f, 0x6e, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c,
++  0x16, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61,
++  0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x31, 0x17, 0x30,
++  0x15, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0e, 0x54, 0x65, 0x73, 0x74, 0x43,
++  0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x31, 0x1f, 0x30, 0x1d,
++  0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x10,
++  0x74, 0x65, 0x73, 0x74, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e,
++  0x63, 0x6f, 0x6d, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
++  0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f,
++  0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xbf, 0xf1, 0xce,
++  0x17, 0x32, 0xac, 0xc4, 0x4b, 0xb2, 0xed, 0x84, 0x76, 0xe5, 0xd0, 0xf8, 0x21,
++  0xac, 0x10, 0xf8, 0x18, 0x09, 0x0e, 0x07, 0x13, 0x76, 0x21, 0x5c, 0xc4, 0xcc,
++  0xd5, 0xe6, 0x25, 0xa7, 0x26, 0x53, 0x79, 0x2f, 0x16, 0x4b, 0x85, 0xbd, 0xae,
++  0x42, 0x64, 0x58, 0xcb, 0x5e, 0xe8, 0x6e, 0x5a, 0xd0, 0xc4, 0x0f, 0x38, 0x16,
++  0xbe, 0xd3, 0x22, 0xa7, 0x3c, 0x9b, 0x8b, 0x5e, 0xcb, 0x62, 0x35, 0xc5, 0x9b,
++  0xe2, 0x8e, 0x4c, 0x65, 0x57, 0x4f, 0xcb, 0x27, 0xad, 0xe7, 0x63, 0xa7, 0x77,
++  0x2b, 0xd5, 0x02, 0x42, 0x70, 0x46, 0xac, 0xba, 0xb6, 0x60, 0x57, 0xd9, 0xce,
++  0x31, 0xc5, 0x12, 0x03, 0x4a, 0xf7, 0x2a, 0x2b, 0x40, 0x06, 0xb4, 0xdb, 0x31,
++  0xb7, 0x83, 0x6c, 0x67, 0x87, 0x98, 0x8b, 0xce, 0x1b, 0x30, 0x7a, 0xfa, 0x35,
++  0x6c, 0x86, 0x20, 0x74, 0xc5, 0x7d, 0x32, 0x31, 0x18, 0xeb, 0x69, 0xf7, 0x2d,
++  0x20, 0xc4, 0xf0, 0xd2, 0xfa, 0x67, 0x81, 0xc1, 0xbb, 0x23, 0xbb, 0x75, 0x1a,
++  0xe4, 0xb4, 0x49, 0x99, 0xdf, 0x12, 0x4c, 0xe3, 0x6d, 0x76, 0x24, 0x85, 0x24,
++  0xae, 0x5a, 0x9e, 0xbd, 0x54, 0x1c, 0xf9, 0x0e, 0xed, 0x96, 0xb5, 0xd8, 0xa2,
++  0x0d, 0x2a, 0x38, 0x5d, 0x12, 0x97, 0xb0, 0x4d, 0x75, 0x85, 0x1e, 0x47, 0x6d,
++  0xe1, 0x25, 0x59, 0xcb, 0xe9, 0x33, 0x86, 0x6a, 0xef, 0x98, 0x24, 0xa0, 0x2b,
++  0x02, 0x7b, 0xc0, 0x9f, 0x88, 0x03, 0xb0, 0xbe, 0x22, 0x65, 0x83, 0x77, 0xb3,
++  0x30, 0xba, 0xe0, 0x3b, 0x54, 0x31, 0x3a, 0x45, 0x81, 0x9c, 0x48, 0xaf, 0xc1,
++  0x11, 0x5b, 0xf2, 0x3a, 0x1e, 0x33, 0x1b, 0x8f, 0x0e, 0x04, 0xa4, 0x16, 0xd4,
++  0x6b, 0x57, 0xee, 0xe7, 0xba, 0xf5, 0xee, 0xaf, 0xe2, 0x4c, 0x50, 0xf8, 0x68,
++  0x57, 0x88, 0xfb, 0x7f, 0xa3, 0xcf, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x50,
++  0x30, 0x4e, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14,
++  0x1e, 0x44, 0xe5, 0xef, 0xcd, 0x6e, 0x1f, 0xdb, 0xcb, 0x4f, 0x94, 0x8f, 0xe3,
++  0x3b, 0x1a, 0x8c, 0xe6, 0x95, 0x29, 0x61, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d,
++  0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x1e, 0x44, 0xe5, 0xef, 0xcd, 0x6e,
++  0x1f, 0xdb, 0xcb, 0x4f, 0x94, 0x8f, 0xe3, 0x3b, 0x1a, 0x8c, 0xe6, 0x95, 0x29,
++  0x61, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01,
++  0x01, 0xff, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
++  0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x12, 0x9c, 0x3e, 0x38,
++  0xfc, 0x26, 0xea, 0x6d, 0xb7, 0x5c, 0x29, 0x3c, 0x76, 0x20, 0x0c, 0xb2, 0xa9,
++  0x0f, 0xdf, 0xc0, 0x85, 0xfe, 0xeb, 0xec, 0x1d, 0x5d, 0x73, 0x84, 0xac, 0x8a,
++  0xb4, 0x2a, 0x86, 0x38, 0x30, 0xaf, 0xd2, 0x2d, 0x2a, 0xde, 0x54, 0xc8, 0x5c,
++  0x29, 0x90, 0x24, 0xf2, 0x39, 0xc1, 0xa5, 0x00, 0xb4, 0xb7, 0xd8, 0xdc, 0x59,
++  0x64, 0x50, 0x62, 0x5f, 0x54, 0xf1, 0x73, 0x02, 0x4d, 0x43, 0xc5, 0xc3, 0xc4,
++  0x0e, 0x62, 0x60, 0x8c, 0x53, 0x66, 0x57, 0x77, 0xb5, 0x81, 0xda, 0x1f, 0x81,
++  0xda, 0xe9, 0xd6, 0x5e, 0x82, 0xce, 0xa7, 0x5c, 0xc0, 0xa6, 0xbe, 0x9c, 0x5c,
++  0x7b, 0xa5, 0x15, 0xc8, 0xd7, 0x14, 0x53, 0xd3, 0x5c, 0x1c, 0x9f, 0x8a, 0x9f,
++  0x66, 0x15, 0xd5, 0xd3, 0x2a, 0x27, 0x0c, 0xee, 0x9f, 0x80, 0x39, 0x88, 0x7b,
++  0x24, 0xde, 0x0c, 0x61, 0xa3, 0x44, 0xd8, 0x8d, 0x2e, 0x79, 0xf8, 0x1e, 0x04,
++  0x5a, 0xcb, 0xd6, 0x9c, 0xa3, 0x22, 0x8f, 0x09, 0x32, 0x1e, 0xe1, 0x65, 0x8f,
++  0x10, 0x5f, 0xd8, 0x52, 0x56, 0xd5, 0x77, 0xac, 0x58, 0x46, 0x60, 0xba, 0x2e,
++  0xe2, 0x3f, 0x58, 0x7d, 0x60, 0xfc, 0x31, 0x4a, 0x3a, 0xaf, 0x61, 0x55, 0x5f,
++  0xfb, 0x68, 0x14, 0x74, 0xda, 0xdc, 0x42, 0x78, 0xcc, 0xee, 0xff, 0x5c, 0x03,
++  0x24, 0x26, 0x2c, 0xb8, 0x3a, 0x81, 0xad, 0xdb, 0xe7, 0xed, 0xe1, 0x62, 0x84,
++  0x07, 0x1a, 0xc8, 0xa4, 0x4e, 0xb0, 0x87, 0xf7, 0x96, 0xd8, 0x33, 0x9b, 0x0d,
++  0xa7, 0x77, 0xae, 0x5b, 0xaf, 0xad, 0xe6, 0x5a, 0xc9, 0xfa, 0xa4, 0xe4, 0xe5,
++  0x57, 0xbb, 0x97, 0xdd, 0x92, 0x85, 0xd8, 0x03, 0x45, 0xfe, 0xd8, 0x6b, 0xb1,
++  0xdb, 0x85, 0x36, 0xb9, 0xd9, 0x28, 0xbf, 0x17, 0xae, 0x11, 0xde, 0x10, 0x19,
++  0x26, 0x5b, 0xc0, 0x3d, 0xc7
++};
++
++//
++// Second KEK: "Microsoft Corporation KEK CA 2011".
++// SHA1: 31:59:0b:fd:89:c9:d7:4e:d0:87:df:ac:66:33:4b:39:31:25:4b:30
++//
++// "dbx" updates in "dbxtool" are signed with a key derived from this KEK.
++//
++STATIC CONST UINT8 MicrosoftKEK[] = {
++  0x30, 0x82, 0x05, 0xe8, 0x30, 0x82, 0x03, 0xd0, 0xa0, 0x03, 0x02, 0x01, 0x02,
++  0x02, 0x0a, 0x61, 0x0a, 0xd1, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x30,
++  0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05,
++  0x00, 0x30, 0x81, 0x91, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
++  0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08,
++  0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31,
++  0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64,
++  0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a,
++  0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43,
++  0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x3b, 0x30,
++  0x39, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x32, 0x4d, 0x69, 0x63, 0x72, 0x6f,
++  0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74,
++  0x69, 0x6f, 0x6e, 0x20, 0x54, 0x68, 0x69, 0x72, 0x64, 0x20, 0x50, 0x61, 0x72,
++  0x74, 0x79, 0x20, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63,
++  0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x31, 0x30,
++  0x36, 0x32, 0x34, 0x32, 0x30, 0x34, 0x31, 0x32, 0x39, 0x5a, 0x17, 0x0d, 0x32,
++  0x36, 0x30, 0x36, 0x32, 0x34, 0x32, 0x30, 0x35, 0x31, 0x32, 0x39, 0x5a, 0x30,
++  0x81, 0x80, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
++  0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a,
++  0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31, 0x10, 0x30,
++  0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64, 0x6d, 0x6f,
++  0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x15,
++  0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72,
++  0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x2a, 0x30, 0x28, 0x06,
++  0x03, 0x55, 0x04, 0x03, 0x13, 0x21, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f,
++  0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f,
++  0x6e, 0x20, 0x4b, 0x45, 0x4b, 0x20, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31, 0x31,
++  0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
++  0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82,
++  0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc4, 0xe8, 0xb5, 0x8a, 0xbf, 0xad,
++  0x57, 0x26, 0xb0, 0x26, 0xc3, 0xea, 0xe7, 0xfb, 0x57, 0x7a, 0x44, 0x02, 0x5d,
++  0x07, 0x0d, 0xda, 0x4a, 0xe5, 0x74, 0x2a, 0xe6, 0xb0, 0x0f, 0xec, 0x6d, 0xeb,
++  0xec, 0x7f, 0xb9, 0xe3, 0x5a, 0x63, 0x32, 0x7c, 0x11, 0x17, 0x4f, 0x0e, 0xe3,
++  0x0b, 0xa7, 0x38, 0x15, 0x93, 0x8e, 0xc6, 0xf5, 0xe0, 0x84, 0xb1, 0x9a, 0x9b,
++  0x2c, 0xe7, 0xf5, 0xb7, 0x91, 0xd6, 0x09, 0xe1, 0xe2, 0xc0, 0x04, 0xa8, 0xac,
++  0x30, 0x1c, 0xdf, 0x48, 0xf3, 0x06, 0x50, 0x9a, 0x64, 0xa7, 0x51, 0x7f, 0xc8,
++  0x85, 0x4f, 0x8f, 0x20, 0x86, 0xce, 0xfe, 0x2f, 0xe1, 0x9f, 0xff, 0x82, 0xc0,
++  0xed, 0xe9, 0xcd, 0xce, 0xf4, 0x53, 0x6a, 0x62, 0x3a, 0x0b, 0x43, 0xb9, 0xe2,
++  0x25, 0xfd, 0xfe, 0x05, 0xf9, 0xd4, 0xc4, 0x14, 0xab, 0x11, 0xe2, 0x23, 0x89,
++  0x8d, 0x70, 0xb7, 0xa4, 0x1d, 0x4d, 0xec, 0xae, 0xe5, 0x9c, 0xfa, 0x16, 0xc2,
++  0xd7, 0xc1, 0xcb, 0xd4, 0xe8, 0xc4, 0x2f, 0xe5, 0x99, 0xee, 0x24, 0x8b, 0x03,
++  0xec, 0x8d, 0xf2, 0x8b, 0xea, 0xc3, 0x4a, 0xfb, 0x43, 0x11, 0x12, 0x0b, 0x7e,
++  0xb5, 0x47, 0x92, 0x6c, 0xdc, 0xe6, 0x04, 0x89, 0xeb, 0xf5, 0x33, 0x04, 0xeb,
++  0x10, 0x01, 0x2a, 0x71, 0xe5, 0xf9, 0x83, 0x13, 0x3c, 0xff, 0x25, 0x09, 0x2f,
++  0x68, 0x76, 0x46, 0xff, 0xba, 0x4f, 0xbe, 0xdc, 0xad, 0x71, 0x2a, 0x58, 0xaa,
++  0xfb, 0x0e, 0xd2, 0x79, 0x3d, 0xe4, 0x9b, 0x65, 0x3b, 0xcc, 0x29, 0x2a, 0x9f,
++  0xfc, 0x72, 0x59, 0xa2, 0xeb, 0xae, 0x92, 0xef, 0xf6, 0x35, 0x13, 0x80, 0xc6,
++  0x02, 0xec, 0xe4, 0x5f, 0xcc, 0x9d, 0x76, 0xcd, 0xef, 0x63, 0x92, 0xc1, 0xaf,
++  0x79, 0x40, 0x84, 0x79, 0x87, 0x7f, 0xe3, 0x52, 0xa8, 0xe8, 0x9d, 0x7b, 0x07,
++  0x69, 0x8f, 0x15, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x4f, 0x30,
++  0x82, 0x01, 0x4b, 0x30, 0x10, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82,
++  0x37, 0x15, 0x01, 0x04, 0x03, 0x02, 0x01, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55,
++  0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x62, 0xfc, 0x43, 0xcd, 0xa0, 0x3e, 0xa4,
++  0xcb, 0x67, 0x12, 0xd2, 0x5b, 0xd9, 0x55, 0xac, 0x7b, 0xcc, 0xb6, 0x8a, 0x5f,
++  0x30, 0x19, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02,
++  0x04, 0x0c, 0x1e, 0x0a, 0x00, 0x53, 0x00, 0x75, 0x00, 0x62, 0x00, 0x43, 0x00,
++  0x41, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01,
++  0x86, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05,
++  0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04,
++  0x18, 0x30, 0x16, 0x80, 0x14, 0x45, 0x66, 0x52, 0x43, 0xe1, 0x7e, 0x58, 0x11,
++  0xbf, 0xd6, 0x4e, 0x9e, 0x23, 0x55, 0x08, 0x3b, 0x3a, 0x22, 0x6a, 0xa8, 0x30,
++  0x5c, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x55, 0x30, 0x53, 0x30, 0x51, 0xa0,
++  0x4f, 0xa0, 0x4d, 0x86, 0x4b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63,
++  0x72, 0x6c, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e,
++  0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x72, 0x6c, 0x2f, 0x70,
++  0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43, 0x6f,
++  0x72, 0x54, 0x68, 0x69, 0x50, 0x61, 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f, 0x6f,
++  0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e, 0x63,
++  0x72, 0x6c, 0x30, 0x60, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01,
++  0x01, 0x04, 0x54, 0x30, 0x52, 0x30, 0x50, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05,
++  0x05, 0x07, 0x30, 0x02, 0x86, 0x44, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
++  0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
++  0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x74,
++  0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43, 0x6f, 0x72, 0x54, 0x68, 0x69, 0x50, 0x61,
++  0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f, 0x6f, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d,
++  0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0d, 0x06, 0x09,
++  0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82,
++  0x02, 0x01, 0x00, 0xd4, 0x84, 0x88, 0xf5, 0x14, 0x94, 0x18, 0x02, 0xca, 0x2a,
++  0x3c, 0xfb, 0x2a, 0x92, 0x1c, 0x0c, 0xd7, 0xa0, 0xd1, 0xf1, 0xe8, 0x52, 0x66,
++  0xa8, 0xee, 0xa2, 0xb5, 0x75, 0x7a, 0x90, 0x00, 0xaa, 0x2d, 0xa4, 0x76, 0x5a,
++  0xea, 0x79, 0xb7, 0xb9, 0x37, 0x6a, 0x51, 0x7b, 0x10, 0x64, 0xf6, 0xe1, 0x64,
++  0xf2, 0x02, 0x67, 0xbe, 0xf7, 0xa8, 0x1b, 0x78, 0xbd, 0xba, 0xce, 0x88, 0x58,
++  0x64, 0x0c, 0xd6, 0x57, 0xc8, 0x19, 0xa3, 0x5f, 0x05, 0xd6, 0xdb, 0xc6, 0xd0,
++  0x69, 0xce, 0x48, 0x4b, 0x32, 0xb7, 0xeb, 0x5d, 0xd2, 0x30, 0xf5, 0xc0, 0xf5,
++  0xb8, 0xba, 0x78, 0x07, 0xa3, 0x2b, 0xfe, 0x9b, 0xdb, 0x34, 0x56, 0x84, 0xec,
++  0x82, 0xca, 0xae, 0x41, 0x25, 0x70, 0x9c, 0x6b, 0xe9, 0xfe, 0x90, 0x0f, 0xd7,
++  0x96, 0x1f, 0xe5, 0xe7, 0x94, 0x1f, 0xb2, 0x2a, 0x0c, 0x8d, 0x4b, 0xff, 0x28,
++  0x29, 0x10, 0x7b, 0xf7, 0xd7, 0x7c, 0xa5, 0xd1, 0x76, 0xb9, 0x05, 0xc8, 0x79,
++  0xed, 0x0f, 0x90, 0x92, 0x9c, 0xc2, 0xfe, 0xdf, 0x6f, 0x7e, 0x6c, 0x0f, 0x7b,
++  0xd4, 0xc1, 0x45, 0xdd, 0x34, 0x51, 0x96, 0x39, 0x0f, 0xe5, 0x5e, 0x56, 0xd8,
++  0x18, 0x05, 0x96, 0xf4, 0x07, 0xa6, 0x42, 0xb3, 0xa0, 0x77, 0xfd, 0x08, 0x19,
++  0xf2, 0x71, 0x56, 0xcc, 0x9f, 0x86, 0x23, 0xa4, 0x87, 0xcb, 0xa6, 0xfd, 0x58,
++  0x7e, 0xd4, 0x69, 0x67, 0x15, 0x91, 0x7e, 0x81, 0xf2, 0x7f, 0x13, 0xe5, 0x0d,
++  0x8b, 0x8a, 0x3c, 0x87, 0x84, 0xeb, 0xe3, 0xce, 0xbd, 0x43, 0xe5, 0xad, 0x2d,
++  0x84, 0x93, 0x8e, 0x6a, 0x2b, 0x5a, 0x7c, 0x44, 0xfa, 0x52, 0xaa, 0x81, 0xc8,
++  0x2d, 0x1c, 0xbb, 0xe0, 0x52, 0xdf, 0x00, 0x11, 0xf8, 0x9a, 0x3d, 0xc1, 0x60,
++  0xb0, 0xe1, 0x33, 0xb5, 0xa3, 0x88, 0xd1, 0x65, 0x19, 0x0a, 0x1a, 0xe7, 0xac,
++  0x7c, 0xa4, 0xc1, 0x82, 0x87, 0x4e, 0x38, 0xb1, 0x2f, 0x0d, 0xc5, 0x14, 0x87,
++  0x6f, 0xfd, 0x8d, 0x2e, 0xbc, 0x39, 0xb6, 0xe7, 0xe6, 0xc3, 0xe0, 0xe4, 0xcd,
++  0x27, 0x84, 0xef, 0x94, 0x42, 0xef, 0x29, 0x8b, 0x90, 0x46, 0x41, 0x3b, 0x81,
++  0x1b, 0x67, 0xd8, 0xf9, 0x43, 0x59, 0x65, 0xcb, 0x0d, 0xbc, 0xfd, 0x00, 0x92,
++  0x4f, 0xf4, 0x75, 0x3b, 0xa7, 0xa9, 0x24, 0xfc, 0x50, 0x41, 0x40, 0x79, 0xe0,
++  0x2d, 0x4f, 0x0a, 0x6a, 0x27, 0x76, 0x6e, 0x52, 0xed, 0x96, 0x69, 0x7b, 0xaf,
++  0x0f, 0xf7, 0x87, 0x05, 0xd0, 0x45, 0xc2, 0xad, 0x53, 0x14, 0x81, 0x1f, 0xfb,
++  0x30, 0x04, 0xaa, 0x37, 0x36, 0x61, 0xda, 0x4a, 0x69, 0x1b, 0x34, 0xd8, 0x68,
++  0xed, 0xd6, 0x02, 0xcf, 0x6c, 0x94, 0x0c, 0xd3, 0xcf, 0x6c, 0x22, 0x79, 0xad,
++  0xb1, 0xf0, 0xbc, 0x03, 0xa2, 0x46, 0x60, 0xa9, 0xc4, 0x07, 0xc2, 0x21, 0x82,
++  0xf1, 0xfd, 0xf2, 0xe8, 0x79, 0x32, 0x60, 0xbf, 0xd8, 0xac, 0xa5, 0x22, 0x14,
++  0x4b, 0xca, 0xc1, 0xd8, 0x4b, 0xeb, 0x7d, 0x3f, 0x57, 0x35, 0xb2, 0xe6, 0x4f,
++  0x75, 0xb4, 0xb0, 0x60, 0x03, 0x22, 0x53, 0xae, 0x91, 0x79, 0x1d, 0xd6, 0x9b,
++  0x41, 0x1f, 0x15, 0x86, 0x54, 0x70, 0xb2, 0xde, 0x0d, 0x35, 0x0f, 0x7c, 0xb0,
++  0x34, 0x72, 0xba, 0x97, 0x60, 0x3b, 0xf0, 0x79, 0xeb, 0xa2, 0xb2, 0x1c, 0x5d,
++  0xa2, 0x16, 0xb8, 0x87, 0xc5, 0xe9, 0x1b, 0xf6, 0xb5, 0x97, 0x25, 0x6f, 0x38,
++  0x9f, 0xe3, 0x91, 0xfa, 0x8a, 0x79, 0x98, 0xc3, 0x69, 0x0e, 0xb7, 0xa3, 0x1c,
++  0x20, 0x05, 0x97, 0xf8, 0xca, 0x14, 0xae, 0x00, 0xd7, 0xc4, 0xf3, 0xc0, 0x14,
++  0x10, 0x75, 0x6b, 0x34, 0xa0, 0x1b, 0xb5, 0x99, 0x60, 0xf3, 0x5c, 0xb0, 0xc5,
++  0x57, 0x4e, 0x36, 0xd2, 0x32, 0x84, 0xbf, 0x9e
++};
++
++//
++// First DB entry: "Microsoft Windows Production PCA 2011"
++// SHA1: 58:0a:6f:4c:c4:e4:b6:69:b9:eb:dc:1b:2b:3e:08:7b:80:d0:67:8d
++//
++// Windows 8 and Windows Server 2012 R2 boot loaders are signed with a chain
++// rooted in this certificate.
++//
++STATIC CONST UINT8 MicrosoftPCA[] = {
++  0x30, 0x82, 0x05, 0xd7, 0x30, 0x82, 0x03, 0xbf, 0xa0, 0x03, 0x02, 0x01, 0x02,
++  0x02, 0x0a, 0x61, 0x07, 0x76, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x30,
++  0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05,
++  0x00, 0x30, 0x81, 0x88, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
++  0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08,
++  0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31,
++  0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64,
++  0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a,
++  0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43,
++  0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x32, 0x30,
++  0x30, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x29, 0x4d, 0x69, 0x63, 0x72, 0x6f,
++  0x73, 0x6f, 0x66, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72,
++  0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68,
++  0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x32, 0x30, 0x31, 0x30, 0x30, 0x1e, 0x17,
++  0x0d, 0x31, 0x31, 0x31, 0x30, 0x31, 0x39, 0x31, 0x38, 0x34, 0x31, 0x34, 0x32,
++  0x5a, 0x17, 0x0d, 0x32, 0x36, 0x31, 0x30, 0x31, 0x39, 0x31, 0x38, 0x35, 0x31,
++  0x34, 0x32, 0x5a, 0x30, 0x81, 0x84, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
++  0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
++  0x04, 0x08, 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f,
++  0x6e, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52,
++  0x65, 0x64, 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55,
++  0x04, 0x0a, 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
++  0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31,
++  0x2e, 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x25, 0x4d, 0x69, 0x63,
++  0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77,
++  0x73, 0x20, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
++  0x50, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31, 0x31, 0x30, 0x82, 0x01, 0x22, 0x30,
++  0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05,
++  0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01,
++  0x01, 0x00, 0xdd, 0x0c, 0xbb, 0xa2, 0xe4, 0x2e, 0x09, 0xe3, 0xe7, 0xc5, 0xf7,
++  0x96, 0x69, 0xbc, 0x00, 0x21, 0xbd, 0x69, 0x33, 0x33, 0xef, 0xad, 0x04, 0xcb,
++  0x54, 0x80, 0xee, 0x06, 0x83, 0xbb, 0xc5, 0x20, 0x84, 0xd9, 0xf7, 0xd2, 0x8b,
++  0xf3, 0x38, 0xb0, 0xab, 0xa4, 0xad, 0x2d, 0x7c, 0x62, 0x79, 0x05, 0xff, 0xe3,
++  0x4a, 0x3f, 0x04, 0x35, 0x20, 0x70, 0xe3, 0xc4, 0xe7, 0x6b, 0xe0, 0x9c, 0xc0,
++  0x36, 0x75, 0xe9, 0x8a, 0x31, 0xdd, 0x8d, 0x70, 0xe5, 0xdc, 0x37, 0xb5, 0x74,
++  0x46, 0x96, 0x28, 0x5b, 0x87, 0x60, 0x23, 0x2c, 0xbf, 0xdc, 0x47, 0xa5, 0x67,
++  0xf7, 0x51, 0x27, 0x9e, 0x72, 0xeb, 0x07, 0xa6, 0xc9, 0xb9, 0x1e, 0x3b, 0x53,
++  0x35, 0x7c, 0xe5, 0xd3, 0xec, 0x27, 0xb9, 0x87, 0x1c, 0xfe, 0xb9, 0xc9, 0x23,
++  0x09, 0x6f, 0xa8, 0x46, 0x91, 0xc1, 0x6e, 0x96, 0x3c, 0x41, 0xd3, 0xcb, 0xa3,
++  0x3f, 0x5d, 0x02, 0x6a, 0x4d, 0xec, 0x69, 0x1f, 0x25, 0x28, 0x5c, 0x36, 0xff,
++  0xfd, 0x43, 0x15, 0x0a, 0x94, 0xe0, 0x19, 0xb4, 0xcf, 0xdf, 0xc2, 0x12, 0xe2,
++  0xc2, 0x5b, 0x27, 0xee, 0x27, 0x78, 0x30, 0x8b, 0x5b, 0x2a, 0x09, 0x6b, 0x22,
++  0x89, 0x53, 0x60, 0x16, 0x2c, 0xc0, 0x68, 0x1d, 0x53, 0xba, 0xec, 0x49, 0xf3,
++  0x9d, 0x61, 0x8c, 0x85, 0x68, 0x09, 0x73, 0x44, 0x5d, 0x7d, 0xa2, 0x54, 0x2b,
++  0xdd, 0x79, 0xf7, 0x15, 0xcf, 0x35, 0x5d, 0x6c, 0x1c, 0x2b, 0x5c, 0xce, 0xbc,
++  0x9c, 0x23, 0x8b, 0x6f, 0x6e, 0xb5, 0x26, 0xd9, 0x36, 0x13, 0xc3, 0x4f, 0xd6,
++  0x27, 0xae, 0xb9, 0x32, 0x3b, 0x41, 0x92, 0x2c, 0xe1, 0xc7, 0xcd, 0x77, 0xe8,
++  0xaa, 0x54, 0x4e, 0xf7, 0x5c, 0x0b, 0x04, 0x87, 0x65, 0xb4, 0x43, 0x18, 0xa8,
++  0xb2, 0xe0, 0x6d, 0x19, 0x77, 0xec, 0x5a, 0x24, 0xfa, 0x48, 0x03, 0x02, 0x03,
++  0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x43, 0x30, 0x82, 0x01, 0x3f, 0x30, 0x10,
++  0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x15, 0x01, 0x04, 0x03,
++  0x02, 0x01, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04,
++  0x14, 0xa9, 0x29, 0x02, 0x39, 0x8e, 0x16, 0xc4, 0x97, 0x78, 0xcd, 0x90, 0xf9,
++  0x9e, 0x4f, 0x9a, 0xe1, 0x7c, 0x55, 0xaf, 0x53, 0x30, 0x19, 0x06, 0x09, 0x2b,
++  0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02, 0x04, 0x0c, 0x1e, 0x0a, 0x00,
++  0x53, 0x00, 0x75, 0x00, 0x62, 0x00, 0x43, 0x00, 0x41, 0x30, 0x0b, 0x06, 0x03,
++  0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x0f, 0x06, 0x03,
++  0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff,
++  0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14,
++  0xd5, 0xf6, 0x56, 0xcb, 0x8f, 0xe8, 0xa2, 0x5c, 0x62, 0x68, 0xd1, 0x3d, 0x94,
++  0x90, 0x5b, 0xd7, 0xce, 0x9a, 0x18, 0xc4, 0x30, 0x56, 0x06, 0x03, 0x55, 0x1d,
++  0x1f, 0x04, 0x4f, 0x30, 0x4d, 0x30, 0x4b, 0xa0, 0x49, 0xa0, 0x47, 0x86, 0x45,
++  0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x72, 0x6c, 0x2e, 0x6d, 0x69,
++  0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70,
++  0x6b, 0x69, 0x2f, 0x63, 0x72, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,
++  0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x52, 0x6f, 0x6f, 0x43, 0x65, 0x72, 0x41,
++  0x75, 0x74, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x30, 0x36, 0x2d, 0x32, 0x33,
++  0x2e, 0x63, 0x72, 0x6c, 0x30, 0x5a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05,
++  0x07, 0x01, 0x01, 0x04, 0x4e, 0x30, 0x4c, 0x30, 0x4a, 0x06, 0x08, 0x2b, 0x06,
++  0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x3e, 0x68, 0x74, 0x74, 0x70, 0x3a,
++  0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f,
++  0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x65,
++  0x72, 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x52, 0x6f, 0x6f, 0x43, 0x65, 0x72,
++  0x41, 0x75, 0x74, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x30, 0x36, 0x2d, 0x32,
++  0x33, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
++  0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x02, 0x01, 0x00, 0x14,
++  0xfc, 0x7c, 0x71, 0x51, 0xa5, 0x79, 0xc2, 0x6e, 0xb2, 0xef, 0x39, 0x3e, 0xbc,
++  0x3c, 0x52, 0x0f, 0x6e, 0x2b, 0x3f, 0x10, 0x13, 0x73, 0xfe, 0xa8, 0x68, 0xd0,
++  0x48, 0xa6, 0x34, 0x4d, 0x8a, 0x96, 0x05, 0x26, 0xee, 0x31, 0x46, 0x90, 0x61,
++  0x79, 0xd6, 0xff, 0x38, 0x2e, 0x45, 0x6b, 0xf4, 0xc0, 0xe5, 0x28, 0xb8, 0xda,
++  0x1d, 0x8f, 0x8a, 0xdb, 0x09, 0xd7, 0x1a, 0xc7, 0x4c, 0x0a, 0x36, 0x66, 0x6a,
++  0x8c, 0xec, 0x1b, 0xd7, 0x04, 0x90, 0xa8, 0x18, 0x17, 0xa4, 0x9b, 0xb9, 0xe2,
++  0x40, 0x32, 0x36, 0x76, 0xc4, 0xc1, 0x5a, 0xc6, 0xbf, 0xe4, 0x04, 0xc0, 0xea,
++  0x16, 0xd3, 0xac, 0xc3, 0x68, 0xef, 0x62, 0xac, 0xdd, 0x54, 0x6c, 0x50, 0x30,
++  0x58, 0xa6, 0xeb, 0x7c, 0xfe, 0x94, 0xa7, 0x4e, 0x8e, 0xf4, 0xec, 0x7c, 0x86,
++  0x73, 0x57, 0xc2, 0x52, 0x21, 0x73, 0x34, 0x5a, 0xf3, 0xa3, 0x8a, 0x56, 0xc8,
++  0x04, 0xda, 0x07, 0x09, 0xed, 0xf8, 0x8b, 0xe3, 0xce, 0xf4, 0x7e, 0x8e, 0xae,
++  0xf0, 0xf6, 0x0b, 0x8a, 0x08, 0xfb, 0x3f, 0xc9, 0x1d, 0x72, 0x7f, 0x53, 0xb8,
++  0xeb, 0xbe, 0x63, 0xe0, 0xe3, 0x3d, 0x31, 0x65, 0xb0, 0x81, 0xe5, 0xf2, 0xac,
++  0xcd, 0x16, 0xa4, 0x9f, 0x3d, 0xa8, 0xb1, 0x9b, 0xc2, 0x42, 0xd0, 0x90, 0x84,
++  0x5f, 0x54, 0x1d, 0xff, 0x89, 0xea, 0xba, 0x1d, 0x47, 0x90, 0x6f, 0xb0, 0x73,
++  0x4e, 0x41, 0x9f, 0x40, 0x9f, 0x5f, 0xe5, 0xa1, 0x2a, 0xb2, 0x11, 0x91, 0x73,
++  0x8a, 0x21, 0x28, 0xf0, 0xce, 0xde, 0x73, 0x39, 0x5f, 0x3e, 0xab, 0x5c, 0x60,
++  0xec, 0xdf, 0x03, 0x10, 0xa8, 0xd3, 0x09, 0xe9, 0xf4, 0xf6, 0x96, 0x85, 0xb6,
++  0x7f, 0x51, 0x88, 0x66, 0x47, 0x19, 0x8d, 0xa2, 0xb0, 0x12, 0x3d, 0x81, 0x2a,
++  0x68, 0x05, 0x77, 0xbb, 0x91, 0x4c, 0x62, 0x7b, 0xb6, 0xc1, 0x07, 0xc7, 0xba,
++  0x7a, 0x87, 0x34, 0x03, 0x0e, 0x4b, 0x62, 0x7a, 0x99, 0xe9, 0xca, 0xfc, 0xce,
++  0x4a, 0x37, 0xc9, 0x2d, 0xa4, 0x57, 0x7c, 0x1c, 0xfe, 0x3d, 0xdc, 0xb8, 0x0f,
++  0x5a, 0xfa, 0xd6, 0xc4, 0xb3, 0x02, 0x85, 0x02, 0x3a, 0xea, 0xb3, 0xd9, 0x6e,
++  0xe4, 0x69, 0x21, 0x37, 0xde, 0x81, 0xd1, 0xf6, 0x75, 0x19, 0x05, 0x67, 0xd3,
++  0x93, 0x57, 0x5e, 0x29, 0x1b, 0x39, 0xc8, 0xee, 0x2d, 0xe1, 0xcd, 0xe4, 0x45,
++  0x73, 0x5b, 0xd0, 0xd2, 0xce, 0x7a, 0xab, 0x16, 0x19, 0x82, 0x46, 0x58, 0xd0,
++  0x5e, 0x9d, 0x81, 0xb3, 0x67, 0xaf, 0x6c, 0x35, 0xf2, 0xbc, 0xe5, 0x3f, 0x24,
++  0xe2, 0x35, 0xa2, 0x0a, 0x75, 0x06, 0xf6, 0x18, 0x56, 0x99, 0xd4, 0x78, 0x2c,
++  0xd1, 0x05, 0x1b, 0xeb, 0xd0, 0x88, 0x01, 0x9d, 0xaa, 0x10, 0xf1, 0x05, 0xdf,
++  0xba, 0x7e, 0x2c, 0x63, 0xb7, 0x06, 0x9b, 0x23, 0x21, 0xc4, 0xf9, 0x78, 0x6c,
++  0xe2, 0x58, 0x17, 0x06, 0x36, 0x2b, 0x91, 0x12, 0x03, 0xcc, 0xa4, 0xd9, 0xf2,
++  0x2d, 0xba, 0xf9, 0x94, 0x9d, 0x40, 0xed, 0x18, 0x45, 0xf1, 0xce, 0x8a, 0x5c,
++  0x6b, 0x3e, 0xab, 0x03, 0xd3, 0x70, 0x18, 0x2a, 0x0a, 0x6a, 0xe0, 0x5f, 0x47,
++  0xd1, 0xd5, 0x63, 0x0a, 0x32, 0xf2, 0xaf, 0xd7, 0x36, 0x1f, 0x2a, 0x70, 0x5a,
++  0xe5, 0x42, 0x59, 0x08, 0x71, 0x4b, 0x57, 0xba, 0x7e, 0x83, 0x81, 0xf0, 0x21,
++  0x3c, 0xf4, 0x1c, 0xc1, 0xc5, 0xb9, 0x90, 0x93, 0x0e, 0x88, 0x45, 0x93, 0x86,
++  0xe9, 0xb1, 0x20, 0x99, 0xbe, 0x98, 0xcb, 0xc5, 0x95, 0xa4, 0x5d, 0x62, 0xd6,
++  0xa0, 0x63, 0x08, 0x20, 0xbd, 0x75, 0x10, 0x77, 0x7d, 0x3d, 0xf3, 0x45, 0xb9,
++  0x9f, 0x97, 0x9f, 0xcb, 0x57, 0x80, 0x6f, 0x33, 0xa9, 0x04, 0xcf, 0x77, 0xa4,
++  0x62, 0x1c, 0x59, 0x7e
++};
++
++//
++// Second DB entry: "Microsoft Corporation UEFI CA 2011"
++// SHA1: 46:de:f6:3b:5c:e6:1c:f8:ba:0d:e2:e6:63:9c:10:19:d0:ed:14:f3
++//
++// To verify the "shim" binary and PCI expansion ROMs with.
++//
++STATIC CONST UINT8 MicrosoftUefiCA[] = {
++  0x30, 0x82, 0x06, 0x10, 0x30, 0x82, 0x03, 0xf8, 0xa0, 0x03, 0x02, 0x01, 0x02,
++  0x02, 0x0a, 0x61, 0x08, 0xd3, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x30,
++  0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05,
++  0x00, 0x30, 0x81, 0x91, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
++  0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08,
++  0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31,
++  0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64,
++  0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a,
++  0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43,
++  0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x3b, 0x30,
++  0x39, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x32, 0x4d, 0x69, 0x63, 0x72, 0x6f,
++  0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74,
++  0x69, 0x6f, 0x6e, 0x20, 0x54, 0x68, 0x69, 0x72, 0x64, 0x20, 0x50, 0x61, 0x72,
++  0x74, 0x79, 0x20, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63,
++  0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x31, 0x30,
++  0x36, 0x32, 0x37, 0x32, 0x31, 0x32, 0x32, 0x34, 0x35, 0x5a, 0x17, 0x0d, 0x32,
++  0x36, 0x30, 0x36, 0x32, 0x37, 0x32, 0x31, 0x33, 0x32, 0x34, 0x35, 0x5a, 0x30,
++  0x81, 0x81, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
++  0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a,
++  0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31, 0x10, 0x30,
++  0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64, 0x6d, 0x6f,
++  0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x15,
++  0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72,
++  0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x2b, 0x30, 0x29, 0x06,
++  0x03, 0x55, 0x04, 0x03, 0x13, 0x22, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f,
++  0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f,
++  0x6e, 0x20, 0x55, 0x45, 0x46, 0x49, 0x20, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31,
++  0x31, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
++  0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30,
++  0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xa5, 0x08, 0x6c, 0x4c, 0xc7,
++  0x45, 0x09, 0x6a, 0x4b, 0x0c, 0xa4, 0xc0, 0x87, 0x7f, 0x06, 0x75, 0x0c, 0x43,
++  0x01, 0x54, 0x64, 0xe0, 0x16, 0x7f, 0x07, 0xed, 0x92, 0x7d, 0x0b, 0xb2, 0x73,
++  0xbf, 0x0c, 0x0a, 0xc6, 0x4a, 0x45, 0x61, 0xa0, 0xc5, 0x16, 0x2d, 0x96, 0xd3,
++  0xf5, 0x2b, 0xa0, 0xfb, 0x4d, 0x49, 0x9b, 0x41, 0x80, 0x90, 0x3c, 0xb9, 0x54,
++  0xfd, 0xe6, 0xbc, 0xd1, 0x9d, 0xc4, 0xa4, 0x18, 0x8a, 0x7f, 0x41, 0x8a, 0x5c,
++  0x59, 0x83, 0x68, 0x32, 0xbb, 0x8c, 0x47, 0xc9, 0xee, 0x71, 0xbc, 0x21, 0x4f,
++  0x9a, 0x8a, 0x7c, 0xff, 0x44, 0x3f, 0x8d, 0x8f, 0x32, 0xb2, 0x26, 0x48, 0xae,
++  0x75, 0xb5, 0xee, 0xc9, 0x4c, 0x1e, 0x4a, 0x19, 0x7e, 0xe4, 0x82, 0x9a, 0x1d,
++  0x78, 0x77, 0x4d, 0x0c, 0xb0, 0xbd, 0xf6, 0x0f, 0xd3, 0x16, 0xd3, 0xbc, 0xfa,
++  0x2b, 0xa5, 0x51, 0x38, 0x5d, 0xf5, 0xfb, 0xba, 0xdb, 0x78, 0x02, 0xdb, 0xff,
++  0xec, 0x0a, 0x1b, 0x96, 0xd5, 0x83, 0xb8, 0x19, 0x13, 0xe9, 0xb6, 0xc0, 0x7b,
++  0x40, 0x7b, 0xe1, 0x1f, 0x28, 0x27, 0xc9, 0xfa, 0xef, 0x56, 0x5e, 0x1c, 0xe6,
++  0x7e, 0x94, 0x7e, 0xc0, 0xf0, 0x44, 0xb2, 0x79, 0x39, 0xe5, 0xda, 0xb2, 0x62,
++  0x8b, 0x4d, 0xbf, 0x38, 0x70, 0xe2, 0x68, 0x24, 0x14, 0xc9, 0x33, 0xa4, 0x08,
++  0x37, 0xd5, 0x58, 0x69, 0x5e, 0xd3, 0x7c, 0xed, 0xc1, 0x04, 0x53, 0x08, 0xe7,
++  0x4e, 0xb0, 0x2a, 0x87, 0x63, 0x08, 0x61, 0x6f, 0x63, 0x15, 0x59, 0xea, 0xb2,
++  0x2b, 0x79, 0xd7, 0x0c, 0x61, 0x67, 0x8a, 0x5b, 0xfd, 0x5e, 0xad, 0x87, 0x7f,
++  0xba, 0x86, 0x67, 0x4f, 0x71, 0x58, 0x12, 0x22, 0x04, 0x22, 0x22, 0xce, 0x8b,
++  0xef, 0x54, 0x71, 0x00, 0xce, 0x50, 0x35, 0x58, 0x76, 0x95, 0x08, 0xee, 0x6a,
++  0xb1, 0xa2, 0x01, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x76,
++  0x30, 0x82, 0x01, 0x72, 0x30, 0x12, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01,
++  0x82, 0x37, 0x15, 0x01, 0x04, 0x05, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x23,
++  0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x15, 0x02, 0x04, 0x16,
++  0x04, 0x14, 0xf8, 0xc1, 0x6b, 0xb7, 0x7f, 0x77, 0x53, 0x4a, 0xf3, 0x25, 0x37,
++  0x1d, 0x4e, 0xa1, 0x26, 0x7b, 0x0f, 0x20, 0x70, 0x80, 0x30, 0x1d, 0x06, 0x03,
++  0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x13, 0xad, 0xbf, 0x43, 0x09, 0xbd,
++  0x82, 0x70, 0x9c, 0x8c, 0xd5, 0x4f, 0x31, 0x6e, 0xd5, 0x22, 0x98, 0x8a, 0x1b,
++  0xd4, 0x30, 0x19, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14,
++  0x02, 0x04, 0x0c, 0x1e, 0x0a, 0x00, 0x53, 0x00, 0x75, 0x00, 0x62, 0x00, 0x43,
++  0x00, 0x41, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02,
++  0x01, 0x86, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04,
++  0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23,
++  0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x45, 0x66, 0x52, 0x43, 0xe1, 0x7e, 0x58,
++  0x11, 0xbf, 0xd6, 0x4e, 0x9e, 0x23, 0x55, 0x08, 0x3b, 0x3a, 0x22, 0x6a, 0xa8,
++  0x30, 0x5c, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x55, 0x30, 0x53, 0x30, 0x51,
++  0xa0, 0x4f, 0xa0, 0x4d, 0x86, 0x4b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
++  0x63, 0x72, 0x6c, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
++  0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x72, 0x6c, 0x2f,
++  0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43,
++  0x6f, 0x72, 0x54, 0x68, 0x69, 0x50, 0x61, 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f,
++  0x6f, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e,
++  0x63, 0x72, 0x6c, 0x30, 0x60, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07,
++  0x01, 0x01, 0x04, 0x54, 0x30, 0x52, 0x30, 0x50, 0x06, 0x08, 0x2b, 0x06, 0x01,
++  0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x44, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
++  0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66,
++  0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x65, 0x72,
++  0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43, 0x6f, 0x72, 0x54, 0x68, 0x69, 0x50,
++  0x61, 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f, 0x6f, 0x5f, 0x32, 0x30, 0x31, 0x30,
++  0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0d, 0x06,
++  0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03,
++  0x82, 0x02, 0x01, 0x00, 0x35, 0x08, 0x42, 0xff, 0x30, 0xcc, 0xce, 0xf7, 0x76,
++  0x0c, 0xad, 0x10, 0x68, 0x58, 0x35, 0x29, 0x46, 0x32, 0x76, 0x27, 0x7c, 0xef,
++  0x12, 0x41, 0x27, 0x42, 0x1b, 0x4a, 0xaa, 0x6d, 0x81, 0x38, 0x48, 0x59, 0x13,
++  0x55, 0xf3, 0xe9, 0x58, 0x34, 0xa6, 0x16, 0x0b, 0x82, 0xaa, 0x5d, 0xad, 0x82,
++  0xda, 0x80, 0x83, 0x41, 0x06, 0x8f, 0xb4, 0x1d, 0xf2, 0x03, 0xb9, 0xf3, 0x1a,
++  0x5d, 0x1b, 0xf1, 0x50, 0x90, 0xf9, 0xb3, 0x55, 0x84, 0x42, 0x28, 0x1c, 0x20,
++  0xbd, 0xb2, 0xae, 0x51, 0x14, 0xc5, 0xc0, 0xac, 0x97, 0x95, 0x21, 0x1c, 0x90,
++  0xdb, 0x0f, 0xfc, 0x77, 0x9e, 0x95, 0x73, 0x91, 0x88, 0xca, 0xbd, 0xbd, 0x52,
++  0xb9, 0x05, 0x50, 0x0d, 0xdf, 0x57, 0x9e, 0xa0, 0x61, 0xed, 0x0d, 0xe5, 0x6d,
++  0x25, 0xd9, 0x40, 0x0f, 0x17, 0x40, 0xc8, 0xce, 0xa3, 0x4a, 0xc2, 0x4d, 0xaf,
++  0x9a, 0x12, 0x1d, 0x08, 0x54, 0x8f, 0xbd, 0xc7, 0xbc, 0xb9, 0x2b, 0x3d, 0x49,
++  0x2b, 0x1f, 0x32, 0xfc, 0x6a, 0x21, 0x69, 0x4f, 0x9b, 0xc8, 0x7e, 0x42, 0x34,
++  0xfc, 0x36, 0x06, 0x17, 0x8b, 0x8f, 0x20, 0x40, 0xc0, 0xb3, 0x9a, 0x25, 0x75,
++  0x27, 0xcd, 0xc9, 0x03, 0xa3, 0xf6, 0x5d, 0xd1, 0xe7, 0x36, 0x54, 0x7a, 0xb9,
++  0x50, 0xb5, 0xd3, 0x12, 0xd1, 0x07, 0xbf, 0xbb, 0x74, 0xdf, 0xdc, 0x1e, 0x8f,
++  0x80, 0xd5, 0xed, 0x18, 0xf4, 0x2f, 0x14, 0x16, 0x6b, 0x2f, 0xde, 0x66, 0x8c,
++  0xb0, 0x23, 0xe5, 0xc7, 0x84, 0xd8, 0xed, 0xea, 0xc1, 0x33, 0x82, 0xad, 0x56,
++  0x4b, 0x18, 0x2d, 0xf1, 0x68, 0x95, 0x07, 0xcd, 0xcf, 0xf0, 0x72, 0xf0, 0xae,
++  0xbb, 0xdd, 0x86, 0x85, 0x98, 0x2c, 0x21, 0x4c, 0x33, 0x2b, 0xf0, 0x0f, 0x4a,
++  0xf0, 0x68, 0x87, 0xb5, 0x92, 0x55, 0x32, 0x75, 0xa1, 0x6a, 0x82, 0x6a, 0x3c,
++  0xa3, 0x25, 0x11, 0xa4, 0xed, 0xad, 0xd7, 0x04, 0xae, 0xcb, 0xd8, 0x40, 0x59,
++  0xa0, 0x84, 0xd1, 0x95, 0x4c, 0x62, 0x91, 0x22, 0x1a, 0x74, 0x1d, 0x8c, 0x3d,
++  0x47, 0x0e, 0x44, 0xa6, 0xe4, 0xb0, 0x9b, 0x34, 0x35, 0xb1, 0xfa, 0xb6, 0x53,
++  0xa8, 0x2c, 0x81, 0xec, 0xa4, 0x05, 0x71, 0xc8, 0x9d, 0xb8, 0xba, 0xe8, 0x1b,
++  0x44, 0x66, 0xe4, 0x47, 0x54, 0x0e, 0x8e, 0x56, 0x7f, 0xb3, 0x9f, 0x16, 0x98,
++  0xb2, 0x86, 0xd0, 0x68, 0x3e, 0x90, 0x23, 0xb5, 0x2f, 0x5e, 0x8f, 0x50, 0x85,
++  0x8d, 0xc6, 0x8d, 0x82, 0x5f, 0x41, 0xa1, 0xf4, 0x2e, 0x0d, 0xe0, 0x99, 0xd2,
++  0x6c, 0x75, 0xe4, 0xb6, 0x69, 0xb5, 0x21, 0x86, 0xfa, 0x07, 0xd1, 0xf6, 0xe2,
++  0x4d, 0xd1, 0xda, 0xad, 0x2c, 0x77, 0x53, 0x1e, 0x25, 0x32, 0x37, 0xc7, 0x6c,
++  0x52, 0x72, 0x95, 0x86, 0xb0, 0xf1, 0x35, 0x61, 0x6a, 0x19, 0xf5, 0xb2, 0x3b,
++  0x81, 0x50, 0x56, 0xa6, 0x32, 0x2d, 0xfe, 0xa2, 0x89, 0xf9, 0x42, 0x86, 0x27,
++  0x18, 0x55, 0xa1, 0x82, 0xca, 0x5a, 0x9b, 0xf8, 0x30, 0x98, 0x54, 0x14, 0xa6,
++  0x47, 0x96, 0x25, 0x2f, 0xc8, 0x26, 0xe4, 0x41, 0x94, 0x1a, 0x5c, 0x02, 0x3f,
++  0xe5, 0x96, 0xe3, 0x85, 0x5b, 0x3c, 0x3e, 0x3f, 0xbb, 0x47, 0x16, 0x72, 0x55,
++  0xe2, 0x25, 0x22, 0xb1, 0xd9, 0x7b, 0xe7, 0x03, 0x06, 0x2a, 0xa3, 0xf7, 0x1e,
++  0x90, 0x46, 0xc3, 0x00, 0x0d, 0xd6, 0x19, 0x89, 0xe3, 0x0e, 0x35, 0x27, 0x62,
++  0x03, 0x71, 0x15, 0xa6, 0xef, 0xd0, 0x27, 0xa0, 0xa0, 0x59, 0x37, 0x60, 0xf8,
++  0x38, 0x94, 0xb8, 0xe0, 0x78, 0x70, 0xf8, 0xba, 0x4c, 0x86, 0x87, 0x94, 0xf6,
++  0xe0, 0xae, 0x02, 0x45, 0xee, 0x65, 0xc2, 0xb6, 0xa3, 0x7e, 0x69, 0x16, 0x75,
++  0x07, 0x92, 0x9b, 0xf5, 0xa6, 0xbc, 0x59, 0x83, 0x58
++};
++
++//
++// The most important thing about the variable payload is that it is a list of
++// lists, where the element size of any given *inner* list is constant.
++//
++// Since X509 certificates vary in size, each of our *inner* lists will contain
++// one element only (one X.509 certificate). This is explicitly mentioned in
++// the UEFI specification, in "28.4.1 Signature Database", in a Note.
++//
++// The list structure looks as follows:
++//
++// struct EFI_VARIABLE_AUTHENTICATION_2 {                           |
++//   struct EFI_TIME {                                              |
++//     UINT16 Year;                                                 |
++//     UINT8  Month;                                                |
++//     UINT8  Day;                                                  |
++//     UINT8  Hour;                                                 |
++//     UINT8  Minute;                                               |
++//     UINT8  Second;                                               |
++//     UINT8  Pad1;                                                 |
++//     UINT32 Nanosecond;                                           |
++//     INT16  TimeZone;                                             |
++//     UINT8  Daylight;                                             |
++//     UINT8  Pad2;                                                 |
++//   } TimeStamp;                                                   |
++//                                                                  |
++//   struct WIN_CERTIFICATE_UEFI_GUID {                           | |
++//     struct WIN_CERTIFICATE {                                   | |
++//       UINT32 dwLength; ----------------------------------------+ |
++//       UINT16 wRevision;                                        | |
++//       UINT16 wCertificateType;                                 | |
++//     } Hdr;                                                     | +- DataSize
++//                                                                | |
++//     EFI_GUID CertType;                                         | |
++//     UINT8    CertData[1] = { <--- "struct hack"                | |
++//       struct EFI_SIGNATURE_LIST {                            | | |
++//         EFI_GUID SignatureType;                              | | |
++//         UINT32   SignatureListSize; -------------------------+ | |
++//         UINT32   SignatureHeaderSize;                        | | |
++//         UINT32   SignatureSize; ---------------------------+ | | |
++//         UINT8    SignatureHeader[SignatureHeaderSize];     | | | |
++//                                                            v | | |
++//         struct EFI_SIGNATURE_DATA {                        | | | |
++//           EFI_GUID SignatureOwner;                         | | | |
++//           UINT8    SignatureData[1] = { <--- "struct hack" | | | |
++//             X.509 payload                                  | | | |
++//           }                                                | | | |
++//         } Signatures[];                                      | | |
++//       } SigLists[];                                            | |
++//     };                                                         | |
++//   } AuthInfo;                                                  | |
++// };                                                               |
++//
++// Given that the "struct hack" invokes undefined behavior (which is why C99
++// introduced the flexible array member), and because subtracting those pesky
++// sizes of 1 is annoying, and because the format is fully specified in the
++// UEFI specification, we'll introduce two matching convenience structures that
++// are customized for our X.509 purposes.
++//
++#pragma pack(1)
++typedef struct {
++  EFI_TIME TimeStamp;
++
++  //
++  // dwLength covers data below
++  //
++  UINT32   dwLength;
++  UINT16   wRevision;
++  UINT16   wCertificateType;
++  EFI_GUID CertType;
++} SINGLE_HEADER;
++
++typedef struct {
++  //
++  // SignatureListSize covers data below
++  //
++  EFI_GUID SignatureType;
++  UINT32   SignatureListSize;
++  UINT32   SignatureHeaderSize; // constant 0
++  UINT32   SignatureSize;
++
++  //
++  // SignatureSize covers data below
++  //
++  EFI_GUID SignatureOwner;
++
++  //
++  // X.509 certificate follows
++  //
++} REPEATING_HEADER;
++#pragma pack()
++
++/**
++  Enroll a set of DER-formatted X.509 certificates in a global variable,
++  overwriting it.
++
++  The variable will be rewritten with NV+BS+RT+AT attributes.
++
++  @param[in] VariableName  The name of the variable to overwrite.
++
++  @param[in] VendorGuid    The namespace (ie. vendor GUID) of the variable to
++                           overwrite.
++
++  @param[in] ...           A list of
++
++                             IN CONST UINT8    *Cert,
++                             IN UINTN          CertSize,
++                             IN CONST EFI_GUID *OwnerGuid
++
++                           triplets. If the first component of a triplet is
++                           NULL, then the other two components are not
++                           accessed, and processing is terminated. The list of
++                           X.509 certificates is enrolled in the variable
++                           specified, overwriting it. The OwnerGuid component
++                           identifies the agent installing the certificate.
++
++  @retval EFI_INVALID_PARAMETER  The triplet list is empty (ie. the first Cert
++                                 value is NULL), or one of the CertSize values
++                                 is 0, or one of the CertSize values would
++                                 overflow the accumulated UINT32 data size.
++
++  @retval EFI_OUT_OF_RESOURCES   Out of memory while formatting variable
++                                 payload.
++
++  @retval EFI_SUCCESS            Enrollment successful; the variable has been
++                                 overwritten (or created).
++
++  @return                        Error codes from gRT->GetTime() and
++                                 gRT->SetVariable().
++**/
++STATIC
++EFI_STATUS
++EFIAPI
++EnrollListOfX509Certs (
++  IN CHAR16   *VariableName,
++  IN EFI_GUID *VendorGuid,
++  ...
++  )
++{
++  UINTN            DataSize;
++  SINGLE_HEADER    *SingleHeader;
++  REPEATING_HEADER *RepeatingHeader;
++  VA_LIST          Marker;
++  CONST UINT8      *Cert;
++  EFI_STATUS       Status = EFI_SUCCESS;
++  UINT8            *Data;
++  UINT8            *Position;
++
++  //
++  // compute total size first, for UINT32 range check, and allocation
++  //
++  DataSize = sizeof *SingleHeader;
++  VA_START (Marker, VendorGuid);
++  for (Cert = VA_ARG (Marker, CONST UINT8 *);
++       Cert != NULL;
++       Cert = VA_ARG (Marker, CONST UINT8 *)) {
++    UINTN          CertSize;
++
++    CertSize = VA_ARG (Marker, UINTN);
++    (VOID)VA_ARG (Marker, CONST EFI_GUID *);
++
++    if (CertSize == 0 ||
++        CertSize > MAX_UINT32 - sizeof *RepeatingHeader ||
++        DataSize > MAX_UINT32 - sizeof *RepeatingHeader - CertSize) {
++      Status = EFI_INVALID_PARAMETER;
++      break;
++    }
++    DataSize += sizeof *RepeatingHeader + CertSize;
++  }
++  VA_END (Marker);
++
++  if (DataSize == sizeof *SingleHeader) {
++    Status = EFI_INVALID_PARAMETER;
++  }
++  if (EFI_ERROR (Status)) {
++    goto Out;
++  }
++
++  Data = AllocatePool (DataSize);
++  if (Data == NULL) {
++    Status = EFI_OUT_OF_RESOURCES;
++    goto Out;
++  }
++
++  Position = Data;
++
++  SingleHeader = (SINGLE_HEADER *)Position;
++  Status = gRT->GetTime (&SingleHeader->TimeStamp, NULL);
++  if (EFI_ERROR (Status)) {
++    goto FreeData;
++  }
++  SingleHeader->TimeStamp.Pad1       = 0;
++  SingleHeader->TimeStamp.Nanosecond = 0;
++  SingleHeader->TimeStamp.TimeZone   = 0;
++  SingleHeader->TimeStamp.Daylight   = 0;
++  SingleHeader->TimeStamp.Pad2       = 0;
++#if 0
++  SingleHeader->dwLength         = DataSize - sizeof SingleHeader->TimeStamp;
++#else
++  //
++  // This looks like a bug in edk2. According to the UEFI specification,
++  // dwLength is "The length of the entire certificate, including the length of
++  // the header, in bytes". That shouldn't stop right after CertType -- it
++  // should include everything below it.
++  //
++  SingleHeader->dwLength         = sizeof *SingleHeader
++                                     - sizeof SingleHeader->TimeStamp;
++#endif
++  SingleHeader->wRevision        = 0x0200;
++  SingleHeader->wCertificateType = WIN_CERT_TYPE_EFI_GUID;
++  CopyGuid (&SingleHeader->CertType, &gEfiCertPkcs7Guid);
++  Position += sizeof *SingleHeader;
++
++  VA_START (Marker, VendorGuid);
++  for (Cert = VA_ARG (Marker, CONST UINT8 *);
++       Cert != NULL;
++       Cert = VA_ARG (Marker, CONST UINT8 *)) {
++    UINTN            CertSize;
++    CONST EFI_GUID   *OwnerGuid;
++
++    CertSize  = VA_ARG (Marker, UINTN);
++    OwnerGuid = VA_ARG (Marker, CONST EFI_GUID *);
++
++    RepeatingHeader = (REPEATING_HEADER *)Position;
++    CopyGuid (&RepeatingHeader->SignatureType, &gEfiCertX509Guid);
++    RepeatingHeader->SignatureListSize   = sizeof *RepeatingHeader + CertSize;
++    RepeatingHeader->SignatureHeaderSize = 0;
++    RepeatingHeader->SignatureSize       =
++      sizeof RepeatingHeader->SignatureOwner + CertSize;
++    CopyGuid (&RepeatingHeader->SignatureOwner, OwnerGuid);
++    Position += sizeof *RepeatingHeader;
++
++    CopyMem (Position, Cert, CertSize);
++    Position += CertSize;
++  }
++  VA_END (Marker);
++
++  ASSERT (Data + DataSize == Position);
++
++  Status = gRT->SetVariable (VariableName, VendorGuid,
++                  (EFI_VARIABLE_NON_VOLATILE |
++                   EFI_VARIABLE_BOOTSERVICE_ACCESS |
++                   EFI_VARIABLE_RUNTIME_ACCESS |
++                   EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS),
++                  DataSize, Data);
++
++FreeData:
++  FreePool (Data);
++
++Out:
++  if (EFI_ERROR (Status)) {
++    AsciiPrint ("error: %a(\"%s\", %g): %r\n", __FUNCTION__, VariableName,
++      VendorGuid, Status);
++  }
++  return Status;
++}
++
++
++STATIC
++EFI_STATUS
++EFIAPI
++GetExact (
++  IN CHAR16   *VariableName,
++  IN EFI_GUID *VendorGuid,
++  OUT VOID    *Data,
++  IN UINTN    DataSize,
++  IN BOOLEAN  AllowMissing
++  )
++{
++  UINTN      Size;
++  EFI_STATUS Status;
++
++  Size = DataSize;
++  Status = gRT->GetVariable (VariableName, VendorGuid, NULL, &Size, Data);
++  if (EFI_ERROR (Status)) {
++    if (Status == EFI_NOT_FOUND && AllowMissing) {
++      ZeroMem (Data, DataSize);
++      return EFI_SUCCESS;
++    }
++
++    AsciiPrint ("error: GetVariable(\"%s\", %g): %r\n", VariableName,
++      VendorGuid, Status);
++    return Status;
++  }
++
++  if (Size != DataSize) {
++    AsciiPrint ("error: GetVariable(\"%s\", %g): expected size 0x%Lx, "
++      "got 0x%Lx\n", VariableName, VendorGuid, (UINT64)DataSize, (UINT64)Size);
++    return EFI_PROTOCOL_ERROR;
++  }
++
++  return EFI_SUCCESS;
++}
++
++typedef struct {
++  UINT8 SetupMode;
++  UINT8 SecureBoot;
++  UINT8 SecureBootEnable;
++  UINT8 CustomMode;
++  UINT8 VendorKeys;
++} SETTINGS;
++
++STATIC
++EFI_STATUS
++EFIAPI
++GetSettings (
++  OUT SETTINGS *Settings
++  )
++{
++  EFI_STATUS Status;
++
++  Status = GetExact (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid,
++             &Settings->SetupMode, sizeof Settings->SetupMode, FALSE);
++  if (EFI_ERROR (Status)) {
++    return Status;
++  }
++
++  Status = GetExact (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid,
++             &Settings->SecureBoot, sizeof Settings->SecureBoot, FALSE);
++  if (EFI_ERROR (Status)) {
++    return Status;
++  }
++
++  Status = GetExact (EFI_SECURE_BOOT_ENABLE_NAME,
++             &gEfiSecureBootEnableDisableGuid, &Settings->SecureBootEnable,
++             sizeof Settings->SecureBootEnable, TRUE);
++  if (EFI_ERROR (Status)) {
++    return Status;
++  }
++
++  Status = GetExact (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid,
++             &Settings->CustomMode, sizeof Settings->CustomMode, FALSE);
++  if (EFI_ERROR (Status)) {
++    return Status;
++  }
++
++  Status = GetExact (EFI_VENDOR_KEYS_VARIABLE_NAME, &gEfiGlobalVariableGuid,
++             &Settings->VendorKeys, sizeof Settings->VendorKeys, FALSE);
++  return Status;
++}
++
++STATIC
++VOID
++EFIAPI
++PrintSettings (
++  IN CONST SETTINGS *Settings
++  )
++{
++  AsciiPrint ("info: SetupMode=%d SecureBoot=%d SecureBootEnable=%d "
++    "CustomMode=%d VendorKeys=%d\n", Settings->SetupMode, Settings->SecureBoot,
++    Settings->SecureBootEnable, Settings->CustomMode, Settings->VendorKeys);
++}
++
++
++INTN
++EFIAPI
++ShellAppMain (
++  IN UINTN  Argc,
++  IN CHAR16 **Argv
++  )
++{
++  EFI_STATUS Status;
++  SETTINGS   Settings;
++
++  Status = GetSettings (&Settings);
++  if (EFI_ERROR (Status)) {
++    return 1;
++  }
++  PrintSettings (&Settings);
++
++  if (Settings.SetupMode != 1) {
++    AsciiPrint ("error: already in User Mode\n");
++    return 1;
++  }
++
++  if (Settings.CustomMode != CUSTOM_SECURE_BOOT_MODE) {
++    Settings.CustomMode = CUSTOM_SECURE_BOOT_MODE;
++    Status = gRT->SetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid,
++                    (EFI_VARIABLE_NON_VOLATILE |
++                     EFI_VARIABLE_BOOTSERVICE_ACCESS),
++                    sizeof Settings.CustomMode, &Settings.CustomMode);
++    if (EFI_ERROR (Status)) {
++      AsciiPrint ("error: SetVariable(\"%s\", %g): %r\n", EFI_CUSTOM_MODE_NAME,
++        &gEfiCustomModeEnableGuid, Status);
++      return 1;
++    }
++  }
++
++  Status = EnrollListOfX509Certs (
++             EFI_IMAGE_SECURITY_DATABASE,
++             &gEfiImageSecurityDatabaseGuid,
++             MicrosoftPCA,    sizeof MicrosoftPCA,    &gEfiCallerIdGuid,
++             MicrosoftUefiCA, sizeof MicrosoftUefiCA, &gEfiCallerIdGuid,
++             NULL);
++  if (EFI_ERROR (Status)) {
++    return 1;
++  }
++
++  Status = EnrollListOfX509Certs (
++             EFI_KEY_EXCHANGE_KEY_NAME,
++             &gEfiGlobalVariableGuid,
++             ExampleCert,  sizeof ExampleCert,  &gEfiCallerIdGuid,
++             MicrosoftKEK, sizeof MicrosoftKEK, &gEfiCallerIdGuid,
++             NULL);
++  if (EFI_ERROR (Status)) {
++    return 1;
++  }
++
++  Status = EnrollListOfX509Certs (
++             EFI_PLATFORM_KEY_NAME,
++             &gEfiGlobalVariableGuid,
++             ExampleCert, sizeof ExampleCert, &gEfiGlobalVariableGuid,
++             NULL);
++  if (EFI_ERROR (Status)) {
++    return 1;
++  }
++
++  Settings.CustomMode = STANDARD_SECURE_BOOT_MODE;
++  Status = gRT->SetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid,
++                  EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
++                  sizeof Settings.CustomMode, &Settings.CustomMode);
++  if (EFI_ERROR (Status)) {
++    AsciiPrint ("error: SetVariable(\"%s\", %g): %r\n", EFI_CUSTOM_MODE_NAME,
++      &gEfiCustomModeEnableGuid, Status);
++    return 1;
++  }
++
++  Status = GetSettings (&Settings);
++  if (EFI_ERROR (Status)) {
++    return 1;
++  }
++  PrintSettings (&Settings);
++
++  if (Settings.SetupMode != 0 || Settings.SecureBoot != 1 ||
++      Settings.SecureBootEnable != 1 || Settings.CustomMode != 0 ||
++      Settings.VendorKeys != 0) {
++    AsciiPrint ("error: unexpected\n");
++    return 1;
++  }
++
++  AsciiPrint ("info: success\n");
++  return 0;
++}
+diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
+new file mode 100644
+index 0000000..ac919bb
+--- /dev/null
++++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
+@@ -0,0 +1,51 @@
++## @file
++#  Enroll default PK, KEK, DB.
++#
++#  Copyright (C) 2014, Red Hat, Inc.
++#
++#  This program and the accompanying materials are licensed and made available
++#  under the terms and conditions of the BSD License which accompanies this
++#  distribution. The full text of the license may be found at
++#  http://opensource.org/licenses/bsd-license.
++#
++#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
++#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
++#  IMPLIED.
++##
++
++[Defines]
++  INF_VERSION                    = 0x00010006
++  BASE_NAME                      = EnrollDefaultKeys
++  FILE_GUID                      = D5C1DF0B-1BAC-4EDF-BA48-08834009CA5A
++  MODULE_TYPE                    = UEFI_APPLICATION
++  VERSION_STRING                 = 0.1
++  ENTRY_POINT                    = ShellCEntryLib
++
++#
++#  VALID_ARCHITECTURES           = IA32 X64
++#
++
++[Sources]
++  EnrollDefaultKeys.c
++
++[Packages]
++  MdePkg/MdePkg.dec
++  MdeModulePkg/MdeModulePkg.dec
++  SecurityPkg/SecurityPkg.dec
++  ShellPkg/ShellPkg.dec
++
++[Guids]
++  gEfiCertPkcs7Guid
++  gEfiCertX509Guid
++  gEfiCustomModeEnableGuid
++  gEfiGlobalVariableGuid
++  gEfiImageSecurityDatabaseGuid
++  gEfiSecureBootEnableDisableGuid
++
++[LibraryClasses]
++  BaseMemoryLib
++  DebugLib
++  MemoryAllocationLib
++  ShellCEntryLib
++  UefiLib
++  UefiRuntimeServicesTableLib
+diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
+index fa9661c..e2e6ba3 100644
+--- a/OvmfPkg/OvmfPkgIa32.dsc
++++ b/OvmfPkg/OvmfPkgIa32.dsc
+@@ -764,6 +764,10 @@
+ 

+ !if $(SECURE_BOOT_ENABLE) == TRUE

+   SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf

++  OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf {
++    <LibraryClasses>
++      ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
++  }
+ !endif

+ 

+   OvmfPkg/PlatformDxe/Platform.inf

+diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
+index 667584a..a0ae1aa 100644
+--- a/OvmfPkg/OvmfPkgIa32X64.dsc
++++ b/OvmfPkg/OvmfPkgIa32X64.dsc
+@@ -773,6 +773,10 @@
+ 

+ !if $(SECURE_BOOT_ENABLE) == TRUE

+   SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf

++  OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf {
++    <LibraryClasses>
++      ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
++  }
+ !endif

+ 

+   OvmfPkg/PlatformDxe/Platform.inf

+diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
+index 5ae8469..87cee52 100644
+--- a/OvmfPkg/OvmfPkgX64.dsc
++++ b/OvmfPkg/OvmfPkgX64.dsc
+@@ -771,6 +771,10 @@
+ 

+ !if $(SECURE_BOOT_ENABLE) == TRUE

+   SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf

++  OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf {
++    <LibraryClasses>
++      ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
++  }
+ !endif

+ 

+   OvmfPkg/PlatformDxe/Platform.inf

diff --git a/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch
new file mode 100644
index 0000000..bb12d8b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch
@@ -0,0 +1,33 @@
+From c7722d10c7bcf6be0adcf54abb1d406599dd7914 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Fri, 24 Feb 2017 01:40:02 +0100
+Subject: [PATCH] VfrCompile: increase path length limit
+
+The VfrCompile tool has a hard-coded maximum length for path names
+which turned out to be too small by around 20 characters in the Yocto
+autobuilder setup. Increasing the maximum by a factor of 4 is
+relatively easy and makes the problem less likely.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ BaseTools/Source/C/VfrCompile/EfiVfr.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/BaseTools/Source/C/VfrCompile/EfiVfr.h b/BaseTools/Source/C/VfrCompile/EfiVfr.h
+index d187902..9ad4a7b 100644
+--- a/BaseTools/Source/C/VfrCompile/EfiVfr.h
++++ b/BaseTools/Source/C/VfrCompile/EfiVfr.h
+@@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ #include "Common/UefiInternalFormRepresentation.h"

+ #include "Common/MdeModuleHii.h"

+ 

+-#define MAX_PATH                 255

++#define MAX_PATH                 1023

+ #define MAX_VFR_LINE_LEN         4096

+ 

+ #define EFI_IFR_MAX_LENGTH       0xFF

+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks
new file mode 100644
index 0000000..1d2f16b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks
@@ -0,0 +1,4 @@
+# short-description: Create an EFI disk image with just the EFI system partition
+
+part / --source rootfs --ondisk sda --fstype=vfat --align 1024
+bootloader --ptable gpt --timeout=5
diff --git a/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf_git.bb b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf_git.bb
new file mode 100644
index 0000000..9d988e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ovmf/ovmf_git.bb
@@ -0,0 +1,243 @@
+DESCRIPTION = "OVMF - UEFI firmware for Qemu and KVM"
+HOMEPAGE = "http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=OVMF"
+LICENSE = "BSD"
+LICENSE_class-target = "${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'BSD & OpenSSL', 'BSD', d)}"
+LIC_FILES_CHKSUM = "file://OvmfPkg/License.txt;md5=343dc88e82ff33d042074f62050c3496"
+
+# Enabling Secure Boot adds a dependency on OpenSSL and implies
+# compiling OVMF twice, so it is disabled by default. Distros
+# may change that default.
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[secureboot] = ",,,"
+
+SRC_URI = "git://github.com/tianocore/edk2.git;branch=master \
+	file://0002-ovmf-update-path-to-native-BaseTools.patch \
+	file://0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \
+	file://VfrCompile-increase-path-length-limit.patch \
+        file://0001-MdeModulePkg-UefiHiiLib-Fix-incorrect-comparison-exp.patch \
+        "
+
+SRC_URI_append_class-target = " \
+	${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'http://www.openssl.org/source/openssl-1.0.2j.tar.gz;name=openssl;subdir=${S}/CryptoPkg/Library/OpensslLib', '', d)} \
+	file://0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch \
+"
+
+SRCREV="4575a602ca6072ee9d04150b38bfb143cbff8588"
+SRC_URI[openssl.md5sum] = "96322138f0b69e61b7212bc53d5e912b"
+SRC_URI[openssl.sha256sum] = "e7aff292be21c259c6af26469c7a9b3ba26e9abaaffd325e3dccc9785256c431"
+
+inherit deploy
+
+PARALLEL_MAKE_class-native = ""
+
+S = "${WORKDIR}/git"
+
+DEPENDS_class-native="util-linux-native iasl-native ossp-uuid-native qemu-native"
+
+DEPENDS_class-target="ovmf-native"
+
+DEPENDS_append = " nasm-native"
+
+EDK_TOOLS_DIR="edk2_basetools"
+
+# OVMF has trouble building with the default optimization of -O2.
+BUILD_OPTIMIZATION="-pipe"
+
+# OVMF supports IA only, although it could conceivably support ARM someday.
+COMPATIBLE_HOST='(i.86|x86_64).*'
+
+# Additional build flags for OVMF with Secure Boot.
+# Fedora also uses "-D SMM_REQUIRE -D EXCLUDE_SHELL_FROM_FD".
+OVMF_SECURE_BOOT_EXTRA_FLAGS ??= ""
+OVMF_SECURE_BOOT_FLAGS = "-DSECURE_BOOT_ENABLE=TRUE ${OVMF_SECURE_BOOT_EXTRA_FLAGS}"
+
+do_patch[postfuncs] += "fix_basetools_location"
+fix_basetools_location () {
+}
+fix_basetools_location_class-target() {
+    # Replaces the fake path inserted by 0002-ovmf-update-path-to-native-BaseTools.patch.
+    # Necessary for finding the actual BaseTools from ovmf-native.
+    sed -i -e 's#BBAKE_EDK_TOOLS_PATH#${STAGING_BINDIR_NATIVE}/${EDK_TOOLS_DIR}#' ${S}/OvmfPkg/build.sh
+}
+
+do_patch[postfuncs] += "fix_iasl"
+fix_iasl() {
+}
+fix_iasl_class-native() {
+    # iasl is not installed under /usr/bin when building with OE.
+    sed -i -e 's#/usr/bin/iasl#${STAGING_BINDIR_NATIVE}/iasl#' ${S}/BaseTools/Conf/tools_def.template
+}
+
+# Inject CC and friends into the build. LINKER already is in GNUmakefile.
+# Must be idempotent and thus remove old assignments that were inserted
+# earlier.
+do_patch[postfuncs] += "fix_toolchain"
+fix_toolchain() {
+    sed -i \
+        -e '/^\(CC\|CXX\|AS\|AR\|LD\|LINKER\) =/d' \
+        -e '/^APPLICATION/a CC = ${CC}\nCXX = ${CXX}\nAS = ${AS}\nAR = ${AR}\nLD = ${LD}\nLINKER = $(CC)' \
+        ${S}/BaseTools/Source/C/Makefiles/app.makefile
+    sed -i \
+        -e '/^\(CC\|CXX\|AS\|AR\|LD\)/d' \
+        -e '/^VFR_CPPFLAGS/a CC = ${CC}\nCXX = ${CXX}\nAS = ${AS}\nAR = ${AR}\nLD = ${LD}' \
+        ${S}/BaseTools/Source/C/VfrCompile/GNUmakefile
+}
+fix_toolchain_append_class-native() {
+    # This tools_def.template is going to be used by the target ovmf and
+    # defines which compilers to use. For the GCC toolchain definitions,
+    # that will be ${HOST_PREFIX}gcc. However, "make" doesn't need that
+    # prefix.
+    #
+    # Injecting ENV(HOST_PREFIX) matches exporting that value as env
+    # variable in do_compile_class-target.
+    sed -i \
+        -e 's#\(ENV\|DEF\)(GCC.*_PREFIX)#ENV(HOST_PREFIX)#' \
+        -e 's#ENV(HOST_PREFIX)make#make#' \
+        ${S}/BaseTools/Conf/tools_def.template
+    sed -i \
+        -e '/^\(LFLAGS\|CFLAGS\) +=/d' \
+        -e '/^LINKER/a LFLAGS += ${BUILD_LDFLAGS}\nCFLAGS += ${BUILD_CFLAGS}' \
+        ${S}/BaseTools/Source/C/Makefiles/app.makefile \
+        ${S}/BaseTools/Source/C/VfrCompile/GNUmakefile
+    # Linking with gold fails:
+    # internal error in do_layout, at ../../gold/object.cc:1821
+    # make: *** [.../OUTPUT/Facs.acpi] Error 1
+    # We intentionally hard-code the use of ld.bfd regardless of DISTRO_FEATURES
+    # to make ovmf-native reusable across distros.
+    sed -i \
+        -e 's#^\(DEFINE GCC.*DLINK.*FLAGS  *=\)#\1 -fuse-ld=bfd#' \
+        ${S}/BaseTools/Conf/tools_def.template
+}
+
+GCC_VER="$(${CC} -v 2>&1 | tail -n1 | awk '{print $3}')"
+
+fixup_target_tools() {
+    case ${1} in
+      4.4.*)
+        FIXED_GCCVER=GCC44
+        ;;
+      4.5.*)
+        FIXED_GCCVER=GCC45
+        ;;
+      4.6.*)
+        FIXED_GCCVER=GCC46
+        ;;
+      4.7.*)
+        FIXED_GCCVER=GCC47
+        ;;
+      4.8.*)
+        FIXED_GCCVER=GCC48
+        ;;
+      4.9.*)
+        FIXED_GCCVER=GCC49
+        ;;
+      *)
+        FIXED_GCCVER=GCC5
+        ;;
+    esac
+    echo ${FIXED_GCCVER}
+}
+
+do_compile_class-native() {
+    oe_runmake -C ${S}/BaseTools
+}
+
+do_compile_class-target() {
+    export LFLAGS="${LDFLAGS}"
+    PARALLEL_JOBS="${@ '${PARALLEL_MAKE}'.replace('-j', '-n')}"
+    OVMF_ARCH="X64"
+    if [ "${TARGET_ARCH}" != "x86_64" ] ; then
+        OVMF_ARCH="IA32"
+    fi
+
+    # The build for the target uses BaseTools/Conf/tools_def.template
+    # from ovmf-native to find the compiler, which depends on
+    # exporting HOST_PREFIX.
+    export HOST_PREFIX="${HOST_PREFIX}"
+
+    # BaseTools/Conf gets copied to Conf, but only if that does not
+    # exist yet. To ensure that an updated template gets used during
+    # incremental builds, we need to remove the copy before we start.
+    rm -f `ls ${S}/Conf/*.txt | grep -v ReadMe.txt`
+
+    # ${WORKDIR}/ovmf is a well-known location where do_install and
+    # do_deploy will be able to find the files.
+    rm -rf ${WORKDIR}/ovmf
+    mkdir ${WORKDIR}/ovmf
+    OVMF_DIR_SUFFIX="X64"
+    if [ "${TARGET_ARCH}" != "x86_64" ] ; then
+        OVMF_DIR_SUFFIX="Ia32" # Note the different capitalization
+    fi
+    FIXED_GCCVER=$(fixup_target_tools ${GCC_VER})
+    bbnote FIXED_GCCVER is ${FIXED_GCCVER}
+    build_dir="${S}/Build/Ovmf$OVMF_DIR_SUFFIX/RELEASE_${FIXED_GCCVER}"
+
+    bbnote "Building without Secure Boot."
+    rm -rf ${S}/Build/Ovmf$OVMF_DIR_SUFFIX
+    ${S}/OvmfPkg/build.sh $PARALLEL_JOBS -a $OVMF_ARCH -b RELEASE -t ${FIXED_GCCVER}
+    ln ${build_dir}/FV/OVMF.fd ${WORKDIR}/ovmf/ovmf.fd
+    ln ${build_dir}/FV/OVMF_CODE.fd ${WORKDIR}/ovmf/ovmf.code.fd
+    ln ${build_dir}/FV/OVMF_VARS.fd ${WORKDIR}/ovmf/ovmf.vars.fd
+    ln ${build_dir}/${OVMF_ARCH}/Shell.efi ${WORKDIR}/ovmf/
+
+    if ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'true', 'false', d)}; then
+        # See CryptoPkg/Library/OpensslLib/Patch-HOWTO.txt and
+        # https://src.fedoraproject.org/cgit/rpms/edk2.git/tree/ for
+        # building with Secure Boot enabled.
+        bbnote "Building with Secure Boot."
+        rm -rf ${S}/Build/Ovmf$OVMF_DIR_SUFFIX
+        if ! [ -f ${S}/CryptoPkg/Library/OpensslLib/openssl-*/edk2-patch-applied ]; then
+            ( cd ${S}/CryptoPkg/Library/OpensslLib/openssl-* && patch -p1 <$(echo ../EDKII_openssl-*.patch) && touch edk2-patch-applied )
+        fi
+        ( cd ${S}/CryptoPkg/Library/OpensslLib/ && ./Install.sh )
+        ${S}/OvmfPkg/build.sh $PARALLEL_JOBS -a $OVMF_ARCH -b RELEASE -t ${FIXED_GCCVER} ${OVMF_SECURE_BOOT_FLAGS}
+        ln ${build_dir}/FV/OVMF.fd ${WORKDIR}/ovmf/ovmf.secboot.fd
+        ln ${build_dir}/FV/OVMF_CODE.fd ${WORKDIR}/ovmf/ovmf.secboot.code.fd
+        ln ${build_dir}/${OVMF_ARCH}/EnrollDefaultKeys.efi ${WORKDIR}/ovmf/
+    fi
+}
+
+do_install_class-native() {
+    install -d ${D}/${bindir}/edk2_basetools
+    cp -r ${S}/BaseTools ${D}/${bindir}/${EDK_TOOLS_DIR}
+}
+
+do_install_class-target() {
+    # Content for UEFI shell iso. We install the EFI shell as
+    # bootx64/ia32.efi because then it can be started even when the
+    # firmware itself does not contain it.
+    install -d ${D}/efi/boot
+    install ${WORKDIR}/ovmf/Shell.efi ${D}/efi/boot/boot${@ "ia32" if "${TARGET_ARCH}" != "x86_64" else "x64"}.efi
+    if ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'true', 'false', d)}; then
+        install ${WORKDIR}/ovmf/EnrollDefaultKeys.efi ${D}
+    fi
+}
+
+# This always gets packaged because ovmf-shell-image depends on it.
+# This allows testing that recipe in all configurations because it
+# can always be part of a world build.
+#
+# However, EnrollDefaultKeys.efi is only included when Secure Boot is enabled.
+PACKAGES =+ "ovmf-shell-efi"
+FILES_ovmf-shell-efi = " \
+    EnrollDefaultKeys.efi \
+    efi/ \
+"
+
+do_deploy() {
+}
+do_deploy[cleandirs] = "${DEPLOYDIR}"
+do_deploy_class-target() {
+    # For use with "runqemu ovmf".
+    for i in \
+        ovmf \
+        ovmf.code \
+        ovmf.vars \
+        ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'ovmf.secboot ovmf.secboot.code', '', d)} \
+        ; do
+        qemu-img convert -f raw -O qcow2 ${WORKDIR}/ovmf/$i.fd ${DEPLOYDIR}/$i.qcow2
+    done
+}
+addtask do_deploy after do_compile before do_build
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
index 2c2abed..2ca6392 100644
--- a/import-layers/yocto-poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -22,7 +22,8 @@
     nativesdk-automake \
     nativesdk-shadow \
     nativesdk-makedevs \
-    nativesdk-smartpm \
+    nativesdk-dnf \
+    nativesdk-cmake \
     nativesdk-postinst-intercept \
     ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'nativesdk-wayland', '', d)} \
     "
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-base.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-base.bb
index 2e94fde..0069e3e 100644
--- a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-base.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-base.bb
@@ -110,8 +110,8 @@
     # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them)
     # then include packagegroup-base-wifi in packagegroup-base
 
-    distro_features = set(d.getVar("DISTRO_FEATURES", True).split())
-    machine_features= set(d.getVar("MACHINE_FEATURES", True).split())
+    distro_features = set(d.getVar("DISTRO_FEATURES").split())
+    machine_features= set(d.getVar("MACHINE_FEATURES").split())
 
     if "bluetooth" in distro_features and not "bluetooth" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
         d.setVar("ADD_BT", "packagegroup-base-bluetooth")
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
index aceba78..7d6d414 100644
--- a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
@@ -28,10 +28,7 @@
 
 SANITIZERS = "libasan-dev libubsan-dev"
 SANITIZERS_aarch64 = ""
-SANITIZERS_mips = ""
-SANITIZERS_mipsel = ""
-SANITIZERS_mips64 = ""
-SANITIZERS_mips64n32 = ""
+SANITIZERS_mipsarch = ""
 SANITIZERS_nios2 = ""
 SANITIZERS_powerpc64 = ""
 SANITIZERS_sparc = ""
@@ -45,7 +42,7 @@
 
 #python generate_sdk_pkgs () {
 #    poky_pkgs = read_pkgdata('packagegroup-core', d)['PACKAGES']
-#    pkgs = d.getVar('PACKAGES', True).split()
+#    pkgs = d.getVar('PACKAGES').split()
 #    for pkg in poky_pkgs.split():
 #        newpkg = pkg.replace('packagegroup-core', 'packagegroup-core-sdk')
 #
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
index dd98445..946c947 100644
--- a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
@@ -36,10 +36,7 @@
 SYSTEMTAP = "systemtap"
 SYSTEMTAP_libc-uclibc = ""
 SYSTEMTAP_libc-musl = ""
-SYSTEMTAP_mips = ""
-SYSTEMTAP_mipsel = ""
-SYSTEMTAP_mips64 = ""
-SYSTEMTAP_mips64n32 = ""
+SYSTEMTAP_mipsarch = ""
 SYSTEMTAP_nios2 = ""
 SYSTEMTAP_aarch64 = ""
 
@@ -65,15 +62,13 @@
 VALGRIND = "valgrind"
 VALGRIND_libc-uclibc = ""
 VALGRIND_libc-musl = ""
-VALGRIND_mips = ""
-VALGRIND_mipsel = ""
-VALGRIND_mips64 = ""
-VALGRIND_mips64n32 = ""
+VALGRIND_mipsarch = ""
 VALGRIND_nios2 = ""
 VALGRIND_armv4 = ""
 VALGRIND_armv5 = ""
 VALGRIND_armv6 = ""
 VALGRIND_aarch64 = ""
+VALGRIND_linux-gnux32 = ""
 
 RDEPENDS_${PN} = "\
     ${PROFILETOOLS} \
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
index 73430b8..c1bbdfc 100644
--- a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
@@ -10,6 +10,9 @@
 # rdepends on libx11-dev
 REQUIRED_DISTRO_FEATURES = "x11"
 
+# rdepends on libgl
+REQUIRED_DISTRO_FEATURES += "opengl"
+
 PACKAGES = "\
     packagegroup-self-hosted \
     packagegroup-self-hosted-debug \
diff --git a/import-layers/yocto-poky/meta/recipes-core/psplash/psplash_git.bb b/import-layers/yocto-poky/meta/recipes-core/psplash/psplash_git.bb
index 0537426..44297e1 100644
--- a/import-layers/yocto-poky/meta/recipes-core/psplash/psplash_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/psplash/psplash_git.bb
@@ -16,8 +16,8 @@
 SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default"
 
 python __anonymous() {
-    oldpkgs = d.getVar("PACKAGES", True).split()
-    splashfiles = d.getVar('SPLASH_IMAGES', True).split()
+    oldpkgs = d.getVar("PACKAGES").split()
+    splashfiles = d.getVar('SPLASH_IMAGES').split()
     pkgs = []
     localpaths = []
     haspng = False
@@ -50,8 +50,8 @@
         d.appendVar("DEPENDS", " gdk-pixbuf-native")
 
     d.prependVar("PACKAGES", "%s " % (" ".join(pkgs)))
-    mlprefix = d.getVar('MLPREFIX', True) or ''
-    pn = d.getVar('PN', True) or ''
+    mlprefix = d.getVar('MLPREFIX') or ''
+    pn = d.getVar('PN') or ''
     for p in pkgs:
         ep = '%s%s' % (mlprefix, p)
         epsplash = '%s%s' % (mlprefix, 'psplash')
@@ -74,11 +74,11 @@
     import shutil
 
     # Build a separate executable for each splash image
-    workdir = d.getVar('WORKDIR', True)
-    convertscript = "%s/make-image-header.sh" % d.getVar('S', True)
-    destfile = "%s/psplash-poky-img.h" % d.getVar('S', True)
-    localfiles = d.getVar('SPLASH_LOCALPATHS', True).split()
-    outputfiles = d.getVar('SPLASH_INSTALL', True).split()
+    workdir = d.getVar('WORKDIR')
+    convertscript = "%s/make-image-header.sh" % d.getVar('S')
+    destfile = "%s/psplash-poky-img.h" % d.getVar('S')
+    localfiles = d.getVar('SPLASH_LOCALPATHS').split()
+    outputfiles = d.getVar('SPLASH_INSTALL').split()
     for localfile, outputfile in zip(localfiles, outputfiles):
         if localfile.endswith(".png"):
             outp = oe.utils.getstatusoutput('%s %s POKY' % (convertscript, os.path.join(workdir, localfile)))
@@ -89,7 +89,7 @@
             shutil.copyfile(os.path.join(workdir, localfile), destfile)
         # For some reason just updating the header is not enough, we have to touch the .c
         # file in order to get it to rebuild
-        os.utime("%s/psplash.c" % d.getVar('S', True), None)
+        os.utime("%s/psplash.c" % d.getVar('S'), None)
         bb.build.exec_func("oe_runmake", d)
         shutil.copyfile("psplash", outputfile)
 }
@@ -110,7 +110,7 @@
 INITSCRIPT_NAME = "psplash.sh"
 INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ."
 
-DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
 pkg_postinst_${PN} () {
 	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
 		if [ -n "$D" ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/files/config-dirent-symbols.patch b/import-layers/yocto-poky/meta/recipes-core/readline/files/config-dirent-symbols.patch
deleted file mode 100644
index cfff03c..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/readline/files/config-dirent-symbols.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Fix the names of the STRUCT_DIRENT_D symbols to match the names used by both
-configure and the source code.
-
-Upstream-Status: Submitted (http://lists.gnu.org/archive/html/bug-readline/2014-05/msg00008.html)
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-From e48656811550774892fd4e0f4b3c7d418422da52 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Tue, 27 May 2014 22:32:31 +0100
-Subject: [PATCH] config.h.in: fix names of STRUCT_DIRENT_D symbols
-
----
- config.h.in |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/config.h.in b/config.h.in
-index a67e43e..a42acc5 100644
---- a/config.h.in
-+++ b/config.h.in
-@@ -244,9 +244,9 @@
- 
- #undef HAVE_GETPW_DECLS
- 
--#undef STRUCT_DIRENT_HAS_D_INO
-+#undef HAVE_STRUCT_DIRENT_D_INO
- 
--#undef STRUCT_DIRENT_HAS_D_FILENO
-+#undef HAVE_STRUCT_DIRENT_D_FILENO
- 
- #undef HAVE_BSD_SIGNALS
- 
--- 
-1.7.10.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/configure-fix.patch b/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/configure-fix.patch
deleted file mode 100644
index be60a98..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/configure-fix.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Upstream-Status: Pending
-
-Without this it fails to link against libtermcap causing various missing symbols 
-issues.
-
-RP - 8/10/08
-
-Index: readline-5.2/configure.in
-===================================================================
---- readline-5.2.orig/configure.in	2008-10-08 09:58:52.000000000 +0100
-+++ readline-5.2/configure.in	2008-10-08 09:59:03.000000000 +0100
-@@ -211,10 +211,10 @@
-         AC_MSG_CHECKING(configuration for building shared libraries)
-         eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
- 
--#	case "$SHLIB_LIBS" in
--#	*curses*|*termcap*|*termlib*)	;;
--#	*)			SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
--#	esac
-+	case "$SHLIB_LIBS" in
-+	*curses*|*termcap*|*termlib*)	;;
-+	*)			SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
-+	esac
- 	
-         AC_SUBST(SHOBJ_CC)
-         AC_SUBST(SHOBJ_CFLAGS)
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch b/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch
deleted file mode 100644
index 3166b47..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-This support script ends up hardcoding unnecessary rpaths into the libraries. We
-will search $libdir automatically so this is just wastes space. There may be some
-cases this is necessary but our use cases aren't one of them.
-
-Upstream-Status: Inappropriate
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-Index: readline-5.2/support/shobj-conf
-===================================================================
---- readline-5.2.orig/support/shobj-conf
-+++ readline-5.2/support/shobj-conf
-@@ -110,7 +110,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*)
- 	SHOBJ_LD='${CC}'
- 	SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
- 
--	SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
-+	SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
- 	SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
- 	;;
- 
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/configure-fix.patch b/import-layers/yocto-poky/meta/recipes-core/readline/readline-7.0/configure-fix.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/configure-fix.patch
rename to import-layers/yocto-poky/meta/recipes-core/readline/readline-7.0/configure-fix.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/norpath.patch b/import-layers/yocto-poky/meta/recipes-core/readline/readline-7.0/norpath.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/norpath.patch
rename to import-layers/yocto-poky/meta/recipes-core/readline/readline-7.0/norpath.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/readline_5.2.bb b/import-layers/yocto-poky/meta/recipes-core/readline/readline_5.2.bb
deleted file mode 100644
index c1007a2..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/readline/readline_5.2.bb
+++ /dev/null
@@ -1,84 +0,0 @@
-SUMMARY = "Library for editing typed command lines"
-DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
-command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes  \
-additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those   \
-lines, and perform csh-like history expansion on previous commands."
-SECTION = "libs"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=03b36fdd84f74b8d8189a202b980b67f"
-
-DEPENDS += "ncurses"
-
-PR = "r9"
-
-SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-001;name=patch1;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-002;name=patch2;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-003;name=patch3;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-004;name=patch4;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-005;name=patch5;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-006;name=patch6;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-007;name=patch7;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-008;name=patch8;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-009;name=patch9;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-010;name=patch10;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-011;name=patch11;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-012;name=patch12;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-013;name=patch13;apply=yes;striplevel=0 \
-           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-014;name=patch14;apply=yes;striplevel=0 \
-           file://configure-fix.patch \
-           file://config-dirent-symbols.patch \
-           file://fix-redundant-rpath.patch"
-
-SRC_URI[archive.md5sum] = "e39331f32ad14009b9ff49cc10c5e751"
-SRC_URI[archive.sha256sum] = "12e88d96aee2cd1192500356f0535540db499282ca7f76339fb4228c31249f45"
-
-SRC_URI[patch1.md5sum]    = "9d4d41622aa9b230c57f68548ce87d8f"
-SRC_URI[patch1.sha256sum] = "eac304c369154059f93049ada328739faaf40338d3cb1fb4b544c93d5ce3f8d5"
-SRC_URI[patch2.md5sum]    = "f03e512d14206e37f7d6a748b56b9476"
-SRC_URI[patch2.sha256sum] = "9deacaef25507a0c2ae0b661bf9342559b59a2954d66ea3c5f5bcd900fdfcf78"
-SRC_URI[patch3.md5sum]    = "252b42d8750f1a94b6bdf086612dceb2"
-SRC_URI[patch3.sha256sum] = "2a55d2ecb1c9b0147aeb193a6323616ab31c1c525a83b2db3a994b15594ba934"
-SRC_URI[patch4.md5sum]    = "a32333c2e603a3ed250514e91050e552"
-SRC_URI[patch4.sha256sum] = "a03b65633781efa7c3aae5d57162985e7b7a3c10acf0f2621be610e16f27e5f2"
-SRC_URI[patch5.md5sum]    = "8106796c09b789523a3a78ab69c04b6d"
-SRC_URI[patch5.sha256sum] = "06001896514148a757ea6edbbd40c4fc4331dc653847244386c37b138b150f64"
-SRC_URI[patch6.md5sum]    = "512188e2bf0837f7eca19dbf71f182ae"
-SRC_URI[patch6.sha256sum] = "dfef3e982c0adf8bb5a9b7d0468ec8f5f18138b325e28759437464de5be71013"
-SRC_URI[patch7.md5sum]    = "ac17aca62eb6fb398c9f2fe9de540aff"
-SRC_URI[patch7.sha256sum] = "775b028c7b761397ac6ae1bdfbac7e896dc3b9b3adc2f91312499180ca13bdd1"
-SRC_URI[patch8.md5sum]    = "2484c392db021905f112cf97a94dfd4c"
-SRC_URI[patch8.sha256sum] = "a21b4e0bf0530b878bad24d5be23d18a9e03a75a31ae30844dc0933bb3d77ecd"
-SRC_URI[patch9.md5sum]    = "fc6eb35d07914fae5c57d49c12483ff7"
-SRC_URI[patch9.sha256sum] = "138d5e0f0709a47a2d1621295a3dd5e3cc73b63b5cc28dab03abc4e94fe95ecf"
-SRC_URI[patch10.md5sum]    = "7a2bf3dc7ac7680b1461a5701100e91b"
-SRC_URI[patch10.sha256sum] = "83f8c1aadb86b1a2fad8821a9c6be72a8de5afd7fd9fde58a30b3b57d939693e"
-SRC_URI[patch11.md5sum]    = "ef6cef6822663470f6ac8c517c5a7ec6"
-SRC_URI[patch11.sha256sum] = "08ad3384ab0906e6fa4cc417eb8c43ff59375bcead15fd5c8e31730f0413b3d6"
-SRC_URI[patch12.md5sum]    = "e3e9f441c8111589855bc363e5640f6c"
-SRC_URI[patch12.sha256sum] = "20f0243be2299c23213492cc2c19cfd15cc528d2b566a76a2de58306bb9e4c9e"
-SRC_URI[patch13.md5sum]    = "3e2e5f543ed268a68fd1fa839faade1a"
-SRC_URI[patch13.sha256sum] = "0cc649516a5bdfa61c5e56937407570288b6972d75aa1bd060ad30ebe98144d5"
-SRC_URI[patch14.md5sum]    = "a1be30e1c6f1099bb5fcef00a2631fb8"
-SRC_URI[patch14.sha256sum] = "6f1a68320d01522ca1ea5a737124ecc8739f3dcbfea2dee21e3ccf839a21a817"
-
-inherit autotools
-
-EXTRA_AUTORECONF += "--exclude=autoheader"
-
-LEAD_SONAME = "libreadline.so"
-
-do_configure_prepend () {
-	if [ ! -e ${S}/acinclude.m4 ]; then
-		cat ${S}/aclocal.m4 > ${S}/acinclude.m4
-	fi
-}
-
-do_install_append () {
-	# Make install doesn't properly install these
-	oe_libinstall -so -C shlib libhistory ${D}${libdir}
-	oe_libinstall -so -C shlib libreadline ${D}${libdir}
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/readline_6.3.bb b/import-layers/yocto-poky/meta/recipes-core/readline/readline_6.3.bb
deleted file mode 100644
index 8ec7c4a..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/readline/readline_6.3.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-require readline.inc
-
-SRC_URI += "${GNU_MIRROR}/readline/readline-6.3-patches/readline63-001;name=patch1;apply=yes;striplevel=0 \
-            ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-002;name=patch2;apply=yes;striplevel=0 \
-            ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-003;name=patch3;apply=yes;striplevel=0 \
-            ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-004;name=patch4;apply=yes;striplevel=0 \
-            ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-005;name=patch5;apply=yes;striplevel=0 \
-            ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-006;name=patch6;apply=yes;striplevel=0 \
-            ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-007;name=patch7;apply=yes;striplevel=0 \
-            ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-008;name=patch8;apply=yes;striplevel=0 \
-            file://configure-fix.patch \
-            file://config-dirent-symbols.patch \
-            file://norpath.patch"
-
-SRC_URI[archive.md5sum] = "33c8fb279e981274f485fd91da77e94a"
-SRC_URI[archive.sha256sum] = "56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43"
-
-SRC_URI[patch1.md5sum]    = "4343f5ea9b0f42447f102fb61576b398"
-SRC_URI[patch1.sha256sum] = "1a79bbb6eaee750e0d6f7f3d059b30a45fc54e8e388a8e05e9c3ae598590146f"
-SRC_URI[patch2.md5sum]    = "700295212f7e2978577feaee584afddb"
-SRC_URI[patch2.sha256sum] = "39e304c7a526888f9e112e733848215736fb7b9d540729b9e31f3347b7a1e0a5"
-SRC_URI[patch3.md5sum]    = "af4963862f5156fbf9111c2c6fa86ed7"
-SRC_URI[patch3.sha256sum] = "ec41bdd8b00fd884e847708513df41d51b1243cecb680189e31b7173d01ca52f"
-SRC_URI[patch4.md5sum]    = "11f9def89803a5052db3ba72394ce14f"
-SRC_URI[patch4.sha256sum] = "4547b906fb2570866c21887807de5dee19838a60a1afb66385b272155e4355cc"
-SRC_URI[patch5.md5sum]    = "93721c31cd225393f80cb3aadb165544"
-SRC_URI[patch5.sha256sum] = "877788f9228d1a9907a4bcfe3d6dd0439c08d728949458b41208d9bf9060274b"
-SRC_URI[patch6.md5sum]    = "71dc6ecce66d1489b96595f55d142a52"
-SRC_URI[patch6.sha256sum] = "5c237ab3c6c97c23cf52b2a118adc265b7fb411b57c93a5f7c221d50fafbe556"
-SRC_URI[patch7.md5sum]    = "062a08ed60679d3c4878710b3d595b65"
-SRC_URI[patch7.sha256sum] = "4d79b5a2adec3c2e8114cbd3d63c1771f7c6cf64035368624903d257014f5bea"
-SRC_URI[patch8.md5sum]    = "ee1c04072154826870848d8b218d7b04"
-SRC_URI[patch8.sha256sum] = "3bc093cf526ceac23eb80256b0ec87fa1735540d659742107b6284d635c43787"
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/readline_7.0.bb b/import-layers/yocto-poky/meta/recipes-core/readline/readline_7.0.bb
new file mode 100644
index 0000000..85dfaa6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/readline/readline_7.0.bb
@@ -0,0 +1,7 @@
+require readline.inc
+
+SRC_URI += "file://configure-fix.patch \
+            file://norpath.patch"
+
+SRC_URI[archive.md5sum] = "205b03a87fc83dab653b628c59b9fc91"
+SRC_URI[archive.sha256sum] = "750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334"
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-compat-units.bb b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-compat-units.bb
index 421fc06..fe9a521 100644
--- a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-compat-units.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -1,11 +1,10 @@
 SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts"
 
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
 
 PR = "r29"
 
-DEPENDS = "systemd-systemctl-native"
+PACKAGE_WRITE_DEPS += "systemd-systemctl-native"
 
 S = "${WORKDIR}"
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-systemctl-native.bb b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-systemctl-native.bb
index fbdc9c0..fadc843 100644
--- a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-systemctl-native.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-systemctl-native.bb
@@ -1,7 +1,7 @@
 SUMMARY = "Wrapper for enabling systemd services"
 
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 PR = "r6"
 
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0001-core-load-fragment-refuse-units-with-errors-in-certa.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0001-core-load-fragment-refuse-units-with-errors-in-certa.patch
new file mode 100644
index 0000000..80948b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0001-core-load-fragment-refuse-units-with-errors-in-certa.patch
@@ -0,0 +1,329 @@
+If a user is created with a strictly-speaking invalid name such as '0day' and a
+unit created to run as that user, systemd rejects the username and runs the unit
+as root.
+
+CVE: CVE-2017-1000082
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From d8e1310e1ed7b6f122bc7eb8ba061fbd088783c0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Thu, 6 Jul 2017 13:28:19 -0400
+Subject: [PATCH] core/load-fragment: refuse units with errors in certain
+ directives
+
+If an error is encountered in any of the Exec* lines, WorkingDirectory,
+SELinuxContext, ApparmorProfile, SmackProcessLabel, Service (in .socket
+units), User, or Group, refuse to load the unit. If the config stanza
+has support, ignore the failure if '-' is present.
+
+For those configuration directives, even if we started the unit, it's
+pretty likely that it'll do something unexpected (like write files
+in a wrong place, or with a wrong context, or run with wrong permissions,
+etc). It seems better to refuse to start the unit and have the admin
+clean up the configuration without giving the service a chance to mess
+up stuff.
+
+Note that all "security" options that restrict what the unit can do
+(Capabilities, AmbientCapabilities, Restrict*, SystemCallFilter, Limit*,
+PrivateDevices, Protect*, etc) are _not_ treated like this. Such options are
+only supplementary, and are not always available depending on the architecture
+and compilation options, so unit authors have to make sure that the service
+runs correctly without them anyway.
+
+Fixes #6237, #6277.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ src/core/load-fragment.c  | 104 ++++++++++++++++++++++++++++------------------
+ src/test/test-unit-file.c |  14 +++----
+ 2 files changed, 70 insertions(+), 48 deletions(-)
+
+diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
+index cbc826809..2047974f4 100644
+--- a/src/core/load-fragment.c
++++ b/src/core/load-fragment.c
+@@ -630,20 +630,28 @@ int config_parse_exec(
+ 
+                 if (isempty(f)) {
+                         /* First word is either "-" or "@" with no command. */
+-                        log_syntax(unit, LOG_ERR, filename, line, 0, "Empty path in command line, ignoring: \"%s\"", rvalue);
+-                        return 0;
++                        log_syntax(unit, LOG_ERR, filename, line, 0,
++                                   "Empty path in command line%s: \"%s\"",
++                                   ignore ? ", ignoring" : "", rvalue);
++                        return ignore ? 0 : -ENOEXEC;
+                 }
+                 if (!string_is_safe(f)) {
+-                        log_syntax(unit, LOG_ERR, filename, line, 0, "Executable path contains special characters, ignoring: %s", rvalue);
+-                        return 0;
++                        log_syntax(unit, LOG_ERR, filename, line, 0,
++                                   "Executable path contains special characters%s: %s",
++                                   ignore ? ", ignoring" : "", rvalue);
++                        return ignore ? 0 : -ENOEXEC;
+                 }
+                 if (!path_is_absolute(f)) {
+-                        log_syntax(unit, LOG_ERR, filename, line, 0, "Executable path is not absolute, ignoring: %s", rvalue);
+-                        return 0;
++                        log_syntax(unit, LOG_ERR, filename, line, 0,
++                                   "Executable path is not absolute%s: %s",
++                                   ignore ? ", ignoring" : "", rvalue);
++                        return ignore ? 0 : -ENOEXEC;
+                 }
+                 if (endswith(f, "/")) {
+-                        log_syntax(unit, LOG_ERR, filename, line, 0, "Executable path specifies a directory, ignoring: %s", rvalue);
+-                        return 0;
++                        log_syntax(unit, LOG_ERR, filename, line, 0,
++                                   "Executable path specifies a directory%s: %s",
++                                   ignore ? ", ignoring" : "", rvalue);
++                        return ignore ? 0 : -ENOEXEC;
+                 }
+ 
+                 if (f == firstword) {
+@@ -699,7 +707,7 @@ int config_parse_exec(
+                         if (r == 0)
+                                 break;
+                         else if (r < 0)
+-                                return 0;
++                                return ignore ? 0 : -ENOEXEC;
+ 
+                         if (!GREEDY_REALLOC(n, nbufsize, nlen + 2))
+                                 return log_oom();
+@@ -709,8 +717,10 @@ int config_parse_exec(
+                 }
+ 
+                 if (!n || !n[0]) {
+-                        log_syntax(unit, LOG_ERR, filename, line, 0, "Empty executable name or zeroeth argument, ignoring: %s", rvalue);
+-                        return 0;
++                        log_syntax(unit, LOG_ERR, filename, line, 0,
++                                   "Empty executable name or zeroeth argument%s: %s",
++                                   ignore ? ", ignoring" : "", rvalue);
++                        return ignore ? 0 : -ENOEXEC;
+                 }
+ 
+                 nce = new0(ExecCommand, 1);
+@@ -1315,8 +1325,10 @@ int config_parse_exec_selinux_context(
+ 
+         r = unit_name_printf(u, rvalue, &k);
+         if (r < 0) {
+-                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %m");
+-                return 0;
++                log_syntax(unit, LOG_ERR, filename, line, r,
++                           "Failed to resolve specifiers%s: %m",
++                           ignore ? ", ignoring" : "");
++                return ignore ? 0 : -ENOEXEC;
+         }
+ 
+         free(c->selinux_context);
+@@ -1363,8 +1375,10 @@ int config_parse_exec_apparmor_profile(
+ 
+         r = unit_name_printf(u, rvalue, &k);
+         if (r < 0) {
+-                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %m");
+-                return 0;
++                log_syntax(unit, LOG_ERR, filename, line, r,
++                           "Failed to resolve specifiers%s: %m",
++                           ignore ? ", ignoring" : "");
++                return ignore ? 0 : -ENOEXEC;
+         }
+ 
+         free(c->apparmor_profile);
+@@ -1411,8 +1425,10 @@ int config_parse_exec_smack_process_label(
+ 
+         r = unit_name_printf(u, rvalue, &k);
+         if (r < 0) {
+-                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %m");
+-                return 0;
++                log_syntax(unit, LOG_ERR, filename, line, r,
++                           "Failed to resolve specifiers%s: %m",
++                           ignore ? ", ignoring" : "");
++                return ignore ? 0 : -ENOEXEC;
+         }
+ 
+         free(c->smack_process_label);
+@@ -1630,19 +1646,19 @@ int config_parse_socket_service(
+ 
+         r = unit_name_printf(UNIT(s), rvalue, &p);
+         if (r < 0) {
+-                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %s", rvalue);
+-                return 0;
++                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers: %s", rvalue);
++                return -ENOEXEC;
+         }
+ 
+         if (!endswith(p, ".service")) {
+-                log_syntax(unit, LOG_ERR, filename, line, 0, "Unit must be of type service, ignoring: %s", rvalue);
+-                return 0;
++                log_syntax(unit, LOG_ERR, filename, line, 0, "Unit must be of type service: %s", rvalue);
++                return -ENOEXEC;
+         }
+ 
+         r = manager_load_unit(UNIT(s)->manager, p, NULL, &error, &x);
+         if (r < 0) {
+-                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to load unit %s, ignoring: %s", rvalue, bus_error_message(&error, r));
+-                return 0;
++                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to load unit %s: %s", rvalue, bus_error_message(&error, r));
++                return -ENOEXEC;
+         }
+ 
+         unit_ref_set(&s->service, x);
+@@ -1893,13 +1909,13 @@ int config_parse_user_group(
+ 
+                 r = unit_full_printf(u, rvalue, &k);
+                 if (r < 0) {
+-                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s, ignoring: %m", rvalue);
+-                        return 0;
++                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s: %m", rvalue);
++                        return -ENOEXEC;
+                 }
+ 
+                 if (!valid_user_group_name_or_id(k)) {
+-                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID, ignoring: %s", k);
+-                        return 0;
++                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID: %s", k);
++                        return -ENOEXEC;
+                 }
+ 
+                 n = k;
+@@ -1957,19 +1973,19 @@ int config_parse_user_group_strv(
+                 if (r == -ENOMEM)
+                         return log_oom();
+                 if (r < 0) {
+-                        log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax, ignoring: %s", rvalue);
+-                        break;
++                        log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax: %s", rvalue);
++                        return -ENOEXEC;
+                 }
+ 
+                 r = unit_full_printf(u, word, &k);
+                 if (r < 0) {
+-                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s, ignoring: %m", word);
+-                        continue;
++                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s: %m", word);
++                        return -ENOEXEC;
+                 }
+ 
+                 if (!valid_user_group_name_or_id(k)) {
+-                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID, ignoring: %s", k);
+-                        continue;
++                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID: %s", k);
++                        return -ENOEXEC;
+                 }
+ 
+                 r = strv_push(users, k);
+@@ -2128,25 +2144,28 @@ int config_parse_working_directory(
+ 
+                 r = unit_full_printf(u, rvalue, &k);
+                 if (r < 0) {
+-                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in working directory path '%s', ignoring: %m", rvalue);
+-                        return 0;
++                        log_syntax(unit, LOG_ERR, filename, line, r,
++                                   "Failed to resolve unit specifiers in working directory path '%s'%s: %m",
++                                   rvalue, missing_ok ? ", ignoring" : "");
++                        return missing_ok ? 0 : -ENOEXEC;
+                 }
+ 
+                 path_kill_slashes(k);
+ 
+                 if (!utf8_is_valid(k)) {
+                         log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, rvalue);
+-                        return 0;
++                        return missing_ok ? 0 : -ENOEXEC;
+                 }
+ 
+                 if (!path_is_absolute(k)) {
+-                        log_syntax(unit, LOG_ERR, filename, line, 0, "Working directory path '%s' is not absolute, ignoring.", rvalue);
+-                        return 0;
++                        log_syntax(unit, LOG_ERR, filename, line, 0,
++                                   "Working directory path '%s' is not absolute%s.",
++                                   rvalue, missing_ok ? ", ignoring" : "");
++                        return missing_ok ? 0 : -ENOEXEC;
+                 }
+ 
+-                free_and_replace(c->working_directory, k);
+-
+                 c->working_directory_home = false;
++                free_and_replace(c->working_directory, k);
+         }
+ 
+         c->working_directory_missing_ok = missing_ok;
+@@ -4228,8 +4247,11 @@ int unit_load_fragment(Unit *u) {
+                         return r;
+ 
+                 r = load_from_path(u, k);
+-                if (r < 0)
++                if (r < 0) {
++                        if (r == -ENOEXEC)
++                                log_unit_notice(u, "Unit configuration has fatal error, unit will not be started.");
+                         return r;
++                }
+ 
+                 if (u->load_state == UNIT_STUB) {
+                         SET_FOREACH(t, u->names, i) {
+diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c
+index 12f48bf43..fd797b587 100644
+--- a/src/test/test-unit-file.c
++++ b/src/test/test-unit-file.c
+@@ -146,7 +146,7 @@ static void test_config_parse_exec(void) {
+         r = config_parse_exec(NULL, "fake", 4, "section", 1,
+                               "LValue", 0, "/RValue/ argv0 r1",
+                               &c, u);
+-        assert_se(r == 0);
++        assert_se(r == -ENOEXEC);
+         assert_se(c1->command_next == NULL);
+ 
+         log_info("/* honour_argv0 */");
+@@ -161,7 +161,7 @@ static void test_config_parse_exec(void) {
+         r = config_parse_exec(NULL, "fake", 3, "section", 1,
+                               "LValue", 0, "@/RValue",
+                               &c, u);
+-        assert_se(r == 0);
++        assert_se(r == -ENOEXEC);
+         assert_se(c1->command_next == NULL);
+ 
+         log_info("/* no command, whitespace only, reset */");
+@@ -220,7 +220,7 @@ static void test_config_parse_exec(void) {
+                               "-@/RValue argv0 r1 ; ; "
+                               "/goo/goo boo",
+                               &c, u);
+-        assert_se(r >= 0);
++        assert_se(r == -ENOEXEC);
+         c1 = c1->command_next;
+         check_execcommand(c1, "/RValue", "argv0", "r1", NULL, true);
+ 
+@@ -374,7 +374,7 @@ static void test_config_parse_exec(void) {
+                 r = config_parse_exec(NULL, "fake", 4, "section", 1,
+                                       "LValue", 0, path,
+                                       &c, u);
+-                assert_se(r == 0);
++                assert_se(r == -ENOEXEC);
+                 assert_se(c1->command_next == NULL);
+         }
+ 
+@@ -401,21 +401,21 @@ static void test_config_parse_exec(void) {
+         r = config_parse_exec(NULL, "fake", 4, "section", 1,
+                               "LValue", 0, "/path\\",
+                               &c, u);
+-        assert_se(r == 0);
++        assert_se(r == -ENOEXEC);
+         assert_se(c1->command_next == NULL);
+ 
+         log_info("/* missing ending ' */");
+         r = config_parse_exec(NULL, "fake", 4, "section", 1,
+                               "LValue", 0, "/path 'foo",
+                               &c, u);
+-        assert_se(r == 0);
++        assert_se(r == -ENOEXEC);
+         assert_se(c1->command_next == NULL);
+ 
+         log_info("/* missing ending ' with trailing backslash */");
+         r = config_parse_exec(NULL, "fake", 4, "section", 1,
+                               "LValue", 0, "/path 'foo\\",
+                               &c, u);
+-        assert_se(r == 0);
++        assert_se(r == -ENOEXEC);
+         assert_se(c1->command_next == NULL);
+ 
+         log_info("/* invalid space between modifiers */");
+-- 
+2.11.0
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/validate-user.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/validate-user.patch
deleted file mode 100644
index 8e0e0c1..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/validate-user.patch
+++ /dev/null
@@ -1,856 +0,0 @@
-If a user is created with a strictly-speaking invalid name such as '0day' and a
-unit created to run as that user, systemd rejects the username and runs the unit
-as root.
-
-CVE: CVE-2017-1000082
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-From e0c4eb1435d50cb3797cf94100d4886dc2022bce Mon Sep 17 00:00:00 2001
-From: Lennart Poettering <lennart@poettering.net>
-Date: Thu, 14 Jul 2016 12:23:39 +0200
-Subject: [PATCH 1/3] sysusers: move various user credential validity checks to
- src/basic/
-
-This way we can reuse them for validating User=/Group= settings in unit files
-(to be added in a later commit).
-
-Also, add some tests for them.
----
- src/basic/user-util.c     | 93 +++++++++++++++++++++++++++++++++++++++++++++++
- src/basic/user-util.h     |  5 +++
- src/sysusers/sysusers.c   | 75 --------------------------------------
- src/test/test-user-util.c | 87 ++++++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 185 insertions(+), 75 deletions(-)
-
-diff --git a/src/basic/user-util.c b/src/basic/user-util.c
-index f65ca3eda..c85b5c6a8 100644
---- a/src/basic/user-util.c
-+++ b/src/basic/user-util.c
-@@ -29,6 +29,7 @@
- #include <string.h>
- #include <sys/stat.h>
- #include <unistd.h>
-+#include <utmp.h>
- 
- #include "missing.h"
- #include "alloc-util.h"
-@@ -39,6 +40,7 @@
- #include "path-util.h"
- #include "string-util.h"
- #include "user-util.h"
-+#include "utf8.h"
- 
- bool uid_is_valid(uid_t uid) {
- 
-@@ -479,3 +481,94 @@ int take_etc_passwd_lock(const char *root) {
- 
-         return fd;
- }
-+
-+bool valid_user_group_name(const char *u) {
-+        const char *i;
-+        long sz;
-+
-+        /* Checks if the specified name is a valid user/group name. */
-+
-+        if (isempty(u))
-+                return false;
-+
-+        if (!(u[0] >= 'a' && u[0] <= 'z') &&
-+            !(u[0] >= 'A' && u[0] <= 'Z') &&
-+            u[0] != '_')
-+                return false;
-+
-+        for (i = u+1; *i; i++) {
-+                if (!(*i >= 'a' && *i <= 'z') &&
-+                    !(*i >= 'A' && *i <= 'Z') &&
-+                    !(*i >= '0' && *i <= '9') &&
-+                    *i != '_' &&
-+                    *i != '-')
-+                        return false;
-+        }
-+
-+        sz = sysconf(_SC_LOGIN_NAME_MAX);
-+        assert_se(sz > 0);
-+
-+        if ((size_t) (i-u) > (size_t) sz)
-+                return false;
-+
-+        if ((size_t) (i-u) > UT_NAMESIZE - 1)
-+                return false;
-+
-+        return true;
-+}
-+
-+bool valid_user_group_name_or_id(const char *u) {
-+
-+        /* Similar as above, but is also fine with numeric UID/GID specifications, as long as they are in the right
-+         * range, and not the invalid user ids. */
-+
-+        if (isempty(u))
-+                return false;
-+
-+        if (valid_user_group_name(u))
-+                return true;
-+
-+        return parse_uid(u, NULL) >= 0;
-+}
-+
-+bool valid_gecos(const char *d) {
-+
-+        if (!d)
-+                return false;
-+
-+        if (!utf8_is_valid(d))
-+                return false;
-+
-+        if (string_has_cc(d, NULL))
-+                return false;
-+
-+        /* Colons are used as field separators, and hence not OK */
-+        if (strchr(d, ':'))
-+                return false;
-+
-+        return true;
-+}
-+
-+bool valid_home(const char *p) {
-+
-+        if (isempty(p))
-+                return false;
-+
-+        if (!utf8_is_valid(p))
-+                return false;
-+
-+        if (string_has_cc(p, NULL))
-+                return false;
-+
-+        if (!path_is_absolute(p))
-+                return false;
-+
-+        if (!path_is_safe(p))
-+                return false;
-+
-+        /* Colons are used as field separators, and hence not OK */
-+        if (strchr(p, ':'))
-+                return false;
-+
-+        return true;
-+}
-diff --git a/src/basic/user-util.h b/src/basic/user-util.h
-index 8026eca3f..36f71fb00 100644
---- a/src/basic/user-util.h
-+++ b/src/basic/user-util.h
-@@ -68,3 +68,8 @@ int take_etc_passwd_lock(const char *root);
- static inline bool userns_supported(void) {
-         return access("/proc/self/uid_map", F_OK) >= 0;
- }
-+
-+bool valid_user_group_name(const char *u);
-+bool valid_user_group_name_or_id(const char *u);
-+bool valid_gecos(const char *d);
-+bool valid_home(const char *p);
-diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
-index 4377f1b91..df3b7de30 100644
---- a/src/sysusers/sysusers.c
-+++ b/src/sysusers/sysusers.c
-@@ -1299,81 +1299,6 @@ static bool item_equal(Item *a, Item *b) {
-         return true;
- }
- 
--static bool valid_user_group_name(const char *u) {
--        const char *i;
--        long sz;
--
--        if (isempty(u))
--                return false;
--
--        if (!(u[0] >= 'a' && u[0] <= 'z') &&
--            !(u[0] >= 'A' && u[0] <= 'Z') &&
--            u[0] != '_')
--                return false;
--
--        for (i = u+1; *i; i++) {
--                if (!(*i >= 'a' && *i <= 'z') &&
--                    !(*i >= 'A' && *i <= 'Z') &&
--                    !(*i >= '0' && *i <= '9') &&
--                    *i != '_' &&
--                    *i != '-')
--                        return false;
--        }
--
--        sz = sysconf(_SC_LOGIN_NAME_MAX);
--        assert_se(sz > 0);
--
--        if ((size_t) (i-u) > (size_t) sz)
--                return false;
--
--        if ((size_t) (i-u) > UT_NAMESIZE - 1)
--                return false;
--
--        return true;
--}
--
--static bool valid_gecos(const char *d) {
--
--        if (!d)
--                return false;
--
--        if (!utf8_is_valid(d))
--                return false;
--
--        if (string_has_cc(d, NULL))
--                return false;
--
--        /* Colons are used as field separators, and hence not OK */
--        if (strchr(d, ':'))
--                return false;
--
--        return true;
--}
--
--static bool valid_home(const char *p) {
--
--        if (isempty(p))
--                return false;
--
--        if (!utf8_is_valid(p))
--                return false;
--
--        if (string_has_cc(p, NULL))
--                return false;
--
--        if (!path_is_absolute(p))
--                return false;
--
--        if (!path_is_safe(p))
--                return false;
--
--        /* Colons are used as field separators, and hence not OK */
--        if (strchr(p, ':'))
--                return false;
--
--        return true;
--}
--
- static int parse_line(const char *fname, unsigned line, const char *buffer) {
- 
-         static const Specifier specifier_table[] = {
-diff --git a/src/test/test-user-util.c b/src/test/test-user-util.c
-index 8d1ec19f1..2a344a9f9 100644
---- a/src/test/test-user-util.c
-+++ b/src/test/test-user-util.c
-@@ -61,6 +61,88 @@ static void test_uid_ptr(void) {
-         assert_se(PTR_TO_UID(UID_TO_PTR(1000)) == 1000);
- }
- 
-+static void test_valid_user_group_name(void) {
-+        assert_se(!valid_user_group_name(NULL));
-+        assert_se(!valid_user_group_name(""));
-+        assert_se(!valid_user_group_name("1"));
-+        assert_se(!valid_user_group_name("65535"));
-+        assert_se(!valid_user_group_name("-1"));
-+        assert_se(!valid_user_group_name("-kkk"));
-+        assert_se(!valid_user_group_name("rööt"));
-+        assert_se(!valid_user_group_name("."));
-+        assert_se(!valid_user_group_name("eff.eff"));
-+        assert_se(!valid_user_group_name("foo\nbar"));
-+        assert_se(!valid_user_group_name("0123456789012345678901234567890123456789"));
-+        assert_se(!valid_user_group_name_or_id("aaa:bbb"));
-+
-+        assert_se(valid_user_group_name("root"));
-+        assert_se(valid_user_group_name("lennart"));
-+        assert_se(valid_user_group_name("LENNART"));
-+        assert_se(valid_user_group_name("_kkk"));
-+        assert_se(valid_user_group_name("kkk-"));
-+        assert_se(valid_user_group_name("kk-k"));
-+
-+        assert_se(valid_user_group_name("some5"));
-+        assert_se(!valid_user_group_name("5some"));
-+        assert_se(valid_user_group_name("INNER5NUMBER"));
-+}
-+
-+static void test_valid_user_group_name_or_id(void) {
-+        assert_se(!valid_user_group_name_or_id(NULL));
-+        assert_se(!valid_user_group_name_or_id(""));
-+        assert_se(valid_user_group_name_or_id("0"));
-+        assert_se(valid_user_group_name_or_id("1"));
-+        assert_se(valid_user_group_name_or_id("65534"));
-+        assert_se(!valid_user_group_name_or_id("65535"));
-+        assert_se(valid_user_group_name_or_id("65536"));
-+        assert_se(!valid_user_group_name_or_id("-1"));
-+        assert_se(!valid_user_group_name_or_id("-kkk"));
-+        assert_se(!valid_user_group_name_or_id("rööt"));
-+        assert_se(!valid_user_group_name_or_id("."));
-+        assert_se(!valid_user_group_name_or_id("eff.eff"));
-+        assert_se(!valid_user_group_name_or_id("foo\nbar"));
-+        assert_se(!valid_user_group_name_or_id("0123456789012345678901234567890123456789"));
-+        assert_se(!valid_user_group_name_or_id("aaa:bbb"));
-+
-+        assert_se(valid_user_group_name_or_id("root"));
-+        assert_se(valid_user_group_name_or_id("lennart"));
-+        assert_se(valid_user_group_name_or_id("LENNART"));
-+        assert_se(valid_user_group_name_or_id("_kkk"));
-+        assert_se(valid_user_group_name_or_id("kkk-"));
-+        assert_se(valid_user_group_name_or_id("kk-k"));
-+
-+        assert_se(valid_user_group_name_or_id("some5"));
-+        assert_se(!valid_user_group_name_or_id("5some"));
-+        assert_se(valid_user_group_name_or_id("INNER5NUMBER"));
-+}
-+
-+static void test_valid_gecos(void) {
-+
-+        assert_se(!valid_gecos(NULL));
-+        assert_se(valid_gecos(""));
-+        assert_se(valid_gecos("test"));
-+        assert_se(valid_gecos("Ümläüt"));
-+        assert_se(!valid_gecos("In\nvalid"));
-+        assert_se(!valid_gecos("In:valid"));
-+}
-+
-+static void test_valid_home(void) {
-+
-+        assert_se(!valid_home(NULL));
-+        assert_se(!valid_home(""));
-+        assert_se(!valid_home("."));
-+        assert_se(!valid_home("/home/.."));
-+        assert_se(!valid_home("/home/../"));
-+        assert_se(!valid_home("/home\n/foo"));
-+        assert_se(!valid_home("./piep"));
-+        assert_se(!valid_home("piep"));
-+        assert_se(!valid_home("/home/user:lennart"));
-+
-+        assert_se(valid_home("/"));
-+        assert_se(valid_home("/home"));
-+        assert_se(valid_home("/home/foo"));
-+}
-+
- int main(int argc, char*argv[]) {
- 
-         test_uid_to_name_one(0, "root");
-@@ -75,5 +157,10 @@ int main(int argc, char*argv[]) {
-         test_parse_uid();
-         test_uid_ptr();
- 
-+        test_valid_user_group_name();
-+        test_valid_user_group_name_or_id();
-+        test_valid_gecos();
-+        test_valid_home();
-+
-         return 0;
- }
--- 
-2.11.0
-
-
-From 1affacaaf6eff93e53563a644567cc5c3930cb28 Mon Sep 17 00:00:00 2001
-From: Lennart Poettering <lennart@poettering.net>
-Date: Thu, 14 Jul 2016 12:28:06 +0200
-Subject: [PATCH 2/3] core: be stricter when parsing User=/Group= fields
-
-Let's verify the validity of the syntax of the user/group names set.
----
- src/core/load-fragment-gperf.gperf.m4 |  10 +--
- src/core/load-fragment.c              | 118 ++++++++++++++++++++++++++++++++++
- src/core/load-fragment.h              |   2 +
- 3 files changed, 125 insertions(+), 5 deletions(-)
-
-diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
-index 819341898..110089696 100644
---- a/src/core/load-fragment-gperf.gperf.m4
-+++ b/src/core/load-fragment-gperf.gperf.m4
-@@ -19,9 +19,9 @@ m4_dnl Define the context options only once
- m4_define(`EXEC_CONTEXT_CONFIG_ITEMS',
- `$1.WorkingDirectory,            config_parse_working_directory,     0,                             offsetof($1, exec_context)
- $1.RootDirectory,                config_parse_unit_path_printf,      0,                             offsetof($1, exec_context.root_directory)
--$1.User,                         config_parse_unit_string_printf,    0,                             offsetof($1, exec_context.user)
--$1.Group,                        config_parse_unit_string_printf,    0,                             offsetof($1, exec_context.group)
--$1.SupplementaryGroups,          config_parse_strv,                  0,                             offsetof($1, exec_context.supplementary_groups)
-+$1.User,                         config_parse_user_group,            0,                             offsetof($1, exec_context.user)
-+$1.Group,                        config_parse_user_group,            0,                             offsetof($1, exec_context.group)
-+$1.SupplementaryGroups,          config_parse_user_group_strv,       0,                             offsetof($1, exec_context.supplementary_groups)
- $1.Nice,                         config_parse_exec_nice,             0,                             offsetof($1, exec_context)
- $1.OOMScoreAdjust,               config_parse_exec_oom_score_adjust, 0,                             offsetof($1, exec_context)
- $1.IOSchedulingClass,            config_parse_exec_io_class,         0,                             offsetof($1, exec_context)
-@@ -275,8 +275,8 @@ Socket.ExecStartPost,            config_parse_exec,                  SOCKET_EXEC
- Socket.ExecStopPre,              config_parse_exec,                  SOCKET_EXEC_STOP_PRE,          offsetof(Socket, exec_command)
- Socket.ExecStopPost,             config_parse_exec,                  SOCKET_EXEC_STOP_POST,         offsetof(Socket, exec_command)
- Socket.TimeoutSec,               config_parse_sec,                   0,                             offsetof(Socket, timeout_usec)
--Socket.SocketUser,               config_parse_unit_string_printf,    0,                             offsetof(Socket, user)
--Socket.SocketGroup,              config_parse_unit_string_printf,    0,                             offsetof(Socket, group)
-+Socket.SocketUser,               config_parse_user_group,            0,                             offsetof(Socket, user)
-+Socket.SocketGroup,              config_parse_user_group,            0,                             offsetof(Socket, group)
- Socket.SocketMode,               config_parse_mode,                  0,                             offsetof(Socket, socket_mode)
- Socket.DirectoryMode,            config_parse_mode,                  0,                             offsetof(Socket, directory_mode)
- Socket.Accept,                   config_parse_bool,                  0,                             offsetof(Socket, accept)
-diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
-index 86b4fb071..f43781803 100644
---- a/src/core/load-fragment.c
-+++ b/src/core/load-fragment.c
-@@ -64,6 +64,7 @@
- #include "unit-name.h"
- #include "unit-printf.h"
- #include "unit.h"
-+#include "user-util.h"
- #include "utf8.h"
- #include "web-util.h"
- 
-@@ -1758,6 +1759,123 @@ int config_parse_sec_fix_0(
-         return 0;
- }
- 
-+int config_parse_user_group(
-+                const char *unit,
-+                const char *filename,
-+                unsigned line,
-+                const char *section,
-+                unsigned section_line,
-+                const char *lvalue,
-+                int ltype,
-+                const char *rvalue,
-+                void *data,
-+                void *userdata) {
-+
-+        char **user = data, *n;
-+        Unit *u = userdata;
-+        int r;
-+
-+        assert(filename);
-+        assert(lvalue);
-+        assert(rvalue);
-+        assert(u);
-+
-+        if (isempty(rvalue))
-+                n = NULL;
-+        else {
-+                _cleanup_free_ char *k = NULL;
-+
-+                r = unit_full_printf(u, rvalue, &k);
-+                if (r < 0) {
-+                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s, ignoring: %m", rvalue);
-+                        return 0;
-+                }
-+
-+                if (!valid_user_group_name_or_id(k)) {
-+                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID, ignoring: %s", k);
-+                        return 0;
-+                }
-+
-+                n = k;
-+                k = NULL;
-+        }
-+
-+        free(*user);
-+        *user = n;
-+
-+        return 0;
-+}
-+
-+int config_parse_user_group_strv(
-+                const char *unit,
-+                const char *filename,
-+                unsigned line,
-+                const char *section,
-+                unsigned section_line,
-+                const char *lvalue,
-+                int ltype,
-+                const char *rvalue,
-+                void *data,
-+                void *userdata) {
-+
-+        char ***users = data;
-+        Unit *u = userdata;
-+        const char *p;
-+        int r;
-+
-+        assert(filename);
-+        assert(lvalue);
-+        assert(rvalue);
-+        assert(u);
-+
-+        if (isempty(rvalue)) {
-+                char **empty;
-+
-+                empty = new0(char*, 1);
-+                if (!empty)
-+                        return log_oom();
-+
-+                strv_free(*users);
-+                *users = empty;
-+
-+                return 0;
-+        }
-+
-+        p = rvalue;
-+        for (;;) {
-+                _cleanup_free_ char *word = NULL, *k = NULL;
-+
-+                r = extract_first_word(&p, &word, WHITESPACE, 0);
-+                if (r == 0)
-+                        break;
-+                if (r == -ENOMEM)
-+                        return log_oom();
-+                if (r < 0) {
-+                        log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax, ignoring: %s", rvalue);
-+                        break;
-+                }
-+
-+                r = unit_full_printf(u, word, &k);
-+                if (r < 0) {
-+                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s, ignoring: %m", word);
-+                        continue;
-+                }
-+
-+                if (!valid_user_group_name_or_id(k)) {
-+                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID, ignoring: %s", k);
-+                        continue;
-+                }
-+
-+                r = strv_push(users, k);
-+                if (r < 0)
-+                        return log_oom();
-+
-+                k = NULL;
-+        }
-+
-+        return 0;
-+}
-+
- int config_parse_busname_service(
-                 const char *unit,
-                 const char *filename,
-diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h
-index b36a2e3a0..213bce55a 100644
---- a/src/core/load-fragment.h
-+++ b/src/core/load-fragment.h
-@@ -111,6 +111,8 @@ int config_parse_exec_utmp_mode(const char *unit, const char *filename, unsigned
- int config_parse_working_directory(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
- int config_parse_fdname(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
- int config_parse_sec_fix_0(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
-+int config_parse_user_group(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
-+int config_parse_user_group_strv(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
- 
- /* gperf prototypes */
- const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, unsigned length);
--- 
-2.11.0
-
-
-From 97e0456384ed5c930394062d340237ea6130ece0 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Thu, 6 Jul 2017 13:28:19 -0400
-Subject: [PATCH 3/3] core/load-fragment: refuse units with errors in certain
- directives
-
-If an error is encountered in any of the Exec* lines, WorkingDirectory,
-SELinuxContext, ApparmorProfile, SmackProcessLabel, Service (in .socket
-units), User, or Group, refuse to load the unit. If the config stanza
-has support, ignore the failure if '-' is present.
-
-For those configuration directives, even if we started the unit, it's
-pretty likely that it'll do something unexpected (like write files
-in a wrong place, or with a wrong context, or run with wrong permissions,
-etc). It seems better to refuse to start the unit and have the admin
-clean up the configuration without giving the service a chance to mess
-up stuff.
-
-Note that all "security" options that restrict what the unit can do
-(Capabilities, AmbientCapabilities, Restrict*, SystemCallFilter, Limit*,
-PrivateDevices, Protect*, etc) are _not_ treated like this. Such options are
-only supplementary, and are not always available depending on the architecture
-and compilation options, so unit authors have to make sure that the service
-runs correctly without them anyway.
-
-Fixes #6237, #6277.
-
-Signed-off-by: Ross Burton <ross.burton@intel.com>
----
- src/core/load-fragment.c  | 101 ++++++++++++++++++++++++++++------------------
- src/test/test-unit-file.c |  14 +++----
- 2 files changed, 69 insertions(+), 46 deletions(-)
-
-diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
-index f43781803..b1fb1d407 100644
---- a/src/core/load-fragment.c
-+++ b/src/core/load-fragment.c
-@@ -626,20 +626,28 @@ int config_parse_exec(
- 
-                 if (isempty(f)) {
-                         /* First word is either "-" or "@" with no command. */
--                        log_syntax(unit, LOG_ERR, filename, line, 0, "Empty path in command line, ignoring: \"%s\"", rvalue);
--                        return 0;
-+                        log_syntax(unit, LOG_ERR, filename, line, 0,
-+                                   "Empty path in command line%s: \"%s\"",
-+                                   ignore ? ", ignoring" : "", rvalue);
-+                        return ignore ? 0 : -ENOEXEC;
-                 }
-                 if (!string_is_safe(f)) {
--                        log_syntax(unit, LOG_ERR, filename, line, 0, "Executable path contains special characters, ignoring: %s", rvalue);
--                        return 0;
-+                        log_syntax(unit, LOG_ERR, filename, line, 0,
-+                                   "Executable path contains special characters%s: %s",
-+                                   ignore ? ", ignoring" : "", rvalue);
-+                        return ignore ? 0 : -ENOEXEC;
-                 }
-                 if (!path_is_absolute(f)) {
--                        log_syntax(unit, LOG_ERR, filename, line, 0, "Executable path is not absolute, ignoring: %s", rvalue);
--                        return 0;
-+                        log_syntax(unit, LOG_ERR, filename, line, 0,
-+                                   "Executable path is not absolute%s: %s",
-+                                   ignore ? ", ignoring" : "", rvalue);
-+                        return ignore ? 0 : -ENOEXEC;
-                 }
-                 if (endswith(f, "/")) {
--                        log_syntax(unit, LOG_ERR, filename, line, 0, "Executable path specifies a directory, ignoring: %s", rvalue);
--                        return 0;
-+                        log_syntax(unit, LOG_ERR, filename, line, 0,
-+                                   "Executable path specifies a directory%s: %s",
-+                                   ignore ? ", ignoring" : "", rvalue);
-+                        return ignore ? 0 : -ENOEXEC;
-                 }
- 
-                 if (f == firstword) {
-@@ -695,7 +703,7 @@ int config_parse_exec(
-                         if (r == 0)
-                                 break;
-                         else if (r < 0)
--                                return 0;
-+                                return ignore ? 0 : -ENOEXEC;
- 
-                         if (!GREEDY_REALLOC(n, nbufsize, nlen + 2))
-                                 return log_oom();
-@@ -705,8 +713,10 @@ int config_parse_exec(
-                 }
- 
-                 if (!n || !n[0]) {
--                        log_syntax(unit, LOG_ERR, filename, line, 0, "Empty executable name or zeroeth argument, ignoring: %s", rvalue);
--                        return 0;
-+                        log_syntax(unit, LOG_ERR, filename, line, 0,
-+                                   "Empty executable name or zeroeth argument%s: %s",
-+                                   ignore ? ", ignoring" : "", rvalue);
-+                        return ignore ? 0 : -ENOEXEC;
-                 }
- 
-                 nce = new0(ExecCommand, 1);
-@@ -1214,8 +1224,10 @@ int config_parse_exec_selinux_context(
- 
-         r = unit_name_printf(u, rvalue, &k);
-         if (r < 0) {
--                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %m");
--                return 0;
-+                log_syntax(unit, LOG_ERR, filename, line, r,
-+                           "Failed to resolve specifiers%s: %m",
-+                           ignore ? ", ignoring" : "");
-+                return ignore ? 0 : -ENOEXEC;
-         }
- 
-         free(c->selinux_context);
-@@ -1262,8 +1274,10 @@ int config_parse_exec_apparmor_profile(
- 
-         r = unit_name_printf(u, rvalue, &k);
-         if (r < 0) {
--                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %m");
--                return 0;
-+                log_syntax(unit, LOG_ERR, filename, line, r,
-+                           "Failed to resolve specifiers%s: %m",
-+                           ignore ? ", ignoring" : "");
-+                return ignore ? 0 : -ENOEXEC;
-         }
- 
-         free(c->apparmor_profile);
-@@ -1310,8 +1324,10 @@ int config_parse_exec_smack_process_label(
- 
-         r = unit_name_printf(u, rvalue, &k);
-         if (r < 0) {
--                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %m");
--                return 0;
-+                log_syntax(unit, LOG_ERR, filename, line, r,
-+                           "Failed to resolve specifiers%s: %m",
-+                           ignore ? ", ignoring" : "");
-+                return ignore ? 0 : -ENOEXEC;
-         }
- 
-         free(c->smack_process_label);
-@@ -1520,19 +1536,19 @@ int config_parse_socket_service(
- 
-         r = unit_name_printf(UNIT(s), rvalue, &p);
-         if (r < 0) {
--                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %s", rvalue);
--                return 0;
-+                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers: %s", rvalue);
-+                return -ENOEXEC;
-         }
- 
-         if (!endswith(p, ".service")) {
--                log_syntax(unit, LOG_ERR, filename, line, 0, "Unit must be of type service, ignoring: %s", rvalue);
--                return 0;
-+                log_syntax(unit, LOG_ERR, filename, line, 0, "Unit must be of type service: %s", rvalue);
-+                return -ENOEXEC;
-         }
- 
-         r = manager_load_unit(UNIT(s)->manager, p, NULL, &error, &x);
-         if (r < 0) {
--                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to load unit %s, ignoring: %s", rvalue, bus_error_message(&error, r));
--                return 0;
-+                log_syntax(unit, LOG_ERR, filename, line, r, "Failed to load unit %s: %s", rvalue, bus_error_message(&error, r));
-+                return -ENOEXEC;
-         }
- 
-         unit_ref_set(&s->service, x);
-@@ -1787,13 +1803,13 @@ int config_parse_user_group(
- 
-                 r = unit_full_printf(u, rvalue, &k);
-                 if (r < 0) {
--                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s, ignoring: %m", rvalue);
--                        return 0;
-+                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s: %m", rvalue);
-+                        return -ENOEXEC;
-                 }
- 
-                 if (!valid_user_group_name_or_id(k)) {
--                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID, ignoring: %s", k);
--                        return 0;
-+                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID: %s", k);
-+                        return -ENOEXEC;
-                 }
- 
-                 n = k;
-@@ -1851,19 +1867,19 @@ int config_parse_user_group_strv(
-                 if (r == -ENOMEM)
-                         return log_oom();
-                 if (r < 0) {
--                        log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax, ignoring: %s", rvalue);
--                        break;
-+                        log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax: %s", rvalue);
-+                        return -ENOEXEC;
-                 }
- 
-                 r = unit_full_printf(u, word, &k);
-                 if (r < 0) {
--                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s, ignoring: %m", word);
--                        continue;
-+                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s: %m", word);
-+                        return -ENOEXEC;
-                 }
- 
-                 if (!valid_user_group_name_or_id(k)) {
--                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID, ignoring: %s", k);
--                        continue;
-+                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID: %s", k);
-+                        return -ENOEXEC;
-                 }
- 
-                 r = strv_push(users, k);
-@@ -2022,20 +2038,24 @@ int config_parse_working_directory(
- 
-                 r = unit_full_printf(u, rvalue, &k);
-                 if (r < 0) {
--                        log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in working directory path '%s', ignoring: %m", rvalue);
--                        return 0;
-+                        log_syntax(unit, LOG_ERR, filename, line, r,
-+                                   "Failed to resolve unit specifiers in working directory path '%s'%s: %m",
-+                                   rvalue, missing_ok ? ", ignoring" : "");
-+                        return missing_ok ? 0 : -ENOEXEC;
-                 }
- 
-                 path_kill_slashes(k);
- 
-                 if (!utf8_is_valid(k)) {
-                         log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, rvalue);
--                        return 0;
-+                        return missing_ok ? 0 : -ENOEXEC;
-                 }
- 
-                 if (!path_is_absolute(k)) {
--                        log_syntax(unit, LOG_ERR, filename, line, 0, "Working directory path '%s' is not absolute, ignoring.", rvalue);
--                        return 0;
-+                        log_syntax(unit, LOG_ERR, filename, line, 0,
-+                                   "Working directory path '%s' is not absolute%s.",
-+                                   rvalue, missing_ok ? ", ignoring" : "");
-+                        return missing_ok ? 0 : -ENOEXEC;
-                 }
- 
-                 free(c->working_directory);
-@@ -4043,8 +4063,11 @@ int unit_load_fragment(Unit *u) {
-                         return r;
- 
-                 r = load_from_path(u, k);
--                if (r < 0)
-+                if (r < 0) {
-+                        if (r == -ENOEXEC)
-+                                log_unit_notice(u, "Unit configuration has fatal error, unit will not be started.");
-                         return r;
-+                }
- 
-                 if (u->load_state == UNIT_STUB) {
-                         SET_FOREACH(t, u->names, i) {
-diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c
-index ade0ff2a6..fe1969570 100644
---- a/src/test/test-unit-file.c
-+++ b/src/test/test-unit-file.c
-@@ -146,7 +146,7 @@ static void test_config_parse_exec(void) {
-         r = config_parse_exec(NULL, "fake", 4, "section", 1,
-                               "LValue", 0, "/RValue/ argv0 r1",
-                               &c, u);
--        assert_se(r == 0);
-+        assert_se(r == -ENOEXEC);
-         assert_se(c1->command_next == NULL);
- 
-         log_info("/* honour_argv0 */");
-@@ -161,7 +161,7 @@ static void test_config_parse_exec(void) {
-         r = config_parse_exec(NULL, "fake", 3, "section", 1,
-                               "LValue", 0, "@/RValue",
-                               &c, u);
--        assert_se(r == 0);
-+        assert_se(r == -ENOEXEC);
-         assert_se(c1->command_next == NULL);
- 
-         log_info("/* no command, whitespace only, reset */");
-@@ -220,7 +220,7 @@ static void test_config_parse_exec(void) {
-                               "-@/RValue argv0 r1 ; ; "
-                               "/goo/goo boo",
-                               &c, u);
--        assert_se(r >= 0);
-+        assert_se(r == -ENOEXEC);
-         c1 = c1->command_next;
-         check_execcommand(c1, "/RValue", "argv0", "r1", NULL, true);
- 
-@@ -374,7 +374,7 @@ static void test_config_parse_exec(void) {
-                 r = config_parse_exec(NULL, "fake", 4, "section", 1,
-                                       "LValue", 0, path,
-                                       &c, u);
--                assert_se(r == 0);
-+                assert_se(r == -ENOEXEC);
-                 assert_se(c1->command_next == NULL);
-         }
- 
-@@ -401,21 +401,21 @@ static void test_config_parse_exec(void) {
-         r = config_parse_exec(NULL, "fake", 4, "section", 1,
-                               "LValue", 0, "/path\\",
-                               &c, u);
--        assert_se(r == 0);
-+        assert_se(r == -ENOEXEC);
-         assert_se(c1->command_next == NULL);
- 
-         log_info("/* missing ending ' */");
-         r = config_parse_exec(NULL, "fake", 4, "section", 1,
-                               "LValue", 0, "/path 'foo",
-                               &c, u);
--        assert_se(r == 0);
-+        assert_se(r == -ENOEXEC);
-         assert_se(c1->command_next == NULL);
- 
-         log_info("/* missing ending ' with trailing backslash */");
-         r = config_parse_exec(NULL, "fake", 4, "section", 1,
-                               "LValue", 0, "/path 'foo\\",
-                               &c, u);
--        assert_se(r == 0);
-+        assert_se(r == -ENOEXEC);
-         assert_se(c1->command_next == NULL);
- 
-         log_info("/* invalid space between modifiers */");
--- 
-2.11.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd_232.bb b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd_232.bb
index df1d9e1..25fe496 100644
--- a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd_232.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd_232.bb
@@ -4,11 +4,11 @@
 
 PE = "1"
 
-DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline libcap libcgroup qemu-native util-linux"
+DEPENDS = "kmod intltool-native gperf-native acl readline libcap libcgroup util-linux"
 
 SECTION = "base/shell"
 
-inherit useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext bash-completion
+inherit useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext bash-completion manpages
 
 SRC_URI += " \
            file://touchscreen.rules \
@@ -33,6 +33,7 @@
            file://0018-check-for-uchar.h-in-configure.patch \
            file://0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
            file://0020-back-port-233-don-t-use-the-unified-hierarchy-for-the-systemd.patch \
+           file://0001-core-load-fragment-refuse-units-with-errors-in-certa.patch \
 "
 SRC_URI_append_libc-uclibc = "\
            file://0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch \
@@ -40,16 +41,14 @@
 SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
 
 PACKAGECONFIG ??= "xz \
-                   ldconfig \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'efi pam selinux ldconfig', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
-                   ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'efi', '', d)} \
                    binfmt \
                    randomseed \
                    machined \
                    backlight \
+                   vconsole \
                    quotacheck \
                    hostnamed \
                    ${@bb.utils.contains('TCLIBC', 'glibc', 'myhostname sysusers', '', d)} \
@@ -82,6 +81,7 @@
 PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
 PACKAGECONFIG[machined] = "--enable-machined,--disable-machined"
 PACKAGECONFIG[backlight] = "--enable-backlight,--disable-backlight"
+PACKAGECONFIG[vconsole] = "--enable-vconsole,--disable-vconsole,,${PN}-vconsole-setup"
 PACKAGECONFIG[quotacheck] = "--enable-quotacheck,--disable-quotacheck"
 PACKAGECONFIG[hostnamed] = "--enable-hostnamed,--disable-hostnamed"
 PACKAGECONFIG[myhostname] = "--enable-myhostname,--disable-myhostname"
@@ -161,6 +161,9 @@
 # disable problematic GCC 5.2 optimizations [YOCTO #8291]
 FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns -fno-schedule-insns2"
 
+# Avoid login failure on qemumips64 when pam is enabled
+FULL_OPTIMIZATION_append_mips64 = " -fno-tree-switch-conversion -fno-tree-tail-merge"
+
 do_configure_prepend() {
 	export NM="${HOST_PREFIX}gcc-nm"
 	export AR="${HOST_PREFIX}gcc-ar"
@@ -274,7 +277,7 @@
 }
 
 python populate_packages_prepend (){
-    systemdlibdir = d.getVar("rootlibdir", True)
+    systemdlibdir = d.getVar("rootlibdir")
     do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
 }
 PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
@@ -365,6 +368,7 @@
                          ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
                          ${systemd_system_unitdir}/systemd-importd.service \
                          ${systemd_system_unitdir}/systemd-machined.service \
+                         ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
                          ${systemd_system_unitdir}/var-lib-machines.mount \
                          ${rootlibexecdir}/systemd/systemd-import \
                          ${rootlibexecdir}/systemd/systemd-importd \
@@ -450,7 +454,6 @@
                 ${rootlibexecdir}/systemd/* \
                 ${systemd_unitdir}/* \
                 ${base_libdir}/security/*.so \
-                ${libdir}/libnss_* \
                 /cgroup \
                 ${bindir}/systemd* \
                 ${bindir}/busctl \
@@ -478,7 +481,6 @@
 RDEPENDS_${PN} += "volatile-binds update-rc.d"
 
 RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)} \
-                      systemd-vconsole-setup \
                       systemd-extra-utils \
                       systemd-compat-units udev-hwdb \
                       util-linux-agetty  util-linux-fsck e2fsprogs-e2fsck \
@@ -570,6 +572,7 @@
 		-i $D${sysconfdir}/nsswitch.conf
 }
 
+PACKAGE_WRITE_DEPS += "qemu-native"
 pkg_postinst_udev-hwdb () {
 	if test -n "$D"; then
 		${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
@@ -591,6 +594,6 @@
         raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
 
     import re
-    if re.match('.*musl*', d.getVar('TARGET_OS', True)) != None:
+    if re.match('.*musl*', d.getVar('TARGET_OS')) != None:
         raise bb.parse.SkipPackage("Not _yet_ supported on musl based targets")
 }
diff --git a/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
index 6eaeb7a..e3d052a 100644
--- a/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
+++ b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
@@ -1,5 +1,5 @@
 #!/bin/sh
 if [ -c /dev/$2 ]
 then 
-	/sbin/getty -L $1 $2
+	/sbin/getty -L $1 $2 $3
 fi
diff --git a/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
index f136ad8..5b9c422 100644
--- a/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -28,7 +28,7 @@
 	j=`echo ${i} | sed s/\;/\ /g`
 	l=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
 	label=`echo $l | sed 's/.*\(....\)/\1/'`
-	echo "$label:12345:respawn:${base_bindir}/start_getty ${j}" >> ${D}${sysconfdir}/inittab
+	echo "$label:12345:respawn:${base_bindir}/start_getty ${j} vt102" >> ${D}${sysconfdir}/inittab
     done
 
     if [ "${USE_VT}" = "1" ]; then
@@ -62,7 +62,7 @@
 		k=`echo ${i} | sed s/^.*\://g`
 		if [ -z "`grep ${j} /proc/consoles`" ]; then
 			if [ -z "${k}" ] || [ -z "`grep ${k} /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
-				sed -i /^.*${j}$/d /etc/inittab
+				sed -i -e /^.*${j}\ /d -e /^.*${j}$/d /etc/inittab
 			fi
 		fi
 	done
diff --git a/import-layers/yocto-poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch
new file mode 100644
index 0000000..fe2ba53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch
@@ -0,0 +1,28 @@
+From 4f0a722489154da99e7f6b3051afde984eed2f74 Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Thu, 19 Mar 2015 15:01:29 +1100
+Subject: [PATCH] Revert "rules: remove firmware loading rules"
+
+This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19.
+Userspace firmware loading support is needed for Linux < 3.7.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ rules/50-firmware.rules | 3 +++
+ 1 file changed, 3 insertions(+)
+ create mode 100644 rules/50-firmware.rules
+
+diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules
+new file mode 100644
+index 0000000..f0ae684
+--- /dev/null
++++ b/rules/50-firmware.rules
+@@ -0,0 +1,3 @@
++# do not edit this file, it will be overwritten on update
++
++SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
+-- 
+2.3.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch
new file mode 100644
index 0000000..db333e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch
@@ -0,0 +1,364 @@
+From e415372cc7a2f52e70e1cfa8c6c1f633b411355d Mon Sep 17 00:00:00 2001
+From: Lauren Post <lauren.post@nxp.com>
+Date: Wed, 8 Jun 2016 06:51:56 -0500
+Subject: [PATCH] Revert "udev: remove userspace firmware loading support"
+
+This reverts commit 3b717594600fa717cdf9bcfd0c7c1b703b245482.
+
+Conflicts:
+	configure.ac
+	src/udev/udevd.c
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Lauren Post <lauren.post@nxp.com>
+---
+ configure.ac                     |  39 +++++++++-
+ rules/Makefile.am                |   5 ++
+ src/udev/Makefile.am             |  10 +++
+ src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++
+ src/udev/udev-builtin.c          |   3 +
+ src/udev/udev.h                  |   6 ++
+ src/udev/udevd.c                 |  13 ++++
+ 7 files changed, 227 insertions(+), 3 deletions(-)
+ create mode 100644 src/udev/udev-builtin-firmware.c
+
+diff --git a/configure.ac b/configure.ac
+index 8691891..65028c2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -238,9 +238,42 @@ AC_CHECK_DECL([unshare],
+         [#include <sched.h>])
+ 
+ # ------------------------------------------------------------------------------
+-AC_PATH_TOOL(GPERF, gperf)
+-if test -z "$GPERF" ; then
+-        AC_MSG_ERROR([*** gperf not found])
++AC_ARG_WITH(firmware-path,
++       AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
++          [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]),
++       [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
++OLD_IFS=$IFS
++IFS=:
++for i in $with_firmware_path; do
++       if test "x${FIRMWARE_PATH}" = "x"; then
++              FIRMWARE_PATH="\\\"${i}/\\\""
++       else
++              FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
++       fi
++done
++IFS=$OLD_IFS
++AC_SUBST(FIRMWARE_PATH)
++AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
++AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
++
++# ------------------------------------------------------------------------------
++AC_ARG_ENABLE([gudev],
++       AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
++       [], [enable_gudev=yes])
++AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ])
++AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
++
++# ------------------------------------------------------------------------------
++AC_ARG_ENABLE([keymap],
++        AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]),
++        [], [enable_keymap=yes])
++
++if test "x$enable_keymap" = "xyes"; then
++        AC_PATH_TOOL(GPERF, gperf)
++        if test -z "$GPERF" ; then
++                AC_MSG_ERROR([*** gperf not found])
++        fi
++        AC_DEFINE([ENABLE_KEYMAP], [1], [Define if we are enabling rule generator])
+ fi
+ 
+ # ------------------------------------------------------------------------------
+diff --git a/rules/Makefile.am b/rules/Makefile.am
+index 24c099c..d714ae3 100644
+--- a/rules/Makefile.am
++++ b/rules/Makefile.am
+@@ -22,6 +22,11 @@ dist_udevrules_DATA += \
+ 	80-net-name-slot.rules
+ endif
+ 
++if ENABLE_FIRMWARE
++dist_udevrules_DATA += \
++	50-firmware.rules
++endif
++
+ if HAVE_BLKID
+ dist_udevrules_DATA += \
+ 	60-persistent-storage.rules
+diff --git a/src/udev/Makefile.am b/src/udev/Makefile.am
+index 401af01..742fbc8 100644
+--- a/src/udev/Makefile.am
++++ b/src/udev/Makefile.am
+@@ -53,12 +53,18 @@ libudev_core_la_SOURCES = \
+ 	udev-ctrl.c \
+ 	udev-builtin.c \
+ 	udev-builtin-btrfs.c \
++	udev-builtin-firmware.c \
+ 	udev-builtin-hwdb.c \
+ 	udev-builtin-input_id.c \
+ 	udev-builtin-net_id.c \
+ 	udev-builtin-path_id.c \
+ 	udev-builtin-usb_id.c
+ 
++if ENABLE_FIRMWARE
++libudev_core_la_SOURCES += \
++	udev-builtin-firmware.c
++endif
++
+ include_HEADERS = \
+ 	udev.h
+ 
+@@ -86,6 +92,10 @@ libudev_core_la_LIBADD += \
+ 	$(KMOD_LIBS)
+ endif
+ 
++libudev_core_la_CPPFLAGS = \
++	$(AM_CPPFLAGS) \
++	-DFIRMWARE_PATH="$(FIRMWARE_PATH)"
++
+ #
+ # Extras
+ #
+diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c
+new file mode 100644
+index 0000000..bd8c2fb
+--- /dev/null
++++ b/src/udev/udev-builtin-firmware.c
+@@ -0,0 +1,154 @@
++/*
++ * firmware - Kernel firmware loader
++ *
++ * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
++ * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of the
++ * License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * General Public License for more details:*
++ */
++
++#include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++#include <getopt.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <sys/utsname.h>
++#include <sys/stat.h>
++
++#include "udev.h"
++
++static bool set_loading(struct udev *udev, char *loadpath, const char *state) {
++        FILE *ldfile;
++
++        ldfile = fopen(loadpath, "we");
++        if (ldfile == NULL) {
++                log_error("error: can not open '%s'", loadpath);
++                return false;
++        };
++        fprintf(ldfile, "%s\n", state);
++        fclose(ldfile);
++        return true;
++}
++
++static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) {
++        char *buf;
++        FILE *fsource = NULL, *ftarget = NULL;
++        bool ret = false;
++
++        buf = malloc(size);
++        if (buf == NULL) {
++                log_error("No memory available to load firmware file");
++                return false;
++        }
++
++        log_debug("writing '%s' (%zi) to '%s'", source, size, target);
++
++        fsource = fopen(source, "re");
++        if (fsource == NULL)
++                goto exit;
++        ftarget = fopen(target, "we");
++        if (ftarget == NULL)
++                goto exit;
++        if (fread(buf, size, 1, fsource) != 1)
++                goto exit;
++        if (fwrite(buf, size, 1, ftarget) == 1)
++                ret = true;
++exit:
++        if (ftarget != NULL)
++                fclose(ftarget);
++        if (fsource != NULL)
++                fclose(fsource);
++        free(buf);
++        return ret;
++}
++
++static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) {
++        struct udev *udev = udev_device_get_udev(dev);
++        static const char *searchpath[] = { FIRMWARE_PATH };
++        char loadpath[UTIL_PATH_SIZE];
++        char datapath[UTIL_PATH_SIZE];
++        char fwpath[UTIL_PATH_SIZE];
++        const char *firmware;
++        FILE *fwfile = NULL;
++        struct utsname kernel;
++        struct stat statbuf;
++        unsigned int i;
++        int rc = EXIT_SUCCESS;
++
++        firmware = udev_device_get_property_value(dev, "FIRMWARE");
++        if (firmware == NULL) {
++                log_error("firmware parameter missing");
++                rc = EXIT_FAILURE;
++                goto exit;
++        }
++
++        /* lookup firmware file */
++        uname(&kernel);
++        for (i = 0; i < ELEMENTSOF(searchpath); i++) {
++                strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL);
++                fwfile = fopen(fwpath, "re");
++                if (fwfile != NULL)
++                        break;
++
++                strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL);
++                fwfile = fopen(fwpath, "re");
++                if (fwfile != NULL)
++                        break;
++        }
++
++        strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
++
++        if (fwfile == NULL) {
++                log_debug("did not find firmware file '%s'", firmware);
++                rc = EXIT_FAILURE;
++                /*
++                 * Do not cancel the request in the initrd, the real root might have
++                 * the firmware file and the 'coldplug' run in the real root will find
++                 * this pending request and fulfill or cancel it.
++                 * */
++                if (!in_initrd())
++                        set_loading(udev, loadpath, "-1");
++                goto exit;
++        }
++
++        if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) {
++                if (!in_initrd())
++                        set_loading(udev, loadpath, "-1");
++                rc = EXIT_FAILURE;
++                goto exit;
++        }
++
++        if (!set_loading(udev, loadpath, "1"))
++                goto exit;
++
++        strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
++        if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
++                log_error("error sending firmware '%s' to device", firmware);
++                set_loading(udev, loadpath, "-1");
++                rc = EXIT_FAILURE;
++                goto exit;
++        };
++
++        set_loading(udev, loadpath, "0");
++exit:
++        if (fwfile)
++                fclose(fwfile);
++        return rc;
++}
++
++const struct udev_builtin udev_builtin_firmware = {
++        .name = "firmware",
++        .cmd = builtin_firmware,
++        .help = "kernel firmware loader",
++        .run_once = true,
++};
+diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
+index 74b3bdc..3657106 100644
+--- a/src/udev/udev-builtin.c
++++ b/src/udev/udev-builtin.c
+@@ -34,6 +34,9 @@ static const struct udev_builtin *builtins[] = {
+         [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
+ #endif
+         [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
++#ifdef HAVE_FIRMWARE
++        [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
++#endif
+         [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
+         [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
+         [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
+diff --git a/src/udev/udev.h b/src/udev/udev.h
+index 198cb2c..01a1e9c 100644
+--- a/src/udev/udev.h
++++ b/src/udev/udev.h
+@@ -149,6 +149,9 @@ enum udev_builtin_cmd {
+         UDEV_BUILTIN_BLKID,
+ #endif
+         UDEV_BUILTIN_BTRFS,
++#ifdef HAVE_FIRMWARE
++        UDEV_BUILTIN_FIRMWARE,
++#endif
+         UDEV_BUILTIN_HWDB,
+         UDEV_BUILTIN_INPUT_ID,
+         UDEV_BUILTIN_KEYBOARD,
+@@ -173,6 +176,9 @@ struct udev_builtin {
+ extern const struct udev_builtin udev_builtin_blkid;
+ #endif
+ extern const struct udev_builtin udev_builtin_btrfs;
++#ifdef HAVE_FIRMWARE
++extern const struct udev_builtin udev_builtin_firmware;
++#endif
+ extern const struct udev_builtin udev_builtin_hwdb;
+ extern const struct udev_builtin udev_builtin_input_id;
+ extern const struct udev_builtin udev_builtin_keyboard;
+diff --git a/src/udev/udevd.c b/src/udev/udevd.c
+index b1de97a..35655d8 100644
+--- a/src/udev/udevd.c
++++ b/src/udev/udevd.c
+@@ -101,6 +101,9 @@ struct event {
+         bool is_block;
+         usec_t start_usec;
+         bool warned;
++#ifdef HAVE_FIRMWARE
++        bool nodelay;
++#endif
+ };
+ 
+ static inline struct event *node_to_event(struct udev_list_node *node) {
+@@ -491,6 +494,10 @@ static int event_queue_insert(struct udev_device *dev) {
+         event->devnum = udev_device_get_devnum(dev);
+         event->is_block = streq("block", udev_device_get_subsystem(dev));
+         event->ifindex = udev_device_get_ifindex(dev);
++#ifdef HAVE_FIRMWARE
++        if (streq(udev_device_get_subsystem(dev), "firmware"))
++                event->nodelay = true;
++#endif
+ 
+         log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
+              udev_device_get_action(dev), udev_device_get_subsystem(dev));
+@@ -566,6 +573,12 @@ static bool is_devpath_busy(struct event *event) {
+                         return true;
+                 }
+ 
++#ifdef HAVE_FIRMWARE
++                /* allow to bypass the dependency tracking */
++                if (event->nodelay)
++                        continue;
++#endif
++
+                 /* parent device event found */
+                 if (event->devpath[common] == '/') {
+                         event->delaying_seqnum = loop_event->seqnum;
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/udev/eudev_3.2.1.bb b/import-layers/yocto-poky/meta/recipes-core/udev/eudev_3.2.1.bb
new file mode 100644
index 0000000..bdfb544
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/udev/eudev_3.2.1.bb
@@ -0,0 +1,106 @@
+SUMMARY = "eudev is a fork of systemd's udev"
+HOMEPAGE = "https://wiki.gentoo.org/wiki/Eudev"
+LICENSE = "GPLv2.0+ & LGPL-2.1+"
+LICENSE_libudev = "LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "glib-2.0 glib-2.0-native gperf-native kmod libxslt-native util-linux"
+
+PROVIDES = "udev"
+
+SRC_URI = "https://github.com/gentoo/${BPN}/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
+           file://0014-Revert-rules-remove-firmware-loading-rules.patch \
+           file://Revert-udev-remove-userspace-firmware-loading-suppor.patch \
+           file://devfs-udev.rules \
+           file://init \
+           file://links.conf \
+           file://local.rules \
+           file://permissions.rules \
+           file://run.rules \
+           file://udev-cache \
+           file://udev-cache.default \
+           file://udev.rules \
+"
+UPSTREAM_CHECK_URI = "https://github.com/gentoo/eudev/releases"
+
+SRC_URI[md5sum] = "a2aae16bc432eac0e71c1267c384e295"
+SRC_URI[sha256sum] = "88f530c1540750e6daa91b5eaeebf88e761e6f0c86515c1c28eedfd871f027c6"
+
+inherit autotools update-rc.d qemu pkgconfig
+
+EXTRA_OECONF = " \
+    --sbindir=${base_sbindir} \
+    --with-rootlibdir=${base_libdir} \
+    --with-rootprefix= \
+"
+
+PACKAGECONFIG ??= "hwdb"
+PACKAGECONFIG[hwdb] = "--enable-hwdb,--disable-hwdb"
+
+do_install_append() {
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
+	install -m 0755 ${WORKDIR}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
+	sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev
+	sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev-cache
+
+	install -d ${D}${sysconfdir}/default
+	install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache
+
+	touch ${D}${sysconfdir}/udev/cache.data
+
+	install -d ${D}${sysconfdir}/udev/rules.d
+	install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
+
+	# Use classic network interface naming scheme
+	touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
+
+	# hid2hci has moved to bluez4. removed in udev as of version 169
+	rm -f ${D}${base_libdir}/udev/hid2hci
+}
+
+INITSCRIPT_PACKAGES = "eudev udev-cache"
+INITSCRIPT_NAME_eudev = "udev"
+INITSCRIPT_PARAMS_eudev = "start 04 S ."
+INITSCRIPT_NAME_udev-cache = "udev-cache"
+INITSCRIPT_PARAMS_udev-cache = "start 36 S ."
+
+PACKAGES =+ "libudev"
+PACKAGES =+ "udev-cache"
+PACKAGES =+ "eudev-hwdb"
+
+
+FILES_${PN} += "${libexecdir} ${base_libdir}/udev ${bindir}/udevadm"
+FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \
+                   ${includedir}/libudev.h ${libdir}/libudev.so \
+                   ${includedir}/udev.h ${libdir}/libudev.la \
+                   ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc"
+FILES_libudev = "${base_libdir}/libudev.so.*"
+FILES_udev-cache = "${sysconfdir}/init.d/udev-cache ${sysconfdir}/default/udev-cache"
+FILES_eudev-hwdb = "${sysconfdir}/udev/hwdb.d"
+
+RDEPENDS_eudev-hwdb += "eudev"
+
+RRECOMMENDS_${PN} += "udev-cache"
+
+RPROVIDES_${PN} = "hotplug udev"
+RPROVIDES_eudev-hwdb += "udev-hwdb"
+
+python () {
+    if bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+        raise bb.parse.SkipPackage("'systemd' in DISTRO_FEATURES")
+}
+
+PACKAGE_WRITE_DEPS += "qemu-native"
+pkg_postinst_eudev-hwdb () {
+    if test -n "$D"; then
+        ${@qemu_run_binary(d, '$D', '${bindir}/udevadm')} hwdb --update --root $D
+        chown root:root $D${sysconfdir}/udev/hwdb.bin
+    else
+        udevadm hwdb --update
+    fi
+}
+
+pkg_prerm_eudev-hwdb () {
+        rm -f $D${sysconfdir}/udev/hwdb.bin
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/udev/eudev_3.2.bb b/import-layers/yocto-poky/meta/recipes-core/udev/eudev_3.2.bb
deleted file mode 100644
index 857d20d..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/udev/eudev_3.2.bb
+++ /dev/null
@@ -1,102 +0,0 @@
-SUMMARY = "eudev is a fork of systemd's udev"
-HOMEPAGE = "https://wiki.gentoo.org/wiki/Eudev"
-LICENSE = "GPLv2.0+ & LGPL-2.1+"
-LICENSE_libudev = "LGPL-2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-
-DEPENDS = "glib-2.0 glib-2.0-native gperf-native kmod libxslt-native util-linux"
-
-PROVIDES = "udev"
-
-SRC_URI = "https://github.com/gentoo/${BPN}/archive/v${PV}.tar.gz \
-           file://devfs-udev.rules \
-           file://init \
-           file://links.conf \
-           file://local.rules \
-           file://permissions.rules \
-           file://run.rules \
-           file://udev-cache \
-           file://udev-cache.default \
-           file://udev.rules \
-"
-UPSTREAM_CHECK_URI = "https://github.com/gentoo/eudev/releases"
-
-SRC_URI[md5sum] = "9eb477cc8718db272b5d24dff1126b04"
-SRC_URI[sha256sum] = "37829d37f4beb7e358ca33abc1ad0907d87f917ce157777aeaeebeacae24efdc"
-
-inherit autotools update-rc.d qemu pkgconfig
-
-EXTRA_OECONF = " \
-    --sbindir=${base_sbindir} \
-    --with-rootlibdir=${base_libdir} \
-    --with-rootprefix= \
-"
-
-PACKAGECONFIG ??= "hwdb"
-PACKAGECONFIG[hwdb] = "--enable-hwdb,--disable-hwdb"
-
-do_install_append() {
-	install -d ${D}${sysconfdir}/init.d
-	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
-	install -m 0755 ${WORKDIR}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
-	sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev
-	sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev-cache
-
-	install -d ${D}${sysconfdir}/default
-	install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache
-
-	touch ${D}${sysconfdir}/udev/cache.data
-
-	install -d ${D}${sysconfdir}/udev/rules.d
-	install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
-
-	# Use classic network interface naming scheme
-	touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
-
-	# hid2hci has moved to bluez4. removed in udev as of version 169
-	rm -f ${D}${base_libdir}/udev/hid2hci
-}
-
-INITSCRIPT_PACKAGES = "eudev udev-cache"
-INITSCRIPT_NAME_eudev = "udev"
-INITSCRIPT_PARAMS_eudev = "start 04 S ."
-INITSCRIPT_NAME_udev-cache = "udev-cache"
-INITSCRIPT_PARAMS_udev-cache = "start 36 S ."
-
-PACKAGES =+ "libudev"
-PACKAGES =+ "udev-cache"
-PACKAGES =+ "eudev-hwdb"
-
-
-FILES_${PN} += "${libexecdir} ${base_libdir}/udev ${bindir}/udevadm"
-FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \
-                   ${includedir}/libudev.h ${libdir}/libudev.so \
-                   ${includedir}/udev.h ${libdir}/libudev.la \
-                   ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc"
-FILES_libudev = "${base_libdir}/libudev.so.*"
-FILES_udev-cache = "${sysconfdir}/init.d/udev-cache ${sysconfdir}/default/udev-cache"
-FILES_eudev-hwdb = "${sysconfdir}/udev/hwdb.d"
-
-RDEPENDS_eudev-hwdb += "eudev"
-
-RRECOMMENDS_${PN} += "udev-cache"
-
-RPROVIDES_${PN} = "hotplug udev"
-
-python () {
-    if bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
-        raise bb.parse.SkipPackage("'systemd' in DISTRO_FEATURES")
-}
-
-pkg_postinst_eudev-hwdb () {
-    if test -n "$D"; then
-        ${@qemu_run_binary(d, '$D', '${bindir}/udevadm')} hwdb --update --root $D
-        chown root:root $D${sysconfdir}/udev/hwdb.bin
-    else
-        udevadm hwdb --update
-    fi
-}
-
-pkg_prerm_eudev-hwdb () {
-        rm -f $D${sysconfdir}/udev/hwdb.bin
-}
diff --git a/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf_1.1.bb b/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
index ecd4a8a..ae12550 100644
--- a/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
@@ -1,8 +1,7 @@
 SUMMARY = "Extra machine specific configuration files"
 DESCRIPTION = "Extra machine specific configuration files for udev, specifically blacklist information."
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 SRC_URI = " \
        file://automount.rules \
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux.inc b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux.inc
index 70cba6b..63302a9 100644
--- a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux.inc
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux.inc
@@ -29,9 +29,9 @@
 PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \
              util-linux-swaponoff util-linux-losetup util-linux-umount \
              util-linux-mount util-linux-readprofile util-linux-uuidd \
-             util-linux-uuidgen util-linux-lscpu util-linux-fsck util-linux-blkid \
-             util-linux-mkfs util-linux-mcookie util-linux-reset \
-             util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \
+             util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs util-linux-fsck \
+             util-linux-blkid util-linux-mkfs util-linux-mcookie util-linux-reset \
+             util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \
              util-linux-partx util-linux-hwclock util-linux-mountpoint \
              util-linux-findfs util-linux-getopt util-linux-sulogin util-linux-prlimit"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
@@ -52,7 +52,7 @@
 
 EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}"
 
-PACKAGECONFIG_class-target ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,"
 
 # Respect the systemd feature for uuidd
@@ -84,7 +84,7 @@
 FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
 FILES_util-linux-uuidd = "${sbindir}/uuidd"
-FILES_util-linux-reset = "${base_bindir}/reset"
+FILES_util-linux-reset = "${base_bindir}/reset*"
 FILES_util-linux-partx = "${sbindir}/partx"
 FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}"
 FILES_util-linux-findfs = "${sbindir}/findfs"
@@ -95,6 +95,7 @@
 FILES_util-linux-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
                                ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \
                                ${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*"
+FILES_util-linux-lsblk = "${bindir}/lsblk"
 FILES_util-linux-lscpu = "${bindir}/lscpu"
 
 FILES_util-linux-fsck = "${base_sbindir}/fsck*"
@@ -116,7 +117,7 @@
 
 RDEPENDS_util-linux-runuser += "libpam"
 
-RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin"
+RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk"
 RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser', '', d)}"
 
 RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint util-linux-prlimit"
@@ -150,7 +151,7 @@
 	mkdir -p ${D}${base_bindir}
 
         sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
-        sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root"
+        sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin"
         binprogs_a="dmesg getopt kill more umount mount login reset su mountpoint"
 
         if [ "${base_sbindir}" != "${sbindir}" ]; then
@@ -176,7 +177,7 @@
 
 	rm -f ${D}${bindir}/chkdupexe
 
-	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
 		install -d ${D}${sysconfdir}/pam.d
 		install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser
 		install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l
@@ -193,7 +194,7 @@
 
 ALTERNATIVE_${PN}  = "dmesg kill more mkswap blockdev pivot_root switch_root"
 ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall"
-ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject"
+ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject nologin"
 
 ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
 ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
@@ -203,8 +204,9 @@
 ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
 ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
 ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
-ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8 utmpdump.1 reset.1 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3"
+ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8 utmpdump.1 reset.1 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3 eject.1 logger.1"
 
 ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
 ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1"
@@ -221,6 +223,8 @@
 ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8"
 ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
 ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3"
+ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1"
+ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1"
 
 ALTERNATIVE_util-linux-hwclock = "hwclock"
 ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock"
@@ -270,7 +274,7 @@
 BBCLASSEXTEND = "native nativesdk"
 
 python do_package_prepend () {
-    if '--enable-su' in d.getVar('EXTRA_OECONF', True).split():
+    if '--enable-su' in d.getVar('EXTRA_OECONF').split():
         d.appendVar(d.expand('ALTERNATIVE_${PN}'), ' su')
         d.appendVar(d.expand('ALTERNATIVE_${PN}-doc'), ' su.1')
 
@@ -285,6 +289,7 @@
                       extra_depends='', prepend=True, allow_links=True)
 }
 
+RDEPENDS_${PN}-bash-completion += "util-linux-lsblk"
 RDEPENDS_${PN}-ptest = "bash grep coreutils"
 
 do_compile_ptest() {
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux_2.28.1.bb b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux_2.28.1.bb
deleted file mode 100644
index f232cb9..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux_2.28.1.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-MAJOR_VERSION = "2.28"
-require util-linux.inc
-
-# To support older hosts, we need to patch and/or revert
-# some upstream changes.  Only do this for native packages.
-OLDHOST = ""
-OLDHOST_class-native = "file://util-linux-native-qsort.patch"
-
-SRC_URI += "file://configure-sbindir.patch \
-            file://runuser.pamd \
-            file://runuser-l.pamd \
-            ${OLDHOST} \
-            file://ptest.patch \
-            file://run-ptest \
-            file://display_testname_for_subtest.patch \
-            file://avoid_parallel_tests.patch \
-            file://uuid-test-error-api.patch \
-"
-SRC_URI[md5sum] = "e2d863efaf4fd330a42c5efe9f1b02b4"
-SRC_URI[sha256sum] = "3ece4ea4a34ef786b68f5c415e848390424232abd1ee00f7ee5bddc30657b60f"
-
-CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms"
-
-EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF} \
-                             --disable-fallocate \
-			     --disable-use-tty-group \
-"
-EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \
-                                --disable-fallocate \
-				--disable-use-tty-group \
-"
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux_2.29.1.bb b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux_2.29.1.bb
new file mode 100644
index 0000000..1395b47
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux_2.29.1.bb
@@ -0,0 +1,31 @@
+MAJOR_VERSION = "2.29"
+require util-linux.inc
+
+# To support older hosts, we need to patch and/or revert
+# some upstream changes.  Only do this for native packages.
+OLDHOST = ""
+OLDHOST_class-native = "file://util-linux-native-qsort.patch"
+
+SRC_URI += "file://configure-sbindir.patch \
+            file://runuser.pamd \
+            file://runuser-l.pamd \
+            ${OLDHOST} \
+            file://ptest.patch \
+            file://run-ptest \
+            file://display_testname_for_subtest.patch \
+            file://avoid_parallel_tests.patch \
+            file://uuid-test-error-api.patch \
+"
+SRC_URI[md5sum] = "0cbb6d16ab9c5736e5649ef1264bee6e"
+SRC_URI[sha256sum] = "0ce40600b934ec2fecfa6bfc4efe6982d051ba96c2832b05201347aec582f54f"
+
+CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms"
+
+EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF} \
+                             --disable-fallocate \
+			     --disable-use-tty-group \
+"
+EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \
+                                --disable-fallocate \
+				--disable-use-tty-group \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb b/import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb
index 130ab55..a6e3254 100644
--- a/import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb
+++ b/import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb
@@ -49,7 +49,7 @@
             -e "s#@whatparent@#${spec%/*}#g; s#@whereparent@#${mountpoint%/*}#g" \
             volatile-binds.service.in >$servicefile
     done <<END
-${@d.getVar('VOLATILE_BINDS', True).replace("\\n", "\n")}
+${@d.getVar('VOLATILE_BINDS').replace("\\n", "\n")}
 END
 
     if [ -e var-volatile-lib.service ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.11/Makefile-runtests.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch
rename to import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.11/Makefile-runtests.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/ldflags-tests.patch b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.11/ldflags-tests.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/ldflags-tests.patch
rename to import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.11/ldflags-tests.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.11/remove.ldconfig.call.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch
rename to import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.11/remove.ldconfig.call.patch
diff --git a/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/run-ptest b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.11/run-ptest
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/run-ptest
rename to import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.11/run-ptest
diff --git a/import-layers/yocto-poky/meta/recipes-core/zlib/zlib_1.2.11.bb b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib_1.2.11.bb
new file mode 100644
index 0000000..ba216f6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib_1.2.11.bb
@@ -0,0 +1,62 @@
+SUMMARY = "Zlib Compression Library"
+DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \
+library which is used by many different programs."
+HOMEPAGE = "http://zlib.net/"
+SECTION = "libs"
+LICENSE = "Zlib"
+LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef63bc555f7aa6c0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
+           file://remove.ldconfig.call.patch \
+           file://Makefile-runtests.patch \
+           file://ldflags-tests.patch \
+           file://run-ptest \
+           "
+UPSTREAM_CHECK_URI = "http://zlib.net/"
+
+SRC_URI[md5sum] = "85adef240c5f370b308da8c938951a68"
+SRC_URI[sha256sum] = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066"
+
+CFLAGS += "-D_REENTRANT"
+
+RDEPENDS_${PN}-ptest += "make"
+
+inherit ptest
+
+do_configure() {
+	uname=GNU ./configure --prefix=${prefix} --shared --libdir=${libdir}
+}
+
+do_compile() {
+	oe_runmake shared
+}
+
+do_compile_ptest() {
+	oe_runmake test
+}
+
+do_install() {
+	oe_runmake DESTDIR=${D} install
+}
+
+do_install_ptest() {
+	install ${B}/Makefile   ${D}${PTEST_PATH}
+	install ${B}/example    ${D}${PTEST_PATH}
+	install ${B}/minigzip   ${D}${PTEST_PATH}
+	install ${B}/examplesh  ${D}${PTEST_PATH}
+	install ${B}/minigzipsh ${D}${PTEST_PATH}
+}
+
+# Move zlib shared libraries for target builds to $base_libdir so the library
+# can be used in early boot before $prefix is mounted.
+do_install_append_class-target() {
+	if [ ${base_libdir} != ${libdir} ]
+	then
+		mkdir -p ${D}/${base_libdir}
+		mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
+		libname=`readlink ${D}/${libdir}/libz.so`
+		ln -sf ${@oe.path.relative("${libdir}", "${base_libdir}")}/$libname ${D}${libdir}/libz.so
+	fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/zlib/zlib_1.2.8.bb b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib_1.2.8.bb
deleted file mode 100644
index 913c703..0000000
--- a/import-layers/yocto-poky/meta/recipes-core/zlib/zlib_1.2.8.bb
+++ /dev/null
@@ -1,59 +0,0 @@
-SUMMARY = "Zlib Compression Library"
-DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \
-library which is used by many different programs."
-HOMEPAGE = "http://zlib.net/"
-SECTION = "libs"
-LICENSE = "Zlib"
-LIC_FILES_CHKSUM = "file://zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
-           file://remove.ldconfig.call.patch \
-           file://Makefile-runtests.patch \
-           file://ldflags-tests.patch \
-           file://run-ptest \
-           "
-
-SRC_URI[md5sum] = "28f1205d8dd2001f26fec1e8c2cebe37"
-SRC_URI[sha256sum] = "831df043236df8e9a7667b9e3bb37e1fcb1220a0f163b6de2626774b9590d057"
-
-RDEPENDS_${PN}-ptest += "make"
-
-inherit ptest
-
-do_configure (){
-	./configure --prefix=${prefix} --shared --libdir=${libdir}
-}
-
-do_compile (){
-	oe_runmake
-}
-
-do_compile_ptest() {
-	oe_runmake static shared
-}
-
-do_install() {
-	oe_runmake DESTDIR=${D} install
-}
-
-do_install_ptest() {
-	install ${B}/Makefile   ${D}${PTEST_PATH}
-	install ${B}/example    ${D}${PTEST_PATH}
-	install ${B}/minigzip   ${D}${PTEST_PATH}
-	install ${B}/examplesh  ${D}${PTEST_PATH}
-	install ${B}/minigzipsh ${D}${PTEST_PATH}
-}
-
-# Move zlib shared libraries for target builds to $base_libdir so the library
-# can be used in early boot before $prefix is mounted.
-do_install_append_class-target() {
-	if [ ${base_libdir} != ${libdir} ]
-	then
-		mkdir -p ${D}/${base_libdir}
-		mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
-		libname=`readlink ${D}/${libdir}/libz.so`
-		ln -sf ${@oe.path.relative("${libdir}", "${base_libdir}")}/$libname ${D}${libdir}/libz.so
-	fi
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native.inc b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native.inc
index 9fa206e..68f1b3c 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native.inc
@@ -17,14 +17,14 @@
 }
 
 python do_install_config () {
-    indir = os.path.dirname(d.getVar('FILE', True))
+    indir = os.path.dirname(d.getVar('FILE'))
     infile = open(oe.path.join(indir, 'files', 'apt.conf'), 'r')
     data = infile.read()
     infile.close()
 
     data = d.expand(data)
 
-    outdir = oe.path.join(d.getVar('D', True), d.getVar('sysconfdir', True), 'apt')
+    outdir = oe.path.join(d.getVar('D'), d.getVar('sysconfdir'), 'apt')
     if not os.path.exists(outdir):
         os.makedirs(outdir)
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-package.inc b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-package.inc
index a553aa2..6a01f99 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-package.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-package.inc
@@ -32,13 +32,19 @@
 	       ${bindir}/apt-config ${bindir}/apt-cache \
 	       ${libdir}/apt ${libdir}/libapt*.so.* \
 	       ${localstatedir} ${sysconfdir} \
-	       ${libdir}/dpkg"
+	       ${libdir}/dpkg \
+	       ${systemd_unitdir}/system \
+           "
 FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
-FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages', True))} \
+FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages'))} \
 		   ${docdir}/apt"
-FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages', True))}"
+FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages'))}"
 FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
 
+inherit systemd
+
+SYSTEMD_SERVICE_${PN} = "apt-daily.timer"
+
 do_install () {
 	set -x
 	install -d ${D}${bindir}
@@ -75,4 +81,13 @@
 
 	install -d ${D}${includedir}/apt-pkg/
 	install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
+
+	install -d ${D}${systemd_unitdir}/system/
+	install -m 0644 ${S}/debian/apt.systemd.daily ${D}${libdir}/apt/
+	install -m 0644 ${S}/debian/apt-daily.service ${D}${systemd_unitdir}/system/
+	sed -i 's#/usr/lib/apt/#${libdir}/apt/#g' ${D}${systemd_unitdir}/system/apt-daily.service
+	install -m 0644 ${S}/debian/apt-daily.timer ${D}${systemd_unitdir}/system/
+	install -d ${D}${sysconfdir}/cron.daily/
+	install -m 0755 ${S}/debian/apt.apt-compat.cron.daily ${D}${sysconfdir}/cron.daily/
+	sed -i 's#/usr/lib/apt/#${libdir}/apt/#g' ${D}${sysconfdir}/cron.daily/apt.apt-compat.cron.daily
 }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc
index b4e3356..f1b2dfc 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc
@@ -27,13 +27,18 @@
 		  perl-module-data-dumper \
 		 "
 RDEPENDS_${PN}_class-native = "m4-native gnu-config-native"
+RDEPENDS_${PN}_class-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
 
 SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.gz \
 	   file://program_prefix.patch"
 
 inherit autotools texinfo
 
-CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl"
+PERL = "${USRBINPATH}/perl"
+PERL_class-native = "/usr/bin/env perl"
+PERL_class-nativesdk = "/usr/bin/env perl"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='${PERL}'"
 
 do_configure() {
 	oe_runconf
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/AC_HEADER_MAJOR-port-to-glibc-2.25.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/AC_HEADER_MAJOR-port-to-glibc-2.25.patch
new file mode 100644
index 0000000..fc37236
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/AC_HEADER_MAJOR-port-to-glibc-2.25.patch
@@ -0,0 +1,162 @@
+From e17a30e987d7ee695fb4294a82d987ec3dc9b974 Mon Sep 17 00:00:00 2001
+From: Eric Blake <eblake@redhat.com>
+Date: Wed, 14 Sep 2016 08:17:06 -0500
+Subject: [PATCH] AC_HEADER_MAJOR: port to glibc 2.25
+
+glibc 2.25 is deprecating the namespace pollution of <sys/types.h>
+injecting major(), minor(), and makedev() into the compilation
+environment, with a warning that insists that users include
+<sys/sysmacros.h> instead.  However, because the expansion of
+AC_HEADER_MAJOR didn't bother checking sys/sysmacros.h until
+after probing whether sys/types.h pollutes the namespace, it was
+not defining MAJOR_IN_SYSMACROS, with the result that code
+compiled with -Werror chokes on the deprecation warnings because
+it was not including sysmacros.h.
+
+In addition to fixing autoconf (which only benefits projects
+that rebuild configure after this fix is released), we can also
+give a hint to distros on how they can populate config.site with
+a cache variable to force pre-existing configure scripts without
+the updated macro to behave sanely in the presence of glibc 2.25
+(the documentation is especially useful since that cache variable
+is no longer present in autoconf after this patch).
+
+Note that mingw lacks major/minor/makedev in any of its standard
+headers; for that platform, the behavior of this macro is unchanged
+(code using the recommended include formula will get a compile error
+when trying to use major(), whether before or after this patch); but
+for now, it is assumed that programs actually concerned with
+creating devices are not worried about portability to mingw.  If
+desired, a later patch could tighten AC_HEADER_MAJOR to fail at
+configure time if the macros are unavailable in any of the three
+system headers, but that semantic change is not worth mixing into
+this patch.
+
+* lib/autoconf/headers.m4 (AC_HEADER_MAJOR): Drop check for
+major within sys/types.h; it interferes with the need to check
+sysmacros.h first.
+* doc/autoconf.texi (Particular Headers) <AC_HEADER_MAJOR>: Expand
+details on usage, and on workarounds for non-updated projects.
+
+Signed-off-by: Eric Blake <eblake@redhat.com>
+---
+Upstream-Status: Backport
+
+ doc/autoconf.texi       |   35 +++++++++++++++++++++++++++++++----
+ lib/autoconf/headers.m4 |   30 ++++++++++++++----------------
+ 2 files changed, 45 insertions(+), 20 deletions(-)
+
+Index: autoconf-2.69/doc/autoconf.texi
+===================================================================
+--- autoconf-2.69.orig/doc/autoconf.texi
++++ autoconf-2.69/doc/autoconf.texi
+@@ -15,7 +15,7 @@
+ @c The ARG is an optional argument.  To be used for macro arguments in
+ @c their documentation (@defmac).
+ @macro ovar{varname}
+-@r{[}@var{\varname\}@r{]}@c
++@r{[}@var{\varname\}@r{]}
+ @end macro
+ 
+ @c @dvar(ARG, DEFAULT)
+@@ -23,7 +23,7 @@
+ @c The ARG is an optional argument, defaulting to DEFAULT.  To be used
+ @c for macro arguments in their documentation (@defmac).
+ @macro dvar{varname, default}
+-@r{[}@var{\varname\} = @samp{\default\}@r{]}@c
++@r{[}@var{\varname\} = @samp{\default\}@r{]}
+ @end macro
+ 
+ @c Handling the indexes with Texinfo yields several different problems.
+@@ -5926,10 +5926,37 @@ Also see @code{AC_STRUCT_DIRENT_D_INO} a
+ @cvindex MAJOR_IN_SYSMACROS
+ @hdrindex{sys/mkdev.h}
+ @hdrindex{sys/sysmacros.h}
+-If @file{sys/types.h} does not define @code{major}, @code{minor}, and
+-@code{makedev}, but @file{sys/mkdev.h} does, define
+-@code{MAJOR_IN_MKDEV}; otherwise, if @file{sys/sysmacros.h} does, define
+-@code{MAJOR_IN_SYSMACROS}.
++Detect the headers required to use @code{makedev}, @code{major}, and
++@code{minor}.  These functions may be defined by @file{sys/mkdev.h},
++@code{sys/sysmacros.h}, or @file{sys/types.h}.
++
++@code{AC_HEADER_MAJOR} defines @code{MAJOR_IN_MKDEV} if they are in
++@file{sys/mkdev.h}, or @code{MAJOR_IN_SYSMACROS} if they are in
++@file{sys/sysmacros.h}.  If neither macro is defined, they are either in
++@file{sys/types.h} or unavailable.
++
++To properly use these functions, your code should contain something
++like:
++
++@verbatim
++#include <sys/types.h>
++#ifdef MAJOR_IN_MKDEV
++# include <sys/mkdev.h>
++#elif defined MAJOR_IN_SYSMACROS
++# include <sys/sysmacros.h>
++#endif
++@end verbatim
++
++Note: Configure scripts built with Autoconf 2.69 or earlier will not
++detect a problem if @file{sys/types.h} contains definitions of
++@code{major}, @code{minor}, and/or @code{makedev} that trigger compiler
++warnings upon use.  This is known to occur with GNU libc 2.25, where
++those definitions are being deprecated to reduce namespace pollution.
++If it is not practical to use Autoconf 2.70 to regenerate the configure
++script of affected software, you can work around the problem by setting
++@samp{ac_cv_header_sys_types_h_makedev=no}, as an argument to
++@command{configure} or as part of a @file{config.site} site default file
++(@pxref{Site Defaults}).
+ @end defmac
+ 
+ @defmac AC_HEADER_RESOLV
+Index: autoconf-2.69/lib/autoconf/headers.m4
+===================================================================
+--- autoconf-2.69.orig/lib/autoconf/headers.m4
++++ autoconf-2.69/lib/autoconf/headers.m4
+@@ -502,31 +502,29 @@ fi
+ 
+ # AC_HEADER_MAJOR
+ # ---------------
++# Thanks to glibc 2.25 deprecating macros in sys/types.h, coupled with
++# back-compat to autoconf 2.69, we need the following logic:
++# Check whether <sys/types.h> compiles.
++# If <sys/mkdev.h> compiles, assume it provides major/minor/makedev.
++# Otherwise, if <sys/sysmacros.h> compiles, assume it provides the macros.
++# Otherwise, either the macros were provided by <sys/types.h>, or do
++# not exist on the platform.  Code trying to use these three macros is
++# assumed to not care about platforms that lack the macros.
+ AN_FUNCTION([major],     [AC_HEADER_MAJOR])
+ AN_FUNCTION([makedev],   [AC_HEADER_MAJOR])
+ AN_FUNCTION([minor],     [AC_HEADER_MAJOR])
+ AN_HEADER([sys/mkdev.h], [AC_HEADER_MAJOR])
+ AC_DEFUN([AC_HEADER_MAJOR],
+-[AC_CACHE_CHECK(whether sys/types.h defines makedev,
+-		ac_cv_header_sys_types_h_makedev,
+-[AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <sys/types.h>]],
+-				 [[return makedev(0, 0);]])],
+-		[ac_cv_header_sys_types_h_makedev=yes],
+-		[ac_cv_header_sys_types_h_makedev=no])
+-])
+-
+-if test $ac_cv_header_sys_types_h_makedev = no; then
++[AC_CHECK_HEADERS_ONCE([sys/types.h])
+ AC_CHECK_HEADER(sys/mkdev.h,
+ 		[AC_DEFINE(MAJOR_IN_MKDEV, 1,
+ 			   [Define to 1 if `major', `minor', and `makedev' are
+ 			    declared in <mkdev.h>.])])
+-
+-  if test $ac_cv_header_sys_mkdev_h = no; then
+-    AC_CHECK_HEADER(sys/sysmacros.h,
+-		    [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
+-			       [Define to 1 if `major', `minor', and `makedev'
+-				are declared in <sysmacros.h>.])])
+-  fi
++if test $ac_cv_header_sys_mkdev_h = no; then
++  AC_CHECK_HEADER(sys/sysmacros.h,
++		  [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
++			     [Define to 1 if `major', `minor', and `makedev'
++			      are declared in <sysmacros.h>.])])
+ fi
+ ])# AC_HEADER_MAJOR
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch
new file mode 100644
index 0000000..ae0e382
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch
@@ -0,0 +1,120 @@
+From 236552ff5b9f1ebf666d8d0e9850007dcce03d26 Mon Sep 17 00:00:00 2001
+From: Serhii Popovych <spopovyc@cisco.com>
+Date: Wed, 10 Feb 2016 16:32:44 +0000
+Subject: [PATCH] perl: Replace -w option in shebangs with modern "use
+ warnings"
+
+In some builds we might provide ac_cv_path_PERL as /usr/bin/env perl
+to use newer version of the perl from users PATH rather than
+older from standard system path.
+
+However using /usr/bin/env perl -w from shebang line isn't
+possible because it translates to something like
+/usr/bin/env -w perl and env complains about illegal option.
+
+To address this we can remove -w option from perl shebang
+line and add "use warnings" statement.
+
+Upstream-Status: Pending
+Signed-off-by: Serhii Popovych <spopovyc@cisco.com>
+---
+ bin/autom4te.in                                          | 3 ++-
+ bin/autoreconf.in                                        | 3 ++-
+ bin/autoscan.in                                          | 3 ++-
+ bin/autoupdate.in                                        | 3 ++-
+ bin/ifnames.in                                           | 3 ++-
+ 5 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/bin/autom4te.in b/bin/autom4te.in
+index 11773c9..a8f5e41 100644
+--- a/bin/autom4te.in
++++ b/bin/autom4te.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ # -*- perl -*-
+ # @configure_input@
+ 
+@@ -42,6 +42,7 @@ use Autom4te::General;
+ use Autom4te::XFile;
+ use File::Basename;
+ use strict;
++use warnings;
+ 
+ # Data directory.
+ my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
+diff --git a/bin/autoreconf.in b/bin/autoreconf.in
+index e245db4..1a318cb 100644
+--- a/bin/autoreconf.in
++++ b/bin/autoreconf.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ # -*- perl -*-
+ # @configure_input@
+ 
+@@ -45,6 +45,7 @@ use Autom4te::XFile;
+ # Do not use Cwd::chdir, since it might hang.
+ use Cwd 'cwd';
+ use strict;
++use warnings;
+ 
+ ## ----------- ##
+ ## Variables.  ##
+diff --git a/bin/autoscan.in b/bin/autoscan.in
+index a67c48d..b931249 100644
+--- a/bin/autoscan.in
++++ b/bin/autoscan.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ # -*- perl -*-
+ # @configure_input@
+ 
+@@ -43,6 +43,7 @@ use Autom4te::XFile;
+ use File::Basename;
+ use File::Find;
+ use strict;
++use warnings;
+ 
+ use vars qw(@cfiles @makefiles @shfiles @subdirs %printed);
+ 
+diff --git a/bin/autoupdate.in b/bin/autoupdate.in
+index 9737d49..92cb147 100644
+--- a/bin/autoupdate.in
++++ b/bin/autoupdate.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ # -*- perl -*-
+ # @configure_input@
+ 
+@@ -44,6 +44,7 @@ use Autom4te::General;
+ use Autom4te::XFile;
+ use File::Basename;
+ use strict;
++use warnings;
+ 
+ # Lib files.
+ my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+diff --git a/bin/ifnames.in b/bin/ifnames.in
+index ba2cd05..74b0278 100644
+--- a/bin/ifnames.in
++++ b/bin/ifnames.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ # -*- perl -*-
+ # @configure_input@
+ 
+@@ -44,6 +44,7 @@ BEGIN
+ use Autom4te::General;
+ use Autom4te::XFile;
+ use Autom4te::FileUtils;
++use warnings;
+ 
+ # $HELP
+ # -----
+-- 
+2.3.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb
index aa1877a..8e67f4b 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb
@@ -14,6 +14,8 @@
             file://autotest-automake-result-format.patch \
             file://add_musl_config.patch \
             file://performance.patch \
+            file://AC_HEADER_MAJOR-port-to-glibc-2.25.patch \
+            file://autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch \
            "
 
 SRC_URI[md5sum] = "82d05e03b93e45f5a39b828dc9c6c29b"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.10.bb b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.10.bb
deleted file mode 100644
index 274427c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.10.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-SUMMARY = "Automated text and program generation tool"
-DESCRIPTION = "AutoGen is a tool designed to simplify the creation and\
- maintenance of programs that contain large amounts of repetitious text.\
- It is especially valuable in programs that have several blocks of text\
- that must be kept synchronized."
-HOMEPAGE = "http://www.gnu.org/software/autogen/"
-SECTION = "devel"
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-SRC_URI = "${GNU_MIRROR}/autogen/rel${PV}/autogen-${PV}.tar.gz \
-           file://increase-timeout-limit.patch \
-           file://mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch \
-           file://fix-script-err-when-processing-libguile.patch \
-"
-
-SRC_URI[md5sum] = "2d1b5226e1929d0680011df631289571"
-SRC_URI[sha256sum] = "0b8681d9724c481d3b726b5a9e81d3d09dc7f307d1a801c76d0a30d8f843d20a"
-
-UPSTREAM_CHECK_URI = "http://ftp.gnu.org/gnu/autogen/"
-UPSTREAM_CHECK_REGEX = "rel(?P<pver>\d+(\.\d+)+)/"
-
-DEPENDS = "guile-native libtool-native libxml2-native"
-
-inherit autotools texinfo native pkgconfig
-
-# autogen-native links against libguile which may have been relocated with sstate
-# these environment variables ensure there isn't a relocation issue
-export GUILE_LOAD_PATH = "${STAGING_DATADIR_NATIVE}/guile/2.0"
-export GUILE_LOAD_COMPILED_PATH = "${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache"
-
-do_install_append () {
-	create_wrapper ${D}/${bindir}/autogen \
-		GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
-		GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.12.bb b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.12.bb
new file mode 100644
index 0000000..853477c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.12.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Automated text and program generation tool"
+DESCRIPTION = "AutoGen is a tool designed to simplify the creation and\
+ maintenance of programs that contain large amounts of repetitious text.\
+ It is especially valuable in programs that have several blocks of text\
+ that must be kept synchronized."
+HOMEPAGE = "http://www.gnu.org/software/autogen/"
+SECTION = "devel"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/autogen/rel${PV}/autogen-${PV}.tar.gz \
+           file://increase-timeout-limit.patch \
+           file://mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch \
+           file://fix-script-err-when-processing-libguile.patch \
+           file://0001-config-libopts.m4-regenerate-it-from-config-libopts..patch \
+           file://0002-autoopts-mk-tpl-config.sh-fix-perl-path.patch \
+"
+
+SRC_URI[md5sum] = "551d15ccbf5b5fc5658da375d5003389"
+SRC_URI[sha256sum] = "805c20182f3cb0ebf1571d3b01972851c56fb34348dfdc38799fd0ec3b2badbe"
+
+UPSTREAM_CHECK_URI = "http://ftp.gnu.org/gnu/autogen/"
+UPSTREAM_CHECK_REGEX = "rel(?P<pver>\d+(\.\d+)+)/"
+
+DEPENDS = "guile-native libtool-native libxml2-native"
+
+inherit autotools texinfo native pkgconfig
+
+# autogen-native links against libguile which may have been relocated with sstate
+# these environment variables ensure there isn't a relocation issue
+export GUILE_LOAD_PATH = "${STAGING_DATADIR_NATIVE}/guile/2.0"
+export GUILE_LOAD_COMPILED_PATH = "${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache"
+
+export POSIX_SHELL = "/usr/bin/env sh"
+
+do_install_append () {
+	create_wrapper ${D}/${bindir}/autogen \
+		GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
+		GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/0001-config-libopts.m4-regenerate-it-from-config-libopts..patch b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/0001-config-libopts.m4-regenerate-it-from-config-libopts..patch
new file mode 100644
index 0000000..a14018e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/0001-config-libopts.m4-regenerate-it-from-config-libopts..patch
@@ -0,0 +1,39 @@
+From 45040e7d268329ebc40e6cb237c64a6637cfab5c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 13 Mar 2017 20:22:10 -0700
+Subject: [PATCH] config/libopts.m4: regenerate it from config/libopts.def
+
+It was out of date compared to config/libopts.def, so regenerate it via
+"autogen config/libopts.def" command.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ config/libopts.m4 | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/config/libopts.m4 b/config/libopts.m4
+index c7ba4f3..51e6a39 100644
+--- a/config/libopts.m4
++++ b/config/libopts.m4
+@@ -2,7 +2,7 @@ dnl  -*- buffer-read-only: t -*- vi: set ro:
+ dnl
+ dnl DO NOT EDIT THIS FILE   (libopts.m4)
+ dnl
+-dnl It has been AutoGen-ed
++dnl It has been AutoGen-ed  March 13, 2017 at 08:21:21 PM by AutoGen 5.18
+ dnl From the definitions    libopts.def
+ dnl and the template file   conftest.tpl
+ dnl
+@@ -114,6 +114,7 @@ AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
+   AC_PROG_SED
+   [while :
+   do
++      test -x "$POSIX_SHELL" && break
+       POSIX_SHELL=`which bash`
+       test -x "$POSIX_SHELL" && break
+       POSIX_SHELL=`which dash`
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/0002-autoopts-mk-tpl-config.sh-fix-perl-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/0002-autoopts-mk-tpl-config.sh-fix-perl-path.patch
new file mode 100644
index 0000000..d5fe143
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/0002-autoopts-mk-tpl-config.sh-fix-perl-path.patch
@@ -0,0 +1,32 @@
+From 9f69f3f5ef22bf1bcffb0e651efc260889cfaa46 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 13 Mar 2017 20:33:30 -0700
+Subject: [PATCH] autoopts/mk-tpl-config.sh: fix perl path
+
+Use "which perl" as shebang doesn't work when it is longer than
+BINPRM_BUF_SIZE which is 128 usually. So use "/usr/bin/env perl" to
+instead of.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ autoopts/mk-tpl-config.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/autoopts/mk-tpl-config.sh b/autoopts/mk-tpl-config.sh
+index 093e808..8dfc6dd 100755
+--- a/autoopts/mk-tpl-config.sh
++++ b/autoopts/mk-tpl-config.sh
+@@ -98,7 +98,7 @@ fix_scripts() {
+         st=`sed 1q $f`
+ 
+         case "$st" in
+-        *perl ) echo '#!' `which perl`
++        *perl ) echo '#!/usr/bin/env perl'
+                  sed 1d $f
+                  ;;
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc
index 4f9b5f7..87cedc9 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc
@@ -16,6 +16,6 @@
 	oe_runconf
 }
 
-export AUTOMAKE = "${@bb.utils.which('automake', d.getVar('PATH', True))}"
+export AUTOMAKE = "${@bb.utils.which('automake', d.getVar('PATH'))}"
 
 FILES_${PN} += "${datadir}/automake* ${datadir}/aclocal*"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch
new file mode 100644
index 0000000..64eb253
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch
@@ -0,0 +1,99 @@
+From 41e06b7a354774913dcd2e32a35440e407843357 Mon Sep 17 00:00:00 2001
+From: Serhii Popovych <spopovyc@cisco.com>
+Date: Wed, 10 Feb 2016 17:07:32 +0000
+Subject: [PATCH] perl: Replace -w option in shebangs with modern "use
+ warnings" In some builds we might provide ac_cv_path_PERL as /usr/bin/env
+ perl to use newer version of the perl from users PATH rather than older from
+ standard system path.
+
+However using /usr/bin/env perl -w from shebang line isn't
+possible because it translates to something like
+/usr/bin/env -w perl and env complains about illegal option.
+
+To address this we can remove -w option from perl shebang
+line and add "use warnings" statement.
+
+Upstream-Status: Pending
+Signed-off-by: Serhii Popovych <spopovyc@cisco.com>
+---
+ bin/aclocal.in     | 3 ++-
+ bin/automake.in    | 3 ++-
+ t/wrap/aclocal.in  | 3 ++-
+ t/wrap/automake.in | 3 ++-
+ 4 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/bin/aclocal.in b/bin/aclocal.in
+index 349f24a..50cb8d3 100644
+--- a/bin/aclocal.in
++++ b/bin/aclocal.in
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ # -*- perl -*-
+ # @configure_input@
+ 
+@@ -33,6 +33,7 @@ BEGIN
+ }
+ 
+ use strict;
++use warnings;
+ 
+ use Automake::Config;
+ use Automake::General;
+diff --git a/bin/automake.in b/bin/automake.in
+index eedc8bc..e0a01cf 100644
+--- a/bin/automake.in
++++ b/bin/automake.in
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ # -*- perl -*-
+ # @configure_input@
+ 
+@@ -28,6 +28,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
+ package Automake;
+ 
+ use strict;
++use warnings;
+ 
+ BEGIN
+ {
+diff --git a/t/wrap/aclocal.in b/t/wrap/aclocal.in
+index e64b546..9996899 100644
+--- a/t/wrap/aclocal.in
++++ b/t/wrap/aclocal.in
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ # @configure_input@
+ 
+ # Copyright (C) 2012-2014 Free Software Foundation, Inc.
+@@ -19,6 +19,7 @@
+ BEGIN
+ {
+   use strict;
++  use warnings;
+   @Aclocal::perl_libdirs = ('@abs_top_srcdir@/lib');
+   unshift @Aclocal::perl_libdirs, '@abs_top_builddir@/lib'
+     if '@srcdir@' ne '.';
+diff --git a/t/wrap/automake.in b/t/wrap/automake.in
+index 8b943b1..be61226 100644
+--- a/t/wrap/automake.in
++++ b/t/wrap/automake.in
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ # @configure_input@
+ 
+ # Copyright (C) 2012-2014 Free Software Foundation, Inc.
+@@ -19,6 +19,7 @@
+ BEGIN
+ {
+   use strict;
++  use warnings;
+   @Automake::perl_libdirs = ('@abs_top_srcdir@/lib');
+   unshift @Automake::perl_libdirs, '@abs_top_builddir@/lib'
+     if '@srcdir@' ne '.';
+-- 
+2.3.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb
index 61ae3ba..902dd63 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb
@@ -17,18 +17,24 @@
     perl-module-vars "
 
 RDEPENDS_${PN}_class-native = "autoconf-native hostperl-runtime-native"
+RDEPENDS_${PN}_class-nativesdk = "nativesdk-autoconf"
 
-SRC_URI += " file://python-libdir.patch \
+SRC_URI += "file://python-libdir.patch \
             file://buildtest.patch \
             file://performance.patch \
             file://new_rt_path_for_test-driver.patch \
+            file://automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch \
             file://0001-automake-port-to-Perl-5.22-and-later.patch \
             "
 
 SRC_URI[md5sum] = "716946a105ca228ab545fc37a70df3a3"
 SRC_URI[sha256sum] = "7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924"
 
-CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl"
+PERL = "${USRBINPATH}/perl"
+PERL_class-native = "${USRBINPATH}/env perl"
+PERL_class-nativesdk = "${USRBINPATH}/env perl"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='${PERL}'"
 
 do_install_append () {
     install -d ${D}${datadir}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.27.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.27.inc
deleted file mode 100644
index 0936d97..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.27.inc
+++ /dev/null
@@ -1,53 +0,0 @@
-LIC_FILES_CHKSUM="\
-    file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
-    file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\
-    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\
-    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\
-    file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\
-    file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
-    file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\
-    file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\
-    file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\
-    "
-
-def binutils_branch_version(d):
-    pvsplit = d.getVar('PV', True).split('.')
-    return pvsplit[0] + "_" + pvsplit[1]
-
-BINUPV = "${@binutils_branch_version(d)}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)"
-
-SRCREV = "5fe53ce37f9d9dd544ec8cc9e2863b68e1a61f4c"
-SRC_URI = "\
-     git://sourceware.org/git/binutils-gdb.git;branch=binutils-${BINUPV}-branch;protocol=git \
-     file://0002-configure-widen-the-regexp-for-SH-architectures.patch \
-     file://0003-Point-scripts-location-to-libdir.patch \
-     file://0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
-     file://0005-Explicitly-link-with-libm-on-uclibc.patch \
-     file://0006-Use-libtool-2.4.patch \
-     file://0007-Add-the-armv5e-architecture-to-binutils.patch \
-     file://0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \
-     file://0009-warn-for-uses-of-system-directories-when-cross-linki.patch \
-     file://0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
-     file://0011-Change-default-emulation-for-mips64-linux.patch \
-     file://0012-Add-support-for-Netlogic-XLP.patch \
-     file://0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
-     file://0014-libtool-remove-rpath.patch \
-     file://0015-binutils-mips-gas-pic-relax-linkonce.diff \
-     file://0015-Refine-.cfi_sections-check-to-only-consider-compact-.patch \
-     file://0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch \
-     file://0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch \
-     file://0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch \
-     file://CVE-2017-6965.patch \
-     file://CVE-2017-6966.patch \
-     file://CVE-2017-6969.patch \
-     file://CVE-2017-6969_2.patch \
-     file://CVE-2017-7209.patch \
-     file://CVE-2017-7210.patch \
-"
-S  = "${WORKDIR}/git"
-
-do_configure_prepend () {
-        rm -rf ${S}/gdb ${S}/libdecnumber ${S}/readline ${S}/sim
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.28.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.28.inc
new file mode 100644
index 0000000..1784c52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.28.inc
@@ -0,0 +1,85 @@
+LIC_FILES_CHKSUM="\
+    file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
+    file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\
+    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\
+    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\
+    file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\
+    file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
+    file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\
+    file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\
+    file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\
+    "
+
+def binutils_branch_version(d):
+    pvsplit = d.getVar('PV').split('.')
+    return pvsplit[0] + "_" + pvsplit[1]
+
+BINUPV = "${@binutils_branch_version(d)}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)"
+
+SRCREV = "354199c7692c1bed53a2a15f0e4d531457e95f17"
+SRC_URI = "\
+     git://sourceware.org/git/binutils-gdb.git;branch=binutils-${BINUPV}-branch;protocol=git \
+     file://0003-gprof-add-uclibc-support-to-configure.patch \
+     file://0004-Point-scripts-location-to-libdir.patch \
+     file://0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
+     file://0006-Explicitly-link-with-libm-on-uclibc.patch \
+     file://0007-Use-libtool-2.4.patch \
+     file://0008-Add-the-armv5e-architecture-to-binutils.patch \
+     file://0009-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \
+     file://0010-warn-for-uses-of-system-directories-when-cross-linki.patch \
+     file://0011-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
+     file://0012-Change-default-emulation-for-mips64-linux.patch \
+     file://0013-Add-support-for-Netlogic-XLP.patch \
+     file://0014-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
+     file://0015-sync-with-OE-libtool-changes.patch \
+     file://0016-Detect-64-bit-MIPS-targets.patch \
+     file://CVE-2017-6965.patch \
+     file://CVE-2017-6966.patch \
+     file://0017-bfd-Improve-lookup-of-file-line-information-for-erro.patch \
+     file://0018-PR-21409-segfault-in-_bfd_dwarf2_find_nearest_line.patch \
+     file://CVE-2017-6969.patch \
+     file://CVE-2017-6969_2.patch \
+     file://CVE-2017-7209.patch \
+     file://CVE-2017-7210.patch \
+     file://CVE-2017-7223.patch \
+     file://CVE-2017-7614.patch \
+     file://CVE-2017-8393.patch \
+     file://CVE-2017-8394.patch \
+     file://CVE-2017-8395.patch \
+     file://CVE-2017-8396_8397.patch \
+     file://CVE-2017-8398.patch \
+     file://CVE-2017-8421.patch \
+     file://CVE-2017-9038_9044.patch \
+     file://CVE-2017-9039.patch \
+     file://CVE-2017-9040_9042.patch \
+     file://CVE-2017-9742.patch \
+     file://CVE-2017-9744.patch \
+     file://CVE-2017-9745.patch \
+     file://CVE-2017-9746.patch \
+     file://CVE-2017-9747.patch \
+     file://CVE-2017-9748.patch \
+     file://CVE-2017-9749.patch \
+     file://CVE-2017-9750.patch \
+     file://CVE-2017-9751.patch \
+     file://CVE-2017-9752.patch \
+     file://CVE-2017-9753.patch \
+     file://CVE-2017-9755.patch \
+     file://CVE-2017-9756.patch \
+     file://CVE-2017-9954.patch \
+     file://CVE-2017-9955_1.patch \
+     file://CVE-2017-9955_2.patch \
+     file://CVE-2017-9955_3.patch \
+     file://CVE-2017-9955_4.patch \
+     file://CVE-2017-9955_5.patch \
+     file://CVE-2017-9955_6.patch \
+     file://CVE-2017-9955_7.patch \
+     file://CVE-2017-9955_8.patch \
+     file://CVE-2017-9955_9.patch \
+"
+S  = "${WORKDIR}/git"
+
+do_configure_prepend () {
+        rm -rf ${S}/gdb ${S}/libdecnumber ${S}/readline ${S}/sim
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
index ae14642..e98f31f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
@@ -6,12 +6,15 @@
 
 DEPENDS = "flex-native bison-native virtual/${HOST_PREFIX}gcc-crosssdk virtual/nativesdk-libc nativesdk-zlib nativesdk-gettext nativesdk-flex"
 EXTRA_OECONF += "--with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \
+                --enable-poison-system-directories \
                 "
 
 # We have to point binutils at a sysroot but we don't need to rebuild if this changes
 # e.g. we switch between different machines with different tunes.
 EXTRA_OECONF[vardepsexclude] = "TUNE_PKGARCH"
 
+LDGOLD_sdkmingw32 = ""
+
 do_install () {
 	autotools_do_install
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.27.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.28.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.27.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.28.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross.inc
index fd3d801..02ec891 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross.inc
@@ -4,12 +4,20 @@
 PN = "binutils-cross-${TARGET_ARCH}"
 BPN = "binutils"
 
+# Ignore how TARGET_ARCH is computed.
+TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}"
+
 INHIBIT_DEFAULT_DEPS = "1"
 INHIBIT_AUTOTOOLS_DEPS = "1"
 
+SRC_URI += "file://0002-binutils-cross-Do-not-generate-linker-script-directo.patch"
+
+# Specify lib-path else we use a load of search dirs which we don't use
+# and mean the linker scripts have to be relocated.
 EXTRA_OECONF += "--with-sysroot=${STAGING_DIR_TARGET} \
                 --disable-install-libbfd \
                 --enable-poison-system-directories \
+                --with-lib-path==${target_base_libdir}:=${target_libdir} \
                 "
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.27.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.28.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.27.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.28.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.27.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.27.bb
deleted file mode 100644
index 62c03d7..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.27.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require binutils-cross_${PV}.bb
-
-inherit crosssdk
-
-PN = "binutils-crosssdk-${SDK_SYS}"
-
-PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
-
-SRC_URI += "file://0001-Generate-relocatable-SDKs.patch"
-
-do_configure_prepend () {
-	sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.28.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.28.bb
new file mode 100644
index 0000000..37f4d6d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.28.bb
@@ -0,0 +1,13 @@
+require binutils-cross_${PV}.bb
+
+inherit crosssdk
+
+PN = "binutils-crosssdk-${SDK_SYS}"
+
+PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
+
+SRC_URI += "file://0001-binutils-crosssdk-Generate-relocatable-SDKs.patch"
+
+do_configure_prepend () {
+	sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils.inc
index 75d190f..37813dd 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils.inc
@@ -59,9 +59,9 @@
 "
 
 python do_package_prepend() {
-    make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or ""
-    prefix = d.getVar("TARGET_PREFIX", True)
-    bindir = d.getVar("bindir", True)
+    make_alts = d.getVar("USE_ALTERNATIVES_FOR") or ""
+    prefix = d.getVar("TARGET_PREFIX")
+    bindir = d.getVar("bindir")
     for alt in make_alts.split():
         d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt)
         d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt)
@@ -78,7 +78,7 @@
 
 LDGOLD_class-native = ""
 LDGOLD_class-crosssdk = ""
-LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default', d)}"
+LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default --enable-threads', d)}"
 
 # This is necessary due to a bug in the binutils Makefiles
 # EXTRA_OEMAKE = "configure-build-libiberty all"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch
deleted file mode 100644
index cad704a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 2dae6b137ce609fd008f2063034a4403d95484c5 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 2 Mar 2015 01:58:54 +0000
-Subject: [PATCH 01/13] Generate relocatable SDKs
-
-This patch will modify the ELF linker scripts so that the crosssdk
-linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries
-will be relocated, at SDK install time, the interpreter path can be easily
-changed by the relocating script.
-
-Upstream-Status: Inappropriate [SDK specific]
-
-Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- ld/genscripts.sh      | 3 +++
- ld/scripttempl/elf.sc | 4 ++--
- 2 files changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/ld/genscripts.sh b/ld/genscripts.sh
-index eb262e7..1a3b8bc 100755
---- a/ld/genscripts.sh
-+++ b/ld/genscripts.sh
-@@ -277,6 +277,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"
- LD_FLAG=r
- DATA_ALIGNMENT=${DATA_ALIGNMENT_r}
- DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
-+PARTIAL_LINKING=" "
- ( echo "/* Script for ld -r: link without relocation */"
-   . ${CUSTOMIZER_SCRIPT}
-   . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
-@@ -285,10 +286,12 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
- LD_FLAG=u
- DATA_ALIGNMENT=${DATA_ALIGNMENT_u}
- CONSTRUCTING=" "
-+PARTIAL_LINKING=" "
- ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */"
-   . ${CUSTOMIZER_SCRIPT}
-   . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
- ) | sed -e '/^ *$/d;s/[ 	]*$//' > ldscripts/${EMULATION_NAME}.xu
-+unset PARTIAL_LINKING
- 
- LD_FLAG=
- DATA_ALIGNMENT=${DATA_ALIGNMENT_}
-diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
-index f0c6439..223c55f 100644
---- a/ld/scripttempl/elf.sc
-+++ b/ld/scripttempl/elf.sc
-@@ -136,8 +136,8 @@ if test -n "${COMMONPAGESIZE}"; then
-   DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
-   DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
- fi
--if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
--  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp) }"
-+if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}${PARTIAL_LINKING}"; then
-+  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp); . = 0x1000; }"
- fi
- if test -z "$PLT"; then
-   IPLT=".iplt         ${RELOCATING-0} : { *(.iplt) }"
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch
new file mode 100644
index 0000000..8fb1b4e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch
@@ -0,0 +1,62 @@
+From 689d011688b5ff9481d4367bef3dea7a7b2867fb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:58:54 +0000
+Subject: [PATCH 01/15] binutils-crosssdk: Generate relocatable SDKs
+
+This patch will modify the ELF linker scripts so that the crosssdk
+linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries
+will be relocated, at SDK install time, the interpreter path can be easily
+changed by the relocating script.
+
+Upstream-Status: Inappropriate [SDK specific]
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/genscripts.sh      | 3 +++
+ ld/scripttempl/elf.sc | 4 ++--
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/ld/genscripts.sh b/ld/genscripts.sh
+index b6940d376d..a42c4d7a4b 100755
+--- a/ld/genscripts.sh
++++ b/ld/genscripts.sh
+@@ -277,6 +277,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"
+ LD_FLAG=r
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_r}
+ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
++PARTIAL_LINKING=" "
+ ( echo "/* Script for ld -r: link without relocation */"
+   . ${CUSTOMIZER_SCRIPT}
+   . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+@@ -285,10 +286,12 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
+ LD_FLAG=u
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_u}
+ CONSTRUCTING=" "
++PARTIAL_LINKING=" "
+ ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */"
+   . ${CUSTOMIZER_SCRIPT}
+   . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ 	]*$//' > ldscripts/${EMULATION_NAME}.xu
++unset PARTIAL_LINKING
+ 
+ LD_FLAG=
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_}
+diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
+index e65f9a3ccf..d99d2c1d2a 100644
+--- a/ld/scripttempl/elf.sc
++++ b/ld/scripttempl/elf.sc
+@@ -138,8 +138,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then
+     DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
+   fi
+ fi
+-if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
+-  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp) }"
++if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}${PARTIAL_LINKING}"; then
++  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp); . = 0x1000; }"
+ fi
+ if test -z "$PLT"; then
+   IPLT=".iplt         ${RELOCATING-0} : { *(.iplt) }"
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch
deleted file mode 100644
index d82a0b6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 8941017bc0226b60ce306d5271df15820ce66a53 Mon Sep 17 00:00:00 2001
-From: Alan Modra <amodra@gmail.com>
-Date: Tue, 30 Aug 2016 20:57:32 +0930
-Subject: [PATCH] ppc apuinfo for spe parsed incorrectly
-Organization: O.S. Systems Software LTDA.
-
-apuinfo saying SPE resulted in mach = bfd_mach_ppc_vle due to a
-missing break.
-
-	PR 20531
-	* elf32-ppc.c (_bfd_elf_ppc_set_arch): Add missing "break".
-
-
-Backport from :
-https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=8941017b
-
-Upstream-Status: Backport
-Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
----
- bfd/elf32-ppc.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
-index 95ce1dc..e42ef1c 100644
---- a/bfd/elf32-ppc.c
-+++ b/bfd/elf32-ppc.c
-@@ -2246,6 +2246,7 @@ _bfd_elf_ppc_set_arch (bfd *abfd)
- 		case PPC_APUINFO_BRLOCK:
- 		  if (mach != bfd_mach_ppc_vle)
- 		    mach = bfd_mach_ppc_e500;
-+		  break;
- 
- 		case PPC_APUINFO_VLE:
- 		  mach = bfd_mach_ppc_vle;
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch
new file mode 100644
index 0000000..14299fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch
@@ -0,0 +1,61 @@
+From 7c7de107b4b0a507d2aeca3e3a86d01cb4b51360 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Mar 2017 23:37:05 -0800
+Subject: [PATCH 02/15] binutils-cross: Do not generate linker script
+ directories
+
+We don't place target libraries within ${exec_prefix}, we'd always place these
+within the target sysroot within the standard library directories. Worse, the
+append_to_lib_path code prefixes these paths with the sysroot which makes even
+less sense.
+
+These directories therefore don't make sense in our case and mean we have to
+relocate all the linker scripts if they're present. Dropping them
+gives a reasonable performance improvement/simplification.
+
+Upstream-Status: Inappropriate
+
+RP 2017/01/30
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/genscripts.sh | 23 -----------------------
+ 1 file changed, 23 deletions(-)
+
+diff --git a/ld/genscripts.sh b/ld/genscripts.sh
+index a42c4d7a4b..d727b4d07e 100755
+--- a/ld/genscripts.sh
++++ b/ld/genscripts.sh
+@@ -189,29 +189,6 @@ append_to_lib_path()
+   fi
+ }
+ 
+-# Always search $(tooldir)/lib, aka /usr/local/TARGET/lib when native
+-# except when LIBPATH=":".
+-if [ "${LIB_PATH}" != ":" ] ; then
+-  libs=
+-  if [ "x${TOOL_LIB}" = "x" ] ; then
+-    if [ "x${NATIVE}" = "xyes" ] ; then
+-      libs="${exec_prefix}/${target_alias}/lib"
+-    fi
+-  else
+-    # For multilib'ed targets, ensure both ${target_alias}/lib${LIBPATH_SUFFIX}
+-    # and ${TOOL_LIB}/lib${LIBPATH_SUFFIX} are in the default search path,
+-    # because 64bit libraries may be in both places, depending on
+-    # cross-development setup method (e.g.: /usr/s390x-linux/lib64
+-    # vs. /usr/s390-linux/lib64)
+-    case "${NATIVE}:${LIBPATH_SUFFIX}:${TOOL_LIB}" in
+-      :* | *::* | *:*:*${LIBPATH_SUFFIX}) ;;
+-      *) libs="${exec_prefix}/${target_alias}/lib${LIBPATH_SUFFIX}" ;;
+-    esac
+-    libs="${exec_prefix}/${TOOL_LIB}/lib ${libs}"
+-  fi
+-  append_to_lib_path ${libs}
+-fi
+-
+ if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
+   libs=${NATIVE_LIB_DIRS}
+   if [ "x${NATIVE}" = "xyes" ] ; then
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch
deleted file mode 100644
index 8d7cf00..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From e4cd40722f597dff39c7214fab1742dd5bcc67eb Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 2 Mar 2015 01:07:33 +0000
-Subject: [PATCH 02/13] configure: widen the regexp for SH architectures
-
-gprof needs to know about uclibc
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- configure       | 4 ++--
- gprof/configure | 5 +++++
- 2 files changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/configure b/configure
-index ad3dfb7..2a74a77 100755
---- a/configure
-+++ b/configure
-@@ -3444,7 +3444,7 @@ case "${target}" in
-     ;;
-   s390-*-* | s390x-*-*)
-     ;;
--  sh-*-* | sh[34]*-*-*)
-+  sh*-*-* | sh[34]*-*-*)
-     ;;
-   sh64-*-* | sh5*-*-*)
-     ;;
-@@ -3946,7 +3946,7 @@ case "${target}" in
-   or1k*-*-*)
-     noconfigdirs="$noconfigdirs gdb"
-     ;;
--  sh-*-* | sh64-*-*)
-+  sh*-*-* | sh64-*-*)
-     case "${target}" in
-       sh*-*-elf)
-          ;;
-diff --git a/gprof/configure b/gprof/configure
-index bf3ecaa..626e1c7 100755
---- a/gprof/configure
-+++ b/gprof/configure
-@@ -5873,6 +5873,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch
deleted file mode 100644
index acc198b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 93c49f6197bd59b2abbf04b3296bf10029b80f48 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 2 Mar 2015 01:09:58 +0000
-Subject: [PATCH 03/13] Point scripts location to libdir
-
-Upstream-Status: Inappropriate [debian patch]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- ld/Makefile.am | 2 +-
- ld/Makefile.in | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/ld/Makefile.am b/ld/Makefile.am
-index 0598923..b478ba7 100644
---- a/ld/Makefile.am
-+++ b/ld/Makefile.am
-@@ -57,7 +57,7 @@ endif
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- 
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
-diff --git a/ld/Makefile.in b/ld/Makefile.in
-index 7c78198..5eb67e0 100644
---- a/ld/Makefile.in
-+++ b/ld/Makefile.in
-@@ -451,7 +451,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- BASEDIR = $(srcdir)/..
- BFDDIR = $(BASEDIR)/bfd
- INCDIR = $(BASEDIR)/include
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-gprof-add-uclibc-support-to-configure.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-gprof-add-uclibc-support-to-configure.patch
new file mode 100644
index 0000000..eddb42b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-gprof-add-uclibc-support-to-configure.patch
@@ -0,0 +1,31 @@
+From 7893d2b24d0303bda3a0049846489619ffd1387b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:07:33 +0000
+Subject: [PATCH 03/15] gprof: add uclibc support to configure
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gprof/configure | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/gprof/configure b/gprof/configure
+index 9e6b8f3525..38a4c0b0e5 100755
+--- a/gprof/configure
++++ b/gprof/configure
+@@ -5874,6 +5874,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
++linux-uclibc*)
++  lt_cv_deplibs_check_method=pass_all
++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++  ;;
++
+ netbsd*)
+   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
deleted file mode 100644
index 28a17f3..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 4ff83779de8621715c6c2a79cf7ed8d74ff2d7c5 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 2 Mar 2015 01:27:17 +0000
-Subject: [PATCH 04/13] Only generate an RPATH entry if LD_RUN_PATH is not
- empty
-
-for cases where -rpath isn't specified. debian (#151024)
-
-Upstream-Status: Pending
-
-Signed-off-by: Chris Chimelis <chris@debian.org>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- ld/emultempl/elf32.em | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
-index 47fa549..f4c640e 100644
---- a/ld/emultempl/elf32.em
-+++ b/ld/emultempl/elf32.em
-@@ -1244,6 +1244,8 @@ fragment <<EOF
- 	      && command_line.rpath == NULL)
- 	    {
- 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
-+	      if ((lib_path) && (strlen (lib_path) == 0))
-+		  lib_path = NULL;
- 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
- 						      force))
- 		break;
-@@ -1525,6 +1527,8 @@ gld${EMULATION_NAME}_before_allocation (void)
-   rpath = command_line.rpath;
-   if (rpath == NULL)
-     rpath = (const char *) getenv ("LD_RUN_PATH");
-+  if ((rpath) && (strlen (rpath) == 0))
-+    rpath = NULL;
- 
-   for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
-     if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch
new file mode 100644
index 0000000..c6b9de7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch
@@ -0,0 +1,42 @@
+From e34650c50574a8a39d694567ed607a63006b6f99 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:09:58 +0000
+Subject: [PATCH 04/15] Point scripts location to libdir
+
+Upstream-Status: Inappropriate [debian patch]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/Makefile.am | 2 +-
+ ld/Makefile.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ld/Makefile.am b/ld/Makefile.am
+index 15beaa7021..bbf9c671d8 100644
+--- a/ld/Makefile.am
++++ b/ld/Makefile.am
+@@ -57,7 +57,7 @@ endif
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ 
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+diff --git a/ld/Makefile.in b/ld/Makefile.in
+index 042b690ed6..37e7b25e9a 100644
+--- a/ld/Makefile.in
++++ b/ld/Makefile.in
+@@ -452,7 +452,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ INCDIR = $(BASEDIR)/include
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch
deleted file mode 100644
index 331f782..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 18a7ae169e8d55ace683357d1de6b07e4fdf797a Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 2 Mar 2015 01:32:49 +0000
-Subject: [PATCH 05/13] Explicitly link with libm on uclibc
-
-Description:
-
-We do not need to have the libtool patch anymore for binutils after
-libtool has been updated upstream it include support for it. However
-for building gas natively on uclibc systems we have to link it with
--lm so that it picks up missing symbols.
-
-/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o):
-In function `floatformat_from_double':
-floatformat.c:(.text+0x1ec): undefined reference to `frexp'
-floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
-/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o):
-In function `floatformat_to_double':
-floatformat.c:(.text+0x38a): undefined reference to `ldexp'
-floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
-floatformat.c:(.text+0x43e): undefined reference to `ldexp'
-floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
-collect2: ld returned 1 exit status
-make[4]: *** [as-new] Error 1
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- gas/configure.tgt | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/gas/configure.tgt b/gas/configure.tgt
-index e2df659..1b9fd99 100644
---- a/gas/configure.tgt
-+++ b/gas/configure.tgt
-@@ -487,6 +487,12 @@ case ${generic_target} in
-   *-*-netware)				fmt=elf em=netware ;;
- esac
- 
-+case ${generic_target} in
-+  arm-*-*uclibc*)
-+    need_libm=yes
-+    ;;
-+esac
-+
- case ${cpu_type} in
-   aarch64 | alpha | arm | i386 | ia64 | microblaze | mips | ns32k | or1k | or1knd | pdp11 | ppc | sparc | z80 | z8k)
-     bfd_gas=yes
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
new file mode 100644
index 0000000..726f702
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
@@ -0,0 +1,41 @@
+From 42292f5533bca904f230a8e03ceee1f84ef0c4ec Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:27:17 +0000
+Subject: [PATCH 05/15] Only generate an RPATH entry if LD_RUN_PATH is not
+ empty
+
+for cases where -rpath isn't specified. debian (#151024)
+
+Upstream-Status: Pending
+
+Signed-off-by: Chris Chimelis <chris@debian.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/emultempl/elf32.em | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
+index 84adaef6df..ab8c74257e 100644
+--- a/ld/emultempl/elf32.em
++++ b/ld/emultempl/elf32.em
+@@ -1411,6 +1411,8 @@ fragment <<EOF
+ 	      && command_line.rpath == NULL)
+ 	    {
+ 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
++	      if ((lib_path) && (strlen (lib_path) == 0))
++		  lib_path = NULL;
+ 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
+ 						      force))
+ 		break;
+@@ -1692,6 +1694,8 @@ gld${EMULATION_NAME}_before_allocation (void)
+   rpath = command_line.rpath;
+   if (rpath == NULL)
+     rpath = (const char *) getenv ("LD_RUN_PATH");
++  if ((rpath) && (strlen (rpath) == 0))
++    rpath = NULL;
+ 
+   for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
+     if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Explicitly-link-with-libm-on-uclibc.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Explicitly-link-with-libm-on-uclibc.patch
new file mode 100644
index 0000000..9770ca7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Explicitly-link-with-libm-on-uclibc.patch
@@ -0,0 +1,52 @@
+From 6a46bf151d7e53df8b5e7645a2d241967688368a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:32:49 +0000
+Subject: [PATCH 06/15] Explicitly link with libm on uclibc
+
+Description:
+
+We do not need to have the libtool patch anymore for binutils after
+libtool has been updated upstream it include support for it. However
+for building gas natively on uclibc systems we have to link it with
+-lm so that it picks up missing symbols.
+
+/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o):
+In function `floatformat_from_double':
+floatformat.c:(.text+0x1ec): undefined reference to `frexp'
+floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
+/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o):
+In function `floatformat_to_double':
+floatformat.c:(.text+0x38a): undefined reference to `ldexp'
+floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
+floatformat.c:(.text+0x43e): undefined reference to `ldexp'
+floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
+collect2: ld returned 1 exit status
+make[4]: *** [as-new] Error 1
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gas/configure.tgt | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gas/configure.tgt b/gas/configure.tgt
+index 711d537e95..7cd2dc176a 100644
+--- a/gas/configure.tgt
++++ b/gas/configure.tgt
+@@ -494,6 +494,12 @@ case ${generic_target} in
+   *-*-netware)				fmt=elf em=netware ;;
+ esac
+ 
++case ${generic_target} in
++  arm-*-*uclibc*)
++    need_libm=yes
++    ;;
++esac
++
+ case ${cpu_type} in
+   aarch64 | alpha | arm | i386 | ia64 | microblaze | mips | ns32k | or1k | or1knd | pdp11 | ppc | riscv | sparc | z80 | z8k)
+     bfd_gas=yes
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch
deleted file mode 100644
index f0fdf46..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch
+++ /dev/null
@@ -1,21177 +0,0 @@
-From 71adcde3648db47f7fa155db12810591ffd3ae34 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 14 Feb 2016 17:04:07 +0000
-Subject: [PATCH 06/13] Use libtool 2.4
-
-get libtool sysroot support
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- bfd/configure        | 1318 +++++++++++++++++------
- bfd/configure.ac     |    2 +-
- binutils/configure   | 1316 +++++++++++++++++------
- configure            |    4 +-
- gas/configure        | 1314 +++++++++++++++++------
- gprof/configure      | 1321 +++++++++++++++++------
- ld/configure         | 1691 +++++++++++++++++++++--------
- libtool.m4           | 1080 +++++++++++++------
- ltmain.sh            | 2925 +++++++++++++++++++++++++++++++++-----------------
- ltoptions.m4         |    2 +-
- ltversion.m4         |   12 +-
- lt~obsolete.m4       |    2 +-
- opcodes/configure    | 1318 +++++++++++++++++------
- opcodes/configure.ac |    2 +-
- zlib/configure       | 1320 +++++++++++++++++------
- 15 files changed, 9930 insertions(+), 3697 deletions(-)
-
-diff --git a/bfd/configure b/bfd/configure
-index a437569..575a257 100755
---- a/bfd/configure
-+++ b/bfd/configure
-@@ -671,6 +671,9 @@ OTOOL
- LIPO
- NMEDIT
- DSYMUTIL
-+MANIFEST_TOOL
-+ac_ct_AR
-+DLLTOOL
- OBJDUMP
- LN_S
- NM
-@@ -784,6 +787,7 @@ enable_static
- with_pic
- enable_fast_install
- with_gnu_ld
-+with_libtool_sysroot
- enable_libtool_lock
- enable_plugins
- enable_largefile
-@@ -1460,6 +1464,8 @@ Optional Packages:
-   --with-pic              try to use only PIC/non-PIC objects [default=use
-                           both]
-   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-+  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
-+                        (or the compiler's sysroot if not specified).
-   --with-mmap             try using mmap for BFD input files if available
-   --with-separate-debug-dir=DIR
-                           Look for global separate debug info in DIR
-@@ -5392,8 +5398,8 @@ esac
- 
- 
- 
--macro_version='2.2.7a'
--macro_revision='1.3134'
-+macro_version='2.4'
-+macro_revision='1.3293'
- 
- 
- 
-@@ -5433,7 +5439,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
- $as_echo_n "checking how to print strings... " >&6; }
- # Test print first, because it will be a builtin if present.
--if test "X`print -r -- -n 2>/dev/null`" = X-n && \
-+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-   ECHO='print -r --'
- elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-@@ -6119,8 +6125,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
- # Try some XSI features
- xsi_shell=no
- ( _lt_dummy="a/b/c"
--  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
--      = c,a/b,, \
-+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-+      = c,a/b,b/c, \
-     && eval 'test $(( 1 + 1 )) -eq 2 \
-     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-   && xsi_shell=yes
-@@ -6169,6 +6175,80 @@ esac
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-+if test "${lt_cv_to_host_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-+        ;;
-+    esac
-+    ;;
-+  *-*-cygwin* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_noop
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-+        ;;
-+    esac
-+    ;;
-+  * ) # unhandled hosts (and "normal" native builds)
-+    lt_cv_to_host_file_cmd=func_convert_file_noop
-+    ;;
-+esac
-+
-+fi
-+
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-+if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  #assume ordinary cross tools, or native build.
-+lt_cv_to_tool_file_cmd=func_convert_file_noop
-+case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+    esac
-+    ;;
-+esac
-+
-+fi
-+
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-+
-+
-+
-+
-+
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
- $as_echo_n "checking for $LD option to reload object files... " >&6; }
- if test "${lt_cv_ld_reload_flag+set}" = set; then :
-@@ -6185,6 +6265,11 @@ case $reload_flag in
- esac
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- case $host_os in
-+  cygwin* | mingw* | pw32* | cegcc*)
-+    if test "$GCC" != yes; then
-+      reload_cmds=false
-+    fi
-+    ;;
-   darwin*)
-     if test "$GCC" = yes; then
-       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-@@ -6353,7 +6438,8 @@ mingw* | pw32*)
-     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-     lt_cv_file_magic_cmd='func_win32_libid'
-   else
--    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-+    # Keep this pattern in sync with the one in func_win32_libid.
-+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-     lt_cv_file_magic_cmd='$OBJDUMP -f'
-   fi
-   ;;
-@@ -6507,6 +6593,21 @@ esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
- $as_echo "$lt_cv_deplibs_check_method" >&6; }
-+
-+file_magic_glob=
-+want_nocaseglob=no
-+if test "$build" = "$host"; then
-+  case $host_os in
-+  mingw* | pw32*)
-+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-+      want_nocaseglob=yes
-+    else
-+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
-+    fi
-+    ;;
-+  esac
-+fi
-+
- file_magic_cmd=$lt_cv_file_magic_cmd
- deplibs_check_method=$lt_cv_deplibs_check_method
- test -z "$deplibs_check_method" && deplibs_check_method=unknown
-@@ -6522,9 +6623,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
- 
- 
- 
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
- if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
--set dummy ${ac_tool_prefix}ar; ac_word=$2
-+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$DLLTOOL"; then
-+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+DLLTOOL=$ac_cv_prog_DLLTOOL
-+if test -n "$DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-+$as_echo "$DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_DLLTOOL"; then
-+  ac_ct_DLLTOOL=$DLLTOOL
-+  # Extract the first word of "dlltool", so it can be a program name with args.
-+set dummy dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_DLLTOOL"; then
-+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-+if test -n "$ac_ct_DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-+$as_echo "$ac_ct_DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_DLLTOOL" = x; then
-+    DLLTOOL="false"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    DLLTOOL=$ac_ct_DLLTOOL
-+  fi
-+else
-+  DLLTOOL="$ac_cv_prog_DLLTOOL"
-+fi
-+
-+test -z "$DLLTOOL" && DLLTOOL=dlltool
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-+if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_sharedlib_from_linklib_cmd='unknown'
-+
-+case $host_os in
-+cygwin* | mingw* | pw32* | cegcc*)
-+  # two different shell functions defined in ltmain.sh
-+  # decide which to use based on capabilities of $DLLTOOL
-+  case `$DLLTOOL --help 2>&1` in
-+  *--identify-strict*)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-+    ;;
-+  *)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-+    ;;
-+  esac
-+  ;;
-+*)
-+  # fallback: assume linklib IS sharedlib
-+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-+  ;;
-+esac
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-+
-+
-+
-+
-+
-+
-+
-+if test -n "$ac_tool_prefix"; then
-+  for ac_prog in ar
-+  do
-+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_AR+set}" = set; then :
-@@ -6540,7 +6794,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_AR="${ac_tool_prefix}ar"
-+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6560,11 +6814,15 @@ $as_echo "no" >&6; }
- fi
- 
- 
-+    test -n "$AR" && break
-+  done
- fi
--if test -z "$ac_cv_prog_AR"; then
-+if test -z "$AR"; then
-   ac_ct_AR=$AR
--  # Extract the first word of "ar", so it can be a program name with args.
--set dummy ar; ac_word=$2
-+  for ac_prog in ar
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
-@@ -6580,7 +6838,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_ac_ct_AR="ar"
-+    ac_cv_prog_ac_ct_AR="$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6599,6 +6857,10 @@ else
- $as_echo "no" >&6; }
- fi
- 
-+
-+  test -n "$ac_ct_AR" && break
-+done
-+
-   if test "x$ac_ct_AR" = x; then
-     AR="false"
-   else
-@@ -6610,16 +6872,72 @@ ac_tool_warned=yes ;;
- esac
-     AR=$ac_ct_AR
-   fi
--else
--  AR="$ac_cv_prog_AR"
- fi
- 
--test -z "$AR" && AR=ar
--test -z "$AR_FLAGS" && AR_FLAGS=cru
-+: ${AR=ar}
-+: ${AR_FLAGS=cru}
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-+$as_echo_n "checking for archiver @FILE support... " >&6; }
-+if test "${lt_cv_ar_at_file+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_ar_at_file=no
-+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
- 
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+  echo conftest.$ac_objext > conftest.lst
-+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
-+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+      if test "$ac_status" -eq 0; then
-+	# Ensure the archiver fails upon bogus file names.
-+	rm -f conftest.$ac_objext libconftest.a
-+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+	if test "$ac_status" -ne 0; then
-+          lt_cv_ar_at_file=@
-+        fi
-+      fi
-+      rm -f conftest.* libconftest.a
- 
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- 
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-+$as_echo "$lt_cv_ar_at_file" >&6; }
- 
-+if test "x$lt_cv_ar_at_file" = xno; then
-+  archiver_list_spec=
-+else
-+  archiver_list_spec=$lt_cv_ar_at_file
-+fi
- 
- 
- 
-@@ -6961,8 +7279,8 @@ esac
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- 
- # Transform an extracted symbol line into symbol name and symbol address
--lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
--lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
- 
- # Handle CRLF in mingw tool chain
- opt_cr=
-@@ -6998,6 +7316,7 @@ for ac_symprfx in "" "_"; do
-   else
-     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-   fi
-+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
- 
-   # Check to see that the pipe works correctly.
-   pipe_works=no
-@@ -7039,6 +7358,18 @@ _LT_EOF
-       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- 	  cat <<_LT_EOF > conftest.$ac_ext
-+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-+/* DATA imports from DLLs on WIN32 con't be const, because runtime
-+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-+# define LT_DLSYM_CONST
-+#elif defined(__osf__)
-+/* This system does not cope well with relocations in const data.  */
-+# define LT_DLSYM_CONST
-+#else
-+# define LT_DLSYM_CONST const
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -7050,7 +7381,7 @@ _LT_EOF
- 	  cat <<_LT_EOF >> conftest.$ac_ext
- 
- /* The mapping between symbol names and symbols.  */
--const struct {
-+LT_DLSYM_CONST struct {
-   const char *name;
-   void       *address;
- }
-@@ -7076,8 +7407,8 @@ static const void *lt_preloaded_setup() {
- _LT_EOF
- 	  # Now try linking the two files.
- 	  mv conftest.$ac_objext conftstm.$ac_objext
--	  lt_save_LIBS="$LIBS"
--	  lt_save_CFLAGS="$CFLAGS"
-+	  lt_globsym_save_LIBS=$LIBS
-+	  lt_globsym_save_CFLAGS=$CFLAGS
- 	  LIBS="conftstm.$ac_objext"
- 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-@@ -7087,8 +7418,8 @@ _LT_EOF
-   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
- 	    pipe_works=yes
- 	  fi
--	  LIBS="$lt_save_LIBS"
--	  CFLAGS="$lt_save_CFLAGS"
-+	  LIBS=$lt_globsym_save_LIBS
-+	  CFLAGS=$lt_globsym_save_CFLAGS
- 	else
- 	  echo "cannot find nm_test_func in $nlist" >&5
- 	fi
-@@ -7125,6 +7456,16 @@ else
- $as_echo "ok" >&6; }
- fi
- 
-+# Response file support.
-+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-+  nm_file_list_spec='@'
-+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
-+  nm_file_list_spec='@'
-+fi
-+
-+
-+
-+
- 
- 
- 
-@@ -7146,6 +7487,45 @@ fi
- 
- 
- 
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-+$as_echo_n "checking for sysroot... " >&6; }
-+
-+# Check whether --with-libtool-sysroot was given.
-+if test "${with_libtool_sysroot+set}" = set; then :
-+  withval=$with_libtool_sysroot;
-+else
-+  with_libtool_sysroot=no
-+fi
-+
-+
-+lt_sysroot=
-+case ${with_libtool_sysroot} in #(
-+ yes)
-+   if test "$GCC" = yes; then
-+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-+   fi
-+   ;; #(
-+ /*)
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
-+   ;; #(
-+ no|'')
-+   ;; #(
-+ *)
-+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
-+$as_echo "${with_libtool_sysroot}" >&6; }
-+   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
-+   ;;
-+esac
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-+$as_echo "${lt_sysroot:-no}" >&6; }
-+
-+
-+
-+
-+
- # Check whether --enable-libtool-lock was given.
- if test "${enable_libtool_lock+set}" = set; then :
-   enableval=$enable_libtool_lock;
-@@ -7352,6 +7732,123 @@ esac
- 
- need_locks="$enable_libtool_lock"
- 
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$MANIFEST_TOOL"; then
-+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-+if test -n "$MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-+$as_echo "$MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
-+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
-+  # Extract the first word of "mt", so it can be a program name with args.
-+set dummy mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-+if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
-+    MANIFEST_TOOL=":"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
-+  fi
-+else
-+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-+fi
-+
-+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-+if test "${lt_cv_path_mainfest_tool+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_path_mainfest_tool=no
-+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
-+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-+  cat conftest.err >&5
-+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-+    lt_cv_path_mainfest_tool=yes
-+  fi
-+  rm -f conftest*
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-+if test "x$lt_cv_path_mainfest_tool" != xyes; then
-+  MANIFEST_TOOL=:
-+fi
-+
-+
-+
-+
-+
- 
-   case $host_os in
-     rhapsody* | darwin*)
-@@ -7915,6 +8412,8 @@ _LT_EOF
-       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-       echo "$AR cru libconftest.a conftest.o" >&5
-       $AR cru libconftest.a conftest.o 2>&5
-+      echo "$RANLIB libconftest.a" >&5
-+      $RANLIB libconftest.a 2>&5
-       cat > conftest.c << _LT_EOF
- int main() { return 0;}
- _LT_EOF
-@@ -8079,7 +8578,8 @@ fi
- LIBTOOL_DEPS="$ltmain"
- 
- # Always use our own libtool.
--LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-+LIBTOOL='$(SHELL) $(top_builddir)'
-+LIBTOOL="$LIBTOOL/${host_alias}-libtool"
- 
- 
- 
-@@ -8168,7 +8668,7 @@ aix3*)
- esac
- 
- # Global variables:
--ofile=libtool
-+ofile=${host_alias}-libtool
- can_build_shared=yes
- 
- # All known linkers require a `.a' archive for static linking (except MSVC,
-@@ -8466,8 +8966,6 @@ fi
- lt_prog_compiler_pic=
- lt_prog_compiler_static=
- 
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
--$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 
-   if test "$GCC" = yes; then
-     lt_prog_compiler_wl='-Wl,'
-@@ -8633,6 +9131,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 	lt_prog_compiler_pic='--shared'
- 	lt_prog_compiler_static='--static'
- 	;;
-+      nagfor*)
-+	# NAG Fortran compiler
-+	lt_prog_compiler_wl='-Wl,-Wl,,'
-+	lt_prog_compiler_pic='-PIC'
-+	lt_prog_compiler_static='-Bstatic'
-+	;;
-       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-         # Portland Group compilers (*not* the Pentium gcc compiler,
- 	# which looks to be a dead project)
-@@ -8695,7 +9199,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-       lt_prog_compiler_pic='-KPIC'
-       lt_prog_compiler_static='-Bstatic'
-       case $cc_basename in
--      f77* | f90* | f95*)
-+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- 	lt_prog_compiler_wl='-Qoption ld ';;
-       *)
- 	lt_prog_compiler_wl='-Wl,';;
-@@ -8752,13 +9256,17 @@ case $host_os in
-     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-     ;;
- esac
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
--$as_echo "$lt_prog_compiler_pic" >&6; }
--
--
--
--
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-+if test "${lt_cv_prog_compiler_pic+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
- 
- #
- # Check to make sure the PIC flag actually works.
-@@ -8819,6 +9327,11 @@ fi
- 
- 
- 
-+
-+
-+
-+
-+
- #
- # Check to make sure the static flag actually works.
- #
-@@ -9169,7 +9682,8 @@ _LT_EOF
-       allow_undefined_flag=unsupported
-       always_export_symbols=no
-       enable_shared_with_static_runtimes=yes
--      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
- 
-       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-@@ -9268,12 +9782,12 @@ _LT_EOF
- 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- 	  hardcode_libdir_flag_spec=
- 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
--	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- 	  if test "x$supports_anon_versioning" = xyes; then
- 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- 	      echo "local: *; };" >> $output_objdir/$libname.ver~
--	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- 	  fi
- 	  ;;
- 	esac
-@@ -9287,8 +9801,8 @@ _LT_EOF
- 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- 	wlarc=
-       else
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       fi
-       ;;
- 
-@@ -9306,8 +9820,8 @@ _LT_EOF
- 
- _LT_EOF
-       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -9353,8 +9867,8 @@ _LT_EOF
- 
-     *)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -9484,7 +9998,13 @@ _LT_EOF
- 	allow_undefined_flag='-berok'
-         # Determine the default libpath from the value encoded in an
-         # empty executable.
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+        if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9497,22 +10017,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
-         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-@@ -9524,7 +10051,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	else
- 	 # Determine the default libpath from the value encoded in an
- 	 # empty executable.
--	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	 if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9537,22 +10070,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
- 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- 	  # Warning - without using the other run time loading flags,
-@@ -9597,20 +10137,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-       # Microsoft Visual C++.
-       # hardcode_libdir_flag_spec is actually meaningless, as there is
-       # no search path for DLLs.
--      hardcode_libdir_flag_spec=' '
--      allow_undefined_flag=unsupported
--      # Tell ltmain to make .lib files, not .a files.
--      libext=lib
--      # Tell ltmain to make .dll files, not .so files.
--      shrext_cmds=".dll"
--      # FIXME: Setting linknames here is a bad hack.
--      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
--      # The linker will automatically build a .lib file if we build a DLL.
--      old_archive_from_new_cmds='true'
--      # FIXME: Should let the user specify the lib program.
--      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
--      fix_srcfile_path='`cygpath -w "$srcfile"`'
--      enable_shared_with_static_runtimes=yes
-+      case $cc_basename in
-+      cl*)
-+	# Native MSVC
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	always_export_symbols=yes
-+	file_list_spec='@'
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-+	  else
-+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-+	  fi~
-+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-+	  linknames='
-+	# The linker will not automatically build a static lib if we build a DLL.
-+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
-+	enable_shared_with_static_runtimes=yes
-+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+	# Don't use ranlib
-+	old_postinstall_cmds='chmod 644 $oldlib'
-+	postlink_cmds='lt_outputfile="@OUTPUT@"~
-+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-+	  case $lt_outputfile in
-+	    *.exe|*.EXE) ;;
-+	    *)
-+	      lt_outputfile="$lt_outputfile.exe"
-+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-+	      ;;
-+	  esac~
-+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-+	    $RM "$lt_outputfile.manifest";
-+	  fi'
-+	;;
-+      *)
-+	# Assume MSVC wrapper
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-+	# The linker will automatically build a .lib file if we build a DLL.
-+	old_archive_from_new_cmds='true'
-+	# FIXME: Should let the user specify the lib program.
-+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-+	enable_shared_with_static_runtimes=yes
-+	;;
-+      esac
-       ;;
- 
-     darwin* | rhapsody*)
-@@ -9671,7 +10254,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-     freebsd* | dragonfly*)
--      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-       hardcode_direct=yes
-       hardcode_shlibpath_var=no
-@@ -9679,7 +10262,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux9*)
-       if test "$GCC" = yes; then
--	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       else
- 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       fi
-@@ -9695,7 +10278,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux10*)
-       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
--	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-       else
- 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-       fi
-@@ -9719,10 +10302,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	ia64*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	esac
-       else
-@@ -9801,23 +10384,36 @@ fi
- 
-     irix5* | irix6* | nonstopux*)
-       if test "$GCC" = yes; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	# Try to use the -exported_symbol ld option, if it does not
- 	# work, assume that -exports_file does not work either and
- 	# implicitly export all symbols.
--        save_LDFLAGS="$LDFLAGS"
--        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	# This should be the same for all languages, so no per-tag cache variable.
-+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-+if test "${lt_cv_irix_exported_symbol+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  save_LDFLAGS="$LDFLAGS"
-+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
--int foo(void) {}
-+int foo (void) { return 0; }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
--  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
--
-+  lt_cv_irix_exported_symbol=yes
-+else
-+  lt_cv_irix_exported_symbol=no
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--        LDFLAGS="$save_LDFLAGS"
-+           LDFLAGS="$save_LDFLAGS"
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
-+	if test "$lt_cv_irix_exported_symbol" = yes; then
-+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-+	fi
-       else
- 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-@@ -9902,7 +10498,7 @@ rm -f core conftest.err conftest.$ac_objext \
-     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-       if test "$GCC" = yes; then
- 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
--	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-       else
- 	allow_undefined_flag=' -expect_unresolved \*'
-@@ -9921,9 +10517,9 @@ rm -f core conftest.err conftest.$ac_objext \
-       no_undefined_flag=' -z defs'
-       if test "$GCC" = yes; then
- 	wlarc='${wl}'
--	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
--	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-       else
- 	case `$CC -V 2>&1` in
- 	*"Compilers 5.0"*)
-@@ -10499,8 +11095,9 @@ cygwin* | mingw* | pw32* | cegcc*)
-   need_version=no
-   need_lib_prefix=no
- 
--  case $GCC,$host_os in
--  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-+  case $GCC,$cc_basename in
-+  yes,*)
-+    # gcc
-     library_names_spec='$libname.dll.a'
-     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-     postinstall_cmds='base_file=`basename \${file}`~
-@@ -10533,13 +11130,71 @@ cygwin* | mingw* | pw32* | cegcc*)
-       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-       ;;
-     esac
-+    dynamic_linker='Win32 ld.exe'
-+    ;;
-+
-+  *,cl*)
-+    # Native MSVC
-+    libname_spec='$name'
-+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-+    library_names_spec='${libname}.dll.lib'
-+
-+    case $build_os in
-+    mingw*)
-+      sys_lib_search_path_spec=
-+      lt_save_ifs=$IFS
-+      IFS=';'
-+      for lt_path in $LIB
-+      do
-+        IFS=$lt_save_ifs
-+        # Let DOS variable expansion print the short 8.3 style file name.
-+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-+      done
-+      IFS=$lt_save_ifs
-+      # Convert to MSYS style.
-+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-+      ;;
-+    cygwin*)
-+      # Convert to unix form, then to dos form, then back to unix form
-+      # but this time dos style (no spaces!) so that the unix form looks
-+      # like /cygdrive/c/PROGRA~1:/cygdr...
-+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      ;;
-+    *)
-+      sys_lib_search_path_spec="$LIB"
-+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-+        # It is most probably a Windows format PATH.
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-+      else
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      fi
-+      # FIXME: find the short name or the path components, as spaces are
-+      # common. (e.g. "Program Files" -> "PROGRA~1")
-+      ;;
-+    esac
-+
-+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-+    postinstall_cmds='base_file=`basename \${file}`~
-+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-+      dldir=$destdir/`dirname \$dlpath`~
-+      test -d \$dldir || mkdir -p \$dldir~
-+      $install_prog $dir/$dlname \$dldir/$dlname'
-+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-+      dlpath=$dir/\$dldll~
-+       $RM \$dlpath'
-+    shlibpath_overrides_runpath=yes
-+    dynamic_linker='Win32 link.exe'
-     ;;
- 
-   *)
-+    # Assume MSVC wrapper
-     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-+    dynamic_linker='Win32 ld.exe'
-     ;;
-   esac
--  dynamic_linker='Win32 ld.exe'
-   # FIXME: first we should search . and the directory the executable is in
-   shlibpath_var=PATH
-   ;;
-@@ -10631,7 +11286,7 @@ haiku*)
-   soname_spec='${libname}${release}${shared_ext}$major'
-   shlibpath_var=LIBRARY_PATH
-   shlibpath_overrides_runpath=yes
--  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-   hardcode_into_libs=yes
-   ;;
- 
-@@ -11471,10 +12126,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -11577,10 +12232,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -14078,7 +14733,7 @@ SHARED_LDFLAGS=
- if test "$enable_shared" = "yes"; then
-   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
-   if test -n "$x"; then
--    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
-+    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
-   fi
- 
- # More hacks to build DLLs on Windows.
-@@ -16789,13 +17444,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
- lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
- lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
- lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
- reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
- reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
- OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
- deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
- file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
- AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
- AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
- STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
- RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
- old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-@@ -16810,14 +17472,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
- lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
- objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
- MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
--lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
- lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
- need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
- DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
- NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
- LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-@@ -16850,12 +17515,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
- hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
- inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
- link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
--fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
- always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
- export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
- exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
- include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
- prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
- file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
- variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
- need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-@@ -16910,8 +17575,13 @@ reload_flag \
- OBJDUMP \
- deplibs_check_method \
- file_magic_cmd \
-+file_magic_glob \
-+want_nocaseglob \
-+DLLTOOL \
-+sharedlib_from_linklib_cmd \
- AR \
- AR_FLAGS \
-+archiver_list_spec \
- STRIP \
- RANLIB \
- CC \
-@@ -16921,12 +17591,14 @@ lt_cv_sys_global_symbol_pipe \
- lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-+nm_file_list_spec \
- lt_prog_compiler_no_builtin_flag \
--lt_prog_compiler_wl \
- lt_prog_compiler_pic \
-+lt_prog_compiler_wl \
- lt_prog_compiler_static \
- lt_cv_prog_compiler_c_o \
- need_locks \
-+MANIFEST_TOOL \
- DSYMUTIL \
- NMEDIT \
- LIPO \
-@@ -16942,7 +17614,6 @@ no_undefined_flag \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
--fix_srcfile_path \
- exclude_expsyms \
- include_expsyms \
- file_list_spec \
-@@ -16978,6 +17649,7 @@ module_cmds \
- module_expsym_cmds \
- export_symbols_cmds \
- prelink_cmds \
-+postlink_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- finish_cmds \
-@@ -17757,7 +18429,8 @@ $as_echo X"$file" |
- # NOTE: Changes made to this file will be lost: look at ltmain.sh.
- #
- #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
--#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-+#                 Inc.
- #   Written by Gordon Matzigkeit, 1996
- #
- #   This file is part of GNU Libtool.
-@@ -17860,19 +18533,42 @@ SP2NL=$lt_lt_SP2NL
- # turn newlines into spaces.
- NL2SP=$lt_lt_NL2SP
- 
-+# convert \$build file names to \$host format.
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+
-+# convert \$build files to toolchain format.
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+
- # An object symbol dumper.
- OBJDUMP=$lt_OBJDUMP
- 
- # Method to check whether dependent libraries are shared objects.
- deplibs_check_method=$lt_deplibs_check_method
- 
--# Command to use when deplibs_check_method == "file_magic".
-+# Command to use when deplibs_check_method = "file_magic".
- file_magic_cmd=$lt_file_magic_cmd
- 
-+# How to find potential files when deplibs_check_method = "file_magic".
-+file_magic_glob=$lt_file_magic_glob
-+
-+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-+want_nocaseglob=$lt_want_nocaseglob
-+
-+# DLL creation program.
-+DLLTOOL=$lt_DLLTOOL
-+
-+# Command to associate shared and link libraries.
-+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-+
- # The archiver.
- AR=$lt_AR
-+
-+# Flags to create an archive.
- AR_FLAGS=$lt_AR_FLAGS
- 
-+# How to feed a file listing to the archiver.
-+archiver_list_spec=$lt_archiver_list_spec
-+
- # A symbol stripping program.
- STRIP=$lt_STRIP
- 
-@@ -17902,6 +18598,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
- # Transform the output of nm in a C name address pair when lib prefix is needed.
- global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
- 
-+# Specify filename containing input files for \$NM.
-+nm_file_list_spec=$lt_nm_file_list_spec
-+
-+# The root where to search for dependent libraries,and in which our libraries should be installed.
-+lt_sysroot=$lt_sysroot
-+
- # The name of the directory that contains temporary libtool files.
- objdir=$objdir
- 
-@@ -17911,6 +18613,9 @@ MAGIC_CMD=$MAGIC_CMD
- # Must we lock files when doing compilation?
- need_locks=$lt_need_locks
- 
-+# Manifest tool.
-+MANIFEST_TOOL=$lt_MANIFEST_TOOL
-+
- # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
- DSYMUTIL=$lt_DSYMUTIL
- 
-@@ -18025,12 +18730,12 @@ with_gcc=$GCC
- # Compiler flag to turn off builtin functions.
- no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
- 
--# How to pass a linker flag through the compiler.
--wl=$lt_lt_prog_compiler_wl
--
- # Additional compiler flags for building library objects.
- pic_flag=$lt_lt_prog_compiler_pic
- 
-+# How to pass a linker flag through the compiler.
-+wl=$lt_lt_prog_compiler_wl
-+
- # Compiler flag to prevent dynamic linking.
- link_static_flag=$lt_lt_prog_compiler_static
- 
-@@ -18117,9 +18822,6 @@ inherit_rpath=$inherit_rpath
- # Whether libtool must link a program against all its dependency libraries.
- link_all_deplibs=$link_all_deplibs
- 
--# Fix the shell variable \$srcfile for the compiler.
--fix_srcfile_path=$lt_fix_srcfile_path
--
- # Set to "yes" if exported symbols are required.
- always_export_symbols=$always_export_symbols
- 
-@@ -18135,6 +18837,9 @@ include_expsyms=$lt_include_expsyms
- # Commands necessary for linking programs (against libraries) with templates.
- prelink_cmds=$lt_prelink_cmds
- 
-+# Commands necessary for finishing linking programs.
-+postlink_cmds=$lt_postlink_cmds
-+
- # Specify filename containing input files.
- file_list_spec=$lt_file_list_spec
- 
-@@ -18167,210 +18872,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
-   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-   # text mode, it properly converts lines to CR/LF.  This bash problem
-   # is reportedly fixed, but why not run on old versions too?
--  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  case $xsi_shell in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result="${1##*/}"
--}
--
--# func_dirname_and_basename file append nondir_replacement
--# perform func_basename and func_dirname in a single function
--# call:
--#   dirname:  Compute the dirname of FILE.  If nonempty,
--#             add APPEND to the result, otherwise set result
--#             to NONDIR_REPLACEMENT.
--#             value returned in "$func_dirname_result"
--#   basename: Compute filename of FILE.
--#             value retuned in "$func_basename_result"
--# Implementation must be kept synchronized with func_dirname
--# and func_basename. For efficiency, we do not delegate to
--# those functions but instead duplicate the functionality here.
--func_dirname_and_basename ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--  func_basename_result="${1##*/}"
--}
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--func_stripname ()
--{
--  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
--  # positional parameters, so assign one to ordinary parameter first.
--  func_stripname_result=${3}
--  func_stripname_result=${func_stripname_result#"${1}"}
--  func_stripname_result=${func_stripname_result%"${2}"}
--}
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=${1%%=*}
--  func_opt_split_arg=${1#*=}
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  case ${1} in
--    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
--    *)    func_lo2o_result=${1} ;;
--  esac
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=${1%.*}.lo
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=$(( $* ))
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=${#1}
--}
--
--_LT_EOF
--    ;;
--  *) # Bourne compatible functions.
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  # Extract subdirectory from the argument.
--  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
--  if test "X$func_dirname_result" = "X${1}"; then
--    func_dirname_result="${3}"
--  else
--    func_dirname_result="$func_dirname_result${2}"
--  fi
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
--}
--
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--# func_strip_suffix prefix name
--func_stripname ()
--{
--  case ${2} in
--    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
--    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
--  esac
--}
--
--# sed scripts:
--my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
--my_sed_long_arg='1s/^-[^=]*=//'
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
--  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=`expr "$@"`
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
--}
--
--_LT_EOF
--esac
--
--case $lt_shell_append in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1+=\$2"
--}
--_LT_EOF
--    ;;
--  *)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1=\$$1\$2"
--}
--
--_LT_EOF
--    ;;
--  esac
--
--
--  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  mv -f "$cfgfile" "$ofile" ||
-+  sed '$q' "$ltmain" >> "$cfgfile" \
-+     || (rm -f "$cfgfile"; exit 1)
-+
-+  if test x"$xsi_shell" = xyes; then
-+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-+func_dirname ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-+func_basename ()\
-+{\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-+func_dirname_and_basename ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-+func_stripname ()\
-+{\
-+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-+\    # positional parameters, so assign one to ordinary parameter first.\
-+\    func_stripname_result=${3}\
-+\    func_stripname_result=${func_stripname_result#"${1}"}\
-+\    func_stripname_result=${func_stripname_result%"${2}"}\
-+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-+func_split_long_opt ()\
-+{\
-+\    func_split_long_opt_name=${1%%=*}\
-+\    func_split_long_opt_arg=${1#*=}\
-+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-+func_split_short_opt ()\
-+{\
-+\    func_split_short_opt_arg=${1#??}\
-+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-+func_lo2o ()\
-+{\
-+\    case ${1} in\
-+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-+\      *)    func_lo2o_result=${1} ;;\
-+\    esac\
-+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-+func_xform ()\
-+{\
-+    func_xform_result=${1%.*}.lo\
-+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-+func_arith ()\
-+{\
-+    func_arith_result=$(( $* ))\
-+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_len ()$/,/^} # func_len /c\
-+func_len ()\
-+{\
-+    func_len_result=${#1}\
-+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+fi
-+
-+if test x"$lt_shell_append" = xyes; then
-+  sed -e '/^func_append ()$/,/^} # func_append /c\
-+func_append ()\
-+{\
-+    eval "${1}+=\\${2}"\
-+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-+func_append_quoted ()\
-+{\
-+\    func_quote_for_eval "${2}"\
-+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  # Save a `func_append' function call where possible by direct use of '+='
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+else
-+  # Save a `func_append' function call even when '+=' is not available
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+fi
-+
-+if test x"$_lt_function_replace_fail" = x":"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-+fi
-+
-+
-+   mv -f "$cfgfile" "$ofile" ||
-     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-   chmod +x "$ofile"
- 
-diff --git a/bfd/configure.ac b/bfd/configure.ac
-index 669cff7..5f57877 100644
---- a/bfd/configure.ac
-+++ b/bfd/configure.ac
-@@ -253,7 +253,7 @@ changequote(,)dnl
-   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
- changequote([,])dnl
-   if test -n "$x"; then
--    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
-+    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
-   fi
- 
- # More hacks to build DLLs on Windows.
-diff --git a/binutils/configure b/binutils/configure
-index 6cbf17c..6d20600 100755
---- a/binutils/configure
-+++ b/binutils/configure
-@@ -658,8 +658,11 @@ OTOOL
- LIPO
- NMEDIT
- DSYMUTIL
-+MANIFEST_TOOL
- RANLIB
-+ac_ct_AR
- AR
-+DLLTOOL
- OBJDUMP
- LN_S
- NM
-@@ -771,6 +774,7 @@ enable_static
- with_pic
- enable_fast_install
- with_gnu_ld
-+with_libtool_sysroot
- enable_libtool_lock
- enable_plugins
- enable_largefile
-@@ -1443,6 +1447,8 @@ Optional Packages:
-   --with-pic              try to use only PIC/non-PIC objects [default=use
-                           both]
-   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-+  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
-+                        (or the compiler's sysroot if not specified).
-   --with-system-zlib      use installed libz
-   --with-gnu-ld           assume the C compiler uses GNU ld default=no
-   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
-@@ -5159,8 +5165,8 @@ esac
- 
- 
- 
--macro_version='2.2.7a'
--macro_revision='1.3134'
-+macro_version='2.4'
-+macro_revision='1.3293'
- 
- 
- 
-@@ -5200,7 +5206,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
- $as_echo_n "checking how to print strings... " >&6; }
- # Test print first, because it will be a builtin if present.
--if test "X`print -r -- -n 2>/dev/null`" = X-n && \
-+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-   ECHO='print -r --'
- elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-@@ -5886,8 +5892,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
- # Try some XSI features
- xsi_shell=no
- ( _lt_dummy="a/b/c"
--  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
--      = c,a/b,, \
-+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-+      = c,a/b,b/c, \
-     && eval 'test $(( 1 + 1 )) -eq 2 \
-     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-   && xsi_shell=yes
-@@ -5936,6 +5942,80 @@ esac
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-+if test "${lt_cv_to_host_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-+        ;;
-+    esac
-+    ;;
-+  *-*-cygwin* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_noop
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-+        ;;
-+    esac
-+    ;;
-+  * ) # unhandled hosts (and "normal" native builds)
-+    lt_cv_to_host_file_cmd=func_convert_file_noop
-+    ;;
-+esac
-+
-+fi
-+
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-+if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  #assume ordinary cross tools, or native build.
-+lt_cv_to_tool_file_cmd=func_convert_file_noop
-+case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+    esac
-+    ;;
-+esac
-+
-+fi
-+
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-+
-+
-+
-+
-+
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
- $as_echo_n "checking for $LD option to reload object files... " >&6; }
- if test "${lt_cv_ld_reload_flag+set}" = set; then :
-@@ -5952,6 +6032,11 @@ case $reload_flag in
- esac
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- case $host_os in
-+  cygwin* | mingw* | pw32* | cegcc*)
-+    if test "$GCC" != yes; then
-+      reload_cmds=false
-+    fi
-+    ;;
-   darwin*)
-     if test "$GCC" = yes; then
-       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-@@ -6120,7 +6205,8 @@ mingw* | pw32*)
-     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-     lt_cv_file_magic_cmd='func_win32_libid'
-   else
--    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-+    # Keep this pattern in sync with the one in func_win32_libid.
-+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-     lt_cv_file_magic_cmd='$OBJDUMP -f'
-   fi
-   ;;
-@@ -6274,6 +6360,21 @@ esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
- $as_echo "$lt_cv_deplibs_check_method" >&6; }
-+
-+file_magic_glob=
-+want_nocaseglob=no
-+if test "$build" = "$host"; then
-+  case $host_os in
-+  mingw* | pw32*)
-+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-+      want_nocaseglob=yes
-+    else
-+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
-+    fi
-+    ;;
-+  esac
-+fi
-+
- file_magic_cmd=$lt_cv_file_magic_cmd
- deplibs_check_method=$lt_cv_deplibs_check_method
- test -z "$deplibs_check_method" && deplibs_check_method=unknown
-@@ -6289,9 +6390,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
- 
- 
- 
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$DLLTOOL"; then
-+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+DLLTOOL=$ac_cv_prog_DLLTOOL
-+if test -n "$DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-+$as_echo "$DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_DLLTOOL"; then
-+  ac_ct_DLLTOOL=$DLLTOOL
-+  # Extract the first word of "dlltool", so it can be a program name with args.
-+set dummy dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_DLLTOOL"; then
-+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-+if test -n "$ac_ct_DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-+$as_echo "$ac_ct_DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_DLLTOOL" = x; then
-+    DLLTOOL="false"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    DLLTOOL=$ac_ct_DLLTOOL
-+  fi
-+else
-+  DLLTOOL="$ac_cv_prog_DLLTOOL"
-+fi
-+
-+test -z "$DLLTOOL" && DLLTOOL=dlltool
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-+if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_sharedlib_from_linklib_cmd='unknown'
-+
-+case $host_os in
-+cygwin* | mingw* | pw32* | cegcc*)
-+  # two different shell functions defined in ltmain.sh
-+  # decide which to use based on capabilities of $DLLTOOL
-+  case `$DLLTOOL --help 2>&1` in
-+  *--identify-strict*)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-+    ;;
-+  *)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-+    ;;
-+  esac
-+  ;;
-+*)
-+  # fallback: assume linklib IS sharedlib
-+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-+  ;;
-+esac
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-+
-+
-+
-+
-+
-+
-+
- if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
--set dummy ${ac_tool_prefix}ar; ac_word=$2
-+  for ac_prog in ar
-+  do
-+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_AR+set}" = set; then :
-@@ -6307,7 +6561,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_AR="${ac_tool_prefix}ar"
-+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6327,11 +6581,15 @@ $as_echo "no" >&6; }
- fi
- 
- 
-+    test -n "$AR" && break
-+  done
- fi
--if test -z "$ac_cv_prog_AR"; then
-+if test -z "$AR"; then
-   ac_ct_AR=$AR
--  # Extract the first word of "ar", so it can be a program name with args.
--set dummy ar; ac_word=$2
-+  for ac_prog in ar
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
-@@ -6347,7 +6605,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_ac_ct_AR="ar"
-+    ac_cv_prog_ac_ct_AR="$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6366,6 +6624,10 @@ else
- $as_echo "no" >&6; }
- fi
- 
-+
-+  test -n "$ac_ct_AR" && break
-+done
-+
-   if test "x$ac_ct_AR" = x; then
-     AR="false"
-   else
-@@ -6377,12 +6639,10 @@ ac_tool_warned=yes ;;
- esac
-     AR=$ac_ct_AR
-   fi
--else
--  AR="$ac_cv_prog_AR"
- fi
- 
--test -z "$AR" && AR=ar
--test -z "$AR_FLAGS" && AR_FLAGS=cru
-+: ${AR=ar}
-+: ${AR_FLAGS=cru}
- 
- 
- 
-@@ -6394,6 +6654,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-+$as_echo_n "checking for archiver @FILE support... " >&6; }
-+if test "${lt_cv_ar_at_file+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_ar_at_file=no
-+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+  echo conftest.$ac_objext > conftest.lst
-+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
-+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+      if test "$ac_status" -eq 0; then
-+	# Ensure the archiver fails upon bogus file names.
-+	rm -f conftest.$ac_objext libconftest.a
-+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+	if test "$ac_status" -ne 0; then
-+          lt_cv_ar_at_file=@
-+        fi
-+      fi
-+      rm -f conftest.* libconftest.a
-+
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-+$as_echo "$lt_cv_ar_at_file" >&6; }
-+
-+if test "x$lt_cv_ar_at_file" = xno; then
-+  archiver_list_spec=
-+else
-+  archiver_list_spec=$lt_cv_ar_at_file
-+fi
-+
-+
-+
-+
-+
-+
-+
- if test -n "$ac_tool_prefix"; then
-   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
- set dummy ${ac_tool_prefix}strip; ac_word=$2
-@@ -6728,8 +7046,8 @@ esac
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- 
- # Transform an extracted symbol line into symbol name and symbol address
--lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
--lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
- 
- # Handle CRLF in mingw tool chain
- opt_cr=
-@@ -6765,6 +7083,7 @@ for ac_symprfx in "" "_"; do
-   else
-     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-   fi
-+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
- 
-   # Check to see that the pipe works correctly.
-   pipe_works=no
-@@ -6806,6 +7125,18 @@ _LT_EOF
-       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- 	  cat <<_LT_EOF > conftest.$ac_ext
-+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-+/* DATA imports from DLLs on WIN32 con't be const, because runtime
-+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-+# define LT_DLSYM_CONST
-+#elif defined(__osf__)
-+/* This system does not cope well with relocations in const data.  */
-+# define LT_DLSYM_CONST
-+#else
-+# define LT_DLSYM_CONST const
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -6817,7 +7148,7 @@ _LT_EOF
- 	  cat <<_LT_EOF >> conftest.$ac_ext
- 
- /* The mapping between symbol names and symbols.  */
--const struct {
-+LT_DLSYM_CONST struct {
-   const char *name;
-   void       *address;
- }
-@@ -6843,8 +7174,8 @@ static const void *lt_preloaded_setup() {
- _LT_EOF
- 	  # Now try linking the two files.
- 	  mv conftest.$ac_objext conftstm.$ac_objext
--	  lt_save_LIBS="$LIBS"
--	  lt_save_CFLAGS="$CFLAGS"
-+	  lt_globsym_save_LIBS=$LIBS
-+	  lt_globsym_save_CFLAGS=$CFLAGS
- 	  LIBS="conftstm.$ac_objext"
- 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-@@ -6854,8 +7185,8 @@ _LT_EOF
-   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
- 	    pipe_works=yes
- 	  fi
--	  LIBS="$lt_save_LIBS"
--	  CFLAGS="$lt_save_CFLAGS"
-+	  LIBS=$lt_globsym_save_LIBS
-+	  CFLAGS=$lt_globsym_save_CFLAGS
- 	else
- 	  echo "cannot find nm_test_func in $nlist" >&5
- 	fi
-@@ -6892,6 +7223,21 @@ else
- $as_echo "ok" >&6; }
- fi
- 
-+# Response file support.
-+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-+  nm_file_list_spec='@'
-+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
-+  nm_file_list_spec='@'
-+fi
-+
-+
-+
-+
-+
-+
-+
-+
-+
- 
- 
- 
-@@ -6910,6 +7256,40 @@ fi
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-+$as_echo_n "checking for sysroot... " >&6; }
-+
-+# Check whether --with-libtool-sysroot was given.
-+if test "${with_libtool_sysroot+set}" = set; then :
-+  withval=$with_libtool_sysroot;
-+else
-+  with_libtool_sysroot=no
-+fi
-+
-+
-+lt_sysroot=
-+case ${with_libtool_sysroot} in #(
-+ yes)
-+   if test "$GCC" = yes; then
-+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-+   fi
-+   ;; #(
-+ /*)
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
-+   ;; #(
-+ no|'')
-+   ;; #(
-+ *)
-+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
-+$as_echo "${with_libtool_sysroot}" >&6; }
-+   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
-+   ;;
-+esac
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-+$as_echo "${lt_sysroot:-no}" >&6; }
-+
-+
- 
- 
- 
-@@ -7119,6 +7499,123 @@ esac
- 
- need_locks="$enable_libtool_lock"
- 
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$MANIFEST_TOOL"; then
-+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-+if test -n "$MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-+$as_echo "$MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
-+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
-+  # Extract the first word of "mt", so it can be a program name with args.
-+set dummy mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-+if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
-+    MANIFEST_TOOL=":"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
-+  fi
-+else
-+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-+fi
-+
-+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-+if test "${lt_cv_path_mainfest_tool+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_path_mainfest_tool=no
-+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
-+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-+  cat conftest.err >&5
-+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-+    lt_cv_path_mainfest_tool=yes
-+  fi
-+  rm -f conftest*
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-+if test "x$lt_cv_path_mainfest_tool" != xyes; then
-+  MANIFEST_TOOL=:
-+fi
-+
-+
-+
-+
-+
- 
-   case $host_os in
-     rhapsody* | darwin*)
-@@ -7682,6 +8179,8 @@ _LT_EOF
-       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-       echo "$AR cru libconftest.a conftest.o" >&5
-       $AR cru libconftest.a conftest.o 2>&5
-+      echo "$RANLIB libconftest.a" >&5
-+      $RANLIB libconftest.a 2>&5
-       cat > conftest.c << _LT_EOF
- int main() { return 0;}
- _LT_EOF
-@@ -7877,7 +8376,8 @@ fi
- LIBTOOL_DEPS="$ltmain"
- 
- # Always use our own libtool.
--LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-+LIBTOOL='$(SHELL) $(top_builddir)'
-+LIBTOOL="$LIBTOOL/${host_alias}-libtool"
- 
- 
- 
-@@ -7966,7 +8466,7 @@ aix3*)
- esac
- 
- # Global variables:
--ofile=libtool
-+ofile=${host_alias}-libtool
- can_build_shared=yes
- 
- # All known linkers require a `.a' archive for static linking (except MSVC,
-@@ -8264,8 +8764,6 @@ fi
- lt_prog_compiler_pic=
- lt_prog_compiler_static=
- 
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
--$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 
-   if test "$GCC" = yes; then
-     lt_prog_compiler_wl='-Wl,'
-@@ -8431,6 +8929,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 	lt_prog_compiler_pic='--shared'
- 	lt_prog_compiler_static='--static'
- 	;;
-+      nagfor*)
-+	# NAG Fortran compiler
-+	lt_prog_compiler_wl='-Wl,-Wl,,'
-+	lt_prog_compiler_pic='-PIC'
-+	lt_prog_compiler_static='-Bstatic'
-+	;;
-       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-         # Portland Group compilers (*not* the Pentium gcc compiler,
- 	# which looks to be a dead project)
-@@ -8493,7 +8997,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-       lt_prog_compiler_pic='-KPIC'
-       lt_prog_compiler_static='-Bstatic'
-       case $cc_basename in
--      f77* | f90* | f95*)
-+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- 	lt_prog_compiler_wl='-Qoption ld ';;
-       *)
- 	lt_prog_compiler_wl='-Wl,';;
-@@ -8550,13 +9054,17 @@ case $host_os in
-     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-     ;;
- esac
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
--$as_echo "$lt_prog_compiler_pic" >&6; }
--
--
--
--
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-+if test "${lt_cv_prog_compiler_pic+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
- 
- #
- # Check to make sure the PIC flag actually works.
-@@ -8617,6 +9125,11 @@ fi
- 
- 
- 
-+
-+
-+
-+
-+
- #
- # Check to make sure the static flag actually works.
- #
-@@ -8967,7 +9480,8 @@ _LT_EOF
-       allow_undefined_flag=unsupported
-       always_export_symbols=no
-       enable_shared_with_static_runtimes=yes
--      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
- 
-       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-@@ -9066,12 +9580,12 @@ _LT_EOF
- 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- 	  hardcode_libdir_flag_spec=
- 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
--	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- 	  if test "x$supports_anon_versioning" = xyes; then
- 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- 	      echo "local: *; };" >> $output_objdir/$libname.ver~
--	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- 	  fi
- 	  ;;
- 	esac
-@@ -9085,8 +9599,8 @@ _LT_EOF
- 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- 	wlarc=
-       else
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       fi
-       ;;
- 
-@@ -9104,8 +9618,8 @@ _LT_EOF
- 
- _LT_EOF
-       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -9151,8 +9665,8 @@ _LT_EOF
- 
-     *)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -9282,7 +9796,13 @@ _LT_EOF
- 	allow_undefined_flag='-berok'
-         # Determine the default libpath from the value encoded in an
-         # empty executable.
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+        if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9295,22 +9815,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
-         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-@@ -9322,7 +9849,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	else
- 	 # Determine the default libpath from the value encoded in an
- 	 # empty executable.
--	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	 if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9335,22 +9868,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
- 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- 	  # Warning - without using the other run time loading flags,
-@@ -9395,20 +9935,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-       # Microsoft Visual C++.
-       # hardcode_libdir_flag_spec is actually meaningless, as there is
-       # no search path for DLLs.
--      hardcode_libdir_flag_spec=' '
--      allow_undefined_flag=unsupported
--      # Tell ltmain to make .lib files, not .a files.
--      libext=lib
--      # Tell ltmain to make .dll files, not .so files.
--      shrext_cmds=".dll"
--      # FIXME: Setting linknames here is a bad hack.
--      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
--      # The linker will automatically build a .lib file if we build a DLL.
--      old_archive_from_new_cmds='true'
--      # FIXME: Should let the user specify the lib program.
--      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
--      fix_srcfile_path='`cygpath -w "$srcfile"`'
--      enable_shared_with_static_runtimes=yes
-+      case $cc_basename in
-+      cl*)
-+	# Native MSVC
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	always_export_symbols=yes
-+	file_list_spec='@'
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-+	  else
-+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-+	  fi~
-+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-+	  linknames='
-+	# The linker will not automatically build a static lib if we build a DLL.
-+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
-+	enable_shared_with_static_runtimes=yes
-+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+	# Don't use ranlib
-+	old_postinstall_cmds='chmod 644 $oldlib'
-+	postlink_cmds='lt_outputfile="@OUTPUT@"~
-+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-+	  case $lt_outputfile in
-+	    *.exe|*.EXE) ;;
-+	    *)
-+	      lt_outputfile="$lt_outputfile.exe"
-+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-+	      ;;
-+	  esac~
-+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-+	    $RM "$lt_outputfile.manifest";
-+	  fi'
-+	;;
-+      *)
-+	# Assume MSVC wrapper
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-+	# The linker will automatically build a .lib file if we build a DLL.
-+	old_archive_from_new_cmds='true'
-+	# FIXME: Should let the user specify the lib program.
-+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-+	enable_shared_with_static_runtimes=yes
-+	;;
-+      esac
-       ;;
- 
-     darwin* | rhapsody*)
-@@ -9469,7 +10052,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-     freebsd* | dragonfly*)
--      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-       hardcode_direct=yes
-       hardcode_shlibpath_var=no
-@@ -9477,7 +10060,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux9*)
-       if test "$GCC" = yes; then
--	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       else
- 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       fi
-@@ -9493,7 +10076,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux10*)
-       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
--	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-       else
- 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-       fi
-@@ -9517,10 +10100,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	ia64*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	esac
-       else
-@@ -9599,23 +10182,36 @@ fi
- 
-     irix5* | irix6* | nonstopux*)
-       if test "$GCC" = yes; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	# Try to use the -exported_symbol ld option, if it does not
- 	# work, assume that -exports_file does not work either and
- 	# implicitly export all symbols.
--        save_LDFLAGS="$LDFLAGS"
--        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	# This should be the same for all languages, so no per-tag cache variable.
-+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-+if test "${lt_cv_irix_exported_symbol+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  save_LDFLAGS="$LDFLAGS"
-+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
--int foo(void) {}
-+int foo (void) { return 0; }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
--  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
--
-+  lt_cv_irix_exported_symbol=yes
-+else
-+  lt_cv_irix_exported_symbol=no
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--        LDFLAGS="$save_LDFLAGS"
-+           LDFLAGS="$save_LDFLAGS"
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
-+	if test "$lt_cv_irix_exported_symbol" = yes; then
-+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-+	fi
-       else
- 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-@@ -9700,7 +10296,7 @@ rm -f core conftest.err conftest.$ac_objext \
-     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-       if test "$GCC" = yes; then
- 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
--	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-       else
- 	allow_undefined_flag=' -expect_unresolved \*'
-@@ -9719,9 +10315,9 @@ rm -f core conftest.err conftest.$ac_objext \
-       no_undefined_flag=' -z defs'
-       if test "$GCC" = yes; then
- 	wlarc='${wl}'
--	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
--	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-       else
- 	case `$CC -V 2>&1` in
- 	*"Compilers 5.0"*)
-@@ -10297,8 +10893,9 @@ cygwin* | mingw* | pw32* | cegcc*)
-   need_version=no
-   need_lib_prefix=no
- 
--  case $GCC,$host_os in
--  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-+  case $GCC,$cc_basename in
-+  yes,*)
-+    # gcc
-     library_names_spec='$libname.dll.a'
-     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-     postinstall_cmds='base_file=`basename \${file}`~
-@@ -10331,13 +10928,71 @@ cygwin* | mingw* | pw32* | cegcc*)
-       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-       ;;
-     esac
-+    dynamic_linker='Win32 ld.exe'
-+    ;;
-+
-+  *,cl*)
-+    # Native MSVC
-+    libname_spec='$name'
-+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-+    library_names_spec='${libname}.dll.lib'
-+
-+    case $build_os in
-+    mingw*)
-+      sys_lib_search_path_spec=
-+      lt_save_ifs=$IFS
-+      IFS=';'
-+      for lt_path in $LIB
-+      do
-+        IFS=$lt_save_ifs
-+        # Let DOS variable expansion print the short 8.3 style file name.
-+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-+      done
-+      IFS=$lt_save_ifs
-+      # Convert to MSYS style.
-+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-+      ;;
-+    cygwin*)
-+      # Convert to unix form, then to dos form, then back to unix form
-+      # but this time dos style (no spaces!) so that the unix form looks
-+      # like /cygdrive/c/PROGRA~1:/cygdr...
-+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      ;;
-+    *)
-+      sys_lib_search_path_spec="$LIB"
-+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-+        # It is most probably a Windows format PATH.
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-+      else
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      fi
-+      # FIXME: find the short name or the path components, as spaces are
-+      # common. (e.g. "Program Files" -> "PROGRA~1")
-+      ;;
-+    esac
-+
-+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-+    postinstall_cmds='base_file=`basename \${file}`~
-+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-+      dldir=$destdir/`dirname \$dlpath`~
-+      test -d \$dldir || mkdir -p \$dldir~
-+      $install_prog $dir/$dlname \$dldir/$dlname'
-+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-+      dlpath=$dir/\$dldll~
-+       $RM \$dlpath'
-+    shlibpath_overrides_runpath=yes
-+    dynamic_linker='Win32 link.exe'
-     ;;
- 
-   *)
-+    # Assume MSVC wrapper
-     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-+    dynamic_linker='Win32 ld.exe'
-     ;;
-   esac
--  dynamic_linker='Win32 ld.exe'
-   # FIXME: first we should search . and the directory the executable is in
-   shlibpath_var=PATH
-   ;;
-@@ -10429,7 +11084,7 @@ haiku*)
-   soname_spec='${libname}${release}${shared_ext}$major'
-   shlibpath_var=LIBRARY_PATH
-   shlibpath_overrides_runpath=yes
--  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-   hardcode_into_libs=yes
-   ;;
- 
-@@ -11269,10 +11924,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -11375,10 +12030,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -15392,13 +16047,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
- lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
- lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
- lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
- reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
- reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
- OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
- deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
- file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
- AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
- AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
- STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
- RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
- old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-@@ -15413,14 +16075,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
- lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
- objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
- MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
--lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
- lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
- need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
- DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
- NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
- LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-@@ -15453,12 +16118,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
- hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
- inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
- link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
--fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
- always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
- export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
- exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
- include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
- prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
- file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
- variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
- need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-@@ -15513,8 +16178,13 @@ reload_flag \
- OBJDUMP \
- deplibs_check_method \
- file_magic_cmd \
-+file_magic_glob \
-+want_nocaseglob \
-+DLLTOOL \
-+sharedlib_from_linklib_cmd \
- AR \
- AR_FLAGS \
-+archiver_list_spec \
- STRIP \
- RANLIB \
- CC \
-@@ -15524,12 +16194,14 @@ lt_cv_sys_global_symbol_pipe \
- lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-+nm_file_list_spec \
- lt_prog_compiler_no_builtin_flag \
--lt_prog_compiler_wl \
- lt_prog_compiler_pic \
-+lt_prog_compiler_wl \
- lt_prog_compiler_static \
- lt_cv_prog_compiler_c_o \
- need_locks \
-+MANIFEST_TOOL \
- DSYMUTIL \
- NMEDIT \
- LIPO \
-@@ -15545,7 +16217,6 @@ no_undefined_flag \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
--fix_srcfile_path \
- exclude_expsyms \
- include_expsyms \
- file_list_spec \
-@@ -15581,6 +16252,7 @@ module_cmds \
- module_expsym_cmds \
- export_symbols_cmds \
- prelink_cmds \
-+postlink_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- finish_cmds \
-@@ -16338,7 +17010,8 @@ $as_echo X"$file" |
- # NOTE: Changes made to this file will be lost: look at ltmain.sh.
- #
- #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
--#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-+#                 Inc.
- #   Written by Gordon Matzigkeit, 1996
- #
- #   This file is part of GNU Libtool.
-@@ -16441,19 +17114,42 @@ SP2NL=$lt_lt_SP2NL
- # turn newlines into spaces.
- NL2SP=$lt_lt_NL2SP
- 
-+# convert \$build file names to \$host format.
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+
-+# convert \$build files to toolchain format.
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+
- # An object symbol dumper.
- OBJDUMP=$lt_OBJDUMP
- 
- # Method to check whether dependent libraries are shared objects.
- deplibs_check_method=$lt_deplibs_check_method
- 
--# Command to use when deplibs_check_method == "file_magic".
-+# Command to use when deplibs_check_method = "file_magic".
- file_magic_cmd=$lt_file_magic_cmd
- 
-+# How to find potential files when deplibs_check_method = "file_magic".
-+file_magic_glob=$lt_file_magic_glob
-+
-+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-+want_nocaseglob=$lt_want_nocaseglob
-+
-+# DLL creation program.
-+DLLTOOL=$lt_DLLTOOL
-+
-+# Command to associate shared and link libraries.
-+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-+
- # The archiver.
- AR=$lt_AR
-+
-+# Flags to create an archive.
- AR_FLAGS=$lt_AR_FLAGS
- 
-+# How to feed a file listing to the archiver.
-+archiver_list_spec=$lt_archiver_list_spec
-+
- # A symbol stripping program.
- STRIP=$lt_STRIP
- 
-@@ -16483,6 +17179,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
- # Transform the output of nm in a C name address pair when lib prefix is needed.
- global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
- 
-+# Specify filename containing input files for \$NM.
-+nm_file_list_spec=$lt_nm_file_list_spec
-+
-+# The root where to search for dependent libraries,and in which our libraries should be installed.
-+lt_sysroot=$lt_sysroot
-+
- # The name of the directory that contains temporary libtool files.
- objdir=$objdir
- 
-@@ -16492,6 +17194,9 @@ MAGIC_CMD=$MAGIC_CMD
- # Must we lock files when doing compilation?
- need_locks=$lt_need_locks
- 
-+# Manifest tool.
-+MANIFEST_TOOL=$lt_MANIFEST_TOOL
-+
- # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
- DSYMUTIL=$lt_DSYMUTIL
- 
-@@ -16606,12 +17311,12 @@ with_gcc=$GCC
- # Compiler flag to turn off builtin functions.
- no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
- 
--# How to pass a linker flag through the compiler.
--wl=$lt_lt_prog_compiler_wl
--
- # Additional compiler flags for building library objects.
- pic_flag=$lt_lt_prog_compiler_pic
- 
-+# How to pass a linker flag through the compiler.
-+wl=$lt_lt_prog_compiler_wl
-+
- # Compiler flag to prevent dynamic linking.
- link_static_flag=$lt_lt_prog_compiler_static
- 
-@@ -16698,9 +17403,6 @@ inherit_rpath=$inherit_rpath
- # Whether libtool must link a program against all its dependency libraries.
- link_all_deplibs=$link_all_deplibs
- 
--# Fix the shell variable \$srcfile for the compiler.
--fix_srcfile_path=$lt_fix_srcfile_path
--
- # Set to "yes" if exported symbols are required.
- always_export_symbols=$always_export_symbols
- 
-@@ -16716,6 +17418,9 @@ include_expsyms=$lt_include_expsyms
- # Commands necessary for linking programs (against libraries) with templates.
- prelink_cmds=$lt_prelink_cmds
- 
-+# Commands necessary for finishing linking programs.
-+postlink_cmds=$lt_postlink_cmds
-+
- # Specify filename containing input files.
- file_list_spec=$lt_file_list_spec
- 
-@@ -16748,210 +17453,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
-   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-   # text mode, it properly converts lines to CR/LF.  This bash problem
-   # is reportedly fixed, but why not run on old versions too?
--  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  case $xsi_shell in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result="${1##*/}"
--}
--
--# func_dirname_and_basename file append nondir_replacement
--# perform func_basename and func_dirname in a single function
--# call:
--#   dirname:  Compute the dirname of FILE.  If nonempty,
--#             add APPEND to the result, otherwise set result
--#             to NONDIR_REPLACEMENT.
--#             value returned in "$func_dirname_result"
--#   basename: Compute filename of FILE.
--#             value retuned in "$func_basename_result"
--# Implementation must be kept synchronized with func_dirname
--# and func_basename. For efficiency, we do not delegate to
--# those functions but instead duplicate the functionality here.
--func_dirname_and_basename ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--  func_basename_result="${1##*/}"
--}
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--func_stripname ()
--{
--  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
--  # positional parameters, so assign one to ordinary parameter first.
--  func_stripname_result=${3}
--  func_stripname_result=${func_stripname_result#"${1}"}
--  func_stripname_result=${func_stripname_result%"${2}"}
--}
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=${1%%=*}
--  func_opt_split_arg=${1#*=}
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  case ${1} in
--    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
--    *)    func_lo2o_result=${1} ;;
--  esac
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=${1%.*}.lo
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=$(( $* ))
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=${#1}
--}
--
--_LT_EOF
--    ;;
--  *) # Bourne compatible functions.
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  # Extract subdirectory from the argument.
--  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
--  if test "X$func_dirname_result" = "X${1}"; then
--    func_dirname_result="${3}"
--  else
--    func_dirname_result="$func_dirname_result${2}"
--  fi
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
--}
--
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--# func_strip_suffix prefix name
--func_stripname ()
--{
--  case ${2} in
--    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
--    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
--  esac
--}
--
--# sed scripts:
--my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
--my_sed_long_arg='1s/^-[^=]*=//'
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
--  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=`expr "$@"`
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
--}
--
--_LT_EOF
--esac
--
--case $lt_shell_append in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1+=\$2"
--}
--_LT_EOF
--    ;;
--  *)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1=\$$1\$2"
--}
--
--_LT_EOF
--    ;;
--  esac
--
--
--  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  mv -f "$cfgfile" "$ofile" ||
-+  sed '$q' "$ltmain" >> "$cfgfile" \
-+     || (rm -f "$cfgfile"; exit 1)
-+
-+  if test x"$xsi_shell" = xyes; then
-+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-+func_dirname ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-+func_basename ()\
-+{\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-+func_dirname_and_basename ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-+func_stripname ()\
-+{\
-+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-+\    # positional parameters, so assign one to ordinary parameter first.\
-+\    func_stripname_result=${3}\
-+\    func_stripname_result=${func_stripname_result#"${1}"}\
-+\    func_stripname_result=${func_stripname_result%"${2}"}\
-+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-+func_split_long_opt ()\
-+{\
-+\    func_split_long_opt_name=${1%%=*}\
-+\    func_split_long_opt_arg=${1#*=}\
-+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-+func_split_short_opt ()\
-+{\
-+\    func_split_short_opt_arg=${1#??}\
-+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-+func_lo2o ()\
-+{\
-+\    case ${1} in\
-+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-+\      *)    func_lo2o_result=${1} ;;\
-+\    esac\
-+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-+func_xform ()\
-+{\
-+    func_xform_result=${1%.*}.lo\
-+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-+func_arith ()\
-+{\
-+    func_arith_result=$(( $* ))\
-+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_len ()$/,/^} # func_len /c\
-+func_len ()\
-+{\
-+    func_len_result=${#1}\
-+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+fi
-+
-+if test x"$lt_shell_append" = xyes; then
-+  sed -e '/^func_append ()$/,/^} # func_append /c\
-+func_append ()\
-+{\
-+    eval "${1}+=\\${2}"\
-+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-+func_append_quoted ()\
-+{\
-+\    func_quote_for_eval "${2}"\
-+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  # Save a `func_append' function call where possible by direct use of '+='
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+else
-+  # Save a `func_append' function call even when '+=' is not available
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+fi
-+
-+if test x"$_lt_function_replace_fail" = x":"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-+fi
-+
-+
-+   mv -f "$cfgfile" "$ofile" ||
-     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-   chmod +x "$ofile"
- 
-diff --git a/configure b/configure
-index 2a74a77..ad3dfb7 100755
---- a/configure
-+++ b/configure
-@@ -3444,7 +3444,7 @@ case "${target}" in
-     ;;
-   s390-*-* | s390x-*-*)
-     ;;
--  sh*-*-* | sh[34]*-*-*)
-+  sh-*-* | sh[34]*-*-*)
-     ;;
-   sh64-*-* | sh5*-*-*)
-     ;;
-@@ -3946,7 +3946,7 @@ case "${target}" in
-   or1k*-*-*)
-     noconfigdirs="$noconfigdirs gdb"
-     ;;
--  sh*-*-* | sh64-*-*)
-+  sh-*-* | sh64-*-*)
-     case "${target}" in
-       sh*-*-elf)
-          ;;
-diff --git a/gas/configure b/gas/configure
-index f7753b8..45da030 100755
---- a/gas/configure
-+++ b/gas/configure
-@@ -648,8 +648,11 @@ OTOOL
- LIPO
- NMEDIT
- DSYMUTIL
-+MANIFEST_TOOL
- RANLIB
-+ac_ct_AR
- AR
-+DLLTOOL
- OBJDUMP
- LN_S
- NM
-@@ -761,6 +764,7 @@ enable_static
- with_pic
- enable_fast_install
- with_gnu_ld
-+with_libtool_sysroot
- enable_libtool_lock
- enable_plugins
- enable_largefile
-@@ -4919,8 +4923,8 @@ esac
- 
- 
- 
--macro_version='2.2.7a'
--macro_revision='1.3134'
-+macro_version='2.4'
-+macro_revision='1.3293'
- 
- 
- 
-@@ -4960,7 +4964,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
- $as_echo_n "checking how to print strings... " >&6; }
- # Test print first, because it will be a builtin if present.
--if test "X`print -r -- -n 2>/dev/null`" = X-n && \
-+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-   ECHO='print -r --'
- elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-@@ -5646,8 +5650,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
- # Try some XSI features
- xsi_shell=no
- ( _lt_dummy="a/b/c"
--  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
--      = c,a/b,, \
-+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-+      = c,a/b,b/c, \
-     && eval 'test $(( 1 + 1 )) -eq 2 \
-     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-   && xsi_shell=yes
-@@ -5696,6 +5700,80 @@ esac
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-+if test "${lt_cv_to_host_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-+        ;;
-+    esac
-+    ;;
-+  *-*-cygwin* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_noop
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-+        ;;
-+    esac
-+    ;;
-+  * ) # unhandled hosts (and "normal" native builds)
-+    lt_cv_to_host_file_cmd=func_convert_file_noop
-+    ;;
-+esac
-+
-+fi
-+
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-+if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  #assume ordinary cross tools, or native build.
-+lt_cv_to_tool_file_cmd=func_convert_file_noop
-+case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+    esac
-+    ;;
-+esac
-+
-+fi
-+
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-+
-+
-+
-+
-+
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
- $as_echo_n "checking for $LD option to reload object files... " >&6; }
- if test "${lt_cv_ld_reload_flag+set}" = set; then :
-@@ -5712,6 +5790,11 @@ case $reload_flag in
- esac
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- case $host_os in
-+  cygwin* | mingw* | pw32* | cegcc*)
-+    if test "$GCC" != yes; then
-+      reload_cmds=false
-+    fi
-+    ;;
-   darwin*)
-     if test "$GCC" = yes; then
-       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-@@ -5880,7 +5963,8 @@ mingw* | pw32*)
-     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-     lt_cv_file_magic_cmd='func_win32_libid'
-   else
--    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-+    # Keep this pattern in sync with the one in func_win32_libid.
-+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-     lt_cv_file_magic_cmd='$OBJDUMP -f'
-   fi
-   ;;
-@@ -6034,6 +6118,21 @@ esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
- $as_echo "$lt_cv_deplibs_check_method" >&6; }
-+
-+file_magic_glob=
-+want_nocaseglob=no
-+if test "$build" = "$host"; then
-+  case $host_os in
-+  mingw* | pw32*)
-+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-+      want_nocaseglob=yes
-+    else
-+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
-+    fi
-+    ;;
-+  esac
-+fi
-+
- file_magic_cmd=$lt_cv_file_magic_cmd
- deplibs_check_method=$lt_cv_deplibs_check_method
- test -z "$deplibs_check_method" && deplibs_check_method=unknown
-@@ -6049,9 +6148,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
- 
- 
- 
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$DLLTOOL"; then
-+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+DLLTOOL=$ac_cv_prog_DLLTOOL
-+if test -n "$DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-+$as_echo "$DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_DLLTOOL"; then
-+  ac_ct_DLLTOOL=$DLLTOOL
-+  # Extract the first word of "dlltool", so it can be a program name with args.
-+set dummy dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_DLLTOOL"; then
-+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-+if test -n "$ac_ct_DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-+$as_echo "$ac_ct_DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_DLLTOOL" = x; then
-+    DLLTOOL="false"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    DLLTOOL=$ac_ct_DLLTOOL
-+  fi
-+else
-+  DLLTOOL="$ac_cv_prog_DLLTOOL"
-+fi
-+
-+test -z "$DLLTOOL" && DLLTOOL=dlltool
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-+if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_sharedlib_from_linklib_cmd='unknown'
-+
-+case $host_os in
-+cygwin* | mingw* | pw32* | cegcc*)
-+  # two different shell functions defined in ltmain.sh
-+  # decide which to use based on capabilities of $DLLTOOL
-+  case `$DLLTOOL --help 2>&1` in
-+  *--identify-strict*)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-+    ;;
-+  *)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-+    ;;
-+  esac
-+  ;;
-+*)
-+  # fallback: assume linklib IS sharedlib
-+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-+  ;;
-+esac
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-+
-+
-+
-+
-+
-+
-+
- if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
--set dummy ${ac_tool_prefix}ar; ac_word=$2
-+  for ac_prog in ar
-+  do
-+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_AR+set}" = set; then :
-@@ -6067,7 +6319,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_AR="${ac_tool_prefix}ar"
-+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6087,11 +6339,15 @@ $as_echo "no" >&6; }
- fi
- 
- 
-+    test -n "$AR" && break
-+  done
- fi
--if test -z "$ac_cv_prog_AR"; then
-+if test -z "$AR"; then
-   ac_ct_AR=$AR
--  # Extract the first word of "ar", so it can be a program name with args.
--set dummy ar; ac_word=$2
-+  for ac_prog in ar
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
-@@ -6107,7 +6363,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_ac_ct_AR="ar"
-+    ac_cv_prog_ac_ct_AR="$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6126,6 +6382,10 @@ else
- $as_echo "no" >&6; }
- fi
- 
-+
-+  test -n "$ac_ct_AR" && break
-+done
-+
-   if test "x$ac_ct_AR" = x; then
-     AR="false"
-   else
-@@ -6137,12 +6397,10 @@ ac_tool_warned=yes ;;
- esac
-     AR=$ac_ct_AR
-   fi
--else
--  AR="$ac_cv_prog_AR"
- fi
- 
--test -z "$AR" && AR=ar
--test -z "$AR_FLAGS" && AR_FLAGS=cru
-+: ${AR=ar}
-+: ${AR_FLAGS=cru}
- 
- 
- 
-@@ -6154,6 +6412,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-+$as_echo_n "checking for archiver @FILE support... " >&6; }
-+if test "${lt_cv_ar_at_file+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_ar_at_file=no
-+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+  echo conftest.$ac_objext > conftest.lst
-+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
-+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+      if test "$ac_status" -eq 0; then
-+	# Ensure the archiver fails upon bogus file names.
-+	rm -f conftest.$ac_objext libconftest.a
-+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+	if test "$ac_status" -ne 0; then
-+          lt_cv_ar_at_file=@
-+        fi
-+      fi
-+      rm -f conftest.* libconftest.a
-+
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-+$as_echo "$lt_cv_ar_at_file" >&6; }
-+
-+if test "x$lt_cv_ar_at_file" = xno; then
-+  archiver_list_spec=
-+else
-+  archiver_list_spec=$lt_cv_ar_at_file
-+fi
-+
-+
-+
-+
-+
-+
-+
- if test -n "$ac_tool_prefix"; then
-   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
- set dummy ${ac_tool_prefix}strip; ac_word=$2
-@@ -6488,8 +6804,8 @@ esac
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- 
- # Transform an extracted symbol line into symbol name and symbol address
--lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
--lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
- 
- # Handle CRLF in mingw tool chain
- opt_cr=
-@@ -6525,6 +6841,7 @@ for ac_symprfx in "" "_"; do
-   else
-     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-   fi
-+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
- 
-   # Check to see that the pipe works correctly.
-   pipe_works=no
-@@ -6566,6 +6883,18 @@ _LT_EOF
-       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- 	  cat <<_LT_EOF > conftest.$ac_ext
-+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-+/* DATA imports from DLLs on WIN32 con't be const, because runtime
-+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-+# define LT_DLSYM_CONST
-+#elif defined(__osf__)
-+/* This system does not cope well with relocations in const data.  */
-+# define LT_DLSYM_CONST
-+#else
-+# define LT_DLSYM_CONST const
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -6577,7 +6906,7 @@ _LT_EOF
- 	  cat <<_LT_EOF >> conftest.$ac_ext
- 
- /* The mapping between symbol names and symbols.  */
--const struct {
-+LT_DLSYM_CONST struct {
-   const char *name;
-   void       *address;
- }
-@@ -6603,8 +6932,8 @@ static const void *lt_preloaded_setup() {
- _LT_EOF
- 	  # Now try linking the two files.
- 	  mv conftest.$ac_objext conftstm.$ac_objext
--	  lt_save_LIBS="$LIBS"
--	  lt_save_CFLAGS="$CFLAGS"
-+	  lt_globsym_save_LIBS=$LIBS
-+	  lt_globsym_save_CFLAGS=$CFLAGS
- 	  LIBS="conftstm.$ac_objext"
- 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-@@ -6614,8 +6943,8 @@ _LT_EOF
-   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
- 	    pipe_works=yes
- 	  fi
--	  LIBS="$lt_save_LIBS"
--	  CFLAGS="$lt_save_CFLAGS"
-+	  LIBS=$lt_globsym_save_LIBS
-+	  CFLAGS=$lt_globsym_save_CFLAGS
- 	else
- 	  echo "cannot find nm_test_func in $nlist" >&5
- 	fi
-@@ -6652,6 +6981,21 @@ else
- $as_echo "ok" >&6; }
- fi
- 
-+# Response file support.
-+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-+  nm_file_list_spec='@'
-+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
-+  nm_file_list_spec='@'
-+fi
-+
-+
-+
-+
-+
-+
-+
-+
-+
- 
- 
- 
-@@ -6670,6 +7014,40 @@ fi
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-+$as_echo_n "checking for sysroot... " >&6; }
-+
-+# Check whether --with-libtool-sysroot was given.
-+if test "${with_libtool_sysroot+set}" = set; then :
-+  withval=$with_libtool_sysroot;
-+else
-+  with_libtool_sysroot=no
-+fi
-+
-+
-+lt_sysroot=
-+case ${with_libtool_sysroot} in #(
-+ yes)
-+   if test "$GCC" = yes; then
-+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-+   fi
-+   ;; #(
-+ /*)
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
-+   ;; #(
-+ no|'')
-+   ;; #(
-+ *)
-+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
-+$as_echo "${with_libtool_sysroot}" >&6; }
-+   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
-+   ;;
-+esac
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-+$as_echo "${lt_sysroot:-no}" >&6; }
-+
-+
- 
- 
- 
-@@ -6879,6 +7257,123 @@ esac
- 
- need_locks="$enable_libtool_lock"
- 
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$MANIFEST_TOOL"; then
-+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-+if test -n "$MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-+$as_echo "$MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
-+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
-+  # Extract the first word of "mt", so it can be a program name with args.
-+set dummy mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-+if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
-+    MANIFEST_TOOL=":"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
-+  fi
-+else
-+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-+fi
-+
-+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-+if test "${lt_cv_path_mainfest_tool+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_path_mainfest_tool=no
-+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
-+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-+  cat conftest.err >&5
-+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-+    lt_cv_path_mainfest_tool=yes
-+  fi
-+  rm -f conftest*
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-+if test "x$lt_cv_path_mainfest_tool" != xyes; then
-+  MANIFEST_TOOL=:
-+fi
-+
-+
-+
-+
-+
- 
-   case $host_os in
-     rhapsody* | darwin*)
-@@ -7442,6 +7937,8 @@ _LT_EOF
-       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-       echo "$AR cru libconftest.a conftest.o" >&5
-       $AR cru libconftest.a conftest.o 2>&5
-+      echo "$RANLIB libconftest.a" >&5
-+      $RANLIB libconftest.a 2>&5
-       cat > conftest.c << _LT_EOF
- int main() { return 0;}
- _LT_EOF
-@@ -7637,7 +8134,8 @@ fi
- LIBTOOL_DEPS="$ltmain"
- 
- # Always use our own libtool.
--LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-+LIBTOOL='$(SHELL) $(top_builddir)'
-+LIBTOOL="$LIBTOOL/${host_alias}-libtool"
- 
- 
- 
-@@ -7726,7 +8224,7 @@ aix3*)
- esac
- 
- # Global variables:
--ofile=libtool
-+ofile=${host_alias}-libtool
- can_build_shared=yes
- 
- # All known linkers require a `.a' archive for static linking (except MSVC,
-@@ -8024,8 +8522,6 @@ fi
- lt_prog_compiler_pic=
- lt_prog_compiler_static=
- 
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
--$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 
-   if test "$GCC" = yes; then
-     lt_prog_compiler_wl='-Wl,'
-@@ -8191,6 +8687,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 	lt_prog_compiler_pic='--shared'
- 	lt_prog_compiler_static='--static'
- 	;;
-+      nagfor*)
-+	# NAG Fortran compiler
-+	lt_prog_compiler_wl='-Wl,-Wl,,'
-+	lt_prog_compiler_pic='-PIC'
-+	lt_prog_compiler_static='-Bstatic'
-+	;;
-       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-         # Portland Group compilers (*not* the Pentium gcc compiler,
- 	# which looks to be a dead project)
-@@ -8253,7 +8755,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-       lt_prog_compiler_pic='-KPIC'
-       lt_prog_compiler_static='-Bstatic'
-       case $cc_basename in
--      f77* | f90* | f95*)
-+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- 	lt_prog_compiler_wl='-Qoption ld ';;
-       *)
- 	lt_prog_compiler_wl='-Wl,';;
-@@ -8310,13 +8812,17 @@ case $host_os in
-     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-     ;;
- esac
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
--$as_echo "$lt_prog_compiler_pic" >&6; }
--
--
--
--
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-+if test "${lt_cv_prog_compiler_pic+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
- 
- #
- # Check to make sure the PIC flag actually works.
-@@ -8377,6 +8883,11 @@ fi
- 
- 
- 
-+
-+
-+
-+
-+
- #
- # Check to make sure the static flag actually works.
- #
-@@ -8727,7 +9238,8 @@ _LT_EOF
-       allow_undefined_flag=unsupported
-       always_export_symbols=no
-       enable_shared_with_static_runtimes=yes
--      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
- 
-       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-@@ -8826,12 +9338,12 @@ _LT_EOF
- 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- 	  hardcode_libdir_flag_spec=
- 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
--	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- 	  if test "x$supports_anon_versioning" = xyes; then
- 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- 	      echo "local: *; };" >> $output_objdir/$libname.ver~
--	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- 	  fi
- 	  ;;
- 	esac
-@@ -8845,8 +9357,8 @@ _LT_EOF
- 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- 	wlarc=
-       else
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       fi
-       ;;
- 
-@@ -8864,8 +9376,8 @@ _LT_EOF
- 
- _LT_EOF
-       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -8911,8 +9423,8 @@ _LT_EOF
- 
-     *)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -9042,7 +9554,13 @@ _LT_EOF
- 	allow_undefined_flag='-berok'
-         # Determine the default libpath from the value encoded in an
-         # empty executable.
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+        if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9055,22 +9573,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
-         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-@@ -9082,7 +9607,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	else
- 	 # Determine the default libpath from the value encoded in an
- 	 # empty executable.
--	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	 if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9095,22 +9626,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
- 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- 	  # Warning - without using the other run time loading flags,
-@@ -9155,20 +9693,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-       # Microsoft Visual C++.
-       # hardcode_libdir_flag_spec is actually meaningless, as there is
-       # no search path for DLLs.
--      hardcode_libdir_flag_spec=' '
--      allow_undefined_flag=unsupported
--      # Tell ltmain to make .lib files, not .a files.
--      libext=lib
--      # Tell ltmain to make .dll files, not .so files.
--      shrext_cmds=".dll"
--      # FIXME: Setting linknames here is a bad hack.
--      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
--      # The linker will automatically build a .lib file if we build a DLL.
--      old_archive_from_new_cmds='true'
--      # FIXME: Should let the user specify the lib program.
--      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
--      fix_srcfile_path='`cygpath -w "$srcfile"`'
--      enable_shared_with_static_runtimes=yes
-+      case $cc_basename in
-+      cl*)
-+	# Native MSVC
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	always_export_symbols=yes
-+	file_list_spec='@'
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-+	  else
-+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-+	  fi~
-+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-+	  linknames='
-+	# The linker will not automatically build a static lib if we build a DLL.
-+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
-+	enable_shared_with_static_runtimes=yes
-+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+	# Don't use ranlib
-+	old_postinstall_cmds='chmod 644 $oldlib'
-+	postlink_cmds='lt_outputfile="@OUTPUT@"~
-+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-+	  case $lt_outputfile in
-+	    *.exe|*.EXE) ;;
-+	    *)
-+	      lt_outputfile="$lt_outputfile.exe"
-+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-+	      ;;
-+	  esac~
-+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-+	    $RM "$lt_outputfile.manifest";
-+	  fi'
-+	;;
-+      *)
-+	# Assume MSVC wrapper
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-+	# The linker will automatically build a .lib file if we build a DLL.
-+	old_archive_from_new_cmds='true'
-+	# FIXME: Should let the user specify the lib program.
-+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-+	enable_shared_with_static_runtimes=yes
-+	;;
-+      esac
-       ;;
- 
-     darwin* | rhapsody*)
-@@ -9229,7 +9810,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-     freebsd* | dragonfly*)
--      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-       hardcode_direct=yes
-       hardcode_shlibpath_var=no
-@@ -9237,7 +9818,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux9*)
-       if test "$GCC" = yes; then
--	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       else
- 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       fi
-@@ -9253,7 +9834,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux10*)
-       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
--	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-       else
- 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-       fi
-@@ -9277,10 +9858,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	ia64*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	esac
-       else
-@@ -9359,23 +9940,36 @@ fi
- 
-     irix5* | irix6* | nonstopux*)
-       if test "$GCC" = yes; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	# Try to use the -exported_symbol ld option, if it does not
- 	# work, assume that -exports_file does not work either and
- 	# implicitly export all symbols.
--        save_LDFLAGS="$LDFLAGS"
--        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	# This should be the same for all languages, so no per-tag cache variable.
-+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-+if test "${lt_cv_irix_exported_symbol+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  save_LDFLAGS="$LDFLAGS"
-+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
--int foo(void) {}
-+int foo (void) { return 0; }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
--  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
--
-+  lt_cv_irix_exported_symbol=yes
-+else
-+  lt_cv_irix_exported_symbol=no
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--        LDFLAGS="$save_LDFLAGS"
-+           LDFLAGS="$save_LDFLAGS"
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
-+	if test "$lt_cv_irix_exported_symbol" = yes; then
-+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-+	fi
-       else
- 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-@@ -9460,7 +10054,7 @@ rm -f core conftest.err conftest.$ac_objext \
-     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-       if test "$GCC" = yes; then
- 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
--	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-       else
- 	allow_undefined_flag=' -expect_unresolved \*'
-@@ -9479,9 +10073,9 @@ rm -f core conftest.err conftest.$ac_objext \
-       no_undefined_flag=' -z defs'
-       if test "$GCC" = yes; then
- 	wlarc='${wl}'
--	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
--	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-       else
- 	case `$CC -V 2>&1` in
- 	*"Compilers 5.0"*)
-@@ -10057,8 +10651,9 @@ cygwin* | mingw* | pw32* | cegcc*)
-   need_version=no
-   need_lib_prefix=no
- 
--  case $GCC,$host_os in
--  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-+  case $GCC,$cc_basename in
-+  yes,*)
-+    # gcc
-     library_names_spec='$libname.dll.a'
-     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-     postinstall_cmds='base_file=`basename \${file}`~
-@@ -10091,13 +10686,71 @@ cygwin* | mingw* | pw32* | cegcc*)
-       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-       ;;
-     esac
-+    dynamic_linker='Win32 ld.exe'
-+    ;;
-+
-+  *,cl*)
-+    # Native MSVC
-+    libname_spec='$name'
-+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-+    library_names_spec='${libname}.dll.lib'
-+
-+    case $build_os in
-+    mingw*)
-+      sys_lib_search_path_spec=
-+      lt_save_ifs=$IFS
-+      IFS=';'
-+      for lt_path in $LIB
-+      do
-+        IFS=$lt_save_ifs
-+        # Let DOS variable expansion print the short 8.3 style file name.
-+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-+      done
-+      IFS=$lt_save_ifs
-+      # Convert to MSYS style.
-+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-+      ;;
-+    cygwin*)
-+      # Convert to unix form, then to dos form, then back to unix form
-+      # but this time dos style (no spaces!) so that the unix form looks
-+      # like /cygdrive/c/PROGRA~1:/cygdr...
-+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      ;;
-+    *)
-+      sys_lib_search_path_spec="$LIB"
-+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-+        # It is most probably a Windows format PATH.
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-+      else
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      fi
-+      # FIXME: find the short name or the path components, as spaces are
-+      # common. (e.g. "Program Files" -> "PROGRA~1")
-+      ;;
-+    esac
-+
-+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-+    postinstall_cmds='base_file=`basename \${file}`~
-+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-+      dldir=$destdir/`dirname \$dlpath`~
-+      test -d \$dldir || mkdir -p \$dldir~
-+      $install_prog $dir/$dlname \$dldir/$dlname'
-+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-+      dlpath=$dir/\$dldll~
-+       $RM \$dlpath'
-+    shlibpath_overrides_runpath=yes
-+    dynamic_linker='Win32 link.exe'
-     ;;
- 
-   *)
-+    # Assume MSVC wrapper
-     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-+    dynamic_linker='Win32 ld.exe'
-     ;;
-   esac
--  dynamic_linker='Win32 ld.exe'
-   # FIXME: first we should search . and the directory the executable is in
-   shlibpath_var=PATH
-   ;;
-@@ -10189,7 +10842,7 @@ haiku*)
-   soname_spec='${libname}${release}${shared_ext}$major'
-   shlibpath_var=LIBRARY_PATH
-   shlibpath_overrides_runpath=yes
--  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-   hardcode_into_libs=yes
-   ;;
- 
-@@ -11029,10 +11682,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -11135,10 +11788,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -15350,13 +16003,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
- lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
- lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
- lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
- reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
- reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
- OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
- deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
- file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
- AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
- AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
- STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
- RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
- old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-@@ -15371,14 +16031,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
- lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
- objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
- MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
--lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
- lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
- need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
- DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
- NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
- LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-@@ -15411,12 +16074,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
- hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
- inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
- link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
--fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
- always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
- export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
- exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
- include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
- prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
- file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
- variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
- need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-@@ -15471,8 +16134,13 @@ reload_flag \
- OBJDUMP \
- deplibs_check_method \
- file_magic_cmd \
-+file_magic_glob \
-+want_nocaseglob \
-+DLLTOOL \
-+sharedlib_from_linklib_cmd \
- AR \
- AR_FLAGS \
-+archiver_list_spec \
- STRIP \
- RANLIB \
- CC \
-@@ -15482,12 +16150,14 @@ lt_cv_sys_global_symbol_pipe \
- lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-+nm_file_list_spec \
- lt_prog_compiler_no_builtin_flag \
--lt_prog_compiler_wl \
- lt_prog_compiler_pic \
-+lt_prog_compiler_wl \
- lt_prog_compiler_static \
- lt_cv_prog_compiler_c_o \
- need_locks \
-+MANIFEST_TOOL \
- DSYMUTIL \
- NMEDIT \
- LIPO \
-@@ -15503,7 +16173,6 @@ no_undefined_flag \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
--fix_srcfile_path \
- exclude_expsyms \
- include_expsyms \
- file_list_spec \
-@@ -15539,6 +16208,7 @@ module_cmds \
- module_expsym_cmds \
- export_symbols_cmds \
- prelink_cmds \
-+postlink_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- finish_cmds \
-@@ -16303,7 +16973,8 @@ $as_echo X"$file" |
- # NOTE: Changes made to this file will be lost: look at ltmain.sh.
- #
- #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
--#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-+#                 Inc.
- #   Written by Gordon Matzigkeit, 1996
- #
- #   This file is part of GNU Libtool.
-@@ -16406,19 +17077,42 @@ SP2NL=$lt_lt_SP2NL
- # turn newlines into spaces.
- NL2SP=$lt_lt_NL2SP
- 
-+# convert \$build file names to \$host format.
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+
-+# convert \$build files to toolchain format.
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+
- # An object symbol dumper.
- OBJDUMP=$lt_OBJDUMP
- 
- # Method to check whether dependent libraries are shared objects.
- deplibs_check_method=$lt_deplibs_check_method
- 
--# Command to use when deplibs_check_method == "file_magic".
-+# Command to use when deplibs_check_method = "file_magic".
- file_magic_cmd=$lt_file_magic_cmd
- 
-+# How to find potential files when deplibs_check_method = "file_magic".
-+file_magic_glob=$lt_file_magic_glob
-+
-+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-+want_nocaseglob=$lt_want_nocaseglob
-+
-+# DLL creation program.
-+DLLTOOL=$lt_DLLTOOL
-+
-+# Command to associate shared and link libraries.
-+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-+
- # The archiver.
- AR=$lt_AR
-+
-+# Flags to create an archive.
- AR_FLAGS=$lt_AR_FLAGS
- 
-+# How to feed a file listing to the archiver.
-+archiver_list_spec=$lt_archiver_list_spec
-+
- # A symbol stripping program.
- STRIP=$lt_STRIP
- 
-@@ -16448,6 +17142,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
- # Transform the output of nm in a C name address pair when lib prefix is needed.
- global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
- 
-+# Specify filename containing input files for \$NM.
-+nm_file_list_spec=$lt_nm_file_list_spec
-+
-+# The root where to search for dependent libraries,and in which our libraries should be installed.
-+lt_sysroot=$lt_sysroot
-+
- # The name of the directory that contains temporary libtool files.
- objdir=$objdir
- 
-@@ -16457,6 +17157,9 @@ MAGIC_CMD=$MAGIC_CMD
- # Must we lock files when doing compilation?
- need_locks=$lt_need_locks
- 
-+# Manifest tool.
-+MANIFEST_TOOL=$lt_MANIFEST_TOOL
-+
- # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
- DSYMUTIL=$lt_DSYMUTIL
- 
-@@ -16571,12 +17274,12 @@ with_gcc=$GCC
- # Compiler flag to turn off builtin functions.
- no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
- 
--# How to pass a linker flag through the compiler.
--wl=$lt_lt_prog_compiler_wl
--
- # Additional compiler flags for building library objects.
- pic_flag=$lt_lt_prog_compiler_pic
- 
-+# How to pass a linker flag through the compiler.
-+wl=$lt_lt_prog_compiler_wl
-+
- # Compiler flag to prevent dynamic linking.
- link_static_flag=$lt_lt_prog_compiler_static
- 
-@@ -16663,9 +17366,6 @@ inherit_rpath=$inherit_rpath
- # Whether libtool must link a program against all its dependency libraries.
- link_all_deplibs=$link_all_deplibs
- 
--# Fix the shell variable \$srcfile for the compiler.
--fix_srcfile_path=$lt_fix_srcfile_path
--
- # Set to "yes" if exported symbols are required.
- always_export_symbols=$always_export_symbols
- 
-@@ -16681,6 +17381,9 @@ include_expsyms=$lt_include_expsyms
- # Commands necessary for linking programs (against libraries) with templates.
- prelink_cmds=$lt_prelink_cmds
- 
-+# Commands necessary for finishing linking programs.
-+postlink_cmds=$lt_postlink_cmds
-+
- # Specify filename containing input files.
- file_list_spec=$lt_file_list_spec
- 
-@@ -16713,210 +17416,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
-   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-   # text mode, it properly converts lines to CR/LF.  This bash problem
-   # is reportedly fixed, but why not run on old versions too?
--  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  case $xsi_shell in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result="${1##*/}"
--}
--
--# func_dirname_and_basename file append nondir_replacement
--# perform func_basename and func_dirname in a single function
--# call:
--#   dirname:  Compute the dirname of FILE.  If nonempty,
--#             add APPEND to the result, otherwise set result
--#             to NONDIR_REPLACEMENT.
--#             value returned in "$func_dirname_result"
--#   basename: Compute filename of FILE.
--#             value retuned in "$func_basename_result"
--# Implementation must be kept synchronized with func_dirname
--# and func_basename. For efficiency, we do not delegate to
--# those functions but instead duplicate the functionality here.
--func_dirname_and_basename ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--  func_basename_result="${1##*/}"
--}
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--func_stripname ()
--{
--  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
--  # positional parameters, so assign one to ordinary parameter first.
--  func_stripname_result=${3}
--  func_stripname_result=${func_stripname_result#"${1}"}
--  func_stripname_result=${func_stripname_result%"${2}"}
--}
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=${1%%=*}
--  func_opt_split_arg=${1#*=}
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  case ${1} in
--    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
--    *)    func_lo2o_result=${1} ;;
--  esac
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=${1%.*}.lo
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=$(( $* ))
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=${#1}
--}
--
--_LT_EOF
--    ;;
--  *) # Bourne compatible functions.
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  # Extract subdirectory from the argument.
--  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
--  if test "X$func_dirname_result" = "X${1}"; then
--    func_dirname_result="${3}"
--  else
--    func_dirname_result="$func_dirname_result${2}"
--  fi
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
--}
--
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--# func_strip_suffix prefix name
--func_stripname ()
--{
--  case ${2} in
--    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
--    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
--  esac
--}
--
--# sed scripts:
--my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
--my_sed_long_arg='1s/^-[^=]*=//'
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
--  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=`expr "$@"`
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
--}
--
--_LT_EOF
--esac
--
--case $lt_shell_append in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1+=\$2"
--}
--_LT_EOF
--    ;;
--  *)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1=\$$1\$2"
--}
--
--_LT_EOF
--    ;;
--  esac
--
--
--  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  mv -f "$cfgfile" "$ofile" ||
-+  sed '$q' "$ltmain" >> "$cfgfile" \
-+     || (rm -f "$cfgfile"; exit 1)
-+
-+  if test x"$xsi_shell" = xyes; then
-+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-+func_dirname ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-+func_basename ()\
-+{\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-+func_dirname_and_basename ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-+func_stripname ()\
-+{\
-+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-+\    # positional parameters, so assign one to ordinary parameter first.\
-+\    func_stripname_result=${3}\
-+\    func_stripname_result=${func_stripname_result#"${1}"}\
-+\    func_stripname_result=${func_stripname_result%"${2}"}\
-+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-+func_split_long_opt ()\
-+{\
-+\    func_split_long_opt_name=${1%%=*}\
-+\    func_split_long_opt_arg=${1#*=}\
-+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-+func_split_short_opt ()\
-+{\
-+\    func_split_short_opt_arg=${1#??}\
-+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-+func_lo2o ()\
-+{\
-+\    case ${1} in\
-+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-+\      *)    func_lo2o_result=${1} ;;\
-+\    esac\
-+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-+func_xform ()\
-+{\
-+    func_xform_result=${1%.*}.lo\
-+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-+func_arith ()\
-+{\
-+    func_arith_result=$(( $* ))\
-+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_len ()$/,/^} # func_len /c\
-+func_len ()\
-+{\
-+    func_len_result=${#1}\
-+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+fi
-+
-+if test x"$lt_shell_append" = xyes; then
-+  sed -e '/^func_append ()$/,/^} # func_append /c\
-+func_append ()\
-+{\
-+    eval "${1}+=\\${2}"\
-+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-+func_append_quoted ()\
-+{\
-+\    func_quote_for_eval "${2}"\
-+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  # Save a `func_append' function call where possible by direct use of '+='
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+else
-+  # Save a `func_append' function call even when '+=' is not available
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+fi
-+
-+if test x"$_lt_function_replace_fail" = x":"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-+fi
-+
-+
-+   mv -f "$cfgfile" "$ofile" ||
-     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-   chmod +x "$ofile"
- 
-diff --git a/gprof/configure b/gprof/configure
-index 626e1c7..a88719c 100755
---- a/gprof/configure
-+++ b/gprof/configure
-@@ -630,8 +630,11 @@ OTOOL
- LIPO
- NMEDIT
- DSYMUTIL
-+MANIFEST_TOOL
- RANLIB
-+ac_ct_AR
- AR
-+DLLTOOL
- OBJDUMP
- LN_S
- NM
-@@ -743,6 +746,7 @@ enable_static
- with_pic
- enable_fast_install
- with_gnu_ld
-+with_libtool_sysroot
- enable_libtool_lock
- enable_plugins
- enable_largefile
-@@ -1401,6 +1405,8 @@ Optional Packages:
-   --with-pic              try to use only PIC/non-PIC objects [default=use
-                           both]
-   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-+  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
-+                        (or the compiler's sysroot if not specified).
- 
- Some influential environment variables:
-   CC          C compiler command
-@@ -4835,8 +4841,8 @@ esac
- 
- 
- 
--macro_version='2.2.7a'
--macro_revision='1.3134'
-+macro_version='2.4'
-+macro_revision='1.3293'
- 
- 
- 
-@@ -4876,7 +4882,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
- $as_echo_n "checking how to print strings... " >&6; }
- # Test print first, because it will be a builtin if present.
--if test "X`print -r -- -n 2>/dev/null`" = X-n && \
-+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-   ECHO='print -r --'
- elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-@@ -5562,8 +5568,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
- # Try some XSI features
- xsi_shell=no
- ( _lt_dummy="a/b/c"
--  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
--      = c,a/b,, \
-+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-+      = c,a/b,b/c, \
-     && eval 'test $(( 1 + 1 )) -eq 2 \
-     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-   && xsi_shell=yes
-@@ -5612,6 +5618,80 @@ esac
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-+if test "${lt_cv_to_host_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-+        ;;
-+    esac
-+    ;;
-+  *-*-cygwin* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_noop
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-+        ;;
-+    esac
-+    ;;
-+  * ) # unhandled hosts (and "normal" native builds)
-+    lt_cv_to_host_file_cmd=func_convert_file_noop
-+    ;;
-+esac
-+
-+fi
-+
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-+if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  #assume ordinary cross tools, or native build.
-+lt_cv_to_tool_file_cmd=func_convert_file_noop
-+case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+    esac
-+    ;;
-+esac
-+
-+fi
-+
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-+
-+
-+
-+
-+
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
- $as_echo_n "checking for $LD option to reload object files... " >&6; }
- if test "${lt_cv_ld_reload_flag+set}" = set; then :
-@@ -5628,6 +5708,11 @@ case $reload_flag in
- esac
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- case $host_os in
-+  cygwin* | mingw* | pw32* | cegcc*)
-+    if test "$GCC" != yes; then
-+      reload_cmds=false
-+    fi
-+    ;;
-   darwin*)
-     if test "$GCC" = yes; then
-       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-@@ -5796,7 +5881,8 @@ mingw* | pw32*)
-     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-     lt_cv_file_magic_cmd='func_win32_libid'
-   else
--    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-+    # Keep this pattern in sync with the one in func_win32_libid.
-+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-     lt_cv_file_magic_cmd='$OBJDUMP -f'
-   fi
-   ;;
-@@ -5873,11 +5959,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
-   lt_cv_deplibs_check_method=pass_all
-   ;;
- 
--linux-uclibc*)
--  lt_cv_deplibs_check_method=pass_all
--  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
--  ;;
--
- netbsd*)
-   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-@@ -5955,6 +6036,21 @@ esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
- $as_echo "$lt_cv_deplibs_check_method" >&6; }
-+
-+file_magic_glob=
-+want_nocaseglob=no
-+if test "$build" = "$host"; then
-+  case $host_os in
-+  mingw* | pw32*)
-+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-+      want_nocaseglob=yes
-+    else
-+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
-+    fi
-+    ;;
-+  esac
-+fi
-+
- file_magic_cmd=$lt_cv_file_magic_cmd
- deplibs_check_method=$lt_cv_deplibs_check_method
- test -z "$deplibs_check_method" && deplibs_check_method=unknown
-@@ -5970,9 +6066,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
- 
- 
- 
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$DLLTOOL"; then
-+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+DLLTOOL=$ac_cv_prog_DLLTOOL
-+if test -n "$DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-+$as_echo "$DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_DLLTOOL"; then
-+  ac_ct_DLLTOOL=$DLLTOOL
-+  # Extract the first word of "dlltool", so it can be a program name with args.
-+set dummy dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_DLLTOOL"; then
-+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-+if test -n "$ac_ct_DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-+$as_echo "$ac_ct_DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_DLLTOOL" = x; then
-+    DLLTOOL="false"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    DLLTOOL=$ac_ct_DLLTOOL
-+  fi
-+else
-+  DLLTOOL="$ac_cv_prog_DLLTOOL"
-+fi
-+
-+test -z "$DLLTOOL" && DLLTOOL=dlltool
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-+if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_sharedlib_from_linklib_cmd='unknown'
-+
-+case $host_os in
-+cygwin* | mingw* | pw32* | cegcc*)
-+  # two different shell functions defined in ltmain.sh
-+  # decide which to use based on capabilities of $DLLTOOL
-+  case `$DLLTOOL --help 2>&1` in
-+  *--identify-strict*)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-+    ;;
-+  *)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-+    ;;
-+  esac
-+  ;;
-+*)
-+  # fallback: assume linklib IS sharedlib
-+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-+  ;;
-+esac
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-+
-+
-+
-+
-+
-+
-+
- if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
--set dummy ${ac_tool_prefix}ar; ac_word=$2
-+  for ac_prog in ar
-+  do
-+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_AR+set}" = set; then :
-@@ -5988,7 +6237,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_AR="${ac_tool_prefix}ar"
-+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6008,11 +6257,15 @@ $as_echo "no" >&6; }
- fi
- 
- 
-+    test -n "$AR" && break
-+  done
- fi
--if test -z "$ac_cv_prog_AR"; then
-+if test -z "$AR"; then
-   ac_ct_AR=$AR
--  # Extract the first word of "ar", so it can be a program name with args.
--set dummy ar; ac_word=$2
-+  for ac_prog in ar
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
-@@ -6028,7 +6281,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_ac_ct_AR="ar"
-+    ac_cv_prog_ac_ct_AR="$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6047,6 +6300,10 @@ else
- $as_echo "no" >&6; }
- fi
- 
-+
-+  test -n "$ac_ct_AR" && break
-+done
-+
-   if test "x$ac_ct_AR" = x; then
-     AR="false"
-   else
-@@ -6058,12 +6315,10 @@ ac_tool_warned=yes ;;
- esac
-     AR=$ac_ct_AR
-   fi
--else
--  AR="$ac_cv_prog_AR"
- fi
- 
--test -z "$AR" && AR=ar
--test -z "$AR_FLAGS" && AR_FLAGS=cru
-+: ${AR=ar}
-+: ${AR_FLAGS=cru}
- 
- 
- 
-@@ -6075,6 +6330,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-+$as_echo_n "checking for archiver @FILE support... " >&6; }
-+if test "${lt_cv_ar_at_file+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_ar_at_file=no
-+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+  echo conftest.$ac_objext > conftest.lst
-+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
-+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+      if test "$ac_status" -eq 0; then
-+	# Ensure the archiver fails upon bogus file names.
-+	rm -f conftest.$ac_objext libconftest.a
-+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+	if test "$ac_status" -ne 0; then
-+          lt_cv_ar_at_file=@
-+        fi
-+      fi
-+      rm -f conftest.* libconftest.a
-+
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-+$as_echo "$lt_cv_ar_at_file" >&6; }
-+
-+if test "x$lt_cv_ar_at_file" = xno; then
-+  archiver_list_spec=
-+else
-+  archiver_list_spec=$lt_cv_ar_at_file
-+fi
-+
-+
-+
-+
-+
-+
-+
- if test -n "$ac_tool_prefix"; then
-   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
- set dummy ${ac_tool_prefix}strip; ac_word=$2
-@@ -6409,8 +6722,8 @@ esac
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- 
- # Transform an extracted symbol line into symbol name and symbol address
--lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
--lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
- 
- # Handle CRLF in mingw tool chain
- opt_cr=
-@@ -6446,6 +6759,7 @@ for ac_symprfx in "" "_"; do
-   else
-     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-   fi
-+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
- 
-   # Check to see that the pipe works correctly.
-   pipe_works=no
-@@ -6487,6 +6801,18 @@ _LT_EOF
-       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- 	  cat <<_LT_EOF > conftest.$ac_ext
-+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-+/* DATA imports from DLLs on WIN32 con't be const, because runtime
-+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-+# define LT_DLSYM_CONST
-+#elif defined(__osf__)
-+/* This system does not cope well with relocations in const data.  */
-+# define LT_DLSYM_CONST
-+#else
-+# define LT_DLSYM_CONST const
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -6498,7 +6824,7 @@ _LT_EOF
- 	  cat <<_LT_EOF >> conftest.$ac_ext
- 
- /* The mapping between symbol names and symbols.  */
--const struct {
-+LT_DLSYM_CONST struct {
-   const char *name;
-   void       *address;
- }
-@@ -6524,8 +6850,8 @@ static const void *lt_preloaded_setup() {
- _LT_EOF
- 	  # Now try linking the two files.
- 	  mv conftest.$ac_objext conftstm.$ac_objext
--	  lt_save_LIBS="$LIBS"
--	  lt_save_CFLAGS="$CFLAGS"
-+	  lt_globsym_save_LIBS=$LIBS
-+	  lt_globsym_save_CFLAGS=$CFLAGS
- 	  LIBS="conftstm.$ac_objext"
- 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-@@ -6535,8 +6861,8 @@ _LT_EOF
-   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
- 	    pipe_works=yes
- 	  fi
--	  LIBS="$lt_save_LIBS"
--	  CFLAGS="$lt_save_CFLAGS"
-+	  LIBS=$lt_globsym_save_LIBS
-+	  CFLAGS=$lt_globsym_save_CFLAGS
- 	else
- 	  echo "cannot find nm_test_func in $nlist" >&5
- 	fi
-@@ -6573,6 +6899,18 @@ else
- $as_echo "ok" >&6; }
- fi
- 
-+# Response file support.
-+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-+  nm_file_list_spec='@'
-+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
-+  nm_file_list_spec='@'
-+fi
-+
-+
-+
-+
-+
-+
- 
- 
- 
-@@ -6594,6 +6932,43 @@ fi
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-+$as_echo_n "checking for sysroot... " >&6; }
-+
-+# Check whether --with-libtool-sysroot was given.
-+if test "${with_libtool_sysroot+set}" = set; then :
-+  withval=$with_libtool_sysroot;
-+else
-+  with_libtool_sysroot=no
-+fi
-+
-+
-+lt_sysroot=
-+case ${with_libtool_sysroot} in #(
-+ yes)
-+   if test "$GCC" = yes; then
-+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-+   fi
-+   ;; #(
-+ /*)
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
-+   ;; #(
-+ no|'')
-+   ;; #(
-+ *)
-+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
-+$as_echo "${with_libtool_sysroot}" >&6; }
-+   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
-+   ;;
-+esac
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-+$as_echo "${lt_sysroot:-no}" >&6; }
-+
-+
-+
-+
-+
- # Check whether --enable-libtool-lock was given.
- if test "${enable_libtool_lock+set}" = set; then :
-   enableval=$enable_libtool_lock;
-@@ -6800,6 +7175,123 @@ esac
- 
- need_locks="$enable_libtool_lock"
- 
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$MANIFEST_TOOL"; then
-+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-+if test -n "$MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-+$as_echo "$MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
-+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
-+  # Extract the first word of "mt", so it can be a program name with args.
-+set dummy mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-+if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
-+    MANIFEST_TOOL=":"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
-+  fi
-+else
-+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-+fi
-+
-+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-+if test "${lt_cv_path_mainfest_tool+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_path_mainfest_tool=no
-+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
-+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-+  cat conftest.err >&5
-+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-+    lt_cv_path_mainfest_tool=yes
-+  fi
-+  rm -f conftest*
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-+if test "x$lt_cv_path_mainfest_tool" != xyes; then
-+  MANIFEST_TOOL=:
-+fi
-+
-+
-+
-+
-+
- 
-   case $host_os in
-     rhapsody* | darwin*)
-@@ -7363,6 +7855,8 @@ _LT_EOF
-       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-       echo "$AR cru libconftest.a conftest.o" >&5
-       $AR cru libconftest.a conftest.o 2>&5
-+      echo "$RANLIB libconftest.a" >&5
-+      $RANLIB libconftest.a 2>&5
-       cat > conftest.c << _LT_EOF
- int main() { return 0;}
- _LT_EOF
-@@ -7558,7 +8052,8 @@ fi
- LIBTOOL_DEPS="$ltmain"
- 
- # Always use our own libtool.
--LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-+LIBTOOL='$(SHELL) $(top_builddir)'
-+LIBTOOL="$LIBTOOL/${host_alias}-libtool"
- 
- 
- 
-@@ -7647,7 +8142,7 @@ aix3*)
- esac
- 
- # Global variables:
--ofile=libtool
-+ofile=${host_alias}-libtool
- can_build_shared=yes
- 
- # All known linkers require a `.a' archive for static linking (except MSVC,
-@@ -7945,8 +8440,6 @@ fi
- lt_prog_compiler_pic=
- lt_prog_compiler_static=
- 
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
--$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 
-   if test "$GCC" = yes; then
-     lt_prog_compiler_wl='-Wl,'
-@@ -8112,6 +8605,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 	lt_prog_compiler_pic='--shared'
- 	lt_prog_compiler_static='--static'
- 	;;
-+      nagfor*)
-+	# NAG Fortran compiler
-+	lt_prog_compiler_wl='-Wl,-Wl,,'
-+	lt_prog_compiler_pic='-PIC'
-+	lt_prog_compiler_static='-Bstatic'
-+	;;
-       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-         # Portland Group compilers (*not* the Pentium gcc compiler,
- 	# which looks to be a dead project)
-@@ -8174,7 +8673,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-       lt_prog_compiler_pic='-KPIC'
-       lt_prog_compiler_static='-Bstatic'
-       case $cc_basename in
--      f77* | f90* | f95*)
-+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- 	lt_prog_compiler_wl='-Qoption ld ';;
-       *)
- 	lt_prog_compiler_wl='-Wl,';;
-@@ -8231,13 +8730,17 @@ case $host_os in
-     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-     ;;
- esac
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
--$as_echo "$lt_prog_compiler_pic" >&6; }
--
--
--
--
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-+if test "${lt_cv_prog_compiler_pic+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
- 
- #
- # Check to make sure the PIC flag actually works.
-@@ -8298,6 +8801,11 @@ fi
- 
- 
- 
-+
-+
-+
-+
-+
- #
- # Check to make sure the static flag actually works.
- #
-@@ -8648,7 +9156,8 @@ _LT_EOF
-       allow_undefined_flag=unsupported
-       always_export_symbols=no
-       enable_shared_with_static_runtimes=yes
--      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
- 
-       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-@@ -8747,12 +9256,12 @@ _LT_EOF
- 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- 	  hardcode_libdir_flag_spec=
- 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
--	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- 	  if test "x$supports_anon_versioning" = xyes; then
- 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- 	      echo "local: *; };" >> $output_objdir/$libname.ver~
--	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- 	  fi
- 	  ;;
- 	esac
-@@ -8766,8 +9275,8 @@ _LT_EOF
- 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- 	wlarc=
-       else
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       fi
-       ;;
- 
-@@ -8785,8 +9294,8 @@ _LT_EOF
- 
- _LT_EOF
-       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -8832,8 +9341,8 @@ _LT_EOF
- 
-     *)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -8963,7 +9472,13 @@ _LT_EOF
- 	allow_undefined_flag='-berok'
-         # Determine the default libpath from the value encoded in an
-         # empty executable.
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+        if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -8976,22 +9491,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
-         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-@@ -9003,7 +9525,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	else
- 	 # Determine the default libpath from the value encoded in an
- 	 # empty executable.
--	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	 if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9016,22 +9544,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
- 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- 	  # Warning - without using the other run time loading flags,
-@@ -9076,20 +9611,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-       # Microsoft Visual C++.
-       # hardcode_libdir_flag_spec is actually meaningless, as there is
-       # no search path for DLLs.
--      hardcode_libdir_flag_spec=' '
--      allow_undefined_flag=unsupported
--      # Tell ltmain to make .lib files, not .a files.
--      libext=lib
--      # Tell ltmain to make .dll files, not .so files.
--      shrext_cmds=".dll"
--      # FIXME: Setting linknames here is a bad hack.
--      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
--      # The linker will automatically build a .lib file if we build a DLL.
--      old_archive_from_new_cmds='true'
--      # FIXME: Should let the user specify the lib program.
--      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
--      fix_srcfile_path='`cygpath -w "$srcfile"`'
--      enable_shared_with_static_runtimes=yes
-+      case $cc_basename in
-+      cl*)
-+	# Native MSVC
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	always_export_symbols=yes
-+	file_list_spec='@'
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-+	  else
-+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-+	  fi~
-+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-+	  linknames='
-+	# The linker will not automatically build a static lib if we build a DLL.
-+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
-+	enable_shared_with_static_runtimes=yes
-+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+	# Don't use ranlib
-+	old_postinstall_cmds='chmod 644 $oldlib'
-+	postlink_cmds='lt_outputfile="@OUTPUT@"~
-+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-+	  case $lt_outputfile in
-+	    *.exe|*.EXE) ;;
-+	    *)
-+	      lt_outputfile="$lt_outputfile.exe"
-+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-+	      ;;
-+	  esac~
-+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-+	    $RM "$lt_outputfile.manifest";
-+	  fi'
-+	;;
-+      *)
-+	# Assume MSVC wrapper
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-+	# The linker will automatically build a .lib file if we build a DLL.
-+	old_archive_from_new_cmds='true'
-+	# FIXME: Should let the user specify the lib program.
-+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-+	enable_shared_with_static_runtimes=yes
-+	;;
-+      esac
-       ;;
- 
-     darwin* | rhapsody*)
-@@ -9150,7 +9728,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-     freebsd* | dragonfly*)
--      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-       hardcode_direct=yes
-       hardcode_shlibpath_var=no
-@@ -9158,7 +9736,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux9*)
-       if test "$GCC" = yes; then
--	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       else
- 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       fi
-@@ -9174,7 +9752,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux10*)
-       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
--	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-       else
- 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-       fi
-@@ -9198,10 +9776,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	ia64*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	esac
-       else
-@@ -9280,23 +9858,36 @@ fi
- 
-     irix5* | irix6* | nonstopux*)
-       if test "$GCC" = yes; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	# Try to use the -exported_symbol ld option, if it does not
- 	# work, assume that -exports_file does not work either and
- 	# implicitly export all symbols.
--        save_LDFLAGS="$LDFLAGS"
--        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	# This should be the same for all languages, so no per-tag cache variable.
-+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-+if test "${lt_cv_irix_exported_symbol+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  save_LDFLAGS="$LDFLAGS"
-+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
--int foo(void) {}
-+int foo (void) { return 0; }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
--  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
--
-+  lt_cv_irix_exported_symbol=yes
-+else
-+  lt_cv_irix_exported_symbol=no
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--        LDFLAGS="$save_LDFLAGS"
-+           LDFLAGS="$save_LDFLAGS"
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
-+	if test "$lt_cv_irix_exported_symbol" = yes; then
-+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-+	fi
-       else
- 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-@@ -9381,7 +9972,7 @@ rm -f core conftest.err conftest.$ac_objext \
-     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-       if test "$GCC" = yes; then
- 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
--	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-       else
- 	allow_undefined_flag=' -expect_unresolved \*'
-@@ -9400,9 +9991,9 @@ rm -f core conftest.err conftest.$ac_objext \
-       no_undefined_flag=' -z defs'
-       if test "$GCC" = yes; then
- 	wlarc='${wl}'
--	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
--	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-       else
- 	case `$CC -V 2>&1` in
- 	*"Compilers 5.0"*)
-@@ -9978,8 +10569,9 @@ cygwin* | mingw* | pw32* | cegcc*)
-   need_version=no
-   need_lib_prefix=no
- 
--  case $GCC,$host_os in
--  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-+  case $GCC,$cc_basename in
-+  yes,*)
-+    # gcc
-     library_names_spec='$libname.dll.a'
-     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-     postinstall_cmds='base_file=`basename \${file}`~
-@@ -10012,13 +10604,71 @@ cygwin* | mingw* | pw32* | cegcc*)
-       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-       ;;
-     esac
-+    dynamic_linker='Win32 ld.exe'
-+    ;;
-+
-+  *,cl*)
-+    # Native MSVC
-+    libname_spec='$name'
-+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-+    library_names_spec='${libname}.dll.lib'
-+
-+    case $build_os in
-+    mingw*)
-+      sys_lib_search_path_spec=
-+      lt_save_ifs=$IFS
-+      IFS=';'
-+      for lt_path in $LIB
-+      do
-+        IFS=$lt_save_ifs
-+        # Let DOS variable expansion print the short 8.3 style file name.
-+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-+      done
-+      IFS=$lt_save_ifs
-+      # Convert to MSYS style.
-+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-+      ;;
-+    cygwin*)
-+      # Convert to unix form, then to dos form, then back to unix form
-+      # but this time dos style (no spaces!) so that the unix form looks
-+      # like /cygdrive/c/PROGRA~1:/cygdr...
-+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      ;;
-+    *)
-+      sys_lib_search_path_spec="$LIB"
-+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-+        # It is most probably a Windows format PATH.
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-+      else
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      fi
-+      # FIXME: find the short name or the path components, as spaces are
-+      # common. (e.g. "Program Files" -> "PROGRA~1")
-+      ;;
-+    esac
-+
-+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-+    postinstall_cmds='base_file=`basename \${file}`~
-+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-+      dldir=$destdir/`dirname \$dlpath`~
-+      test -d \$dldir || mkdir -p \$dldir~
-+      $install_prog $dir/$dlname \$dldir/$dlname'
-+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-+      dlpath=$dir/\$dldll~
-+       $RM \$dlpath'
-+    shlibpath_overrides_runpath=yes
-+    dynamic_linker='Win32 link.exe'
-     ;;
- 
-   *)
-+    # Assume MSVC wrapper
-     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-+    dynamic_linker='Win32 ld.exe'
-     ;;
-   esac
--  dynamic_linker='Win32 ld.exe'
-   # FIXME: first we should search . and the directory the executable is in
-   shlibpath_var=PATH
-   ;;
-@@ -10110,7 +10760,7 @@ haiku*)
-   soname_spec='${libname}${release}${shared_ext}$major'
-   shlibpath_var=LIBRARY_PATH
-   shlibpath_overrides_runpath=yes
--  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-   hardcode_into_libs=yes
-   ;;
- 
-@@ -10950,10 +11600,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -11056,10 +11706,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -12961,13 +13611,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
- lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
- lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
- lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
- reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
- reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
- OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
- deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
- file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
- AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
- AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
- STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
- RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
- old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-@@ -12982,14 +13639,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
- lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
- objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
- MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
--lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
- lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
- need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
- DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
- NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
- LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-@@ -13022,12 +13682,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
- hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
- inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
- link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
--fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
- always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
- export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
- exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
- include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
- prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
- file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
- variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
- need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-@@ -13082,8 +13742,13 @@ reload_flag \
- OBJDUMP \
- deplibs_check_method \
- file_magic_cmd \
-+file_magic_glob \
-+want_nocaseglob \
-+DLLTOOL \
-+sharedlib_from_linklib_cmd \
- AR \
- AR_FLAGS \
-+archiver_list_spec \
- STRIP \
- RANLIB \
- CC \
-@@ -13093,12 +13758,14 @@ lt_cv_sys_global_symbol_pipe \
- lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-+nm_file_list_spec \
- lt_prog_compiler_no_builtin_flag \
--lt_prog_compiler_wl \
- lt_prog_compiler_pic \
-+lt_prog_compiler_wl \
- lt_prog_compiler_static \
- lt_cv_prog_compiler_c_o \
- need_locks \
-+MANIFEST_TOOL \
- DSYMUTIL \
- NMEDIT \
- LIPO \
-@@ -13114,7 +13781,6 @@ no_undefined_flag \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
--fix_srcfile_path \
- exclude_expsyms \
- include_expsyms \
- file_list_spec \
-@@ -13150,6 +13816,7 @@ module_cmds \
- module_expsym_cmds \
- export_symbols_cmds \
- prelink_cmds \
-+postlink_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- finish_cmds \
-@@ -13906,7 +14573,8 @@ $as_echo X"$file" |
- # NOTE: Changes made to this file will be lost: look at ltmain.sh.
- #
- #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
--#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-+#                 Inc.
- #   Written by Gordon Matzigkeit, 1996
- #
- #   This file is part of GNU Libtool.
-@@ -14009,19 +14677,42 @@ SP2NL=$lt_lt_SP2NL
- # turn newlines into spaces.
- NL2SP=$lt_lt_NL2SP
- 
-+# convert \$build file names to \$host format.
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+
-+# convert \$build files to toolchain format.
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+
- # An object symbol dumper.
- OBJDUMP=$lt_OBJDUMP
- 
- # Method to check whether dependent libraries are shared objects.
- deplibs_check_method=$lt_deplibs_check_method
- 
--# Command to use when deplibs_check_method == "file_magic".
-+# Command to use when deplibs_check_method = "file_magic".
- file_magic_cmd=$lt_file_magic_cmd
- 
-+# How to find potential files when deplibs_check_method = "file_magic".
-+file_magic_glob=$lt_file_magic_glob
-+
-+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-+want_nocaseglob=$lt_want_nocaseglob
-+
-+# DLL creation program.
-+DLLTOOL=$lt_DLLTOOL
-+
-+# Command to associate shared and link libraries.
-+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-+
- # The archiver.
- AR=$lt_AR
-+
-+# Flags to create an archive.
- AR_FLAGS=$lt_AR_FLAGS
- 
-+# How to feed a file listing to the archiver.
-+archiver_list_spec=$lt_archiver_list_spec
-+
- # A symbol stripping program.
- STRIP=$lt_STRIP
- 
-@@ -14051,6 +14742,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
- # Transform the output of nm in a C name address pair when lib prefix is needed.
- global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
- 
-+# Specify filename containing input files for \$NM.
-+nm_file_list_spec=$lt_nm_file_list_spec
-+
-+# The root where to search for dependent libraries,and in which our libraries should be installed.
-+lt_sysroot=$lt_sysroot
-+
- # The name of the directory that contains temporary libtool files.
- objdir=$objdir
- 
-@@ -14060,6 +14757,9 @@ MAGIC_CMD=$MAGIC_CMD
- # Must we lock files when doing compilation?
- need_locks=$lt_need_locks
- 
-+# Manifest tool.
-+MANIFEST_TOOL=$lt_MANIFEST_TOOL
-+
- # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
- DSYMUTIL=$lt_DSYMUTIL
- 
-@@ -14174,12 +14874,12 @@ with_gcc=$GCC
- # Compiler flag to turn off builtin functions.
- no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
- 
--# How to pass a linker flag through the compiler.
--wl=$lt_lt_prog_compiler_wl
--
- # Additional compiler flags for building library objects.
- pic_flag=$lt_lt_prog_compiler_pic
- 
-+# How to pass a linker flag through the compiler.
-+wl=$lt_lt_prog_compiler_wl
-+
- # Compiler flag to prevent dynamic linking.
- link_static_flag=$lt_lt_prog_compiler_static
- 
-@@ -14266,9 +14966,6 @@ inherit_rpath=$inherit_rpath
- # Whether libtool must link a program against all its dependency libraries.
- link_all_deplibs=$link_all_deplibs
- 
--# Fix the shell variable \$srcfile for the compiler.
--fix_srcfile_path=$lt_fix_srcfile_path
--
- # Set to "yes" if exported symbols are required.
- always_export_symbols=$always_export_symbols
- 
-@@ -14284,6 +14981,9 @@ include_expsyms=$lt_include_expsyms
- # Commands necessary for linking programs (against libraries) with templates.
- prelink_cmds=$lt_prelink_cmds
- 
-+# Commands necessary for finishing linking programs.
-+postlink_cmds=$lt_postlink_cmds
-+
- # Specify filename containing input files.
- file_list_spec=$lt_file_list_spec
- 
-@@ -14316,210 +15016,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
-   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-   # text mode, it properly converts lines to CR/LF.  This bash problem
-   # is reportedly fixed, but why not run on old versions too?
--  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  case $xsi_shell in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result="${1##*/}"
--}
--
--# func_dirname_and_basename file append nondir_replacement
--# perform func_basename and func_dirname in a single function
--# call:
--#   dirname:  Compute the dirname of FILE.  If nonempty,
--#             add APPEND to the result, otherwise set result
--#             to NONDIR_REPLACEMENT.
--#             value returned in "$func_dirname_result"
--#   basename: Compute filename of FILE.
--#             value retuned in "$func_basename_result"
--# Implementation must be kept synchronized with func_dirname
--# and func_basename. For efficiency, we do not delegate to
--# those functions but instead duplicate the functionality here.
--func_dirname_and_basename ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--  func_basename_result="${1##*/}"
--}
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--func_stripname ()
--{
--  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
--  # positional parameters, so assign one to ordinary parameter first.
--  func_stripname_result=${3}
--  func_stripname_result=${func_stripname_result#"${1}"}
--  func_stripname_result=${func_stripname_result%"${2}"}
--}
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=${1%%=*}
--  func_opt_split_arg=${1#*=}
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  case ${1} in
--    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
--    *)    func_lo2o_result=${1} ;;
--  esac
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=${1%.*}.lo
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=$(( $* ))
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=${#1}
--}
--
--_LT_EOF
--    ;;
--  *) # Bourne compatible functions.
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  # Extract subdirectory from the argument.
--  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
--  if test "X$func_dirname_result" = "X${1}"; then
--    func_dirname_result="${3}"
--  else
--    func_dirname_result="$func_dirname_result${2}"
--  fi
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
--}
--
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--# func_strip_suffix prefix name
--func_stripname ()
--{
--  case ${2} in
--    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
--    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
--  esac
--}
--
--# sed scripts:
--my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
--my_sed_long_arg='1s/^-[^=]*=//'
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
--  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=`expr "$@"`
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
--}
--
--_LT_EOF
--esac
--
--case $lt_shell_append in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1+=\$2"
--}
--_LT_EOF
--    ;;
--  *)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1=\$$1\$2"
--}
--
--_LT_EOF
--    ;;
--  esac
--
--
--  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  mv -f "$cfgfile" "$ofile" ||
-+  sed '$q' "$ltmain" >> "$cfgfile" \
-+     || (rm -f "$cfgfile"; exit 1)
-+
-+  if test x"$xsi_shell" = xyes; then
-+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-+func_dirname ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-+func_basename ()\
-+{\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-+func_dirname_and_basename ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-+func_stripname ()\
-+{\
-+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-+\    # positional parameters, so assign one to ordinary parameter first.\
-+\    func_stripname_result=${3}\
-+\    func_stripname_result=${func_stripname_result#"${1}"}\
-+\    func_stripname_result=${func_stripname_result%"${2}"}\
-+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-+func_split_long_opt ()\
-+{\
-+\    func_split_long_opt_name=${1%%=*}\
-+\    func_split_long_opt_arg=${1#*=}\
-+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-+func_split_short_opt ()\
-+{\
-+\    func_split_short_opt_arg=${1#??}\
-+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-+func_lo2o ()\
-+{\
-+\    case ${1} in\
-+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-+\      *)    func_lo2o_result=${1} ;;\
-+\    esac\
-+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-+func_xform ()\
-+{\
-+    func_xform_result=${1%.*}.lo\
-+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-+func_arith ()\
-+{\
-+    func_arith_result=$(( $* ))\
-+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_len ()$/,/^} # func_len /c\
-+func_len ()\
-+{\
-+    func_len_result=${#1}\
-+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+fi
-+
-+if test x"$lt_shell_append" = xyes; then
-+  sed -e '/^func_append ()$/,/^} # func_append /c\
-+func_append ()\
-+{\
-+    eval "${1}+=\\${2}"\
-+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-+func_append_quoted ()\
-+{\
-+\    func_quote_for_eval "${2}"\
-+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  # Save a `func_append' function call where possible by direct use of '+='
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+else
-+  # Save a `func_append' function call even when '+=' is not available
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+fi
-+
-+if test x"$_lt_function_replace_fail" = x":"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-+fi
-+
-+
-+   mv -f "$cfgfile" "$ofile" ||
-     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-   chmod +x "$ofile"
- 
-diff --git a/ld/configure b/ld/configure
-index f9be51a..3df1149 100755
---- a/ld/configure
-+++ b/ld/configure
-@@ -658,8 +658,11 @@ OTOOL
- LIPO
- NMEDIT
- DSYMUTIL
-+MANIFEST_TOOL
- RANLIB
-+ac_ct_AR
- AR
-+DLLTOOL
- OBJDUMP
- LN_S
- NM
-@@ -781,6 +784,7 @@ enable_static
- with_pic
- enable_fast_install
- with_gnu_ld
-+with_libtool_sysroot
- enable_libtool_lock
- enable_plugins
- enable_largefile
-@@ -1462,6 +1466,8 @@ Optional Packages:
-   --with-pic              try to use only PIC/non-PIC objects [default=use
-                           both]
-   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-+  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
-+                        (or the compiler's sysroot if not specified).
-   --with-lib-path=dir1:dir2...  set default LIB_PATH
-   --with-sysroot=DIR Search for usr/lib et al within DIR.
- 
-@@ -5656,8 +5662,8 @@ esac
- 
- 
- 
--macro_version='2.2.7a'
--macro_revision='1.3134'
-+macro_version='2.4'
-+macro_revision='1.3293'
- 
- 
- 
-@@ -5697,7 +5703,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
- $as_echo_n "checking how to print strings... " >&6; }
- # Test print first, because it will be a builtin if present.
--if test "X`print -r -- -n 2>/dev/null`" = X-n && \
-+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-   ECHO='print -r --'
- elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-@@ -6383,8 +6389,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
- # Try some XSI features
- xsi_shell=no
- ( _lt_dummy="a/b/c"
--  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
--      = c,a/b,, \
-+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-+      = c,a/b,b/c, \
-     && eval 'test $(( 1 + 1 )) -eq 2 \
-     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-   && xsi_shell=yes
-@@ -6433,6 +6439,80 @@ esac
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-+if test "${lt_cv_to_host_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-+        ;;
-+    esac
-+    ;;
-+  *-*-cygwin* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_noop
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-+        ;;
-+    esac
-+    ;;
-+  * ) # unhandled hosts (and "normal" native builds)
-+    lt_cv_to_host_file_cmd=func_convert_file_noop
-+    ;;
-+esac
-+
-+fi
-+
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-+if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  #assume ordinary cross tools, or native build.
-+lt_cv_to_tool_file_cmd=func_convert_file_noop
-+case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+    esac
-+    ;;
-+esac
-+
-+fi
-+
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-+
-+
-+
-+
-+
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
- $as_echo_n "checking for $LD option to reload object files... " >&6; }
- if test "${lt_cv_ld_reload_flag+set}" = set; then :
-@@ -6449,6 +6529,11 @@ case $reload_flag in
- esac
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- case $host_os in
-+  cygwin* | mingw* | pw32* | cegcc*)
-+    if test "$GCC" != yes; then
-+      reload_cmds=false
-+    fi
-+    ;;
-   darwin*)
-     if test "$GCC" = yes; then
-       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-@@ -6617,7 +6702,8 @@ mingw* | pw32*)
-     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-     lt_cv_file_magic_cmd='func_win32_libid'
-   else
--    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-+    # Keep this pattern in sync with the one in func_win32_libid.
-+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-     lt_cv_file_magic_cmd='$OBJDUMP -f'
-   fi
-   ;;
-@@ -6771,6 +6857,21 @@ esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
- $as_echo "$lt_cv_deplibs_check_method" >&6; }
-+
-+file_magic_glob=
-+want_nocaseglob=no
-+if test "$build" = "$host"; then
-+  case $host_os in
-+  mingw* | pw32*)
-+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-+      want_nocaseglob=yes
-+    else
-+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
-+    fi
-+    ;;
-+  esac
-+fi
-+
- file_magic_cmd=$lt_cv_file_magic_cmd
- deplibs_check_method=$lt_cv_deplibs_check_method
- test -z "$deplibs_check_method" && deplibs_check_method=unknown
-@@ -6786,9 +6887,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
- 
- 
- 
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$DLLTOOL"; then
-+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+DLLTOOL=$ac_cv_prog_DLLTOOL
-+if test -n "$DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-+$as_echo "$DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_DLLTOOL"; then
-+  ac_ct_DLLTOOL=$DLLTOOL
-+  # Extract the first word of "dlltool", so it can be a program name with args.
-+set dummy dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_DLLTOOL"; then
-+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-+if test -n "$ac_ct_DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-+$as_echo "$ac_ct_DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_DLLTOOL" = x; then
-+    DLLTOOL="false"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    DLLTOOL=$ac_ct_DLLTOOL
-+  fi
-+else
-+  DLLTOOL="$ac_cv_prog_DLLTOOL"
-+fi
-+
-+test -z "$DLLTOOL" && DLLTOOL=dlltool
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-+if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_sharedlib_from_linklib_cmd='unknown'
-+
-+case $host_os in
-+cygwin* | mingw* | pw32* | cegcc*)
-+  # two different shell functions defined in ltmain.sh
-+  # decide which to use based on capabilities of $DLLTOOL
-+  case `$DLLTOOL --help 2>&1` in
-+  *--identify-strict*)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-+    ;;
-+  *)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-+    ;;
-+  esac
-+  ;;
-+*)
-+  # fallback: assume linklib IS sharedlib
-+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-+  ;;
-+esac
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-+
-+
-+
-+
-+
-+
-+
- if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
--set dummy ${ac_tool_prefix}ar; ac_word=$2
-+  for ac_prog in ar
-+  do
-+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_AR+set}" = set; then :
-@@ -6804,7 +7058,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_AR="${ac_tool_prefix}ar"
-+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6824,11 +7078,15 @@ $as_echo "no" >&6; }
- fi
- 
- 
-+    test -n "$AR" && break
-+  done
- fi
--if test -z "$ac_cv_prog_AR"; then
-+if test -z "$AR"; then
-   ac_ct_AR=$AR
--  # Extract the first word of "ar", so it can be a program name with args.
--set dummy ar; ac_word=$2
-+  for ac_prog in ar
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
-@@ -6844,7 +7102,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_ac_ct_AR="ar"
-+    ac_cv_prog_ac_ct_AR="$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6863,6 +7121,10 @@ else
- $as_echo "no" >&6; }
- fi
- 
-+
-+  test -n "$ac_ct_AR" && break
-+done
-+
-   if test "x$ac_ct_AR" = x; then
-     AR="false"
-   else
-@@ -6874,12 +7136,12 @@ ac_tool_warned=yes ;;
- esac
-     AR=$ac_ct_AR
-   fi
--else
--  AR="$ac_cv_prog_AR"
- fi
- 
--test -z "$AR" && AR=ar
--test -z "$AR_FLAGS" && AR_FLAGS=cru
-+: ${AR=ar}
-+: ${AR_FLAGS=cru}
-+
-+
- 
- 
- 
-@@ -6889,6 +7151,62 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-+$as_echo_n "checking for archiver @FILE support... " >&6; }
-+if test "${lt_cv_ar_at_file+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_ar_at_file=no
-+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+  echo conftest.$ac_objext > conftest.lst
-+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
-+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+      if test "$ac_status" -eq 0; then
-+	# Ensure the archiver fails upon bogus file names.
-+	rm -f conftest.$ac_objext libconftest.a
-+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+	if test "$ac_status" -ne 0; then
-+          lt_cv_ar_at_file=@
-+        fi
-+      fi
-+      rm -f conftest.* libconftest.a
-+
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-+$as_echo "$lt_cv_ar_at_file" >&6; }
-+
-+if test "x$lt_cv_ar_at_file" = xno; then
-+  archiver_list_spec=
-+else
-+  archiver_list_spec=$lt_cv_ar_at_file
-+fi
-+
-+
-+
-+
-+
- 
- 
- if test -n "$ac_tool_prefix"; then
-@@ -7225,8 +7543,8 @@ esac
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- 
- # Transform an extracted symbol line into symbol name and symbol address
--lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
--lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
- 
- # Handle CRLF in mingw tool chain
- opt_cr=
-@@ -7262,6 +7580,7 @@ for ac_symprfx in "" "_"; do
-   else
-     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-   fi
-+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
- 
-   # Check to see that the pipe works correctly.
-   pipe_works=no
-@@ -7303,6 +7622,18 @@ _LT_EOF
-       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- 	  cat <<_LT_EOF > conftest.$ac_ext
-+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-+/* DATA imports from DLLs on WIN32 con't be const, because runtime
-+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-+# define LT_DLSYM_CONST
-+#elif defined(__osf__)
-+/* This system does not cope well with relocations in const data.  */
-+# define LT_DLSYM_CONST
-+#else
-+# define LT_DLSYM_CONST const
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -7314,7 +7645,7 @@ _LT_EOF
- 	  cat <<_LT_EOF >> conftest.$ac_ext
- 
- /* The mapping between symbol names and symbols.  */
--const struct {
-+LT_DLSYM_CONST struct {
-   const char *name;
-   void       *address;
- }
-@@ -7340,8 +7671,8 @@ static const void *lt_preloaded_setup() {
- _LT_EOF
- 	  # Now try linking the two files.
- 	  mv conftest.$ac_objext conftstm.$ac_objext
--	  lt_save_LIBS="$LIBS"
--	  lt_save_CFLAGS="$CFLAGS"
-+	  lt_globsym_save_LIBS=$LIBS
-+	  lt_globsym_save_CFLAGS=$CFLAGS
- 	  LIBS="conftstm.$ac_objext"
- 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-@@ -7351,8 +7682,8 @@ _LT_EOF
-   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
- 	    pipe_works=yes
- 	  fi
--	  LIBS="$lt_save_LIBS"
--	  CFLAGS="$lt_save_CFLAGS"
-+	  LIBS=$lt_globsym_save_LIBS
-+	  CFLAGS=$lt_globsym_save_CFLAGS
- 	else
- 	  echo "cannot find nm_test_func in $nlist" >&5
- 	fi
-@@ -7389,6 +7720,19 @@ else
- $as_echo "ok" >&6; }
- fi
- 
-+# Response file support.
-+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-+  nm_file_list_spec='@'
-+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
-+  nm_file_list_spec='@'
-+fi
-+
-+
-+
-+
-+
-+
-+
- 
- 
- 
-@@ -7409,6 +7753,42 @@ fi
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-+$as_echo_n "checking for sysroot... " >&6; }
-+
-+# Check whether --with-libtool-sysroot was given.
-+if test "${with_libtool_sysroot+set}" = set; then :
-+  withval=$with_libtool_sysroot;
-+else
-+  with_libtool_sysroot=no
-+fi
-+
-+
-+lt_sysroot=
-+case ${with_libtool_sysroot} in #(
-+ yes)
-+   if test "$GCC" = yes; then
-+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-+   fi
-+   ;; #(
-+ /*)
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
-+   ;; #(
-+ no|'')
-+   ;; #(
-+ *)
-+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
-+$as_echo "${with_libtool_sysroot}" >&6; }
-+   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
-+   ;;
-+esac
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-+$as_echo "${lt_sysroot:-no}" >&6; }
-+
-+
-+
-+
- 
- # Check whether --enable-libtool-lock was given.
- if test "${enable_libtool_lock+set}" = set; then :
-@@ -7616,6 +7996,123 @@ esac
- 
- need_locks="$enable_libtool_lock"
- 
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$MANIFEST_TOOL"; then
-+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-+if test -n "$MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-+$as_echo "$MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
-+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
-+  # Extract the first word of "mt", so it can be a program name with args.
-+set dummy mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-+if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
-+    MANIFEST_TOOL=":"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
-+  fi
-+else
-+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-+fi
-+
-+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-+if test "${lt_cv_path_mainfest_tool+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_path_mainfest_tool=no
-+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
-+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-+  cat conftest.err >&5
-+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-+    lt_cv_path_mainfest_tool=yes
-+  fi
-+  rm -f conftest*
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-+if test "x$lt_cv_path_mainfest_tool" != xyes; then
-+  MANIFEST_TOOL=:
-+fi
-+
-+
-+
-+
-+
- 
-   case $host_os in
-     rhapsody* | darwin*)
-@@ -8179,6 +8676,8 @@ _LT_EOF
-       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-       echo "$AR cru libconftest.a conftest.o" >&5
-       $AR cru libconftest.a conftest.o 2>&5
-+      echo "$RANLIB libconftest.a" >&5
-+      $RANLIB libconftest.a 2>&5
-       cat > conftest.c << _LT_EOF
- int main() { return 0;}
- _LT_EOF
-@@ -8247,6 +8746,16 @@ done
- 
- 
- 
-+func_stripname_cnf ()
-+{
-+  case ${2} in
-+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-+  esac
-+} # func_stripname_cnf
-+
-+
-+
- 
- 
- # Set options
-@@ -8375,7 +8884,8 @@ fi
- LIBTOOL_DEPS="$ltmain"
- 
- # Always use our own libtool.
--LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-+LIBTOOL='$(SHELL) $(top_builddir)'
-+LIBTOOL="$LIBTOOL/${host_alias}-libtool"
- 
- 
- 
-@@ -8464,7 +8974,7 @@ aix3*)
- esac
- 
- # Global variables:
--ofile=libtool
-+ofile=${host_alias}-libtool
- can_build_shared=yes
- 
- # All known linkers require a `.a' archive for static linking (except MSVC,
-@@ -8762,8 +9272,6 @@ fi
- lt_prog_compiler_pic=
- lt_prog_compiler_static=
- 
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
--$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 
-   if test "$GCC" = yes; then
-     lt_prog_compiler_wl='-Wl,'
-@@ -8929,6 +9437,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 	lt_prog_compiler_pic='--shared'
- 	lt_prog_compiler_static='--static'
- 	;;
-+      nagfor*)
-+	# NAG Fortran compiler
-+	lt_prog_compiler_wl='-Wl,-Wl,,'
-+	lt_prog_compiler_pic='-PIC'
-+	lt_prog_compiler_static='-Bstatic'
-+	;;
-       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-         # Portland Group compilers (*not* the Pentium gcc compiler,
- 	# which looks to be a dead project)
-@@ -8991,7 +9505,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-       lt_prog_compiler_pic='-KPIC'
-       lt_prog_compiler_static='-Bstatic'
-       case $cc_basename in
--      f77* | f90* | f95*)
-+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- 	lt_prog_compiler_wl='-Qoption ld ';;
-       *)
- 	lt_prog_compiler_wl='-Wl,';;
-@@ -9048,13 +9562,17 @@ case $host_os in
-     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-     ;;
- esac
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
--$as_echo "$lt_prog_compiler_pic" >&6; }
--
--
--
--
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-+if test "${lt_cv_prog_compiler_pic+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
- 
- #
- # Check to make sure the PIC flag actually works.
-@@ -9115,6 +9633,11 @@ fi
- 
- 
- 
-+
-+
-+
-+
-+
- #
- # Check to make sure the static flag actually works.
- #
-@@ -9465,7 +9988,8 @@ _LT_EOF
-       allow_undefined_flag=unsupported
-       always_export_symbols=no
-       enable_shared_with_static_runtimes=yes
--      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
- 
-       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-@@ -9564,12 +10088,12 @@ _LT_EOF
- 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- 	  hardcode_libdir_flag_spec=
- 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
--	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- 	  if test "x$supports_anon_versioning" = xyes; then
- 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- 	      echo "local: *; };" >> $output_objdir/$libname.ver~
--	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- 	  fi
- 	  ;;
- 	esac
-@@ -9583,8 +10107,8 @@ _LT_EOF
- 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- 	wlarc=
-       else
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       fi
-       ;;
- 
-@@ -9602,8 +10126,8 @@ _LT_EOF
- 
- _LT_EOF
-       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -9649,8 +10173,8 @@ _LT_EOF
- 
-     *)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -9780,7 +10304,13 @@ _LT_EOF
- 	allow_undefined_flag='-berok'
-         # Determine the default libpath from the value encoded in an
-         # empty executable.
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+        if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9793,22 +10323,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
-         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-@@ -9820,7 +10357,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	else
- 	 # Determine the default libpath from the value encoded in an
- 	 # empty executable.
--	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	 if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9833,22 +10376,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
- 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- 	  # Warning - without using the other run time loading flags,
-@@ -9892,21 +10442,64 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-       # When not using gcc, we currently assume that we are using
-       # Microsoft Visual C++.
-       # hardcode_libdir_flag_spec is actually meaningless, as there is
--      # no search path for DLLs.
--      hardcode_libdir_flag_spec=' '
--      allow_undefined_flag=unsupported
--      # Tell ltmain to make .lib files, not .a files.
--      libext=lib
--      # Tell ltmain to make .dll files, not .so files.
--      shrext_cmds=".dll"
--      # FIXME: Setting linknames here is a bad hack.
--      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
--      # The linker will automatically build a .lib file if we build a DLL.
--      old_archive_from_new_cmds='true'
--      # FIXME: Should let the user specify the lib program.
--      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
--      fix_srcfile_path='`cygpath -w "$srcfile"`'
--      enable_shared_with_static_runtimes=yes
-+      # no search path for DLLs.
-+      case $cc_basename in
-+      cl*)
-+	# Native MSVC
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	always_export_symbols=yes
-+	file_list_spec='@'
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-+	  else
-+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-+	  fi~
-+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-+	  linknames='
-+	# The linker will not automatically build a static lib if we build a DLL.
-+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
-+	enable_shared_with_static_runtimes=yes
-+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+	# Don't use ranlib
-+	old_postinstall_cmds='chmod 644 $oldlib'
-+	postlink_cmds='lt_outputfile="@OUTPUT@"~
-+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-+	  case $lt_outputfile in
-+	    *.exe|*.EXE) ;;
-+	    *)
-+	      lt_outputfile="$lt_outputfile.exe"
-+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-+	      ;;
-+	  esac~
-+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-+	    $RM "$lt_outputfile.manifest";
-+	  fi'
-+	;;
-+      *)
-+	# Assume MSVC wrapper
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-+	# The linker will automatically build a .lib file if we build a DLL.
-+	old_archive_from_new_cmds='true'
-+	# FIXME: Should let the user specify the lib program.
-+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-+	enable_shared_with_static_runtimes=yes
-+	;;
-+      esac
-       ;;
- 
-     darwin* | rhapsody*)
-@@ -9967,7 +10560,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-     freebsd* | dragonfly*)
--      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-       hardcode_direct=yes
-       hardcode_shlibpath_var=no
-@@ -9975,7 +10568,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux9*)
-       if test "$GCC" = yes; then
--	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       else
- 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       fi
-@@ -9991,7 +10584,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux10*)
-       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
--	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-       else
- 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-       fi
-@@ -10015,10 +10608,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	ia64*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	esac
-       else
-@@ -10097,23 +10690,36 @@ fi
- 
-     irix5* | irix6* | nonstopux*)
-       if test "$GCC" = yes; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	# Try to use the -exported_symbol ld option, if it does not
- 	# work, assume that -exports_file does not work either and
- 	# implicitly export all symbols.
--        save_LDFLAGS="$LDFLAGS"
--        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	# This should be the same for all languages, so no per-tag cache variable.
-+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-+if test "${lt_cv_irix_exported_symbol+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  save_LDFLAGS="$LDFLAGS"
-+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
--int foo(void) {}
-+int foo (void) { return 0; }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
--  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
--
-+  lt_cv_irix_exported_symbol=yes
-+else
-+  lt_cv_irix_exported_symbol=no
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--        LDFLAGS="$save_LDFLAGS"
-+           LDFLAGS="$save_LDFLAGS"
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
-+	if test "$lt_cv_irix_exported_symbol" = yes; then
-+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-+	fi
-       else
- 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-@@ -10198,7 +10804,7 @@ rm -f core conftest.err conftest.$ac_objext \
-     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-       if test "$GCC" = yes; then
- 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
--	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-       else
- 	allow_undefined_flag=' -expect_unresolved \*'
-@@ -10217,9 +10823,9 @@ rm -f core conftest.err conftest.$ac_objext \
-       no_undefined_flag=' -z defs'
-       if test "$GCC" = yes; then
- 	wlarc='${wl}'
--	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
--	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-       else
- 	case `$CC -V 2>&1` in
- 	*"Compilers 5.0"*)
-@@ -10795,8 +11401,9 @@ cygwin* | mingw* | pw32* | cegcc*)
-   need_version=no
-   need_lib_prefix=no
- 
--  case $GCC,$host_os in
--  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-+  case $GCC,$cc_basename in
-+  yes,*)
-+    # gcc
-     library_names_spec='$libname.dll.a'
-     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-     postinstall_cmds='base_file=`basename \${file}`~
-@@ -10829,13 +11436,71 @@ cygwin* | mingw* | pw32* | cegcc*)
-       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-       ;;
-     esac
-+    dynamic_linker='Win32 ld.exe'
-+    ;;
-+
-+  *,cl*)
-+    # Native MSVC
-+    libname_spec='$name'
-+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-+    library_names_spec='${libname}.dll.lib'
-+
-+    case $build_os in
-+    mingw*)
-+      sys_lib_search_path_spec=
-+      lt_save_ifs=$IFS
-+      IFS=';'
-+      for lt_path in $LIB
-+      do
-+        IFS=$lt_save_ifs
-+        # Let DOS variable expansion print the short 8.3 style file name.
-+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-+      done
-+      IFS=$lt_save_ifs
-+      # Convert to MSYS style.
-+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-+      ;;
-+    cygwin*)
-+      # Convert to unix form, then to dos form, then back to unix form
-+      # but this time dos style (no spaces!) so that the unix form looks
-+      # like /cygdrive/c/PROGRA~1:/cygdr...
-+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      ;;
-+    *)
-+      sys_lib_search_path_spec="$LIB"
-+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-+        # It is most probably a Windows format PATH.
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-+      else
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      fi
-+      # FIXME: find the short name or the path components, as spaces are
-+      # common. (e.g. "Program Files" -> "PROGRA~1")
-+      ;;
-+    esac
-+
-+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-+    postinstall_cmds='base_file=`basename \${file}`~
-+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-+      dldir=$destdir/`dirname \$dlpath`~
-+      test -d \$dldir || mkdir -p \$dldir~
-+      $install_prog $dir/$dlname \$dldir/$dlname'
-+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-+      dlpath=$dir/\$dldll~
-+       $RM \$dlpath'
-+    shlibpath_overrides_runpath=yes
-+    dynamic_linker='Win32 link.exe'
-     ;;
- 
-   *)
-+    # Assume MSVC wrapper
-     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-+    dynamic_linker='Win32 ld.exe'
-     ;;
-   esac
--  dynamic_linker='Win32 ld.exe'
-   # FIXME: first we should search . and the directory the executable is in
-   shlibpath_var=PATH
-   ;;
-@@ -10927,7 +11592,7 @@ haiku*)
-   soname_spec='${libname}${release}${shared_ext}$major'
-   shlibpath_var=LIBRARY_PATH
-   shlibpath_overrides_runpath=yes
--  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-   hardcode_into_libs=yes
-   ;;
- 
-@@ -11767,10 +12432,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -11873,10 +12538,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -12268,6 +12933,7 @@ $RM -r conftest*
- 
-   # Allow CC to be a program name with arguments.
-   lt_save_CC=$CC
-+  lt_save_CFLAGS=$CFLAGS
-   lt_save_LD=$LD
-   lt_save_GCC=$GCC
-   GCC=$GXX
-@@ -12285,6 +12951,7 @@ $RM -r conftest*
-   fi
-   test -z "${LDCXX+set}" || LD=$LDCXX
-   CC=${CXX-"c++"}
-+  CFLAGS=$CXXFLAGS
-   compiler=$CC
-   compiler_CXX=$CC
-   for cc_temp in $compiler""; do
-@@ -12567,7 +13234,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
-           allow_undefined_flag_CXX='-berok'
-           # Determine the default libpath from the value encoded in an empty
-           # executable.
--          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+          if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath__CXX+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -12580,22 +13253,29 @@ main ()
- _ACEOF
- if ac_fn_cxx_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath__CXX"; then
-+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath__CXX"; then
-+    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath__CXX
-+fi
- 
-           hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- 
-@@ -12608,7 +13288,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-           else
- 	    # Determine the default libpath from the value encoded in an
- 	    # empty executable.
--	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	    if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath__CXX+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -12621,22 +13307,29 @@ main ()
- _ACEOF
- if ac_fn_cxx_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath__CXX"; then
-+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath__CXX"; then
-+    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath__CXX
-+fi
- 
- 	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- 	    # Warning - without using the other run time loading flags,
-@@ -12679,29 +13372,75 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-         ;;
- 
-       cygwin* | mingw* | pw32* | cegcc*)
--        # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
--        # as there is no search path for DLLs.
--        hardcode_libdir_flag_spec_CXX='-L$libdir'
--        export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
--        allow_undefined_flag_CXX=unsupported
--        always_export_symbols_CXX=no
--        enable_shared_with_static_runtimes_CXX=yes
--
--        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
--          archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
--          # If the export-symbols file already is a .def file (1st line
--          # is EXPORTS), use it as is; otherwise, prepend...
--          archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
--	    cp $export_symbols $output_objdir/$soname.def;
--          else
--	    echo EXPORTS > $output_objdir/$soname.def;
--	    cat $export_symbols >> $output_objdir/$soname.def;
--          fi~
--          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
--        else
--          ld_shlibs_CXX=no
--        fi
--        ;;
-+	case $GXX,$cc_basename in
-+	,cl* | no,cl*)
-+	  # Native MSVC
-+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
-+	  # no search path for DLLs.
-+	  hardcode_libdir_flag_spec_CXX=' '
-+	  allow_undefined_flag_CXX=unsupported
-+	  always_export_symbols_CXX=yes
-+	  file_list_spec_CXX='@'
-+	  # Tell ltmain to make .lib files, not .a files.
-+	  libext=lib
-+	  # Tell ltmain to make .dll files, not .so files.
-+	  shrext_cmds=".dll"
-+	  # FIXME: Setting linknames here is a bad hack.
-+	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-+	  archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-+	    else
-+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-+	    fi~
-+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-+	    linknames='
-+	  # The linker will not automatically build a static lib if we build a DLL.
-+	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
-+	  enable_shared_with_static_runtimes_CXX=yes
-+	  # Don't use ranlib
-+	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
-+	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
-+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
-+	    case $lt_outputfile in
-+	      *.exe|*.EXE) ;;
-+	      *)
-+		lt_outputfile="$lt_outputfile.exe"
-+		lt_tool_outputfile="$lt_tool_outputfile.exe"
-+		;;
-+	    esac~
-+	    func_to_tool_file "$lt_outputfile"~
-+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-+	      $RM "$lt_outputfile.manifest";
-+	    fi'
-+	  ;;
-+	*)
-+	  # g++
-+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
-+	  # as there is no search path for DLLs.
-+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
-+	  export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
-+	  allow_undefined_flag_CXX=unsupported
-+	  always_export_symbols_CXX=no
-+	  enable_shared_with_static_runtimes_CXX=yes
-+
-+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-+	    # If the export-symbols file already is a .def file (1st line
-+	    # is EXPORTS), use it as is; otherwise, prepend...
-+	    archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	      cp $export_symbols $output_objdir/$soname.def;
-+	    else
-+	      echo EXPORTS > $output_objdir/$soname.def;
-+	      cat $export_symbols >> $output_objdir/$soname.def;
-+	    fi~
-+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-+	  else
-+	    ld_shlibs_CXX=no
-+	  fi
-+	  ;;
-+	esac
-+	;;
-       darwin* | rhapsody*)
- 
- 
-@@ -12807,7 +13546,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-             ;;
-           *)
-             if test "$GXX" = yes; then
--              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-             else
-               # FIXME: insert proper C++ library support
-               ld_shlibs_CXX=no
-@@ -12878,10 +13617,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- 	            ;;
- 	          ia64*)
--	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- 	            ;;
- 	          *)
--	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- 	            ;;
- 	        esac
- 	      fi
-@@ -12922,9 +13661,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-           *)
- 	    if test "$GXX" = yes; then
- 	      if test "$with_gnu_ld" = no; then
--	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	      else
--	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
-+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
- 	      fi
- 	    fi
- 	    link_all_deplibs_CXX=yes
-@@ -12994,20 +13733,20 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	      prelink_cmds_CXX='tpldir=Template.dir~
- 		rm -rf $tpldir~
- 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
--		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
-+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
- 	      old_archive_cmds_CXX='tpldir=Template.dir~
- 		rm -rf $tpldir~
- 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
--		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
-+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- 		$RANLIB $oldlib'
- 	      archive_cmds_CXX='tpldir=Template.dir~
- 		rm -rf $tpldir~
- 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
--		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
- 		rm -rf $tpldir~
- 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
--		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- 	      ;;
- 	    *) # Version 6 and above use weak symbols
- 	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-@@ -13202,7 +13941,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 		  ;;
- 	        *)
--	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 		  ;;
- 	      esac
- 
-@@ -13248,7 +13987,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-       solaris*)
-         case $cc_basename in
--          CC*)
-+          CC* | sunCC*)
- 	    # Sun C++ 4.2, 5.x and Centerline C++
-             archive_cmds_need_lc_CXX=yes
- 	    no_undefined_flag_CXX=' -zdefs'
-@@ -13289,9 +14028,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- 	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
- 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
--	        archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- 	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
--		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
- 
- 	        # Commands to make compiler produce verbose output that lists
- 	        # what "hidden" libraries, object files and flags are used when
-@@ -13426,6 +14165,13 @@ private:
- };
- _LT_EOF
- 
-+
-+_lt_libdeps_save_CFLAGS=$CFLAGS
-+case "$CC $CFLAGS " in #(
-+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-+esac
-+
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-   (eval $ac_compile) 2>&5
-   ac_status=$?
-@@ -13439,7 +14185,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-   pre_test_object_deps_done=no
- 
-   for p in `eval "$output_verbose_link_cmd"`; do
--    case $p in
-+    case ${prev}${p} in
- 
-     -L* | -R* | -l*)
-        # Some compilers place space between "-{L,R}" and the path.
-@@ -13448,13 +14194,22 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-           test $p = "-R"; then
- 	 prev=$p
- 	 continue
--       else
--	 prev=
-        fi
- 
-+       # Expand the sysroot to ease extracting the directories later.
-+       if test -z "$prev"; then
-+         case $p in
-+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
-+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
-+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
-+         esac
-+       fi
-+       case $p in
-+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
-+       esac
-        if test "$pre_test_object_deps_done" = no; then
--	 case $p in
--	 -L* | -R*)
-+	 case ${prev} in
-+	 -L | -R)
- 	   # Internal compiler library paths should come after those
- 	   # provided the user.  The postdeps already come after the
- 	   # user supplied libs so there is no need to process them.
-@@ -13474,8 +14229,10 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- 	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
- 	 fi
-        fi
-+       prev=
-        ;;
- 
-+    *.lto.$objext) ;; # Ignore GCC LTO objects
-     *.$objext)
-        # This assumes that the test object file only shows up
-        # once in the compiler output.
-@@ -13511,6 +14268,7 @@ else
- fi
- 
- $RM -f confest.$objext
-+CFLAGS=$_lt_libdeps_save_CFLAGS
- 
- # PORTME: override above test on systems where it is broken
- case $host_os in
-@@ -13546,7 +14304,7 @@ linux*)
- 
- solaris*)
-   case $cc_basename in
--  CC*)
-+  CC* | sunCC*)
-     # The more standards-conforming stlport4 library is
-     # incompatible with the Cstd library. Avoid specifying
-     # it if it's in CXXFLAGS. Ignore libCrun as
-@@ -13611,8 +14369,6 @@ fi
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX=
- 
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
--$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 
-   # C++ specific cases for pic, static, wl, etc.
-   if test "$GXX" = yes; then
-@@ -13717,6 +14473,11 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 	  ;;
- 	esac
- 	;;
-+      mingw* | cygwin* | os2* | pw32* | cegcc*)
-+	# This hack is so that the source file can tell whether it is being
-+	# built for inclusion in a dll (and should export symbols for example).
-+	lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
-+	;;
-       dgux*)
- 	case $cc_basename in
- 	  ec++*)
-@@ -13869,7 +14630,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 	;;
-       solaris*)
- 	case $cc_basename in
--	  CC*)
-+	  CC* | sunCC*)
- 	    # Sun C++ 4.2, 5.x and Centerline C++
- 	    lt_prog_compiler_pic_CXX='-KPIC'
- 	    lt_prog_compiler_static_CXX='-Bstatic'
-@@ -13934,10 +14695,17 @@ case $host_os in
-     lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
-     ;;
- esac
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5
--$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
--
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-+if test "${lt_cv_prog_compiler_pic_CXX+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
-+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
-+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
- 
- #
- # Check to make sure the PIC flag actually works.
-@@ -13995,6 +14763,8 @@ fi
- 
- 
- 
-+
-+
- #
- # Check to make sure the static flag actually works.
- #
-@@ -14172,6 +14942,7 @@ fi
- $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
- 
-   export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-+  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-   case $host_os in
-   aix[4-9]*)
-     # If we're using GNU nm, then we don't want the "-C" option.
-@@ -14186,15 +14957,20 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
-     ;;
-   pw32*)
-     export_symbols_cmds_CXX="$ltdll_cmds"
--  ;;
-+    ;;
-   cygwin* | mingw* | cegcc*)
--    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
--  ;;
-+    case $cc_basename in
-+    cl*) ;;
-+    *)
-+      export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-+      exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
-+      ;;
-+    esac
-+    ;;
-   *)
-     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
--  ;;
-+    ;;
-   esac
--  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
- 
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
- $as_echo "$ld_shlibs_CXX" >&6; }
-@@ -14457,8 +15233,9 @@ cygwin* | mingw* | pw32* | cegcc*)
-   need_version=no
-   need_lib_prefix=no
- 
--  case $GCC,$host_os in
--  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-+  case $GCC,$cc_basename in
-+  yes,*)
-+    # gcc
-     library_names_spec='$libname.dll.a'
-     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-     postinstall_cmds='base_file=`basename \${file}`~
-@@ -14490,13 +15267,71 @@ cygwin* | mingw* | pw32* | cegcc*)
-       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-       ;;
-     esac
-+    dynamic_linker='Win32 ld.exe'
-+    ;;
-+
-+  *,cl*)
-+    # Native MSVC
-+    libname_spec='$name'
-+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-+    library_names_spec='${libname}.dll.lib'
-+
-+    case $build_os in
-+    mingw*)
-+      sys_lib_search_path_spec=
-+      lt_save_ifs=$IFS
-+      IFS=';'
-+      for lt_path in $LIB
-+      do
-+        IFS=$lt_save_ifs
-+        # Let DOS variable expansion print the short 8.3 style file name.
-+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-+      done
-+      IFS=$lt_save_ifs
-+      # Convert to MSYS style.
-+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-+      ;;
-+    cygwin*)
-+      # Convert to unix form, then to dos form, then back to unix form
-+      # but this time dos style (no spaces!) so that the unix form looks
-+      # like /cygdrive/c/PROGRA~1:/cygdr...
-+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      ;;
-+    *)
-+      sys_lib_search_path_spec="$LIB"
-+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-+        # It is most probably a Windows format PATH.
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-+      else
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      fi
-+      # FIXME: find the short name or the path components, as spaces are
-+      # common. (e.g. "Program Files" -> "PROGRA~1")
-+      ;;
-+    esac
-+
-+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-+    postinstall_cmds='base_file=`basename \${file}`~
-+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-+      dldir=$destdir/`dirname \$dlpath`~
-+      test -d \$dldir || mkdir -p \$dldir~
-+      $install_prog $dir/$dlname \$dldir/$dlname'
-+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-+      dlpath=$dir/\$dldll~
-+       $RM \$dlpath'
-+    shlibpath_overrides_runpath=yes
-+    dynamic_linker='Win32 link.exe'
-     ;;
- 
-   *)
-+    # Assume MSVC wrapper
-     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-+    dynamic_linker='Win32 ld.exe'
-     ;;
-   esac
--  dynamic_linker='Win32 ld.exe'
-   # FIXME: first we should search . and the directory the executable is in
-   shlibpath_var=PATH
-   ;;
-@@ -14587,7 +15422,7 @@ haiku*)
-   soname_spec='${libname}${release}${shared_ext}$major'
-   shlibpath_var=LIBRARY_PATH
-   shlibpath_overrides_runpath=yes
--  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-   hardcode_into_libs=yes
-   ;;
- 
-@@ -15046,6 +15881,7 @@ fi
-   fi # test -n "$compiler"
- 
-   CC=$lt_save_CC
-+  CFLAGS=$lt_save_CFLAGS
-   LDCXX=$LD
-   LD=$lt_save_LD
-   GCC=$lt_save_GCC
-@@ -17982,13 +18818,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
- lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
- lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
- lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
- reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
- reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
- OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
- deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
- file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
- AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
- AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
- STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
- RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
- old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-@@ -18003,14 +18846,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
- lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
- objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
- MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
--lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
- lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
- need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
- DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
- NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
- LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-@@ -18043,12 +18889,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
- hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
- inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
- link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
--fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
- always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
- export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
- exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
- include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
- prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
- file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
- variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
- need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-@@ -18087,8 +18933,8 @@ old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote
- compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
- GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
--lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
-+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
- lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
- archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
-@@ -18115,12 +18961,12 @@ hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_
- hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
- inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
- link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
--fix_srcfile_path_CXX='`$ECHO "$fix_srcfile_path_CXX" | $SED "$delay_single_quote_subst"`'
- always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
- export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
- exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
- include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
- prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
- file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
- hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
- compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
-@@ -18158,8 +19004,13 @@ reload_flag \
- OBJDUMP \
- deplibs_check_method \
- file_magic_cmd \
-+file_magic_glob \
-+want_nocaseglob \
-+DLLTOOL \
-+sharedlib_from_linklib_cmd \
- AR \
- AR_FLAGS \
-+archiver_list_spec \
- STRIP \
- RANLIB \
- CC \
-@@ -18169,12 +19020,14 @@ lt_cv_sys_global_symbol_pipe \
- lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-+nm_file_list_spec \
- lt_prog_compiler_no_builtin_flag \
--lt_prog_compiler_wl \
- lt_prog_compiler_pic \
-+lt_prog_compiler_wl \
- lt_prog_compiler_static \
- lt_cv_prog_compiler_c_o \
- need_locks \
-+MANIFEST_TOOL \
- DSYMUTIL \
- NMEDIT \
- LIPO \
-@@ -18190,7 +19043,6 @@ no_undefined_flag \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
--fix_srcfile_path \
- exclude_expsyms \
- include_expsyms \
- file_list_spec \
-@@ -18212,8 +19064,8 @@ LD_CXX \
- reload_flag_CXX \
- compiler_CXX \
- lt_prog_compiler_no_builtin_flag_CXX \
--lt_prog_compiler_wl_CXX \
- lt_prog_compiler_pic_CXX \
-+lt_prog_compiler_wl_CXX \
- lt_prog_compiler_static_CXX \
- lt_cv_prog_compiler_c_o_CXX \
- export_dynamic_flag_spec_CXX \
-@@ -18225,7 +19077,6 @@ no_undefined_flag_CXX \
- hardcode_libdir_flag_spec_CXX \
- hardcode_libdir_flag_spec_ld_CXX \
- hardcode_libdir_separator_CXX \
--fix_srcfile_path_CXX \
- exclude_expsyms_CXX \
- include_expsyms_CXX \
- file_list_spec_CXX \
-@@ -18259,6 +19110,7 @@ module_cmds \
- module_expsym_cmds \
- export_symbols_cmds \
- prelink_cmds \
-+postlink_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- finish_cmds \
-@@ -18273,7 +19125,8 @@ archive_expsym_cmds_CXX \
- module_cmds_CXX \
- module_expsym_cmds_CXX \
- export_symbols_cmds_CXX \
--prelink_cmds_CXX; do
-+prelink_cmds_CXX \
-+postlink_cmds_CXX; do
-     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-     *[\\\\\\\`\\"\\\$]*)
-       eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
-@@ -19066,7 +19919,8 @@ $as_echo X"$file" |
- # NOTE: Changes made to this file will be lost: look at ltmain.sh.
- #
- #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
--#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-+#                 Inc.
- #   Written by Gordon Matzigkeit, 1996
- #
- #   This file is part of GNU Libtool.
-@@ -19169,19 +20023,42 @@ SP2NL=$lt_lt_SP2NL
- # turn newlines into spaces.
- NL2SP=$lt_lt_NL2SP
- 
-+# convert \$build file names to \$host format.
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+
-+# convert \$build files to toolchain format.
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+
- # An object symbol dumper.
- OBJDUMP=$lt_OBJDUMP
- 
- # Method to check whether dependent libraries are shared objects.
- deplibs_check_method=$lt_deplibs_check_method
- 
--# Command to use when deplibs_check_method == "file_magic".
-+# Command to use when deplibs_check_method = "file_magic".
- file_magic_cmd=$lt_file_magic_cmd
- 
-+# How to find potential files when deplibs_check_method = "file_magic".
-+file_magic_glob=$lt_file_magic_glob
-+
-+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-+want_nocaseglob=$lt_want_nocaseglob
-+
-+# DLL creation program.
-+DLLTOOL=$lt_DLLTOOL
-+
-+# Command to associate shared and link libraries.
-+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-+
- # The archiver.
- AR=$lt_AR
-+
-+# Flags to create an archive.
- AR_FLAGS=$lt_AR_FLAGS
- 
-+# How to feed a file listing to the archiver.
-+archiver_list_spec=$lt_archiver_list_spec
-+
- # A symbol stripping program.
- STRIP=$lt_STRIP
- 
-@@ -19211,6 +20088,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
- # Transform the output of nm in a C name address pair when lib prefix is needed.
- global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
- 
-+# Specify filename containing input files for \$NM.
-+nm_file_list_spec=$lt_nm_file_list_spec
-+
-+# The root where to search for dependent libraries,and in which our libraries should be installed.
-+lt_sysroot=$lt_sysroot
-+
- # The name of the directory that contains temporary libtool files.
- objdir=$objdir
- 
-@@ -19220,6 +20103,9 @@ MAGIC_CMD=$MAGIC_CMD
- # Must we lock files when doing compilation?
- need_locks=$lt_need_locks
- 
-+# Manifest tool.
-+MANIFEST_TOOL=$lt_MANIFEST_TOOL
-+
- # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
- DSYMUTIL=$lt_DSYMUTIL
- 
-@@ -19334,12 +20220,12 @@ with_gcc=$GCC
- # Compiler flag to turn off builtin functions.
- no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
- 
--# How to pass a linker flag through the compiler.
--wl=$lt_lt_prog_compiler_wl
--
- # Additional compiler flags for building library objects.
- pic_flag=$lt_lt_prog_compiler_pic
- 
-+# How to pass a linker flag through the compiler.
-+wl=$lt_lt_prog_compiler_wl
-+
- # Compiler flag to prevent dynamic linking.
- link_static_flag=$lt_lt_prog_compiler_static
- 
-@@ -19426,9 +20312,6 @@ inherit_rpath=$inherit_rpath
- # Whether libtool must link a program against all its dependency libraries.
- link_all_deplibs=$link_all_deplibs
- 
--# Fix the shell variable \$srcfile for the compiler.
--fix_srcfile_path=$lt_fix_srcfile_path
--
- # Set to "yes" if exported symbols are required.
- always_export_symbols=$always_export_symbols
- 
-@@ -19444,6 +20327,9 @@ include_expsyms=$lt_include_expsyms
- # Commands necessary for linking programs (against libraries) with templates.
- prelink_cmds=$lt_prelink_cmds
- 
-+# Commands necessary for finishing linking programs.
-+postlink_cmds=$lt_postlink_cmds
-+
- # Specify filename containing input files.
- file_list_spec=$lt_file_list_spec
- 
-@@ -19490,210 +20376,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
-   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-   # text mode, it properly converts lines to CR/LF.  This bash problem
-   # is reportedly fixed, but why not run on old versions too?
--  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  case $xsi_shell in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result="${1##*/}"
--}
--
--# func_dirname_and_basename file append nondir_replacement
--# perform func_basename and func_dirname in a single function
--# call:
--#   dirname:  Compute the dirname of FILE.  If nonempty,
--#             add APPEND to the result, otherwise set result
--#             to NONDIR_REPLACEMENT.
--#             value returned in "$func_dirname_result"
--#   basename: Compute filename of FILE.
--#             value retuned in "$func_basename_result"
--# Implementation must be kept synchronized with func_dirname
--# and func_basename. For efficiency, we do not delegate to
--# those functions but instead duplicate the functionality here.
--func_dirname_and_basename ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--  func_basename_result="${1##*/}"
--}
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--func_stripname ()
--{
--  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
--  # positional parameters, so assign one to ordinary parameter first.
--  func_stripname_result=${3}
--  func_stripname_result=${func_stripname_result#"${1}"}
--  func_stripname_result=${func_stripname_result%"${2}"}
--}
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=${1%%=*}
--  func_opt_split_arg=${1#*=}
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  case ${1} in
--    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
--    *)    func_lo2o_result=${1} ;;
--  esac
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=${1%.*}.lo
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=$(( $* ))
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=${#1}
--}
--
--_LT_EOF
--    ;;
--  *) # Bourne compatible functions.
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  # Extract subdirectory from the argument.
--  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
--  if test "X$func_dirname_result" = "X${1}"; then
--    func_dirname_result="${3}"
--  else
--    func_dirname_result="$func_dirname_result${2}"
--  fi
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
--}
--
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--# func_strip_suffix prefix name
--func_stripname ()
--{
--  case ${2} in
--    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
--    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
--  esac
--}
--
--# sed scripts:
--my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
--my_sed_long_arg='1s/^-[^=]*=//'
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
--  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=`expr "$@"`
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
--}
--
--_LT_EOF
--esac
--
--case $lt_shell_append in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1+=\$2"
--}
--_LT_EOF
--    ;;
--  *)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1=\$$1\$2"
--}
--
--_LT_EOF
--    ;;
--  esac
--
--
--  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  mv -f "$cfgfile" "$ofile" ||
-+  sed '$q' "$ltmain" >> "$cfgfile" \
-+     || (rm -f "$cfgfile"; exit 1)
-+
-+  if test x"$xsi_shell" = xyes; then
-+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-+func_dirname ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-+func_basename ()\
-+{\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-+func_dirname_and_basename ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-+func_stripname ()\
-+{\
-+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-+\    # positional parameters, so assign one to ordinary parameter first.\
-+\    func_stripname_result=${3}\
-+\    func_stripname_result=${func_stripname_result#"${1}"}\
-+\    func_stripname_result=${func_stripname_result%"${2}"}\
-+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-+func_split_long_opt ()\
-+{\
-+\    func_split_long_opt_name=${1%%=*}\
-+\    func_split_long_opt_arg=${1#*=}\
-+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-+func_split_short_opt ()\
-+{\
-+\    func_split_short_opt_arg=${1#??}\
-+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-+func_lo2o ()\
-+{\
-+\    case ${1} in\
-+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-+\      *)    func_lo2o_result=${1} ;;\
-+\    esac\
-+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-+func_xform ()\
-+{\
-+    func_xform_result=${1%.*}.lo\
-+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-+func_arith ()\
-+{\
-+    func_arith_result=$(( $* ))\
-+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_len ()$/,/^} # func_len /c\
-+func_len ()\
-+{\
-+    func_len_result=${#1}\
-+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+fi
-+
-+if test x"$lt_shell_append" = xyes; then
-+  sed -e '/^func_append ()$/,/^} # func_append /c\
-+func_append ()\
-+{\
-+    eval "${1}+=\\${2}"\
-+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-+func_append_quoted ()\
-+{\
-+\    func_quote_for_eval "${2}"\
-+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  # Save a `func_append' function call where possible by direct use of '+='
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+else
-+  # Save a `func_append' function call even when '+=' is not available
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+fi
-+
-+if test x"$_lt_function_replace_fail" = x":"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-+fi
-+
-+
-+   mv -f "$cfgfile" "$ofile" ||
-     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-   chmod +x "$ofile"
- 
-@@ -19721,12 +20566,12 @@ with_gcc=$GCC_CXX
- # Compiler flag to turn off builtin functions.
- no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
- 
--# How to pass a linker flag through the compiler.
--wl=$lt_lt_prog_compiler_wl_CXX
--
- # Additional compiler flags for building library objects.
- pic_flag=$lt_lt_prog_compiler_pic_CXX
- 
-+# How to pass a linker flag through the compiler.
-+wl=$lt_lt_prog_compiler_wl_CXX
-+
- # Compiler flag to prevent dynamic linking.
- link_static_flag=$lt_lt_prog_compiler_static_CXX
- 
-@@ -19813,9 +20658,6 @@ inherit_rpath=$inherit_rpath_CXX
- # Whether libtool must link a program against all its dependency libraries.
- link_all_deplibs=$link_all_deplibs_CXX
- 
--# Fix the shell variable \$srcfile for the compiler.
--fix_srcfile_path=$lt_fix_srcfile_path_CXX
--
- # Set to "yes" if exported symbols are required.
- always_export_symbols=$always_export_symbols_CXX
- 
-@@ -19831,6 +20673,9 @@ include_expsyms=$lt_include_expsyms_CXX
- # Commands necessary for linking programs (against libraries) with templates.
- prelink_cmds=$lt_prelink_cmds_CXX
- 
-+# Commands necessary for finishing linking programs.
-+postlink_cmds=$lt_postlink_cmds_CXX
-+
- # Specify filename containing input files.
- file_list_spec=$lt_file_list_spec_CXX
- 
-diff --git a/libtool.m4 b/libtool.m4
-index 24d13f3..e45fdc6 100644
---- a/libtool.m4
-+++ b/libtool.m4
-@@ -1,7 +1,8 @@
- # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
- #
- #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
--#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-+#                 Inc.
- #   Written by Gordon Matzigkeit, 1996
- #
- # This file is free software; the Free Software Foundation gives
-@@ -10,7 +11,8 @@
- 
- m4_define([_LT_COPYING], [dnl
- #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
--#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-+#                 Inc.
- #   Written by Gordon Matzigkeit, 1996
- #
- #   This file is part of GNU Libtool.
-@@ -37,7 +39,7 @@ m4_define([_LT_COPYING], [dnl
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- ])
- 
--# serial 56 LT_INIT
-+# serial 57 LT_INIT
- 
- 
- # LT_PREREQ(VERSION)
-@@ -92,7 +94,8 @@ _LT_SET_OPTIONS([$0], [$1])
- LIBTOOL_DEPS="$ltmain"
- 
- # Always use our own libtool.
--LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-+LIBTOOL='$(SHELL) $(top_builddir)'
-+LIBTOOL="$LIBTOOL/${host_alias}-libtool"
- AC_SUBST(LIBTOOL)dnl
- 
- _LT_SETUP
-@@ -166,10 +169,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
- dnl
- m4_require([_LT_FILEUTILS_DEFAULTS])dnl
- m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
- m4_require([_LT_CMD_RELOAD])dnl
- m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
- m4_require([_LT_CMD_OLD_ARCHIVE])dnl
- m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-+m4_require([_LT_WITH_SYSROOT])dnl
- 
- _LT_CONFIG_LIBTOOL_INIT([
- # See if we are running on zsh, and set the options which allow our
-@@ -199,7 +205,7 @@ aix3*)
- esac
- 
- # Global variables:
--ofile=libtool
-+ofile=${host_alias}-libtool
- can_build_shared=yes
- 
- # All known linkers require a `.a' archive for static linking (except MSVC,
-@@ -632,7 +638,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
- m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
- configured by $[0], generated by m4_PACKAGE_STRING.
- 
--Copyright (C) 2009 Free Software Foundation, Inc.
-+Copyright (C) 2010 Free Software Foundation, Inc.
- This config.lt script is free software; the Free Software Foundation
- gives unlimited permision to copy, distribute and modify it."
- 
-@@ -746,15 +752,12 @@ _LT_EOF
-   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-   # text mode, it properly converts lines to CR/LF.  This bash problem
-   # is reportedly fixed, but why not run on old versions too?
--  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
-+  sed '$q' "$ltmain" >> "$cfgfile" \
-+     || (rm -f "$cfgfile"; exit 1)
- 
--  _LT_PROG_XSI_SHELLFNS
-+  _LT_PROG_REPLACE_SHELLFNS
- 
--  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  mv -f "$cfgfile" "$ofile" ||
-+   mv -f "$cfgfile" "$ofile" ||
-     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-   chmod +x "$ofile"
- ],
-@@ -980,6 +983,8 @@ _LT_EOF
-       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
-       echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
-       $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
-+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
-+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
-       cat > conftest.c << _LT_EOF
- int main() { return 0;}
- _LT_EOF
-@@ -1069,30 +1074,41 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
-   fi
- ])
- 
--# _LT_SYS_MODULE_PATH_AIX
--# -----------------------
-+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
-+# ----------------------------------
- # Links a minimal program and checks the executable
- # for the system default hardcoded library path. In most cases,
- # this is /usr/lib:/lib, but when the MPI compilers are used
- # the location of the communication and MPI libs are included too.
- # If we don't find anything, use the default library path according
- # to the aix ld manual.
-+# Store the results from the different compilers for each TAGNAME.
-+# Allow to override them for all tags through lt_cv_aix_libpath.
- m4_defun([_LT_SYS_MODULE_PATH_AIX],
- [m4_require([_LT_DECL_SED])dnl
--AC_LINK_IFELSE(AC_LANG_PROGRAM,[
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi],[])
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
-+  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
-+  lt_aix_libpath_sed='[
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }]'
-+  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi],[])
-+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
-+  fi
-+  ])
-+  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
-+fi
- ])# _LT_SYS_MODULE_PATH_AIX
- 
- 
-@@ -1117,7 +1133,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- 
- AC_MSG_CHECKING([how to print strings])
- # Test print first, because it will be a builtin if present.
--if test "X`print -r -- -n 2>/dev/null`" = X-n && \
-+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-   ECHO='print -r --'
- elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-@@ -1161,6 +1177,39 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
- ])# _LT_PROG_ECHO_BACKSLASH
- 
- 
-+# _LT_WITH_SYSROOT
-+# ----------------
-+AC_DEFUN([_LT_WITH_SYSROOT],
-+[AC_MSG_CHECKING([for sysroot])
-+AC_ARG_WITH([libtool-sysroot],
-+[  --with-libtool-sysroot[=DIR] Search for dependent libraries within DIR
-+                        (or the compiler's sysroot if not specified).],
-+[], [with_libtool_sysroot=no])
-+
-+dnl lt_sysroot will always be passed unquoted.  We quote it here
-+dnl in case the user passed a directory name.
-+lt_sysroot=
-+case ${with_libtool_sysroot} in #(
-+ yes)
-+   if test "$GCC" = yes; then
-+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-+   fi
-+   ;; #(
-+ /*)
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
-+   ;; #(
-+ no|'')
-+   ;; #(
-+ *)
-+   AC_MSG_RESULT([${with_libtool_sysroot}])
-+   AC_MSG_ERROR([The sysroot must be an absolute path.])
-+   ;;
-+esac
-+
-+ AC_MSG_RESULT([${lt_sysroot:-no}])
-+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-+[dependent libraries, and in which our libraries should be installed.])])
-+
- # _LT_ENABLE_LOCK
- # ---------------
- m4_defun([_LT_ENABLE_LOCK],
-@@ -1320,14 +1369,47 @@ need_locks="$enable_libtool_lock"
- ])# _LT_ENABLE_LOCK
- 
- 
-+# _LT_PROG_AR
-+# -----------
-+m4_defun([_LT_PROG_AR],
-+[AC_CHECK_TOOLS(AR, [ar], false)
-+: ${AR=ar}
-+: ${AR_FLAGS=cru}
-+_LT_DECL([], [AR], [1], [The archiver])
-+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-+
-+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
-+  [lt_cv_ar_at_file=no
-+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
-+     [echo conftest.$ac_objext > conftest.lst
-+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
-+      AC_TRY_EVAL([lt_ar_try])
-+      if test "$ac_status" -eq 0; then
-+	# Ensure the archiver fails upon bogus file names.
-+	rm -f conftest.$ac_objext libconftest.a
-+	AC_TRY_EVAL([lt_ar_try])
-+	if test "$ac_status" -ne 0; then
-+          lt_cv_ar_at_file=@
-+        fi
-+      fi
-+      rm -f conftest.* libconftest.a
-+     ])
-+  ])
-+
-+if test "x$lt_cv_ar_at_file" = xno; then
-+  archiver_list_spec=
-+else
-+  archiver_list_spec=$lt_cv_ar_at_file
-+fi
-+_LT_DECL([], [archiver_list_spec], [1],
-+  [How to feed a file listing to the archiver])
-+])# _LT_PROG_AR
-+
-+
- # _LT_CMD_OLD_ARCHIVE
- # -------------------
- m4_defun([_LT_CMD_OLD_ARCHIVE],
--[AC_CHECK_TOOL(AR, ar, false)
--test -z "$AR" && AR=ar
--test -z "$AR_FLAGS" && AR_FLAGS=cru
--_LT_DECL([], [AR], [1], [The archiver])
--_LT_DECL([], [AR_FLAGS], [1])
-+[_LT_PROG_AR
- 
- AC_CHECK_TOOL(STRIP, strip, :)
- test -z "$STRIP" && STRIP=:
-@@ -1623,7 +1705,7 @@ else
-   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-   lt_status=$lt_dlunknown
-   cat > conftest.$ac_ext <<_LT_EOF
--[#line __oline__ "configure"
-+[#line $LINENO "configure"
- #include "confdefs.h"
- 
- #if HAVE_DLFCN_H
-@@ -1667,10 +1749,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -2210,8 +2292,9 @@ cygwin* | mingw* | pw32* | cegcc*)
-   need_version=no
-   need_lib_prefix=no
- 
--  case $GCC,$host_os in
--  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-+  case $GCC,$cc_basename in
-+  yes,*)
-+    # gcc
-     library_names_spec='$libname.dll.a'
-     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-     postinstall_cmds='base_file=`basename \${file}`~
-@@ -2244,13 +2327,71 @@ m4_if([$1], [],[
-       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-       ;;
-     esac
-+    dynamic_linker='Win32 ld.exe'
-+    ;;
-+
-+  *,cl*)
-+    # Native MSVC
-+    libname_spec='$name'
-+    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-+    library_names_spec='${libname}.dll.lib'
-+
-+    case $build_os in
-+    mingw*)
-+      sys_lib_search_path_spec=
-+      lt_save_ifs=$IFS
-+      IFS=';'
-+      for lt_path in $LIB
-+      do
-+        IFS=$lt_save_ifs
-+        # Let DOS variable expansion print the short 8.3 style file name.
-+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-+      done
-+      IFS=$lt_save_ifs
-+      # Convert to MSYS style.
-+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
-+      ;;
-+    cygwin*)
-+      # Convert to unix form, then to dos form, then back to unix form
-+      # but this time dos style (no spaces!) so that the unix form looks
-+      # like /cygdrive/c/PROGRA~1:/cygdr...
-+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      ;;
-+    *)
-+      sys_lib_search_path_spec="$LIB"
-+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
-+        # It is most probably a Windows format PATH.
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-+      else
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      fi
-+      # FIXME: find the short name or the path components, as spaces are
-+      # common. (e.g. "Program Files" -> "PROGRA~1")
-+      ;;
-+    esac
-+
-+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-+    postinstall_cmds='base_file=`basename \${file}`~
-+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-+      dldir=$destdir/`dirname \$dlpath`~
-+      test -d \$dldir || mkdir -p \$dldir~
-+      $install_prog $dir/$dlname \$dldir/$dlname'
-+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-+      dlpath=$dir/\$dldll~
-+       $RM \$dlpath'
-+    shlibpath_overrides_runpath=yes
-+    dynamic_linker='Win32 link.exe'
-     ;;
- 
-   *)
-+    # Assume MSVC wrapper
-     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-+    dynamic_linker='Win32 ld.exe'
-     ;;
-   esac
--  dynamic_linker='Win32 ld.exe'
-   # FIXME: first we should search . and the directory the executable is in
-   shlibpath_var=PATH
-   ;;
-@@ -2342,7 +2483,7 @@ haiku*)
-   soname_spec='${libname}${release}${shared_ext}$major'
-   shlibpath_var=LIBRARY_PATH
-   shlibpath_overrides_runpath=yes
--  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-   hardcode_into_libs=yes
-   ;;
- 
-@@ -2950,6 +3091,11 @@ case $reload_flag in
- esac
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- case $host_os in
-+  cygwin* | mingw* | pw32* | cegcc*)
-+    if test "$GCC" != yes; then
-+      reload_cmds=false
-+    fi
-+    ;;
-   darwin*)
-     if test "$GCC" = yes; then
-       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-@@ -3016,7 +3162,8 @@ mingw* | pw32*)
-     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-     lt_cv_file_magic_cmd='func_win32_libid'
-   else
--    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-+    # Keep this pattern in sync with the one in func_win32_libid.
-+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-     lt_cv_file_magic_cmd='$OBJDUMP -f'
-   fi
-   ;;
-@@ -3167,6 +3314,21 @@ tpf*)
-   ;;
- esac
- ])
-+
-+file_magic_glob=
-+want_nocaseglob=no
-+if test "$build" = "$host"; then
-+  case $host_os in
-+  mingw* | pw32*)
-+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-+      want_nocaseglob=yes
-+    else
-+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
-+    fi
-+    ;;
-+  esac
-+fi
-+
- file_magic_cmd=$lt_cv_file_magic_cmd
- deplibs_check_method=$lt_cv_deplibs_check_method
- test -z "$deplibs_check_method" && deplibs_check_method=unknown
-@@ -3174,7 +3336,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
- _LT_DECL([], [deplibs_check_method], [1],
-     [Method to check whether dependent libraries are shared objects])
- _LT_DECL([], [file_magic_cmd], [1],
--    [Command to use when deplibs_check_method == "file_magic"])
-+    [Command to use when deplibs_check_method = "file_magic"])
-+_LT_DECL([], [file_magic_glob], [1],
-+    [How to find potential files when deplibs_check_method = "file_magic"])
-+_LT_DECL([], [want_nocaseglob], [1],
-+    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
- ])# _LT_CHECK_MAGIC_METHOD
- 
- 
-@@ -3277,6 +3443,67 @@ dnl aclocal-1.4 backwards compatibility:
- dnl AC_DEFUN([AM_PROG_NM], [])
- dnl AC_DEFUN([AC_PROG_NM], [])
- 
-+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-+# --------------------------------
-+# how to determine the name of the shared library
-+# associated with a specific link library.
-+#  -- PORTME fill in with the dynamic library characteristics
-+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
-+[m4_require([_LT_DECL_EGREP])
-+m4_require([_LT_DECL_OBJDUMP])
-+m4_require([_LT_DECL_DLLTOOL])
-+AC_CACHE_CHECK([how to associate runtime and link libraries],
-+lt_cv_sharedlib_from_linklib_cmd,
-+[lt_cv_sharedlib_from_linklib_cmd='unknown'
-+
-+case $host_os in
-+cygwin* | mingw* | pw32* | cegcc*)
-+  # two different shell functions defined in ltmain.sh
-+  # decide which to use based on capabilities of $DLLTOOL
-+  case `$DLLTOOL --help 2>&1` in
-+  *--identify-strict*)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-+    ;;
-+  *)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-+    ;;
-+  esac
-+  ;;
-+*)
-+  # fallback: assume linklib IS sharedlib
-+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-+  ;;
-+esac
-+])
-+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-+
-+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
-+    [Command to associate shared and link libraries])
-+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-+
-+
-+# _LT_PATH_MANIFEST_TOOL
-+# ----------------------
-+# locate the manifest tool
-+m4_defun([_LT_PATH_MANIFEST_TOOL],
-+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
-+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
-+  [lt_cv_path_mainfest_tool=no
-+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
-+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-+  cat conftest.err >&AS_MESSAGE_LOG_FD
-+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-+    lt_cv_path_mainfest_tool=yes
-+  fi
-+  rm -f conftest*])
-+if test "x$lt_cv_path_mainfest_tool" != xyes; then
-+  MANIFEST_TOOL=:
-+fi
-+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
-+])# _LT_PATH_MANIFEST_TOOL
-+
- 
- # LT_LIB_M
- # --------
-@@ -3403,8 +3630,8 @@ esac
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- 
- # Transform an extracted symbol line into symbol name and symbol address
--lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
--lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
- 
- # Handle CRLF in mingw tool chain
- opt_cr=
-@@ -3440,6 +3667,7 @@ for ac_symprfx in "" "_"; do
-   else
-     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-   fi
-+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
- 
-   # Check to see that the pipe works correctly.
-   pipe_works=no
-@@ -3473,6 +3701,18 @@ _LT_EOF
-       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- 	  cat <<_LT_EOF > conftest.$ac_ext
-+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-+/* DATA imports from DLLs on WIN32 con't be const, because runtime
-+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-+# define LT@&t@_DLSYM_CONST
-+#elif defined(__osf__)
-+/* This system does not cope well with relocations in const data.  */
-+# define LT@&t@_DLSYM_CONST
-+#else
-+# define LT@&t@_DLSYM_CONST const
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -3484,7 +3724,7 @@ _LT_EOF
- 	  cat <<_LT_EOF >> conftest.$ac_ext
- 
- /* The mapping between symbol names and symbols.  */
--const struct {
-+LT@&t@_DLSYM_CONST struct {
-   const char *name;
-   void       *address;
- }
-@@ -3510,15 +3750,15 @@ static const void *lt_preloaded_setup() {
- _LT_EOF
- 	  # Now try linking the two files.
- 	  mv conftest.$ac_objext conftstm.$ac_objext
--	  lt_save_LIBS="$LIBS"
--	  lt_save_CFLAGS="$CFLAGS"
-+	  lt_globsym_save_LIBS=$LIBS
-+	  lt_globsym_save_CFLAGS=$CFLAGS
- 	  LIBS="conftstm.$ac_objext"
- 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- 	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- 	    pipe_works=yes
- 	  fi
--	  LIBS="$lt_save_LIBS"
--	  CFLAGS="$lt_save_CFLAGS"
-+	  LIBS=$lt_globsym_save_LIBS
-+	  CFLAGS=$lt_globsym_save_CFLAGS
- 	else
- 	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- 	fi
-@@ -3551,6 +3791,13 @@ else
-   AC_MSG_RESULT(ok)
- fi
- 
-+# Response file support.
-+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-+  nm_file_list_spec='@'
-+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
-+  nm_file_list_spec='@'
-+fi
-+
- _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
-     [Take the output of nm and produce a listing of raw symbols and C names])
- _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
-@@ -3561,6 +3808,8 @@ _LT_DECL([global_symbol_to_c_name_address],
- _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
-     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
-     [Transform the output of nm in a C name address pair when lib prefix is needed])
-+_LT_DECL([], [nm_file_list_spec], [1],
-+    [Specify filename containing input files for $NM])
- ]) # _LT_CMD_GLOBAL_SYMBOLS
- 
- 
-@@ -3572,7 +3821,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)=
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- 
--AC_MSG_CHECKING([for $compiler option to produce PIC])
- m4_if([$1], [CXX], [
-   # C++ specific cases for pic, static, wl, etc.
-   if test "$GXX" = yes; then
-@@ -3678,6 +3926,12 @@ m4_if([$1], [CXX], [
- 	  ;;
- 	esac
- 	;;
-+      mingw* | cygwin* | os2* | pw32* | cegcc*)
-+	# This hack is so that the source file can tell whether it is being
-+	# built for inclusion in a dll (and should export symbols for example).
-+	m4_if([$1], [GCJ], [],
-+	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-+	;;
-       dgux*)
- 	case $cc_basename in
- 	  ec++*)
-@@ -3830,7 +4084,7 @@ m4_if([$1], [CXX], [
- 	;;
-       solaris*)
- 	case $cc_basename in
--	  CC*)
-+	  CC* | sunCC*)
- 	    # Sun C++ 4.2, 5.x and Centerline C++
- 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-@@ -4053,6 +4307,12 @@ m4_if([$1], [CXX], [
- 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
- 	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
- 	;;
-+      nagfor*)
-+	# NAG Fortran compiler
-+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
-+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-+	;;
-       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-         # Portland Group compilers (*not* the Pentium gcc compiler,
- 	# which looks to be a dead project)
-@@ -4115,7 +4375,7 @@ m4_if([$1], [CXX], [
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-       case $cc_basename in
--      f77* | f90* | f95*)
-+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-       *)
- 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-@@ -4172,9 +4432,11 @@ case $host_os in
-     _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
-     ;;
- esac
--AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
--_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
--	[How to pass a linker flag through the compiler])
-+
-+AC_CACHE_CHECK([for $compiler option to produce PIC],
-+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
-+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
- 
- #
- # Check to make sure the PIC flag actually works.
-@@ -4193,6 +4455,8 @@ fi
- _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
- 	[Additional compiler flags for building library objects])
- 
-+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
-+	[How to pass a linker flag through the compiler])
- #
- # Check to make sure the static flag actually works.
- #
-@@ -4213,6 +4477,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
- m4_defun([_LT_LINKER_SHLIBS],
- [AC_REQUIRE([LT_PATH_LD])dnl
- AC_REQUIRE([LT_PATH_NM])dnl
-+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
- m4_require([_LT_FILEUTILS_DEFAULTS])dnl
- m4_require([_LT_DECL_EGREP])dnl
- m4_require([_LT_DECL_SED])dnl
-@@ -4221,6 +4486,7 @@ m4_require([_LT_TAG_COMPILER])dnl
- AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
- m4_if([$1], [CXX], [
-   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-   case $host_os in
-   aix[[4-9]]*)
-     # If we're using GNU nm, then we don't want the "-C" option.
-@@ -4235,15 +4501,20 @@ m4_if([$1], [CXX], [
-     ;;
-   pw32*)
-     _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
--  ;;
-+    ;;
-   cygwin* | mingw* | cegcc*)
--    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
--  ;;
-+    case $cc_basename in
-+    cl*) ;;
-+    *)
-+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-+      ;;
-+    esac
-+    ;;
-   *)
-     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
--  ;;
-+    ;;
-   esac
--  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- ], [
-   runpath_var=
-   _LT_TAGVAR(allow_undefined_flag, $1)=
-@@ -4411,7 +4682,8 @@ _LT_EOF
-       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-       _LT_TAGVAR(always_export_symbols, $1)=no
-       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
--      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
- 
-       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-@@ -4510,12 +4782,12 @@ _LT_EOF
- 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- 	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
--	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- 	  if test "x$supports_anon_versioning" = xyes; then
- 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- 	      echo "local: *; };" >> $output_objdir/$libname.ver~
--	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- 	  fi
- 	  ;;
- 	esac
-@@ -4529,8 +4801,8 @@ _LT_EOF
- 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- 	wlarc=
-       else
--	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       fi
-       ;;
- 
-@@ -4548,8 +4820,8 @@ _LT_EOF
- 
- _LT_EOF
-       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	_LT_TAGVAR(ld_shlibs, $1)=no
-       fi
-@@ -4595,8 +4867,8 @@ _LT_EOF
- 
-     *)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	_LT_TAGVAR(ld_shlibs, $1)=no
-       fi
-@@ -4726,7 +4998,7 @@ _LT_EOF
- 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-         # Determine the default libpath from the value encoded in an
-         # empty executable.
--        _LT_SYS_MODULE_PATH_AIX
-+        _LT_SYS_MODULE_PATH_AIX([$1])
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-@@ -4737,7 +5009,7 @@ _LT_EOF
- 	else
- 	 # Determine the default libpath from the value encoded in an
- 	 # empty executable.
--	 _LT_SYS_MODULE_PATH_AIX
-+	 _LT_SYS_MODULE_PATH_AIX([$1])
- 	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- 	  # Warning - without using the other run time loading flags,
- 	  # -berok will link without error, but may produce a broken library.
-@@ -4781,20 +5053,63 @@ _LT_EOF
-       # Microsoft Visual C++.
-       # hardcode_libdir_flag_spec is actually meaningless, as there is
-       # no search path for DLLs.
--      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
--      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
--      # Tell ltmain to make .lib files, not .a files.
--      libext=lib
--      # Tell ltmain to make .dll files, not .so files.
--      shrext_cmds=".dll"
--      # FIXME: Setting linknames here is a bad hack.
--      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
--      # The linker will automatically build a .lib file if we build a DLL.
--      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
--      # FIXME: Should let the user specify the lib program.
--      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
--      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
--      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-+      case $cc_basename in
-+      cl*)
-+	# Native MSVC
-+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-+	_LT_TAGVAR(always_export_symbols, $1)=yes
-+	_LT_TAGVAR(file_list_spec, $1)='@'
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-+	  else
-+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-+	  fi~
-+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-+	  linknames='
-+	# The linker will not automatically build a static lib if we build a DLL.
-+	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-+	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-+	# Don't use ranlib
-+	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-+	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-+	  case $lt_outputfile in
-+	    *.exe|*.EXE) ;;
-+	    *)
-+	      lt_outputfile="$lt_outputfile.exe"
-+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-+	      ;;
-+	  esac~
-+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-+	    $RM "$lt_outputfile.manifest";
-+	  fi'
-+	;;
-+      *)
-+	# Assume MSVC wrapper
-+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-+	# The linker will automatically build a .lib file if we build a DLL.
-+	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-+	# FIXME: Should let the user specify the lib program.
-+	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-+	;;
-+      esac
-       ;;
- 
-     darwin* | rhapsody*)
-@@ -4828,7 +5143,7 @@ _LT_EOF
- 
-     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-     freebsd* | dragonfly*)
--      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-       _LT_TAGVAR(hardcode_direct, $1)=yes
-       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-@@ -4836,7 +5151,7 @@ _LT_EOF
- 
-     hpux9*)
-       if test "$GCC" = yes; then
--	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       else
- 	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       fi
-@@ -4852,7 +5167,7 @@ _LT_EOF
- 
-     hpux10*)
-       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
--	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-       else
- 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-       fi
-@@ -4876,10 +5191,10 @@ _LT_EOF
- 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	ia64*)
--	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	*)
--	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	esac
-       else
-@@ -4926,16 +5241,31 @@ _LT_EOF
- 
-     irix5* | irix6* | nonstopux*)
-       if test "$GCC" = yes; then
--	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	# Try to use the -exported_symbol ld option, if it does not
- 	# work, assume that -exports_file does not work either and
- 	# implicitly export all symbols.
--        save_LDFLAGS="$LDFLAGS"
--        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
--        AC_LINK_IFELSE(int foo(void) {},
--          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
--        )
--        LDFLAGS="$save_LDFLAGS"
-+	# This should be the same for all languages, so no per-tag cache variable.
-+	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
-+	  [lt_cv_irix_exported_symbol],
-+	  [save_LDFLAGS="$LDFLAGS"
-+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-+	   AC_LINK_IFELSE(
-+	     [AC_LANG_SOURCE(
-+	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
-+			      [C++], [[int foo (void) { return 0; }]],
-+			      [Fortran 77], [[
-+      subroutine foo
-+      end]],
-+			      [Fortran], [[
-+      subroutine foo
-+      end]])])],
-+	      [lt_cv_irix_exported_symbol=yes],
-+	      [lt_cv_irix_exported_symbol=no])
-+           LDFLAGS="$save_LDFLAGS"])
-+	if test "$lt_cv_irix_exported_symbol" = yes; then
-+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-+	fi
-       else
- 	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- 	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-@@ -5020,7 +5350,7 @@ _LT_EOF
-     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-       if test "$GCC" = yes; then
- 	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
--	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-       else
- 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-@@ -5039,9 +5369,9 @@ _LT_EOF
-       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-       if test "$GCC" = yes; then
- 	wlarc='${wl}'
--	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
--	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-       else
- 	case `$CC -V 2>&1` in
- 	*"Compilers 5.0"*)
-@@ -5313,8 +5643,6 @@ _LT_TAGDECL([], [inherit_rpath], [0],
-     to runtime path list])
- _LT_TAGDECL([], [link_all_deplibs], [0],
-     [Whether libtool must link a program against all its dependency libraries])
--_LT_TAGDECL([], [fix_srcfile_path], [1],
--    [Fix the shell variable $srcfile for the compiler])
- _LT_TAGDECL([], [always_export_symbols], [0],
-     [Set to "yes" if exported symbols are required])
- _LT_TAGDECL([], [export_symbols_cmds], [2],
-@@ -5325,6 +5653,8 @@ _LT_TAGDECL([], [include_expsyms], [1],
-     [Symbols that must always be exported])
- _LT_TAGDECL([], [prelink_cmds], [2],
-     [Commands necessary for linking programs (against libraries) with templates])
-+_LT_TAGDECL([], [postlink_cmds], [2],
-+    [Commands necessary for finishing linking programs])
- _LT_TAGDECL([], [file_list_spec], [1],
-     [Specify filename containing input files])
- dnl FIXME: Not yet implemented
-@@ -5426,6 +5756,7 @@ CC="$lt_save_CC"
- m4_defun([_LT_LANG_CXX_CONFIG],
- [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
- m4_require([_LT_DECL_EGREP])dnl
-+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-     ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-     (test "X$CXX" != "Xg++"))) ; then
-@@ -5487,6 +5818,7 @@ if test "$_lt_caught_CXX_error" != yes; then
- 
-   # Allow CC to be a program name with arguments.
-   lt_save_CC=$CC
-+  lt_save_CFLAGS=$CFLAGS
-   lt_save_LD=$LD
-   lt_save_GCC=$GCC
-   GCC=$GXX
-@@ -5504,6 +5836,7 @@ if test "$_lt_caught_CXX_error" != yes; then
-   fi
-   test -z "${LDCXX+set}" || LD=$LDCXX
-   CC=${CXX-"c++"}
-+  CFLAGS=$CXXFLAGS
-   compiler=$CC
-   _LT_TAGVAR(compiler, $1)=$CC
-   _LT_CC_BASENAME([$compiler])
-@@ -5667,7 +6000,7 @@ if test "$_lt_caught_CXX_error" != yes; then
-           _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-           # Determine the default libpath from the value encoded in an empty
-           # executable.
--          _LT_SYS_MODULE_PATH_AIX
-+          _LT_SYS_MODULE_PATH_AIX([$1])
-           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- 
-           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-@@ -5679,7 +6012,7 @@ if test "$_lt_caught_CXX_error" != yes; then
-           else
- 	    # Determine the default libpath from the value encoded in an
- 	    # empty executable.
--	    _LT_SYS_MODULE_PATH_AIX
-+	    _LT_SYS_MODULE_PATH_AIX([$1])
- 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- 	    # Warning - without using the other run time loading flags,
- 	    # -berok will link without error, but may produce a broken library.
-@@ -5721,29 +6054,75 @@ if test "$_lt_caught_CXX_error" != yes; then
-         ;;
- 
-       cygwin* | mingw* | pw32* | cegcc*)
--        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
--        # as there is no search path for DLLs.
--        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
--        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
--        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
--        _LT_TAGVAR(always_export_symbols, $1)=no
--        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
--
--        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
--          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
--          # If the export-symbols file already is a .def file (1st line
--          # is EXPORTS), use it as is; otherwise, prepend...
--          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
--	    cp $export_symbols $output_objdir/$soname.def;
--          else
--	    echo EXPORTS > $output_objdir/$soname.def;
--	    cat $export_symbols >> $output_objdir/$soname.def;
--          fi~
--          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
--        else
--          _LT_TAGVAR(ld_shlibs, $1)=no
--        fi
--        ;;
-+	case $GXX,$cc_basename in
-+	,cl* | no,cl*)
-+	  # Native MSVC
-+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
-+	  # no search path for DLLs.
-+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-+	  _LT_TAGVAR(always_export_symbols, $1)=yes
-+	  _LT_TAGVAR(file_list_spec, $1)='@'
-+	  # Tell ltmain to make .lib files, not .a files.
-+	  libext=lib
-+	  # Tell ltmain to make .dll files, not .so files.
-+	  shrext_cmds=".dll"
-+	  # FIXME: Setting linknames here is a bad hack.
-+	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-+	    else
-+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-+	    fi~
-+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-+	    linknames='
-+	  # The linker will not automatically build a static lib if we build a DLL.
-+	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-+	  # Don't use ranlib
-+	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-+	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
-+	    case $lt_outputfile in
-+	      *.exe|*.EXE) ;;
-+	      *)
-+		lt_outputfile="$lt_outputfile.exe"
-+		lt_tool_outputfile="$lt_tool_outputfile.exe"
-+		;;
-+	    esac~
-+	    func_to_tool_file "$lt_outputfile"~
-+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-+	      $RM "$lt_outputfile.manifest";
-+	    fi'
-+	  ;;
-+	*)
-+	  # g++
-+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-+	  # as there is no search path for DLLs.
-+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
-+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-+	  _LT_TAGVAR(always_export_symbols, $1)=no
-+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-+
-+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-+	    # If the export-symbols file already is a .def file (1st line
-+	    # is EXPORTS), use it as is; otherwise, prepend...
-+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	      cp $export_symbols $output_objdir/$soname.def;
-+	    else
-+	      echo EXPORTS > $output_objdir/$soname.def;
-+	      cat $export_symbols >> $output_objdir/$soname.def;
-+	    fi~
-+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-+	  else
-+	    _LT_TAGVAR(ld_shlibs, $1)=no
-+	  fi
-+	  ;;
-+	esac
-+	;;
-       darwin* | rhapsody*)
-         _LT_DARWIN_LINKER_FEATURES($1)
- 	;;
-@@ -5818,7 +6197,7 @@ if test "$_lt_caught_CXX_error" != yes; then
-             ;;
-           *)
-             if test "$GXX" = yes; then
--              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-             else
-               # FIXME: insert proper C++ library support
-               _LT_TAGVAR(ld_shlibs, $1)=no
-@@ -5889,10 +6268,10 @@ if test "$_lt_caught_CXX_error" != yes; then
- 	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- 	            ;;
- 	          ia64*)
--	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- 	            ;;
- 	          *)
--	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- 	            ;;
- 	        esac
- 	      fi
-@@ -5933,9 +6312,9 @@ if test "$_lt_caught_CXX_error" != yes; then
-           *)
- 	    if test "$GXX" = yes; then
- 	      if test "$with_gnu_ld" = no; then
--	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	      else
--	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
-+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
- 	      fi
- 	    fi
- 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
-@@ -6005,20 +6384,20 @@ if test "$_lt_caught_CXX_error" != yes; then
- 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
- 		rm -rf $tpldir~
- 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
--		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
-+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
- 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
- 		rm -rf $tpldir~
- 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
--		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
-+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- 		$RANLIB $oldlib'
- 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
- 		rm -rf $tpldir~
- 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
--		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
- 		rm -rf $tpldir~
- 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
--		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- 	      ;;
- 	    *) # Version 6 and above use weak symbols
- 	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-@@ -6213,7 +6592,7 @@ if test "$_lt_caught_CXX_error" != yes; then
- 	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 		  ;;
- 	        *)
--	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 		  ;;
- 	      esac
- 
-@@ -6259,7 +6638,7 @@ if test "$_lt_caught_CXX_error" != yes; then
- 
-       solaris*)
-         case $cc_basename in
--          CC*)
-+          CC* | sunCC*)
- 	    # Sun C++ 4.2, 5.x and Centerline C++
-             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
- 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-@@ -6300,9 +6679,9 @@ if test "$_lt_caught_CXX_error" != yes; then
- 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- 	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
--	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
--		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
- 
- 	        # Commands to make compiler produce verbose output that lists
- 	        # what "hidden" libraries, object files and flags are used when
-@@ -6431,6 +6810,7 @@ if test "$_lt_caught_CXX_error" != yes; then
-   fi # test -n "$compiler"
- 
-   CC=$lt_save_CC
-+  CFLAGS=$lt_save_CFLAGS
-   LDCXX=$LD
-   LD=$lt_save_LD
-   GCC=$lt_save_GCC
-@@ -6445,6 +6825,29 @@ AC_LANG_POP
- ])# _LT_LANG_CXX_CONFIG
- 
- 
-+# _LT_FUNC_STRIPNAME_CNF
-+# ----------------------
-+# func_stripname_cnf prefix suffix name
-+# strip PREFIX and SUFFIX off of NAME.
-+# PREFIX and SUFFIX must not contain globbing or regex special
-+# characters, hashes, percent signs, but SUFFIX may contain a leading
-+# dot (in which case that matches only a dot).
-+#
-+# This function is identical to the (non-XSI) version of func_stripname,
-+# except this one can be used by m4 code that may be executed by configure,
-+# rather than the libtool script.
-+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
-+AC_REQUIRE([_LT_DECL_SED])
-+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
-+func_stripname_cnf ()
-+{
-+  case ${2} in
-+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-+  esac
-+} # func_stripname_cnf
-+])# _LT_FUNC_STRIPNAME_CNF
-+
- # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
- # ---------------------------------
- # Figure out "hidden" library dependencies from verbose
-@@ -6453,6 +6856,7 @@ AC_LANG_POP
- # objects, libraries and library flags.
- m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
- [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
- # Dependencies to place before and after the object being linked:
- _LT_TAGVAR(predep_objects, $1)=
- _LT_TAGVAR(postdep_objects, $1)=
-@@ -6503,6 +6907,13 @@ public class foo {
- };
- _LT_EOF
- ])
-+
-+_lt_libdeps_save_CFLAGS=$CFLAGS
-+case "$CC $CFLAGS " in #(
-+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-+esac
-+
- dnl Parse the compiler output and extract the necessary
- dnl objects, libraries and library flags.
- if AC_TRY_EVAL(ac_compile); then
-@@ -6514,7 +6925,7 @@ if AC_TRY_EVAL(ac_compile); then
-   pre_test_object_deps_done=no
- 
-   for p in `eval "$output_verbose_link_cmd"`; do
--    case $p in
-+    case ${prev}${p} in
- 
-     -L* | -R* | -l*)
-        # Some compilers place space between "-{L,R}" and the path.
-@@ -6523,13 +6934,22 @@ if AC_TRY_EVAL(ac_compile); then
-           test $p = "-R"; then
- 	 prev=$p
- 	 continue
--       else
--	 prev=
-        fi
- 
-+       # Expand the sysroot to ease extracting the directories later.
-+       if test -z "$prev"; then
-+         case $p in
-+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
-+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
-+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
-+         esac
-+       fi
-+       case $p in
-+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
-+       esac
-        if test "$pre_test_object_deps_done" = no; then
--	 case $p in
--	 -L* | -R*)
-+	 case ${prev} in
-+	 -L | -R)
- 	   # Internal compiler library paths should come after those
- 	   # provided the user.  The postdeps already come after the
- 	   # user supplied libs so there is no need to process them.
-@@ -6549,8 +6969,10 @@ if AC_TRY_EVAL(ac_compile); then
- 	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
- 	 fi
-        fi
-+       prev=
-        ;;
- 
-+    *.lto.$objext) ;; # Ignore GCC LTO objects
-     *.$objext)
-        # This assumes that the test object file only shows up
-        # once in the compiler output.
-@@ -6586,6 +7008,7 @@ else
- fi
- 
- $RM -f confest.$objext
-+CFLAGS=$_lt_libdeps_save_CFLAGS
- 
- # PORTME: override above test on systems where it is broken
- m4_if([$1], [CXX],
-@@ -6622,7 +7045,7 @@ linux*)
- 
- solaris*)
-   case $cc_basename in
--  CC*)
-+  CC* | sunCC*)
-     # The more standards-conforming stlport4 library is
-     # incompatible with the Cstd library. Avoid specifying
-     # it if it's in CXXFLAGS. Ignore libCrun as
-@@ -6735,7 +7158,9 @@ if test "$_lt_disable_F77" != yes; then
-   # Allow CC to be a program name with arguments.
-   lt_save_CC="$CC"
-   lt_save_GCC=$GCC
-+  lt_save_CFLAGS=$CFLAGS
-   CC=${F77-"f77"}
-+  CFLAGS=$FFLAGS
-   compiler=$CC
-   _LT_TAGVAR(compiler, $1)=$CC
-   _LT_CC_BASENAME([$compiler])
-@@ -6789,6 +7214,7 @@ if test "$_lt_disable_F77" != yes; then
- 
-   GCC=$lt_save_GCC
-   CC="$lt_save_CC"
-+  CFLAGS="$lt_save_CFLAGS"
- fi # test "$_lt_disable_F77" != yes
- 
- AC_LANG_POP
-@@ -6865,7 +7291,9 @@ if test "$_lt_disable_FC" != yes; then
-   # Allow CC to be a program name with arguments.
-   lt_save_CC="$CC"
-   lt_save_GCC=$GCC
-+  lt_save_CFLAGS=$CFLAGS
-   CC=${FC-"f95"}
-+  CFLAGS=$FCFLAGS
-   compiler=$CC
-   GCC=$ac_cv_fc_compiler_gnu
- 
-@@ -6921,7 +7349,8 @@ if test "$_lt_disable_FC" != yes; then
-   fi # test -n "$compiler"
- 
-   GCC=$lt_save_GCC
--  CC="$lt_save_CC"
-+  CC=$lt_save_CC
-+  CFLAGS=$lt_save_CFLAGS
- fi # test "$_lt_disable_FC" != yes
- 
- AC_LANG_POP
-@@ -6958,10 +7387,12 @@ _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
- 
- # Allow CC to be a program name with arguments.
--lt_save_CC="$CC"
-+lt_save_CC=$CC
-+lt_save_CFLAGS=$CFLAGS
- lt_save_GCC=$GCC
- GCC=yes
- CC=${GCJ-"gcj"}
-+CFLAGS=$GCJFLAGS
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_TAGVAR(LD, $1)="$LD"
-@@ -6992,7 +7423,8 @@ fi
- AC_LANG_RESTORE
- 
- GCC=$lt_save_GCC
--CC="$lt_save_CC"
-+CC=$lt_save_CC
-+CFLAGS=$lt_save_CFLAGS
- ])# _LT_LANG_GCJ_CONFIG
- 
- 
-@@ -7027,9 +7459,11 @@ _LT_LINKER_BOILERPLATE
- 
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
-+lt_save_CFLAGS=$CFLAGS
- lt_save_GCC=$GCC
- GCC=
- CC=${RC-"windres"}
-+CFLAGS=
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-@@ -7042,7 +7476,8 @@ fi
- 
- GCC=$lt_save_GCC
- AC_LANG_RESTORE
--CC="$lt_save_CC"
-+CC=$lt_save_CC
-+CFLAGS=$lt_save_CFLAGS
- ])# _LT_LANG_RC_CONFIG
- 
- 
-@@ -7101,6 +7536,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
- AC_SUBST([OBJDUMP])
- ])
- 
-+# _LT_DECL_DLLTOOL
-+# ----------------
-+# Ensure DLLTOOL variable is set.
-+m4_defun([_LT_DECL_DLLTOOL],
-+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-+test -z "$DLLTOOL" && DLLTOOL=dlltool
-+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
-+AC_SUBST([DLLTOOL])
-+])
- 
- # _LT_DECL_SED
- # ------------
-@@ -7194,8 +7638,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES],
- # Try some XSI features
- xsi_shell=no
- ( _lt_dummy="a/b/c"
--  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
--      = c,a/b,, \
-+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-+      = c,a/b,b/c, \
-     && eval 'test $(( 1 + 1 )) -eq 2 \
-     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-   && xsi_shell=yes
-@@ -7234,206 +7678,162 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
- ])# _LT_CHECK_SHELL_FEATURES
- 
- 
--# _LT_PROG_XSI_SHELLFNS
--# ---------------------
--# Bourne and XSI compatible variants of some useful shell functions.
--m4_defun([_LT_PROG_XSI_SHELLFNS],
--[case $xsi_shell in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result="${1##*/}"
--}
--
--# func_dirname_and_basename file append nondir_replacement
--# perform func_basename and func_dirname in a single function
--# call:
--#   dirname:  Compute the dirname of FILE.  If nonempty,
--#             add APPEND to the result, otherwise set result
--#             to NONDIR_REPLACEMENT.
--#             value returned in "$func_dirname_result"
--#   basename: Compute filename of FILE.
--#             value retuned in "$func_basename_result"
--# Implementation must be kept synchronized with func_dirname
--# and func_basename. For efficiency, we do not delegate to
--# those functions but instead duplicate the functionality here.
--func_dirname_and_basename ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--  func_basename_result="${1##*/}"
--}
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--func_stripname ()
--{
--  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
--  # positional parameters, so assign one to ordinary parameter first.
--  func_stripname_result=${3}
--  func_stripname_result=${func_stripname_result#"${1}"}
--  func_stripname_result=${func_stripname_result%"${2}"}
--}
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=${1%%=*}
--  func_opt_split_arg=${1#*=}
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  case ${1} in
--    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
--    *)    func_lo2o_result=${1} ;;
--  esac
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=${1%.*}.lo
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=$(( $[*] ))
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=${#1}
--}
-+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-+# ------------------------------------------------------
-+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-+m4_defun([_LT_PROG_FUNCTION_REPLACE],
-+[dnl {
-+sed -e '/^$1 ()$/,/^} # $1 /c\
-+$1 ()\
-+{\
-+m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
-+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+])
- 
--_LT_EOF
--    ;;
--  *) # Bourne compatible functions.
--    cat << \_LT_EOF >> "$cfgfile"
- 
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  # Extract subdirectory from the argument.
--  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
--  if test "X$func_dirname_result" = "X${1}"; then
--    func_dirname_result="${3}"
--  else
--    func_dirname_result="$func_dirname_result${2}"
--  fi
--}
-+# _LT_PROG_REPLACE_SHELLFNS
-+# -------------------------
-+# Replace existing portable implementations of several shell functions with
-+# equivalent extended shell implementations where those features are available..
-+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-+[if test x"$xsi_shell" = xyes; then
-+  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
-+    case ${1} in
-+      */*) func_dirname_result="${1%/*}${2}" ;;
-+      *  ) func_dirname_result="${3}" ;;
-+    esac])
-+
-+  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
-+    func_basename_result="${1##*/}"])
-+
-+  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
-+    case ${1} in
-+      */*) func_dirname_result="${1%/*}${2}" ;;
-+      *  ) func_dirname_result="${3}" ;;
-+    esac
-+    func_basename_result="${1##*/}"])
- 
--# func_basename file
--func_basename ()
--{
--  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
--}
-+  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
-+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-+    # positional parameters, so assign one to ordinary parameter first.
-+    func_stripname_result=${3}
-+    func_stripname_result=${func_stripname_result#"${1}"}
-+    func_stripname_result=${func_stripname_result%"${2}"}])
- 
--dnl func_dirname_and_basename
--dnl A portable version of this function is already defined in general.m4sh
--dnl so there is no need for it here.
-+  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
-+    func_split_long_opt_name=${1%%=*}
-+    func_split_long_opt_arg=${1#*=}])
- 
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--# func_strip_suffix prefix name
--func_stripname ()
--{
--  case ${2} in
--    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
--    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
--  esac
--}
-+  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
-+    func_split_short_opt_arg=${1#??}
-+    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
- 
--# sed scripts:
--my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
--my_sed_long_arg='1s/^-[[^=]]*=//'
-+  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
-+    case ${1} in
-+      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-+      *)    func_lo2o_result=${1} ;;
-+    esac])
- 
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
--  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
--}
-+  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
- 
--# func_lo2o object
--func_lo2o ()
--{
--  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
--}
-+  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
- 
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
--}
-+  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
-+fi
- 
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=`expr "$[@]"`
--}
-+if test x"$lt_shell_append" = xyes; then
-+  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
- 
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
--}
-+  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
-+    func_quote_for_eval "${2}"
-+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
-+    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
- 
--_LT_EOF
--esac
-+  # Save a `func_append' function call where possible by direct use of '+='
-+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+else
-+  # Save a `func_append' function call even when '+=' is not available
-+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+fi
- 
--case $lt_shell_append in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
-+if test x"$_lt_function_replace_fail" = x":"; then
-+  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-+fi
-+])
- 
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$[1]+=\$[2]"
--}
--_LT_EOF
-+# _LT_PATH_CONVERSION_FUNCTIONS
-+# -----------------------------
-+# Determine which file name conversion functions should be used by
-+# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
-+# for certain cross-compile configurations and native mingw.
-+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
-+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-+AC_MSG_CHECKING([how to convert $build file names to $host format])
-+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
-+[case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-+        ;;
-+    esac
-     ;;
--  *)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$[1]=\$$[1]\$[2]"
--}
--
--_LT_EOF
-+  *-*-cygwin* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_noop
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-+        ;;
-+    esac
-     ;;
--  esac
-+  * ) # unhandled hosts (and "normal" native builds)
-+    lt_cv_to_host_file_cmd=func_convert_file_noop
-+    ;;
-+esac
-+])
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
-+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
-+         [0], [convert $build file names to $host format])dnl
-+
-+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
-+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
-+[#assume ordinary cross tools, or native build.
-+lt_cv_to_tool_file_cmd=func_convert_file_noop
-+case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+    esac
-+    ;;
-+esac
- ])
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
-+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
-+         [0], [convert $build files to toolchain format])dnl
-+])# _LT_PATH_CONVERSION_FUNCTIONS
-diff --git a/ltmain.sh b/ltmain.sh
-index 9503ec8..70e856e 100644
---- a/ltmain.sh
-+++ b/ltmain.sh
-@@ -1,10 +1,9 @@
--# Generated from ltmain.m4sh.
- 
--# libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
-+# libtool (GNU libtool) 2.4
- # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
- 
- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
--# 2007, 2008, 2009 Free Software Foundation, Inc.
-+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
- # This is free software; see the source for copying conditions.  There is NO
- # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- 
-@@ -38,7 +37,6 @@
- #   -n, --dry-run            display commands without modifying any files
- #       --features           display basic configuration information and exit
- #       --mode=MODE          use operation mode MODE
--#       --no-finish          let install mode avoid finish commands
- #       --preserve-dup-deps  don't remove duplicate dependency libraries
- #       --quiet, --silent    don't print informational messages
- #       --no-quiet, --no-silent
-@@ -71,17 +69,19 @@
- #         compiler:		$LTCC
- #         compiler flags:		$LTCFLAGS
- #         linker:		$LD (gnu? $with_gnu_ld)
--#         $progname:	(GNU libtool 1.3134 2009-11-29) 2.2.7a
-+#         $progname:	(GNU libtool) 2.4
- #         automake:	$automake_version
- #         autoconf:	$autoconf_version
- #
- # Report bugs to <bug-libtool@gnu.org>.
-+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-+# General help using GNU software: <http://www.gnu.org/gethelp/>.
- 
- PROGRAM=libtool
- PACKAGE=libtool
--VERSION=2.2.7a
--TIMESTAMP=" 1.3134 2009-11-29"
--package_revision=1.3134
-+VERSION=2.4
-+TIMESTAMP=""
-+package_revision=1.3293
- 
- # Be Bourne compatible
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-@@ -106,9 +106,6 @@ _LTECHO_EOF'
- }
- 
- # NLS nuisances: We save the old values to restore during execute mode.
--# Only set LANG and LC_ALL to C if already set.
--# These must not be set unconditionally because not all systems understand
--# e.g. LANG=C (notably SCO).
- lt_user_locale=
- lt_safe_locale=
- for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-@@ -121,15 +118,13 @@ do
- 	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
- 	fi"
- done
-+LC_ALL=C
-+LANGUAGE=C
-+export LANGUAGE LC_ALL
- 
- $lt_unset CDPATH
- 
- 
--
--
--
--
--
- # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
- # is ksh but when the shell is invoked as "sh" and the current value of
- # the _XPG environment variable is not equal to 1 (one), the special
-@@ -140,7 +135,7 @@ progpath="$0"
- 
- 
- : ${CP="cp -f"}
--: ${ECHO=$as_echo}
-+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
- : ${EGREP="/bin/grep -E"}
- : ${FGREP="/bin/grep -F"}
- : ${GREP="/bin/grep"}
-@@ -149,7 +144,7 @@ progpath="$0"
- : ${MKDIR="mkdir"}
- : ${MV="mv -f"}
- : ${RM="rm -f"}
--: ${SED="/mount/endor/wildenhu/local-x86_64/bin/sed"}
-+: ${SED="/bin/sed"}
- : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
- : ${Xsed="$SED -e 1s/^X//"}
- 
-@@ -169,6 +164,27 @@ IFS=" 	$lt_nl"
- dirname="s,/[^/]*$,,"
- basename="s,^.*/,,"
- 
-+# func_dirname file append nondir_replacement
-+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-+# otherwise set result to NONDIR_REPLACEMENT.
-+func_dirname ()
-+{
-+    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
-+    if test "X$func_dirname_result" = "X${1}"; then
-+      func_dirname_result="${3}"
-+    else
-+      func_dirname_result="$func_dirname_result${2}"
-+    fi
-+} # func_dirname may be replaced by extended shell implementation
-+
-+
-+# func_basename file
-+func_basename ()
-+{
-+    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-+} # func_basename may be replaced by extended shell implementation
-+
-+
- # func_dirname_and_basename file append nondir_replacement
- # perform func_basename and func_dirname in a single function
- # call:
-@@ -183,17 +199,31 @@ basename="s,^.*/,,"
- # those functions but instead duplicate the functionality here.
- func_dirname_and_basename ()
- {
--  # Extract subdirectory from the argument.
--  func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
--  if test "X$func_dirname_result" = "X${1}"; then
--    func_dirname_result="${3}"
--  else
--    func_dirname_result="$func_dirname_result${2}"
--  fi
--  func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
--}
-+    # Extract subdirectory from the argument.
-+    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
-+    if test "X$func_dirname_result" = "X${1}"; then
-+      func_dirname_result="${3}"
-+    else
-+      func_dirname_result="$func_dirname_result${2}"
-+    fi
-+    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-+} # func_dirname_and_basename may be replaced by extended shell implementation
-+
-+
-+# func_stripname prefix suffix name
-+# strip PREFIX and SUFFIX off of NAME.
-+# PREFIX and SUFFIX must not contain globbing or regex special
-+# characters, hashes, percent signs, but SUFFIX may contain a leading
-+# dot (in which case that matches only a dot).
-+# func_strip_suffix prefix name
-+func_stripname ()
-+{
-+    case ${2} in
-+      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-+      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-+    esac
-+} # func_stripname may be replaced by extended shell implementation
- 
--# Generated shell functions inserted here.
- 
- # These SED scripts presuppose an absolute path with a trailing slash.
- pathcar='s,^/\([^/]*\).*$,\1,'
-@@ -376,6 +406,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
- # Same as above, but do not quote variable references.
- double_quote_subst='s/\(["`\\]\)/\\\1/g'
- 
-+# Sed substitution that turns a string into a regex matching for the
-+# string literally.
-+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
-+
-+# Sed substitution that converts a w32 file name or path
-+# which contains forward slashes, into one that contains
-+# (escaped) backslashes.  A very naive implementation.
-+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-+
- # Re-`\' parameter expansions in output of double_quote_subst that were
- # `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
- # in input to double_quote_subst, that '$' was protected from expansion.
-@@ -404,7 +443,7 @@ opt_warning=:
- # name if it has been set yet.
- func_echo ()
- {
--    $ECHO "$progname${mode+: }$mode: $*"
-+    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
- }
- 
- # func_verbose arg...
-@@ -430,14 +469,14 @@ func_echo_all ()
- # Echo program name prefixed message to standard error.
- func_error ()
- {
--    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
-+    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
- }
- 
- # func_warning arg...
- # Echo program name prefixed warning message to standard error.
- func_warning ()
- {
--    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
-+    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
- 
-     # bash bug again:
-     :
-@@ -656,19 +695,35 @@ func_show_eval_locale ()
-     fi
- }
- 
--
--
-+# func_tr_sh
-+# Turn $1 into a string suitable for a shell variable name.
-+# Result is stored in $func_tr_sh_result.  All characters
-+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-+# if $1 begins with a digit, a '_' is prepended as well.
-+func_tr_sh ()
-+{
-+  case $1 in
-+  [0-9]* | *[!a-zA-Z0-9_]*)
-+    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
-+    ;;
-+  * )
-+    func_tr_sh_result=$1
-+    ;;
-+  esac
-+}
- 
- 
- # func_version
- # Echo version message to standard output and exit.
- func_version ()
- {
-+    $opt_debug
-+
-     $SED -n '/(C)/!b go
- 	:more
- 	/\./!{
- 	  N
--	  s/\n# //
-+	  s/\n# / /
- 	  b more
- 	}
- 	:go
-@@ -685,7 +740,9 @@ func_version ()
- # Echo short help message to standard output and exit.
- func_usage ()
- {
--    $SED -n '/^# Usage:/,/^#  *-h/ {
-+    $opt_debug
-+
-+    $SED -n '/^# Usage:/,/^#  *.*--help/ {
-         s/^# //
- 	s/^# *$//
- 	s/\$progname/'$progname'/
-@@ -701,7 +758,10 @@ func_usage ()
- # unless 'noexit' is passed as argument.
- func_help ()
- {
-+    $opt_debug
-+
-     $SED -n '/^# Usage:/,/# Report bugs to/ {
-+	:print
-         s/^# //
- 	s/^# *$//
- 	s*\$progname*'$progname'*
-@@ -714,7 +774,11 @@ func_help ()
- 	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
- 	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
- 	p
--     }' < "$progpath"
-+	d
-+     }
-+     /^# .* home page:/b print
-+     /^# General help using/b print
-+     ' < "$progpath"
-     ret=$?
-     if test -z "$1"; then
-       exit $ret
-@@ -726,12 +790,39 @@ func_help ()
- # exit_cmd.
- func_missing_arg ()
- {
--    func_error "missing argument for $1"
-+    $opt_debug
-+
-+    func_error "missing argument for $1."
-     exit_cmd=exit
- }
- 
--exit_cmd=:
- 
-+# func_split_short_opt shortopt
-+# Set func_split_short_opt_name and func_split_short_opt_arg shell
-+# variables after splitting SHORTOPT after the 2nd character.
-+func_split_short_opt ()
-+{
-+    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
-+    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
-+
-+    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
-+    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-+} # func_split_short_opt may be replaced by extended shell implementation
-+
-+
-+# func_split_long_opt longopt
-+# Set func_split_long_opt_name and func_split_long_opt_arg shell
-+# variables after splitting LONGOPT at the `=' sign.
-+func_split_long_opt ()
-+{
-+    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
-+    my_sed_long_arg='1s/^--[^=]*=//'
-+
-+    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
-+    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-+} # func_split_long_opt may be replaced by extended shell implementation
-+
-+exit_cmd=:
- 
- 
- 
-@@ -741,26 +832,64 @@ magic="%%%MAGIC variable%%%"
- magic_exe="%%%MAGIC EXE variable%%%"
- 
- # Global variables.
--# $mode is unset
- nonopt=
--execute_dlfiles=
- preserve_args=
- lo2o="s/\\.lo\$/.${objext}/"
- o2lo="s/\\.${objext}\$/.lo/"
- extracted_archives=
- extracted_serial=0
- 
--opt_dry_run=false
--opt_finish=:
--opt_duplicate_deps=false
--opt_silent=false
--opt_debug=:
--
- # If this variable is set in any of the actions, the command in it
- # will be execed at the end.  This prevents here-documents from being
- # left over by shells.
- exec_cmd=
- 
-+# func_append var value
-+# Append VALUE to the end of shell variable VAR.
-+func_append ()
-+{
-+    eval "${1}=\$${1}\${2}"
-+} # func_append may be replaced by extended shell implementation
-+
-+# func_append_quoted var value
-+# Quote VALUE and append to the end of shell variable VAR, separated
-+# by a space.
-+func_append_quoted ()
-+{
-+    func_quote_for_eval "${2}"
-+    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-+} # func_append_quoted may be replaced by extended shell implementation
-+
-+
-+# func_arith arithmetic-term...
-+func_arith ()
-+{
-+    func_arith_result=`expr "${@}"`
-+} # func_arith may be replaced by extended shell implementation
-+
-+
-+# func_len string
-+# STRING may not start with a hyphen.
-+func_len ()
-+{
-+    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-+} # func_len may be replaced by extended shell implementation
-+
-+
-+# func_lo2o object
-+func_lo2o ()
-+{
-+    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-+} # func_lo2o may be replaced by extended shell implementation
-+
-+
-+# func_xform libobj-or-source
-+func_xform ()
-+{
-+    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-+} # func_xform may be replaced by extended shell implementation
-+
-+
- # func_fatal_configuration arg...
- # Echo program name prefixed message to standard error, followed by
- # a configuration failure hint, and exit.
-@@ -850,130 +979,204 @@ func_enable_tag ()
-   esac
- }
- 
--# Parse options once, thoroughly.  This comes as soon as possible in
--# the script to make things like `libtool --version' happen quickly.
-+# func_check_version_match
-+# Ensure that we are using m4 macros, and libtool script from the same
-+# release of libtool.
-+func_check_version_match ()
- {
-+  if test "$package_revision" != "$macro_revision"; then
-+    if test "$VERSION" != "$macro_version"; then
-+      if test -z "$macro_version"; then
-+        cat >&2 <<_LT_EOF
-+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-+$progname: definition of this LT_INIT comes from an older release.
-+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-+$progname: and run autoconf again.
-+_LT_EOF
-+      else
-+        cat >&2 <<_LT_EOF
-+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-+$progname: and run autoconf again.
-+_LT_EOF
-+      fi
-+    else
-+      cat >&2 <<_LT_EOF
-+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
-+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-+$progname: of $PACKAGE $VERSION and run autoconf again.
-+_LT_EOF
-+    fi
- 
--  # Shorthand for --mode=foo, only valid as the first argument
--  case $1 in
--  clean|clea|cle|cl)
--    shift; set dummy --mode clean ${1+"$@"}; shift
--    ;;
--  compile|compil|compi|comp|com|co|c)
--    shift; set dummy --mode compile ${1+"$@"}; shift
--    ;;
--  execute|execut|execu|exec|exe|ex|e)
--    shift; set dummy --mode execute ${1+"$@"}; shift
--    ;;
--  finish|finis|fini|fin|fi|f)
--    shift; set dummy --mode finish ${1+"$@"}; shift
--    ;;
--  install|instal|insta|inst|ins|in|i)
--    shift; set dummy --mode install ${1+"$@"}; shift
--    ;;
--  link|lin|li|l)
--    shift; set dummy --mode link ${1+"$@"}; shift
--    ;;
--  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
--    shift; set dummy --mode uninstall ${1+"$@"}; shift
--    ;;
--  esac
-+    exit $EXIT_MISMATCH
-+  fi
-+}
-+
-+
-+# Shorthand for --mode=foo, only valid as the first argument
-+case $1 in
-+clean|clea|cle|cl)
-+  shift; set dummy --mode clean ${1+"$@"}; shift
-+  ;;
-+compile|compil|compi|comp|com|co|c)
-+  shift; set dummy --mode compile ${1+"$@"}; shift
-+  ;;
-+execute|execut|execu|exec|exe|ex|e)
-+  shift; set dummy --mode execute ${1+"$@"}; shift
-+  ;;
-+finish|finis|fini|fin|fi|f)
-+  shift; set dummy --mode finish ${1+"$@"}; shift
-+  ;;
-+install|instal|insta|inst|ins|in|i)
-+  shift; set dummy --mode install ${1+"$@"}; shift
-+  ;;
-+link|lin|li|l)
-+  shift; set dummy --mode link ${1+"$@"}; shift
-+  ;;
-+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-+  shift; set dummy --mode uninstall ${1+"$@"}; shift
-+  ;;
-+esac
- 
--  # Parse non-mode specific arguments:
--  while test "$#" -gt 0; do
-+
-+
-+# Option defaults:
-+opt_debug=:
-+opt_dry_run=false
-+opt_config=false
-+opt_preserve_dup_deps=false
-+opt_features=false
-+opt_finish=false
-+opt_help=false
-+opt_help_all=false
-+opt_silent=:
-+opt_verbose=:
-+opt_silent=false
-+opt_verbose=false
-+
-+
-+# Parse options once, thoroughly.  This comes as soon as possible in the
-+# script to make things like `--version' happen as quickly as we can.
-+{
-+  # this just eases exit handling
-+  while test $# -gt 0; do
-     opt="$1"
-     shift
--
-     case $opt in
--      --config)		func_config					;;
--
--      --debug)		preserve_args="$preserve_args $opt"
-+      --debug|-x)	opt_debug='set -x'
- 			func_echo "enabling shell trace mode"
--			opt_debug='set -x'
- 			$opt_debug
- 			;;
--
--      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
--			execute_dlfiles="$execute_dlfiles $1"
--			shift
-+      --dry-run|--dryrun|-n)
-+			opt_dry_run=:
- 			;;
--
--      --dry-run | -n)	opt_dry_run=:					;;
--      --features)       func_features					;;
--      --finish)		mode="finish"					;;
--      --no-finish)	opt_finish=false				;;
--
--      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
--			case $1 in
--			  # Valid mode arguments:
--			  clean)	;;
--			  compile)	;;
--			  execute)	;;
--			  finish)	;;
--			  install)	;;
--			  link)		;;
--			  relink)	;;
--			  uninstall)	;;
--
--			  # Catch anything else as an error
--			  *) func_error "invalid argument for $opt"
--			     exit_cmd=exit
--			     break
--			     ;;
--		        esac
--
--			mode="$1"
-+      --config)
-+			opt_config=:
-+func_config
-+			;;
-+      --dlopen|-dlopen)
-+			optarg="$1"
-+			opt_dlopen="${opt_dlopen+$opt_dlopen
-+}$optarg"
- 			shift
- 			;;
--
-       --preserve-dup-deps)
--			opt_duplicate_deps=:				;;
--
--      --quiet|--silent)	preserve_args="$preserve_args $opt"
--			opt_silent=:
--			opt_verbose=false
-+			opt_preserve_dup_deps=:
- 			;;
--
--      --no-quiet|--no-silent)
--			preserve_args="$preserve_args $opt"
--			opt_silent=false
-+      --features)
-+			opt_features=:
-+func_features
- 			;;
--
--      --verbose| -v)	preserve_args="$preserve_args $opt"
-+      --finish)
-+			opt_finish=:
-+set dummy --mode finish ${1+"$@"}; shift
-+			;;
-+      --help)
-+			opt_help=:
-+			;;
-+      --help-all)
-+			opt_help_all=:
-+opt_help=': help-all'
-+			;;
-+      --mode)
-+			test $# = 0 && func_missing_arg $opt && break
-+			optarg="$1"
-+			opt_mode="$optarg"
-+case $optarg in
-+  # Valid mode arguments:
-+  clean|compile|execute|finish|install|link|relink|uninstall) ;;
-+
-+  # Catch anything else as an error
-+  *) func_error "invalid argument for $opt"
-+     exit_cmd=exit
-+     break
-+     ;;
-+esac
-+			shift
-+			;;
-+      --no-silent|--no-quiet)
- 			opt_silent=false
--			opt_verbose=:
-+func_append preserve_args " $opt"
- 			;;
--
--      --no-verbose)	preserve_args="$preserve_args $opt"
-+      --no-verbose)
- 			opt_verbose=false
-+func_append preserve_args " $opt"
- 			;;
--
--      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
--			preserve_args="$preserve_args $opt $1"
--			func_enable_tag "$1"	# tagname is set here
-+      --silent|--quiet)
-+			opt_silent=:
-+func_append preserve_args " $opt"
-+        opt_verbose=false
-+			;;
-+      --verbose|-v)
-+			opt_verbose=:
-+func_append preserve_args " $opt"
-+opt_silent=false
-+			;;
-+      --tag)
-+			test $# = 0 && func_missing_arg $opt && break
-+			optarg="$1"
-+			opt_tag="$optarg"
-+func_append preserve_args " $opt $optarg"
-+func_enable_tag "$optarg"
- 			shift
- 			;;
- 
-+      -\?|-h)		func_usage				;;
-+      --help)		func_help				;;
-+      --version)	func_version				;;
-+
-       # Separate optargs to long options:
--      -dlopen=*|--mode=*|--tag=*)
--			func_opt_split "$opt"
--			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
-+      --*=*)
-+			func_split_long_opt "$opt"
-+			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
- 			shift
- 			;;
- 
--      -\?|-h)		func_usage					;;
--      --help)		opt_help=:					;;
--      --help-all)	opt_help=': help-all'				;;
--      --version)	func_version					;;
--
--      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
--
--      *)		nonopt="$opt"
--			break
-+      # Separate non-argument short options:
-+      -\?*|-h*|-n*|-v*)
-+			func_split_short_opt "$opt"
-+			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
-+			shift
- 			;;
-+
-+      --)		break					;;
-+      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
-+      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
-     esac
-   done
- 
-+  # Validate options:
-+
-+  # save first non-option argument
-+  if test "$#" -gt 0; then
-+    nonopt="$opt"
-+    shift
-+  fi
-+
-+  # preserve --debug
-+  test "$opt_debug" = : || func_append preserve_args " --debug"
- 
-   case $host in
-     *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* )
-@@ -981,82 +1184,44 @@ func_enable_tag ()
-       opt_duplicate_compiler_generated_deps=:
-       ;;
-     *)
--      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
-+      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-       ;;
-   esac
- 
--  # Having warned about all mis-specified options, bail out if
--  # anything was wrong.
--  $exit_cmd $EXIT_FAILURE
--}
-+  $opt_help || {
-+    # Sanity checks first:
-+    func_check_version_match
- 
--# func_check_version_match
--# Ensure that we are using m4 macros, and libtool script from the same
--# release of libtool.
--func_check_version_match ()
--{
--  if test "$package_revision" != "$macro_revision"; then
--    if test "$VERSION" != "$macro_version"; then
--      if test -z "$macro_version"; then
--        cat >&2 <<_LT_EOF
--$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
--$progname: definition of this LT_INIT comes from an older release.
--$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
--$progname: and run autoconf again.
--_LT_EOF
--      else
--        cat >&2 <<_LT_EOF
--$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
--$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
--$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
--$progname: and run autoconf again.
--_LT_EOF
--      fi
--    else
--      cat >&2 <<_LT_EOF
--$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
--$progname: but the definition of this LT_INIT comes from revision $macro_revision.
--$progname: You should recreate aclocal.m4 with macros from revision $package_revision
--$progname: of $PACKAGE $VERSION and run autoconf again.
--_LT_EOF
-+    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-+      func_fatal_configuration "not configured to build any kind of library"
-     fi
- 
--    exit $EXIT_MISMATCH
--  fi
--}
--
-+    # Darwin sucks
-+    eval std_shrext=\"$shrext_cmds\"
- 
--## ----------- ##
--##    Main.    ##
--## ----------- ##
--
--$opt_help || {
--  # Sanity checks first:
--  func_check_version_match
--
--  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
--    func_fatal_configuration "not configured to build any kind of library"
--  fi
-+    # Only execute mode is allowed to have -dlopen flags.
-+    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
-+      func_error "unrecognized option \`-dlopen'"
-+      $ECHO "$help" 1>&2
-+      exit $EXIT_FAILURE
-+    fi
- 
--  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
-+    # Change the help message to a mode-specific one.
-+    generic_help="$help"
-+    help="Try \`$progname --help --mode=$opt_mode' for more information."
-+  }
- 
- 
--  # Darwin sucks
--  eval "std_shrext=\"$shrext_cmds\""
-+  # Bail if the options were screwed
-+  $exit_cmd $EXIT_FAILURE
-+}
- 
- 
--  # Only execute mode is allowed to have -dlopen flags.
--  if test -n "$execute_dlfiles" && test "$mode" != execute; then
--    func_error "unrecognized option \`-dlopen'"
--    $ECHO "$help" 1>&2
--    exit $EXIT_FAILURE
--  fi
- 
--  # Change the help message to a mode-specific one.
--  generic_help="$help"
--  help="Try \`$progname --help --mode=$mode' for more information."
--}
- 
-+## ----------- ##
-+##    Main.    ##
-+## ----------- ##
- 
- # func_lalib_p file
- # True iff FILE is a libtool `.la' library or `.lo' object file.
-@@ -1121,12 +1286,9 @@ func_ltwrapper_executable_p ()
- # temporary ltwrapper_script.
- func_ltwrapper_scriptname ()
- {
--    func_ltwrapper_scriptname_result=""
--    if func_ltwrapper_executable_p "$1"; then
--	func_dirname_and_basename "$1" "" "."
--	func_stripname '' '.exe' "$func_basename_result"
--	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
--    fi
-+    func_dirname_and_basename "$1" "" "."
-+    func_stripname '' '.exe' "$func_basename_result"
-+    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
- }
- 
- # func_ltwrapper_p file
-@@ -1149,7 +1311,7 @@ func_execute_cmds ()
-     save_ifs=$IFS; IFS='~'
-     for cmd in $1; do
-       IFS=$save_ifs
--      eval "cmd=\"$cmd\""
-+      eval cmd=\"$cmd\"
-       func_show_eval "$cmd" "${2-:}"
-     done
-     IFS=$save_ifs
-@@ -1172,6 +1334,37 @@ func_source ()
- }
- 
- 
-+# func_resolve_sysroot PATH
-+# Replace a leading = in PATH with a sysroot.  Store the result into
-+# func_resolve_sysroot_result
-+func_resolve_sysroot ()
-+{
-+  func_resolve_sysroot_result=$1
-+  case $func_resolve_sysroot_result in
-+  =*)
-+    func_stripname '=' '' "$func_resolve_sysroot_result"
-+    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
-+    ;;
-+  esac
-+}
-+
-+# func_replace_sysroot PATH
-+# If PATH begins with the sysroot, replace it with = and
-+# store the result into func_replace_sysroot_result.
-+func_replace_sysroot ()
-+{
-+  case "$lt_sysroot:$1" in
-+  ?*:"$lt_sysroot"*)
-+    func_stripname "$lt_sysroot" '' "$1"
-+    func_replace_sysroot_result="=$func_stripname_result"
-+    ;;
-+  *)
-+    # Including no sysroot.
-+    func_replace_sysroot_result=$1
-+    ;;
-+  esac
-+}
-+
- # func_infer_tag arg
- # Infer tagged configuration to use if any are available and
- # if one wasn't chosen via the "--tag" command line option.
-@@ -1184,8 +1377,7 @@ func_infer_tag ()
-     if test -n "$available_tags" && test -z "$tagname"; then
-       CC_quoted=
-       for arg in $CC; do
--        func_quote_for_eval "$arg"
--	CC_quoted="$CC_quoted $func_quote_for_eval_result"
-+	func_append_quoted CC_quoted "$arg"
-       done
-       CC_expanded=`func_echo_all $CC`
-       CC_quoted_expanded=`func_echo_all $CC_quoted`
-@@ -1204,8 +1396,7 @@ func_infer_tag ()
- 	    CC_quoted=
- 	    for arg in $CC; do
- 	      # Double-quote args containing other shell metacharacters.
--	      func_quote_for_eval "$arg"
--	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
-+	      func_append_quoted CC_quoted "$arg"
- 	    done
- 	    CC_expanded=`func_echo_all $CC`
- 	    CC_quoted_expanded=`func_echo_all $CC_quoted`
-@@ -1274,6 +1465,486 @@ EOF
-     }
- }
- 
-+
-+##################################################
-+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-+##################################################
-+
-+# func_convert_core_file_wine_to_w32 ARG
-+# Helper function used by file name conversion functions when $build is *nix,
-+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-+# correctly configured wine environment available, with the winepath program
-+# in $build's $PATH.
-+#
-+# ARG is the $build file name to be converted to w32 format.
-+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-+# be empty on error (or when ARG is empty)
-+func_convert_core_file_wine_to_w32 ()
-+{
-+  $opt_debug
-+  func_convert_core_file_wine_to_w32_result="$1"
-+  if test -n "$1"; then
-+    # Unfortunately, winepath does not exit with a non-zero error code, so we
-+    # are forced to check the contents of stdout. On the other hand, if the
-+    # command is not found, the shell will set an exit code of 127 and print
-+    # *an error message* to stdout. So we must check for both error code of
-+    # zero AND non-empty stdout, which explains the odd construction:
-+    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-+    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
-+      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-+        $SED -e "$lt_sed_naive_backslashify"`
-+    else
-+      func_convert_core_file_wine_to_w32_result=
-+    fi
-+  fi
-+}
-+# end: func_convert_core_file_wine_to_w32
-+
-+
-+# func_convert_core_path_wine_to_w32 ARG
-+# Helper function used by path conversion functions when $build is *nix, and
-+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-+# configured wine environment available, with the winepath program in $build's
-+# $PATH. Assumes ARG has no leading or trailing path separator characters.
-+#
-+# ARG is path to be converted from $build format to win32.
-+# Result is available in $func_convert_core_path_wine_to_w32_result.
-+# Unconvertible file (directory) names in ARG are skipped; if no directory names
-+# are convertible, then the result may be empty.
-+func_convert_core_path_wine_to_w32 ()
-+{
-+  $opt_debug
-+  # unfortunately, winepath doesn't convert paths, only file names
-+  func_convert_core_path_wine_to_w32_result=""
-+  if test -n "$1"; then
-+    oldIFS=$IFS
-+    IFS=:
-+    for func_convert_core_path_wine_to_w32_f in $1; do
-+      IFS=$oldIFS
-+      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-+      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
-+        if test -z "$func_convert_core_path_wine_to_w32_result"; then
-+          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
-+        else
-+          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
-+        fi
-+      fi
-+    done
-+    IFS=$oldIFS
-+  fi
-+}
-+# end: func_convert_core_path_wine_to_w32
-+
-+
-+# func_cygpath ARGS...
-+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-+# (2), returns the Cygwin file name or path in func_cygpath_result (input
-+# file name or path is assumed to be in w32 format, as previously converted
-+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-+# or path in func_cygpath_result (input file name or path is assumed to be in
-+# Cygwin format). Returns an empty string on error.
-+#
-+# ARGS are passed to cygpath, with the last one being the file name or path to
-+# be converted.
-+#
-+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-+# environment variable; do not put it in $PATH.
-+func_cygpath ()
-+{
-+  $opt_debug
-+  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
-+    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
-+    if test "$?" -ne 0; then
-+      # on failure, ensure result is empty
-+      func_cygpath_result=
-+    fi
-+  else
-+    func_cygpath_result=
-+    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
-+  fi
-+}
-+#end: func_cygpath
-+
-+
-+# func_convert_core_msys_to_w32 ARG
-+# Convert file name or path ARG from MSYS format to w32 format.  Return
-+# result in func_convert_core_msys_to_w32_result.
-+func_convert_core_msys_to_w32 ()
-+{
-+  $opt_debug
-+  # awkward: cmd appends spaces to result
-+  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-+    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
-+}
-+#end: func_convert_core_msys_to_w32
-+
-+
-+# func_convert_file_check ARG1 ARG2
-+# Verify that ARG1 (a file name in $build format) was converted to $host
-+# format in ARG2. Otherwise, emit an error message, but continue (resetting
-+# func_to_host_file_result to ARG1).
-+func_convert_file_check ()
-+{
-+  $opt_debug
-+  if test -z "$2" && test -n "$1" ; then
-+    func_error "Could not determine host file name corresponding to"
-+    func_error "  \`$1'"
-+    func_error "Continuing, but uninstalled executables may not work."
-+    # Fallback:
-+    func_to_host_file_result="$1"
-+  fi
-+}
-+# end func_convert_file_check
-+
-+
-+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-+# Verify that FROM_PATH (a path in $build format) was converted to $host
-+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-+# func_to_host_file_result to a simplistic fallback value (see below).
-+func_convert_path_check ()
-+{
-+  $opt_debug
-+  if test -z "$4" && test -n "$3"; then
-+    func_error "Could not determine the host path corresponding to"
-+    func_error "  \`$3'"
-+    func_error "Continuing, but uninstalled executables may not work."
-+    # Fallback.  This is a deliberately simplistic "conversion" and
-+    # should not be "improved".  See libtool.info.
-+    if test "x$1" != "x$2"; then
-+      lt_replace_pathsep_chars="s|$1|$2|g"
-+      func_to_host_path_result=`echo "$3" |
-+        $SED -e "$lt_replace_pathsep_chars"`
-+    else
-+      func_to_host_path_result="$3"
-+    fi
-+  fi
-+}
-+# end func_convert_path_check
-+
-+
-+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-+# and appending REPL if ORIG matches BACKPAT.
-+func_convert_path_front_back_pathsep ()
-+{
-+  $opt_debug
-+  case $4 in
-+  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
-+    ;;
-+  esac
-+  case $4 in
-+  $2 ) func_append func_to_host_path_result "$3"
-+    ;;
-+  esac
-+}
-+# end func_convert_path_front_back_pathsep
-+
-+
-+##################################################
-+# $build to $host FILE NAME CONVERSION FUNCTIONS #
-+##################################################
-+# invoked via `$to_host_file_cmd ARG'
-+#
-+# In each case, ARG is the path to be converted from $build to $host format.
-+# Result will be available in $func_to_host_file_result.
-+
-+
-+# func_to_host_file ARG
-+# Converts the file name ARG from $build format to $host format. Return result
-+# in func_to_host_file_result.
-+func_to_host_file ()
-+{
-+  $opt_debug
-+  $to_host_file_cmd "$1"
-+}
-+# end func_to_host_file
-+
-+
-+# func_to_tool_file ARG LAZY
-+# converts the file name ARG from $build format to toolchain format. Return
-+# result in func_to_tool_file_result.  If the conversion in use is listed
-+# in (the comma separated) LAZY, no conversion takes place.
-+func_to_tool_file ()
-+{
-+  $opt_debug
-+  case ,$2, in
-+    *,"$to_tool_file_cmd",*)
-+      func_to_tool_file_result=$1
-+      ;;
-+    *)
-+      $to_tool_file_cmd "$1"
-+      func_to_tool_file_result=$func_to_host_file_result
-+      ;;
-+  esac
-+}
-+# end func_to_tool_file
-+
-+
-+# func_convert_file_noop ARG
-+# Copy ARG to func_to_host_file_result.
-+func_convert_file_noop ()
-+{
-+  func_to_host_file_result="$1"
-+}
-+# end func_convert_file_noop
-+
-+
-+# func_convert_file_msys_to_w32 ARG
-+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-+# conversion to w32 is not available inside the cwrapper.  Returns result in
-+# func_to_host_file_result.
-+func_convert_file_msys_to_w32 ()
-+{
-+  $opt_debug
-+  func_to_host_file_result="$1"
-+  if test -n "$1"; then
-+    func_convert_core_msys_to_w32 "$1"
-+    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
-+  fi
-+  func_convert_file_check "$1" "$func_to_host_file_result"
-+}
-+# end func_convert_file_msys_to_w32
-+
-+
-+# func_convert_file_cygwin_to_w32 ARG
-+# Convert file name ARG from Cygwin to w32 format.  Returns result in
-+# func_to_host_file_result.
-+func_convert_file_cygwin_to_w32 ()
-+{
-+  $opt_debug
-+  func_to_host_file_result="$1"
-+  if test -n "$1"; then
-+    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
-+    # LT_CYGPATH in this case.
-+    func_to_host_file_result=`cygpath -m "$1"`
-+  fi
-+  func_convert_file_check "$1" "$func_to_host_file_result"
-+}
-+# end func_convert_file_cygwin_to_w32
-+
-+
-+# func_convert_file_nix_to_w32 ARG
-+# Convert file name ARG from *nix to w32 format.  Requires a wine environment
-+# and a working winepath. Returns result in func_to_host_file_result.
-+func_convert_file_nix_to_w32 ()
-+{
-+  $opt_debug
-+  func_to_host_file_result="$1"
-+  if test -n "$1"; then
-+    func_convert_core_file_wine_to_w32 "$1"
-+    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
-+  fi
-+  func_convert_file_check "$1" "$func_to_host_file_result"
-+}
-+# end func_convert_file_nix_to_w32
-+
-+
-+# func_convert_file_msys_to_cygwin ARG
-+# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-+# Returns result in func_to_host_file_result.
-+func_convert_file_msys_to_cygwin ()
-+{
-+  $opt_debug
-+  func_to_host_file_result="$1"
-+  if test -n "$1"; then
-+    func_convert_core_msys_to_w32 "$1"
-+    func_cygpath -u "$func_convert_core_msys_to_w32_result"
-+    func_to_host_file_result="$func_cygpath_result"
-+  fi
-+  func_convert_file_check "$1" "$func_to_host_file_result"
-+}
-+# end func_convert_file_msys_to_cygwin
-+
-+
-+# func_convert_file_nix_to_cygwin ARG
-+# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
-+# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
-+# in func_to_host_file_result.
-+func_convert_file_nix_to_cygwin ()
-+{
-+  $opt_debug
-+  func_to_host_file_result="$1"
-+  if test -n "$1"; then
-+    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
-+    func_convert_core_file_wine_to_w32 "$1"
-+    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-+    func_to_host_file_result="$func_cygpath_result"
-+  fi
-+  func_convert_file_check "$1" "$func_to_host_file_result"
-+}
-+# end func_convert_file_nix_to_cygwin
-+
-+
-+#############################################
-+# $build to $host PATH CONVERSION FUNCTIONS #
-+#############################################
-+# invoked via `$to_host_path_cmd ARG'
-+#
-+# In each case, ARG is the path to be converted from $build to $host format.
-+# The result will be available in $func_to_host_path_result.
-+#
-+# Path separators are also converted from $build format to $host format.  If
-+# ARG begins or ends with a path separator character, it is preserved (but
-+# converted to $host format) on output.
-+#
-+# All path conversion functions are named using the following convention:
-+#   file name conversion function    : func_convert_file_X_to_Y ()
-+#   path conversion function         : func_convert_path_X_to_Y ()
-+# where, for any given $build/$host combination the 'X_to_Y' value is the
-+# same.  If conversion functions are added for new $build/$host combinations,
-+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-+# will break.
-+
-+
-+# func_init_to_host_path_cmd
-+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-+# appropriate value, based on the value of $to_host_file_cmd.
-+to_host_path_cmd=
-+func_init_to_host_path_cmd ()
-+{
-+  $opt_debug
-+  if test -z "$to_host_path_cmd"; then
-+    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-+    to_host_path_cmd="func_convert_path_${func_stripname_result}"
-+  fi
-+}
-+
-+
-+# func_to_host_path ARG
-+# Converts the path ARG from $build format to $host format. Return result
-+# in func_to_host_path_result.
-+func_to_host_path ()
-+{
-+  $opt_debug
-+  func_init_to_host_path_cmd
-+  $to_host_path_cmd "$1"
-+}
-+# end func_to_host_path
-+
-+
-+# func_convert_path_noop ARG
-+# Copy ARG to func_to_host_path_result.
-+func_convert_path_noop ()
-+{
-+  func_to_host_path_result="$1"
-+}
-+# end func_convert_path_noop
-+
-+
-+# func_convert_path_msys_to_w32 ARG
-+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-+# conversion to w32 is not available inside the cwrapper.  Returns result in
-+# func_to_host_path_result.
-+func_convert_path_msys_to_w32 ()
-+{
-+  $opt_debug
-+  func_to_host_path_result="$1"
-+  if test -n "$1"; then
-+    # Remove leading and trailing path separator characters from ARG.  MSYS
-+    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
-+    # and winepath ignores them completely.
-+    func_stripname : : "$1"
-+    func_to_host_path_tmp1=$func_stripname_result
-+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-+    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
-+    func_convert_path_check : ";" \
-+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-+  fi
-+}
-+# end func_convert_path_msys_to_w32
-+
-+
-+# func_convert_path_cygwin_to_w32 ARG
-+# Convert path ARG from Cygwin to w32 format.  Returns result in
-+# func_to_host_file_result.
-+func_convert_path_cygwin_to_w32 ()
-+{
-+  $opt_debug
-+  func_to_host_path_result="$1"
-+  if test -n "$1"; then
-+    # See func_convert_path_msys_to_w32:
-+    func_stripname : : "$1"
-+    func_to_host_path_tmp1=$func_stripname_result
-+    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
-+    func_convert_path_check : ";" \
-+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-+  fi
-+}
-+# end func_convert_path_cygwin_to_w32
-+
-+
-+# func_convert_path_nix_to_w32 ARG
-+# Convert path ARG from *nix to w32 format.  Requires a wine environment and
-+# a working winepath.  Returns result in func_to_host_file_result.
-+func_convert_path_nix_to_w32 ()
-+{
-+  $opt_debug
-+  func_to_host_path_result="$1"
-+  if test -n "$1"; then
-+    # See func_convert_path_msys_to_w32:
-+    func_stripname : : "$1"
-+    func_to_host_path_tmp1=$func_stripname_result
-+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-+    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
-+    func_convert_path_check : ";" \
-+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-+  fi
-+}
-+# end func_convert_path_nix_to_w32
-+
-+
-+# func_convert_path_msys_to_cygwin ARG
-+# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-+# Returns result in func_to_host_file_result.
-+func_convert_path_msys_to_cygwin ()
-+{
-+  $opt_debug
-+  func_to_host_path_result="$1"
-+  if test -n "$1"; then
-+    # See func_convert_path_msys_to_w32:
-+    func_stripname : : "$1"
-+    func_to_host_path_tmp1=$func_stripname_result
-+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-+    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-+    func_to_host_path_result="$func_cygpath_result"
-+    func_convert_path_check : : \
-+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-+  fi
-+}
-+# end func_convert_path_msys_to_cygwin
-+
-+
-+# func_convert_path_nix_to_cygwin ARG
-+# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
-+# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
-+# func_to_host_file_result.
-+func_convert_path_nix_to_cygwin ()
-+{
-+  $opt_debug
-+  func_to_host_path_result="$1"
-+  if test -n "$1"; then
-+    # Remove leading and trailing path separator characters from
-+    # ARG. msys behavior is inconsistent here, cygpath turns them
-+    # into '.;' and ';.', and winepath ignores them completely.
-+    func_stripname : : "$1"
-+    func_to_host_path_tmp1=$func_stripname_result
-+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-+    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-+    func_to_host_path_result="$func_cygpath_result"
-+    func_convert_path_check : : \
-+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-+  fi
-+}
-+# end func_convert_path_nix_to_cygwin
-+
-+
- # func_mode_compile arg...
- func_mode_compile ()
- {
-@@ -1314,12 +1985,12 @@ func_mode_compile ()
- 	  ;;
- 
- 	-pie | -fpie | -fPIE)
--          pie_flag="$pie_flag $arg"
-+          func_append pie_flag " $arg"
- 	  continue
- 	  ;;
- 
- 	-shared | -static | -prefer-pic | -prefer-non-pic)
--	  later="$later $arg"
-+	  func_append later " $arg"
- 	  continue
- 	  ;;
- 
-@@ -1340,15 +2011,14 @@ func_mode_compile ()
- 	  save_ifs="$IFS"; IFS=','
- 	  for arg in $args; do
- 	    IFS="$save_ifs"
--	    func_quote_for_eval "$arg"
--	    lastarg="$lastarg $func_quote_for_eval_result"
-+	    func_append_quoted lastarg "$arg"
- 	  done
- 	  IFS="$save_ifs"
- 	  func_stripname ' ' '' "$lastarg"
- 	  lastarg=$func_stripname_result
- 
- 	  # Add the arguments to base_compile.
--	  base_compile="$base_compile $lastarg"
-+	  func_append base_compile " $lastarg"
- 	  continue
- 	  ;;
- 
-@@ -1364,8 +2034,7 @@ func_mode_compile ()
-       esac    #  case $arg_mode
- 
-       # Aesthetically quote the previous argument.
--      func_quote_for_eval "$lastarg"
--      base_compile="$base_compile $func_quote_for_eval_result"
-+      func_append_quoted base_compile "$lastarg"
-     done # for arg
- 
-     case $arg_mode in
-@@ -1496,17 +2165,16 @@ compiler."
- 	$opt_dry_run || $RM $removelist
- 	exit $EXIT_FAILURE
-       fi
--      removelist="$removelist $output_obj"
-+      func_append removelist " $output_obj"
-       $ECHO "$srcfile" > "$lockfile"
-     fi
- 
-     $opt_dry_run || $RM $removelist
--    removelist="$removelist $lockfile"
-+    func_append removelist " $lockfile"
-     trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
- 
--    if test -n "$fix_srcfile_path"; then
--      eval "srcfile=\"$fix_srcfile_path\""
--    fi
-+    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
-+    srcfile=$func_to_tool_file_result
-     func_quote_for_eval "$srcfile"
-     qsrcfile=$func_quote_for_eval_result
- 
-@@ -1526,7 +2194,7 @@ compiler."
- 
-       if test -z "$output_obj"; then
- 	# Place PIC objects in $objdir
--	command="$command -o $lobj"
-+	func_append command " -o $lobj"
-       fi
- 
-       func_show_eval_locale "$command"	\
-@@ -1573,11 +2241,11 @@ compiler."
- 	command="$base_compile $qsrcfile $pic_flag"
-       fi
-       if test "$compiler_c_o" = yes; then
--	command="$command -o $obj"
-+	func_append command " -o $obj"
-       fi
- 
-       # Suppress compiler output if we already did a PIC compilation.
--      command="$command$suppress_output"
-+      func_append command "$suppress_output"
-       func_show_eval_locale "$command" \
-         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
- 
-@@ -1622,13 +2290,13 @@ compiler."
- }
- 
- $opt_help || {
--  test "$mode" = compile && func_mode_compile ${1+"$@"}
-+  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
- }
- 
- func_mode_help ()
- {
-     # We need to display help for each of the modes.
--    case $mode in
-+    case $opt_mode in
-       "")
-         # Generic help is extracted from the usage comments
-         # at the start of this file.
-@@ -1659,8 +2327,8 @@ This mode accepts the following additional options:
- 
-   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-   -no-suppress      do not suppress compiler output for multiple passes
--  -prefer-pic       try to building PIC objects only
--  -prefer-non-pic   try to building non-PIC objects only
-+  -prefer-pic       try to build PIC objects only
-+  -prefer-non-pic   try to build non-PIC objects only
-   -shared           do not build a \`.o' file suitable for static linking
-   -static           only build a \`.o' file suitable for static linking
-   -Wc,FLAG          pass FLAG directly to the compiler
-@@ -1804,7 +2472,7 @@ Otherwise, only FILE itself is deleted using RM."
-         ;;
- 
-       *)
--        func_fatal_help "invalid operation mode \`$mode'"
-+        func_fatal_help "invalid operation mode \`$opt_mode'"
-         ;;
-     esac
- 
-@@ -1819,13 +2487,13 @@ if $opt_help; then
-   else
-     {
-       func_help noexit
--      for mode in compile link execute install finish uninstall clean; do
-+      for opt_mode in compile link execute install finish uninstall clean; do
- 	func_mode_help
-       done
-     } | sed -n '1p; 2,$s/^Usage:/  or: /p'
-     {
-       func_help noexit
--      for mode in compile link execute install finish uninstall clean; do
-+      for opt_mode in compile link execute install finish uninstall clean; do
- 	echo
- 	func_mode_help
-       done
-@@ -1854,13 +2522,16 @@ func_mode_execute ()
-       func_fatal_help "you must specify a COMMAND"
- 
-     # Handle -dlopen flags immediately.
--    for file in $execute_dlfiles; do
-+    for file in $opt_dlopen; do
-       test -f "$file" \
- 	|| func_fatal_help "\`$file' is not a file"
- 
-       dir=
-       case $file in
-       *.la)
-+	func_resolve_sysroot "$file"
-+	file=$func_resolve_sysroot_result
-+
- 	# Check to see that this really is a libtool archive.
- 	func_lalib_unsafe_p "$file" \
- 	  || func_fatal_help "\`$lib' is not a valid libtool archive"
-@@ -1882,7 +2553,7 @@ func_mode_execute ()
- 	dir="$func_dirname_result"
- 
- 	if test -f "$dir/$objdir/$dlname"; then
--	  dir="$dir/$objdir"
-+	  func_append dir "/$objdir"
- 	else
- 	  if test ! -f "$dir/$dlname"; then
- 	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
-@@ -1907,10 +2578,10 @@ func_mode_execute ()
-       test -n "$absdir" && dir="$absdir"
- 
-       # Now add the directory to shlibpath_var.
--      if eval test -z \"\$$shlibpath_var\"; then
--	eval $shlibpath_var=\$dir
-+      if eval "test -z \"\$$shlibpath_var\""; then
-+	eval "$shlibpath_var=\"\$dir\""
-       else
--	eval $shlibpath_var=\$dir:\$$shlibpath_var
-+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-       fi
-     done
- 
-@@ -1939,8 +2610,7 @@ func_mode_execute ()
- 	;;
-       esac
-       # Quote arguments (to preserve shell metacharacters).
--      func_quote_for_eval "$file"
--      args="$args $func_quote_for_eval_result"
-+      func_append_quoted args "$file"
-     done
- 
-     if test "X$opt_dry_run" = Xfalse; then
-@@ -1972,22 +2642,59 @@ func_mode_execute ()
-     fi
- }
- 
--test "$mode" = execute && func_mode_execute ${1+"$@"}
-+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
- 
- 
- # func_mode_finish arg...
- func_mode_finish ()
- {
-     $opt_debug
--    libdirs="$nonopt"
-+    libs=
-+    libdirs=
-     admincmds=
- 
--    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
--      for dir
--      do
--	libdirs="$libdirs $dir"
--      done
-+    for opt in "$nonopt" ${1+"$@"}
-+    do
-+      if test -d "$opt"; then
-+	func_append libdirs " $opt"
- 
-+      elif test -f "$opt"; then
-+	if func_lalib_unsafe_p "$opt"; then
-+	  func_append libs " $opt"
-+	else
-+	  func_warning "\`$opt' is not a valid libtool archive"
-+	fi
-+
-+      else
-+	func_fatal_error "invalid argument \`$opt'"
-+      fi
-+    done
-+
-+    if test -n "$libs"; then
-+      if test -n "$lt_sysroot"; then
-+        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
-+        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
-+      else
-+        sysroot_cmd=
-+      fi
-+
-+      # Remove sysroot references
-+      if $opt_dry_run; then
-+        for lib in $libs; do
-+          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
-+        done
-+      else
-+        tmpdir=`func_mktempdir`
-+        for lib in $libs; do
-+	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
-+	    > $tmpdir/tmp-la
-+	  mv -f $tmpdir/tmp-la $lib
-+	done
-+        ${RM}r "$tmpdir"
-+      fi
-+    fi
-+
-+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-       for libdir in $libdirs; do
- 	if test -n "$finish_cmds"; then
- 	  # Do each command in the finish commands.
-@@ -1997,7 +2704,7 @@ func_mode_finish ()
- 	if test -n "$finish_eval"; then
- 	  # Do the single finish_eval.
- 	  eval cmds=\"$finish_eval\"
--	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
-+	  $opt_dry_run || eval "$cmds" || func_append admincmds "
-        $cmds"
- 	fi
-       done
-@@ -2006,53 +2713,55 @@ func_mode_finish ()
-     # Exit here if they wanted silent mode.
-     $opt_silent && exit $EXIT_SUCCESS
- 
--    echo "----------------------------------------------------------------------"
--    echo "Libraries have been installed in:"
--    for libdir in $libdirs; do
--      $ECHO "   $libdir"
--    done
--    echo
--    echo "If you ever happen to want to link against installed libraries"
--    echo "in a given directory, LIBDIR, you must either use libtool, and"
--    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
--    echo "flag during linking and do at least one of the following:"
--    if test -n "$shlibpath_var"; then
--      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
--      echo "     during execution"
--    fi
--    if test -n "$runpath_var"; then
--      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
--      echo "     during linking"
--    fi
--    if test -n "$hardcode_libdir_flag_spec"; then
--      libdir=LIBDIR
--      eval "flag=\"$hardcode_libdir_flag_spec\""
-+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-+      echo "----------------------------------------------------------------------"
-+      echo "Libraries have been installed in:"
-+      for libdir in $libdirs; do
-+	$ECHO "   $libdir"
-+      done
-+      echo
-+      echo "If you ever happen to want to link against installed libraries"
-+      echo "in a given directory, LIBDIR, you must either use libtool, and"
-+      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
-+      echo "flag during linking and do at least one of the following:"
-+      if test -n "$shlibpath_var"; then
-+	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-+	echo "     during execution"
-+      fi
-+      if test -n "$runpath_var"; then
-+	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
-+	echo "     during linking"
-+      fi
-+      if test -n "$hardcode_libdir_flag_spec"; then
-+	libdir=LIBDIR
-+	eval flag=\"$hardcode_libdir_flag_spec\"
- 
--      $ECHO "   - use the \`$flag' linker flag"
--    fi
--    if test -n "$admincmds"; then
--      $ECHO "   - have your system administrator run these commands:$admincmds"
--    fi
--    if test -f /etc/ld.so.conf; then
--      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
--    fi
--    echo
-+	$ECHO "   - use the \`$flag' linker flag"
-+      fi
-+      if test -n "$admincmds"; then
-+	$ECHO "   - have your system administrator run these commands:$admincmds"
-+      fi
-+      if test -f /etc/ld.so.conf; then
-+	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-+      fi
-+      echo
- 
--    echo "See any operating system documentation about shared libraries for"
--    case $host in
--      solaris2.[6789]|solaris2.1[0-9])
--        echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
--	echo "pages."
--	;;
--      *)
--        echo "more information, such as the ld(1) and ld.so(8) manual pages."
--        ;;
--    esac
--    echo "----------------------------------------------------------------------"
-+      echo "See any operating system documentation about shared libraries for"
-+      case $host in
-+	solaris2.[6789]|solaris2.1[0-9])
-+	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
-+	  echo "pages."
-+	  ;;
-+	*)
-+	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
-+	  ;;
-+      esac
-+      echo "----------------------------------------------------------------------"
-+    fi
-     exit $EXIT_SUCCESS
- }
- 
--test "$mode" = finish && func_mode_finish ${1+"$@"}
-+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
- 
- 
- # func_mode_install arg...
-@@ -2077,7 +2786,7 @@ func_mode_install ()
-     # The real first argument should be the name of the installation program.
-     # Aesthetically quote it.
-     func_quote_for_eval "$arg"
--    install_prog="$install_prog$func_quote_for_eval_result"
-+    func_append install_prog "$func_quote_for_eval_result"
-     install_shared_prog=$install_prog
-     case " $install_prog " in
-       *[\\\ /]cp\ *) install_cp=: ;;
-@@ -2097,7 +2806,7 @@ func_mode_install ()
-     do
-       arg2=
-       if test -n "$dest"; then
--	files="$files $dest"
-+	func_append files " $dest"
- 	dest=$arg
- 	continue
-       fi
-@@ -2135,11 +2844,11 @@ func_mode_install ()
- 
-       # Aesthetically quote the argument.
-       func_quote_for_eval "$arg"
--      install_prog="$install_prog $func_quote_for_eval_result"
-+      func_append install_prog " $func_quote_for_eval_result"
-       if test -n "$arg2"; then
- 	func_quote_for_eval "$arg2"
-       fi
--      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
-+      func_append install_shared_prog " $func_quote_for_eval_result"
-     done
- 
-     test -z "$install_prog" && \
-@@ -2151,7 +2860,7 @@ func_mode_install ()
-     if test -n "$install_override_mode" && $no_mode; then
-       if $install_cp; then :; else
- 	func_quote_for_eval "$install_override_mode"
--	install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
-+	func_append install_shared_prog " -m $func_quote_for_eval_result"
-       fi
-     fi
- 
-@@ -2209,10 +2918,13 @@ func_mode_install ()
-       case $file in
-       *.$libext)
- 	# Do the static libraries later.
--	staticlibs="$staticlibs $file"
-+	func_append staticlibs " $file"
- 	;;
- 
-       *.la)
-+	func_resolve_sysroot "$file"
-+	file=$func_resolve_sysroot_result
-+
- 	# Check to see that this really is a libtool archive.
- 	func_lalib_unsafe_p "$file" \
- 	  || func_fatal_help "\`$file' is not a valid libtool archive"
-@@ -2226,23 +2938,30 @@ func_mode_install ()
- 	if test "X$destdir" = "X$libdir"; then
- 	  case "$current_libdirs " in
- 	  *" $libdir "*) ;;
--	  *) current_libdirs="$current_libdirs $libdir" ;;
-+	  *) func_append current_libdirs " $libdir" ;;
- 	  esac
- 	else
- 	  # Note the libdir as a future libdir.
- 	  case "$future_libdirs " in
- 	  *" $libdir "*) ;;
--	  *) future_libdirs="$future_libdirs $libdir" ;;
-+	  *) func_append future_libdirs " $libdir" ;;
- 	  esac
- 	fi
- 
- 	func_dirname "$file" "/" ""
- 	dir="$func_dirname_result"
--	dir="$dir$objdir"
-+	func_append dir "$objdir"
- 
- 	if test -n "$relink_command"; then
-+      # Strip any trailing slash from the destination.
-+      func_stripname '' '/' "$libdir"
-+      destlibdir=$func_stripname_result
-+
-+      func_stripname '' '/' "$destdir"
-+      s_destdir=$func_stripname_result
-+
- 	  # Determine the prefix the user has applied to our future dir.
--	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
-+	  inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
- 
- 	  # Don't allow the user to place us outside of our expected
- 	  # location b/c this prevents finding dependent libraries that
-@@ -2315,7 +3034,7 @@ func_mode_install ()
- 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
- 
- 	# Maybe install the static library, too.
--	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
-+	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
- 	;;
- 
-       *.lo)
-@@ -2503,7 +3222,7 @@ func_mode_install ()
-     test -n "$future_libdirs" && \
-       func_warning "remember to run \`$progname --finish$future_libdirs'"
- 
--    if test -n "$current_libdirs" && $opt_finish; then
-+    if test -n "$current_libdirs"; then
-       # Maybe just do a dry run.
-       $opt_dry_run && current_libdirs=" -n$current_libdirs"
-       exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
-@@ -2512,7 +3231,7 @@ func_mode_install ()
-     fi
- }
- 
--test "$mode" = install && func_mode_install ${1+"$@"}
-+test "$opt_mode" = install && func_mode_install ${1+"$@"}
- 
- 
- # func_generate_dlsyms outputname originator pic_p
-@@ -2559,6 +3278,18 @@ extern \"C\" {
- #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
- #endif
- 
-+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-+/* DATA imports from DLLs on WIN32 con't be const, because runtime
-+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-+# define LT_DLSYM_CONST
-+#elif defined(__osf__)
-+/* This system does not cope well with relocations in const data.  */
-+# define LT_DLSYM_CONST
-+#else
-+# define LT_DLSYM_CONST const
-+#endif
-+
- /* External symbol declarations for the compiler. */\
- "
- 
-@@ -2570,21 +3301,22 @@ extern \"C\" {
- 	  # Add our own program objects to the symbol list.
- 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
- 	  for progfile in $progfiles; do
--	    func_verbose "extracting global C symbols from \`$progfile'"
--	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
-+	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-+	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
-+	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
- 	  done
- 
- 	  if test -n "$exclude_expsyms"; then
- 	    $opt_dry_run || {
--	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
--	      $MV "$nlist"T "$nlist"
-+	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-+	      eval '$MV "$nlist"T "$nlist"'
- 	    }
- 	  fi
- 
- 	  if test -n "$export_symbols_regex"; then
- 	    $opt_dry_run || {
--	      $EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T
--	      $MV "$nlist"T "$nlist"
-+	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-+	      eval '$MV "$nlist"T "$nlist"'
- 	    }
- 	  fi
- 
-@@ -2593,23 +3325,23 @@ extern \"C\" {
- 	    export_symbols="$output_objdir/$outputname.exp"
- 	    $opt_dry_run || {
- 	      $RM $export_symbols
--	      ${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' < "$nlist" > "$export_symbols"
-+	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
- 	      case $host in
- 	      *cygwin* | *mingw* | *cegcc* )
--                echo EXPORTS > "$output_objdir/$outputname.def"
--                cat "$export_symbols" >> "$output_objdir/$outputname.def"
-+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
- 	        ;;
- 	      esac
- 	    }
- 	  else
- 	    $opt_dry_run || {
--	      ${SED} -e 's/\([].[*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/' < "$export_symbols" > "$output_objdir/$outputname.exp"
--	      $GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T
--	      $MV "$nlist"T "$nlist"
-+	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-+	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-+	      eval '$MV "$nlist"T "$nlist"'
- 	      case $host in
- 	        *cygwin* | *mingw* | *cegcc* )
--	          echo EXPORTS > "$output_objdir/$outputname.def"
--	          cat "$nlist" >> "$output_objdir/$outputname.def"
-+	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-+	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
- 	          ;;
- 	      esac
- 	    }
-@@ -2620,10 +3352,52 @@ extern \"C\" {
- 	  func_verbose "extracting global C symbols from \`$dlprefile'"
- 	  func_basename "$dlprefile"
- 	  name="$func_basename_result"
--	  $opt_dry_run || {
--	    $ECHO ": $name " >> "$nlist"
--	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
--	  }
-+          case $host in
-+	    *cygwin* | *mingw* | *cegcc* )
-+	      # if an import library, we need to obtain dlname
-+	      if func_win32_import_lib_p "$dlprefile"; then
-+	        func_tr_sh "$dlprefile"
-+	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-+	        dlprefile_dlbasename=""
-+	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
-+	          # Use subshell, to avoid clobbering current variable values
-+	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-+	          if test -n "$dlprefile_dlname" ; then
-+	            func_basename "$dlprefile_dlname"
-+	            dlprefile_dlbasename="$func_basename_result"
-+	          else
-+	            # no lafile. user explicitly requested -dlpreopen <import library>.
-+	            $sharedlib_from_linklib_cmd "$dlprefile"
-+	            dlprefile_dlbasename=$sharedlib_from_linklib_result
-+	          fi
-+	        fi
-+	        $opt_dry_run || {
-+	          if test -n "$dlprefile_dlbasename" ; then
-+	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
-+	          else
-+	            func_warning "Could not compute DLL name from $name"
-+	            eval '$ECHO ": $name " >> "$nlist"'
-+	          fi
-+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
-+	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
-+	        }
-+	      else # not an import lib
-+	        $opt_dry_run || {
-+	          eval '$ECHO ": $name " >> "$nlist"'
-+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-+	        }
-+	      fi
-+	    ;;
-+	    *)
-+	      $opt_dry_run || {
-+	        eval '$ECHO ": $name " >> "$nlist"'
-+	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-+	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-+	      }
-+	    ;;
-+          esac
- 	done
- 
- 	$opt_dry_run || {
-@@ -2661,26 +3435,9 @@ typedef struct {
-   const char *name;
-   void *address;
- } lt_dlsymlist;
--"
--	  case $host in
--	  *cygwin* | *mingw* | *cegcc* )
--	    echo >> "$output_objdir/$my_dlsyms" "\
--/* DATA imports from DLLs on WIN32 con't be const, because
--   runtime relocations are performed -- see ld's documentation
--   on pseudo-relocs.  */"
--	    lt_dlsym_const= ;;
--	  *osf5*)
--	    echo >> "$output_objdir/$my_dlsyms" "\
--/* This system does not cope well with relocations in const data */"
--	    lt_dlsym_const= ;;
--	  *)
--	    lt_dlsym_const=const ;;
--	  esac
--
--	  echo >> "$output_objdir/$my_dlsyms" "\
--extern $lt_dlsym_const lt_dlsymlist
-+extern LT_DLSYM_CONST lt_dlsymlist
- lt_${my_prefix}_LTX_preloaded_symbols[];
--$lt_dlsym_const lt_dlsymlist
-+LT_DLSYM_CONST lt_dlsymlist
- lt_${my_prefix}_LTX_preloaded_symbols[] =
- {\
-   { \"$my_originator\", (void *) 0 },"
-@@ -2736,7 +3493,7 @@ static const void *lt_preloaded_setup() {
- 	for arg in $LTCFLAGS; do
- 	  case $arg in
- 	  -pie | -fpie | -fPIE) ;;
--	  *) symtab_cflags="$symtab_cflags $arg" ;;
-+	  *) func_append symtab_cflags " $arg" ;;
- 	  esac
- 	done
- 
-@@ -2796,9 +3553,11 @@ func_win32_libid ()
-     win32_libid_type="x86 archive import"
-     ;;
-   *ar\ archive*) # could be an import, or static
--    if $OBJDUMP -f "$1" | $SED -e '10q' 2>/dev/null |
--       $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
--      win32_nmres=`$NM -f posix -A "$1" |
-+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
-+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-+      func_to_tool_file "$1" func_convert_file_msys_to_w32
-+      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
- 	$SED -n -e '
- 	    1,100{
- 		/ I /{
-@@ -2827,6 +3586,131 @@ func_win32_libid ()
-   $ECHO "$win32_libid_type"
- }
- 
-+# func_cygming_dll_for_implib ARG
-+#
-+# Platform-specific function to extract the
-+# name of the DLL associated with the specified
-+# import library ARG.
-+# Invoked by eval'ing the libtool variable
-+#    $sharedlib_from_linklib_cmd
-+# Result is available in the variable
-+#    $sharedlib_from_linklib_result
-+func_cygming_dll_for_implib ()
-+{
-+  $opt_debug
-+  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-+}
-+
-+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-+#
-+# The is the core of a fallback implementation of a
-+# platform-specific function to extract the name of the
-+# DLL associated with the specified import library LIBNAME.
-+#
-+# SECTION_NAME is either .idata$6 or .idata$7, depending
-+# on the platform and compiler that created the implib.
-+#
-+# Echos the name of the DLL associated with the
-+# specified import library.
-+func_cygming_dll_for_implib_fallback_core ()
-+{
-+  $opt_debug
-+  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
-+  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
-+    $SED '/^Contents of section '"$match_literal"':/{
-+      # Place marker at beginning of archive member dllname section
-+      s/.*/====MARK====/
-+      p
-+      d
-+    }
-+    # These lines can sometimes be longer than 43 characters, but
-+    # are always uninteresting
-+    /:[	 ]*file format pe[i]\{,1\}-/d
-+    /^In archive [^:]*:/d
-+    # Ensure marker is printed
-+    /^====MARK====/p
-+    # Remove all lines with less than 43 characters
-+    /^.\{43\}/!d
-+    # From remaining lines, remove first 43 characters
-+    s/^.\{43\}//' |
-+    $SED -n '
-+      # Join marker and all lines until next marker into a single line
-+      /^====MARK====/ b para
-+      H
-+      $ b para
-+      b
-+      :para
-+      x
-+      s/\n//g
-+      # Remove the marker
-+      s/^====MARK====//
-+      # Remove trailing dots and whitespace
-+      s/[\. \t]*$//
-+      # Print
-+      /./p' |
-+    # we now have a list, one entry per line, of the stringified
-+    # contents of the appropriate section of all members of the
-+    # archive which possess that section. Heuristic: eliminate
-+    # all those which have a first or second character that is
-+    # a '.' (that is, objdump's representation of an unprintable
-+    # character.) This should work for all archives with less than
-+    # 0x302f exports -- but will fail for DLLs whose name actually
-+    # begins with a literal '.' or a single character followed by
-+    # a '.'.
-+    #
-+    # Of those that remain, print the first one.
-+    $SED -e '/^\./d;/^.\./d;q'
-+}
-+
-+# func_cygming_gnu_implib_p ARG
-+# This predicate returns with zero status (TRUE) if
-+# ARG is a GNU/binutils-style import library. Returns
-+# with nonzero status (FALSE) otherwise.
-+func_cygming_gnu_implib_p ()
-+{
-+  $opt_debug
-+  func_to_tool_file "$1" func_convert_file_msys_to_w32
-+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-+  test -n "$func_cygming_gnu_implib_tmp"
-+}
-+
-+# func_cygming_ms_implib_p ARG
-+# This predicate returns with zero status (TRUE) if
-+# ARG is an MS-style import library. Returns
-+# with nonzero status (FALSE) otherwise.
-+func_cygming_ms_implib_p ()
-+{
-+  $opt_debug
-+  func_to_tool_file "$1" func_convert_file_msys_to_w32
-+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-+  test -n "$func_cygming_ms_implib_tmp"
-+}
-+
-+# func_cygming_dll_for_implib_fallback ARG
-+# Platform-specific function to extract the
-+# name of the DLL associated with the specified
-+# import library ARG.
-+#
-+# This fallback implementation is for use when $DLLTOOL
-+# does not support the --identify-strict option.
-+# Invoked by eval'ing the libtool variable
-+#    $sharedlib_from_linklib_cmd
-+# Result is available in the variable
-+#    $sharedlib_from_linklib_result
-+func_cygming_dll_for_implib_fallback ()
-+{
-+  $opt_debug
-+  if func_cygming_gnu_implib_p "$1" ; then
-+    # binutils import library
-+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-+  elif func_cygming_ms_implib_p "$1" ; then
-+    # ms-generated import library
-+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
-+  else
-+    # unknown
-+    sharedlib_from_linklib_result=""
-+  fi
-+}
- 
- 
- # func_extract_an_archive dir oldlib
-@@ -2917,7 +3801,7 @@ func_extract_archives ()
- 	    darwin_file=
- 	    darwin_files=
- 	    for darwin_file in $darwin_filelist; do
--	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
-+	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
- 	      $LIPO -create -output "$darwin_file" $darwin_files
- 	    done # $darwin_filelist
- 	    $RM -rf unfat-$$
-@@ -2932,7 +3816,7 @@ func_extract_archives ()
-         func_extract_an_archive "$my_xdir" "$my_xabs"
- 	;;
-       esac
--      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
-     done
- 
-     func_extract_archives_result="$my_oldobjs"
-@@ -3014,7 +3898,110 @@ func_fallback_echo ()
- _LTECHO_EOF'
- }
-     ECHO=\"$qECHO\"
--  fi\
-+  fi
-+
-+# Very basic option parsing. These options are (a) specific to
-+# the libtool wrapper, (b) are identical between the wrapper
-+# /script/ and the wrapper /executable/ which is used only on
-+# windows platforms, and (c) all begin with the string "--lt-"
-+# (application programs are unlikely to have options which match
-+# this pattern).
-+#
-+# There are only two supported options: --lt-debug and
-+# --lt-dump-script. There is, deliberately, no --lt-help.
-+#
-+# The first argument to this parsing function should be the
-+# script's $0 value, followed by "$@".
-+lt_option_debug=
-+func_parse_lt_options ()
-+{
-+  lt_script_arg0=\$0
-+  shift
-+  for lt_opt
-+  do
-+    case \"\$lt_opt\" in
-+    --lt-debug) lt_option_debug=1 ;;
-+    --lt-dump-script)
-+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
-+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
-+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
-+        cat \"\$lt_dump_D/\$lt_dump_F\"
-+        exit 0
-+      ;;
-+    --lt-*)
-+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
-+        exit 1
-+      ;;
-+    esac
-+  done
-+
-+  # Print the debug banner immediately:
-+  if test -n \"\$lt_option_debug\"; then
-+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
-+  fi
-+}
-+
-+# Used when --lt-debug. Prints its arguments to stdout
-+# (redirection is the responsibility of the caller)
-+func_lt_dump_args ()
-+{
-+  lt_dump_args_N=1;
-+  for lt_arg
-+  do
-+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
-+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
-+  done
-+}
-+
-+# Core function for launching the target application
-+func_exec_program_core ()
-+{
-+"
-+  case $host in
-+  # Backslashes separate directories on plain windows
-+  *-*-mingw | *-*-os2* | *-cegcc*)
-+    $ECHO "\
-+      if test -n \"\$lt_option_debug\"; then
-+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
-+        func_lt_dump_args \${1+\"\$@\"} 1>&2
-+      fi
-+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-+"
-+    ;;
-+
-+  *)
-+    $ECHO "\
-+      if test -n \"\$lt_option_debug\"; then
-+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
-+        func_lt_dump_args \${1+\"\$@\"} 1>&2
-+      fi
-+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-+"
-+    ;;
-+  esac
-+  $ECHO "\
-+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-+      exit 1
-+}
-+
-+# A function to encapsulate launching the target application
-+# Strips options in the --lt-* namespace from \$@ and
-+# launches target application with the remaining arguments.
-+func_exec_program ()
-+{
-+  for lt_wr_arg
-+  do
-+    case \$lt_wr_arg in
-+    --lt-*) ;;
-+    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-+    esac
-+    shift
-+  done
-+  func_exec_program_core \${1+\"\$@\"}
-+}
-+
-+  # Parse options
-+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
- 
-   # Find the directory that this script lives in.
-   thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
-@@ -3078,7 +4065,7 @@ _LTECHO_EOF'
- 
-     # relink executable if necessary
-     if test -n \"\$relink_command\"; then
--      if relink_command_output=\`eval \"\$relink_command\" 2>&1\`; then :
-+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-       else
- 	$ECHO \"\$relink_command_output\" >&2
- 	$RM \"\$progdir/\$file\"
-@@ -3102,6 +4089,18 @@ _LTECHO_EOF'
- 
-   if test -f \"\$progdir/\$program\"; then"
- 
-+	# fixup the dll searchpath if we need to.
-+	#
-+	# Fix the DLL searchpath if we need to.  Do this before prepending
-+	# to shlibpath, because on Windows, both are PATH and uninstalled
-+	# libraries must come first.
-+	if test -n "$dllsearchpath"; then
-+	  $ECHO "\
-+    # Add the dll search path components to the executable PATH
-+    PATH=$dllsearchpath:\$PATH
-+"
-+	fi
-+
- 	# Export our shlibpath_var if we have one.
- 	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- 	  $ECHO "\
-@@ -3116,35 +4115,10 @@ _LTECHO_EOF'
- "
- 	fi
- 
--	# fixup the dll searchpath if we need to.
--	if test -n "$dllsearchpath"; then
--	  $ECHO "\
--    # Add the dll search path components to the executable PATH
--    PATH=$dllsearchpath:\$PATH
--"
--	fi
--
- 	$ECHO "\
-     if test \"\$libtool_execute_magic\" != \"$magic\"; then
-       # Run the actual program with our arguments.
--"
--	case $host in
--	# Backslashes separate directories on plain windows
--	*-*-mingw | *-*-os2* | *-cegcc*)
--	  $ECHO "\
--      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
--"
--	  ;;
--
--	*)
--	  $ECHO "\
--      exec \"\$progdir/\$program\" \${1+\"\$@\"}
--"
--	  ;;
--	esac
--	$ECHO "\
--      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
--      exit 1
-+      func_exec_program \${1+\"\$@\"}
-     fi
-   else
-     # The program doesn't exist.
-@@ -3158,166 +4132,6 @@ fi\
- }
- 
- 
--# func_to_host_path arg
--#
--# Convert paths to host format when used with build tools.
--# Intended for use with "native" mingw (where libtool itself
--# is running under the msys shell), or in the following cross-
--# build environments:
--#    $build          $host
--#    mingw (msys)    mingw  [e.g. native]
--#    cygwin          mingw
--#    *nix + wine     mingw
--# where wine is equipped with the `winepath' executable.
--# In the native mingw case, the (msys) shell automatically
--# converts paths for any non-msys applications it launches,
--# but that facility isn't available from inside the cwrapper.
--# Similar accommodations are necessary for $host mingw and
--# $build cygwin.  Calling this function does no harm for other
--# $host/$build combinations not listed above.
--#
--# ARG is the path (on $build) that should be converted to
--# the proper representation for $host. The result is stored
--# in $func_to_host_path_result.
--func_to_host_path ()
--{
--  func_to_host_path_result="$1"
--  if test -n "$1"; then
--    case $host in
--      *mingw* )
--        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
--        case $build in
--          *mingw* ) # actually, msys
--            # awkward: cmd appends spaces to result
--            func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
--              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
--            ;;
--          *cygwin* )
--            func_to_host_path_result=`cygpath -w "$1" |
--	      $SED -e "$lt_sed_naive_backslashify"`
--            ;;
--          * )
--            # Unfortunately, winepath does not exit with a non-zero
--            # error code, so we are forced to check the contents of
--            # stdout. On the other hand, if the command is not
--            # found, the shell will set an exit code of 127 and print
--            # *an error message* to stdout. So we must check for both
--            # error code of zero AND non-empty stdout, which explains
--            # the odd construction:
--            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
--            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
--              func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
--                $SED -e "$lt_sed_naive_backslashify"`
--            else
--              # Allow warning below.
--              func_to_host_path_result=
--            fi
--            ;;
--        esac
--        if test -z "$func_to_host_path_result" ; then
--          func_error "Could not determine host path corresponding to"
--          func_error "  \`$1'"
--          func_error "Continuing, but uninstalled executables may not work."
--          # Fallback:
--          func_to_host_path_result="$1"
--        fi
--        ;;
--    esac
--  fi
--}
--# end: func_to_host_path
--
--# func_to_host_pathlist arg
--#
--# Convert pathlists to host format when used with build tools.
--# See func_to_host_path(), above. This function supports the
--# following $build/$host combinations (but does no harm for
--# combinations not listed here):
--#    $build          $host
--#    mingw (msys)    mingw  [e.g. native]
--#    cygwin          mingw
--#    *nix + wine     mingw
--#
--# Path separators are also converted from $build format to
--# $host format. If ARG begins or ends with a path separator
--# character, it is preserved (but converted to $host format)
--# on output.
--#
--# ARG is a pathlist (on $build) that should be converted to
--# the proper representation on $host. The result is stored
--# in $func_to_host_pathlist_result.
--func_to_host_pathlist ()
--{
--  func_to_host_pathlist_result="$1"
--  if test -n "$1"; then
--    case $host in
--      *mingw* )
--        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
--        # Remove leading and trailing path separator characters from
--        # ARG. msys behavior is inconsistent here, cygpath turns them
--        # into '.;' and ';.', and winepath ignores them completely.
--	func_stripname : : "$1"
--        func_to_host_pathlist_tmp1=$func_stripname_result
--        case $build in
--          *mingw* ) # Actually, msys.
--            # Awkward: cmd appends spaces to result.
--            func_to_host_pathlist_result=`
--	      ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
--	      $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
--            ;;
--          *cygwin* )
--            func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
--              $SED -e "$lt_sed_naive_backslashify"`
--            ;;
--          * )
--            # unfortunately, winepath doesn't convert pathlists
--            func_to_host_pathlist_result=""
--            func_to_host_pathlist_oldIFS=$IFS
--            IFS=:
--            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
--              IFS=$func_to_host_pathlist_oldIFS
--              if test -n "$func_to_host_pathlist_f" ; then
--                func_to_host_path "$func_to_host_pathlist_f"
--                if test -n "$func_to_host_path_result" ; then
--                  if test -z "$func_to_host_pathlist_result" ; then
--                    func_to_host_pathlist_result="$func_to_host_path_result"
--                  else
--                    func_append func_to_host_pathlist_result ";$func_to_host_path_result"
--                  fi
--                fi
--              fi
--            done
--            IFS=$func_to_host_pathlist_oldIFS
--            ;;
--        esac
--        if test -z "$func_to_host_pathlist_result"; then
--          func_error "Could not determine the host path(s) corresponding to"
--          func_error "  \`$1'"
--          func_error "Continuing, but uninstalled executables may not work."
--          # Fallback. This may break if $1 contains DOS-style drive
--          # specifications. The fix is not to complicate the expression
--          # below, but for the user to provide a working wine installation
--          # with winepath so that path translation in the cross-to-mingw
--          # case works properly.
--          lt_replace_pathsep_nix_to_dos="s|:|;|g"
--          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
--            $SED -e "$lt_replace_pathsep_nix_to_dos"`
--        fi
--        # Now, add the leading and trailing path separators back
--        case "$1" in
--          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
--            ;;
--        esac
--        case "$1" in
--          *: ) func_append func_to_host_pathlist_result ";"
--            ;;
--        esac
--        ;;
--    esac
--  fi
--}
--# end: func_to_host_pathlist
--
- # func_emit_cwrapperexe_src
- # emit the source code for a wrapper executable on stdout
- # Must ONLY be called from within func_mode_link because
-@@ -3334,10 +4148,6 @@ func_emit_cwrapperexe_src ()
- 
-    This wrapper executable should never be moved out of the build directory.
-    If it is, it will not operate correctly.
--
--   Currently, it simply execs the wrapper *script* "$SHELL $output",
--   but could eventually absorb all of the scripts functionality and
--   exec $objdir/$outputname directly.
- */
- EOF
- 	    cat <<"EOF"
-@@ -3462,22 +4272,13 @@ int setenv (const char *, const char *, int);
-   if (stale) { free ((void *) stale); stale = 0; } \
- } while (0)
- 
--#undef LTWRAPPER_DEBUGPRINTF
--#if defined LT_DEBUGWRAPPER
--# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
--static void
--ltwrapper_debugprintf (const char *fmt, ...)
--{
--    va_list args;
--    va_start (args, fmt);
--    (void) vfprintf (stderr, fmt, args);
--    va_end (args);
--}
-+#if defined(LT_DEBUGWRAPPER)
-+static int lt_debug = 1;
- #else
--# define LTWRAPPER_DEBUGPRINTF(args)
-+static int lt_debug = 0;
- #endif
- 
--const char *program_name = NULL;
-+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
- 
- void *xmalloc (size_t num);
- char *xstrdup (const char *string);
-@@ -3487,7 +4288,10 @@ char *chase_symlinks (const char *pathspec);
- int make_executable (const char *path);
- int check_executable (const char *path);
- char *strendzap (char *str, const char *pat);
--void lt_fatal (const char *message, ...);
-+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
-+void lt_fatal (const char *file, int line, const char *message, ...);
-+static const char *nonnull (const char *s);
-+static const char *nonempty (const char *s);
- void lt_setenv (const char *name, const char *value);
- char *lt_extend_str (const char *orig_value, const char *add, int to_end);
- void lt_update_exe_path (const char *name, const char *value);
-@@ -3497,14 +4301,14 @@ void lt_dump_script (FILE *f);
- EOF
- 
- 	    cat <<EOF
--const char * MAGIC_EXE = "$magic_exe";
-+volatile const char * MAGIC_EXE = "$magic_exe";
- const char * LIB_PATH_VARNAME = "$shlibpath_var";
- EOF
- 
- 	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
--              func_to_host_pathlist "$temp_rpath"
-+              func_to_host_path "$temp_rpath"
- 	      cat <<EOF
--const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
-+const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
- EOF
- 	    else
- 	      cat <<"EOF"
-@@ -3513,10 +4317,10 @@ EOF
- 	    fi
- 
- 	    if test -n "$dllsearchpath"; then
--              func_to_host_pathlist "$dllsearchpath:"
-+              func_to_host_path "$dllsearchpath:"
- 	      cat <<EOF
- const char * EXE_PATH_VARNAME = "PATH";
--const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
-+const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
- EOF
- 	    else
- 	      cat <<"EOF"
-@@ -3539,12 +4343,10 @@ EOF
- 	    cat <<"EOF"
- 
- #define LTWRAPPER_OPTION_PREFIX         "--lt-"
--#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
- 
--static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
- static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
--
- static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
-+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
- 
- int
- main (int argc, char *argv[])
-@@ -3561,10 +4363,13 @@ main (int argc, char *argv[])
-   int i;
- 
-   program_name = (char *) xstrdup (base_name (argv[0]));
--  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
--  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
-+  newargz = XMALLOC (char *, argc + 1);
- 
--  /* very simple arg parsing; don't want to rely on getopt */
-+  /* very simple arg parsing; don't want to rely on getopt
-+   * also, copy all non cwrapper options to newargz, except
-+   * argz[0], which is handled differently
-+   */
-+  newargc=0;
-   for (i = 1; i < argc; i++)
-     {
-       if (strcmp (argv[i], dumpscript_opt) == 0)
-@@ -3581,21 +4386,54 @@ EOF
- 	  lt_dump_script (stdout);
- 	  return 0;
- 	}
-+      if (strcmp (argv[i], debug_opt) == 0)
-+	{
-+          lt_debug = 1;
-+          continue;
-+	}
-+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
-+        {
-+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-+             namespace, but it is not one of the ones we know about and
-+             have already dealt with, above (inluding dump-script), then
-+             report an error. Otherwise, targets might begin to believe
-+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-+             namespace. The first time any user complains about this, we'll
-+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-+             or a configure.ac-settable value.
-+           */
-+          lt_fatal (__FILE__, __LINE__,
-+		    "unrecognized %s option: '%s'",
-+                    ltwrapper_option_prefix, argv[i]);
-+        }
-+      /* otherwise ... */
-+      newargz[++newargc] = xstrdup (argv[i]);
-     }
-+  newargz[++newargc] = NULL;
-+
-+EOF
-+	    cat <<EOF
-+  /* The GNU banner must be the first non-error debug message */
-+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
-+EOF
-+	    cat <<"EOF"
-+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
-+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
- 
--  newargz = XMALLOC (char *, argc + 1);
-   tmp_pathspec = find_executable (argv[0]);
-   if (tmp_pathspec == NULL)
--    lt_fatal ("Couldn't find %s", argv[0]);
--  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
--			  tmp_pathspec));
-+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
-+  lt_debugprintf (__FILE__, __LINE__,
-+                  "(main) found exe (before symlink chase) at: %s\n",
-+		  tmp_pathspec);
- 
-   actual_cwrapper_path = chase_symlinks (tmp_pathspec);
--  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
--			  actual_cwrapper_path));
-+  lt_debugprintf (__FILE__, __LINE__,
-+                  "(main) found exe (after symlink chase) at: %s\n",
-+		  actual_cwrapper_path);
-   XFREE (tmp_pathspec);
- 
--  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
-+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
-   strendzap (actual_cwrapper_path, actual_cwrapper_name);
- 
-   /* wrapper name transforms */
-@@ -3613,8 +4451,9 @@ EOF
-   target_name = tmp_pathspec;
-   tmp_pathspec = 0;
- 
--  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
--			  target_name));
-+  lt_debugprintf (__FILE__, __LINE__,
-+		  "(main) libtool target name: %s\n",
-+		  target_name);
- EOF
- 
- 	    cat <<EOF
-@@ -3664,35 +4503,19 @@ EOF
- 
-   lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
-   lt_setenv ("DUALCASE", "1");  /* for MSK sh */
--  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-+  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
-+     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
-+     because on Windows, both *_VARNAMEs are PATH but uninstalled
-+     libraries must come first. */
-   lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
-+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
- 
--  newargc=0;
--  for (i = 1; i < argc; i++)
--    {
--      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
--        {
--          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
--             namespace, but it is not one of the ones we know about and
--             have already dealt with, above (inluding dump-script), then
--             report an error. Otherwise, targets might begin to believe
--             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
--             namespace. The first time any user complains about this, we'll
--             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
--             or a configure.ac-settable value.
--           */
--          lt_fatal ("Unrecognized option in %s namespace: '%s'",
--                    ltwrapper_option_prefix, argv[i]);
--        }
--      /* otherwise ... */
--      newargz[++newargc] = xstrdup (argv[i]);
--    }
--  newargz[++newargc] = NULL;
--
--  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
-+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
-+		  nonnull (lt_argv_zero));
-   for (i = 0; i < newargc; i++)
-     {
--      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
-+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
-+		      i, nonnull (newargz[i]));
-     }
- 
- EOF
-@@ -3706,7 +4529,9 @@ EOF
-   if (rval == -1)
-     {
-       /* failed to start process */
--      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
-+      lt_debugprintf (__FILE__, __LINE__,
-+		      "(main) failed to launch target \"%s\": %s\n",
-+		      lt_argv_zero, nonnull (strerror (errno)));
-       return 127;
-     }
-   return rval;
-@@ -3728,7 +4553,7 @@ xmalloc (size_t num)
- {
-   void *p = (void *) malloc (num);
-   if (!p)
--    lt_fatal ("Memory exhausted");
-+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
- 
-   return p;
- }
-@@ -3762,8 +4587,8 @@ check_executable (const char *path)
- {
-   struct stat st;
- 
--  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
--			  path ? (*path ? path : "EMPTY!") : "NULL!"));
-+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
-+                  nonempty (path));
-   if ((!path) || (!*path))
-     return 0;
- 
-@@ -3780,8 +4605,8 @@ make_executable (const char *path)
-   int rval = 0;
-   struct stat st;
- 
--  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
--			  path ? (*path ? path : "EMPTY!") : "NULL!"));
-+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
-+                  nonempty (path));
-   if ((!path) || (!*path))
-     return 0;
- 
-@@ -3807,8 +4632,8 @@ find_executable (const char *wrapper)
-   int tmp_len;
-   char *concat_name;
- 
--  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
--			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
-+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
-+                  nonempty (wrapper));
- 
-   if ((wrapper == NULL) || (*wrapper == '\0'))
-     return NULL;
-@@ -3861,7 +4686,8 @@ find_executable (const char *wrapper)
- 		{
- 		  /* empty path: current directory */
- 		  if (getcwd (tmp, LT_PATHMAX) == NULL)
--		    lt_fatal ("getcwd failed");
-+		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-+                              nonnull (strerror (errno)));
- 		  tmp_len = strlen (tmp);
- 		  concat_name =
- 		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-@@ -3886,7 +4712,8 @@ find_executable (const char *wrapper)
-     }
-   /* Relative path | not found in path: prepend cwd */
-   if (getcwd (tmp, LT_PATHMAX) == NULL)
--    lt_fatal ("getcwd failed");
-+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-+              nonnull (strerror (errno)));
-   tmp_len = strlen (tmp);
-   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-   memcpy (concat_name, tmp, tmp_len);
-@@ -3912,8 +4739,9 @@ chase_symlinks (const char *pathspec)
-   int has_symlinks = 0;
-   while (strlen (tmp_pathspec) && !has_symlinks)
-     {
--      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
--			      tmp_pathspec));
-+      lt_debugprintf (__FILE__, __LINE__,
-+		      "checking path component for symlinks: %s\n",
-+		      tmp_pathspec);
-       if (lstat (tmp_pathspec, &s) == 0)
- 	{
- 	  if (S_ISLNK (s.st_mode) != 0)
-@@ -3935,8 +4763,9 @@ chase_symlinks (const char *pathspec)
- 	}
-       else
- 	{
--	  char *errstr = strerror (errno);
--	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
-+	  lt_fatal (__FILE__, __LINE__,
-+		    "error accessing file \"%s\": %s",
-+		    tmp_pathspec, nonnull (strerror (errno)));
- 	}
-     }
-   XFREE (tmp_pathspec);
-@@ -3949,7 +4778,8 @@ chase_symlinks (const char *pathspec)
-   tmp_pathspec = realpath (pathspec, buf);
-   if (tmp_pathspec == 0)
-     {
--      lt_fatal ("Could not follow symlinks for %s", pathspec);
-+      lt_fatal (__FILE__, __LINE__,
-+		"could not follow symlinks for %s", pathspec);
-     }
-   return xstrdup (tmp_pathspec);
- #endif
-@@ -3975,11 +4805,25 @@ strendzap (char *str, const char *pat)
-   return str;
- }
- 
-+void
-+lt_debugprintf (const char *file, int line, const char *fmt, ...)
-+{
-+  va_list args;
-+  if (lt_debug)
-+    {
-+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
-+      va_start (args, fmt);
-+      (void) vfprintf (stderr, fmt, args);
-+      va_end (args);
-+    }
-+}
-+
- static void
--lt_error_core (int exit_status, const char *mode,
-+lt_error_core (int exit_status, const char *file,
-+	       int line, const char *mode,
- 	       const char *message, va_list ap)
- {
--  fprintf (stderr, "%s: %s: ", program_name, mode);
-+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
-   vfprintf (stderr, message, ap);
-   fprintf (stderr, ".\n");
- 
-@@ -3988,20 +4832,32 @@ lt_error_core (int exit_status, const char *mode,
- }
- 
- void
--lt_fatal (const char *message, ...)
-+lt_fatal (const char *file, int line, const char *message, ...)
- {
-   va_list ap;
-   va_start (ap, message);
--  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
-+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
-   va_end (ap);
- }
- 
-+static const char *
-+nonnull (const char *s)
-+{
-+  return s ? s : "(null)";
-+}
-+
-+static const char *
-+nonempty (const char *s)
-+{
-+  return (s && !*s) ? "(empty)" : nonnull (s);
-+}
-+
- void
- lt_setenv (const char *name, const char *value)
- {
--  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
--                          (name ? name : "<NULL>"),
--                          (value ? value : "<NULL>")));
-+  lt_debugprintf (__FILE__, __LINE__,
-+		  "(lt_setenv) setting '%s' to '%s'\n",
-+                  nonnull (name), nonnull (value));
-   {
- #ifdef HAVE_SETENV
-     /* always make a copy, for consistency with !HAVE_SETENV */
-@@ -4049,9 +4905,9 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
- void
- lt_update_exe_path (const char *name, const char *value)
- {
--  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
--                          (name ? name : "<NULL>"),
--                          (value ? value : "<NULL>")));
-+  lt_debugprintf (__FILE__, __LINE__,
-+		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-+                  nonnull (name), nonnull (value));
- 
-   if (name && *name && value && *value)
-     {
-@@ -4070,9 +4926,9 @@ lt_update_exe_path (const char *name, const char *value)
- void
- lt_update_lib_path (const char *name, const char *value)
- {
--  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
--                          (name ? name : "<NULL>"),
--                          (value ? value : "<NULL>")));
-+  lt_debugprintf (__FILE__, __LINE__,
-+		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-+                  nonnull (name), nonnull (value));
- 
-   if (name && *name && value && *value)
-     {
-@@ -4222,7 +5078,7 @@ EOF
- func_win32_import_lib_p ()
- {
-     $opt_debug
--    case `eval "$file_magic_cmd \"\$1\" 2>/dev/null" | $SED -e 10q` in
-+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
-     *import*) : ;;
-     *) false ;;
-     esac
-@@ -4401,9 +5257,9 @@ func_mode_link ()
- 	    ;;
- 	  *)
- 	    if test "$prev" = dlfiles; then
--	      dlfiles="$dlfiles $arg"
-+	      func_append dlfiles " $arg"
- 	    else
--	      dlprefiles="$dlprefiles $arg"
-+	      func_append dlprefiles " $arg"
- 	    fi
- 	    prev=
- 	    continue
-@@ -4427,7 +5283,7 @@ func_mode_link ()
- 	    *-*-darwin*)
- 	      case "$deplibs " in
- 		*" $qarg.ltframework "*) ;;
--		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
-+		*) func_append deplibs " $qarg.ltframework" # this is fixed later
- 		   ;;
- 	      esac
- 	      ;;
-@@ -4446,7 +5302,7 @@ func_mode_link ()
- 	    moreargs=
- 	    for fil in `cat "$save_arg"`
- 	    do
--#	      moreargs="$moreargs $fil"
-+#	      func_append moreargs " $fil"
- 	      arg=$fil
- 	      # A libtool-controlled object.
- 
-@@ -4475,7 +5331,7 @@ func_mode_link ()
- 
- 		  if test "$prev" = dlfiles; then
- 		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
--		      dlfiles="$dlfiles $pic_object"
-+		      func_append dlfiles " $pic_object"
- 		      prev=
- 		      continue
- 		    else
-@@ -4487,7 +5343,7 @@ func_mode_link ()
- 		  # CHECK ME:  I think I busted this.  -Ossama
- 		  if test "$prev" = dlprefiles; then
- 		    # Preload the old-style object.
--		    dlprefiles="$dlprefiles $pic_object"
-+		    func_append dlprefiles " $pic_object"
- 		    prev=
- 		  fi
- 
-@@ -4557,12 +5413,12 @@ func_mode_link ()
- 	  if test "$prev" = rpath; then
- 	    case "$rpath " in
- 	    *" $arg "*) ;;
--	    *) rpath="$rpath $arg" ;;
-+	    *) func_append rpath " $arg" ;;
- 	    esac
- 	  else
- 	    case "$xrpath " in
- 	    *" $arg "*) ;;
--	    *) xrpath="$xrpath $arg" ;;
-+	    *) func_append xrpath " $arg" ;;
- 	    esac
- 	  fi
- 	  prev=
-@@ -4574,28 +5430,28 @@ func_mode_link ()
- 	  continue
- 	  ;;
- 	weak)
--	  weak_libs="$weak_libs $arg"
-+	  func_append weak_libs " $arg"
- 	  prev=
- 	  continue
- 	  ;;
- 	xcclinker)
--	  linker_flags="$linker_flags $qarg"
--	  compiler_flags="$compiler_flags $qarg"
-+	  func_append linker_flags " $qarg"
-+	  func_append compiler_flags " $qarg"
- 	  prev=
- 	  func_append compile_command " $qarg"
- 	  func_append finalize_command " $qarg"
- 	  continue
- 	  ;;
- 	xcompiler)
--	  compiler_flags="$compiler_flags $qarg"
-+	  func_append compiler_flags " $qarg"
- 	  prev=
- 	  func_append compile_command " $qarg"
- 	  func_append finalize_command " $qarg"
- 	  continue
- 	  ;;
- 	xlinker)
--	  linker_flags="$linker_flags $qarg"
--	  compiler_flags="$compiler_flags $wl$qarg"
-+	  func_append linker_flags " $qarg"
-+	  func_append compiler_flags " $wl$qarg"
- 	  prev=
- 	  func_append compile_command " $wl$qarg"
- 	  func_append finalize_command " $wl$qarg"
-@@ -4686,15 +5542,16 @@ func_mode_link ()
- 	;;
- 
-       -L*)
--	func_stripname '-L' '' "$arg"
--	dir=$func_stripname_result
--	if test -z "$dir"; then
-+	func_stripname "-L" '' "$arg"
-+	if test -z "$func_stripname_result"; then
- 	  if test "$#" -gt 0; then
- 	    func_fatal_error "require no space between \`-L' and \`$1'"
- 	  else
- 	    func_fatal_error "need path for \`-L' option"
- 	  fi
- 	fi
-+	func_resolve_sysroot "$func_stripname_result"
-+	dir=$func_resolve_sysroot_result
- 	# We need an absolute path.
- 	case $dir in
- 	[\\/]* | [A-Za-z]:[\\/]*) ;;
-@@ -4706,10 +5563,16 @@ func_mode_link ()
- 	  ;;
- 	esac
- 	case "$deplibs " in
--	*" -L$dir "*) ;;
-+	*" -L$dir "* | *" $arg "*)
-+	  # Will only happen for absolute or sysroot arguments
-+	  ;;
- 	*)
--	  deplibs="$deplibs -L$dir"
--	  lib_search_path="$lib_search_path $dir"
-+	  # Preserve sysroot, but never include relative directories
-+	  case $dir in
-+	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
-+	    *) func_append deplibs " -L$dir" ;;
-+	  esac
-+	  func_append lib_search_path " $dir"
- 	  ;;
- 	esac
- 	case $host in
-@@ -4718,12 +5581,12 @@ func_mode_link ()
- 	  case :$dllsearchpath: in
- 	  *":$dir:"*) ;;
- 	  ::) dllsearchpath=$dir;;
--	  *) dllsearchpath="$dllsearchpath:$dir";;
-+	  *) func_append dllsearchpath ":$dir";;
- 	  esac
- 	  case :$dllsearchpath: in
- 	  *":$testbindir:"*) ;;
- 	  ::) dllsearchpath=$testbindir;;
--	  *) dllsearchpath="$dllsearchpath:$testbindir";;
-+	  *) func_append dllsearchpath ":$testbindir";;
- 	  esac
- 	  ;;
- 	esac
-@@ -4747,7 +5610,7 @@ func_mode_link ()
- 	    ;;
- 	  *-*-rhapsody* | *-*-darwin1.[012])
- 	    # Rhapsody C and math libraries are in the System framework
--	    deplibs="$deplibs System.ltframework"
-+	    func_append deplibs " System.ltframework"
- 	    continue
- 	    ;;
- 	  *-*-sco3.2v5* | *-*-sco5v6*)
-@@ -4758,9 +5621,6 @@ func_mode_link ()
- 	    # Compiler inserts libc in the correct place for threads to work
- 	    test "X$arg" = "X-lc" && continue
- 	    ;;
--	  *-*-linux*)
--	    test "X$arg" = "X-lc" && continue
--	    ;;
- 	  esac
- 	elif test "X$arg" = "X-lc_r"; then
- 	 case $host in
-@@ -4770,7 +5630,7 @@ func_mode_link ()
- 	   ;;
- 	 esac
- 	fi
--	deplibs="$deplibs $arg"
-+	func_append deplibs " $arg"
- 	continue
- 	;;
- 
-@@ -4782,8 +5642,8 @@ func_mode_link ()
-       # Tru64 UNIX uses -model [arg] to determine the layout of C++
-       # classes, name mangling, and exception handling.
-       # Darwin uses the -arch flag to determine output architecture.
--      -model|-arch|-isysroot)
--	compiler_flags="$compiler_flags $arg"
-+      -model|-arch|-isysroot|--sysroot)
-+	func_append compiler_flags " $arg"
- 	func_append compile_command " $arg"
- 	func_append finalize_command " $arg"
- 	prev=xcompiler
-@@ -4791,12 +5651,12 @@ func_mode_link ()
- 	;;
- 
-       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
--	compiler_flags="$compiler_flags $arg"
-+	func_append compiler_flags " $arg"
- 	func_append compile_command " $arg"
- 	func_append finalize_command " $arg"
- 	case "$new_inherited_linker_flags " in
- 	    *" $arg "*) ;;
--	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
-+	    * ) func_append new_inherited_linker_flags " $arg" ;;
- 	esac
- 	continue
- 	;;
-@@ -4863,13 +5723,17 @@ func_mode_link ()
- 	# We need an absolute path.
- 	case $dir in
- 	[\\/]* | [A-Za-z]:[\\/]*) ;;
-+	=*)
-+	  func_stripname '=' '' "$dir"
-+	  dir=$lt_sysroot$func_stripname_result
-+	  ;;
- 	*)
- 	  func_fatal_error "only absolute run-paths are allowed"
- 	  ;;
- 	esac
- 	case "$xrpath " in
- 	*" $dir "*) ;;
--	*) xrpath="$xrpath $dir" ;;
-+	*) func_append xrpath " $dir" ;;
- 	esac
- 	continue
- 	;;
-@@ -4922,8 +5786,8 @@ func_mode_link ()
- 	for flag in $args; do
- 	  IFS="$save_ifs"
-           func_quote_for_eval "$flag"
--	  arg="$arg $func_quote_for_eval_result"
--	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
-+	  func_append arg " $func_quote_for_eval_result"
-+	  func_append compiler_flags " $func_quote_for_eval_result"
- 	done
- 	IFS="$save_ifs"
- 	func_stripname ' ' '' "$arg"
-@@ -4938,9 +5802,9 @@ func_mode_link ()
- 	for flag in $args; do
- 	  IFS="$save_ifs"
-           func_quote_for_eval "$flag"
--	  arg="$arg $wl$func_quote_for_eval_result"
--	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
--	  linker_flags="$linker_flags $func_quote_for_eval_result"
-+	  func_append arg " $wl$func_quote_for_eval_result"
-+	  func_append compiler_flags " $wl$func_quote_for_eval_result"
-+	  func_append linker_flags " $func_quote_for_eval_result"
- 	done
- 	IFS="$save_ifs"
- 	func_stripname ' ' '' "$arg"
-@@ -4968,24 +5832,27 @@ func_mode_link ()
- 	arg="$func_quote_for_eval_result"
- 	;;
- 
--      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
--      # -r[0-9][0-9]* specifies the processor on the SGI compiler
--      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
--      # +DA*, +DD* enable 64-bit mode on the HP compiler
--      # -q* pass through compiler args for the IBM compiler
--      # -m*, -t[45]*, -txscale* pass through architecture-specific
--      # compiler args for GCC
--      # -F/path gives path to uninstalled frameworks, gcc on darwin
--      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
--      # @file GCC response files
--      # -tp=* Portland pgcc target processor selection
-+      # Flags to be passed through unchanged, with rationale:
-+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
-+      # -r[0-9][0-9]*        specify processor for the SGI compiler
-+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
-+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
-+      # -q*                  compiler args for the IBM compiler
-+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
-+      # -F/path              path to uninstalled frameworks, gcc on darwin
-+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
-+      # @file                GCC response files
-+      # -tp=*                Portland pgcc target processor selection
-+      # --sysroot=*          for sysroot support
-+      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
--      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
-+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-+      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
-         func_quote_for_eval "$arg"
- 	arg="$func_quote_for_eval_result"
-         func_append compile_command " $arg"
-         func_append finalize_command " $arg"
--        compiler_flags="$compiler_flags $arg"
-+        func_append compiler_flags " $arg"
-         continue
-         ;;
- 
-@@ -4997,7 +5864,7 @@ func_mode_link ()
- 
-       *.$objext)
- 	# A standard object.
--	objs="$objs $arg"
-+	func_append objs " $arg"
- 	;;
- 
-       *.lo)
-@@ -5028,7 +5895,7 @@ func_mode_link ()
- 
- 	    if test "$prev" = dlfiles; then
- 	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
--		dlfiles="$dlfiles $pic_object"
-+		func_append dlfiles " $pic_object"
- 		prev=
- 		continue
- 	      else
-@@ -5040,7 +5907,7 @@ func_mode_link ()
- 	    # CHECK ME:  I think I busted this.  -Ossama
- 	    if test "$prev" = dlprefiles; then
- 	      # Preload the old-style object.
--	      dlprefiles="$dlprefiles $pic_object"
-+	      func_append dlprefiles " $pic_object"
- 	      prev=
- 	    fi
- 
-@@ -5085,24 +5952,25 @@ func_mode_link ()
- 
-       *.$libext)
- 	# An archive.
--	deplibs="$deplibs $arg"
--	old_deplibs="$old_deplibs $arg"
-+	func_append deplibs " $arg"
-+	func_append old_deplibs " $arg"
- 	continue
- 	;;
- 
-       *.la)
- 	# A libtool-controlled library.
- 
-+	func_resolve_sysroot "$arg"
- 	if test "$prev" = dlfiles; then
- 	  # This library was specified with -dlopen.
--	  dlfiles="$dlfiles $arg"
-+	  func_append dlfiles " $func_resolve_sysroot_result"
- 	  prev=
- 	elif test "$prev" = dlprefiles; then
- 	  # The library was specified with -dlpreopen.
--	  dlprefiles="$dlprefiles $arg"
-+	  func_append dlprefiles " $func_resolve_sysroot_result"
- 	  prev=
- 	else
--	  deplibs="$deplibs $arg"
-+	  func_append deplibs " $func_resolve_sysroot_result"
- 	fi
- 	continue
- 	;;
-@@ -5127,7 +5995,7 @@ func_mode_link ()
-       func_fatal_help "the \`$prevarg' option requires an argument"
- 
-     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
--      eval "arg=\"$export_dynamic_flag_spec\""
-+      eval arg=\"$export_dynamic_flag_spec\"
-       func_append compile_command " $arg"
-       func_append finalize_command " $arg"
-     fi
-@@ -5144,11 +6012,13 @@ func_mode_link ()
-     else
-       shlib_search_path=
-     fi
--    eval "sys_lib_search_path=\"$sys_lib_search_path_spec\""
--    eval "sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\""
-+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
-+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
- 
-     func_dirname "$output" "/" ""
-     output_objdir="$func_dirname_result$objdir"
-+    func_to_tool_file "$output_objdir/"
-+    tool_output_objdir=$func_to_tool_file_result
-     # Create the object directory.
-     func_mkdir_p "$output_objdir"
- 
-@@ -5169,12 +6039,12 @@ func_mode_link ()
-     # Find all interdependent deplibs by searching for libraries
-     # that are linked more than once (e.g. -la -lb -la)
-     for deplib in $deplibs; do
--      if $opt_duplicate_deps ; then
-+      if $opt_preserve_dup_deps ; then
- 	case "$libs " in
--	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-+	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
- 	esac
-       fi
--      libs="$libs $deplib"
-+      func_append libs " $deplib"
-     done
- 
-     if test "$linkmode" = lib; then
-@@ -5187,9 +6057,9 @@ func_mode_link ()
-       if $opt_duplicate_compiler_generated_deps; then
- 	for pre_post_dep in $predeps $postdeps; do
- 	  case "$pre_post_deps " in
--	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
-+	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
- 	  esac
--	  pre_post_deps="$pre_post_deps $pre_post_dep"
-+	  func_append pre_post_deps " $pre_post_dep"
- 	done
-       fi
-       pre_post_deps=
-@@ -5256,8 +6126,9 @@ func_mode_link ()
- 	for lib in $dlprefiles; do
- 	  # Ignore non-libtool-libs
- 	  dependency_libs=
-+	  func_resolve_sysroot "$lib"
- 	  case $lib in
--	  *.la)	func_source "$lib" ;;
-+	  *.la)	func_source "$func_resolve_sysroot_result" ;;
- 	  esac
- 
- 	  # Collect preopened libtool deplibs, except any this library
-@@ -5267,7 +6138,7 @@ func_mode_link ()
-             deplib_base=$func_basename_result
- 	    case " $weak_libs " in
- 	    *" $deplib_base "*) ;;
--	    *) deplibs="$deplibs $deplib" ;;
-+	    *) func_append deplibs " $deplib" ;;
- 	    esac
- 	  done
- 	done
-@@ -5288,11 +6159,11 @@ func_mode_link ()
- 	    compile_deplibs="$deplib $compile_deplibs"
- 	    finalize_deplibs="$deplib $finalize_deplibs"
- 	  else
--	    compiler_flags="$compiler_flags $deplib"
-+	    func_append compiler_flags " $deplib"
- 	    if test "$linkmode" = lib ; then
- 		case "$new_inherited_linker_flags " in
- 		    *" $deplib "*) ;;
--		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
-+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
- 		esac
- 	    fi
- 	  fi
-@@ -5377,7 +6248,7 @@ func_mode_link ()
- 	    if test "$linkmode" = lib ; then
- 		case "$new_inherited_linker_flags " in
- 		    *" $deplib "*) ;;
--		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
-+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
- 		esac
- 	    fi
- 	  fi
-@@ -5390,7 +6261,8 @@ func_mode_link ()
- 	    test "$pass" = conv && continue
- 	    newdependency_libs="$deplib $newdependency_libs"
- 	    func_stripname '-L' '' "$deplib"
--	    newlib_search_path="$newlib_search_path $func_stripname_result"
-+	    func_resolve_sysroot "$func_stripname_result"
-+	    func_append newlib_search_path " $func_resolve_sysroot_result"
- 	    ;;
- 	  prog)
- 	    if test "$pass" = conv; then
-@@ -5404,7 +6276,8 @@ func_mode_link ()
- 	      finalize_deplibs="$deplib $finalize_deplibs"
- 	    fi
- 	    func_stripname '-L' '' "$deplib"
--	    newlib_search_path="$newlib_search_path $func_stripname_result"
-+	    func_resolve_sysroot "$func_stripname_result"
-+	    func_append newlib_search_path " $func_resolve_sysroot_result"
- 	    ;;
- 	  *)
- 	    func_warning "\`-L' is ignored for archives/objects"
-@@ -5415,17 +6288,21 @@ func_mode_link ()
- 	-R*)
- 	  if test "$pass" = link; then
- 	    func_stripname '-R' '' "$deplib"
--	    dir=$func_stripname_result
-+	    func_resolve_sysroot "$func_stripname_result"
-+	    dir=$func_resolve_sysroot_result
- 	    # Make sure the xrpath contains only unique directories.
- 	    case "$xrpath " in
- 	    *" $dir "*) ;;
--	    *) xrpath="$xrpath $dir" ;;
-+	    *) func_append xrpath " $dir" ;;
- 	    esac
- 	  fi
- 	  deplibs="$deplib $deplibs"
- 	  continue
- 	  ;;
--	*.la) lib="$deplib" ;;
-+	*.la)
-+	  func_resolve_sysroot "$deplib"
-+	  lib=$func_resolve_sysroot_result
-+	  ;;
- 	*.$libext)
- 	  if test "$pass" = conv; then
- 	    deplibs="$deplib $deplibs"
-@@ -5488,11 +6365,11 @@ func_mode_link ()
- 	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- 	      # If there is no dlopen support or we're linking statically,
- 	      # we need to preload.
--	      newdlprefiles="$newdlprefiles $deplib"
-+	      func_append newdlprefiles " $deplib"
- 	      compile_deplibs="$deplib $compile_deplibs"
- 	      finalize_deplibs="$deplib $finalize_deplibs"
- 	    else
--	      newdlfiles="$newdlfiles $deplib"
-+	      func_append newdlfiles " $deplib"
- 	    fi
- 	  fi
- 	  continue
-@@ -5538,7 +6415,7 @@ func_mode_link ()
- 	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
- 	    case " $new_inherited_linker_flags " in
- 	      *" $tmp_inherited_linker_flag "*) ;;
--	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
-+	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
- 	    esac
- 	  done
- 	fi
-@@ -5546,8 +6423,8 @@ func_mode_link ()
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
--	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
--	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
-+	  test -n "$dlopen" && func_append dlfiles " $dlopen"
-+	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
- 	fi
- 
- 	if test "$pass" = conv; then
-@@ -5558,20 +6435,20 @@ func_mode_link ()
- 	      func_fatal_error "cannot find name of link library for \`$lib'"
- 	    fi
- 	    # It is a libtool convenience library, so add in its objects.
--	    convenience="$convenience $ladir/$objdir/$old_library"
--	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
-+	    func_append convenience " $ladir/$objdir/$old_library"
-+	    func_append old_convenience " $ladir/$objdir/$old_library"
- 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
- 	    func_fatal_error "\`$lib' is not a convenience library"
- 	  fi
- 	  tmp_libs=
- 	  for deplib in $dependency_libs; do
- 	    deplibs="$deplib $deplibs"
--	    if $opt_duplicate_deps ; then
-+	    if $opt_preserve_dup_deps ; then
- 	      case "$tmp_libs " in
--	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- 	      esac
- 	    fi
--	    tmp_libs="$tmp_libs $deplib"
-+	    func_append tmp_libs " $deplib"
- 	  done
- 	  continue
- 	fi # $pass = conv
-@@ -5579,9 +6456,15 @@ func_mode_link ()
- 
- 	# Get the name of the library we link against.
- 	linklib=
--	for l in $old_library $library_names; do
--	  linklib="$l"
--	done
-+	if test -n "$old_library" &&
-+	   { test "$prefer_static_libs" = yes ||
-+	     test "$prefer_static_libs,$installed" = "built,no"; }; then
-+	  linklib=$old_library
-+	else
-+	  for l in $old_library $library_names; do
-+	    linklib="$l"
-+	  done
-+	fi
- 	if test -z "$linklib"; then
- 	  func_fatal_error "cannot find name of link library for \`$lib'"
- 	fi
-@@ -5598,9 +6481,9 @@ func_mode_link ()
- 	    # statically, we need to preload.  We also need to preload any
- 	    # dependent libraries so libltdl's deplib preloader doesn't
- 	    # bomb out in the load deplibs phase.
--	    dlprefiles="$dlprefiles $lib $dependency_libs"
-+	    func_append dlprefiles " $lib $dependency_libs"
- 	  else
--	    newdlfiles="$newdlfiles $lib"
-+	    func_append newdlfiles " $lib"
- 	  fi
- 	  continue
- 	fi # $pass = dlopen
-@@ -5622,14 +6505,14 @@ func_mode_link ()
- 
- 	# Find the relevant object directory and library name.
- 	if test "X$installed" = Xyes; then
--	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-+	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- 	    func_warning "library \`$lib' was moved."
- 	    dir="$ladir"
- 	    absdir="$abs_ladir"
- 	    libdir="$abs_ladir"
- 	  else
--	    dir="$libdir"
--	    absdir="$libdir"
-+	    dir="$lt_sysroot$libdir"
-+	    absdir="$lt_sysroot$libdir"
- 	  fi
- 	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
- 	else
-@@ -5637,12 +6520,12 @@ func_mode_link ()
- 	    dir="$ladir"
- 	    absdir="$abs_ladir"
- 	    # Remove this search path later
--	    notinst_path="$notinst_path $abs_ladir"
-+	    func_append notinst_path " $abs_ladir"
- 	  else
- 	    dir="$ladir/$objdir"
- 	    absdir="$abs_ladir/$objdir"
- 	    # Remove this search path later
--	    notinst_path="$notinst_path $abs_ladir"
-+	    func_append notinst_path " $abs_ladir"
- 	  fi
- 	fi # $installed = yes
- 	func_stripname 'lib' '.la' "$laname"
-@@ -5653,20 +6536,46 @@ func_mode_link ()
- 	  if test -z "$libdir" && test "$linkmode" = prog; then
- 	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
- 	  fi
--	  # Prefer using a static library (so that no silly _DYNAMIC symbols
--	  # are required to link).
--	  if test -n "$old_library"; then
--	    newdlprefiles="$newdlprefiles $dir/$old_library"
--	    # Keep a list of preopened convenience libraries to check
--	    # that they are being used correctly in the link pass.
--	    test -z "$libdir" && \
--		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
--	  # Otherwise, use the dlname, so that lt_dlopen finds it.
--	  elif test -n "$dlname"; then
--	    newdlprefiles="$newdlprefiles $dir/$dlname"
--	  else
--	    newdlprefiles="$newdlprefiles $dir/$linklib"
--	  fi
-+	  case "$host" in
-+	    # special handling for platforms with PE-DLLs.
-+	    *cygwin* | *mingw* | *cegcc* )
-+	      # Linker will automatically link against shared library if both
-+	      # static and shared are present.  Therefore, ensure we extract
-+	      # symbols from the import library if a shared library is present
-+	      # (otherwise, the dlopen module name will be incorrect).  We do
-+	      # this by putting the import library name into $newdlprefiles.
-+	      # We recover the dlopen module name by 'saving' the la file
-+	      # name in a special purpose variable, and (later) extracting the
-+	      # dlname from the la file.
-+	      if test -n "$dlname"; then
-+	        func_tr_sh "$dir/$linklib"
-+	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
-+	        func_append newdlprefiles " $dir/$linklib"
-+	      else
-+	        func_append newdlprefiles " $dir/$old_library"
-+	        # Keep a list of preopened convenience libraries to check
-+	        # that they are being used correctly in the link pass.
-+	        test -z "$libdir" && \
-+	          func_append dlpreconveniencelibs " $dir/$old_library"
-+	      fi
-+	    ;;
-+	    * )
-+	      # Prefer using a static library (so that no silly _DYNAMIC symbols
-+	      # are required to link).
-+	      if test -n "$old_library"; then
-+	        func_append newdlprefiles " $dir/$old_library"
-+	        # Keep a list of preopened convenience libraries to check
-+	        # that they are being used correctly in the link pass.
-+	        test -z "$libdir" && \
-+	          func_append dlpreconveniencelibs " $dir/$old_library"
-+	      # Otherwise, use the dlname, so that lt_dlopen finds it.
-+	      elif test -n "$dlname"; then
-+	        func_append newdlprefiles " $dir/$dlname"
-+	      else
-+	        func_append newdlprefiles " $dir/$linklib"
-+	      fi
-+	    ;;
-+	  esac
- 	fi # $pass = dlpreopen
- 
- 	if test -z "$libdir"; then
-@@ -5684,7 +6593,7 @@ func_mode_link ()
- 
- 
- 	if test "$linkmode" = prog && test "$pass" != link; then
--	  newlib_search_path="$newlib_search_path $ladir"
-+	  func_append newlib_search_path " $ladir"
- 	  deplibs="$lib $deplibs"
- 
- 	  linkalldeplibs=no
-@@ -5697,7 +6606,8 @@ func_mode_link ()
- 	  for deplib in $dependency_libs; do
- 	    case $deplib in
- 	    -L*) func_stripname '-L' '' "$deplib"
--	         newlib_search_path="$newlib_search_path $func_stripname_result"
-+	         func_resolve_sysroot "$func_stripname_result"
-+	         func_append newlib_search_path " $func_resolve_sysroot_result"
- 		 ;;
- 	    esac
- 	    # Need to link against all dependency_libs?
-@@ -5708,12 +6618,12 @@ func_mode_link ()
- 	      # or/and link against static libraries
- 	      newdependency_libs="$deplib $newdependency_libs"
- 	    fi
--	    if $opt_duplicate_deps ; then
-+	    if $opt_preserve_dup_deps ; then
- 	      case "$tmp_libs " in
--	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- 	      esac
- 	    fi
--	    tmp_libs="$tmp_libs $deplib"
-+	    func_append tmp_libs " $deplib"
- 	  done # for deplib
- 	  continue
- 	fi # $linkmode = prog...
-@@ -5728,7 +6638,7 @@ func_mode_link ()
- 	      # Make sure the rpath contains only unique directories.
- 	      case "$temp_rpath:" in
- 	      *"$absdir:"*) ;;
--	      *) temp_rpath="$temp_rpath$absdir:" ;;
-+	      *) func_append temp_rpath "$absdir:" ;;
- 	      esac
- 	    fi
- 
-@@ -5740,7 +6650,7 @@ func_mode_link ()
- 	    *)
- 	      case "$compile_rpath " in
- 	      *" $absdir "*) ;;
--	      *) compile_rpath="$compile_rpath $absdir"
-+	      *) func_append compile_rpath " $absdir" ;;
- 	      esac
- 	      ;;
- 	    esac
-@@ -5749,7 +6659,7 @@ func_mode_link ()
- 	    *)
- 	      case "$finalize_rpath " in
- 	      *" $libdir "*) ;;
--	      *) finalize_rpath="$finalize_rpath $libdir"
-+	      *) func_append finalize_rpath " $libdir" ;;
- 	      esac
- 	      ;;
- 	    esac
-@@ -5774,12 +6684,12 @@ func_mode_link ()
- 	  case $host in
- 	  *cygwin* | *mingw* | *cegcc*)
- 	      # No point in relinking DLLs because paths are not encoded
--	      notinst_deplibs="$notinst_deplibs $lib"
-+	      func_append notinst_deplibs " $lib"
- 	      need_relink=no
- 	    ;;
- 	  *)
- 	    if test "$installed" = no; then
--	      notinst_deplibs="$notinst_deplibs $lib"
-+	      func_append notinst_deplibs " $lib"
- 	      need_relink=yes
- 	    fi
- 	    ;;
-@@ -5814,7 +6724,7 @@ func_mode_link ()
- 	    *)
- 	      case "$compile_rpath " in
- 	      *" $absdir "*) ;;
--	      *) compile_rpath="$compile_rpath $absdir"
-+	      *) func_append compile_rpath " $absdir" ;;
- 	      esac
- 	      ;;
- 	    esac
-@@ -5823,7 +6733,7 @@ func_mode_link ()
- 	    *)
- 	      case "$finalize_rpath " in
- 	      *" $libdir "*) ;;
--	      *) finalize_rpath="$finalize_rpath $libdir"
-+	      *) func_append finalize_rpath " $libdir" ;;
- 	      esac
- 	      ;;
- 	    esac
-@@ -5835,7 +6745,7 @@ func_mode_link ()
- 	    shift
- 	    realname="$1"
- 	    shift
--	    eval "libname=\"$libname_spec\""
-+	    libname=`eval "\\$ECHO \"$libname_spec\""`
- 	    # use dlname if we got it. it's perfectly good, no?
- 	    if test -n "$dlname"; then
- 	      soname="$dlname"
-@@ -5848,7 +6758,7 @@ func_mode_link ()
- 		versuffix="-$major"
- 		;;
- 	      esac
--	      eval "soname=\"$soname_spec\""
-+	      eval soname=\"$soname_spec\"
- 	    else
- 	      soname="$realname"
- 	    fi
-@@ -5877,7 +6787,7 @@ func_mode_link ()
- 	    linklib=$newlib
- 	  fi # test -n "$old_archive_from_expsyms_cmds"
- 
--	  if test "$linkmode" = prog || test "$mode" != relink; then
-+	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
- 	    add_shlibpath=
- 	    add_dir=
- 	    add=
-@@ -5933,7 +6843,7 @@ func_mode_link ()
- 		if test -n "$inst_prefix_dir"; then
- 		  case $libdir in
- 		    [\\/]*)
--		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
-+		      func_append add_dir " -L$inst_prefix_dir$libdir"
- 		      ;;
- 		  esac
- 		fi
-@@ -5955,7 +6865,7 @@ func_mode_link ()
- 	    if test -n "$add_shlibpath"; then
- 	      case :$compile_shlibpath: in
- 	      *":$add_shlibpath:"*) ;;
--	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
-+	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
- 	      esac
- 	    fi
- 	    if test "$linkmode" = prog; then
-@@ -5969,13 +6879,13 @@ func_mode_link ()
- 		 test "$hardcode_shlibpath_var" = yes; then
- 		case :$finalize_shlibpath: in
- 		*":$libdir:"*) ;;
--		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
-+		*) func_append finalize_shlibpath "$libdir:" ;;
- 		esac
- 	      fi
- 	    fi
- 	  fi
- 
--	  if test "$linkmode" = prog || test "$mode" = relink; then
-+	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
- 	    add_shlibpath=
- 	    add_dir=
- 	    add=
-@@ -5989,7 +6899,7 @@ func_mode_link ()
- 	    elif test "$hardcode_shlibpath_var" = yes; then
- 	      case :$finalize_shlibpath: in
- 	      *":$libdir:"*) ;;
--	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
-+	      *) func_append finalize_shlibpath "$libdir:" ;;
- 	      esac
- 	      add="-l$name"
- 	    elif test "$hardcode_automatic" = yes; then
-@@ -6001,12 +6911,12 @@ func_mode_link ()
- 	      fi
- 	    else
- 	      # We cannot seem to hardcode it, guess we'll fake it.
--	      add_dir="-L$libdir"
-+	      add_dir="-L$lt_sysroot$libdir"
- 	      # Try looking first in the location we're being installed to.
- 	      if test -n "$inst_prefix_dir"; then
- 		case $libdir in
- 		  [\\/]*)
--		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
-+		    func_append add_dir " -L$inst_prefix_dir$libdir"
- 		    ;;
- 		esac
- 	      fi
-@@ -6083,27 +6993,33 @@ func_mode_link ()
- 	           temp_xrpath=$func_stripname_result
- 		   case " $xrpath " in
- 		   *" $temp_xrpath "*) ;;
--		   *) xrpath="$xrpath $temp_xrpath";;
-+		   *) func_append xrpath " $temp_xrpath";;
- 		   esac;;
--	      *) temp_deplibs="$temp_deplibs $libdir";;
-+	      *) func_append temp_deplibs " $libdir";;
- 	      esac
- 	    done
- 	    dependency_libs="$temp_deplibs"
- 	  fi
- 
--	  newlib_search_path="$newlib_search_path $absdir"
-+	  func_append newlib_search_path " $absdir"
- 	  # Link against this library
- 	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
- 	  # ... and its dependency_libs
- 	  tmp_libs=
- 	  for deplib in $dependency_libs; do
- 	    newdependency_libs="$deplib $newdependency_libs"
--	    if $opt_duplicate_deps ; then
-+	    case $deplib in
-+              -L*) func_stripname '-L' '' "$deplib"
-+                   func_resolve_sysroot "$func_stripname_result";;
-+              *) func_resolve_sysroot "$deplib" ;;
-+            esac
-+	    if $opt_preserve_dup_deps ; then
- 	      case "$tmp_libs " in
--	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-+	      *" $func_resolve_sysroot_result "*)
-+                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
- 	      esac
- 	    fi
--	    tmp_libs="$tmp_libs $deplib"
-+	    func_append tmp_libs " $func_resolve_sysroot_result"
- 	  done
- 
- 	  if test "$link_all_deplibs" != no; then
-@@ -6113,8 +7029,10 @@ func_mode_link ()
- 	      case $deplib in
- 	      -L*) path="$deplib" ;;
- 	      *.la)
-+	        func_resolve_sysroot "$deplib"
-+	        deplib=$func_resolve_sysroot_result
- 	        func_dirname "$deplib" "" "."
--		dir="$func_dirname_result"
-+		dir=$func_dirname_result
- 		# We need an absolute path.
- 		case $dir in
- 		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
-@@ -6130,7 +7048,7 @@ func_mode_link ()
- 		case $host in
- 		*-*-darwin*)
- 		  depdepl=
--		  deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- 		  if test -n "$deplibrary_names" ; then
- 		    for tmp in $deplibrary_names ; do
- 		      depdepl=$tmp
-@@ -6141,8 +7059,8 @@ func_mode_link ()
-                       if test -z "$darwin_install_name"; then
-                           darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
-                       fi
--		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
--		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
-+		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-+		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
- 		      path=
- 		    fi
- 		  fi
-@@ -6152,7 +7070,7 @@ func_mode_link ()
- 		  ;;
- 		esac
- 		else
--		  libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- 		  test -z "$libdir" && \
- 		    func_fatal_error "\`$deplib' is not a valid libtool archive"
- 		  test "$absdir" != "$libdir" && \
-@@ -6192,7 +7110,7 @@ func_mode_link ()
- 	  for dir in $newlib_search_path; do
- 	    case "$lib_search_path " in
- 	    *" $dir "*) ;;
--	    *) lib_search_path="$lib_search_path $dir" ;;
-+	    *) func_append lib_search_path " $dir" ;;
- 	    esac
- 	  done
- 	  newlib_search_path=
-@@ -6205,7 +7123,7 @@ func_mode_link ()
- 	fi
- 	for var in $vars dependency_libs; do
- 	  # Add libraries to $var in reverse order
--	  eval tmp_libs=\$$var
-+	  eval tmp_libs=\"\$$var\"
- 	  new_libs=
- 	  for deplib in $tmp_libs; do
- 	    # FIXME: Pedantically, this is the right thing to do, so
-@@ -6250,13 +7168,13 @@ func_mode_link ()
- 	    -L*)
- 	      case " $tmp_libs " in
- 	      *" $deplib "*) ;;
--	      *) tmp_libs="$tmp_libs $deplib" ;;
-+	      *) func_append tmp_libs " $deplib" ;;
- 	      esac
- 	      ;;
--	    *) tmp_libs="$tmp_libs $deplib" ;;
-+	    *) func_append tmp_libs " $deplib" ;;
- 	    esac
- 	  done
--	  eval $var=\$tmp_libs
-+	  eval $var=\"$tmp_libs\"
- 	done # for var
-       fi
-       # Last step: remove runtime libs from dependency_libs
-@@ -6269,7 +7187,7 @@ func_mode_link ()
- 	  ;;
- 	esac
- 	if test -n "$i" ; then
--	  tmp_libs="$tmp_libs $i"
-+	  func_append tmp_libs " $i"
- 	fi
-       done
-       dependency_libs=$tmp_libs
-@@ -6310,7 +7228,7 @@ func_mode_link ()
-       # Now set the variables for building old libraries.
-       build_libtool_libs=no
-       oldlibs="$output"
--      objs="$objs$old_deplibs"
-+      func_append objs "$old_deplibs"
-       ;;
- 
-     lib)
-@@ -6319,8 +7237,8 @@ func_mode_link ()
-       lib*)
- 	func_stripname 'lib' '.la' "$outputname"
- 	name=$func_stripname_result
--	eval "shared_ext=\"$shrext_cmds\""
--	eval "libname=\"$libname_spec\""
-+	eval shared_ext=\"$shrext_cmds\"
-+	eval libname=\"$libname_spec\"
- 	;;
-       *)
- 	test "$module" = no && \
-@@ -6330,8 +7248,8 @@ func_mode_link ()
- 	  # Add the "lib" prefix for modules if required
- 	  func_stripname '' '.la' "$outputname"
- 	  name=$func_stripname_result
--	  eval "shared_ext=\"$shrext_cmds\""
--	  eval "libname=\"$libname_spec\""
-+	  eval shared_ext=\"$shrext_cmds\"
-+	  eval libname=\"$libname_spec\"
- 	else
- 	  func_stripname '' '.la' "$outputname"
- 	  libname=$func_stripname_result
-@@ -6346,7 +7264,7 @@ func_mode_link ()
- 	  echo
- 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- 	  $ECHO "*** objects $objs is not portable!"
--	  libobjs="$libobjs $objs"
-+	  func_append libobjs " $objs"
- 	fi
-       fi
- 
-@@ -6544,7 +7462,7 @@ func_mode_link ()
- 	  done
- 
- 	  # Make executables depend on our current version.
--	  verstring="$verstring:${current}.0"
-+	  func_append verstring ":${current}.0"
- 	  ;;
- 
- 	qnx)
-@@ -6612,10 +7530,10 @@ func_mode_link ()
-       fi
- 
-       func_generate_dlsyms "$libname" "$libname" "yes"
--      libobjs="$libobjs $symfileobj"
-+      func_append libobjs " $symfileobj"
-       test "X$libobjs" = "X " && libobjs=
- 
--      if test "$mode" != relink; then
-+      if test "$opt_mode" != relink; then
- 	# Remove our outputs, but don't remove object files since they
- 	# may have been created when compiling PIC objects.
- 	removelist=
-@@ -6631,7 +7549,7 @@ func_mode_link ()
- 		   continue
- 		 fi
- 	       fi
--	       removelist="$removelist $p"
-+	       func_append removelist " $p"
- 	       ;;
- 	    *) ;;
- 	  esac
-@@ -6642,7 +7560,7 @@ func_mode_link ()
- 
-       # Now set the variables for building old libraries.
-       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
--	oldlibs="$oldlibs $output_objdir/$libname.$libext"
-+	func_append oldlibs " $output_objdir/$libname.$libext"
- 
- 	# Transform .lo files to .o files.
- 	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
-@@ -6659,10 +7577,11 @@ func_mode_link ()
- 	# If the user specified any rpath flags, then add them.
- 	temp_xrpath=
- 	for libdir in $xrpath; do
--	  temp_xrpath="$temp_xrpath -R$libdir"
-+	  func_replace_sysroot "$libdir"
-+	  func_append temp_xrpath " -R$func_replace_sysroot_result"
- 	  case "$finalize_rpath " in
- 	  *" $libdir "*) ;;
--	  *) finalize_rpath="$finalize_rpath $libdir" ;;
-+	  *) func_append finalize_rpath " $libdir" ;;
- 	  esac
- 	done
- 	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
-@@ -6676,7 +7595,7 @@ func_mode_link ()
-       for lib in $old_dlfiles; do
- 	case " $dlprefiles $dlfiles " in
- 	*" $lib "*) ;;
--	*) dlfiles="$dlfiles $lib" ;;
-+	*) func_append dlfiles " $lib" ;;
- 	esac
-       done
- 
-@@ -6686,7 +7605,7 @@ func_mode_link ()
-       for lib in $old_dlprefiles; do
- 	case "$dlprefiles " in
- 	*" $lib "*) ;;
--	*) dlprefiles="$dlprefiles $lib" ;;
-+	*) func_append dlprefiles " $lib" ;;
- 	esac
-       done
- 
-@@ -6698,7 +7617,7 @@ func_mode_link ()
- 	    ;;
- 	  *-*-rhapsody* | *-*-darwin1.[012])
- 	    # Rhapsody C library is in the System framework
--	    deplibs="$deplibs System.ltframework"
-+	    func_append deplibs " System.ltframework"
- 	    ;;
- 	  *-*-netbsd*)
- 	    # Don't link with libc until the a.out ld.so is fixed.
-@@ -6715,7 +7634,7 @@ func_mode_link ()
- 	  *)
- 	    # Add libc to deplibs on all other systems if necessary.
- 	    if test "$build_libtool_need_lc" = "yes"; then
--	      deplibs="$deplibs -lc"
-+	      func_append deplibs " -lc"
- 	    fi
- 	    ;;
- 	  esac
-@@ -6764,18 +7683,18 @@ EOF
- 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- 		  case " $predeps $postdeps " in
- 		  *" $i "*)
--		    newdeplibs="$newdeplibs $i"
-+		    func_append newdeplibs " $i"
- 		    i=""
- 		    ;;
- 		  esac
- 		fi
- 		if test -n "$i" ; then
--		  eval "libname=\"$libname_spec\""
--		  eval "deplib_matches=\"$library_names_spec\""
-+		  libname=`eval "\\$ECHO \"$libname_spec\""`
-+		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- 		  set dummy $deplib_matches; shift
- 		  deplib_match=$1
- 		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
--		    newdeplibs="$newdeplibs $i"
-+		    func_append newdeplibs " $i"
- 		  else
- 		    droppeddeps=yes
- 		    echo
-@@ -6789,7 +7708,7 @@ EOF
- 		fi
- 		;;
- 	      *)
--		newdeplibs="$newdeplibs $i"
-+		func_append newdeplibs " $i"
- 		;;
- 	      esac
- 	    done
-@@ -6807,18 +7726,18 @@ EOF
- 		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- 		    case " $predeps $postdeps " in
- 		    *" $i "*)
--		      newdeplibs="$newdeplibs $i"
-+		      func_append newdeplibs " $i"
- 		      i=""
- 		      ;;
- 		    esac
- 		  fi
- 		  if test -n "$i" ; then
--		    eval "libname=\"$libname_spec\""
--		    eval "deplib_matches=\"$library_names_spec\""
-+		    libname=`eval "\\$ECHO \"$libname_spec\""`
-+		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- 		    set dummy $deplib_matches; shift
- 		    deplib_match=$1
- 		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
--		      newdeplibs="$newdeplibs $i"
-+		      func_append newdeplibs " $i"
- 		    else
- 		      droppeddeps=yes
- 		      echo
-@@ -6840,7 +7759,7 @@ EOF
- 		fi
- 		;;
- 	      *)
--		newdeplibs="$newdeplibs $i"
-+		func_append newdeplibs " $i"
- 		;;
- 	      esac
- 	    done
-@@ -6857,15 +7776,27 @@ EOF
- 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- 		case " $predeps $postdeps " in
- 		*" $a_deplib "*)
--		  newdeplibs="$newdeplibs $a_deplib"
-+		  func_append newdeplibs " $a_deplib"
- 		  a_deplib=""
- 		  ;;
- 		esac
- 	      fi
- 	      if test -n "$a_deplib" ; then
--		eval "libname=\"$libname_spec\""
-+		libname=`eval "\\$ECHO \"$libname_spec\""`
-+		if test -n "$file_magic_glob"; then
-+		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
-+		else
-+		  libnameglob=$libname
-+		fi
-+		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
- 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
--		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-+		  if test "$want_nocaseglob" = yes; then
-+		    shopt -s nocaseglob
-+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-+		    $nocaseglob
-+		  else
-+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-+		  fi
- 		  for potent_lib in $potential_libs; do
- 		      # Follow soft links.
- 		      if ls -lLd "$potent_lib" 2>/dev/null |
-@@ -6885,10 +7816,10 @@ EOF
- 			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
- 			esac
- 		      done
--		      if eval "$file_magic_cmd \"\$potlib\"" 2>/dev/null |
-+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
- 			 $SED -e 10q |
- 			 $EGREP "$file_magic_regex" > /dev/null; then
--			newdeplibs="$newdeplibs $a_deplib"
-+			func_append newdeplibs " $a_deplib"
- 			a_deplib=""
- 			break 2
- 		      fi
-@@ -6913,7 +7844,7 @@ EOF
- 	      ;;
- 	    *)
- 	      # Add a -L argument.
--	      newdeplibs="$newdeplibs $a_deplib"
-+	      func_append newdeplibs " $a_deplib"
- 	      ;;
- 	    esac
- 	  done # Gone through all deplibs.
-@@ -6929,20 +7860,20 @@ EOF
- 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- 		case " $predeps $postdeps " in
- 		*" $a_deplib "*)
--		  newdeplibs="$newdeplibs $a_deplib"
-+		  func_append newdeplibs " $a_deplib"
- 		  a_deplib=""
- 		  ;;
- 		esac
- 	      fi
- 	      if test -n "$a_deplib" ; then
--		eval "libname=\"$libname_spec\""
-+		libname=`eval "\\$ECHO \"$libname_spec\""`
- 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- 		  for potent_lib in $potential_libs; do
- 		    potlib="$potent_lib" # see symlink-check above in file_magic test
- 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
- 		       $EGREP "$match_pattern_regex" > /dev/null; then
--		      newdeplibs="$newdeplibs $a_deplib"
-+		      func_append newdeplibs " $a_deplib"
- 		      a_deplib=""
- 		      break 2
- 		    fi
-@@ -6967,7 +7898,7 @@ EOF
- 	      ;;
- 	    *)
- 	      # Add a -L argument.
--	      newdeplibs="$newdeplibs $a_deplib"
-+	      func_append newdeplibs " $a_deplib"
- 	      ;;
- 	    esac
- 	  done # Gone through all deplibs.
-@@ -7071,7 +8002,7 @@ EOF
- 	*)
- 	  case " $deplibs " in
- 	  *" -L$path/$objdir "*)
--	    new_libs="$new_libs -L$path/$objdir" ;;
-+	    func_append new_libs " -L$path/$objdir" ;;
- 	  esac
- 	  ;;
- 	esac
-@@ -7081,10 +8012,10 @@ EOF
- 	-L*)
- 	  case " $new_libs " in
- 	  *" $deplib "*) ;;
--	  *) new_libs="$new_libs $deplib" ;;
-+	  *) func_append new_libs " $deplib" ;;
- 	  esac
- 	  ;;
--	*) new_libs="$new_libs $deplib" ;;
-+	*) func_append new_libs " $deplib" ;;
- 	esac
-       done
-       deplibs="$new_libs"
-@@ -7101,10 +8032,12 @@ EOF
- 	  hardcode_libdirs=
- 	  dep_rpath=
- 	  rpath="$finalize_rpath"
--	  test "$mode" != relink && rpath="$compile_rpath$rpath"
-+	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
- 	  for libdir in $rpath; do
- 	    if test -n "$hardcode_libdir_flag_spec"; then
- 	      if test -n "$hardcode_libdir_separator"; then
-+		func_replace_sysroot "$libdir"
-+		libdir=$func_replace_sysroot_result
- 		if test -z "$hardcode_libdirs"; then
- 		  hardcode_libdirs="$libdir"
- 		else
-@@ -7113,18 +8046,18 @@ EOF
- 		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- 		    ;;
- 		  *)
--		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-+		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- 		    ;;
- 		  esac
- 		fi
- 	      else
--		eval "flag=\"$hardcode_libdir_flag_spec\""
--		dep_rpath="$dep_rpath $flag"
-+		eval flag=\"$hardcode_libdir_flag_spec\"
-+		func_append dep_rpath " $flag"
- 	      fi
- 	    elif test -n "$runpath_var"; then
- 	      case "$perm_rpath " in
- 	      *" $libdir "*) ;;
--	      *) perm_rpath="$perm_rpath $libdir" ;;
-+	      *) func_append perm_rpath " $libdir" ;;
- 	      esac
- 	    fi
- 	  done
-@@ -7133,40 +8066,38 @@ EOF
- 	     test -n "$hardcode_libdirs"; then
- 	    libdir="$hardcode_libdirs"
- 	    if test -n "$hardcode_libdir_flag_spec_ld"; then
--	      eval "dep_rpath=\"$hardcode_libdir_flag_spec_ld\""
-+	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
- 	    else
--	      eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
-+	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
- 	    fi
- 	  fi
- 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
- 	    # We should set the runpath_var.
- 	    rpath=
- 	    for dir in $perm_rpath; do
--	      rpath="$rpath$dir:"
-+	      func_append rpath "$dir:"
- 	    done
--	    eval $runpath_var=\$rpath\$$runpath_var
--	    export $runpath_var
-+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
- 	  fi
- 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
- 	fi
- 
- 	shlibpath="$finalize_shlibpath"
--	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
-+	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
- 	if test -n "$shlibpath"; then
--	  eval $shlibpath_var=\$shlibpath\$$shlibpath_var
--	  export $shlibpath_var
-+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- 	fi
- 
- 	# Get the real and link names of the library.
--	eval "shared_ext=\"$shrext_cmds\""
--	eval "library_names=\"$library_names_spec\""
-+	eval shared_ext=\"$shrext_cmds\"
-+	eval library_names=\"$library_names_spec\"
- 	set dummy $library_names
- 	shift
- 	realname="$1"
- 	shift
- 
- 	if test -n "$soname_spec"; then
--	  eval "soname=\"$soname_spec\""
-+	  eval soname=\"$soname_spec\"
- 	else
- 	  soname="$realname"
- 	fi
-@@ -7178,7 +8109,7 @@ EOF
- 	linknames=
- 	for link
- 	do
--	  linknames="$linknames $link"
-+	  func_append linknames " $link"
- 	done
- 
- 	# Use standard objects if they are pic
-@@ -7189,7 +8120,7 @@ EOF
- 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
- 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
- 	  export_symbols="$output_objdir/$libname.uexp"
--	  delfiles="$delfiles $export_symbols"
-+	  func_append delfiles " $export_symbols"
- 	fi
- 
- 	orig_export_symbols=
-@@ -7220,13 +8151,45 @@ EOF
- 	    $opt_dry_run || $RM $export_symbols
- 	    cmds=$export_symbols_cmds
- 	    save_ifs="$IFS"; IFS='~'
--	    for cmd in $cmds; do
-+	    for cmd1 in $cmds; do
- 	      IFS="$save_ifs"
--	      eval "cmd=\"$cmd\""
--	      func_len " $cmd"
--	      len=$func_len_result
--	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-+	      # Take the normal branch if the nm_file_list_spec branch
-+	      # doesn't work or if tool conversion is not needed.
-+	      case $nm_file_list_spec~$to_tool_file_cmd in
-+		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
-+		  try_normal_branch=yes
-+		  eval cmd=\"$cmd1\"
-+		  func_len " $cmd"
-+		  len=$func_len_result
-+		  ;;
-+		*)
-+		  try_normal_branch=no
-+		  ;;
-+	      esac
-+	      if test "$try_normal_branch" = yes \
-+		 && { test "$len" -lt "$max_cmd_len" \
-+		      || test "$max_cmd_len" -le -1; }
-+	      then
-+		func_show_eval "$cmd" 'exit $?'
-+		skipped_export=false
-+	      elif test -n "$nm_file_list_spec"; then
-+		func_basename "$output"
-+		output_la=$func_basename_result
-+		save_libobjs=$libobjs
-+		save_output=$output
-+		output=${output_objdir}/${output_la}.nm
-+		func_to_tool_file "$output"
-+		libobjs=$nm_file_list_spec$func_to_tool_file_result
-+		func_append delfiles " $output"
-+		func_verbose "creating $NM input file list: $output"
-+		for obj in $save_libobjs; do
-+		  func_to_tool_file "$obj"
-+		  $ECHO "$func_to_tool_file_result"
-+		done > "$output"
-+		eval cmd=\"$cmd1\"
- 		func_show_eval "$cmd" 'exit $?'
-+		output=$save_output
-+		libobjs=$save_libobjs
- 		skipped_export=false
- 	      else
- 		# The command line is too long to execute in one step.
-@@ -7248,7 +8211,7 @@ EOF
- 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
- 	  tmp_export_symbols="$export_symbols"
- 	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
--	  $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
-+	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
- 	fi
- 
- 	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
-@@ -7260,7 +8223,7 @@ EOF
- 	  # global variables. join(1) would be nice here, but unfortunately
- 	  # isn't a blessed tool.
- 	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
--	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
-+	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
- 	  export_symbols=$output_objdir/$libname.def
- 	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- 	fi
-@@ -7270,7 +8233,7 @@ EOF
- 	  case " $convenience " in
- 	  *" $test_deplib "*) ;;
- 	  *)
--	    tmp_deplibs="$tmp_deplibs $test_deplib"
-+	    func_append tmp_deplibs " $test_deplib"
- 	    ;;
- 	  esac
- 	done
-@@ -7286,43 +8249,43 @@ EOF
- 	  fi
- 	  if test -n "$whole_archive_flag_spec"; then
- 	    save_libobjs=$libobjs
--	    eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
-+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- 	    test "X$libobjs" = "X " && libobjs=
- 	  else
- 	    gentop="$output_objdir/${outputname}x"
--	    generated="$generated $gentop"
-+	    func_append generated " $gentop"
- 
- 	    func_extract_archives $gentop $convenience
--	    libobjs="$libobjs $func_extract_archives_result"
-+	    func_append libobjs " $func_extract_archives_result"
- 	    test "X$libobjs" = "X " && libobjs=
- 	  fi
- 	fi
- 
- 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
--	  eval "flag=\"$thread_safe_flag_spec\""
--	  linker_flags="$linker_flags $flag"
-+	  eval flag=\"$thread_safe_flag_spec\"
-+	  func_append linker_flags " $flag"
- 	fi
- 
- 	# Make a backup of the uninstalled library when relinking
--	if test "$mode" = relink; then
--	  $opt_dry_run || (cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U) || exit $?
-+	if test "$opt_mode" = relink; then
-+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
- 	fi
- 
- 	# Do each of the archive commands.
- 	if test "$module" = yes && test -n "$module_cmds" ; then
- 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
--	    eval "test_cmds=\"$module_expsym_cmds\""
-+	    eval test_cmds=\"$module_expsym_cmds\"
- 	    cmds=$module_expsym_cmds
- 	  else
--	    eval "test_cmds=\"$module_cmds\""
-+	    eval test_cmds=\"$module_cmds\"
- 	    cmds=$module_cmds
- 	  fi
- 	else
- 	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
--	    eval "test_cmds=\"$archive_expsym_cmds\""
-+	    eval test_cmds=\"$archive_expsym_cmds\"
- 	    cmds=$archive_expsym_cmds
- 	  else
--	    eval "test_cmds=\"$archive_cmds\""
-+	    eval test_cmds=\"$archive_cmds\"
- 	    cmds=$archive_cmds
- 	  fi
- 	fi
-@@ -7366,10 +8329,13 @@ EOF
- 	    echo 'INPUT (' > $output
- 	    for obj in $save_libobjs
- 	    do
--	      $ECHO "$obj" >> $output
-+	      func_to_tool_file "$obj"
-+	      $ECHO "$func_to_tool_file_result" >> $output
- 	    done
- 	    echo ')' >> $output
--	    delfiles="$delfiles $output"
-+	    func_append delfiles " $output"
-+	    func_to_tool_file "$output"
-+	    output=$func_to_tool_file_result
- 	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
- 	    output=${output_objdir}/${output_la}.lnk
- 	    func_verbose "creating linker input file list: $output"
-@@ -7383,15 +8349,17 @@ EOF
- 	    fi
- 	    for obj
- 	    do
--	      $ECHO "$obj" >> $output
-+	      func_to_tool_file "$obj"
-+	      $ECHO "$func_to_tool_file_result" >> $output
- 	    done
--	    delfiles="$delfiles $output"
--	    output=$firstobj\"$file_list_spec$output\"
-+	    func_append delfiles " $output"
-+	    func_to_tool_file "$output"
-+	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
- 	  else
- 	    if test -n "$save_libobjs"; then
- 	      func_verbose "creating reloadable object files..."
- 	      output=$output_objdir/$output_la-${k}.$objext
--	      eval "test_cmds=\"$reload_cmds\""
-+	      eval test_cmds=\"$reload_cmds\"
- 	      func_len " $test_cmds"
- 	      len0=$func_len_result
- 	      len=$len0
-@@ -7411,12 +8379,12 @@ EOF
- 		  if test "$k" -eq 1 ; then
- 		    # The first file doesn't have a previous command to add.
- 		    reload_objs=$objlist
--		    eval "concat_cmds=\"$reload_cmds\""
-+		    eval concat_cmds=\"$reload_cmds\"
- 		  else
- 		    # All subsequent reloadable object files will link in
- 		    # the last one created.
- 		    reload_objs="$objlist $last_robj"
--		    eval "concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\""
-+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
- 		  fi
- 		  last_robj=$output_objdir/$output_la-${k}.$objext
- 		  func_arith $k + 1
-@@ -7433,11 +8401,11 @@ EOF
- 	      # files will link in the last one created.
- 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- 	      reload_objs="$objlist $last_robj"
--	      eval "concat_cmds=\"\${concat_cmds}$reload_cmds\""
-+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
- 	      if test -n "$last_robj"; then
--	        eval "concat_cmds=\"\${concat_cmds}~\$RM $last_robj\""
-+	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
- 	      fi
--	      delfiles="$delfiles $output"
-+	      func_append delfiles " $output"
- 
- 	    else
- 	      output=
-@@ -7450,9 +8418,9 @@ EOF
- 	      libobjs=$output
- 	      # Append the command to create the export file.
- 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
--	      eval "concat_cmds=\"\$concat_cmds$export_symbols_cmds\""
-+	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
- 	      if test -n "$last_robj"; then
--		eval "concat_cmds=\"\$concat_cmds~\$RM $last_robj\""
-+		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
- 	      fi
- 	    fi
- 
-@@ -7471,7 +8439,7 @@ EOF
- 		lt_exit=$?
- 
- 		# Restore the uninstalled library and exit
--		if test "$mode" = relink; then
-+		if test "$opt_mode" = relink; then
- 		  ( cd "$output_objdir" && \
- 		    $RM "${realname}T" && \
- 		    $MV "${realname}U" "$realname" )
-@@ -7492,7 +8460,7 @@ EOF
- 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
- 	      tmp_export_symbols="$export_symbols"
- 	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
--	      $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
-+	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
- 	    fi
- 
- 	    if test -n "$orig_export_symbols"; then
-@@ -7504,7 +8472,7 @@ EOF
- 	      # global variables. join(1) would be nice here, but unfortunately
- 	      # isn't a blessed tool.
- 	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
--	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
-+	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
- 	      export_symbols=$output_objdir/$libname.def
- 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- 	    fi
-@@ -7515,7 +8483,7 @@ EOF
- 	  output=$save_output
- 
- 	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
--	    eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
-+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- 	    test "X$libobjs" = "X " && libobjs=
- 	  fi
- 	  # Expand the library linking commands again to reset the
-@@ -7539,23 +8507,23 @@ EOF
- 
- 	if test -n "$delfiles"; then
- 	  # Append the command to remove temporary files to $cmds.
--	  eval "cmds=\"\$cmds~\$RM $delfiles\""
-+	  eval cmds=\"\$cmds~\$RM $delfiles\"
- 	fi
- 
- 	# Add any objects from preloaded convenience libraries
- 	if test -n "$dlprefiles"; then
- 	  gentop="$output_objdir/${outputname}x"
--	  generated="$generated $gentop"
-+	  func_append generated " $gentop"
- 
- 	  func_extract_archives $gentop $dlprefiles
--	  libobjs="$libobjs $func_extract_archives_result"
-+	  func_append libobjs " $func_extract_archives_result"
- 	  test "X$libobjs" = "X " && libobjs=
- 	fi
- 
- 	save_ifs="$IFS"; IFS='~'
- 	for cmd in $cmds; do
- 	  IFS="$save_ifs"
--	  eval "cmd=\"$cmd\""
-+	  eval cmd=\"$cmd\"
- 	  $opt_silent || {
- 	    func_quote_for_expand "$cmd"
- 	    eval "func_echo $func_quote_for_expand_result"
-@@ -7564,7 +8532,7 @@ EOF
- 	    lt_exit=$?
- 
- 	    # Restore the uninstalled library and exit
--	    if test "$mode" = relink; then
-+	    if test "$opt_mode" = relink; then
- 	      ( cd "$output_objdir" && \
- 	        $RM "${realname}T" && \
- 		$MV "${realname}U" "$realname" )
-@@ -7576,8 +8544,8 @@ EOF
- 	IFS="$save_ifs"
- 
- 	# Restore the uninstalled library and exit
--	if test "$mode" = relink; then
--	  $opt_dry_run || (cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname) || exit $?
-+	if test "$opt_mode" = relink; then
-+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
- 
- 	  if test -n "$convenience"; then
- 	    if test -z "$whole_archive_flag_spec"; then
-@@ -7656,17 +8624,20 @@ EOF
- 
-       if test -n "$convenience"; then
- 	if test -n "$whole_archive_flag_spec"; then
--	  eval "tmp_whole_archive_flags=\"$whole_archive_flag_spec\""
-+	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- 	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
- 	else
- 	  gentop="$output_objdir/${obj}x"
--	  generated="$generated $gentop"
-+	  func_append generated " $gentop"
- 
- 	  func_extract_archives $gentop $convenience
- 	  reload_conv_objs="$reload_objs $func_extract_archives_result"
- 	fi
-       fi
- 
-+      # If we're not building shared, we need to use non_pic_objs
-+      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
-+
-       # Create the old-style object.
-       reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
- 
-@@ -7690,7 +8661,7 @@ EOF
- 	# Create an invalid libtool object if no PIC, so that we don't
- 	# accidentally link it into a program.
- 	# $show "echo timestamp > $libobj"
--	# $opt_dry_run || echo timestamp > $libobj || exit $?
-+	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
- 	exit $EXIT_SUCCESS
-       fi
- 
-@@ -7740,8 +8711,8 @@ EOF
- 	if test "$tagname" = CXX ; then
- 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
- 	    10.[0123])
--	      compile_command="$compile_command ${wl}-bind_at_load"
--	      finalize_command="$finalize_command ${wl}-bind_at_load"
-+	      func_append compile_command " ${wl}-bind_at_load"
-+	      func_append finalize_command " ${wl}-bind_at_load"
- 	    ;;
- 	  esac
- 	fi
-@@ -7761,7 +8732,7 @@ EOF
- 	*)
- 	  case " $compile_deplibs " in
- 	  *" -L$path/$objdir "*)
--	    new_libs="$new_libs -L$path/$objdir" ;;
-+	    func_append new_libs " -L$path/$objdir" ;;
- 	  esac
- 	  ;;
- 	esac
-@@ -7771,17 +8742,17 @@ EOF
- 	-L*)
- 	  case " $new_libs " in
- 	  *" $deplib "*) ;;
--	  *) new_libs="$new_libs $deplib" ;;
-+	  *) func_append new_libs " $deplib" ;;
- 	  esac
- 	  ;;
--	*) new_libs="$new_libs $deplib" ;;
-+	*) func_append new_libs " $deplib" ;;
- 	esac
-       done
-       compile_deplibs="$new_libs"
- 
- 
--      compile_command="$compile_command $compile_deplibs"
--      finalize_command="$finalize_command $finalize_deplibs"
-+      func_append compile_command " $compile_deplibs"
-+      func_append finalize_command " $finalize_deplibs"
- 
-       if test -n "$rpath$xrpath"; then
- 	# If the user specified any rpath flags, then add them.
-@@ -7789,7 +8760,7 @@ EOF
- 	  # This is the magic to use -rpath.
- 	  case "$finalize_rpath " in
- 	  *" $libdir "*) ;;
--	  *) finalize_rpath="$finalize_rpath $libdir" ;;
-+	  *) func_append finalize_rpath " $libdir" ;;
- 	  esac
- 	done
-       fi
-@@ -7808,18 +8779,18 @@ EOF
- 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- 		;;
- 	      *)
--		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- 		;;
- 	      esac
- 	    fi
- 	  else
--	    eval "flag=\"$hardcode_libdir_flag_spec\""
--	    rpath="$rpath $flag"
-+	    eval flag=\"$hardcode_libdir_flag_spec\"
-+	    func_append rpath " $flag"
- 	  fi
- 	elif test -n "$runpath_var"; then
- 	  case "$perm_rpath " in
- 	  *" $libdir "*) ;;
--	  *) perm_rpath="$perm_rpath $libdir" ;;
-+	  *) func_append perm_rpath " $libdir" ;;
- 	  esac
- 	fi
- 	case $host in
-@@ -7828,12 +8799,12 @@ EOF
- 	  case :$dllsearchpath: in
- 	  *":$libdir:"*) ;;
- 	  ::) dllsearchpath=$libdir;;
--	  *) dllsearchpath="$dllsearchpath:$libdir";;
-+	  *) func_append dllsearchpath ":$libdir";;
- 	  esac
- 	  case :$dllsearchpath: in
- 	  *":$testbindir:"*) ;;
- 	  ::) dllsearchpath=$testbindir;;
--	  *) dllsearchpath="$dllsearchpath:$testbindir";;
-+	  *) func_append dllsearchpath ":$testbindir";;
- 	  esac
- 	  ;;
- 	esac
-@@ -7842,7 +8813,7 @@ EOF
-       if test -n "$hardcode_libdir_separator" &&
- 	 test -n "$hardcode_libdirs"; then
- 	libdir="$hardcode_libdirs"
--	eval "rpath=\" $hardcode_libdir_flag_spec\""
-+	eval rpath=\" $hardcode_libdir_flag_spec\"
-       fi
-       compile_rpath="$rpath"
- 
-@@ -7859,18 +8830,18 @@ EOF
- 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- 		;;
- 	      *)
--		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- 		;;
- 	      esac
- 	    fi
- 	  else
--	    eval "flag=\"$hardcode_libdir_flag_spec\""
--	    rpath="$rpath $flag"
-+	    eval flag=\"$hardcode_libdir_flag_spec\"
-+	    func_append rpath " $flag"
- 	  fi
- 	elif test -n "$runpath_var"; then
- 	  case "$finalize_perm_rpath " in
- 	  *" $libdir "*) ;;
--	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
-+	  *) func_append finalize_perm_rpath " $libdir" ;;
- 	  esac
- 	fi
-       done
-@@ -7878,7 +8849,7 @@ EOF
-       if test -n "$hardcode_libdir_separator" &&
- 	 test -n "$hardcode_libdirs"; then
- 	libdir="$hardcode_libdirs"
--	eval "rpath=\" $hardcode_libdir_flag_spec\""
-+	eval rpath=\" $hardcode_libdir_flag_spec\"
-       fi
-       finalize_rpath="$rpath"
- 
-@@ -7921,6 +8892,12 @@ EOF
- 	exit_status=0
- 	func_show_eval "$link_command" 'exit_status=$?'
- 
-+	if test -n "$postlink_cmds"; then
-+	  func_to_tool_file "$output"
-+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-+	  func_execute_cmds "$postlink_cmds" 'exit $?'
-+	fi
-+
- 	# Delete the generated files.
- 	if test -f "$output_objdir/${outputname}S.${objext}"; then
- 	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
-@@ -7943,7 +8920,7 @@ EOF
- 	  # We should set the runpath_var.
- 	  rpath=
- 	  for dir in $perm_rpath; do
--	    rpath="$rpath$dir:"
-+	    func_append rpath "$dir:"
- 	  done
- 	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
- 	fi
-@@ -7951,7 +8928,7 @@ EOF
- 	  # We should set the runpath_var.
- 	  rpath=
- 	  for dir in $finalize_perm_rpath; do
--	    rpath="$rpath$dir:"
-+	    func_append rpath "$dir:"
- 	  done
- 	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
- 	fi
-@@ -7966,6 +8943,13 @@ EOF
- 	$opt_dry_run || $RM $output
- 	# Link the executable and exit
- 	func_show_eval "$link_command" 'exit $?'
-+
-+	if test -n "$postlink_cmds"; then
-+	  func_to_tool_file "$output"
-+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-+	  func_execute_cmds "$postlink_cmds" 'exit $?'
-+	fi
-+
- 	exit $EXIT_SUCCESS
-       fi
- 
-@@ -7999,6 +8983,12 @@ EOF
- 
-       func_show_eval "$link_command" 'exit $?'
- 
-+      if test -n "$postlink_cmds"; then
-+	func_to_tool_file "$output_objdir/$outputname"
-+	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-+	func_execute_cmds "$postlink_cmds" 'exit $?'
-+      fi
-+
-       # Now create the wrapper script.
-       func_verbose "creating $output"
- 
-@@ -8096,7 +9086,7 @@ EOF
- 	else
- 	  oldobjs="$old_deplibs $non_pic_objects"
- 	  if test "$preload" = yes && test -f "$symfileobj"; then
--	    oldobjs="$oldobjs $symfileobj"
-+	    func_append oldobjs " $symfileobj"
- 	  fi
- 	fi
- 	addlibs="$old_convenience"
-@@ -8104,10 +9094,10 @@ EOF
- 
-       if test -n "$addlibs"; then
- 	gentop="$output_objdir/${outputname}x"
--	generated="$generated $gentop"
-+	func_append generated " $gentop"
- 
- 	func_extract_archives $gentop $addlibs
--	oldobjs="$oldobjs $func_extract_archives_result"
-+	func_append oldobjs " $func_extract_archives_result"
-       fi
- 
-       # Do each command in the archive commands.
-@@ -8118,10 +9108,10 @@ EOF
- 	# Add any objects from preloaded convenience libraries
- 	if test -n "$dlprefiles"; then
- 	  gentop="$output_objdir/${outputname}x"
--	  generated="$generated $gentop"
-+	  func_append generated " $gentop"
- 
- 	  func_extract_archives $gentop $dlprefiles
--	  oldobjs="$oldobjs $func_extract_archives_result"
-+	  func_append oldobjs " $func_extract_archives_result"
- 	fi
- 
- 	# POSIX demands no paths to be encoded in archives.  We have
-@@ -8139,7 +9129,7 @@ EOF
- 	else
- 	  echo "copying selected object files to avoid basename conflicts..."
- 	  gentop="$output_objdir/${outputname}x"
--	  generated="$generated $gentop"
-+	  func_append generated " $gentop"
- 	  func_mkdir_p "$gentop"
- 	  save_oldobjs=$oldobjs
- 	  oldobjs=
-@@ -8163,18 +9153,28 @@ EOF
- 		esac
- 	      done
- 	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
--	      oldobjs="$oldobjs $gentop/$newobj"
-+	      func_append oldobjs " $gentop/$newobj"
- 	      ;;
--	    *) oldobjs="$oldobjs $obj" ;;
-+	    *) func_append oldobjs " $obj" ;;
- 	    esac
- 	  done
- 	fi
--	eval "cmds=\"$old_archive_cmds\""
-+	eval cmds=\"$old_archive_cmds\"
- 
- 	func_len " $cmds"
- 	len=$func_len_result
- 	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- 	  cmds=$old_archive_cmds
-+	elif test -n "$archiver_list_spec"; then
-+	  func_verbose "using command file archive linking..."
-+	  for obj in $oldobjs
-+	  do
-+	    func_to_tool_file "$obj"
-+	    $ECHO "$func_to_tool_file_result"
-+	  done > $output_objdir/$libname.libcmd
-+	  func_to_tool_file "$output_objdir/$libname.libcmd"
-+	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
-+	  cmds=$old_archive_cmds
- 	else
- 	  # the command line is too long to link in one step, link in parts
- 	  func_verbose "using piecewise archive linking..."
-@@ -8189,7 +9189,7 @@ EOF
- 	  do
- 	    last_oldobj=$obj
- 	  done
--	  eval "test_cmds=\"$old_archive_cmds\""
-+	  eval test_cmds=\"$old_archive_cmds\"
- 	  func_len " $test_cmds"
- 	  len0=$func_len_result
- 	  len=$len0
-@@ -8208,7 +9208,7 @@ EOF
- 		RANLIB=$save_RANLIB
- 	      fi
- 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
--	      eval "concat_cmds=\"\${concat_cmds}$old_archive_cmds\""
-+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
- 	      objlist=
- 	      len=$len0
- 	    fi
-@@ -8216,9 +9216,9 @@ EOF
- 	  RANLIB=$save_RANLIB
- 	  oldobjs=$objlist
- 	  if test "X$oldobjs" = "X" ; then
--	    eval "cmds=\"\$concat_cmds\""
-+	    eval cmds=\"\$concat_cmds\"
- 	  else
--	    eval "cmds=\"\$concat_cmds~\$old_archive_cmds\""
-+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
- 	  fi
- 	fi
-       fi
-@@ -8268,12 +9268,23 @@ EOF
- 	      *.la)
- 		func_basename "$deplib"
- 		name="$func_basename_result"
--		libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-+		func_resolve_sysroot "$deplib"
-+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
- 		test -z "$libdir" && \
- 		  func_fatal_error "\`$deplib' is not a valid libtool archive"
--		newdependency_libs="$newdependency_libs $libdir/$name"
-+		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
-+		;;
-+	      -L*)
-+		func_stripname -L '' "$deplib"
-+		func_replace_sysroot "$func_stripname_result"
-+		func_append newdependency_libs " -L$func_replace_sysroot_result"
- 		;;
--	      *) newdependency_libs="$newdependency_libs $deplib" ;;
-+	      -R*)
-+		func_stripname -R '' "$deplib"
-+		func_replace_sysroot "$func_stripname_result"
-+		func_append newdependency_libs " -R$func_replace_sysroot_result"
-+		;;
-+	      *) func_append newdependency_libs " $deplib" ;;
- 	      esac
- 	    done
- 	    dependency_libs="$newdependency_libs"
-@@ -8284,12 +9295,14 @@ EOF
- 	      *.la)
- 	        func_basename "$lib"
- 		name="$func_basename_result"
--		libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-+		func_resolve_sysroot "$lib"
-+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
-+
- 		test -z "$libdir" && \
- 		  func_fatal_error "\`$lib' is not a valid libtool archive"
--		newdlfiles="$newdlfiles $libdir/$name"
-+		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
- 		;;
--	      *) newdlfiles="$newdlfiles $lib" ;;
-+	      *) func_append newdlfiles " $lib" ;;
- 	      esac
- 	    done
- 	    dlfiles="$newdlfiles"
-@@ -8303,10 +9316,11 @@ EOF
- 		# the library:
- 		func_basename "$lib"
- 		name="$func_basename_result"
--		libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-+		func_resolve_sysroot "$lib"
-+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
- 		test -z "$libdir" && \
- 		  func_fatal_error "\`$lib' is not a valid libtool archive"
--		newdlprefiles="$newdlprefiles $libdir/$name"
-+		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
- 		;;
- 	      esac
- 	    done
-@@ -8318,7 +9332,7 @@ EOF
- 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- 		*) abs=`pwd`"/$lib" ;;
- 	      esac
--	      newdlfiles="$newdlfiles $abs"
-+	      func_append newdlfiles " $abs"
- 	    done
- 	    dlfiles="$newdlfiles"
- 	    newdlprefiles=
-@@ -8327,7 +9341,7 @@ EOF
- 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- 		*) abs=`pwd`"/$lib" ;;
- 	      esac
--	      newdlprefiles="$newdlprefiles $abs"
-+	      func_append newdlprefiles " $abs"
- 	    done
- 	    dlprefiles="$newdlprefiles"
- 	  fi
-@@ -8412,7 +9426,7 @@ relink_command=\"$relink_command\""
-     exit $EXIT_SUCCESS
- }
- 
--{ test "$mode" = link || test "$mode" = relink; } &&
-+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
-     func_mode_link ${1+"$@"}
- 
- 
-@@ -8432,9 +9446,9 @@ func_mode_uninstall ()
-     for arg
-     do
-       case $arg in
--      -f) RM="$RM $arg"; rmforce=yes ;;
--      -*) RM="$RM $arg" ;;
--      *) files="$files $arg" ;;
-+      -f) func_append RM " $arg"; rmforce=yes ;;
-+      -*) func_append RM " $arg" ;;
-+      *) func_append files " $arg" ;;
-       esac
-     done
- 
-@@ -8443,24 +9457,23 @@ func_mode_uninstall ()
- 
-     rmdirs=
- 
--    origobjdir="$objdir"
-     for file in $files; do
-       func_dirname "$file" "" "."
-       dir="$func_dirname_result"
-       if test "X$dir" = X.; then
--	objdir="$origobjdir"
-+	odir="$objdir"
-       else
--	objdir="$dir/$origobjdir"
-+	odir="$dir/$objdir"
-       fi
-       func_basename "$file"
-       name="$func_basename_result"
--      test "$mode" = uninstall && objdir="$dir"
-+      test "$opt_mode" = uninstall && odir="$dir"
- 
--      # Remember objdir for removal later, being careful to avoid duplicates
--      if test "$mode" = clean; then
-+      # Remember odir for removal later, being careful to avoid duplicates
-+      if test "$opt_mode" = clean; then
- 	case " $rmdirs " in
--	  *" $objdir "*) ;;
--	  *) rmdirs="$rmdirs $objdir" ;;
-+	  *" $odir "*) ;;
-+	  *) func_append rmdirs " $odir" ;;
- 	esac
-       fi
- 
-@@ -8486,18 +9499,17 @@ func_mode_uninstall ()
- 
- 	  # Delete the libtool libraries and symlinks.
- 	  for n in $library_names; do
--	    rmfiles="$rmfiles $objdir/$n"
-+	    func_append rmfiles " $odir/$n"
- 	  done
--	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-+	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
- 
--	  case "$mode" in
-+	  case "$opt_mode" in
- 	  clean)
--	    case "  $library_names " in
--	    # "  " in the beginning catches empty $dlname
-+	    case " $library_names " in
- 	    *" $dlname "*) ;;
--	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
-+	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
- 	    esac
--	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
-+	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
- 	    ;;
- 	  uninstall)
- 	    if test -n "$library_names"; then
-@@ -8525,19 +9537,19 @@ func_mode_uninstall ()
- 	  # Add PIC object to the list of files to remove.
- 	  if test -n "$pic_object" &&
- 	     test "$pic_object" != none; then
--	    rmfiles="$rmfiles $dir/$pic_object"
-+	    func_append rmfiles " $dir/$pic_object"
- 	  fi
- 
- 	  # Add non-PIC object to the list of files to remove.
- 	  if test -n "$non_pic_object" &&
- 	     test "$non_pic_object" != none; then
--	    rmfiles="$rmfiles $dir/$non_pic_object"
-+	    func_append rmfiles " $dir/$non_pic_object"
- 	  fi
- 	fi
- 	;;
- 
-       *)
--	if test "$mode" = clean ; then
-+	if test "$opt_mode" = clean ; then
- 	  noexename=$name
- 	  case $file in
- 	  *.exe)
-@@ -8547,7 +9559,7 @@ func_mode_uninstall ()
- 	    noexename=$func_stripname_result
- 	    # $file with .exe has already been added to rmfiles,
- 	    # add $file without .exe
--	    rmfiles="$rmfiles $file"
-+	    func_append rmfiles " $file"
- 	    ;;
- 	  esac
- 	  # Do a test to see if this is a libtool program.
-@@ -8556,7 +9568,7 @@ func_mode_uninstall ()
- 	      func_ltwrapper_scriptname "$file"
- 	      relink_command=
- 	      func_source $func_ltwrapper_scriptname_result
--	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
-+	      func_append rmfiles " $func_ltwrapper_scriptname_result"
- 	    else
- 	      relink_command=
- 	      func_source $dir/$noexename
-@@ -8564,12 +9576,12 @@ func_mode_uninstall ()
- 
- 	    # note $name still contains .exe if it was in $file originally
- 	    # as does the version of $file that was added into $rmfiles
--	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
-+	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
- 	    if test "$fast_install" = yes && test -n "$relink_command"; then
--	      rmfiles="$rmfiles $objdir/lt-$name"
-+	      func_append rmfiles " $odir/lt-$name"
- 	    fi
- 	    if test "X$noexename" != "X$name" ; then
--	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
-+	      func_append rmfiles " $odir/lt-${noexename}.c"
- 	    fi
- 	  fi
- 	fi
-@@ -8577,7 +9589,6 @@ func_mode_uninstall ()
-       esac
-       func_show_eval "$RM $rmfiles" 'exit_status=1'
-     done
--    objdir="$origobjdir"
- 
-     # Try to remove the ${objdir}s in the directories where we deleted files
-     for dir in $rmdirs; do
-@@ -8589,16 +9600,16 @@ func_mode_uninstall ()
-     exit $exit_status
- }
- 
--{ test "$mode" = uninstall || test "$mode" = clean; } &&
-+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
-     func_mode_uninstall ${1+"$@"}
- 
--test -z "$mode" && {
-+test -z "$opt_mode" && {
-   help="$generic_help"
-   func_fatal_help "you must specify a MODE"
- }
- 
- test -z "$exec_cmd" && \
--  func_fatal_help "invalid operation mode \`$mode'"
-+  func_fatal_help "invalid operation mode \`$opt_mode'"
- 
- if test -n "$exec_cmd"; then
-   eval exec "$exec_cmd"
-diff --git a/ltoptions.m4 b/ltoptions.m4
-index 5ef12ce..17cfd51 100644
---- a/ltoptions.m4
-+++ b/ltoptions.m4
-@@ -8,7 +8,7 @@
- # unlimited permission to copy and/or distribute it, with or without
- # modifications, as long as this notice is preserved.
- 
--# serial 6 ltoptions.m4
-+# serial 7 ltoptions.m4
- 
- # This is to help aclocal find these macros, as it can't see m4_define.
- AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-diff --git a/ltversion.m4 b/ltversion.m4
-index bf87f77..9c7b5d4 100644
---- a/ltversion.m4
-+++ b/ltversion.m4
-@@ -7,17 +7,17 @@
- # unlimited permission to copy and/or distribute it, with or without
- # modifications, as long as this notice is preserved.
- 
--# Generated from ltversion.in.
-+# @configure_input@
- 
--# serial 3134 ltversion.m4
-+# serial 3293 ltversion.m4
- # This file is part of GNU Libtool
- 
--m4_define([LT_PACKAGE_VERSION], [2.2.7a])
--m4_define([LT_PACKAGE_REVISION], [1.3134])
-+m4_define([LT_PACKAGE_VERSION], [2.4])
-+m4_define([LT_PACKAGE_REVISION], [1.3293])
- 
- AC_DEFUN([LTVERSION_VERSION],
--[macro_version='2.2.7a'
--macro_revision='1.3134'
-+[macro_version='2.4'
-+macro_revision='1.3293'
- _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
- _LT_DECL(, macro_revision, 0)
- ])
-diff --git a/lt~obsolete.m4 b/lt~obsolete.m4
-index bf92b5e..c573da9 100644
---- a/lt~obsolete.m4
-+++ b/lt~obsolete.m4
-@@ -7,7 +7,7 @@
- # unlimited permission to copy and/or distribute it, with or without
- # modifications, as long as this notice is preserved.
- 
--# serial 4 lt~obsolete.m4
-+# serial 5 lt~obsolete.m4
- 
- # These exist entirely to fool aclocal when bootstrapping libtool.
- #
-diff --git a/opcodes/configure b/opcodes/configure
-index f615634..a340983 100755
---- a/opcodes/configure
-+++ b/opcodes/configure
-@@ -649,6 +649,9 @@ OTOOL
- LIPO
- NMEDIT
- DSYMUTIL
-+MANIFEST_TOOL
-+ac_ct_AR
-+DLLTOOL
- OBJDUMP
- LN_S
- NM
-@@ -762,6 +765,7 @@ enable_static
- with_pic
- enable_fast_install
- with_gnu_ld
-+with_libtool_sysroot
- enable_libtool_lock
- enable_targets
- enable_werror
-@@ -1422,6 +1426,8 @@ Optional Packages:
-   --with-pic              try to use only PIC/non-PIC objects [default=use
-                           both]
-   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-+  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
-+                        (or the compiler's sysroot if not specified).
- 
- Some influential environment variables:
-   CC          C compiler command
-@@ -5114,8 +5120,8 @@ esac
- 
- 
- 
--macro_version='2.2.7a'
--macro_revision='1.3134'
-+macro_version='2.4'
-+macro_revision='1.3293'
- 
- 
- 
-@@ -5155,7 +5161,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
- $as_echo_n "checking how to print strings... " >&6; }
- # Test print first, because it will be a builtin if present.
--if test "X`print -r -- -n 2>/dev/null`" = X-n && \
-+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-   ECHO='print -r --'
- elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-@@ -5841,8 +5847,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
- # Try some XSI features
- xsi_shell=no
- ( _lt_dummy="a/b/c"
--  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
--      = c,a/b,, \
-+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-+      = c,a/b,b/c, \
-     && eval 'test $(( 1 + 1 )) -eq 2 \
-     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-   && xsi_shell=yes
-@@ -5891,6 +5897,80 @@ esac
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-+if test "${lt_cv_to_host_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-+        ;;
-+    esac
-+    ;;
-+  *-*-cygwin* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_noop
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-+        ;;
-+    esac
-+    ;;
-+  * ) # unhandled hosts (and "normal" native builds)
-+    lt_cv_to_host_file_cmd=func_convert_file_noop
-+    ;;
-+esac
-+
-+fi
-+
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-+if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  #assume ordinary cross tools, or native build.
-+lt_cv_to_tool_file_cmd=func_convert_file_noop
-+case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+    esac
-+    ;;
-+esac
-+
-+fi
-+
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-+
-+
-+
-+
-+
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
- $as_echo_n "checking for $LD option to reload object files... " >&6; }
- if test "${lt_cv_ld_reload_flag+set}" = set; then :
-@@ -5907,6 +5987,11 @@ case $reload_flag in
- esac
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- case $host_os in
-+  cygwin* | mingw* | pw32* | cegcc*)
-+    if test "$GCC" != yes; then
-+      reload_cmds=false
-+    fi
-+    ;;
-   darwin*)
-     if test "$GCC" = yes; then
-       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-@@ -6075,7 +6160,8 @@ mingw* | pw32*)
-     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-     lt_cv_file_magic_cmd='func_win32_libid'
-   else
--    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-+    # Keep this pattern in sync with the one in func_win32_libid.
-+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-     lt_cv_file_magic_cmd='$OBJDUMP -f'
-   fi
-   ;;
-@@ -6229,6 +6315,21 @@ esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
- $as_echo "$lt_cv_deplibs_check_method" >&6; }
-+
-+file_magic_glob=
-+want_nocaseglob=no
-+if test "$build" = "$host"; then
-+  case $host_os in
-+  mingw* | pw32*)
-+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-+      want_nocaseglob=yes
-+    else
-+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
-+    fi
-+    ;;
-+  esac
-+fi
-+
- file_magic_cmd=$lt_cv_file_magic_cmd
- deplibs_check_method=$lt_cv_deplibs_check_method
- test -z "$deplibs_check_method" && deplibs_check_method=unknown
-@@ -6244,9 +6345,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
- 
- 
- 
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
- if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
--set dummy ${ac_tool_prefix}ar; ac_word=$2
-+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$DLLTOOL"; then
-+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+DLLTOOL=$ac_cv_prog_DLLTOOL
-+if test -n "$DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-+$as_echo "$DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_DLLTOOL"; then
-+  ac_ct_DLLTOOL=$DLLTOOL
-+  # Extract the first word of "dlltool", so it can be a program name with args.
-+set dummy dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_DLLTOOL"; then
-+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-+if test -n "$ac_ct_DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-+$as_echo "$ac_ct_DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_DLLTOOL" = x; then
-+    DLLTOOL="false"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    DLLTOOL=$ac_ct_DLLTOOL
-+  fi
-+else
-+  DLLTOOL="$ac_cv_prog_DLLTOOL"
-+fi
-+
-+test -z "$DLLTOOL" && DLLTOOL=dlltool
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-+if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_sharedlib_from_linklib_cmd='unknown'
-+
-+case $host_os in
-+cygwin* | mingw* | pw32* | cegcc*)
-+  # two different shell functions defined in ltmain.sh
-+  # decide which to use based on capabilities of $DLLTOOL
-+  case `$DLLTOOL --help 2>&1` in
-+  *--identify-strict*)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-+    ;;
-+  *)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-+    ;;
-+  esac
-+  ;;
-+*)
-+  # fallback: assume linklib IS sharedlib
-+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-+  ;;
-+esac
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-+
-+
-+
-+
-+
-+
-+
-+if test -n "$ac_tool_prefix"; then
-+  for ac_prog in ar
-+  do
-+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_AR+set}" = set; then :
-@@ -6262,7 +6516,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_AR="${ac_tool_prefix}ar"
-+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6282,11 +6536,15 @@ $as_echo "no" >&6; }
- fi
- 
- 
-+    test -n "$AR" && break
-+  done
- fi
--if test -z "$ac_cv_prog_AR"; then
-+if test -z "$AR"; then
-   ac_ct_AR=$AR
--  # Extract the first word of "ar", so it can be a program name with args.
--set dummy ar; ac_word=$2
-+  for ac_prog in ar
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
-@@ -6302,7 +6560,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_ac_ct_AR="ar"
-+    ac_cv_prog_ac_ct_AR="$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -6321,6 +6579,10 @@ else
- $as_echo "no" >&6; }
- fi
- 
-+
-+  test -n "$ac_ct_AR" && break
-+done
-+
-   if test "x$ac_ct_AR" = x; then
-     AR="false"
-   else
-@@ -6332,16 +6594,72 @@ ac_tool_warned=yes ;;
- esac
-     AR=$ac_ct_AR
-   fi
--else
--  AR="$ac_cv_prog_AR"
- fi
- 
--test -z "$AR" && AR=ar
--test -z "$AR_FLAGS" && AR_FLAGS=cru
-+: ${AR=ar}
-+: ${AR_FLAGS=cru}
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-+$as_echo_n "checking for archiver @FILE support... " >&6; }
-+if test "${lt_cv_ar_at_file+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_ar_at_file=no
-+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
- 
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+  echo conftest.$ac_objext > conftest.lst
-+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
-+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+      if test "$ac_status" -eq 0; then
-+	# Ensure the archiver fails upon bogus file names.
-+	rm -f conftest.$ac_objext libconftest.a
-+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+	if test "$ac_status" -ne 0; then
-+          lt_cv_ar_at_file=@
-+        fi
-+      fi
-+      rm -f conftest.* libconftest.a
- 
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- 
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-+$as_echo "$lt_cv_ar_at_file" >&6; }
- 
-+if test "x$lt_cv_ar_at_file" = xno; then
-+  archiver_list_spec=
-+else
-+  archiver_list_spec=$lt_cv_ar_at_file
-+fi
- 
- 
- 
-@@ -6683,8 +7001,8 @@ esac
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- 
- # Transform an extracted symbol line into symbol name and symbol address
--lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
--lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
- 
- # Handle CRLF in mingw tool chain
- opt_cr=
-@@ -6720,6 +7038,7 @@ for ac_symprfx in "" "_"; do
-   else
-     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-   fi
-+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
- 
-   # Check to see that the pipe works correctly.
-   pipe_works=no
-@@ -6761,6 +7080,18 @@ _LT_EOF
-       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- 	  cat <<_LT_EOF > conftest.$ac_ext
-+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-+/* DATA imports from DLLs on WIN32 con't be const, because runtime
-+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-+# define LT_DLSYM_CONST
-+#elif defined(__osf__)
-+/* This system does not cope well with relocations in const data.  */
-+# define LT_DLSYM_CONST
-+#else
-+# define LT_DLSYM_CONST const
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -6772,7 +7103,7 @@ _LT_EOF
- 	  cat <<_LT_EOF >> conftest.$ac_ext
- 
- /* The mapping between symbol names and symbols.  */
--const struct {
-+LT_DLSYM_CONST struct {
-   const char *name;
-   void       *address;
- }
-@@ -6798,8 +7129,8 @@ static const void *lt_preloaded_setup() {
- _LT_EOF
- 	  # Now try linking the two files.
- 	  mv conftest.$ac_objext conftstm.$ac_objext
--	  lt_save_LIBS="$LIBS"
--	  lt_save_CFLAGS="$CFLAGS"
-+	  lt_globsym_save_LIBS=$LIBS
-+	  lt_globsym_save_CFLAGS=$CFLAGS
- 	  LIBS="conftstm.$ac_objext"
- 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-@@ -6809,8 +7140,8 @@ _LT_EOF
-   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
- 	    pipe_works=yes
- 	  fi
--	  LIBS="$lt_save_LIBS"
--	  CFLAGS="$lt_save_CFLAGS"
-+	  LIBS=$lt_globsym_save_LIBS
-+	  CFLAGS=$lt_globsym_save_CFLAGS
- 	else
- 	  echo "cannot find nm_test_func in $nlist" >&5
- 	fi
-@@ -6847,6 +7178,16 @@ else
- $as_echo "ok" >&6; }
- fi
- 
-+# Response file support.
-+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-+  nm_file_list_spec='@'
-+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
-+  nm_file_list_spec='@'
-+fi
-+
-+
-+
-+
- 
- 
- 
-@@ -6868,6 +7209,45 @@ fi
- 
- 
- 
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-+$as_echo_n "checking for sysroot... " >&6; }
-+
-+# Check whether --with-libtool-sysroot was given.
-+if test "${with_libtool_sysroot+set}" = set; then :
-+  withval=$with_libtool_sysroot;
-+else
-+  with_libtool_sysroot=no
-+fi
-+
-+
-+lt_sysroot=
-+case ${with_libtool_sysroot} in #(
-+ yes)
-+   if test "$GCC" = yes; then
-+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-+   fi
-+   ;; #(
-+ /*)
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
-+   ;; #(
-+ no|'')
-+   ;; #(
-+ *)
-+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
-+$as_echo "${with_libtool_sysroot}" >&6; }
-+   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
-+   ;;
-+esac
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-+$as_echo "${lt_sysroot:-no}" >&6; }
-+
-+
-+
-+
-+
- # Check whether --enable-libtool-lock was given.
- if test "${enable_libtool_lock+set}" = set; then :
-   enableval=$enable_libtool_lock;
-@@ -7074,6 +7454,123 @@ esac
- 
- need_locks="$enable_libtool_lock"
- 
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$MANIFEST_TOOL"; then
-+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-+if test -n "$MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-+$as_echo "$MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
-+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
-+  # Extract the first word of "mt", so it can be a program name with args.
-+set dummy mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-+if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
-+    MANIFEST_TOOL=":"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
-+  fi
-+else
-+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-+fi
-+
-+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-+if test "${lt_cv_path_mainfest_tool+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_path_mainfest_tool=no
-+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
-+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-+  cat conftest.err >&5
-+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-+    lt_cv_path_mainfest_tool=yes
-+  fi
-+  rm -f conftest*
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-+if test "x$lt_cv_path_mainfest_tool" != xyes; then
-+  MANIFEST_TOOL=:
-+fi
-+
-+
-+
-+
-+
- 
-   case $host_os in
-     rhapsody* | darwin*)
-@@ -7637,6 +8134,8 @@ _LT_EOF
-       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-       echo "$AR cru libconftest.a conftest.o" >&5
-       $AR cru libconftest.a conftest.o 2>&5
-+      echo "$RANLIB libconftest.a" >&5
-+      $RANLIB libconftest.a 2>&5
-       cat > conftest.c << _LT_EOF
- int main() { return 0;}
- _LT_EOF
-@@ -7802,7 +8301,8 @@ fi
- LIBTOOL_DEPS="$ltmain"
- 
- # Always use our own libtool.
--LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-+LIBTOOL='$(SHELL) $(top_builddir)'
-+LIBTOOL="$LIBTOOL/${host_alias}-libtool"
- 
- 
- 
-@@ -7891,7 +8391,7 @@ aix3*)
- esac
- 
- # Global variables:
--ofile=libtool
-+ofile=${host_alias}-libtool
- can_build_shared=yes
- 
- # All known linkers require a `.a' archive for static linking (except MSVC,
-@@ -8189,8 +8689,6 @@ fi
- lt_prog_compiler_pic=
- lt_prog_compiler_static=
- 
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
--$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 
-   if test "$GCC" = yes; then
-     lt_prog_compiler_wl='-Wl,'
-@@ -8356,6 +8854,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 	lt_prog_compiler_pic='--shared'
- 	lt_prog_compiler_static='--static'
- 	;;
-+      nagfor*)
-+	# NAG Fortran compiler
-+	lt_prog_compiler_wl='-Wl,-Wl,,'
-+	lt_prog_compiler_pic='-PIC'
-+	lt_prog_compiler_static='-Bstatic'
-+	;;
-       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-         # Portland Group compilers (*not* the Pentium gcc compiler,
- 	# which looks to be a dead project)
-@@ -8418,7 +8922,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-       lt_prog_compiler_pic='-KPIC'
-       lt_prog_compiler_static='-Bstatic'
-       case $cc_basename in
--      f77* | f90* | f95*)
-+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- 	lt_prog_compiler_wl='-Qoption ld ';;
-       *)
- 	lt_prog_compiler_wl='-Wl,';;
-@@ -8475,13 +8979,17 @@ case $host_os in
-     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-     ;;
- esac
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
--$as_echo "$lt_prog_compiler_pic" >&6; }
--
--
--
--
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-+if test "${lt_cv_prog_compiler_pic+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
- 
- #
- # Check to make sure the PIC flag actually works.
-@@ -8542,6 +9050,11 @@ fi
- 
- 
- 
-+
-+
-+
-+
-+
- #
- # Check to make sure the static flag actually works.
- #
-@@ -8892,7 +9405,8 @@ _LT_EOF
-       allow_undefined_flag=unsupported
-       always_export_symbols=no
-       enable_shared_with_static_runtimes=yes
--      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
- 
-       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-@@ -8991,12 +9505,12 @@ _LT_EOF
- 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- 	  hardcode_libdir_flag_spec=
- 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
--	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- 	  if test "x$supports_anon_versioning" = xyes; then
- 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- 	      echo "local: *; };" >> $output_objdir/$libname.ver~
--	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- 	  fi
- 	  ;;
- 	esac
-@@ -9010,8 +9524,8 @@ _LT_EOF
- 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- 	wlarc=
-       else
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       fi
-       ;;
- 
-@@ -9029,8 +9543,8 @@ _LT_EOF
- 
- _LT_EOF
-       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -9076,8 +9590,8 @@ _LT_EOF
- 
-     *)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -9207,7 +9721,13 @@ _LT_EOF
- 	allow_undefined_flag='-berok'
-         # Determine the default libpath from the value encoded in an
-         # empty executable.
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+        if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9220,22 +9740,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
-         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-@@ -9247,7 +9774,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	else
- 	 # Determine the default libpath from the value encoded in an
- 	 # empty executable.
--	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	 if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- int
-@@ -9260,22 +9793,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
- 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- 	  # Warning - without using the other run time loading flags,
-@@ -9320,20 +9860,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-       # Microsoft Visual C++.
-       # hardcode_libdir_flag_spec is actually meaningless, as there is
-       # no search path for DLLs.
--      hardcode_libdir_flag_spec=' '
--      allow_undefined_flag=unsupported
--      # Tell ltmain to make .lib files, not .a files.
--      libext=lib
--      # Tell ltmain to make .dll files, not .so files.
--      shrext_cmds=".dll"
--      # FIXME: Setting linknames here is a bad hack.
--      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
--      # The linker will automatically build a .lib file if we build a DLL.
--      old_archive_from_new_cmds='true'
--      # FIXME: Should let the user specify the lib program.
--      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
--      fix_srcfile_path='`cygpath -w "$srcfile"`'
--      enable_shared_with_static_runtimes=yes
-+      case $cc_basename in
-+      cl*)
-+	# Native MSVC
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	always_export_symbols=yes
-+	file_list_spec='@'
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-+	  else
-+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-+	  fi~
-+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-+	  linknames='
-+	# The linker will not automatically build a static lib if we build a DLL.
-+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
-+	enable_shared_with_static_runtimes=yes
-+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+	# Don't use ranlib
-+	old_postinstall_cmds='chmod 644 $oldlib'
-+	postlink_cmds='lt_outputfile="@OUTPUT@"~
-+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-+	  case $lt_outputfile in
-+	    *.exe|*.EXE) ;;
-+	    *)
-+	      lt_outputfile="$lt_outputfile.exe"
-+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-+	      ;;
-+	  esac~
-+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-+	    $RM "$lt_outputfile.manifest";
-+	  fi'
-+	;;
-+      *)
-+	# Assume MSVC wrapper
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-+	# The linker will automatically build a .lib file if we build a DLL.
-+	old_archive_from_new_cmds='true'
-+	# FIXME: Should let the user specify the lib program.
-+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-+	enable_shared_with_static_runtimes=yes
-+	;;
-+      esac
-       ;;
- 
-     darwin* | rhapsody*)
-@@ -9394,7 +9977,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-     freebsd* | dragonfly*)
--      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-       hardcode_direct=yes
-       hardcode_shlibpath_var=no
-@@ -9402,7 +9985,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux9*)
-       if test "$GCC" = yes; then
--	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       else
- 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       fi
-@@ -9418,7 +10001,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux10*)
-       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
--	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-       else
- 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-       fi
-@@ -9442,10 +10025,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	ia64*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	esac
-       else
-@@ -9524,23 +10107,36 @@ fi
- 
-     irix5* | irix6* | nonstopux*)
-       if test "$GCC" = yes; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	# Try to use the -exported_symbol ld option, if it does not
- 	# work, assume that -exports_file does not work either and
- 	# implicitly export all symbols.
--        save_LDFLAGS="$LDFLAGS"
--        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
--        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+	# This should be the same for all languages, so no per-tag cache variable.
-+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-+if test "${lt_cv_irix_exported_symbol+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  save_LDFLAGS="$LDFLAGS"
-+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
--int foo(void) {}
-+int foo (void) { return 0; }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
--  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
--
-+  lt_cv_irix_exported_symbol=yes
-+else
-+  lt_cv_irix_exported_symbol=no
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--        LDFLAGS="$save_LDFLAGS"
-+           LDFLAGS="$save_LDFLAGS"
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
-+	if test "$lt_cv_irix_exported_symbol" = yes; then
-+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-+	fi
-       else
- 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-@@ -9625,7 +10221,7 @@ rm -f core conftest.err conftest.$ac_objext \
-     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-       if test "$GCC" = yes; then
- 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
--	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-       else
- 	allow_undefined_flag=' -expect_unresolved \*'
-@@ -9644,9 +10240,9 @@ rm -f core conftest.err conftest.$ac_objext \
-       no_undefined_flag=' -z defs'
-       if test "$GCC" = yes; then
- 	wlarc='${wl}'
--	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
--	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-       else
- 	case `$CC -V 2>&1` in
- 	*"Compilers 5.0"*)
-@@ -10222,8 +10818,9 @@ cygwin* | mingw* | pw32* | cegcc*)
-   need_version=no
-   need_lib_prefix=no
- 
--  case $GCC,$host_os in
--  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-+  case $GCC,$cc_basename in
-+  yes,*)
-+    # gcc
-     library_names_spec='$libname.dll.a'
-     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-     postinstall_cmds='base_file=`basename \${file}`~
-@@ -10256,13 +10853,71 @@ cygwin* | mingw* | pw32* | cegcc*)
-       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-       ;;
-     esac
-+    dynamic_linker='Win32 ld.exe'
-+    ;;
-+
-+  *,cl*)
-+    # Native MSVC
-+    libname_spec='$name'
-+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-+    library_names_spec='${libname}.dll.lib'
-+
-+    case $build_os in
-+    mingw*)
-+      sys_lib_search_path_spec=
-+      lt_save_ifs=$IFS
-+      IFS=';'
-+      for lt_path in $LIB
-+      do
-+        IFS=$lt_save_ifs
-+        # Let DOS variable expansion print the short 8.3 style file name.
-+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-+      done
-+      IFS=$lt_save_ifs
-+      # Convert to MSYS style.
-+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-+      ;;
-+    cygwin*)
-+      # Convert to unix form, then to dos form, then back to unix form
-+      # but this time dos style (no spaces!) so that the unix form looks
-+      # like /cygdrive/c/PROGRA~1:/cygdr...
-+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      ;;
-+    *)
-+      sys_lib_search_path_spec="$LIB"
-+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-+        # It is most probably a Windows format PATH.
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-+      else
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      fi
-+      # FIXME: find the short name or the path components, as spaces are
-+      # common. (e.g. "Program Files" -> "PROGRA~1")
-+      ;;
-+    esac
-+
-+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-+    postinstall_cmds='base_file=`basename \${file}`~
-+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-+      dldir=$destdir/`dirname \$dlpath`~
-+      test -d \$dldir || mkdir -p \$dldir~
-+      $install_prog $dir/$dlname \$dldir/$dlname'
-+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-+      dlpath=$dir/\$dldll~
-+       $RM \$dlpath'
-+    shlibpath_overrides_runpath=yes
-+    dynamic_linker='Win32 link.exe'
-     ;;
- 
-   *)
-+    # Assume MSVC wrapper
-     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-+    dynamic_linker='Win32 ld.exe'
-     ;;
-   esac
--  dynamic_linker='Win32 ld.exe'
-   # FIXME: first we should search . and the directory the executable is in
-   shlibpath_var=PATH
-   ;;
-@@ -10354,7 +11009,7 @@ haiku*)
-   soname_spec='${libname}${release}${shared_ext}$major'
-   shlibpath_var=LIBRARY_PATH
-   shlibpath_overrides_runpath=yes
--  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-   hardcode_into_libs=yes
-   ;;
- 
-@@ -11194,10 +11849,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -11300,10 +11955,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -12499,7 +13154,7 @@ if test "$enable_shared" = "yes"; then
- # since libbfd may not pull in the entirety of libiberty.
-   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
-   if test -n "$x"; then
--    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
-+    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
-   fi
- 
-   case "${host}" in
-@@ -13473,13 +14128,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
- lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
- lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
- lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
- reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
- reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
- OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
- deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
- file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
- AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
- AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
- STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
- RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
- old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-@@ -13494,14 +14156,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
- lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
- objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
- MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
--lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
- lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
- need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
- DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
- NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
- LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-@@ -13534,12 +14199,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
- hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
- inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
- link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
--fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
- always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
- export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
- exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
- include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
- prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
- file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
- variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
- need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-@@ -13594,8 +14259,13 @@ reload_flag \
- OBJDUMP \
- deplibs_check_method \
- file_magic_cmd \
-+file_magic_glob \
-+want_nocaseglob \
-+DLLTOOL \
-+sharedlib_from_linklib_cmd \
- AR \
- AR_FLAGS \
-+archiver_list_spec \
- STRIP \
- RANLIB \
- CC \
-@@ -13605,12 +14275,14 @@ lt_cv_sys_global_symbol_pipe \
- lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-+nm_file_list_spec \
- lt_prog_compiler_no_builtin_flag \
--lt_prog_compiler_wl \
- lt_prog_compiler_pic \
-+lt_prog_compiler_wl \
- lt_prog_compiler_static \
- lt_cv_prog_compiler_c_o \
- need_locks \
-+MANIFEST_TOOL \
- DSYMUTIL \
- NMEDIT \
- LIPO \
-@@ -13626,7 +14298,6 @@ no_undefined_flag \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
--fix_srcfile_path \
- exclude_expsyms \
- include_expsyms \
- file_list_spec \
-@@ -13662,6 +14333,7 @@ module_cmds \
- module_expsym_cmds \
- export_symbols_cmds \
- prelink_cmds \
-+postlink_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- finish_cmds \
-@@ -14418,7 +15090,8 @@ $as_echo X"$file" |
- # NOTE: Changes made to this file will be lost: look at ltmain.sh.
- #
- #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
--#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-+#                 Inc.
- #   Written by Gordon Matzigkeit, 1996
- #
- #   This file is part of GNU Libtool.
-@@ -14521,19 +15194,42 @@ SP2NL=$lt_lt_SP2NL
- # turn newlines into spaces.
- NL2SP=$lt_lt_NL2SP
- 
-+# convert \$build file names to \$host format.
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+
-+# convert \$build files to toolchain format.
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+
- # An object symbol dumper.
- OBJDUMP=$lt_OBJDUMP
- 
- # Method to check whether dependent libraries are shared objects.
- deplibs_check_method=$lt_deplibs_check_method
- 
--# Command to use when deplibs_check_method == "file_magic".
-+# Command to use when deplibs_check_method = "file_magic".
- file_magic_cmd=$lt_file_magic_cmd
- 
-+# How to find potential files when deplibs_check_method = "file_magic".
-+file_magic_glob=$lt_file_magic_glob
-+
-+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-+want_nocaseglob=$lt_want_nocaseglob
-+
-+# DLL creation program.
-+DLLTOOL=$lt_DLLTOOL
-+
-+# Command to associate shared and link libraries.
-+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-+
- # The archiver.
- AR=$lt_AR
-+
-+# Flags to create an archive.
- AR_FLAGS=$lt_AR_FLAGS
- 
-+# How to feed a file listing to the archiver.
-+archiver_list_spec=$lt_archiver_list_spec
-+
- # A symbol stripping program.
- STRIP=$lt_STRIP
- 
-@@ -14563,6 +15259,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
- # Transform the output of nm in a C name address pair when lib prefix is needed.
- global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
- 
-+# Specify filename containing input files for \$NM.
-+nm_file_list_spec=$lt_nm_file_list_spec
-+
-+# The root where to search for dependent libraries,and in which our libraries should be installed.
-+lt_sysroot=$lt_sysroot
-+
- # The name of the directory that contains temporary libtool files.
- objdir=$objdir
- 
-@@ -14572,6 +15274,9 @@ MAGIC_CMD=$MAGIC_CMD
- # Must we lock files when doing compilation?
- need_locks=$lt_need_locks
- 
-+# Manifest tool.
-+MANIFEST_TOOL=$lt_MANIFEST_TOOL
-+
- # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
- DSYMUTIL=$lt_DSYMUTIL
- 
-@@ -14686,12 +15391,12 @@ with_gcc=$GCC
- # Compiler flag to turn off builtin functions.
- no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
- 
--# How to pass a linker flag through the compiler.
--wl=$lt_lt_prog_compiler_wl
--
- # Additional compiler flags for building library objects.
- pic_flag=$lt_lt_prog_compiler_pic
- 
-+# How to pass a linker flag through the compiler.
-+wl=$lt_lt_prog_compiler_wl
-+
- # Compiler flag to prevent dynamic linking.
- link_static_flag=$lt_lt_prog_compiler_static
- 
-@@ -14778,9 +15483,6 @@ inherit_rpath=$inherit_rpath
- # Whether libtool must link a program against all its dependency libraries.
- link_all_deplibs=$link_all_deplibs
- 
--# Fix the shell variable \$srcfile for the compiler.
--fix_srcfile_path=$lt_fix_srcfile_path
--
- # Set to "yes" if exported symbols are required.
- always_export_symbols=$always_export_symbols
- 
-@@ -14796,6 +15498,9 @@ include_expsyms=$lt_include_expsyms
- # Commands necessary for linking programs (against libraries) with templates.
- prelink_cmds=$lt_prelink_cmds
- 
-+# Commands necessary for finishing linking programs.
-+postlink_cmds=$lt_postlink_cmds
-+
- # Specify filename containing input files.
- file_list_spec=$lt_file_list_spec
- 
-@@ -14828,210 +15533,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
-   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-   # text mode, it properly converts lines to CR/LF.  This bash problem
-   # is reportedly fixed, but why not run on old versions too?
--  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  case $xsi_shell in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result="${1##*/}"
--}
--
--# func_dirname_and_basename file append nondir_replacement
--# perform func_basename and func_dirname in a single function
--# call:
--#   dirname:  Compute the dirname of FILE.  If nonempty,
--#             add APPEND to the result, otherwise set result
--#             to NONDIR_REPLACEMENT.
--#             value returned in "$func_dirname_result"
--#   basename: Compute filename of FILE.
--#             value retuned in "$func_basename_result"
--# Implementation must be kept synchronized with func_dirname
--# and func_basename. For efficiency, we do not delegate to
--# those functions but instead duplicate the functionality here.
--func_dirname_and_basename ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--  func_basename_result="${1##*/}"
--}
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--func_stripname ()
--{
--  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
--  # positional parameters, so assign one to ordinary parameter first.
--  func_stripname_result=${3}
--  func_stripname_result=${func_stripname_result#"${1}"}
--  func_stripname_result=${func_stripname_result%"${2}"}
--}
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=${1%%=*}
--  func_opt_split_arg=${1#*=}
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  case ${1} in
--    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
--    *)    func_lo2o_result=${1} ;;
--  esac
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=${1%.*}.lo
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=$(( $* ))
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=${#1}
--}
--
--_LT_EOF
--    ;;
--  *) # Bourne compatible functions.
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  # Extract subdirectory from the argument.
--  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
--  if test "X$func_dirname_result" = "X${1}"; then
--    func_dirname_result="${3}"
--  else
--    func_dirname_result="$func_dirname_result${2}"
--  fi
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
--}
--
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--# func_strip_suffix prefix name
--func_stripname ()
--{
--  case ${2} in
--    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
--    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
--  esac
--}
--
--# sed scripts:
--my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
--my_sed_long_arg='1s/^-[^=]*=//'
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
--  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=`expr "$@"`
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
--}
--
--_LT_EOF
--esac
--
--case $lt_shell_append in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1+=\$2"
--}
--_LT_EOF
--    ;;
--  *)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1=\$$1\$2"
--}
--
--_LT_EOF
--    ;;
--  esac
--
--
--  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  mv -f "$cfgfile" "$ofile" ||
-+  sed '$q' "$ltmain" >> "$cfgfile" \
-+     || (rm -f "$cfgfile"; exit 1)
-+
-+  if test x"$xsi_shell" = xyes; then
-+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-+func_dirname ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-+func_basename ()\
-+{\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-+func_dirname_and_basename ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-+func_stripname ()\
-+{\
-+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-+\    # positional parameters, so assign one to ordinary parameter first.\
-+\    func_stripname_result=${3}\
-+\    func_stripname_result=${func_stripname_result#"${1}"}\
-+\    func_stripname_result=${func_stripname_result%"${2}"}\
-+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-+func_split_long_opt ()\
-+{\
-+\    func_split_long_opt_name=${1%%=*}\
-+\    func_split_long_opt_arg=${1#*=}\
-+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-+func_split_short_opt ()\
-+{\
-+\    func_split_short_opt_arg=${1#??}\
-+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-+func_lo2o ()\
-+{\
-+\    case ${1} in\
-+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-+\      *)    func_lo2o_result=${1} ;;\
-+\    esac\
-+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-+func_xform ()\
-+{\
-+    func_xform_result=${1%.*}.lo\
-+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-+func_arith ()\
-+{\
-+    func_arith_result=$(( $* ))\
-+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_len ()$/,/^} # func_len /c\
-+func_len ()\
-+{\
-+    func_len_result=${#1}\
-+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+fi
-+
-+if test x"$lt_shell_append" = xyes; then
-+  sed -e '/^func_append ()$/,/^} # func_append /c\
-+func_append ()\
-+{\
-+    eval "${1}+=\\${2}"\
-+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-+func_append_quoted ()\
-+{\
-+\    func_quote_for_eval "${2}"\
-+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  # Save a `func_append' function call where possible by direct use of '+='
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+else
-+  # Save a `func_append' function call even when '+=' is not available
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+fi
-+
-+if test x"$_lt_function_replace_fail" = x":"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-+fi
-+
-+
-+   mv -f "$cfgfile" "$ofile" ||
-     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-   chmod +x "$ofile"
- 
-diff --git a/opcodes/configure.ac b/opcodes/configure.ac
-index c7f4783..f2e002d 100644
---- a/opcodes/configure.ac
-+++ b/opcodes/configure.ac
-@@ -167,7 +167,7 @@ changequote(,)dnl
-   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
- changequote([,])dnl
-   if test -n "$x"; then
--    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
-+    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
-   fi
- 
-   case "${host}" in
-diff --git a/zlib/configure b/zlib/configure
-index bba9fd2..25a2dae 100755
---- a/zlib/configure
-+++ b/zlib/configure
-@@ -614,8 +614,11 @@ OTOOL
- LIPO
- NMEDIT
- DSYMUTIL
-+MANIFEST_TOOL
- RANLIB
-+ac_ct_AR
- AR
-+DLLTOOL
- OBJDUMP
- LN_S
- NM
-@@ -737,6 +740,7 @@ enable_static
- with_pic
- enable_fast_install
- with_gnu_ld
-+with_libtool_sysroot
- enable_libtool_lock
- enable_host_shared
- '
-@@ -1385,6 +1389,8 @@ Optional Packages:
-   --with-pic              try to use only PIC/non-PIC objects [default=use
-                           both]
-   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-+  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
-+                        (or the compiler's sysroot if not specified).
- 
- Some influential environment variables:
-   CC          C compiler command
-@@ -3910,8 +3916,8 @@ esac
- 
- 
- 
--macro_version='2.2.7a'
--macro_revision='1.3134'
-+macro_version='2.4'
-+macro_revision='1.3293'
- 
- 
- 
-@@ -3951,7 +3957,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
- $as_echo_n "checking how to print strings... " >&6; }
- # Test print first, because it will be a builtin if present.
--if test "X`print -r -- -n 2>/dev/null`" = X-n && \
-+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-   ECHO='print -r --'
- elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-@@ -4767,8 +4773,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
- # Try some XSI features
- xsi_shell=no
- ( _lt_dummy="a/b/c"
--  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
--      = c,a/b,, \
-+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-+      = c,a/b,b/c, \
-     && eval 'test $(( 1 + 1 )) -eq 2 \
-     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-   && xsi_shell=yes
-@@ -4817,6 +4823,80 @@ esac
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-+if test "${lt_cv_to_host_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-+        ;;
-+    esac
-+    ;;
-+  *-*-cygwin* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-+        ;;
-+      *-*-cygwin* )
-+        lt_cv_to_host_file_cmd=func_convert_file_noop
-+        ;;
-+      * ) # otherwise, assume *nix
-+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-+        ;;
-+    esac
-+    ;;
-+  * ) # unhandled hosts (and "normal" native builds)
-+    lt_cv_to_host_file_cmd=func_convert_file_noop
-+    ;;
-+esac
-+
-+fi
-+
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-+if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  #assume ordinary cross tools, or native build.
-+lt_cv_to_tool_file_cmd=func_convert_file_noop
-+case $host in
-+  *-*-mingw* )
-+    case $build in
-+      *-*-mingw* ) # actually msys
-+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-+        ;;
-+    esac
-+    ;;
-+esac
-+
-+fi
-+
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-+
-+
-+
-+
-+
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
- $as_echo_n "checking for $LD option to reload object files... " >&6; }
- if test "${lt_cv_ld_reload_flag+set}" = set; then :
-@@ -4833,6 +4913,11 @@ case $reload_flag in
- esac
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- case $host_os in
-+  cygwin* | mingw* | pw32* | cegcc*)
-+    if test "$GCC" != yes; then
-+      reload_cmds=false
-+    fi
-+    ;;
-   darwin*)
-     if test "$GCC" = yes; then
-       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-@@ -5001,7 +5086,8 @@ mingw* | pw32*)
-     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-     lt_cv_file_magic_cmd='func_win32_libid'
-   else
--    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-+    # Keep this pattern in sync with the one in func_win32_libid.
-+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-     lt_cv_file_magic_cmd='$OBJDUMP -f'
-   fi
-   ;;
-@@ -5155,6 +5241,21 @@ esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
- $as_echo "$lt_cv_deplibs_check_method" >&6; }
-+
-+file_magic_glob=
-+want_nocaseglob=no
-+if test "$build" = "$host"; then
-+  case $host_os in
-+  mingw* | pw32*)
-+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-+      want_nocaseglob=yes
-+    else
-+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
-+    fi
-+    ;;
-+  esac
-+fi
-+
- file_magic_cmd=$lt_cv_file_magic_cmd
- deplibs_check_method=$lt_cv_deplibs_check_method
- test -z "$deplibs_check_method" && deplibs_check_method=unknown
-@@ -5170,9 +5271,163 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
- 
- 
- 
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
- if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
--set dummy ${ac_tool_prefix}ar; ac_word=$2
-+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$DLLTOOL"; then
-+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+DLLTOOL=$ac_cv_prog_DLLTOOL
-+if test -n "$DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-+$as_echo "$DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_DLLTOOL"; then
-+  ac_ct_DLLTOOL=$DLLTOOL
-+  # Extract the first word of "dlltool", so it can be a program name with args.
-+set dummy dlltool; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_DLLTOOL"; then
-+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-+if test -n "$ac_ct_DLLTOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-+$as_echo "$ac_ct_DLLTOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_DLLTOOL" = x; then
-+    DLLTOOL="false"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    DLLTOOL=$ac_ct_DLLTOOL
-+  fi
-+else
-+  DLLTOOL="$ac_cv_prog_DLLTOOL"
-+fi
-+
-+test -z "$DLLTOOL" && DLLTOOL=dlltool
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-+if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_sharedlib_from_linklib_cmd='unknown'
-+
-+case $host_os in
-+cygwin* | mingw* | pw32* | cegcc*)
-+  # two different shell functions defined in ltmain.sh
-+  # decide which to use based on capabilities of $DLLTOOL
-+  case `$DLLTOOL --help 2>&1` in
-+  *--identify-strict*)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-+    ;;
-+  *)
-+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-+    ;;
-+  esac
-+  ;;
-+*)
-+  # fallback: assume linklib IS sharedlib
-+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-+  ;;
-+esac
-+
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-+
-+
-+
-+
-+
-+
-+
-+
-+if test -n "$ac_tool_prefix"; then
-+  for ac_prog in ar
-+  do
-+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_AR+set}" = set; then :
-@@ -5188,7 +5443,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_AR="${ac_tool_prefix}ar"
-+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -5208,11 +5463,15 @@ $as_echo "no" >&6; }
- fi
- 
- 
-+    test -n "$AR" && break
-+  done
- fi
--if test -z "$ac_cv_prog_AR"; then
-+if test -z "$AR"; then
-   ac_ct_AR=$AR
--  # Extract the first word of "ar", so it can be a program name with args.
--set dummy ar; ac_word=$2
-+  for ac_prog in ar
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
-@@ -5228,7 +5487,7 @@ do
-   test -z "$as_dir" && as_dir=.
-     for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
--    ac_cv_prog_ac_ct_AR="ar"
-+    ac_cv_prog_ac_ct_AR="$ac_prog"
-     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -5247,6 +5506,10 @@ else
- $as_echo "no" >&6; }
- fi
- 
-+
-+  test -n "$ac_ct_AR" && break
-+done
-+
-   if test "x$ac_ct_AR" = x; then
-     AR="false"
-   else
-@@ -5258,16 +5521,72 @@ ac_tool_warned=yes ;;
- esac
-     AR=$ac_ct_AR
-   fi
--else
--  AR="$ac_cv_prog_AR"
- fi
- 
--test -z "$AR" && AR=ar
--test -z "$AR_FLAGS" && AR_FLAGS=cru
-+: ${AR=ar}
-+: ${AR_FLAGS=cru}
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-+$as_echo_n "checking for archiver @FILE support... " >&6; }
-+if test "${lt_cv_ar_at_file+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_ar_at_file=no
-+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
- 
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+  echo conftest.$ac_objext > conftest.lst
-+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
-+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+      if test "$ac_status" -eq 0; then
-+	# Ensure the archiver fails upon bogus file names.
-+	rm -f conftest.$ac_objext libconftest.a
-+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-+  (eval $lt_ar_try) 2>&5
-+  ac_status=$?
-+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+  test $ac_status = 0; }
-+	if test "$ac_status" -ne 0; then
-+          lt_cv_ar_at_file=@
-+        fi
-+      fi
-+      rm -f conftest.* libconftest.a
- 
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- 
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-+$as_echo "$lt_cv_ar_at_file" >&6; }
- 
-+if test "x$lt_cv_ar_at_file" = xno; then
-+  archiver_list_spec=
-+else
-+  archiver_list_spec=$lt_cv_ar_at_file
-+fi
- 
- 
- 
-@@ -5609,8 +5928,8 @@ esac
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- 
- # Transform an extracted symbol line into symbol name and symbol address
--lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
--lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
- 
- # Handle CRLF in mingw tool chain
- opt_cr=
-@@ -5646,6 +5965,7 @@ for ac_symprfx in "" "_"; do
-   else
-     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-   fi
-+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
- 
-   # Check to see that the pipe works correctly.
-   pipe_works=no
-@@ -5687,6 +6007,18 @@ _LT_EOF
-       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- 	  cat <<_LT_EOF > conftest.$ac_ext
-+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-+/* DATA imports from DLLs on WIN32 con't be const, because runtime
-+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-+# define LT_DLSYM_CONST
-+#elif defined(__osf__)
-+/* This system does not cope well with relocations in const data.  */
-+# define LT_DLSYM_CONST
-+#else
-+# define LT_DLSYM_CONST const
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -5698,7 +6030,7 @@ _LT_EOF
- 	  cat <<_LT_EOF >> conftest.$ac_ext
- 
- /* The mapping between symbol names and symbols.  */
--const struct {
-+LT_DLSYM_CONST struct {
-   const char *name;
-   void       *address;
- }
-@@ -5724,8 +6056,8 @@ static const void *lt_preloaded_setup() {
- _LT_EOF
- 	  # Now try linking the two files.
- 	  mv conftest.$ac_objext conftstm.$ac_objext
--	  lt_save_LIBS="$LIBS"
--	  lt_save_CFLAGS="$CFLAGS"
-+	  lt_globsym_save_LIBS=$LIBS
-+	  lt_globsym_save_CFLAGS=$CFLAGS
- 	  LIBS="conftstm.$ac_objext"
- 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-@@ -5735,8 +6067,8 @@ _LT_EOF
-   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
- 	    pipe_works=yes
- 	  fi
--	  LIBS="$lt_save_LIBS"
--	  CFLAGS="$lt_save_CFLAGS"
-+	  LIBS=$lt_globsym_save_LIBS
-+	  CFLAGS=$lt_globsym_save_CFLAGS
- 	else
- 	  echo "cannot find nm_test_func in $nlist" >&5
- 	fi
-@@ -5773,6 +6105,19 @@ else
- $as_echo "ok" >&6; }
- fi
- 
-+# Response file support.
-+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-+  nm_file_list_spec='@'
-+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
-+  nm_file_list_spec='@'
-+fi
-+
-+
-+
-+
-+
-+
-+
- 
- 
- 
-@@ -5793,6 +6138,41 @@ fi
- 
- 
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-+$as_echo_n "checking for sysroot... " >&6; }
-+
-+# Check whether --with-libtool-sysroot was given.
-+if test "${with_libtool_sysroot+set}" = set; then :
-+  withval=$with_libtool_sysroot;
-+else
-+  with_libtool_sysroot=no
-+fi
-+
-+
-+lt_sysroot=
-+case ${with_libtool_sysroot} in #(
-+ yes)
-+   if test "$GCC" = yes; then
-+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-+   fi
-+   ;; #(
-+ /*)
-+   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
-+   ;; #(
-+ no|'')
-+   ;; #(
-+ *)
-+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
-+$as_echo "${with_libtool_sysroot}" >&6; }
-+   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
-+   ;;
-+esac
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-+$as_echo "${lt_sysroot:-no}" >&6; }
-+
-+
-+
- 
- 
- # Check whether --enable-libtool-lock was given.
-@@ -6004,6 +6384,123 @@ esac
- 
- need_locks="$enable_libtool_lock"
- 
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$MANIFEST_TOOL"; then
-+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-+if test -n "$MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-+$as_echo "$MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
-+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
-+  # Extract the first word of "mt", so it can be a program name with args.
-+set dummy mt; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-+if test -n "$ac_ct_MANIFEST_TOOL"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
-+    MANIFEST_TOOL=":"
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
-+  fi
-+else
-+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-+fi
-+
-+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-+if test "${lt_cv_path_mainfest_tool+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_path_mainfest_tool=no
-+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
-+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-+  cat conftest.err >&5
-+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-+    lt_cv_path_mainfest_tool=yes
-+  fi
-+  rm -f conftest*
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-+if test "x$lt_cv_path_mainfest_tool" != xyes; then
-+  MANIFEST_TOOL=:
-+fi
-+
-+
-+
-+
-+
- 
-   case $host_os in
-     rhapsody* | darwin*)
-@@ -6570,6 +7067,8 @@ _LT_EOF
-       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-       echo "$AR cru libconftest.a conftest.o" >&5
-       $AR cru libconftest.a conftest.o 2>&5
-+      echo "$RANLIB libconftest.a" >&5
-+      $RANLIB libconftest.a 2>&5
-       cat > conftest.c << _LT_EOF
- int main() { return 0;}
- _LT_EOF
-@@ -7033,7 +7532,8 @@ fi
- LIBTOOL_DEPS="$ltmain"
- 
- # Always use our own libtool.
--LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-+LIBTOOL='$(SHELL) $(top_builddir)'
-+LIBTOOL="$LIBTOOL/${host_alias}-libtool"
- 
- 
- 
-@@ -7122,7 +7622,7 @@ aix3*)
- esac
- 
- # Global variables:
--ofile=libtool
-+ofile=${host_alias}-libtool
- can_build_shared=yes
- 
- # All known linkers require a `.a' archive for static linking (except MSVC,
-@@ -7420,8 +7920,6 @@ fi
- lt_prog_compiler_pic=
- lt_prog_compiler_static=
- 
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
--$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 
-   if test "$GCC" = yes; then
-     lt_prog_compiler_wl='-Wl,'
-@@ -7587,6 +8085,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- 	lt_prog_compiler_pic='--shared'
- 	lt_prog_compiler_static='--static'
- 	;;
-+      nagfor*)
-+	# NAG Fortran compiler
-+	lt_prog_compiler_wl='-Wl,-Wl,,'
-+	lt_prog_compiler_pic='-PIC'
-+	lt_prog_compiler_static='-Bstatic'
-+	;;
-       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-         # Portland Group compilers (*not* the Pentium gcc compiler,
- 	# which looks to be a dead project)
-@@ -7649,7 +8153,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-       lt_prog_compiler_pic='-KPIC'
-       lt_prog_compiler_static='-Bstatic'
-       case $cc_basename in
--      f77* | f90* | f95*)
-+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- 	lt_prog_compiler_wl='-Qoption ld ';;
-       *)
- 	lt_prog_compiler_wl='-Wl,';;
-@@ -7706,13 +8210,17 @@ case $host_os in
-     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-     ;;
- esac
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
--$as_echo "$lt_prog_compiler_pic" >&6; }
--
--
--
--
- 
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-+if test "${lt_cv_prog_compiler_pic+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
- 
- #
- # Check to make sure the PIC flag actually works.
-@@ -7773,6 +8281,11 @@ fi
- 
- 
- 
-+
-+
-+
-+
-+
- #
- # Check to make sure the static flag actually works.
- #
-@@ -8123,7 +8636,8 @@ _LT_EOF
-       allow_undefined_flag=unsupported
-       always_export_symbols=no
-       enable_shared_with_static_runtimes=yes
--      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
- 
-       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-@@ -8222,12 +8736,12 @@ _LT_EOF
- 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- 	  hardcode_libdir_flag_spec=
- 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
--	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- 	  if test "x$supports_anon_versioning" = xyes; then
- 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- 	      echo "local: *; };" >> $output_objdir/$libname.ver~
--	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- 	  fi
- 	  ;;
- 	esac
-@@ -8241,8 +8755,8 @@ _LT_EOF
- 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- 	wlarc=
-       else
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       fi
-       ;;
- 
-@@ -8260,8 +8774,8 @@ _LT_EOF
- 
- _LT_EOF
-       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -8307,8 +8821,8 @@ _LT_EOF
- 
-     *)
-       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
--	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-       else
- 	ld_shlibs=no
-       fi
-@@ -8438,7 +8952,13 @@ _LT_EOF
- 	allow_undefined_flag='-berok'
-         # Determine the default libpath from the value encoded in an
-         # empty executable.
--        if test x$gcc_no_link = xyes; then
-+        if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test x$gcc_no_link = xyes; then
-   as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
- fi
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -8454,22 +8974,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
-         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-@@ -8481,7 +9008,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	else
- 	 # Determine the default libpath from the value encoded in an
- 	 # empty executable.
--	 if test x$gcc_no_link = xyes; then
-+	 if test "${lt_cv_aix_libpath+set}" = set; then
-+  aix_libpath=$lt_cv_aix_libpath
-+else
-+  if test "${lt_cv_aix_libpath_+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test x$gcc_no_link = xyes; then
-   as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
- fi
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -8497,22 +9030,29 @@ main ()
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- 
--lt_aix_libpath_sed='
--    /Import File Strings/,/^$/ {
--	/^0/ {
--	    s/^0  *\(.*\)$/\1/
--	    p
--	}
--    }'
--aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--# Check for a 64-bit object if we didn't find anything.
--if test -z "$aix_libpath"; then
--  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
--fi
-+  lt_aix_libpath_sed='
-+      /Import File Strings/,/^$/ {
-+	  /^0/ {
-+	      s/^0  *\([^ ]*\) *$/\1/
-+	      p
-+	  }
-+      }'
-+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  # Check for a 64-bit object if we didn't find anything.
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-+  fi
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-+  if test -z "$lt_cv_aix_libpath_"; then
-+    lt_cv_aix_libpath_="/usr/lib:/lib"
-+  fi
-+
-+fi
-+
-+  aix_libpath=$lt_cv_aix_libpath_
-+fi
- 
- 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- 	  # Warning - without using the other run time loading flags,
-@@ -8557,20 +9097,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-       # Microsoft Visual C++.
-       # hardcode_libdir_flag_spec is actually meaningless, as there is
-       # no search path for DLLs.
--      hardcode_libdir_flag_spec=' '
--      allow_undefined_flag=unsupported
--      # Tell ltmain to make .lib files, not .a files.
--      libext=lib
--      # Tell ltmain to make .dll files, not .so files.
--      shrext_cmds=".dll"
--      # FIXME: Setting linknames here is a bad hack.
--      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
--      # The linker will automatically build a .lib file if we build a DLL.
--      old_archive_from_new_cmds='true'
--      # FIXME: Should let the user specify the lib program.
--      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
--      fix_srcfile_path='`cygpath -w "$srcfile"`'
--      enable_shared_with_static_runtimes=yes
-+      case $cc_basename in
-+      cl*)
-+	# Native MSVC
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	always_export_symbols=yes
-+	file_list_spec='@'
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-+	  else
-+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-+	  fi~
-+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-+	  linknames='
-+	# The linker will not automatically build a static lib if we build a DLL.
-+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
-+	enable_shared_with_static_runtimes=yes
-+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-+	# Don't use ranlib
-+	old_postinstall_cmds='chmod 644 $oldlib'
-+	postlink_cmds='lt_outputfile="@OUTPUT@"~
-+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-+	  case $lt_outputfile in
-+	    *.exe|*.EXE) ;;
-+	    *)
-+	      lt_outputfile="$lt_outputfile.exe"
-+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-+	      ;;
-+	  esac~
-+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-+	    $RM "$lt_outputfile.manifest";
-+	  fi'
-+	;;
-+      *)
-+	# Assume MSVC wrapper
-+	hardcode_libdir_flag_spec=' '
-+	allow_undefined_flag=unsupported
-+	# Tell ltmain to make .lib files, not .a files.
-+	libext=lib
-+	# Tell ltmain to make .dll files, not .so files.
-+	shrext_cmds=".dll"
-+	# FIXME: Setting linknames here is a bad hack.
-+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-+	# The linker will automatically build a .lib file if we build a DLL.
-+	old_archive_from_new_cmds='true'
-+	# FIXME: Should let the user specify the lib program.
-+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-+	enable_shared_with_static_runtimes=yes
-+	;;
-+      esac
-       ;;
- 
-     darwin* | rhapsody*)
-@@ -8631,7 +9214,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-     freebsd* | dragonfly*)
--      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-       hardcode_direct=yes
-       hardcode_shlibpath_var=no
-@@ -8639,7 +9222,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux9*)
-       if test "$GCC" = yes; then
--	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       else
- 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-       fi
-@@ -8655,7 +9238,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 
-     hpux10*)
-       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
--	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-       else
- 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-       fi
-@@ -8679,10 +9262,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
- 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	ia64*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	*)
--	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- 	  ;;
- 	esac
-       else
-@@ -8761,26 +9344,39 @@ fi
- 
-     irix5* | irix6* | nonstopux*)
-       if test "$GCC" = yes; then
--	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	# Try to use the -exported_symbol ld option, if it does not
- 	# work, assume that -exports_file does not work either and
- 	# implicitly export all symbols.
--        save_LDFLAGS="$LDFLAGS"
--        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
--        if test x$gcc_no_link = xyes; then
-+	# This should be the same for all languages, so no per-tag cache variable.
-+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-+if test "${lt_cv_irix_exported_symbol+set}" = set; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  save_LDFLAGS="$LDFLAGS"
-+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-+	   if test x$gcc_no_link = xyes; then
-   as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
- fi
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
--int foo(void) {}
-+int foo (void) { return 0; }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
--  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
--
-+  lt_cv_irix_exported_symbol=yes
-+else
-+  lt_cv_irix_exported_symbol=no
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
--        LDFLAGS="$save_LDFLAGS"
-+           LDFLAGS="$save_LDFLAGS"
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
-+	if test "$lt_cv_irix_exported_symbol" = yes; then
-+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-+	fi
-       else
- 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-@@ -8865,7 +9461,7 @@ rm -f core conftest.err conftest.$ac_objext \
-     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-       if test "$GCC" = yes; then
- 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
--	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-       else
- 	allow_undefined_flag=' -expect_unresolved \*'
-@@ -8884,9 +9480,9 @@ rm -f core conftest.err conftest.$ac_objext \
-       no_undefined_flag=' -z defs'
-       if test "$GCC" = yes; then
- 	wlarc='${wl}'
--	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
--	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-       else
- 	case `$CC -V 2>&1` in
- 	*"Compilers 5.0"*)
-@@ -9462,8 +10058,9 @@ cygwin* | mingw* | pw32* | cegcc*)
-   need_version=no
-   need_lib_prefix=no
- 
--  case $GCC,$host_os in
--  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-+  case $GCC,$cc_basename in
-+  yes,*)
-+    # gcc
-     library_names_spec='$libname.dll.a'
-     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-     postinstall_cmds='base_file=`basename \${file}`~
-@@ -9496,13 +10093,71 @@ cygwin* | mingw* | pw32* | cegcc*)
-       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-       ;;
-     esac
-+    dynamic_linker='Win32 ld.exe'
-+    ;;
-+
-+  *,cl*)
-+    # Native MSVC
-+    libname_spec='$name'
-+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-+    library_names_spec='${libname}.dll.lib'
-+
-+    case $build_os in
-+    mingw*)
-+      sys_lib_search_path_spec=
-+      lt_save_ifs=$IFS
-+      IFS=';'
-+      for lt_path in $LIB
-+      do
-+        IFS=$lt_save_ifs
-+        # Let DOS variable expansion print the short 8.3 style file name.
-+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-+      done
-+      IFS=$lt_save_ifs
-+      # Convert to MSYS style.
-+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-+      ;;
-+    cygwin*)
-+      # Convert to unix form, then to dos form, then back to unix form
-+      # but this time dos style (no spaces!) so that the unix form looks
-+      # like /cygdrive/c/PROGRA~1:/cygdr...
-+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      ;;
-+    *)
-+      sys_lib_search_path_spec="$LIB"
-+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-+        # It is most probably a Windows format PATH.
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-+      else
-+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-+      fi
-+      # FIXME: find the short name or the path components, as spaces are
-+      # common. (e.g. "Program Files" -> "PROGRA~1")
-+      ;;
-+    esac
-+
-+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-+    postinstall_cmds='base_file=`basename \${file}`~
-+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-+      dldir=$destdir/`dirname \$dlpath`~
-+      test -d \$dldir || mkdir -p \$dldir~
-+      $install_prog $dir/$dlname \$dldir/$dlname'
-+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-+      dlpath=$dir/\$dldll~
-+       $RM \$dlpath'
-+    shlibpath_overrides_runpath=yes
-+    dynamic_linker='Win32 link.exe'
-     ;;
- 
-   *)
-+    # Assume MSVC wrapper
-     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-+    dynamic_linker='Win32 ld.exe'
-     ;;
-   esac
--  dynamic_linker='Win32 ld.exe'
-   # FIXME: first we should search . and the directory the executable is in
-   shlibpath_var=PATH
-   ;;
-@@ -9594,7 +10249,7 @@ haiku*)
-   soname_spec='${libname}${release}${shared_ext}$major'
-   shlibpath_var=LIBRARY_PATH
-   shlibpath_overrides_runpath=yes
--  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
-+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-   hardcode_into_libs=yes
-   ;;
- 
-@@ -10408,7 +11063,7 @@ else
-   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-   lt_status=$lt_dlunknown
-   cat > conftest.$ac_ext <<_LT_EOF
--#line 10411 "configure"
-+#line $LINENO "configure"
- #include "confdefs.h"
- 
- #if HAVE_DLFCN_H
-@@ -10452,10 +11107,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -10514,7 +11169,7 @@ else
-   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-   lt_status=$lt_dlunknown
-   cat > conftest.$ac_ext <<_LT_EOF
--#line 10517 "configure"
-+#line $LINENO "configure"
- #include "confdefs.h"
- 
- #if HAVE_DLFCN_H
-@@ -10558,10 +11213,10 @@ else
- /* When -fvisbility=hidden is used, assume the code has been annotated
-    correspondingly for the symbols needed.  */
- #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
--void fnord () __attribute__((visibility("default")));
-+int fnord () __attribute__((visibility("default")));
- #endif
- 
--void fnord () { int i=42; }
-+int fnord () { return 42; }
- int main ()
- {
-   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-@@ -11993,13 +12648,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
- lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
- lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
- lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
- reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
- reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
- OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
- deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
- file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
- AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
- AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
- STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
- RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
- old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-@@ -12014,14 +12676,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
- lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
- objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
- MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
--lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
- lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
- lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
- need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
- DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
- NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
- LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-@@ -12054,12 +12719,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
- hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
- inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
- link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
--fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
- always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
- export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
- exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
- include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
- prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
- file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
- variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
- need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-@@ -12114,8 +12779,13 @@ reload_flag \
- OBJDUMP \
- deplibs_check_method \
- file_magic_cmd \
-+file_magic_glob \
-+want_nocaseglob \
-+DLLTOOL \
-+sharedlib_from_linklib_cmd \
- AR \
- AR_FLAGS \
-+archiver_list_spec \
- STRIP \
- RANLIB \
- CC \
-@@ -12125,12 +12795,14 @@ lt_cv_sys_global_symbol_pipe \
- lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-+nm_file_list_spec \
- lt_prog_compiler_no_builtin_flag \
--lt_prog_compiler_wl \
- lt_prog_compiler_pic \
-+lt_prog_compiler_wl \
- lt_prog_compiler_static \
- lt_cv_prog_compiler_c_o \
- need_locks \
-+MANIFEST_TOOL \
- DSYMUTIL \
- NMEDIT \
- LIPO \
-@@ -12146,7 +12818,6 @@ no_undefined_flag \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
--fix_srcfile_path \
- exclude_expsyms \
- include_expsyms \
- file_list_spec \
-@@ -12182,6 +12853,7 @@ module_cmds \
- module_expsym_cmds \
- export_symbols_cmds \
- prelink_cmds \
-+postlink_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- finish_cmds \
-@@ -12771,7 +13443,8 @@ $as_echo X"$file" |
- # NOTE: Changes made to this file will be lost: look at ltmain.sh.
- #
- #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
--#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-+#                 Inc.
- #   Written by Gordon Matzigkeit, 1996
- #
- #   This file is part of GNU Libtool.
-@@ -12874,19 +13547,42 @@ SP2NL=$lt_lt_SP2NL
- # turn newlines into spaces.
- NL2SP=$lt_lt_NL2SP
- 
-+# convert \$build file names to \$host format.
-+to_host_file_cmd=$lt_cv_to_host_file_cmd
-+
-+# convert \$build files to toolchain format.
-+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-+
- # An object symbol dumper.
- OBJDUMP=$lt_OBJDUMP
- 
- # Method to check whether dependent libraries are shared objects.
- deplibs_check_method=$lt_deplibs_check_method
- 
--# Command to use when deplibs_check_method == "file_magic".
-+# Command to use when deplibs_check_method = "file_magic".
- file_magic_cmd=$lt_file_magic_cmd
- 
-+# How to find potential files when deplibs_check_method = "file_magic".
-+file_magic_glob=$lt_file_magic_glob
-+
-+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-+want_nocaseglob=$lt_want_nocaseglob
-+
-+# DLL creation program.
-+DLLTOOL=$lt_DLLTOOL
-+
-+# Command to associate shared and link libraries.
-+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-+
- # The archiver.
- AR=$lt_AR
-+
-+# Flags to create an archive.
- AR_FLAGS=$lt_AR_FLAGS
- 
-+# How to feed a file listing to the archiver.
-+archiver_list_spec=$lt_archiver_list_spec
-+
- # A symbol stripping program.
- STRIP=$lt_STRIP
- 
-@@ -12916,6 +13612,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
- # Transform the output of nm in a C name address pair when lib prefix is needed.
- global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
- 
-+# Specify filename containing input files for \$NM.
-+nm_file_list_spec=$lt_nm_file_list_spec
-+
-+# The root where to search for dependent libraries,and in which our libraries should be installed.
-+lt_sysroot=$lt_sysroot
-+
- # The name of the directory that contains temporary libtool files.
- objdir=$objdir
- 
-@@ -12925,6 +13627,9 @@ MAGIC_CMD=$MAGIC_CMD
- # Must we lock files when doing compilation?
- need_locks=$lt_need_locks
- 
-+# Manifest tool.
-+MANIFEST_TOOL=$lt_MANIFEST_TOOL
-+
- # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
- DSYMUTIL=$lt_DSYMUTIL
- 
-@@ -13039,12 +13744,12 @@ with_gcc=$GCC
- # Compiler flag to turn off builtin functions.
- no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
- 
--# How to pass a linker flag through the compiler.
--wl=$lt_lt_prog_compiler_wl
--
- # Additional compiler flags for building library objects.
- pic_flag=$lt_lt_prog_compiler_pic
- 
-+# How to pass a linker flag through the compiler.
-+wl=$lt_lt_prog_compiler_wl
-+
- # Compiler flag to prevent dynamic linking.
- link_static_flag=$lt_lt_prog_compiler_static
- 
-@@ -13131,9 +13836,6 @@ inherit_rpath=$inherit_rpath
- # Whether libtool must link a program against all its dependency libraries.
- link_all_deplibs=$link_all_deplibs
- 
--# Fix the shell variable \$srcfile for the compiler.
--fix_srcfile_path=$lt_fix_srcfile_path
--
- # Set to "yes" if exported symbols are required.
- always_export_symbols=$always_export_symbols
- 
-@@ -13149,6 +13851,9 @@ include_expsyms=$lt_include_expsyms
- # Commands necessary for linking programs (against libraries) with templates.
- prelink_cmds=$lt_prelink_cmds
- 
-+# Commands necessary for finishing linking programs.
-+postlink_cmds=$lt_postlink_cmds
-+
- # Specify filename containing input files.
- file_list_spec=$lt_file_list_spec
- 
-@@ -13181,210 +13886,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
-   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-   # text mode, it properly converts lines to CR/LF.  This bash problem
-   # is reportedly fixed, but why not run on old versions too?
--  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  case $xsi_shell in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result="${1##*/}"
--}
--
--# func_dirname_and_basename file append nondir_replacement
--# perform func_basename and func_dirname in a single function
--# call:
--#   dirname:  Compute the dirname of FILE.  If nonempty,
--#             add APPEND to the result, otherwise set result
--#             to NONDIR_REPLACEMENT.
--#             value returned in "$func_dirname_result"
--#   basename: Compute filename of FILE.
--#             value retuned in "$func_basename_result"
--# Implementation must be kept synchronized with func_dirname
--# and func_basename. For efficiency, we do not delegate to
--# those functions but instead duplicate the functionality here.
--func_dirname_and_basename ()
--{
--  case ${1} in
--    */*) func_dirname_result="${1%/*}${2}" ;;
--    *  ) func_dirname_result="${3}" ;;
--  esac
--  func_basename_result="${1##*/}"
--}
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--func_stripname ()
--{
--  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
--  # positional parameters, so assign one to ordinary parameter first.
--  func_stripname_result=${3}
--  func_stripname_result=${func_stripname_result#"${1}"}
--  func_stripname_result=${func_stripname_result%"${2}"}
--}
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=${1%%=*}
--  func_opt_split_arg=${1#*=}
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  case ${1} in
--    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
--    *)    func_lo2o_result=${1} ;;
--  esac
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=${1%.*}.lo
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=$(( $* ))
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=${#1}
--}
--
--_LT_EOF
--    ;;
--  *) # Bourne compatible functions.
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_dirname file append nondir_replacement
--# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
--# otherwise set result to NONDIR_REPLACEMENT.
--func_dirname ()
--{
--  # Extract subdirectory from the argument.
--  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
--  if test "X$func_dirname_result" = "X${1}"; then
--    func_dirname_result="${3}"
--  else
--    func_dirname_result="$func_dirname_result${2}"
--  fi
--}
--
--# func_basename file
--func_basename ()
--{
--  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
--}
--
--
--# func_stripname prefix suffix name
--# strip PREFIX and SUFFIX off of NAME.
--# PREFIX and SUFFIX must not contain globbing or regex special
--# characters, hashes, percent signs, but SUFFIX may contain a leading
--# dot (in which case that matches only a dot).
--# func_strip_suffix prefix name
--func_stripname ()
--{
--  case ${2} in
--    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
--    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
--  esac
--}
--
--# sed scripts:
--my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
--my_sed_long_arg='1s/^-[^=]*=//'
--
--# func_opt_split
--func_opt_split ()
--{
--  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
--  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
--}
--
--# func_lo2o object
--func_lo2o ()
--{
--  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
--}
--
--# func_xform libobj-or-source
--func_xform ()
--{
--  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
--}
--
--# func_arith arithmetic-term...
--func_arith ()
--{
--  func_arith_result=`expr "$@"`
--}
--
--# func_len string
--# STRING may not start with a hyphen.
--func_len ()
--{
--  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
--}
--
--_LT_EOF
--esac
--
--case $lt_shell_append in
--  yes)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1+=\$2"
--}
--_LT_EOF
--    ;;
--  *)
--    cat << \_LT_EOF >> "$cfgfile"
--
--# func_append var value
--# Append VALUE to the end of shell variable VAR.
--func_append ()
--{
--  eval "$1=\$$1\$2"
--}
--
--_LT_EOF
--    ;;
--  esac
--
--
--  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
--    || (rm -f "$cfgfile"; exit 1)
--
--  mv -f "$cfgfile" "$ofile" ||
-+  sed '$q' "$ltmain" >> "$cfgfile" \
-+     || (rm -f "$cfgfile"; exit 1)
-+
-+  if test x"$xsi_shell" = xyes; then
-+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-+func_dirname ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-+func_basename ()\
-+{\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-+func_dirname_and_basename ()\
-+{\
-+\    case ${1} in\
-+\      */*) func_dirname_result="${1%/*}${2}" ;;\
-+\      *  ) func_dirname_result="${3}" ;;\
-+\    esac\
-+\    func_basename_result="${1##*/}"\
-+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-+func_stripname ()\
-+{\
-+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-+\    # positional parameters, so assign one to ordinary parameter first.\
-+\    func_stripname_result=${3}\
-+\    func_stripname_result=${func_stripname_result#"${1}"}\
-+\    func_stripname_result=${func_stripname_result%"${2}"}\
-+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-+func_split_long_opt ()\
-+{\
-+\    func_split_long_opt_name=${1%%=*}\
-+\    func_split_long_opt_arg=${1#*=}\
-+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-+func_split_short_opt ()\
-+{\
-+\    func_split_short_opt_arg=${1#??}\
-+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-+func_lo2o ()\
-+{\
-+\    case ${1} in\
-+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-+\      *)    func_lo2o_result=${1} ;;\
-+\    esac\
-+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-+func_xform ()\
-+{\
-+    func_xform_result=${1%.*}.lo\
-+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-+func_arith ()\
-+{\
-+    func_arith_result=$(( $* ))\
-+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_len ()$/,/^} # func_len /c\
-+func_len ()\
-+{\
-+    func_len_result=${#1}\
-+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+fi
-+
-+if test x"$lt_shell_append" = xyes; then
-+  sed -e '/^func_append ()$/,/^} # func_append /c\
-+func_append ()\
-+{\
-+    eval "${1}+=\\${2}"\
-+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-+func_append_quoted ()\
-+{\
-+\    func_quote_for_eval "${2}"\
-+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-+  && mv -f "$cfgfile.tmp" "$cfgfile" \
-+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+test 0 -eq $? || _lt_function_replace_fail=:
-+
-+
-+  # Save a `func_append' function call where possible by direct use of '+='
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+else
-+  # Save a `func_append' function call even when '+=' is not available
-+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-+    && mv -f "$cfgfile.tmp" "$cfgfile" \
-+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-+  test 0 -eq $? || _lt_function_replace_fail=:
-+fi
-+
-+if test x"$_lt_function_replace_fail" = x":"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-+fi
-+
-+
-+   mv -f "$cfgfile" "$ofile" ||
-     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-   chmod +x "$ofile"
- 
--- 
-2.9.0
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch
deleted file mode 100644
index 795abf3..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 9475aee8a702aa531737ec12dfd928d52951bc84 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 2 Mar 2015 01:37:10 +0000
-Subject: [PATCH 07/13] Add the armv5e architecture to binutils
-
-Binutils has a comment that indicates it is supposed to match gcc for
-all of the support "-march=" settings, but it was lacking the armv5e setting.
-This was a simple way to add it, as thumb instructions shouldn't be generated
-by the compiler anyway.
-
-Upstream-Status: Denied
-Upstream maintainer indicated that we should not be using armv5e, even
-though it is a legal archicture defined by our gcc.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- gas/config/tc-arm.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
-index 73d0531..4b9e32f 100644
---- a/gas/config/tc-arm.c
-+++ b/gas/config/tc-arm.c
-@@ -25421,6 +25421,7 @@ static const struct arm_arch_option_table arm_archs[] =
-   ARM_ARCH_OPT ("armv4t",	ARM_ARCH_V4T,	 FPU_ARCH_FPA),
-   ARM_ARCH_OPT ("armv4txm",	ARM_ARCH_V4TxM,	 FPU_ARCH_FPA),
-   ARM_ARCH_OPT ("armv5",	ARM_ARCH_V5,	 FPU_ARCH_VFP),
-+  ARM_ARCH_OPT ("armv5e",	ARM_ARCH_V5TE,	 FPU_ARCH_VFP),
-   ARM_ARCH_OPT ("armv5t",	ARM_ARCH_V5T,	 FPU_ARCH_VFP),
-   ARM_ARCH_OPT ("armv5txm",	ARM_ARCH_V5TxM,	 FPU_ARCH_VFP),
-   ARM_ARCH_OPT ("armv5te",	ARM_ARCH_V5TE,	 FPU_ARCH_VFP),
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch
new file mode 100644
index 0000000..6b7f753
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch
@@ -0,0 +1,21137 @@
+From 9a3651e120261c72090689ad770ad048b0baf506 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Mar 2017 23:28:33 -0800
+Subject: [PATCH 07/15] Use libtool 2.4
+
+get libtool sysroot support
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate [ OE configuration Specific]
+
+ bfd/configure        | 1318 +++++++++++++++++------
+ bfd/configure.ac     |    2 +-
+ binutils/configure   | 1316 +++++++++++++++++------
+ gas/configure        | 1314 +++++++++++++++++------
+ gprof/configure      | 1321 +++++++++++++++++------
+ ld/configure         | 1691 +++++++++++++++++++++--------
+ libtool.m4           | 1080 +++++++++++++------
+ ltmain.sh            | 2925 +++++++++++++++++++++++++++++++++-----------------
+ ltoptions.m4         |    2 +-
+ ltversion.m4         |   12 +-
+ lt~obsolete.m4       |    2 +-
+ opcodes/configure    | 1318 +++++++++++++++++------
+ opcodes/configure.ac |    2 +-
+ zlib/configure       | 1316 +++++++++++++++++------
+ 14 files changed, 9926 insertions(+), 3693 deletions(-)
+
+diff --git a/bfd/configure b/bfd/configure
+index f30bfabef3..fa1a545e9d 100755
+--- a/bfd/configure
++++ b/bfd/configure
+@@ -672,6 +672,9 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
++ac_ct_AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -785,6 +788,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1461,6 +1465,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+   --with-mmap             try using mmap for BFD input files if available
+   --with-separate-debug-dir=DIR
+                           Look for global separate debug info in DIR
+@@ -5393,8 +5399,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -5434,7 +5440,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -6120,8 +6126,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -6170,6 +6176,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -6186,6 +6266,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6354,7 +6439,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -6508,6 +6594,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6523,9 +6624,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6541,7 +6795,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6561,11 +6815,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6581,7 +6839,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6600,6 +6858,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6611,16 +6873,72 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
+ 
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
+ 
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
+ 
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
+ 
+ 
+ 
+@@ -6962,8 +7280,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6999,6 +7317,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -7040,6 +7359,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -7051,7 +7382,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -7077,8 +7408,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -7088,8 +7419,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -7126,6 +7457,16 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
+ 
+ 
+ 
+@@ -7147,6 +7488,45 @@ fi
+ 
+ 
+ 
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
++
++
++
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+   enableval=$enable_libtool_lock;
+@@ -7353,6 +7733,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -7916,6 +8413,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -8080,7 +8579,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -8169,7 +8669,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8467,8 +8967,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8634,6 +9132,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8696,7 +9200,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -8753,13 +9257,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8820,6 +9328,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -9170,7 +9683,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -9269,12 +9783,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -9288,8 +9802,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -9307,8 +9821,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9354,8 +9868,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9485,7 +9999,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9498,22 +10018,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9525,7 +10052,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9538,22 +10071,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9598,20 +10138,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9672,7 +10255,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9680,7 +10263,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9696,7 +10279,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -9720,10 +10303,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -9802,23 +10385,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9903,7 +10499,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -9922,9 +10518,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -10500,8 +11096,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10534,13 +11131,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10632,7 +11287,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -11472,10 +12127,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11578,10 +12233,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -14122,7 +14777,7 @@ SHARED_LDFLAGS=
+ if test "$enable_shared" = "yes"; then
+   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+   if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+   fi
+ 
+ # More hacks to build DLLs on Windows.
+@@ -16826,13 +17481,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -16847,14 +17509,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -16887,12 +17552,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -16947,8 +17612,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -16958,12 +17628,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -16979,7 +17651,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -17015,6 +17686,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -17794,7 +18466,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -17897,19 +18570,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -17939,6 +18635,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -17948,6 +18650,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -18062,12 +18767,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -18154,9 +18859,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -18172,6 +18874,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -18204,210 +18909,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+diff --git a/bfd/configure.ac b/bfd/configure.ac
+index 9a183c1628..3d8ea07836 100644
+--- a/bfd/configure.ac
++++ b/bfd/configure.ac
+@@ -253,7 +253,7 @@ changequote(,)dnl
+   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+ changequote([,])dnl
+   if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+   fi
+ 
+ # More hacks to build DLLs on Windows.
+diff --git a/binutils/configure b/binutils/configure
+index 82119efe72..4a98918ce1 100755
+--- a/binutils/configure
++++ b/binutils/configure
+@@ -659,8 +659,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -772,6 +775,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1444,6 +1448,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+   --with-system-zlib      use installed libz
+   --with-gnu-ld           assume the C compiler uses GNU ld default=no
+   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
+@@ -5160,8 +5166,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -5201,7 +5207,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5887,8 +5893,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -5937,6 +5943,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5953,6 +6033,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6121,7 +6206,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -6275,6 +6361,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6290,9 +6391,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6308,7 +6562,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6328,11 +6582,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6348,7 +6606,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6367,6 +6625,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6378,12 +6640,10 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
+ 
+ 
+ 
+@@ -6395,6 +6655,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}strip; ac_word=$2
+@@ -6729,8 +7047,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6766,6 +7084,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -6807,6 +7126,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6818,7 +7149,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -6844,8 +7175,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6855,8 +7186,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -6893,6 +7224,21 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
++
++
+ 
+ 
+ 
+@@ -6910,6 +7256,40 @@ fi
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
+ 
+ 
+ 
+@@ -7120,6 +7500,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -7683,6 +8180,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7878,7 +8377,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -7967,7 +8467,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8265,8 +8765,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8432,6 +8930,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8494,7 +8998,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -8551,13 +9055,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8618,6 +9126,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8968,7 +9481,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -9067,12 +9581,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -9086,8 +9600,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -9105,8 +9619,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9152,8 +9666,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9283,7 +9797,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9296,22 +9816,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9323,7 +9850,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9336,22 +9869,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9396,20 +9936,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9470,7 +10053,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9478,7 +10061,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9494,7 +10077,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -9518,10 +10101,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -9600,23 +10183,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9701,7 +10297,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -9720,9 +10316,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -10298,8 +10894,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10332,13 +10929,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10430,7 +11085,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -11270,10 +11925,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11376,10 +12031,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -15436,13 +16091,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -15457,14 +16119,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -15497,12 +16162,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -15557,8 +16222,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -15568,12 +16238,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -15589,7 +16261,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -15625,6 +16296,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -16382,7 +17054,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -16485,19 +17158,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -16527,6 +17223,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -16536,6 +17238,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -16650,12 +17355,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -16742,9 +17447,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -16760,6 +17462,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -16792,210 +17497,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+diff --git a/gas/configure b/gas/configure
+index e574cb8514..a36f1ae161 100755
+--- a/gas/configure
++++ b/gas/configure
+@@ -650,8 +650,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -763,6 +766,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -4921,8 +4925,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -4962,7 +4966,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5648,8 +5652,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -5698,6 +5702,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5714,6 +5792,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -5882,7 +5965,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -6036,6 +6120,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6051,9 +6150,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6069,7 +6321,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6089,11 +6341,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6109,7 +6365,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6128,6 +6384,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6139,12 +6399,10 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
+ 
+ 
+ 
+@@ -6156,6 +6414,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}strip; ac_word=$2
+@@ -6490,8 +6806,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6527,6 +6843,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -6568,6 +6885,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6579,7 +6908,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -6605,8 +6934,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6616,8 +6945,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -6654,6 +6983,21 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
++
++
+ 
+ 
+ 
+@@ -6671,6 +7015,40 @@ fi
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
+ 
+ 
+ 
+@@ -6881,6 +7259,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -7444,6 +7939,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7639,7 +8136,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -7728,7 +8226,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8026,8 +8524,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8193,6 +8689,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8255,7 +8757,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -8312,13 +8814,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8379,6 +8885,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8729,7 +9240,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8828,12 +9340,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -8847,8 +9359,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -8866,8 +9378,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -8913,8 +9425,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9044,7 +9556,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9057,22 +9575,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9084,7 +9609,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9097,22 +9628,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9157,20 +9695,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9231,7 +9812,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9239,7 +9820,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9255,7 +9836,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -9279,10 +9860,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -9361,23 +9942,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9462,7 +10056,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -9481,9 +10075,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -10059,8 +10653,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10093,13 +10688,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10191,7 +10844,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -11031,10 +11684,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11137,10 +11790,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -15425,13 +16078,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -15446,14 +16106,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -15486,12 +16149,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -15546,8 +16209,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -15557,12 +16225,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -15578,7 +16248,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -15614,6 +16283,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -16378,7 +17048,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -16481,19 +17152,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -16523,6 +17217,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -16532,6 +17232,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -16646,12 +17349,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -16738,9 +17441,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -16756,6 +17456,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -16788,210 +17491,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+diff --git a/gprof/configure b/gprof/configure
+index 38a4c0b0e5..38d1f699c7 100755
+--- a/gprof/configure
++++ b/gprof/configure
+@@ -631,8 +631,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -744,6 +747,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1402,6 +1406,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+ 
+ Some influential environment variables:
+   CC          C compiler command
+@@ -4836,8 +4842,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -4877,7 +4883,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5563,8 +5569,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -5613,6 +5619,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5629,6 +5709,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -5797,7 +5882,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -5874,11 +5960,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+-linux-uclibc*)
+-  lt_cv_deplibs_check_method=pass_all
+-  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+-  ;;
+-
+ netbsd*)
+   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+@@ -5956,6 +6037,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -5971,9 +6067,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -5989,7 +6238,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6009,11 +6258,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6029,7 +6282,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6048,6 +6301,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6059,12 +6316,10 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
+ 
+ 
+ 
+@@ -6076,6 +6331,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}strip; ac_word=$2
+@@ -6410,8 +6723,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6447,6 +6760,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -6488,6 +6802,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6499,7 +6825,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -6525,8 +6851,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6536,8 +6862,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -6574,6 +6900,18 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
++
++
+ 
+ 
+ 
+@@ -6595,6 +6933,43 @@ fi
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
++
++
++
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+   enableval=$enable_libtool_lock;
+@@ -6801,6 +7176,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -7364,6 +7856,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7559,7 +8053,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -7648,7 +8143,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -7946,8 +8441,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8113,6 +8606,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8175,7 +8674,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -8232,13 +8731,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8299,6 +8802,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8649,7 +9157,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8748,12 +9257,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -8767,8 +9276,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -8786,8 +9295,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -8833,8 +9342,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -8964,7 +9473,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -8977,22 +9492,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9004,7 +9526,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9017,22 +9545,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9077,20 +9612,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9151,7 +9729,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9159,7 +9737,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9175,7 +9753,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -9199,10 +9777,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -9281,23 +9859,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9382,7 +9973,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -9401,9 +9992,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -9979,8 +10570,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10013,13 +10605,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10111,7 +10761,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -10951,10 +11601,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11057,10 +11707,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -13005,13 +13655,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -13026,14 +13683,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -13066,12 +13726,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -13126,8 +13786,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -13137,12 +13802,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -13158,7 +13825,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -13194,6 +13860,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -13950,7 +14617,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -14053,19 +14721,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -14095,6 +14786,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -14104,6 +14801,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -14218,12 +14918,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -14310,9 +15010,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -14328,6 +15025,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -14360,210 +15060,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+diff --git a/ld/configure b/ld/configure
+index a16c6db059..4277b74bad 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -659,8 +659,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -782,6 +785,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1463,6 +1467,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+   --with-lib-path=dir1:dir2...  set default LIB_PATH
+   --with-sysroot=DIR Search for usr/lib et al within DIR.
+ 
+@@ -5657,8 +5663,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -5698,7 +5704,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -6384,8 +6390,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -6434,6 +6440,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -6450,6 +6530,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6618,7 +6703,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -6772,6 +6858,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6787,9 +6888,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6805,7 +7059,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6825,11 +7079,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6845,7 +7103,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6864,6 +7122,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6875,12 +7137,12 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
+ 
+ 
+ 
+@@ -6890,6 +7152,62 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
+ 
+ 
+ if test -n "$ac_tool_prefix"; then
+@@ -7226,8 +7544,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -7263,6 +7581,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -7304,6 +7623,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -7315,7 +7646,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -7341,8 +7672,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -7352,8 +7683,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -7390,6 +7721,19 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
+ 
+ 
+ 
+@@ -7410,6 +7754,42 @@ fi
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
++
++
+ 
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+@@ -7617,6 +7997,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -8180,6 +8677,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -8248,6 +8747,16 @@ done
+ 
+ 
+ 
++func_stripname_cnf ()
++{
++  case ${2} in
++  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++  esac
++} # func_stripname_cnf
++
++
++
+ 
+ 
+ # Set options
+@@ -8376,7 +8885,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -8465,7 +8975,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8763,8 +9273,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8930,6 +9438,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8992,7 +9506,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -9049,13 +9563,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -9116,6 +9634,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -9466,7 +9989,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -9565,12 +10089,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -9584,8 +10108,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -9603,8 +10127,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9650,8 +10174,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9781,7 +10305,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9794,22 +10324,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9821,7 +10358,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9834,22 +10377,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9893,21 +10443,64 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # When not using gcc, we currently assume that we are using
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+-      # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      # no search path for DLLs.
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9968,7 +10561,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9976,7 +10569,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9992,7 +10585,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -10016,10 +10609,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -10098,23 +10691,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -10199,7 +10805,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -10218,9 +10824,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -10796,8 +11402,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10830,13 +11437,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10928,7 +11593,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -11768,10 +12433,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11874,10 +12539,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -12269,6 +12934,7 @@ $RM -r conftest*
+ 
+   # Allow CC to be a program name with arguments.
+   lt_save_CC=$CC
++  lt_save_CFLAGS=$CFLAGS
+   lt_save_LD=$LD
+   lt_save_GCC=$GCC
+   GCC=$GXX
+@@ -12286,6 +12952,7 @@ $RM -r conftest*
+   fi
+   test -z "${LDCXX+set}" || LD=$LDCXX
+   CC=${CXX-"c++"}
++  CFLAGS=$CXXFLAGS
+   compiler=$CC
+   compiler_CXX=$CC
+   for cc_temp in $compiler""; do
+@@ -12568,7 +13235,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
+           allow_undefined_flag_CXX='-berok'
+           # Determine the default libpath from the value encoded in an empty
+           # executable.
+-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++          if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath__CXX+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -12581,22 +13254,29 @@ main ()
+ _ACEOF
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath__CXX"; then
++    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath__CXX"; then
++    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath__CXX
++fi
+ 
+           hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 
+@@ -12609,7 +13289,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+           else
+ 	    # Determine the default libpath from the value encoded in an
+ 	    # empty executable.
+-	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	    if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath__CXX+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -12622,22 +13308,29 @@ main ()
+ _ACEOF
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath__CXX"; then
++    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath__CXX"; then
++    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath__CXX
++fi
+ 
+ 	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	    # Warning - without using the other run time loading flags,
+@@ -12680,29 +13373,75 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+         ;;
+ 
+       cygwin* | mingw* | pw32* | cegcc*)
+-        # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+-        # as there is no search path for DLLs.
+-        hardcode_libdir_flag_spec_CXX='-L$libdir'
+-        export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+-        allow_undefined_flag_CXX=unsupported
+-        always_export_symbols_CXX=no
+-        enable_shared_with_static_runtimes_CXX=yes
+-
+-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+-          archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-          # If the export-symbols file already is a .def file (1st line
+-          # is EXPORTS), use it as is; otherwise, prepend...
+-          archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+-	    cp $export_symbols $output_objdir/$soname.def;
+-          else
+-	    echo EXPORTS > $output_objdir/$soname.def;
+-	    cat $export_symbols >> $output_objdir/$soname.def;
+-          fi~
+-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-        else
+-          ld_shlibs_CXX=no
+-        fi
+-        ;;
++	case $GXX,$cc_basename in
++	,cl* | no,cl*)
++	  # Native MSVC
++	  # hardcode_libdir_flag_spec is actually meaningless, as there is
++	  # no search path for DLLs.
++	  hardcode_libdir_flag_spec_CXX=' '
++	  allow_undefined_flag_CXX=unsupported
++	  always_export_symbols_CXX=yes
++	  file_list_spec_CXX='@'
++	  # Tell ltmain to make .lib files, not .a files.
++	  libext=lib
++	  # Tell ltmain to make .dll files, not .so files.
++	  shrext_cmds=".dll"
++	  # FIXME: Setting linknames here is a bad hack.
++	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	  archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	    else
++	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	    fi~
++	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	    linknames='
++	  # The linker will not automatically build a static lib if we build a DLL.
++	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
++	  enable_shared_with_static_runtimes_CXX=yes
++	  # Don't use ranlib
++	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
++	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
++	    lt_tool_outputfile="@TOOL_OUTPUT@"~
++	    case $lt_outputfile in
++	      *.exe|*.EXE) ;;
++	      *)
++		lt_outputfile="$lt_outputfile.exe"
++		lt_tool_outputfile="$lt_tool_outputfile.exe"
++		;;
++	    esac~
++	    func_to_tool_file "$lt_outputfile"~
++	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	      $RM "$lt_outputfile.manifest";
++	    fi'
++	  ;;
++	*)
++	  # g++
++	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
++	  # as there is no search path for DLLs.
++	  hardcode_libdir_flag_spec_CXX='-L$libdir'
++	  export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
++	  allow_undefined_flag_CXX=unsupported
++	  always_export_symbols_CXX=no
++	  enable_shared_with_static_runtimes_CXX=yes
++
++	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
++	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	    # If the export-symbols file already is a .def file (1st line
++	    # is EXPORTS), use it as is; otherwise, prepend...
++	    archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	      cp $export_symbols $output_objdir/$soname.def;
++	    else
++	      echo EXPORTS > $output_objdir/$soname.def;
++	      cat $export_symbols >> $output_objdir/$soname.def;
++	    fi~
++	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	  else
++	    ld_shlibs_CXX=no
++	  fi
++	  ;;
++	esac
++	;;
+       darwin* | rhapsody*)
+ 
+ 
+@@ -12808,7 +13547,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+             ;;
+           *)
+             if test "$GXX" = yes; then
+-              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+             else
+               # FIXME: insert proper C++ library support
+               ld_shlibs_CXX=no
+@@ -12879,10 +13618,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	          ia64*)
+-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	          *)
+-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	        esac
+ 	      fi
+@@ -12923,9 +13662,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+           *)
+ 	    if test "$GXX" = yes; then
+ 	      if test "$with_gnu_ld" = no; then
+-	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	      else
+-	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
++	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ 	      fi
+ 	    fi
+ 	    link_all_deplibs_CXX=yes
+@@ -12995,20 +13734,20 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	      prelink_cmds_CXX='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
++		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ 	      old_archive_cmds_CXX='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
++		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ 		$RANLIB $oldlib'
+ 	      archive_cmds_CXX='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
++		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
++		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ 	      ;;
+ 	    *) # Version 6 and above use weak symbols
+ 	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+@@ -13203,7 +13942,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 		  ;;
+ 	        *)
+-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 		  ;;
+ 	      esac
+ 
+@@ -13249,7 +13988,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+       solaris*)
+         case $cc_basename in
+-          CC*)
++          CC* | sunCC*)
+ 	    # Sun C++ 4.2, 5.x and Centerline C++
+             archive_cmds_need_lc_CXX=yes
+ 	    no_undefined_flag_CXX=' -zdefs'
+@@ -13290,9 +14029,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ 	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+-	        archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ 	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
++		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+ 
+ 	        # Commands to make compiler produce verbose output that lists
+ 	        # what "hidden" libraries, object files and flags are used when
+@@ -13427,6 +14166,13 @@ private:
+ };
+ _LT_EOF
+ 
++
++_lt_libdeps_save_CFLAGS=$CFLAGS
++case "$CC $CFLAGS " in #(
++*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
++*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
++esac
++
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+   (eval $ac_compile) 2>&5
+   ac_status=$?
+@@ -13440,7 +14186,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+   pre_test_object_deps_done=no
+ 
+   for p in `eval "$output_verbose_link_cmd"`; do
+-    case $p in
++    case ${prev}${p} in
+ 
+     -L* | -R* | -l*)
+        # Some compilers place space between "-{L,R}" and the path.
+@@ -13449,13 +14195,22 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+           test $p = "-R"; then
+ 	 prev=$p
+ 	 continue
+-       else
+-	 prev=
+        fi
+ 
++       # Expand the sysroot to ease extracting the directories later.
++       if test -z "$prev"; then
++         case $p in
++         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
++         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
++         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
++         esac
++       fi
++       case $p in
++       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
++       esac
+        if test "$pre_test_object_deps_done" = no; then
+-	 case $p in
+-	 -L* | -R*)
++	 case ${prev} in
++	 -L | -R)
+ 	   # Internal compiler library paths should come after those
+ 	   # provided the user.  The postdeps already come after the
+ 	   # user supplied libs so there is no need to process them.
+@@ -13475,8 +14230,10 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ 	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ 	 fi
+        fi
++       prev=
+        ;;
+ 
++    *.lto.$objext) ;; # Ignore GCC LTO objects
+     *.$objext)
+        # This assumes that the test object file only shows up
+        # once in the compiler output.
+@@ -13512,6 +14269,7 @@ else
+ fi
+ 
+ $RM -f confest.$objext
++CFLAGS=$_lt_libdeps_save_CFLAGS
+ 
+ # PORTME: override above test on systems where it is broken
+ case $host_os in
+@@ -13547,7 +14305,7 @@ linux*)
+ 
+ solaris*)
+   case $cc_basename in
+-  CC*)
++  CC* | sunCC*)
+     # The more standards-conforming stlport4 library is
+     # incompatible with the Cstd library. Avoid specifying
+     # it if it's in CXXFLAGS. Ignore libCrun as
+@@ -13612,8 +14370,6 @@ fi
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   # C++ specific cases for pic, static, wl, etc.
+   if test "$GXX" = yes; then
+@@ -13718,6 +14474,11 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	  ;;
+ 	esac
+ 	;;
++      mingw* | cygwin* | os2* | pw32* | cegcc*)
++	# This hack is so that the source file can tell whether it is being
++	# built for inclusion in a dll (and should export symbols for example).
++	lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
++	;;
+       dgux*)
+ 	case $cc_basename in
+ 	  ec++*)
+@@ -13870,7 +14631,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	;;
+       solaris*)
+ 	case $cc_basename in
+-	  CC*)
++	  CC* | sunCC*)
+ 	    # Sun C++ 4.2, 5.x and Centerline C++
+ 	    lt_prog_compiler_pic_CXX='-KPIC'
+ 	    lt_prog_compiler_static_CXX='-Bstatic'
+@@ -13935,10 +14696,17 @@ case $host_os in
+     lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5
+-$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic_CXX+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
++$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
++lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -13996,6 +14764,8 @@ fi
+ 
+ 
+ 
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -14173,6 +14943,7 @@ fi
+ $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ 
+   export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+   case $host_os in
+   aix[4-9]*)
+     # If we're using GNU nm, then we don't want the "-C" option.
+@@ -14187,15 +14958,20 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
+     ;;
+   pw32*)
+     export_symbols_cmds_CXX="$ltdll_cmds"
+-  ;;
++    ;;
+   cygwin* | mingw* | cegcc*)
+-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+-  ;;
++    case $cc_basename in
++    cl*) ;;
++    *)
++      export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
++      ;;
++    esac
++    ;;
+   *)
+     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+-  ;;
++    ;;
+   esac
+-  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+ $as_echo "$ld_shlibs_CXX" >&6; }
+@@ -14458,8 +15234,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -14491,13 +15268,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -14588,7 +15423,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -15047,6 +15882,7 @@ fi
+   fi # test -n "$compiler"
+ 
+   CC=$lt_save_CC
++  CFLAGS=$lt_save_CFLAGS
+   LDCXX=$LD
+   LD=$lt_save_LD
+   GCC=$lt_save_GCC
+@@ -18026,13 +18862,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -18047,14 +18890,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -18087,12 +18933,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -18131,8 +18977,8 @@ old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote
+ compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+ GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+ archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+@@ -18159,12 +19005,12 @@ hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_
+ hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path_CXX='`$ECHO "$fix_srcfile_path_CXX" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+ include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
++postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+ file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+ hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+ compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+@@ -18202,8 +19048,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -18213,12 +19064,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -18234,7 +19087,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -18256,8 +19108,8 @@ LD_CXX \
+ reload_flag_CXX \
+ compiler_CXX \
+ lt_prog_compiler_no_builtin_flag_CXX \
+-lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_pic_CXX \
++lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_static_CXX \
+ lt_cv_prog_compiler_c_o_CXX \
+ export_dynamic_flag_spec_CXX \
+@@ -18269,7 +19121,6 @@ no_undefined_flag_CXX \
+ hardcode_libdir_flag_spec_CXX \
+ hardcode_libdir_flag_spec_ld_CXX \
+ hardcode_libdir_separator_CXX \
+-fix_srcfile_path_CXX \
+ exclude_expsyms_CXX \
+ include_expsyms_CXX \
+ file_list_spec_CXX \
+@@ -18303,6 +19154,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -18317,7 +19169,8 @@ archive_expsym_cmds_CXX \
+ module_cmds_CXX \
+ module_expsym_cmds_CXX \
+ export_symbols_cmds_CXX \
+-prelink_cmds_CXX; do
++prelink_cmds_CXX \
++postlink_cmds_CXX; do
+     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+     *[\\\\\\\`\\"\\\$]*)
+       eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+@@ -19110,7 +19963,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -19213,19 +20067,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -19255,6 +20132,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -19264,6 +20147,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -19378,12 +20264,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -19470,9 +20356,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -19488,6 +20371,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -19534,210 +20420,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+@@ -19765,12 +20610,12 @@ with_gcc=$GCC_CXX
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl_CXX
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic_CXX
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl_CXX
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static_CXX
+ 
+@@ -19857,9 +20702,6 @@ inherit_rpath=$inherit_rpath_CXX
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs_CXX
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path_CXX
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols_CXX
+ 
+@@ -19875,6 +20717,9 @@ include_expsyms=$lt_include_expsyms_CXX
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds_CXX
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds_CXX
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec_CXX
+ 
+diff --git a/libtool.m4 b/libtool.m4
+index 24d13f3440..e45fdc6998 100644
+--- a/libtool.m4
++++ b/libtool.m4
+@@ -1,7 +1,8 @@
+ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ # This file is free software; the Free Software Foundation gives
+@@ -10,7 +11,8 @@
+ 
+ m4_define([_LT_COPYING], [dnl
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -37,7 +39,7 @@ m4_define([_LT_COPYING], [dnl
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ ])
+ 
+-# serial 56 LT_INIT
++# serial 57 LT_INIT
+ 
+ 
+ # LT_PREREQ(VERSION)
+@@ -92,7 +94,8 @@ _LT_SET_OPTIONS([$0], [$1])
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ AC_SUBST(LIBTOOL)dnl
+ 
+ _LT_SETUP
+@@ -166,10 +169,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+ dnl
+ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_CHECK_SHELL_FEATURES])dnl
++m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+ m4_require([_LT_CMD_RELOAD])dnl
+ m4_require([_LT_CHECK_MAGIC_METHOD])dnl
++m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+ m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+ m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
++m4_require([_LT_WITH_SYSROOT])dnl
+ 
+ _LT_CONFIG_LIBTOOL_INIT([
+ # See if we are running on zsh, and set the options which allow our
+@@ -199,7 +205,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -632,7 +638,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+ configured by $[0], generated by m4_PACKAGE_STRING.
+ 
+-Copyright (C) 2009 Free Software Foundation, Inc.
++Copyright (C) 2010 Free Software Foundation, Inc.
+ This config.lt script is free software; the Free Software Foundation
+ gives unlimited permision to copy, distribute and modify it."
+ 
+@@ -746,15 +752,12 @@ _LT_EOF
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
+ 
+-  _LT_PROG_XSI_SHELLFNS
++  _LT_PROG_REPLACE_SHELLFNS
+ 
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ ],
+@@ -980,6 +983,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+       echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+       $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
++      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
++      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -1069,30 +1074,41 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
+   fi
+ ])
+ 
+-# _LT_SYS_MODULE_PATH_AIX
+-# -----------------------
++# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
++# ----------------------------------
+ # Links a minimal program and checks the executable
+ # for the system default hardcoded library path. In most cases,
+ # this is /usr/lib:/lib, but when the MPI compilers are used
+ # the location of the communication and MPI libs are included too.
+ # If we don't find anything, use the default library path according
+ # to the aix ld manual.
++# Store the results from the different compilers for each TAGNAME.
++# Allow to override them for all tags through lt_cv_aix_libpath.
+ m4_defun([_LT_SYS_MODULE_PATH_AIX],
+ [m4_require([_LT_DECL_SED])dnl
+-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi],[])
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
++  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
++  lt_aix_libpath_sed='[
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }]'
++  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
++    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi],[])
++  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
++    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
++  fi
++  ])
++  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
++fi
+ ])# _LT_SYS_MODULE_PATH_AIX
+ 
+ 
+@@ -1117,7 +1133,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ 
+ AC_MSG_CHECKING([how to print strings])
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -1161,6 +1177,39 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+ ])# _LT_PROG_ECHO_BACKSLASH
+ 
+ 
++# _LT_WITH_SYSROOT
++# ----------------
++AC_DEFUN([_LT_WITH_SYSROOT],
++[AC_MSG_CHECKING([for sysroot])
++AC_ARG_WITH([libtool-sysroot],
++[  --with-libtool-sysroot[=DIR] Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).],
++[], [with_libtool_sysroot=no])
++
++dnl lt_sysroot will always be passed unquoted.  We quote it here
++dnl in case the user passed a directory name.
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   AC_MSG_RESULT([${with_libtool_sysroot}])
++   AC_MSG_ERROR([The sysroot must be an absolute path.])
++   ;;
++esac
++
++ AC_MSG_RESULT([${lt_sysroot:-no}])
++_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
++[dependent libraries, and in which our libraries should be installed.])])
++
+ # _LT_ENABLE_LOCK
+ # ---------------
+ m4_defun([_LT_ENABLE_LOCK],
+@@ -1320,14 +1369,47 @@ need_locks="$enable_libtool_lock"
+ ])# _LT_ENABLE_LOCK
+ 
+ 
++# _LT_PROG_AR
++# -----------
++m4_defun([_LT_PROG_AR],
++[AC_CHECK_TOOLS(AR, [ar], false)
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++_LT_DECL([], [AR], [1], [The archiver])
++_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
++
++AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
++  [lt_cv_ar_at_file=no
++   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
++     [echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
++      AC_TRY_EVAL([lt_ar_try])
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	AC_TRY_EVAL([lt_ar_try])
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
++     ])
++  ])
++
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
++_LT_DECL([], [archiver_list_spec], [1],
++  [How to feed a file listing to the archiver])
++])# _LT_PROG_AR
++
++
+ # _LT_CMD_OLD_ARCHIVE
+ # -------------------
+ m4_defun([_LT_CMD_OLD_ARCHIVE],
+-[AC_CHECK_TOOL(AR, ar, false)
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
+-_LT_DECL([], [AR], [1], [The archiver])
+-_LT_DECL([], [AR_FLAGS], [1])
++[_LT_PROG_AR
+ 
+ AC_CHECK_TOOL(STRIP, strip, :)
+ test -z "$STRIP" && STRIP=:
+@@ -1623,7 +1705,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-[#line __oline__ "configure"
++[#line $LINENO "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -1667,10 +1749,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -2210,8 +2292,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -2244,13 +2327,71 @@ m4_if([$1], [],[
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -2342,7 +2483,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -2950,6 +3091,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -3016,7 +3162,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -3167,6 +3314,21 @@ tpf*)
+   ;;
+ esac
+ ])
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -3174,7 +3336,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ _LT_DECL([], [deplibs_check_method], [1],
+     [Method to check whether dependent libraries are shared objects])
+ _LT_DECL([], [file_magic_cmd], [1],
+-    [Command to use when deplibs_check_method == "file_magic"])
++    [Command to use when deplibs_check_method = "file_magic"])
++_LT_DECL([], [file_magic_glob], [1],
++    [How to find potential files when deplibs_check_method = "file_magic"])
++_LT_DECL([], [want_nocaseglob], [1],
++    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+ ])# _LT_CHECK_MAGIC_METHOD
+ 
+ 
+@@ -3277,6 +3443,67 @@ dnl aclocal-1.4 backwards compatibility:
+ dnl AC_DEFUN([AM_PROG_NM], [])
+ dnl AC_DEFUN([AC_PROG_NM], [])
+ 
++# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
++# --------------------------------
++# how to determine the name of the shared library
++# associated with a specific link library.
++#  -- PORTME fill in with the dynamic library characteristics
++m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
++[m4_require([_LT_DECL_EGREP])
++m4_require([_LT_DECL_OBJDUMP])
++m4_require([_LT_DECL_DLLTOOL])
++AC_CACHE_CHECK([how to associate runtime and link libraries],
++lt_cv_sharedlib_from_linklib_cmd,
++[lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++])
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
++    [Command to associate shared and link libraries])
++])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
++
++
++# _LT_PATH_MANIFEST_TOOL
++# ----------------------
++# locate the manifest tool
++m4_defun([_LT_PATH_MANIFEST_TOOL],
++[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
++  [lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&AS_MESSAGE_LOG_FD
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*])
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
++])# _LT_PATH_MANIFEST_TOOL
++
+ 
+ # LT_LIB_M
+ # --------
+@@ -3403,8 +3630,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -3440,6 +3667,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -3473,6 +3701,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT@&t@_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT@&t@_DLSYM_CONST
++#else
++# define LT@&t@_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -3484,7 +3724,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT@&t@_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -3510,15 +3750,15 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ 	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ 	fi
+@@ -3551,6 +3791,13 @@ else
+   AC_MSG_RESULT(ok)
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
+ _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+     [Take the output of nm and produce a listing of raw symbols and C names])
+ _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+@@ -3561,6 +3808,8 @@ _LT_DECL([global_symbol_to_c_name_address],
+ _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+     [Transform the output of nm in a C name address pair when lib prefix is needed])
++_LT_DECL([], [nm_file_list_spec], [1],
++    [Specify filename containing input files for $NM])
+ ]) # _LT_CMD_GLOBAL_SYMBOLS
+ 
+ 
+@@ -3572,7 +3821,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)=
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ 
+-AC_MSG_CHECKING([for $compiler option to produce PIC])
+ m4_if([$1], [CXX], [
+   # C++ specific cases for pic, static, wl, etc.
+   if test "$GXX" = yes; then
+@@ -3678,6 +3926,12 @@ m4_if([$1], [CXX], [
+ 	  ;;
+ 	esac
+ 	;;
++      mingw* | cygwin* | os2* | pw32* | cegcc*)
++	# This hack is so that the source file can tell whether it is being
++	# built for inclusion in a dll (and should export symbols for example).
++	m4_if([$1], [GCJ], [],
++	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
++	;;
+       dgux*)
+ 	case $cc_basename in
+ 	  ec++*)
+@@ -3830,7 +4084,7 @@ m4_if([$1], [CXX], [
+ 	;;
+       solaris*)
+ 	case $cc_basename in
+-	  CC*)
++	  CC* | sunCC*)
+ 	    # Sun C++ 4.2, 5.x and Centerline C++
+ 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+@@ -4053,6 +4307,12 @@ m4_if([$1], [CXX], [
+ 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ 	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
++	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
++	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -4115,7 +4375,7 @@ m4_if([$1], [CXX], [
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+       *)
+ 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+@@ -4172,9 +4432,11 @@ case $host_os in
+     _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+     ;;
+ esac
+-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+-	[How to pass a linker flag through the compiler])
++
++AC_CACHE_CHECK([for $compiler option to produce PIC],
++  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
++  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
++_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -4193,6 +4455,8 @@ fi
+ _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ 	[Additional compiler flags for building library objects])
+ 
++_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
++	[How to pass a linker flag through the compiler])
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -4213,6 +4477,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ m4_defun([_LT_LINKER_SHLIBS],
+ [AC_REQUIRE([LT_PATH_LD])dnl
+ AC_REQUIRE([LT_PATH_NM])dnl
++m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_DECL_EGREP])dnl
+ m4_require([_LT_DECL_SED])dnl
+@@ -4221,6 +4486,7 @@ m4_require([_LT_TAG_COMPILER])dnl
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ m4_if([$1], [CXX], [
+   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+   case $host_os in
+   aix[[4-9]]*)
+     # If we're using GNU nm, then we don't want the "-C" option.
+@@ -4235,15 +4501,20 @@ m4_if([$1], [CXX], [
+     ;;
+   pw32*)
+     _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+-  ;;
++    ;;
+   cygwin* | mingw* | cegcc*)
+-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+-  ;;
++    case $cc_basename in
++    cl*) ;;
++    *)
++      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
++      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
++      ;;
++    esac
++    ;;
+   *)
+     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+-  ;;
++    ;;
+   esac
+-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ ], [
+   runpath_var=
+   _LT_TAGVAR(allow_undefined_flag, $1)=
+@@ -4411,7 +4682,8 @@ _LT_EOF
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       _LT_TAGVAR(always_export_symbols, $1)=no
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
++      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
++      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -4510,12 +4782,12 @@ _LT_EOF
+ 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ 	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+-	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -4529,8 +4801,8 @@ _LT_EOF
+ 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -4548,8 +4820,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	_LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+@@ -4595,8 +4867,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	_LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+@@ -4726,7 +4998,7 @@ _LT_EOF
+ 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        _LT_SYS_MODULE_PATH_AIX
++        _LT_SYS_MODULE_PATH_AIX([$1])
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+@@ -4737,7 +5009,7 @@ _LT_EOF
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 _LT_SYS_MODULE_PATH_AIX
++	 _LT_SYS_MODULE_PATH_AIX([$1])
+ 	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+ 	  # -berok will link without error, but may produce a broken library.
+@@ -4781,20 +5053,63 @@ _LT_EOF
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+-      # FIXME: Should let the user specify the lib program.
+-      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	_LT_TAGVAR(always_export_symbols, $1)=yes
++	_LT_TAGVAR(file_list_spec, $1)='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
++	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++	# FIXME: Should let the user specify the lib program.
++	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -4828,7 +5143,7 @@ _LT_EOF
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+@@ -4836,7 +5151,7 @@ _LT_EOF
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -4852,7 +5167,7 @@ _LT_EOF
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -4876,10 +5191,10 @@ _LT_EOF
+ 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -4926,16 +5241,31 @@ _LT_EOF
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        AC_LINK_IFELSE(int foo(void) {},
+-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-        )
+-        LDFLAGS="$save_LDFLAGS"
++	# This should be the same for all languages, so no per-tag cache variable.
++	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
++	  [lt_cv_irix_exported_symbol],
++	  [save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   AC_LINK_IFELSE(
++	     [AC_LANG_SOURCE(
++	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
++			      [C++], [[int foo (void) { return 0; }]],
++			      [Fortran 77], [[
++      subroutine foo
++      end]],
++			      [Fortran], [[
++      subroutine foo
++      end]])])],
++	      [lt_cv_irix_exported_symbol=yes],
++	      [lt_cv_irix_exported_symbol=no])
++           LDFLAGS="$save_LDFLAGS"])
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -5020,7 +5350,7 @@ _LT_EOF
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+       else
+ 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+@@ -5039,9 +5369,9 @@ _LT_EOF
+       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -5313,8 +5643,6 @@ _LT_TAGDECL([], [inherit_rpath], [0],
+     to runtime path list])
+ _LT_TAGDECL([], [link_all_deplibs], [0],
+     [Whether libtool must link a program against all its dependency libraries])
+-_LT_TAGDECL([], [fix_srcfile_path], [1],
+-    [Fix the shell variable $srcfile for the compiler])
+ _LT_TAGDECL([], [always_export_symbols], [0],
+     [Set to "yes" if exported symbols are required])
+ _LT_TAGDECL([], [export_symbols_cmds], [2],
+@@ -5325,6 +5653,8 @@ _LT_TAGDECL([], [include_expsyms], [1],
+     [Symbols that must always be exported])
+ _LT_TAGDECL([], [prelink_cmds], [2],
+     [Commands necessary for linking programs (against libraries) with templates])
++_LT_TAGDECL([], [postlink_cmds], [2],
++    [Commands necessary for finishing linking programs])
+ _LT_TAGDECL([], [file_list_spec], [1],
+     [Specify filename containing input files])
+ dnl FIXME: Not yet implemented
+@@ -5426,6 +5756,7 @@ CC="$lt_save_CC"
+ m4_defun([_LT_LANG_CXX_CONFIG],
+ [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_DECL_EGREP])dnl
++m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+     ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+     (test "X$CXX" != "Xg++"))) ; then
+@@ -5487,6 +5818,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 
+   # Allow CC to be a program name with arguments.
+   lt_save_CC=$CC
++  lt_save_CFLAGS=$CFLAGS
+   lt_save_LD=$LD
+   lt_save_GCC=$GCC
+   GCC=$GXX
+@@ -5504,6 +5836,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+   fi
+   test -z "${LDCXX+set}" || LD=$LDCXX
+   CC=${CXX-"c++"}
++  CFLAGS=$CXXFLAGS
+   compiler=$CC
+   _LT_TAGVAR(compiler, $1)=$CC
+   _LT_CC_BASENAME([$compiler])
+@@ -5667,7 +6000,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+           _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+           # Determine the default libpath from the value encoded in an empty
+           # executable.
+-          _LT_SYS_MODULE_PATH_AIX
++          _LT_SYS_MODULE_PATH_AIX([$1])
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -5679,7 +6012,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+           else
+ 	    # Determine the default libpath from the value encoded in an
+ 	    # empty executable.
+-	    _LT_SYS_MODULE_PATH_AIX
++	    _LT_SYS_MODULE_PATH_AIX([$1])
+ 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	    # Warning - without using the other run time loading flags,
+ 	    # -berok will link without error, but may produce a broken library.
+@@ -5721,29 +6054,75 @@ if test "$_lt_caught_CXX_error" != yes; then
+         ;;
+ 
+       cygwin* | mingw* | pw32* | cegcc*)
+-        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+-        # as there is no search path for DLLs.
+-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+-        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-        _LT_TAGVAR(always_export_symbols, $1)=no
+-        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-
+-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+-          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-          # If the export-symbols file already is a .def file (1st line
+-          # is EXPORTS), use it as is; otherwise, prepend...
+-          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+-	    cp $export_symbols $output_objdir/$soname.def;
+-          else
+-	    echo EXPORTS > $output_objdir/$soname.def;
+-	    cat $export_symbols >> $output_objdir/$soname.def;
+-          fi~
+-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-        else
+-          _LT_TAGVAR(ld_shlibs, $1)=no
+-        fi
+-        ;;
++	case $GXX,$cc_basename in
++	,cl* | no,cl*)
++	  # Native MSVC
++	  # hardcode_libdir_flag_spec is actually meaningless, as there is
++	  # no search path for DLLs.
++	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	  _LT_TAGVAR(always_export_symbols, $1)=yes
++	  _LT_TAGVAR(file_list_spec, $1)='@'
++	  # Tell ltmain to make .lib files, not .a files.
++	  libext=lib
++	  # Tell ltmain to make .dll files, not .so files.
++	  shrext_cmds=".dll"
++	  # FIXME: Setting linknames here is a bad hack.
++	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	    else
++	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	    fi~
++	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	    linknames='
++	  # The linker will not automatically build a static lib if we build a DLL.
++	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++	  # Don't use ranlib
++	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
++	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
++	    lt_tool_outputfile="@TOOL_OUTPUT@"~
++	    case $lt_outputfile in
++	      *.exe|*.EXE) ;;
++	      *)
++		lt_outputfile="$lt_outputfile.exe"
++		lt_tool_outputfile="$lt_tool_outputfile.exe"
++		;;
++	    esac~
++	    func_to_tool_file "$lt_outputfile"~
++	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	      $RM "$lt_outputfile.manifest";
++	    fi'
++	  ;;
++	*)
++	  # g++
++	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
++	  # as there is no search path for DLLs.
++	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
++	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	  _LT_TAGVAR(always_export_symbols, $1)=no
++	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++
++	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
++	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	    # If the export-symbols file already is a .def file (1st line
++	    # is EXPORTS), use it as is; otherwise, prepend...
++	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	      cp $export_symbols $output_objdir/$soname.def;
++	    else
++	      echo EXPORTS > $output_objdir/$soname.def;
++	      cat $export_symbols >> $output_objdir/$soname.def;
++	    fi~
++	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	  else
++	    _LT_TAGVAR(ld_shlibs, $1)=no
++	  fi
++	  ;;
++	esac
++	;;
+       darwin* | rhapsody*)
+         _LT_DARWIN_LINKER_FEATURES($1)
+ 	;;
+@@ -5818,7 +6197,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+             ;;
+           *)
+             if test "$GXX" = yes; then
+-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+             else
+               # FIXME: insert proper C++ library support
+               _LT_TAGVAR(ld_shlibs, $1)=no
+@@ -5889,10 +6268,10 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	          ia64*)
+-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	          *)
+-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	        esac
+ 	      fi
+@@ -5933,9 +6312,9 @@ if test "$_lt_caught_CXX_error" != yes; then
+           *)
+ 	    if test "$GXX" = yes; then
+ 	      if test "$with_gnu_ld" = no; then
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	      else
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ 	      fi
+ 	    fi
+ 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+@@ -6005,20 +6384,20 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
++		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
++		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ 		$RANLIB $oldlib'
+ 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
++		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
++		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ 	      ;;
+ 	    *) # Version 6 and above use weak symbols
+ 	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+@@ -6213,7 +6592,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 		  ;;
+ 	        *)
+-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 		  ;;
+ 	      esac
+ 
+@@ -6259,7 +6638,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 
+       solaris*)
+         case $cc_basename in
+-          CC*)
++          CC* | sunCC*)
+ 	    # Sun C++ 4.2, 5.x and Centerline C++
+             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+@@ -6300,9 +6679,9 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ 	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
++		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+ 
+ 	        # Commands to make compiler produce verbose output that lists
+ 	        # what "hidden" libraries, object files and flags are used when
+@@ -6431,6 +6810,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+   fi # test -n "$compiler"
+ 
+   CC=$lt_save_CC
++  CFLAGS=$lt_save_CFLAGS
+   LDCXX=$LD
+   LD=$lt_save_LD
+   GCC=$lt_save_GCC
+@@ -6445,6 +6825,29 @@ AC_LANG_POP
+ ])# _LT_LANG_CXX_CONFIG
+ 
+ 
++# _LT_FUNC_STRIPNAME_CNF
++# ----------------------
++# func_stripname_cnf prefix suffix name
++# strip PREFIX and SUFFIX off of NAME.
++# PREFIX and SUFFIX must not contain globbing or regex special
++# characters, hashes, percent signs, but SUFFIX may contain a leading
++# dot (in which case that matches only a dot).
++#
++# This function is identical to the (non-XSI) version of func_stripname,
++# except this one can be used by m4 code that may be executed by configure,
++# rather than the libtool script.
++m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
++AC_REQUIRE([_LT_DECL_SED])
++AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
++func_stripname_cnf ()
++{
++  case ${2} in
++  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++  esac
++} # func_stripname_cnf
++])# _LT_FUNC_STRIPNAME_CNF
++
+ # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+ # ---------------------------------
+ # Figure out "hidden" library dependencies from verbose
+@@ -6453,6 +6856,7 @@ AC_LANG_POP
+ # objects, libraries and library flags.
+ m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+ [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
++AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+ # Dependencies to place before and after the object being linked:
+ _LT_TAGVAR(predep_objects, $1)=
+ _LT_TAGVAR(postdep_objects, $1)=
+@@ -6503,6 +6907,13 @@ public class foo {
+ };
+ _LT_EOF
+ ])
++
++_lt_libdeps_save_CFLAGS=$CFLAGS
++case "$CC $CFLAGS " in #(
++*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
++*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
++esac
++
+ dnl Parse the compiler output and extract the necessary
+ dnl objects, libraries and library flags.
+ if AC_TRY_EVAL(ac_compile); then
+@@ -6514,7 +6925,7 @@ if AC_TRY_EVAL(ac_compile); then
+   pre_test_object_deps_done=no
+ 
+   for p in `eval "$output_verbose_link_cmd"`; do
+-    case $p in
++    case ${prev}${p} in
+ 
+     -L* | -R* | -l*)
+        # Some compilers place space between "-{L,R}" and the path.
+@@ -6523,13 +6934,22 @@ if AC_TRY_EVAL(ac_compile); then
+           test $p = "-R"; then
+ 	 prev=$p
+ 	 continue
+-       else
+-	 prev=
+        fi
+ 
++       # Expand the sysroot to ease extracting the directories later.
++       if test -z "$prev"; then
++         case $p in
++         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
++         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
++         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
++         esac
++       fi
++       case $p in
++       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
++       esac
+        if test "$pre_test_object_deps_done" = no; then
+-	 case $p in
+-	 -L* | -R*)
++	 case ${prev} in
++	 -L | -R)
+ 	   # Internal compiler library paths should come after those
+ 	   # provided the user.  The postdeps already come after the
+ 	   # user supplied libs so there is no need to process them.
+@@ -6549,8 +6969,10 @@ if AC_TRY_EVAL(ac_compile); then
+ 	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ 	 fi
+        fi
++       prev=
+        ;;
+ 
++    *.lto.$objext) ;; # Ignore GCC LTO objects
+     *.$objext)
+        # This assumes that the test object file only shows up
+        # once in the compiler output.
+@@ -6586,6 +7008,7 @@ else
+ fi
+ 
+ $RM -f confest.$objext
++CFLAGS=$_lt_libdeps_save_CFLAGS
+ 
+ # PORTME: override above test on systems where it is broken
+ m4_if([$1], [CXX],
+@@ -6622,7 +7045,7 @@ linux*)
+ 
+ solaris*)
+   case $cc_basename in
+-  CC*)
++  CC* | sunCC*)
+     # The more standards-conforming stlport4 library is
+     # incompatible with the Cstd library. Avoid specifying
+     # it if it's in CXXFLAGS. Ignore libCrun as
+@@ -6735,7 +7158,9 @@ if test "$_lt_disable_F77" != yes; then
+   # Allow CC to be a program name with arguments.
+   lt_save_CC="$CC"
+   lt_save_GCC=$GCC
++  lt_save_CFLAGS=$CFLAGS
+   CC=${F77-"f77"}
++  CFLAGS=$FFLAGS
+   compiler=$CC
+   _LT_TAGVAR(compiler, $1)=$CC
+   _LT_CC_BASENAME([$compiler])
+@@ -6789,6 +7214,7 @@ if test "$_lt_disable_F77" != yes; then
+ 
+   GCC=$lt_save_GCC
+   CC="$lt_save_CC"
++  CFLAGS="$lt_save_CFLAGS"
+ fi # test "$_lt_disable_F77" != yes
+ 
+ AC_LANG_POP
+@@ -6865,7 +7291,9 @@ if test "$_lt_disable_FC" != yes; then
+   # Allow CC to be a program name with arguments.
+   lt_save_CC="$CC"
+   lt_save_GCC=$GCC
++  lt_save_CFLAGS=$CFLAGS
+   CC=${FC-"f95"}
++  CFLAGS=$FCFLAGS
+   compiler=$CC
+   GCC=$ac_cv_fc_compiler_gnu
+ 
+@@ -6921,7 +7349,8 @@ if test "$_lt_disable_FC" != yes; then
+   fi # test -n "$compiler"
+ 
+   GCC=$lt_save_GCC
+-  CC="$lt_save_CC"
++  CC=$lt_save_CC
++  CFLAGS=$lt_save_CFLAGS
+ fi # test "$_lt_disable_FC" != yes
+ 
+ AC_LANG_POP
+@@ -6958,10 +7387,12 @@ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+ 
+ # Allow CC to be a program name with arguments.
+-lt_save_CC="$CC"
++lt_save_CC=$CC
++lt_save_CFLAGS=$CFLAGS
+ lt_save_GCC=$GCC
+ GCC=yes
+ CC=${GCJ-"gcj"}
++CFLAGS=$GCJFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_TAGVAR(LD, $1)="$LD"
+@@ -6992,7 +7423,8 @@ fi
+ AC_LANG_RESTORE
+ 
+ GCC=$lt_save_GCC
+-CC="$lt_save_CC"
++CC=$lt_save_CC
++CFLAGS=$lt_save_CFLAGS
+ ])# _LT_LANG_GCJ_CONFIG
+ 
+ 
+@@ -7027,9 +7459,11 @@ _LT_LINKER_BOILERPLATE
+ 
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
++lt_save_CFLAGS=$CFLAGS
+ lt_save_GCC=$GCC
+ GCC=
+ CC=${RC-"windres"}
++CFLAGS=
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+@@ -7042,7 +7476,8 @@ fi
+ 
+ GCC=$lt_save_GCC
+ AC_LANG_RESTORE
+-CC="$lt_save_CC"
++CC=$lt_save_CC
++CFLAGS=$lt_save_CFLAGS
+ ])# _LT_LANG_RC_CONFIG
+ 
+ 
+@@ -7101,6 +7536,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+ AC_SUBST([OBJDUMP])
+ ])
+ 
++# _LT_DECL_DLLTOOL
++# ----------------
++# Ensure DLLTOOL variable is set.
++m4_defun([_LT_DECL_DLLTOOL],
++[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
++AC_SUBST([DLLTOOL])
++])
+ 
+ # _LT_DECL_SED
+ # ------------
+@@ -7194,8 +7638,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES],
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -7234,206 +7678,162 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+ ])# _LT_CHECK_SHELL_FEATURES
+ 
+ 
+-# _LT_PROG_XSI_SHELLFNS
+-# ---------------------
+-# Bourne and XSI compatible variants of some useful shell functions.
+-m4_defun([_LT_PROG_XSI_SHELLFNS],
+-[case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $[*] ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
++# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
++# ------------------------------------------------------
++# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
++# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
++m4_defun([_LT_PROG_FUNCTION_REPLACE],
++[dnl {
++sed -e '/^$1 ()$/,/^} # $1 /c\
++$1 ()\
++{\
++m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
++} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++])
+ 
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+ 
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
++# _LT_PROG_REPLACE_SHELLFNS
++# -------------------------
++# Replace existing portable implementations of several shell functions with
++# equivalent extended shell implementations where those features are available..
++m4_defun([_LT_PROG_REPLACE_SHELLFNS],
++[if test x"$xsi_shell" = xyes; then
++  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
++    case ${1} in
++      */*) func_dirname_result="${1%/*}${2}" ;;
++      *  ) func_dirname_result="${3}" ;;
++    esac])
++
++  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
++    func_basename_result="${1##*/}"])
++
++  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
++    case ${1} in
++      */*) func_dirname_result="${1%/*}${2}" ;;
++      *  ) func_dirname_result="${3}" ;;
++    esac
++    func_basename_result="${1##*/}"])
+ 
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
++    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
++    # positional parameters, so assign one to ordinary parameter first.
++    func_stripname_result=${3}
++    func_stripname_result=${func_stripname_result#"${1}"}
++    func_stripname_result=${func_stripname_result%"${2}"}])
+ 
+-dnl func_dirname_and_basename
+-dnl A portable version of this function is already defined in general.m4sh
+-dnl so there is no need for it here.
++  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
++    func_split_long_opt_name=${1%%=*}
++    func_split_long_opt_arg=${1#*=}])
+ 
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
++    func_split_short_opt_arg=${1#??}
++    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+ 
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[[^=]]*=//'
++  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
++    case ${1} in
++      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
++      *)    func_lo2o_result=${1} ;;
++    esac])
+ 
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+ 
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+ 
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
++fi
+ 
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$[@]"`
+-}
++if test x"$lt_shell_append" = xyes; then
++  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+ 
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
++    func_quote_for_eval "${2}"
++dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
++    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+ 
+-_LT_EOF
+-esac
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
+ 
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
++if test x"$_lt_function_replace_fail" = x":"; then
++  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
++fi
++])
+ 
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$[1]+=\$[2]"
+-}
+-_LT_EOF
++# _LT_PATH_CONVERSION_FUNCTIONS
++# -----------------------------
++# Determine which file name conversion functions should be used by
++# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
++# for certain cross-compile configurations and native mingw.
++m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
++[AC_REQUIRE([AC_CANONICAL_HOST])dnl
++AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++AC_MSG_CHECKING([how to convert $build file names to $host format])
++AC_CACHE_VAL(lt_cv_to_host_file_cmd,
++[case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
+     ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$[1]=\$$[1]\$[2]"
+-}
+-
+-_LT_EOF
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
+     ;;
+-  esac
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++])
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
++_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
++         [0], [convert $build file names to $host format])dnl
++
++AC_MSG_CHECKING([how to convert $build file names to toolchain format])
++AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
++[#assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
+ ])
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
++_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
++         [0], [convert $build files to toolchain format])dnl
++])# _LT_PATH_CONVERSION_FUNCTIONS
+diff --git a/ltmain.sh b/ltmain.sh
+index 9503ec85d7..70e856e065 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -1,10 +1,9 @@
+-# Generated from ltmain.m4sh.
+ 
+-# libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
++# libtool (GNU libtool) 2.4
+ # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+ 
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+-# 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ # This is free software; see the source for copying conditions.  There is NO
+ # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ 
+@@ -38,7 +37,6 @@
+ #   -n, --dry-run            display commands without modifying any files
+ #       --features           display basic configuration information and exit
+ #       --mode=MODE          use operation mode MODE
+-#       --no-finish          let install mode avoid finish commands
+ #       --preserve-dup-deps  don't remove duplicate dependency libraries
+ #       --quiet, --silent    don't print informational messages
+ #       --no-quiet, --no-silent
+@@ -71,17 +69,19 @@
+ #         compiler:		$LTCC
+ #         compiler flags:		$LTCFLAGS
+ #         linker:		$LD (gnu? $with_gnu_ld)
+-#         $progname:	(GNU libtool 1.3134 2009-11-29) 2.2.7a
++#         $progname:	(GNU libtool) 2.4
+ #         automake:	$automake_version
+ #         autoconf:	$autoconf_version
+ #
+ # Report bugs to <bug-libtool@gnu.org>.
++# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
++# General help using GNU software: <http://www.gnu.org/gethelp/>.
+ 
+ PROGRAM=libtool
+ PACKAGE=libtool
+-VERSION=2.2.7a
+-TIMESTAMP=" 1.3134 2009-11-29"
+-package_revision=1.3134
++VERSION=2.4
++TIMESTAMP=""
++package_revision=1.3293
+ 
+ # Be Bourne compatible
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+@@ -106,9 +106,6 @@ _LTECHO_EOF'
+ }
+ 
+ # NLS nuisances: We save the old values to restore during execute mode.
+-# Only set LANG and LC_ALL to C if already set.
+-# These must not be set unconditionally because not all systems understand
+-# e.g. LANG=C (notably SCO).
+ lt_user_locale=
+ lt_safe_locale=
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+@@ -121,15 +118,13 @@ do
+ 	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ 	fi"
+ done
++LC_ALL=C
++LANGUAGE=C
++export LANGUAGE LC_ALL
+ 
+ $lt_unset CDPATH
+ 
+ 
+-
+-
+-
+-
+-
+ # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+ # is ksh but when the shell is invoked as "sh" and the current value of
+ # the _XPG environment variable is not equal to 1 (one), the special
+@@ -140,7 +135,7 @@ progpath="$0"
+ 
+ 
+ : ${CP="cp -f"}
+-: ${ECHO=$as_echo}
++test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+ : ${EGREP="/bin/grep -E"}
+ : ${FGREP="/bin/grep -F"}
+ : ${GREP="/bin/grep"}
+@@ -149,7 +144,7 @@ progpath="$0"
+ : ${MKDIR="mkdir"}
+ : ${MV="mv -f"}
+ : ${RM="rm -f"}
+-: ${SED="/mount/endor/wildenhu/local-x86_64/bin/sed"}
++: ${SED="/bin/sed"}
+ : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+ : ${Xsed="$SED -e 1s/^X//"}
+ 
+@@ -169,6 +164,27 @@ IFS=" 	$lt_nl"
+ dirname="s,/[^/]*$,,"
+ basename="s,^.*/,,"
+ 
++# func_dirname file append nondir_replacement
++# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
++# otherwise set result to NONDIR_REPLACEMENT.
++func_dirname ()
++{
++    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
++    if test "X$func_dirname_result" = "X${1}"; then
++      func_dirname_result="${3}"
++    else
++      func_dirname_result="$func_dirname_result${2}"
++    fi
++} # func_dirname may be replaced by extended shell implementation
++
++
++# func_basename file
++func_basename ()
++{
++    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
++} # func_basename may be replaced by extended shell implementation
++
++
+ # func_dirname_and_basename file append nondir_replacement
+ # perform func_basename and func_dirname in a single function
+ # call:
+@@ -183,17 +199,31 @@ basename="s,^.*/,,"
+ # those functions but instead duplicate the functionality here.
+ func_dirname_and_basename ()
+ {
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-  func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+-}
++    # Extract subdirectory from the argument.
++    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
++    if test "X$func_dirname_result" = "X${1}"; then
++      func_dirname_result="${3}"
++    else
++      func_dirname_result="$func_dirname_result${2}"
++    fi
++    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
++} # func_dirname_and_basename may be replaced by extended shell implementation
++
++
++# func_stripname prefix suffix name
++# strip PREFIX and SUFFIX off of NAME.
++# PREFIX and SUFFIX must not contain globbing or regex special
++# characters, hashes, percent signs, but SUFFIX may contain a leading
++# dot (in which case that matches only a dot).
++# func_strip_suffix prefix name
++func_stripname ()
++{
++    case ${2} in
++      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++    esac
++} # func_stripname may be replaced by extended shell implementation
+ 
+-# Generated shell functions inserted here.
+ 
+ # These SED scripts presuppose an absolute path with a trailing slash.
+ pathcar='s,^/\([^/]*\).*$,\1,'
+@@ -376,6 +406,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+ # Same as above, but do not quote variable references.
+ double_quote_subst='s/\(["`\\]\)/\\\1/g'
+ 
++# Sed substitution that turns a string into a regex matching for the
++# string literally.
++sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
++
++# Sed substitution that converts a w32 file name or path
++# which contains forward slashes, into one that contains
++# (escaped) backslashes.  A very naive implementation.
++lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
++
+ # Re-`\' parameter expansions in output of double_quote_subst that were
+ # `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+ # in input to double_quote_subst, that '$' was protected from expansion.
+@@ -404,7 +443,7 @@ opt_warning=:
+ # name if it has been set yet.
+ func_echo ()
+ {
+-    $ECHO "$progname${mode+: }$mode: $*"
++    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+ }
+ 
+ # func_verbose arg...
+@@ -430,14 +469,14 @@ func_echo_all ()
+ # Echo program name prefixed message to standard error.
+ func_error ()
+ {
+-    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
++    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+ }
+ 
+ # func_warning arg...
+ # Echo program name prefixed warning message to standard error.
+ func_warning ()
+ {
+-    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
++    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+ 
+     # bash bug again:
+     :
+@@ -656,19 +695,35 @@ func_show_eval_locale ()
+     fi
+ }
+ 
+-
+-
++# func_tr_sh
++# Turn $1 into a string suitable for a shell variable name.
++# Result is stored in $func_tr_sh_result.  All characters
++# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
++# if $1 begins with a digit, a '_' is prepended as well.
++func_tr_sh ()
++{
++  case $1 in
++  [0-9]* | *[!a-zA-Z0-9_]*)
++    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
++    ;;
++  * )
++    func_tr_sh_result=$1
++    ;;
++  esac
++}
+ 
+ 
+ # func_version
+ # Echo version message to standard output and exit.
+ func_version ()
+ {
++    $opt_debug
++
+     $SED -n '/(C)/!b go
+ 	:more
+ 	/\./!{
+ 	  N
+-	  s/\n# //
++	  s/\n# / /
+ 	  b more
+ 	}
+ 	:go
+@@ -685,7 +740,9 @@ func_version ()
+ # Echo short help message to standard output and exit.
+ func_usage ()
+ {
+-    $SED -n '/^# Usage:/,/^#  *-h/ {
++    $opt_debug
++
++    $SED -n '/^# Usage:/,/^#  *.*--help/ {
+         s/^# //
+ 	s/^# *$//
+ 	s/\$progname/'$progname'/
+@@ -701,7 +758,10 @@ func_usage ()
+ # unless 'noexit' is passed as argument.
+ func_help ()
+ {
++    $opt_debug
++
+     $SED -n '/^# Usage:/,/# Report bugs to/ {
++	:print
+         s/^# //
+ 	s/^# *$//
+ 	s*\$progname*'$progname'*
+@@ -714,7 +774,11 @@ func_help ()
+ 	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ 	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ 	p
+-     }' < "$progpath"
++	d
++     }
++     /^# .* home page:/b print
++     /^# General help using/b print
++     ' < "$progpath"
+     ret=$?
+     if test -z "$1"; then
+       exit $ret
+@@ -726,12 +790,39 @@ func_help ()
+ # exit_cmd.
+ func_missing_arg ()
+ {
+-    func_error "missing argument for $1"
++    $opt_debug
++
++    func_error "missing argument for $1."
+     exit_cmd=exit
+ }
+ 
+-exit_cmd=:
+ 
++# func_split_short_opt shortopt
++# Set func_split_short_opt_name and func_split_short_opt_arg shell
++# variables after splitting SHORTOPT after the 2nd character.
++func_split_short_opt ()
++{
++    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
++    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
++
++    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
++    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
++} # func_split_short_opt may be replaced by extended shell implementation
++
++
++# func_split_long_opt longopt
++# Set func_split_long_opt_name and func_split_long_opt_arg shell
++# variables after splitting LONGOPT at the `=' sign.
++func_split_long_opt ()
++{
++    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
++    my_sed_long_arg='1s/^--[^=]*=//'
++
++    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
++    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
++} # func_split_long_opt may be replaced by extended shell implementation
++
++exit_cmd=:
+ 
+ 
+ 
+@@ -741,26 +832,64 @@ magic="%%%MAGIC variable%%%"
+ magic_exe="%%%MAGIC EXE variable%%%"
+ 
+ # Global variables.
+-# $mode is unset
+ nonopt=
+-execute_dlfiles=
+ preserve_args=
+ lo2o="s/\\.lo\$/.${objext}/"
+ o2lo="s/\\.${objext}\$/.lo/"
+ extracted_archives=
+ extracted_serial=0
+ 
+-opt_dry_run=false
+-opt_finish=:
+-opt_duplicate_deps=false
+-opt_silent=false
+-opt_debug=:
+-
+ # If this variable is set in any of the actions, the command in it
+ # will be execed at the end.  This prevents here-documents from being
+ # left over by shells.
+ exec_cmd=
+ 
++# func_append var value
++# Append VALUE to the end of shell variable VAR.
++func_append ()
++{
++    eval "${1}=\$${1}\${2}"
++} # func_append may be replaced by extended shell implementation
++
++# func_append_quoted var value
++# Quote VALUE and append to the end of shell variable VAR, separated
++# by a space.
++func_append_quoted ()
++{
++    func_quote_for_eval "${2}"
++    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
++} # func_append_quoted may be replaced by extended shell implementation
++
++
++# func_arith arithmetic-term...
++func_arith ()
++{
++    func_arith_result=`expr "${@}"`
++} # func_arith may be replaced by extended shell implementation
++
++
++# func_len string
++# STRING may not start with a hyphen.
++func_len ()
++{
++    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
++} # func_len may be replaced by extended shell implementation
++
++
++# func_lo2o object
++func_lo2o ()
++{
++    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
++} # func_lo2o may be replaced by extended shell implementation
++
++
++# func_xform libobj-or-source
++func_xform ()
++{
++    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
++} # func_xform may be replaced by extended shell implementation
++
++
+ # func_fatal_configuration arg...
+ # Echo program name prefixed message to standard error, followed by
+ # a configuration failure hint, and exit.
+@@ -850,130 +979,204 @@ func_enable_tag ()
+   esac
+ }
+ 
+-# Parse options once, thoroughly.  This comes as soon as possible in
+-# the script to make things like `libtool --version' happen quickly.
++# func_check_version_match
++# Ensure that we are using m4 macros, and libtool script from the same
++# release of libtool.
++func_check_version_match ()
+ {
++  if test "$package_revision" != "$macro_revision"; then
++    if test "$VERSION" != "$macro_version"; then
++      if test -z "$macro_version"; then
++        cat >&2 <<_LT_EOF
++$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
++$progname: definition of this LT_INIT comes from an older release.
++$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
++$progname: and run autoconf again.
++_LT_EOF
++      else
++        cat >&2 <<_LT_EOF
++$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
++$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
++$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
++$progname: and run autoconf again.
++_LT_EOF
++      fi
++    else
++      cat >&2 <<_LT_EOF
++$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
++$progname: but the definition of this LT_INIT comes from revision $macro_revision.
++$progname: You should recreate aclocal.m4 with macros from revision $package_revision
++$progname: of $PACKAGE $VERSION and run autoconf again.
++_LT_EOF
++    fi
+ 
+-  # Shorthand for --mode=foo, only valid as the first argument
+-  case $1 in
+-  clean|clea|cle|cl)
+-    shift; set dummy --mode clean ${1+"$@"}; shift
+-    ;;
+-  compile|compil|compi|comp|com|co|c)
+-    shift; set dummy --mode compile ${1+"$@"}; shift
+-    ;;
+-  execute|execut|execu|exec|exe|ex|e)
+-    shift; set dummy --mode execute ${1+"$@"}; shift
+-    ;;
+-  finish|finis|fini|fin|fi|f)
+-    shift; set dummy --mode finish ${1+"$@"}; shift
+-    ;;
+-  install|instal|insta|inst|ins|in|i)
+-    shift; set dummy --mode install ${1+"$@"}; shift
+-    ;;
+-  link|lin|li|l)
+-    shift; set dummy --mode link ${1+"$@"}; shift
+-    ;;
+-  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+-    shift; set dummy --mode uninstall ${1+"$@"}; shift
+-    ;;
+-  esac
++    exit $EXIT_MISMATCH
++  fi
++}
++
++
++# Shorthand for --mode=foo, only valid as the first argument
++case $1 in
++clean|clea|cle|cl)
++  shift; set dummy --mode clean ${1+"$@"}; shift
++  ;;
++compile|compil|compi|comp|com|co|c)
++  shift; set dummy --mode compile ${1+"$@"}; shift
++  ;;
++execute|execut|execu|exec|exe|ex|e)
++  shift; set dummy --mode execute ${1+"$@"}; shift
++  ;;
++finish|finis|fini|fin|fi|f)
++  shift; set dummy --mode finish ${1+"$@"}; shift
++  ;;
++install|instal|insta|inst|ins|in|i)
++  shift; set dummy --mode install ${1+"$@"}; shift
++  ;;
++link|lin|li|l)
++  shift; set dummy --mode link ${1+"$@"}; shift
++  ;;
++uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
++  shift; set dummy --mode uninstall ${1+"$@"}; shift
++  ;;
++esac
+ 
+-  # Parse non-mode specific arguments:
+-  while test "$#" -gt 0; do
++
++
++# Option defaults:
++opt_debug=:
++opt_dry_run=false
++opt_config=false
++opt_preserve_dup_deps=false
++opt_features=false
++opt_finish=false
++opt_help=false
++opt_help_all=false
++opt_silent=:
++opt_verbose=:
++opt_silent=false
++opt_verbose=false
++
++
++# Parse options once, thoroughly.  This comes as soon as possible in the
++# script to make things like `--version' happen as quickly as we can.
++{
++  # this just eases exit handling
++  while test $# -gt 0; do
+     opt="$1"
+     shift
+-
+     case $opt in
+-      --config)		func_config					;;
+-
+-      --debug)		preserve_args="$preserve_args $opt"
++      --debug|-x)	opt_debug='set -x'
+ 			func_echo "enabling shell trace mode"
+-			opt_debug='set -x'
+ 			$opt_debug
+ 			;;
+-
+-      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+-			execute_dlfiles="$execute_dlfiles $1"
+-			shift
++      --dry-run|--dryrun|-n)
++			opt_dry_run=:
+ 			;;
+-
+-      --dry-run | -n)	opt_dry_run=:					;;
+-      --features)       func_features					;;
+-      --finish)		mode="finish"					;;
+-      --no-finish)	opt_finish=false				;;
+-
+-      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+-			case $1 in
+-			  # Valid mode arguments:
+-			  clean)	;;
+-			  compile)	;;
+-			  execute)	;;
+-			  finish)	;;
+-			  install)	;;
+-			  link)		;;
+-			  relink)	;;
+-			  uninstall)	;;
+-
+-			  # Catch anything else as an error
+-			  *) func_error "invalid argument for $opt"
+-			     exit_cmd=exit
+-			     break
+-			     ;;
+-		        esac
+-
+-			mode="$1"
++      --config)
++			opt_config=:
++func_config
++			;;
++      --dlopen|-dlopen)
++			optarg="$1"
++			opt_dlopen="${opt_dlopen+$opt_dlopen
++}$optarg"
+ 			shift
+ 			;;
+-
+       --preserve-dup-deps)
+-			opt_duplicate_deps=:				;;
+-
+-      --quiet|--silent)	preserve_args="$preserve_args $opt"
+-			opt_silent=:
+-			opt_verbose=false
++			opt_preserve_dup_deps=:
+ 			;;
+-
+-      --no-quiet|--no-silent)
+-			preserve_args="$preserve_args $opt"
+-			opt_silent=false
++      --features)
++			opt_features=:
++func_features
+ 			;;
+-
+-      --verbose| -v)	preserve_args="$preserve_args $opt"
++      --finish)
++			opt_finish=:
++set dummy --mode finish ${1+"$@"}; shift
++			;;
++      --help)
++			opt_help=:
++			;;
++      --help-all)
++			opt_help_all=:
++opt_help=': help-all'
++			;;
++      --mode)
++			test $# = 0 && func_missing_arg $opt && break
++			optarg="$1"
++			opt_mode="$optarg"
++case $optarg in
++  # Valid mode arguments:
++  clean|compile|execute|finish|install|link|relink|uninstall) ;;
++
++  # Catch anything else as an error
++  *) func_error "invalid argument for $opt"
++     exit_cmd=exit
++     break
++     ;;
++esac
++			shift
++			;;
++      --no-silent|--no-quiet)
+ 			opt_silent=false
+-			opt_verbose=:
++func_append preserve_args " $opt"
+ 			;;
+-
+-      --no-verbose)	preserve_args="$preserve_args $opt"
++      --no-verbose)
+ 			opt_verbose=false
++func_append preserve_args " $opt"
+ 			;;
+-
+-      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+-			preserve_args="$preserve_args $opt $1"
+-			func_enable_tag "$1"	# tagname is set here
++      --silent|--quiet)
++			opt_silent=:
++func_append preserve_args " $opt"
++        opt_verbose=false
++			;;
++      --verbose|-v)
++			opt_verbose=:
++func_append preserve_args " $opt"
++opt_silent=false
++			;;
++      --tag)
++			test $# = 0 && func_missing_arg $opt && break
++			optarg="$1"
++			opt_tag="$optarg"
++func_append preserve_args " $opt $optarg"
++func_enable_tag "$optarg"
+ 			shift
+ 			;;
+ 
++      -\?|-h)		func_usage				;;
++      --help)		func_help				;;
++      --version)	func_version				;;
++
+       # Separate optargs to long options:
+-      -dlopen=*|--mode=*|--tag=*)
+-			func_opt_split "$opt"
+-			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
++      --*=*)
++			func_split_long_opt "$opt"
++			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ 			shift
+ 			;;
+ 
+-      -\?|-h)		func_usage					;;
+-      --help)		opt_help=:					;;
+-      --help-all)	opt_help=': help-all'				;;
+-      --version)	func_version					;;
+-
+-      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
+-
+-      *)		nonopt="$opt"
+-			break
++      # Separate non-argument short options:
++      -\?*|-h*|-n*|-v*)
++			func_split_short_opt "$opt"
++			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
++			shift
+ 			;;
++
++      --)		break					;;
++      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
++      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
+     esac
+   done
+ 
++  # Validate options:
++
++  # save first non-option argument
++  if test "$#" -gt 0; then
++    nonopt="$opt"
++    shift
++  fi
++
++  # preserve --debug
++  test "$opt_debug" = : || func_append preserve_args " --debug"
+ 
+   case $host in
+     *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* )
+@@ -981,82 +1184,44 @@ func_enable_tag ()
+       opt_duplicate_compiler_generated_deps=:
+       ;;
+     *)
+-      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
++      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+       ;;
+   esac
+ 
+-  # Having warned about all mis-specified options, bail out if
+-  # anything was wrong.
+-  $exit_cmd $EXIT_FAILURE
+-}
++  $opt_help || {
++    # Sanity checks first:
++    func_check_version_match
+ 
+-# func_check_version_match
+-# Ensure that we are using m4 macros, and libtool script from the same
+-# release of libtool.
+-func_check_version_match ()
+-{
+-  if test "$package_revision" != "$macro_revision"; then
+-    if test "$VERSION" != "$macro_version"; then
+-      if test -z "$macro_version"; then
+-        cat >&2 <<_LT_EOF
+-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+-$progname: definition of this LT_INIT comes from an older release.
+-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+-$progname: and run autoconf again.
+-_LT_EOF
+-      else
+-        cat >&2 <<_LT_EOF
+-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+-$progname: and run autoconf again.
+-_LT_EOF
+-      fi
+-    else
+-      cat >&2 <<_LT_EOF
+-$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+-$progname: of $PACKAGE $VERSION and run autoconf again.
+-_LT_EOF
++    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
++      func_fatal_configuration "not configured to build any kind of library"
+     fi
+ 
+-    exit $EXIT_MISMATCH
+-  fi
+-}
+-
++    # Darwin sucks
++    eval std_shrext=\"$shrext_cmds\"
+ 
+-## ----------- ##
+-##    Main.    ##
+-## ----------- ##
+-
+-$opt_help || {
+-  # Sanity checks first:
+-  func_check_version_match
+-
+-  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+-    func_fatal_configuration "not configured to build any kind of library"
+-  fi
++    # Only execute mode is allowed to have -dlopen flags.
++    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
++      func_error "unrecognized option \`-dlopen'"
++      $ECHO "$help" 1>&2
++      exit $EXIT_FAILURE
++    fi
+ 
+-  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
++    # Change the help message to a mode-specific one.
++    generic_help="$help"
++    help="Try \`$progname --help --mode=$opt_mode' for more information."
++  }
+ 
+ 
+-  # Darwin sucks
+-  eval "std_shrext=\"$shrext_cmds\""
++  # Bail if the options were screwed
++  $exit_cmd $EXIT_FAILURE
++}
+ 
+ 
+-  # Only execute mode is allowed to have -dlopen flags.
+-  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+-    func_error "unrecognized option \`-dlopen'"
+-    $ECHO "$help" 1>&2
+-    exit $EXIT_FAILURE
+-  fi
+ 
+-  # Change the help message to a mode-specific one.
+-  generic_help="$help"
+-  help="Try \`$progname --help --mode=$mode' for more information."
+-}
+ 
++## ----------- ##
++##    Main.    ##
++## ----------- ##
+ 
+ # func_lalib_p file
+ # True iff FILE is a libtool `.la' library or `.lo' object file.
+@@ -1121,12 +1286,9 @@ func_ltwrapper_executable_p ()
+ # temporary ltwrapper_script.
+ func_ltwrapper_scriptname ()
+ {
+-    func_ltwrapper_scriptname_result=""
+-    if func_ltwrapper_executable_p "$1"; then
+-	func_dirname_and_basename "$1" "" "."
+-	func_stripname '' '.exe' "$func_basename_result"
+-	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+-    fi
++    func_dirname_and_basename "$1" "" "."
++    func_stripname '' '.exe' "$func_basename_result"
++    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+ }
+ 
+ # func_ltwrapper_p file
+@@ -1149,7 +1311,7 @@ func_execute_cmds ()
+     save_ifs=$IFS; IFS='~'
+     for cmd in $1; do
+       IFS=$save_ifs
+-      eval "cmd=\"$cmd\""
++      eval cmd=\"$cmd\"
+       func_show_eval "$cmd" "${2-:}"
+     done
+     IFS=$save_ifs
+@@ -1172,6 +1334,37 @@ func_source ()
+ }
+ 
+ 
++# func_resolve_sysroot PATH
++# Replace a leading = in PATH with a sysroot.  Store the result into
++# func_resolve_sysroot_result
++func_resolve_sysroot ()
++{
++  func_resolve_sysroot_result=$1
++  case $func_resolve_sysroot_result in
++  =*)
++    func_stripname '=' '' "$func_resolve_sysroot_result"
++    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
++    ;;
++  esac
++}
++
++# func_replace_sysroot PATH
++# If PATH begins with the sysroot, replace it with = and
++# store the result into func_replace_sysroot_result.
++func_replace_sysroot ()
++{
++  case "$lt_sysroot:$1" in
++  ?*:"$lt_sysroot"*)
++    func_stripname "$lt_sysroot" '' "$1"
++    func_replace_sysroot_result="=$func_stripname_result"
++    ;;
++  *)
++    # Including no sysroot.
++    func_replace_sysroot_result=$1
++    ;;
++  esac
++}
++
+ # func_infer_tag arg
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+@@ -1184,8 +1377,7 @@ func_infer_tag ()
+     if test -n "$available_tags" && test -z "$tagname"; then
+       CC_quoted=
+       for arg in $CC; do
+-        func_quote_for_eval "$arg"
+-	CC_quoted="$CC_quoted $func_quote_for_eval_result"
++	func_append_quoted CC_quoted "$arg"
+       done
+       CC_expanded=`func_echo_all $CC`
+       CC_quoted_expanded=`func_echo_all $CC_quoted`
+@@ -1204,8 +1396,7 @@ func_infer_tag ()
+ 	    CC_quoted=
+ 	    for arg in $CC; do
+ 	      # Double-quote args containing other shell metacharacters.
+-	      func_quote_for_eval "$arg"
+-	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
++	      func_append_quoted CC_quoted "$arg"
+ 	    done
+ 	    CC_expanded=`func_echo_all $CC`
+ 	    CC_quoted_expanded=`func_echo_all $CC_quoted`
+@@ -1274,6 +1465,486 @@ EOF
+     }
+ }
+ 
++
++##################################################
++# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
++##################################################
++
++# func_convert_core_file_wine_to_w32 ARG
++# Helper function used by file name conversion functions when $build is *nix,
++# and $host is mingw, cygwin, or some other w32 environment. Relies on a
++# correctly configured wine environment available, with the winepath program
++# in $build's $PATH.
++#
++# ARG is the $build file name to be converted to w32 format.
++# Result is available in $func_convert_core_file_wine_to_w32_result, and will
++# be empty on error (or when ARG is empty)
++func_convert_core_file_wine_to_w32 ()
++{
++  $opt_debug
++  func_convert_core_file_wine_to_w32_result="$1"
++  if test -n "$1"; then
++    # Unfortunately, winepath does not exit with a non-zero error code, so we
++    # are forced to check the contents of stdout. On the other hand, if the
++    # command is not found, the shell will set an exit code of 127 and print
++    # *an error message* to stdout. So we must check for both error code of
++    # zero AND non-empty stdout, which explains the odd construction:
++    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
++    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
++      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
++        $SED -e "$lt_sed_naive_backslashify"`
++    else
++      func_convert_core_file_wine_to_w32_result=
++    fi
++  fi
++}
++# end: func_convert_core_file_wine_to_w32
++
++
++# func_convert_core_path_wine_to_w32 ARG
++# Helper function used by path conversion functions when $build is *nix, and
++# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
++# configured wine environment available, with the winepath program in $build's
++# $PATH. Assumes ARG has no leading or trailing path separator characters.
++#
++# ARG is path to be converted from $build format to win32.
++# Result is available in $func_convert_core_path_wine_to_w32_result.
++# Unconvertible file (directory) names in ARG are skipped; if no directory names
++# are convertible, then the result may be empty.
++func_convert_core_path_wine_to_w32 ()
++{
++  $opt_debug
++  # unfortunately, winepath doesn't convert paths, only file names
++  func_convert_core_path_wine_to_w32_result=""
++  if test -n "$1"; then
++    oldIFS=$IFS
++    IFS=:
++    for func_convert_core_path_wine_to_w32_f in $1; do
++      IFS=$oldIFS
++      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
++      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
++        if test -z "$func_convert_core_path_wine_to_w32_result"; then
++          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
++        else
++          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
++        fi
++      fi
++    done
++    IFS=$oldIFS
++  fi
++}
++# end: func_convert_core_path_wine_to_w32
++
++
++# func_cygpath ARGS...
++# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
++# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
++# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
++# (2), returns the Cygwin file name or path in func_cygpath_result (input
++# file name or path is assumed to be in w32 format, as previously converted
++# from $build's *nix or MSYS format). In case (3), returns the w32 file name
++# or path in func_cygpath_result (input file name or path is assumed to be in
++# Cygwin format). Returns an empty string on error.
++#
++# ARGS are passed to cygpath, with the last one being the file name or path to
++# be converted.
++#
++# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
++# environment variable; do not put it in $PATH.
++func_cygpath ()
++{
++  $opt_debug
++  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
++    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
++    if test "$?" -ne 0; then
++      # on failure, ensure result is empty
++      func_cygpath_result=
++    fi
++  else
++    func_cygpath_result=
++    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
++  fi
++}
++#end: func_cygpath
++
++
++# func_convert_core_msys_to_w32 ARG
++# Convert file name or path ARG from MSYS format to w32 format.  Return
++# result in func_convert_core_msys_to_w32_result.
++func_convert_core_msys_to_w32 ()
++{
++  $opt_debug
++  # awkward: cmd appends spaces to result
++  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
++    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
++}
++#end: func_convert_core_msys_to_w32
++
++
++# func_convert_file_check ARG1 ARG2
++# Verify that ARG1 (a file name in $build format) was converted to $host
++# format in ARG2. Otherwise, emit an error message, but continue (resetting
++# func_to_host_file_result to ARG1).
++func_convert_file_check ()
++{
++  $opt_debug
++  if test -z "$2" && test -n "$1" ; then
++    func_error "Could not determine host file name corresponding to"
++    func_error "  \`$1'"
++    func_error "Continuing, but uninstalled executables may not work."
++    # Fallback:
++    func_to_host_file_result="$1"
++  fi
++}
++# end func_convert_file_check
++
++
++# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
++# Verify that FROM_PATH (a path in $build format) was converted to $host
++# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
++# func_to_host_file_result to a simplistic fallback value (see below).
++func_convert_path_check ()
++{
++  $opt_debug
++  if test -z "$4" && test -n "$3"; then
++    func_error "Could not determine the host path corresponding to"
++    func_error "  \`$3'"
++    func_error "Continuing, but uninstalled executables may not work."
++    # Fallback.  This is a deliberately simplistic "conversion" and
++    # should not be "improved".  See libtool.info.
++    if test "x$1" != "x$2"; then
++      lt_replace_pathsep_chars="s|$1|$2|g"
++      func_to_host_path_result=`echo "$3" |
++        $SED -e "$lt_replace_pathsep_chars"`
++    else
++      func_to_host_path_result="$3"
++    fi
++  fi
++}
++# end func_convert_path_check
++
++
++# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
++# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
++# and appending REPL if ORIG matches BACKPAT.
++func_convert_path_front_back_pathsep ()
++{
++  $opt_debug
++  case $4 in
++  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
++    ;;
++  esac
++  case $4 in
++  $2 ) func_append func_to_host_path_result "$3"
++    ;;
++  esac
++}
++# end func_convert_path_front_back_pathsep
++
++
++##################################################
++# $build to $host FILE NAME CONVERSION FUNCTIONS #
++##################################################
++# invoked via `$to_host_file_cmd ARG'
++#
++# In each case, ARG is the path to be converted from $build to $host format.
++# Result will be available in $func_to_host_file_result.
++
++
++# func_to_host_file ARG
++# Converts the file name ARG from $build format to $host format. Return result
++# in func_to_host_file_result.
++func_to_host_file ()
++{
++  $opt_debug
++  $to_host_file_cmd "$1"
++}
++# end func_to_host_file
++
++
++# func_to_tool_file ARG LAZY
++# converts the file name ARG from $build format to toolchain format. Return
++# result in func_to_tool_file_result.  If the conversion in use is listed
++# in (the comma separated) LAZY, no conversion takes place.
++func_to_tool_file ()
++{
++  $opt_debug
++  case ,$2, in
++    *,"$to_tool_file_cmd",*)
++      func_to_tool_file_result=$1
++      ;;
++    *)
++      $to_tool_file_cmd "$1"
++      func_to_tool_file_result=$func_to_host_file_result
++      ;;
++  esac
++}
++# end func_to_tool_file
++
++
++# func_convert_file_noop ARG
++# Copy ARG to func_to_host_file_result.
++func_convert_file_noop ()
++{
++  func_to_host_file_result="$1"
++}
++# end func_convert_file_noop
++
++
++# func_convert_file_msys_to_w32 ARG
++# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
++# conversion to w32 is not available inside the cwrapper.  Returns result in
++# func_to_host_file_result.
++func_convert_file_msys_to_w32 ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    func_convert_core_msys_to_w32 "$1"
++    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_msys_to_w32
++
++
++# func_convert_file_cygwin_to_w32 ARG
++# Convert file name ARG from Cygwin to w32 format.  Returns result in
++# func_to_host_file_result.
++func_convert_file_cygwin_to_w32 ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
++    # LT_CYGPATH in this case.
++    func_to_host_file_result=`cygpath -m "$1"`
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_cygwin_to_w32
++
++
++# func_convert_file_nix_to_w32 ARG
++# Convert file name ARG from *nix to w32 format.  Requires a wine environment
++# and a working winepath. Returns result in func_to_host_file_result.
++func_convert_file_nix_to_w32 ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    func_convert_core_file_wine_to_w32 "$1"
++    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_nix_to_w32
++
++
++# func_convert_file_msys_to_cygwin ARG
++# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
++# Returns result in func_to_host_file_result.
++func_convert_file_msys_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    func_convert_core_msys_to_w32 "$1"
++    func_cygpath -u "$func_convert_core_msys_to_w32_result"
++    func_to_host_file_result="$func_cygpath_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_msys_to_cygwin
++
++
++# func_convert_file_nix_to_cygwin ARG
++# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
++# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
++# in func_to_host_file_result.
++func_convert_file_nix_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
++    func_convert_core_file_wine_to_w32 "$1"
++    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
++    func_to_host_file_result="$func_cygpath_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_nix_to_cygwin
++
++
++#############################################
++# $build to $host PATH CONVERSION FUNCTIONS #
++#############################################
++# invoked via `$to_host_path_cmd ARG'
++#
++# In each case, ARG is the path to be converted from $build to $host format.
++# The result will be available in $func_to_host_path_result.
++#
++# Path separators are also converted from $build format to $host format.  If
++# ARG begins or ends with a path separator character, it is preserved (but
++# converted to $host format) on output.
++#
++# All path conversion functions are named using the following convention:
++#   file name conversion function    : func_convert_file_X_to_Y ()
++#   path conversion function         : func_convert_path_X_to_Y ()
++# where, for any given $build/$host combination the 'X_to_Y' value is the
++# same.  If conversion functions are added for new $build/$host combinations,
++# the two new functions must follow this pattern, or func_init_to_host_path_cmd
++# will break.
++
++
++# func_init_to_host_path_cmd
++# Ensures that function "pointer" variable $to_host_path_cmd is set to the
++# appropriate value, based on the value of $to_host_file_cmd.
++to_host_path_cmd=
++func_init_to_host_path_cmd ()
++{
++  $opt_debug
++  if test -z "$to_host_path_cmd"; then
++    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
++    to_host_path_cmd="func_convert_path_${func_stripname_result}"
++  fi
++}
++
++
++# func_to_host_path ARG
++# Converts the path ARG from $build format to $host format. Return result
++# in func_to_host_path_result.
++func_to_host_path ()
++{
++  $opt_debug
++  func_init_to_host_path_cmd
++  $to_host_path_cmd "$1"
++}
++# end func_to_host_path
++
++
++# func_convert_path_noop ARG
++# Copy ARG to func_to_host_path_result.
++func_convert_path_noop ()
++{
++  func_to_host_path_result="$1"
++}
++# end func_convert_path_noop
++
++
++# func_convert_path_msys_to_w32 ARG
++# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
++# conversion to w32 is not available inside the cwrapper.  Returns result in
++# func_to_host_path_result.
++func_convert_path_msys_to_w32 ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # Remove leading and trailing path separator characters from ARG.  MSYS
++    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
++    # and winepath ignores them completely.
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
++    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
++    func_convert_path_check : ";" \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++  fi
++}
++# end func_convert_path_msys_to_w32
++
++
++# func_convert_path_cygwin_to_w32 ARG
++# Convert path ARG from Cygwin to w32 format.  Returns result in
++# func_to_host_file_result.
++func_convert_path_cygwin_to_w32 ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # See func_convert_path_msys_to_w32:
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
++    func_convert_path_check : ";" \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++  fi
++}
++# end func_convert_path_cygwin_to_w32
++
++
++# func_convert_path_nix_to_w32 ARG
++# Convert path ARG from *nix to w32 format.  Requires a wine environment and
++# a working winepath.  Returns result in func_to_host_file_result.
++func_convert_path_nix_to_w32 ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # See func_convert_path_msys_to_w32:
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
++    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
++    func_convert_path_check : ";" \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++  fi
++}
++# end func_convert_path_nix_to_w32
++
++
++# func_convert_path_msys_to_cygwin ARG
++# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
++# Returns result in func_to_host_file_result.
++func_convert_path_msys_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # See func_convert_path_msys_to_w32:
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
++    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
++    func_to_host_path_result="$func_cygpath_result"
++    func_convert_path_check : : \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
++  fi
++}
++# end func_convert_path_msys_to_cygwin
++
++
++# func_convert_path_nix_to_cygwin ARG
++# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
++# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
++# func_to_host_file_result.
++func_convert_path_nix_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # Remove leading and trailing path separator characters from
++    # ARG. msys behavior is inconsistent here, cygpath turns them
++    # into '.;' and ';.', and winepath ignores them completely.
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
++    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
++    func_to_host_path_result="$func_cygpath_result"
++    func_convert_path_check : : \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
++  fi
++}
++# end func_convert_path_nix_to_cygwin
++
++
+ # func_mode_compile arg...
+ func_mode_compile ()
+ {
+@@ -1314,12 +1985,12 @@ func_mode_compile ()
+ 	  ;;
+ 
+ 	-pie | -fpie | -fPIE)
+-          pie_flag="$pie_flag $arg"
++          func_append pie_flag " $arg"
+ 	  continue
+ 	  ;;
+ 
+ 	-shared | -static | -prefer-pic | -prefer-non-pic)
+-	  later="$later $arg"
++	  func_append later " $arg"
+ 	  continue
+ 	  ;;
+ 
+@@ -1340,15 +2011,14 @@ func_mode_compile ()
+ 	  save_ifs="$IFS"; IFS=','
+ 	  for arg in $args; do
+ 	    IFS="$save_ifs"
+-	    func_quote_for_eval "$arg"
+-	    lastarg="$lastarg $func_quote_for_eval_result"
++	    func_append_quoted lastarg "$arg"
+ 	  done
+ 	  IFS="$save_ifs"
+ 	  func_stripname ' ' '' "$lastarg"
+ 	  lastarg=$func_stripname_result
+ 
+ 	  # Add the arguments to base_compile.
+-	  base_compile="$base_compile $lastarg"
++	  func_append base_compile " $lastarg"
+ 	  continue
+ 	  ;;
+ 
+@@ -1364,8 +2034,7 @@ func_mode_compile ()
+       esac    #  case $arg_mode
+ 
+       # Aesthetically quote the previous argument.
+-      func_quote_for_eval "$lastarg"
+-      base_compile="$base_compile $func_quote_for_eval_result"
++      func_append_quoted base_compile "$lastarg"
+     done # for arg
+ 
+     case $arg_mode in
+@@ -1496,17 +2165,16 @@ compiler."
+ 	$opt_dry_run || $RM $removelist
+ 	exit $EXIT_FAILURE
+       fi
+-      removelist="$removelist $output_obj"
++      func_append removelist " $output_obj"
+       $ECHO "$srcfile" > "$lockfile"
+     fi
+ 
+     $opt_dry_run || $RM $removelist
+-    removelist="$removelist $lockfile"
++    func_append removelist " $lockfile"
+     trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+ 
+-    if test -n "$fix_srcfile_path"; then
+-      eval "srcfile=\"$fix_srcfile_path\""
+-    fi
++    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
++    srcfile=$func_to_tool_file_result
+     func_quote_for_eval "$srcfile"
+     qsrcfile=$func_quote_for_eval_result
+ 
+@@ -1526,7 +2194,7 @@ compiler."
+ 
+       if test -z "$output_obj"; then
+ 	# Place PIC objects in $objdir
+-	command="$command -o $lobj"
++	func_append command " -o $lobj"
+       fi
+ 
+       func_show_eval_locale "$command"	\
+@@ -1573,11 +2241,11 @@ compiler."
+ 	command="$base_compile $qsrcfile $pic_flag"
+       fi
+       if test "$compiler_c_o" = yes; then
+-	command="$command -o $obj"
++	func_append command " -o $obj"
+       fi
+ 
+       # Suppress compiler output if we already did a PIC compilation.
+-      command="$command$suppress_output"
++      func_append command "$suppress_output"
+       func_show_eval_locale "$command" \
+         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+ 
+@@ -1622,13 +2290,13 @@ compiler."
+ }
+ 
+ $opt_help || {
+-  test "$mode" = compile && func_mode_compile ${1+"$@"}
++  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+ }
+ 
+ func_mode_help ()
+ {
+     # We need to display help for each of the modes.
+-    case $mode in
++    case $opt_mode in
+       "")
+         # Generic help is extracted from the usage comments
+         # at the start of this file.
+@@ -1659,8 +2327,8 @@ This mode accepts the following additional options:
+ 
+   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+   -no-suppress      do not suppress compiler output for multiple passes
+-  -prefer-pic       try to building PIC objects only
+-  -prefer-non-pic   try to building non-PIC objects only
++  -prefer-pic       try to build PIC objects only
++  -prefer-non-pic   try to build non-PIC objects only
+   -shared           do not build a \`.o' file suitable for static linking
+   -static           only build a \`.o' file suitable for static linking
+   -Wc,FLAG          pass FLAG directly to the compiler
+@@ -1804,7 +2472,7 @@ Otherwise, only FILE itself is deleted using RM."
+         ;;
+ 
+       *)
+-        func_fatal_help "invalid operation mode \`$mode'"
++        func_fatal_help "invalid operation mode \`$opt_mode'"
+         ;;
+     esac
+ 
+@@ -1819,13 +2487,13 @@ if $opt_help; then
+   else
+     {
+       func_help noexit
+-      for mode in compile link execute install finish uninstall clean; do
++      for opt_mode in compile link execute install finish uninstall clean; do
+ 	func_mode_help
+       done
+     } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+     {
+       func_help noexit
+-      for mode in compile link execute install finish uninstall clean; do
++      for opt_mode in compile link execute install finish uninstall clean; do
+ 	echo
+ 	func_mode_help
+       done
+@@ -1854,13 +2522,16 @@ func_mode_execute ()
+       func_fatal_help "you must specify a COMMAND"
+ 
+     # Handle -dlopen flags immediately.
+-    for file in $execute_dlfiles; do
++    for file in $opt_dlopen; do
+       test -f "$file" \
+ 	|| func_fatal_help "\`$file' is not a file"
+ 
+       dir=
+       case $file in
+       *.la)
++	func_resolve_sysroot "$file"
++	file=$func_resolve_sysroot_result
++
+ 	# Check to see that this really is a libtool archive.
+ 	func_lalib_unsafe_p "$file" \
+ 	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+@@ -1882,7 +2553,7 @@ func_mode_execute ()
+ 	dir="$func_dirname_result"
+ 
+ 	if test -f "$dir/$objdir/$dlname"; then
+-	  dir="$dir/$objdir"
++	  func_append dir "/$objdir"
+ 	else
+ 	  if test ! -f "$dir/$dlname"; then
+ 	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+@@ -1907,10 +2578,10 @@ func_mode_execute ()
+       test -n "$absdir" && dir="$absdir"
+ 
+       # Now add the directory to shlibpath_var.
+-      if eval test -z \"\$$shlibpath_var\"; then
+-	eval $shlibpath_var=\$dir
++      if eval "test -z \"\$$shlibpath_var\""; then
++	eval "$shlibpath_var=\"\$dir\""
+       else
+-	eval $shlibpath_var=\$dir:\$$shlibpath_var
++	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+       fi
+     done
+ 
+@@ -1939,8 +2610,7 @@ func_mode_execute ()
+ 	;;
+       esac
+       # Quote arguments (to preserve shell metacharacters).
+-      func_quote_for_eval "$file"
+-      args="$args $func_quote_for_eval_result"
++      func_append_quoted args "$file"
+     done
+ 
+     if test "X$opt_dry_run" = Xfalse; then
+@@ -1972,22 +2642,59 @@ func_mode_execute ()
+     fi
+ }
+ 
+-test "$mode" = execute && func_mode_execute ${1+"$@"}
++test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+ 
+ 
+ # func_mode_finish arg...
+ func_mode_finish ()
+ {
+     $opt_debug
+-    libdirs="$nonopt"
++    libs=
++    libdirs=
+     admincmds=
+ 
+-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+-      for dir
+-      do
+-	libdirs="$libdirs $dir"
+-      done
++    for opt in "$nonopt" ${1+"$@"}
++    do
++      if test -d "$opt"; then
++	func_append libdirs " $opt"
+ 
++      elif test -f "$opt"; then
++	if func_lalib_unsafe_p "$opt"; then
++	  func_append libs " $opt"
++	else
++	  func_warning "\`$opt' is not a valid libtool archive"
++	fi
++
++      else
++	func_fatal_error "invalid argument \`$opt'"
++      fi
++    done
++
++    if test -n "$libs"; then
++      if test -n "$lt_sysroot"; then
++        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
++        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
++      else
++        sysroot_cmd=
++      fi
++
++      # Remove sysroot references
++      if $opt_dry_run; then
++        for lib in $libs; do
++          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
++        done
++      else
++        tmpdir=`func_mktempdir`
++        for lib in $libs; do
++	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
++	    > $tmpdir/tmp-la
++	  mv -f $tmpdir/tmp-la $lib
++	done
++        ${RM}r "$tmpdir"
++      fi
++    fi
++
++    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+       for libdir in $libdirs; do
+ 	if test -n "$finish_cmds"; then
+ 	  # Do each command in the finish commands.
+@@ -1997,7 +2704,7 @@ func_mode_finish ()
+ 	if test -n "$finish_eval"; then
+ 	  # Do the single finish_eval.
+ 	  eval cmds=\"$finish_eval\"
+-	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
++	  $opt_dry_run || eval "$cmds" || func_append admincmds "
+        $cmds"
+ 	fi
+       done
+@@ -2006,53 +2713,55 @@ func_mode_finish ()
+     # Exit here if they wanted silent mode.
+     $opt_silent && exit $EXIT_SUCCESS
+ 
+-    echo "----------------------------------------------------------------------"
+-    echo "Libraries have been installed in:"
+-    for libdir in $libdirs; do
+-      $ECHO "   $libdir"
+-    done
+-    echo
+-    echo "If you ever happen to want to link against installed libraries"
+-    echo "in a given directory, LIBDIR, you must either use libtool, and"
+-    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+-    echo "flag during linking and do at least one of the following:"
+-    if test -n "$shlibpath_var"; then
+-      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+-      echo "     during execution"
+-    fi
+-    if test -n "$runpath_var"; then
+-      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+-      echo "     during linking"
+-    fi
+-    if test -n "$hardcode_libdir_flag_spec"; then
+-      libdir=LIBDIR
+-      eval "flag=\"$hardcode_libdir_flag_spec\""
++    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
++      echo "----------------------------------------------------------------------"
++      echo "Libraries have been installed in:"
++      for libdir in $libdirs; do
++	$ECHO "   $libdir"
++      done
++      echo
++      echo "If you ever happen to want to link against installed libraries"
++      echo "in a given directory, LIBDIR, you must either use libtool, and"
++      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
++      echo "flag during linking and do at least one of the following:"
++      if test -n "$shlibpath_var"; then
++	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
++	echo "     during execution"
++      fi
++      if test -n "$runpath_var"; then
++	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
++	echo "     during linking"
++      fi
++      if test -n "$hardcode_libdir_flag_spec"; then
++	libdir=LIBDIR
++	eval flag=\"$hardcode_libdir_flag_spec\"
+ 
+-      $ECHO "   - use the \`$flag' linker flag"
+-    fi
+-    if test -n "$admincmds"; then
+-      $ECHO "   - have your system administrator run these commands:$admincmds"
+-    fi
+-    if test -f /etc/ld.so.conf; then
+-      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+-    fi
+-    echo
++	$ECHO "   - use the \`$flag' linker flag"
++      fi
++      if test -n "$admincmds"; then
++	$ECHO "   - have your system administrator run these commands:$admincmds"
++      fi
++      if test -f /etc/ld.so.conf; then
++	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
++      fi
++      echo
+ 
+-    echo "See any operating system documentation about shared libraries for"
+-    case $host in
+-      solaris2.[6789]|solaris2.1[0-9])
+-        echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+-	echo "pages."
+-	;;
+-      *)
+-        echo "more information, such as the ld(1) and ld.so(8) manual pages."
+-        ;;
+-    esac
+-    echo "----------------------------------------------------------------------"
++      echo "See any operating system documentation about shared libraries for"
++      case $host in
++	solaris2.[6789]|solaris2.1[0-9])
++	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
++	  echo "pages."
++	  ;;
++	*)
++	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
++	  ;;
++      esac
++      echo "----------------------------------------------------------------------"
++    fi
+     exit $EXIT_SUCCESS
+ }
+ 
+-test "$mode" = finish && func_mode_finish ${1+"$@"}
++test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+ 
+ 
+ # func_mode_install arg...
+@@ -2077,7 +2786,7 @@ func_mode_install ()
+     # The real first argument should be the name of the installation program.
+     # Aesthetically quote it.
+     func_quote_for_eval "$arg"
+-    install_prog="$install_prog$func_quote_for_eval_result"
++    func_append install_prog "$func_quote_for_eval_result"
+     install_shared_prog=$install_prog
+     case " $install_prog " in
+       *[\\\ /]cp\ *) install_cp=: ;;
+@@ -2097,7 +2806,7 @@ func_mode_install ()
+     do
+       arg2=
+       if test -n "$dest"; then
+-	files="$files $dest"
++	func_append files " $dest"
+ 	dest=$arg
+ 	continue
+       fi
+@@ -2135,11 +2844,11 @@ func_mode_install ()
+ 
+       # Aesthetically quote the argument.
+       func_quote_for_eval "$arg"
+-      install_prog="$install_prog $func_quote_for_eval_result"
++      func_append install_prog " $func_quote_for_eval_result"
+       if test -n "$arg2"; then
+ 	func_quote_for_eval "$arg2"
+       fi
+-      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
++      func_append install_shared_prog " $func_quote_for_eval_result"
+     done
+ 
+     test -z "$install_prog" && \
+@@ -2151,7 +2860,7 @@ func_mode_install ()
+     if test -n "$install_override_mode" && $no_mode; then
+       if $install_cp; then :; else
+ 	func_quote_for_eval "$install_override_mode"
+-	install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
++	func_append install_shared_prog " -m $func_quote_for_eval_result"
+       fi
+     fi
+ 
+@@ -2209,10 +2918,13 @@ func_mode_install ()
+       case $file in
+       *.$libext)
+ 	# Do the static libraries later.
+-	staticlibs="$staticlibs $file"
++	func_append staticlibs " $file"
+ 	;;
+ 
+       *.la)
++	func_resolve_sysroot "$file"
++	file=$func_resolve_sysroot_result
++
+ 	# Check to see that this really is a libtool archive.
+ 	func_lalib_unsafe_p "$file" \
+ 	  || func_fatal_help "\`$file' is not a valid libtool archive"
+@@ -2226,23 +2938,30 @@ func_mode_install ()
+ 	if test "X$destdir" = "X$libdir"; then
+ 	  case "$current_libdirs " in
+ 	  *" $libdir "*) ;;
+-	  *) current_libdirs="$current_libdirs $libdir" ;;
++	  *) func_append current_libdirs " $libdir" ;;
+ 	  esac
+ 	else
+ 	  # Note the libdir as a future libdir.
+ 	  case "$future_libdirs " in
+ 	  *" $libdir "*) ;;
+-	  *) future_libdirs="$future_libdirs $libdir" ;;
++	  *) func_append future_libdirs " $libdir" ;;
+ 	  esac
+ 	fi
+ 
+ 	func_dirname "$file" "/" ""
+ 	dir="$func_dirname_result"
+-	dir="$dir$objdir"
++	func_append dir "$objdir"
+ 
+ 	if test -n "$relink_command"; then
++      # Strip any trailing slash from the destination.
++      func_stripname '' '/' "$libdir"
++      destlibdir=$func_stripname_result
++
++      func_stripname '' '/' "$destdir"
++      s_destdir=$func_stripname_result
++
+ 	  # Determine the prefix the user has applied to our future dir.
+-	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
++	  inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
+ 
+ 	  # Don't allow the user to place us outside of our expected
+ 	  # location b/c this prevents finding dependent libraries that
+@@ -2315,7 +3034,7 @@ func_mode_install ()
+ 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+ 
+ 	# Maybe install the static library, too.
+-	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
++	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ 	;;
+ 
+       *.lo)
+@@ -2503,7 +3222,7 @@ func_mode_install ()
+     test -n "$future_libdirs" && \
+       func_warning "remember to run \`$progname --finish$future_libdirs'"
+ 
+-    if test -n "$current_libdirs" && $opt_finish; then
++    if test -n "$current_libdirs"; then
+       # Maybe just do a dry run.
+       $opt_dry_run && current_libdirs=" -n$current_libdirs"
+       exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+@@ -2512,7 +3231,7 @@ func_mode_install ()
+     fi
+ }
+ 
+-test "$mode" = install && func_mode_install ${1+"$@"}
++test "$opt_mode" = install && func_mode_install ${1+"$@"}
+ 
+ 
+ # func_generate_dlsyms outputname originator pic_p
+@@ -2559,6 +3278,18 @@ extern \"C\" {
+ #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+ #endif
+ 
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ /* External symbol declarations for the compiler. */\
+ "
+ 
+@@ -2570,21 +3301,22 @@ extern \"C\" {
+ 	  # Add our own program objects to the symbol list.
+ 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ 	  for progfile in $progfiles; do
+-	    func_verbose "extracting global C symbols from \`$progfile'"
+-	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
++	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
++	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
++	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ 	  done
+ 
+ 	  if test -n "$exclude_expsyms"; then
+ 	    $opt_dry_run || {
+-	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+-	      $MV "$nlist"T "$nlist"
++	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
++	      eval '$MV "$nlist"T "$nlist"'
+ 	    }
+ 	  fi
+ 
+ 	  if test -n "$export_symbols_regex"; then
+ 	    $opt_dry_run || {
+-	      $EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T
+-	      $MV "$nlist"T "$nlist"
++	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
++	      eval '$MV "$nlist"T "$nlist"'
+ 	    }
+ 	  fi
+ 
+@@ -2593,23 +3325,23 @@ extern \"C\" {
+ 	    export_symbols="$output_objdir/$outputname.exp"
+ 	    $opt_dry_run || {
+ 	      $RM $export_symbols
+-	      ${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' < "$nlist" > "$export_symbols"
++	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ 	      case $host in
+ 	      *cygwin* | *mingw* | *cegcc* )
+-                echo EXPORTS > "$output_objdir/$outputname.def"
+-                cat "$export_symbols" >> "$output_objdir/$outputname.def"
++                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
++                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ 	        ;;
+ 	      esac
+ 	    }
+ 	  else
+ 	    $opt_dry_run || {
+-	      ${SED} -e 's/\([].[*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/' < "$export_symbols" > "$output_objdir/$outputname.exp"
+-	      $GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T
+-	      $MV "$nlist"T "$nlist"
++	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
++	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
++	      eval '$MV "$nlist"T "$nlist"'
+ 	      case $host in
+ 	        *cygwin* | *mingw* | *cegcc* )
+-	          echo EXPORTS > "$output_objdir/$outputname.def"
+-	          cat "$nlist" >> "$output_objdir/$outputname.def"
++	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
++	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ 	          ;;
+ 	      esac
+ 	    }
+@@ -2620,10 +3352,52 @@ extern \"C\" {
+ 	  func_verbose "extracting global C symbols from \`$dlprefile'"
+ 	  func_basename "$dlprefile"
+ 	  name="$func_basename_result"
+-	  $opt_dry_run || {
+-	    $ECHO ": $name " >> "$nlist"
+-	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+-	  }
++          case $host in
++	    *cygwin* | *mingw* | *cegcc* )
++	      # if an import library, we need to obtain dlname
++	      if func_win32_import_lib_p "$dlprefile"; then
++	        func_tr_sh "$dlprefile"
++	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
++	        dlprefile_dlbasename=""
++	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
++	          # Use subshell, to avoid clobbering current variable values
++	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
++	          if test -n "$dlprefile_dlname" ; then
++	            func_basename "$dlprefile_dlname"
++	            dlprefile_dlbasename="$func_basename_result"
++	          else
++	            # no lafile. user explicitly requested -dlpreopen <import library>.
++	            $sharedlib_from_linklib_cmd "$dlprefile"
++	            dlprefile_dlbasename=$sharedlib_from_linklib_result
++	          fi
++	        fi
++	        $opt_dry_run || {
++	          if test -n "$dlprefile_dlbasename" ; then
++	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
++	          else
++	            func_warning "Could not compute DLL name from $name"
++	            eval '$ECHO ": $name " >> "$nlist"'
++	          fi
++	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
++	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
++	        }
++	      else # not an import lib
++	        $opt_dry_run || {
++	          eval '$ECHO ": $name " >> "$nlist"'
++	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
++	        }
++	      fi
++	    ;;
++	    *)
++	      $opt_dry_run || {
++	        eval '$ECHO ": $name " >> "$nlist"'
++	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
++	      }
++	    ;;
++          esac
+ 	done
+ 
+ 	$opt_dry_run || {
+@@ -2661,26 +3435,9 @@ typedef struct {
+   const char *name;
+   void *address;
+ } lt_dlsymlist;
+-"
+-	  case $host in
+-	  *cygwin* | *mingw* | *cegcc* )
+-	    echo >> "$output_objdir/$my_dlsyms" "\
+-/* DATA imports from DLLs on WIN32 con't be const, because
+-   runtime relocations are performed -- see ld's documentation
+-   on pseudo-relocs.  */"
+-	    lt_dlsym_const= ;;
+-	  *osf5*)
+-	    echo >> "$output_objdir/$my_dlsyms" "\
+-/* This system does not cope well with relocations in const data */"
+-	    lt_dlsym_const= ;;
+-	  *)
+-	    lt_dlsym_const=const ;;
+-	  esac
+-
+-	  echo >> "$output_objdir/$my_dlsyms" "\
+-extern $lt_dlsym_const lt_dlsymlist
++extern LT_DLSYM_CONST lt_dlsymlist
+ lt_${my_prefix}_LTX_preloaded_symbols[];
+-$lt_dlsym_const lt_dlsymlist
++LT_DLSYM_CONST lt_dlsymlist
+ lt_${my_prefix}_LTX_preloaded_symbols[] =
+ {\
+   { \"$my_originator\", (void *) 0 },"
+@@ -2736,7 +3493,7 @@ static const void *lt_preloaded_setup() {
+ 	for arg in $LTCFLAGS; do
+ 	  case $arg in
+ 	  -pie | -fpie | -fPIE) ;;
+-	  *) symtab_cflags="$symtab_cflags $arg" ;;
++	  *) func_append symtab_cflags " $arg" ;;
+ 	  esac
+ 	done
+ 
+@@ -2796,9 +3553,11 @@ func_win32_libid ()
+     win32_libid_type="x86 archive import"
+     ;;
+   *ar\ archive*) # could be an import, or static
+-    if $OBJDUMP -f "$1" | $SED -e '10q' 2>/dev/null |
+-       $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+-      win32_nmres=`$NM -f posix -A "$1" |
++    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
++    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
++       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
++      func_to_tool_file "$1" func_convert_file_msys_to_w32
++      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ 	$SED -n -e '
+ 	    1,100{
+ 		/ I /{
+@@ -2827,6 +3586,131 @@ func_win32_libid ()
+   $ECHO "$win32_libid_type"
+ }
+ 
++# func_cygming_dll_for_implib ARG
++#
++# Platform-specific function to extract the
++# name of the DLL associated with the specified
++# import library ARG.
++# Invoked by eval'ing the libtool variable
++#    $sharedlib_from_linklib_cmd
++# Result is available in the variable
++#    $sharedlib_from_linklib_result
++func_cygming_dll_for_implib ()
++{
++  $opt_debug
++  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
++}
++
++# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
++#
++# The is the core of a fallback implementation of a
++# platform-specific function to extract the name of the
++# DLL associated with the specified import library LIBNAME.
++#
++# SECTION_NAME is either .idata$6 or .idata$7, depending
++# on the platform and compiler that created the implib.
++#
++# Echos the name of the DLL associated with the
++# specified import library.
++func_cygming_dll_for_implib_fallback_core ()
++{
++  $opt_debug
++  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
++  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
++    $SED '/^Contents of section '"$match_literal"':/{
++      # Place marker at beginning of archive member dllname section
++      s/.*/====MARK====/
++      p
++      d
++    }
++    # These lines can sometimes be longer than 43 characters, but
++    # are always uninteresting
++    /:[	 ]*file format pe[i]\{,1\}-/d
++    /^In archive [^:]*:/d
++    # Ensure marker is printed
++    /^====MARK====/p
++    # Remove all lines with less than 43 characters
++    /^.\{43\}/!d
++    # From remaining lines, remove first 43 characters
++    s/^.\{43\}//' |
++    $SED -n '
++      # Join marker and all lines until next marker into a single line
++      /^====MARK====/ b para
++      H
++      $ b para
++      b
++      :para
++      x
++      s/\n//g
++      # Remove the marker
++      s/^====MARK====//
++      # Remove trailing dots and whitespace
++      s/[\. \t]*$//
++      # Print
++      /./p' |
++    # we now have a list, one entry per line, of the stringified
++    # contents of the appropriate section of all members of the
++    # archive which possess that section. Heuristic: eliminate
++    # all those which have a first or second character that is
++    # a '.' (that is, objdump's representation of an unprintable
++    # character.) This should work for all archives with less than
++    # 0x302f exports -- but will fail for DLLs whose name actually
++    # begins with a literal '.' or a single character followed by
++    # a '.'.
++    #
++    # Of those that remain, print the first one.
++    $SED -e '/^\./d;/^.\./d;q'
++}
++
++# func_cygming_gnu_implib_p ARG
++# This predicate returns with zero status (TRUE) if
++# ARG is a GNU/binutils-style import library. Returns
++# with nonzero status (FALSE) otherwise.
++func_cygming_gnu_implib_p ()
++{
++  $opt_debug
++  func_to_tool_file "$1" func_convert_file_msys_to_w32
++  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
++  test -n "$func_cygming_gnu_implib_tmp"
++}
++
++# func_cygming_ms_implib_p ARG
++# This predicate returns with zero status (TRUE) if
++# ARG is an MS-style import library. Returns
++# with nonzero status (FALSE) otherwise.
++func_cygming_ms_implib_p ()
++{
++  $opt_debug
++  func_to_tool_file "$1" func_convert_file_msys_to_w32
++  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
++  test -n "$func_cygming_ms_implib_tmp"
++}
++
++# func_cygming_dll_for_implib_fallback ARG
++# Platform-specific function to extract the
++# name of the DLL associated with the specified
++# import library ARG.
++#
++# This fallback implementation is for use when $DLLTOOL
++# does not support the --identify-strict option.
++# Invoked by eval'ing the libtool variable
++#    $sharedlib_from_linklib_cmd
++# Result is available in the variable
++#    $sharedlib_from_linklib_result
++func_cygming_dll_for_implib_fallback ()
++{
++  $opt_debug
++  if func_cygming_gnu_implib_p "$1" ; then
++    # binutils import library
++    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
++  elif func_cygming_ms_implib_p "$1" ; then
++    # ms-generated import library
++    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
++  else
++    # unknown
++    sharedlib_from_linklib_result=""
++  fi
++}
+ 
+ 
+ # func_extract_an_archive dir oldlib
+@@ -2917,7 +3801,7 @@ func_extract_archives ()
+ 	    darwin_file=
+ 	    darwin_files=
+ 	    for darwin_file in $darwin_filelist; do
+-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
++	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ 	      $LIPO -create -output "$darwin_file" $darwin_files
+ 	    done # $darwin_filelist
+ 	    $RM -rf unfat-$$
+@@ -2932,7 +3816,7 @@ func_extract_archives ()
+         func_extract_an_archive "$my_xdir" "$my_xabs"
+ 	;;
+       esac
+-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
++      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+     done
+ 
+     func_extract_archives_result="$my_oldobjs"
+@@ -3014,7 +3898,110 @@ func_fallback_echo ()
+ _LTECHO_EOF'
+ }
+     ECHO=\"$qECHO\"
+-  fi\
++  fi
++
++# Very basic option parsing. These options are (a) specific to
++# the libtool wrapper, (b) are identical between the wrapper
++# /script/ and the wrapper /executable/ which is used only on
++# windows platforms, and (c) all begin with the string "--lt-"
++# (application programs are unlikely to have options which match
++# this pattern).
++#
++# There are only two supported options: --lt-debug and
++# --lt-dump-script. There is, deliberately, no --lt-help.
++#
++# The first argument to this parsing function should be the
++# script's $0 value, followed by "$@".
++lt_option_debug=
++func_parse_lt_options ()
++{
++  lt_script_arg0=\$0
++  shift
++  for lt_opt
++  do
++    case \"\$lt_opt\" in
++    --lt-debug) lt_option_debug=1 ;;
++    --lt-dump-script)
++        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
++        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
++        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
++        cat \"\$lt_dump_D/\$lt_dump_F\"
++        exit 0
++      ;;
++    --lt-*)
++        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
++        exit 1
++      ;;
++    esac
++  done
++
++  # Print the debug banner immediately:
++  if test -n \"\$lt_option_debug\"; then
++    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
++  fi
++}
++
++# Used when --lt-debug. Prints its arguments to stdout
++# (redirection is the responsibility of the caller)
++func_lt_dump_args ()
++{
++  lt_dump_args_N=1;
++  for lt_arg
++  do
++    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
++    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
++  done
++}
++
++# Core function for launching the target application
++func_exec_program_core ()
++{
++"
++  case $host in
++  # Backslashes separate directories on plain windows
++  *-*-mingw | *-*-os2* | *-cegcc*)
++    $ECHO "\
++      if test -n \"\$lt_option_debug\"; then
++        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
++        func_lt_dump_args \${1+\"\$@\"} 1>&2
++      fi
++      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
++"
++    ;;
++
++  *)
++    $ECHO "\
++      if test -n \"\$lt_option_debug\"; then
++        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
++        func_lt_dump_args \${1+\"\$@\"} 1>&2
++      fi
++      exec \"\$progdir/\$program\" \${1+\"\$@\"}
++"
++    ;;
++  esac
++  $ECHO "\
++      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
++      exit 1
++}
++
++# A function to encapsulate launching the target application
++# Strips options in the --lt-* namespace from \$@ and
++# launches target application with the remaining arguments.
++func_exec_program ()
++{
++  for lt_wr_arg
++  do
++    case \$lt_wr_arg in
++    --lt-*) ;;
++    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
++    esac
++    shift
++  done
++  func_exec_program_core \${1+\"\$@\"}
++}
++
++  # Parse options
++  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+ 
+   # Find the directory that this script lives in.
+   thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+@@ -3078,7 +4065,7 @@ _LTECHO_EOF'
+ 
+     # relink executable if necessary
+     if test -n \"\$relink_command\"; then
+-      if relink_command_output=\`eval \"\$relink_command\" 2>&1\`; then :
++      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+       else
+ 	$ECHO \"\$relink_command_output\" >&2
+ 	$RM \"\$progdir/\$file\"
+@@ -3102,6 +4089,18 @@ _LTECHO_EOF'
+ 
+   if test -f \"\$progdir/\$program\"; then"
+ 
++	# fixup the dll searchpath if we need to.
++	#
++	# Fix the DLL searchpath if we need to.  Do this before prepending
++	# to shlibpath, because on Windows, both are PATH and uninstalled
++	# libraries must come first.
++	if test -n "$dllsearchpath"; then
++	  $ECHO "\
++    # Add the dll search path components to the executable PATH
++    PATH=$dllsearchpath:\$PATH
++"
++	fi
++
+ 	# Export our shlibpath_var if we have one.
+ 	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ 	  $ECHO "\
+@@ -3116,35 +4115,10 @@ _LTECHO_EOF'
+ "
+ 	fi
+ 
+-	# fixup the dll searchpath if we need to.
+-	if test -n "$dllsearchpath"; then
+-	  $ECHO "\
+-    # Add the dll search path components to the executable PATH
+-    PATH=$dllsearchpath:\$PATH
+-"
+-	fi
+-
+ 	$ECHO "\
+     if test \"\$libtool_execute_magic\" != \"$magic\"; then
+       # Run the actual program with our arguments.
+-"
+-	case $host in
+-	# Backslashes separate directories on plain windows
+-	*-*-mingw | *-*-os2* | *-cegcc*)
+-	  $ECHO "\
+-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+-"
+-	  ;;
+-
+-	*)
+-	  $ECHO "\
+-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+-"
+-	  ;;
+-	esac
+-	$ECHO "\
+-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+-      exit 1
++      func_exec_program \${1+\"\$@\"}
+     fi
+   else
+     # The program doesn't exist.
+@@ -3158,166 +4132,6 @@ fi\
+ }
+ 
+ 
+-# func_to_host_path arg
+-#
+-# Convert paths to host format when used with build tools.
+-# Intended for use with "native" mingw (where libtool itself
+-# is running under the msys shell), or in the following cross-
+-# build environments:
+-#    $build          $host
+-#    mingw (msys)    mingw  [e.g. native]
+-#    cygwin          mingw
+-#    *nix + wine     mingw
+-# where wine is equipped with the `winepath' executable.
+-# In the native mingw case, the (msys) shell automatically
+-# converts paths for any non-msys applications it launches,
+-# but that facility isn't available from inside the cwrapper.
+-# Similar accommodations are necessary for $host mingw and
+-# $build cygwin.  Calling this function does no harm for other
+-# $host/$build combinations not listed above.
+-#
+-# ARG is the path (on $build) that should be converted to
+-# the proper representation for $host. The result is stored
+-# in $func_to_host_path_result.
+-func_to_host_path ()
+-{
+-  func_to_host_path_result="$1"
+-  if test -n "$1"; then
+-    case $host in
+-      *mingw* )
+-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+-        case $build in
+-          *mingw* ) # actually, msys
+-            # awkward: cmd appends spaces to result
+-            func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
+-              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          *cygwin* )
+-            func_to_host_path_result=`cygpath -w "$1" |
+-	      $SED -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          * )
+-            # Unfortunately, winepath does not exit with a non-zero
+-            # error code, so we are forced to check the contents of
+-            # stdout. On the other hand, if the command is not
+-            # found, the shell will set an exit code of 127 and print
+-            # *an error message* to stdout. So we must check for both
+-            # error code of zero AND non-empty stdout, which explains
+-            # the odd construction:
+-            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+-            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+-              func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
+-                $SED -e "$lt_sed_naive_backslashify"`
+-            else
+-              # Allow warning below.
+-              func_to_host_path_result=
+-            fi
+-            ;;
+-        esac
+-        if test -z "$func_to_host_path_result" ; then
+-          func_error "Could not determine host path corresponding to"
+-          func_error "  \`$1'"
+-          func_error "Continuing, but uninstalled executables may not work."
+-          # Fallback:
+-          func_to_host_path_result="$1"
+-        fi
+-        ;;
+-    esac
+-  fi
+-}
+-# end: func_to_host_path
+-
+-# func_to_host_pathlist arg
+-#
+-# Convert pathlists to host format when used with build tools.
+-# See func_to_host_path(), above. This function supports the
+-# following $build/$host combinations (but does no harm for
+-# combinations not listed here):
+-#    $build          $host
+-#    mingw (msys)    mingw  [e.g. native]
+-#    cygwin          mingw
+-#    *nix + wine     mingw
+-#
+-# Path separators are also converted from $build format to
+-# $host format. If ARG begins or ends with a path separator
+-# character, it is preserved (but converted to $host format)
+-# on output.
+-#
+-# ARG is a pathlist (on $build) that should be converted to
+-# the proper representation on $host. The result is stored
+-# in $func_to_host_pathlist_result.
+-func_to_host_pathlist ()
+-{
+-  func_to_host_pathlist_result="$1"
+-  if test -n "$1"; then
+-    case $host in
+-      *mingw* )
+-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+-        # Remove leading and trailing path separator characters from
+-        # ARG. msys behavior is inconsistent here, cygpath turns them
+-        # into '.;' and ';.', and winepath ignores them completely.
+-	func_stripname : : "$1"
+-        func_to_host_pathlist_tmp1=$func_stripname_result
+-        case $build in
+-          *mingw* ) # Actually, msys.
+-            # Awkward: cmd appends spaces to result.
+-            func_to_host_pathlist_result=`
+-	      ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
+-	      $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          *cygwin* )
+-            func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
+-              $SED -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          * )
+-            # unfortunately, winepath doesn't convert pathlists
+-            func_to_host_pathlist_result=""
+-            func_to_host_pathlist_oldIFS=$IFS
+-            IFS=:
+-            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+-              IFS=$func_to_host_pathlist_oldIFS
+-              if test -n "$func_to_host_pathlist_f" ; then
+-                func_to_host_path "$func_to_host_pathlist_f"
+-                if test -n "$func_to_host_path_result" ; then
+-                  if test -z "$func_to_host_pathlist_result" ; then
+-                    func_to_host_pathlist_result="$func_to_host_path_result"
+-                  else
+-                    func_append func_to_host_pathlist_result ";$func_to_host_path_result"
+-                  fi
+-                fi
+-              fi
+-            done
+-            IFS=$func_to_host_pathlist_oldIFS
+-            ;;
+-        esac
+-        if test -z "$func_to_host_pathlist_result"; then
+-          func_error "Could not determine the host path(s) corresponding to"
+-          func_error "  \`$1'"
+-          func_error "Continuing, but uninstalled executables may not work."
+-          # Fallback. This may break if $1 contains DOS-style drive
+-          # specifications. The fix is not to complicate the expression
+-          # below, but for the user to provide a working wine installation
+-          # with winepath so that path translation in the cross-to-mingw
+-          # case works properly.
+-          lt_replace_pathsep_nix_to_dos="s|:|;|g"
+-          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+-            $SED -e "$lt_replace_pathsep_nix_to_dos"`
+-        fi
+-        # Now, add the leading and trailing path separators back
+-        case "$1" in
+-          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+-            ;;
+-        esac
+-        case "$1" in
+-          *: ) func_append func_to_host_pathlist_result ";"
+-            ;;
+-        esac
+-        ;;
+-    esac
+-  fi
+-}
+-# end: func_to_host_pathlist
+-
+ # func_emit_cwrapperexe_src
+ # emit the source code for a wrapper executable on stdout
+ # Must ONLY be called from within func_mode_link because
+@@ -3334,10 +4148,6 @@ func_emit_cwrapperexe_src ()
+ 
+    This wrapper executable should never be moved out of the build directory.
+    If it is, it will not operate correctly.
+-
+-   Currently, it simply execs the wrapper *script* "$SHELL $output",
+-   but could eventually absorb all of the scripts functionality and
+-   exec $objdir/$outputname directly.
+ */
+ EOF
+ 	    cat <<"EOF"
+@@ -3462,22 +4272,13 @@ int setenv (const char *, const char *, int);
+   if (stale) { free ((void *) stale); stale = 0; } \
+ } while (0)
+ 
+-#undef LTWRAPPER_DEBUGPRINTF
+-#if defined LT_DEBUGWRAPPER
+-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+-static void
+-ltwrapper_debugprintf (const char *fmt, ...)
+-{
+-    va_list args;
+-    va_start (args, fmt);
+-    (void) vfprintf (stderr, fmt, args);
+-    va_end (args);
+-}
++#if defined(LT_DEBUGWRAPPER)
++static int lt_debug = 1;
+ #else
+-# define LTWRAPPER_DEBUGPRINTF(args)
++static int lt_debug = 0;
+ #endif
+ 
+-const char *program_name = NULL;
++const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+ 
+ void *xmalloc (size_t num);
+ char *xstrdup (const char *string);
+@@ -3487,7 +4288,10 @@ char *chase_symlinks (const char *pathspec);
+ int make_executable (const char *path);
+ int check_executable (const char *path);
+ char *strendzap (char *str, const char *pat);
+-void lt_fatal (const char *message, ...);
++void lt_debugprintf (const char *file, int line, const char *fmt, ...);
++void lt_fatal (const char *file, int line, const char *message, ...);
++static const char *nonnull (const char *s);
++static const char *nonempty (const char *s);
+ void lt_setenv (const char *name, const char *value);
+ char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+ void lt_update_exe_path (const char *name, const char *value);
+@@ -3497,14 +4301,14 @@ void lt_dump_script (FILE *f);
+ EOF
+ 
+ 	    cat <<EOF
+-const char * MAGIC_EXE = "$magic_exe";
++volatile const char * MAGIC_EXE = "$magic_exe";
+ const char * LIB_PATH_VARNAME = "$shlibpath_var";
+ EOF
+ 
+ 	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+-              func_to_host_pathlist "$temp_rpath"
++              func_to_host_path "$temp_rpath"
+ 	      cat <<EOF
+-const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
++const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
+ EOF
+ 	    else
+ 	      cat <<"EOF"
+@@ -3513,10 +4317,10 @@ EOF
+ 	    fi
+ 
+ 	    if test -n "$dllsearchpath"; then
+-              func_to_host_pathlist "$dllsearchpath:"
++              func_to_host_path "$dllsearchpath:"
+ 	      cat <<EOF
+ const char * EXE_PATH_VARNAME = "PATH";
+-const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
++const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
+ EOF
+ 	    else
+ 	      cat <<"EOF"
+@@ -3539,12 +4343,10 @@ EOF
+ 	    cat <<"EOF"
+ 
+ #define LTWRAPPER_OPTION_PREFIX         "--lt-"
+-#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
+ 
+-static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
+ static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+-
+ static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
++static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+ 
+ int
+ main (int argc, char *argv[])
+@@ -3561,10 +4363,13 @@ main (int argc, char *argv[])
+   int i;
+ 
+   program_name = (char *) xstrdup (base_name (argv[0]));
+-  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
+-  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
++  newargz = XMALLOC (char *, argc + 1);
+ 
+-  /* very simple arg parsing; don't want to rely on getopt */
++  /* very simple arg parsing; don't want to rely on getopt
++   * also, copy all non cwrapper options to newargz, except
++   * argz[0], which is handled differently
++   */
++  newargc=0;
+   for (i = 1; i < argc; i++)
+     {
+       if (strcmp (argv[i], dumpscript_opt) == 0)
+@@ -3581,21 +4386,54 @@ EOF
+ 	  lt_dump_script (stdout);
+ 	  return 0;
+ 	}
++      if (strcmp (argv[i], debug_opt) == 0)
++	{
++          lt_debug = 1;
++          continue;
++	}
++      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
++        {
++          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
++             namespace, but it is not one of the ones we know about and
++             have already dealt with, above (inluding dump-script), then
++             report an error. Otherwise, targets might begin to believe
++             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
++             namespace. The first time any user complains about this, we'll
++             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
++             or a configure.ac-settable value.
++           */
++          lt_fatal (__FILE__, __LINE__,
++		    "unrecognized %s option: '%s'",
++                    ltwrapper_option_prefix, argv[i]);
++        }
++      /* otherwise ... */
++      newargz[++newargc] = xstrdup (argv[i]);
+     }
++  newargz[++newargc] = NULL;
++
++EOF
++	    cat <<EOF
++  /* The GNU banner must be the first non-error debug message */
++  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
++EOF
++	    cat <<"EOF"
++  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
++  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+ 
+-  newargz = XMALLOC (char *, argc + 1);
+   tmp_pathspec = find_executable (argv[0]);
+   if (tmp_pathspec == NULL)
+-    lt_fatal ("Couldn't find %s", argv[0]);
+-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+-			  tmp_pathspec));
++    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
++  lt_debugprintf (__FILE__, __LINE__,
++                  "(main) found exe (before symlink chase) at: %s\n",
++		  tmp_pathspec);
+ 
+   actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+-			  actual_cwrapper_path));
++  lt_debugprintf (__FILE__, __LINE__,
++                  "(main) found exe (after symlink chase) at: %s\n",
++		  actual_cwrapper_path);
+   XFREE (tmp_pathspec);
+ 
+-  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
++  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+   strendzap (actual_cwrapper_path, actual_cwrapper_name);
+ 
+   /* wrapper name transforms */
+@@ -3613,8 +4451,9 @@ EOF
+   target_name = tmp_pathspec;
+   tmp_pathspec = 0;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+-			  target_name));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(main) libtool target name: %s\n",
++		  target_name);
+ EOF
+ 
+ 	    cat <<EOF
+@@ -3664,35 +4503,19 @@ EOF
+ 
+   lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+   lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+-  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
++  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
++     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
++     because on Windows, both *_VARNAMEs are PATH but uninstalled
++     libraries must come first. */
+   lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
++  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+ 
+-  newargc=0;
+-  for (i = 1; i < argc; i++)
+-    {
+-      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+-        {
+-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+-             namespace, but it is not one of the ones we know about and
+-             have already dealt with, above (inluding dump-script), then
+-             report an error. Otherwise, targets might begin to believe
+-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+-             namespace. The first time any user complains about this, we'll
+-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+-             or a configure.ac-settable value.
+-           */
+-          lt_fatal ("Unrecognized option in %s namespace: '%s'",
+-                    ltwrapper_option_prefix, argv[i]);
+-        }
+-      /* otherwise ... */
+-      newargz[++newargc] = xstrdup (argv[i]);
+-    }
+-  newargz[++newargc] = NULL;
+-
+-  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
++		  nonnull (lt_argv_zero));
+   for (i = 0; i < newargc; i++)
+     {
+-      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
++      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
++		      i, nonnull (newargz[i]));
+     }
+ 
+ EOF
+@@ -3706,7 +4529,9 @@ EOF
+   if (rval == -1)
+     {
+       /* failed to start process */
+-      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
++      lt_debugprintf (__FILE__, __LINE__,
++		      "(main) failed to launch target \"%s\": %s\n",
++		      lt_argv_zero, nonnull (strerror (errno)));
+       return 127;
+     }
+   return rval;
+@@ -3728,7 +4553,7 @@ xmalloc (size_t num)
+ {
+   void *p = (void *) malloc (num);
+   if (!p)
+-    lt_fatal ("Memory exhausted");
++    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+ 
+   return p;
+ }
+@@ -3762,8 +4587,8 @@ check_executable (const char *path)
+ {
+   struct stat st;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
+-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
++  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
++                  nonempty (path));
+   if ((!path) || (!*path))
+     return 0;
+ 
+@@ -3780,8 +4605,8 @@ make_executable (const char *path)
+   int rval = 0;
+   struct stat st;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
+-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
++  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
++                  nonempty (path));
+   if ((!path) || (!*path))
+     return 0;
+ 
+@@ -3807,8 +4632,8 @@ find_executable (const char *wrapper)
+   int tmp_len;
+   char *concat_name;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
+-			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
++  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
++                  nonempty (wrapper));
+ 
+   if ((wrapper == NULL) || (*wrapper == '\0'))
+     return NULL;
+@@ -3861,7 +4686,8 @@ find_executable (const char *wrapper)
+ 		{
+ 		  /* empty path: current directory */
+ 		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+-		    lt_fatal ("getcwd failed");
++		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
++                              nonnull (strerror (errno)));
+ 		  tmp_len = strlen (tmp);
+ 		  concat_name =
+ 		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+@@ -3886,7 +4712,8 @@ find_executable (const char *wrapper)
+     }
+   /* Relative path | not found in path: prepend cwd */
+   if (getcwd (tmp, LT_PATHMAX) == NULL)
+-    lt_fatal ("getcwd failed");
++    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
++              nonnull (strerror (errno)));
+   tmp_len = strlen (tmp);
+   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+   memcpy (concat_name, tmp, tmp_len);
+@@ -3912,8 +4739,9 @@ chase_symlinks (const char *pathspec)
+   int has_symlinks = 0;
+   while (strlen (tmp_pathspec) && !has_symlinks)
+     {
+-      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+-			      tmp_pathspec));
++      lt_debugprintf (__FILE__, __LINE__,
++		      "checking path component for symlinks: %s\n",
++		      tmp_pathspec);
+       if (lstat (tmp_pathspec, &s) == 0)
+ 	{
+ 	  if (S_ISLNK (s.st_mode) != 0)
+@@ -3935,8 +4763,9 @@ chase_symlinks (const char *pathspec)
+ 	}
+       else
+ 	{
+-	  char *errstr = strerror (errno);
+-	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
++	  lt_fatal (__FILE__, __LINE__,
++		    "error accessing file \"%s\": %s",
++		    tmp_pathspec, nonnull (strerror (errno)));
+ 	}
+     }
+   XFREE (tmp_pathspec);
+@@ -3949,7 +4778,8 @@ chase_symlinks (const char *pathspec)
+   tmp_pathspec = realpath (pathspec, buf);
+   if (tmp_pathspec == 0)
+     {
+-      lt_fatal ("Could not follow symlinks for %s", pathspec);
++      lt_fatal (__FILE__, __LINE__,
++		"could not follow symlinks for %s", pathspec);
+     }
+   return xstrdup (tmp_pathspec);
+ #endif
+@@ -3975,11 +4805,25 @@ strendzap (char *str, const char *pat)
+   return str;
+ }
+ 
++void
++lt_debugprintf (const char *file, int line, const char *fmt, ...)
++{
++  va_list args;
++  if (lt_debug)
++    {
++      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
++      va_start (args, fmt);
++      (void) vfprintf (stderr, fmt, args);
++      va_end (args);
++    }
++}
++
+ static void
+-lt_error_core (int exit_status, const char *mode,
++lt_error_core (int exit_status, const char *file,
++	       int line, const char *mode,
+ 	       const char *message, va_list ap)
+ {
+-  fprintf (stderr, "%s: %s: ", program_name, mode);
++  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+   vfprintf (stderr, message, ap);
+   fprintf (stderr, ".\n");
+ 
+@@ -3988,20 +4832,32 @@ lt_error_core (int exit_status, const char *mode,
+ }
+ 
+ void
+-lt_fatal (const char *message, ...)
++lt_fatal (const char *file, int line, const char *message, ...)
+ {
+   va_list ap;
+   va_start (ap, message);
+-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
++  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+   va_end (ap);
+ }
+ 
++static const char *
++nonnull (const char *s)
++{
++  return s ? s : "(null)";
++}
++
++static const char *
++nonempty (const char *s)
++{
++  return (s && !*s) ? "(empty)" : nonnull (s);
++}
++
+ void
+ lt_setenv (const char *name, const char *value)
+ {
+-  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+-                          (name ? name : "<NULL>"),
+-                          (value ? value : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(lt_setenv) setting '%s' to '%s'\n",
++                  nonnull (name), nonnull (value));
+   {
+ #ifdef HAVE_SETENV
+     /* always make a copy, for consistency with !HAVE_SETENV */
+@@ -4049,9 +4905,9 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
+ void
+ lt_update_exe_path (const char *name, const char *value)
+ {
+-  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+-                          (name ? name : "<NULL>"),
+-                          (value ? value : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
++                  nonnull (name), nonnull (value));
+ 
+   if (name && *name && value && *value)
+     {
+@@ -4070,9 +4926,9 @@ lt_update_exe_path (const char *name, const char *value)
+ void
+ lt_update_lib_path (const char *name, const char *value)
+ {
+-  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+-                          (name ? name : "<NULL>"),
+-                          (value ? value : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
++                  nonnull (name), nonnull (value));
+ 
+   if (name && *name && value && *value)
+     {
+@@ -4222,7 +5078,7 @@ EOF
+ func_win32_import_lib_p ()
+ {
+     $opt_debug
+-    case `eval "$file_magic_cmd \"\$1\" 2>/dev/null" | $SED -e 10q` in
++    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+     *import*) : ;;
+     *) false ;;
+     esac
+@@ -4401,9 +5257,9 @@ func_mode_link ()
+ 	    ;;
+ 	  *)
+ 	    if test "$prev" = dlfiles; then
+-	      dlfiles="$dlfiles $arg"
++	      func_append dlfiles " $arg"
+ 	    else
+-	      dlprefiles="$dlprefiles $arg"
++	      func_append dlprefiles " $arg"
+ 	    fi
+ 	    prev=
+ 	    continue
+@@ -4427,7 +5283,7 @@ func_mode_link ()
+ 	    *-*-darwin*)
+ 	      case "$deplibs " in
+ 		*" $qarg.ltframework "*) ;;
+-		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
++		*) func_append deplibs " $qarg.ltframework" # this is fixed later
+ 		   ;;
+ 	      esac
+ 	      ;;
+@@ -4446,7 +5302,7 @@ func_mode_link ()
+ 	    moreargs=
+ 	    for fil in `cat "$save_arg"`
+ 	    do
+-#	      moreargs="$moreargs $fil"
++#	      func_append moreargs " $fil"
+ 	      arg=$fil
+ 	      # A libtool-controlled object.
+ 
+@@ -4475,7 +5331,7 @@ func_mode_link ()
+ 
+ 		  if test "$prev" = dlfiles; then
+ 		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+-		      dlfiles="$dlfiles $pic_object"
++		      func_append dlfiles " $pic_object"
+ 		      prev=
+ 		      continue
+ 		    else
+@@ -4487,7 +5343,7 @@ func_mode_link ()
+ 		  # CHECK ME:  I think I busted this.  -Ossama
+ 		  if test "$prev" = dlprefiles; then
+ 		    # Preload the old-style object.
+-		    dlprefiles="$dlprefiles $pic_object"
++		    func_append dlprefiles " $pic_object"
+ 		    prev=
+ 		  fi
+ 
+@@ -4557,12 +5413,12 @@ func_mode_link ()
+ 	  if test "$prev" = rpath; then
+ 	    case "$rpath " in
+ 	    *" $arg "*) ;;
+-	    *) rpath="$rpath $arg" ;;
++	    *) func_append rpath " $arg" ;;
+ 	    esac
+ 	  else
+ 	    case "$xrpath " in
+ 	    *" $arg "*) ;;
+-	    *) xrpath="$xrpath $arg" ;;
++	    *) func_append xrpath " $arg" ;;
+ 	    esac
+ 	  fi
+ 	  prev=
+@@ -4574,28 +5430,28 @@ func_mode_link ()
+ 	  continue
+ 	  ;;
+ 	weak)
+-	  weak_libs="$weak_libs $arg"
++	  func_append weak_libs " $arg"
+ 	  prev=
+ 	  continue
+ 	  ;;
+ 	xcclinker)
+-	  linker_flags="$linker_flags $qarg"
+-	  compiler_flags="$compiler_flags $qarg"
++	  func_append linker_flags " $qarg"
++	  func_append compiler_flags " $qarg"
+ 	  prev=
+ 	  func_append compile_command " $qarg"
+ 	  func_append finalize_command " $qarg"
+ 	  continue
+ 	  ;;
+ 	xcompiler)
+-	  compiler_flags="$compiler_flags $qarg"
++	  func_append compiler_flags " $qarg"
+ 	  prev=
+ 	  func_append compile_command " $qarg"
+ 	  func_append finalize_command " $qarg"
+ 	  continue
+ 	  ;;
+ 	xlinker)
+-	  linker_flags="$linker_flags $qarg"
+-	  compiler_flags="$compiler_flags $wl$qarg"
++	  func_append linker_flags " $qarg"
++	  func_append compiler_flags " $wl$qarg"
+ 	  prev=
+ 	  func_append compile_command " $wl$qarg"
+ 	  func_append finalize_command " $wl$qarg"
+@@ -4686,15 +5542,16 @@ func_mode_link ()
+ 	;;
+ 
+       -L*)
+-	func_stripname '-L' '' "$arg"
+-	dir=$func_stripname_result
+-	if test -z "$dir"; then
++	func_stripname "-L" '' "$arg"
++	if test -z "$func_stripname_result"; then
+ 	  if test "$#" -gt 0; then
+ 	    func_fatal_error "require no space between \`-L' and \`$1'"
+ 	  else
+ 	    func_fatal_error "need path for \`-L' option"
+ 	  fi
+ 	fi
++	func_resolve_sysroot "$func_stripname_result"
++	dir=$func_resolve_sysroot_result
+ 	# We need an absolute path.
+ 	case $dir in
+ 	[\\/]* | [A-Za-z]:[\\/]*) ;;
+@@ -4706,10 +5563,16 @@ func_mode_link ()
+ 	  ;;
+ 	esac
+ 	case "$deplibs " in
+-	*" -L$dir "*) ;;
++	*" -L$dir "* | *" $arg "*)
++	  # Will only happen for absolute or sysroot arguments
++	  ;;
+ 	*)
+-	  deplibs="$deplibs -L$dir"
+-	  lib_search_path="$lib_search_path $dir"
++	  # Preserve sysroot, but never include relative directories
++	  case $dir in
++	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
++	    *) func_append deplibs " -L$dir" ;;
++	  esac
++	  func_append lib_search_path " $dir"
+ 	  ;;
+ 	esac
+ 	case $host in
+@@ -4718,12 +5581,12 @@ func_mode_link ()
+ 	  case :$dllsearchpath: in
+ 	  *":$dir:"*) ;;
+ 	  ::) dllsearchpath=$dir;;
+-	  *) dllsearchpath="$dllsearchpath:$dir";;
++	  *) func_append dllsearchpath ":$dir";;
+ 	  esac
+ 	  case :$dllsearchpath: in
+ 	  *":$testbindir:"*) ;;
+ 	  ::) dllsearchpath=$testbindir;;
+-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
++	  *) func_append dllsearchpath ":$testbindir";;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -4747,7 +5610,7 @@ func_mode_link ()
+ 	    ;;
+ 	  *-*-rhapsody* | *-*-darwin1.[012])
+ 	    # Rhapsody C and math libraries are in the System framework
+-	    deplibs="$deplibs System.ltframework"
++	    func_append deplibs " System.ltframework"
+ 	    continue
+ 	    ;;
+ 	  *-*-sco3.2v5* | *-*-sco5v6*)
+@@ -4758,9 +5621,6 @@ func_mode_link ()
+ 	    # Compiler inserts libc in the correct place for threads to work
+ 	    test "X$arg" = "X-lc" && continue
+ 	    ;;
+-	  *-*-linux*)
+-	    test "X$arg" = "X-lc" && continue
+-	    ;;
+ 	  esac
+ 	elif test "X$arg" = "X-lc_r"; then
+ 	 case $host in
+@@ -4770,7 +5630,7 @@ func_mode_link ()
+ 	   ;;
+ 	 esac
+ 	fi
+-	deplibs="$deplibs $arg"
++	func_append deplibs " $arg"
+ 	continue
+ 	;;
+ 
+@@ -4782,8 +5642,8 @@ func_mode_link ()
+       # Tru64 UNIX uses -model [arg] to determine the layout of C++
+       # classes, name mangling, and exception handling.
+       # Darwin uses the -arch flag to determine output architecture.
+-      -model|-arch|-isysroot)
+-	compiler_flags="$compiler_flags $arg"
++      -model|-arch|-isysroot|--sysroot)
++	func_append compiler_flags " $arg"
+ 	func_append compile_command " $arg"
+ 	func_append finalize_command " $arg"
+ 	prev=xcompiler
+@@ -4791,12 +5651,12 @@ func_mode_link ()
+ 	;;
+ 
+       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+-	compiler_flags="$compiler_flags $arg"
++	func_append compiler_flags " $arg"
+ 	func_append compile_command " $arg"
+ 	func_append finalize_command " $arg"
+ 	case "$new_inherited_linker_flags " in
+ 	    *" $arg "*) ;;
+-	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
++	    * ) func_append new_inherited_linker_flags " $arg" ;;
+ 	esac
+ 	continue
+ 	;;
+@@ -4863,13 +5723,17 @@ func_mode_link ()
+ 	# We need an absolute path.
+ 	case $dir in
+ 	[\\/]* | [A-Za-z]:[\\/]*) ;;
++	=*)
++	  func_stripname '=' '' "$dir"
++	  dir=$lt_sysroot$func_stripname_result
++	  ;;
+ 	*)
+ 	  func_fatal_error "only absolute run-paths are allowed"
+ 	  ;;
+ 	esac
+ 	case "$xrpath " in
+ 	*" $dir "*) ;;
+-	*) xrpath="$xrpath $dir" ;;
++	*) func_append xrpath " $dir" ;;
+ 	esac
+ 	continue
+ 	;;
+@@ -4922,8 +5786,8 @@ func_mode_link ()
+ 	for flag in $args; do
+ 	  IFS="$save_ifs"
+           func_quote_for_eval "$flag"
+-	  arg="$arg $func_quote_for_eval_result"
+-	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
++	  func_append arg " $func_quote_for_eval_result"
++	  func_append compiler_flags " $func_quote_for_eval_result"
+ 	done
+ 	IFS="$save_ifs"
+ 	func_stripname ' ' '' "$arg"
+@@ -4938,9 +5802,9 @@ func_mode_link ()
+ 	for flag in $args; do
+ 	  IFS="$save_ifs"
+           func_quote_for_eval "$flag"
+-	  arg="$arg $wl$func_quote_for_eval_result"
+-	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+-	  linker_flags="$linker_flags $func_quote_for_eval_result"
++	  func_append arg " $wl$func_quote_for_eval_result"
++	  func_append compiler_flags " $wl$func_quote_for_eval_result"
++	  func_append linker_flags " $func_quote_for_eval_result"
+ 	done
+ 	IFS="$save_ifs"
+ 	func_stripname ' ' '' "$arg"
+@@ -4968,24 +5832,27 @@ func_mode_link ()
+ 	arg="$func_quote_for_eval_result"
+ 	;;
+ 
+-      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+-      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+-      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+-      # +DA*, +DD* enable 64-bit mode on the HP compiler
+-      # -q* pass through compiler args for the IBM compiler
+-      # -m*, -t[45]*, -txscale* pass through architecture-specific
+-      # compiler args for GCC
+-      # -F/path gives path to uninstalled frameworks, gcc on darwin
+-      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+-      # @file GCC response files
+-      # -tp=* Portland pgcc target processor selection
++      # Flags to be passed through unchanged, with rationale:
++      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
++      # -r[0-9][0-9]*        specify processor for the SGI compiler
++      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
++      # +DA*, +DD*           enable 64-bit mode for the HP compiler
++      # -q*                  compiler args for the IBM compiler
++      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
++      # -F/path              path to uninstalled frameworks, gcc on darwin
++      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
++      # @file                GCC response files
++      # -tp=*                Portland pgcc target processor selection
++      # --sysroot=*          for sysroot support
++      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
++      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
++      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+         func_quote_for_eval "$arg"
+ 	arg="$func_quote_for_eval_result"
+         func_append compile_command " $arg"
+         func_append finalize_command " $arg"
+-        compiler_flags="$compiler_flags $arg"
++        func_append compiler_flags " $arg"
+         continue
+         ;;
+ 
+@@ -4997,7 +5864,7 @@ func_mode_link ()
+ 
+       *.$objext)
+ 	# A standard object.
+-	objs="$objs $arg"
++	func_append objs " $arg"
+ 	;;
+ 
+       *.lo)
+@@ -5028,7 +5895,7 @@ func_mode_link ()
+ 
+ 	    if test "$prev" = dlfiles; then
+ 	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+-		dlfiles="$dlfiles $pic_object"
++		func_append dlfiles " $pic_object"
+ 		prev=
+ 		continue
+ 	      else
+@@ -5040,7 +5907,7 @@ func_mode_link ()
+ 	    # CHECK ME:  I think I busted this.  -Ossama
+ 	    if test "$prev" = dlprefiles; then
+ 	      # Preload the old-style object.
+-	      dlprefiles="$dlprefiles $pic_object"
++	      func_append dlprefiles " $pic_object"
+ 	      prev=
+ 	    fi
+ 
+@@ -5085,24 +5952,25 @@ func_mode_link ()
+ 
+       *.$libext)
+ 	# An archive.
+-	deplibs="$deplibs $arg"
+-	old_deplibs="$old_deplibs $arg"
++	func_append deplibs " $arg"
++	func_append old_deplibs " $arg"
+ 	continue
+ 	;;
+ 
+       *.la)
+ 	# A libtool-controlled library.
+ 
++	func_resolve_sysroot "$arg"
+ 	if test "$prev" = dlfiles; then
+ 	  # This library was specified with -dlopen.
+-	  dlfiles="$dlfiles $arg"
++	  func_append dlfiles " $func_resolve_sysroot_result"
+ 	  prev=
+ 	elif test "$prev" = dlprefiles; then
+ 	  # The library was specified with -dlpreopen.
+-	  dlprefiles="$dlprefiles $arg"
++	  func_append dlprefiles " $func_resolve_sysroot_result"
+ 	  prev=
+ 	else
+-	  deplibs="$deplibs $arg"
++	  func_append deplibs " $func_resolve_sysroot_result"
+ 	fi
+ 	continue
+ 	;;
+@@ -5127,7 +5995,7 @@ func_mode_link ()
+       func_fatal_help "the \`$prevarg' option requires an argument"
+ 
+     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+-      eval "arg=\"$export_dynamic_flag_spec\""
++      eval arg=\"$export_dynamic_flag_spec\"
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+     fi
+@@ -5144,11 +6012,13 @@ func_mode_link ()
+     else
+       shlib_search_path=
+     fi
+-    eval "sys_lib_search_path=\"$sys_lib_search_path_spec\""
+-    eval "sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\""
++    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
++    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+ 
+     func_dirname "$output" "/" ""
+     output_objdir="$func_dirname_result$objdir"
++    func_to_tool_file "$output_objdir/"
++    tool_output_objdir=$func_to_tool_file_result
+     # Create the object directory.
+     func_mkdir_p "$output_objdir"
+ 
+@@ -5169,12 +6039,12 @@ func_mode_link ()
+     # Find all interdependent deplibs by searching for libraries
+     # that are linked more than once (e.g. -la -lb -la)
+     for deplib in $deplibs; do
+-      if $opt_duplicate_deps ; then
++      if $opt_preserve_dup_deps ; then
+ 	case "$libs " in
+-	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ 	esac
+       fi
+-      libs="$libs $deplib"
++      func_append libs " $deplib"
+     done
+ 
+     if test "$linkmode" = lib; then
+@@ -5187,9 +6057,9 @@ func_mode_link ()
+       if $opt_duplicate_compiler_generated_deps; then
+ 	for pre_post_dep in $predeps $postdeps; do
+ 	  case "$pre_post_deps " in
+-	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
++	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ 	  esac
+-	  pre_post_deps="$pre_post_deps $pre_post_dep"
++	  func_append pre_post_deps " $pre_post_dep"
+ 	done
+       fi
+       pre_post_deps=
+@@ -5256,8 +6126,9 @@ func_mode_link ()
+ 	for lib in $dlprefiles; do
+ 	  # Ignore non-libtool-libs
+ 	  dependency_libs=
++	  func_resolve_sysroot "$lib"
+ 	  case $lib in
+-	  *.la)	func_source "$lib" ;;
++	  *.la)	func_source "$func_resolve_sysroot_result" ;;
+ 	  esac
+ 
+ 	  # Collect preopened libtool deplibs, except any this library
+@@ -5267,7 +6138,7 @@ func_mode_link ()
+             deplib_base=$func_basename_result
+ 	    case " $weak_libs " in
+ 	    *" $deplib_base "*) ;;
+-	    *) deplibs="$deplibs $deplib" ;;
++	    *) func_append deplibs " $deplib" ;;
+ 	    esac
+ 	  done
+ 	done
+@@ -5288,11 +6159,11 @@ func_mode_link ()
+ 	    compile_deplibs="$deplib $compile_deplibs"
+ 	    finalize_deplibs="$deplib $finalize_deplibs"
+ 	  else
+-	    compiler_flags="$compiler_flags $deplib"
++	    func_append compiler_flags " $deplib"
+ 	    if test "$linkmode" = lib ; then
+ 		case "$new_inherited_linker_flags " in
+ 		    *" $deplib "*) ;;
+-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
++		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+ 		esac
+ 	    fi
+ 	  fi
+@@ -5377,7 +6248,7 @@ func_mode_link ()
+ 	    if test "$linkmode" = lib ; then
+ 		case "$new_inherited_linker_flags " in
+ 		    *" $deplib "*) ;;
+-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
++		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+ 		esac
+ 	    fi
+ 	  fi
+@@ -5390,7 +6261,8 @@ func_mode_link ()
+ 	    test "$pass" = conv && continue
+ 	    newdependency_libs="$deplib $newdependency_libs"
+ 	    func_stripname '-L' '' "$deplib"
+-	    newlib_search_path="$newlib_search_path $func_stripname_result"
++	    func_resolve_sysroot "$func_stripname_result"
++	    func_append newlib_search_path " $func_resolve_sysroot_result"
+ 	    ;;
+ 	  prog)
+ 	    if test "$pass" = conv; then
+@@ -5404,7 +6276,8 @@ func_mode_link ()
+ 	      finalize_deplibs="$deplib $finalize_deplibs"
+ 	    fi
+ 	    func_stripname '-L' '' "$deplib"
+-	    newlib_search_path="$newlib_search_path $func_stripname_result"
++	    func_resolve_sysroot "$func_stripname_result"
++	    func_append newlib_search_path " $func_resolve_sysroot_result"
+ 	    ;;
+ 	  *)
+ 	    func_warning "\`-L' is ignored for archives/objects"
+@@ -5415,17 +6288,21 @@ func_mode_link ()
+ 	-R*)
+ 	  if test "$pass" = link; then
+ 	    func_stripname '-R' '' "$deplib"
+-	    dir=$func_stripname_result
++	    func_resolve_sysroot "$func_stripname_result"
++	    dir=$func_resolve_sysroot_result
+ 	    # Make sure the xrpath contains only unique directories.
+ 	    case "$xrpath " in
+ 	    *" $dir "*) ;;
+-	    *) xrpath="$xrpath $dir" ;;
++	    *) func_append xrpath " $dir" ;;
+ 	    esac
+ 	  fi
+ 	  deplibs="$deplib $deplibs"
+ 	  continue
+ 	  ;;
+-	*.la) lib="$deplib" ;;
++	*.la)
++	  func_resolve_sysroot "$deplib"
++	  lib=$func_resolve_sysroot_result
++	  ;;
+ 	*.$libext)
+ 	  if test "$pass" = conv; then
+ 	    deplibs="$deplib $deplibs"
+@@ -5488,11 +6365,11 @@ func_mode_link ()
+ 	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ 	      # If there is no dlopen support or we're linking statically,
+ 	      # we need to preload.
+-	      newdlprefiles="$newdlprefiles $deplib"
++	      func_append newdlprefiles " $deplib"
+ 	      compile_deplibs="$deplib $compile_deplibs"
+ 	      finalize_deplibs="$deplib $finalize_deplibs"
+ 	    else
+-	      newdlfiles="$newdlfiles $deplib"
++	      func_append newdlfiles " $deplib"
+ 	    fi
+ 	  fi
+ 	  continue
+@@ -5538,7 +6415,7 @@ func_mode_link ()
+ 	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ 	    case " $new_inherited_linker_flags " in
+ 	      *" $tmp_inherited_linker_flag "*) ;;
+-	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
++	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ 	    esac
+ 	  done
+ 	fi
+@@ -5546,8 +6423,8 @@ func_mode_link ()
+ 	if test "$linkmode,$pass" = "lib,link" ||
+ 	   test "$linkmode,$pass" = "prog,scan" ||
+ 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+-	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+-	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
++	  test -n "$dlopen" && func_append dlfiles " $dlopen"
++	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ 	fi
+ 
+ 	if test "$pass" = conv; then
+@@ -5558,20 +6435,20 @@ func_mode_link ()
+ 	      func_fatal_error "cannot find name of link library for \`$lib'"
+ 	    fi
+ 	    # It is a libtool convenience library, so add in its objects.
+-	    convenience="$convenience $ladir/$objdir/$old_library"
+-	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
++	    func_append convenience " $ladir/$objdir/$old_library"
++	    func_append old_convenience " $ladir/$objdir/$old_library"
+ 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ 	    func_fatal_error "\`$lib' is not a convenience library"
+ 	  fi
+ 	  tmp_libs=
+ 	  for deplib in $dependency_libs; do
+ 	    deplibs="$deplib $deplibs"
+-	    if $opt_duplicate_deps ; then
++	    if $opt_preserve_dup_deps ; then
+ 	      case "$tmp_libs " in
+-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ 	      esac
+ 	    fi
+-	    tmp_libs="$tmp_libs $deplib"
++	    func_append tmp_libs " $deplib"
+ 	  done
+ 	  continue
+ 	fi # $pass = conv
+@@ -5579,9 +6456,15 @@ func_mode_link ()
+ 
+ 	# Get the name of the library we link against.
+ 	linklib=
+-	for l in $old_library $library_names; do
+-	  linklib="$l"
+-	done
++	if test -n "$old_library" &&
++	   { test "$prefer_static_libs" = yes ||
++	     test "$prefer_static_libs,$installed" = "built,no"; }; then
++	  linklib=$old_library
++	else
++	  for l in $old_library $library_names; do
++	    linklib="$l"
++	  done
++	fi
+ 	if test -z "$linklib"; then
+ 	  func_fatal_error "cannot find name of link library for \`$lib'"
+ 	fi
+@@ -5598,9 +6481,9 @@ func_mode_link ()
+ 	    # statically, we need to preload.  We also need to preload any
+ 	    # dependent libraries so libltdl's deplib preloader doesn't
+ 	    # bomb out in the load deplibs phase.
+-	    dlprefiles="$dlprefiles $lib $dependency_libs"
++	    func_append dlprefiles " $lib $dependency_libs"
+ 	  else
+-	    newdlfiles="$newdlfiles $lib"
++	    func_append newdlfiles " $lib"
+ 	  fi
+ 	  continue
+ 	fi # $pass = dlopen
+@@ -5622,14 +6505,14 @@ func_mode_link ()
+ 
+ 	# Find the relevant object directory and library name.
+ 	if test "X$installed" = Xyes; then
+-	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
++	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ 	    func_warning "library \`$lib' was moved."
+ 	    dir="$ladir"
+ 	    absdir="$abs_ladir"
+ 	    libdir="$abs_ladir"
+ 	  else
+-	    dir="$libdir"
+-	    absdir="$libdir"
++	    dir="$lt_sysroot$libdir"
++	    absdir="$lt_sysroot$libdir"
+ 	  fi
+ 	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ 	else
+@@ -5637,12 +6520,12 @@ func_mode_link ()
+ 	    dir="$ladir"
+ 	    absdir="$abs_ladir"
+ 	    # Remove this search path later
+-	    notinst_path="$notinst_path $abs_ladir"
++	    func_append notinst_path " $abs_ladir"
+ 	  else
+ 	    dir="$ladir/$objdir"
+ 	    absdir="$abs_ladir/$objdir"
+ 	    # Remove this search path later
+-	    notinst_path="$notinst_path $abs_ladir"
++	    func_append notinst_path " $abs_ladir"
+ 	  fi
+ 	fi # $installed = yes
+ 	func_stripname 'lib' '.la' "$laname"
+@@ -5653,20 +6536,46 @@ func_mode_link ()
+ 	  if test -z "$libdir" && test "$linkmode" = prog; then
+ 	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ 	  fi
+-	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+-	  # are required to link).
+-	  if test -n "$old_library"; then
+-	    newdlprefiles="$newdlprefiles $dir/$old_library"
+-	    # Keep a list of preopened convenience libraries to check
+-	    # that they are being used correctly in the link pass.
+-	    test -z "$libdir" && \
+-		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+-	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+-	  elif test -n "$dlname"; then
+-	    newdlprefiles="$newdlprefiles $dir/$dlname"
+-	  else
+-	    newdlprefiles="$newdlprefiles $dir/$linklib"
+-	  fi
++	  case "$host" in
++	    # special handling for platforms with PE-DLLs.
++	    *cygwin* | *mingw* | *cegcc* )
++	      # Linker will automatically link against shared library if both
++	      # static and shared are present.  Therefore, ensure we extract
++	      # symbols from the import library if a shared library is present
++	      # (otherwise, the dlopen module name will be incorrect).  We do
++	      # this by putting the import library name into $newdlprefiles.
++	      # We recover the dlopen module name by 'saving' the la file
++	      # name in a special purpose variable, and (later) extracting the
++	      # dlname from the la file.
++	      if test -n "$dlname"; then
++	        func_tr_sh "$dir/$linklib"
++	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
++	        func_append newdlprefiles " $dir/$linklib"
++	      else
++	        func_append newdlprefiles " $dir/$old_library"
++	        # Keep a list of preopened convenience libraries to check
++	        # that they are being used correctly in the link pass.
++	        test -z "$libdir" && \
++	          func_append dlpreconveniencelibs " $dir/$old_library"
++	      fi
++	    ;;
++	    * )
++	      # Prefer using a static library (so that no silly _DYNAMIC symbols
++	      # are required to link).
++	      if test -n "$old_library"; then
++	        func_append newdlprefiles " $dir/$old_library"
++	        # Keep a list of preopened convenience libraries to check
++	        # that they are being used correctly in the link pass.
++	        test -z "$libdir" && \
++	          func_append dlpreconveniencelibs " $dir/$old_library"
++	      # Otherwise, use the dlname, so that lt_dlopen finds it.
++	      elif test -n "$dlname"; then
++	        func_append newdlprefiles " $dir/$dlname"
++	      else
++	        func_append newdlprefiles " $dir/$linklib"
++	      fi
++	    ;;
++	  esac
+ 	fi # $pass = dlpreopen
+ 
+ 	if test -z "$libdir"; then
+@@ -5684,7 +6593,7 @@ func_mode_link ()
+ 
+ 
+ 	if test "$linkmode" = prog && test "$pass" != link; then
+-	  newlib_search_path="$newlib_search_path $ladir"
++	  func_append newlib_search_path " $ladir"
+ 	  deplibs="$lib $deplibs"
+ 
+ 	  linkalldeplibs=no
+@@ -5697,7 +6606,8 @@ func_mode_link ()
+ 	  for deplib in $dependency_libs; do
+ 	    case $deplib in
+ 	    -L*) func_stripname '-L' '' "$deplib"
+-	         newlib_search_path="$newlib_search_path $func_stripname_result"
++	         func_resolve_sysroot "$func_stripname_result"
++	         func_append newlib_search_path " $func_resolve_sysroot_result"
+ 		 ;;
+ 	    esac
+ 	    # Need to link against all dependency_libs?
+@@ -5708,12 +6618,12 @@ func_mode_link ()
+ 	      # or/and link against static libraries
+ 	      newdependency_libs="$deplib $newdependency_libs"
+ 	    fi
+-	    if $opt_duplicate_deps ; then
++	    if $opt_preserve_dup_deps ; then
+ 	      case "$tmp_libs " in
+-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ 	      esac
+ 	    fi
+-	    tmp_libs="$tmp_libs $deplib"
++	    func_append tmp_libs " $deplib"
+ 	  done # for deplib
+ 	  continue
+ 	fi # $linkmode = prog...
+@@ -5728,7 +6638,7 @@ func_mode_link ()
+ 	      # Make sure the rpath contains only unique directories.
+ 	      case "$temp_rpath:" in
+ 	      *"$absdir:"*) ;;
+-	      *) temp_rpath="$temp_rpath$absdir:" ;;
++	      *) func_append temp_rpath "$absdir:" ;;
+ 	      esac
+ 	    fi
+ 
+@@ -5740,7 +6650,7 @@ func_mode_link ()
+ 	    *)
+ 	      case "$compile_rpath " in
+ 	      *" $absdir "*) ;;
+-	      *) compile_rpath="$compile_rpath $absdir"
++	      *) func_append compile_rpath " $absdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5749,7 +6659,7 @@ func_mode_link ()
+ 	    *)
+ 	      case "$finalize_rpath " in
+ 	      *" $libdir "*) ;;
+-	      *) finalize_rpath="$finalize_rpath $libdir"
++	      *) func_append finalize_rpath " $libdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5774,12 +6684,12 @@ func_mode_link ()
+ 	  case $host in
+ 	  *cygwin* | *mingw* | *cegcc*)
+ 	      # No point in relinking DLLs because paths are not encoded
+-	      notinst_deplibs="$notinst_deplibs $lib"
++	      func_append notinst_deplibs " $lib"
+ 	      need_relink=no
+ 	    ;;
+ 	  *)
+ 	    if test "$installed" = no; then
+-	      notinst_deplibs="$notinst_deplibs $lib"
++	      func_append notinst_deplibs " $lib"
+ 	      need_relink=yes
+ 	    fi
+ 	    ;;
+@@ -5814,7 +6724,7 @@ func_mode_link ()
+ 	    *)
+ 	      case "$compile_rpath " in
+ 	      *" $absdir "*) ;;
+-	      *) compile_rpath="$compile_rpath $absdir"
++	      *) func_append compile_rpath " $absdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5823,7 +6733,7 @@ func_mode_link ()
+ 	    *)
+ 	      case "$finalize_rpath " in
+ 	      *" $libdir "*) ;;
+-	      *) finalize_rpath="$finalize_rpath $libdir"
++	      *) func_append finalize_rpath " $libdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5835,7 +6745,7 @@ func_mode_link ()
+ 	    shift
+ 	    realname="$1"
+ 	    shift
+-	    eval "libname=\"$libname_spec\""
++	    libname=`eval "\\$ECHO \"$libname_spec\""`
+ 	    # use dlname if we got it. it's perfectly good, no?
+ 	    if test -n "$dlname"; then
+ 	      soname="$dlname"
+@@ -5848,7 +6758,7 @@ func_mode_link ()
+ 		versuffix="-$major"
+ 		;;
+ 	      esac
+-	      eval "soname=\"$soname_spec\""
++	      eval soname=\"$soname_spec\"
+ 	    else
+ 	      soname="$realname"
+ 	    fi
+@@ -5877,7 +6787,7 @@ func_mode_link ()
+ 	    linklib=$newlib
+ 	  fi # test -n "$old_archive_from_expsyms_cmds"
+ 
+-	  if test "$linkmode" = prog || test "$mode" != relink; then
++	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ 	    add_shlibpath=
+ 	    add_dir=
+ 	    add=
+@@ -5933,7 +6843,7 @@ func_mode_link ()
+ 		if test -n "$inst_prefix_dir"; then
+ 		  case $libdir in
+ 		    [\\/]*)
+-		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
++		      func_append add_dir " -L$inst_prefix_dir$libdir"
+ 		      ;;
+ 		  esac
+ 		fi
+@@ -5955,7 +6865,7 @@ func_mode_link ()
+ 	    if test -n "$add_shlibpath"; then
+ 	      case :$compile_shlibpath: in
+ 	      *":$add_shlibpath:"*) ;;
+-	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
++	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ 	      esac
+ 	    fi
+ 	    if test "$linkmode" = prog; then
+@@ -5969,13 +6879,13 @@ func_mode_link ()
+ 		 test "$hardcode_shlibpath_var" = yes; then
+ 		case :$finalize_shlibpath: in
+ 		*":$libdir:"*) ;;
+-		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++		*) func_append finalize_shlibpath "$libdir:" ;;
+ 		esac
+ 	      fi
+ 	    fi
+ 	  fi
+ 
+-	  if test "$linkmode" = prog || test "$mode" = relink; then
++	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ 	    add_shlibpath=
+ 	    add_dir=
+ 	    add=
+@@ -5989,7 +6899,7 @@ func_mode_link ()
+ 	    elif test "$hardcode_shlibpath_var" = yes; then
+ 	      case :$finalize_shlibpath: in
+ 	      *":$libdir:"*) ;;
+-	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++	      *) func_append finalize_shlibpath "$libdir:" ;;
+ 	      esac
+ 	      add="-l$name"
+ 	    elif test "$hardcode_automatic" = yes; then
+@@ -6001,12 +6911,12 @@ func_mode_link ()
+ 	      fi
+ 	    else
+ 	      # We cannot seem to hardcode it, guess we'll fake it.
+-	      add_dir="-L$libdir"
++	      add_dir="-L$lt_sysroot$libdir"
+ 	      # Try looking first in the location we're being installed to.
+ 	      if test -n "$inst_prefix_dir"; then
+ 		case $libdir in
+ 		  [\\/]*)
+-		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
++		    func_append add_dir " -L$inst_prefix_dir$libdir"
+ 		    ;;
+ 		esac
+ 	      fi
+@@ -6083,27 +6993,33 @@ func_mode_link ()
+ 	           temp_xrpath=$func_stripname_result
+ 		   case " $xrpath " in
+ 		   *" $temp_xrpath "*) ;;
+-		   *) xrpath="$xrpath $temp_xrpath";;
++		   *) func_append xrpath " $temp_xrpath";;
+ 		   esac;;
+-	      *) temp_deplibs="$temp_deplibs $libdir";;
++	      *) func_append temp_deplibs " $libdir";;
+ 	      esac
+ 	    done
+ 	    dependency_libs="$temp_deplibs"
+ 	  fi
+ 
+-	  newlib_search_path="$newlib_search_path $absdir"
++	  func_append newlib_search_path " $absdir"
+ 	  # Link against this library
+ 	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ 	  # ... and its dependency_libs
+ 	  tmp_libs=
+ 	  for deplib in $dependency_libs; do
+ 	    newdependency_libs="$deplib $newdependency_libs"
+-	    if $opt_duplicate_deps ; then
++	    case $deplib in
++              -L*) func_stripname '-L' '' "$deplib"
++                   func_resolve_sysroot "$func_stripname_result";;
++              *) func_resolve_sysroot "$deplib" ;;
++            esac
++	    if $opt_preserve_dup_deps ; then
+ 	      case "$tmp_libs " in
+-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	      *" $func_resolve_sysroot_result "*)
++                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ 	      esac
+ 	    fi
+-	    tmp_libs="$tmp_libs $deplib"
++	    func_append tmp_libs " $func_resolve_sysroot_result"
+ 	  done
+ 
+ 	  if test "$link_all_deplibs" != no; then
+@@ -6113,8 +7029,10 @@ func_mode_link ()
+ 	      case $deplib in
+ 	      -L*) path="$deplib" ;;
+ 	      *.la)
++	        func_resolve_sysroot "$deplib"
++	        deplib=$func_resolve_sysroot_result
+ 	        func_dirname "$deplib" "" "."
+-		dir="$func_dirname_result"
++		dir=$func_dirname_result
+ 		# We need an absolute path.
+ 		case $dir in
+ 		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+@@ -6130,7 +7048,7 @@ func_mode_link ()
+ 		case $host in
+ 		*-*-darwin*)
+ 		  depdepl=
+-		  deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
++		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ 		  if test -n "$deplibrary_names" ; then
+ 		    for tmp in $deplibrary_names ; do
+ 		      depdepl=$tmp
+@@ -6141,8 +7059,8 @@ func_mode_link ()
+                       if test -z "$darwin_install_name"; then
+                           darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                       fi
+-		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+-		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
++		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
++		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ 		      path=
+ 		    fi
+ 		  fi
+@@ -6152,7 +7070,7 @@ func_mode_link ()
+ 		  ;;
+ 		esac
+ 		else
+-		  libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ 		  test -z "$libdir" && \
+ 		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+ 		  test "$absdir" != "$libdir" && \
+@@ -6192,7 +7110,7 @@ func_mode_link ()
+ 	  for dir in $newlib_search_path; do
+ 	    case "$lib_search_path " in
+ 	    *" $dir "*) ;;
+-	    *) lib_search_path="$lib_search_path $dir" ;;
++	    *) func_append lib_search_path " $dir" ;;
+ 	    esac
+ 	  done
+ 	  newlib_search_path=
+@@ -6205,7 +7123,7 @@ func_mode_link ()
+ 	fi
+ 	for var in $vars dependency_libs; do
+ 	  # Add libraries to $var in reverse order
+-	  eval tmp_libs=\$$var
++	  eval tmp_libs=\"\$$var\"
+ 	  new_libs=
+ 	  for deplib in $tmp_libs; do
+ 	    # FIXME: Pedantically, this is the right thing to do, so
+@@ -6250,13 +7168,13 @@ func_mode_link ()
+ 	    -L*)
+ 	      case " $tmp_libs " in
+ 	      *" $deplib "*) ;;
+-	      *) tmp_libs="$tmp_libs $deplib" ;;
++	      *) func_append tmp_libs " $deplib" ;;
+ 	      esac
+ 	      ;;
+-	    *) tmp_libs="$tmp_libs $deplib" ;;
++	    *) func_append tmp_libs " $deplib" ;;
+ 	    esac
+ 	  done
+-	  eval $var=\$tmp_libs
++	  eval $var=\"$tmp_libs\"
+ 	done # for var
+       fi
+       # Last step: remove runtime libs from dependency_libs
+@@ -6269,7 +7187,7 @@ func_mode_link ()
+ 	  ;;
+ 	esac
+ 	if test -n "$i" ; then
+-	  tmp_libs="$tmp_libs $i"
++	  func_append tmp_libs " $i"
+ 	fi
+       done
+       dependency_libs=$tmp_libs
+@@ -6310,7 +7228,7 @@ func_mode_link ()
+       # Now set the variables for building old libraries.
+       build_libtool_libs=no
+       oldlibs="$output"
+-      objs="$objs$old_deplibs"
++      func_append objs "$old_deplibs"
+       ;;
+ 
+     lib)
+@@ -6319,8 +7237,8 @@ func_mode_link ()
+       lib*)
+ 	func_stripname 'lib' '.la' "$outputname"
+ 	name=$func_stripname_result
+-	eval "shared_ext=\"$shrext_cmds\""
+-	eval "libname=\"$libname_spec\""
++	eval shared_ext=\"$shrext_cmds\"
++	eval libname=\"$libname_spec\"
+ 	;;
+       *)
+ 	test "$module" = no && \
+@@ -6330,8 +7248,8 @@ func_mode_link ()
+ 	  # Add the "lib" prefix for modules if required
+ 	  func_stripname '' '.la' "$outputname"
+ 	  name=$func_stripname_result
+-	  eval "shared_ext=\"$shrext_cmds\""
+-	  eval "libname=\"$libname_spec\""
++	  eval shared_ext=\"$shrext_cmds\"
++	  eval libname=\"$libname_spec\"
+ 	else
+ 	  func_stripname '' '.la' "$outputname"
+ 	  libname=$func_stripname_result
+@@ -6346,7 +7264,7 @@ func_mode_link ()
+ 	  echo
+ 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ 	  $ECHO "*** objects $objs is not portable!"
+-	  libobjs="$libobjs $objs"
++	  func_append libobjs " $objs"
+ 	fi
+       fi
+ 
+@@ -6544,7 +7462,7 @@ func_mode_link ()
+ 	  done
+ 
+ 	  # Make executables depend on our current version.
+-	  verstring="$verstring:${current}.0"
++	  func_append verstring ":${current}.0"
+ 	  ;;
+ 
+ 	qnx)
+@@ -6612,10 +7530,10 @@ func_mode_link ()
+       fi
+ 
+       func_generate_dlsyms "$libname" "$libname" "yes"
+-      libobjs="$libobjs $symfileobj"
++      func_append libobjs " $symfileobj"
+       test "X$libobjs" = "X " && libobjs=
+ 
+-      if test "$mode" != relink; then
++      if test "$opt_mode" != relink; then
+ 	# Remove our outputs, but don't remove object files since they
+ 	# may have been created when compiling PIC objects.
+ 	removelist=
+@@ -6631,7 +7549,7 @@ func_mode_link ()
+ 		   continue
+ 		 fi
+ 	       fi
+-	       removelist="$removelist $p"
++	       func_append removelist " $p"
+ 	       ;;
+ 	    *) ;;
+ 	  esac
+@@ -6642,7 +7560,7 @@ func_mode_link ()
+ 
+       # Now set the variables for building old libraries.
+       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+-	oldlibs="$oldlibs $output_objdir/$libname.$libext"
++	func_append oldlibs " $output_objdir/$libname.$libext"
+ 
+ 	# Transform .lo files to .o files.
+ 	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+@@ -6659,10 +7577,11 @@ func_mode_link ()
+ 	# If the user specified any rpath flags, then add them.
+ 	temp_xrpath=
+ 	for libdir in $xrpath; do
+-	  temp_xrpath="$temp_xrpath -R$libdir"
++	  func_replace_sysroot "$libdir"
++	  func_append temp_xrpath " -R$func_replace_sysroot_result"
+ 	  case "$finalize_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
++	  *) func_append finalize_rpath " $libdir" ;;
+ 	  esac
+ 	done
+ 	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+@@ -6676,7 +7595,7 @@ func_mode_link ()
+       for lib in $old_dlfiles; do
+ 	case " $dlprefiles $dlfiles " in
+ 	*" $lib "*) ;;
+-	*) dlfiles="$dlfiles $lib" ;;
++	*) func_append dlfiles " $lib" ;;
+ 	esac
+       done
+ 
+@@ -6686,7 +7605,7 @@ func_mode_link ()
+       for lib in $old_dlprefiles; do
+ 	case "$dlprefiles " in
+ 	*" $lib "*) ;;
+-	*) dlprefiles="$dlprefiles $lib" ;;
++	*) func_append dlprefiles " $lib" ;;
+ 	esac
+       done
+ 
+@@ -6698,7 +7617,7 @@ func_mode_link ()
+ 	    ;;
+ 	  *-*-rhapsody* | *-*-darwin1.[012])
+ 	    # Rhapsody C library is in the System framework
+-	    deplibs="$deplibs System.ltframework"
++	    func_append deplibs " System.ltframework"
+ 	    ;;
+ 	  *-*-netbsd*)
+ 	    # Don't link with libc until the a.out ld.so is fixed.
+@@ -6715,7 +7634,7 @@ func_mode_link ()
+ 	  *)
+ 	    # Add libc to deplibs on all other systems if necessary.
+ 	    if test "$build_libtool_need_lc" = "yes"; then
+-	      deplibs="$deplibs -lc"
++	      func_append deplibs " -lc"
+ 	    fi
+ 	    ;;
+ 	  esac
+@@ -6764,18 +7683,18 @@ EOF
+ 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		  case " $predeps $postdeps " in
+ 		  *" $i "*)
+-		    newdeplibs="$newdeplibs $i"
++		    func_append newdeplibs " $i"
+ 		    i=""
+ 		    ;;
+ 		  esac
+ 		fi
+ 		if test -n "$i" ; then
+-		  eval "libname=\"$libname_spec\""
+-		  eval "deplib_matches=\"$library_names_spec\""
++		  libname=`eval "\\$ECHO \"$libname_spec\""`
++		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ 		  set dummy $deplib_matches; shift
+ 		  deplib_match=$1
+ 		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+-		    newdeplibs="$newdeplibs $i"
++		    func_append newdeplibs " $i"
+ 		  else
+ 		    droppeddeps=yes
+ 		    echo
+@@ -6789,7 +7708,7 @@ EOF
+ 		fi
+ 		;;
+ 	      *)
+-		newdeplibs="$newdeplibs $i"
++		func_append newdeplibs " $i"
+ 		;;
+ 	      esac
+ 	    done
+@@ -6807,18 +7726,18 @@ EOF
+ 		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		    case " $predeps $postdeps " in
+ 		    *" $i "*)
+-		      newdeplibs="$newdeplibs $i"
++		      func_append newdeplibs " $i"
+ 		      i=""
+ 		      ;;
+ 		    esac
+ 		  fi
+ 		  if test -n "$i" ; then
+-		    eval "libname=\"$libname_spec\""
+-		    eval "deplib_matches=\"$library_names_spec\""
++		    libname=`eval "\\$ECHO \"$libname_spec\""`
++		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ 		    set dummy $deplib_matches; shift
+ 		    deplib_match=$1
+ 		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+-		      newdeplibs="$newdeplibs $i"
++		      func_append newdeplibs " $i"
+ 		    else
+ 		      droppeddeps=yes
+ 		      echo
+@@ -6840,7 +7759,7 @@ EOF
+ 		fi
+ 		;;
+ 	      *)
+-		newdeplibs="$newdeplibs $i"
++		func_append newdeplibs " $i"
+ 		;;
+ 	      esac
+ 	    done
+@@ -6857,15 +7776,27 @@ EOF
+ 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		case " $predeps $postdeps " in
+ 		*" $a_deplib "*)
+-		  newdeplibs="$newdeplibs $a_deplib"
++		  func_append newdeplibs " $a_deplib"
+ 		  a_deplib=""
+ 		  ;;
+ 		esac
+ 	      fi
+ 	      if test -n "$a_deplib" ; then
+-		eval "libname=\"$libname_spec\""
++		libname=`eval "\\$ECHO \"$libname_spec\""`
++		if test -n "$file_magic_glob"; then
++		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
++		else
++		  libnameglob=$libname
++		fi
++		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
++		  if test "$want_nocaseglob" = yes; then
++		    shopt -s nocaseglob
++		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
++		    $nocaseglob
++		  else
++		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
++		  fi
+ 		  for potent_lib in $potential_libs; do
+ 		      # Follow soft links.
+ 		      if ls -lLd "$potent_lib" 2>/dev/null |
+@@ -6885,10 +7816,10 @@ EOF
+ 			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ 			esac
+ 		      done
+-		      if eval "$file_magic_cmd \"\$potlib\"" 2>/dev/null |
++		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ 			 $SED -e 10q |
+ 			 $EGREP "$file_magic_regex" > /dev/null; then
+-			newdeplibs="$newdeplibs $a_deplib"
++			func_append newdeplibs " $a_deplib"
+ 			a_deplib=""
+ 			break 2
+ 		      fi
+@@ -6913,7 +7844,7 @@ EOF
+ 	      ;;
+ 	    *)
+ 	      # Add a -L argument.
+-	      newdeplibs="$newdeplibs $a_deplib"
++	      func_append newdeplibs " $a_deplib"
+ 	      ;;
+ 	    esac
+ 	  done # Gone through all deplibs.
+@@ -6929,20 +7860,20 @@ EOF
+ 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		case " $predeps $postdeps " in
+ 		*" $a_deplib "*)
+-		  newdeplibs="$newdeplibs $a_deplib"
++		  func_append newdeplibs " $a_deplib"
+ 		  a_deplib=""
+ 		  ;;
+ 		esac
+ 	      fi
+ 	      if test -n "$a_deplib" ; then
+-		eval "libname=\"$libname_spec\""
++		libname=`eval "\\$ECHO \"$libname_spec\""`
+ 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ 		  for potent_lib in $potential_libs; do
+ 		    potlib="$potent_lib" # see symlink-check above in file_magic test
+ 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ 		       $EGREP "$match_pattern_regex" > /dev/null; then
+-		      newdeplibs="$newdeplibs $a_deplib"
++		      func_append newdeplibs " $a_deplib"
+ 		      a_deplib=""
+ 		      break 2
+ 		    fi
+@@ -6967,7 +7898,7 @@ EOF
+ 	      ;;
+ 	    *)
+ 	      # Add a -L argument.
+-	      newdeplibs="$newdeplibs $a_deplib"
++	      func_append newdeplibs " $a_deplib"
+ 	      ;;
+ 	    esac
+ 	  done # Gone through all deplibs.
+@@ -7071,7 +8002,7 @@ EOF
+ 	*)
+ 	  case " $deplibs " in
+ 	  *" -L$path/$objdir "*)
+-	    new_libs="$new_libs -L$path/$objdir" ;;
++	    func_append new_libs " -L$path/$objdir" ;;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -7081,10 +8012,10 @@ EOF
+ 	-L*)
+ 	  case " $new_libs " in
+ 	  *" $deplib "*) ;;
+-	  *) new_libs="$new_libs $deplib" ;;
++	  *) func_append new_libs " $deplib" ;;
+ 	  esac
+ 	  ;;
+-	*) new_libs="$new_libs $deplib" ;;
++	*) func_append new_libs " $deplib" ;;
+ 	esac
+       done
+       deplibs="$new_libs"
+@@ -7101,10 +8032,12 @@ EOF
+ 	  hardcode_libdirs=
+ 	  dep_rpath=
+ 	  rpath="$finalize_rpath"
+-	  test "$mode" != relink && rpath="$compile_rpath$rpath"
++	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ 	  for libdir in $rpath; do
+ 	    if test -n "$hardcode_libdir_flag_spec"; then
+ 	      if test -n "$hardcode_libdir_separator"; then
++		func_replace_sysroot "$libdir"
++		libdir=$func_replace_sysroot_result
+ 		if test -z "$hardcode_libdirs"; then
+ 		  hardcode_libdirs="$libdir"
+ 		else
+@@ -7113,18 +8046,18 @@ EOF
+ 		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ 		    ;;
+ 		  *)
+-		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ 		    ;;
+ 		  esac
+ 		fi
+ 	      else
+-		eval "flag=\"$hardcode_libdir_flag_spec\""
+-		dep_rpath="$dep_rpath $flag"
++		eval flag=\"$hardcode_libdir_flag_spec\"
++		func_append dep_rpath " $flag"
+ 	      fi
+ 	    elif test -n "$runpath_var"; then
+ 	      case "$perm_rpath " in
+ 	      *" $libdir "*) ;;
+-	      *) perm_rpath="$perm_rpath $libdir" ;;
++	      *) func_apped perm_rpath " $libdir" ;;
+ 	      esac
+ 	    fi
+ 	  done
+@@ -7133,40 +8066,38 @@ EOF
+ 	     test -n "$hardcode_libdirs"; then
+ 	    libdir="$hardcode_libdirs"
+ 	    if test -n "$hardcode_libdir_flag_spec_ld"; then
+-	      eval "dep_rpath=\"$hardcode_libdir_flag_spec_ld\""
++	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ 	    else
+-	      eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
++	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ 	    fi
+ 	  fi
+ 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ 	    # We should set the runpath_var.
+ 	    rpath=
+ 	    for dir in $perm_rpath; do
+-	      rpath="$rpath$dir:"
++	      func_append rpath "$dir:"
+ 	    done
+-	    eval $runpath_var=\$rpath\$$runpath_var
+-	    export $runpath_var
++	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ 	  fi
+ 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ 	fi
+ 
+ 	shlibpath="$finalize_shlibpath"
+-	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
++	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ 	if test -n "$shlibpath"; then
+-	  eval $shlibpath_var=\$shlibpath\$$shlibpath_var
+-	  export $shlibpath_var
++	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ 	fi
+ 
+ 	# Get the real and link names of the library.
+-	eval "shared_ext=\"$shrext_cmds\""
+-	eval "library_names=\"$library_names_spec\""
++	eval shared_ext=\"$shrext_cmds\"
++	eval library_names=\"$library_names_spec\"
+ 	set dummy $library_names
+ 	shift
+ 	realname="$1"
+ 	shift
+ 
+ 	if test -n "$soname_spec"; then
+-	  eval "soname=\"$soname_spec\""
++	  eval soname=\"$soname_spec\"
+ 	else
+ 	  soname="$realname"
+ 	fi
+@@ -7178,7 +8109,7 @@ EOF
+ 	linknames=
+ 	for link
+ 	do
+-	  linknames="$linknames $link"
++	  func_append linknames " $link"
+ 	done
+ 
+ 	# Use standard objects if they are pic
+@@ -7189,7 +8120,7 @@ EOF
+ 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ 	  export_symbols="$output_objdir/$libname.uexp"
+-	  delfiles="$delfiles $export_symbols"
++	  func_append delfiles " $export_symbols"
+ 	fi
+ 
+ 	orig_export_symbols=
+@@ -7220,13 +8151,45 @@ EOF
+ 	    $opt_dry_run || $RM $export_symbols
+ 	    cmds=$export_symbols_cmds
+ 	    save_ifs="$IFS"; IFS='~'
+-	    for cmd in $cmds; do
++	    for cmd1 in $cmds; do
+ 	      IFS="$save_ifs"
+-	      eval "cmd=\"$cmd\""
+-	      func_len " $cmd"
+-	      len=$func_len_result
+-	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
++	      # Take the normal branch if the nm_file_list_spec branch
++	      # doesn't work or if tool conversion is not needed.
++	      case $nm_file_list_spec~$to_tool_file_cmd in
++		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
++		  try_normal_branch=yes
++		  eval cmd=\"$cmd1\"
++		  func_len " $cmd"
++		  len=$func_len_result
++		  ;;
++		*)
++		  try_normal_branch=no
++		  ;;
++	      esac
++	      if test "$try_normal_branch" = yes \
++		 && { test "$len" -lt "$max_cmd_len" \
++		      || test "$max_cmd_len" -le -1; }
++	      then
++		func_show_eval "$cmd" 'exit $?'
++		skipped_export=false
++	      elif test -n "$nm_file_list_spec"; then
++		func_basename "$output"
++		output_la=$func_basename_result
++		save_libobjs=$libobjs
++		save_output=$output
++		output=${output_objdir}/${output_la}.nm
++		func_to_tool_file "$output"
++		libobjs=$nm_file_list_spec$func_to_tool_file_result
++		func_append delfiles " $output"
++		func_verbose "creating $NM input file list: $output"
++		for obj in $save_libobjs; do
++		  func_to_tool_file "$obj"
++		  $ECHO "$func_to_tool_file_result"
++		done > "$output"
++		eval cmd=\"$cmd1\"
+ 		func_show_eval "$cmd" 'exit $?'
++		output=$save_output
++		libobjs=$save_libobjs
+ 		skipped_export=false
+ 	      else
+ 		# The command line is too long to execute in one step.
+@@ -7248,7 +8211,7 @@ EOF
+ 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ 	  tmp_export_symbols="$export_symbols"
+ 	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+-	  $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
++	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ 	fi
+ 
+ 	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+@@ -7260,7 +8223,7 @@ EOF
+ 	  # global variables. join(1) would be nice here, but unfortunately
+ 	  # isn't a blessed tool.
+ 	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+-	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
++	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ 	  export_symbols=$output_objdir/$libname.def
+ 	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ 	fi
+@@ -7270,7 +8233,7 @@ EOF
+ 	  case " $convenience " in
+ 	  *" $test_deplib "*) ;;
+ 	  *)
+-	    tmp_deplibs="$tmp_deplibs $test_deplib"
++	    func_append tmp_deplibs " $test_deplib"
+ 	    ;;
+ 	  esac
+ 	done
+@@ -7286,43 +8249,43 @@ EOF
+ 	  fi
+ 	  if test -n "$whole_archive_flag_spec"; then
+ 	    save_libobjs=$libobjs
+-	    eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
++	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ 	    test "X$libobjs" = "X " && libobjs=
+ 	  else
+ 	    gentop="$output_objdir/${outputname}x"
+-	    generated="$generated $gentop"
++	    func_append generated " $gentop"
+ 
+ 	    func_extract_archives $gentop $convenience
+-	    libobjs="$libobjs $func_extract_archives_result"
++	    func_append libobjs " $func_extract_archives_result"
+ 	    test "X$libobjs" = "X " && libobjs=
+ 	  fi
+ 	fi
+ 
+ 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+-	  eval "flag=\"$thread_safe_flag_spec\""
+-	  linker_flags="$linker_flags $flag"
++	  eval flag=\"$thread_safe_flag_spec\"
++	  func_append linker_flags " $flag"
+ 	fi
+ 
+ 	# Make a backup of the uninstalled library when relinking
+-	if test "$mode" = relink; then
+-	  $opt_dry_run || (cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U) || exit $?
++	if test "$opt_mode" = relink; then
++	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ 	fi
+ 
+ 	# Do each of the archive commands.
+ 	if test "$module" = yes && test -n "$module_cmds" ; then
+ 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+-	    eval "test_cmds=\"$module_expsym_cmds\""
++	    eval test_cmds=\"$module_expsym_cmds\"
+ 	    cmds=$module_expsym_cmds
+ 	  else
+-	    eval "test_cmds=\"$module_cmds\""
++	    eval test_cmds=\"$module_cmds\"
+ 	    cmds=$module_cmds
+ 	  fi
+ 	else
+ 	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+-	    eval "test_cmds=\"$archive_expsym_cmds\""
++	    eval test_cmds=\"$archive_expsym_cmds\"
+ 	    cmds=$archive_expsym_cmds
+ 	  else
+-	    eval "test_cmds=\"$archive_cmds\""
++	    eval test_cmds=\"$archive_cmds\"
+ 	    cmds=$archive_cmds
+ 	  fi
+ 	fi
+@@ -7366,10 +8329,13 @@ EOF
+ 	    echo 'INPUT (' > $output
+ 	    for obj in $save_libobjs
+ 	    do
+-	      $ECHO "$obj" >> $output
++	      func_to_tool_file "$obj"
++	      $ECHO "$func_to_tool_file_result" >> $output
+ 	    done
+ 	    echo ')' >> $output
+-	    delfiles="$delfiles $output"
++	    func_append delfiles " $output"
++	    func_to_tool_file "$output"
++	    output=$func_to_tool_file_result
+ 	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ 	    output=${output_objdir}/${output_la}.lnk
+ 	    func_verbose "creating linker input file list: $output"
+@@ -7383,15 +8349,17 @@ EOF
+ 	    fi
+ 	    for obj
+ 	    do
+-	      $ECHO "$obj" >> $output
++	      func_to_tool_file "$obj"
++	      $ECHO "$func_to_tool_file_result" >> $output
+ 	    done
+-	    delfiles="$delfiles $output"
+-	    output=$firstobj\"$file_list_spec$output\"
++	    func_append delfiles " $output"
++	    func_to_tool_file "$output"
++	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ 	  else
+ 	    if test -n "$save_libobjs"; then
+ 	      func_verbose "creating reloadable object files..."
+ 	      output=$output_objdir/$output_la-${k}.$objext
+-	      eval "test_cmds=\"$reload_cmds\""
++	      eval test_cmds=\"$reload_cmds\"
+ 	      func_len " $test_cmds"
+ 	      len0=$func_len_result
+ 	      len=$len0
+@@ -7411,12 +8379,12 @@ EOF
+ 		  if test "$k" -eq 1 ; then
+ 		    # The first file doesn't have a previous command to add.
+ 		    reload_objs=$objlist
+-		    eval "concat_cmds=\"$reload_cmds\""
++		    eval concat_cmds=\"$reload_cmds\"
+ 		  else
+ 		    # All subsequent reloadable object files will link in
+ 		    # the last one created.
+ 		    reload_objs="$objlist $last_robj"
+-		    eval "concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\""
++		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ 		  fi
+ 		  last_robj=$output_objdir/$output_la-${k}.$objext
+ 		  func_arith $k + 1
+@@ -7433,11 +8401,11 @@ EOF
+ 	      # files will link in the last one created.
+ 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ 	      reload_objs="$objlist $last_robj"
+-	      eval "concat_cmds=\"\${concat_cmds}$reload_cmds\""
++	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ 	      if test -n "$last_robj"; then
+-	        eval "concat_cmds=\"\${concat_cmds}~\$RM $last_robj\""
++	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ 	      fi
+-	      delfiles="$delfiles $output"
++	      func_append delfiles " $output"
+ 
+ 	    else
+ 	      output=
+@@ -7450,9 +8418,9 @@ EOF
+ 	      libobjs=$output
+ 	      # Append the command to create the export file.
+ 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+-	      eval "concat_cmds=\"\$concat_cmds$export_symbols_cmds\""
++	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ 	      if test -n "$last_robj"; then
+-		eval "concat_cmds=\"\$concat_cmds~\$RM $last_robj\""
++		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ 	      fi
+ 	    fi
+ 
+@@ -7471,7 +8439,7 @@ EOF
+ 		lt_exit=$?
+ 
+ 		# Restore the uninstalled library and exit
+-		if test "$mode" = relink; then
++		if test "$opt_mode" = relink; then
+ 		  ( cd "$output_objdir" && \
+ 		    $RM "${realname}T" && \
+ 		    $MV "${realname}U" "$realname" )
+@@ -7492,7 +8460,7 @@ EOF
+ 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ 	      tmp_export_symbols="$export_symbols"
+ 	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+-	      $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
++	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ 	    fi
+ 
+ 	    if test -n "$orig_export_symbols"; then
+@@ -7504,7 +8472,7 @@ EOF
+ 	      # global variables. join(1) would be nice here, but unfortunately
+ 	      # isn't a blessed tool.
+ 	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+-	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
++	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ 	      export_symbols=$output_objdir/$libname.def
+ 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ 	    fi
+@@ -7515,7 +8483,7 @@ EOF
+ 	  output=$save_output
+ 
+ 	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+-	    eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
++	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ 	    test "X$libobjs" = "X " && libobjs=
+ 	  fi
+ 	  # Expand the library linking commands again to reset the
+@@ -7539,23 +8507,23 @@ EOF
+ 
+ 	if test -n "$delfiles"; then
+ 	  # Append the command to remove temporary files to $cmds.
+-	  eval "cmds=\"\$cmds~\$RM $delfiles\""
++	  eval cmds=\"\$cmds~\$RM $delfiles\"
+ 	fi
+ 
+ 	# Add any objects from preloaded convenience libraries
+ 	if test -n "$dlprefiles"; then
+ 	  gentop="$output_objdir/${outputname}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 
+ 	  func_extract_archives $gentop $dlprefiles
+-	  libobjs="$libobjs $func_extract_archives_result"
++	  func_append libobjs " $func_extract_archives_result"
+ 	  test "X$libobjs" = "X " && libobjs=
+ 	fi
+ 
+ 	save_ifs="$IFS"; IFS='~'
+ 	for cmd in $cmds; do
+ 	  IFS="$save_ifs"
+-	  eval "cmd=\"$cmd\""
++	  eval cmd=\"$cmd\"
+ 	  $opt_silent || {
+ 	    func_quote_for_expand "$cmd"
+ 	    eval "func_echo $func_quote_for_expand_result"
+@@ -7564,7 +8532,7 @@ EOF
+ 	    lt_exit=$?
+ 
+ 	    # Restore the uninstalled library and exit
+-	    if test "$mode" = relink; then
++	    if test "$opt_mode" = relink; then
+ 	      ( cd "$output_objdir" && \
+ 	        $RM "${realname}T" && \
+ 		$MV "${realname}U" "$realname" )
+@@ -7576,8 +8544,8 @@ EOF
+ 	IFS="$save_ifs"
+ 
+ 	# Restore the uninstalled library and exit
+-	if test "$mode" = relink; then
+-	  $opt_dry_run || (cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname) || exit $?
++	if test "$opt_mode" = relink; then
++	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+ 
+ 	  if test -n "$convenience"; then
+ 	    if test -z "$whole_archive_flag_spec"; then
+@@ -7656,17 +8624,20 @@ EOF
+ 
+       if test -n "$convenience"; then
+ 	if test -n "$whole_archive_flag_spec"; then
+-	  eval "tmp_whole_archive_flags=\"$whole_archive_flag_spec\""
++	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ 	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ 	else
+ 	  gentop="$output_objdir/${obj}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 
+ 	  func_extract_archives $gentop $convenience
+ 	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+ 	fi
+       fi
+ 
++      # If we're not building shared, we need to use non_pic_objs
++      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
++
+       # Create the old-style object.
+       reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+ 
+@@ -7690,7 +8661,7 @@ EOF
+ 	# Create an invalid libtool object if no PIC, so that we don't
+ 	# accidentally link it into a program.
+ 	# $show "echo timestamp > $libobj"
+-	# $opt_dry_run || echo timestamp > $libobj || exit $?
++	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ 	exit $EXIT_SUCCESS
+       fi
+ 
+@@ -7740,8 +8711,8 @@ EOF
+ 	if test "$tagname" = CXX ; then
+ 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 	    10.[0123])
+-	      compile_command="$compile_command ${wl}-bind_at_load"
+-	      finalize_command="$finalize_command ${wl}-bind_at_load"
++	      func_append compile_command " ${wl}-bind_at_load"
++	      func_append finalize_command " ${wl}-bind_at_load"
+ 	    ;;
+ 	  esac
+ 	fi
+@@ -7761,7 +8732,7 @@ EOF
+ 	*)
+ 	  case " $compile_deplibs " in
+ 	  *" -L$path/$objdir "*)
+-	    new_libs="$new_libs -L$path/$objdir" ;;
++	    func_append new_libs " -L$path/$objdir" ;;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -7771,17 +8742,17 @@ EOF
+ 	-L*)
+ 	  case " $new_libs " in
+ 	  *" $deplib "*) ;;
+-	  *) new_libs="$new_libs $deplib" ;;
++	  *) func_append new_libs " $deplib" ;;
+ 	  esac
+ 	  ;;
+-	*) new_libs="$new_libs $deplib" ;;
++	*) func_append new_libs " $deplib" ;;
+ 	esac
+       done
+       compile_deplibs="$new_libs"
+ 
+ 
+-      compile_command="$compile_command $compile_deplibs"
+-      finalize_command="$finalize_command $finalize_deplibs"
++      func_append compile_command " $compile_deplibs"
++      func_append finalize_command " $finalize_deplibs"
+ 
+       if test -n "$rpath$xrpath"; then
+ 	# If the user specified any rpath flags, then add them.
+@@ -7789,7 +8760,7 @@ EOF
+ 	  # This is the magic to use -rpath.
+ 	  case "$finalize_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
++	  *) func_append finalize_rpath " $libdir" ;;
+ 	  esac
+ 	done
+       fi
+@@ -7808,18 +8779,18 @@ EOF
+ 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ 		;;
+ 	      *)
+-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ 		;;
+ 	      esac
+ 	    fi
+ 	  else
+-	    eval "flag=\"$hardcode_libdir_flag_spec\""
+-	    rpath="$rpath $flag"
++	    eval flag=\"$hardcode_libdir_flag_spec\"
++	    func_append rpath " $flag"
+ 	  fi
+ 	elif test -n "$runpath_var"; then
+ 	  case "$perm_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) perm_rpath="$perm_rpath $libdir" ;;
++	  *) func_append perm_rpath " $libdir" ;;
+ 	  esac
+ 	fi
+ 	case $host in
+@@ -7828,12 +8799,12 @@ EOF
+ 	  case :$dllsearchpath: in
+ 	  *":$libdir:"*) ;;
+ 	  ::) dllsearchpath=$libdir;;
+-	  *) dllsearchpath="$dllsearchpath:$libdir";;
++	  *) func_append dllsearchpath ":$libdir";;
+ 	  esac
+ 	  case :$dllsearchpath: in
+ 	  *":$testbindir:"*) ;;
+ 	  ::) dllsearchpath=$testbindir;;
+-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
++	  *) func_append dllsearchpath ":$testbindir";;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -7842,7 +8813,7 @@ EOF
+       if test -n "$hardcode_libdir_separator" &&
+ 	 test -n "$hardcode_libdirs"; then
+ 	libdir="$hardcode_libdirs"
+-	eval "rpath=\" $hardcode_libdir_flag_spec\""
++	eval rpath=\" $hardcode_libdir_flag_spec\"
+       fi
+       compile_rpath="$rpath"
+ 
+@@ -7859,18 +8830,18 @@ EOF
+ 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ 		;;
+ 	      *)
+-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ 		;;
+ 	      esac
+ 	    fi
+ 	  else
+-	    eval "flag=\"$hardcode_libdir_flag_spec\""
+-	    rpath="$rpath $flag"
++	    eval flag=\"$hardcode_libdir_flag_spec\"
++	    func_append rpath " $flag"
+ 	  fi
+ 	elif test -n "$runpath_var"; then
+ 	  case "$finalize_perm_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
++	  *) func_append finalize_perm_rpath " $libdir" ;;
+ 	  esac
+ 	fi
+       done
+@@ -7878,7 +8849,7 @@ EOF
+       if test -n "$hardcode_libdir_separator" &&
+ 	 test -n "$hardcode_libdirs"; then
+ 	libdir="$hardcode_libdirs"
+-	eval "rpath=\" $hardcode_libdir_flag_spec\""
++	eval rpath=\" $hardcode_libdir_flag_spec\"
+       fi
+       finalize_rpath="$rpath"
+ 
+@@ -7921,6 +8892,12 @@ EOF
+ 	exit_status=0
+ 	func_show_eval "$link_command" 'exit_status=$?'
+ 
++	if test -n "$postlink_cmds"; then
++	  func_to_tool_file "$output"
++	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++	  func_execute_cmds "$postlink_cmds" 'exit $?'
++	fi
++
+ 	# Delete the generated files.
+ 	if test -f "$output_objdir/${outputname}S.${objext}"; then
+ 	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+@@ -7943,7 +8920,7 @@ EOF
+ 	  # We should set the runpath_var.
+ 	  rpath=
+ 	  for dir in $perm_rpath; do
+-	    rpath="$rpath$dir:"
++	    func_append rpath "$dir:"
+ 	  done
+ 	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ 	fi
+@@ -7951,7 +8928,7 @@ EOF
+ 	  # We should set the runpath_var.
+ 	  rpath=
+ 	  for dir in $finalize_perm_rpath; do
+-	    rpath="$rpath$dir:"
++	    func_append rpath "$dir:"
+ 	  done
+ 	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ 	fi
+@@ -7966,6 +8943,13 @@ EOF
+ 	$opt_dry_run || $RM $output
+ 	# Link the executable and exit
+ 	func_show_eval "$link_command" 'exit $?'
++
++	if test -n "$postlink_cmds"; then
++	  func_to_tool_file "$output"
++	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++	  func_execute_cmds "$postlink_cmds" 'exit $?'
++	fi
++
+ 	exit $EXIT_SUCCESS
+       fi
+ 
+@@ -7999,6 +8983,12 @@ EOF
+ 
+       func_show_eval "$link_command" 'exit $?'
+ 
++      if test -n "$postlink_cmds"; then
++	func_to_tool_file "$output_objdir/$outputname"
++	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++	func_execute_cmds "$postlink_cmds" 'exit $?'
++      fi
++
+       # Now create the wrapper script.
+       func_verbose "creating $output"
+ 
+@@ -8096,7 +9086,7 @@ EOF
+ 	else
+ 	  oldobjs="$old_deplibs $non_pic_objects"
+ 	  if test "$preload" = yes && test -f "$symfileobj"; then
+-	    oldobjs="$oldobjs $symfileobj"
++	    func_append oldobjs " $symfileobj"
+ 	  fi
+ 	fi
+ 	addlibs="$old_convenience"
+@@ -8104,10 +9094,10 @@ EOF
+ 
+       if test -n "$addlibs"; then
+ 	gentop="$output_objdir/${outputname}x"
+-	generated="$generated $gentop"
++	func_append generated " $gentop"
+ 
+ 	func_extract_archives $gentop $addlibs
+-	oldobjs="$oldobjs $func_extract_archives_result"
++	func_append oldobjs " $func_extract_archives_result"
+       fi
+ 
+       # Do each command in the archive commands.
+@@ -8118,10 +9108,10 @@ EOF
+ 	# Add any objects from preloaded convenience libraries
+ 	if test -n "$dlprefiles"; then
+ 	  gentop="$output_objdir/${outputname}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 
+ 	  func_extract_archives $gentop $dlprefiles
+-	  oldobjs="$oldobjs $func_extract_archives_result"
++	  func_append oldobjs " $func_extract_archives_result"
+ 	fi
+ 
+ 	# POSIX demands no paths to be encoded in archives.  We have
+@@ -8139,7 +9129,7 @@ EOF
+ 	else
+ 	  echo "copying selected object files to avoid basename conflicts..."
+ 	  gentop="$output_objdir/${outputname}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 	  func_mkdir_p "$gentop"
+ 	  save_oldobjs=$oldobjs
+ 	  oldobjs=
+@@ -8163,18 +9153,28 @@ EOF
+ 		esac
+ 	      done
+ 	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+-	      oldobjs="$oldobjs $gentop/$newobj"
++	      func_append oldobjs " $gentop/$newobj"
+ 	      ;;
+-	    *) oldobjs="$oldobjs $obj" ;;
++	    *) func_append oldobjs " $obj" ;;
+ 	    esac
+ 	  done
+ 	fi
+-	eval "cmds=\"$old_archive_cmds\""
++	eval cmds=\"$old_archive_cmds\"
+ 
+ 	func_len " $cmds"
+ 	len=$func_len_result
+ 	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ 	  cmds=$old_archive_cmds
++	elif test -n "$archiver_list_spec"; then
++	  func_verbose "using command file archive linking..."
++	  for obj in $oldobjs
++	  do
++	    func_to_tool_file "$obj"
++	    $ECHO "$func_to_tool_file_result"
++	  done > $output_objdir/$libname.libcmd
++	  func_to_tool_file "$output_objdir/$libname.libcmd"
++	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
++	  cmds=$old_archive_cmds
+ 	else
+ 	  # the command line is too long to link in one step, link in parts
+ 	  func_verbose "using piecewise archive linking..."
+@@ -8189,7 +9189,7 @@ EOF
+ 	  do
+ 	    last_oldobj=$obj
+ 	  done
+-	  eval "test_cmds=\"$old_archive_cmds\""
++	  eval test_cmds=\"$old_archive_cmds\"
+ 	  func_len " $test_cmds"
+ 	  len0=$func_len_result
+ 	  len=$len0
+@@ -8208,7 +9208,7 @@ EOF
+ 		RANLIB=$save_RANLIB
+ 	      fi
+ 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+-	      eval "concat_cmds=\"\${concat_cmds}$old_archive_cmds\""
++	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ 	      objlist=
+ 	      len=$len0
+ 	    fi
+@@ -8216,9 +9216,9 @@ EOF
+ 	  RANLIB=$save_RANLIB
+ 	  oldobjs=$objlist
+ 	  if test "X$oldobjs" = "X" ; then
+-	    eval "cmds=\"\$concat_cmds\""
++	    eval cmds=\"\$concat_cmds\"
+ 	  else
+-	    eval "cmds=\"\$concat_cmds~\$old_archive_cmds\""
++	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ 	  fi
+ 	fi
+       fi
+@@ -8268,12 +9268,23 @@ EOF
+ 	      *.la)
+ 		func_basename "$deplib"
+ 		name="$func_basename_result"
+-		libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++		func_resolve_sysroot "$deplib"
++		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ 		test -z "$libdir" && \
+ 		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+-		newdependency_libs="$newdependency_libs $libdir/$name"
++		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
++		;;
++	      -L*)
++		func_stripname -L '' "$deplib"
++		func_replace_sysroot "$func_stripname_result"
++		func_append newdependency_libs " -L$func_replace_sysroot_result"
+ 		;;
+-	      *) newdependency_libs="$newdependency_libs $deplib" ;;
++	      -R*)
++		func_stripname -R '' "$deplib"
++		func_replace_sysroot "$func_stripname_result"
++		func_append newdependency_libs " -R$func_replace_sysroot_result"
++		;;
++	      *) func_append newdependency_libs " $deplib" ;;
+ 	      esac
+ 	    done
+ 	    dependency_libs="$newdependency_libs"
+@@ -8284,12 +9295,14 @@ EOF
+ 	      *.la)
+ 	        func_basename "$lib"
+ 		name="$func_basename_result"
+-		libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++		func_resolve_sysroot "$lib"
++		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
++
+ 		test -z "$libdir" && \
+ 		  func_fatal_error "\`$lib' is not a valid libtool archive"
+-		newdlfiles="$newdlfiles $libdir/$name"
++		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ 		;;
+-	      *) newdlfiles="$newdlfiles $lib" ;;
++	      *) func_append newdlfiles " $lib" ;;
+ 	      esac
+ 	    done
+ 	    dlfiles="$newdlfiles"
+@@ -8303,10 +9316,11 @@ EOF
+ 		# the library:
+ 		func_basename "$lib"
+ 		name="$func_basename_result"
+-		libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++		func_resolve_sysroot "$lib"
++		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ 		test -z "$libdir" && \
+ 		  func_fatal_error "\`$lib' is not a valid libtool archive"
+-		newdlprefiles="$newdlprefiles $libdir/$name"
++		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ 		;;
+ 	      esac
+ 	    done
+@@ -8318,7 +9332,7 @@ EOF
+ 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ 		*) abs=`pwd`"/$lib" ;;
+ 	      esac
+-	      newdlfiles="$newdlfiles $abs"
++	      func_append newdlfiles " $abs"
+ 	    done
+ 	    dlfiles="$newdlfiles"
+ 	    newdlprefiles=
+@@ -8327,7 +9341,7 @@ EOF
+ 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ 		*) abs=`pwd`"/$lib" ;;
+ 	      esac
+-	      newdlprefiles="$newdlprefiles $abs"
++	      func_append newdlprefiles " $abs"
+ 	    done
+ 	    dlprefiles="$newdlprefiles"
+ 	  fi
+@@ -8412,7 +9426,7 @@ relink_command=\"$relink_command\""
+     exit $EXIT_SUCCESS
+ }
+ 
+-{ test "$mode" = link || test "$mode" = relink; } &&
++{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+     func_mode_link ${1+"$@"}
+ 
+ 
+@@ -8432,9 +9446,9 @@ func_mode_uninstall ()
+     for arg
+     do
+       case $arg in
+-      -f) RM="$RM $arg"; rmforce=yes ;;
+-      -*) RM="$RM $arg" ;;
+-      *) files="$files $arg" ;;
++      -f) func_append RM " $arg"; rmforce=yes ;;
++      -*) func_append RM " $arg" ;;
++      *) func_append files " $arg" ;;
+       esac
+     done
+ 
+@@ -8443,24 +9457,23 @@ func_mode_uninstall ()
+ 
+     rmdirs=
+ 
+-    origobjdir="$objdir"
+     for file in $files; do
+       func_dirname "$file" "" "."
+       dir="$func_dirname_result"
+       if test "X$dir" = X.; then
+-	objdir="$origobjdir"
++	odir="$objdir"
+       else
+-	objdir="$dir/$origobjdir"
++	odir="$dir/$objdir"
+       fi
+       func_basename "$file"
+       name="$func_basename_result"
+-      test "$mode" = uninstall && objdir="$dir"
++      test "$opt_mode" = uninstall && odir="$dir"
+ 
+-      # Remember objdir for removal later, being careful to avoid duplicates
+-      if test "$mode" = clean; then
++      # Remember odir for removal later, being careful to avoid duplicates
++      if test "$opt_mode" = clean; then
+ 	case " $rmdirs " in
+-	  *" $objdir "*) ;;
+-	  *) rmdirs="$rmdirs $objdir" ;;
++	  *" $odir "*) ;;
++	  *) func_append rmdirs " $odir" ;;
+ 	esac
+       fi
+ 
+@@ -8486,18 +9499,17 @@ func_mode_uninstall ()
+ 
+ 	  # Delete the libtool libraries and symlinks.
+ 	  for n in $library_names; do
+-	    rmfiles="$rmfiles $objdir/$n"
++	    func_append rmfiles " $odir/$n"
+ 	  done
+-	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
++	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+ 
+-	  case "$mode" in
++	  case "$opt_mode" in
+ 	  clean)
+-	    case "  $library_names " in
+-	    # "  " in the beginning catches empty $dlname
++	    case " $library_names " in
+ 	    *" $dlname "*) ;;
+-	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
++	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ 	    esac
+-	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
++	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ 	    ;;
+ 	  uninstall)
+ 	    if test -n "$library_names"; then
+@@ -8525,19 +9537,19 @@ func_mode_uninstall ()
+ 	  # Add PIC object to the list of files to remove.
+ 	  if test -n "$pic_object" &&
+ 	     test "$pic_object" != none; then
+-	    rmfiles="$rmfiles $dir/$pic_object"
++	    func_append rmfiles " $dir/$pic_object"
+ 	  fi
+ 
+ 	  # Add non-PIC object to the list of files to remove.
+ 	  if test -n "$non_pic_object" &&
+ 	     test "$non_pic_object" != none; then
+-	    rmfiles="$rmfiles $dir/$non_pic_object"
++	    func_append rmfiles " $dir/$non_pic_object"
+ 	  fi
+ 	fi
+ 	;;
+ 
+       *)
+-	if test "$mode" = clean ; then
++	if test "$opt_mode" = clean ; then
+ 	  noexename=$name
+ 	  case $file in
+ 	  *.exe)
+@@ -8547,7 +9559,7 @@ func_mode_uninstall ()
+ 	    noexename=$func_stripname_result
+ 	    # $file with .exe has already been added to rmfiles,
+ 	    # add $file without .exe
+-	    rmfiles="$rmfiles $file"
++	    func_append rmfiles " $file"
+ 	    ;;
+ 	  esac
+ 	  # Do a test to see if this is a libtool program.
+@@ -8556,7 +9568,7 @@ func_mode_uninstall ()
+ 	      func_ltwrapper_scriptname "$file"
+ 	      relink_command=
+ 	      func_source $func_ltwrapper_scriptname_result
+-	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
++	      func_append rmfiles " $func_ltwrapper_scriptname_result"
+ 	    else
+ 	      relink_command=
+ 	      func_source $dir/$noexename
+@@ -8564,12 +9576,12 @@ func_mode_uninstall ()
+ 
+ 	    # note $name still contains .exe if it was in $file originally
+ 	    # as does the version of $file that was added into $rmfiles
+-	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
++	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ 	    if test "$fast_install" = yes && test -n "$relink_command"; then
+-	      rmfiles="$rmfiles $objdir/lt-$name"
++	      func_append rmfiles " $odir/lt-$name"
+ 	    fi
+ 	    if test "X$noexename" != "X$name" ; then
+-	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
++	      func_append rmfiles " $odir/lt-${noexename}.c"
+ 	    fi
+ 	  fi
+ 	fi
+@@ -8577,7 +9589,6 @@ func_mode_uninstall ()
+       esac
+       func_show_eval "$RM $rmfiles" 'exit_status=1'
+     done
+-    objdir="$origobjdir"
+ 
+     # Try to remove the ${objdir}s in the directories where we deleted files
+     for dir in $rmdirs; do
+@@ -8589,16 +9600,16 @@ func_mode_uninstall ()
+     exit $exit_status
+ }
+ 
+-{ test "$mode" = uninstall || test "$mode" = clean; } &&
++{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+     func_mode_uninstall ${1+"$@"}
+ 
+-test -z "$mode" && {
++test -z "$opt_mode" && {
+   help="$generic_help"
+   func_fatal_help "you must specify a MODE"
+ }
+ 
+ test -z "$exec_cmd" && \
+-  func_fatal_help "invalid operation mode \`$mode'"
++  func_fatal_help "invalid operation mode \`$opt_mode'"
+ 
+ if test -n "$exec_cmd"; then
+   eval exec "$exec_cmd"
+diff --git a/ltoptions.m4 b/ltoptions.m4
+index 5ef12ced2a..17cfd51c0b 100644
+--- a/ltoptions.m4
++++ b/ltoptions.m4
+@@ -8,7 +8,7 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ 
+-# serial 6 ltoptions.m4
++# serial 7 ltoptions.m4
+ 
+ # This is to help aclocal find these macros, as it can't see m4_define.
+ AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+diff --git a/ltversion.m4 b/ltversion.m4
+index bf87f77132..9c7b5d4118 100644
+--- a/ltversion.m4
++++ b/ltversion.m4
+@@ -7,17 +7,17 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ 
+-# Generated from ltversion.in.
++# @configure_input@
+ 
+-# serial 3134 ltversion.m4
++# serial 3293 ltversion.m4
+ # This file is part of GNU Libtool
+ 
+-m4_define([LT_PACKAGE_VERSION], [2.2.7a])
+-m4_define([LT_PACKAGE_REVISION], [1.3134])
++m4_define([LT_PACKAGE_VERSION], [2.4])
++m4_define([LT_PACKAGE_REVISION], [1.3293])
+ 
+ AC_DEFUN([LTVERSION_VERSION],
+-[macro_version='2.2.7a'
+-macro_revision='1.3134'
++[macro_version='2.4'
++macro_revision='1.3293'
+ _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+ _LT_DECL(, macro_revision, 0)
+ ])
+diff --git a/lt~obsolete.m4 b/lt~obsolete.m4
+index bf92b5e079..c573da90c5 100644
+--- a/lt~obsolete.m4
++++ b/lt~obsolete.m4
+@@ -7,7 +7,7 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ 
+-# serial 4 lt~obsolete.m4
++# serial 5 lt~obsolete.m4
+ 
+ # These exist entirely to fool aclocal when bootstrapping libtool.
+ #
+diff --git a/opcodes/configure b/opcodes/configure
+index 0b352a454d..7eaea7db73 100755
+--- a/opcodes/configure
++++ b/opcodes/configure
+@@ -650,6 +650,9 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
++ac_ct_AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -763,6 +766,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_targets
+ enable_werror
+@@ -1423,6 +1427,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+ 
+ Some influential environment variables:
+   CC          C compiler command
+@@ -5115,8 +5121,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -5156,7 +5162,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5842,8 +5848,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -5892,6 +5898,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5908,6 +5988,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6076,7 +6161,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -6230,6 +6316,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6245,9 +6346,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6263,7 +6517,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6283,11 +6537,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6303,7 +6561,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6322,6 +6580,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6333,16 +6595,72 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
+ 
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
+ 
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
+ 
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
+ 
+ 
+ 
+@@ -6684,8 +7002,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6721,6 +7039,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -6762,6 +7081,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6773,7 +7104,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -6799,8 +7130,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6810,8 +7141,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -6848,6 +7179,16 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
+ 
+ 
+ 
+@@ -6869,6 +7210,45 @@ fi
+ 
+ 
+ 
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
++
++
++
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+   enableval=$enable_libtool_lock;
+@@ -7075,6 +7455,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -7638,6 +8135,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7803,7 +8302,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -7892,7 +8392,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8190,8 +8690,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8357,6 +8855,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8419,7 +8923,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -8476,13 +8980,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8543,6 +9051,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8893,7 +9406,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8992,12 +9506,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -9011,8 +9525,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -9030,8 +9544,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9077,8 +9591,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9208,7 +9722,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9221,22 +9741,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9248,7 +9775,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9261,22 +9794,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9321,20 +9861,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9395,7 +9978,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9403,7 +9986,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9419,7 +10002,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -9443,10 +10026,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -9525,23 +10108,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9626,7 +10222,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -9645,9 +10241,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -10223,8 +10819,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10257,13 +10854,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10355,7 +11010,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -11195,10 +11850,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11301,10 +11956,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -12543,7 +13198,7 @@ if test "$enable_shared" = "yes"; then
+ # since libbfd may not pull in the entirety of libiberty.
+   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+   if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+   fi
+ 
+   case "${host}" in
+@@ -13518,13 +14173,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -13539,14 +14201,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -13579,12 +14244,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -13639,8 +14304,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -13650,12 +14320,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -13671,7 +14343,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -13707,6 +14378,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -14463,7 +15135,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -14566,19 +15239,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -14608,6 +15304,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -14617,6 +15319,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -14731,12 +15436,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -14823,9 +15528,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -14841,6 +15543,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -14873,210 +15578,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+diff --git a/opcodes/configure.ac b/opcodes/configure.ac
+index b9f5eb8a4f..a31b66a2f0 100644
+--- a/opcodes/configure.ac
++++ b/opcodes/configure.ac
+@@ -167,7 +167,7 @@ changequote(,)dnl
+   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+ changequote([,])dnl
+   if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+   fi
+ 
+   case "${host}" in
+diff --git a/zlib/configure b/zlib/configure
+index bed9e3ea2b..caef0b674e 100755
+--- a/zlib/configure
++++ b/zlib/configure
+@@ -614,8 +614,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -737,6 +740,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_host_shared
+ '
+@@ -1385,6 +1389,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+ 
+ Some influential environment variables:
+   CC          C compiler command
+@@ -3910,8 +3916,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -3951,7 +3957,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -4767,8 +4773,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -4817,6 +4823,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -4833,6 +4913,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -5001,7 +5086,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -5155,6 +5241,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -5170,9 +5271,163 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -5188,7 +5443,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -5208,11 +5463,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -5228,7 +5487,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -5247,6 +5506,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -5258,16 +5521,72 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
+ 
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
+ 
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
+ 
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
+ 
+ 
+ 
+@@ -5609,8 +5928,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -5646,6 +5965,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -5687,6 +6007,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -5698,7 +6030,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -5724,8 +6056,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -5735,8 +6067,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -5773,6 +6105,19 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
+ 
+ 
+ 
+@@ -5793,6 +6138,41 @@ fi
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
++
+ 
+ 
+ # Check whether --enable-libtool-lock was given.
+@@ -6004,6 +6384,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -6570,6 +7067,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7033,7 +7532,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -7122,7 +7622,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -7420,8 +7920,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -7587,6 +8085,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -7649,7 +8153,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -7706,13 +8210,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -7773,6 +8281,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8123,7 +8636,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8222,12 +8736,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -8241,8 +8755,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -8260,8 +8774,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -8307,8 +8821,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -8438,7 +8952,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        if test x$gcc_no_link = xyes; then
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test x$gcc_no_link = xyes; then
+   as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -8454,22 +8974,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -8481,7 +9008,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 if test x$gcc_no_link = xyes; then
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test x$gcc_no_link = xyes; then
+   as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -8497,22 +9030,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -8557,20 +9097,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -8631,7 +9214,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -8639,7 +9222,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -8655,7 +9238,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -8679,10 +9262,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -8761,26 +9344,39 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        if test x$gcc_no_link = xyes; then
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   if test x$gcc_no_link = xyes; then
+   as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -8865,7 +9461,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -8884,9 +9480,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -9462,8 +10058,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -9496,13 +10093,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -9594,7 +10249,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -10452,10 +11107,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -10558,10 +11213,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11992,13 +12647,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -12013,14 +12675,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -12053,12 +12718,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -12113,8 +12778,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -12124,12 +12794,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -12145,7 +12817,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -12181,6 +12852,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -12770,7 +13442,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -12873,19 +13546,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -12915,6 +13611,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -12924,6 +13626,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -13038,12 +13743,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -13130,9 +13835,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -13148,6 +13850,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -13180,210 +13885,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-Add-the-armv5e-architecture-to-binutils.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-Add-the-armv5e-architecture-to-binutils.patch
new file mode 100644
index 0000000..449225a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-Add-the-armv5e-architecture-to-binutils.patch
@@ -0,0 +1,35 @@
+From 9c313e8a15a7e7c5c0f2906e3218ed211563ac2a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:37:10 +0000
+Subject: [PATCH 08/15] Add the armv5e architecture to binutils
+
+Binutils has a comment that indicates it is supposed to match gcc for
+all of the support "-march=" settings, but it was lacking the armv5e setting.
+This was a simple way to add it, as thumb instructions shouldn't be generated
+by the compiler anyway.
+
+Upstream-Status: Denied
+Upstream maintainer indicated that we should not be using armv5e, even
+though it is a legal archicture defined by our gcc.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gas/config/tc-arm.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
+index 60bda51070..eb6d0afd6e 100644
+--- a/gas/config/tc-arm.c
++++ b/gas/config/tc-arm.c
+@@ -25633,6 +25633,7 @@ static const struct arm_arch_option_table arm_archs[] =
+   ARM_ARCH_OPT ("armv4t",	ARM_ARCH_V4T,	 FPU_ARCH_FPA),
+   ARM_ARCH_OPT ("armv4txm",	ARM_ARCH_V4TxM,	 FPU_ARCH_FPA),
+   ARM_ARCH_OPT ("armv5",	ARM_ARCH_V5,	 FPU_ARCH_VFP),
++  ARM_ARCH_OPT ("armv5e",	ARM_ARCH_V5TE,	 FPU_ARCH_VFP),
+   ARM_ARCH_OPT ("armv5t",	ARM_ARCH_V5T,	 FPU_ARCH_VFP),
+   ARM_ARCH_OPT ("armv5txm",	ARM_ARCH_V5TxM,	 FPU_ARCH_VFP),
+   ARM_ARCH_OPT ("armv5te",	ARM_ARCH_V5TE,	 FPU_ARCH_VFP),
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
deleted file mode 100644
index af524ce..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From b2d277937d11f1ce1d581f48ff74a25822a052da Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 2 Mar 2015 01:39:01 +0000
-Subject: [PATCH 08/13] don't let the distro compiler point to the wrong
- installation location
-
-Thanks to RP for helping find the source code causing the issue.
-
-2010/08/13
-Nitin A Kamble <nitin.a.kamble@intel.com>
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- libiberty/Makefile.in | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
-index c7a4568..f766b72 100644
---- a/libiberty/Makefile.in
-+++ b/libiberty/Makefile.in
-@@ -364,7 +364,8 @@ install-strip: install
- # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
- # default multilib, so we have to take CFLAGS into account as well,
- # since it will be passed the multilib flags.
--MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
-+#MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
-+MULTIOSDIR = ""
- install_to_libdir: all
- 	if test -n "${target_header_dir}"; then \
- 		${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
new file mode 100644
index 0000000..1c40593
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
@@ -0,0 +1,35 @@
+From 2be9b44a4a308e3ea42a027c4c3211170f10c9c0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:39:01 +0000
+Subject: [PATCH 09/15] don't let the distro compiler point to the wrong
+ installation location
+
+Thanks to RP for helping find the source code causing the issue.
+
+2010/08/13
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libiberty/Makefile.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
+index 0ff9e45e45..42c32642b2 100644
+--- a/libiberty/Makefile.in
++++ b/libiberty/Makefile.in
+@@ -366,7 +366,8 @@ install-strip: install
+ # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
+ # default multilib, so we have to take CFLAGS into account as well,
+ # since it will be passed the multilib flags.
+-MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
++#MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
++MULTIOSDIR = ""
+ install_to_libdir: all
+ 	if test -n "${target_header_dir}"; then \
+ 		${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch
deleted file mode 100644
index 3c83e69..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch
+++ /dev/null
@@ -1,273 +0,0 @@
-From 7ab8e318659eb5d9adc758c78d084a95560b93fd Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 15 Jan 2016 06:31:09 +0000
-Subject: [PATCH 09/13] warn for uses of system directories when cross linking
-
-2008-07-02  Joseph Myers  <joseph@codesourcery.com>
-
-    ld/
-    * ld.h (args_type): Add error_poison_system_directories.
-    * ld.texinfo (--error-poison-system-directories): Document.
-    * ldfile.c (ldfile_add_library_path): Check
-    command_line.error_poison_system_directories.
-    * ldmain.c (main): Initialize
-    command_line.error_poison_system_directories.
-    * lexsup.c (enum option_values): Add
-    OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
-    (ld_options): Add --error-poison-system-directories.
-    (parse_args): Handle new option.
-
-2007-06-13  Joseph Myers  <joseph@codesourcery.com>
-
-    ld/
-    * config.in: Regenerate.
-    * ld.h (args_type): Add poison_system_directories.
-    * ld.texinfo (--no-poison-system-directories): Document.
-    * ldfile.c (ldfile_add_library_path): Check
-    command_line.poison_system_directories.
-    * ldmain.c (main): Initialize
-    command_line.poison_system_directories.
-    * lexsup.c (enum option_values): Add
-    OPTION_NO_POISON_SYSTEM_DIRECTORIES.
-    (ld_options): Add --no-poison-system-directories.
-    (parse_args): Handle new option.
-
-2007-04-20  Joseph Myers  <joseph@codesourcery.com>
-
-    Merge from Sourcery G++ binutils 2.17:
-
-    2007-03-20  Joseph Myers  <joseph@codesourcery.com>
-    Based on patch by Mark Hatle <mark.hatle@windriver.com>.
-    ld/
-    * configure.in (--enable-poison-system-directories): New option.
-    * configure, config.in: Regenerate.
-    * ldfile.c (ldfile_add_library_path): If
-    ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
-    /usr/lib, /usr/local/lib or /usr/X11R6/lib.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- ld/config.in    |  3 +++
- ld/configure    | 16 ++++++++++++++++
- ld/configure.ac | 10 ++++++++++
- ld/ld.h         |  8 ++++++++
- ld/ld.texinfo   | 12 ++++++++++++
- ld/ldfile.c     | 17 +++++++++++++++++
- ld/ldlex.h      |  2 ++
- ld/ldmain.c     |  2 ++
- ld/lexsup.c     | 16 ++++++++++++++++
- 9 files changed, 86 insertions(+)
-
-diff --git a/ld/config.in b/ld/config.in
-index 2c6d698..d3cb7e8 100644
---- a/ld/config.in
-+++ b/ld/config.in
-@@ -17,6 +17,9 @@
-    language is requested. */
- #undef ENABLE_NLS
- 
-+/* Define to warn for use of native system library directories */
-+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
-+
- /* Additional extension a shared object might have. */
- #undef EXTRA_SHLIB_EXTENSION
- 
-diff --git a/ld/configure b/ld/configure
-index 3df1149..0601c98 100755
---- a/ld/configure
-+++ b/ld/configure
-@@ -792,6 +792,7 @@ with_lib_path
- enable_targets
- enable_64_bit_bfd
- with_sysroot
-+enable_poison_system_directories
- enable_gold
- enable_got
- enable_compressed_debug_sections
-@@ -1449,6 +1450,8 @@ Optional Features:
-   --disable-largefile     omit support for large files
-   --enable-targets        alternative target configurations
-   --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)
-+  --enable-poison-system-directories
-+                          warn for use of native system library directories
-   --enable-gold[=ARG]     build gold [ARG={default,yes,no}]
-   --enable-got=<type>     GOT handling scheme (target, single, negative,
-                           multigot)
-@@ -16313,6 +16316,19 @@ fi
- 
- 
- 
-+# Check whether --enable-poison-system-directories was given.
-+if test "${enable_poison_system_directories+set}" = set; then :
-+  enableval=$enable_poison_system_directories;
-+else
-+  enable_poison_system_directories=no
-+fi
-+
-+if test "x${enable_poison_system_directories}" = "xyes"; then
-+
-+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
-+
-+fi
-+
- # Check whether --enable-gold was given.
- if test "${enable_gold+set}" = set; then :
-   enableval=$enable_gold; case "${enableval}" in
-diff --git a/ld/configure.ac b/ld/configure.ac
-index d17281f..9fb3db9 100644
---- a/ld/configure.ac
-+++ b/ld/configure.ac
-@@ -95,6 +95,16 @@ AC_SUBST(use_sysroot)
- AC_SUBST(TARGET_SYSTEM_ROOT)
- AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
- 
-+AC_ARG_ENABLE([poison-system-directories],
-+         AS_HELP_STRING([--enable-poison-system-directories],
-+                [warn for use of native system library directories]),,
-+         [enable_poison_system_directories=no])
-+if test "x${enable_poison_system_directories}" = "xyes"; then
-+  AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
-+       [1],
-+       [Define to warn for use of native system library directories])
-+fi
-+
- dnl Use --enable-gold to decide if this linker should be the default.
- dnl "install_as_default" is set to false if gold is the default linker.
- dnl "installed_linker" is the installed BFD linker name.
-diff --git a/ld/ld.h b/ld/ld.h
-index 85a48ad..a8fdddf 100644
---- a/ld/ld.h
-+++ b/ld/ld.h
-@@ -169,6 +169,14 @@ typedef struct
-   /* If set, display the target memory usage (per memory region).  */
-   bfd_boolean print_memory_usage;
- 
-+  /* If TRUE (the default) warn for uses of system directories when
-+     cross linking.  */
-+  bfd_boolean poison_system_directories;
-+
-+  /* If TRUE (default FALSE) give an error for uses of system
-+     directories when cross linking instead of a warning.  */
-+  bfd_boolean error_poison_system_directories;
-+
-   /* Big or little endian as set on command line.  */
-   enum endian_enum endian;
- 
-diff --git a/ld/ld.texinfo b/ld/ld.texinfo
-index bc16764..838c75d 100644
---- a/ld/ld.texinfo
-+++ b/ld/ld.texinfo
-@@ -2357,6 +2357,18 @@ string identifying the original linked file does not change.
- 
- Passing @code{none} for @var{style} disables the setting from any
- @code{--build-id} options earlier on the command line.
-+
-+@kindex --no-poison-system-directories
-+@item --no-poison-system-directories
-+Do not warn for @option{-L} options using system directories such as
-+@file{/usr/lib} when cross linking.  This option is intended for use
-+in chroot environments when such directories contain the correct
-+libraries for the target system rather than the host.
-+
-+@kindex --error-poison-system-directories
-+@item --error-poison-system-directories
-+Give an error instead of a warning for @option{-L} options using
-+system directories when cross linking.
- @end table
- 
- @c man end
-diff --git a/ld/ldfile.c b/ld/ldfile.c
-index e397737..013727b 100644
---- a/ld/ldfile.c
-+++ b/ld/ldfile.c
-@@ -114,6 +114,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline)
-     new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
-   else
-     new_dirs->name = xstrdup (name);
-+
-+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
-+  if (command_line.poison_system_directories
-+  && ((!strncmp (name, "/lib", 4))
-+      || (!strncmp (name, "/usr/lib", 8))
-+      || (!strncmp (name, "/usr/local/lib", 14))
-+      || (!strncmp (name, "/usr/X11R6/lib", 14))))
-+   {
-+     if (command_line.error_poison_system_directories)
-+       einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
-+            "cross-compilation\n"), name);
-+     else
-+       einfo (_("%P: warning: library search path \"%s\" is unsafe for "
-+            "cross-compilation\n"), name);
-+   }
-+#endif
-+
- }
- 
- /* Try to open a BFD for a lang_input_statement.  */
-diff --git a/ld/ldlex.h b/ld/ldlex.h
-index cf943e4..12cfcaa 100644
---- a/ld/ldlex.h
-+++ b/ld/ldlex.h
-@@ -144,6 +144,8 @@ enum option_values
-   OPTION_PRINT_MEMORY_USAGE,
-   OPTION_REQUIRE_DEFINED_SYMBOL,
-   OPTION_ORPHAN_HANDLING,
-+  OPTION_NO_POISON_SYSTEM_DIRECTORIES,
-+  OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
- };
- 
- /* The initial parser states.  */
-diff --git a/ld/ldmain.c b/ld/ldmain.c
-index e7a8dff..3ccf2af 100644
---- a/ld/ldmain.c
-+++ b/ld/ldmain.c
-@@ -257,6 +257,8 @@ main (int argc, char **argv)
-   command_line.warn_mismatch = TRUE;
-   command_line.warn_search_mismatch = TRUE;
-   command_line.check_section_addresses = -1;
-+  command_line.poison_system_directories = TRUE;
-+  command_line.error_poison_system_directories = FALSE;
- 
-   /* We initialize DEMANGLING based on the environment variable
-      COLLECT_NO_DEMANGLE.  The gcc collect2 program will demangle the
-diff --git a/ld/lexsup.c b/ld/lexsup.c
-index 6d28e91..5c9da57 100644
---- a/ld/lexsup.c
-+++ b/ld/lexsup.c
-@@ -530,6 +530,14 @@ static const struct ld_option ld_options[] =
-   { {"orphan-handling", required_argument, NULL, OPTION_ORPHAN_HANDLING},
-     '\0', N_("=MODE"), N_("Control how orphan sections are handled."),
-     TWO_DASHES },
-+  { {"no-poison-system-directories", no_argument, NULL,
-+     OPTION_NO_POISON_SYSTEM_DIRECTORIES},
-+    '\0', NULL, N_("Do not warn for -L options using system directories"),
-+    TWO_DASHES },
-+  { {"error-poison-system-directories", no_argument, NULL,
-+    +     OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
-+    '\0', NULL, N_("Give an error for -L options using system directories"),
-+    TWO_DASHES },
- };
- 
- #define OPTION_COUNT ARRAY_SIZE (ld_options)
-@@ -1550,6 +1558,14 @@ parse_args (unsigned argc, char **argv)
- 	    einfo (_("%P%F: invalid argument to option"
- 		     " \"--orphan-handling\"\n"));
- 	  break;
-+
-+	case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
-+	  command_line.poison_system_directories = FALSE;
-+	  break;
-+
-+	case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
-+	  command_line.error_poison_system_directories = TRUE;
-+	  break;
- 	}
-     }
- 
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
deleted file mode 100644
index e2f6a51..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 27fc7a4927ab92925a5be84217959d9f1c808ccc Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 2 Mar 2015 01:42:38 +0000
-Subject: [PATCH 10/13] Fix rpath in libtool when sysroot is enabled
-
-Enabling sysroot support in libtool exposed a bug where the final
-library had an RPATH encoded into it which still pointed to the
-sysroot. This works around the issue until it gets sorted out
-upstream.
-
-Fix suggested by Richard Purdie <richard.purdie@linuxfoundation.org>
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- ltmain.sh | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/ltmain.sh b/ltmain.sh
-index 70e856e..11ee684 100644
---- a/ltmain.sh
-+++ b/ltmain.sh
-@@ -8035,9 +8035,11 @@ EOF
- 	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
- 	  for libdir in $rpath; do
- 	    if test -n "$hardcode_libdir_flag_spec"; then
-+		  func_replace_sysroot "$libdir"
-+		  libdir=$func_replace_sysroot_result
-+		  func_stripname '=' '' "$libdir"
-+		  libdir=$func_stripname_result
- 	      if test -n "$hardcode_libdir_separator"; then
--		func_replace_sysroot "$libdir"
--		libdir=$func_replace_sysroot_result
- 		if test -z "$hardcode_libdirs"; then
- 		  hardcode_libdirs="$libdir"
- 		else
-@@ -8770,6 +8772,10 @@ EOF
-       hardcode_libdirs=
-       for libdir in $compile_rpath $finalize_rpath; do
- 	if test -n "$hardcode_libdir_flag_spec"; then
-+	  func_replace_sysroot "$libdir"
-+	  libdir=$func_replace_sysroot_result
-+	  func_stripname '=' '' "$libdir"
-+	  libdir=$func_stripname_result
- 	  if test -n "$hardcode_libdir_separator"; then
- 	    if test -z "$hardcode_libdirs"; then
- 	      hardcode_libdirs="$libdir"
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-warn-for-uses-of-system-directories-when-cross-linki.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-warn-for-uses-of-system-directories-when-cross-linki.patch
new file mode 100644
index 0000000..0774ad6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-warn-for-uses-of-system-directories-when-cross-linki.patch
@@ -0,0 +1,273 @@
+From b1ab17abe4128684f19775448545176fb2a5e27e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 15 Jan 2016 06:31:09 +0000
+Subject: [PATCH 10/15] warn for uses of system directories when cross linking
+
+2008-07-02  Joseph Myers  <joseph@codesourcery.com>
+
+    ld/
+    * ld.h (args_type): Add error_poison_system_directories.
+    * ld.texinfo (--error-poison-system-directories): Document.
+    * ldfile.c (ldfile_add_library_path): Check
+    command_line.error_poison_system_directories.
+    * ldmain.c (main): Initialize
+    command_line.error_poison_system_directories.
+    * lexsup.c (enum option_values): Add
+    OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
+    (ld_options): Add --error-poison-system-directories.
+    (parse_args): Handle new option.
+
+2007-06-13  Joseph Myers  <joseph@codesourcery.com>
+
+    ld/
+    * config.in: Regenerate.
+    * ld.h (args_type): Add poison_system_directories.
+    * ld.texinfo (--no-poison-system-directories): Document.
+    * ldfile.c (ldfile_add_library_path): Check
+    command_line.poison_system_directories.
+    * ldmain.c (main): Initialize
+    command_line.poison_system_directories.
+    * lexsup.c (enum option_values): Add
+    OPTION_NO_POISON_SYSTEM_DIRECTORIES.
+    (ld_options): Add --no-poison-system-directories.
+    (parse_args): Handle new option.
+
+2007-04-20  Joseph Myers  <joseph@codesourcery.com>
+
+    Merge from Sourcery G++ binutils 2.17:
+
+    2007-03-20  Joseph Myers  <joseph@codesourcery.com>
+    Based on patch by Mark Hatle <mark.hatle@windriver.com>.
+    ld/
+    * configure.in (--enable-poison-system-directories): New option.
+    * configure, config.in: Regenerate.
+    * ldfile.c (ldfile_add_library_path): If
+    ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
+    /usr/lib, /usr/local/lib or /usr/X11R6/lib.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ ld/config.in    |  3 +++
+ ld/configure    | 16 ++++++++++++++++
+ ld/configure.ac | 10 ++++++++++
+ ld/ld.h         |  8 ++++++++
+ ld/ld.texinfo   | 12 ++++++++++++
+ ld/ldfile.c     | 17 +++++++++++++++++
+ ld/ldlex.h      |  2 ++
+ ld/ldmain.c     |  2 ++
+ ld/lexsup.c     | 16 ++++++++++++++++
+ 9 files changed, 86 insertions(+)
+
+diff --git a/ld/config.in b/ld/config.in
+index 2c6d698b6c..d3cb7e882d 100644
+--- a/ld/config.in
++++ b/ld/config.in
+@@ -17,6 +17,9 @@
+    language is requested. */
+ #undef ENABLE_NLS
+ 
++/* Define to warn for use of native system library directories */
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++
+ /* Additional extension a shared object might have. */
+ #undef EXTRA_SHLIB_EXTENSION
+ 
+diff --git a/ld/configure b/ld/configure
+index 4277b74bad..63109644b6 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -793,6 +793,7 @@ with_lib_path
+ enable_targets
+ enable_64_bit_bfd
+ with_sysroot
++enable_poison_system_directories
+ enable_gold
+ enable_got
+ enable_compressed_debug_sections
+@@ -1450,6 +1451,8 @@ Optional Features:
+   --disable-largefile     omit support for large files
+   --enable-targets        alternative target configurations
+   --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)
++  --enable-poison-system-directories
++                          warn for use of native system library directories
+   --enable-gold[=ARG]     build gold [ARG={default,yes,no}]
+   --enable-got=<type>     GOT handling scheme (target, single, negative,
+                           multigot)
+@@ -16314,6 +16317,19 @@ fi
+ 
+ 
+ 
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++  enableval=$enable_poison_system_directories;
++else
++  enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
++
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
++
+ # Check whether --enable-gold was given.
+ if test "${enable_gold+set}" = set; then :
+   enableval=$enable_gold; case "${enableval}" in
+diff --git a/ld/configure.ac b/ld/configure.ac
+index 36a9f5083a..47f1d33fa5 100644
+--- a/ld/configure.ac
++++ b/ld/configure.ac
+@@ -95,6 +95,16 @@ AC_SUBST(use_sysroot)
+ AC_SUBST(TARGET_SYSTEM_ROOT)
+ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+ 
++AC_ARG_ENABLE([poison-system-directories],
++         AS_HELP_STRING([--enable-poison-system-directories],
++                [warn for use of native system library directories]),,
++         [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++  AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++       [1],
++       [Define to warn for use of native system library directories])
++fi
++
+ dnl Use --enable-gold to decide if this linker should be the default.
+ dnl "install_as_default" is set to false if gold is the default linker.
+ dnl "installed_linker" is the installed BFD linker name.
+diff --git a/ld/ld.h b/ld/ld.h
+index 104bb8e237..74c914bdd5 100644
+--- a/ld/ld.h
++++ b/ld/ld.h
+@@ -172,6 +172,14 @@ typedef struct
+   /* If set, display the target memory usage (per memory region).  */
+   bfd_boolean print_memory_usage;
+ 
++  /* If TRUE (the default) warn for uses of system directories when
++     cross linking.  */
++  bfd_boolean poison_system_directories;
++
++  /* If TRUE (default FALSE) give an error for uses of system
++     directories when cross linking instead of a warning.  */
++  bfd_boolean error_poison_system_directories;
++
+   /* Big or little endian as set on command line.  */
+   enum endian_enum endian;
+ 
+diff --git a/ld/ld.texinfo b/ld/ld.texinfo
+index d393acdd94..ba995b1e3a 100644
+--- a/ld/ld.texinfo
++++ b/ld/ld.texinfo
+@@ -2403,6 +2403,18 @@ string identifying the original linked file does not change.
+ 
+ Passing @code{none} for @var{style} disables the setting from any
+ @code{--build-id} options earlier on the command line.
++
++@kindex --no-poison-system-directories
++@item --no-poison-system-directories
++Do not warn for @option{-L} options using system directories such as
++@file{/usr/lib} when cross linking.  This option is intended for use
++in chroot environments when such directories contain the correct
++libraries for the target system rather than the host.
++
++@kindex --error-poison-system-directories
++@item --error-poison-system-directories
++Give an error instead of a warning for @option{-L} options using
++system directories when cross linking.
+ @end table
+ 
+ @c man end
+diff --git a/ld/ldfile.c b/ld/ldfile.c
+index 0943bb2dfa..95874c75de 100644
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -114,6 +114,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline)
+     new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
+   else
+     new_dirs->name = xstrdup (name);
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++  if (command_line.poison_system_directories
++  && ((!strncmp (name, "/lib", 4))
++      || (!strncmp (name, "/usr/lib", 8))
++      || (!strncmp (name, "/usr/local/lib", 14))
++      || (!strncmp (name, "/usr/X11R6/lib", 14))))
++   {
++     if (command_line.error_poison_system_directories)
++       einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
++            "cross-compilation\n"), name);
++     else
++       einfo (_("%P: warning: library search path \"%s\" is unsafe for "
++            "cross-compilation\n"), name);
++   }
++#endif
++
+ }
+ 
+ /* Try to open a BFD for a lang_input_statement.  */
+diff --git a/ld/ldlex.h b/ld/ldlex.h
+index 3ecac2bc86..34117f43a5 100644
+--- a/ld/ldlex.h
++++ b/ld/ldlex.h
+@@ -146,6 +146,8 @@ enum option_values
+   OPTION_PRINT_MEMORY_USAGE,
+   OPTION_REQUIRE_DEFINED_SYMBOL,
+   OPTION_ORPHAN_HANDLING,
++  OPTION_NO_POISON_SYSTEM_DIRECTORIES,
++  OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
+ };
+ 
+ /* The initial parser states.  */
+diff --git a/ld/ldmain.c b/ld/ldmain.c
+index 1e48b1a2db..21f27bacf1 100644
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -270,6 +270,8 @@ main (int argc, char **argv)
+   command_line.warn_mismatch = TRUE;
+   command_line.warn_search_mismatch = TRUE;
+   command_line.check_section_addresses = -1;
++  command_line.poison_system_directories = TRUE;
++  command_line.error_poison_system_directories = FALSE;
+ 
+   /* We initialize DEMANGLING based on the environment variable
+      COLLECT_NO_DEMANGLE.  The gcc collect2 program will demangle the
+diff --git a/ld/lexsup.c b/ld/lexsup.c
+index 0b7d4976ac..dedc07a143 100644
+--- a/ld/lexsup.c
++++ b/ld/lexsup.c
+@@ -535,6 +535,14 @@ static const struct ld_option ld_options[] =
+   { {"orphan-handling", required_argument, NULL, OPTION_ORPHAN_HANDLING},
+     '\0', N_("=MODE"), N_("Control how orphan sections are handled."),
+     TWO_DASHES },
++  { {"no-poison-system-directories", no_argument, NULL,
++     OPTION_NO_POISON_SYSTEM_DIRECTORIES},
++    '\0', NULL, N_("Do not warn for -L options using system directories"),
++    TWO_DASHES },
++  { {"error-poison-system-directories", no_argument, NULL,
++    +     OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
++    '\0', NULL, N_("Give an error for -L options using system directories"),
++    TWO_DASHES },
+ };
+ 
+ #define OPTION_COUNT ARRAY_SIZE (ld_options)
+@@ -1562,6 +1570,14 @@ parse_args (unsigned argc, char **argv)
+ 	    einfo (_("%P%F: invalid argument to option"
+ 		     " \"--orphan-handling\"\n"));
+ 	  break;
++
++	case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
++	  command_line.poison_system_directories = FALSE;
++	  break;
++
++	case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
++	  command_line.error_poison_system_directories = TRUE;
++	  break;
+ 	}
+     }
+ 
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch
deleted file mode 100644
index 3fdb5eb..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 6b018e8129298dbd5b714e459ef0b3aef5bbce13 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 2 Mar 2015 01:44:14 +0000
-Subject: [PATCH 11/13] Change default emulation for mips64*-*-linux
-
-we change the default emulations to be N64 instead of N32
-
-Upstream-Status: Inappropriate [ OE configuration Specific]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- bfd/config.bfd   | 8 ++++----
- ld/configure.tgt | 8 ++++----
- 2 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/bfd/config.bfd b/bfd/config.bfd
-index b998830..ab17e72 100644
---- a/bfd/config.bfd
-+++ b/bfd/config.bfd
-@@ -1101,12 +1101,12 @@ case "${targ}" in
-     targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
-     ;;
-   mips64*el-*-linux*)
--    targ_defvec=mips_elf32_ntrad_le_vec
--    targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
-+    targ_defvec=mips_elf64_trad_le_vec
-+    targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec"
-     ;;
-   mips64*-*-linux*)
--    targ_defvec=mips_elf32_ntrad_be_vec
--    targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
-+    targ_defvec=mips_elf64_trad_be_vec
-+    targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_be_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec"
-     ;;
-   mips*el-*-linux*)
-     targ_defvec=mips_elf32_trad_le_vec
-diff --git a/ld/configure.tgt b/ld/configure.tgt
-index a3db909..212327c 100644
---- a/ld/configure.tgt
-+++ b/ld/configure.tgt
-@@ -513,11 +513,11 @@ mips*el-*-vxworks*)	targ_emul=elf32elmipvxworks
- mips*-*-vxworks*)	targ_emul=elf32ebmipvxworks
- 		        targ_extra_emuls="elf32elmipvxworks" ;;
- mips*-*-windiss)	targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-*)	targ_emul=elf32ltsmipn32
--			targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-+mips64*el-*-linux-*)	targ_emul=elf64ltsmip
-+			targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
- 			targ_extra_libpath=$targ_extra_emuls ;;
--mips64*-*-linux-*)	targ_emul=elf32btsmipn32
--			targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-+mips64*-*-linux-*)	targ_emul=elf64btsmip
-+			targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
- 			targ_extra_libpath=$targ_extra_emuls ;;
- mips*el-*-linux-*)	targ_emul=elf32ltsmip
- 			targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
new file mode 100644
index 0000000..949ef51
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
@@ -0,0 +1,52 @@
+From 4fe13a36997253a5c91bcb086aeb392ab2095f67 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:42:38 +0000
+Subject: [PATCH 11/15] Fix rpath in libtool when sysroot is enabled
+
+Enabling sysroot support in libtool exposed a bug where the final
+library had an RPATH encoded into it which still pointed to the
+sysroot. This works around the issue until it gets sorted out
+upstream.
+
+Fix suggested by Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 70e856e065..11ee684ccc 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -8035,9 +8035,11 @@ EOF
+ 	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ 	  for libdir in $rpath; do
+ 	    if test -n "$hardcode_libdir_flag_spec"; then
++		  func_replace_sysroot "$libdir"
++		  libdir=$func_replace_sysroot_result
++		  func_stripname '=' '' "$libdir"
++		  libdir=$func_stripname_result
+ 	      if test -n "$hardcode_libdir_separator"; then
+-		func_replace_sysroot "$libdir"
+-		libdir=$func_replace_sysroot_result
+ 		if test -z "$hardcode_libdirs"; then
+ 		  hardcode_libdirs="$libdir"
+ 		else
+@@ -8770,6 +8772,10 @@ EOF
+       hardcode_libdirs=
+       for libdir in $compile_rpath $finalize_rpath; do
+ 	if test -n "$hardcode_libdir_flag_spec"; then
++	  func_replace_sysroot "$libdir"
++	  libdir=$func_replace_sysroot_result
++	  func_stripname '=' '' "$libdir"
++	  libdir=$func_stripname_result
+ 	  if test -n "$hardcode_libdir_separator"; then
+ 	    if test -z "$hardcode_libdirs"; then
+ 	      hardcode_libdirs="$libdir"
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch
deleted file mode 100644
index 8103347..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch
+++ /dev/null
@@ -1,413 +0,0 @@
-From c2e138f4ccdf8af81c18c8511c901d3deee696b5 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 14 Feb 2016 17:06:19 +0000
-Subject: [PATCH 12/13] Add support for Netlogic XLP
-
-Patch From: Nebu Philips <nphilips@netlogicmicro.com>
-
-Using the mipsisa64r2nlm target, add support for XLP from
-Netlogic. Also, update vendor name to NLM wherever applicable.
-
-Use 0x00000080 for INSN_XLP, the value 0x00000040 has already been
-assigned to INSN_OCTEON3
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
----
-Upstream-Status: Pending
-
- bfd/aoutx.h           |  1 +
- bfd/archures.c        |  1 +
- bfd/bfd-in2.h         |  1 +
- bfd/config.bfd        |  5 +++++
- bfd/cpu-mips.c        |  6 ++++--
- bfd/elfxx-mips.c      |  8 ++++++++
- binutils/readelf.c    |  1 +
- gas/config/tc-mips.c  |  4 +++-
- gas/configure         |  3 +++
- gas/configure.tgt     |  2 +-
- include/elf/mips.h    |  1 +
- include/opcode/mips.h | 10 ++++++++--
- ld/configure.tgt      |  2 ++
- opcodes/mips-dis.c    | 12 +++++-------
- opcodes/mips-opc.c    | 33 +++++++++++++++++++++------------
- 15 files changed, 65 insertions(+), 25 deletions(-)
-
-diff --git a/bfd/aoutx.h b/bfd/aoutx.h
-index be0126a..4ca7e24 100644
---- a/bfd/aoutx.h
-+++ b/bfd/aoutx.h
-@@ -812,6 +812,7 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
- 	case bfd_mach_mipsisa64r6:
- 	case bfd_mach_mips_sb1:
- 	case bfd_mach_mips_xlr:
-+	case bfd_mach_mips_xlp:
- 	  /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc.  */
- 	  arch_flags = M_MIPS2;
- 	  break;
-diff --git a/bfd/archures.c b/bfd/archures.c
-index 96c9109..5a30d02 100644
---- a/bfd/archures.c
-+++ b/bfd/archures.c
-@@ -197,6 +197,7 @@ DESCRIPTION
- .#define bfd_mach_mips_octeon2		6502
- .#define bfd_mach_mips_octeon3          6503
- .#define bfd_mach_mips_xlr              887682   {* decimal 'XLR'  *}
-+.#define bfd_mach_mips_xlp              887680   {* decimal 'XLP'  *}
- .#define bfd_mach_mipsisa32             32
- .#define bfd_mach_mipsisa32r2           33
- .#define bfd_mach_mipsisa32r3           34
-diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
-index 30513c4..5e8ed4c 100644
---- a/bfd/bfd-in2.h
-+++ b/bfd/bfd-in2.h
-@@ -2008,6 +2008,7 @@ enum bfd_architecture
- #define bfd_mach_mips_octeon2          6502
- #define bfd_mach_mips_octeon3          6503
- #define bfd_mach_mips_xlr              887682   /* decimal 'XLR'  */
-+#define bfd_mach_mips_xlp              887680   /* decimal 'XLP'  */
- #define bfd_mach_mipsisa32             32
- #define bfd_mach_mipsisa32r2           33
- #define bfd_mach_mipsisa32r3           34
-diff --git a/bfd/config.bfd b/bfd/config.bfd
-index ab17e72..863be89 100644
---- a/bfd/config.bfd
-+++ b/bfd/config.bfd
-@@ -1084,6 +1084,11 @@ case "${targ}" in
-     targ_defvec=mips_elf32_le_vec
-     targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
-     ;;
-+  mipsisa64*-*-elf*)
-+	targ_defvec=mips_elf32_trad_be_vec
-+	targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
-+	want64=true
-+	;;
-   mips*-*-elf* | mips*-*-rtems* | mips*-*-windiss | mips*-*-none)
-     targ_defvec=mips_elf32_be_vec
-     targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
-diff --git a/bfd/cpu-mips.c b/bfd/cpu-mips.c
-index d209fb6..b6a86ae 100644
---- a/bfd/cpu-mips.c
-+++ b/bfd/cpu-mips.c
-@@ -104,7 +104,8 @@ enum
-   I_mipsocteon2,
-   I_mipsocteon3,
-   I_xlr,
--  I_micromips
-+  I_micromips,
-+  I_xlp
- };
- 
- #define NN(index) (&arch_info_struct[(index) + 1])
-@@ -155,7 +156,8 @@ static const bfd_arch_info_type arch_info_struct[] =
-   N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2",  FALSE, NN(I_mipsocteon2)),
-   N (64, 64, bfd_mach_mips_octeon3, "mips:octeon3",  FALSE, NN(I_mipsocteon3)),
-   N (64, 64, bfd_mach_mips_xlr, "mips:xlr",       FALSE, NN(I_xlr)),
--  N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,0)
-+  N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,NN(I_micromips)),
-+  N (64, 64, bfd_mach_mips_xlp, "mips:xlp",      FALSE, 0)
- };
- 
- /* The default architecture is mips:3000, but with a machine number of
-diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
-index e47276b..71c30a0 100644
---- a/bfd/elfxx-mips.c
-+++ b/bfd/elfxx-mips.c
-@@ -6646,6 +6646,9 @@ _bfd_elf_mips_mach (flagword flags)
-     case E_MIPS_MACH_XLR:
-       return bfd_mach_mips_xlr;
- 
-+	case E_MIPS_MACH_XLP:
-+      return bfd_mach_mips_xlp;
-+
-     default:
-       switch (flags & EF_MIPS_ARCH)
- 	{
-@@ -11949,6 +11952,10 @@ mips_set_isa_flags (bfd *abfd)
-       val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON2;
-       break;
- 
-+	case bfd_mach_mips_xlp:
-+	  val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_XLP;
-+	  break;
-+
-     case bfd_mach_mipsisa32:
-       val = E_MIPS_ARCH_32;
-       break;
-@@ -13975,6 +13982,7 @@ static const struct mips_mach_extension mips_mach_extensions[] =
-   { bfd_mach_mips_octeonp, bfd_mach_mips_octeon },
-   { bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 },
-   { bfd_mach_mips_loongson_3a, bfd_mach_mipsisa64r2 },
-+  { bfd_mach_mips_xlp, bfd_mach_mipsisa64r2 },
- 
-   /* MIPS64 extensions.  */
-   { bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 },
-diff --git a/binutils/readelf.c b/binutils/readelf.c
-index 274ddd1..d31558c 100644
---- a/binutils/readelf.c
-+++ b/binutils/readelf.c
-@@ -3230,6 +3230,7 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
- 	    case E_MIPS_MACH_OCTEON2: strcat (buf, ", octeon2"); break;
- 	    case E_MIPS_MACH_OCTEON3: strcat (buf, ", octeon3"); break;
- 	    case E_MIPS_MACH_XLR:  strcat (buf, ", xlr"); break;
-+		case E_MIPS_MACH_XLP:  strcat (buf, ", xlp"); break;
- 	    case 0:
- 	    /* We simply ignore the field in this case to avoid confusion:
- 	       MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
-diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
-index eb8b26b..e59dce6 100644
---- a/gas/config/tc-mips.c
-+++ b/gas/config/tc-mips.c
-@@ -552,6 +552,7 @@ static int mips_32bitmode = 0;
-    || mips_opts.arch == CPU_RM7000                    \
-    || mips_opts.arch == CPU_VR5500                    \
-    || mips_opts.micromips                             \
-+   || mips_opts.arch == CPU_XLP                       \
-    )
- 
- /* Whether the processor uses hardware interlocks to protect reads
-@@ -581,6 +582,7 @@ static int mips_32bitmode = 0;
-     && mips_opts.isa != ISA_MIPS3)                    \
-    || mips_opts.arch == CPU_R4300                     \
-    || mips_opts.micromips                             \
-+   || mips_opts.arch == CPU_XLP                       \
-    )
- 
- /* Whether the processor uses hardware interlocks to protect reads
-@@ -18858,7 +18860,7 @@ static const struct mips_cpu_info mips_cpu_info_table[] =
-   /* Broadcom XLP.
-      XLP is mostly like XLR, with the prominent exception that it is
-      MIPS64R2 rather than MIPS64.  */
--  { "xlp",	      0, 0,			ISA_MIPS64R2, CPU_XLR },
-+  { "xlp",	      0, 0,			ISA_MIPS64R2, CPU_XLP },
- 
-   /* MIPS 64 Release 6 */
-   { "i6400",	      0, ASE_MSA,		ISA_MIPS64R6, CPU_MIPS64R6},
-diff --git a/gas/configure b/gas/configure
-index 45da030..aba89f7 100755
---- a/gas/configure
-+++ b/gas/configure
-@@ -12914,6 +12914,9 @@ _ACEOF
- 	  mipsisa64r6 | mipsisa64r6el)
- 	    mips_cpu=mips64r6
- 	    ;;
-+	  mipsisa64r2nlm | mipsisa64r2nlmel)
-+		mips_cpu=xlp
-+		;;
- 	  mipstx39 | mipstx39el)
- 	    mips_cpu=r3900
- 	    ;;
-diff --git a/gas/configure.tgt b/gas/configure.tgt
-index 1b9fd99..a9f1977 100644
---- a/gas/configure.tgt
-+++ b/gas/configure.tgt
-@@ -339,7 +339,7 @@ case ${generic_target} in
-   mips-*-sysv4*MP* | mips-*-gnu*)	fmt=elf em=tmips ;;
-   mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
- 					fmt=elf em=tmips ;;
--  mips-*-elf* | mips-*-rtems*)		fmt=elf ;;
-+  mips-*-elf* | mips-*-rtems*)		fmt=elf em=tmips ;;
-   mips-*-netbsd*)			fmt=elf em=tmips ;;
-   mips-*-openbsd*)			fmt=elf em=tmips ;;
- 
-diff --git a/include/elf/mips.h b/include/elf/mips.h
-index 7e813de..d7d72c1 100644
---- a/include/elf/mips.h
-+++ b/include/elf/mips.h
-@@ -290,6 +290,7 @@ END_RELOC_NUMBERS (R_MIPS_maxext)
- #define E_MIPS_MACH_SB1         0x008a0000
- #define E_MIPS_MACH_OCTEON	0x008b0000
- #define E_MIPS_MACH_XLR     	0x008c0000
-+#define E_MIPS_MACH_XLP         0x008f0000
- #define E_MIPS_MACH_OCTEON2	0x008d0000
- #define E_MIPS_MACH_OCTEON3	0x008e0000
- #define E_MIPS_MACH_5400	0x00910000
-diff --git a/include/opcode/mips.h b/include/opcode/mips.h
-index b1d4ef6..f2c8e88 100644
---- a/include/opcode/mips.h
-+++ b/include/opcode/mips.h
-@@ -1232,8 +1232,10 @@ static const unsigned int mips_isa_table[] = {
- #define INSN_LOONGSON_2F          0x80000000
- /* Loongson 3A.  */
- #define INSN_LOONGSON_3A          0x00000400
--/* RMI Xlr instruction */
--#define INSN_XLR                 0x00000020
-+/* Netlogic Xlr instruction */
-+#define INSN_XLR		0x00000020
-+/* Netlogic XlP instruction */
-+#define INSN_XLP		0x00000080
- 
- /* DSP ASE */
- #define ASE_DSP			0x00000001
-@@ -1331,6 +1333,7 @@ static const unsigned int mips_isa_table[] = {
- #define CPU_OCTEON2	6502
- #define CPU_OCTEON3	6503
- #define CPU_XLR     	887682   	/* decimal 'XLR'   */
-+#define CPU_XLP         887680      /* decimal 'XLP'   */
- 
- /* Return true if the given CPU is included in INSN_* mask MASK.  */
- 
-@@ -1408,6 +1411,9 @@ cpu_is_member (int cpu, unsigned int mask)
-       return ((mask & INSN_ISA_MASK) == INSN_ISA32R6)
- 	     || ((mask & INSN_ISA_MASK) == INSN_ISA64R6);
- 
-+    case CPU_XLP:
-+      return (mask & INSN_XLP) != 0;
-+
-     default:
-       return FALSE;
-     }
-diff --git a/ld/configure.tgt b/ld/configure.tgt
-index 212327c..212e09c 100644
---- a/ld/configure.tgt
-+++ b/ld/configure.tgt
-@@ -499,6 +499,8 @@ mips*el-sde-elf* | mips*el-mti-elf* | mips*el-img-elf*)
- mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
- 			targ_emul=elf32btsmip
- 			targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" ;;
-+mipsisa64*-*-elf*)	targ_emul=elf32btsmip
-+			targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip" ;;
- mips64*el-ps2-elf*)	targ_emul=elf32lr5900n32
- 			targ_extra_emuls="elf32lr5900"
- 			targ_extra_libpath=$targ_extra_emuls ;;
-diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
-index 3f874e7..9813d0e 100644
---- a/opcodes/mips-dis.c
-+++ b/opcodes/mips-dis.c
-@@ -648,13 +648,11 @@ const struct mips_arch_choice mips_arch_choices[] =
-     mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr),
-     mips_cp1_names_mips3264, mips_hwr_names_numeric },
- 
--  /* XLP is mostly like XLR, with the prominent exception it is being
--     MIPS64R2.  */
--  { "xlp", 1, bfd_mach_mips_xlr, CPU_XLR,
--    ISA_MIPS64R2 | INSN_XLR, 0,
--    mips_cp0_names_xlr,
--    mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr),
--    mips_cp1_names_mips3264, mips_hwr_names_numeric },
-+  { "xlp", 1, bfd_mach_mips_xlp, CPU_XLP,
-+    ISA_MIPS64R2 | INSN_XLP, 0,
-+    mips_cp0_names_mips3264r2,
-+    mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2),
-+    mips_cp1_names_mips3264, mips_hwr_names_mips3264r2 },
- 
-   /* This entry, mips16, is here only for ISA/processor selection; do
-      not print its name.  */
-diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
-index a95eff1..99fb7bb 100644
---- a/opcodes/mips-opc.c
-+++ b/opcodes/mips-opc.c
-@@ -320,7 +320,8 @@ decode_mips_operand (const char *p)
- #define IOCTP	(INSN_OCTEONP | INSN_OCTEON2 | INSN_OCTEON3)
- #define IOCT2	(INSN_OCTEON2 | INSN_OCTEON3)
- #define IOCT3	INSN_OCTEON3
--#define XLR     INSN_XLR
-+#define XLR	INSN_XLR
-+#define XLP	INSN_XLP
- #define IVIRT	ASE_VIRT
- #define IVIRT64	ASE_VIRT64
- 
-@@ -958,6 +959,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
- {"clo",			"U,s",		0x70000021, 0xfc0007ff, WR_1|RD_2,		0,		I32|N55,	0,	I37 },
- {"clz",			"d,s",		0x00000050, 0xfc1f07ff, WR_1|RD_2,		0,		I37,		0,	0 },
- {"clz",			"U,s",		0x70000020, 0xfc0007ff, WR_1|RD_2,		0,		I32|N55,	0,	I37 },
-+{"crc",			"d,s,t",	0x7000001c, 0xfc0007ff,	WR_1|RD_2|RD_3,	0,		XLP, 		0,	0 },
- /* ctc0 is at the bottom of the table.  */
- {"ctc1",		"t,G",		0x44c00000, 0xffe007ff,	RD_1|WR_CC|CM,		0,		I1,		0,	0 },
- {"ctc1",		"t,S",		0x44c00000, 0xffe007ff,	RD_1|WR_CC|CM,		0,		I1,		0,	0 },
-@@ -990,12 +992,13 @@ const struct mips_opcode mips_builtin_opcodes[] =
- {"daddiu",		"t,r,j",	0x64000000, 0xfc000000, WR_1|RD_2,		0,		I3,		0,	0 },
- {"daddu",		"d,v,t",	0x0000002d, 0xfc0007ff, WR_1|RD_2|RD_3,		0,		I3,		0,	0 },
- {"daddu",		"t,r,I",	0,    (int) M_DADDU_I,	INSN_MACRO,		0,		I3,		0,	0 },
--{"daddwc",		"d,s,t", 	0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0,		XLR,		0,	0 },
-+{"daddwc",		"d,s,t", 	0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0,		XLR|XLP,	0,	0 },
- {"dbreak",		"",		0x7000003f, 0xffffffff,	0,			0,		N5,		0,	0 },
- {"dclo",		"d,s",		0x00000053, 0xfc1f07ff, WR_1|RD_2,		0,		I69,		0,	0 },
- {"dclo",		"U,s",	 	0x70000025, 0xfc0007ff, WR_1|RD_2, 	0,		I64|N55,	0,	I69 },
- {"dclz",		"d,s",		0x00000052, 0xfc1f07ff, WR_1|RD_2,		0,		I69,		0,	0 },
- {"dclz",		"U,s",	 	0x70000024, 0xfc0007ff, WR_1|RD_2, 	0,		I64|N55,	0,	I69 },
-+{"dcrc",		"d,s,t",	0x7000001d, 0xfc0007ff, WR_1|RD_2|RD_3,	0,		XLP, 		0,	0 },
- /* dctr and dctw are used on the r5000.  */
- {"dctr",		"o(b)",	 	0xbc050000, 0xfc1f0000, RD_2,			0,		I3,		0,	0 },
- {"dctw",		"o(b)",		0xbc090000, 0xfc1f0000, RD_2,			0,		I3,		0,	0 },
-@@ -1067,6 +1070,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
- {"dmfc0",		"t,G,H",	0x40200000, 0xffe007f8,	WR_1|RD_C0|LC,		0,		I64,		0,	0 },
- {"dmfgc0",		"t,G",		0x40600100, 0xffe007ff, WR_1|RD_C0|LC,		0,		0,		IVIRT64, 0 },
- {"dmfgc0",		"t,G,H",	0x40600100, 0xffe007f8, WR_1|RD_C0|LC,		0,		0,		IVIRT64, 0 },
-+{"dmfur",		"t,d",		0x7000001e, 0xffe007ff, WR_1,			0,		XLP,		0,	0 },
- {"dmt",			"",		0x41600bc1, 0xffffffff, TRAP,			0,		0,		MT32,	0 },
- {"dmt",			"t",		0x41600bc1, 0xffe0ffff, WR_1|TRAP,		0,		0,		MT32,	0 },
- {"dmtc0",		"t,G",		0x40a00000, 0xffe007ff,	RD_1|WR_C0|WR_CC|CM,	0,		I3,		0,	EE },
-@@ -1082,6 +1086,8 @@ const struct mips_opcode mips_builtin_opcodes[] =
- /* dmfc3 is at the bottom of the table.  */
- /* dmtc3 is at the bottom of the table.  */
- {"dmuh",		"d,s,t",	0x000000dc, 0xfc0007ff, WR_1|RD_2|RD_3,		0,		I69,		0,	0 },
-+{"dmtur",		"t,d",		0x7000001f, 0xffe007ff,	RD_1,			0,		XLP,		0,	0 },
-+{"dmul",		"d,s,t",	0x70000006, 0xfc0007ff,	WR_1|RD_2|RD_3,		0,		XLP,		0,	0 },
- {"dmul",		"d,s,t",	0x0000009c, 0xfc0007ff, WR_1|RD_2|RD_3,		0,		I69,		0,	0 },
- {"dmul",		"d,v,t",	0x70000003, 0xfc0007ff, WR_1|RD_2|RD_3|WR_HILO,	0,		IOCT,		0,	0 },
- {"dmul",		"d,v,t",	0,    (int) M_DMUL,	INSN_MACRO,		0,		I3,		0,	M32|I69 },
-@@ -1235,9 +1241,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
- {"ld",			"s,-b(+R)",	0xec180000, 0xfc1c0000, WR_1,			RD_pc,		I69,		0,	0 },
- {"ld",			"t,A(b)",	0,    (int) M_LD_AB,	INSN_MACRO,		0,		I1,		0,	0 },
- {"ld",			"t,o(b)",	0xdc000000, 0xfc000000, WR_1|RD_3|LM,		0,		I3,		0,	0 },
--{"ldaddw",		"t,b",		0x70000010, 0xfc00ffff,	MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
--{"ldaddwu",		"t,b",		0x70000011, 0xfc00ffff,	MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
--{"ldaddd",		"t,b",		0x70000012, 0xfc00ffff,	MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
-+{"ldaddw",		"t,b",		0x70000010, 0xfc00ffff,	MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
-+{"ldaddwu",		"t,b",		0x70000011, 0xfc00ffff,	MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
-+{"ldaddd",		"t,b",		0x70000012, 0xfc00ffff,	MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
- {"ldc1",		"T,o(b)",	0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D,	0,		I2,		0,	SF },
- {"ldc1",		"E,o(b)",	0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D,	0,		I2,		0,	SF },
- {"ldc1",		"T,A(b)",	0,    (int) M_LDC1_AB,	INSN_MACRO,		INSN2_M_FP_D,	I2,		0,	SF },
-@@ -1402,7 +1408,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
- {"mflo",		"d,9",		0x00000012, 0xff9f07ff, WR_1|RD_LO,		0,		0,		D32,	0 },
- {"mflo1",		"d",		0x70000012, 0xffff07ff,	WR_1|RD_LO,		0,		EE,		0,	0 },
- {"mflhxu",		"d",		0x00000052, 0xffff07ff,	WR_1|MOD_HILO,		0,		0,		SMT,	0 },
--{"mfcr",		"t,s",		0x70000018, 0xfc00ffff, WR_1|RD_2,		0,		XLR,		0,	0 },
-+{"mfcr",		"t,s",		0x70000018, 0xfc00ffff, WR_1,			0,		XLR|XLP,	0,	0 },
- {"mfsa",		"d",		0x00000028, 0xffff07ff,	WR_1,			0,		EE,		0,	0 },
- {"min.ob",		"X,Y,Q",	0x78000006, 0xfc20003f,	WR_1|RD_2|RD_3|FP_D,	0,		SB1,		MX,	0 },
- {"min.ob",		"D,S,Q",	0x48000006, 0xfc20003f,	WR_1|RD_2|RD_3|FP_D,	0,		N54,		0,	0 },
-@@ -1447,10 +1453,13 @@ const struct mips_opcode mips_builtin_opcodes[] =
- /* move is at the top of the table.  */
- {"msgn.qh",		"X,Y,Q",	0x78200000, 0xfc20003f,	WR_1|RD_2|RD_3|FP_D,	0,		0,		MX,	0 },
- {"msgsnd",		"t",		0,    (int) M_MSGSND,	INSN_MACRO,		0,		XLR,		0,	0 },
-+{"msgsnds",		"d,t",		0x4a000001, 0xffe007ff,	WR_1|RD_2|RD_C0|WR_C0,	0,		XLP,		0,	0 },
- {"msgld",		"", 		0,    (int) M_MSGLD,	INSN_MACRO,		0,		XLR,		0,	0 },
- {"msgld",		"t",		0,    (int) M_MSGLD_T,	INSN_MACRO,		0,		XLR,		0,	0 },
--{"msgwait",		"", 		0,    (int) M_MSGWAIT,	INSN_MACRO,		0,		XLR,		0,	0 },
--{"msgwait",		"t",		0,    (int) M_MSGWAIT_T,INSN_MACRO,		0,		XLR,		0,	0 },
-+{"msglds",		"d,t",		0x4a000002, 0xffe007ff,	WR_1|RD_2|RD_C0|WR_C0,	0,		XLP,		0,	0 },
-+{"msgwait",		"",		0,    (int) M_MSGWAIT,  INSN_MACRO,		0,		XLR|XLP,	0,	0 },
-+{"msgwait",		"t",		0,    (int) M_MSGWAIT_T,INSN_MACRO,		0,		XLR|XLP,	0,	0 },
-+{"msgsync",		"",		0x4a000004, 0xffffffff,0,			0,		XLP,		0,	0 },
- {"msub.d",		"D,R,S,T",	0x4c000029, 0xfc00003f, WR_1|RD_2|RD_3|RD_4|FP_D, 0,		I4_33,		0,	I37 },
- {"msub.d",		"D,S,T",	0x46200019, 0xffe0003f,	WR_1|RD_2|RD_3|FP_D,	0,		IL2E,		0,	0 },
- {"msub.d",		"D,S,T",	0x72200019, 0xffe0003f,	WR_1|RD_2|RD_3|FP_D,	0,		IL2F,		0,	0 },
-@@ -1500,7 +1509,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
- {"mtlo",		"s,7",		0x00000013, 0xfc1fe7ff, RD_1|WR_LO,		0,		0,		D32,	0 },
- {"mtlo1",		"s",		0x70000013, 0xfc1fffff,	RD_1|WR_LO,		0,		EE,		0,	0 },
- {"mtlhx",		"s",		0x00000053, 0xfc1fffff,	RD_1|MOD_HILO,		0,		0,		SMT,	0 },
--{"mtcr",		"t,s",		0x70000019, 0xfc00ffff, RD_1|RD_2,		0,		XLR,		0,	0 },
-+{"mtcr",		"t,s",		0x70000019, 0xfc00ffff, RD_1,			0,		XLR|XLP,	0,	0 },
- {"mtm0",		"s",		0x70000008, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
- {"mtm0",    		"s,t",		0x70000008, 0xfc00ffff, RD_1|RD_2,		0,		IOCT3,		0,	0 },
- {"mtm1",		"s",		0x7000000c, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
-@@ -1937,9 +1946,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
- {"suxc1",		"S,t(b)",	0x4c00000d, 0xfc0007ff, RD_1|RD_2|RD_3|SM|FP_D,	0,		I5_33|N55,	0,	I37},
- {"sw",			"t,o(b)",	0xac000000, 0xfc000000,	RD_1|RD_3|SM,		0,		I1,		0,	0 },
- {"sw",			"t,A(b)",	0,    (int) M_SW_AB,	INSN_MACRO,		0,		I1,		0,	0 },
--{"swapw",		"t,b",		0x70000014, 0xfc00ffff, MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
--{"swapwu",		"t,b",		0x70000015, 0xfc00ffff, MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
--{"swapd",		"t,b",		0x70000016, 0xfc00ffff, MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
-+{"swapw",		"t,b",		0x70000014, 0xfc00ffff, MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
-+{"swapwu",		"t,b",		0x70000015, 0xfc00ffff, MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
-+{"swapd",		"t,b",		0x70000016, 0xfc00ffff, MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
- {"swc0",		"E,o(b)",	0xe0000000, 0xfc000000,	RD_3|RD_C0|SM,		0,		I1,		0,	IOCT|IOCTP|IOCT2|I37 },
- {"swc0",		"E,A(b)",	0,    (int) M_SWC0_AB,	INSN_MACRO,		0,		I1,		0,	IOCT|IOCTP|IOCT2|I37 },
- {"swc1",		"T,o(b)",	0xe4000000, 0xfc000000,	RD_1|RD_3|SM|FP_S,	0,		I1,		0,	0 },
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Change-default-emulation-for-mips64-linux.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Change-default-emulation-for-mips64-linux.patch
new file mode 100644
index 0000000..2ac101c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Change-default-emulation-for-mips64-linux.patch
@@ -0,0 +1,59 @@
+From f43f832e0009caea6a3d5bcaa8f0a64d943072ea Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:44:14 +0000
+Subject: [PATCH 12/15] Change default emulation for mips64*-*-linux
+
+we change the default emulations to be N64 instead of N32
+
+Upstream-Status: Inappropriate [ OE configuration Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ bfd/config.bfd   | 8 ++++----
+ ld/configure.tgt | 8 ++++----
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/bfd/config.bfd b/bfd/config.bfd
+index 1b28016b91..63596c2ebc 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -1183,12 +1183,12 @@ case "${targ}" in
+     targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
+     ;;
+   mips64*el-*-linux*)
+-    targ_defvec=mips_elf32_ntrad_le_vec
+-    targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
++    targ_defvec=mips_elf64_trad_le_vec
++    targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec"
+     ;;
+   mips64*-*-linux*)
+-    targ_defvec=mips_elf32_ntrad_be_vec
+-    targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
++    targ_defvec=mips_elf64_trad_be_vec
++    targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_be_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec"
+     ;;
+   mips*el-*-linux*)
+     targ_defvec=mips_elf32_trad_le_vec
+diff --git a/ld/configure.tgt b/ld/configure.tgt
+index b85c6bb35a..4e77383a19 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -518,11 +518,11 @@ mips*el-*-vxworks*)	targ_emul=elf32elmipvxworks
+ mips*-*-vxworks*)	targ_emul=elf32ebmipvxworks
+ 		        targ_extra_emuls="elf32elmipvxworks" ;;
+ mips*-*-windiss)	targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-*)	targ_emul=elf32ltsmipn32
+-			targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
++mips64*el-*-linux-*)	targ_emul=elf64ltsmip
++			targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
+ 			targ_extra_libpath=$targ_extra_emuls ;;
+-mips64*-*-linux-*)	targ_emul=elf32btsmipn32
+-			targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
++mips64*-*-linux-*)	targ_emul=elf64btsmip
++			targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
+ 			targ_extra_libpath=$targ_extra_emuls ;;
+ mips*el-*-linux-*)	targ_emul=elf32ltsmip
+ 			targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Add-support-for-Netlogic-XLP.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Add-support-for-Netlogic-XLP.patch
new file mode 100644
index 0000000..b03e046
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Add-support-for-Netlogic-XLP.patch
@@ -0,0 +1,399 @@
+From fc6fa6a6e6e9e6e5ad7080785af31b4ea68f60c4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 14 Feb 2016 17:06:19 +0000
+Subject: [PATCH 13/15] Add support for Netlogic XLP
+
+Patch From: Nebu Philips <nphilips@netlogicmicro.com>
+
+Using the mipsisa64r2nlm target, add support for XLP from
+Netlogic. Also, update vendor name to NLM wherever applicable.
+
+Use 0x00000080 for INSN_XLP, the value 0x00000040 has already been
+assigned to INSN_OCTEON3
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+Upstream-Status: Pending
+
+ bfd/aoutx.h           |  1 +
+ bfd/archures.c        |  1 +
+ bfd/bfd-in2.h         |  1 +
+ bfd/config.bfd        |  5 +++++
+ bfd/cpu-mips.c        |  6 ++++--
+ bfd/elfxx-mips.c      |  8 ++++++++
+ binutils/readelf.c    |  1 +
+ gas/config/tc-mips.c  |  4 +++-
+ gas/configure         |  3 +++
+ include/elf/mips.h    |  1 +
+ include/opcode/mips.h | 10 ++++++++--
+ ld/configure.tgt      |  2 ++
+ opcodes/mips-dis.c    | 12 +++++-------
+ opcodes/mips-opc.c    | 33 +++++++++++++++++++++------------
+ 14 files changed, 64 insertions(+), 24 deletions(-)
+
+diff --git a/bfd/aoutx.h b/bfd/aoutx.h
+index d30e8b8fbc..913b499744 100644
+--- a/bfd/aoutx.h
++++ b/bfd/aoutx.h
+@@ -812,6 +812,7 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
+ 	case bfd_mach_mipsisa64r6:
+ 	case bfd_mach_mips_sb1:
+ 	case bfd_mach_mips_xlr:
++	case bfd_mach_mips_xlp:
+ 	  /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc.  */
+ 	  arch_flags = M_MIPS2;
+ 	  break;
+diff --git a/bfd/archures.c b/bfd/archures.c
+index 6f35a5b2a7..d12cdf609a 100644
+--- a/bfd/archures.c
++++ b/bfd/archures.c
+@@ -197,6 +197,7 @@ DESCRIPTION
+ .#define bfd_mach_mips_octeon2		6502
+ .#define bfd_mach_mips_octeon3          6503
+ .#define bfd_mach_mips_xlr              887682   {* decimal 'XLR'  *}
++.#define bfd_mach_mips_xlp              887680   {* decimal 'XLP'  *}
+ .#define bfd_mach_mipsisa32             32
+ .#define bfd_mach_mipsisa32r2           33
+ .#define bfd_mach_mipsisa32r3           34
+diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
+index 6288c3bb4a..e9f9859a7b 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -2041,6 +2041,7 @@ enum bfd_architecture
+ #define bfd_mach_mips_octeon2          6502
+ #define bfd_mach_mips_octeon3          6503
+ #define bfd_mach_mips_xlr              887682   /* decimal 'XLR'  */
++#define bfd_mach_mips_xlp              887680   /* decimal 'XLP'  */
+ #define bfd_mach_mipsisa32             32
+ #define bfd_mach_mipsisa32r2           33
+ #define bfd_mach_mipsisa32r3           34
+diff --git a/bfd/config.bfd b/bfd/config.bfd
+index 63596c2ebc..6e923fb0ed 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -1166,6 +1166,11 @@ case "${targ}" in
+     targ_defvec=mips_elf32_le_vec
+     targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
+     ;;
++  mipsisa64*-*-elf*)
++	targ_defvec=mips_elf32_trad_be_vec
++	targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
++	want64=true
++	;;
+   mips*-*-elf* | mips*-*-rtems* | mips*-*-windiss | mips*-*-none)
+     targ_defvec=mips_elf32_be_vec
+     targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
+diff --git a/bfd/cpu-mips.c b/bfd/cpu-mips.c
+index b9ecdd6e55..df1bffc25b 100644
+--- a/bfd/cpu-mips.c
++++ b/bfd/cpu-mips.c
+@@ -104,7 +104,8 @@ enum
+   I_mipsocteon2,
+   I_mipsocteon3,
+   I_xlr,
+-  I_micromips
++  I_micromips,
++  I_xlp
+ };
+ 
+ #define NN(index) (&arch_info_struct[(index) + 1])
+@@ -155,7 +156,8 @@ static const bfd_arch_info_type arch_info_struct[] =
+   N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2",  FALSE, NN(I_mipsocteon2)),
+   N (64, 64, bfd_mach_mips_octeon3, "mips:octeon3",  FALSE, NN(I_mipsocteon3)),
+   N (64, 64, bfd_mach_mips_xlr, "mips:xlr",       FALSE, NN(I_xlr)),
+-  N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,0)
++  N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,NN(I_micromips)),
++  N (64, 64, bfd_mach_mips_xlp, "mips:xlp",      FALSE, 0)
+ };
+ 
+ /* The default architecture is mips:3000, but with a machine number of
+diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
+index 723853f821..7b464211c3 100644
+--- a/bfd/elfxx-mips.c
++++ b/bfd/elfxx-mips.c
+@@ -6787,6 +6787,9 @@ _bfd_elf_mips_mach (flagword flags)
+     case E_MIPS_MACH_XLR:
+       return bfd_mach_mips_xlr;
+ 
++	case E_MIPS_MACH_XLP:
++      return bfd_mach_mips_xlp;
++
+     default:
+       switch (flags & EF_MIPS_ARCH)
+ 	{
+@@ -12106,6 +12109,10 @@ mips_set_isa_flags (bfd *abfd)
+       val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON2;
+       break;
+ 
++	case bfd_mach_mips_xlp:
++	  val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_XLP;
++	  break;
++
+     case bfd_mach_mipsisa32:
+       val = E_MIPS_ARCH_32;
+       break;
+@@ -14135,6 +14142,7 @@ static const struct mips_mach_extension mips_mach_extensions[] =
+   { bfd_mach_mips_octeonp, bfd_mach_mips_octeon },
+   { bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 },
+   { bfd_mach_mips_loongson_3a, bfd_mach_mipsisa64r2 },
++  { bfd_mach_mips_xlp, bfd_mach_mipsisa64r2 },
+ 
+   /* MIPS64 extensions.  */
+   { bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 },
+diff --git a/binutils/readelf.c b/binutils/readelf.c
+index 8dca490226..b5f577f5a1 100644
+--- a/binutils/readelf.c
++++ b/binutils/readelf.c
+@@ -3261,6 +3261,7 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
+ 	    case E_MIPS_MACH_OCTEON2: strcat (buf, ", octeon2"); break;
+ 	    case E_MIPS_MACH_OCTEON3: strcat (buf, ", octeon3"); break;
+ 	    case E_MIPS_MACH_XLR:  strcat (buf, ", xlr"); break;
++		case E_MIPS_MACH_XLP:  strcat (buf, ", xlp"); break;
+ 	    case 0:
+ 	    /* We simply ignore the field in this case to avoid confusion:
+ 	       MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
+diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
+index e24e84df54..baf84e419d 100644
+--- a/gas/config/tc-mips.c
++++ b/gas/config/tc-mips.c
+@@ -552,6 +552,7 @@ static int mips_32bitmode = 0;
+    || mips_opts.arch == CPU_RM7000                    \
+    || mips_opts.arch == CPU_VR5500                    \
+    || mips_opts.micromips                             \
++   || mips_opts.arch == CPU_XLP                       \
+    )
+ 
+ /* Whether the processor uses hardware interlocks to protect reads
+@@ -581,6 +582,7 @@ static int mips_32bitmode = 0;
+     && mips_opts.isa != ISA_MIPS3)                    \
+    || mips_opts.arch == CPU_R4300                     \
+    || mips_opts.micromips                             \
++   || mips_opts.arch == CPU_XLP                       \
+    )
+ 
+ /* Whether the processor uses hardware interlocks to protect reads
+@@ -19409,7 +19411,7 @@ static const struct mips_cpu_info mips_cpu_info_table[] =
+   /* Broadcom XLP.
+      XLP is mostly like XLR, with the prominent exception that it is
+      MIPS64R2 rather than MIPS64.  */
+-  { "xlp",	      0, 0,			ISA_MIPS64R2, CPU_XLR },
++  { "xlp",	      0, 0,			ISA_MIPS64R2, CPU_XLP },
+ 
+   /* MIPS 64 Release 6 */
+   { "i6400",	      0, ASE_MSA,		ISA_MIPS64R6, CPU_MIPS64R6},
+diff --git a/gas/configure b/gas/configure
+index a36f1ae161..99f0a94e20 100755
+--- a/gas/configure
++++ b/gas/configure
+@@ -12989,6 +12989,9 @@ _ACEOF
+ 	  mipsisa64r6 | mipsisa64r6el)
+ 	    mips_cpu=mips64r6
+ 	    ;;
++	  mipsisa64r2nlm | mipsisa64r2nlmel)
++		mips_cpu=xlp
++		;;
+ 	  mipstx39 | mipstx39el)
+ 	    mips_cpu=r3900
+ 	    ;;
+diff --git a/include/elf/mips.h b/include/elf/mips.h
+index 3e27b05122..81ea78a817 100644
+--- a/include/elf/mips.h
++++ b/include/elf/mips.h
+@@ -290,6 +290,7 @@ END_RELOC_NUMBERS (R_MIPS_maxext)
+ #define E_MIPS_MACH_SB1         0x008a0000
+ #define E_MIPS_MACH_OCTEON	0x008b0000
+ #define E_MIPS_MACH_XLR     	0x008c0000
++#define E_MIPS_MACH_XLP         0x008f0000
+ #define E_MIPS_MACH_OCTEON2	0x008d0000
+ #define E_MIPS_MACH_OCTEON3	0x008e0000
+ #define E_MIPS_MACH_5400	0x00910000
+diff --git a/include/opcode/mips.h b/include/opcode/mips.h
+index 0d043d9520..450e9c2d67 100644
+--- a/include/opcode/mips.h
++++ b/include/opcode/mips.h
+@@ -1244,8 +1244,10 @@ static const unsigned int mips_isa_table[] = {
+ #define INSN_LOONGSON_2F          0x80000000
+ /* Loongson 3A.  */
+ #define INSN_LOONGSON_3A          0x00000400
+-/* RMI Xlr instruction */
+-#define INSN_XLR                 0x00000020
++/* Netlogic Xlr instruction */
++#define INSN_XLR		0x00000020
++/* Netlogic XlP instruction */
++#define INSN_XLP		0x00000080
+ 
+ /* DSP ASE */
+ #define ASE_DSP			0x00000001
+@@ -1344,6 +1346,7 @@ static const unsigned int mips_isa_table[] = {
+ #define CPU_OCTEON2	6502
+ #define CPU_OCTEON3	6503
+ #define CPU_XLR     	887682   	/* decimal 'XLR'   */
++#define CPU_XLP         887680      /* decimal 'XLP'   */
+ 
+ /* Return true if the given CPU is included in INSN_* mask MASK.  */
+ 
+@@ -1421,6 +1424,9 @@ cpu_is_member (int cpu, unsigned int mask)
+       return ((mask & INSN_ISA_MASK) == INSN_ISA32R6)
+ 	     || ((mask & INSN_ISA_MASK) == INSN_ISA64R6);
+ 
++    case CPU_XLP:
++      return (mask & INSN_XLP) != 0;
++
+     default:
+       return FALSE;
+     }
+diff --git a/ld/configure.tgt b/ld/configure.tgt
+index 4e77383a19..8a81f7ac39 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -504,6 +504,8 @@ mips*el-sde-elf* | mips*el-mti-elf* | mips*el-img-elf*)
+ mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
+ 			targ_emul=elf32btsmip
+ 			targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" ;;
++mipsisa64*-*-elf*)	targ_emul=elf32btsmip
++			targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip" ;;
+ mips64*el-ps2-elf*)	targ_emul=elf32lr5900n32
+ 			targ_extra_emuls="elf32lr5900"
+ 			targ_extra_libpath=$targ_extra_emuls ;;
+diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
+index bb9912e462..70ecc51717 100644
+--- a/opcodes/mips-dis.c
++++ b/opcodes/mips-dis.c
+@@ -648,13 +648,11 @@ const struct mips_arch_choice mips_arch_choices[] =
+     mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr),
+     mips_cp1_names_mips3264, mips_hwr_names_numeric },
+ 
+-  /* XLP is mostly like XLR, with the prominent exception it is being
+-     MIPS64R2.  */
+-  { "xlp", 1, bfd_mach_mips_xlr, CPU_XLR,
+-    ISA_MIPS64R2 | INSN_XLR, 0,
+-    mips_cp0_names_xlr,
+-    mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr),
+-    mips_cp1_names_mips3264, mips_hwr_names_numeric },
++  { "xlp", 1, bfd_mach_mips_xlp, CPU_XLP,
++    ISA_MIPS64R2 | INSN_XLP, 0,
++    mips_cp0_names_mips3264r2,
++    mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2),
++    mips_cp1_names_mips3264, mips_hwr_names_mips3264r2 },
+ 
+   /* This entry, mips16, is here only for ISA/processor selection; do
+      not print its name.  */
+diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
+index 5cb8e7365f..f2074856a2 100644
+--- a/opcodes/mips-opc.c
++++ b/opcodes/mips-opc.c
+@@ -320,7 +320,8 @@ decode_mips_operand (const char *p)
+ #define IOCTP	(INSN_OCTEONP | INSN_OCTEON2 | INSN_OCTEON3)
+ #define IOCT2	(INSN_OCTEON2 | INSN_OCTEON3)
+ #define IOCT3	INSN_OCTEON3
+-#define XLR     INSN_XLR
++#define XLR	INSN_XLR
++#define XLP	INSN_XLP
+ #define IVIRT	ASE_VIRT
+ #define IVIRT64	ASE_VIRT64
+ 
+@@ -958,6 +959,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"clo",			"U,s",		0x70000021, 0xfc0007ff, WR_1|RD_2,		0,		I32|N55,	0,	I37 },
+ {"clz",			"d,s",		0x00000050, 0xfc1f07ff, WR_1|RD_2,		0,		I37,		0,	0 },
+ {"clz",			"U,s",		0x70000020, 0xfc0007ff, WR_1|RD_2,		0,		I32|N55,	0,	I37 },
++{"crc",			"d,s,t",	0x7000001c, 0xfc0007ff,	WR_1|RD_2|RD_3,	0,		XLP, 		0,	0 },
+ /* ctc0 is at the bottom of the table.  */
+ {"ctc1",		"t,G",		0x44c00000, 0xffe007ff,	RD_1|WR_CC|CM,		0,		I1,		0,	0 },
+ {"ctc1",		"t,S",		0x44c00000, 0xffe007ff,	RD_1|WR_CC|CM,		0,		I1,		0,	0 },
+@@ -990,12 +992,13 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"daddiu",		"t,r,j",	0x64000000, 0xfc000000, WR_1|RD_2,		0,		I3,		0,	0 },
+ {"daddu",		"d,v,t",	0x0000002d, 0xfc0007ff, WR_1|RD_2|RD_3,		0,		I3,		0,	0 },
+ {"daddu",		"t,r,I",	0,    (int) M_DADDU_I,	INSN_MACRO,		0,		I3,		0,	0 },
+-{"daddwc",		"d,s,t", 	0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0,		XLR,		0,	0 },
++{"daddwc",		"d,s,t", 	0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0,		XLR|XLP,	0,	0 },
+ {"dbreak",		"",		0x7000003f, 0xffffffff,	0,			0,		N5,		0,	0 },
+ {"dclo",		"d,s",		0x00000053, 0xfc1f07ff, WR_1|RD_2,		0,		I69,		0,	0 },
+ {"dclo",		"U,s",	 	0x70000025, 0xfc0007ff, WR_1|RD_2, 	0,		I64|N55,	0,	I69 },
+ {"dclz",		"d,s",		0x00000052, 0xfc1f07ff, WR_1|RD_2,		0,		I69,		0,	0 },
+ {"dclz",		"U,s",	 	0x70000024, 0xfc0007ff, WR_1|RD_2, 	0,		I64|N55,	0,	I69 },
++{"dcrc",		"d,s,t",	0x7000001d, 0xfc0007ff, WR_1|RD_2|RD_3,	0,		XLP, 		0,	0 },
+ /* dctr and dctw are used on the r5000.  */
+ {"dctr",		"o(b)",	 	0xbc050000, 0xfc1f0000, RD_2,			0,		I3,		0,	0 },
+ {"dctw",		"o(b)",		0xbc090000, 0xfc1f0000, RD_2,			0,		I3,		0,	0 },
+@@ -1067,6 +1070,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"dmfc0",		"t,G,H",	0x40200000, 0xffe007f8,	WR_1|RD_C0|LC,		0,		I64,		0,	0 },
+ {"dmfgc0",		"t,G",		0x40600100, 0xffe007ff, WR_1|RD_C0|LC,		0,		0,		IVIRT64, 0 },
+ {"dmfgc0",		"t,G,H",	0x40600100, 0xffe007f8, WR_1|RD_C0|LC,		0,		0,		IVIRT64, 0 },
++{"dmfur",		"t,d",		0x7000001e, 0xffe007ff, WR_1,			0,		XLP,		0,	0 },
+ {"dmt",			"",		0x41600bc1, 0xffffffff, TRAP,			0,		0,		MT32,	0 },
+ {"dmt",			"t",		0x41600bc1, 0xffe0ffff, WR_1|TRAP,		0,		0,		MT32,	0 },
+ {"dmtc0",		"t,G",		0x40a00000, 0xffe007ff,	RD_1|WR_C0|WR_CC|CM,	0,		I3,		0,	EE },
+@@ -1082,6 +1086,8 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ /* dmfc3 is at the bottom of the table.  */
+ /* dmtc3 is at the bottom of the table.  */
+ {"dmuh",		"d,s,t",	0x000000dc, 0xfc0007ff, WR_1|RD_2|RD_3,		0,		I69,		0,	0 },
++{"dmtur",		"t,d",		0x7000001f, 0xffe007ff,	RD_1,			0,		XLP,		0,	0 },
++{"dmul",		"d,s,t",	0x70000006, 0xfc0007ff,	WR_1|RD_2|RD_3,		0,		XLP,		0,	0 },
+ {"dmul",		"d,s,t",	0x0000009c, 0xfc0007ff, WR_1|RD_2|RD_3,		0,		I69,		0,	0 },
+ {"dmul",		"d,v,t",	0x70000003, 0xfc0007ff, WR_1|RD_2|RD_3|WR_HILO,	0,		IOCT,		0,	0 },
+ {"dmul",		"d,v,t",	0,    (int) M_DMUL,	INSN_MACRO,		0,		I3,		0,	M32|I69 },
+@@ -1235,9 +1241,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"ld",			"s,-b(+R)",	0xec180000, 0xfc1c0000, WR_1,			RD_pc,		I69,		0,	0 },
+ {"ld",			"t,A(b)",	0,    (int) M_LD_AB,	INSN_MACRO,		0,		I1,		0,	0 },
+ {"ld",			"t,o(b)",	0xdc000000, 0xfc000000, WR_1|RD_3|LM,		0,		I3,		0,	0 },
+-{"ldaddw",		"t,b",		0x70000010, 0xfc00ffff,	MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
+-{"ldaddwu",		"t,b",		0x70000011, 0xfc00ffff,	MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
+-{"ldaddd",		"t,b",		0x70000012, 0xfc00ffff,	MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
++{"ldaddw",		"t,b",		0x70000010, 0xfc00ffff,	MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
++{"ldaddwu",		"t,b",		0x70000011, 0xfc00ffff,	MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
++{"ldaddd",		"t,b",		0x70000012, 0xfc00ffff,	MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
+ {"ldc1",		"T,o(b)",	0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D,	0,		I2,		0,	SF },
+ {"ldc1",		"E,o(b)",	0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D,	0,		I2,		0,	SF },
+ {"ldc1",		"T,A(b)",	0,    (int) M_LDC1_AB,	INSN_MACRO,		INSN2_M_FP_D,	I2,		0,	SF },
+@@ -1402,7 +1408,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"mflo",		"d,9",		0x00000012, 0xff9f07ff, WR_1|RD_LO,		0,		0,		D32,	0 },
+ {"mflo1",		"d",		0x70000012, 0xffff07ff,	WR_1|RD_LO,		0,		EE,		0,	0 },
+ {"mflhxu",		"d",		0x00000052, 0xffff07ff,	WR_1|MOD_HILO,		0,		0,		SMT,	0 },
+-{"mfcr",		"t,s",		0x70000018, 0xfc00ffff, WR_1|RD_2,		0,		XLR,		0,	0 },
++{"mfcr",		"t,s",		0x70000018, 0xfc00ffff, WR_1,			0,		XLR|XLP,	0,	0 },
+ {"mfsa",		"d",		0x00000028, 0xffff07ff,	WR_1,			0,		EE,		0,	0 },
+ {"min.ob",		"X,Y,Q",	0x78000006, 0xfc20003f,	WR_1|RD_2|RD_3|FP_D,	0,		SB1,		MX,	0 },
+ {"min.ob",		"D,S,Q",	0x48000006, 0xfc20003f,	WR_1|RD_2|RD_3|FP_D,	0,		N54,		0,	0 },
+@@ -1447,10 +1453,13 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ /* move is at the top of the table.  */
+ {"msgn.qh",		"X,Y,Q",	0x78200000, 0xfc20003f,	WR_1|RD_2|RD_3|FP_D,	0,		0,		MX,	0 },
+ {"msgsnd",		"t",		0,    (int) M_MSGSND,	INSN_MACRO,		0,		XLR,		0,	0 },
++{"msgsnds",		"d,t",		0x4a000001, 0xffe007ff,	WR_1|RD_2|RD_C0|WR_C0,	0,		XLP,		0,	0 },
+ {"msgld",		"", 		0,    (int) M_MSGLD,	INSN_MACRO,		0,		XLR,		0,	0 },
+ {"msgld",		"t",		0,    (int) M_MSGLD_T,	INSN_MACRO,		0,		XLR,		0,	0 },
+-{"msgwait",		"", 		0,    (int) M_MSGWAIT,	INSN_MACRO,		0,		XLR,		0,	0 },
+-{"msgwait",		"t",		0,    (int) M_MSGWAIT_T,INSN_MACRO,		0,		XLR,		0,	0 },
++{"msglds",		"d,t",		0x4a000002, 0xffe007ff,	WR_1|RD_2|RD_C0|WR_C0,	0,		XLP,		0,	0 },
++{"msgwait",		"",		0,    (int) M_MSGWAIT,  INSN_MACRO,		0,		XLR|XLP,	0,	0 },
++{"msgwait",		"t",		0,    (int) M_MSGWAIT_T,INSN_MACRO,		0,		XLR|XLP,	0,	0 },
++{"msgsync",		"",		0x4a000004, 0xffffffff,0,			0,		XLP,		0,	0 },
+ {"msub.d",		"D,R,S,T",	0x4c000029, 0xfc00003f, WR_1|RD_2|RD_3|RD_4|FP_D, 0,		I4_33,		0,	I37 },
+ {"msub.d",		"D,S,T",	0x46200019, 0xffe0003f,	WR_1|RD_2|RD_3|FP_D,	0,		IL2E,		0,	0 },
+ {"msub.d",		"D,S,T",	0x72200019, 0xffe0003f,	WR_1|RD_2|RD_3|FP_D,	0,		IL2F,		0,	0 },
+@@ -1500,7 +1509,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"mtlo",		"s,7",		0x00000013, 0xfc1fe7ff, RD_1|WR_LO,		0,		0,		D32,	0 },
+ {"mtlo1",		"s",		0x70000013, 0xfc1fffff,	RD_1|WR_LO,		0,		EE,		0,	0 },
+ {"mtlhx",		"s",		0x00000053, 0xfc1fffff,	RD_1|MOD_HILO,		0,		0,		SMT,	0 },
+-{"mtcr",		"t,s",		0x70000019, 0xfc00ffff, RD_1|RD_2,		0,		XLR,		0,	0 },
++{"mtcr",		"t,s",		0x70000019, 0xfc00ffff, RD_1,			0,		XLR|XLP,	0,	0 },
+ {"mtm0",		"s",		0x70000008, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
+ {"mtm0",    		"s,t",		0x70000008, 0xfc00ffff, RD_1|RD_2,		0,		IOCT3,		0,	0 },
+ {"mtm1",		"s",		0x7000000c, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
+@@ -1937,9 +1946,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"suxc1",		"S,t(b)",	0x4c00000d, 0xfc0007ff, RD_1|RD_2|RD_3|SM|FP_D,	0,		I5_33|N55,	0,	I37},
+ {"sw",			"t,o(b)",	0xac000000, 0xfc000000,	RD_1|RD_3|SM,		0,		I1,		0,	0 },
+ {"sw",			"t,A(b)",	0,    (int) M_SW_AB,	INSN_MACRO,		0,		I1,		0,	0 },
+-{"swapw",		"t,b",		0x70000014, 0xfc00ffff, MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
+-{"swapwu",		"t,b",		0x70000015, 0xfc00ffff, MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
+-{"swapd",		"t,b",		0x70000016, 0xfc00ffff, MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
++{"swapw",		"t,b",		0x70000014, 0xfc00ffff, MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
++{"swapwu",		"t,b",		0x70000015, 0xfc00ffff, MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
++{"swapd",		"t,b",		0x70000016, 0xfc00ffff, MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
+ {"swc0",		"E,o(b)",	0xe0000000, 0xfc000000,	RD_3|RD_C0|SM,		0,		I1,		0,	IOCT|IOCTP|IOCT2|I37 },
+ {"swc0",		"E,A(b)",	0,    (int) M_SWC0_AB,	INSN_MACRO,		0,		I1,		0,	IOCT|IOCTP|IOCT2|I37 },
+ {"swc1",		"T,o(b)",	0xe4000000, 0xfc000000,	RD_1|RD_3|SM|FP_S,	0,		I1,		0,	0 },
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch
deleted file mode 100644
index f314d64..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 0c04c3b626998c8e7b595381b35456428581f52a Mon Sep 17 00:00:00 2001
-From: Zhenhua Luo <zhenhua.luo@nxp.com>
-Date: Sat, 11 Jun 2016 22:08:29 -0500
-Subject: [PATCH 13/13] fix the incorrect assembling for ppc wait mnemonic
-
-Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com>
-
-Upstream-Status: Pending
----
- opcodes/ppc-opc.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
-index 8106ab7..ca4b0f3 100644
---- a/opcodes/ppc-opc.c
-+++ b/opcodes/ppc-opc.c
-@@ -4811,7 +4811,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {
- {"ldepx",	X(31,29),	X_MASK,	  E500MC|PPCA2, 0,		{RT, RA0, RB}},
- 
- {"waitasec",	X(31,30),      XRTRARB_MASK, POWER8,	POWER9,		{0}},
--{"wait",	X(31,30),	XWC_MASK,    POWER9,	0,		{WC}},
- 
- {"lwepx",	X(31,31),	X_MASK,	  E500MC|PPCA2, 0,		{RT, RA0, RB}},
- 
-@@ -4865,7 +4864,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
- 
- {"waitrsv",	X(31,62)|(1<<21), 0xffffffff, E500MC|PPCA2, 0,		{0}},
- {"waitimpl",	X(31,62)|(2<<21), 0xffffffff, E500MC|PPCA2, 0,		{0}},
--{"wait",	X(31,62),	XWC_MASK,    E500MC|PPCA2, 0,		{WC}},
-+{"wait",	X(31,62),	XWC_MASK,    E500MC|PPCA2|POWER9, 0,	{WC}},
- 
- {"dcbstep",	XRT(31,63,0),	XRT_MASK,    E500MC|PPCA2, 0,		{RA0, RB}},
- 
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch
new file mode 100644
index 0000000..bb95a0c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch
@@ -0,0 +1,36 @@
+From a9177150f808d7e6285e1011c85d0ce89037b553 Mon Sep 17 00:00:00 2001
+From: Zhenhua Luo <zhenhua.luo@nxp.com>
+Date: Sat, 11 Jun 2016 22:08:29 -0500
+Subject: [PATCH 14/15] fix the incorrect assembling for ppc wait mnemonic
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com>
+
+Upstream-Status: Pending
+---
+ opcodes/ppc-opc.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
+index 30fd789182..f2708e2276 100644
+--- a/opcodes/ppc-opc.c
++++ b/opcodes/ppc-opc.c
+@@ -4876,7 +4876,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {
+ {"ldepx",	X(31,29),	X_MASK,	  E500MC|PPCA2, 0,		{RT, RA0, RB}},
+ 
+ {"waitasec",	X(31,30),      XRTRARB_MASK, POWER8,	POWER9,		{0}},
+-{"wait",	X(31,30),	XWC_MASK,    POWER9,	0,		{WC}},
+ 
+ {"lwepx",	X(31,31),	X_MASK,	  E500MC|PPCA2, 0,		{RT, RA0, RB}},
+ 
+@@ -4930,7 +4929,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
+ 
+ {"waitrsv",	X(31,62)|(1<<21), 0xffffffff, E500MC|PPCA2, 0,		{0}},
+ {"waitimpl",	X(31,62)|(2<<21), 0xffffffff, E500MC|PPCA2, 0,		{0}},
+-{"wait",	X(31,62),	XWC_MASK,    E500MC|PPCA2, 0,		{WC}},
++{"wait",	X(31,62),	XWC_MASK,    E500MC|PPCA2|POWER9, 0,	{WC}},
+ 
+ {"dcbstep",	XRT(31,63,0),	XRT_MASK,    E500MC|PPCA2, 0,		{RA0, RB}},
+ 
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-libtool-remove-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-libtool-remove-rpath.patch
deleted file mode 100644
index d56948f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-libtool-remove-rpath.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-Apply these patches from our libtool patches as not only are redundant RPATHs a
-waste of space but they can cause incorrect linking when native packages are
-restored from sstate.
-
-fix-rpath.patch:
-We don't want to add RPATHS which match default linker
-search paths, they're a waste of space. This patch
-filters libtools list and removes the ones we don't need.
-
-norm-rpath.patch:
-Libtool may be passed link paths of the form "/usr/lib/../lib", which
-fool its detection code into thinking it should be included as an
-RPATH in the generated binary.  Normalize before comparision.
-
-Upstream-Status: Inappropriate
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-diff --git a/ltmain.sh b/ltmain.sh
-index 683317c..860a16a 100644
---- a/ltmain.sh
-+++ b/ltmain.sh
-@@ -8053,8 +8053,14 @@ EOF
- 		  esac
- 		fi
- 	      else
--		eval flag=\"$hardcode_libdir_flag_spec\"
--		func_append dep_rpath " $flag"
-+                # We only want to hardcode in an rpath if it isn't in the
-+                # default dlsearch path.
-+	        case " $sys_lib_dlsearch_path " in
-+	        *" $libdir "*) ;;
-+	        *) eval flag=\"$hardcode_libdir_flag_spec\"
-+                   func_append dep_rpath " $flag"
-+                   ;;
-+	        esac
- 	      fi
- 	    elif test -n "$runpath_var"; then
- 	      case "$perm_rpath " in
-@@ -8790,8 +8796,14 @@ EOF
- 	      esac
- 	    fi
- 	  else
--	    eval flag=\"$hardcode_libdir_flag_spec\"
--	    func_append rpath " $flag"
-+            # We only want to hardcode in an rpath if it isn't in the
-+            # default dlsearch path.
-+	    case " $sys_lib_dlsearch_path " in
-+	    *" $libdir "*) ;;
-+	    *) eval flag=\"$hardcode_libdir_flag_spec\"
-+               rpath+=" $flag"
-+               ;;
-+	    esac
- 	  fi
- 	elif test -n "$runpath_var"; then
- 	  case "$perm_rpath " in
-@@ -8841,8 +8853,14 @@ EOF
- 	      esac
- 	    fi
- 	  else
--	    eval flag=\"$hardcode_libdir_flag_spec\"
--	    func_append rpath " $flag"
-+            # We only want to hardcode in an rpath if it isn't in the
-+            # default dlsearch path.
-+	    case " $sys_lib_dlsearch_path " in
-+	    *" $libdir "*) ;;
-+	    *) eval flag=\"$hardcode_libdir_flag_spec\"
-+               func_append rpath " $flag"
-+               ;;
-+	    esac
- 	  fi
- 	elif test -n "$runpath_var"; then
- 	  case "$finalize_perm_rpath " in
-diff --git a/ltmain.sh b/ltmain.sh
-index 683317c..860a16a 100644
---- a/ltmain.sh
-+++ b/ltmain.sh
-@@ -8055,8 +8055,10 @@ EOF
- 	      else
-                 # We only want to hardcode in an rpath if it isn't in the
-                 # default dlsearch path.
-+                func_normal_abspath "$libdir"
-+                libdir_norm=$func_normal_abspath_result
- 	        case " $sys_lib_dlsearch_path " in
--	        *" $libdir "*) ;;
-+	        *" $libdir_norm "*) ;;
- 	        *) eval flag=\"$hardcode_libdir_flag_spec\"
-                    func_append dep_rpath " $flag"
-                    ;;
-@@ -8798,8 +8800,10 @@ EOF
- 	  else
-             # We only want to hardcode in an rpath if it isn't in the
-             # default dlsearch path.
-+            func_normal_abspath "$libdir"
-+            libdir_norm=$func_normal_abspath_result
- 	    case " $sys_lib_dlsearch_path " in
--	    *" $libdir "*) ;;
-+	    *" $libdir_norm "*) ;;
- 	    *) eval flag=\"$hardcode_libdir_flag_spec\"
-                rpath+=" $flag"
-                ;;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0015-Refine-.cfi_sections-check-to-only-consider-compact-.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0015-Refine-.cfi_sections-check-to-only-consider-compact-.patch
deleted file mode 100644
index f3e3a11..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0015-Refine-.cfi_sections-check-to-only-consider-compact-.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 3d3424e9a8d6ad56160b98bf6e223c0346164468 Mon Sep 17 00:00:00 2001
-From: Matthew Fortune <matthew.fortune@imgtec.com>
-Date: Thu, 29 Sep 2016 11:13:46 +0100
-Subject: [PATCH] Refine .cfi_sections check to only consider compact eh_frame
-
-The .cfi_sections directive can be safely used multiple times
-with different sections named at any time unless the compact form
-of exception handling is requested after CFI information has
-been emitted.  Only the compact form of CFI information changes
-the way in which CFI is generated and therefore cannot be
-retrospectively requested after generating CFI information.
-
-gas/
-
-	PR gas/20648
-	* dw2gencfi.c (dot_cfi_sections): Refine the check for
-	inconsistent .cfi_sections to only consider compact vs non
-	compact forms.
-	* testsuite/gas/cfi/cfi-common-9.d: New file.
-	* testsuite/gas/cfi/cfi-common-9.s: New file.
-	* testsuite/gas/cfi/cfi.exp: Run new test.
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com
-
- gas/ChangeLog                        | 10 ++++++++++
- gas/dw2gencfi.c                      |  5 ++++-
- gas/testsuite/gas/cfi/cfi-common-9.d | 23 +++++++++++++++++++++++
- gas/testsuite/gas/cfi/cfi-common-9.s |  4 ++++
- gas/testsuite/gas/cfi/cfi.exp        |  1 +
- 5 files changed, 42 insertions(+), 1 deletion(-)
- create mode 100644 gas/testsuite/gas/cfi/cfi-common-9.d
- create mode 100644 gas/testsuite/gas/cfi/cfi-common-9.s
-
-Index: git/gas/dw2gencfi.c
-===================================================================
---- git.orig/gas/dw2gencfi.c
-+++ git/gas/dw2gencfi.c
-@@ -1244,7 +1244,10 @@ dot_cfi_sections (int ignored ATTRIBUTE_
-       }
- 
-   demand_empty_rest_of_line ();
--  if (cfi_sections_set && cfi_sections != sections)
-+  if (cfi_sections_set
-+      && (sections & (CFI_EMIT_eh_frame | CFI_EMIT_eh_frame_compact))
-+      && (cfi_sections & (CFI_EMIT_eh_frame | CFI_EMIT_eh_frame_compact))
-+	 != (sections & (CFI_EMIT_eh_frame | CFI_EMIT_eh_frame_compact)))
-     as_bad (_("inconsistent uses of .cfi_sections"));
-   cfi_sections = sections;
- }
-Index: git/gas/testsuite/gas/cfi/cfi-common-9.d
-===================================================================
---- /dev/null
-+++ git/gas/testsuite/gas/cfi/cfi-common-9.d
-@@ -0,0 +1,23 @@
-+#objdump: -Wf
-+#name: CFI common 9
-+#...
-+Contents of the .eh_frame section:
-+
-+00000000 0+0010 0+0000 CIE
-+  Version:               1
-+  Augmentation:          "zR"
-+  Code alignment factor: .*
-+  Data alignment factor: .*
-+  Return address column: .*
-+  Augmentation data:     [01]b
-+
-+  DW_CFA_nop
-+  DW_CFA_nop
-+  DW_CFA_nop
-+
-+00000014 0+00(10|18|1c|20) 0+0018 FDE cie=0+0000 pc=.*
-+
-+  DW_CFA_nop
-+  DW_CFA_nop
-+  DW_CFA_nop
-+#...
-Index: git/gas/testsuite/gas/cfi/cfi-common-9.s
-===================================================================
---- /dev/null
-+++ git/gas/testsuite/gas/cfi/cfi-common-9.s
-@@ -0,0 +1,4 @@
-+	.cfi_sections .eh_frame
-+	.cfi_startproc simple
-+	.cfi_sections .debug_frame
-+	.cfi_endproc
-Index: git/gas/testsuite/gas/cfi/cfi.exp
-===================================================================
---- git.orig/gas/testsuite/gas/cfi/cfi.exp
-+++ git/gas/testsuite/gas/cfi/cfi.exp
-@@ -135,4 +135,5 @@ if { ![istarget "hppa64*-*"] } then {
-     run_dump_test "cfi-common-6"
-   }
-   run_dump_test "cfi-common-7"
-+  run_dump_test "cfi-common-9"
- }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0015-binutils-mips-gas-pic-relax-linkonce.diff b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0015-binutils-mips-gas-pic-relax-linkonce.diff
deleted file mode 100644
index 78b971a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0015-binutils-mips-gas-pic-relax-linkonce.diff
+++ /dev/null
@@ -1,65 +0,0 @@
-Patch taken from Binutils Bugzilla:
-
-  https://sourceware.org/bugzilla/show_bug.cgi?id=20649
-
-Upstream-Status: Pending
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
-
-Index: binutils/gas/config/tc-mips.c
-===================================================================
---- binutils.orig/gas/config/tc-mips.c	2016-09-29 05:12:31.000000000 +0100
-+++ binutils/gas/config/tc-mips.c	2016-09-29 20:05:13.257411084 +0100
-@@ -1353,7 +1353,7 @@ static void s_mips_stab (int);
- static void s_mips_weakext (int);
- static void s_mips_file (int);
- static void s_mips_loc (int);
--static bfd_boolean pic_need_relax (symbolS *, asection *);
-+static bfd_boolean pic_need_relax (symbolS *);
- static int relaxed_branch_length (fragS *, asection *, int);
- static int relaxed_micromips_16bit_branch_length (fragS *, asection *, int);
- static int relaxed_micromips_32bit_branch_length (fragS *, asection *, int);
-@@ -4258,6 +4258,8 @@ mips_move_text_labels (void)
-   mips_move_labels (seg_info (now_seg)->label_list, TRUE);
- }
- 
-+/* Duplicate the test for LINK_ONCE sections as in `adjust_reloc_syms'.  */
-+
- static bfd_boolean
- s_is_linkonce (symbolS *sym, segT from_seg)
- {
-@@ -14823,7 +14825,7 @@ mips_frob_file (void)
- 	 constants; we'll report an error for those later.  */
-       if (got16_reloc_p (l->fixp->fx_r_type)
- 	  && !(l->fixp->fx_addsy
--	       && pic_need_relax (l->fixp->fx_addsy, l->seg)))
-+	       && pic_need_relax (l->fixp->fx_addsy)))
- 	continue;
- 
-       /* Check quickly whether the next fixup happens to be a matching %lo.  */
-@@ -17043,7 +17045,7 @@ nopic_need_relax (symbolS *sym, int befo
- /* Return true if the given symbol should be considered local for SVR4 PIC.  */
- 
- static bfd_boolean
--pic_need_relax (symbolS *sym, asection *segtype)
-+pic_need_relax (symbolS *sym)
- {
-   asection *symsec;
- 
-@@ -17068,7 +17070,6 @@ pic_need_relax (symbolS *sym, asection *
-   return (!bfd_is_und_section (symsec)
- 	  && !bfd_is_abs_section (symsec)
- 	  && !bfd_is_com_section (symsec)
--	  && !s_is_linkonce (sym, segtype)
- 	  /* A global or weak symbol is treated as external.  */
- 	  && (!S_IS_WEAK (sym) && !S_IS_EXTERNAL (sym)));
- }
-@@ -17507,7 +17508,7 @@ md_estimate_size_before_relax (fragS *fr
-   if (mips_pic == NO_PIC)
-     change = nopic_need_relax (fragp->fr_symbol, 0);
-   else if (mips_pic == SVR4_PIC)
--    change = pic_need_relax (fragp->fr_symbol, segtype);
-+    change = pic_need_relax (fragp->fr_symbol);
-   else if (mips_pic == VXWORKS_PIC)
-     /* For vxworks, GOT16 relocations never have a corresponding LO16.  */
-     change = 0;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch
new file mode 100644
index 0000000..1559038
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch
@@ -0,0 +1,89 @@
+From 58cdb28ed71cb57b4a0ea1b412a708fdb0f84c27 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Mon, 6 Mar 2017 23:33:27 -0800
+Subject: [PATCH 15/15] sync with OE libtool changes
+
+Apply these patches from our libtool patches as not only are redundant RPATHs a
+waste of space but they can cause incorrect linking when native packages are
+restored from sstate.
+
+fix-rpath.patch:
+We don't want to add RPATHS which match default linker
+search paths, they're a waste of space. This patch
+filters libtools list and removes the ones we don't need.
+
+norm-rpath.patch:
+Libtool may be passed link paths of the form "/usr/lib/../lib", which
+fool its detection code into thinking it should be included as an
+RPATH in the generated binary.  Normalize before comparision.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 34 ++++++++++++++++++++++++++++------
+ 1 file changed, 28 insertions(+), 6 deletions(-)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 11ee684ccc..3b19ac1532 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -8053,8 +8053,16 @@ EOF
+ 		  esac
+ 		fi
+ 	      else
+-		eval flag=\"$hardcode_libdir_flag_spec\"
+-		func_append dep_rpath " $flag"
++                # We only want to hardcode in an rpath if it isn't in the
++                # default dlsearch path.
++                func_normal_abspath "$libdir"
++                libdir_norm=$func_normal_abspath_result
++	        case " $sys_lib_dlsearch_path " in
++	        *" $libdir_norm "*) ;;
++	        *) eval flag=\"$hardcode_libdir_flag_spec\"
++                   func_append dep_rpath " $flag"
++                   ;;
++	        esac
+ 	      fi
+ 	    elif test -n "$runpath_var"; then
+ 	      case "$perm_rpath " in
+@@ -8790,8 +8798,16 @@ EOF
+ 	      esac
+ 	    fi
+ 	  else
+-	    eval flag=\"$hardcode_libdir_flag_spec\"
+-	    func_append rpath " $flag"
++            # We only want to hardcode in an rpath if it isn't in the
++            # default dlsearch path.
++            func_normal_abspath "$libdir"
++            libdir_norm=$func_normal_abspath_result
++	    case " $sys_lib_dlsearch_path " in
++	    *" $libdir_norm "*) ;;
++	    *) eval flag=\"$hardcode_libdir_flag_spec\"
++               rpath+=" $flag"
++               ;;
++	    esac
+ 	  fi
+ 	elif test -n "$runpath_var"; then
+ 	  case "$perm_rpath " in
+@@ -8841,8 +8857,14 @@ EOF
+ 	      esac
+ 	    fi
+ 	  else
+-	    eval flag=\"$hardcode_libdir_flag_spec\"
+-	    func_append rpath " $flag"
++            # We only want to hardcode in an rpath if it isn't in the
++            # default dlsearch path.
++	    case " $sys_lib_dlsearch_path " in
++	    *" $libdir "*) ;;
++	    *) eval flag=\"$hardcode_libdir_flag_spec\"
++               func_append rpath " $flag"
++               ;;
++	    esac
+ 	  fi
+ 	elif test -n "$runpath_var"; then
+ 	  case "$finalize_perm_rpath " in
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0016-Detect-64-bit-MIPS-targets.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0016-Detect-64-bit-MIPS-targets.patch
new file mode 100644
index 0000000..1b2eb84
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0016-Detect-64-bit-MIPS-targets.patch
@@ -0,0 +1,50 @@
+From c3ebde5d8cc3b0092966b4d725cad7cfd074fd8d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 11:42:03 -0700
+Subject: [PATCH 16/16] Detect 64-bit MIPS targets
+
+Add mips64 target triplets and default to N64
+
+Upstream-Status: Submitted
+https://sourceware.org/ml/binutils/2016-08/msg00048.html
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gold/configure.tgt | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/gold/configure.tgt b/gold/configure.tgt
+index 3d63027297..c1f92a1360 100644
+--- a/gold/configure.tgt
++++ b/gold/configure.tgt
+@@ -153,6 +153,13 @@ aarch64*-*)
+  targ_big_endian=false
+  targ_extra_big_endian=true
+  ;;
++mips*64*el*-*-*|mips*64*le*-*-*)
++ targ_obj=mips
++ targ_machine=EM_MIPS_RS3_LE
++ targ_size=64
++ targ_big_endian=false
++ targ_extra_big_endian=true
++ ;;
+ mips*el*-*-*|mips*le*-*-*)
+  targ_obj=mips
+  targ_machine=EM_MIPS_RS3_LE
+@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*)
+  targ_big_endian=false
+  targ_extra_big_endian=true
+  ;;
++mips*64*-*-*)
++ targ_obj=mips
++ targ_machine=EM_MIPS
++ targ_size=64
++ targ_big_endian=true
++ targ_extra_big_endian=false
++ ;;
+ mips*-*-*)
+  targ_obj=mips
+  targ_machine=EM_MIPS
+-- 
+2.12.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch
deleted file mode 100644
index 33bf1e8f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 72b09de92cc597c53b1d762882b67a17fe56846c Mon Sep 17 00:00:00 2001
-From: Nick Clifton <nickc@redhat.com>
-Date: Tue, 23 Aug 2016 09:45:11 +0100
-Subject: [PATCH 16/16] Fix seg-fault in ARM linker when trying to parse a
- binary file.
-
-	* elf32-arm.c (elf32_arm_count_additional_relocs): Return zero if
-	there is no arm data associated with the section.
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- bfd/elf32-arm.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
-index 700bec3..3fab609 100644
---- a/bfd/elf32-arm.c
-+++ b/bfd/elf32-arm.c
-@@ -18207,7 +18207,7 @@ elf32_arm_count_additional_relocs (asection *sec)
- {
-   struct _arm_elf_section_data *arm_data;
-   arm_data = get_arm_elf_section_data (sec);
--  return arm_data->additional_reloc_count;
-+  return arm_data == NULL ? 0 : arm_data->additional_reloc_count;
- }
- 
- /* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which
--- 
-2.10.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch
deleted file mode 100644
index f8b46be..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 4a4286465b5d6c28968bc2b29ae08daca7f219a3 Mon Sep 17 00:00:00 2001
-From: Nick Clifton <nickc@redhat.com>
-Date: Fri, 18 Nov 2016 11:42:48 -0800
-Subject: [PATCH] Fix the generation of alignment frags in code sections for AArch64.
-
-PR gas/20364
-* config/tc-aarch64.c (s_ltorg): Change the mapping state after
-aligning the frag.
-(aarch64_init): Treat rs_align frags in code sections as
-containing code, not data.
-* testsuite/gas/aarch64/pr20364.s: New test.
-* testsuite/gas/aarch64/pr20364.d: New test driver.
-
-Backporting the patch from binutils mainline
-https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7ea12e5c3ad54da440c08f32da09534e63e515ca
-
-Upstream-Status: Backport
-
-Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
----
- gas/ChangeLog                       | 10 ++++++++++
- gas/config/tc-aarch64.c             | 10 +++++++---
- gas/testsuite/gas/aarch64/pr20364.d | 13 +++++++++++++
- gas/testsuite/gas/aarch64/pr20364.s | 28 ++++++++++++++++++++++++++++
- 4 files changed, 58 insertions(+), 3 deletions(-)
- create mode 100644 gas/testsuite/gas/aarch64/pr20364.d
- create mode 100644 gas/testsuite/gas/aarch64/pr20364.s
-
-diff --git a/gas/ChangeLog b/gas/ChangeLog
-index a39895a..fad06dc 100644
---- a/gas/ChangeLog
-+++ b/gas/ChangeLog
-@@ -1,3 +1,13 @@
-+2016-08-05  Nick Clifton  <nickc@redhat.com>
-+
-+	PR gas/20364
-+	* config/tc-aarch64.c (s_ltorg): Change the mapping state after
-+	aligning the frag.
-+	(aarch64_init): Treat rs_align frags in code sections as
-+	containing code, not data.
-+	* testsuite/gas/aarch64/pr20364.s: New test.
-+	* testsuite/gas/aarch64/pr20364.d: New test driver.
-+
- 2016-08-03  Tristan Gingold  <gingold@adacore.com>
- 
- 	* configure: Regenerate.
-diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
-index ddc40f2..74933cb 100644
---- a/gas/config/tc-aarch64.c
-+++ b/gas/config/tc-aarch64.c
-@@ -1736,13 +1736,13 @@ s_ltorg (int ignored ATTRIBUTE_UNUSED)
-       if (pool == NULL || pool->symbol == NULL || pool->next_free_entry == 0)
- 	continue;
- 
--      mapping_state (MAP_DATA);
--
-       /* Align pool as you have word accesses.
-          Only make a frag if we have to.  */
-       if (!need_pass_2)
- 	frag_align (align, 0, 0);
- 
-+      mapping_state (MAP_DATA);
-+
-       record_alignment (now_seg, align);
- 
-       sprintf (sym_name, "$$lit_\002%x", pool->id);
-@@ -6373,11 +6373,15 @@ aarch64_init_frag (fragS * fragP, int max_chars)
- 
-   switch (fragP->fr_type)
-     {
--    case rs_align:
-     case rs_align_test:
-     case rs_fill:
-       mapping_state_2 (MAP_DATA, max_chars);
-       break;
-+    case rs_align:
-+      /* PR 20364: We can get alignment frags in code sections,
-+	 so do not just assume that we should use the MAP_DATA state.  */
-+      mapping_state_2 (subseg_text_p (now_seg) ? MAP_INSN : MAP_DATA, max_chars);
-+      break;
-     case rs_align_code:
-       mapping_state_2 (MAP_INSN, max_chars);
-       break;
-diff --git a/gas/testsuite/gas/aarch64/pr20364.d b/gas/testsuite/gas/aarch64/pr20364.d
-new file mode 100644
-index 0000000..babcff1
---- /dev/null
-+++ b/gas/testsuite/gas/aarch64/pr20364.d
-@@ -0,0 +1,13 @@
-+# Check that ".align <size>, <fill>" does not set the mapping state to DATA, causing unnecessary frag generation.
-+#name: PR20364 
-+#objdump: -d
-+
-+.*:     file format .*
-+
-+Disassembly of section \.vectors:
-+
-+0+000 <.*>:
-+   0:	d2800000 	mov	x0, #0x0                   	// #0
-+   4:	94000000 	bl	0 <plat_report_exception>
-+   8:	17fffffe 	b	0 <bl1_exceptions>
-+
-diff --git a/gas/testsuite/gas/aarch64/pr20364.s b/gas/testsuite/gas/aarch64/pr20364.s
-new file mode 100644
-index 0000000..594ad7c
---- /dev/null
-+++ b/gas/testsuite/gas/aarch64/pr20364.s
-@@ -0,0 +1,28 @@
-+ .macro vector_base label
-+ .section .vectors, "ax"
-+ .align 11, 0
-+ \label:
-+ .endm
-+
-+ .macro vector_entry label
-+ .section .vectors, "ax"
-+ .align 7, 0
-+ \label:
-+ .endm
-+
-+ .macro check_vector_size since
-+   .if (. - \since) > (32 * 4)
-+     .error "Vector exceeds 32 instructions"
-+   .endif
-+ .endm
-+
-+ .globl bl1_exceptions
-+
-+vector_base bl1_exceptions
-+
-+vector_entry SynchronousExceptionSP0
-+ mov x0, #0x0
-+ bl plat_report_exception
-+ b SynchronousExceptionSP0
-+ check_vector_size SynchronousExceptionSP0
-+
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0017-bfd-Improve-lookup-of-file-line-information-for-erro.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0017-bfd-Improve-lookup-of-file-line-information-for-erro.patch
new file mode 100644
index 0000000..23ad10a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0017-bfd-Improve-lookup-of-file-line-information-for-erro.patch
@@ -0,0 +1,75 @@
+From 3239a4231ff79bf8b67b8faaf414b1667486167c Mon Sep 17 00:00:00 2001
+From: Andrew Burgess <andrew.burgess@embecosm.com>
+Date: Mon, 19 Dec 2016 15:27:59 +0000
+Subject: [PATCH] bfd: Improve lookup of file / line information for errors
+
+When looking up file and line information (used from the linker to
+report error messages) if no symbol is passed in, then use the symbol
+list to look for a matching symbol.
+
+If a matching symbol is found then use this to look up the file / line
+information.
+
+This should improve errors when looking up file / line information for
+data sections.  Hopefully we should find a matching data symbol, which
+should, in turn (we hope) match a DW_TAG_variable in the DWARF, this
+should allow us to give accurate file / line errors for data symbols.
+
+As the hope is to find a matching DW_TAG_variable in the DWARF then we
+ignore section symbols, and prefer global symbols to locals.
+
+CVE: CVE-2017-8392
+Upstream-Status: Accepted
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+---
+ bfd/dwarf2.c                   | 32 ++++++++++++++++++++++++++++++++
+ 1 files changed, 32 insertions(+)
+
+
+diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
+index 03447a9..9bb8126 100644
+--- a/bfd/dwarf2.c
++++ b/bfd/dwarf2.c
+@@ -4155,6 +4155,38 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
+     {
+       BFD_ASSERT (section != NULL && functionname_ptr != NULL);
+       addr = offset;
++
++      /* If we have no SYMBOL but the section we're looking at is not a
++         code section, then take a look through the list of symbols to see
++         if we have a symbol at the address we're looking for.  If we do
++         then use this to look up line information.  This will allow us to
++         give file and line results for data symbols.  We exclude code
++         symbols here, if we look up a function symbol and then look up the
++         line information we'll actually return the line number for the
++         opening '{' rather than the function definition line.  This is
++         because looking up by symbol uses the line table, in which the
++         first line for a function is usually the opening '{', while
++         looking up the function by section + offset uses the
++         DW_AT_decl_line from the function DW_TAG_subprogram for the line,
++         which will be the line of the function name.  */
++      if ((section->flags & SEC_CODE) == 0)
++	{
++	  asymbol **tmp;
++
++	  for (tmp = symbols; (*tmp) != NULL; ++tmp)
++	    if ((*tmp)->the_bfd == abfd
++		&& (*tmp)->section == section
++		&& (*tmp)->value == offset
++		&& ((*tmp)->flags & BSF_SECTION_SYM) == 0)
++	      {
++		symbol = *tmp;
++		do_line = TRUE;
++                /* For local symbols, keep going in the hope we find a
++                   global.  */
++                if ((symbol->flags & BSF_GLOBAL) != 0)
++                  break;
++	      }
++	}
+     }
+ 
+   if (section->output_section)
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0018-PR-21409-segfault-in-_bfd_dwarf2_find_nearest_line.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0018-PR-21409-segfault-in-_bfd_dwarf2_find_nearest_line.patch
new file mode 100644
index 0000000..acb37df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0018-PR-21409-segfault-in-_bfd_dwarf2_find_nearest_line.patch
@@ -0,0 +1,33 @@
+From 97e83a100aa8250be783304bfe0429761c6e6b6b Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Sun, 23 Apr 2017 13:55:49 +0930
+Subject: [PATCH] PR 21409, segfault in _bfd_dwarf2_find_nearest_line
+
+	PR 21409
+	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
+	no symbols.
+
+CVE: CVE-2017-8392
+Upstream-Status: Accepted
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+---
+ bfd/dwarf2.c  | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletion(-)
+
+diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
+index 132a674..0ef3e1f 100644
+--- a/bfd/dwarf2.c
++++ b/bfd/dwarf2.c
+@@ -4205,7 +4205,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd,
+          looking up the function by section + offset uses the
+          DW_AT_decl_line from the function DW_TAG_subprogram for the line,
+          which will be the line of the function name.  */
+-      if ((section->flags & SEC_CODE) == 0)
++      if (symbols != NULL && (section->flags & SEC_CODE) == 0)
+ 	{
+ 	  asymbol **tmp;
+ 
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6965.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6965.patch
index 85f7f98..1334c94 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6965.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6965.patch
@@ -1,4 +1,4 @@
-From 6f898c17b1d6f6a29a05ca6de31f0fc8f52cfbfe Mon Sep 17 00:00:00 2001
+From bdc5166c274b842f83f8328e7cfaaf80fd29934e Mon Sep 17 00:00:00 2001
 From: Nick Clifton <nickc@redhat.com>
 Date: Mon, 13 Feb 2017 13:08:32 +0000
 Subject: [PATCH 1/2] Fix readelf writing to illegal addresses whilst
@@ -20,13 +20,10 @@
  2 files changed, 32 insertions(+), 5 deletions(-)
 
 diff --git a/binutils/ChangeLog b/binutils/ChangeLog
-index 995de87dc3..154b797a29 100644
+index f21867f98c..e789a3b99b 100644
 --- a/binutils/ChangeLog
 +++ b/binutils/ChangeLog
-@@ -5,6 +5,13 @@
- 	Check for buffer overflow before writing relocated values.
- 	(apply_relocations): Pass end to target_specific_reloc_handling.
- 
+@@ -1,3 +1,10 @@
 +2017-02-13  Nick Clifton  <nickc@redhat.com>
 +
 +	PR binutils/21137
@@ -34,14 +31,14 @@
 +	Check for buffer overflow before writing relocated values.
 +	(apply_relocations): Pass end to target_specific_reloc_handling.
 +
- 2016-08-03  Tristan Gingold  <gingold@adacore.com>
+ 2017-03-02  Tristan Gingold  <gingold@adacore.com>
  
  	* configure: Regenerate.
 diff --git a/binutils/readelf.c b/binutils/readelf.c
-index d31558c3b4..220671f76f 100644
+index b5f577f5a1..8cdaae3b8c 100644
 --- a/binutils/readelf.c
 +++ b/binutils/readelf.c
-@@ -11345,6 +11345,7 @@ process_syminfo (FILE * file ATTRIBUTE_UNUSED)
+@@ -11585,6 +11585,7 @@ process_syminfo (FILE * file ATTRIBUTE_UNUSED)
  static bfd_boolean
  target_specific_reloc_handling (Elf_Internal_Rela * reloc,
  				unsigned char *     start,
@@ -49,7 +46,7 @@
  				Elf_Internal_Sym *  symtab)
  {
    unsigned int reloc_type = get_reloc_type (reloc->r_info);
-@@ -11384,13 +11385,19 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+@@ -11625,13 +11626,19 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
  	  handle_sym_diff:
  	    if (saved_sym != NULL)
  	      {
@@ -70,7 +67,7 @@
  
  		saved_sym = NULL;
  		return TRUE;
-@@ -11421,13 +11428,18 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+@@ -11662,13 +11669,18 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
  	  case 2: /* R_MN10300_16 */
  	    if (saved_sym != NULL)
  	      {
@@ -90,7 +87,7 @@
  
  		saved_sym = NULL;
  		return TRUE;
-@@ -11462,12 +11474,20 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+@@ -11703,12 +11715,20 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
  	    break;
  
  	  case 0x41: /* R_RL78_ABS32.  */
@@ -113,7 +110,7 @@
  	    value = 0;
  	    return TRUE;
  
-@@ -12074,7 +12094,7 @@ apply_relocations (void *                     file,
+@@ -12325,7 +12345,7 @@ apply_relocations (void *                     file,
  
  	  reloc_type = get_reloc_type (rp->r_info);
  
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6966.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6966.patch
index 5e364ef..dd58df5 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6966.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6966.patch
@@ -1,7 +1,7 @@
-From 310e2cdc0a46ef62602097f5c21c393571e76df4 Mon Sep 17 00:00:00 2001
+From 383ec757d27652448d1511169e1133f486abf54f Mon Sep 17 00:00:00 2001
 From: Nick Clifton <nickc@redhat.com>
 Date: Mon, 13 Feb 2017 14:03:22 +0000
-Subject: [PATCH 2/2] Fix read-after-free error in readelf when processing
+Subject: [PATCH] Fix read-after-free error in readelf when processing
  multiple, relocated sections in an MSP430 binary.
 
 	PR binutils/21139
@@ -23,7 +23,7 @@
  2 files changed, 94 insertions(+), 25 deletions(-)
 
 diff --git a/binutils/ChangeLog b/binutils/ChangeLog
-index 154b797a29..aef0a51f19 100644
+index e789a3b99b..bd63c8a0d8 100644
 --- a/binutils/ChangeLog
 +++ b/binutils/ChangeLog
 @@ -1,5 +1,15 @@
@@ -43,10 +43,10 @@
  	* readelf.c (target_specific_reloc_handling): Add end parameter.
  	Check for buffer overflow before writing relocated values.
 diff --git a/binutils/readelf.c b/binutils/readelf.c
-index 220671f76f..2b6cef1638 100644
+index 8cdaae3b8c..7c158c6342 100644
 --- a/binutils/readelf.c
 +++ b/binutils/readelf.c
-@@ -11340,15 +11340,27 @@ process_syminfo (FILE * file ATTRIBUTE_UNUSED)
+@@ -11580,15 +11580,27 @@ process_syminfo (FILE * file ATTRIBUTE_UNUSED)
  
  /* Check to see if the given reloc needs to be handled in a target specific
     manner.  If so then process the reloc and return TRUE otherwise return
@@ -77,7 +77,7 @@
  
    switch (elf_header.e_machine)
      {
-@@ -11357,13 +11369,24 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+@@ -11597,6 +11609,12 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
        {
  	static Elf_Internal_Sym * saved_sym = NULL;
  
@@ -90,8 +90,9 @@
  	switch (reloc_type)
  	  {
  	  case 10: /* R_MSP430_SYM_DIFF */
- 	    if (uses_msp430x_relocs ())
+@@ -11604,7 +11622,12 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
  	      break;
+ 	    /* Fall through.  */
  	  case 21: /* R_MSP430X_SYM_DIFF */
 -	    saved_sym = symtab + get_reloc_symindex (reloc->r_info);
 +	    /* PR 21139.  */
@@ -103,7 +104,7 @@
  	    return TRUE;
  
  	  case 1: /* R_MSP430_32 or R_MSP430_ABS32 */
-@@ -11388,16 +11411,21 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+@@ -11629,16 +11652,21 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
  		int reloc_size = reloc_type == 1 ? 4 : 2;
  		bfd_vma value;
  
@@ -134,7 +135,7 @@
  
  		saved_sym = NULL;
  		return TRUE;
-@@ -11417,13 +11445,24 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+@@ -11658,13 +11686,24 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
        {
  	static Elf_Internal_Sym * saved_sym = NULL;
  
@@ -160,7 +161,7 @@
  	  case 1: /* R_MN10300_32 */
  	  case 2: /* R_MN10300_16 */
  	    if (saved_sym != NULL)
-@@ -11431,15 +11470,20 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+@@ -11672,15 +11711,20 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
  		int reloc_size = reloc_type == 1 ? 4 : 2;
  		bfd_vma value;
  
@@ -189,7 +190,7 @@
  
  		saved_sym = NULL;
  		return TRUE;
-@@ -11459,12 +11503,24 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+@@ -11700,12 +11744,24 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
  	static bfd_vma saved_sym2 = 0;
  	static bfd_vma value;
  
@@ -216,7 +217,7 @@
  	    return TRUE;
  
  	  case 0x83: /* R_RL78_OPsub.  */
-@@ -12094,7 +12150,7 @@ apply_relocations (void *                     file,
+@@ -12345,7 +12401,7 @@ apply_relocations (void *                     file,
  
  	  reloc_type = get_reloc_type (rp->r_info);
  
@@ -225,7 +226,7 @@
  	    continue;
  	  else if (is_none_reloc (reloc_type))
  	    continue;
-@@ -12190,6 +12246,9 @@ apply_relocations (void *                     file,
+@@ -12441,6 +12497,9 @@ apply_relocations (void *                     file,
  	}
  
        free (symtab);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch
index 3d036c4..ed54034 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch
@@ -1,7 +1,8 @@
-From 489246368e2c49a795ad5ecbc8895cbc854292fa Mon Sep 17 00:00:00 2001
+From 1d9a2696903fc59d6a936f4ab4e4407ef329d066 Mon Sep 17 00:00:00 2001
 From: Nick Clifton <nickc@redhat.com>
 Date: Fri, 17 Feb 2017 15:59:45 +0000
-Subject: Fix illegal memory accesses in readelf when parsing a corrupt binary.
+Subject: Fix illegal memory accesses in readelf when parsing
+ a corrupt binary.
 
 	PR binutils/21156
 	* readelf.c (find_section_in_set): Test for invalid section
@@ -17,7 +18,7 @@
  2 files changed, 14 insertions(+), 2 deletions(-)
 
 diff --git a/binutils/ChangeLog b/binutils/ChangeLog
-index a70bdb7a7b..dbf8eb079e 100644
+index bd63c8a0d8..1d840b42f9 100644
 --- a/binutils/ChangeLog
 +++ b/binutils/ChangeLog
 @@ -1,3 +1,9 @@
@@ -27,14 +28,14 @@
 +	* readelf.c (find_section_in_set): Test for invalid section
 +	indicies.
 +
- 2016-08-03  Tristan Gingold  <gingold@adacore.com>
+ 2017-02-13  Nick Clifton  <nickc@redhat.com>
  
- 	* configure: Regenerate.
+ 	PR binutils/21139
 diff --git a/binutils/readelf.c b/binutils/readelf.c
-index d31558c3b4..7f7365dbc5 100644
+index 7c158c6342..4960491c5c 100644
 --- a/binutils/readelf.c
 +++ b/binutils/readelf.c
-@@ -674,8 +674,14 @@ find_section_in_set (const char * name, unsigned int * set)
+@@ -675,8 +675,14 @@ find_section_in_set (const char * name, unsigned int * set)
    if (set != NULL)
      {
        while ((i = *set++) > 0)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch
index 491c708..59a5dec 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch
@@ -1,8 +1,8 @@
-From 59fcd64fe65a89fb0acaf5463840310701189375 Mon Sep 17 00:00:00 2001
+From ef81126314f67472a46db9581530fbf5ccb6b3f2 Mon Sep 17 00:00:00 2001
 From: Nick Clifton <nickc@redhat.com>
 Date: Mon, 20 Feb 2017 14:40:39 +0000
-Subject: Fix another memory access error in readelf when parsing a corrupt
- binary.
+Subject: Fix another memory access error in readelf when
+ parsing a corrupt binary.
 
 	PR binutils/21156
 	* dwarf.c (cu_tu_indexes_read): Move into...
@@ -22,7 +22,7 @@
  2 files changed, 30 insertions(+), 14 deletions(-)
 
 diff --git a/binutils/ChangeLog b/binutils/ChangeLog
-index dbf8eb079e..55d2f8ba40 100644
+index 1d840b42f9..53352c1801 100644
 --- a/binutils/ChangeLog
 +++ b/binutils/ChangeLog
 @@ -1,3 +1,13 @@
@@ -40,7 +40,7 @@
  
  	PR binutils/21156
 diff --git a/binutils/dwarf.c b/binutils/dwarf.c
-index 282e069958..a23267feb6 100644
+index 0184a7ab2e..6d879c9b61 100644
 --- a/binutils/dwarf.c
 +++ b/binutils/dwarf.c
 @@ -76,7 +76,6 @@ int dwarf_check = 0;
@@ -60,7 +60,7 @@
  
  /* Values for do_debug_lines.  */
  #define FLAG_DEBUG_LINES_RAW	 1
-@@ -2713,7 +2712,7 @@ load_debug_info (void * file)
+@@ -2715,7 +2714,7 @@ load_debug_info (void * file)
      return num_debug_info_entries;
  
    /* If this is a DWARF package file, load the CU and TU indexes.  */
@@ -69,7 +69,7 @@
  
    if (load_debug_section (info, file)
        && process_debug_info (&debug_displays [info].section, file, abbrev, 1, 0))
-@@ -7302,21 +7301,27 @@ process_cu_tu_index (struct dwarf_section *section, int do_display)
+@@ -7378,21 +7377,27 @@ process_cu_tu_index (struct dwarf_section *section, int do_display)
     section sets that we can use to associate a .debug_info.dwo section
     with its associated .debug_abbrev.dwo section in a .dwp file.  */
  
@@ -107,7 +107,7 @@
  }
  
  /* Find the set of sections that includes section SHNDX.  */
-@@ -7326,7 +7331,8 @@ find_cu_tu_set (void *file, unsigned int shndx)
+@@ -7402,7 +7407,8 @@ find_cu_tu_set (void *file, unsigned int shndx)
  {
    unsigned int i;
  
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7209.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7209.patch
index 336d72c..2357a12 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7209.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7209.patch
@@ -1,8 +1,7 @@
-From 6e5e9d96b5bd7dc3147db9917d6a7a20682915cc Mon Sep 17 00:00:00 2001
+From b2706ceadac7239e7b02d43f05100fc6538b0d65 Mon Sep 17 00:00:00 2001
 From: Nick Clifton <nickc@redhat.com>
 Date: Mon, 13 Feb 2017 15:04:37 +0000
-Subject: Fix invalid read of section contents whilst processing a corrupt
- binary.
+Subject: Fix invalid read of section contents whilst processing a corrupt binary.
 
 	PR binutils/21135
 	* readelf.c (dump_section_as_bytes): Handle the case where
@@ -18,7 +17,7 @@
  2 files changed, 18 insertions(+), 4 deletions(-)
 
 diff --git a/binutils/ChangeLog b/binutils/ChangeLog
-index 55d2f8ba40..c4d8e60eca 100644
+index 53352c1801..cf92744c12 100644
 --- a/binutils/ChangeLog
 +++ b/binutils/ChangeLog
 @@ -1,3 +1,9 @@
@@ -32,10 +31,10 @@
  
  	PR binutils/21156
 diff --git a/binutils/readelf.c b/binutils/readelf.c
-index 7f7365dbc5..bc4e92fa81 100644
+index 4960491c5c..f0e7b080e8 100644
 --- a/binutils/readelf.c
 +++ b/binutils/readelf.c
-@@ -12473,10 +12473,18 @@ dump_section_as_bytes (Elf_Internal_Shdr * section,
+@@ -12803,10 +12803,18 @@ dump_section_as_bytes (Elf_Internal_Shdr * section,
  	  new_size -= 12;
  	}
  
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7210.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7210.patch
index 211d2bf..8791792 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7210.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7210.patch
@@ -1,4 +1,4 @@
-From 80958b04c91edcd41c42807225a7ad1b2a4ce0e6 Mon Sep 17 00:00:00 2001
+From 4da598a472e1d298825035e452e3bc68f714311c Mon Sep 17 00:00:00 2001
 From: Nick Clifton <nickc@redhat.com>
 Date: Tue, 14 Feb 2017 14:07:29 +0000
 Subject: Fix handling of corrupt STABS enum type strings.
@@ -18,7 +18,7 @@
  2 files changed, 20 insertions(+), 1 deletion(-)
 
 diff --git a/binutils/ChangeLog b/binutils/ChangeLog
-index c4d8e60eca..2bae9ec587 100644
+index cf92744c12..0045fbaaa6 100644
 --- a/binutils/ChangeLog
 +++ b/binutils/ChangeLog
 @@ -1,3 +1,10 @@
@@ -33,7 +33,7 @@
  
  	PR binutils/21135
 diff --git a/binutils/stabs.c b/binutils/stabs.c
-index aebde7afe9..c425afe98e 100644
+index f5c5d2d8e0..5d013cc361 100644
 --- a/binutils/stabs.c
 +++ b/binutils/stabs.c
 @@ -232,6 +232,10 @@ parse_number (const char **pp, bfd_boolean *poverflow)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7223.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7223.patch
new file mode 100644
index 0000000..c78c8bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7223.patch
@@ -0,0 +1,52 @@
+From 69ace2200106348a1b00d509a6a234337c104c17 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Thu, 1 Dec 2016 15:20:19 +0000
+Subject: [PATCH] Fix seg fault attempting to unget an EOF character.
+
+	PR gas/20898
+	* app.c (do_scrub_chars): Do not attempt to unget EOF.
+
+Affects: <= 2.28
+Upstream-Status: Backport
+CVE: CVE-2017-7223
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ gas/ChangeLog | 3 +++
+ gas/app.c     | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+Index: git/gas/ChangeLog
+===================================================================
+--- git.orig/gas/ChangeLog
++++ git/gas/ChangeLog
+@@ -1,3 +1,8 @@
++2016-12-01  Nick Clifton  <nickc@redhat.com>
++ 
++       PR gas/20898
++       * app.c (do_scrub_chars): Do not attempt to unget EOF.
++
+ 2017-03-02  Tristan Gingold  <gingold@adacore.com>
+ 
+ 	* configure: Regenerate.
+@@ -198,7 +203,6 @@
+ 	* config/tc-pru.c (md_number_to_chars): Fix parameter to be
+ 	valueT, as declared in tc.h.
+ 	(md_apply_fix): Fix to work on 32-bit hosts.
+->>>>>>> 0115611... RISC-V/GAS: Correct branch relaxation for weak symbols.
+ 
+ 2017-01-02  Alan Modra  <amodra@gmail.com>
+ 
+Index: git/gas/app.c
+===================================================================
+--- git.orig/gas/app.c
++++ git/gas/app.c
+@@ -1350,7 +1350,7 @@ do_scrub_chars (size_t (*get) (char *, s
+ 		  PUT (ch);
+ 		  break;
+ 		}
+-	      else
++	      else if (ch2 != EOF)
+ 		{
+ 		  state = 9;
+ 		  if (ch == EOF || !IS_SYMBOL_COMPONENT (ch))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7614.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7614.patch
new file mode 100644
index 0000000..be8631a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7614.patch
@@ -0,0 +1,103 @@
+From ad32986fdf9da1c8748e47b8b45100398223dba8 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Tue, 4 Apr 2017 11:23:36 +0100
+Subject: [PATCH] Fix null pointer dereferences when using a link built with
+ clang.
+
+	PR binutils/21342
+	* elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
+	dereference.
+	(bfd_elf_final_link): Only initialize the extended symbol index
+	section if there are extended symbol tables to list.
+
+Upstream-Status: Backport
+CVE: CVE-2017-7614
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog |  8 ++++++++
+ bfd/elflink.c | 35 +++++++++++++++++++++--------------
+ 2 files changed, 29 insertions(+), 14 deletions(-)
+
+Index: git/bfd/elflink.c
+===================================================================
+--- git.orig/bfd/elflink.c
++++ git/bfd/elflink.c
+@@ -119,15 +119,18 @@ _bfd_elf_define_linkage_sym (bfd *abfd,
+ 	 defined in shared libraries can't be overridden, because we
+ 	 lose the link to the bfd which is via the symbol section.  */
+       h->root.type = bfd_link_hash_new;
++      bh = &h->root;
+     }
++  else
++    bh = NULL;
+ 
+-  bh = &h->root;
+   bed = get_elf_backend_data (abfd);
+   if (!_bfd_generic_link_add_one_symbol (info, abfd, name, BSF_GLOBAL,
+ 					 sec, 0, NULL, FALSE, bed->collect,
+ 					 &bh))
+     return NULL;
+   h = (struct elf_link_hash_entry *) bh;
++  BFD_ASSERT (h != NULL);
+   h->def_regular = 1;
+   h->non_elf = 0;
+   h->root.linker_def = 1;
+@@ -11973,24 +11976,28 @@ bfd_elf_final_link (bfd *abfd, struct bf
+     {
+       /* Finish up and write out the symbol string table (.strtab)
+ 	 section.  */
+-      Elf_Internal_Shdr *symstrtab_hdr;
++      Elf_Internal_Shdr *symstrtab_hdr = NULL;
+       file_ptr off = symtab_hdr->sh_offset + symtab_hdr->sh_size;
+ 
+-      symtab_shndx_hdr = & elf_symtab_shndx_list (abfd)->hdr;
+-      if (symtab_shndx_hdr != NULL && symtab_shndx_hdr->sh_name != 0)
++      if (elf_symtab_shndx_list (abfd))
+ 	{
+-	  symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX;
+-	  symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx);
+-	  symtab_shndx_hdr->sh_addralign = sizeof (Elf_External_Sym_Shndx);
+-	  amt = bfd_get_symcount (abfd) * sizeof (Elf_External_Sym_Shndx);
+-	  symtab_shndx_hdr->sh_size = amt;
++	  symtab_shndx_hdr = & elf_symtab_shndx_list (abfd)->hdr;
+ 
+-	  off = _bfd_elf_assign_file_position_for_section (symtab_shndx_hdr,
+-							   off, TRUE);
++	  if (symtab_shndx_hdr != NULL && symtab_shndx_hdr->sh_name != 0)
++	    {
++	      symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX;
++	      symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx);
++	      symtab_shndx_hdr->sh_addralign = sizeof (Elf_External_Sym_Shndx);
++	      amt = bfd_get_symcount (abfd) * sizeof (Elf_External_Sym_Shndx);
++	      symtab_shndx_hdr->sh_size = amt;
+ 
+-	  if (bfd_seek (abfd, symtab_shndx_hdr->sh_offset, SEEK_SET) != 0
+-	      || (bfd_bwrite (flinfo.symshndxbuf, amt, abfd) != amt))
+-	    return FALSE;
++	      off = _bfd_elf_assign_file_position_for_section (symtab_shndx_hdr,
++							       off, TRUE);
++
++	      if (bfd_seek (abfd, symtab_shndx_hdr->sh_offset, SEEK_SET) != 0
++		  || (bfd_bwrite (flinfo.symshndxbuf, amt, abfd) != amt))
++		return FALSE;
++	    }
+ 	}
+ 
+       symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr;
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,11 @@
++2017-04-04  Nick Clifton  <nickc@redhat.com>
++
++       PR binutils/21342
++       * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
++       dereference.
++       (bfd_elf_final_link): Only initialize the extended symbol index
++       section if there are extended symbol tables to list.
++
+ 2017-03-07  Alan Modra  <amodra@gmail.com>
+ 
+ 	PR 21224
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8393.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8393.patch
new file mode 100644
index 0000000..8500a03
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8393.patch
@@ -0,0 +1,205 @@
+From bce964aa6c777d236fbd641f2bc7bb931cfe4bf3 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Sun, 23 Apr 2017 11:03:34 +0930
+Subject: [PATCH] PR 21412, get_reloc_section assumes .rel/.rela name for
+ SHT_REL/RELA.
+
+This patch fixes an assumption made by code that runs for objcopy and
+strip, that SHT_REL/SHR_RELA sections are always named starting with a
+.rel/.rela prefix.  I'm also modifying the interface for
+elf_backend_get_reloc_section, so any backend function just needs to
+handle name mapping.
+
+	PR 21412
+	* elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
+	parameters and comment.
+	(_bfd_elf_get_reloc_section): Delete.
+	(_bfd_elf_plt_get_reloc_section): Declare.
+	* elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
+	New functions.  Don't blindly skip over assumed .rel/.rela prefix.
+	Extracted from..
+	(_bfd_elf_get_reloc_section): ..here.  Delete.
+	(assign_section_numbers): Call elf_get_reloc_section.
+	* elf64-ppc.c (elf_backend_get_reloc_section): Define.
+	* elfxx-target.h (elf_backend_get_reloc_section): Update.
+
+Upstream-Status: Backport
+CVE: CVE-2017-8393
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog      | 15 ++++++++++++++
+ bfd/elf-bfd.h      |  8 ++++---
+ bfd/elf.c          | 61 +++++++++++++++++++++++++++++++-----------------------
+ bfd/elf64-ppc.c    |  1 +
+ bfd/elfxx-target.h |  2 +-
+ 5 files changed, 57 insertions(+), 30 deletions(-)
+
+Index: git/bfd/elf-bfd.h
+===================================================================
+--- git.orig/bfd/elf-bfd.h
++++ git/bfd/elf-bfd.h
+@@ -1322,8 +1322,10 @@ struct elf_backend_data
+   bfd_size_type (*maybe_function_sym) (const asymbol *sym, asection *sec,
+ 				       bfd_vma *code_off);
+ 
+-  /* Return the section which RELOC_SEC applies to.  */
+-  asection *(*get_reloc_section) (asection *reloc_sec);
++  /* Given NAME, the name of a relocation section stripped of its
++     .rel/.rela prefix, return the section in ABFD to which the
++     relocations apply.  */
++  asection *(*get_reloc_section) (bfd *abfd, const char *name);
+ 
+   /* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which
+      has a type >= SHT_LOOS.  Returns TRUE if the fields were initialised,
+@@ -2392,7 +2394,7 @@ extern bfd_boolean _bfd_elf_is_function_
+ extern bfd_size_type _bfd_elf_maybe_function_sym (const asymbol *, asection *,
+ 						  bfd_vma *);
+ 
+-extern asection *_bfd_elf_get_reloc_section (asection *);
++extern asection *_bfd_elf_plt_get_reloc_section (bfd *, const char *);
+ 
+ extern int bfd_elf_get_default_section_type (flagword);
+ 
+Index: git/bfd/elf.c
+===================================================================
+--- git.orig/bfd/elf.c
++++ git/bfd/elf.c
+@@ -3532,17 +3532,39 @@ bfd_elf_set_group_contents (bfd *abfd, a
+   H_PUT_32 (abfd, sec->flags & SEC_LINK_ONCE ? GRP_COMDAT : 0, loc);
+ }
+ 
+-/* Return the section which RELOC_SEC applies to.  */
++/* Given NAME, the name of a relocation section stripped of its
++   .rel/.rela prefix, return the section in ABFD to which the
++   relocations apply.  */
+ 
+ asection *
+-_bfd_elf_get_reloc_section (asection *reloc_sec)
++_bfd_elf_plt_get_reloc_section (bfd *abfd, const char *name)
++{
++  /* If a target needs .got.plt section, relocations in rela.plt/rel.plt
++     section likely apply to .got.plt or .got section.  */
++  if (get_elf_backend_data (abfd)->want_got_plt
++      && strcmp (name, ".plt") == 0)
++    {
++      asection *sec;
++
++      name = ".got.plt";
++      sec = bfd_get_section_by_name (abfd, name);
++      if (sec != NULL)
++	return sec;
++      name = ".got";
++    }
++
++  return bfd_get_section_by_name (abfd, name);
++}
++
++/* Return the section to which RELOC_SEC applies.  */
++
++static asection *
++elf_get_reloc_section (asection *reloc_sec)
+ {
+   const char *name;
+   unsigned int type;
+   bfd *abfd;
+-
+-  if (reloc_sec == NULL)
+-    return NULL;
++  const struct elf_backend_data *bed;
+ 
+   type = elf_section_data (reloc_sec)->this_hdr.sh_type;
+   if (type != SHT_REL && type != SHT_RELA)
+@@ -3550,28 +3572,15 @@ _bfd_elf_get_reloc_section (asection *re
+ 
+   /* We look up the section the relocs apply to by name.  */
+   name = reloc_sec->name;
+-  if (type == SHT_REL)
+-    name += 4;
+-  else
+-    name += 5;
++  if (strncmp (name, ".rel", 4) != 0)
++    return NULL;
++  name += 4;
++  if (type == SHT_RELA && *name++ != 'a')
++    return NULL;
+ 
+-  /* If a target needs .got.plt section, relocations in rela.plt/rel.plt
+-     section apply to .got.plt section.  */
+   abfd = reloc_sec->owner;
+-  if (get_elf_backend_data (abfd)->want_got_plt
+-      && strcmp (name, ".plt") == 0)
+-    {
+-      /* .got.plt is a linker created input section.  It may be mapped
+-	 to some other output section.  Try two likely sections.  */
+-      name = ".got.plt";
+-      reloc_sec = bfd_get_section_by_name (abfd, name);
+-      if (reloc_sec != NULL)
+-	return reloc_sec;
+-      name = ".got";
+-    }
+-
+-  reloc_sec = bfd_get_section_by_name (abfd, name);
+-  return reloc_sec;
++  bed = get_elf_backend_data (abfd);
++  return bed->get_reloc_section (abfd, name);
+ }
+ 
+ /* Assign all ELF section numbers.  The dummy first section is handled here
+@@ -3833,7 +3842,7 @@ assign_section_numbers (bfd *abfd, struc
+ 	  if (s != NULL)
+ 	    d->this_hdr.sh_link = elf_section_data (s)->this_idx;
+ 
+-	  s = get_elf_backend_data (abfd)->get_reloc_section (sec);
++	  s = elf_get_reloc_section (sec);
+ 	  if (s != NULL)
+ 	    {
+ 	      d->this_hdr.sh_info = elf_section_data (s)->this_idx;
+Index: git/bfd/elf64-ppc.c
+===================================================================
+--- git.orig/bfd/elf64-ppc.c
++++ git/bfd/elf64-ppc.c
+@@ -121,6 +121,7 @@ static bfd_vma opd_entry_value
+ #define elf_backend_special_sections	      ppc64_elf_special_sections
+ #define elf_backend_merge_symbol_attribute    ppc64_elf_merge_symbol_attribute
+ #define elf_backend_merge_symbol	      ppc64_elf_merge_symbol
++#define elf_backend_get_reloc_section	      bfd_get_section_by_name
+ 
+ /* The name of the dynamic interpreter.  This is put in the .interp
+    section.  */
+Index: git/bfd/elfxx-target.h
+===================================================================
+--- git.orig/bfd/elfxx-target.h
++++ git/bfd/elfxx-target.h
+@@ -706,7 +706,7 @@
+ #endif
+ 
+ #ifndef elf_backend_get_reloc_section
+-#define elf_backend_get_reloc_section _bfd_elf_get_reloc_section
++#define elf_backend_get_reloc_section _bfd_elf_plt_get_reloc_section
+ #endif
+ 
+ #ifndef elf_backend_copy_special_section_fields
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,18 @@
++2017-04-23  Alan Modra  <amodra@gmail.com>
++ 
++       PR 21412
++       * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
++       parameters and comment.
++       (_bfd_elf_get_reloc_section): Delete.
++       (_bfd_elf_plt_get_reloc_section): Declare.
++       * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
++       New functions.  Don't blindly skip over assumed .rel/.rela prefix.
++       Extracted from..
++       (_bfd_elf_get_reloc_section): ..here.  Delete.
++       (assign_section_numbers): Call elf_get_reloc_section.
++       * elf64-ppc.c (elf_backend_get_reloc_section): Define.
++       * elfxx-target.h (elf_backend_get_reloc_section): Update.
++
+ 2017-04-04  Nick Clifton  <nickc@redhat.com>
+ 
+        PR binutils/21342
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8394.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8394.patch
new file mode 100644
index 0000000..e6c6b17
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8394.patch
@@ -0,0 +1,118 @@
+From 7eacd66b086cabb1daab20890d5481894d4f56b2 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Sun, 23 Apr 2017 15:21:11 +0930
+Subject: [PATCH] PR 21414, null pointer deref of _bfd_elf_large_com_section
+ sym
+
+	PR 21414
+	* section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
+	* elf.c (lcomm_sym): New.
+	(_bfd_elf_large_com_section): Use lcomm_sym section symbol.
+	* bfd-in2.h: Regenerate.
+
+Upstream-Status: Backport
+CVE: CVE-2017-8394
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog |  8 ++++++++
+ bfd/bfd-in2.h | 12 ++++++++++++
+ bfd/elf.c     |  6 ++++--
+ bfd/section.c | 24 ++++++++++++------------
+ 4 files changed, 36 insertions(+), 14 deletions(-)
+
+Index: git/bfd/bfd-in2.h
+===================================================================
+--- git.orig/bfd/bfd-in2.h
++++ git/bfd/bfd-in2.h
+@@ -1838,6 +1838,18 @@ extern asection _bfd_std_section[4];
+      { NULL }, { NULL }                                                \
+     }
+ 
++/* We use a macro to initialize the static asymbol structures because
++   traditional C does not permit us to initialize a union member while
++   gcc warns if we don't initialize it.
++   the_bfd, name, value, attr, section [, udata]  */
++#ifdef __STDC__
++#define GLOBAL_SYM_INIT(NAME, SECTION) \
++  { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
++#else
++#define GLOBAL_SYM_INIT(NAME, SECTION) \
++  { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
++#endif
++
+ void bfd_section_list_clear (bfd *);
+ 
+ asection *bfd_get_section_by_name (bfd *abfd, const char *name);
+Index: git/bfd/elf.c
+===================================================================
+--- git.orig/bfd/elf.c
++++ git/bfd/elf.c
+@@ -11164,9 +11164,11 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd
+ 
+ /* It is only used by x86-64 so far.
+    ??? This repeats *COM* id of zero.  sec->id is supposed to be unique,
+-   but current usage would allow all of _bfd_std_section to be zero.  t*/
++   but current usage would allow all of _bfd_std_section to be zero.  */
++static const asymbol lcomm_sym
++  = GLOBAL_SYM_INIT ("LARGE_COMMON", &_bfd_elf_large_com_section);
+ asection _bfd_elf_large_com_section
+-  = BFD_FAKE_SECTION (_bfd_elf_large_com_section, NULL,
++  = BFD_FAKE_SECTION (_bfd_elf_large_com_section, &lcomm_sym,
+ 		      "LARGE_COMMON", 0, SEC_IS_COMMON);
+ 
+ void
+Index: git/bfd/section.c
+===================================================================
+--- git.orig/bfd/section.c
++++ git/bfd/section.c
+@@ -738,20 +738,20 @@ CODE_FRAGMENT
+ .     { NULL }, { NULL }						\
+ .    }
+ .
++.{* We use a macro to initialize the static asymbol structures because
++.   traditional C does not permit us to initialize a union member while
++.   gcc warns if we don't initialize it.
++.   the_bfd, name, value, attr, section [, udata]  *}
++.#ifdef __STDC__
++.#define GLOBAL_SYM_INIT(NAME, SECTION) \
++.  { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
++.#else
++.#define GLOBAL_SYM_INIT(NAME, SECTION) \
++.  { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
++.#endif
++.
+ */
+ 
+-/* We use a macro to initialize the static asymbol structures because
+-   traditional C does not permit us to initialize a union member while
+-   gcc warns if we don't initialize it.  */
+- /* the_bfd, name, value, attr, section [, udata] */
+-#ifdef __STDC__
+-#define GLOBAL_SYM_INIT(NAME, SECTION) \
+-  { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }}
+-#else
+-#define GLOBAL_SYM_INIT(NAME, SECTION) \
+-  { 0, NAME, 0, BSF_SECTION_SYM, SECTION }
+-#endif
+-
+ /* These symbols are global, not specific to any BFD.  Therefore, anything
+    that tries to change them is broken, and should be repaired.  */
+ 
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,4 +1,12 @@
++
+ 2017-04-23  Alan Modra  <amodra@gmail.com>
++       PR 21414
++       * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
++       * elf.c (lcomm_sym): New.
++       (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
++       * bfd-in2.h: Regenerate.
++
+++2017-04-23  Alan Modra  <amodra@gmail.com>
+  
+        PR 21412
+        * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8395.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8395.patch
new file mode 100644
index 0000000..0a9bce3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8395.patch
@@ -0,0 +1,72 @@
+From e63d123268f23a4cbc45ee55fb6dbc7d84729da3 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Wed, 26 Apr 2017 13:07:49 +0100
+Subject: [PATCH] Fix seg-fault attempting to compress a debug section in a
+ corrupt binary.
+
+	PR binutils/21431
+	* compress.c (bfd_init_section_compress_status): Check the return
+	value from bfd_malloc.
+
+Upstream-Status: Backport
+CVE: CVE-2017-8395
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog  |  6 ++++++
+ bfd/compress.c | 19 +++++++++----------
+ 2 files changed, 15 insertions(+), 10 deletions(-)
+
+Index: git/bfd/compress.c
+===================================================================
+--- git.orig/bfd/compress.c
++++ git/bfd/compress.c
+@@ -542,7 +542,6 @@ bfd_init_section_compress_status (bfd *a
+ {
+   bfd_size_type uncompressed_size;
+   bfd_byte *uncompressed_buffer;
+-  bfd_boolean ret;
+ 
+   /* Error if not opened for read.  */
+   if (abfd->direction != read_direction
+@@ -558,18 +557,18 @@ bfd_init_section_compress_status (bfd *a
+   /* Read in the full section contents and compress it.  */
+   uncompressed_size = sec->size;
+   uncompressed_buffer = (bfd_byte *) bfd_malloc (uncompressed_size);
++  /* PR 21431 */
++  if (uncompressed_buffer == NULL)
++    return FALSE;
++
+   if (!bfd_get_section_contents (abfd, sec, uncompressed_buffer,
+ 				 0, uncompressed_size))
+-    ret = FALSE;
+-  else
+-    {
+-      uncompressed_size = bfd_compress_section_contents (abfd, sec,
+-							 uncompressed_buffer,
+-							 uncompressed_size);
+-      ret = uncompressed_size != 0;
+-    }
++    return FALSE;
+ 
+-  return ret;
++  uncompressed_size = bfd_compress_section_contents (abfd, sec,
++						     uncompressed_buffer,
++						     uncompressed_size);
++  return uncompressed_size != 0;
+ }
+ 
+ /*
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,8 @@
++2017-04-26  Nick Clifton  <nickc@redhat.com>
++
++       PR binutils/21431
++       * compress.c (bfd_init_section_compress_status): Check the return
++       value from bfd_malloc.
+ 
+ 2017-04-23  Alan Modra  <amodra@gmail.com>
+        PR 21414
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8396_8397.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8396_8397.patch
new file mode 100644
index 0000000..14f4282
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8396_8397.patch
@@ -0,0 +1,102 @@
+From a941291cab71b9ac356e1c03968c177c03e602ab Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Sat, 29 Apr 2017 14:48:16 +0930
+Subject: [PATCH] PR21432, buffer overflow in perform_relocation
+
+The existing reloc offset range tests didn't catch small negative
+offsets less than the size of the reloc field.
+
+	PR 21432
+	* reloc.c (reloc_offset_in_range): New function.
+	(bfd_perform_relocation, bfd_install_relocation): Use it.
+	(_bfd_final_link_relocate): Likewise.
+
+Upstream-Status: Backport
+CVE: CVE-2017-8396
+CVE: CVE-2017-8397
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog |  7 +++++++
+ bfd/reloc.c   | 32 ++++++++++++++++++++------------
+ 2 files changed, 27 insertions(+), 12 deletions(-)
+
+Index: git/bfd/reloc.c
+===================================================================
+--- git.orig/bfd/reloc.c
++++ git/bfd/reloc.c
+@@ -538,6 +538,22 @@ bfd_check_overflow (enum complain_overfl
+   return flag;
+ }
+ 
++/* HOWTO describes a relocation, at offset OCTET.  Return whether the
++   relocation field is within SECTION of ABFD.  */
++
++static bfd_boolean
++reloc_offset_in_range (reloc_howto_type *howto, bfd *abfd,
++		       asection *section, bfd_size_type octet)
++{
++  bfd_size_type octet_end = bfd_get_section_limit_octets (abfd, section);
++  bfd_size_type reloc_size = bfd_get_reloc_size (howto);
++
++  /* The reloc field must be contained entirely within the section.
++     Allow zero length fields (marker relocs or NONE relocs where no
++     relocation will be performed) at the end of the section.  */
++  return octet <= octet_end && octet + reloc_size <= octet_end;
++}
++
+ /*
+ FUNCTION
+ 	bfd_perform_relocation
+@@ -618,13 +634,10 @@ bfd_perform_relocation (bfd *abfd,
+   /* PR 17512: file: 0f67f69d.  */
+   if (howto == NULL)
+     return bfd_reloc_undefined;
+-
+-  /* Is the address of the relocation really within the section?
+-     Include the size of the reloc in the test for out of range addresses.
+-     PR 17512: file: c146ab8b, 46dff27f, 38e53ebf.  */
++  
++  /* Is the address of the relocation really within the section?  */
+   octets = reloc_entry->address * bfd_octets_per_byte (abfd);
+-  if (octets + bfd_get_reloc_size (howto)
+-      > bfd_get_section_limit_octets (abfd, input_section))
++  if (!reloc_offset_in_range (howto, abfd, input_section, octets))
+     return bfd_reloc_outofrange;
+ 
+   /* Work out which section the relocation is targeted at and the
+@@ -1012,8 +1025,7 @@ bfd_install_relocation (bfd *abfd,
+ 
+   /* Is the address of the relocation really within the section?  */
+   octets = reloc_entry->address * bfd_octets_per_byte (abfd);
+-  if (octets + bfd_get_reloc_size (howto)
+-      > bfd_get_section_limit_octets (abfd, input_section))
++  if (!reloc_offset_in_range (howto, abfd, input_section, octets))
+     return bfd_reloc_outofrange;
+ 
+   /* Work out which section the relocation is targeted at and the
+@@ -1351,8 +1363,7 @@ _bfd_final_link_relocate (reloc_howto_ty
+   bfd_size_type octets = address * bfd_octets_per_byte (input_bfd);
+ 
+   /* Sanity check the address.  */
+-  if (octets + bfd_get_reloc_size (howto)
+-      > bfd_get_section_limit_octets (input_bfd, input_section))
++  if (!reloc_offset_in_range (howto, input_bfd, input_section, octets))
+     return bfd_reloc_outofrange;
+ 
+   /* This function assumes that we are dealing with a basic relocation
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,10 @@
++2017-04-29  Alan Modra  <amodra@gmail.com>
++
++       PR 21432
++       * reloc.c (reloc_offset_in_range): New function.
++       (bfd_perform_relocation, bfd_install_relocation): Use it.
++       (_bfd_final_link_relocate): Likewise.
++
+ 2017-04-26  Nick Clifton  <nickc@redhat.com>
+ 
+        PR binutils/21431
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8398.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8398.patch
new file mode 100644
index 0000000..5b9acc8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8398.patch
@@ -0,0 +1,147 @@
+From d949ff5607b9f595e0eed2ff15fbe5eb84eb3a34 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Fri, 28 Apr 2017 10:28:04 +0100
+Subject: [PATCH] Fix heap-buffer overflow bugs caused when dumping debug
+ information from a corrupt binary.
+
+	PR binutils/21438
+	* dwarf.c (process_extended_line_op): Do not assume that the
+	string extracted from the section is NUL terminated.
+	(fetch_indirect_string): If the string retrieved from the section
+	is not NUL terminated, return an error message.
+	(fetch_indirect_line_string): Likewise.
+	(fetch_indexed_string): Likewise.
+
+Upstream-Status: Backport
+CVE: CVE-2017-8398
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ binutils/ChangeLog | 10 +++++++++
+ binutils/dwarf.c   | 66 +++++++++++++++++++++++++++++++++++++++++-------------
+ 2 files changed, 60 insertions(+), 16 deletions(-)
+
+Index: git/binutils/dwarf.c
+===================================================================
+--- git.orig/binutils/dwarf.c
++++ git/binutils/dwarf.c
+@@ -472,15 +472,20 @@ process_extended_line_op (unsigned char
+       printf (_("  Entry\tDir\tTime\tSize\tName\n"));
+       printf ("   %d\t", ++state_machine_regs.last_file_entry);
+ 
+-      name = data;
+-      data += strnlen ((char *) data, end - data) + 1;
+-      printf ("%s\t", dwarf_vmatoa ("u", read_uleb128 (data, & bytes_read, end)));
+-      data += bytes_read;
+-      printf ("%s\t", dwarf_vmatoa ("u", read_uleb128 (data, & bytes_read, end)));
+-      data += bytes_read;
+-      printf ("%s\t", dwarf_vmatoa ("u", read_uleb128 (data, & bytes_read, end)));
+-      data += bytes_read;
+-      printf ("%s\n\n", name);
++      {
++	size_t l;
++
++	name = data;
++	l = strnlen ((char *) data, end - data);
++	data += len + 1;
++	printf ("%s\t", dwarf_vmatoa ("u", read_uleb128 (data, & bytes_read, end)));
++	data += bytes_read;
++	printf ("%s\t", dwarf_vmatoa ("u", read_uleb128 (data, & bytes_read, end)));
++	data += bytes_read;
++	printf ("%s\t", dwarf_vmatoa ("u", read_uleb128 (data, & bytes_read, end)));
++	data += bytes_read;
++	printf ("%.*s\n\n", (int) l, name);
++      }
+ 
+       if (((unsigned int) (data - orig_data) != len) || data == end)
+ 	warn (_("DW_LNE_define_file: Bad opcode length\n"));
+@@ -597,18 +602,27 @@ static const unsigned char *
+ fetch_indirect_string (dwarf_vma offset)
+ {
+   struct dwarf_section *section = &debug_displays [str].section;
++  const unsigned char * ret;
+ 
+   if (section->start == NULL)
+     return (const unsigned char *) _("<no .debug_str section>");
+ 
+-  if (offset > section->size)
++  if (offset >= section->size)
+     {
+       warn (_("DW_FORM_strp offset too big: %s\n"),
+ 	    dwarf_vmatoa ("x", offset));
+       return (const unsigned char *) _("<offset is too big>");
+     }
++  ret = section->start + offset;
++  /* Unfortunately we cannot rely upon the .debug_str section ending with a
++     NUL byte.  Since our caller is expecting to receive a well formed C
++     string we test for the lack of a terminating byte here.  */
++  if (strnlen ((const char *) ret, section->size - offset)
++      == section->size - offset)
++    ret = (const unsigned char *)
++      _("<no NUL byte at end of .debug_str section>");
+ 
+-  return (const unsigned char *) section->start + offset;
++  return ret; 
+ }
+ 
+ static const char *
+@@ -621,6 +635,7 @@ fetch_indexed_string (dwarf_vma idx, str
+   struct dwarf_section *str_section = &debug_displays [str_sec_idx].section;
+   dwarf_vma index_offset = idx * offset_size;
+   dwarf_vma str_offset;
++  const char * ret;
+ 
+   if (index_section->start == NULL)
+     return (dwo ? _("<no .debug_str_offsets.dwo section>")
+@@ -628,7 +643,7 @@ fetch_indexed_string (dwarf_vma idx, str
+ 
+   if (this_set != NULL)
+     index_offset += this_set->section_offsets [DW_SECT_STR_OFFSETS];
+-  if (index_offset > index_section->size)
++  if (index_offset >= index_section->size)
+     {
+       warn (_("DW_FORM_GNU_str_index offset too big: %s\n"),
+ 	    dwarf_vmatoa ("x", index_offset));
+@@ -641,14 +656,22 @@ fetch_indexed_string (dwarf_vma idx, str
+ 
+   str_offset = byte_get (index_section->start + index_offset, offset_size);
+   str_offset -= str_section->address;
+-  if (str_offset > str_section->size)
++  if (str_offset >= str_section->size)
+     {
+       warn (_("DW_FORM_GNU_str_index indirect offset too big: %s\n"),
+ 	    dwarf_vmatoa ("x", str_offset));
+       return _("<indirect index offset is too big>");
+     }
+ 
+-  return (const char *) str_section->start + str_offset;
++  ret = (const char *) str_section->start + str_offset;
++  /* Unfortunately we cannot rely upon str_section ending with a NUL byte.
++     Since our caller is expecting to receive a well formed C string we test
++     for the lack of a terminating byte here.  */
++  if (strnlen (ret, str_section->size - str_offset)
++      == str_section->size - str_offset)
++    ret = (const char *) _("<no NUL byte at end of section>");
++
++  return ret;
+ }
+ 
+ static const char *
+Index: git/binutils/ChangeLog
+===================================================================
+--- git.orig/binutils/ChangeLog
++++ git/binutils/ChangeLog
+@@ -1,3 +1,13 @@
++2017-04-28  Nick Clifton  <nickc@redhat.com>
++
++       PR binutils/21438
++       * dwarf.c (process_extended_line_op): Do not assume that the
++       string extracted from the section is NUL terminated.
++       (fetch_indirect_string): If the string retrieved from the section
++       is not NUL terminated, return an error message.
++       (fetch_indirect_line_string): Likewise.
++       (fetch_indexed_string): Likewise.
++
+ 2017-02-14  Nick Clifton  <nickc@redhat.com>
+ 
+ 	PR binutils/21157
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8421.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8421.patch
new file mode 100644
index 0000000..7969c66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-8421.patch
@@ -0,0 +1,52 @@
+From 39ff1b79f687b65f4144ddb379f22587003443fb Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Tue, 2 May 2017 11:54:53 +0100
+Subject: [PATCH] Prevent memory exhaustion from a corrupt PE binary with an
+ overlarge number of relocs.
+
+	PR 21440
+	* objdump.c (dump_relocs_in_section): Check for an excessive
+	number of relocs before attempting to dump them.
+
+Upstream-Status: Backport
+CVE: CVE-2017-8421
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ binutils/ChangeLog | 6 ++++++
+ binutils/objdump.c | 8 ++++++++
+ 2 files changed, 14 insertions(+)
+
+Index: git/binutils/objdump.c
+===================================================================
+--- git.orig/binutils/objdump.c
++++ git/binutils/objdump.c
+@@ -3311,6 +3311,14 @@ dump_relocs_in_section (bfd *abfd,
+       return;
+     }
+ 
++  if ((bfd_get_file_flags (abfd) & (BFD_IN_MEMORY | BFD_LINKER_CREATED)) == 0
++      && relsize > get_file_size (bfd_get_filename (abfd)))
++    {
++      printf (" (too many: 0x%x)\n", section->reloc_count);
++      bfd_set_error (bfd_error_file_truncated);
++      bfd_fatal (bfd_get_filename (abfd));
++    }
++
+   relpp = (arelent **) xmalloc (relsize);
+   relcount = bfd_canonicalize_reloc (abfd, section, relpp, syms);
+ 
+Index: git/binutils/ChangeLog
+===================================================================
+--- git.orig/binutils/ChangeLog
++++ git/binutils/ChangeLog
+@@ -1,3 +1,9 @@
++2017-05-02  Nick Clifton  <nickc@redhat.com>
++
++       PR 21440
++       * objdump.c (dump_relocs_in_section): Check for an excessive
++       number of relocs before attempting to dump them.
++
+ 2017-04-28  Nick Clifton  <nickc@redhat.com>
+ 
+        PR binutils/21438
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9038_9044.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9038_9044.patch
new file mode 100644
index 0000000..535efc3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9038_9044.patch
@@ -0,0 +1,51 @@
+From f32ba72991d2406b21ab17edc234a2f3fa7fb23d Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Mon, 3 Apr 2017 11:01:45 +0100
+Subject: [PATCH] readelf: Update check for invalid word offsets in ARM unwind
+ information.
+
+	PR binutils/21343
+	* readelf.c (get_unwind_section_word): Fix snafu checking for
+	invalid word offsets in ARM unwind information.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9038
+CVE: CVE-2017-9044
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ binutils/ChangeLog | 6 ++++++
+ binutils/readelf.c | 6 +++---
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+Index: git/binutils/readelf.c
+===================================================================
+--- git.orig/binutils/readelf.c
++++ git/binutils/readelf.c
+@@ -7972,9 +7972,9 @@ get_unwind_section_word (struct arm_unw_
+     return FALSE;
+ 
+   /* If the offset is invalid then fail.  */
+-  if (word_offset > (sec->sh_size - 4)
+-      /* PR 18879 */
+-      || (sec->sh_size < 5 && word_offset >= sec->sh_size)
++  if (/* PR 21343 *//* PR 18879 */
++      sec->sh_size < 4
++      || word_offset > (sec->sh_size - 4)
+       || ((bfd_signed_vma) word_offset) < 0)
+     return FALSE;
+ 
+Index: git/binutils/ChangeLog
+===================================================================
+--- git.orig/binutils/ChangeLog
++++ git/binutils/ChangeLog
+@@ -1,3 +1,9 @@
++2017-04-03  Nick Clifton  <nickc@redhat.com>
++
++       PR binutils/21343
++       * readelf.c (get_unwind_section_word): Fix snafu checking for
++       invalid word offsets in ARM unwind information.
++
+ 2017-05-02  Nick Clifton  <nickc@redhat.com>
+ 
+        PR 21440
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9039.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9039.patch
new file mode 100644
index 0000000..aed8f7f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9039.patch
@@ -0,0 +1,61 @@
+From 82156ab704b08b124d319c0decdbd48b3ca2dac5 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Mon, 3 Apr 2017 12:14:06 +0100
+Subject: [PATCH] readelf: Fix overlarge memory allocation when reading a
+ binary with an excessive number of program headers.
+
+	PR binutils/21345
+	* readelf.c (get_program_headers): Check for there being too many
+	program headers before attempting to allocate space for them.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9039
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ binutils/ChangeLog |  6 ++++++
+ binutils/readelf.c | 17 ++++++++++++++---
+ 2 files changed, 20 insertions(+), 3 deletions(-)
+
+Index: git/binutils/readelf.c
+===================================================================
+--- git.orig/binutils/readelf.c
++++ git/binutils/readelf.c
+@@ -4765,9 +4765,19 @@ get_program_headers (FILE * file)
+   if (program_headers != NULL)
+     return 1;
+ 
+-  phdrs = (Elf_Internal_Phdr *) cmalloc (elf_header.e_phnum,
+-                                         sizeof (Elf_Internal_Phdr));
++  /* Be kind to memory checkers by looking for
++     e_phnum values which we know must be invalid.  */
++  if (elf_header.e_phnum
++      * (is_32bit_elf ? sizeof (Elf32_External_Phdr) : sizeof (Elf64_External_Phdr))
++      >= current_file_size)
++    {
++      error (_("Too many program headers - %#x - the file is not that big\n"),
++	     elf_header.e_phnum);
++      return FALSE;
++    }
+ 
++  phdrs = (Elf_Internal_Phdr *) cmalloc (elf_header.e_phnum,
++					 sizeof (Elf_Internal_Phdr));
+   if (phdrs == NULL)
+     {
+       error (_("Out of memory reading %u program headers\n"),
+Index: git/binutils/ChangeLog
+===================================================================
+--- git.orig/binutils/ChangeLog
++++ git/binutils/ChangeLog
+@@ -1,5 +1,11 @@
+ 2017-04-03  Nick Clifton  <nickc@redhat.com>
+ 
++       PR binutils/21345
++       * readelf.c (get_program_headers): Check for there being too many
++       program headers before attempting to allocate space for them.
++
++2017-04-03  Nick Clifton  <nickc@redhat.com>
++
+        PR binutils/21343
+        * readelf.c (get_unwind_section_word): Fix snafu checking for
+        invalid word offsets in ARM unwind information.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9040_9042.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9040_9042.patch
new file mode 100644
index 0000000..79c6a7d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9040_9042.patch
@@ -0,0 +1,57 @@
+From 7296a62a2a237f6b1ad8db8c38b090e9f592c8cf Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Thu, 13 Apr 2017 16:06:30 +0100
+Subject: [PATCH] readelf: fix out of range subtraction, seg fault from a NULL
+ pointer and memory exhaustion, all from parsing corrupt binaries.
+
+	PR binutils/21379
+	* readelf.c (process_dynamic_section): Detect over large section
+	offsets in the DT_SYMTAB entry.
+
+	PR binutils/21345
+	* readelf.c (process_mips_specific): Catch an unfeasible memory
+	allocation before it happens and print a suitable error message.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9040
+CVE: CVE-2017-9042
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ binutils/ChangeLog | 12 ++++++++++++
+ binutils/readelf.c | 26 +++++++++++++++++++++-----
+ 2 files changed, 33 insertions(+), 5 deletions(-)
+
+Index: git/binutils/readelf.c
+===================================================================
+--- git.orig/binutils/readelf.c
++++ git/binutils/readelf.c
+@@ -9306,6 +9306,12 @@ process_dynamic_section (FILE * file)
+ 	     processing that.  This is overkill, I know, but it
+ 	     should work.  */
+ 	  section.sh_offset = offset_from_vma (file, entry->d_un.d_val, 0);
++	  if ((bfd_size_type) section.sh_offset > current_file_size)
++	    {
++	      /* See PR 21379 for a reproducer.  */
++	      error (_("Invalid DT_SYMTAB entry: %lx"), (long) section.sh_offset);
++	      return FALSE;
++	    }
+ 
+ 	  if (archive_file_offset != 0)
+ 	    section.sh_size = archive_file_size - section.sh_offset;
+@@ -15175,6 +15181,15 @@ process_mips_specific (FILE * file)
+ 	  return 0;
+ 	}
+ 
++      /* PR 21345 - print a slightly more helpful error message
++	 if we are sure that the cmalloc will fail.  */
++      if (conflictsno * sizeof (* iconf) > current_file_size)
++	{
++	  error (_("Overlarge number of conflicts detected: %lx\n"),
++		 (long) conflictsno);
++	  return FALSE;
++	}
++
+       iconf = (Elf32_Conflict *) cmalloc (conflictsno, sizeof (* iconf));
+       if (iconf == NULL)
+ 	{
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9742.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9742.patch
new file mode 100644
index 0000000..0c9ed0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9742.patch
@@ -0,0 +1,45 @@
+From e64519d1ed7fd8f990f05a5562d5b5c0c44b7d7e Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Wed, 14 Jun 2017 17:10:28 +0100
+Subject: [PATCH] Fix seg-fault when trying to disassemble a corrupt score
+ binary.
+
+	PR binutils/21576
+	* score7-dis.c (score_opcodes): Add sentinel.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9742
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ opcodes/ChangeLog    | 5 +++++
+ opcodes/score7-dis.c | 3 ++-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+Index: git/opcodes/score7-dis.c
+===================================================================
+--- git.orig/opcodes/score7-dis.c
++++ git/opcodes/score7-dis.c
+@@ -513,7 +513,8 @@ static struct score_opcode score_opcodes
+   {0x00000d05, 0x00007f0f, "tvc!"},
+   {0x00000026, 0x3e0003ff, "xor\t\t%20-24r, %15-19r, %10-14r"},
+   {0x00000027, 0x3e0003ff, "xor.c\t\t%20-24r, %15-19r, %10-14r"},
+-  {0x00002007, 0x0000700f, "xor!\t\t%8-11r, %4-7r"}
++  {0x00002007, 0x0000700f, "xor!\t\t%8-11r, %4-7r"},
++  { 0, 0, NULL }
+ };
+ 
+ typedef struct
+Index: git/opcodes/ChangeLog
+===================================================================
+--- git.orig/opcodes/ChangeLog
++++ git/opcodes/ChangeLog
+@@ -1,3 +1,8 @@
++2017-06-14  Nick Clifton  <nickc@redhat.com>
++
++       PR binutils/21576
++       * score7-dis.c (score_opcodes): Add sentinel.
++
+ 2017-03-07  Alan Modra  <amodra@gmail.com>
+ 
+ 	Apply from master
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9744.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9744.patch
new file mode 100644
index 0000000..c34a5a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9744.patch
@@ -0,0 +1,46 @@
+From f461bbd847f15657f3dd2f317c30c75a7520da1f Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Wed, 14 Jun 2017 17:01:54 +0100
+Subject: [PATCH] Fix address violation bug when disassembling a corrupt SH
+ binary.
+
+	PR binutils/21578
+	* elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
+	flag value.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9744
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog  | 6 ++++++
+ bfd/elf32-sh.c | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+Index: git/bfd/elf32-sh.c
+===================================================================
+--- git.orig/bfd/elf32-sh.c
++++ git/bfd/elf32-sh.c
+@@ -6344,7 +6344,7 @@ sh_elf_set_mach_from_flags (bfd *abfd)
+ {
+   flagword flags = elf_elfheader (abfd)->e_flags & EF_SH_MACH_MASK;
+ 
+-  if (flags >= sizeof(sh_ef_bfd_table))
++  if (flags >= ARRAY_SIZE (sh_ef_bfd_table))
+     return FALSE;
+ 
+   if (sh_ef_bfd_table[flags] == 0)
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,9 @@
++2017-06-14  Nick Clifton  <nickc@redhat.com>
++ 
++       PR binutils/21578
++       * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
++       flag value.
++
+ 2017-04-29  Alan Modra  <amodra@gmail.com>
+ 
+        PR 21432
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9745.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9745.patch
new file mode 100644
index 0000000..0b3885b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9745.patch
@@ -0,0 +1,35 @@
+From 76800cba595efc3fe95a446c2d664e42ae4ee869 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Thu, 15 Jun 2017 12:08:57 +0100
+Subject: [PATCH] Handle EITR records in VMS Alpha binaries with overlarge
+ command length parameters.
+
+	PR binutils/21579
+	* vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9745
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog   |  5 +++++
+ bfd/vms-alpha.c | 16 ++++++++--------
+ 2 files changed, 13 insertions(+), 8 deletions(-)
+
+Index: git/bfd/vms-alpha.c
+===================================================================
+--- git.orig/bfd/vms-alpha.c
++++ git/bfd/vms-alpha.c
+@@ -1741,6 +1741,12 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+       _bfd_hexdump (8, ptr, cmd_length - 4, 0);
+ #endif
+ 
++#if VMS_DEBUG
++      _bfd_vms_debug (4, "etir: %s(%d)\n",
++                      _bfd_vms_etir_name (cmd), cmd);
++      _bfd_hexdump (8, ptr, cmd_length - 4, 0);
++#endif
++
+       switch (cmd)
+         {
+           /* Stack global
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9746.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9746.patch
new file mode 100644
index 0000000..bd4a40c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9746.patch
@@ -0,0 +1,91 @@
+From ae87f7e73eba29bd38b3a9684a10b948ed715612 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Wed, 14 Jun 2017 16:50:03 +0100
+Subject: [PATCH] Fix address violation when disassembling a corrupt binary.
+
+	PR binutils/21580
+binutils * objdump.c (disassemble_bytes): Check for buffer overrun when
+	printing out rae insns.
+
+ld	* testsuite/ld-nds32/diff.d: Adjust expected output.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9746
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ binutils/objdump.c           | 27 +++++++++++++++------------
+ ld/ChangeLog                 |  5 +++++
+ ld/testsuite/ld-nds32/diff.d |  6 +++---
+ 3 files changed, 23 insertions(+), 15 deletions(-)
+
+Index: git/binutils/objdump.c
+===================================================================
+--- git.orig/binutils/objdump.c
++++ git/binutils/objdump.c
+@@ -1855,20 +1855,23 @@ disassemble_bytes (struct disassemble_in
+ 
+ 	      for (j = addr_offset * opb; j < addr_offset * opb + pb; j += bpc)
+ 		{
+-		  int k;
+-
+-		  if (bpc > 1 && inf->display_endian == BFD_ENDIAN_LITTLE)
+-		    {
+-		      for (k = bpc - 1; k >= 0; k--)
+-			printf ("%02x", (unsigned) data[j + k]);
+-		      putchar (' ');
+-		    }
+-		  else
++		  /* PR 21580: Check for a buffer ending early.  */
++		  if (j + bpc <= stop_offset * opb)
+ 		    {
+-		      for (k = 0; k < bpc; k++)
+-			printf ("%02x", (unsigned) data[j + k]);
+-		      putchar (' ');
++		      int k;
++
++		      if (inf->display_endian == BFD_ENDIAN_LITTLE)
++			{
++			  for (k = bpc - 1; k >= 0; k--)
++			    printf ("%02x", (unsigned) data[j + k]);
++			}
++		      else
++			{
++			  for (k = 0; k < bpc; k++)
++			    printf ("%02x", (unsigned) data[j + k]);
++			}
+ 		    }
++		  putchar (' ');
+ 		}
+ 
+ 	      for (; pb < octets_per_line; pb += bpc)
+Index: git/ld/testsuite/ld-nds32/diff.d
+===================================================================
+--- git.orig/ld/testsuite/ld-nds32/diff.d
++++ git/ld/testsuite/ld-nds32/diff.d
+@@ -7,9 +7,9 @@
+ 
+ Disassembly of section .data:
+ 00008000 <WORD> (7e 00 00 00|00 00 00 7e).*
+-00008004 <HALF> (7e 00 7e fe|00 7e 7e fe).*
+-00008006 <BYTE> 7e fe 00 fe.*
+-00008007 <ULEB128> fe 00.*
++00008004 <HALF> (7e 00|00 7e).*
++00008006 <BYTE> 7e.*
++00008007 <ULEB128> fe.*
+ 	...
+ 00008009 <ULEB128_2> fe 00.*
+ .*
+Index: git/ld/ChangeLog
+===================================================================
+--- git.orig/ld/ChangeLog
++++ git/ld/ChangeLog
+@@ -1,3 +1,8 @@
++2017-06-14  Nick Clifton  <nickc@redhat.com>
++
++       PR binutils/21580
++       * testsuite/ld-nds32/diff.d: Adjust expected output.
++
+ 2017-03-07  Alan Modra  <amodra@gmail.com>
+ 
+ 	* ldlang.c (open_input_bfds): Check that lang_assignment_statement
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9747.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9747.patch
new file mode 100644
index 0000000..41ead54
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9747.patch
@@ -0,0 +1,43 @@
+From 62b76e4b6e0b4cb5b3e0053d1de4097b32577049 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Thu, 15 Jun 2017 13:08:47 +0100
+Subject: [PATCH] Fix address violation parsing a corrupt ieee binary.
+
+	PR binutils/21581
+	(ieee_archive_p): Use a static buffer to avoid compiler bugs.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9747
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog | 2 ++
+ bfd/ieee.c    | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+Index: git/bfd/ieee.c
+===================================================================
+--- git.orig/bfd/ieee.c
++++ git/bfd/ieee.c
+@@ -1357,7 +1357,7 @@ ieee_archive_p (bfd *abfd)
+ {
+   char *library;
+   unsigned int i;
+-  unsigned char buffer[512];
++  static unsigned char buffer[512];
+   file_ptr buffer_offset = 0;
+   ieee_ar_data_type *save = abfd->tdata.ieee_ar_data;
+   ieee_ar_data_type *ieee;
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,8 @@
++2017-06-15  Nick Clifton  <nickc@redhat.com>
++
++       PR binutils/21581
++       (ieee_archive_p): Likewise.
++
+ 2017-06-14  Nick Clifton  <nickc@redhat.com>
+  
+        PR binutils/21578
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9748.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9748.patch
new file mode 100644
index 0000000..0207023
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9748.patch
@@ -0,0 +1,46 @@
+From 63634bb4a107877dd08b6282e28e11cfd1a1649e Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Thu, 15 Jun 2017 12:44:23 +0100
+Subject: [PATCH] Avoid a possible compiler bug by using a static buffer
+ instead of a stack local buffer.
+
+	PR binutils/21582
+	* ieee.c (ieee_object_p): Use a static buffer to avoid compiler
+	bugs.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9748
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog | 6 ++++++
+ bfd/ieee.c    | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+Index: git/bfd/ieee.c
+===================================================================
+--- git.orig/bfd/ieee.c
++++ git/bfd/ieee.c
+@@ -1875,7 +1875,7 @@ ieee_object_p (bfd *abfd)
+   char *processor;
+   unsigned int part;
+   ieee_data_type *ieee;
+-  unsigned char buffer[300];
++  static unsigned char buffer[300];
+   ieee_data_type *save = IEEE_DATA (abfd);
+   bfd_size_type amt;
+ 
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,5 +1,9 @@
+ 2017-06-15  Nick Clifton  <nickc@redhat.com>
+ 
++       PR binutils/21582
++       * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
++       bugs.
++
+        PR binutils/21581
+        (ieee_archive_p): Likewise.
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9749.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9749.patch
new file mode 100644
index 0000000..3cc2afc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9749.patch
@@ -0,0 +1,77 @@
+From 08c7881b814c546efc3996fd1decdf0877f7a779 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Thu, 15 Jun 2017 11:52:02 +0100
+Subject: [PATCH] Prevent invalid array accesses when disassembling a corrupt
+ bfin binary.
+
+	PR binutils/21586
+	* bfin-dis.c (gregs): Clip index to prevent overflow.
+	(regs): Likewise.
+	(regs_lo): Likewise.
+	(regs_hi): Likewise.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9749
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ opcodes/ChangeLog  | 8 ++++++++
+ opcodes/bfin-dis.c | 8 ++++----
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+Index: git/opcodes/ChangeLog
+===================================================================
+--- git.orig/opcodes/ChangeLog
++++ git/opcodes/ChangeLog
+@@ -1,3 +1,11 @@
++2017-06-15  Nick Clifton  <nickc@redhat.com>
++
++	PR binutils/21586
++	* bfin-dis.c (gregs): Clip index to prevent overflow.
++	(regs): Likewise.
++	(regs_lo): Likewise.
++	(regs_hi): Likewise.
++
+ 2017-06-14  Nick Clifton  <nickc@redhat.com>
+ 
+        PR binutils/21576
+Index: git/opcodes/bfin-dis.c
+===================================================================
+--- git.orig/opcodes/bfin-dis.c
++++ git/opcodes/bfin-dis.c
+@@ -350,7 +350,7 @@ static const enum machine_registers deco
+   REG_P0, REG_P1, REG_P2, REG_P3, REG_P4, REG_P5, REG_SP, REG_FP,
+ };
+ 
+-#define gregs(x, i) REGNAME (decode_gregs[((i) << 3) | (x)])
++#define gregs(x, i) REGNAME (decode_gregs[(((i) << 3) | (x)) & 15])
+ 
+ /* [dregs pregs (iregs mregs) (bregs lregs)].  */
+ static const enum machine_registers decode_regs[] =
+@@ -361,7 +361,7 @@ static const enum machine_registers deco
+   REG_B0, REG_B1, REG_B2, REG_B3, REG_L0, REG_L1, REG_L2, REG_L3,
+ };
+ 
+-#define regs(x, i) REGNAME (decode_regs[((i) << 3) | (x)])
++#define regs(x, i) REGNAME (decode_regs[(((i) << 3) | (x)) & 31])
+ 
+ /* [dregs pregs (iregs mregs) (bregs lregs) Low Half].  */
+ static const enum machine_registers decode_regs_lo[] =
+@@ -372,7 +372,7 @@ static const enum machine_registers deco
+   REG_BL0, REG_BL1, REG_BL2, REG_BL3, REG_LL0, REG_LL1, REG_LL2, REG_LL3,
+ };
+ 
+-#define regs_lo(x, i) REGNAME (decode_regs_lo[((i) << 3) | (x)])
++#define regs_lo(x, i) REGNAME (decode_regs_lo[(((i) << 3) | (x)) & 31])
+ 
+ /* [dregs pregs (iregs mregs) (bregs lregs) High Half].  */
+ static const enum machine_registers decode_regs_hi[] =
+@@ -383,7 +383,7 @@ static const enum machine_registers deco
+   REG_BH0, REG_BH1, REG_BH2, REG_BH3, REG_LH0, REG_LH1, REG_LH2, REG_LH3,
+ };
+ 
+-#define regs_hi(x, i) REGNAME (decode_regs_hi[((i) << 3) | (x)])
++#define regs_hi(x, i) REGNAME (decode_regs_hi[(((i) << 3) | (x)) & 31])
+ 
+ static const enum machine_registers decode_statbits[] =
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9750.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9750.patch
new file mode 100644
index 0000000..fe8fa69
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9750.patch
@@ -0,0 +1,247 @@
+From db5fa770268baf8cc82cf9b141d69799fd485fe2 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Wed, 14 Jun 2017 13:35:06 +0100
+Subject: [PATCH] Fix address violation problems when disassembling a corrupt
+ RX binary.
+
+	PR binutils/21587
+	* rx-decode.opc: Include libiberty.h
+	(GET_SCALE): New macro - validates access to SCALE array.
+	(GET_PSCALE): New macro - validates access to PSCALE array.
+	(DIs, SIs, S2Is, rx_disp): Use new macros.
+	* rx-decode.c: Regenerate.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9750
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ opcodes/ChangeLog     |  9 +++++++++
+ opcodes/rx-decode.c   | 24 ++++++++++++++----------
+ opcodes/rx-decode.opc | 24 ++++++++++++++----------
+ 3 files changed, 37 insertions(+), 20 deletions(-)
+
+Index: git/opcodes/rx-decode.c
+===================================================================
+--- git.orig/opcodes/rx-decode.c
++++ git/opcodes/rx-decode.c
+@@ -27,6 +27,7 @@
+ #include <string.h>
+ #include "ansidecl.h"
+ #include "opcode/rx.h"
++#include "libiberty.h"
+ 
+ #define RX_OPCODE_BIG_ENDIAN 0
+ 
+@@ -45,7 +46,7 @@ static int trace = 0;
+ #define LSIZE 2
+ 
+ /* These are for when the upper bits are "don't care" or "undefined".  */
+-static int bwl[] =
++static int bwl[4] =
+ {
+   RX_Byte,
+   RX_Word,
+@@ -53,7 +54,7 @@ static int bwl[] =
+   RX_Bad_Size /* Bogus instructions can have a size field set to 3.  */
+ };
+ 
+-static int sbwl[] =
++static int sbwl[4] =
+ {
+   RX_SByte,
+   RX_SWord,
+@@ -61,7 +62,7 @@ static int sbwl[] =
+   RX_Bad_Size /* Bogus instructions can have a size field set to 3.  */
+ };
+ 
+-static int ubw[] =
++static int ubw[4] =
+ {
+   RX_UByte,
+   RX_UWord,
+@@ -69,7 +70,7 @@ static int ubw[] =
+   RX_Bad_Size /* Bogus instructions can have a size field set to 3.  */
+ };
+ 
+-static int memex[] =
++static int memex[4] =
+ {
+   RX_SByte,
+   RX_SWord,
+@@ -89,6 +90,9 @@ static int SCALE[] = { 1, 2, 4, 0 };
+ /* This is for the prefix size enum.  */
+ static int PSCALE[] = { 4, 1, 1, 1, 2, 2, 2, 3, 4 };
+ 
++#define GET_SCALE(_indx)  ((unsigned)(_indx) < ARRAY_SIZE (SCALE) ? SCALE[(_indx)] : 0)
++#define GET_PSCALE(_indx) ((unsigned)(_indx) < ARRAY_SIZE (PSCALE) ? PSCALE[(_indx)] : 0)
++
+ static int flagmap[] = {0, 1, 2, 3, 0, 0, 0, 0,
+ 		       16, 17, 0, 0, 0, 0, 0, 0 };
+ 
+@@ -107,7 +111,7 @@ static int dsp3map[] = { 8, 9, 10, 3, 4,
+ #define DC(c)       OP (0, RX_Operand_Immediate, 0, c)
+ #define DR(r)       OP (0, RX_Operand_Register,  r, 0)
+ #define DI(r,a)     OP (0, RX_Operand_Indirect,  r, a)
+-#define DIs(r,a,s)  OP (0, RX_Operand_Indirect,  r, (a) * SCALE[s])
++#define DIs(r,a,s)  OP (0, RX_Operand_Indirect,  r, (a) * GET_SCALE (s))
+ #define DD(t,r,s)   rx_disp (0, t, r, bwl[s], ld);
+ #define DF(r)       OP (0, RX_Operand_Flag,  flagmap[r], 0)
+ 
+@@ -115,7 +119,7 @@ static int dsp3map[] = { 8, 9, 10, 3, 4,
+ #define SR(r)       OP (1, RX_Operand_Register,  r, 0)
+ #define SRR(r)      OP (1, RX_Operand_TwoReg,  r, 0)
+ #define SI(r,a)     OP (1, RX_Operand_Indirect,  r, a)
+-#define SIs(r,a,s)  OP (1, RX_Operand_Indirect,  r, (a) * SCALE[s])
++#define SIs(r,a,s)  OP (1, RX_Operand_Indirect,  r, (a) * GET_SCALE (s))
+ #define SD(t,r,s)   rx_disp (1, t, r, bwl[s], ld);
+ #define SP(t,r)     rx_disp (1, t, r, (t!=3) ? RX_UByte : RX_Long, ld); P(t, 1);
+ #define SPm(t,r,m)  rx_disp (1, t, r, memex[m], ld); rx->op[1].size = memex[m];
+@@ -124,7 +128,7 @@ static int dsp3map[] = { 8, 9, 10, 3, 4,
+ #define S2C(i)      OP (2, RX_Operand_Immediate, 0, i)
+ #define S2R(r)      OP (2, RX_Operand_Register,  r, 0)
+ #define S2I(r,a)    OP (2, RX_Operand_Indirect,  r, a)
+-#define S2Is(r,a,s) OP (2, RX_Operand_Indirect,  r, (a) * SCALE[s])
++#define S2Is(r,a,s) OP (2, RX_Operand_Indirect,  r, (a) * GET_SCALE (s))
+ #define S2D(t,r,s)  rx_disp (2, t, r, bwl[s], ld);
+ #define S2P(t,r)    rx_disp (2, t, r, (t!=3) ? RX_UByte : RX_Long, ld); P(t, 2);
+ #define S2Pm(t,r,m) rx_disp (2, t, r, memex[m], ld); rx->op[2].size = memex[m];
+@@ -211,7 +215,7 @@ immediate (int sfield, int ex, LocalData
+ }
+ 
+ static void
+-rx_disp (int n, int type, int reg, int size, LocalData * ld)
++rx_disp (int n, int type, int reg, unsigned int size, LocalData * ld)
+ {
+   int disp;
+ 
+@@ -228,7 +232,7 @@ rx_disp (int n, int type, int reg, int s
+     case 1:
+       ld->rx->op[n].type = RX_Operand_Indirect;
+       disp = GETBYTE ();
+-      ld->rx->op[n].addend = disp * PSCALE[size];
++      ld->rx->op[n].addend = disp * GET_PSCALE (size);
+       break;
+     case 2:
+       ld->rx->op[n].type = RX_Operand_Indirect;
+@@ -238,7 +242,7 @@ rx_disp (int n, int type, int reg, int s
+ #else
+       disp = disp + GETBYTE () * 256;
+ #endif
+-      ld->rx->op[n].addend = disp * PSCALE[size];
++      ld->rx->op[n].addend = disp * GET_PSCALE (size);
+       break;
+     default:
+       abort ();
+Index: git/opcodes/rx-decode.opc
+===================================================================
+--- git.orig/opcodes/rx-decode.opc
++++ git/opcodes/rx-decode.opc
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include "ansidecl.h"
+ #include "opcode/rx.h"
++#include "libiberty.h"
+ 
+ #define RX_OPCODE_BIG_ENDIAN 0
+ 
+@@ -44,7 +45,7 @@ static int trace = 0;
+ #define LSIZE 2
+ 
+ /* These are for when the upper bits are "don't care" or "undefined".  */
+-static int bwl[] =
++static int bwl[4] =
+ {
+   RX_Byte,
+   RX_Word,
+@@ -52,7 +53,7 @@ static int bwl[] =
+   RX_Bad_Size /* Bogus instructions can have a size field set to 3.  */
+ };
+ 
+-static int sbwl[] =
++static int sbwl[4] =
+ {
+   RX_SByte,
+   RX_SWord,
+@@ -60,7 +61,7 @@ static int sbwl[] =
+   RX_Bad_Size /* Bogus instructions can have a size field set to 3.  */
+ };
+ 
+-static int ubw[] =
++static int ubw[4] =
+ {
+   RX_UByte,
+   RX_UWord,
+@@ -68,7 +69,7 @@ static int ubw[] =
+   RX_Bad_Size /* Bogus instructions can have a size field set to 3.  */
+ };
+ 
+-static int memex[] =
++static int memex[4] =
+ {
+   RX_SByte,
+   RX_SWord,
+@@ -88,6 +89,9 @@ static int SCALE[] = { 1, 2, 4, 0 };
+ /* This is for the prefix size enum.  */
+ static int PSCALE[] = { 4, 1, 1, 1, 2, 2, 2, 3, 4 };
+ 
++#define GET_SCALE(_indx)  ((unsigned)(_indx) < ARRAY_SIZE (SCALE) ? SCALE[(_indx)] : 0)
++#define GET_PSCALE(_indx) ((unsigned)(_indx) < ARRAY_SIZE (PSCALE) ? PSCALE[(_indx)] : 0)
++
+ static int flagmap[] = {0, 1, 2, 3, 0, 0, 0, 0,
+ 		       16, 17, 0, 0, 0, 0, 0, 0 };
+ 
+@@ -106,7 +110,7 @@ static int dsp3map[] = { 8, 9, 10, 3, 4,
+ #define DC(c)       OP (0, RX_Operand_Immediate, 0, c)
+ #define DR(r)       OP (0, RX_Operand_Register,  r, 0)
+ #define DI(r,a)     OP (0, RX_Operand_Indirect,  r, a)
+-#define DIs(r,a,s)  OP (0, RX_Operand_Indirect,  r, (a) * SCALE[s])
++#define DIs(r,a,s)  OP (0, RX_Operand_Indirect,  r, (a) * GET_SCALE (s))
+ #define DD(t,r,s)   rx_disp (0, t, r, bwl[s], ld);
+ #define DF(r)       OP (0, RX_Operand_Flag,  flagmap[r], 0)
+ 
+@@ -114,7 +118,7 @@ static int dsp3map[] = { 8, 9, 10, 3, 4,
+ #define SR(r)       OP (1, RX_Operand_Register,  r, 0)
+ #define SRR(r)      OP (1, RX_Operand_TwoReg,  r, 0)
+ #define SI(r,a)     OP (1, RX_Operand_Indirect,  r, a)
+-#define SIs(r,a,s)  OP (1, RX_Operand_Indirect,  r, (a) * SCALE[s])
++#define SIs(r,a,s)  OP (1, RX_Operand_Indirect,  r, (a) * GET_SCALE (s))
+ #define SD(t,r,s)   rx_disp (1, t, r, bwl[s], ld);
+ #define SP(t,r)     rx_disp (1, t, r, (t!=3) ? RX_UByte : RX_Long, ld); P(t, 1);
+ #define SPm(t,r,m)  rx_disp (1, t, r, memex[m], ld); rx->op[1].size = memex[m];
+@@ -123,7 +127,7 @@ static int dsp3map[] = { 8, 9, 10, 3, 4,
+ #define S2C(i)      OP (2, RX_Operand_Immediate, 0, i)
+ #define S2R(r)      OP (2, RX_Operand_Register,  r, 0)
+ #define S2I(r,a)    OP (2, RX_Operand_Indirect,  r, a)
+-#define S2Is(r,a,s) OP (2, RX_Operand_Indirect,  r, (a) * SCALE[s])
++#define S2Is(r,a,s) OP (2, RX_Operand_Indirect,  r, (a) * GET_SCALE (s))
+ #define S2D(t,r,s)  rx_disp (2, t, r, bwl[s], ld);
+ #define S2P(t,r)    rx_disp (2, t, r, (t!=3) ? RX_UByte : RX_Long, ld); P(t, 2);
+ #define S2Pm(t,r,m) rx_disp (2, t, r, memex[m], ld); rx->op[2].size = memex[m];
+@@ -210,7 +214,7 @@ immediate (int sfield, int ex, LocalData
+ }
+ 
+ static void
+-rx_disp (int n, int type, int reg, int size, LocalData * ld)
++rx_disp (int n, int type, int reg, unsigned int size, LocalData * ld)
+ {
+   int disp;
+ 
+@@ -227,7 +231,7 @@ rx_disp (int n, int type, int reg, int s
+     case 1:
+       ld->rx->op[n].type = RX_Operand_Indirect;
+       disp = GETBYTE ();
+-      ld->rx->op[n].addend = disp * PSCALE[size];
++      ld->rx->op[n].addend = disp * GET_PSCALE (size);
+       break;
+     case 2:
+       ld->rx->op[n].type = RX_Operand_Indirect;
+@@ -237,7 +241,7 @@ rx_disp (int n, int type, int reg, int s
+ #else
+       disp = disp + GETBYTE () * 256;
+ #endif
+-      ld->rx->op[n].addend = disp * PSCALE[size];
++      ld->rx->op[n].addend = disp * GET_PSCALE (size);
+       break;
+     default:
+       abort ();
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9751.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9751.patch
new file mode 100644
index 0000000..d7c18cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9751.patch
@@ -0,0 +1,3748 @@
+From 63323b5b23bd83fa7b04ea00dff593c933e9b0e3 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Thu, 15 Jun 2017 12:37:01 +0100
+Subject: [PATCH] Fix address violation when disassembling a corrupt RL78
+ binary.
+
+	PR binutils/21588
+	* rl78-decode.opc (OP_BUF_LEN): Define.
+	(GETBYTE): Check for the index exceeding OP_BUF_LEN.
+	(rl78_decode_opcode): Use OP_BUF_LEN as the length of the op_buf
+	array.
+	* rl78-decode.c: Regenerate.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9751
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ opcodes/ChangeLog       |   9 +
+ opcodes/rl78-decode.c   | 820 ++++++++++++++++++++++++------------------------
+ opcodes/rl78-decode.opc |   6 +-
+ 3 files changed, 424 insertions(+), 411 deletions(-)
+
+diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
+index 34b1844..c77f00a 100644
+--- a/opcodes/ChangeLog
++++ b/opcodes/ChangeLog
+@@ -1,5 +1,14 @@
+ 2017-06-15  Nick Clifton  <nickc@redhat.com>
+ 
++	PR binutils/21588
++	* rl78-decode.opc (OP_BUF_LEN): Define.
++	(GETBYTE): Check for the index exceeding OP_BUF_LEN.
++	(rl78_decode_opcode): Use OP_BUF_LEN as the length of the op_buf
++	array.
++	* rl78-decode.c: Regenerate.
++
++2017-06-15  Nick Clifton  <nickc@redhat.com>
++
+ 	PR binutils/21586
+ 	* bfin-dis.c (gregs): Clip index to prevent overflow.
+ 	(regs): Likewise.
+diff --git a/opcodes/rl78-decode.c b/opcodes/rl78-decode.c
+index d0566ea..b2d4bd6 100644
+--- a/opcodes/rl78-decode.c
++++ b/opcodes/rl78-decode.c
+@@ -51,7 +51,9 @@ typedef struct
+ #define W() rl78->size = RL78_Word
+ 
+ #define AU ATTRIBUTE_UNUSED
+-#define GETBYTE() (ld->op [ld->rl78->n_bytes++] = ld->getbyte (ld->ptr))
++
++#define OP_BUF_LEN 20
++#define GETBYTE() (ld->rl78->n_bytes < (OP_BUF_LEN - 1) ? ld->op [ld->rl78->n_bytes++] = ld->getbyte (ld->ptr): 0)
+ #define B ((unsigned long) GETBYTE())
+ 
+ #define SYNTAX(x) rl78->syntax = x
+@@ -169,7 +171,7 @@ rl78_decode_opcode (unsigned long pc AU,
+ 		  RL78_Dis_Isa isa)
+ {
+   LocalData lds, * ld = &lds;
+-  unsigned char op_buf[20] = {0};
++  unsigned char op_buf[OP_BUF_LEN] = {0};
+   unsigned char *op = op_buf;
+   int op0, op1;
+ 
+@@ -201,7 +203,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("nop");
+-#line 911 "rl78-decode.opc"
++#line 913 "rl78-decode.opc"
+           ID(nop);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -214,7 +216,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x07:
+         {
+           /** 0000 0rw1			addw	%0, %1				*/
+-#line 274 "rl78-decode.opc"
++#line 276 "rl78-decode.opc"
+           int rw AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -224,7 +226,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rw = 0x%x\n", rw);
+             }
+           SYNTAX("addw	%0, %1");
+-#line 274 "rl78-decode.opc"
++#line 276 "rl78-decode.opc"
+           ID(add); W(); DR(AX); SRW(rw); Fzac;
+ 
+         }
+@@ -239,7 +241,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("addw	%0, %e!1");
+-#line 265 "rl78-decode.opc"
++#line 267 "rl78-decode.opc"
+           ID(add); W(); DR(AX); SM(None, IMMU(2)); Fzac;
+ 
+         }
+@@ -254,7 +256,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("addw	%0, #%1");
+-#line 271 "rl78-decode.opc"
++#line 273 "rl78-decode.opc"
+           ID(add); W(); DR(AX); SC(IMMU(2)); Fzac;
+ 
+         }
+@@ -269,7 +271,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("addw	%0, %1");
+-#line 277 "rl78-decode.opc"
++#line 279 "rl78-decode.opc"
+           ID(add); W(); DR(AX); SM(None, SADDR); Fzac;
+ 
+         }
+@@ -284,7 +286,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("xch	a, x");
+-#line 1234 "rl78-decode.opc"
++#line 1236 "rl78-decode.opc"
+           ID(xch); DR(A); SR(X);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -301,7 +303,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %e1");
+-#line 678 "rl78-decode.opc"
++#line 680 "rl78-decode.opc"
+           ID(mov); DR(A); SM(B, IMMU(2));
+ 
+         }
+@@ -316,7 +318,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("add	%0, #%1");
+-#line 228 "rl78-decode.opc"
++#line 230 "rl78-decode.opc"
+           ID(add); DM(None, SADDR); SC(IMMU(1)); Fzac;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -333,7 +335,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("add	%0, %1");
+-#line 222 "rl78-decode.opc"
++#line 224 "rl78-decode.opc"
+           ID(add); DR(A); SM(None, SADDR); Fzac;
+ 
+         }
+@@ -348,7 +350,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("add	%0, #%1");
+-#line 216 "rl78-decode.opc"
++#line 218 "rl78-decode.opc"
+           ID(add); DR(A); SC(IMMU(1)); Fzac;
+ 
+         }
+@@ -363,7 +365,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("add	%0, %e1");
+-#line 204 "rl78-decode.opc"
++#line 206 "rl78-decode.opc"
+           ID(add); DR(A); SM(HL, 0); Fzac;
+ 
+         }
+@@ -378,7 +380,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("add	%0, %ea1");
+-#line 210 "rl78-decode.opc"
++#line 212 "rl78-decode.opc"
+           ID(add); DR(A); SM(HL, IMMU(1)); Fzac;
+ 
+         }
+@@ -393,7 +395,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("add	%0, %e!1");
+-#line 201 "rl78-decode.opc"
++#line 203 "rl78-decode.opc"
+           ID(add); DR(A); SM(None, IMMU(2)); Fzac;
+ 
+         }
+@@ -408,7 +410,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("addw	%0, #%1");
+-#line 280 "rl78-decode.opc"
++#line 282 "rl78-decode.opc"
+           ID(add); W(); DR(SP); SC(IMMU(1)); Fzac;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -425,7 +427,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("es:");
+-#line 193 "rl78-decode.opc"
++#line 195 "rl78-decode.opc"
+           DE(); SE();
+           op ++;
+           pc ++;
+@@ -440,7 +442,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x16:
+         {
+           /** 0001 0ra0			movw	%0, %1				*/
+-#line 859 "rl78-decode.opc"
++#line 861 "rl78-decode.opc"
+           int ra AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -450,7 +452,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  ra = 0x%x\n", ra);
+             }
+           SYNTAX("movw	%0, %1");
+-#line 859 "rl78-decode.opc"
++#line 861 "rl78-decode.opc"
+           ID(mov); W(); DRW(ra); SR(AX);
+ 
+         }
+@@ -460,7 +462,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x17:
+         {
+           /** 0001 0ra1			movw	%0, %1				*/
+-#line 856 "rl78-decode.opc"
++#line 858 "rl78-decode.opc"
+           int ra AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -470,7 +472,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  ra = 0x%x\n", ra);
+             }
+           SYNTAX("movw	%0, %1");
+-#line 856 "rl78-decode.opc"
++#line 858 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SRW(ra);
+ 
+         }
+@@ -485,7 +487,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%e0, %1");
+-#line 729 "rl78-decode.opc"
++#line 731 "rl78-decode.opc"
+           ID(mov); DM(B, IMMU(2)); SR(A);
+ 
+         }
+@@ -500,7 +502,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%e0, #%1");
+-#line 726 "rl78-decode.opc"
++#line 728 "rl78-decode.opc"
+           ID(mov); DM(B, IMMU(2)); SC(IMMU(1));
+ 
+         }
+@@ -515,7 +517,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("addc	%0, #%1");
+-#line 260 "rl78-decode.opc"
++#line 262 "rl78-decode.opc"
+           ID(addc); DM(None, SADDR); SC(IMMU(1)); Fzac;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -532,7 +534,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("addc	%0, %1");
+-#line 257 "rl78-decode.opc"
++#line 259 "rl78-decode.opc"
+           ID(addc); DR(A); SM(None, SADDR); Fzac;
+ 
+         }
+@@ -547,7 +549,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("addc	%0, #%1");
+-#line 248 "rl78-decode.opc"
++#line 250 "rl78-decode.opc"
+           ID(addc); DR(A); SC(IMMU(1)); Fzac;
+ 
+         }
+@@ -562,7 +564,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("addc	%0, %e1");
+-#line 236 "rl78-decode.opc"
++#line 238 "rl78-decode.opc"
+           ID(addc); DR(A); SM(HL, 0); Fzac;
+ 
+         }
+@@ -577,7 +579,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("addc	%0, %ea1");
+-#line 245 "rl78-decode.opc"
++#line 247 "rl78-decode.opc"
+           ID(addc); DR(A); SM(HL, IMMU(1)); Fzac;
+ 
+         }
+@@ -592,7 +594,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("addc	%0, %e!1");
+-#line 233 "rl78-decode.opc"
++#line 235 "rl78-decode.opc"
+           ID(addc); DR(A); SM(None, IMMU(2)); Fzac;
+ 
+         }
+@@ -607,7 +609,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("subw	%0, #%1");
+-#line 1198 "rl78-decode.opc"
++#line 1200 "rl78-decode.opc"
+           ID(sub); W(); DR(SP); SC(IMMU(1)); Fzac;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -620,7 +622,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x27:
+         {
+           /** 0010 0rw1			subw	%0, %1				*/
+-#line 1192 "rl78-decode.opc"
++#line 1194 "rl78-decode.opc"
+           int rw AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -630,7 +632,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rw = 0x%x\n", rw);
+             }
+           SYNTAX("subw	%0, %1");
+-#line 1192 "rl78-decode.opc"
++#line 1194 "rl78-decode.opc"
+           ID(sub); W(); DR(AX); SRW(rw); Fzac;
+ 
+         }
+@@ -645,7 +647,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("subw	%0, %e!1");
+-#line 1183 "rl78-decode.opc"
++#line 1185 "rl78-decode.opc"
+           ID(sub); W(); DR(AX); SM(None, IMMU(2)); Fzac;
+ 
+         }
+@@ -660,7 +662,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("subw	%0, #%1");
+-#line 1189 "rl78-decode.opc"
++#line 1191 "rl78-decode.opc"
+           ID(sub); W(); DR(AX); SC(IMMU(2)); Fzac;
+ 
+         }
+@@ -675,7 +677,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("subw	%0, %1");
+-#line 1195 "rl78-decode.opc"
++#line 1197 "rl78-decode.opc"
+           ID(sub); W(); DR(AX); SM(None, SADDR); Fzac;
+ 
+         }
+@@ -690,7 +692,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%e0, %1");
+-#line 741 "rl78-decode.opc"
++#line 743 "rl78-decode.opc"
+           ID(mov); DM(C, IMMU(2)); SR(A);
+ 
+         }
+@@ -705,7 +707,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %e1");
+-#line 684 "rl78-decode.opc"
++#line 686 "rl78-decode.opc"
+           ID(mov); DR(A); SM(C, IMMU(2));
+ 
+         }
+@@ -720,7 +722,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("sub	%0, #%1");
+-#line 1146 "rl78-decode.opc"
++#line 1148 "rl78-decode.opc"
+           ID(sub); DM(None, SADDR); SC(IMMU(1)); Fzac;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -737,7 +739,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("sub	%0, %1");
+-#line 1140 "rl78-decode.opc"
++#line 1142 "rl78-decode.opc"
+           ID(sub); DR(A); SM(None, SADDR); Fzac;
+ 
+         }
+@@ -752,7 +754,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("sub	%0, #%1");
+-#line 1134 "rl78-decode.opc"
++#line 1136 "rl78-decode.opc"
+           ID(sub); DR(A); SC(IMMU(1)); Fzac;
+ 
+         }
+@@ -767,7 +769,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("sub	%0, %e1");
+-#line 1122 "rl78-decode.opc"
++#line 1124 "rl78-decode.opc"
+           ID(sub); DR(A); SM(HL, 0); Fzac;
+ 
+         }
+@@ -782,7 +784,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("sub	%0, %ea1");
+-#line 1128 "rl78-decode.opc"
++#line 1130 "rl78-decode.opc"
+           ID(sub); DR(A); SM(HL, IMMU(1)); Fzac;
+ 
+         }
+@@ -797,7 +799,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("sub	%0, %e!1");
+-#line 1119 "rl78-decode.opc"
++#line 1121 "rl78-decode.opc"
+           ID(sub); DR(A); SM(None, IMMU(2)); Fzac;
+ 
+         }
+@@ -808,7 +810,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x36:
+         {
+           /** 0011 0rg0			movw	%0, #%1				*/
+-#line 853 "rl78-decode.opc"
++#line 855 "rl78-decode.opc"
+           int rg AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -818,7 +820,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rg = 0x%x\n", rg);
+             }
+           SYNTAX("movw	%0, #%1");
+-#line 853 "rl78-decode.opc"
++#line 855 "rl78-decode.opc"
+           ID(mov); W(); DRW(rg); SC(IMMU(2));
+ 
+         }
+@@ -830,7 +832,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x00:
+               {
+                 /** 0011 0001 0bit 0000		btclr	%s1, $%a0			*/
+-#line 416 "rl78-decode.opc"
++#line 418 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -840,7 +842,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("btclr	%s1, $%a0");
+-#line 416 "rl78-decode.opc"
++#line 418 "rl78-decode.opc"
+                 ID(branch_cond_clear); SM(None, SADDR); SB(bit); DC(pc+IMMS(1)+4); COND(T);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -850,7 +852,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x01:
+               {
+                 /** 0011 0001 0bit 0001		btclr	%1, $%a0			*/
+-#line 410 "rl78-decode.opc"
++#line 412 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -860,7 +862,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("btclr	%1, $%a0");
+-#line 410 "rl78-decode.opc"
++#line 412 "rl78-decode.opc"
+                 ID(branch_cond_clear); DC(pc+IMMS(1)+3); SR(A); SB(bit); COND(T);
+ 
+               }
+@@ -868,7 +870,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x02:
+               {
+                 /** 0011 0001 0bit 0010		bt	%s1, $%a0			*/
+-#line 402 "rl78-decode.opc"
++#line 404 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -878,7 +880,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("bt	%s1, $%a0");
+-#line 402 "rl78-decode.opc"
++#line 404 "rl78-decode.opc"
+                 ID(branch_cond); SM(None, SADDR); SB(bit); DC(pc+IMMS(1)+4); COND(T);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -888,7 +890,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x03:
+               {
+                 /** 0011 0001 0bit 0011		bt	%1, $%a0			*/
+-#line 396 "rl78-decode.opc"
++#line 398 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -898,7 +900,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("bt	%1, $%a0");
+-#line 396 "rl78-decode.opc"
++#line 398 "rl78-decode.opc"
+                 ID(branch_cond); DC(pc+IMMS(1)+3); SR(A); SB(bit); COND(T);
+ 
+               }
+@@ -906,7 +908,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x04:
+               {
+                 /** 0011 0001 0bit 0100		bf	%s1, $%a0			*/
+-#line 363 "rl78-decode.opc"
++#line 365 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -916,7 +918,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("bf	%s1, $%a0");
+-#line 363 "rl78-decode.opc"
++#line 365 "rl78-decode.opc"
+                 ID(branch_cond); SM(None, SADDR); SB(bit); DC(pc+IMMS(1)+4); COND(F);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -926,7 +928,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x05:
+               {
+                 /** 0011 0001 0bit 0101		bf	%1, $%a0			*/
+-#line 357 "rl78-decode.opc"
++#line 359 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -936,7 +938,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("bf	%1, $%a0");
+-#line 357 "rl78-decode.opc"
++#line 359 "rl78-decode.opc"
+                 ID(branch_cond); DC(pc+IMMS(1)+3); SR(A); SB(bit); COND(F);
+ 
+               }
+@@ -944,7 +946,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x07:
+               {
+                 /** 0011 0001 0cnt 0111		shl	%0, %1				*/
+-#line 1075 "rl78-decode.opc"
++#line 1077 "rl78-decode.opc"
+                 int cnt AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -954,7 +956,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  cnt = 0x%x\n", cnt);
+                   }
+                 SYNTAX("shl	%0, %1");
+-#line 1075 "rl78-decode.opc"
++#line 1077 "rl78-decode.opc"
+                 ID(shl); DR(C); SC(cnt);
+ 
+               }
+@@ -962,7 +964,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x08:
+               {
+                 /** 0011 0001 0cnt 1000		shl	%0, %1				*/
+-#line 1072 "rl78-decode.opc"
++#line 1074 "rl78-decode.opc"
+                 int cnt AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -972,7 +974,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  cnt = 0x%x\n", cnt);
+                   }
+                 SYNTAX("shl	%0, %1");
+-#line 1072 "rl78-decode.opc"
++#line 1074 "rl78-decode.opc"
+                 ID(shl); DR(B); SC(cnt);
+ 
+               }
+@@ -980,7 +982,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x09:
+               {
+                 /** 0011 0001 0cnt 1001		shl	%0, %1				*/
+-#line 1069 "rl78-decode.opc"
++#line 1071 "rl78-decode.opc"
+                 int cnt AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -990,7 +992,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  cnt = 0x%x\n", cnt);
+                   }
+                 SYNTAX("shl	%0, %1");
+-#line 1069 "rl78-decode.opc"
++#line 1071 "rl78-decode.opc"
+                 ID(shl); DR(A); SC(cnt);
+ 
+               }
+@@ -998,7 +1000,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x0a:
+               {
+                 /** 0011 0001 0cnt 1010		shr	%0, %1				*/
+-#line 1086 "rl78-decode.opc"
++#line 1088 "rl78-decode.opc"
+                 int cnt AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -1008,7 +1010,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  cnt = 0x%x\n", cnt);
+                   }
+                 SYNTAX("shr	%0, %1");
+-#line 1086 "rl78-decode.opc"
++#line 1088 "rl78-decode.opc"
+                 ID(shr); DR(A); SC(cnt);
+ 
+               }
+@@ -1016,7 +1018,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x0b:
+               {
+                 /** 0011 0001 0cnt 1011		sar	%0, %1				*/
+-#line 1033 "rl78-decode.opc"
++#line 1035 "rl78-decode.opc"
+                 int cnt AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -1026,7 +1028,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  cnt = 0x%x\n", cnt);
+                   }
+                 SYNTAX("sar	%0, %1");
+-#line 1033 "rl78-decode.opc"
++#line 1035 "rl78-decode.opc"
+                 ID(sar); DR(A); SC(cnt);
+ 
+               }
+@@ -1035,7 +1037,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x8c:
+               {
+                 /** 0011 0001 wcnt 1100		shlw	%0, %1				*/
+-#line 1081 "rl78-decode.opc"
++#line 1083 "rl78-decode.opc"
+                 int wcnt AU = (op[1] >> 4) & 0x0f;
+                 if (trace)
+                   {
+@@ -1045,7 +1047,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  wcnt = 0x%x\n", wcnt);
+                   }
+                 SYNTAX("shlw	%0, %1");
+-#line 1081 "rl78-decode.opc"
++#line 1083 "rl78-decode.opc"
+                 ID(shl); W(); DR(BC); SC(wcnt);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -1056,7 +1058,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x8d:
+               {
+                 /** 0011 0001 wcnt 1101		shlw	%0, %1				*/
+-#line 1078 "rl78-decode.opc"
++#line 1080 "rl78-decode.opc"
+                 int wcnt AU = (op[1] >> 4) & 0x0f;
+                 if (trace)
+                   {
+@@ -1066,7 +1068,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  wcnt = 0x%x\n", wcnt);
+                   }
+                 SYNTAX("shlw	%0, %1");
+-#line 1078 "rl78-decode.opc"
++#line 1080 "rl78-decode.opc"
+                 ID(shl); W(); DR(AX); SC(wcnt);
+ 
+               }
+@@ -1075,7 +1077,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x8e:
+               {
+                 /** 0011 0001 wcnt 1110		shrw	%0, %1				*/
+-#line 1089 "rl78-decode.opc"
++#line 1091 "rl78-decode.opc"
+                 int wcnt AU = (op[1] >> 4) & 0x0f;
+                 if (trace)
+                   {
+@@ -1085,7 +1087,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  wcnt = 0x%x\n", wcnt);
+                   }
+                 SYNTAX("shrw	%0, %1");
+-#line 1089 "rl78-decode.opc"
++#line 1091 "rl78-decode.opc"
+                 ID(shr); W(); DR(AX); SC(wcnt);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -1096,7 +1098,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x8f:
+               {
+                 /** 0011 0001 wcnt 1111		sarw	%0, %1				*/
+-#line 1036 "rl78-decode.opc"
++#line 1038 "rl78-decode.opc"
+                 int wcnt AU = (op[1] >> 4) & 0x0f;
+                 if (trace)
+                   {
+@@ -1106,7 +1108,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  wcnt = 0x%x\n", wcnt);
+                   }
+                 SYNTAX("sarw	%0, %1");
+-#line 1036 "rl78-decode.opc"
++#line 1038 "rl78-decode.opc"
+                 ID(sar); W(); DR(AX); SC(wcnt);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -1116,7 +1118,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x80:
+               {
+                 /** 0011 0001 1bit 0000		btclr	%s1, $%a0			*/
+-#line 413 "rl78-decode.opc"
++#line 415 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -1126,7 +1128,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("btclr	%s1, $%a0");
+-#line 413 "rl78-decode.opc"
++#line 415 "rl78-decode.opc"
+                 ID(branch_cond_clear); SM(None, SFR); SB(bit); DC(pc+IMMS(1)+4); COND(T);
+ 
+               }
+@@ -1134,7 +1136,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x81:
+               {
+                 /** 0011 0001 1bit 0001		btclr	%e1, $%a0			*/
+-#line 407 "rl78-decode.opc"
++#line 409 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -1144,7 +1146,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("btclr	%e1, $%a0");
+-#line 407 "rl78-decode.opc"
++#line 409 "rl78-decode.opc"
+                 ID(branch_cond_clear); DC(pc+IMMS(1)+3); SM(HL,0); SB(bit); COND(T);
+ 
+               }
+@@ -1152,7 +1154,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x82:
+               {
+                 /** 0011 0001 1bit 0010		bt	%s1, $%a0			*/
+-#line 399 "rl78-decode.opc"
++#line 401 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -1162,7 +1164,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("bt	%s1, $%a0");
+-#line 399 "rl78-decode.opc"
++#line 401 "rl78-decode.opc"
+                 ID(branch_cond); SM(None, SFR); SB(bit); DC(pc+IMMS(1)+4); COND(T);
+ 
+               }
+@@ -1170,7 +1172,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x83:
+               {
+                 /** 0011 0001 1bit 0011		bt	%e1, $%a0			*/
+-#line 393 "rl78-decode.opc"
++#line 395 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -1180,7 +1182,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("bt	%e1, $%a0");
+-#line 393 "rl78-decode.opc"
++#line 395 "rl78-decode.opc"
+                 ID(branch_cond); DC(pc+IMMS(1)+3); SM(HL,0); SB(bit); COND(T);
+ 
+               }
+@@ -1188,7 +1190,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x84:
+               {
+                 /** 0011 0001 1bit 0100		bf	%s1, $%a0			*/
+-#line 360 "rl78-decode.opc"
++#line 362 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -1198,7 +1200,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("bf	%s1, $%a0");
+-#line 360 "rl78-decode.opc"
++#line 362 "rl78-decode.opc"
+                 ID(branch_cond); SM(None, SFR); SB(bit); DC(pc+IMMS(1)+4); COND(F);
+ 
+               }
+@@ -1206,7 +1208,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x85:
+               {
+                 /** 0011 0001 1bit 0101		bf	%e1, $%a0			*/
+-#line 354 "rl78-decode.opc"
++#line 356 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -1216,7 +1218,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("bf	%e1, $%a0");
+-#line 354 "rl78-decode.opc"
++#line 356 "rl78-decode.opc"
+                 ID(branch_cond); DC(pc+IMMS(1)+3); SM(HL,0); SB(bit); COND(F);
+ 
+               }
+@@ -1229,7 +1231,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x37:
+         {
+           /** 0011 0ra1			xchw	%0, %1				*/
+-#line 1239 "rl78-decode.opc"
++#line 1241 "rl78-decode.opc"
+           int ra AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -1239,7 +1241,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  ra = 0x%x\n", ra);
+             }
+           SYNTAX("xchw	%0, %1");
+-#line 1239 "rl78-decode.opc"
++#line 1241 "rl78-decode.opc"
+           ID(xch); W(); DR(AX); SRW(ra);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -1256,7 +1258,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%e0, #%1");
+-#line 738 "rl78-decode.opc"
++#line 740 "rl78-decode.opc"
+           ID(mov); DM(C, IMMU(2)); SC(IMMU(1));
+ 
+         }
+@@ -1271,7 +1273,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%e0, #%1");
+-#line 732 "rl78-decode.opc"
++#line 734 "rl78-decode.opc"
+           ID(mov); DM(BC, IMMU(2)); SC(IMMU(1));
+ 
+         }
+@@ -1286,7 +1288,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("subc	%0, #%1");
+-#line 1178 "rl78-decode.opc"
++#line 1180 "rl78-decode.opc"
+           ID(subc); DM(None, SADDR); SC(IMMU(1)); Fzac;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -1303,7 +1305,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("subc	%0, %1");
+-#line 1175 "rl78-decode.opc"
++#line 1177 "rl78-decode.opc"
+           ID(subc); DR(A); SM(None, SADDR); Fzac;
+ 
+         }
+@@ -1318,7 +1320,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("subc	%0, #%1");
+-#line 1166 "rl78-decode.opc"
++#line 1168 "rl78-decode.opc"
+           ID(subc); DR(A); SC(IMMU(1)); Fzac;
+ 
+         }
+@@ -1333,7 +1335,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("subc	%0, %e1");
+-#line 1154 "rl78-decode.opc"
++#line 1156 "rl78-decode.opc"
+           ID(subc); DR(A); SM(HL, 0); Fzac;
+ 
+         }
+@@ -1348,7 +1350,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("subc	%0, %ea1");
+-#line 1163 "rl78-decode.opc"
++#line 1165 "rl78-decode.opc"
+           ID(subc); DR(A); SM(HL, IMMU(1)); Fzac;
+ 
+         }
+@@ -1363,7 +1365,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("subc	%0, %e!1");
+-#line 1151 "rl78-decode.opc"
++#line 1153 "rl78-decode.opc"
+           ID(subc); DR(A); SM(None, IMMU(2)); Fzac;
+ 
+         }
+@@ -1378,7 +1380,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmp	%e!0, #%1");
+-#line 480 "rl78-decode.opc"
++#line 482 "rl78-decode.opc"
+           ID(cmp); DM(None, IMMU(2)); SC(IMMU(1)); Fzac;
+ 
+         }
+@@ -1393,7 +1395,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, #%1");
+-#line 717 "rl78-decode.opc"
++#line 719 "rl78-decode.opc"
+           ID(mov); DR(ES); SC(IMMU(1));
+ 
+         }
+@@ -1408,7 +1410,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmpw	%0, %e!1");
+-#line 531 "rl78-decode.opc"
++#line 533 "rl78-decode.opc"
+           ID(cmp); W(); DR(AX); SM(None, IMMU(2)); Fzac;
+ 
+         }
+@@ -1418,7 +1420,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x47:
+         {
+           /** 0100 0ra1			cmpw	%0, %1				*/
+-#line 540 "rl78-decode.opc"
++#line 542 "rl78-decode.opc"
+           int ra AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -1428,7 +1430,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  ra = 0x%x\n", ra);
+             }
+           SYNTAX("cmpw	%0, %1");
+-#line 540 "rl78-decode.opc"
++#line 542 "rl78-decode.opc"
+           ID(cmp); W(); DR(AX); SRW(ra); Fzac;
+ 
+         }
+@@ -1443,7 +1445,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmpw	%0, #%1");
+-#line 537 "rl78-decode.opc"
++#line 539 "rl78-decode.opc"
+           ID(cmp); W(); DR(AX); SC(IMMU(2)); Fzac;
+ 
+         }
+@@ -1458,7 +1460,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmpw	%0, %1");
+-#line 543 "rl78-decode.opc"
++#line 545 "rl78-decode.opc"
+           ID(cmp); W(); DR(AX); SM(None, SADDR); Fzac;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -1475,7 +1477,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%e0, %1");
+-#line 735 "rl78-decode.opc"
++#line 737 "rl78-decode.opc"
+           ID(mov); DM(BC, IMMU(2)); SR(A);
+ 
+         }
+@@ -1490,7 +1492,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %e1");
+-#line 681 "rl78-decode.opc"
++#line 683 "rl78-decode.opc"
+           ID(mov); DR(A); SM(BC, IMMU(2));
+ 
+         }
+@@ -1505,7 +1507,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmp	%0, #%1");
+-#line 483 "rl78-decode.opc"
++#line 485 "rl78-decode.opc"
+           ID(cmp); DM(None, SADDR); SC(IMMU(1)); Fzac;
+ 
+         }
+@@ -1520,7 +1522,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmp	%0, %1");
+-#line 510 "rl78-decode.opc"
++#line 512 "rl78-decode.opc"
+           ID(cmp); DR(A); SM(None, SADDR); Fzac;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -1537,7 +1539,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmp	%0, #%1");
+-#line 501 "rl78-decode.opc"
++#line 503 "rl78-decode.opc"
+           ID(cmp); DR(A); SC(IMMU(1)); Fzac;
+ 
+         }
+@@ -1552,7 +1554,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmp	%0, %e1");
+-#line 489 "rl78-decode.opc"
++#line 491 "rl78-decode.opc"
+           ID(cmp); DR(A); SM(HL, 0); Fzac;
+ 
+         }
+@@ -1567,7 +1569,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmp	%0, %ea1");
+-#line 498 "rl78-decode.opc"
++#line 500 "rl78-decode.opc"
+           ID(cmp); DR(A); SM(HL, IMMU(1)); Fzac;
+ 
+         }
+@@ -1582,7 +1584,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmp	%0, %e!1");
+-#line 486 "rl78-decode.opc"
++#line 488 "rl78-decode.opc"
+           ID(cmp); DR(A); SM(None, IMMU(2)); Fzac;
+ 
+         }
+@@ -1597,7 +1599,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x57:
+         {
+           /** 0101 0reg			mov	%0, #%1				*/
+-#line 669 "rl78-decode.opc"
++#line 671 "rl78-decode.opc"
+           int reg AU = op[0] & 0x07;
+           if (trace)
+             {
+@@ -1607,7 +1609,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  reg = 0x%x\n", reg);
+             }
+           SYNTAX("mov	%0, #%1");
+-#line 669 "rl78-decode.opc"
++#line 671 "rl78-decode.opc"
+           ID(mov); DRB(reg); SC(IMMU(1));
+ 
+         }
+@@ -1622,7 +1624,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%e0, %1");
+-#line 871 "rl78-decode.opc"
++#line 873 "rl78-decode.opc"
+           ID(mov); W(); DM(B, IMMU(2)); SR(AX);
+ 
+         }
+@@ -1637,7 +1639,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %e1");
+-#line 862 "rl78-decode.opc"
++#line 864 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(B, IMMU(2));
+ 
+         }
+@@ -1652,7 +1654,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("and	%0, #%1");
+-#line 312 "rl78-decode.opc"
++#line 314 "rl78-decode.opc"
+           ID(and); DM(None, SADDR); SC(IMMU(1)); Fz;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -1669,7 +1671,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("and	%0, %1");
+-#line 309 "rl78-decode.opc"
++#line 311 "rl78-decode.opc"
+           ID(and); DR(A); SM(None, SADDR); Fz;
+ 
+         }
+@@ -1684,7 +1686,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("and	%0, #%1");
+-#line 300 "rl78-decode.opc"
++#line 302 "rl78-decode.opc"
+           ID(and); DR(A); SC(IMMU(1)); Fz;
+ 
+         }
+@@ -1699,7 +1701,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("and	%0, %e1");
+-#line 288 "rl78-decode.opc"
++#line 290 "rl78-decode.opc"
+           ID(and); DR(A); SM(HL, 0); Fz;
+ 
+         }
+@@ -1714,7 +1716,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("and	%0, %ea1");
+-#line 294 "rl78-decode.opc"
++#line 296 "rl78-decode.opc"
+           ID(and); DR(A); SM(HL, IMMU(1)); Fz;
+ 
+         }
+@@ -1729,7 +1731,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("and	%0, %e!1");
+-#line 285 "rl78-decode.opc"
++#line 287 "rl78-decode.opc"
+           ID(and); DR(A); SM(None, IMMU(2)); Fz;
+ 
+         }
+@@ -1743,7 +1745,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x67:
+         {
+           /** 0110 0rba			mov	%0, %1				*/
+-#line 672 "rl78-decode.opc"
++#line 674 "rl78-decode.opc"
+           int rba AU = op[0] & 0x07;
+           if (trace)
+             {
+@@ -1753,7 +1755,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rba = 0x%x\n", rba);
+             }
+           SYNTAX("mov	%0, %1");
+-#line 672 "rl78-decode.opc"
++#line 674 "rl78-decode.opc"
+           ID(mov); DR(A); SRB(rba);
+ 
+         }
+@@ -1772,7 +1774,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x07:
+               {
+                 /** 0110 0001 0000 0reg		add	%0, %1				*/
+-#line 225 "rl78-decode.opc"
++#line 227 "rl78-decode.opc"
+                 int reg AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -1782,7 +1784,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  reg = 0x%x\n", reg);
+                   }
+                 SYNTAX("add	%0, %1");
+-#line 225 "rl78-decode.opc"
++#line 227 "rl78-decode.opc"
+                 ID(add); DRB(reg); SR(A); Fzac;
+ 
+               }
+@@ -1796,7 +1798,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x0f:
+               {
+                 /** 0110 0001 0000 1rba		add	%0, %1				*/
+-#line 219 "rl78-decode.opc"
++#line 221 "rl78-decode.opc"
+                 int rba AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -1806,7 +1808,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  rba = 0x%x\n", rba);
+                   }
+                 SYNTAX("add	%0, %1");
+-#line 219 "rl78-decode.opc"
++#line 221 "rl78-decode.opc"
+                 ID(add); DR(A); SRB(rba); Fzac;
+ 
+               }
+@@ -1821,7 +1823,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("addw	%0, %ea1");
+-#line 268 "rl78-decode.opc"
++#line 270 "rl78-decode.opc"
+                 ID(add); W(); DR(AX); SM(HL, IMMU(1)); Fzac;
+ 
+               }
+@@ -1836,7 +1838,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x17:
+               {
+                 /** 0110 0001 0001 0reg		addc	%0, %1				*/
+-#line 254 "rl78-decode.opc"
++#line 256 "rl78-decode.opc"
+                 int reg AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -1846,7 +1848,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  reg = 0x%x\n", reg);
+                   }
+                 SYNTAX("addc	%0, %1");
+-#line 254 "rl78-decode.opc"
++#line 256 "rl78-decode.opc"
+                 ID(addc); DRB(reg); SR(A); Fzac;
+ 
+               }
+@@ -1860,7 +1862,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x1f:
+               {
+                 /** 0110 0001 0001 1rba		addc	%0, %1				*/
+-#line 251 "rl78-decode.opc"
++#line 253 "rl78-decode.opc"
+                 int rba AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -1870,7 +1872,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  rba = 0x%x\n", rba);
+                   }
+                 SYNTAX("addc	%0, %1");
+-#line 251 "rl78-decode.opc"
++#line 253 "rl78-decode.opc"
+                 ID(addc); DR(A); SRB(rba); Fzac;
+ 
+               }
+@@ -1885,7 +1887,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x27:
+               {
+                 /** 0110 0001 0010 0reg		sub	%0, %1				*/
+-#line 1143 "rl78-decode.opc"
++#line 1145 "rl78-decode.opc"
+                 int reg AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -1895,7 +1897,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  reg = 0x%x\n", reg);
+                   }
+                 SYNTAX("sub	%0, %1");
+-#line 1143 "rl78-decode.opc"
++#line 1145 "rl78-decode.opc"
+                 ID(sub); DRB(reg); SR(A); Fzac;
+ 
+               }
+@@ -1909,7 +1911,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x2f:
+               {
+                 /** 0110 0001 0010 1rba		sub	%0, %1				*/
+-#line 1137 "rl78-decode.opc"
++#line 1139 "rl78-decode.opc"
+                 int rba AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -1919,7 +1921,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  rba = 0x%x\n", rba);
+                   }
+                 SYNTAX("sub	%0, %1");
+-#line 1137 "rl78-decode.opc"
++#line 1139 "rl78-decode.opc"
+                 ID(sub); DR(A); SRB(rba); Fzac;
+ 
+               }
+@@ -1934,7 +1936,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("subw	%0, %ea1");
+-#line 1186 "rl78-decode.opc"
++#line 1188 "rl78-decode.opc"
+                 ID(sub); W(); DR(AX); SM(HL, IMMU(1)); Fzac;
+ 
+               }
+@@ -1949,7 +1951,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x37:
+               {
+                 /** 0110 0001 0011 0reg		subc	%0, %1				*/
+-#line 1172 "rl78-decode.opc"
++#line 1174 "rl78-decode.opc"
+                 int reg AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -1959,7 +1961,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  reg = 0x%x\n", reg);
+                   }
+                 SYNTAX("subc	%0, %1");
+-#line 1172 "rl78-decode.opc"
++#line 1174 "rl78-decode.opc"
+                 ID(subc); DRB(reg); SR(A); Fzac;
+ 
+               }
+@@ -1973,7 +1975,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x3f:
+               {
+                 /** 0110 0001 0011 1rba		subc	%0, %1				*/
+-#line 1169 "rl78-decode.opc"
++#line 1171 "rl78-decode.opc"
+                 int rba AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -1983,7 +1985,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  rba = 0x%x\n", rba);
+                   }
+                 SYNTAX("subc	%0, %1");
+-#line 1169 "rl78-decode.opc"
++#line 1171 "rl78-decode.opc"
+                 ID(subc); DR(A); SRB(rba); Fzac;
+ 
+               }
+@@ -1998,7 +2000,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x47:
+               {
+                 /** 0110 0001 0100 0reg		cmp	%0, %1				*/
+-#line 507 "rl78-decode.opc"
++#line 509 "rl78-decode.opc"
+                 int reg AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -2008,7 +2010,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  reg = 0x%x\n", reg);
+                   }
+                 SYNTAX("cmp	%0, %1");
+-#line 507 "rl78-decode.opc"
++#line 509 "rl78-decode.opc"
+                 ID(cmp); DRB(reg); SR(A); Fzac;
+ 
+               }
+@@ -2022,7 +2024,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x4f:
+               {
+                 /** 0110 0001 0100 1rba		cmp	%0, %1				*/
+-#line 504 "rl78-decode.opc"
++#line 506 "rl78-decode.opc"
+                 int rba AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -2032,7 +2034,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  rba = 0x%x\n", rba);
+                   }
+                 SYNTAX("cmp	%0, %1");
+-#line 504 "rl78-decode.opc"
++#line 506 "rl78-decode.opc"
+                 ID(cmp); DR(A); SRB(rba); Fzac;
+ 
+               }
+@@ -2047,7 +2049,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("cmpw	%0, %ea1");
+-#line 534 "rl78-decode.opc"
++#line 536 "rl78-decode.opc"
+                 ID(cmp); W(); DR(AX); SM(HL, IMMU(1)); Fzac;
+ 
+               }
+@@ -2062,7 +2064,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x57:
+               {
+                 /** 0110 0001 0101 0reg		and	%0, %1				*/
+-#line 306 "rl78-decode.opc"
++#line 308 "rl78-decode.opc"
+                 int reg AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -2072,7 +2074,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  reg = 0x%x\n", reg);
+                   }
+                 SYNTAX("and	%0, %1");
+-#line 306 "rl78-decode.opc"
++#line 308 "rl78-decode.opc"
+                 ID(and); DRB(reg); SR(A); Fz;
+ 
+               }
+@@ -2086,7 +2088,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x5f:
+               {
+                 /** 0110 0001 0101 1rba		and	%0, %1				*/
+-#line 303 "rl78-decode.opc"
++#line 305 "rl78-decode.opc"
+                 int rba AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -2096,7 +2098,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  rba = 0x%x\n", rba);
+                   }
+                 SYNTAX("and	%0, %1");
+-#line 303 "rl78-decode.opc"
++#line 305 "rl78-decode.opc"
+                 ID(and); DR(A); SRB(rba); Fz;
+ 
+               }
+@@ -2111,7 +2113,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("inc	%ea0");
+-#line 584 "rl78-decode.opc"
++#line 586 "rl78-decode.opc"
+                 ID(add); DM(HL, IMMU(1)); SC(1); Fza;
+ 
+               }
+@@ -2126,7 +2128,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x67:
+               {
+                 /** 0110 0001 0110 0reg		or	%0, %1				*/
+-#line 961 "rl78-decode.opc"
++#line 963 "rl78-decode.opc"
+                 int reg AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -2136,7 +2138,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  reg = 0x%x\n", reg);
+                   }
+                 SYNTAX("or	%0, %1");
+-#line 961 "rl78-decode.opc"
++#line 963 "rl78-decode.opc"
+                 ID(or); DRB(reg); SR(A); Fz;
+ 
+               }
+@@ -2150,7 +2152,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x6f:
+               {
+                 /** 0110 0001 0110 1rba		or	%0, %1				*/
+-#line 958 "rl78-decode.opc"
++#line 960 "rl78-decode.opc"
+                 int rba AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -2160,7 +2162,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  rba = 0x%x\n", rba);
+                   }
+                 SYNTAX("or	%0, %1");
+-#line 958 "rl78-decode.opc"
++#line 960 "rl78-decode.opc"
+                 ID(or); DR(A); SRB(rba); Fz;
+ 
+               }
+@@ -2175,7 +2177,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("dec	%ea0");
+-#line 551 "rl78-decode.opc"
++#line 553 "rl78-decode.opc"
+                 ID(sub); DM(HL, IMMU(1)); SC(1); Fza;
+ 
+               }
+@@ -2190,7 +2192,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x77:
+               {
+                 /** 0110 0001 0111 0reg		xor	%0, %1				*/
+-#line 1265 "rl78-decode.opc"
++#line 1267 "rl78-decode.opc"
+                 int reg AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -2200,7 +2202,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  reg = 0x%x\n", reg);
+                   }
+                 SYNTAX("xor	%0, %1");
+-#line 1265 "rl78-decode.opc"
++#line 1267 "rl78-decode.opc"
+                 ID(xor); DRB(reg); SR(A); Fz;
+ 
+               }
+@@ -2214,7 +2216,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x7f:
+               {
+                 /** 0110 0001 0111 1rba		xor	%0, %1				*/
+-#line 1262 "rl78-decode.opc"
++#line 1264 "rl78-decode.opc"
+                 int rba AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -2224,7 +2226,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  rba = 0x%x\n", rba);
+                   }
+                 SYNTAX("xor	%0, %1");
+-#line 1262 "rl78-decode.opc"
++#line 1264 "rl78-decode.opc"
+                 ID(xor); DR(A); SRB(rba); Fz;
+ 
+               }
+@@ -2239,7 +2241,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("incw	%ea0");
+-#line 598 "rl78-decode.opc"
++#line 600 "rl78-decode.opc"
+                 ID(add); W(); DM(HL, IMMU(1)); SC(1);
+ 
+               }
+@@ -2255,7 +2257,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("add	%0, %e1");
+-#line 207 "rl78-decode.opc"
++#line 209 "rl78-decode.opc"
+                 ID(add); DR(A); SM2(HL, B, 0); Fzac;
+ 
+               }
+@@ -2270,7 +2272,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("add	%0, %e1");
+-#line 213 "rl78-decode.opc"
++#line 215 "rl78-decode.opc"
+                 ID(add); DR(A); SM2(HL, C, 0); Fzac;
+ 
+               }
+@@ -2309,9 +2311,9 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xf7:
+               {
+                 /** 0110 0001 1nnn 01mm		callt	[%x0]				*/
+-#line 433 "rl78-decode.opc"
++#line 435 "rl78-decode.opc"
+                 int nnn AU = (op[1] >> 4) & 0x07;
+-#line 433 "rl78-decode.opc"
++#line 435 "rl78-decode.opc"
+                 int mm AU = op[1] & 0x03;
+                 if (trace)
+                   {
+@@ -2322,7 +2324,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  mm = 0x%x\n", mm);
+                   }
+                 SYNTAX("callt	[%x0]");
+-#line 433 "rl78-decode.opc"
++#line 435 "rl78-decode.opc"
+                 ID(call); DM(None, 0x80 + mm*16 + nnn*2);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -2338,7 +2340,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x8f:
+               {
+                 /** 0110 0001 1000 1reg		xch	%0, %1				*/
+-#line 1224 "rl78-decode.opc"
++#line 1226 "rl78-decode.opc"
+                 int reg AU = op[1] & 0x07;
+                 if (trace)
+                   {
+@@ -2348,7 +2350,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  reg = 0x%x\n", reg);
+                   }
+                 SYNTAX("xch	%0, %1");
+-#line 1224 "rl78-decode.opc"
++#line 1226 "rl78-decode.opc"
+                 /* Note: DECW uses reg == X, so this must follow DECW */
+                 ID(xch); DR(A); SRB(reg);
+ 
+@@ -2364,7 +2366,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("decw	%ea0");
+-#line 565 "rl78-decode.opc"
++#line 567 "rl78-decode.opc"
+                 ID(sub); W(); DM(HL, IMMU(1)); SC(1);
+ 
+               }
+@@ -2379,7 +2381,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("addc	%0, %e1");
+-#line 239 "rl78-decode.opc"
++#line 241 "rl78-decode.opc"
+                 ID(addc); DR(A); SM2(HL, B, 0); Fzac;
+ 
+               }
+@@ -2394,7 +2396,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("addc	%0, %e1");
+-#line 242 "rl78-decode.opc"
++#line 244 "rl78-decode.opc"
+                 ID(addc); DR(A); SM2(HL, C, 0); Fzac;
+ 
+               }
+@@ -2410,7 +2412,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("sub	%0, %e1");
+-#line 1125 "rl78-decode.opc"
++#line 1127 "rl78-decode.opc"
+                 ID(sub); DR(A); SM2(HL, B, 0); Fzac;
+ 
+               }
+@@ -2425,7 +2427,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("sub	%0, %e1");
+-#line 1131 "rl78-decode.opc"
++#line 1133 "rl78-decode.opc"
+                 ID(sub); DR(A); SM2(HL, C, 0); Fzac;
+ 
+               }
+@@ -2440,7 +2442,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xch	%0, %1");
+-#line 1228 "rl78-decode.opc"
++#line 1230 "rl78-decode.opc"
+                 ID(xch); DR(A); SM(None, SADDR);
+ 
+               }
+@@ -2455,7 +2457,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xch	%0, %e1");
+-#line 1221 "rl78-decode.opc"
++#line 1223 "rl78-decode.opc"
+                 ID(xch); DR(A); SM2(HL, C, 0);
+ 
+               }
+@@ -2470,7 +2472,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xch	%0, %e!1");
+-#line 1203 "rl78-decode.opc"
++#line 1205 "rl78-decode.opc"
+                 ID(xch); DR(A); SM(None, IMMU(2));
+ 
+               }
+@@ -2485,7 +2487,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xch	%0, %s1");
+-#line 1231 "rl78-decode.opc"
++#line 1233 "rl78-decode.opc"
+                 ID(xch); DR(A); SM(None, SFR);
+ 
+               }
+@@ -2500,7 +2502,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xch	%0, %e1");
+-#line 1212 "rl78-decode.opc"
++#line 1214 "rl78-decode.opc"
+                 ID(xch); DR(A); SM(HL, 0);
+ 
+               }
+@@ -2515,7 +2517,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xch	%0, %ea1");
+-#line 1218 "rl78-decode.opc"
++#line 1220 "rl78-decode.opc"
+                 ID(xch); DR(A); SM(HL, IMMU(1));
+ 
+               }
+@@ -2530,7 +2532,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xch	%0, %e1");
+-#line 1206 "rl78-decode.opc"
++#line 1208 "rl78-decode.opc"
+                 ID(xch); DR(A); SM(DE, 0);
+ 
+               }
+@@ -2545,7 +2547,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xch	%0, %ea1");
+-#line 1209 "rl78-decode.opc"
++#line 1211 "rl78-decode.opc"
+                 ID(xch); DR(A); SM(DE, IMMU(1));
+ 
+               }
+@@ -2560,7 +2562,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("subc	%0, %e1");
+-#line 1157 "rl78-decode.opc"
++#line 1159 "rl78-decode.opc"
+                 ID(subc); DR(A); SM2(HL, B, 0); Fzac;
+ 
+               }
+@@ -2575,7 +2577,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("subc	%0, %e1");
+-#line 1160 "rl78-decode.opc"
++#line 1162 "rl78-decode.opc"
+                 ID(subc); DR(A); SM2(HL, C, 0); Fzac;
+ 
+               }
+@@ -2590,7 +2592,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("mov	%0, %1");
+-#line 723 "rl78-decode.opc"
++#line 725 "rl78-decode.opc"
+                 ID(mov); DR(ES); SM(None, SADDR);
+ 
+               }
+@@ -2605,7 +2607,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xch	%0, %e1");
+-#line 1215 "rl78-decode.opc"
++#line 1217 "rl78-decode.opc"
+                 ID(xch); DR(A); SM2(HL, B, 0);
+ 
+               }
+@@ -2620,7 +2622,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("cmp	%0, %e1");
+-#line 492 "rl78-decode.opc"
++#line 494 "rl78-decode.opc"
+                 ID(cmp); DR(A); SM2(HL, B, 0); Fzac;
+ 
+               }
+@@ -2635,7 +2637,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("cmp	%0, %e1");
+-#line 495 "rl78-decode.opc"
++#line 497 "rl78-decode.opc"
+                 ID(cmp); DR(A); SM2(HL, C, 0); Fzac;
+ 
+               }
+@@ -2650,7 +2652,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("bh	$%a0");
+-#line 340 "rl78-decode.opc"
++#line 342 "rl78-decode.opc"
+                 ID(branch_cond); DC(pc+IMMS(1)+3); SR(None); COND(H);
+ 
+               }
+@@ -2665,7 +2667,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("sk%c1");
+-#line 1094 "rl78-decode.opc"
++#line 1096 "rl78-decode.opc"
+                 ID(skip); COND(C);
+ 
+               }
+@@ -2680,7 +2682,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("mov	%0, %e1");
+-#line 660 "rl78-decode.opc"
++#line 662 "rl78-decode.opc"
+                 ID(mov); DR(A); SM2(HL, B, 0);
+ 
+               }
+@@ -2691,7 +2693,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xfa:
+               {
+                 /** 0110 0001 11rg 1010		call	%0				*/
+-#line 430 "rl78-decode.opc"
++#line 432 "rl78-decode.opc"
+                 int rg AU = (op[1] >> 4) & 0x03;
+                 if (trace)
+                   {
+@@ -2701,7 +2703,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  rg = 0x%x\n", rg);
+                   }
+                 SYNTAX("call	%0");
+-#line 430 "rl78-decode.opc"
++#line 432 "rl78-decode.opc"
+                 ID(call); DRW(rg);
+ 
+               }
+@@ -2716,7 +2718,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("br	ax");
+-#line 380 "rl78-decode.opc"
++#line 382 "rl78-decode.opc"
+                 ID(branch); DR(AX);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -2733,7 +2735,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("brk");
+-#line 388 "rl78-decode.opc"
++#line 390 "rl78-decode.opc"
+                 ID(break);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -2750,7 +2752,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("pop	%s0");
+-#line 989 "rl78-decode.opc"
++#line 991 "rl78-decode.opc"
+                 ID(mov); W(); DR(PSW); SPOP();
+ 
+               /*----------------------------------------------------------------------*/
+@@ -2767,7 +2769,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("movs	%ea0, %1");
+-#line 811 "rl78-decode.opc"
++#line 813 "rl78-decode.opc"
+                 ID(mov); DM(HL, IMMU(1)); SR(X); Fzc;
+ 
+               /*----------------------------------------------------------------------*/
+@@ -2780,7 +2782,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xff:
+               {
+                 /** 0110 0001 11rb 1111		sel	rb%1				*/
+-#line 1041 "rl78-decode.opc"
++#line 1043 "rl78-decode.opc"
+                 int rb AU = (op[1] >> 4) & 0x03;
+                 if (trace)
+                   {
+@@ -2790,7 +2792,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  rb = 0x%x\n", rb);
+                   }
+                 SYNTAX("sel	rb%1");
+-#line 1041 "rl78-decode.opc"
++#line 1043 "rl78-decode.opc"
+                 ID(sel); SC(rb);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -2807,7 +2809,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("and	%0, %e1");
+-#line 291 "rl78-decode.opc"
++#line 293 "rl78-decode.opc"
+                 ID(and); DR(A); SM2(HL, B, 0); Fz;
+ 
+               }
+@@ -2822,7 +2824,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("and	%0, %e1");
+-#line 297 "rl78-decode.opc"
++#line 299 "rl78-decode.opc"
+                 ID(and); DR(A); SM2(HL, C, 0); Fz;
+ 
+               }
+@@ -2837,7 +2839,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("bnh	$%a0");
+-#line 343 "rl78-decode.opc"
++#line 345 "rl78-decode.opc"
+                 ID(branch_cond); DC(pc+IMMS(1)+3); SR(None); COND(NH);
+ 
+               }
+@@ -2852,7 +2854,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("sk%c1");
+-#line 1100 "rl78-decode.opc"
++#line 1102 "rl78-decode.opc"
+                 ID(skip); COND(NC);
+ 
+               }
+@@ -2867,7 +2869,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("mov	%e0, %1");
+-#line 627 "rl78-decode.opc"
++#line 629 "rl78-decode.opc"
+                 ID(mov); DM2(HL, B, 0); SR(A);
+ 
+               }
+@@ -2882,7 +2884,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("ror	%0, %1");
+-#line 1022 "rl78-decode.opc"
++#line 1024 "rl78-decode.opc"
+                 ID(ror); DR(A); SC(1);
+ 
+               }
+@@ -2897,7 +2899,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("rolc	%0, %1");
+-#line 1016 "rl78-decode.opc"
++#line 1018 "rl78-decode.opc"
+                 ID(rolc); DR(A); SC(1);
+ 
+               }
+@@ -2912,7 +2914,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("push	%s1");
+-#line 997 "rl78-decode.opc"
++#line 999 "rl78-decode.opc"
+                 ID(mov); W(); DPUSH(); SR(PSW);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -2929,7 +2931,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("cmps	%0, %ea1");
+-#line 526 "rl78-decode.opc"
++#line 528 "rl78-decode.opc"
+                 ID(cmp); DR(X); SM(HL, IMMU(1)); Fzac;
+ 
+               /*----------------------------------------------------------------------*/
+@@ -2946,7 +2948,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("or	%0, %e1");
+-#line 946 "rl78-decode.opc"
++#line 948 "rl78-decode.opc"
+                 ID(or); DR(A); SM2(HL, B, 0); Fz;
+ 
+               }
+@@ -2961,7 +2963,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("or	%0, %e1");
+-#line 952 "rl78-decode.opc"
++#line 954 "rl78-decode.opc"
+                 ID(or); DR(A); SM2(HL, C, 0); Fz;
+ 
+               }
+@@ -2976,7 +2978,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("sk%c1");
+-#line 1097 "rl78-decode.opc"
++#line 1099 "rl78-decode.opc"
+                 ID(skip); COND(H);
+ 
+               }
+@@ -2991,7 +2993,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("sk%c1");
+-#line 1109 "rl78-decode.opc"
++#line 1111 "rl78-decode.opc"
+                 ID(skip); COND(Z);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3008,7 +3010,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("mov	%0, %e1");
+-#line 663 "rl78-decode.opc"
++#line 665 "rl78-decode.opc"
+                 ID(mov); DR(A); SM2(HL, C, 0);
+ 
+               }
+@@ -3023,7 +3025,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("rol	%0, %1");
+-#line 1013 "rl78-decode.opc"
++#line 1015 "rl78-decode.opc"
+                 ID(rol); DR(A); SC(1);
+ 
+               }
+@@ -3038,7 +3040,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("retb");
+-#line 1008 "rl78-decode.opc"
++#line 1010 "rl78-decode.opc"
+                 ID(reti);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3055,7 +3057,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("halt");
+-#line 576 "rl78-decode.opc"
++#line 578 "rl78-decode.opc"
+                 ID(halt);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3066,7 +3068,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xfe:
+               {
+                 /** 0110 0001 111r 1110		rolwc	%0, %1				*/
+-#line 1019 "rl78-decode.opc"
++#line 1021 "rl78-decode.opc"
+                 int r AU = (op[1] >> 4) & 0x01;
+                 if (trace)
+                   {
+@@ -3076,7 +3078,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  r = 0x%x\n", r);
+                   }
+                 SYNTAX("rolwc	%0, %1");
+-#line 1019 "rl78-decode.opc"
++#line 1021 "rl78-decode.opc"
+                 ID(rolc); W(); DRW(r); SC(1);
+ 
+               }
+@@ -3091,7 +3093,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xor	%0, %e1");
+-#line 1250 "rl78-decode.opc"
++#line 1252 "rl78-decode.opc"
+                 ID(xor); DR(A); SM2(HL, B, 0); Fz;
+ 
+               }
+@@ -3106,7 +3108,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("xor	%0, %e1");
+-#line 1256 "rl78-decode.opc"
++#line 1258 "rl78-decode.opc"
+                 ID(xor); DR(A); SM2(HL, C, 0); Fz;
+ 
+               }
+@@ -3121,7 +3123,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("sk%c1");
+-#line 1103 "rl78-decode.opc"
++#line 1105 "rl78-decode.opc"
+                 ID(skip); COND(NH);
+ 
+               }
+@@ -3136,7 +3138,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("sk%c1");
+-#line 1106 "rl78-decode.opc"
++#line 1108 "rl78-decode.opc"
+                 ID(skip); COND(NZ);
+ 
+               }
+@@ -3151,7 +3153,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("mov	%e0, %1");
+-#line 636 "rl78-decode.opc"
++#line 638 "rl78-decode.opc"
+                 ID(mov); DM2(HL, C, 0); SR(A);
+ 
+               }
+@@ -3166,7 +3168,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("rorc	%0, %1");
+-#line 1025 "rl78-decode.opc"
++#line 1027 "rl78-decode.opc"
+                 ID(rorc); DR(A); SC(1);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3186,7 +3188,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("reti");
+-#line 1005 "rl78-decode.opc"
++#line 1007 "rl78-decode.opc"
+                 ID(reti);
+ 
+               }
+@@ -3201,7 +3203,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("stop");
+-#line 1114 "rl78-decode.opc"
++#line 1116 "rl78-decode.opc"
+                 ID(stop);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3221,7 +3223,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%e0, %1");
+-#line 874 "rl78-decode.opc"
++#line 876 "rl78-decode.opc"
+           ID(mov); W(); DM(C, IMMU(2)); SR(AX);
+ 
+         }
+@@ -3236,7 +3238,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %e1");
+-#line 865 "rl78-decode.opc"
++#line 867 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(C, IMMU(2));
+ 
+         }
+@@ -3251,7 +3253,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("or	%0, #%1");
+-#line 967 "rl78-decode.opc"
++#line 969 "rl78-decode.opc"
+           ID(or); DM(None, SADDR); SC(IMMU(1)); Fz;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -3268,7 +3270,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("or	%0, %1");
+-#line 964 "rl78-decode.opc"
++#line 966 "rl78-decode.opc"
+           ID(or); DR(A); SM(None, SADDR); Fz;
+ 
+         }
+@@ -3283,7 +3285,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("or	%0, #%1");
+-#line 955 "rl78-decode.opc"
++#line 957 "rl78-decode.opc"
+           ID(or); DR(A); SC(IMMU(1)); Fz;
+ 
+         }
+@@ -3298,7 +3300,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("or	%0, %e1");
+-#line 943 "rl78-decode.opc"
++#line 945 "rl78-decode.opc"
+           ID(or); DR(A); SM(HL, 0); Fz;
+ 
+         }
+@@ -3313,7 +3315,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("or	%0, %ea1");
+-#line 949 "rl78-decode.opc"
++#line 951 "rl78-decode.opc"
+           ID(or); DR(A); SM(HL, IMMU(1)); Fz;
+ 
+         }
+@@ -3328,7 +3330,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("or	%0, %e!1");
+-#line 940 "rl78-decode.opc"
++#line 942 "rl78-decode.opc"
+           ID(or); DR(A); SM(None, IMMU(2)); Fz;
+ 
+         }
+@@ -3342,7 +3344,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x77:
+         {
+           /** 0111 0rba			mov	%0, %1				*/
+-#line 696 "rl78-decode.opc"
++#line 698 "rl78-decode.opc"
+           int rba AU = op[0] & 0x07;
+           if (trace)
+             {
+@@ -3352,7 +3354,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rba = 0x%x\n", rba);
+             }
+           SYNTAX("mov	%0, %1");
+-#line 696 "rl78-decode.opc"
++#line 698 "rl78-decode.opc"
+           ID(mov); DRB(rba); SR(A);
+ 
+         }
+@@ -3371,7 +3373,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x70:
+               {
+                 /** 0111 0001 0bit 0000		set1	%e!0				*/
+-#line 1046 "rl78-decode.opc"
++#line 1048 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3381,7 +3383,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("set1	%e!0");
+-#line 1046 "rl78-decode.opc"
++#line 1048 "rl78-decode.opc"
+                 ID(mov); DM(None, IMMU(2)); DB(bit); SC(1);
+ 
+               }
+@@ -3396,7 +3398,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x71:
+               {
+                 /** 0111 0001 0bit 0001		mov1	%0, cy				*/
+-#line 803 "rl78-decode.opc"
++#line 805 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3406,7 +3408,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("mov1	%0, cy");
+-#line 803 "rl78-decode.opc"
++#line 805 "rl78-decode.opc"
+                 ID(mov); DM(None, SADDR); DB(bit); SCY();
+ 
+               }
+@@ -3421,7 +3423,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x72:
+               {
+                 /** 0111 0001 0bit 0010		set1	%0				*/
+-#line 1064 "rl78-decode.opc"
++#line 1066 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3431,7 +3433,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("set1	%0");
+-#line 1064 "rl78-decode.opc"
++#line 1066 "rl78-decode.opc"
+                 ID(mov); DM(None, SADDR); DB(bit); SC(1);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3448,7 +3450,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x73:
+               {
+                 /** 0111 0001 0bit 0011		clr1	%0				*/
+-#line 456 "rl78-decode.opc"
++#line 458 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3458,7 +3460,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("clr1	%0");
+-#line 456 "rl78-decode.opc"
++#line 458 "rl78-decode.opc"
+                 ID(mov); DM(None, SADDR); DB(bit); SC(0);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3475,7 +3477,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x74:
+               {
+                 /** 0111 0001 0bit 0100		mov1	cy, %1				*/
+-#line 797 "rl78-decode.opc"
++#line 799 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3485,7 +3487,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("mov1	cy, %1");
+-#line 797 "rl78-decode.opc"
++#line 799 "rl78-decode.opc"
+                 ID(mov); DCY(); SM(None, SADDR); SB(bit);
+ 
+               }
+@@ -3500,7 +3502,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x75:
+               {
+                 /** 0111 0001 0bit 0101		and1	cy, %s1				*/
+-#line 326 "rl78-decode.opc"
++#line 328 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3510,7 +3512,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("and1	cy, %s1");
+-#line 326 "rl78-decode.opc"
++#line 328 "rl78-decode.opc"
+                 ID(and); DCY(); SM(None, SADDR); SB(bit);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3530,7 +3532,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x76:
+               {
+                 /** 0111 0001 0bit 0110		or1	cy, %s1				*/
+-#line 981 "rl78-decode.opc"
++#line 983 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3540,7 +3542,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("or1	cy, %s1");
+-#line 981 "rl78-decode.opc"
++#line 983 "rl78-decode.opc"
+                 ID(or); DCY(); SM(None, SADDR); SB(bit);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3557,7 +3559,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x77:
+               {
+                 /** 0111 0001 0bit 0111		xor1	cy, %s1				*/
+-#line 1285 "rl78-decode.opc"
++#line 1287 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3567,7 +3569,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("xor1	cy, %s1");
+-#line 1285 "rl78-decode.opc"
++#line 1287 "rl78-decode.opc"
+                 ID(xor); DCY(); SM(None, SADDR); SB(bit);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3584,7 +3586,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x78:
+               {
+                 /** 0111 0001 0bit 1000		clr1	%e!0				*/
+-#line 438 "rl78-decode.opc"
++#line 440 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3594,7 +3596,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("clr1	%e!0");
+-#line 438 "rl78-decode.opc"
++#line 440 "rl78-decode.opc"
+                 ID(mov); DM(None, IMMU(2)); DB(bit); SC(0);
+ 
+               }
+@@ -3609,7 +3611,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x79:
+               {
+                 /** 0111 0001 0bit 1001		mov1	%s0, cy				*/
+-#line 806 "rl78-decode.opc"
++#line 808 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3619,7 +3621,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("mov1	%s0, cy");
+-#line 806 "rl78-decode.opc"
++#line 808 "rl78-decode.opc"
+                 ID(mov); DM(None, SFR); DB(bit); SCY();
+ 
+               /*----------------------------------------------------------------------*/
+@@ -3636,7 +3638,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x7a:
+               {
+                 /** 0111 0001 0bit 1010		set1	%s0				*/
+-#line 1058 "rl78-decode.opc"
++#line 1060 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3646,7 +3648,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("set1	%s0");
+-#line 1058 "rl78-decode.opc"
++#line 1060 "rl78-decode.opc"
+                 op0 = SFR;
+                 ID(mov); DM(None, op0); DB(bit); SC(1);
+                 if (op0 == RL78_SFR_PSW && bit == 7)
+@@ -3664,7 +3666,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x7b:
+               {
+                 /** 0111 0001 0bit 1011		clr1	%s0				*/
+-#line 450 "rl78-decode.opc"
++#line 452 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3674,7 +3676,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("clr1	%s0");
+-#line 450 "rl78-decode.opc"
++#line 452 "rl78-decode.opc"
+                 op0 = SFR;
+                 ID(mov); DM(None, op0); DB(bit); SC(0);
+                 if (op0 == RL78_SFR_PSW && bit == 7)
+@@ -3692,7 +3694,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x7c:
+               {
+                 /** 0111 0001 0bit 1100		mov1	cy, %s1				*/
+-#line 800 "rl78-decode.opc"
++#line 802 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3702,7 +3704,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("mov1	cy, %s1");
+-#line 800 "rl78-decode.opc"
++#line 802 "rl78-decode.opc"
+                 ID(mov); DCY(); SM(None, SFR); SB(bit);
+ 
+               }
+@@ -3717,7 +3719,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x7d:
+               {
+                 /** 0111 0001 0bit 1101		and1	cy, %s1				*/
+-#line 323 "rl78-decode.opc"
++#line 325 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3727,7 +3729,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("and1	cy, %s1");
+-#line 323 "rl78-decode.opc"
++#line 325 "rl78-decode.opc"
+                 ID(and); DCY(); SM(None, SFR); SB(bit);
+ 
+               }
+@@ -3742,7 +3744,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x7e:
+               {
+                 /** 0111 0001 0bit 1110		or1	cy, %s1				*/
+-#line 978 "rl78-decode.opc"
++#line 980 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3752,7 +3754,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("or1	cy, %s1");
+-#line 978 "rl78-decode.opc"
++#line 980 "rl78-decode.opc"
+                 ID(or); DCY(); SM(None, SFR); SB(bit);
+ 
+               }
+@@ -3767,7 +3769,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0x7f:
+               {
+                 /** 0111 0001 0bit 1111		xor1	cy, %s1				*/
+-#line 1282 "rl78-decode.opc"
++#line 1284 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3777,7 +3779,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("xor1	cy, %s1");
+-#line 1282 "rl78-decode.opc"
++#line 1284 "rl78-decode.opc"
+                 ID(xor); DCY(); SM(None, SFR); SB(bit);
+ 
+               }
+@@ -3792,7 +3794,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("set1	cy");
+-#line 1055 "rl78-decode.opc"
++#line 1057 "rl78-decode.opc"
+                 ID(mov); DCY(); SC(1);
+ 
+               }
+@@ -3807,7 +3809,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xf1:
+               {
+                 /** 0111 0001 1bit 0001		mov1	%e0, cy				*/
+-#line 785 "rl78-decode.opc"
++#line 787 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3817,7 +3819,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("mov1	%e0, cy");
+-#line 785 "rl78-decode.opc"
++#line 787 "rl78-decode.opc"
+                 ID(mov); DM(HL, 0); DB(bit); SCY();
+ 
+               }
+@@ -3832,7 +3834,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xf2:
+               {
+                 /** 0111 0001 1bit 0010		set1	%e0				*/
+-#line 1049 "rl78-decode.opc"
++#line 1051 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3842,7 +3844,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("set1	%e0");
+-#line 1049 "rl78-decode.opc"
++#line 1051 "rl78-decode.opc"
+                 ID(mov); DM(HL, 0); DB(bit); SC(1);
+ 
+               }
+@@ -3857,7 +3859,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xf3:
+               {
+                 /** 0111 0001 1bit 0011		clr1	%e0				*/
+-#line 441 "rl78-decode.opc"
++#line 443 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3867,7 +3869,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("clr1	%e0");
+-#line 441 "rl78-decode.opc"
++#line 443 "rl78-decode.opc"
+                 ID(mov); DM(HL, 0); DB(bit); SC(0);
+ 
+               }
+@@ -3882,7 +3884,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xf4:
+               {
+                 /** 0111 0001 1bit 0100		mov1	cy, %e1				*/
+-#line 791 "rl78-decode.opc"
++#line 793 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3892,7 +3894,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("mov1	cy, %e1");
+-#line 791 "rl78-decode.opc"
++#line 793 "rl78-decode.opc"
+                 ID(mov); DCY(); SM(HL, 0); SB(bit);
+ 
+               }
+@@ -3907,7 +3909,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xf5:
+               {
+                 /** 0111 0001 1bit 0101		and1	cy, %e1			*/
+-#line 317 "rl78-decode.opc"
++#line 319 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3917,7 +3919,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("and1	cy, %e1");
+-#line 317 "rl78-decode.opc"
++#line 319 "rl78-decode.opc"
+                 ID(and); DCY(); SM(HL, 0); SB(bit);
+ 
+               }
+@@ -3932,7 +3934,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xf6:
+               {
+                 /** 0111 0001 1bit 0110		or1	cy, %e1				*/
+-#line 972 "rl78-decode.opc"
++#line 974 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3942,7 +3944,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("or1	cy, %e1");
+-#line 972 "rl78-decode.opc"
++#line 974 "rl78-decode.opc"
+                 ID(or); DCY(); SM(HL, 0); SB(bit);
+ 
+               }
+@@ -3957,7 +3959,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xf7:
+               {
+                 /** 0111 0001 1bit 0111		xor1	cy, %e1				*/
+-#line 1276 "rl78-decode.opc"
++#line 1278 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -3967,7 +3969,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("xor1	cy, %e1");
+-#line 1276 "rl78-decode.opc"
++#line 1278 "rl78-decode.opc"
+                 ID(xor); DCY(); SM(HL, 0); SB(bit);
+ 
+               }
+@@ -3982,7 +3984,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("clr1	cy");
+-#line 447 "rl78-decode.opc"
++#line 449 "rl78-decode.opc"
+                 ID(mov); DCY(); SC(0);
+ 
+               }
+@@ -3997,7 +3999,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xf9:
+               {
+                 /** 0111 0001 1bit 1001		mov1	%e0, cy				*/
+-#line 788 "rl78-decode.opc"
++#line 790 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -4007,7 +4009,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("mov1	%e0, cy");
+-#line 788 "rl78-decode.opc"
++#line 790 "rl78-decode.opc"
+                 ID(mov); DR(A); DB(bit); SCY();
+ 
+               }
+@@ -4022,7 +4024,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xfa:
+               {
+                 /** 0111 0001 1bit 1010		set1	%0				*/
+-#line 1052 "rl78-decode.opc"
++#line 1054 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -4032,7 +4034,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("set1	%0");
+-#line 1052 "rl78-decode.opc"
++#line 1054 "rl78-decode.opc"
+                 ID(mov); DR(A); DB(bit); SC(1);
+ 
+               }
+@@ -4047,7 +4049,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xfb:
+               {
+                 /** 0111 0001 1bit 1011		clr1	%0				*/
+-#line 444 "rl78-decode.opc"
++#line 446 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -4057,7 +4059,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("clr1	%0");
+-#line 444 "rl78-decode.opc"
++#line 446 "rl78-decode.opc"
+                 ID(mov); DR(A); DB(bit); SC(0);
+ 
+               }
+@@ -4072,7 +4074,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xfc:
+               {
+                 /** 0111 0001 1bit 1100		mov1	cy, %e1				*/
+-#line 794 "rl78-decode.opc"
++#line 796 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -4082,7 +4084,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("mov1	cy, %e1");
+-#line 794 "rl78-decode.opc"
++#line 796 "rl78-decode.opc"
+                 ID(mov); DCY(); SR(A); SB(bit);
+ 
+               }
+@@ -4097,7 +4099,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xfd:
+               {
+                 /** 0111 0001 1bit 1101		and1	cy, %1				*/
+-#line 320 "rl78-decode.opc"
++#line 322 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -4107,7 +4109,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("and1	cy, %1");
+-#line 320 "rl78-decode.opc"
++#line 322 "rl78-decode.opc"
+                 ID(and); DCY(); SR(A); SB(bit);
+ 
+               }
+@@ -4122,7 +4124,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xfe:
+               {
+                 /** 0111 0001 1bit 1110		or1	cy, %1				*/
+-#line 975 "rl78-decode.opc"
++#line 977 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -4132,7 +4134,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("or1	cy, %1");
+-#line 975 "rl78-decode.opc"
++#line 977 "rl78-decode.opc"
+                 ID(or); DCY(); SR(A); SB(bit);
+ 
+               }
+@@ -4147,7 +4149,7 @@ rl78_decode_opcode (unsigned long pc AU,
+           case 0xff:
+               {
+                 /** 0111 0001 1bit 1111		xor1	cy, %1				*/
+-#line 1279 "rl78-decode.opc"
++#line 1281 "rl78-decode.opc"
+                 int bit AU = (op[1] >> 4) & 0x07;
+                 if (trace)
+                   {
+@@ -4157,7 +4159,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                     printf ("  bit = 0x%x\n", bit);
+                   }
+                 SYNTAX("xor1	cy, %1");
+-#line 1279 "rl78-decode.opc"
++#line 1281 "rl78-decode.opc"
+                 ID(xor); DCY(); SR(A); SB(bit);
+ 
+               }
+@@ -4172,7 +4174,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                            op[0], op[1]);
+                   }
+                 SYNTAX("not1	cy");
+-#line 916 "rl78-decode.opc"
++#line 918 "rl78-decode.opc"
+                 ID(xor); DCY(); SC(1);
+ 
+               /*----------------------------------------------------------------------*/
+@@ -4192,7 +4194,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%e0, %1");
+-#line 877 "rl78-decode.opc"
++#line 879 "rl78-decode.opc"
+           ID(mov); W(); DM(BC, IMMU(2)); SR(AX);
+ 
+         }
+@@ -4207,7 +4209,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %e1");
+-#line 868 "rl78-decode.opc"
++#line 870 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(BC, IMMU(2));
+ 
+         }
+@@ -4222,7 +4224,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("xor	%0, #%1");
+-#line 1271 "rl78-decode.opc"
++#line 1273 "rl78-decode.opc"
+           ID(xor); DM(None, SADDR); SC(IMMU(1)); Fz;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -4239,7 +4241,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("xor	%0, %1");
+-#line 1268 "rl78-decode.opc"
++#line 1270 "rl78-decode.opc"
+           ID(xor); DR(A); SM(None, SADDR); Fz;
+ 
+         }
+@@ -4254,7 +4256,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("xor	%0, #%1");
+-#line 1259 "rl78-decode.opc"
++#line 1261 "rl78-decode.opc"
+           ID(xor); DR(A); SC(IMMU(1)); Fz;
+ 
+         }
+@@ -4269,7 +4271,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("xor	%0, %e1");
+-#line 1247 "rl78-decode.opc"
++#line 1249 "rl78-decode.opc"
+           ID(xor); DR(A); SM(HL, 0); Fz;
+ 
+         }
+@@ -4284,7 +4286,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("xor	%0, %ea1");
+-#line 1253 "rl78-decode.opc"
++#line 1255 "rl78-decode.opc"
+           ID(xor); DR(A); SM(HL, IMMU(1)); Fz;
+ 
+         }
+@@ -4299,7 +4301,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("xor	%0, %e!1");
+-#line 1244 "rl78-decode.opc"
++#line 1246 "rl78-decode.opc"
+           ID(xor); DR(A); SM(None, IMMU(2)); Fz;
+ 
+         }
+@@ -4314,7 +4316,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x87:
+         {
+           /** 1000 0reg			inc	%0				*/
+-#line 587 "rl78-decode.opc"
++#line 589 "rl78-decode.opc"
+           int reg AU = op[0] & 0x07;
+           if (trace)
+             {
+@@ -4324,7 +4326,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  reg = 0x%x\n", reg);
+             }
+           SYNTAX("inc	%0");
+-#line 587 "rl78-decode.opc"
++#line 589 "rl78-decode.opc"
+           ID(add); DRB(reg); SC(1); Fza;
+ 
+         }
+@@ -4339,7 +4341,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %ea1");
+-#line 666 "rl78-decode.opc"
++#line 668 "rl78-decode.opc"
+           ID(mov); DR(A); SM(SP, IMMU(1));
+ 
+         }
+@@ -4354,7 +4356,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %e1");
+-#line 648 "rl78-decode.opc"
++#line 650 "rl78-decode.opc"
+           ID(mov); DR(A); SM(DE, 0);
+ 
+         }
+@@ -4369,7 +4371,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %ea1");
+-#line 651 "rl78-decode.opc"
++#line 653 "rl78-decode.opc"
+           ID(mov); DR(A); SM(DE, IMMU(1));
+ 
+         }
+@@ -4384,7 +4386,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %e1");
+-#line 654 "rl78-decode.opc"
++#line 656 "rl78-decode.opc"
+           ID(mov); DR(A); SM(HL, 0);
+ 
+         }
+@@ -4399,7 +4401,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %ea1");
+-#line 657 "rl78-decode.opc"
++#line 659 "rl78-decode.opc"
+           ID(mov); DR(A); SM(HL, IMMU(1));
+ 
+         }
+@@ -4414,7 +4416,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %1");
+-#line 690 "rl78-decode.opc"
++#line 692 "rl78-decode.opc"
+           ID(mov); DR(A); SM(None, SADDR);
+ 
+         }
+@@ -4429,7 +4431,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %s1");
+-#line 687 "rl78-decode.opc"
++#line 689 "rl78-decode.opc"
+           ID(mov); DR(A); SM(None, SFR);
+ 
+         }
+@@ -4444,7 +4446,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %e!1");
+-#line 645 "rl78-decode.opc"
++#line 647 "rl78-decode.opc"
+           ID(mov); DR(A); SM(None, IMMU(2));
+ 
+         }
+@@ -4459,7 +4461,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0x97:
+         {
+           /** 1001 0reg			dec	%0				*/
+-#line 554 "rl78-decode.opc"
++#line 556 "rl78-decode.opc"
+           int reg AU = op[0] & 0x07;
+           if (trace)
+             {
+@@ -4469,7 +4471,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  reg = 0x%x\n", reg);
+             }
+           SYNTAX("dec	%0");
+-#line 554 "rl78-decode.opc"
++#line 556 "rl78-decode.opc"
+           ID(sub); DRB(reg); SC(1); Fza;
+ 
+         }
+@@ -4484,7 +4486,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%a0, %1");
+-#line 642 "rl78-decode.opc"
++#line 644 "rl78-decode.opc"
+           ID(mov); DM(SP, IMMU(1)); SR(A);
+ 
+         }
+@@ -4499,7 +4501,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%e0, %1");
+-#line 615 "rl78-decode.opc"
++#line 617 "rl78-decode.opc"
+           ID(mov); DM(DE, 0); SR(A);
+ 
+         }
+@@ -4514,7 +4516,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%ea0, %1");
+-#line 621 "rl78-decode.opc"
++#line 623 "rl78-decode.opc"
+           ID(mov); DM(DE, IMMU(1)); SR(A);
+ 
+         }
+@@ -4529,7 +4531,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%e0, %1");
+-#line 624 "rl78-decode.opc"
++#line 626 "rl78-decode.opc"
+           ID(mov); DM(HL, 0); SR(A);
+ 
+         }
+@@ -4544,7 +4546,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%ea0, %1");
+-#line 633 "rl78-decode.opc"
++#line 635 "rl78-decode.opc"
+           ID(mov); DM(HL, IMMU(1)); SR(A);
+ 
+         }
+@@ -4559,7 +4561,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %1");
+-#line 747 "rl78-decode.opc"
++#line 749 "rl78-decode.opc"
+           ID(mov); DM(None, SADDR); SR(A);
+ 
+         }
+@@ -4574,7 +4576,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%s0, %1");
+-#line 780 "rl78-decode.opc"
++#line 782 "rl78-decode.opc"
+           ID(mov); DM(None, SFR); SR(A);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -4591,7 +4593,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%e!0, %1");
+-#line 612 "rl78-decode.opc"
++#line 614 "rl78-decode.opc"
+           ID(mov); DM(None, IMMU(2)); SR(A);
+ 
+         }
+@@ -4606,7 +4608,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("inc	%e!0");
+-#line 581 "rl78-decode.opc"
++#line 583 "rl78-decode.opc"
+           ID(add); DM(None, IMMU(2)); SC(1); Fza;
+ 
+         }
+@@ -4617,7 +4619,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0xa7:
+         {
+           /** 1010 0rg1			incw	%0				*/
+-#line 601 "rl78-decode.opc"
++#line 603 "rl78-decode.opc"
+           int rg AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -4627,7 +4629,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rg = 0x%x\n", rg);
+             }
+           SYNTAX("incw	%0");
+-#line 601 "rl78-decode.opc"
++#line 603 "rl78-decode.opc"
+           ID(add); W(); DRW(rg); SC(1);
+ 
+         }
+@@ -4642,7 +4644,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("incw	%e!0");
+-#line 595 "rl78-decode.opc"
++#line 597 "rl78-decode.opc"
+           ID(add); W(); DM(None, IMMU(2)); SC(1);
+ 
+         }
+@@ -4657,7 +4659,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("inc	%0");
+-#line 590 "rl78-decode.opc"
++#line 592 "rl78-decode.opc"
+           ID(add); DM(None, SADDR); SC(1); Fza;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -4674,7 +4676,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("incw	%0");
+-#line 604 "rl78-decode.opc"
++#line 606 "rl78-decode.opc"
+           ID(add); W(); DM(None, SADDR); SC(1);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -4691,7 +4693,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %a1");
+-#line 850 "rl78-decode.opc"
++#line 852 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(SP, IMMU(1));
+ 
+         }
+@@ -4706,7 +4708,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %e1");
+-#line 838 "rl78-decode.opc"
++#line 840 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(DE, 0);
+ 
+         }
+@@ -4721,7 +4723,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %ea1");
+-#line 841 "rl78-decode.opc"
++#line 843 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(DE, IMMU(1));
+ 
+         }
+@@ -4736,7 +4738,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %e1");
+-#line 844 "rl78-decode.opc"
++#line 846 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(HL, 0);
+ 
+         }
+@@ -4751,7 +4753,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %ea1");
+-#line 847 "rl78-decode.opc"
++#line 849 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(HL, IMMU(1));
+ 
+         }
+@@ -4766,7 +4768,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %1");
+-#line 880 "rl78-decode.opc"
++#line 882 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(None, SADDR);
+ 
+         }
+@@ -4781,7 +4783,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %s1");
+-#line 883 "rl78-decode.opc"
++#line 885 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(None, SFR);
+ 
+         }
+@@ -4796,7 +4798,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %e!1");
+-#line 834 "rl78-decode.opc"
++#line 836 "rl78-decode.opc"
+           ID(mov); W(); DR(AX); SM(None, IMMU(2));
+ 
+ 
+@@ -4812,7 +4814,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("dec	%e!0");
+-#line 548 "rl78-decode.opc"
++#line 550 "rl78-decode.opc"
+           ID(sub); DM(None, IMMU(2)); SC(1); Fza;
+ 
+         }
+@@ -4823,7 +4825,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0xb7:
+         {
+           /** 1011 0rg1 			decw	%0				*/
+-#line 568 "rl78-decode.opc"
++#line 570 "rl78-decode.opc"
+           int rg AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -4833,7 +4835,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rg = 0x%x\n", rg);
+             }
+           SYNTAX("decw	%0");
+-#line 568 "rl78-decode.opc"
++#line 570 "rl78-decode.opc"
+           ID(sub); W(); DRW(rg); SC(1);
+ 
+         }
+@@ -4848,7 +4850,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("decw	%e!0");
+-#line 562 "rl78-decode.opc"
++#line 564 "rl78-decode.opc"
+           ID(sub); W(); DM(None, IMMU(2)); SC(1);
+ 
+         }
+@@ -4863,7 +4865,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("dec	%0");
+-#line 557 "rl78-decode.opc"
++#line 559 "rl78-decode.opc"
+           ID(sub); DM(None, SADDR); SC(1); Fza;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -4880,7 +4882,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("decw	%0");
+-#line 571 "rl78-decode.opc"
++#line 573 "rl78-decode.opc"
+           ID(sub); W(); DM(None, SADDR); SC(1);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -4897,7 +4899,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%a0, %1");
+-#line 831 "rl78-decode.opc"
++#line 833 "rl78-decode.opc"
+           ID(mov); W(); DM(SP, IMMU(1)); SR(AX);
+ 
+         }
+@@ -4912,7 +4914,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%e0, %1");
+-#line 819 "rl78-decode.opc"
++#line 821 "rl78-decode.opc"
+           ID(mov); W(); DM(DE, 0); SR(AX);
+ 
+         }
+@@ -4927,7 +4929,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%ea0, %1");
+-#line 822 "rl78-decode.opc"
++#line 824 "rl78-decode.opc"
+           ID(mov); W(); DM(DE, IMMU(1)); SR(AX);
+ 
+         }
+@@ -4942,7 +4944,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%e0, %1");
+-#line 825 "rl78-decode.opc"
++#line 827 "rl78-decode.opc"
+           ID(mov); W(); DM(HL, 0); SR(AX);
+ 
+         }
+@@ -4957,7 +4959,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%ea0, %1");
+-#line 828 "rl78-decode.opc"
++#line 830 "rl78-decode.opc"
+           ID(mov); W(); DM(HL, IMMU(1)); SR(AX);
+ 
+         }
+@@ -4972,7 +4974,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, %1");
+-#line 895 "rl78-decode.opc"
++#line 897 "rl78-decode.opc"
+           ID(mov); W(); DM(None, SADDR); SR(AX);
+ 
+         }
+@@ -4987,7 +4989,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%s0, %1");
+-#line 901 "rl78-decode.opc"
++#line 903 "rl78-decode.opc"
+           ID(mov); W(); DM(None, SFR); SR(AX);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -5004,7 +5006,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%e!0, %1");
+-#line 816 "rl78-decode.opc"
++#line 818 "rl78-decode.opc"
+           ID(mov); W(); DM(None, IMMU(2)); SR(AX);
+ 
+         }
+@@ -5015,7 +5017,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0xc6:
+         {
+           /** 1100 0rg0			pop	%0				*/
+-#line 986 "rl78-decode.opc"
++#line 988 "rl78-decode.opc"
+           int rg AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -5025,7 +5027,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rg = 0x%x\n", rg);
+             }
+           SYNTAX("pop	%0");
+-#line 986 "rl78-decode.opc"
++#line 988 "rl78-decode.opc"
+           ID(mov); W(); DRW(rg); SPOP();
+ 
+         }
+@@ -5036,7 +5038,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0xc7:
+         {
+           /** 1100 0rg1			push	%1				*/
+-#line 994 "rl78-decode.opc"
++#line 996 "rl78-decode.opc"
+           int rg AU = (op[0] >> 1) & 0x03;
+           if (trace)
+             {
+@@ -5046,7 +5048,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rg = 0x%x\n", rg);
+             }
+           SYNTAX("push	%1");
+-#line 994 "rl78-decode.opc"
++#line 996 "rl78-decode.opc"
+           ID(mov); W(); DPUSH(); SRW(rg);
+ 
+         }
+@@ -5061,7 +5063,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%a0, #%1");
+-#line 639 "rl78-decode.opc"
++#line 641 "rl78-decode.opc"
+           ID(mov); DM(SP, IMMU(1)); SC(IMMU(1));
+ 
+         }
+@@ -5076,7 +5078,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%0, #%1");
+-#line 892 "rl78-decode.opc"
++#line 894 "rl78-decode.opc"
+           ID(mov); W(); DM(None, SADDR); SC(IMMU(2));
+ 
+         }
+@@ -5091,7 +5093,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%ea0, #%1");
+-#line 618 "rl78-decode.opc"
++#line 620 "rl78-decode.opc"
+           ID(mov); DM(DE, IMMU(1)); SC(IMMU(1));
+ 
+         }
+@@ -5106,7 +5108,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("movw	%s0, #%1");
+-#line 898 "rl78-decode.opc"
++#line 900 "rl78-decode.opc"
+           ID(mov); W(); DM(None, SFR); SC(IMMU(2));
+ 
+         }
+@@ -5121,7 +5123,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%ea0, #%1");
+-#line 630 "rl78-decode.opc"
++#line 632 "rl78-decode.opc"
+           ID(mov); DM(HL, IMMU(1)); SC(IMMU(1));
+ 
+         }
+@@ -5136,7 +5138,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, #%1");
+-#line 744 "rl78-decode.opc"
++#line 746 "rl78-decode.opc"
+           ID(mov); DM(None, SADDR); SC(IMMU(1));
+ 
+         }
+@@ -5151,7 +5153,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%s0, #%1");
+-#line 750 "rl78-decode.opc"
++#line 752 "rl78-decode.opc"
+           op0 = SFR;
+           op1 = IMMU(1);
+           ID(mov); DM(None, op0); SC(op1);
+@@ -5193,7 +5195,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%e!0, #%1");
+-#line 609 "rl78-decode.opc"
++#line 611 "rl78-decode.opc"
+           ID(mov); DM(None, IMMU(2)); SC(IMMU(1));
+ 
+         }
+@@ -5204,7 +5206,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0xd3:
+         {
+           /** 1101 00rg			cmp0	%0				*/
+-#line 518 "rl78-decode.opc"
++#line 520 "rl78-decode.opc"
+           int rg AU = op[0] & 0x03;
+           if (trace)
+             {
+@@ -5214,7 +5216,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rg = 0x%x\n", rg);
+             }
+           SYNTAX("cmp0	%0");
+-#line 518 "rl78-decode.opc"
++#line 520 "rl78-decode.opc"
+           ID(cmp); DRB(rg); SC(0); Fzac;
+ 
+         }
+@@ -5229,7 +5231,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmp0	%0");
+-#line 521 "rl78-decode.opc"
++#line 523 "rl78-decode.opc"
+           ID(cmp); DM(None, SADDR); SC(0); Fzac;
+ 
+         /*----------------------------------------------------------------------*/
+@@ -5246,7 +5248,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("cmp0	%e!0");
+-#line 515 "rl78-decode.opc"
++#line 517 "rl78-decode.opc"
+           ID(cmp); DM(None, IMMU(2)); SC(0); Fzac;
+ 
+         }
+@@ -5261,7 +5263,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mulu	x");
+-#line 906 "rl78-decode.opc"
++#line 908 "rl78-decode.opc"
+           ID(mulu);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -5278,7 +5280,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("ret");
+-#line 1002 "rl78-decode.opc"
++#line 1004 "rl78-decode.opc"
+           ID(ret);
+ 
+         }
+@@ -5293,7 +5295,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %1");
+-#line 711 "rl78-decode.opc"
++#line 713 "rl78-decode.opc"
+           ID(mov); DR(X); SM(None, SADDR);
+ 
+         }
+@@ -5308,7 +5310,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %e!1");
+-#line 708 "rl78-decode.opc"
++#line 710 "rl78-decode.opc"
+           ID(mov); DR(X); SM(None, IMMU(2));
+ 
+         }
+@@ -5318,7 +5320,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0xfa:
+         {
+           /** 11ra 1010			movw	%0, %1				*/
+-#line 889 "rl78-decode.opc"
++#line 891 "rl78-decode.opc"
+           int ra AU = (op[0] >> 4) & 0x03;
+           if (trace)
+             {
+@@ -5328,7 +5330,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  ra = 0x%x\n", ra);
+             }
+           SYNTAX("movw	%0, %1");
+-#line 889 "rl78-decode.opc"
++#line 891 "rl78-decode.opc"
+           ID(mov); W(); DRW(ra); SM(None, SADDR);
+ 
+         }
+@@ -5338,7 +5340,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0xfb:
+         {
+           /** 11ra 1011			movw	%0, %es!1			*/
+-#line 886 "rl78-decode.opc"
++#line 888 "rl78-decode.opc"
+           int ra AU = (op[0] >> 4) & 0x03;
+           if (trace)
+             {
+@@ -5348,7 +5350,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  ra = 0x%x\n", ra);
+             }
+           SYNTAX("movw	%0, %es!1");
+-#line 886 "rl78-decode.opc"
++#line 888 "rl78-decode.opc"
+           ID(mov); W(); DRW(ra); SM(None, IMMU(2));
+ 
+         }
+@@ -5363,7 +5365,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("bc	$%a0");
+-#line 334 "rl78-decode.opc"
++#line 336 "rl78-decode.opc"
+           ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(C);
+ 
+         }
+@@ -5378,7 +5380,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("bz	$%a0");
+-#line 346 "rl78-decode.opc"
++#line 348 "rl78-decode.opc"
+           ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(Z);
+ 
+         }
+@@ -5393,7 +5395,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("bnc	$%a0");
+-#line 337 "rl78-decode.opc"
++#line 339 "rl78-decode.opc"
+           ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(NC);
+ 
+         }
+@@ -5408,7 +5410,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("bnz	$%a0");
+-#line 349 "rl78-decode.opc"
++#line 351 "rl78-decode.opc"
+           ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(NZ);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -5421,7 +5423,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0xe3:
+         {
+           /** 1110 00rg			oneb	%0				*/
+-#line 924 "rl78-decode.opc"
++#line 926 "rl78-decode.opc"
+           int rg AU = op[0] & 0x03;
+           if (trace)
+             {
+@@ -5431,7 +5433,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rg = 0x%x\n", rg);
+             }
+           SYNTAX("oneb	%0");
+-#line 924 "rl78-decode.opc"
++#line 926 "rl78-decode.opc"
+           ID(mov); DRB(rg); SC(1);
+ 
+         }
+@@ -5446,7 +5448,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("oneb	%0");
+-#line 927 "rl78-decode.opc"
++#line 929 "rl78-decode.opc"
+           ID(mov); DM(None, SADDR); SC(1);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -5463,7 +5465,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("oneb	%e!0");
+-#line 921 "rl78-decode.opc"
++#line 923 "rl78-decode.opc"
+           ID(mov); DM(None, IMMU(2)); SC(1);
+ 
+         }
+@@ -5478,7 +5480,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("onew	%0");
+-#line 932 "rl78-decode.opc"
++#line 934 "rl78-decode.opc"
+           ID(mov); DR(AX); SC(1);
+ 
+         }
+@@ -5493,7 +5495,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("onew	%0");
+-#line 935 "rl78-decode.opc"
++#line 937 "rl78-decode.opc"
+           ID(mov); DR(BC); SC(1);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -5510,7 +5512,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %1");
+-#line 699 "rl78-decode.opc"
++#line 701 "rl78-decode.opc"
+           ID(mov); DR(B); SM(None, SADDR);
+ 
+         }
+@@ -5525,7 +5527,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %e!1");
+-#line 693 "rl78-decode.opc"
++#line 695 "rl78-decode.opc"
+           ID(mov); DR(B); SM(None, IMMU(2));
+ 
+         }
+@@ -5540,7 +5542,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("br	!%!a0");
+-#line 368 "rl78-decode.opc"
++#line 370 "rl78-decode.opc"
+           ID(branch); DC(IMMU(3));
+ 
+         }
+@@ -5555,7 +5557,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("br	%!a0");
+-#line 371 "rl78-decode.opc"
++#line 373 "rl78-decode.opc"
+           ID(branch); DC(IMMU(2));
+ 
+         }
+@@ -5570,7 +5572,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("br	$%!a0");
+-#line 374 "rl78-decode.opc"
++#line 376 "rl78-decode.opc"
+           ID(branch); DC(pc+IMMS(2)+3);
+ 
+         }
+@@ -5585,7 +5587,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("br	$%a0");
+-#line 377 "rl78-decode.opc"
++#line 379 "rl78-decode.opc"
+           ID(branch); DC(pc+IMMS(1)+2);
+ 
+         }
+@@ -5596,7 +5598,7 @@ rl78_decode_opcode (unsigned long pc AU,
+     case 0xf3:
+         {
+           /** 1111 00rg			clrb	%0				*/
+-#line 464 "rl78-decode.opc"
++#line 466 "rl78-decode.opc"
+           int rg AU = op[0] & 0x03;
+           if (trace)
+             {
+@@ -5606,7 +5608,7 @@ rl78_decode_opcode (unsigned long pc AU,
+               printf ("  rg = 0x%x\n", rg);
+             }
+           SYNTAX("clrb	%0");
+-#line 464 "rl78-decode.opc"
++#line 466 "rl78-decode.opc"
+           ID(mov); DRB(rg); SC(0);
+ 
+         }
+@@ -5621,7 +5623,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("clrb	%0");
+-#line 467 "rl78-decode.opc"
++#line 469 "rl78-decode.opc"
+           ID(mov); DM(None, SADDR); SC(0);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -5638,7 +5640,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("clrb	%e!0");
+-#line 461 "rl78-decode.opc"
++#line 463 "rl78-decode.opc"
+           ID(mov); DM(None, IMMU(2)); SC(0);
+ 
+         }
+@@ -5653,7 +5655,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("clrw	%0");
+-#line 472 "rl78-decode.opc"
++#line 474 "rl78-decode.opc"
+           ID(mov); DR(AX); SC(0);
+ 
+         }
+@@ -5668,7 +5670,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("clrw	%0");
+-#line 475 "rl78-decode.opc"
++#line 477 "rl78-decode.opc"
+           ID(mov); DR(BC); SC(0);
+ 
+         /*----------------------------------------------------------------------*/
+@@ -5685,7 +5687,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %1");
+-#line 705 "rl78-decode.opc"
++#line 707 "rl78-decode.opc"
+           ID(mov); DR(C); SM(None, SADDR);
+ 
+         }
+@@ -5700,7 +5702,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("mov	%0, %e!1");
+-#line 702 "rl78-decode.opc"
++#line 704 "rl78-decode.opc"
+           ID(mov); DR(C); SM(None, IMMU(2));
+ 
+         }
+@@ -5715,7 +5717,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("call	!%!a0");
+-#line 421 "rl78-decode.opc"
++#line 423 "rl78-decode.opc"
+           ID(call); DC(IMMU(3));
+ 
+         }
+@@ -5730,7 +5732,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("call	%!a0");
+-#line 424 "rl78-decode.opc"
++#line 426 "rl78-decode.opc"
+           ID(call); DC(IMMU(2));
+ 
+         }
+@@ -5745,7 +5747,7 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("call	$%!a0");
+-#line 427 "rl78-decode.opc"
++#line 429 "rl78-decode.opc"
+           ID(call); DC(pc+IMMS(2)+3);
+ 
+         }
+@@ -5760,13 +5762,13 @@ rl78_decode_opcode (unsigned long pc AU,
+                      op[0]);
+             }
+           SYNTAX("brk1");
+-#line 385 "rl78-decode.opc"
++#line 387 "rl78-decode.opc"
+           ID(break);
+ 
+         }
+       break;
+   }
+-#line 1290 "rl78-decode.opc"
++#line 1292 "rl78-decode.opc"
+ 
+   return rl78->n_bytes;
+ }
+diff --git a/opcodes/rl78-decode.opc b/opcodes/rl78-decode.opc
+index 6212f08..b25e441 100644
+--- a/opcodes/rl78-decode.opc
++++ b/opcodes/rl78-decode.opc
+@@ -50,7 +50,9 @@ typedef struct
+ #define W() rl78->size = RL78_Word
+ 
+ #define AU ATTRIBUTE_UNUSED
+-#define GETBYTE() (ld->op [ld->rl78->n_bytes++] = ld->getbyte (ld->ptr))
++
++#define OP_BUF_LEN 20
++#define GETBYTE() (ld->rl78->n_bytes < (OP_BUF_LEN - 1) ? ld->op [ld->rl78->n_bytes++] = ld->getbyte (ld->ptr): 0)
+ #define B ((unsigned long) GETBYTE())
+ 
+ #define SYNTAX(x) rl78->syntax = x
+@@ -168,7 +170,7 @@ rl78_decode_opcode (unsigned long pc AU,
+ 		  RL78_Dis_Isa isa)
+ {
+   LocalData lds, * ld = &lds;
+-  unsigned char op_buf[20] = {0};
++  unsigned char op_buf[OP_BUF_LEN] = {0};
+   unsigned char *op = op_buf;
+   int op0, op1;
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9752.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9752.patch
new file mode 100644
index 0000000..f63a993
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9752.patch
@@ -0,0 +1,208 @@
+From c53d2e6d744da000aaafe0237bced090aab62818 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Wed, 14 Jun 2017 11:27:15 +0100
+Subject: [PATCH] Fix potential address violations when processing a corrupt
+ Alpha VMA binary.
+
+	PR binutils/21589
+	* vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
+	maximum value for the ascic pointer.  Check that name processing
+	does not read beyond this value.
+	(_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
+	end of etir record.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9752
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog   |  9 +++++++++
+ bfd/vms-alpha.c | 51 +++++++++++++++++++++++++++++++++++++++++----------
+ 2 files changed, 50 insertions(+), 10 deletions(-)
+
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -9,6 +9,15 @@
+ 
+ 2017-06-14  Nick Clifton  <nickc@redhat.com>
+  
++       PR binutils/21589
++       * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
++       maximum value for the ascic pointer.  Check that name processing
++       does not read beyond this value.
++       (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
++       end of etir record.
++
++2017-06-14  Nick Clifton  <nickc@redhat.com>
++ 
+        PR binutils/21578
+        * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
+        flag value.
+Index: git/bfd/vms-alpha.c
+===================================================================
+--- git.orig/bfd/vms-alpha.c
++++ git/bfd/vms-alpha.c
+@@ -1456,7 +1456,7 @@ dst_retrieve_location (bfd *abfd, unsign
+ /* Write multiple bytes to section image.  */
+ 
+ static bfd_boolean
+-image_write (bfd *abfd, unsigned char *ptr, int size)
++image_write (bfd *abfd, unsigned char *ptr, unsigned int size)
+ {
+ #if VMS_DEBUG
+   _bfd_vms_debug (8, "image_write from (%p, %d) to (%ld)\n", ptr, size,
+@@ -1603,14 +1603,16 @@ _bfd_vms_etir_name (int cmd)
+ #define HIGHBIT(op) ((op & 0x80000000L) == 0x80000000L)
+ 
+ static void
+-_bfd_vms_get_value (bfd *abfd, const unsigned char *ascic,
++_bfd_vms_get_value (bfd *abfd,
++		    const unsigned char *ascic,
++		    const unsigned char *max_ascic,
+                     struct bfd_link_info *info,
+                     bfd_vma *vma,
+                     struct alpha_vms_link_hash_entry **hp)
+ {
+   char name[257];
+-  int len;
+-  int i;
++  unsigned int len;
++  unsigned int i;
+   struct alpha_vms_link_hash_entry *h;
+ 
+   /* Not linking.  Do not try to resolve the symbol.  */
+@@ -1622,6 +1624,14 @@ _bfd_vms_get_value (bfd *abfd, const uns
+     }
+ 
+   len = *ascic;
++  if (ascic + len >= max_ascic)
++    {
++      _bfd_error_handler (_("Corrupt vms value"));
++      *vma = 0;
++      *hp = NULL;
++      return;
++    }
++
+   for (i = 0; i < len; i++)
+     name[i] = ascic[i + 1];
+   name[i] = 0;
+@@ -1741,6 +1751,15 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+       _bfd_hexdump (8, ptr, cmd_length - 4, 0);
+ #endif
+ 
++      /* PR 21589: Check for a corrupt ETIR record.  */
++      if (cmd_length < 4)
++	{
++	corrupt_etir:
++	  _bfd_error_handler (_("Corrupt ETIR record encountered"));
++	  bfd_set_error (bfd_error_bad_value);
++	  return FALSE;
++	}
++
+       switch (cmd)
+         {
+           /* Stack global
+@@ -1748,7 +1767,7 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+ 
+              stack 32 bit value of symbol (high bits set to 0).  */
+         case ETIR__C_STA_GBL:
+-          _bfd_vms_get_value (abfd, ptr, info, &op1, &h);
++          _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
+           _bfd_vms_push (abfd, op1, alpha_vms_sym_to_ctxt (h));
+           break;
+ 
+@@ -1757,6 +1776,8 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+ 
+              stack 32 bit value, sign extend to 64 bit.  */
+         case ETIR__C_STA_LW:
++	  if (ptr + 4 >= maxptr)
++	    goto corrupt_etir;
+           _bfd_vms_push (abfd, bfd_getl32 (ptr), RELC_NONE);
+           break;
+ 
+@@ -1765,6 +1786,8 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+ 
+              stack 64 bit value of symbol.  */
+         case ETIR__C_STA_QW:
++	  if (ptr + 8 >= maxptr)
++	    goto corrupt_etir;
+           _bfd_vms_push (abfd, bfd_getl64 (ptr), RELC_NONE);
+           break;
+ 
+@@ -1778,6 +1801,8 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+           {
+             int psect;
+ 
++	    if (ptr + 12 >= maxptr)
++	      goto corrupt_etir;
+             psect = bfd_getl32 (ptr);
+             if ((unsigned int) psect >= PRIV (section_count))
+               {
+@@ -1867,6 +1892,8 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+           {
+             int size;
+ 
++	    if (ptr + 4 >= maxptr)
++	      goto corrupt_etir;
+             size = bfd_getl32 (ptr);
+             _bfd_vms_pop (abfd, &op1, &rel1);
+             if (rel1 != RELC_NONE)
+@@ -1879,7 +1906,7 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+           /* Store global: write symbol value
+              arg: cs	global symbol name.  */
+         case ETIR__C_STO_GBL:
+-          _bfd_vms_get_value (abfd, ptr, info, &op1, &h);
++          _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
+           if (h && h->sym)
+             {
+               if (h->sym->typ == EGSD__C_SYMG)
+@@ -1901,7 +1928,7 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+           /* Store code address: write address of entry point
+              arg: cs	global symbol name (procedure).  */
+         case ETIR__C_STO_CA:
+-          _bfd_vms_get_value (abfd, ptr, info, &op1, &h);
++          _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
+           if (h && h->sym)
+             {
+               if (h->sym->flags & EGSY__V_NORM)
+@@ -1946,8 +1973,10 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+              da	data.  */
+         case ETIR__C_STO_IMM:
+           {
+-            int size;
++            unsigned int size;
+ 
++	    if (ptr + 4 >= maxptr)
++	      goto corrupt_etir;
+             size = bfd_getl32 (ptr);
+             image_write (abfd, ptr + 4, size);
+           }
+@@ -1960,7 +1989,7 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+              store global longword: store 32bit value of symbol
+              arg: cs	symbol name.  */
+         case ETIR__C_STO_GBL_LW:
+-          _bfd_vms_get_value (abfd, ptr, info, &op1, &h);
++          _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
+ #if 0
+           abort ();
+ #endif
+@@ -2013,7 +2042,7 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+              da	signature.  */
+ 
+         case ETIR__C_STC_LP_PSB:
+-          _bfd_vms_get_value (abfd, ptr + 4, info, &op1, &h);
++          _bfd_vms_get_value (abfd, ptr + 4, maxptr, info, &op1, &h);
+           if (h && h->sym)
+             {
+               if (h->sym->typ == EGSD__C_SYMG)
+@@ -2109,6 +2138,8 @@ _bfd_vms_slurp_etir (bfd *abfd, struct b
+           /* Augment relocation base: increment image location counter by offset
+              arg: lw	offset value.  */
+         case ETIR__C_CTL_AUGRB:
++	  if (ptr + 4 >= maxptr)
++	    goto corrupt_etir;
+           op1 = bfd_getl32 (ptr);
+           image_inc_ptr (abfd, op1);
+           break;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9753.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9753.patch
new file mode 100644
index 0000000..241142b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9753.patch
@@ -0,0 +1,79 @@
+From 04f963fd489cae724a60140e13984415c205f4ac Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Wed, 14 Jun 2017 10:35:16 +0100
+Subject: [PATCH] Fix seg-faults in objdump when disassembling a corrupt
+ versados binary.
+
+	PR binutils/21591
+	* versados.c (versados_mkobject): Zero the allocated tdata structure.
+	(process_otr): Check for an invalid offset in the otr structure.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9753
+CVE: CVE-2017-9754
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog  |  6 ++++++
+ bfd/versados.c | 12 ++++++++----
+ 2 files changed, 14 insertions(+), 4 deletions(-)
+
+Index: git/bfd/versados.c
+===================================================================
+--- git.orig/bfd/versados.c
++++ git/bfd/versados.c
+@@ -149,7 +149,7 @@ versados_mkobject (bfd *abfd)
+   if (abfd->tdata.versados_data == NULL)
+     {
+       bfd_size_type amt = sizeof (tdata_type);
+-      tdata_type *tdata = bfd_alloc (abfd, amt);
++      tdata_type *tdata = bfd_zalloc (abfd, amt);
+ 
+       if (tdata == NULL)
+ 	return FALSE;
+@@ -345,13 +345,13 @@ reloc_howto_type versados_howto_table[]
+ };
+ 
+ static int
+-get_offset (int len, unsigned char *ptr)
++get_offset (unsigned int len, unsigned char *ptr)
+ {
+   int val = 0;
+ 
+   if (len)
+     {
+-      int i;
++      unsigned int i;
+ 
+       val = *ptr++;
+       if (val & 0x80)
+@@ -394,9 +394,13 @@ process_otr (bfd *abfd, struct ext_otr *
+ 	  int flag = *srcp++;
+ 	  int esdids = (flag >> 5) & 0x7;
+ 	  int sizeinwords = ((flag >> 3) & 1) ? 2 : 1;
+-	  int offsetlen = flag & 0x7;
++	  unsigned int offsetlen = flag & 0x7;
+ 	  int j;
+ 
++	  /* PR 21591: Check for invalid lengths.  */
++	  if (srcp + esdids + offsetlen >= endp)
++	    return;
++
+ 	  if (esdids == 0)
+ 	    {
+ 	      /* A zero esdid means the new pc is the offset given.  */
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -8,6 +8,10 @@
+        (ieee_archive_p): Likewise.
+ 
+ 2017-06-14  Nick Clifton  <nickc@redhat.com>
++
++       PR binutils/21591
++       * versados.c (versados_mkobject): Zero the allocated tdata structure.
++       (process_otr): Check for an invalid offset in the otr structure.
+  
+        PR binutils/21589
+        * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9755.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9755.patch
new file mode 100644
index 0000000..15dc909
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9755.patch
@@ -0,0 +1,63 @@
+From 0d96e4df4812c3bad77c229dfef47a9bc115ac12 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Thu, 15 Jun 2017 06:40:17 -0700
+Subject: [PATCH] i386-dis: Check valid bnd register
+
+Since there are only 4 bnd registers, return "(bad)" for register
+number > 3.
+
+	PR binutils/21594
+	* i386-dis.c (OP_E_register): Check valid bnd register.
+	(OP_G): Likewise.
+
+Upstream-Status: Backport 
+CVE: CVE-2017-9755
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ opcodes/ChangeLog  |  6 ++++++
+ opcodes/i386-dis.c | 10 ++++++++++
+ 2 files changed, 16 insertions(+)
+
+Index: git/opcodes/ChangeLog
+===================================================================
+--- git.orig/opcodes/ChangeLog
++++ git/opcodes/ChangeLog
+@@ -1,3 +1,9 @@
++2017-06-15  H.J. Lu  <hongjiu.lu@intel.com>
++
++	PR binutils/21594
++	* i386-dis.c (OP_E_register): Check valid bnd register.
++	(OP_G): Likewise.
++
+ 2017-06-15  Nick Clifton  <nickc@redhat.com>
+ 
+ 	PR binutils/21588
+Index: git/opcodes/i386-dis.c
+===================================================================
+--- git.orig/opcodes/i386-dis.c
++++ git/opcodes/i386-dis.c
+@@ -14939,6 +14939,11 @@ OP_E_register (int bytemode, int sizefla
+       names = address_mode == mode_64bit ? names64 : names32;
+       break;
+     case bnd_mode:
++      if (reg > 0x3)
++	{
++	  oappend ("(bad)");
++	  return;
++	}
+       names = names_bnd;
+       break;
+     case indir_v_mode:
+@@ -15483,6 +15488,11 @@ OP_G (int bytemode, int sizeflag)
+       oappend (names64[modrm.reg + add]);
+       break;
+     case bnd_mode:
++      if (modrm.reg > 0x3)
++	{
++	  oappend ("(bad)");
++	  return;
++	}
+       oappend (names_bnd[modrm.reg]);
+       break;
+     case v_mode:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9756.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9756.patch
new file mode 100644
index 0000000..191d0be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9756.patch
@@ -0,0 +1,50 @@
+From cd3ea7c69acc5045eb28f9bf80d923116e15e4f5 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Thu, 15 Jun 2017 13:26:54 +0100
+Subject: [PATCH] Prevent address violation problem when disassembling corrupt
+ aarch64 binary.
+
+	PR binutils/21595
+	* aarch64-dis.c (aarch64_ext_ldst_reglist): Check for an out of
+	range value.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9756
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ opcodes/ChangeLog     | 6 ++++++
+ opcodes/aarch64-dis.c | 3 +++
+ 2 files changed, 9 insertions(+)
+
+Index: git/opcodes/ChangeLog
+===================================================================
+--- git.orig/opcodes/ChangeLog
++++ git/opcodes/ChangeLog
+@@ -6,6 +6,12 @@
+ 
+ 2017-06-15  Nick Clifton  <nickc@redhat.com>
+ 
++	PR binutils/21595
++	* aarch64-dis.c (aarch64_ext_ldst_reglist): Check for an out of
++	range value.
++
++2017-06-15  Nick Clifton  <nickc@redhat.com>
++
+ 	PR binutils/21588
+ 	* rl78-decode.opc (OP_BUF_LEN): Define.
+ 	(GETBYTE): Check for the index exceeding OP_BUF_LEN.
+Index: git/opcodes/aarch64-dis.c
+===================================================================
+--- git.orig/opcodes/aarch64-dis.c
++++ git/opcodes/aarch64-dis.c
+@@ -409,6 +409,9 @@ aarch64_ext_ldst_reglist (const aarch64_
+   info->reglist.first_regno = extract_field (FLD_Rt, code, 0);
+   /* opcode */
+   value = extract_field (FLD_opcode, code, 0);
++  /* PR 21595: Check for a bogus value.  */
++  if (value >= ARRAY_SIZE (data))
++    return 0;
+   if (expected_num != data[value].num_elements || data[value].is_reserved)
+     return 0;
+   info->reglist.num_regs = data[value].num_regs;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9954.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9954.patch
new file mode 100644
index 0000000..8a9d7eb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9954.patch
@@ -0,0 +1,58 @@
+From 04e15b4a9462cb1ae819e878a6009829aab8020b Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Mon, 26 Jun 2017 15:46:34 +0100
+Subject: [PATCH] Fix address violation parsing a corrupt texhex format file.
+
+	PR binutils/21670
+	* tekhex.c (getvalue): Check for the source pointer exceeding the
+	end pointer before the first byte is read.
+
+Upstream-Status: Backport
+CVE: CVE_2017-9954
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog | 6 ++++++
+ bfd/tekhex.c  | 6 +++++-
+ 2 files changed, 11 insertions(+), 1 deletion(-)
+
+Index: git/bfd/tekhex.c
+===================================================================
+--- git.orig/bfd/tekhex.c
++++ git/bfd/tekhex.c
+@@ -273,6 +273,9 @@ getvalue (char **srcp, bfd_vma *valuep,
+   bfd_vma value = 0;
+   unsigned int len;
+ 
++  if (src >= endp)
++    return FALSE;
++
+   if (!ISHEX (*src))
+     return FALSE;
+ 
+@@ -514,9 +517,10 @@ pass_over (bfd *abfd, bfd_boolean (*func
+   /* To the front of the file.  */
+   if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
+     return FALSE;
++
+   while (! is_eof)
+     {
+-      char src[MAXCHUNK];
++      static char src[MAXCHUNK];
+       char type;
+ 
+       /* Find first '%'.  */
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,9 @@
++2017-06-26  Nick Clifton  <nickc@redhat.com>
++ 
++       PR binutils/21670
++       * tekhex.c (getvalue): Check for the source pointer exceeding the
++       end pointer before the first byte is read.
++
+ 2017-06-15  Nick Clifton  <nickc@redhat.com>
+ 
+        PR binutils/21582
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_1.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_1.patch
new file mode 100644
index 0000000..774670f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_1.patch
@@ -0,0 +1,168 @@
+From cfd14a500e0485374596234de4db10e88ebc7618 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Mon, 26 Jun 2017 15:25:08 +0100
+Subject: [PATCH] Fix address violations when atempting to parse fuzzed
+ binaries.
+
+	PR binutils/21665
+bfd	* opncls.c (get_build_id): Check that the section is beig enough
+	to contain the whole note.
+	* compress.c (bfd_get_full_section_contents): Check for and reject
+	a section whoes size is greater than the size of the entire file.
+	* elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
+	contain a notes section.
+
+binutils* objdump.c (disassemble_section): Skip any section that is bigger
+	than the entire file.
+
+Upstream-Status: Backport 
+CVE: CVE-2017-9955 #1
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog      | 10 ++++++++++
+ bfd/compress.c     |  6 ++++++
+ bfd/elf32-v850.c   |  4 +++-
+ bfd/opncls.c       | 18 ++++++++++++++++--
+ binutils/ChangeLog |  6 ++++++
+ binutils/objdump.c |  4 ++--
+ 6 files changed, 43 insertions(+), 5 deletions(-)
+
+Index: git/bfd/compress.c
+===================================================================
+--- git.orig/bfd/compress.c
++++ git/bfd/compress.c
+@@ -239,6 +239,12 @@ bfd_get_full_section_contents (bfd *abfd
+       *ptr = NULL;
+       return TRUE;
+     }
++  else if (bfd_get_file_size (abfd) > 0
++	   && sz > (bfd_size_type) bfd_get_file_size (abfd))
++    {
++      *ptr = NULL;
++      return FALSE;
++    }
+ 
+   switch (sec->compress_status)
+     {
+Index: git/bfd/elf32-v850.c
+===================================================================
+--- git.orig/bfd/elf32-v850.c
++++ git/bfd/elf32-v850.c
+@@ -2450,7 +2450,9 @@ v850_elf_copy_notes (bfd *ibfd, bfd *obf
+ 	BFD_ASSERT (bfd_malloc_and_get_section (ibfd, inotes, & icont));
+ 
+       if ((ocont = elf_section_data (onotes)->this_hdr.contents) == NULL)
+-	BFD_ASSERT (bfd_malloc_and_get_section (obfd, onotes, & ocont));
++	/* If the output is being stripped then it is possible for
++	   the notes section to disappear.  In this case do nothing.  */
++	return;
+ 
+       /* Copy/overwrite notes from the input to the output.  */
+       memcpy (ocont, icont, bfd_section_size (obfd, onotes));
+Index: git/bfd/opncls.c
+===================================================================
+--- git.orig/bfd/opncls.c
++++ git/bfd/opncls.c
+@@ -1776,6 +1776,7 @@ get_build_id (bfd *abfd)
+   Elf_External_Note *enote;
+   bfd_byte *contents;
+   asection *sect;
++  bfd_size_type size;
+ 
+   BFD_ASSERT (abfd);
+ 
+@@ -1790,8 +1791,9 @@ get_build_id (bfd *abfd)
+       return NULL;
+     }
+ 
++  size = bfd_get_section_size (sect);
+   /* FIXME: Should we support smaller build-id notes ?  */
+-  if (bfd_get_section_size (sect) < 0x24)
++  if (size < 0x24)
+     {
+       bfd_set_error (bfd_error_invalid_operation);
+       return NULL;
+@@ -1804,6 +1806,17 @@ get_build_id (bfd *abfd)
+       return NULL;
+     }
+ 
++  /* FIXME: Paranoia - allow for compressed build-id sections.
++     Maybe we should complain if this size is different from
++     the one obtained above...  */
++  size = bfd_get_section_size (sect);
++  if (size < sizeof (Elf_External_Note))
++    {
++      bfd_set_error (bfd_error_invalid_operation);
++      free (contents);
++      return NULL;
++    }
++
+   enote = (Elf_External_Note *) contents;
+   inote.type = H_GET_32 (abfd, enote->type);
+   inote.namesz = H_GET_32 (abfd, enote->namesz);
+@@ -1815,7 +1828,8 @@ get_build_id (bfd *abfd)
+   if (inote.descsz == 0
+       || inote.type != NT_GNU_BUILD_ID
+       || inote.namesz != 4 /* sizeof "GNU"  */
+-      || strcmp (inote.namedata, "GNU") != 0)
++      || strncmp (inote.namedata, "GNU", 4) != 0
++      || size < (12 + BFD_ALIGN (inote.namesz, 4) + inote.descsz))
+     {
+       free (contents);
+       bfd_set_error (bfd_error_invalid_operation);
+Index: git/binutils/objdump.c
+===================================================================
+--- git.orig/binutils/objdump.c
++++ git/binutils/objdump.c
+@@ -2048,7 +2048,7 @@ disassemble_section (bfd *abfd, asection
+     return;
+ 
+   datasize = bfd_get_section_size (section);
+-  if (datasize == 0)
++  if (datasize == 0 || datasize >= (bfd_size_type) bfd_get_file_size (abfd))
+     return;
+ 
+   if (start_address == (bfd_vma) -1
+@@ -2912,7 +2912,7 @@ dump_target_specific (bfd *abfd)
+ static void
+ dump_section (bfd *abfd, asection *section, void *dummy ATTRIBUTE_UNUSED)
+ {
+-  bfd_byte *data = 0;
++  bfd_byte *data = NULL;
+   bfd_size_type datasize;
+   bfd_vma addr_offset;
+   bfd_vma start_offset;
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,4 +1,14 @@
+ 2017-06-26  Nick Clifton  <nickc@redhat.com>
++
++       PR binutils/21665
++       * opncls.c (get_build_id): Check that the section is beig enough
++       to contain the whole note.
++       * compress.c (bfd_get_full_section_contents): Check for and reject
++       a section whoes size is greater than the size of the entire file.
++       * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
++       contain a notes section.
++
++2017-06-26  Nick Clifton  <nickc@redhat.com>
+  
+        PR binutils/21670
+        * tekhex.c (getvalue): Check for the source pointer exceeding the
+Index: git/binutils/ChangeLog
+===================================================================
+--- git.orig/binutils/ChangeLog
++++ git/binutils/ChangeLog
+@@ -1,3 +1,9 @@
++2017-06-26  Nick Clifton  <nickc@redhat.com>
++ 
++       PR binutils/21665
++       * objdump.c (disassemble_section): Skip any section that is bigger
++       than the entire file.
++
+ 2017-04-03  Nick Clifton  <nickc@redhat.com>
+ 
+        PR binutils/21345
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_2.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_2.patch
new file mode 100644
index 0000000..f95295f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_2.patch
@@ -0,0 +1,122 @@
+From 0630b49c470ca2e3c3f74da4c7e4ff63440dd71f Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Mon, 26 Jun 2017 09:24:49 -0700
+Subject: [PATCH] Check file size before getting section contents
+
+Don't check the section size in bfd_get_full_section_contents since
+the size of a decompressed section may be larger than the file size.
+Instead, check file size in _bfd_generic_get_section_contents.
+
+	PR binutils/21665
+	* compress.c (bfd_get_full_section_contents): Don't check the
+	file size here.
+	* libbfd.c (_bfd_generic_get_section_contents): Check for and
+	reject a section whoes size + offset is greater than the size
+	of the entire file.
+	(_bfd_generic_get_section_contents_in_window): Likewise.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9955 #2
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog  | 10 +++++++++-
+ bfd/compress.c |  8 +-------
+ bfd/libbfd.c   | 17 ++++++++++++++++-
+ 3 files changed, 26 insertions(+), 9 deletions(-)
+
+Index: git/bfd/compress.c
+===================================================================
+--- git.orig/bfd/compress.c
++++ git/bfd/compress.c
+@@ -239,12 +239,6 @@ bfd_get_full_section_contents (bfd *abfd
+       *ptr = NULL;
+       return TRUE;
+     }
+-  else if (bfd_get_file_size (abfd) > 0
+-	   && sz > (bfd_size_type) bfd_get_file_size (abfd))
+-    {
+-      *ptr = NULL;
+-      return FALSE;
+-    }
+ 
+   switch (sec->compress_status)
+     {
+@@ -260,7 +254,7 @@ bfd_get_full_section_contents (bfd *abfd
+ 		  /* xgettext:c-format */
+ 		  (_("error: %B(%A) is too large (%#lx bytes)"),
+ 		  abfd, sec, (long) sz);
+-	    return FALSE;
++	      return FALSE;
+ 	    }
+ 	}
+ 
+Index: git/bfd/libbfd.c
+===================================================================
+--- git.orig/bfd/libbfd.c
++++ git/bfd/libbfd.c
+@@ -780,6 +780,7 @@ _bfd_generic_get_section_contents (bfd *
+ 				   bfd_size_type count)
+ {
+   bfd_size_type sz;
++  file_ptr filesz;
+   if (count == 0)
+     return TRUE;
+ 
+@@ -802,8 +803,15 @@ _bfd_generic_get_section_contents (bfd *
+     sz = section->rawsize;
+   else
+     sz = section->size;
++  filesz = bfd_get_file_size (abfd);
++  if (filesz < 0)
++    {
++      /* This should never happen.  */
++      abort ();
++    }
+   if (offset + count < count
+-      || offset + count > sz)
++      || offset + count > sz
++      || (section->filepos + offset + sz) > (bfd_size_type) filesz)
+     {
+       bfd_set_error (bfd_error_invalid_operation);
+       return FALSE;
+@@ -826,6 +834,7 @@ _bfd_generic_get_section_contents_in_win
+ {
+ #ifdef USE_MMAP
+   bfd_size_type sz;
++  file_ptr filesz;
+ 
+   if (count == 0)
+     return TRUE;
+@@ -858,7 +867,13 @@ _bfd_generic_get_section_contents_in_win
+     sz = section->rawsize;
+   else
+     sz = section->size;
++  filesz = bfd_get_file_size (abfd);
++    {
++      /* This should never happen.  */
++      abort ();
++    }
+   if (offset + count > sz
++      || (section->filepos + offset + sz) > (bfd_size_type) filesz
+       || ! bfd_get_file_window (abfd, section->filepos + offset, count, w,
+ 				TRUE))
+     return FALSE;
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,13 @@
++2017-06-26  H.J. Lu  <hongjiu.lu@intel.com>
++
++       PR binutils/21665
++       * compress.c (bfd_get_full_section_contents): Don't check the
++       file size here.
++       * libbfd.c (_bfd_generic_get_section_contents): Check for and
++       reject a section whoes size + offset is greater than the size
++       of the entire file.
++       (_bfd_generic_get_section_contents_in_window): Likewise.
++
+ 2017-06-26  Nick Clifton  <nickc@redhat.com>
+ 
+        PR binutils/21665
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_3.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_3.patch
new file mode 100644
index 0000000..1b67c4e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_3.patch
@@ -0,0 +1,48 @@
+From 1f473e3d0ad285195934e6a077c7ed32afe66437 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Mon, 26 Jun 2017 15:47:16 -0700
+Subject: [PATCH] Add a missing line to
+ _bfd_generic_get_section_contents_in_window
+
+	PR binutils/21665
+	* libbfd.c (_bfd_generic_get_section_contents_in_window): Add
+	a missing line.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9955 #3
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog | 6 ++++++
+ bfd/libbfd.c  | 1 +
+ 2 files changed, 7 insertions(+)
+
+Index: git/bfd/libbfd.c
+===================================================================
+--- git.orig/bfd/libbfd.c
++++ git/bfd/libbfd.c
+@@ -868,6 +868,7 @@ _bfd_generic_get_section_contents_in_win
+   else
+     sz = section->size;
+   filesz = bfd_get_file_size (abfd);
++  if (filesz < 0)
+     {
+       /* This should never happen.  */
+       abort ();
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,6 +1,12 @@
+ 2017-06-26  H.J. Lu  <hongjiu.lu@intel.com>
+ 
+        PR binutils/21665
++       * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
++       a missing line.
++
++2017-06-26  H.J. Lu  <hongjiu.lu@intel.com>
++
++       PR binutils/21665
+        * compress.c (bfd_get_full_section_contents): Don't check the
+        file size here.
+        * libbfd.c (_bfd_generic_get_section_contents): Check for and
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_4.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_4.patch
new file mode 100644
index 0000000..97d529a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_4.patch
@@ -0,0 +1,51 @@
+From ab27f80c5dceaa23c4ba7f62c0d5d22a5d5dd7a1 Mon Sep 17 00:00:00 2001
+From: Pedro Alves <palves@redhat.com>
+Date: Tue, 27 Jun 2017 00:21:25 +0100
+Subject: [PATCH] Fix GDB regressions caused by previous
+ bfd_get_section_contents changes
+
+Ref: https://sourceware.org/ml/binutils/2017-06/msg00343.html
+
+bfd/ChangeLog:
+2017-06-26  Pedro Alves  <palves@redhat.com>
+
+	PR binutils/21665
+	* libbfd.c (_bfd_generic_get_section_contents): Add "count", not
+	"sz".
+
+Upstream-Status: Backport
+CVE: CVE-2017-9955 #4
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog | 6 ++++++
+ bfd/libbfd.c  | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,9 @@
++2017-06-26  Pedro Alves  <palves@redhat.com>
++
++	PR binutils/21665
++	* libbfd.c (_bfd_generic_get_section_contents): Add "count", not
++	"sz".
++
+ 2017-06-26  H.J. Lu  <hongjiu.lu@intel.com>
+ 
+        PR binutils/21665
+Index: git/bfd/libbfd.c
+===================================================================
+--- git.orig/bfd/libbfd.c
++++ git/bfd/libbfd.c
+@@ -811,7 +811,7 @@ _bfd_generic_get_section_contents (bfd *
+     }
+   if (offset + count < count
+       || offset + count > sz
+-      || (section->filepos + offset + sz) > (bfd_size_type) filesz)
++      || (section->filepos + offset + count) > (bfd_size_type) filesz)
+     {
+       bfd_set_error (bfd_error_invalid_operation);
+       return FALSE;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_5.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_5.patch
new file mode 100644
index 0000000..da3bd37
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_5.patch
@@ -0,0 +1,89 @@
+From 7211ae501eb0de1044983f2dfb00091a58fbd66c Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Tue, 27 Jun 2017 09:45:04 +0930
+Subject: [PATCH] More fixes for bfd_get_section_contents change
+
+	PR binutils/21665
+	* libbfd.c (_bfd_generic_get_section_contents): Delete abort.
+	Use unsigned file pointer type, and remove cast.
+	* libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
+	Add "count", not "sz".
+
+Upstream-Status: Backport
+CVE: CVE-2017-9955 #5
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog |  8 ++++++++
+ bfd/libbfd.c  | 18 ++++--------------
+ 2 files changed, 12 insertions(+), 14 deletions(-)
+
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,11 @@
++2017-06-27  Alan Modra  <amodra@gmail.com>
++
++	PR binutils/21665
++	* libbfd.c (_bfd_generic_get_section_contents): Delete abort.
++	Use unsigned file pointer type, and remove cast.
++	* libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
++	Add "count", not "sz".
++
+ 2017-06-26  Pedro Alves  <palves@redhat.com>
+ 
+ 	PR binutils/21665
+Index: git/bfd/libbfd.c
+===================================================================
+--- git.orig/bfd/libbfd.c
++++ git/bfd/libbfd.c
+@@ -780,7 +780,7 @@ _bfd_generic_get_section_contents (bfd *
+ 				   bfd_size_type count)
+ {
+   bfd_size_type sz;
+-  file_ptr filesz;
++  ufile_ptr filesz;
+   if (count == 0)
+     return TRUE;
+ 
+@@ -804,14 +804,9 @@ _bfd_generic_get_section_contents (bfd *
+   else
+     sz = section->size;
+   filesz = bfd_get_file_size (abfd);
+-  if (filesz < 0)
+-    {
+-      /* This should never happen.  */
+-      abort ();
+-    }
+   if (offset + count < count
+       || offset + count > sz
+-      || (section->filepos + offset + count) > (bfd_size_type) filesz)
++      || section->filepos + offset + count > filesz)
+     {
+       bfd_set_error (bfd_error_invalid_operation);
+       return FALSE;
+@@ -834,7 +829,7 @@ _bfd_generic_get_section_contents_in_win
+ {
+ #ifdef USE_MMAP
+   bfd_size_type sz;
+-  file_ptr filesz;
++  ufile_ptr filesz;
+ 
+   if (count == 0)
+     return TRUE;
+@@ -868,13 +863,8 @@ _bfd_generic_get_section_contents_in_win
+   else
+     sz = section->size;
+   filesz = bfd_get_file_size (abfd);
+-  if (filesz < 0)
+-    {
+-      /* This should never happen.  */
+-      abort ();
+-    }
+   if (offset + count > sz
+-      || (section->filepos + offset + sz) > (bfd_size_type) filesz
++      || section->filepos + offset + count > filesz
+       || ! bfd_get_file_window (abfd, section->filepos + offset, count, w,
+ 				TRUE))
+     return FALSE;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_6.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_6.patch
new file mode 100644
index 0000000..e36429a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_6.patch
@@ -0,0 +1,56 @@
+From ea9aafc41a764e4e2dbb88a7b031e886b481b99a Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Tue, 27 Jun 2017 14:43:49 +0930
+Subject: [PATCH] Warning fix
+
+	PR binutils/21665
+	* libbfd.c (_bfd_generic_get_section_contents): Warning fix.
+	(_bfd_generic_get_section_contents_in_window): Likewise.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9955 #6
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog | 12 +++++++++---
+ bfd/libbfd.c  |  4 ++--
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+Index: git/bfd/libbfd.c
+===================================================================
+--- git.orig/bfd/libbfd.c
++++ git/bfd/libbfd.c
+@@ -806,7 +806,7 @@ _bfd_generic_get_section_contents (bfd *
+   filesz = bfd_get_file_size (abfd);
+   if (offset + count < count
+       || offset + count > sz
+-      || section->filepos + offset + count > filesz)
++      || (ufile_ptr) section->filepos + offset + count > filesz)
+     {
+       bfd_set_error (bfd_error_invalid_operation);
+       return FALSE;
+@@ -864,7 +864,7 @@ _bfd_generic_get_section_contents_in_win
+     sz = section->size;
+   filesz = bfd_get_file_size (abfd);
+   if (offset + count > sz
+-      || section->filepos + offset + count > filesz
++      || (ufile_ptr) section->filepos + offset + count > filesz
+       || ! bfd_get_file_window (abfd, section->filepos + offset, count, w,
+ 				TRUE))
+     return FALSE;
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,5 +1,11 @@
+ 2017-06-27  Alan Modra  <amodra@gmail.com>
+ 
++       PR binutils/21665
++       * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
++       (_bfd_generic_get_section_contents_in_window): Likewise.
++
++2017-06-27  Alan Modra  <amodra@gmail.com>
++
+ 	PR binutils/21665
+ 	* libbfd.c (_bfd_generic_get_section_contents): Delete abort.
+ 	Use unsigned file pointer type, and remove cast.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_7.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_7.patch
new file mode 100644
index 0000000..2cae63b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_7.patch
@@ -0,0 +1,80 @@
+From 60a02042bacf8d25814430080adda61ed086bca6 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Fri, 30 Jun 2017 11:03:37 +0100
+Subject: [PATCH] Fix failures in MMIX linker tests introduced by fix for PR
+ 21665.
+
+	PR binutils/21665
+	* objdump.c (disassemble_section): Move check for an overlarge
+	section to just before the allocation of memory.  Do not check
+	section size against file size, but instead use an arbitrary 2Gb
+	limit.  Issue a warning message if the section is too big.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9955 #7
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ binutils/ChangeLog |  8 ++++++++
+ binutils/objdump.c | 25 ++++++++++++++++++++++++-
+ 2 files changed, 32 insertions(+), 1 deletion(-)
+
+Index: git/binutils/objdump.c
+===================================================================
+--- git.orig/binutils/objdump.c
++++ git/binutils/objdump.c
+@@ -2048,7 +2048,7 @@ disassemble_section (bfd *abfd, asection
+     return;
+ 
+   datasize = bfd_get_section_size (section);
+-  if (datasize == 0 || datasize >= (bfd_size_type) bfd_get_file_size (abfd))
++  if (datasize == 0)
+     return;
+ 
+   if (start_address == (bfd_vma) -1
+@@ -2112,6 +2112,29 @@ disassemble_section (bfd *abfd, asection
+     }
+   rel_ppend = rel_pp + rel_count;
+ 
++  /* PR 21665: Check for overlarge datasizes.
++     Note - we used to check for "datasize > bfd_get_file_size (abfd)" but
++     this fails when using compressed sections or compressed file formats
++     (eg MMO, tekhex).
++
++     The call to xmalloc below will fail if too much memory is requested,
++     which will catch the problem in the normal use case.  But if a memory
++     checker is in use, eg valgrind or sanitize, then an exception will
++     be still generated, so we try to catch the problem first.
++
++     Unfortunately there is no simple way to determine how much memory can
++     be allocated by calling xmalloc.  So instead we use a simple, arbitrary
++     limit of 2Gb.  Hopefully this should be enough for most users.  If
++     someone does start trying to disassemble sections larger then 2Gb in
++     size they will doubtless complain and we can increase the limit.  */
++#define MAX_XMALLOC (1024 * 1024 * 1024 * 2UL) /* 2Gb */
++  if (datasize > MAX_XMALLOC)
++    {
++      non_fatal (_("Reading section %s failed because it is too big (%#lx)"),
++		 section->name, (unsigned long) datasize);
++      return;
++    }
++
+   data = (bfd_byte *) xmalloc (datasize);
+ 
+   bfd_get_section_contents (abfd, section, data, 0, datasize);
+Index: git/binutils/ChangeLog
+===================================================================
+--- git.orig/binutils/ChangeLog
++++ git/binutils/ChangeLog
+@@ -1,3 +1,11 @@
++2017-06-30  Nick Clifton  <nickc@redhat.com>
++
++       PR binutils/21665
++       * objdump.c (disassemble_section): Move check for an overlarge
++       section to just before the allocation of memory.  Do not check
++       section size against file size, but instead use an arbitrary 2Gb
++       limit.  Issue a warning message if the section is too big.
++
+ 2017-06-26  Nick Clifton  <nickc@redhat.com>
+  
+        PR binutils/21665
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_8.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_8.patch
new file mode 100644
index 0000000..45dd974
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_8.patch
@@ -0,0 +1,187 @@
+From bae7501e87ab614115d9d3213b4dd18d96e604db Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Sat, 1 Jul 2017 21:58:10 +0930
+Subject: [PATCH] Use bfd_malloc_and_get_section
+
+It's nicer than xmalloc followed by bfd_get_section_contents, since
+xmalloc exits on failure and needs a check that its size_t arg doesn't
+lose high bits when converted from bfd_size_type.
+
+	PR binutils/21665
+	* objdump.c (strtab): Make var a bfd_byte*.
+	(disassemble_section): Don't limit malloc size.  Instead, use
+	bfd_malloc_and_get_section.
+	(read_section_stabs): Use bfd_malloc_and_get_section.  Return
+	bfd_byte*.
+	(find_stabs_section): Remove now unnecessary cast.
+	* objcopy.c (copy_object): Use bfd_malloc_and_get_section.  Free
+	contents on error return.
+	* nlmconv.c (copy_sections): Use bfd_malloc_and_get_section.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9955 #8
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ binutils/ChangeLog | 13 +++++++++++++
+ binutils/nlmconv.c |  6 ++----
+ binutils/objcopy.c |  5 +++--
+ binutils/objdump.c | 44 +++++++-------------------------------------
+ 4 files changed, 25 insertions(+), 43 deletions(-)
+
+Index: git/binutils/ChangeLog
+===================================================================
+--- git.orig/binutils/ChangeLog
++++ git/binutils/ChangeLog
+@@ -1,3 +1,16 @@
++2017-07-01  Alan Modra  <amodra@gmail.com>
++
++	PR binutils/21665
++	* objdump.c (strtab): Make var a bfd_byte*.
++	(disassemble_section): Don't limit malloc size.  Instead, use
++	bfd_malloc_and_get_section.
++	(read_section_stabs): Use bfd_malloc_and_get_section.  Return
++	bfd_byte*.
++	(find_stabs_section): Remove now unnecessary cast.
++	* objcopy.c (copy_object): Use bfd_malloc_and_get_section.  Free
++	contents on error return.
++	* nlmconv.c (copy_sections): Use bfd_malloc_and_get_section.
++
+ 2017-06-30  Nick Clifton  <nickc@redhat.com>
+ 
+        PR binutils/21665
+Index: git/binutils/nlmconv.c
+===================================================================
+--- git.orig/binutils/nlmconv.c
++++ git/binutils/nlmconv.c
+@@ -1224,7 +1224,7 @@ copy_sections (bfd *inbfd, asection *ins
+   const char *inname;
+   asection *outsec;
+   bfd_size_type size;
+-  void *contents;
++  bfd_byte *contents;
+   long reloc_size;
+   bfd_byte buf[4];
+   bfd_size_type add;
+@@ -1240,9 +1240,7 @@ copy_sections (bfd *inbfd, asection *ins
+     contents = NULL;
+   else
+     {
+-      contents = xmalloc (size);
+-      if (! bfd_get_section_contents (inbfd, insec, contents,
+-				      (file_ptr) 0, size))
++      if (!bfd_malloc_and_get_section (inbfd, insec, &contents))
+ 	bfd_fatal (bfd_get_filename (inbfd));
+     }
+ 
+Index: git/binutils/objdump.c
+===================================================================
+--- git.orig/binutils/objdump.c
++++ git/binutils/objdump.c
+@@ -180,7 +180,7 @@ static long dynsymcount = 0;
+ static bfd_byte *stabs;
+ static bfd_size_type stab_size;
+ 
+-static char *strtab;
++static bfd_byte *strtab;
+ static bfd_size_type stabstr_size;
+ 
+ static bfd_boolean is_relocatable = FALSE;
+@@ -2112,29 +2112,6 @@ disassemble_section (bfd *abfd, asection
+     }
+   rel_ppend = rel_pp + rel_count;
+ 
+-  /* PR 21665: Check for overlarge datasizes.
+-     Note - we used to check for "datasize > bfd_get_file_size (abfd)" but
+-     this fails when using compressed sections or compressed file formats
+-     (eg MMO, tekhex).
+-
+-     The call to xmalloc below will fail if too much memory is requested,
+-     which will catch the problem in the normal use case.  But if a memory
+-     checker is in use, eg valgrind or sanitize, then an exception will
+-     be still generated, so we try to catch the problem first.
+-
+-     Unfortunately there is no simple way to determine how much memory can
+-     be allocated by calling xmalloc.  So instead we use a simple, arbitrary
+-     limit of 2Gb.  Hopefully this should be enough for most users.  If
+-     someone does start trying to disassemble sections larger then 2Gb in
+-     size they will doubtless complain and we can increase the limit.  */
+-#define MAX_XMALLOC (1024 * 1024 * 1024 * 2UL) /* 2Gb */
+-  if (datasize > MAX_XMALLOC)
+-    {
+-      non_fatal (_("Reading section %s failed because it is too big (%#lx)"),
+-		 section->name, (unsigned long) datasize);
+-      return;
+-    }
+-
+   data = (bfd_byte *) xmalloc (datasize);
+ 
+   bfd_get_section_contents (abfd, section, data, 0, datasize);
+@@ -2652,12 +2629,11 @@ dump_dwarf (bfd *abfd)
+ /* Read ABFD's stabs section STABSECT_NAME, and return a pointer to
+    it.  Return NULL on failure.   */
+ 
+-static char *
++static bfd_byte *
+ read_section_stabs (bfd *abfd, const char *sect_name, bfd_size_type *size_ptr)
+ {
+   asection *stabsect;
+-  bfd_size_type size;
+-  char *contents;
++  bfd_byte *contents;
+ 
+   stabsect = bfd_get_section_by_name (abfd, sect_name);
+   if (stabsect == NULL)
+@@ -2666,10 +2642,7 @@ read_section_stabs (bfd *abfd, const cha
+       return FALSE;
+     }
+ 
+-  size = bfd_section_size (abfd, stabsect);
+-  contents  = (char *) xmalloc (size);
+-
+-  if (! bfd_get_section_contents (abfd, stabsect, contents, 0, size))
++  if (!bfd_malloc_and_get_section (abfd, stabsect, &contents))
+     {
+       non_fatal (_("reading %s section of %s failed: %s"),
+ 		 sect_name, bfd_get_filename (abfd),
+@@ -2679,7 +2652,7 @@ read_section_stabs (bfd *abfd, const cha
+       return NULL;
+     }
+ 
+-  *size_ptr = size;
++  *size_ptr = bfd_section_size (abfd, stabsect);
+ 
+   return contents;
+ }
+@@ -2806,8 +2779,7 @@ find_stabs_section (bfd *abfd, asection
+ 
+       if (strtab)
+ 	{
+-	  stabs = (bfd_byte *) read_section_stabs (abfd, section->name,
+-						   &stab_size);
++	  stabs = read_section_stabs (abfd, section->name, &stab_size);
+ 	  if (stabs)
+ 	    print_section_stabs (abfd, section->name, &sought->string_offset);
+ 	}
+Index: git/binutils/objcopy.c
+===================================================================
+--- git.orig/binutils/objcopy.c
++++ git/binutils/objcopy.c
+@@ -2186,14 +2186,15 @@ copy_object (bfd *ibfd, bfd *obfd, const
+ 	      continue;
+ 	    }
+ 
+-	  bfd_byte * contents = xmalloc (size);
+-	  if (bfd_get_section_contents (ibfd, sec, contents, 0, size))
++	  bfd_byte *contents;
++          if (bfd_malloc_and_get_section (ibfd, sec, &contents))
+ 	    {
+ 	      if (fwrite (contents, 1, size, f) != size)
+ 		{
+ 		  non_fatal (_("error writing section contents to %s (error: %s)"),
+ 			     pdump->filename,
+ 			     strerror (errno));
++                  free (contents);
+ 		  return FALSE;
+ 		}
+ 	    }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_9.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_9.patch
new file mode 100644
index 0000000..c6353d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_9.patch
@@ -0,0 +1,361 @@
+From 8e2f54bcee7e3e8315d4a39a302eaf8e4389e07d Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Tue, 30 May 2017 06:34:05 -0700
+Subject: [PATCH] Add bfd_get_file_size to get archive element size
+
+We can't use stat() to get archive element size.  Add bfd_get_file_size
+to get size for both normal files and archive elements.
+
+bfd/
+
+	PR binutils/21519
+	* bfdio.c (bfd_get_file_size): New function.
+	* bfd-in2.h: Regenerated.
+
+binutils/
+
+	PR binutils/21519
+	* objdump.c (dump_relocs_in_section): Replace get_file_size
+	with bfd_get_file_size to get archive element size.
+	* testsuite/binutils-all/objdump.exp (test_objdump_f): New
+	proc.
+	(test_objdump_h): Likewise.
+	(test_objdump_t): Likewise.
+	(test_objdump_r): Likewise.
+	(test_objdump_s): Likewise.
+	Add objdump tests on archive.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9955
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ bfd/ChangeLog                               |   6 +
+ bfd/bfd-in2.h                               |   2 +
+ bfd/bfdio.c                                 |  23 ++++
+ binutils/ChangeLog                          |  13 ++
+ binutils/objdump.c                          |   2 +-
+ binutils/testsuite/binutils-all/objdump.exp | 178 +++++++++++++++++++---------
+ 6 files changed, 170 insertions(+), 54 deletions(-)
+
+Index: git/bfd/bfd-in2.h
+===================================================================
+--- git.orig/bfd/bfd-in2.h
++++ git/bfd/bfd-in2.h
+@@ -1241,6 +1241,8 @@ long bfd_get_mtime (bfd *abfd);
+ 
+ file_ptr bfd_get_size (bfd *abfd);
+ 
++file_ptr bfd_get_file_size (bfd *abfd);
++
+ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
+     int prot, int flags, file_ptr offset,
+     void **map_addr, bfd_size_type *map_len);
+Index: git/bfd/bfdio.c
+===================================================================
+--- git.orig/bfd/bfdio.c
++++ git/bfd/bfdio.c
+@@ -434,6 +434,29 @@ bfd_get_size (bfd *abfd)
+   return buf.st_size;
+ }
+ 
++/*
++FUNCTION
++	bfd_get_file_size
++
++SYNOPSIS
++	file_ptr bfd_get_file_size (bfd *abfd);
++
++DESCRIPTION
++	Return the file size (as read from file system) for the file
++	associated with BFD @var{abfd}.  It supports both normal files
++	and archive elements.
++
++*/
++
++file_ptr
++bfd_get_file_size (bfd *abfd)
++{
++  if (abfd->my_archive != NULL
++      && !bfd_is_thin_archive (abfd->my_archive))
++    return arelt_size (abfd);
++
++  return bfd_get_size (abfd);
++}
+ 
+ /*
+ FUNCTION
+Index: git/binutils/objdump.c
+===================================================================
+--- git.orig/binutils/objdump.c
++++ git/binutils/objdump.c
+@@ -3310,7 +3310,7 @@ dump_relocs_in_section (bfd *abfd,
+     }
+ 
+   if ((bfd_get_file_flags (abfd) & (BFD_IN_MEMORY | BFD_LINKER_CREATED)) == 0
+-      && relsize > get_file_size (bfd_get_filename (abfd)))
++      && relsize > bfd_get_file_size (abfd))
+     {
+       printf (" (too many: 0x%x)\n", section->reloc_count);
+       bfd_set_error (bfd_error_file_truncated);
+Index: git/binutils/testsuite/binutils-all/objdump.exp
+===================================================================
+--- git.orig/binutils/testsuite/binutils-all/objdump.exp
++++ git/binutils/testsuite/binutils-all/objdump.exp
+@@ -64,96 +64,168 @@ if [regexp $want $got] then {
+ if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
+     return
+ }
++if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest2.o]} then {
++    return
++}
+ if [is_remote host] {
+     set testfile [remote_download host tmpdir/bintest.o]
++    set testfile2 [remote_download host tmpdir/bintest2.o]
+ } else {
+     set testfile tmpdir/bintest.o
++    set testfile2 tmpdir/bintest2.o
++}
++
++if { ![istarget "alpha-*-*"] || [is_elf_format] } then {
++    remote_file host file delete tmpdir/bintest.a
++    set got [binutils_run $AR "rc tmpdir/bintest.a $testfile2"]
++    if ![string match "" $got] then {
++	fail "bintest.a"
++	remote_file host delete tmpdir/bintest.a
++    } else {
++	if [is_remote host] {
++	    set testarchive [remote_download host tmpdir/bintest.a]
++	} else {
++	    set testarchive tmpdir/bintest.a
++	}
++    }
++    remote_file host delete tmpdir/bintest2.o
+ }
+ 
+ # Test objdump -f
+ 
+-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f $testfile"]
++proc test_objdump_f { testfile dumpfile } {
++    global OBJDUMP
++    global OBJDUMPFLAGS
++    global cpus_regex
+ 
+-set want "$testfile:\[ 	\]*file format.*architecture:\[ 	\]*${cpus_regex}.*HAS_RELOC.*HAS_SYMS"
++    set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f $testfile"]
+ 
+-if ![regexp $want $got] then {
+-    fail "objdump -f"
+-} else {
+-    pass "objdump -f"
++    set want "$dumpfile:\[ 	\]*file format.*architecture:\[ 	\]*${cpus_regex}.*HAS_RELOC.*HAS_SYMS"
++
++    if ![regexp $want $got] then {
++	fail "objdump -f ($testfile, $dumpfile)"
++    } else {
++	pass "objdump -f ($testfile, $dumpfile)"
++    }
++}
++
++test_objdump_f $testfile $testfile
++if { [ remote_file host exists $testarchive ] } then {
++    test_objdump_f $testarchive bintest2.o
+ }
+ 
+ # Test objdump -h
+ 
+-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -h $testfile"]
++proc test_objdump_h { testfile dumpfile } {
++    global OBJDUMP
++    global OBJDUMPFLAGS
+ 
+-set want "$testfile:\[ 	\]*file format.*Sections.*\[0-9\]+\[ 	\]+\[^ 	\]*(text|TEXT|P|\\\$CODE\\\$)\[^ 	\]*\[ 	\]*(\[0-9a-fA-F\]+).*\[0-9\]+\[ 	\]+\[^ 	\]*(\\.data|DATA|D_1)\[^ 	\]*\[ 	\]*(\[0-9a-fA-F\]+)"
++    set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -h $testfile"]
+ 
+-if ![regexp $want $got all text_name text_size data_name data_size] then {
+-    fail "objdump -h"
+-} else {
+-    verbose "text name is $text_name size is $text_size"
+-    verbose "data name is $data_name size is $data_size"
+-    set ets 8
+-    set eds 4
+-    # The [ti]c4x target has the property sizeof(char)=sizeof(long)=1
+-    if [istarget *c4x*-*-*] then {
+-        set ets 2
+-        set eds 1
+-    }
+-    # c54x section sizes are in bytes, not octets; adjust accordingly
+-    if [istarget *c54x*-*-*] then {
+-	set ets 4
+-	set eds 2
+-    }
+-    if {[expr "0x$text_size"] < $ets || [expr "0x$data_size"] < $eds} then {
+-	send_log "sizes too small\n"
+-	fail "objdump -h"
++    set want "$dumpfile:\[ 	\]*file format.*Sections.*\[0-9\]+\[ 	\]+\[^ 	\]*(text|TEXT|P|\\\$CODE\\\$)\[^ 	\]*\[ 	\]*(\[0-9a-fA-F\]+).*\[0-9\]+\[ 	\]+\[^ 	\]*(\\.data|DATA|D_1)\[^ 	\]*\[ 	\]*(\[0-9a-fA-F\]+)"
++
++    if ![regexp $want $got all text_name text_size data_name data_size] then {
++	fail "objdump -h ($testfile, $dumpfile)"
+     } else {
+-	pass "objdump -h"
++	verbose "text name is $text_name size is $text_size"
++	verbose "data name is $data_name size is $data_size"
++	set ets 8
++	set eds 4
++	# The [ti]c4x target has the property sizeof(char)=sizeof(long)=1
++	if [istarget *c4x*-*-*] then {
++            set ets 2
++            set eds 1
++	}
++	# c54x section sizes are in bytes, not octets; adjust accordingly
++	if [istarget *c54x*-*-*] then {
++	    set ets 4
++	    set eds 2
++        }
++	if {[expr "0x$text_size"] < $ets || [expr "0x$data_size"] < $eds} then {
++	    send_log "sizes too small\n"
++	    fail "objdump -h ($testfile, $dumpfile)"
++	} else {
++	    pass "objdump -h ($testfile, $dumpfile)"
++	}
+     }
+ }
+ 
++test_objdump_h $testfile $testfile
++if { [ remote_file host exists $testarchive ] } then {
++    test_objdump_h $testarchive bintest2.o
++}
++
+ # Test objdump -t
+ 
+-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -t $testfile"]
++proc test_objdump_t { testfile} {
++    global OBJDUMP
++    global OBJDUMPFLAGS
++
++    set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -t $testfile"]
++
++    if [info exists vars] then { unset vars }
++    while {[regexp "(\[a-z\]*_symbol)(.*)" $got all symbol rest]} {
++	set vars($symbol) 1
++	set got $rest
++    }
+ 
+-if [info exists vars] then { unset vars }
+-while {[regexp "(\[a-z\]*_symbol)(.*)" $got all symbol rest]} {
+-    set vars($symbol) 1
+-    set got $rest
++    if {![info exists vars(text_symbol)] \
++	 || ![info exists vars(data_symbol)] \
++	 || ![info exists vars(common_symbol)] \
++	 || ![info exists vars(external_symbol)]} then {
++	fail "objdump -t ($testfile)"
++    } else {
++	pass "objdump -t ($testfile)"
++    }
+ }
+ 
+-if {![info exists vars(text_symbol)] \
+-     || ![info exists vars(data_symbol)] \
+-     || ![info exists vars(common_symbol)] \
+-     || ![info exists vars(external_symbol)]} then {
+-    fail "objdump -t"
+-} else {
+-    pass "objdump -t"
++test_objdump_t $testfile
++if { [ remote_file host exists $testarchive ] } then {
++    test_objdump_t $testarchive
+ }
+ 
+ # Test objdump -r
+ 
+-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -r $testfile"]
++proc test_objdump_r { testfile dumpfile } {
++    global OBJDUMP
++    global OBJDUMPFLAGS
+ 
+-set want "$testfile:\[ 	\]*file format.*RELOCATION RECORDS FOR \\\[\[^\]\]*(text|TEXT|P|\\\$CODE\\\$)\[^\]\]*\\\].*external_symbol"
++    set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -r $testfile"]
+ 
+-if [regexp $want $got] then {
+-    pass "objdump -r"
+-} else {
+-    fail "objdump -r"
++    set want "$dumpfile:\[ 	\]*file format.*RELOCATION RECORDS FOR \\\[\[^\]\]*(text|TEXT|P|\\\$CODE\\\$)\[^\]\]*\\\].*external_symbol"
++
++    if [regexp $want $got] then {
++	pass "objdump -r ($testfile, $dumpfile)"
++    } else {
++	fail "objdump -r ($testfile, $dumpfile)"
++    }
++}
++
++test_objdump_r $testfile $testfile
++if { [ remote_file host exists $testarchive ] } then {
++    test_objdump_r $testarchive bintest2.o
+ }
+ 
+ # Test objdump -s
+ 
+-set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -s $testfile"]
++proc test_objdump_s { testfile dumpfile } {
++    global OBJDUMP
++    global OBJDUMPFLAGS
+ 
+-set want "$testfile:\[ 	\]*file format.*Contents.*(text|TEXT|P|\\\$CODE\\\$)\[^0-9\]*\[ 	\]*\[0-9a-fA-F\]*\[ 	\]*(00000001|01000000|00000100).*Contents.*(data|DATA|D_1)\[^0-9\]*\[ 	\]*\[0-9a-fA-F\]*\[ 	\]*(00000002|02000000|00000200)"
++    set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -s $testfile"]
+ 
+-if [regexp $want $got] then {
+-    pass "objdump -s"
+-} else {
+-    fail "objdump -s"
++    set want "$dumpfile:\[ 	\]*file format.*Contents.*(text|TEXT|P|\\\$CODE\\\$)\[^0-9\]*\[ 	\]*\[0-9a-fA-F\]*\[ 	\]*(00000001|01000000|00000100).*Contents.*(data|DATA|D_1)\[^0-9\]*\[ 	\]*\[0-9a-fA-F\]*\[ 	\]*(00000002|02000000|00000200)"
++
++    if [regexp $want $got] then {
++	pass "objdump -s ($testfile, $dumpfile)"
++    } else {
++	fail "objdump -s ($testfile, $dumpfile)"
++    }
++}
++
++test_objdump_s $testfile $testfile
++if { [ remote_file host exists $testarchive ] } then {
++    test_objdump_s $testarchive bintest2.o
+ }
+ 
+ # Test objdump -s on a file that contains a compressed .debug section
+Index: git/bfd/ChangeLog
+===================================================================
+--- git.orig/bfd/ChangeLog
++++ git/bfd/ChangeLog
+@@ -1,3 +1,9 @@
++2017-05-30  H.J. Lu  <hongjiu.lu@intel.com>
++
++       PR binutils/21519
++       * bfdio.c (bfd_get_file_size): New function.
++       * bfd-in2.h: Regenerated.
++
+ 2017-06-27  Alan Modra  <amodra@gmail.com>
+ 
+        PR binutils/21665
+Index: git/binutils/ChangeLog
+===================================================================
+--- git.orig/binutils/ChangeLog
++++ git/binutils/ChangeLog
+@@ -1,3 +1,16 @@
++2017-05-30  H.J. Lu  <hongjiu.lu@intel.com>
++
++       PR binutils/21519
++       * objdump.c (dump_relocs_in_section): Replace get_file_size
++       with bfd_get_file_size to get archive element size.
++       * testsuite/binutils-all/objdump.exp (test_objdump_f): New
++       proc.
++       (test_objdump_h): Likewise.
++       (test_objdump_t): Likewise.
++       (test_objdump_r): Likewise.
++       (test_objdump_s): Likewise.
++       Add objdump tests on archive.
++
+ 2017-07-01  Alan Modra  <amodra@gmail.com>
+ 
+ 	PR binutils/21665
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.27.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.28.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.27.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.28.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch
deleted file mode 100644
index 348ce1d..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch
+++ /dev/null
@@ -1,591 +0,0 @@
-Upstream-Status: Pending
-
-#
-# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
-#
-
---- /dev/null
-+++ bison-1.875/m4/inttypes-pri.m4
-@@ -0,0 +1,32 @@
-+# inttypes-pri.m4 serial 1 (gettext-0.11.4)
-+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Bruno Haible.
-+
-+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
-+# macros to non-string values.  This is the case on AIX 4.3.3.
-+
-+AC_DEFUN([gt_INTTYPES_PRI],
-+[
-+  AC_REQUIRE([gt_HEADER_INTTYPES_H])
-+  if test $gt_cv_header_inttypes_h = yes; then
-+    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
-+      gt_cv_inttypes_pri_broken,
-+      [
-+        AC_TRY_COMPILE([#include <inttypes.h>
-+#ifdef PRId32
-+char *p = PRId32;
-+#endif
-+], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
-+      ])
-+  fi
-+  if test "$gt_cv_inttypes_pri_broken" = yes; then
-+    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
-+      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
-+  fi
-+])
---- /dev/null
-+++ bison-1.875/m4/lcmessage.m4
-@@ -0,0 +1,32 @@
-+# lcmessage.m4 serial 3 (gettext-0.11.3)
-+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+dnl
-+dnl This file can can be used in projects which are not available under
-+dnl the GNU General Public License or the GNU Library General Public
-+dnl License but which still want to provide support for the GNU gettext
-+dnl functionality.
-+dnl Please note that the actual code of the GNU gettext library is covered
-+dnl by the GNU Library General Public License, and the rest of the GNU
-+dnl gettext package package is covered by the GNU General Public License.
-+dnl They are *not* in the public domain.
-+
-+dnl Authors:
-+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
-+
-+# Check whether LC_MESSAGES is available in <locale.h>.
-+
-+AC_DEFUN([AM_LC_MESSAGES],
-+[
-+  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
-+    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
-+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
-+  if test $am_cv_val_LC_MESSAGES = yes; then
-+    AC_DEFINE(HAVE_LC_MESSAGES, 1,
-+      [Define if your <locale.h> file defines LC_MESSAGES.])
-+  fi
-+])
---- /dev/null
-+++ bison-1.875/m4/uintmax_t.m4
-@@ -0,0 +1,29 @@
-+# uintmax_t.m4 serial 6 (gettext-0.11)
-+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Paul Eggert.
-+
-+AC_PREREQ(2.13)
-+
-+# Define uintmax_t to `unsigned long' or `unsigned long long'
-+# if <inttypes.h> does not exist.
-+
-+AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
-+[
-+  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
-+  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
-+  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
-+    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
-+    test $ac_cv_type_unsigned_long_long = yes \
-+      && ac_type='unsigned long long' \
-+      || ac_type='unsigned long'
-+    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
-+  [Define to unsigned long or unsigned long long
-+   if <inttypes.h> and <stdint.h> don't define.])
-+  fi
-+])
---- /dev/null
-+++ bison-1.875/m4/glibc21.m4
-@@ -0,0 +1,32 @@
-+# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
-+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+# Test for the GNU C Library, version 2.1 or newer.
-+# From Bruno Haible.
-+
-+AC_DEFUN([jm_GLIBC21],
-+  [
-+    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
-+      ac_cv_gnu_library_2_1,
-+      [AC_EGREP_CPP([Lucky GNU user],
-+	[
-+#include <features.h>
-+#ifdef __GNU_LIBRARY__
-+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-+  Lucky GNU user
-+ #endif
-+#endif
-+	],
-+	ac_cv_gnu_library_2_1=yes,
-+	ac_cv_gnu_library_2_1=no)
-+      ]
-+    )
-+    AC_SUBST(GLIBC21)
-+    GLIBC21="$ac_cv_gnu_library_2_1"
-+  ]
-+)
---- /dev/null
-+++ bison-1.875/m4/stdint_h.m4
-@@ -0,0 +1,28 @@
-+# stdint_h.m4 serial 2 (gettext-0.11.4)
-+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Paul Eggert.
-+
-+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
-+# doesn't clash with <sys/types.h>, and declares uintmax_t.
-+
-+AC_DEFUN([jm_AC_HEADER_STDINT_H],
-+[
-+  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
-+  [AC_TRY_COMPILE(
-+    [#include <sys/types.h>
-+#include <stdint.h>],
-+    [uintmax_t i = (uintmax_t) -1;],
-+    jm_ac_cv_header_stdint_h=yes,
-+    jm_ac_cv_header_stdint_h=no)])
-+  if test $jm_ac_cv_header_stdint_h = yes; then
-+    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
-+[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
-+   and declares uintmax_t. ])
-+  fi
-+])
---- /dev/null
-+++ bison-1.875/m4/inttypes_h.m4
-@@ -0,0 +1,28 @@
-+# inttypes_h.m4 serial 4 (gettext-0.11.4)
-+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Paul Eggert.
-+
-+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
-+# doesn't clash with <sys/types.h>, and declares uintmax_t.
-+
-+AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
-+[
-+  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
-+  [AC_TRY_COMPILE(
-+    [#include <sys/types.h>
-+#include <inttypes.h>],
-+    [uintmax_t i = (uintmax_t) -1;],
-+    jm_ac_cv_header_inttypes_h=yes,
-+    jm_ac_cv_header_inttypes_h=no)])
-+  if test $jm_ac_cv_header_inttypes_h = yes; then
-+    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
-+[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
-+   and declares uintmax_t. ])
-+  fi
-+])
---- /dev/null
-+++ bison-1.875/m4/ulonglong.m4
-@@ -0,0 +1,23 @@
-+# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
-+dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Paul Eggert.
-+
-+AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
-+[
-+  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
-+  [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
-+    [unsigned long long ullmax = (unsigned long long) -1;
-+     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
-+    ac_cv_type_unsigned_long_long=yes,
-+    ac_cv_type_unsigned_long_long=no)])
-+  if test $ac_cv_type_unsigned_long_long = yes; then
-+    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
-+      [Define if you have the unsigned long long type.])
-+  fi
-+])
---- /dev/null
-+++ bison-1.875/m4/codeset.m4
-@@ -0,0 +1,23 @@
-+# codeset.m4 serial AM1 (gettext-0.10.40)
-+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Bruno Haible.
-+
-+AC_DEFUN([AM_LANGINFO_CODESET],
-+[
-+  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
-+    [AC_TRY_LINK([#include <langinfo.h>],
-+      [char* cs = nl_langinfo(CODESET);],
-+      am_cv_langinfo_codeset=yes,
-+      am_cv_langinfo_codeset=no)
-+    ])
-+  if test $am_cv_langinfo_codeset = yes; then
-+    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
-+      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
-+  fi
-+])
---- /dev/null
-+++ bison-1.875/m4/intdiv0.m4
-@@ -0,0 +1,72 @@
-+# intdiv0.m4 serial 1 (gettext-0.11.3)
-+dnl Copyright (C) 2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Bruno Haible.
-+
-+AC_DEFUN([gt_INTDIV0],
-+[
-+  AC_REQUIRE([AC_PROG_CC])dnl
-+  AC_REQUIRE([AC_CANONICAL_HOST])dnl
-+
-+  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
-+    gt_cv_int_divbyzero_sigfpe,
-+    [
-+      AC_TRY_RUN([
-+#include <stdlib.h>
-+#include <signal.h>
-+
-+static void
-+#ifdef __cplusplus
-+sigfpe_handler (int sig)
-+#else
-+sigfpe_handler (sig) int sig;
-+#endif
-+{
-+  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
-+  exit (sig != SIGFPE);
-+}
-+
-+int x = 1;
-+int y = 0;
-+int z;
-+int nan;
-+
-+int main ()
-+{
-+  signal (SIGFPE, sigfpe_handler);
-+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
-+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
-+  signal (SIGTRAP, sigfpe_handler);
-+#endif
-+/* Linux/SPARC yields signal SIGILL.  */
-+#if defined (__sparc__) && defined (__linux__)
-+  signal (SIGILL, sigfpe_handler);
-+#endif
-+
-+  z = x / y;
-+  nan = y / y;
-+  exit (1);
-+}
-+], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
-+        [
-+          # Guess based on the CPU.
-+          case "$host_cpu" in
-+            alpha* | i[34567]86 | m68k | s390*)
-+              gt_cv_int_divbyzero_sigfpe="guessing yes";;
-+            *)
-+              gt_cv_int_divbyzero_sigfpe="guessing no";;
-+          esac
-+        ])
-+    ])
-+  case "$gt_cv_int_divbyzero_sigfpe" in
-+    *yes) value=1;;
-+    *) value=0;;
-+  esac
-+  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
-+    [Define if integer division by zero raises signal SIGFPE.])
-+])
---- /dev/null
-+++ bison-1.875/m4/glib.m4
-@@ -0,0 +1,196 @@
-+# Configure paths for GLIB
-+# Owen Taylor     97-11-3
-+
-+dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
-+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or 
-+dnl gthread is specified in MODULES, pass to glib-config
-+dnl
-+AC_DEFUN(AM_PATH_GLIB,
-+[dnl 
-+dnl Get the cflags and libraries from the glib-config script
-+dnl
-+AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
-+            glib_config_prefix="$withval", glib_config_prefix="")
-+AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
-+            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
-+AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
-+		    , enable_glibtest=yes)
-+
-+  if test x$glib_config_exec_prefix != x ; then
-+     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
-+     if test x${GLIB_CONFIG+set} != xset ; then
-+        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
-+     fi
-+  fi
-+  if test x$glib_config_prefix != x ; then
-+     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
-+     if test x${GLIB_CONFIG+set} != xset ; then
-+        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
-+     fi
-+  fi
-+
-+  for module in . $4
-+  do
-+      case "$module" in
-+         gmodule) 
-+             glib_config_args="$glib_config_args gmodule"
-+         ;;
-+         gthread) 
-+             glib_config_args="$glib_config_args gthread"
-+         ;;
-+      esac
-+  done
-+
-+  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
-+  min_glib_version=ifelse([$1], ,0.99.7,$1)
-+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
-+  no_glib=""
-+  if test "$GLIB_CONFIG" = "no" ; then
-+    no_glib=yes
-+  else
-+    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
-+    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
-+    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
-+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-+    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
-+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-+    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
-+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-+    if test "x$enable_glibtest" = "xyes" ; then
-+      ac_save_CFLAGS="$CFLAGS"
-+      ac_save_LIBS="$LIBS"
-+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
-+      LIBS="$GLIB_LIBS $LIBS"
-+dnl
-+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
-+dnl checks the results of glib-config to some extent
-+dnl
-+      rm -f conf.glibtest
-+      AC_TRY_RUN([
-+#include <glib.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+
-+int 
-+main ()
-+{
-+  int major, minor, micro;
-+  char *tmp_version;
-+
-+  system ("touch conf.glibtest");
-+
-+  /* HP/UX 9 (%@#!) writes to sscanf strings */
-+  tmp_version = g_strdup("$min_glib_version");
-+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
-+     printf("%s, bad version string\n", "$min_glib_version");
-+     exit(1);
-+   }
-+
-+  if ((glib_major_version != $glib_config_major_version) ||
-+      (glib_minor_version != $glib_config_minor_version) ||
-+      (glib_micro_version != $glib_config_micro_version))
-+    {
-+      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
-+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
-+             glib_major_version, glib_minor_version, glib_micro_version);
-+      printf ("*** was found! If glib-config was correct, then it is best\n");
-+      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
-+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
-+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
-+      printf("*** required on your system.\n");
-+      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
-+      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
-+      printf("*** before re-running configure\n");
-+    } 
-+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
-+	   (glib_minor_version != GLIB_MINOR_VERSION) ||
-+           (glib_micro_version != GLIB_MICRO_VERSION))
-+    {
-+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
-+	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
-+      printf("*** library (version %d.%d.%d)\n",
-+	     glib_major_version, glib_minor_version, glib_micro_version);
-+    }
-+  else
-+    {
-+      if ((glib_major_version > major) ||
-+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
-+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
-+      {
-+        return 0;
-+       }
-+     else
-+      {
-+        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
-+               glib_major_version, glib_minor_version, glib_micro_version);
-+        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
-+	       major, minor, micro);
-+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
-+        printf("***\n");
-+        printf("*** If you have already installed a sufficiently new version, this error\n");
-+        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
-+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-+        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
-+        printf("*** correct copy of glib-config. (In this case, you will have to\n");
-+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-+        printf("*** so that the correct libraries are found at run-time))\n");
-+      }
-+    }
-+  return 1;
-+}
-+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-+       CFLAGS="$ac_save_CFLAGS"
-+       LIBS="$ac_save_LIBS"
-+     fi
-+  fi
-+  if test "x$no_glib" = x ; then
-+     AC_MSG_RESULT(yes)
-+     ifelse([$2], , :, [$2])     
-+  else
-+     AC_MSG_RESULT(no)
-+     if test "$GLIB_CONFIG" = "no" ; then
-+       echo "*** The glib-config script installed by GLIB could not be found"
-+       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
-+       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
-+       echo "*** full path to glib-config."
-+     else
-+       if test -f conf.glibtest ; then
-+        :
-+       else
-+          echo "*** Could not run GLIB test program, checking why..."
-+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
-+          LIBS="$LIBS $GLIB_LIBS"
-+          AC_TRY_LINK([
-+#include <glib.h>
-+#include <stdio.h>
-+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
-+        [ echo "*** The test program compiled, but did not run. This usually means"
-+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
-+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
-+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-+          echo "*** is required on your system"
-+	  echo "***"
-+          echo "*** If you have an old version installed, it is best to remove it, although"
-+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
-+          echo "***"
-+          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
-+          echo "*** came with the system with the command"
-+          echo "***"
-+          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
-+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-+          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
-+          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
-+          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
-+          CFLAGS="$ac_save_CFLAGS"
-+          LIBS="$ac_save_LIBS"
-+       fi
-+     fi
-+     GLIB_CFLAGS=""
-+     GLIB_LIBS=""
-+     ifelse([$3], , :, [$3])
-+  fi
-+  AC_SUBST(GLIB_CFLAGS)
-+  AC_SUBST(GLIB_LIBS)
-+  rm -f conf.glibtest
-+])
---- /dev/null
-+++ bison-1.875/m4/inttypes.m4
-@@ -0,0 +1,27 @@
-+# inttypes.m4 serial 1 (gettext-0.11.4)
-+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Paul Eggert.
-+
-+# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
-+# <sys/types.h>.
-+
-+AC_DEFUN([gt_HEADER_INTTYPES_H],
-+[
-+  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
-+  [
-+    AC_TRY_COMPILE(
-+      [#include <sys/types.h>
-+#include <inttypes.h>],
-+      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
-+  ])
-+  if test $gt_cv_header_inttypes_h = yes; then
-+    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
-+      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
-+  fi
-+])
---- /dev/null
-+++ bison-1.875/m4/isc-posix.m4
-@@ -0,0 +1,26 @@
-+# isc-posix.m4 serial 2 (gettext-0.11.2)
-+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
-+
-+# This test replaces the one in autoconf.
-+# Currently this macro should have the same name as the autoconf macro
-+# because gettext's gettext.m4 (distributed in the automake package)
-+# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
-+# give these diagnostics:
-+#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
-+#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
-+
-+undefine([AC_ISC_POSIX])
-+
-+AC_DEFUN([AC_ISC_POSIX],
-+  [
-+    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
-+    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
-+  ]
-+)
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_2.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_2.3.bb
deleted file mode 100644
index 182e880..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_2.3.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "GNU Project parser generator (yacc replacement)"
-DESCRIPTION = "Bison is a general-purpose parser generator that converts an annotated context-free grammar into \
-an LALR(1) or GLR parser for that grammar.  Bison is upward compatible with Yacc: all properly-written Yacc \
-grammars ought to work with Bison with no change. Anyone familiar with Yacc should be able to use Bison with \
-little trouble."
-HOMEPAGE = "http://www.gnu.org/software/bison/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
-SECTION = "devel"
-DEPENDS = "bison-native flex-native"
-
-PR = "r1"
-
-SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.gz \
-         file://bison-2.3_m4.patch"
-
-SRC_URI[md5sum] = "22327efdd5080e2b1acb6e560a04b43a"
-SRC_URI[sha256sum] = "52f78aa4761a74ceb7fdf770f3554dd84308c3b93c4255e3a5c17558ecda293e"
-
-inherit autotools gettext texinfo
-acpaths = "-I ${S}/m4"
-
-do_configure_prepend () {
-	rm -f ${S}/m4/*gl.m4
-	cp ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/runtime-po/
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch
deleted file mode 100644
index bbc53c6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 373eb51328b5e10529763cad441210e6b0efb24e Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Wed, 11 Feb 2015 22:08:41 -0800
-Subject: [PATCH] Makefile: fix for parallel build
-
-Fixed:
-mkfs.c:300:46: error: 'BTRFS_BUILD_VERSION' undeclared (first use in this function)
-  fprintf(stderr, "mkfs.btrfs, part of %s\n", BTRFS_BUILD_VERSION);
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- Makefile.in |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index 860a390..8a6fbd7 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -142,7 +142,7 @@ else
- 	check_echo = true
- endif
- 
--%.o.d: %.c
-+%.o.d: %.c version.h
- 	$(Q)$(CC) -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(CFLAGS) $<
- 
- .c.o:
--- 
-1.7.9.5
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.7.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.7.1.bb
deleted file mode 100644
index becf093..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.7.1.bb
+++ /dev/null
@@ -1,33 +0,0 @@
-SUMMARY = "Checksumming Copy on Write Filesystem utilities"
-DESCRIPTION = "Btrfs is a new copy on write filesystem for Linux aimed at \
-implementing advanced features while focusing on fault tolerance, repair and \
-easy administration. \
-This package contains utilities (mkfs, fsck, btrfsctl) used to work with \
-btrfs and an utility (btrfs-convert) to make a btrfs filesystem from an ext3."
-
-HOMEPAGE = "https://btrfs.wiki.kernel.org"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=fcb02dc552a041dee27e4b85c7396067"
-SECTION = "base"
-DEPENDS = "util-linux attr e2fsprogs lzo acl"
-RDEPENDS_${PN} = "libgcc"
-
-SRCREV = "6819fbcdcab63c2d95da1a2997e37be9a71ca533"
-SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
-           file://fix-parallel.patch \
-"
-
-inherit autotools-brokensep pkgconfig
-
-EXTRA_OECONF += "--disable-documentation"
-EXTRA_OECONF_append_libc-musl = " --disable-backtrace "
-
-
-do_configure_prepend() {
-      sh autogen.sh
-}
-
-S = "${WORKDIR}/git"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.9.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.9.1.bb
new file mode 100644
index 0000000..a5e9e22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.9.1.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Checksumming Copy on Write Filesystem utilities"
+DESCRIPTION = "Btrfs is a new copy on write filesystem for Linux aimed at \
+implementing advanced features while focusing on fault tolerance, repair and \
+easy administration. \
+This package contains utilities (mkfs, fsck, btrfsctl) used to work with \
+btrfs and an utility (btrfs-convert) to make a btrfs filesystem from an ext3."
+
+HOMEPAGE = "https://btrfs.wiki.kernel.org"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fcb02dc552a041dee27e4b85c7396067"
+SECTION = "base"
+DEPENDS = "util-linux attr e2fsprogs lzo acl"
+DEPENDS_append_class-target = " udev"
+RDEPENDS_${PN} = "libgcc"
+
+SRCREV = "96485c34ac0329fb0073476f16d2083c64701f29"
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+
+inherit autotools-brokensep pkgconfig manpages
+
+PACKAGECONFIG[manpages] = "--enable-documentation, --disable-documentation, asciidoc-native xmlto-native"
+EXTRA_OECONF_append_libc-musl = " --disable-backtrace "
+
+do_configure_prepend() {
+	# Upstream doesn't ship this and autoreconf won't install it as automake isn't used.
+	mkdir -p ${S}/config
+	cp -f $(automake --print-libdir)/install-sh ${S}/config/
+}
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb
index fa9c6b4..c60c164 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb
@@ -17,11 +17,15 @@
            file://functions.sh-improve-deb-and-ipk-checking.patch \
            "
 
+# Date matches entry in build-compare.changes and date of SRCREV.
+#
 SRCREV = "c5352c054c6ef15735da31b76d6d88620f4aff0a"
+PE = "1"
+PV = "2015.02.10+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
-BBCLASSEXTEND += "native nativesdk"
+BBCLASSEXTEND = "native nativesdk"
 
 do_install() {
     install -d ${D}/${bindir}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc
index 69aa64e..6566328 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc
@@ -9,9 +9,7 @@
 
 DEPENDS = "zlib"
 
-SRC_URI = "git://git.samba.org/ccache.git"
-
-S = "${WORKDIR}/git"
+SRC_URI = "https://download.samba.org/pub/${BPN}/${BP}.tar.xz"
 
 inherit autotools
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.5.bb
deleted file mode 100644
index afd1b0e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.5.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-require ccache.inc
-
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b8a4fa173ed91c1a5204ea4f9c9eadc3"
-
-SRCREV = "424d3ae1fb73444c6c38bf189f8fc048f66d6499"
-
-SRC_URI += " \
-            file://0002-dev.mk.in-fix-file-name-too-long.patch \
-            file://Revert-Create-man-page-in-the-make-install-from-git-.patch \
-"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.3.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.3.4.bb
new file mode 100644
index 0000000..1e535b1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.3.4.bb
@@ -0,0 +1,12 @@
+require ccache.inc
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=7fe21f9470f2305e95e7d8a632255079"
+
+SRC_URI[md5sum] = "95ab3c56284129cc2a32460c23069516"
+SRC_URI[sha256sum] = "24f15bf389e38c41548c9c259532187774ec0cb9686c3497bbb75504c8dc404f"
+
+SRC_URI += " \
+            file://0002-dev.mk.in-fix-file-name-too-long.patch \
+            file://Revert-Create-man-page-in-the-make-install-from-git-.patch \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb b/import-layers/yocto-poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
index ff4d5ac..0e0be62 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
@@ -14,6 +14,9 @@
 
 EXTRA_OEMAKE = "-e MAKEFLAGS="
 
+# Stop failures when 'cc' can't be found
+export ac_cv_prog_CC = "${CC}"
+
 inherit native
 
 PV = "3.01a31+really3.01"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb b/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb
index e115eb5..b61eef9 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb
@@ -7,7 +7,7 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
 
-SRC_URI = "http://alioth.debian.org/frs/download.php/file/3979/chrpath-0.16.tar.gz \
+SRC_URI = "https://alioth.debian.org/frs/download.php/file/3979/chrpath-0.16.tar.gz \
            file://standarddoc.patch"
 
 SRC_URI[md5sum] = "2bf8d1d1ee345fc8a7915576f5649982"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.6.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.6.1.bb
deleted file mode 100644
index aec0d64d..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.6.1.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-require cmake.inc
-inherit native
-
-DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native"
-
-SRC_URI += "\
-    file://cmlibarchive-disable-ext2fs.patch \
-"
-
-B = "${WORKDIR}/build"
-do_configure[cleandirs] = "${B}"
-
-# Disable ccmake since we don't depend on ncurses
-CMAKE_EXTRACONF = "\
-    -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
-    -DBUILD_CursesDialog=0 \
-    -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
-    -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
-    -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
-    -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
-    -DHAVE_SYS_ACL_H=0 \
-"
-
-do_configure () {
-	${S}/configure --verbose --prefix=${prefix} -- ${CMAKE_EXTRACONF}
-}
-
-do_compile() {
-	oe_runmake
-}
-
-do_install() {
-	oe_runmake 'DESTDIR=${D}' install
-}
-
-do_compile[progress] = "percent"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.7.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.7.2.bb
new file mode 100644
index 0000000..7ad4345
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.7.2.bb
@@ -0,0 +1,37 @@
+require cmake.inc
+inherit native
+
+DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native"
+
+SRC_URI += "\
+    file://cmlibarchive-disable-ext2fs.patch \
+"
+
+B = "${WORKDIR}/build"
+do_configure[cleandirs] = "${B}"
+
+# Disable ccmake since we don't depend on ncurses
+CMAKE_EXTRACONF = "\
+    -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
+    -DBUILD_CursesDialog=0 \
+    -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
+    -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
+    -DHAVE_SYS_ACL_H=0 \
+"
+
+do_configure () {
+	${S}/configure --verbose --prefix=${prefix} -- ${CMAKE_EXTRACONF}
+}
+
+do_compile() {
+	oe_runmake
+}
+
+do_install() {
+	oe_runmake 'DESTDIR=${D}' install
+}
+
+do_compile[progress] = "percent"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc
index 4fcb0b1..6c8b36d 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc
@@ -6,18 +6,20 @@
 BUGTRACKER = "http://public.kitware.com/Bug/my_view_page.php"
 SECTION = "console/utils"
 LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://Copyright.txt;md5=052f86c15bbde68af55c7f7b340ab639 \
-                    file://Source/cmake.h;beginline=1;endline=10;md5=341736dae83c9e344b53eeb1bc7d7bc2"
+LIC_FILES_CHKSUM = "file://Copyright.txt;md5=7a64bc564202bf7401d9a8ef33c9564d \
+                    file://Source/cmake.h;beginline=1;endline=3;md5=4494dee184212fc89c469c3acd555a14"
 
-CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV', True).split('.')[0:2])}"
+CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 
 SRC_URI = "https://cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \
            file://support-oe-qt4-tools-names.patch \
            file://qt4-fail-silent.patch \
+           file://avoid-gcc-warnings-with-Wstrict-prototypes.patch \
+           file://0001-KWIML-tests-Remove-format-security-from-flags.patch \
            "
 
-SRC_URI[md5sum] = "d6dd661380adacdb12f41b926ec99545"
-SRC_URI[sha256sum] = "28ee98ec40427d41a45673847db7a905b59ce9243bb866eaf59dce0f58aaef11"
+SRC_URI[md5sum] = "79bd7e65cd81ea3aa2619484ad6ff25a"
+SRC_URI[sha256sum] = "dc1246c4e6d168ea4d6e042cfba577c1acd65feea27e56f5ff37df920c30cae0"
 
 UPSTREAM_CHECK_REGEX = "cmake-(?P<pver>\d+(\.\d+)+)\.tar"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-KWIML-tests-Remove-format-security-from-flags.patch b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-KWIML-tests-Remove-format-security-from-flags.patch
new file mode 100644
index 0000000..190133b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-KWIML-tests-Remove-format-security-from-flags.patch
@@ -0,0 +1,33 @@
+From 0941395b146804abcd87004589ff6e7a2953412d Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 16 Mar 2017 14:39:04 +0200
+Subject: [PATCH] KWIML tests: Remove format-security from flags
+
+For the tests where "format" is removed from flags, "format-security"
+should be removed as well. Otherwise building cmake with
+"-Wformat -Wformat-security" fails:
+
+| cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
+
+Upstream-Status: Backport [part of commit f77420cfc9]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ Utilities/KWIML/test/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Utilities/KWIML/test/CMakeLists.txt b/Utilities/KWIML/test/CMakeLists.txt
+index 4f6f37b..1bf93bb 100644
+--- a/Utilities/KWIML/test/CMakeLists.txt
++++ b/Utilities/KWIML/test/CMakeLists.txt
+@@ -10,7 +10,7 @@ endif()
+ # Suppress printf/scanf format warnings; we test if the sizes match.
+ foreach(lang C CXX)
+   if(KWIML_LANGUAGE_${lang} AND CMAKE_${lang}_COMPILER_ID STREQUAL "GNU")
+-    set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -Wno-format")
++    set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -Wno-format -Wno-format-security")
+   endif()
+ endforeach()
+ 
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/avoid-gcc-warnings-with-Wstrict-prototypes.patch b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/avoid-gcc-warnings-with-Wstrict-prototypes.patch
new file mode 100644
index 0000000..8b8d480
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/avoid-gcc-warnings-with-Wstrict-prototypes.patch
@@ -0,0 +1,42 @@
+From 4bc17345c01ea467099e28c7df30c23ace9e7811 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Fri, 14 Oct 2016 16:26:58 -0700
+Subject: [PATCH] CheckFunctionExists.c: avoid gcc warnings with
+ -Wstrict-prototypes
+
+Avoid warnings (and therefore build failures etc) if a user happens
+to add -Wstrict-prototypes to CFLAGS.
+
+ | $ gcc --version
+ | gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
+ |
+ | $ gcc -Wstrict-prototypes -Werror -DCHECK_FUNCTION_EXISTS=pthread_create -o foo.o -c Modules/CheckFunctionExists.c
+ | Modules/CheckFunctionExists.c:7:3: error: function declaration isn't a prototype [-Werror=strict-prototypes]
+ |    CHECK_FUNCTION_EXISTS();
+ |    ^
+ | cc1: all warnings being treated as errors
+ |
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ Modules/CheckFunctionExists.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Modules/CheckFunctionExists.c b/Modules/CheckFunctionExists.c
+index 2304000..224e340 100644
+--- a/Modules/CheckFunctionExists.c
++++ b/Modules/CheckFunctionExists.c
+@@ -4,7 +4,7 @@
+ extern "C"
+ #endif
+   char
+-  CHECK_FUNCTION_EXISTS();
++  CHECK_FUNCTION_EXISTS(void);
+ #ifdef __CLASSIC_C__
+ int main()
+ {
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.6.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.6.1.bb
deleted file mode 100644
index 850d6de..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.6.1.bb
+++ /dev/null
@@ -1,48 +0,0 @@
-require cmake.inc
-
-inherit cmake
-
-DEPENDS += "curl expat zlib libarchive xz ncurses bzip2"
-
-SRC_URI_append_class-nativesdk = " \
-    file://OEToolchainConfig.cmake \
-    file://environment.d-cmake.sh"
-
-# Strip ${prefix} from ${docdir}, set result into docdir_stripped
-python () {
-    prefix=d.getVar("prefix", True)
-    docdir=d.getVar("docdir", True)
-
-    if not docdir.startswith(prefix):
-        bb.fatal('docdir must contain prefix as its prefix')
-
-    docdir_stripped = docdir[len(prefix):]
-    if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
-        docdir_stripped = docdir_stripped[1:]
-
-    d.setVar("docdir_stripped", docdir_stripped)
-}
-
-EXTRA_OECMAKE=" \
-    -DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \
-    -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
-    -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
-    -DKWSYS_CHAR_IS_SIGNED=1 \
-    -DBUILD_CursesDialog=0 \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '-DKWSYS_LFS_WORKS=1', '-DKWSYS_LFS_DISABLE=1', d)} \
-"
-
-do_install_append_class-nativesdk() {
-    mkdir -p ${D}${datadir}/cmake
-    install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/
-
-    mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
-    install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${SDKPATHNATIVE}/environment-setup.d/cmake.sh
-}
-
-FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}"
-
-FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION}"
-FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
-
-BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.7.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.7.2.bb
new file mode 100644
index 0000000..f566a48
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.7.2.bb
@@ -0,0 +1,49 @@
+require cmake.inc
+
+inherit cmake
+
+DEPENDS += "curl expat zlib libarchive xz ncurses bzip2"
+
+SRC_URI_append_class-nativesdk = " \
+    file://OEToolchainConfig.cmake \
+    file://environment.d-cmake.sh"
+
+# Strip ${prefix} from ${docdir}, set result into docdir_stripped
+python () {
+    prefix=d.getVar("prefix")
+    docdir=d.getVar("docdir")
+
+    if not docdir.startswith(prefix):
+        bb.fatal('docdir must contain prefix as its prefix')
+
+    docdir_stripped = docdir[len(prefix):]
+    if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
+        docdir_stripped = docdir_stripped[1:]
+
+    d.setVar("docdir_stripped", docdir_stripped)
+}
+
+EXTRA_OECMAKE=" \
+    -DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \
+    -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
+    -DKWSYS_CHAR_IS_SIGNED=1 \
+    -DBUILD_CursesDialog=0 \
+    -DKWSYS_LFS_WORKS=1 \
+"
+
+do_install_append_class-nativesdk() {
+    mkdir -p ${D}${datadir}/cmake
+    install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/
+
+    mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
+    install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${SDKPATHNATIVE}/environment-setup.d/cmake.sh
+}
+
+FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}"
+
+FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION}"
+FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Correctly-install-the-shared-library.patch b/import-layers/yocto-poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Correctly-install-the-shared-library.patch
new file mode 100644
index 0000000..0127124
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Correctly-install-the-shared-library.patch
@@ -0,0 +1,28 @@
+From fef835e1fdedc72c97d9c3e5704302e56e1bdef0 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 2 Jan 2017 17:23:59 +0200
+Subject: [PATCH] Correctly install the shared library
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ src/CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index f3635e8..46dc037 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -110,7 +110,8 @@ CONFIGURE_FILE("deltarpms.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/deltarpms.h" @ONLY)
+ IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+     SET (LIB_SUFFIX "64")
+ ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+-SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++#SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
+ 
+ INSTALL(FILES ${headers} DESTINATION "include/createrepo_c")
+ INSTALL(FILES "createrepo_c.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/import-layers/yocto-poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
new file mode 100644
index 0000000..9531070
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
@@ -0,0 +1,27 @@
+From bef487b5c2515062c5dd73c21082ce42f69aa717 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:31:02 +0200
+Subject: [PATCH] Do not set PYTHON_INSTALL_DIR by running python
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ src/python/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
+index 9f1ac64..eae0cbb 100644
+--- a/src/python/CMakeLists.txt
++++ b/src/python/CMakeLists.txt
+@@ -19,7 +19,7 @@ else()
+     FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
+ endif()
+ 
+-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+ INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH})
+ 
+ MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}")
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/createrepo-c/createrepo-c_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/createrepo-c/createrepo-c_git.bb
new file mode 100644
index 0000000..3176136
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/createrepo-c/createrepo-c_git.bb
@@ -0,0 +1,31 @@
+DESCRIPTION = "C implementation of createrepo."
+HOMEPAGE = "https://github.com/rpm-software-management/createrepo_c/wiki"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "git://github.com/rpm-software-management/createrepo_c \
+           file://0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
+           file://0001-Correctly-install-the-shared-library.patch \
+           "
+
+PV = "0.10.0+git${SRCPV}"
+SRCREV = "748891ff8ee524c2d37926c608cd2794f88013f3"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "expat curl glib-2.0 libxml2 openssl bzip2 zlib file sqlite3 xz rpm"
+DEPENDS_append_class-native = " file-replacement-native"
+
+inherit cmake pkgconfig bash-completion distutils3-base
+
+EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
+
+BBCLASSEXTEND = "native"
+
+# Direct createrepo to read rpm configuration from our sysroot, not the one it was compiled in
+do_install_append_class-native() {
+        create_wrapper ${D}/${bindir}/createrepo_c \
+                RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
index 1baadea..1f906ee 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
@@ -9,18 +9,22 @@
 SRC_URI = "https://github.com/ikeydoherty/${BPN}/releases/download/v${PV}/${BP}.tar.xz \
            file://check-for-malloc_trim-before-using-it.patch \
            file://0001-print-progress-in-percent-when-downloading-CVE-db.patch \
+           file://0001-curl-allow-overriding-default-CA-certificate-file.patch \
+           file://0001-update-Compare-computed-vs-expected-sha256-digit-str.patch \
           "
 
 SRC_URI[md5sum] = "c5f4247140fc9be3bf41491d31a34155"
 SRC_URI[sha256sum] = "b8f283be718af8d31232ac1bfc10a0378fb958aaaa49af39168f8acf501e6a5b"
 
+UPSTREAM_CHECK_URI = "https://github.com/ikeydoherty/cve-check-tool/releases"
+
 DEPENDS = "libcheck glib-2.0 json-glib curl libxml2 sqlite3 openssl ca-certificates"
 
 RDEPENDS_${PN} = "ca-certificates"
 
 inherit pkgconfig autotools
 
-EXTRA_OECONF = "--disable-coverage"
+EXTRA_OECONF = "--disable-coverage --enable-relative-plugins"
 CFLAGS_append = " -Wno-error=pedantic"
 
 do_populate_cve_db() {
@@ -37,7 +41,8 @@
     [ -z "${cve_file}" ] && cve_file="${TMPDIR}/cve_check"
 
     bbdebug 2 "Updating cve-check-tool database located in $cve_dir"
-    if cve-check-update -d "$cve_dir" ; then
+    # --cacert works around curl-native not finding the CA bundle
+    if cve-check-update --cacert ${sysconfdir}/ssl/certs/ca-certificates.crt -d "$cve_dir" ; then
         printf "CVE database was updated on %s UTC\n\n" "$(LANG=C date --utc +'%F %T')" > "$cve_file"
     else
         bbwarn "Error in executing cve-check-update"
@@ -48,6 +53,7 @@
 }
 
 addtask populate_cve_db after do_populate_sysroot
+do_populate_cve_db[depends] = "cve-check-tool-native:do_populate_sysroot"
 do_populate_cve_db[nostamp] = "1"
 do_populate_cve_db[progress] = "percent"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cve-check-tool/files/0001-curl-allow-overriding-default-CA-certificate-file.patch b/import-layers/yocto-poky/meta/recipes-devtools/cve-check-tool/files/0001-curl-allow-overriding-default-CA-certificate-file.patch
new file mode 100644
index 0000000..3d8ebd1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cve-check-tool/files/0001-curl-allow-overriding-default-CA-certificate-file.patch
@@ -0,0 +1,215 @@
+From 825a9969dea052b02ba868bdf39e676349f10dce Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 9 Feb 2017 14:51:28 +0200
+Subject: [PATCH] curl: allow overriding default CA certificate file
+
+Similar to curl, --cacert can now be used in cve-check-tool and
+cve-check-update to override the default CA certificate file. Useful
+in cases where the system default is unsuitable (for example,
+out-dated) or broken (as in OE's current native libcurl, which embeds
+a path string from one build host and then uses it on another although
+the right path may have become something different).
+
+Upstream-Status: Submitted [https://github.com/ikeydoherty/cve-check-tool/pull/45]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+
+
+Took Patrick Ohlys original patch from meta-security-isafw, rebased
+on top of other patches.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ src/library/cve-check-tool.h |  1 +
+ src/library/fetch.c          | 10 +++++++++-
+ src/library/fetch.h          |  3 ++-
+ src/main.c                   |  5 ++++-
+ src/update-main.c            |  4 +++-
+ src/update.c                 | 12 +++++++-----
+ src/update.h                 |  2 +-
+ 7 files changed, 27 insertions(+), 10 deletions(-)
+
+diff --git a/src/library/cve-check-tool.h b/src/library/cve-check-tool.h
+index e4bb5b1..f89eade 100644
+--- a/src/library/cve-check-tool.h
++++ b/src/library/cve-check-tool.h
+@@ -43,6 +43,7 @@ typedef struct CveCheckTool {
+     bool bugs;                          /**<Whether bug tracking is enabled */
+     GHashTable *mapping;                /**<CVE Mapping */
+     const char *output_file;            /**<Output file, if any */
++    const char *cacert_file;            /**<Non-default SSL certificate file, if any */
+ } CveCheckTool;
+ 
+ /**
+diff --git a/src/library/fetch.c b/src/library/fetch.c
+index 0fe6d76..8f998c3 100644
+--- a/src/library/fetch.c
++++ b/src/library/fetch.c
+@@ -60,7 +60,8 @@ static int progress_callback_new(void *ptr, curl_off_t dltotal, curl_off_t dlnow
+ }
+ 
+ FetchStatus fetch_uri(const char *uri, const char *target, bool verbose,
+-                      unsigned int start_percent, unsigned int end_percent)
++                      unsigned int start_percent, unsigned int end_percent,
++                      const char *cacert_file)
+ {
+         FetchStatus ret = FETCH_STATUS_FAIL;
+         CURLcode res;
+@@ -74,6 +75,13 @@ FetchStatus fetch_uri(const char *uri, const char *target, bool verbose,
+                 return ret;
+         }
+ 
++        if (cacert_file) {
++                res = curl_easy_setopt(curl, CURLOPT_CAINFO, cacert_file);
++                if (res != CURLE_OK) {
++                        goto bail;
++                }
++        }
++
+         if (stat(target, &st) == 0) {
+                 res = curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
+                 if (res != CURLE_OK) {
+diff --git a/src/library/fetch.h b/src/library/fetch.h
+index 4cce5d1..836c7d7 100644
+--- a/src/library/fetch.h
++++ b/src/library/fetch.h
+@@ -29,7 +29,8 @@ typedef enum {
+  * @return A FetchStatus, indicating the operation taken
+  */
+ FetchStatus fetch_uri(const char *uri, const char *target, bool verbose,
+-                      unsigned int this_percent, unsigned int next_percent);
++                      unsigned int this_percent, unsigned int next_percent,
++                      const char *cacert_file);
+ 
+ /**
+  * Attempt to extract the given gzipped file
+diff --git a/src/main.c b/src/main.c
+index 8e6f158..ae69d47 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -280,6 +280,7 @@ static bool csv_mode = false;
+ static char *modified_stamp = NULL;
+ static gchar *mapping_file = NULL;
+ static gchar *output_file = NULL;
++static gchar *cacert_file = NULL;
+ 
+ static GOptionEntry _entries[] = {
+         { "not-patched", 'n', 0, G_OPTION_ARG_NONE, &hide_patched, "Hide patched/addressed CVEs", NULL },
+@@ -294,6 +295,7 @@ static GOptionEntry _entries[] = {
+         { "csv", 'c', 0, G_OPTION_ARG_NONE, &csv_mode, "Output CSV formatted data only", NULL },
+         { "mapping", 'M', 0, G_OPTION_ARG_STRING, &mapping_file, "Path to a mapping file", NULL},
+         { "output-file", 'o', 0, G_OPTION_ARG_STRING, &output_file, "Path to the output file (output plugin specific)", NULL},
++        { "cacert", 'C', 0, G_OPTION_ARG_STRING, &cacert_file, "Path to the combined SSL certificates file (system default is used if not set)", NULL},
+         { .short_name = 0 }
+ };
+ 
+@@ -492,6 +494,7 @@ int main(int argc, char **argv)
+ 
+         quiet = csv_mode || !no_html;
+         self->output_file = output_file;
++        self->cacert_file = cacert_file;
+ 
+         if (!csv_mode && self->output_file) {
+                 quiet = false;
+@@ -530,7 +533,7 @@ int main(int argc, char **argv)
+                 if (status) {
+                         fprintf(stderr, "Update of db forced\n");
+                         cve_db_unlock();
+-                        if (!update_db(quiet, db_path->str)) {
++                        if (!update_db(quiet, db_path->str, self->cacert_file)) {
+                                 fprintf(stderr, "DB update failure\n");
+                                 goto cleanup;
+                         }
+diff --git a/src/update-main.c b/src/update-main.c
+index 2379cfa..c52d9d0 100644
+--- a/src/update-main.c
++++ b/src/update-main.c
+@@ -43,11 +43,13 @@ the Free Software Foundation; either version 2 of the License, or\n\
+ static gchar *nvds = NULL;
+ static bool _show_version = false;
+ static bool _quiet = false;
++static const char *_cacert_file = NULL;
+ 
+ static GOptionEntry _entries[] = {
+         { "nvd-dir", 'd', 0, G_OPTION_ARG_STRING, &nvds, "NVD directory in filesystem", NULL },
+         { "version", 'v', 0, G_OPTION_ARG_NONE, &_show_version, "Show version", NULL },
+         { "quiet", 'q', 0, G_OPTION_ARG_NONE, &_quiet, "Run silently", NULL },
++        { "cacert", 'C', 0, G_OPTION_ARG_STRING, &_cacert_file, "Path to the combined SSL certificates file (system default is used if not set)", NULL},
+         { .short_name = 0 }
+ };
+ 
+@@ -88,7 +90,7 @@ int main(int argc, char **argv)
+                 goto end;
+         }
+ 
+-        if (update_db(_quiet, db_path->str)) {
++        if (update_db(_quiet, db_path->str, _cacert_file)) {
+                 ret = EXIT_SUCCESS;
+         } else {
+                 fprintf(stderr, "Failed to update database\n");
+diff --git a/src/update.c b/src/update.c
+index 070560a..8cb4a39 100644
+--- a/src/update.c
++++ b/src/update.c
+@@ -267,7 +267,8 @@ static inline void update_end(int fd, const char *update_fname, bool ok)
+ 
+ static int do_fetch_update(int year, const char *db_dir, CveDB *cve_db,
+                            bool db_exist, bool verbose,
+-                           unsigned int this_percent, unsigned int next_percent)
++                           unsigned int this_percent, unsigned int next_percent,
++                           const char *cacert_file)
+ {
+         const char nvd_uri[] = URI_PREFIX;
+         autofree(cve_string) *uri_meta = NULL;
+@@ -331,14 +332,14 @@ refetch:
+         }
+ 
+         /* Fetch NVD META file */
+-        st = fetch_uri(uri_meta->str, nvdcve_meta->str, verbose, this_percent, this_percent);
++        st = fetch_uri(uri_meta->str, nvdcve_meta->str, verbose, this_percent, this_percent, cacert_file);
+         if (st == FETCH_STATUS_FAIL) {
+                 fprintf(stderr, "Failed to fetch %s\n", uri_meta->str);
+                 return -1;
+         }
+ 
+         /* Fetch NVD XML file */
+-        st = fetch_uri(uri_data_gz->str, nvdcve_data_gz->str, verbose, this_percent, next_percent);
++        st = fetch_uri(uri_data_gz->str, nvdcve_data_gz->str, verbose, this_percent, next_percent, cacert_file);
+         switch (st) {
+         case FETCH_STATUS_FAIL:
+                 fprintf(stderr, "Failed to fetch %s\n", uri_data_gz->str);
+@@ -391,7 +392,7 @@ refetch:
+         return 0;
+ }
+ 
+-bool update_db(bool quiet, const char *db_file)
++bool update_db(bool quiet, const char *db_file, const char *cacert_file)
+ {
+         autofree(char) *db_dir = NULL;
+         autofree(CveDB) *cve_db = NULL;
+@@ -466,7 +467,8 @@ bool update_db(bool quiet, const char *db_file)
+                 if (!quiet)
+                         fprintf(stderr, "completed: %u%%\r", start_percent);
+                 rc = do_fetch_update(y, db_dir, cve_db, db_exist, !quiet,
+-                                     start_percent, end_percent);
++                                     start_percent, end_percent,
++                                     cacert_file);
+                 switch (rc) {
+                 case 0:
+                         if (!quiet)
+diff --git a/src/update.h b/src/update.h
+index b8e9911..ceea0c3 100644
+--- a/src/update.h
++++ b/src/update.h
+@@ -15,7 +15,7 @@ cve_string *get_db_path(const char *path);
+ 
+ int update_required(const char *db_file);
+ 
+-bool update_db(bool quiet, const char *db_file);
++bool update_db(bool quiet, const char *db_file, const char *cacert_file);
+ 
+ 
+ /*
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cve-check-tool/files/0001-update-Compare-computed-vs-expected-sha256-digit-str.patch b/import-layers/yocto-poky/meta/recipes-devtools/cve-check-tool/files/0001-update-Compare-computed-vs-expected-sha256-digit-str.patch
new file mode 100644
index 0000000..458c0cc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cve-check-tool/files/0001-update-Compare-computed-vs-expected-sha256-digit-str.patch
@@ -0,0 +1,52 @@
+From b0426e63c9ac61657e029f689bcb8dd051e752c6 Mon Sep 17 00:00:00 2001
+From: Sergey Popovich <popovich_sergei@mail.ua>
+Date: Fri, 21 Apr 2017 07:32:23 -0700
+Subject: [PATCH] update: Compare computed vs expected sha256 digit string
+ ignoring case
+
+We produce sha256 digest string using %x snprintf()
+qualifier for each byte of digest which uses alphabetic
+characters from "a" to "f" in lower case to represent
+integer values from 10 to 15.
+
+Previously all of the NVD META files supply sha256
+digest string for corresponding XML file in lower case.
+
+However due to some reason this changed recently to
+provide digest digits in upper case causing fetched
+data consistency checks to fail. This prevents database
+from being updated periodically.
+
+While commit c4f6e94 (update: Do not treat sha256 failure
+as fatal if requested) adds useful option to skip
+digest validation at all and thus provides workaround for
+this situation, it might be unacceptable for some
+deployments where we need to ensure that downloaded
+data is consistent before start parsing it and update
+SQLite database.
+
+Use strcasecmp() to compare two digest strings case
+insensitively and addressing this case.
+
+Upstream-Status: Backport
+Signed-off-by: Sergey Popovich <popovich_sergei@mail.ua>
+---
+ src/update.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/update.c b/src/update.c
+index 8588f38..3cc6b67 100644
+--- a/src/update.c
++++ b/src/update.c
+@@ -187,7 +187,7 @@ static bool nvdcve_data_ok(const char *meta, const char *data)
+                 snprintf(&csum_data[idx], len, "%02hhx", digest[i]);
+         }
+ 
+-        ret = streq(csum_meta, csum_data);
++        ret = !strcasecmp(csum_meta, csum_data);
+ 
+ err_unmap:
+         munmap(buffer, length);
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config.bb b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config.bb
index cb7830b..3cd661d 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config.bb
@@ -1,8 +1,7 @@
 SUMMARY = "Sets up distcc for compilation on the target device"
 
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 SRC_URI = "file://distcc.sh"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root.bb b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root.bb
index 169d005..56375a4 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root.bb
@@ -1,8 +1,7 @@
 SUMMARY = "Configuration script to export target rootfs filesystem"
 DESCRIPTION = "Enables NFS access from any host to the entire filesystem (for development purposes)."
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 PR = "r1"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb b/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb
index 0ec41c3..583b387 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb
@@ -7,7 +7,7 @@
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://install-sh;endline=42;md5=b3549726c1022bee09c174c72a0ca4a5"
 
-SRC_URI = "ftp://invisible-island.net/diffstat/diffstat-${PV}.tgz \
+SRC_URI = "http://invisible-mirror.net/archives/${BPN}/${BP}.tgz \
            file://run-ptest \
 "
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.2.bb
index c084ad2..ea3d7c1 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.2.bb
@@ -65,7 +65,3 @@
 		${systemd_unitdir}/system/distcc.service"
 FILES_distcc-distmon-gnome = "  ${bindir}/distccmon-gnome \
 				${datadir}/distcc"
-
-pkg_postrm_${PN} () {
-	deluser distcc || true
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch
new file mode 100644
index 0000000..c9df458
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch
@@ -0,0 +1,21 @@
+From 8ce181714640315d2dd37ee794acbb22063cd669 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 26 Jan 2017 16:36:20 +0200
+Subject: [PATCH] Corretly install tmpfiles.d configuration
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ etc/tmpfiles.d/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/etc/tmpfiles.d/CMakeLists.txt b/etc/tmpfiles.d/CMakeLists.txt
+index f69c773e..3eb6d0e8 100644
+--- a/etc/tmpfiles.d/CMakeLists.txt
++++ b/etc/tmpfiles.d/CMakeLists.txt
+@@ -1 +1 @@
+-INSTALL (FILES dnf.conf DESTINATION /usr/lib/tmpfiles.d/)
++INSTALL (FILES dnf.conf DESTINATION ${SYSCONFDIR}/tmpfiles.d/)
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch
new file mode 100644
index 0000000..0f261e5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch
@@ -0,0 +1,29 @@
+From 4313ced1320594013795f11f6db00381e3f4cc45 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 26 Jan 2017 16:25:47 +0200
+Subject: [PATCH] Do not hardcode /etc and systemd unit directories
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6a319935..db20ccd4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -7,8 +7,8 @@ if (NOT PYTHON_DESIRED)
+     set (PYTHON_DESIRED "2")
+ endif()
+ 
+-SET( SYSCONFDIR /etc)
+-SET( SYSTEMD_DIR /usr/lib/systemd/system)
++SET( SYSCONFDIR ${CMAKE_INSTALL_SYSCONFDIR})
++SET( SYSTEMD_DIR $ENV{systemd_system_unitdir})
+ 
+ if (${PYTHON_DESIRED} STREQUAL "2")
+ 	FIND_PACKAGE (PythonInterp REQUIRED)
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0001-Do-not-prepend-installroot-to-logdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0001-Do-not-prepend-installroot-to-logdir.patch
new file mode 100644
index 0000000..a90e77c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0001-Do-not-prepend-installroot-to-logdir.patch
@@ -0,0 +1,31 @@
+From 31653d324cf8c7b1f2f9e49d22676bd2ac546331 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 11 Jan 2017 15:10:13 +0200
+Subject: [PATCH] Do not prepend installroot to logdir.
+
+This would otherwise write the logs into rootfs/var/log
+(whereas we want them in $T),
+and will break installation of base-files rpm.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ dnf/cli/cli.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
+index b764801a..893f4bda 100644
+--- a/dnf/cli/cli.py
++++ b/dnf/cli/cli.py
+@@ -881,7 +881,7 @@ class Cli(object):
+         subst = conf.substitutions
+         subst.update_from_etc(conf.installroot)
+ 
+-        for opt in ('cachedir', 'logdir', 'persistdir'):
++        for opt in ('cachedir', 'persistdir'):
+             conf.prepend_installroot(opt)
+ 
+         self.base._logging._setup_from_dnf_conf(conf)
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
new file mode 100644
index 0000000..8c59f9f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
@@ -0,0 +1,27 @@
+From 3ddaa930cda57a62a2174faebcc87aebc59591d1 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:29:07 +0200
+Subject: [PATCH 29/30] Do not set PYTHON_INSTALL_DIR by running python
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6a319935..466ca1e6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -18,7 +18,7 @@ else()
+ 	FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
+ endif()
+ 
+-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+ EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write('%s.%s' % (sys.version_info.major, sys.version_info.minor))" OUTPUT_VARIABLE PYTHON_MAJOR_DOT_MINOR_VERSION)
+ MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}")
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch
new file mode 100644
index 0000000..61328e6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch
@@ -0,0 +1,48 @@
+From 9c8d545152b35d8943be72b9503414a53e1ebf7c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:29:37 +0200
+Subject: [PATCH 30/30] Run python scripts using env
+
+Otherwise the build tools hardcode the python path into them.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ bin/dnf-automatic.in | 2 +-
+ bin/dnf.in           | 2 +-
+ bin/yum.in           | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/bin/dnf-automatic.in b/bin/dnf-automatic.in
+index 5b06aa26..9f6f703e 100755
+--- a/bin/dnf-automatic.in
++++ b/bin/dnf-automatic.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON_EXECUTABLE@
++#!/usr/bin/env python3
+ # dnf-automatic executable.
+ #
+ # Copyright (C) 2014-2016 Red Hat, Inc.
+diff --git a/bin/dnf.in b/bin/dnf.in
+index 645d0f06..ab141abd 100755
+--- a/bin/dnf.in
++++ b/bin/dnf.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON_EXECUTABLE@
++#!/usr/bin/env python3
+ # The dnf executable script.
+ #
+ # Copyright (C) 2012-2016 Red Hat, Inc.
+diff --git a/bin/yum.in b/bin/yum.in
+index f1fee071..013dc8c5 100755
+--- a/bin/yum.in
++++ b/bin/yum.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON_EXECUTABLE@
++#!/usr/bin/env python3
+ # The dnf executable script.
+ #
+ # Copyright (C) 2016 Red Hat, Inc.
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf_git.bb
new file mode 100644
index 0000000..9f814fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dnf/dnf_git.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Package manager forked from Yum, using libsolv as a dependency resolver"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://PACKAGE-LICENSING;md5=bfc29916e11321be06924c4fb096fdcc \
+                   "
+
+SRC_URI = "git://github.com/rpm-software-management/dnf.git \
+           file://0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
+           file://0030-Run-python-scripts-using-env.patch \
+           file://0001-Do-not-prepend-installroot-to-logdir.patch \
+           file://0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch \
+           file://0001-Corretly-install-tmpfiles.d-configuration.patch \
+           "
+
+PV = "2.0.0+git${SRCPV}"
+SRCREV = "f0093d672d3069cfee8447973ae70ef615fd8886"
+
+S = "${WORKDIR}/git"
+
+inherit cmake gettext bash-completion distutils3-base systemd
+
+DEPENDS += "libdnf librepo libcomps python3-pygpgme python3-iniparse"
+
+# manpages generation requires http://www.sphinx-doc.org/
+EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
+
+BBCLASSEXTEND = "native nativesdk"
+RDEPENDS_${PN}_class-target += "python3-core python3-codecs python3-netclient python3-email python3-threading python3-distutils librepo python3-shell python3-subprocess libcomps libdnf python3-sqlite3 python3-compression python3-pygpgme python3-rpm python3-iniparse python3-json python3-importlib python3-curses python3-argparse python3-misc"
+
+# Create a symlink called 'dnf' as 'make install' does not do it, but
+# .spec file in dnf source tree does (and then Fedora and dnf documentation
+# says that dnf binary is plain 'dnf').
+do_install_append() {
+        lnr ${D}/${bindir}/dnf-3 ${D}/${bindir}/dnf
+        lnr ${D}/${bindir}/dnf-automatic-3 ${D}/${bindir}/dnf-automatic
+}
+
+# Direct dnf-native to read rpm configuration from our sysroot, not the one it was compiled in
+do_install_append_class-native() {
+        create_wrapper ${D}/${bindir}/dnf \
+                RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
+                RPM_NO_CHROOT_FOR_SCRIPTS=1
+}
+
+SYSTEMD_SERVICE_${PN} = "dnf-makecache.service dnf-makecache.timer \
+                         dnf-automatic-download.service dnf-automatic-download.timer \
+                         dnf-automatic-install.service dnf-automatic-install.timer \
+                         dnf-automatic-notifyonly.service dnf-automatic-notifyonly.timer \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb
deleted file mode 100644
index b7791f3..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb
+++ /dev/null
@@ -1,71 +0,0 @@
-SUMMARY = "DSSSL stylesheets used to transform SGML and XML DocBook files"
-HOMEPAGE = "http://docbook.sourceforge.net"
-# Simple persmissive
-LICENSE = "DSSSL"
-LIC_FILES_CHKSUM = "file://README;beginline=41;endline=74;md5=875385159b2ee76ecf56136ae7f542d6"
-
-DEPENDS = "sgml-common-native"
-
-PR = "r4"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/docbook/docbook-dsssl-${PV}.tar.bz2"
-
-SRC_URI[md5sum] = "bc192d23266b9a664ca0aba4a7794c7c"
-SRC_URI[sha256sum] = "2f329e120bee9ef42fbdd74ddd60e05e49786c5a7953a0ff4c680ae6bdf0e2bc"
-
-UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/docbook/files/docbook-dsssl/"
-UPSTREAM_CHECK_REGEX = "/docbook-dsssl/(?P<pver>(\d+[\.\-_]*)+)/"
-
-S = "${WORKDIR}/docbook-dsssl-${PV}"
-
-inherit native
-
-SSTATEPOSTINSTFUNCS += "docbook_dsssl_stylesheets_sstate_postinst"
-SYSROOT_PREPROCESS_FUNCS += "docbook_dsssl_sysroot_preprocess"
-CLEANFUNCS += "docbook_dsssl_stylesheets_sstate_clean"
-
-
-do_install () {
-	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/docbook-dsssl.html
-	# for details.
-	install -d ${D}${bindir}
-	install -m 0755 bin/collateindex.pl ${D}${bindir}
-
-	install -d ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
-	install -m 0644 catalog ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
-	cp -v -R * ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
-
-	install -d ${D}${sysconfdir}/sgml
-	echo "CATALOG ${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/catalog" > \
-		 ${D}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
-	echo "CATALOG ${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/common/catalog" >> \
-		${D}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
-}
-
-docbook_dsssl_stylesheets_sstate_postinst () {
-	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
-	then
-		# Ensure that the catalog file sgml-docbook.cat is properly
-		# updated when the package is installed from sstate cache.
-		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl \
-			--add ${sysconfdir}/sgml/sgml-docbook.bak \
-			${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
-		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl \
-			--add ${sysconfdir}/sgml/sgml-docbook.cat \
-			${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
-	fi
-}
-
-docbook_dsssl_sysroot_preprocess () {
-    install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
-    install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl
-}
-
-docbook_dsssl_stylesheets_sstate_clean () {
-	# Ensure that the catalog file sgml-docbook.cat is properly
-	# updated when the package is removed from sstate cache.
-	files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
-	for f in $files; do
-		[ ! -f $f ] || sed -i '/\/sgml\/dsssl-docbook-stylesheets.cat/d' $f
-	done
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb
deleted file mode 100644
index a3ee5d8..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-require docbook-sgml-dtd-native.inc
-
-LICENSE = "OASIS"
-LIC_FILES_CHKSUM = "file://LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
-
-DTD_VERSION = "3.1"
-
-PR = "${INC_PR}.0"
-
-# Note: the upstream sources are not distributed with a license file.
-# LICENSE-OASIS is included as a "patch" to workaround this. When
-# upgrading this recipe, please verify whether this is still needed.
-SRC_URI = "http://www.docbook.org/sgml/3.1/docbk31.zip \
-           file://LICENSE-OASIS"
-
-SRC_URI[md5sum] = "432749c0c806dbae81c8bcb70da3b5d3"
-SRC_URI[sha256sum] = "20261d2771b9a052abfa3d8fab1aa62be05791a010281c566f9073bf0e644538"
-
-UPSTREAM_CHECK_URI = "http://www.docbook.org/sgml/"
-UPSTREAM_CHECK_REGEX = "(?P<pver>3\..+)/"
-
-do_compile() {
-	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd-3.html
-	# for details.
-	sed -i -e '/ISO 8879/d' -e 's|DTDDECL "-//OASIS//DTD DocBook V3.1//EN"|SGMLDECL|g' docbook.cat
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb
deleted file mode 100644
index be59680..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-require docbook-sgml-dtd-native.inc
-
-LICENSE = "OASIS"
-LIC_FILES_CHKSUM = "file://LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
-
-DTD_VERSION = "4.1"
-
-PR = "${INC_PR}.0"
-
-# Note: the upstream sources are not distributed with a license file.
-# LICENSE-OASIS is included as a "patch" to workaround this. When
-# upgrading this recipe, please verify whether this is still needed.
-SRC_URI = "http://docbook.org/sgml/4.1/docbk41.zip \
-           file://LICENSE-OASIS"
-
-SRC_URI[md5sum] = "489f6ff2a2173eb1e14216c10533ede2"
-SRC_URI[sha256sum] = "deaafcf0a3677692e7ad4412c0e41c1db3e9da6cdcdb3dd32b2cc1f9c97d6311"
-
-UPSTREAM_CHECK_URI = "http://www.docbook.org/sgml/"
-UPSTREAM_CHECK_REGEX = "(?P<pver>4\.1(\.\d+)*)/"
-
-do_compile() {
-	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
-	# for details.
-	sed -i -e '/ISO 8879/d' -e '/gml/d' docbook.cat
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb
deleted file mode 100644
index ae723c7..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require docbook-sgml-dtd-native.inc
-
-LICENSE = "OASIS"
-LIC_FILES_CHKSUM = "file://LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
-
-DTD_VERSION = "4.5"
-
-PR = "${INC_PR}.0"
-PV = "4.5"
-
-SRC_URI[md5sum] = "07c581f4bbcba6d3aac85360a19f95f7"
-SRC_URI[sha256sum] = "8043e514e80c6c19cb146b5d37937d1305bf3abf9b0097c36df7f70f611cdf43"
-
-do_compile() {
-	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
-	# for details.
-	sed -i -e '/ISO 8879/d' -e'/gml/d' docbook.cat
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc
deleted file mode 100644
index af50987..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc
+++ /dev/null
@@ -1,70 +0,0 @@
-# The DTDs of the various versions have to be installed in parallel and
-# should not replace each other. The installation step is common for
-# all versions and just differs in ${DTD_VERSION} which is set in each
-# version recipe.
-#
-# The DTDs do have some quirks (see LFS documentation).
-SUMMARY = "Document type definitions for verification of SGML data files"
-DESCRIPTION = "Document type definitions for verification of SGML data \
-files against the DocBook rule set"
-HOMEPAGE = "http://www.docbook.org/sgml/"
-
-DEPENDS = "sgml-common-native"
-
-# Note: the upstream sources are not distributed with a license file.
-# LICENSE-OASIS is included as a "patch" to workaround this. When
-# upgrading this recipe, please verify whether this is still needed.
-SRC_URI = "http://www.docbook.org/sgml/${DTD_VERSION}/docbook-${DTD_VERSION}.zip \
-           file://LICENSE-OASIS"
-
-# The .zip file extracts to the current dir
-S = "${WORKDIR}"
-
-INC_PR = "r3"
-
-SSTATEPOSTINSTFUNCS += "docbook_sgml_dtd_sstate_postinst"
-SYSROOT_PREPROCESS_FUNCS += "docbook_sgml_dtd_sysroot_preprocess"
-
-inherit native
-
-do_install () {
-	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
-	# for details.
-	install -d -m 755 ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}
-	install docbook.cat ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog
-	cp -PpRr *.dtd *.mod *.dcl ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}
-
-	install -d ${D}${sysconfdir}/sgml
-	echo "CATALOG ${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog" > \
-		${D}${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
-}
-
-docbook_sgml_dtd_sstate_postinst () {
-	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
-	then
-		# Ensure that the catalog file sgml-docbook.cat is properly
-		# updated when the package is installed from sstate cache.
-		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION} \
-			--add ${sysconfdir}/sgml/sgml-docbook.bak \
-			${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
-		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION} \
-			--add ${sysconfdir}/sgml/sgml-docbook.cat \
-			${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
-	fi
-}
-
-docbook_sgml_dtd_sysroot_preprocess () {
-    install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
-    install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION}
-}
-
-CLEANFUNCS += "docbook_sgml_dtd_sstate_clean"
-
-docbook_sgml_dtd_sstate_clean () {
-	# Ensure that the catalog file sgml-docbook.cat is properly
-	# updated when the package is removed from sstate cache.
-	files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
-	for f in $files; do
-		[ ! -f $f ] || sed -i '/\/sgml\/sgml-docbook-dtd-${DTD_VERSION}.cat/d' $f
-	done
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS
deleted file mode 100644
index 6da7f5b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS
+++ /dev/null
@@ -1,16 +0,0 @@
-Permission to use, copy, modify and distribute the DocBook XML DTD
-and its accompanying documentation for any purpose and without fee
-is hereby granted in perpetuity, provided that the above copyright
-notice and this paragraph appear in all copies.  The copyright
-holders make no representation about the suitability of the DTD for
-any purpose.  It is provided "as is" without expressed or implied
-warranty.
-
-If you modify the DocBook DTD in any way, except for declaring and
-referencing additional sets of general entities and declaring
-additional notations, label your DTD as a variant of DocBook.  See
-the maintenance documentation for more information.
-
-Please direct all questions, bug reports, or suggestions for 
-changes to the docbook@lists.oasis-open.org mailing list. For more
-information, see http://www.oasis-open.org/docbook/.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch b/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch
deleted file mode 100644
index db079d6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Upstream-Status: Pending
-
-Fix runtime error occurred e.g. with docbook-to-man calls:
-
-  grep: character class syntax is [[:space:]], not [:space:]
-  grep: character class syntax is [[:space:]], not [:space:]
-  jw: There is no frontend called "/docbook/utils-0.6.14/frontends/docbook".
-
-See also:
-
-   <https://qa.mandriva.com/show_bug.cgi?id=61127>
-
-Signed-off-by: Steffen Sledz <sledz@dresearch-fe.de>
-
-diff -Nurd docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in
---- docbook-utils-0.6.14-orig/bin/jw.in	2012-03-29 07:50:00.789564826 +0200
-+++ docbook-utils-0.6.14/bin/jw.in	2012-03-29 07:52:10.371302967 +0200
-@@ -80,9 +80,9 @@
- SGML_CATALOGS_DIR="/etc/sgml"
- if [ -f "$SGML_CONF" ]
- then
--  RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*'
-+  RE='^[[:space:]]*SGML_BASE_DIR[[:space:]]*=[[:space:]]*'
-   SGML_BASE_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"`
--  RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*'
-+  RE='^[[:space:]]*SGML_CATALOGS_DIR[[:space:]]*=[[:space:]]*'
-   SGML_CATALOGS_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"`
- fi
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
deleted file mode 100644
index 44b43a8..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
+++ /dev/null
@@ -1,63 +0,0 @@
-SUMMARY = "Utilities for formatting and manipulating DocBook documents"
-DESCRIPTION = "A collection of all the free software tools you need to \
-work on and format DocBook documents."
-HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
-SECTION = "console/utils"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-DEPENDS = "openjade-native sgmlspl-native docbook-dsssl-stylesheets-native docbook-sgml-dtd-3.1-native"
-
-PR = "r3"
-
-SRC_URI = "\
-	http://ftp.osuosl.org/pub/blfs/conglomeration/docbook-utils/docbook-utils-${PV}.tar.gz \
-	file://re.patch \
-"
-
-SRC_URI[md5sum] = "6b41b18c365c01f225bc417cf632d81c"
-SRC_URI[sha256sum] = "48faab8ee8a7605c9342fb7b906e0815e3cee84a489182af38e8f7c0df2e92e9"
-
-inherit autotools native
-
-do_configure_prepend() {
-	# Fix hard-coded references to /etc/sgml
-	if [ ! -e ${S}/.sed_done ]; then
-		sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" ${S}/bin/jw.in
-		sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" ${S}/doc/man/Makefile.am
-		sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" ${S}/doc/HTML/Makefile.am
-
-		# Point jw to the native sysroot catalog
-		sed -i -e 's|^SGML_EXTRA_CATALOGS=""|SGML_EXTRA_CATALOGS=":${sysconfdir}/sgml/catalog"|g' ${S}/bin/jw.in
-		touch ${S}/.sed_done
-	fi
-}
-do_unpack[cleandirs] += "${S}"
-
-do_install() {
-	install -d ${D}${bindir}
-	# Install the binaries and a bunch of other commonly used names for them.
-	for doctype in html ps dvi man pdf rtf tex texi txt
-	do
-		install -m 0755 ${S}/bin/docbook2$doctype ${D}${bindir}/
-		ln -sf docbook2x-$doctype ${D}${bindir}/db2$doctype
-		ln -sf docbook2$doctype ${D}${bindir}/db2$doctype
-		ln -sf docbook2$doctype ${D}${bindir}/docbook-to-$doctype
-	done
-
-	install -m 0755 ${B}/bin/jw ${D}${bindir}/
-	for i in backends/dvi backends/html \
-		backends/pdf backends/ps backends/rtf backends/tex \
-		backends/txt \
-		helpers/docbook2man-spec.pl helpers/docbook2texi-spec.pl \
-		docbook-utils.dsl
-	do
-		install -d ${D}${datadir}/sgml/docbook/utils-${PV}/`dirname $i`
-		install ${S}/$i ${D}${datadir}/sgml/docbook/utils-${PV}/$i
-	done
-	for i in backends/man backends/texi frontends/docbook
-	do
-		install -d ${D}${datadir}/sgml/docbook/utils-${PV}/`dirname $i`
-		install ${B}/$i ${D}${datadir}/sgml/docbook/utils-${PV}/$i
-	done
-
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb
index 2f13dba..da62b77 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb
@@ -27,10 +27,7 @@
 inherit allarch
 BBCLASSEXTEND = "native"
 
-SSTATEPOSTINSTFUNCS_append_class-native = " docbook_xml_dtd_sstate_postinst"
-SYSROOT_PREPROCESS_FUNCS_append_class-native = " docbook_xml_dtd_sysroot_preprocess"
-
-do_configre (){
+do_configure (){
     :
 }
 
@@ -49,18 +46,10 @@
     install -m 755  ${WORKDIR}/docbook-xml.xml ${D}${sysconfdir}/xml/docbook-xml.xml
 }
 
-docbook_xml_dtd_sstate_postinst () {
-    if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
-    then
-        # Ensure that the catalog file sgml-docbook.cat is properly
-        # updated when the package is installed from sstate cache.
-        sed -i -e "s|file://.*/usr/share/xml|file://${datadir}/xml|g" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xml.xml
-    fi
-}
-
-docbook_xml_dtd_sysroot_preprocess () {
-    # Update the hardcode dir in docbook-xml.xml
-    sed -i -e "s|file:///usr/share/xml|file://${datadir}/xml|g" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xml.xml
+do_install_append_class-native () {
+	# Ensure that the catalog file sgml-docbook.cat is properly
+	# updated when the package is installed from sstate cache.
+	sed -i -e "s|file://.*/usr/share/xml|file://${datadir}/xml|g" ${D}${sysconfdir}/xml/docbook-xml.xml
 }
 
 FILES_${PN} = "${datadir}/* ${sysconfdir}/xml/docbook-xml.xml"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.79.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.79.1.bb
index aa03a82..07d32ce 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.79.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.79.1.bb
@@ -20,9 +20,6 @@
 inherit allarch
 BBCLASSEXTEND = "native"
 
-SSTATEPOSTINSTFUNCS_append_class-native = " docbook_xsl_stylesheets_sstate_postinst"
-SYSROOT_PREPROCESS_FUNCS_append_class-native = " docbook_xsl_stylesheets_sysroot_preprocess"
-
 do_configure (){
 	:
 }
@@ -55,18 +52,10 @@
 
 }
 
-docbook_xsl_stylesheets_sstate_postinst () {
-    if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
-    then
-        # Ensure that the catalog file sgml-docbook.cat is properly
-        # updated when the package is installed from sstate cache.
-        sed -i -e "s|file://.*/usr/share/xml|file://${datadir}/xml|g" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xsl.xml
-    fi
-}
-
-docbook_xsl_stylesheets_sysroot_preprocess () {
-    # Update the hardcode dir in docbook-xml.xml
-    sed -i -e "s|file:///usr/share/xml|file://${datadir}/xml|g" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xsl.xml
+do_install_append_class-native () {
+	# Ensure that the catalog file sgml-docbook.cat is properly
+	# updated when the package is installed from sstate cache.
+	sed -i -e "s|file://.*/usr/share/xml|file://${datadir}/xml|g" ${D}${sysconfdir}/xml/docbook-xsl.xml
 }
 
 RDEPENDS_${PN} += "perl"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch
deleted file mode 100644
index 06f5b7a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From b7c42c6a9829bea911b22201edd7df2a9bec1a14 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 13 Apr 2015 17:52:34 -0700
-Subject: [PATCH] Include fcntl.h for getting loff_t definition
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- dosfsck/dosfsck.h | 2 ++
- dosfsck/lfn.c     | 1 +
- 2 files changed, 3 insertions(+)
-
-diff --git a/dosfsck/dosfsck.h b/dosfsck/dosfsck.h
-index d9314b1..2076d5f 100644
---- a/dosfsck/dosfsck.h
-+++ b/dosfsck/dosfsck.h
-@@ -50,6 +50,8 @@
- #define CT_LE_L(v) (v)
- #endif /* __BIG_ENDIAN */
- 
-+#include <fcntl.h>
-+
- #define VFAT_LN_ATTR (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
- 
- /* ++roman: Use own definition of boot sector structure -- the kernel headers'
-diff --git a/dosfsck/lfn.c b/dosfsck/lfn.c
-index 9b2cfc3..bb04fda 100644
---- a/dosfsck/lfn.c
-+++ b/dosfsck/lfn.c
-@@ -7,6 +7,7 @@
- #include <string.h>
- #include <limits.h>
- #include <time.h>
-+#include <fcntl.h>
- 
- #include "common.h"
- #include "io.h"
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch
deleted file mode 100644
index b46b2db..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-The problem is that unsigned char[2] is
-guranteed to be 8Bit aligned on arm
-but unsigned short is/needs to be 16bit aligned
-the union { unsigned short; unsigned char[2] } trick 
-didn't work so no we use the alpha hack.
-
-memcpy into an 16bit aligned
-
-    -zecke
-
-Upstream-Status: Inappropriate [licensing]
-We're tracking an old release of dosfstools due to licensing issues.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
---- dosfstools/dosfsck/boot.c.orig	2003-05-15 19:32:23.000000000 +0200
-+++ dosfstools/dosfsck/boot.c	2003-06-13 17:44:25.000000000 +0200
-@@ -36,17 +36,15 @@
-     { 0xff, "5.25\" 320k floppy 2s/40tr/8sec" },
- };
- 
--#if defined __alpha || defined __ia64__ || defined __s390x__ || defined __x86_64__ || defined __ppc64__
-+
- /* Unaligned fields must first be copied byte-wise */
- #define GET_UNALIGNED_W(f)			\
-     ({						\
- 	unsigned short __v;			\
- 	memcpy( &__v, &f, sizeof(__v) );	\
--	CF_LE_W( *(unsigned short *)&f );	\
-+	CF_LE_W( *(unsigned short *)&__v );	\
-     })
--#else
--#define GET_UNALIGNED_W(f) CF_LE_W( *(unsigned short *)&f )
--#endif
-+
- 
- 
- static char *get_media_descr( unsigned char media )
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch
deleted file mode 100644
index 35abd1a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ensure the __s8 type is properly defined.
-
-Upstream-Status: Inappropriate [licensing]
-We're tracking an old release of dosfstools due to licensing issues.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
---- dosfstools-2.10/dosfsck/dosfsck.h.org	2006-02-21 08:36:14.000000000 -0700
-+++ dosfstools-2.10/dosfsck/dosfsck.h	2006-02-21 08:40:12.000000000 -0700
-@@ -22,6 +22,14 @@
-        #undef __KERNEL__
- #endif
- 
-+#ifndef __s8
-+#include <asm/types.h>
-+#endif
-+
-+#ifndef __ASM_STUB_BYTEORDER_H__
-+#include <asm/byteorder.h>
-+#endif
-+
- #include <linux/msdos_fs.h>
- 
- /* 2.1 kernels use le16_to_cpu() type functions for CF_LE_W & Co., but don't
---- dosfstools-2.10/dosfsck/file.c.org	2006-02-21 08:37:36.000000000 -0700
-+++ dosfstools-2.10/dosfsck/file.c	2006-02-21 08:37:47.000000000 -0700
-@@ -23,6 +23,10 @@
-        #undef __KERNEL__
- #endif
- 
-+#ifndef __s8
-+#include <asm/types.h>
-+#endif
-+
- #include <linux/msdos_fs.h>
- 
- #include "common.h"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch
deleted file mode 100644
index 9d7f732..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch
+++ /dev/null
@@ -1,489 +0,0 @@
-Upstream-Status: Inappropriate
-
-This patch fixes populated dosfs image creation with directory 
-structures. Earlier it was causing segfault; and only image 
-population with no subdirectories was working.
-
-Issues fixed:
-1. (dir->count == dir->entries) check was only needed for root 
-   directory entries. And this check is wrong for non-root 
-   directories.
-2. For each dir entry 2 dir->table entries were needed, one for 
-   the file/dir and 2nd for long file name support. Earlier long
-   name support was added for filenames but the 2nd entry 
-   allocation, initialization & counting was missed.
-3. The memory clearing was missed at the code path after dir->table 
-   memroy allocation.
-4. Add entries for . & .. directories in all non-root directories.
-5. The . directory points to the correct entry in fat now.
-6. All directoriy entries' size was not zero as required for dosfsck,
-   Now all directory entries' size is zero.
-
-Enhancements:
-1. Added support for long names for directory names. This is same
-   as the existing long name support for filenames.
-2. Added error messages for previously silent memory allocation and 
-   other errors.
-3. -d options does not work correctly with fat32, so now throwing 
-   an error for that.
-4. Use predefined structures from kernel's msdos_fs.h file, rather 
-   than defining again here. And accordingly change the names & use
-   of structure variables.
-
-Outstanding Issues:
-1. The .. directory entry do not point to the parent of current
-   directory. This issue can be fixed by running dosfsck -a after
-   image creation.
-2. For files the filesize is correct, but the clusters size is more 
-   than it needs to be, this also can be fixed by running dosfsck -a
-   after image creation.
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 
-2011/12/13
-
-
-Index: dosfstools-2.11/mkdosfs/mkdosfs.c
-===================================================================
---- dosfstools-2.11.orig/mkdosfs/mkdosfs.c
-+++ dosfstools-2.11/mkdosfs/mkdosfs.c
-@@ -21,7 +21,17 @@
-    June 2004 - Jordan Crouse (info.linux@amd.com)
-    Added -d <directory> support to populate the image
-    Copyright (C) 2004, Advanced Micro Devices, All Rights Reserved
--   
-+
-+   2011-12-13: Nitin A Kamble <nitin.a.kamble@intel.com>
-+   Enhanced the -d <directory> support for population of image while
-+   creation. Earlier subdirectores support was broken, only files in
-+   the rootdir were supported. Now directory hirarchy is supported.
-+   Also added long filename support to directory names.
-+     The -d <directory> option (image population while creation)
-+   is broken with fat32.
-+   Copyright (C) 2011, Intel Corporation, All Rights Reserved
-+
-+
-    Fixes/additions May 1998 by Roman Hodek
-    <Roman.Hodek@informatik.uni-erlangen.de>:
-    - Atari format support
-@@ -86,23 +96,23 @@
- # undef __KERNEL__
- #endif
- 
--#if __BYTE_ORDER == __BIG_ENDIAN
--
-+#ifndef __ASM_STUB_BYTEORDER_H__
- #include <asm/byteorder.h>
--#ifdef __le16_to_cpu
--/* ++roman: 2.1 kernel headers define these function, they're probably more
-- * efficient then coding the swaps machine-independently. */
--#define CF_LE_W	__le16_to_cpu
--#define CF_LE_L	__le32_to_cpu
--#define CT_LE_W	__cpu_to_le16
--#define CT_LE_L	__cpu_to_le32
--#else
--#define CF_LE_W(v) ((((v) & 0xff) << 8) | (((v) >> 8) & 0xff))
--#define CF_LE_L(v) (((unsigned)(v)>>24) | (((unsigned)(v)>>8)&0xff00) | \
--               (((unsigned)(v)<<8)&0xff0000) | ((unsigned)(v)<<24))
-+#endif
-+
-+#include <linux/msdos_fs.h>
-+
-+#undef CF_LE_W
-+#undef CF_LE_L
-+#undef CT_LE_W
-+#undef CT_LE_L
-+
-+#if __BYTE_ORDER == __BIG_ENDIAN
-+#include <byteswap.h>
-+#define CF_LE_W(v) bswap_16(v)
-+#define CF_LE_L(v) bswap_32(v)
- #define CT_LE_W(v) CF_LE_W(v)
- #define CT_LE_L(v) CF_LE_L(v)
--#endif /* defined(__le16_to_cpu) */
-     
- #else
- 
-@@ -253,33 +263,6 @@ struct fat32_fsinfo {
-   __u32		reserved2[4];
- };
- 
--/* This stores up to 13 chars of the name */
--
--struct msdos_dir_slot {
--        __u8    id;             /* sequence number for slot */
--        __u8    name0_4[10];    /* first 5 characters in name */
--        __u8    attr;           /* attribute byte */
--        __u8    reserved;       /* always 0 */
--        __u8    alias_checksum; /* checksum for 8.3 alias */
--        __u8    name5_10[12];   /* 6 more characters in name */
--        __u16   start;          /* starting cluster number, 0 in long slots */
--        __u8    name11_12[4];   /* last 2 characters in name */
--};
--
--struct msdos_dir_entry
--  {
--    char	name[8], ext[3];	/* name and extension */
--    __u8        attr;			/* attribute bits */
--    __u8	lcase;			/* Case for base and extension */
--    __u8	ctime_ms;		/* Creation time, milliseconds */
--    __u16	ctime;			/* Creation time */
--    __u16	cdate;			/* Creation date */
--    __u16	adate;			/* Last access date */
--    __u16	starthi;		/* high 16 bits of first cl. (FAT32) */
--    __u16	time, date, start;	/* time, date and first cluster */
--    __u32	size;			/* file size (in bytes) */
--  } __attribute__ ((packed));
--
- /* The "boot code" we put into the filesystem... it writes a message and
-    tells the user to try again */
- 
-@@ -356,7 +339,6 @@ static struct msdos_dir_entry *root_dir;
- static int size_root_dir;	/* Size of the root directory in bytes */
- static int sectors_per_cluster = 0;	/* Number of sectors per disk cluster */
- static int root_dir_entries = 0;	/* Number of root directory entries */
--static int root_dir_num_entries = 0;
- static int last_cluster_written = 0;
- 
- static char *blank_sector;		/* Blank sector - all zeros */
-@@ -1315,7 +1297,7 @@ setup_tables (void)
-       de->date = CT_LE_W((unsigned short)(ctime->tm_mday +
- 					  ((ctime->tm_mon+1) << 5) +
- 					  ((ctime->tm_year-80) << 9)));
--      de->ctime_ms = 0;
-+      de->ctime_cs = 0;
-       de->ctime = de->time;
-       de->cdate = de->date;
-       de->adate = de->date;
-@@ -1451,16 +1433,23 @@ write_tables (void)
- 
- /* Add a file to the specified directory entry, and also write it into the image */
- 
--static void copy_filename(char *filename, char *base, char *ext) {
-+static void copy_filename(char *filename, char *dos_name) {
-   
-   char *ch = filename;
-   int i, len;
- 
--  memset(base, 0x20, 8);
--  memset(ext, 0x20, 3);
-+  if (!strcmp(filename, ".")) {
-+    strncpy(dos_name, MSDOS_DOT, MSDOS_NAME);
-+    return;
-+  }
-+  if (!strcmp(filename, "..")) {
-+    strncpy(dos_name, MSDOS_DOTDOT, MSDOS_NAME);
-+    return;
-+  }
-+  memset(dos_name, 0x20, MSDOS_NAME);
-   
-   for(len = 0 ; *ch && *ch != '.'; ch++) {
--    base[len++] = toupper(*ch);
-+    dos_name[len++] = toupper(*ch);
-     if (len == 8) break;
-   }
-   
-@@ -1468,7 +1457,7 @@ static void copy_filename(char *filename
-   if (*ch) ch++;
-   
-   for(len = 0 ; *ch; ch++) {
--    ext[len++] = toupper(*ch);
-+    dos_name[8 + len++] = toupper(*ch);
-     if (len == 3) break;
-   }
- }
-@@ -1551,7 +1540,7 @@ static int add_file(char *filename, stru
-   int start;
-   int usedsec, totalsec;
- 
--  char name83[8], ext83[3];
-+  char dos_name[MSDOS_NAME+1];
- 
-   struct msdos_dir_slot *slot;
-   int i;
-@@ -1562,23 +1551,22 @@ static int add_file(char *filename, stru
-   if (dir->root) {
-     if (dir->count == dir->entries) {
-       printf("Error - too many directory entries\n");
-+      return;
-     }
-   }
-   else {
--    if (dir->count == dir->entries) {
--      if (!dir->table) 
--	dir->table = 
--	  (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
--      else {
--	dir->table = 
--	  (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) * 
--					     sizeof(struct msdos_dir_entry));
--
--	memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
--      }
--
--      dir->entries++;
--    }
-+    /* 2 entries, one extra for long filename */
-+    if (!dir->table)
-+      dir->table =
-+        (struct msdos_dir_entry *) malloc(2 * sizeof(struct msdos_dir_entry));
-+    else
-+      dir->table =
-+        (struct msdos_dir_entry *) realloc(dir->table, 2 * (dir->entries + 1) *
-+      				     sizeof(struct msdos_dir_entry));
-+    if (!dir->table)
-+      printf("Error - realloc failed\n");
-+    memset(&dir->table[dir->entries], 0, 2 * sizeof(struct msdos_dir_entry));
-+    dir->entries += 2;
-   }
- 
-   infile = open(filename, O_RDONLY, 0);
-@@ -1611,13 +1599,13 @@ static int add_file(char *filename, stru
-     return -1;
-   }
- 
--  printf("ADD %s\n", filename);
-+  printf("ADD FILE %s\n", filename);
- 
-   /* Grab the basename of the file */
-   base = basename(filename);
-   
--  /* Extract out the 8.3 name */
--  copy_filename(base, name83, ext83);
-+  /* convert for dos fat structure  */
-+  copy_filename(base, dos_name);
- 
-   /* Make an extended name slot */
- 
-@@ -1629,12 +1617,9 @@ static int add_file(char *filename, stru
-   
-   slot->alias_checksum = 0;
-   
--  for(i = 0; i < 8; i++) 
--    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + name83[i];
-+  for(i = 0; i < MSDOS_NAME; i++)
-+    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + dos_name[i];
-   
--  for(i = 0; i < 3; i++) 
--    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + ext83[i];
--
-   p = base;
- 
-   copy_name(slot->name0_4, 10, &p);
-@@ -1645,8 +1630,7 @@ static int add_file(char *filename, stru
-   /* Get the entry from the root filesytem */
-   entry = &dir->table[dir->count++];
- 
--  strncpy(entry->name, name83, 8);
--  strncpy(entry->ext, ext83, 3);
-+  strncpy(entry->name, dos_name, MSDOS_NAME);
- 
- 
-   /* If the user has it read only, then add read only to the incoming
-@@ -1665,7 +1649,7 @@ static int add_file(char *filename, stru
- 				      ((ctime->tm_mon+1) << 5) +
- 				      ((ctime->tm_year-80) << 9)));
- 
--  entry->ctime_ms = 0;
-+  entry->ctime_cs = 0;
-   entry->ctime = entry->time;
-   entry->cdate = entry->date;
-   entry->adate = entry->date;
-@@ -1711,6 +1695,7 @@ static int add_file(char *filename, stru
- 
-  exit_add:
-   if (infile) close(infile);
-+  return 0;
- }
- 
- /* Add a new directory to the specified directory entry, and in turn populate 
-@@ -1727,10 +1712,18 @@ static void add_directory(char *filename
-   struct dirent *dentry = 0;
-   int remain;
-   char *data;
-+  char *base;
-+  char dos_name[MSDOS_NAME+1];
-+  struct msdos_dir_slot *slot;
-+  int i;
-+  char *p;
- 
-   /* If the directory doesn't exist */
--  if (!rddir) return;
--  
-+  if (!rddir) {
-+    printf("Error - dir does not exist: %s\n", filename);
-+    return;
-+  }
-+
-   if (dir->root) {
-     if (dir->count == dir->entries) {
-       printf("Error - too many directory entries\n");
-@@ -1738,28 +1731,58 @@ static void add_directory(char *filename
-     }
-   }
-   else {
--    if (dir->count == dir->entries) {
--      if (!dir->table) 
--	dir->table = (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
--      else {
--	dir->table = (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) * 
--							sizeof(struct msdos_dir_entry));
--
--	/* Zero it out to avoid issues */
--	memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
--      }
--	dir->entries++;
-+    /* 2 entries, one extra for long name of the directory */
-+    if (!dir->table)
-+      dir->table = (struct msdos_dir_entry *) malloc(2 * sizeof(struct msdos_dir_entry));
-+    else
-+      dir->table = (struct msdos_dir_entry *) realloc(dir->table, 2 * (dir->entries + 1) *
-+                                                             sizeof(struct msdos_dir_entry));
-+    if (!dir->table) {
-+      printf("Error - memory allocation failed\n");
-+      goto exit_add_dir;
-     }
-+    /* Zero it out to avoid issues */
-+    memset(&dir->table[dir->entries], 0, 2 * sizeof(struct msdos_dir_entry));
-+    dir->entries += 2;
-   }
- 
-+  printf("ADD DIR %s\n", filename);
-   /* Now, create a new directory entry for the new directory */
-   newdir = (struct dir_entry *) calloc(1, sizeof(struct dir_entry));
--  if (!newdir) goto exit_add_dir;
-+  if (!newdir) {
-+    printf("Error - calloc failed\n");
-+    goto exit_add_dir;
-+  }
-+
-+  /* Grab the basename of the file */
-+  base = basename(filename);
-+
-+  /* convert for dos structure  */
-+  copy_filename(base, dos_name);
-+
-+  /* Make an extended name slot */
-+  slot = (struct msdos_dir_slot *) &dir->table[dir->count++];
-+  slot->id = 'A';
-+  slot->attr = 0x0F;
-+  slot->reserved = 0;
-+  slot->start = 0;
-+
-+  slot->alias_checksum = 0;
- 
-+  for (i = 0; i < MSDOS_NAME; i++)
-+    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + dos_name[i];
-+
-+  p = base;
-+
-+  copy_name(slot->name0_4, 10, &p);
-+  copy_name(slot->name5_10, 12, &p);
-+  copy_name(slot->name11_12, 4, &p);
-+
-+  /* Get the entry from the root filesytem */
-   entry = &dir->table[dir->count++];
- 
--  strncpy(entry->name, basename(filename), sizeof(entry->name));
--  
-+  strncpy(entry->name, dos_name, MSDOS_NAME);
-+
-   entry->attr = ATTR_DIR;
-   ctime = localtime(&create_time);
- 
-@@ -1770,25 +1793,32 @@ static void add_directory(char *filename
- 				      ((ctime->tm_mon+1) << 5) +
- 				      ((ctime->tm_year-80) << 9)));
- 
--  entry->ctime_ms = 0;
-+  entry->ctime_cs = 0;
-   entry->ctime = entry->time;
-   entry->cdate = entry->date;
-   entry->adate = entry->date;
- 
-   /* Now, read the directory */
- 
--  while((dentry = readdir(rddir))) {
-+
-+  while((base[0] != '.') && (dentry = readdir(rddir))) {
-     struct stat st;
-     char *buffer;
--    
--    if (!strcmp(dentry->d_name, ".") || !strcmp(dentry->d_name, ".."))
--      continue;
- 
--    /* DOS wouldn't like a typical unix . (dot) file, so we skip those too */
--    if (dentry->d_name[0] == '.') continue;
-+    if (dentry->d_name[0] == '.') {
-+        /* dos also has . & .. directory entries */
-+      if (! ((!strcmp(dentry->d_name, ".")) || (!strcmp(dentry->d_name, "..")))) {
-+        /* ignore other .* files */
-+        printf("Error - File/Dir name is not dos compatible, ignored: %s\n", dentry->d_name);
-+        continue;
-+      }
-+    }
- 
-     buffer = malloc(strlen(filename) + strlen(dentry->d_name) + 3);
--    if (!buffer) continue;
-+    if (!buffer) {
-+        printf("Error - malloc failed\n");
-+        goto exit_add_dir;
-+    }
-     
-     sprintf(buffer, "%s/%s", filename, dentry->d_name);
-     if (!stat(buffer, &st)) {
-@@ -1806,11 +1836,23 @@ static void add_directory(char *filename
-   /* Now that the entire directory has been written, go ahead and write the directory
-      entry as well */
- 
-+  entry->size = 0; /* a directory has zero size */
-+
-+  if (base[0] == '.')  { /* . & .. point to parent's cluster */
-+    goto exit_add_dir;
-+  }
-+
-   entry->start = CT_LE_W(last_cluster_written);
-   entry->starthi = CT_LE_W((last_cluster_written & 0xFFFF0000) >> 16); 
--  entry->size = newdir->count * sizeof(struct msdos_dir_entry);
-+
-+/* . dir start points to parent */
-+  newdir->table[1].start = entry->start;
-+/* .. dir points to parent of parent*/
-+/* .. dir start is not set yet, would need more changes to the code,
-+ * but dosfsck can fix these .. entry start pointers correctly */
-+
-+  remain = newdir->count * sizeof(struct msdos_dir_entry);
-   
--  remain = entry->size;
-   data = (char *) newdir->table;
- 
-   while(remain) {
-@@ -1858,6 +1900,7 @@ static void add_root_directory(char *dir
- 
-   if (!newdir) {
-     closedir(dir);
-+    printf("Error - calloc failed!\n");
-     return;
-   }
- 
-@@ -1877,7 +1920,10 @@ static void add_root_directory(char *dir
-     if (entry->d_name[0] == '.') continue;
-  
-     buffer = malloc(strlen(dirname) + strlen(entry->d_name) + 3);
--    if (!buffer) continue;
-+    if (!buffer) {
-+        printf("Error - malloc failed!\n");
-+        continue;
-+    }
- 
-     sprintf(buffer, "%s/%s", dirname, entry->d_name);
-     if (!stat(buffer, &st)) {
-@@ -2245,6 +2291,9 @@ main (int argc, char **argv)
-   if (check && listfile)	/* Auto and specified bad block handling are mutually */
-     die ("-c and -l are incompatible");		/* exclusive of each other! */
- 
-+  if (dirname && (size_fat == 32))
-+    die ("-d is incompatible with FAT32");
-+
-   if (!create) {
-     check_mount (device_name);	/* Is the device already mounted? */
-     dev = open (device_name, O_RDWR);	/* Is it a suitable device to build the FS on? */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch
deleted file mode 100644
index ab5c8cf..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-mkdsofs is using types of the style __u8, which it gets with some
-versions of libc headers via linux/hdreg.h including asm/types.h.
-Newer version of fedora (at least) have a hdreg.h whichdoes not
-include asm/types.h. To work around this patch mkdosfs.c to explicity
-include linux/types.h which will in turn pull in asm/types.h which
-defines these variables.
-
-Upstream-Status: Inappropriate [licensing]
-We're tracking an old release of dosfstools due to licensing issues.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
---- dosfstools-2.10/mkdosfs/mkdosfs.c~	2006-07-12 18:46:21.000000000 +1000
-+++ dosfstools-2.10/mkdosfs/mkdosfs.c	2006-07-12 18:46:21.000000000 +1000
-@@ -60,6 +60,7 @@
- #include "../version.h"
- 
- #include <fcntl.h>
-+#include <linux/types.h>
- #include <linux/hdreg.h>
- #include <linux/fs.h>
- #include <linux/fd.h>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
deleted file mode 100644
index ae21bee..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
+++ /dev/null
@@ -1,241 +0,0 @@
-Add option to read in bootcode from a file.
-
-Upstream-Status: Inappropriate [licensing]
-We're tracking an old release of dosfstools due to licensing issues.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
-Index: dosfstools-2.11/mkdosfs/ChangeLog
-===================================================================
---- dosfstools-2.11.orig/mkdosfs/ChangeLog	1997-06-18 10:09:38.000000000 +0000
-+++ dosfstools-2.11/mkdosfs/ChangeLog	2011-12-06 12:14:23.634011558 +0000
-@@ -1,3 +1,14 @@
-+19th June 2003			Sam Bingner (sam@bingner.com)
-+
-+	Added option to read in bootcode from a file so that if you have
-+	for example Windows 2000 boot code, you can have it write that
-+	as the bootcode.  This is a dump of the behinning of a partition
-+	generally 512 bytes, but can be up to reserved sectors*512 bytes.
-+        Also writes 0x80 as the	BIOS drive number if we are formatting a
-+	hard drive, and sets the number of hidden sectors to be the
-+	number of sectors in one track. These were required so that DOS
-+	could boot using the bootcode.
-+
- 28th January 1995		H. Peter Anvin (hpa@yggdrasil.com)
- 
- 	Better algorithm to select cluster sizes on large filesystems.
-Index: dosfstools-2.11/mkdosfs/mkdosfs.8
-===================================================================
---- dosfstools-2.11.orig/mkdosfs/mkdosfs.8	2004-02-25 19:36:07.000000000 +0000
-+++ dosfstools-2.11/mkdosfs/mkdosfs.8	2011-12-06 12:19:54.777888434 +0000
-@@ -44,6 +44,10 @@
- .I message-file
- ]
- [
-+.B \-B
-+.I bootcode-file
-+]
-+[
- .B \-n
- .I volume-name
- ]
-@@ -165,6 +169,18 @@
- carriage return-line feed combinations, and tabs have been expanded.
- If the filename is a hyphen (-), the text is taken from standard input. 
- .TP
-+.BI \-B " bootcode-file"
-+Uses boot machine code from file "file".  On any thing other than FAT32,
-+this only writes the first 3 bytes, and 480 bytes from offset 3Eh.  On
-+FAT32, this writes the first 3 bytes, 420 bytes from offset 5Ah to both
-+primary and backup boot sectors.  Also writes all other reserved sectors
-+excluding the sectors following boot sectors (usually sector 2 and 7).
-+Does not require that the input file be as large as reserved_sectors*512.
-+To make a FAT32 partition bootable, you will need at least the first
-+13 sectors (6656 bytes).  You can also specify a partition as the argument
-+to clone the boot code from that partition.
-+i.e mkdosfs -B /dev/sda1 /dev/sda1
-+.TP
- .BI \-n " volume-name"
- Sets the volume name (label) of the filesystem.  The volume name can
- be up to 11 characters long.  The default is no label.
-@@ -198,8 +214,9 @@
- simply will not support it ;)
- .SH AUTHOR
- Dave Hudson - <dave@humbug.demon.co.uk>; modified by Peter Anvin
--<hpa@yggdrasil.com>. Fixes and additions by Roman Hodek
--<roman@hodek.net> for Debian/GNU Linux.
-+<hpa@yggdrasil.com> and Sam Bingner <sam@bingner.com>. Fixes and
-+additions by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
-+for Debian/GNU Linux.
- .SH ACKNOWLEDGEMENTS
- .B mkdosfs
- is based on code from
-Index: dosfstools-2.11/mkdosfs/mkdosfs.c
-===================================================================
---- dosfstools-2.11.orig/mkdosfs/mkdosfs.c	2005-03-12 16:12:16.000000000 +0000
-+++ dosfstools-2.11/mkdosfs/mkdosfs.c	2011-12-06 12:27:55.121886076 +0000
-@@ -24,6 +24,12 @@
-    - New options -A, -S, -C
-    - Support for filesystems > 2GB
-    - FAT32 support
-+
-+   Fixes/additions June 2003 by Sam Bingner
-+   <sam@bingner.com>:
-+   - Add -B option to read in bootcode from a file
-+   - Write BIOS drive number so that FS can properly boot
-+   - Set number of hidden sectors before boot code to be one track
-    
-    Copying:     Copyright 1993, 1994 David Hudson (dave@humbug.demon.co.uk)
- 
-@@ -153,6 +159,8 @@
- #define FAT_BAD      0x0ffffff7
- 
- #define MSDOS_EXT_SIGN 0x29	/* extended boot sector signature */
-+#define HD_DRIVE_NUMBER 0x80	/* Boot off first hard drive */
-+#define FD_DRIVE_NUMBER 0x00	/* Boot off first floppy drive */
- #define MSDOS_FAT12_SIGN "FAT12   "	/* FAT12 filesystem signature */
- #define MSDOS_FAT16_SIGN "FAT16   "	/* FAT16 filesystem signature */
- #define MSDOS_FAT32_SIGN "FAT32   "	/* FAT32 filesystem signature */
-@@ -175,6 +183,8 @@
- #define BOOTCODE_SIZE		448
- #define BOOTCODE_FAT32_SIZE	420
- 
-+#define MAX_RESERVED		0xFFFF
-+
- /* __attribute__ ((packed)) is used on all structures to make gcc ignore any
-  * alignments */
- 
-@@ -202,7 +212,7 @@
-   __u16         fat_length;	/* sectors/FAT */
-   __u16         secs_track;	/* sectors per track */
-   __u16         heads;		/* number of heads */
--  __u32         hidden;		/* hidden sectors (unused) */
-+  __u32         hidden;		/* hidden sectors (one track) */
-   __u32         total_sect;	/* number of sectors (if sectors == 0) */
-   union {
-     struct {
-@@ -285,6 +295,8 @@
- 
- /* Global variables - the root of all evil :-) - see these and weep! */
- 
-+static char *template_boot_code;	/* Variable to store a full template boot sector in */
-+static int use_template = 0;
- static char *program_name = "mkdosfs";	/* Name of the program */
- static char *device_name = NULL;	/* Name of the device on which to create the filesystem */
- static int atari_format = 0;	/* Use Atari variation of MS-DOS FS format */
-@@ -837,6 +849,12 @@
-     vi->volume_id[2] = (unsigned char) ((volume_id & 0x00ff0000) >> 16);
-     vi->volume_id[3] = (unsigned char) (volume_id >> 24);
-   }
-+  if (bs.media == 0xf8) {
-+      vi->drive_number = HD_DRIVE_NUMBER;  /* Set bios drive number to 80h */
-+  }
-+  else {
-+      vi->drive_number = FD_DRIVE_NUMBER;  /* Set bios drive number to 00h */
-+  }
- 
-   if (!atari_format) {
-     memcpy(vi->volume_label, volume_name, 11);
-@@ -1362,6 +1380,32 @@
-    * dir area on FAT12/16, and the first cluster on FAT32. */
-   writebuf( (char *) root_dir, size_root_dir, "root directory" );
- 
-+  if (use_template == 1) {
-+    /* dupe template into reserved sectors */
-+    seekto( 0, "Start of partition" );
-+    if (size_fat == 32) {
-+      writebuf( template_boot_code, 3, "backup jmpBoot" );
-+      seekto( 0x5a, "sector 1 boot area" );
-+      writebuf( template_boot_code+0x5a, 420, "sector 1 boot area" );
-+      seekto( 512*2, "third sector" );
-+      if (backup_boot != 0) {
-+        writebuf( template_boot_code+512*2, backup_boot*sector_size - 512*2, "data to backup boot" );
-+        seekto( backup_boot*sector_size, "backup boot sector" );
-+        writebuf( template_boot_code, 3, "backup jmpBoot" );
-+        seekto( backup_boot*sector_size+0x5a, "backup boot sector boot area" );
-+        writebuf( template_boot_code+0x5a, 420, "backup boot sector boot area" );
-+        seekto( (backup_boot+2)*sector_size, "sector following backup code" );
-+        writebuf( template_boot_code+(backup_boot+2)*sector_size, (reserved_sectors-backup_boot-2)*512, "remaining data" );
-+      } else {
-+        writebuf( template_boot_code+512*2, (reserved_sectors-2)*512, "remaining data" );
-+      }
-+    } else {
-+      writebuf( template_boot_code, 3, "jmpBoot" );
-+      seekto( 0x3e, "sector 1 boot area" );
-+      writebuf( template_boot_code+0x3e, 448, "boot code" );
-+    }
-+  }
-+
-   if (blank_sector) free( blank_sector );
-   if (info_sector) free( info_sector );
-   free (root_dir);   /* Free up the root directory space from setup_tables */
-@@ -1376,7 +1420,7 @@
- {
-   fatal_error("\
- Usage: mkdosfs [-A] [-c] [-C] [-v] [-I] [-l bad-block-file] [-b backup-boot-sector]\n\
--       [-m boot-msg-file] [-n volume-name] [-i volume-id]\n\
-+       [-m boot-msg-file] [-n volume-name] [-i volume-id] [-B bootcode]\n\
-        [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\
-        [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
-        /dev/name [blocks]\n");
-@@ -1439,7 +1483,7 @@
-   printf ("%s " VERSION " (" VERSION_DATE ")\n",
- 	   program_name);
- 
--  while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:h:v")) != EOF)
-+  while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
-     /* Scan the command line for options */
-     switch (c)
-       {
-@@ -1509,6 +1553,51 @@
- 	listfile = optarg;
- 	break;
- 
-+      case 'B':         /* B : read in bootcode */
-+        if ( strcmp(optarg, "-") )
-+	  {
-+	    msgfile = fopen(optarg, "r");
-+	    if ( !msgfile )
-+	      perror(optarg);
-+	  }
-+	else
-+	  msgfile = stdin;
-+
-+	if ( msgfile )
-+	  {
-+            if (!(template_boot_code = malloc( MAX_RESERVED )))
-+                die( "Out of memory" );
-+	    /* The template boot sector including reserved must not be > 65535 */
-+            use_template = 1;
-+	    i = 0;
-+	    do
-+	      {
-+		ch = getc(msgfile);
-+		switch (ch)
-+		  {
-+		  case EOF:
-+		    break;
-+
-+		  default:
-+		    template_boot_code[i++] = ch; /* Store character */
-+		    break;
-+		  }
-+	      }
-+	    while ( ch != EOF && i < MAX_RESERVED );
-+	    ch = getc(msgfile); /* find out if we're at EOF */
-+
-+	    /* Fill up with zeros */
-+	    while( i < MAX_RESERVED )
-+		template_boot_code[i++] = '\0';
-+	    
-+	    if ( ch != EOF )
-+	      printf ("Warning: template too long; truncated after %d bytes\n", i);
-+	    
-+	    if ( msgfile != stdin )
-+	      fclose(msgfile);
-+	  }
-+	break;
-+
-       case 'm':		/* m : Set boot message */
- 	if ( strcmp(optarg, "-") )
- 	  {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
deleted file mode 100644
index 3ba4711..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
+++ /dev/null
@@ -1,639 +0,0 @@
-Add -d <directory> support to populate the image.
-
-Upstream-Status: Inappropriate [licensing]
-We're tracking an old release of dosfstools due to licensing issues.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
-Index: dosfstools-2.11/mkdosfs/mkdosfs.c
-===================================================================
---- dosfstools-2.11.orig/mkdosfs/mkdosfs.c	2011-12-06 12:27:55.000000000 +0000
-+++ dosfstools-2.11/mkdosfs/mkdosfs.c	2011-12-06 12:37:13.445950703 +0000
-@@ -18,6 +18,10 @@
-    as a rule), and not the block.  For example the boot block does not
-    occupy a full cluster.
- 
-+   June 2004 - Jordan Crouse (info.linux@amd.com)
-+   Added -d <directory> support to populate the image
-+   Copyright (C) 2004, Advanced Micro Devices, All Rights Reserved
-+   
-    Fixes/additions May 1998 by Roman Hodek
-    <Roman.Hodek@informatik.uni-erlangen.de>:
-    - Atari format support
-@@ -71,6 +75,8 @@
- #include <unistd.h>
- #include <time.h>
- #include <errno.h>
-+#include <libgen.h>
-+#include <dirent.h>
- 
- #include <linux/version.h>
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-@@ -110,6 +116,8 @@
-  * sufficient (or even better :) for 64 bit offsets in the meantime */
- #define llseek lseek
- 
-+#define ROUND_UP(value, divisor) (value + (divisor - (value % divisor))) / divisor
-+
- /* Constant definitions */
- 
- #define TRUE 1			/* Boolean constants */
-@@ -149,7 +157,6 @@
- #define ATTR_VOLUME  8		/* volume label */
- #define ATTR_DIR     16		/* directory */
- #define ATTR_ARCH    32		/* archived */
--
- #define ATTR_NONE    0		/* no attribute bits */
- #define ATTR_UNUSED  (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
- 	/* attribute bits that are copied "as is" */
-@@ -245,6 +252,19 @@
-   __u32		reserved2[4];
- };
- 
-+/* This stores up to 13 chars of the name */
-+
-+struct msdos_dir_slot {
-+        __u8    id;             /* sequence number for slot */
-+        __u8    name0_4[10];    /* first 5 characters in name */
-+        __u8    attr;           /* attribute byte */
-+        __u8    reserved;       /* always 0 */
-+        __u8    alias_checksum; /* checksum for 8.3 alias */
-+        __u8    name5_10[12];   /* 6 more characters in name */
-+        __u16   start;          /* starting cluster number, 0 in long slots */
-+        __u8    name11_12[4];   /* last 2 characters in name */
-+};
-+
- struct msdos_dir_entry
-   {
-     char	name[8], ext[3];	/* name and extension */
-@@ -293,6 +313,15 @@
- 
- #define MESSAGE_OFFSET 29	/* Offset of message in above code */
- 
-+/* Special structure to keep track of directories as we add them for the -d option */
-+
-+struct dir_entry {
-+  int root;                       /* Specifies if this is the root dir or not */
-+  int count;                      /* Number of items in the table */
-+  int entries;                    /* Number of entries in the table */
-+  struct msdos_dir_entry *table;  /* Pointer to the entry table */
-+};
-+
- /* Global variables - the root of all evil :-) - see these and weep! */
- 
- static char *template_boot_code;	/* Variable to store a full template boot sector in */
-@@ -326,6 +355,9 @@
- static int size_root_dir;	/* Size of the root directory in bytes */
- static int sectors_per_cluster = 0;	/* Number of sectors per disk cluster */
- static int root_dir_entries = 0;	/* Number of root directory entries */
-+static int root_dir_num_entries = 0;
-+static int last_cluster_written = 0;
-+
- static char *blank_sector;		/* Blank sector - all zeros */
- static int hidden_sectors = 0;		/* Number of hidden sectors */
- 
-@@ -399,7 +431,6 @@
-   }
- }
- 
--
- /* Mark a specified sector as having a particular value in it's FAT entry */
- 
- static void
-@@ -1266,6 +1297,9 @@
-       die ("unable to allocate space for root directory in memory");
-     }
- 
-+
-+  last_cluster_written = 2;
-+  
-   memset(root_dir, 0, size_root_dir);
-   if ( memcmp(volume_name, "           ", 11) )
-     {
-@@ -1314,11 +1348,11 @@
-   }
-   
-   if (!(blank_sector = malloc( sector_size )))
--      die( "Out of memory" );
-+    die( "Out of memory" );
-+  
-   memset(blank_sector, 0, sector_size);
- }
--
--
-+  
- /* Write the new filesystem's data tables to wherever they're going to end up! */
- 
- #define error(str)				\
-@@ -1340,7 +1374,7 @@
-   do {							\
-     int __size = (size);				\
-     if (write (dev, buf, __size) != __size)		\
--	error ("failed whilst writing " errstr);	\
-+       error ("failed whilst writing " errstr);	\
-   } while(0)
- 
- 
-@@ -1412,6 +1446,452 @@
-   free (fat);  /* Free up the fat table space reserved during setup_tables */
- }
- 
-+/* Add a file to the specified directory entry, and also write it into the image */
-+
-+static void copy_filename(char *filename, char *base, char *ext) {
-+  
-+  char *ch = filename;
-+  int i, len;
-+
-+  memset(base, 0x20, 8);
-+  memset(ext, 0x20, 3);
-+  
-+  for(len = 0 ; *ch && *ch != '.'; ch++) {
-+    base[len++] = toupper(*ch);
-+    if (len == 8) break;
-+  }
-+  
-+  for ( ; *ch && *ch != '.'; ch++);
-+  if (*ch) ch++;
-+  
-+  for(len = 0 ; *ch; ch++) {
-+    ext[len++] = toupper(*ch);
-+    if (len == 3) break;
-+  }
-+}
-+
-+/* Check for an .attrib.<filename> file, and read the attributes therein */
-+
-+/* We are going to be pretty pedantic about this.  The file needs 3
-+   bytes at the beginning, the attributes are listed in this order:
-+   
-+   (H)idden|(S)ystem|(A)rchived
-+   
-+   A capital HSA means to enable it, anything else will disable it
-+   (I recommend a '-') The unix user attributes will still be used 
-+   for write access.
-+
-+   For example, to enable system file access for ldlinux.sys, write 
-+   the following to .attrib.ldlinux.sys: -S-
-+*/
-+
-+unsigned char check_attrib_file(char *dir, char *filename) {
-+
-+  char attrib[4] = { '-', '-', '-' };
-+  unsigned char *buffer = 0;
-+  int ret = ATTR_NONE;
-+  int fd = -1;
-+
-+  buffer = (char *) calloc(1, strlen(dir) + strlen(filename) + 10);
-+  if (!buffer) return ATTR_NONE;
-+
-+  sprintf(buffer, "%s/.attrib.%s", dir, filename);
-+
-+  if (access(buffer, R_OK)) 
-+    goto exit_attrib;
-+
-+  if ((fd = open(buffer, O_RDONLY, 0)) < 0)
-+    goto exit_attrib;
-+
-+  if (read(fd, attrib, 3) < 0)
-+    goto exit_attrib;
-+  
-+  if (attrib[0] == 'H') ret |= ATTR_HIDDEN;
-+  if (attrib[1] == 'S') ret |= ATTR_SYS;
-+  if (attrib[2] == 'A') ret |= ATTR_ARCH;
-+
-+  printf("%s: Setting atrribute %x\n", filename, ret);
-+
-+ exit_attrib:
-+  if (fd >= 0) close(fd);
-+  if (buffer) free(buffer);
-+
-+  return ret;
-+}
-+
-+static void copy_name(char *buffer, int size, char **pointer) {
-+  int i;
-+
-+  for(i = 0; i < size; i += 2) {
-+    if (*pointer) {
-+      buffer[i] = **pointer;
-+      buffer[i + 1] = 0x00;
-+      *pointer = **pointer ? *pointer + 1 : 0;
-+    }
-+    else {
-+      buffer[i] = 0xFF;
-+      buffer[i + 1] = 0xFF;
-+    }
-+  }  
-+}
-+
-+static int add_file(char *filename, struct dir_entry *dir, unsigned char attr) 
-+{
-+  struct stat stat;
-+  struct msdos_dir_entry *entry;
-+  int infile = 0;
-+  int sectors, clusters;
-+  struct tm *ctime;
-+  int c, s;
-+  int ptr;
-+  char *buffer, *base;
-+  int start;
-+  int usedsec, totalsec;
-+
-+  char name83[8], ext83[3];
-+
-+  struct msdos_dir_slot *slot;
-+  int i;
-+  char *p;
-+
-+  /* The root directory is static, everything else grows as needed */
-+
-+  if (dir->root) {
-+    if (dir->count == dir->entries) {
-+      printf("Error - too many directory entries\n");
-+    }
-+  }
-+  else {
-+    if (dir->count == dir->entries) {
-+      if (!dir->table) 
-+	dir->table = 
-+	  (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
-+      else {
-+	dir->table = 
-+	  (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) * 
-+					     sizeof(struct msdos_dir_entry));
-+
-+	memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
-+      }
-+
-+      dir->entries++;
-+    }
-+  }
-+
-+  infile = open(filename, O_RDONLY, 0);
-+  if (!infile) return;
-+  
-+  if (fstat(infile, &stat))
-+    goto exit_add;
-+ 
-+  if (S_ISCHR(stat.st_mode) ||S_ISBLK(stat.st_mode) ||
-+      S_ISFIFO(stat.st_mode) || S_ISLNK(stat.st_mode)) {
-+    printf("Error - cannot create a special file in a FATFS\n");
-+    goto exit_add;
-+  }
-+
-+  /* FIXME: This isn't very pretty */
-+
-+  usedsec = start_data_sector + (size_root_dir / sector_size) +
-+    (last_cluster_written * bs.cluster_size);
-+
-+  totalsec = blocks * BLOCK_SIZE / sector_size;
-+  
-+  /* Figure out how many sectors / clustors the file requires */
-+
-+  sectors = ROUND_UP(stat.st_size, sector_size);
-+  clusters = ROUND_UP(sectors, (int) bs.cluster_size);
-+
-+  if (usedsec + sectors > totalsec) {
-+    printf("Error - %s is too big (%d vs %d)\n", filename, sectors, totalsec - usedsec);
-+    close(infile);
-+    return -1;
-+  }
-+
-+  printf("ADD %s\n", filename);
-+
-+  /* Grab the basename of the file */
-+  base = basename(filename);
-+  
-+  /* Extract out the 8.3 name */
-+  copy_filename(base, name83, ext83);
-+
-+  /* Make an extended name slot */
-+
-+  slot = (struct msdos_dir_slot *) &dir->table[dir->count++];
-+  slot->id = 'A';  
-+  slot->attr = 0x0F;
-+  slot->reserved = 0;
-+  slot->start = 0;
-+  
-+  slot->alias_checksum = 0;
-+  
-+  for(i = 0; i < 8; i++) 
-+    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + name83[i];
-+  
-+  for(i = 0; i < 3; i++) 
-+    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + ext83[i];
-+
-+  p = base;
-+
-+  copy_name(slot->name0_4, 10, &p);
-+  copy_name(slot->name5_10, 12, &p);
-+  copy_name(slot->name11_12, 4, &p);
-+
-+
-+  /* Get the entry from the root filesytem */
-+  entry = &dir->table[dir->count++];
-+
-+  strncpy(entry->name, name83, 8);
-+  strncpy(entry->ext, ext83, 3);
-+
-+
-+  /* If the user has it read only, then add read only to the incoming
-+     attribute settings */
-+
-+  if (!(stat.st_mode & S_IWUSR)) attr |= ATTR_RO;
-+  entry->attr = attr;
-+
-+  /* Set the access time on the file */
-+  ctime = localtime(&create_time);
-+
-+  entry->time = CT_LE_W((unsigned short)((ctime->tm_sec >> 1) +
-+					  (ctime->tm_min << 5) + (ctime->tm_hour << 11)));
-+
-+  entry->date = CT_LE_W((unsigned short)(ctime->tm_mday +
-+				      ((ctime->tm_mon+1) << 5) +
-+				      ((ctime->tm_year-80) << 9)));
-+
-+  entry->ctime_ms = 0;
-+  entry->ctime = entry->time;
-+  entry->cdate = entry->date;
-+  entry->adate = entry->date;
-+  entry->size = stat.st_size;
-+
-+  start = last_cluster_written;
-+
-+  entry->start = CT_LE_W(start);  /* start sector */
-+  entry->starthi = CT_LE_W((start & 0xFFFF0000) >> 16); /* High start sector (for FAT32) */
-+
-+  /* We mark all of the clusters we use in the FAT */
-+  
-+  for(c = 0; c < clusters; c++ ) {
-+    int free;
-+    int next = c == (clusters - 1) ? FAT_EOF : start + c + 1;
-+    mark_FAT_cluster(start + c, next);  
-+    last_cluster_written++;
-+  }
-+  
-+  /* This confused me too - cluster 2 starts after the
-+     root directory data - search me as to why */
-+
-+  ptr = (start_data_sector * sector_size) + size_root_dir;
-+  ptr += (start - 2) * bs.cluster_size * sector_size;
-+    
-+  buffer = (char *) malloc(sector_size);
-+
-+  if (!buffer) {
-+    printf("Error - couldn't allocate memory\n");
-+    goto exit_add;
-+  }
-+
-+  /* Write the file into the file block */
-+
-+  seekto(ptr, "datafile");
-+
-+  while(1) {
-+    int size = read(infile, buffer, sector_size);    
-+    if (size <= 0) break;
-+    
-+    writebuf(buffer, size, "data");    
-+  }
-+
-+ exit_add:
-+  if (infile) close(infile);
-+}
-+
-+/* Add a new directory to the specified directory entry, and in turn populate 
-+   it with its own files */
-+
-+/* FIXME:  This should check to make sure there is enough size to add itself */
-+
-+static void add_directory(char *filename, struct dir_entry *dir) {
-+
-+  struct dir_entry *newdir = 0;
-+  struct msdos_dir_entry *entry;
-+  struct tm *ctime;
-+  DIR *rddir = opendir(filename);
-+  struct dirent *dentry = 0;
-+  int remain;
-+  char *data;
-+
-+  /* If the directory doesn't exist */
-+  if (!rddir) return;
-+  
-+  if (dir->root) {
-+    if (dir->count == dir->entries) {
-+      printf("Error - too many directory entries\n");
-+      goto exit_add_dir;
-+    }
-+  }
-+  else {
-+    if (dir->count == dir->entries) {
-+      if (!dir->table) 
-+	dir->table = (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
-+      else {
-+	dir->table = (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) * 
-+							sizeof(struct msdos_dir_entry));
-+
-+	/* Zero it out to avoid issues */
-+	memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
-+      }
-+	dir->entries++;
-+    }
-+  }
-+
-+  /* Now, create a new directory entry for the new directory */
-+  newdir = (struct dir_entry *) calloc(1, sizeof(struct dir_entry));
-+  if (!newdir) goto exit_add_dir;
-+
-+  entry = &dir->table[dir->count++];
-+
-+  strncpy(entry->name, basename(filename), sizeof(entry->name));
-+  
-+  entry->attr = ATTR_DIR;
-+  ctime = localtime(&create_time);
-+
-+  entry->time = CT_LE_W((unsigned short)((ctime->tm_sec >> 1) +
-+					  (ctime->tm_min << 5) + (ctime->tm_hour << 11)));
-+
-+  entry->date = CT_LE_W((unsigned short)(ctime->tm_mday +
-+				      ((ctime->tm_mon+1) << 5) +
-+				      ((ctime->tm_year-80) << 9)));
-+
-+  entry->ctime_ms = 0;
-+  entry->ctime = entry->time;
-+  entry->cdate = entry->date;
-+  entry->adate = entry->date;
-+
-+  /* Now, read the directory */
-+
-+  while((dentry = readdir(rddir))) {
-+    struct stat st;
-+    char *buffer;
-+    
-+    if (!strcmp(dentry->d_name, ".") || !strcmp(dentry->d_name, ".."))
-+      continue;
-+
-+    /* DOS wouldn't like a typical unix . (dot) file, so we skip those too */
-+    if (dentry->d_name[0] == '.') continue;
-+
-+    buffer = malloc(strlen(filename) + strlen(dentry->d_name) + 3);
-+    if (!buffer) continue;
-+    
-+    sprintf(buffer, "%s/%s", filename, dentry->d_name);
-+    if (!stat(buffer, &st)) {
-+      if (S_ISDIR(st.st_mode)) 
-+	add_directory(buffer, newdir);
-+      else if (S_ISREG(st.st_mode)) {
-+	unsigned char attrib = check_attrib_file(filename, dentry->d_name);
-+	add_file(buffer, newdir, attrib);
-+      }
-+    }
-+ 
-+    free(buffer);
-+  }
-+  
-+  /* Now that the entire directory has been written, go ahead and write the directory
-+     entry as well */
-+
-+  entry->start = CT_LE_W(last_cluster_written);
-+  entry->starthi = CT_LE_W((last_cluster_written & 0xFFFF0000) >> 16); 
-+  entry->size = newdir->count * sizeof(struct msdos_dir_entry);
-+  
-+  remain = entry->size;
-+  data = (char *) newdir->table;
-+
-+  while(remain) {
-+    int size = 
-+      remain > bs.cluster_size * sector_size ? bs.cluster_size * sector_size : remain;
-+
-+    int pos = (start_data_sector * sector_size) + size_root_dir;
-+    pos += (last_cluster_written - 2) * bs.cluster_size * sector_size;
-+    
-+    seekto(pos, "add_dir");
-+    writebuf(data, size, "add_dir");
-+    
-+    remain -= size;
-+    data += size;
-+
-+    mark_FAT_cluster(last_cluster_written, remain ? last_cluster_written + 1 : FAT_EOF);      
-+    last_cluster_written++;
-+  }
-+  
-+ exit_add_dir:
-+  if (rddir) closedir(rddir);
-+  if (newdir->table) free(newdir->table);
-+  if (newdir) free(newdir);
-+}  
-+  
-+/* Given a directory, add all the files and directories to the root directory of the
-+   image.  
-+*/
-+
-+static void add_root_directory(char *dirname) 
-+{
-+  DIR *dir = opendir(dirname);
-+  struct dirent *entry = 0;
-+  struct dir_entry *newdir = 0;
-+
-+  if (!dir) {
-+    printf("Error - directory %s does not exist\n", dirname);
-+    return;
-+  }
-+ 
-+  /* Create the root directory structure - this is a bit different then
-+     above, because the table already exists, we just refer to it. */
-+
-+  newdir = (struct dir_entry *) calloc(1,sizeof(struct dir_entry));
-+
-+  if (!newdir) {
-+    closedir(dir);
-+    return;
-+  }
-+
-+  newdir->entries = root_dir_entries;
-+  newdir->root = 1;
-+  newdir->count = 0;
-+  newdir->table = root_dir;
-+
-+  while((entry = readdir(dir))) {
-+    struct stat st;
-+    char *buffer;
-+    
-+    if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."))
-+      continue;
-+    
-+    /* DOS wouldn't like a typical unix . (dot) file, so we skip those too */
-+    if (entry->d_name[0] == '.') continue;
-+ 
-+    buffer = malloc(strlen(dirname) + strlen(entry->d_name) + 3);
-+    if (!buffer) continue;
-+
-+    sprintf(buffer, "%s/%s", dirname, entry->d_name);
-+    if (!stat(buffer, &st)) {
-+      if (S_ISDIR(st.st_mode)) 
-+	add_directory(buffer, newdir);
-+      else if (S_ISREG(st.st_mode)) {
-+	unsigned char attrib = check_attrib_file(dirname, entry->d_name);
-+	add_file(buffer, newdir, attrib);
-+      }
-+    }
-+
-+    free(buffer);
-+  }
-+
-+  closedir(dir);
-+  if (newdir) free(newdir);
-+}
- 
- /* Report the command usage and return a failure error code */
- 
-@@ -1423,7 +1903,7 @@
-        [-m boot-msg-file] [-n volume-name] [-i volume-id] [-B bootcode]\n\
-        [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\
-        [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
--       /dev/name [blocks]\n");
-+       [-d directory] /dev/name [blocks]\n");
- }
- 
- /*
-@@ -1463,6 +1943,8 @@
-   int c;
-   char *tmp;
-   char *listfile = NULL;
-+  char *dirname = NULL;
-+
-   FILE *msgfile;
-   struct stat statbuf;
-   int i = 0, pos, ch;
-@@ -1483,7 +1965,7 @@
-   printf ("%s " VERSION " (" VERSION_DATE ")\n",
- 	   program_name);
- 
--  while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
-+  while ((c = getopt (argc, argv, "AbcCd:f:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
-     /* Scan the command line for options */
-     switch (c)
-       {
-@@ -1508,6 +1990,10 @@
- 	create = TRUE;
- 	break;
- 
-+  case 'd':
-+	dirname = optarg;
-+	break;
-+
-       case 'f':		/* f : Choose number of FATs */
- 	nr_fats = (int) strtol (optarg, &tmp, 0);
- 	if (*tmp || nr_fats < 1 || nr_fats > 4)
-@@ -1811,8 +2297,10 @@
-   else if (listfile)
-     get_list_blocks (listfile);
- 
--  write_tables ();		/* Write the file system tables away! */
- 
-+  if (dirname) add_root_directory(dirname);
-+
-+  write_tables ();		/* Write the file system tables away! */  
-   exit (0);			/* Terminate with no errors! */
- }
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch
deleted file mode 100644
index 11e8a75..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Fix a compilation error due to undefined MSDOS_FAT12.
-
-Upstream-Status: Inappropriate [licensing]
-We're tracking an old release of dosfstools due to licensing issues.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
---- dosfstools-2.10/dosfsck/boot.c.orig	2004-10-15 08:51:42.394725176 -0600
-+++ dosfstools-2.10/dosfsck/boot.c	2004-10-15 08:49:16.776862456 -0600
-@@ -14,6 +14,9 @@
- #include "io.h"
- #include "boot.h"
- 
-+#ifndef MSDOS_FAT12
-+#define MSDOS_FAT12 4084
-+#endif
- 
- #define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0)
-     /* don't divide by zero */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch
deleted file mode 100644
index 848a76b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-FAT32 appears to be broken when used with the -d option to populate the msdos
-image. This disables the FAT32 autoselection code which means we don't get
-broken images with the -d option. It can still be enabled on the commandline
-at the users own risk. This changes us back to the 2.10 version's behaviour
-which was known to work well even with large images.
-
-Upstream-Status: Inappropriate [depends on other patches we apply]
-
-RP 2011/12/13
-
-Index: dosfstools-2.11/mkdosfs/mkdosfs.c
-===================================================================
---- dosfstools-2.11.orig/mkdosfs/mkdosfs.c	2011-12-13 13:54:37.538509391 +0000
-+++ dosfstools-2.11/mkdosfs/mkdosfs.c	2011-12-13 13:55:10.258508631 +0000
-@@ -808,10 +808,12 @@
-       bs.media = (char) 0xf8; /* Set up the media descriptor for a hard drive */
-       bs.dir_entries[0] = (char) 0;	/* Default to 512 entries */
-       bs.dir_entries[1] = (char) 2;
-+/*
-       if (!size_fat && blocks*SECTORS_PER_BLOCK > 1064960) {
- 	  if (verbose) printf("Auto-selecting FAT32 for large filesystem\n");
- 	  size_fat = 32;
-       }
-+*/
-       if (size_fat == 32) {
- 	  /* For FAT32, try to do the same as M$'s format command:
- 	   * fs size < 256M: 0.5k clusters
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
deleted file mode 100644
index 176504d..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-# dosfstools OE build file
-# Copyright (C) 2004-2006, Advanced Micro Devices, Inc.  All Rights Reserved
-# Released under the MIT license (see packages/COPYING)
-SUMMARY = "DOS FAT Filesystem Utilities"
-HOMEPAGE = "https://github.com/dosfstools/dosfstools"
-
-SECTION = "base"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://mkdosfs/COPYING;md5=cbe67f08d6883bff587f615f0cc81aa8"
-PR = "r5"
-
-SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.src.tar.gz/407d405ade410f7597d364ab5dc8c9f6/${BP}.src.tar.gz \
-           file://mkdosfs-bootcode.patch \
-           file://mkdosfs-dir.patch \
-           file://alignment_hack.patch \
-           file://msdos_fat12_undefined.patch \
-           file://dosfstools-msdos_fs-types.patch \
-           file://include-linux-types.patch \
-           file://nofat32_autoselect.patch \
-           file://fix_populated_dosfs_creation.patch \
-           file://0001-Include-fcntl.h-for-getting-loff_t-definition.patch \
-"
-
-SRC_URI[md5sum] = "407d405ade410f7597d364ab5dc8c9f6"
-SRC_URI[sha256sum] = "0eac6d12388b3d9ed78684529c1b0d9346fa2abbe406c4d4a3eb5a023c98a484"
-
-CFLAGS += "-D_GNU_SOURCE ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', '', d)}"
-
-EXTRA_OEMAKE = "CC='${CC}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
-
-do_install () {
-	oe_runmake "PREFIX=${D}" "SBINDIR=${D}${base_sbindir}" \
-		   "MANDIR=${D}${mandir}/man8" install
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_4.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_4.0.bb
deleted file mode 100644
index e7b1f61..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_4.0.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-# dosfstools OE build file
-# Copyright (C) 2004-2006, Advanced Micro Devices, Inc.  All Rights Reserved
-# Copyright (C) 2015, Sören Brinkmann <soeren.brinkmann@gmail>  All Rights Reserved
-# Released under the MIT license (see packages/COPYING)
-SUMMARY = "DOS FAT Filesystem Utilities"
-HOMEPAGE = "https://github.com/dosfstools/dosfstools"
-
-SECTION = "base"
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-SRC_URI = "https://github.com/dosfstools/dosfstools/releases/download/v${PV}/${BP}.tar.xz \
-          "
-SRC_URI[md5sum] = "20f8388b99702f276c973d228c7cff45"
-SRC_URI[sha256sum] = "9037738953559d1efe04fc5408b6846216cc0138f7f9d32de80b6ec3c35e7daf"
-
-UPSTREAM_CHECK_URI = "https://github.com/dosfstools/dosfstools/releases"
-
-inherit autotools pkgconfig
-
-EXTRA_OECONF = "--without-udev --enable-compat-symlinks"
-
-CFLAGS += "-D_GNU_SOURCE ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', '', d)}"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
new file mode 100644
index 0000000..69aa81a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
@@ -0,0 +1,25 @@
+# dosfstools OE build file
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc.  All Rights Reserved
+# Copyright (C) 2015, Sören Brinkmann <soeren.brinkmann@gmail>  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+SUMMARY = "DOS FAT Filesystem Utilities"
+HOMEPAGE = "https://github.com/dosfstools/dosfstools"
+
+SECTION = "base"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "https://github.com/dosfstools/dosfstools/releases/download/v${PV}/${BP}.tar.xz \
+          "
+SRC_URI[md5sum] = "07a1050db1a898e9a2e03b0c4569c4bd"
+SRC_URI[sha256sum] = "e6b2aca70ccc3fe3687365009dd94a2e18e82b688ed4e260e04b7412471cc173"
+
+UPSTREAM_CHECK_URI = "https://github.com/dosfstools/dosfstools/releases"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--without-udev --enable-compat-symlinks"
+
+CFLAGS += "-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg.inc b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg.inc
index e8d8a9b..fe4732d 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg.inc
@@ -4,43 +4,39 @@
 
 DEPENDS = "zlib bzip2 perl ncurses"
 DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
-RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
-RDEPENDS_${PN}_class-native = "xz-native"
+RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} perl"
+RDEPENDS_${PN}_class-native = ""
 
 UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/dpkg/"
 
-inherit autotools gettext perlnative pkgconfig systemd
+inherit autotools gettext perlnative pkgconfig systemd perl-version
 
 python () {
     if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
-        pn = d.getVar('PN', True)
+        pn = d.getVar('PN')
         d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service')
 }
 
 export PERL = "${bindir}/perl"
 PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
 
-export PERL_LIBDIR = "${libdir}/perl"
-PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
+export PERL_LIBDIR = "${libdir}/perl/${@get_perl_version(d)}"
+PERL_LIBDIR_class-native = "${libdir}/perl-native/perl/${@get_perl_version(d)}"
 
 EXTRA_OECONF = "\
 		--disable-dselect \
 		--enable-start-stop-daemon \
-		--with-zlib \
-		--with-bz2 \
-		--without-liblzma \
-		--without-selinux \
+		--with-libz \
+		--with-libbz2 \
+		--without-libselinux \
 		"
 
+PACKAGECONFIG = "liblzma"
+PACKAGECONFIG[liblzma] = "--with-liblzma,--without-liblzma, xz"
+
 EXTRA_OECONF += "TAR=tar"
 EXTRA_OECONF_append_class-target = " DEB_HOST_ARCH=${DPKG_ARCH}"
 
-do_configure () {
-    echo >> ${S}/m4/compiler.m4
-    sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure
-    autotools_do_configure
-}
-
 do_install_append () {
 	if [ "${PN}" = "dpkg-native" ]; then
 		# update-alternatives doesn't have an offline mode
@@ -71,7 +67,26 @@
 RPROVIDES_update-alternatives-dpkg += "update-alternatives"
 
 PACKAGES += "${PN}-perl"
-FILES_${PN}-perl = "${libdir}/perl"
+FILES_${PN}-perl = "${libdir}/perl/${@get_perl_version(d)}"
+
+RDEPENDS_${PN}-perl += "perl-module-carp perl-module-constant \
+                        perl-module-cwd perl-module-digest \
+                        perl-module-digest-md5 perl-module-errno \
+                        perl-module-exporter perl-module-fcntl \
+                        perl-module-feature perl-module-file-basename \
+                        perl-module-file-compare perl-module-file-copy \
+                        perl-module-file-find perl-module-file-path \
+                        perl-module-file-spec perl-module-file-temp \
+                        perl-module-list-util perl-module-overload \
+                        perl-module-parent perl-module-storable \
+                        perl-module-filehandle perl-module-io \
+                        perl-module-io-handle perl-module-io-seekable \
+                        perl-module-posix perl-module-scalar-util \
+                        perl-module-selectsaver perl-module-symbol \
+                        perl-module-term-ansicolor perl-module-tie-handle \
+                        perl-module-tie-hash perl-module-storable \
+                        perl-module-time-hires perl-module-time-piece \
+                        perl-module-xsloader"
 
 # Split out start-stop-daemon to its own package.  Note that it
 # is installed in a different directory than the one used for
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
index 80504ce..93d8704 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
@@ -9,27 +9,32 @@
 
 RP 2011/12/07
 ALIMON 2016/05/26
-
+ALIMON 2017/02/21
 ---
- src/script.c | 39 +++------------------------------------
- 1 file changed, 3 insertions(+), 36 deletions(-)
+ src/script.c | 44 +++-----------------------------------------
+ 1 file changed, 3 insertions(+), 41 deletions(-)
 
 diff --git a/src/script.c b/src/script.c
-index 3c88be8..ce66a86 100644
+index 2f252ae..768a9d1 100644
 --- a/src/script.c
 +++ b/src/script.c
-@@ -97,43 +97,10 @@ setexecute(const char *path, struct stat *stab)
+@@ -97,48 +97,10 @@ setexecute(const char *path, struct stat *stab)
  static const char *
  maintscript_pre_exec(struct command *cmd)
  {
 -	const char *admindir = dpkg_db_get_dir();
--	const char *changedir = fc_script_chrootless ? instdir : "/";
--	size_t instdirl = strlen(instdir);
+-	const char *changedir;
+-	size_t instdirlen = strlen(instdir);
 -
--	if (*instdir && !fc_script_chrootless) {
--		if (strncmp(admindir, instdir, instdirl) != 0)
+-	if (instdirlen > 0 && fc_script_chrootless)
+-		changedir = instdir;
+-	else
+-		changedir = "/";
+-
+-	if (instdirlen > 0 && !fc_script_chrootless) {
+-		if (strncmp(admindir, instdir, instdirlen) != 0)
 -			ohshit(_("admindir must be inside instdir for dpkg to work properly"));
--		if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0)
+-		if (setenv("DPKG_ADMINDIR", admindir + instdirlen, 1) < 0)
 -			ohshite(_("unable to setenv for subprocesses"));
 -		if (setenv("DPKG_ROOT", "", 1) < 0)
 -			ohshite(_("unable to setenv for subprocesses"));
@@ -56,11 +61,11 @@
 -		      args.buf);
 -		varbuf_destroy(&args);
 -	}
--	if (!instdirl || fc_script_chrootless)
+-	if (instdirlen == 0 || fc_script_chrootless)
 -		return cmd->filename;
 -
--	assert(strlen(cmd->filename) >= instdirl);
--	return cmd->filename + instdirl;
+-	assert(strlen(cmd->filename) >= instdirlen);
+-	return cmd->filename + instdirlen;
 +	return cmd->filename;
  }
  
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0007-dpkg-deb-build.c-Remove-usage-of-clamp-mtime-in-tar.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0007-dpkg-deb-build.c-Remove-usage-of-clamp-mtime-in-tar.patch
new file mode 100644
index 0000000..8bfaad1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0007-dpkg-deb-build.c-Remove-usage-of-clamp-mtime-in-tar.patch
@@ -0,0 +1,40 @@
+From 8659eeeeda74d71e12080121f0b13a88cbdda433 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Tue, 21 Feb 2017 11:23:27 -0600
+Subject: [PATCH] dpkg-deb/build.c: Remove usage of --clamp-mtime in tar
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recently dpkg added --clamp-mtime to tar to create reproducible
+build tarballs [1].
+
+But host tools doesn't support this option because is new on tar
+so disable in our builds.
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+Upstream-Status: Inappropriate [Configuration]
+
+[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759999#20
+[2] https://lists.gnu.org/archive/html/help-tar/2016-01/msg00000.html
+---
+ dpkg-deb/build.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
+index 655aa55..927f56f 100644
+--- a/dpkg-deb/build.c
++++ b/dpkg-deb/build.c
+@@ -447,7 +447,7 @@ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
+     snprintf(mtime, sizeof(mtime), "@%ld", timestamp);
+ 
+     execlp(TAR, "tar", "-cf", "-", "--format=gnu",
+-                       "--mtime", mtime, "--clamp-mtime",
++                       "--mtime", mtime,
+                        "--null", "--no-unquote",
+                        "--no-recursion", "-T", "-", NULL);
+     ohshite(_("unable to execute %s (%s)"), "tar -cf", TAR);
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.10.bb b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.10.bb
new file mode 100644
index 0000000..21385af
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.10.bb
@@ -0,0 +1,20 @@
+require dpkg.inc
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20160731T221931Z/pool/main/d/${BPN}/${BPN}_${PV}.tar.xz \
+           file://noman.patch \
+           file://remove-tar-no-timestamp.patch \
+           file://arch_pm.patch \
+           file://dpkg-configure.service \
+           file://add_armeb_triplet_entry.patch \
+           file://0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch \
+           file://0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch \
+           file://0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch \
+           file://0005-dpkg-compiler.m4-remove-Wvla.patch \
+           file://0006-add-musleabi-to-known-target-tripets.patch \
+           file://0007-dpkg-deb-build.c-Remove-usage-of-clamp-mtime-in-tar.patch \
+           "
+SRC_URI_append_class-native = " file://glibc2.5-sync_file_range.patch "
+
+SRC_URI[md5sum] = "ccff17730c0964428fc186ded2f2f401"
+SRC_URI[sha256sum] = "025524da41ba18b183ff11e388eb8686f7cc58ee835ed7d48bd159c46a8b6dc5"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb
deleted file mode 100644
index 28fdc13..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-require dpkg.inc
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-
-SRC_URI = "http://snapshot.debian.org/archive/debian/20160509T100042Z/pool/main/d/${BPN}/${BPN}_${PV}.tar.xz \
-           file://noman.patch \
-           file://remove-tar-no-timestamp.patch \
-           file://arch_pm.patch \
-           file://dpkg-configure.service \
-           file://add_armeb_triplet_entry.patch \
-           file://0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch \
-           file://0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch \
-           file://0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch \
-           file://0005-dpkg-compiler.m4-remove-Wvla.patch \
-           file://0006-add-musleabi-to-known-target-tripets.patch \
-           "
-SRC_URI_append_class-native = " file://glibc2.5-sync_file_range.patch "
-
-SRC_URI[md5sum] = "073dbf2129a54b0fc627464bf8af4a1b"
-SRC_URI[sha256sum] = "ace36d3a6dc750a42baf797f9e75ec580a21f92bb9ff96b482100755d6d9b87b"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc
index 74e92f6..81d90a1 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc
@@ -17,7 +17,7 @@
                       file://lib/et/et_name.c;beginline=1;endline=11;md5=ead236447dac7b980dbc5b4804d8c836 \
                       file://lib/ss/ss.h;beginline=1;endline=20;md5=6e89ad47da6e75fecd2b5e0e81e1d4a6"
 SECTION = "base"
-DEPENDS = "util-linux"
+DEPENDS = "util-linux attr"
 
 SRC_URI = "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git"
 S = "${WORKDIR}/git"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch
index 44f3888..1d17520 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch
@@ -1,4 +1,4 @@
-From b9bb77a0dd712f06b262a12766972b99cd801269 Mon Sep 17 00:00:00 2001
+From bf9f3b6d5b10d19218b4ed904c12b22e36ec57dd Mon Sep 17 00:00:00 2001
 From: Theodore Ts'o <tytso@mit.edu>
 Date: Thu, 16 Feb 2017 22:02:35 -0500
 Subject: [PATCH] e2fsck: exit with exit status 0 if no errors were fixed
@@ -13,15 +13,12 @@
 
 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
 Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
-
-Conflicts:
-	e2fsck/e2fsck.conf.5.in
 ---
- e2fsck/e2fsck.conf.5.in                     | 34 +++++++++++++++++++++++++++++
+ e2fsck/e2fsck.conf.5.in                     |  7 +++++++
  e2fsck/journal.c                            |  1 +
- e2fsck/problem.c                            |  8 ++++---
+ e2fsck/problem.c                            |  8 +++++---
  e2fsck/problemP.h                           |  1 +
- e2fsck/unix.c                               | 20 +++++++++++++----
+ e2fsck/unix.c                               | 20 ++++++++++++++++----
  tests/f_collapse_extent_tree/expect.1       |  2 +-
  tests/f_compress_extent_tree_level/expect.1 |  2 +-
  tests/f_convert_bmap/expect.1               |  2 +-
@@ -33,16 +30,16 @@
  tests/f_orphan_extents_inode/expect.1       |  2 +-
  tests/f_rehash_dir/expect.1                 |  2 +-
  tests/f_unsorted_EAs/expect.1               |  2 +-
- 16 files changed, 68 insertions(+), 18 deletions(-)
+ 16 files changed, 41 insertions(+), 18 deletions(-)
 
 diff --git a/e2fsck/e2fsck.conf.5.in b/e2fsck/e2fsck.conf.5.in
-index 1f80a04..6a205ce 100644
+index 1848bdb..0bfc76a 100644
 --- a/e2fsck/e2fsck.conf.5.in
 +++ b/e2fsck/e2fsck.conf.5.in
-@@ -326,6 +326,40 @@ defaults to true.
- This relation controls whether or not the scratch file directory is used
- instead of an in-memory data structure when tracking inode counts.  It
- defaults to true.
+@@ -303,6 +303,13 @@ of 'should this problem be fixed?'.  The
+ option even overrides the
+ .B -y
+ option given on the command-line (just for the specific problem, of course).
 +.TP
 +.I not_a_fix
 +This boolean option, it set to true, marks the problem as
@@ -50,38 +47,11 @@
 +it does not mean that the file system had a problem which has since
 +been fixed.  This is used for requests to optimize the file system's
 +data structure, such as pruning an extent tree.
-+@TDB_MAN_COMMENT@.SH THE [scratch_files] STANZA
-+@TDB_MAN_COMMENT@The following relations are defined in the
-+@TDB_MAN_COMMENT@.I [scratch_files]
-+@TDB_MAN_COMMENT@stanza.
-+@TDB_MAN_COMMENT@.TP
-+@TDB_MAN_COMMENT@.I directory
-+@TDB_MAN_COMMENT@If the directory named by this relation exists and is
-+@TDB_MAN_COMMENT@writeable, then e2fsck will attempt to use this
-+@TDB_MAN_COMMENT@directory to store scratch files instead of using
-+@TDB_MAN_COMMENT@in-memory data structures.
-+@TDB_MAN_COMMENT@.TP
-+@TDB_MAN_COMMENT@.I numdirs_threshold
-+@TDB_MAN_COMMENT@If this relation is set, then in-memory data structures
-+@TDB_MAN_COMMENT@be used if the number of directories in the filesystem
-+@TDB_MAN_COMMENT@are fewer than amount specified.
-+@TDB_MAN_COMMENT@.TP
-+@TDB_MAN_COMMENT@.I dirinfo
-+@TDB_MAN_COMMENT@This relation controls whether or not the scratch file
-+@TDB_MAN_COMMENT@directory is used instead of an in-memory data
-+@TDB_MAN_COMMENT@structure for directory information.  It defaults to
-+@TDB_MAN_COMMENT@true.
-+@TDB_MAN_COMMENT@.TP
-+@TDB_MAN_COMMENT@.I icount
-+@TDB_MAN_COMMENT@This relation controls whether or not the scratch file
-+@TDB_MAN_COMMENT@directory is used instead of an in-memory data
-+@TDB_MAN_COMMENT@structure when tracking inode counts.  It defaults to
-+@TDB_MAN_COMMENT@true.
- .SH LOGGING
- E2fsck has the facility to save the information from an e2fsck run in a
- directory so that a system administrator can review its output at their
+ @TDB_MAN_COMMENT@.SH THE [scratch_files] STANZA
+ @TDB_MAN_COMMENT@The following relations are defined in the
+ @TDB_MAN_COMMENT@.I [scratch_files]
 diff --git a/e2fsck/journal.c b/e2fsck/journal.c
-index c8ac57d..b4cf329 100644
+index 46fe7b4..c4f58f1 100644
 --- a/e2fsck/journal.c
 +++ b/e2fsck/journal.c
 @@ -572,6 +572,7 @@ static void clear_v2_journal_fields(journal_t *journal)
@@ -93,10 +63,10 @@
  	       ctx->fs->blocksize-V1_SB_SIZE);
  	mark_buffer_dirty(journal->j_sb_buffer);
 diff --git a/e2fsck/problem.c b/e2fsck/problem.c
-index 1e645e4..2b01ffc 100644
+index 34a671e..4b25069 100644
 --- a/e2fsck/problem.c
 +++ b/e2fsck/problem.c
-@@ -1261,12 +1261,12 @@ static struct e2fsck_problem problem_table[] = {
+@@ -1276,12 +1276,12 @@ static struct e2fsck_problem problem_table[] = {
  	/* Inode extent tree could be shorter */
  	{ PR_1E_CAN_COLLAPSE_EXTENT_TREE,
  	  N_("@i %i @x tree (at level %b) could be shorter.  "),
@@ -111,7 +81,7 @@
  
  	/* Pass 2 errors */
  
-@@ -2146,6 +2146,7 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
+@@ -2166,6 +2166,7 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
  		reconfigure_bool(ctx, ptr, key, PR_NO_NOMSG, "no_nomsg");
  		reconfigure_bool(ctx, ptr, key, PR_PREEN_NOHDR, "preen_noheader");
  		reconfigure_bool(ctx, ptr, key, PR_FORCE_NO, "force_no");
@@ -119,7 +89,7 @@
  		profile_get_integer(ctx->profile, "options",
  				    "max_count_problems", 0, 0,
  				    &ptr->max_count);
-@@ -2263,7 +2264,8 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
+@@ -2283,7 +2284,8 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
  	if (ptr->flags & PR_AFTER_CODE)
  		answer = fix_problem(ctx, ptr->second_code, pctx);
  
@@ -139,10 +109,10 @@
  #define PR_FORCE_NO	0x100000 /* Force the answer to be no */
 +#define PR_NOT_A_FIX	0x200000 /* Yes doesn't mean a problem was fixed */
 diff --git a/e2fsck/unix.c b/e2fsck/unix.c
-index 004a6e5..d33d7fd 100644
+index eb9f311..9e4d31a 100644
 --- a/e2fsck/unix.c
 +++ b/e2fsck/unix.c
-@@ -1896,11 +1896,23 @@ no_journal:
+@@ -1901,11 +1901,23 @@ no_journal:
  		fix_problem(ctx, PR_6_IO_FLUSH, &pctx);
  
  	if (was_changed) {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch
index e66cd4d..38fb07e 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch
@@ -20,20 +20,17 @@
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in
-index 78fe50a..6f1940e 100644
+index 812f7c7..0280398 100644
 --- a/misc/mke2fs.conf.in
 +++ b/misc/mke2fs.conf.in
 @@ -11,8 +11,9 @@
  		features = has_journal
  	}
  	ext4 = {
--		features = has_journal,extent,huge_file,flex_bg,64bit,dir_nlink,extra_isize
+-		features = has_journal,extent,huge_file,flex_bg,uninit_bg,64bit,dir_nlink,extra_isize
 +		features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
  		inode_size = 256
 +		auto_64-bit_support = 1
  	}
  	ext4dev = {
- 		features = has_journal,extent,huge_file,flex_bg,inline_data,64bit,dir_nlink,extra_isize
--- 
-2.8.1
-
+ 		features = has_journal,extent,huge_file,flex_bg,uninit_bg,inline_data,64bit,dir_nlink,extra_isize
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-1.43-sysmacros.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-1.43-sysmacros.patch
new file mode 100644
index 0000000..abbf2ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-1.43-sysmacros.patch
@@ -0,0 +1,130 @@
+From 30ef41f68703b6a16027cc8787118b87f1462dff Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 28 Mar 2016 20:31:33 -0400
+Subject: [PATCH e2fsprogs] include sys/sysmacros.h as needed
+
+The minor/major/makedev macros are not entirely standard.  glibc has had
+the definitions in sys/sysmacros.h since the start, and wants to move away
+from always defining them implicitly via sys/types.h (as this pollutes the
+namespace in violation of POSIX).  Other C libraries have already dropped
+them.  Since the configure script already checks for this header, use that
+to pull in the header in files that use these macros.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Taken from gentoo portage.
+
+Upstream-Status: Pending
+
+---
+ debugfs/debugfs.c      | 3 +++
+ lib/blkid/devname.c    | 3 +++
+ lib/blkid/devno.c      | 3 +++
+ lib/ext2fs/finddev.c   | 3 +++
+ lib/ext2fs/ismounted.c | 3 +++
+ misc/create_inode.c    | 4 ++++
+ misc/mk_hugefiles.c    | 3 +++
+ 7 files changed, 22 insertions(+)
+
+diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
+index ba8be40..7d481bc 100644
+--- a/debugfs/debugfs.c
++++ b/debugfs/debugfs.c
+@@ -26,6 +26,9 @@ extern char *optarg;
+ #include <errno.h>
+ #endif
+ #include <fcntl.h>
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+ 
+ #include "debugfs.h"
+ #include "uuid/uuid.h"
+diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c
+index 3e2efa9..671e781 100644
+--- a/lib/blkid/devname.c
++++ b/lib/blkid/devname.c
+@@ -36,6 +36,9 @@
+ #if HAVE_SYS_MKDEV_H
+ #include <sys/mkdev.h>
+ #endif
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+ #include <time.h>
+ 
+ #include "blkidP.h"
+diff --git a/lib/blkid/devno.c b/lib/blkid/devno.c
+index 479d977..61e6fc7 100644
+--- a/lib/blkid/devno.c
++++ b/lib/blkid/devno.c
+@@ -31,6 +31,9 @@
+ #if HAVE_SYS_MKDEV_H
+ #include <sys/mkdev.h>
+ #endif
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+ 
+ #include "blkidP.h"
+ 
+diff --git a/lib/ext2fs/finddev.c b/lib/ext2fs/finddev.c
+index 311608d..62fa0db 100644
+--- a/lib/ext2fs/finddev.c
++++ b/lib/ext2fs/finddev.c
+@@ -31,6 +31,9 @@
+ #if HAVE_SYS_MKDEV_H
+ #include <sys/mkdev.h>
+ #endif
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+ 
+ #include "ext2_fs.h"
+ #include "ext2fs.h"
+diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c
+index e0f69dd..7404996 100644
+--- a/lib/ext2fs/ismounted.c
++++ b/lib/ext2fs/ismounted.c
+@@ -49,6 +49,9 @@
+ #if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+ 
+ #include "ext2_fs.h"
+ #include "ext2fs.h"
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index 4dbd8e5..98aeb41 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -22,6 +22,10 @@
+ #include <attr/xattr.h>
+ #endif
+ #include <sys/ioctl.h>
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
++
+ #include <ext2fs/ext2fs.h>
+ #include <ext2fs/ext2_types.h>
+ #include <ext2fs/fiemap.h>
+diff --git a/misc/mk_hugefiles.c b/misc/mk_hugefiles.c
+index 71a15c5..00e95cd 100644
+--- a/misc/mk_hugefiles.c
++++ b/misc/mk_hugefiles.c
+@@ -35,6 +35,9 @@ extern int optind;
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
+ #include <libgen.h>
+ #include <limits.h>
+ #include <blkid/blkid.h>
+-- 
+2.8.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch
index ef1ce58..879d936 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch
@@ -1,5 +1,5 @@
 diff --git a/tests/Makefile.in b/tests/Makefile.in
-index 60cf655..ce220f1 100644
+index c130f4a..d2ade03 100644
 --- a/tests/Makefile.in
 +++ b/tests/Makefile.in
 @@ -18,7 +18,7 @@ test_one: $(srcdir)/test_one.in Makefile mke2fs.conf
@@ -7,21 +7,21 @@
  	@echo "HTREE=y" >> test_one
  	@echo "QUOTA=y" >> test_one
 -	@echo "SRCDIR=@srcdir@" >> test_one
-+	@echo "SRCDIR=/usr/lib/e2fsprogs/ptest/test" >> test_one
++	@echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_one
  	@echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one
+ 	@echo "SIZEOF_TIME_T=@SIZEOF_TIME_T@" >> test_one
  	@cat $(srcdir)/test_one.in >> test_one
- 	@chmod +x test_one
-@@ -26,7 +26,7 @@ test_one: $(srcdir)/test_one.in Makefile mke2fs.conf
+@@ -27,7 +27,7 @@ test_one: $(srcdir)/test_one.in Makefile mke2fs.conf
  test_script: test_one test_script.in Makefile mke2fs.conf
  	@echo "Creating test_script..."
  	@echo "#!/bin/sh" > test_script
 -	@echo "SRCDIR=@srcdir@" >> test_script
-+	@echo "SRCDIR=/usr/lib/e2fsprogs/ptest/test" >> test_script
++	@echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_script
  	@cat $(srcdir)/test_script.in >> test_script
  	@chmod +x test_script
  
 diff --git a/tests/test_config b/tests/test_config
-index 7f39157..c815a44 100644
+index 547ef4c..e11e6f4 100644
 --- a/tests/test_config
 +++ b/tests/test_config
 @@ -3,24 +3,24 @@
@@ -65,3 +65,16 @@
  CLEAN_OUTPUT="sed -f $cmd_dir/filter.sed"
  LD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss:${LD_LIBRARY_PATH}
  DYLD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss:${DYLD_LIBRARY_PATH}
+diff --git a/tests/test_script.in b/tests/test_script.in
+index 9959e30..442999d 100644
+--- a/tests/test_script.in
++++ b/tests/test_script.in
+@@ -39,7 +39,7 @@ for i; do
+ done
+ 
+ if test "$TESTS"x = x ; then
+-    if test -n "DO_FAILED"; then
++    if test -n "$DO_FAILED"; then
+ 	exit 0
+     fi
+     TESTS=`ls -d $SRCDIR/[a-zA-Z]_*`
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest
index 1ac2513..e02fc7f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest
@@ -5,7 +5,7 @@
 if [ $? -eq 0 ]
 then
 	echo "PASS: e2fsprogs"
-	rm test.log
+	rm ../test.log
 else
 	echo "FAIL: e2fsprogs"
 fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.4.bb
new file mode 100644
index 0000000..5216c70
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.4.bb
@@ -0,0 +1,112 @@
+require e2fsprogs.inc
+
+SRC_URI += "file://acinclude.m4 \
+            file://remove.ldconfig.call.patch \
+            file://quiet-debugfs.patch \
+            file://run-ptest \
+            file://ptest.patch \
+            file://mkdir.patch \
+            file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \
+            file://e2fsprogs-1.43-sysmacros.patch \
+            file://mkdir_p.patch \
+            file://0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch \
+"
+
+SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch"
+
+SRCREV = "3d66c4b20f09f923078c1e6eb9b549865b549674"
+UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+(\.\d+)*)$"
+
+EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} \
+                --enable-elf-shlibs --disable-libuuid --disable-uuidd \
+                --disable-libblkid --enable-verbose-makecmds"
+
+EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[fuse] = '--enable-fuse2fs,--disable-fuse2fs,fuse'
+
+do_configure_prepend () {
+	cp ${WORKDIR}/acinclude.m4 ${S}/
+}
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install
+	oe_runmake 'DESTDIR=${D}' install-libs
+	# We use blkid from util-linux now so remove from here
+	rm -f ${D}${base_libdir}/libblkid*
+	rm -rf ${D}${includedir}/blkid
+	rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
+	rm -f ${D}${base_sbindir}/blkid
+	rm -f ${D}${base_sbindir}/fsck
+	rm -f ${D}${base_sbindir}/findfs
+
+	# e2initrd_helper and the pkgconfig files belong in libdir
+	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+		install -d ${D}${libdir}
+		mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
+		mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
+	fi
+
+	oe_multilib_header ext2fs/ext2_types.h
+	install -d ${D}${base_bindir}
+	mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs
+
+	install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/
+
+	# Clean host path (build directory) in compile_et, mk_cmds
+	sed -i -e "s,\(ET_DIR=.*\)${S}/lib/et\(.*\),\1${datadir}/et\2,g" ${D}${bindir}/compile_et
+	sed -i -e "s,\(SS_DIR=.*\)${S}/lib/ss\(.*\),\1${datadir}/ss\2,g" ${D}${bindir}/mk_cmds
+}
+
+# Need to find the right mke2fs.conf file
+e2fsprogs_conf_fixup () {
+	for i in mke2fs mkfs.ext2 mkfs.ext3 mkfs.ext4; do
+		create_wrapper ${D}${base_sbindir}/$i MKE2FS_CONFIG=${sysconfdir}/mke2fs.conf
+	done
+}
+
+do_install_append_class-native() {
+	e2fsprogs_conf_fixup
+}
+
+do_install_append_class-nativesdk() {
+	e2fsprogs_conf_fixup
+}
+
+RDEPENDS_e2fsprogs = "e2fsprogs-badblocks"
+RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck"
+
+PACKAGES =+ "e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-badblocks e2fsprogs-resize2fs"
+PACKAGES =+ "libcomerr libss libe2p libext2fs"
+
+FILES_e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*"
+FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*"
+FILES_e2fsprogs-mke2fs = "${base_sbindir}/mke2fs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf"
+FILES_e2fsprogs-tune2fs = "${base_sbindir}/tune2fs ${base_sbindir}/e2label"
+FILES_e2fsprogs-badblocks = "${base_sbindir}/badblocks"
+FILES_libcomerr = "${base_libdir}/libcom_err.so.*"
+FILES_libss = "${base_libdir}/libss.so.*"
+FILES_libe2p = "${base_libdir}/libe2p.so.*"
+FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*"
+FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so ${bindir}/compile_et ${bindir}/mk_cmds"
+
+ALTERNATIVE_${PN} = "chattr"
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr"
+ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs"
+
+ALTERNATIVE_${PN}-doc = "fsck.8"
+ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
+
+RDEPENDS_${PN}-ptest += "${PN} ${PN}-tune2fs coreutils procps bash"
+
+do_compile_ptest() {
+	oe_runmake -C ${B}/tests
+}
+
+do_install_ptest() {
+	cp -a ${B}/tests ${D}${PTEST_PATH}/test
+	cp -a ${S}/tests/* ${D}${PTEST_PATH}/test
+	sed -e 's!../e2fsck/e2fsck!e2fsck!g' -i ${D}${PTEST_PATH}/test/*/expect*
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb
deleted file mode 100644
index dcfb564..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb
+++ /dev/null
@@ -1,113 +0,0 @@
-require e2fsprogs.inc
-
-PR = "r1"
-
-SRC_URI += "file://acinclude.m4 \
-            file://remove.ldconfig.call.patch \
-            file://quiet-debugfs.patch \
-            file://run-ptest \
-            file://ptest.patch \
-            file://mkdir.patch \
-            file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \
-            file://mkdir_p.patch \
-            file://0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch \
-"
-
-SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch"
-
-SRCREV = "d6adf070b0e85f209c0d7f310188b134b5cb7180"
-UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+(\.\d+)*)$"
-
-EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} \
-                --enable-elf-shlibs --disable-libuuid --disable-uuidd \
-                --disable-libblkid --enable-verbose-makecmds"
-
-EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs"
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[fuse] = '--enable-fuse2fs,--disable-fuse2fs,fuse'
-
-do_configure_prepend () {
-	cp ${WORKDIR}/acinclude.m4 ${S}/
-}
-
-do_install () {
-	oe_runmake 'DESTDIR=${D}' install
-	oe_runmake 'DESTDIR=${D}' install-libs
-	# We use blkid from util-linux now so remove from here
-	rm -f ${D}${base_libdir}/libblkid*
-	rm -rf ${D}${includedir}/blkid
-	rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
-	rm -f ${D}${base_sbindir}/blkid
-	rm -f ${D}${base_sbindir}/fsck
-	rm -f ${D}${base_sbindir}/findfs
-
-	# e2initrd_helper and the pkgconfig files belong in libdir
-	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
-		install -d ${D}${libdir}
-		mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
-		mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
-	fi
-
-	oe_multilib_header ext2fs/ext2_types.h
-	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs
-
-	install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/
-
-	# Clean host path (build directory) in compile_et, mk_cmds
-	sed -i -e "s,\(ET_DIR=.*\)${S}/lib/et\(.*\),\1${datadir}/et\2,g" ${D}${bindir}/compile_et
-	sed -i -e "s,\(SS_DIR=.*\)${S}/lib/ss\(.*\),\1${datadir}/ss\2,g" ${D}${bindir}/mk_cmds
-}
-
-# Need to find the right mke2fs.conf file
-e2fsprogs_conf_fixup () {
-	for i in mke2fs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.ext4dev; do
-		create_wrapper ${D}${base_sbindir}/$i MKE2FS_CONFIG=${sysconfdir}/mke2fs.conf
-	done
-}
-
-do_install_append_class-native() {
-	e2fsprogs_conf_fixup
-}
-
-do_install_append_class-nativesdk() {
-	e2fsprogs_conf_fixup
-}
-
-RDEPENDS_e2fsprogs = "e2fsprogs-badblocks"
-RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck"
-
-PACKAGES =+ "e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-badblocks e2fsprogs-resize2fs"
-PACKAGES =+ "libcomerr libss libe2p libext2fs"
-
-FILES_e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*"
-FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*"
-FILES_e2fsprogs-mke2fs = "${base_sbindir}/mke2fs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf"
-FILES_e2fsprogs-tune2fs = "${base_sbindir}/tune2fs ${base_sbindir}/e2label"
-FILES_e2fsprogs-badblocks = "${base_sbindir}/badblocks"
-FILES_libcomerr = "${base_libdir}/libcom_err.so.*"
-FILES_libss = "${base_libdir}/libss.so.*"
-FILES_libe2p = "${base_libdir}/libe2p.so.*"
-FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*"
-FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so ${bindir}/compile_et ${bindir}/mk_cmds"
-
-ALTERNATIVE_${PN} = "chattr"
-ALTERNATIVE_PRIORITY = "100"
-ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr"
-ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs"
-
-ALTERNATIVE_${PN}-doc = "fsck.8"
-ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
-
-RDEPENDS_${PN}-ptest += "${PN} ${PN}-tune2fs coreutils procps bash"
-
-do_compile_ptest() {
-	oe_runmake -C ${B}/tests
-}
-
-do_install_ptest() {
-	cp -a ${B}/tests ${D}${PTEST_PATH}/test
-	cp -a ${S}/tests/* ${D}${PTEST_PATH}/test
-	sed -e 's!../e2fsck/e2fsck!e2fsck!g' -i ${D}${PTEST_PATH}/test/*/expect*
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff
deleted file mode 100644
index d4e4675..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff
+++ /dev/null
@@ -1,449 +0,0 @@
-Upstream-Status: Backport
-
-Index: elfutils-0.146/backends/arm_init.c
-===================================================================
---- elfutils-0.146.orig/backends/arm_init.c	2009-04-21 14:50:01.000000000 +0000
-+++ elfutils-0.146/backends/arm_init.c	2010-04-24 10:11:13.000000000 +0000
-@@ -32,21 +32,32 @@
- #define RELOC_PREFIX	R_ARM_
- #include "libebl_CPU.h"
- 
-+#include "libebl_arm.h"
-+
- /* This defines the common reloc hooks based on arm_reloc.def.  */
- #include "common-reloc.c"
- 
- 
- const char *
- arm_init (elf, machine, eh, ehlen)
--     Elf *elf __attribute__ ((unused));
-+     Elf *elf;
-      GElf_Half machine __attribute__ ((unused));
-      Ebl *eh;
-      size_t ehlen;
- {
-+  int soft_float = 0;
-+
-   /* Check whether the Elf_BH object has a sufficent size.  */
-   if (ehlen < sizeof (Ebl))
-     return NULL;
- 
-+  if (elf) {
-+    GElf_Ehdr ehdr_mem;
-+    GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
-+    if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT))
-+      soft_float = 1;
-+  }
-+
-   /* We handle it.  */
-   eh->name = "ARM";
-   arm_init_reloc (eh);
-@@ -58,7 +69,10 @@
-   HOOK (eh, core_note);
-   HOOK (eh, auxv_info);
-   HOOK (eh, check_object_attribute);
--  HOOK (eh, return_value_location);
-+  if (soft_float)
-+    eh->return_value_location = arm_return_value_location_soft;
-+  else
-+    eh->return_value_location = arm_return_value_location_hard;
- 
-   return MODVERSION;
- }
-Index: elfutils-0.146/backends/arm_regs.c
-===================================================================
---- elfutils-0.146.orig/backends/arm_regs.c	2009-04-21 14:50:01.000000000 +0000
-+++ elfutils-0.146/backends/arm_regs.c	2010-04-24 10:11:13.000000000 +0000
-@@ -28,6 +28,7 @@
- #endif
- 
- #include <string.h>
-+#include <stdio.h>
- #include <dwarf.h>
- 
- #define BACKEND arm_
-@@ -58,7 +59,15 @@
-       namelen = 2;
-       break;
- 
--    case 10 ... 12:
-+    case 10 ... 11:
-+      name[0] = 'r';
-+      name[1] = '1';
-+      name[2] = regno % 10 + '0';
-+      namelen = 3;
-+      break;
-+
-+    case 12:
-+      *type = DW_ATE_unsigned;
-       name[0] = 'r';
-       name[1] = '1';
-       name[2] = regno % 10 + '0';
-@@ -73,6 +82,9 @@
-       break;
- 
-     case 16 + 0 ... 16 + 7:
-+      /* AADWARF says that there are no registers in that range,
-+       * but gcc maps FPA registers here
-+       */
-       regno += 96 - 16;
-       /* Fall through.  */
-     case 96 + 0 ... 96 + 7:
-@@ -84,11 +96,139 @@
-       namelen = 2;
-       break;
- 
-+    case 64 + 0 ... 64 + 9:
-+      *setname = "VFP";
-+      *bits = 32;
-+      *type = DW_ATE_float;
-+      name[0] = 's';
-+      name[1] = regno - 64 + '0';
-+      namelen = 2;
-+      break;
-+
-+    case 64 + 10 ... 64 + 31:
-+      *setname = "VFP";
-+      *bits = 32;
-+      *type = DW_ATE_float;
-+      name[0] = 's';
-+      name[1] = (regno - 64) / 10 + '0';
-+      name[2] = (regno - 64) % 10 + '0';
-+      namelen = 3;
-+      break;
-+
-+    case 104 + 0 ... 104 + 7:
-+      /* XXX TODO:
-+       * This can be either intel wireless MMX general purpose/control
-+       * registers or xscale accumulator, which have different usage.
-+       * We only have the intel wireless MMX here now.
-+       * The name needs to be changed for the xscale accumulator too. */
-+      *setname = "MMX";
-+      *type = DW_ATE_unsigned;
-+      *bits = 32;
-+      memcpy(name, "wcgr", 4);
-+      name[4] = regno - 104 + '0';
-+      namelen = 5;
-+      break;
-+
-+    case 112 + 0 ... 112 + 9:
-+      *setname = "MMX";
-+      *type = DW_ATE_unsigned;
-+      *bits = 64;
-+      name[0] = 'w';
-+      name[1] = 'r';
-+      name[2] = regno - 112 + '0';
-+      namelen = 3;
-+      break;
-+
-+    case 112 + 10 ... 112 + 15:
-+      *setname = "MMX";
-+      *type = DW_ATE_unsigned;
-+      *bits = 64;
-+      name[0] = 'w';
-+      name[1] = 'r';
-+      name[2] = '1';
-+      name[3] = regno - 112 - 10 + '0';
-+      namelen = 4;
-+      break;
-+
-     case 128:
-+      *setname = "special";
-       *type = DW_ATE_unsigned;
-       return stpcpy (name, "spsr") + 1 - name;
- 
-+    case 129:
-+      *setname = "special";
-+      *type = DW_ATE_unsigned;
-+      return stpcpy(name, "spsr_fiq") + 1 - name;
-+
-+    case 130:
-+      *setname = "special";
-+      *type = DW_ATE_unsigned;
-+      return stpcpy(name, "spsr_irq") + 1 - name;
-+
-+    case 131:
-+      *setname = "special";
-+      *type = DW_ATE_unsigned;
-+      return stpcpy(name, "spsr_abt") + 1 - name;
-+
-+    case 132:
-+      *setname = "special";
-+      *type = DW_ATE_unsigned;
-+      return stpcpy(name, "spsr_und") + 1 - name;
-+
-+    case 133:
-+      *setname = "special";
-+      *type = DW_ATE_unsigned;
-+      return stpcpy(name, "spsr_svc") + 1 - name;
-+
-+    case 144 ... 150:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_usr", regno - 144 + 8) + 1;
-+
-+    case 151 ... 157:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1;
-+
-+    case 158 ... 159:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_irq", regno - 158 + 13) + 1;
-+
-+    case 160 ... 161:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_abt", regno - 160 + 13) + 1;
-+
-+    case 162 ... 163:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_und", regno - 162 + 13) + 1;
-+
-+    case 164 ... 165:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_svc", regno - 164 + 13) + 1;
-+
-+    case 192 ... 199:
-+     *setname = "MMX";
-+      *bits = 32;
-+      *type = DW_ATE_unsigned;
-+      name[0] = 'w';
-+      name[1] = 'c';
-+      name[2] = regno - 192 + '0';
-+      namelen = 3;
-+      break;
-+
-     case 256 + 0 ... 256 + 9:
-+      /* XXX TODO: Neon also uses those registers and can contain
-+       * both float and integers */
-       *setname = "VFP";
-       *type = DW_ATE_float;
-       *bits = 64;
-Index: elfutils-0.146/backends/arm_retval.c
-===================================================================
---- elfutils-0.146.orig/backends/arm_retval.c	2010-01-12 16:57:54.000000000 +0000
-+++ elfutils-0.146/backends/arm_retval.c	2010-04-24 10:11:13.000000000 +0000
-@@ -45,6 +45,13 @@
- #define nloc_intreg	1
- #define nloc_intregs(n)	(2 * (n))
- 
-+/* f1  */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */
-+static const Dwarf_Op loc_fpreg[] =
-+  {
-+    { .atom = DW_OP_reg16 },
-+  };
-+#define nloc_fpreg  1
-+
- /* The return value is a structure and is actually stored in stack space
-    passed in a hidden argument by the caller.  But, the compiler
-    helpfully returns the address of that space in r0.  */
-@@ -55,8 +62,9 @@
- #define nloc_aggregate 1
- 
- 
--int
--arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+static int
-+arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp,
-+		            int soft_float)
- {
-   /* Start with the function's type, and get the DW_AT_type attribute,
-      which is the type of the return value.  */
-@@ -109,14 +117,31 @@
- 	  else
- 	    return -1;
- 	}
-+      if (tag == DW_TAG_base_type)
-+	{
-+	  Dwarf_Word encoding;
-+	  if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
-+	                       &attr_mem), &encoding) != 0)
-+	    return -1;
-+
-+	  if ((encoding == DW_ATE_float) && !soft_float)
-+	    {
-+	      *locp = loc_fpreg;
-+	      if (size <= 8)
-+		return nloc_fpreg;
-+	      goto aggregate;
-+	    }
-+	}
-       if (size <= 16)
- 	{
- 	intreg:
- 	  *locp = loc_intreg;
- 	  return size <= 4 ? nloc_intreg : nloc_intregs ((size + 3) / 4);
- 	}
-+      /* fall through. */
- 
-     aggregate:
-+      /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */
-       *locp = loc_aggregate;
-       return nloc_aggregate;
- 
-@@ -135,3 +160,18 @@
-      DWARF and might be valid.  */
-   return -2;
- }
-+
-+/* return location for -mabi=apcs-gnu -msoft-float */
-+int
-+arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+   return arm_return_value_location_ (functypedie, locp, 1);
-+}
-+
-+/* return location for -mabi=apcs-gnu -mhard-float (current default) */
-+int
-+arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+   return arm_return_value_location_ (functypedie, locp, 0);
-+}
-+
-Index: elfutils-0.146/libelf/elf.h
-===================================================================
---- elfutils-0.146.orig/libelf/elf.h	2010-04-24 10:11:11.000000000 +0000
-+++ elfutils-0.146/libelf/elf.h	2010-04-24 10:11:13.000000000 +0000
-@@ -2290,6 +2290,9 @@
- #define EF_ARM_EABI_VER4	0x04000000
- #define EF_ARM_EABI_VER5	0x05000000
- 
-+/* EI_OSABI values */
-+#define ELFOSABI_ARM_AEABI    64      /* Contains symbol versioning. */
-+
- /* Additional symbol types for Thumb.  */
- #define STT_ARM_TFUNC		STT_LOPROC /* A Thumb function.  */
- #define STT_ARM_16BIT		STT_HIPROC /* A Thumb label.  */
-@@ -2307,12 +2310,19 @@
- 
- /* Processor specific values for the Phdr p_type field.  */
- #define PT_ARM_EXIDX		(PT_LOPROC + 1)	/* ARM unwind segment.  */
-+#define PT_ARM_UNWIND		PT_ARM_EXIDX
- 
- /* Processor specific values for the Shdr sh_type field.  */
- #define SHT_ARM_EXIDX		(SHT_LOPROC + 1) /* ARM unwind section.  */
- #define SHT_ARM_PREEMPTMAP	(SHT_LOPROC + 2) /* Preemption details.  */
- #define SHT_ARM_ATTRIBUTES	(SHT_LOPROC + 3) /* ARM attributes section.  */
- 
-+/* Processor specific values for the Dyn d_tag field.  */
-+#define DT_ARM_RESERVED1	(DT_LOPROC + 0)
-+#define DT_ARM_SYMTABSZ		(DT_LOPROC + 1)
-+#define DT_ARM_PREEMTMAB	(DT_LOPROC + 2)
-+#define DT_ARM_RESERVED2	(DT_LOPROC + 3)
-+#define DT_ARM_NUM		4
- 
- /* ARM relocs.  */
- 
-@@ -2344,12 +2354,75 @@
- #define R_ARM_GOTPC		25	/* 32 bit PC relative offset to GOT */
- #define R_ARM_GOT32		26	/* 32 bit GOT entry */
- #define R_ARM_PLT32		27	/* 32 bit PLT address */
-+#define R_ARM_CALL		28
-+#define R_ARM_JUMP24		29
-+#define R_ARM_THM_JUMP24	30
-+#define R_ARM_BASE_ABS		31
- #define R_ARM_ALU_PCREL_7_0	32
- #define R_ARM_ALU_PCREL_15_8	33
- #define R_ARM_ALU_PCREL_23_15	34
- #define R_ARM_LDR_SBREL_11_0	35
- #define R_ARM_ALU_SBREL_19_12	36
- #define R_ARM_ALU_SBREL_27_20	37
-+#define R_ARM_TARGET1		38
-+#define R_ARM_SBREL31		39
-+#define R_ARM_V4BX		40
-+#define R_ARM_TARGET2		41
-+#define R_ARM_PREL31		42
-+#define R_ARM_MOVW_ABS_NC	43
-+#define R_ARM_MOVT_ABS		44
-+#define R_ARM_MOVW_PREL_NC	45
-+#define R_ARM_MOVT_PREL		46
-+#define R_ARM_THM_MOVW_ABS_NC	47
-+#define R_ARM_THM_MOVT_ABS	48
-+#define R_ARM_THM_MOVW_PREL_NC	49
-+#define R_ARM_THM_MOVT_PREL	50
-+#define R_ARM_THM_JUMP19	51
-+#define R_ARM_THM_JUMP6		52
-+#define R_ARM_THM_ALU_PREL_11_0	53
-+#define R_ARM_THM_PC12		54
-+#define R_ARM_ABS32_NOI		55
-+#define R_ARM_REL32_NOI		56
-+#define R_ARM_ALU_PC_G0_NC	57
-+#define R_ARM_ALU_PC_G0		58
-+#define R_ARM_ALU_PC_G1_NC	59
-+#define R_ARM_ALU_PC_G1		60
-+#define R_ARM_ALU_PC_G2		61
-+#define R_ARM_LDR_PC_G1		62
-+#define R_ARM_LDR_PC_G2		63
-+#define R_ARM_LDRS_PC_G0	64
-+#define R_ARM_LDRS_PC_G1	65
-+#define R_ARM_LDRS_PC_G2	66
-+#define R_ARM_LDC_PC_G0		67
-+#define R_ARM_LDC_PC_G1		68
-+#define R_ARM_LDC_PC_G2		69
-+#define R_ARM_ALU_SB_G0_NC	70
-+#define R_ARM_ALU_SB_G0		71
-+#define R_ARM_ALU_SB_G1_NC	72
-+#define R_ARM_ALU_SB_G1		73
-+#define R_ARM_ALU_SB_G2		74
-+#define R_ARM_LDR_SB_G0		75
-+#define R_ARM_LDR_SB_G1		76
-+#define R_ARM_LDR_SB_G2		77
-+#define R_ARM_LDRS_SB_G0	78
-+#define R_ARM_LDRS_SB_G1	79
-+#define R_ARM_LDRS_SB_G2	80
-+#define R_ARM_LDC_G0		81
-+#define R_ARM_LDC_G1		82
-+#define R_ARM_LDC_G2		83
-+#define R_ARM_MOVW_BREL_NC	84
-+#define R_ARM_MOVT_BREL		85
-+#define R_ARM_MOVW_BREL		86
-+#define R_ARM_THM_MOVW_BREL_NC	87
-+#define R_ARM_THM_MOVT_BREL	88
-+#define R_ARM_THM_MOVW_BREL	89
-+/* 90-93 unallocated */
-+#define R_ARM_PLT32_ABS		94
-+#define R_ARM_GOT_ABS		95
-+#define R_ARM_GOT_PREL		96
-+#define R_ARM_GOT_BREL12	97
-+#define R_ARM_GOTOFF12		98
-+#define R_ARM_GOTRELAX		99
- #define R_ARM_GNU_VTENTRY	100
- #define R_ARM_GNU_VTINHERIT	101
- #define R_ARM_THM_PC11		102	/* thumb unconditional branch */
-@@ -2364,6 +2437,12 @@
- 					   static TLS block offset */
- #define R_ARM_TLS_LE32		108	/* 32 bit offset relative to static
- 					   TLS block */
-+#define R_ARM_TLS_LDO12		109
-+#define R_ARM_TLS_LE12		110
-+#define R_ARM_TLS_IE12GP	111
-+/* 112 - 127 private range */
-+#define R_ARM_ME_TOO		128	/* obsolete */
-+
- #define R_ARM_RXPC25		249
- #define R_ARM_RSBREL32		250
- #define R_ARM_THM_RPC22		251
-Index: elfutils-0.146/backends/libebl_arm.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/libebl_arm.h	2010-04-24 10:11:13.000000000 +0000
-@@ -0,0 +1,9 @@
-+#ifndef _LIBEBL_ARM_H
-+#define _LIBEBL_ARM_H 1
-+
-+#include <libdw.h>
-+
-+extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
-+extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
-+
-+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff
deleted file mode 100644
index 5baa709..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff
+++ /dev/null
@@ -1,71 +0,0 @@
-Upstream-Status: Backport
-
-Index: elfutils-0.146/libelf/elf.h
-===================================================================
---- elfutils-0.146.orig/libelf/elf.h	2010-04-24 10:13:50.000000000 +0000
-+++ elfutils-0.146/libelf/elf.h	2010-04-24 10:22:43.000000000 +0000
-@@ -143,6 +143,7 @@
- #define ELFOSABI_HPUX		1	/* HP-UX */
- #define ELFOSABI_NETBSD		2	/* NetBSD.  */
- #define ELFOSABI_LINUX		3	/* Linux.  */
-+#define ELFOSABI_HURD		4	/* GNU/Hurd */
- #define ELFOSABI_SOLARIS	6	/* Sun Solaris.  */
- #define ELFOSABI_AIX		7	/* IBM AIX.  */
- #define ELFOSABI_IRIX		8	/* SGI Irix.  */
-@@ -150,8 +151,13 @@
- #define ELFOSABI_TRU64		10	/* Compaq TRU64 UNIX.  */
- #define ELFOSABI_MODESTO	11	/* Novell Modesto.  */
- #define ELFOSABI_OPENBSD	12	/* OpenBSD.  */
-+#define ELFOSABI_OPENVMS	13	/* OpenVMS */
-+#define ELFOSABI_NSK		14	/* Hewlett-Packard Non-Stop Kernel */
-+#define ELFOSABI_AROS		15	/* Amiga Research OS */
-+/* 64-255 Architecture-specific value range */
- #define ELFOSABI_ARM_AEABI	64	/* ARM EABI */
- #define ELFOSABI_ARM		97	/* ARM */
-+/* This is deprecated? It's not in the latest version anymore. */
- #define ELFOSABI_STANDALONE	255	/* Standalone (embedded) application */
- 
- #define EI_ABIVERSION	8		/* ABI version */
-@@ -206,7 +212,7 @@
- #define EM_H8_300H	47		/* Hitachi H8/300H */
- #define EM_H8S		48		/* Hitachi H8S */
- #define EM_H8_500	49		/* Hitachi H8/500 */
--#define EM_IA_64	50		/* Intel Merced */
-+#define EM_IA_64	50		/* Intel IA64 */
- #define EM_MIPS_X	51		/* Stanford MIPS-X */
- #define EM_COLDFIRE	52		/* Motorola Coldfire */
- #define EM_68HC12	53		/* Motorola M68HC12 */
-@@ -220,7 +226,8 @@
- #define EM_TINYJ	61		/* Advanced Logic Corp. Tinyj emb.fam*/
- #define EM_X86_64	62		/* AMD x86-64 architecture */
- #define EM_PDSP		63		/* Sony DSP Processor */
--
-+#define	EM_PDP10	64		/* Digital Equipment Corp. PDP-10 */
-+#define EM_PDP11	65		/* Digital Equipment Corp. PDP-11 */
- #define EM_FX66		66		/* Siemens FX66 microcontroller */
- #define EM_ST9PLUS	67		/* STMicroelectronics ST9+ 8/16 mc */
- #define EM_ST7		68		/* STmicroelectronics ST7 8 bit mc */
-@@ -250,7 +257,22 @@
- #define EM_OPENRISC	92		/* OpenRISC 32-bit embedded processor */
- #define EM_ARC_A5	93		/* ARC Cores Tangent-A5 */
- #define EM_XTENSA	94		/* Tensilica Xtensa Architecture */
--#define EM_NUM		95
-+#define	EM_VIDEOCORE	95		/* Alphamosaic VideoCore processor */
-+#define	EM_TMM_GPP	96		/* Thompson Multimedia General Purpose Processor */
-+#define	EM_NS32K	97		/* National Semiconductor 32000 series */
-+#define	EM_TPC		98		/* Tenor Network TPC processor */
-+#define	EM_SNP1K	99		/* Trebia SNP 1000 processor */
-+#define	EM_ST200	100		/* STMicroelectronics (www.st.com) ST200 microcontroller */
-+#define EM_IP2K         101		/* Ubicom IP2XXX microcontroller family */
-+#define	EM_MAX		102		/* MAX Processor */
-+#define EM_CR           103		/* National Semiconductor CompactRISC */
-+#define	EM_F2MC16	104		/* Fujitsu F2MC16 */
-+#define EM_MSP430       105		/* TI msp430 micro controller */
-+#define EM_BLACKFIN     106		/* Analog Devices Blackfin (DSP) processor */
-+#define EM_SE_C33	107		/* S1C33 Family of Seiko Epson processors */
-+#define	EM_SEP		108		/* Sharp embedded microprocessor */
-+#define EM_ARCA		109		/* Arca RISC Microprocessor */
-+#define EM_NUM		110
- 
- /* If it is necessary to assign new unofficial EM_* values, please
-    pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch
deleted file mode 100644
index deba45f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 323ca04a0c9189544075c19b49da67f6443a8950 Mon Sep 17 00:00:00 2001
-From: Li xin <lixin.fnst@cn.fujitsu.com>
-Date: Wed, 21 Jan 2015 09:33:38 +0900
-Subject: [PATCH] elf_begin.c: CVE-2014-9447 fix
-
-this patch is from:
- https://git.fedorahosted.org/cgit/elfutils.git/commit/?id=147018e729e7c22eeabf15b82d26e4bf68a0d18e
-
-Upstream-Status: Backport
-CVE: CVE-2014-9447
-
-Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
----
- libelf/elf_begin.c | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
-diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c
-index e46add3..e83ba35 100644
---- a/libelf/elf_begin.c
-+++ b/libelf/elf_begin.c
-@@ -736,11 +736,8 @@ read_long_names (Elf *elf)
- 	    break;
- 
- 	  /* NUL-terminate the string.  */
--	  *runp = '\0';
--
--	  /* Skip the NUL byte and the \012.  */
--	  runp += 2;
--
-+	  *runp++ = '\0';
-+ 
- 	  /* A sanity check.  Somebody might have generated invalid
- 	     archive.  */
- 	  if (runp >= newp + len)
--- 
-1.8.4.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch
deleted file mode 100644
index b619619..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Upstream-Status: Backport
-
-ar.c (do_oper_delete): Fix num passed to memset
-native build failed as following on Fedora18+: 
-ar.c: In function 'do_oper_delete':
-ar.c:918:31: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
-   memset (found, '\0', sizeof (found));
-                                ^
-The original commit is http://git.fedorahosted.org/cgit/elfutils.git/commit/src/ar.c?id=1a4d0668d18bf1090c5c08cdb5cb3ba2b8eb5410
-
-Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
-
---- elfutils-0.148/src/ar.c.org	2013-03-12 21:12:17.928281375 -0500
-+++ elfutils-0.148/src/ar.c	2013-03-12 21:15:30.053285271 -0500
-@@ -915,7 +915,7 @@
- 		long int instance)
- {
-   bool *found = alloca (sizeof (bool) * argc);
--  memset (found, '\0', sizeof (found));
-+  memset (found, '\0', sizeof (bool) * argc);
- 
-   /* List of the files we keep.  */
-   struct armem *to_copy = NULL;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch
deleted file mode 100644
index 0ff353d..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Upstream-Status: Backport
-
-The ELF_T_LIB and ELF_T_GNUHASH sizes were missing from fsize table.
-
-This could cause a failure in the elf*_xlatetof function.
-
-diff -ur elfutils-0.148.orig/libelf/exttypes.h elfutils-0.148/libelf/exttypes.h
---- elfutils-0.148.orig/libelf/exttypes.h	2009-01-08 12:56:37.000000000 -0800
-+++ elfutils-0.148/libelf/exttypes.h	2010-08-18 14:00:33.000000000 -0700
-@@ -94,6 +94,7 @@
- Vernaux32 (Ext_);
- Syminfo32 (Ext_);
- Move32 (Ext_);
-+Lib32 (Ext_);
- auxv_t32 (Ext_);
- 
- Ehdr64 (Ext_);
-@@ -110,6 +111,7 @@
- Vernaux64 (Ext_);
- Syminfo64 (Ext_);
- Move64 (Ext_);
-+Lib64 (Ext_);
- auxv_t64 (Ext_);
- 
- #undef START
-diff -ur elfutils-0.148.orig/libelf/gelf_fsize.c elfutils-0.148/libelf/gelf_fsize.c
---- elfutils-0.148.orig/libelf/gelf_fsize.c	2009-01-08 12:56:37.000000000 -0800
-+++ elfutils-0.148/libelf/gelf_fsize.c	2010-08-18 14:11:57.000000000 -0700
-@@ -87,7 +87,9 @@
-       [ELF_T_NHDR]	= sizeof (ElfW2(LIBELFBITS, Ext_Nhdr)),		      \
-       [ELF_T_SYMINFO]	= sizeof (ElfW2(LIBELFBITS, Ext_Syminfo)),	      \
-       [ELF_T_MOVE]	= sizeof (ElfW2(LIBELFBITS, Ext_Move)),		      \
--      [ELF_T_AUXV]	= sizeof (ElfW2(LIBELFBITS, Ext_auxv_t))
-+      [ELF_T_LIB]	= sizeof (ElfW2(LIBELFBITS, Ext_Lib)),		      \
-+      [ELF_T_AUXV]	= sizeof (ElfW2(LIBELFBITS, Ext_auxv_t)),	      \
-+      [ELF_T_GNUHASH]	= ELFW2(LIBELFBITS, FSZ_WORD)
-       TYPE_SIZES (32)
-     },
-     [ELFCLASS64 - 1] = {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch
deleted file mode 100644
index 0e28690..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-This patch fixes a warning seen with gcc 4.8 (especially on ubuntu 13.10)
-
-| addr2line.c: In function 'handle_address':
-| addr2line.c:450:7: error: format '%a' expects argument of type 'float *', but argument 3 has type 'char **' [-Werror=format=]
-|        if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
-|        ^
-| addr2line.c:453:7: error: format '%a' expects argument of type 'float *', but argument 3 has type 'char **' [-Werror=format=]
-|        switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
-|        ^
-| cc1: all warnings being treated as errors
-
-
-%a is old GNU style and should be abandoned in favor of %m
-
-Also see
-
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54361
-
-to support this assertion
-
-This patch is added via redhat-compatibility patch so lets revert this part
-here.
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Upstream-Status: Inappropriate [Caused by an earlier patch]
-
-Index: elfutils-0.148/src/addr2line.c
-===================================================================
---- elfutils-0.148.orig/src/addr2line.c	2013-09-23 17:46:45.513586538 -0700
-+++ elfutils-0.148/src/addr2line.c	2013-09-23 17:46:46.329586558 -0700
-@@ -447,10 +447,10 @@
-       bool parsed = false;
-       int i, j;
-       char *name = NULL;
--      if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
-+      if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
- 	  && string[i] == '\0')
- 	parsed = adjust_to_section (name, &addr, dwfl);
--      switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
-+      switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
- 	{
- 	default:
- 	  break;
-Index: elfutils-0.148/tests/line2addr.c
-===================================================================
---- elfutils-0.148.orig/tests/line2addr.c	2013-09-23 17:46:45.521586538 -0700
-+++ elfutils-0.148/tests/line2addr.c	2013-09-23 17:46:46.329586558 -0700
-@@ -132,7 +132,7 @@
-     {
-       struct args a = { .arg = argv[cnt] };
- 
--      switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
-+      switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
- 	{
- 	default:
- 	case 0:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch
deleted file mode 100644
index c78f95d..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-Upstream-Status: pending
-gcc 4.7 does not like pointer conversion, so have a void * tmp var to work 
-around following compilation issue.
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
-2011/07/07
-
-| md5.c: In function 'md5_finish_ctx':
-| md5.c:108:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
-| md5.c:109:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
-| cc1: all warnings being treated as errors
-| 
-| make[2]: *** [md5.o] Error 1
-| make[2]: *** Waiting for unfinished jobs....
-| sha1.c: In function 'sha1_finish_ctx':
-| sha1.c:109:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
-| sha1.c:111:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
-| cc1: all warnings being treated as errors
-| 
-| make[2]: *** [sha1.o] Error 1
-
-Index: elfutils-0.148/lib/md5.c
-===================================================================
---- elfutils-0.148.orig/lib/md5.c
-+++ elfutils-0.148/lib/md5.c
-@@ -95,6 +95,7 @@ md5_finish_ctx (ctx, resbuf)
-   /* Take yet unprocessed bytes into account.  */
-   md5_uint32 bytes = ctx->buflen;
-   size_t pad;
-+  void * tmp;
- 
-   /* Now count remaining bytes.  */
-   ctx->total[0] += bytes;
-@@ -105,9 +106,10 @@ md5_finish_ctx (ctx, resbuf)
-   memcpy (&ctx->buffer[bytes], fillbuf, pad);
- 
-   /* Put the 64-bit file length in *bits* at the end of the buffer.  */
--  *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
--  *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
--							(ctx->total[0] >> 29));
-+  tmp = &ctx->buffer[bytes + pad];
-+  *(md5_uint32 *) tmp = SWAP (ctx->total[0] << 3);
-+  tmp = &ctx->buffer[bytes + pad + 4];
-+  *(md5_uint32 *) tmp = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
- 
-   /* Process last bytes.  */
-   md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
-Index: elfutils-0.148/lib/sha1.c
-===================================================================
---- elfutils-0.148.orig/lib/sha1.c
-+++ elfutils-0.148/lib/sha1.c
-@@ -96,6 +96,7 @@ sha1_finish_ctx (ctx, resbuf)
-   /* Take yet unprocessed bytes into account.  */
-   sha1_uint32 bytes = ctx->buflen;
-   size_t pad;
-+  void * tmp;
- 
-   /* Now count remaining bytes.  */
-   ctx->total[0] += bytes;
-@@ -106,9 +107,10 @@ sha1_finish_ctx (ctx, resbuf)
-   memcpy (&ctx->buffer[bytes], fillbuf, pad);
- 
-   /* Put the 64-bit file length in *bits* at the end of the buffer.  */
--  *(sha1_uint32 *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) |
--						     (ctx->total[0] >> 29));
--  *(sha1_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3);
-+  tmp = &ctx->buffer[bytes + pad];
-+  *(sha1_uint32 *) tmp = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
-+  tmp = &ctx->buffer[bytes + pad + 4];
-+  *(sha1_uint32 *) tmp = SWAP (ctx->total[0] << 3);
- 
-   /* Process last bytes.  */
-   sha1_process_block (ctx->buffer, bytes + pad + 8, ctx);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/gcc6.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/gcc6.patch
deleted file mode 100644
index b56a754..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/gcc6.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Fix warnings found with gcc6
-
-| ../../elfutils-0.148/libdw/dwarf_siblingof.c: In function 'dwarf_siblingof':
-| ../../elfutils-0.148/libdw/dwarf_siblingof.c:69:6: error: nonnull argument 'result' compared to NULL [-Werror=nonnull-compare]
-|    if (result == NULL)
-|       ^
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Inappropriate [ unmaintained ]
-Index: elfutils-0.148/libdw/dwarf_siblingof.c
-===================================================================
---- elfutils-0.148.orig/libdw/dwarf_siblingof.c
-+++ elfutils-0.148/libdw/dwarf_siblingof.c
-@@ -66,9 +66,6 @@ dwarf_siblingof (die, result)
-   if (die == NULL)
-     return -1;
- 
--  if (result == NULL)
--    return -1;
--
-   if (result != die)
-     result->addr = NULL;
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff
deleted file mode 100644
index a86b97c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff
+++ /dev/null
@@ -1,801 +0,0 @@
-Upstream-Status: Backport
-
-Index: elfutils-0.146/backends/parisc_init.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/parisc_init.c	2010-04-24 10:10:50.000000000 +0000
-@@ -0,0 +1,74 @@
-+/* Initialization of PA-RISC specific backend library.
-+   Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#define BACKEND		parisc_
-+#define RELOC_PREFIX	R_PARISC_
-+#include "libebl_CPU.h"
-+#include "libebl_parisc.h"
-+
-+/* This defines the common reloc hooks based on parisc_reloc.def.  */
-+#include "common-reloc.c"
-+
-+
-+const char *
-+parisc_init (elf, machine, eh, ehlen)
-+     Elf *elf __attribute__ ((unused));
-+     GElf_Half machine __attribute__ ((unused));
-+     Ebl *eh;
-+     size_t ehlen;
-+{
-+  int pa64 = 0;
-+
-+  /* Check whether the Elf_BH object has a sufficent size.  */
-+  if (ehlen < sizeof (Ebl))
-+    return NULL;
-+
-+  if (elf) {
-+    GElf_Ehdr ehdr_mem;
-+    GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
-+    if (ehdr && (ehdr->e_flags & EF_PARISC_WIDE))
-+      pa64 = 1;
-+  }
-+  /* We handle it.  */
-+  eh->name = "PA-RISC";
-+  parisc_init_reloc (eh);
-+  HOOK (eh, reloc_simple_type);
-+  HOOK (eh, machine_flag_check);
-+  HOOK (eh, symbol_type_name);
-+  HOOK (eh, segment_type_name);
-+  HOOK (eh, section_type_name);
-+  HOOK (eh, register_info);
-+  if (pa64)
-+    eh->return_value_location = parisc_return_value_location_64;
-+  else
-+    eh->return_value_location = parisc_return_value_location_32;
-+
-+  return MODVERSION;
-+}
-Index: elfutils-0.146/backends/parisc_regs.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/parisc_regs.c	2010-04-24 10:10:50.000000000 +0000
-@@ -0,0 +1,159 @@
-+/* Register names and numbers for PA-RISC DWARF.
-+   Copyright (C) 2005, 2006 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <string.h>
-+#include <dwarf.h>
-+
-+#define BACKEND parisc_
-+#include "libebl_CPU.h"
-+
-+ssize_t
-+parisc_register_info (Ebl *ebl, int regno, char *name, size_t namelen,
-+		     const char **prefix, const char **setname,
-+		     int *bits, int *type)
-+{
-+  int pa64 = 0;
-+
-+  if (ebl->elf) {
-+    GElf_Ehdr ehdr_mem;
-+    GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem);
-+    if (ehdr->e_flags & EF_PARISC_WIDE)
-+      pa64 = 1;
-+  }
-+
-+  int nregs = pa64 ? 127 : 128;
-+
-+  if (name == NULL)
-+    return nregs;
-+
-+  if (regno < 0 || regno >= nregs || namelen < 6)
-+    return -1;
-+
-+  *prefix = "%";
-+
-+  if (regno < 32)
-+  {
-+    *setname = "integer";
-+    *type = DW_ATE_signed;
-+    if (pa64)
-+    {
-+	*bits = 64;
-+    }
-+    else
-+    {
-+    	*bits = 32;
-+    }
-+  }
-+  else if (regno == 32)
-+  {
-+    *setname = "special";
-+    if (pa64)
-+    {
-+	*bits = 6;
-+    }
-+    else
-+    {
-+    	*bits = 5;
-+    }
-+    *type = DW_ATE_unsigned;
-+  }
-+  else
-+  {
-+    *setname = "FPU";
-+    *type = DW_ATE_float;
-+    if (pa64)
-+    {
-+	*bits = 64;
-+    }
-+    else
-+    {
-+    	*bits = 32;
-+    }
-+  }
-+
-+  if (regno < 33) {
-+    switch (regno)
-+      {
-+      case 0 ... 9:
-+        name[0] = 'r';
-+        name[1] = regno + '0';
-+        namelen = 2;
-+        break;
-+      case 10 ... 31:
-+        name[0] = 'r';
-+        name[1] = regno / 10 + '0';
-+        name[2] = regno % 10 + '0';
-+        namelen = 3;
-+        break;
-+      case 32:
-+	*prefix = NULL;
-+	name[0] = 'S';
-+	name[1] = 'A';
-+	name[2] = 'R';
-+	namelen = 3;
-+	break;
-+      }
-+  }
-+  else {
-+    if (pa64 && ((regno - 72) % 2)) {
-+      *setname = NULL;
-+      return 0;
-+    }
-+
-+    switch (regno)
-+      {
-+      case 72 + 0 ... 72 + 11:
-+        name[0] = 'f';
-+	name[1] = 'r';
-+        name[2] = (regno + 8 - 72) / 2 + '0';
-+        namelen = 3;
-+        if ((regno + 8 - 72) % 2) {
-+	  name[3] = 'R';
-+	  namelen++;
-+        }
-+        break;
-+      case 72 + 12 ... 72 + 55:
-+        name[0] = 'f';
-+	name[1] = 'r';
-+        name[2] = (regno + 8 - 72) / 2 / 10 + '0';
-+        name[3] = (regno + 8 - 72) / 2 % 10 + '0';
-+        namelen = 4;
-+        if ((regno + 8 - 72) % 2) {
-+	  name[4] = 'R';
-+	  namelen++;
-+        }
-+        break;
-+      default:
-+        *setname = NULL;
-+        return 0;
-+      }
-+  }
-+  name[namelen++] = '\0';
-+  return namelen;
-+}
-Index: elfutils-0.146/backends/parisc_reloc.def
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/parisc_reloc.def	2010-04-24 10:10:50.000000000 +0000
-@@ -0,0 +1,128 @@
-+/* List the relocation types for PA-RISC.  -*- C -*-
-+   Copyright (C) 2005 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+/*	    NAME,		REL|EXEC|DYN	*/
-+
-+RELOC_TYPE (NONE,		EXEC|DYN)
-+RELOC_TYPE (DIR32,		REL|EXEC|DYN)
-+RELOC_TYPE (DIR21L,		REL|EXEC|DYN)
-+RELOC_TYPE (DIR17R,		REL)
-+RELOC_TYPE (DIR17F,		REL)
-+RELOC_TYPE (DIR14R,		REL|DYN)
-+RELOC_TYPE (PCREL32,		REL)
-+RELOC_TYPE (PCREL21L,		REL)
-+RELOC_TYPE (PCREL17R,		REL)
-+RELOC_TYPE (PCREL17F,		REL)
-+RELOC_TYPE (PCREL14R,		REL|EXEC)
-+RELOC_TYPE (DPREL21L,		REL)
-+RELOC_TYPE (DPREL14WR,		REL)
-+RELOC_TYPE (DPREL14DR,          REL)
-+RELOC_TYPE (DPREL14R,		REL)
-+RELOC_TYPE (GPREL21L,		0)
-+RELOC_TYPE (GPREL14R,		0)
-+RELOC_TYPE (LTOFF21L,		REL)
-+RELOC_TYPE (LTOFF14R,		REL)
-+RELOC_TYPE (DLTIND14F,		0)
-+RELOC_TYPE (SETBASE,		0)
-+RELOC_TYPE (SECREL32,		REL)
-+RELOC_TYPE (BASEREL21L,		0)
-+RELOC_TYPE (BASEREL17R,		0)
-+RELOC_TYPE (BASEREL14R,		0)
-+RELOC_TYPE (SEGBASE,		0)
-+RELOC_TYPE (SEGREL32,		REL)
-+RELOC_TYPE (PLTOFF21L,		0)
-+RELOC_TYPE (PLTOFF14R,		0)
-+RELOC_TYPE (PLTOFF14F,		0)
-+RELOC_TYPE (LTOFF_FPTR32,	0)
-+RELOC_TYPE (LTOFF_FPTR21L,	0)
-+RELOC_TYPE (LTOFF_FPTR14R,	0)
-+RELOC_TYPE (FPTR64,		0)
-+RELOC_TYPE (PLABEL32,		REL|DYN)
-+RELOC_TYPE (PCREL64,		0)
-+RELOC_TYPE (PCREL22C,		0)
-+RELOC_TYPE (PCREL22F,		0)
-+RELOC_TYPE (PCREL14WR,		0)
-+RELOC_TYPE (PCREL14DR,		0)
-+RELOC_TYPE (PCREL16F,		0)
-+RELOC_TYPE (PCREL16WF,		0)
-+RELOC_TYPE (PCREL16DF,		0)
-+RELOC_TYPE (DIR64,		REL|DYN)
-+RELOC_TYPE (DIR14WR,		REL)
-+RELOC_TYPE (DIR14DR,		REL)
-+RELOC_TYPE (DIR16F,		REL)
-+RELOC_TYPE (DIR16WF,		REL)
-+RELOC_TYPE (DIR16DF,		REL)
-+RELOC_TYPE (GPREL64,		0)
-+RELOC_TYPE (GPREL14WR,		0)
-+RELOC_TYPE (GPREL14DR,		0)
-+RELOC_TYPE (GPREL16F,		0)
-+RELOC_TYPE (GPREL16WF,		0)
-+RELOC_TYPE (GPREL16DF,		0)
-+RELOC_TYPE (LTOFF64,		0)
-+RELOC_TYPE (LTOFF14WR,		0)
-+RELOC_TYPE (LTOFF14DR,		0)
-+RELOC_TYPE (LTOFF16F,		0)
-+RELOC_TYPE (LTOFF16WF,		0)
-+RELOC_TYPE (LTOFF16DF,		0)
-+RELOC_TYPE (SECREL64,		0)
-+RELOC_TYPE (BASEREL14WR,	0)
-+RELOC_TYPE (BASEREL14DR,	0)
-+RELOC_TYPE (SEGREL64,		0)
-+RELOC_TYPE (PLTOFF14WR,		0)
-+RELOC_TYPE (PLTOFF14DR,		0)
-+RELOC_TYPE (PLTOFF16F,		0)
-+RELOC_TYPE (PLTOFF16WF,		0)
-+RELOC_TYPE (PLTOFF16DF,		0)
-+RELOC_TYPE (LTOFF_FPTR64,	0)
-+RELOC_TYPE (LTOFF_FPTR14WR,	0)
-+RELOC_TYPE (LTOFF_FPTR14DR,	0)
-+RELOC_TYPE (LTOFF_FPTR16F,	0)
-+RELOC_TYPE (LTOFF_FPTR16WF,	0)
-+RELOC_TYPE (LTOFF_FPTR16DF,	0)
-+RELOC_TYPE (COPY,		EXEC)
-+RELOC_TYPE (IPLT,		EXEC|DYN)
-+RELOC_TYPE (EPLT,		0)
-+RELOC_TYPE (TPREL32,		DYN)
-+RELOC_TYPE (TPREL21L,		0)
-+RELOC_TYPE (TPREL14R,		0)
-+RELOC_TYPE (LTOFF_TP21L,	0)
-+RELOC_TYPE (LTOFF_TP14R,	0)
-+RELOC_TYPE (LTOFF_TP14F,	0)
-+RELOC_TYPE (TPREL64,		0)
-+RELOC_TYPE (TPREL14WR,		0)
-+RELOC_TYPE (TPREL14DR,		0)
-+RELOC_TYPE (TPREL16F,		0)
-+RELOC_TYPE (TPREL16WF,		0)
-+RELOC_TYPE (TPREL16DF,		0)
-+RELOC_TYPE (LTOFF_TP64,		0)
-+RELOC_TYPE (LTOFF_TP14WR,	0)
-+RELOC_TYPE (LTOFF_TP14DR,	0)
-+RELOC_TYPE (LTOFF_TP16F,	0)
-+RELOC_TYPE (LTOFF_TP16WF,	0)
-+RELOC_TYPE (LTOFF_TP16DF,	0)
-+RELOC_TYPE (TLS_DTPMOD32,	DYN)
-+RELOC_TYPE (TLS_DTPMOD64,	DYN)
-+
-+#define NO_RELATIVE_RELOC       1
-Index: elfutils-0.146/backends/parisc_retval.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/parisc_retval.c	2010-04-24 10:10:50.000000000 +0000
-@@ -0,0 +1,213 @@
-+/* Function return value location for Linux/PA-RISC ABI.
-+   Copyright (C) 2005 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <assert.h>
-+#include <dwarf.h>
-+
-+#define BACKEND parisc_
-+#include "libebl_CPU.h"
-+#include "libebl_parisc.h"
-+
-+/* %r28, or pair %r28, %r29.  */
-+static const Dwarf_Op loc_intreg32[] =
-+  {
-+    { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 4 },
-+  };
-+
-+static const Dwarf_Op loc_intreg[] =
-+  {
-+    { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 8 },
-+    { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 8 },
-+  };
-+#define nloc_intreg	1
-+#define nloc_intregpair	4
-+
-+/* %fr4L, or pair %fr4L, %fr4R on pa-32 */
-+static const Dwarf_Op loc_fpreg32[] =
-+  {
-+    { .atom = DW_OP_regx, .number = 72 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_regx, .number = 73 }, { .atom = DW_OP_piece, .number = 4 },
-+  };
-+#define nloc_fpreg32 2
-+#define nloc_fpregpair32 4
-+
-+/* $fr4 */
-+static const Dwarf_Op loc_fpreg[] =
-+  {
-+    { .atom = DW_OP_regx, .number = 72 },
-+  };
-+#define nloc_fpreg  1
-+
-+#if 0
-+/* The return value is a structure and is actually stored in stack space
-+   passed in a hidden argument by the caller. Address of the location is stored
-+   in %r28 before function call, but it may be changed by function. */
-+static const Dwarf_Op loc_aggregate[] =
-+  {
-+    { .atom = DW_OP_breg28 },
-+  };
-+#define nloc_aggregate 1
-+#endif
-+
-+static int
-+parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, int pa64)
-+{
-+  Dwarf_Word regsize = pa64 ? 8 : 4;
-+
-+  /* Start with the function's type, and get the DW_AT_type attribute,
-+     which is the type of the return value.  */
-+
-+  Dwarf_Attribute attr_mem;
-+  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
-+  if (attr == NULL)
-+    /* The function has no return value, like a `void' function in C.  */
-+    return 0;
-+
-+  Dwarf_Die die_mem;
-+  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
-+  int tag = dwarf_tag (typedie);
-+
-+  /* Follow typedefs and qualifiers to get to the actual type.  */
-+  while (tag == DW_TAG_typedef
-+	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
-+	 || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
-+    {
-+      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
-+      typedie = dwarf_formref_die (attr, &die_mem);
-+      tag = dwarf_tag (typedie);
-+    }
-+
-+  switch (tag)
-+    {
-+    case -1:
-+      return -1;
-+
-+    case DW_TAG_subrange_type:
-+      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
-+	{
-+	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
-+	  typedie = dwarf_formref_die (attr, &die_mem);
-+	  tag = dwarf_tag (typedie);
-+	}
-+      /* Fall through.  */
-+
-+    case DW_TAG_base_type:
-+    case DW_TAG_enumeration_type:
-+    case DW_TAG_pointer_type:
-+    case DW_TAG_ptr_to_member_type:
-+      {
-+        Dwarf_Word size;
-+	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
-+					 &attr_mem), &size) != 0)
-+	  {
-+	    if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
-+	      size = 4;
-+	    else
-+	      return -1;
-+	  }
-+	if (tag == DW_TAG_base_type)
-+	  {
-+	    Dwarf_Word encoding;
-+	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
-+					     &attr_mem), &encoding) != 0)
-+	      return -1;
-+
-+	    if (encoding == DW_ATE_float)
-+	      {
-+		if (pa64) {
-+		  *locp = loc_fpreg;
-+		  if (size <= 8)
-+		      return nloc_fpreg;
-+		}
-+		else {
-+		  *locp = loc_fpreg32;
-+		  if (size <= 4)
-+		    return nloc_fpreg32;
-+		  else if (size <= 8)
-+		    return nloc_fpregpair32;
-+		}
-+		goto aggregate;
-+	      }
-+	  }
-+	if (pa64)
-+	  *locp = loc_intreg;
-+	else
-+	  *locp = loc_intreg32;
-+	if (size <= regsize)
-+	  return nloc_intreg;
-+	if (size <= 2 * regsize)
-+	  return nloc_intregpair;
-+
-+	/* Else fall through.  */
-+      }
-+
-+    case DW_TAG_structure_type:
-+    case DW_TAG_class_type:
-+    case DW_TAG_union_type:
-+    case DW_TAG_array_type:
-+    aggregate: {
-+        Dwarf_Word size;
-+	if (dwarf_aggregate_size (typedie, &size) != 0)
-+	  return -1;
-+	if (pa64)
-+          *locp = loc_intreg;
-+	else
-+	  *locp = loc_intreg32;
-+        if (size <= regsize)
-+	  return nloc_intreg;
-+        if (size <= 2 * regsize)
-+	  return nloc_intregpair;
-+#if 0
-+	/* there should be some way to know this location... But I do not see it. */
-+        *locp = loc_aggregate;
-+        return nloc_aggregate;
-+#endif
-+	/* fall through.  */
-+      }
-+    }
-+
-+  /* XXX We don't have a good way to return specific errors from ebl calls.
-+     This value means we do not understand the type, but it is well-formed
-+     DWARF and might be valid.  */
-+  return -2;
-+}
-+
-+int
-+parisc_return_value_location_32 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+  return parisc_return_value_location_ (functypedie, locp, 0);
-+}
-+
-+int
-+parisc_return_value_location_64 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+  return parisc_return_value_location_ (functypedie, locp, 1);
-+}
-+
-Index: elfutils-0.146/backends/parisc_symbol.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/parisc_symbol.c	2010-04-24 10:10:50.000000000 +0000
-@@ -0,0 +1,112 @@
-+/* PA-RISC specific symbolic name handling.
-+   Copyright (C) 2002, 2005 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <elf.h>
-+#include <stddef.h>
-+
-+#define BACKEND		parisc_
-+#include "libebl_CPU.h"
-+
-+const char *
-+parisc_segment_type_name (int segment, char *buf __attribute__ ((unused)),
-+			size_t len __attribute__ ((unused)))
-+{
-+  switch (segment)
-+    {
-+    case PT_PARISC_ARCHEXT:
-+      return "PARISC_ARCHEXT";
-+    case PT_PARISC_UNWIND:
-+      return "PARISC_UNWIND";
-+    default:
-+      break;
-+    }
-+  return NULL;
-+}
-+
-+/* Return symbolic representation of symbol type.  */
-+const char *
-+parisc_symbol_type_name(int symbol, char *buf __attribute__ ((unused)),
-+    size_t len __attribute__ ((unused)))
-+{
-+	if (symbol == STT_PARISC_MILLICODE)
-+	  return "PARISC_MILLI";
-+	return NULL;
-+}
-+
-+/* Return symbolic representation of section type.  */
-+const char *
-+parisc_section_type_name (int type,
-+			char *buf __attribute__ ((unused)),
-+			size_t len __attribute__ ((unused)))
-+{
-+  switch (type)
-+    {
-+    case SHT_PARISC_EXT:
-+      return "PARISC_EXT";
-+    case SHT_PARISC_UNWIND:
-+      return "PARISC_UNWIND";
-+    case SHT_PARISC_DOC:
-+      return "PARISC_DOC";
-+    }
-+
-+  return NULL;
-+}
-+
-+/* Check whether machine flags are valid.  */
-+bool
-+parisc_machine_flag_check (GElf_Word flags)
-+{
-+  if (flags &~ (EF_PARISC_TRAPNIL | EF_PARISC_EXT | EF_PARISC_LSB |
-+	EF_PARISC_WIDE | EF_PARISC_NO_KABP |
-+	EF_PARISC_LAZYSWAP | EF_PARISC_ARCH))
-+    return 0;
-+
-+  GElf_Word arch = flags & EF_PARISC_ARCH;
-+
-+  return ((arch == EFA_PARISC_1_0) || (arch == EFA_PARISC_1_1) ||
-+      (arch == EFA_PARISC_2_0));
-+}
-+
-+/* Check for the simple reloc types.  */
-+Elf_Type
-+parisc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
-+{
-+  switch (type)
-+    {
-+    case R_PARISC_DIR64:
-+    case R_PARISC_SECREL64:
-+      return ELF_T_XWORD;
-+    case R_PARISC_DIR32:
-+    case R_PARISC_SECREL32:
-+      return ELF_T_WORD;
-+    default:
-+      return ELF_T_NUM;
-+    }
-+}
-Index: elfutils-0.146/backends/libebl_parisc.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/libebl_parisc.h	2010-04-24 10:10:50.000000000 +0000
-@@ -0,0 +1,9 @@
-+#ifndef _LIBEBL_HPPA_H
-+#define _LIBEBL_HPPA_H 1
-+
-+#include <libdw.h>
-+
-+extern int parisc_return_value_location_32(Dwarf_Die *, const Dwarf_Op **locp);
-+extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp);
-+
-+#endif
-Index: elfutils-0.146/backends/Makefile.am
-===================================================================
---- elfutils-0.146.orig/backends/Makefile.am	2010-04-24 10:10:41.000000000 +0000
-+++ elfutils-0.146/backends/Makefile.am	2010-04-24 10:10:50.000000000 +0000
-@@ -29,11 +29,11 @@
- 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
- 
- 
--modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390
-+modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc
- libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
- 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
- 	     libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
--	     libebl_s390_pic.a
-+	     libebl_s390_pic.a libebl_parisc_pic.a
- noinst_LIBRARIES = $(libebl_pic)
- noinst_DATA = $(libebl_pic:_pic.a=.so)
- 
-@@ -95,6 +95,9 @@
- libebl_s390_pic_a_SOURCES = $(s390_SRCS)
- am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
- 
-+parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
-+libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
-+am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
- 
- libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
- 	@rm -f $(@:.so=.map)
-Index: elfutils-0.146/libelf/elf.h
-===================================================================
---- elfutils-0.146.orig/libelf/elf.h	2010-04-13 20:08:02.000000000 +0000
-+++ elfutils-0.146/libelf/elf.h	2010-04-24 10:10:50.000000000 +0000
-@@ -1789,16 +1789,24 @@
- #define R_PARISC_PCREL17F	12	/* 17 bits of rel. address.  */
- #define R_PARISC_PCREL14R	14	/* Right 14 bits of rel. address.  */
- #define R_PARISC_DPREL21L	18	/* Left 21 bits of rel. address.  */
-+#define R_PARISC_DPREL14WR	19
-+#define R_PARISC_DPREL14DR	20
- #define R_PARISC_DPREL14R	22	/* Right 14 bits of rel. address.  */
- #define R_PARISC_GPREL21L	26	/* GP-relative, left 21 bits.  */
- #define R_PARISC_GPREL14R	30	/* GP-relative, right 14 bits.  */
- #define R_PARISC_LTOFF21L	34	/* LT-relative, left 21 bits.  */
- #define R_PARISC_LTOFF14R	38	/* LT-relative, right 14 bits.  */
-+#define R_PARISC_DLTIND14F	39
-+#define R_PARISC_SETBASE	40
- #define R_PARISC_SECREL32	41	/* 32 bits section rel. address.  */
-+#define R_PARISC_BASEREL21L	42
-+#define R_PARISC_BASEREL17R	43
-+#define R_PARISC_BASEREL14R	46
- #define R_PARISC_SEGBASE	48	/* No relocation, set segment base.  */
- #define R_PARISC_SEGREL32	49	/* 32 bits segment rel. address.  */
- #define R_PARISC_PLTOFF21L	50	/* PLT rel. address, left 21 bits.  */
- #define R_PARISC_PLTOFF14R	54	/* PLT rel. address, right 14 bits.  */
-+#define R_PARISC_PLTOFF14F	55
- #define R_PARISC_LTOFF_FPTR32	57	/* 32 bits LT-rel. function pointer. */
- #define R_PARISC_LTOFF_FPTR21L	58	/* LT-rel. fct ptr, left 21 bits. */
- #define R_PARISC_LTOFF_FPTR14R	62	/* LT-rel. fct ptr, right 14 bits. */
-@@ -1807,6 +1815,7 @@
- #define R_PARISC_PLABEL21L	66	/* Left 21 bits of fdesc address.  */
- #define R_PARISC_PLABEL14R	70	/* Right 14 bits of fdesc address.  */
- #define R_PARISC_PCREL64	72	/* 64 bits PC-rel. address.  */
-+#define R_PARISC_PCREL22C	73
- #define R_PARISC_PCREL22F	74	/* 22 bits PC-rel. address.  */
- #define R_PARISC_PCREL14WR	75	/* PC-rel. address, right 14 bits.  */
- #define R_PARISC_PCREL14DR	76	/* PC rel. address, right 14 bits.  */
-@@ -1832,6 +1841,8 @@
- #define R_PARISC_LTOFF16WF	102	/* 16 bits LT-rel. address.  */
- #define R_PARISC_LTOFF16DF	103	/* 16 bits LT-rel. address.  */
- #define R_PARISC_SECREL64	104	/* 64 bits section rel. address.  */
-+#define R_PARISC_BASEREL14WR	107
-+#define R_PARISC_BASEREL14DR	108
- #define R_PARISC_SEGREL64	112	/* 64 bits segment rel. address.  */
- #define R_PARISC_PLTOFF14WR	115	/* PLT-rel. address, right 14 bits.  */
- #define R_PARISC_PLTOFF14DR	116	/* PLT-rel. address, right 14 bits.  */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h
deleted file mode 100644
index a5cc01f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h
+++ /dev/null
@@ -1,1657 +0,0 @@
-#define MNEMONIC_BITS 10
-#define SUFFIX_BITS 3
-#define FCT1_BITS 7
-#define STR1_BITS 4
-#define OFF1_1_BITS 7
-#define OFF1_1_BIAS 3
-#define OFF1_2_BITS 7
-#define OFF1_2_BIAS 4
-#define OFF1_3_BITS 1
-#define OFF1_3_BIAS 7
-#define FCT2_BITS 6
-#define STR2_BITS 2
-#define OFF2_1_BITS 7
-#define OFF2_1_BIAS 5
-#define OFF2_2_BITS 7
-#define OFF2_2_BIAS 4
-#define OFF2_3_BITS 4
-#define OFF2_3_BIAS 7
-#define FCT3_BITS 4
-#define STR3_BITS 1
-#define OFF3_1_BITS 6
-#define OFF3_1_BIAS 10
-#define OFF3_2_BITS 1
-#define OFF3_2_BIAS 21
-
-#include <i386_data.h>
-
-#define suffix_none 0
-#define suffix_w 1
-#define suffix_w0 2
-#define suffix_W 3
-#define suffix_tttn 4
-#define suffix_D 7
-#define suffix_w1 5
-#define suffix_W1 6
-
-static const opfct_t op1_fct[] =
-{
-  NULL,
-  FCT_MOD$R_M,
-  FCT_Mod$R_m,
-  FCT_abs,
-  FCT_ax,
-  FCT_ax$w,
-  FCT_ccc,
-  FCT_ddd,
-  FCT_disp8,
-  FCT_ds_bx,
-  FCT_ds_si,
-  FCT_dx,
-  FCT_es_di,
-  FCT_freg,
-  FCT_imm$s,
-  FCT_imm$w,
-  FCT_imm16,
-  FCT_imm8,
-  FCT_imms8,
-  FCT_mmxreg,
-  FCT_mod$16r_m,
-  FCT_mod$64r_m,
-  FCT_mod$8r_m,
-  FCT_mod$r_m,
-  FCT_mod$r_m$w,
-  FCT_reg,
-  FCT_reg$w,
-  FCT_reg16,
-  FCT_reg64,
-  FCT_rel,
-  FCT_sel,
-  FCT_sreg2,
-  FCT_sreg3,
-  FCT_string,
-  FCT_xmmreg,
-};
-static const char op1_str[] =
-  "%ax\0"
-  "%cl\0"
-  "%eax\0"
-  "%st\0"
-  "%xmm0\0"
-  "*";
-static const uint8_t op1_str_idx[] = {
-  0,
-  4,
-  8,
-  13,
-  17,
-  23,
-};
-static const opfct_t op2_fct[] =
-{
-  NULL,
-  FCT_MOD$R_M,
-  FCT_Mod$R_m,
-  FCT_abs,
-  FCT_absval,
-  FCT_ax$w,
-  FCT_ccc,
-  FCT_ddd,
-  FCT_ds_si,
-  FCT_dx,
-  FCT_es_di,
-  FCT_freg,
-  FCT_imm8,
-  FCT_mmxreg,
-  FCT_mod$64r_m,
-  FCT_mod$r_m,
-  FCT_mod$r_m$w,
-  FCT_moda$r_m,
-  FCT_reg,
-  FCT_reg$w,
-  FCT_reg64,
-  FCT_sreg3,
-  FCT_string,
-  FCT_xmmreg,
-};
-static const char op2_str[] =
-  "%ecx\0"
-  "%st";
-static const uint8_t op2_str_idx[] = {
-  0,
-  5,
-};
-static const opfct_t op3_fct[] =
-{
-  NULL,
-  FCT_mmxreg,
-  FCT_mod$r_m,
-  FCT_reg,
-  FCT_string,
-  FCT_xmmreg,
-};
-static const char op3_str[] =
-  "%edx";
-static const uint8_t op3_str_idx[] = {
-  0,
-};
-static const struct instr_enc instrtab[] =
-{
-  { .mnemonic = MNE_aaa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_aad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_aam, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_aas, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_arpl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bound, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 17, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bsf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bswap, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lcall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 30, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 4, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lcall, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_clc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cli, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_syscall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_clts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sysret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sysenter, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sysexit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmov, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmps, .rep = 0, .repe = 1, .suffix = 1, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 8, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpxchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpxchg8b, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cpuid, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtdq2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_daa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_das, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_dec, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_dec, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_div, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_enter, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 19, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fabs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ftst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fxam, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fld1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldl2t, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldl2e, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldpi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldlg2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldln2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldz, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_f2xm1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fyl2x, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fptan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fpatan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fxtract, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fprem1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fprem, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fyl2xp1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsqrt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsincos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_frndint, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fscale, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsin, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnstenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnstcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fxch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_faddp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fiadd, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fmulp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fimul, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsubp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fisub, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsubrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fisubr, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 1, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fbld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fbstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_finit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovnb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovnbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovnu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcompp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fucomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fucomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fidivl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fidiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fidivrl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fidivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ffree, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ficom, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ficomp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fild, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fildl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fildll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fninit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fist, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fistp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fistpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fisttp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fisttpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fstpt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fucom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_frstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fucomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_hlt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_idiv, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 14, .str1 = 0, .off1_1 = 13, .off1_2 = 2, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_inc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_inc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ins, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_int, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_int3, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_into, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_invd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_swapgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_invlpg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_iret, .rep = 0, .repe = 0, .suffix = 6, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 30, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 4, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lar, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lds, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lea, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_leave, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_les, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lfs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lgdt, .rep = 0, .repe = 0, .suffix = 2, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lidt, .rep = 0, .repe = 0, .suffix = 2, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lmsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lock, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lods, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_loop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_loope, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_loopne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lsl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ltr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 3, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 35, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 37, .off1_2 = 3, .off1_3 = 0, .fct2 = 3, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 6, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 6, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 7, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 7, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movsbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movswl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movzbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movzwl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_neg, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pause, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_nop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_popcnt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_not, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_outs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_popf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 14, .str1 = 0, .off1_1 = 5, .off1_2 = 2, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pusha, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_popa, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pushf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rdmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rdpmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rdtsc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rsm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_scas, .rep = 0, .repe = 1, .suffix = 0, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
-  { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
-  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
-  { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
-  { .mnemonic = MNE_vmcall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmlaunch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmresume, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmxoff, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmread, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 28, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 14, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmwrite, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sgdtl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_monitor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 4, .str3 = 1, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sidtl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_smsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_stc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_std, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_stos, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_str, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ud2a, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_verr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_verw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_wbinvd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetchw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetchnta, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetcht0, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetcht1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetcht2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_nop, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_wrmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 4, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xlat, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 9, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpeqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpunordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpneqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpnltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpnleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpeqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpunordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpneqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpnltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpnless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fxrstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fxsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ldmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_stmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movddup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movsldup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_unpcklpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_unpcklps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_unpckhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_unpckhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movshdup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtsi2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtsi2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtpi2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtpi2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movntpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movntps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ucomisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ucomiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_comisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_comiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_getsec, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movmskpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movmskps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sqrtpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sqrtsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rsqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rsqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcpss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_orpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_orps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xorpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xorps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mulsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mulss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mulpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mulps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtsd2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtss2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtpd2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtps2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtdq2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_subsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_subss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_subpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_subps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_minsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_minss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_minpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_minps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_divsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_divss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_divpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_divps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maxss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maxpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maxps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpcklqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pshufd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_pshuflw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_pshufhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_pshufw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_haddpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_haddps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_hsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_hsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movnti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
-  { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
-  { .mnemonic = MNE_shufpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_shufps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movdq2q, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movq2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 19, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 19, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movntdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movntq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lddqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maskmovdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maskmovq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 19, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_vmclear, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmxon, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmptrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmptrst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pslldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_clflush, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_blendps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_blendpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_blendvps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_blendvpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_dpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_dppd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_insertps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_movntdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mpsadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_packusdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pblendvb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pblendw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpestri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpestrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpistri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpistrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phminposuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pinsrb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pinsrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmuldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ptest, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_roundps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_roundpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_roundss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_roundsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-};
-static const uint8_t match_data[] =
-{
-  0x11, 0x37,
-  0x22, 0xd5, 0xa,
-  0x22, 0xd4, 0xa,
-  0x11, 0x3f,
-  0x1, 0xfe, 0x14,
-  0x2, 0xfe, 0x80, 0x38, 0x10,
-  0x2, 0xfe, 0x82, 0x38, 0x10,
-  0x2, 0xfe, 0x10, 0, 0,
-  0x2, 0xfe, 0x12, 0, 0,
-  0x1, 0xfe, 0x4,
-  0x2, 0xfe, 0x80, 0x38, 0,
-  0x12, 0x83, 0x38, 0,
-  0x2, 0xfe, 0, 0, 0,
-  0x2, 0xfe, 0x2, 0, 0,
-  0x34, 0x66, 0xf, 0xd0, 0, 0,
-  0x34, 0xf2, 0xf, 0xd0, 0, 0,
-  0x1, 0xfe, 0x24,
-  0x2, 0xfe, 0x80, 0x38, 0x20,
-  0x2, 0xfe, 0x82, 0x38, 0x20,
-  0x2, 0xfe, 0x20, 0, 0,
-  0x2, 0xfe, 0x22, 0, 0,
-  0x34, 0x66, 0xf, 0x54, 0, 0,
-  0x23, 0xf, 0x54, 0, 0,
-  0x34, 0x66, 0xf, 0x55, 0, 0,
-  0x23, 0xf, 0x55, 0, 0,
-  0x12, 0x63, 0, 0,
-  0x12, 0x62, 0, 0,
-  0x23, 0xf, 0xbc, 0, 0,
-  0x23, 0xf, 0xbd, 0, 0,
-  0x12, 0xf, 0xf8, 0xc8,
-  0x23, 0xf, 0xa3, 0, 0,
-  0x23, 0xf, 0xba, 0x38, 0x20,
-  0x23, 0xf, 0xbb, 0, 0,
-  0x23, 0xf, 0xba, 0x38, 0x38,
-  0x23, 0xf, 0xb3, 0, 0,
-  0x23, 0xf, 0xba, 0x38, 0x30,
-  0x23, 0xf, 0xab, 0, 0,
-  0x23, 0xf, 0xba, 0x38, 0x28,
-  0x11, 0xe8,
-  0x12, 0xff, 0x38, 0x10,
-  0x11, 0x9a,
-  0x12, 0xff, 0x38, 0x18,
-  0x11, 0x98,
-  0x11, 0x99,
-  0x11, 0xf8,
-  0x11, 0xfc,
-  0x11, 0xfa,
-  0x22, 0xf, 0x5,
-  0x22, 0xf, 0x6,
-  0x22, 0xf, 0x7,
-  0x22, 0xf, 0x34,
-  0x22, 0xf, 0x35,
-  0x11, 0xf5,
-  0x13, 0xf, 0xf0, 0x40, 0, 0,
-  0x1, 0xfe, 0x3c,
-  0x2, 0xfe, 0x80, 0x38, 0x38,
-  0x12, 0x83, 0x38, 0x38,
-  0x2, 0xfe, 0x38, 0, 0,
-  0x2, 0xfe, 0x3a, 0, 0,
-  0x34, 0xf2, 0xf, 0xc2, 0, 0,
-  0x34, 0xf3, 0xf, 0xc2, 0, 0,
-  0x34, 0x66, 0xf, 0xc2, 0, 0,
-  0x23, 0xf, 0xc2, 0, 0,
-  0x1, 0xfe, 0xa6,
-  0x13, 0xf, 0xfe, 0xb0, 0, 0,
-  0x23, 0xf, 0xc7, 0x38, 0x8,
-  0x22, 0xf, 0xa2,
-  0x34, 0xf3, 0xf, 0xe6, 0, 0,
-  0x34, 0xf2, 0xf, 0xe6, 0, 0,
-  0x34, 0x66, 0xf, 0xe6, 0, 0,
-  0x11, 0x27,
-  0x11, 0x2f,
-  0x2, 0xfe, 0xfe, 0x38, 0x8,
-  0x1, 0xf8, 0x48,
-  0x2, 0xfe, 0xf6, 0x38, 0x30,
-  0x22, 0xf, 0x77,
-  0x11, 0xc8,
-  0x22, 0xd9, 0xd0,
-  0x22, 0xd9, 0xe0,
-  0x22, 0xd9, 0xe1,
-  0x22, 0xd9, 0xe4,
-  0x22, 0xd9, 0xe5,
-  0x22, 0xd9, 0xe8,
-  0x22, 0xd9, 0xe9,
-  0x22, 0xd9, 0xea,
-  0x22, 0xd9, 0xeb,
-  0x22, 0xd9, 0xec,
-  0x22, 0xd9, 0xed,
-  0x22, 0xd9, 0xee,
-  0x22, 0xd9, 0xf0,
-  0x22, 0xd9, 0xf1,
-  0x22, 0xd9, 0xf2,
-  0x22, 0xd9, 0xf3,
-  0x22, 0xd9, 0xf4,
-  0x22, 0xd9, 0xf5,
-  0x22, 0xd9, 0xf6,
-  0x22, 0xd9, 0xf7,
-  0x22, 0xd9, 0xf8,
-  0x22, 0xd9, 0xf9,
-  0x22, 0xd9, 0xfa,
-  0x22, 0xd9, 0xfb,
-  0x22, 0xd9, 0xfc,
-  0x22, 0xd9, 0xfd,
-  0x22, 0xd9, 0xfe,
-  0x22, 0xd9, 0xff,
-  0x12, 0xd8, 0xf8, 0xc0,
-  0x12, 0xdc, 0xf8, 0xc0,
-  0x2, 0xfb, 0xd8, 0x38, 0,
-  0x12, 0xd8, 0xf8, 0xc8,
-  0x12, 0xdc, 0xf8, 0xc8,
-  0x2, 0xfb, 0xd8, 0x38, 0x8,
-  0x12, 0xd8, 0xf8, 0xe0,
-  0x12, 0xdc, 0xf8, 0xe0,
-  0x2, 0xfb, 0xd8, 0x38, 0x20,
-  0x12, 0xd8, 0xf8, 0xe8,
-  0x12, 0xdc, 0xf8, 0xe8,
-  0x2, 0xfb, 0xd8, 0x38, 0x28,
-  0x12, 0xdd, 0xf8, 0xd0,
-  0x2, 0xfb, 0xd9, 0x38, 0x10,
-  0x12, 0xdd, 0xf8, 0xd8,
-  0x2, 0xfb, 0xd9, 0x38, 0x18,
-  0x12, 0xd9, 0x38, 0x20,
-  0x12, 0xd9, 0x38, 0x28,
-  0x12, 0xd9, 0x38, 0x30,
-  0x12, 0xd9, 0x38, 0x38,
-  0x12, 0xd9, 0xf8, 0xc8,
-  0x12, 0xde, 0xf8, 0xc0,
-  0x12, 0xda, 0xf8, 0xc0,
-  0x2, 0xfb, 0xda, 0x38, 0,
-  0x12, 0xda, 0xf8, 0xc8,
-  0x12, 0xde, 0xf8, 0xc8,
-  0x2, 0xfb, 0xda, 0x38, 0x8,
-  0x12, 0xde, 0xf8, 0xe0,
-  0x2, 0xfb, 0xda, 0x38, 0x20,
-  0x12, 0xde, 0xf8, 0xe8,
-  0x2, 0xfb, 0xda, 0x38, 0x28,
-  0x22, 0xdf, 0xe0,
-  0x12, 0xdf, 0x38, 0x20,
-  0x12, 0xdf, 0xf8, 0xf0,
-  0x12, 0xdf, 0x38, 0x30,
-  0x22, 0xd9, 0xe0,
-  0x33, 0x9b, 0xdb, 0xe2,
-  0x33, 0x9b, 0xdb, 0xe3,
-  0x11, 0x9b,
-  0x22, 0xdb, 0xe2,
-  0x12, 0xda, 0xf8, 0xc0,
-  0x12, 0xda, 0xf8, 0xc8,
-  0x12, 0xda, 0xf8, 0xd0,
-  0x12, 0xda, 0xf8, 0xd8,
-  0x12, 0xdb, 0xf8, 0xc0,
-  0x12, 0xdb, 0xf8, 0xc8,
-  0x12, 0xdb, 0xf8, 0xd0,
-  0x12, 0xdb, 0xf8, 0xd8,
-  0x12, 0xd8, 0xf8, 0xd0,
-  0x2, 0xfb, 0xd8, 0x38, 0x10,
-  0x12, 0xd8, 0xf8, 0xd8,
-  0x2, 0xfb, 0xd8, 0x38, 0x18,
-  0x22, 0xde, 0xd9,
-  0x12, 0xdb, 0xf8, 0xf0,
-  0x12, 0xdf, 0xf8, 0xf0,
-  0x12, 0xdb, 0xf8, 0xe8,
-  0x12, 0xdf, 0xf8, 0xe8,
-  0x22, 0xd9, 0xff,
-  0x22, 0xd9, 0xf6,
-  0x12, 0xd8, 0xf8, 0xf0,
-  0x12, 0xdc, 0xf8, 0xf0,
-  0x2, 0xfb, 0xd8, 0x38, 0x30,
-  0x12, 0xda, 0x38, 0x30,
-  0x12, 0xde, 0xf8, 0xf0,
-  0x12, 0xde, 0x38, 0x30,
-  0x12, 0xde, 0xf8, 0xf8,
-  0x12, 0xd8, 0xf8, 0xf8,
-  0x12, 0xdc, 0xf8, 0xf8,
-  0x2, 0xfb, 0xd8, 0x38, 0x38,
-  0x12, 0xda, 0x38, 0x38,
-  0x12, 0xde, 0x38, 0x38,
-  0x12, 0xde, 0xf8, 0xf0,
-  0x12, 0xdd, 0xf8, 0xc0,
-  0x12, 0xda, 0xf8, 0xd0,
-  0x2, 0xfb, 0xda, 0x38, 0x10,
-  0x12, 0xda, 0xf8, 0xd8,
-  0x2, 0xfb, 0xda, 0x38, 0x18,
-  0x12, 0xdf, 0x38, 0,
-  0x12, 0xdb, 0x38, 0,
-  0x12, 0xdf, 0x38, 0x28,
-  0x22, 0xd9, 0xf7,
-  0x22, 0xdb, 0xe3,
-  0x2, 0xfb, 0xdb, 0x38, 0x10,
-  0x2, 0xfb, 0xdb, 0x38, 0x18,
-  0x12, 0xdf, 0x38, 0x38,
-  0x2, 0xfb, 0xdb, 0x38, 0x8,
-  0x12, 0xdd, 0x38, 0x8,
-  0x12, 0xdb, 0x38, 0x28,
-  0x12, 0xdb, 0x38, 0x38,
-  0x12, 0xd9, 0xf8, 0xc0,
-  0x2, 0xfb, 0xd9, 0x38, 0,
-  0x12, 0xdd, 0xf8, 0xe0,
-  0x12, 0xdd, 0x38, 0x20,
-  0x12, 0xdd, 0xf8, 0xe8,
-  0x12, 0xdd, 0x38, 0x30,
-  0x12, 0xdd, 0x38, 0x38,
-  0x11, 0xf4,
-  0x2, 0xfe, 0xf6, 0x38, 0x38,
-  0x2, 0xfe, 0xf6, 0x38, 0x28,
-  0x23, 0xf, 0xaf, 0, 0,
-  0x2, 0xfd, 0x69, 0, 0,
-  0x1, 0xfe, 0xe4,
-  0x1, 0xfe, 0xec,
-  0x2, 0xfe, 0xfe, 0x38, 0,
-  0x1, 0xf8, 0x40,
-  0x1, 0xfe, 0x6c,
-  0x11, 0xcd,
-  0x11, 0xcc,
-  0x11, 0xce,
-  0x22, 0xf, 0x8,
-  0x33, 0xf, 0x1, 0xf8,
-  0x23, 0xf, 0x1, 0x38, 0x38,
-  0x11, 0xcf,
-  0x1, 0xf0, 0x70,
-  0x12, 0xf, 0xf0, 0x80,
-  0x13, 0xf, 0xf0, 0x90, 0x38, 0,
-  0x11, 0xe3,
-  0x11, 0xeb,
-  0x11, 0xe9,
-  0x12, 0xff, 0x38, 0x20,
-  0x11, 0xea,
-  0x12, 0xff, 0x38, 0x28,
-  0x11, 0x9f,
-  0x23, 0xf, 0x2, 0, 0,
-  0x12, 0xc5, 0, 0,
-  0x12, 0x8d, 0, 0,
-  0x11, 0xc9,
-  0x12, 0xc4, 0, 0,
-  0x23, 0xf, 0xb4, 0, 0,
-  0x23, 0xf, 0xb5, 0, 0,
-  0x23, 0xf, 0x1, 0x38, 0x10,
-  0x23, 0xf, 0x1, 0x38, 0x18,
-  0x23, 0xf, 0, 0x38, 0x10,
-  0x23, 0xf, 0x1, 0x38, 0x30,
-  0x11, 0xf0,
-  0x1, 0xfe, 0xac,
-  0x11, 0xe2,
-  0x11, 0xe1,
-  0x11, 0xe0,
-  0x23, 0xf, 0x3, 0, 0,
-  0x23, 0xf, 0xb2, 0, 0,
-  0x23, 0xf, 0, 0x38, 0x18,
-  0x2, 0xfe, 0x88, 0, 0,
-  0x2, 0xfe, 0x8a, 0, 0,
-  0x2, 0xfe, 0xc6, 0x38, 0,
-  0x1, 0xf0, 0xb0,
-  0x1, 0xfe, 0xa0,
-  0x1, 0xfe, 0xa2,
-  0x23, 0xf, 0x20, 0xc0, 0xc0,
-  0x23, 0xf, 0x22, 0xc0, 0xc0,
-  0x23, 0xf, 0x21, 0xc0, 0xc0,
-  0x23, 0xf, 0x23, 0xc0, 0xc0,
-  0x12, 0x8c, 0, 0,
-  0x12, 0x8e, 0, 0,
-  0x1, 0xfe, 0xa4,
-  0x23, 0xf, 0xbe, 0, 0,
-  0x23, 0xf, 0xbf, 0, 0,
-  0x23, 0xf, 0xb6, 0, 0,
-  0x23, 0xf, 0xb7, 0, 0,
-  0x2, 0xfe, 0xf6, 0x38, 0x20,
-  0x2, 0xfe, 0xf6, 0x38, 0x18,
-  0x22, 0xf3, 0x90,
-  0x11, 0x90,
-  0x34, 0xf3, 0xf, 0xb8, 0, 0,
-  0x2, 0xfe, 0xf6, 0x38, 0x10,
-  0x2, 0xfe, 0x8, 0, 0,
-  0x2, 0xfe, 0xa, 0, 0,
-  0x2, 0xfe, 0x80, 0x38, 0x8,
-  0x2, 0xfe, 0x82, 0x38, 0x8,
-  0x1, 0xfe, 0xc,
-  0x1, 0xfe, 0xe6,
-  0x1, 0xfe, 0xee,
-  0x1, 0xfe, 0x6e,
-  0x12, 0x8f, 0x38, 0,
-  0x12, 0xf, 0xc7, 0x81,
-  0x11, 0x9d,
-  0x12, 0xff, 0x38, 0x30,
-  0x1, 0xf8, 0x50,
-  0x1, 0xf8, 0x58,
-  0x1, 0xfd, 0x68,
-  0x1, 0xe7, 0x6,
-  0x12, 0xf, 0xc7, 0x80,
-  0x11, 0x60,
-  0x11, 0x61,
-  0x11, 0x9c,
-  0x2, 0xfe, 0xd0, 0x38, 0x10,
-  0x2, 0xfe, 0xd2, 0x38, 0x10,
-  0x2, 0xfe, 0xc0, 0x38, 0x10,
-  0x2, 0xfe, 0xd0, 0x38, 0x18,
-  0x2, 0xfe, 0xd2, 0x38, 0x18,
-  0x2, 0xfe, 0xc0, 0x38, 0x18,
-  0x22, 0xf, 0x32,
-  0x22, 0xf, 0x33,
-  0x22, 0xf, 0x31,
-  0x11, 0xc3,
-  0x11, 0xc2,
-  0x11, 0xcb,
-  0x11, 0xca,
-  0x2, 0xfe, 0xd0, 0x38, 0,
-  0x2, 0xfe, 0xd2, 0x38, 0,
-  0x2, 0xfe, 0xc0, 0x38, 0,
-  0x2, 0xfe, 0xd0, 0x38, 0x8,
-  0x2, 0xfe, 0xd2, 0x38, 0x8,
-  0x2, 0xfe, 0xc0, 0x38, 0x8,
-  0x22, 0xf, 0xaa,
-  0x11, 0x9e,
-  0x2, 0xfe, 0xd0, 0x38, 0x38,
-  0x2, 0xfe, 0xd2, 0x38, 0x38,
-  0x2, 0xfe, 0xc0, 0x38, 0x38,
-  0x2, 0xfe, 0x18, 0, 0,
-  0x2, 0xfe, 0x1a, 0, 0,
-  0x1, 0xfe, 0x1c,
-  0x2, 0xfe, 0x80, 0x38, 0x18,
-  0x2, 0xfe, 0x82, 0x38, 0x18,
-  0x1, 0xfe, 0xae,
-  0x13, 0xf, 0xf0, 0x90, 0x38, 0,
-  0x2, 0xfe, 0xd0, 0x38, 0x20,
-  0x2, 0xfe, 0xd2, 0x38, 0x20,
-  0x2, 0xfe, 0xc0, 0x38, 0x20,
-  0x2, 0xfe, 0xd0, 0x38, 0x28,
-  0x23, 0xf, 0xa4, 0, 0,
-  0x23, 0xf, 0xa5, 0, 0,
-  0x2, 0xfe, 0xd2, 0x38, 0x28,
-  0x2, 0xfe, 0xc0, 0x38, 0x28,
-  0x23, 0xf, 0xac, 0, 0,
-  0x23, 0xf, 0xad, 0, 0,
-  0x33, 0xf, 0x1, 0xc1,
-  0x33, 0xf, 0x1, 0xc2,
-  0x33, 0xf, 0x1, 0xc3,
-  0x33, 0xf, 0x1, 0xc4,
-  0x23, 0xf, 0x78, 0, 0,
-  0x23, 0xf, 0x79, 0, 0,
-  0x23, 0xf, 0x1, 0x38, 0,
-  0x33, 0xf, 0x1, 0xc8,
-  0x33, 0xf, 0x1, 0xc9,
-  0x23, 0xf, 0x1, 0x38, 0x8,
-  0x23, 0xf, 0, 0x38, 0,
-  0x23, 0xf, 0x1, 0x38, 0x20,
-  0x11, 0xf9,
-  0x11, 0xfd,
-  0x11, 0xfb,
-  0x1, 0xfe, 0xaa,
-  0x23, 0xf, 0, 0x38, 0x8,
-  0x2, 0xfe, 0x28, 0, 0,
-  0x2, 0xfe, 0x2a, 0, 0,
-  0x1, 0xfe, 0x2c,
-  0x2, 0xfe, 0x80, 0x38, 0x28,
-  0x2, 0xfe, 0x82, 0x38, 0x28,
-  0x2, 0xfe, 0x84, 0, 0,
-  0x1, 0xfe, 0xa8,
-  0x2, 0xfe, 0xf6, 0x38, 0,
-  0x22, 0xf, 0xb,
-  0x23, 0xf, 0, 0x38, 0x20,
-  0x23, 0xf, 0, 0x38, 0x28,
-  0x22, 0xf, 0x9,
-  0x23, 0xf, 0xd, 0x38, 0,
-  0x23, 0xf, 0xd, 0x38, 0x8,
-  0x23, 0xf, 0x18, 0x38, 0,
-  0x23, 0xf, 0x18, 0x38, 0x8,
-  0x23, 0xf, 0x18, 0x38, 0x10,
-  0x23, 0xf, 0x18, 0x38, 0x18,
-  0x23, 0xf, 0x1f, 0, 0,
-  0x22, 0xf, 0x30,
-  0x13, 0xf, 0xfe, 0xc0, 0, 0,
-  0x2, 0xfe, 0x86, 0, 0,
-  0x1, 0xf8, 0x90,
-  0x11, 0xd7,
-  0x2, 0xfe, 0x30, 0, 0,
-  0x2, 0xfe, 0x32, 0, 0,
-  0x1, 0xfe, 0x34,
-  0x2, 0xfe, 0x80, 0x38, 0x30,
-  0x2, 0xfe, 0x82, 0x38, 0x30,
-  0x22, 0xf, 0x77,
-  0x34, 0x66, 0xf, 0xdb, 0, 0,
-  0x23, 0xf, 0xdb, 0, 0,
-  0x34, 0x66, 0xf, 0xdf, 0, 0,
-  0x23, 0xf, 0xdf, 0, 0,
-  0x34, 0x66, 0xf, 0xf5, 0, 0,
-  0x23, 0xf, 0xf5, 0, 0,
-  0x34, 0x66, 0xf, 0xeb, 0, 0,
-  0x23, 0xf, 0xeb, 0, 0,
-  0x34, 0x66, 0xf, 0xef, 0, 0,
-  0x23, 0xf, 0xef, 0, 0,
-  0x23, 0xf, 0x55, 0, 0,
-  0x23, 0xf, 0x54, 0, 0,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x1,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x2,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x3,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x4,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x5,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x6,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x7,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x1,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x2,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x3,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x4,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x5,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x6,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x7,
-  0x23, 0xf, 0xae, 0x38, 0x8,
-  0x23, 0xf, 0xae, 0x38, 0,
-  0x23, 0xf, 0xae, 0x38, 0x10,
-  0x23, 0xf, 0xae, 0x38, 0x18,
-  0x34, 0xf2, 0xf, 0x10, 0, 0,
-  0x34, 0xf3, 0xf, 0x10, 0, 0,
-  0x34, 0x66, 0xf, 0x10, 0, 0,
-  0x23, 0xf, 0x10, 0, 0,
-  0x34, 0xf2, 0xf, 0x11, 0, 0,
-  0x34, 0xf3, 0xf, 0x11, 0, 0,
-  0x34, 0x66, 0xf, 0x11, 0, 0,
-  0x23, 0xf, 0x11, 0, 0,
-  0x34, 0xf2, 0xf, 0x12, 0, 0,
-  0x34, 0xf3, 0xf, 0x12, 0, 0,
-  0x34, 0x66, 0xf, 0x12, 0, 0,
-  0x23, 0xf, 0x12, 0xc0, 0xc0,
-  0x23, 0xf, 0x12, 0, 0,
-  0x34, 0x66, 0xf, 0x13, 0xc0, 0xc0,
-  0x23, 0xf, 0x13, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0x13, 0, 0,
-  0x23, 0xf, 0x13, 0, 0,
-  0x34, 0x66, 0xf, 0x14, 0, 0,
-  0x23, 0xf, 0x14, 0, 0,
-  0x34, 0x66, 0xf, 0x15, 0, 0,
-  0x23, 0xf, 0x15, 0, 0,
-  0x34, 0xf3, 0xf, 0x16, 0, 0,
-  0x34, 0x66, 0xf, 0x16, 0, 0,
-  0x23, 0xf, 0x16, 0xc0, 0xc0,
-  0x23, 0xf, 0x16, 0, 0,
-  0x34, 0x66, 0xf, 0x17, 0xc0, 0xc0,
-  0x23, 0xf, 0x17, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0x17, 0, 0,
-  0x23, 0xf, 0x17, 0, 0,
-  0x34, 0x66, 0xf, 0x28, 0, 0,
-  0x23, 0xf, 0x28, 0, 0,
-  0x34, 0x66, 0xf, 0x29, 0, 0,
-  0x23, 0xf, 0x29, 0, 0,
-  0x34, 0xf2, 0xf, 0x2a, 0, 0,
-  0x34, 0xf3, 0xf, 0x2a, 0, 0,
-  0x34, 0x66, 0xf, 0x2a, 0, 0,
-  0x23, 0xf, 0x2a, 0, 0,
-  0x34, 0x66, 0xf, 0x2b, 0, 0,
-  0x23, 0xf, 0x2b, 0, 0,
-  0x34, 0xf2, 0xf, 0x2c, 0, 0,
-  0x34, 0xf3, 0xf, 0x2c, 0, 0,
-  0x34, 0x66, 0xf, 0x2c, 0, 0,
-  0x23, 0xf, 0x2c, 0, 0,
-  0x34, 0x66, 0xf, 0x2d, 0, 0,
-  0x34, 0xf2, 0xf, 0x2d, 0, 0,
-  0x34, 0xf3, 0xf, 0x2d, 0, 0,
-  0x23, 0xf, 0x2d, 0, 0,
-  0x34, 0x66, 0xf, 0x2e, 0, 0,
-  0x23, 0xf, 0x2e, 0, 0,
-  0x34, 0x66, 0xf, 0x2f, 0, 0,
-  0x23, 0xf, 0x2f, 0, 0,
-  0x22, 0xf, 0x37,
-  0x34, 0x66, 0xf, 0x50, 0xc0, 0xc0,
-  0x23, 0xf, 0x50, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0x51, 0, 0,
-  0x34, 0xf2, 0xf, 0x51, 0, 0,
-  0x34, 0xf3, 0xf, 0x51, 0, 0,
-  0x23, 0xf, 0x51, 0, 0,
-  0x34, 0xf3, 0xf, 0x52, 0, 0,
-  0x23, 0xf, 0x52, 0, 0,
-  0x34, 0xf3, 0xf, 0x53, 0, 0,
-  0x23, 0xf, 0x53, 0, 0,
-  0x34, 0x66, 0xf, 0x54, 0, 0,
-  0x23, 0xf, 0x54, 0, 0,
-  0x34, 0x66, 0xf, 0x55, 0, 0,
-  0x23, 0xf, 0x55, 0, 0,
-  0x34, 0x66, 0xf, 0x56, 0, 0,
-  0x23, 0xf, 0x56, 0, 0,
-  0x34, 0x66, 0xf, 0x57, 0, 0,
-  0x23, 0xf, 0x57, 0, 0,
-  0x34, 0xf2, 0xf, 0x58, 0, 0,
-  0x34, 0xf3, 0xf, 0x58, 0, 0,
-  0x34, 0x66, 0xf, 0x58, 0, 0,
-  0x23, 0xf, 0x58, 0, 0,
-  0x34, 0xf2, 0xf, 0x59, 0, 0,
-  0x34, 0xf3, 0xf, 0x59, 0, 0,
-  0x34, 0x66, 0xf, 0x59, 0, 0,
-  0x23, 0xf, 0x59, 0, 0,
-  0x34, 0xf2, 0xf, 0x5a, 0, 0,
-  0x34, 0xf3, 0xf, 0x5a, 0, 0,
-  0x34, 0x66, 0xf, 0x5a, 0, 0,
-  0x23, 0xf, 0x5a, 0, 0,
-  0x34, 0x66, 0xf, 0x5b, 0, 0,
-  0x34, 0xf3, 0xf, 0x5b, 0, 0,
-  0x23, 0xf, 0x5b, 0, 0,
-  0x34, 0xf2, 0xf, 0x5c, 0, 0,
-  0x34, 0xf3, 0xf, 0x5c, 0, 0,
-  0x34, 0x66, 0xf, 0x5c, 0, 0,
-  0x23, 0xf, 0x5c, 0, 0,
-  0x34, 0xf2, 0xf, 0x5d, 0, 0,
-  0x34, 0xf3, 0xf, 0x5d, 0, 0,
-  0x34, 0x66, 0xf, 0x5d, 0, 0,
-  0x23, 0xf, 0x5d, 0, 0,
-  0x34, 0xf2, 0xf, 0x5e, 0, 0,
-  0x34, 0xf3, 0xf, 0x5e, 0, 0,
-  0x34, 0x66, 0xf, 0x5e, 0, 0,
-  0x23, 0xf, 0x5e, 0, 0,
-  0x34, 0xf2, 0xf, 0x5f, 0, 0,
-  0x34, 0xf3, 0xf, 0x5f, 0, 0,
-  0x34, 0x66, 0xf, 0x5f, 0, 0,
-  0x23, 0xf, 0x5f, 0, 0,
-  0x34, 0x66, 0xf, 0x60, 0, 0,
-  0x23, 0xf, 0x60, 0, 0,
-  0x34, 0x66, 0xf, 0x61, 0, 0,
-  0x23, 0xf, 0x61, 0, 0,
-  0x34, 0x66, 0xf, 0x62, 0, 0,
-  0x23, 0xf, 0x62, 0, 0,
-  0x34, 0x66, 0xf, 0x63, 0, 0,
-  0x23, 0xf, 0x63, 0, 0,
-  0x34, 0x66, 0xf, 0x64, 0, 0,
-  0x23, 0xf, 0x64, 0, 0,
-  0x34, 0x66, 0xf, 0x65, 0, 0,
-  0x23, 0xf, 0x65, 0, 0,
-  0x34, 0x66, 0xf, 0x66, 0, 0,
-  0x23, 0xf, 0x66, 0, 0,
-  0x34, 0x66, 0xf, 0x67, 0, 0,
-  0x23, 0xf, 0x67, 0, 0,
-  0x34, 0x66, 0xf, 0x68, 0, 0,
-  0x23, 0xf, 0x68, 0, 0,
-  0x34, 0x66, 0xf, 0x69, 0, 0,
-  0x23, 0xf, 0x69, 0, 0,
-  0x34, 0x66, 0xf, 0x6a, 0, 0,
-  0x23, 0xf, 0x6a, 0, 0,
-  0x34, 0x66, 0xf, 0x6b, 0, 0,
-  0x23, 0xf, 0x6b, 0, 0,
-  0x34, 0x66, 0xf, 0x6c, 0, 0,
-  0x34, 0x66, 0xf, 0x6d, 0, 0,
-  0x34, 0x66, 0xf, 0x6e, 0, 0,
-  0x23, 0xf, 0x6e, 0, 0,
-  0x34, 0x66, 0xf, 0x6f, 0, 0,
-  0x34, 0xf3, 0xf, 0x6f, 0, 0,
-  0x23, 0xf, 0x6f, 0, 0,
-  0x34, 0x66, 0xf, 0x70, 0, 0,
-  0x34, 0xf2, 0xf, 0x70, 0, 0,
-  0x34, 0xf3, 0xf, 0x70, 0, 0,
-  0x23, 0xf, 0x70, 0, 0,
-  0x34, 0x66, 0xf, 0x74, 0, 0,
-  0x23, 0xf, 0x74, 0, 0,
-  0x34, 0x66, 0xf, 0x75, 0, 0,
-  0x23, 0xf, 0x75, 0, 0,
-  0x34, 0x66, 0xf, 0x76, 0, 0,
-  0x23, 0xf, 0x76, 0, 0,
-  0x34, 0x66, 0xf, 0x7c, 0, 0,
-  0x34, 0xf2, 0xf, 0x7c, 0, 0,
-  0x34, 0x66, 0xf, 0x7d, 0, 0,
-  0x34, 0xf2, 0xf, 0x7d, 0, 0,
-  0x34, 0x66, 0xf, 0x7e, 0, 0,
-  0x34, 0xf3, 0xf, 0x7e, 0, 0,
-  0x23, 0xf, 0x7e, 0, 0,
-  0x34, 0x66, 0xf, 0x7f, 0, 0,
-  0x34, 0xf3, 0xf, 0x7f, 0, 0,
-  0x23, 0xf, 0x7f, 0, 0,
-  0x23, 0xf, 0xc3, 0, 0,
-  0x34, 0x66, 0xf, 0xc4, 0, 0,
-  0x23, 0xf, 0xc4, 0, 0,
-  0x34, 0x66, 0xf, 0xc5, 0xc0, 0xc0,
-  0x23, 0xf, 0xc5, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0xc6, 0, 0,
-  0x23, 0xf, 0xc6, 0, 0,
-  0x34, 0x66, 0xf, 0xd1, 0, 0,
-  0x23, 0xf, 0xd1, 0, 0,
-  0x34, 0x66, 0xf, 0xd2, 0, 0,
-  0x23, 0xf, 0xd2, 0, 0,
-  0x34, 0x66, 0xf, 0xd3, 0, 0,
-  0x23, 0xf, 0xd3, 0, 0,
-  0x34, 0x66, 0xf, 0xd4, 0, 0,
-  0x23, 0xf, 0xd4, 0, 0,
-  0x34, 0x66, 0xf, 0xd5, 0, 0,
-  0x23, 0xf, 0xd5, 0, 0,
-  0x34, 0x66, 0xf, 0xd6, 0, 0,
-  0x34, 0xf2, 0xf, 0xd6, 0xc0, 0xc0,
-  0x34, 0xf3, 0xf, 0xd6, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0xd7, 0xc0, 0xc0,
-  0x23, 0xf, 0xd7, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0xd8, 0, 0,
-  0x23, 0xf, 0xd8, 0, 0,
-  0x34, 0x66, 0xf, 0xd9, 0, 0,
-  0x23, 0xf, 0xd9, 0, 0,
-  0x34, 0x66, 0xf, 0xda, 0, 0,
-  0x23, 0xf, 0xda, 0, 0,
-  0x34, 0x66, 0xf, 0xdc, 0, 0,
-  0x23, 0xf, 0xdc, 0, 0,
-  0x34, 0x66, 0xf, 0xdd, 0, 0,
-  0x23, 0xf, 0xdd, 0, 0,
-  0x34, 0x66, 0xf, 0xde, 0, 0,
-  0x23, 0xf, 0xde, 0, 0,
-  0x34, 0x66, 0xf, 0xe0, 0, 0,
-  0x23, 0xf, 0xe0, 0, 0,
-  0x34, 0x66, 0xf, 0xe1, 0, 0,
-  0x23, 0xf, 0xe1, 0, 0,
-  0x34, 0x66, 0xf, 0xe2, 0, 0,
-  0x23, 0xf, 0xe2, 0, 0,
-  0x34, 0x66, 0xf, 0xe3, 0, 0,
-  0x23, 0xf, 0xe3, 0, 0,
-  0x34, 0x66, 0xf, 0xe4, 0, 0,
-  0x23, 0xf, 0xe4, 0, 0,
-  0x34, 0x66, 0xf, 0xe5, 0, 0,
-  0x23, 0xf, 0xe5, 0, 0,
-  0x34, 0x66, 0xf, 0xe7, 0, 0,
-  0x23, 0xf, 0xe7, 0, 0,
-  0x34, 0x66, 0xf, 0xe8, 0, 0,
-  0x23, 0xf, 0xe8, 0, 0,
-  0x34, 0x66, 0xf, 0xe9, 0, 0,
-  0x23, 0xf, 0xe9, 0, 0,
-  0x34, 0x66, 0xf, 0xea, 0, 0,
-  0x23, 0xf, 0xea, 0, 0,
-  0x34, 0x66, 0xf, 0xec, 0, 0,
-  0x23, 0xf, 0xec, 0, 0,
-  0x34, 0x66, 0xf, 0xed, 0, 0,
-  0x23, 0xf, 0xed, 0, 0,
-  0x34, 0x66, 0xf, 0xee, 0, 0,
-  0x23, 0xf, 0xee, 0, 0,
-  0x34, 0xf2, 0xf, 0xf0, 0, 0,
-  0x34, 0x66, 0xf, 0xf1, 0, 0,
-  0x23, 0xf, 0xf1, 0, 0,
-  0x34, 0x66, 0xf, 0xf2, 0, 0,
-  0x23, 0xf, 0xf2, 0, 0,
-  0x34, 0x66, 0xf, 0xf3, 0, 0,
-  0x23, 0xf, 0xf3, 0, 0,
-  0x34, 0x66, 0xf, 0xf4, 0, 0,
-  0x23, 0xf, 0xf4, 0, 0,
-  0x34, 0x66, 0xf, 0xf6, 0, 0,
-  0x23, 0xf, 0xf6, 0, 0,
-  0x34, 0x66, 0xf, 0xf7, 0xc0, 0xc0,
-  0x23, 0xf, 0xf7, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0xf8, 0, 0,
-  0x23, 0xf, 0xf8, 0, 0,
-  0x34, 0x66, 0xf, 0xf9, 0, 0,
-  0x23, 0xf, 0xf9, 0, 0,
-  0x34, 0x66, 0xf, 0xfa, 0, 0,
-  0x23, 0xf, 0xfa, 0, 0,
-  0x34, 0x66, 0xf, 0xfb, 0, 0,
-  0x23, 0xf, 0xfb, 0, 0,
-  0x34, 0x66, 0xf, 0xfc, 0, 0,
-  0x23, 0xf, 0xfc, 0, 0,
-  0x34, 0x66, 0xf, 0xfd, 0, 0,
-  0x23, 0xf, 0xfd, 0, 0,
-  0x34, 0x66, 0xf, 0xfe, 0, 0,
-  0x23, 0xf, 0xfe, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0, 0, 0,
-  0x34, 0xf, 0x38, 0, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x1, 0, 0,
-  0x34, 0xf, 0x38, 0x1, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x2, 0, 0,
-  0x34, 0xf, 0x38, 0x2, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3, 0, 0,
-  0x34, 0xf, 0x38, 0x3, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x4, 0, 0,
-  0x34, 0xf, 0x38, 0x4, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x5, 0, 0,
-  0x34, 0xf, 0x38, 0x5, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x6, 0, 0,
-  0x34, 0xf, 0x38, 0x6, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x7, 0, 0,
-  0x34, 0xf, 0x38, 0x7, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x8, 0, 0,
-  0x34, 0xf, 0x38, 0x8, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x9, 0, 0,
-  0x34, 0xf, 0x38, 0x9, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0xa, 0, 0,
-  0x34, 0xf, 0x38, 0xa, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0xb, 0, 0,
-  0x34, 0xf, 0x38, 0xb, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x1c, 0, 0,
-  0x34, 0xf, 0x38, 0x1c, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x1d, 0, 0,
-  0x34, 0xf, 0x38, 0x1d, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x1e, 0, 0,
-  0x34, 0xf, 0x38, 0x1e, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xf, 0, 0,
-  0x34, 0xf, 0x3a, 0xf, 0, 0,
-  0x34, 0x66, 0xf, 0xc7, 0x38, 0x30,
-  0x34, 0xf3, 0xf, 0xc7, 0x38, 0x30,
-  0x23, 0xf, 0xc7, 0x38, 0x30,
-  0x23, 0xf, 0xc7, 0x38, 0x38,
-  0x34, 0x66, 0xf, 0x71, 0xf8, 0xd0,
-  0x23, 0xf, 0x71, 0xf8, 0xd0,
-  0x34, 0x66, 0xf, 0x71, 0xf8, 0xe0,
-  0x23, 0xf, 0x71, 0xf8, 0xe0,
-  0x34, 0x66, 0xf, 0x71, 0xf8, 0xf0,
-  0x23, 0xf, 0x71, 0xf8, 0xf0,
-  0x34, 0x66, 0xf, 0x72, 0xf8, 0xd0,
-  0x23, 0xf, 0x72, 0xf8, 0xd0,
-  0x34, 0x66, 0xf, 0x72, 0xf8, 0xe0,
-  0x23, 0xf, 0x72, 0xf8, 0xe0,
-  0x34, 0x66, 0xf, 0x72, 0xf8, 0xf0,
-  0x23, 0xf, 0x72, 0xf8, 0xf0,
-  0x34, 0x66, 0xf, 0x73, 0xf8, 0xd0,
-  0x23, 0xf, 0x73, 0xf8, 0xd0,
-  0x34, 0x66, 0xf, 0x73, 0xf8, 0xd8,
-  0x34, 0x66, 0xf, 0x73, 0xf8, 0xf0,
-  0x23, 0xf, 0x73, 0xf8, 0xf0,
-  0x34, 0x66, 0xf, 0x73, 0xf8, 0xf8,
-  0x33, 0xf, 0xae, 0xe8,
-  0x33, 0xf, 0xae, 0xf0,
-  0x33, 0xf, 0xae, 0xf8,
-  0x23, 0xf, 0xae, 0x38, 0x38,
-  0x23, 0xf, 0xf, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xc, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xd, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x14, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x15, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x40, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x41, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x21, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x2a, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x42, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x2b, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x10, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xe, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x29, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x61, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x60, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x63, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x62, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x37, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x41, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x20, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x22, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3c, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3d, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3f, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3e, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x38, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x39, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3b, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3a, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x20, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x21, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x22, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x23, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x24, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x25, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x30, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x31, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x32, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x33, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x34, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x35, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x28, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x40, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x17, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x8, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x9, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xa, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xb, 0, 0,
-  0x1, 0xe7, 0x7,
-};
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff
deleted file mode 100644
index 5b621f9..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff
+++ /dev/null
@@ -1,309 +0,0 @@
-Upstream-Status: Backport
-
-Index: elfutils-0.146/backends/m68k_init.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/m68k_init.c	2010-04-24 10:11:38.000000000 +0000
-@@ -0,0 +1,49 @@
-+/* Initialization of m68k specific backend library.
-+   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
-+
-+   This software is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   This softare is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with this software; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+*/
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#define BACKEND		m68k_
-+#define RELOC_PREFIX	R_68K_
-+#include "libebl_CPU.h"
-+
-+/* This defines the common reloc hooks based on m68k_reloc.def.  */
-+#include "common-reloc.c"
-+
-+
-+const char *
-+m68k_init (elf, machine, eh, ehlen)
-+     Elf *elf __attribute__ ((unused));
-+     GElf_Half machine __attribute__ ((unused));
-+     Ebl *eh;
-+     size_t ehlen;
-+{
-+  /* Check whether the Elf_BH object has a sufficent size.  */
-+  if (ehlen < sizeof (Ebl))
-+    return NULL;
-+
-+  /* We handle it.  */
-+  eh->name = "m68k";
-+  m68k_init_reloc (eh);
-+  HOOK (eh, reloc_simple_type);
-+  HOOK (eh, register_info);
-+
-+  return MODVERSION;
-+}
-Index: elfutils-0.146/backends/m68k_regs.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/m68k_regs.c	2010-04-24 10:11:38.000000000 +0000
-@@ -0,0 +1,106 @@
-+/* Register names and numbers for m68k DWARF.
-+   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
-+
-+   This software is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   This software is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with this software; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <string.h>
-+#include <dwarf.h>
-+
-+#define BACKEND m68k_
-+#include "libebl_CPU.h"
-+
-+ssize_t
-+m68k_register_info (Ebl *ebl __attribute__ ((unused)),
-+		   int regno, char *name, size_t namelen,
-+		   const char **prefix, const char **setname,
-+		   int *bits, int *type)
-+{
-+	if (name == NULL)
-+		return 25;
-+
-+	if (regno < 0 || regno > 24 || namelen < 5)
-+		return -1;
-+
-+	*prefix = "%";
-+	*bits = 32;
-+	*type = (regno < 8 ? DW_ATE_signed
-+		: regno < 16 ? DW_ATE_address : DW_ATE_float);
-+
-+	if (regno < 8)
-+	{
-+		*setname = "integer";
-+	}
-+	else if (regno < 16)
-+	{
-+		*setname = "address";
-+	}
-+	else if (regno < 24)
-+	{
-+		*setname = "FPU";
-+	}
-+	else
-+	{
-+		*setname = "address";
-+		*type = DW_ATE_address;
-+	}
-+
-+	switch (regno)
-+	{
-+	case 0 ... 7:
-+		name[0] = 'd';
-+		name[1] = regno + '0';
-+		namelen = 2;
-+		break;
-+
-+	case 8 ... 13:
-+		name[0] = 'a';
-+		name[1] = regno - 8 + '0';
-+		namelen = 2;
-+		break;
-+
-+	case 14:
-+		name[0] = 'f';
-+		name[1] = 'p';
-+   		namelen = 2;
-+		break;
-+
-+	case 15:
-+		name[0] = 's';
-+		name[1] = 'p';
-+   		namelen = 2;
-+		break;
-+
-+	case 16 ... 23:
-+		name[0] = 'f';
-+		name[1] = 'p';
-+		name[2] = regno - 16 + '0';
-+   		namelen = 3;
-+		break;
-+
-+	case 24:
-+		name[0] = 'p';
-+		name[1] = 'c';
-+		namelen = 2;
-+	}
-+
-+	name[namelen++] = '\0';
-+	return namelen;
-+}
-+
-Index: elfutils-0.146/backends/m68k_reloc.def
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/m68k_reloc.def	2010-04-24 10:11:38.000000000 +0000
-@@ -0,0 +1,45 @@
-+/* List the relocation types for m68k.  -*- C -*-
-+   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
-+
-+   This software is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   This software is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with this software; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+*/
-+
-+/* 	    NAME,		REL|EXEC|DYN	*/
-+
-+RELOC_TYPE (NONE,		0)
-+RELOC_TYPE (32,			REL|EXEC|DYN)
-+RELOC_TYPE (16,			REL)
-+RELOC_TYPE (8,			REL)
-+RELOC_TYPE (PC32,		REL|EXEC|DYN)
-+RELOC_TYPE (PC16,		REL)
-+RELOC_TYPE (PC8,		REL)
-+RELOC_TYPE (GOT32,		REL)
-+RELOC_TYPE (GOT16,		REL)
-+RELOC_TYPE (GOT8,		REL)
-+RELOC_TYPE (GOT32O,		REL)
-+RELOC_TYPE (GOT16O,		REL)
-+RELOC_TYPE (GOT8O,		REL)
-+RELOC_TYPE (PLT32,		REL)
-+RELOC_TYPE (PLT16,		REL)
-+RELOC_TYPE (PLT8,		REL)
-+RELOC_TYPE (PLT32O,		REL)
-+RELOC_TYPE (PLT16O,		REL)
-+RELOC_TYPE (PLT8O,		REL)
-+RELOC_TYPE (COPY,		EXEC)
-+RELOC_TYPE (GLOB_DAT,		EXEC|DYN)
-+RELOC_TYPE (JMP_SLOT,		EXEC|DYN)
-+RELOC_TYPE (RELATIVE,		EXEC|DYN)
-+RELOC_TYPE (GNU_VTINHERIT,	REL)
-+RELOC_TYPE (GNU_VTENTRY,	REL)
-+
-Index: elfutils-0.146/libelf/elf.h
-===================================================================
---- elfutils-0.146.orig/libelf/elf.h	2010-04-24 10:11:13.000000000 +0000
-+++ elfutils-0.146/libelf/elf.h	2010-04-24 10:13:50.000000000 +0000
-@@ -1125,6 +1125,9 @@
- #define R_68K_GLOB_DAT	20		/* Create GOT entry */
- #define R_68K_JMP_SLOT	21		/* Create PLT entry */
- #define R_68K_RELATIVE	22		/* Adjust by program base */
-+/* The next 2 are GNU extensions to enable C++ vtable garbage collection.  */
-+#define R_68K_GNU_VTINHERIT 23
-+#define R_68K_GNU_VTENTRY   24
- #define R_68K_TLS_GD32      25          /* 32 bit GOT offset for GD */
- #define R_68K_TLS_GD16      26          /* 16 bit GOT offset for GD */
- #define R_68K_TLS_GD8       27          /* 8 bit GOT offset for GD */
-Index: elfutils-0.146/backends/Makefile.am
-===================================================================
---- elfutils-0.146.orig/backends/Makefile.am	2010-04-24 10:11:23.000000000 +0000
-+++ elfutils-0.146/backends/Makefile.am	2010-04-24 10:11:38.000000000 +0000
-@@ -29,11 +29,12 @@
- 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
- 
- 
--modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc mips
-+modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc mips m68k
- libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
- 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
- 	     libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
--	     libebl_s390_pic.a libebl_parisc_pic.a libebl_mips_pic.a
-+	     libebl_s390_pic.a libebl_parisc_pic.a libebl_mips_pic.a \
-+	     libebl_m68k_pic.a
- noinst_LIBRARIES = $(libebl_pic)
- noinst_DATA = $(libebl_pic:_pic.a=.so)
- 
-@@ -103,6 +104,10 @@
- libebl_mips_pic_a_SOURCES = $(mips_SRCS)
- am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
- 
-+m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c
-+libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
-+am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
-+
- libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
- 	@rm -f $(@:.so=.map)
- 	echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
-Index: elfutils-0.146/backends/m68k_symbol.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.146/backends/m68k_symbol.c	2010-04-24 10:11:38.000000000 +0000
-@@ -0,0 +1,43 @@
-+/* m68k specific symbolic name handling.
-+   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
-+
-+   This software is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   This software distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with this software; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+*/
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <elf.h>
-+#include <stddef.h>
-+
-+#define BACKEND		m68k_
-+#include "libebl_CPU.h"
-+
-+/* Check for the simple reloc types.  */
-+Elf_Type
-+m68k_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
-+{
-+  switch (type)
-+    {
-+    case R_68K_32:
-+      return ELF_T_SWORD;
-+    case R_68K_16:
-+      return ELF_T_HALF;
-+    case R_68K_8:
-+      return ELF_T_BYTE;
-+    default:
-+      return ELF_T_NUM;
-+    }
-+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff
deleted file mode 100644
index 3f81a75..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff
+++ /dev/null
@@ -1,713 +0,0 @@
-Upstream-Status: Backport
-
-Index: elfutils-0.145/backends/mips_init.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.145/backends/mips_init.c	2010-02-24 18:57:35.000000000 +0000
-@@ -0,0 +1,60 @@
-+/* Initialization of mips specific backend library.
-+   Copyright (C) 2006 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#define BACKEND		mips_
-+#define RELOC_PREFIX	R_MIPS_
-+#include "libebl_CPU.h"
-+
-+/* This defines the common reloc hooks based on mips_reloc.def.  */
-+#include "common-reloc.c"
-+
-+const char *
-+mips_init (elf, machine, eh, ehlen)
-+     Elf *elf __attribute__ ((unused));
-+     GElf_Half machine __attribute__ ((unused));
-+     Ebl *eh;
-+     size_t ehlen;
-+{
-+  /* Check whether the Elf_BH object has a sufficent size.  */
-+  if (ehlen < sizeof (Ebl))
-+    return NULL;
-+
-+  /* We handle it.  */
-+  if (machine == EM_MIPS)
-+    eh->name = "MIPS R3000 big-endian";
-+  else if (machine == EM_MIPS_RS3_LE)
-+    eh->name = "MIPS R3000 little-endian";
-+
-+  mips_init_reloc (eh);
-+  HOOK (eh, reloc_simple_type);
-+  HOOK (eh, return_value_location);
-+  HOOK (eh, register_info);
-+
-+  return MODVERSION;
-+}
-Index: elfutils-0.145/backends/mips_regs.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.145/backends/mips_regs.c	2010-02-24 18:57:35.000000000 +0000
-@@ -0,0 +1,104 @@
-+/* Register names and numbers for MIPS DWARF.
-+   Copyright (C) 2006 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <string.h>
-+#include <dwarf.h>
-+
-+#define BACKEND mips_
-+#include "libebl_CPU.h"
-+
-+ssize_t
-+mips_register_info (Ebl *ebl __attribute__((unused)),
-+		    int regno, char *name, size_t namelen,
-+		    const char **prefix, const char **setname,
-+		    int *bits, int *type)
-+{
-+  if (name == NULL)
-+    return 66;
-+
-+  if (regno < 0 || regno > 65 || namelen < 4)
-+    return -1;
-+
-+  *prefix = "$";
-+
-+  if (regno < 32)
-+    {
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      if (regno < 32 + 10)
-+        {
-+          name[0] = regno + '0';
-+          namelen = 1;
-+        }
-+      else
-+        {
-+          name[0] = (regno / 10) + '0';
-+          name[1] = (regno % 10) + '0';
-+          namelen = 2;
-+        }
-+    }
-+  else if (regno < 64)
-+    {
-+      *setname = "FPU";
-+      *type = DW_ATE_float;
-+      *bits = 32;
-+      name[0] = 'f';
-+      if (regno < 32 + 10)
-+	{
-+	  name[1] = (regno - 32) + '0';
-+	  namelen = 2;
-+	}
-+      else
-+	{
-+	  name[1] = (regno - 32) / 10 + '0';
-+	  name[2] = (regno - 32) % 10 + '0';
-+	  namelen = 3;
-+	}
-+    }
-+  else if (regno == 64)
-+    {
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      name[0] = 'h';
-+      name[1] = 'i';
-+      namelen = 2;
-+    }
-+  else
-+    {
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      name[0] = 'l';
-+      name[1] = 'o';
-+      namelen = 2;
-+    }
-+
-+  name[namelen++] = '\0';
-+  return namelen;
-+}
-Index: elfutils-0.145/backends/mips_reloc.def
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.145/backends/mips_reloc.def	2010-02-24 18:57:35.000000000 +0000
-@@ -0,0 +1,79 @@
-+/* List the relocation types for mips.  -*- C -*-
-+   Copyright (C) 2006 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+/* 	    NAME,		REL|EXEC|DYN	*/
-+
-+RELOC_TYPE (NONE,               0)
-+RELOC_TYPE (16,                 0)
-+RELOC_TYPE (32,                 0)
-+RELOC_TYPE (REL32,              0)
-+RELOC_TYPE (26,                 0)
-+RELOC_TYPE (HI16,               0)
-+RELOC_TYPE (LO16,               0)
-+RELOC_TYPE (GPREL16,            0)
-+RELOC_TYPE (LITERAL,            0)
-+RELOC_TYPE (GOT16,              0)
-+RELOC_TYPE (PC16,               0)
-+RELOC_TYPE (CALL16,             0)
-+RELOC_TYPE (GPREL32,            0)
-+
-+RELOC_TYPE (SHIFT5,             0)
-+RELOC_TYPE (SHIFT6,             0)
-+RELOC_TYPE (64,                 0)
-+RELOC_TYPE (GOT_DISP,           0)
-+RELOC_TYPE (GOT_PAGE,           0)
-+RELOC_TYPE (GOT_OFST,           0)
-+RELOC_TYPE (GOT_HI16,           0)
-+RELOC_TYPE (GOT_LO16,           0)
-+RELOC_TYPE (SUB,                0)
-+RELOC_TYPE (INSERT_A,           0)
-+RELOC_TYPE (INSERT_B,           0)
-+RELOC_TYPE (DELETE,             0)
-+RELOC_TYPE (HIGHER,             0)
-+RELOC_TYPE (HIGHEST,            0)
-+RELOC_TYPE (CALL_HI16,          0)
-+RELOC_TYPE (CALL_LO16,          0)
-+RELOC_TYPE (SCN_DISP,           0)
-+RELOC_TYPE (REL16,              0)
-+RELOC_TYPE (ADD_IMMEDIATE,      0)
-+RELOC_TYPE (PJUMP,              0)
-+RELOC_TYPE (RELGOT,             0)
-+RELOC_TYPE (JALR,               0)
-+RELOC_TYPE (TLS_DTPMOD32,       0)
-+RELOC_TYPE (TLS_DTPREL32,       0)
-+RELOC_TYPE (TLS_DTPMOD64,       0)
-+RELOC_TYPE (TLS_DTPREL64,       0)
-+RELOC_TYPE (TLS_GD,             0)
-+RELOC_TYPE (TLS_LDM,            0)
-+RELOC_TYPE (TLS_DTPREL_HI16,    0)
-+RELOC_TYPE (TLS_DTPREL_LO16,    0)
-+RELOC_TYPE (TLS_GOTTPREL,       0)
-+RELOC_TYPE (TLS_TPREL32,        0)
-+RELOC_TYPE (TLS_TPREL64,        0)
-+RELOC_TYPE (TLS_TPREL_HI16,     0)
-+RELOC_TYPE (TLS_TPREL_LO16,     0)
-+
-+#define NO_COPY_RELOC 1
-+#define NO_RELATIVE_RELOC 1
-Index: elfutils-0.145/backends/mips_retval.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.145/backends/mips_retval.c	2010-02-24 18:57:35.000000000 +0000
-@@ -0,0 +1,321 @@
-+/* Function return value location for Linux/mips ABI.
-+   Copyright (C) 2005 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <string.h>
-+#include <assert.h>
-+#include <dwarf.h>
-+#include <elf.h>
-+
-+#include "../libebl/libeblP.h"
-+#include "../libdw/libdwP.h"
-+
-+#define BACKEND mips_
-+#include "libebl_CPU.h"
-+
-+/* The ABI of the file.  Also see EF_MIPS_ABI2 above. */
-+#define EF_MIPS_ABI		0x0000F000
-+
-+/* The original o32 abi. */
-+#define E_MIPS_ABI_O32          0x00001000
-+
-+/* O32 extended to work on 64 bit architectures */
-+#define E_MIPS_ABI_O64          0x00002000
-+
-+/* EABI in 32 bit mode */
-+#define E_MIPS_ABI_EABI32       0x00003000
-+
-+/* EABI in 64 bit mode */
-+#define E_MIPS_ABI_EABI64       0x00004000
-+
-+/* All the possible MIPS ABIs. */
-+enum mips_abi
-+  {
-+    MIPS_ABI_UNKNOWN = 0,
-+    MIPS_ABI_N32,
-+    MIPS_ABI_O32,
-+    MIPS_ABI_N64,
-+    MIPS_ABI_O64,
-+    MIPS_ABI_EABI32,
-+    MIPS_ABI_EABI64,
-+    MIPS_ABI_LAST
-+  };
-+
-+/* Find the mips ABI of the current file */
-+enum mips_abi find_mips_abi(Elf *elf)
-+{
-+  GElf_Ehdr ehdr_mem;
-+  GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
-+
-+  if (ehdr == NULL)
-+    return MIPS_ABI_LAST;
-+
-+  GElf_Word elf_flags = ehdr->e_flags;
-+
-+  /* Check elf_flags to see if it specifies the ABI being used.  */
-+  switch ((elf_flags & EF_MIPS_ABI))
-+    {
-+    case E_MIPS_ABI_O32:
-+      return MIPS_ABI_O32;
-+    case E_MIPS_ABI_O64:
-+      return MIPS_ABI_O64;
-+    case E_MIPS_ABI_EABI32:
-+      return MIPS_ABI_EABI32;
-+    case E_MIPS_ABI_EABI64:
-+      return MIPS_ABI_EABI64;
-+    default:
-+      if ((elf_flags & EF_MIPS_ABI2))
-+	return MIPS_ABI_N32;
-+    }
-+
-+  /* GCC creates a pseudo-section whose name describes the ABI.  */
-+  size_t shstrndx;
-+  if (elf_getshdrstrndx (elf, &shstrndx) < 0)
-+    return MIPS_ABI_LAST;
-+
-+  const char *name;
-+  Elf_Scn *scn = NULL;
-+  while ((scn = elf_nextscn (elf, scn)) != NULL)
-+    {
-+      GElf_Shdr shdr_mem;
-+      GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
-+      if (shdr == NULL)
-+        return MIPS_ABI_LAST;
-+
-+      name = elf_strptr (elf, shstrndx, shdr->sh_name) ?: "";
-+      if (strncmp (name, ".mdebug.", 8) != 0)
-+        continue;
-+
-+      if (strcmp (name, ".mdebug.abi32") == 0)
-+        return MIPS_ABI_O32;
-+      else if (strcmp (name, ".mdebug.abiN32") == 0)
-+        return MIPS_ABI_N32;
-+      else if (strcmp (name, ".mdebug.abi64") == 0)
-+        return MIPS_ABI_N64;
-+      else if (strcmp (name, ".mdebug.abiO64") == 0)
-+        return MIPS_ABI_O64;
-+      else if (strcmp (name, ".mdebug.eabi32") == 0)
-+        return MIPS_ABI_EABI32;
-+      else if (strcmp (name, ".mdebug.eabi64") == 0)
-+        return MIPS_ABI_EABI64;
-+      else
-+        return MIPS_ABI_UNKNOWN;
-+    }
-+
-+  return MIPS_ABI_UNKNOWN;
-+}
-+
-+unsigned int
-+mips_abi_regsize (enum mips_abi abi)
-+{
-+  switch (abi)
-+    {
-+    case MIPS_ABI_EABI32:
-+    case MIPS_ABI_O32:
-+      return 4;
-+    case MIPS_ABI_N32:
-+    case MIPS_ABI_N64:
-+    case MIPS_ABI_O64:
-+    case MIPS_ABI_EABI64:
-+      return 8;
-+    case MIPS_ABI_UNKNOWN:
-+    case MIPS_ABI_LAST:
-+    default:
-+      return 0;
-+    }
-+}
-+
-+
-+/* $v0 or pair $v0, $v1 */
-+static const Dwarf_Op loc_intreg_o32[] =
-+  {
-+    { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 },
-+  };
-+
-+static const Dwarf_Op loc_intreg[] =
-+  {
-+    { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 8 },
-+    { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 8 },
-+  };
-+#define nloc_intreg	1
-+#define nloc_intregpair	4
-+
-+/* $f0 (float), or pair $f0, $f1 (double).
-+ * f2/f3 are used for COMPLEX (= 2 doubles) returns in Fortran */
-+static const Dwarf_Op loc_fpreg_o32[] =
-+  {
-+    { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 4 },
-+  };
-+
-+/* $f0, or pair $f0, $f2.  */
-+static const Dwarf_Op loc_fpreg[] =
-+  {
-+    { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 8 },
-+    { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 },
-+  };
-+#define nloc_fpreg  1
-+#define nloc_fpregpair 4
-+#define nloc_fpregquad 8
-+
-+/* The return value is a structure and is actually stored in stack space
-+   passed in a hidden argument by the caller.  But, the compiler
-+   helpfully returns the address of that space in $v0.  */
-+static const Dwarf_Op loc_aggregate[] =
-+  {
-+    { .atom = DW_OP_breg2, .number = 0 }
-+  };
-+#define nloc_aggregate 1
-+
-+int
-+mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+  /* First find the ABI used by the elf object */
-+  enum mips_abi abi = find_mips_abi(functypedie->cu->dbg->elf);
-+
-+  /* Something went seriously wrong while trying to figure out the ABI */
-+  if (abi == MIPS_ABI_LAST)
-+    return -1;
-+
-+  /* We couldn't identify the ABI, but the file seems valid */
-+  if (abi == MIPS_ABI_UNKNOWN)
-+    return -2;
-+
-+  /* Can't handle EABI variants */
-+  if ((abi == MIPS_ABI_EABI32) || (abi == MIPS_ABI_EABI64))
-+    return -2;
-+
-+  unsigned int regsize = mips_abi_regsize (abi);
-+  if (!regsize)
-+    return -2;
-+
-+  /* Start with the function's type, and get the DW_AT_type attribute,
-+     which is the type of the return value.  */
-+
-+  Dwarf_Attribute attr_mem;
-+  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
-+  if (attr == NULL)
-+    /* The function has no return value, like a `void' function in C.  */
-+    return 0;
-+
-+  Dwarf_Die die_mem;
-+  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
-+  int tag = dwarf_tag (typedie);
-+
-+  /* Follow typedefs and qualifiers to get to the actual type.  */
-+  while (tag == DW_TAG_typedef
-+	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
-+	 || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
-+    {
-+      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
-+      typedie = dwarf_formref_die (attr, &die_mem);
-+      tag = dwarf_tag (typedie);
-+    }
-+
-+  switch (tag)
-+    {
-+    case -1:
-+      return -1;
-+
-+    case DW_TAG_subrange_type:
-+      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
-+	{
-+	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
-+	  typedie = dwarf_formref_die (attr, &die_mem);
-+	  tag = dwarf_tag (typedie);
-+	}
-+      /* Fall through.  */
-+
-+    case DW_TAG_base_type:
-+    case DW_TAG_enumeration_type:
-+    case DW_TAG_pointer_type:
-+    case DW_TAG_ptr_to_member_type:
-+      {
-+        Dwarf_Word size;
-+	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
-+					 &attr_mem), &size) != 0)
-+	  {
-+	    if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
-+	      size = regsize;
-+	    else
-+	      return -1;
-+	  }
-+	if (tag == DW_TAG_base_type)
-+	  {
-+	    Dwarf_Word encoding;
-+	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
-+					     &attr_mem), &encoding) != 0)
-+	      return -1;
-+
-+#define ABI_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc))
-+
-+	    if (encoding == DW_ATE_float)
-+	      {
-+		*locp = ABI_LOC(loc_fpreg, regsize);
-+		if (size <= regsize)
-+		    return nloc_fpreg;
-+
-+		if (size <= 2*regsize)
-+                  return nloc_fpregpair;
-+
-+		if (size <= 4*regsize && abi == MIPS_ABI_O32)
-+                  return nloc_fpregquad;
-+
-+		goto aggregate;
-+	      }
-+	  }
-+	*locp = ABI_LOC(loc_intreg, regsize);
-+	if (size <= regsize)
-+	  return nloc_intreg;
-+	if (size <= 2*regsize)
-+	  return nloc_intregpair;
-+
-+	/* Else fall through. Shouldn't happen though (at least with gcc) */
-+      }
-+
-+    case DW_TAG_structure_type:
-+    case DW_TAG_class_type:
-+    case DW_TAG_union_type:
-+    case DW_TAG_array_type:
-+    aggregate:
-+      /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
-+      if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64))
-+        return -2;
-+
-+      *locp = loc_aggregate;
-+      return nloc_aggregate;
-+    }
-+
-+  /* XXX We don't have a good way to return specific errors from ebl calls.
-+     This value means we do not understand the type, but it is well-formed
-+     DWARF and might be valid.  */
-+  return -2;
-+}
-Index: elfutils-0.145/backends/mips_symbol.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ elfutils-0.145/backends/mips_symbol.c	2010-02-24 18:57:35.000000000 +0000
-@@ -0,0 +1,52 @@
-+/* MIPS specific symbolic name handling.
-+   Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+   Written by Jakub Jelinek <jakub@redhat.com>, 2002.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <elf.h>
-+#include <stddef.h>
-+
-+#define BACKEND		mips_
-+#include "libebl_CPU.h"
-+
-+/* Check for the simple reloc types.  */
-+Elf_Type
-+mips_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
-+{
-+  switch (type)
-+    {
-+    case R_MIPS_16:
-+      return ELF_T_HALF;
-+    case R_MIPS_32:
-+      return ELF_T_WORD;
-+    case R_MIPS_64:
-+      return ELF_T_XWORD;
-+    default:
-+      return ELF_T_NUM;
-+    }
-+}
-Index: elfutils-0.145/libebl/eblopenbackend.c
-===================================================================
---- elfutils-0.145.orig/libebl/eblopenbackend.c	2010-02-24 18:55:51.000000000 +0000
-+++ elfutils-0.145/libebl/eblopenbackend.c	2010-02-24 18:57:35.000000000 +0000
-@@ -91,6 +91,8 @@
-   { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 },
-   { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 },
-   { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 },
-+  { "mips", "elf_mips", "mips", 4, EM_MIPS, 0, 0 },
-+  { "mips", "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 },
- 
-   { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
-   { "m68k", "elf_m68k", "m68k", 4, EM_68K, 0, 0 },
-Index: elfutils-0.145/backends/common-reloc.c
-===================================================================
---- elfutils-0.145.orig/backends/common-reloc.c	2010-02-24 18:55:51.000000000 +0000
-+++ elfutils-0.145/backends/common-reloc.c	2010-02-24 18:57:35.000000000 +0000
-@@ -109,11 +109,13 @@
- }
- 
- 
-+#ifndef NO_COPY_RELOC
- bool
- EBLHOOK(copy_reloc_p) (int reloc)
- {
-   return reloc == R_TYPE (COPY);
- }
-+#endif
- 
- bool
- EBLHOOK(none_reloc_p) (int reloc)
-@@ -135,7 +137,9 @@
-   ebl->reloc_type_name = EBLHOOK(reloc_type_name);
-   ebl->reloc_type_check = EBLHOOK(reloc_type_check);
-   ebl->reloc_valid_use = EBLHOOK(reloc_valid_use);
-+#ifndef NO_COPY_RELOC
-   ebl->copy_reloc_p = EBLHOOK(copy_reloc_p);
-+#endif
-   ebl->none_reloc_p = EBLHOOK(none_reloc_p);
- #ifndef NO_RELATIVE_RELOC
-   ebl->relative_reloc_p = EBLHOOK(relative_reloc_p);
-Index: elfutils-0.145/backends/Makefile.am
-===================================================================
---- elfutils-0.145.orig/backends/Makefile.am	2010-02-24 18:57:26.000000000 +0000
-+++ elfutils-0.145/backends/Makefile.am	2010-02-24 18:57:57.000000000 +0000
-@@ -29,11 +29,11 @@
- 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
- 
- 
--modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc
-+modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc mips
- libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
- 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
- 	     libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
--	     libebl_s390_pic.a libebl_parisc_pic.a
-+	     libebl_s390_pic.a libebl_parisc_pic.a libebl_mips_pic.a
- noinst_LIBRARIES = $(libebl_pic)
- noinst_DATA = $(libebl_pic:_pic.a=.so)
- 
-@@ -99,6 +99,10 @@
- libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
- am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
- 
-+mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c
-+libebl_mips_pic_a_SOURCES = $(mips_SRCS)
-+am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
-+
- libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
- 	@rm -f $(@:.so=.map)
- 	echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
deleted file mode 100644
index 2b5dad3..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Upstream-Status: Backport
-
-nm: Fix size passed to snprintf for invalid sh_name case.
-native build failed as following on Fedora18:
-nm.c: In function 'show_symbols_sysv':
-nm.c:756:27: error: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
-    snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]",
-                           ^
-
-The original commit is http://git.fedorahosted.org/cgit/elfutils.git/commit/src/nm.c?id=57bd66cabf6e6b9ecf622cdbf350804897a8df58
-
-Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
-
---- elfutils-0.148/src/nm.c.org	2013-03-11 22:36:11.000000000 -0500
-+++ elfutils-0.148/src/nm.c	2013-03-11 22:46:09.000000000 -0500
-@@ -752,8 +752,9 @@
- 			       gelf_getshdr (scn, &shdr_mem)->sh_name);
-       if (unlikely (name == NULL))
- 	{
--	  name = alloca (sizeof "[invalid sh_name 0x12345678]");
--	  snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]",
-+	  const size_t bufsz = sizeof "[invalid sh_name 0x12345678]";
-+	  name = alloca (bufsz);
-+	  snprintf (name, bufsz, "[invalid sh_name %#" PRIx32 "]",
- 		    gelf_getshdr (scn, &shdr_mem)->sh_name);
- 	}
-       scnnames[elf_ndxscn (scn)] = name;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff
deleted file mode 100644
index b8a912c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff
+++ /dev/null
@@ -1,756 +0,0 @@
-Upstream-Status: Backport
-
-Index: elfutils-0.148/backends/ChangeLog
-===================================================================
---- elfutils-0.148.orig/backends/ChangeLog	2010-04-13 20:08:02.000000000 +0000
-+++ elfutils-0.148/backends/ChangeLog	2010-07-03 13:04:07.000000000 +0000
-@@ -106,6 +106,10 @@
- 	* ppc_attrs.c (ppc_check_object_attribute): Handle tag
- 	GNU_Power_ABI_Struct_Return.
- 
-+2009-01-23  Roland McGrath  <roland@redhat.com>
-+
-+	* Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
-+
- 2008-10-04  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
-@@ -433,6 +437,11 @@
- 	* sparc_init.c: Likewise.
- 	* x86_64_init.c: Likewise.
- 
-+2005-11-22  Roland McGrath  <roland@redhat.com>
-+
-+	* Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
-+	(libebl_%.so rule): Use it in place of -Wl,--as-needed.
-+
- 2005-11-19  Roland McGrath  <roland@redhat.com>
- 
- 	* ppc64_reloc.def: REL30 -> ADDR30.
-@@ -455,6 +464,9 @@
- 	* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
- 	(CLEANFILES): Add libebl_$(m).so.
- 
-+	* Makefile.am (WEXTRA): New variable, substituted by configure.
-+	(AM_CFLAGS): Use it in place of -Wextra.
-+
- 	* ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
- 	* ppc64_reloc.def: Likewise.
- 
-Index: elfutils-0.148/backends/Makefile.am
-===================================================================
---- elfutils-0.148.orig/backends/Makefile.am	2010-04-13 20:08:02.000000000 +0000
-+++ elfutils-0.148/backends/Makefile.am	2010-07-03 13:04:07.000000000 +0000
-@@ -103,7 +103,7 @@
- 	$(LINK) -shared -o $(@:.map=.so) \
- 		-Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
- 		-Wl,--version-script,$(@:.so=.map) \
--		-Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
-+		-Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
- 	$(textrel_check)
- 
- libebl_i386.so: $(cpu_i386)
-Index: elfutils-0.148/ChangeLog
-===================================================================
---- elfutils-0.148.orig/ChangeLog	2010-04-21 14:26:40.000000000 +0000
-+++ elfutils-0.148/ChangeLog	2010-07-03 13:04:07.000000000 +0000
-@@ -2,6 +2,10 @@
- 
- 	* configure.ac (LOCALEDIR, DATADIRNAME): Removed.
- 
-+2009-11-22  Roland McGrath  <roland@redhat.com>
-+
-+	* configure.ac: Use sed and expr instead of modern bash extensions.
-+
- 2009-09-21  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* configure.ac: Update for more modern autoconf.
-@@ -10,6 +14,10 @@
- 
- 	* configure.ac (zip_LIBS): Check for liblzma too.
- 
-+2009-08-17  Roland McGrath  <roland@redhat.com>
-+
-+	* configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
-+
- 2009-04-19  Roland McGrath  <roland@redhat.com>
- 
- 	* configure.ac (eu_version): Round down here, not in version.h macros.
-@@ -21,6 +29,8 @@
- 
- 2009-01-23  Roland McGrath  <roland@redhat.com>
- 
-+	* configure.ac: Check for __builtin_popcount.
-+
- 	* configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
- 
- 	* configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
-@@ -101,6 +111,10 @@
- 	* configure.ac: Add dummy automake conditional to get dependencies
- 	for non-generic linker right.  See src/Makefile.am.
- 
-+2005-11-22  Roland McGrath  <roland@redhat.com>
-+
-+	* configure.ac: Check for --as-needed linker option.
-+
- 2005-11-18  Roland McGrath  <roland@redhat.com>
- 
- 	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
-@@ -148,6 +162,17 @@
- 	* Makefile.am (all_SUBDIRS): Add libdwfl.
- 	* configure.ac: Write libdwfl/Makefile.
- 
-+2005-05-31  Roland McGrath  <roland@redhat.com>
-+
-+	* configure.ac (WEXTRA): Check for -Wextra and set this substitution.
-+
-+	* configure.ac: Check for struct stat st_?tim members.
-+	* src/strip.c (process_file): Use st_?time if st_?tim are not there.
-+
-+	* configure.ac: Check for futimes function.
-+	* src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
-+	(handle_ar) [! HAVE_FUTIMES]: Likewise.
-+
- 2005-05-19  Roland McGrath  <roland@redhat.com>
- 
- 	* configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
-Index: elfutils-0.148/config/eu.am
-===================================================================
---- elfutils-0.148.orig/config/eu.am	2010-04-21 14:26:40.000000000 +0000
-+++ elfutils-0.148/config/eu.am	2010-07-03 13:04:07.000000000 +0000
-@@ -25,11 +25,14 @@
- ## <http://www.openinventionnetwork.com>.
- ##
- 
-+WEXTRA = @WEXTRA@
-+LD_AS_NEEDED = @LD_AS_NEEDED@
-+
- DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
- INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
- AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
- 	    $(if $($(*F)_no_Werror),,-Werror) \
--	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
-+	    $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
- 	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
- 	    $($(*F)_CFLAGS)
- 
-Index: elfutils-0.148/config.h.in
-===================================================================
---- elfutils-0.148.orig/config.h.in	2010-06-28 19:07:37.000000000 +0000
-+++ elfutils-0.148/config.h.in	2010-07-03 13:04:07.000000000 +0000
-@@ -1,5 +1,8 @@
- /* config.h.in.  Generated from configure.ac by autoheader.  */
- 
-+/* Have __builtin_popcount. */
-+#undef HAVE_BUILTIN_POPCOUNT
-+
- /* $libdir subdirectory containing libebl modules. */
- #undef LIBEBL_SUBDIR
- 
-@@ -55,4 +58,7 @@
- /* Define for large files, on AIX-style hosts. */
- #undef _LARGE_FILES
- 
-+/* Stubbed out if missing compiler support. */
-+#undef __thread
-+
- #include <eu-config.h>
-Index: elfutils-0.148/configure.ac
-===================================================================
---- elfutils-0.148.orig/configure.ac	2010-06-28 19:07:26.000000000 +0000
-+++ elfutils-0.148/configure.ac	2010-07-03 13:04:07.000000000 +0000
-@@ -73,6 +73,54 @@
- AS_IF([test "x$ac_cv_c99" != xyes],
-       AC_MSG_ERROR([gcc with C99 support required]))
- 
-+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
-+old_CFLAGS="$CFLAGS"
-+CFLAGS="$CFLAGS -Wextra"
-+AC_COMPILE_IFELSE([void foo (void) { }],
-+		  ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
-+CFLAGS="$old_CFLAGS"])
-+AC_SUBST(WEXTRA)
-+AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
-+
-+AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
-+old_CFLAGS="$CFLAGS"
-+CFLAGS="$CFLAGS -fgnu89-inline -Werror"
-+AC_COMPILE_IFELSE([
-+void foo (void)
-+{
-+  inline void bar (void) {}
-+  bar ();
-+}
-+extern inline void baz (void) {}
-+], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
-+CFLAGS="$old_CFLAGS"])
-+AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
-+      [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
-+
-+AC_CACHE_CHECK([for --as-needed linker option],
-+	       ac_cv_as_needed, [dnl
-+cat > conftest.c <<EOF
-+int main (void) { return 0; }
-+EOF
-+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-+			    -fPIC -shared -o conftest.so conftest.c
-+			    -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
-+then
-+  ac_cv_as_needed=yes
-+else
-+  ac_cv_as_needed=no
-+fi
-+rm -f conftest*])
-+AS_IF([test "x$ac_cv_as_needed" = xyes],
-+      [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
-+AC_SUBST(LD_AS_NEEDED)
-+
-+AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
-+AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
-+	       ac_cv_popcount=yes, ac_cv_popcount=no)])
-+AS_IF([test "x$ac_cv_popcount" = xyes],
-+      [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
-+
- AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
- # Use the same flags that we use for our DSOs, so the test is representative.
- # Some old compiler/linker/libc combinations fail some ways and not others.
-@@ -88,7 +136,10 @@
- CFLAGS="$save_CFLAGS"
- LDFLAGS="$save_LDFLAGS"])
- AS_IF([test "x$ac_cv_tls" != xyes],
--      AC_MSG_ERROR([__thread support required]))
-+      [AS_IF([test "$use_locks" = yes],
-+	     [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
-+	     [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
-+			[Stubbed out if missing compiler support.])])])
- 
- dnl This test must come as early as possible after the compiler configuration
- dnl tests, because the choice of the file model can (in principle) affect
-@@ -251,7 +302,7 @@
- 
- # 1.234<whatever> -> 1234<whatever>
- case "$PACKAGE_VERSION" in
--[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;;
-+[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
- *)     	   AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
- esac
- case "$eu_version" in
-@@ -280,6 +331,6 @@
- esac
- 
- # Round up to the next release API (x.y) version.
--[eu_version=$[($eu_version + 999) / 1000]]
-+eu_version=`expr \( $eu_version + 999 \) / 1000`
- 
- AC_OUTPUT
-Index: elfutils-0.148/lib/ChangeLog
-===================================================================
---- elfutils-0.148.orig/lib/ChangeLog	2010-06-28 19:05:56.000000000 +0000
-+++ elfutils-0.148/lib/ChangeLog	2010-07-03 13:04:07.000000000 +0000
-@@ -14,6 +14,9 @@
- 
- 2009-01-23  Roland McGrath  <roland@redhat.com>
- 
-+	* eu-config.h [! HAVE_BUILTIN_POPCOUNT]
-+	(__builtin_popcount): New inline function.
-+
- 	* eu-config.h: Add multiple inclusion protection.
- 
- 2009-01-17  Ulrich Drepper  <drepper@redhat.com>
-@@ -70,6 +73,11 @@
- 	* Makefile.am (libeu_a_SOURCES): Add it.
- 	* system.h: Declare crc32_file.
- 
-+2005-02-07  Roland McGrath  <roland@redhat.com>
-+
-+	* Makefile.am (WEXTRA): New variable, substituted by configure.
-+	(AM_CFLAGS): Use it in place of -Wextra.
-+
- 2005-04-30  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* Makefile.am: Use -ffunction-sections for xmalloc.c.
-Index: elfutils-0.148/lib/eu-config.h
-===================================================================
---- elfutils-0.148.orig/lib/eu-config.h	2009-08-12 14:23:22.000000000 +0000
-+++ elfutils-0.148/lib/eu-config.h	2010-07-03 13:04:07.000000000 +0000
-@@ -182,6 +182,17 @@
- /* This macro is used by the tests conditionalize for standalone building.  */
- #define ELFUTILS_HEADER(name) <lib##name.h>
- 
-+#ifndef HAVE_BUILTIN_POPCOUNT
-+# define __builtin_popcount hakmem_popcount
-+static inline unsigned int __attribute__ ((unused))
-+hakmem_popcount (unsigned int x)
-+{
-+  /* HAKMEM 169 */
-+  unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
-+  return ((n + (n >> 3)) & 030707070707) % 63;
-+}
-+#endif	/* HAVE_BUILTIN_POPCOUNT */
-+
- 
- #ifdef SHARED
- # define OLD_VERSION(name, version) \
-Index: elfutils-0.148/libasm/ChangeLog
-===================================================================
---- elfutils-0.148.orig/libasm/ChangeLog	2010-03-05 05:48:23.000000000 +0000
-+++ elfutils-0.148/libasm/ChangeLog	2010-07-03 13:04:07.000000000 +0000
-@@ -67,6 +67,11 @@
- 	* asm_error.c: Add new error ASM_E_IOERROR.
- 	* libasmP.h: Add ASM_E_IOERROR definition.
- 
-+2005-05-31  Roland McGrath  <roland@redhat.com>
-+
-+	* Makefile.am (WEXTRA): New variable, substituted by configure.
-+	(AM_CFLAGS): Use it in place of -Wextra.
-+
- 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
-Index: elfutils-0.148/libcpu/ChangeLog
-===================================================================
---- elfutils-0.148.orig/libcpu/ChangeLog	2010-03-05 05:48:23.000000000 +0000
-+++ elfutils-0.148/libcpu/ChangeLog	2010-07-03 13:04:07.000000000 +0000
-@@ -9,6 +9,9 @@
- 
- 2009-01-23  Roland McGrath  <roland@redhat.com>
- 
-+	* i386_disasm.c (i386_disasm): Add abort after assert-constant for old
-+	compilers that don't realize it's noreturn.
-+
- 	* Makefile.am (i386_parse_CFLAGS): Use quotes around command
- 	substitution that can produce leading whitespace.
- 
-@@ -338,6 +341,11 @@
- 	* defs/i386.doc: New file.
- 	* defs/x86_64: New file.
- 
-+2005-04-04  Roland McGrath  <roland@redhat.com>
-+
-+	* Makefile.am (WEXTRA): New variable, substituted by configure.
-+	(AM_CFLAGS): Use it instead of -Wextra.
-+
- 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
-Index: elfutils-0.148/libcpu/i386_disasm.c
-===================================================================
---- elfutils-0.148.orig/libcpu/i386_disasm.c	2009-01-08 20:56:36.000000000 +0000
-+++ elfutils-0.148/libcpu/i386_disasm.c	2010-07-03 13:04:07.000000000 +0000
-@@ -791,6 +791,7 @@
- 
- 			default:
- 			  assert (! "INVALID not handled");
-+			  abort ();
- 			}
- 		    }
- 		  else
-Index: elfutils-0.148/libdw/ChangeLog
-===================================================================
---- elfutils-0.148.orig/libdw/ChangeLog	2010-06-28 19:05:56.000000000 +0000
-+++ elfutils-0.148/libdw/ChangeLog	2010-07-03 13:04:07.000000000 +0000
-@@ -276,6 +276,10 @@
- 
- 	* dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
- 
-+2009-08-17  Roland McGrath  <roland@redhat.com>
-+
-+	* libdw.h: Disable extern inlines for GCC 4.2.
-+
- 2009-08-10  Roland McGrath  <roland@redhat.com>
- 
- 	* dwarf_getscopevar.c: Use dwarf_diename.
-@@ -1044,6 +1048,11 @@
- 
- 2005-05-31  Roland McGrath  <roland@redhat.com>
- 
-+	* Makefile.am (WEXTRA): New variable, substituted by configure.
-+	(AM_CFLAGS): Use it in place of -Wextra.
-+
-+2005-05-31  Roland McGrath  <roland@redhat.com>
-+
- 	* dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
- 	formref offset.
- 
-Index: elfutils-0.148/libdw/libdw.h
-===================================================================
---- elfutils-0.148.orig/libdw/libdw.h	2010-06-28 19:05:56.000000000 +0000
-+++ elfutils-0.148/libdw/libdw.h	2010-07-03 13:04:07.000000000 +0000
-@@ -842,7 +842,7 @@
- 
- 
- /* Inline optimizations.  */
--#ifdef __OPTIMIZE__
-+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
- /* Return attribute code of given attribute.  */
- __libdw_extern_inline unsigned int
- dwarf_whatattr (Dwarf_Attribute *attr)
-Index: elfutils-0.148/libdwfl/ChangeLog
-===================================================================
---- elfutils-0.148.orig/libdwfl/ChangeLog	2010-06-28 19:05:56.000000000 +0000
-+++ elfutils-0.148/libdwfl/ChangeLog	2010-07-03 13:04:07.000000000 +0000
-@@ -1265,6 +1265,11 @@
- 
- 2005-07-21  Roland McGrath  <roland@redhat.com>
- 
-+	* Makefile.am (WEXTRA): New variable, substituted by configure.
-+	(AM_CFLAGS): Use it in place of -Wextra.
-+
-+2005-07-21  Roland McGrath  <roland@redhat.com>
-+
- 	* Makefile.am (noinst_HEADERS): Add loc2c.c.
- 
- 	* test2.c (main): Check sscanf result to quiet warning.
-Index: elfutils-0.148/libebl/ChangeLog
-===================================================================
---- elfutils-0.148.orig/libebl/ChangeLog	2010-03-05 05:48:23.000000000 +0000
-+++ elfutils-0.148/libebl/ChangeLog	2010-07-03 13:04:07.000000000 +0000
-@@ -624,6 +624,11 @@
- 	* Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
- 	tracking works right.
- 
-+2005-05-31  Roland McGrath  <roland@redhat.com>
-+
-+	* Makefile.am (WEXTRA): New variable, substituted by configure.
-+	(AM_CFLAGS): Use it in place of -Wextra.
-+
- 2005-05-21  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* libebl_x86_64.map: Add x86_64_core_note.
-Index: elfutils-0.148/libelf/ChangeLog
-===================================================================
---- elfutils-0.148.orig/libelf/ChangeLog	2010-06-14 21:17:20.000000000 +0000
-+++ elfutils-0.148/libelf/ChangeLog	2010-07-03 13:04:07.000000000 +0000
-@@ -657,6 +657,11 @@
- 
- 	* elf.h: Update from glibc.
- 
-+2005-05-31  Roland McGrath  <roland@redhat.com>
-+
-+	* Makefile.am (WEXTRA): New variable, substituted by configure.
-+	(AM_CFLAGS): Use it in place of -Wextra.
-+
- 2005-05-08  Roland McGrath  <roland@redhat.com>
- 
- 	* elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
-Index: elfutils-0.148/libelf/common.h
-===================================================================
---- elfutils-0.148.orig/libelf/common.h	2009-01-08 20:56:36.000000000 +0000
-+++ elfutils-0.148/libelf/common.h	2010-07-03 13:04:07.000000000 +0000
-@@ -160,7 +160,7 @@
-   (Var) = (sizeof (Var) == 1						      \
- 	   ? (unsigned char) (Var)					      \
- 	   : (sizeof (Var) == 2						      \
--	      ? bswap_16 (Var)						      \
-+	      ? (unsigned short int) bswap_16 (Var)			      \
- 	      : (sizeof (Var) == 4					      \
- 		 ? bswap_32 (Var)					      \
- 		 : bswap_64 (Var))))
-@@ -169,7 +169,7 @@
-   (Dst) = (sizeof (Var) == 1						      \
- 	   ? (unsigned char) (Var)					      \
- 	   : (sizeof (Var) == 2						      \
--	      ? bswap_16 (Var)						      \
-+	      ? (unsigned short int) bswap_16 (Var)			      \
- 	      : (sizeof (Var) == 4					      \
- 		 ? bswap_32 (Var)					      \
- 		 : bswap_64 (Var))))
-Index: elfutils-0.148/src/addr2line.c
-===================================================================
---- elfutils-0.148.orig/src/addr2line.c	2010-05-28 14:38:30.000000000 +0000
-+++ elfutils-0.148/src/addr2line.c	2010-07-03 13:05:40.000000000 +0000
-@@ -447,10 +447,10 @@
-       bool parsed = false;
-       int i, j;
-       char *name = NULL;
--      if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
-+      if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
- 	  && string[i] == '\0')
- 	parsed = adjust_to_section (name, &addr, dwfl);
--      switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
-+      switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
- 	{
- 	default:
- 	  break;
-Index: elfutils-0.148/src/ChangeLog
-===================================================================
---- elfutils-0.148.orig/src/ChangeLog	2010-06-28 19:05:56.000000000 +0000
-+++ elfutils-0.148/src/ChangeLog	2010-07-03 13:04:08.000000000 +0000
-@@ -165,8 +165,16 @@
- 	* readelf.c (attr_callback): Use print_block only when we don't use
- 	print_ops.
- 
-+2009-08-17  Roland McGrath  <roland@redhat.com>
-+
-+	* ld.h: Disable extern inlines for GCC 4.2.
-+
- 2009-08-14  Roland McGrath  <roland@redhat.com>
- 
-+	* strings.c (read_block): Conditionalize posix_fadvise use
-+	on [POSIX_FADV_SEQUENTIAL].
-+	From Petr Salinger <Petr.Salinger@seznam.cz>.
-+
- 	* ar.c (do_oper_extract): Use pathconf instead of statfs.
- 
- 2009-08-01  Ulrich Drepper  <drepper@redhat.com>
-@@ -330,6 +338,8 @@
- 	* readelf.c (print_debug_frame_section): Use t instead of j formats
- 	for ptrdiff_t OFFSET.
- 
-+	* addr2line.c (handle_address): Use %a instead of %m for compatibility.
-+
- 2009-01-21  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
-@@ -513,6 +523,11 @@
- 	that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
- 	is valid in RELRO.
- 
-+2008-03-01  Roland McGrath  <roland@redhat.com>
-+
-+	* readelf.c (dump_archive_index): Tweak portability hack
-+	to match [__GNUC__ < 4] too.
-+
- 2008-02-29  Roland McGrath  <roland@redhat.com>
- 
- 	* readelf.c (print_attributes): Add a cast.
-@@ -764,6 +779,8 @@
- 
- 	* readelf.c (hex_dump): Fix rounding error in whitespace calculation.
- 
-+	* Makefile.am (readelf_no_Werror): New variable.
-+
- 2007-10-15  Roland McGrath  <roland@redhat.com>
- 
- 	* make-debug-archive.in: New file.
-@@ -1203,6 +1220,10 @@
- 	* elflint.c (valid_e_machine): Add EM_ALPHA.
- 	Reported by Christian Aichinger <Greek0@gmx.net>.
- 
-+	* strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
-+	MADV_SEQUENTIAL if undefined.  	Don't call posix_madvise
-+	if neither is defined.
-+
- 2006-08-08  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
-@@ -1279,6 +1300,10 @@
- 	* Makefile.am: Add hacks to create dependency files for non-generic
- 	linker.
- 
-+2006-04-05  Roland McGrath  <roland@redhat.com>
-+
-+	* strings.c (MAP_POPULATE): Define to 0 if undefined.
-+
- 2006-06-12  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
-@@ -1627,6 +1652,11 @@
- 	* readelf.c (print_debug_loc_section): Fix indentation for larger
- 	address size.
- 
-+2005-05-31  Roland McGrath  <roland@redhat.com>
-+
-+	* Makefile.am (WEXTRA): New variable, substituted by configure.
-+	(AM_CFLAGS): Use it in place of -Wextra.
-+
- 2005-05-30  Roland McGrath  <roland@redhat.com>
- 
- 	* readelf.c (print_debug_line_section): Print section offset of each
-Index: elfutils-0.148/src/findtextrel.c
-===================================================================
---- elfutils-0.148.orig/src/findtextrel.c	2009-02-11 01:12:59.000000000 +0000
-+++ elfutils-0.148/src/findtextrel.c	2010-07-03 13:04:08.000000000 +0000
-@@ -490,7 +490,11 @@
- 
- 
- static void
--check_rel (size_t nsegments, struct segments segments[nsegments],
-+check_rel (size_t nsegments, struct segments segments[
-+#if __GNUC__ >= 4
-+						      nsegments
-+#endif
-+	   ],
- 	   GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
- 	   const char *fname, bool more_than_one, void **knownsrcs)
- {
-Index: elfutils-0.148/src/ld.h
-===================================================================
---- elfutils-0.148.orig/src/ld.h	2009-06-13 22:39:51.000000000 +0000
-+++ elfutils-0.148/src/ld.h	2010-07-03 13:04:08.000000000 +0000
-@@ -1122,6 +1122,7 @@
- 
- /* Checked whether the symbol is undefined and referenced from a DSO.  */
- extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
-+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
- #ifdef __GNUC_STDC_INLINE__
- __attribute__ ((__gnu_inline__))
- #endif
-@@ -1139,5 +1140,6 @@
- 
-   return sym->defined && sym->in_dso;
- }
-+#endif	/* Optimizing and not GCC 4.2.  */
- 
- #endif	/* ld.h */
-Index: elfutils-0.148/src/Makefile.am
-===================================================================
---- elfutils-0.148.orig/src/Makefile.am	2010-03-05 05:48:23.000000000 +0000
-+++ elfutils-0.148/src/Makefile.am	2010-07-03 13:04:08.000000000 +0000
-@@ -99,6 +99,9 @@
- # XXX While the file is not finished, don't warn about this
- ldgeneric_no_Wunused = yes
- 
-+# Buggy old compilers.
-+readelf_no_Werror = yes
-+
- readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
- nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
- size_LDADD = $(libelf) $(libeu) $(libmudflap)
-
-Index: elfutils-0.148/src/readelf.c
-===================================================================
---- elfutils-0.148.orig/src/readelf.c	2010-06-28 19:05:56.000000000 +0000
-+++ elfutils-0.148/src/readelf.c	2010-07-03 13:04:08.000000000 +0000
-@@ -7845,7 +7845,7 @@
- 	  if (unlikely (elf_rand (elf, as_off) == 0)
- 	      || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
- 			   == NULL))
--#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
-+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
- 	    while (1)
- #endif
- 	      error (EXIT_FAILURE, 0,
-Index: elfutils-0.148/src/strings.c
-===================================================================
---- elfutils-0.148.orig/src/strings.c	2009-02-11 01:12:59.000000000 +0000
-+++ elfutils-0.148/src/strings.c	2010-07-03 13:04:08.000000000 +0000
-@@ -51,6 +51,10 @@
- 
- #include <system.h>
- 
-+#ifndef MAP_POPULATE
-+# define MAP_POPULATE 0
-+#endif
-+
- 
- /* Prototypes of local functions.  */
- static int read_fd (int fd, const char *fname, off64_t fdlen);
-@@ -491,8 +495,13 @@
- 		    fd, start_off);
-       if (mem != MAP_FAILED)
- 	{
-+#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
-+# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
-+#endif
-+#ifdef POSIX_MADV_SEQUENTIAL
- 	  /* We will go through the mapping sequentially.  */
- 	  (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
-+#endif
- 	  break;
- 	}
-       if (errno != EINVAL && errno != ENOMEM)
-@@ -586,9 +595,11 @@
-       elfmap_off = from & ~(ps - 1);
-       elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
- 
-+#ifdef POSIX_FADV_SEQUENTIAL
-       if (unlikely (elfmap == MAP_FAILED))
- 	/* Let the kernel know we are going to read everything in sequence.  */
- 	(void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
-+#endif
-     }
- 
-   if (unlikely (elfmap == MAP_FAILED))
-Index: elfutils-0.148/src/strip.c
-===================================================================
---- elfutils-0.148.orig/src/strip.c	2010-01-15 09:05:55.000000000 +0000
-+++ elfutils-0.148/src/strip.c	2010-07-03 13:04:08.000000000 +0000
-@@ -53,6 +53,12 @@
- #include <libebl.h>
- #include <system.h>
- 
-+#ifdef HAVE_FUTIMES
-+# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
-+#else
-+# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
-+#endif
-+
- 
- /* Name and version of program.  */
- static void print_version (FILE *stream, struct argp_state *state);
-@@ -301,8 +307,18 @@
- 
-       /* If we have to preserve the timestamp, we need it in the
- 	 format utimes() understands.  */
-+#ifdef HAVE_STRUCT_STAT_ST_ATIM
-       TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
-+#else
-+      tv[0].tv_sec = pre_st.st_atime;
-+      tv[0].tv_usec = 0;
-+#endif
-+#ifdef HAVE_STRUCT_STAT_ST_MTIM
-       TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
-+#else
-+      tv[1].tv_sec = pre_st.st_atime;
-+      tv[1].tv_usec = 0;
-+#endif
-     }
- 
-   /* Open the file.  */
-@@ -1747,7 +1763,7 @@
-   /* If requested, preserve the timestamp.  */
-   if (tvp != NULL)
-     {
--      if (futimes (fd, tvp) != 0)
-+      if (FUTIMES (fd, output_fname, tvp) != 0)
- 	{
- 	  error (0, errno, gettext ("\
- cannot set access and modification date of '%s'"),
-@@ -1804,7 +1820,7 @@
- 
-   if (tvp != NULL)
-     {
--      if (unlikely (futimes (fd, tvp) != 0))
-+      if (unlikely (FUTIMES (fd, fname, tvp) != 0))
- 	{
- 	  error (0, errno, gettext ("\
- cannot set access and modification date of '%s'"), fname);
-Index: elfutils-0.148/tests/ChangeLog
-===================================================================
---- elfutils-0.148.orig/tests/ChangeLog	2010-06-28 19:05:56.000000000 +0000
-+++ elfutils-0.148/tests/ChangeLog	2010-07-03 13:04:08.000000000 +0000
-@@ -154,6 +154,8 @@
- 
- 2008-01-21  Roland McGrath  <roland@redhat.com>
- 
-+	* line2addr.c (main): Revert last change.
-+
- 	* testfile45.S.bz2: Add tests for cltq, cqto.
- 	* testfile45.expect.bz2: Adjust.
- 
-@@ -862,6 +864,11 @@
- 	* Makefile.am (TESTS): Add run-elflint-test.sh.
- 	(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
- 
-+2005-05-31  Roland McGrath  <roland@redhat.com>
-+
-+	* Makefile.am (WEXTRA): New variable, substituted by configure.
-+	(AM_CFLAGS): Use it in place of -Wextra.
-+
- 2005-05-24  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* get-files.c (main): Use correct format specifier.
-Index: elfutils-0.148/tests/line2addr.c
-===================================================================
---- elfutils-0.148.orig/tests/line2addr.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/tests/line2addr.c	2010-07-03 13:04:08.000000000 +0000
-@@ -132,7 +132,7 @@
-     {
-       struct args a = { .arg = argv[cnt] };
- 
--      switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
-+      switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
- 	{
- 	default:
- 	case 0:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff
deleted file mode 100644
index cd39854..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff
+++ /dev/null
@@ -1,1709 +0,0 @@
-Upstream-Status: Backport
-
-Index: elfutils-0.148/libelf/ChangeLog
-===================================================================
---- elfutils-0.148.orig/libelf/ChangeLog	2010-07-03 13:07:10.000000000 +0000
-+++ elfutils-0.148/libelf/ChangeLog	2010-07-03 13:07:11.000000000 +0000
-@@ -649,10 +649,53 @@
- 	If section content hasn't been read yet, do it before looking for the
- 	block size.  If no section data present, infer size of section header.
- 
-+2005-05-14  Jakub Jelinek  <jakub@redhat.com>
-+
-+	* libelfP.h (INVALID_NDX): Define.
-+	* gelf_getdyn.c (gelf_getdyn): Use it.  Remove ndx < 0 test if any.
-+	* gelf_getlib.c (gelf_getlib): Likewise.
-+	* gelf_getmove.c (gelf_getmove): Likewise.
-+	* gelf_getrel.c (gelf_getrel): Likewise.
-+	* gelf_getrela.c (gelf_getrela): Likewise.
-+	* gelf_getsym.c (gelf_getsym): Likewise.
-+	* gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
-+	* gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
-+	* gelf_getversym.c (gelf_getversym): Likewise.
-+	* gelf_update_dyn.c (gelf_update_dyn): Likewise.
-+	* gelf_update_lib.c (gelf_update_lib): Likewise.
-+	* gelf_update_move.c (gelf_update_move): Likewise.
-+	* gelf_update_rel.c (gelf_update_rel): Likewise.
-+	* gelf_update_rela.c (gelf_update_rela): Likewise.
-+	* gelf_update_sym.c (gelf_update_sym): Likewise.
-+	* gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
-+	* gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
-+	* gelf_update_versym.c (gelf_update_versym): Likewise.
-+	* elf_newscn.c (elf_newscn): Check for overflow.
-+	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
-+	(__elfw2(LIBELFBITS,updatefile)): Likewise.
-+	* elf_begin.c (file_read_elf): Likewise.
-+	* elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
-+	* elf_getarsym.c (elf_getarsym): Likewise.
-+	* elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): Likewise.
- 2005-05-11  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* elf.h: Update again.
- 
-+2005-05-17  Jakub Jelinek  <jakub@redhat.com>
-+
-+	* elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
-+	table fits into object's bounds.
-+	* elf_getshstrndx.c (elf_getshstrndx): Add elf->start_offset to
-+	elf->map_address.  Check if first section header fits into object's
-+	bounds.
-+	* elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)):
-+	Check if section header table fits into object's bounds.
-+	* elf_begin.c (get_shnum): Ensure section headers fits into
-+	object's bounds.
-+	(file_read_elf): Make sure scncnt is small enough to allocate both
-+	ElfXX_Shdr and Elf_Scn array.  Make sure section and program header
-+	tables fit into object's bounds.  Avoid memory leak on failure.
-+
- 2005-05-09  Ulrich Drepper  <drepper@redhat.com>
- 
- 	* elf.h: Update from glibc.
-Index: elfutils-0.148/libelf/elf32_getphdr.c
-===================================================================
---- elfutils-0.148.orig/libelf/elf32_getphdr.c	2010-04-21 14:26:40.000000000 +0000
-+++ elfutils-0.148/libelf/elf32_getphdr.c	2010-07-03 13:07:11.000000000 +0000
-@@ -114,6 +114,16 @@
- 
-       if (elf->map_address != NULL)
- 	{
-+	  /* First see whether the information in the ELF header is
-+	     valid and it does not ask for too much.  */
-+	  if (unlikely (ehdr->e_phoff >= elf->maximum_size)
-+	      || unlikely (elf->maximum_size - ehdr->e_phoff < size))
-+	    {
-+	      /* Something is wrong.  */
-+	      __libelf_seterrno (ELF_E_INVALID_PHDR);
-+	      goto out;
-+	    }
-+
- 	  /* All the data is already mapped.  Use it.  */
- 	  void *file_phdr = ((char *) elf->map_address
- 			     + elf->start_offset + ehdr->e_phoff);
-Index: elfutils-0.148/libelf/elf32_getshdr.c
-===================================================================
---- elfutils-0.148.orig/libelf/elf32_getshdr.c	2009-06-13 22:41:42.000000000 +0000
-+++ elfutils-0.148/libelf/elf32_getshdr.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Return section header.
--   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2009 Red Hat, Inc.
-+   Copyright (C) 1998-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 1998.
- 
-@@ -81,7 +81,8 @@
-     goto out;
- 
-   size_t shnum;
--  if (__elf_getshdrnum_rdlock (elf, &shnum) != 0)
-+  if (__elf_getshdrnum_rdlock (elf, &shnum) != 0
-+      || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr)))
-     goto out;
-   size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
- 
-@@ -98,6 +99,16 @@
- 
-   if (elf->map_address != NULL)
-     {
-+      /* First see whether the information in the ELF header is
-+	 valid and it does not ask for too much.  */
-+      if (unlikely (ehdr->e_shoff >= elf->maximum_size)
-+	  || unlikely (elf->maximum_size - ehdr->e_shoff < size))
-+	{
-+	  /* Something is wrong.  */
-+	  __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
-+	  goto free_and_out;
-+	}
-+
-       ElfW2(LIBELFBITS,Shdr) *notcvt;
- 
-       /* All the data is already mapped.  If we could use it
-Index: elfutils-0.148/libelf/elf32_newphdr.c
-===================================================================
---- elfutils-0.148.orig/libelf/elf32_newphdr.c	2010-01-12 16:57:54.000000000 +0000
-+++ elfutils-0.148/libelf/elf32_newphdr.c	2010-07-03 13:07:11.000000000 +0000
-@@ -135,6 +135,12 @@
- 	   || count == PN_XNUM
- 	   || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
-     {
-+      if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr))))
-+	{
-+	  result = NULL;
-+	  goto out;
-+	}
-+
-       /* Allocate a new program header with the appropriate number of
- 	 elements.  */
-       result = (ElfW2(LIBELFBITS,Phdr) *)
-Index: elfutils-0.148/libelf/elf32_updatefile.c
-===================================================================
---- elfutils-0.148.orig/libelf/elf32_updatefile.c	2010-01-12 16:57:54.000000000 +0000
-+++ elfutils-0.148/libelf/elf32_updatefile.c	2010-07-03 13:07:11.000000000 +0000
-@@ -223,6 +223,9 @@
-   /* Write all the sections.  Well, only those which are modified.  */
-   if (shnum > 0)
-     {
-+      if (unlikely (shnum > SIZE_MAX / sizeof (Elf_Scn *)))
-+ 	return 1;
-+
-       Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns;
-       Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *));
-       char *const shdr_start = ((char *) elf->map_address + elf->start_offset
-@@ -645,6 +648,10 @@
-   /* Write all the sections.  Well, only those which are modified.  */
-   if (shnum > 0)
-     {
-+      if (unlikely (shnum > SIZE_MAX / (sizeof (Elf_Scn *)
-+					+ sizeof (ElfW2(LIBELFBITS,Shdr)))))
-+	return 1;
-+
-       off_t shdr_offset = elf->start_offset + ehdr->e_shoff;
- #if EV_NUM != 2
-       xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR];
-Index: elfutils-0.148/libelf/elf_begin.c
-===================================================================
---- elfutils-0.148.orig/libelf/elf_begin.c	2010-04-21 14:26:40.000000000 +0000
-+++ elfutils-0.148/libelf/elf_begin.c	2010-07-03 13:07:11.000000000 +0000
-@@ -165,7 +165,8 @@
- 
-       if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
- 	{
--	  if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
-+	  if (unlikely (ehdr.e32->e_shoff >= maxsize)
-+	      || unlikely (maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr)))
- 	    /* Cannot read the first section header.  */
- 	    return 0;
- 
-@@ -213,7 +214,8 @@
- 
-       if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
- 	{
--	  if (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
-+	  if (unlikely (ehdr.e64->e_shoff >= maxsize)
-+	      || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize))
- 	    /* Cannot read the first section header.  */
- 	    return 0;
- 
-@@ -285,6 +287,15 @@
-     /* Could not determine the number of sections.  */
-     return NULL;
- 
-+  /* Check for too many sections.  */
-+  if (e_ident[EI_CLASS] == ELFCLASS32)
-+    {
-+      if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr)))
-+	return NULL;
-+    }
-+  else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr)))
-+    return NULL;
-+
-   /* We can now allocate the memory.  Even if there are no section headers,
-      we allocate space for a zeroth section in case we need it later.  */
-   const size_t scnmax = (scncnt ?: (cmd == ELF_C_RDWR || cmd == ELF_C_RDWR_MMAP)
-@@ -324,6 +335,16 @@
- 	{
- 	  /* We can use the mmapped memory.  */
- 	  elf->state.elf32.ehdr = ehdr;
-+
-+	  if (unlikely (ehdr->e_shoff >= maxsize)
-+	      || unlikely (maxsize - ehdr->e_shoff
-+			   < scncnt * sizeof (Elf32_Shdr)))
-+	    {
-+	    free_and_out:
-+	      free (elf);
-+	      __libelf_seterrno (ELF_E_INVALID_FILE);
-+	      return NULL;
-+	    }
- 	  elf->state.elf32.shdr
- 	    = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff);
- 
-@@ -410,6 +431,11 @@
- 	{
- 	  /* We can use the mmapped memory.  */
- 	  elf->state.elf64.ehdr = ehdr;
-+
-+	  if (unlikely (ehdr->e_shoff >= maxsize)
-+	      || unlikely (ehdr->e_shoff
-+			   + scncnt * sizeof (Elf32_Shdr) > maxsize))
-+	    goto free_and_out;
- 	  elf->state.elf64.shdr
- 	    = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff);
- 
-Index: elfutils-0.148/libelf/elf_getarsym.c
-===================================================================
---- elfutils-0.148.orig/libelf/elf_getarsym.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/elf_getarsym.c	2010-07-03 13:07:11.000000000 +0000
-@@ -179,6 +179,9 @@
-       size_t index_size = atol (tmpbuf);
- 
-       if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
-+#if SIZE_MAX <= 4294967295U
-+	  || n >= SIZE_MAX / sizeof (Elf_Arsym)
-+#endif
- 	  || n * sizeof (uint32_t) > index_size)
- 	{
- 	  /* This index table cannot be right since it does not fit into
-Index: elfutils-0.148/libelf/elf_getshdrstrndx.c
-===================================================================
---- elfutils-0.148.orig/libelf/elf_getshdrstrndx.c	2009-06-13 22:31:35.000000000 +0000
-+++ elfutils-0.148/libelf/elf_getshdrstrndx.c	2010-07-03 13:07:11.000000000 +0000
-@@ -125,10 +125,25 @@
- 	      if (elf->map_address != NULL
- 		  && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
- 		  && (ALLOW_UNALIGNED
--		      || (((size_t) ((char *) elf->map_address + offset))
-+		      || (((size_t) ((char *) elf->map_address
-+			   + elf->start_offset + offset))
- 			  & (__alignof__ (Elf32_Shdr) - 1)) == 0))
--		/* We can directly access the memory.  */
--		num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link;
-+		{
-+		  /* First see whether the information in the ELF header is
-+		     valid and it does not ask for too much.  */
-+		  if (unlikely (elf->maximum_size - offset
-+				< sizeof (Elf32_Shdr)))
-+		    {
-+		      /* Something is wrong.  */
-+		      __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
-+		      result = -1;
-+		      goto out;
-+		    }
-+
-+		  /* We can directly access the memory.  */
-+		  num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset
-+					 + offset))->sh_link;
-+		}
- 	      else
- 		{
- 		  /* We avoid reading in all the section headers.  Just read
-@@ -163,10 +178,25 @@
- 	      if (elf->map_address != NULL
- 		  && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
- 		  && (ALLOW_UNALIGNED
--		      || (((size_t) ((char *) elf->map_address + offset))
-+		      || (((size_t) ((char *) elf->map_address
-+			   + elf->start_offset + offset))
- 			  & (__alignof__ (Elf64_Shdr) - 1)) == 0))
--		/* We can directly access the memory.  */
--		num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link;
-+		{
-+		  /* First see whether the information in the ELF header is
-+		     valid and it does not ask for too much.  */
-+		  if (unlikely (elf->maximum_size - offset
-+				< sizeof (Elf64_Shdr)))
-+		    {
-+		      /* Something is wrong.  */
-+		      __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
-+		      result = -1;
-+		      goto out;
-+		    }
-+
-+		  /* We can directly access the memory.  */
-+		  num = ((Elf64_Shdr *) (elf->map_address + elf->start_offset
-+					 + offset))->sh_link;
-+		}
- 	      else
- 		{
- 		  /* We avoid reading in all the section headers.  Just read
-Index: elfutils-0.148/libelf/elf_newscn.c
-===================================================================
---- elfutils-0.148.orig/libelf/elf_newscn.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/elf_newscn.c	2010-07-03 13:07:11.000000000 +0000
-@@ -104,10 +104,18 @@
-   else
-     {
-       /* We must allocate a new element.  */
--      Elf_ScnList *newp;
-+      Elf_ScnList *newp = NULL;
- 
-       assert (elf->state.elf.scnincr > 0);
- 
-+      if (
-+#if SIZE_MAX <= 4294967295U
-+	  likely (elf->state.elf.scnincr
-+		  < SIZE_MAX / 2 / sizeof (Elf_Scn) - sizeof (Elf_ScnList))
-+#else
-+	  1
-+#endif
-+	  )
-       newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList)
- 				     + ((elf->state.elf.scnincr *= 2)
- 					* sizeof (Elf_Scn)), 1);
-Index: elfutils-0.148/libelf/gelf_getdyn.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_getdyn.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_getdyn.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Get information from dynamic table at the given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -93,7 +93,7 @@
- 	 table entries has to be adopted.  The user better has provided
- 	 a buffer where we can store the information.  While copying the
- 	 data we are converting the format.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -114,7 +114,7 @@
- 
-       /* The data is already in the correct form.  Just make sure the
- 	 index is OK.  */
--      if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, GElf_Dyn, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-Index: elfutils-0.148/libelf/gelf_getlib.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_getlib.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_getlib.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Get library from table at the given index.
--   Copyright (C) 2004 Red Hat, Inc.
-+   Copyright (C) 2004-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2004.
- 
-@@ -86,7 +86,7 @@
-   /* The data is already in the correct form.  Just make sure the
-      index is OK.  */
-   GElf_Lib *result = NULL;
--  if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
-+  if (INVALID_NDX (ndx, GElf_Lib, data))
-     __libelf_seterrno (ELF_E_INVALID_INDEX);
-   else
-     {
-Index: elfutils-0.148/libelf/gelf_getmove.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_getmove.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_getmove.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Get move structure at the given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -83,7 +83,7 @@
- 
-   /* The data is already in the correct form.  Just make sure the
-      index is OK.  */
--  if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
-+  if (INVALID_NDX (ndx, GElf_Move, data))
-     {
-       __libelf_seterrno (ELF_E_INVALID_INDEX);
-       goto out;
-Index: elfutils-0.148/libelf/gelf_getrela.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_getrela.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_getrela.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Get RELA relocation information at given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -71,12 +71,6 @@
-   if (data_scn == NULL)
-     return NULL;
- 
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return NULL;
--    }
--
-   if (unlikely (data_scn->d.d_type != ELF_T_RELA))
-     {
-       __libelf_seterrno (ELF_E_INVALID_HANDLE);
-@@ -93,7 +87,7 @@
-   if (scn->elf->class == ELFCLASS32)
-     {
-       /* We have to convert the data.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  result = NULL;
-@@ -114,7 +108,7 @@
-     {
-       /* Simply copy the data after we made sure we are actually getting
- 	 correct data.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  result = NULL;
-Index: elfutils-0.148/libelf/gelf_getrel.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_getrel.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_getrel.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Get REL relocation information at given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -71,12 +71,6 @@
-   if (data_scn == NULL)
-     return NULL;
- 
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return NULL;
--    }
--
-   if (unlikely (data_scn->d.d_type != ELF_T_REL))
-     {
-       __libelf_seterrno (ELF_E_INVALID_HANDLE);
-@@ -93,7 +87,7 @@
-   if (scn->elf->class == ELFCLASS32)
-     {
-       /* We have to convert the data.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  result = NULL;
-@@ -113,7 +107,7 @@
-     {
-       /* Simply copy the data after we made sure we are actually getting
- 	 correct data.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  result = NULL;
-Index: elfutils-0.148/libelf/gelf_getsym.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_getsym.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_getsym.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Get symbol information from symbol table at the given index.
--   Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 1999-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 1999.
- 
-@@ -90,7 +90,7 @@
- 	 table entries has to be adopted.  The user better has provided
- 	 a buffer where we can store the information.  While copying the
- 	 data we are converting the format.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
-+      if (INVALID_NDX (ndx, Elf32_Sym, data))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -119,7 +119,7 @@
- 
-       /* The data is already in the correct form.  Just make sure the
- 	 index is OK.  */
--      if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
-+      if (INVALID_NDX (ndx, GElf_Sym, data))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-Index: elfutils-0.148/libelf/gelf_getsyminfo.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_getsyminfo.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_getsyminfo.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Get additional symbol information from symbol table at the given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -84,7 +84,7 @@
- 
-   /* The data is already in the correct form.  Just make sure the
-      index is OK.  */
--  if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
-+  if (INVALID_NDX (ndx, GElf_Syminfo, data))
-     {
-       __libelf_seterrno (ELF_E_INVALID_INDEX);
-       goto out;
-Index: elfutils-0.148/libelf/gelf_getsymshndx.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_getsymshndx.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_getsymshndx.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,6 +1,6 @@
- /* Get symbol information and separate section index from symbol table
-    at the given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -90,7 +90,7 @@
-      section index table.  */
-   if (likely (shndxdata_scn != NULL))
-     {
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Word, &shndxdata_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -110,7 +110,7 @@
- 	 table entries has to be adopted.  The user better has provided
- 	 a buffer where we can store the information.  While copying the
- 	 data we are converting the format.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
-+      if (INVALID_NDX (ndx, Elf32_Sym, symdata))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -139,7 +139,7 @@
- 
-       /* The data is already in the correct form.  Just make sure the
- 	 index is OK.  */
--      if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
-+      if (INVALID_NDX (ndx, GElf_Sym, symdata))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-Index: elfutils-0.148/libelf/gelf_getversym.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_getversym.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_getversym.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Get symbol version information at the given index.
--   Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 1999-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 1999.
- 
-@@ -92,7 +92,7 @@
- 
-   /* The data is already in the correct form.  Just make sure the
-      index is OK.  */
--  if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
-+  if (INVALID_NDX (ndx, GElf_Versym, data))
-     {
-       __libelf_seterrno (ELF_E_INVALID_INDEX);
-       result = NULL;
-Index: elfutils-0.148/libelf/gelf_update_dyn.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_update_dyn.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_update_dyn.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Update information in dynamic table at the given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -71,12 +71,6 @@
-   if (data == NULL)
-     return 0;
- 
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return 0;
--    }
--
-   if (unlikely (data_scn->d.d_type != ELF_T_DYN))
-     {
-       /* The type of the data better should match.  */
-@@ -102,7 +96,7 @@
- 	}
- 
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -116,7 +110,7 @@
-   else
-     {
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Dyn, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-Index: elfutils-0.148/libelf/gelf_update_lib.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_update_lib.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_update_lib.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Update library in table at the given index.
--   Copyright (C) 2004 Red Hat, Inc.
-+   Copyright (C) 2004-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2004.
- 
-@@ -68,12 +68,6 @@
-   if (data == NULL)
-     return 0;
- 
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return 0;
--    }
--
-   Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
-   if (unlikely (data_scn->d.d_type != ELF_T_LIB))
-     {
-@@ -87,7 +81,7 @@
- 
-   /* Check whether we have to resize the data buffer.  */
-   int result = 0;
--  if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
-+  if (INVALID_NDX (ndx, Elf64_Lib, &data_scn->d))
-     __libelf_seterrno (ELF_E_INVALID_INDEX);
-   else
-     {
-Index: elfutils-0.148/libelf/gelf_update_move.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_update_move.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_update_move.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Update move structure at the given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -75,8 +75,7 @@
-   assert (sizeof (GElf_Move) == sizeof (Elf64_Move));
- 
-   /* Check whether we have to resize the data buffer.  */
--  if (unlikely (ndx < 0)
--      || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
-+  if (INVALID_NDX (ndx, GElf_Move, &data_scn->d))
-     {
-       __libelf_seterrno (ELF_E_INVALID_INDEX);
-       return 0;
-Index: elfutils-0.148/libelf/gelf_update_rela.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_update_rela.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_update_rela.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Update RELA relocation information at given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -68,12 +68,6 @@
-   if (dst == NULL)
-     return 0;
- 
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return 0;
--    }
--
-   if (unlikely (data_scn->d.d_type != ELF_T_RELA))
-     {
-       /* The type of the data better should match.  */
-@@ -101,7 +95,7 @@
- 	}
- 
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -117,7 +111,7 @@
-   else
-     {
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-Index: elfutils-0.148/libelf/gelf_update_rel.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_update_rel.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_update_rel.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Update REL relocation information at given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -68,12 +68,6 @@
-   if (dst == NULL)
-     return 0;
- 
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return 0;
--    }
--
-   if (unlikely (data_scn->d.d_type != ELF_T_REL))
-     {
-       /* The type of the data better should match.  */
-@@ -99,7 +93,7 @@
- 	}
- 
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -114,7 +108,7 @@
-   else
-     {
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-Index: elfutils-0.148/libelf/gelf_update_sym.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_update_sym.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_update_sym.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Update symbol information in symbol table at the given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -72,12 +72,6 @@
-   if (data == NULL)
-     return 0;
- 
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return 0;
--    }
--
-   if (unlikely (data_scn->d.d_type != ELF_T_SYM))
-     {
-       /* The type of the data better should match.  */
-@@ -102,7 +96,7 @@
- 	}
- 
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Sym, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -125,7 +119,7 @@
-   else
-     {
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Sym, &data_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-Index: elfutils-0.148/libelf/gelf_update_syminfo.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_update_syminfo.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_update_syminfo.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Update additional symbol information in symbol table at the given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -72,12 +72,6 @@
-   if (data == NULL)
-     return 0;
- 
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return 0;
--    }
--
-   if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO))
-     {
-       /* The type of the data better should match.  */
-@@ -93,7 +87,7 @@
-   rwlock_wrlock (scn->elf->lock);
- 
-   /* Check whether we have to resize the data buffer.  */
--  if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
-+  if (INVALID_NDX (ndx, GElf_Syminfo, &data_scn->d))
-     {
-       __libelf_seterrno (ELF_E_INVALID_INDEX);
-       goto out;
-Index: elfutils-0.148/libelf/gelf_update_symshndx.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_update_symshndx.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_update_symshndx.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,6 +1,6 @@
- /* Update symbol information and section index in symbol table at the
-    given index.
--   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2000-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
- 
-@@ -77,12 +77,6 @@
-   if (symdata == NULL)
-     return 0;
- 
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return 0;
--    }
--
-   if (unlikely (symdata_scn->d.d_type != ELF_T_SYM))
-     {
-       /* The type of the data better should match.  */
-@@ -128,7 +122,7 @@
- 	}
- 
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Sym, &symdata_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -151,7 +145,7 @@
-   else
-     {
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Sym, &symdata_scn->d))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-Index: elfutils-0.148/libelf/gelf_update_versym.c
-===================================================================
---- elfutils-0.148.orig/libelf/gelf_update_versym.c	2009-01-08 20:56:37.000000000 +0000
-+++ elfutils-0.148/libelf/gelf_update_versym.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1,5 +1,5 @@
- /* Update symbol version information.
--   Copyright (C) 2001, 2002 Red Hat, Inc.
-+   Copyright (C) 2001-2009 Red Hat, Inc.
-    This file is part of Red Hat elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2001.
- 
-@@ -75,8 +75,7 @@
-   assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym));
- 
-   /* Check whether we have to resize the data buffer.  */
--  if (unlikely (ndx < 0)
--      || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size))
-+  if (INVALID_NDX (ndx, GElf_Versym, &data_scn->d))
-     {
-       __libelf_seterrno (ELF_E_INVALID_INDEX);
-       return 0;
-Index: elfutils-0.148/libelf/libelfP.h
-===================================================================
---- elfutils-0.148.orig/libelf/libelfP.h	2010-01-12 16:57:54.000000000 +0000
-+++ elfutils-0.148/libelf/libelfP.h	2010-07-03 13:07:11.000000000 +0000
-@@ -608,4 +608,8 @@
- /* Align offset to 4 bytes as needed for note name and descriptor data.  */
- #define NOTE_ALIGN(n)	(((n) + 3) & -4U)
- 
-+/* Convenience macro.  */
-+#define INVALID_NDX(ndx, type, data) \
-+  unlikely ((data)->d_size / sizeof (type) <= (unsigned int) (ndx))
-+
- #endif  /* libelfP.h */
-Index: elfutils-0.148/src/ChangeLog
-===================================================================
---- elfutils-0.148.orig/src/ChangeLog	2010-07-03 13:07:10.000000000 +0000
-+++ elfutils-0.148/src/ChangeLog	2010-07-03 13:07:11.000000000 +0000
-@@ -1640,6 +1640,16 @@
- 	object symbols or symbols with unknown type.
- 	(check_rel): Likewise.
- 
-+2005-06-09  Roland McGrath  <roland@redhat.com>
-+
-+	* readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
-+	(handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
-+	(handle_scngrp): Check for bogus sh_info.
-+
-+	* strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
-+	st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
-+	Don't use assert on input values, instead bail with "illformed" error.
-+
- 2005-06-08  Roland McGrath  <roland@redhat.com>
- 
- 	* readelf.c (print_ops): Add consts.
-@@ -1690,6 +1700,19 @@
- 
- 	* readelf.c (dwarf_tag_string): Add new tags.
- 
-+2005-05-17  Jakub Jelinek  <jakub@redhat.com>
-+
-+	* elflint.c (check_hash): Don't check entries beyond end of section.
-+	(check_note): Don't crash if gelf_rawchunk fails.
-+	(section_name): Return <invalid> if gelf_getshdr returns NULL.
-+
-+2005-05-14  Jakub Jelinek  <jakub@redhat.com>
-+
-+	* elflint.c (section_name): Return "<invalid>" instead of
-+	crashing on invalid section name.
-+	(check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
-+	check_symtab_shndx, check_hash, check_versym): Robustify.
-+
- 2005-05-08  Roland McGrath  <roland@redhat.com>
- 
- 	* strip.c (handle_elf): Don't translate hash and versym data formats,
-Index: elfutils-0.148/src/elflint.c
-===================================================================
---- elfutils-0.148.orig/src/elflint.c	2010-04-13 20:08:02.000000000 +0000
-+++ elfutils-0.148/src/elflint.c	2010-07-03 13:07:11.000000000 +0000
-@@ -131,6 +131,10 @@
- /* Array to count references in section groups.  */
- static int *scnref;
- 
-+/* Numbers of sections and program headers.  */
-+static unsigned int shnum;
-+static unsigned int phnum;
-+
- 
- int
- main (int argc, char *argv[])
-@@ -319,10 +323,19 @@
- {
-   GElf_Shdr shdr_mem;
-   GElf_Shdr *shdr;
-+  const char *ret;
-+
-+  if ((unsigned int) idx > shnum)
-+    return "<invalid>";
- 
-   shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem);
-+  if (shdr == NULL)
-+    return "<invalid>";
- 
--  return elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
-+  ret = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
-+  if (ret == NULL)
-+    return "<invalid>";
-+  return ret;
- }
- 
- 
-@@ -344,11 +357,6 @@
-   (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
- 
- 
--/* Numbers of sections and program headers.  */
--static unsigned int shnum;
--static unsigned int phnum;
--
--
- static void
- check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
- {
-@@ -632,7 +640,8 @@
- 	  }
-       }
- 
--  if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT))
-+  size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT);
-+  if (shdr->sh_entsize != sh_entsize)
-     ERROR (gettext ("\
- section [%2u] '%s': entry size is does not match ElfXX_Sym\n"),
- 	   idx, section_name (ebl, idx));
-@@ -670,7 +679,7 @@
- 	       xndxscnidx, section_name (ebl, xndxscnidx));
-     }
- 
--  for (size_t cnt = 1; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-+  for (size_t cnt = 1; cnt < shdr->sh_size / sh_entsize; ++cnt)
-     {
-       sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
-       if (sym == NULL)
-@@ -690,7 +699,8 @@
-       else
- 	{
- 	  name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
--	  assert (name != NULL);
-+	  assert (name != NULL
-+		  || strshdr->sh_type != SHT_STRTAB);
- 	}
- 
-       if (sym->st_shndx == SHN_XINDEX)
-@@ -1038,9 +1048,11 @@
-     {
-       GElf_Shdr rcshdr_mem;
-       const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
--      assert (rcshdr != NULL);
- 
--      if (rcshdr->sh_type == SHT_DYNAMIC)
-+      if (rcshdr == NULL)
-+	break;
-+
-+      if (rcshdr->sh_type == SHT_DYNAMIC && rcshdr->sh_entsize)
- 	{
- 	  /* Found the dynamic section.  Look through it.  */
- 	  Elf_Data *d = elf_getdata (scn, NULL);
-@@ -1050,7 +1062,9 @@
- 	    {
- 	      GElf_Dyn dyn_mem;
- 	      GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem);
--	      assert (dyn != NULL);
-+
-+	      if (dyn == NULL)
-+		break;
- 
- 	      if (dyn->d_tag == DT_RELCOUNT)
- 		{
-@@ -1064,7 +1078,9 @@
- 		      /* Does the number specified number of relative
- 			 relocations exceed the total number of
- 			 relocations?  */
--		      if (dyn->d_un.d_val > shdr->sh_size / shdr->sh_entsize)
-+		      if (shdr->sh_entsize != 0
-+			  && dyn->d_un.d_val > (shdr->sh_size
-+						/ shdr->sh_entsize))
- 			ERROR (gettext ("\
- section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"),
- 			       idx, section_name (ebl, idx),
-@@ -1224,7 +1240,8 @@
- 	}
-     }
- 
--  if (shdr->sh_entsize != gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT))
-+  size_t sh_entsize = gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT);
-+  if (shdr->sh_entsize != sh_entsize)
-     ERROR (gettext (reltype == ELF_T_RELA ? "\
- section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\
- section [%2d] '%s': section entry size does not match ElfXX_Rel\n"),
-@@ -1447,7 +1464,8 @@
-   Elf_Data *symdata = elf_getdata (symscn, NULL);
-   enum load_state state = state_undecided;
- 
--  for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-+  size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT);
-+  for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
-     {
-       GElf_Rela rela_mem;
-       GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
-@@ -1497,7 +1515,8 @@
-   Elf_Data *symdata = elf_getdata (symscn, NULL);
-   enum load_state state = state_undecided;
- 
--  for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-+  size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT);
-+  for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
-     {
-       GElf_Rel rel_mem;
-       GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
-@@ -1600,7 +1619,8 @@
- 	   shdr->sh_link, section_name (ebl, shdr->sh_link),
- 	   idx, section_name (ebl, idx));
- 
--  if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT))
-+  size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
-+  if (shdr->sh_entsize != sh_entsize)
-     ERROR (gettext ("\
- section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
- 	   idx, section_name (ebl, idx));
-@@ -1610,7 +1630,7 @@
- 	   idx, section_name (ebl, idx));
- 
-   bool non_null_warned = false;
--  for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-+  for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
-     {
-       GElf_Dyn dyn_mem;
-       GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
-@@ -1891,6 +1911,8 @@
- 	   idx, section_name (ebl, idx));
- 
-   if (symshdr != NULL
-+      && shdr->sh_entsize
-+      && symshdr->sh_entsize
-       && (shdr->sh_size / shdr->sh_entsize
- 	  < symshdr->sh_size / symshdr->sh_entsize))
-     ERROR (gettext ("\
-@@ -1917,6 +1939,12 @@
-     }
- 
-   Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
-+  if (data == NULL)
-+    {
-+      ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
-+ 	     idx, section_name (ebl, idx));
-+      return;
-+    }
- 
-   if (*((Elf32_Word *) data->d_buf) != 0)
-     ERROR (gettext ("symbol 0 should have zero extended section index\n"));
-@@ -1959,7 +1987,7 @@
- 
-   size_t maxidx = nchain;
- 
--  if (symshdr != NULL)
-+  if (symshdr != NULL && symshdr->sh_entsize != 0)
-     {
-       size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
- 
-@@ -1970,18 +1998,28 @@
-       maxidx = symsize;
-     }
- 
-+  Elf32_Word *buf = (Elf32_Word *) data->d_buf;
-+  Elf32_Word *end = (Elf32_Word *) ((char *) data->d_buf + shdr->sh_size);
-   size_t cnt;
-   for (cnt = 2; cnt < 2 + nbucket; ++cnt)
--    if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
-+    {
-+      if (buf + cnt >= end)
-+	break;
-+      else if (buf[cnt] >= maxidx)
-       ERROR (gettext ("\
- section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
- 	     idx, section_name (ebl, idx), cnt - 2);
-+    }
- 
-   for (; cnt < 2 + nbucket + nchain; ++cnt)
--    if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
-+    {
-+      if (buf + cnt >= end)
-+	break;
-+      else if (buf[cnt] >= maxidx)
-       ERROR (gettext ("\
- section [%2d] '%s': hash chain reference %zu out of bounds\n"),
- 	     idx, section_name (ebl, idx), cnt - 2 - nbucket);
-+    }
- }
- 
- 
-@@ -2011,18 +2049,28 @@
-       maxidx = symsize;
-     }
- 
-+  Elf64_Xword *buf = (Elf64_Xword *) data->d_buf;
-+  Elf64_Xword *end = (Elf64_Xword *) ((char *) data->d_buf + shdr->sh_size);
-   size_t cnt;
-   for (cnt = 2; cnt < 2 + nbucket; ++cnt)
--    if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
-+    {
-+      if (buf + cnt >= end)
-+	break;
-+      else if (buf[cnt] >= maxidx)
-       ERROR (gettext ("\
- section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
- 	     idx, section_name (ebl, idx), cnt - 2);
-+    }
- 
-   for (; cnt < 2 + nbucket + nchain; ++cnt)
--    if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
-+    {
-+      if (buf + cnt >= end)
-+	break;
-+      else if (buf[cnt] >= maxidx)
-       ERROR (gettext ("\
- section [%2d] '%s': hash chain reference %" PRIu64 " out of bounds\n"),
--	     idx, section_name (ebl, idx), (uint64_t) (cnt - 2 - nbucket));
-+	       idx, section_name (ebl, idx), (uint64_t) cnt - 2 - nbucket);
-+    }
- }
- 
- 
-@@ -2047,7 +2095,7 @@
-   if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))
-     {
-       ERROR (gettext ("\
--section [%2d] '%s': hash table section is too small (is %ld, expected at least%ld)\n"),
-+section [%2d] '%s': hash table section is too small (is %ld, expected at least %ld)\n"),
- 	     idx, section_name (ebl, idx), (long int) shdr->sh_size,
- 	     (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)));
-       return;
-@@ -2719,8 +2767,9 @@
- 
-   /* The number of elements in the version symbol table must be the
-      same as the number of symbols.  */
--  if (shdr->sh_size / shdr->sh_entsize
--      != symshdr->sh_size / symshdr->sh_entsize)
-+  if (shdr->sh_entsize && symshdr->sh_entsize
-+      && (shdr->sh_size / shdr->sh_entsize
-+	  != symshdr->sh_size / symshdr->sh_entsize))
-     ERROR (gettext ("\
- section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"),
- 	   idx, section_name (ebl, idx),
-Index: elfutils-0.148/src/readelf.c
-===================================================================
---- elfutils-0.148.orig/src/readelf.c	2010-07-03 13:07:10.000000000 +0000
-+++ elfutils-0.148/src/readelf.c	2010-07-03 13:07:11.000000000 +0000
-@@ -1172,6 +1172,8 @@
-   Elf32_Word *grpref = (Elf32_Word *) data->d_buf;
- 
-   GElf_Sym sym_mem;
-+  GElf_Sym *sym = gelf_getsym (symdata, shdr->sh_info, &sym_mem);
-+
-   printf ((grpref[0] & GRP_COMDAT)
- 	  ? ngettext ("\
- \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n",
-@@ -1184,8 +1186,8 @@
- 		      data->d_size / sizeof (Elf32_Word) - 1),
- 	  elf_ndxscn (scn),
- 	  elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
--	  elf_strptr (ebl->elf, symshdr->sh_link,
--		      gelf_getsym (symdata, shdr->sh_info, &sym_mem)->st_name)
-+	  (sym == NULL ? NULL
-+	   : elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name))
- 	  ?: gettext ("<INVALID SYMBOL>"),
- 	  data->d_size / sizeof (Elf32_Word) - 1);
- 
-@@ -1336,7 +1338,8 @@
- handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
- {
-   int class = gelf_getclass (ebl->elf);
--  GElf_Shdr glink;
-+  GElf_Shdr glink_mem;
-+  GElf_Shdr *glink;
-   Elf_Data *data;
-   size_t cnt;
-   size_t shstrndx;
-@@ -1351,6 +1354,11 @@
-     error (EXIT_FAILURE, 0,
- 	   gettext ("cannot get section header string table index"));
- 
-+  glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
-+  if (glink == NULL)
-+    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
-+	   elf_ndxscn (scn));
-+
-   printf (ngettext ("\
- \nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
- 		    "\
-@@ -1360,9 +1368,7 @@
- 	  class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
- 	  shdr->sh_offset,
- 	  (int) shdr->sh_link,
--	  elf_strptr (ebl->elf, shstrndx,
--		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
--				    &glink)->sh_name));
-+	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
-   fputs_unlocked (gettext ("  Type              Value\n"), stdout);
- 
-   for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-@@ -1945,6 +1951,13 @@
-     error (EXIT_FAILURE, 0,
- 	   gettext ("cannot get section header string table index"));
- 
-+  GElf_Shdr glink_mem;
-+  GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
-+				   &glink_mem);
-+  if (glink == NULL)
-+    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
-+	   elf_ndxscn (scn));
-+
-   /* Now we can compute the number of entries in the section.  */
-   unsigned int nsyms = data->d_size / (class == ELFCLASS32
- 				       ? sizeof (Elf32_Sym)
-@@ -1955,15 +1968,12 @@
- 		    nsyms),
- 	  (unsigned int) elf_ndxscn (scn),
- 	  elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
--  GElf_Shdr glink;
-   printf (ngettext (" %lu local symbol  String table: [%2u] '%s'\n",
- 		    " %lu local symbols  String table: [%2u] '%s'\n",
- 		    shdr->sh_info),
- 	  (unsigned long int) shdr->sh_info,
- 	  (unsigned int) shdr->sh_link,
--	  elf_strptr (ebl->elf, shstrndx,
--		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
--				    &glink)->sh_name));
-+	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
- 
-   fputs_unlocked (class == ELFCLASS32
- 		  ? gettext ("\
-@@ -2199,7 +2209,13 @@
-     error (EXIT_FAILURE, 0,
- 	   gettext ("cannot get section header string table index"));
- 
--  GElf_Shdr glink;
-+  GElf_Shdr glink_mem;
-+  GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
-+				   &glink_mem);
-+  if (glink == NULL)
-+    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
-+	   elf_ndxscn (scn));
-+
-   printf (ngettext ("\
- \nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
- 		    "\
-@@ -2210,9 +2226,7 @@
- 	  class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
- 	  shdr->sh_offset,
- 	  (unsigned int) shdr->sh_link,
--	  elf_strptr (ebl->elf, shstrndx,
--		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
--				    &glink)->sh_name));
-+	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
- 
-   unsigned int offset = 0;
-   for (int cnt = shdr->sh_info; --cnt >= 0; )
-@@ -2265,8 +2279,14 @@
-     error (EXIT_FAILURE, 0,
- 	   gettext ("cannot get section header string table index"));
- 
-+  GElf_Shdr glink_mem;
-+  GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
-+				   &glink_mem);
-+  if (glink == NULL)
-+    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
-+	   elf_ndxscn (scn));
-+
-   int class = gelf_getclass (ebl->elf);
--  GElf_Shdr glink;
-   printf (ngettext ("\
- \nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
- 		    "\
-@@ -2278,9 +2298,7 @@
- 	  class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
- 	  shdr->sh_offset,
- 	  (unsigned int) shdr->sh_link,
--	  elf_strptr (ebl->elf, shstrndx,
--		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
--				    &glink)->sh_name));
-+	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
- 
-   unsigned int offset = 0;
-   for (int cnt = shdr->sh_info; --cnt >= 0; )
-@@ -2542,8 +2560,14 @@
-       filename = NULL;
-     }
- 
-+  GElf_Shdr glink_mem;
-+  GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
-+				   &glink_mem);
-+  if (glink == NULL)
-+    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
-+	   elf_ndxscn (scn));
-+
-   /* Print the header.  */
--  GElf_Shdr glink;
-   printf (ngettext ("\
- \nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'",
- 		    "\
-@@ -2555,9 +2579,7 @@
- 	  class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
- 	  shdr->sh_offset,
- 	  (unsigned int) shdr->sh_link,
--	  elf_strptr (ebl->elf, shstrndx,
--		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
--				    &glink)->sh_name));
-+	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
- 
-   /* Now we can finally look at the actual contents of this section.  */
-   for (unsigned int cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-@@ -2609,7 +2631,17 @@
-   for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt)
-     ++counts[lengths[cnt]];
- 
--  GElf_Shdr glink;
-+  GElf_Shdr glink_mem;
-+  GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf,
-+					       shdr->sh_link),
-+				   &glink_mem);
-+  if (glink == NULL)
-+    {
-+      error (0, 0, gettext ("invalid sh_link value in section %Zu"),
-+	     elf_ndxscn (scn));
-+      return;
-+    }
-+
-   printf (ngettext ("\
- \nHistogram for bucket list length in section [%2u] '%s' (total of %d bucket):\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
- 		    "\
-@@ -2622,9 +2654,7 @@
- 	  shdr->sh_addr,
- 	  shdr->sh_offset,
- 	  (unsigned int) shdr->sh_link,
--	  elf_strptr (ebl->elf, shstrndx,
--		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
--				    &glink)->sh_name));
-+	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
- 
-   if (extrastr != NULL)
-     fputs (extrastr, stdout);
-@@ -4312,6 +4342,16 @@
-       return;
-     }
- 
-+  GElf_Shdr glink_mem;
-+  GElf_Shdr *glink;
-+  glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
-+  if (glink == NULL)
-+    {
-+      error (0, 0, gettext ("invalid sh_link value in section %Zu"),
-+	     elf_ndxscn (scn));
-+      return;
-+    }
-+
-   printf (ngettext ("\
- \nDWARF section [%2zu] '%s' at offset %#" PRIx64 " contains %zu entry:\n",
- 		    "\
-Index: elfutils-0.148/src/strip.c
-===================================================================
---- elfutils-0.148.orig/src/strip.c	2010-07-03 13:07:10.000000000 +0000
-+++ elfutils-0.148/src/strip.c	2010-07-03 13:07:11.000000000 +0000
-@@ -561,6 +561,11 @@
-       goto fail_close;
-     }
- 
-+  if (shstrndx >= shnum)
-+    goto illformed;
-+
-+#define elf_assert(test) do { if (!(test)) goto illformed; } while (0)
-+
-   /* Storage for section information.  We leave room for two more
-      entries since we unconditionally create a section header string
-      table.  Maybe some weird tool created an ELF file without one.
-@@ -582,7 +587,7 @@
-     {
-       /* This should always be true (i.e., there should not be any
- 	 holes in the numbering).  */
--      assert (elf_ndxscn (scn) == cnt);
-+      elf_assert (elf_ndxscn (scn) == cnt);
- 
-       shdr_info[cnt].scn = scn;
- 
-@@ -595,6 +600,7 @@
- 					shdr_info[cnt].shdr.sh_name);
-       if (shdr_info[cnt].name == NULL)
- 	{
-+	illformed:
- 	  error (0, 0, gettext ("illformed file '%s'"), fname);
- 	  goto fail_close;
- 	}
-@@ -604,6 +610,8 @@
- 
-       /* Remember the shdr.sh_link value.  */
-       shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link;
-+      if (shdr_info[cnt].old_sh_link >= shnum)
-+	goto illformed;
- 
-       /* Sections in files other than relocatable object files which
- 	 are not loaded can be freely moved by us.  In relocatable
-@@ -616,7 +624,7 @@
- 	 appropriate reference.  */
-       if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX))
- 	{
--	  assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
-+	  elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
- 	  shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt;
- 	}
-       else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP))
-@@ -633,7 +641,12 @@
- 	  for (inner = 1;
- 	       inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word);
- 	       ++inner)
-+	    {
-+	      if (grpref[inner] < shnum)
- 	    shdr_info[grpref[inner]].group_idx = cnt;
-+	      else
-+		goto illformed;
-+	    }
- 
- 	  if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0))
- 	    /* If the section group contains only one element and this
-@@ -644,7 +657,7 @@
- 	}
-       else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym))
- 	{
--	  assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
-+	  elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
- 	  shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt;
- 	}
- 
-@@ -652,7 +665,7 @@
- 	 discarded right away.  */
-       if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0)
- 	{
--	  assert (shdr_info[cnt].group_idx != 0);
-+	  elf_assert (shdr_info[cnt].group_idx != 0);
- 
- 	  if (shdr_info[shdr_info[cnt].group_idx].idx == 0)
- 	    {
-@@ -727,11 +740,15 @@
- 	    {
- 	      /* If a relocation section is marked as being removed make
- 		 sure the section it is relocating is removed, too.  */
--	      if ((shdr_info[cnt].shdr.sh_type == SHT_REL
-+	      if (shdr_info[cnt].shdr.sh_type == SHT_REL
- 		   || shdr_info[cnt].shdr.sh_type == SHT_RELA)
--		  && shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
-+		{
-+		  if (shdr_info[cnt].shdr.sh_info >= shnum)
-+		    goto illformed;
-+		  else if (shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
- 		shdr_info[cnt].idx = 1;
- 	    }
-+	    }
- 
- 	  if (shdr_info[cnt].idx == 1)
- 	    {
-@@ -758,7 +775,7 @@
- 		  if (shdr_info[cnt].symtab_idx != 0
- 		      && shdr_info[shdr_info[cnt].symtab_idx].data == NULL)
- 		    {
--		      assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
-+		      elf_assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
- 
- 		      shdr_info[shdr_info[cnt].symtab_idx].data
- 			= elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
-@@ -798,6 +815,9 @@
- 		      else if (scnidx == SHN_XINDEX)
- 			scnidx = xndx;
- 
-+		      if (scnidx >= shnum)
-+			goto illformed;
-+
- 		      if (shdr_info[scnidx].idx == 0)
- 			/* This symbol table has a real symbol in
- 			   a discarded section.  So preserve the
-@@ -828,12 +848,16 @@
- 		}
- 
- 	      /* Handle references through sh_info.  */
--	      if (SH_INFO_LINK_P (&shdr_info[cnt].shdr)
--		  && shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
-+	      if (SH_INFO_LINK_P (&shdr_info[cnt].shdr))
-+		{
-+		  if (shdr_info[cnt].shdr.sh_info >= shnum)
-+		    goto illformed;
-+		  else if ( shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
- 		{
- 		  shdr_info[shdr_info[cnt].shdr.sh_info].idx = 1;
- 		  changes |= shdr_info[cnt].shdr.sh_info < cnt;
- 		}
-+		}
- 
- 	      /* Mark the section as investigated.  */
- 	      shdr_info[cnt].idx = 2;
-@@ -972,7 +996,7 @@
- 	  error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"),
- 		 elf_errmsg (-1));
- 
--	assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
-+	elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
- 
- 	/* Add this name to the section header string table.  */
- 	shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
-@@ -1009,7 +1033,7 @@
- 	error (EXIT_FAILURE, 0,
- 	       gettext ("while create section header section: %s"),
- 	       elf_errmsg (-1));
--      assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
-+      elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
- 
-       shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn);
-       if (shdr_info[cnt].data == NULL)
-@@ -1065,7 +1089,7 @@
-     error (EXIT_FAILURE, 0,
- 	   gettext ("while create section header section: %s"),
- 	   elf_errmsg (-1));
--  assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
-+  elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
- 
-   /* Finalize the string table and fill in the correct indices in the
-      section headers.  */
-@@ -1155,20 +1179,20 @@
- 		    shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
- 					     NULL);
- 
--		    assert ((versiondata->d_size / sizeof (Elf32_Word))
-+		    elf_assert ((versiondata->d_size / sizeof (Elf32_Word))
- 			    >= shdr_info[cnt].data->d_size / elsize);
- 		  }
- 
- 		if (shdr_info[cnt].version_idx != 0)
- 		  {
--		    assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
-+		    elf_assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
- 		    /* This section has associated version
- 		       information.  We have to modify that
- 		       information, too.  */
- 		    versiondata = elf_getdata (shdr_info[shdr_info[cnt].version_idx].scn,
- 					       NULL);
- 
--		    assert ((versiondata->d_size / sizeof (GElf_Versym))
-+		    elf_assert ((versiondata->d_size / sizeof (GElf_Versym))
- 			    >= shdr_info[cnt].data->d_size / elsize);
- 		  }
- 
-@@ -1223,7 +1247,7 @@
- 		      sec = shdr_info[sym->st_shndx].idx;
- 		    else
- 		      {
--			assert (shndxdata != NULL);
-+			elf_assert (shndxdata != NULL);
- 
- 			sec = shdr_info[xshndx].idx;
- 		      }
-@@ -1244,7 +1268,7 @@
- 			    nxshndx = sec;
- 			  }
- 
--			assert (sec < SHN_LORESERVE || shndxdata != NULL);
-+			elf_assert (sec < SHN_LORESERVE || shndxdata != NULL);
- 
- 			if ((inner != destidx || nshndx != sym->st_shndx
- 			     || (shndxdata != NULL && nxshndx != xshndx))
-@@ -1268,7 +1292,7 @@
- 			     || shdr_info[cnt].debug_data == NULL)
- 		      /* This is a section symbol for a section which has
- 			 been removed.  */
--		      assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION);
-+		      elf_assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION);
- 		  }
- 
- 		if (destidx != inner)
-@@ -1455,11 +1479,11 @@
- 		  {
- 		    GElf_Sym sym_mem;
- 		    GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
--		    assert (sym != NULL);
-+		    elf_assert (sym != NULL);
- 
- 		    const char *name = elf_strptr (elf, strshndx,
- 						   sym->st_name);
--		    assert (name != NULL);
-+		    elf_assert (name != NULL);
- 		    size_t hidx = elf_hash (name) % nbucket;
- 
- 		    if (bucket[hidx] == 0)
-@@ -1478,7 +1502,7 @@
- 	    else
- 	      {
- 		/* Alpha and S390 64-bit use 64-bit SHT_HASH entries.  */
--		assert (shdr_info[cnt].shdr.sh_entsize
-+		elf_assert (shdr_info[cnt].shdr.sh_entsize
- 			== sizeof (Elf64_Xword));
- 
- 		Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf;
-@@ -1509,11 +1533,11 @@
- 		  {
- 		    GElf_Sym sym_mem;
- 		    GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
--		    assert (sym != NULL);
-+		    elf_assert (sym != NULL);
- 
- 		    const char *name = elf_strptr (elf, strshndx,
- 						   sym->st_name);
--		    assert (name != NULL);
-+		    elf_assert (name != NULL);
- 		    size_t hidx = elf_hash (name) % nbucket;
- 
- 		    if (bucket[hidx] == 0)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch
deleted file mode 100644
index 6a19791..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch
+++ /dev/null
@@ -1,154 +0,0 @@
-Upstream-Status: Backport
-
-Remove unused variables from the code to prevent -Werror causing a build
-failure on hosts with GCC 4.6.
-
-These changes are all upstream so should not be required once we've updated
-to elfutils 0.152 or later. Therefore this patch consolidates several
-changes from elfutils upstream by Roland McGrath into a single file so that
-it's easier to remove later once we upgrade.
-Links to upstream gitweb of the consolidated commits follow:
-- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=7094d00a169afb27e0323f8580e817798ae7c240
-- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=fd992543185126eb0280c1ee0883e073020499b4
-- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=4db89f04bb59327abd7a3b60e88f2e7e73c65c79
-- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=8f6c1795ab9d41f03805eebd55767070ade55aac
-- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=240784b48aa276822c5a61c9ad6a4355051ce259
-
-Joshua Lock <josh@linux.intel.com> - 06/04/11
-
-Index: elfutils-0.148/libasm/asm_newscn.c
-===================================================================
---- elfutils-0.148.orig/libasm/asm_newscn.c
-+++ elfutils-0.148/libasm/asm_newscn.c
-@@ -162,7 +162,6 @@ asm_newscn (ctx, scnname, type, flags)
-      GElf_Xword flags;
- {
-   size_t scnname_len = strlen (scnname) + 1;
--  unsigned long int hval;
-   AsmScn_t *result;
- 
-   /* If no context is given there might be an earlier error.  */
-@@ -180,8 +179,6 @@ asm_newscn (ctx, scnname, type, flags)
-       return NULL;
-     }
- 
--  hval = elf_hash (scnname);
--
-   rwlock_wrlock (ctx->lock);
- 
-   /* This is a new section.  */
-Index: elfutils-0.148/src/elflint.c
-===================================================================
---- elfutils-0.148.orig/src/elflint.c
-+++ elfutils-0.148/src/elflint.c
-@@ -707,9 +707,10 @@ section [%2d] '%s': symbol %zu: invalid 
- 	{
- 	  if (xndxdata == NULL)
- 	    {
--	      ERROR (gettext ("\
-+	      if (!no_xndx_warned)
-+		ERROR (gettext ("\
- section [%2d] '%s': symbol %zu: too large section index but no extended section index section\n"),
--		     idx, section_name (ebl, idx), cnt);
-+		       idx, section_name (ebl, idx), cnt);
- 	      no_xndx_warned = true;
- 	    }
- 	  else if (xndx < SHN_LORESERVE)
-@@ -1592,10 +1593,6 @@ check_dynamic (Ebl *ebl, GElf_Ehdr *ehdr
-       [DT_STRSZ] = true,
-       [DT_SYMENT] = true
-     };
--  GElf_Addr reladdr = 0;
--  GElf_Word relsz = 0;
--  GElf_Addr pltreladdr = 0;
--  GElf_Word pltrelsz = 0;
- 
-   memset (has_dt, '\0', sizeof (has_dt));
-   memset (has_val_dt, '\0', sizeof (has_val_dt));
-@@ -1694,15 +1691,6 @@ section [%2d] '%s': entry %zu: level 2 t
- section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"),
- 	       idx, section_name (ebl, idx), cnt);
- 
--      if (dyn->d_tag == DT_REL)
--	reladdr = dyn->d_un.d_ptr;
--      if (dyn->d_tag == DT_RELSZ)
--	relsz = dyn->d_un.d_val;
--      if (dyn->d_tag == DT_JMPREL)
--	pltreladdr = dyn->d_un.d_ptr;
--      if (dyn->d_tag == DT_PLTRELSZ)
--	pltrelsz = dyn->d_un.d_val;
--
-       /* Check that addresses for entries are in loaded segments.  */
-       switch (dyn->d_tag)
- 	{
-Index: elfutils-0.148/src/ldgeneric.c
-===================================================================
---- elfutils-0.148.orig/src/ldgeneric.c
-+++ elfutils-0.148/src/ldgeneric.c
-@@ -285,12 +285,10 @@ static int
- check_for_duplicate2 (struct usedfiles *newp, struct usedfiles *list)
- {
-   struct usedfiles *first;
--  struct usedfiles *prevp;
- 
-   if (list == NULL)
-     return 0;
- 
--  prevp = list;
-   list = first = list->next;
-   do
-     {
-Index: elfutils-0.148/src/ldscript.y
-===================================================================
---- elfutils-0.148.orig/src/ldscript.y
-+++ elfutils-0.148/src/ldscript.y
-@@ -802,12 +802,9 @@ add_versions (struct version *versions)
- 
-   do
-     {
--      struct version *oldp;
--
-       add_id_list (versions->versionname, versions->local_names, true);
-       add_id_list (versions->versionname, versions->global_names, false);
- 
--      oldp = versions;
-       versions = versions->next;
-     }
-   while (versions != NULL);
-Index: elfutils-0.148/src/unstrip.c
-===================================================================
---- elfutils-0.148.orig/src/unstrip.c
-+++ elfutils-0.148/src/unstrip.c
-@@ -1301,7 +1301,6 @@ more sections in stripped file than debu
-   /* Match each debuginfo section with its corresponding stripped section.  */
-   bool check_prelink = false;
-   Elf_Scn *unstripped_symtab = NULL;
--  size_t unstripped_strtab_ndx = SHN_UNDEF;
-   size_t alloc_avail = 0;
-   scn = NULL;
-   while ((scn = elf_nextscn (unstripped, scn)) != NULL)
-@@ -1313,7 +1312,6 @@ more sections in stripped file than debu
-       if (shdr->sh_type == SHT_SYMTAB)
- 	{
- 	  unstripped_symtab = scn;
--	  unstripped_strtab_ndx = shdr->sh_link;
- 	  continue;
- 	}
- 
-Index: elfutils-0.148/src/ldscript.c
-===================================================================
---- elfutils-0.148.orig/src/ldscript.c
-+++ elfutils-0.148/src/ldscript.c
-@@ -2728,12 +2728,9 @@ add_versions (struct version *versions)
- 
-   do
-     {
--      struct version *oldp;
--
-       add_id_list (versions->versionname, versions->local_names, true);
-       add_id_list (versions->versionname, versions->global_names, false);
- 
--      oldp = versions;
-       versions = versions->next;
-     }
-   while (versions != NULL);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff
deleted file mode 100644
index d792d5f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-Upstream-Status: Backport
-
-On many architectures this test fails because binaries/libs produced by
-binutils don't pass elflint. However elfutils shouldn't FTBFS because of this.
-
-So we run the tests on all archs to see what breaks, but if it breaks we ignore
-the result (exitcode 77 means: this test was skipped).
-
-Index: elfutils-0.128/tests/run-elflint-self.sh
-===================================================================
---- elfutils-0.128.orig/tests/run-elflint-self.sh	2007-07-08 21:46:16.000000000 +0000
-+++ elfutils-0.128/tests/run-elflint-self.sh	2007-07-08 21:46:49.000000000 +0000
-@@ -32,7 +32,7 @@
- #  echo $1
-   if [ -f $1 ]; then
-     testrun ../src/elflint --quiet --gnu-ld $1 ||
--    { echo "*** failure in $1"; status=1; }
-+    { echo "*** failure in $1"; status=77; }
-   fi
- }
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch
deleted file mode 100644
index 3cf16ac..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-on uclibc systems libintl and libuargp are separate from libc.
-so they need to be specified on commandline when we use proxy-libintl
-then libintl is a static archive so it should be listed last since
-elfutils does not respect disable-nls we need to link in libintl
-
-We add a new option --enable-uclibc which will be used to control
-the uclibc specific configurations during build.
-
-Signed-off-by: Khem Raj <raj.khem>
-
-Upstream-Status: Inappropriate [uclibc specific]
-
-Index: elfutils-0.148/configure.ac
-===================================================================
---- elfutils-0.148.orig/configure.ac
-+++ elfutils-0.148/configure.ac
-@@ -55,9 +55,16 @@ AS_IF([test "$use_locks" = yes], [AC_DEF
- 
- AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
- 
-+AC_ARG_ENABLE([uclibc],
-+AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
-+use_uclibc=yes, use_uclibc=no)
-+AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
-+AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
-+
-+AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
-+
- dnl Add all the languages for which translations are available.
- ALL_LINGUAS=
--
- AC_PROG_CC
- AC_PROG_RANLIB
- AC_PROG_YACC
-Index: elfutils-0.148/libelf/Makefile.am
-===================================================================
---- elfutils-0.148.orig/libelf/Makefile.am
-+++ elfutils-0.148/libelf/Makefile.am
-@@ -93,7 +93,12 @@ if !MUDFLAP
- libelf_pic_a_SOURCES =
- am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
- 
-+
- libelf_so_LDLIBS =
-+if USE_UCLIBC
-+libelf_so_LDLIBS += -lintl -luargp
-+endif
-+
- if USE_LOCKS
- libelf_so_LDLIBS += -lpthread
- endif
-Index: elfutils-0.148/libdw/Makefile.am
-===================================================================
---- elfutils-0.148.orig/libdw/Makefile.am
-+++ elfutils-0.148/libdw/Makefile.am
-@@ -98,6 +98,11 @@ if !MUDFLAP
- libdw_pic_a_SOURCES =
- am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
- 
-+libdw_so_LDLIBS =
-+if USE_UCLIBC
-+libdw_so_LDLIBS += -lintl -luargp
-+endif
-+
- libdw_so_SOURCES =
- libdw.so: $(srcdir)/libdw.map libdw_pic.a \
- 	  ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
-@@ -108,7 +113,7 @@ libdw.so: $(srcdir)/libdw.map libdw_pic.
- 		-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
- 		-Wl,--version-script,$<,--no-undefined \
- 		-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
--		-ldl $(zip_LIBS)
-+		-ldl $(zip_LIBS) $(libdw_so_LDLIBS)
- 	if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
- 	ln -fs $@ $@.$(VERSION)
- 
-Index: elfutils-0.148/libcpu/Makefile.am
-===================================================================
---- elfutils-0.148.orig/libcpu/Makefile.am
-+++ elfutils-0.148/libcpu/Makefile.am
-@@ -63,6 +63,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
- i386_lex.o: i386_parse.h
- i386_gendis_LDADD = $(libeu) -lm $(libmudflap)
- 
-+if USE_UCLIBC
-+i386_gendis_LDADD += -luargp -lintl
-+endif
-+
- i386_parse.h: i386_parse.c ;
- 
- noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h
deleted file mode 100644
index a0198be..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h
+++ /dev/null
@@ -1,1632 +0,0 @@
-#define MNEMONIC_BITS 10
-#define SUFFIX_BITS 3
-#define FCT1_BITS 7
-#define STR1_BITS 4
-#define OFF1_1_BITS 7
-#define OFF1_1_BIAS 3
-#define OFF1_2_BITS 7
-#define OFF1_2_BIAS 4
-#define OFF1_3_BITS 1
-#define OFF1_3_BIAS 7
-#define FCT2_BITS 6
-#define STR2_BITS 2
-#define OFF2_1_BITS 7
-#define OFF2_1_BIAS 5
-#define OFF2_2_BITS 7
-#define OFF2_2_BIAS 4
-#define OFF2_3_BITS 4
-#define OFF2_3_BIAS 7
-#define FCT3_BITS 4
-#define STR3_BITS 1
-#define OFF3_1_BITS 6
-#define OFF3_1_BIAS 10
-#define OFF3_2_BITS 1
-#define OFF3_2_BIAS 21
-
-#include <i386_data.h>
-
-#define suffix_none 0
-#define suffix_w 1
-#define suffix_w0 2
-#define suffix_W 3
-#define suffix_tttn 4
-#define suffix_D 7
-#define suffix_w1 5
-#define suffix_W1 6
-
-static const opfct_t op1_fct[] =
-{
-  NULL,
-  FCT_MOD$R_M,
-  FCT_Mod$R_m,
-  FCT_abs,
-  FCT_ax,
-  FCT_ax$w,
-  FCT_ccc,
-  FCT_ddd,
-  FCT_disp8,
-  FCT_ds_bx,
-  FCT_ds_si,
-  FCT_dx,
-  FCT_es_di,
-  FCT_freg,
-  FCT_imm$s,
-  FCT_imm$w,
-  FCT_imm16,
-  FCT_imm64$w,
-  FCT_imm8,
-  FCT_imms8,
-  FCT_mmxreg,
-  FCT_mod$16r_m,
-  FCT_mod$64r_m,
-  FCT_mod$8r_m,
-  FCT_mod$r_m,
-  FCT_mod$r_m$w,
-  FCT_reg,
-  FCT_reg$w,
-  FCT_reg64,
-  FCT_rel,
-  FCT_sel,
-  FCT_sreg2,
-  FCT_sreg3,
-  FCT_string,
-  FCT_xmmreg,
-};
-static const char op1_str[] =
-  "%ax\0"
-  "%cl\0"
-  "%rax\0"
-  "%st\0"
-  "%xmm0\0"
-  "*";
-static const uint8_t op1_str_idx[] = {
-  0,
-  4,
-  8,
-  13,
-  17,
-  23,
-};
-static const opfct_t op2_fct[] =
-{
-  NULL,
-  FCT_MOD$R_M,
-  FCT_Mod$R_m,
-  FCT_abs,
-  FCT_absval,
-  FCT_ax$w,
-  FCT_ccc,
-  FCT_ddd,
-  FCT_ds_si,
-  FCT_dx,
-  FCT_es_di,
-  FCT_freg,
-  FCT_imm8,
-  FCT_mmxreg,
-  FCT_mod$64r_m,
-  FCT_mod$r_m,
-  FCT_mod$r_m$w,
-  FCT_oreg,
-  FCT_oreg$w,
-  FCT_reg,
-  FCT_reg$w,
-  FCT_reg64,
-  FCT_sreg3,
-  FCT_string,
-  FCT_xmmreg,
-};
-static const char op2_str[] =
-  "%rcx\0"
-  "%st";
-static const uint8_t op2_str_idx[] = {
-  0,
-  5,
-};
-static const opfct_t op3_fct[] =
-{
-  NULL,
-  FCT_mmxreg,
-  FCT_mod$r_m,
-  FCT_reg,
-  FCT_string,
-  FCT_xmmreg,
-};
-static const char op3_str[] =
-  "%rdx";
-static const uint8_t op3_str_idx[] = {
-  0,
-};
-static const struct instr_enc instrtab[] =
-{
-  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movslq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bsf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bswap, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 26, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lcall, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_clc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cli, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_syscall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_clts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sysret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sysenter, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sysexit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmov, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmps, .rep = 0, .repe = 1, .suffix = 1, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 8, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpxchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cpuid, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtdq2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_dec, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_div, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_enter, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 19, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fabs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ftst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fxam, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fld1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldl2t, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldl2e, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldpi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldlg2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldln2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldz, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_f2xm1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fyl2x, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fptan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fpatan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fxtract, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fprem1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fprem, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fyl2xp1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsqrt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsincos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_frndint, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fscale, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsin, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnstenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnstcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fxch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_faddp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fiadd, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fmulp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fimul, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsubp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fisub, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fsubrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fisubr, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 1, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fbld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fbstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_finit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovnb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovnbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovnu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcompp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fucomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fucomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fidivl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fidiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fidivrl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fidivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ffree, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ficom, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ficomp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fild, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fildl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fildll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fninit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fist, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fistp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fistpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fisttp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fisttpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fstpt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fucom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_frstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fucomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_hlt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_idiv, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 14, .str1 = 0, .off1_1 = 13, .off1_2 = 2, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_inc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ins, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_int, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_int3, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_invd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_swapgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_invlpg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_iret, .rep = 0, .repe = 0, .suffix = 6, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 30, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 4, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lar, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lea, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_leave, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lfs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lgdt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lidt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lmsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lock, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lods, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_loop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_loope, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_loopne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lsl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ltr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 3, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 35, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 37, .off1_2 = 3, .off1_3 = 0, .fct2 = 3, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 6, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 6, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 7, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 7, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 22, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movsbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movswl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movzbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movzwl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_neg, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pause, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_popcnt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_not, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_outs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_popf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pushq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 14, .str1 = 0, .off1_1 = 5, .off1_2 = 2, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pushf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rdmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rdpmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rdtsc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rsm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_scas, .rep = 0, .repe = 1, .suffix = 0, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
-  { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
-  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
-  { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
-  { .mnemonic = MNE_vmcall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmlaunch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmresume, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmxoff, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmread, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 28, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 14, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmwrite, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sgdt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_monitor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 4, .str3 = 1, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sidt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_smsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_stc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_std, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_stos, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_str, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ud2a, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_verr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_verw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_wbinvd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetchw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetchnta, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetcht0, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetcht1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_prefetcht2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_nop, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_wrmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 4, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 17, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xlat, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 9, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpeqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpunordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpneqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpnltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpnleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpeqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpunordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpneqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpnltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpnless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cmpordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fxrstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_fxsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ldmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_stmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movddup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movsldup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_unpcklpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_unpcklps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_unpckhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_unpckhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movshdup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtsi2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtsi2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtpi2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtpi2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movntpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movntps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ucomisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ucomiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_comisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_comiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_getsec, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movmskpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movmskps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sqrtpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sqrtsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rsqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rsqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcpss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_rcpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_orpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_orps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xorpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_xorps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_addps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mulsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mulss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mulpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mulps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtsd2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtss2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtpd2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtps2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvttps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_cvtdq2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_subsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_subss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_subpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_subps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_minsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_minss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_minpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_minps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_divsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_divss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_divpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_divps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maxss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maxpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maxps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpcklqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_punpckhqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pshufd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_pshuflw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_pshufhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_pshufw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_haddpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_haddps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_hsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_hsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movnti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
-  { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
-  { .mnemonic = MNE_shufpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_shufps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movdq2q, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movq2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 20, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 20, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movntdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_movntq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lddqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maskmovdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_maskmovq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 20, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
-  { .mnemonic = MNE_vmclear, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmxon, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmptrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_vmptrst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psrldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pslldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_lfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_sfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_clflush, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_blendps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_blendpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_blendvps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_blendvpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_dpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_dppd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_insertps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_movntdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_mpsadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_packusdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pblendvb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pblendw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpeqq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpestri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpestrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpistri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpistrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pcmpgtq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_phminposuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pinsrb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pinsrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmaxuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pminuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovsxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmovzxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmuldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_pmulld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_ptest, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-  { .mnemonic = MNE_roundps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_roundpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_roundss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_roundsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
-  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
-};
-static const uint8_t match_data[] =
-{
-  0x1, 0xfe, 0x14,
-  0x2, 0xfe, 0x80, 0x38, 0x10,
-  0x2, 0xfe, 0x82, 0x38, 0x10,
-  0x2, 0xfe, 0x10, 0, 0,
-  0x2, 0xfe, 0x12, 0, 0,
-  0x1, 0xfe, 0x4,
-  0x2, 0xfe, 0x80, 0x38, 0,
-  0x12, 0x83, 0x38, 0,
-  0x2, 0xfe, 0, 0, 0,
-  0x2, 0xfe, 0x2, 0, 0,
-  0x34, 0x66, 0xf, 0xd0, 0, 0,
-  0x34, 0xf2, 0xf, 0xd0, 0, 0,
-  0x1, 0xfe, 0x24,
-  0x2, 0xfe, 0x80, 0x38, 0x20,
-  0x2, 0xfe, 0x82, 0x38, 0x20,
-  0x2, 0xfe, 0x20, 0, 0,
-  0x2, 0xfe, 0x22, 0, 0,
-  0x34, 0x66, 0xf, 0x54, 0, 0,
-  0x23, 0xf, 0x54, 0, 0,
-  0x34, 0x66, 0xf, 0x55, 0, 0,
-  0x23, 0xf, 0x55, 0, 0,
-  0x12, 0x63, 0, 0,
-  0x23, 0xf, 0xbc, 0, 0,
-  0x23, 0xf, 0xbd, 0, 0,
-  0x12, 0xf, 0xf8, 0xc8,
-  0x23, 0xf, 0xa3, 0, 0,
-  0x23, 0xf, 0xba, 0x38, 0x20,
-  0x23, 0xf, 0xbb, 0, 0,
-  0x23, 0xf, 0xba, 0x38, 0x38,
-  0x23, 0xf, 0xb3, 0, 0,
-  0x23, 0xf, 0xba, 0x38, 0x30,
-  0x23, 0xf, 0xab, 0, 0,
-  0x23, 0xf, 0xba, 0x38, 0x28,
-  0x11, 0xe8,
-  0x12, 0xff, 0x38, 0x10,
-  0x12, 0xff, 0x38, 0x18,
-  0x11, 0x98,
-  0x11, 0x99,
-  0x11, 0xf8,
-  0x11, 0xfc,
-  0x11, 0xfa,
-  0x22, 0xf, 0x5,
-  0x22, 0xf, 0x6,
-  0x22, 0xf, 0x7,
-  0x22, 0xf, 0x34,
-  0x22, 0xf, 0x35,
-  0x11, 0xf5,
-  0x13, 0xf, 0xf0, 0x40, 0, 0,
-  0x1, 0xfe, 0x3c,
-  0x2, 0xfe, 0x80, 0x38, 0x38,
-  0x12, 0x83, 0x38, 0x38,
-  0x2, 0xfe, 0x38, 0, 0,
-  0x2, 0xfe, 0x3a, 0, 0,
-  0x34, 0xf2, 0xf, 0xc2, 0, 0,
-  0x34, 0xf3, 0xf, 0xc2, 0, 0,
-  0x34, 0x66, 0xf, 0xc2, 0, 0,
-  0x23, 0xf, 0xc2, 0, 0,
-  0x1, 0xfe, 0xa6,
-  0x13, 0xf, 0xfe, 0xb0, 0, 0,
-  0x23, 0xf, 0xc7, 0x38, 0x8,
-  0x22, 0xf, 0xa2,
-  0x34, 0xf3, 0xf, 0xe6, 0, 0,
-  0x34, 0xf2, 0xf, 0xe6, 0, 0,
-  0x34, 0x66, 0xf, 0xe6, 0, 0,
-  0x2, 0xfe, 0xfe, 0x38, 0x8,
-  0x2, 0xfe, 0xf6, 0x38, 0x30,
-  0x22, 0xf, 0x77,
-  0x11, 0xc8,
-  0x22, 0xd9, 0xd0,
-  0x22, 0xd9, 0xe0,
-  0x22, 0xd9, 0xe1,
-  0x22, 0xd9, 0xe4,
-  0x22, 0xd9, 0xe5,
-  0x22, 0xd9, 0xe8,
-  0x22, 0xd9, 0xe9,
-  0x22, 0xd9, 0xea,
-  0x22, 0xd9, 0xeb,
-  0x22, 0xd9, 0xec,
-  0x22, 0xd9, 0xed,
-  0x22, 0xd9, 0xee,
-  0x22, 0xd9, 0xf0,
-  0x22, 0xd9, 0xf1,
-  0x22, 0xd9, 0xf2,
-  0x22, 0xd9, 0xf3,
-  0x22, 0xd9, 0xf4,
-  0x22, 0xd9, 0xf5,
-  0x22, 0xd9, 0xf6,
-  0x22, 0xd9, 0xf7,
-  0x22, 0xd9, 0xf8,
-  0x22, 0xd9, 0xf9,
-  0x22, 0xd9, 0xfa,
-  0x22, 0xd9, 0xfb,
-  0x22, 0xd9, 0xfc,
-  0x22, 0xd9, 0xfd,
-  0x22, 0xd9, 0xfe,
-  0x22, 0xd9, 0xff,
-  0x12, 0xd8, 0xf8, 0xc0,
-  0x12, 0xdc, 0xf8, 0xc0,
-  0x2, 0xfb, 0xd8, 0x38, 0,
-  0x12, 0xd8, 0xf8, 0xc8,
-  0x12, 0xdc, 0xf8, 0xc8,
-  0x2, 0xfb, 0xd8, 0x38, 0x8,
-  0x12, 0xd8, 0xf8, 0xe0,
-  0x12, 0xdc, 0xf8, 0xe0,
-  0x2, 0xfb, 0xd8, 0x38, 0x20,
-  0x12, 0xd8, 0xf8, 0xe8,
-  0x12, 0xdc, 0xf8, 0xe8,
-  0x2, 0xfb, 0xd8, 0x38, 0x28,
-  0x12, 0xdd, 0xf8, 0xd0,
-  0x2, 0xfb, 0xd9, 0x38, 0x10,
-  0x12, 0xdd, 0xf8, 0xd8,
-  0x2, 0xfb, 0xd9, 0x38, 0x18,
-  0x12, 0xd9, 0x38, 0x20,
-  0x12, 0xd9, 0x38, 0x28,
-  0x12, 0xd9, 0x38, 0x30,
-  0x12, 0xd9, 0x38, 0x38,
-  0x12, 0xd9, 0xf8, 0xc8,
-  0x12, 0xde, 0xf8, 0xc0,
-  0x12, 0xda, 0xf8, 0xc0,
-  0x2, 0xfb, 0xda, 0x38, 0,
-  0x12, 0xda, 0xf8, 0xc8,
-  0x12, 0xde, 0xf8, 0xc8,
-  0x2, 0xfb, 0xda, 0x38, 0x8,
-  0x12, 0xde, 0xf8, 0xe0,
-  0x2, 0xfb, 0xda, 0x38, 0x20,
-  0x12, 0xde, 0xf8, 0xe8,
-  0x2, 0xfb, 0xda, 0x38, 0x28,
-  0x22, 0xdf, 0xe0,
-  0x12, 0xdf, 0x38, 0x20,
-  0x12, 0xdf, 0xf8, 0xf0,
-  0x12, 0xdf, 0x38, 0x30,
-  0x22, 0xd9, 0xe0,
-  0x33, 0x9b, 0xdb, 0xe2,
-  0x33, 0x9b, 0xdb, 0xe3,
-  0x11, 0x9b,
-  0x22, 0xdb, 0xe2,
-  0x12, 0xda, 0xf8, 0xc0,
-  0x12, 0xda, 0xf8, 0xc8,
-  0x12, 0xda, 0xf8, 0xd0,
-  0x12, 0xda, 0xf8, 0xd8,
-  0x12, 0xdb, 0xf8, 0xc0,
-  0x12, 0xdb, 0xf8, 0xc8,
-  0x12, 0xdb, 0xf8, 0xd0,
-  0x12, 0xdb, 0xf8, 0xd8,
-  0x12, 0xd8, 0xf8, 0xd0,
-  0x2, 0xfb, 0xd8, 0x38, 0x10,
-  0x12, 0xd8, 0xf8, 0xd8,
-  0x2, 0xfb, 0xd8, 0x38, 0x18,
-  0x22, 0xde, 0xd9,
-  0x12, 0xdb, 0xf8, 0xf0,
-  0x12, 0xdf, 0xf8, 0xf0,
-  0x12, 0xdb, 0xf8, 0xe8,
-  0x12, 0xdf, 0xf8, 0xe8,
-  0x22, 0xd9, 0xff,
-  0x22, 0xd9, 0xf6,
-  0x12, 0xd8, 0xf8, 0xf0,
-  0x12, 0xdc, 0xf8, 0xf0,
-  0x2, 0xfb, 0xd8, 0x38, 0x30,
-  0x12, 0xda, 0x38, 0x30,
-  0x12, 0xde, 0xf8, 0xf0,
-  0x12, 0xde, 0x38, 0x30,
-  0x12, 0xde, 0xf8, 0xf8,
-  0x12, 0xd8, 0xf8, 0xf8,
-  0x12, 0xdc, 0xf8, 0xf8,
-  0x2, 0xfb, 0xd8, 0x38, 0x38,
-  0x12, 0xda, 0x38, 0x38,
-  0x12, 0xde, 0x38, 0x38,
-  0x12, 0xde, 0xf8, 0xf0,
-  0x12, 0xdd, 0xf8, 0xc0,
-  0x12, 0xda, 0xf8, 0xd0,
-  0x2, 0xfb, 0xda, 0x38, 0x10,
-  0x12, 0xda, 0xf8, 0xd8,
-  0x2, 0xfb, 0xda, 0x38, 0x18,
-  0x12, 0xdf, 0x38, 0,
-  0x12, 0xdb, 0x38, 0,
-  0x12, 0xdf, 0x38, 0x28,
-  0x22, 0xd9, 0xf7,
-  0x22, 0xdb, 0xe3,
-  0x2, 0xfb, 0xdb, 0x38, 0x10,
-  0x2, 0xfb, 0xdb, 0x38, 0x18,
-  0x12, 0xdf, 0x38, 0x38,
-  0x2, 0xfb, 0xdb, 0x38, 0x8,
-  0x12, 0xdd, 0x38, 0x8,
-  0x12, 0xdb, 0x38, 0x28,
-  0x12, 0xdb, 0x38, 0x38,
-  0x12, 0xd9, 0xf8, 0xc0,
-  0x2, 0xfb, 0xd9, 0x38, 0,
-  0x12, 0xdd, 0xf8, 0xe0,
-  0x12, 0xdd, 0x38, 0x20,
-  0x12, 0xdd, 0xf8, 0xe8,
-  0x12, 0xdd, 0x38, 0x30,
-  0x12, 0xdd, 0x38, 0x38,
-  0x11, 0xf4,
-  0x2, 0xfe, 0xf6, 0x38, 0x38,
-  0x2, 0xfe, 0xf6, 0x38, 0x28,
-  0x23, 0xf, 0xaf, 0, 0,
-  0x2, 0xfd, 0x69, 0, 0,
-  0x1, 0xfe, 0xe4,
-  0x1, 0xfe, 0xec,
-  0x2, 0xfe, 0xfe, 0x38, 0,
-  0x1, 0xfe, 0x6c,
-  0x11, 0xcd,
-  0x11, 0xcc,
-  0x22, 0xf, 0x8,
-  0x33, 0xf, 0x1, 0xf8,
-  0x23, 0xf, 0x1, 0x38, 0x38,
-  0x11, 0xcf,
-  0x1, 0xf0, 0x70,
-  0x12, 0xf, 0xf0, 0x80,
-  0x13, 0xf, 0xf0, 0x90, 0x38, 0,
-  0x11, 0xe3,
-  0x11, 0xeb,
-  0x11, 0xe9,
-  0x12, 0xff, 0x38, 0x20,
-  0x11, 0xea,
-  0x12, 0xff, 0x38, 0x28,
-  0x11, 0x9f,
-  0x23, 0xf, 0x2, 0, 0,
-  0x12, 0x8d, 0, 0,
-  0x11, 0xc9,
-  0x23, 0xf, 0xb4, 0, 0,
-  0x23, 0xf, 0xb5, 0, 0,
-  0x23, 0xf, 0x1, 0x38, 0x10,
-  0x23, 0xf, 0x1, 0x38, 0x18,
-  0x23, 0xf, 0, 0x38, 0x10,
-  0x23, 0xf, 0x1, 0x38, 0x30,
-  0x11, 0xf0,
-  0x1, 0xfe, 0xac,
-  0x11, 0xe2,
-  0x11, 0xe1,
-  0x11, 0xe0,
-  0x23, 0xf, 0x3, 0, 0,
-  0x23, 0xf, 0xb2, 0, 0,
-  0x23, 0xf, 0, 0x38, 0x18,
-  0x2, 0xfe, 0x88, 0, 0,
-  0x2, 0xfe, 0x8a, 0, 0,
-  0x2, 0xfe, 0xc6, 0x38, 0,
-  0x1, 0xf0, 0xb0,
-  0x1, 0xfe, 0xa0,
-  0x1, 0xfe, 0xa2,
-  0x23, 0xf, 0x20, 0xc0, 0xc0,
-  0x23, 0xf, 0x22, 0xc0, 0xc0,
-  0x23, 0xf, 0x21, 0xc0, 0xc0,
-  0x23, 0xf, 0x23, 0xc0, 0xc0,
-  0x12, 0x8c, 0, 0,
-  0x12, 0x8e, 0, 0,
-  0x1, 0xfe, 0xa4,
-  0x23, 0xf, 0xbe, 0, 0,
-  0x23, 0xf, 0xbf, 0, 0,
-  0x23, 0xf, 0xb6, 0, 0,
-  0x23, 0xf, 0xb7, 0, 0,
-  0x2, 0xfe, 0xf6, 0x38, 0x20,
-  0x2, 0xfe, 0xf6, 0x38, 0x18,
-  0x22, 0xf3, 0x90,
-  0x11, 0x90,
-  0x34, 0xf3, 0xf, 0xb8, 0, 0,
-  0x2, 0xfe, 0xf6, 0x38, 0x10,
-  0x2, 0xfe, 0x8, 0, 0,
-  0x2, 0xfe, 0xa, 0, 0,
-  0x2, 0xfe, 0x80, 0x38, 0x8,
-  0x2, 0xfe, 0x82, 0x38, 0x8,
-  0x1, 0xfe, 0xc,
-  0x1, 0xfe, 0xe6,
-  0x1, 0xfe, 0xee,
-  0x1, 0xfe, 0x6e,
-  0x12, 0x8f, 0xf8, 0xc0,
-  0x12, 0x8f, 0x38, 0,
-  0x12, 0xf, 0xc7, 0x81,
-  0x11, 0x9d,
-  0x12, 0xff, 0xf8, 0xf0,
-  0x12, 0xff, 0x38, 0x30,
-  0x1, 0xf8, 0x50,
-  0x1, 0xf8, 0x58,
-  0x1, 0xfd, 0x68,
-  0x1, 0xe7, 0x6,
-  0x12, 0xf, 0xc7, 0x80,
-  0x11, 0x9c,
-  0x2, 0xfe, 0xd0, 0x38, 0x10,
-  0x2, 0xfe, 0xd2, 0x38, 0x10,
-  0x2, 0xfe, 0xc0, 0x38, 0x10,
-  0x2, 0xfe, 0xd0, 0x38, 0x18,
-  0x2, 0xfe, 0xd2, 0x38, 0x18,
-  0x2, 0xfe, 0xc0, 0x38, 0x18,
-  0x22, 0xf, 0x32,
-  0x22, 0xf, 0x33,
-  0x22, 0xf, 0x31,
-  0x11, 0xc3,
-  0x11, 0xc2,
-  0x11, 0xcb,
-  0x11, 0xca,
-  0x2, 0xfe, 0xd0, 0x38, 0,
-  0x2, 0xfe, 0xd2, 0x38, 0,
-  0x2, 0xfe, 0xc0, 0x38, 0,
-  0x2, 0xfe, 0xd0, 0x38, 0x8,
-  0x2, 0xfe, 0xd2, 0x38, 0x8,
-  0x2, 0xfe, 0xc0, 0x38, 0x8,
-  0x22, 0xf, 0xaa,
-  0x11, 0x9e,
-  0x2, 0xfe, 0xd0, 0x38, 0x38,
-  0x2, 0xfe, 0xd2, 0x38, 0x38,
-  0x2, 0xfe, 0xc0, 0x38, 0x38,
-  0x2, 0xfe, 0x18, 0, 0,
-  0x2, 0xfe, 0x1a, 0, 0,
-  0x1, 0xfe, 0x1c,
-  0x2, 0xfe, 0x80, 0x38, 0x18,
-  0x2, 0xfe, 0x82, 0x38, 0x18,
-  0x1, 0xfe, 0xae,
-  0x13, 0xf, 0xf0, 0x90, 0x38, 0,
-  0x2, 0xfe, 0xd0, 0x38, 0x20,
-  0x2, 0xfe, 0xd2, 0x38, 0x20,
-  0x2, 0xfe, 0xc0, 0x38, 0x20,
-  0x2, 0xfe, 0xd0, 0x38, 0x28,
-  0x23, 0xf, 0xa4, 0, 0,
-  0x23, 0xf, 0xa5, 0, 0,
-  0x2, 0xfe, 0xd2, 0x38, 0x28,
-  0x2, 0xfe, 0xc0, 0x38, 0x28,
-  0x23, 0xf, 0xac, 0, 0,
-  0x23, 0xf, 0xad, 0, 0,
-  0x33, 0xf, 0x1, 0xc1,
-  0x33, 0xf, 0x1, 0xc2,
-  0x33, 0xf, 0x1, 0xc3,
-  0x33, 0xf, 0x1, 0xc4,
-  0x23, 0xf, 0x78, 0, 0,
-  0x23, 0xf, 0x79, 0, 0,
-  0x23, 0xf, 0x1, 0x38, 0,
-  0x33, 0xf, 0x1, 0xc8,
-  0x33, 0xf, 0x1, 0xc9,
-  0x23, 0xf, 0x1, 0x38, 0x8,
-  0x23, 0xf, 0, 0x38, 0,
-  0x23, 0xf, 0x1, 0x38, 0x20,
-  0x11, 0xf9,
-  0x11, 0xfd,
-  0x11, 0xfb,
-  0x1, 0xfe, 0xaa,
-  0x23, 0xf, 0, 0x38, 0x8,
-  0x2, 0xfe, 0x28, 0, 0,
-  0x2, 0xfe, 0x2a, 0, 0,
-  0x1, 0xfe, 0x2c,
-  0x2, 0xfe, 0x80, 0x38, 0x28,
-  0x2, 0xfe, 0x82, 0x38, 0x28,
-  0x2, 0xfe, 0x84, 0, 0,
-  0x1, 0xfe, 0xa8,
-  0x2, 0xfe, 0xf6, 0x38, 0,
-  0x22, 0xf, 0xb,
-  0x23, 0xf, 0, 0x38, 0x20,
-  0x23, 0xf, 0, 0x38, 0x28,
-  0x22, 0xf, 0x9,
-  0x23, 0xf, 0xd, 0x38, 0,
-  0x23, 0xf, 0xd, 0x38, 0x8,
-  0x23, 0xf, 0x18, 0x38, 0,
-  0x23, 0xf, 0x18, 0x38, 0x8,
-  0x23, 0xf, 0x18, 0x38, 0x10,
-  0x23, 0xf, 0x18, 0x38, 0x18,
-  0x23, 0xf, 0x1f, 0, 0,
-  0x22, 0xf, 0x30,
-  0x13, 0xf, 0xfe, 0xc0, 0, 0,
-  0x2, 0xfe, 0x86, 0, 0,
-  0x1, 0xf8, 0x90,
-  0x11, 0xd7,
-  0x2, 0xfe, 0x30, 0, 0,
-  0x2, 0xfe, 0x32, 0, 0,
-  0x1, 0xfe, 0x34,
-  0x2, 0xfe, 0x80, 0x38, 0x30,
-  0x2, 0xfe, 0x82, 0x38, 0x30,
-  0x22, 0xf, 0x77,
-  0x34, 0x66, 0xf, 0xdb, 0, 0,
-  0x23, 0xf, 0xdb, 0, 0,
-  0x34, 0x66, 0xf, 0xdf, 0, 0,
-  0x23, 0xf, 0xdf, 0, 0,
-  0x34, 0x66, 0xf, 0xf5, 0, 0,
-  0x23, 0xf, 0xf5, 0, 0,
-  0x34, 0x66, 0xf, 0xeb, 0, 0,
-  0x23, 0xf, 0xeb, 0, 0,
-  0x34, 0x66, 0xf, 0xef, 0, 0,
-  0x23, 0xf, 0xef, 0, 0,
-  0x23, 0xf, 0x55, 0, 0,
-  0x23, 0xf, 0x54, 0, 0,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x1,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x2,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x3,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x4,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x5,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x6,
-  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x7,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x1,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x2,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x3,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x4,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x5,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x6,
-  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x7,
-  0x23, 0xf, 0xae, 0x38, 0x8,
-  0x23, 0xf, 0xae, 0x38, 0,
-  0x23, 0xf, 0xae, 0x38, 0x10,
-  0x23, 0xf, 0xae, 0x38, 0x18,
-  0x34, 0xf2, 0xf, 0x10, 0, 0,
-  0x34, 0xf3, 0xf, 0x10, 0, 0,
-  0x34, 0x66, 0xf, 0x10, 0, 0,
-  0x23, 0xf, 0x10, 0, 0,
-  0x34, 0xf2, 0xf, 0x11, 0, 0,
-  0x34, 0xf3, 0xf, 0x11, 0, 0,
-  0x34, 0x66, 0xf, 0x11, 0, 0,
-  0x23, 0xf, 0x11, 0, 0,
-  0x34, 0xf2, 0xf, 0x12, 0, 0,
-  0x34, 0xf3, 0xf, 0x12, 0, 0,
-  0x34, 0x66, 0xf, 0x12, 0, 0,
-  0x23, 0xf, 0x12, 0xc0, 0xc0,
-  0x23, 0xf, 0x12, 0, 0,
-  0x34, 0x66, 0xf, 0x13, 0xc0, 0xc0,
-  0x23, 0xf, 0x13, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0x13, 0, 0,
-  0x23, 0xf, 0x13, 0, 0,
-  0x34, 0x66, 0xf, 0x14, 0, 0,
-  0x23, 0xf, 0x14, 0, 0,
-  0x34, 0x66, 0xf, 0x15, 0, 0,
-  0x23, 0xf, 0x15, 0, 0,
-  0x34, 0xf3, 0xf, 0x16, 0, 0,
-  0x34, 0x66, 0xf, 0x16, 0, 0,
-  0x23, 0xf, 0x16, 0xc0, 0xc0,
-  0x23, 0xf, 0x16, 0, 0,
-  0x34, 0x66, 0xf, 0x17, 0xc0, 0xc0,
-  0x23, 0xf, 0x17, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0x17, 0, 0,
-  0x23, 0xf, 0x17, 0, 0,
-  0x34, 0x66, 0xf, 0x28, 0, 0,
-  0x23, 0xf, 0x28, 0, 0,
-  0x34, 0x66, 0xf, 0x29, 0, 0,
-  0x23, 0xf, 0x29, 0, 0,
-  0x34, 0xf2, 0xf, 0x2a, 0, 0,
-  0x34, 0xf3, 0xf, 0x2a, 0, 0,
-  0x34, 0x66, 0xf, 0x2a, 0, 0,
-  0x23, 0xf, 0x2a, 0, 0,
-  0x34, 0x66, 0xf, 0x2b, 0, 0,
-  0x23, 0xf, 0x2b, 0, 0,
-  0x34, 0xf2, 0xf, 0x2c, 0, 0,
-  0x34, 0xf3, 0xf, 0x2c, 0, 0,
-  0x34, 0x66, 0xf, 0x2c, 0, 0,
-  0x23, 0xf, 0x2c, 0, 0,
-  0x34, 0x66, 0xf, 0x2d, 0, 0,
-  0x34, 0xf2, 0xf, 0x2d, 0, 0,
-  0x34, 0xf3, 0xf, 0x2d, 0, 0,
-  0x23, 0xf, 0x2d, 0, 0,
-  0x34, 0x66, 0xf, 0x2e, 0, 0,
-  0x23, 0xf, 0x2e, 0, 0,
-  0x34, 0x66, 0xf, 0x2f, 0, 0,
-  0x23, 0xf, 0x2f, 0, 0,
-  0x22, 0xf, 0x37,
-  0x34, 0x66, 0xf, 0x50, 0xc0, 0xc0,
-  0x23, 0xf, 0x50, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0x51, 0, 0,
-  0x34, 0xf2, 0xf, 0x51, 0, 0,
-  0x34, 0xf3, 0xf, 0x51, 0, 0,
-  0x23, 0xf, 0x51, 0, 0,
-  0x34, 0xf3, 0xf, 0x52, 0, 0,
-  0x23, 0xf, 0x52, 0, 0,
-  0x34, 0xf3, 0xf, 0x53, 0, 0,
-  0x23, 0xf, 0x53, 0, 0,
-  0x34, 0x66, 0xf, 0x54, 0, 0,
-  0x23, 0xf, 0x54, 0, 0,
-  0x34, 0x66, 0xf, 0x55, 0, 0,
-  0x23, 0xf, 0x55, 0, 0,
-  0x34, 0x66, 0xf, 0x56, 0, 0,
-  0x23, 0xf, 0x56, 0, 0,
-  0x34, 0x66, 0xf, 0x57, 0, 0,
-  0x23, 0xf, 0x57, 0, 0,
-  0x34, 0xf2, 0xf, 0x58, 0, 0,
-  0x34, 0xf3, 0xf, 0x58, 0, 0,
-  0x34, 0x66, 0xf, 0x58, 0, 0,
-  0x23, 0xf, 0x58, 0, 0,
-  0x34, 0xf2, 0xf, 0x59, 0, 0,
-  0x34, 0xf3, 0xf, 0x59, 0, 0,
-  0x34, 0x66, 0xf, 0x59, 0, 0,
-  0x23, 0xf, 0x59, 0, 0,
-  0x34, 0xf2, 0xf, 0x5a, 0, 0,
-  0x34, 0xf3, 0xf, 0x5a, 0, 0,
-  0x34, 0x66, 0xf, 0x5a, 0, 0,
-  0x23, 0xf, 0x5a, 0, 0,
-  0x34, 0x66, 0xf, 0x5b, 0, 0,
-  0x34, 0xf3, 0xf, 0x5b, 0, 0,
-  0x23, 0xf, 0x5b, 0, 0,
-  0x34, 0xf2, 0xf, 0x5c, 0, 0,
-  0x34, 0xf3, 0xf, 0x5c, 0, 0,
-  0x34, 0x66, 0xf, 0x5c, 0, 0,
-  0x23, 0xf, 0x5c, 0, 0,
-  0x34, 0xf2, 0xf, 0x5d, 0, 0,
-  0x34, 0xf3, 0xf, 0x5d, 0, 0,
-  0x34, 0x66, 0xf, 0x5d, 0, 0,
-  0x23, 0xf, 0x5d, 0, 0,
-  0x34, 0xf2, 0xf, 0x5e, 0, 0,
-  0x34, 0xf3, 0xf, 0x5e, 0, 0,
-  0x34, 0x66, 0xf, 0x5e, 0, 0,
-  0x23, 0xf, 0x5e, 0, 0,
-  0x34, 0xf2, 0xf, 0x5f, 0, 0,
-  0x34, 0xf3, 0xf, 0x5f, 0, 0,
-  0x34, 0x66, 0xf, 0x5f, 0, 0,
-  0x23, 0xf, 0x5f, 0, 0,
-  0x34, 0x66, 0xf, 0x60, 0, 0,
-  0x23, 0xf, 0x60, 0, 0,
-  0x34, 0x66, 0xf, 0x61, 0, 0,
-  0x23, 0xf, 0x61, 0, 0,
-  0x34, 0x66, 0xf, 0x62, 0, 0,
-  0x23, 0xf, 0x62, 0, 0,
-  0x34, 0x66, 0xf, 0x63, 0, 0,
-  0x23, 0xf, 0x63, 0, 0,
-  0x34, 0x66, 0xf, 0x64, 0, 0,
-  0x23, 0xf, 0x64, 0, 0,
-  0x34, 0x66, 0xf, 0x65, 0, 0,
-  0x23, 0xf, 0x65, 0, 0,
-  0x34, 0x66, 0xf, 0x66, 0, 0,
-  0x23, 0xf, 0x66, 0, 0,
-  0x34, 0x66, 0xf, 0x67, 0, 0,
-  0x23, 0xf, 0x67, 0, 0,
-  0x34, 0x66, 0xf, 0x68, 0, 0,
-  0x23, 0xf, 0x68, 0, 0,
-  0x34, 0x66, 0xf, 0x69, 0, 0,
-  0x23, 0xf, 0x69, 0, 0,
-  0x34, 0x66, 0xf, 0x6a, 0, 0,
-  0x23, 0xf, 0x6a, 0, 0,
-  0x34, 0x66, 0xf, 0x6b, 0, 0,
-  0x23, 0xf, 0x6b, 0, 0,
-  0x34, 0x66, 0xf, 0x6c, 0, 0,
-  0x34, 0x66, 0xf, 0x6d, 0, 0,
-  0x34, 0x66, 0xf, 0x6e, 0, 0,
-  0x23, 0xf, 0x6e, 0, 0,
-  0x34, 0x66, 0xf, 0x6f, 0, 0,
-  0x34, 0xf3, 0xf, 0x6f, 0, 0,
-  0x23, 0xf, 0x6f, 0, 0,
-  0x34, 0x66, 0xf, 0x70, 0, 0,
-  0x34, 0xf2, 0xf, 0x70, 0, 0,
-  0x34, 0xf3, 0xf, 0x70, 0, 0,
-  0x23, 0xf, 0x70, 0, 0,
-  0x34, 0x66, 0xf, 0x74, 0, 0,
-  0x23, 0xf, 0x74, 0, 0,
-  0x34, 0x66, 0xf, 0x75, 0, 0,
-  0x23, 0xf, 0x75, 0, 0,
-  0x34, 0x66, 0xf, 0x76, 0, 0,
-  0x23, 0xf, 0x76, 0, 0,
-  0x34, 0x66, 0xf, 0x7c, 0, 0,
-  0x34, 0xf2, 0xf, 0x7c, 0, 0,
-  0x34, 0x66, 0xf, 0x7d, 0, 0,
-  0x34, 0xf2, 0xf, 0x7d, 0, 0,
-  0x34, 0x66, 0xf, 0x7e, 0, 0,
-  0x34, 0xf3, 0xf, 0x7e, 0, 0,
-  0x23, 0xf, 0x7e, 0, 0,
-  0x34, 0x66, 0xf, 0x7f, 0, 0,
-  0x34, 0xf3, 0xf, 0x7f, 0, 0,
-  0x23, 0xf, 0x7f, 0, 0,
-  0x23, 0xf, 0xc3, 0, 0,
-  0x34, 0x66, 0xf, 0xc4, 0, 0,
-  0x23, 0xf, 0xc4, 0, 0,
-  0x34, 0x66, 0xf, 0xc5, 0xc0, 0xc0,
-  0x23, 0xf, 0xc5, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0xc6, 0, 0,
-  0x23, 0xf, 0xc6, 0, 0,
-  0x34, 0x66, 0xf, 0xd1, 0, 0,
-  0x23, 0xf, 0xd1, 0, 0,
-  0x34, 0x66, 0xf, 0xd2, 0, 0,
-  0x23, 0xf, 0xd2, 0, 0,
-  0x34, 0x66, 0xf, 0xd3, 0, 0,
-  0x23, 0xf, 0xd3, 0, 0,
-  0x34, 0x66, 0xf, 0xd4, 0, 0,
-  0x23, 0xf, 0xd4, 0, 0,
-  0x34, 0x66, 0xf, 0xd5, 0, 0,
-  0x23, 0xf, 0xd5, 0, 0,
-  0x34, 0x66, 0xf, 0xd6, 0, 0,
-  0x34, 0xf2, 0xf, 0xd6, 0xc0, 0xc0,
-  0x34, 0xf3, 0xf, 0xd6, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0xd7, 0xc0, 0xc0,
-  0x23, 0xf, 0xd7, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0xd8, 0, 0,
-  0x23, 0xf, 0xd8, 0, 0,
-  0x34, 0x66, 0xf, 0xd9, 0, 0,
-  0x23, 0xf, 0xd9, 0, 0,
-  0x34, 0x66, 0xf, 0xda, 0, 0,
-  0x23, 0xf, 0xda, 0, 0,
-  0x34, 0x66, 0xf, 0xdc, 0, 0,
-  0x23, 0xf, 0xdc, 0, 0,
-  0x34, 0x66, 0xf, 0xdd, 0, 0,
-  0x23, 0xf, 0xdd, 0, 0,
-  0x34, 0x66, 0xf, 0xde, 0, 0,
-  0x23, 0xf, 0xde, 0, 0,
-  0x34, 0x66, 0xf, 0xe0, 0, 0,
-  0x23, 0xf, 0xe0, 0, 0,
-  0x34, 0x66, 0xf, 0xe1, 0, 0,
-  0x23, 0xf, 0xe1, 0, 0,
-  0x34, 0x66, 0xf, 0xe2, 0, 0,
-  0x23, 0xf, 0xe2, 0, 0,
-  0x34, 0x66, 0xf, 0xe3, 0, 0,
-  0x23, 0xf, 0xe3, 0, 0,
-  0x34, 0x66, 0xf, 0xe4, 0, 0,
-  0x23, 0xf, 0xe4, 0, 0,
-  0x34, 0x66, 0xf, 0xe5, 0, 0,
-  0x23, 0xf, 0xe5, 0, 0,
-  0x34, 0x66, 0xf, 0xe7, 0, 0,
-  0x23, 0xf, 0xe7, 0, 0,
-  0x34, 0x66, 0xf, 0xe8, 0, 0,
-  0x23, 0xf, 0xe8, 0, 0,
-  0x34, 0x66, 0xf, 0xe9, 0, 0,
-  0x23, 0xf, 0xe9, 0, 0,
-  0x34, 0x66, 0xf, 0xea, 0, 0,
-  0x23, 0xf, 0xea, 0, 0,
-  0x34, 0x66, 0xf, 0xec, 0, 0,
-  0x23, 0xf, 0xec, 0, 0,
-  0x34, 0x66, 0xf, 0xed, 0, 0,
-  0x23, 0xf, 0xed, 0, 0,
-  0x34, 0x66, 0xf, 0xee, 0, 0,
-  0x23, 0xf, 0xee, 0, 0,
-  0x34, 0xf2, 0xf, 0xf0, 0, 0,
-  0x34, 0x66, 0xf, 0xf1, 0, 0,
-  0x23, 0xf, 0xf1, 0, 0,
-  0x34, 0x66, 0xf, 0xf2, 0, 0,
-  0x23, 0xf, 0xf2, 0, 0,
-  0x34, 0x66, 0xf, 0xf3, 0, 0,
-  0x23, 0xf, 0xf3, 0, 0,
-  0x34, 0x66, 0xf, 0xf4, 0, 0,
-  0x23, 0xf, 0xf4, 0, 0,
-  0x34, 0x66, 0xf, 0xf6, 0, 0,
-  0x23, 0xf, 0xf6, 0, 0,
-  0x34, 0x66, 0xf, 0xf7, 0xc0, 0xc0,
-  0x23, 0xf, 0xf7, 0xc0, 0xc0,
-  0x34, 0x66, 0xf, 0xf8, 0, 0,
-  0x23, 0xf, 0xf8, 0, 0,
-  0x34, 0x66, 0xf, 0xf9, 0, 0,
-  0x23, 0xf, 0xf9, 0, 0,
-  0x34, 0x66, 0xf, 0xfa, 0, 0,
-  0x23, 0xf, 0xfa, 0, 0,
-  0x34, 0x66, 0xf, 0xfb, 0, 0,
-  0x23, 0xf, 0xfb, 0, 0,
-  0x34, 0x66, 0xf, 0xfc, 0, 0,
-  0x23, 0xf, 0xfc, 0, 0,
-  0x34, 0x66, 0xf, 0xfd, 0, 0,
-  0x23, 0xf, 0xfd, 0, 0,
-  0x34, 0x66, 0xf, 0xfe, 0, 0,
-  0x23, 0xf, 0xfe, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0, 0, 0,
-  0x34, 0xf, 0x38, 0, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x1, 0, 0,
-  0x34, 0xf, 0x38, 0x1, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x2, 0, 0,
-  0x34, 0xf, 0x38, 0x2, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3, 0, 0,
-  0x34, 0xf, 0x38, 0x3, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x4, 0, 0,
-  0x34, 0xf, 0x38, 0x4, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x5, 0, 0,
-  0x34, 0xf, 0x38, 0x5, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x6, 0, 0,
-  0x34, 0xf, 0x38, 0x6, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x7, 0, 0,
-  0x34, 0xf, 0x38, 0x7, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x8, 0, 0,
-  0x34, 0xf, 0x38, 0x8, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x9, 0, 0,
-  0x34, 0xf, 0x38, 0x9, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0xa, 0, 0,
-  0x34, 0xf, 0x38, 0xa, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0xb, 0, 0,
-  0x34, 0xf, 0x38, 0xb, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x1c, 0, 0,
-  0x34, 0xf, 0x38, 0x1c, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x1d, 0, 0,
-  0x34, 0xf, 0x38, 0x1d, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x1e, 0, 0,
-  0x34, 0xf, 0x38, 0x1e, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xf, 0, 0,
-  0x34, 0xf, 0x3a, 0xf, 0, 0,
-  0x34, 0x66, 0xf, 0xc7, 0x38, 0x30,
-  0x34, 0xf3, 0xf, 0xc7, 0x38, 0x30,
-  0x23, 0xf, 0xc7, 0x38, 0x30,
-  0x23, 0xf, 0xc7, 0x38, 0x38,
-  0x34, 0x66, 0xf, 0x71, 0xf8, 0xd0,
-  0x23, 0xf, 0x71, 0xf8, 0xd0,
-  0x34, 0x66, 0xf, 0x71, 0xf8, 0xe0,
-  0x23, 0xf, 0x71, 0xf8, 0xe0,
-  0x34, 0x66, 0xf, 0x71, 0xf8, 0xf0,
-  0x23, 0xf, 0x71, 0xf8, 0xf0,
-  0x34, 0x66, 0xf, 0x72, 0xf8, 0xd0,
-  0x23, 0xf, 0x72, 0xf8, 0xd0,
-  0x34, 0x66, 0xf, 0x72, 0xf8, 0xe0,
-  0x23, 0xf, 0x72, 0xf8, 0xe0,
-  0x34, 0x66, 0xf, 0x72, 0xf8, 0xf0,
-  0x23, 0xf, 0x72, 0xf8, 0xf0,
-  0x34, 0x66, 0xf, 0x73, 0xf8, 0xd0,
-  0x23, 0xf, 0x73, 0xf8, 0xd0,
-  0x34, 0x66, 0xf, 0x73, 0xf8, 0xd8,
-  0x34, 0x66, 0xf, 0x73, 0xf8, 0xf0,
-  0x23, 0xf, 0x73, 0xf8, 0xf0,
-  0x34, 0x66, 0xf, 0x73, 0xf8, 0xf8,
-  0x33, 0xf, 0xae, 0xe8,
-  0x33, 0xf, 0xae, 0xf0,
-  0x33, 0xf, 0xae, 0xf8,
-  0x23, 0xf, 0xae, 0x38, 0x38,
-  0x23, 0xf, 0xf, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xc, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xd, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x14, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x15, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x40, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x41, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x21, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x2a, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x42, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x2b, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x10, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xe, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x29, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x61, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x60, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x63, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x62, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x37, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x41, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x20, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x22, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3c, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3d, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3f, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3e, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x38, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x39, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3b, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x3a, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x20, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x21, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x22, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x23, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x24, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x25, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x30, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x31, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x32, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x33, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x34, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x35, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x28, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x40, 0, 0,
-  0x45, 0x66, 0xf, 0x38, 0x17, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x8, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0x9, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xa, 0, 0,
-  0x45, 0x66, 0xf, 0x3a, 0xb, 0, 0,
-  0x1, 0xe7, 0x7,
-};
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-Add-GCC7-Wimplicit-fallthrough-support-fixes.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-Add-GCC7-Wimplicit-fallthrough-support-fixes.patch
deleted file mode 100644
index a240323..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-Add-GCC7-Wimplicit-fallthrough-support-fixes.patch
+++ /dev/null
@@ -1,318 +0,0 @@
-From 09949994e76eea3c1230a5c88ffa8fdf588b120f Mon Sep 17 00:00:00 2001
-From: Mark Wielaard <mjw@redhat.com>
-Date: Wed, 2 Nov 2016 13:29:26 +0100
-Subject: [PATCH] Add GCC7 -Wimplicit-fallthrough support/fixes.
-
-GCC7 will have a new -Wimplicit-fallthrough warning. It did catch one
-small buglet in elflint option procession. So it seems useful to enable
-to make sure all swatch case fallthroughs are deliberate.
-
-Add configure check to detect whether gcc support -Wimplicit-fallthrough
-and enable it. Add fixes and explicit fallthrough comments where necessary.
-
-Signed-off-by: Mark Wielaard <mjw@redhat.com>
-
-Upstream-Status: Backport
-Upstream-Commit: a3cc8182b2ae05290b0eafa74b70746d7befc0e4
----
- backends/alpha_retval.c    |  4 +---
- backends/i386_regs.c       |  1 +
- backends/i386_retval.c     |  3 +--
- backends/linux-core-note.c |  4 ++--
- backends/ppc_regs.c        |  2 +-
- backends/x86_64_regs.c     |  1 +
- config/eu.am               |  8 +++++++-
- configure.ac               | 10 ++++++++++
- libcpu/i386_disasm.c       |  2 +-
- libdw/cfi.c                |  2 ++
- libdw/encoded-value.h      |  1 +
- libdwfl/dwfl_report_elf.c  |  2 +-
- src/addr2line.c            |  1 +
- src/elfcompress.c          |  3 ++-
- src/elflint.c              |  4 +++-
- src/objdump.c              |  4 +++-
- tests/backtrace-data.c     |  1 +
- tests/backtrace.c          |  2 +-
- 18 files changed, 40 insertions(+), 15 deletions(-)
-
-diff --git a/backends/alpha_retval.c b/backends/alpha_retval.c
-index 53dbfa45..7232b462 100644
---- a/backends/alpha_retval.c
-+++ b/backends/alpha_retval.c
-@@ -130,9 +130,7 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
- 	    return nloc_intreg;
- 	  }
-       }
--
--      /* Else fall through.  */
--
-+      /* Fallthrough */
-     case DW_TAG_structure_type:
-     case DW_TAG_class_type:
-     case DW_TAG_union_type:
-diff --git a/backends/i386_regs.c b/backends/i386_regs.c
-index fb8ded33..fd963a62 100644
---- a/backends/i386_regs.c
-+++ b/backends/i386_regs.c
-@@ -92,6 +92,7 @@ i386_register_info (Ebl *ebl __attribute__ ((unused)),
-     case 5:
-     case 8:
-       *type = DW_ATE_address;
-+      /* Fallthrough */
-     case 0 ... 3:
-     case 6 ... 7:
-       name[0] = 'e';
-diff --git a/backends/i386_retval.c b/backends/i386_retval.c
-index 9da797d5..4aa646fe 100644
---- a/backends/i386_retval.c
-+++ b/backends/i386_retval.c
-@@ -122,9 +122,8 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
- 	  return nloc_intreg;
- 	if (size <= 8)
- 	  return nloc_intregpair;
--
--	/* Else fall through.  */
-       }
-+    /* Fallthrough */
- 
-     case DW_TAG_structure_type:
-     case DW_TAG_class_type:
-diff --git a/backends/linux-core-note.c b/backends/linux-core-note.c
-index ff2b226f..321721f3 100644
---- a/backends/linux-core-note.c
-+++ b/backends/linux-core-note.c
-@@ -219,8 +219,8 @@ EBLHOOK(core_note) (const GElf_Nhdr *nhdr, const char *name,
-     case sizeof "CORE":
-       if (memcmp (name, "CORE", nhdr->n_namesz) == 0)
- 	break;
--      /* Buggy old Linux kernels didn't terminate "LINUX".
--         Fall through.  */
-+      /* Buggy old Linux kernels didn't terminate "LINUX".  */
-+      /* Fall through. */
- 
-     case sizeof "LINUX":
-       if (memcmp (name, "LINUX", nhdr->n_namesz) == 0)
-diff --git a/backends/ppc_regs.c b/backends/ppc_regs.c
-index 4b92a9aa..bcf4f7a3 100644
---- a/backends/ppc_regs.c
-+++ b/backends/ppc_regs.c
-@@ -140,7 +140,7 @@ ppc_register_info (Ebl *ebl __attribute__ ((unused)),
-     case 100:
-       if (*bits == 32)
- 	return stpcpy (name, "mq") + 1 - name;
--
-+      /* Fallthrough */
-     case 102 ... 107:
-       name[0] = 's';
-       name[1] = 'p';
-diff --git a/backends/x86_64_regs.c b/backends/x86_64_regs.c
-index 2172d9f1..84304407 100644
---- a/backends/x86_64_regs.c
-+++ b/backends/x86_64_regs.c
-@@ -87,6 +87,7 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
- 
-     case 6 ... 7:
-       *type = DW_ATE_address;
-+      /* Fallthrough */
-     case 0 ... 5:
-       name[0] = 'r';
-       name[1] = baseregs[regno][0];
-diff --git a/config/eu.am b/config/eu.am
-index 4998771d..8fe1e259 100644
---- a/config/eu.am
-+++ b/config/eu.am
-@@ -61,10 +61,16 @@ else
- NULL_DEREFERENCE_WARNING=
- endif
- 
-+if HAVE_IMPLICIT_FALLTHROUGH_WARNING
-+IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough
-+else
-+IMPLICIT_FALLTHROUGH_WARNING=
-+endif
-+
- AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
- 	    -Wold-style-definition -Wstrict-prototypes \
- 	    $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
--	    $(NULL_DEREFERENCE_WARNING) \
-+	    $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
- 	    $(if $($(*F)_no_Werror),,-Werror) \
- 	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
- 	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
-diff --git a/configure.ac b/configure.ac
-index 86a69c66..35850c64 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -336,6 +336,16 @@ CFLAGS="$old_CFLAGS"])
- AM_CONDITIONAL(HAVE_NULL_DEREFERENCE_WARNING,
- 	       [test "x$ac_cv_null_dereference" != "xno"])
- 
-+# -Wimplicit-fallthrough was added by GCC7
-+AC_CACHE_CHECK([whether gcc accepts -Wimplicit-fallthrough], ac_cv_implicit_fallthrough, [dnl
-+old_CFLAGS="$CFLAGS"
-+CFLAGS="$CFLAGS -Wimplicit-fallthrough -Werror"
-+AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
-+		  ac_cv_implicit_fallthrough=yes, ac_cv_implicit_fallthrough=no)
-+CFLAGS="$old_CFLAGS"])
-+AM_CONDITIONAL(HAVE_IMPLICIT_FALLTHROUGH_WARNING,
-+	       [test "x$ac_cv_implicit_fallthrough" != "xno"])
-+
- dnl Check if we have argp available from our libc
- AC_LINK_IFELSE(
- 	[AC_LANG_PROGRAM(
-diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
-index 832241f2..1a584635 100644
---- a/libcpu/i386_disasm.c
-+++ b/libcpu/i386_disasm.c
-@@ -819,7 +819,7 @@ i386_disasm (const uint8_t **startp, const uint8_t *end, GElf_Addr addr,
- 			      ++param_start;
- 			      break;
- 			    }
--
-+			  /* Fallthrough */
- 			default:
- 			  assert (! "INVALID not handled");
- 			}
-diff --git a/libdw/cfi.c b/libdw/cfi.c
-index 1fd668d7..daa845f3 100644
---- a/libdw/cfi.c
-+++ b/libdw/cfi.c
-@@ -138,6 +138,7 @@ execute_cfi (Dwarf_CFI *cache,
- 
- 	case DW_CFA_advance_loc1:
- 	  operand = *program++;
-+	  /* Fallthrough */
- 	case DW_CFA_advance_loc + 0 ... DW_CFA_advance_loc + CFI_PRIMARY_MAX:
- 	advance_loc:
- 	  loc += operand * cie->code_alignment_factor;
-@@ -300,6 +301,7 @@ execute_cfi (Dwarf_CFI *cache,
- 
- 	case DW_CFA_restore_extended:
- 	  get_uleb128 (operand, program, end);
-+	  /* Fallthrough */
- 	case DW_CFA_restore + 0 ... DW_CFA_restore + CFI_PRIMARY_MAX:
- 
- 	  if (unlikely (abi_cfi) && likely (opcode == DW_CFA_restore))
-diff --git a/libdw/encoded-value.h b/libdw/encoded-value.h
-index 48d868fb..f0df4cec 100644
---- a/libdw/encoded-value.h
-+++ b/libdw/encoded-value.h
-@@ -64,6 +64,7 @@ encoded_value_size (const Elf_Data *data, const unsigned char e_ident[],
- 	    if (*end++ & 0x80u)
- 	      return end - p;
- 	}
-+      return 0;
- 
-     default:
-       return 0;
-diff --git a/libdwfl/dwfl_report_elf.c b/libdwfl/dwfl_report_elf.c
-index 1c6e401d..73a5511a 100644
---- a/libdwfl/dwfl_report_elf.c
-+++ b/libdwfl/dwfl_report_elf.c
-@@ -170,7 +170,7 @@ __libdwfl_elf_address_range (Elf *elf, GElf_Addr base, bool add_p_vaddr,
-       /* An assigned base address is meaningless for these.  */
-       base = 0;
-       add_p_vaddr = true;
--
-+      /* Fallthrough. */
-     case ET_DYN:
-     default:;
-       size_t phnum;
-diff --git a/src/addr2line.c b/src/addr2line.c
-index 0ce854f6..bea24aea 100644
---- a/src/addr2line.c
-+++ b/src/addr2line.c
-@@ -632,6 +632,7 @@ handle_address (const char *string, Dwfl *dwfl)
- 	case 1:
- 	  addr = 0;
- 	  j = i;
-+	  /* Fallthrough */
- 	case 2:
- 	  if (string[j] != '\0')
- 	    break;
-diff --git a/src/elfcompress.c b/src/elfcompress.c
-index d0ca469c..57afa116 100644
---- a/src/elfcompress.c
-+++ b/src/elfcompress.c
-@@ -153,7 +153,8 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
- 	argp_error (state,
- 		    N_("Only one input file allowed together with '-o'"));
-       /* We only use this for checking the number of arguments, we don't
--	 actually want to consume them, so fallthrough.  */
-+	 actually want to consume them.  */
-+      /* Fallthrough */
-     default:
-       return ARGP_ERR_UNKNOWN;
-     }
-diff --git a/src/elflint.c b/src/elflint.c
-index 15b12f6f..2c45fcb8 100644
---- a/src/elflint.c
-+++ b/src/elflint.c
-@@ -210,6 +210,7 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
- 
-     case 'd':
-       is_debuginfo = true;
-+      break;
- 
-     case ARGP_gnuld:
-       gnuld = true;
-@@ -3963,6 +3964,7 @@ section [%2zu] '%s': merge flag set but entry size is zero\n"),
- 	    case SHT_NOBITS:
- 	      if (is_debuginfo)
- 		break;
-+	      /* Fallthrough */
- 	    default:
- 	      ERROR (gettext ("\
- section [%2zu] '%s' has unexpected type %d for an executable section\n"),
-@@ -4305,7 +4307,7 @@ section [%2d] '%s': unknown core file note type %" PRIu32
- 	    if (nhdr.n_namesz == sizeof "Linux"
- 		&& !memcmp (data->d_buf + name_offset, "Linux", sizeof "Linux"))
- 	      break;
--
-+	    /* Fallthrough */
- 	  default:
- 	    if (shndx == 0)
- 	      ERROR (gettext ("\
-diff --git a/src/objdump.c b/src/objdump.c
-index 0aa41e89..94e9e021 100644
---- a/src/objdump.c
-+++ b/src/objdump.c
-@@ -234,7 +234,9 @@ parse_opt (int key, char *arg,
- 		     program_invocation_short_name);
- 	  exit (EXIT_FAILURE);
- 	}
--
-+      /* We only use this for checking the number of arguments, we don't
-+	 actually want to consume them.  */
-+      /* Fallthrough */
-     default:
-       return ARGP_ERR_UNKNOWN;
-     }
-diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c
-index bc5ceba0..b7158dae 100644
---- a/tests/backtrace-data.c
-+++ b/tests/backtrace-data.c
-@@ -250,6 +250,7 @@ thread_callback (Dwfl_Thread *thread, void *thread_arg __attribute__ ((unused)))
-       break;
-     case -1:
-       error (1, 0, "dwfl_thread_getframes: %s", dwfl_errmsg (-1));
-+      break;
-     default:
-       abort ();
-     }
-diff --git a/tests/backtrace.c b/tests/backtrace.c
-index 12476430..bf5995b4 100644
---- a/tests/backtrace.c
-+++ b/tests/backtrace.c
-@@ -123,7 +123,7 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
- 	  assert (symname2 == NULL || strcmp (symname2, "jmp") != 0);
- 	  break;
- 	}
--      /* PASSTHRU */
-+      /* FALLTHRU */
-     case 4:
-       assert (symname != NULL && strcmp (symname, "stdarg") == 0);
-       break;
--- 
-2.13.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-Ignore-differences-between-mips-machine-identifiers.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-Ignore-differences-between-mips-machine-identifiers.patch
deleted file mode 100644
index 3f110f9..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-Ignore-differences-between-mips-machine-identifiers.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 77cb4a53c270d5854d3af24f19547bc3de825233 Mon Sep 17 00:00:00 2001
-From: James Cowgill <james410@cowgill.org.uk>
-Date: Mon, 5 Jan 2015 15:16:58 +0000
-Subject: [PATCH 1/3] Ignore differences between mips machine identifiers
-
-Little endian binaries actually use EM_MIPS so you can't tell the endianness
-from the elf machine id. Also, the EM_MIPS_RS3_LE machine is dead anyway (the
-kernel will not load binaries containing it).
-
-Signed-off-by: James Cowgill <james410@cowgill.org.uk>
----
- backends/mips_init.c | 6 +-----
- 1 file changed, 1 insertion(+), 5 deletions(-)
-
-diff --git a/backends/mips_init.c b/backends/mips_init.c
-index 7429a89..d10e940 100644
---- a/backends/mips_init.c
-+++ b/backends/mips_init.c
-@@ -46,11 +46,7 @@ mips_init (elf, machine, eh, ehlen)
-     return NULL;
- 
-   /* We handle it.  */
--  if (machine == EM_MIPS)
--    eh->name = "MIPS R3000 big-endian";
--  else if (machine == EM_MIPS_RS3_LE)
--    eh->name = "MIPS R3000 little-endian";
--
-+  eh->name = "MIPS";
-   mips_init_reloc (eh);
-   HOOK (eh, reloc_simple_type);
-   HOOK (eh, return_value_location);
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-ar-Fix-GCC7-Wformat-length-issues.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-ar-Fix-GCC7-Wformat-length-issues.patch
deleted file mode 100644
index 3465476..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-ar-Fix-GCC7-Wformat-length-issues.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From f090883ca61f0bf0f979c5b26d4e1a69e805156e Mon Sep 17 00:00:00 2001
-From: Mark Wielaard <mjw@redhat.com>
-Date: Thu, 10 Nov 2016 18:45:02 +0100
-Subject: [PATCH] ar: Fix GCC7 -Wformat-length issues.
-
-GCC7 adds warnings for snprintf formatting into too small buffers.
-Fix the two issues pointed out by the new warning. The ar header
-fields are fixed length containing left-justified strings without
-zero terminator. snprintf always adds a '\0' char at the end (which
-we then don't copy into the ar header field) and numbers are decimal
-strings of fixed 10 chars  (-Wformat-length thinks formatting
-them as size_t might overflow the buffer on 64bit arches).
-
-Signed-off-by: Mark Wielaard <mjw@redhat.com>
-
-Upstream-Status: Backport
-Upstream-Commit: d5afff85e22b38949f3e7936231c67de16e180e8
----
- src/ar.c    | 15 +++++++++++----
- src/arlib.c | 16 ++++++++++------
- 2 files changed, 21 insertions(+), 10 deletions(-)
-
-diff --git a/src/ar.c b/src/ar.c
-index 1320d07b..f2160d35 100644
---- a/src/ar.c
-+++ b/src/ar.c
-@@ -1,5 +1,5 @@
- /* Create, modify, and extract from archives.
--   Copyright (C) 2005-2012 Red Hat, Inc.
-+   Copyright (C) 2005-2012, 2016 Red Hat, Inc.
-    This file is part of elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2005.
- 
-@@ -853,7 +853,10 @@ write_member (struct armem *memb, off_t *startp, off_t *lenp, Elf *elf,
- 	      off_t end_off, int newfd)
- {
-   struct ar_hdr arhdr;
--  char tmpbuf[sizeof (arhdr.ar_name) + 1];
-+  /* The ar_name is not actually zero teminated, but we need that for
-+     snprintf.  Also if the name is too long, then the string starts
-+     with '/' plus an index off number (decimal).  */
-+  char tmpbuf[sizeof (arhdr.ar_name) + 2];
- 
-   bool changed_header = memb->long_name_off != -1;
-   if (changed_header)
-@@ -1455,7 +1458,11 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
- 
- 	      /* Create the header.  */
- 	      struct ar_hdr arhdr;
--	      char tmpbuf[sizeof (arhdr.ar_name) + 1];
-+	      /* The ar_name is not actually zero teminated, but we
-+		 need that for snprintf.  Also if the name is too
-+		 long, then the string starts with '/' plus an index
-+		 off number (decimal).  */
-+	      char tmpbuf[sizeof (arhdr.ar_name) + 2];
- 	      if (all->long_name_off == -1)
- 		{
- 		  size_t namelen = strlen (all->name);
-@@ -1465,7 +1472,7 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
- 		}
- 	      else
- 		{
--		  snprintf (tmpbuf, sizeof (arhdr.ar_name) + 1, "/%-*ld",
-+		  snprintf (tmpbuf, sizeof (tmpbuf), "/%-*ld",
- 			    (int) sizeof (arhdr.ar_name), all->long_name_off);
- 		  memcpy (arhdr.ar_name, tmpbuf, sizeof (arhdr.ar_name));
- 		}
-diff --git a/src/arlib.c b/src/arlib.c
-index 43a9145b..0c2e4cde 100644
---- a/src/arlib.c
-+++ b/src/arlib.c
-@@ -1,5 +1,5 @@
- /* Functions to handle creation of Linux archives.
--   Copyright (C) 2007-2012 Red Hat, Inc.
-+   Copyright (C) 2007-2012, 2016 Red Hat, Inc.
-    This file is part of elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2007.
- 
-@@ -23,6 +23,7 @@
- #include <assert.h>
- #include <error.h>
- #include <gelf.h>
-+#include <inttypes.h>
- #include <libintl.h>
- #include <stdio.h>
- #include <stdlib.h>
-@@ -107,6 +108,9 @@ arlib_init (void)
- void
- arlib_finalize (void)
- {
-+  /* Note that the size is stored as decimal string in 10 chars,
-+     without zero terminator (we add + 1 here only so snprintf can
-+     put it at the end, we then don't use it when we memcpy it).  */
-   char tmpbuf[sizeof (((struct ar_hdr *) NULL)->ar_size) + 1];
- 
-   symtab.longnameslen = obstack_object_size (&symtab.longnamesob);
-@@ -121,9 +125,9 @@ arlib_finalize (void)
- 
-       symtab.longnames = obstack_finish (&symtab.longnamesob);
- 
--      int s = snprintf (tmpbuf, sizeof (tmpbuf), "%-*zu",
-+      int s = snprintf (tmpbuf, sizeof (tmpbuf), "%-*" PRIu32 "",
- 			(int) sizeof (((struct ar_hdr *) NULL)->ar_size),
--			symtab.longnameslen - sizeof (struct ar_hdr));
-+			(uint32_t) (symtab.longnameslen - sizeof (struct ar_hdr)));
-       memcpy (&((struct ar_hdr *) symtab.longnames)->ar_size, tmpbuf, s);
-     }
- 
-@@ -169,10 +173,10 @@ arlib_finalize (void)
- 
-   /* See comment for ar_date above.  */
-   memcpy (&((struct ar_hdr *) symtab.symsoff)->ar_size, tmpbuf,
--	  snprintf (tmpbuf, sizeof (tmpbuf), "%-*zu",
-+	  snprintf (tmpbuf, sizeof (tmpbuf), "%-*" PRIu32 "",
- 		    (int) sizeof (((struct ar_hdr *) NULL)->ar_size),
--		    symtab.symsofflen + symtab.symsnamelen
--		    - sizeof (struct ar_hdr)));
-+		    (uint32_t) (symtab.symsofflen + symtab.symsnamelen
-+				- sizeof (struct ar_hdr))));
- }
- 
- 
--- 
-2.13.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
deleted file mode 100644
index 38b31f6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
+++ /dev/null
@@ -1,1163 +0,0 @@
-From 4b0fe80b3951f044c1c1b14d1d7f5f0b8ab67507 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 31 Dec 2015 06:35:34 +0000
-Subject: [PATCH] build: Provide alternatives for glibc assumptions helps
- compiling it on musl
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- Makefile.am                      |  2 +-
- lib/color.c                      |  2 +-
- lib/crc32_file.c                 |  4 +++-
- lib/fixedsizehash.h              |  4 ++--
- lib/system.h                     | 11 +++++++++++
- lib/xmalloc.c                    |  2 +-
- libasm/asm_end.c                 |  2 +-
- libasm/asm_newscn.c              |  2 +-
- libcpu/i386_gendis.c             |  2 +-
- libcpu/i386_lex.c                |  2 +-
- libcpu/i386_parse.c              |  2 +-
- libdw/Makefile.am                |  2 +-
- libdw/libdw_alloc.c              |  3 ++-
- libdwfl/Makefile.am              |  2 ++
- libdwfl/dwfl_build_id_find_elf.c |  3 ++-
- libdwfl/dwfl_error.c             |  4 +++-
- libdwfl/dwfl_module_getdwarf.c   |  1 +
- libdwfl/find-debuginfo.c         |  2 +-
- libdwfl/libdwfl_crc32_file.c     | 10 ++++++++++
- libdwfl/linux-kernel-modules.c   |  1 +
- libebl/eblopenbackend.c          |  2 +-
- libebl/eblwstrtab.c              |  2 +-
- libelf/elf.h                     |  9 ++++++---
- libelf/libelf.h                  |  1 +
- libelf/libelfP.h                 |  1 +
- src/addr2line.c                  |  2 +-
- src/ar.c                         |  2 +-
- src/arlib.c                      |  2 +-
- src/arlib2.c                     |  2 +-
- src/elfcmp.c                     |  2 +-
- src/elflint.c                    |  2 +-
- src/findtextrel.c                |  2 +-
- src/i386_ld.c                    |  2 +-
- src/ld.c                         |  2 +-
- src/ldgeneric.c                  |  2 +-
- src/ldlex.c                      |  2 +-
- src/ldscript.c                   |  2 +-
- src/nm.c                         |  2 +-
- src/objdump.c                    |  2 +-
- src/ranlib.c                     |  2 +-
- src/readelf.c                    |  2 +-
- src/size.c                       |  2 +-
- src/stack.c                      |  2 +-
- src/strings.c                    |  2 +-
- src/strip.c                      |  2 +-
- src/unstrip.c                    |  2 +-
- tests/addrscopes.c               |  2 +-
- tests/allregs.c                  |  2 +-
- tests/backtrace-data.c           |  2 +-
- tests/backtrace-dwarf.c          |  2 +-
- tests/backtrace.c                |  2 +-
- tests/buildid.c                  |  2 +-
- tests/debugaltlink.c             |  2 +-
- tests/debuglink.c                |  2 +-
- tests/deleted.c                  |  2 +-
- tests/dwfl-addr-sect.c           |  2 +-
- tests/dwfl-bug-addr-overflow.c   |  2 +-
- tests/dwfl-bug-fd-leak.c         |  2 +-
- tests/dwfl-bug-getmodules.c      |  2 +-
- tests/dwfl-report-elf-align.c    |  2 +-
- tests/dwfllines.c                |  2 +-
- tests/dwflmodtest.c              |  2 +-
- tests/dwflsyms.c                 |  2 +-
- tests/early-offscn.c             |  2 +-
- tests/ecp.c                      |  2 +-
- tests/find-prologues.c           |  2 +-
- tests/funcretval.c               |  2 +-
- tests/funcscopes.c               |  2 +-
- tests/getsrc_die.c               |  2 +-
- tests/line2addr.c                |  2 +-
- tests/low_high_pc.c              |  2 +-
- tests/md5-sha1-test.c            |  2 +-
- tests/rdwrmmap.c                 |  2 +-
- tests/saridx.c                   |  2 +-
- tests/sectiondump.c              |  2 +-
- tests/varlocs.c                  |  2 +-
- tests/vdsosyms.c                 |  2 +-
- 77 files changed, 109 insertions(+), 73 deletions(-)
-
-Index: elfutils-0.166/Makefile.am
-===================================================================
---- elfutils-0.166.orig/Makefile.am
-+++ elfutils-0.166/Makefile.am
-@@ -28,7 +28,7 @@ pkginclude_HEADERS = version.h
- 
- # Add doc back when we have some real content.
- SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \
--	  backends src po tests
-+	  backends po tests
- 
- EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
- 	     COPYING COPYING-GPLV2 COPYING-LGPLV3
-Index: elfutils-0.166/lib/color.c
-===================================================================
---- elfutils-0.166.orig/lib/color.c
-+++ elfutils-0.166/lib/color.c
-@@ -32,7 +32,7 @@
- #endif
- 
- #include <argp.h>
--#include <error.h>
-+#include <err.h>
- #include <libintl.h>
- #include <stdlib.h>
- #include <string.h>
-Index: elfutils-0.166/lib/crc32_file.c
-===================================================================
---- elfutils-0.166.orig/lib/crc32_file.c
-+++ elfutils-0.166/lib/crc32_file.c
-@@ -30,12 +30,14 @@
- # include <config.h>
- #endif
- 
--#include "system.h"
- #include <errno.h>
- #include <unistd.h>
-+#include <stdint.h>
- #include <sys/stat.h>
- #include <sys/mman.h>
- 
-+#include "system.h"
-+
- int
- crc32_file (int fd, uint32_t *resp)
- {
-Index: elfutils-0.166/lib/fixedsizehash.h
-===================================================================
---- elfutils-0.166.orig/lib/fixedsizehash.h
-+++ elfutils-0.166/lib/fixedsizehash.h
-@@ -30,12 +30,12 @@
- #include <errno.h>
- #include <stdlib.h>
- #include <string.h>
--#include <sys/cdefs.h>
- #include <sys/param.h>
- 
- #include <system.h>
- 
--#define CONCAT(t1,t2) __CONCAT (t1,t2)
-+#define CONCAT1(x,y) x##y
-+#define CONCAT(x,y) CONCAT1(x,y)
- 
- /* Before including this file the following macros must be defined:
- 
-Index: elfutils-0.166/lib/system.h
-===================================================================
---- elfutils-0.166.orig/lib/system.h
-+++ elfutils-0.166/lib/system.h
-@@ -49,6 +49,16 @@
- #else
- # error "Unknown byte order"
- #endif
-+#ifndef TEMP_FAILURE_RETRY
-+#define TEMP_FAILURE_RETRY(expression) \
-+  (__extension__							      \
-+    ({ long int __result;						      \
-+       do __result = (long int) (expression);				      \
-+       while (__result == -1L && errno == EINTR);			      \
-+       __result; }))
-+#endif
-+
-+#define error(status, errno, ...) err(status, __VA_ARGS__)
- 
- extern void *xmalloc (size_t) __attribute__ ((__malloc__));
- extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
-Index: elfutils-0.166/lib/xmalloc.c
-===================================================================
---- elfutils-0.166.orig/lib/xmalloc.c
-+++ elfutils-0.166/lib/xmalloc.c
-@@ -30,7 +30,7 @@
- # include <config.h>
- #endif
- 
--#include <error.h>
-+#include <err.h>
- #include <libintl.h>
- #include <stddef.h>
- #include <stdlib.h>
-Index: elfutils-0.166/libasm/asm_end.c
-===================================================================
---- elfutils-0.166.orig/libasm/asm_end.c
-+++ elfutils-0.166/libasm/asm_end.c
-@@ -32,7 +32,7 @@
- #endif
- 
- #include <assert.h>
--#include <error.h>
-+#include <err.h>
- #include <libintl.h>
- #include <stdio.h>
- #include <stdlib.h>
-Index: elfutils-0.166/libasm/asm_newscn.c
-===================================================================
---- elfutils-0.166.orig/libasm/asm_newscn.c
-+++ elfutils-0.166/libasm/asm_newscn.c
-@@ -32,7 +32,7 @@
- #endif
- 
- #include <assert.h>
--#include <error.h>
-+#include <err.h>
- #include <libintl.h>
- #include <stdlib.h>
- #include <string.h>
-Index: elfutils-0.166/libcpu/i386_gendis.c
-===================================================================
---- elfutils-0.166.orig/libcpu/i386_gendis.c
-+++ elfutils-0.166/libcpu/i386_gendis.c
-@@ -31,7 +31,7 @@
- # include <config.h>
- #endif
- 
--#include <error.h>
-+#include <err.h>
- #include <errno.h>
- #include <stdio.h>
- #include <stdlib.h>
-Index: elfutils-0.166/libcpu/i386_lex.c
-===================================================================
---- elfutils-0.166.orig/libcpu/i386_lex.c
-+++ elfutils-0.166/libcpu/i386_lex.c
-@@ -578,7 +578,7 @@ char *i386_text;
- #endif
- 
- #include <ctype.h>
--#include <error.h>
-+#include <err.h>
- #include <libintl.h>
- 
- #include <system.h>
-Index: elfutils-0.166/libcpu/i386_parse.c
-===================================================================
---- elfutils-0.166.orig/libcpu/i386_parse.c
-+++ elfutils-0.166/libcpu/i386_parse.c
-@@ -107,7 +107,7 @@
- #include <assert.h>
- #include <ctype.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <inttypes.h>
- #include <libintl.h>
- #include <math.h>
-Index: elfutils-0.166/libdw/Makefile.am
-===================================================================
---- elfutils-0.166.orig/libdw/Makefile.am
-+++ elfutils-0.166/libdw/Makefile.am
-@@ -117,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map l
- 		-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
- 		-Wl,--version-script,$<,--no-undefined \
- 		-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
--		-ldl -lz $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
-+		-ldl -lz $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS) -lfts -largp
- 	@$(textrel_check)
- 	$(AM_V_at)ln -fs $@ $@.$(VERSION)
- 
-Index: elfutils-0.166/libdw/libdw_alloc.c
-===================================================================
---- elfutils-0.166.orig/libdw/libdw_alloc.c
-+++ elfutils-0.166/libdw/libdw_alloc.c
-@@ -31,11 +31,12 @@
- # include <config.h>
- #endif
- 
--#include <error.h>
-+#include <err.h>
- #include <errno.h>
- #include <stdlib.h>
- #include <sys/param.h>
- #include "libdwP.h"
-+#include "system.h"
- 
- 
- void *
-Index: elfutils-0.166/libdwfl/Makefile.am
-===================================================================
---- elfutils-0.166.orig/libdwfl/Makefile.am
-+++ elfutils-0.166/libdwfl/Makefile.am
-@@ -84,6 +84,8 @@ libelf = ../libelf/libelf.so
- libebl = ../libebl/libebl.a
- libeu = ../lib/libeu.a
- 
-+LDADD = -lfts
-+
- libdwfl_pic_a_SOURCES =
- am_libdwfl_pic_a_OBJECTS = $(libdwfl_a_SOURCES:.c=.os)
- 
-Index: elfutils-0.166/libdwfl/dwfl_build_id_find_elf.c
-===================================================================
---- elfutils-0.166.orig/libdwfl/dwfl_build_id_find_elf.c
-+++ elfutils-0.166/libdwfl/dwfl_build_id_find_elf.c
-@@ -27,6 +27,7 @@
-    not, see <http://www.gnu.org/licenses/>.  */
- 
- #include "libdwflP.h"
-+#include "system.h"
- #include <inttypes.h>
- #include <fcntl.h>
- #include <unistd.h>
-@@ -94,7 +95,7 @@ __libdwfl_open_by_build_id (Dwfl_Module
- 	{
- 	  if (*file_name != NULL)
- 	    free (*file_name);
--	  *file_name = canonicalize_file_name (name);
-+	  *file_name = realpath (name, NULL);
- 	  if (*file_name == NULL)
- 	    {
- 	      *file_name = name;
-Index: elfutils-0.166/libdwfl/dwfl_error.c
-===================================================================
---- elfutils-0.166.orig/libdwfl/dwfl_error.c
-+++ elfutils-0.166/libdwfl/dwfl_error.c
-@@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
- const char *
- dwfl_errmsg (int error)
- {
-+  static __thread char s[64] = "";
-   if (error == 0 || error == -1)
-     {
-       int last_error = global_error;
-@@ -154,7 +155,8 @@ dwfl_errmsg (int error)
-   switch (error &~ 0xffff)
-     {
-     case OTHER_ERROR (ERRNO):
--      return strerror_r (error & 0xffff, "bad", 0);
-+      strerror_r (error & 0xffff, s, sizeof(s));
-+      return s;
-     case OTHER_ERROR (LIBELF):
-       return elf_errmsg (error & 0xffff);
-     case OTHER_ERROR (LIBDW):
-Index: elfutils-0.166/libdwfl/dwfl_module_getdwarf.c
-===================================================================
---- elfutils-0.166.orig/libdwfl/dwfl_module_getdwarf.c
-+++ elfutils-0.166/libdwfl/dwfl_module_getdwarf.c
-@@ -31,6 +31,7 @@
- #include <fcntl.h>
- #include <string.h>
- #include <unistd.h>
-+#include "system.h"
- #include "../libdw/libdwP.h"	/* DWARF_E_* values are here.  */
- #include "../libelf/libelfP.h"
- 
-Index: elfutils-0.166/libdwfl/find-debuginfo.c
-===================================================================
---- elfutils-0.166.orig/libdwfl/find-debuginfo.c
-+++ elfutils-0.166/libdwfl/find-debuginfo.c
-@@ -385,7 +385,7 @@ dwfl_standard_find_debuginfo (Dwfl_Modul
-       /* If FILE_NAME is a symlink, the debug file might be associated
- 	 with the symlink target name instead.  */
- 
--      char *canon = canonicalize_file_name (file_name);
-+      char *canon = realpath (file_name, NULL);
-       if (canon != NULL && strcmp (file_name, canon))
- 	fd = find_debuginfo_in_path (mod, canon,
- 				     debuglink_file, debuglink_crc,
-Index: elfutils-0.166/libdwfl/libdwfl_crc32_file.c
-===================================================================
---- elfutils-0.166.orig/libdwfl/libdwfl_crc32_file.c
-+++ elfutils-0.166/libdwfl/libdwfl_crc32_file.c
-@@ -31,6 +31,16 @@
- 
- #define crc32_file attribute_hidden __libdwfl_crc32_file
- #define crc32 __libdwfl_crc32
-+
-+#ifndef TEMP_FAILURE_RETRY
-+#define TEMP_FAILURE_RETRY(expression) \
-+  (__extension__							      \
-+    ({ long int __result;						      \
-+       do __result = (long int) (expression);				      \
-+       while (__result == -1L && errno == EINTR);			      \
-+       __result; }))
-+#endif
-+
- #define LIB_SYSTEM_H	1
- #include <libdwflP.h>
- #include "../lib/crc32_file.c"
-Index: elfutils-0.166/libdwfl/linux-kernel-modules.c
-===================================================================
---- elfutils-0.166.orig/libdwfl/linux-kernel-modules.c
-+++ elfutils-0.166/libdwfl/linux-kernel-modules.c
-@@ -34,6 +34,7 @@
- #include <config.h>
- 
- #include "libdwflP.h"
-+#include "system.h"
- #include <inttypes.h>
- #include <errno.h>
- #include <stdio.h>
-Index: elfutils-0.166/libebl/eblopenbackend.c
-===================================================================
---- elfutils-0.166.orig/libebl/eblopenbackend.c
-+++ elfutils-0.166/libebl/eblopenbackend.c
-@@ -32,7 +32,7 @@
- 
- #include <assert.h>
- #include <dlfcn.h>
--#include <error.h>
-+#include <err.h>
- #include <libelfP.h>
- #include <dwarf.h>
- #include <stdlib.h>
-Index: elfutils-0.166/libebl/eblwstrtab.c
-===================================================================
---- elfutils-0.166.orig/libebl/eblwstrtab.c
-+++ elfutils-0.166/libebl/eblwstrtab.c
-@@ -305,7 +305,7 @@ copystrings (struct Ebl_WStrent *nodep,
- 
-   /* Process the current node.  */
-   nodep->offset = *offsetp;
--  *freep = wmempcpy (*freep, nodep->string, nodep->len);
-+  *freep = wmemcpy (*freep, nodep->string, nodep->len) + nodep->len;
-   *offsetp += nodep->len * sizeof (wchar_t);
- 
-   for (subs = nodep->next; subs != NULL; subs = subs->next)
-Index: elfutils-0.166/libelf/elf.h
-===================================================================
---- elfutils-0.166.orig/libelf/elf.h
-+++ elfutils-0.166/libelf/elf.h
-@@ -21,7 +21,9 @@
- 
- #include <features.h>
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- /* Standard ELF types.  */
- 
-@@ -3591,7 +3593,8 @@ enum
- 
- #define R_TILEGX_NUM		130
- 
--
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif	/* elf.h */
-Index: elfutils-0.166/libelf/libelf.h
-===================================================================
---- elfutils-0.166.orig/libelf/libelf.h
-+++ elfutils-0.166/libelf/libelf.h
-@@ -29,6 +29,7 @@
- #ifndef _LIBELF_H
- #define _LIBELF_H 1
- 
-+#include <fcntl.h>
- #include <stdint.h>
- #include <sys/types.h>
- 
-Index: elfutils-0.166/libelf/libelfP.h
-===================================================================
---- elfutils-0.166.orig/libelf/libelfP.h
-+++ elfutils-0.166/libelf/libelfP.h
-@@ -36,6 +36,7 @@
- 
- #include <ar.h>
- #include <gelf.h>
-+#include <libelf.h>
- 
- #include <errno.h>
- #include <stdbool.h>
-Index: elfutils-0.166/src/addr2line.c
-===================================================================
---- elfutils-0.166.orig/src/addr2line.c
-+++ elfutils-0.166/src/addr2line.c
-@@ -23,7 +23,7 @@
- #include <argp.h>
- #include <assert.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <inttypes.h>
- #include <libdwfl.h>
-Index: elfutils-0.166/src/ar.c
-===================================================================
---- elfutils-0.166.orig/src/ar.c
-+++ elfutils-0.166/src/ar.c
-@@ -22,7 +22,7 @@
- 
- #include <argp.h>
- #include <assert.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <libintl.h>
-Index: elfutils-0.166/src/arlib.c
-===================================================================
---- elfutils-0.166.orig/src/arlib.c
-+++ elfutils-0.166/src/arlib.c
-@@ -21,7 +21,7 @@
- #endif
- 
- #include <assert.h>
--#include <error.h>
-+#include <err.h>
- #include <gelf.h>
- #include <libintl.h>
- #include <stdio.h>
-Index: elfutils-0.166/src/arlib2.c
-===================================================================
---- elfutils-0.166.orig/src/arlib2.c
-+++ elfutils-0.166/src/arlib2.c
-@@ -20,7 +20,7 @@
- # include <config.h>
- #endif
- 
--#include <error.h>
-+#include <err.h>
- #include <libintl.h>
- #include <limits.h>
- #include <string.h>
-Index: elfutils-0.166/src/elfcmp.c
-===================================================================
---- elfutils-0.166.orig/src/elfcmp.c
-+++ elfutils-0.166/src/elfcmp.c
-@@ -23,7 +23,7 @@
- #include <argp.h>
- #include <assert.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <locale.h>
- #include <libintl.h>
-Index: elfutils-0.166/src/elflint.c
-===================================================================
---- elfutils-0.166.orig/src/elflint.c
-+++ elfutils-0.166/src/elflint.c
-@@ -24,7 +24,7 @@
- #include <assert.h>
- #include <byteswap.h>
- #include <endian.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <inttypes.h>
-Index: elfutils-0.166/src/findtextrel.c
-===================================================================
---- elfutils-0.166.orig/src/findtextrel.c
-+++ elfutils-0.166/src/findtextrel.c
-@@ -23,7 +23,7 @@
- #include <argp.h>
- #include <assert.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <libdw.h>
-Index: elfutils-0.166/src/i386_ld.c
-===================================================================
---- elfutils-0.166.orig/src/i386_ld.c
-+++ elfutils-0.166/src/i386_ld.c
-@@ -20,7 +20,7 @@
- #endif
- 
- #include <assert.h>
--#include <error.h>
-+#include <err.h>
- #include <libintl.h>
- #include <stdlib.h>
- #include <string.h>
-Index: elfutils-0.166/src/ld.c
-===================================================================
---- elfutils-0.166.orig/src/ld.c
-+++ elfutils-0.166/src/ld.c
-@@ -21,7 +21,7 @@
- 
- #include <argp.h>
- #include <assert.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <libelf.h>
- #include <libintl.h>
-Index: elfutils-0.166/src/ldgeneric.c
-===================================================================
---- elfutils-0.166.orig/src/ldgeneric.c
-+++ elfutils-0.166/src/ldgeneric.c
-@@ -23,7 +23,7 @@
- #include <ctype.h>
- #include <dlfcn.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <fnmatch.h>
- #include <gelf.h>
-Index: elfutils-0.166/src/ldlex.c
-===================================================================
---- elfutils-0.166.orig/src/ldlex.c
-+++ elfutils-0.166/src/ldlex.c
-@@ -1106,7 +1106,7 @@ char *ldtext;
- #include <assert.h>
- #include <ctype.h>
- #include <elf.h>
--#include <error.h>
-+#include <err.h>
- #include <inttypes.h>
- #include <libintl.h>
- #include <stdbool.h>
-Index: elfutils-0.166/src/ldscript.c
-===================================================================
---- elfutils-0.166.orig/src/ldscript.c
-+++ elfutils-0.166/src/ldscript.c
-@@ -95,7 +95,7 @@
- #endif
- 
- #include <assert.h>
--#include <error.h>
-+#include <err.h>
- #include <libintl.h>
- #include <stdbool.h>
- #include <stdint.h>
-Index: elfutils-0.166/src/nm.c
-===================================================================
---- elfutils-0.166.orig/src/nm.c
-+++ elfutils-0.166/src/nm.c
-@@ -26,7 +26,7 @@
- #include <ctype.h>
- #include <dwarf.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <inttypes.h>
-Index: elfutils-0.166/src/objdump.c
-===================================================================
---- elfutils-0.166.orig/src/objdump.c
-+++ elfutils-0.166/src/objdump.c
-@@ -21,7 +21,7 @@
- #endif
- 
- #include <argp.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <inttypes.h>
- #include <libintl.h>
-Index: elfutils-0.166/src/ranlib.c
-===================================================================
---- elfutils-0.166.orig/src/ranlib.c
-+++ elfutils-0.166/src/ranlib.c
-@@ -24,7 +24,7 @@
- #include <argp.h>
- #include <assert.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <libintl.h>
-Index: elfutils-0.166/src/readelf.c
-===================================================================
---- elfutils-0.166.orig/src/readelf.c
-+++ elfutils-0.166/src/readelf.c
-@@ -25,7 +25,7 @@
- #include <ctype.h>
- #include <dwarf.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <inttypes.h>
-Index: elfutils-0.166/src/size.c
-===================================================================
---- elfutils-0.166.orig/src/size.c
-+++ elfutils-0.166/src/size.c
-@@ -21,7 +21,7 @@
- #endif
- 
- #include <argp.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <inttypes.h>
-Index: elfutils-0.166/src/stack.c
-===================================================================
---- elfutils-0.166.orig/src/stack.c
-+++ elfutils-0.166/src/stack.c
-@@ -18,7 +18,7 @@
- #include <config.h>
- #include <assert.h>
- #include <argp.h>
--#include <error.h>
-+#include <err.h>
- #include <stdlib.h>
- #include <inttypes.h>
- #include <stdio.h>
-Index: elfutils-0.166/src/strings.c
-===================================================================
---- elfutils-0.166.orig/src/strings.c
-+++ elfutils-0.166/src/strings.c
-@@ -25,7 +25,7 @@
- #include <ctype.h>
- #include <endian.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <inttypes.h>
-Index: elfutils-0.166/src/strip.c
-===================================================================
---- elfutils-0.166.orig/src/strip.c
-+++ elfutils-0.166/src/strip.c
-@@ -24,7 +24,7 @@
- #include <assert.h>
- #include <byteswap.h>
- #include <endian.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <libelf.h>
-Index: elfutils-0.166/src/unstrip.c
-===================================================================
---- elfutils-0.166.orig/src/unstrip.c
-+++ elfutils-0.166/src/unstrip.c
-@@ -31,7 +31,7 @@
- #include <argp.h>
- #include <assert.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <fnmatch.h>
- #include <libintl.h>
-Index: elfutils-0.166/tests/addrscopes.c
-===================================================================
---- elfutils-0.166.orig/tests/addrscopes.c
-+++ elfutils-0.166/tests/addrscopes.c
-@@ -25,7 +25,7 @@
- #include <stdio_ext.h>
- #include <locale.h>
- #include <stdlib.h>
--#include <error.h>
-+#include <err.h>
- #include <string.h>
- 
- 
-Index: elfutils-0.166/tests/allregs.c
-===================================================================
---- elfutils-0.166.orig/tests/allregs.c
-+++ elfutils-0.166/tests/allregs.c
-@@ -21,7 +21,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--#include <error.h>
-+#include <err.h>
- #include <locale.h>
- #include <argp.h>
- #include <assert.h>
-Index: elfutils-0.166/tests/backtrace-data.c
-===================================================================
---- elfutils-0.166.orig/tests/backtrace-data.c
-+++ elfutils-0.166/tests/backtrace-data.c
-@@ -27,7 +27,7 @@
- #include <dirent.h>
- #include <stdlib.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <unistd.h>
- #include <dwarf.h>
- #if defined(__x86_64__) && defined(__linux__)
-Index: elfutils-0.166/tests/backtrace-dwarf.c
-===================================================================
---- elfutils-0.166.orig/tests/backtrace-dwarf.c
-+++ elfutils-0.166/tests/backtrace-dwarf.c
-@@ -22,7 +22,7 @@
- #include <stdio_ext.h>
- #include <locale.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <unistd.h>
- #include <sys/ptrace.h>
- #include <sys/types.h>
-Index: elfutils-0.166/tests/backtrace.c
-===================================================================
---- elfutils-0.166.orig/tests/backtrace.c
-+++ elfutils-0.166/tests/backtrace.c
-@@ -24,7 +24,7 @@
- #include <dirent.h>
- #include <stdlib.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <unistd.h>
- #include <dwarf.h>
- #ifdef __linux__
-Index: elfutils-0.166/tests/buildid.c
-===================================================================
---- elfutils-0.166.orig/tests/buildid.c
-+++ elfutils-0.166/tests/buildid.c
-@@ -23,7 +23,7 @@
- #include ELFUTILS_HEADER(elf)
- #include ELFUTILS_HEADER(dwelf)
- #include <stdio.h>
--#include <error.h>
-+#include <err.h>
- #include <string.h>
- #include <stdlib.h>
- #include <sys/types.h>
-Index: elfutils-0.166/tests/debugaltlink.c
-===================================================================
---- elfutils-0.166.orig/tests/debugaltlink.c
-+++ elfutils-0.166/tests/debugaltlink.c
-@@ -23,7 +23,7 @@
- #include ELFUTILS_HEADER(dw)
- #include ELFUTILS_HEADER(dwelf)
- #include <stdio.h>
--#include <error.h>
-+#include <err.h>
- #include <string.h>
- #include <stdlib.h>
- #include <sys/types.h>
-Index: elfutils-0.166/tests/debuglink.c
-===================================================================
---- elfutils-0.166.orig/tests/debuglink.c
-+++ elfutils-0.166/tests/debuglink.c
-@@ -21,7 +21,7 @@
- #include <errno.h>
- #include ELFUTILS_HEADER(dwelf)
- #include <stdio.h>
--#include <error.h>
-+#include <err.h>
- #include <string.h>
- #include <stdlib.h>
- #include <sys/types.h>
-Index: elfutils-0.166/tests/deleted.c
-===================================================================
---- elfutils-0.166.orig/tests/deleted.c
-+++ elfutils-0.166/tests/deleted.c
-@@ -21,7 +21,7 @@
- #include <unistd.h>
- #include <assert.h>
- #include <stdio.h>
--#include <error.h>
-+#include <err.h>
- #include <errno.h>
- #ifdef __linux__
- #include <sys/prctl.h>
-Index: elfutils-0.166/tests/dwfl-addr-sect.c
-===================================================================
---- elfutils-0.166.orig/tests/dwfl-addr-sect.c
-+++ elfutils-0.166/tests/dwfl-addr-sect.c
-@@ -23,7 +23,7 @@
- #include <stdio_ext.h>
- #include <stdlib.h>
- #include <string.h>
--#include <error.h>
-+#include <err.h>
- #include <locale.h>
- #include <argp.h>
- #include ELFUTILS_HEADER(dwfl)
-Index: elfutils-0.166/tests/dwfl-bug-addr-overflow.c
-===================================================================
---- elfutils-0.166.orig/tests/dwfl-bug-addr-overflow.c
-+++ elfutils-0.166/tests/dwfl-bug-addr-overflow.c
-@@ -20,7 +20,7 @@
- #include <inttypes.h>
- #include <stdio.h>
- #include <stdio_ext.h>
--#include <error.h>
-+#include <err.h>
- #include <locale.h>
- #include ELFUTILS_HEADER(dwfl)
- 
-Index: elfutils-0.166/tests/dwfl-bug-fd-leak.c
-===================================================================
---- elfutils-0.166.orig/tests/dwfl-bug-fd-leak.c
-+++ elfutils-0.166/tests/dwfl-bug-fd-leak.c
-@@ -24,7 +24,7 @@
- #include <dirent.h>
- #include <stdlib.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <unistd.h>
- #include <dwarf.h>
- 
-Index: elfutils-0.166/tests/dwfl-bug-getmodules.c
-===================================================================
---- elfutils-0.166.orig/tests/dwfl-bug-getmodules.c
-+++ elfutils-0.166/tests/dwfl-bug-getmodules.c
-@@ -18,7 +18,7 @@
- #include <config.h>
- #include ELFUTILS_HEADER(dwfl)
- 
--#include <error.h>
-+#include <err.h>
- 
- static const Dwfl_Callbacks callbacks =
-   {
-Index: elfutils-0.166/tests/dwfl-report-elf-align.c
-===================================================================
---- elfutils-0.166.orig/tests/dwfl-report-elf-align.c
-+++ elfutils-0.166/tests/dwfl-report-elf-align.c
-@@ -20,7 +20,7 @@
- #include <inttypes.h>
- #include <stdio.h>
- #include <stdio_ext.h>
--#include <error.h>
-+#include <err.h>
- #include <locale.h>
- #include <string.h>
- #include <stdlib.h>
-Index: elfutils-0.166/tests/dwfllines.c
-===================================================================
---- elfutils-0.166.orig/tests/dwfllines.c
-+++ elfutils-0.166/tests/dwfllines.c
-@@ -27,7 +27,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--#include <error.h>
-+#include <err.h>
- 
- int
- main (int argc, char *argv[])
-Index: elfutils-0.166/tests/dwflmodtest.c
-===================================================================
---- elfutils-0.166.orig/tests/dwflmodtest.c
-+++ elfutils-0.166/tests/dwflmodtest.c
-@@ -23,7 +23,7 @@
- #include <stdio_ext.h>
- #include <stdlib.h>
- #include <string.h>
--#include <error.h>
-+#include <err.h>
- #include <locale.h>
- #include <argp.h>
- #include ELFUTILS_HEADER(dwfl)
-Index: elfutils-0.166/tests/dwflsyms.c
-===================================================================
---- elfutils-0.166.orig/tests/dwflsyms.c
-+++ elfutils-0.166/tests/dwflsyms.c
-@@ -25,7 +25,7 @@
- #include <stdio.h>
- #include <stdio_ext.h>
- #include <stdlib.h>
--#include <error.h>
-+#include <err.h>
- #include <string.h>
- 
- static const char *
-Index: elfutils-0.166/tests/early-offscn.c
-===================================================================
---- elfutils-0.166.orig/tests/early-offscn.c
-+++ elfutils-0.166/tests/early-offscn.c
-@@ -19,7 +19,7 @@
- #endif
- 
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <stdio.h>
-Index: elfutils-0.166/tests/ecp.c
-===================================================================
---- elfutils-0.166.orig/tests/ecp.c
-+++ elfutils-0.166/tests/ecp.c
-@@ -20,7 +20,7 @@
- #endif
- 
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <stdlib.h>
-Index: elfutils-0.166/tests/find-prologues.c
-===================================================================
---- elfutils-0.166.orig/tests/find-prologues.c
-+++ elfutils-0.166/tests/find-prologues.c
-@@ -25,7 +25,7 @@
- #include <stdio_ext.h>
- #include <locale.h>
- #include <stdlib.h>
--#include <error.h>
-+#include <err.h>
- #include <string.h>
- #include <fnmatch.h>
- 
-Index: elfutils-0.166/tests/funcretval.c
-===================================================================
---- elfutils-0.166.orig/tests/funcretval.c
-+++ elfutils-0.166/tests/funcretval.c
-@@ -25,7 +25,7 @@
- #include <stdio_ext.h>
- #include <locale.h>
- #include <stdlib.h>
--#include <error.h>
-+#include <err.h>
- #include <string.h>
- #include <fnmatch.h>
- 
-Index: elfutils-0.166/tests/funcscopes.c
-===================================================================
---- elfutils-0.166.orig/tests/funcscopes.c
-+++ elfutils-0.166/tests/funcscopes.c
-@@ -25,7 +25,7 @@
- #include <stdio_ext.h>
- #include <locale.h>
- #include <stdlib.h>
--#include <error.h>
-+#include <err.h>
- #include <string.h>
- #include <fnmatch.h>
- 
-Index: elfutils-0.166/tests/getsrc_die.c
-===================================================================
---- elfutils-0.166.orig/tests/getsrc_die.c
-+++ elfutils-0.166/tests/getsrc_die.c
-@@ -19,7 +19,7 @@
- #endif
- 
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <inttypes.h>
- #include <libelf.h>
-Index: elfutils-0.166/tests/line2addr.c
-===================================================================
---- elfutils-0.166.orig/tests/line2addr.c
-+++ elfutils-0.166/tests/line2addr.c
-@@ -26,7 +26,7 @@
- #include <locale.h>
- #include <stdlib.h>
- #include <string.h>
--#include <error.h>
-+#include <err.h>
- 
- 
- static void
-Index: elfutils-0.166/tests/low_high_pc.c
-===================================================================
---- elfutils-0.166.orig/tests/low_high_pc.c
-+++ elfutils-0.166/tests/low_high_pc.c
-@@ -25,7 +25,7 @@
- #include <stdio_ext.h>
- #include <locale.h>
- #include <stdlib.h>
--#include <error.h>
-+#include <err.h>
- #include <string.h>
- #include <fnmatch.h>
- 
-Index: elfutils-0.166/tests/md5-sha1-test.c
-===================================================================
---- elfutils-0.166.orig/tests/md5-sha1-test.c
-+++ elfutils-0.166/tests/md5-sha1-test.c
-@@ -19,7 +19,7 @@
- #endif
- 
- #include <string.h>
--#include <error.h>
-+#include <err.h>
- 
- #include "md5.h"
- #include "sha1.h"
-Index: elfutils-0.166/tests/rdwrmmap.c
-===================================================================
---- elfutils-0.166.orig/tests/rdwrmmap.c
-+++ elfutils-0.166/tests/rdwrmmap.c
-@@ -19,7 +19,7 @@
- #endif
- 
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <stdio.h>
- #include <fcntl.h>
- #include <unistd.h>
-Index: elfutils-0.166/tests/saridx.c
-===================================================================
---- elfutils-0.166.orig/tests/saridx.c
-+++ elfutils-0.166/tests/saridx.c
-@@ -17,7 +17,7 @@
- 
- #include <config.h>
- 
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <stdio.h>
-Index: elfutils-0.166/tests/sectiondump.c
-===================================================================
---- elfutils-0.166.orig/tests/sectiondump.c
-+++ elfutils-0.166/tests/sectiondump.c
-@@ -18,7 +18,7 @@
- #include <config.h>
- 
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <fcntl.h>
- #include <gelf.h>
- #include <inttypes.h>
-Index: elfutils-0.166/tests/varlocs.c
-===================================================================
---- elfutils-0.166.orig/tests/varlocs.c
-+++ elfutils-0.166/tests/varlocs.c
-@@ -25,7 +25,7 @@
- #include <dwarf.h>
- #include <stdio.h>
- #include <stdlib.h>
--#include <error.h>
-+#include <err.h>
- #include <string.h>
- #include <sys/types.h>
- #include <sys/stat.h>
-Index: elfutils-0.166/tests/vdsosyms.c
-===================================================================
---- elfutils-0.166.orig/tests/vdsosyms.c
-+++ elfutils-0.166/tests/vdsosyms.c
-@@ -18,7 +18,7 @@
- #include <config.h>
- #include <assert.h>
- #include <errno.h>
--#include <error.h>
-+#include <err.h>
- #include <inttypes.h>
- #include <stdio.h>
- #include <string.h>
-Index: elfutils-0.166/libelf/elf_getarsym.c
-===================================================================
---- elfutils-0.166.orig/libelf/elf_getarsym.c
-+++ elfutils-0.166/libelf/elf_getarsym.c
-@@ -302,7 +302,7 @@ elf_getarsym (Elf *elf, size_t *ptr)
- 		arsym[cnt].as_off = (*u32)[cnt];
- 
- 	      arsym[cnt].as_hash = _dl_elf_hash (str_data);
--	      str_data = rawmemchr (str_data, '\0') + 1;
-+	      str_data = memchr (str_data, '\0', SIZE_MAX) + 1;
- 	    }
- 
- 	  /* At the end a special entry.  */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
deleted file mode 100644
index 72125c9..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
+++ /dev/null
@@ -1,168 +0,0 @@
-From fdaab18a65ed2529656baa64cb6169f34d7e507b Mon Sep 17 00:00:00 2001
-From: James Cowgill <james410@cowgill.org.uk>
-Date: Mon, 5 Jan 2015 15:17:01 +0000
-Subject: [PATCH 2/3] Add support for mips64 abis in mips_retval.c
-
-Signed-off-by: James Cowgill <james410@cowgill.org.uk>
----
- backends/mips_retval.c | 104 ++++++++++++++++++++++++++++++++++++++++++++-----
- 1 file changed, 94 insertions(+), 10 deletions(-)
-
-diff --git a/backends/mips_retval.c b/backends/mips_retval.c
-index 33f12a7..d5c6ef0 100644
---- a/backends/mips_retval.c
-+++ b/backends/mips_retval.c
-@@ -91,6 +91,8 @@ enum mips_abi find_mips_abi(Elf *elf)
-     default:
-       if ((elf_flags & EF_MIPS_ABI2))
- 	return MIPS_ABI_N32;
-+      else if ((ehdr->e_ident[EI_CLASS] == ELFCLASS64))
-+	return MIPS_ABI_N64;
-     }
- 
-   /* GCC creates a pseudo-section whose name describes the ABI.  */
-@@ -195,6 +197,57 @@ static const Dwarf_Op loc_aggregate[] =
-   };
- #define nloc_aggregate 1
- 
-+/* Test if a struct member is a float */
-+static int is_float_child(Dwarf_Die *childdie)
-+{
-+  /* Test if this is actually a struct member */
-+  if (dwarf_tag(childdie) != DW_TAG_member)
-+    return 0;
-+
-+  /* Get type of member */
-+  Dwarf_Attribute attr_mem;
-+  Dwarf_Die child_type_mem;
-+  Dwarf_Die *child_typedie =
-+    dwarf_formref_die(dwarf_attr_integrate(childdie,
-+                                           DW_AT_type,
-+                                           &attr_mem), &child_type_mem);
-+
-+  if (dwarf_tag(child_typedie) != DW_TAG_base_type)
-+    return 0;
-+
-+  /* Get base subtype */
-+  Dwarf_Word encoding;
-+  if (dwarf_formudata (dwarf_attr_integrate (child_typedie,
-+                                             DW_AT_encoding,
-+                                             &attr_mem), &encoding) != 0)
-+    return 0;
-+
-+  return encoding == DW_ATE_float;
-+}
-+
-+/* Returns the number of fpregs which can be returned in the given struct */
-+static int get_struct_fpregs(Dwarf_Die *structtypedie)
-+{
-+  Dwarf_Die child_mem;
-+  int fpregs = 0;
-+
-+  /* Get first structure member */
-+  if (dwarf_child(structtypedie, &child_mem) != 0)
-+    return 0;
-+
-+  do
-+    {
-+      /* Ensure this register is a float */
-+      if (!is_float_child(&child_mem))
-+        return 0;
-+
-+      fpregs++;
-+    }
-+  while (dwarf_siblingof (&child_mem, &child_mem) == 0);
-+
-+  return fpregs;
-+}
-+
- int
- mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
- {
-@@ -240,6 +293,7 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-       tag = dwarf_tag (typedie);
-     }
- 
-+  Dwarf_Word size;
-   switch (tag)
-     {
-     case -1:
-@@ -258,8 +312,6 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-     case DW_TAG_enumeration_type:
-     case DW_TAG_pointer_type:
-     case DW_TAG_ptr_to_member_type:
--      {
--        Dwarf_Word size;
- 	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
- 					 &attr_mem), &size) != 0)
- 	  {
-@@ -289,7 +341,7 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
- 		if (size <= 4*regsize && abi == MIPS_ABI_O32)
-                   return nloc_fpregquad;
- 
--		goto aggregate;
-+		goto large;
- 	      }
- 	  }
- 	*locp = ABI_LOC(loc_intreg, regsize);
-@@ -298,18 +350,50 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
- 	if (size <= 2*regsize)
- 	  return nloc_intregpair;
- 
--	/* Else fall through. Shouldn't happen though (at least with gcc) */
--      }
-+	/* Else pass in memory. Shouldn't happen though (at least with gcc) */
-+	goto large;
- 
-     case DW_TAG_structure_type:
-     case DW_TAG_class_type:
-     case DW_TAG_union_type:
--    case DW_TAG_array_type:
--    aggregate:
--      /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
--      if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64))
--        return -2;
-+      /* Handle special cases for structures <= 128 bytes in newer ABIs */
-+      if (abi == MIPS_ABI_EABI32 || abi == MIPS_ABI_EABI64 ||
-+          abi == MIPS_ABI_N32 || abi == MIPS_ABI_N64)
-+        {
-+          if (dwarf_aggregate_size (typedie, &size) == 0 && size <= 16)
-+            {
-+              /*
-+               * Special case in N64 / N32 -
-+               * structures containing only floats are returned in fp regs.
-+               * Everything else is returned in integer regs.
-+               */
-+              if (tag != DW_TAG_union_type &&
-+                  (abi == MIPS_ABI_N32 || abi == MIPS_ABI_N64))
-+                {
-+                  int num_fpregs = get_struct_fpregs(typedie);
-+                  if (num_fpregs == 1 || num_fpregs == 2)
-+                    {
-+                      *locp = loc_fpreg;
-+                      if (num_fpregs == 1)
-+                        return nloc_fpreg;
-+                      else
-+                        return nloc_fpregpair;
-+                    }
-+                }
-+
-+              *locp = loc_intreg;
-+              if (size <= 8)
-+                return nloc_intreg;
-+              else
-+                return nloc_intregpair;
-+            }
-+        }
-+
-+      /* Fallthrough to handle large types */
- 
-+    case DW_TAG_array_type:
-+    large:
-+      /* Return large structures in memory */
-       *locp = loc_aggregate;
-       return nloc_aggregate;
-     }
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0003-Add-mips-n64-relocation-format-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0003-Add-mips-n64-relocation-format-hack.patch
deleted file mode 100644
index 14b7985..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0003-Add-mips-n64-relocation-format-hack.patch
+++ /dev/null
@@ -1,226 +0,0 @@
-From 59d4b8c48e5040af7e02b34eb26ea602ec82a38e Mon Sep 17 00:00:00 2001
-From: James Cowgill <james410@cowgill.org.uk>
-Date: Mon, 5 Jan 2015 15:17:02 +0000
-Subject: [PATCH 3/3] Add mips n64 relocation format hack
-
-MIPSEL N64 ELF files use a slightly different format for storing relocation
-entries which is incompatible with the normal R_SYM / R_INFO macros.
-To workaround this, we rearrange the bytes in the relocation's r_info field
-when reading and writing the relocations.
-
-This patch also ensures that strip.c sets the correct value of e_machine
-before manipulating relocations so that these changes take effect.
-
-Signed-off-by: James Cowgill <james410@cowgill.org.uk>
----
- libelf/gelf_getrel.c      | 25 +++++++++++++++++++++++--
- libelf/gelf_getrela.c     | 25 +++++++++++++++++++++++--
- libelf/gelf_update_rel.c  | 20 +++++++++++++++++++-
- libelf/gelf_update_rela.c | 20 +++++++++++++++++++-
- src/strip.c               | 17 +++++++++++++++++
- 5 files changed, 101 insertions(+), 6 deletions(-)
-
-Index: elfutils-0.164/libelf/gelf_getrel.c
-===================================================================
---- elfutils-0.164.orig/libelf/gelf_getrel.c
-+++ elfutils-0.164/libelf/gelf_getrel.c
-@@ -36,6 +36,7 @@
- 
- #include "libelfP.h"
- 
-+#define EF_MIPS_ABI	0x0000F000
- 
- GElf_Rel *
- gelf_getrel (Elf_Data *data, int ndx, GElf_Rel *dst)
-@@ -89,8 +90,28 @@ gelf_getrel (Elf_Data *data, int ndx, GE
- 	  result = NULL;
- 	}
-       else
--	result = memcpy (dst, &((Elf64_Rel *) data_scn->d.d_buf)[ndx],
--			 sizeof (Elf64_Rel));
-+        {
-+          GElf_Ehdr hdr;
-+          result = memcpy (dst, &((Elf64_Rel *) data_scn->d.d_buf)[ndx],
-+                           sizeof (Elf64_Rel));
-+
-+          if (gelf_getehdr(scn->elf, &hdr) != NULL &&
-+              hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
-+              hdr.e_machine == EM_MIPS &&
-+              (hdr.e_flags & EF_MIPS_ABI) == 0)
-+            {
-+              /*
-+               * The relocation format is mangled on MIPSEL N64
-+               *  We'll adjust it so at least R_SYM will work on it
-+               */
-+              GElf_Xword r_info = dst->r_info;
-+              dst->r_info = (r_info << 32) |
-+                            ((r_info >> 8) & 0xFF000000) |
-+                            ((r_info >> 24) & 0x00FF0000) |
-+                            ((r_info >> 40) & 0x0000FF00) |
-+                            ((r_info >> 56) & 0x000000FF);
-+            }
-+        }
-     }
- 
-   rwlock_unlock (scn->elf->lock);
-Index: elfutils-0.164/libelf/gelf_getrela.c
-===================================================================
---- elfutils-0.164.orig/libelf/gelf_getrela.c
-+++ elfutils-0.164/libelf/gelf_getrela.c
-@@ -36,6 +36,7 @@
- 
- #include "libelfP.h"
- 
-+#define EF_MIPS_ABI	0x0000F000
- 
- GElf_Rela *
- gelf_getrela (Elf_Data *data, int ndx, GElf_Rela *dst)
-@@ -90,8 +91,28 @@ gelf_getrela (Elf_Data *data, int ndx, G
- 	  result = NULL;
- 	}
-       else
--	result = memcpy (dst, &((Elf64_Rela *) data_scn->d.d_buf)[ndx],
--			 sizeof (Elf64_Rela));
-+        {
-+          GElf_Ehdr hdr;
-+          result = memcpy (dst, &((Elf64_Rela *) data_scn->d.d_buf)[ndx],
-+                           sizeof (Elf64_Rela));
-+
-+          if (gelf_getehdr(scn->elf, &hdr) != NULL &&
-+              hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
-+              hdr.e_machine == EM_MIPS &&
-+              (hdr.e_flags & EF_MIPS_ABI) == 0)
-+            {
-+              /*
-+               * The relocation format is mangled on MIPSEL N64
-+               *  We'll adjust it so at least R_SYM will work on it
-+               */
-+              GElf_Xword r_info = dst->r_info;
-+              dst->r_info = (r_info << 32) |
-+                            ((r_info >> 8) & 0xFF000000) |
-+                            ((r_info >> 24) & 0x00FF0000) |
-+                            ((r_info >> 40) & 0x0000FF00) |
-+                            ((r_info >> 56) & 0x000000FF);
-+            }
-+        }
-     }
- 
-   rwlock_unlock (scn->elf->lock);
-Index: elfutils-0.164/libelf/gelf_update_rel.c
-===================================================================
---- elfutils-0.164.orig/libelf/gelf_update_rel.c
-+++ elfutils-0.164/libelf/gelf_update_rel.c
-@@ -36,6 +36,7 @@
- 
- #include "libelfP.h"
- 
-+#define EF_MIPS_ABI	0x0000F000
- 
- int
- gelf_update_rel (Elf_Data *dst, int ndx, GElf_Rel *src)
-@@ -86,6 +87,9 @@ gelf_update_rel (Elf_Data *dst, int ndx,
-     }
-   else
-     {
-+      GElf_Ehdr hdr;
-+      GElf_Rel value = *src;
-+
-       /* Check whether we have to resize the data buffer.  */
-       if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
- 	{
-@@ -93,7 +97,21 @@ gelf_update_rel (Elf_Data *dst, int ndx,
- 	  goto out;
- 	}
- 
--      ((Elf64_Rel *) data_scn->d.d_buf)[ndx] = *src;
-+      if (gelf_getehdr(scn->elf, &hdr) != NULL &&
-+          hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
-+          hdr.e_machine == EM_MIPS &&
-+          (hdr.e_flags & EF_MIPS_ABI) == 0)
-+        {
-+          /* Undo the MIPSEL N64 hack from gelf_getrel */
-+          GElf_Xword r_info = value.r_info;
-+          value.r_info = (r_info >> 32) |
-+                         ((r_info << 8) &  0x000000FF00000000) |
-+                         ((r_info << 24) & 0x0000FF0000000000) |
-+                         ((r_info << 40) & 0x00FF000000000000) |
-+                         ((r_info << 56) & 0xFF00000000000000);
-+        }
-+
-+      ((Elf64_Rel *) data_scn->d.d_buf)[ndx] = value;
-     }
- 
-   result = 1;
-Index: elfutils-0.164/libelf/gelf_update_rela.c
-===================================================================
---- elfutils-0.164.orig/libelf/gelf_update_rela.c
-+++ elfutils-0.164/libelf/gelf_update_rela.c
-@@ -36,6 +36,7 @@
- 
- #include "libelfP.h"
- 
-+#define EF_MIPS_ABI	0x0000F000
- 
- int
- gelf_update_rela (Elf_Data *dst, int ndx, GElf_Rela *src)
-@@ -89,6 +90,9 @@ gelf_update_rela (Elf_Data *dst, int ndx
-     }
-   else
-     {
-+      GElf_Ehdr hdr;
-+      GElf_Rela value = *src;
-+
-       /* Check whether we have to resize the data buffer.  */
-       if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
- 	{
-@@ -96,7 +100,21 @@ gelf_update_rela (Elf_Data *dst, int ndx
- 	  goto out;
- 	}
- 
--      ((Elf64_Rela *) data_scn->d.d_buf)[ndx] = *src;
-+      if (gelf_getehdr(scn->elf, &hdr) != NULL &&
-+          hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
-+          hdr.e_machine == EM_MIPS &&
-+          (hdr.e_flags & EF_MIPS_ABI) == 0)
-+        {
-+          /* Undo the MIPSEL N64 hack from gelf_getrel */
-+          GElf_Xword r_info = value.r_info;
-+          value.r_info = (r_info >> 32) |
-+                         ((r_info << 8) &  0x000000FF00000000) |
-+                         ((r_info << 24) & 0x0000FF0000000000) |
-+                         ((r_info << 40) & 0x00FF000000000000) |
-+                         ((r_info << 56) & 0xFF00000000000000);
-+        }
-+
-+      ((Elf64_Rela *) data_scn->d.d_buf)[ndx] = value;
-     }
- 
-   result = 1;
-Index: elfutils-0.164/src/strip.c
-===================================================================
---- elfutils-0.164.orig/src/strip.c
-+++ elfutils-0.164/src/strip.c
-@@ -546,6 +546,23 @@ handle_elf (int fd, Elf *elf, const char
-       goto fail;
-     }
- 
-+  /* Copy identity part of the ELF header now */
-+  newehdr = gelf_getehdr (newelf, &newehdr_mem);
-+  if (newehdr == NULL)
-+    INTERNAL_ERROR (fname);
-+
-+  memcpy (newehdr->e_ident, ehdr->e_ident, EI_NIDENT);
-+  newehdr->e_type = ehdr->e_type;
-+  newehdr->e_machine = ehdr->e_machine;
-+  newehdr->e_version = ehdr->e_version;
-+
-+  if (gelf_update_ehdr (newelf, newehdr) == 0)
-+    {
-+      error (0, 0, gettext ("%s: error while creating ELF header: %s"),
-+	     fname, elf_errmsg (-1));
-+      return 1;
-+    }
-+
-   /* Copy over the old program header if needed.  */
-   if (ehdr->e_type != ET_REL)
-     for (cnt = 0; cnt < phnum; ++cnt)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch
deleted file mode 100644
index 25f5e14..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 8e2ab18b874d1fda06243ad00209d44e2992928a Mon Sep 17 00:00:00 2001
-From: Mark Wielaard <mark@klomp.org>
-Date: Sun, 12 Feb 2017 21:51:34 +0100
-Subject: [PATCH 1/2] libasm: Fix one GCC7 -Wformat-truncation=2 warning.
-
-Make sure that if we have really lots of labels the tempsym doesn't get
-truncated because it is too small to hold the whole name.
-
-This doesn't enable -Wformat-truncation=2 or fix other "issues" pointed
-out by enabling this warning because there are currently some issues
-with it. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79448
-
-Signed-off-by: Mark Wielaard <mark@klomp.org>
-
-Upstream-Status: Backport (https://sourceware.org/git/?p=elfutils.git;a=commit;h=93c51144c3f664d4e9709da75a1d0fa00ea0fe95)
-Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
----
- libasm/asm_newsym.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/libasm/asm_newsym.c b/libasm/asm_newsym.c
-index 7f522910..76482bb2 100644
---- a/libasm/asm_newsym.c
-+++ b/libasm/asm_newsym.c
-@@ -1,5 +1,5 @@
- /* Define new symbol for current position in given section.
--   Copyright (C) 2002, 2005 Red Hat, Inc.
-+   Copyright (C) 2002, 2005, 2017 Red Hat, Inc.
-    This file is part of elfutils.
-    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
- 
-@@ -44,7 +44,9 @@ AsmSym_t *
- asm_newsym (AsmScn_t *asmscn, const char *name, GElf_Xword size,
- 	    int type, int binding)
- {
--#define TEMPSYMLEN 10
-+/* We don't really expect labels with many digits, but in theory it could
-+   be 10 digits (plus ".L" and a zero terminator).  */
-+#define TEMPSYMLEN 13
-   char tempsym[TEMPSYMLEN];
-   AsmSym_t *result;
- 
--- 
-2.13.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/arm_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/arm_backend.diff
deleted file mode 100644
index 9d47f95..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/arm_backend.diff
+++ /dev/null
@@ -1,600 +0,0 @@
-Index: elfutils-0.164/backends/arm_init.c
-===================================================================
---- elfutils-0.164.orig/backends/arm_init.c
-+++ elfutils-0.164/backends/arm_init.c
-@@ -35,20 +35,31 @@
- #define RELOC_PREFIX	R_ARM_
- #include "libebl_CPU.h"
- 
-+#include "libebl_arm.h"
-+
- /* This defines the common reloc hooks based on arm_reloc.def.  */
- #include "common-reloc.c"
- 
- 
- const char *
--arm_init (Elf *elf __attribute__ ((unused)),
-+arm_init (Elf *elf,
- 	  GElf_Half machine __attribute__ ((unused)),
- 	  Ebl *eh,
- 	  size_t ehlen)
- {
-+  int soft_float = 0;
-+
-   /* Check whether the Elf_BH object has a sufficent size.  */
-   if (ehlen < sizeof (Ebl))
-     return NULL;
- 
-+  if (elf) {
-+    GElf_Ehdr ehdr_mem;
-+    GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
-+    if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT))
-+      soft_float = 1;
-+  }
-+
-   /* We handle it.  */
-   eh->name = "ARM";
-   arm_init_reloc (eh);
-@@ -60,7 +71,10 @@ arm_init (Elf *elf __attribute__ ((unuse
-   HOOK (eh, core_note);
-   HOOK (eh, auxv_info);
-   HOOK (eh, check_object_attribute);
--  HOOK (eh, return_value_location);
-+  if (soft_float)
-+    eh->return_value_location = arm_return_value_location_soft;
-+  else
-+    eh->return_value_location = arm_return_value_location_hard;
-   HOOK (eh, abi_cfi);
-   HOOK (eh, check_reloc_target_type);
-   HOOK (eh, symbol_type_name);
-Index: elfutils-0.164/backends/arm_regs.c
-===================================================================
---- elfutils-0.164.orig/backends/arm_regs.c
-+++ elfutils-0.164/backends/arm_regs.c
-@@ -31,6 +31,7 @@
- #endif
- 
- #include <string.h>
-+#include <stdio.h>
- #include <dwarf.h>
- 
- #define BACKEND arm_
-@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute_
-       break;
- 
-     case 16 + 0 ... 16 + 7:
-+      /* AADWARF says that there are no registers in that range,
-+       * but gcc maps FPA registers here
-+       */
-       regno += 96 - 16;
-       /* Fall through.  */
-     case 96 + 0 ... 96 + 7:
-@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute_
-       namelen = 2;
-       break;
- 
-+    case 64 + 0 ... 64 + 9:
-+      *setname = "VFP";
-+      *bits = 32;
-+      *type = DW_ATE_float;
-+      name[0] = 's';
-+      name[1] = regno - 64 + '0';
-+      namelen = 2;
-+      break;
-+
-+    case 64 + 10 ... 64 + 31:
-+      *setname = "VFP";
-+      *bits = 32;
-+      *type = DW_ATE_float;
-+      name[0] = 's';
-+      name[1] = (regno - 64) / 10 + '0';
-+      name[2] = (regno - 64) % 10 + '0';
-+      namelen = 3;
-+      break;
-+
-+    case 104 + 0 ... 104 + 7:
-+      /* XXX TODO:
-+       * This can be either intel wireless MMX general purpose/control
-+       * registers or xscale accumulator, which have different usage.
-+       * We only have the intel wireless MMX here now.
-+       * The name needs to be changed for the xscale accumulator too. */
-+      *setname = "MMX";
-+      *type = DW_ATE_unsigned;
-+      *bits = 32;
-+      memcpy(name, "wcgr", 4);
-+      name[4] = regno - 104 + '0';
-+      namelen = 5;
-+      break;
-+
-+    case 112 + 0 ... 112 + 9:
-+      *setname = "MMX";
-+      *type = DW_ATE_unsigned;
-+      *bits = 64;
-+      name[0] = 'w';
-+      name[1] = 'r';
-+      name[2] = regno - 112 + '0';
-+      namelen = 3;
-+      break;
-+
-+    case 112 + 10 ... 112 + 15:
-+      *setname = "MMX";
-+      *type = DW_ATE_unsigned;
-+      *bits = 64;
-+      name[0] = 'w';
-+      name[1] = 'r';
-+      name[2] = '1';
-+      name[3] = regno - 112 - 10 + '0';
-+      namelen = 4;
-+      break;
-+
-     case 128:
-+      *setname = "state";
-       *type = DW_ATE_unsigned;
-       return stpcpy (name, "spsr") + 1 - name;
- 
-+    case 129:
-+      *setname = "state";
-+      *type = DW_ATE_unsigned;
-+      return stpcpy(name, "spsr_fiq") + 1 - name;
-+
-+    case 130:
-+      *setname = "state";
-+      *type = DW_ATE_unsigned;
-+      return stpcpy(name, "spsr_irq") + 1 - name;
-+
-+    case 131:
-+      *setname = "state";
-+      *type = DW_ATE_unsigned;
-+      return stpcpy(name, "spsr_abt") + 1 - name;
-+
-+    case 132:
-+      *setname = "state";
-+      *type = DW_ATE_unsigned;
-+      return stpcpy(name, "spsr_und") + 1 - name;
-+
-+    case 133:
-+      *setname = "state";
-+      *type = DW_ATE_unsigned;
-+      return stpcpy(name, "spsr_svc") + 1 - name;
-+
-+    case 144 ... 150:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_usr", regno - 144 + 8) + 1;
-+
-+    case 151 ... 157:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1;
-+
-+    case 158 ... 159:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_irq", regno - 158 + 13) + 1;
-+
-+    case 160 ... 161:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_abt", regno - 160 + 13) + 1;
-+
-+    case 162 ... 163:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_und", regno - 162 + 13) + 1;
-+
-+    case 164 ... 165:
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      return sprintf(name, "r%d_svc", regno - 164 + 13) + 1;
-+
-+    case 192 ... 199:
-+     *setname = "MMX";
-+      *bits = 32;
-+      *type = DW_ATE_unsigned;
-+      name[0] = 'w';
-+      name[1] = 'c';
-+      name[2] = regno - 192 + '0';
-+      namelen = 3;
-+      break;
-+
-     case 256 + 0 ... 256 + 9:
-+      /* XXX TODO: Neon also uses those registers and can contain
-+       * both float and integers */
-       *setname = "VFP";
-       *type = DW_ATE_float;
-       *bits = 64;
-Index: elfutils-0.164/backends/arm_retval.c
-===================================================================
---- elfutils-0.164.orig/backends/arm_retval.c
-+++ elfutils-0.164/backends/arm_retval.c
-@@ -48,6 +48,13 @@ static const Dwarf_Op loc_intreg[] =
- #define nloc_intreg	1
- #define nloc_intregs(n)	(2 * (n))
- 
-+/* f1  */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */
-+static const Dwarf_Op loc_fpreg[] =
-+  {
-+    { .atom = DW_OP_reg16 },
-+  };
-+#define nloc_fpreg  1
-+
- /* The return value is a structure and is actually stored in stack space
-    passed in a hidden argument by the caller.  But, the compiler
-    helpfully returns the address of that space in r0.  */
-@@ -58,8 +65,9 @@ static const Dwarf_Op loc_aggregate[] =
- #define nloc_aggregate 1
- 
- 
--int
--arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+static int
-+arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp,
-+		            int soft_float)
- {
-   /* Start with the function's type, and get the DW_AT_type attribute,
-      which is the type of the return value.  */
-@@ -98,6 +106,21 @@ arm_return_value_location (Dwarf_Die *fu
- 	    else
- 	      return -1;
- 	  }
-+	if (tag == DW_TAG_base_type)
-+	  {
-+	    Dwarf_Word encoding;
-+	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
-+				 &attr_mem), &encoding) != 0)
-+	      return -1;
-+
-+	    if ((encoding == DW_ATE_float) && !soft_float)
-+	      {
-+		*locp = loc_fpreg;
-+		if (size <= 8)
-+		  return nloc_fpreg;
-+		goto aggregate;
-+	      }
-+	  }
- 	if (size <= 16)
- 	  {
- 	  intreg:
-@@ -106,6 +129,7 @@ arm_return_value_location (Dwarf_Die *fu
- 	  }
- 
-       aggregate:
-+	/* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */
- 	*locp = loc_aggregate;
- 	return nloc_aggregate;
-       }
-@@ -125,3 +149,18 @@ arm_return_value_location (Dwarf_Die *fu
-      DWARF and might be valid.  */
-   return -2;
- }
-+
-+/* return location for -mabi=apcs-gnu -msoft-float */
-+int
-+arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+   return arm_return_value_location_ (functypedie, locp, 1);
-+}
-+
-+/* return location for -mabi=apcs-gnu -mhard-float (current default) */
-+int
-+arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+   return arm_return_value_location_ (functypedie, locp, 0);
-+}
-+
-Index: elfutils-0.164/libelf/elf.h
-===================================================================
---- elfutils-0.164.orig/libelf/elf.h
-+++ elfutils-0.164/libelf/elf.h
-@@ -2450,6 +2450,9 @@ enum
- #define EF_ARM_EABI_VER4	0x04000000
- #define EF_ARM_EABI_VER5	0x05000000
- 
-+/* EI_OSABI values */
-+#define ELFOSABI_ARM_AEABI    64      /* Contains symbol versioning. */
-+
- /* Additional symbol types for Thumb.  */
- #define STT_ARM_TFUNC		STT_LOPROC /* A Thumb function.  */
- #define STT_ARM_16BIT		STT_HIPROC /* A Thumb label.  */
-@@ -2467,12 +2470,19 @@ enum
- 
- /* Processor specific values for the Phdr p_type field.  */
- #define PT_ARM_EXIDX		(PT_LOPROC + 1)	/* ARM unwind segment.  */
-+#define PT_ARM_UNWIND		PT_ARM_EXIDX
- 
- /* Processor specific values for the Shdr sh_type field.  */
- #define SHT_ARM_EXIDX		(SHT_LOPROC + 1) /* ARM unwind section.  */
- #define SHT_ARM_PREEMPTMAP	(SHT_LOPROC + 2) /* Preemption details.  */
- #define SHT_ARM_ATTRIBUTES	(SHT_LOPROC + 3) /* ARM attributes section.  */
- 
-+/* Processor specific values for the Dyn d_tag field.  */
-+#define DT_ARM_RESERVED1	(DT_LOPROC + 0)
-+#define DT_ARM_SYMTABSZ		(DT_LOPROC + 1)
-+#define DT_ARM_PREEMTMAB	(DT_LOPROC + 2)
-+#define DT_ARM_RESERVED2	(DT_LOPROC + 3)
-+#define DT_ARM_NUM		4
- 
- /* AArch64 relocs.  */
- 
-@@ -2765,6 +2775,7 @@ enum
- 					   TLS block (LDR, STR).  */
- #define R_ARM_TLS_IE12GP	111	/* 12 bit GOT entry relative
- 					   to GOT origin (LDR).  */
-+/* 112 - 127 private range */
- #define R_ARM_ME_TOO		128	/* Obsolete.  */
- #define R_ARM_THM_TLS_DESCSEQ	129
- #define R_ARM_THM_TLS_DESCSEQ16	129
-Index: elfutils-0.164/backends/libebl_arm.h
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/libebl_arm.h
-@@ -0,0 +1,9 @@
-+#ifndef _LIBEBL_ARM_H
-+#define _LIBEBL_ARM_H 1
-+
-+#include <libdw.h>
-+
-+extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
-+extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
-+
-+#endif
-Index: elfutils-0.164/tests/run-allregs.sh
-===================================================================
---- elfutils-0.164.orig/tests/run-allregs.sh
-+++ elfutils-0.164/tests/run-allregs.sh
-@@ -2672,7 +2672,28 @@ integer registers:
- 	 13: sp (sp), address 32 bits
- 	 14: lr (lr), address 32 bits
- 	 15: pc (pc), address 32 bits
--	128: spsr (spsr), unsigned 32 bits
-+	144: r8_usr (r8_usr), signed 32 bits
-+	145: r9_usr (r9_usr), signed 32 bits
-+	146: r10_usr (r10_usr), signed 32 bits
-+	147: r11_usr (r11_usr), signed 32 bits
-+	148: r12_usr (r12_usr), signed 32 bits
-+	149: r13_usr (r13_usr), signed 32 bits
-+	150: r14_usr (r14_usr), signed 32 bits
-+	151: r8_fiq (r8_fiq), signed 32 bits
-+	152: r9_fiq (r9_fiq), signed 32 bits
-+	153: r10_fiq (r10_fiq), signed 32 bits
-+	154: r11_fiq (r11_fiq), signed 32 bits
-+	155: r12_fiq (r12_fiq), signed 32 bits
-+	156: r13_fiq (r13_fiq), signed 32 bits
-+	157: r14_fiq (r14_fiq), signed 32 bits
-+	158: r13_irq (r13_irq), signed 32 bits
-+	159: r14_irq (r14_irq), signed 32 bits
-+	160: r13_abt (r13_abt), signed 32 bits
-+	161: r14_abt (r14_abt), signed 32 bits
-+	162: r13_und (r13_und), signed 32 bits
-+	163: r14_und (r14_und), signed 32 bits
-+	164: r13_svc (r13_svc), signed 32 bits
-+	165: r14_svc (r14_svc), signed 32 bits
- FPA registers:
- 	 16: f0 (f0), float 96 bits
- 	 17: f1 (f1), float 96 bits
-@@ -2690,7 +2711,72 @@ FPA registers:
- 	101: f5 (f5), float 96 bits
- 	102: f6 (f6), float 96 bits
- 	103: f7 (f7), float 96 bits
-+MMX registers:
-+	104: wcgr0 (wcgr0), unsigned 32 bits
-+	105: wcgr1 (wcgr1), unsigned 32 bits
-+	106: wcgr2 (wcgr2), unsigned 32 bits
-+	107: wcgr3 (wcgr3), unsigned 32 bits
-+	108: wcgr4 (wcgr4), unsigned 32 bits
-+	109: wcgr5 (wcgr5), unsigned 32 bits
-+	110: wcgr6 (wcgr6), unsigned 32 bits
-+	111: wcgr7 (wcgr7), unsigned 32 bits
-+	112: wr0 (wr0), unsigned 64 bits
-+	113: wr1 (wr1), unsigned 64 bits
-+	114: wr2 (wr2), unsigned 64 bits
-+	115: wr3 (wr3), unsigned 64 bits
-+	116: wr4 (wr4), unsigned 64 bits
-+	117: wr5 (wr5), unsigned 64 bits
-+	118: wr6 (wr6), unsigned 64 bits
-+	119: wr7 (wr7), unsigned 64 bits
-+	120: wr8 (wr8), unsigned 64 bits
-+	121: wr9 (wr9), unsigned 64 bits
-+	122: wr10 (wr10), unsigned 64 bits
-+	123: wr11 (wr11), unsigned 64 bits
-+	124: wr12 (wr12), unsigned 64 bits
-+	125: wr13 (wr13), unsigned 64 bits
-+	126: wr14 (wr14), unsigned 64 bits
-+	127: wr15 (wr15), unsigned 64 bits
-+	192: wc0 (wc0), unsigned 32 bits
-+	193: wc1 (wc1), unsigned 32 bits
-+	194: wc2 (wc2), unsigned 32 bits
-+	195: wc3 (wc3), unsigned 32 bits
-+	196: wc4 (wc4), unsigned 32 bits
-+	197: wc5 (wc5), unsigned 32 bits
-+	198: wc6 (wc6), unsigned 32 bits
-+	199: wc7 (wc7), unsigned 32 bits
- VFP registers:
-+	 64: s0 (s0), float 32 bits
-+	 65: s1 (s1), float 32 bits
-+	 66: s2 (s2), float 32 bits
-+	 67: s3 (s3), float 32 bits
-+	 68: s4 (s4), float 32 bits
-+	 69: s5 (s5), float 32 bits
-+	 70: s6 (s6), float 32 bits
-+	 71: s7 (s7), float 32 bits
-+	 72: s8 (s8), float 32 bits
-+	 73: s9 (s9), float 32 bits
-+	 74: s10 (s10), float 32 bits
-+	 75: s11 (s11), float 32 bits
-+	 76: s12 (s12), float 32 bits
-+	 77: s13 (s13), float 32 bits
-+	 78: s14 (s14), float 32 bits
-+	 79: s15 (s15), float 32 bits
-+	 80: s16 (s16), float 32 bits
-+	 81: s17 (s17), float 32 bits
-+	 82: s18 (s18), float 32 bits
-+	 83: s19 (s19), float 32 bits
-+	 84: s20 (s20), float 32 bits
-+	 85: s21 (s21), float 32 bits
-+	 86: s22 (s22), float 32 bits
-+	 87: s23 (s23), float 32 bits
-+	 88: s24 (s24), float 32 bits
-+	 89: s25 (s25), float 32 bits
-+	 90: s26 (s26), float 32 bits
-+	 91: s27 (s27), float 32 bits
-+	 92: s28 (s28), float 32 bits
-+	 93: s29 (s29), float 32 bits
-+	 94: s30 (s30), float 32 bits
-+	 95: s31 (s31), float 32 bits
- 	256: d0 (d0), float 64 bits
- 	257: d1 (d1), float 64 bits
- 	258: d2 (d2), float 64 bits
-@@ -2723,6 +2809,13 @@ VFP registers:
- 	285: d29 (d29), float 64 bits
- 	286: d30 (d30), float 64 bits
- 	287: d31 (d31), float 64 bits
-+state registers:
-+	128: spsr (spsr), unsigned 32 bits
-+	129: spsr_fiq (spsr_fiq), unsigned 32 bits
-+	130: spsr_irq (spsr_irq), unsigned 32 bits
-+	131: spsr_abt (spsr_abt), unsigned 32 bits
-+	132: spsr_und (spsr_und), unsigned 32 bits
-+	133: spsr_svc (spsr_svc), unsigned 32 bits
- EOF
- 
- # See run-readelf-mixed-corenote.sh for instructions to regenerate
-Index: elfutils-0.164/tests/run-readelf-mixed-corenote.sh
-===================================================================
---- elfutils-0.164.orig/tests/run-readelf-mixed-corenote.sh
-+++ elfutils-0.164/tests/run-readelf-mixed-corenote.sh
-@@ -31,12 +31,11 @@ Note segment of 892 bytes at offset 0x27
-     pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
-     utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000
-     orig_r0: -1, fpvalid: 1
--    r0:             1  r1:   -1091672508  r2:   -1091672500
--    r3:             0  r4:             0  r5:             0
--    r6:         33728  r7:             0  r8:             0
--    r9:             0  r10:  -1225703496  r11:  -1091672844
--    r12:            0  sp:    0xbeee64f4  lr:    0xb6dc3f48
--    pc:    0x00008500  spsr:  0x60000010
-+    r0:            1  r1:  -1091672508  r2:  -1091672500  r3:            0
-+    r4:            0  r5:            0  r6:        33728  r7:            0
-+    r8:            0  r9:            0  r10: -1225703496  r11: -1091672844
-+    r12:           0  sp:   0xbeee64f4  lr:   0xb6dc3f48  pc:   0x00008500
-+    spsr:  0x60000010
-   CORE                 124  PRPSINFO
-     state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500
-     uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
-Index: elfutils-0.164/tests/run-addrcfi.sh
-===================================================================
---- elfutils-0.164.orig/tests/run-addrcfi.sh
-+++ elfutils-0.164/tests/run-addrcfi.sh
-@@ -3554,6 +3554,38 @@ dwarf_cfi_addrframe (.eh_frame): no matc
- 	FPA reg21 (f5): undefined
- 	FPA reg22 (f6): undefined
- 	FPA reg23 (f7): undefined
-+	VFP reg64 (s0): undefined
-+	VFP reg65 (s1): undefined
-+	VFP reg66 (s2): undefined
-+	VFP reg67 (s3): undefined
-+	VFP reg68 (s4): undefined
-+	VFP reg69 (s5): undefined
-+	VFP reg70 (s6): undefined
-+	VFP reg71 (s7): undefined
-+	VFP reg72 (s8): undefined
-+	VFP reg73 (s9): undefined
-+	VFP reg74 (s10): undefined
-+	VFP reg75 (s11): undefined
-+	VFP reg76 (s12): undefined
-+	VFP reg77 (s13): undefined
-+	VFP reg78 (s14): undefined
-+	VFP reg79 (s15): undefined
-+	VFP reg80 (s16): undefined
-+	VFP reg81 (s17): undefined
-+	VFP reg82 (s18): undefined
-+	VFP reg83 (s19): undefined
-+	VFP reg84 (s20): undefined
-+	VFP reg85 (s21): undefined
-+	VFP reg86 (s22): undefined
-+	VFP reg87 (s23): undefined
-+	VFP reg88 (s24): undefined
-+	VFP reg89 (s25): undefined
-+	VFP reg90 (s26): undefined
-+	VFP reg91 (s27): undefined
-+	VFP reg92 (s28): undefined
-+	VFP reg93 (s29): undefined
-+	VFP reg94 (s30): undefined
-+	VFP reg95 (s31): undefined
- 	FPA reg96 (f0): undefined
- 	FPA reg97 (f1): undefined
- 	FPA reg98 (f2): undefined
-@@ -3562,7 +3594,66 @@ dwarf_cfi_addrframe (.eh_frame): no matc
- 	FPA reg101 (f5): undefined
- 	FPA reg102 (f6): undefined
- 	FPA reg103 (f7): undefined
--	integer reg128 (spsr): undefined
-+	MMX reg104 (wcgr0): undefined
-+	MMX reg105 (wcgr1): undefined
-+	MMX reg106 (wcgr2): undefined
-+	MMX reg107 (wcgr3): undefined
-+	MMX reg108 (wcgr4): undefined
-+	MMX reg109 (wcgr5): undefined
-+	MMX reg110 (wcgr6): undefined
-+	MMX reg111 (wcgr7): undefined
-+	MMX reg112 (wr0): undefined
-+	MMX reg113 (wr1): undefined
-+	MMX reg114 (wr2): undefined
-+	MMX reg115 (wr3): undefined
-+	MMX reg116 (wr4): undefined
-+	MMX reg117 (wr5): undefined
-+	MMX reg118 (wr6): undefined
-+	MMX reg119 (wr7): undefined
-+	MMX reg120 (wr8): undefined
-+	MMX reg121 (wr9): undefined
-+	MMX reg122 (wr10): undefined
-+	MMX reg123 (wr11): undefined
-+	MMX reg124 (wr12): undefined
-+	MMX reg125 (wr13): undefined
-+	MMX reg126 (wr14): undefined
-+	MMX reg127 (wr15): undefined
-+	state reg128 (spsr): undefined
-+	state reg129 (spsr_fiq): undefined
-+	state reg130 (spsr_irq): undefined
-+	state reg131 (spsr_abt): undefined
-+	state reg132 (spsr_und): undefined
-+	state reg133 (spsr_svc): undefined
-+	integer reg144 (r8_usr): undefined
-+	integer reg145 (r9_usr): undefined
-+	integer reg146 (r10_usr): undefined
-+	integer reg147 (r11_usr): undefined
-+	integer reg148 (r12_usr): undefined
-+	integer reg149 (r13_usr): undefined
-+	integer reg150 (r14_usr): undefined
-+	integer reg151 (r8_fiq): undefined
-+	integer reg152 (r9_fiq): undefined
-+	integer reg153 (r10_fiq): undefined
-+	integer reg154 (r11_fiq): undefined
-+	integer reg155 (r12_fiq): undefined
-+	integer reg156 (r13_fiq): undefined
-+	integer reg157 (r14_fiq): undefined
-+	integer reg158 (r13_irq): undefined
-+	integer reg159 (r14_irq): undefined
-+	integer reg160 (r13_abt): undefined
-+	integer reg161 (r14_abt): undefined
-+	integer reg162 (r13_und): undefined
-+	integer reg163 (r14_und): undefined
-+	integer reg164 (r13_svc): undefined
-+	integer reg165 (r14_svc): undefined
-+	MMX reg192 (wc0): undefined
-+	MMX reg193 (wc1): undefined
-+	MMX reg194 (wc2): undefined
-+	MMX reg195 (wc3): undefined
-+	MMX reg196 (wc4): undefined
-+	MMX reg197 (wc5): undefined
-+	MMX reg198 (wc6): undefined
-+	MMX reg199 (wc7): undefined
- 	VFP reg256 (d0): undefined
- 	VFP reg257 (d1): undefined
- 	VFP reg258 (d2): undefined
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/elfcmp-fix-self-comparision.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/elfcmp-fix-self-comparision.patch
deleted file mode 100644
index 6c150bb..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/elfcmp-fix-self-comparision.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 836a16fe5b5bab4a3afe2c991c104652775ce3a3 Mon Sep 17 00:00:00 2001
-From: David Abdurachmanov <davidlt@cern.ch>
-Date: Mon, 11 Apr 2016 16:00:57 +0200
-Subject: elfcmp: fix self-comparison error with GCC 6
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Noticed with Fedora 24 Alpha, gcc (GCC) 6.0.0 20160406
-(Red Hat 6.0.0-0.20).
-
-elfcmp.c: In function ‘main’:
-elfcmp.c:364:199: error: self-comparison always evaluates
-to false [-Werror=tautological-compare]
-        if (unlikely (name1 == NULL || name2 == NULL
-
-Signed-off-by: David Abdurachmanov <davidlt@cern.ch>
----
-
-Upstream-Status: Backport
-
- src/ChangeLog | 4 ++++
- src/elfcmp.c  | 2 +-
- 2 files changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/src/elfcmp.c b/src/elfcmp.c
-index 852b92f..7b5d39c 100644
---- a/src/elfcmp.c
-+++ b/src/elfcmp.c
-@@ -368,7 +368,7 @@ main (int argc, char *argv[])
- 				&& sym1->st_shndx != SHN_UNDEF)
- 			    || sym1->st_info != sym2->st_info
- 			    || sym1->st_other != sym2->st_other
--			    || sym1->st_shndx != sym1->st_shndx))
-+			    || sym1->st_shndx != sym2->st_shndx))
- 		{
- 		  // XXX Do we want to allow reordered symbol tables?
- 		symtab_mismatch:
--- 
-cgit v0.12
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/hppa_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/hppa_backend.diff
deleted file mode 100644
index 4545671..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/hppa_backend.diff
+++ /dev/null
@@ -1,799 +0,0 @@
-Index: elfutils-0.164/backends/parisc_init.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/parisc_init.c
-@@ -0,0 +1,73 @@
-+/* Initialization of PA-RISC specific backend library.
-+   Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#define BACKEND		parisc_
-+#define RELOC_PREFIX	R_PARISC_
-+#include "libebl_CPU.h"
-+#include "libebl_parisc.h"
-+
-+/* This defines the common reloc hooks based on parisc_reloc.def.  */
-+#include "common-reloc.c"
-+
-+
-+const char *
-+parisc_init (Elf *elf __attribute__ ((unused)),
-+     GElf_Half machine __attribute__ ((unused)),
-+     Ebl *eh,
-+     size_t ehlen)
-+{
-+  int pa64 = 0;
-+
-+  /* Check whether the Elf_BH object has a sufficent size.  */
-+  if (ehlen < sizeof (Ebl))
-+    return NULL;
-+
-+  if (elf) {
-+    GElf_Ehdr ehdr_mem;
-+    GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
-+    if (ehdr && (ehdr->e_flags & EF_PARISC_WIDE))
-+      pa64 = 1;
-+  }
-+  /* We handle it.  */
-+  eh->name = "PA-RISC";
-+  parisc_init_reloc (eh);
-+  HOOK (eh, reloc_simple_type);
-+  HOOK (eh, machine_flag_check);
-+  HOOK (eh, symbol_type_name);
-+  HOOK (eh, segment_type_name);
-+  HOOK (eh, section_type_name);
-+  HOOK (eh, register_info);
-+  if (pa64)
-+    eh->return_value_location = parisc_return_value_location_64;
-+  else
-+    eh->return_value_location = parisc_return_value_location_32;
-+
-+  return MODVERSION;
-+}
-Index: elfutils-0.164/backends/parisc_regs.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/parisc_regs.c
-@@ -0,0 +1,159 @@
-+/* Register names and numbers for PA-RISC DWARF.
-+   Copyright (C) 2005, 2006 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <string.h>
-+#include <dwarf.h>
-+
-+#define BACKEND parisc_
-+#include "libebl_CPU.h"
-+
-+ssize_t
-+parisc_register_info (Ebl *ebl, int regno, char *name, size_t namelen,
-+		     const char **prefix, const char **setname,
-+		     int *bits, int *type)
-+{
-+  int pa64 = 0;
-+
-+  if (ebl->elf) {
-+    GElf_Ehdr ehdr_mem;
-+    GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem);
-+    if (ehdr->e_flags & EF_PARISC_WIDE)
-+      pa64 = 1;
-+  }
-+
-+  int nregs = pa64 ? 127 : 128;
-+
-+  if (name == NULL)
-+    return nregs;
-+
-+  if (regno < 0 || regno >= nregs || namelen < 6)
-+    return -1;
-+
-+  *prefix = "%";
-+
-+  if (regno < 32)
-+  {
-+    *setname = "integer";
-+    *type = DW_ATE_signed;
-+    if (pa64)
-+    {
-+	*bits = 64;
-+    }
-+    else
-+    {
-+    	*bits = 32;
-+    }
-+  }
-+  else if (regno == 32)
-+  {
-+    *setname = "special";
-+    if (pa64)
-+    {
-+	*bits = 6;
-+    }
-+    else
-+    {
-+    	*bits = 5;
-+    }
-+    *type = DW_ATE_unsigned;
-+  }
-+  else
-+  {
-+    *setname = "FPU";
-+    *type = DW_ATE_float;
-+    if (pa64)
-+    {
-+	*bits = 64;
-+    }
-+    else
-+    {
-+    	*bits = 32;
-+    }
-+  }
-+
-+  if (regno < 33) {
-+    switch (regno)
-+      {
-+      case 0 ... 9:
-+        name[0] = 'r';
-+        name[1] = regno + '0';
-+        namelen = 2;
-+        break;
-+      case 10 ... 31:
-+        name[0] = 'r';
-+        name[1] = regno / 10 + '0';
-+        name[2] = regno % 10 + '0';
-+        namelen = 3;
-+        break;
-+      case 32:
-+	*prefix = NULL;
-+	name[0] = 'S';
-+	name[1] = 'A';
-+	name[2] = 'R';
-+	namelen = 3;
-+	break;
-+      }
-+  }
-+  else {
-+    if (pa64 && ((regno - 72) % 2)) {
-+      *setname = NULL;
-+      return 0;
-+    }
-+
-+    switch (regno)
-+      {
-+      case 72 + 0 ... 72 + 11:
-+        name[0] = 'f';
-+	name[1] = 'r';
-+        name[2] = (regno + 8 - 72) / 2 + '0';
-+        namelen = 3;
-+        if ((regno + 8 - 72) % 2) {
-+	  name[3] = 'R';
-+	  namelen++;
-+        }
-+        break;
-+      case 72 + 12 ... 72 + 55:
-+        name[0] = 'f';
-+	name[1] = 'r';
-+        name[2] = (regno + 8 - 72) / 2 / 10 + '0';
-+        name[3] = (regno + 8 - 72) / 2 % 10 + '0';
-+        namelen = 4;
-+        if ((regno + 8 - 72) % 2) {
-+	  name[4] = 'R';
-+	  namelen++;
-+        }
-+        break;
-+      default:
-+        *setname = NULL;
-+        return 0;
-+      }
-+  }
-+  name[namelen++] = '\0';
-+  return namelen;
-+}
-Index: elfutils-0.164/backends/parisc_reloc.def
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/parisc_reloc.def
-@@ -0,0 +1,128 @@
-+/* List the relocation types for PA-RISC.  -*- C -*-
-+   Copyright (C) 2005 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+/*	    NAME,		REL|EXEC|DYN	*/
-+
-+RELOC_TYPE (NONE,		EXEC|DYN)
-+RELOC_TYPE (DIR32,		REL|EXEC|DYN)
-+RELOC_TYPE (DIR21L,		REL|EXEC|DYN)
-+RELOC_TYPE (DIR17R,		REL)
-+RELOC_TYPE (DIR17F,		REL)
-+RELOC_TYPE (DIR14R,		REL|DYN)
-+RELOC_TYPE (PCREL32,		REL)
-+RELOC_TYPE (PCREL21L,		REL)
-+RELOC_TYPE (PCREL17R,		REL)
-+RELOC_TYPE (PCREL17F,		REL)
-+RELOC_TYPE (PCREL14R,		REL|EXEC)
-+RELOC_TYPE (DPREL21L,		REL)
-+RELOC_TYPE (DPREL14WR,		REL)
-+RELOC_TYPE (DPREL14DR,          REL)
-+RELOC_TYPE (DPREL14R,		REL)
-+RELOC_TYPE (GPREL21L,		0)
-+RELOC_TYPE (GPREL14R,		0)
-+RELOC_TYPE (LTOFF21L,		REL)
-+RELOC_TYPE (LTOFF14R,		REL)
-+RELOC_TYPE (DLTIND14F,		0)
-+RELOC_TYPE (SETBASE,		0)
-+RELOC_TYPE (SECREL32,		REL)
-+RELOC_TYPE (BASEREL21L,		0)
-+RELOC_TYPE (BASEREL17R,		0)
-+RELOC_TYPE (BASEREL14R,		0)
-+RELOC_TYPE (SEGBASE,		0)
-+RELOC_TYPE (SEGREL32,		REL)
-+RELOC_TYPE (PLTOFF21L,		0)
-+RELOC_TYPE (PLTOFF14R,		0)
-+RELOC_TYPE (PLTOFF14F,		0)
-+RELOC_TYPE (LTOFF_FPTR32,	0)
-+RELOC_TYPE (LTOFF_FPTR21L,	0)
-+RELOC_TYPE (LTOFF_FPTR14R,	0)
-+RELOC_TYPE (FPTR64,		0)
-+RELOC_TYPE (PLABEL32,		REL|DYN)
-+RELOC_TYPE (PCREL64,		0)
-+RELOC_TYPE (PCREL22C,		0)
-+RELOC_TYPE (PCREL22F,		0)
-+RELOC_TYPE (PCREL14WR,		0)
-+RELOC_TYPE (PCREL14DR,		0)
-+RELOC_TYPE (PCREL16F,		0)
-+RELOC_TYPE (PCREL16WF,		0)
-+RELOC_TYPE (PCREL16DF,		0)
-+RELOC_TYPE (DIR64,		REL|DYN)
-+RELOC_TYPE (DIR14WR,		REL)
-+RELOC_TYPE (DIR14DR,		REL)
-+RELOC_TYPE (DIR16F,		REL)
-+RELOC_TYPE (DIR16WF,		REL)
-+RELOC_TYPE (DIR16DF,		REL)
-+RELOC_TYPE (GPREL64,		0)
-+RELOC_TYPE (GPREL14WR,		0)
-+RELOC_TYPE (GPREL14DR,		0)
-+RELOC_TYPE (GPREL16F,		0)
-+RELOC_TYPE (GPREL16WF,		0)
-+RELOC_TYPE (GPREL16DF,		0)
-+RELOC_TYPE (LTOFF64,		0)
-+RELOC_TYPE (LTOFF14WR,		0)
-+RELOC_TYPE (LTOFF14DR,		0)
-+RELOC_TYPE (LTOFF16F,		0)
-+RELOC_TYPE (LTOFF16WF,		0)
-+RELOC_TYPE (LTOFF16DF,		0)
-+RELOC_TYPE (SECREL64,		0)
-+RELOC_TYPE (BASEREL14WR,	0)
-+RELOC_TYPE (BASEREL14DR,	0)
-+RELOC_TYPE (SEGREL64,		0)
-+RELOC_TYPE (PLTOFF14WR,		0)
-+RELOC_TYPE (PLTOFF14DR,		0)
-+RELOC_TYPE (PLTOFF16F,		0)
-+RELOC_TYPE (PLTOFF16WF,		0)
-+RELOC_TYPE (PLTOFF16DF,		0)
-+RELOC_TYPE (LTOFF_FPTR64,	0)
-+RELOC_TYPE (LTOFF_FPTR14WR,	0)
-+RELOC_TYPE (LTOFF_FPTR14DR,	0)
-+RELOC_TYPE (LTOFF_FPTR16F,	0)
-+RELOC_TYPE (LTOFF_FPTR16WF,	0)
-+RELOC_TYPE (LTOFF_FPTR16DF,	0)
-+RELOC_TYPE (COPY,		EXEC)
-+RELOC_TYPE (IPLT,		EXEC|DYN)
-+RELOC_TYPE (EPLT,		0)
-+RELOC_TYPE (TPREL32,		DYN)
-+RELOC_TYPE (TPREL21L,		0)
-+RELOC_TYPE (TPREL14R,		0)
-+RELOC_TYPE (LTOFF_TP21L,	0)
-+RELOC_TYPE (LTOFF_TP14R,	0)
-+RELOC_TYPE (LTOFF_TP14F,	0)
-+RELOC_TYPE (TPREL64,		0)
-+RELOC_TYPE (TPREL14WR,		0)
-+RELOC_TYPE (TPREL14DR,		0)
-+RELOC_TYPE (TPREL16F,		0)
-+RELOC_TYPE (TPREL16WF,		0)
-+RELOC_TYPE (TPREL16DF,		0)
-+RELOC_TYPE (LTOFF_TP64,		0)
-+RELOC_TYPE (LTOFF_TP14WR,	0)
-+RELOC_TYPE (LTOFF_TP14DR,	0)
-+RELOC_TYPE (LTOFF_TP16F,	0)
-+RELOC_TYPE (LTOFF_TP16WF,	0)
-+RELOC_TYPE (LTOFF_TP16DF,	0)
-+RELOC_TYPE (TLS_DTPMOD32,	DYN)
-+RELOC_TYPE (TLS_DTPMOD64,	DYN)
-+
-+#define NO_RELATIVE_RELOC       1
-Index: elfutils-0.164/backends/parisc_retval.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/parisc_retval.c
-@@ -0,0 +1,213 @@
-+/* Function return value location for Linux/PA-RISC ABI.
-+   Copyright (C) 2005 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <assert.h>
-+#include <dwarf.h>
-+
-+#define BACKEND parisc_
-+#include "libebl_CPU.h"
-+#include "libebl_parisc.h"
-+
-+/* %r28, or pair %r28, %r29.  */
-+static const Dwarf_Op loc_intreg32[] =
-+  {
-+    { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 4 },
-+  };
-+
-+static const Dwarf_Op loc_intreg[] =
-+  {
-+    { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 8 },
-+    { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 8 },
-+  };
-+#define nloc_intreg	1
-+#define nloc_intregpair	4
-+
-+/* %fr4L, or pair %fr4L, %fr4R on pa-32 */
-+static const Dwarf_Op loc_fpreg32[] =
-+  {
-+    { .atom = DW_OP_regx, .number = 72 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_regx, .number = 73 }, { .atom = DW_OP_piece, .number = 4 },
-+  };
-+#define nloc_fpreg32 2
-+#define nloc_fpregpair32 4
-+
-+/* $fr4 */
-+static const Dwarf_Op loc_fpreg[] =
-+  {
-+    { .atom = DW_OP_regx, .number = 72 },
-+  };
-+#define nloc_fpreg  1
-+
-+#if 0
-+/* The return value is a structure and is actually stored in stack space
-+   passed in a hidden argument by the caller. Address of the location is stored
-+   in %r28 before function call, but it may be changed by function. */
-+static const Dwarf_Op loc_aggregate[] =
-+  {
-+    { .atom = DW_OP_breg28 },
-+  };
-+#define nloc_aggregate 1
-+#endif
-+
-+static int
-+parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, int pa64)
-+{
-+  Dwarf_Word regsize = pa64 ? 8 : 4;
-+
-+  /* Start with the function's type, and get the DW_AT_type attribute,
-+     which is the type of the return value.  */
-+
-+  Dwarf_Attribute attr_mem;
-+  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
-+  if (attr == NULL)
-+    /* The function has no return value, like a `void' function in C.  */
-+    return 0;
-+
-+  Dwarf_Die die_mem;
-+  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
-+  int tag = dwarf_tag (typedie);
-+
-+  /* Follow typedefs and qualifiers to get to the actual type.  */
-+  while (tag == DW_TAG_typedef
-+	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
-+	 || tag == DW_TAG_restrict_type)
-+    {
-+      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
-+      typedie = dwarf_formref_die (attr, &die_mem);
-+      tag = dwarf_tag (typedie);
-+    }
-+
-+  switch (tag)
-+    {
-+    case -1:
-+      return -1;
-+
-+    case DW_TAG_subrange_type:
-+      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
-+	{
-+	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
-+	  typedie = dwarf_formref_die (attr, &die_mem);
-+	  tag = dwarf_tag (typedie);
-+	}
-+      /* Fall through.  */
-+
-+    case DW_TAG_base_type:
-+    case DW_TAG_enumeration_type:
-+    case DW_TAG_pointer_type:
-+    case DW_TAG_ptr_to_member_type:
-+      {
-+        Dwarf_Word size;
-+	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
-+					 &attr_mem), &size) != 0)
-+	  {
-+	    if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
-+	      size = 4;
-+	    else
-+	      return -1;
-+	  }
-+	if (tag == DW_TAG_base_type)
-+	  {
-+	    Dwarf_Word encoding;
-+	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
-+					     &attr_mem), &encoding) != 0)
-+	      return -1;
-+
-+	    if (encoding == DW_ATE_float)
-+	      {
-+		if (pa64) {
-+		  *locp = loc_fpreg;
-+		  if (size <= 8)
-+		      return nloc_fpreg;
-+		}
-+		else {
-+		  *locp = loc_fpreg32;
-+		  if (size <= 4)
-+		    return nloc_fpreg32;
-+		  else if (size <= 8)
-+		    return nloc_fpregpair32;
-+		}
-+		goto aggregate;
-+	      }
-+	  }
-+	if (pa64)
-+	  *locp = loc_intreg;
-+	else
-+	  *locp = loc_intreg32;
-+	if (size <= regsize)
-+	  return nloc_intreg;
-+	if (size <= 2 * regsize)
-+	  return nloc_intregpair;
-+
-+	/* Else fall through.  */
-+      }
-+
-+    case DW_TAG_structure_type:
-+    case DW_TAG_class_type:
-+    case DW_TAG_union_type:
-+    case DW_TAG_array_type:
-+    aggregate: {
-+        Dwarf_Word size;
-+	if (dwarf_aggregate_size (typedie, &size) != 0)
-+	  return -1;
-+	if (pa64)
-+          *locp = loc_intreg;
-+	else
-+	  *locp = loc_intreg32;
-+        if (size <= regsize)
-+	  return nloc_intreg;
-+        if (size <= 2 * regsize)
-+	  return nloc_intregpair;
-+#if 0
-+	/* there should be some way to know this location... But I do not see it. */
-+        *locp = loc_aggregate;
-+        return nloc_aggregate;
-+#endif
-+	/* fall through.  */
-+      }
-+    }
-+
-+  /* XXX We don't have a good way to return specific errors from ebl calls.
-+     This value means we do not understand the type, but it is well-formed
-+     DWARF and might be valid.  */
-+  return -2;
-+}
-+
-+int
-+parisc_return_value_location_32 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+  return parisc_return_value_location_ (functypedie, locp, 0);
-+}
-+
-+int
-+parisc_return_value_location_64 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+  return parisc_return_value_location_ (functypedie, locp, 1);
-+}
-+
-Index: elfutils-0.164/backends/parisc_symbol.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/parisc_symbol.c
-@@ -0,0 +1,112 @@
-+/* PA-RISC specific symbolic name handling.
-+   Copyright (C) 2002, 2005 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <elf.h>
-+#include <stddef.h>
-+
-+#define BACKEND		parisc_
-+#include "libebl_CPU.h"
-+
-+const char *
-+parisc_segment_type_name (int segment, char *buf __attribute__ ((unused)),
-+			size_t len __attribute__ ((unused)))
-+{
-+  switch (segment)
-+    {
-+    case PT_PARISC_ARCHEXT:
-+      return "PARISC_ARCHEXT";
-+    case PT_PARISC_UNWIND:
-+      return "PARISC_UNWIND";
-+    default:
-+      break;
-+    }
-+  return NULL;
-+}
-+
-+/* Return symbolic representation of symbol type.  */
-+const char *
-+parisc_symbol_type_name(int symbol, char *buf __attribute__ ((unused)),
-+    size_t len __attribute__ ((unused)))
-+{
-+	if (symbol == STT_PARISC_MILLICODE)
-+	  return "PARISC_MILLI";
-+	return NULL;
-+}
-+
-+/* Return symbolic representation of section type.  */
-+const char *
-+parisc_section_type_name (int type,
-+			char *buf __attribute__ ((unused)),
-+			size_t len __attribute__ ((unused)))
-+{
-+  switch (type)
-+    {
-+    case SHT_PARISC_EXT:
-+      return "PARISC_EXT";
-+    case SHT_PARISC_UNWIND:
-+      return "PARISC_UNWIND";
-+    case SHT_PARISC_DOC:
-+      return "PARISC_DOC";
-+    }
-+
-+  return NULL;
-+}
-+
-+/* Check whether machine flags are valid.  */
-+bool
-+parisc_machine_flag_check (GElf_Word flags)
-+{
-+  if (flags &~ (EF_PARISC_TRAPNIL | EF_PARISC_EXT | EF_PARISC_LSB |
-+	EF_PARISC_WIDE | EF_PARISC_NO_KABP |
-+	EF_PARISC_LAZYSWAP | EF_PARISC_ARCH))
-+    return 0;
-+
-+  GElf_Word arch = flags & EF_PARISC_ARCH;
-+
-+  return ((arch == EFA_PARISC_1_0) || (arch == EFA_PARISC_1_1) ||
-+      (arch == EFA_PARISC_2_0));
-+}
-+
-+/* Check for the simple reloc types.  */
-+Elf_Type
-+parisc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
-+{
-+  switch (type)
-+    {
-+    case R_PARISC_DIR64:
-+    case R_PARISC_SECREL64:
-+      return ELF_T_XWORD;
-+    case R_PARISC_DIR32:
-+    case R_PARISC_SECREL32:
-+      return ELF_T_WORD;
-+    default:
-+      return ELF_T_NUM;
-+    }
-+}
-Index: elfutils-0.164/backends/libebl_parisc.h
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/libebl_parisc.h
-@@ -0,0 +1,9 @@
-+#ifndef _LIBEBL_HPPA_H
-+#define _LIBEBL_HPPA_H 1
-+
-+#include <libdw.h>
-+
-+extern int parisc_return_value_location_32(Dwarf_Die *, const Dwarf_Op **locp);
-+extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp);
-+
-+#endif
-Index: elfutils-0.164/backends/Makefile.am
-===================================================================
---- elfutils-0.164.orig/backends/Makefile.am
-+++ elfutils-0.164/backends/Makefile.am
-@@ -33,11 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
- 
- 
- modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
--	  tilegx
-+	  tilegx parisc
- libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a    \
- 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a    \
- 	     libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
--	     libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a
-+	     libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
-+	     libebl_parisc_pic.a
- noinst_LIBRARIES = $(libebl_pic)
- noinst_DATA = $(libebl_pic:_pic.a=.so)
- 
-@@ -111,6 +112,9 @@ tilegx_SRCS = tilegx_init.c tilegx_symbo
- libebl_tilegx_pic_a_SOURCES = $(tilegx_SRCS)
- am_libebl_tilegx_pic_a_OBJECTS = $(tilegx_SRCS:.c=.os)
- 
-+parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
-+libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
-+am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
- 
- libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
- 	@rm -f $(@:.so=.map)
-Index: elfutils-0.164/libelf/elf.h
-===================================================================
---- elfutils-0.164.orig/libelf/elf.h
-+++ elfutils-0.164/libelf/elf.h
-@@ -1912,16 +1912,24 @@ enum
- #define R_PARISC_PCREL17F	12	/* 17 bits of rel. address.  */
- #define R_PARISC_PCREL14R	14	/* Right 14 bits of rel. address.  */
- #define R_PARISC_DPREL21L	18	/* Left 21 bits of rel. address.  */
-+#define R_PARISC_DPREL14WR	19
-+#define R_PARISC_DPREL14DR	20
- #define R_PARISC_DPREL14R	22	/* Right 14 bits of rel. address.  */
- #define R_PARISC_GPREL21L	26	/* GP-relative, left 21 bits.  */
- #define R_PARISC_GPREL14R	30	/* GP-relative, right 14 bits.  */
- #define R_PARISC_LTOFF21L	34	/* LT-relative, left 21 bits.  */
- #define R_PARISC_LTOFF14R	38	/* LT-relative, right 14 bits.  */
-+#define R_PARISC_DLTIND14F	39
-+#define R_PARISC_SETBASE	40
- #define R_PARISC_SECREL32	41	/* 32 bits section rel. address.  */
-+#define R_PARISC_BASEREL21L	42
-+#define R_PARISC_BASEREL17R	43
-+#define R_PARISC_BASEREL14R	46
- #define R_PARISC_SEGBASE	48	/* No relocation, set segment base.  */
- #define R_PARISC_SEGREL32	49	/* 32 bits segment rel. address.  */
- #define R_PARISC_PLTOFF21L	50	/* PLT rel. address, left 21 bits.  */
- #define R_PARISC_PLTOFF14R	54	/* PLT rel. address, right 14 bits.  */
-+#define R_PARISC_PLTOFF14F	55
- #define R_PARISC_LTOFF_FPTR32	57	/* 32 bits LT-rel. function pointer. */
- #define R_PARISC_LTOFF_FPTR21L	58	/* LT-rel. fct ptr, left 21 bits. */
- #define R_PARISC_LTOFF_FPTR14R	62	/* LT-rel. fct ptr, right 14 bits. */
-@@ -1930,6 +1938,7 @@ enum
- #define R_PARISC_PLABEL21L	66	/* Left 21 bits of fdesc address.  */
- #define R_PARISC_PLABEL14R	70	/* Right 14 bits of fdesc address.  */
- #define R_PARISC_PCREL64	72	/* 64 bits PC-rel. address.  */
-+#define R_PARISC_PCREL22C	73
- #define R_PARISC_PCREL22F	74	/* 22 bits PC-rel. address.  */
- #define R_PARISC_PCREL14WR	75	/* PC-rel. address, right 14 bits.  */
- #define R_PARISC_PCREL14DR	76	/* PC rel. address, right 14 bits.  */
-@@ -1955,6 +1964,8 @@ enum
- #define R_PARISC_LTOFF16WF	102	/* 16 bits LT-rel. address.  */
- #define R_PARISC_LTOFF16DF	103	/* 16 bits LT-rel. address.  */
- #define R_PARISC_SECREL64	104	/* 64 bits section rel. address.  */
-+#define R_PARISC_BASEREL14WR	107
-+#define R_PARISC_BASEREL14DR	108
- #define R_PARISC_SEGREL64	112	/* 64 bits segment rel. address.  */
- #define R_PARISC_PLTOFF14WR	115	/* PLT-rel. address, right 14 bits.  */
- #define R_PARISC_PLTOFF14DR	116	/* PLT-rel. address, right 14 bits.  */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/kfreebsd_path.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/kfreebsd_path.patch
deleted file mode 100644
index ba454ee..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/kfreebsd_path.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- elfutils/tests/run-native-test.sh.orig
-+++ elfutils/tests/run-native-test.sh
-@@ -78,6 +78,12 @@
-   test $native -eq 0 || testrun "$@" -p $native > /dev/null
- }
- 
-+# On the Debian buildds, GNU/kFreeBSD linprocfs /proc/$PID/maps does
-+# not give absolute paths due to sbuild's bind mounts (bug #570805)
-+# therefore the next two test programs are expected to fail with
-+# "cannot attach to process: Function not implemented".
-+[ "$(uname)" = "GNU/kFreeBSD" ] && exit 77
-+
- native_test ${abs_builddir}/allregs
- native_test ${abs_builddir}/funcretval
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/m68k_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/m68k_backend.diff
deleted file mode 100644
index d73855b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/m68k_backend.diff
+++ /dev/null
@@ -1,492 +0,0 @@
-From: Kurt Roeckx <kurt@roeckx.be>
-From: Thorsten Glaser <tg@mirbsd.de>
-Subject: m68k support
-
-Written by Kurt Roeckx, except for the retval support which was written
-by Thorsten Glaser
-
-
-Index: elfutils-0.164/backends/m68k_init.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/m68k_init.c
-@@ -0,0 +1,49 @@
-+/* Initialization of m68k specific backend library.
-+   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
-+
-+   This software is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   This softare is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with this software; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+*/
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#define BACKEND		m68k_
-+#define RELOC_PREFIX	R_68K_
-+#include "libebl_CPU.h"
-+
-+/* This defines the common reloc hooks based on m68k_reloc.def.  */
-+#include "common-reloc.c"
-+
-+
-+const char *
-+m68k_init (Elf *elf __attribute__ ((unused)),
-+     GElf_Half machine __attribute__ ((unused)),
-+     Ebl *eh,
-+     size_t ehlen)
-+{
-+  /* Check whether the Elf_BH object has a sufficent size.  */
-+  if (ehlen < sizeof (Ebl))
-+    return NULL;
-+
-+  /* We handle it.  */
-+  eh->name = "m68k";
-+  m68k_init_reloc (eh);
-+  HOOK (eh, reloc_simple_type);
-+  HOOK (eh, return_value_location);
-+  HOOK (eh, register_info);
-+
-+  return MODVERSION;
-+}
-Index: elfutils-0.164/backends/m68k_regs.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/m68k_regs.c
-@@ -0,0 +1,106 @@
-+/* Register names and numbers for m68k DWARF.
-+   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
-+
-+   This software is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   This software is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with this software; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <string.h>
-+#include <dwarf.h>
-+
-+#define BACKEND m68k_
-+#include "libebl_CPU.h"
-+
-+ssize_t
-+m68k_register_info (Ebl *ebl __attribute__ ((unused)),
-+		   int regno, char *name, size_t namelen,
-+		   const char **prefix, const char **setname,
-+		   int *bits, int *type)
-+{
-+	if (name == NULL)
-+		return 25;
-+
-+	if (regno < 0 || regno > 24 || namelen < 5)
-+		return -1;
-+
-+	*prefix = "%";
-+	*bits = 32;
-+	*type = (regno < 8 ? DW_ATE_signed
-+		: regno < 16 ? DW_ATE_address : DW_ATE_float);
-+
-+	if (regno < 8)
-+	{
-+		*setname = "integer";
-+	}
-+	else if (regno < 16)
-+	{
-+		*setname = "address";
-+	}
-+	else if (regno < 24)
-+	{
-+		*setname = "FPU";
-+	}
-+	else
-+	{
-+		*setname = "address";
-+		*type = DW_ATE_address;
-+	}
-+
-+	switch (regno)
-+	{
-+	case 0 ... 7:
-+		name[0] = 'd';
-+		name[1] = regno + '0';
-+		namelen = 2;
-+		break;
-+
-+	case 8 ... 13:
-+		name[0] = 'a';
-+		name[1] = regno - 8 + '0';
-+		namelen = 2;
-+		break;
-+
-+	case 14:
-+		name[0] = 'f';
-+		name[1] = 'p';
-+   		namelen = 2;
-+		break;
-+
-+	case 15:
-+		name[0] = 's';
-+		name[1] = 'p';
-+   		namelen = 2;
-+		break;
-+
-+	case 16 ... 23:
-+		name[0] = 'f';
-+		name[1] = 'p';
-+		name[2] = regno - 16 + '0';
-+   		namelen = 3;
-+		break;
-+
-+	case 24:
-+		name[0] = 'p';
-+		name[1] = 'c';
-+		namelen = 2;
-+	}
-+
-+	name[namelen++] = '\0';
-+	return namelen;
-+}
-+
-Index: elfutils-0.164/backends/m68k_reloc.def
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/m68k_reloc.def
-@@ -0,0 +1,45 @@
-+/* List the relocation types for m68k.  -*- C -*-
-+   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
-+
-+   This software is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   This software is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with this software; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+*/
-+
-+/* 	    NAME,		REL|EXEC|DYN	*/
-+
-+RELOC_TYPE (NONE,		0)
-+RELOC_TYPE (32,			REL|EXEC|DYN)
-+RELOC_TYPE (16,			REL)
-+RELOC_TYPE (8,			REL)
-+RELOC_TYPE (PC32,		REL|EXEC|DYN)
-+RELOC_TYPE (PC16,		REL)
-+RELOC_TYPE (PC8,		REL)
-+RELOC_TYPE (GOT32,		REL)
-+RELOC_TYPE (GOT16,		REL)
-+RELOC_TYPE (GOT8,		REL)
-+RELOC_TYPE (GOT32O,		REL)
-+RELOC_TYPE (GOT16O,		REL)
-+RELOC_TYPE (GOT8O,		REL)
-+RELOC_TYPE (PLT32,		REL)
-+RELOC_TYPE (PLT16,		REL)
-+RELOC_TYPE (PLT8,		REL)
-+RELOC_TYPE (PLT32O,		REL)
-+RELOC_TYPE (PLT16O,		REL)
-+RELOC_TYPE (PLT8O,		REL)
-+RELOC_TYPE (COPY,		EXEC)
-+RELOC_TYPE (GLOB_DAT,		EXEC|DYN)
-+RELOC_TYPE (JMP_SLOT,		EXEC|DYN)
-+RELOC_TYPE (RELATIVE,		EXEC|DYN)
-+RELOC_TYPE (GNU_VTINHERIT,	REL)
-+RELOC_TYPE (GNU_VTENTRY,	REL)
-+
-Index: elfutils-0.164/libelf/elf.h
-===================================================================
---- elfutils-0.164.orig/libelf/elf.h
-+++ elfutils-0.164/libelf/elf.h
-@@ -1158,6 +1158,9 @@ typedef struct
- #define R_68K_GLOB_DAT	20		/* Create GOT entry */
- #define R_68K_JMP_SLOT	21		/* Create PLT entry */
- #define R_68K_RELATIVE	22		/* Adjust by program base */
-+/* The next 2 are GNU extensions to enable C++ vtable garbage collection.  */
-+#define R_68K_GNU_VTINHERIT 23
-+#define R_68K_GNU_VTENTRY   24
- #define R_68K_TLS_GD32      25          /* 32 bit GOT offset for GD */
- #define R_68K_TLS_GD16      26          /* 16 bit GOT offset for GD */
- #define R_68K_TLS_GD8       27          /* 8 bit GOT offset for GD */
-Index: elfutils-0.164/backends/Makefile.am
-===================================================================
---- elfutils-0.164.orig/backends/Makefile.am
-+++ elfutils-0.164/backends/Makefile.am
-@@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
- 
- 
- modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
--	  tilegx parisc mips
-+	  tilegx parisc mips m68k
- libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a    \
- 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a    \
- 	     libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
- 	     libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
--	     libebl_parisc_pic.a libebl_mips_pic.a
-+	     libebl_parisc_pic.a libebl_mips_pic.a libebl_m68k_pic.a
- noinst_LIBRARIES = $(libebl_pic)
- noinst_DATA = $(libebl_pic:_pic.a=.so)
- 
-@@ -120,6 +120,10 @@ mips_SRCS = mips_init.c mips_symbol.c mi
- libebl_mips_pic_a_SOURCES = $(mips_SRCS)
- am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
- 
-+m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c m68k_retval.c
-+libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
-+am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
-+
- libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
- 	@rm -f $(@:.so=.map)
- 	$(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
-Index: elfutils-0.164/backends/m68k_symbol.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/m68k_symbol.c
-@@ -0,0 +1,43 @@
-+/* m68k specific symbolic name handling.
-+   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
-+
-+   This software is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   This software distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with this software; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+*/
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <elf.h>
-+#include <stddef.h>
-+
-+#define BACKEND		m68k_
-+#include "libebl_CPU.h"
-+
-+/* Check for the simple reloc types.  */
-+Elf_Type
-+m68k_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
-+{
-+  switch (type)
-+    {
-+    case R_68K_32:
-+      return ELF_T_SWORD;
-+    case R_68K_16:
-+      return ELF_T_HALF;
-+    case R_68K_8:
-+      return ELF_T_BYTE;
-+    default:
-+      return ELF_T_NUM;
-+    }
-+}
-Index: elfutils-0.164/backends/m68k_retval.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/m68k_retval.c
-@@ -0,0 +1,172 @@
-+/* Function return value location for Linux/m68k ABI.
-+   Copyright (C) 2005-2010 Red Hat, Inc.
-+   Copyright (c) 2011 Thorsten Glaser, Debian.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <assert.h>
-+#include <dwarf.h>
-+
-+#define BACKEND m68k_
-+#include "libebl_CPU.h"
-+
-+
-+/* %d0, or pair %d0, %d1, or %a0 */
-+static const Dwarf_Op loc_intreg[] =
-+  {
-+    { .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_reg1 }, { .atom = DW_OP_piece, .number = 4 },
-+  };
-+static const Dwarf_Op loc_ptrreg[] =
-+  {
-+    { .atom = DW_OP_reg8 },
-+  };
-+#define nloc_intreg	1
-+#define nloc_intregpair	4
-+#define nloc_ptrreg	1
-+
-+/* %f0 */
-+static const Dwarf_Op loc_fpreg[] =
-+  {
-+    { .atom = DW_OP_reg16 }
-+  };
-+#define nloc_fpreg	1
-+
-+/* Structures are a bit more complicated - small structures are returned
-+   in %d0 / %d1 (-freg-struct-return which is enabled by default), large
-+   structures use %a1 (in constrast to the SYSV psABI which says %a0) as
-+   reentrant storage space indicator.  */
-+static const Dwarf_Op loc_aggregate[] =
-+  {
-+    { .atom = DW_OP_breg9, .number = 0 }
-+  };
-+#define nloc_aggregate 1
-+
-+int
-+m68k_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+  Dwarf_Word size;
-+
-+  /* Start with the function's type, and get the DW_AT_type attribute,
-+     which is the type of the return value.  */
-+
-+  Dwarf_Attribute attr_mem;
-+  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
-+						&attr_mem);
-+  if (attr == NULL)
-+    /* The function has no return value, like a `void' function in C.  */
-+    return 0;
-+
-+  Dwarf_Die die_mem;
-+  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
-+  int tag = dwarf_tag (typedie);
-+
-+  /* Follow typedefs and qualifiers to get to the actual type.  */
-+  while (tag == DW_TAG_typedef
-+	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
-+	 || tag == DW_TAG_restrict_type)
-+    {
-+      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
-+      typedie = dwarf_formref_die (attr, &die_mem);
-+      tag = dwarf_tag (typedie);
-+    }
-+
-+  switch (tag)
-+    {
-+    case -1:
-+      return -1;
-+
-+    case DW_TAG_subrange_type:
-+      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
-+	{
-+	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
-+	  typedie = dwarf_formref_die (attr, &die_mem);
-+	  tag = dwarf_tag (typedie);
-+	}
-+      /* Fall through.  */
-+
-+    case DW_TAG_base_type:
-+    case DW_TAG_enumeration_type:
-+    case DW_TAG_pointer_type:
-+    case DW_TAG_ptr_to_member_type:
-+      if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
-+						 &attr_mem), &size) != 0)
-+	{
-+	  if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
-+	    size = 4;
-+	  else
-+	    return -1;
-+	}
-+      if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
-+	{
-+	  *locp = loc_ptrreg;
-+          return nloc_ptrreg;
-+	}
-+      if (tag == DW_TAG_base_type)
-+	{
-+	  Dwarf_Word encoding;
-+	  if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
-+						     &attr_mem),
-+			       &encoding) != 0)
-+	    return -1;
-+	  if (encoding == DW_ATE_float)
-+	    {
-+	      /* XXX really 10? */
-+              if (size > 10)
-+                return -2;
-+              *locp = loc_fpreg;
-+              return nloc_fpreg;
-+	    }
-+	}
-+      if (size <= 8)
-+	{
-+	intreg:
-+	  /* XXX check endianness of dword pair, int64 vs aggregate */
-+	  *locp = loc_intreg;
-+	  return size <= 4 ? nloc_intreg : nloc_intregpair;
-+	}
-+
-+    aggregate:
-+      *locp = loc_aggregate;
-+      return nloc_aggregate;
-+
-+    case DW_TAG_structure_type:
-+    case DW_TAG_class_type:
-+    case DW_TAG_union_type:
-+    case DW_TAG_array_type:
-+      if (dwarf_aggregate_size (typedie, &size) == 0
-+	  && size > 0 && size <= 8)
-+	/* not accurate for a struct whose only member is a float */
-+	goto intreg;
-+      goto aggregate;
-+    }
-+
-+  /* XXX We don't have a good way to return specific errors from ebl calls.
-+     This value means we do not understand the type, but it is well-formed
-+     DWARF and might be valid.  */
-+  return -2;
-+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/mips_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/mips_backend.diff
deleted file mode 100644
index de1237b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/mips_backend.diff
+++ /dev/null
@@ -1,711 +0,0 @@
-Index: elfutils-0.164/backends/mips_init.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/mips_init.c
-@@ -0,0 +1,59 @@
-+/* Initialization of mips specific backend library.
-+   Copyright (C) 2006 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#define BACKEND		mips_
-+#define RELOC_PREFIX	R_MIPS_
-+#include "libebl_CPU.h"
-+
-+/* This defines the common reloc hooks based on mips_reloc.def.  */
-+#include "common-reloc.c"
-+
-+const char *
-+mips_init (Elf *elf __attribute__ ((unused)),
-+     GElf_Half machine __attribute__ ((unused)),
-+     Ebl *eh,
-+     size_t ehlen)
-+{
-+  /* Check whether the Elf_BH object has a sufficent size.  */
-+  if (ehlen < sizeof (Ebl))
-+    return NULL;
-+
-+  /* We handle it.  */
-+  if (machine == EM_MIPS)
-+    eh->name = "MIPS R3000 big-endian";
-+  else if (machine == EM_MIPS_RS3_LE)
-+    eh->name = "MIPS R3000 little-endian";
-+
-+  mips_init_reloc (eh);
-+  HOOK (eh, reloc_simple_type);
-+  HOOK (eh, return_value_location);
-+  HOOK (eh, register_info);
-+
-+  return MODVERSION;
-+}
-Index: elfutils-0.164/backends/mips_regs.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/mips_regs.c
-@@ -0,0 +1,104 @@
-+/* Register names and numbers for MIPS DWARF.
-+   Copyright (C) 2006 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <string.h>
-+#include <dwarf.h>
-+
-+#define BACKEND mips_
-+#include "libebl_CPU.h"
-+
-+ssize_t
-+mips_register_info (Ebl *ebl __attribute__((unused)),
-+		    int regno, char *name, size_t namelen,
-+		    const char **prefix, const char **setname,
-+		    int *bits, int *type)
-+{
-+  if (name == NULL)
-+    return 66;
-+
-+  if (regno < 0 || regno > 65 || namelen < 4)
-+    return -1;
-+
-+  *prefix = "$";
-+
-+  if (regno < 32)
-+    {
-+      *setname = "integer";
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      if (regno < 32 + 10)
-+        {
-+          name[0] = regno + '0';
-+          namelen = 1;
-+        }
-+      else
-+        {
-+          name[0] = (regno / 10) + '0';
-+          name[1] = (regno % 10) + '0';
-+          namelen = 2;
-+        }
-+    }
-+  else if (regno < 64)
-+    {
-+      *setname = "FPU";
-+      *type = DW_ATE_float;
-+      *bits = 32;
-+      name[0] = 'f';
-+      if (regno < 32 + 10)
-+	{
-+	  name[1] = (regno - 32) + '0';
-+	  namelen = 2;
-+	}
-+      else
-+	{
-+	  name[1] = (regno - 32) / 10 + '0';
-+	  name[2] = (regno - 32) % 10 + '0';
-+	  namelen = 3;
-+	}
-+    }
-+  else if (regno == 64)
-+    {
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      name[0] = 'h';
-+      name[1] = 'i';
-+      namelen = 2;
-+    }
-+  else
-+    {
-+      *type = DW_ATE_signed;
-+      *bits = 32;
-+      name[0] = 'l';
-+      name[1] = 'o';
-+      namelen = 2;
-+    }
-+
-+  name[namelen++] = '\0';
-+  return namelen;
-+}
-Index: elfutils-0.164/backends/mips_reloc.def
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/mips_reloc.def
-@@ -0,0 +1,79 @@
-+/* List the relocation types for mips.  -*- C -*-
-+   Copyright (C) 2006 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+/* 	    NAME,		REL|EXEC|DYN	*/
-+
-+RELOC_TYPE (NONE,               0)
-+RELOC_TYPE (16,                 0)
-+RELOC_TYPE (32,                 0)
-+RELOC_TYPE (REL32,              0)
-+RELOC_TYPE (26,                 0)
-+RELOC_TYPE (HI16,               0)
-+RELOC_TYPE (LO16,               0)
-+RELOC_TYPE (GPREL16,            0)
-+RELOC_TYPE (LITERAL,            0)
-+RELOC_TYPE (GOT16,              0)
-+RELOC_TYPE (PC16,               0)
-+RELOC_TYPE (CALL16,             0)
-+RELOC_TYPE (GPREL32,            0)
-+
-+RELOC_TYPE (SHIFT5,             0)
-+RELOC_TYPE (SHIFT6,             0)
-+RELOC_TYPE (64,                 0)
-+RELOC_TYPE (GOT_DISP,           0)
-+RELOC_TYPE (GOT_PAGE,           0)
-+RELOC_TYPE (GOT_OFST,           0)
-+RELOC_TYPE (GOT_HI16,           0)
-+RELOC_TYPE (GOT_LO16,           0)
-+RELOC_TYPE (SUB,                0)
-+RELOC_TYPE (INSERT_A,           0)
-+RELOC_TYPE (INSERT_B,           0)
-+RELOC_TYPE (DELETE,             0)
-+RELOC_TYPE (HIGHER,             0)
-+RELOC_TYPE (HIGHEST,            0)
-+RELOC_TYPE (CALL_HI16,          0)
-+RELOC_TYPE (CALL_LO16,          0)
-+RELOC_TYPE (SCN_DISP,           0)
-+RELOC_TYPE (REL16,              0)
-+RELOC_TYPE (ADD_IMMEDIATE,      0)
-+RELOC_TYPE (PJUMP,              0)
-+RELOC_TYPE (RELGOT,             0)
-+RELOC_TYPE (JALR,               0)
-+RELOC_TYPE (TLS_DTPMOD32,       0)
-+RELOC_TYPE (TLS_DTPREL32,       0)
-+RELOC_TYPE (TLS_DTPMOD64,       0)
-+RELOC_TYPE (TLS_DTPREL64,       0)
-+RELOC_TYPE (TLS_GD,             0)
-+RELOC_TYPE (TLS_LDM,            0)
-+RELOC_TYPE (TLS_DTPREL_HI16,    0)
-+RELOC_TYPE (TLS_DTPREL_LO16,    0)
-+RELOC_TYPE (TLS_GOTTPREL,       0)
-+RELOC_TYPE (TLS_TPREL32,        0)
-+RELOC_TYPE (TLS_TPREL64,        0)
-+RELOC_TYPE (TLS_TPREL_HI16,     0)
-+RELOC_TYPE (TLS_TPREL_LO16,     0)
-+
-+#define NO_COPY_RELOC 1
-+#define NO_RELATIVE_RELOC 1
-Index: elfutils-0.164/backends/mips_retval.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/mips_retval.c
-@@ -0,0 +1,321 @@
-+/* Function return value location for Linux/mips ABI.
-+   Copyright (C) 2005 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <string.h>
-+#include <assert.h>
-+#include <dwarf.h>
-+#include <elf.h>
-+
-+#include "../libebl/libeblP.h"
-+#include "../libdw/libdwP.h"
-+
-+#define BACKEND mips_
-+#include "libebl_CPU.h"
-+
-+/* The ABI of the file.  Also see EF_MIPS_ABI2 above. */
-+#define EF_MIPS_ABI		0x0000F000
-+
-+/* The original o32 abi. */
-+#define E_MIPS_ABI_O32          0x00001000
-+
-+/* O32 extended to work on 64 bit architectures */
-+#define E_MIPS_ABI_O64          0x00002000
-+
-+/* EABI in 32 bit mode */
-+#define E_MIPS_ABI_EABI32       0x00003000
-+
-+/* EABI in 64 bit mode */
-+#define E_MIPS_ABI_EABI64       0x00004000
-+
-+/* All the possible MIPS ABIs. */
-+enum mips_abi
-+  {
-+    MIPS_ABI_UNKNOWN = 0,
-+    MIPS_ABI_N32,
-+    MIPS_ABI_O32,
-+    MIPS_ABI_N64,
-+    MIPS_ABI_O64,
-+    MIPS_ABI_EABI32,
-+    MIPS_ABI_EABI64,
-+    MIPS_ABI_LAST
-+  };
-+
-+/* Find the mips ABI of the current file */
-+enum mips_abi find_mips_abi(Elf *elf)
-+{
-+  GElf_Ehdr ehdr_mem;
-+  GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
-+
-+  if (ehdr == NULL)
-+    return MIPS_ABI_LAST;
-+
-+  GElf_Word elf_flags = ehdr->e_flags;
-+
-+  /* Check elf_flags to see if it specifies the ABI being used.  */
-+  switch ((elf_flags & EF_MIPS_ABI))
-+    {
-+    case E_MIPS_ABI_O32:
-+      return MIPS_ABI_O32;
-+    case E_MIPS_ABI_O64:
-+      return MIPS_ABI_O64;
-+    case E_MIPS_ABI_EABI32:
-+      return MIPS_ABI_EABI32;
-+    case E_MIPS_ABI_EABI64:
-+      return MIPS_ABI_EABI64;
-+    default:
-+      if ((elf_flags & EF_MIPS_ABI2))
-+	return MIPS_ABI_N32;
-+    }
-+
-+  /* GCC creates a pseudo-section whose name describes the ABI.  */
-+  size_t shstrndx;
-+  if (elf_getshdrstrndx (elf, &shstrndx) < 0)
-+    return MIPS_ABI_LAST;
-+
-+  const char *name;
-+  Elf_Scn *scn = NULL;
-+  while ((scn = elf_nextscn (elf, scn)) != NULL)
-+    {
-+      GElf_Shdr shdr_mem;
-+      GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
-+      if (shdr == NULL)
-+        return MIPS_ABI_LAST;
-+
-+      name = elf_strptr (elf, shstrndx, shdr->sh_name) ?: "";
-+      if (strncmp (name, ".mdebug.", 8) != 0)
-+        continue;
-+
-+      if (strcmp (name, ".mdebug.abi32") == 0)
-+        return MIPS_ABI_O32;
-+      else if (strcmp (name, ".mdebug.abiN32") == 0)
-+        return MIPS_ABI_N32;
-+      else if (strcmp (name, ".mdebug.abi64") == 0)
-+        return MIPS_ABI_N64;
-+      else if (strcmp (name, ".mdebug.abiO64") == 0)
-+        return MIPS_ABI_O64;
-+      else if (strcmp (name, ".mdebug.eabi32") == 0)
-+        return MIPS_ABI_EABI32;
-+      else if (strcmp (name, ".mdebug.eabi64") == 0)
-+        return MIPS_ABI_EABI64;
-+      else
-+        return MIPS_ABI_UNKNOWN;
-+    }
-+
-+  return MIPS_ABI_UNKNOWN;
-+}
-+
-+unsigned int
-+mips_abi_regsize (enum mips_abi abi)
-+{
-+  switch (abi)
-+    {
-+    case MIPS_ABI_EABI32:
-+    case MIPS_ABI_O32:
-+      return 4;
-+    case MIPS_ABI_N32:
-+    case MIPS_ABI_N64:
-+    case MIPS_ABI_O64:
-+    case MIPS_ABI_EABI64:
-+      return 8;
-+    case MIPS_ABI_UNKNOWN:
-+    case MIPS_ABI_LAST:
-+    default:
-+      return 0;
-+    }
-+}
-+
-+
-+/* $v0 or pair $v0, $v1 */
-+static const Dwarf_Op loc_intreg_o32[] =
-+  {
-+    { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 },
-+  };
-+
-+static const Dwarf_Op loc_intreg[] =
-+  {
-+    { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 8 },
-+    { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 8 },
-+  };
-+#define nloc_intreg	1
-+#define nloc_intregpair	4
-+
-+/* $f0 (float), or pair $f0, $f1 (double).
-+ * f2/f3 are used for COMPLEX (= 2 doubles) returns in Fortran */
-+static const Dwarf_Op loc_fpreg_o32[] =
-+  {
-+    { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 4 },
-+    { .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 4 },
-+  };
-+
-+/* $f0, or pair $f0, $f2.  */
-+static const Dwarf_Op loc_fpreg[] =
-+  {
-+    { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 8 },
-+    { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 },
-+  };
-+#define nloc_fpreg  1
-+#define nloc_fpregpair 4
-+#define nloc_fpregquad 8
-+
-+/* The return value is a structure and is actually stored in stack space
-+   passed in a hidden argument by the caller.  But, the compiler
-+   helpfully returns the address of that space in $v0.  */
-+static const Dwarf_Op loc_aggregate[] =
-+  {
-+    { .atom = DW_OP_breg2, .number = 0 }
-+  };
-+#define nloc_aggregate 1
-+
-+int
-+mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
-+{
-+  /* First find the ABI used by the elf object */
-+  enum mips_abi abi = find_mips_abi(functypedie->cu->dbg->elf);
-+
-+  /* Something went seriously wrong while trying to figure out the ABI */
-+  if (abi == MIPS_ABI_LAST)
-+    return -1;
-+
-+  /* We couldn't identify the ABI, but the file seems valid */
-+  if (abi == MIPS_ABI_UNKNOWN)
-+    return -2;
-+
-+  /* Can't handle EABI variants */
-+  if ((abi == MIPS_ABI_EABI32) || (abi == MIPS_ABI_EABI64))
-+    return -2;
-+
-+  unsigned int regsize = mips_abi_regsize (abi);
-+  if (!regsize)
-+    return -2;
-+
-+  /* Start with the function's type, and get the DW_AT_type attribute,
-+     which is the type of the return value.  */
-+
-+  Dwarf_Attribute attr_mem;
-+  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
-+  if (attr == NULL)
-+    /* The function has no return value, like a `void' function in C.  */
-+    return 0;
-+
-+  Dwarf_Die die_mem;
-+  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
-+  int tag = dwarf_tag (typedie);
-+
-+  /* Follow typedefs and qualifiers to get to the actual type.  */
-+  while (tag == DW_TAG_typedef
-+	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
-+	 || tag == DW_TAG_restrict_type)
-+    {
-+      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
-+      typedie = dwarf_formref_die (attr, &die_mem);
-+      tag = dwarf_tag (typedie);
-+    }
-+
-+  switch (tag)
-+    {
-+    case -1:
-+      return -1;
-+
-+    case DW_TAG_subrange_type:
-+      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
-+	{
-+	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
-+	  typedie = dwarf_formref_die (attr, &die_mem);
-+	  tag = dwarf_tag (typedie);
-+	}
-+      /* Fall through.  */
-+
-+    case DW_TAG_base_type:
-+    case DW_TAG_enumeration_type:
-+    case DW_TAG_pointer_type:
-+    case DW_TAG_ptr_to_member_type:
-+      {
-+        Dwarf_Word size;
-+	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
-+					 &attr_mem), &size) != 0)
-+	  {
-+	    if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
-+	      size = regsize;
-+	    else
-+	      return -1;
-+	  }
-+	if (tag == DW_TAG_base_type)
-+	  {
-+	    Dwarf_Word encoding;
-+	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
-+					     &attr_mem), &encoding) != 0)
-+	      return -1;
-+
-+#define ABI_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc))
-+
-+	    if (encoding == DW_ATE_float)
-+	      {
-+		*locp = ABI_LOC(loc_fpreg, regsize);
-+		if (size <= regsize)
-+		    return nloc_fpreg;
-+
-+		if (size <= 2*regsize)
-+                  return nloc_fpregpair;
-+
-+		if (size <= 4*regsize && abi == MIPS_ABI_O32)
-+                  return nloc_fpregquad;
-+
-+		goto aggregate;
-+	      }
-+	  }
-+	*locp = ABI_LOC(loc_intreg, regsize);
-+	if (size <= regsize)
-+	  return nloc_intreg;
-+	if (size <= 2*regsize)
-+	  return nloc_intregpair;
-+
-+	/* Else fall through. Shouldn't happen though (at least with gcc) */
-+      }
-+
-+    case DW_TAG_structure_type:
-+    case DW_TAG_class_type:
-+    case DW_TAG_union_type:
-+    case DW_TAG_array_type:
-+    aggregate:
-+      /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
-+      if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64))
-+        return -2;
-+
-+      *locp = loc_aggregate;
-+      return nloc_aggregate;
-+    }
-+
-+  /* XXX We don't have a good way to return specific errors from ebl calls.
-+     This value means we do not understand the type, but it is well-formed
-+     DWARF and might be valid.  */
-+  return -2;
-+}
-Index: elfutils-0.164/backends/mips_symbol.c
-===================================================================
---- /dev/null
-+++ elfutils-0.164/backends/mips_symbol.c
-@@ -0,0 +1,52 @@
-+/* MIPS specific symbolic name handling.
-+   Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
-+   This file is part of Red Hat elfutils.
-+   Written by Jakub Jelinek <jakub@redhat.com>, 2002.
-+
-+   Red Hat elfutils is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by the
-+   Free Software Foundation; version 2 of the License.
-+
-+   Red Hat elfutils is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License along
-+   with Red Hat elfutils; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
-+
-+   Red Hat elfutils is an included package of the Open Invention Network.
-+   An included package of the Open Invention Network is a package for which
-+   Open Invention Network licensees cross-license their patents.  No patent
-+   license is granted, either expressly or impliedly, by designation as an
-+   included package.  Should you wish to participate in the Open Invention
-+   Network licensing program, please visit www.openinventionnetwork.com
-+   <http://www.openinventionnetwork.com>.  */
-+
-+#ifdef HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+
-+#include <elf.h>
-+#include <stddef.h>
-+
-+#define BACKEND		mips_
-+#include "libebl_CPU.h"
-+
-+/* Check for the simple reloc types.  */
-+Elf_Type
-+mips_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
-+{
-+  switch (type)
-+    {
-+    case R_MIPS_16:
-+      return ELF_T_HALF;
-+    case R_MIPS_32:
-+      return ELF_T_WORD;
-+    case R_MIPS_64:
-+      return ELF_T_XWORD;
-+    default:
-+      return ELF_T_NUM;
-+    }
-+}
-Index: elfutils-0.164/libebl/eblopenbackend.c
-===================================================================
---- elfutils-0.164.orig/libebl/eblopenbackend.c
-+++ elfutils-0.164/libebl/eblopenbackend.c
-@@ -71,6 +71,8 @@ static const struct
-   { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 },
-   { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 },
-   { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 },
-+  { "mips", "elf_mips", "mips", 4, EM_MIPS, 0, 0 },
-+  { "mips", "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 },
- 
-   { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
-   { "m68k", "elf_m68k", "m68k", 4, EM_68K, 0, 0 },
-Index: elfutils-0.164/backends/common-reloc.c
-===================================================================
---- elfutils-0.164.orig/backends/common-reloc.c
-+++ elfutils-0.164/backends/common-reloc.c
-@@ -125,11 +125,13 @@ EBLHOOK(reloc_valid_use) (Elf *elf, int
- }
- 
- 
-+#ifndef NO_COPY_RELOC
- bool
- EBLHOOK(copy_reloc_p) (int reloc)
- {
-   return reloc == R_TYPE (COPY);
- }
-+#endif
- 
- bool
- EBLHOOK(none_reloc_p) (int reloc)
-@@ -151,7 +153,9 @@ EBLHOOK(init_reloc) (Ebl *ebl)
-   ebl->reloc_type_name = EBLHOOK(reloc_type_name);
-   ebl->reloc_type_check = EBLHOOK(reloc_type_check);
-   ebl->reloc_valid_use = EBLHOOK(reloc_valid_use);
-+#ifndef NO_COPY_RELOC
-   ebl->copy_reloc_p = EBLHOOK(copy_reloc_p);
-+#endif
-   ebl->none_reloc_p = EBLHOOK(none_reloc_p);
- #ifndef NO_RELATIVE_RELOC
-   ebl->relative_reloc_p = EBLHOOK(relative_reloc_p);
-Index: elfutils-0.164/backends/Makefile.am
-===================================================================
---- elfutils-0.164.orig/backends/Makefile.am
-+++ elfutils-0.164/backends/Makefile.am
-@@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
- 
- 
- modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
--	  tilegx parisc
-+	  tilegx parisc mips
- libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a    \
- 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a    \
- 	     libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
- 	     libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
--	     libebl_parisc_pic.a
-+	     libebl_parisc_pic.a libebl_mips_pic.a
- noinst_LIBRARIES = $(libebl_pic)
- noinst_DATA = $(libebl_pic:_pic.a=.so)
- 
-@@ -116,6 +116,10 @@ parisc_SRCS = parisc_init.c parisc_symbo
- libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
- am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
- 
-+mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c
-+libebl_mips_pic_a_SOURCES = $(mips_SRCS)
-+am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
-+
- libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
- 	@rm -f $(@:.so=.map)
- 	$(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/mips_readelf_w.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/mips_readelf_w.patch
deleted file mode 100644
index 930d6f6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/mips_readelf_w.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Kurt Roeckx <kurt@roeckx.be>
-Subject: Make readelf -w output debug information on mips
-Bug-Debian: http://bugs.debian.org/662041
-Forwarded: not-needed
-
-Upstreams wants a change where this is handled by a hook that needs
-to be filled in by the backend for the arch.
-
-Index: elfutils-0.164/src/readelf.c
-===================================================================
---- elfutils-0.164.orig/src/readelf.c
-+++ elfutils-0.164/src/readelf.c
-@@ -8218,7 +8218,8 @@ print_debug (Dwfl_Module *dwflmod, Ebl *
-       GElf_Shdr shdr_mem;
-       GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- 
--      if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
-+      if (shdr != NULL && (
-+	 (shdr->sh_type == SHT_PROGBITS) || (shdr->sh_type == SHT_MIPS_DWARF)))
- 	{
- 	  static const struct
- 	  {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/testsuite-ignore-elflint.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/testsuite-ignore-elflint.diff
deleted file mode 100644
index eae5796..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/testsuite-ignore-elflint.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-On many architectures this test fails because binaries/libs produced by
-binutils don't pass elflint. However elfutils shouldn't FTBFS because of this.
-
-So we run the tests on all archs to see what breaks, but if it breaks we ignore
-the result (exitcode 77 means: this test was skipped).
-
-Index: elfutils-0.156/tests/run-elflint-self.sh
-===================================================================
---- elfutils-0.156.orig/tests/run-elflint-self.sh	2013-07-28 14:35:36.000000000 +0200
-+++ elfutils-0.156/tests/run-elflint-self.sh	2013-07-28 14:36:10.000000000 +0200
-@@ -18,4 +18,4 @@
- 
- . $srcdir/test-subr.sh
- 
--testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld
-+testrun_on_self_skip ${abs_top_builddir}/src/elflint --quiet --gnu-ld
-Index: elfutils-0.156/tests/test-subr.sh
-===================================================================
---- elfutils-0.156.orig/tests/test-subr.sh	2013-07-28 14:35:36.000000000 +0200
-+++ elfutils-0.156/tests/test-subr.sh	2013-07-28 14:35:36.000000000 +0200
-@@ -149,3 +149,18 @@
-   # Only exit if something failed
-   if test $exit_status != 0; then exit $exit_status; fi
- }
-+
-+# Same as testrun_on_self(), but skip on failure.
-+testrun_on_self_skip()
-+{
-+  exit_status=0
-+
-+  for file in $self_test_files; do
-+      testrun $* $file \
-+	  || { echo "*** failure in $* $file"; exit_status=77; }
-+  done
-+
-+  # Only exit if something failed
-+  if test $exit_status != 0; then exit $exit_status; fi
-+}
-+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/uclibc-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/uclibc-support.patch
deleted file mode 100644
index 6299998..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/uclibc-support.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From 3daec2dd11a04955f95e8f65a48820103d84dbec Mon Sep 17 00:00:00 2001
-From: Junling Zheng <zhengjunling@huawei.com>
-Date: Thu, 9 Apr 2015 12:12:49 +0000
-Subject: [PATCH] uclibc support for elfutils 0.161
-
-on uclibc systems libintl and libuargp are separate from libc.
-so they need to be specified on commandline when we use proxy-libintl
-then libintl is a static archive so it should be listed last since
-elfutils does not respect disable-nls we need to link in libintl
-
-We add a new option --enable-uclibc which will be used to control
-the uclibc specific configurations during build.
-
-Upstream-Status: Inappropriate [uclibc specific]
-
-Signed-off-by: Khem Raj <raj.khem>
-Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
-[Junling Zheng:
- - adjust context
-]
----
- configure.ac       | 8 ++++++++
- libcpu/Makefile.am | 4 ++++
- libdw/Makefile.am  | 7 ++++++-
- libelf/Makefile.am | 5 +++++
- 4 files changed, 23 insertions(+), 1 deletion(-)
-
-Index: elfutils-0.166/configure.ac
-===================================================================
---- elfutils-0.166.orig/configure.ac
-+++ elfutils-0.166/configure.ac
-@@ -79,6 +79,14 @@ AS_IF([test "$use_locks" = yes],
- 
- AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
- 
-+AC_ARG_ENABLE([uclibc],
-+AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
-+use_uclibc=yes, use_uclibc=no)
-+AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
-+AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
-+
-+AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
-+
- AC_PROG_CC
- AC_PROG_RANLIB
- AC_PROG_YACC
-@@ -347,18 +355,13 @@ AC_LINK_IFELSE(
- )
- 
- dnl If our libc doesn't provide argp, then test for libargp
--if test "$libc_has_argp" = "false" ; then
--	AC_MSG_WARN("libc does not have argp")
--	AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
--
--	if test "$have_argp" = "false"; then
--		AC_MSG_ERROR("no libargp found")
--	else
--		argp_LDADD="-largp"
--	fi
--else
--	argp_LDADD=""
--fi
-+AS_IF([test "x$libc_has_argp" = "xfalse"],
-+	[AC_MSG_WARN("libc does not have argp")
-+	AC_CHECK_LIB([argp], [argp_parse], [have_argp="true" argp_LDADD="-largp"], [have_argp="false"])], [argp_LDADD=""])
-+
-+AS_IF([test "x$libc_has_argp" = "xfalse" -a "x$have_argp" = "xfalse"],
-+	AC_CHECK_LIB([uargp], [argp_parse], [have_uargp="true" argp_LDADD="-luargp"], [have_uargp="false"])], [argp_LDADD=""])
-+
- AC_SUBST([argp_LDADD])
- 
- dnl The directories with content.
-Index: elfutils-0.166/libcpu/Makefile.am
-===================================================================
---- elfutils-0.166.orig/libcpu/Makefile.am
-+++ elfutils-0.166/libcpu/Makefile.am
-@@ -80,6 +80,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
- i386_lex.o: i386_parse.h
- i386_gendis_LDADD = $(libeu) -lm
- 
-+if USE_UCLIBC
-+i386_gendis_LDADD += -lintl
-+endif
-+
- i386_parse.h: i386_parse.c ;
- 
- EXTRA_DIST = defs/i386
-Index: elfutils-0.166/libdw/Makefile.am
-===================================================================
---- elfutils-0.166.orig/libdw/Makefile.am
-+++ elfutils-0.166/libdw/Makefile.am
-@@ -102,6 +102,11 @@ endif
- libdw_pic_a_SOURCES =
- am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
- 
-+libdw_so_LDLIBS =
-+if USE_UCLIBC
-+libdw_so_LDLIBS += -lintl
-+endif
-+
- libdw_so_SOURCES =
- libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
- 	  ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
-@@ -112,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map l
- 		-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
- 		-Wl,--version-script,$<,--no-undefined \
- 		-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
--		-ldl -lz $(argp_LDADD) $(zip_LIBS)
-+		-ldl -lz $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
- 	@$(textrel_check)
- 	$(AM_V_at)ln -fs $@ $@.$(VERSION)
- 
-Index: elfutils-0.166/libelf/Makefile.am
-===================================================================
---- elfutils-0.166.orig/libelf/Makefile.am
-+++ elfutils-0.166/libelf/Makefile.am
-@@ -96,6 +96,11 @@ libelf_pic_a_SOURCES =
- am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
- 
- libelf_so_LDLIBS = -lz
-+
-+if USE_UCLIBC
-+libelf_so_LDLIBS += -lintl
-+endif
-+
- if USE_LOCKS
- libelf_so_LDLIBS += -lpthread
- endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
new file mode 100644
index 0000000..020ffa1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
@@ -0,0 +1,1051 @@
+From 054fedda5ab9b84160d40d90cb967f2f5822b889 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 06:35:34 +0000
+Subject: [PATCH] build: Provide alternatives for glibc assumptions helps
+ compiling it on musl
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Rebase to 0.68
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.am                      |  2 +-
+ lib/color.c                      |  3 ++-
+ lib/crc32_file.c                 |  1 +
+ lib/fixedsizehash.h              |  1 -
+ lib/system.h                     | 10 ++++++++++
+ lib/xmalloc.c                    |  2 +-
+ libasm/asm_end.c                 |  2 +-
+ libasm/asm_newscn.c              |  2 +-
+ libcpu/i386_gendis.c             |  2 +-
+ libcpu/i386_lex.c                |  2 +-
+ libcpu/i386_parse.c              |  2 +-
+ libdw/Makefile.am                |  4 +++-
+ libdw/libdw_alloc.c              |  2 +-
+ libdwfl/dwfl_build_id_find_elf.c |  3 ++-
+ libdwfl/dwfl_error.c             |  4 +++-
+ libdwfl/dwfl_module_getdwarf.c   |  1 +
+ libdwfl/find-debuginfo.c         |  2 +-
+ libdwfl/libdwfl_crc32_file.c     | 10 ++++++++++
+ libdwfl/linux-kernel-modules.c   |  1 +
+ libebl/eblopenbackend.c          |  2 +-
+ libelf/elf.h                     |  8 ++++++--
+ libelf/libelf.h                  |  1 +
+ libelf/libelfP.h                 |  1 +
+ src/addr2line.c                  |  2 +-
+ src/ar.c                         |  2 +-
+ src/arlib.c                      |  2 +-
+ src/arlib2.c                     |  2 +-
+ src/elfcmp.c                     |  2 +-
+ src/elflint.c                    |  2 +-
+ src/findtextrel.c                |  2 +-
+ src/nm.c                         |  2 +-
+ src/objdump.c                    |  2 +-
+ src/ranlib.c                     |  2 +-
+ src/readelf.c                    |  2 +-
+ src/size.c                       |  2 +-
+ src/stack.c                      |  2 +-
+ src/strings.c                    |  2 +-
+ src/strip.c                      |  2 +-
+ src/unstrip.c                    |  2 +-
+ tests/addrscopes.c               |  2 +-
+ tests/allregs.c                  |  2 +-
+ tests/backtrace-data.c           |  2 +-
+ tests/backtrace-dwarf.c          |  2 +-
+ tests/backtrace.c                |  2 +-
+ tests/buildid.c                  |  2 +-
+ tests/debugaltlink.c             |  2 +-
+ tests/debuglink.c                |  2 +-
+ tests/deleted.c                  |  2 +-
+ tests/dwfl-addr-sect.c           |  2 +-
+ tests/dwfl-bug-addr-overflow.c   |  2 +-
+ tests/dwfl-bug-fd-leak.c         |  2 +-
+ tests/dwfl-bug-getmodules.c      |  2 +-
+ tests/dwfl-report-elf-align.c    |  2 +-
+ tests/dwfllines.c                |  2 +-
+ tests/dwflmodtest.c              |  2 +-
+ tests/dwflsyms.c                 |  2 +-
+ tests/early-offscn.c             |  2 +-
+ tests/ecp.c                      |  2 +-
+ tests/find-prologues.c           |  2 +-
+ tests/funcretval.c               |  2 +-
+ tests/funcscopes.c               |  2 +-
+ tests/getsrc_die.c               |  2 +-
+ tests/line2addr.c                |  2 +-
+ tests/low_high_pc.c              |  2 +-
+ tests/md5-sha1-test.c            |  2 +-
+ tests/rdwrmmap.c                 |  2 +-
+ tests/saridx.c                   |  2 +-
+ tests/sectiondump.c              |  2 +-
+ tests/varlocs.c                  |  2 +-
+ tests/vdsosyms.c                 |  2 +-
+ 70 files changed, 98 insertions(+), 64 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 2ff444e..41f77df 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -28,7 +28,7 @@ pkginclude_HEADERS = version.h
+ 
+ # Add doc back when we have some real content.
+ SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \
+-	  backends src po tests
++	  backends po tests
+ 
+ EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
+ 	     COPYING COPYING-GPLV2 COPYING-LGPLV3
+diff --git a/lib/color.c b/lib/color.c
+index fde2d9d..73292ac 100644
+--- a/lib/color.c
++++ b/lib/color.c
+@@ -32,12 +32,13 @@
+ #endif
+ 
+ #include <argp.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include "libeu.h"
++#include "system.h"
+ 
+ 
+ /* Prototype for option handler.  */
+diff --git a/lib/crc32_file.c b/lib/crc32_file.c
+index a8434d4..57e4298 100644
+--- a/lib/crc32_file.c
++++ b/lib/crc32_file.c
+@@ -35,6 +35,7 @@
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <sys/mman.h>
++#include "system.h"
+ 
+ int
+ crc32_file (int fd, uint32_t *resp)
+diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
+index dac2a5f..43016fc 100644
+--- a/lib/fixedsizehash.h
++++ b/lib/fixedsizehash.h
+@@ -30,7 +30,6 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/cdefs.h>
+ 
+ #include <system.h>
+ 
+diff --git a/lib/system.h b/lib/system.h
+index ccd99d6..0e93e60 100644
+--- a/lib/system.h
++++ b/lib/system.h
+@@ -55,6 +55,16 @@
+ #else
+ # error "Unknown byte order"
+ #endif
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++  (__extension__							      \
++    ({ long int __result;						      \
++       do __result = (long int) (expression);				      \
++       while (__result == -1L && errno == EINTR);			      \
++       __result; }))
++#endif
++
++#define error(status, errno, ...) err(status, __VA_ARGS__)
+ 
+ #ifndef MAX
+ #define MAX(m, n) ((m) < (n) ? (n) : (m))
+diff --git a/lib/xmalloc.c b/lib/xmalloc.c
+index 0cde384..217b054 100644
+--- a/lib/xmalloc.c
++++ b/lib/xmalloc.c
+@@ -30,7 +30,7 @@
+ # include <config.h>
+ #endif
+ 
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stddef.h>
+ #include <stdlib.h>
+diff --git a/libasm/asm_end.c b/libasm/asm_end.c
+index 191a535..bf5ab06 100644
+--- a/libasm/asm_end.c
++++ b/libasm/asm_end.c
+@@ -32,7 +32,7 @@
+ #endif
+ 
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+diff --git a/libasm/asm_newscn.c b/libasm/asm_newscn.c
+index ddbb25d..74a598d 100644
+--- a/libasm/asm_newscn.c
++++ b/libasm/asm_newscn.c
+@@ -32,7 +32,7 @@
+ #endif
+ 
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/libcpu/i386_gendis.c b/libcpu/i386_gendis.c
+index aae5eae..6d76016 100644
+--- a/libcpu/i386_gendis.c
++++ b/libcpu/i386_gendis.c
+@@ -31,7 +31,7 @@
+ # include <config.h>
+ #endif
+ 
+-#include <error.h>
++#include <err.h>
+ #include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+diff --git a/libcpu/i386_lex.c b/libcpu/i386_lex.c
+index b670608..b842c25 100644
+--- a/libcpu/i386_lex.c
++++ b/libcpu/i386_lex.c
+@@ -592,7 +592,7 @@ char *i386_text;
+ #endif
+ 
+ #include <ctype.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ 
+ #include <libeu.h>
+diff --git a/libcpu/i386_parse.c b/libcpu/i386_parse.c
+index 724addf..5b67802 100644
+--- a/libcpu/i386_parse.c
++++ b/libcpu/i386_parse.c
+@@ -107,7 +107,7 @@
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <inttypes.h>
+ #include <libintl.h>
+ #include <math.h>
+diff --git a/libdw/Makefile.am b/libdw/Makefile.am
+index 082d96c..51cbea0 100644
+--- a/libdw/Makefile.am
++++ b/libdw/Makefile.am
+@@ -102,6 +102,8 @@ endif
+ libdw_pic_a_SOURCES =
+ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+ 
++fts_LDADD = -lfts
++
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ 	  ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
+@@ -112,7 +114,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ 		-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
+ 		-Wl,--version-script,$<,--no-undefined \
+ 		-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
+-		-ldl -lz $(argp_LDADD) $(zip_LIBS)
++		-ldl -lz $(argp_LDADD) $(zip_LIBS) $(fts_LDADD)
+ 	@$(textrel_check)
+ 	$(AM_V_at)ln -fs $@ $@.$(VERSION)
+ 
+diff --git a/libdw/libdw_alloc.c b/libdw/libdw_alloc.c
+index 28a8cf6..29aeb3f 100644
+--- a/libdw/libdw_alloc.c
++++ b/libdw/libdw_alloc.c
+@@ -31,7 +31,7 @@
+ # include <config.h>
+ #endif
+ 
+-#include <error.h>
++#include <err.h>
+ #include <errno.h>
+ #include <stdlib.h>
+ #include "libdwP.h"
+diff --git a/libdwfl/dwfl_build_id_find_elf.c b/libdwfl/dwfl_build_id_find_elf.c
+index 903e193..b00d10c 100644
+--- a/libdwfl/dwfl_build_id_find_elf.c
++++ b/libdwfl/dwfl_build_id_find_elf.c
+@@ -27,6 +27,7 @@
+    not, see <http://www.gnu.org/licenses/>.  */
+ 
+ #include "libdwflP.h"
++#include "system.h"
+ #include <inttypes.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+@@ -94,7 +95,7 @@ __libdwfl_open_by_build_id (Dwfl_Module *mod, bool debug, char **file_name,
+ 	{
+ 	  if (*file_name != NULL)
+ 	    free (*file_name);
+-	  *file_name = canonicalize_file_name (name);
++	  *file_name = realpath (name, NULL);
+ 	  if (*file_name == NULL)
+ 	    {
+ 	      *file_name = name;
+diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c
+index 7bcf61c..c345797 100644
+--- a/libdwfl/dwfl_error.c
++++ b/libdwfl/dwfl_error.c
+@@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
+ const char *
+ dwfl_errmsg (int error)
+ {
++  static __thread char s[64] = "";
+   if (error == 0 || error == -1)
+     {
+       int last_error = global_error;
+@@ -154,7 +155,8 @@ dwfl_errmsg (int error)
+   switch (error &~ 0xffff)
+     {
+     case OTHER_ERROR (ERRNO):
+-      return strerror_r (error & 0xffff, "bad", 0);
++      strerror_r (error & 0xffff, s, sizeof(s));
++      return s;
+     case OTHER_ERROR (LIBELF):
+       return elf_errmsg (error & 0xffff);
+     case OTHER_ERROR (LIBDW):
+diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c
+index 0e8810b..82ad665 100644
+--- a/libdwfl/dwfl_module_getdwarf.c
++++ b/libdwfl/dwfl_module_getdwarf.c
+@@ -31,6 +31,7 @@
+ #include <fcntl.h>
+ #include <string.h>
+ #include <unistd.h>
++#include "system.h"
+ #include "../libdw/libdwP.h"	/* DWARF_E_* values are here.  */
+ #include "../libelf/libelfP.h"
+ 
+diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
+index 80515db..80b0148 100644
+--- a/libdwfl/find-debuginfo.c
++++ b/libdwfl/find-debuginfo.c
+@@ -385,7 +385,7 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod,
+       /* If FILE_NAME is a symlink, the debug file might be associated
+ 	 with the symlink target name instead.  */
+ 
+-      char *canon = canonicalize_file_name (file_name);
++      char *canon = realpath (file_name, NULL);
+       if (canon != NULL && strcmp (file_name, canon))
+ 	fd = find_debuginfo_in_path (mod, canon,
+ 				     debuglink_file, debuglink_crc,
+diff --git a/libdwfl/libdwfl_crc32_file.c b/libdwfl/libdwfl_crc32_file.c
+index 6b6b7d3..debc4a4 100644
+--- a/libdwfl/libdwfl_crc32_file.c
++++ b/libdwfl/libdwfl_crc32_file.c
+@@ -31,6 +31,16 @@
+ 
+ #define crc32_file attribute_hidden __libdwfl_crc32_file
+ #define crc32 __libdwfl_crc32
++
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++  (__extension__							      \
++    ({ long int __result;						      \
++       do __result = (long int) (expression);				      \
++       while (__result == -1L && errno == EINTR);			      \
++       __result; }))
++#endif
++
+ #define LIB_SYSTEM_H	1
+ #include <libdwflP.h>
+ #include "../lib/crc32_file.c"
+diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
+index 9cd8ea9..4dbf4c5 100644
+--- a/libdwfl/linux-kernel-modules.c
++++ b/libdwfl/linux-kernel-modules.c
+@@ -36,6 +36,7 @@
+ #include <config.h>
+ 
+ #include "libdwflP.h"
++#include "system.h"
+ #include <inttypes.h>
+ #include <errno.h>
+ #include <stdio.h>
+diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
+index 34d439a..56d2345 100644
+--- a/libebl/eblopenbackend.c
++++ b/libebl/eblopenbackend.c
+@@ -32,7 +32,7 @@
+ 
+ #include <assert.h>
+ #include <dlfcn.h>
+-#include <error.h>
++#include <err.h>
+ #include <libelfP.h>
+ #include <dwarf.h>
+ #include <stdlib.h>
+diff --git a/libelf/elf.h b/libelf/elf.h
+index 74654d6..81eee8b 100644
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -21,7 +21,9 @@
+ 
+ #include <features.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /* Standard ELF types.  */
+ 
+@@ -3704,6 +3706,8 @@ enum
+ #define R_BPF_NONE		0	/* No reloc */
+ #define R_BPF_MAP_FD		1	/* Map fd to pointer */
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif	/* elf.h */
+diff --git a/libelf/libelf.h b/libelf/libelf.h
+index c0d6389..38a68fd 100644
+--- a/libelf/libelf.h
++++ b/libelf/libelf.h
+@@ -29,6 +29,7 @@
+ #ifndef _LIBELF_H
+ #define _LIBELF_H 1
+ 
++#include <fcntl.h>
+ #include <stdint.h>
+ #include <sys/types.h>
+ 
+diff --git a/libelf/libelfP.h b/libelf/libelfP.h
+index 4459982..1296f20 100644
+--- a/libelf/libelfP.h
++++ b/libelf/libelfP.h
+@@ -36,6 +36,7 @@
+ 
+ #include <ar.h>
+ #include <gelf.h>
++#include <libelf.h>
+ 
+ #include <errno.h>
+ #include <stdbool.h>
+diff --git a/src/addr2line.c b/src/addr2line.c
+index 0222088..cd6a9a6 100644
+--- a/src/addr2line.c
++++ b/src/addr2line.c
+@@ -23,7 +23,7 @@
+ #include <argp.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <inttypes.h>
+ #include <libdwfl.h>
+diff --git a/src/ar.c b/src/ar.c
+index f2f322b..6e70031 100644
+--- a/src/ar.c
++++ b/src/ar.c
+@@ -22,7 +22,7 @@
+ 
+ #include <argp.h>
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <libintl.h>
+diff --git a/src/arlib.c b/src/arlib.c
+index e0839aa..1143658 100644
+--- a/src/arlib.c
++++ b/src/arlib.c
+@@ -21,7 +21,7 @@
+ #endif
+ 
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+ #include <libintl.h>
+diff --git a/src/arlib2.c b/src/arlib2.c
+index 553fc57..46443d0 100644
+--- a/src/arlib2.c
++++ b/src/arlib2.c
+@@ -20,7 +20,7 @@
+ # include <config.h>
+ #endif
+ 
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <limits.h>
+ #include <string.h>
+diff --git a/src/elfcmp.c b/src/elfcmp.c
+index 401ab31..873d253 100644
+--- a/src/elfcmp.c
++++ b/src/elfcmp.c
+@@ -23,7 +23,7 @@
+ #include <argp.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <locale.h>
+ #include <libintl.h>
+diff --git a/src/elflint.c b/src/elflint.c
+index 7d3f227..074d21c 100644
+--- a/src/elflint.c
++++ b/src/elflint.c
+@@ -24,7 +24,7 @@
+ #include <assert.h>
+ #include <byteswap.h>
+ #include <endian.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/src/findtextrel.c b/src/findtextrel.c
+index dc41502..325888c 100644
+--- a/src/findtextrel.c
++++ b/src/findtextrel.c
+@@ -23,7 +23,7 @@
+ #include <argp.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <libdw.h>
+diff --git a/src/nm.c b/src/nm.c
+index c54e96f..9e031d9 100644
+--- a/src/nm.c
++++ b/src/nm.c
+@@ -26,7 +26,7 @@
+ #include <ctype.h>
+ #include <dwarf.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/src/objdump.c b/src/objdump.c
+index fff4b81..4b1f966 100644
+--- a/src/objdump.c
++++ b/src/objdump.c
+@@ -21,7 +21,7 @@
+ #endif
+ 
+ #include <argp.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <inttypes.h>
+ #include <libintl.h>
+diff --git a/src/ranlib.c b/src/ranlib.c
+index 41a3bcf..0c7da2c 100644
+--- a/src/ranlib.c
++++ b/src/ranlib.c
+@@ -24,7 +24,7 @@
+ #include <argp.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <libintl.h>
+diff --git a/src/readelf.c b/src/readelf.c
+index d18a4b7..a6cfb35 100644
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -25,7 +25,7 @@
+ #include <ctype.h>
+ #include <dwarf.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/src/size.c b/src/size.c
+index de0d791..4639d42 100644
+--- a/src/size.c
++++ b/src/size.c
+@@ -21,7 +21,7 @@
+ #endif
+ 
+ #include <argp.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/src/stack.c b/src/stack.c
+index a5a7beb..4c075bc 100644
+--- a/src/stack.c
++++ b/src/stack.c
+@@ -18,7 +18,7 @@
+ #include <config.h>
+ #include <assert.h>
+ #include <argp.h>
+-#include <error.h>
++#include <err.h>
+ #include <stdlib.h>
+ #include <inttypes.h>
+ #include <stdio.h>
+diff --git a/src/strings.c b/src/strings.c
+index 49aab8b..09d5b1c 100644
+--- a/src/strings.c
++++ b/src/strings.c
+@@ -25,7 +25,7 @@
+ #include <ctype.h>
+ #include <endian.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/src/strip.c b/src/strip.c
+index a875ddf..fd76f7f 100644
+--- a/src/strip.c
++++ b/src/strip.c
+@@ -24,7 +24,7 @@
+ #include <assert.h>
+ #include <byteswap.h>
+ #include <endian.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <libelf.h>
+diff --git a/src/unstrip.c b/src/unstrip.c
+index d838ae9..0108272 100644
+--- a/src/unstrip.c
++++ b/src/unstrip.c
+@@ -31,7 +31,7 @@
+ #include <argp.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <fnmatch.h>
+ #include <libintl.h>
+diff --git a/tests/addrscopes.c b/tests/addrscopes.c
+index 791569f..54f4311 100644
+--- a/tests/addrscopes.c
++++ b/tests/addrscopes.c
+@@ -25,7 +25,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ 
+ 
+diff --git a/tests/allregs.c b/tests/allregs.c
+index 286f7e3..c9de089 100644
+--- a/tests/allregs.c
++++ b/tests/allregs.c
+@@ -21,7 +21,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+ #include <locale.h>
+ #include <argp.h>
+ #include <assert.h>
+diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c
+index b7158da..354fa6a 100644
+--- a/tests/backtrace-data.c
++++ b/tests/backtrace-data.c
+@@ -27,7 +27,7 @@
+ #include <dirent.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <unistd.h>
+ #include <dwarf.h>
+ #if defined(__x86_64__) && defined(__linux__)
+diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c
+index a644c8a..b8cbe27 100644
+--- a/tests/backtrace-dwarf.c
++++ b/tests/backtrace-dwarf.c
+@@ -22,7 +22,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <unistd.h>
+ #include <sys/ptrace.h>
+ #include <sys/types.h>
+diff --git a/tests/backtrace.c b/tests/backtrace.c
+index 1ff6353..47e3f7b 100644
+--- a/tests/backtrace.c
++++ b/tests/backtrace.c
+@@ -24,7 +24,7 @@
+ #include <dirent.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <unistd.h>
+ #include <dwarf.h>
+ #ifdef __linux__
+diff --git a/tests/buildid.c b/tests/buildid.c
+index 87c1877..2953e6b 100644
+--- a/tests/buildid.c
++++ b/tests/buildid.c
+@@ -23,7 +23,7 @@
+ #include ELFUTILS_HEADER(elf)
+ #include ELFUTILS_HEADER(dwelf)
+ #include <stdio.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <sys/types.h>
+diff --git a/tests/debugaltlink.c b/tests/debugaltlink.c
+index 6d97d50..ee7e559 100644
+--- a/tests/debugaltlink.c
++++ b/tests/debugaltlink.c
+@@ -23,7 +23,7 @@
+ #include ELFUTILS_HEADER(dw)
+ #include ELFUTILS_HEADER(dwelf)
+ #include <stdio.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <sys/types.h>
+diff --git a/tests/debuglink.c b/tests/debuglink.c
+index 935d102..741cb81 100644
+--- a/tests/debuglink.c
++++ b/tests/debuglink.c
+@@ -21,7 +21,7 @@
+ #include <errno.h>
+ #include ELFUTILS_HEADER(dwelf)
+ #include <stdio.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <sys/types.h>
+diff --git a/tests/deleted.c b/tests/deleted.c
+index 6be35bc..0190711 100644
+--- a/tests/deleted.c
++++ b/tests/deleted.c
+@@ -21,7 +21,7 @@
+ #include <unistd.h>
+ #include <assert.h>
+ #include <stdio.h>
+-#include <error.h>
++#include <err.h>
+ #include <errno.h>
+ #ifdef __linux__
+ #include <sys/prctl.h>
+diff --git a/tests/dwfl-addr-sect.c b/tests/dwfl-addr-sect.c
+index 21e470a..1ea1e3b 100644
+--- a/tests/dwfl-addr-sect.c
++++ b/tests/dwfl-addr-sect.c
+@@ -23,7 +23,7 @@
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+ #include <locale.h>
+ #include <argp.h>
+ #include ELFUTILS_HEADER(dwfl)
+diff --git a/tests/dwfl-bug-addr-overflow.c b/tests/dwfl-bug-addr-overflow.c
+index aa8030e..02c8bef 100644
+--- a/tests/dwfl-bug-addr-overflow.c
++++ b/tests/dwfl-bug-addr-overflow.c
+@@ -20,7 +20,7 @@
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+-#include <error.h>
++#include <err.h>
+ #include <locale.h>
+ #include ELFUTILS_HEADER(dwfl)
+ 
+diff --git a/tests/dwfl-bug-fd-leak.c b/tests/dwfl-bug-fd-leak.c
+index 689cdd7..5973da3 100644
+--- a/tests/dwfl-bug-fd-leak.c
++++ b/tests/dwfl-bug-fd-leak.c
+@@ -24,7 +24,7 @@
+ #include <dirent.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <unistd.h>
+ #include <dwarf.h>
+ 
+diff --git a/tests/dwfl-bug-getmodules.c b/tests/dwfl-bug-getmodules.c
+index 1ee989f..fd62e65 100644
+--- a/tests/dwfl-bug-getmodules.c
++++ b/tests/dwfl-bug-getmodules.c
+@@ -18,7 +18,7 @@
+ #include <config.h>
+ #include ELFUTILS_HEADER(dwfl)
+ 
+-#include <error.h>
++#include <err.h>
+ 
+ static const Dwfl_Callbacks callbacks =
+   {
+diff --git a/tests/dwfl-report-elf-align.c b/tests/dwfl-report-elf-align.c
+index a4e97d3..f471587 100644
+--- a/tests/dwfl-report-elf-align.c
++++ b/tests/dwfl-report-elf-align.c
+@@ -20,7 +20,7 @@
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+-#include <error.h>
++#include <err.h>
+ #include <locale.h>
+ #include <string.h>
+ #include <stdlib.h>
+diff --git a/tests/dwfllines.c b/tests/dwfllines.c
+index 90379dd..cbdf6c4 100644
+--- a/tests/dwfllines.c
++++ b/tests/dwfllines.c
+@@ -27,7 +27,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+ 
+ int
+ main (int argc, char *argv[])
+diff --git a/tests/dwflmodtest.c b/tests/dwflmodtest.c
+index 0027f96..e68d3bc 100644
+--- a/tests/dwflmodtest.c
++++ b/tests/dwflmodtest.c
+@@ -23,7 +23,7 @@
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+ #include <locale.h>
+ #include <argp.h>
+ #include ELFUTILS_HEADER(dwfl)
+diff --git a/tests/dwflsyms.c b/tests/dwflsyms.c
+index 49ac334..cf07830 100644
+--- a/tests/dwflsyms.c
++++ b/tests/dwflsyms.c
+@@ -25,7 +25,7 @@
+ #include <stdio.h>
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ 
+ static const char *
+diff --git a/tests/early-offscn.c b/tests/early-offscn.c
+index 924cb9e..6f60d5a 100644
+--- a/tests/early-offscn.c
++++ b/tests/early-offscn.c
+@@ -19,7 +19,7 @@
+ #endif
+ 
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <stdio.h>
+diff --git a/tests/ecp.c b/tests/ecp.c
+index 38a6859..743cea5 100644
+--- a/tests/ecp.c
++++ b/tests/ecp.c
+@@ -20,7 +20,7 @@
+ #endif
+ 
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <stdlib.h>
+diff --git a/tests/find-prologues.c b/tests/find-prologues.c
+index ba8ae37..76f5f04 100644
+--- a/tests/find-prologues.c
++++ b/tests/find-prologues.c
+@@ -25,7 +25,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <fnmatch.h>
+ 
+diff --git a/tests/funcretval.c b/tests/funcretval.c
+index 8d19d11..c8aaa93 100644
+--- a/tests/funcretval.c
++++ b/tests/funcretval.c
+@@ -25,7 +25,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <fnmatch.h>
+ 
+diff --git a/tests/funcscopes.c b/tests/funcscopes.c
+index 9c90185..dbccb89 100644
+--- a/tests/funcscopes.c
++++ b/tests/funcscopes.c
+@@ -25,7 +25,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <fnmatch.h>
+ 
+diff --git a/tests/getsrc_die.c b/tests/getsrc_die.c
+index 055aede..9c394dd 100644
+--- a/tests/getsrc_die.c
++++ b/tests/getsrc_die.c
+@@ -19,7 +19,7 @@
+ #endif
+ 
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <inttypes.h>
+ #include <libelf.h>
+diff --git a/tests/line2addr.c b/tests/line2addr.c
+index e0d65d3..9bf0023 100644
+--- a/tests/line2addr.c
++++ b/tests/line2addr.c
+@@ -26,7 +26,7 @@
+ #include <locale.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+ 
+ 
+ static void
+diff --git a/tests/low_high_pc.c b/tests/low_high_pc.c
+index d0f4302..8da4fbd 100644
+--- a/tests/low_high_pc.c
++++ b/tests/low_high_pc.c
+@@ -25,7 +25,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <fnmatch.h>
+ 
+diff --git a/tests/md5-sha1-test.c b/tests/md5-sha1-test.c
+index d50355e..3c41f40 100644
+--- a/tests/md5-sha1-test.c
++++ b/tests/md5-sha1-test.c
+@@ -19,7 +19,7 @@
+ #endif
+ 
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+ 
+ #include "md5.h"
+ #include "sha1.h"
+diff --git a/tests/rdwrmmap.c b/tests/rdwrmmap.c
+index 6f027df..1ce5e6e 100644
+--- a/tests/rdwrmmap.c
++++ b/tests/rdwrmmap.c
+@@ -19,7 +19,7 @@
+ #endif
+ 
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+diff --git a/tests/saridx.c b/tests/saridx.c
+index 8a450d8..b387801 100644
+--- a/tests/saridx.c
++++ b/tests/saridx.c
+@@ -17,7 +17,7 @@
+ 
+ #include <config.h>
+ 
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <stdio.h>
+diff --git a/tests/sectiondump.c b/tests/sectiondump.c
+index 3033fed..8e888db 100644
+--- a/tests/sectiondump.c
++++ b/tests/sectiondump.c
+@@ -18,7 +18,7 @@
+ #include <config.h>
+ 
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/tests/varlocs.c b/tests/varlocs.c
+index c3fba89..e043ea2 100644
+--- a/tests/varlocs.c
++++ b/tests/varlocs.c
+@@ -25,7 +25,7 @@
+ #include <dwarf.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+diff --git a/tests/vdsosyms.c b/tests/vdsosyms.c
+index b876c10..afb2823 100644
+--- a/tests/vdsosyms.c
++++ b/tests/vdsosyms.c
+@@ -18,7 +18,7 @@
+ #include <config.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <string.h>
+-- 
+2.8.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-fix-a-stack-usage-warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/0001-fix-a-stack-usage-warning.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-fix-a-stack-usage-warning.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/0001-fix-a-stack-usage-warning.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-remove-the-unneed-checking.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/0001-remove-the-unneed-checking.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-remove-the-unneed-checking.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/0001-remove-the-unneed-checking.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/Fix_one_GCC7_warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/Fix_one_GCC7_warning.patch
new file mode 100644
index 0000000..d88f4eb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/Fix_one_GCC7_warning.patch
@@ -0,0 +1,44 @@
+From 93c51144c3f664d4e9709da75a1d0fa00ea0fe95 Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mark@klomp.org>
+Date: Sun, 12 Feb 2017 21:51:34 +0100
+Subject: [PATCH] libasm: Fix one GCC7 -Wformat-truncation=2 warning.
+
+Make sure that if we have really lots of labels the tempsym doesn't get
+truncated because it is too small to hold the whole name.
+
+This doesn't enable -Wformat-truncation=2 or fix other "issues" pointed
+out by enabling this warning because there are currently some issues
+with it. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79448
+
+Signed-off-by: Mark Wielaard <mark@klomp.org>
+
+Upstream-Status: Backport (https://sourceware.org/git/?p=elfutils.git;a=commit;h=93c51144c3f664d4e9709da75a1d0fa00ea0fe95)
+Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
+
+---
+ libasm/ChangeLog    | 6 +++++-
+ libasm/asm_newsym.c | 6 ++++--
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+Index: elfutils-0.168/libasm/asm_newsym.c
+===================================================================
+--- elfutils-0.168.orig/libasm/asm_newsym.c
++++ elfutils-0.168/libasm/asm_newsym.c
+@@ -1,5 +1,5 @@
+ /* Define new symbol for current position in given section.
+-   Copyright (C) 2002, 2005, 2016 Red Hat, Inc.
++   Copyright (C) 2002, 2005, 2016, 2017 Red Hat, Inc.
+    This file is part of elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
+ 
+@@ -44,7 +44,9 @@ AsmSym_t *
+ asm_newsym (AsmScn_t *asmscn, const char *name, GElf_Xword size,
+ 	    int type, int binding)
+ {
+-#define TEMPSYMLEN 10
++/* We don't really expect labels with many digits, but in theory it could
++   be 10 digits (plus ".L" and a zero terminator).  */
++#define TEMPSYMLEN 13
+   char tempsym[TEMPSYMLEN];
+   AsmSym_t *result;
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/aarch64_uio.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/aarch64_uio.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/aarch64_uio.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/aarch64_uio.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch
new file mode 100644
index 0000000..e0291b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch
@@ -0,0 +1,35 @@
+From 77cb4a53c270d5854d3af24f19547bc3de825233 Mon Sep 17 00:00:00 2001
+From: James Cowgill <james410@cowgill.org.uk>
+Date: Mon, 5 Jan 2015 15:16:58 +0000
+Subject: [PATCH 1/3] Ignore differences between mips machine identifiers
+
+Little endian binaries actually use EM_MIPS so you can't tell the endianness
+from the elf machine id. Also, the EM_MIPS_RS3_LE machine is dead anyway (the
+kernel will not load binaries containing it).
+
+Signed-off-by: James Cowgill <james410@cowgill.org.uk>
+
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+---
+ backends/mips_init.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+Index: b/backends/mips_init.c
+===================================================================
+--- a/backends/mips_init.c
++++ b/backends/mips_init.c
+@@ -45,11 +45,7 @@ mips_init (Elf *elf __attribute__ ((unus
+     return NULL;
+ 
+   /* We handle it.  */
+-  if (machine == EM_MIPS)
+-    eh->name = "MIPS R3000 big-endian";
+-  else if (machine == EM_MIPS_RS3_LE)
+-    eh->name = "MIPS R3000 little-endian";
+-
++  eh->name = "MIPS";
+   mips_init_reloc (eh);
+   HOOK (eh, reloc_simple_type);
+   HOOK (eh, return_value_location);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
new file mode 100644
index 0000000..b17498f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
@@ -0,0 +1,171 @@
+From fdaab18a65ed2529656baa64cb6169f34d7e507b Mon Sep 17 00:00:00 2001
+From: James Cowgill <james410@cowgill.org.uk>
+Date: Mon, 5 Jan 2015 15:17:01 +0000
+Subject: [PATCH 2/3] Add support for mips64 abis in mips_retval.c
+
+Signed-off-by: James Cowgill <james410@cowgill.org.uk>
+
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ backends/mips_retval.c | 104 ++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 94 insertions(+), 10 deletions(-)
+
+diff --git a/backends/mips_retval.c b/backends/mips_retval.c
+index 33f12a7..d5c6ef0 100644
+--- a/backends/mips_retval.c
++++ b/backends/mips_retval.c
+@@ -91,6 +91,8 @@ enum mips_abi find_mips_abi(Elf *elf)
+     default:
+       if ((elf_flags & EF_MIPS_ABI2))
+ 	return MIPS_ABI_N32;
++      else if ((ehdr->e_ident[EI_CLASS] == ELFCLASS64))
++	return MIPS_ABI_N64;
+     }
+ 
+   /* GCC creates a pseudo-section whose name describes the ABI.  */
+@@ -195,6 +197,57 @@ static const Dwarf_Op loc_aggregate[] =
+   };
+ #define nloc_aggregate 1
+ 
++/* Test if a struct member is a float */
++static int is_float_child(Dwarf_Die *childdie)
++{
++  /* Test if this is actually a struct member */
++  if (dwarf_tag(childdie) != DW_TAG_member)
++    return 0;
++
++  /* Get type of member */
++  Dwarf_Attribute attr_mem;
++  Dwarf_Die child_type_mem;
++  Dwarf_Die *child_typedie =
++    dwarf_formref_die(dwarf_attr_integrate(childdie,
++                                           DW_AT_type,
++                                           &attr_mem), &child_type_mem);
++
++  if (dwarf_tag(child_typedie) != DW_TAG_base_type)
++    return 0;
++
++  /* Get base subtype */
++  Dwarf_Word encoding;
++  if (dwarf_formudata (dwarf_attr_integrate (child_typedie,
++                                             DW_AT_encoding,
++                                             &attr_mem), &encoding) != 0)
++    return 0;
++
++  return encoding == DW_ATE_float;
++}
++
++/* Returns the number of fpregs which can be returned in the given struct */
++static int get_struct_fpregs(Dwarf_Die *structtypedie)
++{
++  Dwarf_Die child_mem;
++  int fpregs = 0;
++
++  /* Get first structure member */
++  if (dwarf_child(structtypedie, &child_mem) != 0)
++    return 0;
++
++  do
++    {
++      /* Ensure this register is a float */
++      if (!is_float_child(&child_mem))
++        return 0;
++
++      fpregs++;
++    }
++  while (dwarf_siblingof (&child_mem, &child_mem) == 0);
++
++  return fpregs;
++}
++
+ int
+ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ {
+@@ -240,6 +293,7 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+       tag = dwarf_tag (typedie);
+     }
+ 
++  Dwarf_Word size;
+   switch (tag)
+     {
+     case -1:
+@@ -258,8 +312,6 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+     case DW_TAG_enumeration_type:
+     case DW_TAG_pointer_type:
+     case DW_TAG_ptr_to_member_type:
+-      {
+-        Dwarf_Word size;
+ 	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ 					 &attr_mem), &size) != 0)
+ 	  {
+@@ -289,7 +341,7 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ 		if (size <= 4*regsize && abi == MIPS_ABI_O32)
+                   return nloc_fpregquad;
+ 
+-		goto aggregate;
++		goto large;
+ 	      }
+ 	  }
+ 	*locp = ABI_LOC(loc_intreg, regsize);
+@@ -298,18 +350,50 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ 	if (size <= 2*regsize)
+ 	  return nloc_intregpair;
+ 
+-	/* Else fall through. Shouldn't happen though (at least with gcc) */
+-      }
++	/* Else pass in memory. Shouldn't happen though (at least with gcc) */
++	goto large;
+ 
+     case DW_TAG_structure_type:
+     case DW_TAG_class_type:
+     case DW_TAG_union_type:
+-    case DW_TAG_array_type:
+-    aggregate:
+-      /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
+-      if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64))
+-        return -2;
++      /* Handle special cases for structures <= 128 bytes in newer ABIs */
++      if (abi == MIPS_ABI_EABI32 || abi == MIPS_ABI_EABI64 ||
++          abi == MIPS_ABI_N32 || abi == MIPS_ABI_N64)
++        {
++          if (dwarf_aggregate_size (typedie, &size) == 0 && size <= 16)
++            {
++              /*
++               * Special case in N64 / N32 -
++               * structures containing only floats are returned in fp regs.
++               * Everything else is returned in integer regs.
++               */
++              if (tag != DW_TAG_union_type &&
++                  (abi == MIPS_ABI_N32 || abi == MIPS_ABI_N64))
++                {
++                  int num_fpregs = get_struct_fpregs(typedie);
++                  if (num_fpregs == 1 || num_fpregs == 2)
++                    {
++                      *locp = loc_fpreg;
++                      if (num_fpregs == 1)
++                        return nloc_fpreg;
++                      else
++                        return nloc_fpregpair;
++                    }
++                }
++
++              *locp = loc_intreg;
++              if (size <= 8)
++                return nloc_intreg;
++              else
++                return nloc_intregpair;
++            }
++        }
++
++      /* Fallthrough to handle large types */
+ 
++    case DW_TAG_array_type:
++    large:
++      /* Return large structures in memory */
+       *locp = loc_aggregate;
+       return nloc_aggregate;
+     }
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/0003-Add-mips-n64-relocation-format-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/0003-Add-mips-n64-relocation-format-hack.patch
new file mode 100644
index 0000000..2a5f862
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/0003-Add-mips-n64-relocation-format-hack.patch
@@ -0,0 +1,229 @@
+From 59d4b8c48e5040af7e02b34eb26ea602ec82a38e Mon Sep 17 00:00:00 2001
+From: James Cowgill <james410@cowgill.org.uk>
+Date: Mon, 5 Jan 2015 15:17:02 +0000
+Subject: [PATCH 3/3] Add mips n64 relocation format hack
+
+MIPSEL N64 ELF files use a slightly different format for storing relocation
+entries which is incompatible with the normal R_SYM / R_INFO macros.
+To workaround this, we rearrange the bytes in the relocation's r_info field
+when reading and writing the relocations.
+
+This patch also ensures that strip.c sets the correct value of e_machine
+before manipulating relocations so that these changes take effect.
+
+Signed-off-by: James Cowgill <james410@cowgill.org.uk>
+
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libelf/gelf_getrel.c      | 25 +++++++++++++++++++++++--
+ libelf/gelf_getrela.c     | 25 +++++++++++++++++++++++--
+ libelf/gelf_update_rel.c  | 20 +++++++++++++++++++-
+ libelf/gelf_update_rela.c | 20 +++++++++++++++++++-
+ src/strip.c               | 17 +++++++++++++++++
+ 5 files changed, 101 insertions(+), 6 deletions(-)
+
+Index: b/libelf/gelf_getrel.c
+===================================================================
+--- a/libelf/gelf_getrel.c
++++ b/libelf/gelf_getrel.c
+@@ -36,6 +36,7 @@
+ 
+ #include "libelfP.h"
+ 
++#define EF_MIPS_ABI	0x0000F000
+ 
+ GElf_Rel *
+ gelf_getrel (Elf_Data *data, int ndx, GElf_Rel *dst)
+@@ -89,8 +90,28 @@ gelf_getrel (Elf_Data *data, int ndx, GE
+ 	  result = NULL;
+ 	}
+       else
+-	result = memcpy (dst, &((Elf64_Rel *) data_scn->d.d_buf)[ndx],
+-			 sizeof (Elf64_Rel));
++        {
++          GElf_Ehdr hdr;
++          result = memcpy (dst, &((Elf64_Rel *) data_scn->d.d_buf)[ndx],
++                           sizeof (Elf64_Rel));
++
++          if (gelf_getehdr(scn->elf, &hdr) != NULL &&
++              hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
++              hdr.e_machine == EM_MIPS &&
++              (hdr.e_flags & EF_MIPS_ABI) == 0)
++            {
++              /*
++               * The relocation format is mangled on MIPSEL N64
++               *  We'll adjust it so at least R_SYM will work on it
++               */
++              GElf_Xword r_info = dst->r_info;
++              dst->r_info = (r_info << 32) |
++                            ((r_info >> 8) & 0xFF000000) |
++                            ((r_info >> 24) & 0x00FF0000) |
++                            ((r_info >> 40) & 0x0000FF00) |
++                            ((r_info >> 56) & 0x000000FF);
++            }
++        }
+     }
+ 
+   rwlock_unlock (scn->elf->lock);
+Index: b/libelf/gelf_getrela.c
+===================================================================
+--- a/libelf/gelf_getrela.c
++++ b/libelf/gelf_getrela.c
+@@ -36,6 +36,7 @@
+ 
+ #include "libelfP.h"
+ 
++#define EF_MIPS_ABI	0x0000F000
+ 
+ GElf_Rela *
+ gelf_getrela (Elf_Data *data, int ndx, GElf_Rela *dst)
+@@ -90,8 +91,28 @@ gelf_getrela (Elf_Data *data, int ndx, G
+ 	  result = NULL;
+ 	}
+       else
+-	result = memcpy (dst, &((Elf64_Rela *) data_scn->d.d_buf)[ndx],
+-			 sizeof (Elf64_Rela));
++        {
++          GElf_Ehdr hdr;
++          result = memcpy (dst, &((Elf64_Rela *) data_scn->d.d_buf)[ndx],
++                           sizeof (Elf64_Rela));
++
++          if (gelf_getehdr(scn->elf, &hdr) != NULL &&
++              hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
++              hdr.e_machine == EM_MIPS &&
++              (hdr.e_flags & EF_MIPS_ABI) == 0)
++            {
++              /*
++               * The relocation format is mangled on MIPSEL N64
++               *  We'll adjust it so at least R_SYM will work on it
++               */
++              GElf_Xword r_info = dst->r_info;
++              dst->r_info = (r_info << 32) |
++                            ((r_info >> 8) & 0xFF000000) |
++                            ((r_info >> 24) & 0x00FF0000) |
++                            ((r_info >> 40) & 0x0000FF00) |
++                            ((r_info >> 56) & 0x000000FF);
++            }
++        }
+     }
+ 
+   rwlock_unlock (scn->elf->lock);
+Index: b/libelf/gelf_update_rel.c
+===================================================================
+--- a/libelf/gelf_update_rel.c
++++ b/libelf/gelf_update_rel.c
+@@ -36,6 +36,7 @@
+ 
+ #include "libelfP.h"
+ 
++#define EF_MIPS_ABI	0x0000F000
+ 
+ int
+ gelf_update_rel (Elf_Data *dst, int ndx, GElf_Rel *src)
+@@ -86,6 +87,9 @@ gelf_update_rel (Elf_Data *dst, int ndx,
+     }
+   else
+     {
++      GElf_Ehdr hdr;
++      GElf_Rel value = *src;
++
+       /* Check whether we have to resize the data buffer.  */
+       if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
+ 	{
+@@ -93,7 +97,21 @@ gelf_update_rel (Elf_Data *dst, int ndx,
+ 	  goto out;
+ 	}
+ 
+-      ((Elf64_Rel *) data_scn->d.d_buf)[ndx] = *src;
++      if (gelf_getehdr(scn->elf, &hdr) != NULL &&
++          hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
++          hdr.e_machine == EM_MIPS &&
++          (hdr.e_flags & EF_MIPS_ABI) == 0)
++        {
++          /* Undo the MIPSEL N64 hack from gelf_getrel */
++          GElf_Xword r_info = value.r_info;
++          value.r_info = (r_info >> 32) |
++                         ((r_info << 8) &  0x000000FF00000000) |
++                         ((r_info << 24) & 0x0000FF0000000000) |
++                         ((r_info << 40) & 0x00FF000000000000) |
++                         ((r_info << 56) & 0xFF00000000000000);
++        }
++
++      ((Elf64_Rel *) data_scn->d.d_buf)[ndx] = value;
+     }
+ 
+   result = 1;
+Index: b/libelf/gelf_update_rela.c
+===================================================================
+--- a/libelf/gelf_update_rela.c
++++ b/libelf/gelf_update_rela.c
+@@ -36,6 +36,7 @@
+ 
+ #include "libelfP.h"
+ 
++#define EF_MIPS_ABI	0x0000F000
+ 
+ int
+ gelf_update_rela (Elf_Data *dst, int ndx, GElf_Rela *src)
+@@ -89,6 +90,9 @@ gelf_update_rela (Elf_Data *dst, int ndx
+     }
+   else
+     {
++      GElf_Ehdr hdr;
++      GElf_Rela value = *src;
++
+       /* Check whether we have to resize the data buffer.  */
+       if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
+ 	{
+@@ -96,7 +100,21 @@ gelf_update_rela (Elf_Data *dst, int ndx
+ 	  goto out;
+ 	}
+ 
+-      ((Elf64_Rela *) data_scn->d.d_buf)[ndx] = *src;
++      if (gelf_getehdr(scn->elf, &hdr) != NULL &&
++          hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
++          hdr.e_machine == EM_MIPS &&
++          (hdr.e_flags & EF_MIPS_ABI) == 0)
++        {
++          /* Undo the MIPSEL N64 hack from gelf_getrel */
++          GElf_Xword r_info = value.r_info;
++          value.r_info = (r_info >> 32) |
++                         ((r_info << 8) &  0x000000FF00000000) |
++                         ((r_info << 24) & 0x0000FF0000000000) |
++                         ((r_info << 40) & 0x00FF000000000000) |
++                         ((r_info << 56) & 0xFF00000000000000);
++        }
++
++      ((Elf64_Rela *) data_scn->d.d_buf)[ndx] = value;
+     }
+ 
+   result = 1;
+Index: b/src/strip.c
+===================================================================
+--- a/src/strip.c
++++ b/src/strip.c
+@@ -532,6 +532,23 @@ handle_elf (int fd, Elf *elf, const char
+       goto fail;
+     }
+ 
++  /* Copy identity part of the ELF header now */
++  newehdr = gelf_getehdr (newelf, &newehdr_mem);
++  if (newehdr == NULL)
++    INTERNAL_ERROR (fname);
++
++  memcpy (newehdr->e_ident, ehdr->e_ident, EI_NIDENT);
++  newehdr->e_type = ehdr->e_type;
++  newehdr->e_machine = ehdr->e_machine;
++  newehdr->e_version = ehdr->e_version;
++
++  if (gelf_update_ehdr (newelf, newehdr) == 0)
++    {
++      error (0, 0, gettext ("%s: error while creating ELF header: %s"),
++	     fname, elf_errmsg (-1));
++      return 1;
++    }
++
+   /* Copy over the old program header if needed.  */
+   if (ehdr->e_type != ET_REL)
+     for (cnt = 0; cnt < phnum; ++cnt)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/arm_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/arm_backend.diff
new file mode 100644
index 0000000..50f4b05
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/arm_backend.diff
@@ -0,0 +1,603 @@
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Index: b/backends/arm_init.c
+===================================================================
+--- a/backends/arm_init.c
++++ b/backends/arm_init.c
+@@ -35,20 +35,31 @@
+ #define RELOC_PREFIX	R_ARM_
+ #include "libebl_CPU.h"
+ 
++#include "libebl_arm.h"
++
+ /* This defines the common reloc hooks based on arm_reloc.def.  */
+ #include "common-reloc.c"
+ 
+ 
+ const char *
+-arm_init (Elf *elf __attribute__ ((unused)),
++arm_init (Elf *elf,
+ 	  GElf_Half machine __attribute__ ((unused)),
+ 	  Ebl *eh,
+ 	  size_t ehlen)
+ {
++  int soft_float = 0;
++
+   /* Check whether the Elf_BH object has a sufficent size.  */
+   if (ehlen < sizeof (Ebl))
+     return NULL;
+ 
++  if (elf) {
++    GElf_Ehdr ehdr_mem;
++    GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++    if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT))
++      soft_float = 1;
++  }
++
+   /* We handle it.  */
+   eh->name = "ARM";
+   arm_init_reloc (eh);
+@@ -60,7 +71,10 @@ arm_init (Elf *elf __attribute__ ((unuse
+   HOOK (eh, core_note);
+   HOOK (eh, auxv_info);
+   HOOK (eh, check_object_attribute);
+-  HOOK (eh, return_value_location);
++  if (soft_float)
++    eh->return_value_location = arm_return_value_location_soft;
++  else
++    eh->return_value_location = arm_return_value_location_hard;
+   HOOK (eh, abi_cfi);
+   HOOK (eh, check_reloc_target_type);
+   HOOK (eh, symbol_type_name);
+Index: b/backends/arm_regs.c
+===================================================================
+--- a/backends/arm_regs.c
++++ b/backends/arm_regs.c
+@@ -31,6 +31,7 @@
+ #endif
+ 
+ #include <string.h>
++#include <stdio.h>
+ #include <dwarf.h>
+ 
+ #define BACKEND arm_
+@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute_
+       break;
+ 
+     case 16 + 0 ... 16 + 7:
++      /* AADWARF says that there are no registers in that range,
++       * but gcc maps FPA registers here
++       */
+       regno += 96 - 16;
+       /* Fall through.  */
+     case 96 + 0 ... 96 + 7:
+@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute_
+       namelen = 2;
+       break;
+ 
++    case 64 + 0 ... 64 + 9:
++      *setname = "VFP";
++      *bits = 32;
++      *type = DW_ATE_float;
++      name[0] = 's';
++      name[1] = regno - 64 + '0';
++      namelen = 2;
++      break;
++
++    case 64 + 10 ... 64 + 31:
++      *setname = "VFP";
++      *bits = 32;
++      *type = DW_ATE_float;
++      name[0] = 's';
++      name[1] = (regno - 64) / 10 + '0';
++      name[2] = (regno - 64) % 10 + '0';
++      namelen = 3;
++      break;
++
++    case 104 + 0 ... 104 + 7:
++      /* XXX TODO:
++       * This can be either intel wireless MMX general purpose/control
++       * registers or xscale accumulator, which have different usage.
++       * We only have the intel wireless MMX here now.
++       * The name needs to be changed for the xscale accumulator too. */
++      *setname = "MMX";
++      *type = DW_ATE_unsigned;
++      *bits = 32;
++      memcpy(name, "wcgr", 4);
++      name[4] = regno - 104 + '0';
++      namelen = 5;
++      break;
++
++    case 112 + 0 ... 112 + 9:
++      *setname = "MMX";
++      *type = DW_ATE_unsigned;
++      *bits = 64;
++      name[0] = 'w';
++      name[1] = 'r';
++      name[2] = regno - 112 + '0';
++      namelen = 3;
++      break;
++
++    case 112 + 10 ... 112 + 15:
++      *setname = "MMX";
++      *type = DW_ATE_unsigned;
++      *bits = 64;
++      name[0] = 'w';
++      name[1] = 'r';
++      name[2] = '1';
++      name[3] = regno - 112 - 10 + '0';
++      namelen = 4;
++      break;
++
+     case 128:
++      *setname = "state";
+       *type = DW_ATE_unsigned;
+       return stpcpy (name, "spsr") + 1 - name;
+ 
++    case 129:
++      *setname = "state";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_fiq") + 1 - name;
++
++    case 130:
++      *setname = "state";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_irq") + 1 - name;
++
++    case 131:
++      *setname = "state";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_abt") + 1 - name;
++
++    case 132:
++      *setname = "state";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_und") + 1 - name;
++
++    case 133:
++      *setname = "state";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_svc") + 1 - name;
++
++    case 144 ... 150:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_usr", regno - 144 + 8) + 1;
++
++    case 151 ... 157:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1;
++
++    case 158 ... 159:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_irq", regno - 158 + 13) + 1;
++
++    case 160 ... 161:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_abt", regno - 160 + 13) + 1;
++
++    case 162 ... 163:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_und", regno - 162 + 13) + 1;
++
++    case 164 ... 165:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_svc", regno - 164 + 13) + 1;
++
++    case 192 ... 199:
++     *setname = "MMX";
++      *bits = 32;
++      *type = DW_ATE_unsigned;
++      name[0] = 'w';
++      name[1] = 'c';
++      name[2] = regno - 192 + '0';
++      namelen = 3;
++      break;
++
+     case 256 + 0 ... 256 + 9:
++      /* XXX TODO: Neon also uses those registers and can contain
++       * both float and integers */
+       *setname = "VFP";
+       *type = DW_ATE_float;
+       *bits = 64;
+Index: b/backends/arm_retval.c
+===================================================================
+--- a/backends/arm_retval.c
++++ b/backends/arm_retval.c
+@@ -48,6 +48,13 @@ static const Dwarf_Op loc_intreg[] =
+ #define nloc_intreg	1
+ #define nloc_intregs(n)	(2 * (n))
+ 
++/* f1  */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */
++static const Dwarf_Op loc_fpreg[] =
++  {
++    { .atom = DW_OP_reg16 },
++  };
++#define nloc_fpreg  1
++
+ /* The return value is a structure and is actually stored in stack space
+    passed in a hidden argument by the caller.  But, the compiler
+    helpfully returns the address of that space in r0.  */
+@@ -58,8 +65,9 @@ static const Dwarf_Op loc_aggregate[] =
+ #define nloc_aggregate 1
+ 
+ 
+-int
+-arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++static int
++arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp,
++		            int soft_float)
+ {
+   /* Start with the function's type, and get the DW_AT_type attribute,
+      which is the type of the return value.  */
+@@ -98,6 +106,21 @@ arm_return_value_location (Dwarf_Die *fu
+ 	    else
+ 	      return -1;
+ 	  }
++	if (tag == DW_TAG_base_type)
++	  {
++	    Dwarf_Word encoding;
++	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++				 &attr_mem), &encoding) != 0)
++	      return -1;
++
++	    if ((encoding == DW_ATE_float) && !soft_float)
++	      {
++		*locp = loc_fpreg;
++		if (size <= 8)
++		  return nloc_fpreg;
++		goto aggregate;
++	      }
++	  }
+ 	if (size <= 16)
+ 	  {
+ 	  intreg:
+@@ -106,6 +129,7 @@ arm_return_value_location (Dwarf_Die *fu
+ 	  }
+ 
+       aggregate:
++	/* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */
+ 	*locp = loc_aggregate;
+ 	return nloc_aggregate;
+       }
+@@ -125,3 +149,18 @@ arm_return_value_location (Dwarf_Die *fu
+      DWARF and might be valid.  */
+   return -2;
+ }
++
++/* return location for -mabi=apcs-gnu -msoft-float */
++int
++arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++   return arm_return_value_location_ (functypedie, locp, 1);
++}
++
++/* return location for -mabi=apcs-gnu -mhard-float (current default) */
++int
++arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++   return arm_return_value_location_ (functypedie, locp, 0);
++}
++
+Index: b/libelf/elf.h
+===================================================================
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -2593,6 +2593,9 @@ enum
+ #define EF_ARM_EABI_VER4	0x04000000
+ #define EF_ARM_EABI_VER5	0x05000000
+ 
++/* EI_OSABI values */
++#define ELFOSABI_ARM_AEABI    64      /* Contains symbol versioning. */
++
+ /* Additional symbol types for Thumb.  */
+ #define STT_ARM_TFUNC		STT_LOPROC /* A Thumb function.  */
+ #define STT_ARM_16BIT		STT_HIPROC /* A Thumb label.  */
+@@ -2610,12 +2613,19 @@ enum
+ 
+ /* Processor specific values for the Phdr p_type field.  */
+ #define PT_ARM_EXIDX		(PT_LOPROC + 1)	/* ARM unwind segment.  */
++#define PT_ARM_UNWIND		PT_ARM_EXIDX
+ 
+ /* Processor specific values for the Shdr sh_type field.  */
+ #define SHT_ARM_EXIDX		(SHT_LOPROC + 1) /* ARM unwind section.  */
+ #define SHT_ARM_PREEMPTMAP	(SHT_LOPROC + 2) /* Preemption details.  */
+ #define SHT_ARM_ATTRIBUTES	(SHT_LOPROC + 3) /* ARM attributes section.  */
+ 
++/* Processor specific values for the Dyn d_tag field.  */
++#define DT_ARM_RESERVED1	(DT_LOPROC + 0)
++#define DT_ARM_SYMTABSZ		(DT_LOPROC + 1)
++#define DT_ARM_PREEMTMAB	(DT_LOPROC + 2)
++#define DT_ARM_RESERVED2	(DT_LOPROC + 3)
++#define DT_ARM_NUM		4
+ 
+ /* AArch64 relocs.  */
+ 
+@@ -2908,6 +2918,7 @@ enum
+ 					   TLS block (LDR, STR).  */
+ #define R_ARM_TLS_IE12GP	111	/* 12 bit GOT entry relative
+ 					   to GOT origin (LDR).  */
++/* 112 - 127 private range */
+ #define R_ARM_ME_TOO		128	/* Obsolete.  */
+ #define R_ARM_THM_TLS_DESCSEQ	129
+ #define R_ARM_THM_TLS_DESCSEQ16	129
+Index: b/backends/libebl_arm.h
+===================================================================
+--- /dev/null
++++ b/backends/libebl_arm.h
+@@ -0,0 +1,9 @@
++#ifndef _LIBEBL_ARM_H
++#define _LIBEBL_ARM_H 1
++
++#include <libdw.h>
++
++extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
++extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
++
++#endif
+Index: b/tests/run-allregs.sh
+===================================================================
+--- a/tests/run-allregs.sh
++++ b/tests/run-allregs.sh
+@@ -2672,7 +2672,28 @@ integer registers:
+ 	 13: sp (sp), address 32 bits
+ 	 14: lr (lr), address 32 bits
+ 	 15: pc (pc), address 32 bits
+-	128: spsr (spsr), unsigned 32 bits
++	144: r8_usr (r8_usr), signed 32 bits
++	145: r9_usr (r9_usr), signed 32 bits
++	146: r10_usr (r10_usr), signed 32 bits
++	147: r11_usr (r11_usr), signed 32 bits
++	148: r12_usr (r12_usr), signed 32 bits
++	149: r13_usr (r13_usr), signed 32 bits
++	150: r14_usr (r14_usr), signed 32 bits
++	151: r8_fiq (r8_fiq), signed 32 bits
++	152: r9_fiq (r9_fiq), signed 32 bits
++	153: r10_fiq (r10_fiq), signed 32 bits
++	154: r11_fiq (r11_fiq), signed 32 bits
++	155: r12_fiq (r12_fiq), signed 32 bits
++	156: r13_fiq (r13_fiq), signed 32 bits
++	157: r14_fiq (r14_fiq), signed 32 bits
++	158: r13_irq (r13_irq), signed 32 bits
++	159: r14_irq (r14_irq), signed 32 bits
++	160: r13_abt (r13_abt), signed 32 bits
++	161: r14_abt (r14_abt), signed 32 bits
++	162: r13_und (r13_und), signed 32 bits
++	163: r14_und (r14_und), signed 32 bits
++	164: r13_svc (r13_svc), signed 32 bits
++	165: r14_svc (r14_svc), signed 32 bits
+ FPA registers:
+ 	 16: f0 (f0), float 96 bits
+ 	 17: f1 (f1), float 96 bits
+@@ -2690,7 +2711,72 @@ FPA registers:
+ 	101: f5 (f5), float 96 bits
+ 	102: f6 (f6), float 96 bits
+ 	103: f7 (f7), float 96 bits
++MMX registers:
++	104: wcgr0 (wcgr0), unsigned 32 bits
++	105: wcgr1 (wcgr1), unsigned 32 bits
++	106: wcgr2 (wcgr2), unsigned 32 bits
++	107: wcgr3 (wcgr3), unsigned 32 bits
++	108: wcgr4 (wcgr4), unsigned 32 bits
++	109: wcgr5 (wcgr5), unsigned 32 bits
++	110: wcgr6 (wcgr6), unsigned 32 bits
++	111: wcgr7 (wcgr7), unsigned 32 bits
++	112: wr0 (wr0), unsigned 64 bits
++	113: wr1 (wr1), unsigned 64 bits
++	114: wr2 (wr2), unsigned 64 bits
++	115: wr3 (wr3), unsigned 64 bits
++	116: wr4 (wr4), unsigned 64 bits
++	117: wr5 (wr5), unsigned 64 bits
++	118: wr6 (wr6), unsigned 64 bits
++	119: wr7 (wr7), unsigned 64 bits
++	120: wr8 (wr8), unsigned 64 bits
++	121: wr9 (wr9), unsigned 64 bits
++	122: wr10 (wr10), unsigned 64 bits
++	123: wr11 (wr11), unsigned 64 bits
++	124: wr12 (wr12), unsigned 64 bits
++	125: wr13 (wr13), unsigned 64 bits
++	126: wr14 (wr14), unsigned 64 bits
++	127: wr15 (wr15), unsigned 64 bits
++	192: wc0 (wc0), unsigned 32 bits
++	193: wc1 (wc1), unsigned 32 bits
++	194: wc2 (wc2), unsigned 32 bits
++	195: wc3 (wc3), unsigned 32 bits
++	196: wc4 (wc4), unsigned 32 bits
++	197: wc5 (wc5), unsigned 32 bits
++	198: wc6 (wc6), unsigned 32 bits
++	199: wc7 (wc7), unsigned 32 bits
+ VFP registers:
++	 64: s0 (s0), float 32 bits
++	 65: s1 (s1), float 32 bits
++	 66: s2 (s2), float 32 bits
++	 67: s3 (s3), float 32 bits
++	 68: s4 (s4), float 32 bits
++	 69: s5 (s5), float 32 bits
++	 70: s6 (s6), float 32 bits
++	 71: s7 (s7), float 32 bits
++	 72: s8 (s8), float 32 bits
++	 73: s9 (s9), float 32 bits
++	 74: s10 (s10), float 32 bits
++	 75: s11 (s11), float 32 bits
++	 76: s12 (s12), float 32 bits
++	 77: s13 (s13), float 32 bits
++	 78: s14 (s14), float 32 bits
++	 79: s15 (s15), float 32 bits
++	 80: s16 (s16), float 32 bits
++	 81: s17 (s17), float 32 bits
++	 82: s18 (s18), float 32 bits
++	 83: s19 (s19), float 32 bits
++	 84: s20 (s20), float 32 bits
++	 85: s21 (s21), float 32 bits
++	 86: s22 (s22), float 32 bits
++	 87: s23 (s23), float 32 bits
++	 88: s24 (s24), float 32 bits
++	 89: s25 (s25), float 32 bits
++	 90: s26 (s26), float 32 bits
++	 91: s27 (s27), float 32 bits
++	 92: s28 (s28), float 32 bits
++	 93: s29 (s29), float 32 bits
++	 94: s30 (s30), float 32 bits
++	 95: s31 (s31), float 32 bits
+ 	256: d0 (d0), float 64 bits
+ 	257: d1 (d1), float 64 bits
+ 	258: d2 (d2), float 64 bits
+@@ -2723,6 +2809,13 @@ VFP registers:
+ 	285: d29 (d29), float 64 bits
+ 	286: d30 (d30), float 64 bits
+ 	287: d31 (d31), float 64 bits
++state registers:
++	128: spsr (spsr), unsigned 32 bits
++	129: spsr_fiq (spsr_fiq), unsigned 32 bits
++	130: spsr_irq (spsr_irq), unsigned 32 bits
++	131: spsr_abt (spsr_abt), unsigned 32 bits
++	132: spsr_und (spsr_und), unsigned 32 bits
++	133: spsr_svc (spsr_svc), unsigned 32 bits
+ EOF
+ 
+ # See run-readelf-mixed-corenote.sh for instructions to regenerate
+Index: b/tests/run-readelf-mixed-corenote.sh
+===================================================================
+--- a/tests/run-readelf-mixed-corenote.sh
++++ b/tests/run-readelf-mixed-corenote.sh
+@@ -31,12 +31,11 @@ Note segment of 892 bytes at offset 0x27
+     pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
+     utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000
+     orig_r0: -1, fpvalid: 1
+-    r0:             1  r1:   -1091672508  r2:   -1091672500
+-    r3:             0  r4:             0  r5:             0
+-    r6:         33728  r7:             0  r8:             0
+-    r9:             0  r10:  -1225703496  r11:  -1091672844
+-    r12:            0  sp:    0xbeee64f4  lr:    0xb6dc3f48
+-    pc:    0x00008500  spsr:  0x60000010
++    r0:            1  r1:  -1091672508  r2:  -1091672500  r3:            0
++    r4:            0  r5:            0  r6:        33728  r7:            0
++    r8:            0  r9:            0  r10: -1225703496  r11: -1091672844
++    r12:           0  sp:   0xbeee64f4  lr:   0xb6dc3f48  pc:   0x00008500
++    spsr:  0x60000010
+   CORE                 124  PRPSINFO
+     state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500
+     uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
+Index: b/tests/run-addrcfi.sh
+===================================================================
+--- a/tests/run-addrcfi.sh
++++ b/tests/run-addrcfi.sh
+@@ -3554,6 +3554,38 @@ dwarf_cfi_addrframe (.eh_frame): no matc
+ 	FPA reg21 (f5): undefined
+ 	FPA reg22 (f6): undefined
+ 	FPA reg23 (f7): undefined
++	VFP reg64 (s0): undefined
++	VFP reg65 (s1): undefined
++	VFP reg66 (s2): undefined
++	VFP reg67 (s3): undefined
++	VFP reg68 (s4): undefined
++	VFP reg69 (s5): undefined
++	VFP reg70 (s6): undefined
++	VFP reg71 (s7): undefined
++	VFP reg72 (s8): undefined
++	VFP reg73 (s9): undefined
++	VFP reg74 (s10): undefined
++	VFP reg75 (s11): undefined
++	VFP reg76 (s12): undefined
++	VFP reg77 (s13): undefined
++	VFP reg78 (s14): undefined
++	VFP reg79 (s15): undefined
++	VFP reg80 (s16): undefined
++	VFP reg81 (s17): undefined
++	VFP reg82 (s18): undefined
++	VFP reg83 (s19): undefined
++	VFP reg84 (s20): undefined
++	VFP reg85 (s21): undefined
++	VFP reg86 (s22): undefined
++	VFP reg87 (s23): undefined
++	VFP reg88 (s24): undefined
++	VFP reg89 (s25): undefined
++	VFP reg90 (s26): undefined
++	VFP reg91 (s27): undefined
++	VFP reg92 (s28): undefined
++	VFP reg93 (s29): undefined
++	VFP reg94 (s30): undefined
++	VFP reg95 (s31): undefined
+ 	FPA reg96 (f0): undefined
+ 	FPA reg97 (f1): undefined
+ 	FPA reg98 (f2): undefined
+@@ -3562,7 +3594,66 @@ dwarf_cfi_addrframe (.eh_frame): no matc
+ 	FPA reg101 (f5): undefined
+ 	FPA reg102 (f6): undefined
+ 	FPA reg103 (f7): undefined
+-	integer reg128 (spsr): undefined
++	MMX reg104 (wcgr0): undefined
++	MMX reg105 (wcgr1): undefined
++	MMX reg106 (wcgr2): undefined
++	MMX reg107 (wcgr3): undefined
++	MMX reg108 (wcgr4): undefined
++	MMX reg109 (wcgr5): undefined
++	MMX reg110 (wcgr6): undefined
++	MMX reg111 (wcgr7): undefined
++	MMX reg112 (wr0): undefined
++	MMX reg113 (wr1): undefined
++	MMX reg114 (wr2): undefined
++	MMX reg115 (wr3): undefined
++	MMX reg116 (wr4): undefined
++	MMX reg117 (wr5): undefined
++	MMX reg118 (wr6): undefined
++	MMX reg119 (wr7): undefined
++	MMX reg120 (wr8): undefined
++	MMX reg121 (wr9): undefined
++	MMX reg122 (wr10): undefined
++	MMX reg123 (wr11): undefined
++	MMX reg124 (wr12): undefined
++	MMX reg125 (wr13): undefined
++	MMX reg126 (wr14): undefined
++	MMX reg127 (wr15): undefined
++	state reg128 (spsr): undefined
++	state reg129 (spsr_fiq): undefined
++	state reg130 (spsr_irq): undefined
++	state reg131 (spsr_abt): undefined
++	state reg132 (spsr_und): undefined
++	state reg133 (spsr_svc): undefined
++	integer reg144 (r8_usr): undefined
++	integer reg145 (r9_usr): undefined
++	integer reg146 (r10_usr): undefined
++	integer reg147 (r11_usr): undefined
++	integer reg148 (r12_usr): undefined
++	integer reg149 (r13_usr): undefined
++	integer reg150 (r14_usr): undefined
++	integer reg151 (r8_fiq): undefined
++	integer reg152 (r9_fiq): undefined
++	integer reg153 (r10_fiq): undefined
++	integer reg154 (r11_fiq): undefined
++	integer reg155 (r12_fiq): undefined
++	integer reg156 (r13_fiq): undefined
++	integer reg157 (r14_fiq): undefined
++	integer reg158 (r13_irq): undefined
++	integer reg159 (r14_irq): undefined
++	integer reg160 (r13_abt): undefined
++	integer reg161 (r14_abt): undefined
++	integer reg162 (r13_und): undefined
++	integer reg163 (r14_und): undefined
++	integer reg164 (r13_svc): undefined
++	integer reg165 (r14_svc): undefined
++	MMX reg192 (wc0): undefined
++	MMX reg193 (wc1): undefined
++	MMX reg194 (wc2): undefined
++	MMX reg195 (wc3): undefined
++	MMX reg196 (wc4): undefined
++	MMX reg197 (wc5): undefined
++	MMX reg198 (wc6): undefined
++	MMX reg199 (wc7): undefined
+ 	VFP reg256 (d0): undefined
+ 	VFP reg257 (d1): undefined
+ 	VFP reg258 (d2): undefined
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/hppa_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/hppa_backend.diff
new file mode 100644
index 0000000..44fda7f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/hppa_backend.diff
@@ -0,0 +1,802 @@
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Index: b/backends/parisc_init.c
+===================================================================
+--- /dev/null
++++ b/backends/parisc_init.c
+@@ -0,0 +1,73 @@
++/* Initialization of PA-RISC specific backend library.
++   Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
++
++   Red Hat elfutils is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by the
++   Free Software Foundation; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License along
++   with Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND		parisc_
++#define RELOC_PREFIX	R_PARISC_
++#include "libebl_CPU.h"
++#include "libebl_parisc.h"
++
++/* This defines the common reloc hooks based on parisc_reloc.def.  */
++#include "common-reloc.c"
++
++
++const char *
++parisc_init (Elf *elf __attribute__ ((unused)),
++     GElf_Half machine __attribute__ ((unused)),
++     Ebl *eh,
++     size_t ehlen)
++{
++  int pa64 = 0;
++
++  /* Check whether the Elf_BH object has a sufficent size.  */
++  if (ehlen < sizeof (Ebl))
++    return NULL;
++
++  if (elf) {
++    GElf_Ehdr ehdr_mem;
++    GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++    if (ehdr && (ehdr->e_flags & EF_PARISC_WIDE))
++      pa64 = 1;
++  }
++  /* We handle it.  */
++  eh->name = "PA-RISC";
++  parisc_init_reloc (eh);
++  HOOK (eh, reloc_simple_type);
++  HOOK (eh, machine_flag_check);
++  HOOK (eh, symbol_type_name);
++  HOOK (eh, segment_type_name);
++  HOOK (eh, section_type_name);
++  HOOK (eh, register_info);
++  if (pa64)
++    eh->return_value_location = parisc_return_value_location_64;
++  else
++    eh->return_value_location = parisc_return_value_location_32;
++
++  return MODVERSION;
++}
+Index: b/backends/parisc_regs.c
+===================================================================
+--- /dev/null
++++ b/backends/parisc_regs.c
+@@ -0,0 +1,159 @@
++/* Register names and numbers for PA-RISC DWARF.
++   Copyright (C) 2005, 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by the
++   Free Software Foundation; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License along
++   with Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND parisc_
++#include "libebl_CPU.h"
++
++ssize_t
++parisc_register_info (Ebl *ebl, int regno, char *name, size_t namelen,
++		     const char **prefix, const char **setname,
++		     int *bits, int *type)
++{
++  int pa64 = 0;
++
++  if (ebl->elf) {
++    GElf_Ehdr ehdr_mem;
++    GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem);
++    if (ehdr->e_flags & EF_PARISC_WIDE)
++      pa64 = 1;
++  }
++
++  int nregs = pa64 ? 127 : 128;
++
++  if (name == NULL)
++    return nregs;
++
++  if (regno < 0 || regno >= nregs || namelen < 6)
++    return -1;
++
++  *prefix = "%";
++
++  if (regno < 32)
++  {
++    *setname = "integer";
++    *type = DW_ATE_signed;
++    if (pa64)
++    {
++	*bits = 64;
++    }
++    else
++    {
++    	*bits = 32;
++    }
++  }
++  else if (regno == 32)
++  {
++    *setname = "special";
++    if (pa64)
++    {
++	*bits = 6;
++    }
++    else
++    {
++    	*bits = 5;
++    }
++    *type = DW_ATE_unsigned;
++  }
++  else
++  {
++    *setname = "FPU";
++    *type = DW_ATE_float;
++    if (pa64)
++    {
++	*bits = 64;
++    }
++    else
++    {
++    	*bits = 32;
++    }
++  }
++
++  if (regno < 33) {
++    switch (regno)
++      {
++      case 0 ... 9:
++        name[0] = 'r';
++        name[1] = regno + '0';
++        namelen = 2;
++        break;
++      case 10 ... 31:
++        name[0] = 'r';
++        name[1] = regno / 10 + '0';
++        name[2] = regno % 10 + '0';
++        namelen = 3;
++        break;
++      case 32:
++	*prefix = NULL;
++	name[0] = 'S';
++	name[1] = 'A';
++	name[2] = 'R';
++	namelen = 3;
++	break;
++      }
++  }
++  else {
++    if (pa64 && ((regno - 72) % 2)) {
++      *setname = NULL;
++      return 0;
++    }
++
++    switch (regno)
++      {
++      case 72 + 0 ... 72 + 11:
++        name[0] = 'f';
++	name[1] = 'r';
++        name[2] = (regno + 8 - 72) / 2 + '0';
++        namelen = 3;
++        if ((regno + 8 - 72) % 2) {
++	  name[3] = 'R';
++	  namelen++;
++        }
++        break;
++      case 72 + 12 ... 72 + 55:
++        name[0] = 'f';
++	name[1] = 'r';
++        name[2] = (regno + 8 - 72) / 2 / 10 + '0';
++        name[3] = (regno + 8 - 72) / 2 % 10 + '0';
++        namelen = 4;
++        if ((regno + 8 - 72) % 2) {
++	  name[4] = 'R';
++	  namelen++;
++        }
++        break;
++      default:
++        *setname = NULL;
++        return 0;
++      }
++  }
++  name[namelen++] = '\0';
++  return namelen;
++}
+Index: b/backends/parisc_reloc.def
+===================================================================
+--- /dev/null
++++ b/backends/parisc_reloc.def
+@@ -0,0 +1,128 @@
++/* List the relocation types for PA-RISC.  -*- C -*-
++   Copyright (C) 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by the
++   Free Software Foundation; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License along
++   with Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++/*	    NAME,		REL|EXEC|DYN	*/
++
++RELOC_TYPE (NONE,		EXEC|DYN)
++RELOC_TYPE (DIR32,		REL|EXEC|DYN)
++RELOC_TYPE (DIR21L,		REL|EXEC|DYN)
++RELOC_TYPE (DIR17R,		REL)
++RELOC_TYPE (DIR17F,		REL)
++RELOC_TYPE (DIR14R,		REL|DYN)
++RELOC_TYPE (PCREL32,		REL)
++RELOC_TYPE (PCREL21L,		REL)
++RELOC_TYPE (PCREL17R,		REL)
++RELOC_TYPE (PCREL17F,		REL)
++RELOC_TYPE (PCREL14R,		REL|EXEC)
++RELOC_TYPE (DPREL21L,		REL)
++RELOC_TYPE (DPREL14WR,		REL)
++RELOC_TYPE (DPREL14DR,          REL)
++RELOC_TYPE (DPREL14R,		REL)
++RELOC_TYPE (GPREL21L,		0)
++RELOC_TYPE (GPREL14R,		0)
++RELOC_TYPE (LTOFF21L,		REL)
++RELOC_TYPE (LTOFF14R,		REL)
++RELOC_TYPE (DLTIND14F,		0)
++RELOC_TYPE (SETBASE,		0)
++RELOC_TYPE (SECREL32,		REL)
++RELOC_TYPE (BASEREL21L,		0)
++RELOC_TYPE (BASEREL17R,		0)
++RELOC_TYPE (BASEREL14R,		0)
++RELOC_TYPE (SEGBASE,		0)
++RELOC_TYPE (SEGREL32,		REL)
++RELOC_TYPE (PLTOFF21L,		0)
++RELOC_TYPE (PLTOFF14R,		0)
++RELOC_TYPE (PLTOFF14F,		0)
++RELOC_TYPE (LTOFF_FPTR32,	0)
++RELOC_TYPE (LTOFF_FPTR21L,	0)
++RELOC_TYPE (LTOFF_FPTR14R,	0)
++RELOC_TYPE (FPTR64,		0)
++RELOC_TYPE (PLABEL32,		REL|DYN)
++RELOC_TYPE (PCREL64,		0)
++RELOC_TYPE (PCREL22C,		0)
++RELOC_TYPE (PCREL22F,		0)
++RELOC_TYPE (PCREL14WR,		0)
++RELOC_TYPE (PCREL14DR,		0)
++RELOC_TYPE (PCREL16F,		0)
++RELOC_TYPE (PCREL16WF,		0)
++RELOC_TYPE (PCREL16DF,		0)
++RELOC_TYPE (DIR64,		REL|DYN)
++RELOC_TYPE (DIR14WR,		REL)
++RELOC_TYPE (DIR14DR,		REL)
++RELOC_TYPE (DIR16F,		REL)
++RELOC_TYPE (DIR16WF,		REL)
++RELOC_TYPE (DIR16DF,		REL)
++RELOC_TYPE (GPREL64,		0)
++RELOC_TYPE (GPREL14WR,		0)
++RELOC_TYPE (GPREL14DR,		0)
++RELOC_TYPE (GPREL16F,		0)
++RELOC_TYPE (GPREL16WF,		0)
++RELOC_TYPE (GPREL16DF,		0)
++RELOC_TYPE (LTOFF64,		0)
++RELOC_TYPE (LTOFF14WR,		0)
++RELOC_TYPE (LTOFF14DR,		0)
++RELOC_TYPE (LTOFF16F,		0)
++RELOC_TYPE (LTOFF16WF,		0)
++RELOC_TYPE (LTOFF16DF,		0)
++RELOC_TYPE (SECREL64,		0)
++RELOC_TYPE (BASEREL14WR,	0)
++RELOC_TYPE (BASEREL14DR,	0)
++RELOC_TYPE (SEGREL64,		0)
++RELOC_TYPE (PLTOFF14WR,		0)
++RELOC_TYPE (PLTOFF14DR,		0)
++RELOC_TYPE (PLTOFF16F,		0)
++RELOC_TYPE (PLTOFF16WF,		0)
++RELOC_TYPE (PLTOFF16DF,		0)
++RELOC_TYPE (LTOFF_FPTR64,	0)
++RELOC_TYPE (LTOFF_FPTR14WR,	0)
++RELOC_TYPE (LTOFF_FPTR14DR,	0)
++RELOC_TYPE (LTOFF_FPTR16F,	0)
++RELOC_TYPE (LTOFF_FPTR16WF,	0)
++RELOC_TYPE (LTOFF_FPTR16DF,	0)
++RELOC_TYPE (COPY,		EXEC)
++RELOC_TYPE (IPLT,		EXEC|DYN)
++RELOC_TYPE (EPLT,		0)
++RELOC_TYPE (TPREL32,		DYN)
++RELOC_TYPE (TPREL21L,		0)
++RELOC_TYPE (TPREL14R,		0)
++RELOC_TYPE (LTOFF_TP21L,	0)
++RELOC_TYPE (LTOFF_TP14R,	0)
++RELOC_TYPE (LTOFF_TP14F,	0)
++RELOC_TYPE (TPREL64,		0)
++RELOC_TYPE (TPREL14WR,		0)
++RELOC_TYPE (TPREL14DR,		0)
++RELOC_TYPE (TPREL16F,		0)
++RELOC_TYPE (TPREL16WF,		0)
++RELOC_TYPE (TPREL16DF,		0)
++RELOC_TYPE (LTOFF_TP64,		0)
++RELOC_TYPE (LTOFF_TP14WR,	0)
++RELOC_TYPE (LTOFF_TP14DR,	0)
++RELOC_TYPE (LTOFF_TP16F,	0)
++RELOC_TYPE (LTOFF_TP16WF,	0)
++RELOC_TYPE (LTOFF_TP16DF,	0)
++RELOC_TYPE (TLS_DTPMOD32,	DYN)
++RELOC_TYPE (TLS_DTPMOD64,	DYN)
++
++#define NO_RELATIVE_RELOC       1
+Index: b/backends/parisc_retval.c
+===================================================================
+--- /dev/null
++++ b/backends/parisc_retval.c
+@@ -0,0 +1,213 @@
++/* Function return value location for Linux/PA-RISC ABI.
++   Copyright (C) 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by the
++   Free Software Foundation; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License along
++   with Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <assert.h>
++#include <dwarf.h>
++
++#define BACKEND parisc_
++#include "libebl_CPU.h"
++#include "libebl_parisc.h"
++
++/* %r28, or pair %r28, %r29.  */
++static const Dwarf_Op loc_intreg32[] =
++  {
++    { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++
++static const Dwarf_Op loc_intreg[] =
++  {
++    { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 8 },
++    { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 8 },
++  };
++#define nloc_intreg	1
++#define nloc_intregpair	4
++
++/* %fr4L, or pair %fr4L, %fr4R on pa-32 */
++static const Dwarf_Op loc_fpreg32[] =
++  {
++    { .atom = DW_OP_regx, .number = 72 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 73 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++#define nloc_fpreg32 2
++#define nloc_fpregpair32 4
++
++/* $fr4 */
++static const Dwarf_Op loc_fpreg[] =
++  {
++    { .atom = DW_OP_regx, .number = 72 },
++  };
++#define nloc_fpreg  1
++
++#if 0
++/* The return value is a structure and is actually stored in stack space
++   passed in a hidden argument by the caller. Address of the location is stored
++   in %r28 before function call, but it may be changed by function. */
++static const Dwarf_Op loc_aggregate[] =
++  {
++    { .atom = DW_OP_breg28 },
++  };
++#define nloc_aggregate 1
++#endif
++
++static int
++parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, int pa64)
++{
++  Dwarf_Word regsize = pa64 ? 8 : 4;
++
++  /* Start with the function's type, and get the DW_AT_type attribute,
++     which is the type of the return value.  */
++
++  Dwarf_Attribute attr_mem;
++  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
++  if (attr == NULL)
++    /* The function has no return value, like a `void' function in C.  */
++    return 0;
++
++  Dwarf_Die die_mem;
++  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
++  int tag = dwarf_tag (typedie);
++
++  /* Follow typedefs and qualifiers to get to the actual type.  */
++  while (tag == DW_TAG_typedef
++	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
++	 || tag == DW_TAG_restrict_type)
++    {
++      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++      typedie = dwarf_formref_die (attr, &die_mem);
++      tag = dwarf_tag (typedie);
++    }
++
++  switch (tag)
++    {
++    case -1:
++      return -1;
++
++    case DW_TAG_subrange_type:
++      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
++	{
++	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++	  typedie = dwarf_formref_die (attr, &die_mem);
++	  tag = dwarf_tag (typedie);
++	}
++      /* Fall through.  */
++
++    case DW_TAG_base_type:
++    case DW_TAG_enumeration_type:
++    case DW_TAG_pointer_type:
++    case DW_TAG_ptr_to_member_type:
++      {
++        Dwarf_Word size;
++	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
++					 &attr_mem), &size) != 0)
++	  {
++	    if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
++	      size = 4;
++	    else
++	      return -1;
++	  }
++	if (tag == DW_TAG_base_type)
++	  {
++	    Dwarf_Word encoding;
++	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++					     &attr_mem), &encoding) != 0)
++	      return -1;
++
++	    if (encoding == DW_ATE_float)
++	      {
++		if (pa64) {
++		  *locp = loc_fpreg;
++		  if (size <= 8)
++		      return nloc_fpreg;
++		}
++		else {
++		  *locp = loc_fpreg32;
++		  if (size <= 4)
++		    return nloc_fpreg32;
++		  else if (size <= 8)
++		    return nloc_fpregpair32;
++		}
++		goto aggregate;
++	      }
++	  }
++	if (pa64)
++	  *locp = loc_intreg;
++	else
++	  *locp = loc_intreg32;
++	if (size <= regsize)
++	  return nloc_intreg;
++	if (size <= 2 * regsize)
++	  return nloc_intregpair;
++
++	/* Else fall through.  */
++      }
++
++    case DW_TAG_structure_type:
++    case DW_TAG_class_type:
++    case DW_TAG_union_type:
++    case DW_TAG_array_type:
++    aggregate: {
++        Dwarf_Word size;
++	if (dwarf_aggregate_size (typedie, &size) != 0)
++	  return -1;
++	if (pa64)
++          *locp = loc_intreg;
++	else
++	  *locp = loc_intreg32;
++        if (size <= regsize)
++	  return nloc_intreg;
++        if (size <= 2 * regsize)
++	  return nloc_intregpair;
++#if 0
++	/* there should be some way to know this location... But I do not see it. */
++        *locp = loc_aggregate;
++        return nloc_aggregate;
++#endif
++	/* fall through.  */
++      }
++    }
++
++  /* XXX We don't have a good way to return specific errors from ebl calls.
++     This value means we do not understand the type, but it is well-formed
++     DWARF and might be valid.  */
++  return -2;
++}
++
++int
++parisc_return_value_location_32 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++  return parisc_return_value_location_ (functypedie, locp, 0);
++}
++
++int
++parisc_return_value_location_64 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++  return parisc_return_value_location_ (functypedie, locp, 1);
++}
++
+Index: b/backends/parisc_symbol.c
+===================================================================
+--- /dev/null
++++ b/backends/parisc_symbol.c
+@@ -0,0 +1,112 @@
++/* PA-RISC specific symbolic name handling.
++   Copyright (C) 2002, 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
++
++   Red Hat elfutils is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by the
++   Free Software Foundation; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License along
++   with Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND		parisc_
++#include "libebl_CPU.h"
++
++const char *
++parisc_segment_type_name (int segment, char *buf __attribute__ ((unused)),
++			size_t len __attribute__ ((unused)))
++{
++  switch (segment)
++    {
++    case PT_PARISC_ARCHEXT:
++      return "PARISC_ARCHEXT";
++    case PT_PARISC_UNWIND:
++      return "PARISC_UNWIND";
++    default:
++      break;
++    }
++  return NULL;
++}
++
++/* Return symbolic representation of symbol type.  */
++const char *
++parisc_symbol_type_name(int symbol, char *buf __attribute__ ((unused)),
++    size_t len __attribute__ ((unused)))
++{
++	if (symbol == STT_PARISC_MILLICODE)
++	  return "PARISC_MILLI";
++	return NULL;
++}
++
++/* Return symbolic representation of section type.  */
++const char *
++parisc_section_type_name (int type,
++			char *buf __attribute__ ((unused)),
++			size_t len __attribute__ ((unused)))
++{
++  switch (type)
++    {
++    case SHT_PARISC_EXT:
++      return "PARISC_EXT";
++    case SHT_PARISC_UNWIND:
++      return "PARISC_UNWIND";
++    case SHT_PARISC_DOC:
++      return "PARISC_DOC";
++    }
++
++  return NULL;
++}
++
++/* Check whether machine flags are valid.  */
++bool
++parisc_machine_flag_check (GElf_Word flags)
++{
++  if (flags &~ (EF_PARISC_TRAPNIL | EF_PARISC_EXT | EF_PARISC_LSB |
++	EF_PARISC_WIDE | EF_PARISC_NO_KABP |
++	EF_PARISC_LAZYSWAP | EF_PARISC_ARCH))
++    return 0;
++
++  GElf_Word arch = flags & EF_PARISC_ARCH;
++
++  return ((arch == EFA_PARISC_1_0) || (arch == EFA_PARISC_1_1) ||
++      (arch == EFA_PARISC_2_0));
++}
++
++/* Check for the simple reloc types.  */
++Elf_Type
++parisc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++  switch (type)
++    {
++    case R_PARISC_DIR64:
++    case R_PARISC_SECREL64:
++      return ELF_T_XWORD;
++    case R_PARISC_DIR32:
++    case R_PARISC_SECREL32:
++      return ELF_T_WORD;
++    default:
++      return ELF_T_NUM;
++    }
++}
+Index: b/backends/libebl_parisc.h
+===================================================================
+--- /dev/null
++++ b/backends/libebl_parisc.h
+@@ -0,0 +1,9 @@
++#ifndef _LIBEBL_HPPA_H
++#define _LIBEBL_HPPA_H 1
++
++#include <libdw.h>
++
++extern int parisc_return_value_location_32(Dwarf_Die *, const Dwarf_Op **locp);
++extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp);
++
++#endif
+Index: b/backends/Makefile.am
+===================================================================
+--- a/backends/Makefile.am
++++ b/backends/Makefile.am
+@@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
+ 
+ 
+ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
+-	  tilegx m68k bpf
++	  tilegx m68k bpf parisc
+ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a    \
+ 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a    \
+ 	     libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
+ 	     libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
+-	     libebl_m68k_pic.a libebl_bpf_pic.a
++	     libebl_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+ 
+@@ -128,6 +128,9 @@ endif
+ libebl_bpf_pic_a_SOURCES = $(bpf_SRCS)
+ am_libebl_bpf_pic_a_OBJECTS = $(bpf_SRCS:.c=.os)
+ 
++parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
++libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
++am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
+ 
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ 	@rm -f $(@:.so=.map)
+Index: b/libelf/elf.h
+===================================================================
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -2055,16 +2055,24 @@ enum
+ #define R_PARISC_PCREL17F	12	/* 17 bits of rel. address.  */
+ #define R_PARISC_PCREL14R	14	/* Right 14 bits of rel. address.  */
+ #define R_PARISC_DPREL21L	18	/* Left 21 bits of rel. address.  */
++#define R_PARISC_DPREL14WR	19
++#define R_PARISC_DPREL14DR	20
+ #define R_PARISC_DPREL14R	22	/* Right 14 bits of rel. address.  */
+ #define R_PARISC_GPREL21L	26	/* GP-relative, left 21 bits.  */
+ #define R_PARISC_GPREL14R	30	/* GP-relative, right 14 bits.  */
+ #define R_PARISC_LTOFF21L	34	/* LT-relative, left 21 bits.  */
+ #define R_PARISC_LTOFF14R	38	/* LT-relative, right 14 bits.  */
++#define R_PARISC_DLTIND14F	39
++#define R_PARISC_SETBASE	40
+ #define R_PARISC_SECREL32	41	/* 32 bits section rel. address.  */
++#define R_PARISC_BASEREL21L	42
++#define R_PARISC_BASEREL17R	43
++#define R_PARISC_BASEREL14R	46
+ #define R_PARISC_SEGBASE	48	/* No relocation, set segment base.  */
+ #define R_PARISC_SEGREL32	49	/* 32 bits segment rel. address.  */
+ #define R_PARISC_PLTOFF21L	50	/* PLT rel. address, left 21 bits.  */
+ #define R_PARISC_PLTOFF14R	54	/* PLT rel. address, right 14 bits.  */
++#define R_PARISC_PLTOFF14F	55
+ #define R_PARISC_LTOFF_FPTR32	57	/* 32 bits LT-rel. function pointer. */
+ #define R_PARISC_LTOFF_FPTR21L	58	/* LT-rel. fct ptr, left 21 bits. */
+ #define R_PARISC_LTOFF_FPTR14R	62	/* LT-rel. fct ptr, right 14 bits. */
+@@ -2073,6 +2081,7 @@ enum
+ #define R_PARISC_PLABEL21L	66	/* Left 21 bits of fdesc address.  */
+ #define R_PARISC_PLABEL14R	70	/* Right 14 bits of fdesc address.  */
+ #define R_PARISC_PCREL64	72	/* 64 bits PC-rel. address.  */
++#define R_PARISC_PCREL22C	73
+ #define R_PARISC_PCREL22F	74	/* 22 bits PC-rel. address.  */
+ #define R_PARISC_PCREL14WR	75	/* PC-rel. address, right 14 bits.  */
+ #define R_PARISC_PCREL14DR	76	/* PC rel. address, right 14 bits.  */
+@@ -2098,6 +2107,8 @@ enum
+ #define R_PARISC_LTOFF16WF	102	/* 16 bits LT-rel. address.  */
+ #define R_PARISC_LTOFF16DF	103	/* 16 bits LT-rel. address.  */
+ #define R_PARISC_SECREL64	104	/* 64 bits section rel. address.  */
++#define R_PARISC_BASEREL14WR	107
++#define R_PARISC_BASEREL14DR	108
+ #define R_PARISC_SEGREL64	112	/* 64 bits segment rel. address.  */
+ #define R_PARISC_PLTOFF14WR	115	/* PLT-rel. address, right 14 bits.  */
+ #define R_PARISC_PLTOFF14DR	116	/* PLT-rel. address, right 14 bits.  */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/hurd_path.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/hurd_path.patch
new file mode 100644
index 0000000..a4d568b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/hurd_path.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Index: elfutils-0.165/tests/run-native-test.sh
+===================================================================
+--- elfutils-0.165.orig/tests/run-native-test.sh
++++ elfutils-0.165/tests/run-native-test.sh
+@@ -83,6 +83,9 @@ native_test()
+ # "cannot attach to process: Function not implemented".
+ [ "$(uname)" = "GNU/kFreeBSD" ] && exit 77
+ 
++# hurd's /proc/$PID/maps does not give paths yet.
++[ "$(uname)" = "GNU" ] && exit 77
++
+ native_test ${abs_builddir}/allregs
+ native_test ${abs_builddir}/funcretval
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/ignore_strmerge.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/ignore_strmerge.diff
new file mode 100644
index 0000000..3570dec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/ignore_strmerge.diff
@@ -0,0 +1,14 @@
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+--- elfutils-0.165.orig/tests/run-strip-strmerge.sh
++++ elfutils-0.165/tests/run-strip-strmerge.sh
+@@ -30,7 +30,7 @@ remerged=remerged.elf
+ tempfiles $merged $stripped $debugfile $remerged
+ 
+ echo elflint $input
+-testrun ${abs_top_builddir}/src/elflint --gnu $input
++testrun_on_self_skip ${abs_top_builddir}/src/elflint --gnu $input
+ echo elfstrmerge
+ testrun ${abs_top_builddir}/tests/elfstrmerge -o $merged $input
+ echo elflint $merged
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/kfreebsd_path.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/kfreebsd_path.patch
new file mode 100644
index 0000000..49085d1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/kfreebsd_path.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Index: b/tests/run-native-test.sh
+===================================================================
+--- a/tests/run-native-test.sh
++++ b/tests/run-native-test.sh
+@@ -77,6 +77,12 @@ native_test()
+   test $native -eq 0 || testrun "$@" -p $native > /dev/null
+ }
+ 
++# On the Debian buildds, GNU/kFreeBSD linprocfs /proc/$PID/maps does
++# not give absolute paths due to sbuild's bind mounts (bug #570805)
++# therefore the next two test programs are expected to fail with
++# "cannot attach to process: Function not implemented".
++[ "$(uname)" = "GNU/kFreeBSD" ] && exit 77
++
+ native_test ${abs_builddir}/allregs
+ native_test ${abs_builddir}/funcretval
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/mips_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/mips_backend.diff
new file mode 100644
index 0000000..a5e76dd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/mips_backend.diff
@@ -0,0 +1,686 @@
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Index: b/backends/mips_init.c
+===================================================================
+--- /dev/null
++++ b/backends/mips_init.c
+@@ -0,0 +1,59 @@
++/* Initialization of mips specific backend library.
++   Copyright (C) 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by the
++   Free Software Foundation; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License along
++   with Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND		mips_
++#define RELOC_PREFIX	R_MIPS_
++#include "libebl_CPU.h"
++
++/* This defines the common reloc hooks based on mips_reloc.def.  */
++#include "common-reloc.c"
++
++const char *
++mips_init (Elf *elf __attribute__ ((unused)),
++     GElf_Half machine __attribute__ ((unused)),
++     Ebl *eh,
++     size_t ehlen)
++{
++  /* Check whether the Elf_BH object has a sufficent size.  */
++  if (ehlen < sizeof (Ebl))
++    return NULL;
++
++  /* We handle it.  */
++  if (machine == EM_MIPS)
++    eh->name = "MIPS R3000 big-endian";
++  else if (machine == EM_MIPS_RS3_LE)
++    eh->name = "MIPS R3000 little-endian";
++
++  mips_init_reloc (eh);
++  HOOK (eh, reloc_simple_type);
++  HOOK (eh, return_value_location);
++  HOOK (eh, register_info);
++
++  return MODVERSION;
++}
+Index: b/backends/mips_regs.c
+===================================================================
+--- /dev/null
++++ b/backends/mips_regs.c
+@@ -0,0 +1,104 @@
++/* Register names and numbers for MIPS DWARF.
++   Copyright (C) 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by the
++   Free Software Foundation; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License along
++   with Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND mips_
++#include "libebl_CPU.h"
++
++ssize_t
++mips_register_info (Ebl *ebl __attribute__((unused)),
++		    int regno, char *name, size_t namelen,
++		    const char **prefix, const char **setname,
++		    int *bits, int *type)
++{
++  if (name == NULL)
++    return 66;
++
++  if (regno < 0 || regno > 65 || namelen < 4)
++    return -1;
++
++  *prefix = "$";
++
++  if (regno < 32)
++    {
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      if (regno < 32 + 10)
++        {
++          name[0] = regno + '0';
++          namelen = 1;
++        }
++      else
++        {
++          name[0] = (regno / 10) + '0';
++          name[1] = (regno % 10) + '0';
++          namelen = 2;
++        }
++    }
++  else if (regno < 64)
++    {
++      *setname = "FPU";
++      *type = DW_ATE_float;
++      *bits = 32;
++      name[0] = 'f';
++      if (regno < 32 + 10)
++	{
++	  name[1] = (regno - 32) + '0';
++	  namelen = 2;
++	}
++      else
++	{
++	  name[1] = (regno - 32) / 10 + '0';
++	  name[2] = (regno - 32) % 10 + '0';
++	  namelen = 3;
++	}
++    }
++  else if (regno == 64)
++    {
++      *type = DW_ATE_signed;
++      *bits = 32;
++      name[0] = 'h';
++      name[1] = 'i';
++      namelen = 2;
++    }
++  else
++    {
++      *type = DW_ATE_signed;
++      *bits = 32;
++      name[0] = 'l';
++      name[1] = 'o';
++      namelen = 2;
++    }
++
++  name[namelen++] = '\0';
++  return namelen;
++}
+Index: b/backends/mips_reloc.def
+===================================================================
+--- /dev/null
++++ b/backends/mips_reloc.def
+@@ -0,0 +1,79 @@
++/* List the relocation types for mips.  -*- C -*-
++   Copyright (C) 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by the
++   Free Software Foundation; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License along
++   with Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++/* 	    NAME,		REL|EXEC|DYN	*/
++
++RELOC_TYPE (NONE,               0)
++RELOC_TYPE (16,                 0)
++RELOC_TYPE (32,                 0)
++RELOC_TYPE (REL32,              0)
++RELOC_TYPE (26,                 0)
++RELOC_TYPE (HI16,               0)
++RELOC_TYPE (LO16,               0)
++RELOC_TYPE (GPREL16,            0)
++RELOC_TYPE (LITERAL,            0)
++RELOC_TYPE (GOT16,              0)
++RELOC_TYPE (PC16,               0)
++RELOC_TYPE (CALL16,             0)
++RELOC_TYPE (GPREL32,            0)
++
++RELOC_TYPE (SHIFT5,             0)
++RELOC_TYPE (SHIFT6,             0)
++RELOC_TYPE (64,                 0)
++RELOC_TYPE (GOT_DISP,           0)
++RELOC_TYPE (GOT_PAGE,           0)
++RELOC_TYPE (GOT_OFST,           0)
++RELOC_TYPE (GOT_HI16,           0)
++RELOC_TYPE (GOT_LO16,           0)
++RELOC_TYPE (SUB,                0)
++RELOC_TYPE (INSERT_A,           0)
++RELOC_TYPE (INSERT_B,           0)
++RELOC_TYPE (DELETE,             0)
++RELOC_TYPE (HIGHER,             0)
++RELOC_TYPE (HIGHEST,            0)
++RELOC_TYPE (CALL_HI16,          0)
++RELOC_TYPE (CALL_LO16,          0)
++RELOC_TYPE (SCN_DISP,           0)
++RELOC_TYPE (REL16,              0)
++RELOC_TYPE (ADD_IMMEDIATE,      0)
++RELOC_TYPE (PJUMP,              0)
++RELOC_TYPE (RELGOT,             0)
++RELOC_TYPE (JALR,               0)
++RELOC_TYPE (TLS_DTPMOD32,       0)
++RELOC_TYPE (TLS_DTPREL32,       0)
++RELOC_TYPE (TLS_DTPMOD64,       0)
++RELOC_TYPE (TLS_DTPREL64,       0)
++RELOC_TYPE (TLS_GD,             0)
++RELOC_TYPE (TLS_LDM,            0)
++RELOC_TYPE (TLS_DTPREL_HI16,    0)
++RELOC_TYPE (TLS_DTPREL_LO16,    0)
++RELOC_TYPE (TLS_GOTTPREL,       0)
++RELOC_TYPE (TLS_TPREL32,        0)
++RELOC_TYPE (TLS_TPREL64,        0)
++RELOC_TYPE (TLS_TPREL_HI16,     0)
++RELOC_TYPE (TLS_TPREL_LO16,     0)
++
++#define NO_COPY_RELOC 1
++#define NO_RELATIVE_RELOC 1
+Index: b/backends/mips_retval.c
+===================================================================
+--- /dev/null
++++ b/backends/mips_retval.c
+@@ -0,0 +1,321 @@
++/* Function return value location for Linux/mips ABI.
++   Copyright (C) 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by the
++   Free Software Foundation; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License along
++   with Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <assert.h>
++#include <dwarf.h>
++#include <elf.h>
++
++#include "../libebl/libeblP.h"
++#include "../libdw/libdwP.h"
++
++#define BACKEND mips_
++#include "libebl_CPU.h"
++
++/* The ABI of the file.  Also see EF_MIPS_ABI2 above. */
++#define EF_MIPS_ABI		0x0000F000
++
++/* The original o32 abi. */
++#define E_MIPS_ABI_O32          0x00001000
++
++/* O32 extended to work on 64 bit architectures */
++#define E_MIPS_ABI_O64          0x00002000
++
++/* EABI in 32 bit mode */
++#define E_MIPS_ABI_EABI32       0x00003000
++
++/* EABI in 64 bit mode */
++#define E_MIPS_ABI_EABI64       0x00004000
++
++/* All the possible MIPS ABIs. */
++enum mips_abi
++  {
++    MIPS_ABI_UNKNOWN = 0,
++    MIPS_ABI_N32,
++    MIPS_ABI_O32,
++    MIPS_ABI_N64,
++    MIPS_ABI_O64,
++    MIPS_ABI_EABI32,
++    MIPS_ABI_EABI64,
++    MIPS_ABI_LAST
++  };
++
++/* Find the mips ABI of the current file */
++enum mips_abi find_mips_abi(Elf *elf)
++{
++  GElf_Ehdr ehdr_mem;
++  GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++
++  if (ehdr == NULL)
++    return MIPS_ABI_LAST;
++
++  GElf_Word elf_flags = ehdr->e_flags;
++
++  /* Check elf_flags to see if it specifies the ABI being used.  */
++  switch ((elf_flags & EF_MIPS_ABI))
++    {
++    case E_MIPS_ABI_O32:
++      return MIPS_ABI_O32;
++    case E_MIPS_ABI_O64:
++      return MIPS_ABI_O64;
++    case E_MIPS_ABI_EABI32:
++      return MIPS_ABI_EABI32;
++    case E_MIPS_ABI_EABI64:
++      return MIPS_ABI_EABI64;
++    default:
++      if ((elf_flags & EF_MIPS_ABI2))
++	return MIPS_ABI_N32;
++    }
++
++  /* GCC creates a pseudo-section whose name describes the ABI.  */
++  size_t shstrndx;
++  if (elf_getshdrstrndx (elf, &shstrndx) < 0)
++    return MIPS_ABI_LAST;
++
++  const char *name;
++  Elf_Scn *scn = NULL;
++  while ((scn = elf_nextscn (elf, scn)) != NULL)
++    {
++      GElf_Shdr shdr_mem;
++      GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
++      if (shdr == NULL)
++        return MIPS_ABI_LAST;
++
++      name = elf_strptr (elf, shstrndx, shdr->sh_name) ?: "";
++      if (strncmp (name, ".mdebug.", 8) != 0)
++        continue;
++
++      if (strcmp (name, ".mdebug.abi32") == 0)
++        return MIPS_ABI_O32;
++      else if (strcmp (name, ".mdebug.abiN32") == 0)
++        return MIPS_ABI_N32;
++      else if (strcmp (name, ".mdebug.abi64") == 0)
++        return MIPS_ABI_N64;
++      else if (strcmp (name, ".mdebug.abiO64") == 0)
++        return MIPS_ABI_O64;
++      else if (strcmp (name, ".mdebug.eabi32") == 0)
++        return MIPS_ABI_EABI32;
++      else if (strcmp (name, ".mdebug.eabi64") == 0)
++        return MIPS_ABI_EABI64;
++      else
++        return MIPS_ABI_UNKNOWN;
++    }
++
++  return MIPS_ABI_UNKNOWN;
++}
++
++unsigned int
++mips_abi_regsize (enum mips_abi abi)
++{
++  switch (abi)
++    {
++    case MIPS_ABI_EABI32:
++    case MIPS_ABI_O32:
++      return 4;
++    case MIPS_ABI_N32:
++    case MIPS_ABI_N64:
++    case MIPS_ABI_O64:
++    case MIPS_ABI_EABI64:
++      return 8;
++    case MIPS_ABI_UNKNOWN:
++    case MIPS_ABI_LAST:
++    default:
++      return 0;
++    }
++}
++
++
++/* $v0 or pair $v0, $v1 */
++static const Dwarf_Op loc_intreg_o32[] =
++  {
++    { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++
++static const Dwarf_Op loc_intreg[] =
++  {
++    { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 8 },
++    { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 8 },
++  };
++#define nloc_intreg	1
++#define nloc_intregpair	4
++
++/* $f0 (float), or pair $f0, $f1 (double).
++ * f2/f3 are used for COMPLEX (= 2 doubles) returns in Fortran */
++static const Dwarf_Op loc_fpreg_o32[] =
++  {
++    { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++
++/* $f0, or pair $f0, $f2.  */
++static const Dwarf_Op loc_fpreg[] =
++  {
++    { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 8 },
++    { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 },
++  };
++#define nloc_fpreg  1
++#define nloc_fpregpair 4
++#define nloc_fpregquad 8
++
++/* The return value is a structure and is actually stored in stack space
++   passed in a hidden argument by the caller.  But, the compiler
++   helpfully returns the address of that space in $v0.  */
++static const Dwarf_Op loc_aggregate[] =
++  {
++    { .atom = DW_OP_breg2, .number = 0 }
++  };
++#define nloc_aggregate 1
++
++int
++mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++  /* First find the ABI used by the elf object */
++  enum mips_abi abi = find_mips_abi(functypedie->cu->dbg->elf);
++
++  /* Something went seriously wrong while trying to figure out the ABI */
++  if (abi == MIPS_ABI_LAST)
++    return -1;
++
++  /* We couldn't identify the ABI, but the file seems valid */
++  if (abi == MIPS_ABI_UNKNOWN)
++    return -2;
++
++  /* Can't handle EABI variants */
++  if ((abi == MIPS_ABI_EABI32) || (abi == MIPS_ABI_EABI64))
++    return -2;
++
++  unsigned int regsize = mips_abi_regsize (abi);
++  if (!regsize)
++    return -2;
++
++  /* Start with the function's type, and get the DW_AT_type attribute,
++     which is the type of the return value.  */
++
++  Dwarf_Attribute attr_mem;
++  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
++  if (attr == NULL)
++    /* The function has no return value, like a `void' function in C.  */
++    return 0;
++
++  Dwarf_Die die_mem;
++  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
++  int tag = dwarf_tag (typedie);
++
++  /* Follow typedefs and qualifiers to get to the actual type.  */
++  while (tag == DW_TAG_typedef
++	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
++	 || tag == DW_TAG_restrict_type)
++    {
++      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++      typedie = dwarf_formref_die (attr, &die_mem);
++      tag = dwarf_tag (typedie);
++    }
++
++  switch (tag)
++    {
++    case -1:
++      return -1;
++
++    case DW_TAG_subrange_type:
++      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
++	{
++	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++	  typedie = dwarf_formref_die (attr, &die_mem);
++	  tag = dwarf_tag (typedie);
++	}
++      /* Fall through.  */
++
++    case DW_TAG_base_type:
++    case DW_TAG_enumeration_type:
++    case DW_TAG_pointer_type:
++    case DW_TAG_ptr_to_member_type:
++      {
++        Dwarf_Word size;
++	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
++					 &attr_mem), &size) != 0)
++	  {
++	    if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
++	      size = regsize;
++	    else
++	      return -1;
++	  }
++	if (tag == DW_TAG_base_type)
++	  {
++	    Dwarf_Word encoding;
++	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++					     &attr_mem), &encoding) != 0)
++	      return -1;
++
++#define ABI_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc))
++
++	    if (encoding == DW_ATE_float)
++	      {
++		*locp = ABI_LOC(loc_fpreg, regsize);
++		if (size <= regsize)
++		    return nloc_fpreg;
++
++		if (size <= 2*regsize)
++                  return nloc_fpregpair;
++
++		if (size <= 4*regsize && abi == MIPS_ABI_O32)
++                  return nloc_fpregquad;
++
++		goto aggregate;
++	      }
++	  }
++	*locp = ABI_LOC(loc_intreg, regsize);
++	if (size <= regsize)
++	  return nloc_intreg;
++	if (size <= 2*regsize)
++	  return nloc_intregpair;
++
++	/* Else fall through. Shouldn't happen though (at least with gcc) */
++      }
++
++    case DW_TAG_structure_type:
++    case DW_TAG_class_type:
++    case DW_TAG_union_type:
++    case DW_TAG_array_type:
++    aggregate:
++      /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
++      if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64))
++        return -2;
++
++      *locp = loc_aggregate;
++      return nloc_aggregate;
++    }
++
++  /* XXX We don't have a good way to return specific errors from ebl calls.
++     This value means we do not understand the type, but it is well-formed
++     DWARF and might be valid.  */
++  return -2;
++}
+Index: b/backends/mips_symbol.c
+===================================================================
+--- /dev/null
++++ b/backends/mips_symbol.c
+@@ -0,0 +1,52 @@
++/* MIPS specific symbolic name handling.
++   Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++   Written by Jakub Jelinek <jakub@redhat.com>, 2002.
++
++   Red Hat elfutils is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by the
++   Free Software Foundation; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License along
++   with Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND		mips_
++#include "libebl_CPU.h"
++
++/* Check for the simple reloc types.  */
++Elf_Type
++mips_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++  switch (type)
++    {
++    case R_MIPS_16:
++      return ELF_T_HALF;
++    case R_MIPS_32:
++      return ELF_T_WORD;
++    case R_MIPS_64:
++      return ELF_T_XWORD;
++    default:
++      return ELF_T_NUM;
++    }
++}
+Index: b/libebl/eblopenbackend.c
+===================================================================
+--- a/libebl/eblopenbackend.c
++++ b/libebl/eblopenbackend.c
+@@ -71,6 +71,8 @@ static const struct
+   { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 },
+   { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 },
+   { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 },
++  { "mips", "elf_mips", "mips", 4, EM_MIPS, 0, 0 },
++  { "mips", "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 },
+ 
+   { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
+   { "m68k", "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB },
+Index: b/backends/Makefile.am
+===================================================================
+--- a/backends/Makefile.am
++++ b/backends/Makefile.am
+@@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
+ 
+ 
+ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
+-	  tilegx m68k bpf parisc
++	  tilegx m68k bpf parisc mips
+ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a    \
+ 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a    \
+ 	     libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
+ 	     libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
+-	     libebl_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a
++	     libebl_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a libebl_mips_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+ 
+@@ -132,6 +132,10 @@ parisc_SRCS = parisc_init.c parisc_symbo
+ libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
+ am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
+ 
++mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c
++libebl_mips_pic_a_SOURCES = $(mips_SRCS)
++am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
++
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ 	@rm -f $(@:.so=.map)
+ 	$(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/mips_readelf_w.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/mips_readelf_w.patch
new file mode 100644
index 0000000..790930c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/mips_readelf_w.patch
@@ -0,0 +1,25 @@
+From: Kurt Roeckx <kurt@roeckx.be>
+Subject: Make readelf -w output debug information on mips
+Bug-Debian: http://bugs.debian.org/662041
+Forwarded: not-needed
+
+Upstreams wants a change where this is handled by a hook that needs
+to be filled in by the backend for the arch.
+
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Index: b/src/readelf.c
+===================================================================
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -8343,7 +8343,8 @@ print_debug (Dwfl_Module *dwflmod, Ebl *
+       GElf_Shdr shdr_mem;
+       GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ 
+-      if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
++      if (shdr != NULL && (
++	 (shdr->sh_type == SHT_PROGBITS) || (shdr->sh_type == SHT_MIPS_DWARF)))
+ 	{
+ 	  static const struct
+ 	  {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/testsuite-ignore-elflint.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/testsuite-ignore-elflint.diff
new file mode 100644
index 0000000..3df3576
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/debian/testsuite-ignore-elflint.diff
@@ -0,0 +1,42 @@
+On many architectures this test fails because binaries/libs produced by
+binutils don't pass elflint. However elfutils shouldn't FTBFS because of this.
+
+So we run the tests on all archs to see what breaks, but if it breaks we ignore
+the result (exitcode 77 means: this test was skipped).
+
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Index: b/tests/run-elflint-self.sh
+===================================================================
+--- a/tests/run-elflint-self.sh
++++ b/tests/run-elflint-self.sh
+@@ -18,4 +18,4 @@
+ 
+ . $srcdir/test-subr.sh
+ 
+-testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld
++testrun_on_self_skip ${abs_top_builddir}/src/elflint --quiet --gnu-ld
+Index: b/tests/test-subr.sh
+===================================================================
+--- a/tests/test-subr.sh
++++ b/tests/test-subr.sh
+@@ -152,3 +152,18 @@ testrun_on_self_quiet()
+   # Only exit if something failed
+   if test $exit_status != 0; then exit $exit_status; fi
+ }
++
++# Same as testrun_on_self(), but skip on failure.
++testrun_on_self_skip()
++{
++  exit_status=0
++
++  for file in $self_test_files; do
++      testrun $* $file \
++	  || { echo "*** failure in $* $file"; exit_status=77; }
++  done
++
++  # Only exit if something failed
++  if test $exit_status != 0; then exit $exit_status; fi
++}
++
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/fallthrough.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/fallthrough.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/fallthrough.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/fallthrough.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/fixheadercheck.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/fixheadercheck.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/fixheadercheck.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/fixheadercheck.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/shadow.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/shadow.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/shadow.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.168/shadow.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb
deleted file mode 100644
index d18b732..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb
+++ /dev/null
@@ -1,90 +0,0 @@
-SUMMARY = "Utilities and libraries for handling compiled object files"
-HOMEPAGE = "https://fedorahosted.org/elfutils"
-SECTION = "base"
-LICENSE = "(GPL-2+ & Elfutils-Exception)"
-LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3\
-                    file://EXCEPTION;md5=570adcb0c1218ab57f2249c67d0ce417"
-DEPENDS = "libtool bzip2 zlib virtual/libintl"
-
-PR = "r11"
-
-SRC_URI = "ftp://sourceware.org/pub/elfutils/${PV}/${BP}.tar.bz2"
-SRC_URI[md5sum] = "a0bed1130135f17ad27533b0034dba8d"
-SRC_URI[sha256sum] = "8aebfa4a745db21cf5429c9541fe482729b62efc7e53e9110151b4169fe887da"
-
-# pick the patch from debian
-# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.148-1.debian.tar.gz
-
-SRC_URI += "\
-        file://redhat-portability.diff \
-        file://redhat-robustify.diff \
-        file://hppa_backend.diff \
-        file://arm_backend.diff \
-        file://mips_backend.diff \
-        file://m68k_backend.diff \
-        file://testsuite-ignore-elflint.diff \
-        file://elf_additions.diff \
-        file://elfutils-fsize.patch \
-        file://remove-unused.patch \
-        file://fix_for_gcc-4.7.patch \
-        file://dso-link-change.patch \
-        file://nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch \
-        file://elfutils-ar-c-fix-num-passed-to-memset.patch \
-        file://Fix_elf_cvt_gunhash.patch \
-        file://elf_begin.c-CVE-2014-9447-fix.patch \
-        file://fix-build-gcc-4.8.patch \
-        file://gcc6.patch \
-"
-# Only apply when building uclibc based target recipe
-SRC_URI_append_libc-uclibc = " file://uclibc-support-for-elfutils-0.148.patch"
-
-# The buildsystem wants to generate 2 .h files from source using a binary it just built,
-# which can not pass the cross compiling, so let's work around it by adding 2 .h files
-# along with the do_configure_prepend()
-
-SRC_URI += "\
-        file://i386_dis.h \
-        file://x86_64_dis.h \
-"
-inherit autotools gettext
-
-EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
-EXTRA_OECONF_append_class-native = " --without-bzlib"
-EXTRA_OECONF_append_libc-uclibc = " --enable-uclibc"
-
-do_configure_prepend() {
-    sed -i '/^i386_dis.h:/,+4 {/.*/d}' ${S}/libcpu/Makefile.am
-
-    cp ${WORKDIR}/*dis.h ${S}/libcpu
-}
-
-# we can not build complete elfutils when using uclibc
-# but some recipes e.g. gcc 4.5 depends on libelf so we
-# build only libelf for uclibc case
-
-EXTRA_OEMAKE_libc-uclibc = "-C libelf"
-EXTRA_OEMAKE_class-native = ""
-EXTRA_OEMAKE_class-nativesdk = ""
-
-BBCLASSEXTEND = "native nativesdk"
-
-# Package utilities separately
-PACKAGES =+ "${PN}-binutils libelf libasm libdw"
-FILES_${PN}-binutils = "\
-    ${bindir}/eu-addr2line \
-    ${bindir}/eu-ld \
-    ${bindir}/eu-nm \
-    ${bindir}/eu-readelf \
-    ${bindir}/eu-size \
-    ${bindir}/eu-strip"
-
-FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
-FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
-FILES_libdw  = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
-# Some packages have the version preceeding the .so instead properly
-# versioned .so.<version>, so we need to reorder and repackage.
-#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
-#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
-
-# The package contains symlinks that trip up insane
-INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.166.bb b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.166.bb
deleted file mode 100644
index 3593c1c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.166.bb
+++ /dev/null
@@ -1,94 +0,0 @@
-SUMMARY = "Utilities and libraries for handling compiled object files"
-HOMEPAGE = "https://sourceware.org/elfutils"
-SECTION = "base"
-LICENSE = "(GPLv3 & Elfutils-Exception)"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-DEPENDS = "libtool bzip2 zlib virtual/libintl"
-DEPENDS_append_libc-musl = " argp-standalone fts "
-
-SRC_URI = "ftp://sourceware.org/pub/elfutils/${PV}/${BP}.tar.bz2"
-SRC_URI[md5sum] = "d4e462b7891915dc5326bccefa2024ff"
-SRC_URI[sha256sum] = "3c056914c8a438b210be0d790463b960fc79d234c3f05ce707cbff80e94cba30"
-
-SRC_URI += "\
-        file://dso-link-change.patch \
-        file://Fix_elf_cvt_gunhash.patch \
-        file://fixheadercheck.patch \
-        file://0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch \
-        file://0001-remove-the-unneed-checking.patch \
-        file://0001-fix-a-stack-usage-warning.patch \
-        file://aarch64_uio.patch \
-        file://Fix_one_GCC7_warning.patch \
-        file://0001-Add-GCC7-Wimplicit-fallthrough-support-fixes.patch \
-        file://shadow.patch \
-        file://0001-ar-Fix-GCC7-Wformat-length-issues.patch \
-"
-
-# pick the patch from debian
-# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.164-1.debian.tar.xz
-SRC_URI += "\
-        file://hppa_backend.diff \
-        file://arm_backend.diff \
-        file://mips_backend.diff \
-        file://m68k_backend.diff \
-        file://testsuite-ignore-elflint.diff \
-        file://mips_readelf_w.patch \
-        file://kfreebsd_path.patch \
-        file://0001-Ignore-differences-between-mips-machine-identifiers.patch \
-        file://0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \
-        file://0003-Add-mips-n64-relocation-format-hack.patch \
-        file://uclibc-support.patch \
-        file://elfcmp-fix-self-comparision.patch \
-"
-# Fix the patches from Debian with GCC7
-SRC_URI += "file://fallthrough.patch"
-SRC_URI_append_libc-musl = " file://0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch "
-
-# The buildsystem wants to generate 2 .h files from source using a binary it just built,
-# which can not pass the cross compiling, so let's work around it by adding 2 .h files
-# along with the do_configure_prepend()
-
-inherit autotools gettext
-
-EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
-EXTRA_OECONF_append_class-native = " --without-bzlib"
-EXTRA_OECONF_append_libc-uclibc = " --enable-uclibc"
-
-do_install_append() {
-	if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
-		rm -f ${D}${bindir}/eu-objdump
-	fi
-}
-
-# we can not build complete elfutils when using uclibc
-# but some recipes e.g. gcc 4.5 depends on libelf so we
-# build only libelf for uclibc case
-
-EXTRA_OEMAKE_libc-uclibc = "-C libelf"
-EXTRA_OEMAKE_class-native = ""
-EXTRA_OEMAKE_class-nativesdk = ""
-
-ALLOW_EMPTY_${PN}_libc-musl = "1"
-
-BBCLASSEXTEND = "native nativesdk"
-
-# Package utilities separately
-PACKAGES =+ "${PN}-binutils libelf libasm libdw"
-FILES_${PN}-binutils = "\
-    ${bindir}/eu-addr2line \
-    ${bindir}/eu-ld \
-    ${bindir}/eu-nm \
-    ${bindir}/eu-readelf \
-    ${bindir}/eu-size \
-    ${bindir}/eu-strip"
-
-FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
-FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
-FILES_libdw  = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
-# Some packages have the version preceeding the .so instead properly
-# versioned .so.<version>, so we need to reorder and repackage.
-#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
-#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
-
-# The package contains symlinks that trip up insane
-INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.168.bb b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.168.bb
new file mode 100644
index 0000000..b977ce0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.168.bb
@@ -0,0 +1,90 @@
+SUMMARY = "Utilities and libraries for handling compiled object files"
+HOMEPAGE = "https://sourceware.org/elfutils"
+SECTION = "base"
+LICENSE = "(GPLv3 & Elfutils-Exception)"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "libtool bzip2 zlib virtual/libintl"
+DEPENDS_append_libc-musl = " argp-standalone fts "
+SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2"
+SRC_URI[md5sum] = "52adfa40758d0d39e5d5c57689bf38d6"
+SRC_URI[sha256sum] = "b88d07893ba1373c7dd69a7855974706d05377766568a7d9002706d5de72c276"
+
+SRC_URI += "\
+        file://dso-link-change.patch \
+        file://Fix_elf_cvt_gunhash.patch \
+        file://fixheadercheck.patch \
+        file://0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch \
+        file://0001-remove-the-unneed-checking.patch \
+        file://0001-fix-a-stack-usage-warning.patch \
+        file://aarch64_uio.patch \
+        file://Fix_one_GCC7_warning.patch \
+        file://shadow.patch \
+"
+
+# pick the patch from debian
+# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.168-0.2.debian.tar.xz
+SRC_URI += "\
+        file://debian/hppa_backend.diff \
+        file://debian/arm_backend.diff \
+        file://debian/mips_backend.diff \
+        file://debian/testsuite-ignore-elflint.diff \
+        file://debian/mips_readelf_w.patch \
+        file://debian/kfreebsd_path.patch \
+        file://debian/0001-Ignore-differences-between-mips-machine-identifiers.patch \
+        file://debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \
+        file://debian/0003-Add-mips-n64-relocation-format-hack.patch \
+        file://debian/hurd_path.patch \
+        file://debian/ignore_strmerge.diff \
+"
+# Fix the patches from Debian with GCC7
+SRC_URI += "file://fallthrough.patch"
+SRC_URI_append_libc-musl = " file://0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch "
+
+# The buildsystem wants to generate 2 .h files from source using a binary it just built,
+# which can not pass the cross compiling, so let's work around it by adding 2 .h files
+# along with the do_configure_prepend()
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
+EXTRA_OECONF_append_class-native = " --without-bzlib"
+EXTRA_OECONF_append_libc-uclibc = " --enable-uclibc"
+
+do_install_append() {
+	if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
+		rm -f ${D}${bindir}/eu-objdump
+	fi
+}
+
+# we can not build complete elfutils when using uclibc
+# but some recipes e.g. gcc 4.5 depends on libelf so we
+# build only libelf for uclibc case
+
+EXTRA_OEMAKE_libc-uclibc = "-C libelf"
+EXTRA_OEMAKE_class-native = ""
+EXTRA_OEMAKE_class-nativesdk = ""
+
+ALLOW_EMPTY_${PN}_libc-musl = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Package utilities separately
+PACKAGES =+ "${PN}-binutils libelf libasm libdw"
+FILES_${PN}-binutils = "\
+    ${bindir}/eu-addr2line \
+    ${bindir}/eu-ld \
+    ${bindir}/eu-nm \
+    ${bindir}/eu-readelf \
+    ${bindir}/eu-size \
+    ${bindir}/eu-strip"
+
+FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
+FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
+FILES_libdw  = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
+# Some packages have the version preceeding the .so instead properly
+# versioned .so.<version>, so we need to reorder and repackage.
+#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
+#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
+
+# The package contains symlinks that trip up insane
+INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-Resolve-string-formatting-issues.patch b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-Resolve-string-formatting-issues.patch
new file mode 100644
index 0000000..af1d8c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-Resolve-string-formatting-issues.patch
@@ -0,0 +1,29 @@
+From 107cc370705d8520ba42f1416d89ed3544277c83 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 23 Mar 2017 13:44:41 +0200
+Subject: [PATCH] Resolve string formatting issues.
+
+Upstream-Status: Inappropriate [upstream seems dead]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ exp_clib.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/exp_clib.c b/exp_clib.c
+index 172c05e..809200e 100644
+--- a/exp_clib.c
++++ b/exp_clib.c
+@@ -1476,8 +1476,8 @@ expDiagLogU(str)
+      char *str;
+ {
+   if (exp_is_debugging) {
+-    fprintf(stderr,str);
+-    if (exp_logfile) fprintf(exp_logfile,str);
++    fprintf(stderr, "%s", str);
++    if (exp_logfile) fprintf(exp_logfile, "%s", str);
+   }
+ }
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/expect/expect_5.45.bb b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect_5.45.bb
index b4dfe15..630f2e4 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/expect/expect_5.45.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect_5.45.bb
@@ -25,6 +25,7 @@
            file://0002-tcl.m4.patch \
            file://01-example-shebang.patch \
            file://0001-expect-install-scripts-without-using-the-fixline1-tc.patch \
+           file://0001-Resolve-string-formatting-issues.patch \
           "
 SRC_URI[md5sum] = "44e1a4f4c877e9ddc5a542dfa7ecc92b"
 SRC_URI[sha256sum] = "b28dca90428a3b30e650525cdc16255d76bb6ccd65d448be53e620d95d5cc040"
@@ -43,11 +44,16 @@
         sed -e 's|$dir|${libdir}|' -i ${D}${libdir}/expect${PV}/pkgIndex.tcl
 }
 
+# Apparently the public Tcl headers are only in /usr/include/tcl8.6
+# when building for the target.
+TCL_INCLUDE_PATH = ""
+TCL_INCLUDE_PATH_class-target = "--with-tclinclude=${STAGING_INCDIR}/tcl8.6"
+
 EXTRA_OECONF += "--with-tcl=${STAGING_LIBDIR} \
-                 --with-tclinclude=${STAGING_INCDIR}/tcl8.6 \
                  --enable-shared \
                  --enable-threads \
                  --disable-rpath \
+                 ${TCL_INCLUDE_PATH} \
                 "
 EXTRA_OEMAKE_install = " 'SCRIPTS=' "
 
@@ -62,3 +68,5 @@
 FILES_${PN} += "${libdir}/libexpect${PV}.so \
                 ${libdir}/expect${PV}/* \
                "
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.1.bb
index 8fab28f..d62a903 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.1.bb
@@ -13,7 +13,7 @@
 UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/gptfdisk/files/gptfdisk/"
 UPSTREAM_CHECK_REGEX = "/gptfdisk/(?P<pver>(\d+[\.\-_]*)+)/"
 
-EXTRA_OEMAKE = "-e MAKEFLAGS="
+EXTRA_OEMAKE = "'CC=${CC}' 'CXX=${CXX}'"
 
 do_install() {
     install -d ${D}${sbindir}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.28.bb b/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.28.bb
deleted file mode 100644
index e64a89c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.28.bb
+++ /dev/null
@@ -1,48 +0,0 @@
-SUMMARY = "File classification tool"
-DESCRIPTION = "File attempts to classify files depending \
-on their contents and prints a description if a match is found."
-HOMEPAGE = "http://www.darwinsys.com/file/"
-SECTION = "console/utils"
-
-# two clause BSD
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;beginline=2;md5=6a7382872edb68d33e1a9398b6e03188"
-
-DEPENDS = "zlib file-replacement-native"
-DEPENDS_class-native = "zlib-native"
-
-# Blacklist a bogus tag in upstream check
-UPSTREAM_CHECK_GITTAGREGEX = "FILE(?P<pver>(?!6_23).+)"
-
-SRC_URI = "git://github.com/file/file.git \
-        file://debian-742262.patch \
-        file://0001-Add-P-prompt-into-Usage-info.patch \
-        "
-
-SRCREV = "3c521817322a6bf5160cfeb09b9145ccde587b2a"
-S = "${WORKDIR}/git"
-
-inherit autotools
-
-EXTRA_OEMAKE_append_class-target = "-e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
-EXTRA_OEMAKE_append_class-nativesdk = "-e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
-
-CFLAGS_append = " -std=c99"
-
-FILES_${PN} += "${datadir}/misc/*.mgc"
-
-do_install_append_class-native() {
-	create_cmdline_wrapper ${D}/${bindir}/file \
-		--magic-file ${datadir}/misc/magic.mgc
-}
-
-do_install_append_class-nativesdk() {
-	create_cmdline_wrapper ${D}/${bindir}/file \
-		--magic-file ${datadir}/misc/magic.mgc
-}
-
-BBCLASSEXTEND = "native nativesdk"
-PROVIDES_append_class-native = " file-replacement-native"
-# Don't use NATIVE_PACKAGE_PATH_SUFFIX as that hides libmagic from anyone who
-# depends on file-replacement-native.
-bindir_append_class-native = "/file-native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.30.bb b/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.30.bb
new file mode 100644
index 0000000..0998fcf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.30.bb
@@ -0,0 +1,48 @@
+SUMMARY = "File classification tool"
+DESCRIPTION = "File attempts to classify files depending \
+on their contents and prints a description if a match is found."
+HOMEPAGE = "http://www.darwinsys.com/file/"
+SECTION = "console/utils"
+
+# two clause BSD
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;beginline=2;md5=6a7382872edb68d33e1a9398b6e03188"
+
+DEPENDS = "zlib file-replacement-native"
+DEPENDS_class-native = "zlib-native"
+
+# Blacklist a bogus tag in upstream check
+UPSTREAM_CHECK_GITTAGREGEX = "FILE(?P<pver>(?!6_23).+)"
+
+SRC_URI = "git://github.com/file/file.git \
+        file://debian-742262.patch \
+        file://0001-Add-P-prompt-into-Usage-info.patch \
+        "
+
+SRCREV = "79814950aafb81ecd6a910c2a8a3b8ec12f3e4a6"
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+EXTRA_OEMAKE_append_class-target = "-e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
+EXTRA_OEMAKE_append_class-nativesdk = "-e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
+
+CFLAGS_append = " -std=c99"
+
+FILES_${PN} += "${datadir}/misc/*.mgc"
+
+do_install_append_class-native() {
+	create_cmdline_wrapper ${D}/${bindir}/file \
+		--magic-file ${datadir}/misc/magic.mgc
+}
+
+do_install_append_class-nativesdk() {
+	create_cmdline_wrapper ${D}/${bindir}/file \
+		--magic-file ${datadir}/misc/magic.mgc
+}
+
+BBCLASSEXTEND = "native nativesdk"
+PROVIDES_append_class-native = " file-replacement-native"
+# Don't use NATIVE_PACKAGE_PATH_SUFFIX as that hides libmagic from anyone who
+# depends on file-replacement-native.
+bindir_append_class-native = "/file-native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.4.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.4.inc
index 338530f..b769675 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.4.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.4.inc
@@ -89,6 +89,7 @@
            file://0057-unwind-fix-for-musl.patch \
            file://0058-fdebug-prefix-map-support-to-remap-relative-path.patch \
            file://0059-libgcc-use-ldflags.patch \
+           file://CVE-2016-6131.patch \
 "
 
 BACKPORTS = ""
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.4/CVE-2016-6131.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.4/CVE-2016-6131.patch
new file mode 100644
index 0000000..88524c3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.4/CVE-2016-6131.patch
@@ -0,0 +1,251 @@
+From b3f6b32165d3f437bd0ac6269c3c499b68ecf036 Mon Sep 17 00:00:00 2001
+From: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 4 Aug 2016 16:53:18 +0000
+Subject: [PATCH] Fix for PR71696 in Libiberty Demangler
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[BZ #71696] -- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71696
+
+2016-08-04  Marcel Böhme  <boehme.marcel@gmail.com>
+
+	PR c++/71696
+	* cplus-dem.c: Prevent infinite recursion when there is a cycle
+	in the referencing of remembered mangled types.
+	(work_stuff): New stack to keep track of the remembered mangled
+	types that are currently being processed.
+	(push_processed_type): New method to push currently processed
+	remembered type onto the stack.
+	(pop_processed_type): New method to pop currently processed
+	remembered type from the stack.
+	(work_stuff_copy_to_from): Copy values of new variables.
+	(delete_non_B_K_work_stuff): Free stack memory.
+	(demangle_args): Push/Pop currently processed remembered type.
+	(do_type): Do not demangle a cyclic reference and push/pop
+	referenced remembered type.
+
+cherry-picked from commit of
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239143 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport [master]
+CVE: CVE-2016-6131
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ libiberty/ChangeLog                   | 17 ++++++++
+ libiberty/cplus-dem.c                 | 78 ++++++++++++++++++++++++++++++++---
+ libiberty/testsuite/demangle-expected | 18 ++++++++
+ 3 files changed, 108 insertions(+), 5 deletions(-)
+
+diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
+index 9859ad3..7939480 100644
+--- a/libiberty/ChangeLog
++++ b/libiberty/ChangeLog
+@@ -1,3 +1,20 @@
++2016-08-04  Marcel Böhme  <boehme.marcel@gmail.com>
++
++	PR c++/71696
++	* cplus-dem.c: Prevent infinite recursion when there is a cycle
++	in the referencing of remembered mangled types.
++	(work_stuff): New stack to keep track of the remembered mangled
++	types that are currently being processed.
++	(push_processed_type): New method to push currently processed
++	remembered type onto the stack.
++	(pop_processed_type): New method to pop currently processed
++	remembered type from the stack.
++	(work_stuff_copy_to_from): Copy values of new variables.
++	(delete_non_B_K_work_stuff): Free stack memory.
++	(demangle_args): Push/Pop currently processed remembered type.
++	(do_type): Do not demangle a cyclic reference and push/pop
++	referenced remembered type.
++
+ 2016-06-03  Release Manager
+ 
+ 	* GCC 5.4.0 released.
+diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
+index 7514e57..f21e630 100644
+--- a/libiberty/cplus-dem.c
++++ b/libiberty/cplus-dem.c
+@@ -144,6 +144,9 @@ struct work_stuff
+   string* previous_argument; /* The last function argument demangled.  */
+   int nrepeats;         /* The number of times to repeat the previous
+ 			   argument.  */
++  int *proctypevec;     /* Indices of currently processed remembered typevecs.  */
++  int proctypevec_size;
++  int nproctypes;
+ };
+ 
+ #define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI)
+@@ -435,6 +438,10 @@ iterate_demangle_function (struct work_stuff *,
+ 
+ static void remember_type (struct work_stuff *, const char *, int);
+ 
++static void push_processed_type (struct work_stuff *, int);
++
++static void pop_processed_type (struct work_stuff *);
++
+ static void remember_Btype (struct work_stuff *, const char *, int, int);
+ 
+ static int register_Btype (struct work_stuff *);
+@@ -1301,6 +1308,10 @@ work_stuff_copy_to_from (struct work_stuff *to, struct work_stuff *from)
+       memcpy (to->btypevec[i], from->btypevec[i], len);
+     }
+ 
++  if (from->proctypevec)
++    to->proctypevec =
++      XDUPVEC (int, from->proctypevec, from->proctypevec_size);
++
+   if (from->ntmpl_args)
+     to->tmpl_argvec = XNEWVEC (char *, from->ntmpl_args);
+ 
+@@ -1329,11 +1340,17 @@ delete_non_B_K_work_stuff (struct work_stuff *work)
+   /* Discard the remembered types, if any.  */
+ 
+   forget_types (work);
+-  if (work -> typevec != NULL)
++  if (work->typevec != NULL)
+     {
+-      free ((char *) work -> typevec);
+-      work -> typevec = NULL;
+-      work -> typevec_size = 0;
++      free ((char *) work->typevec);
++      work->typevec = NULL;
++      work->typevec_size = 0;
++    }
++  if (work->proctypevec != NULL)
++    {
++      free (work->proctypevec);
++      work->proctypevec = NULL;
++      work->proctypevec_size = 0;
+     }
+   if (work->tmpl_argvec)
+     {
+@@ -3552,6 +3569,8 @@ static int
+ do_type (struct work_stuff *work, const char **mangled, string *result)
+ {
+   int n;
++  int i;
++  int is_proctypevec;
+   int done;
+   int success;
+   string decl;
+@@ -3564,6 +3583,7 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
+ 
+   done = 0;
+   success = 1;
++  is_proctypevec = 0;
+   while (success && !done)
+     {
+       int member;
+@@ -3616,8 +3636,15 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
+ 	      success = 0;
+ 	    }
+ 	  else
++	    for (i = 0; i < work->nproctypes; i++)
++	      if (work -> proctypevec [i] == n)
++	        success = 0;
++
++	  if (success)
+ 	    {
+-	      remembered_type = work -> typevec[n];
++	      is_proctypevec = 1;
++	      push_processed_type (work, n);
++	      remembered_type = work->typevec[n];
+ 	      mangled = &remembered_type;
+ 	    }
+ 	  break;
+@@ -3840,6 +3867,9 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
+     string_delete (result);
+   string_delete (&decl);
+ 
++  if (is_proctypevec)
++    pop_processed_type (work);
++
+   if (success)
+     /* Assume an integral type, if we're not sure.  */
+     return (int) ((tk == tk_none) ? tk_integral : tk);
+@@ -4252,6 +4282,41 @@ do_arg (struct work_stuff *work, const char **mangled, string *result)
+ }
+ 
+ static void
++push_processed_type (struct work_stuff *work, int typevec_index)
++{
++  if (work->nproctypes >= work->proctypevec_size)
++    {
++      if (!work->proctypevec_size)
++	{
++	  work->proctypevec_size = 4;
++	  work->proctypevec = XNEWVEC (int, work->proctypevec_size);
++	}
++      else
++	{
++	  if (work->proctypevec_size < 16)
++	    /* Double when small.  */
++	    work->proctypevec_size *= 2;
++	  else
++	    {
++	      /* Grow slower when large.  */
++	      if (work->proctypevec_size > (INT_MAX / 3) * 2)
++                xmalloc_failed (INT_MAX);
++              work->proctypevec_size = (work->proctypevec_size * 3 / 2);
++	    }
++          work->proctypevec
++            = XRESIZEVEC (int, work->proctypevec, work->proctypevec_size);
++	}
++    }
++    work->proctypevec [work->nproctypes++] = typevec_index;
++}
++
++static void
++pop_processed_type (struct work_stuff *work)
++{
++  work->nproctypes--;
++}
++
++static void
+ remember_type (struct work_stuff *work, const char *start, int len)
+ {
+   char *tem;
+@@ -4515,10 +4580,13 @@ demangle_args (struct work_stuff *work, const char **mangled,
+ 		{
+ 		  string_append (declp, ", ");
+ 		}
++	      push_processed_type (work, t);
+ 	      if (!do_arg (work, &tem, &arg))
+ 		{
++		  pop_processed_type (work);
+ 		  return (0);
+ 		}
++	      pop_processed_type (work);
+ 	      if (PRINT_ARG_TYPES)
+ 		{
+ 		  string_appends (declp, &arg);
+diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
+index 1d8b771..d690b23 100644
+--- a/libiberty/testsuite/demangle-expected
++++ b/libiberty/testsuite/demangle-expected
+@@ -4429,3 +4429,21 @@ __vt_90000000000cafebabe
+ 
+ _Z80800000000000000000000
+ _Z80800000000000000000000
++#
++# Tests write access violation PR70926
++
++0__Ot2m02R5T0000500000
++0__Ot2m02R5T0000500000
++#
++
++0__GT50000000000_
++0__GT50000000000_
++#
++
++__t2m05B500000000000000000_
++__t2m05B500000000000000000_
++#
++# Tests stack overflow PR71696
++
++__10%0__S4_0T0T0
++%0<>::%0(%0<>)
+-- 
+2.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2.inc
deleted file mode 100644
index 39ae653..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2.inc
+++ /dev/null
@@ -1,134 +0,0 @@
-require gcc-common.inc
-
-# Third digit in PV should be incremented after a minor release
-
-PV = "6.2.0"
-
-# BINV should be incremented to a revision after a minor gcc release
-
-BINV = "6.2.0"
-
-FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-6.2:${FILE_DIRNAME}/gcc-6.2/backport:"
-
-DEPENDS =+ "mpfr gmp libmpc zlib"
-NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native"
-
-LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
-
-LIC_FILES_CHKSUM = "\
-    file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
-    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
-    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
-    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
-    file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
-"
-
-
-BASEURI ?= "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2"
-#SRCREV = "bd9a826d5448db11d29d2ec5884e7e679066f140"
-#BASEURI ?= "git://github.com/gcc-mirror/gcc;branch=gcc-6-branch;protocol=git"
-#BASEURI ?= "ftp://sourceware.org/pub/gcc/snapshots/6.2.0-RC-20160815/gcc-6.2.0-RC-20160815.tar.bz2"
-
-SRC_URI = "\
-           ${BASEURI} \
-           file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
-           file://0002-uclibc-conf.patch \
-           file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
-           file://0004-uclibc-locale.patch \
-           file://0005-uclibc-locale-no__x.patch \
-           file://0006-uclibc-locale-wchar_fix.patch \
-           file://0007-uclibc-locale-update.patch \
-           file://0008-missing-execinfo_h.patch \
-           file://0009-c99-snprintf.patch \
-           file://0010-gcc-poison-system-directories.patch \
-           file://0011-gcc-poison-dir-extend.patch \
-           file://0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
-           file://0013-64-bit-multilib-hack.patch \
-           file://0014-optional-libstdc.patch \
-           file://0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
-           file://0016-COLLECT_GCC_OPTIONS.patch \
-           file://0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
-           file://0018-fortran-cross-compile-hack.patch \
-           file://0019-cpp-honor-sysroot.patch \
-           file://0020-MIPS64-Default-to-N64-ABI.patch \
-           file://0021-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
-           file://0022-gcc-Fix-argument-list-too-long-error.patch \
-           file://0023-Disable-sdt.patch \
-           file://0024-libtool.patch \
-           file://0025-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
-           file://0026-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
-           file://0027-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \
-           file://0028-export-CPP.patch \
-           file://0029-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
-           file://0030-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch \
-           file://0031-Ensure-target-gcc-headers-can-be-included.patch \
-           file://0032-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch \
-           file://0033-Don-t-search-host-directory-during-relink-if-inst_pr.patch \
-           file://0034-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
-           file://0035-aarch64-Add-support-for-musl-ldso.patch \
-           file://0036-libcc1-fix-libcc1-s-install-path-and-rpath.patch \
-           file://0037-handle-sysroot-support-for-nativesdk-gcc.patch \
-           file://0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch \
-           file://0039-Fix-various-_FOR_BUILD-and-related-variables.patch \
-           file://0040-nios2-Define-MUSL_DYNAMIC_LINKER.patch \
-           file://0041-ssp_nonshared.patch \
-           file://0042-gcc-libcpp-support-ffile-prefix-map-old-new.patch \
-           file://0043-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
-           file://0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch \
-           file://0045-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch \
-           file://0046-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
-           file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
-           ${BACKPORTS} \
-"
-BACKPORTS = "\
-           file://ubsan-fix-check-empty-string.patch \
-"
-SRC_URI[md5sum] = "9768625159663b300ae4de2f4745fcc4"
-SRC_URI[sha256sum] = "9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5"
-
-S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
-#S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/git"
-B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
-
-# Language Overrides
-FORTRAN = ""
-JAVA = ""
-
-LTO = "--enable-lto"
-
-EXTRA_OECONF_BASE = "\
-    ${LTO} \
-    --enable-libssp \
-    --enable-libitm \
-    --disable-bootstrap \
-    --disable-libmudflap \
-    --with-system-zlib \
-    --with-linker-hash-style=${LINKER_HASH_STYLE} \
-    --enable-linker-build-id \
-    --with-ppl=no \
-    --with-cloog=no \
-    --enable-checking=release \
-    --enable-cheaders=c_global \
-    --without-isl \
-"
-
-EXTRA_OECONF_INITIAL = "\
-    --disable-libmudflap \
-    --disable-libgomp \
-    --disable-libitm \
-    --disable-libquadmath \
-    --with-system-zlib \
-    --disable-lto \
-    --disable-plugin \
-    --enable-decimal-float=no \
-    --without-isl \
-    gcc_cv_libc_provides_ssp=yes \
-"
-
-EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
-
-EXTRA_OECONF_PATHS = "\
-    --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
-    --with-sysroot=/not/exist \
-    --with-build-sysroot=${STAGING_DIR_TARGET} \
-"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0041-ssp_nonshared.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0041-ssp_nonshared.patch
deleted file mode 100644
index 0744529..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0041-ssp_nonshared.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 551a5db7acb56e085a101f1c222d51b2c1b039a4 Mon Sep 17 00:00:00 2001
-From: Szabolcs Nagy <nsz@port70.net>
-Date: Sat, 7 Nov 2015 14:58:40 +0000
-Subject: [PATCH 41/46] ssp_nonshared
-
----
-Upstream-Status: Inappropriate [OE Configuration]
-
- gcc/gcc.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/gcc/gcc.c b/gcc/gcc.c
-index 2812819..9de96ee 100644
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -863,7 +863,8 @@ proper position among the other output files.  */
- #ifndef LINK_SSP_SPEC
- #ifdef TARGET_LIBC_PROVIDES_SSP
- #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
--		       "|fstack-protector-strong|fstack-protector-explicit:}"
-+		       "|fstack-protector-strong|fstack-protector-explicit" \
-+		       ":-lssp_nonshared}"
- #else
- #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
- 		       "|fstack-protector-strong|fstack-protector-explicit" \
--- 
-2.8.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0048-ARM-PR-target-71056-Don-t-use-vectorized-builtins-wh.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0048-ARM-PR-target-71056-Don-t-use-vectorized-builtins-wh.patch
deleted file mode 100644
index 9c39c7f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0048-ARM-PR-target-71056-Don-t-use-vectorized-builtins-wh.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 84d2a5509892b65ed60d39e6e2f9719e3762e40e Mon Sep 17 00:00:00 2001
-From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Tue, 31 May 2016 08:29:39 +0000
-Subject: [PATCH] [ARM] PR target/71056: Don't use vectorized builtins when
- NEON is not available
-
-	PR target/71056
-	* config/arm/arm-builtins.c (arm_builtin_vectorized_function): Return
-	NULL_TREE early if NEON is not available.  Remove now redundant check
-	in ARM_CHECK_BUILTIN_MODE.
-
-	* gcc.target/arm/pr71056.c: New test.
-
-
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@236910 138bc75d-0d04-0410-961f-82ee72b054a4
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- gcc/ChangeLog                          |  7 +++++++
- gcc/config/arm/arm-builtins.c          |  6 +++++-
- gcc/testsuite/ChangeLog                |  5 +++++
- gcc/testsuite/gcc.target/arm/pr71056.c | 32 ++++++++++++++++++++++++++++++++
- 4 files changed, 49 insertions(+), 1 deletion(-)
- create mode 100644 gcc/testsuite/gcc.target/arm/pr71056.c
-
-diff --git a/gcc/config/arm/arm-builtins.c b/gcc/config/arm/arm-builtins.c
-index 90fb40f..68b2839 100644
---- a/gcc/config/arm/arm-builtins.c
-+++ b/gcc/config/arm/arm-builtins.c
-@@ -2861,6 +2861,10 @@ arm_builtin_vectorized_function (unsigned int fn, tree type_out, tree type_in)
-   int in_n, out_n;
-   bool out_unsigned_p = TYPE_UNSIGNED (type_out);
- 
-+  /* Can't provide any vectorized builtins when we can't use NEON.  */
-+  if (!TARGET_NEON)
-+    return NULL_TREE;
-+
-   if (TREE_CODE (type_out) != VECTOR_TYPE
-       || TREE_CODE (type_in) != VECTOR_TYPE)
-     return NULL_TREE;
-@@ -2875,7 +2879,7 @@ arm_builtin_vectorized_function (unsigned int fn, tree type_out, tree type_in)
-    NULL_TREE is returned if no such builtin is available.  */
- #undef ARM_CHECK_BUILTIN_MODE
- #define ARM_CHECK_BUILTIN_MODE(C)    \
--  (TARGET_NEON && TARGET_FPU_ARMV8   \
-+  (TARGET_FPU_ARMV8   \
-    && flag_unsafe_math_optimizations \
-    && ARM_CHECK_BUILTIN_MODE_1 (C))
- 
-diff --git a/gcc/testsuite/gcc.target/arm/pr71056.c b/gcc/testsuite/gcc.target/arm/pr71056.c
-new file mode 100644
-index 0000000..136754e
---- /dev/null
-+++ b/gcc/testsuite/gcc.target/arm/pr71056.c
-@@ -0,0 +1,32 @@
-+/* PR target/71056.  */
-+/* { dg-do compile } */
-+/* { dg-require-effective-target arm_vfp3_ok } */
-+/* { dg-options "-O3 -mfpu=vfpv3" } */
-+
-+/* Check that compiling for a non-NEON target doesn't try to introduce
-+   a NEON vectorized builtin.  */
-+
-+extern char *buff;
-+int f2 ();
-+struct T1
-+{
-+  int reserved[2];
-+  unsigned int ip;
-+  unsigned short cs;
-+  unsigned short rsrv2;
-+};
-+void
-+f3 (const char *p)
-+{
-+  struct T1 x;
-+  __builtin_memcpy (&x, p, sizeof (struct T1));
-+  x.reserved[0] = __builtin_bswap32 (x.reserved[0]);
-+  x.reserved[1] = __builtin_bswap32 (x.reserved[1]);
-+  x.ip = __builtin_bswap32 (x.ip);
-+  x.cs = x.cs << 8 | x.cs >> 8;
-+  x.rsrv2 = x.rsrv2 << 8 | x.rsrv2 >> 8;
-+  if (f2 ())
-+    {
-+      __builtin_memcpy (buff, "\n", 1);
-+    }
-+}
--- 
-2.9.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/CVE-2016-4490.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/CVE-2016-4490.patch
deleted file mode 100644
index f32e91d..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/CVE-2016-4490.patch
+++ /dev/null
@@ -1,290 +0,0 @@
-From 7d235b1b5ea35352c54957ef5530d9a02c46962f Mon Sep 17 00:00:00 2001
-From: bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Mon, 2 May 2016 17:06:40 +0000
-Subject: [PATCH] =?UTF-8?q?Demangler=20integer=20overflow=20fixes=20from?=
- =?UTF-8?q?=20Marcel=20B=C3=B6hme.?=
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-	PR c++/70498
-	* cp-demangle.c: Parse numbers as integer instead of long to avoid
-	overflow after sanity checks. Include <limits.h> if available.
-	(INT_MAX): Define if necessary.
-	(d_make_template_param): Takes integer argument instead of long.
-	(d_make_function_param): Likewise.
-	(d_append_num): Likewise.
-	(d_identifier): Likewise.
-	(d_number): Parse as and return integer.
-	(d_compact_number): Handle overflow.
-	(d_source_name): Change variable type to integer for parsed number.
-	(d_java_resource): Likewise.
-	(d_special_name): Likewise.
-	(d_discriminator): Likewise.
-	(d_unnamed_type): Likewise.
-	* testsuite/demangle-expected: Add regression test cases.
-
-
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235767 138bc75d-0d04-0410-961f-82ee72b054a4
-
-Upstream-Status: Backport
-CVE:  CVE-2016-4490
-[Yocto #9632]
-
-Signed-off-by: Armin Kuster <akuster@mvista.com>
-
----
- libiberty/ChangeLog                   | 19 +++++++++++++
- libiberty/cp-demangle.c               | 52 ++++++++++++++++++++---------------
- libiberty/testsuite/demangle-expected | 14 ++++++++--
- 3 files changed, 61 insertions(+), 24 deletions(-)
-
-Index: git/libiberty/ChangeLog
-===================================================================
---- git.orig/libiberty/ChangeLog
-+++ git/libiberty/ChangeLog
-@@ -1,3 +1,22 @@
-+2016-05-02  Marcel Böhme  <boehme.marcel@gmail.com>
-+
-+   PR c++/70498
-+   * cp-demangle.c: Parse numbers as integer instead of long to avoid
-+   overflow after sanity checks. Include <limits.h> if available.
-+   (INT_MAX): Define if necessary.
-+   (d_make_template_param): Takes integer argument instead of long.
-+   (d_make_function_param): Likewise.
-+   (d_append_num): Likewise.
-+   (d_identifier): Likewise.
-+   (d_number): Parse as and return integer.
-+   (d_compact_number): Handle overflow.
-+   (d_source_name): Change variable type to integer for parsed number.
-+   (d_java_resource): Likewise.
-+   (d_special_name): Likewise.
-+   (d_discriminator): Likewise.
-+   (d_unnamed_type): Likewise.
-+   * testsuite/demangle-expected: Add regression test cases.
-+
- 2016-04-27  Release Manager
- 
- 	* GCC 6.1.0 released.
-Index: git/libiberty/cp-demangle.c
-===================================================================
---- git.orig/libiberty/cp-demangle.c
-+++ git/libiberty/cp-demangle.c
-@@ -128,6 +128,13 @@ extern char *alloca ();
- # endif /* alloca */
- #endif /* HAVE_ALLOCA_H */
- 
-+#ifdef HAVE_LIMITS_H
-+#include <limits.h>
-+#endif
-+#ifndef INT_MAX
-+# define INT_MAX       (int)(((unsigned int) ~0) >> 1)          /* 0x7FFFFFFF */
-+#endif
-+
- #include "ansidecl.h"
- #include "libiberty.h"
- #include "demangle.h"
-@@ -398,7 +405,7 @@ d_make_dtor (struct d_info *, enum gnu_v
-              struct demangle_component *);
- 
- static struct demangle_component *
--d_make_template_param (struct d_info *, long);
-+d_make_template_param (struct d_info *, int);
- 
- static struct demangle_component *
- d_make_sub (struct d_info *, const char *, int);
-@@ -421,9 +428,9 @@ static struct demangle_component *d_unqu
- 
- static struct demangle_component *d_source_name (struct d_info *);
- 
--static long d_number (struct d_info *);
-+static int d_number (struct d_info *);
- 
--static struct demangle_component *d_identifier (struct d_info *, long);
-+static struct demangle_component *d_identifier (struct d_info *, int);
- 
- static struct demangle_component *d_operator_name (struct d_info *);
- 
-@@ -1119,7 +1126,7 @@ d_make_dtor (struct d_info *di, enum gnu
- /* Add a new template parameter.  */
- 
- static struct demangle_component *
--d_make_template_param (struct d_info *di, long i)
-+d_make_template_param (struct d_info *di, int i)
- {
-   struct demangle_component *p;
- 
-@@ -1135,7 +1142,7 @@ d_make_template_param (struct d_info *di
- /* Add a new function parameter.  */
- 
- static struct demangle_component *
--d_make_function_param (struct d_info *di, long i)
-+d_make_function_param (struct d_info *di, int i)
- {
-   struct demangle_component *p;
- 
-@@ -1620,7 +1627,7 @@ d_unqualified_name (struct d_info *di)
- static struct demangle_component *
- d_source_name (struct d_info *di)
- {
--  long len;
-+  int len;
-   struct demangle_component *ret;
- 
-   len = d_number (di);
-@@ -1633,12 +1640,12 @@ d_source_name (struct d_info *di)
- 
- /* number ::= [n] <(non-negative decimal integer)>  */
- 
--static long
-+static int
- d_number (struct d_info *di)
- {
-   int negative;
-   char peek;
--  long ret;
-+  int ret;
- 
-   negative = 0;
-   peek = d_peek_char (di);
-@@ -1681,7 +1688,7 @@ d_number_component (struct d_info *di)
- /* identifier ::= <(unqualified source code identifier)>  */
- 
- static struct demangle_component *
--d_identifier (struct d_info *di, long len)
-+d_identifier (struct d_info *di, int len)
- {
-   const char *name;
- 
-@@ -1702,7 +1709,7 @@ d_identifier (struct d_info *di, long le
-   /* Look for something which looks like a gcc encoding of an
-      anonymous namespace, and replace it with a more user friendly
-      name.  */
--  if (len >= (long) ANONYMOUS_NAMESPACE_PREFIX_LEN + 2
-+  if (len >= (int) ANONYMOUS_NAMESPACE_PREFIX_LEN + 2
-       && memcmp (name, ANONYMOUS_NAMESPACE_PREFIX,
- 		 ANONYMOUS_NAMESPACE_PREFIX_LEN) == 0)
-     {
-@@ -1870,7 +1877,7 @@ d_java_resource (struct d_info *di)
- {
-   struct demangle_component *p = NULL;
-   struct demangle_component *next = NULL;
--  long len, i;
-+  int len, i;
-   char c;
-   const char *str;
- 
-@@ -2012,7 +2019,7 @@ d_special_name (struct d_info *di)
- 	case 'C':
- 	  {
- 	    struct demangle_component *derived_type;
--	    long offset;
-+	    int offset;
- 	    struct demangle_component *base_type;
- 
- 	    derived_type = cplus_demangle_type (di);
-@@ -2946,10 +2953,10 @@ d_pointer_to_member_type (struct d_info
- 
- /* <non-negative number> _ */
- 
--static long
-+static int
- d_compact_number (struct d_info *di)
- {
--  long num;
-+  int num;
-   if (d_peek_char (di) == '_')
-     num = 0;
-   else if (d_peek_char (di) == 'n')
-@@ -2957,7 +2964,7 @@ d_compact_number (struct d_info *di)
-   else
-     num = d_number (di) + 1;
- 
--  if (! d_check_char (di, '_'))
-+  if (num < 0 || ! d_check_char (di, '_'))
-     return -1;
-   return num;
- }
-@@ -2969,7 +2976,7 @@ d_compact_number (struct d_info *di)
- static struct demangle_component *
- d_template_param (struct d_info *di)
- {
--  long param;
-+  int param;
- 
-   if (! d_check_char (di, 'T'))
-     return NULL;
-@@ -3171,9 +3178,10 @@ d_expression_1 (struct d_info *di)
- 	}
-       else
- 	{
--	  index = d_compact_number (di) + 1;
--	  if (index == 0)
-+	  index = d_compact_number (di);
-+	  if (index == INT_MAX || index == -1)
- 	    return NULL;
-+	  index ++;
- 	}
-       return d_make_function_param (di, index);
-     }
-@@ -3502,7 +3510,7 @@ d_local_name (struct d_info *di)
- static int
- d_discriminator (struct d_info *di)
- {
--  long discrim;
-+  int discrim;
- 
-   if (d_peek_char (di) != '_')
-     return 1;
-@@ -3558,7 +3566,7 @@ static struct demangle_component *
- d_unnamed_type (struct d_info *di)
- {
-   struct demangle_component *ret;
--  long num;
-+  int num;
- 
-   if (! d_check_char (di, 'U'))
-     return NULL;
-@@ -4086,10 +4094,10 @@ d_append_string (struct d_print_info *dp
- }
- 
- static inline void
--d_append_num (struct d_print_info *dpi, long l)
-+d_append_num (struct d_print_info *dpi, int l)
- {
-   char buf[25];
--  sprintf (buf,"%ld", l);
-+  sprintf (buf,"%d", l);
-   d_append_string (dpi, buf);
- }
- 
-Index: git/libiberty/testsuite/demangle-expected
-===================================================================
---- git.orig/libiberty/testsuite/demangle-expected
-+++ git/libiberty/testsuite/demangle-expected
-@@ -4422,12 +4422,22 @@ void baz<int>(A<sizeof (foo((int)(), (fl
- _Z3fooI1FEN1XIXszdtcl1PclcvT__EEE5arrayEE4TypeEv
- X<sizeof ((P(((F)())())).array)>::Type foo<F>()
- #
--# Tests a use-after-free problem
-+# Tests a use-after-free problem PR70481
- 
- _Q.__0
- ::Q.(void)
- #
--# Tests a use-after-free problem
-+# Tests a use-after-free problem PR70481
- 
- _Q10-__9cafebabe.
- cafebabe.::-(void)
-+#
-+# Tests integer overflow problem PR70492
-+
-+__vt_90000000000cafebabe
-+__vt_90000000000cafebabe
-+#
-+# Tests write access violation PR70498
-+
-+_Z80800000000000000000000
-+_Z80800000000000000000000
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3.inc
new file mode 100644
index 0000000..5c81a33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3.inc
@@ -0,0 +1,138 @@
+require gcc-common.inc
+
+# Third digit in PV should be incremented after a minor release
+
+PV = "6.3.0"
+
+# BINV should be incremented to a revision after a minor gcc release
+
+BINV = "6.3.0"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-6.3:${FILE_DIRNAME}/gcc-6.3/backport:"
+
+DEPENDS =+ "mpfr gmp libmpc zlib"
+NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native"
+
+LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
+
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+    file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
+"
+
+
+BASEURI ?= "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2"
+#SRCREV = "bd9a826d5448db11d29d2ec5884e7e679066f140"
+#BASEURI ?= "git://github.com/gcc-mirror/gcc;branch=gcc-6-branch;protocol=git"
+#BASEURI ?= "ftp://sourceware.org/pub/gcc/snapshots/6.2.0-RC-20160815/gcc-6.2.0-RC-20160815.tar.bz2"
+
+SRC_URI = "\
+           ${BASEURI} \
+           file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
+           file://0002-uclibc-conf.patch \
+           file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
+           file://0004-uclibc-locale.patch \
+           file://0005-uclibc-locale-no__x.patch \
+           file://0006-uclibc-locale-wchar_fix.patch \
+           file://0007-uclibc-locale-update.patch \
+           file://0008-missing-execinfo_h.patch \
+           file://0009-c99-snprintf.patch \
+           file://0010-gcc-poison-system-directories.patch \
+           file://0011-gcc-poison-dir-extend.patch \
+           file://0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+           file://0013-64-bit-multilib-hack.patch \
+           file://0014-optional-libstdc.patch \
+           file://0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+           file://0016-COLLECT_GCC_OPTIONS.patch \
+           file://0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+           file://0018-fortran-cross-compile-hack.patch \
+           file://0019-cpp-honor-sysroot.patch \
+           file://0020-MIPS64-Default-to-N64-ABI.patch \
+           file://0021-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+           file://0022-gcc-Fix-argument-list-too-long-error.patch \
+           file://0023-Disable-sdt.patch \
+           file://0024-libtool.patch \
+           file://0025-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+           file://0026-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+           file://0027-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \
+           file://0028-export-CPP.patch \
+           file://0029-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+           file://0030-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch \
+           file://0031-Ensure-target-gcc-headers-can-be-included.patch \
+           file://0032-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch \
+           file://0033-Don-t-search-host-directory-during-relink-if-inst_pr.patch \
+           file://0034-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
+           file://0035-aarch64-Add-support-for-musl-ldso.patch \
+           file://0036-libcc1-fix-libcc1-s-install-path-and-rpath.patch \
+           file://0037-handle-sysroot-support-for-nativesdk-gcc.patch \
+           file://0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch \
+           file://0039-Fix-various-_FOR_BUILD-and-related-variables.patch \
+           file://0040-nios2-Define-MUSL_DYNAMIC_LINKER.patch \
+           file://0041-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \
+           file://0042-gcc-libcpp-support-ffile-prefix-map-old-new.patch \
+           file://0043-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
+           file://0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch \
+           file://0045-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch \
+           file://0046-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
+           file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
+           file://0048-sync-gcc-stddef.h-with-musl.patch \
+           file://0054_all_nopie-all-flags.patch \
+           file://0055-unwind_h-glibc26.patch \
+           ${BACKPORTS} \
+"
+BACKPORTS = "\
+           file://CVE-2016-6131.patch \
+           file://ubsan-fix-check-empty-string.patch \
+"
+SRC_URI[md5sum] = "677a7623c7ef6ab99881bc4e048debb6"
+SRC_URI[sha256sum] = "f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f"
+
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+#S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/git"
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+# Language Overrides
+FORTRAN = ""
+JAVA = ""
+
+LTO = "--enable-lto"
+
+EXTRA_OECONF_BASE = "\
+    ${LTO} \
+    --enable-libssp \
+    --enable-libitm \
+    --disable-bootstrap \
+    --disable-libmudflap \
+    --with-system-zlib \
+    --with-linker-hash-style=${LINKER_HASH_STYLE} \
+    --enable-linker-build-id \
+    --with-ppl=no \
+    --with-cloog=no \
+    --enable-checking=release \
+    --enable-cheaders=c_global \
+    --without-isl \
+"
+
+EXTRA_OECONF_INITIAL = "\
+    --disable-libmudflap \
+    --disable-libgomp \
+    --disable-libitm \
+    --disable-libquadmath \
+    --with-system-zlib \
+    --disable-lto \
+    --disable-plugin \
+    --enable-decimal-float=no \
+    --without-isl \
+    gcc_cv_libc_provides_ssp=yes \
+"
+
+EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
+
+EXTRA_OECONF_PATHS = "\
+    --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
+    --with-sysroot=/not/exist \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0002-uclibc-conf.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0002-uclibc-conf.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0002-uclibc-conf.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0002-uclibc-conf.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0003-gcc-uclibc-locale-ctype_touplow_t.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0003-gcc-uclibc-locale-ctype_touplow_t.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0003-gcc-uclibc-locale-ctype_touplow_t.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0004-uclibc-locale.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0004-uclibc-locale.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0004-uclibc-locale.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0004-uclibc-locale.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0005-uclibc-locale-no__x.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0005-uclibc-locale-no__x.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0005-uclibc-locale-no__x.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0005-uclibc-locale-no__x.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0006-uclibc-locale-wchar_fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0006-uclibc-locale-wchar_fix.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0006-uclibc-locale-wchar_fix.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0006-uclibc-locale-wchar_fix.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0007-uclibc-locale-update.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0007-uclibc-locale-update.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0007-uclibc-locale-update.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0007-uclibc-locale-update.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0008-missing-execinfo_h.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0008-missing-execinfo_h.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0008-missing-execinfo_h.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0008-missing-execinfo_h.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0009-c99-snprintf.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0009-c99-snprintf.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0009-c99-snprintf.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0009-c99-snprintf.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0010-gcc-poison-system-directories.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0010-gcc-poison-system-directories.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0010-gcc-poison-system-directories.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0010-gcc-poison-system-directories.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0011-gcc-poison-dir-extend.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0011-gcc-poison-dir-extend.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0011-gcc-poison-dir-extend.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0011-gcc-poison-dir-extend.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0013-64-bit-multilib-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0013-64-bit-multilib-hack.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0013-64-bit-multilib-hack.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0013-64-bit-multilib-hack.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0014-optional-libstdc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0014-optional-libstdc.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0014-optional-libstdc.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0014-optional-libstdc.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0016-COLLECT_GCC_OPTIONS.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0016-COLLECT_GCC_OPTIONS.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0016-COLLECT_GCC_OPTIONS.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0016-COLLECT_GCC_OPTIONS.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0018-fortran-cross-compile-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0018-fortran-cross-compile-hack.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0018-fortran-cross-compile-hack.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0018-fortran-cross-compile-hack.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0019-cpp-honor-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0019-cpp-honor-sysroot.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0019-cpp-honor-sysroot.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0019-cpp-honor-sysroot.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0020-MIPS64-Default-to-N64-ABI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0020-MIPS64-Default-to-N64-ABI.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0020-MIPS64-Default-to-N64-ABI.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0020-MIPS64-Default-to-N64-ABI.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0021-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0021-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0021-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0021-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0022-gcc-Fix-argument-list-too-long-error.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0022-gcc-Fix-argument-list-too-long-error.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0022-gcc-Fix-argument-list-too-long-error.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0022-gcc-Fix-argument-list-too-long-error.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0023-Disable-sdt.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0023-Disable-sdt.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0023-Disable-sdt.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0023-Disable-sdt.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0024-libtool.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0024-libtool.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0024-libtool.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0024-libtool.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0025-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0025-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0025-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0025-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0026-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0026-Use-the-multilib-config-files-from-B-instead-of-usin.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0026-Use-the-multilib-config-files-from-B-instead-of-usin.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0026-Use-the-multilib-config-files-from-B-instead-of-usin.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0027-Avoid-using-libdir-from-.la-which-usually-points-to-.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0027-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0027-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0027-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0028-export-CPP.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0028-export-CPP.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0028-export-CPP.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0028-export-CPP.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0029-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0029-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0029-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0029-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0030-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0030-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0030-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0030-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0031-Ensure-target-gcc-headers-can-be-included.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0031-Ensure-target-gcc-headers-can-be-included.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0031-Ensure-target-gcc-headers-can-be-included.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0031-Ensure-target-gcc-headers-can-be-included.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0032-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0032-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0032-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0032-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0033-Don-t-search-host-directory-during-relink-if-inst_pr.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0033-Don-t-search-host-directory-during-relink-if-inst_pr.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0033-Don-t-search-host-directory-during-relink-if-inst_pr.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0033-Don-t-search-host-directory-during-relink-if-inst_pr.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0034-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0034-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0034-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0034-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0035-aarch64-Add-support-for-musl-ldso.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0035-aarch64-Add-support-for-musl-ldso.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0035-aarch64-Add-support-for-musl-ldso.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0035-aarch64-Add-support-for-musl-ldso.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0036-libcc1-fix-libcc1-s-install-path-and-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0036-libcc1-fix-libcc1-s-install-path-and-rpath.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0036-libcc1-fix-libcc1-s-install-path-and-rpath.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0036-libcc1-fix-libcc1-s-install-path-and-rpath.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0037-handle-sysroot-support-for-nativesdk-gcc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0037-handle-sysroot-support-for-nativesdk-gcc.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0037-handle-sysroot-support-for-nativesdk-gcc.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0037-handle-sysroot-support-for-nativesdk-gcc.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0038-Search-target-sysroot-gcc-version-specific-dirs-with.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0039-Fix-various-_FOR_BUILD-and-related-variables.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0039-Fix-various-_FOR_BUILD-and-related-variables.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0039-Fix-various-_FOR_BUILD-and-related-variables.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0039-Fix-various-_FOR_BUILD-and-related-variables.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0040-nios2-Define-MUSL_DYNAMIC_LINKER.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0040-nios2-Define-MUSL_DYNAMIC_LINKER.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0040-nios2-Define-MUSL_DYNAMIC_LINKER.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0040-nios2-Define-MUSL_DYNAMIC_LINKER.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0041-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0041-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
new file mode 100644
index 0000000..29b7ce7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0041-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
@@ -0,0 +1,87 @@
+From 210f6b3b82084cc756e02b8bc12f909a43b14ee8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 18:10:54 -0700
+Subject: [PATCH 40/49] Add ssp_nonshared to link commandline for musl targets
+
+when -fstack-protector options are enabled we need to
+link with ssp_shared on musl since it does not provide
+the __stack_chk_fail_local() so essentially it provides
+libssp but not libssp_nonshared something like
+TARGET_LIBC_PROVIDES_SSP_BUT_NOT_SSP_NONSHARED
+ where-as for glibc the needed symbols
+are already present in libc_nonshared library therefore
+we do not need any library helper on glibc based systems
+but musl needs the libssp_noshared from gcc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/linux.h          |  7 +++++++
+ gcc/config/rs6000/linux.h   | 10 ++++++++++
+ gcc/config/rs6000/linux64.h | 10 ++++++++++
+ 3 files changed, 27 insertions(+)
+
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h
+index 2e683d0c430..1b4df798671 100644
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -182,6 +182,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+     { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 },		\
+     { 0, 0, 0, 0, 0, 0 }				\
+   }
++#ifdef TARGET_LIBC_PROVIDES_SSP
++#undef LINK_SSP_SPEC
++#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
++		       "|fstack-protector-strong|fstack-protector-explicit" \
++		       ":-lssp_nonshared}"
++#endif
++
+ #endif
+ 
+ #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
+diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
+index 684afd6c190..22cfa391b89 100644
+--- a/gcc/config/rs6000/linux.h
++++ b/gcc/config/rs6000/linux.h
+@@ -91,6 +91,16 @@
+ 					 " -m elf32ppclinux")
+ #endif
+ 
++/* link libssp_nonshared.a with musl */
++#if DEFAULT_LIBC == LIBC_MUSL
++#ifdef TARGET_LIBC_PROVIDES_SSP
++#undef LINK_SSP_SPEC
++#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
++		       "|fstack-protector-strong|fstack-protector-explicit" \
++		       ":-lssp_nonshared}"
++#endif
++#endif
++
+ #undef LINK_OS_LINUX_SPEC
+ #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 3b00ec0fcf0..8371f8d7b6b 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -465,6 +465,16 @@ extern int dot_symbols;
+ 					   " -m elf64ppc")
+ #endif
+ 
++/* link libssp_nonshared.a with musl */
++#if DEFAULT_LIBC == LIBC_MUSL
++#ifdef TARGET_LIBC_PROVIDES_SSP
++#undef LINK_SSP_SPEC
++#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
++		       "|fstack-protector-strong|fstack-protector-explicit" \
++		       ":-lssp_nonshared}"
++#endif
++#endif
++
+ #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+   -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \
+-- 
+2.13.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0042-gcc-libcpp-support-ffile-prefix-map-old-new.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0042-gcc-libcpp-support-ffile-prefix-map-old-new.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0042-gcc-libcpp-support-ffile-prefix-map-old-new.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0042-gcc-libcpp-support-ffile-prefix-map-old-new.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0043-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0043-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0043-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0043-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0044-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0045-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0045-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0045-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0045-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0046-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0046-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0046-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0046-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0048-sync-gcc-stddef.h-with-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0048-sync-gcc-stddef.h-with-musl.patch
new file mode 100644
index 0000000..30c158d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0048-sync-gcc-stddef.h-with-musl.patch
@@ -0,0 +1,91 @@
+From 10595c03c39b4e980d2a00e16fc84e9caf82292e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 3 Feb 2017 12:56:00 -0800
+Subject: [PATCH 48/48] sync gcc stddef.h with musl
+
+musl defines ptrdiff_t size_t and wchar_t
+so dont define them here if musl is definining them
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ gcc/ginclude/stddef.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
+index d711530d053..c315b7a97c1 100644
+--- a/gcc/ginclude/stddef.h
++++ b/gcc/ginclude/stddef.h
+@@ -134,6 +134,7 @@ _TYPE_wchar_t;
+ #ifndef ___int_ptrdiff_t_h
+ #ifndef _GCC_PTRDIFF_T
+ #ifndef _PTRDIFF_T_DECLARED /* DragonFly */
++#ifndef __DEFINED_ptrdiff_t /* musl */
+ #define _PTRDIFF_T
+ #define _T_PTRDIFF_
+ #define _T_PTRDIFF
+@@ -143,10 +144,12 @@ _TYPE_wchar_t;
+ #define ___int_ptrdiff_t_h
+ #define _GCC_PTRDIFF_T
+ #define _PTRDIFF_T_DECLARED
++#define __DEFINED_ptrdiff_t /* musl */
+ #ifndef __PTRDIFF_TYPE__
+ #define __PTRDIFF_TYPE__ long int
+ #endif
+ typedef __PTRDIFF_TYPE__ ptrdiff_t;
++#endif /* __DEFINED_ptrdiff_t */
+ #endif /* _PTRDIFF_T_DECLARED */
+ #endif /* _GCC_PTRDIFF_T */
+ #endif /* ___int_ptrdiff_t_h */
+@@ -184,6 +187,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #ifndef _GCC_SIZE_T
+ #ifndef _SIZET_
+ #ifndef __size_t
++#ifndef __DEFINED_size_t /* musl */
+ #define __size_t__	/* BeOS */
+ #define __SIZE_T__	/* Cray Unicos/Mk */
+ #define _SIZE_T
+@@ -200,6 +204,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
++#define __DEFINED_size_t /* musl */
+ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
+   || defined(__DragonFly__) \
+   || defined(__FreeBSD_kernel__)
+@@ -235,6 +240,7 @@ typedef long ssize_t;
+ #endif /* _SIZE_T */
+ #endif /* __SIZE_T__ */
+ #endif /* __size_t__ */
++#endif /* __DEFINED_size_t */
+ #undef	__need_size_t
+ #endif /* _STDDEF_H or __need_size_t.  */
+ 
+@@ -264,6 +270,7 @@ typedef long ssize_t;
+ #ifndef ___int_wchar_t_h
+ #ifndef __INT_WCHAR_T_H
+ #ifndef _GCC_WCHAR_T
++#ifndef __DEFINED_wchar_t /* musl */
+ #define __wchar_t__	/* BeOS */
+ #define __WCHAR_T__	/* Cray Unicos/Mk */
+ #define _WCHAR_T
+@@ -279,6 +286,7 @@ typedef long ssize_t;
+ #define __INT_WCHAR_T_H
+ #define _GCC_WCHAR_T
+ #define _WCHAR_T_DECLARED
++#define __DEFINED_wchar_t /* musl */
+ 
+ /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+    instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
+@@ -344,6 +352,7 @@ typedef __WCHAR_TYPE__ wchar_t;
+ #endif
+ #endif /* __WCHAR_T__ */
+ #endif /* __wchar_t__ */
++#endif /* __DEFINED_wchar_t musl */
+ #undef	__need_wchar_t
+ #endif /* _STDDEF_H or __need_wchar_t.  */
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0054_all_nopie-all-flags.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0054_all_nopie-all-flags.patch
new file mode 100644
index 0000000..73ab950
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0054_all_nopie-all-flags.patch
@@ -0,0 +1,22 @@
+Need to pass NO_PIE_CFLAGS to ALL_* so gcc doesn't fail when
+we compile it with older gcc and pie.
+
+Upstream-Status: Inappropriate [configuration]
+
+Maintained by: Gentoo Toolchain Project <toolchain@gentoo.org>
+Signed-off-by: Stephen Arnold <stephen.arnold42@gmail.com>
+
+--- a/gcc/Makefile.in	2015-06-25 19:18:12.000000000 +0200
++++ b/gcc/Makefile.in	2016-04-22 00:12:54.029178860 +0200
+@@ -991,10 +991,10 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@)
+ ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
+
+ # This is the variable to use when using $(COMPILER).
+-ALL_COMPILERFLAGS = $(ALL_CXXFLAGS)
++ALL_COMPILERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
+
+ # This is the variable to use when using $(LINKER).
+-ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
++ALL_LINKERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
+
+ # Build and host support libraries.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0055-unwind_h-glibc26.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0055-unwind_h-glibc26.patch
new file mode 100644
index 0000000..c266cfe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/0055-unwind_h-glibc26.patch
@@ -0,0 +1,139 @@
+Backport and edit of patches from:
+https://gcc.gnu.org/viewcvs/gcc?limit_changes=0&view=revision&revision=249957
+by jsm28 (Joseph Myers)
+
+Current glibc no longer gives the ucontext_t type the tag struct
+ucontext, to conform with POSIX namespace rules.  This requires
+various linux-unwind.h files in libgcc, that were previously using
+struct ucontext, to be fixed to use ucontext_t instead.  This is
+similar to the removal of the struct siginfo tag from siginfo_t some
+years ago.
+
+This patch changes those files to use ucontext_t instead.  As the
+standard name that should be unconditionally safe, so this is not
+restricted to architectures supported by glibc, or conditioned on the
+glibc version.
+
+Upstream-Status: Backport
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+--- branches/gcc-6-branch/libgcc/config/aarch64/linux-unwind.h	2017/07/04 10:22:56	249956
+--- b/libgcc/config/aarch64/linux-unwind.h	2017/07/04 10:23:57	249957
+@@ -52,7 +52,7 @@
+   struct rt_sigframe
+   {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   };
+ 
+   struct rt_sigframe *rt_;
+--- branches/gcc-6-branch/libgcc/config/alpha/linux-unwind.h	2017/07/04 10:22:56	249956
+--- b/libgcc/config/alpha/linux-unwind.h	2017/07/04 10:23:57	249957
+@@ -51,7 +51,7 @@
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+     }
+--- branches/gcc-6-branch/libgcc/config/bfin/linux-unwind.h	2017/07/04 10:22:56	249956
+--- b/libgcc/config/bfin/linux-unwind.h	2017/07/04 10:23:57	249957
+@@ -52,7 +52,7 @@
+ 	void *puc;
+ 	char retcode[8];
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+ 
+       /* The void * cast is necessary to avoid an aliasing warning.
+--- branches/gcc-6-branch/libgcc/config/i386/linux-unwind.h	2017/07/04 10:22:56	249956
+--- b/libgcc/config/i386/linux-unwind.h	2017/07/04 10:23:57	249957
+@@ -58,7 +58,7 @@
+   if (*(unsigned char *)(pc+0) == 0x48
+       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
+     {
+-      struct ucontext *uc_ = context->cfa;
++      ucontext_t *uc_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+          because it does not alias anything.  */
+@@ -138,7 +138,7 @@
+ 	siginfo_t *pinfo;
+ 	void *puc;
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+--- branches/gcc-6-branch/libgcc/config/m68k/linux-unwind.h	2017/07/04 10:22:56	249956
+--- b/libgcc/config/m68k/linux-unwind.h	2017/07/04 10:23:57	249957
+@@ -33,7 +33,7 @@
+ /* <sys/ucontext.h> is unfortunately broken right now.  */
+ struct uw_ucontext {
+ 	unsigned long	  uc_flags;
+-	struct ucontext  *uc_link;
++	ucontext_t	 *uc_link;
+ 	stack_t		  uc_stack;
+ 	mcontext_t	  uc_mcontext;
+ 	unsigned long	  uc_filler[80];
+--- branches/gcc-6-branch/libgcc/config/nios2/linux-unwind.h	2017/07/04 10:22:56	249956
+--- b/libgcc/config/nios2/linux-unwind.h	2017/07/04 10:23:57	249957
+@@ -38,7 +38,7 @@
+ 
+ struct nios2_ucontext {
+   unsigned long uc_flags;
+-  struct ucontext *uc_link;
++  ucontext_t *uc_link;
+   stack_t uc_stack;
+   struct nios2_mcontext uc_mcontext;
+   sigset_t uc_sigmask;	/* mask last for extensibility */
+--- branches/gcc-6-branch/libgcc/config/pa/linux-unwind.h	2017/07/04 10:22:56	249956
+--- b/libgcc/config/pa/linux-unwind.h	2017/07/04 10:23:57	249957
+@@ -80,7 +80,7 @@
+   struct sigcontext *sc;
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *frame;
+ 
+   /* rt_sigreturn trampoline:
+--- branches/gcc-6-branch/libgcc/config/sh/linux-unwind.h	2017/07/04 10:22:56	249956
+--- b/libgcc/config/sh/linux-unwind.h	2017/07/04 10:23:57	249957
+@@ -180,7 +180,7 @@
+     {
+       struct rt_sigframe {
+ 	siginfo_t info;
+-	struct ucontext uc;
++	ucontext_t uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+          The aliasing warning is correct, but should not be a problem
+--- branches/gcc-6-branch/libgcc/config/tilepro/linux-unwind.h	2017/07/04 10:22:56	249956
+--- b/libgcc/config/tilepro/linux-unwind.h	2017/07/04 10:23:57	249957
+@@ -61,7 +61,7 @@
+   struct rt_sigframe {
+     unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* Return if this is not a signal handler.  */
+--- branches/gcc-6-branch/libgcc/config/xtensa/linux-unwind.h	2017/07/04 10:22:56	249956
+--- b/libgcc/config/xtensa/linux-unwind.h	2017/07/04 10:23:57	249957
+@@ -67,7 +67,7 @@
+ 
+   struct rt_sigframe {
+     siginfo_t info;
+-    struct ucontext uc;
++    ucontext_t uc;
+   } *rt_;
+ 
+   /* movi a2, __NR_rt_sigreturn; syscall */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/CVE-2016-6131.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/CVE-2016-6131.patch
new file mode 100644
index 0000000..e873cc6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/CVE-2016-6131.patch
@@ -0,0 +1,251 @@
+From 59a0e4bd8391962f62600ae3ac95ab0fba74d464 Mon Sep 17 00:00:00 2001
+From: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 4 Aug 2016 16:53:18 +0000
+Subject: [PATCH] Fix for PR71696 in Libiberty Demangler
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[BZ #71696] -- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71696
+
+2016-08-04  Marcel Böhme  <boehme.marcel@gmail.com>
+
+	PR c++/71696
+	* cplus-dem.c: Prevent infinite recursion when there is a cycle
+	in the referencing of remembered mangled types.
+	(work_stuff): New stack to keep track of the remembered mangled
+	types that are currently being processed.
+	(push_processed_type): New method to push currently processed
+	remembered type onto the stack.
+	(pop_processed_type): New method to pop currently processed
+	remembered type from the stack.
+	(work_stuff_copy_to_from): Copy values of new variables.
+	(delete_non_B_K_work_stuff): Free stack memory.
+	(demangle_args): Push/Pop currently processed remembered type.
+	(do_type): Do not demangle a cyclic reference and push/pop
+	referenced remembered type.
+
+cherry-picked from commit of
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239143 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport [master]
+CVE: CVE-2016-6131
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ libiberty/ChangeLog                   | 17 ++++++++
+ libiberty/cplus-dem.c                 | 78 ++++++++++++++++++++++++++++++++---
+ libiberty/testsuite/demangle-expected | 18 ++++++++
+ 3 files changed, 108 insertions(+), 5 deletions(-)
+
+diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
+index 240138f..adf1d72 100644
+--- a/libiberty/ChangeLog
++++ b/libiberty/ChangeLog
+@@ -1,3 +1,20 @@
++2016-08-04  Marcel Böhme  <boehme.marcel@gmail.com>
++
++	PR c++/71696
++	* cplus-dem.c: Prevent infinite recursion when there is a cycle
++	in the referencing of remembered mangled types.
++	(work_stuff): New stack to keep track of the remembered mangled
++	types that are currently being processed.
++	(push_processed_type): New method to push currently processed
++	remembered type onto the stack.
++	(pop_processed_type): New method to pop currently processed
++	remembered type from the stack.
++	(work_stuff_copy_to_from): Copy values of new variables.
++	(delete_non_B_K_work_stuff): Free stack memory.
++	(demangle_args): Push/Pop currently processed remembered type.
++	(do_type): Do not demangle a cyclic reference and push/pop
++	referenced remembered type.
++
+ 2016-12-21  Release Manager
+ 
+ 	* GCC 6.3.0 released.
+diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
+index 7514e57..f21e630 100644
+--- a/libiberty/cplus-dem.c
++++ b/libiberty/cplus-dem.c
+@@ -144,6 +144,9 @@ struct work_stuff
+   string* previous_argument; /* The last function argument demangled.  */
+   int nrepeats;         /* The number of times to repeat the previous
+ 			   argument.  */
++  int *proctypevec;     /* Indices of currently processed remembered typevecs.  */
++  int proctypevec_size;
++  int nproctypes;
+ };
+ 
+ #define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI)
+@@ -435,6 +438,10 @@ iterate_demangle_function (struct work_stuff *,
+ 
+ static void remember_type (struct work_stuff *, const char *, int);
+ 
++static void push_processed_type (struct work_stuff *, int);
++
++static void pop_processed_type (struct work_stuff *);
++
+ static void remember_Btype (struct work_stuff *, const char *, int, int);
+ 
+ static int register_Btype (struct work_stuff *);
+@@ -1301,6 +1308,10 @@ work_stuff_copy_to_from (struct work_stuff *to, struct work_stuff *from)
+       memcpy (to->btypevec[i], from->btypevec[i], len);
+     }
+ 
++  if (from->proctypevec)
++    to->proctypevec =
++      XDUPVEC (int, from->proctypevec, from->proctypevec_size);
++
+   if (from->ntmpl_args)
+     to->tmpl_argvec = XNEWVEC (char *, from->ntmpl_args);
+ 
+@@ -1329,11 +1340,17 @@ delete_non_B_K_work_stuff (struct work_stuff *work)
+   /* Discard the remembered types, if any.  */
+ 
+   forget_types (work);
+-  if (work -> typevec != NULL)
++  if (work->typevec != NULL)
+     {
+-      free ((char *) work -> typevec);
+-      work -> typevec = NULL;
+-      work -> typevec_size = 0;
++      free ((char *) work->typevec);
++      work->typevec = NULL;
++      work->typevec_size = 0;
++    }
++  if (work->proctypevec != NULL)
++    {
++      free (work->proctypevec);
++      work->proctypevec = NULL;
++      work->proctypevec_size = 0;
+     }
+   if (work->tmpl_argvec)
+     {
+@@ -3552,6 +3569,8 @@ static int
+ do_type (struct work_stuff *work, const char **mangled, string *result)
+ {
+   int n;
++  int i;
++  int is_proctypevec;
+   int done;
+   int success;
+   string decl;
+@@ -3564,6 +3583,7 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
+ 
+   done = 0;
+   success = 1;
++  is_proctypevec = 0;
+   while (success && !done)
+     {
+       int member;
+@@ -3616,8 +3636,15 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
+ 	      success = 0;
+ 	    }
+ 	  else
++	    for (i = 0; i < work->nproctypes; i++)
++	      if (work -> proctypevec [i] == n)
++	        success = 0;
++
++	  if (success)
+ 	    {
+-	      remembered_type = work -> typevec[n];
++	      is_proctypevec = 1;
++	      push_processed_type (work, n);
++	      remembered_type = work->typevec[n];
+ 	      mangled = &remembered_type;
+ 	    }
+ 	  break;
+@@ -3840,6 +3867,9 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
+     string_delete (result);
+   string_delete (&decl);
+ 
++  if (is_proctypevec)
++    pop_processed_type (work);
++
+   if (success)
+     /* Assume an integral type, if we're not sure.  */
+     return (int) ((tk == tk_none) ? tk_integral : tk);
+@@ -4252,6 +4282,41 @@ do_arg (struct work_stuff *work, const char **mangled, string *result)
+ }
+ 
+ static void
++push_processed_type (struct work_stuff *work, int typevec_index)
++{
++  if (work->nproctypes >= work->proctypevec_size)
++    {
++      if (!work->proctypevec_size)
++	{
++	  work->proctypevec_size = 4;
++	  work->proctypevec = XNEWVEC (int, work->proctypevec_size);
++	}
++      else
++	{
++	  if (work->proctypevec_size < 16)
++	    /* Double when small.  */
++	    work->proctypevec_size *= 2;
++	  else
++	    {
++	      /* Grow slower when large.  */
++	      if (work->proctypevec_size > (INT_MAX / 3) * 2)
++                xmalloc_failed (INT_MAX);
++              work->proctypevec_size = (work->proctypevec_size * 3 / 2);
++	    }
++          work->proctypevec
++            = XRESIZEVEC (int, work->proctypevec, work->proctypevec_size);
++	}
++    }
++    work->proctypevec [work->nproctypes++] = typevec_index;
++}
++
++static void
++pop_processed_type (struct work_stuff *work)
++{
++  work->nproctypes--;
++}
++
++static void
+ remember_type (struct work_stuff *work, const char *start, int len)
+ {
+   char *tem;
+@@ -4515,10 +4580,13 @@ demangle_args (struct work_stuff *work, const char **mangled,
+ 		{
+ 		  string_append (declp, ", ");
+ 		}
++	      push_processed_type (work, t);
+ 	      if (!do_arg (work, &tem, &arg))
+ 		{
++		  pop_processed_type (work);
+ 		  return (0);
+ 		}
++	      pop_processed_type (work);
+ 	      if (PRINT_ARG_TYPES)
+ 		{
+ 		  string_appends (declp, &arg);
+diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
+index 157d2ee..8793a0b 100644
+--- a/libiberty/testsuite/demangle-expected
++++ b/libiberty/testsuite/demangle-expected
+@@ -4491,3 +4491,21 @@ void eat<int*, Foo()::{lambda(auto:1*, auto:2*)#6}>(int*&, Foo()::{lambda(auto:1
+ 
+ _Z3eatIPiZ3BarIsEvvEUlPsPT_PT0_E0_EvRS3_RS5_
+ void eat<int*, void Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}>(int*&, void Bar<short>()::{lambda(short*, auto:1*, auto:2*)#2}&)
++#
++# Tests write access violation PR70926
++
++0__Ot2m02R5T0000500000
++0__Ot2m02R5T0000500000
++#
++
++0__GT50000000000_
++0__GT50000000000_
++#
++
++__t2m05B500000000000000000_
++__t2m05B500000000000000000_
++#
++# Tests stack overflow PR71696
++
++__10%0__S4_0T0T0
++%0<>::%0(%0<>)
+-- 
+2.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/ubsan-fix-check-empty-string.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.3/ubsan-fix-check-empty-string.patch
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-common.inc
index f540b4d..857aa8f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-common.inc
@@ -5,40 +5,52 @@
 
 NATIVEDEPS = ""
 
+CVE_PRODUCT = "gcc"
+
 inherit autotools gettext texinfo
 
 BPN = "gcc"
+COMPILERINITIAL = ""
+COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc${COMPILERINITIAL}:do_gcc_stash_builddir"
+COMPILERDEP_class-nativesdk = "virtual/${TARGET_PREFIX}gcc${COMPILERINITIAL}-crosssdk:do_gcc_stash_builddir"
+
+python extract_stashed_builddir () {
+    src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}")
+    dest = d.getVar("B")
+    oe.path.copyhardlinktree(src, dest)
+    staging_processfixme([src + "/fixmepath"], dest, dest, dest, d)
+}
 
 def get_gcc_float_setting(bb, d):
-    if d.getVar('ARMPKGSFX_EABI', True) == "hf" and d.getVar('TRANSLATED_TARGET_ARCH', True) == "arm":
+    if d.getVar('ARMPKGSFX_EABI') == "hf" and d.getVar('TRANSLATED_TARGET_ARCH') == "arm":
         return "--with-float=hard"
-    if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+    if d.getVar('TARGET_FPU') in [ 'soft' ]:
         return "--with-float=soft"
-    if d.getVar('TARGET_FPU', True) in [ 'ppc-efd' ]:
+    if d.getVar('TARGET_FPU') in [ 'ppc-efd' ]:
         return "--enable-e500_double"
     return ""
 
 get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}"
 
 def get_gcc_mips_plt_setting(bb, d):
-    if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d):
+    if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d):
         return "--with-mips-plt"
     return ""
 
 def get_gcc_ppc_plt_settings(bb, d):
-    if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d):
+    if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d):
         return "--enable-secureplt"
     return ""
 
 def get_long_double_setting(bb, d):
-    if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC', True) in [ 'uclibc', 'glibc' ]:
+    if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC') in [ 'uclibc', 'glibc' ]:
         return "--with-long-double-128"
     else:
         return "--without-long-double-128"
     return ""
 
 def get_gcc_multiarch_setting(bb, d):
-    target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True)
+    target_arch = d.getVar('TRANSLATED_TARGET_ARCH')
     multiarch_options = {
         "i586":    "--enable-targets=all",
         "i686":    "--enable-targets=all",
@@ -54,26 +66,25 @@
 
 # this is used by the multilib setup of gcc
 def get_tune_parameters(tune, d):
-    availtunes = d.getVar('AVAILTUNES', True)
+    availtunes = d.getVar('AVAILTUNES')
     if tune not in availtunes.split():
         bb.error('The tune: %s is not one of the available tunes: %s' % (tune or None, availtunes))
 
     localdata = bb.data.createCopy(d)
     override = ':tune-' + tune
     localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override)
-    bb.data.update_data(localdata)
 
     retdict = {}
     retdict['tune'] = tune
-    retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True)
-    retdict['features'] = localdata.getVar('TUNE_FEATURES', True)
+    retdict['ccargs'] = localdata.getVar('TUNE_CCARGS')
+    retdict['features'] = localdata.getVar('TUNE_FEATURES')
     # BASELIB is used by the multilib code to change library paths
-    retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True)
-    retdict['arch'] = localdata.getVar('TUNE_ARCH', True)
-    retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True)
-    retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True)
-    retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True)
-    retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True)
+    retdict['baselib'] = localdata.getVar('BASE_LIB') or localdata.getVar('BASELIB')
+    retdict['arch'] = localdata.getVar('TUNE_ARCH')
+    retdict['abiextension'] = localdata.getVar('ABIEXTENSION')
+    retdict['target_fpu'] = localdata.getVar('TARGET_FPU')
+    retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH')
+    retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS')
     return retdict
 
 get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-configure-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-configure-common.inc
index ddebbb8..00ef89e 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -23,7 +23,7 @@
 GCCTHREADS ?= "posix"
 
 EXTRA_OECONF = "\
-    ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS', True) != 'no']} \
+    ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS') != 'no']} \
     --with-gnu-ld \
     --enable-shared \
     --enable-languages=${LANGUAGES} \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc
index dcf2271..9502c2b 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -24,7 +24,7 @@
     --enable-languages=c \
     --program-prefix=${TARGET_PREFIX} \
     --with-sysroot=/not/exist \
-    --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
     ${EXTRA_OECONF_INITIAL} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \
     ${EXTRA_OECONF_GCC_FLOAT} \
@@ -33,20 +33,10 @@
 
 EXTRA_OECONF += "--with-native-system-header-dir=${SYSTEMHEADERS}"
 
-GCCCROSS_BUILDSYSROOT = "${B}/tmpsysroot"
-
-do_configure_prepend () {
-	sysr=${GCCCROSS_BUILDSYSROOT}${target_includedir}
-	mkdir -p $sysr
-	for t in linux asm asm-generic; do
-		rm -f $sysr/$t
-		ln -s ${STAGING_DIR_TARGET}${target_includedir}/$t $sysr/
-	done
-}
-
 do_compile () {
     oe_runmake all-gcc configure-target-libgcc
 }
+
 do_install () {
 	( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h )
 	oe_runmake 'DESTDIR=${D}' install-gcc
@@ -74,14 +64,6 @@
 	# so we overwirte the generated include-fixed/limits.h for gcc-cross-initial
 	# to get rid references to real limits.h
 	cp gcc/include-fixed/limits.h ${D}${gcclibdir}/${TARGET_SYS}/${BINV}/include/limits.h
-
-	# gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
-	case ${PN} in
-		*gcc-cross-initial-${TARGET_ARCH}|*gcc-crosssdk-initial-${SDK_SYS})
-			dest=${D}/${includedir}/gcc-build-internal-initial-${TARGET_SYS}
-			hardlinkdir . $dest
-		;;
-	esac
 }
 #
 # Override the default sysroot staging copy since this won't look like a target system
@@ -94,7 +76,13 @@
 	mv ${SYSROOT_DESTDIR}${target_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/ || true
 }
 
-do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST}/ ${SYSROOT_DESTDIR}/${STAGING_DIR_TARGET}/${target_base_libdir}/"
-do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST}/ ${STAGING_DIR_TCBOOTSTRAP}/${target_base_libdir}/"
+do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST}/"
+do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
 
 inherit nopackages
+
+COMPILERINITIAL = "-initial"
+
+
+# We really only want this built by things that need it, not any recrdeptask
+deltask do_build
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross.inc
index cc465a2..45985c3 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -5,12 +5,15 @@
 DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
 python () {
-    if d.getVar("TARGET_OS", True).startswith("linux"):
+    if d.getVar("TARGET_OS").startswith("linux"):
         d.setVar("EXTRADEPENDS", "linux-libc-headers")
 }
 
 PN = "gcc-cross-${TARGET_ARCH}"
 
+# Ignore how TARGET_ARCH is computed.
+TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}"
+
 require gcc-configure-common.inc
 
 # While we want the 'gnu' hash style, we explicitly set it to sysv here to
@@ -185,21 +188,28 @@
 	# We use libiberty from binutils
 	find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
 	find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
-
-	# gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
-	case ${PN} in
-		*gcc-cross-${TARGET_ARCH}|*gcc-crosssdk-${SDK_SYS})
-			dest=${D}/${includedir}/gcc-build-internal-${TARGET_SYS}
-			hardlinkdir . $dest
-		;;
-	esac
 }
-# This is reflected in the recipe name and target gcc shouldn't depend 
-# on SDK settings either
-do_install[vardepsexclude] += "SDK_SYS"
 
 do_package[noexec] = "1"
 do_packagedata[noexec] = "1"
 do_package_write_ipk[noexec] = "1"
 do_package_write_rpm[noexec] = "1"
 do_package_write_deb[noexec] = "1"
+
+BUILDDIRSTASH = "${WORKDIR}/stashed-builddir"
+do_gcc_stash_builddir[dirs] = "${B}"
+do_gcc_stash_builddir[cleandirs] = "${BUILDDIRSTASH}"
+do_gcc_stash_builddir () {
+	dest=${BUILDDIRSTASH}
+	hardlinkdir . $dest
+}
+addtask do_gcc_stash_builddir after do_compile before do_install
+SSTATETASKS += "do_gcc_stash_builddir"
+do_gcc_stash_builddir[sstate-inputdirs] = "${BUILDDIRSTASH}"
+do_gcc_stash_builddir[sstate-outputdirs] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+do_gcc_stash_builddir[sstate-fixmedir] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+
+python do_gcc_stash_builddir_setscene () {
+    sstate_setscene(d)
+}
+addtask do_gcc_stash_builddir_setscene
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc
index a0a2ac0..31b8619 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -21,8 +21,8 @@
     import shutil
     import glob
 
-    srcdir = d.getVar('S', True)
-    builddir = d.getVar('B', True)
+    srcdir = d.getVar('S')
+    builddir = d.getVar('B')
     src_conf_dir = '%s/gcc/config' % srcdir
     build_conf_dir = '%s/gcc/config' % builddir
 
@@ -43,12 +43,12 @@
             bb.utils.mkdirhier('%s/%s' % (build_conf_dir, parent_dir))
             bb.utils.copyfile(fn, '%s/%s' % (build_conf_dir, rel_path))
 
-    pn = d.getVar('PN', True)
-    multilibs = (d.getVar('MULTILIB_VARIANTS', True) or '').split()
+    pn = d.getVar('PN')
+    multilibs = (d.getVar('MULTILIB_VARIANTS') or '').split()
     if not multilibs and pn != "nativesdk-gcc":
         return
 
-    mlprefix = d.getVar('MLPREFIX', True)
+    mlprefix = d.getVar('MLPREFIX')
 
     if ('%sgcc' % mlprefix) != pn and (not pn.startswith('gcc-cross-canadian')) and pn != "nativesdk-gcc":
         return
@@ -155,10 +155,10 @@
     libdirn32 = 'SYSTEMLIBS_DIR'
 
 
-    target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL', True) if mlprefix
-                    else d.getVar('TARGET_ARCH', True))
+    target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL') if mlprefix
+                    else d.getVar('TARGET_ARCH'))
     if pn == "nativesdk-gcc":
-        header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH", True)]
+        header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH")]
         write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
         return
 
@@ -188,7 +188,7 @@
     optsets = []
 
     for ml in ml_list:
-        tune = d.getVar(ml, True)
+        tune = d.getVar(ml)
         if not tune:
             bb.warn("%s doesn't have a corresponding tune. Skipping..." % ml)
             continue
@@ -212,7 +212,7 @@
 
         # take out '-' mcpu='s and march='s from parameters
         opts = []
-        whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST", True) or "").split()
+        whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST") or "").split()
         for i in d.expand(tune_parameters['ccargs']).split():
             if i in whitelist:
                 # Need to strip '-' from option
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime.inc
index 15252f1..0dc405c 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -17,55 +17,48 @@
 EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
 
 RUNTIMELIBITM = "libitm"
-RUNTIMELIBITM_mips = ""
-RUNTIMELIBITM_mipsel = ""
-RUNTIMELIBITM_mips64 = ""
-RUNTIMELIBITM_mips64el = ""
-RUNTIMELIBITM_mipsisa32r6 = ""
-RUNTIMELIBITM_mipsisa32r6el = ""
-RUNTIMELIBITM_mipsisa64r6 = ""
-RUNTIMELIBITM_mipsisa64r6el = ""
+RUNTIMELIBITM_mipsarch = ""
 RUNTIMELIBITM_nios2 = ""
 RUNTIMELIBITM_microblaze = ""
 
 RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
     ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
 "
+RUNTIMETARGET_append_x86 = " libmpx"
+RUNTIMETARGET_append_x86-64 = " libmpx"
+RUNTIMETARGET_remove_libc-musl = "libmpx"
 
-#  ?
 # libiberty
 # libmudflap
 # libgfortran needs separate recipe due to libquadmath dependency
 
 do_configure () {
 	export CXX="${CXX} -nostdinc++ -nostdlib++"
-	mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
+
 	for d in libgcc ${RUNTIMETARGET}; do
 		echo "Configuring $d"
-		rm -rf ${B}/$target/$d/
-		mkdir -p ${B}/$target/$d/
-		cd ${B}/$target/$d/
+		rm -rf ${B}/${TARGET_SYS}/$d/
+		mkdir -p ${B}/${TARGET_SYS}/$d/
+		cd ${B}/${TARGET_SYS}/$d/
 		chmod a+x ${S}/$d/configure
-		relpath=${@os.path.relpath("${S}/$d", "${B}/$target/$d")}
+		relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")}
 		$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 	done
 }
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	for d in libgcc ${RUNTIMETARGET}; do
-		cd ${B}/$target/$d/
-		oe_runmake MULTIBUILDTOP=${B}/$target/$d/
+		cd ${B}/${TARGET_SYS}/$d/
+		oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
 	done
 }
 
 do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	for d in ${RUNTIMETARGET}; do
-		cd ${B}/$target/$d/
-		oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install
+		cd ${B}/${TARGET_SYS}/$d/
+		oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
 	done
 	rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
 	rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
@@ -148,6 +141,17 @@
     libitm-dev \
     libitm-staticdev \
 "
+PACKAGES_append_x86 = "\
+    libmpx \
+    libmpx-dev \
+    libmpx-staticdev \
+"
+
+PACKAGES_append_x86-64 = "\
+    libmpx \
+    libmpx-dev \
+    libmpx-staticdev \
+"
 
 # The base package doesn't exist, so we clear the recommends.
 RRECOMMENDS_${PN}-dbg = ""
@@ -252,6 +256,20 @@
 FILES_libitm-staticdev = "${libdir}/libitm.a"
 SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"
 
+
+FILES_libmpx = "${libdir}/libmpx.so.* ${libdir}/libmpxwrappers.so.*"
+SUMMARY_libmpx = "Intel Memory Protection Extension library"
+FILES_libmpx-dev = "\
+    ${libdir}/libmpxwrappers.so \
+    ${libdir}/libmpxwrappers.la \
+    ${libdir}/libmpx.so \
+    ${libdir}/libmpx.la \
+    ${libdir}/libmpx.spec \
+"
+SUMMARY_libmpx-dev = "Intel Memory Protection Extension library - development files"
+FILES_libmpx-staticdev = "${libdir}/libmpx.a ${libdir}/libmpxwrappers.a"
+SUMMARY_libmpx-staticdev = "Intel Memory Protection Extension library - static development files"
+
 do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
 do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
 do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc
index df4e297..f97885b 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -12,36 +12,29 @@
 "
 
 do_configure () {
-    mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-    target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-    if [ -d ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ]; then
-        hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
-    fi
-
-    echo "Configuring libsanitizer"
-    rm -rf ${B}/$target/libsanitizer/
-    mkdir -p ${B}/$target/libsanitizer/
-    cd ${B}/$target/libsanitizer/
+    rm -rf ${B}/${TARGET_SYS}/libsanitizer/
+    mkdir -p ${B}/${TARGET_SYS}/libsanitizer/
+    cd ${B}/${TARGET_SYS}/libsanitizer/
     chmod a+x ${S}/libsanitizer/configure
-    relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/$target/libsanitizer")}
+    relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/${TARGET_SYS}/libsanitizer")}
     $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
     # Easiest way to stop bad RPATHs getting into the library since we have a
     # broken libtool here
-    sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libsanitizer/libtool
+    sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/libsanitizer/libtool
     # Link to the sysroot's libstdc++ instead of one gcc thinks it just built
-    sed -i -e '/LIBSTDCXX_RAW_CXX_\(CXXFLAGS\|LDFLAGS\)\s*=/d' ${B}/$target/libsanitizer/*/Makefile
+    sed -i -e '/LIBSTDCXX_RAW_CXX_\(CXXFLAGS\|LDFLAGS\)\s*=/d' ${B}/${TARGET_SYS}/libsanitizer/*/Makefile
 }
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
-    target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-    cd ${B}/$target/libsanitizer/
-    oe_runmake MULTIBUILDTOP=${B}/$target/libsanitizer/
+    cd ${B}/${TARGET_SYS}/libsanitizer/
+    oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/
 }
 
 do_install () {
-    target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-    cd ${B}/$target/libsanitizer/
-    oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libsanitizer/ install
+    cd ${B}/${TARGET_SYS}/libsanitizer/
+    oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/ install
     if [ -d ${D}${infodir} ]; then
         rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
     fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source.inc
index 49bde92..03bab97 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source.inc
@@ -3,7 +3,7 @@
 deltask do_install 
 deltask do_populate_sysroot
 deltask do_populate_lic 
-deltask do_rm_work
+RM_WORK_EXCLUDE += "${PN}"
 
 inherit nopackages
 
@@ -18,6 +18,8 @@
 DEPENDS = ""
 PACKAGES = ""
 
+
+# This needs to be Python to avoid lots of shell variables becoming dependencies.
 python do_preconfigure () {
     import subprocess
     cmd = d.expand('cd ${S} && PATH=${PATH} gnu-configize')
@@ -26,6 +28,11 @@
     bb.utils.remove(d.expand("${S}/gcc/gengtype-lex.c"))
     cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure")
     subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+
+    # Easiest way to stop bad RPATHs getting into the library since we have a
+    # broken libtool here (breaks cross-canadian and target at least)
+    cmd = d.expand("sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure")
+    subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
 }
 addtask do_preconfigure after do_patch
 do_preconfigure[depends] += "gnu-config-native:do_populate_sysroot autoconf-native:do_populate_sysroot"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-target.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-target.inc
index f436fa2..eef4434 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-target.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-target.inc
@@ -31,7 +31,7 @@
 FILES_${PN} = "\
     ${bindir}/${TARGET_PREFIX}gcc* \
     ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2* \
-    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc* \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
     ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \
     ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
     ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \
@@ -46,6 +46,7 @@
     libssp \
     libssp-dev \
 "
+RDEPENDS_${PN} += "cpp"
 
 FILES_${PN}-dev = "\
     ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
@@ -179,6 +180,8 @@
 	ln -sf ${TARGET_PREFIX}g++ g++
 	ln -sf ${TARGET_PREFIX}gcc gcc
 	ln -sf ${TARGET_PREFIX}cpp cpp
+	ln -sf ${TARGET_PREFIX}gcov gcov
+	ln -sf ${TARGET_PREFIX}gcov-tool gcov-tool
 	install -d ${D}${base_libdir}
 	ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp
 	ln -sf g++ c++
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.4.bb
index b0a523c..2c618df 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.4.bb
@@ -6,10 +6,4 @@
 # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output
 ARM_INSTRUCTION_SET_armv4 = "arm"
 
-do_configure_prepend() {
-	# Easiest way to stop bad RPATHs getting into the library since we have a
-	# broken libtool here
-	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure
-}
-
 BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_6.2.bb
deleted file mode 100644
index b0a523c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_6.2.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-require recipes-devtools/gcc/gcc-${PV}.inc
-require gcc-target.inc
-
-# Building with thumb enabled on armv4t fails with
-# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
-# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output
-ARM_INSTRUCTION_SET_armv4 = "arm"
-
-do_configure_prepend() {
-	# Easiest way to stop bad RPATHs getting into the library since we have a
-	# broken libtool here
-	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure
-}
-
-BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_6.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_6.3.bb
new file mode 100644
index 0000000..2c618df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_6.3.bb
@@ -0,0 +1,9 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-target.inc
+
+# Building with thumb enabled on armv4t fails with
+# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
+# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output
+ARM_INSTRUCTION_SET_armv4 = "arm"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc
index c4de31c..848a476 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -5,27 +5,25 @@
 INHIBIT_DEFAULT_DEPS = "1"
 
 do_configure () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	install -d ${D}${base_libdir} ${D}${libdir}
-	hardlinkdir ${STAGING_INCDIR_NATIVE}/${LIBGCCBUILDTREENAME}$target/ ${B}
 	mkdir -p ${B}/${BPN}
-	mkdir -p ${B}/$target/${BPN}/
+	mkdir -p ${B}/${TARGET_SYS}/${BPN}/
 	cd ${B}/${BPN}
 	chmod a+x ${S}/${BPN}/configure
 	relpath=${@os.path.relpath("${S}/${BPN}", "${B}/${BPN}")}
 	$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 }
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	cd ${B}/${BPN}
-	oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
+	oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/${BPN}/
 }
 
 do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	cd ${B}/${BPN}
-	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
+	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/${BPN}/ install
 
 	# Move libgcc_s into /lib
 	mkdir -p ${D}${base_libdir}
@@ -64,18 +62,18 @@
 fakeroot python do_multilib_install() {
     import re
 
-    multilibs = d.getVar('MULTILIB_VARIANTS', True)
+    multilibs = d.getVar('MULTILIB_VARIANTS')
     if not multilibs or bb.data.inherits_class('nativesdk', d):
         return
 
-    binv = d.getVar('BINV', True)
+    binv = d.getVar('BINV')
 
-    mlprefix = d.getVar('MLPREFIX', True)
-    if ('%slibgcc' % mlprefix) != d.getVar('PN', True):
+    mlprefix = d.getVar('MLPREFIX')
+    if ('%slibgcc' % mlprefix) != d.getVar('PN'):
         return
 
     if mlprefix:
-        orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True)
+        orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL')
         orig_tune_params = get_tune_parameters(orig_tune, d)
         orig_tune_baselib = orig_tune_params['baselib']
         orig_tune_bitness = orig_tune_baselib.replace('lib', '')
@@ -83,10 +81,10 @@
             orig_tune_bitness = '32'
 
         src = '../../../' + orig_tune_baselib + '/' + \
-            d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/'
+            d.getVar('TARGET_SYS_MULTILIB_ORIGINAL') + '/' + binv + '/'
 
-        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
-            d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness
+        dest = d.getVar('D') + d.getVar('libdir') + '/' + \
+            d.getVar('TARGET_SYS') + '/' + binv + '/' + orig_tune_bitness
 
         if os.path.lexists(dest):
             os.unlink(dest)
@@ -95,7 +93,7 @@
 
 
     for ml in multilibs.split():
-        tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True)
+        tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml)
         if not tune:
             bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml)
             continue
@@ -118,11 +116,11 @@
             libcextension = ''
 
         src = '../../../' + tune_baselib + '/' + \
-            tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \
-            '-' + d.getVar('TARGET_OS', True) + libcextension +  '/' + binv + '/'
+            tune_arch + d.getVar('TARGET_VENDOR') + 'ml' + ml + \
+            '-' + d.getVar('TARGET_OS') + libcextension +  '/' + binv + '/'
 
-        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
-            d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness
+        dest = d.getVar('D') + d.getVar('libdir') + '/' + \
+            d.getVar('TARGET_SYS') + '/' + binv + '/' + tune_bitness
 
         if os.path.lexists(dest):
             os.unlink(dest)
@@ -131,7 +129,7 @@
 
 def get_original_os(d):
     vendoros = d.expand('${TARGET_ARCH}${ORIG_TARGET_VENDOR}-${TARGET_OS}')
-    for suffix in [d.getVar('ABIEXTENSION', True), d.getVar('LIBCEXTENSION', True)]:
+    for suffix in [d.getVar('ABIEXTENSION'), d.getVar('LIBCEXTENSION')]:
         if suffix and vendoros.endswith(suffix):
             vendoros = vendoros[:-len(suffix)]
     # Arm must use linux-gnueabi not linux as only the former is accepted by gcc
@@ -147,11 +145,11 @@
     if bb.data.inherits_class('nativesdk', d):
         return
 
-    targetsys = d.getVar('BASETARGET_SYS', True)
+    targetsys = d.getVar('BASETARGET_SYS')
 
-    if targetsys != d.getVar('TARGET_SYS', True):
-        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + targetsys
-        src = d.getVar('TARGET_SYS', True)
-        if not os.path.lexists(dest) and os.path.lexists(d.getVar('D', True) + d.getVar('libdir', True)):
+    if targetsys != d.getVar('TARGET_SYS'):
+        dest = d.getVar('D') + d.getVar('libdir') + '/' + targetsys
+        src = d.getVar('TARGET_SYS')
+        if not os.path.lexists(dest) and os.path.lexists(d.getVar('D') + d.getVar('libdir')):
             os.symlink(src, dest)
 }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial.inc
index 687a8a0..950ad86 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial.inc
@@ -12,8 +12,9 @@
 
 EXTRA_OECONF += "--disable-shared"
 
-LIBGCCBUILDTREENAME = "gcc-build-internal-initial-"
-
-do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
+COMPILERINITIAL = "-initial"
 
 inherit nopackages
+
+# We really only want this built by things that need it, not any recrdeptask
+deltask do_build
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc
index 4770394..38d1643 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc
@@ -33,8 +33,6 @@
     ${libdir}/${TARGET_ARCH}${TARGET_VENDOR}* \
 "
 
-LIBGCCBUILDTREENAME = "gcc-build-internal-"
-
 do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
 do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
 do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc
index 58ceb2e..4846dec 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc
@@ -6,32 +6,27 @@
 "
 
 do_configure () {
-	mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
-
-	echo "Configuring libgfortran"
-	rm -rf ${B}/$target/libgfortran/
-	mkdir -p ${B}/$target/libgfortran/
-	cd ${B}/$target/libgfortran/
+	rm -rf ${B}/${TARGET_SYS}/libgfortran/
+	mkdir -p ${B}/${TARGET_SYS}/libgfortran/
+	cd ${B}/${TARGET_SYS}/libgfortran/
 	chmod a+x ${S}/libgfortran/configure
-	relpath=${@os.path.relpath("${S}/libgfortran", "${B}/$target/libgfortran")}
+	relpath=${@os.path.relpath("${S}/libgfortran", "${B}/${TARGET_SYS}/libgfortran")}
 	$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 	# Easiest way to stop bad RPATHs getting into the library since we have a
 	# broken libtool here
-	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libgfortran/libtool
+	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/libgfortran/libtool
 }
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	cd ${B}/$target/libgfortran/
-	oe_runmake MULTIBUILDTOP=${B}/$target/libgfortran/
+	cd ${B}/${TARGET_SYS}/libgfortran/
+	oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/libgfortran/
 }
 
 do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	cd ${B}/$target/libgfortran/
-	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libgfortran/ install
+	cd ${B}/${TARGET_SYS}/libgfortran/
+	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libgfortran/ install
 	if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
 		rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
 	fi
@@ -69,7 +64,7 @@
 do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
 
 python __anonymous () {
-    f = d.getVar("FORTRAN", True)
+    f = d.getVar("FORTRAN")
     if "fortran" not in f:
         raise bb.parse.SkipPackage("libgfortran needs fortran support to be enabled in the compiler")
 }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_6.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_6.2.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_6.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.1.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.1.inc
deleted file mode 100644
index d9dfe6f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.1.inc
+++ /dev/null
@@ -1,22 +0,0 @@
-LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
-		    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
-		    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
-		    file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
-
-SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \
-           file://0001-include-sys-types.h-for-mode_t.patch \
-           file://0002-make-man-install-relative-to-DESTDIR.patch \
-           file://0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \
-           file://0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch \
-           file://0005-Add-support-for-Renesas-SH-sh4-architecture.patch \
-           file://0006-Dont-disable-libreadline.a-when-using-disable-static.patch \
-           file://0007-use-asm-sgidefs.h.patch \
-           file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \
-           file://0009-Change-order-of-CFLAGS.patch \
-           file://0010-resolve-restrict-keyword-conflict.patch \
-           file://0011-avx_mpx.patch \
-"
-
-SRC_URI[md5sum] = "5aa71522e488e358243917967db87476"
-SRC_URI[sha256sum] = "e9216da4e3755e9f414c1aa0026b626251dfc57ffe572a266e98da4f6988fc70"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.12.1.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.12.1.inc
new file mode 100644
index 0000000..634756c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.12.1.inc
@@ -0,0 +1,22 @@
+LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+		    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+		    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+		    file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
+
+SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \
+           file://0001-include-sys-types.h-for-mode_t.patch \
+           file://0002-make-man-install-relative-to-DESTDIR.patch \
+           file://0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \
+           file://0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch \
+           file://0005-Add-support-for-Renesas-SH-sh4-architecture.patch \
+           file://0006-Dont-disable-libreadline.a-when-using-disable-static.patch \
+           file://0007-use-asm-sgidefs.h.patch \
+           file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \
+           file://0009-Change-order-of-CFLAGS.patch \
+           file://0010-resolve-restrict-keyword-conflict.patch \
+           file://package_devel_gdb_patches_120-sigprocmask-invalid-call.patch \
+"
+SRC_URI[md5sum] = "193453347ddced7acb6b1cd2ee8f2e4b"
+SRC_URI[sha256sum] = "4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc
index 33a5ce9..239b375 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc
@@ -6,12 +6,7 @@
 LTTNGUST = "lttng-ust"
 LTTNGUST_aarch64 = ""
 LTTNGUST_libc-uclibc = ""
-LTTNGUST_mips = ""
-LTTNGUST_mipsel = ""
-LTTNGUST_mips64 = ""
-LTTNGUST_mips64el = ""
-LTTNGUST_mips64n32 = ""
-LTTNGUST_mips64eln32 = ""
+LTTNGUST_mipsarch = ""
 LTTNGUST_sh4 = ""
 LTTNGUST_libc-musl = ""
 
@@ -52,11 +47,12 @@
 }
 
 # we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
-# right bits installed by binutils.
+# right bits installed by binutils.  Same for bfd.info -- also from binutils.
 do_install_append() {
 	rm -rf ${D}${libdir}
 	rm -rf ${D}${includedir}
 	rm -rf ${D}${datadir}/locale
+	rm -f ${D}${infodir}/bfd.info
 }
 
 RRECOMMENDS_gdb_append_linux = " glibc-thread-db "
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.12.1.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.1.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.12.1.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross.inc
index 5fa7c33..ebe329f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross.inc
@@ -1,6 +1,6 @@
 require gdb-common.inc
 
-DEPENDS = "expat-native ncurses-native"
+DEPENDS = "expat-native ncurses-native flex-native bison-native"
 
 inherit python3native
 
@@ -21,7 +21,10 @@
 PN = "gdb-cross-${TARGET_ARCH}"
 BPN = "gdb"
 
+# Ignore how TARGET_ARCH is computed.
+TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}"
+
 inherit cross
 inherit gettext
 
-datadir .= "/gdb-${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
+datadir .= "/gdb-${TARGET_SYS}${TARGET_VENDOR}-${TARGET_OS}"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.11.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.12.1.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.11.1.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.12.1.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch
index 0042c00..fc6c92f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch
@@ -1,4 +1,4 @@
-From fddd7178915968acf680814411b8b3cb137d0587 Mon Sep 17 00:00:00 2001
+From 2c81e17216b4e471a1ce0bddb50f374b0722a2ce Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Tue, 19 Jan 2016 18:18:52 -0800
 Subject: [PATCH 01/10] include sys/types.h for mode_t
@@ -14,7 +14,7 @@
  1 file changed, 1 insertion(+)
 
 diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
-index 5af2051..f42c510 100644
+index 4c14c204bb..bdab18f7f7 100644
 --- a/gdb/gdbserver/target.h
 +++ b/gdb/gdbserver/target.h
 @@ -28,6 +28,7 @@
@@ -26,5 +26,5 @@
  struct emit_ops;
  struct buffer;
 -- 
-2.8.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch
index defed62..9a9201b 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch
@@ -1,4 +1,4 @@
-From 3229cb09033eeb5003a08d91fa9d43be8ba4c86b Mon Sep 17 00:00:00 2001
+From f316d604b312bead78594f02e1355633eda9507b Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Mon, 2 Mar 2015 02:27:55 +0000
 Subject: [PATCH 02/10] make man install relative to DESTDIR
@@ -11,7 +11,7 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/sim/common/Makefile.in b/sim/common/Makefile.in
-index a05f507..8d0fa64 100644
+index a05f50767a..8d0fa64ea8 100644
 --- a/sim/common/Makefile.in
 +++ b/sim/common/Makefile.in
 @@ -35,7 +35,7 @@ tooldir = $(libdir)/$(target_alias)
@@ -24,5 +24,5 @@
  includedir = @includedir@
  
 -- 
-2.8.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
index bac7939..74c0006 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
@@ -1,4 +1,4 @@
-From 88e67caed662d8344c8db56176c9f1221e6cd2a2 Mon Sep 17 00:00:00 2001
+From f2912b1d2e5c854a112176682903b696da33e003 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Wed, 23 Mar 2016 06:30:09 +0000
 Subject: [PATCH 03/10] mips-linux-nat: Define _ABIO32 if not defined
@@ -17,7 +17,7 @@
  1 file changed, 5 insertions(+)
 
 diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
-index bfe9fcb..449b43a 100644
+index 0f20f16814..722532bb6c 100644
 --- a/gdb/mips-linux-nat.c
 +++ b/gdb/mips-linux-nat.c
 @@ -46,6 +46,11 @@
@@ -33,5 +33,5 @@
     we'll clear this and use PTRACE_PEEKUSER instead.  */
  static int have_ptrace_regsets = 1;
 -- 
-2.8.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
index a5fe2a2..847f24f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
@@ -1,6 +1,6 @@
-From bec564eb454bc7fc6ecfcb573aa53040bf39c1d5 Mon Sep 17 00:00:00 2001
+From 7ef7b709885378279c424eab0510b93233400b24 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 30 Apr 2016 16:46:03 +0000
+Date: Sat, 6 Aug 2016 17:32:50 -0700
 Subject: [PATCH 04/10] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC
  systems
 
@@ -13,7 +13,7 @@
  2 files changed, 12 insertions(+)
 
 diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
-index 2145c50..777905d 100644
+index 1d013f185f..68098b3db9 100644
 --- a/gdb/gdbserver/linux-ppc-low.c
 +++ b/gdb/gdbserver/linux-ppc-low.c
 @@ -21,7 +21,13 @@
@@ -29,9 +29,9 @@
 +#endif
  
  #include "nat/ppc-linux.h"
- 
+ #include "linux-ppc-tdesc.h"
 diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
-index 85fbcd8..cbec9c5 100644
+index 85fbcd84bb..cbec9c53b2 100644
 --- a/gdb/nat/ppc-linux.h
 +++ b/gdb/nat/ppc-linux.h
 @@ -18,7 +18,13 @@
@@ -49,5 +49,5 @@
  
  /* This sometimes isn't defined.  */
 -- 
-2.8.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0005-Add-support-for-Renesas-SH-sh4-architecture.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0005-Add-support-for-Renesas-SH-sh4-architecture.patch
index 8809e6f..d0c15f6 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0005-Add-support-for-Renesas-SH-sh4-architecture.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0005-Add-support-for-Renesas-SH-sh4-architecture.patch
@@ -1,4 +1,4 @@
-From 8c5fe58c5a0044ddb517a41b277ed27fb3d3bedc Mon Sep 17 00:00:00 2001
+From 6649e2cccfb11dec076abb02eae0afab95614829 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Mon, 2 Mar 2015 02:31:12 +0000
 Subject: [PATCH 05/10] Add support for Renesas SH (sh4) architecture.
@@ -27,10 +27,10 @@
  11 files changed, 617 insertions(+), 29 deletions(-)
 
 diff --git a/gdb/Makefile.in b/gdb/Makefile.in
-index ec2af52..df8e84d 100644
+index 7b2df86878..10f1266fe3 100644
 --- a/gdb/Makefile.in
 +++ b/gdb/Makefile.in
-@@ -1736,6 +1736,7 @@ ALLDEPFILES = \
+@@ -1750,6 +1750,7 @@ ALLDEPFILES = \
  	score-tdep.c \
  	ser-go32.c ser-pipe.c ser-tcp.c ser-mingw.c \
  	sh-tdep.c sh64-tdep.c shnbsd-tdep.c shnbsd-nat.c \
@@ -39,7 +39,7 @@
  	solib-svr4.c \
  	sparc-linux-nat.c sparc-linux-tdep.c \
 diff --git a/gdb/configure.host b/gdb/configure.host
-index ef265eb..322a1e2 100644
+index ef265ebe29..322a1e2c67 100644
 --- a/gdb/configure.host
 +++ b/gdb/configure.host
 @@ -149,6 +149,7 @@ powerpc*-*-linux*)	gdb_host=linux ;;
@@ -51,7 +51,7 @@
  			gdb_host=nbsd ;;
  sh*-*-openbsd*)		gdb_host=nbsd ;;
 diff --git a/gdb/sh-linux-tdep.c b/gdb/sh-linux-tdep.c
-index 2418d25..ac8ea9e 100644
+index 2418d25010..ac8ea9e2a4 100644
 --- a/gdb/sh-linux-tdep.c
 +++ b/gdb/sh-linux-tdep.c
 @@ -18,14 +18,37 @@
@@ -599,7 +599,7 @@
  
    /* GNU/Linux uses SVR4-style shared libraries.  */
 diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
-index 336b48e..847b271 100644
+index 694f5f742d..8d54df7a1a 100644
 --- a/gdb/sh-tdep.c
 +++ b/gdb/sh-tdep.c
 @@ -21,6 +21,9 @@
@@ -662,7 +662,7 @@
        len = TYPE_LENGTH (type);
        val = sh_justify_value_in_reg (gdbarch, args[argnum], len);
  
-@@ -1821,7 +1808,7 @@ sh_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
+@@ -1819,7 +1806,7 @@ sh_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
      reg->how = DWARF2_FRAME_REG_UNDEFINED;
  }
  
@@ -671,7 +671,7 @@
  sh_alloc_frame_cache (void)
  {
    struct sh_frame_cache *cache;
-@@ -1848,7 +1835,7 @@ sh_alloc_frame_cache (void)
+@@ -1846,7 +1833,7 @@ sh_alloc_frame_cache (void)
    return cache;
  }
  
@@ -680,7 +680,7 @@
  sh_frame_cache (struct frame_info *this_frame, void **this_cache)
  {
    struct gdbarch *gdbarch = get_frame_arch (this_frame);
-@@ -1915,9 +1902,9 @@ sh_frame_cache (struct frame_info *this_frame, void **this_cache)
+@@ -1913,9 +1900,9 @@ sh_frame_cache (struct frame_info *this_frame, void **this_cache)
    return cache;
  }
  
@@ -693,7 +693,7 @@
  {
    struct gdbarch *gdbarch = get_frame_arch (this_frame);
    struct sh_frame_cache *cache = sh_frame_cache (this_frame, this_cache);
-@@ -1931,7 +1918,7 @@ sh_frame_prev_register (struct frame_info *this_frame,
+@@ -1929,7 +1916,7 @@ sh_frame_prev_register (struct frame_info *this_frame,
       the current frame.  Frob regnum so that we pull the value from
       the correct place.  */
    if (regnum == gdbarch_pc_regnum (gdbarch))
@@ -702,7 +702,7 @@
  
    if (regnum < SH_NUM_REGS && cache->saved_regs[regnum] != -1)
      return frame_unwind_got_memory (this_frame, regnum,
-@@ -2240,8 +2227,8 @@ sh_return_in_first_hidden_param_p (struct gdbarch *gdbarch,
+@@ -2238,8 +2225,8 @@ sh_return_in_first_hidden_param_p (struct gdbarch *gdbarch,
  static struct gdbarch *
  sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
  {
@@ -712,7 +712,7 @@
  
    /* SH5 is handled entirely in sh64-tdep.c.  */
    if (info.bfd_arch_info->mach == bfd_mach_sh5)
-@@ -2257,6 +2244,18 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+@@ -2255,6 +2242,18 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
    tdep = XCNEW (struct gdbarch_tdep);
    gdbarch = gdbarch_alloc (&info, tdep);
  
@@ -731,7 +731,7 @@
    set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
    set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
    set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
-@@ -2407,10 +2406,11 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+@@ -2405,10 +2404,11 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
        break;
      }
  
@@ -745,7 +745,7 @@
    frame_unwind_append_unwinder (gdbarch, &sh_frame_unwind);
  
 diff --git a/gdb/sh-tdep.h b/gdb/sh-tdep.h
-index 666968f..62c65b5 100644
+index 666968f787..62c65b55ea 100644
 --- a/gdb/sh-tdep.h
 +++ b/gdb/sh-tdep.h
 @@ -21,6 +21,12 @@
@@ -828,7 +828,7 @@
       where each general-purpose register is stored inside the associated
       core file section.  */
 diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
-index 6d9aef8..5b66b42 100644
+index 6d9aef81bb..5b66b429d1 100644
 --- a/gdb/testsuite/gdb.asm/asm-source.exp
 +++ b/gdb/testsuite/gdb.asm/asm-source.exp
 @@ -116,6 +116,11 @@ switch -glob -- [istarget] {
@@ -844,7 +844,7 @@
          set asm-arch sh
  	set debug-flags "-gdwarf-2"
 diff --git a/gdb/testsuite/gdb.asm/sh.inc b/gdb/testsuite/gdb.asm/sh.inc
-index a4a5fc5..89efed7 100644
+index a4a5fc545e..89efed7795 100644
 --- a/gdb/testsuite/gdb.asm/sh.inc
 +++ b/gdb/testsuite/gdb.asm/sh.inc
 @@ -40,9 +40,8 @@
@@ -859,7 +859,7 @@
  	.align	1
  .Lafterconst\@:
 diff --git a/gdb/testsuite/gdb.base/annota1.c b/gdb/testsuite/gdb.base/annota1.c
-index 424e1b8..0de2e7b 100644
+index 424e1b8327..0de2e7b633 100644
 --- a/gdb/testsuite/gdb.base/annota1.c
 +++ b/gdb/testsuite/gdb.base/annota1.c
 @@ -1,6 +1,9 @@
@@ -873,7 +873,7 @@
  void
  handle_USR1 (int sig)
 diff --git a/gdb/testsuite/gdb.base/annota3.c b/gdb/testsuite/gdb.base/annota3.c
-index 424e1b8..952aaf21 100644
+index 424e1b8327..952aaf218a 100644
 --- a/gdb/testsuite/gdb.base/annota3.c
 +++ b/gdb/testsuite/gdb.base/annota3.c
 @@ -1,6 +1,10 @@
@@ -888,7 +888,7 @@
  void
  handle_USR1 (int sig)
 diff --git a/gdb/testsuite/gdb.base/sigall.c b/gdb/testsuite/gdb.base/sigall.c
-index 81f3b08..1574b2d 100644
+index 81f3b08d6b..1574b2d6cb 100644
 --- a/gdb/testsuite/gdb.base/sigall.c
 +++ b/gdb/testsuite/gdb.base/sigall.c
 @@ -1,6 +1,9 @@
@@ -902,7 +902,7 @@
  /* Signal handlers, we set breakpoints in them to make sure that the
     signals really get delivered.  */
 diff --git a/gdb/testsuite/gdb.base/signals.c b/gdb/testsuite/gdb.base/signals.c
-index 7566068..1205a9b 100644
+index 756606880f..1205a9bc9c 100644
 --- a/gdb/testsuite/gdb.base/signals.c
 +++ b/gdb/testsuite/gdb.base/signals.c
 @@ -3,6 +3,10 @@
@@ -917,5 +917,5 @@
  static int count = 0;
  
 -- 
-2.8.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch
index 394d26d..5ed8e81 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch
@@ -1,4 +1,4 @@
-From f3932cb2960fd54655a448b13d5a5b80f356f8de Mon Sep 17 00:00:00 2001
+From 2a6e28ad5c0cad189a3697d96de031e4713052b8 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 30 Apr 2016 15:25:03 -0700
 Subject: [PATCH 06/10] Dont disable libreadline.a when using --disable-static
@@ -19,7 +19,7 @@
  2 files changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/Makefile.def b/Makefile.def
-index ea8453e..0fc66c6 100644
+index ea8453e851..0fc66c694b 100644
 --- a/Makefile.def
 +++ b/Makefile.def
 @@ -104,7 +104,8 @@ host_modules= { module= libiconv;
@@ -33,10 +33,10 @@
  host_modules= { module= sim; };
  host_modules= { module= texinfo; no_install= true; };
 diff --git a/Makefile.in b/Makefile.in
-index 2733c4d..3e04e80 100644
+index cb0136e8f8..55f9085c16 100644
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -25380,7 +25380,7 @@ configure-readline:
+@@ -25385,7 +25385,7 @@ configure-readline:
  	  $$s/$$module_srcdir/configure \
  	  --srcdir=$${topdir}/$$module_srcdir \
  	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
@@ -46,5 +46,5 @@
  @endif readline
  
 -- 
-2.8.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0007-use-asm-sgidefs.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0007-use-asm-sgidefs.h.patch
index f32f8ee..a42c9fd 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0007-use-asm-sgidefs.h.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0007-use-asm-sgidefs.h.patch
@@ -1,4 +1,4 @@
-From 048675a915a72989f2613386975730da016e7c5d Mon Sep 17 00:00:00 2001
+From d7543b44255da4ae71447d4e4d63e0b6aa4ed909 Mon Sep 17 00:00:00 2001
 From: Andre McCurdy <amccurdy@gmail.com>
 Date: Sat, 30 Apr 2016 15:29:06 -0700
 Subject: [PATCH 07/10] use <asm/sgidefs.h>
@@ -19,7 +19,7 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
-index 449b43a..09603da 100644
+index 722532bb6c..51d8fc8f66 100644
 --- a/gdb/mips-linux-nat.c
 +++ b/gdb/mips-linux-nat.c
 @@ -31,7 +31,7 @@
@@ -32,5 +32,5 @@
  #include <asm/ptrace.h>
  
 -- 
-2.8.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch
index 7e58b61..ae9cb8c 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch
@@ -1,4 +1,4 @@
-From e54ead9d81f4d38412751b815f909db3cb144bb1 Mon Sep 17 00:00:00 2001
+From aacd77184da1328908da41c9fdb55ad881fa0e99 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 30 Apr 2016 15:31:40 -0700
 Subject: [PATCH 08/10] Use exorted definitions of SIGRTMIN
@@ -20,10 +20,10 @@
  2 files changed, 6 insertions(+), 2 deletions(-)
 
 diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
-index 0829bcb..3b8a896 100644
+index 5d5efa0af4..e3420b49a0 100644
 --- a/gdb/linux-nat.c
 +++ b/gdb/linux-nat.c
-@@ -4845,6 +4845,6 @@ lin_thread_get_thread_signals (sigset_t *set)
+@@ -5022,6 +5022,6 @@ lin_thread_get_thread_signals (sigset_t *set)
    /* NPTL reserves the first two RT signals, but does not provide any
       way for the debugger to query the signal numbers - fortunately
       they don't change.  */
@@ -33,7 +33,7 @@
 +  sigaddset (set, SIGRTMIN + 1);
  }
 diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h
-index 2b485db..d058afc 100644
+index 2b485db141..d058afcde8 100644
 --- a/gdb/nat/linux-nat.h
 +++ b/gdb/nat/linux-nat.h
 @@ -85,4 +85,8 @@ extern enum target_stop_reason lwp_stop_reason (struct lwp_info *lwp);
@@ -46,5 +46,5 @@
 +
  #endif /* LINUX_NAT_H */
 -- 
-2.8.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch
index a230047..ed6e0ae 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch
@@ -1,4 +1,4 @@
-From ba0bbf887d4911ccee9df57cb13eafb1de34bb31 Mon Sep 17 00:00:00 2001
+From 8c35d5d1825ed017cc58ea91011412e54c002eeb Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 30 Apr 2016 15:35:39 -0700
 Subject: [PATCH 09/10] Change order of CFLAGS
@@ -13,7 +13,7 @@
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
-index 1e874e3..91e8550 100644
+index f844ab8853..3f88db52e3 100644
 --- a/gdb/gdbserver/Makefile.in
 +++ b/gdb/gdbserver/Makefile.in
 @@ -138,10 +138,10 @@ CXXFLAGS = @CXXFLAGS@
@@ -30,5 +30,5 @@
  # LDFLAGS is specifically reserved for setting from the command line
  # when running make.
 -- 
-2.8.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch
index 16c34c7..1938beb 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch
@@ -1,4 +1,4 @@
-From 5a9ccb8c0728b658fc4f7f0f7b36873c64274f10 Mon Sep 17 00:00:00 2001
+From 7816d3497266e55c1c921d7cc1c8bf81c8ed0b4a Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Tue, 10 May 2016 08:47:05 -0700
 Subject: [PATCH 10/10] resolve restrict keyword conflict
@@ -15,7 +15,7 @@
  1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/gdb/gnulib/import/sys_time.in.h b/gdb/gnulib/import/sys_time.in.h
-index c556c5d..2a6107f 100644
+index c556c5db23..2a6107fcf8 100644
 --- a/gdb/gnulib/import/sys_time.in.h
 +++ b/gdb/gnulib/import/sys_time.in.h
 @@ -93,20 +93,20 @@ struct timeval
@@ -44,5 +44,5 @@
  _GL_CXXALIASWARN (gettimeofday);
  #elif defined GNULIB_POSIXCHECK
 -- 
-2.8.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0011-avx_mpx.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0011-avx_mpx.patch
deleted file mode 100644
index 209c4fc..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0011-avx_mpx.patch
+++ /dev/null
@@ -1,2601 +0,0 @@
-gdb: Backport patch to support changes with AVX and MPX
-
-The current MPX target descriptions assume that MPX is always combined
-with AVX, however that's not correct.  We can have machines with MPX
-and without AVX; or machines with AVX and without MPX.
-
-This patch adds new target descriptions for machines that support
-both MPX and AVX, as duplicates of the existing MPX descriptions.
-
-The following commit will remove AVX from the MPX-only descriptions.
-
-Upstream-Status: Backport
-
-Signed-off-by: bavery <brian.avery@intel.com>
-
-
-Orignal patch changelog and author attribution:
-
-2016-04-16  Walfred Tedeschi  <walfred.tedeschi@intel.com>
-
-gdb/ChangeLog:
-
-	* amd64-linux-tdep.c (features/i386/amd64-avx-mpx-linux.c):
-	New include.
-	(amd64_linux_core_read_description): Add case for
-	 X86_XSTATE_AVX_MPX_MASK.
-	(_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_mpx_linux.
-	* amd64-linux-tdep.h (tdesc_amd64_avx_mpx_linux): New definition.
-	* amd64-tdep.c (features/i386/amd64-avx-mpx.c): New include.
-	(amd64_target_description): Add case for  X86_XSTATE_AVX_MPX_MASK.
-	(_initialize_amd64_tdep): Call initialize_tdesc_amd64_avx_mpx.
-	* common/x86-xstate.h (X86_XSTATE_MPX_MASK): Remove AVX bits.
-	(X86_XSTATE_AVX_MPX_MASK): New case.
-	* features/Makefile (i386/i386-avx-mpx, i386/i386-avx-mpx-linux)
-	(i386/amd64-avx-mpx, i386/amd64-avx-mpx-linux): New rules.
-	(i386/i386-avx-mpx-expedite, i386/i386-avx-mpx-linux-expedite)
-	(i386/amd64-avx-mpx-expedite, i386/amd64-avx-mpx-linux-expedite):
-	New expedites.
-	* i386-linux-tdep.c (features/i386/i386-avx-mpx-linux.c): New
-	include.
-	(i386_linux_core_read_description): Add case
-	X86_XSTATE_AVX_MPX_MASK.
-	(_initialize_i386_linux_tdep): Call
-	initialize_tdesc_i386_avx_mpx_linux.
-	* i386-linux-tdep.h (tdesc_i386_avx_mpx_linux): New include.
-	* i386-tdep.c (features/i386/i386-avx-mpx.c): New include.
-	(i386_target_description): Add case for X86_XSTATE_AVX_MPX_MASK.
-	* x86-linux-nat.c (x86_linux_read_description): Add case for
-	X86_XSTATE_AVX_MPX_MASK.
-	* features/i386/amd64-avx-mpx-linux.xml: New file.
-	* features/i386/i386-avx-mpx-linux.xml: New file.
-	* features/i386/i386-avx-mpx.xml: New file.
-	* features/i386/amd64-avx-mpx.xml: New file.
-	* features/i386/amd64-avx-mpx-linux.c: Generated.
-	* features/i386/amd64-avx-mpx.c: Generated.
-	* features/i386/i386-avx-mpx-linux.c: Generated.
-	* features/i386/i386-avx-mpx.c: Generated.
-	* regformats/i386/amd64-avx-mpx-linux.dat: Generated.
-	* regformats/i386/amd64-avx-mpx.dat: Generated.
-	* regformats/i386/i386-avx-mpx-linux.dat: Generated.
-	* regformats/i386/i386-avx-mpx.dat: Generated.
-
-gdb/gdbserver/ChangeLog:
-
-	* Makefile.in (clean): Add removal for i386-avx-mpx.c,
-	i386-avx-mpx-linux.c, amd64-avx-mpx.c and amd64-avx-mpx-linux.c.
-	(i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c)
-	(amd64-avx-mpx-linux.c): New rules.
-	(amd64-avx-mpx-linux-ipa.o, i386-avx-mpx-linux-ipa.o): New rule.
-	* configure.srv (srv_i386_regobj): Add i386-avx-mpx.o.
-	(srv_i386_linux_regobj): Add i386-avx-mpx-linux.o.
-	(srv_amd64_regobj): Add amd64-avx-mpx.o.
-	(srv_amd64_linux_regobj): Add amd64-avx-mpx-linux.o.
-	(srv_i386_xmlfiles): Add i386/i386-avx-mpx.xml.
-	(srv_amd64_xmlfiles): Add i386/amd64-avx-mpx.xml.
-	(srv_i386_linux_xmlfiles): Add i386/i386-avx-mpx-linux.xml.
-	(srv_amd64_linux_xmlfiles): Add i386/amd64-avx-mpx-linux.xml.
-	(ipa_i386_linux_regobj): Add i386-avx-mpx-linux-ipa.o.
-	(ipa_amd64_linux_regobj): Add amd64-avx-mpx-linux-ipa.o.
-	* linux-x86-low.c (x86_linux_read_description): Add case for
-	X86_XSTATE_AVX_MPX_MASK.
-	(x86_get_ipa_tdesc_idx): Add cases for avx_mpx.
-	(initialize_low_arch): Call init_registers_amd64_avx_mpx_linux and
-	init_registers_i386_avx_mpx_linux.
-	* linux-i386-ipa.c (get_ipa_tdesc): Add case for avx_mpx.
-	(initialize_low_tracepoint): Call
-	init_registers_i386_avx_mpx_linux.
-	* linux-amd64-ipa.c (get_ipa_tdesc):  Add case for avx_mpx.
-	(initialize_low_tracepoint): Call
-	init_registers_amd64_avx_mpx_linux.
-	* linux-x86-tdesc.h (X86_TDESC_AVX_MPX): New enum value.
-	(init_registers_amd64_avx_mpx_linux, tdesc_amd64_avx_mpx_linux)
-	(init_registers_i386_avx_mpx_linux, tdesc_i386_avx_mpx_linux): New
-	declarations.
-
-
-
-
-diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
-index 21bcd99..5327f7c 100644
---- a/gdb/amd64-linux-tdep.c
-+++ b/gdb/amd64-linux-tdep.c
-@@ -43,6 +43,7 @@
- #include "features/i386/amd64-linux.c"
- #include "features/i386/amd64-avx-linux.c"
- #include "features/i386/amd64-mpx-linux.c"
-+#include "features/i386/amd64-avx-mpx-linux.c"
- #include "features/i386/amd64-avx512-linux.c"
-
- #include "features/i386/x32-linux.c"
-@@ -1590,6 +1591,11 @@ amd64_linux_core_read_description (struct gdbarch *gdbarch,
- 	return tdesc_x32_avx_linux;  /* No x32 MPX falling back to AVX.  */
-       else
- 	return tdesc_amd64_mpx_linux;
-+    case X86_XSTATE_AVX_MPX_MASK:
-+      if (gdbarch_ptr_bit (gdbarch) == 32)
-+	return tdesc_x32_avx_linux;  /* No x32 MPX falling back to AVX.  */
-+      else
-+	return tdesc_amd64_avx_mpx_linux;
-     case X86_XSTATE_AVX_MASK:
-       if (gdbarch_ptr_bit (gdbarch) == 32)
- 	return tdesc_x32_avx_linux;
-@@ -2285,6 +2291,7 @@ _initialize_amd64_linux_tdep (void)
-   initialize_tdesc_amd64_linux ();
-   initialize_tdesc_amd64_avx_linux ();
-   initialize_tdesc_amd64_mpx_linux ();
-+  initialize_tdesc_amd64_avx_mpx_linux ();
-   initialize_tdesc_amd64_avx512_linux ();
-
-   initialize_tdesc_x32_linux ();
-diff --git a/gdb/amd64-linux-tdep.h b/gdb/amd64-linux-tdep.h
-index 8673442..d64d5d6 100644
---- a/gdb/amd64-linux-tdep.h
-+++ b/gdb/amd64-linux-tdep.h
-@@ -35,6 +35,7 @@
- extern struct target_desc *tdesc_amd64_linux;
- extern struct target_desc *tdesc_amd64_avx_linux;
- extern struct target_desc *tdesc_amd64_mpx_linux;
-+extern struct target_desc *tdesc_amd64_avx_mpx_linux;
- extern struct target_desc *tdesc_amd64_avx512_linux;
-
- extern struct target_desc *tdesc_x32_linux;
-diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
-index fae92b2..88e3bf8 100644
---- a/gdb/amd64-tdep.c
-+++ b/gdb/amd64-tdep.c
-@@ -44,6 +44,7 @@
- #include "features/i386/amd64.c"
- #include "features/i386/amd64-avx.c"
- #include "features/i386/amd64-mpx.c"
-+#include "features/i386/amd64-avx-mpx.c"
- #include "features/i386/amd64-avx512.c"
-
- #include "features/i386/x32.c"
-@@ -3132,6 +3133,8 @@ amd64_target_description (uint64_t xcr0)
-       return tdesc_amd64_avx512;
-     case X86_XSTATE_MPX_MASK:
-       return tdesc_amd64_mpx;
-+    case X86_XSTATE_AVX_MPX_MASK:
-+      return tdesc_amd64_avx_mpx;
-     case X86_XSTATE_AVX_MASK:
-       return tdesc_amd64_avx;
-     default:
-@@ -3148,6 +3151,7 @@ _initialize_amd64_tdep (void)
-   initialize_tdesc_amd64 ();
-   initialize_tdesc_amd64_avx ();
-   initialize_tdesc_amd64_mpx ();
-+  initialize_tdesc_amd64_avx_mpx ();
-   initialize_tdesc_amd64_avx512 ();
-
-   initialize_tdesc_x32 ();
-diff --git a/gdb/common/x86-xstate.h b/gdb/common/x86-xstate.h
-index 8386420..0aa9164 100644
---- a/gdb/common/x86-xstate.h
-+++ b/gdb/common/x86-xstate.h
-@@ -39,9 +39,10 @@
- #define X86_XSTATE_X87_MASK	X86_XSTATE_X87
- #define X86_XSTATE_SSE_MASK	(X86_XSTATE_X87 | X86_XSTATE_SSE)
- #define X86_XSTATE_AVX_MASK	(X86_XSTATE_SSE_MASK | X86_XSTATE_AVX)
--#define X86_XSTATE_MPX_MASK	(X86_XSTATE_AVX_MASK | X86_XSTATE_MPX)
-+#define X86_XSTATE_MPX_MASK	(X86_XSTATE_SSE_MASK | X86_XSTATE_MPX)
-+#define X86_XSTATE_AVX_MPX_MASK	(X86_XSTATE_AVX_MASK | X86_XSTATE_MPX)
- #define X86_XSTATE_AVX512_MASK	(X86_XSTATE_AVX_MASK | X86_XSTATE_AVX512)
--#define X86_XSTATE_MPX_AVX512_MASK (X86_XSTATE_MPX_MASK | X86_XSTATE_AVX512)
-+#define X86_XSTATE_MPX_AVX512_MASK (X86_XSTATE_AVX_MPX_MASK | X86_XSTATE_AVX512)
-
- #define X86_XSTATE_ALL_MASK	(X86_XSTATE_MPX_AVX512_MASK)
-
-diff --git a/gdb/features/Makefile b/gdb/features/Makefile
-index 10173cf..e5c5154 100644
---- a/gdb/features/Makefile
-+++ b/gdb/features/Makefile
-@@ -50,9 +50,11 @@ WHICH = aarch64 \
- 	i386/amd64 i386/amd64-linux \
- 	i386/i386-avx i386/i386-avx-linux \
- 	i386/i386-mpx i386/i386-mpx-linux \
-+	i386/i386-avx-mpx i386/i386-avx-mpx-linux \
- 	i386/i386-avx512 i386/i386-avx512-linux \
- 	i386/amd64-avx i386/amd64-avx-linux \
- 	i386/amd64-mpx i386/amd64-mpx-linux \
-+	i386/amd64-avx-mpx i386/amd64-avx-mpx-linux \
- 	i386/amd64-avx512 i386/amd64-avx512-linux \
- 	i386/x32 i386/x32-linux \
- 	i386/x32-avx i386/x32-avx-linux \
-@@ -83,7 +85,9 @@ i386/amd64-linux-expedite = rbp,rsp,rip
- i386/i386-avx-expedite = ebp,esp,eip
- i386/i386-avx-linux-expedite = ebp,esp,eip
- i386/i386-mpx-expedite = ebp,esp,eip
-+i386/i386-avx-mpx-expedite = ebp,esp,eip
- i386/i386-mpx-linux-expedite = ebp,esp,eip
-+i386/i386-avx-mpx-linux-expedite = ebp,esp,eip
- i386/i386-avx512-expedite = ebp,esp,eip
- i386/i386-avx512-linux-expedite = ebp,esp,eip
- i386/i386-mmx-expedite = ebp,esp,eip
-@@ -91,7 +95,9 @@ i386/i386-mmx-linux-expedite = ebp,esp,eip
- i386/amd64-avx-expedite = rbp,rsp,rip
- i386/amd64-avx-linux-expedite = rbp,rsp,rip
- i386/amd64-mpx-expedite = rbp,rsp,rip
-+i386/amd64-avx-mpx-expedite = rbp,rsp,rip
- i386/amd64-mpx-linux-expedite = rbp,rsp,rip
-+i386/amd64-avx-mpx-linux-expedite = rbp,rsp,rip
- i386/amd64-avx512-expedite = rbp,rsp,rip
- i386/amd64-avx512-linux-expedite = rbp,rsp,rip
- i386/x32-expedite = rbp,rsp,rip
-@@ -156,6 +162,8 @@ XMLTOC = \
- 	i386/amd64-linux.xml \
- 	i386/amd64-mpx-linux.xml \
- 	i386/amd64-mpx.xml \
-+	i386/amd64-avx-mpx-linux.xml \
-+	i386/amd64-avx-mpx.xml \
- 	i386/amd64.xml \
- 	i386/i386-avx-linux.xml \
- 	i386/i386-avx.xml \
-@@ -166,6 +174,8 @@ XMLTOC = \
- 	i386/i386-mmx.xml \
- 	i386/i386-mpx-linux.xml \
- 	i386/i386-mpx.xml \
-+	i386/i386-avx-mpx-linux.xml \
-+	i386/i386-avx-mpx.xml \
- 	i386/i386.xml \
- 	i386/x32-avx-linux.xml \
- 	i386/x32-avx.xml \
-@@ -271,6 +281,10 @@ $(outdir)/i386/i386-mpx.dat: i386/32bit-core.xml i386/32bit-avx.xml \
- 			       i386/32bit-mpx.xml
- $(outdir)/i386/i386-mpx-linux.dat: i386/32bit-core.xml 	i386/32bit-avx.xml \
- 			       i386/32bit-linux.xml i386/32bit-mpx.xml
-+$(outdir)/i386/i386-mpx-linux.dat: i386/32bit-core.xml \
-+			       i386/32bit-linux.xml i386/32bit-mpx.xml
-+$(outdir)/i386/i386-avx-mpx-linux.dat: i386/32bit-core.xml \
-+			       i386/32bit-linux.xml i386/32bit-mpx.xml
- $(outdir)/i386/i386-avx512.dat: i386/32bit-core.xml i386/32bit-avx.xml \
- 			       i386/32bit-mpx.xml i386/32bit-avx512.xml
- $(outdir)/i386/i386-avx512-linux.dat: i386/32bit-core.xml i386/32bit-avx.xml \
-@@ -282,8 +296,12 @@ $(outdir)/i386/amd64-avx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
- 				    i386/64bit-linux.xml
- $(outdir)/i386/amd64-mpx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
- 			       i386/64bit-linux.xml i386/64bit-mpx.xml
-+$(outdir)/i386/amd64-avx-mpx-linux.dat: i386/64bit-core.xml \
-+			       i386/64bit-linux.xml i386/64bit-mpx.xml
- $(outdir)/i386/amd64-mpx.dat: i386/64bit-core.xml i386/64bit-avx.xml \
- 			       i386/64bit-mpx.xml
-+$(outdir)/i386/amd64-avx-mpx.dat: i386/64bit-core.xml \
-+			       i386/64bit-mpx.xml
- $(outdir)/i386/amd64-avx512.dat: i386/64bit-core.xml i386/64bit-avx.xml \
- 			       i386/64bit-mpx.xml i386/64bit-avx512.xml
- $(outdir)/i386/amd64-avx512-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
-diff --git a/gdb/features/i386/amd64-avx-mpx-linux.c b/gdb/features/i386/amd64-avx-mpx-linux.c
-new file mode 100644
-index 0000000..37b4c81
---- /dev/null
-+++ b/gdb/features/i386/amd64-avx-mpx-linux.c
-@@ -0,0 +1,211 @@
-+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
-+  Original: amd64-avx-mpx-linux.xml */
-+
-+#include "defs.h"
-+#include "osabi.h"
-+#include "target-descriptions.h"
-+
-+struct target_desc *tdesc_amd64_avx_mpx_linux;
-+static void
-+initialize_tdesc_amd64_avx_mpx_linux (void)
-+{
-+  struct target_desc *result = allocate_target_description ();
-+  struct tdesc_feature *feature;
-+  struct tdesc_type *field_type;
-+  struct tdesc_type *type;
-+
-+  set_tdesc_architecture (result, bfd_scan_arch ("i386:x86-64"));
-+
-+  set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
-+  field_type = tdesc_create_flags (feature, "i386_eflags", 4);
-+  tdesc_add_flag (field_type, 0, "CF");
-+  tdesc_add_flag (field_type, 1, "");
-+  tdesc_add_flag (field_type, 2, "PF");
-+  tdesc_add_flag (field_type, 4, "AF");
-+  tdesc_add_flag (field_type, 6, "ZF");
-+  tdesc_add_flag (field_type, 7, "SF");
-+  tdesc_add_flag (field_type, 8, "TF");
-+  tdesc_add_flag (field_type, 9, "IF");
-+  tdesc_add_flag (field_type, 10, "DF");
-+  tdesc_add_flag (field_type, 11, "OF");
-+  tdesc_add_flag (field_type, 14, "NT");
-+  tdesc_add_flag (field_type, 16, "RF");
-+  tdesc_add_flag (field_type, 17, "VM");
-+  tdesc_add_flag (field_type, 18, "AC");
-+  tdesc_add_flag (field_type, 19, "VIF");
-+  tdesc_add_flag (field_type, 20, "VIP");
-+  tdesc_add_flag (field_type, 21, "ID");
-+
-+  tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rdx", 3, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rsi", 4, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rdi", 5, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rbp", 6, 1, NULL, 64, "data_ptr");
-+  tdesc_create_reg (feature, "rsp", 7, 1, NULL, 64, "data_ptr");
-+  tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rip", 16, 1, NULL, 64, "code_ptr");
-+  tdesc_create_reg (feature, "eflags", 17, 1, NULL, 32, "i386_eflags");
-+  tdesc_create_reg (feature, "cs", 18, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ss", 19, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ds", 20, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "es", 21, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "fs", 22, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "gs", 23, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "st0", 24, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st1", 25, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st2", 26, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st3", 27, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st4", 28, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st5", 29, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st6", 30, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st7", 31, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "fctrl", 32, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fstat", 33, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "ftag", 34, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fiseg", 35, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fioff", 36, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "foseg", 37, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fooff", 38, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fop", 39, 1, "float", 32, "int");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse");
-+  field_type = tdesc_named_type (feature, "ieee_single");
-+  tdesc_create_vector (feature, "v4f", field_type, 4);
-+
-+  field_type = tdesc_named_type (feature, "ieee_double");
-+  tdesc_create_vector (feature, "v2d", field_type, 2);
-+
-+  field_type = tdesc_named_type (feature, "int8");
-+  tdesc_create_vector (feature, "v16i8", field_type, 16);
-+
-+  field_type = tdesc_named_type (feature, "int16");
-+  tdesc_create_vector (feature, "v8i16", field_type, 8);
-+
-+  field_type = tdesc_named_type (feature, "int32");
-+  tdesc_create_vector (feature, "v4i32", field_type, 4);
-+
-+  field_type = tdesc_named_type (feature, "int64");
-+  tdesc_create_vector (feature, "v2i64", field_type, 2);
-+
-+  type = tdesc_create_union (feature, "vec128");
-+  field_type = tdesc_named_type (feature, "v4f");
-+  tdesc_add_field (type, "v4_float", field_type);
-+  field_type = tdesc_named_type (feature, "v2d");
-+  tdesc_add_field (type, "v2_double", field_type);
-+  field_type = tdesc_named_type (feature, "v16i8");
-+  tdesc_add_field (type, "v16_int8", field_type);
-+  field_type = tdesc_named_type (feature, "v8i16");
-+  tdesc_add_field (type, "v8_int16", field_type);
-+  field_type = tdesc_named_type (feature, "v4i32");
-+  tdesc_add_field (type, "v4_int32", field_type);
-+  field_type = tdesc_named_type (feature, "v2i64");
-+  tdesc_add_field (type, "v2_int64", field_type);
-+  field_type = tdesc_named_type (feature, "uint128");
-+  tdesc_add_field (type, "uint128", field_type);
-+
-+  field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
-+  tdesc_add_flag (field_type, 0, "IE");
-+  tdesc_add_flag (field_type, 1, "DE");
-+  tdesc_add_flag (field_type, 2, "ZE");
-+  tdesc_add_flag (field_type, 3, "OE");
-+  tdesc_add_flag (field_type, 4, "UE");
-+  tdesc_add_flag (field_type, 5, "PE");
-+  tdesc_add_flag (field_type, 6, "DAZ");
-+  tdesc_add_flag (field_type, 7, "IM");
-+  tdesc_add_flag (field_type, 8, "DM");
-+  tdesc_add_flag (field_type, 9, "ZM");
-+  tdesc_add_flag (field_type, 10, "OM");
-+  tdesc_add_flag (field_type, 11, "UM");
-+  tdesc_add_flag (field_type, 12, "PM");
-+  tdesc_add_flag (field_type, 15, "FZ");
-+
-+  tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm3", 43, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm4", 44, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm5", 45, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm6", 46, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm7", 47, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm8", 48, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm9", 49, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm10", 50, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm11", 51, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm12", 52, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm13", 53, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm14", 54, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm15", 55, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "mxcsr", 56, 1, "vector", 32, "i386_mxcsr");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
-+  tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
-+  tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
-+  type = tdesc_create_struct (feature, "br128");
-+  field_type = tdesc_named_type (feature, "uint64");
-+  tdesc_add_field (type, "lbound", field_type);
-+  field_type = tdesc_named_type (feature, "uint64");
-+  tdesc_add_field (type, "ubound_raw", field_type);
-+
-+  type = tdesc_create_struct (feature, "_bndstatus");
-+  tdesc_set_struct_size (type, 8);
-+  tdesc_add_bitfield (type, "bde", 2, 63);
-+  tdesc_add_bitfield (type, "error", 0, 1);
-+
-+  type = tdesc_create_union (feature, "status");
-+  field_type = tdesc_named_type (feature, "data_ptr");
-+  tdesc_add_field (type, "raw", field_type);
-+  field_type = tdesc_named_type (feature, "_bndstatus");
-+  tdesc_add_field (type, "status", field_type);
-+
-+  type = tdesc_create_struct (feature, "_bndcfgu");
-+  tdesc_set_struct_size (type, 8);
-+  tdesc_add_bitfield (type, "base", 12, 63);
-+  tdesc_add_bitfield (type, "reserved", 2, 11);
-+  tdesc_add_bitfield (type, "preserved", 1, 1);
-+  tdesc_add_bitfield (type, "enabled", 0, 0);
-+
-+  type = tdesc_create_union (feature, "cfgu");
-+  field_type = tdesc_named_type (feature, "data_ptr");
-+  tdesc_add_field (type, "raw", field_type);
-+  field_type = tdesc_named_type (feature, "_bndcfgu");
-+  tdesc_add_field (type, "config", field_type);
-+
-+  tdesc_create_reg (feature, "bnd0raw", 74, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd1raw", 75, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd2raw", 76, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd3raw", 77, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bndcfgu", 78, 1, NULL, 64, "cfgu");
-+  tdesc_create_reg (feature, "bndstatus", 79, 1, NULL, 64, "status");
-+
-+  tdesc_amd64_avx_mpx_linux = result;
-+}
-diff --git a/gdb/features/i386/amd64-avx-mpx-linux.xml b/gdb/features/i386/amd64-avx-mpx-linux.xml
-new file mode 100644
-index 0000000..526c700
---- /dev/null
-+++ b/gdb/features/i386/amd64-avx-mpx-linux.xml
-@@ -0,0 +1,19 @@
-+<?xml version="1.0"?>
-+<!-- Copyright (C) 2013-2016 Free Software Foundation, Inc.
-+
-+     Copying and distribution of this file, with or without modification,
-+     are permitted in any medium without royalty provided the copyright
-+     notice and this notice are preserved.  -->
-+
-+<!-- AMD64 with AVX and MPX - Includes Linux-only special "register".  -->
-+
-+<!DOCTYPE target SYSTEM "gdb-target.dtd">
-+<target>
-+  <architecture>i386:x86-64</architecture>
-+  <osabi>GNU/Linux</osabi>
-+  <xi:include href="64bit-core.xml"/>
-+  <xi:include href="64bit-sse.xml"/>
-+  <xi:include href="64bit-linux.xml"/>
-+  <xi:include href="64bit-avx.xml"/>
-+  <xi:include href="64bit-mpx.xml"/>
-+</target>
-diff --git a/gdb/features/i386/amd64-avx-mpx.c b/gdb/features/i386/amd64-avx-mpx.c
-new file mode 100644
-index 0000000..1279f73
---- /dev/null
-+++ b/gdb/features/i386/amd64-avx-mpx.c
-@@ -0,0 +1,206 @@
-+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
-+  Original: amd64-avx-mpx.xml */
-+
-+#include "defs.h"
-+#include "osabi.h"
-+#include "target-descriptions.h"
-+
-+struct target_desc *tdesc_amd64_avx_mpx;
-+static void
-+initialize_tdesc_amd64_avx_mpx (void)
-+{
-+  struct target_desc *result = allocate_target_description ();
-+  struct tdesc_feature *feature;
-+  struct tdesc_type *field_type;
-+  struct tdesc_type *type;
-+
-+  set_tdesc_architecture (result, bfd_scan_arch ("i386:x86-64"));
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
-+  field_type = tdesc_create_flags (feature, "i386_eflags", 4);
-+  tdesc_add_flag (field_type, 0, "CF");
-+  tdesc_add_flag (field_type, 1, "");
-+  tdesc_add_flag (field_type, 2, "PF");
-+  tdesc_add_flag (field_type, 4, "AF");
-+  tdesc_add_flag (field_type, 6, "ZF");
-+  tdesc_add_flag (field_type, 7, "SF");
-+  tdesc_add_flag (field_type, 8, "TF");
-+  tdesc_add_flag (field_type, 9, "IF");
-+  tdesc_add_flag (field_type, 10, "DF");
-+  tdesc_add_flag (field_type, 11, "OF");
-+  tdesc_add_flag (field_type, 14, "NT");
-+  tdesc_add_flag (field_type, 16, "RF");
-+  tdesc_add_flag (field_type, 17, "VM");
-+  tdesc_add_flag (field_type, 18, "AC");
-+  tdesc_add_flag (field_type, 19, "VIF");
-+  tdesc_add_flag (field_type, 20, "VIP");
-+  tdesc_add_flag (field_type, 21, "ID");
-+
-+  tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rdx", 3, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rsi", 4, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rdi", 5, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rbp", 6, 1, NULL, 64, "data_ptr");
-+  tdesc_create_reg (feature, "rsp", 7, 1, NULL, 64, "data_ptr");
-+  tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "int64");
-+  tdesc_create_reg (feature, "rip", 16, 1, NULL, 64, "code_ptr");
-+  tdesc_create_reg (feature, "eflags", 17, 1, NULL, 32, "i386_eflags");
-+  tdesc_create_reg (feature, "cs", 18, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ss", 19, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ds", 20, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "es", 21, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "fs", 22, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "gs", 23, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "st0", 24, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st1", 25, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st2", 26, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st3", 27, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st4", 28, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st5", 29, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st6", 30, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st7", 31, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "fctrl", 32, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fstat", 33, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "ftag", 34, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fiseg", 35, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fioff", 36, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "foseg", 37, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fooff", 38, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fop", 39, 1, "float", 32, "int");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse");
-+  field_type = tdesc_named_type (feature, "ieee_single");
-+  tdesc_create_vector (feature, "v4f", field_type, 4);
-+
-+  field_type = tdesc_named_type (feature, "ieee_double");
-+  tdesc_create_vector (feature, "v2d", field_type, 2);
-+
-+  field_type = tdesc_named_type (feature, "int8");
-+  tdesc_create_vector (feature, "v16i8", field_type, 16);
-+
-+  field_type = tdesc_named_type (feature, "int16");
-+  tdesc_create_vector (feature, "v8i16", field_type, 8);
-+
-+  field_type = tdesc_named_type (feature, "int32");
-+  tdesc_create_vector (feature, "v4i32", field_type, 4);
-+
-+  field_type = tdesc_named_type (feature, "int64");
-+  tdesc_create_vector (feature, "v2i64", field_type, 2);
-+
-+  type = tdesc_create_union (feature, "vec128");
-+  field_type = tdesc_named_type (feature, "v4f");
-+  tdesc_add_field (type, "v4_float", field_type);
-+  field_type = tdesc_named_type (feature, "v2d");
-+  tdesc_add_field (type, "v2_double", field_type);
-+  field_type = tdesc_named_type (feature, "v16i8");
-+  tdesc_add_field (type, "v16_int8", field_type);
-+  field_type = tdesc_named_type (feature, "v8i16");
-+  tdesc_add_field (type, "v8_int16", field_type);
-+  field_type = tdesc_named_type (feature, "v4i32");
-+  tdesc_add_field (type, "v4_int32", field_type);
-+  field_type = tdesc_named_type (feature, "v2i64");
-+  tdesc_add_field (type, "v2_int64", field_type);
-+  field_type = tdesc_named_type (feature, "uint128");
-+  tdesc_add_field (type, "uint128", field_type);
-+
-+  field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
-+  tdesc_add_flag (field_type, 0, "IE");
-+  tdesc_add_flag (field_type, 1, "DE");
-+  tdesc_add_flag (field_type, 2, "ZE");
-+  tdesc_add_flag (field_type, 3, "OE");
-+  tdesc_add_flag (field_type, 4, "UE");
-+  tdesc_add_flag (field_type, 5, "PE");
-+  tdesc_add_flag (field_type, 6, "DAZ");
-+  tdesc_add_flag (field_type, 7, "IM");
-+  tdesc_add_flag (field_type, 8, "DM");
-+  tdesc_add_flag (field_type, 9, "ZM");
-+  tdesc_add_flag (field_type, 10, "OM");
-+  tdesc_add_flag (field_type, 11, "UM");
-+  tdesc_add_flag (field_type, 12, "PM");
-+  tdesc_add_flag (field_type, 15, "FZ");
-+
-+  tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm3", 43, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm4", 44, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm5", 45, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm6", 46, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm7", 47, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm8", 48, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm9", 49, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm10", 50, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm11", 51, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm12", 52, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm13", 53, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm14", 54, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm15", 55, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "mxcsr", 56, 1, "vector", 32, "i386_mxcsr");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
-+  tdesc_create_reg (feature, "ymm0h", 57, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm1h", 58, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm2h", 59, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm3h", 60, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm4h", 61, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm5h", 62, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm6h", 63, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm7h", 64, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm8h", 65, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm9h", 66, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm10h", 67, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm11h", 68, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm12h", 69, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm13h", 70, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm14h", 71, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm15h", 72, 1, NULL, 128, "uint128");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
-+  type = tdesc_create_struct (feature, "br128");
-+  field_type = tdesc_named_type (feature, "uint64");
-+  tdesc_add_field (type, "lbound", field_type);
-+  field_type = tdesc_named_type (feature, "uint64");
-+  tdesc_add_field (type, "ubound_raw", field_type);
-+
-+  type = tdesc_create_struct (feature, "_bndstatus");
-+  tdesc_set_struct_size (type, 8);
-+  tdesc_add_bitfield (type, "bde", 2, 63);
-+  tdesc_add_bitfield (type, "error", 0, 1);
-+
-+  type = tdesc_create_union (feature, "status");
-+  field_type = tdesc_named_type (feature, "data_ptr");
-+  tdesc_add_field (type, "raw", field_type);
-+  field_type = tdesc_named_type (feature, "_bndstatus");
-+  tdesc_add_field (type, "status", field_type);
-+
-+  type = tdesc_create_struct (feature, "_bndcfgu");
-+  tdesc_set_struct_size (type, 8);
-+  tdesc_add_bitfield (type, "base", 12, 63);
-+  tdesc_add_bitfield (type, "reserved", 2, 11);
-+  tdesc_add_bitfield (type, "preserved", 1, 1);
-+  tdesc_add_bitfield (type, "enabled", 0, 0);
-+
-+  type = tdesc_create_union (feature, "cfgu");
-+  field_type = tdesc_named_type (feature, "data_ptr");
-+  tdesc_add_field (type, "raw", field_type);
-+  field_type = tdesc_named_type (feature, "_bndcfgu");
-+  tdesc_add_field (type, "config", field_type);
-+
-+  tdesc_create_reg (feature, "bnd0raw", 73, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd1raw", 74, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd2raw", 75, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd3raw", 76, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bndcfgu", 77, 1, NULL, 64, "cfgu");
-+  tdesc_create_reg (feature, "bndstatus", 78, 1, NULL, 64, "status");
-+
-+  tdesc_amd64_avx_mpx = result;
-+}
-diff --git a/gdb/features/i386/amd64-avx-mpx.xml b/gdb/features/i386/amd64-avx-mpx.xml
-new file mode 100644
-index 0000000..3eea6dd
---- /dev/null
-+++ b/gdb/features/i386/amd64-avx-mpx.xml
-@@ -0,0 +1,17 @@
-+<?xml version="1.0"?>
-+<!-- Copyright (C) 2013-2016 Free Software Foundation, Inc.
-+
-+     Copying and distribution of this file, with or without modification,
-+     are permitted in any medium without royalty provided the copyright
-+     notice and this notice are preserved.  -->
-+
-+<!-- AMD64 with AVX and MPX -->
-+
-+<!DOCTYPE target SYSTEM "gdb-target.dtd">
-+<target>
-+  <architecture>i386:x86-64</architecture>
-+  <xi:include href="64bit-core.xml"/>
-+  <xi:include href="64bit-sse.xml"/>
-+  <xi:include href="64bit-avx.xml"/>
-+  <xi:include href="64bit-mpx.xml"/>
-+</target>
-diff --git a/gdb/features/i386/amd64-mpx-linux.c b/gdb/features/i386/amd64-mpx-linux.c
-index 86a1774..5c1584b 100644
---- a/gdb/features/i386/amd64-mpx-linux.c
-+++ b/gdb/features/i386/amd64-mpx-linux.c
-@@ -151,24 +151,6 @@ initialize_tdesc_amd64_mpx_linux (void)
-   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
-   tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
-
--  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
--  tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
--
-   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
-   type = tdesc_create_struct (feature, "br128");
-   field_type = tdesc_named_type (feature, "uint64");
-@@ -200,12 +182,12 @@ initialize_tdesc_amd64_mpx_linux (void)
-   field_type = tdesc_named_type (feature, "_bndcfgu");
-   tdesc_add_field (type, "config", field_type);
-
--  tdesc_create_reg (feature, "bnd0raw", 74, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd1raw", 75, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd2raw", 76, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd3raw", 77, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bndcfgu", 78, 1, NULL, 64, "cfgu");
--  tdesc_create_reg (feature, "bndstatus", 79, 1, NULL, 64, "status");
-+  tdesc_create_reg (feature, "bnd0raw", 58, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd1raw", 59, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd2raw", 60, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd3raw", 61, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bndcfgu", 62, 1, NULL, 64, "cfgu");
-+  tdesc_create_reg (feature, "bndstatus", 63, 1, NULL, 64, "status");
-
-   tdesc_amd64_mpx_linux = result;
- }
-diff --git a/gdb/features/i386/amd64-mpx-linux.xml b/gdb/features/i386/amd64-mpx-linux.xml
-index 15e87b4..835126b 100644
---- a/gdb/features/i386/amd64-mpx-linux.xml
-+++ b/gdb/features/i386/amd64-mpx-linux.xml
-@@ -14,6 +14,5 @@
-   <xi:include href="64bit-core.xml"/>
-   <xi:include href="64bit-sse.xml"/>
-   <xi:include href="64bit-linux.xml"/>
--  <xi:include href="64bit-avx.xml"/>
-   <xi:include href="64bit-mpx.xml"/>
- </target>
-diff --git a/gdb/features/i386/amd64-mpx.c b/gdb/features/i386/amd64-mpx.c
-index 15ae5f7..4c852ef 100644
---- a/gdb/features/i386/amd64-mpx.c
-+++ b/gdb/features/i386/amd64-mpx.c
-@@ -146,24 +146,6 @@ initialize_tdesc_amd64_mpx (void)
-   tdesc_create_reg (feature, "xmm15", 55, 1, NULL, 128, "vec128");
-   tdesc_create_reg (feature, "mxcsr", 56, 1, "vector", 32, "i386_mxcsr");
-
--  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
--  tdesc_create_reg (feature, "ymm0h", 57, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm1h", 58, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm2h", 59, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm3h", 60, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm4h", 61, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm5h", 62, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm6h", 63, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm7h", 64, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm8h", 65, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm9h", 66, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm10h", 67, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm11h", 68, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm12h", 69, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm13h", 70, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm14h", 71, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm15h", 72, 1, NULL, 128, "uint128");
--
-   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
-   type = tdesc_create_struct (feature, "br128");
-   field_type = tdesc_named_type (feature, "uint64");
-@@ -195,12 +177,12 @@ initialize_tdesc_amd64_mpx (void)
-   field_type = tdesc_named_type (feature, "_bndcfgu");
-   tdesc_add_field (type, "config", field_type);
-
--  tdesc_create_reg (feature, "bnd0raw", 73, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd1raw", 74, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd2raw", 75, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd3raw", 76, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bndcfgu", 77, 1, NULL, 64, "cfgu");
--  tdesc_create_reg (feature, "bndstatus", 78, 1, NULL, 64, "status");
-+  tdesc_create_reg (feature, "bnd0raw", 57, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd1raw", 58, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd2raw", 59, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd3raw", 60, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bndcfgu", 61, 1, NULL, 64, "cfgu");
-+  tdesc_create_reg (feature, "bndstatus", 62, 1, NULL, 64, "status");
-
-   tdesc_amd64_mpx = result;
- }
-diff --git a/gdb/features/i386/amd64-mpx.xml b/gdb/features/i386/amd64-mpx.xml
-index 21b6df3..e458736 100644
---- a/gdb/features/i386/amd64-mpx.xml
-+++ b/gdb/features/i386/amd64-mpx.xml
-@@ -12,6 +12,5 @@
-   <architecture>i386:x86-64</architecture>
-   <xi:include href="64bit-core.xml"/>
-   <xi:include href="64bit-sse.xml"/>
--  <xi:include href="64bit-avx.xml"/>
-   <xi:include href="64bit-mpx.xml"/>
- </target>
-diff --git a/gdb/features/i386/i386-avx-mpx-linux.c b/gdb/features/i386/i386-avx-mpx-linux.c
-new file mode 100644
-index 0000000..dd75403
---- /dev/null
-+++ b/gdb/features/i386/i386-avx-mpx-linux.c
-@@ -0,0 +1,187 @@
-+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
-+  Original: i386-avx-mpx-linux.xml */
-+
-+#include "defs.h"
-+#include "osabi.h"
-+#include "target-descriptions.h"
-+
-+struct target_desc *tdesc_i386_avx_mpx_linux;
-+static void
-+initialize_tdesc_i386_avx_mpx_linux (void)
-+{
-+  struct target_desc *result = allocate_target_description ();
-+  struct tdesc_feature *feature;
-+  struct tdesc_type *field_type;
-+  struct tdesc_type *type;
-+
-+  set_tdesc_architecture (result, bfd_scan_arch ("i386"));
-+
-+  set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
-+  field_type = tdesc_create_flags (feature, "i386_eflags", 4);
-+  tdesc_add_flag (field_type, 0, "CF");
-+  tdesc_add_flag (field_type, 1, "");
-+  tdesc_add_flag (field_type, 2, "PF");
-+  tdesc_add_flag (field_type, 4, "AF");
-+  tdesc_add_flag (field_type, 6, "ZF");
-+  tdesc_add_flag (field_type, 7, "SF");
-+  tdesc_add_flag (field_type, 8, "TF");
-+  tdesc_add_flag (field_type, 9, "IF");
-+  tdesc_add_flag (field_type, 10, "DF");
-+  tdesc_add_flag (field_type, 11, "OF");
-+  tdesc_add_flag (field_type, 14, "NT");
-+  tdesc_add_flag (field_type, 16, "RF");
-+  tdesc_add_flag (field_type, 17, "VM");
-+  tdesc_add_flag (field_type, 18, "AC");
-+  tdesc_add_flag (field_type, 19, "VIF");
-+  tdesc_add_flag (field_type, 20, "VIP");
-+  tdesc_add_flag (field_type, 21, "ID");
-+
-+  tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ebx", 3, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "esp", 4, 1, NULL, 32, "data_ptr");
-+  tdesc_create_reg (feature, "ebp", 5, 1, NULL, 32, "data_ptr");
-+  tdesc_create_reg (feature, "esi", 6, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "edi", 7, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "eip", 8, 1, NULL, 32, "code_ptr");
-+  tdesc_create_reg (feature, "eflags", 9, 1, NULL, 32, "i386_eflags");
-+  tdesc_create_reg (feature, "cs", 10, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ss", 11, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ds", 12, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "es", 13, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "fs", 14, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "gs", 15, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "st0", 16, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st1", 17, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st2", 18, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st3", 19, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st4", 20, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st5", 21, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st6", 22, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st7", 23, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "fctrl", 24, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fstat", 25, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "ftag", 26, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fiseg", 27, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fioff", 28, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "foseg", 29, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fooff", 30, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fop", 31, 1, "float", 32, "int");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse");
-+  field_type = tdesc_named_type (feature, "ieee_single");
-+  tdesc_create_vector (feature, "v4f", field_type, 4);
-+
-+  field_type = tdesc_named_type (feature, "ieee_double");
-+  tdesc_create_vector (feature, "v2d", field_type, 2);
-+
-+  field_type = tdesc_named_type (feature, "int8");
-+  tdesc_create_vector (feature, "v16i8", field_type, 16);
-+
-+  field_type = tdesc_named_type (feature, "int16");
-+  tdesc_create_vector (feature, "v8i16", field_type, 8);
-+
-+  field_type = tdesc_named_type (feature, "int32");
-+  tdesc_create_vector (feature, "v4i32", field_type, 4);
-+
-+  field_type = tdesc_named_type (feature, "int64");
-+  tdesc_create_vector (feature, "v2i64", field_type, 2);
-+
-+  type = tdesc_create_union (feature, "vec128");
-+  field_type = tdesc_named_type (feature, "v4f");
-+  tdesc_add_field (type, "v4_float", field_type);
-+  field_type = tdesc_named_type (feature, "v2d");
-+  tdesc_add_field (type, "v2_double", field_type);
-+  field_type = tdesc_named_type (feature, "v16i8");
-+  tdesc_add_field (type, "v16_int8", field_type);
-+  field_type = tdesc_named_type (feature, "v8i16");
-+  tdesc_add_field (type, "v8_int16", field_type);
-+  field_type = tdesc_named_type (feature, "v4i32");
-+  tdesc_add_field (type, "v4_int32", field_type);
-+  field_type = tdesc_named_type (feature, "v2i64");
-+  tdesc_add_field (type, "v2_int64", field_type);
-+  field_type = tdesc_named_type (feature, "uint128");
-+  tdesc_add_field (type, "uint128", field_type);
-+
-+  field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
-+  tdesc_add_flag (field_type, 0, "IE");
-+  tdesc_add_flag (field_type, 1, "DE");
-+  tdesc_add_flag (field_type, 2, "ZE");
-+  tdesc_add_flag (field_type, 3, "OE");
-+  tdesc_add_flag (field_type, 4, "UE");
-+  tdesc_add_flag (field_type, 5, "PE");
-+  tdesc_add_flag (field_type, 6, "DAZ");
-+  tdesc_add_flag (field_type, 7, "IM");
-+  tdesc_add_flag (field_type, 8, "DM");
-+  tdesc_add_flag (field_type, 9, "ZM");
-+  tdesc_add_flag (field_type, 10, "OM");
-+  tdesc_add_flag (field_type, 11, "UM");
-+  tdesc_add_flag (field_type, 12, "PM");
-+  tdesc_add_flag (field_type, 15, "FZ");
-+
-+  tdesc_create_reg (feature, "xmm0", 32, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm1", 33, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm2", 34, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm3", 35, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm4", 36, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm5", 37, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm6", 38, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm7", 39, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "mxcsr", 40, 1, "vector", 32, "i386_mxcsr");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
-+  tdesc_create_reg (feature, "orig_eax", 41, 1, NULL, 32, "int");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
-+  tdesc_create_reg (feature, "ymm0h", 42, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm1h", 43, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm2h", 44, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm3h", 45, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm4h", 46, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm5h", 47, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm6h", 48, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm7h", 49, 1, NULL, 128, "uint128");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
-+  type = tdesc_create_struct (feature, "br128");
-+  field_type = tdesc_named_type (feature, "uint64");
-+  tdesc_add_field (type, "lbound", field_type);
-+  field_type = tdesc_named_type (feature, "uint64");
-+  tdesc_add_field (type, "ubound_raw", field_type);
-+
-+  type = tdesc_create_struct (feature, "_bndstatus");
-+  tdesc_set_struct_size (type, 8);
-+  tdesc_add_bitfield (type, "bde", 2, 31);
-+  tdesc_add_bitfield (type, "error", 0, 1);
-+
-+  type = tdesc_create_union (feature, "status");
-+  field_type = tdesc_named_type (feature, "data_ptr");
-+  tdesc_add_field (type, "raw", field_type);
-+  field_type = tdesc_named_type (feature, "_bndstatus");
-+  tdesc_add_field (type, "status", field_type);
-+
-+  type = tdesc_create_struct (feature, "_bndcfgu");
-+  tdesc_set_struct_size (type, 8);
-+  tdesc_add_bitfield (type, "base", 12, 31);
-+  tdesc_add_bitfield (type, "reserved", 2, 11);
-+  tdesc_add_bitfield (type, "preserved", 1, 1);
-+  tdesc_add_bitfield (type, "enabled", 0, 1);
-+
-+  type = tdesc_create_union (feature, "cfgu");
-+  field_type = tdesc_named_type (feature, "data_ptr");
-+  tdesc_add_field (type, "raw", field_type);
-+  field_type = tdesc_named_type (feature, "_bndcfgu");
-+  tdesc_add_field (type, "config", field_type);
-+
-+  tdesc_create_reg (feature, "bnd0raw", 50, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd1raw", 51, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd2raw", 52, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd3raw", 53, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bndcfgu", 54, 1, NULL, 64, "cfgu");
-+  tdesc_create_reg (feature, "bndstatus", 55, 1, NULL, 64, "status");
-+
-+  tdesc_i386_avx_mpx_linux = result;
-+}
-diff --git a/gdb/features/i386/i386-avx-mpx-linux.xml b/gdb/features/i386/i386-avx-mpx-linux.xml
-new file mode 100644
-index 0000000..c9a1a61
---- /dev/null
-+++ b/gdb/features/i386/i386-avx-mpx-linux.xml
-@@ -0,0 +1,19 @@
-+<?xml version="1.0"?>
-+<!-- Copyright (C) 2013-2016 Free Software Foundation, Inc.
-+
-+     Copying and distribution of this file, with or without modification,
-+     are permitted in any medium without royalty provided the copyright
-+     notice and this notice are preserved.  -->
-+
-+<!-- I386 with AVX and MPX- Includes Linux-only special "register".  -->
-+
-+<!DOCTYPE target SYSTEM "gdb-target.dtd">
-+<target>
-+  <architecture>i386</architecture>
-+  <osabi>GNU/Linux</osabi>
-+  <xi:include href="32bit-core.xml"/>
-+  <xi:include href="32bit-sse.xml"/>
-+  <xi:include href="32bit-linux.xml"/>
-+  <xi:include href="32bit-avx.xml"/>
-+  <xi:include href="32bit-mpx.xml"/>
-+</target>
-diff --git a/gdb/features/i386/i386-avx-mpx.c b/gdb/features/i386/i386-avx-mpx.c
-new file mode 100644
-index 0000000..f104e4b
---- /dev/null
-+++ b/gdb/features/i386/i386-avx-mpx.c
-@@ -0,0 +1,182 @@
-+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
-+  Original: i386-avx-mpx.xml */
-+
-+#include "defs.h"
-+#include "osabi.h"
-+#include "target-descriptions.h"
-+
-+struct target_desc *tdesc_i386_avx_mpx;
-+static void
-+initialize_tdesc_i386_avx_mpx (void)
-+{
-+  struct target_desc *result = allocate_target_description ();
-+  struct tdesc_feature *feature;
-+  struct tdesc_type *field_type;
-+  struct tdesc_type *type;
-+
-+  set_tdesc_architecture (result, bfd_scan_arch ("i386"));
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
-+  field_type = tdesc_create_flags (feature, "i386_eflags", 4);
-+  tdesc_add_flag (field_type, 0, "CF");
-+  tdesc_add_flag (field_type, 1, "");
-+  tdesc_add_flag (field_type, 2, "PF");
-+  tdesc_add_flag (field_type, 4, "AF");
-+  tdesc_add_flag (field_type, 6, "ZF");
-+  tdesc_add_flag (field_type, 7, "SF");
-+  tdesc_add_flag (field_type, 8, "TF");
-+  tdesc_add_flag (field_type, 9, "IF");
-+  tdesc_add_flag (field_type, 10, "DF");
-+  tdesc_add_flag (field_type, 11, "OF");
-+  tdesc_add_flag (field_type, 14, "NT");
-+  tdesc_add_flag (field_type, 16, "RF");
-+  tdesc_add_flag (field_type, 17, "VM");
-+  tdesc_add_flag (field_type, 18, "AC");
-+  tdesc_add_flag (field_type, 19, "VIF");
-+  tdesc_add_flag (field_type, 20, "VIP");
-+  tdesc_add_flag (field_type, 21, "ID");
-+
-+  tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ebx", 3, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "esp", 4, 1, NULL, 32, "data_ptr");
-+  tdesc_create_reg (feature, "ebp", 5, 1, NULL, 32, "data_ptr");
-+  tdesc_create_reg (feature, "esi", 6, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "edi", 7, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "eip", 8, 1, NULL, 32, "code_ptr");
-+  tdesc_create_reg (feature, "eflags", 9, 1, NULL, 32, "i386_eflags");
-+  tdesc_create_reg (feature, "cs", 10, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ss", 11, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "ds", 12, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "es", 13, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "fs", 14, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "gs", 15, 1, NULL, 32, "int32");
-+  tdesc_create_reg (feature, "st0", 16, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st1", 17, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st2", 18, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st3", 19, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st4", 20, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st5", 21, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st6", 22, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "st7", 23, 1, NULL, 80, "i387_ext");
-+  tdesc_create_reg (feature, "fctrl", 24, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fstat", 25, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "ftag", 26, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fiseg", 27, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fioff", 28, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "foseg", 29, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fooff", 30, 1, "float", 32, "int");
-+  tdesc_create_reg (feature, "fop", 31, 1, "float", 32, "int");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.sse");
-+  field_type = tdesc_named_type (feature, "ieee_single");
-+  tdesc_create_vector (feature, "v4f", field_type, 4);
-+
-+  field_type = tdesc_named_type (feature, "ieee_double");
-+  tdesc_create_vector (feature, "v2d", field_type, 2);
-+
-+  field_type = tdesc_named_type (feature, "int8");
-+  tdesc_create_vector (feature, "v16i8", field_type, 16);
-+
-+  field_type = tdesc_named_type (feature, "int16");
-+  tdesc_create_vector (feature, "v8i16", field_type, 8);
-+
-+  field_type = tdesc_named_type (feature, "int32");
-+  tdesc_create_vector (feature, "v4i32", field_type, 4);
-+
-+  field_type = tdesc_named_type (feature, "int64");
-+  tdesc_create_vector (feature, "v2i64", field_type, 2);
-+
-+  type = tdesc_create_union (feature, "vec128");
-+  field_type = tdesc_named_type (feature, "v4f");
-+  tdesc_add_field (type, "v4_float", field_type);
-+  field_type = tdesc_named_type (feature, "v2d");
-+  tdesc_add_field (type, "v2_double", field_type);
-+  field_type = tdesc_named_type (feature, "v16i8");
-+  tdesc_add_field (type, "v16_int8", field_type);
-+  field_type = tdesc_named_type (feature, "v8i16");
-+  tdesc_add_field (type, "v8_int16", field_type);
-+  field_type = tdesc_named_type (feature, "v4i32");
-+  tdesc_add_field (type, "v4_int32", field_type);
-+  field_type = tdesc_named_type (feature, "v2i64");
-+  tdesc_add_field (type, "v2_int64", field_type);
-+  field_type = tdesc_named_type (feature, "uint128");
-+  tdesc_add_field (type, "uint128", field_type);
-+
-+  field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
-+  tdesc_add_flag (field_type, 0, "IE");
-+  tdesc_add_flag (field_type, 1, "DE");
-+  tdesc_add_flag (field_type, 2, "ZE");
-+  tdesc_add_flag (field_type, 3, "OE");
-+  tdesc_add_flag (field_type, 4, "UE");
-+  tdesc_add_flag (field_type, 5, "PE");
-+  tdesc_add_flag (field_type, 6, "DAZ");
-+  tdesc_add_flag (field_type, 7, "IM");
-+  tdesc_add_flag (field_type, 8, "DM");
-+  tdesc_add_flag (field_type, 9, "ZM");
-+  tdesc_add_flag (field_type, 10, "OM");
-+  tdesc_add_flag (field_type, 11, "UM");
-+  tdesc_add_flag (field_type, 12, "PM");
-+  tdesc_add_flag (field_type, 15, "FZ");
-+
-+  tdesc_create_reg (feature, "xmm0", 32, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm1", 33, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm2", 34, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm3", 35, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm4", 36, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm5", 37, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm6", 38, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "xmm7", 39, 1, NULL, 128, "vec128");
-+  tdesc_create_reg (feature, "mxcsr", 40, 1, "vector", 32, "i386_mxcsr");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
-+  tdesc_create_reg (feature, "ymm0h", 41, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm1h", 42, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm2h", 43, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm3h", 44, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm4h", 45, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm5h", 46, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm6h", 47, 1, NULL, 128, "uint128");
-+  tdesc_create_reg (feature, "ymm7h", 48, 1, NULL, 128, "uint128");
-+
-+  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
-+  type = tdesc_create_struct (feature, "br128");
-+  field_type = tdesc_named_type (feature, "uint64");
-+  tdesc_add_field (type, "lbound", field_type);
-+  field_type = tdesc_named_type (feature, "uint64");
-+  tdesc_add_field (type, "ubound_raw", field_type);
-+
-+  type = tdesc_create_struct (feature, "_bndstatus");
-+  tdesc_set_struct_size (type, 8);
-+  tdesc_add_bitfield (type, "bde", 2, 31);
-+  tdesc_add_bitfield (type, "error", 0, 1);
-+
-+  type = tdesc_create_union (feature, "status");
-+  field_type = tdesc_named_type (feature, "data_ptr");
-+  tdesc_add_field (type, "raw", field_type);
-+  field_type = tdesc_named_type (feature, "_bndstatus");
-+  tdesc_add_field (type, "status", field_type);
-+
-+  type = tdesc_create_struct (feature, "_bndcfgu");
-+  tdesc_set_struct_size (type, 8);
-+  tdesc_add_bitfield (type, "base", 12, 31);
-+  tdesc_add_bitfield (type, "reserved", 2, 11);
-+  tdesc_add_bitfield (type, "preserved", 1, 1);
-+  tdesc_add_bitfield (type, "enabled", 0, 1);
-+
-+  type = tdesc_create_union (feature, "cfgu");
-+  field_type = tdesc_named_type (feature, "data_ptr");
-+  tdesc_add_field (type, "raw", field_type);
-+  field_type = tdesc_named_type (feature, "_bndcfgu");
-+  tdesc_add_field (type, "config", field_type);
-+
-+  tdesc_create_reg (feature, "bnd0raw", 49, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd1raw", 50, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd2raw", 51, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd3raw", 52, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bndcfgu", 53, 1, NULL, 64, "cfgu");
-+  tdesc_create_reg (feature, "bndstatus", 54, 1, NULL, 64, "status");
-+
-+  tdesc_i386_avx_mpx = result;
-+}
-diff --git a/gdb/features/i386/i386-avx-mpx.xml b/gdb/features/i386/i386-avx-mpx.xml
-new file mode 100644
-index 0000000..ab97367
---- /dev/null
-+++ b/gdb/features/i386/i386-avx-mpx.xml
-@@ -0,0 +1,17 @@
-+<?xml version="1.0"?>
-+<!-- Copyright (C) 2013-2016 Free Software Foundation, Inc.
-+
-+     Copying and distribution of this file, with or without modification,
-+     are permitted in any medium without royalty provided the copyright
-+     notice and this notice are preserved.  -->
-+
-+<!-- I386 with AVX and MPX -->
-+
-+<!DOCTYPE target SYSTEM "gdb-target.dtd">
-+<target>
-+  <architecture>i386</architecture>
-+  <xi:include href="32bit-core.xml"/>
-+  <xi:include href="32bit-sse.xml"/>
-+  <xi:include href="32bit-avx.xml"/>
-+  <xi:include href="32bit-mpx.xml"/>
-+</target>
-diff --git a/gdb/features/i386/i386-mpx-linux.c b/gdb/features/i386/i386-mpx-linux.c
-index dbf8789..c6bafea 100644
---- a/gdb/features/i386/i386-mpx-linux.c
-+++ b/gdb/features/i386/i386-mpx-linux.c
-@@ -135,16 +135,6 @@ initialize_tdesc_i386_mpx_linux (void)
-   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
-   tdesc_create_reg (feature, "orig_eax", 41, 1, NULL, 32, "int");
-
--  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
--  tdesc_create_reg (feature, "ymm0h", 42, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm1h", 43, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm2h", 44, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm3h", 45, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm4h", 46, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm5h", 47, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm6h", 48, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm7h", 49, 1, NULL, 128, "uint128");
--
-   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
-   type = tdesc_create_struct (feature, "br128");
-   field_type = tdesc_named_type (feature, "uint64");
-@@ -176,12 +166,12 @@ initialize_tdesc_i386_mpx_linux (void)
-   field_type = tdesc_named_type (feature, "_bndcfgu");
-   tdesc_add_field (type, "config", field_type);
-
--  tdesc_create_reg (feature, "bnd0raw", 50, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd1raw", 51, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd2raw", 52, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd3raw", 53, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bndcfgu", 54, 1, NULL, 64, "cfgu");
--  tdesc_create_reg (feature, "bndstatus", 55, 1, NULL, 64, "status");
-+  tdesc_create_reg (feature, "bnd0raw", 42, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd1raw", 43, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd2raw", 44, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd3raw", 45, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bndcfgu", 46, 1, NULL, 64, "cfgu");
-+  tdesc_create_reg (feature, "bndstatus", 47, 1, NULL, 64, "status");
-
-   tdesc_i386_mpx_linux = result;
- }
-diff --git a/gdb/features/i386/i386-mpx-linux.xml b/gdb/features/i386/i386-mpx-linux.xml
-index c4004d6..4228cf5 100644
---- a/gdb/features/i386/i386-mpx-linux.xml
-+++ b/gdb/features/i386/i386-mpx-linux.xml
-@@ -14,6 +14,5 @@
-   <xi:include href="32bit-core.xml"/>
-   <xi:include href="32bit-sse.xml"/>
-   <xi:include href="32bit-linux.xml"/>
--  <xi:include href="32bit-avx.xml"/>
-   <xi:include href="32bit-mpx.xml"/>
- </target>
-diff --git a/gdb/features/i386/i386-mpx.c b/gdb/features/i386/i386-mpx.c
-index 1e04afd..430db3f 100644
---- a/gdb/features/i386/i386-mpx.c
-+++ b/gdb/features/i386/i386-mpx.c
-@@ -130,16 +130,6 @@ initialize_tdesc_i386_mpx (void)
-   tdesc_create_reg (feature, "xmm7", 39, 1, NULL, 128, "vec128");
-   tdesc_create_reg (feature, "mxcsr", 40, 1, "vector", 32, "i386_mxcsr");
-
--  feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
--  tdesc_create_reg (feature, "ymm0h", 41, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm1h", 42, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm2h", 43, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm3h", 44, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm4h", 45, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm5h", 46, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm6h", 47, 1, NULL, 128, "uint128");
--  tdesc_create_reg (feature, "ymm7h", 48, 1, NULL, 128, "uint128");
--
-   feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
-   type = tdesc_create_struct (feature, "br128");
-   field_type = tdesc_named_type (feature, "uint64");
-@@ -171,12 +161,12 @@ initialize_tdesc_i386_mpx (void)
-   field_type = tdesc_named_type (feature, "_bndcfgu");
-   tdesc_add_field (type, "config", field_type);
-
--  tdesc_create_reg (feature, "bnd0raw", 49, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd1raw", 50, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd2raw", 51, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bnd3raw", 52, 1, NULL, 128, "br128");
--  tdesc_create_reg (feature, "bndcfgu", 53, 1, NULL, 64, "cfgu");
--  tdesc_create_reg (feature, "bndstatus", 54, 1, NULL, 64, "status");
-+  tdesc_create_reg (feature, "bnd0raw", 41, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd1raw", 42, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd2raw", 43, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bnd3raw", 44, 1, NULL, 128, "br128");
-+  tdesc_create_reg (feature, "bndcfgu", 45, 1, NULL, 64, "cfgu");
-+  tdesc_create_reg (feature, "bndstatus", 46, 1, NULL, 64, "status");
-
-   tdesc_i386_mpx = result;
- }
-diff --git a/gdb/features/i386/i386-mpx.xml b/gdb/features/i386/i386-mpx.xml
-index 52a68db..c1806cb 100644
---- a/gdb/features/i386/i386-mpx.xml
-+++ b/gdb/features/i386/i386-mpx.xml
-@@ -12,6 +12,5 @@
-   <architecture>i386</architecture>
-   <xi:include href="32bit-core.xml"/>
-   <xi:include href="32bit-sse.xml"/>
--  <xi:include href="32bit-avx.xml"/>
-   <xi:include href="32bit-mpx.xml"/>
- </target>
-diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
-index 1e874e3..dee2ea1 100644
---- a/gdb/gdbserver/Makefile.in
-+++ b/gdb/gdbserver/Makefile.in
-@@ -376,9 +376,11 @@ clean:
- 	rm -f xml-builtin.c stamp-xml
- 	rm -f i386-avx.c i386-avx-linux.c
- 	rm -f i386-mpx.c i386-mpx-linux.c
-+	rm -f i386-avx-mpx.c i386-avx-mpx-linux.c
- 	rm -f i386-avx512.c i386-avx512-linux.c
- 	rm -f amd64-avx.c amd64-avx-linux.c
- 	rm -f amd64-mpx.c amd64-mpx-linux.c
-+	rm -f amd64-avx-mpx.c amd64-avx-mpx-linux.c
- 	rm -f amd64-avx512.c amd64-avx512-linux.c
- 	rm -f i386-mmx.c i386-mmx-linux.c
- 	rm -f x32.c x32-linux.c
-@@ -495,6 +497,21 @@ regcache-ipa.o: regcache.c
- i386-linux-ipa.o: i386-linux.c
- 	$(IPAGENT_COMPILE) $<
- 	$(POSTCOMPILE)
-+i386-mmx-linux-ipa.o: i386-mmx-linux.c
-+	$(IPAGENT_COMPILE) $<
-+	$(POSTCOMPILE)
-+i386-avx-linux-ipa.o: i386-avx-linux.c
-+	$(IPAGENT_COMPILE) $<
-+	$(POSTCOMPILE)
-+i386-mpx-linux-ipa.o: i386-mpx-linux.c
-+	$(IPAGENT_COMPILE) $<
-+	$(POSTCOMPILE)
-+i386-avx-mpx-linux-ipa.o: i386-avx-mpx-linux.c
-+	$(IPAGENT_COMPILE) $<
-+	$(POSTCOMPILE)
-+i386-avx512-linux-ipa.o: i386-avx512-linux.c
-+	$(IPAGENT_COMPILE) $<
-+	$(POSTCOMPILE)
- linux-i386-ipa.o: linux-i386-ipa.c
- 	$(IPAGENT_COMPILE) $<
- 	$(POSTCOMPILE)
-@@ -504,6 +521,18 @@ linux-amd64-ipa.o: linux-amd64-ipa.c
- amd64-linux-ipa.o: amd64-linux.c
- 	$(IPAGENT_COMPILE) $<
- 	$(POSTCOMPILE)
-+amd64-avx-linux-ipa.o: amd64-avx-linux.c
-+	$(IPAGENT_COMPILE) $<
-+	$(POSTCOMPILE)
-+amd64-mpx-linux-ipa.o: amd64-mpx-linux.c
-+	$(IPAGENT_COMPILE) $<
-+	$(POSTCOMPILE)
-+amd64-avx-mpx-linux-ipa.o: amd64-avx-mpx-linux.c
-+	$(IPAGENT_COMPILE) $<
-+	$(POSTCOMPILE)
-+amd64-avx512-linux-ipa.o: amd64-avx512-linux.c
-+	$(IPAGENT_COMPILE) $<
-+	$(POSTCOMPILE)
- linux-aarch64-ipa.o: linux-aarch64-ipa.c
- 	$(IPAGENT_COMPILE) $<
- 	$(POSTCOMPILE)
-@@ -694,6 +723,10 @@ i386-mpx.c : $(srcdir)/../regformats/i386/i386-mpx.dat $(regdat_sh)
- 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-mpx.dat i386-mpx.c
- i386-mpx-linux.c : $(srcdir)/../regformats/i386/i386-mpx-linux.dat $(regdat_sh)
- 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-mpx-linux.dat i386-mpx-linux.c
-+i386-avx-mpx.c : $(srcdir)/../regformats/i386/i386-avx-mpx.dat $(regdat_sh)
-+	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-avx-mpx.dat i386-avx-mpx.c
-+i386-avx-mpx-linux.c : $(srcdir)/../regformats/i386/i386-avx-mpx-linux.dat $(regdat_sh)
-+	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-avx-mpx-linux.dat i386-avx-mpx-linux.c
- i386-mmx.c : $(srcdir)/../regformats/i386/i386-mmx.dat $(regdat_sh)
- 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-mmx.dat i386-mmx.c
- i386-mmx-linux.c : $(srcdir)/../regformats/i386/i386-mmx-linux.dat $(regdat_sh)
-@@ -808,6 +841,10 @@ amd64-mpx.c : $(srcdir)/../regformats/i386/amd64-mpx.dat $(regdat_sh)
- 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/amd64-mpx.dat amd64-mpx.c
- amd64-mpx-linux.c : $(srcdir)/../regformats/i386/amd64-mpx-linux.dat $(regdat_sh)
- 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/amd64-mpx-linux.dat amd64-mpx-linux.c
-+amd64-avx-mpx.c : $(srcdir)/../regformats/i386/amd64-avx-mpx.dat $(regdat_sh)
-+	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/amd64-avx-mpx.dat amd64-avx-mpx.c
-+amd64-avx-mpx-linux.c : $(srcdir)/../regformats/i386/amd64-avx-mpx-linux.dat $(regdat_sh)
-+	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/amd64-avx-mpx-linux.dat amd64-avx-mpx-linux.c
- x32.c : $(srcdir)/../regformats/i386/x32.dat $(regdat_sh)
- 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/x32.dat x32.c
- x32-linux.c : $(srcdir)/../regformats/i386/x32-linux.dat $(regdat_sh)
-diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
-index a54b9e7..4935a36 100644
---- a/gdb/gdbserver/configure.srv
-+++ b/gdb/gdbserver/configure.srv
-@@ -24,20 +24,23 @@
- # Default hostio_last_error implementation
- srv_hostio_err_objs="hostio-errno.o"
-
--srv_i386_regobj="i386.o i386-avx.o i386-avx512.o i386-mpx.o i386-mmx.o"
--srv_i386_linux_regobj="i386-linux.o i386-avx-linux.o i386-avx512-linux.o i386-mpx-linux.o i386-mmx-linux.o"
--srv_amd64_regobj="amd64.o amd64-avx.o amd64-avx512.o amd64-mpx.o x32.o x32-avx.o x32-avx512.o"
--srv_amd64_linux_regobj="amd64-linux.o amd64-avx-linux.o amd64-avx512-linux.o amd64-mpx-linux.o x32-linux.o x32-avx-linux.o x32-avx512-linux.o"
-+srv_i386_regobj="i386.o i386-avx.o i386-avx512.o i386-mpx.o i386-avx-mpx.o i386-mmx.o"
-+srv_i386_linux_regobj="i386-linux.o i386-avx-linux.o i386-avx512-linux.o i386-mpx-linux.o i386-avx-mpx-linux.o i386-mmx-linux.o"
-+srv_amd64_regobj="amd64.o amd64-avx.o amd64-avx512.o amd64-mpx.o amd64-avx-mpx.o x32.o x32-avx.o x32-avx512.o"
-+srv_amd64_linux_regobj="amd64-linux.o amd64-avx-linux.o amd64-avx512-linux.o amd64-mpx-linux.o amd64-avx-mpx-linux.o x32-linux.o x32-avx-linux.o x32-avx512-linux.o"
-+
-+
-+ipa_i386_linux_regobj="i386-linux-ipa.o i386-avx-linux-ipa.o  i386-avx-mpx-linux-ipa.o i386-avx512-linux-ipa.o i386-mpx-linux-ipa.o i386-mmx-linux-ipa.o"
-+ipa_amd64_linux_regobj="amd64-linux-ipa.o amd64-avx-linux-ipa.o amd64-avx-mpx-linux-ipa.o amd64-avx512-linux-ipa.o amd64-mpx-linux-ipa.o"
-
--ipa_i386_linux_regobj=i386-linux-ipa.o
--ipa_amd64_linux_regobj=amd64-linux-ipa.o
-
- srv_i386_32bit_xmlfiles="i386/32bit-core.xml i386/32bit-sse.xml i386/32bit-avx.xml i386/32bit-avx512.xml i386/32bit-mpx.xml"
- srv_i386_64bit_xmlfiles="i386/64bit-core.xml i386/64bit-sse.xml i386/64bit-avx.xml i386/64bit-avx512.xml i386/x32-core.xml i386/64bit-mpx.xml"
--srv_i386_xmlfiles="i386/i386.xml i386/i386-avx.xml i386/i386-avx512.xml i386/i386-mpx.xml i386/i386-mmx.xml $srv_i386_32bit_xmlfiles"
--srv_amd64_xmlfiles="i386/amd64.xml i386/amd64-avx.xml i386/amd64-avx512.xml i386/x32.xml i386/x32-avx.xml i386/x32-avx512.xml i386/amd64-mpx.xml $srv_i386_64bit_xmlfiles"
--srv_i386_linux_xmlfiles="i386/i386-linux.xml i386/i386-avx-linux.xml i386/i386-avx512-linux.xml i386/i386-mmx-linux.xml i386/32bit-linux.xml i386/i386-mpx-linux.xml $srv_i386_32bit_xmlfiles"
--srv_amd64_linux_xmlfiles="i386/amd64-linux.xml i386/amd64-avx-linux.xml i386/amd64-avx512-linux.xml i386/64bit-linux.xml i386/amd64-mpx-linux.xml i386/x32-linux.xml i386/x32-avx-linux.xml i386/x32-avx512-linux.xml $srv_i386_64bit_xmlfiles"
-+srv_i386_xmlfiles="i386/i386.xml i386/i386-avx.xml i386/i386-avx512.xml i386/i386-mpx.xml i386/i386-avx-mpx.xml i386/i386-mmx.xml $srv_i386_32bit_xmlfiles"
-+srv_amd64_xmlfiles="i386/amd64.xml i386/amd64-avx.xml i386/amd64-avx512.xml i386/x32.xml i386/x32-avx.xml i386/x32-avx512.xml i386/amd64-mpx.xml i386/amd64-avx-mpx.xml  $srv_i386_64bit_xmlfiles"
-+srv_i386_linux_xmlfiles="i386/i386-linux.xml i386/i386-avx-linux.xml i386/i386-avx512-linux.xml i386/i386-mmx-linux.xml i386/32bit-linux.xml i386/i386-mpx-linux.xml i386/i386-avx-mpx-linux.xml $srv_i386_32bit_xmlfiles"
-+srv_amd64_linux_xmlfiles="i386/amd64-linux.xml i386/amd64-avx-linux.xml i386/amd64-avx512-linux.xml i386/64bit-linux.xml i386/amd64-mpx-linux.xml i386/amd64-avx-mpx-linux.xml i386/x32-linux.xml i386/x32-avx-linux.xml i386/x32-avx512-linux.xml $srv_i386_64bit_xmlfiles"
-+
-
-
- # Linux object files.  This is so we don't have to repeat
-diff --git a/gdb/gdbserver/linux-aarch64-ipa.c b/gdb/gdbserver/linux-aarch64-ipa.c
-index 758708d..f1eaa70 100644
---- a/gdb/gdbserver/linux-aarch64-ipa.c
-+++ b/gdb/gdbserver/linux-aarch64-ipa.c
-@@ -143,9 +143,18 @@ gdb_agent_get_raw_reg (const unsigned char *raw_regs, int regnum)
- 			+ aarch64_ft_collect_regmap[regnum] * FT_CR_SIZE);
- }
-
-+/* Return target_desc to use for IPA, given the tdesc index passed by
-+   gdbserver.  Index is ignored, since we have only one tdesc
-+   at the moment.  */
-+
-+const struct target_desc *
-+get_ipa_tdesc (int idx)
-+{
-+  return tdesc_aarch64;
-+}
-+
- void
- initialize_low_tracepoint (void)
- {
-   init_registers_aarch64 ();
--  ipa_tdesc = tdesc_aarch64;
- }
-diff --git a/gdb/gdbserver/linux-amd64-ipa.c b/gdb/gdbserver/linux-amd64-ipa.c
-index 2eeedcd..f9c72a0 100644
---- a/gdb/gdbserver/linux-amd64-ipa.c
-+++ b/gdb/gdbserver/linux-amd64-ipa.c
-@@ -20,6 +20,7 @@
-
- #include "server.h"
- #include "tracepoint.h"
-+#include "linux-x86-tdesc.h"
-
- /* Defined in auto-generated file amd64-linux.c.  */
- void init_registers_amd64_linux (void);
-@@ -166,9 +167,37 @@ supply_static_tracepoint_registers (struct regcache *regcache,
-
- #endif /* HAVE_UST */
-
-+/* Return target_desc to use for IPA, given the tdesc index passed by
-+   gdbserver.  */
-+
-+const struct target_desc *
-+get_ipa_tdesc (int idx)
-+{
-+  switch (idx)
-+    {
-+    case X86_TDESC_SSE:
-+      return tdesc_amd64_linux;
-+    case X86_TDESC_AVX:
-+      return tdesc_amd64_avx_linux;
-+    case X86_TDESC_MPX:
-+      return tdesc_amd64_mpx_linux;
-+    case X86_TDESC_AVX_MPX:
-+      return tdesc_amd64_avx_mpx_linux;
-+    case X86_TDESC_AVX512:
-+      return tdesc_amd64_avx512_linux;
-+    default:
-+      internal_error (__FILE__, __LINE__,
-+		      "unknown ipa tdesc index: %d", idx);
-+      return tdesc_amd64_linux;
-+    }
-+}
-+
- void
- initialize_low_tracepoint (void)
- {
-   init_registers_amd64_linux ();
--  ipa_tdesc = tdesc_amd64_linux;
-+  init_registers_amd64_avx_linux ();
-+  init_registers_amd64_avx_mpx_linux ();
-+  init_registers_amd64_mpx_linux ();
-+  init_registers_amd64_avx512_linux ();
- }
-diff --git a/gdb/gdbserver/linux-i386-ipa.c b/gdb/gdbserver/linux-i386-ipa.c
-index 11dc038..d7a8e7d 100644
---- a/gdb/gdbserver/linux-i386-ipa.c
-+++ b/gdb/gdbserver/linux-i386-ipa.c
-@@ -21,6 +21,7 @@
- #include "server.h"
- #include <sys/mman.h>
- #include "tracepoint.h"
-+#include "linux-x86-tdesc.h"
-
- /* GDB register numbers.  */
-
-@@ -47,10 +48,6 @@ enum i386_gdb_regnum
-
- #define i386_num_regs 16
-
--/* Defined in auto-generated file i386-linux.c.  */
--void init_registers_i386_linux (void);
--extern const struct target_desc *tdesc_i386_linux;
--
- #define FT_CR_EAX 15
- #define FT_CR_ECX 14
- #define FT_CR_EDX 13
-@@ -247,10 +244,40 @@ initialize_fast_tracepoint_trampoline_buffer (void)
-     }
- }
-
-+/* Return target_desc to use for IPA, given the tdesc index passed by
-+   gdbserver.  */
-+
-+const struct target_desc *
-+get_ipa_tdesc (int idx)
-+{
-+  switch (idx)
-+    {
-+    case X86_TDESC_MMX:
-+      return tdesc_i386_mmx_linux;
-+    case X86_TDESC_SSE:
-+      return tdesc_i386_linux;
-+    case X86_TDESC_AVX:
-+      return tdesc_i386_avx_linux;
-+    case X86_TDESC_MPX:
-+      return tdesc_i386_mpx_linux;
-+    case X86_TDESC_AVX_MPX:
-+      return tdesc_i386_avx_mpx_linux;
-+    case X86_TDESC_AVX512:
-+      return tdesc_i386_avx512_linux;
-+    default:
-+      internal_error (__FILE__, __LINE__,
-+		      "unknown ipa tdesc index: %d", idx);
-+      return tdesc_i386_linux;
-+    }
-+}
-+
- void
- initialize_low_tracepoint (void)
- {
-+  init_registers_i386_mmx_linux ();
-   init_registers_i386_linux ();
--  ipa_tdesc = tdesc_i386_linux;
-+  init_registers_i386_avx_linux ();
-+  init_registers_i386_mpx_linux ();
-+  init_registers_i386_avx512_linux ();
-   initialize_fast_tracepoint_trampoline_buffer ();
- }
-diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
-index 8b025bd..a142c2c 100644
---- a/gdb/gdbserver/linux-low.c
-+++ b/gdb/gdbserver/linux-low.c
-@@ -6432,6 +6432,15 @@ linux_supports_catch_syscall (void)
- }
-
- static int
-+linux_get_ipa_tdesc_idx (void)
-+{
-+  if (the_low_target.get_ipa_tdesc_idx == NULL)
-+    return 0;
-+
-+  return (*the_low_target.get_ipa_tdesc_idx) ();
-+}
-+
-+static int
- linux_supports_tracepoints (void)
- {
-   if (*the_low_target.supports_tracepoints == NULL)
-@@ -7408,6 +7417,7 @@ static struct target_ops linux_target_ops = {
-   linux_breakpoint_kind_from_current_state,
-   linux_supports_software_single_step,
-   linux_supports_catch_syscall,
-+  linux_get_ipa_tdesc_idx,
- };
-
- #ifdef HAVE_LINUX_REGSETS
-diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
-index 4ec8550..d4946c1 100644
---- a/gdb/gdbserver/linux-low.h
-+++ b/gdb/gdbserver/linux-low.h
-@@ -246,6 +246,9 @@ struct linux_target_ops
-      due to SYSCALL_SIGTRAP.  */
-   void (*get_syscall_trapinfo) (struct regcache *regcache,
- 				int *sysno, int *sysret);
-+
-+  /* See target.h.  */
-+  int (*get_ipa_tdesc_idx) (void);
- };
-
- extern struct linux_target_ops the_low_target;
-diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
-index 0c4954a..2535959 100644
---- a/gdb/gdbserver/linux-x86-low.c
-+++ b/gdb/gdbserver/linux-x86-low.c
-@@ -45,57 +45,7 @@
- #include "nat/linux-nat.h"
- #include "nat/x86-linux.h"
- #include "nat/x86-linux-dregs.h"
--
--#ifdef __x86_64__
--/* Defined in auto-generated file amd64-linux.c.  */
--void init_registers_amd64_linux (void);
--extern const struct target_desc *tdesc_amd64_linux;
--
--/* Defined in auto-generated file amd64-avx-linux.c.  */
--void init_registers_amd64_avx_linux (void);
--extern const struct target_desc *tdesc_amd64_avx_linux;
--
--/* Defined in auto-generated file amd64-avx512-linux.c.  */
--void init_registers_amd64_avx512_linux (void);
--extern const struct target_desc *tdesc_amd64_avx512_linux;
--
--/* Defined in auto-generated file amd64-mpx-linux.c.  */
--void init_registers_amd64_mpx_linux (void);
--extern const struct target_desc *tdesc_amd64_mpx_linux;
--
--/* Defined in auto-generated file x32-linux.c.  */
--void init_registers_x32_linux (void);
--extern const struct target_desc *tdesc_x32_linux;
--
--/* Defined in auto-generated file x32-avx-linux.c.  */
--void init_registers_x32_avx_linux (void);
--extern const struct target_desc *tdesc_x32_avx_linux;
--
--/* Defined in auto-generated file x32-avx512-linux.c.  */
--void init_registers_x32_avx512_linux (void);
--extern const struct target_desc *tdesc_x32_avx512_linux;
--
--#endif
--
--/* Defined in auto-generated file i386-linux.c.  */
--void init_registers_i386_linux (void);
--extern const struct target_desc *tdesc_i386_linux;
--
--/* Defined in auto-generated file i386-mmx-linux.c.  */
--void init_registers_i386_mmx_linux (void);
--extern const struct target_desc *tdesc_i386_mmx_linux;
--
--/* Defined in auto-generated file i386-avx-linux.c.  */
--void init_registers_i386_avx_linux (void);
--extern const struct target_desc *tdesc_i386_avx_linux;
--
--/* Defined in auto-generated file i386-avx512-linux.c.  */
--void init_registers_i386_avx512_linux (void);
--extern const struct target_desc *tdesc_i386_avx512_linux;
--
--/* Defined in auto-generated file i386-mpx-linux.c.  */
--void init_registers_i386_mpx_linux (void);
--extern const struct target_desc *tdesc_i386_mpx_linux;
-+#include "linux-x86-tdesc.h"
-
- #ifdef __x86_64__
- static struct target_desc *tdesc_amd64_linux_no_xml;
-@@ -839,6 +789,9 @@ x86_linux_read_description (void)
- 		case X86_XSTATE_AVX512_MASK:
- 		  return tdesc_amd64_avx512_linux;
-
-+		case X86_XSTATE_AVX_MPX_MASK:
-+		  return tdesc_amd64_avx_mpx_linux;
-+
- 		case X86_XSTATE_MPX_MASK:
- 		  return tdesc_amd64_mpx_linux;
-
-@@ -886,6 +839,9 @@ x86_linux_read_description (void)
- 	    case (X86_XSTATE_MPX_MASK):
- 	      return tdesc_i386_mpx_linux;
-
-+	    case (X86_XSTATE_AVX_MPX_MASK):
-+	      return tdesc_i386_avx_mpx_linux;
-+
- 	    case (X86_XSTATE_AVX_MASK):
- 	      return tdesc_i386_avx_linux;
-
-@@ -2891,6 +2847,42 @@ x86_supports_hardware_single_step (void)
-   return 1;
- }
-
-+static int
-+x86_get_ipa_tdesc_idx (void)
-+{
-+  struct regcache *regcache = get_thread_regcache (current_thread, 0);
-+  const struct target_desc *tdesc = regcache->tdesc;
-+
-+#ifdef __x86_64__
-+  if (tdesc == tdesc_amd64_linux || tdesc == tdesc_amd64_linux_no_xml
-+      || tdesc == tdesc_x32_linux)
-+    return X86_TDESC_SSE;
-+  if (tdesc == tdesc_amd64_avx_linux || tdesc == tdesc_x32_avx_linux)
-+    return X86_TDESC_AVX;
-+  if (tdesc == tdesc_amd64_mpx_linux)
-+    return X86_TDESC_MPX;
-+  if (tdesc == tdesc_amd64_avx_mpx_linux)
-+    return X86_TDESC_AVX_MPX;
-+  if (tdesc == tdesc_amd64_avx512_linux || tdesc == tdesc_x32_avx512_linux)
-+    return X86_TDESC_AVX512;
-+#endif
-+
-+  if (tdesc == tdesc_i386_mmx_linux)
-+    return X86_TDESC_MMX;
-+  if (tdesc == tdesc_i386_linux || tdesc == tdesc_i386_linux_no_xml)
-+    return X86_TDESC_SSE;
-+  if (tdesc == tdesc_i386_avx_linux)
-+    return X86_TDESC_AVX;
-+  if (tdesc == tdesc_i386_mpx_linux)
-+    return X86_TDESC_MPX;
-+  if (tdesc == tdesc_i386_avx_mpx_linux)
-+    return X86_TDESC_AVX_MPX;
-+  if (tdesc == tdesc_i386_avx512_linux)
-+    return X86_TDESC_AVX512;
-+
-+  return 0;
-+}
-+
- /* This is initialized assuming an amd64 target.
-    x86_arch_setup will correct it for i386 or amd64 targets.  */
-
-@@ -2934,6 +2926,7 @@ struct linux_target_ops the_low_target =
-   NULL, /* breakpoint_kind_from_current_state */
-   x86_supports_hardware_single_step,
-   x86_get_syscall_trapinfo,
-+  x86_get_ipa_tdesc_idx,
- };
-
- void
-@@ -2945,6 +2938,7 @@ initialize_low_arch (void)
-   init_registers_amd64_avx_linux ();
-   init_registers_amd64_avx512_linux ();
-   init_registers_amd64_mpx_linux ();
-+  init_registers_amd64_avx_mpx_linux ();
-
-   init_registers_x32_linux ();
-   init_registers_x32_avx_linux ();
-@@ -2959,6 +2953,7 @@ initialize_low_arch (void)
-   init_registers_i386_avx_linux ();
-   init_registers_i386_avx512_linux ();
-   init_registers_i386_mpx_linux ();
-+  init_registers_i386_avx_mpx_linux ();
-
-   tdesc_i386_linux_no_xml = XNEW (struct target_desc);
-   copy_target_description (tdesc_i386_linux_no_xml, tdesc_i386_linux);
-diff --git a/gdb/gdbserver/linux-x86-tdesc.h b/gdb/gdbserver/linux-x86-tdesc.h
-new file mode 100644
-index 0000000..720f50c
---- /dev/null
-+++ b/gdb/gdbserver/linux-x86-tdesc.h
-@@ -0,0 +1,98 @@
-+/* Low level support for x86 (i386 and x86-64), shared between gdbserver
-+   and IPA.
-+
-+   Copyright (C) 2016 Free Software Foundation, Inc.
-+
-+   This file is part of GDB.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+/* Note: since IPA obviously knows what ABI it's running on (i386 vs x86_64
-+   vs x32), it's sufficient to pass only the register set here.  This,
-+   together with the ABI known at IPA compile time, maps to a tdesc.  */
-+
-+enum x86_linux_tdesc {
-+  X86_TDESC_MMX = 0,
-+  X86_TDESC_SSE = 1,
-+  X86_TDESC_AVX = 2,
-+  X86_TDESC_MPX = 3,
-+  X86_TDESC_AVX_MPX = 4,
-+  X86_TDESC_AVX512 = 5,
-+};
-+
-+#ifdef __x86_64__
-+
-+#if defined __LP64__  || !defined IN_PROCESS_AGENT
-+/* Defined in auto-generated file amd64-linux.c.  */
-+void init_registers_amd64_linux (void);
-+extern const struct target_desc *tdesc_amd64_linux;
-+
-+/* Defined in auto-generated file amd64-avx-linux.c.  */
-+void init_registers_amd64_avx_linux (void);
-+extern const struct target_desc *tdesc_amd64_avx_linux;
-+
-+/* Defined in auto-generated file amd64-avx512-linux.c.  */
-+void init_registers_amd64_avx512_linux (void);
-+extern const struct target_desc *tdesc_amd64_avx512_linux;
-+
-+/* Defined in auto-generated file amd64-avx-mpx-linux.c.  */
-+void init_registers_amd64_avx_mpx_linux (void);
-+extern const struct target_desc *tdesc_amd64_avx_mpx_linux;
-+
-+/* Defined in auto-generated file amd64-mpx-linux.c.  */
-+void init_registers_amd64_mpx_linux (void);
-+extern const struct target_desc *tdesc_amd64_mpx_linux;
-+#endif
-+
-+#if defined __ILP32__ || !defined IN_PROCESS_AGENT
-+/* Defined in auto-generated file x32-linux.c.  */
-+void init_registers_x32_linux (void);
-+extern const struct target_desc *tdesc_x32_linux;
-+
-+/* Defined in auto-generated file x32-avx-linux.c.  */
-+void init_registers_x32_avx_linux (void);
-+extern const struct target_desc *tdesc_x32_avx_linux;
-+
-+/* Defined in auto-generated file x32-avx512-linux.c.  */
-+void init_registers_x32_avx512_linux (void);
-+extern const struct target_desc *tdesc_x32_avx512_linux;
-+#endif
-+
-+#endif
-+
-+#if defined __i386__ || !defined IN_PROCESS_AGENT
-+/* Defined in auto-generated file i386-linux.c.  */
-+void init_registers_i386_linux (void);
-+extern const struct target_desc *tdesc_i386_linux;
-+
-+/* Defined in auto-generated file i386-mmx-linux.c.  */
-+void init_registers_i386_mmx_linux (void);
-+extern const struct target_desc *tdesc_i386_mmx_linux;
-+
-+/* Defined in auto-generated file i386-avx-linux.c.  */
-+void init_registers_i386_avx_linux (void);
-+extern const struct target_desc *tdesc_i386_avx_linux;
-+
-+/* Defined in auto-generated file i386-avx-mpx-linux.c.  */
-+void init_registers_i386_avx_mpx_linux (void);
-+extern const struct target_desc *tdesc_i386_avx_mpx_linux;
-+
-+/* Defined in auto-generated file i386-avx512-linux.c.  */
-+void init_registers_i386_avx512_linux (void);
-+extern const struct target_desc *tdesc_i386_avx512_linux;
-+
-+/* Defined in auto-generated file i386-mpx-linux.c.  */
-+void init_registers_i386_mpx_linux (void);
-+extern const struct target_desc *tdesc_i386_mpx_linux;
-+#endif
-diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
-index 5af2051..4c14c20 100644
---- a/gdb/gdbserver/target.h
-+++ b/gdb/gdbserver/target.h
-@@ -471,6 +471,9 @@ struct target_ops
-   /* Return 1 if the target supports catch syscall, 0 (or leave the
-      callback NULL) otherwise.  */
-   int (*supports_catch_syscall) (void);
-+
-+  /* Return tdesc index for IPA.  */
-+  int (*get_ipa_tdesc_idx) (void);
- };
-
- extern struct target_ops *the_target;
-@@ -550,6 +553,10 @@ int kill_inferior (int);
-   (the_target->supports_catch_syscall ?			\
-    (*the_target->supports_catch_syscall) () : 0)
-
-+#define target_get_ipa_tdesc_idx()			\
-+  (the_target->get_ipa_tdesc_idx			\
-+   ? (*the_target->get_ipa_tdesc_idx) () : 0)
-+
- #define target_supports_tracepoints()			\
-   (the_target->supports_tracepoints			\
-    ? (*the_target->supports_tracepoints) () : 0)
-diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
-index 0671999..cc86677 100644
---- a/gdb/gdbserver/tracepoint.c
-+++ b/gdb/gdbserver/tracepoint.c
-@@ -134,6 +134,7 @@ trace_vdebug (const char *fmt, ...)
- # define ust_loaded IPA_SYM_EXPORTED_NAME (ust_loaded)
- # define helper_thread_id IPA_SYM_EXPORTED_NAME (helper_thread_id)
- # define cmd_buf IPA_SYM_EXPORTED_NAME (cmd_buf)
-+# define ipa_tdesc_idx IPA_SYM_EXPORTED_NAME (ipa_tdesc_idx)
- #endif
-
- #ifndef IN_PROCESS_AGENT
-@@ -171,6 +172,7 @@ struct ipa_sym_addresses
-   CORE_ADDR addr_get_trace_state_variable_value;
-   CORE_ADDR addr_set_trace_state_variable_value;
-   CORE_ADDR addr_ust_loaded;
-+  CORE_ADDR addr_ipa_tdesc_idx;
- };
-
- static struct
-@@ -207,6 +209,7 @@ static struct
-   IPA_SYM(get_trace_state_variable_value),
-   IPA_SYM(set_trace_state_variable_value),
-   IPA_SYM(ust_loaded),
-+  IPA_SYM(ipa_tdesc_idx),
- };
-
- static struct ipa_sym_addresses ipa_sym_addrs;
-@@ -3231,6 +3234,11 @@ cmd_qtstart (char *packet)
-
-   *packet = '\0';
-
-+  /* Tell IPA about the correct tdesc.  */
-+  if (write_inferior_integer (ipa_sym_addrs.addr_ipa_tdesc_idx,
-+			      target_get_ipa_tdesc_idx ()))
-+    error ("Error setting ipa_tdesc_idx variable in lib");
-+
-   /* Start out empty.  */
-   if (agent_loaded_p ())
-     write_inferior_data_ptr (ipa_sym_addrs.addr_tracepoints, 0);
-@@ -4714,19 +4722,20 @@ collect_data_at_step (struct tracepoint_hit_ctx *ctx,
- #endif
-
- #ifdef IN_PROCESS_AGENT
--/* The target description used by the IPA.  Given that the IPA library
--   is built for a specific architecture that is loaded into the
--   inferior, there only needs to be one such description per
--   build.  */
--const struct target_desc *ipa_tdesc;
-+/* The target description index for IPA.  Passed from gdbserver, used
-+   to select ipa_tdesc.  */
-+EXTERN_C_PUSH
-+IP_AGENT_EXPORT_VAR int ipa_tdesc_idx;
-+EXTERN_C_POP
- #endif
-
- static struct regcache *
- get_context_regcache (struct tracepoint_hit_ctx *ctx)
- {
-   struct regcache *regcache = NULL;
--
- #ifdef IN_PROCESS_AGENT
-+  const struct target_desc *ipa_tdesc = get_ipa_tdesc (ipa_tdesc_idx);
-+
-   if (ctx->type == fast_tracepoint)
-     {
-       struct fast_tracepoint_ctx *fctx = (struct fast_tracepoint_ctx *) ctx;
-@@ -5799,11 +5808,13 @@ IP_AGENT_EXPORT_FUNC void
- gdb_collect (struct tracepoint *tpoint, unsigned char *regs)
- {
-   struct fast_tracepoint_ctx ctx;
-+  const struct target_desc *ipa_tdesc;
-
-   /* Don't do anything until the trace run is completely set up.  */
-   if (!tracing)
-     return;
-
-+  ipa_tdesc = get_ipa_tdesc (ipa_tdesc_idx);
-   ctx.base.type = fast_tracepoint;
-   ctx.regs = regs;
-   ctx.regcache_initted = 0;
-@@ -6660,6 +6671,7 @@ gdb_probe (const struct marker *mdata, void *probe_private,
- {
-   struct tracepoint *tpoint;
-   struct static_tracepoint_ctx ctx;
-+  const struct target_desc *ipa_tdesc;
-
-   /* Don't do anything until the trace run is completely set up.  */
-   if (!tracing)
-@@ -6668,6 +6680,7 @@ gdb_probe (const struct marker *mdata, void *probe_private,
-       return;
-     }
-
-+  ipa_tdesc = get_ipa_tdesc (ipa_tdesc_idx);
-   ctx.base.type = static_tracepoint;
-   ctx.regcache_initted = 0;
-   ctx.regs = regs;
-diff --git a/gdb/gdbserver/tracepoint.h b/gdb/gdbserver/tracepoint.h
-index cab89cf..e30f4f7 100644
---- a/gdb/gdbserver/tracepoint.h
-+++ b/gdb/gdbserver/tracepoint.h
-@@ -124,6 +124,7 @@ int handle_tracepoint_bkpts (struct thread_info *tinfo, CORE_ADDR stop_pc);
-
- #ifdef IN_PROCESS_AGENT
- void initialize_low_tracepoint (void);
-+const struct target_desc *get_ipa_tdesc (int idx);
- void supply_fast_tracepoint_registers (struct regcache *regcache,
- 				       const unsigned char *regs);
- void supply_static_tracepoint_registers (struct regcache *regcache,
-@@ -131,9 +132,6 @@ void supply_static_tracepoint_registers (struct regcache *regcache,
- 					 CORE_ADDR pc);
- void set_trampoline_buffer_space (CORE_ADDR begin, CORE_ADDR end,
- 				  char *errmsg);
--
--extern const struct target_desc *ipa_tdesc;
--
- #else
- void stop_tracing (void);
-
-diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
-index af39e78..df47efd 100644
---- a/gdb/i386-linux-tdep.c
-+++ b/gdb/i386-linux-tdep.c
-@@ -47,6 +47,7 @@
- #include "features/i386/i386-linux.c"
- #include "features/i386/i386-mmx-linux.c"
- #include "features/i386/i386-mpx-linux.c"
-+#include "features/i386/i386-avx-mpx-linux.c"
- #include "features/i386/i386-avx-linux.c"
- #include "features/i386/i386-avx512-linux.c"
-
-@@ -630,6 +631,8 @@ i386_linux_core_read_description (struct gdbarch *gdbarch,
-       return tdesc_i386_avx512_linux;
-     case X86_XSTATE_MPX_MASK:
-       return tdesc_i386_mpx_linux;
-+    case X86_XSTATE_AVX_MPX_MASK:
-+      return tdesc_i386_avx_mpx_linux;
-     case X86_XSTATE_AVX_MASK:
-       return tdesc_i386_avx_linux;
-     case X86_XSTATE_SSE_MASK:
-@@ -1018,5 +1021,6 @@ _initialize_i386_linux_tdep (void)
-   initialize_tdesc_i386_mmx_linux ();
-   initialize_tdesc_i386_avx_linux ();
-   initialize_tdesc_i386_mpx_linux ();
-+  initialize_tdesc_i386_avx_mpx_linux ();
-   initialize_tdesc_i386_avx512_linux ();
- }
-diff --git a/gdb/i386-linux-tdep.h b/gdb/i386-linux-tdep.h
-index ecc9e31..0cb0c4d 100644
---- a/gdb/i386-linux-tdep.h
-+++ b/gdb/i386-linux-tdep.h
-@@ -42,6 +42,7 @@ extern struct target_desc *tdesc_i386_linux;
- extern struct target_desc *tdesc_i386_mmx_linux;
- extern struct target_desc *tdesc_i386_avx_linux;
- extern struct target_desc *tdesc_i386_mpx_linux;
-+extern struct target_desc *tdesc_i386_avx_mpx_linux;
- extern struct target_desc *tdesc_i386_avx512_linux;
-
- /* Format of XSAVE extended state is:
-diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
-index b706463..1ec0a08 100644
---- a/gdb/i386-tdep.c
-+++ b/gdb/i386-tdep.c
-@@ -53,6 +53,7 @@
- #include "features/i386/i386.c"
- #include "features/i386/i386-avx.c"
- #include "features/i386/i386-mpx.c"
-+#include "features/i386/i386-avx-mpx.c"
- #include "features/i386/i386-avx512.c"
- #include "features/i386/i386-mmx.c"
-
-@@ -8618,6 +8619,8 @@ i386_target_description (uint64_t xcr0)
-     case X86_XSTATE_MPX_AVX512_MASK:
-     case X86_XSTATE_AVX512_MASK:
-       return tdesc_i386_avx512;
-+    case X86_XSTATE_AVX_MPX_MASK:
-+      return tdesc_i386_avx_mpx;
-     case X86_XSTATE_MPX_MASK:
-       return tdesc_i386_mpx;
-     case X86_XSTATE_AVX_MASK:
-@@ -8957,6 +8960,7 @@ Show Intel Memory Protection Extensions specific variables."),
-   initialize_tdesc_i386_mmx ();
-   initialize_tdesc_i386_avx ();
-   initialize_tdesc_i386_mpx ();
-+  initialize_tdesc_i386_avx_mpx ();
-   initialize_tdesc_i386_avx512 ();
-
-   /* Tell remote stub that we support XML target description.  */
-diff --git a/gdb/regformats/i386/amd64-avx-mpx-linux.dat b/gdb/regformats/i386/amd64-avx-mpx-linux.dat
-new file mode 100644
-index 0000000..6d45324
---- /dev/null
-+++ b/gdb/regformats/i386/amd64-avx-mpx-linux.dat
-@@ -0,0 +1,85 @@
-+# THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi :set ro:
-+# Generated from: i386/amd64-avx-mpx-linux.xml
-+name:amd64_avx_mpx_linux
-+xmltarget:amd64-avx-mpx-linux.xml
-+expedite:rbp,rsp,rip
-+64:rax
-+64:rbx
-+64:rcx
-+64:rdx
-+64:rsi
-+64:rdi
-+64:rbp
-+64:rsp
-+64:r8
-+64:r9
-+64:r10
-+64:r11
-+64:r12
-+64:r13
-+64:r14
-+64:r15
-+64:rip
-+32:eflags
-+32:cs
-+32:ss
-+32:ds
-+32:es
-+32:fs
-+32:gs
-+80:st0
-+80:st1
-+80:st2
-+80:st3
-+80:st4
-+80:st5
-+80:st6
-+80:st7
-+32:fctrl
-+32:fstat
-+32:ftag
-+32:fiseg
-+32:fioff
-+32:foseg
-+32:fooff
-+32:fop
-+128:xmm0
-+128:xmm1
-+128:xmm2
-+128:xmm3
-+128:xmm4
-+128:xmm5
-+128:xmm6
-+128:xmm7
-+128:xmm8
-+128:xmm9
-+128:xmm10
-+128:xmm11
-+128:xmm12
-+128:xmm13
-+128:xmm14
-+128:xmm15
-+32:mxcsr
-+64:orig_rax
-+128:ymm0h
-+128:ymm1h
-+128:ymm2h
-+128:ymm3h
-+128:ymm4h
-+128:ymm5h
-+128:ymm6h
-+128:ymm7h
-+128:ymm8h
-+128:ymm9h
-+128:ymm10h
-+128:ymm11h
-+128:ymm12h
-+128:ymm13h
-+128:ymm14h
-+128:ymm15h
-+128:bnd0raw
-+128:bnd1raw
-+128:bnd2raw
-+128:bnd3raw
-+64:bndcfgu
-+64:bndstatus
-diff --git a/gdb/regformats/i386/amd64-avx-mpx.dat b/gdb/regformats/i386/amd64-avx-mpx.dat
-new file mode 100644
-index 0000000..d985641
---- /dev/null
-+++ b/gdb/regformats/i386/amd64-avx-mpx.dat
-@@ -0,0 +1,84 @@
-+# THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi :set ro:
-+# Generated from: i386/amd64-avx-mpx.xml
-+name:amd64_avx_mpx
-+xmltarget:amd64-avx-mpx.xml
-+expedite:rbp,rsp,rip
-+64:rax
-+64:rbx
-+64:rcx
-+64:rdx
-+64:rsi
-+64:rdi
-+64:rbp
-+64:rsp
-+64:r8
-+64:r9
-+64:r10
-+64:r11
-+64:r12
-+64:r13
-+64:r14
-+64:r15
-+64:rip
-+32:eflags
-+32:cs
-+32:ss
-+32:ds
-+32:es
-+32:fs
-+32:gs
-+80:st0
-+80:st1
-+80:st2
-+80:st3
-+80:st4
-+80:st5
-+80:st6
-+80:st7
-+32:fctrl
-+32:fstat
-+32:ftag
-+32:fiseg
-+32:fioff
-+32:foseg
-+32:fooff
-+32:fop
-+128:xmm0
-+128:xmm1
-+128:xmm2
-+128:xmm3
-+128:xmm4
-+128:xmm5
-+128:xmm6
-+128:xmm7
-+128:xmm8
-+128:xmm9
-+128:xmm10
-+128:xmm11
-+128:xmm12
-+128:xmm13
-+128:xmm14
-+128:xmm15
-+32:mxcsr
-+128:ymm0h
-+128:ymm1h
-+128:ymm2h
-+128:ymm3h
-+128:ymm4h
-+128:ymm5h
-+128:ymm6h
-+128:ymm7h
-+128:ymm8h
-+128:ymm9h
-+128:ymm10h
-+128:ymm11h
-+128:ymm12h
-+128:ymm13h
-+128:ymm14h
-+128:ymm15h
-+128:bnd0raw
-+128:bnd1raw
-+128:bnd2raw
-+128:bnd3raw
-+64:bndcfgu
-+64:bndstatus
-diff --git a/gdb/regformats/i386/amd64-mpx-linux.dat b/gdb/regformats/i386/amd64-mpx-linux.dat
-index 7a05cfe..523ae01 100644
---- a/gdb/regformats/i386/amd64-mpx-linux.dat
-+++ b/gdb/regformats/i386/amd64-mpx-linux.dat
-@@ -61,22 +61,6 @@ expedite:rbp,rsp,rip
- 128:xmm15
- 32:mxcsr
- 64:orig_rax
--128:ymm0h
--128:ymm1h
--128:ymm2h
--128:ymm3h
--128:ymm4h
--128:ymm5h
--128:ymm6h
--128:ymm7h
--128:ymm8h
--128:ymm9h
--128:ymm10h
--128:ymm11h
--128:ymm12h
--128:ymm13h
--128:ymm14h
--128:ymm15h
- 128:bnd0raw
- 128:bnd1raw
- 128:bnd2raw
-diff --git a/gdb/regformats/i386/amd64-mpx.dat b/gdb/regformats/i386/amd64-mpx.dat
-index 1b75f4d..43b8776 100644
---- a/gdb/regformats/i386/amd64-mpx.dat
-+++ b/gdb/regformats/i386/amd64-mpx.dat
-@@ -60,22 +60,6 @@ expedite:rbp,rsp,rip
- 128:xmm14
- 128:xmm15
- 32:mxcsr
--128:ymm0h
--128:ymm1h
--128:ymm2h
--128:ymm3h
--128:ymm4h
--128:ymm5h
--128:ymm6h
--128:ymm7h
--128:ymm8h
--128:ymm9h
--128:ymm10h
--128:ymm11h
--128:ymm12h
--128:ymm13h
--128:ymm14h
--128:ymm15h
- 128:bnd0raw
- 128:bnd1raw
- 128:bnd2raw
-diff --git a/gdb/regformats/i386/i386-avx-mpx-linux.dat b/gdb/regformats/i386/i386-avx-mpx-linux.dat
-new file mode 100644
-index 0000000..831c476
---- /dev/null
-+++ b/gdb/regformats/i386/i386-avx-mpx-linux.dat
-@@ -0,0 +1,61 @@
-+# THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi :set ro:
-+# Generated from: i386/i386-avx-mpx-linux.xml
-+name:i386_avx_mpx_linux
-+xmltarget:i386-avx-mpx-linux.xml
-+expedite:ebp,esp,eip
-+32:eax
-+32:ecx
-+32:edx
-+32:ebx
-+32:esp
-+32:ebp
-+32:esi
-+32:edi
-+32:eip
-+32:eflags
-+32:cs
-+32:ss
-+32:ds
-+32:es
-+32:fs
-+32:gs
-+80:st0
-+80:st1
-+80:st2
-+80:st3
-+80:st4
-+80:st5
-+80:st6
-+80:st7
-+32:fctrl
-+32:fstat
-+32:ftag
-+32:fiseg
-+32:fioff
-+32:foseg
-+32:fooff
-+32:fop
-+128:xmm0
-+128:xmm1
-+128:xmm2
-+128:xmm3
-+128:xmm4
-+128:xmm5
-+128:xmm6
-+128:xmm7
-+32:mxcsr
-+32:orig_eax
-+128:ymm0h
-+128:ymm1h
-+128:ymm2h
-+128:ymm3h
-+128:ymm4h
-+128:ymm5h
-+128:ymm6h
-+128:ymm7h
-+128:bnd0raw
-+128:bnd1raw
-+128:bnd2raw
-+128:bnd3raw
-+64:bndcfgu
-+64:bndstatus
-diff --git a/gdb/regformats/i386/i386-avx-mpx.dat b/gdb/regformats/i386/i386-avx-mpx.dat
-new file mode 100644
-index 0000000..8caef75
---- /dev/null
-+++ b/gdb/regformats/i386/i386-avx-mpx.dat
-@@ -0,0 +1,60 @@
-+# THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi :set ro:
-+# Generated from: i386/i386-avx-mpx.xml
-+name:i386_avx_mpx
-+xmltarget:i386-avx-mpx.xml
-+expedite:ebp,esp,eip
-+32:eax
-+32:ecx
-+32:edx
-+32:ebx
-+32:esp
-+32:ebp
-+32:esi
-+32:edi
-+32:eip
-+32:eflags
-+32:cs
-+32:ss
-+32:ds
-+32:es
-+32:fs
-+32:gs
-+80:st0
-+80:st1
-+80:st2
-+80:st3
-+80:st4
-+80:st5
-+80:st6
-+80:st7
-+32:fctrl
-+32:fstat
-+32:ftag
-+32:fiseg
-+32:fioff
-+32:foseg
-+32:fooff
-+32:fop
-+128:xmm0
-+128:xmm1
-+128:xmm2
-+128:xmm3
-+128:xmm4
-+128:xmm5
-+128:xmm6
-+128:xmm7
-+32:mxcsr
-+128:ymm0h
-+128:ymm1h
-+128:ymm2h
-+128:ymm3h
-+128:ymm4h
-+128:ymm5h
-+128:ymm6h
-+128:ymm7h
-+128:bnd0raw
-+128:bnd1raw
-+128:bnd2raw
-+128:bnd3raw
-+64:bndcfgu
-+64:bndstatus
-diff --git a/gdb/regformats/i386/i386-mpx-linux.dat b/gdb/regformats/i386/i386-mpx-linux.dat
-index b52b68d..1dcdce9 100644
---- a/gdb/regformats/i386/i386-mpx-linux.dat
-+++ b/gdb/regformats/i386/i386-mpx-linux.dat
-@@ -45,14 +45,6 @@ expedite:ebp,esp,eip
- 128:xmm7
- 32:mxcsr
- 32:orig_eax
--128:ymm0h
--128:ymm1h
--128:ymm2h
--128:ymm3h
--128:ymm4h
--128:ymm5h
--128:ymm6h
--128:ymm7h
- 128:bnd0raw
- 128:bnd1raw
- 128:bnd2raw
-diff --git a/gdb/regformats/i386/i386-mpx.dat b/gdb/regformats/i386/i386-mpx.dat
-index 0ea420b..dda5164 100644
---- a/gdb/regformats/i386/i386-mpx.dat
-+++ b/gdb/regformats/i386/i386-mpx.dat
-@@ -44,14 +44,6 @@ expedite:ebp,esp,eip
- 128:xmm6
- 128:xmm7
- 32:mxcsr
--128:ymm0h
--128:ymm1h
--128:ymm2h
--128:ymm3h
--128:ymm4h
--128:ymm5h
--128:ymm6h
--128:ymm7h
- 128:bnd0raw
- 128:bnd1raw
- 128:bnd2raw
-diff --git a/gdb/testsuite/gdb.trace/ftrace.exp b/gdb/testsuite/gdb.trace/ftrace.exp
-index 15ad7e7..3a94471 100644
---- a/gdb/testsuite/gdb.trace/ftrace.exp
-+++ b/gdb/testsuite/gdb.trace/ftrace.exp
-@@ -132,7 +132,6 @@ proc test_fast_tracepoints {} {
- 	gdb_test "tfind pc *set_point" "Found trace frame .*" \
- 	    "tfind set_point frame, first time"
-
--	setup_kfail "gdb/13808" "x86_64-*-linux*"
- 	gdb_test "print globvar" " = 1"
-
- 	gdb_test "tfind pc *set_point" "Found trace frame .*" \
-diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
-index 3cc18c1..107576f 100644
---- a/gdb/x86-linux-nat.c
-+++ b/gdb/x86-linux-nat.c
-@@ -215,6 +215,11 @@ x86_linux_read_description (struct target_ops *ops)
- 	    return tdesc_x32_avx_linux; /* No MPX on x32 using AVX.  */
- 	  else
- 	    return tdesc_amd64_mpx_linux;
-+	case X86_XSTATE_AVX_MPX_MASK:
-+	  if (is_x32)
-+	    return tdesc_x32_avx_linux; /* No MPX on x32 using AVX.  */
-+	  else
-+	    return tdesc_amd64_avx_mpx_linux;
- 	case X86_XSTATE_AVX_MASK:
- 	  if (is_x32)
- 	    return tdesc_x32_avx_linux;
-@@ -237,6 +242,8 @@ x86_linux_read_description (struct target_ops *ops)
- 	  return tdesc_i386_avx512_linux;
- 	case X86_XSTATE_MPX_MASK:
- 	  return tdesc_i386_mpx_linux;
-+	case X86_XSTATE_AVX_MPX_MASK:
-+	  return tdesc_i386_avx_mpx_linux;
- 	case X86_XSTATE_AVX_MASK:
- 	  return tdesc_i386_avx_linux;
- 	default:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch
new file mode 100644
index 0000000..c5484f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch
@@ -0,0 +1,45 @@
+From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Fri, 24 Mar 2017 10:36:03 +0800
+Subject: [PATCH] Fix invalid sigprocmask call
+
+The POSIX document says
+
+    The pthread_sigmask() and sigprocmask() functions shall fail if:
+
+    [EINVAL]
+    The value of the how argument is not equal to one of the defined values.
+
+and this is how musl-libc is currently doing.  Fix the call to be safe
+and correct
+
+ [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html
+
+gdb/ChangeLog:
+2017-03-24  Yousong Zhou  <yszhou4tech@gmail.com>
+
+    * common/signals-state-save-restore.c (save_original_signals_state):
+    Fix invalid sigprocmask call.
+---
+Upstream-Status: Pending [not author, cherry-picked from LEDE https://bugs.lede-project.org/index.php?do=details&task_id=637&openedfrom=-1%2Bweek]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ gdb/ChangeLog                           | 5 +++++
+ gdb/common/signals-state-save-restore.c | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/common/signals-state-save-restore.c b/gdb/common/signals-state-save-restore.c
+index d11a9ae..734335c 100644
+--- a/gdb/common/signals-state-save-restore.c
++++ b/gdb/common/signals-state-save-restore.c
+@@ -41,7 +41,7 @@ save_original_signals_state (void)
+   int i;
+   int res;
+ 
+-  res = sigprocmask (0,  NULL, &original_signal_mask);
++  res = sigprocmask (SIG_BLOCK,  NULL, &original_signal_mask);
+   if (res == -1)
+     perror_with_name (("sigprocmask"));
+ 
+-- 
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.11.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.11.1.bb
deleted file mode 100644
index 57cffc9..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.11.1.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-require gdb.inc
-require gdb-${PV}.inc
-
-inherit python3-dir
-
-EXTRA_OEMAKE_append_libc-musl = "\
-                                 gt_cv_func_gnugettext1_libc=yes \
-                                 gt_cv_func_gnugettext2_libc=yes \
-                                "
-
-do_configure_prepend() {
-	if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}" ]; then
-		cat > ${WORKDIR}/python << EOF
-#!/bin/sh
-case "\$2" in
-	--includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;;
-	--ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}${PYTHON_ABI}" ;;
-	--exec-prefix) echo "${exec_prefix}" ;;
-	*) exit 1 ;;
-esac
-exit 0
-EOF
-		chmod +x ${WORKDIR}/python
-	fi
-}
-CFLAGS_append_libc-musl = " -Drpl_gettimeofday=gettimeofday"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.12.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.12.1.bb
new file mode 100644
index 0000000..ea8fef1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.12.1.bb
@@ -0,0 +1,27 @@
+require gdb.inc
+require gdb-${PV}.inc
+
+inherit python3-dir
+
+EXTRA_OEMAKE_append_libc-musl = "\
+                                 gt_cv_func_gnugettext1_libc=yes \
+                                 gt_cv_func_gnugettext2_libc=yes \
+                                 gl_cv_func_gettimeofday_clobber=no \
+                                "
+
+do_configure_prepend() {
+	if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then
+		cat > ${WORKDIR}/python << EOF
+#!/bin/sh
+case "\$2" in
+	--includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;;
+	--ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}${PYTHON_ABI}" ;;
+	--exec-prefix) echo "${exec_prefix}" ;;
+	*) exit 1 ;;
+esac
+exit 0
+EOF
+		chmod +x ${WORKDIR}/python
+	fi
+}
+CFLAGS_append_libc-musl = " -Drpl_gettimeofday=gettimeofday"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/git/git.inc b/import-layers/yocto-poky/meta/recipes-devtools/git/git.inc
index 753b047..5c12ca8 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/git/git.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/git/git.inc
@@ -13,6 +13,10 @@
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
 
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[cvsserver] = ""
+PACKAGECONFIG[svn] = ""
+
 EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
 		--without-tcltk \
 "
@@ -46,7 +50,7 @@
 perl_native_fixup () {
 	sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
 	       -e 's#${libdir}/perl-native/#${libdir}/#' \
-	    ${@d.getVar("PERLTOOLS", True).replace(' /',d.getVar('D', True) + '/')}
+	    ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')}
 
 	# ${libdir} is not applicable here, perl-native files are always
 	# installed to /usr/lib on both 32/64 bits targets.
@@ -54,6 +58,23 @@
 	mkdir -p ${D}${libdir}
 	mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir}
 	rmdir -p ${D}${exec_prefix}/lib/perl-native || true
+
+	if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then
+		# Only install the git cvsserver command if explicitly requested
+		# as it requires the DBI Perl module, which does not exist in
+		# OE-Core.
+		rm ${D}${libexecdir}/git-core/git-cvsserver \
+		   ${D}${bindir}/git-cvsserver
+	fi
+
+	if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then
+		# Only install the git svn command and all Git::SVN Perl modules
+		# if explicitly requested as they require the SVN::Core Perl
+		# module, which does not exist in OE-Core.
+		rm -r ${D}${libexecdir}/git-core/git-svn \
+		      ${D}${libdir}/perl/site_perl/*/Git/SVN*
+		sed -i -e '/SVN/d' ${D}${libdir}/perl/site_perl/*/auto/Git/.packlist
+	fi
 }
 
 REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
@@ -118,6 +139,6 @@
 
 PACKAGES =+ "gitweb"
 FILES_gitweb = "${datadir}/gitweb/"
-
+RDEPENDS_gitweb = "perl"
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.11.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.11.1.bb
new file mode 100644
index 0000000..f2f072c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.11.1.bb
@@ -0,0 +1,11 @@
+require git.inc
+
+EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no \
+                 ac_cv_fread_reads_directories=${ac_cv_fread_reads_directories=yes} \
+                 "
+EXTRA_OEMAKE += "NO_GETTEXT=1"
+
+SRC_URI[tarball.md5sum] = "6a7a73db076bb0514b602720669d685c"
+SRC_URI[tarball.sha256sum] = "a1cdd7c820f92c44abb5003b36dc8cb7201ba38e8744802399f59c97285ca043"
+SRC_URI[manpages.md5sum] = "e4268a6b514ccdb624b6450ff55881a3"
+SRC_URI[manpages.sha256sum] = "ee567e7b0f95333816793714bb31c54e288cf8041f77a0092b85e62c9c2974f9"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.9.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.9.3.bb
deleted file mode 100644
index d59f3d2..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.9.3.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-require git.inc
-
-EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no \
-                 ac_cv_fread_reads_directories=${ac_cv_fread_reads_directories=yes} \
-                 "
-EXTRA_OEMAKE += "NO_GETTEXT=1"
-
-SRC_URI[tarball.md5sum] = "c783361be894b8bfa5373811b1b65602"
-SRC_URI[tarball.sha256sum] = "a252b6636b12d5ba57732c8469701544c26c2b1689933bd1b425e603cbb247c0"
-SRC_URI[manpages.md5sum] = "66fafd61d65f9d2d99581133170eb186"
-SRC_URI[manpages.sha256sum] = "8ea1a55b048fafbf0c0c6fcbca4b5b0f5e9917893221fc7345c09051d65832ce"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb
index 072726f..f1c7788 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb
@@ -11,7 +11,7 @@
 SRCREV = "b576fa87c140b824466ef1638e945e87dc5c0343"
 PV = "20150728+git${SRCPV}"
 
-SRC_URI = "git://git.sv.gnu.org/config.git \
+SRC_URI = "git://git.savannah.gnu.org/config.git \
            file://gnu-configize.in"
 
 S = "${WORKDIR}/git"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4.inc b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4.inc
new file mode 100644
index 0000000..2f500f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4.inc
@@ -0,0 +1,16 @@
+require go-common.inc
+
+PV = "1.4.3"
+GO_BASEVERSION = "1.4"
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
+
+SRC_URI += "\
+        file://016-armhf-elf-header.patch \
+        file://go-cross-backport-cmd-link-support-new-386-amd64-rel.patch \
+        file://syslog.patch \
+        file://0001-cmd-ld-set-alignment-for-the-.rel.plt-section-on-32-.patch \
+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81"
+SRC_URI[md5sum] = "dfb604511115dd402a77a553a5923a04"
+SRC_URI[sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/0001-cmd-ld-set-alignment-for-the-.rel.plt-section-on-32-.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/0001-cmd-ld-set-alignment-for-the-.rel.plt-section-on-32-.patch
new file mode 100644
index 0000000..f2adc20
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/0001-cmd-ld-set-alignment-for-the-.rel.plt-section-on-32-.patch
@@ -0,0 +1,33 @@
+From 855145d5c03c4b4faf60736c38d7a299c682af4a Mon Sep 17 00:00:00 2001
+From: Shenghou Ma <minux@golang.org>
+Date: Sat, 7 Feb 2015 14:06:02 -0500
+Subject: [PATCH] cmd/ld: set alignment for the .rel.plt section on 32-bit
+ architectures
+
+Fixes #9802.
+
+Change-Id: I22c52a37bdb23a14cc4615c9519431bb14ca81ca
+Reviewed-on: https://go-review.googlesource.com/4170
+Reviewed-by: Ian Lance Taylor <iant@golang.org>
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ src/cmd/ld/elf.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cmd/ld/elf.c b/src/cmd/ld/elf.c
+index 12ced98..97ed4bd 100644
+--- a/src/cmd/ld/elf.c
++++ b/src/cmd/ld/elf.c
+@@ -1363,6 +1363,7 @@ asmbelf(vlong symo)
+ 			sh->type = SHT_REL;
+ 			sh->flags = SHF_ALLOC;
+ 			sh->entsize = ELF32RELSIZE;
++			sh->addralign = 4;
+ 			sh->link = elfshname(".dynsym")->shnum;
+ 			shsym(sh, linklookup(ctxt, ".rel.plt", 0));
+ 
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch
new file mode 100644
index 0000000..e6e414e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch
@@ -0,0 +1,24 @@
+Description: Use correct ELF header for armhf binaries.
+Author: Adam Conrad <adconrad@ubuntu.com>
+Last-Update: 2013-07-08
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: go/src/cmd/ld/elf.c
+===================================================================
+--- go.orig/src/cmd/ld/elf.c	2015-02-20 10:49:58.763451586 -0800
++++ go/src/cmd/ld/elf.c	2015-02-20 10:49:27.895478521 -0800
+@@ -57,7 +57,11 @@
+ 	case '5':
+ 		// we use EABI on both linux/arm and freebsd/arm.
+ 		if(HEADTYPE == Hlinux || HEADTYPE == Hfreebsd)
+-			hdr.flags = 0x5000002; // has entry point, Version5 EABI
++#ifdef __ARM_PCS_VFP
++			hdr.flags = 0x5000402; // has entry point, Version5 EABI, hard-float ABI
++#else
++			hdr.flags = 0x5000202; // has entry point, Version5 EABI, soft-float ABI
++#endif
+ 		// fallthrough
+ 	default:
+ 		hdr.phoff = ELF32HDRSIZE;	/* Must be be ELF32HDRSIZE: first PHdr must follow ELF header */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
new file mode 100644
index 0000000..95ca9d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
@@ -0,0 +1,225 @@
+From d6eefad445831c161fca130f9bdf7b3848aac23c Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Tue, 29 Mar 2016 21:14:33 -0400
+Subject: [PATCH] go-cross: backport "cmd/link: support new 386/amd64
+ relocations"
+
+Newer binutils won't support building older go-1.4.3 as per:
+
+https://github.com/golang/go/issues/13114
+
+Upstream commit 914db9f060b1fd3eb1f74d48f3bd46a73d4ae9c7 (see subj)
+was identified as the fix and nominated for 1.4.4 but that release
+never happened.  The paths in 1.4.3 aren't the same as go1.6beta1~662
+where this commit appeared, but the NetBSD folks indicated what a
+1.4.3 backport would look like here: https://gnats.netbsd.org/50777
+
+This is based on that, but without the BSD wrapper infrastructure
+layer that makes things look like patches of patches.
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+Upstream-Status: Backport [ Partial ]
+
+diff --git a/src/cmd/6l/asm.c b/src/cmd/6l/asm.c
+index 18b5aa311981..2e9d339aef87 100644
+--- a/src/cmd/6l/asm.c
++++ b/src/cmd/6l/asm.c
+@@ -118,6 +118,8 @@ adddynrel(LSym *s, Reloc *r)
+ 		return;
+ 	
+ 	case 256 + R_X86_64_GOTPCREL:
++	case 256 + R_X86_64_GOTPCRELX:
++	case 256 + R_X86_64_REX_GOTPCRELX:
+ 		if(targ->type != SDYNIMPORT) {
+ 			// have symbol
+ 			if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
+diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c
+index 98c04240374f..cff29488e8af 100644
+--- a/src/cmd/8l/asm.c
++++ b/src/cmd/8l/asm.c
+@@ -115,6 +115,7 @@ adddynrel(LSym *s, Reloc *r)
+ 		return;		
+ 	
+ 	case 256 + R_386_GOT32:
++	case 256 + R_386_GOT32X:
+ 		if(targ->type != SDYNIMPORT) {
+ 			// have symbol
+ 			if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
+diff --git a/src/cmd/ld/elf.h b/src/cmd/ld/elf.h
+index e84d996f2596..bbf2cfaa3cc0 100644
+--- a/src/cmd/ld/elf.h
++++ b/src/cmd/ld/elf.h
+@@ -478,32 +478,47 @@ typedef struct {
+  * Relocation types.
+  */
+ 
+-#define	R_X86_64_NONE	0	/* No relocation. */
+-#define	R_X86_64_64	1	/* Add 64 bit symbol value. */
+-#define	R_X86_64_PC32	2	/* PC-relative 32 bit signed sym value. */
+-#define	R_X86_64_GOT32	3	/* PC-relative 32 bit GOT offset. */
+-#define	R_X86_64_PLT32	4	/* PC-relative 32 bit PLT offset. */
+-#define	R_X86_64_COPY	5	/* Copy data from shared object. */
+-#define	R_X86_64_GLOB_DAT 6	/* Set GOT entry to data address. */
+-#define	R_X86_64_JMP_SLOT 7	/* Set GOT entry to code address. */
+-#define	R_X86_64_RELATIVE 8	/* Add load address of shared object. */
+-#define	R_X86_64_GOTPCREL 9	/* Add 32 bit signed pcrel offset to GOT. */
+-#define	R_X86_64_32	10	/* Add 32 bit zero extended symbol value */
+-#define	R_X86_64_32S	11	/* Add 32 bit sign extended symbol value */
+-#define	R_X86_64_16	12	/* Add 16 bit zero extended symbol value */
+-#define	R_X86_64_PC16	13	/* Add 16 bit signed extended pc relative symbol value */
+-#define	R_X86_64_8	14	/* Add 8 bit zero extended symbol value */
+-#define	R_X86_64_PC8	15	/* Add 8 bit signed extended pc relative symbol value */
+-#define	R_X86_64_DTPMOD64 16	/* ID of module containing symbol */
+-#define	R_X86_64_DTPOFF64 17	/* Offset in TLS block */
+-#define	R_X86_64_TPOFF64 18	/* Offset in static TLS block */
+-#define	R_X86_64_TLSGD	19	/* PC relative offset to GD GOT entry */
+-#define	R_X86_64_TLSLD	20	/* PC relative offset to LD GOT entry */
+-#define	R_X86_64_DTPOFF32 21	/* Offset in TLS block */
+-#define	R_X86_64_GOTTPOFF 22	/* PC relative offset to IE GOT entry */
+-#define	R_X86_64_TPOFF32 23	/* Offset in static TLS block */
+-
+-#define	R_X86_64_COUNT	24	/* Count of defined relocation types. */
++#define	R_X86_64_NONE           0
++#define	R_X86_64_64             1
++#define	R_X86_64_PC32           2
++#define	R_X86_64_GOT32          3
++#define	R_X86_64_PLT32          4
++#define	R_X86_64_COPY           5
++#define	R_X86_64_GLOB_DAT       6
++#define	R_X86_64_JMP_SLOT       7
++#define	R_X86_64_RELATIVE       8
++#define	R_X86_64_GOTPCREL       9
++#define	R_X86_64_32             10
++#define	R_X86_64_32S            11
++#define	R_X86_64_16             12
++#define	R_X86_64_PC16           13
++#define	R_X86_64_8              14
++#define	R_X86_64_PC8            15
++#define	R_X86_64_DTPMOD64       16
++#define	R_X86_64_DTPOFF64       17
++#define	R_X86_64_TPOFF64        18
++#define	R_X86_64_TLSGD          19
++#define	R_X86_64_TLSLD          20
++#define	R_X86_64_DTPOFF32       21
++#define	R_X86_64_GOTTPOFF       22
++#define	R_X86_64_TPOFF32        23
++#define	R_X86_64_PC64           24
++#define	R_X86_64_GOTOFF64       25
++#define	R_X86_64_GOTPC32        26
++#define	R_X86_64_GOT64          27
++#define	R_X86_64_GOTPCREL64     28
++#define	R_X86_64_GOTPC64        29
++#define	R_X86_64_GOTPLT64       30
++#define	R_X86_64_PLTOFF64       31
++#define	R_X86_64_SIZE32         32
++#define	R_X86_64_SIZE64         33
++#define	R_X86_64_GOTPC32_TLSDEC 34
++#define	R_X86_64_TLSDESC_CALL   35
++#define	R_X86_64_TLSDESC        36
++#define	R_X86_64_IRELATIVE      37
++#define	R_X86_64_PC32_BND       40
++#define	R_X86_64_GOTPCRELX      41
++#define	R_X86_64_REX_GOTPCRELX  42
+ 
+ 
+ #define	R_ALPHA_NONE		0	/* No reloc */
+@@ -581,39 +596,42 @@ typedef struct {
+ #define	R_ARM_COUNT		38	/* Count of defined relocation types. */
+ 
+ 
+-#define	R_386_NONE	0	/* No relocation. */
+-#define	R_386_32	1	/* Add symbol value. */
+-#define	R_386_PC32	2	/* Add PC-relative symbol value. */
+-#define	R_386_GOT32	3	/* Add PC-relative GOT offset. */
+-#define	R_386_PLT32	4	/* Add PC-relative PLT offset. */
+-#define	R_386_COPY	5	/* Copy data from shared object. */
+-#define	R_386_GLOB_DAT	6	/* Set GOT entry to data address. */
+-#define	R_386_JMP_SLOT	7	/* Set GOT entry to code address. */
+-#define	R_386_RELATIVE	8	/* Add load address of shared object. */
+-#define	R_386_GOTOFF	9	/* Add GOT-relative symbol address. */
+-#define	R_386_GOTPC	10	/* Add PC-relative GOT table address. */
+-#define	R_386_TLS_TPOFF	14	/* Negative offset in static TLS block */
+-#define	R_386_TLS_IE	15	/* Absolute address of GOT for -ve static TLS */
+-#define	R_386_TLS_GOTIE	16	/* GOT entry for negative static TLS block */
+-#define	R_386_TLS_LE	17	/* Negative offset relative to static TLS */
+-#define	R_386_TLS_GD	18	/* 32 bit offset to GOT (index,off) pair */
+-#define	R_386_TLS_LDM	19	/* 32 bit offset to GOT (index,zero) pair */
+-#define	R_386_TLS_GD_32	24	/* 32 bit offset to GOT (index,off) pair */
+-#define	R_386_TLS_GD_PUSH 25	/* pushl instruction for Sun ABI GD sequence */
+-#define	R_386_TLS_GD_CALL 26	/* call instruction for Sun ABI GD sequence */
+-#define	R_386_TLS_GD_POP 27	/* popl instruction for Sun ABI GD sequence */
+-#define	R_386_TLS_LDM_32 28	/* 32 bit offset to GOT (index,zero) pair */
+-#define	R_386_TLS_LDM_PUSH 29	/* pushl instruction for Sun ABI LD sequence */
+-#define	R_386_TLS_LDM_CALL 30	/* call instruction for Sun ABI LD sequence */
+-#define	R_386_TLS_LDM_POP 31	/* popl instruction for Sun ABI LD sequence */
+-#define	R_386_TLS_LDO_32 32	/* 32 bit offset from start of TLS block */
+-#define	R_386_TLS_IE_32	33	/* 32 bit offset to GOT static TLS offset entry */
+-#define	R_386_TLS_LE_32	34	/* 32 bit offset within static TLS block */
+-#define	R_386_TLS_DTPMOD32 35	/* GOT entry containing TLS index */
+-#define	R_386_TLS_DTPOFF32 36	/* GOT entry containing TLS offset */
+-#define	R_386_TLS_TPOFF32 37	/* GOT entry of -ve static TLS offset */
+-
+-#define	R_386_COUNT	38	/* Count of defined relocation types. */
++#define	R_386_NONE          0
++#define	R_386_32            1
++#define	R_386_PC32          2
++#define	R_386_GOT32         3
++#define	R_386_PLT32         4
++#define	R_386_COPY          5
++#define	R_386_GLOB_DAT      6
++#define	R_386_JMP_SLOT      7
++#define	R_386_RELATIVE      8
++#define	R_386_GOTOFF        9
++#define	R_386_GOTPC         10
++#define	R_386_TLS_TPOFF     14
++#define	R_386_TLS_IE        15
++#define	R_386_TLS_GOTIE     16
++#define	R_386_TLS_LE        17
++#define	R_386_TLS_GD        18
++#define	R_386_TLS_LDM       19
++#define	R_386_TLS_GD_32     24
++#define	R_386_TLS_GD_PUSH   25
++#define	R_386_TLS_GD_CALL   26
++#define	R_386_TLS_GD_POP    27
++#define	R_386_TLS_LDM_32    28
++#define	R_386_TLS_LDM_PUSH  29
++#define	R_386_TLS_LDM_CALL  30
++#define	R_386_TLS_LDM_POP   31
++#define	R_386_TLS_LDO_32    32
++#define	R_386_TLS_IE_32     33
++#define	R_386_TLS_LE_32     34
++#define	R_386_TLS_DTPMOD32  35
++#define	R_386_TLS_DTPOFF32  36
++#define	R_386_TLS_TPOFF32   37
++#define	R_386_TLS_GOTDESC   39
++#define	R_386_TLS_DESC_CALL 40
++#define	R_386_TLS_DESC      41
++#define	R_386_IRELATIVE     42
++#define	R_386_GOT32X        43
+ 
+ #define	R_PPC_NONE		0	/* No relocation. */
+ #define	R_PPC_ADDR32		1
+diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c
+index dd5fa0d2a839..2e2fbd17377f 100644
+--- a/src/cmd/ld/ldelf.c
++++ b/src/cmd/ld/ldelf.c
+@@ -888,12 +888,15 @@ reltype(char *pn, int elftype, uchar *siz)
+ 	case R('6', R_X86_64_PC32):
+ 	case R('6', R_X86_64_PLT32):
+ 	case R('6', R_X86_64_GOTPCREL):
++	case R('6', R_X86_64_GOTPCRELX):
++	case R('6', R_X86_64_REX_GOTPCRELX):
+ 	case R('8', R_386_32):
+ 	case R('8', R_386_PC32):
+ 	case R('8', R_386_GOT32):
+ 	case R('8', R_386_PLT32):
+ 	case R('8', R_386_GOTOFF):
+ 	case R('8', R_386_GOTPC):
++	case R('8', R_386_GOT32X):
+ 		*siz = 4;
+ 		break;
+ 	case R('6', R_X86_64_64):
+-- 
+2.7.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/syslog.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/syslog.patch
new file mode 100644
index 0000000..29be06f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.4/syslog.patch
@@ -0,0 +1,62 @@
+Add timeouts to logger
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
+--- go/src/log/syslog/syslog.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go	2014-10-03 11:44:37.710403200 -0700
+@@ -33,6 +33,9 @@
+ const severityMask = 0x07
+ const facilityMask = 0xf8
+ 
++var writeTimeout = 1 * time.Second
++var connectTimeout = 1 * time.Second
++
+ const (
+ 	// Severity.
+ 
+@@ -100,6 +103,7 @@
+ type serverConn interface {
+ 	writeString(p Priority, hostname, tag, s, nl string) error
+ 	close() error
++	setWriteDeadline(t time.Time) error
+ }
+ 
+ type netConn struct {
+@@ -273,7 +277,11 @@
+ 		nl = "\n"
+ 	}
+ 
+-	err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
++	err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
++	if err != nil {
++		return 0, err
++	}
++	err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
+ 	if err != nil {
+ 		return 0, err
+ 	}
+@@ -305,6 +313,10 @@
+ 	return n.conn.Close()
+ }
+ 
++func (n *netConn) setWriteDeadline(t time.Time) error {
++	return n.conn.SetWriteDeadline(t)
++}
++
+ // NewLogger creates a log.Logger whose output is written to
+ // the system log service with the specified priority. The logFlag
+ // argument is the flag set passed through to log.New to create
+diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
+--- go/src/log/syslog/syslog_unix.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go	2014-10-03 11:44:39.010403175 -0700
+@@ -19,7 +19,7 @@
+ 	logPaths := []string{"/dev/log", "/var/run/syslog"}
+ 	for _, network := range logTypes {
+ 		for _, path := range logPaths {
+-			conn, err := net.Dial(network, path)
++			conn, err := net.DialTimeout(network, path, connectTimeout)
+ 			if err != nil {
+ 				continue
+ 			} else {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6.inc b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6.inc
new file mode 100644
index 0000000..769c1d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6.inc
@@ -0,0 +1,19 @@
+require go-common.inc
+
+PV = "1.6.3"
+GO_BASEVERSION = "1.6"
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81"
+
+SRC_URI += "\
+       file://armhf-elf-header.patch \
+       file://syslog.patch \
+       file://fix-target-cc-for-build.patch \
+       file://fix-cc-handling.patch \
+       file://split-host-and-target-build.patch \
+       file://gotooldir.patch \
+"
+SRC_URI[md5sum] = "bf3fce6ccaadd310159c9e874220e2a2"
+SRC_URI[sha256sum] = "6326aeed5f86cf18f16d6dc831405614f855e2d416a91fd3fdc334f772345b00"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch
new file mode 100644
index 0000000..1e3a16b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch
@@ -0,0 +1,23 @@
+Encode arm EABI ( hard/soft ) calling convention in ELF header
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/link/internal/ld/elf.go
+===================================================================
+--- go.orig/src/cmd/link/internal/ld/elf.go
++++ go/src/cmd/link/internal/ld/elf.go
+@@ -827,7 +827,13 @@
+ 	// 32-bit architectures
+ 	case '5':
+ 		// we use EABI on both linux/arm and freebsd/arm.
+-		if HEADTYPE == obj.Hlinux || HEADTYPE == obj.Hfreebsd {
++		if HEADTYPE == obj.Hlinux {
++			if Ctxt.Goarm == 7 {
++				ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float
++			} else {
++				ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float
++			}
++		} else if HEADTYPE == obj.Hfreebsd {
+ 			// We set a value here that makes no indication of which
+ 			// float ABI the object uses, because this is information
+ 			// used by the dynamic linker to compare executables and
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch
new file mode 100644
index 0000000..983323a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch
@@ -0,0 +1,50 @@
+Accept CC with multiple words in its name
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go	2015-07-29 14:48:40.323185807 -0700
++++ go/src/cmd/go/build.go	2015-07-30 07:37:40.529818586 -0700
+@@ -2805,12 +2805,24 @@
+ 	return b.ccompilerCmd("CC", defaultCC, objdir)
+ }
+ 
++// gccCmd returns a gcc command line prefix
++// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gccCmdForReal() []string {
++	return envList("CC", defaultCC)
++}
++
+ // gxxCmd returns a g++ command line prefix
+ // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
+ func (b *builder) gxxCmd(objdir string) []string {
+ 	return b.ccompilerCmd("CXX", defaultCXX, objdir)
+ }
+ 
++// gxxCmd returns a g++ command line prefix
++// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gxxCmdForReal() []string {
++	return envList("CXX", defaultCXX)
++}
++
+ // ccompilerCmd returns a command line prefix for the given environment
+ // variable and using the default command when the variable is empty.
+ func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string {
+Index: go/src/cmd/go/env.go
+===================================================================
+--- go.orig/src/cmd/go/env.go	2015-07-29 14:48:40.323185807 -0700
++++ go/src/cmd/go/env.go	2015-07-30 07:40:54.461655721 -0700
+@@ -52,10 +52,9 @@
+ 
+ 	if goos != "plan9" {
+ 		cmd := b.gccCmd(".")
+-		env = append(env, envVar{"CC", cmd[0]})
++		env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
+ 		env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
+-		cmd = b.gxxCmd(".")
+-		env = append(env, envVar{"CXX", cmd[0]})
++		env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
+ 	}
+ 
+ 	if buildContext.CgoEnabled {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch
new file mode 100644
index 0000000..2f6156e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch
@@ -0,0 +1,17 @@
+Put Quotes around CC_FOR_TARGET since it can be mutliple words e.g. in OE
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/make.bash
+===================================================================
+--- go.orig/src/make.bash	2015-07-29 13:28:11.334031696 -0700
++++ go/src/make.bash	2015-07-29 13:36:55.814465630 -0700
+@@ -158,7 +158,7 @@
+ fi
+ 
+ echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
++CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+ echo
+ 
+ rm -f "$GOTOOLDIR"/go_bootstrap
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/gotooldir.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/gotooldir.patch
new file mode 100644
index 0000000..9467025
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/gotooldir.patch
@@ -0,0 +1,30 @@
+Define tooldir in relation to GOTOOLDIR env var
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/go/build/build.go
+===================================================================
+--- go.orig/src/go/build/build.go
++++ go/src/go/build/build.go
+@@ -1388,7 +1388,7 @@ func init() {
+ }
+ 
+ // ToolDir is the directory containing build tools.
+-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
+ 
+ // IsLocalImport reports whether the import path is
+ // a local import path, like ".", "..", "./foo", or "../foo".
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
+ 		}
+ 
+ 		cgoExe := tool("cgo")
+-		if a.cgo != nil && a.cgo.target != "" {
++		if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
+ 			cgoExe = a.cgo.target
+ 		}
+ 		outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
new file mode 100644
index 0000000..afbae02
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
@@ -0,0 +1,63 @@
+Add new option --target-only to build target components
+Separates the host and target pieces of build
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/make.bash
+===================================================================
+--- go.orig/src/make.bash
++++ go/src/make.bash
+@@ -143,12 +143,23 @@ if [ "$1" = "--no-clean" ]; then
+ 	buildall=""
+ 	shift
+ fi
+-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
+-# Delay move of dist tool to now, because bootstrap may clear tool directory.
+-mv cmd/dist/dist "$GOTOOLDIR"/dist
+-echo
+ 
+-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
++do_host_build="yes"
++do_target_build="yes"
++if [ "$1" = "--target-only" ]; then
++	do_host_build="no"
++	shift
++elif [ "$1" = "--host-only" ]; then
++	do_target_build="no"
++	shift
++fi
++
++if [ "$do_host_build" = "yes" ]; then
++	./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++	# Delay move of dist tool to now, because bootstrap may clear tool directory.
++	mv cmd/dist/dist "$GOTOOLDIR"/dist
++	echo
++
+ 	echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
+ 	# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
+ 	# use the host compiler, CC, from `cmd/dist/dist env` instead.
+@@ -157,11 +168,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
+ 	echo
+ fi
+ 
+-echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+-echo
++if [ "$do_target_build" = "yes" ]; then
++    GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
++    echo "##### Building packages and commands for $GOOS/$GOARCH."
++    if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
++	rm -rf ./host-tools
++	mkdir ./host-tools
++	mv "$GOTOOLDIR"/* ./host-tools
++	GOTOOLDIR="$PWD/host-tools"
++    fi
++    GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
++    echo
+ 
+-rm -f "$GOTOOLDIR"/go_bootstrap
++    rm -f "$GOTOOLDIR"/go_bootstrap
++fi
+ 
+ if [ "$1" != "--no-banner" ]; then
+ 	"$GOTOOLDIR"/dist banner
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/syslog.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/syslog.patch
new file mode 100644
index 0000000..29be06f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.6/syslog.patch
@@ -0,0 +1,62 @@
+Add timeouts to logger
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
+--- go/src/log/syslog/syslog.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go	2014-10-03 11:44:37.710403200 -0700
+@@ -33,6 +33,9 @@
+ const severityMask = 0x07
+ const facilityMask = 0xf8
+ 
++var writeTimeout = 1 * time.Second
++var connectTimeout = 1 * time.Second
++
+ const (
+ 	// Severity.
+ 
+@@ -100,6 +103,7 @@
+ type serverConn interface {
+ 	writeString(p Priority, hostname, tag, s, nl string) error
+ 	close() error
++	setWriteDeadline(t time.Time) error
+ }
+ 
+ type netConn struct {
+@@ -273,7 +277,11 @@
+ 		nl = "\n"
+ 	}
+ 
+-	err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
++	err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
++	if err != nil {
++		return 0, err
++	}
++	err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
+ 	if err != nil {
+ 		return 0, err
+ 	}
+@@ -305,6 +313,10 @@
+ 	return n.conn.Close()
+ }
+ 
++func (n *netConn) setWriteDeadline(t time.Time) error {
++	return n.conn.SetWriteDeadline(t)
++}
++
+ // NewLogger creates a log.Logger whose output is written to
+ // the system log service with the specified priority. The logFlag
+ // argument is the flag set passed through to log.New to create
+diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
+--- go/src/log/syslog/syslog_unix.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go	2014-10-03 11:44:39.010403175 -0700
+@@ -19,7 +19,7 @@
+ 	logPaths := []string{"/dev/log", "/var/run/syslog"}
+ 	for _, network := range logTypes {
+ 		for _, path := range logPaths {
+-			conn, err := net.Dial(network, path)
++			conn, err := net.DialTimeout(network, path, connectTimeout)
+ 			if err != nil {
+ 				continue
+ 			} else {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7.inc b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7.inc
new file mode 100644
index 0000000..5c3004e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7.inc
@@ -0,0 +1,19 @@
+require go-common.inc
+
+PV = "1.7.4"
+GO_BASEVERSION = "1.7"
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
+
+SRC_URI += "\
+       file://armhf-elf-header.patch \
+       file://syslog.patch \
+       file://fix-target-cc-for-build.patch \
+       file://fix-cc-handling.patch \
+       file://split-host-and-target-build.patch \
+       file://gotooldir.patch \
+"
+SRC_URI[md5sum] = "49c1076428a5d3b5ad7ac65233fcca2f"
+SRC_URI[sha256sum] = "4c189111e9ba651a2bb3ee868aa881fab36b2f2da3409e80885ca758a6b614cc"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch
new file mode 100644
index 0000000..1e3a16b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch
@@ -0,0 +1,23 @@
+Encode arm EABI ( hard/soft ) calling convention in ELF header
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/link/internal/ld/elf.go
+===================================================================
+--- go.orig/src/cmd/link/internal/ld/elf.go
++++ go/src/cmd/link/internal/ld/elf.go
+@@ -827,7 +827,13 @@
+ 	// 32-bit architectures
+ 	case '5':
+ 		// we use EABI on both linux/arm and freebsd/arm.
+-		if HEADTYPE == obj.Hlinux || HEADTYPE == obj.Hfreebsd {
++		if HEADTYPE == obj.Hlinux {
++			if Ctxt.Goarm == 7 {
++				ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float
++			} else {
++				ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float
++			}
++		} else if HEADTYPE == obj.Hfreebsd {
+ 			// We set a value here that makes no indication of which
+ 			// float ABI the object uses, because this is information
+ 			// used by the dynamic linker to compare executables and
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch
new file mode 100644
index 0000000..a67caf4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch
@@ -0,0 +1,50 @@
+Accept CC with multiple words in its name
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -2991,12 +2991,24 @@ func (b *builder) gccCmd(objdir string)
+ 	return b.ccompilerCmd("CC", defaultCC, objdir)
+ }
+ 
++// gccCmd returns a gcc command line prefix
++// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gccCmdForReal() []string {
++	return envList("CC", defaultCC)
++}
++
+ // gxxCmd returns a g++ command line prefix
+ // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
+ func (b *builder) gxxCmd(objdir string) []string {
+ 	return b.ccompilerCmd("CXX", defaultCXX, objdir)
+ }
+ 
++// gxxCmd returns a g++ command line prefix
++// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gxxCmdForReal() []string {
++	return envList("CXX", defaultCXX)
++}
++
+ // gfortranCmd returns a gfortran command line prefix.
+ func (b *builder) gfortranCmd(objdir string) []string {
+ 	return b.ccompilerCmd("FC", "gfortran", objdir)
+Index: go/src/cmd/go/env.go
+===================================================================
+--- go.orig/src/cmd/go/env.go
++++ go/src/cmd/go/env.go
+@@ -51,10 +51,9 @@ func mkEnv() []envVar {
+ 
+ 	if goos != "plan9" {
+ 		cmd := b.gccCmd(".")
+-		env = append(env, envVar{"CC", cmd[0]})
++		env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
+ 		env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
+-		cmd = b.gxxCmd(".")
+-		env = append(env, envVar{"CXX", cmd[0]})
++		env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
+ 	}
+ 
+ 	if buildContext.CgoEnabled {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch
new file mode 100644
index 0000000..2f6156e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch
@@ -0,0 +1,17 @@
+Put Quotes around CC_FOR_TARGET since it can be mutliple words e.g. in OE
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/make.bash
+===================================================================
+--- go.orig/src/make.bash	2015-07-29 13:28:11.334031696 -0700
++++ go/src/make.bash	2015-07-29 13:36:55.814465630 -0700
+@@ -158,7 +158,7 @@
+ fi
+ 
+ echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
++CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+ echo
+ 
+ rm -f "$GOTOOLDIR"/go_bootstrap
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/gotooldir.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/gotooldir.patch
new file mode 100644
index 0000000..9467025
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/gotooldir.patch
@@ -0,0 +1,30 @@
+Define tooldir in relation to GOTOOLDIR env var
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/go/build/build.go
+===================================================================
+--- go.orig/src/go/build/build.go
++++ go/src/go/build/build.go
+@@ -1388,7 +1388,7 @@ func init() {
+ }
+ 
+ // ToolDir is the directory containing build tools.
+-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
+ 
+ // IsLocalImport reports whether the import path is
+ // a local import path, like ".", "..", "./foo", or "../foo".
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
+ 		}
+ 
+ 		cgoExe := tool("cgo")
+-		if a.cgo != nil && a.cgo.target != "" {
++		if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
+ 			cgoExe = a.cgo.target
+ 		}
+ 		outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch
new file mode 100644
index 0000000..b0dd95b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch
@@ -0,0 +1,62 @@
+Add new option --target-only to build target components
+Separates the host and target pieces of build
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/make.bash
+===================================================================
+--- go.orig/src/make.bash
++++ go/src/make.bash
+@@ -154,13 +154,22 @@ if [ "$1" = "--no-clean" ]; then
+ 	buildall=""
+ 	shift
+ fi
+-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++do_host_build="yes"
++do_target_build="yes"
++if [ "$1" = "--target-only" ]; then
++	do_host_build="no"
++	shift
++elif [ "$1" = "--host-only" ]; then
++	do_target_build="no"
++	shift
++fi
+ 
+-# Delay move of dist tool to now, because bootstrap may clear tool directory.
+-mv cmd/dist/dist "$GOTOOLDIR"/dist
+-echo
++if [ "$do_host_build" = "yes" ]; then
++	./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++	# Delay move of dist tool to now, because bootstrap may clear tool directory.
++	mv cmd/dist/dist "$GOTOOLDIR"/dist
++	echo
+ 
+-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
+ 	echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
+ 	# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
+ 	# use the host compiler, CC, from `cmd/dist/dist env` instead.
+@@ -169,11 +178,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
+ 	echo
+ fi
+ 
+-echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+-echo
++if [ "$do_target_build" = "yes" ]; then
++    GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
++    echo "##### Building packages and commands for $GOOS/$GOARCH."
++    if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
++	rm -rf ./host-tools
++	mkdir ./host-tools
++	mv "$GOTOOLDIR"/* ./host-tools
++	GOTOOLDIR="$PWD/host-tools"
++    fi
++    GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
++    echo
+ 
+-rm -f "$GOTOOLDIR"/go_bootstrap
++    rm -f "$GOTOOLDIR"/go_bootstrap
++fi
+ 
+ if [ "$1" != "--no-banner" ]; then
+ 	"$GOTOOLDIR"/dist banner
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/syslog.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/syslog.patch
new file mode 100644
index 0000000..29be06f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.7/syslog.patch
@@ -0,0 +1,62 @@
+Add timeouts to logger
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
+--- go/src/log/syslog/syslog.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go	2014-10-03 11:44:37.710403200 -0700
+@@ -33,6 +33,9 @@
+ const severityMask = 0x07
+ const facilityMask = 0xf8
+ 
++var writeTimeout = 1 * time.Second
++var connectTimeout = 1 * time.Second
++
+ const (
+ 	// Severity.
+ 
+@@ -100,6 +103,7 @@
+ type serverConn interface {
+ 	writeString(p Priority, hostname, tag, s, nl string) error
+ 	close() error
++	setWriteDeadline(t time.Time) error
+ }
+ 
+ type netConn struct {
+@@ -273,7 +277,11 @@
+ 		nl = "\n"
+ 	}
+ 
+-	err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
++	err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
++	if err != nil {
++		return 0, err
++	}
++	err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
+ 	if err != nil {
+ 		return 0, err
+ 	}
+@@ -305,6 +313,10 @@
+ 	return n.conn.Close()
+ }
+ 
++func (n *netConn) setWriteDeadline(t time.Time) error {
++	return n.conn.SetWriteDeadline(t)
++}
++
+ // NewLogger creates a log.Logger whose output is written to
+ // the system log service with the specified priority. The logFlag
+ // argument is the flag set passed through to log.New to create
+diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
+--- go/src/log/syslog/syslog_unix.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go	2014-10-03 11:44:39.010403175 -0700
+@@ -19,7 +19,7 @@
+ 	logPaths := []string{"/dev/log", "/var/run/syslog"}
+ 	for _, network := range logTypes {
+ 		for _, path := range logPaths {
+-			conn, err := net.Dial(network, path)
++			conn, err := net.DialTimeout(network, path, connectTimeout)
+ 			if err != nil {
+ 				continue
+ 			} else {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8.inc b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8.inc
new file mode 100644
index 0000000..5c376a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8.inc
@@ -0,0 +1,19 @@
+require go-common.inc
+
+GOMINOR = ""
+GO_BASEVERSION = "1.8"
+PV .= "${GOMINOR}"
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
+
+SRC_URI += "\
+       file://armhf-elf-header.patch \
+       file://syslog.patch \
+       file://fix-target-cc-for-build.patch \
+       file://fix-cc-handling.patch \
+       file://split-host-and-target-build.patch \
+       file://gotooldir.patch \
+"
+SRC_URI[md5sum] = "7743960c968760437b6e39093cfe6f67"
+SRC_URI[sha256sum] = "406865f587b44be7092f206d73fc1de252600b79b3cacc587b74b5ef5c623596"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/armhf-elf-header.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/armhf-elf-header.patch
new file mode 100644
index 0000000..3508838
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/armhf-elf-header.patch
@@ -0,0 +1,23 @@
+Encode arm EABI ( hard/soft ) calling convention in ELF header
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/link/internal/ld/elf.go
+===================================================================
+--- go.orig/src/cmd/link/internal/ld/elf.go
++++ go/src/cmd/link/internal/ld/elf.go
+@@ -950,7 +950,13 @@ func Elfinit(ctxt *Link) {
+ 	case sys.ARM, sys.MIPS:
+ 		if SysArch.Family == sys.ARM {
+ 			// we use EABI on linux/arm, freebsd/arm, netbsd/arm.
+-			if Headtype == obj.Hlinux || Headtype == obj.Hfreebsd || Headtype == obj.Hnetbsd {
++			if Headtype == obj.Hlinux {
++				if obj.GOARM == 7 {
++					ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float
++				} else {
++					ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float
++				}
++			} else if Headtype == obj.Hfreebsd || Headtype == obj.Hnetbsd {
+ 				// We set a value here that makes no indication of which
+ 				// float ABI the object uses, because this is information
+ 				// used by the dynamic linker to compare executables and
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch
new file mode 100644
index 0000000..dc9b811
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch
@@ -0,0 +1,50 @@
+Accept CC with multiple words in its name
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -3100,12 +3100,24 @@ func (b *builder) gccCmd(objdir string)
+ 	return b.ccompilerCmd("CC", defaultCC, objdir)
+ }
+ 
++// gccCmd returns a gcc command line prefix
++// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gccCmdForReal() []string {
++	return envList("CC", defaultCC)
++}
++
+ // gxxCmd returns a g++ command line prefix
+ // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
+ func (b *builder) gxxCmd(objdir string) []string {
+ 	return b.ccompilerCmd("CXX", defaultCXX, objdir)
+ }
+ 
++// gxxCmd returns a g++ command line prefix
++// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gxxCmdForReal() []string {
++	return envList("CXX", defaultCXX)
++}
++
+ // gfortranCmd returns a gfortran command line prefix.
+ func (b *builder) gfortranCmd(objdir string) []string {
+ 	return b.ccompilerCmd("FC", "gfortran", objdir)
+Index: go/src/cmd/go/env.go
+===================================================================
+--- go.orig/src/cmd/go/env.go
++++ go/src/cmd/go/env.go
+@@ -63,10 +63,9 @@ func mkEnv() []envVar {
+ 	}
+ 
+ 	cmd := b.gccCmd(".")
+-	env = append(env, envVar{"CC", cmd[0]})
++	env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
+ 	env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
+-	cmd = b.gxxCmd(".")
+-	env = append(env, envVar{"CXX", cmd[0]})
++	env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
+ 
+ 	if buildContext.CgoEnabled {
+ 		env = append(env, envVar{"CGO_ENABLED", "1"})
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/fix-target-cc-for-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/fix-target-cc-for-build.patch
new file mode 100644
index 0000000..2f6156e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/fix-target-cc-for-build.patch
@@ -0,0 +1,17 @@
+Put Quotes around CC_FOR_TARGET since it can be mutliple words e.g. in OE
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/make.bash
+===================================================================
+--- go.orig/src/make.bash	2015-07-29 13:28:11.334031696 -0700
++++ go/src/make.bash	2015-07-29 13:36:55.814465630 -0700
+@@ -158,7 +158,7 @@
+ fi
+ 
+ echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
++CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+ echo
+ 
+ rm -f "$GOTOOLDIR"/go_bootstrap
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/gotooldir.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/gotooldir.patch
new file mode 100644
index 0000000..9467025
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/gotooldir.patch
@@ -0,0 +1,30 @@
+Define tooldir in relation to GOTOOLDIR env var
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/go/build/build.go
+===================================================================
+--- go.orig/src/go/build/build.go
++++ go/src/go/build/build.go
+@@ -1388,7 +1388,7 @@ func init() {
+ }
+ 
+ // ToolDir is the directory containing build tools.
+-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
+ 
+ // IsLocalImport reports whether the import path is
+ // a local import path, like ".", "..", "./foo", or "../foo".
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
+ 		}
+ 
+ 		cgoExe := tool("cgo")
+-		if a.cgo != nil && a.cgo.target != "" {
++		if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
+ 			cgoExe = a.cgo.target
+ 		}
+ 		outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/split-host-and-target-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/split-host-and-target-build.patch
new file mode 100644
index 0000000..b0dd95b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/split-host-and-target-build.patch
@@ -0,0 +1,62 @@
+Add new option --target-only to build target components
+Separates the host and target pieces of build
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/make.bash
+===================================================================
+--- go.orig/src/make.bash
++++ go/src/make.bash
+@@ -154,13 +154,22 @@ if [ "$1" = "--no-clean" ]; then
+ 	buildall=""
+ 	shift
+ fi
+-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++do_host_build="yes"
++do_target_build="yes"
++if [ "$1" = "--target-only" ]; then
++	do_host_build="no"
++	shift
++elif [ "$1" = "--host-only" ]; then
++	do_target_build="no"
++	shift
++fi
+ 
+-# Delay move of dist tool to now, because bootstrap may clear tool directory.
+-mv cmd/dist/dist "$GOTOOLDIR"/dist
+-echo
++if [ "$do_host_build" = "yes" ]; then
++	./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++	# Delay move of dist tool to now, because bootstrap may clear tool directory.
++	mv cmd/dist/dist "$GOTOOLDIR"/dist
++	echo
+ 
+-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
+ 	echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
+ 	# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
+ 	# use the host compiler, CC, from `cmd/dist/dist env` instead.
+@@ -169,11 +178,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
+ 	echo
+ fi
+ 
+-echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+-echo
++if [ "$do_target_build" = "yes" ]; then
++    GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
++    echo "##### Building packages and commands for $GOOS/$GOARCH."
++    if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
++	rm -rf ./host-tools
++	mkdir ./host-tools
++	mv "$GOTOOLDIR"/* ./host-tools
++	GOTOOLDIR="$PWD/host-tools"
++    fi
++    GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
++    echo
+ 
+-rm -f "$GOTOOLDIR"/go_bootstrap
++    rm -f "$GOTOOLDIR"/go_bootstrap
++fi
+ 
+ if [ "$1" != "--no-banner" ]; then
+ 	"$GOTOOLDIR"/dist banner
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/syslog.patch b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/syslog.patch
new file mode 100644
index 0000000..29be06f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-1.8/syslog.patch
@@ -0,0 +1,62 @@
+Add timeouts to logger
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
+--- go/src/log/syslog/syslog.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go	2014-10-03 11:44:37.710403200 -0700
+@@ -33,6 +33,9 @@
+ const severityMask = 0x07
+ const facilityMask = 0xf8
+ 
++var writeTimeout = 1 * time.Second
++var connectTimeout = 1 * time.Second
++
+ const (
+ 	// Severity.
+ 
+@@ -100,6 +103,7 @@
+ type serverConn interface {
+ 	writeString(p Priority, hostname, tag, s, nl string) error
+ 	close() error
++	setWriteDeadline(t time.Time) error
+ }
+ 
+ type netConn struct {
+@@ -273,7 +277,11 @@
+ 		nl = "\n"
+ 	}
+ 
+-	err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
++	err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
++	if err != nil {
++		return 0, err
++	}
++	err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
+ 	if err != nil {
+ 		return 0, err
+ 	}
+@@ -305,6 +313,10 @@
+ 	return n.conn.Close()
+ }
+ 
++func (n *netConn) setWriteDeadline(t time.Time) error {
++	return n.conn.SetWriteDeadline(t)
++}
++
+ // NewLogger creates a log.Logger whose output is written to
+ // the system log service with the specified priority. The logFlag
+ // argument is the flag set passed through to log.New to create
+diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
+--- go/src/log/syslog/syslog_unix.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go	2014-10-03 11:44:39.010403175 -0700
+@@ -19,7 +19,7 @@
+ 	logPaths := []string{"/dev/log", "/var/run/syslog"}
+ 	for _, network := range logTypes {
+ 		for _, path := range logPaths {
+-			conn, err := net.Dial(network, path)
++			conn, err := net.DialTimeout(network, path, connectTimeout)
+ 			if err != nil {
+ 				continue
+ 			} else {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-bootstrap-native_1.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/go/go-bootstrap-native_1.4.bb
new file mode 100644
index 0000000..3d4141e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-bootstrap-native_1.4.bb
@@ -0,0 +1,3 @@
+BOOTSTRAP = "1.4"
+require go-native.inc
+require go-${PV}.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/go/go-common.inc
new file mode 100644
index 0000000..f74b8b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-common.inc
@@ -0,0 +1,22 @@
+SUMMARY = "Go programming language compiler"
+DESCRIPTION = " The Go programming language is an open source project to make \
+ programmers more productive. Go is expressive, concise, clean, and\
+ efficient. Its concurrency mechanisms make it easy to write programs\
+ that get the most out of multicore and networked machines, while its\
+ novel type system enables flexible and modular program construction.\
+ Go compiles quickly to machine code yet has the convenience of\
+ garbage collection and the power of run-time reflection. It's a\
+ fast, statically typed, compiled language that feels like a\
+ dynamically typed, interpreted language."
+
+HOMEPAGE = " http://golang.org/"
+LICENSE = "BSD-3-Clause"
+
+inherit goarch
+
+SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz"
+S = "${WORKDIR}/go"
+B = "${S}"
+
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+SSTATE_SCAN_CMD = "true"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-cross.inc b/import-layers/yocto-poky/meta/recipes-devtools/go/go-cross.inc
new file mode 100644
index 0000000..93206a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-cross.inc
@@ -0,0 +1,18 @@
+inherit cross
+
+DEPENDS += "gcc-cross-${TARGET_ARCH}"
+
+PN = "go-cross-${TARGET_ARCH}"
+
+# Ignore how TARGET_ARCH is computed.
+TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/go-cross:"
+
+GOROOT_FINAL = "${libdir}/go"
+export GOROOT_FINAL
+
+# x32 ABI is not supported on go compiler so far
+COMPATIBLE_HOST_linux-gnux32 = "null"
+# ppc32 is not supported in go compilers
+COMPATIBLE_HOST_powerpc = "null"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-cross_1.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/go/go-cross_1.7.bb
new file mode 100644
index 0000000..56ee084
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-cross_1.7.bb
@@ -0,0 +1,5 @@
+require go-cross.inc
+require go_${PV}.bb
+
+# Go binaries are not understood by the strip tool.
+INHIBIT_SYSROOT_STRIP = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-cross_1.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/go/go-cross_1.8.bb
new file mode 100644
index 0000000..56ee084
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-cross_1.8.bb
@@ -0,0 +1,5 @@
+require go-cross.inc
+require go_${PV}.bb
+
+# Go binaries are not understood by the strip tool.
+INHIBIT_SYSROOT_STRIP = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-native.inc b/import-layers/yocto-poky/meta/recipes-devtools/go/go-native.inc
new file mode 100644
index 0000000..c21f8fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-native.inc
@@ -0,0 +1,56 @@
+inherit native
+
+BOOTSTRAP ?= ""
+export GOOS = "${BUILD_GOOS}"
+export GOARCH = "${BUILD_GOARCH}"
+export GOROOT_FINAL = "${STAGING_LIBDIR_NATIVE}/go${BOOTSTRAP}"
+export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go1.4"
+export CGO_ENABLED = "1"
+
+do_configure[noexec] = "1"
+
+do_compile() {
+	export GOBIN="${B}/bin"
+	rm -rf ${GOBIN}
+	mkdir ${GOBIN}
+
+	export TMPDIR=${WORKDIR}/build-tmp
+	mkdir -p ${WORKDIR}/build-tmp
+
+	cd src
+	CGO_ENABLED=0 ./make.bash --host-only
+}
+
+make_wrapper() {
+	rm -f ${D}${bindir}/$2$3
+	cat <<END >${D}${bindir}/$2$3
+#!/bin/bash
+here=\`dirname \$0\`
+export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go$3\`}"
+\$here/../lib/go$3/bin/$1 "\$@"
+END
+	chmod +x ${D}${bindir}/$2$3
+}
+
+do_install() {
+	install -d ${D}${libdir}/go${BOOTSTRAP}
+	cp -a ${B}/pkg ${D}${libdir}/go${BOOTSTRAP}/
+	install -d ${D}${libdir}/go${BOOTSTRAP}/src
+	(cd ${S}/src; for d in *; do \
+		[ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go${BOOTSTRAP}/src/; \
+	done)
+
+	install -d ${D}${bindir} ${D}${libdir}/go${BOOTSTRAP}/bin
+	for f in ${B}/bin/*
+	do
+		base=`basename $f`
+		install -m755 $f ${D}${libdir}/go${BOOTSTRAP}/bin
+		make_wrapper $base $base ${BOOTSTRAP}
+	done
+}
+
+do_package[noexec] = "1"
+do_packagedata[noexec] = "1"
+do_package_write_ipk[noexec] = "1"
+do_package_write_deb[noexec] = "1"
+do_package_write_rpm[noexec] = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go-native_1.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/go/go-native_1.8.bb
new file mode 100644
index 0000000..182fca2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go-native_1.8.bb
@@ -0,0 +1,3 @@
+require ${PN}.inc
+require go-${PV}.inc
+DEPENDS += "go-bootstrap-native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go.inc b/import-layers/yocto-poky/meta/recipes-devtools/go/go.inc
new file mode 100644
index 0000000..25437dd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go.inc
@@ -0,0 +1,86 @@
+inherit goarch
+DEPENDS += "go-bootstrap-native"
+
+# libgcc is required for the target specific libraries to build
+# properly, but apparently not for go-cross and, more importantly,
+# also can't be used there because go-cross cannot depend on
+# the tune-specific libgcc. Otherwise go-cross also would have
+# to be tune-specific.
+DEPENDS += "${@ 'libgcc' if not oe.utils.inherits(d, 'cross') else ''}"
+
+# Prevent runstrip from running because you get errors when the host arch != target arch
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_SYSROOT_STRIP = "1"
+
+# x32 ABI is not supported on go compiler so far
+COMPATIBLE_HOST_linux-gnux32 = "null"
+# ppc32 is not supported in go compilers
+COMPATIBLE_HOST_powerpc = "null"
+
+export GOHOSTOS = "${BUILD_GOOS}"
+export GOHOSTARCH = "${BUILD_GOARCH}"
+export GOOS = "${TARGET_GOOS}"
+export GOARCH = "${TARGET_GOARCH}"
+export GOARM = "${TARGET_GOARM}"
+export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go1.4"
+export GOROOT_FINAL = "${libdir}/go"
+export CGO_ENABLED = "1"
+export CC_FOR_TARGET = "${CC}"
+export CXX_FOR_TARGET = "${CXX}"
+
+do_configure[noexec] = "1"
+
+do_compile_prepend_class-cross() {
+	export CGO_ENABLED=0
+}
+
+do_compile() {
+	export GOBIN="${B}/bin"
+	export CC="${@d.getVar('BUILD_CC', True).strip()}"
+	rm -rf ${GOBIN} ${B}/pkg
+	mkdir ${GOBIN}
+
+	export TMPDIR=${WORKDIR}/build-tmp
+	mkdir -p ${WORKDIR}/build-tmp
+
+	cd src
+	./make.bash --host-only
+	# Ensure cgo.a is built with the target toolchain
+	export GOBIN="${B}/target/bin"
+	rm -rf ${GOBIN}
+	mkdir -p ${GOBIN}
+	GO_FLAGS="-a" ./make.bash
+}
+
+do_install_class-target() {
+	install -d ${D}${libdir}/go
+	cp -a ${B}/pkg ${D}${libdir}/go/
+	install -d ${D}${libdir}/go/src
+	(cd ${S}/src; for d in *; do \
+		[ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
+	done)
+	install -d ${D}${bindir}
+	if [ -d ${B}/bin/${GOOS}_${GOARCH} ]
+	then
+		install -m 0755 ${B}/bin/${GOOS}_${GOARCH}/* ${D}${bindir}
+	else
+		install -m 0755 ${B}/bin/* ${D}${bindir}
+	fi
+}
+
+do_install_class-cross() {
+	install -d ${D}${libdir}/go
+	cp -a ${B}/pkg ${D}${libdir}/go/
+	install -d ${D}${libdir}/go/src
+	(cd ${S}/src; for d in *; do \
+		[ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
+	done)
+	install -d ${D}${bindir}
+	for f in ${B}/bin/go*
+	do
+		install -m755 $f ${D}${bindir}
+	done
+}
+do_package_qa[noexec] = "1"
+
+RDEPENDS_${PN} += "perl"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go_1.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/go/go_1.6.bb
new file mode 100644
index 0000000..2f59033
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go_1.6.bb
@@ -0,0 +1,4 @@
+require go.inc
+require go-${PV}.inc
+
+BBCLASSEXTEND = "cross"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go_1.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/go/go_1.7.bb
new file mode 100644
index 0000000..e7a6ab2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go_1.7.bb
@@ -0,0 +1,2 @@
+require go-${PV}.inc
+require go.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/go/go_1.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/go/go_1.8.bb
new file mode 100644
index 0000000..091b131
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/go/go_1.8.bb
@@ -0,0 +1,3 @@
+require go-${PV}.inc
+require go.inc
+TUNE_CCARGS_remove = "-march=mips32r2"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch
deleted file mode 100644
index 8e84747..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 76155065c70b5ab65c6c805423183b360141db84 Mon Sep 17 00:00:00 2001
-From: Marek Vasut <marex@denx.de>
-Date: Thu, 28 Jan 2016 04:46:23 +0100
-Subject: [PATCH] Recognize nios2 as compilation target
-
-Signed-off-by: Marek Vasut <marex@denx.de>
-Upstream-Status: Submitted [ http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22480 ]
----
- module/system/base/target.scm | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/module/system/base/target.scm b/module/system/base/target.scm
---- a/module/system/base/target.scm
-+++ b/module/system/base/target.scm
-@@ -65,7 +65,7 @@
-       (cond ((string-match "^i[0-9]86$" cpu)
-              (endianness little))
-             ((member cpu '("x86_64" "ia64"
--                           "powerpcle" "powerpc64le" "mipsel" "mips64el" "sh4"))
-+                           "powerpcle" "powerpc64le" "mipsel" "mips64el" "sh4" "nios2"))
-              (endianness little))
-             ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
-                            "mips" "mips64" "m68k" "s390x"))
-@@ -108,7 +108,7 @@
- 
-           ((string-match "64$" cpu) 8)
-           ((string-match "64_?[lbe][lbe]$" cpu) 8)
--          ((member cpu '("sparc" "powerpc" "mips" "mipsel" "m68k" "sh4")) 4)
-+          ((member cpu '("sparc" "powerpc" "mips" "mipsel" "m68k" "sh4" "nios2")) 4)
-           ((member cpu '("s390x")) 8)
-           ((string-match "^arm.*" cpu) 4)
-           (else (error "unknown CPU word size" cpu)))))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.12.bb b/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.12.bb
deleted file mode 100644
index d2fe511..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.12.bb
+++ /dev/null
@@ -1,121 +0,0 @@
-SUMMARY = "Guile is the GNU Ubiquitous Intelligent Language for Extensions"
-DESCRIPTION = "Guile is the GNU Ubiquitous Intelligent Language for Extensions,\
- the official extension language for the GNU operating system.\
- Guile is a library designed to help programmers create flexible applications.\
- Using Guile in an application allows the application's functionality to be\
- extended by users or other programmers with plug-ins, modules, or scripts.\
- Guile provides what might be described as 'practical software freedom,'\
- making it possible for users to customize an application to meet their\
- needs without digging into the application's internals."
-
-HOMEPAGE = "http://www.gnu.org/software/guile/"
-SECTION = "devel"
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-SRC_URI = "${GNU_MIRROR}/guile/guile-${PV}.tar.xz \
-           file://debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch \
-           file://debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch \
-           file://opensuse/guile-64bit.patch \
-           file://guile_2.0.6_fix_sed_error.patch \
-           file://arm_endianness.patch \
-           file://arm_aarch64.patch \
-           file://workaround-ice-ssa-corruption.patch \
-           file://libguile-Makefile.am-hook.patch \
-           file://0002-Recognize-nios2-as-compilation-target.patch \
-           "
-
-SRC_URI[md5sum] = "081fdf80cd3a76f260a2a0d87f773d6b"
-SRC_URI[sha256sum] = "de8187736f9b260f2fa776ed39b52cb74dd389ccf7039c042f0606270196b7e9"
-
-inherit autotools gettext pkgconfig texinfo
-BBCLASSEXTEND = "native"
-
-DEPENDS = "libunistring bdwgc gmp libtool libffi ncurses readline"
-# add guile-native only to the target recipe's DEPENDS
-DEPENDS_append_class-target = " guile-native libatomic-ops"
-
-# The comment of the script guile-config said it has been deprecated but we should
-# at least add the required dependency to make it work since we still provide the script.
-RDEPENDS_${PN} = "pkgconfig"
-
-RDEPENDS_${PN}_append_libc-glibc_class-target = " glibc-gconv-iso8859-1"
-
-EXTRA_OECONF += "${@['--without-libltdl-prefix --without-libgmp-prefix --without-libreadline-prefix', ''][bb.data.inherits_class('native',d)]}"
-
-EXTRA_OECONF_append_class-target = " --with-libunistring-prefix=${STAGING_LIBDIR} \
-                                     --with-libgmp-prefix=${STAGING_LIBDIR} \
-                                     --with-libltdl-prefix=${STAGING_LIBDIR}"
-EXTRA_OECONF_append_libc-uclibc = " guile_cv_use_csqrt=no "
-
-CFLAGS_append_libc-musl = " -DHAVE_GC_SET_FINALIZER_NOTIFIER \
-	                    -DHAVE_GC_GET_HEAP_USAGE_SAFE \
-	                    -DHAVE_GC_GET_FREE_SPACE_DIVISOR \
-	                    -DHAVE_GC_SET_FINALIZE_ON_DEMAND \
-                           "
-
-do_configure_prepend() {
-	mkdir -p po
-}
-
-export GUILE_FOR_BUILD="${BUILD_SYS}-guile"
-
-do_install_append_class-native() {
-	install -m 0755  ${D}${bindir}/guile ${D}${bindir}/${HOST_SYS}-guile
-
-	create_wrapper ${D}/${bindir}/guile \
-		GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
-		GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
-	create_wrapper ${D}${bindir}/${HOST_SYS}-guile \
-		GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
-		GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
-}
-
-do_install_append_class-target() {
-	# cleanup buildpaths in scripts
-	sed -i -e 's:${STAGING_DIR_NATIVE}::' ${D}${bindir}/guile-config
-	sed -i -e 's:${STAGING_DIR_HOST}::' ${D}${bindir}/guile-snarf
-
-	sed -i -e 's:${STAGING_DIR_TARGET}::g' ${D}${libdir}/pkgconfig/guile-2.0.pc
-}
-
-do_install_append_libc-musl() {
-	rm -f ${D}${libdir}/charset.alias
-}
-
-SYSROOT_PREPROCESS_FUNCS = "guile_cross_config"
-
-guile_cross_config() {
-	# this is only for target recipe
-	if [ "${PN}" = "guile" ]
-	then
-	        # Create guile-config returning target values instead of native values
-	        install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
-        	echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
-			> ${B}/guile-config.cross
-	        sed -n -e 's:^[ \t]*{[ \t]*":  (:' \
-			-e 's:",[ \t]*": . ":' \
-			-e 's:" *}, *\\:"):' \
-			-e 's:^.*cachedir.*$::' \
-			-e '/^  (/p' \
-			< ${B}/libguile/libpath.h >> ${B}/guile-config.cross
-	        echo '))' >> ${B}/guile-config.cross
-	        cat ${B}/meta/guile-config >> ${B}/guile-config.cross
-	        install ${B}/guile-config.cross ${STAGING_BINDIR_CROSS}/guile-config
-	fi
-}
-
-# Guile needs the compiled files to be newer than the source, and it won't
-# auto-compile into the prefix even if it can write there, so touch them here as
-# sysroot is managed.
-SSTATEPOSTINSTFUNCS += "guile_sstate_postinst"
-guile_sstate_postinst() {
-	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
-	then
-                find ${STAGING_DIR_TARGET}/${libdir}/guile/2.0/ccache -type f | xargs touch
-	fi
-}
-
-# http://errors.yoctoproject.org/Errors/Details/20491/
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.14.bb b/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.14.bb
new file mode 100644
index 0000000..7a01d0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.14.bb
@@ -0,0 +1,125 @@
+SUMMARY = "Guile is the GNU Ubiquitous Intelligent Language for Extensions"
+DESCRIPTION = "Guile is the GNU Ubiquitous Intelligent Language for Extensions,\
+ the official extension language for the GNU operating system.\
+ Guile is a library designed to help programmers create flexible applications.\
+ Using Guile in an application allows the application's functionality to be\
+ extended by users or other programmers with plug-ins, modules, or scripts.\
+ Guile provides what might be described as 'practical software freedom,'\
+ making it possible for users to customize an application to meet their\
+ needs without digging into the application's internals."
+
+HOMEPAGE = "http://www.gnu.org/software/guile/"
+SECTION = "devel"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/guile/guile-${PV}.tar.xz \
+           file://debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch \
+           file://debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch \
+           file://opensuse/guile-64bit.patch \
+           file://guile_2.0.6_fix_sed_error.patch \
+           file://arm_endianness.patch \
+           file://arm_aarch64.patch \
+           file://workaround-ice-ssa-corruption.patch \
+           file://libguile-Makefile.am-hook.patch \
+           "
+
+SRC_URI[md5sum] = "c64977c775effd19393364b3018fd8cd"
+SRC_URI[sha256sum] = "e8442566256e1be14e51fc18839cd799b966bc5b16c6a1d7a7c35155a8619d82"
+
+inherit autotools gettext pkgconfig texinfo
+BBCLASSEXTEND = "native"
+
+# Fix "Argument list too long" error when len(TMPDIR) = 410
+acpaths = "-I ./m4"
+
+DEPENDS = "libunistring bdwgc gmp libtool libffi ncurses readline"
+# add guile-native only to the target recipe's DEPENDS
+DEPENDS_append_class-target = " guile-native libatomic-ops"
+
+# The comment of the script guile-config said it has been deprecated but we should
+# at least add the required dependency to make it work since we still provide the script.
+RDEPENDS_${PN} = "pkgconfig"
+
+RDEPENDS_${PN}_append_libc-glibc_class-target = " glibc-gconv-iso8859-1"
+
+EXTRA_OECONF += "${@['--without-libltdl-prefix --without-libgmp-prefix --without-libreadline-prefix', ''][bb.data.inherits_class('native',d)]}"
+
+EXTRA_OECONF_append_class-target = " --with-libunistring-prefix=${STAGING_LIBDIR} \
+                                     --with-libgmp-prefix=${STAGING_LIBDIR} \
+                                     --with-libltdl-prefix=${STAGING_LIBDIR}"
+EXTRA_OECONF_append_libc-uclibc = " guile_cv_use_csqrt=no "
+
+CFLAGS_append_libc-musl = " -DHAVE_GC_SET_FINALIZER_NOTIFIER \
+	                    -DHAVE_GC_GET_HEAP_USAGE_SAFE \
+	                    -DHAVE_GC_GET_FREE_SPACE_DIVISOR \
+	                    -DHAVE_GC_SET_FINALIZE_ON_DEMAND \
+                           "
+
+do_configure_prepend() {
+	mkdir -p po
+}
+
+export GUILE_FOR_BUILD="${BUILD_SYS}-guile"
+
+do_install_append_class-native() {
+	install -m 0755  ${D}${bindir}/guile ${D}${bindir}/${HOST_SYS}-guile
+
+	create_wrapper ${D}/${bindir}/guile \
+		GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
+		GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
+	create_wrapper ${D}${bindir}/${HOST_SYS}-guile \
+		GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
+		GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
+}
+
+do_install_append_class-target() {
+	# cleanup buildpaths in scripts
+	sed -i -e 's:${STAGING_DIR_NATIVE}::' ${D}${bindir}/guile-config
+	sed -i -e 's:${STAGING_DIR_HOST}::' ${D}${bindir}/guile-snarf
+
+	sed -i -e 's:${STAGING_DIR_TARGET}::g' ${D}${libdir}/pkgconfig/guile-2.0.pc
+}
+
+do_install_append_libc-musl() {
+	rm -f ${D}${libdir}/charset.alias
+}
+
+SYSROOT_PREPROCESS_FUNCS = "guile_cross_config"
+
+guile_cross_config() {
+	# this is only for target recipe
+	if [ "${PN}" = "guile" ]
+	then
+	        # Create guile-config returning target values instead of native values
+	        install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
+        	printf '#!%s \\\n--no-auto-compile -e main -s\n!#\n(define %%guile-build-info %s(\n' $(which ${BUILD_SYS}-guile) "'" \
+			> ${B}/guile-config.cross
+	        sed -n -e 's:^[ \t]*{[ \t]*":  (:' \
+			-e 's:",[ \t]*": . ":' \
+			-e 's:" *}, *\\:"):' \
+			-e 's:^.*cachedir.*$::' \
+			-e '/^  (/p' \
+			< ${B}/libguile/libpath.h >> ${B}/guile-config.cross
+	        echo '))' >> ${B}/guile-config.cross
+	        cat ${B}/meta/guile-config >> ${B}/guile-config.cross
+	        install ${B}/guile-config.cross ${STAGING_BINDIR_CROSS}/guile-config
+	fi
+}
+
+# Guile needs the compiled files to be newer than the source, and it won't
+# auto-compile into the prefix even if it can write there, so touch them here as
+# sysroot is managed.
+SSTATEPOSTINSTFUNCS += "guile_sstate_postinst"
+GUILESSTATEDIR = "${COMPONENTS_DIR}/${TUNE_PKGARCH}/${PN}/${libdir}/guile/2.0/ccache"
+GUILESSTATEDIR_class-native = "${COMPONENTS_DIR}/${BUILD_ARCH}/${PN}/${libdir_native}/guile/2.0/ccache"
+guile_sstate_postinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+                find ${GUILESSTATEDIR} -type f | xargs touch
+	fi
+}
+
+# http://errors.yoctoproject.org/Errors/Details/20491/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guilt/files/guilt-bash.patch b/import-layers/yocto-poky/meta/recipes-devtools/guilt/files/guilt-bash.patch
deleted file mode 100644
index 70a439e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/guilt/files/guilt-bash.patch
+++ /dev/null
@@ -1,288 +0,0 @@
-guilt: explicitly call for bash
-
-Running complex guilt stacks of patches/commits can cause interesting
-failures after ~20m of processing, with errors like "Bad substitution".
-
-These have been traced back to having /bin/sh -->  /bin/dash on Ubuntu
-systems.  Putting a shell that actually *works* (such as /bin/bash)
-in as /bin/sh makes the problem go away.  So here we change the guilt
-scripts to explicitly call for bash to ensure we don't have a similar
-issue after deployment.
-
-Upstream-Status: Inappropriate [oe-specific]
-
-Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-
----
- guilt               |    2 +-
- guilt-add           |    2 +-
- guilt-applied       |    2 +-
- guilt-branch        |    2 +-
- guilt-delete        |    2 +-
- guilt-diff          |    2 +-
- guilt-export        |    2 +-
- guilt-files         |    2 +-
- guilt-fold          |    2 +-
- guilt-fork          |    2 +-
- guilt-graph         |    2 +-
- guilt-header        |    2 +-
- guilt-help          |    2 +-
- guilt-import        |    2 +-
- guilt-import-commit |    2 +-
- guilt-init          |    4 ++--
- guilt-new           |    2 +-
- guilt-next          |    2 +-
- guilt-patchbomb     |    2 +-
- guilt-pop           |    2 +-
- guilt-prev          |    2 +-
- guilt-push          |    2 +-
- guilt-rebase        |    2 +-
- guilt-refresh       |    2 +-
- guilt-rm            |    2 +-
- guilt-series        |    2 +-
- guilt-status        |    2 +-
- guilt-top           |    2 +-
- guilt-unapplied     |    2 +-
- 29 files changed, 30 insertions(+), 30 deletions(-)
-
---- a/guilt
-+++ b/guilt
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006-2010
- #
---- a/guilt-add
-+++ b/guilt-add
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-applied
-+++ b/guilt-applied
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-branch
-+++ b/guilt-branch
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2007-2008
- #
---- a/guilt-delete
-+++ b/guilt-delete
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-diff
-+++ b/guilt-diff
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (C) 2007 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
- #
---- a/guilt-export
-+++ b/guilt-export
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Pierre Habouzit, 2007
- #
---- a/guilt-files
-+++ b/guilt-files
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (C) 2007 Yasushi SHOJI <yashi@atmark-techno.com>
- #
---- a/guilt-fold
-+++ b/guilt-fold
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-fork
-+++ b/guilt-fork
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2007
- #
---- a/guilt-graph
-+++ b/guilt-graph
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2007
- #
---- a/guilt-header
-+++ b/guilt-header
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006-2010
- #
---- a/guilt-help
-+++ b/guilt-help
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2007
- #
---- a/guilt-import
-+++ b/guilt-import
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2007
- #
---- a/guilt-import-commit
-+++ b/guilt-import-commit
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2007
- #
---- a/guilt-init
-+++ b/guilt-init
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
-@@ -31,7 +31,7 @@ touch "$GUILT_DIR/$branch/status"
- 
- mkdir -p "$GIT_DIR/hooks/guilt"
- cat > "$GIT_DIR/hooks/guilt/delete" <<EOF
--#!/bin/sh
-+#!/bin/bash
- # Usage: <script> <patch being removed>
- 
- echo "Removing patch '\$1'..."
---- a/guilt-new
-+++ b/guilt-new
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-next
-+++ b/guilt-next
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-patchbomb
-+++ b/guilt-patchbomb
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2007
- #
---- a/guilt-pop
-+++ b/guilt-pop
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-prev
-+++ b/guilt-prev
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-push
-+++ b/guilt-push
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-rebase
-+++ b/guilt-rebase
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2007
- #
---- a/guilt-refresh
-+++ b/guilt-refresh
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-rm
-+++ b/guilt-rm
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-series
-+++ b/guilt-series
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-status
-+++ b/guilt-status
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-top
-+++ b/guilt-top
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
---- a/guilt-unapplied
-+++ b/guilt-unapplied
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
- #
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guilt/guilt-native_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/guilt/guilt-native_git.bb
deleted file mode 100644
index b63c68c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/guilt/guilt-native_git.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-SUMMARY = "quilt-like tool for Git"
-LICENSE = "GPLv2"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=b6f3400dc1a01cebafe8a52b3f344135"
-
-inherit native
-
-SRC_URI = "git://repo.or.cz/guilt.git \
-           file://guilt-bash.patch \
-           "
-PV = "0.35+git${SRCPV}"
-SRCREV = "c2a5bae511c6d5354aa4e1cb59069c31df2b8eeb"
-
-S = "${WORKDIR}/git"
-
-# we don't compile, we just install
-do_compile() {
-	:
-}
-
-do_install() {
-	oe_runmake PREFIX=${D}/${prefix} install
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb
index a7ea3b7..551bdf0 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb
@@ -22,6 +22,7 @@
 
 export PERL = "${bindir}/env perl"
 PERL_class-native = "/usr/bin/env nativeperl"
+PERL_class-nativesdk = "/usr/bin/env perl"
 
 # gettext is assumed to exist on the host
 RDEPENDS_${PN}_class-native = "libxml-parser-perl-native"
@@ -33,4 +34,4 @@
 
 INSANE_SKIP_${PN} += "dev-deps"
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch
new file mode 100644
index 0000000..df3b600
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch
@@ -0,0 +1,77 @@
+From 9522ac8e5d5b20a472f3ffc356d388d36f7f582c Mon Sep 17 00:00:00 2001
+From: marxin <mliska@suse.cz>
+Date: Tue, 21 Mar 2017 08:42:11 +0100
+Subject: [PATCH] Add FALLTHRU comment to handle GCC7 warnings.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+---
+Upstream-Status: Backport [https://github.com/json-c/json-c/commit/014924ba899f659917bb64392bbff7d3c803afc2]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+
+ json_object.c  |  1 +
+ json_tokener.c |  1 +
+ linkhash.c     | 22 +++++++++++-----------
+ 3 files changed, 13 insertions(+), 11 deletions(-)
+
+diff --git a/json_object.c b/json_object.c
+index 6cc73bc..77e8b21 100644
+--- a/json_object.c
++++ b/json_object.c
+@@ -552,6 +552,7 @@ int64_t json_object_get_int64(struct json_object *jso)
+     return jso->o.c_boolean;
+   case json_type_string:
+ 	if (json_parse_int64(jso->o.c_string.str, &cint) == 0) return cint;
++	/* FALLTHRU */
+   default:
+     return 0;
+   }
+diff --git a/json_tokener.c b/json_tokener.c
+index 7fa32ae..b32d657 100644
+--- a/json_tokener.c
++++ b/json_tokener.c
+@@ -306,6 +306,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
+             tok->err = json_tokener_error_parse_unexpected;
+             goto out;
+         }
++	/* FALLTHRU */
+       case '"':
+ 	state = json_tokener_state_string;
+ 	printbuf_reset(tok->pb);
+diff --git a/linkhash.c b/linkhash.c
+index 712c387..74e3b0f 100644
+--- a/linkhash.c
++++ b/linkhash.c
+@@ -376,17 +376,17 @@ static uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
+     /*-------------------------------- last block: affect all 32 bits of (c) */
+     switch(length)                   /* all the case statements fall through */
+     {
+-    case 12: c+=((uint32_t)k[11])<<24;
+-    case 11: c+=((uint32_t)k[10])<<16;
+-    case 10: c+=((uint32_t)k[9])<<8;
+-    case 9 : c+=k[8];
+-    case 8 : b+=((uint32_t)k[7])<<24;
+-    case 7 : b+=((uint32_t)k[6])<<16;
+-    case 6 : b+=((uint32_t)k[5])<<8;
+-    case 5 : b+=k[4];
+-    case 4 : a+=((uint32_t)k[3])<<24;
+-    case 3 : a+=((uint32_t)k[2])<<16;
+-    case 2 : a+=((uint32_t)k[1])<<8;
++    case 12: c+=((uint32_t)k[11])<<24; /* FALLTHRU */
++    case 11: c+=((uint32_t)k[10])<<16; /* FALLTHRU */
++    case 10: c+=((uint32_t)k[9])<<8; /* FALLTHRU */
++    case 9 : c+=k[8]; /* FALLTHRU */
++    case 8 : b+=((uint32_t)k[7])<<24; /* FALLTHRU */
++    case 7 : b+=((uint32_t)k[6])<<16; /* FALLTHRU */
++    case 6 : b+=((uint32_t)k[5])<<8; /* FALLTHRU */
++    case 5 : b+=k[4]; /* FALLTHRU */
++    case 4 : a+=((uint32_t)k[3])<<24; /* FALLTHRU */
++    case 3 : a+=((uint32_t)k[2])<<16; /* FALLTHRU */
++    case 2 : a+=((uint32_t)k[1])<<8; /* FALLTHRU */
+     case 1 : a+=k[0];
+              break;
+     case 0 : return c;
+-- 
+2.14.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c_0.12.bb b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c_0.12.bb
index a15455c..072c092 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c_0.12.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c_0.12.bb
@@ -7,6 +7,7 @@
 SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
            file://0001-json_tokener-requires-INF-and-NAN.patch \
            file://0001-Link-against-libm-when-needed.patch \
+           file://0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch \
           "
 
 SRC_URI[md5sum] = "3ca4bbb881dfc4017e8021b5e0a8c491"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb
index 9b65a99..4ca0e4d 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb
@@ -13,14 +13,15 @@
 SECTION = "devel"
 DEPENDS += "ncurses flex bison gperf-native"
 RDEPENDS_${PN} += "python bash"
-SRC_URI = "http://ymorin.is-a-geek.org/download/${BPN}/${BP}.tar.xz"
+SRC_URI = "git://ymorin.is-a-geek.org/kconfig-frontends"
 
-SRC_URI[md5sum] = "b939280dcc83f8feabd87a1d5f9b00c2"
-SRC_URI[sha256sum] = "ea2615a62c74bea6ce3b38402f00c7513858f307f6ba7aa9fdbf0bbc12bcf407"
+SRCREV = "75d35b172fc0f7b6620dd659af41f2ce04edc4e6"
+
+S = "${WORKDIR}/git"
 
 inherit autotools pkgconfig
 do_configure_prepend () {
-	mkdir -p scripts/.autostuff/m4
+	mkdir -p ${S}/scripts/.autostuff/m4
 }
 
 do_install_append() {
@@ -32,7 +33,7 @@
 
 # Some packages have the version preceeding the .so instead properly
 # versioned .so.<version>, so we need to reorder and repackage.
-SOLIBS = "-${@d.getVar('PV', True)[:-2]}.so"
+SOLIBS = "-${@d.getVar('PV')[:-2]}.so"
 FILES_SOLIBSDEV = "${libdir}/libkconfig-parser.so"
 
 BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
new file mode 100644
index 0000000..26e8b06
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
@@ -0,0 +1,41 @@
+From ff4aae4c8beaf17cb8e7a3431f6c541eccfae244 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:22:09 +0200
+Subject: [PATCH 1/2] Do not set PYTHON_INSTALL_DIR by running python.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ libcomps/src/python/src/python2/CMakeLists.txt | 2 +-
+ libcomps/src/python/src/python3/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libcomps/src/python/src/python2/CMakeLists.txt b/libcomps/src/python/src/python2/CMakeLists.txt
+index 3ad9e18..0e7dd4b 100644
+--- a/libcomps/src/python/src/python2/CMakeLists.txt
++++ b/libcomps/src/python/src/python2/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ find_package (PythonLibs 2.6)
+ find_package (PythonInterp 2.6 REQUIRED)
+ 
+-execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+ 
+ include_directories(${PYTHON_INCLUDE_PATH})
+ include_directories(${LIBCOMPS_INCLUDE_PATH})
+diff --git a/libcomps/src/python/src/python3/CMakeLists.txt b/libcomps/src/python/src/python3/CMakeLists.txt
+index 7fafa9f..ed82d3d 100644
+--- a/libcomps/src/python/src/python3/CMakeLists.txt
++++ b/libcomps/src/python/src/python3/CMakeLists.txt
+@@ -2,7 +2,7 @@ find_package (PythonLibs 3.0)
+ find_package (PythonInterp 3.0)
+ #add_custom_target(py3-copy)
+ 
+-execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+ 
+ include_directories(${PYTHON_INCLUDE_PATH})
+ include_directories(${LIBCOMPS_INCLUDE_PATH})
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps/0001-Make-__comps_objmrtree_all-static-inline.patch b/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps/0001-Make-__comps_objmrtree_all-static-inline.patch
new file mode 100644
index 0000000..88469fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps/0001-Make-__comps_objmrtree_all-static-inline.patch
@@ -0,0 +1,35 @@
+From 91a324f8771818b81017fdf4daaad0c8c4b6987c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 20 Mar 2017 11:38:54 -0700
+Subject: [PATCH] Make __comps_objmrtree_all() static inline
+
+This helps compilers to scope the symbol correctly
+and apply the inlining optimizations, clang e.g.
+emits the functions and calls in code which is
+suboptimal, therefore give a little help to compiler
+this function is not used anywhere else to have
+a global scope.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libcomps/src/comps_objmradix.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcomps/src/comps_objmradix.c b/libcomps/src/comps_objmradix.c
+index 9be6648..55f7793 100644
+--- a/libcomps/src/comps_objmradix.c
++++ b/libcomps/src/comps_objmradix.c
+@@ -604,7 +604,7 @@ inline void comps_objmrtree_pair_destroy_v(void * pair) {
+     free(pair);
+ }
+ 
+-inline COMPS_HSList* __comps_objmrtree_all(COMPS_ObjMRTree * rt, char keyvalpair) {
++static inline COMPS_HSList* __comps_objmrtree_all(COMPS_ObjMRTree * rt, char keyvalpair) {
+     COMPS_HSList *to_process, *ret;
+     COMPS_HSListItem *hsit, *oldit;
+     size_t x;
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps/0002-Set-library-installation-path-correctly.patch b/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps/0002-Set-library-installation-path-correctly.patch
new file mode 100644
index 0000000..ec1fdc4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps/0002-Set-library-installation-path-correctly.patch
@@ -0,0 +1,27 @@
+From b1f61296e2f16c2b9a39c5501e4538628ff01ab4 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:26:00 +0200
+Subject: [PATCH 2/2] Set library installation path correctly
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ libcomps/src/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcomps/src/CMakeLists.txt b/libcomps/src/CMakeLists.txt
+index e553d77..e2eef9c 100644
+--- a/libcomps/src/CMakeLists.txt
++++ b/libcomps/src/CMakeLists.txt
+@@ -52,7 +52,7 @@ add_dependencies(libcomps src-copy)
+ IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+     SET (LIB_SUFFIX "64")
+ ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+-set (LIB_INST_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
++set (LIB_INST_DIR ${CMAKE_INSTALL_LIBDIR})
+ 
+ 
+ install (FILES ${libcomps_HEADERS} DESTINATION include/libcomps)
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps_git.bb
new file mode 100644
index 0000000..e69bf67
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libcomps/libcomps_git.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Libcomps is alternative for yum.comps library (which is for managing rpm package groups)."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "git://github.com/rpm-software-management/libcomps.git \
+           file://0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
+           file://0002-Set-library-installation-path-correctly.patch \
+           file://0001-Make-__comps_objmrtree_all-static-inline.patch \
+           "
+
+PV = "0.1.8+git${SRCPV}"
+SRCREV = "01a4759894cccff64d2561614a58281adf5ce859"
+
+S = "${WORKDIR}/git"
+
+inherit cmake distutils3-base
+
+DEPENDS += "libxml2 expat libcheck"
+
+EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
+OECMAKE_SOURCEPATH = "${S}/libcomps"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch
new file mode 100644
index 0000000..73acda6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch
@@ -0,0 +1,31 @@
+From 9bb7630915c3e787732463a3e2064fe0e177101b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 24 Nov 2016 14:33:07 +0200
+Subject: [PATCH 1/4] FindGtkDoc.cmake: drop the requirement for
+ GTKDOC_SCANGOBJ_WRAPPER
+
+For some reason cmake is not able to find it when building in openembedded,
+and it's bundled with the source code anyway.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ cmake/modules/FindGtkDoc.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/modules/FindGtkDoc.cmake b/cmake/modules/FindGtkDoc.cmake
+index 92b2cc7..39f34bd 100644
+--- a/cmake/modules/FindGtkDoc.cmake
++++ b/cmake/modules/FindGtkDoc.cmake
+@@ -52,7 +52,7 @@ find_program(GTKDOC_MKHTML_EXE gtkdoc-mkhtml PATH "${GLIB_PREFIX}/bin")
+ find_program(GTKDOC_FIXXREF_EXE gtkdoc-fixxref PATH "${GLIB_PREFIX}/bin")
+ 
+ find_package_handle_standard_args(GtkDoc
+-    REQUIRED_VARS GTKDOC_SCAN_EXE GTKDOC_SCANGOBJ_EXE GTKDOC_SCANGOBJ_WRAPPER GTKDOC_MKDB_EXE GTKDOC_MKHTML_EXE GTKDOC_FIXXREF_EXE
++    REQUIRED_VARS GTKDOC_SCAN_EXE GTKDOC_SCANGOBJ_EXE GTKDOC_MKDB_EXE GTKDOC_MKHTML_EXE GTKDOC_FIXXREF_EXE
+     VERSION_VAR GtkDoc_VERSION)
+ 
+ # ::
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch
new file mode 100644
index 0000000..954add6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch
@@ -0,0 +1,28 @@
+From 5958b151a4dbb89114e90c971a34b74f873b7beb Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 7 Feb 2017 12:16:03 +0200
+Subject: [PATCH] Get parameters for both libsolv and libsolvext (libdnf is
+ using both)
+
+Upstream-Status: Pending [depends on whether https://github.com/openSUSE/libsolv/pull/177 is accepted]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b531da1..e512da0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -28,7 +28,7 @@ find_package (PkgConfig REQUIRED)
+ SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
+ PKG_CHECK_MODULES(GLIB gio-unix-2.0>=2.44.0 REQUIRED)
+ FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb)
+-PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv)
++PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv libsolvext)
+ set(LIBSOLV_LIBRARY ${LIBSOLV_LIBRARIES})
+ pkg_check_modules (CHECK REQUIRED check)
+ pkg_check_modules (REPO REQUIRED librepo)
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0002-Prefix-sysroot-path-to-introspection-tools-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0002-Prefix-sysroot-path-to-introspection-tools-path.patch
new file mode 100644
index 0000000..3d772a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0002-Prefix-sysroot-path-to-introspection-tools-path.patch
@@ -0,0 +1,36 @@
+From c8211ad99ccaa4af4a75e0ba639527267fcfd69e Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:17:19 +0200
+Subject: [PATCH 2/4] Prefix sysroot path to introspection tools path.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ libdnf/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libdnf/CMakeLists.txt b/libdnf/CMakeLists.txt
+index 63f07bf..837792b 100644
+--- a/libdnf/CMakeLists.txt
++++ b/libdnf/CMakeLists.txt
+@@ -133,7 +133,7 @@ if (GOBJECT_INTROSPECTION_FOUND)
+         set(GIR_TYPELIB "${GIR_PREFIX}.typelib")
+ 
+         add_custom_command(OUTPUT ${GIR_XML}
+-            COMMAND env CFLAGS=${CMAKE_C_FLAGS} ${GOBJECT_INTROSPECTION_1.0_G_IR_SCANNER}
++            COMMAND env CFLAGS=${CMAKE_C_FLAGS} $ENV{PKG_CONFIG_SYSROOT_DIR}${GOBJECT_INTROSPECTION_1.0_G_IR_SCANNER}
+                     --namespace=Dnf
+                     --nsversion=${DNF_SO_VERSION}.0
+                     --library-path=${CMAKE_CURRENT_BINARY_DIR}
+@@ -153,7 +153,7 @@ if (GOBJECT_INTROSPECTION_FOUND)
+             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ 
+         add_custom_command(OUTPUT ${GIR_TYPELIB}
+-            COMMAND ${GOBJECT_INTROSPECTION_1.0_G_IR_COMPILER}
++            COMMAND $ENV{PKG_CONFIG_SYSROOT_DIR}${GOBJECT_INTROSPECTION_1.0_G_IR_COMPILER}
+                     -o ${GIR_TYPELIB}
+                     ${GIR_XML}
+             DEPENDS ${GIR_XML}
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0003-Set-the-library-installation-directory-correctly.patch b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0003-Set-the-library-installation-directory-correctly.patch
new file mode 100644
index 0000000..d7e59d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0003-Set-the-library-installation-directory-correctly.patch
@@ -0,0 +1,29 @@
+From 8d29879fe3606c78769c1bcdddf0bcfc7191c710 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:20:01 +0200
+Subject: [PATCH 3/4] Set the library installation directory correctly.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d35f0d7..8edb627 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -62,7 +62,9 @@ ADD_DEFINITIONS(-DPACKAGE_VERSION=\\"${LIBDNF_VERSION}\\")
+ IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+   SET (LIB_SUFFIX "64")
+ ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+-SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++#SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
++
+ 
+ ADD_SUBDIRECTORY (libdnf)
+ ENABLE_TESTING()
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch
new file mode 100644
index 0000000..931959b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch
@@ -0,0 +1,29 @@
+From 6d2718b925453f9a6915001f489606eb8e4086c8 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:24:50 +0200
+Subject: [PATCH 4/4] Set libsolv variables with pkg-config (cmake's own module
+ doesn't work properly).
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8edb627..b531da1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -28,7 +28,8 @@ find_package (PkgConfig REQUIRED)
+ SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
+ PKG_CHECK_MODULES(GLIB gio-unix-2.0>=2.44.0 REQUIRED)
+ FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb)
+-find_package (LibSolv 0.6.21 REQUIRED COMPONENTS ext)
++PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv)
++set(LIBSOLV_LIBRARY ${LIBSOLV_LIBRARIES})
+ pkg_check_modules (CHECK REQUIRED check)
+ pkg_check_modules (REPO REQUIRED librepo)
+ FIND_PROGRAM (VALGRIND_PROGRAM NAMES valgrind PATH /usr/bin /usr/local/bin)
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf_git.bb
new file mode 100644
index 0000000..ef28611
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libdnf/libdnf_git.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Library providing simplified C and Python API to libsolv"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = "git://github.com/rpm-software-management/libdnf \
+           file://0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch \
+           file://0002-Prefix-sysroot-path-to-introspection-tools-path.patch \
+           file://0003-Set-the-library-installation-directory-correctly.patch \
+           file://0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch \
+           file://0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch \
+           "
+
+PV = "0.2.3+git${SRCPV}"
+SRCREV = "367545629cc01a8e622890d89bd13d062ce60d7b"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "glib-2.0 libsolv libcheck librepo rpm gtk-doc"
+
+inherit gtk-doc gobject-introspection cmake pkgconfig distutils3-base
+
+EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DWITH_MAN=OFF -DPYTHON_DESIRED=3 \
+                  ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DWITH_GIR=ON', '-DWITH_GIR=OFF', d)} \
+                "
+EXTRA_OECMAKE_append_class-native = " -DWITH_GIR=OFF"
+EXTRA_OECMAKE_append_class-nativesdk = " -DWITH_GIR=OFF"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0001-Correctly-set-the-library-installation-directory.patch b/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0001-Correctly-set-the-library-installation-directory.patch
new file mode 100644
index 0000000..01fea40
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0001-Correctly-set-the-library-installation-directory.patch
@@ -0,0 +1,28 @@
+From 36d87919223db9b054862ad38cdda8d9222a2bab Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:04:35 +0200
+Subject: [PATCH 1/4] Correctly set the library installation directory
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ librepo/CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/librepo/CMakeLists.txt b/librepo/CMakeLists.txt
+index 2fe76d8..5026def 100644
+--- a/librepo/CMakeLists.txt
++++ b/librepo/CMakeLists.txt
+@@ -60,7 +60,8 @@ CONFIGURE_FILE("version.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/version.h" @ONLY)
+ IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+   SET (LIB_SUFFIX "64")
+ ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+-SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++#SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
+ 
+ INSTALL(FILES ${librepo_HEADERS} DESTINATION include/librepo)
+ INSTALL(TARGETS librepo LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch b/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch
new file mode 100644
index 0000000..7138dfc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch
@@ -0,0 +1,41 @@
+From 1570ad33dd7e5d83f3ee80bd104b114709ac1e34 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:05:36 +0200
+Subject: [PATCH 2/4] Do not try to obtain PYTHON_INSTALL_DIR by running
+ python.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ librepo/python/python2/CMakeLists.txt | 2 +-
+ librepo/python/python3/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/librepo/python/python2/CMakeLists.txt b/librepo/python/python2/CMakeLists.txt
+index 3615e17..cffa99f 100644
+--- a/librepo/python/python2/CMakeLists.txt
++++ b/librepo/python/python2/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ FIND_PACKAGE (PythonLibs 2 )
+ FIND_PACKAGE (PythonInterp 2 REQUIRED)
+-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+ INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH})
+ 
+ MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}")
+diff --git a/librepo/python/python3/CMakeLists.txt b/librepo/python/python3/CMakeLists.txt
+index dfecac9..38bcc72 100644
+--- a/librepo/python/python3/CMakeLists.txt
++++ b/librepo/python/python3/CMakeLists.txt
+@@ -10,7 +10,7 @@ message("--- ${PYTHON_INCLUDE_DIR}")
+ 
+ FIND_PACKAGE(PythonLibs 3.0)
+ FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
+-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+ INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH})
+ 
+ MESSAGE(STATUS "Python3 install dir is ${PYTHON_INSTALL_DIR}")
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0003-tests-fix-a-race-when-deleting-temporary-directories.patch b/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0003-tests-fix-a-race-when-deleting-temporary-directories.patch
new file mode 100644
index 0000000..0d2fae4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0003-tests-fix-a-race-when-deleting-temporary-directories.patch
@@ -0,0 +1,41 @@
+From b1a5c92dbd1d11f1afdc094fccea64de334d2783 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:06:24 +0200
+Subject: [PATCH 3/4] tests: fix a race when deleting temporary directories
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ tests/python/tests/test_yum_repo_downloading.py | 2 +-
+ tests/python/tests/test_yum_repo_locating.py    | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/python/tests/test_yum_repo_downloading.py b/tests/python/tests/test_yum_repo_downloading.py
+index ad597dc..4a32519 100644
+--- a/tests/python/tests/test_yum_repo_downloading.py
++++ b/tests/python/tests/test_yum_repo_downloading.py
+@@ -32,7 +32,7 @@ class TestCaseYumRepoDownloading(TestCaseWithFlask):
+             os.environ.pop('GNUPGHOME')
+         else:
+             os.environ['GNUPGHOME'] = self._gnupghome
+-        shutil.rmtree(self.tmpdir)
++        shutil.rmtree(self.tmpdir, True)
+ 
+     def test_download_repo_01(self):
+         h = librepo.Handle()
+diff --git a/tests/python/tests/test_yum_repo_locating.py b/tests/python/tests/test_yum_repo_locating.py
+index 8f4bea5..db4294c 100644
+--- a/tests/python/tests/test_yum_repo_locating.py
++++ b/tests/python/tests/test_yum_repo_locating.py
+@@ -34,7 +34,7 @@ class TestCaseYumRepoLocating(TestCase):
+             os.environ.pop('GNUPGHOME')
+         else:
+             os.environ['GNUPGHOME'] = self._gnupghome
+-        shutil.rmtree(self.tmpdir)
++        shutil.rmtree(self.tmpdir, True)
+ 
+     def test_read_mirrorlist(self):
+         h = librepo.Handle()
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch b/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch
new file mode 100644
index 0000000..6665b31
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo/0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch
@@ -0,0 +1,29 @@
+From a36be8192615e2a1fb5a5856d44565277f15583b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:23:27 +0200
+Subject: [PATCH 4/4] Set gpgme variables with pkg-config, not with cmake
+ module (which doesn't work properly)
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ef07d2d..f1fa09b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -31,7 +31,8 @@ PKG_CHECK_MODULES(GLIB2 glib-2.0 REQUIRED)
+ PKG_SEARCH_MODULE(LIBCRYPTO REQUIRED libcrypto openssl)
+ FIND_PACKAGE(EXPAT REQUIRED)
+ FIND_PACKAGE(CURL REQUIRED)
+-FIND_PACKAGE(Gpgme REQUIRED)
++PKG_CHECK_MODULES(GPGME gpgme REQUIRED)
++set(GPGME_VANILLA_LIBRARIES ${GPGME_LIBRARIES})
+ FIND_PACKAGE(Xattr REQUIRED)
+ 
+ INCLUDE_DIRECTORIES(${GLIB2_INCLUDE_DIRS})
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo_git.bb
new file mode 100644
index 0000000..2f194f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/librepo/librepo_git.bb
@@ -0,0 +1,24 @@
+SUMMARY = " A library providing C and Python (libcURL like) API for downloading linux repository metadata and packages."
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = "git://github.com/rpm-software-management/librepo.git \
+           file://0001-Correctly-set-the-library-installation-directory.patch \
+           file://0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch \
+           file://0003-tests-fix-a-race-when-deleting-temporary-directories.patch \
+           file://0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch \
+           "
+
+PV = "1.7.20+git${SRCPV}"
+SRCREV = "e1137cbbda78fecb192146300790680a5bc811b1"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "curl expat glib-2.0 openssl attr libcheck gpgme"
+
+inherit cmake distutils3-base pkgconfig
+
+EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb
index 8858f6e..06abb05 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb
@@ -11,6 +11,8 @@
     ${datadir}/libtool/build-aux \
 "
 
+ACLOCALEXTRAPATH_class-target = ""
+
 do_install_append () {
         sed -e 's@--sysroot=${STAGING_DIR_HOST}@@g' \
             -e 's@${STAGING_DIR_HOST}@@g' \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb
deleted file mode 100644
index a5deb2e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "Convert LinuxDoc SGML source into other formats"
-HOMEPAGE = "http://packages.debian.org/linuxdoc-tools"
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=077ef64ec3ac257fb0d786531cf26931"
-
-DEPENDS = "groff-native openjade-native"
-
-SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/l/${BPN}/${BPN}_${PV}.orig.tar.gz \
-           file://disable_sgml2rtf.patch \
-           file://disable_txt_doc.patch \
-           file://disable_tex_doc.patch \
-           file://disable_dvips_doc.patch"
-
-SRC_URI[md5sum] = "1d13d500918a7a145b0edc2f16f61dd1"
-SRC_URI[sha256sum] = "7103facee18a2ea97186ca459d743d22f7f89ad4b5cd1dfd1c34f83d6bfd4101"
-
-UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/l/linuxdoc-tools/"
-inherit autotools-brokensep native
-
-do_configure () {
-	oe_runconf
-}
-
-do_install() {
-	oe_runmake 'DESTDIR=${D}' 'TMPDIR=${T}' install
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch
deleted file mode 100644
index 490b367..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Disable building documentation which requires the dvips utility.
-This patch should be dropped once we include a native version of
-dvips.
-
-Upstream-Status: Inappropriate [Other]
-Temporary workaround which disables documentation.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
-diff -urN linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh linuxdoc-tools-0.9.66/doc/Makedoc.sh
---- linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh	2011-02-25 15:26:41.142917782 -0800
-+++ linuxdoc-tools-0.9.66/doc/Makedoc.sh	2011-02-25 15:27:25.141917472 -0800
-@@ -52,13 +52,13 @@
- #	$TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
- #fi
- 
--if [ -n "`which dvips`" ]; then
--	echo "   + dvips" >&2
--	dvips -t letter -o ./guide.ps ./guide.dvi
--	if [ -n "`which gzip`" -a -f ./guide.ps ]; then
--		gzip -fN ./guide.ps
--	fi
--fi
-+#if [ -n "`which dvips`" ]; then
-+#	echo "   + dvips" >&2
-+#	dvips -t letter -o ./guide.ps ./guide.dvi
-+#	if [ -n "`which gzip`" -a -f ./guide.ps ]; then
-+#		gzip -fN ./guide.ps
-+#	fi
-+#fi
- 
- 
- echo "- Building info docs" >&2
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch
deleted file mode 100644
index 50c8a8f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 756f20e70a97ee2dea9b32c0955eabfc27f29be1 Mon Sep 17 00:00:00 2001
-From: Andrei Dinu <andrei.adrianx.dinu@intel.com>
-Date: Wed, 29 May 2013 16:50:17 +0300
-Subject: [PATCH] The build of sgml2rtf is problematic due to the way it wants
- to link to a shared library version of flex. Flex only
- ships with a static lib. Rather than diverging from
- upstream flex, simply skip building this un-needed utility.
-
-Upstream-Status: Inappropriate [Other]
-Workaround which disables a feature.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
----
- Makefile.in |   12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index 359f14e..fc04020 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -40,7 +40,7 @@ perl5lib_ddir      = $(DESTDIR)$(perl5libdir)
- pkgdata_ddir       = $(DESTDIR)$(pkgdatadir)
- tex_ddir           = $(DESTDIR)$(texdir)
- 
--progs    := sgml2html sgml2info sgml2latex sgml2lyx sgml2rtf sgml2txt sgmlcheck
-+progs    := sgml2html sgml2info sgml2latex sgml2lyx sgml2txt sgmlcheck
- 
- PROFILE  =
- INCLUDE  =
-@@ -71,9 +71,9 @@ endif
- 	( cd sgmlpre ; \
- 	  $(MAKE)  CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LEX=flex sgmlpre || exit -1 )
- 
--	@echo "Compiling RTF conversion tools (in rtf-fix/)..."
--	( cd rtf-fix ; \
--	  $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" || exit -1 )
-+#	@echo "Compiling RTF conversion tools (in rtf-fix/)..."
-+#	( cd rtf-fix ; \
-+#	  $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" || exit -1 )
- 
- 	@echo "making man pages in genman ..."
- 	if [ ! -d genman ]; then mkdir genman ; fi
-@@ -117,7 +117,7 @@ endif
- 
- #    -- Install auxiliary programs
- 	mkdir -p $(auxbin_ddir)
--	for ii in sgmlpre/sgmlpre rtf-fix/rtf2rtf; do \
-+	for ii in sgmlpre/sgmlpre; do \
- 	  bn=`basename $$ii`; \
- 	  $(INSTALL_PROGRAM) $$ii $(auxbin_ddir)/$$bn; \
- 	done
-@@ -206,7 +206,7 @@ bin/linuxdoc:: Makefile bin/linuxdoc.in
- 
- clean::
- 	-rm -f *~ bin/*~ bin/linuxdoc
--	for d in $(DDIRS) $(MDIRS) rtf-fix; do $(MAKE) -C $$d clean; done
-+	for d in $(DDIRS) $(MDIRS); do $(MAKE) -C $$d clean; done
- 	(cd sgmlpre ; rm -f sgmlpre.o sgmlpre)
- 	-rm -rf genman/
- 
--- 
-1.7.9.5
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch
deleted file mode 100644
index b62895c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Disable building documentation which requires the latex utility.
-This patch should be dropped once we include a native version of
-latex.
-
-Upstream-Status: Inappropriate [Other]
-Temporary workaround which disables documentation.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
-diff -urN linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh linuxdoc-tools-0.9.66/doc/Makedoc.sh
---- linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh	2009-11-09 11:58:25.000000000 -0800
-+++ linuxdoc-tools-0.9.66/doc/Makedoc.sh	2011-02-25 15:23:58.610016114 -0800
-@@ -46,11 +46,11 @@
- 	$TMPDIR/sgml2txt -b 1 ./guide
- fi
- 
--if [ -n "`which latex`" ]; then
--	ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
--	echo "- Building latex docs" >&2
--	$TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
--fi
-+#if [ -n "`which latex`" ]; then
-+#	ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
-+#	echo "- Building latex docs" >&2
-+#	$TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
-+#fi
- 
- if [ -n "`which dvips`" ]; then
- 	echo "   + dvips" >&2
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch
deleted file mode 100644
index 8d78411..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Disable building txt documentation. This is a temporary workaround,
-as I have found an Ubuntu 10.10 system which throws errors during
-building this that I'd like to ultimately fix. The error manifests
-itself from the end of LinuxDocTools.pm with the following messages
-during do_install:
-
-| - Building txt docs
-| Processing file ./guide
-| troff: fatal error: can't find macro file s
-|  fmt_txt::postASP: Empty output file, error when calling groff. Aborting...
-
-Upstream-Status: Inappropriate [Other]
-Temporary workaround which disables documentation.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
-diff -urN linuxdoc-tools-0.9.66.orig//doc/Makedoc.sh linuxdoc-tools-0.9.66/doc/Makedoc.sh
---- linuxdoc-tools-0.9.66.orig//doc/Makedoc.sh	2009-11-09 11:58:25.000000000 -0800
-+++ linuxdoc-tools-0.9.66/doc/Makedoc.sh	2011-03-04 17:37:24.788923998 -0800
-@@ -40,11 +40,11 @@
- 
- chmod u+x $TMPDIR/linuxdoc
- 
--if [ -n "`which groff`" ]; then
--	ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2txt
--	echo "- Building txt docs" >&2
--	$TMPDIR/sgml2txt -b 1 ./guide
--fi
-+#if [ -n "`which groff`" ]; then
-+#	ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2txt
-+#	echo "- Building txt docs" >&2
-+#	$TMPDIR/sgml2txt -b 1 ./guide
-+#fi
- 
- if [ -n "`which latex`" ]; then
- 	ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.17.inc b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.17.inc
deleted file mode 100644
index 8ea4e04..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.17.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-require m4.inc
-
-EXTRA_OECONF += "--without-libsigsegv-prefix"
-
-LICENSE = "GPLv3"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
-	            file://examples/COPYING;md5=4031593b2166d6c47cae282d944a7ede"
-
-SRC_URI += "file://ac_config_links.patch \
-            file://remove-gets.patch \
-           "
-
-SRC_URI_append_class-target = "\
-           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
-	   "
-SRC_URI[md5sum] = "a5e9954b1dae036762f7b13673a2cf76"
-SRC_URI[sha256sum] = "3ce725133ee552b8b4baca7837fb772940b25e81b2a9dc92537aeaf733538c9e"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.18.inc b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.18.inc
new file mode 100644
index 0000000..d7c8648
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.18.inc
@@ -0,0 +1,22 @@
+require m4.inc
+
+EXTRA_OECONF += "--without-libsigsegv-prefix"
+
+LICENSE = "GPLv3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+	            file://examples/COPYING;md5=4031593b2166d6c47cae282d944a7ede"
+
+SRC_URI += "file://ac_config_links.patch \
+            file://remove-gets.patch \
+           "
+
+SRC_URI_append_class-target = "\
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+	   "
+
+# Fix "Argument list too long" error when len(TMPDIR) = 410
+acpaths = "-I ./m4"
+
+SRC_URI[md5sum] = "a077779db287adf4e12a035029002d28"
+SRC_URI[sha256sum] = "ab2633921a5cd38e48797bf5521ad259bdc4b979078034a3b790d7fec5493fab"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.9.inc b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.9.inc
deleted file mode 100644
index aab2c1e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.9.inc
+++ /dev/null
@@ -1,13 +0,0 @@
-require m4.inc
-
-LICENSE = "GPLv2"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe\
-	file://examples/COPYING;md5=1d49bd61dc590f014cae7173b43e3e5c"
-
-PR = "r2"
-SRC_URI += "file://fix_for_circular_dependency.patch"
-
-SRC_URI[md5sum] = "1ba8e147aff5e79bd2bfb983d86b53d5"
-SRC_URI[sha256sum] = "815ce53853fbf6493617f467389b799208b1ec98296b95be44a683f8bcfd7c47"
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-native_1.4.17.bb b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-native_1.4.18.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/m4/m4-native_1.4.17.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/m4/m4-native_1.4.18.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch
deleted file mode 100644
index 9877453..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-Upstream-Status: Inappropriate [licensing]
-
-The older GPLv2 m4 does not work well with newer autoconf. It causes the 
-circular dependency as seen bellow.
-  Removing this m4 file which was needed only forl older autoconf
-
-| configure.ac:34: error: AC_REQUIRE: circular dependency of AC_GNU_SOURCE
-| /build_disk/poky_build/build1/tmp/work/i586-poky-linux/m4-1.4.9-r0/m4-1.4.9/m4/extensions.m4:19: AC_USE_SYSTEM_EXTENSIONS is expanded from...
-| ../../lib/autoconf/specific.m4:310: AC_GNU_SOURCE is expanded from...
-| /build_disk/poky_build/build1/tmp/work/i586-poky-linux/m4-1.4.9-r0/m4-1.4.9/m4/gnulib-comp.m4:21: M4_EARLY is expanded from...
-| configure.ac:34: the top level
-| autom4te: /build_disk/poky_build/build1/tmp/sysroots/x86_64-linux/usr/bin/m4 failed with exit status: 1
-| aclocal: /build_disk/poky_build/build1/tmp/sysroots/x86_64-linux/usr/bin/autom4te failed with exit status: 1
-| autoreconf: aclocal failed with exit status: 1
-
-Nitin A Kamble <nitin.a.kamble@intel.com>
-2011/03/16
-
-Index: m4-1.4.9/m4/extensions.m4
-===================================================================
---- m4-1.4.9.orig/m4/extensions.m4
-+++ m4-1.4.9/m4/extensions.m4
-@@ -6,53 +6,10 @@
- # gives unlimited permission to copy and/or distribute it,
- # with or without modifications, as long as this notice is preserved.
- 
--# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
--# Autoconf.  Perhaps we can remove this once we can assume Autoconf
--# 2.61 or later everywhere, but since CVS Autoconf mutates rapidly
--# enough in this area it's likely we'll need to redefine
--# AC_USE_SYSTEM_EXTENSIONS for quite some time.
--
--# AC_USE_SYSTEM_EXTENSIONS
--# ------------------------
--# Enable extensions on systems that normally disable them,
--# typically due to standards-conformance issues.
--AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
--[
--  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
--  AC_BEFORE([$0], [AC_RUN_IFELSE])
--
--  AC_REQUIRE([AC_GNU_SOURCE])
--  AC_REQUIRE([AC_AIX])
--  AC_REQUIRE([AC_MINIX])
--
--  AH_VERBATIM([__EXTENSIONS__],
--[/* Enable extensions on Solaris.  */
--#ifndef __EXTENSIONS__
--# undef __EXTENSIONS__
--#endif
--#ifndef _POSIX_PTHREAD_SEMANTICS
--# undef _POSIX_PTHREAD_SEMANTICS
--#endif
--#ifndef _TANDEM_SOURCE
--# undef _TANDEM_SOURCE
--#endif])
--  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
--    [ac_cv_safe_to_define___extensions__],
--    [AC_COMPILE_IFELSE(
--       [AC_LANG_PROGRAM([
--#	  define __EXTENSIONS__ 1
--	  AC_INCLUDES_DEFAULT])],
--       [ac_cv_safe_to_define___extensions__=yes],
--       [ac_cv_safe_to_define___extensions__=no])])
--  test $ac_cv_safe_to_define___extensions__ = yes &&
--    AC_DEFINE([__EXTENSIONS__])
--  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
--  AC_DEFINE([_TANDEM_SOURCE])
--])
- 
- # gl_USE_SYSTEM_EXTENSIONS
- # ------------------------
- # Enable extensions on systems that normally disable them,
- # typically due to standards-conformance issues.
- AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
--  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
-+  [])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/remove-gets.patch b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/remove-gets.patch
index effb353..abe82f3 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/remove-gets.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/remove-gets.patch
@@ -4,20 +4,21 @@
 
 Upstream-Status: Pending
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Index: m4-1.4.17/lib/stdio.in.h
-===================================================================
---- m4-1.4.17.orig/lib/stdio.in.h	2013-10-16 14:41:01.678496227 +0300
-+++ m4-1.4.17/lib/stdio.in.h	2013-10-16 14:41:48.849427839 +0300
-@@ -717,10 +717,12 @@
+---
+diff --git a/lib/stdio.in.h b/lib/stdio.in.h
+index 5727452..f04a691 100644
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -742,10 +742,12 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
  /* It is very rare that the developer ever has full control of stdin,
     so any use of gets warrants an unconditional warning; besides, C11
     removed it.  */
 +#if defined gets
  #undef gets
- #if HAVE_RAW_DECL_GETS
+ #if HAVE_RAW_DECL_GETS && !defined __cplusplus
  _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
  #endif
 +#endif
  
- 
  #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
+ struct obstack;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.17.bb b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.18.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.17.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.18.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.9.bb
deleted file mode 100644
index b12c0ad..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.9.bb
+++ /dev/null
@@ -1,3 +0,0 @@
-require m4-${PV}.inc
-
-BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch
deleted file mode 100644
index 102fe79..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Upstream-Status: Pending
-
-automake 1.12 has depricated automatic de-ANSI-fication support
-
-this patch avoids these kinds of errors:
-
-| configure.in:48: error: automatic de-ANSI-fication support has been removed
-...
-| Makefile.am:19: error: automatic de-ANSI-fication support has been removed
-| autoreconf: automake failed with exit status: 1
-| ERROR: autoreconf execution failed.
-
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
-2012/05/04
-
-Index: make-3.81/configure.in
-===================================================================
---- make-3.81.orig/configure.in
-+++ make-3.81/configure.in
-@@ -44,9 +44,6 @@ AC_AIX
- AC_ISC_POSIX
- AC_MINIX
- 
--# Needed for ansi2knr
--AM_C_PROTOTYPES
--
- # Enable gettext, in "external" mode.
- 
- AM_GNU_GETTEXT_VERSION(0.14.1)
-Index: make-3.81/Makefile.am
-===================================================================
---- make-3.81.orig/Makefile.am
-+++ make-3.81/Makefile.am
-@@ -16,7 +16,7 @@
- # GNU Make; see the file COPYING.  If not, write to the Free Software
- # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- 
--AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news ansi2knr
-+AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news
- ACLOCAL_AMFLAGS	=  -I config
- 
- MAKE_HOST =	@MAKE_HOST@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/makeinfo.patch b/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/makeinfo.patch
deleted file mode 100644
index 5dd7604..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/makeinfo.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Allow docs to build with makeinfo 5.X, fixing the error:
-
-doc/make.texi:8165: @itemx must follow @item
-
-Upstream-Status: Backport
-
-RP
-2014/03/29
-
-Index: make-3.81/doc/make.texi
-===================================================================
---- make-3.81.orig/doc/make.texi	2006-04-01 06:36:40.000000000 +0000
-+++ make-3.81/doc/make.texi	2014-03-29 09:39:51.007727012 +0000
-@@ -8162,7 +8162,7 @@
- rarely need to specify this option since @samp{make} does it for you;
- see @ref{-w Option, ,The @samp{--print-directory} Option}.)
- 
--@itemx --no-print-directory
-+@item --no-print-directory
- @cindex @code{--no-print-directory}
- Disable printing of the working directory under @code{-w}.
- This option is useful when @code{-w} is turned on automatically,
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/make/make_3.81.bb b/import-layers/yocto-poky/meta/recipes-devtools/make/make_3.81.bb
deleted file mode 100644
index b8a79b0..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/make/make_3.81.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-PR = "r1"
-
-LICENSE = "GPLv2 & LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=361b6b837cad26c6900a926b62aada5f \
-                    file://tests/COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
-                    file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
-
-require make.inc
-
-SRC_URI += "file://make_fix_for_automake-1.12.patch"
-SRC_URI += "file://makeinfo.patch"
-
-SRC_URI[md5sum] = "354853e0b2da90c527e35aabb8d6f1e6"
-SRC_URI[sha256sum] = "f3e69023771e23908f5d5592954d8271d3d6af09693cecfd29cee6fde8550dc8"
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch
index 756a65c..be54754 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch
@@ -3,8 +3,11 @@
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 Upstream-Status: Pending
 ---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
 diff --git a/configure.ac b/configure.ac
-index d1acc36..6f865b0 100644
+index 0f2ac72..f9099a2 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -62,7 +62,7 @@ AC_CHECK_PROG([RPM],   rpm,   rpm,   [], [$PATH])
@@ -16,15 +19,15 @@
  
  dnl Find the default programs
  if test "with_default" != no ; then
-@@ -175,7 +175,7 @@ fi
- 
+@@ -176,7 +176,7 @@ fi
  dnl ---Output variables...
  
--HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)"
-+HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS) $CFLAGS"
+ CFLAGS="${CFLAGS:--O2} -Wall \$(CPPFLAGS)"
+-HOST_CFLAGS="${HOST_CFLAGS:--O2} -Wall \$(HOST_CPPFLAGS)"
++HOST_CFLAGS="${HOST_CFLAGS:--O2} -Wall \$(HOST_CPPFLAGS) $CFLAGS"
  
  dnl TODO: figure out how to set these appropriately for compilers other than gcc
  I386_CFLAGS="$I386_CFLAGS -Os -ffreestanding -Wall -W -Wno-format \$(I386_CPPFLAGS)"
 -- 
-1.7.10.4
+2.7.4
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.41.bb b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.41.bb
deleted file mode 100644
index b3c1b5b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.41.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "Shared library optimisation tool"
-DESCRIPTION = "mklibs produces cut-down shared libraries that contain only the routines required by a particular set of executables."
-HOMEPAGE = "https://launchpad.net/mklibs"
-SECTION = "devel"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://debian/copyright;md5=98d31037b13d896e33890738ef01af64"
-DEPENDS = "python-native"
-
-SRC_URI = "http://snapshot.debian.org/archive/debian/20160207T221625Z/pool/main/m/${BPN}/${BPN}_${PV}.tar.xz \
-	file://ac_init_fix.patch\
-	file://fix_STT_GNU_IFUNC.patch\
-	file://sysrooted-ldso.patch \
-	file://avoid-failure-on-symbol-provided-by-application.patch \
-	file://show-GNU-unique-symbols-as-provided-symbols.patch \
-	file://fix_cross_compile.patch \
-"
-
-SRC_URI[md5sum] = "6b2979876a611717df3d49e7f9cf291d"
-SRC_URI[sha256sum] = "058c7349f8ec8a03b529c546a95cd6426741bd819f1e1211f499273eb4bf5d89"
-
-inherit autotools gettext native pythonnative
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.43.bb b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.43.bb
new file mode 100644
index 0000000..b9c6c6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.43.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Shared library optimisation tool"
+DESCRIPTION = "mklibs produces cut-down shared libraries that contain only the routines required by a particular set of executables."
+HOMEPAGE = "https://launchpad.net/mklibs"
+SECTION = "devel"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=98d31037b13d896e33890738ef01af64"
+DEPENDS = "python-native"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20161123T152011Z/pool/main/m/mklibs/mklibs_${PV}.tar.xz \
+	file://ac_init_fix.patch\
+	file://fix_STT_GNU_IFUNC.patch\
+	file://sysrooted-ldso.patch \
+	file://avoid-failure-on-symbol-provided-by-application.patch \
+	file://show-GNU-unique-symbols-as-provided-symbols.patch \
+	file://fix_cross_compile.patch \
+"
+
+SRC_URI[md5sum] = "39b08a173454e5210ab3f598e94179bf"
+SRC_URI[sha256sum] = "6f0cf24ade13fff76e943c003413d85c3e497c984c95c1ecea1c9731ca86f13c"
+
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/m/mklibs/"
+
+inherit autotools gettext native pythonnative
+
+S = "${WORKDIR}/mklibs"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mmc/mmc-utils_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/mmc/mmc-utils_git.bb
index 0a8da19..7858819 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mmc/mmc-utils_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mmc/mmc-utils_git.bb
@@ -4,7 +4,7 @@
 LIC_FILES_CHKSUM = "file://mmc.c;beginline=1;endline=20;md5=fae32792e20f4d27ade1c5a762d16b7d"
 
 SRCBRANCH ?= "master"
-SRCREV = "bb779acfc385d135b32a6998c1d1fceef0491400"
+SRCREV = "2cb6695e8dec00d887bdd5309d1b57d836fcd214"
 
 PV = "0.1"
 
@@ -13,8 +13,8 @@
 S = "${WORKDIR}/git"
 
 CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
-CFLAGS_append_mips64 = " -D__SANE_USERSPACE_TYPES__"
-CFLAGS_append_mips64n32 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mipsarchn32 = " -D__SANE_USERSPACE_TYPES__"
 
 do_install() {
     install -d ${D}${bindir}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
index 305be52..bf3f98f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
@@ -1,21 +1,20 @@
-From e16fa28bc57c29923ab60af2ac343da83e1992d8 Mon Sep 17 00:00:00 2001
+From 4dab9bed1033f797ef9b482c77342fe3fe26d0be Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Tue, 6 Oct 2015 23:51:34 +0000
 Subject: [PATCH] Fix build with musl
 
-Upstream-Status: Pending
+Upstream-Status: Backport
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
 ---
- mkfs.jffs2.c  | 44 ++++++++++++++++++++++++++++++++++++++++++--
- recv_image.c  |  1 -
- serve_image.c |  1 -
- 3 files changed, 42 insertions(+), 4 deletions(-)
+ jffsX-utils/mkfs.jffs2.c | 1 +
+ 1 file changed, 1 insertion(+)
 
-diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c
-index f09c0b2..ed2dc43 100644
---- a/mkfs.jffs2.c
-+++ b/mkfs.jffs2.c
+diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c
+index 5446a16..ca5e0d5 100644
+--- a/jffsX-utils/mkfs.jffs2.c
++++ b/jffsX-utils/mkfs.jffs2.c
 @@ -72,6 +72,7 @@
  #include <byteswap.h>
  #include <crc32.h>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
index 7d783e7..853de6a 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
@@ -1,11 +1,48 @@
-Replace rpmatch() usage with checking first character of line
+From 82839c3c0371ca2a1643a99d7d01f5bc1c850b28 Mon Sep 17 00:00:00 2001
+From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+Date: Thu, 2 Mar 2017 11:40:36 +0100
+Subject: [PATCH] Replace rpmatch() usage with checking first character of line
 
-Upstream-Status: Pending
+This is based on the patch from Khem Raj used by openembedded. In
+addition to the original patch, this also removes the fallback
+implementation that was provided for C libraries that don't implement
+rpmatch.
+
+Upstream-Status: Backport
+
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+---
+ include/common.h | 25 ++++++-------------------
+ 1 file changed, 6 insertions(+), 19 deletions(-)
 
+diff --git a/include/common.h b/include/common.h
+index d0c706d..d609257 100644
 --- a/include/common.h
 +++ b/include/common.h
-@@ -122,10 +122,12 @@
+@@ -129,21 +129,6 @@ extern "C" {
+ 	fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \
+ } while(0)
+ 
+-/* uClibc versions before 0.9.34 and musl don't have rpmatch() */
+-#if defined(__UCLIBC__) && \
+-		(__UCLIBC_MAJOR__ == 0 && \
+-		(__UCLIBC_MINOR__ < 9 || \
+-		(__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 34))) || \
+-	!defined(__GLIBC__)
+-#undef rpmatch
+-#define rpmatch __rpmatch
+-static inline int __rpmatch(const char *resp)
+-{
+-    return (resp[0] == 'y' || resp[0] == 'Y') ? 1 :
+-	(resp[0] == 'n' || resp[0] == 'N') ? 0 : -1;
+-}
+-#endif
+-
+ /**
+  * prompt the user for confirmation
+  */
+@@ -164,10 +149,12 @@ static inline bool prompt(const char *msg, bool def)
  		}
  
  		if (strcmp("\n", line) != 0) {
@@ -22,3 +59,5 @@
  				puts("unknown response; please try again");
  				continue;
  			}
+-- 
+2.6.1
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
index 57d6a30..0e3776a 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
@@ -1,7 +1,7 @@
 Upstream-Status: Pending
 
 --- /tmp/mkfs.jffs2.c	2009-01-11 15:28:41.000000000 +0100
-+++ git/mkfs.jffs2.c	2009-01-11 15:59:29.000000000 +0100
++++ git/jffsX-utils/mkfs.jffs2.c	2009-01-11 15:59:29.000000000 +0100
 @@ -100,6 +100,11 @@
  	struct rb_node hardlink_rb;
  };
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
index 05f1629..6fc594f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
@@ -1,16 +1,25 @@
-Upstream-Status: Pending
+From 7d026a85946a08b8167dcd792ea6660bf6a49e08 Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+Date: Thu, 2 Mar 2017 10:43:56 +0100
+Subject: [PATCH] Fix alignment trap triggered by NEON instructions
 
 NEON instruction VLD1.64 was used to copy 64 bits data after type
 casting, and they will trigger alignment trap.
 This patch uses memcpy to avoid alignment problem.
 
-Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+Upstream-Status: Backport
 
-diff --git a/mkfs.ubifs/key.h b/mkfs.ubifs/key.h
-index d3a02d4..e7e9218 100644
---- a/mkfs.ubifs/key.h
-+++ b/mkfs.ubifs/key.h
-@@ -141,10 +141,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
+Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+---
+ ubifs-utils/mkfs.ubifs/key.h | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/ubifs-utils/mkfs.ubifs/key.h b/ubifs-utils/mkfs.ubifs/key.h
+index 39379fd..118858b 100644
+--- a/ubifs-utils/mkfs.ubifs/key.h
++++ b/ubifs-utils/mkfs.ubifs/key.h
+@@ -159,10 +159,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
   */
  static inline void key_write(const union ubifs_key *from, void *to)
  {
@@ -26,7 +35,7 @@
  	memset(to + 8, 0, UBIFS_MAX_KEY_LEN - 8);
  }
  
-@@ -156,10 +158,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
+@@ -174,10 +176,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
   */
  static inline void key_write_idx(const union ubifs_key *from, void *to)
  {
@@ -42,3 +51,5 @@
  }
  
  /**
+-- 
+2.6.1
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
index 7207cfc..0f42e73 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
@@ -49,8 +49,8 @@
 
 diff --git a/flash_erase.c b/flash_erase.c
 index 933373a..4b9d84b 100644
---- a/flash_erase.c
-+++ b/flash_erase.c
+--- a/misc-utils/flash_erase.c
++++ b/misc-utils/flash_erase.c
 @@ -99,6 +99,7 @@ int main(int argc, char *argv[])
  	bool isNAND;
  	int error = 0;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
index 8a3afaf..4fbc54f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -5,26 +5,27 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
                     file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
 
+inherit autotools pkgconfig
+
 DEPENDS = "zlib lzo e2fsprogs util-linux"
 
-PV = "1.5.2"
+PV = "2.0.0"
 
-SRCREV = "aea36417067dade75192bafa03af70b6eb2677b1"
+SRCREV = "1bfee8660131fca7a18f68e9548a18ca6b3378a0"
 SRC_URI = "git://git.infradead.org/mtd-utils.git \
            file://add-exclusion-to-mkfs-jffs2-git-2.patch \
            file://fix-armv7-neon-alignment.patch \
            file://mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch \
            file://0001-Fix-build-with-musl.patch \
+           file://010-fix-rpmatch.patch \
 "
 
-SRC_URI_append_libc-musl = " file://010-fix-rpmatch.patch "
-
 S = "${WORKDIR}/git/"
 
 # xattr support creates an additional compile-time dependency on acl because
 # the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
 # regardless whether acl is enabled or disabled in the distro should be okay.
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'xattr', d)}"
 PACKAGECONFIG[xattr] = ",,acl,"
 
 EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' 'BUILDDIR=${S}'"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch
deleted file mode 100644
index cb45491..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Upstream-Status: Backport
-
-Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
-Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
----
- Makefile.in | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/Makefile.in b/Makefile.in
-index 8f9305a..694e837 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -251,6 +251,7 @@ install-scripts: ${DESTDIR}$(bindir)/mtools
- 	@$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
- 	@for j in $(SCRIPTS) ; do \
- 		$(INSTALL_SCRIPT) $(srcdir)/scripts/$$j ${DESTDIR}$(bindir)/$$j ; \
-+		$(INSTALL_PROGRAM) $(srcdir)/scripts/$$j ${DESTDIR}$(bindir)/$$j ; \
- 		echo ${DESTDIR}$(bindir)/$$j ; \
- 	done
- 	rm -f ${DESTDIR}$(bindir)/lz
--- 
-2.0.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools.patch
deleted file mode 100644
index 15a3208..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-$NetBSD: patch-aa,v 1.10 2007/08/17 20:55:34 joerg Exp $
-
----
- Makefile.in |   74 ++++++++++++++++++++++++++----------------------------------
- 1 file changed, 33 insertions(+), 41 deletions(-)
-
-Upstream-Status: Inappropriate [licensing]
-
-Index: mtools-3.9.9/Makefile.in
-===================================================================
---- mtools-3.9.9.orig/Makefile.in	2007-10-12 11:18:46.000000000 +0100
-+++ mtools-3.9.9/Makefile.in	2007-10-12 11:28:14.000000000 +0100
-@@ -195,30 +195,22 @@ html: mtools.html mtools_toc.html
- 
- # Don't cd, to avoid breaking install-sh references.
- install-info: info
--	$(top_srcdir)/mkinstalldirs $(infodir)
-+	$(top_srcdir)/mkinstalldirs ${DESTDIR}$(infodir)
- 	if test -f mtools.info; then \
- 	  for i in mtools.info*; do \
--	    $(INSTALL_DATA) $$i $(infodir)/$$i; \
-+	    $(INSTALL_DATA) $$i ${DESTDIR}$(infodir)/$$i; \
- 	  done; \
- 	else \
- 	  for i in $(srcdir)/mtools.info*; do \
--	    $(INSTALL_DATA) $$i $(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
-+	    $(INSTALL_DATA) $$i ${DESTDIR}$(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
- 	  done; \
- 	fi; \
--	if [ -n "$(INSTALL_INFO)" ] ; then \
--		if [ -f $(infodir)/dir.info ] ; then \
--			$(INSTALL_INFO) $(infodir)/mtools.info $(infodir)/dir.info; \
--		fi; \
--		if [ -f $(infodir)/dir ] ; then \
--			$(INSTALL_INFO) $(infodir)/mtools.info $(infodir)/dir; \
--		fi; \
--	fi
- 
- uninstall-info:
- 	cd $(infodir) && rm -f mtools.info*
- 
--install:	$(bindir)/mtools @BINFLOPPYD@ install-man install-links \
--		$(bindir)/mkmanifest install-scripts install-info
-+install:	${DESTDIR}$(bindir)/mtools ${DESTDIR}$(bindir)/floppyd install-man install-links \
-+		${DESTDIR}$(bindir)/mkmanifest install-scripts install-info
- 
- uninstall:	uninstall-bin uninstall-man uninstall-links \
- 		uninstall-scripts
-@@ -228,52 +220,52 @@ distclean: clean texclean
- maintainer-clean: distclean
- 
- 
--$(bindir)/floppyd: floppyd
--	$(top_srcdir)/mkinstalldirs $(bindir)
--	$(INSTALL_PROGRAM) floppyd $(bindir)/floppyd
-+${DESTDIR}$(bindir)/floppyd: floppyd
-+	$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
-+	$(INSTALL_PROGRAM) floppyd ${DESTDIR}$(bindir)/floppyd
- 
--$(bindir)/floppyd_installtest: floppyd_installtest
--	$(top_srcdir)/mkinstalldirs $(bindir)
--	$(INSTALL_PROGRAM) floppyd_installtest $(bindir)/floppyd_installtest
-+${DESTDIR}$(bindir)/floppyd_installtest: floppyd_installtest
-+	$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
-+	$(INSTALL_PROGRAM) floppyd_installtest ${DESTDIR}$(bindir)/floppyd_installtest
- 
--$(bindir)/mtools: mtools
--	$(top_srcdir)/mkinstalldirs $(bindir)
--	$(INSTALL_PROGRAM) mtools $(bindir)/mtools
-+${DESTDIR}$(bindir)/mtools: mtools
-+	$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
-+	$(INSTALL_PROGRAM) mtools ${DESTDIR}$(bindir)/mtools
- 
--$(bindir)/mkmanifest: mkmanifest
--	$(top_srcdir)/mkinstalldirs $(bindir)
--	$(INSTALL_PROGRAM) mkmanifest $(bindir)/mkmanifest
-+${DESTDIR}$(bindir)/mkmanifest: mkmanifest
-+	$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
-+	$(INSTALL_PROGRAM) mkmanifest ${DESTDIR}$(bindir)/mkmanifest
- 
- #$(ETCDIR)/mtools: mtools.etc
- #	cp mtools.etc $(ETCDIR)/mtools
- 
--install-links: $(bindir)/mtools
-+install-links: ${DESTDIR}$(bindir)/mtools
- 	@for j in $(LINKS); do \
--		rm -f $(bindir)/$$j ; \
--		$(LN_S) mtools $(bindir)/$$j ; \
--		echo $(bindir)/$$j ; \
-+		rm -f ${DESTDIR}$(bindir)/$$j ; \
-+		$(LN_S) mtools ${DESTDIR}$(bindir)/$$j ; \
-+		echo ${DESTDIR}$(bindir)/$$j ; \
- 	done
- 
- ## "z" is the older version of "gz"; the name is just *too* short
--install-scripts: $(bindir)/mtools
--	@$(top_srcdir)/mkinstalldirs $(bindir)
-+install-scripts: ${DESTDIR}$(bindir)/mtools
-+	@$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
- 	@for j in $(SCRIPTS) ; do \
--		$(INSTALL_PROGRAM) $(srcdir)/scripts/$$j $(bindir)/$$j ; \
--		echo $(bindir)/$$j ; \
-+		$(INSTALL_SCRIPT) $(srcdir)/scripts/$$j ${DESTDIR}$(bindir)/$$j ; \
-+		echo ${DESTDIR}$(bindir)/$$j ; \
- 	done
--	rm -f $(bindir)/lz
--	$(LN_S) uz $(bindir)/lz
-+	rm -f ${DESTDIR}$(bindir)/lz
-+	$(LN_S) uz ${DESTDIR}$(bindir)/lz
- 
- install-man:
--	@$(top_srcdir)/mkinstalldirs $(MAN1DIR)
-+	@$(top_srcdir)/mkinstalldirs ${DESTDIR}$(MAN1DIR)
- 	@for j in $(MAN1); do \
--		$(INSTALL_DATA) $(srcdir)/$$j $(MAN1DIR)/$$j ; \
--		echo $(MAN1DIR)/$$j ; \
-+		$(INSTALL_DATA) $(srcdir)/$$j ${DESTDIR}$(MAN1DIR)/$$j ; \
-+		echo ${DESTDIR}$(MAN1DIR)/$$j ; \
- 	done
--	@$(top_srcdir)/mkinstalldirs $(MAN5DIR)
-+	@$(top_srcdir)/mkinstalldirs ${DESTDIR}$(MAN5DIR)
- 	@for j in $(MAN5); do \
--		$(INSTALL_DATA) $(srcdir)/$$j $(MAN5DIR)/$$j ; \
--		echo $(MAN5DIR)/$$j ; \
-+		$(INSTALL_DATA) $(srcdir)/$$j ${DESTDIR}$(MAN5DIR)/$$j ; \
-+		echo ${DESTDIR}$(MAN5DIR)/$$j ; \
- 	done
- 
- uninstall-bin:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.patch
deleted file mode 100644
index 705b629..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.patch
+++ /dev/null
@@ -1,21 +0,0 @@
----
- Makefile.in |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Upstream-Status: Inappropriate [licensing]
-
---- mtools-3.9.9.orig/Makefile.in
-+++ mtools-3.9.9/Makefile.in
-@@ -128,11 +128,11 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
- X_PRE_LIBS = @X_PRE_LIBS@
- CFLAGS = $(CPPFLAGS) $(DEFS) $(MYCFLAGS) -I. @extraincludedir@ -I@srcdir@ $(USERCFLAGS) 
- CXXFLAGS  = $(CPPFLAGS) $(DEFS) $(MYCXXFLAGS) -I. @extraincludedir@ -I@srcdir@ $(USERCFLAGS) 
- LINK      = $(CC) $(LDFLAGS) $(USERLDFLAGS) @extralibdir@
- ALLLIBS   = $(USERLDLIBS) $(MACHDEPLIBS) $(SHLIB) $(LIBS)
--X_LDFLAGS = $(X_EXTRA_LIBS) $(X_LIBS) $(X_PRE_LIBS) -lXau -lX11 $(LIBS) 
-+X_LDFLAGS = $(X_EXTRA_LIBS) $(X_LIBS) $(X_PRE_LIBS) $(LIBS)
- X_CCFLAGS = $(X_CFLAGS) $(CFLAGS)
- 
- all:    mtools $(LINKS) mkmanifest @FLOPPYD@
- 
- %.o: %.c
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_3.9.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_3.9.9.bb
deleted file mode 100644
index 2904ff4..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_3.9.9.bb
+++ /dev/null
@@ -1,55 +0,0 @@
-SUMMARY = "Utilities to access MS-DOS disks without mounting them"
-DESCRIPTION = "Mtools is a collection of utilities to access MS-DOS disks from GNU and Unix without mounting them."
-HOMEPAGE = "http://www.gnu.org/software/mtools/"
-SECTION = "optional"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=92b58ec77696788ce278b044d2a8e9d3"
-PR = "r6"
-
-DEPENDS += "virtual/libiconv"
-
-RDEPENDS_${PN}_libc-glibc = "glibc-gconv-ibm850"
-RRECOMMENDS_${PN}_libc-glibc = "\
-	glibc-gconv-ibm437 \
-	glibc-gconv-ibm737 \
-	glibc-gconv-ibm775 \
-	glibc-gconv-ibm851 \
-	glibc-gconv-ibm852 \
-	glibc-gconv-ibm855 \
-	glibc-gconv-ibm857 \
-	glibc-gconv-ibm860 \
-	glibc-gconv-ibm861 \
-	glibc-gconv-ibm862 \
-	glibc-gconv-ibm863 \
-	glibc-gconv-ibm865 \
-	glibc-gconv-ibm866 \
-	glibc-gconv-ibm869 \
-	"
-SRC_URI[md5sum] = "3e68b857b4e1f3a6521d1dfefbd30a36"
-SRC_URI[sha256sum] = "af083a73425d664d4607ef6c6564fd9319a0e47ee7c105259a45356cb834690e"
-
-#http://mtools.linux.lu/mtools-${PV}.tar.gz 
-SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/mtools-${PV}.tar.gz \
-           file://mtools-makeinfo.patch \
-           file://mtools.patch \
-           file://no-x11.patch \
-           file://fix-broken-lz.patch \
-           file://0001-Continue-even-if-fs-size-is-not-divisible-by-sectors.patch \
-           "
-
-inherit autotools texinfo
-
-EXTRA_OECONF = "--without-x"
-
-LDFLAGS_append_libc-uclibc = " -liconv "
-
-BBCLASSEXTEND = "native nativesdk"
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[libbsd] = "ac_cv_lib_bsd_main=yes,ac_cv_lib_bsd_main=no,libbsd"
-
-do_install_prepend () {
-    # Create bindir to fix parallel installation issues
-    mkdir -p ${D}/${bindir}
-    mkdir -p ${D}/${datadir}
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.12.02.bb b/import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.12.02.bb
index 9c4b60f..3280b84 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.12.02.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.12.02.bb
@@ -2,7 +2,6 @@
 SECTION = "devel"
 LICENSE = "BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=90904486f8fbf1861cf42752e1a39efe"
-COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)'
 
 SRC_URI = "http://www.nasm.us/pub/nasm/releasebuilds/${PV}/nasm-${PV}.tar.bz2 "
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch
deleted file mode 100644
index 6b40afd..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 55f6fd8f1958aa36584eefeecce782a505963c88 Mon Sep 17 00:00:00 2001
-From: benvm <benvm@yow-gmoffatt-lx2.wrs.com>
-Date: Wed, 9 Jan 2013 12:14:06 -0500
-Subject: [PATCH] Fix Makefile regular expression
-
-This patch modifies a regular expression within a Makefile to stop builds
-from failing in the case where the path contains the characters ".a".
-
-Upstream-Status: Submitted
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
-
----
- Makefile.prog.in |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/Makefile.prog.in b/Makefile.prog.in
-index 76310c9..44c3534 100644
---- a/Makefile.prog.in
-+++ b/Makefile.prog.in
-@@ -12,7 +12,7 @@ LINKFLAGS = @LINKFLAGS@
- 
- ALL_LIBS = $(XLIBS) $(LIBS)
- Makefile.lt:
--	echo 'LT_LIBS='`echo $(ALL_LIBS)|sed 's/\.a/.la/g'` >Makefile.lt
-+	echo 'LT_LIBS='`echo $(ALL_LIBS) | sed 's/\.a\s/\.la /g' | sed s/\.a$$/\.la/` > Makefile.lt
- 
- PROG:=$(shell echo "$(PROG)" | sed '@program_transform_name@')
- 
--- 
-1.7.0.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch
deleted file mode 100644
index 968b9b4..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-This patch fixes libtool QA issues with WORKDIR creeping in to
-libospgrove.la and libostyle.la. Patch obtained from OpenEmbedded.
-
-Upstream-Status: Inappropriate [Other]
-Workaround is specific to our build system.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
-Index: openjade-1.3.2/spgrove/Makefile.sub
-===================================================================
---- openjade-1.3.2.orig/spgrove/Makefile.sub
-+++ openjade-1.3.2/spgrove/Makefile.sub
-@@ -1,8 +1,8 @@
- LTVERSION=0:1:0
- LIB=ospgrove
- INCLUDE=-I$(srcdir)/../grove
--DEPLIBS=-lm -L$(TOP)/grove -L$(TOP)/grove/.libs \
--	-L$(TOP)/lib -L$(TOP)/lib/.libs \
-+DEPLIBS=-lm $(TOP)/grove \
-+	$(TOP)/lib \
- 	$(LIB_THREADS)
- OBJS=GroveApp.o GroveBuilder.o SdNode.o
- GENSRCS=grove_inst.cxx
-Index: openjade-1.3.2/style/Makefile.sub
-===================================================================
---- openjade-1.3.2.orig/style/Makefile.sub
-+++ openjade-1.3.2/style/Makefile.sub
-@@ -1,8 +1,8 @@
- LTVERSION=0:1:0
- LIB=ostyle
--DEPLIBS=-lm -L$(TOP)/grove -L$(TOP)/grove/.libs \
--  -L$(TOP)/lib -L$(TOP)/lib/.libs \
--  -L$(TOP)/spgrove -L$(TOP)/spgrove/.libs 
-+DEPLIBS=-lm $(TOP)/grove \
-+  $(TOP)/lib  \
-+  $(TOP)/spgrove
- OBJS=LangObj.o \
-   Collector.o \
-   DssslApp.o \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch
deleted file mode 100644
index b47fd46..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-commit fcc5b94f118495b1a467edcda6c6f631691c3f69
-Author: Dennis Lan <dennis.yxun@gmail.com>
-Date:   Tue Jul 3 09:25:42 2012 +0800
-
-    openjade: fix undefined Getopts error, use std namespace
-    
-    Using Gentoo Linux as the build host, it fails without this patch
-    Use Getopt::Std in place of getopts.pl.
-    
-    Upstream-Status: Inappropriate [no upstream]
-    Original-Author-By: Mike Gilbert <floppym@gentoo.org>
-    Signed-off-by: Dennis Lan <dennis.yxun@gmail.com>
-
-diff --git a/msggen.pl b/msggen.pl
-index 0c33968..2ee3f66 100644
---- a/msggen.pl
-+++ b/msggen.pl
-@@ -4,6 +4,7 @@
- # See the file COPYING for copying permission.
- 
- use POSIX;
-+use Getopt::Std;
- 
- # Package and version.
- $package = 'openjade';
-@@ -18,8 +19,7 @@ $gen_c = 0;
- undef $opt_l;
- undef $opt_p;
- undef $opt_t;
--do 'getopts.pl';
--&Getopts('l:p:t:');
-+getopts('l:p:t:');
- $module = $opt_l;
- $pot_file = $opt_p;
- 
-@@ -72,7 +72,7 @@ while (<DEF>) {
-     else {
- 	$field[0] =~ /^[IWQXE][0-9]$/ || &error("invalid first field");;
- 	$type[$num] = substr($field[0], 0, 1);
--	$argc = int(substr($field[0], 1, 1));
-+	$argc = substr($field[0], 1, 1);
-     }
-     $nargs[$num] = $argc;
-     $field[1] =~ /^[a-zA-Z_][a-zA-Z0-9_]+$/ || &error("invalid tag");
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/no-libtool.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/no-libtool.patch
deleted file mode 100644
index 2f57c00..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/no-libtool.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-The openjade build is fairly unique in auto-generating explicit dependencies to
-installed .la files.  As some distributions may delete these files unless
-clearly required, change the Makefile fragment to depend on the .so instead.
-
-Patch originally by Phil Blundell <philb@brightsign.biz>.
-
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-Upstream-Status: Inappropriate
-
---- openjade-1.3.2/Makefile.prog.in~	2013-05-14 11:42:02.646782318 +0100
-+++ openjade-1.3.2/Makefile.prog.in	2013-05-14 11:54:55.051728343 +0100
-@@ -12,7 +12,7 @@
- 
- ALL_LIBS = $(XLIBS) $(LIBS)
- Makefile.lt:
--	echo 'LT_LIBS='`echo $(ALL_LIBS) | sed 's/\.a\s/\.la /g' | sed s/\.a$$/\.la/` > Makefile.lt
-+	echo 'LT_LIBS='`for d in $(ALL_LIBS); do case $$d in ../*) echo $$d | sed s/\.a$$/.la/g ;; *) echo $$d | sed s/\.a$$/.so/g ;; esac ; done` >Makefile.lt
- 
- PROG:=$(shell echo "$(PROG)" | sed '@program_transform_name@')
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch
deleted file mode 100644
index 1a23a4a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-Ensure we reautoconf the packag
-
-Currently since configure.in in is in a subdirectory, we don't reautoconf the 
-recipe. We really need to do this, to update things like the libtool script used
-and fix various issues such as those that could creep in if a reautoconf is 
-triggered for some reason. Since this source only calls AM_INIT_AUTOMAKE to 
-gain the PACKAGE and VERSION definitions and that macro now errors if Makefile.am 
-doesn't exist, we need to add these definitions manually. 
-
-These changes avoid failures like: 
----- 
-| ... 
-| DssslApp.cxx:117:36: error: 'PACKAGE' was not declared in this scope 
-| DssslApp.cxx:118:36: error: 'VERSION' was not declared in this scope 
-| make[2]: *** [DssslApp.lo] Error 1 ----
-
-Upstream-Status: Pending
-
-RP 2012/6/12
-
-Index: openjade-1.3.2/acinclude.m4
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ openjade-1.3.2/acinclude.m4	2012-06-12 12:48:54.871365344 +0000
-@@ -0,0 +1,39 @@
-+dnl Configure-time switch with default
-+dnl
-+dnl Each switch defines an --enable-FOO and --disable-FOO option in
-+dnl the resulting configure script.
-+dnl
-+dnl Usage:
-+dnl smr_SWITCH(name, description, default, pos-def, neg-def)
-+dnl
-+dnl where:
-+dnl
-+dnl name        name of switch; generates --enable-name & --disable-name
-+dnl             options
-+dnl description help string is set to this prefixed by "enable" or
-+dnl             "disable", whichever is the non-default value
-+dnl default     either "on" or "off"; specifies default if neither
-+dnl             --enable-name nor --disable-name is specified
-+dnl pos-def     a symbol to AC_DEFINE if switch is on (optional)
-+dnl neg-def     a symbol to AC_DEFINE if switch is off (optional)
-+dnl
-+AC_DEFUN(smr_SWITCH, [
-+    AC_MSG_CHECKING(whether to enable $2)
-+    AC_ARG_ENABLE(
-+        $1,
-+        ifelse($3, on,
-+            [  --disable-[$1]    disable [$2]],
-+            [  --enable-[$1]     enable [$2]]),
-+        [ if test "$enableval" = yes; then
-+            AC_MSG_RESULT(yes)
-+            ifelse($4, , , AC_DEFINE($4))
-+        else
-+            AC_MSG_RESULT(no)
-+            ifelse($5, , , AC_DEFINE($5))
-+        fi ],
-+        ifelse($3, on,
-+           [ AC_MSG_RESULT(yes)
-+             ifelse($4, , , AC_DEFINE($4)) ],
-+           [ AC_MSG_RESULT(no)
-+            ifelse($5, , , AC_DEFINE($5))]))])
-+
-Index: openjade-1.3.2/config/configure.in
-===================================================================
---- openjade-1.3.2.orig/config/configure.in	2012-06-12 12:47:20.735365445 +0000
-+++ openjade-1.3.2/config/configure.in	2012-06-12 12:48:17.507364080 +0000
-@@ -12,9 +12,12 @@
- dnl  Credits: this autoconf script was largely "inspired" <g> by the
- dnl  autoconf script around SP made by Henry Thompson.
- dnl
--AC_INIT(dsssl)
-+AC_INIT([openjade], [1.3.2])
- AC_CONFIG_AUX_DIR(config)
--AM_INIT_AUTOMAKE( openjade, 1.3.2)
-+AC_SUBST([PACKAGE], [openjade])
-+AC_SUBST([VERSION], [1.3.2])
-+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-+AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
- TOP=`pwd`
- AC_SUBST(TOP)
- dnl
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch
deleted file mode 100644
index 073af46..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-In GCC 4.6 the compiler no longer allows objects of const-qualified type to
-be default initialized unless the type has a user-declared default
-constructor.
-
-Patch from Gentoo bugzilla: http://bugs.gentoo.org/show_bug.cgi?id=358021
-
-Gentoo Bugzilla description follows:
-"If a class or struct has no user-defined default constructor, C++ doesn't
-allow you to default construct a const instance of it.
-
-https://bugs.gentoo.org/358021
-http://clang.llvm.org/compatibility.html#default_init_const
-http://gcc.gnu.org/PR44499"
-
-Upstream-Status: Pending
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
---- a/jade/TeXFOTBuilder.cxx
-+++ b/jade/TeXFOTBuilder.cxx
-@@ -88,6 +88,8 @@ public:
-       value.convertString(nic_.placement);
-       }
-     ExtensionFlowObj *copy() const { return new PageFloatFlowObj(*this); }
-+  public:
-+    PageFloatFlowObj() {}
-   private:
-     PageFloatNIC nic_;
-     StringC name_;
-@@ -101,6 +103,8 @@ public:
-       fotb.endPageFootnote();
-     }
-     ExtensionFlowObj *copy() const { return new PageFootnoteFlowObj(*this); }
-+  public:
-+    PageFootnoteFlowObj() {}
-   private:
-   };
-   //////////////////////////////////////////////////////////////////////
---- a/jade/TransformFOTBuilder.cxx
-+++ b/jade/TransformFOTBuilder.cxx
-@@ -41,6 +41,7 @@ public:
-   };
-   class EntityRefFlowObj : public TransformExtensionFlowObj {
-   public:
-+    EntityRefFlowObj() {}
-     void atomic(TransformFOTBuilder &fotb, const NodePtr &) const {
-       fotb.entityRef(name_);
-     }
-@@ -56,6 +57,7 @@ public:
-   };
-   class ProcessingInstructionFlowObj : public TransformExtensionFlowObj {
-   public:
-+    ProcessingInstructionFlowObj() {}
-     void atomic(TransformFOTBuilder &fotb, const NodePtr &) const {
-       fotb.processingInstruction(data_);
-     }
-@@ -98,6 +100,8 @@ public:
-       }
-     }
-     ExtensionFlowObj *copy() const { return new EmptyElementFlowObj(*this); }
-+  public:
-+    EmptyElementFlowObj() {}
-   private:
-     ElementNIC nic_;
-   };
-@@ -133,6 +137,8 @@ public:
-       }
-     }
-     ExtensionFlowObj *copy() const { return new ElementFlowObj(*this); }
-+  public:
-+    ElementFlowObj() {}
-   private:
-     ElementNIC nic_;
-   };
-@@ -150,6 +156,8 @@ public:
-       value.convertString(systemId_);
-     }
-     ExtensionFlowObj *copy() const { return new EntityFlowObj(*this); }
-+  public:
-+    EntityFlowObj() {}
-   private:
-     StringC systemId_;
-   };
-@@ -174,6 +182,8 @@ public:
-       }
-     }
-     ExtensionFlowObj *copy() const { return new DocumentTypeFlowObj(*this); }
-+  public:
-+    DocumentTypeFlowObj() {}
-   private:
-     DocumentTypeNIC nic_;
-   };
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
deleted file mode 100644
index 8b15b0c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
+++ /dev/null
@@ -1,121 +0,0 @@
-SUMMARY = "Tools for working with DSSSL stylesheets for SGML and XML documents"
-DESCRIPTION = "OpenJade is a suite of tools for validating, \
-processing, and applying DSSSL (Document Style Semantics and \
-Specification Language) stylesheets to SGML and XML documents."
-HOMEPAGE = "http://openjade.sourceforge.net"
-SECTION = "base"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=641ff1e4511f0a87044ad42f87cb1045"
-
-PR = "r5"
-
-DEPENDS = "opensp-native sgml-common-native"
-RDEPENDS_${PN} = "sgml-common-native"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/openjade/openjade-${PV}.tar.gz \
-           file://makefile.patch \
-           file://msggen.pl.patch \
-           file://reautoconf.patch \
-	   file://user-declared-default-constructor.patch \
-           file://fix-regex.patch \
-	   file://no-libtool.patch"
-
-SRC_URI[md5sum] = "7df692e3186109cc00db6825b777201e"
-SRC_URI[sha256sum] = "1d2d7996cc94f9b87d0c51cf0e028070ac177c4123ecbfd7ac1cb8d0b7d322d1"
-
-UPSTREAM_CHECK_URI = "http://openjade.sourceforge.net/download.html"
-
-inherit autotools-brokensep native
-
-# Statically link local libs to avoid gold link issue [YOCTO #2972]
-PACKAGECONFIG ?= "static-only-libs"
-PACKAGECONFIG[static-only-libs] = "--enable-static --disable-shared,--enable-static --enable-shared,,"
-
-EXTRA_OECONF = "--enable-spincludedir=${STAGING_INCDIR}/OpenSP \
-                --enable-splibdir=${STAGING_LIBDIR}"
-
-# We need to set datadir explicitly, but adding it to EXTRA_OECONF
-# results in it being specified twice when configure is run.
-CONFIGUREOPTS := "${@d.getVar('CONFIGUREOPTS', True).replace('--datadir=${datadir}', '--datadir=${STAGING_DATADIR}/sgml/openjade-${PV}')}"
-
-# CONFIGUREOPTS has hard coded paths so we need to ignore it's vardeps
-# there are other bits in there too but they are picked up by other variable
-# dependencies so it all works out
-oe_runconf[vardepsexclude] += "CONFIGUREOPTS"
-
-CFLAGS =+ "-I${S}/include"
-CXXFLAGS += "-fno-tree-dse"
-
-SSTATEPOSTINSTFUNCS += "openjade_sstate_postinst"
-SYSROOT_PREPROCESS_FUNCS += "openjade_sysroot_preprocess"
-
-# configure.in needs to be reloacted to trigger reautoconf
-do_extraunpack () {
-	cp ${S}/config/configure.in ${S}/
-}
-addtask extraunpack after do_patch before do_configure
-
-# We need to do this else the source interdependencies aren't generated and
-# build failures can result (e.g. zero size style/Makefile.dep file)
-do_compile_prepend () {
-	oe_runmake depend
-}
-
-do_install() {
-	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/openjade.html
-	# for details.
-	install -d ${D}${bindir} ${D}${libdir}
-	if ${@bb.utils.contains('PACKAGECONFIG', 'static-only-libs', 'true', 'false', d)}; then
-		install -m 0755 jade/openjade ${D}${bindir}/openjade
-		oe_libinstall -a -C style libostyle ${D}${libdir}
-		oe_libinstall -a -C spgrove libospgrove ${D}${libdir}
-		oe_libinstall -a -C grove libogrove ${D}${libdir}
-	else
-		install -m 0755 jade/.libs/openjade ${D}${bindir}/openjade
-		oe_libinstall -a -so -C style libostyle ${D}${libdir}
-		oe_libinstall -a -so -C spgrove libospgrove ${D}${libdir}
-		oe_libinstall -a -so -C grove libogrove ${D}${libdir}
-	fi
-	ln -sf openjade ${D}${bindir}/jade
-
-	install -d ${D}${datadir}/sgml/openjade-${PV}
-	install -m 644 dsssl/catalog ${D}${datadir}/sgml/openjade-${PV}
-	install -m 644 dsssl/*.dtd ${D}${datadir}/sgml/openjade-${PV}
-	install -m 644 dsssl/*.dsl ${D}${datadir}/sgml/openjade-${PV}
-	install -m 644 dsssl/*.sgm ${D}${datadir}/sgml/openjade-${PV}
-
-	install -d ${datadir}/sgml/openjade-${PV}
-	install -m 644 dsssl/catalog ${datadir}/sgml/openjade-${PV}/catalog
-
-	install -d ${D}${sysconfdir}/sgml
-	echo "CATALOG ${datadir}/sgml/openjade-${PV}/catalog" > \
-		${D}${sysconfdir}/sgml/openjade-${PV}.cat
-}
-
-openjade_sstate_postinst() {
-	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
-	then
-		# Ensure that the catalog file sgml-docbook.cat is properly
-		# updated when the package is installed from sstate cache.
-		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \
-			--add ${sysconfdir}/sgml/sgml-docbook.bak \
-			${sysconfdir}/sgml/openjade-${PV}.cat
-		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \
-			--add ${sysconfdir}/sgml/sgml-docbook.cat \
-			${sysconfdir}/sgml/openjade-${PV}.cat
-		cat << EOF > ${SSTATE_INST_POSTRM}
-#!/bin/sh
-# Ensure that the catalog file sgml-docbook.cat is properly
-# updated when the package is removed from sstate cache.
-files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
-for f in \$files; do
-	[ ! -f \$f ] || sed -i '/\/sgml\/openjade-${PV}.cat/d' \$f
-done
-EOF
-	fi
-}
-
-openjade_sysroot_preprocess () {
-    install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
-    install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch
deleted file mode 100644
index 42218a6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Upstream-Status: Submitted [https://sourceforge.net/tracker/?func=detail&aid=3599291&group_id=2115&atid=102115]
-
-Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
-diff -Nurd OpenSP-1.5.2/configure.in OpenSP-1.5.2/configure.in
---- OpenSP-1.5.2/configure.in	2005-12-23 16:15:21.000000000 +0200
-+++ OpenSP-1.5.2/configure.in	2013-01-03 09:04:51.922645689 +0200
-@@ -16,7 +16,7 @@
- AM_INIT_AUTOMAKE(OpenSP, 1.5.2, no-define)
- AM_MAINTAINER_MODE
- AC_PREREQ(2.53)
--AM_CONFIG_HEADER(config.h)
-+AC_CONFIG_HEADERS(config.h)
- AM_SANITY_CHECK
-
- dnl Autoheader definitions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp_1.5.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp_1.5.2.bb
deleted file mode 100644
index 60a7d2e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp_1.5.2.bb
+++ /dev/null
@@ -1,59 +0,0 @@
-SUMMARY = "An SGML parser"
-DESCRIPTION = "An SGML parser used by the OpenJade suite of utilities."
-HOMEPAGE = "http://openjade.sourceforge.net"
-SECTION = "libs"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=641ff1e4511f0a87044ad42f87cb1045"
-
-PR = "r1"
-
-# At -Os it encounters calls to some inline functions which are then
-# not found in any other objects with gcc 4.5
-FULL_OPTIMIZATION += "-O2"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/openjade/OpenSP-${PV}.tar.gz \
-           file://obsolete_automake_macros.patch \
-"
-
-SRC_URI[md5sum] = "670b223c5d12cee40c9137be86b6c39b"
-SRC_URI[sha256sum] = "57f4898498a368918b0d49c826aa434bb5b703d2c3b169beb348016ab25617ce"
-
-S = "${WORKDIR}/OpenSP-${PV}"
-
-inherit autotools gettext
-
-EXTRA_OECONF = "--disable-doc-build"
-
-EXTRA_OECONF_class-native = "\
-	--disable-doc-build \
-	--enable-default-catalog=${sysconfdir}/sgml/catalog \
-	--enable-default-search-path=${datadir}/sgml \
-	"
-
-do_install_append() {
-	# Set up symlinks to often-used alternate names. See
-	# http://www.linuxfromscratch.org/blfs/view/stable/pst/opensp.html
-	cd ${D}${libdir}
-	ln -sf libosp.so libsp.so
-
-	cd ${D}${bindir}
-	for util in nsgmls sgmlnorm spam spcat spent sx; do
-		ln -sf o$util $util	
-	done
-	ln -sf osx sgml2xml
-}
-
-do_install_append_class-native() {
-	for util in nsgmls sgmlnorm spam spcat spent sx; do
-		create_cmdline_wrapper ${D}/${bindir}/$util \
-		    -D ${sysconfdir}/sgml
-	done
-}
-
-FILES_${PN} += "${datadir}/OpenSP/"
-
-BBCLASSEXTEND = "native"
-
-# http://errors.yoctoproject.org/Errors/Details/20489/
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
index 4dddb08..3824eb3 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
@@ -25,7 +25,7 @@
  mkdir $tmp_dir
  
  echo $CONTROL > $tmp_dir/tarX
--( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -cz $tarformat -f $tmp_dir/data.tar.gz . )
+-( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -c --$compressor $tarformat -f $tmp_dir/data.tar.$cext . )
 -( cd $pkg_dir/$CONTROL && tar $ogargs -cz $tarformat -f $tmp_dir/control.tar.gz . )
 +
 +
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
index a7aec45..9deea0f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -7,10 +7,11 @@
                     file://opkg.py;beginline=1;endline=18;md5=15917491ad6bf7acc666ca5f7cc1e083"
 PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"
 
-SRCREV = "3ffece9bf19a844edacc563aa092fd1fbfcffeee"
-PV = "0.3.2+git${SRCPV}"
+SRCREV = "1a708fd73d10c2b7677dd4cc4e017746ebbb9166"
+PV = "0.3.4+git${SRCPV}"
 
-SRC_URI = "git://git.yoctoproject.org/opkg-utils"
+SRC_URI = "git://git.yoctoproject.org/opkg-utils \
+"
 SRC_URI_append_class-native = " file://tar_ignore_error.patch"
 
 S = "${WORKDIR}/git"
@@ -43,4 +44,11 @@
 RREPLACES_update-alternatives-opkg = "update-alternatives-cworth"
 RCONFLICTS_update-alternatives-opkg = "update-alternatives-cworth"
 
+pkg_postrm_update-alternatives-opkg() {
+	rm -rf $D${nonarch_libdir}/opkg/alternatives
+	rmdir $D${nonarch_libdir}/opkg || true
+}
+
 BBCLASSEXTEND = "native nativesdk"
+
+CLEANBROKEN = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb
index ace3de4..682142a 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb
@@ -1,6 +1,5 @@
 SUMMARY = "Architecture-dependent configuration for opkg"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 PR = "r1"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch
index 255021b..e94a412 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch
@@ -21,10 +21,10 @@
 --- a/libopkg/opkg_conf.h
 +++ b/libopkg/opkg_conf.h
 @@ -40,7 +40,7 @@ extern "C" {
- #define OPKG_CONF_DEFAULT_STATUS_FILE   "/var/lib/opkg/status"
- #define OPKG_CONF_DEFAULT_CACHE_DIR     "/var/cache/opkg"
- #define OPKG_CONF_DEFAULT_CONF_FILE_DIR "/etc/opkg"
--#define OPKG_CONF_DEFAULT_LOCK_FILE     "/var/run/opkg.lock"
+ #define OPKG_CONF_DEFAULT_STATUS_FILE   VARDIR "/lib/opkg/status"
+ #define OPKG_CONF_DEFAULT_CACHE_DIR     VARDIR "/cache/opkg"
+ #define OPKG_CONF_DEFAULT_CONF_FILE_DIR SYSCONFDIR "/opkg"
+-#define OPKG_CONF_DEFAULT_LOCK_FILE     VARDIR "/run/opkg.lock"
 +#define OPKG_CONF_DEFAULT_LOCK_FILE     "/run/opkg.lock"
  
  /* In case the config file defines no dest */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/status-conffile.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/status-conffile.patch
new file mode 100644
index 0000000..6fc405b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/status-conffile.patch
@@ -0,0 +1,69 @@
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 086d5083dfe0102368cb7c8ce89b0c06b64ca773 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 10 Jan 2017 15:24:59 +0000
+Subject: [PATCH 1/2] opkg_cmd: only look at conffile status if we're going to
+ output it
+
+The loop to compare the recorded conffile hash with their hash on disk is
+outputted at level INFO but the loop was executed at level NOTICE and higher.
+
+This means that if a conffile had been deleted the status operation would
+produce error messages for output it isn't displaying.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ libopkg/opkg_cmd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
+index ba57c6a..37416fd 100644
+--- a/libopkg/opkg_cmd.c
++++ b/libopkg/opkg_cmd.c
+@@ -638,7 +638,7 @@ static int opkg_info_status_cmd(int argc, char **argv, int installed_only)
+ 
+         pkg_formatted_info(stdout, pkg);
+ 
+-        if (opkg_config->verbosity >= NOTICE) {
++        if (opkg_config->verbosity >= INFO) {
+             conffile_list_elt_t *iter;
+             for (iter = nv_pair_list_first(&pkg->conffiles); iter;
+                  iter = nv_pair_list_next(&pkg->conffiles, iter)) {
+-- 
+2.8.1
+
+From 225e30e0f9fa7cfeaa3f89e2713e5147ab371def Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 10 Jan 2017 15:28:47 +0000
+Subject: [PATCH 2/2] conffile: gracefully handle deleted conffiles in
+ conffile_has_been_modified
+
+Handle conffiles that don't exist gracefully so that instead of showing an error
+message from file_md5sum_alloc() a notice that the file has been deleted is
+shown instead.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ libopkg/conffile.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libopkg/conffile.c b/libopkg/conffile.c
+index b2f2469..7b4b87b 100644
+--- a/libopkg/conffile.c
++++ b/libopkg/conffile.c
+@@ -51,6 +51,11 @@ int conffile_has_been_modified(conffile_t * conffile)
+     }
+ 
+     root_filename = root_filename_alloc(filename);
++    if (!file_exists(root_filename)) {
++        opkg_msg(INFO, "Conffile %s deleted\n", conffile->name);
++        free(root_filename);
++        return 1;
++    }
+ 
+     md5sum = file_md5sum_alloc(root_filename);
+ 
+-- 
+2.8.1
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.3.bb
deleted file mode 100644
index bce72fc..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.3.bb
+++ /dev/null
@@ -1,73 +0,0 @@
-SUMMARY = "Open Package Manager"
-SUMMARY_libopkg = "Open Package Manager library"
-SECTION = "base"
-HOMEPAGE = "http://code.google.com/p/opkg/"
-BUGTRACKER = "http://code.google.com/p/opkg/issues/list"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
-                    file://src/opkg.c;beginline=2;endline=21;md5=90435a519c6ea69ef22e4a88bcc52fa0"
-
-DEPENDS = "libarchive"
-
-PE = "1"
-
-SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
-           file://opkg-configure.service \
-           file://opkg.conf \
-           file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
-"
-
-SRC_URI[md5sum] = "a4613038c8afc7d8d482f5c53f137bdf"
-SRC_URI[sha256sum] = "19db9e73121a5e4c91fa228b0a6a4c55cc3591056130cfb3c66c30aa32f8d00e"
-
-inherit autotools pkgconfig systemd
-
-SYSTEMD_SERVICE_${PN} = "opkg-configure.service"
-
-target_localstatedir := "${localstatedir}"
-OPKGLIBDIR = "${target_localstatedir}/lib"
-
-PACKAGECONFIG ??= ""
-
-PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,gpgme libgpg-error,gnupg"
-PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
-PACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl"
-PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
-PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256"
-PACKAGECONFIG[pathfinder] = "--enable-pathfinder,--disable-pathfinder,pathfinder"
-PACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv"
-
-do_install_append () {
-	install -d ${D}${sysconfdir}/opkg
-	install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
-	echo "option lists_dir ${OPKGLIBDIR}/opkg/lists" >>${D}${sysconfdir}/opkg/opkg.conf
-
-	# We need to create the lock directory
-	install -d ${D}${OPKGLIBDIR}/opkg
-
-	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
-		install -d ${D}${systemd_unitdir}/system
-		install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/
-		sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
-			-e 's,@SYSCONFDIR@,${sysconfdir},g' \
-			-e 's,@BINDIR@,${bindir},g' \
-			-e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
-			${D}${systemd_unitdir}/system/opkg-configure.service
-	fi
-}
-
-RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config run-postinsts libarchive"
-RDEPENDS_${PN}_class-native = ""
-RDEPENDS_${PN}_class-nativesdk = ""
-RREPLACES_${PN} = "opkg-nogpg opkg-collateral"
-RCONFLICTS_${PN} = "opkg-collateral"
-RPROVIDES_${PN} = "opkg-collateral"
-
-PACKAGES =+ "libopkg"
-
-FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
-FILES_${PN} += "${systemd_unitdir}/system/"
-
-BBCLASSEXTEND = "native nativesdk"
-
-CONFFILES_${PN} = "${sysconfdir}/opkg/opkg.conf"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.4.bb
new file mode 100644
index 0000000..a21fde1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.4.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Open Package Manager"
+SUMMARY_libopkg = "Open Package Manager library"
+SECTION = "base"
+HOMEPAGE = "http://code.google.com/p/opkg/"
+BUGTRACKER = "http://code.google.com/p/opkg/issues/list"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://src/opkg.c;beginline=2;endline=21;md5=90435a519c6ea69ef22e4a88bcc52fa0"
+
+DEPENDS = "libarchive"
+
+PE = "1"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
+           file://opkg-configure.service \
+           file://opkg.conf \
+           file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
+           file://status-conffile.patch \
+"
+
+SRC_URI[md5sum] = "6c52a065499056a196e0b45a27e392de"
+SRC_URI[sha256sum] = "750b900b53b62a9b280b601a196f02da81091eda2f3478c509512aa5a1ec93be"
+
+inherit autotools pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "opkg-configure.service"
+
+target_localstatedir := "${localstatedir}"
+OPKGLIBDIR = "${target_localstatedir}/lib"
+
+PACKAGECONFIG ??= "libsolv"
+
+PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,gpgme libgpg-error,gnupg"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
+PACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256"
+PACKAGECONFIG[pathfinder] = "--enable-pathfinder,--disable-pathfinder,pathfinder"
+PACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv"
+
+EXTRA_OECONF_class-native = "--localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
+
+do_install_append () {
+	install -d ${D}${sysconfdir}/opkg
+	install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
+	echo "option lists_dir ${OPKGLIBDIR}/opkg/lists" >>${D}${sysconfdir}/opkg/opkg.conf
+
+	# We need to create the lock directory
+	install -d ${D}${OPKGLIBDIR}/opkg
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
+		install -d ${D}${systemd_unitdir}/system
+		install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/
+		sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+			-e 's,@SYSCONFDIR@,${sysconfdir},g' \
+			-e 's,@BINDIR@,${bindir},g' \
+			-e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
+			${D}${systemd_unitdir}/system/opkg-configure.service
+	fi
+}
+
+RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+RREPLACES_${PN} = "opkg-nogpg opkg-collateral"
+RCONFLICTS_${PN} = "opkg-collateral"
+RPROVIDES_${PN} = "opkg-collateral"
+
+PACKAGES =+ "libopkg"
+
+FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
+FILES_${PN} += "${systemd_unitdir}/system/"
+
+BBCLASSEXTEND = "native nativesdk"
+
+CONFFILES_${PN} = "${sysconfdir}/opkg/opkg.conf"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.25.bb b/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.25.bb
deleted file mode 100644
index 897493a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.25.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY = "Optimised Inner Loop Runtime Compiler"
-HOMEPAGE = "http://gstreamer.freedesktop.org/modules/orc.html"
-LICENSE = "BSD-2-Clause & BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://COPYING;md5=1400bd9d09e8af56b9ec982b3d85797e"
-
-SRC_URI = "http://gstreamer.freedesktop.org/src/orc/orc-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "8582a28b15f53110c88d8043d9f55bcf"
-SRC_URI[sha256sum] = "c1b1d54a58f26d483f0b3881538984789fe5d5460ab8fab74a1cacbd3d1c53d1"
-
-inherit autotools pkgconfig gtk-doc
-
-BBCLASSEXTEND = "native nativesdk"
-
-PACKAGES =+ "orc-examples"
-PACKAGES_DYNAMIC += "^liborc-.*"
-FILES_orc-examples = "${libdir}/orc/*"
-FILES_${PN} = "${bindir}/*"
-
-python populate_packages_prepend () {
-    libdir = d.expand('${libdir}')
-    do_split_packages(d, libdir, '^lib(.*)\.so\.*', 'lib%s', 'ORC %s library', extra_depends='', allow_links=True)
-}
-
-do_compile_prepend_class-native () {
-    sed -i -e 's#/tmp#.#g' ${S}/orc/orccodemem.c
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.26.bb b/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.26.bb
new file mode 100644
index 0000000..e47342f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.26.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Optimised Inner Loop Runtime Compiler"
+HOMEPAGE = "http://gstreamer.freedesktop.org/modules/orc.html"
+LICENSE = "BSD-2-Clause & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1400bd9d09e8af56b9ec982b3d85797e"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/orc/orc-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "8e9bef677bae289d3324d81c337a4507"
+SRC_URI[sha256sum] = "7d52fa80ef84988359c3434e1eea302d077a08987abdde6905678ebcad4fa649"
+
+inherit autotools pkgconfig gtk-doc
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGES =+ "orc-examples"
+PACKAGES_DYNAMIC += "^liborc-.*"
+FILES_orc-examples = "${libdir}/orc/*"
+FILES_${PN} = "${bindir}/*"
+
+python populate_packages_prepend () {
+    libdir = d.expand('${libdir}')
+    do_split_packages(d, libdir, '^lib(.*)\.so\.*', 'lib%s', 'ORC %s library', extra_depends='', allow_links=True)
+}
+
+do_compile_prepend_class-native () {
+    sed -i -e 's#/tmp#.#g' ${S}/orc/orccodemem.c
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/debian.patch b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/debian.patch
deleted file mode 100644
index 1a07646..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/debian.patch
+++ /dev/null
@@ -1,10426 +0,0 @@
-Upstream-Status: Inappropriate [debian patch]
-
---- patch-2.5.9.orig/m4/hash.m4
-+++ patch-2.5.9/m4/hash.m4
-@@ -0,0 +1,15 @@
-+# hash.m4 serial 1
-+dnl Copyright (C) 2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+AC_DEFUN([gl_HASH],
-+[
-+  dnl Prerequisites of lib/hash.c.
-+  AC_CHECK_HEADERS_ONCE(stdlib.h)
-+  AC_HEADER_STDBOOL
-+  AC_CHECK_DECLS_ONCE(free malloc)
-+])
---- patch-2.5.9.orig/m4/nanosecond_stat.m4
-+++ patch-2.5.9/m4/nanosecond_stat.m4
-@@ -0,0 +1,35 @@
-+AC_DEFUN([ag_CHECK_NANOSECOND_STAT],
-+  [AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
-+     [ac_cv_stat_nsec],
-+     [AC_TRY_COMPILE(
-+	[
-+	  #include <sys/types.h>
-+	  #include <sys/stat.h>
-+	  #include <unistd.h>
-+	  struct stat st;
-+	],
-+	[ return st.st_atimensec + st.st_mtimensec + st.st_ctimensec; ],
-+	[ac_cv_stat_nsec=yes],
-+	[ac_cv_stat_nsec=no])
-+     ])
-+   if test $ac_cv_stat_nsec = yes; then
-+     AC_DEFINE(HAVE_STAT_NSEC, 1, [Define to 1 if struct stat has nanosecond timestamps.])
-+   fi
-+
-+   AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
-+     [ac_cv_stat_timeval],
-+     [AC_TRY_COMPILE(
-+	[
-+	  #include <time.h>
-+	  #include <sys/types.h>
-+	  #include <sys/stat.h>
-+	  #include <unistd.h>
-+	  struct stat st;
-+	],
-+	[ return st.st_atim.tv_nsec + st.st_mtim.tv_nsec + st.st_ctim.tv_nsec; ],
-+	[ac_cv_stat_timeval=yes],
-+	[ac_cv_stat_timeval=no])
-+     ])
-+   if test $ac_cv_stat_timeval = yes; then
-+     AC_DEFINE(HAVE_STAT_TIMEVAL, 1, [Define to 1 if struct stat comtains struct timeval's.])
-+   fi])
---- patch-2.5.9.orig/Makefile.in
-+++ patch-2.5.9/Makefile.in
-@@ -62,7 +62,7 @@
- SHELL = /bin/sh
- 
- LIBSRCS = error.c malloc.c memchr.c mkdir.c \
--	realloc.c rmdir.c strcasecmp.c strncasecmp.c
-+	realloc.c rmdir.c strcasecmp.c strncasecmp.c hash.c
- SRCS = $(LIBSRCS) \
- 	addext.c argmatch.c backupfile.c \
- 	basename.c dirname.c \
-@@ -78,12 +78,12 @@
- 	maketime.$(OBJEXT) partime.$(OBJEXT) \
- 	patch.$(OBJEXT) pch.$(OBJEXT) \
- 	quote.$(OBJEXT) quotearg.$(OBJEXT) quotesys.$(OBJEXT) \
--	util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT)
-+	util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT) hash.$(OBJEXT)
- HDRS = argmatch.h backupfile.h common.h dirname.h \
- 	error.h getopt.h gettext.h \
- 	inp.h maketime.h partime.h pch.h \
- 	quote.h quotearg.h quotesys.h \
--	unlocked-io.h util.h version.h xalloc.h
-+	unlocked-io.h util.h version.h xalloc.h hash.h
- MISC = AUTHORS COPYING ChangeLog INSTALL Makefile.in NEWS README \
- 	aclocal.m4 \
- 	config.hin configure configure.ac \
---- patch-2.5.9.orig/aclocal.m4
-+++ patch-2.5.9/aclocal.m4
-@@ -1,3 +1,1058 @@
-+dnl aclocal.m4 generated automatically by aclocal 1.4-p6
-+
-+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
-+dnl This file is free software; the Free Software Foundation
-+dnl gives unlimited permission to copy and/or distribute it,
-+dnl with or without modifications, as long as this notice is preserved.
-+
-+dnl This program is distributed in the hope that it will be useful,
-+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-+dnl PARTICULAR PURPOSE.
-+
-+# lib-prefix.m4 serial 3 (gettext-0.13)
-+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Bruno Haible.
-+
-+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
-+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
-+dnl require excessive bracketing.
-+ifdef([AC_HELP_STRING],
-+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
-+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
-+
-+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
-+dnl to access previously installed libraries. The basic assumption is that
-+dnl a user will want packages to use other packages he previously installed
-+dnl with the same --prefix option.
-+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
-+dnl libraries, but is otherwise very convenient.
-+AC_DEFUN([AC_LIB_PREFIX],
-+[
-+  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
-+  AC_REQUIRE([AC_PROG_CC])
-+  AC_REQUIRE([AC_CANONICAL_HOST])
-+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-+  dnl By default, look in $includedir and $libdir.
-+  use_additional=yes
-+  AC_LIB_WITH_FINAL_PREFIX([
-+    eval additional_includedir=\"$includedir\"
-+    eval additional_libdir=\"$libdir\"
-+  ])
-+  AC_LIB_ARG_WITH([lib-prefix],
-+[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
-+  --without-lib-prefix    don't search for libraries in includedir and libdir],
-+[
-+    if test "X$withval" = "Xno"; then
-+      use_additional=no
-+    else
-+      if test "X$withval" = "X"; then
-+        AC_LIB_WITH_FINAL_PREFIX([
-+          eval additional_includedir=\"$includedir\"
-+          eval additional_libdir=\"$libdir\"
-+        ])
-+      else
-+        additional_includedir="$withval/include"
-+        additional_libdir="$withval/lib"
-+      fi
-+    fi
-+])
-+  if test $use_additional = yes; then
-+    dnl Potentially add $additional_includedir to $CPPFLAGS.
-+    dnl But don't add it
-+    dnl   1. if it's the standard /usr/include,
-+    dnl   2. if it's already present in $CPPFLAGS,
-+    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
-+    dnl   4. if it doesn't exist as a directory.
-+    if test "X$additional_includedir" != "X/usr/include"; then
-+      haveit=
-+      for x in $CPPFLAGS; do
-+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-+        if test "X$x" = "X-I$additional_includedir"; then
-+          haveit=yes
-+          break
-+        fi
-+      done
-+      if test -z "$haveit"; then
-+        if test "X$additional_includedir" = "X/usr/local/include"; then
-+          if test -n "$GCC"; then
-+            case $host_os in
-+              linux*) haveit=yes;;
-+            esac
-+          fi
-+        fi
-+        if test -z "$haveit"; then
-+          if test -d "$additional_includedir"; then
-+            dnl Really add $additional_includedir to $CPPFLAGS.
-+            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
-+          fi
-+        fi
-+      fi
-+    fi
-+    dnl Potentially add $additional_libdir to $LDFLAGS.
-+    dnl But don't add it
-+    dnl   1. if it's the standard /usr/lib,
-+    dnl   2. if it's already present in $LDFLAGS,
-+    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
-+    dnl   4. if it doesn't exist as a directory.
-+    if test "X$additional_libdir" != "X/usr/lib"; then
-+      haveit=
-+      for x in $LDFLAGS; do
-+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-+        if test "X$x" = "X-L$additional_libdir"; then
-+          haveit=yes
-+          break
-+        fi
-+      done
-+      if test -z "$haveit"; then
-+        if test "X$additional_libdir" = "X/usr/local/lib"; then
-+          if test -n "$GCC"; then
-+            case $host_os in
-+              linux*) haveit=yes;;
-+            esac
-+          fi
-+        fi
-+        if test -z "$haveit"; then
-+          if test -d "$additional_libdir"; then
-+            dnl Really add $additional_libdir to $LDFLAGS.
-+            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
-+          fi
-+        fi
-+      fi
-+    fi
-+  fi
-+])
-+
-+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
-+dnl acl_final_exec_prefix, containing the values to which $prefix and
-+dnl $exec_prefix will expand at the end of the configure script.
-+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
-+[
-+  dnl Unfortunately, prefix and exec_prefix get only finally determined
-+  dnl at the end of configure.
-+  if test "X$prefix" = "XNONE"; then
-+    acl_final_prefix="$ac_default_prefix"
-+  else
-+    acl_final_prefix="$prefix"
-+  fi
-+  if test "X$exec_prefix" = "XNONE"; then
-+    acl_final_exec_prefix='${prefix}'
-+  else
-+    acl_final_exec_prefix="$exec_prefix"
-+  fi
-+  acl_save_prefix="$prefix"
-+  prefix="$acl_final_prefix"
-+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
-+  prefix="$acl_save_prefix"
-+])
-+
-+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
-+dnl variables prefix and exec_prefix bound to the values they will have
-+dnl at the end of the configure script.
-+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
-+[
-+  acl_save_prefix="$prefix"
-+  prefix="$acl_final_prefix"
-+  acl_save_exec_prefix="$exec_prefix"
-+  exec_prefix="$acl_final_exec_prefix"
-+  $1
-+  exec_prefix="$acl_save_exec_prefix"
-+  prefix="$acl_save_prefix"
-+])
-+
-+# lib-link.m4 serial 4 (gettext-0.12)
-+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Bruno Haible.
-+
-+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
-+dnl the libraries corresponding to explicit and implicit dependencies.
-+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
-+dnl augments the CPPFLAGS variable.
-+AC_DEFUN([AC_LIB_LINKFLAGS],
-+[
-+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-+  AC_REQUIRE([AC_LIB_RPATH])
-+  define([Name],[translit([$1],[./-], [___])])
-+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-+  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
-+    AC_LIB_LINKFLAGS_BODY([$1], [$2])
-+    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
-+    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
-+    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
-+  ])
-+  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
-+  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
-+  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
-+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
-+  AC_SUBST([LIB]NAME)
-+  AC_SUBST([LTLIB]NAME)
-+  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
-+  dnl results of this search when this library appears as a dependency.
-+  HAVE_LIB[]NAME=yes
-+  undefine([Name])
-+  undefine([NAME])
-+])
-+
-+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
-+dnl searches for libname and the libraries corresponding to explicit and
-+dnl implicit dependencies, together with the specified include files and
-+dnl the ability to compile and link the specified testcode. If found, it
-+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
-+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
-+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
-+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
-+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
-+[
-+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
-+  AC_REQUIRE([AC_LIB_RPATH])
-+  define([Name],[translit([$1],[./-], [___])])
-+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-+
-+  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
-+  dnl accordingly.
-+  AC_LIB_LINKFLAGS_BODY([$1], [$2])
-+
-+  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
-+  dnl because if the user has installed lib[]Name and not disabled its use
-+  dnl via --without-lib[]Name-prefix, he wants to use it.
-+  ac_save_CPPFLAGS="$CPPFLAGS"
-+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
-+
-+  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
-+    ac_save_LIBS="$LIBS"
-+    LIBS="$LIBS $LIB[]NAME"
-+    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
-+    LIBS="$ac_save_LIBS"
-+  ])
-+  if test "$ac_cv_lib[]Name" = yes; then
-+    HAVE_LIB[]NAME=yes
-+    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
-+    AC_MSG_CHECKING([how to link with lib[]$1])
-+    AC_MSG_RESULT([$LIB[]NAME])
-+  else
-+    HAVE_LIB[]NAME=no
-+    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
-+    dnl $INC[]NAME either.
-+    CPPFLAGS="$ac_save_CPPFLAGS"
-+    LIB[]NAME=
-+    LTLIB[]NAME=
-+  fi
-+  AC_SUBST([HAVE_LIB]NAME)
-+  AC_SUBST([LIB]NAME)
-+  AC_SUBST([LTLIB]NAME)
-+  undefine([Name])
-+  undefine([NAME])
-+])
-+
-+dnl Determine the platform dependent parameters needed to use rpath:
-+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
-+dnl hardcode_direct, hardcode_minus_L.
-+AC_DEFUN([AC_LIB_RPATH],
-+[
-+  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
-+  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
-+  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
-+  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
-+  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
-+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
-+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-+    . ./conftest.sh
-+    rm -f ./conftest.sh
-+    acl_cv_rpath=done
-+  ])
-+  wl="$acl_cv_wl"
-+  libext="$acl_cv_libext"
-+  shlibext="$acl_cv_shlibext"
-+  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-+  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-+  hardcode_direct="$acl_cv_hardcode_direct"
-+  hardcode_minus_L="$acl_cv_hardcode_minus_L"
-+  dnl Determine whether the user wants rpath handling at all.
-+  AC_ARG_ENABLE(rpath,
-+    [  --disable-rpath         do not hardcode runtime library paths],
-+    :, enable_rpath=yes)
-+])
-+
-+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
-+dnl the libraries corresponding to explicit and implicit dependencies.
-+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
-+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
-+[
-+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
-+  dnl By default, look in $includedir and $libdir.
-+  use_additional=yes
-+  AC_LIB_WITH_FINAL_PREFIX([
-+    eval additional_includedir=\"$includedir\"
-+    eval additional_libdir=\"$libdir\"
-+  ])
-+  AC_LIB_ARG_WITH([lib$1-prefix],
-+[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
-+  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
-+[
-+    if test "X$withval" = "Xno"; then
-+      use_additional=no
-+    else
-+      if test "X$withval" = "X"; then
-+        AC_LIB_WITH_FINAL_PREFIX([
-+          eval additional_includedir=\"$includedir\"
-+          eval additional_libdir=\"$libdir\"
-+        ])
-+      else
-+        additional_includedir="$withval/include"
-+        additional_libdir="$withval/lib"
-+      fi
-+    fi
-+])
-+  dnl Search the library and its dependencies in $additional_libdir and
-+  dnl $LDFLAGS. Using breadth-first-seach.
-+  LIB[]NAME=
-+  LTLIB[]NAME=
-+  INC[]NAME=
-+  rpathdirs=
-+  ltrpathdirs=
-+  names_already_handled=
-+  names_next_round='$1 $2'
-+  while test -n "$names_next_round"; do
-+    names_this_round="$names_next_round"
-+    names_next_round=
-+    for name in $names_this_round; do
-+      already_handled=
-+      for n in $names_already_handled; do
-+        if test "$n" = "$name"; then
-+          already_handled=yes
-+          break
-+        fi
-+      done
-+      if test -z "$already_handled"; then
-+        names_already_handled="$names_already_handled $name"
-+        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
-+        dnl or AC_LIB_HAVE_LINKFLAGS call.
-+        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
-+        eval value=\"\$HAVE_LIB$uppername\"
-+        if test -n "$value"; then
-+          if test "$value" = yes; then
-+            eval value=\"\$LIB$uppername\"
-+            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
-+            eval value=\"\$LTLIB$uppername\"
-+            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
-+          else
-+            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
-+            dnl that this library doesn't exist. So just drop it.
-+            :
-+          fi
-+        else
-+          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
-+          dnl and the already constructed $LIBNAME/$LTLIBNAME.
-+          found_dir=
-+          found_la=
-+          found_so=
-+          found_a=
-+          if test $use_additional = yes; then
-+            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
-+              found_dir="$additional_libdir"
-+              found_so="$additional_libdir/lib$name.$shlibext"
-+              if test -f "$additional_libdir/lib$name.la"; then
-+                found_la="$additional_libdir/lib$name.la"
-+              fi
-+            else
-+              if test -f "$additional_libdir/lib$name.$libext"; then
-+                found_dir="$additional_libdir"
-+                found_a="$additional_libdir/lib$name.$libext"
-+                if test -f "$additional_libdir/lib$name.la"; then
-+                  found_la="$additional_libdir/lib$name.la"
-+                fi
-+              fi
-+            fi
-+          fi
-+          if test "X$found_dir" = "X"; then
-+            for x in $LDFLAGS $LTLIB[]NAME; do
-+              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-+              case "$x" in
-+                -L*)
-+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
-+                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
-+                    found_dir="$dir"
-+                    found_so="$dir/lib$name.$shlibext"
-+                    if test -f "$dir/lib$name.la"; then
-+                      found_la="$dir/lib$name.la"
-+                    fi
-+                  else
-+                    if test -f "$dir/lib$name.$libext"; then
-+                      found_dir="$dir"
-+                      found_a="$dir/lib$name.$libext"
-+                      if test -f "$dir/lib$name.la"; then
-+                        found_la="$dir/lib$name.la"
-+                      fi
-+                    fi
-+                  fi
-+                  ;;
-+              esac
-+              if test "X$found_dir" != "X"; then
-+                break
-+              fi
-+            done
-+          fi
-+          if test "X$found_dir" != "X"; then
-+            dnl Found the library.
-+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
-+            if test "X$found_so" != "X"; then
-+              dnl Linking with a shared library. We attempt to hardcode its
-+              dnl directory into the executable's runpath, unless it's the
-+              dnl standard /usr/lib.
-+              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
-+                dnl No hardcoding is needed.
-+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-+              else
-+                dnl Use an explicit option to hardcode DIR into the resulting
-+                dnl binary.
-+                dnl Potentially add DIR to ltrpathdirs.
-+                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
-+                haveit=
-+                for x in $ltrpathdirs; do
-+                  if test "X$x" = "X$found_dir"; then
-+                    haveit=yes
-+                    break
-+                  fi
-+                done
-+                if test -z "$haveit"; then
-+                  ltrpathdirs="$ltrpathdirs $found_dir"
-+                fi
-+                dnl The hardcoding into $LIBNAME is system dependent.
-+                if test "$hardcode_direct" = yes; then
-+                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
-+                  dnl resulting binary.
-+                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-+                else
-+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
-+                    dnl Use an explicit option to hardcode DIR into the resulting
-+                    dnl binary.
-+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-+                    dnl Potentially add DIR to rpathdirs.
-+                    dnl The rpathdirs will be appended to $LIBNAME at the end.
-+                    haveit=
-+                    for x in $rpathdirs; do
-+                      if test "X$x" = "X$found_dir"; then
-+                        haveit=yes
-+                        break
-+                      fi
-+                    done
-+                    if test -z "$haveit"; then
-+                      rpathdirs="$rpathdirs $found_dir"
-+                    fi
-+                  else
-+                    dnl Rely on "-L$found_dir".
-+                    dnl But don't add it if it's already contained in the LDFLAGS
-+                    dnl or the already constructed $LIBNAME
-+                    haveit=
-+                    for x in $LDFLAGS $LIB[]NAME; do
-+                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-+                      if test "X$x" = "X-L$found_dir"; then
-+                        haveit=yes
-+                        break
-+                      fi
-+                    done
-+                    if test -z "$haveit"; then
-+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
-+                    fi
-+                    if test "$hardcode_minus_L" != no; then
-+                      dnl FIXME: Not sure whether we should use
-+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-+                      dnl here.
-+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-+                    else
-+                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
-+                      dnl here, because this doesn't fit in flags passed to the
-+                      dnl compiler. So give up. No hardcoding. This affects only
-+                      dnl very old systems.
-+                      dnl FIXME: Not sure whether we should use
-+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-+                      dnl here.
-+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
-+                    fi
-+                  fi
-+                fi
-+              fi
-+            else
-+              if test "X$found_a" != "X"; then
-+                dnl Linking with a static library.
-+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
-+              else
-+                dnl We shouldn't come here, but anyway it's good to have a
-+                dnl fallback.
-+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
-+              fi
-+            fi
-+            dnl Assume the include files are nearby.
-+            additional_includedir=
-+            case "$found_dir" in
-+              */lib | */lib/)
-+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
-+                additional_includedir="$basedir/include"
-+                ;;
-+            esac
-+            if test "X$additional_includedir" != "X"; then
-+              dnl Potentially add $additional_includedir to $INCNAME.
-+              dnl But don't add it
-+              dnl   1. if it's the standard /usr/include,
-+              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
-+              dnl   3. if it's already present in $CPPFLAGS or the already
-+              dnl      constructed $INCNAME,
-+              dnl   4. if it doesn't exist as a directory.
-+              if test "X$additional_includedir" != "X/usr/include"; then
-+                haveit=
-+                if test "X$additional_includedir" = "X/usr/local/include"; then
-+                  if test -n "$GCC"; then
-+                    case $host_os in
-+                      linux*) haveit=yes;;
-+                    esac
-+                  fi
-+                fi
-+                if test -z "$haveit"; then
-+                  for x in $CPPFLAGS $INC[]NAME; do
-+                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-+                    if test "X$x" = "X-I$additional_includedir"; then
-+                      haveit=yes
-+                      break
-+                    fi
-+                  done
-+                  if test -z "$haveit"; then
-+                    if test -d "$additional_includedir"; then
-+                      dnl Really add $additional_includedir to $INCNAME.
-+                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
-+                    fi
-+                  fi
-+                fi
-+              fi
-+            fi
-+            dnl Look for dependencies.
-+            if test -n "$found_la"; then
-+              dnl Read the .la file. It defines the variables
-+              dnl dlname, library_names, old_library, dependency_libs, current,
-+              dnl age, revision, installed, dlopen, dlpreopen, libdir.
-+              save_libdir="$libdir"
-+              case "$found_la" in
-+                */* | *\\*) . "$found_la" ;;
-+                *) . "./$found_la" ;;
-+              esac
-+              libdir="$save_libdir"
-+              dnl We use only dependency_libs.
-+              for dep in $dependency_libs; do
-+                case "$dep" in
-+                  -L*)
-+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-+                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
-+                    dnl But don't add it
-+                    dnl   1. if it's the standard /usr/lib,
-+                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
-+                    dnl   3. if it's already present in $LDFLAGS or the already
-+                    dnl      constructed $LIBNAME,
-+                    dnl   4. if it doesn't exist as a directory.
-+                    if test "X$additional_libdir" != "X/usr/lib"; then
-+                      haveit=
-+                      if test "X$additional_libdir" = "X/usr/local/lib"; then
-+                        if test -n "$GCC"; then
-+                          case $host_os in
-+                            linux*) haveit=yes;;
-+                          esac
-+                        fi
-+                      fi
-+                      if test -z "$haveit"; then
-+                        haveit=
-+                        for x in $LDFLAGS $LIB[]NAME; do
-+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-+                          if test "X$x" = "X-L$additional_libdir"; then
-+                            haveit=yes
-+                            break
-+                          fi
-+                        done
-+                        if test -z "$haveit"; then
-+                          if test -d "$additional_libdir"; then
-+                            dnl Really add $additional_libdir to $LIBNAME.
-+                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
-+                          fi
-+                        fi
-+                        haveit=
-+                        for x in $LDFLAGS $LTLIB[]NAME; do
-+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-+                          if test "X$x" = "X-L$additional_libdir"; then
-+                            haveit=yes
-+                            break
-+                          fi
-+                        done
-+                        if test -z "$haveit"; then
-+                          if test -d "$additional_libdir"; then
-+                            dnl Really add $additional_libdir to $LTLIBNAME.
-+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
-+                          fi
-+                        fi
-+                      fi
-+                    fi
-+                    ;;
-+                  -R*)
-+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
-+                    if test "$enable_rpath" != no; then
-+                      dnl Potentially add DIR to rpathdirs.
-+                      dnl The rpathdirs will be appended to $LIBNAME at the end.
-+                      haveit=
-+                      for x in $rpathdirs; do
-+                        if test "X$x" = "X$dir"; then
-+                          haveit=yes
-+                          break
-+                        fi
-+                      done
-+                      if test -z "$haveit"; then
-+                        rpathdirs="$rpathdirs $dir"
-+                      fi
-+                      dnl Potentially add DIR to ltrpathdirs.
-+                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
-+                      haveit=
-+                      for x in $ltrpathdirs; do
-+                        if test "X$x" = "X$dir"; then
-+                          haveit=yes
-+                          break
-+                        fi
-+                      done
-+                      if test -z "$haveit"; then
-+                        ltrpathdirs="$ltrpathdirs $dir"
-+                      fi
-+                    fi
-+                    ;;
-+                  -l*)
-+                    dnl Handle this in the next round.
-+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
-+                    ;;
-+                  *.la)
-+                    dnl Handle this in the next round. Throw away the .la's
-+                    dnl directory; it is already contained in a preceding -L
-+                    dnl option.
-+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
-+                    ;;
-+                  *)
-+                    dnl Most likely an immediate library name.
-+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
-+                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
-+                    ;;
-+                esac
-+              done
-+            fi
-+          else
-+            dnl Didn't find the library; assume it is in the system directories
-+            dnl known to the linker and runtime loader. (All the system
-+            dnl directories known to the linker should also be known to the
-+            dnl runtime loader, otherwise the system is severely misconfigured.)
-+            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
-+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
-+          fi
-+        fi
-+      fi
-+    done
-+  done
-+  if test "X$rpathdirs" != "X"; then
-+    if test -n "$hardcode_libdir_separator"; then
-+      dnl Weird platform: only the last -rpath option counts, the user must
-+      dnl pass all path elements in one option. We can arrange that for a
-+      dnl single library, but not when more than one $LIBNAMEs are used.
-+      alldirs=
-+      for found_dir in $rpathdirs; do
-+        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
-+      done
-+      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
-+      acl_save_libdir="$libdir"
-+      libdir="$alldirs"
-+      eval flag=\"$hardcode_libdir_flag_spec\"
-+      libdir="$acl_save_libdir"
-+      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
-+    else
-+      dnl The -rpath options are cumulative.
-+      for found_dir in $rpathdirs; do
-+        acl_save_libdir="$libdir"
-+        libdir="$found_dir"
-+        eval flag=\"$hardcode_libdir_flag_spec\"
-+        libdir="$acl_save_libdir"
-+        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
-+      done
-+    fi
-+  fi
-+  if test "X$ltrpathdirs" != "X"; then
-+    dnl When using libtool, the option that works for both libraries and
-+    dnl executables is -R. The -R options are cumulative.
-+    for found_dir in $ltrpathdirs; do
-+      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
-+    done
-+  fi
-+])
-+
-+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
-+dnl unless already present in VAR.
-+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
-+dnl contains two or three consecutive elements that belong together.
-+AC_DEFUN([AC_LIB_APPENDTOVAR],
-+[
-+  for element in [$2]; do
-+    haveit=
-+    for x in $[$1]; do
-+      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-+      if test "X$x" = "X$element"; then
-+        haveit=yes
-+        break
-+      fi
-+    done
-+    if test -z "$haveit"; then
-+      [$1]="${[$1]}${[$1]:+ }$element"
-+    fi
-+  done
-+])
-+
-+# lib-ld.m4 serial 3 (gettext-0.13)
-+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl Subroutines of libtool.m4,
-+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
-+dnl with libtool.m4.
-+
-+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
-+AC_DEFUN([AC_LIB_PROG_LD_GNU],
-+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
-+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-+case `$LD -v 2>&1 </dev/null` in
-+*GNU* | *'with BFD'*)
-+  acl_cv_prog_gnu_ld=yes ;;
-+*)
-+  acl_cv_prog_gnu_ld=no ;;
-+esac])
-+with_gnu_ld=$acl_cv_prog_gnu_ld
-+])
-+
-+dnl From libtool-1.4. Sets the variable LD.
-+AC_DEFUN([AC_LIB_PROG_LD],
-+[AC_ARG_WITH(gnu-ld,
-+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
-+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-+AC_REQUIRE([AC_PROG_CC])dnl
-+AC_REQUIRE([AC_CANONICAL_HOST])dnl
-+# Prepare PATH_SEPARATOR.
-+# The user is always right.
-+if test "${PATH_SEPARATOR+set}" != set; then
-+  echo "#! /bin/sh" >conf$$.sh
-+  echo  "exit 0"   >>conf$$.sh
-+  chmod +x conf$$.sh
-+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-+    PATH_SEPARATOR=';'
-+  else
-+    PATH_SEPARATOR=:
-+  fi
-+  rm -f conf$$.sh
-+fi
-+ac_prog=ld
-+if test "$GCC" = yes; then
-+  # Check if gcc -print-prog-name=ld gives a path.
-+  AC_MSG_CHECKING([for ld used by GCC])
-+  case $host in
-+  *-*-mingw*)
-+    # gcc leaves a trailing carriage return which upsets mingw
-+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-+  *)
-+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-+  esac
-+  case $ac_prog in
-+    # Accept absolute paths.
-+    [[\\/]* | [A-Za-z]:[\\/]*)]
-+      [re_direlt='/[^/][^/]*/\.\./']
-+      # Canonicalize the path of ld
-+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-+      done
-+      test -z "$LD" && LD="$ac_prog"
-+      ;;
-+  "")
-+    # If it fails, then pretend we aren't using GCC.
-+    ac_prog=ld
-+    ;;
-+  *)
-+    # If it is relative, then search for the first ld in PATH.
-+    with_gnu_ld=unknown
-+    ;;
-+  esac
-+elif test "$with_gnu_ld" = yes; then
-+  AC_MSG_CHECKING([for GNU ld])
-+else
-+  AC_MSG_CHECKING([for non-GNU ld])
-+fi
-+AC_CACHE_VAL(acl_cv_path_LD,
-+[if test -z "$LD"; then
-+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-+  for ac_dir in $PATH; do
-+    test -z "$ac_dir" && ac_dir=.
-+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-+      acl_cv_path_LD="$ac_dir/$ac_prog"
-+      # Check to see if the program is GNU ld.  I'd rather use --version,
-+      # but apparently some GNU ld's only accept -v.
-+      # Break only if it was the GNU/non-GNU ld that we prefer.
-+      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
-+      *GNU* | *'with BFD'*)
-+	test "$with_gnu_ld" != no && break ;;
-+      *)
-+	test "$with_gnu_ld" != yes && break ;;
-+      esac
-+    fi
-+  done
-+  IFS="$ac_save_ifs"
-+else
-+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
-+fi])
-+LD="$acl_cv_path_LD"
-+if test -n "$LD"; then
-+  AC_MSG_RESULT($LD)
-+else
-+  AC_MSG_RESULT(no)
-+fi
-+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-+AC_LIB_PROG_LD_GNU
-+])
-+
-+# isc-posix.m4 serial 2 (gettext-0.11.2)
-+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
-+
-+# This test replaces the one in autoconf.
-+# Currently this macro should have the same name as the autoconf macro
-+# because gettext's gettext.m4 (distributed in the automake package)
-+# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
-+# give these diagnostics:
-+#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
-+#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
-+
-+undefine([AC_ISC_POSIX])
-+
-+AC_DEFUN([AC_ISC_POSIX],
-+  [
-+    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
-+    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
-+  ]
-+)
-+
-+# Check for stdbool.h that conforms to C99.
-+
-+# Copyright (C) 2002-2003 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2, or (at your option)
-+# any later version.
-+
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-+# 02111-1307, USA.
-+
-+# Prepare for substituting <stdbool.h> if it is not supported.
-+
-+AC_DEFUN([AM_STDBOOL_H],
-+[
-+  AC_REQUIRE([AC_HEADER_STDBOOL])
-+
-+  # Define two additional variables used in the Makefile substitution.
-+
-+  if test "$ac_cv_header_stdbool_h" = yes; then
-+    STDBOOL_H=''
-+  else
-+    STDBOOL_H='stdbool.h'
-+  fi
-+  AC_SUBST([STDBOOL_H])
-+
-+  if test "$ac_cv_type__Bool" = yes; then
-+    HAVE__BOOL=1
-+  else
-+    HAVE__BOOL=0
-+  fi
-+  AC_SUBST([HAVE__BOOL])
-+])
-+
-+# This macro is only needed in autoconf <= 2.54.  Newer versions of autoconf
-+# have this macro built-in.
-+
-+AC_DEFUN([AC_HEADER_STDBOOL],
-+  [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
-+     [ac_cv_header_stdbool_h],
-+     [AC_TRY_COMPILE(
-+	[
-+	  #include <stdbool.h>
-+	  #ifndef bool
-+	   "error: bool is not defined"
-+	  #endif
-+	  #ifndef false
-+	   "error: false is not defined"
-+	  #endif
-+	  #if false
-+	   "error: false is not 0"
-+	  #endif
-+	  #ifndef true
-+	   "error: false is not defined"
-+	  #endif
-+	  #if true != 1
-+	   "error: true is not 1"
-+	  #endif
-+	  #ifndef __bool_true_false_are_defined
-+	   "error: __bool_true_false_are_defined is not defined"
-+	  #endif
-+
-+	  struct s { _Bool s: 1; _Bool t; } s;
-+
-+	  char a[true == 1 ? 1 : -1];
-+	  char b[false == 0 ? 1 : -1];
-+	  char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-+	  char d[(bool) -0.5 == true ? 1 : -1];
-+	  bool e = &s;
-+	  char f[(_Bool) -0.0 == false ? 1 : -1];
-+	  char g[true];
-+	  char h[sizeof (_Bool)];
-+	  char i[sizeof s.t];
-+	],
-+	[ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
-+	[ac_cv_header_stdbool_h=yes],
-+	[ac_cv_header_stdbool_h=no])])
-+   AC_CHECK_TYPES([_Bool])
-+   if test $ac_cv_header_stdbool_h = yes; then
-+     AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
-+   fi])
-+
-+#serial 5
-+
-+dnl From Jim Meyering
-+
-+dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
-+dnl usually in <utime.h>.
-+dnl Some systems have utime.h but don't declare the struct anywhere.
-+
-+AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
-+[
-+  AC_CHECK_HEADERS_ONCE(sys/time.h utime.h)
-+  AC_REQUIRE([AC_HEADER_TIME])
-+  AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
-+    [AC_TRY_COMPILE(
-+      [
-+#ifdef TIME_WITH_SYS_TIME
-+# include <sys/time.h>
-+# include <time.h>
-+#else
-+# ifdef HAVE_SYS_TIME_H
-+#  include <sys/time.h>
-+# else
-+#  include <time.h>
-+# endif
-+#endif
-+#ifdef HAVE_UTIME_H
-+# include <utime.h>
-+#endif
-+      ],
-+      [static struct utimbuf x; x.actime = x.modtime;],
-+      fu_cv_sys_struct_utimbuf=yes,
-+      fu_cv_sys_struct_utimbuf=no)
-+    ])
-+
-+  if test $fu_cv_sys_struct_utimbuf = yes; then
-+    AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
-+      [Define if struct utimbuf is declared -- usually in <utime.h>.
-+       Some systems have utime.h but don't declare the struct anywhere. ])
-+  fi
-+])
-+
-+# onceonly.m4 serial 3
-+dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl This file defines some "once only" variants of standard autoconf macros.
-+dnl   AC_CHECK_HEADERS_ONCE         like  AC_CHECK_HEADERS
-+dnl   AC_CHECK_FUNCS_ONCE           like  AC_CHECK_FUNCS
-+dnl   AC_CHECK_DECLS_ONCE           like  AC_CHECK_DECLS
-+dnl   AC_REQUIRE([AC_HEADER_STDC])  like  AC_HEADER_STDC
-+dnl The advantage is that the check for each of the headers/functions/decls
-+dnl will be put only once into the 'configure' file. It keeps the size of
-+dnl the 'configure' file down, and avoids redundant output when 'configure'
-+dnl is run.
-+dnl The drawback is that the checks cannot be conditionalized. If you write
-+dnl   if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
-+dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
-+dnl empty, and the check will be inserted before the body of the AC_DEFUNed
-+dnl function.
-+
-+dnl Autoconf version 2.57 or newer is recommended.
-+AC_PREREQ(2.54)
-+
-+# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
-+# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
-+AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
-+  :
-+  AC_FOREACH([gl_HEADER_NAME], [$1], [
-+    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]),
-+                                                 [-./], [___])), [
-+      AC_CHECK_HEADERS(gl_HEADER_NAME)
-+    ])
-+    AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
-+                                                   [-./], [___])))
-+  ])
-+])
-+
-+# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
-+# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
-+AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
-+  :
-+  AC_FOREACH([gl_FUNC_NAME], [$1], [
-+    AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
-+      AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME]))
-+    ])
-+    AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
-+  ])
-+])
-+
-+# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
-+# AC_CHECK_DECLS(DECL1, DECL2, ...).
-+AC_DEFUN([AC_CHECK_DECLS_ONCE], [
-+  :
-+  AC_FOREACH([gl_DECL_NAME], [$1], [
-+    AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
-+      AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
-+    ])
-+    AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
-+  ])
-+])
-+
- # backupfile.m4 serial 1
- dnl Copyright (C) 2002 Free Software Foundation, Inc.
- dnl This file is free software, distributed under the terms of the GNU
-@@ -21,6 +1076,7 @@
-   AC_CHECK_HEADERS_ONCE(limits.h string.h unistd.h)
-   AC_CHECK_FUNCS(pathconf)
- ])
-+
- #serial 5
- 
- dnl From Jim Meyering.
-@@ -63,31 +1119,7 @@
-    fi
-   ]
- )
--# dirname.m4 serial 1
--dnl Copyright (C) 2002 Free Software Foundation, Inc.
--dnl This file is free software, distributed under the terms of the GNU
--dnl General Public License.  As a special exception to the GNU General
--dnl Public License, this file may be distributed as part of a program
--dnl that contains a configuration script generated by Autoconf, under
--dnl the same distribution terms as the rest of that program.
- 
--AC_DEFUN([gl_DIRNAME],
--[
--  dnl Prerequisites of lib/dirname.h.
--  AC_REQUIRE([jm_AC_DOS])
--
--  dnl Prerequisites of lib/dirname.c.
--  AC_REQUIRE([AC_HEADER_STDC])
--  AC_CHECK_HEADERS_ONCE(string.h)
--
--  dnl Prerequisites of lib/basename.c.
--  AC_REQUIRE([AC_HEADER_STDC])
--  AC_CHECK_HEADERS_ONCE(string.h)
--
--  dnl Prerequisites of lib/stripslash.c.
--  AC_REQUIRE([AC_HEADER_STDC])
--  AC_CHECK_HEADERS_ONCE(string.h)
--])
- #serial 5
- 
- # Define some macros required for proper operation of code in lib/*.c
-@@ -141,6 +1173,33 @@
-       [Define if the backslash character may also serve as a file name
-        component separator.])
-   ])
-+
-+# dirname.m4 serial 1
-+dnl Copyright (C) 2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+AC_DEFUN([gl_DIRNAME],
-+[
-+  dnl Prerequisites of lib/dirname.h.
-+  AC_REQUIRE([jm_AC_DOS])
-+
-+  dnl Prerequisites of lib/dirname.c.
-+  AC_REQUIRE([AC_HEADER_STDC])
-+  AC_CHECK_HEADERS_ONCE(string.h)
-+
-+  dnl Prerequisites of lib/basename.c.
-+  AC_REQUIRE([AC_HEADER_STDC])
-+  AC_CHECK_HEADERS_ONCE(string.h)
-+
-+  dnl Prerequisites of lib/stripslash.c.
-+  AC_REQUIRE([AC_HEADER_STDC])
-+  AC_CHECK_HEADERS_ONCE(string.h)
-+])
-+
- #serial 7
- 
- AC_DEFUN([gl_ERROR],
-@@ -159,7 +1218,67 @@
-   AC_CHECK_DECLS([strerror])
-   AC_FUNC_STRERROR_R
- ])
--# getopt.m4 serial 1
-+
-+# memchr.m4 serial 1
-+dnl Copyright (C) 2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+AC_DEFUN([gl_FUNC_MEMCHR],
-+[
-+  AC_REPLACE_FUNCS(memchr)
-+  if test $ac_cv_func_memchr = no; then
-+    jm_PREREQ_MEMCHR
-+  fi
-+])
-+
-+# Prerequisites of lib/memchr.c.
-+AC_DEFUN([jm_PREREQ_MEMCHR], [
-+  AC_CHECK_HEADERS_ONCE(limits.h stdlib.h)
-+  AC_CHECK_HEADERS(bp-sym.h)
-+])
-+
-+# rmdir.m4 serial 1
-+dnl Copyright (C) 2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+AC_DEFUN([gl_FUNC_RMDIR],
-+[
-+  AC_REPLACE_FUNCS(rmdir)
-+  if test $ac_cv_func_rmdir = no; then
-+    gl_PREREQ_RMDIR
-+  fi
-+])
-+
-+# Prerequisites of lib/rmdir.c.
-+AC_DEFUN([gl_PREREQ_RMDIR], [
-+  AC_REQUIRE([AC_HEADER_STAT])
-+  :
-+])
-+
-+
-+# getopt.m4 serial 1
-+dnl Copyright (C) 2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+AC_DEFUN([gl_GETOPT],
-+[
-+  dnl Prerequisites of lib/getopt.c.
-+  AC_CHECK_HEADERS_ONCE(string.h)
-+])
-+
-+# xalloc.m4 serial 1
- dnl Copyright (C) 2002 Free Software Foundation, Inc.
- dnl This file is free software, distributed under the terms of the GNU
- dnl General Public License.  As a special exception to the GNU General
-@@ -167,11 +1286,25 @@
- dnl that contains a configuration script generated by Autoconf, under
- dnl the same distribution terms as the rest of that program.
- 
--AC_DEFUN([gl_GETOPT],
-+AC_DEFUN([gl_XALLOC],
- [
--  dnl Prerequisites of lib/getopt.c.
-+  gl_PREREQ_XMALLOC
-+  gl_PREREQ_XSTRDUP
-+])
-+
-+# Prerequisites of lib/xmalloc.c.
-+AC_DEFUN([gl_PREREQ_XMALLOC], [
-+  AC_REQUIRE([AC_HEADER_STDC])
-+  AC_REQUIRE([jm_FUNC_MALLOC])
-+  AC_REQUIRE([jm_FUNC_REALLOC])
-+])
-+
-+# Prerequisites of lib/xstrdup.c.
-+AC_DEFUN([gl_PREREQ_XSTRDUP], [
-+  AC_REQUIRE([AC_HEADER_STDC])
-   AC_CHECK_HEADERS_ONCE(string.h)
- ])
-+
- # malloc.m4 serial 7
- dnl Copyright (C) 2002 Free Software Foundation, Inc.
- dnl This file is free software, distributed under the terms of the GNU
-@@ -197,66 +1330,8 @@
- AC_DEFUN([gl_PREREQ_MALLOC], [
-   :
- ])
--# mbrtowc.m4 serial 5
--dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
--dnl This file is free software, distributed under the terms of the GNU
--dnl General Public License.  As a special exception to the GNU General
--dnl Public License, this file may be distributed as part of a program
--dnl that contains a configuration script generated by Autoconf, under
--dnl the same distribution terms as the rest of that program.
--
--dnl From Paul Eggert
--
--dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with
--dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
--
--AC_DEFUN([jm_FUNC_MBRTOWC],
--[
--  AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
--    jm_cv_func_mbrtowc,
--    [AC_TRY_LINK(
--       [#include <wchar.h>],
--       [mbstate_t state; return ! (sizeof state && mbrtowc);],
--       jm_cv_func_mbrtowc=yes,
--       jm_cv_func_mbrtowc=no)])
--  if test $jm_cv_func_mbrtowc = yes; then
--    AC_DEFINE(HAVE_MBRTOWC, 1,
--      [Define to 1 if mbrtowc and mbstate_t are properly declared.])
--  fi
--])
--# mbstate_t.m4 serial 9
--dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
--dnl This file is free software, distributed under the terms of the GNU
--dnl General Public License.  As a special exception to the GNU General
--dnl Public License, this file may be distributed as part of a program
--dnl that contains a configuration script generated by Autoconf, under
--dnl the same distribution terms as the rest of that program.
--
--# From Paul Eggert.
--
--# BeOS 5 has <wchar.h> but does not define mbstate_t,
--# so you can't declare an object of that type.
--# Check for this incompatibility with Standard C.
- 
--# AC_TYPE_MBSTATE_T
--# -----------------
--AC_DEFUN([AC_TYPE_MBSTATE_T],
--  [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
--     [AC_COMPILE_IFELSE(
--	[AC_LANG_PROGRAM(
--	   [AC_INCLUDES_DEFAULT
--#	    include <wchar.h>],
--	   [mbstate_t x; return sizeof x;])],
--	[ac_cv_type_mbstate_t=yes],
--	[ac_cv_type_mbstate_t=no])])
--   if test $ac_cv_type_mbstate_t = yes; then
--     AC_DEFINE([HAVE_MBSTATE_T], 1,
--	       [Define to 1 if <wchar.h> declares mbstate_t.])
--   else
--     AC_DEFINE([mbstate_t], int,
--	       [Define to a type if <wchar.h> does not define.])
--   fi])
--# memchr.m4 serial 1
-+# realloc.m4 serial 7
- dnl Copyright (C) 2002 Free Software Foundation, Inc.
- dnl This file is free software, distributed under the terms of the GNU
- dnl General Public License.  As a special exception to the GNU General
-@@ -264,116 +1339,24 @@
- dnl that contains a configuration script generated by Autoconf, under
- dnl the same distribution terms as the rest of that program.
- 
--AC_DEFUN([gl_FUNC_MEMCHR],
-+dnl From Jim Meyering.
-+dnl Determine whether realloc works when both arguments are 0.
-+dnl If it doesn't, arrange to use the replacement function.
-+
-+AC_DEFUN([jm_FUNC_REALLOC],
- [
--  AC_REPLACE_FUNCS(memchr)
--  if test $ac_cv_func_memchr = no; then
--    jm_PREREQ_MEMCHR
-+  AC_REQUIRE([AC_FUNC_REALLOC])
-+  dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works.
-+  if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then
-+    gl_PREREQ_REALLOC
-   fi
- ])
- 
--# Prerequisites of lib/memchr.c.
--AC_DEFUN([jm_PREREQ_MEMCHR], [
--  AC_CHECK_HEADERS_ONCE(limits.h stdlib.h)
--  AC_CHECK_HEADERS(bp-sym.h)
--])
--#serial 1
--
--dnl From Mumit Khan and Paul Eggert
--dnl Determine whether mkdir accepts only one argument instead of the usual two.
--
--AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG],
--  [AC_CHECK_FUNCS(mkdir)
--   AC_CACHE_CHECK([whether mkdir takes only one argument],
--     patch_cv_mkdir_takes_one_arg,
--     [patch_cv_mkdir_takes_one_arg=no
--      if test $ac_cv_func_mkdir = yes; then
--        AC_TRY_COMPILE([
--#include <sys/types.h>
--#include <sys/stat.h>
--	  ],
--	  [mkdir (".", 0);],
--	  ,
--	  [AC_TRY_COMPILE([
--#include <sys/types.h>
--#include <sys/stat.h>
--	     ],
--	     [mkdir (".");],
--	     patch_cv_mkdir_takes_one_arg=yes
--	  )]
--	)
--      fi
--     ]
--   )
--   if test $patch_cv_mkdir_takes_one_arg = yes; then
--     AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
--       [Define if mkdir takes only one argument.])
--   fi
--  ]
--)
--# onceonly.m4 serial 3
--dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
--dnl This file is free software, distributed under the terms of the GNU
--dnl General Public License.  As a special exception to the GNU General
--dnl Public License, this file may be distributed as part of a program
--dnl that contains a configuration script generated by Autoconf, under
--dnl the same distribution terms as the rest of that program.
--
--dnl This file defines some "once only" variants of standard autoconf macros.
--dnl   AC_CHECK_HEADERS_ONCE         like  AC_CHECK_HEADERS
--dnl   AC_CHECK_FUNCS_ONCE           like  AC_CHECK_FUNCS
--dnl   AC_CHECK_DECLS_ONCE           like  AC_CHECK_DECLS
--dnl   AC_REQUIRE([AC_HEADER_STDC])  like  AC_HEADER_STDC
--dnl The advantage is that the check for each of the headers/functions/decls
--dnl will be put only once into the 'configure' file. It keeps the size of
--dnl the 'configure' file down, and avoids redundant output when 'configure'
--dnl is run.
--dnl The drawback is that the checks cannot be conditionalized. If you write
--dnl   if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
--dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
--dnl empty, and the check will be inserted before the body of the AC_DEFUNed
--dnl function.
--
--dnl Autoconf version 2.57 or newer is recommended.
--AC_PREREQ(2.54)
--
--# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
--# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
--AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
--  :
--  AC_FOREACH([gl_HEADER_NAME], [$1], [
--    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]),
--                                                 [-./], [___])), [
--      AC_CHECK_HEADERS(gl_HEADER_NAME)
--    ])
--    AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
--                                                   [-./], [___])))
--  ])
--])
--
--# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
--# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
--AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
-+# Prerequisites of lib/realloc.c.
-+AC_DEFUN([gl_PREREQ_REALLOC], [
-   :
--  AC_FOREACH([gl_FUNC_NAME], [$1], [
--    AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
--      AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME]))
--    ])
--    AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
--  ])
- ])
- 
--# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
--# AC_CHECK_DECLS(DECL1, DECL2, ...).
--AC_DEFUN([AC_CHECK_DECLS_ONCE], [
--  :
--  AC_FOREACH([gl_DECL_NAME], [$1], [
--    AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
--      AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
--    ])
--    AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
--  ])
--])
- # quote.m4 serial 1
- dnl Copyright (C) 2002 Free Software Foundation, Inc.
- dnl This file is free software, distributed under the terms of the GNU
-@@ -387,6 +1370,7 @@
-   dnl Prerequisites of lib/quote.c.
-   AC_CHECK_HEADERS_ONCE(stddef.h)
- ])
-+
- # quotearg.m4 serial 1
- dnl Copyright (C) 2002 Free Software Foundation, Inc.
- dnl This file is free software, distributed under the terms of the GNU
-@@ -403,32 +1387,69 @@
-   AC_TYPE_MBSTATE_T
-   jm_FUNC_MBRTOWC
- ])
--# realloc.m4 serial 7
--dnl Copyright (C) 2002 Free Software Foundation, Inc.
-+
-+# mbstate_t.m4 serial 9
-+dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
- dnl This file is free software, distributed under the terms of the GNU
- dnl General Public License.  As a special exception to the GNU General
- dnl Public License, this file may be distributed as part of a program
- dnl that contains a configuration script generated by Autoconf, under
- dnl the same distribution terms as the rest of that program.
- 
--dnl From Jim Meyering.
--dnl Determine whether realloc works when both arguments are 0.
--dnl If it doesn't, arrange to use the replacement function.
-+# From Paul Eggert.
- 
--AC_DEFUN([jm_FUNC_REALLOC],
-+# BeOS 5 has <wchar.h> but does not define mbstate_t,
-+# so you can't declare an object of that type.
-+# Check for this incompatibility with Standard C.
-+
-+# AC_TYPE_MBSTATE_T
-+# -----------------
-+AC_DEFUN([AC_TYPE_MBSTATE_T],
-+  [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
-+     [AC_COMPILE_IFELSE(
-+	[AC_LANG_PROGRAM(
-+	   [AC_INCLUDES_DEFAULT
-+#	    include <wchar.h>],
-+	   [mbstate_t x; return sizeof x;])],
-+	[ac_cv_type_mbstate_t=yes],
-+	[ac_cv_type_mbstate_t=no])])
-+   if test $ac_cv_type_mbstate_t = yes; then
-+     AC_DEFINE([HAVE_MBSTATE_T], 1,
-+	       [Define to 1 if <wchar.h> declares mbstate_t.])
-+   else
-+     AC_DEFINE([mbstate_t], int,
-+	       [Define to a type if <wchar.h> does not define.])
-+   fi])
-+
-+# mbrtowc.m4 serial 5
-+dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
-+dnl This file is free software, distributed under the terms of the GNU
-+dnl General Public License.  As a special exception to the GNU General
-+dnl Public License, this file may be distributed as part of a program
-+dnl that contains a configuration script generated by Autoconf, under
-+dnl the same distribution terms as the rest of that program.
-+
-+dnl From Paul Eggert
-+
-+dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with
-+dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
-+
-+AC_DEFUN([jm_FUNC_MBRTOWC],
- [
--  AC_REQUIRE([AC_FUNC_REALLOC])
--  dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works.
--  if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then
--    gl_PREREQ_REALLOC
-+  AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
-+    jm_cv_func_mbrtowc,
-+    [AC_TRY_LINK(
-+       [#include <wchar.h>],
-+       [mbstate_t state; return ! (sizeof state && mbrtowc);],
-+       jm_cv_func_mbrtowc=yes,
-+       jm_cv_func_mbrtowc=no)])
-+  if test $jm_cv_func_mbrtowc = yes; then
-+    AC_DEFINE(HAVE_MBRTOWC, 1,
-+      [Define to 1 if mbrtowc and mbstate_t are properly declared.])
-   fi
- ])
- 
--# Prerequisites of lib/realloc.c.
--AC_DEFUN([gl_PREREQ_REALLOC], [
--  :
--])
--# rmdir.m4 serial 1
-+# hash.m4 serial 1
- dnl Copyright (C) 2002 Free Software Foundation, Inc.
- dnl This file is free software, distributed under the terms of the GNU
- dnl General Public License.  As a special exception to the GNU General
-@@ -436,18 +1457,71 @@
- dnl that contains a configuration script generated by Autoconf, under
- dnl the same distribution terms as the rest of that program.
- 
--AC_DEFUN([gl_FUNC_RMDIR],
-+AC_DEFUN([gl_HASH],
- [
--  AC_REPLACE_FUNCS(rmdir)
--  if test $ac_cv_func_rmdir = no; then
--    gl_PREREQ_RMDIR
--  fi
-+  dnl Prerequisites of lib/hash.c.
-+  AC_CHECK_HEADERS_ONCE(stdlib.h)
-+  AC_HEADER_STDBOOL
-+  AC_CHECK_DECLS_ONCE(free malloc)
- ])
- 
--# Prerequisites of lib/rmdir.c.
--AC_DEFUN([gl_PREREQ_RMDIR], [
--  AC_REQUIRE([AC_HEADER_STAT])
--  :
-+AC_DEFUN([ag_CHECK_NANOSECOND_STAT],
-+  [AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
-+     [ac_cv_stat_nsec],
-+     [AC_TRY_COMPILE(
-+	[
-+	  #include <sys/types.h>
-+	  #include <sys/stat.h>
-+	  #include <unistd.h>
-+	  struct stat st;
-+	],
-+	[ return st.st_atimensec + st.st_mtimensec + st.st_ctimensec; ],
-+	[ac_cv_stat_nsec=yes],
-+	[ac_cv_stat_nsec=no])
-+     ])
-+   if test $ac_cv_stat_nsec = yes; then
-+     AC_DEFINE(HAVE_STAT_NSEC, 1, [Define to 1 if struct stat has nanosecond timestamps.])
-+   fi
-+
-+   AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
-+     [ac_cv_stat_timeval],
-+     [AC_TRY_COMPILE(
-+	[
-+	  #include <time.h>
-+	  #include <sys/types.h>
-+	  #include <sys/stat.h>
-+	  #include <unistd.h>
-+	  struct stat st;
-+	],
-+	[ return st.st_atim.tv_nsec + st.st_mtim.tv_nsec + st.st_ctim.tv_nsec; ],
-+	[ac_cv_stat_timeval=yes],
-+	[ac_cv_stat_timeval=no])
-+     ])
-+   if test $ac_cv_stat_timeval = yes; then
-+     AC_DEFINE(HAVE_STAT_TIMEVAL, 1, [Define to 1 if struct stat comtains struct timeval's.])
-+   fi])
-+
-+#serial 7 -*- autoconf -*-
-+
-+dnl From Jim Meyering.
-+dnl
-+dnl See if the glibc *_unlocked I/O macros or functions are available.
-+dnl Use only those *_unlocked macros or functions that are declared
-+dnl (because some of them were declared in Solaris 2.5.1 but were removed
-+dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
-+dnl on Solaris 2.6).
-+
-+AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
-+[
-+  dnl Persuade glibc <stdio.h> to declare fgets_unlocked(), fputs_unlocked()
-+  dnl etc.
-+  AC_REQUIRE([AC_GNU_SOURCE])
-+
-+  AC_CHECK_DECLS_ONCE(
-+     [clearerr_unlocked feof_unlocked ferror_unlocked
-+      fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
-+      fread_unlocked fwrite_unlocked getc_unlocked
-+      getchar_unlocked putc_unlocked putchar_unlocked])
- ])
- 
- # Check for setmode, DOS style.
-@@ -488,180 +1562,39 @@
-      AC_DEFINE(HAVE_SETMODE_DOS, 1,
-        [Define to 1 if you have the DOS-style `setmode' function.])
-    fi])
--# Check for stdbool.h that conforms to C99.
--
--# Copyright (C) 2002-2003 Free Software Foundation, Inc.
--
--# This program is free software; you can redistribute it and/or modify
--# it under the terms of the GNU General Public License as published by
--# the Free Software Foundation; either version 2, or (at your option)
--# any later version.
--
--# This program is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--# GNU General Public License for more details.
--
--# You should have received a copy of the GNU General Public License
--# along with this program; if not, write to the Free Software
--# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
--# 02111-1307, USA.
--
--# Prepare for substituting <stdbool.h> if it is not supported.
--
--AC_DEFUN([AM_STDBOOL_H],
--[
--  AC_REQUIRE([AC_HEADER_STDBOOL])
--
--  # Define two additional variables used in the Makefile substitution.
--
--  if test "$ac_cv_header_stdbool_h" = yes; then
--    STDBOOL_H=''
--  else
--    STDBOOL_H='stdbool.h'
--  fi
--  AC_SUBST([STDBOOL_H])
--
--  if test "$ac_cv_type__Bool" = yes; then
--    HAVE__BOOL=1
--  else
--    HAVE__BOOL=0
--  fi
--  AC_SUBST([HAVE__BOOL])
--])
--
--# This macro is only needed in autoconf <= 2.54.  Newer versions of autoconf
--# have this macro built-in.
--
--AC_DEFUN([AC_HEADER_STDBOOL],
--  [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
--     [ac_cv_header_stdbool_h],
--     [AC_TRY_COMPILE(
--	[
--	  #include <stdbool.h>
--	  #ifndef bool
--	   "error: bool is not defined"
--	  #endif
--	  #ifndef false
--	   "error: false is not defined"
--	  #endif
--	  #if false
--	   "error: false is not 0"
--	  #endif
--	  #ifndef true
--	   "error: false is not defined"
--	  #endif
--	  #if true != 1
--	   "error: true is not 1"
--	  #endif
--	  #ifndef __bool_true_false_are_defined
--	   "error: __bool_true_false_are_defined is not defined"
--	  #endif
--
--	  struct s { _Bool s: 1; _Bool t; } s;
--
--	  char a[true == 1 ? 1 : -1];
--	  char b[false == 0 ? 1 : -1];
--	  char c[__bool_true_false_are_defined == 1 ? 1 : -1];
--	  char d[(bool) -0.5 == true ? 1 : -1];
--	  bool e = &s;
--	  char f[(_Bool) -0.0 == false ? 1 : -1];
--	  char g[true];
--	  char h[sizeof (_Bool)];
--	  char i[sizeof s.t];
--	],
--	[ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
--	[ac_cv_header_stdbool_h=yes],
--	[ac_cv_header_stdbool_h=no])])
--   AC_CHECK_TYPES([_Bool])
--   if test $ac_cv_header_stdbool_h = yes; then
--     AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
--   fi])
--#serial 7 -*- autoconf -*-
--
--dnl From Jim Meyering.
--dnl
--dnl See if the glibc *_unlocked I/O macros or functions are available.
--dnl Use only those *_unlocked macros or functions that are declared
--dnl (because some of them were declared in Solaris 2.5.1 but were removed
--dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
--dnl on Solaris 2.6).
--
--AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
--[
--  dnl Persuade glibc <stdio.h> to declare fgets_unlocked(), fputs_unlocked()
--  dnl etc.
--  AC_REQUIRE([AC_GNU_SOURCE])
--
--  AC_CHECK_DECLS_ONCE(
--     [clearerr_unlocked feof_unlocked ferror_unlocked
--      fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
--      fread_unlocked fwrite_unlocked getc_unlocked
--      getchar_unlocked putc_unlocked putchar_unlocked])
--])
--#serial 5
--
--dnl From Jim Meyering
--
--dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
--dnl usually in <utime.h>.
--dnl Some systems have utime.h but don't declare the struct anywhere.
--
--AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
--[
--  AC_CHECK_HEADERS_ONCE(sys/time.h utime.h)
--  AC_REQUIRE([AC_HEADER_TIME])
--  AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
--    [AC_TRY_COMPILE(
--      [
--#ifdef TIME_WITH_SYS_TIME
--# include <sys/time.h>
--# include <time.h>
--#else
--# ifdef HAVE_SYS_TIME_H
--#  include <sys/time.h>
--# else
--#  include <time.h>
--# endif
--#endif
--#ifdef HAVE_UTIME_H
--# include <utime.h>
--#endif
--      ],
--      [static struct utimbuf x; x.actime = x.modtime;],
--      fu_cv_sys_struct_utimbuf=yes,
--      fu_cv_sys_struct_utimbuf=no)
--    ])
- 
--  if test $fu_cv_sys_struct_utimbuf = yes; then
--    AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
--      [Define if struct utimbuf is declared -- usually in <utime.h>.
--       Some systems have utime.h but don't declare the struct anywhere. ])
--  fi
--])
--# xalloc.m4 serial 1
--dnl Copyright (C) 2002 Free Software Foundation, Inc.
--dnl This file is free software, distributed under the terms of the GNU
--dnl General Public License.  As a special exception to the GNU General
--dnl Public License, this file may be distributed as part of a program
--dnl that contains a configuration script generated by Autoconf, under
--dnl the same distribution terms as the rest of that program.
-+#serial 1
- 
--AC_DEFUN([gl_XALLOC],
--[
--  gl_PREREQ_XMALLOC
--  gl_PREREQ_XSTRDUP
--])
-+dnl From Mumit Khan and Paul Eggert
-+dnl Determine whether mkdir accepts only one argument instead of the usual two.
- 
--# Prerequisites of lib/xmalloc.c.
--AC_DEFUN([gl_PREREQ_XMALLOC], [
--  AC_REQUIRE([AC_HEADER_STDC])
--  AC_REQUIRE([jm_FUNC_MALLOC])
--  AC_REQUIRE([jm_FUNC_REALLOC])
--])
-+AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG],
-+  [AC_CHECK_FUNCS(mkdir)
-+   AC_CACHE_CHECK([whether mkdir takes only one argument],
-+     patch_cv_mkdir_takes_one_arg,
-+     [patch_cv_mkdir_takes_one_arg=no
-+      if test $ac_cv_func_mkdir = yes; then
-+        AC_TRY_COMPILE([
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+	  ],
-+	  [mkdir (".", 0);],
-+	  ,
-+	  [AC_TRY_COMPILE([
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+	     ],
-+	     [mkdir (".");],
-+	     patch_cv_mkdir_takes_one_arg=yes
-+	  )]
-+	)
-+      fi
-+     ]
-+   )
-+   if test $patch_cv_mkdir_takes_one_arg = yes; then
-+     AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
-+       [Define if mkdir takes only one argument.])
-+   fi
-+  ]
-+)
- 
--# Prerequisites of lib/xstrdup.c.
--AC_DEFUN([gl_PREREQ_XSTRDUP], [
--  AC_REQUIRE([AC_HEADER_STDC])
--  AC_CHECK_HEADERS_ONCE(string.h)
--])
---- patch-2.5.9.orig/configure
-+++ patch-2.5.9/configure
-@@ -1,11 +1,10 @@
- #! /bin/sh
- # Guess values for system-dependent variables and create Makefiles.
--# Generated by GNU Autoconf 2.57 for patch 2.5.9.
-+# Generated by GNU Autoconf 2.59 for patch 2.5.9.
- #
- # Report bugs to <bug-patch@gnu.org>.
- #
--# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
--# Free Software Foundation, Inc.
-+# Copyright (C) 2003 Free Software Foundation, Inc.
- # This configure script is free software; the Free Software Foundation
- # gives unlimited permission to copy, distribute and modify it.
- ## --------------------- ##
-@@ -22,9 +21,10 @@
- elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-   set -o posix
- fi
-+DUALCASE=1; export DUALCASE # for MKS sh
- 
- # Support unset when possible.
--if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
-+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-   as_unset=unset
- else
-   as_unset=false
-@@ -43,7 +43,7 @@
-   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-   LC_TELEPHONE LC_TIME
- do
--  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
-+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-     eval $as_var=C; export $as_var
-   else
-     $as_unset $as_var
-@@ -220,16 +220,17 @@
- if mkdir -p . 2>/dev/null; then
-   as_mkdir_p=:
- else
-+  test -d ./-p && rmdir ./-p
-   as_mkdir_p=false
- fi
- 
- as_executable_p="test -f"
- 
- # Sed expression to map a string onto a valid CPP name.
--as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
- 
- # Sed expression to map a string onto a valid variable name.
--as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
- 
- 
- # IFS
-@@ -669,7 +670,7 @@
- 
- # Be sure to have absolute paths.
- for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
--              localstatedir libdir includedir oldincludedir infodir mandir
-+	      localstatedir libdir includedir oldincludedir infodir mandir
- do
-   eval ac_val=$`echo $ac_var`
-   case $ac_val in
-@@ -709,10 +710,10 @@
-   # Try the directory containing this script, then its parent.
-   ac_confdir=`(dirname "$0") 2>/dev/null ||
- $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
--         X"$0" : 'X\(//\)[^/]' \| \
--         X"$0" : 'X\(//\)$' \| \
--         X"$0" : 'X\(/\)' \| \
--         .     : '\(.\)' 2>/dev/null ||
-+	 X"$0" : 'X\(//\)[^/]' \| \
-+	 X"$0" : 'X\(//\)$' \| \
-+	 X"$0" : 'X\(/\)' \| \
-+	 .     : '\(.\)' 2>/dev/null ||
- echo X"$0" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-@@ -804,9 +805,9 @@
-   cat <<_ACEOF
- Installation directories:
-   --prefix=PREFIX         install architecture-independent files in PREFIX
--                          [$ac_default_prefix]
-+			  [$ac_default_prefix]
-   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
--                          [PREFIX]
-+			  [PREFIX]
- 
- By default, \`make install' will install all the files in
- \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-@@ -896,12 +897,45 @@
-     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-     ac_top_srcdir=$ac_top_builddir$srcdir ;;
- esac
--# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
--# absolute.
--ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
--ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
--ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
--ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
-+
-+# Do not use `cd foo && pwd` to compute absolute paths, because
-+# the directories may not exist.
-+case `pwd` in
-+.) ac_abs_builddir="$ac_dir";;
-+*)
-+  case "$ac_dir" in
-+  .) ac_abs_builddir=`pwd`;;
-+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-+  esac;;
-+esac
-+case $ac_abs_builddir in
-+.) ac_abs_top_builddir=${ac_top_builddir}.;;
-+*)
-+  case ${ac_top_builddir}. in
-+  .) ac_abs_top_builddir=$ac_abs_builddir;;
-+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-+  esac;;
-+esac
-+case $ac_abs_builddir in
-+.) ac_abs_srcdir=$ac_srcdir;;
-+*)
-+  case $ac_srcdir in
-+  .) ac_abs_srcdir=$ac_abs_builddir;;
-+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-+  esac;;
-+esac
-+case $ac_abs_builddir in
-+.) ac_abs_top_srcdir=$ac_top_srcdir;;
-+*)
-+  case $ac_top_srcdir in
-+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-+  esac;;
-+esac
- 
-     cd $ac_dir
-     # Check for guested configure; otherwise get Cygnus style configure.
-@@ -912,13 +946,13 @@
-       echo
-       $SHELL $ac_srcdir/configure  --help=recursive
-     elif test -f $ac_srcdir/configure.ac ||
--           test -f $ac_srcdir/configure.in; then
-+	   test -f $ac_srcdir/configure.in; then
-       echo
-       $ac_configure --help
-     else
-       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-     fi
--    cd $ac_popdir
-+    cd "$ac_popdir"
-   done
- fi
- 
-@@ -926,10 +960,9 @@
- if $ac_init_version; then
-   cat <<\_ACEOF
- patch configure 2.5.9
--generated by GNU Autoconf 2.57
-+generated by GNU Autoconf 2.59
- 
--Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
--Free Software Foundation, Inc.
-+Copyright (C) 2003 Free Software Foundation, Inc.
- This configure script is free software; the Free Software Foundation
- gives unlimited permission to copy, distribute and modify it.
- _ACEOF
-@@ -941,7 +974,7 @@
- running configure, to aid debugging if configure makes a mistake.
- 
- It was created by patch $as_me 2.5.9, which was
--generated by GNU Autoconf 2.57.  Invocation command line was
-+generated by GNU Autoconf 2.59.  Invocation command line was
- 
-   $ $0 $@
- 
-@@ -1018,19 +1051,19 @@
-     2)
-       ac_configure_args1="$ac_configure_args1 '$ac_arg'"
-       if test $ac_must_keep_next = true; then
--        ac_must_keep_next=false # Got value, back to normal.
-+	ac_must_keep_next=false # Got value, back to normal.
-       else
--        case $ac_arg in
--          *=* | --config-cache | -C | -disable-* | --disable-* \
--          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
--          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
--          | -with-* | --with-* | -without-* | --without-* | --x)
--            case "$ac_configure_args0 " in
--              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
--            esac
--            ;;
--          -* ) ac_must_keep_next=true ;;
--        esac
-+	case $ac_arg in
-+	  *=* | --config-cache | -C | -disable-* | --disable-* \
-+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-+	  | -with-* | --with-* | -without-* | --without-* | --x)
-+	    case "$ac_configure_args0 " in
-+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-+	    esac
-+	    ;;
-+	  -* ) ac_must_keep_next=true ;;
-+	esac
-       fi
-       ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-       # Get rid of the leading space.
-@@ -1064,12 +1097,12 @@
-     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-     *ac_space=\ *)
-       sed -n \
--        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
--    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-       ;;
-     *)
-       sed -n \
--        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-       ;;
-     esac;
- }
-@@ -1098,7 +1131,7 @@
-       for ac_var in $ac_subst_files
-       do
- 	eval ac_val=$`echo $ac_var`
--        echo "$ac_var='"'"'$ac_val'"'"'"
-+	echo "$ac_var='"'"'$ac_val'"'"'"
-       done | sort
-       echo
-     fi
-@@ -1117,7 +1150,7 @@
-       echo "$as_me: caught signal $ac_signal"
-     echo "$as_me: exit $exit_status"
-   } >&5
--  rm -f core core.* *.core &&
-+  rm -f core *.core &&
-   rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
-     exit $exit_status
-      ' 0
-@@ -1197,7 +1230,7 @@
- # value.
- ac_cache_corrupted=false
- for ac_var in `(set) 2>&1 |
--               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
-+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
-   eval ac_old_set=\$ac_cv_env_${ac_var}_set
-   eval ac_new_set=\$ac_env_${ac_var}_set
-   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-@@ -1214,13 +1247,13 @@
-     ,);;
-     *)
-       if test "x$ac_old_val" != "x$ac_new_val"; then
--        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
- echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
--        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
- echo "$as_me:   former value:  $ac_old_val" >&2;}
--        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
- echo "$as_me:   current value: $ac_new_val" >&2;}
--        ac_cache_corrupted=:
-+	ac_cache_corrupted=:
-       fi;;
-   esac
-   # Pass precious variables to config.status.
-@@ -1629,7 +1662,6 @@
-   (exit $ac_status); }
- 
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -1649,8 +1681,8 @@
- # Try to create an executable without -o first, disregard a.out.
- # It will help us diagnose broken compilers, and finding out an intuition
- # of exeext.
--echo "$as_me:$LINENO: checking for C compiler default output" >&5
--echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
-+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
- ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
- if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-   (eval $ac_link_default) 2>&5
-@@ -1670,23 +1702,23 @@
-   test -f "$ac_file" || continue
-   case $ac_file in
-     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
--        ;;
-+	;;
-     conftest.$ac_ext )
--        # This is the source file.
--        ;;
-+	# This is the source file.
-+	;;
-     [ab].out )
--        # We found the default executable, but exeext='' is most
--        # certainly right.
--        break;;
-+	# We found the default executable, but exeext='' is most
-+	# certainly right.
-+	break;;
-     *.* )
--        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
--        # FIXME: I believe we export ac_cv_exeext for Libtool,
--        # but it would be cool to find out if it's true.  Does anybody
--        # maintain Libtool? --akim.
--        export ac_cv_exeext
--        break;;
-+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-+	# FIXME: I believe we export ac_cv_exeext for Libtool,
-+	# but it would be cool to find out if it's true.  Does anybody
-+	# maintain Libtool? --akim.
-+	export ac_cv_exeext
-+	break;;
-     * )
--        break;;
-+	break;;
-   esac
- done
- else
-@@ -1760,8 +1792,8 @@
-   case $ac_file in
-     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
-     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
--          export ac_cv_exeext
--          break;;
-+	  export ac_cv_exeext
-+	  break;;
-     * ) break;;
-   esac
- done
-@@ -1786,7 +1818,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -1837,7 +1868,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -1857,11 +1887,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -1874,7 +1913,7 @@
- 
- ac_compiler_gnu=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_c_compiler_gnu=$ac_compiler_gnu
- 
- fi
-@@ -1890,7 +1929,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -1907,11 +1945,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -1924,7 +1971,7 @@
- 
- ac_cv_prog_cc_g=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
- echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-@@ -1951,7 +1998,6 @@
-   ac_cv_prog_cc_stdc=no
- ac_save_CC=$CC
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -1979,6 +2025,16 @@
-   va_end (v);
-   return s;
- }
-+
-+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-+   function prototypes and stuff, but not '\xHH' hex character constants.
-+   These don't provoke an error unfortunately, instead are silently treated
-+   as 'x'.  The following induces an error, until -std1 is added to get
-+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-+   array size at least.  It's necessary to write '\x00'==0 to get something
-+   that's true only with -std1.  */
-+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-+
- int test (int i, double x);
- struct s1 {int (*f) (int a);};
- struct s2 {int (*f) (double a);};
-@@ -2005,11 +2061,20 @@
-   CC="$ac_save_CC $ac_arg"
-   rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2022,7 +2087,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext
-+rm -f conftest.err conftest.$ac_objext
- done
- rm -f conftest.$ac_ext conftest.$ac_objext
- CC=$ac_save_CC
-@@ -2050,19 +2115,27 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
-   for ac_declaration in \
--   ''\
--   '#include <stdlib.h>' \
-+   '' \
-    'extern "C" void std::exit (int) throw (); using std::exit;' \
-    'extern "C" void std::exit (int); using std::exit;' \
-    'extern "C" void exit (int) throw ();' \
-@@ -2070,14 +2143,13 @@
-    'void exit (int);'
- do
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--#include <stdlib.h>
- $ac_declaration
-+#include <stdlib.h>
- int
- main ()
- {
-@@ -2088,11 +2160,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2105,9 +2186,8 @@
- 
- continue
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2124,11 +2204,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2140,7 +2229,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- done
- rm -f conftest*
- if test -n "$ac_declaration"; then
-@@ -2154,7 +2243,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
- ac_cpp='$CPP $CPPFLAGS'
- ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-@@ -2189,7 +2278,6 @@
-   # On the NeXT, cc -E runs the code through the compiler's parser,
-   # not just through cpp. "Syntax error" is here to catch this case.
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2200,7 +2288,7 @@
- #else
- # include <assert.h>
- #endif
--                     Syntax error
-+		     Syntax error
- _ACEOF
- if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-@@ -2212,6 +2300,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -2232,7 +2321,6 @@
-   # OK, works on sane cases.  Now check whether non-existent headers
-   # can be detected and how.
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2250,6 +2338,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -2296,7 +2385,6 @@
-   # On the NeXT, cc -E runs the code through the compiler's parser,
-   # not just through cpp. "Syntax error" is here to catch this case.
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2307,7 +2395,7 @@
- #else
- # include <assert.h>
- #endif
--                     Syntax error
-+		     Syntax error
- _ACEOF
- if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-@@ -2319,6 +2407,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -2339,7 +2428,6 @@
-   # OK, works on sane cases.  Now check whether non-existent headers
-   # can be detected and how.
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2357,6 +2445,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -2431,6 +2520,7 @@
- # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
- # AFS /usr/afsws/bin/install, which mishandles nonexistent args
- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-+# OS/2's system install, which has a completely different semantic
- # ./install, which can be erroneously created by make from ./install.sh.
- echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
- echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-@@ -2447,6 +2537,7 @@
- case $as_dir/ in
-   ./ | .// | /cC/* | \
-   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
-   /usr/ucb/* ) ;;
-   *)
-     # OSF1 and SCO ODT 3.0 have their own names for install.
-@@ -2454,20 +2545,20 @@
-     # by default.
-     for ac_prog in ginstall scoinst install; do
-       for ac_exec_ext in '' $ac_executable_extensions; do
--        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
--          if test $ac_prog = install &&
--            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
--            # AIX install.  It has an incompatible calling convention.
--            :
--          elif test $ac_prog = install &&
--            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
--            # program-specific install script used by HP pwplus--don't use.
--            :
--          else
--            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
--            break 3
--          fi
--        fi
-+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-+	  if test $ac_prog = install &&
-+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-+	    # AIX install.  It has an incompatible calling convention.
-+	    :
-+	  elif test $ac_prog = install &&
-+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-+	    # program-specific install script used by HP pwplus--don't use.
-+	    :
-+	  else
-+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-+	    break 3
-+	  fi
-+	fi
-       done
-     done
-     ;;
-@@ -2499,7 +2590,7 @@
- 
- echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
- echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
--set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
-+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
- if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-@@ -2596,7 +2687,6 @@
- echo "$as_me:$LINENO: checking for AIX" >&5
- echo $ECHO_N "checking for AIX... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2628,7 +2718,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2649,11 +2738,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2666,12 +2764,11 @@
- 
- ac_cv_header_stdc=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- 
- if test $ac_cv_header_stdc = yes; then
-   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2693,7 +2790,6 @@
- if test $ac_cv_header_stdc = yes; then
-   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2718,7 +2814,6 @@
-   :
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2730,9 +2825,9 @@
- # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
- #else
- # define ISLOWER(c) \
--                   (('a' <= (c) && (c) <= 'i') \
--                     || ('j' <= (c) && (c) <= 'r') \
--                     || ('s' <= (c) && (c) <= 'z'))
-+		   (('a' <= (c) && (c) <= 'i') \
-+		     || ('j' <= (c) && (c) <= 'r') \
-+		     || ('s' <= (c) && (c) <= 'z'))
- # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
- #endif
- 
-@@ -2743,7 +2838,7 @@
-   int i;
-   for (i = 0; i < 256; i++)
-     if (XOR (islower (i), ISLOWER (i))
--        || toupper (i) != TOUPPER (i))
-+	|| toupper (i) != TOUPPER (i))
-       exit(2);
-   exit (0);
- }
-@@ -2768,7 +2863,7 @@
- ( exit $ac_status )
- ac_cv_header_stdc=no
- fi
--rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
- fi
- fi
-@@ -2793,7 +2888,7 @@
- 
- 
- for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
--                  inttypes.h stdint.h unistd.h
-+		  inttypes.h stdint.h unistd.h
- do
- as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-@@ -2802,7 +2897,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2814,11 +2908,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2831,7 +2934,7 @@
- 
- eval "$as_ac_Header=no"
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -2858,7 +2961,6 @@
- echo "$as_me:$LINENO: checking minix/config.h usability" >&5
- echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2869,11 +2971,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2886,7 +2997,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -2894,7 +3005,6 @@
- echo "$as_me:$LINENO: checking minix/config.h presence" >&5
- echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -2912,6 +3022,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -2931,33 +3042,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
- echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: minix/config.h:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: minix/config.h:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -3000,15 +3110,15 @@
- fi
- 
- 
--echo "$as_me:$LINENO: checking for library containing strerror" >&5
--echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
--if test "${ac_cv_search_strerror+set}" = set; then
-+
-+        echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
-+echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
-+if test "${ac_cv_lib_cposix_strerror+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  ac_func_search_save_LIBS=$LIBS
--ac_cv_search_strerror=no
-+  ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lcposix  $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3032,79 +3142,43 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_cv_search_strerror="none required"
--else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
--if test "$ac_cv_search_strerror" = no; then
--  for ac_lib in cposix; do
--    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
--    cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--
--/* Override any gcc2 internal prototype to avoid an error.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--/* We use char because int might match the return type of a gcc2
--   builtin and then its argument prototype would still apply.  */
--char strerror ();
--int
--main ()
--{
--strerror ();
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_search_strerror="-l$ac_lib"
--break
-+  ac_cv_lib_cposix_strerror=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
-+ac_cv_lib_cposix_strerror=no
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
--  done
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
- fi
--LIBS=$ac_func_search_save_LIBS
-+echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
-+echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
-+if test $ac_cv_lib_cposix_strerror = yes; then
-+  LIBS="$LIBS -lcposix"
- fi
--echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
--echo "${ECHO_T}$ac_cv_search_strerror" >&6
--if test "$ac_cv_search_strerror" != no; then
--  test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
- 
--fi
-+
- 
- # Check whether --enable-largefile or --disable-largefile was given.
- if test "${enable_largefile+set}" = set; then
-@@ -3124,8 +3198,7 @@
-        while :; do
-      	 # IRIX 6.2 and later do not support large files by default,
-      	 # so use the C compiler's -n32 option if that helps.
--         cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
-+	 cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3150,11 +3223,20 @@
- _ACEOF
-      	 rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3166,15 +3248,24 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext
-+rm -f conftest.err conftest.$ac_objext
-      	 CC="$CC -n32"
-      	 rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3186,8 +3277,8 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext
--         break
-+rm -f conftest.err conftest.$ac_objext
-+	 break
-        done
-        CC=$ac_save_CC
-        rm -f conftest.$ac_ext
-@@ -3207,7 +3298,6 @@
-   while :; do
-   ac_cv_sys_file_offset_bits=no
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3232,11 +3322,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3248,9 +3347,8 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3276,11 +3374,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3292,7 +3399,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-   break
- done
- fi
-@@ -3314,7 +3421,6 @@
-   while :; do
-   ac_cv_sys_large_files=no
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3339,11 +3445,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3355,9 +3470,8 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3383,11 +3497,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3399,7 +3522,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-   break
- done
- fi
-@@ -3443,7 +3566,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3506,11 +3628,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3523,7 +3654,7 @@
- 
- ac_cv_c_const=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
- echo "${ECHO_T}$ac_cv_c_const" >&6
-@@ -3550,7 +3681,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3570,11 +3700,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3587,7 +3726,7 @@
- 
- eval "$as_ac_Header=no"
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -3610,7 +3749,6 @@
-   ac_func_search_save_LIBS=$LIBS
- ac_cv_search_opendir=no
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3634,11 +3772,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3650,12 +3797,12 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- if test "$ac_cv_search_opendir" = no; then
-   for ac_lib in dir; do
-     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3679,11 +3826,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3696,7 +3852,8 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-   done
- fi
- LIBS=$ac_func_search_save_LIBS
-@@ -3717,7 +3874,6 @@
-   ac_func_search_save_LIBS=$LIBS
- ac_cv_search_opendir=no
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3741,11 +3897,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3757,12 +3922,12 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- if test "$ac_cv_search_opendir" = no; then
-   for ac_lib in x; do
-     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3786,11 +3951,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3803,7 +3977,8 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-   done
- fi
- LIBS=$ac_func_search_save_LIBS
-@@ -3823,7 +3998,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3844,11 +4018,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -3861,12 +4044,11 @@
- 
- ac_cv_header_stdc=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- 
- if test $ac_cv_header_stdc = yes; then
-   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3888,7 +4070,6 @@
- if test $ac_cv_header_stdc = yes; then
-   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3913,7 +4094,6 @@
-   :
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3925,9 +4105,9 @@
- # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
- #else
- # define ISLOWER(c) \
--                   (('a' <= (c) && (c) <= 'i') \
--                     || ('j' <= (c) && (c) <= 'r') \
--                     || ('s' <= (c) && (c) <= 'z'))
-+		   (('a' <= (c) && (c) <= 'i') \
-+		     || ('j' <= (c) && (c) <= 'r') \
-+		     || ('s' <= (c) && (c) <= 'z'))
- # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
- #endif
- 
-@@ -3938,7 +4118,7 @@
-   int i;
-   for (i = 0; i < 256; i++)
-     if (XOR (islower (i), ISLOWER (i))
--        || toupper (i) != TOUPPER (i))
-+	|| toupper (i) != TOUPPER (i))
-       exit(2);
-   exit (0);
- }
-@@ -3963,7 +4143,7 @@
- ( exit $ac_status )
- ac_cv_header_stdc=no
- fi
--rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
- fi
- fi
-@@ -3999,7 +4179,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4010,11 +4189,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4027,7 +4215,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -4035,7 +4223,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4053,6 +4240,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -4072,33 +4260,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-+    ;;
-+  no:yes:* )
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
--    ;;
--  no:yes )
--    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
--echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -4109,7 +4296,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -4131,7 +4318,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4151,11 +4337,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4168,7 +4363,7 @@
- 
- ac_cv_type_mode_t=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
- echo "${ECHO_T}$ac_cv_type_mode_t" >&6
-@@ -4188,7 +4383,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4208,11 +4402,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4225,7 +4428,7 @@
- 
- ac_cv_type_off_t=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
- echo "${ECHO_T}$ac_cv_type_off_t" >&6
-@@ -4245,7 +4448,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4265,11 +4467,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4282,7 +4493,7 @@
- 
- ac_cv_type_pid_t=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
- echo "${ECHO_T}$ac_cv_type_pid_t" >&6
-@@ -4302,7 +4513,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4329,11 +4539,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4346,7 +4565,7 @@
- 
- ac_cv_type_signal=int
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
- echo "${ECHO_T}$ac_cv_type_signal" >&6
-@@ -4362,7 +4581,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4382,11 +4600,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4399,7 +4626,7 @@
- 
- ac_cv_type_size_t=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
- echo "${ECHO_T}$ac_cv_type_size_t" >&6
-@@ -4419,7 +4646,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4468,11 +4694,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4485,7 +4720,7 @@
- 
- ac_cv_header_stdbool_h=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
- echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
-@@ -4495,7 +4730,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4515,11 +4749,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4532,7 +4775,7 @@
- 
- ac_cv_type__Bool=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
- echo "${ECHO_T}$ac_cv_type__Bool" >&6
-@@ -4589,7 +4832,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4600,11 +4842,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4617,7 +4868,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -4625,7 +4876,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4643,6 +4893,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -4662,33 +4913,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -4699,7 +4949,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -4733,7 +4983,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4744,11 +4993,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4761,7 +5019,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -4769,7 +5027,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4787,6 +5044,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -4806,33 +5064,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -4843,7 +5100,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -4865,7 +5122,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4886,11 +5142,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4903,7 +5168,7 @@
- 
- ac_cv_header_time=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
- echo "${ECHO_T}$ac_cv_header_time" >&6
-@@ -4933,7 +5198,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -4964,11 +5228,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4981,7 +5254,7 @@
- 
- fu_cv_sys_struct_utimbuf=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- 
- fi
- echo "$as_me:$LINENO: result: $fu_cv_sys_struct_utimbuf" >&5
-@@ -5005,7 +5278,6 @@
-   ac_cv_func_closedir_void=yes
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5045,7 +5317,7 @@
- ( exit $ac_status )
- ac_cv_func_closedir_void=yes
- fi
--rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
- fi
- echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
-@@ -5076,7 +5348,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5087,11 +5358,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5104,7 +5384,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -5112,7 +5392,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5130,6 +5409,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -5149,33 +5429,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -5186,7 +5465,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -5220,7 +5499,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5231,11 +5509,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5248,7 +5535,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -5256,7 +5543,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5274,6 +5560,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -5293,33 +5580,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -5330,7 +5616,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -5364,7 +5650,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5375,11 +5660,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5392,7 +5686,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -5400,7 +5694,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5418,6 +5711,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -5437,33 +5731,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -5474,7 +5767,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -5497,7 +5790,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5517,11 +5809,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5534,7 +5835,7 @@
- 
- ac_cv_have_decl_getenv=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5
- echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6
-@@ -5562,7 +5863,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5582,11 +5882,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5599,7 +5908,7 @@
- 
- ac_cv_have_decl_malloc=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5
- echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6
-@@ -5628,7 +5937,6 @@
- else
- 
-         cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5647,11 +5955,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5664,7 +5981,7 @@
- 
- ac_cv_win_or_dos=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- 
- fi
- echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5
-@@ -5714,7 +6031,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5725,11 +6041,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5742,7 +6067,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -5750,7 +6075,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5768,6 +6092,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -5787,33 +6112,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -5824,7 +6148,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -5872,7 +6196,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -5905,11 +6228,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5922,7 +6254,8 @@
- 
- jm_cv_struct_dirent_d_ino=no
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- 
- 
- fi
-@@ -6011,21 +6344,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -6056,11 +6396,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6073,7 +6422,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -6126,21 +6476,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -6171,11 +6528,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6188,7 +6554,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -6203,21 +6570,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define _doprnt innocuous__doprnt
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char _doprnt (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef _doprnt
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -6248,11 +6622,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6265,7 +6648,8 @@
- 
- ac_cv_func__doprnt=no
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
- echo "${ECHO_T}$ac_cv_func__doprnt" >&6
-@@ -6288,13 +6672,12 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
-+$ac_includes_default
- int
- main ()
- {
-@@ -6305,11 +6688,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6322,12 +6714,20 @@
- 
- ac_cv_lib_error_at_line=no
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5
- echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6
- if test $ac_cv_lib_error_at_line = no; then
--  LIBOBJS="$LIBOBJS error.$ac_objext"
-+  case $LIBOBJS in
-+    "error.$ac_objext"   | \
-+  *" error.$ac_objext"   | \
-+    "error.$ac_objext "* | \
-+  *" error.$ac_objext "* ) ;;
-+  *) LIBOBJS="$LIBOBJS error.$ac_objext" ;;
-+esac
-+
- fi
- 
- 
-@@ -6343,21 +6743,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -6388,11 +6795,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6405,7 +6821,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -6423,7 +6840,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -6443,11 +6859,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6460,7 +6885,7 @@
- 
- ac_cv_have_decl_strerror=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5
- echo "${ECHO_T}$ac_cv_have_decl_strerror" >&6
-@@ -6486,7 +6911,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -6506,11 +6930,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6523,7 +6956,7 @@
- 
- ac_cv_have_decl_strerror_r=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5
- echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6
-@@ -6553,21 +6986,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -6598,11 +7038,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6615,7 +7064,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -6636,7 +7086,6 @@
-     ac_cv_func_strerror_r_char_p=no
-     if test $ac_cv_have_decl_strerror_r = yes; then
-       cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -6657,11 +7106,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6673,7 +7131,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-     else
-       # strerror_r is not declared.  Choose between
-       # systems that have relatively inaccessible declarations for the
-@@ -6685,7 +7143,6 @@
-   :
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -6721,7 +7178,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
-     fi
- 
-@@ -6749,21 +7206,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -6794,11 +7258,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6811,7 +7284,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -6821,7 +7295,14 @@
- _ACEOF
- 
- else
--  LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
-+  case $LIBOBJS in
-+    "$ac_func.$ac_objext"   | \
-+  *" $ac_func.$ac_objext"   | \
-+    "$ac_func.$ac_objext "* | \
-+  *" $ac_func.$ac_objext "* ) ;;
-+  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-+esac
-+
- fi
- done
- 
-@@ -6855,7 +7336,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -6866,11 +7346,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6883,7 +7372,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -6891,7 +7380,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -6909,6 +7397,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -6928,33 +7417,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -6965,7 +7453,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -6989,7 +7477,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7053,21 +7540,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -7098,11 +7592,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -7115,7 +7618,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -7125,7 +7629,14 @@
- _ACEOF
- 
- else
--  LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
-+  case $LIBOBJS in
-+    "$ac_func.$ac_objext"   | \
-+  *" $ac_func.$ac_objext"   | \
-+    "$ac_func.$ac_objext "* | \
-+  *" $ac_func.$ac_objext "* ) ;;
-+  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-+esac
-+
- fi
- done
- 
-@@ -7163,7 +7674,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7174,11 +7684,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -7191,7 +7710,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -7199,7 +7718,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7217,6 +7735,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -7236,33 +7755,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -7273,7 +7791,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -7297,7 +7815,6 @@
-   ac_cv_func_malloc_0_nonnull=no
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7337,7 +7854,7 @@
- ( exit $ac_status )
- ac_cv_func_malloc_0_nonnull=no
- fi
--rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
- fi
- echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
-@@ -7353,7 +7870,14 @@
- #define HAVE_MALLOC 0
- _ACEOF
- 
--   LIBOBJS="$LIBOBJS malloc.$ac_objext"
-+   case $LIBOBJS in
-+    "malloc.$ac_objext"   | \
-+  *" malloc.$ac_objext"   | \
-+    "malloc.$ac_objext "* | \
-+  *" malloc.$ac_objext "* ) ;;
-+  *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;;
-+esac
-+
- 
- cat >>confdefs.h <<\_ACEOF
- #define malloc rpl_malloc
-@@ -7388,7 +7912,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7399,11 +7922,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -7416,7 +7948,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -7424,7 +7956,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7442,6 +7973,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -7461,33 +7993,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -7498,7 +8029,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -7522,7 +8053,6 @@
-   ac_cv_func_realloc_0_nonnull=no
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7562,7 +8092,7 @@
- ( exit $ac_status )
- ac_cv_func_realloc_0_nonnull=no
- fi
--rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
- fi
- echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5
-@@ -7578,7 +8108,14 @@
- #define HAVE_REALLOC 0
- _ACEOF
- 
--   LIBOBJS="$LIBOBJS realloc.$ac_objext"
-+   case $LIBOBJS in
-+    "realloc.$ac_objext"   | \
-+  *" realloc.$ac_objext"   | \
-+    "realloc.$ac_objext "* | \
-+  *" realloc.$ac_objext "* ) ;;
-+  *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;;
-+esac
-+
- 
- cat >>confdefs.h <<\_ACEOF
- #define realloc rpl_realloc
-@@ -7619,7 +8156,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7630,11 +8166,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -7647,7 +8192,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -7655,7 +8200,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7673,6 +8217,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -7692,33 +8237,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -7729,7 +8273,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -7772,7 +8316,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7783,11 +8326,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -7800,7 +8352,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -7808,7 +8360,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7826,6 +8377,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -7845,33 +8397,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -7882,7 +8433,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -7916,7 +8467,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7927,11 +8477,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -7944,7 +8503,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -7952,7 +8511,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -7970,6 +8528,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -7989,33 +8548,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -8026,7 +8584,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -8053,21 +8611,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -8098,11 +8663,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8115,7 +8689,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -8139,21 +8714,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -8184,11 +8766,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8201,7 +8792,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -8241,7 +8833,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -8259,11 +8850,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8276,7 +8876,7 @@
- 
- ac_cv_type_mbstate_t=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5
- echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6
-@@ -8300,7 +8900,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -8317,11 +8916,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8334,7 +8942,8 @@
- 
- jm_cv_func_mbrtowc=no
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $jm_cv_func_mbrtowc" >&5
- echo "${ECHO_T}$jm_cv_func_mbrtowc" >&6
-@@ -8348,69 +8957,465 @@
- 
- 
- 
--
--
--
--
--for ac_func in pathconf
--do
--as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
--echo "$as_me:$LINENO: checking for $ac_func" >&5
--echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
--if eval "test \"\${$as_ac_var+set}\" = set"; then
-+      echo "$as_me:$LINENO: checking whether free is declared" >&5
-+echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6
-+if test "${ac_cv_have_decl_free+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--/* System header to define __stub macros and hopefully few prototypes,
--    which can conflict with char $ac_func (); below.
--    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
--    <limits.h> exists even on freestanding compilers.  */
--#ifdef __STDC__
--# include <limits.h>
--#else
--# include <assert.h>
--#endif
--/* Override any gcc2 internal prototype to avoid an error.  */
--#ifdef __cplusplus
--extern "C"
--{
--#endif
--/* We use char because int might match the return type of a gcc2
--   builtin and then its argument prototype would still apply.  */
--char $ac_func ();
--/* The GNU C library defines this for functions which it implements
--    to always fail with ENOSYS.  Some functions are actually named
--    something starting with __ and the normal name is an alias.  */
--#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
--choke me
--#else
--char (*f) () = $ac_func;
--#endif
--#ifdef __cplusplus
--}
--#endif
--
-+$ac_includes_default
- int
- main ()
- {
--return f != $ac_func;
-+#ifndef free
-+  char *p = (char *) free;
-+#endif
-+
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_cv_have_decl_free=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_have_decl_free=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5
-+echo "${ECHO_T}$ac_cv_have_decl_free" >&6
-+if test $ac_cv_have_decl_free = yes; then
-+
-+cat >>confdefs.h <<_ACEOF
-+#define HAVE_DECL_FREE 1
-+_ACEOF
-+
-+
-+else
-+  cat >>confdefs.h <<_ACEOF
-+#define HAVE_DECL_FREE 0
-+_ACEOF
-+
-+
-+fi
-+
-+
-+
-+
-+
-+  :
-+
-+
-+
-+
-+
-+  echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
-+echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
-+if test "${ac_cv_header_stdbool_h+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+	  #include <stdbool.h>
-+	  #ifndef bool
-+	   "error: bool is not defined"
-+	  #endif
-+	  #ifndef false
-+	   "error: false is not defined"
-+	  #endif
-+	  #if false
-+	   "error: false is not 0"
-+	  #endif
-+	  #ifndef true
-+	   "error: false is not defined"
-+	  #endif
-+	  #if true != 1
-+	   "error: true is not 1"
-+	  #endif
-+	  #ifndef __bool_true_false_are_defined
-+	   "error: __bool_true_false_are_defined is not defined"
-+	  #endif
-+
-+	  struct s { _Bool s: 1; _Bool t; } s;
-+
-+	  char a[true == 1 ? 1 : -1];
-+	  char b[false == 0 ? 1 : -1];
-+	  char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-+	  char d[(bool) -0.5 == true ? 1 : -1];
-+	  bool e = &s;
-+	  char f[(_Bool) -0.0 == false ? 1 : -1];
-+	  char g[true];
-+	  char h[sizeof (_Bool)];
-+	  char i[sizeof s.t];
-+
-+int
-+main ()
-+{
-+ return !a + !b + !c + !d + !e + !f + !g + !h + !i;
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_cv_header_stdbool_h=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_header_stdbool_h=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
-+echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
-+   echo "$as_me:$LINENO: checking for _Bool" >&5
-+echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
-+if test "${ac_cv_type__Bool+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+int
-+main ()
-+{
-+if ((_Bool *) 0)
-+  return 0;
-+if (sizeof (_Bool))
-+  return 0;
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_cv_type__Bool=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_type__Bool=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
-+echo "${ECHO_T}$ac_cv_type__Bool" >&6
-+if test $ac_cv_type__Bool = yes; then
-+
-+cat >>confdefs.h <<_ACEOF
-+#define HAVE__BOOL 1
-+_ACEOF
-+
-+
-+fi
-+
-+   if test $ac_cv_header_stdbool_h = yes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_STDBOOL_H 1
-+_ACEOF
-+
-+   fi
-+
-+  :
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+echo "$as_me:$LINENO: checking for nanosecond timestamps in struct stat" >&5
-+echo $ECHO_N "checking for nanosecond timestamps in struct stat... $ECHO_C" >&6
-+if test "${ac_cv_stat_nsec+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+	  #include <sys/types.h>
-+	  #include <sys/stat.h>
-+	  #include <unistd.h>
-+	  struct stat st;
-+
-+int
-+main ()
-+{
-+ return st.st_atimensec + st.st_mtimensec + st.st_ctimensec;
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_cv_stat_nsec=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_stat_nsec=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_stat_nsec" >&5
-+echo "${ECHO_T}$ac_cv_stat_nsec" >&6
-+   if test $ac_cv_stat_nsec = yes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_STAT_NSEC 1
-+_ACEOF
-+
-+   fi
-+
-+   echo "$as_me:$LINENO: checking for nanosecond timestamps in struct stat" >&5
-+echo $ECHO_N "checking for nanosecond timestamps in struct stat... $ECHO_C" >&6
-+if test "${ac_cv_stat_timeval+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+	  #include <time.h>
-+	  #include <sys/types.h>
-+	  #include <sys/stat.h>
-+	  #include <unistd.h>
-+	  struct stat st;
-+
-+int
-+main ()
-+{
-+ return st.st_atim.tv_nsec + st.st_mtim.tv_nsec + st.st_ctim.tv_nsec;
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_cv_stat_timeval=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_stat_timeval=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_stat_timeval" >&5
-+echo "${ECHO_T}$ac_cv_stat_timeval" >&6
-+   if test $ac_cv_stat_timeval = yes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_STAT_TIMEVAL 1
-+_ACEOF
-+
-+   fi
-+
-+
-+
-+
-+
-+for ac_func in pathconf
-+do
-+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-+echo "$as_me:$LINENO: checking for $ac_func" >&5
-+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-+if eval "test \"\${$as_ac_var+set}\" = set"; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func (); below.
-+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-+    <limits.h> exists even on freestanding compilers.  */
-+
-+#ifdef __STDC__
-+# include <limits.h>
-+#else
-+# include <assert.h>
-+#endif
-+
-+#undef $ac_func
-+
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+#ifdef __cplusplus
-+extern "C"
-+{
-+#endif
-+/* We use char because int might match the return type of a gcc2
-+   builtin and then its argument prototype would still apply.  */
-+char $ac_func ();
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+char (*f) () = $ac_func;
-+#endif
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+int
-+main ()
-+{
-+return f != $ac_func;
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8423,7 +9428,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -8454,7 +9460,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -8465,11 +9470,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8482,7 +9496,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -8490,7 +9504,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -8508,6 +9521,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -8527,33 +9541,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -8564,7 +9577,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -8587,7 +9600,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -8607,11 +9619,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8624,7 +9645,7 @@
- 
- ac_cv_have_decl_free=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5
- echo "${ECHO_T}$ac_cv_have_decl_free" >&6
-@@ -8648,7 +9669,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -8668,11 +9688,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8685,7 +9714,7 @@
- 
- ac_cv_have_decl_getenv=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5
- echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6
-@@ -8709,7 +9738,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -8729,11 +9757,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8746,7 +9783,7 @@
- 
- ac_cv_have_decl_malloc=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5
- echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6
-@@ -8770,7 +9807,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -8790,11 +9826,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8807,7 +9852,7 @@
- 
- ac_cv_have_decl_mktemp=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_mktemp" >&5
- echo "${ECHO_T}$ac_cv_have_decl_mktemp" >&6
-@@ -8849,21 +9894,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -8894,11 +9946,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8911,7 +9972,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -8934,21 +9996,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -8979,11 +10048,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -8996,7 +10074,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -9006,7 +10085,14 @@
- _ACEOF
- 
- else
--  LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
-+  case $LIBOBJS in
-+    "$ac_func.$ac_objext"   | \
-+  *" $ac_func.$ac_objext"   | \
-+    "$ac_func.$ac_objext "* | \
-+  *" $ac_func.$ac_objext "* ) ;;
-+  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-+esac
-+
- fi
- done
- 
-@@ -9019,7 +10105,6 @@
-   while :; do
-   ac_cv_sys_largefile_source=no
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9036,11 +10121,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9052,9 +10146,8 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9072,11 +10165,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9088,7 +10190,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-   break
- done
- fi
-@@ -9112,7 +10214,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9129,11 +10230,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9146,7 +10256,8 @@
- 
- ac_cv_func_fseeko=no
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_func_fseeko" >&5
- echo "${ECHO_T}$ac_cv_func_fseeko" >&6
-@@ -9165,7 +10276,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9185,11 +10295,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9202,7 +10321,7 @@
- 
- ac_cv_have_decl_clearerr_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6
-@@ -9230,7 +10349,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9250,11 +10368,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9267,7 +10394,7 @@
- 
- ac_cv_have_decl_feof_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6
-@@ -9295,7 +10422,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9315,11 +10441,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9332,7 +10467,7 @@
- 
- ac_cv_have_decl_ferror_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6
-@@ -9360,7 +10495,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9380,11 +10514,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9397,7 +10540,7 @@
- 
- ac_cv_have_decl_fflush_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6
-@@ -9425,7 +10568,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9445,11 +10587,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9462,7 +10613,7 @@
- 
- ac_cv_have_decl_fgets_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6
-@@ -9490,7 +10641,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9510,11 +10660,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9527,7 +10686,7 @@
- 
- ac_cv_have_decl_fputc_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6
-@@ -9555,7 +10714,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9575,11 +10733,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9592,7 +10759,7 @@
- 
- ac_cv_have_decl_fputs_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6
-@@ -9620,7 +10787,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9640,11 +10806,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9657,7 +10832,7 @@
- 
- ac_cv_have_decl_fread_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6
-@@ -9685,7 +10860,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9705,11 +10879,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9722,7 +10905,7 @@
- 
- ac_cv_have_decl_fwrite_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6
-@@ -9750,7 +10933,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9770,11 +10952,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9787,7 +10978,7 @@
- 
- ac_cv_have_decl_getc_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6
-@@ -9815,7 +11006,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9835,11 +11025,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9852,7 +11051,7 @@
- 
- ac_cv_have_decl_getchar_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6
-@@ -9880,7 +11079,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9900,11 +11098,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9917,7 +11124,7 @@
- 
- ac_cv_have_decl_putc_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6
-@@ -9945,7 +11152,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -9965,11 +11171,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -9982,7 +11197,7 @@
- 
- ac_cv_have_decl_putchar_unlocked=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5
- echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6
-@@ -10075,7 +11290,6 @@
-   ac_cv_func_closedir_void=yes
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -10115,7 +11329,7 @@
- ( exit $ac_status )
- ac_cv_func_closedir_void=yes
- fi
--rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
- fi
- echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
-@@ -10146,7 +11360,6 @@
- echo "$as_me:$LINENO: checking $ac_header usability" >&5
- echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -10157,11 +11370,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -10174,7 +11396,7 @@
- 
- ac_header_compiler=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
- echo "${ECHO_T}$ac_header_compiler" >&6
- 
-@@ -10182,7 +11404,6 @@
- echo "$as_me:$LINENO: checking $ac_header presence" >&5
- echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -10200,6 +11421,7 @@
-   (exit $ac_status); } >/dev/null; then
-   if test -s conftest.err; then
-     ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-   else
-     ac_cpp_err=
-   fi
-@@ -10219,33 +11441,32 @@
- echo "${ECHO_T}$ac_header_preproc" >&6
- 
- # So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc in
--  yes:no )
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
- echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-     ;;
--  no:yes )
-+  no:yes:* )
-     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
- echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
- echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-     (
-       cat <<\_ASBOX
--## ------------------------------------ ##
--## Report this to bug-autoconf@gnu.org. ##
--## ------------------------------------ ##
-+## -------------------------------- ##
-+## Report this to bug-patch@gnu.org ##
-+## -------------------------------- ##
- _ASBOX
-     ) |
-       sed "s/^/$as_me: WARNING:     /" >&2
-@@ -10256,7 +11477,7 @@
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=$ac_header_preproc"
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-@@ -10277,7 +11498,6 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -10300,11 +11520,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -10317,7 +11546,8 @@
- 
- ac_cv_func_setmode_dos=no
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_func_setmode_dos" >&5
- echo "${ECHO_T}$ac_cv_func_setmode_dos" >&6
-@@ -10338,21 +11568,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -10383,11 +11620,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -10400,7 +11646,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -10415,21 +11662,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define _doprnt innocuous__doprnt
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char _doprnt (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef _doprnt
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -10460,11 +11714,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -10477,7 +11740,8 @@
- 
- ac_cv_func__doprnt=no
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
- echo "${ECHO_T}$ac_cv_func__doprnt" >&6
-@@ -10503,21 +11767,28 @@
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char $ac_func (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
-+
- #ifdef __STDC__
- # include <limits.h>
- #else
- # include <assert.h>
- #endif
-+
-+#undef $ac_func
-+
- /* Override any gcc2 internal prototype to avoid an error.  */
- #ifdef __cplusplus
- extern "C"
-@@ -10548,11 +11819,20 @@
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest$ac_exeext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -10565,7 +11845,8 @@
- 
- eval "$as_ac_var=no"
- fi
--rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
- echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-@@ -10585,7 +11866,6 @@
-   patch_cv_mkdir_takes_one_arg=no
-       if test $ac_cv_func_mkdir = yes; then
-         cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -10605,11 +11885,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -10621,7 +11910,6 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -10641,11 +11929,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -10658,10 +11955,10 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- 
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-       fi
- 
- 
-@@ -10686,7 +11983,6 @@
- else
- 
-         cat >conftest.$ac_ext <<_ACEOF
--#line $LINENO "configure"
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -10705,11 +12001,20 @@
- _ACEOF
- rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--         { ac_try='test -s conftest.$ac_objext'
-+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -10722,7 +12027,7 @@
- 
- ac_cv_win_or_dos=no
- fi
--rm -f conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- 
- fi
- echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5
-@@ -10834,13 +12139,13 @@
-       # `set' does not quote correctly, so add quotes (double-quote
-       # substitution turns \\\\ into \\, and sed turns \\ into \).
-       sed -n \
--        "s/'/'\\\\''/g;
--    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-+	"s/'/'\\\\''/g;
-+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-       ;;
-     *)
-       # `set' quotes correctly as required by POSIX, so do not add quotes.
-       sed -n \
--        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-       ;;
-     esac;
- } |
-@@ -10870,13 +12175,13 @@
- # trailing colons and then remove the whole line if VPATH becomes empty
- # (actually we leave an empty line to preserve line numbers).
- if test "x$srcdir" = x.; then
--  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
-+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
- s/:*\$(srcdir):*/:/;
- s/:*\${srcdir}:*/:/;
- s/:*@srcdir@:*/:/;
--s/^\([^=]*=[ 	]*\):*/\1/;
-+s/^\([^=]*=[	 ]*\):*/\1/;
- s/:*$//;
--s/^[^=]*=[ 	]*$//;
-+s/^[^=]*=[	 ]*$//;
- }'
- fi
- 
-@@ -10887,7 +12192,7 @@
- for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-   # 1. Remove the extension, and $U if already installed.
-   ac_i=`echo "$ac_i" |
--         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-   # 2. Add them.
-   ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-   ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-@@ -10931,9 +12236,10 @@
- elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-   set -o posix
- fi
-+DUALCASE=1; export DUALCASE # for MKS sh
- 
- # Support unset when possible.
--if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
-+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-   as_unset=unset
- else
-   as_unset=false
-@@ -10952,7 +12258,7 @@
-   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-   LC_TELEPHONE LC_TIME
- do
--  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
-+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-     eval $as_var=C; export $as_var
-   else
-     $as_unset $as_var
-@@ -11131,16 +12437,17 @@
- if mkdir -p . 2>/dev/null; then
-   as_mkdir_p=:
- else
-+  test -d ./-p && rmdir ./-p
-   as_mkdir_p=false
- fi
- 
- as_executable_p="test -f"
- 
- # Sed expression to map a string onto a valid CPP name.
--as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
- 
- # Sed expression to map a string onto a valid variable name.
--as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
- 
- 
- # IFS
-@@ -11167,7 +12474,7 @@
- cat >&5 <<_CSEOF
- 
- This file was extended by patch $as_me 2.5.9, which was
--generated by GNU Autoconf 2.57.  Invocation command line was
-+generated by GNU Autoconf 2.59.  Invocation command line was
- 
-   CONFIG_FILES    = $CONFIG_FILES
-   CONFIG_HEADERS  = $CONFIG_HEADERS
-@@ -11211,9 +12518,9 @@
-   -d, --debug      don't remove temporary files
-       --recheck    update $as_me by reconfiguring in the same conditions
-   --file=FILE[:TEMPLATE]
--                   instantiate the configuration file FILE
-+		   instantiate the configuration file FILE
-   --header=FILE[:TEMPLATE]
--                   instantiate the configuration header FILE
-+		   instantiate the configuration header FILE
- 
- Configuration files:
- $config_files
-@@ -11227,11 +12534,10 @@
- cat >>$CONFIG_STATUS <<_ACEOF
- ac_cs_version="\\
- patch config.status 2.5.9
--configured by $0, generated by GNU Autoconf 2.57,
-+configured by $0, generated by GNU Autoconf 2.59,
-   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
- 
--Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
--Free Software Foundation, Inc.
-+Copyright (C) 2003 Free Software Foundation, Inc.
- This config.status script is free software; the Free Software Foundation
- gives unlimited permission to copy, distribute and modify it."
- srcdir=$srcdir
-@@ -11463,9 +12769,9 @@
-       (echo ':t
-   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-       if test -z "$ac_sed_cmds"; then
--  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-       else
--  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-       fi
-       ac_sed_frag=`expr $ac_sed_frag + 1`
-       ac_beg=$ac_end
-@@ -11483,21 +12789,21 @@
-   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-   case $ac_file in
-   - | *:- | *:-:* ) # input from stdin
--        cat >$tmp/stdin
--        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
--        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-+	cat >$tmp/stdin
-+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
--        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-   * )   ac_file_in=$ac_file.in ;;
-   esac
- 
-   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-   ac_dir=`(dirname "$ac_file") 2>/dev/null ||
- $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
--         X"$ac_file" : 'X\(//\)[^/]' \| \
--         X"$ac_file" : 'X\(//\)$' \| \
--         X"$ac_file" : 'X\(/\)' \| \
--         .     : '\(.\)' 2>/dev/null ||
-+	 X"$ac_file" : 'X\(//\)[^/]' \| \
-+	 X"$ac_file" : 'X\(//\)$' \| \
-+	 X"$ac_file" : 'X\(/\)' \| \
-+	 .     : '\(.\)' 2>/dev/null ||
- echo X"$ac_file" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-@@ -11513,10 +12819,10 @@
-       as_dirs="$as_dir $as_dirs"
-       as_dir=`(dirname "$as_dir") 2>/dev/null ||
- $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
--         X"$as_dir" : 'X\(//\)[^/]' \| \
--         X"$as_dir" : 'X\(//\)$' \| \
--         X"$as_dir" : 'X\(/\)' \| \
--         .     : '\(.\)' 2>/dev/null ||
-+	 X"$as_dir" : 'X\(//\)[^/]' \| \
-+	 X"$as_dir" : 'X\(//\)$' \| \
-+	 X"$as_dir" : 'X\(/\)' \| \
-+	 .     : '\(.\)' 2>/dev/null ||
- echo X"$as_dir" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-@@ -11554,12 +12860,45 @@
-     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-     ac_top_srcdir=$ac_top_builddir$srcdir ;;
- esac
--# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
--# absolute.
--ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
--ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
--ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
--ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
-+
-+# Do not use `cd foo && pwd` to compute absolute paths, because
-+# the directories may not exist.
-+case `pwd` in
-+.) ac_abs_builddir="$ac_dir";;
-+*)
-+  case "$ac_dir" in
-+  .) ac_abs_builddir=`pwd`;;
-+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-+  esac;;
-+esac
-+case $ac_abs_builddir in
-+.) ac_abs_top_builddir=${ac_top_builddir}.;;
-+*)
-+  case ${ac_top_builddir}. in
-+  .) ac_abs_top_builddir=$ac_abs_builddir;;
-+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-+  esac;;
-+esac
-+case $ac_abs_builddir in
-+.) ac_abs_srcdir=$ac_srcdir;;
-+*)
-+  case $ac_srcdir in
-+  .) ac_abs_srcdir=$ac_abs_builddir;;
-+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-+  esac;;
-+esac
-+case $ac_abs_builddir in
-+.) ac_abs_top_srcdir=$ac_top_srcdir;;
-+*)
-+  case $ac_top_srcdir in
-+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-+  esac;;
-+esac
- 
- 
-   case $INSTALL in
-@@ -11567,11 +12906,6 @@
-   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
-   esac
- 
--  if test x"$ac_file" != x-; then
--    { echo "$as_me:$LINENO: creating $ac_file" >&5
--echo "$as_me: creating $ac_file" >&6;}
--    rm -f "$ac_file"
--  fi
-   # Let's still pretend it is `configure' which instantiates (i.e., don't
-   # use $as_me), people would be surprised to read:
-   #    /* config.h.  Generated by config.status.  */
-@@ -11581,7 +12915,7 @@
-     configure_input="$ac_file.  "
-   fi
-   configure_input=$configure_input"Generated from `echo $ac_file_in |
--                                     sed 's,.*/,,'` by configure."
-+				     sed 's,.*/,,'` by configure."
- 
-   # First look for the input files in the build tree, otherwise in the
-   # src tree.
-@@ -11590,26 +12924,32 @@
-       case $f in
-       -) echo $tmp/stdin ;;
-       [\\/$]*)
--         # Absolute (can't be DOS-style, as IFS=:)
--         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-+	 # Absolute (can't be DOS-style, as IFS=:)
-+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
- echo "$as_me: error: cannot find input file: $f" >&2;}
-    { (exit 1); exit 1; }; }
--         echo $f;;
-+	 echo "$f";;
-       *) # Relative
--         if test -f "$f"; then
--           # Build tree
--           echo $f
--         elif test -f "$srcdir/$f"; then
--           # Source tree
--           echo $srcdir/$f
--         else
--           # /dev/null tree
--           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-+	 if test -f "$f"; then
-+	   # Build tree
-+	   echo "$f"
-+	 elif test -f "$srcdir/$f"; then
-+	   # Source tree
-+	   echo "$srcdir/$f"
-+	 else
-+	   # /dev/null tree
-+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
- echo "$as_me: error: cannot find input file: $f" >&2;}
-    { (exit 1); exit 1; }; }
--         fi;;
-+	 fi;;
-       esac
-     done` || { (exit 1); exit 1; }
-+
-+  if test x"$ac_file" != x-; then
-+    { echo "$as_me:$LINENO: creating $ac_file" >&5
-+echo "$as_me: creating $ac_file" >&6;}
-+    rm -f "$ac_file"
-+  fi
- _ACEOF
- cat >>$CONFIG_STATUS <<_ACEOF
-   sed "$ac_vpsub
-@@ -11649,12 +12989,12 @@
- # NAME is the cpp macro being defined and VALUE is the value it is being given.
- #
- # ac_d sets the value in "#define NAME VALUE" lines.
--ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
--ac_dB='[ 	].*$,\1#\2'
-+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
-+ac_dB='[	 ].*$,\1#\2'
- ac_dC=' '
- ac_dD=',;t'
- # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
--ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
-+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
- ac_uB='$,\1#\2define\3'
- ac_uC=' '
- ac_uD=',;t'
-@@ -11663,11 +13003,11 @@
-   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-   case $ac_file in
-   - | *:- | *:-:* ) # input from stdin
--        cat >$tmp/stdin
--        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
--        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-+	cat >$tmp/stdin
-+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
--        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-   * )   ac_file_in=$ac_file.in ;;
-   esac
- 
-@@ -11681,28 +13021,29 @@
-       case $f in
-       -) echo $tmp/stdin ;;
-       [\\/$]*)
--         # Absolute (can't be DOS-style, as IFS=:)
--         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-+	 # Absolute (can't be DOS-style, as IFS=:)
-+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
- echo "$as_me: error: cannot find input file: $f" >&2;}
-    { (exit 1); exit 1; }; }
--         echo $f;;
-+	 # Do quote $f, to prevent DOS paths from being IFS'd.
-+	 echo "$f";;
-       *) # Relative
--         if test -f "$f"; then
--           # Build tree
--           echo $f
--         elif test -f "$srcdir/$f"; then
--           # Source tree
--           echo $srcdir/$f
--         else
--           # /dev/null tree
--           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-+	 if test -f "$f"; then
-+	   # Build tree
-+	   echo "$f"
-+	 elif test -f "$srcdir/$f"; then
-+	   # Source tree
-+	   echo "$srcdir/$f"
-+	 else
-+	   # /dev/null tree
-+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
- echo "$as_me: error: cannot find input file: $f" >&2;}
-    { (exit 1); exit 1; }; }
--         fi;;
-+	 fi;;
-       esac
-     done` || { (exit 1); exit 1; }
-   # Remove the trailing spaces.
--  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
-+  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
- 
- _ACEOF
- 
-@@ -11725,9 +13066,9 @@
- s,[\\$`],\\&,g
- t clear
- : clear
--s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*\)\(([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
- t end
--s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
- : end
- _ACEOF
- # If some macros were called several times there might be several times
-@@ -11741,13 +13082,13 @@
- # example, in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- cat >>conftest.undefs <<\_ACEOF
--s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
- _ACEOF
- 
- # Break up conftest.defines because some shells have a limit on the size
- # of here documents, and old seds have small limits too (100 cmds).
- echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
--echo '  if grep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
- echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
- echo '  :' >>$CONFIG_STATUS
- rm -f conftest.tail
-@@ -11756,7 +13097,7 @@
-   # Write a limited-size here document to $tmp/defines.sed.
-   echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
-   # Speed up: don't consider the non `#define' lines.
--  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
-+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
-   # Work around the forget-to-reset-the-flag bug.
-   echo 't clr' >>$CONFIG_STATUS
-   echo ': clr' >>$CONFIG_STATUS
-@@ -11783,7 +13124,7 @@
-   # Write a limited-size here document to $tmp/undefs.sed.
-   echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
-   # Speed up: don't consider the non `#undef'
--  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
-+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
-   # Work around the forget-to-reset-the-flag bug.
-   echo 't clr' >>$CONFIG_STATUS
-   echo ': clr' >>$CONFIG_STATUS
-@@ -11817,10 +13158,10 @@
-     else
-       ac_dir=`(dirname "$ac_file") 2>/dev/null ||
- $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
--         X"$ac_file" : 'X\(//\)[^/]' \| \
--         X"$ac_file" : 'X\(//\)$' \| \
--         X"$ac_file" : 'X\(/\)' \| \
--         .     : '\(.\)' 2>/dev/null ||
-+	 X"$ac_file" : 'X\(//\)[^/]' \| \
-+	 X"$ac_file" : 'X\(//\)$' \| \
-+	 X"$ac_file" : 'X\(/\)' \| \
-+	 .     : '\(.\)' 2>/dev/null ||
- echo X"$ac_file" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-@@ -11836,10 +13177,10 @@
-       as_dirs="$as_dir $as_dirs"
-       as_dir=`(dirname "$as_dir") 2>/dev/null ||
- $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
--         X"$as_dir" : 'X\(//\)[^/]' \| \
--         X"$as_dir" : 'X\(//\)$' \| \
--         X"$as_dir" : 'X\(/\)' \| \
--         .     : '\(.\)' 2>/dev/null ||
-+	 X"$as_dir" : 'X\(//\)[^/]' \| \
-+	 X"$as_dir" : 'X\(//\)$' \| \
-+	 X"$as_dir" : 'X\(/\)' \| \
-+	 .     : '\(.\)' 2>/dev/null ||
- echo X"$as_dir" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
---- patch-2.5.9.orig/configure.ac
-+++ patch-2.5.9/configure.ac
-@@ -64,6 +64,9 @@
- gl_PREREQ_XMALLOC
- gl_QUOTE
- gl_QUOTEARG
-+gl_HASH
-+
-+ag_CHECK_NANOSECOND_STAT
- 
- dnl This should be in gnulib, but isn't for some reason.
- AC_DEFUN([jm_PREREQ_ADDEXT],
---- patch-2.5.9.orig/pch.c
-+++ patch-2.5.9/pch.c
-@@ -1,6 +1,6 @@
- /* reading patches */
- 
--/* $Id: pch.c,v 1.44 2003/05/20 14:03:17 eggert Exp $ */
-+/* $Id: pch.c,v 1.45 2003/07/02 22:19:21 eggert Exp $ */
- 
- /* Copyright (C) 1986, 1987, 1988 Larry Wall
- 
-@@ -366,10 +366,16 @@
- 	if (!stars_last_line && strnEQ(s, "*** ", 4))
- 	    name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]);
- 	else if (strnEQ(s, "+++ ", 4))
-+	  {
- 	    /* Swap with NEW below.  */
- 	    name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]);
-+	    p_strip_trailing_cr = strip_trailing_cr;
-+	  }
- 	else if (strnEQ(s, "Index:", 6))
-+	  {
- 	    name[INDEX] = fetchname (s+6, strippath, (time_t *) 0);
-+	    p_strip_trailing_cr = strip_trailing_cr;
-+	  }
- 	else if (strnEQ(s, "Prereq:", 7)) {
- 	    for (t = s + 7;  ISSPACE ((unsigned char) *t);  t++)
- 	      continue;
-@@ -409,6 +415,7 @@
- 		    p_timestamp[NEW] = timestamp;
- 		    p_rfc934_nesting = (t - s) >> 1;
- 		  }
-+		p_strip_trailing_cr = strip_trailing_cr;
- 	      }
- 	  }
- 	if ((diff_type == NO_DIFF || diff_type == ED_DIFF) &&
---- patch-2.5.9.orig/util.c
-+++ patch-2.5.9/util.c
-@@ -45,9 +45,17 @@
- # define raise(sig) kill (getpid (), sig)
- #endif
- 
-+#if defined(HAVE_STAT_TIMEVAL)
-+#include <time.h>
-+#endif
-+
- #include <stdarg.h>
-+#include <hash.h>
- 
- static void makedirs (char *);
-+static bool fid_search (const char *, const struct stat *, bool);
-+# define fid_exists(name, pst) fid_search (name, pst, false)
-+# define insert_fid(name) fid_search (name, NULL, true)
- 
- /* Move a file FROM (where *FROM_NEEDS_REMOVAL is nonzero if FROM
-    needs removal when cleaning up at the end of execution)
-@@ -64,7 +72,7 @@
-   struct stat to_st;
-   int to_errno = ! backup ? -1 : stat (to, &to_st) == 0 ? 0 : errno;
- 
--  if (backup)
-+  if (backup && (to_errno || ! fid_exists (to, &to_st)))
-     {
-       int try_makedirs_errno = 0;
-       char *bakname;
-@@ -165,6 +173,7 @@
- 	      if (! to_dir_known_to_exist)
- 		makedirs (to);
- 	      copy_file (from, to, 0, mode);
-+	      insert_fid (to);
- 	      return;
- 	    }
- 
-@@ -173,6 +182,7 @@
- 	}
- 
-     rename_succeeded:
-+      insert_fid (to);
-       /* Do not clear *FROM_NEEDS_REMOVAL if it's possible that the
- 	 rename returned zero because FROM and TO are hard links to
- 	 the same file.  */
-@@ -1011,3 +1021,105 @@
-   if (file_seek (stream, offset, ptrname) != 0)
-     pfatal ("fseek");
- }
-+
-+typedef struct
-+{
-+  dev_t		fid_dev;
-+  ino_t		fid_ino;
-+  time_t	fid_mtime;
-+  unsigned long	fid_mtimensec;
-+} file_id;
-+
-+unsigned
-+file_id_hasher (file_id *entry, unsigned table_size)
-+{
-+  return ((unsigned long) entry->fid_ino +
-+  	  (unsigned long) entry->fid_dev +
-+  	  (unsigned long) entry->fid_mtime +
-+	  (unsigned long) entry->fid_mtimensec) % table_size;
-+}
-+
-+bool
-+file_id_comparator (file_id *entry1, file_id *entry2)
-+{
-+  return (entry1->fid_dev	== entry2->fid_dev &&
-+	  entry1->fid_ino	== entry2->fid_ino &&
-+	  entry1->fid_mtime	== entry2->fid_mtime &&
-+	  entry1->fid_mtimensec == entry2->fid_mtimensec);
-+}
-+
-+void
-+file_id_freer (file_id *entry)
-+{
-+  free (entry);
-+}
-+
-+Hash_table *file_id_hash;
-+
-+/* Check if the file identified by FILENAME and PST was already seen. If the
-+   file was already seen, returns TRUE.  If the file has not yet been seen
-+   and INSERT is TRUE, it is inserted.  PST or FILENAME may be NULL (but not
-+   both of them).  */
-+
-+static bool
-+fid_search (const char *filename, const struct stat *pst, bool insert)
-+{
-+  struct stat st;
-+
-+  if (!file_id_hash)
-+    {
-+      file_id_hash = hash_initialize (0, NULL, (Hash_hasher) file_id_hasher,
-+				      (Hash_comparator) file_id_comparator,
-+				      (Hash_data_freer) file_id_freer);
-+      if (!file_id_hash)
-+	pfatal ("hash_initialize");
-+    }
-+
-+  if (!pst)
-+    {
-+      if (stat (filename, &st) != 0)
-+	pfatal ("%s", quotearg (filename));
-+      pst = &st;
-+    }
-+
-+  if (insert)
-+    {
-+      file_id *pfid = xmalloc (sizeof (file_id)), *old_pfid;
-+      pfid->fid_dev	  = pst->st_dev;
-+      pfid->fid_ino	  = pst->st_ino;
-+      pfid->fid_mtime	  = pst->st_mtime;
-+#if defined(HAVE_STAT_NSEC)
-+      pfid->fid_mtimensec = pst->st_mtimensec;
-+#elif defined(HAVE_STAT_TIMEVAL)
-+      pfid->fid_mtimensec = pst->st_mtim.tv_nsec;
-+#else
-+      pfid->fid_mtimensec = 0;
-+#endif
-+      old_pfid = hash_insert (file_id_hash, pfid);
-+      if (!old_pfid)
-+	pfatal ("hash_insert");
-+      else if (old_pfid != pfid)
-+        {
-+	  free (pfid);
-+	  return true;
-+	}
-+      else
-+	return false;
-+    }
-+  else
-+    {
-+      file_id fid;
-+      fid.fid_dev	= pst->st_dev;
-+      fid.fid_ino	= pst->st_ino;
-+      fid.fid_mtime	= pst->st_mtime;
-+#if defined(HAVE_STAT_NSEC)
-+      fid.fid_mtimensec = pst->st_mtimensec;
-+#elif defined(HAVE_STAT_TIMEVAL)
-+      fid.fid_mtimensec = pst->st_mtim.tv_nsec;
-+#else
-+      fid.fid_mtimensec = 0;
-+#endif
-+      return hash_lookup (file_id_hash, &fid) != 0;
-+    }
-+}
-+
---- patch-2.5.9.orig/hash.c
-+++ patch-2.5.9/hash.c
-@@ -0,0 +1,1051 @@
-+/* hash - hashing table processing.
-+
-+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
-+   Foundation, Inc.
-+
-+   Written by Jim Meyering, 1992.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program; if not, write to the Free Software Foundation,
-+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-+
-+/* A generic hash table package.  */
-+
-+/* Define USE_OBSTACK to 1 if you want the allocator to use obstacks instead
-+   of malloc.  If you change USE_OBSTACK, you have to recompile!  */
-+
-+#if HAVE_CONFIG_H
-+# include <config.h>
-+#endif
-+#if HAVE_STDLIB_H
-+# include <stdlib.h>
-+#endif
-+
-+#include <limits.h>
-+#include <stdbool.h>
-+#include <stdio.h>
-+
-+#ifndef HAVE_DECL_FREE
-+"this configure-time declaration test was not run"
-+#endif
-+#if !HAVE_DECL_FREE
-+void free ();
-+#endif
-+
-+#ifndef HAVE_DECL_MALLOC
-+"this configure-time declaration test was not run"
-+#endif
-+#if !HAVE_DECL_MALLOC
-+char *malloc ();
-+#endif
-+
-+#if USE_OBSTACK
-+# include "obstack.h"
-+# ifndef obstack_chunk_alloc
-+#  define obstack_chunk_alloc malloc
-+# endif
-+# ifndef obstack_chunk_free
-+#  define obstack_chunk_free free
-+# endif
-+#endif
-+
-+#include "hash.h"
-+
-+struct hash_table
-+  {
-+    /* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
-+       for a possibility of N_BUCKETS.  Among those, N_BUCKETS_USED buckets
-+       are not empty, there are N_ENTRIES active entries in the table.  */
-+    struct hash_entry *bucket;
-+    struct hash_entry *bucket_limit;
-+    unsigned n_buckets;
-+    unsigned n_buckets_used;
-+    unsigned n_entries;
-+
-+    /* Tuning arguments, kept in a physicaly separate structure.  */
-+    const Hash_tuning *tuning;
-+
-+    /* Three functions are given to `hash_initialize', see the documentation
-+       block for this function.  In a word, HASHER randomizes a user entry
-+       into a number up from 0 up to some maximum minus 1; COMPARATOR returns
-+       true if two user entries compare equally; and DATA_FREER is the cleanup
-+       function for a user entry.  */
-+    Hash_hasher hasher;
-+    Hash_comparator comparator;
-+    Hash_data_freer data_freer;
-+
-+    /* A linked list of freed struct hash_entry structs.  */
-+    struct hash_entry *free_entry_list;
-+
-+#if USE_OBSTACK
-+    /* Whenever obstacks are used, it is possible to allocate all overflowed
-+       entries into a single stack, so they all can be freed in a single
-+       operation.  It is not clear if the speedup is worth the trouble.  */
-+    struct obstack entry_stack;
-+#endif
-+  };
-+
-+/* A hash table contains many internal entries, each holding a pointer to
-+   some user provided data (also called a user entry).  An entry indistinctly
-+   refers to both the internal entry and its associated user entry.  A user
-+   entry contents may be hashed by a randomization function (the hashing
-+   function, or just `hasher' for short) into a number (or `slot') between 0
-+   and the current table size.  At each slot position in the hash table,
-+   starts a linked chain of entries for which the user data all hash to this
-+   slot.  A bucket is the collection of all entries hashing to the same slot.
-+
-+   A good `hasher' function will distribute entries rather evenly in buckets.
-+   In the ideal case, the length of each bucket is roughly the number of
-+   entries divided by the table size.  Finding the slot for a data is usually
-+   done in constant time by the `hasher', and the later finding of a precise
-+   entry is linear in time with the size of the bucket.  Consequently, a
-+   larger hash table size (that is, a larger number of buckets) is prone to
-+   yielding shorter chains, *given* the `hasher' function behaves properly.
-+
-+   Long buckets slow down the lookup algorithm.  One might use big hash table
-+   sizes in hope to reduce the average length of buckets, but this might
-+   become inordinate, as unused slots in the hash table take some space.  The
-+   best bet is to make sure you are using a good `hasher' function (beware
-+   that those are not that easy to write! :-), and to use a table size
-+   larger than the actual number of entries.  */
-+
-+/* If an insertion makes the ratio of nonempty buckets to table size larger
-+   than the growth threshold (a number between 0.0 and 1.0), then increase
-+   the table size by multiplying by the growth factor (a number greater than
-+   1.0).  The growth threshold defaults to 0.8, and the growth factor
-+   defaults to 1.414, meaning that the table will have doubled its size
-+   every second time 80% of the buckets get used.  */
-+#define DEFAULT_GROWTH_THRESHOLD 0.8
-+#define DEFAULT_GROWTH_FACTOR 1.414
-+
-+/* If a deletion empties a bucket and causes the ratio of used buckets to
-+   table size to become smaller than the shrink threshold (a number between
-+   0.0 and 1.0), then shrink the table by multiplying by the shrink factor (a
-+   number greater than the shrink threshold but smaller than 1.0).  The shrink
-+   threshold and factor default to 0.0 and 1.0, meaning that the table never
-+   shrinks.  */
-+#define DEFAULT_SHRINK_THRESHOLD 0.0
-+#define DEFAULT_SHRINK_FACTOR 1.0
-+
-+/* Use this to initialize or reset a TUNING structure to
-+   some sensible values. */
-+static const Hash_tuning default_tuning =
-+  {
-+    DEFAULT_SHRINK_THRESHOLD,
-+    DEFAULT_SHRINK_FACTOR,
-+    DEFAULT_GROWTH_THRESHOLD,
-+    DEFAULT_GROWTH_FACTOR,
-+    false
-+  };
-+
-+/* Information and lookup.  */
-+
-+/* The following few functions provide information about the overall hash
-+   table organization: the number of entries, number of buckets and maximum
-+   length of buckets.  */
-+
-+/* Return the number of buckets in the hash table.  The table size, the total
-+   number of buckets (used plus unused), or the maximum number of slots, are
-+   the same quantity.  */
-+
-+unsigned
-+hash_get_n_buckets (const Hash_table *table)
-+{
-+  return table->n_buckets;
-+}
-+
-+/* Return the number of slots in use (non-empty buckets).  */
-+
-+unsigned
-+hash_get_n_buckets_used (const Hash_table *table)
-+{
-+  return table->n_buckets_used;
-+}
-+
-+/* Return the number of active entries.  */
-+
-+unsigned
-+hash_get_n_entries (const Hash_table *table)
-+{
-+  return table->n_entries;
-+}
-+
-+/* Return the length of the longest chain (bucket).  */
-+
-+unsigned
-+hash_get_max_bucket_length (const Hash_table *table)
-+{
-+  struct hash_entry *bucket;
-+  unsigned max_bucket_length = 0;
-+
-+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
-+    {
-+      if (bucket->data)
-+	{
-+	  struct hash_entry *cursor = bucket;
-+	  unsigned bucket_length = 1;
-+
-+	  while (cursor = cursor->next, cursor)
-+	    bucket_length++;
-+
-+	  if (bucket_length > max_bucket_length)
-+	    max_bucket_length = bucket_length;
-+	}
-+    }
-+
-+  return max_bucket_length;
-+}
-+
-+/* Do a mild validation of a hash table, by traversing it and checking two
-+   statistics.  */
-+
-+bool
-+hash_table_ok (const Hash_table *table)
-+{
-+  struct hash_entry *bucket;
-+  unsigned n_buckets_used = 0;
-+  unsigned n_entries = 0;
-+
-+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
-+    {
-+      if (bucket->data)
-+	{
-+	  struct hash_entry *cursor = bucket;
-+
-+	  /* Count bucket head.  */
-+	  n_buckets_used++;
-+	  n_entries++;
-+
-+	  /* Count bucket overflow.  */
-+	  while (cursor = cursor->next, cursor)
-+	    n_entries++;
-+	}
-+    }
-+
-+  if (n_buckets_used == table->n_buckets_used && n_entries == table->n_entries)
-+    return true;
-+
-+  return false;
-+}
-+
-+void
-+hash_print_statistics (const Hash_table *table, FILE *stream)
-+{
-+  unsigned n_entries = hash_get_n_entries (table);
-+  unsigned n_buckets = hash_get_n_buckets (table);
-+  unsigned n_buckets_used = hash_get_n_buckets_used (table);
-+  unsigned max_bucket_length = hash_get_max_bucket_length (table);
-+
-+  fprintf (stream, "# entries:         %u\n", n_entries);
-+  fprintf (stream, "# buckets:         %u\n", n_buckets);
-+  fprintf (stream, "# buckets used:    %u (%.2f%%)\n", n_buckets_used,
-+	   (100.0 * n_buckets_used) / n_buckets);
-+  fprintf (stream, "max bucket length: %u\n", max_bucket_length);
-+}
-+
-+/* If ENTRY matches an entry already in the hash table, return the
-+   entry from the table.  Otherwise, return NULL.  */
-+
-+void *
-+hash_lookup (const Hash_table *table, const void *entry)
-+{
-+  struct hash_entry *bucket
-+    = table->bucket + table->hasher (entry, table->n_buckets);
-+  struct hash_entry *cursor;
-+
-+  if (! (bucket < table->bucket_limit))
-+    abort ();
-+
-+  if (bucket->data == NULL)
-+    return NULL;
-+
-+  for (cursor = bucket; cursor; cursor = cursor->next)
-+    if (table->comparator (entry, cursor->data))
-+      return cursor->data;
-+
-+  return NULL;
-+}
-+
-+/* Walking.  */
-+
-+/* The functions in this page traverse the hash table and process the
-+   contained entries.  For the traversal to work properly, the hash table
-+   should not be resized nor modified while any particular entry is being
-+   processed.  In particular, entries should not be added or removed.  */
-+
-+/* Return the first data in the table, or NULL if the table is empty.  */
-+
-+void *
-+hash_get_first (const Hash_table *table)
-+{
-+  struct hash_entry *bucket;
-+
-+  if (table->n_entries == 0)
-+    return NULL;
-+
-+  for (bucket = table->bucket; ; bucket++)
-+    if (! (bucket < table->bucket_limit))
-+      abort ();
-+    else if (bucket->data)
-+      return bucket->data;
-+}
-+
-+/* Return the user data for the entry following ENTRY, where ENTRY has been
-+   returned by a previous call to either `hash_get_first' or `hash_get_next'.
-+   Return NULL if there are no more entries.  */
-+
-+void *
-+hash_get_next (const Hash_table *table, const void *entry)
-+{
-+  struct hash_entry *bucket
-+    = table->bucket + table->hasher (entry, table->n_buckets);
-+  struct hash_entry *cursor;
-+
-+  if (! (bucket < table->bucket_limit))
-+    abort ();
-+
-+  /* Find next entry in the same bucket.  */
-+  for (cursor = bucket; cursor; cursor = cursor->next)
-+    if (cursor->data == entry && cursor->next)
-+      return cursor->next->data;
-+
-+  /* Find first entry in any subsequent bucket.  */
-+  while (++bucket < table->bucket_limit)
-+    if (bucket->data)
-+      return bucket->data;
-+
-+  /* None found.  */
-+  return NULL;
-+}
-+
-+/* Fill BUFFER with pointers to active user entries in the hash table, then
-+   return the number of pointers copied.  Do not copy more than BUFFER_SIZE
-+   pointers.  */
-+
-+unsigned
-+hash_get_entries (const Hash_table *table, void **buffer,
-+		  unsigned buffer_size)
-+{
-+  unsigned counter = 0;
-+  struct hash_entry *bucket;
-+  struct hash_entry *cursor;
-+
-+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
-+    {
-+      if (bucket->data)
-+	{
-+	  for (cursor = bucket; cursor; cursor = cursor->next)
-+	    {
-+	      if (counter >= buffer_size)
-+		return counter;
-+	      buffer[counter++] = cursor->data;
-+	    }
-+	}
-+    }
-+
-+  return counter;
-+}
-+
-+/* Call a PROCESSOR function for each entry of a hash table, and return the
-+   number of entries for which the processor function returned success.  A
-+   pointer to some PROCESSOR_DATA which will be made available to each call to
-+   the processor function.  The PROCESSOR accepts two arguments: the first is
-+   the user entry being walked into, the second is the value of PROCESSOR_DATA
-+   as received.  The walking continue for as long as the PROCESSOR function
-+   returns nonzero.  When it returns zero, the walking is interrupted.  */
-+
-+unsigned
-+hash_do_for_each (const Hash_table *table, Hash_processor processor,
-+		  void *processor_data)
-+{
-+  unsigned counter = 0;
-+  struct hash_entry *bucket;
-+  struct hash_entry *cursor;
-+
-+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
-+    {
-+      if (bucket->data)
-+	{
-+	  for (cursor = bucket; cursor; cursor = cursor->next)
-+	    {
-+	      if (!(*processor) (cursor->data, processor_data))
-+		return counter;
-+	      counter++;
-+	    }
-+	}
-+    }
-+
-+  return counter;
-+}
-+
-+/* Allocation and clean-up.  */
-+
-+/* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1.
-+   This is a convenience routine for constructing other hashing functions.  */
-+
-+#if USE_DIFF_HASH
-+
-+/* About hashings, Paul Eggert writes to me (FP), on 1994-01-01: "Please see
-+   B. J. McKenzie, R. Harries & T. Bell, Selecting a hashing algorithm,
-+   Software--practice & experience 20, 2 (Feb 1990), 209-224.  Good hash
-+   algorithms tend to be domain-specific, so what's good for [diffutils'] io.c
-+   may not be good for your application."  */
-+
-+unsigned
-+hash_string (const char *string, unsigned n_buckets)
-+{
-+# define ROTATE_LEFT(Value, Shift) \
-+  ((Value) << (Shift) | (Value) >> ((sizeof (unsigned) * CHAR_BIT) - (Shift)))
-+# define HASH_ONE_CHAR(Value, Byte) \
-+  ((Byte) + ROTATE_LEFT (Value, 7))
-+
-+  unsigned value = 0;
-+
-+  for (; *string; string++)
-+    value = HASH_ONE_CHAR (value, *(const unsigned char *) string);
-+  return value % n_buckets;
-+
-+# undef ROTATE_LEFT
-+# undef HASH_ONE_CHAR
-+}
-+
-+#else /* not USE_DIFF_HASH */
-+
-+/* This one comes from `recode', and performs a bit better than the above as
-+   per a few experiments.  It is inspired from a hashing routine found in the
-+   very old Cyber `snoop', itself written in typical Greg Mansfield style.
-+   (By the way, what happened to this excellent man?  Is he still alive?)  */
-+
-+unsigned
-+hash_string (const char *string, unsigned n_buckets)
-+{
-+  unsigned value = 0;
-+
-+  while (*string)
-+    value = ((value * 31 + (int) *(const unsigned char *) string++)
-+	     % n_buckets);
-+  return value;
-+}
-+
-+#endif /* not USE_DIFF_HASH */
-+
-+/* Return true if CANDIDATE is a prime number.  CANDIDATE should be an odd
-+   number at least equal to 11.  */
-+
-+static bool
-+is_prime (unsigned long candidate)
-+{
-+  unsigned long divisor = 3;
-+  unsigned long square = divisor * divisor;
-+
-+  while (square < candidate && (candidate % divisor))
-+    {
-+      divisor++;
-+      square += 4 * divisor;
-+      divisor++;
-+    }
-+
-+  return (candidate % divisor ? true : false);
-+}
-+
-+/* Round a given CANDIDATE number up to the nearest prime, and return that
-+   prime.  Primes lower than 10 are merely skipped.  */
-+
-+static unsigned long
-+next_prime (unsigned long candidate)
-+{
-+  /* Skip small primes.  */
-+  if (candidate < 10)
-+    candidate = 10;
-+
-+  /* Make it definitely odd.  */
-+  candidate |= 1;
-+
-+  while (!is_prime (candidate))
-+    candidate += 2;
-+
-+  return candidate;
-+}
-+
-+void
-+hash_reset_tuning (Hash_tuning *tuning)
-+{
-+  *tuning = default_tuning;
-+}
-+
-+/* For the given hash TABLE, check the user supplied tuning structure for
-+   reasonable values, and return true if there is no gross error with it.
-+   Otherwise, definitively reset the TUNING field to some acceptable default
-+   in the hash table (that is, the user loses the right of further modifying
-+   tuning arguments), and return false.  */
-+
-+static bool
-+check_tuning (Hash_table *table)
-+{
-+  const Hash_tuning *tuning = table->tuning;
-+
-+  if (tuning->growth_threshold > 0.0
-+      && tuning->growth_threshold < 1.0
-+      && tuning->growth_factor > 1.0
-+      && tuning->shrink_threshold >= 0.0
-+      && tuning->shrink_threshold < 1.0
-+      && tuning->shrink_factor > tuning->shrink_threshold
-+      && tuning->shrink_factor <= 1.0
-+      && tuning->shrink_threshold < tuning->growth_threshold)
-+    return true;
-+
-+  table->tuning = &default_tuning;
-+  return false;
-+}
-+
-+/* Allocate and return a new hash table, or NULL upon failure.  The initial
-+   number of buckets is automatically selected so as to _guarantee_ that you
-+   may insert at least CANDIDATE different user entries before any growth of
-+   the hash table size occurs.  So, if have a reasonably tight a-priori upper
-+   bound on the number of entries you intend to insert in the hash table, you
-+   may save some table memory and insertion time, by specifying it here.  If
-+   the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE
-+   argument has its meaning changed to the wanted number of buckets.
-+
-+   TUNING points to a structure of user-supplied values, in case some fine
-+   tuning is wanted over the default behavior of the hasher.  If TUNING is
-+   NULL, the default tuning parameters are used instead.
-+
-+   The user-supplied HASHER function should be provided.  It accepts two
-+   arguments ENTRY and TABLE_SIZE.  It computes, by hashing ENTRY contents, a
-+   slot number for that entry which should be in the range 0..TABLE_SIZE-1.
-+   This slot number is then returned.
-+
-+   The user-supplied COMPARATOR function should be provided.  It accepts two
-+   arguments pointing to user data, it then returns true for a pair of entries
-+   that compare equal, or false otherwise.  This function is internally called
-+   on entries which are already known to hash to the same bucket index.
-+
-+   The user-supplied DATA_FREER function, when not NULL, may be later called
-+   with the user data as an argument, just before the entry containing the
-+   data gets freed.  This happens from within `hash_free' or `hash_clear'.
-+   You should specify this function only if you want these functions to free
-+   all of your `data' data.  This is typically the case when your data is
-+   simply an auxiliary struct that you have malloc'd to aggregate several
-+   values.  */
-+
-+Hash_table *
-+hash_initialize (unsigned candidate, const Hash_tuning *tuning,
-+		 Hash_hasher hasher, Hash_comparator comparator,
-+		 Hash_data_freer data_freer)
-+{
-+  Hash_table *table;
-+  struct hash_entry *bucket;
-+
-+  if (hasher == NULL || comparator == NULL)
-+    return NULL;
-+
-+  table = (Hash_table *) malloc (sizeof (Hash_table));
-+  if (table == NULL)
-+    return NULL;
-+
-+  if (!tuning)
-+    tuning = &default_tuning;
-+  table->tuning = tuning;
-+  if (!check_tuning (table))
-+    {
-+      /* Fail if the tuning options are invalid.  This is the only occasion
-+	 when the user gets some feedback about it.  Once the table is created,
-+	 if the user provides invalid tuning options, we silently revert to
-+	 using the defaults, and ignore further request to change the tuning
-+	 options.  */
-+      free (table);
-+      return NULL;
-+    }
-+
-+  table->n_buckets
-+    = next_prime (tuning->is_n_buckets ? candidate
-+		  : (unsigned) (candidate / tuning->growth_threshold));
-+
-+  table->bucket = (struct hash_entry *)
-+    malloc (table->n_buckets * sizeof (struct hash_entry));
-+  if (table->bucket == NULL)
-+    {
-+      free (table);
-+      return NULL;
-+    }
-+  table->bucket_limit = table->bucket + table->n_buckets;
-+
-+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
-+    {
-+      bucket->data = NULL;
-+      bucket->next = NULL;
-+    }
-+  table->n_buckets_used = 0;
-+  table->n_entries = 0;
-+
-+  table->hasher = hasher;
-+  table->comparator = comparator;
-+  table->data_freer = data_freer;
-+
-+  table->free_entry_list = NULL;
-+#if USE_OBSTACK
-+  obstack_init (&table->entry_stack);
-+#endif
-+  return table;
-+}
-+
-+/* Make all buckets empty, placing any chained entries on the free list.
-+   Apply the user-specified function data_freer (if any) to the datas of any
-+   affected entries.  */
-+
-+void
-+hash_clear (Hash_table *table)
-+{
-+  struct hash_entry *bucket;
-+
-+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
-+    {
-+      if (bucket->data)
-+	{
-+	  struct hash_entry *cursor;
-+	  struct hash_entry *next;
-+
-+	  /* Free the bucket overflow.  */
-+	  for (cursor = bucket->next; cursor; cursor = next)
-+	    {
-+	      if (table->data_freer)
-+		(*table->data_freer) (cursor->data);
-+	      cursor->data = NULL;
-+
-+	      next = cursor->next;
-+	      /* Relinking is done one entry at a time, as it is to be expected
-+		 that overflows are either rare or short.  */
-+	      cursor->next = table->free_entry_list;
-+	      table->free_entry_list = cursor;
-+	    }
-+
-+	  /* Free the bucket head.  */
-+	  if (table->data_freer)
-+	    (*table->data_freer) (bucket->data);
-+	  bucket->data = NULL;
-+	  bucket->next = NULL;
-+	}
-+    }
-+
-+  table->n_buckets_used = 0;
-+  table->n_entries = 0;
-+}
-+
-+/* Reclaim all storage associated with a hash table.  If a data_freer
-+   function has been supplied by the user when the hash table was created,
-+   this function applies it to the data of each entry before freeing that
-+   entry.  */
-+
-+void
-+hash_free (Hash_table *table)
-+{
-+  struct hash_entry *bucket;
-+  struct hash_entry *cursor;
-+  struct hash_entry *next;
-+
-+  /* Call the user data_freer function.  */
-+  if (table->data_freer && table->n_entries)
-+    {
-+      for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
-+	{
-+	  if (bucket->data)
-+	    {
-+	      for (cursor = bucket; cursor; cursor = cursor->next)
-+		{
-+		  (*table->data_freer) (cursor->data);
-+		}
-+	    }
-+	}
-+    }
-+
-+#if USE_OBSTACK
-+
-+  obstack_free (&table->entry_stack, NULL);
-+
-+#else
-+
-+  /* Free all bucket overflowed entries.  */
-+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
-+    {
-+      for (cursor = bucket->next; cursor; cursor = next)
-+	{
-+	  next = cursor->next;
-+	  free (cursor);
-+	}
-+    }
-+
-+  /* Also reclaim the internal list of previously freed entries.  */
-+  for (cursor = table->free_entry_list; cursor; cursor = next)
-+    {
-+      next = cursor->next;
-+      free (cursor);
-+    }
-+
-+#endif
-+
-+  /* Free the remainder of the hash table structure.  */
-+  free (table->bucket);
-+  free (table);
-+}
-+
-+/* Insertion and deletion.  */
-+
-+/* Get a new hash entry for a bucket overflow, possibly by reclying a
-+   previously freed one.  If this is not possible, allocate a new one.  */
-+
-+static struct hash_entry *
-+allocate_entry (Hash_table *table)
-+{
-+  struct hash_entry *new;
-+
-+  if (table->free_entry_list)
-+    {
-+      new = table->free_entry_list;
-+      table->free_entry_list = new->next;
-+    }
-+  else
-+    {
-+#if USE_OBSTACK
-+      new = (struct hash_entry *)
-+	obstack_alloc (&table->entry_stack, sizeof (struct hash_entry));
-+#else
-+      new = (struct hash_entry *) malloc (sizeof (struct hash_entry));
-+#endif
-+    }
-+
-+  return new;
-+}
-+
-+/* Free a hash entry which was part of some bucket overflow,
-+   saving it for later recycling.  */
-+
-+static void
-+free_entry (Hash_table *table, struct hash_entry *entry)
-+{
-+  entry->data = NULL;
-+  entry->next = table->free_entry_list;
-+  table->free_entry_list = entry;
-+}
-+
-+/* This private function is used to help with insertion and deletion.  When
-+   ENTRY matches an entry in the table, return a pointer to the corresponding
-+   user data and set *BUCKET_HEAD to the head of the selected bucket.
-+   Otherwise, return NULL.  When DELETE is true and ENTRY matches an entry in
-+   the table, unlink the matching entry.  */
-+
-+static void *
-+hash_find_entry (Hash_table *table, const void *entry,
-+		 struct hash_entry **bucket_head, bool delete)
-+{
-+  struct hash_entry *bucket
-+    = table->bucket + table->hasher (entry, table->n_buckets);
-+  struct hash_entry *cursor;
-+
-+  if (! (bucket < table->bucket_limit))
-+    abort ();
-+
-+  *bucket_head = bucket;
-+
-+  /* Test for empty bucket.  */
-+  if (bucket->data == NULL)
-+    return NULL;
-+
-+  /* See if the entry is the first in the bucket.  */
-+  if ((*table->comparator) (entry, bucket->data))
-+    {
-+      void *data = bucket->data;
-+
-+      if (delete)
-+	{
-+	  if (bucket->next)
-+	    {
-+	      struct hash_entry *next = bucket->next;
-+
-+	      /* Bump the first overflow entry into the bucket head, then save
-+		 the previous first overflow entry for later recycling.  */
-+	      *bucket = *next;
-+	      free_entry (table, next);
-+	    }
-+	  else
-+	    {
-+	      bucket->data = NULL;
-+	    }
-+	}
-+
-+      return data;
-+    }
-+
-+  /* Scan the bucket overflow.  */
-+  for (cursor = bucket; cursor->next; cursor = cursor->next)
-+    {
-+      if ((*table->comparator) (entry, cursor->next->data))
-+	{
-+	  void *data = cursor->next->data;
-+
-+	  if (delete)
-+	    {
-+	      struct hash_entry *next = cursor->next;
-+
-+	      /* Unlink the entry to delete, then save the freed entry for later
-+		 recycling.  */
-+	      cursor->next = next->next;
-+	      free_entry (table, next);
-+	    }
-+
-+	  return data;
-+	}
-+    }
-+
-+  /* No entry found.  */
-+  return NULL;
-+}
-+
-+/* For an already existing hash table, change the number of buckets through
-+   specifying CANDIDATE.  The contents of the hash table are preserved.  The
-+   new number of buckets is automatically selected so as to _guarantee_ that
-+   the table may receive at least CANDIDATE different user entries, including
-+   those already in the table, before any other growth of the hash table size
-+   occurs.  If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the
-+   exact number of buckets desired.  */
-+
-+bool
-+hash_rehash (Hash_table *table, unsigned candidate)
-+{
-+  Hash_table *new_table;
-+  struct hash_entry *bucket;
-+  struct hash_entry *cursor;
-+  struct hash_entry *next;
-+
-+  new_table = hash_initialize (candidate, table->tuning, table->hasher,
-+			       table->comparator, table->data_freer);
-+  if (new_table == NULL)
-+    return false;
-+
-+  /* Merely reuse the extra old space into the new table.  */
-+#if USE_OBSTACK
-+  obstack_free (&new_table->entry_stack, NULL);
-+  new_table->entry_stack = table->entry_stack;
-+#endif
-+  new_table->free_entry_list = table->free_entry_list;
-+
-+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
-+    if (bucket->data)
-+      for (cursor = bucket; cursor; cursor = next)
-+	{
-+	  void *data = cursor->data;
-+	  struct hash_entry *new_bucket
-+	    = (new_table->bucket
-+	       + new_table->hasher (data, new_table->n_buckets));
-+
-+	  if (! (new_bucket < new_table->bucket_limit))
-+	    abort ();
-+
-+	  next = cursor->next;
-+
-+	  if (new_bucket->data)
-+	    {
-+	      if (cursor == bucket)
-+		{
-+		  /* Allocate or recycle an entry, when moving from a bucket
-+		     header into a bucket overflow.  */
-+		  struct hash_entry *new_entry = allocate_entry (new_table);
-+
-+		  if (new_entry == NULL)
-+		    return false;
-+
-+		  new_entry->data = data;
-+		  new_entry->next = new_bucket->next;
-+		  new_bucket->next = new_entry;
-+		}
-+	      else
-+		{
-+		  /* Merely relink an existing entry, when moving from a
-+		     bucket overflow into a bucket overflow.  */
-+		  cursor->next = new_bucket->next;
-+		  new_bucket->next = cursor;
-+		}
-+	    }
-+	  else
-+	    {
-+	      /* Free an existing entry, when moving from a bucket
-+		 overflow into a bucket header.  Also take care of the
-+		 simple case of moving from a bucket header into a bucket
-+		 header.  */
-+	      new_bucket->data = data;
-+	      new_table->n_buckets_used++;
-+	      if (cursor != bucket)
-+		free_entry (new_table, cursor);
-+	    }
-+	}
-+
-+  free (table->bucket);
-+  table->bucket = new_table->bucket;
-+  table->bucket_limit = new_table->bucket_limit;
-+  table->n_buckets = new_table->n_buckets;
-+  table->n_buckets_used = new_table->n_buckets_used;
-+  table->free_entry_list = new_table->free_entry_list;
-+  /* table->n_entries already holds its value.  */
-+#if USE_OBSTACK
-+  table->entry_stack = new_table->entry_stack;
-+#endif
-+  free (new_table);
-+
-+  return true;
-+}
-+
-+/* If ENTRY matches an entry already in the hash table, return the pointer
-+   to the entry from the table.  Otherwise, insert ENTRY and return ENTRY.
-+   Return NULL if the storage required for insertion cannot be allocated.  */
-+
-+void *
-+hash_insert (Hash_table *table, const void *entry)
-+{
-+  void *data;
-+  struct hash_entry *bucket;
-+
-+  /* The caller cannot insert a NULL entry.  */
-+  if (! entry)
-+    abort ();
-+
-+  /* If there's a matching entry already in the table, return that.  */
-+  if ((data = hash_find_entry (table, entry, &bucket, false)) != NULL)
-+    return data;
-+
-+  /* ENTRY is not matched, it should be inserted.  */
-+
-+  if (bucket->data)
-+    {
-+      struct hash_entry *new_entry = allocate_entry (table);
-+
-+      if (new_entry == NULL)
-+	return NULL;
-+
-+      /* Add ENTRY in the overflow of the bucket.  */
-+
-+      new_entry->data = (void *) entry;
-+      new_entry->next = bucket->next;
-+      bucket->next = new_entry;
-+      table->n_entries++;
-+      return (void *) entry;
-+    }
-+
-+  /* Add ENTRY right in the bucket head.  */
-+
-+  bucket->data = (void *) entry;
-+  table->n_entries++;
-+  table->n_buckets_used++;
-+
-+  /* If the growth threshold of the buckets in use has been reached, increase
-+     the table size and rehash.  There's no point in checking the number of
-+     entries:  if the hashing function is ill-conditioned, rehashing is not
-+     likely to improve it.  */
-+
-+  if (table->n_buckets_used
-+      > table->tuning->growth_threshold * table->n_buckets)
-+    {
-+      /* Check more fully, before starting real work.  If tuning arguments
-+	 became invalid, the second check will rely on proper defaults.  */
-+      check_tuning (table);
-+      if (table->n_buckets_used
-+	  > table->tuning->growth_threshold * table->n_buckets)
-+	{
-+	  const Hash_tuning *tuning = table->tuning;
-+	  unsigned candidate
-+	    = (unsigned) (tuning->is_n_buckets
-+			  ? (table->n_buckets * tuning->growth_factor)
-+			  : (table->n_buckets * tuning->growth_factor
-+			     * tuning->growth_threshold));
-+
-+	  /* If the rehash fails, arrange to return NULL.  */
-+	  if (!hash_rehash (table, candidate))
-+	    entry = NULL;
-+	}
-+    }
-+
-+  return (void *) entry;
-+}
-+
-+/* If ENTRY is already in the table, remove it and return the just-deleted
-+   data (the user may want to deallocate its storage).  If ENTRY is not in the
-+   table, don't modify the table and return NULL.  */
-+
-+void *
-+hash_delete (Hash_table *table, const void *entry)
-+{
-+  void *data;
-+  struct hash_entry *bucket;
-+
-+  data = hash_find_entry (table, entry, &bucket, true);
-+  if (!data)
-+    return NULL;
-+
-+  table->n_entries--;
-+  if (!bucket->data)
-+    {
-+      table->n_buckets_used--;
-+
-+      /* If the shrink threshold of the buckets in use has been reached,
-+	 rehash into a smaller table.  */
-+
-+      if (table->n_buckets_used
-+	  < table->tuning->shrink_threshold * table->n_buckets)
-+	{
-+	  /* Check more fully, before starting real work.  If tuning arguments
-+	     became invalid, the second check will rely on proper defaults.  */
-+	  check_tuning (table);
-+	  if (table->n_buckets_used
-+	      < table->tuning->shrink_threshold * table->n_buckets)
-+	    {
-+	      const Hash_tuning *tuning = table->tuning;
-+	      unsigned candidate
-+		= (unsigned) (tuning->is_n_buckets
-+			      ? table->n_buckets * tuning->shrink_factor
-+			      : (table->n_buckets * tuning->shrink_factor
-+				 * tuning->growth_threshold));
-+
-+	      hash_rehash (table, candidate);
-+	    }
-+	}
-+    }
-+
-+  return data;
-+}
-+
-+/* Testing.  */
-+
-+#if TESTING
-+
-+void
-+hash_print (const Hash_table *table)
-+{
-+  struct hash_entry *bucket;
-+
-+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
-+    {
-+      struct hash_entry *cursor;
-+
-+      if (bucket)
-+	printf ("%d:\n", bucket - table->bucket);
-+
-+      for (cursor = bucket; cursor; cursor = cursor->next)
-+	{
-+	  char *s = (char *) cursor->data;
-+	  /* FIXME */
-+	  if (s)
-+	    printf ("  %s\n", s);
-+	}
-+    }
-+}
-+
-+#endif /* TESTING */
---- patch-2.5.9.orig/hash.h
-+++ patch-2.5.9/hash.h
-@@ -0,0 +1,93 @@
-+/* hash - hashing table processing.
-+   Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
-+   Written by Jim Meyering <meyering@ascend.com>, 1998.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program; if not, write to the Free Software Foundation,
-+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-+
-+/* A generic hash table package.  */
-+
-+/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
-+   obstacks instead of malloc, and recompile `hash.c' with same setting.  */
-+
-+#ifndef HASH_H_
-+# define HASH_H_
-+
-+# ifndef PARAMS
-+#  if PROTOTYPES || __STDC__
-+#   define PARAMS(Args) Args
-+#  else
-+#   define PARAMS(Args) ()
-+#  endif
-+# endif
-+
-+typedef unsigned (*Hash_hasher) PARAMS ((const void *, unsigned));
-+typedef bool (*Hash_comparator) PARAMS ((const void *, const void *));
-+typedef void (*Hash_data_freer) PARAMS ((void *));
-+typedef bool (*Hash_processor) PARAMS ((void *, void *));
-+
-+struct hash_entry
-+  {
-+    void *data;
-+    struct hash_entry *next;
-+  };
-+
-+struct hash_tuning
-+  {
-+    /* This structure is mainly used for `hash_initialize', see the block
-+       documentation of `hash_reset_tuning' for more complete comments.  */
-+
-+    float shrink_threshold;	/* ratio of used buckets to trigger a shrink */
-+    float shrink_factor;	/* ratio of new smaller size to original size */
-+    float growth_threshold;	/* ratio of used buckets to trigger a growth */
-+    float growth_factor;	/* ratio of new bigger size to original size */
-+    bool is_n_buckets;		/* if CANDIDATE really means table size */
-+  };
-+
-+typedef struct hash_tuning Hash_tuning;
-+
-+struct hash_table;
-+
-+typedef struct hash_table Hash_table;
-+
-+/* Information and lookup.  */
-+unsigned hash_get_n_buckets PARAMS ((const Hash_table *));
-+unsigned hash_get_n_buckets_used PARAMS ((const Hash_table *));
-+unsigned hash_get_n_entries PARAMS ((const Hash_table *));
-+unsigned hash_get_max_bucket_length PARAMS ((const Hash_table *));
-+bool hash_table_ok PARAMS ((const Hash_table *));
-+void hash_print_statistics PARAMS ((const Hash_table *, FILE *));
-+void *hash_lookup PARAMS ((const Hash_table *, const void *));
-+
-+/* Walking.  */
-+void *hash_get_first PARAMS ((const Hash_table *));
-+void *hash_get_next PARAMS ((const Hash_table *, const void *));
-+unsigned hash_get_entries PARAMS ((const Hash_table *, void **, unsigned));
-+unsigned hash_do_for_each PARAMS ((const Hash_table *, Hash_processor, void *));
-+
-+/* Allocation and clean-up.  */
-+unsigned hash_string PARAMS ((const char *, unsigned));
-+void hash_reset_tuning PARAMS ((Hash_tuning *));
-+Hash_table *hash_initialize PARAMS ((unsigned, const Hash_tuning *,
-+				     Hash_hasher, Hash_comparator,
-+				     Hash_data_freer));
-+void hash_clear PARAMS ((Hash_table *));
-+void hash_free PARAMS ((Hash_table *));
-+
-+/* Insertion and deletion.  */
-+bool hash_rehash PARAMS ((Hash_table *, unsigned));
-+void *hash_insert PARAMS ((Hash_table *, const void *));
-+void *hash_delete PARAMS ((Hash_table *, const void *));
-+
-+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/global-reject-file.diff b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/global-reject-file.diff
deleted file mode 100644
index bb7ca79..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/global-reject-file.diff
+++ /dev/null
@@ -1,203 +0,0 @@
-Upstream-Status: Inappropriate [debian patch]
-
-Index: patch-2.5.9/patch.man
-===================================================================
---- patch-2.5.9.orig/patch.man
-+++ patch-2.5.9/patch.man
-@@ -520,6 +520,15 @@ file.
- \fB\*=reject\-unified\fP
- Produce unified reject files. The default is to produce context type reject files.
- .TP
-+.BI \*=global\-reject\-file= rejectfile
-+Put all rejects into
-+.I rejectfile
-+instead of creating separate reject files for all files that have rejects. The
-+.I rejectfile
-+will contain headers that identify which file each reject refers to. Note that
-+the global reject file is created even if \-\-dry\-run is specified (while
-+non-global reject files will only be created without \-\-dry\-run).
-+.TP
- \fB\-R\fP  or  \fB\*=reverse\fP
- Assume that this patch was created with the old and new files swapped.
- (Yes, I'm afraid that does happen occasionally, human nature being what it
-Index: patch-2.5.9/patch.c
-===================================================================
---- patch-2.5.9.orig/patch.c
-+++ patch-2.5.9/patch.c
-@@ -67,6 +67,7 @@ static bool similar (char const *, size_
- static bool spew_output (struct outstate *);
- static char const *make_temp (char);
- static int numeric_string (char const *, bool, char const *);
-+static void reject_header (const char *filename);
- static void abort_hunk (void);
- static void cleanup (void);
- static void get_some_switches (void);
-@@ -98,6 +99,7 @@ static int Argc;
- static char * const *Argv;
- 
- static FILE *rejfp;  /* reject file pointer */
-+static char *global_reject;
- 
- static char const *patchname;
- static char *rejname;
-@@ -172,6 +174,10 @@ main (int argc, char **argv)
-     /* Make sure we clean up in case of disaster.  */
-     set_signals (false);
- 
-+    /* initialize global reject file */
-+    if (global_reject)
-+      init_reject ();
-+
-     for (
- 	open_patch_file (patchname);
- 	there_is_another_patch();
-@@ -208,8 +214,9 @@ main (int argc, char **argv)
- 	    init_output (TMPOUTNAME, exclusive, &outstate);
- 	  }
- 
--	/* initialize reject file */
--	init_reject ();
-+	/* initialize per-patch reject file */
-+	if (!global_reject)
-+	  init_reject ();
- 
- 	/* find out where all the lines are */
- 	if (!skip_rest_of_patch)
-@@ -278,6 +285,8 @@ main (int argc, char **argv)
- 
- 	    newwhere = pch_newfirst() + last_offset;
- 	    if (skip_rest_of_patch) {
-+		if (!failed)
-+		  reject_header(outname);
- 		abort_hunk();
- 		failed++;
- 		if (verbosity == VERBOSE)
-@@ -292,6 +301,8 @@ main (int argc, char **argv)
- 		  say ("Patch attempted to create file %s, which already exists.\n",
- 		       quotearg (inname));
- 
-+		if (!failed)
-+		  reject_header(outname);
- 		abort_hunk();
- 		failed++;
- 		if (verbosity != SILENT)
-@@ -299,6 +310,8 @@ main (int argc, char **argv)
- 		       format_linenum (numbuf, newwhere));
- 	    }
- 	    else if (! apply_hunk (&outstate, where)) {
-+		if (!failed)
-+		  reject_header(outname);
- 		abort_hunk ();
- 		failed++;
- 		if (verbosity != SILENT)
-@@ -332,7 +345,8 @@ main (int argc, char **argv)
- 		    fclose (outstate.ofp);
- 		    outstate.ofp = 0;
- 		  }
--		fclose (rejfp);
-+		if (!global_reject)
-+		  fclose (rejfp);
- 		continue;
- 	      }
- 
-@@ -412,13 +426,13 @@ main (int argc, char **argv)
- 	    }
-       }
-       if (diff_type != ED_DIFF) {
--	if (fclose (rejfp) != 0)
-+	if (!global_reject && fclose (rejfp) != 0)
- 	    write_fatal ();
- 	if (failed) {
- 	    somefailed = true;
- 	    say ("%d out of %d hunk%s %s", failed, hunk, "s" + (hunk == 1),
- 		 skip_rest_of_patch ? "ignored" : "FAILED");
--	    if (outname) {
-+	    if (!global_reject && outname) {
- 		char *rej = rejname;
- 		if (!rejname) {
- 		    rej = xmalloc (strlen (outname) + 5);
-@@ -445,6 +459,20 @@ main (int argc, char **argv)
-       }
-       set_signals (true);
-     }
-+    if (global_reject)
-+      {
-+	if (fclose (rejfp) != 0)
-+	  write_fatal ();
-+	if (somefailed)
-+	  {
-+	  say (" -- saving rejects to file %s\n", quotearg (global_reject));
-+	  /*if (! dry_run)
-+	    {*/
-+	      move_file (TMPREJNAME, &TMPREJNAME_needs_removal,
-+			 global_reject, 0644, false);
-+	    /*}*/
-+	  }
-+      }
-     if (outstate.ofp && (ferror (outstate.ofp) || fclose (outstate.ofp) != 0))
-       write_fatal ();
-     cleanup ();
-@@ -523,6 +551,7 @@ static struct option const longopts[] =
-   {"posix", no_argument, NULL, CHAR_MAX + 7},
-   {"quoting-style", required_argument, NULL, CHAR_MAX + 8},
-   {"unified-reject-files", no_argument, NULL, CHAR_MAX + 9},
-+  {"global-reject-file", required_argument, NULL, CHAR_MAX + 10},
-   {NULL, no_argument, NULL, 0}
- };
- 
-@@ -582,6 +611,7 @@ static char const *const option_help[] =
- "  --dry-run  Do not actually change any files; just print what would happen.",
- "  --posix  Conform to the POSIX standard.",
- "  --unified-reject-files  Create unified reject files.",
-+"  --global-reject-file=file  Put all rejects into one file.",
- "",
- "  -d DIR  --directory=DIR  Change the working directory to DIR first.",
- #if HAVE_SETMODE_DOS
-@@ -784,6 +814,9 @@ get_some_switches (void)
- 	    case CHAR_MAX + 9:
- 		unified_reject_files = true;
- 		break;
-+	    case CHAR_MAX + 10:
-+		global_reject = savestr (optarg);
-+		break;
- 	    default:
- 		usage (stderr, 2);
- 	}
-@@ -933,6 +966,37 @@ locate_hunk (LINENUM fuzz)
- }
- 
- static char *
-+format_timestamp (char timebuf[37], bool which)
-+{
-+  time_t ts = pch_timestamp(which);
-+  if (ts != -1)
-+    {
-+      struct tm *tm = localtime(&ts);
-+      strftime(timebuf, 37, "\t%Y-%m-%d %H:%M:%S.000000000 %z", tm);
-+    }
-+  else
-+    timebuf[0] = 0;
-+  return timebuf;
-+}
-+
-+/* Write a header in a reject file that combines multiple hunks. */
-+static void
-+reject_header (const char *outname)
-+{
-+    char timebuf0[37], timebuf1[37];
-+    if (!global_reject)
-+      return;
-+    if (diff_type == UNI_DIFF)
-+	fprintf(rejfp, "--- %s.orig%s\n+++ %s%s\n",
-+		outname, format_timestamp(timebuf0, reverse),
-+		outname, format_timestamp(timebuf1, !reverse));
-+    else
-+	fprintf(rejfp, "*** %s.orig%s\n--- %s%s\n",
-+		outname, format_timestamp(timebuf0, reverse),
-+		outname, format_timestamp(timebuf1, !reverse));
-+}
-+
-+static char *
- format_linerange (char rangebuf[LINENUM_LENGTH_BOUND*2 + 2],
- 		  LINENUM first, LINENUM lines)
- {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/install.patch b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/install.patch
deleted file mode 100644
index 0354ec8..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/install.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Upstream-Status: Inappropriate [embedded specific]
-
-Index: patch-2.5.4/Makefile.in
-===================================================================
---- patch-2.5.4.orig/Makefile.in	2005-03-09 07:23:54.779311824 -0500
-+++ patch-2.5.4/Makefile.in	2005-03-09 07:26:09.616813408 -0500
-@@ -43,10 +43,11 @@
- PACKAGE_NAME = @PACKAGE_NAME@
- PACKAGE_VERSION = @PACKAGE_VERSION@
- 
-+DESTDIR =
- prefix = @prefix@
- exec_prefix = @exec_prefix@
- 
--bindir = $(exec_prefix)/bin
-+bindir = @bindir@
- 
- # Where to put the manual pages.
- mandir = @mandir@
-@@ -112,18 +113,18 @@
- 	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
- 
- install:: all installdirs
--	$(INSTALL_PROGRAM) patch$(EXEEXT) $(bindir)/$(patch_name)$(EXEEXT)
--	-$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)
-+	$(INSTALL_PROGRAM) patch$(EXEEXT) $(DESTDIR)$(bindir)/$(patch_name)$(EXEEXT)
-+	-$(INSTALL_DATA) $(srcdir)/patch.man $(DESTDIR)$(man1dir)/$(patch_name)$(man1ext)
- 
- installdirs::
--	$(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)
-+	$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
- 
- install-strip::
- 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
- 
- uninstall::
--	rm -f $(bindir)/$(patch_name)$(EXEEXT)
--	rm -f $(man1dir)/$(patch_name)$(man1ext)
-+	rm -f $(DESTDIR)$(bindir)/$(patch_name)$(EXEEXT)
-+	rm -f $(DESTDIR)$(man1dir)/$(patch_name)$(man1ext)
- 
- Makefile: Makefile.in $(CONFIG_STATUS)
- 	$(SHELL) $(CONFIG_STATUS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/unified-reject-files.diff b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/unified-reject-files.diff
deleted file mode 100644
index 4b59212..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/unified-reject-files.diff
+++ /dev/null
@@ -1,307 +0,0 @@
-Upstream-Status: Inappropriate [debian patch]
-
-Generate unified diff style reject files. Also include the C function names
-in reject files whenever possible.
-
-	$ cat > f.orig
-	< a() {
-	< 2
-	< 3
-	<
-	< 5
-	< 6
-	< }
-
-	$ sed -e 's/5/5a/' f.orig > f
-	$ diff -U2 -p f.orig f > f.diff
-	$ sed -e 's/5/5a/' -e 's/6/6x/' f.orig > f
-	$ ./patch -F0 -s --no-backup-if-mismatch f --reject-unified < f.diff
-	> 1 out of 1 hunk FAILED -- saving rejects to file f.rej
-
-	$ cat f.rej
-	> @@ -3,5 +3,5 @@ a() {
-	>  3
-	>  
-	> -5
-	> +5a
-	>  6
-	>  }
-
-	$ ./patch -F0 -s --no-backup-if-mismatch f < f.diff
-	> 1 out of 1 hunk FAILED -- saving rejects to file f.rej
-
-	$ cat f.rej
-	> *************** a() {
-	> *** 3,7 ****
-	>   3
-	>   
-	> - 5
-	>   6
-	>   }
-	> --- 3,7 ----
-	>   3
-	>   
-	> + 5a
-	>   6
-	>   }
-
-	$ diff -Nu -p /dev/null f.orig > f2.diff
-	$ ./patch -F0 -s --no-backup-if-mismatch f --reject-unified < f2.diff
-	> Patch attempted to create file f, which already exists.
-	> 1 out of 1 hunk FAILED -- saving rejects to file f.rej
-
-	$ cat f.rej
-	> @@ -0,0 +1,7 @@
-	> +a() {
-	> +2
-	> +3
-	> +
-	> +5
-	> +6
-	> +}
-
-	$ rm -f f f.orig f.rej f.diff f2.diff
-
-Index: patch-2.5.9/pch.c
-===================================================================
---- patch-2.5.9.orig/pch.c
-+++ patch-2.5.9/pch.c
-@@ -68,6 +68,7 @@ static LINENUM p_sline;			/* and the lin
- static LINENUM p_hunk_beg;		/* line number of current hunk */
- static LINENUM p_efake = -1;		/* end of faked up lines--don't free */
- static LINENUM p_bfake = -1;		/* beg of faked up lines */
-+static char *p_c_function;		/* the C function a hunk is in */
- 
- enum nametype { OLD, NEW, INDEX, NONE };
- 
-@@ -888,6 +889,19 @@ another_hunk (enum diff difftype, bool r
- 	    next_intuit_at(line_beginning,p_input_line);
- 	    return chars_read == (size_t) -1 ? -1 : 0;
- 	}
-+	s = buf;
-+	while (*s == '*')
-+	    s++;
-+	if (*s == ' ')
-+	  {
-+	    p_c_function = s;
-+	    while (*s != '\n')
-+		s++;
-+	    *s = '\0';
-+	    p_c_function = savestr (p_c_function);
-+	  }
-+	else
-+	    p_c_function = NULL;
- 	p_hunk_beg = p_input_line + 1;
- 	while (p_end < p_max) {
- 	    chars_read = get_line ();
-@@ -1277,8 +1291,18 @@ another_hunk (enum diff difftype, bool r
- 	else
- 	    p_repl_lines = 1;
- 	if (*s == ' ') s++;
--	if (*s != '@')
-+	if (*s++ != '@')
- 	    malformed ();
-+	if (*s++ == '@' && *s == ' ' && *s != '\0')
-+	  {
-+	    p_c_function = s;
-+	    while (*s != '\n')
-+		s++;
-+	    *s = '\0';
-+	    p_c_function = savestr (p_c_function);
-+	  }
-+	else
-+	    p_c_function = NULL;
- 	if (!p_ptrn_lines)
- 	    p_first++;			/* do append rather than insert */
- 	if (!p_repl_lines)
-@@ -1884,6 +1908,12 @@ pch_hunk_beg (void)
-     return p_hunk_beg;
- }
- 
-+char const *
-+pch_c_function (void)
-+{
-+    return p_c_function;
-+}
-+
- /* Is the newline-terminated line a valid `ed' command for patch
-    input?  If so, return the command character; if not, return 0.
-    This accepts accepts just a subset of the valid commands, but it's
-Index: patch-2.5.9/pch.h
-===================================================================
---- patch-2.5.9.orig/pch.h
-+++ patch-2.5.9/pch.h
-@@ -25,6 +25,7 @@
- LINENUM pch_end (void);
- LINENUM pch_first (void);
- LINENUM pch_hunk_beg (void);
-+char const *pch_c_function (void);
- LINENUM pch_newfirst (void);
- LINENUM pch_prefix_context (void);
- LINENUM pch_ptrn_lines (void);
-Index: patch-2.5.9/patch.man
-===================================================================
---- patch-2.5.9.orig/patch.man
-+++ patch-2.5.9/patch.man
-@@ -517,6 +517,9 @@ instead of the default
- .B \&.rej
- file.
- .TP
-+\fB\*=reject\-unified\fP
-+Produce unified reject files. The default is to produce context type reject files.
-+.TP
- \fB\-R\fP  or  \fB\*=reverse\fP
- Assume that this patch was created with the old and new files swapped.
- (Yes, I'm afraid that does happen occasionally, human nature being what it
-Index: patch-2.5.9/common.h
-===================================================================
---- patch-2.5.9.orig/common.h
-+++ patch-2.5.9/common.h
-@@ -146,6 +146,7 @@ XTERN int invc;
- XTERN struct stat instat;
- XTERN bool dry_run;
- XTERN bool posixly_correct;
-+XTERN bool unified_reject_files;
- 
- XTERN char const *origprae;
- XTERN char const *origbase;
-Index: patch-2.5.9/patch.c
-===================================================================
---- patch-2.5.9.orig/patch.c
-+++ patch-2.5.9/patch.c
-@@ -522,6 +522,7 @@ static struct option const longopts[] =
-   {"no-backup-if-mismatch", no_argument, NULL, CHAR_MAX + 6},
-   {"posix", no_argument, NULL, CHAR_MAX + 7},
-   {"quoting-style", required_argument, NULL, CHAR_MAX + 8},
-+  {"unified-reject-files", no_argument, NULL, CHAR_MAX + 9},
-   {NULL, no_argument, NULL, 0}
- };
- 
-@@ -580,6 +581,7 @@ static char const *const option_help[] =
- "  --verbose  Output extra information about the work being done.",
- "  --dry-run  Do not actually change any files; just print what would happen.",
- "  --posix  Conform to the POSIX standard.",
-+"  --unified-reject-files  Create unified reject files.",
- "",
- "  -d DIR  --directory=DIR  Change the working directory to DIR first.",
- #if HAVE_SETMODE_DOS
-@@ -779,6 +781,9 @@ get_some_switches (void)
- 				     (enum quoting_style) i);
- 		}
- 		break;
-+	    case CHAR_MAX + 9:
-+		unified_reject_files = true;
-+		break;
- 	    default:
- 		usage (stderr, 2);
- 	}
-@@ -927,6 +932,24 @@ locate_hunk (LINENUM fuzz)
-     return 0;
- }
- 
-+static char *
-+format_linerange (char rangebuf[LINENUM_LENGTH_BOUND*2 + 2],
-+		  LINENUM first, LINENUM lines)
-+{
-+    if (lines == 1)
-+      rangebuf = format_linenum (rangebuf, first);
-+    else
-+      {
-+	char *rb;
-+	rangebuf = format_linenum (rangebuf + LINENUM_LENGTH_BOUND + 1, lines);
-+	rb = rangebuf-1;
-+	rangebuf = format_linenum (rangebuf - LINENUM_LENGTH_BOUND - 1,
-+				   (lines > 0) ? first : 0);
-+	*rb = ',';
-+      }
-+    return rangebuf;
-+}
-+
- /* We did not find the pattern, dump out the hunk so they can handle it. */
- 
- static void
-@@ -943,8 +966,83 @@ abort_hunk (void)
-       (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ****" : "";
-     char const *minuses =
-       (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ----" : " -----";
-+    char const *function = pch_c_function();
-+    if (function == NULL)
-+	function = "";
-+
-+    if (unified_reject_files)
-+      {
-+	/* produce unified reject files */
-+	char rangebuf0[LINENUM_LENGTH_BOUND*2 + 2];
-+	char rangebuf1[LINENUM_LENGTH_BOUND*2 + 2];
-+	LINENUM j;
-+
-+	/* Find the beginning of the remove and insert section. */
-+	for (j = 0; j <= pat_end; j++)
-+	  if (pch_char (j) == '=')
-+	    break;
-+	for (i = j+1; i <= pat_end; i++)
-+	  if (pch_char (i) == '^')
-+	    break;
-+	if (pch_char (0) != '*' || j > pat_end || i > pat_end+1)
-+	  fatal ("internal error in abort_hunk");
-+	i = 1; j++;
-+
-+	/* @@ -from,lines +to,lines @@ */
-+	fprintf (rejfp, "@@ -%s +%s @@%s\n",
-+		 format_linerange (rangebuf0, oldfirst, pch_ptrn_lines()),
-+		 format_linerange (rangebuf1, newfirst, pch_repl_lines()),
-+		 function);
-+
-+	while (   (i <= pat_end && pch_char (i) != '=')
-+	       || (j <= pat_end && pch_char (j) != '^'))
-+	  {
-+	    if (i <= pat_end
-+		&& (pch_char (i) == '-' || pch_char (i) == '!'))
-+	      {
-+		fputc('-', rejfp);
-+		pch_write_line (i++, rejfp);
-+	      }
-+	    else if (j <= pat_end
-+		     && (pch_char (j) == '+' || pch_char (j) == '!'))
-+	      {
-+		fputc('+', rejfp);
-+		pch_write_line (j++, rejfp);
-+	      }
-+	    else if ((i <= pat_end
-+		      && (pch_char (i) == ' ' || pch_char (i) == '\n')) &&
-+		     (j > pat_end
-+		      || (pch_char (j) == ' ' || pch_char (j) == '\n')))
-+	      {
-+		/* Unless j is already past the end, lines i and j
-+		   must be equal here.  */
-+
-+		if (pch_char (i) == ' ')
-+		  fputc(' ', rejfp);
-+		pch_write_line (i++, rejfp);
-+		if (j <= pat_end)
-+		  j++;
-+	      }
-+	    else if ((j <= pat_end &&
-+		     (pch_char (j) == ' ' || pch_char (j) == '\n')) &&
-+		     (pch_char (i) == '='))
-+	      {
-+		if (pch_char (j) == ' ')
-+		  fputc(' ', rejfp);
-+		pch_write_line (j++, rejfp);
-+	      }
-+	    else
-+	      fatal ("internal error in abort_hunk");
-+	  }
-+
-+	if (ferror (rejfp))
-+	  write_fatal ();
-+	return;
-+      }
- 
--    fprintf(rejfp, "***************\n");
-+    /* produce context type reject files */
-+   
-+    fprintf(rejfp, "***************%s\n", function);
-     for (i=0; i<=pat_end; i++) {
- 	char numbuf0[LINENUM_LENGTH_BOUND + 1];
- 	char numbuf1[LINENUM_LENGTH_BOUND + 1];
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.5.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.5.9.bb
deleted file mode 100644
index c29b240..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.5.9.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-require patch.inc
-LICENSE = "GPLv2"
-
-SRC_URI += " file://debian.patch \
-	   file://install.patch \
-           file://unified-reject-files.diff \
-           file://global-reject-file.diff "
-PR = "r3"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-SRC_URI[md5sum] = "dacfb618082f8d3a2194601193cf8716"
-SRC_URI[sha256sum] = "ecb5c6469d732bcf01d6ec1afe9e64f1668caba5bfdb103c28d7f537ba3cdb8a"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.7.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.7.5.bb
index f3fcf5e..151f021 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.7.5.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.7.5.bb
@@ -10,6 +10,6 @@
 
 acpaths = "-I ${S}/m4 "
 
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'xattr', d)}"
 PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/avoidholes.patch b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/avoidholes.patch
new file mode 100644
index 0000000..a273688
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/avoidholes.patch
@@ -0,0 +1,163 @@
+Different types of binaries create challenges for patchelf. In order to extend 
+sections they need to be moved within the binary. The current approach to 
+handling ET_DYN binaries is to move the INTERP section to the end of the file.
+This means changing PT_PHDR to add an extra PT_LOAD section so that the new section
+is mmaped into memory by the elf loader in the kernel. In order to extend PHDR,
+this means moving it to the end of the file.
+
+Its documented in patchelf there is a kernel 'bug' which means that if you have holes
+in memory between the base load address and the PT_LOAD segment that contains PHDR,
+it will pass an incorrect PHDR address to ld.so and fail to load the binary, segfaulting.
+
+To avoid this, the code currently inserts space into the binary to ensure that when 
+loaded into memory there are no holes between the PT_LOAD sections. This inflates the 
+binaries by many MBs in some cases. Whilst we could make them sparse, there is a second
+issue which is that strip can fail to process these binaries:
+
+$ strip fixincl
+Not enough room for program headers, try linking with -N
+[.note.ABI-tag]: Bad value
+
+This turns out to be due to libbfd not liking the relocated PHDR section either 
+(https://github.com/NixOS/patchelf/issues/10).
+
+Instead this patch implements a different approach, leaving PHDR where it is but extending
+it in place to allow addition of a new PT_LOAD section. This overwrites sections in the 
+binary but those get moved to the end of the file in the new PT_LOAD section.
+
+This is based on patches linked from the above github issue, however whilst the idea
+was good, the implementation wasn't correct and they've been rewritten here.
+
+RP
+2017/3/7
+
+Upstream-Status: Pending
+
+Index: patchelf-0.9/src/patchelf.cc
+===================================================================
+--- patchelf-0.9.orig/src/patchelf.cc
++++ patchelf-0.9/src/patchelf.cc
+@@ -146,6 +146,8 @@ private:
+     string & replaceSection(const SectionName & sectionName,
+         unsigned int size);
+ 
++    bool haveReplacedSection(const SectionName & sectionName);
++
+     void writeReplacedSections(Elf_Off & curOff,
+         Elf_Addr startAddr, Elf_Off startOffset);
+ 
+@@ -497,6 +499,16 @@ unsigned int ElfFile<ElfFileParamNames>:
+     return 0;
+ }
+ 
++template<ElfFileParams>
++bool ElfFile<ElfFileParamNames>::haveReplacedSection(const SectionName & sectionName)
++{
++    ReplacedSections::iterator i = replacedSections.find(sectionName);
++
++    if (i != replacedSections.end())
++        return true;
++    return false;
++}
++
+ 
+ template<ElfFileParams>
+ string & ElfFile<ElfFileParamNames>::replaceSection(const SectionName & sectionName,
+@@ -595,52 +607,52 @@ void ElfFile<ElfFileParamNames>::rewrite
+ 
+     debug("last page is 0x%llx\n", (unsigned long long) startPage);
+ 
++    /* Because we're adding a new section header, we're necessarily increasing
++       the size of the program header table.  This can cause the first section
++       to overlap the program header table in memory; we need to shift the first
++       few segments to someplace else. */
++    /* Some sections may already be replaced so account for that */
++    unsigned int i = 1;
++    Elf_Addr pht_size = sizeof(Elf_Ehdr) + (phdrs.size() + 1)*sizeof(Elf_Phdr);
++    while( shdrs[i].sh_addr <= pht_size && i < rdi(hdr->e_shnum) ) {
++        if (not haveReplacedSection(getSectionName(shdrs[i])))
++            replaceSection(getSectionName(shdrs[i]), shdrs[i].sh_size);
++        i++;
++    }
+ 
+-    /* Compute the total space needed for the replaced sections and
+-       the program headers. */
+-    off_t neededSpace = (phdrs.size() + 1) * sizeof(Elf_Phdr);
++    /* Compute the total space needed for the replaced sections */
++    off_t neededSpace = 0;
+     for (ReplacedSections::iterator i = replacedSections.begin();
+          i != replacedSections.end(); ++i)
+         neededSpace += roundUp(i->second.size(), sectionAlignment);
+     debug("needed space is %d\n", neededSpace);
+ 
+-
+     size_t startOffset = roundUp(fileSize, getPageSize());
+ 
+     growFile(startOffset + neededSpace);
+ 
+-
+     /* Even though this file is of type ET_DYN, it could actually be
+        an executable.  For instance, Gold produces executables marked
+-       ET_DYN.  In that case we can still hit the kernel bug that
+-       necessitated rewriteSectionsExecutable().  However, such
+-       executables also tend to start at virtual address 0, so
++       ET_DYN as does LD when linking with pie. If we move PT_PHDR, it
++       has to stay in the first PT_LOAD segment or any subsequent ones
++       if they're continuous in memory due to linux kernel constraints
++       (see BUGS). Since the end of the file would be after bss, we can't 
++       move PHDR there, we therefore choose to leave PT_PHDR where it is but
++       move enough following sections such that we can add the extra PT_LOAD
++       section to it. This PT_LOAD segment ensures the sections at the end of
++       the file are mapped into memory for ld.so to process.
++       We can't use the approach in rewriteSectionsExecutable()
++       since DYN executables tend to start at virtual address 0, so
+        rewriteSectionsExecutable() won't work because it doesn't have
+-       any virtual address space to grow downwards into.  As a
+-       workaround, make sure that the virtual address of our new
+-       PT_LOAD segment relative to the first PT_LOAD segment is equal
+-       to its offset; otherwise we hit the kernel bug.  This may
+-       require creating a hole in the executable.  The bigger the size
+-       of the uninitialised data segment, the bigger the hole. */
++       any virtual address space to grow downwards into. */
+     if (isExecutable) {
+         if (startOffset >= startPage) {
+             debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage);
+-        } else {
+-            size_t hole = startPage - startOffset;
+-            /* Print a warning, because the hole could be very big. */
+-            fprintf(stderr, "warning: working around a Linux kernel bug by creating a hole of %zu bytes in ‘%s’\n", hole, fileName.c_str());
+-            assert(hole % getPageSize() == 0);
+-            /* !!! We could create an actual hole in the file here,
+-               but it's probably not worth the effort. */
+-            growFile(fileSize + hole);
+-            startOffset += hole;
+         }
+         startPage = startOffset;
+     }
+ 
+-
+-    /* Add a segment that maps the replaced sections and program
+-       headers into memory. */
++    /* Add a segment that maps the replaced sections into memory. */
+     phdrs.resize(rdi(hdr->e_phnum) + 1);
+     wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1);
+     Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1];
+@@ -653,15 +665,12 @@ void ElfFile<ElfFileParamNames>::rewrite
+ 
+ 
+     /* Write out the replaced sections. */
+-    Elf_Off curOff = startOffset + phdrs.size() * sizeof(Elf_Phdr);
++    Elf_Off curOff = startOffset;
+     writeReplacedSections(curOff, startPage, startOffset);
+     assert(curOff == startOffset + neededSpace);
+ 
+-
+-    /* Move the program header to the start of the new area. */
+-    wri(hdr->e_phoff, startOffset);
+-
+-    rewriteHeaders(startPage);
++    /* Write out the updated program and section headers */
++    rewriteHeaders(hdr->e_phoff);
+ }
+ 
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.9.bb
index 54e654b..01f0e62 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.9.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.9.bb
@@ -2,6 +2,7 @@
            file://Skip-empty-section-fixes-66.patch \
            file://handle-read-only-files.patch \
            file://Increase-maxSize-to-64MB.patch \
+           file://avoidholes.patch \
 "
 
 LICENSE = "GPLv3"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.6.bb
deleted file mode 100644
index 5cc5463..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.6.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-SUMMARY = "Security-focused ELF files checking tool"
-DESCRIPTION = "This is a small set of various PaX aware and related \
-utilities for ELF binaries. It can check ELF binary files and running \
-processes for issues that might be relevant when using ELF binaries \
-along with PaX, such as non-PIC code or executable stack and heap."
-HOMEPAGE = "http://www.gentoo.org/proj/en/hardened/pax-utils.xml"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
-
-SRC_URI = "http://gentoo.osuosl.org/distfiles/pax-utils-${PV}.tar.xz \
-"
-
-SRC_URI[md5sum] = "96f56a5a10ed50f2448c5ccebd27764f"
-SRC_URI[sha256sum] = "f5436c517bea40f7035ec29a6f34034c739b943f2e3a080d76df5dfd7fd41b12"
-
-RDEPENDS_${PN} += "bash"
-
-do_configure_prepend() {
-    touch ${S}/NEWS ${S}/AUTHORS ${S}/ChangeLog ${S}/README
-}
-
-do_install() {
-    oe_runmake PREFIX=${D}${prefix} DESTDIR=${D} install
-}
-
-BBCLASSEXTEND = "native"
-
-inherit autotools pkgconfig
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
-"
-PACKAGECONFIG[libcap] = "--with-caps, --without-caps, libcap"
-PACKAGECONFIG[libseccomp] = "--with-seccomp, --without-seccomp, libseccomp"
-PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
-PACKAGECONFIG[pyelftools] = "--with-python, --without-python,, pyelftools"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.2.2.bb
new file mode 100644
index 0000000..476fa6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.2.2.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Security-focused ELF files checking tool"
+DESCRIPTION = "This is a small set of various PaX aware and related \
+utilities for ELF binaries. It can check ELF binary files and running \
+processes for issues that might be relevant when using ELF binaries \
+along with PaX, such as non-PIC code or executable stack and heap."
+HOMEPAGE = "http://www.gentoo.org/proj/en/hardened/pax-utils.xml"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+
+SRC_URI = "http://gentoo.osuosl.org/distfiles/pax-utils-${PV}.tar.xz \
+"
+
+SRC_URI[md5sum] = "a580468318f0ff42edf4a8cd314cc942"
+SRC_URI[sha256sum] = "7f4a7f8db6b4743adde7582fa48992ad01776796fcde030683732f56221337d9"
+
+RDEPENDS_${PN} += "bash"
+
+export GNULIB_OVERRIDES_WINT_T = "0"
+
+do_configure_prepend() {
+    touch ${S}/NEWS ${S}/AUTHORS ${S}/ChangeLog ${S}/README
+}
+
+do_install() {
+    oe_runmake PREFIX=${D}${prefix} DESTDIR=${D} install
+}
+
+BBCLASSEXTEND = "native"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= ""
+
+PACKAGECONFIG[libcap] = "--with-caps, --without-caps, libcap"
+PACKAGECONFIG[libseccomp] = "--with-seccomp, --without-seccomp, libseccomp"
+PACKAGECONFIG[pyelftools] = "--with-python, --without-python,, pyelftools"
+
+EXTRA_OECONF += "--enable-largefile"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.60.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.60.bb
deleted file mode 100644
index 8809a44..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.60.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-SUMMARY = "Perl module to manipulate and access URI strings"
-DESCRIPTION = "This package contains the URI.pm module with friends. \
-The module implements the URI class. URI objects can be used to access \
-and manipulate the various components that make up these strings."
-
-SECTION = "libs"
-LICENSE = "Artistic-1.0 | GPL-1.0+"
-
-LIC_FILES_CHKSUM = "file://README;beginline=26;endline=30;md5=6c33ae5c87fd1c4897714e122dd9c23d"
-
-DEPENDS += "perl"
-
-SRC_URI = "http://www.cpan.org/authors/id/G/GA/GAAS/URI-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "70f739be8ce28b8baba7c5920ffee4dc"
-SRC_URI[sha256sum] = "1f92d3dc64acb8845e9917c945e22b9a5275aeb9ff924eb7873c3b7a5c0d2377"
-
-S = "${WORKDIR}/URI-${PV}"
-
-EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR}"
-
-inherit cpan
-
-do_compile() {
-	export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
-	cpan_do_compile
-}
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.71.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.71.bb
new file mode 100644
index 0000000..432803c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.71.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Perl module to manipulate and access URI strings"
+DESCRIPTION = "This package contains the URI.pm module with friends. \
+The module implements the URI class. URI objects can be used to access \
+and manipulate the various components that make up these strings."
+
+HOMEPAGE = "http://search.cpan.org/dist/URI/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c453e94fae672800f83bc1bd7a38b53f"
+
+DEPENDS += "perl"
+
+SRC_URI = "https://downloads.yoctoproject.org/mirror/sources/URI-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "247c3da29a794f72730e01aa5a715daf"
+SRC_URI[sha256sum] = "9c8eca0d7f39e74bbc14706293e653b699238eeb1a7690cc9c136fb8c2644115"
+
+S = "${WORKDIR}/URI-${PV}"
+
+EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR}"
+
+inherit cpan
+
+do_compile() {
+	export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+	cpan_do_compile
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
index 3acd826..d9bbf71 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
@@ -20,6 +20,8 @@
 do_configure_append() {
 	sed 's:--sysroot=.*\(\s\|$\):--sysroot=${STAGING_DIR_TARGET} :g' -i Makefile Expat/Makefile
 	sed 's:^FULL_AR = .*:FULL_AR = ${AR}:g' -i Expat/Makefile
+	# make sure these two do not build in parallel
+	sed 's!^$(INST_DYNAMIC):!$(INST_DYNAMIC): $(BOOTSTRAP)!' -i Expat/Makefile
 }
 
 do_compile() {
@@ -31,4 +33,4 @@
 	cpan_do_compile
 }
 
-BBCLASSEXTEND="native"
+BBCLASSEXTEND="native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.22.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.22.1.bb
deleted file mode 100644
index 1c21522..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.22.1.bb
+++ /dev/null
@@ -1,128 +0,0 @@
-require perl.inc
-
-EXTRA_OEMAKE = "-e MAKEFLAGS="
-
-SRC_URI += "\
-           file://Configure-multilib.patch \
-           file://perl-configpm-switch.patch \
-           file://native-nopacklist.patch \
-           file://native-perlinc.patch \
-           file://MM_Unix.pm.patch \
-           file://debian/errno_ver.diff \
-           file://dynaloaderhack.patch \
-           file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
-           file://perl-remove-nm-from-libswanted.patch \
-          "
-
-SRC_URI[md5sum] = "6671e4829cbaf9cecafa9a84f141b0a3"
-SRC_URI[sha256sum] = "9e87317d693ce828095204be0d09af8d60b8785533fadea1a82b6f0e071e5c79"
-
-inherit native
-
-NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
-
-export LD="${CCLD}"
-
-do_configure () {
-	./Configure \
-		-Dcc="${CC}" \
-		-Dcflags="${CFLAGS}" \
-		-Dldflags="${LDFLAGS}" \
-		-Dcf_by="Open Embedded" \
-		-Dprefix=${prefix} \
-		-Dvendorprefix=${prefix} \
-		-Dsiteprefix=${prefix} \
-		\
-		-Dbin=${STAGING_BINDIR}/${PN} \
-		-Dprivlib=${STAGING_LIBDIR}/perl/${PV} \
-		-Darchlib=${STAGING_LIBDIR}/perl/${PV} \
-		-Dvendorlib=${STAGING_LIBDIR}/perl/vendor_perl/${PV} \
-		-Dvendorarch=${STAGING_LIBDIR}/perl/vendor_perl/${PV} \
-		-Dsitelib=${STAGING_LIBDIR}/perl/site_perl/${PV} \
-		-Dsitearch=${STAGING_LIBDIR}/perl/site_perl/${PV} \
-		\
-		-Duseshrplib \
-		-Dusethreads \
-		-Duseithreads \
-		-Duselargefiles \
-		-Dnoextensions=ODBM_File \
-		-Ud_dosuid \
-		-Ui_db \
-		-Ui_ndbm \
-		-Ui_gdbm \
-		-Ui_gdbm_ndbm \
-		-Ui_gdbmndbm \
-		-Di_shadow \
-		-Di_syslog \
-		-Duseperlio \
-		-Dman3ext=3pm \
-		-Dsed=/bin/sed \
-		-Uafs \
-		-Ud_csh \
-		-Uusesfio \
-		-Uusenm -des
-}
-
-do_install () {
-	oe_runmake 'DESTDIR=${D}' install
-
-	# We need a hostperl link for building perl
-	ln -sf perl${PV} ${D}${bindir}/hostperl
-
-        ln -sf perl ${D}${libdir}/perl5
-
-	install -d ${D}${libdir}/perl/${PV}/CORE \
-	           ${D}${datadir}/perl/${PV}/ExtUtils
-
-	# Save native config 
-	install config.sh ${D}${libdir}/perl
-	install lib/Config.pm ${D}${libdir}/perl/${PV}/
-	install lib/ExtUtils/typemap ${D}${libdir}/perl/${PV}/ExtUtils/
-
-	# perl shared library headers
-	# reference perl 5.20.0-1 in debian:
-	# https://packages.debian.org/experimental/i386/perl/filelist
-	for i in av.h bitcount.h charclass_invlists.h config.h cop.h cv.h dosish.h \
-		embed.h embedvar.h EXTERN.h fakesdio.h feature.h form.h git_version.h \
-		gv.h handy.h hv_func.h hv.h inline.h INTERN.h intrpvar.h iperlsys.h \
-		keywords.h l1_char_class_tab.h malloc_ctl.h metaconfig.h mg_data.h \
-		mg.h mg_raw.h mg_vtable.h mydtrace.h nostdio.h opcode.h op.h \
-		opnames.h op_reg_common.h overload.h pad.h parser.h patchlevel.h \
-		perlapi.h perl.h perlio.h perliol.h perlsdio.h perlvars.h perly.h \
-		pp.h pp_proto.h proto.h reentr.h regcharclass.h regcomp.h regexp.h \
-		regnodes.h scope.h sv.h thread.h time64_config.h time64.h uconfig.h \
-		unicode_constants.h unixish.h utf8.h utfebcdic.h util.h uudmap.h \
-		vutil.h warnings.h XSUB.h
-	do
-		install $i ${D}${libdir}/perl/${PV}/CORE
-	done
-
-	# Those wrappers mean that perl installed from sstate (which may change
-	# path location) works and that in the nativesdk case, the SDK can be
-	# installed to a different location from the one it was built for.
-	create_wrapper ${D}${bindir}/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/site_perl/${PV}:${STAGING_LIBDIR}/perl/vendor_perl/${PV}:${STAGING_LIBDIR}/perl/${PV}'
-	create_wrapper ${D}${bindir}/perl${PV} PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/site_perl/${PV}:${STAGING_LIBDIR}/perl/vendor_perl/${PV}:${STAGING_LIBDIR}/perl/${PV}'
-
-	# Use /usr/bin/env nativeperl for the perl script.
-	for f in `grep -Il '#! *${bindir}/perl' ${D}/${bindir}/*`; do
-		sed -i -e 's|${bindir}/perl|/usr/bin/env nativeperl|' $f
-	done
-}
-
-SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper"
-
-perl_sysroot_create_wrapper () {
-	mkdir -p ${SYSROOT_DESTDIR}${bindir}
-	# Create a wrapper that /usr/bin/env perl will use to get perl-native.
-	# This MUST live in the normal bindir.
-	cat > ${SYSROOT_DESTDIR}${bindir}/../nativeperl << EOF
-#!/bin/sh
-realpath=\`readlink -fn \$0\`
-exec \`dirname \$realpath\`/perl-native/perl "\$@"
-EOF
-	chmod 0755 ${SYSROOT_DESTDIR}${bindir}/../nativeperl
-	cat ${SYSROOT_DESTDIR}${bindir}/../nativeperl
-}
-
-# Fix the path in sstate
-SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.24.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.24.1.bb
new file mode 100644
index 0000000..e01d11f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.24.1.bb
@@ -0,0 +1,136 @@
+require perl.inc
+
+# We need gnugrep (for -I)
+DEPENDS = "virtual/db-native grep-native"
+DEPENDS += "gdbm-native zlib-native"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+SRC_URI += "\
+           file://Configure-multilib.patch \
+           file://perl-configpm-switch.patch \
+           file://native-nopacklist.patch \
+           file://native-perlinc.patch \
+           file://MM_Unix.pm.patch \
+           file://debian/errno_ver.diff \
+           file://dynaloaderhack.patch \
+           file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
+           file://0001-Configure-Remove-fstack-protector-strong-for-native-.patch \
+          "
+
+SRC_URI[md5sum] = "af6a84c7c3e2b8b269c105a5db2f6d53"
+SRC_URI[sha256sum] = "03a77bac4505c270f1890ece75afc7d4b555090b41aa41ea478747e23b2afb3f"
+
+inherit native
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+export LD="${CCLD}"
+
+do_configure () {
+	./Configure \
+		-Dcc="${CC}" \
+		-Dcflags="${CFLAGS}" \
+		-Dldflags="${LDFLAGS}" \
+		-Dcf_by="Open Embedded" \
+		-Dprefix=${prefix} \
+		-Dvendorprefix=${prefix} \
+		-Dsiteprefix=${prefix} \
+		\
+		-Dbin=${STAGING_BINDIR}/${PN} \
+		-Dprivlib=${STAGING_LIBDIR}/perl/${PV} \
+		-Darchlib=${STAGING_LIBDIR}/perl/${PV} \
+		-Dvendorlib=${STAGING_LIBDIR}/perl/vendor_perl/${PV} \
+		-Dvendorarch=${STAGING_LIBDIR}/perl/vendor_perl/${PV} \
+		-Dsitelib=${STAGING_LIBDIR}/perl/site_perl/${PV} \
+		-Dsitearch=${STAGING_LIBDIR}/perl/site_perl/${PV} \
+		\
+		-Duseshrplib \
+		-Dusethreads \
+		-Duseithreads \
+		-Duselargefiles \
+		-Dnoextensions=ODBM_File \
+		-Ud_dosuid \
+		-Ui_db \
+		-Ui_ndbm \
+		-Ui_gdbm \
+		-Ui_gdbm_ndbm \
+		-Ui_gdbmndbm \
+		-Di_shadow \
+		-Di_syslog \
+		-Duseperlio \
+		-Dman3ext=3pm \
+		-Dsed=/bin/sed \
+		-Uafs \
+		-Ud_csh \
+		-Uusesfio \
+		-Uusenm -des
+}
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install
+
+	# We need a hostperl link for building perl
+	ln -sf perl${PV} ${D}${bindir}/hostperl
+
+        ln -sf perl ${D}${libdir}/perl5
+
+	install -d ${D}${libdir}/perl/${PV}/CORE \
+	           ${D}${datadir}/perl/${PV}/ExtUtils
+
+	# Save native config 
+	install config.sh ${D}${libdir}/perl
+	install lib/Config.pm ${D}${libdir}/perl/${PV}/
+	install lib/ExtUtils/typemap ${D}${libdir}/perl/${PV}/ExtUtils/
+
+	# perl shared library headers
+	# reference perl 5.20.0-1 in debian:
+	# https://packages.debian.org/experimental/i386/perl/filelist
+	for i in av.h bitcount.h charclass_invlists.h config.h cop.h cv.h dosish.h \
+		embed.h embedvar.h EXTERN.h fakesdio.h feature.h form.h git_version.h \
+		gv.h handy.h hv_func.h hv.h inline.h INTERN.h intrpvar.h iperlsys.h \
+		keywords.h l1_char_class_tab.h malloc_ctl.h metaconfig.h mg_data.h \
+		mg.h mg_raw.h mg_vtable.h mydtrace.h nostdio.h opcode.h op.h \
+		opnames.h op_reg_common.h overload.h pad.h parser.h patchlevel.h \
+		perlapi.h perl.h perlio.h perliol.h perlsdio.h perlvars.h perly.h \
+		pp.h pp_proto.h proto.h reentr.h regcharclass.h regcomp.h regexp.h \
+		regnodes.h scope.h sv.h thread.h time64_config.h time64.h uconfig.h \
+		unicode_constants.h unixish.h utf8.h utfebcdic.h util.h uudmap.h \
+		vutil.h warnings.h XSUB.h
+	do
+		install $i ${D}${libdir}/perl/${PV}/CORE
+	done
+
+	# Those wrappers mean that perl installed from sstate (which may change
+	# path location) works and that in the nativesdk case, the SDK can be
+	# installed to a different location from the one it was built for.
+	create_wrapper ${D}${bindir}/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/site_perl/${PV}:${STAGING_LIBDIR}/perl/vendor_perl/${PV}:${STAGING_LIBDIR}/perl/${PV}'
+	create_wrapper ${D}${bindir}/perl${PV} PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/site_perl/${PV}:${STAGING_LIBDIR}/perl/vendor_perl/${PV}:${STAGING_LIBDIR}/perl/${PV}'
+
+	# Use /usr/bin/env nativeperl for the perl script.
+	for f in `grep -Il '#! *${bindir}/perl' ${D}/${bindir}/*`; do
+		sed -i -e 's|${bindir}/perl|/usr/bin/env nativeperl|' $f
+	done
+
+	# The packlist is large with hardcoded paths meaning it needs relocating
+	# so just remove it.
+	rm ${D}${libdir}/perl/${PV}/.packlist
+}
+
+SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper"
+
+perl_sysroot_create_wrapper () {
+	mkdir -p ${SYSROOT_DESTDIR}${bindir}
+	# Create a wrapper that /usr/bin/env perl will use to get perl-native.
+	# This MUST live in the normal bindir.
+	cat > ${SYSROOT_DESTDIR}${bindir}/../nativeperl << EOF
+#!/bin/sh
+realpath=\`readlink -fn \$0\`
+exec \`dirname \$realpath\`/perl-native/perl "\$@"
+EOF
+	chmod 0755 ${SYSROOT_DESTDIR}${bindir}/../nativeperl
+	cat ${SYSROOT_DESTDIR}${bindir}/../nativeperl
+}
+
+# Fix the path in sstate
+SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc
index d136c5c..1f549af 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc
@@ -20,10 +20,13 @@
 	       -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
 	       -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
 	       -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
-	    ${D}${PTEST_PATH}/lib/Config.pm
+	    ${D}${PTEST_PATH}/lib/Config.pm \
+	    ${D}${PTEST_PATH}/cpan/podlators/scripts/pod2man \
+	    ${D}${PTEST_PATH}/cpan/podlators/scripts/pod2text
 
 	ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/perl
-
+	# Remove plan9 related stuff
+	rm -rf ${D}${PTEST_PATH}/plan9 ${D}${PTEST_PATH}/README.plan9 ${D}${PTEST_PATH}/pod/perlplan9.pod
 }
 
 python populate_packages_prepend() {
@@ -36,3 +39,7 @@
 }
 
 RDEPENDS_${PN}-ptest += "${PN}-modules ${PN}-doc ${PN}-misc sed libssp"
+
+# The perl-ptest package contains Perl internal modules and generating file
+# dependencies for it causes problems.
+SKIP_FILEDEPS_${PN}-ptest = '1'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.22.1.inc b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.22.1.inc
deleted file mode 100644
index 2c497fe..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.22.1.inc
+++ /dev/null
@@ -1,2563 +0,0 @@
-# To create/update the perl-rdepends_${PV}.inc use this piece of ugly script (modified for your arch/paths etc):
-
-#jiahongxu:5.20.0-r1$ pwd
-#/home/jiahongxu/yocto/build-20140618-perl/tmp/work/i586-poky-linux/perl/5.20.0-r1
-
-#1 cp -r packages-split packages-split.new && cd packages-split.new
-#2 find . -name \*.pm | xargs sed -i '/^=head/,/^=cut/d'
-#3 egrep -r "^\s*(\<use .*|\<require .*);?" perl-module-* --include="*.pm" 
-#| sed "s/\/.*\.pm: */ += /g;s/[\"\']//g;s/;.*/\"/g;s/+= .*\(require\|use\)\> */+= \"perl-module-/g;s/CPANPLUS::.*/cpanplus/g;s/CPAN::.*/cpan/g;s/::/-/g;s/ [^+\"].*//g;s/_/-/g;s/\.pl\"$/\"/;s/\"\?\$/\"/;s/(//;" | tr [:upper:] [:lower:] 
-#| awk '{if ($3 != "\x22"$1"\x22"){ print $0}}'
-#| grep -v -e "\-vms\-" -e module-5 -e "^$" -e "\\$" -e your -e tk -e autoperl -e html -e http -e parse-cpan -e perl-ostype -e ndbm-file -e module-mac -e fcgi -e lwp -e dbd -e dbix 
-#| sort -u 
-#| sed 's/^/RDEPENDS_/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;' 
-#| egrep -wv '=>|module-a|module-apache.?|module-apr|module-authen-sasl|module-b-asmdata|module-convert-ebcdic|module-devel-size|module-digest-perl-md5|module-dumpvalue|module-extutils-constant-aaargh56hash|module-extutils-xssymset|module-file-bsdglob|module-for|module-it|module-io-string|module-ipc-system-simple|module-lexical|module-local-lib|metadata|module-modperl-util|module-pluggable-object|module-test-builder-io-scalar|module-text-unidecode|module-win32|objects\sload|syscall.ph|systeminfo.ph|%s' > /tmp/perl-rdepends
-
-RDEPENDS_perl-misc += "perl perl-modules"
-RDEPENDS_${PN}-pod += "perl"
-
-# Some additional dependencies that the above doesn't manage to figure out
-RDEPENDS_${PN}-module-file-spec += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
-RDEPENDS_${PN}-module-thread-queue += "${PN}-module-attributes"
-RDEPENDS_${PN}-module-overload += "${PN}-module-overloading"
-
-
-# Depends list
-# copy contents of /tmp/perl-rdepends in this file
-RDEPENDS_${PN}-module-anydbm-file += "${PN}-module-strict"
-RDEPENDS_${PN}-module-anydbm-file += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-carp"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-config"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-constant"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-cpan"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-data-dumper"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-spec-functions"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-getopt-std"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-if"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-net-ping"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-strict"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-user-pwent"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-vars"
-RDEPENDS_${PN}-module-app-cpan += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-app-prove-state"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-base"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-carp"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-constant"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-getopt-long"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-strict"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-tap-harness"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-tap-harness-env"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-app-prove += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-app-prove-state-result"
-RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-base"
-RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-carp"
-RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-constant"
-RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-strict"
-RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-tap-parser-yamlish-reader"
-RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-tap-parser-yamlish-writer"
-RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-app-prove-state-result-test"
-RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-carp"
-RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-constant"
-RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-strict"
-RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-app-prove-state-result-test += "${PN}-module-strict"
-RDEPENDS_${PN}-module-app-prove-state-result-test += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-constant"
-RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-io-compress-bzip2"
-RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-time-local"
-RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-archive-tar"
-RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-archive-tar-constant"
-RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-carp"
-RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-io-file"
-RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-strict"
-RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-vars"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-archive-tar-constant"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-archive-tar-file"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-carp"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-config"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-io-file"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-io-zlib"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-strict"
-RDEPENDS_${PN}-module-archive-tar += "${PN}-module-vars"
-RDEPENDS_${PN}-module-arybase += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-carp"
-RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-strict"
-RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-vars"
-RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-attributes += "${PN}-module-carp"
-RDEPENDS_${PN}-module-attributes += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-attributes += "${PN}-module-strict"
-RDEPENDS_${PN}-module-attributes += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-attributes += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-carp"
-RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-constant"
-RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-fatal"
-RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-overload"
-RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-strict"
-RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-carp"
-RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-parent"
-RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-strict"
-RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-b"
-RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-carp"
-RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-constant"
-RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-strict"
-RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-autodie += "${PN}-module-carp"
-RDEPENDS_${PN}-module-autodie += "${PN}-module-constant"
-RDEPENDS_${PN}-module-autodie += "${PN}-module-lib"
-RDEPENDS_${PN}-module-autodie += "${PN}-module-parent"
-RDEPENDS_${PN}-module-autodie += "${PN}-module-strict"
-RDEPENDS_${PN}-module-autodie += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-autodie-scope-guard += "${PN}-module-strict"
-RDEPENDS_${PN}-module-autodie-scope-guard += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-autodie-scope-guard"
-RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-strict"
-RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-autodie-scope-guardstack"
-RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-strict"
-RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-autodie-skip += "${PN}-module-strict"
-RDEPENDS_${PN}-module-autodie-skip += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-autoloader += "${PN}-module-carp"
-RDEPENDS_${PN}-module-autoloader += "${PN}-module-strict"
-RDEPENDS_${PN}-module-autosplit += "${PN}-module-carp"
-RDEPENDS_${PN}-module-autosplit += "${PN}-module-config"
-RDEPENDS_${PN}-module-autosplit += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-spec-functions"
-RDEPENDS_${PN}-module-autosplit += "${PN}-module-strict"
-RDEPENDS_${PN}-module-autouse += "${PN}-module-carp"
-RDEPENDS_${PN}-module-base += "${PN}-module-carp"
-RDEPENDS_${PN}-module-base += "${PN}-module-strict"
-RDEPENDS_${PN}-module-base += "${PN}-module-vars"
-RDEPENDS_${PN}-module-b-concise += "${PN}-module-b"
-RDEPENDS_${PN}-module-b-concise += "${PN}-module-b-op-private"
-RDEPENDS_${PN}-module-b-concise += "${PN}-module-config"
-RDEPENDS_${PN}-module-b-concise += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-b-concise += "${PN}-module-strict"
-RDEPENDS_${PN}-module-b-concise += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-b-debug += "${PN}-module-b"
-RDEPENDS_${PN}-module-b-debug += "${PN}-module-config"
-RDEPENDS_${PN}-module-b-debug += "${PN}-module-strict"
-RDEPENDS_${PN}-module-b-deparse += "${PN}-module-b"
-RDEPENDS_${PN}-module-b-deparse += "${PN}-module-carp"
-RDEPENDS_${PN}-module-b-deparse += "${PN}-module-data-dumper"
-RDEPENDS_${PN}-module-b-deparse += "${PN}-module-feature"
-RDEPENDS_${PN}-module-b-deparse += "${PN}-module-overloading"
-RDEPENDS_${PN}-module-b-deparse += "${PN}-module-re"
-RDEPENDS_${PN}-module-b-deparse += "${PN}-module-strict"
-RDEPENDS_${PN}-module-b-deparse += "${PN}-module-vars"
-RDEPENDS_${PN}-module-b-deparse += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-benchmark += "${PN}-module-carp"
-RDEPENDS_${PN}-module-benchmark += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-benchmark += "${PN}-module-strict"
-RDEPENDS_${PN}-module-bigint += "${PN}-module-carp"
-RDEPENDS_${PN}-module-bigint += "${PN}-module-constant"
-RDEPENDS_${PN}-module-bigint += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-bigint += "${PN}-module-math-bigint"
-RDEPENDS_${PN}-module-bigint += "${PN}-module-math-bigint-trace"
-RDEPENDS_${PN}-module-bigint += "${PN}-module-overload"
-RDEPENDS_${PN}-module-bigint += "${PN}-module-strict"
-RDEPENDS_${PN}-module-bigint += "${PN}-module-vars"
-RDEPENDS_${PN}-module-bignum += "${PN}-module-bigint"
-RDEPENDS_${PN}-module-bignum += "${PN}-module-carp"
-RDEPENDS_${PN}-module-bignum += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigfloat"
-RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigfloat-trace"
-RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigint"
-RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigint-trace"
-RDEPENDS_${PN}-module-bignum += "${PN}-module-overload"
-RDEPENDS_${PN}-module-bignum += "${PN}-module-strict"
-RDEPENDS_${PN}-module-bignum += "${PN}-module-vars"
-RDEPENDS_${PN}-module-bigrat += "${PN}-module-bigint"
-RDEPENDS_${PN}-module-bigrat += "${PN}-module-carp"
-RDEPENDS_${PN}-module-bigrat += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigfloat"
-RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigint"
-RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigint-trace"
-RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigrat"
-RDEPENDS_${PN}-module-bigrat += "${PN}-module-overload"
-RDEPENDS_${PN}-module-bigrat += "${PN}-module-strict"
-RDEPENDS_${PN}-module-bigrat += "${PN}-module-vars"
-RDEPENDS_${PN}-module-blib += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-blib += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-blib += "${PN}-module-vars"
-RDEPENDS_${PN}-module-b += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-b += "${PN}-module-strict"
-RDEPENDS_${PN}-module-b += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b"
-RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b-concise"
-RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b-terse"
-RDEPENDS_${PN}-module-b-showlex += "${PN}-module-strict"
-RDEPENDS_${PN}-module-b-terse += "${PN}-module-b"
-RDEPENDS_${PN}-module-b-terse += "${PN}-module-b-concise"
-RDEPENDS_${PN}-module-b-terse += "${PN}-module-carp"
-RDEPENDS_${PN}-module-b-terse += "${PN}-module-strict"
-RDEPENDS_${PN}-module-b-xref += "${PN}-module-b"
-RDEPENDS_${PN}-module-b-xref += "${PN}-module-config"
-RDEPENDS_${PN}-module-b-xref += "${PN}-module-strict"
-RDEPENDS_${PN}-module-bytes += "${PN}-module-bytes-heavy"
-RDEPENDS_${PN}-module-bytes += "${PN}-module-carp"
-RDEPENDS_${PN}-module-carp-heavy += "${PN}-module-carp"
-RDEPENDS_${PN}-module-carp += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-carp += "${PN}-module-strict"
-RDEPENDS_${PN}-module-carp += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-charnames += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-charnames += "${PN}-module-carp"
-RDEPENDS_${PN}-module-charnames += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-charnames += "${PN}-module-re"
-RDEPENDS_${PN}-module-charnames += "${PN}-module-strict"
-RDEPENDS_${PN}-module-charnames += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-class-struct += "${PN}-module-carp"
-RDEPENDS_${PN}-module-class-struct += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-class-struct += "${PN}-module-strict"
-RDEPENDS_${PN}-module-class-struct += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-bytes "
-RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-carp "
-RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-constant"
-RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-strict "
-RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-warnings "
-RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-bytes "
-RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-carp "
-RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-constant"
-RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-strict "
-RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-warnings "
-RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-bytes "
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-carp "
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-compress-raw-zlib"
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-constant"
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-gzip"
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-gzip-constants"
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-handle "
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-uncompress-gunzip"
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-strict "
-RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-warnings "
-RDEPENDS_${PN}-module-config-extensions += "${PN}-module-config"
-RDEPENDS_${PN}-module-config-extensions += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-config-extensions += "${PN}-module-strict"
-RDEPENDS_${PN}-module-config-extensions += "${PN}-module-vars"
-RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-config"
-RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-strict"
-RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-vars"
-RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-constant += "${PN}-module-carp"
-RDEPENDS_${PN}-module-constant += "${PN}-module-strict"
-RDEPENDS_${PN}-module-constant += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-corelist += "${PN}-module-list-util"
-RDEPENDS_${PN}-module-corelist += "${PN}-module-strict"
-RDEPENDS_${PN}-module-corelist += "${PN}-module-vars"
-RDEPENDS_${PN}-module-corelist += "${PN}-module-version"
-RDEPENDS_${PN}-module-corelist += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-b"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-carp"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-config"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-data-dumper"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-dirhandle"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-extutils-manifest"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-file-copy"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-filehandle"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-lib"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-net-ping"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-overload"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-posix"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-safe"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-strict"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-sys-hostname"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-term-readline"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-text-wrap"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-time-local"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-vars"
-RDEPENDS_${PN}-module-cpan += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-cwd += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-cwd += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-cwd += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-cwd += "${PN}-module-strict"
-RDEPENDS_${PN}-module-cwd += "${PN}-module-vars"
-RDEPENDS_${PN}-module-cwd += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-data-dumper += "${PN}-module-b-deparse"
-RDEPENDS_${PN}-module-data-dumper += "${PN}-module-carp"
-RDEPENDS_${PN}-module-data-dumper += "${PN}-module-config"
-RDEPENDS_${PN}-module-data-dumper += "${PN}-module-constant"
-RDEPENDS_${PN}-module-data-dumper += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-data-dumper += "${PN}-module-overload"
-RDEPENDS_${PN}-module-data-dumper += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-data-dumper += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-carp"
-RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-strict"
-RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-carp"
-RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-strict"
-RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-dbm-filter-int32 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-dbm-filter-int32 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-dbm-filter-null += "${PN}-module-strict"
-RDEPENDS_${PN}-module-dbm-filter-null += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-carp"
-RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-strict"
-RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-carp"
-RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-db += "${PN}-module-strict"
-RDEPENDS_${PN}-module-deprecate += "${PN}-module-carp"
-RDEPENDS_${PN}-module-deprecate += "${PN}-module-strict"
-RDEPENDS_${PN}-module-deprecate += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-devel-peek += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-devel-peek += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-getopt-long"
-RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-strict"
-RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-vars"
-RDEPENDS_${PN}-module-devel-selfstubber += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-devel-selfstubber += "${PN}-module-selfloader"
-RDEPENDS_${PN}-module-diagnostics += "${PN}-module-carp"
-RDEPENDS_${PN}-module-diagnostics += "${PN}-module-config"
-RDEPENDS_${PN}-module-diagnostics += "${PN}-module-getopt-std"
-RDEPENDS_${PN}-module-diagnostics += "${PN}-module-strict"
-RDEPENDS_${PN}-module-diagnostics += "${PN}-module-text-tabs"
-RDEPENDS_${PN}-module-digest-base += "${PN}-module-carp"
-RDEPENDS_${PN}-module-digest-base += "${PN}-module-mime-base64"
-RDEPENDS_${PN}-module-digest-base += "${PN}-module-strict"
-RDEPENDS_${PN}-module-digest-base += "${PN}-module-vars"
-RDEPENDS_${PN}-module-digest-file += "${PN}-module-carp"
-RDEPENDS_${PN}-module-digest-file += "${PN}-module-digest"
-RDEPENDS_${PN}-module-digest-file += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-digest-file += "${PN}-module-strict"
-RDEPENDS_${PN}-module-digest-file += "${PN}-module-vars"
-RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-digest-base"
-RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-vars"
-RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-digest += "${PN}-module-strict"
-RDEPENDS_${PN}-module-digest += "${PN}-module-vars"
-RDEPENDS_${PN}-module-digest-sha += "${PN}-module-carp"
-RDEPENDS_${PN}-module-digest-sha += "${PN}-module-digest-base"
-RDEPENDS_${PN}-module-digest-sha += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-digest-sha += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-digest-sha += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-digest-sha += "${PN}-module-integer"
-RDEPENDS_${PN}-module-digest-sha += "${PN}-module-strict"
-RDEPENDS_${PN}-module-digest-sha += "${PN}-module-vars"
-RDEPENDS_${PN}-module-digest-sha += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-dirhandle += "${PN}-module-carp"
-RDEPENDS_${PN}-module-dirhandle += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-dynaloader += "${PN}-module-carp"
-RDEPENDS_${PN}-module-dynaloader += "${PN}-module-config"
-RDEPENDS_${PN}-module-encode-alias += "${PN}-module-constant"
-RDEPENDS_${PN}-module-encode-alias += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-alias += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-encode-alias += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-alias += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-byte += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-byte += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-byte += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-byte += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-carp"
-RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-parent"
-RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-vars"
-RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-cn += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-cn += "${PN}-module-encode-cn-hz"
-RDEPENDS_${PN}-module-encode-cn += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-cn += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-cn += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-encode-config += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-config += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-carp"
-RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-constant"
-RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-overload"
-RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-carp"
-RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-encode-mime-name"
-RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-carp"
-RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-parent"
-RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-vars"
-RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-guess += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-encode-guess += "${PN}-module-carp"
-RDEPENDS_${PN}-module-encode-guess += "${PN}-module-constant"
-RDEPENDS_${PN}-module-encode-guess += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-guess += "${PN}-module-encode-unicode"
-RDEPENDS_${PN}-module-encode-guess += "${PN}-module-parent"
-RDEPENDS_${PN}-module-encode-guess += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-guess += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-encode-cjkconstants"
-RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-vars"
-RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode-cjkconstants"
-RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode-jp-h2z"
-RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-parent"
-RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-jp += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-jp += "${PN}-module-encode-jp-jis7"
-RDEPENDS_${PN}-module-encode-jp += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-jp += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-jp += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-encode-cjkconstants"
-RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-parent"
-RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-kr += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-kr += "${PN}-module-encode-kr-2022-kr"
-RDEPENDS_${PN}-module-encode-kr += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-kr += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-kr += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-constant"
-RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-encode-cjkconstants"
-RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-parent"
-RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-carp"
-RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-constant"
-RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-mime-base64"
-RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-parent"
-RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-mime-name += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-mime-name += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-encode += "${PN}-module-carp"
-RDEPENDS_${PN}-module-encode += "${PN}-module-constant"
-RDEPENDS_${PN}-module-encode += "${PN}-module-encode-alias"
-RDEPENDS_${PN}-module-encode += "${PN}-module-encode-config"
-RDEPENDS_${PN}-module-encode += "${PN}-module-encode-configlocal-pm"
-RDEPENDS_${PN}-module-encode += "${PN}-module-encode-encoding"
-RDEPENDS_${PN}-module-encode += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-encode += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-encode-tw += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-tw += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-tw += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-tw += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-parent"
-RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-mime-base64"
-RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-parent"
-RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-re"
-RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encoding += "${PN}-module-carp"
-RDEPENDS_${PN}-module-encoding += "${PN}-module-config"
-RDEPENDS_${PN}-module-encoding += "${PN}-module-constant"
-RDEPENDS_${PN}-module-encoding += "${PN}-module-encode"
-RDEPENDS_${PN}-module-encoding += "${PN}-module-filter-util-call"
-RDEPENDS_${PN}-module-encoding += "${PN}-module-i18n-langinfo"
-RDEPENDS_${PN}-module-encoding += "${PN}-module-strict"
-RDEPENDS_${PN}-module-encoding += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-encoding += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-encoding-warnings += "${PN}-module-carp"
-RDEPENDS_${PN}-module-encoding-warnings += "${PN}-module-strict"
-RDEPENDS_${PN}-module-english += "${PN}-module-carp "
-RDEPENDS_${PN}-module-english += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-env += "${PN}-module-config"
-RDEPENDS_${PN}-module-env += "${PN}-module-tie-array"
-RDEPENDS_${PN}-module-errno += "${PN}-module-carp"
-RDEPENDS_${PN}-module-errno += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-errno += "${PN}-module-strict"
-RDEPENDS_${PN}-module-experimental += "${PN}-module-carp"
-RDEPENDS_${PN}-module-experimental += "${PN}-module-feature"
-RDEPENDS_${PN}-module-experimental += "${PN}-module-strict"
-RDEPENDS_${PN}-module-experimental += "${PN}-module-version"
-RDEPENDS_${PN}-module-experimental += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-carp"
-RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-strict"
-RDEPENDS_${PN}-module-exporter += "${PN}-module-exporter-heavy"
-RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-extutils-mksymlists"
-RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-temp"
-RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-ipc-cmd"
-RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-extutils-cbuilder-platform-unix"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-extutils-cbuilder-platform-unix"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-extutils-cbuilder-platform-unix"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-extutils-cbuilder-platform-unix"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-extutils-cbuilder-platform-unix"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-extutils-cbuilder-platform-unix"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-extutils-cbuilder-base"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-extutils-cbuilder-base"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-file-spec-functions"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-extutils-cbuilder-base"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-io-file"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-extutils-command"
-RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-extutils-install"
-RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-getopt-long"
-RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-test-harness"
-RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-command += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-command += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-copy"
-RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-command += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-command += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-constant"
-RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-extutils-constant-utils"
-RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-text-wrap"
-RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-proxysubs"
-RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-utils"
-RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-xs"
-RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-filehandle"
-RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-extutils-constant-utils"
-RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-extutils-constant-xs"
-RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-constant"
-RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-posix"
-RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-data-dumper"
-RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant"
-RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant-base"
-RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant-utils"
-RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-extutils-liblist"
-RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-getopt-std"
-RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-data-dumper"
-RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-extutils-packlist"
-RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-autosplit"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-extutils-packlist"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-compare"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-copy"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-install += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-extutils-liblist-kid"
-RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-makemaker-config += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-makemaker-config += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-base"
-RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-encode"
-RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-encode-alias"
-RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-i18n-langinfo"
-RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-b"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-makemaker-version"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-manifest"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-mm"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-my"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-version"
-RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-extutils-makemaker-version-regex"
-RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-makemaker-version-regex += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-makemaker-version-regex += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-b"
-RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-constant"
-RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-extutils-makemaker-version-regex"
-RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-locale"
-RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-overload"
-RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-universal"
-RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-copy"
-RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-extutils-embed"
-RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-autosplit"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-cpan"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-data-dumper"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-version"
-RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-mm-any"
-RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-mm-win32"
-RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-darwin += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-darwin += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-extutils-mm-any"
-RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-macos += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-mm-win32"
-RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-mm-any"
-RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-liblist"
-RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-qnx += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-qnx += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-dirhandle"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-encode"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-liblist"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-mm-any"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-version"
-RDEPENDS_${PN}-module-extutils-mm-uwin += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-uwin += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-liblist-kid"
-RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-mm-any"
-RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-vos += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-vos += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-mm-any"
-RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-mm-unix"
-RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-extutils-makemaker-config"
-RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-extutils-mm-win32"
-RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-my += "${PN}-module-extutils-mm"
-RDEPENDS_${PN}-module-extutils-my += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-carp"
-RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-vars"
-RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-parsexs-countlines += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-parsexs-eval += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-parsexs-eval += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-config"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-constants"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-countlines"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-eval"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-utilities"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-re"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-extutils-parsexs-constants"
-RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-extutils-typemaps"
-RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-lib"
-RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-extutils-typemaps"
-RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-typemaps-inputmap += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-typemaps-inputmap += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-re"
-RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-parsexs"
-RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-parsexs-constants"
-RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-inputmap"
-RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-outputmap"
-RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-type"
-RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-extutils-typemaps"
-RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-strict"
-RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-exception-system"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-hints"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-scopeutil"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-carp"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-config"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-constant"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-posix"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-strict"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-tie-refhash"
-RDEPENDS_${PN}-module-fatal += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-fcntl += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-fcntl += "${PN}-module-strict"
-RDEPENDS_${PN}-module-fcntl += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-feature += "${PN}-module-carp"
-RDEPENDS_${PN}-module-fields += "${PN}-module-base"
-RDEPENDS_${PN}-module-fields += "${PN}-module-carp"
-RDEPENDS_${PN}-module-fields += "${PN}-module-hash-util"
-RDEPENDS_${PN}-module-fields += "${PN}-module-strict"
-RDEPENDS_${PN}-module-fields += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-basename += "${PN}-module-carp"
-RDEPENDS_${PN}-module-file-basename += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-file-basename += "${PN}-module-re"
-RDEPENDS_${PN}-module-file-basename += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-basename += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-filecache += "${PN}-module-carp"
-RDEPENDS_${PN}-module-filecache += "${PN}-module-parent"
-RDEPENDS_${PN}-module-filecache += "${PN}-module-strict"
-RDEPENDS_${PN}-module-filecache += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-compare += "${PN}-module-carp"
-RDEPENDS_${PN}-module-file-compare += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-file-compare += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-compare += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-file-copy += "${PN}-module-carp"
-RDEPENDS_${PN}-module-file-copy += "${PN}-module-config"
-RDEPENDS_${PN}-module-file-copy += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-file-copy += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-file-copy += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-file-copy += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-copy += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-carp"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-constant"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-copy"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-filehandle"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-temp"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-ipc-cmd"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-locale-maketext-simple"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-load"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-params-check"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-fetch += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-find += "${PN}-module-config"
-RDEPENDS_${PN}-module-file-find += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-file-find += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-file-find += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-file-find += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-file-find += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-find += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-file-find += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-carp"
-RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-file-glob"
-RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-file-glob += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-file-glob += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-glob += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-filehandle += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-filehandle += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-filehandle += "${PN}-module-io-file"
-RDEPENDS_${PN}-module-filehandle += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-path += "${PN}-module-carp"
-RDEPENDS_${PN}-module-file-path += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-file-path += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-file-path += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-file-path += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-file-path += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-path += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-spec += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-spec += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-constant"
-RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-cwd "
-RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-file-spec-unix"
-RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-carp"
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-constant"
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-overload "
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-vars"
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-file-stat += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-carp"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-constant"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-errno"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-io-seekable"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-overload"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-parent"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-posix"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-strict"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-file-temp += "${PN}-module-vars"
-RDEPENDS_${PN}-module-filter-simple += "${PN}-module-carp"
-RDEPENDS_${PN}-module-filter-simple += "${PN}-module-filter-util-call"
-RDEPENDS_${PN}-module-filter-simple += "${PN}-module-text-balanced"
-RDEPENDS_${PN}-module-filter-simple += "${PN}-module-vars"
-RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-carp "
-RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-strict"
-RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-vars"
-RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-findbin += "${PN}-module-carp"
-RDEPENDS_${PN}-module-findbin += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-findbin += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-findbin += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-findbin += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-getopt-long += "${PN}-module-constant"
-RDEPENDS_${PN}-module-getopt-long += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-getopt-long += "${PN}-module-overload"
-RDEPENDS_${PN}-module-getopt-long += "${PN}-module-pod-usage"
-RDEPENDS_${PN}-module-getopt-long += "${PN}-module-strict"
-RDEPENDS_${PN}-module-getopt-long += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-getopt-long += "${PN}-module-vars"
-RDEPENDS_${PN}-module-getopt-std += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-strict"
-RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-hash-util += "${PN}-module-carp"
-RDEPENDS_${PN}-module-hash-util += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-hash-util += "${PN}-module-hash-util-fieldhash"
-RDEPENDS_${PN}-module-hash-util += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-hash-util += "${PN}-module-strict"
-RDEPENDS_${PN}-module-hash-util += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-hash-util += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-hash-util += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-overload"
-RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-posix"
-RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-strict"
-RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-carp"
-RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-strict"
-RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-i18n-langtags"
-RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-strict"
-RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-vars"
-RDEPENDS_${PN}-module-i18n-langtags-list += "${PN}-module-strict"
-RDEPENDS_${PN}-module-i18n-langtags-list += "${PN}-module-vars"
-RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-strict"
-RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-vars"
-RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-compress-raw-bzip2"
-RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-compress-raw-zlib"
-RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-constant"
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-encode"
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-file-globmapper"
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-file"
-RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-handle "
-RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-adapter-bzip2"
-RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-base"
-RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-adapter-deflate"
-RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-rawdeflate"
-RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-zlib-constants"
-RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-constant"
-RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-adapter-deflate"
-RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-gzip-constants"
-RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-rawdeflate"
-RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-zlib-extra"
-RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-compress-raw-zlib"
-RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-adapter-deflate"
-RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-base"
-RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-constant"
-RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-compress-raw-zlib"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-config"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-adapter-deflate"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-adapter-identity"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-bzip2 "
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-rawdeflate"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-zip-constants"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-zlib-extra"
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-constant"
-RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-io-compress-gzip-constants"
-RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-dir += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-dir += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-dir += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-io-dir += "${PN}-module-file-stat"
-RDEPENDS_${PN}-module-io-dir += "${PN}-module-io-file"
-RDEPENDS_${PN}-module-io-dir += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-dir += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-io-dir += "${PN}-module-tie-hash"
-RDEPENDS_${PN}-module-io-file += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-file += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-file += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-io-file += "${PN}-module-io-seekable"
-RDEPENDS_${PN}-module-io-file += "${PN}-module-selectsaver"
-RDEPENDS_${PN}-module-io-file += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-file += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-io-handle += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-handle += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-handle += "${PN}-module-io"
-RDEPENDS_${PN}-module-io-handle += "${PN}-module-io-file"
-RDEPENDS_${PN}-module-io-handle += "${PN}-module-selectsaver"
-RDEPENDS_${PN}-module-io-handle += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-handle += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-io += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-io-pipe += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-pipe += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-io-pipe += "${PN}-module-io-handle"
-RDEPENDS_${PN}-module-io-pipe += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-pipe += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-io-poll += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-poll += "${PN}-module-io-handle"
-RDEPENDS_${PN}-module-io-poll += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-seekable += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-seekable += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-seekable += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-io-seekable += "${PN}-module-io-handle"
-RDEPENDS_${PN}-module-io-seekable += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-select += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-select += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-select += "${PN}-module-vars"
-RDEPENDS_${PN}-module-io-select += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-errno"
-RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-io-socket"
-RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-socket"
-RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-base"
-RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-constant"
-RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-errno"
-RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-posix"
-RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-socket"
-RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-socket += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-socket += "${PN}-module-errno"
-RDEPENDS_${PN}-module-io-socket += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-handle"
-RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-select"
-RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-socket-inet"
-RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-socket-unix"
-RDEPENDS_${PN}-module-io-socket += "${PN}-module-socket"
-RDEPENDS_${PN}-module-io-socket += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-io-socket"
-RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-compress-raw-bzip2"
-RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-compress-raw-zlib"
-RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-io-compress-zip-constants "
-RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-compress-raw-zlib"
-RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-adapter-inflate"
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-base"
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-gunzip"
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-inflate"
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-rawinflate"
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-unzip"
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-io-uncompress-base"
-RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-carp "
-RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-constant"
-RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-io-file "
-RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-list-util"
-RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-uncompress-adapter-bunzip2"
-RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-uncompress-base"
-RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-compress-raw-zlib"
-RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-gzip-constants"
-RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-zlib-extra"
-RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-uncompress-rawinflate"
-RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-compress-zlib-constants"
-RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-uncompress-rawinflate"
-RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-compress-raw-zlib"
-RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-uncompress-adapter-inflate"
-RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-uncompress-base"
-RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-compress-raw-zlib"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-constant"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-exporter "
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-base-common"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-zip-constants"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-zlib-extra"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-file"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-adapter-identity"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-adapter-inflate"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-rawinflate"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-posix"
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-strict "
-RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-io-zlib += "${PN}-module-carp"
-RDEPENDS_${PN}-module-io-zlib += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-io-zlib += "${PN}-module-io-handle"
-RDEPENDS_${PN}-module-io-zlib += "${PN}-module-strict"
-RDEPENDS_${PN}-module-io-zlib += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-io-zlib += "${PN}-module-tie-handle"
-RDEPENDS_${PN}-module-io-zlib += "${PN}-module-vars"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-carp"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-constant"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-extutils-makemaker"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-filehandle"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-io-handle"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-io-select"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-ipc-open3"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-locale-maketext-simple"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-load"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-params-check"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-posix"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-socket"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-strict"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-time-hires"
-RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-vars"
-RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-carp"
-RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-ipc-sysv"
-RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-strict"
-RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-vars"
-RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-ipc-open3"
-RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-carp"
-RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-constant"
-RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-io-pipe"
-RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-posix"
-RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-carp"
-RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-ipc-sysv"
-RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-strict"
-RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-vars"
-RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-carp"
-RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-ipc-sysv"
-RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-strict"
-RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-vars"
-RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-carp"
-RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-config"
-RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-strict"
-RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-vars"
-RDEPENDS_${PN}-module-json-pp-boolean += "${PN}-module-json-pp"
-RDEPENDS_${PN}-module-json-pp-boolean += "${PN}-module-strict"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-b"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-base"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-bytes"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-carp"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-constant"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-encode"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-math-bigfloat"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-math-bigint"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-overload"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-strict"
-RDEPENDS_${PN}-module-json-pp += "${PN}-module-subs"
-RDEPENDS_${PN}-module-less += "${PN}-module-strict"
-RDEPENDS_${PN}-module-less += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-lib += "${PN}-module-carp"
-RDEPENDS_${PN}-module-lib += "${PN}-module-config"
-RDEPENDS_${PN}-module-lib += "${PN}-module-strict"
-RDEPENDS_${PN}-module-list-util += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-list-util += "${PN}-module-strict"
-RDEPENDS_${PN}-module-list-util += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-list-util-xs += "${PN}-module-list-util"
-RDEPENDS_${PN}-module-list-util-xs += "${PN}-module-strict"
-RDEPENDS_${PN}-module-loaded += "${PN}-module-carp"
-RDEPENDS_${PN}-module-loaded += "${PN}-module-strict"
-RDEPENDS_${PN}-module-loaded += "${PN}-module-vars"
-RDEPENDS_${PN}-module-load += "${PN}-module-carp"
-RDEPENDS_${PN}-module-load += "${PN}-module-config"
-RDEPENDS_${PN}-module-load += "${PN}-module-constant"
-RDEPENDS_${PN}-module-load += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-load += "${PN}-module-filehandle"
-RDEPENDS_${PN}-module-load += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-load += "${PN}-module-locale-maketext-simple"
-RDEPENDS_${PN}-module-load += "${PN}-module-corelist"
-RDEPENDS_${PN}-module-load += "${PN}-module-params-check"
-RDEPENDS_${PN}-module-load += "${PN}-module-strict"
-RDEPENDS_${PN}-module-load += "${PN}-module-vars"
-RDEPENDS_${PN}-module-load += "${PN}-module-version"
-RDEPENDS_${PN}-module-load += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-constant"
-RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-carp"
-RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes"
-RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-constants"
-RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-country-codes"
-RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-country-retired"
-RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-carp"
-RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes"
-RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-constants"
-RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-currency-codes"
-RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-currency-retired"
-RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-carp"
-RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes"
-RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-constants"
-RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-langext-codes"
-RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-langext-retired"
-RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-carp"
-RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes"
-RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-constants"
-RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-langfam-codes"
-RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-langfam-retired"
-RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-langfam-retired += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-langfam-retired += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-carp"
-RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes"
-RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-constants"
-RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-language-codes"
-RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-language-retired"
-RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-carp"
-RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes"
-RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-constants"
-RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-langvar-codes"
-RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-langvar-retired"
-RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes += "${PN}-module-carp"
-RDEPENDS_${PN}-module-locale-codes += "${PN}-module-locale-codes-constants"
-RDEPENDS_${PN}-module-locale-codes += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-carp"
-RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes"
-RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-constants"
-RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-script-codes"
-RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-script-retired"
-RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-country += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-country += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-country += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-currency += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-currency += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-currency += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-language += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-language += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-language += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-locale-maketext-gutsloader += "${PN}-module-locale-maketext"
-RDEPENDS_${PN}-module-locale-maketext-guts += "${PN}-module-locale-maketext"
-RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-carp"
-RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-i18n-langtags"
-RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-i18n-langtags-detect"
-RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-integer"
-RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-vars"
-RDEPENDS_${PN}-module-locale-maketext-simple += "${PN}-module-base"
-RDEPENDS_${PN}-module-locale-maketext-simple += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale += "${PN}-module-carp"
-RDEPENDS_${PN}-module-locale += "${PN}-module-config"
-RDEPENDS_${PN}-module-locale-script += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-locale-script += "${PN}-module-strict"
-RDEPENDS_${PN}-module-locale-script += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-carp"
-RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-math-bigint"
-RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-overload"
-RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-strict"
-RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-vars"
-RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-math-bigfloat"
-RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-overload"
-RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-strict"
-RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-vars"
-RDEPENDS_${PN}-module-math-bigint-calcemu += "${PN}-module-strict"
-RDEPENDS_${PN}-module-math-bigint-calcemu += "${PN}-module-vars"
-RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-carp"
-RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-constant"
-RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-integer"
-RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-strict"
-RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-math-bigint-calc"
-RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-strict"
-RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-vars"
-RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-math-bigint += "${PN}-module-carp"
-RDEPENDS_${PN}-module-math-bigint += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-math-bigint += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigfloat"
-RDEPENDS_${PN}-module-math-bigint += "${PN}-module-overload"
-RDEPENDS_${PN}-module-math-bigint += "${PN}-module-strict"
-RDEPENDS_${PN}-module-math-bigint += "${PN}-module-vars"
-RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-math-bigint"
-RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-overload"
-RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-strict"
-RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-vars"
-RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-carp"
-RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-math-bigfloat"
-RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-math-bigint"
-RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-overload"
-RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-strict"
-RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-vars"
-RDEPENDS_${PN}-module-math-complex += "${PN}-module-config"
-RDEPENDS_${PN}-module-math-complex += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-math-complex += "${PN}-module-overload"
-RDEPENDS_${PN}-module-math-complex += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-math-complex += "${PN}-module-strict"
-RDEPENDS_${PN}-module-math-complex += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-math-trig += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-math-trig += "${PN}-module-math-complex"
-RDEPENDS_${PN}-module-math-trig += "${PN}-module-strict"
-RDEPENDS_${PN}-module-memoize-anydbm-file += "${PN}-module-vars"
-RDEPENDS_${PN}-module-memoize-expirefile += "${PN}-module-carp"
-RDEPENDS_${PN}-module-memoize-expire += "${PN}-module-carp"
-RDEPENDS_${PN}-module-memoize += "${PN}-module-carp"
-RDEPENDS_${PN}-module-memoize += "${PN}-module-config"
-RDEPENDS_${PN}-module-memoize += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-memoize += "${PN}-module-strict"
-RDEPENDS_${PN}-module-memoize += "${PN}-module-vars"
-RDEPENDS_${PN}-module-memoize-sdbm-file += "${PN}-module-sdbm-file"
-RDEPENDS_${PN}-module-memoize-storable += "${PN}-module-carp"
-RDEPENDS_${PN}-module-memoize-storable += "${PN}-module-storable"
-RDEPENDS_${PN}-module-meta-notation += "${PN}-module-strict"
-RDEPENDS_${PN}-module-meta-notation += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-vars"
-RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-mime-base64"
-RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-strict"
-RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-vars"
-RDEPENDS_${PN}-module-mro += "${PN}-module-strict"
-RDEPENDS_${PN}-module-mro += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-mro += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-net-cmd += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-cmd += "${PN}-module-constant"
-RDEPENDS_${PN}-module-net-cmd += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-net-cmd += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-cmd += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-net-cmd += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-config += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-net-config += "${PN}-module-socket"
-RDEPENDS_${PN}-module-net-config += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-config += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-domain += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-domain += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-net-domain += "${PN}-module-net-config"
-RDEPENDS_${PN}-module-net-domain += "${PN}-module-posix"
-RDEPENDS_${PN}-module-net-domain += "${PN}-module-socket"
-RDEPENDS_${PN}-module-net-domain += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-domain += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-net-ftp-dataconn"
-RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-errno"
-RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-net-cmd"
-RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-net-ftp-i"
-RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-net-ftp-dataconn"
-RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-net-ftp-i"
-RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-constant"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-io-socket"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-io-socket-ip"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-cmd"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-config"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-ftp-a"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-netrc"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-socket"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-time-local"
-RDEPENDS_${PN}-module-net-ftp += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-hostent += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-net-hostent += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-net-hostent += "${PN}-module-socket"
-RDEPENDS_${PN}-module-net-hostent += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-hostent += "${PN}-module-vars"
-RDEPENDS_${PN}-module-net-netent += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-net-netent += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-net-netent += "${PN}-module-socket"
-RDEPENDS_${PN}-module-net-netent += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-netent += "${PN}-module-vars"
-RDEPENDS_${PN}-module-net-netrc += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-netrc += "${PN}-module-filehandle"
-RDEPENDS_${PN}-module-net-netrc += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-netrc += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-nntp += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-nntp += "${PN}-module-io-socket"
-RDEPENDS_${PN}-module-net-nntp += "${PN}-module-io-socket-ip"
-RDEPENDS_${PN}-module-net-nntp += "${PN}-module-net-cmd"
-RDEPENDS_${PN}-module-net-nntp += "${PN}-module-net-config"
-RDEPENDS_${PN}-module-net-nntp += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-nntp += "${PN}-module-time-local"
-RDEPENDS_${PN}-module-net-nntp += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-ping += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-ping += "${PN}-module-constant"
-RDEPENDS_${PN}-module-net-ping += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-net-ping += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-net-ping += "${PN}-module-filehandle"
-RDEPENDS_${PN}-module-net-ping += "${PN}-module-posix"
-RDEPENDS_${PN}-module-net-ping += "${PN}-module-socket"
-RDEPENDS_${PN}-module-net-ping += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-ping += "${PN}-module-time-hires"
-RDEPENDS_${PN}-module-net-ping += "${PN}-module-vars"
-RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-io-socket"
-RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-io-socket-ip"
-RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-mime-base64"
-RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-cmd"
-RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-config"
-RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-netrc"
-RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-protoent += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-net-protoent += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-net-protoent += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-protoent += "${PN}-module-vars"
-RDEPENDS_${PN}-module-net-servent += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-net-servent += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-net-servent += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-servent += "${PN}-module-vars"
-RDEPENDS_${PN}-module-net-smtp += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-smtp += "${PN}-module-io-socket"
-RDEPENDS_${PN}-module-net-smtp += "${PN}-module-io-socket-ip"
-RDEPENDS_${PN}-module-net-smtp += "${PN}-module-mime-base64"
-RDEPENDS_${PN}-module-net-smtp += "${PN}-module-net-cmd"
-RDEPENDS_${PN}-module-net-smtp += "${PN}-module-net-config"
-RDEPENDS_${PN}-module-net-smtp += "${PN}-module-socket"
-RDEPENDS_${PN}-module-net-smtp += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-smtp += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-net-time += "${PN}-module-carp"
-RDEPENDS_${PN}-module-net-time += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-net-time += "${PN}-module-io-select"
-RDEPENDS_${PN}-module-net-time += "${PN}-module-io-socket"
-RDEPENDS_${PN}-module-net-time += "${PN}-module-net-config"
-RDEPENDS_${PN}-module-net-time += "${PN}-module-strict"
-RDEPENDS_${PN}-module-net-time += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-next += "${PN}-module-carp"
-RDEPENDS_${PN}-module-next += "${PN}-module-overload"
-RDEPENDS_${PN}-module-next += "${PN}-module-strict"
-RDEPENDS_${PN}-module-odbm-file += "${PN}-module-strict"
-RDEPENDS_${PN}-module-odbm-file += "${PN}-module-tie-hash"
-RDEPENDS_${PN}-module-odbm-file += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-odbm-file += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-ok += "${PN}-module-strict"
-RDEPENDS_${PN}-module-ok += "${PN}-module-test-more"
-RDEPENDS_${PN}-module-opcode += "${PN}-module-carp"
-RDEPENDS_${PN}-module-opcode += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-opcode += "${PN}-module-strict"
-RDEPENDS_${PN}-module-opcode += "${PN}-module-subs"
-RDEPENDS_${PN}-module-opcode += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-open += "${PN}-module-carp"
-RDEPENDS_${PN}-module-open += "${PN}-module-encode"
-RDEPENDS_${PN}-module-open += "${PN}-module-encoding"
-RDEPENDS_${PN}-module-open += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-o += "${PN}-module-b"
-RDEPENDS_${PN}-module-o += "${PN}-module-carp"
-RDEPENDS_${PN}-module-ops += "${PN}-module-opcode"
-RDEPENDS_${PN}-module-overloading += "${PN}-module-overload-numbers"
-RDEPENDS_${PN}-module-overloading += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-overload += "${PN}-module-mro"
-RDEPENDS_${PN}-module-overload += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-overload += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-params-check += "${PN}-module-carp"
-RDEPENDS_${PN}-module-params-check += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-params-check += "${PN}-module-locale-maketext-simple"
-RDEPENDS_${PN}-module-params-check += "${PN}-module-strict"
-RDEPENDS_${PN}-module-params-check += "${PN}-module-vars"
-RDEPENDS_${PN}-module-parent += "${PN}-module-strict"
-RDEPENDS_${PN}-module-parent += "${PN}-module-vars"
-RDEPENDS_${PN}-module-perlfaq += "${PN}-module-strict"
-RDEPENDS_${PN}-module-perlfaq += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-perlio-encoding += "${PN}-module-strict"
-RDEPENDS_${PN}-module-perlio-encoding += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-strict"
-RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-perlio-scalar += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-perlio-via += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-perlio-via-quotedprint += "${PN}-module-mime-quotedprint"
-RDEPENDS_${PN}-module-perlio-via-quotedprint += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-checker += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-checker += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-pod-checker += "${PN}-module-pod-parser"
-RDEPENDS_${PN}-module-pod-checker += "${PN}-module-pod-parseutils"
-RDEPENDS_${PN}-module-pod-checker += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-checker += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-find += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-find += "${PN}-module-config"
-RDEPENDS_${PN}-module-pod-find += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-pod-find += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-pod-find += "${PN}-module-file-find"
-RDEPENDS_${PN}-module-pod-find += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-pod-find += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-find += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-pod-find += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-functions += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-pod-functions += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-inputobjects += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-inputobjects += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-man += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-man += "${PN}-module-encode"
-RDEPENDS_${PN}-module-pod-man += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-pod-man += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-pod-man += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-man += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-man += "${PN}-module-subs"
-RDEPENDS_${PN}-module-pod-man += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-parser += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-parser += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-pod-parser += "${PN}-module-pod-inputobjects"
-RDEPENDS_${PN}-module-pod-parser += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-parser += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-pod-parser += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-config"
-RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-file-spec-functions"
-RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-perldoc-getoptsoo += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-getoptsoo += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-config"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-encode"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-spec-functions"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-temp"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-pod-perldoc-getoptsoo"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-parent"
-RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-pod-text-color"
-RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-pod-checker"
-RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-encode"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-file-spec-functions"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-io-handle"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-io-select"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-ipc-open3"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-parent"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-pod-man"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-pod-perldoc-topod"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-parent"
-RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-pod-man"
-RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-parent"
-RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-parent"
-RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-parent"
-RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-pod-text-termcap"
-RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-parent"
-RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-pod-text"
-RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-parent"
-RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-pod-select"
-RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-select += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-select += "${PN}-module-pod-parser"
-RDEPENDS_${PN}-module-pod-select += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-select += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-integer"
-RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-pod-simple-transcode"
-RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-pod-simple-methody"
-RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-text-wrap"
-RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-text-wrap"
-RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-overload"
-RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-pod-simple-blackbox"
-RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple += "${PN}-module-integer"
-RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-escapes"
-RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-blackbox"
-RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-linksection"
-RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-tiedoutfh"
-RDEPENDS_${PN}-module-pod-simple += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-pod-simple += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-progress += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-pod-simple-pullparsertoken"
-RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparserendtoken"
-RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparserstarttoken"
-RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparsertexttoken"
-RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-pod-simple-pullparsertoken"
-RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-pod-simple-pullparsertoken"
-RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-pullparsertoken += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-integer"
-RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-pod-simple-pullparser"
-RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-config"
-RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-cwd"
-RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-pod-simple-methody"
-RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-text-wrap"
-RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-transcodedumb += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-transcodedumb += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-transcode += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-encode"
-RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-pod-text"
-RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-term-ansicolor"
-RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-pod-text"
-RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-text += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-text += "${PN}-module-encode"
-RDEPENDS_${PN}-module-pod-text += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-pod-text += "${PN}-module-pod-simple"
-RDEPENDS_${PN}-module-pod-text += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-text += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-pod-text"
-RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-posix"
-RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-term-cap"
-RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-vars"
-RDEPENDS_${PN}-module-pod-usage += "${PN}-module-carp"
-RDEPENDS_${PN}-module-pod-usage += "${PN}-module-config"
-RDEPENDS_${PN}-module-pod-usage += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-pod-usage += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-pod-usage += "${PN}-module-strict"
-RDEPENDS_${PN}-module-pod-usage += "${PN}-module-vars"
-RDEPENDS_${PN}-module-posix += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-posix += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-posix += "${PN}-module-strict"
-RDEPENDS_${PN}-module-posix += "${PN}-module-tie-hash"
-RDEPENDS_${PN}-module-posix += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-posix += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-re += "${PN}-module-carp"
-RDEPENDS_${PN}-module-re += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-re += "${PN}-module-strict"
-RDEPENDS_${PN}-module-re += "${PN}-module-term-cap"
-RDEPENDS_${PN}-module-re += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-re += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-safe += "${PN}-module-b"
-RDEPENDS_${PN}-module-safe += "${PN}-module-carp"
-RDEPENDS_${PN}-module-safe += "${PN}-module-carp-heavy"
-RDEPENDS_${PN}-module-safe += "${PN}-module-opcode"
-RDEPENDS_${PN}-module-safe += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-safe += "${PN}-module-strict"
-RDEPENDS_${PN}-module-safe += "${PN}-module-utf8"
-RDEPENDS_${PN}-module-scalar-util += "${PN}-module-carp"
-RDEPENDS_${PN}-module-scalar-util += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-scalar-util += "${PN}-module-list-util"
-RDEPENDS_${PN}-module-scalar-util += "${PN}-module-strict"
-RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-strict"
-RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-tie-hash"
-RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-search-dict += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-search-dict += "${PN}-module-feature"
-RDEPENDS_${PN}-module-search-dict += "${PN}-module-strict"
-RDEPENDS_${PN}-module-selectsaver += "${PN}-module-carp"
-RDEPENDS_${PN}-module-selectsaver += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-selfloader += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-selfloader += "${PN}-module-io-handle"
-RDEPENDS_${PN}-module-selfloader += "${PN}-module-strict"
-RDEPENDS_${PN}-module-selfloader += "${PN}-module-vars"
-RDEPENDS_${PN}-module-sigtrap += "${PN}-module-carp"
-RDEPENDS_${PN}-module-sigtrap += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-socket += "${PN}-module-carp"
-RDEPENDS_${PN}-module-socket += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-socket += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-socket += "${PN}-module-strict"
-RDEPENDS_${PN}-module-socket += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-socket += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-sort += "${PN}-module-carp"
-RDEPENDS_${PN}-module-sort += "${PN}-module-strict"
-RDEPENDS_${PN}-module-storable += "${PN}-module-carp"
-RDEPENDS_${PN}-module-storable += "${PN}-module-config"
-RDEPENDS_${PN}-module-storable += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-storable += "${PN}-module-io-file"
-RDEPENDS_${PN}-module-storable += "${PN}-module-vars"
-RDEPENDS_${PN}-module-storable += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-sub-util += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-sub-util += "${PN}-module-list-util"
-RDEPENDS_${PN}-module-sub-util += "${PN}-module-strict"
-RDEPENDS_${PN}-module-sub-util += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-symbol += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-carp"
-RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-posix"
-RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-strict"
-RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-carp"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-posix"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-socket"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-strict"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-sys-hostname"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-vars"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-tap-base += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-base += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-base += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-base += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-posix"
-RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-tap-formatter-color"
-RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-posix"
-RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-posix"
-RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-tap-formatter-file-session"
-RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-tap-object"
-RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-harness += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-harness += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-harness += "${PN}-module-file-path"
-RDEPENDS_${PN}-module-tap-harness += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-tap-harness += "${PN}-module-io-handle"
-RDEPENDS_${PN}-module-tap-harness += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-harness += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-object += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-object += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-object += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-benchmark"
-RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-tap-parser-resultfactory"
-RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-tap-parser-yamlish-reader"
-RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-config"
-RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-io-handle"
-RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-io-select"
-RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-grammar"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-iterator"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-iteratorfactory"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-result"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-resultfactory"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-source"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-executable"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-file"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-handle"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-perl"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-rawtap"
-RDEPENDS_${PN}-module-tap-parser += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-bailout"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-comment"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-plan"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-pragma"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-test"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-unknown"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-version"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-yaml"
-RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-tap-parser-scheduler-job"
-RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-tap-parser-scheduler-spinner"
-RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-tap-parser-iteratorfactory"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-tap-parser-iterator-process"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-tap-parser-iteratorfactory"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-tap-parser-iterator-stream"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-tap-parser-iteratorfactory"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-tap-parser-iterator-stream"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-tap-parser-iterator"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-config"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-tap-parser-iteratorfactory"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-tap-parser-iterator-process"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-tap-parser-iterator-array"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-tap-parser-iteratorfactory"
-RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-constant"
-RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-file-basename"
-RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-base"
-RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-carp"
-RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-strict"
-RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-term-cap += "${PN}-module-carp"
-RDEPENDS_${PN}-module-term-cap += "${PN}-module-strict"
-RDEPENDS_${PN}-module-term-cap += "${PN}-module-vars"
-RDEPENDS_${PN}-module-term-complete += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-term-complete += "${PN}-module-strict"
-RDEPENDS_${PN}-module-term-readline += "${PN}-module-strict"
-RDEPENDS_${PN}-module-term-readline += "${PN}-module-term-cap"
-RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-test-builder"
-RDEPENDS_${PN}-module-test-builder += "${PN}-module-config"
-RDEPENDS_${PN}-module-test-builder += "${PN}-module-perlio"
-RDEPENDS_${PN}-module-test-builder += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-builder += "${PN}-module-threads-shared"
-RDEPENDS_${PN}-module-test-builder += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-test-builder-tester-color += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-builder-tester-color += "${PN}-module-test-builder-tester"
-RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-carp"
-RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-test-builder"
-RDEPENDS_${PN}-module-test-harness += "${PN}-module-base"
-RDEPENDS_${PN}-module-test-harness += "${PN}-module-config"
-RDEPENDS_${PN}-module-test-harness += "${PN}-module-constant"
-RDEPENDS_${PN}-module-test-harness += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-harness"
-RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-aggregator"
-RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-source"
-RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-sourcehandler-perl"
-RDEPENDS_${PN}-module-test-harness += "${PN}-module-text-parsewords"
-RDEPENDS_${PN}-module-test-harness += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-test-more += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-test-more += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-more += "${PN}-module-test-builder-module"
-RDEPENDS_${PN}-module-test-more += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-test += "${PN}-module-carp"
-RDEPENDS_${PN}-module-test += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-test += "${PN}-module-file-temp"
-RDEPENDS_${PN}-module-test += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test += "${PN}-module-vars"
-RDEPENDS_${PN}-module-test-simple += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-simple += "${PN}-module-test-builder-module"
-RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-config"
-RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-test-builder"
-RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-threads-shared"
-RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-vars"
-RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-test-tester-capture"
-RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-vars"
-RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-test-tester += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-test-tester += "${PN}-module-strict"
-RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-builder"
-RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-tester-capturerunner"
-RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-tester-delegate"
-RDEPENDS_${PN}-module-test-tester += "${PN}-module-vars"
-RDEPENDS_${PN}-module-text-abbrev += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-text-balanced += "${PN}-module-carp"
-RDEPENDS_${PN}-module-text-balanced += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-text-balanced += "${PN}-module-overload"
-RDEPENDS_${PN}-module-text-balanced += "${PN}-module-selfloader"
-RDEPENDS_${PN}-module-text-balanced += "${PN}-module-strict"
-RDEPENDS_${PN}-module-text-balanced += "${PN}-module-vars"
-RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-carp"
-RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-strict"
-RDEPENDS_${PN}-module-text-tabs += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-text-tabs += "${PN}-module-strict"
-RDEPENDS_${PN}-module-text-tabs += "${PN}-module-vars"
-RDEPENDS_${PN}-module-text-wrap += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-text-wrap += "${PN}-module-re"
-RDEPENDS_${PN}-module-text-wrap += "${PN}-module-strict"
-RDEPENDS_${PN}-module-text-wrap += "${PN}-module-text-tabs"
-RDEPENDS_${PN}-module-text-wrap += "${PN}-module-vars"
-RDEPENDS_${PN}-module-text-wrap += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-thread += "${PN}-module-config"
-RDEPENDS_${PN}-module-thread += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-thread += "${PN}-module-strict"
-RDEPENDS_${PN}-module-thread += "${PN}-module-threads"
-RDEPENDS_${PN}-module-thread += "${PN}-module-threads-shared"
-RDEPENDS_${PN}-module-thread += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-thread-queue += "${PN}-module-carp"
-RDEPENDS_${PN}-module-thread-queue += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-thread-queue += "${PN}-module-strict"
-RDEPENDS_${PN}-module-thread-queue += "${PN}-module-threads-shared"
-RDEPENDS_${PN}-module-thread-queue += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-carp"
-RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-strict"
-RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-threads-shared"
-RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-threads += "${PN}-module-carp"
-RDEPENDS_${PN}-module-threads += "${PN}-module-config"
-RDEPENDS_${PN}-module-threads += "${PN}-module-overload"
-RDEPENDS_${PN}-module-threads += "${PN}-module-strict"
-RDEPENDS_${PN}-module-threads += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-threads += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-threads-shared += "${PN}-module-carp"
-RDEPENDS_${PN}-module-threads-shared += "${PN}-module-scalar-util"
-RDEPENDS_${PN}-module-threads-shared += "${PN}-module-strict"
-RDEPENDS_${PN}-module-threads-shared += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-threads-shared += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-tie-array += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tie-array += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tie-array += "${PN}-module-vars"
-RDEPENDS_${PN}-module-tie-file += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tie-file += "${PN}-module-fcntl"
-RDEPENDS_${PN}-module-tie-file += "${PN}-module-posix"
-RDEPENDS_${PN}-module-tie-file += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tie-file += "${PN}-module-symbol"
-RDEPENDS_${PN}-module-tie-handle += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tie-handle += "${PN}-module-tie-stdhandle"
-RDEPENDS_${PN}-module-tie-handle += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-tie-hash-namedcapture += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tie-hash-namedcapture += "${PN}-module-xsloader"
-RDEPENDS_${PN}-module-tie-hash += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tie-hash += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-tie-memoize += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tie-memoize += "${PN}-module-tie-hash"
-RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-config"
-RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-overload"
-RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-tie-hash"
-RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-vars"
-RDEPENDS_${PN}-module-tie-scalar += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tie-scalar += "${PN}-module-warnings-register"
-RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-strict"
-RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-tie-handle"
-RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-vars"
-RDEPENDS_${PN}-module-tie-substrhash += "${PN}-module-carp"
-RDEPENDS_${PN}-module-tie-substrhash += "${PN}-module-integer"
-RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-strict"
-RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-time-tm"
-RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-vars"
-RDEPENDS_${PN}-module-time-hires += "${PN}-module-carp"
-RDEPENDS_${PN}-module-time-hires += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-time-hires += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-time-hires += "${PN}-module-strict"
-RDEPENDS_${PN}-module-time-local += "${PN}-module-carp"
-RDEPENDS_${PN}-module-time-local += "${PN}-module-config"
-RDEPENDS_${PN}-module-time-local += "${PN}-module-constant"
-RDEPENDS_${PN}-module-time-local += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-time-local += "${PN}-module-strict"
-RDEPENDS_${PN}-module-time-local += "${PN}-module-vars"
-RDEPENDS_${PN}-module-time-localtime += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-time-localtime += "${PN}-module-strict"
-RDEPENDS_${PN}-module-time-localtime += "${PN}-module-time-tm"
-RDEPENDS_${PN}-module-time-localtime += "${PN}-module-vars"
-RDEPENDS_${PN}-module-time-piece += "${PN}-module-carp"
-RDEPENDS_${PN}-module-time-piece += "${PN}-module-constant"
-RDEPENDS_${PN}-module-time-piece += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-time-piece += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-time-piece += "${PN}-module-integer"
-RDEPENDS_${PN}-module-time-piece += "${PN}-module-overload"
-RDEPENDS_${PN}-module-time-piece += "${PN}-module-strict"
-RDEPENDS_${PN}-module-time-piece += "${PN}-module-time-local"
-RDEPENDS_${PN}-module-time-piece += "${PN}-module-time-seconds"
-RDEPENDS_${PN}-module-time-seconds += "${PN}-module-constant"
-RDEPENDS_${PN}-module-time-seconds += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-time-seconds += "${PN}-module-overload "
-RDEPENDS_${PN}-module-time-seconds += "${PN}-module-strict"
-RDEPENDS_${PN}-module-time-seconds += "${PN}-module-vars"
-RDEPENDS_${PN}-module-time-tm += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-time-tm += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-collate-cjk-big5 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-collate-cjk-big5 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicode-collate-cjk-gb2312 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-collate-cjk-gb2312 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicode-collate-cjk-jisx0208 += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-collate-cjk-jisx0208 += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicode-collate-cjk-korean += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-collate-cjk-korean += "${PN}-module-unicode-collate"
-RDEPENDS_${PN}-module-unicode-collate-cjk-korean += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicode-collate-cjk-pinyin += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-collate-cjk-pinyin += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicode-collate-cjk-stroke += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-collate-cjk-stroke += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicode-collate-cjk-zhuyin += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-collate-cjk-zhuyin += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-base"
-RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-carp"
-RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-carp"
-RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-constant"
-RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-dynaloader"
-RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-carp"
-RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-constant"
-RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-carp"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-charnames"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-feature"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-file-spec"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-if"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-integer"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-strict"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-unicode-normalize"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-unicore"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-utf8-heavy"
-RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-unicore += "${PN}-module-integer"
-RDEPENDS_${PN}-module-universal += "${PN}-module-carp"
-RDEPENDS_${PN}-module-user-grent += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-user-grent += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-user-grent += "${PN}-module-strict"
-RDEPENDS_${PN}-module-user-grent += "${PN}-module-vars"
-RDEPENDS_${PN}-module-user-pwent += "${PN}-module-carp"
-RDEPENDS_${PN}-module-user-pwent += "${PN}-module-class-struct"
-RDEPENDS_${PN}-module-user-pwent += "${PN}-module-config"
-RDEPENDS_${PN}-module-user-pwent += "${PN}-module-exporter"
-RDEPENDS_${PN}-module-user-pwent += "${PN}-module-strict"
-RDEPENDS_${PN}-module-user-pwent += "${PN}-module-vars"
-RDEPENDS_${PN}-module-user-pwent += "${PN}-module-warnings"
-RDEPENDS_${PN}-module-utf8 += "${PN}-module-carp"
-RDEPENDS_${PN}-module-utf8 += "${PN}-module-utf8-heavy"
-RDEPENDS_${PN}-module-version += "${PN}-module-strict"
-RDEPENDS_${PN}-module-version += "${PN}-module-vars"
-RDEPENDS_${PN}-module-version += "${PN}-module-version-regex"
-RDEPENDS_${PN}-module-version-regex += "${PN}-module-strict"
-RDEPENDS_${PN}-module-version-regex += "${PN}-module-vars"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-b"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-carp"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-config"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-constant"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-if"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-overload"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-posix"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-strict"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-universal"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-vars"
-RDEPENDS_${PN}-module-version-vpp += "${PN}-module-version-regex"
-RDEPENDS_${PN}-module-xsloader += "${PN}-module-carp"
-RDEPENDS_${PN}-module-xsloader += "${PN}-module-dynaloader"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.24.1.inc b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.24.1.inc
new file mode 100644
index 0000000..10e3c04
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.24.1.inc
@@ -0,0 +1,2575 @@
+# To create/update the perl-rdepends_${PV}.inc use this piece of ugly script (modified for your arch/paths etc):
+
+#jiahongxu:5.20.0-r1$ pwd
+#/home/jiahongxu/yocto/build-20140618-perl/tmp/work/i586-poky-linux/perl/5.20.0-r1
+
+#1 cp -r packages-split packages-split.new && cd packages-split.new
+#2 find . -name \*.pm | xargs sed -i '/^=head/,/^=cut/d'
+#3 egrep -r "^\s*(\<use .*|\<require .*);?" perl-module-* --include="*.pm" 
+#| sed "s/\/.*\.pm: */ += /g;s/[\"\']//g;s/;.*/\"/g;s/+= .*\(require\|use\)\> */+= \"perl-module-/g;s/CPANPLUS::.*/cpanplus/g;s/CPAN::.*/cpan/g;s/::/-/g;s/ [^+\"].*//g;s/_/-/g;s/\.pl\"$/\"/;s/\"\?\$/\"/;s/(//;" | tr [:upper:] [:lower:] 
+#| awk '{if ($3 != "\x22"$1"\x22"){ print $0}}'
+#| grep -v -e "\-vms\-" -e module-5 -e "^$" -e "\\$" -e your -e tk -e autoperl -e html -e http -e parse-cpan -e perl-ostype -e ndbm-file -e module-mac -e fcgi -e lwp -e dbd -e dbix 
+#| sort -u 
+#| sed 's/^/RDEPENDS_/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;' 
+#| egrep -wv '=>|module-a|module-apache.?|module-apr|module-authen-sasl|module-b-asmdata|module-convert-ebcdic|module-devel-size|module-digest-perl-md5|module-dumpvalue|module-extutils-constant-aaargh56hash|module-extutils-xssymset|module-file-bsdglob|module-for|module-it|module-io-string|module-ipc-system-simple|module-lexical|module-local-lib|metadata|module-modperl-util|module-pluggable-object|module-test-builder-io-scalar|module-text-unidecode|module-win32|objects\sload|syscall.ph|systeminfo.ph|%s' > /tmp/perl-rdepends
+
+RDEPENDS_perl-misc += "perl perl-modules"
+RDEPENDS_${PN}-pod += "perl"
+
+# Some additional dependencies that the above doesn't manage to figure out
+RDEPENDS_${PN}-module-file-spec += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-attributes"
+RDEPENDS_${PN}-module-overload += "${PN}-module-overloading"
+
+# Depends list
+# copy contents of /tmp/perl-rdepends in this file
+RDEPENDS_${PN}-module-anydbm-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-anydbm-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-config"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-cpan"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-getopt-std"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-if"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-net-ping"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-user-pwent"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-vars"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-app-prove-state"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-base"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-getopt-long"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-tap-harness"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-tap-harness-env"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-app-prove-state-result"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-base"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-tap-parser-yamlish-reader"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-tap-parser-yamlish-writer"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-app-prove-state-result-test"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove-state-result-test += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove-state-result-test += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-constant"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-io-compress-bzip2"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-archive-tar"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-archive-tar-constant"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-vars"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-archive-tar-constant"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-archive-tar-file"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-config"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-io-zlib"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-strict"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-vars"
+RDEPENDS_${PN}-module-arybase += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-carp"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-strict"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-vars"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-carp"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-constant"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-fatal"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-overload"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-parent"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-b"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-constant"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-constant"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-lib"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-parent"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-scope-guard += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-scope-guard += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-autodie-scope-guard"
+RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-skip += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-skip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-util += "${PN}-module-autodie-scope-guardstack"
+RDEPENDS_${PN}-module-autodie-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-autodie-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-util += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autoloader += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autoloader += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-config"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autouse += "${PN}-module-carp"
+RDEPENDS_${PN}-module-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-base += "${PN}-module-vars"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-b-op-private"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-config"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-b-debug += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-debug += "${PN}-module-config"
+RDEPENDS_${PN}-module-b-debug += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-carp"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-feature"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-overloading"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-re"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-vars"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-benchmark += "${PN}-module-carp"
+RDEPENDS_${PN}-module-benchmark += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-benchmark += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-carp"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-constant"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-math-bigint-trace"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-overload"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-bigint"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-carp"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigfloat-trace"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigint-trace"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-overload"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-bigint"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigint-trace"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigrat"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-overload"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-blib += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-blib += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-blib += "${PN}-module-vars"
+RDEPENDS_${PN}-module-b += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-b += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b-concise"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b-terse"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-b-concise"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-carp"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-xref += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-xref += "${PN}-module-config"
+RDEPENDS_${PN}-module-b-xref += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bytes += "${PN}-module-bytes-heavy"
+RDEPENDS_${PN}-module-bytes += "${PN}-module-carp"
+RDEPENDS_${PN}-module-carp-heavy += "${PN}-module-carp"
+RDEPENDS_${PN}-module-carp += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-carp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-carp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-bytes"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-carp"
+RDEPENDS_${PN}-module-charnames += "${PN}-module--charnames"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-re"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-re"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-strict"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-strict"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-carp"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-strict"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-bytes "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-carp "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-constant"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-strict "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-warnings "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-bytes "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-carp "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-constant"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-strict "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-warnings "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-bytes "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-carp "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-constant"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-gzip"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-handle "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-uncompress-gunzip"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-strict "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-warnings "
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-config"
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-strict"
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-vars"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-config"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-strict"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-vars"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-constant += "${PN}-module-carp"
+RDEPENDS_${PN}-module-constant += "${PN}-module-strict"
+RDEPENDS_${PN}-module-constant += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-corelist"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-strict"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-vars"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-version"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-b"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-carp"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-config"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-dirhandle"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-extutils-manifest"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-lib"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-net-ping"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-overload"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-posix"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-safe"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-strict"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-sys-hostname"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-term-readline"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-vars"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-vars"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-b-deparse"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-carp"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-config"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-constant"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-overload"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-int32 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-int32 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-null += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-null += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-db += "${PN}-module-strict"
+RDEPENDS_${PN}-module-deprecate += "${PN}-module-carp"
+RDEPENDS_${PN}-module-deprecate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-deprecate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-devel-peek += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-devel-peek += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-getopt-long"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-strict"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-vars"
+RDEPENDS_${PN}-module-devel-selfstubber += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-devel-selfstubber += "${PN}-module-selfloader"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-carp"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-config"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-getopt-std"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-strict"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-text-tabs"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-digest"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-digest-base"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-digest += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-carp"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-digest-base"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-integer"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dirhandle += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dirhandle += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-dynaloader += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dynaloader += "${PN}-module-config"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-vars"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-encode-cn-hz"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-config += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-config += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-overload"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-encode-mime-name"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-encode-unicode"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-vars"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode-jp-h2z"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-encode-jp-jis7"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-encode-kr-2022-kr"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-mime-name += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-mime-name += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-alias"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-config"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-configlocal-pm"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-encoding"
+RDEPENDS_${PN}-module-encode += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-re"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-config"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-filter-util-call"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-i18n-langinfo"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-posix"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encoding-warnings += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encoding-warnings += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encoding-warnings += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-english += "${PN}-module-carp "
+RDEPENDS_${PN}-module-english += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-env += "${PN}-module-config"
+RDEPENDS_${PN}-module-env += "${PN}-module-tie-array"
+RDEPENDS_${PN}-module-errno += "${PN}-module-carp"
+RDEPENDS_${PN}-module-errno += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-errno += "${PN}-module-strict"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-carp"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-feature"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-strict"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-version"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-carp"
+RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-strict"
+RDEPENDS_${PN}-module-exporter += "${PN}-module-exporter-heavy"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-extutils-mksymlists"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-ipc-cmd"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-extutils-cbuilder-base"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-extutils-cbuilder-base"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-bcc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-bcc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-gcc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-gcc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-msvc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-msvc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-extutils-cbuilder-base"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-extutils-command"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-extutils-install"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-getopt-long"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-test-harness"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-constant"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-proxysubs"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-xs"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-extutils-constant-xs"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-constant"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-posix"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant-base"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-extutils-liblist"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-getopt-std"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-extutils-packlist"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-autosplit"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-extutils-packlist"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-compare"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-extutils-liblist-kid"
+RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-config += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-makemaker-config += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-base"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-encode"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-encode-alias"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-i18n-langinfo"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-b"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-makemaker-version"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-manifest"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-mm"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-my"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-version"
+RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-extutils-embed"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-autosplit"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-cpan"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-version"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-mm-win32"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-darwin += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-darwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-macos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-mm-win32"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-liblist"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-qnx += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-qnx += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-dirhandle"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-encode"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-liblist"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-version"
+RDEPENDS_${PN}-module-extutils-mm-uwin += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-uwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-liblist-kid"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-vos += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-vos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-extutils-mm-win32"
+RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-my += "${PN}-module-extutils-mm"
+RDEPENDS_${PN}-module-extutils-my += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-parsexs-countlines += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-eval += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-eval += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-constants"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-countlines"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-eval"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-utilities"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-re"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-extutils-parsexs-constants"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-extutils-typemaps"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-lib"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-extutils-typemaps"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-inputmap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-inputmap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-re"
+RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-parsexs"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-parsexs-constants"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-inputmap"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-outputmap"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-type"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-extutils-typemaps"
+RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-exception-system"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-hints"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-util"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-carp"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-config"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-constant"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-posix"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-strict"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-tie-refhash"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-fcntl += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-fcntl += "${PN}-module-strict"
+RDEPENDS_${PN}-module-fcntl += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-feature += "${PN}-module-carp"
+RDEPENDS_${PN}-module-fields += "${PN}-module-base"
+RDEPENDS_${PN}-module-fields += "${PN}-module-carp"
+RDEPENDS_${PN}-module-fields += "${PN}-module-hash-util"
+RDEPENDS_${PN}-module-fields += "${PN}-module-strict"
+RDEPENDS_${PN}-module-fields += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-re"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-carp"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-parent"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-strict"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-config"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-ipc-cmd"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-load"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-params-check"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-config"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-file-glob"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-glob += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-glob += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-glob += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-amigaos += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-amigaos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-amigaos += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-cwd "
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-overload "
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-errno"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-io-seekable"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-overload"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-parent"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-posix"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-vars"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-carp"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-filter-util-call"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-text-balanced"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-vars"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-carp "
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-strict"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-vars"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-carp"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-constant"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-overload"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-pod-usage"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-strict"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-vars"
+RDEPENDS_${PN}-module-getopt-std += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-strict"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-carp"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-hash-util-fieldhash"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-overload"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-posix"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-carp"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-i18n-langtags"
+RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-vars"
+RDEPENDS_${PN}-module-i18n-langtags-list += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langtags-list += "${PN}-module-vars"
+RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-vars"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-compress-raw-bzip2"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-encode"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-file-globmapper"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-handle "
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-adapter-bzip2"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-base"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-rawdeflate"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-zlib-constants"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-rawdeflate"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-base"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-config"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-adapter-identity"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-bzip2"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-rawdeflate"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-zip-constants"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-file-stat"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-io-seekable"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-selectsaver"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-io"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-selectsaver"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-poll += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-poll += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-poll += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-vars"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-errno"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-socket"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-base"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-errno"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-posix"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-socket"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-errno"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-socket-inet"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-socket-unix"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-socket"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-compress-raw-bzip2"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-io-compress-zip-constants "
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-adapter-inflate"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-gunzip"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-inflate"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-unzip"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-carp "
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-io-file "
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-uncompress-adapter-bunzip2"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-compress-zlib-constants"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-uncompress-adapter-inflate"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-zip-constants"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-adapter-identity"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-adapter-inflate"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-posix"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-tie-handle"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-constant"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-ipc-open3"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-load"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-params-check"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-posix"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-socket"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-time-hires"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-ipc-sysv"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-ipc-open3"
+RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-constant"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-io-pipe"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-posix"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-ipc-sysv"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-ipc-sysv"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-config"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-vars"
+RDEPENDS_${PN}-module-json-pp-boolean += "${PN}-module-json-pp"
+RDEPENDS_${PN}-module-json-pp-boolean += "${PN}-module-strict"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-b"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-base"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-encode"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-overload"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-subs"
+RDEPENDS_${PN}-module-less += "${PN}-module-strict"
+RDEPENDS_${PN}-module-less += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-lib += "${PN}-module-carp"
+RDEPENDS_${PN}-module-lib += "${PN}-module-config"
+RDEPENDS_${PN}-module-lib += "${PN}-module-strict"
+RDEPENDS_${PN}-module-list-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-list-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-list-util += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-list-util-xs += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-list-util-xs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-loaded += "${PN}-module-carp"
+RDEPENDS_${PN}-module-loaded += "${PN}-module-strict"
+RDEPENDS_${PN}-module-loaded += "${PN}-module-vars"
+RDEPENDS_${PN}-module-load += "${PN}-module-carp"
+RDEPENDS_${PN}-module-load += "${PN}-module-config"
+RDEPENDS_${PN}-module-load += "${PN}-module-constant"
+RDEPENDS_${PN}-module-load += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-load += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-load += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-load += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-load += "${PN}-module-corelist"
+RDEPENDS_${PN}-module-load += "${PN}-module-load"
+RDEPENDS_${PN}-module-load += "${PN}-module-params-check"
+RDEPENDS_${PN}-module-load += "${PN}-module-strict"
+RDEPENDS_${PN}-module-load += "${PN}-module-vars"
+RDEPENDS_${PN}-module-load += "${PN}-module-version"
+RDEPENDS_${PN}-module-load += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-country-codes"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-country-retired"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-currency-codes"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-currency-retired"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-langext-codes"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-langext-retired"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-langfam-codes"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-langfam-retired"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langfam-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langfam-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-language-codes"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-language-retired"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-langvar-codes"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-langvar-retired"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-script-codes"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-script-retired"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-country += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-country += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-country += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-currency += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-currency += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-currency += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-language += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-language += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-language += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-maketext-gutsloader += "${PN}-module-locale-maketext"
+RDEPENDS_${PN}-module-locale-maketext-guts += "${PN}-module-locale-maketext"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-i18n-langtags"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-i18n-langtags-detect"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-integer"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-vars"
+RDEPENDS_${PN}-module-locale-maketext-simple += "${PN}-module-base"
+RDEPENDS_${PN}-module-locale-maketext-simple += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale += "${PN}-module-config"
+RDEPENDS_${PN}-module-locale-script += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-script += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-script += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-math-complex"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-calcemu += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-calcemu += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-constant"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-integer"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-math-bigint-calc"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-complex"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-config"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-trig += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-trig += "${PN}-module-math-complex"
+RDEPENDS_${PN}-module-math-trig += "${PN}-module-strict"
+RDEPENDS_${PN}-module-memoize-anydbm-file += "${PN}-module-vars"
+RDEPENDS_${PN}-module-memoize-expirefile += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize-expire += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-config"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-strict"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-vars"
+RDEPENDS_${PN}-module-memoize-sdbm-file += "${PN}-module-sdbm-file"
+RDEPENDS_${PN}-module-memoize-storable += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize-storable += "${PN}-module-storable"
+RDEPENDS_${PN}-module-meta-notation += "${PN}-module-strict"
+RDEPENDS_${PN}-module-meta-notation += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-vars"
+RDEPENDS_${PN}-module-mro += "${PN}-module-strict"
+RDEPENDS_${PN}-module-mro += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-mro += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-constant"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-errno"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-posix"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-net-ftp-dataconn"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-errno"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-net-ftp-i"
+RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-net-ftp-dataconn"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-net-ftp-i"
+RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-ftp-a"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-netrc"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-constant"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-posix"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-time-hires"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-netrc"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-next += "${PN}-module-carp"
+RDEPENDS_${PN}-module-next += "${PN}-module-overload"
+RDEPENDS_${PN}-module-next += "${PN}-module-strict"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-ok += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ok += "${PN}-module-test-more"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-carp"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-subs"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-open += "${PN}-module-carp"
+RDEPENDS_${PN}-module-open += "${PN}-module-encode"
+RDEPENDS_${PN}-module-open += "${PN}-module-encoding"
+RDEPENDS_${PN}-module-open += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-o += "${PN}-module-b"
+RDEPENDS_${PN}-module-o += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ops += "${PN}-module-opcode"
+RDEPENDS_${PN}-module-overloading += "${PN}-module-overload-numbers"
+RDEPENDS_${PN}-module-overloading += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-overload += "${PN}-module-mro"
+RDEPENDS_${PN}-module-overload += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-overload += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-carp"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-strict"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-vars"
+RDEPENDS_${PN}-module-parent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-parent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-perlfaq += "${PN}-module-strict"
+RDEPENDS_${PN}-module-perlfaq += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-perlio-encoding += "${PN}-module-strict"
+RDEPENDS_${PN}-module-perlio-encoding += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-scalar += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-via += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-via-quotedprint += "${PN}-module-mime-quotedprint"
+RDEPENDS_${PN}-module-perlio-via-quotedprint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-pod-parser"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-pod-parseutils"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-functions += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-functions += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-inputobjects += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-inputobjects += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-subs"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-pod-inputobjects"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-getoptsoo += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-getoptsoo += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-pod-perldoc-getoptsoo"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-pod-text-color"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-pod-checker"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-ipc-open3"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-pod-man"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-pod-perldoc-topod"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-pod-man"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-pod-text-termcap"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-pod-select"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-pod-parser"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-integer"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-pod-simple-transcode"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-pod-simple-methody"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-overload"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-pod-simple-blackbox"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-integer"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-escapes"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-blackbox"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-linksection"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-tiedoutfh"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-progress += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-pod-simple-pullparsertoken"
+RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparserendtoken"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparserstarttoken"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparsertexttoken"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-pod-simple-pullparsertoken"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-pod-simple-pullparsertoken"
+RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-pullparsertoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-integer"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-pod-simple-pullparser"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-pod-simple-methody"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-transcodedumb += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-transcodedumb += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-transcode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-transcode += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-term-ansicolor"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-posix"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-term-cap"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-vars"
+RDEPENDS_${PN}-module-posix += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-posix += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-posix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-posix += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-posix += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-posix += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-re += "${PN}-module-carp"
+RDEPENDS_${PN}-module-re += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-re += "${PN}-module-strict"
+RDEPENDS_${PN}-module-re += "${PN}-module-term-cap"
+RDEPENDS_${PN}-module-re += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-re += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-safe += "${PN}-module-b"
+RDEPENDS_${PN}-module-safe += "${PN}-module-carp"
+RDEPENDS_${PN}-module-safe += "${PN}-module-carp-heavy"
+RDEPENDS_${PN}-module-safe += "${PN}-module-opcode"
+RDEPENDS_${PN}-module-safe += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-safe += "${PN}-module-strict"
+RDEPENDS_${PN}-module-safe += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-carp"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-search-dict += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-search-dict += "${PN}-module-feature"
+RDEPENDS_${PN}-module-search-dict += "${PN}-module-strict"
+RDEPENDS_${PN}-module-selectsaver += "${PN}-module-carp"
+RDEPENDS_${PN}-module-selectsaver += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-strict"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-vars"
+RDEPENDS_${PN}-module-sigtrap += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sigtrap += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-socket += "${PN}-module-carp"
+RDEPENDS_${PN}-module-socket += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-socket += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-socket += "${PN}-module-strict"
+RDEPENDS_${PN}-module-socket += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-socket += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-sort += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sort += "${PN}-module-strict"
+RDEPENDS_${PN}-module-storable += "${PN}-module-carp"
+RDEPENDS_${PN}-module-storable += "${PN}-module-config"
+RDEPENDS_${PN}-module-storable += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-storable += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-storable += "${PN}-module-vars"
+RDEPENDS_${PN}-module-storable += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-symbol += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-posix"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-posix"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-socket"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-sys-hostname"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-vars"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-tap-formatter-color"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-tap-formatter-file-session"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-tap-object"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-object += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-object += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-object += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-benchmark"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-tap-parser-resultfactory"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-tap-parser-yamlish-reader"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-config"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-grammar"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-iterator"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-result"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-resultfactory"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-source"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-executable"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-file"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-handle"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-perl"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-rawtap"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-bailout"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-comment"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-plan"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-pragma"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-test"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-unknown"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-version"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-yaml"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-tap-parser-scheduler-job"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-tap-parser-scheduler-spinner"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-tap-parser-iterator-process"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-tap-parser-iterator-stream"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-tap-parser-iterator-stream"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-tap-parser-iterator"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-config"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-tap-parser-iterator-process"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-tap-parser-iterator-array"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-carp"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-term-cap += "${PN}-module-carp"
+RDEPENDS_${PN}-module-term-cap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-cap += "${PN}-module-vars"
+RDEPENDS_${PN}-module-term-complete += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-term-complete += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-readline += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-readline += "${PN}-module-term-cap"
+RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-config"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-perlio"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test-builder-tester-color += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder-tester-color += "${PN}-module-test-builder-tester"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-carp"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-base"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-config"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-constant"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-harness"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-aggregator"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-source"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-sourcehandler-perl"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-test-builder-module"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test += "${PN}-module-carp"
+RDEPENDS_${PN}-module-test += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-test += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test += "${PN}-module-vars"
+RDEPENDS_${PN}-module-test-simple += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-simple += "${PN}-module-test-builder-module"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-config"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-vars"
+RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-test-tester-capture"
+RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-vars"
+RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-tester-capturerunner"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-tester-delegate"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-abbrev += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-carp"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-overload"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-selfloader"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-carp"
+RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-tabs += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-tabs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-tabs += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-re"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-text-tabs"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-thread += "${PN}-module-config"
+RDEPENDS_${PN}-module-thread += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-thread += "${PN}-module-strict"
+RDEPENDS_${PN}-module-thread += "${PN}-module-threads"
+RDEPENDS_${PN}-module-thread += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-thread += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-carp"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-strict"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-carp"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-strict"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-threads += "${PN}-module-carp"
+RDEPENDS_${PN}-module-threads += "${PN}-module-config"
+RDEPENDS_${PN}-module-threads += "${PN}-module-overload"
+RDEPENDS_${PN}-module-threads += "${PN}-module-strict"
+RDEPENDS_${PN}-module-threads += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-threads += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-carp"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-strict"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-tie-array += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-array += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-array += "${PN}-module-vars"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-tie-handle += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-handle += "${PN}-module-tie-stdhandle"
+RDEPENDS_${PN}-module-tie-handle += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-tie-hash-namedcapture += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-hash-namedcapture += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-tie-hash += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-hash += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-tie-memoize += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-memoize += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-config"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-overload"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-vars"
+RDEPENDS_${PN}-module-tie-scalar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-scalar += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-tie-handle"
+RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-vars"
+RDEPENDS_${PN}-module-tie-substrhash += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-substrhash += "${PN}-module-integer"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-time-tm"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-vars"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-carp"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-carp"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-config"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-constant"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-vars"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-time-tm"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-vars"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-carp"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-constant"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-integer"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-overload"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-time-seconds"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-constant"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-overload"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-tm += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-time-tm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-big5 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-big5 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-gb2312 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-gb2312 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-jisx0208 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-jisx0208 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-korean += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-korean += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-pinyin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-pinyin += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-stroke += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-stroke += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-zhuyin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-zhuyin += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-base"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-constant"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-charnames"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-feature"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-if"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-integer"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-unicode-normalize"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-unicore"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-utf8-heavy"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicore += "${PN}-module-integer"
+RDEPENDS_${PN}-module-universal += "${PN}-module-carp"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-carp"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-config"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-utf8 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-utf8 += "${PN}-module-utf8-heavy"
+RDEPENDS_${PN}-module-version += "${PN}-module-strict"
+RDEPENDS_${PN}-module-version += "${PN}-module-vars"
+RDEPENDS_${PN}-module-version += "${PN}-module-version-regex"
+RDEPENDS_${PN}-module-version += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-version-regex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-version-regex += "${PN}-module-vars"
+RDEPENDS_${PN}-module-xsloader += "${PN}-module-carp"
+RDEPENDS_${PN}-module-xsloader += "${PN}-module-dynaloader"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/0001-Configure-Remove-fstack-protector-strong-for-native-.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/0001-Configure-Remove-fstack-protector-strong-for-native-.patch
new file mode 100644
index 0000000..7391ac5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/0001-Configure-Remove-fstack-protector-strong-for-native-.patch
@@ -0,0 +1,103 @@
+Some distributions (like opensuse421) supported by the project
+comes with older gcc releases, -fstack-protector=strong is supported
+by GCC>=4.9.
+
+This causes a build failure when install perl-native from a sstate that
+comes from a machine supporting -fstack-protector=strong [1].
+
+So disable usage of this flag in perl-native builds, this patch could
+be removed when all supported distros comes with GCC>=4.9.
+
+[YOCTO #10338]
+
+Upstream-status: Inappropriate [configuration]
+
+[1] http://errors.yoctoproject.org/Errors/Details/109589/
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ Configure | 54 ------------------------------------------------------
+ 1 file changed, 54 deletions(-)
+
+diff --git a/Configure b/Configure
+index efbdcfd..d5bd98c 100755
+--- a/Configure
++++ b/Configure
+@@ -5468,30 +5468,6 @@ default|recommended)
+ 		eval $checkccflag
+ 		;;
+ 	esac
+-
+-	# on x86_64 (at least) we require an extra library (libssp) in the
+-	# link command line. This library is not named, so I infer that it is
+-	# an implementation detail that may change. Hence the safest approach
+-	# is to add the flag to the flags passed to the compiler at link time,
+-	# as that way the compiler can do the right implementation dependant
+-	# thing. (NWC)
+-	case "$osname" in
+-	amigaos) ;; # -fstack-protector builds but doesn't work
+-	*)	case "$gccversion" in
+-		?*)	set stack-protector-strong -fstack-protector-strong
+-			eval $checkccflag
+-			case "$dflt" in
+-			*-fstack-protector-strong*) ;; # It got added.
+-			*) # Try the plain/older -fstack-protector.
+-			   set stack-protector -fstack-protector
+-			   eval $checkccflag
+-			   ;;
+-			esac
+-			;;
+-		esac
+-		;;
+-	esac
+-	;;
+ esac
+ 
+ case "$mips_type" in
+@@ -5634,21 +5610,6 @@ case "$ldflags" in
+ 	;;
+ *) dflt="$ldflags";;
+ esac
+-# See note above about -fstack-protector
+-case "$ccflags" in
+-*-fstack-protector-strong*)
+-	case "$dflt" in
+-	*-fstack-protector-strong*) ;; # Don't add it again
+-	*) dflt="$dflt -fstack-protector-strong" ;;
+-	esac
+-	;;
+-*-fstack-protector*)
+-	case "$dflt" in
+-	*-fstack-protector*) ;; # Don't add it again
+-	*) dflt="$dflt -fstack-protector" ;;
+-	esac
+-	;;
+-esac
+ 
+ : Try to guess additional flags to pick up local libraries.
+ for thislibdir in $libpth; do
+@@ -8571,21 +8532,6 @@ EOM
+ 	    ''|' ') dflt='none' ;;
+ 	esac
+ 
+-	case "$ldflags" in
+-	    *-fstack-protector-strong*)
+-		case "$dflt" in
+-		    *-fstack-protector-strong*) ;; # Don't add it again
+-		    *) dflt="$dflt -fstack-protector-strong" ;;
+-		esac
+-		;;
+-	    *-fstack-protector*)
+-		case "$dflt" in
+-		    *-fstack-protector*) ;; # Don't add it again
+-		    *) dflt="$dflt -fstack-protector" ;;
+-		esac
+-		;;
+-	esac
+-
+ 	rp="Any special flags to pass to $ld to create a dynamically loaded library?"
+ 	. ./myread
+ 	case "$ans" in
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch
index edf49d6..fd8237f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch
@@ -1,15 +1,22 @@
+From 4dd9f3f81d8c81c96ff1ea0890ea55685f28b7e9 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 1 Jul 2014 15:51:53 +0800
+Subject: [PATCH 28/49] perl, perl-native, perl-ptest: upgrade from 5.14.3 to
+ 5.20.0
+
 Upstream-Status:Inappropriate [embedded specific]
 
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- Makefile.SH |  145 +++++++++++++++++++++++++++--------------------------------
- 1 file changed, 67 insertions(+), 78 deletions(-)
 
-Index: perl-5.22.1/Makefile.SH
-===================================================================
---- perl-5.22.1.orig/Makefile.SH
-+++ perl-5.22.1/Makefile.SH
-@@ -39,10 +39,10 @@ case "$useshrplib" in
+---
+ Makefile.SH | 147 ++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 68 insertions(+), 79 deletions(-)
+
+diff --git a/Makefile.SH b/Makefile.SH
+index 916b332..b143d46 100755
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -48,10 +48,10 @@ case "$useshrplib" in
  true)
  	# Prefix all runs of 'miniperl' and 'perl' with
  	# $ldlibpth so that ./perl finds *this* shared libperl.
@@ -24,7 +31,7 @@
  
  	pldlflags="$cccdlflags"
  	static_ldflags=''
-@@ -122,10 +122,11 @@ true)
+@@ -131,10 +131,11 @@ true)
  	    *)
  		eval "ldlibpthval=\"\$$ldlibpthname\""
  
@@ -40,7 +47,7 @@
  
  		;;
  	    esac
-@@ -141,18 +142,7 @@ true)
+@@ -150,18 +151,7 @@ true)
  	    # INSTALL file, under "Building a shared perl library".
  	    # If there is no pre-existing $libperl, we don't need
  	    # to do anything further.
@@ -60,17 +67,13 @@
  	    ;;
  	os390)	test -f /bin/env && ldlibpth="/bin/env $ldlibpth"
  		;;
-@@ -566,13 +556,23 @@ splintfiles = $(c1)
+@@ -596,13 +586,23 @@ splintfiles = $(c1)
  	@echo `$(CCCMDSRC)` -S $*.c
  	@`$(CCCMDSRC)` -S $*.c
  
 -all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make $(MANIFEST_SRT)
 -	@echo " ";
 -	@echo "	Everything is up to date. Type '$(MAKE) test' to run test suite."
--
--$(MANIFEST_SRT):	MANIFEST $(PERL_EXE)
--	@$(RUN_PERL) Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
--	    $(RUN_PERL) Porting/manisort -q -o MANIFEST; sh -c true)
 +#all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make $(MANIFEST_SRT)
 +#	@echo " ";
 +#	@echo "	Everything is up to date. Type '$(MAKE) test' to run test suite."
@@ -80,7 +83,10 @@
 +more: $(generated_pods) $(private) $(public)
 +
 +more2: $(dynamic_ext)
-+
+ 
+-$(MANIFEST_SRT):	MANIFEST $(PERL_EXE)
+-	@$(RUN_PERL) Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
+-	    $(RUN_PERL) Porting/manisort -q -o MANIFEST; sh -c true)
 +more3: $(nonxs_ext)
 +
 +more4: extras.make $(MANIFEST_SRT)
@@ -91,7 +97,7 @@
  	@touch $(MANIFEST_SRT)
  
  .PHONY: all utilities
-@@ -581,7 +581,7 @@ $(MANIFEST_SRT):	MANIFEST $(PERL_EXE)
+@@ -611,7 +611,7 @@ $(MANIFEST_SRT):	MANIFEST $(PERL_EXE)
  # by make_patchnum.pl.
  git_version.h: lib/Config_git.pl
  
@@ -100,7 +106,7 @@
  	$(MINIPERL) make_patchnum.pl
  
  # make sure that we recompile perl.c if the git version changes
-@@ -594,7 +594,7 @@ perl$(OBJ_EXT): git_version.h
+@@ -624,7 +624,7 @@ perl$(OBJ_EXT): git_version.h
  # loading, we need to build perl first.
  case "$usedl$static_cwd" in
  defineundef)
@@ -109,7 +115,7 @@
      ;;
  definedefine)
      util_deps='$(PERL_EXE) $(CONFIGPM) FORCE'
-@@ -604,7 +604,7 @@ definedefine)
+@@ -634,7 +634,7 @@ definedefine)
  esac
  
  $spitshell >>$Makefile <<!GROK!THIS!
@@ -118,16 +124,16 @@
  	\$(MINIPERL) -Ilib utils/Makefile.PL
  
  utilities:	utils/Makefile $util_deps
-@@ -699,7 +699,7 @@ esac
- 
- 
+@@ -743,7 +743,7 @@ ext.libs: $(static_ext)
+ ;;
+ *)
  $spitshell >>$Makefile <<'!NO!SUBS!'
 -perlmain.c: $(MINIPERL_EXE) ext/ExtUtils-Miniperl/pm_to_blib
 +perlmain.c: ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
  	$(MINIPERL) -Ilib -MExtUtils::Miniperl -e 'writemain(\"perlmain.c", @ARGV)' DynaLoader $(static_ext)
  
  # The file ext.libs is a list of libraries that must be linked in
-@@ -760,7 +760,7 @@ PERLEXPORT		= perl.exp
+@@ -806,7 +806,7 @@ PERLEXPORT		= perl.exp
  	;;
  	esac
  	$spitshell >>$Makefile <<'!NO!SUBS!'
@@ -136,7 +142,7 @@
  	./$(MINIPERLEXP) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp
  
  !NO!SUBS!
-@@ -769,7 +769,7 @@ os2)
+@@ -815,7 +815,7 @@ os2)
  	$spitshell >>$Makefile <<'!NO!SUBS!'
  MINIPERLEXP		= miniperl
  
@@ -145,19 +151,19 @@
  	./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def
  
  !NO!SUBS!
-@@ -829,7 +829,7 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LI
+@@ -878,7 +878,7 @@ $(LIBPERL): $& $(perllib_objs) $(DYNALOADER) $(LIBPERLEXPORT)
  	true)
  		$spitshell >>$Makefile <<'!NO!SUBS!'
  	rm -f $@
--	$(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs)
-+	$(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -Wl,-soname,libperl.so.5
+-	$(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
++	$(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs) -Wl,-soname,libperl.so.5
  !NO!SUBS!
  		case "$osname" in
  		aix)
-@@ -877,7 +877,9 @@ $(MINIPERL_EXE): lib/buildcustomize.pl
+@@ -936,15 +936,19 @@ lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
  		$spitshell >>$Makefile <<'!NO!SUBS!'
- lib/buildcustomize.pl: $& $(mini_obj)
- 	$(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(mini_obj) $(libs)
+ lib/buildcustomize.pl: $& $(miniperl_objs)
+ 	$(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(miniperl_objs) $(libs)
 -	$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
 +	mv -f miniperl miniperl-target
 +	ln -s hostperl miniperl
@@ -165,21 +171,22 @@
  	$(MINIPERL) -f write_buildcustomize.pl
  !NO!SUBS!
  		;;
-@@ -885,7 +887,9 @@ lib/buildcustomize.pl: $& $(mini_obj)
+ 	next4*)
  		$spitshell >>$Makefile <<'!NO!SUBS!'
- lib/buildcustomize.pl: $& $(mini_obj) write    ldcustomize.pl
- 	$(CC) -o $(MINIPERL_EXE) $(mini_obj    libs)
+ lib/buildcustomize.pl: $& $(miniperl_objs) write    ldcustomize.pl
+-	$(CC) -o $(MINIPERL_EXE) $(miniperl_objs    libs)
 -	$(LDLIBPTH) ./miniperl$(HOST    _EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
++	$(CC) -o $(MINIPERL_EXE) $(miniperl_objs   libs)
 +	mv -f miniperl miniperl-target
 +	ln -s hostperl miniperl
 +	#$(LDLIBPTH) ./miniperl$(HOST    _EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
  	$(MINIPERL) -f write_buildcustomize.pl    
  !NO!SUBS!
  		;;
-@@ -907,7 +911,9 @@ lib/buildcustomize.pl: $& $(mini_obj) wr
+@@ -966,7 +970,9 @@ lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
  	-@rm -f miniperl.xok
  	$(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
- 	    $(mini_obj) $(libs)
+ 	    $(miniperl_objs) $(libs)
 -	$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
 +	mv -f miniperl miniperl-target
 +	ln -s hostperl miniperl
@@ -187,7 +194,7 @@
  	$(MINIPERL) -f write_buildcustomize.pl
  !NO!SUBS!
  		;;
-@@ -918,7 +924,9 @@ lib/buildcustomize.pl: \$& \$(mini_obj)
+@@ -977,7 +983,9 @@ lib/buildcustomize.pl: \$& \$(miniperl_objs) write_buildcustomize.pl
  	-@rm -f miniperl.xok
  	-@rm \$(MINIPERL_EXE)
  	\$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
@@ -198,10 +205,10 @@
  	\$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
  !GROK!THIS!
  		else
-@@ -927,7 +935,9 @@ lib/buildcustomize.pl: $& $(mini_obj) wr
+@@ -986,7 +994,9 @@ lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
  	-@rm -f miniperl.xok
  	$(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
- 	    $(mini_obj) $(libs)
+ 	    $(miniperl_objs) $(libs)
 -	$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
 +	mv -f miniperl miniperl-target
 +	ln -s hostperl miniperl
@@ -209,7 +216,7 @@
  	$(MINIPERL) -f write_buildcustomize.pl
  !NO!SUBS!
  		fi
-@@ -971,7 +981,7 @@ case "${osname}" in
+@@ -1036,7 +1046,7 @@ case "${osname}" in
  catamount)
  $spitshell >>$Makefile <<!GROK!THIS!
  .PHONY: makeppport
@@ -218,7 +225,7 @@
  	-@for f in Makefile.PL PPPort_pm.PL PPPort_xs.PL ppport_h.PL; do \
  	(cd ext/Devel-PPPort && `pwd`/run.sh ../../$(MINIPERL_EXE) -I../../lib \$\$f); \
  	done
-@@ -981,7 +991,7 @@ makeppport: \$(MINIPERL_EXE) \$(CONFIGPM
+@@ -1046,7 +1056,7 @@ makeppport: \$(MINIPERL_EXE) \$(CONFIGPM)
  *)
  $spitshell >>$Makefile <<'!NO!SUBS!'
  .PHONY: makeppport
@@ -227,7 +234,7 @@
  	$(MINIPERL) mkppport
  
  !NO!SUBS!
-@@ -991,16 +1001,16 @@ esac
+@@ -1056,16 +1066,16 @@ esac
  $spitshell >>$Makefile <<'!NO!SUBS!'
  
  .PHONY: preplibrary
@@ -247,7 +254,7 @@
  	$(MINIPERL) lib/unicore/mktables -C lib/unicore -P pod -maketest -makelist -p
  #	Commented out so always runs, mktables looks at far more files than we
  #	can in this makefile to decide if needs to run or not
-@@ -1009,12 +1019,12 @@ uni.data: $(MINIPERL_EXE) $(CONFIGPM) li
+@@ -1074,12 +1084,12 @@ uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
  # $(PERL_EXE) and ext because pod_lib.pl needs Digest::MD5
  # But also this ensures that all extensions are built before we try to scan
  # them, which picks up Devel::PPPort's documentation.
@@ -263,16 +270,16 @@
  	$(MINIPERL) autodoc.pl
  
  pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST
-@@ -1024,7 +1034,7 @@ pod/perl5221delta.pod: pod/perldelta.pod
- 	$(RMS) pod/perl5221delta.pod
- 	$(LNS) perldelta.pod pod/perl5221delta.pod
+@@ -1089,7 +1099,7 @@ pod/perl5240delta.pod: pod/perldelta.pod
+ 	$(RMS) pod/perl5240delta.pod
+ 	$(LNS) perldelta.pod pod/perl5240delta.pod
  
 -extra.pods: $(MINIPERL_EXE)
 +extra.pods:
  	-@test ! -f extra.pods || rm -f `cat extra.pods`
  	-@rm -f extra.pods
  	-@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
-@@ -1068,8 +1078,7 @@ EOT
+@@ -1133,8 +1143,7 @@ EOT
          $spitshell >>$Makefile <<EOT
  
  install_$name install-$name: \$(INSTALL_DEPENDENCE) installperl all installman
@@ -282,7 +289,7 @@
  EOT
      fi
  
-@@ -1079,11 +1088,7 @@ done
+@@ -1144,11 +1153,7 @@ done
  if test "X$hostperl" != X; then
  	$spitshell >>$Makefile <<'!NO!SUBS!'
  install.perl:	$(INSTALL_DEPENDENCE) installperl
@@ -295,7 +302,7 @@
  
  # XXX Experimental. Hardwired values, but useful for testing.
  # Eventually Configure could ask for some of these values.
-@@ -1101,24 +1106,8 @@ install.html: all installhtml
+@@ -1166,24 +1171,8 @@ install.html: all installhtml
  else
  	$spitshell >>$Makefile <<'!NO!SUBS!'
  install.perl:	$(INSTALL_DEPENDENCE) installperl
@@ -321,7 +328,7 @@
  !NO!SUBS!
  fi
  
-@@ -1210,13 +1199,13 @@ manicheck:	FORCE
+@@ -1275,13 +1264,13 @@ manicheck:	FORCE
  #
  # DynaLoader may be needed for extensions that use Makefile.PL.
  
@@ -338,7 +345,7 @@
  	$(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
  
  n_dummy $(nonxs_ext):	$(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE
-@@ -1405,14 +1394,14 @@ test_prep_pre: preplibrary utilities $(n
+@@ -1479,14 +1468,14 @@ test_prep_pre: preplibrary utilities $(nonxs_ext)
  
  case "$targethost" in
  '') $spitshell >>$Makefile <<'!NO!SUBS!'
@@ -355,7 +362,7 @@
  	\$(dynamic_ext) \$(TEST_PERL_DLL) runtests \
  	\$(generated_pods)
  	$to libperl.*
-@@ -1465,7 +1454,7 @@ test_prep test-prep: test_prep_pre \$(MI
+@@ -1539,7 +1528,7 @@ test_prep test-prep: test_prep_pre \$(MINIPERL_EXE) \$(unidatafiles) \$(PERL_EXE
  esac
  
  $spitshell >>$Makefile <<'!NO!SUBS!'
@@ -364,12 +371,15 @@
  	$(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
  	cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
  !NO!SUBS!
-@@ -1526,7 +1515,7 @@ minitest_prep:
+@@ -1600,7 +1589,7 @@ minitest_prep:
  
  MINITEST_TESTS = base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t
  
 -minitest: $(MINIPERL_EXE) minitest_prep
 +minitest: minitest_prep
- 	- cd t && $(RUN_PERL) TEST $(MINITEST_TESTS) </dev/tty
+ 	- cd t && $(RUN_PERL) TEST $(MINITEST_TESTS) <$(devtty)
  
  minitest-notty minitest_notty: $(MINIPERL_EXE) minitest_prep
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh
index b2a7f2c..4657673 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh
@@ -14,7 +14,7 @@
 
 : Configure command line arguments.
 config_arg0='Configure'
-config_args='-des -Doptimize=-O2 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Open Embedded -Dinstallprefix=@EXECPREFIX@ -Dprefix=@EXECPREFIX@ -Dvendorprefix=@EXECPREFIX@ -Dsiteprefix=@EXECPREFIX@ -Dotherlibdirs=@LIBDIR@/perl/5.22.1 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Ud_dosuid -Dd_semctl_semun -Ui_db -Ui_ndbm -Ui_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=@USRBIN@/less -isr'
+config_args='-des -Doptimize=-O2 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Open Embedded -Dinstallprefix=@EXECPREFIX@ -Dprefix=@EXECPREFIX@ -Dvendorprefix=@EXECPREFIX@ -Dsiteprefix=@EXECPREFIX@ -Dotherlibdirs=@LIBDIR@/perl/5.24.1 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Ud_dosuid -Dd_semctl_semun -Ui_db -Ui_ndbm -Ui_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=@USRBIN@/less -isr'
 config_argc=28
 config_arg1='-des'
 config_arg2='-Doptimize=-O2'
@@ -26,7 +26,7 @@
 config_arg8='-Dprefix=@EXECPREFIX@'
 config_arg9='-Dvendorprefix=@EXECPREFIX@'
 config_arg10='-Dsiteprefix=@EXECPREFIX@'
-config_arg11='-Dotherlibdirs=@LIBDIR@/perl/5.22.1'
+config_arg11='-Dotherlibdirs=@LIBDIR@/perl/5.24.1'
 config_arg12='-Duseshrplib'
 config_arg13='-Dusethreads'
 config_arg14='-Duseithreads'
@@ -64,13 +64,13 @@
 ansi2knr=''
 aphostname=''
 api_revision='5'
-api_subversion='0'
-api_version='22'
-api_versionstring='5.22.0'
+api_subversion='1'
+api_version='24'
+api_versionstring='5.24.1'
 ar='ar'
-archlib='@LIBDIR@/perl/5.22.1/@ARCH@-thread-multi'
-archlibexp='@STAGINGDIR@@LIBDIR@/perl/5.22.1/@ARCH@-thread-multi'
-archlib_exp='@LIBDIR@/perl/5.22.1/@ARCH@-thread-multi'
+archlib='@LIBDIR@/perl/5.24.1/@ARCH@-thread-multi'
+archlibexp='@STAGINGDIR@@LIBDIR@/perl/5.24.1/@ARCH@-thread-multi'
+archlib_exp='@LIBDIR@/perl/5.24.1/@ARCH@-thread-multi'
 archname64=''
 archname='@ARCH@-thread-multi'
 archobjs=''
@@ -88,7 +88,7 @@
 cat='cat'
 cc='gcc'
 cccdlflags='-fPIC'
-ccdlflags='-Wl,-E -Wl,-rpath,@LIBDIR@/perl/5.22.1/@ARCH@-thread-multi/CORE'
+ccdlflags='-Wl,-E -Wl,-rpath,@LIBDIR@/perl/5.24.1/@ARCH@-thread-multi/CORE'
 ccflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
 ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 ccname='gcc'
@@ -648,11 +648,15 @@
 direntrytype='struct dirent'
 dlext='so'
 dlsrc='dl_dlopen.xs'
+doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
 doublekind='3'
+doublemantbits='52'
+doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff'
 doublesize='8'
 drand01='Perl_drand48()'
 drand48_r_proto='REENTRANT_PROTO_I_ST'
 dtrace=''
+dtraceobject=''
 dynamic_ext='B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate XS/APItest XS/Typemap arybase attributes mro re threads threads/shared'
 eagain='EAGAIN'
 ebcdic='undef'
@@ -834,7 +838,7 @@
 incpath=''
 inews=''
 initialinstalllocation='@USRBIN@'
-installarchlib='@LIBDIR@/perl/5.22.1/@ARCH@-thread-multi'
+installarchlib='@LIBDIR@/perl/5.24.1/@ARCH@-thread-multi'
 installbin='@USRBIN@'
 installhtml1dir=''
 installhtml3dir=''
@@ -842,23 +846,23 @@
 installman3dir=''
 installprefix='@EXECPREFIX@'
 installprefixexp='@EXECPREFIX@'
-installprivlib='@LIBDIR@/perl/5.22.1'
+installprivlib='@LIBDIR@/perl/5.24.1'
 installscript='@USRBIN@'
-installsitearch='@LIBDIR@/perl/site_perl/5.22.1/@ARCH@-thread-multi'
+installsitearch='@LIBDIR@/perl/site_perl/5.24.1/@ARCH@-thread-multi'
 installsitebin='@USRBIN@'
 installsitehtml1dir=''
 installsitehtml3dir=''
-installsitelib='@LIBDIR@/perl/site_perl/5.22.1'
+installsitelib='@LIBDIR@/perl/site_perl/5.24.1'
 installsiteman1dir=''
 installsiteman3dir=''
 installsitescript='@USRBIN@'
 installstyle='lib/perl'
 installusrbinperl='define'
-installvendorarch='@LIBDIR@/perl/vendor_perl/5.22.1/@ARCH@-thread-multi'
+installvendorarch='@LIBDIR@/perl/vendor_perl/5.24.1/@ARCH@-thread-multi'
 installvendorbin='@USRBIN@'
 installvendorhtml1dir=''
 installvendorhtml3dir=''
-installvendorlib='@LIBDIR@/perl/vendor_perl/5.22.1'
+installvendorlib='@LIBDIR@/perl/vendor_perl/5.24.1'
 installvendorman1dir=''
 installvendorman3dir=''
 installvendorscript='@USRBIN@'
@@ -895,7 +899,10 @@
 localtime_r_proto='REENTRANT_PROTO_S_TS'
 locincpth='@EXECPREFIX@/local/include /opt/local/include @EXECPREFIX@/gnu/include /opt/gnu/include @EXECPREFIX@/GNU/include /opt/GNU/include'
 loclibpth='@EXECPREFIX@/local@BASELIBDIR@ /opt/local@BASELIBDIR@ @EXECPREFIX@/gnu@BASELIBDIR@ /opt/gnu@BASELIBDIR@ @EXECPREFIX@/GNU@BASELIBDIR@ /opt/GNU@BASELIBDIR@'
+longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
 longdblkind='3'
+longdblmantbits='64'
+longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x32, 0xf7'
 longdblsize='16'
 longlongsize='8'
 longsize='8'
@@ -948,6 +955,7 @@
 nveformat='"e"'
 nvfformat='"f"'
 nvgformat='"g"'
+nvmantbits='52'
 nvsize='8'
 nvtype='double'
 o_nonblock='O_NONBLOCK'
@@ -957,11 +965,11 @@
 orderlib='false'
 osname='linux'
 osvers='3.19.5-yocto-standard'
-otherlibdirs='@LIBDIR@/perl/5.22.1'
+otherlibdirs='@LIBDIR@/perl/5.24.1'
 package='perl'
 pager='/usr/bin/less -isr'
 passcat='cat /etc/passwd'
-patchlevel='22'
+patchlevel='24'
 path_sep=':'
 perl5='@USRBIN@/perl'
 perl='perl'
@@ -978,8 +986,8 @@
 pr=''
 prefix='@EXECPREFIX@'
 prefixexp='@EXECPREFIX@'
-privlib='@LIBDIR@/perl/5.22.1'
-privlibexp='@LIBDIR@/perl/5.22.1'
+privlib='@LIBDIR@/perl/5.24.1'
+privlibexp='@LIBDIR@/perl/5.24.1'
 procselfexe='"/proc/self/exe"'
 prototype='define'
 ptrsize='8'
@@ -1045,17 +1053,17 @@
 sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 6, 17, 29, 31, 0'
 sig_size='69'
 signal_t='void'
-sitearch='@LIBDIR@/perl/site_perl/5.22.1/@ARCH@-thread-multi'
-sitearchexp='@LIBDIR@/perl/site_perl/5.22.1/@ARCH@-thread-multi'
+sitearch='@LIBDIR@/perl/site_perl/5.24.1/@ARCH@-thread-multi'
+sitearchexp='@LIBDIR@/perl/site_perl/5.24.1/@ARCH@-thread-multi'
 sitebin='@USRBIN@'
 sitebinexp='@USRBIN@'
 sitehtml1dir=''
 sitehtml1direxp=''
 sitehtml3dir=''
 sitehtml3direxp=''
-sitelib='@LIBDIR@/perl/site_perl/5.22.1'
+sitelib='@LIBDIR@/perl/site_perl/5.24.1'
 sitelib_stem='@LIBDIR@/perl/site_perl'
-sitelibexp='@LIBDIR@/perl/site_perl/5.22.1'
+sitelibexp='@LIBDIR@/perl/site_perl/5.24.1'
 siteman1dir=''
 siteman1direxp=''
 siteman3dir=''
@@ -1094,7 +1102,7 @@
 strerror_r_proto='REENTRANT_PROTO_B_IBW'
 strings='@INCLUDEDIR@/string.h'
 submit=''
-subversion='0'
+subversion='1'
 sysman='@EXECPREFIX@/share/man/man1'
 sysroot=''
 tail=''
@@ -1134,8 +1142,8 @@
 uniq='uniq'
 uquadtype='unsigned long'
 use5005threads='undef'
-use64bitall='define'
-use64bitint='define'
+use64bitall='undef'
+use64bitint='undef'
 usecbacktrace='undef'
 usecrosscompile='define'
 usedevel='undef'
@@ -1174,17 +1182,17 @@
 uvuformat='"lu"'
 uvxformat='"lx"'
 vaproto='define'
-vendorarch='@LIBDIR@/perl/vendor_perl/5.22.1/@ARCH@-thread-multi'
-vendorarchexp='@LIBDIR@/perl/vendor_perl/5.22.1/@ARCH@-thread-multi'
+vendorarch='@LIBDIR@/perl/vendor_perl/5.24.1/@ARCH@-thread-multi'
+vendorarchexp='@LIBDIR@/perl/vendor_perl/5.24.1/@ARCH@-thread-multi'
 vendorbin='@USRBIN@'
 vendorbinexp='@USRBIN@'
 vendorhtml1dir=' '
 vendorhtml1direxp=''
 vendorhtml3dir=' '
 vendorhtml3direxp=''
-vendorlib='@LIBDIR@/perl/vendor_perl/5.22.1'
+vendorlib='@LIBDIR@/perl/vendor_perl/5.24.1'
 vendorlib_stem='@LIBDIR@/perl/vendor_perl'
-vendorlibexp='@LIBDIR@/perl/vendor_perl/5.22.1'
+vendorlibexp='@LIBDIR@/perl/vendor_perl/5.24.1'
 vendorman1dir=' '
 vendorman1direxp=''
 vendorman3dir=' '
@@ -1193,8 +1201,8 @@
 vendorprefixexp='@EXECPREFIX@'
 vendorscript='@USRBIN@'
 vendorscriptexp='@USRBIN@'
-version='5.22.1'
-version_patchlevel_string='version 22 subversion 1'
+version='5.24.1'
+version_patchlevel_string='version 24 subversion 1'
 versiononly='undef'
 vi=''
 xlibpth='@LIBDIR@/386 @BASELIBDIR@386'
@@ -1203,11 +1211,11 @@
 zcat=''
 zip='zip'
 PERL_REVISION=5
-PERL_VERSION=22
+PERL_VERSION=24
 PERL_SUBVERSION=1
 PERL_API_REVISION=5
-PERL_API_VERSION=22
-PERL_API_SUBVERSION=0
+PERL_API_VERSION=24
+PERL_API_SUBVERSION=1
 PERL_PATCHLEVEL=''
 PERL_CONFIG_SH=true
 : Variables propagated from previous config.sh file.
@@ -1219,3 +1227,23 @@
 d_clock_getres='define'
 d_clock='define'
 d_nanosleep='define'
+
+# for Signinfo
+d_siginfo_si_errno='define'
+d_siginfo_si_pid='define'
+d_siginfo_si_uid='define'
+d_siginfo_si_addr='define'
+d_siginfo_si_status='define'
+d_siginfo_si_band='define'
+d_siginfo_si_value='define'
+
+# don't support fdclose
+d_fdclose='undef'
+
+# support memmem
+d_memmem='define'
+
+# for locale
+d_newlocale='define'
+d_freelocale='define'
+d_uselocale='define'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff
index bcb59c6..3d09229 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff
@@ -1,8 +1,8 @@
-From 827eee225897c35ec97194a5971bf4bfcf250748 Mon Sep 17 00:00:00 2001
+From 8e1efba7560d8d55524c7a0f1b0539ddce419b86 Mon Sep 17 00:00:00 2001
 From: Brendan O'Dea <bod@debian.org>
 Date: Fri, 16 Dec 2005 01:32:14 +1100
-Subject: Remove Errno version check due to upgrade problems with long-running
- processes.
+Subject: [PATCH 6/8] Remove Errno version check due to upgrade problems with
+ long-running processes.
 
 Bug-Debian: http://bugs.debian.org/343351
 
@@ -11,25 +11,27 @@
 compatible, but built on a different machine.
 
 Patch-Name: debian/errno_ver.diff
+
 ---
  ext/Errno/Errno_pm.PL | 5 -----
  1 file changed, 5 deletions(-)
 
 diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
-index c6bfa06..519e5c7 100644
+index 6251a3c..eeed445 100644
 --- a/ext/Errno/Errno_pm.PL
 +++ b/ext/Errno/Errno_pm.PL
-@@ -278,13 +278,8 @@ sub write_errno_pm {
- 
- package Errno;
- require Exporter;
+@@ -294,11 +294,6 @@ EDQ
+     # they've already declared perl doesn't need to worry about this risk.
+     if(!$ENV{'PERL_BUILD_EXPAND_CONFIG_VARS'}) {
+         print <<"CONFIG_CHECK_END";
 -use Config;
- use strict;
- 
 -"\$Config{'archname'}-\$Config{'osvers'}" eq
 -"$archname-$Config{'osvers'}" or
 -	die "Errno architecture ($archname-$Config{'osvers'}) does not match executable architecture (\$Config{'archname'}-\$Config{'osvers'})";
 -
- our \$VERSION = "$VERSION";
- \$VERSION = eval \$VERSION;
- our \@ISA = 'Exporter';
+ CONFIG_CHECK_END
+ }
+ 
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff
index b4443f6..d153e0e 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff
@@ -1,7 +1,8 @@
-From 21bc033755f0b609f9bb2aa9e98b10d58424406f Mon Sep 17 00:00:00 2001
+From c4538f966c49e356599358def7d1febf61bca21f Mon Sep 17 00:00:00 2001
 From: Brendan O'Dea <bod@debian.org>
 Date: Fri, 18 Mar 2005 22:22:25 +1100
-Subject: Prune the list of libraries wanted to what we actually need.
+Subject: [PATCH 15/49] Prune the list of libraries wanted to what we actually
+ need.
 
 Bug-Debian: http://bugs.debian.org/128355
 
@@ -9,25 +10,26 @@
 and some of the original list may be present on buildds (see Bug#128355).
 
 Patch-Name: debian/prune_libs.diff
+
 ---
  Configure | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
 
 diff --git a/Configure b/Configure
-index 0a405d3..6fcc3bc 100755
+index 5a353d6..a00df64 100755
 --- a/Configure
 +++ b/Configure
-@@ -1454,8 +1454,7 @@ libswanted_uselargefiles=''
- : set usesocks on the Configure command line to enable socks.
+@@ -1479,8 +1479,7 @@ archname=''
+ usereentrant='undef'
  : List of libraries we want.
  : If anyone needs extra -lxxx, put those in a hint file.
--libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
+-libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
 -libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
 +libswanted='gdbm gdbm_compat db dl m c crypt'
  : We probably want to search /usr/shlib before most other libraries.
  : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
  glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
-@@ -23593,7 +23592,7 @@ sunos*X4*)
+@@ -24007,7 +24006,7 @@ sunos*X4*)
      ;;
  *) case "$usedl" in
      $define|true|[yY]*)
@@ -36,3 +38,6 @@
  	    shift
  	    perllibs="$*"
  	    ;;
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch
index 3df5933..719f07c 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch
@@ -1,3 +1,8 @@
+From 2e0ce5d27e70defd66ace0661af7c24daae34f8b Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Sat, 19 Jan 2013 23:49:24 +0000
+Subject: [PATCH 7/8] perl: Add dyanloader build hack
+
 Hack the dynamic module loader so that we use native modules since we can't load
 the target ones.
 
@@ -6,14 +11,18 @@
 RP
 2013/01/13
 
-Index: perl-5.14.2/ext/DynaLoader/DynaLoader_pm.PL
-===================================================================
---- perl-5.14.2.orig/ext/DynaLoader/DynaLoader_pm.PL	2011-09-19 13:18:22.000000000 +0000
-+++ perl-5.14.2/ext/DynaLoader/DynaLoader_pm.PL	2013-01-19 16:09:51.020584945 +0000
-@@ -310,6 +310,10 @@
+---
+ ext/DynaLoader/DynaLoader_pm.PL | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
+index e828f35..4021559 100644
+--- a/ext/DynaLoader/DynaLoader_pm.PL
++++ b/ext/DynaLoader/DynaLoader_pm.PL
+@@ -343,6 +343,10 @@ sub bootstrap {
      foreach (@INC) {
  	<<$^O-eq-VMS>>chop($_ = VMS::Filespec::unixpath($_));<</$^O-eq-VMS>>
- 	    my $dir = "$_/auto/$modpname";
+ 	    $dir = "$_/auto/$modpname";
 +
 +	if (defined $ENV{PERL_LIB} and defined $ENV{PERLHOSTLIB}) {
 +	    $dir =~ s/$ENV{PERL_LIB}/$ENV{PERLHOSTLIB}/g;
@@ -21,3 +30,6 @@
  	
  	next unless -d $dir; # skip over uninteresting directories
  	
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2015-8607.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2015-8607.patch
deleted file mode 100644
index 7b4a001..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2015-8607.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 652c8d4852a69f1bb4d387946f9b76350a1f0d0e Mon Sep 17 00:00:00 2001
-From: Tony Cook <tony@develop-help.com>
-Date: Tue, 15 Dec 2015 10:56:54 +1100
-Subject: [PATCH] perl: fix CVE-2015-8607
-
-ensure File::Spec::canonpath() preserves taint
-
-Previously the unix specific XS implementation of canonpath() would
-return an untainted path when supplied a tainted path.
-
-For the empty string case, newSVpvs() already sets taint as needed on
-its result.
-
-This issue was assigned CVE-2015-8607.  [perl #126862]
-
-Backport patch from http://perl5.git.perl.org/perl.git/commitdiff/0b6f93036de171c12ba95d415e264d9cf7f4e1fd
-
-Upstream-Status: Backport
-CVE: CVE-2015-8607
-Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
----
- dist/PathTools/Cwd.xs    |  1 +
- dist/PathTools/t/taint.t | 19 ++++++++++++++++++-
- 2 files changed, 19 insertions(+), 1 deletion(-)
-
-diff --git a/dist/PathTools/Cwd.xs b/dist/PathTools/Cwd.xs
-index 9d4dcf0..3d018dc 100644
---- a/dist/PathTools/Cwd.xs
-+++ b/dist/PathTools/Cwd.xs
-@@ -535,6 +535,7 @@ THX_unix_canonpath(pTHX_ SV *path)
-     *o = 0;
-     SvPOK_on(retval);
-     SvCUR_set(retval, o - SvPVX(retval));
-+    SvTAINT(retval);
-     return retval;
- }
- 
-diff --git a/dist/PathTools/t/taint.t b/dist/PathTools/t/taint.t
-index 309b3e5..48f8c5b 100644
---- a/dist/PathTools/t/taint.t
-+++ b/dist/PathTools/t/taint.t
-@@ -12,7 +12,7 @@ use Test::More;
- BEGIN {
-     plan(
-         ${^TAINT}
--        ? (tests => 17)
-+        ? (tests => 21)
-         : (skip_all => "A perl without taint support")
-     );
- }
-@@ -34,3 +34,20 @@ foreach my $func (@Functions) {
- 
- # Previous versions of Cwd tainted $^O
- is !tainted($^O), 1, "\$^O should not be tainted";
-+
-+{
-+    # [perl #126862] canonpath() loses taint
-+    my $tainted = substr($ENV{PATH}, 0, 0);
-+    # yes, getcwd()'s result should be tainted, and is tested above
-+    # but be sure
-+    ok tainted(File::Spec->canonpath($tainted . Cwd::getcwd)),
-+        "canonpath() keeps taint on non-empty string";
-+    ok tainted(File::Spec->canonpath($tainted)),
-+        "canonpath() keeps taint on empty string";
-+
-+    (Cwd::getcwd() =~ /^(.*)/);
-+    my $untainted = $1;
-+    ok !tainted($untainted), "make sure our untainted value is untainted";
-+    ok !tainted(File::Spec->canonpath($untainted)),
-+        "canonpath() doesn't add taint to untainted string";
-+}
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2016-1238.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2016-1238.patch
deleted file mode 100644
index 730ef17..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2016-1238.patch
+++ /dev/null
@@ -1,352 +0,0 @@
-From 9987be3d24286d96d9dccec0433253ee8ad894b4 Mon Sep 17 00:00:00 2001
-From: Tony Cook <tony@develop-help.com>
-Date: Tue, 21 Jun 2016 10:02:02 +1000
-Subject: [PATCH] perl: fix CVE-2016-1238
-
-(perl #127834) remove . from the end of @INC if complex modules are loaded
-
-While currently Encode and Storable are know to attempt to load modules
-not included in the core, updates to other modules may lead to those
-also attempting to load new modules, so be safe and remove . for those
-as well.
-
-Backport patch from http://perl5.git.perl.org/perl.git/commitdiff/cee96d52c39b1e7b36e1c62d38bcd8d86e9a41ab
-
-Upstream-Status: Backport
-CVE: CVE-2016-1238
-Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
----
- cpan/Archive-Tar/bin/ptar                 | 1 +
- cpan/Archive-Tar/bin/ptardiff             | 1 +
- cpan/Archive-Tar/bin/ptargrep             | 1 +
- cpan/CPAN/scripts/cpan                    | 1 +
- cpan/Digest-SHA/shasum                    | 1 +
- cpan/Encode/bin/enc2xs                    | 1 +
- cpan/Encode/bin/encguess                  | 1 +
- cpan/Encode/bin/piconv                    | 1 +
- cpan/Encode/bin/ucmlint                   | 1 +
- cpan/Encode/bin/unidump                   | 1 +
- cpan/ExtUtils-MakeMaker/bin/instmodsh     | 1 +
- cpan/IO-Compress/bin/zipdetails           | 1 +
- cpan/JSON-PP/bin/json_pp                  | 1 +
- cpan/Test-Harness/bin/prove               | 1 +
- dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp | 1 +
- dist/Module-CoreList/corelist             | 1 +
- ext/Pod-Html/bin/pod2html                 | 1 +
- utils/c2ph.PL                             | 1 +
- utils/h2ph.PL                             | 2 ++
- utils/h2xs.PL                             | 2 ++
- utils/libnetcfg.PL                        | 1 +
- utils/perlbug.PL                          | 1 +
- utils/perldoc.PL                          | 5 ++++-
- utils/perlivp.PL                          | 2 ++
- utils/splain.PL                           | 6 ++++++
- 25 files changed, 36 insertions(+), 1 deletion(-)
-
-diff --git a/cpan/Archive-Tar/bin/ptar b/cpan/Archive-Tar/bin/ptar
-index 0eaffa7..9dc6402 100644
---- a/cpan/Archive-Tar/bin/ptar
-+++ b/cpan/Archive-Tar/bin/ptar
-@@ -1,6 +1,7 @@
- #!/usr/bin/perl
- use strict;
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use File::Find;
- use Getopt::Std;
- use Archive::Tar;
-diff --git a/cpan/Archive-Tar/bin/ptardiff b/cpan/Archive-Tar/bin/ptardiff
-index 66bd859..4668fa6 100644
---- a/cpan/Archive-Tar/bin/ptardiff
-+++ b/cpan/Archive-Tar/bin/ptardiff
-@@ -1,5 +1,6 @@
- #!/usr/bin/perl
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use Archive::Tar;
- use Getopt::Std;
-diff --git a/cpan/Archive-Tar/bin/ptargrep b/cpan/Archive-Tar/bin/ptargrep
-index 1a320f1..8dc6b4f 100644
---- a/cpan/Archive-Tar/bin/ptargrep
-+++ b/cpan/Archive-Tar/bin/ptargrep
-@@ -4,6 +4,7 @@
- # archive.  See 'ptargrep --help' for more documentation.
- #
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use warnings;
- 
-diff --git a/cpan/CPAN/scripts/cpan b/cpan/CPAN/scripts/cpan
-index 5f4320e..ccba47e 100644
---- a/cpan/CPAN/scripts/cpan
-+++ b/cpan/CPAN/scripts/cpan
-@@ -1,5 +1,6 @@
- #!/usr/local/bin/perl
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use vars qw($VERSION);
- 
-diff --git a/cpan/Digest-SHA/shasum b/cpan/Digest-SHA/shasum
-index 14ddd60..62a2b0e 100644
---- a/cpan/Digest-SHA/shasum
-+++ b/cpan/Digest-SHA/shasum
-@@ -13,6 +13,7 @@
- 	## "-0" option for reading bit strings, and
- 	## "-p" option for portable digests (to be deprecated).
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use warnings;
- use Fcntl;
-diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs
-index 4d64e38..473a15c 100644
---- a/cpan/Encode/bin/enc2xs
-+++ b/cpan/Encode/bin/enc2xs
-@@ -4,6 +4,7 @@ BEGIN {
-     # with $ENV{PERL_CORE} set
-     # In case we need it in future...
-     require Config; import Config;
-+    pop @INC if $INC[-1] eq '.';
- }
- use strict;
- use warnings;
-diff --git a/cpan/Encode/bin/encguess b/cpan/Encode/bin/encguess
-index 5d7ac80..0be5c7c 100644
---- a/cpan/Encode/bin/encguess
-+++ b/cpan/Encode/bin/encguess
-@@ -1,5 +1,6 @@
- #!./perl
- use 5.008001;
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use warnings;
- use Encode;
-diff --git a/cpan/Encode/bin/piconv b/cpan/Encode/bin/piconv
-index c1dad9e..60b2a59 100644
---- a/cpan/Encode/bin/piconv
-+++ b/cpan/Encode/bin/piconv
-@@ -1,6 +1,7 @@
- #!./perl
- # $Id: piconv,v 2.7 2014/05/31 09:48:48 dankogai Exp $
- #
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use 5.8.0;
- use strict;
- use Encode ;
-diff --git a/cpan/Encode/bin/ucmlint b/cpan/Encode/bin/ucmlint
-index 622376d..25e0d67 100644
---- a/cpan/Encode/bin/ucmlint
-+++ b/cpan/Encode/bin/ucmlint
-@@ -3,6 +3,7 @@
- # $Id: ucmlint,v 2.2 2008/03/12 09:51:11 dankogai Exp $
- #
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- our  $VERSION = do { my @r = (q$Revision: 2.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
- 
-diff --git a/cpan/Encode/bin/unidump b/cpan/Encode/bin/unidump
-index ae0da30..f190827 100644
---- a/cpan/Encode/bin/unidump
-+++ b/cpan/Encode/bin/unidump
-@@ -1,5 +1,6 @@
- #!./perl
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use Encode;
- use Getopt::Std;
-diff --git a/cpan/ExtUtils-MakeMaker/bin/instmodsh b/cpan/ExtUtils-MakeMaker/bin/instmodsh
-index e551434..b3b109f 100644
---- a/cpan/ExtUtils-MakeMaker/bin/instmodsh
-+++ b/cpan/ExtUtils-MakeMaker/bin/instmodsh
-@@ -1,5 +1,6 @@
- #!/usr/bin/perl -w
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use IO::File;
- use ExtUtils::Packlist;
-diff --git a/cpan/IO-Compress/bin/zipdetails b/cpan/IO-Compress/bin/zipdetails
-index 0249850..1b9c70a 100644
---- a/cpan/IO-Compress/bin/zipdetails
-+++ b/cpan/IO-Compress/bin/zipdetails
-@@ -5,6 +5,7 @@
- # Display info on the contents of a Zip file
- #
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use warnings ;
- 
-diff --git a/cpan/JSON-PP/bin/json_pp b/cpan/JSON-PP/bin/json_pp
-index df9d243..896cd2f 100644
---- a/cpan/JSON-PP/bin/json_pp
-+++ b/cpan/JSON-PP/bin/json_pp
-@@ -1,5 +1,6 @@
- #!/usr/bin/perl
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use Getopt::Long;
- 
-diff --git a/cpan/Test-Harness/bin/prove b/cpan/Test-Harness/bin/prove
-index 6637cc4..d71b238 100644
---- a/cpan/Test-Harness/bin/prove
-+++ b/cpan/Test-Harness/bin/prove
-@@ -1,5 +1,6 @@
- #!/usr/bin/perl -w
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use warnings;
- use App::Prove;
-diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp b/dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp
-index e2ac71a..d596cdf 100644
---- a/dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp
-+++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp
-@@ -1,5 +1,6 @@
- #!perl
- use 5.006;
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- eval {
-   require ExtUtils::ParseXS;
-diff --git a/dist/Module-CoreList/corelist b/dist/Module-CoreList/corelist
-index aa4a945..bbe61cc 100644
---- a/dist/Module-CoreList/corelist
-+++ b/dist/Module-CoreList/corelist
-@@ -130,6 +130,7 @@ requested perl versions.
- 
- =cut
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use Module::CoreList;
- use Getopt::Long qw(:config no_ignore_case);
- use Pod::Usage;
-diff --git a/ext/Pod-Html/bin/pod2html b/ext/Pod-Html/bin/pod2html
-index b022859..7d1d232 100644
---- a/ext/Pod-Html/bin/pod2html
-+++ b/ext/Pod-Html/bin/pod2html
-@@ -216,6 +216,7 @@ This program is distributed under the Artistic License.
- 
- =cut
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use Pod::Html;
- 
- pod2html @ARGV;
-diff --git a/utils/c2ph.PL b/utils/c2ph.PL
-index 13389ec..cef0b5c 100644
---- a/utils/c2ph.PL
-+++ b/utils/c2ph.PL
-@@ -280,6 +280,7 @@ Anyway, here it is.  Should run on perl v4 or greater.  Maybe less.
- 
- $RCSID = '$Id: c2ph,v 1.7 95/10/28 10:41:47 tchrist Exp Locker: tchrist $';
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use File::Temp;
- 
- ######################################################################
-diff --git a/utils/h2ph.PL b/utils/h2ph.PL
-index 55c1f72..300b756 100644
---- a/utils/h2ph.PL
-+++ b/utils/h2ph.PL
-@@ -36,6 +36,8 @@ $Config{startperl}
- 
- print OUT <<'!NO!SUBS!';
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
-+
- use strict;
- 
- use Config;
-diff --git a/utils/h2xs.PL b/utils/h2xs.PL
-index 268f680..f95ee0c 100644
---- a/utils/h2xs.PL
-+++ b/utils/h2xs.PL
-@@ -35,6 +35,8 @@ $Config{startperl}
- 
- print OUT <<'!NO!SUBS!';
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
-+
- use warnings;
- 
- =head1 NAME
-diff --git a/utils/libnetcfg.PL b/utils/libnetcfg.PL
-index 59a2de8..26d2f99 100644
---- a/utils/libnetcfg.PL
-+++ b/utils/libnetcfg.PL
-@@ -97,6 +97,7 @@ Jarkko Hietaniemi, conversion into libnetcfg for inclusion into Perl 5.8.
- 
- # $Id: Configure,v 1.8 1997/03/04 09:22:32 gbarr Exp $
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use strict;
- use IO::File;
- use Getopt::Std;
-diff --git a/utils/perlbug.PL b/utils/perlbug.PL
-index 885785a..ae8c343 100644
---- a/utils/perlbug.PL
-+++ b/utils/perlbug.PL
-@@ -57,6 +57,7 @@ print OUT <<'!NO!SUBS!';
- my @patches = Config::local_patches();
- my $patch_tags = join "", map /(\S+)/ ? "+$1 " : (), @patches;
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
- use warnings;
- use strict;
- use Config;
-diff --git a/utils/perldoc.PL b/utils/perldoc.PL
-index e201de9..cd60bd4 100644
---- a/utils/perldoc.PL
-+++ b/utils/perldoc.PL
-@@ -44,7 +44,10 @@ $Config{startperl}
- # This "$file" file was generated by "$0"
- 
- require 5;
--BEGIN { \$^W = 1 if \$ENV{'PERLDOCDEBUG'} }
-+BEGIN {
-+    \$^W = 1 if \$ENV{'PERLDOCDEBUG'};
-+    pop \@INC if \$INC[-1] eq '.';
-+}
- use Pod::Perldoc;
- exit( Pod::Perldoc->run() );
- 
-diff --git a/utils/perlivp.PL b/utils/perlivp.PL
-index cc49f96..696a44e 100644
---- a/utils/perlivp.PL
-+++ b/utils/perlivp.PL
-@@ -39,6 +39,8 @@ print OUT "\n# perlivp $^V\n";
- 
- print OUT <<'!NO!SUBS!';
- 
-+BEGIN { pop @INC if $INC[-1] eq '.' }
-+
- sub usage {
-     warn "@_\n" if @_;
-     print << "    EOUSAGE";
-diff --git a/utils/splain.PL b/utils/splain.PL
-index 9c70b61..cae84a0 100644
---- a/utils/splain.PL
-+++ b/utils/splain.PL
-@@ -38,6 +38,12 @@ $Config{startperl}
- 	if \$running_under_some_shell;
- !GROK!THIS!
- 
-+print <<'!NO!SUBS!';
-+
-+BEGIN { pop @INC if $INC[-1] eq '.' }
-+
-+!NO!SUBS!
-+
- while (<IN>) {
-     print OUT unless /^package diagnostics/;
- }
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2016-2381.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2016-2381.patch
deleted file mode 100644
index 99fa8d9..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2016-2381.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-CVE: CVE-2016-2381
-Upstream-Status: Backport
-
-Backport patch to fix CVE-2016-2381 from
-
-http://perl5.git.perl.org/perl.git/commitdiff/ae37b791a73a9e78dedb89fb2429d2628cf58076
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From: Tony Cook <tony@develop-help.com>
-Date: Wed, 27 Jan 2016 00:52:15 +0000 (+1100)
-Subject: remove duplicate environment variables from environ
-X-Git-Tag: v5.23.9~170
-X-Git-Url: http://perl5.git.perl.org/perl.git/commitdiff_plain/ae37b791a73a9e78dedb89fb2429d2628cf58076
-
-remove duplicate environment variables from environ
-
-If we see duplicate environment variables while iterating over
-environ[]:
-
-a) make sure we use the same value in %ENV that getenv() returns.
-
-Previously on a duplicate, %ENV would have the last entry for the name
-from environ[], but a typical getenv() would return the first entry.
-
-Rather than assuming all getenv() implementations return the first entry
-explicitly call getenv() to ensure they agree.
-
-b) remove duplicate entries from environ
-
-Previously if there was a duplicate definition for a name in environ[]
-setting that name in %ENV could result in an unsafe value being passed
-to a child process, so ensure environ[] has no duplicates.
-
-CVE-2016-2381
----
-
-diff --git a/perl.c b/perl.c
-index 4a324c6..5c71fd0 100644
---- a/perl.c
-+++ b/perl.c
-@@ -4329,23 +4329,70 @@ S_init_postdump_symbols(pTHX_ int argc, char **argv, char **env)
- 	}
- 	if (env) {
- 	  char *s, *old_var;
-+          STRLEN nlen;
- 	  SV *sv;
-+          HV *dups = newHV();
-+
- 	  for (; *env; env++) {
- 	    old_var = *env;
- 
- 	    if (!(s = strchr(old_var,'=')) || s == old_var)
- 		continue;
-+            nlen = s - old_var;
- 
- #if defined(MSDOS) && !defined(DJGPP)
- 	    *s = '\0';
- 	    (void)strupr(old_var);
- 	    *s = '=';
- #endif
--	    sv = newSVpv(s+1, 0);
--	    (void)hv_store(hv, old_var, s - old_var, sv, 0);
-+            if (hv_exists(hv, old_var, nlen)) {
-+                const char *name = savepvn(old_var, nlen);
-+
-+                /* make sure we use the same value as getenv(), otherwise code that
-+                   uses getenv() (like setlocale()) might see a different value to %ENV
-+                 */
-+                sv = newSVpv(PerlEnv_getenv(name), 0);
-+
-+                /* keep a count of the dups of this name so we can de-dup environ later */
-+                if (hv_exists(dups, name, nlen))
-+                    ++SvIVX(*hv_fetch(dups, name, nlen, 0));
-+                else
-+                    (void)hv_store(dups, name, nlen, newSViv(1), 0);
-+
-+                Safefree(name);
-+            }
-+            else {
-+                sv = newSVpv(s+1, 0);
-+            }
-+	    (void)hv_store(hv, old_var, nlen, sv, 0);
- 	    if (env_is_not_environ)
- 	        mg_set(sv);
- 	  }
-+          if (HvKEYS(dups)) {
-+              /* environ has some duplicate definitions, remove them */
-+              HE *entry;
-+              hv_iterinit(dups);
-+              while ((entry = hv_iternext_flags(dups, 0))) {
-+                  STRLEN nlen;
-+                  const char *name = HePV(entry, nlen);
-+                  IV count = SvIV(HeVAL(entry));
-+                  IV i;
-+                  SV **valp = hv_fetch(hv, name, nlen, 0);
-+
-+                  assert(valp);
-+
-+                  /* try to remove any duplicate names, depending on the
-+                   * implementation used in my_setenv() the iteration might
-+                   * not be necessary, but let's be safe.
-+                   */
-+                  for (i = 0; i < count; ++i)
-+                      my_setenv(name, 0);
-+
-+                  /* and set it back to the value we set $ENV{name} to */
-+                  my_setenv(name, SvPV_nolen(*valp));
-+              }
-+          }
-+          SvREFCNT_dec_NN(dups);
-       }
- #endif /* USE_ENVIRON_ARRAY */
- #endif /* !PERL_MICRO */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2016-6185.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2016-6185.patch
deleted file mode 100644
index 2722af3..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-fix-CVE-2016-6185.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From 7cedaa8bc2ca9e63369d0e2d4c4c23af9febb93a Mon Sep 17 00:00:00 2001
-From: Father Chrysostomos <sprout@cpan.org>
-Date: Sat, 2 Jul 2016 22:56:51 -0700
-Subject: [PATCH] perl: fix CVE-2016-6185
-MIME-Version: 1.0
-
-Don't let XSLoader load relative paths
-
-[rt.cpan.org #115808]
-
-The logic in XSLoader for determining the library goes like this:
-
-    my $c = () = split(/::/,$caller,-1);
-    $modlibname =~ s,[\\/][^\\/]+$,, while $c--;    # Q&D basename
-    my $file = "$modlibname/auto/$modpname/$modfname.bundle";
-
-(That last line varies by platform.)
-
-$caller is the calling package.  $modlibname is the calling file.  It
-removes as many path segments from $modlibname as there are segments
-in $caller.  So if you have Foo/Bar/XS.pm calling XSLoader from the
-Foo::Bar package, the $modlibname will end up containing the path in
-@INC where XS.pm was found, followed by "/Foo".  Usually the fallback
-to Dynaloader::bootstrap_inherit, which does an @INC search, makes
-things Just Work.
-
-But if our hypothetical Foo/Bar/XS.pm actually calls
-XSLoader::load from inside a string eval, then path ends up being
-"(eval 1)/auto/Foo/Bar/Bar.bundle".
-
-So if someone creates a directory named '(eval 1)' with a naughty
-binary file in it, it will be loaded if a script using Foo::Bar is run
-in the parent directory.
-
-This commit makes XSLoader fall back to Dynaloader's @INC search if
-the calling file has a relative path that is not found in @INC.
-
-Backport patch from http://perl5.git.perl.org/perl.git/commitdiff/08e3451d7
-
-Upstream-Status: Backport
-CVE: CVE-2016-6185
-Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
----
- dist/XSLoader/XSLoader_pm.PL | 25 +++++++++++++++++++++++++
- dist/XSLoader/t/XSLoader.t   | 27 ++++++++++++++++++++++++++-
- 2 files changed, 51 insertions(+), 1 deletion(-)
-
-diff --git a/dist/XSLoader/XSLoader_pm.PL b/dist/XSLoader/XSLoader_pm.PL
-index 668411d..778e46b 100644
---- a/dist/XSLoader/XSLoader_pm.PL
-+++ b/dist/XSLoader/XSLoader_pm.PL
-@@ -104,6 +104,31 @@ print OUT <<'EOT';
-     my $modpname = join('/',@modparts);
-     my $c = () = split(/::/,$caller,-1);
-     $modlibname =~ s,[\\/][^\\/]+$,, while $c--;    # Q&D basename
-+    # Does this look like a relative path?
-+    if ($modlibname !~ m|^[\\/]|) {
-+        # Someone may have a #line directive that changes the file name, or
-+        # may be calling XSLoader::load from inside a string eval.  We cer-
-+        # tainly do not want to go loading some code that is not in @INC,
-+        # as it could be untrusted.
-+        #
-+        # We could just fall back to DynaLoader here, but then the rest of
-+        # this function would go untested in the perl core, since all @INC
-+        # paths are relative during testing.  That would be a time bomb
-+        # waiting to happen, since bugs could be introduced into the code.
-+        #
-+        # So look through @INC to see if $modlibname is in it.  A rela-
-+        # tive $modlibname is not a common occurrence, so this block is
-+        # not hot code.
-+        FOUND: {
-+            for (@INC) {
-+                if ($_ eq $modlibname) {
-+                    last FOUND;
-+                }
-+            }
-+            # Not found.  Fall back to DynaLoader.
-+            goto \&XSLoader::bootstrap_inherit;
-+        }
-+    }
- EOT
- 
- my $dl_dlext = quotemeta($Config::Config{'dlext'});
-diff --git a/dist/XSLoader/t/XSLoader.t b/dist/XSLoader/t/XSLoader.t
-index 2ff11fe..1e86faa 100644
---- a/dist/XSLoader/t/XSLoader.t
-+++ b/dist/XSLoader/t/XSLoader.t
-@@ -33,7 +33,7 @@ my %modules = (
-     'Time::HiRes'=> q| ::can_ok( 'Time::HiRes' => 'usleep'  ) |,  # 5.7.3
- );
- 
--plan tests => keys(%modules) * 3 + 9;
-+plan tests => keys(%modules) * 3 + 10;
- 
- # Try to load the module
- use_ok( 'XSLoader' );
-@@ -125,3 +125,28 @@ XSLoader::load("Devel::Peek");
- EOS
-     or ::diag $@;
- }
-+
-+SKIP: {
-+  skip "File::Path not available", 1
-+    unless eval { require File::Path };
-+  my $name = "phooo$$";
-+  File::Path::make_path("$name/auto/Foo/Bar");
-+  open my $fh,
-+    ">$name/auto/Foo/Bar/Bar.$Config::Config{'dlext'}";
-+  close $fh;
-+  my $fell_back;
-+  local *XSLoader::bootstrap_inherit = sub {
-+    $fell_back++;
-+    # Break out of the calling subs
-+    goto the_test;
-+  };
-+  eval <<END;
-+#line 1 $name
-+package Foo::Bar;
-+XSLoader::load("Foo::Bar");
-+END
-+ the_test:
-+  ok $fell_back,
-+    'XSLoader will not load relative paths based on (caller)[1]';
-+  File::Path::remove_tree($name);
-+}
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-remove-nm-from-libswanted.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-remove-nm-from-libswanted.patch
deleted file mode 100644
index c489f05..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-remove-nm-from-libswanted.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 4732711e2548b6d734ca831d65dbcf501a89774e Mon Sep 17 00:00:00 2001
-From: Andreas Koenig <andk@cpan.org>
-Date: Sun, 3 Jan 2016 08:40:33 +0100
-Subject: [PATCH] Remove nm from libswanted
-
-Nm stood for "New Math" library in the context of 1994. 2014 a conflicting
-library libnm appeared that has a network manager context.
-
-Upstream-Status: Backport [commit 4732711e on branch blead, tag v5.25.0]
-
----
- Configure | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Configure b/Configure
-index 0e71b4b..cfbdaa1 100755
---- a/Configure
-+++ b/Configure
-@@ -1464,7 +1464,7 @@ libswanted_uselargefiles=''
- : set usesocks on the Configure command line to enable socks.
- : List of libraries we want.
- : If anyone needs extra -lxxx, put those in a hint file.
--libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
-+libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
- libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
- : We probably want to search /usr/shlib before most other libraries.
- : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
--- 
-2.9.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch
index 477be29..90e4dcd 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch
@@ -1,61 +1,86 @@
-The OE core recipies customize some ExtUtils-MakeMaker modules,
-which causes their MD5 sum to mismatch the provided table and the
-corresponding tests to fail. Also, we patch several test files with
-a backported patch. Update list of hashes to reflect the patched files.
+From 64df09205b6ccb5a434a4e53e8e0a32377ab634f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Thu, 24 Nov 2016 10:49:55 -0600
+Subject: [PATCH] The OE core recipies customize some ExtUtils-MakeMaker
+ modules, which causes their MD5 sum to mismatch the provided table and the
+ corresponding tests to fail. Also, we patch several test files with a
+ backported patch. Update list of hashes to reflect the patched files.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
 Upstream-Status: Inappropriate [embedded specific]
 
 Signed-off-by: Bill Randle <william.c.randle@intel.com>
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ t/porting/customized.dat | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
 
-Index: perl-5.22.1/t/porting/customized.dat
-===================================================================
---- perl-5.22.1.orig/t/porting/customized.dat	2015-10-31 13:36:16.000000000 +0000
-+++ perl-5.22.1/t/porting/customized.dat	2016-06-02 12:50:10.381030204 -0700
-@@ -1,8 +1,8 @@
- CPAN cpan/CPAN/lib/CPAN.pm ce62c43d72f101c011184dbbc59e21c2790826f0
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm 7f4dfd0fe884bd42412bcf04ca80ef97b39c1d54
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm bef099988b15fb0b2a1f5ac48c01af1f7f36d329
--ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm 8168e18f0e3ce3ece4bb7e7c72d57ec07c67c402
--ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 7115e97a53559cb3ec061dd6f7f344e522724c4a
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm 8c22e119b96d674f1f268a9c495bb4aa04e1100b
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 3d7abd674b15ed323f743594ef0bd09db76b1aee
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm f8db8d4245bf0684b8210c811f50d7cfb1a27d78
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/FAQ.pod 757bffb47857521311f8f3bde43ebe165f8d5191
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Locale.pm 82be06851deb84c6419ad003ce9b6d1957f395f3
-@@ -14,7 +14,7 @@
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mksymlists.pm ab80029ab16d38d4f2e41dc88d2ceb9f3790e477
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm 453e0abbc4bb38db4c0820ad5c4846f313b66291
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_AIX.pm c1b1babda8f43ae7a2caba1cb4f70f92af5a0e34
--ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm 6f90d94ad3e7aa0045a3b1a10a1bb18391f89f57
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm 21bde53290bf1a4da4457290b65bd1b0ca6f1d16
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm cab2b3ce08b71a4ce89aa630f236eb08b852439d
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm 61fced0faf518bf87c265fcb51ed330ba354623f
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm ae0ef51a7b6dd0b05aa61c779df7167dda5f5119
-@@ -23,7 +23,7 @@
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_NW5.pm 433135eecb85b4b1d90d3027432f329436c78447
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm 1fbb5605bfb47feee4083feba8aa85e659628f70
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm 5b66d1f485a6034d96fc24ba1665b1bad9e447f1
--ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 8cef99a9bd370ecfd07ddb0efbdcbb4101255e45
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 860d520234d7c9036d91f0b143a1dddf2a5e8cb7
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm 939572fde3d59ba77c2e677fe2df2bed4bed5898
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm 09c2049bfd25b735e2a5bcf56a6cff7b4827f9c8
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm d65d63f8217a55c36f62e249814988974f593c79
-@@ -31,8 +31,16 @@
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win95.pm 12df38eacceeed73cab94c423236bfaed0fbbfec
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MY.pm 22fe9596a0237252f45399a36abc83b7813bc328
- ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/testlib.pm 7fbc42ca2ebc6c677b79ae5fd5647243cf069463
--ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/basic.t 6cdc7701b50e586bc9c4cfb1616de8eb0b1baf34
--ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/pm_to_blib.t 71ebcee355691ce374fcad251b12d8b2412462b3
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/basic.t d78fdec7a4512dc8d2a7abd62b8104530af8ecf9
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/echo.t 9427f4adebbb13b57b4a76fef2972adf63c9bd96
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t ef356c196bb5c3c428ae309d7f989bdd6d79b86d
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t 3e6d4d6eb2eab42e983ac70eb5737a759af0916f
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/INST.t e553fa0d53c894c8d36aafb69edd55b38a9355f8
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/min_perl_version.t e930ec9217de5a1785d0247c30b159e6f7f5673f
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/PL_FILES.t 7e49ab6c4d467826d22023fa03d77b85f935b58e
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/pm_to_blib.t a04c96eecfab17e4094604e0fb998dd93cf93b93
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/recurs.t 94cce3bff875a878ed27816b3f5df2ca4225c714
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/several_authors.t f811d993c0835c66dc501ed55083acb29bf33bf7
- Text::ParseWords cpan/Text-ParseWords/t/ParseWords.t 9bae51c9b944cd5c0bbabe9d397e573976a2be8e
- Win32API::File cpan/Win32API-File/buffers.h 02d230ac9ac7091365128161a0ed671898baefae
- Win32API::File cpan/Win32API-File/cFile.h fca7e383e76979c3ac3adf12d11d1bcd2618e489
+diff --git a/t/porting/customized.dat b/t/porting/customized.dat
+index defeae1..b5d3c46 100644
+--- a/t/porting/customized.dat
++++ b/t/porting/customized.dat
+@@ -18,12 +18,12 @@ Encode cpan/Encode/bin/unidump 715f47c2fcc661268f3c6cd3de0d27c72b745cd2
+ Encode cpan/Encode/Encode.pm e146861ff2e6aaa62defa4887eade68dd7b17c8e
+ Encode cpan/Encode/encoding.pm 51c19efc9bfe8467d6ae12a4654f6e7f980715bf
+ ExtUtils::Constant cpan/ExtUtils-Constant/t/Constant.t a0369c919e216fb02767a637666bb4577ad79b02
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/bin/instmodsh 5bc04a0173b8b787f465271b6186220326ae8eef
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/bin/instmodsh 2070fe968fa344d89aea1bdc6a8dbb0c467d0612
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command.pm e3a372e07392179711ea9972087c1105a2780fad
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm b72721bd6aa9bf7ec328bda99a8fdb63cac6114d
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm 0e1e4c25eddb999fec6c4dc66593f76db34cfd16
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm bfd2aa00ca4ed251f342e1d1ad704abbaf5a615e
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 5529ae3064365eafd99536621305d52f4ab31b45
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm d593d8fdc5c0ebcb6d3701c70fc6640c50d93455
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm bf9174c70a0e50ff2fee4552c7df89b37d292da1
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm bc88b275af73b8faac6abd59a9aad3f625925810
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/FAQ.pod 062e5d14a803fbbec8d61803086a3d7997e8a473
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Tutorial.pod a8a9cab7d67922ed3d6883c864e1fe29aaa6ad89
+@@ -33,7 +33,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mkbootstrap.pm 412e95c3
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mksymlists.pm 8559ef191b4371d0c381472464856a8a73825b2a
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm 09d579ed9daea95c3bf47de2e0b8fe3aa0ff6447
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_AIX.pm f720c13748293b792f7073aa96e7daecb590b183
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm 243649a399d293ae7ad0f26b7eab2668aa864ce8
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm ec39f68802a6fee8daaa914fc7131f40533cfc23
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm b63c90129303b2c17d084fb828aa2c02a2ad85b8
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm cabd1c97eaa427067811d92807e34c17940c7350
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm 6a185d897a600c34615a6073f4de0ac2f54fef3e
+@@ -42,7 +42,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_MacOS.pm 1f5eb772eed
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_NW5.pm de777d7809c0d73e5d4622a29921731c7e5dff48
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm 01e8f08a82b5304009574e3ac0892b4066ff7639
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm 5340052b58557a6764f5ac9f8b807fefec404a06
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 3c3b93f431b0a51b9592b3d69624dbf5409f6f74
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 0d6ed5e4bdcdcd28e968e8629a592fdd0cc84818
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm 40397f4cd2d49700b80b4ef490da98add24c5b37
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm 147e97fbabb74841f0733dbd5d1b9f3fa51f87c1
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm 3f13ed7045ff3443bcb4dd6c95c98b9bd705820f
+@@ -51,7 +51,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win95.pm 48e8a2fe176
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MY.pm 6fefe99045b64459905d4721f3a494d8d50f7ab9
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/testlib.pm 172778ad21c065a89cd270668eb9f99a7364b41c
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/cd.t 0a71fbd646a7be8358b07b6f64f838243cc0aef4
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/echo.t 37aec8f794c52e037540757eb5b2556f79419ff7
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/echo.t 1a93dd8834e4bb0e5facf08204e782807567b2eb
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/NoXS.pm 371cdff1b2375017907cfbc9c8f4a31f5ad10582
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/prereq.t 53bda2c549fd13a6b6c13a070ca6bc79883081c0
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/vstrings.t 90035a2bdbf45f15b9c3196d072d7cba7e662871
+@@ -165,7 +165,7 @@ bignum cpan/bignum/lib/bigrat.pm 7fccc9df30e43dbbae6e5ea91b26c8046545c9a9
+ bignum cpan/bignum/lib/Math/BigFloat/Trace.pm a6b4b995e18f4083252e6dc72e9bef69671893dd
+ bignum cpan/bignum/lib/Math/BigInt/Trace.pm d9596963673760cae3eeeb752c1eeeec50bb2290
+ libnet cpan/libnet/lib/Net/Cmd.pm a44a10c939a4c35f923c4638054178c32f1d283a
+-libnet cpan/libnet/lib/Net/Config.pm 9bd49bf4de0dc438bceee0ef4baf8ba7a6633327
++libnet cpan/libnet/lib/Net/Config.pm 2873da5efbffed67934dd297ef6f360b3558cb0b
+ libnet cpan/libnet/lib/Net/Domain.pm 1bbed50f70fd1ff3e1cdf087b19a9349cddfaced
+ libnet cpan/libnet/lib/Net/FTP.pm 40dba553c8d44e1530daec2d07a6e50910401f2e
+ libnet cpan/libnet/lib/Net/FTP/A.pm c570b10730b168990034dcf9cb00e305a100f336
+@@ -176,6 +176,6 @@ libnet cpan/libnet/lib/Net/FTP/L.pm ac1599c775faee0474710e4f75051c8949f13df2
+ libnet cpan/libnet/lib/Net/Netrc.pm 009cfc08f8a5bf247257acb64a21e1b6ad8b2c9c
+ libnet cpan/libnet/lib/Net/NNTP.pm 6325fc05fd9ef81dc8d461a77b2a3f56ad1ae114
+ libnet cpan/libnet/lib/Net/POP3.pm 2d8065646df80061dae5a9e3465a36a6557165fd
+-libnet cpan/libnet/lib/Net/SMTP.pm f3ed7a177b49ee0ba65ac1c414de797cdbbe6886
++libnet cpan/libnet/lib/Net/SMTP.pm f1beb42bfbef4333ed24ad63d5dd1aa5c67b20c7
+ libnet cpan/libnet/lib/Net/Time.pm b3df8bbaa3bc253fbf77e8386c59a1b2aae13627
+ version cpan/version/lib/version.pm ff75e2076be10bd4c05133cd979fda0b38ca8653
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.22.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.22.1.bb
deleted file mode 100644
index 792a65b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.22.1.bb
+++ /dev/null
@@ -1,375 +0,0 @@
-require perl.inc
-
-# We need gnugrep (for -I)
-DEPENDS = "virtual/db grep-native"
-DEPENDS += "gdbm zlib"
-
-# Pick up patches from debian
-# http://ftp.de.debian.org/debian/pool/main/p/perl/perl_5.22.0-1.debian.tar.xz
-SRC_URI += " \
-	file://debian/cpan_definstalldirs.diff \
-	file://debian/db_file_ver.diff \
-	file://debian/doc_info.diff \
-	file://debian/enc2xs_inc.diff \
-	file://debian/errno_ver.diff \
-	file://debian/libperl_embed_doc.diff \
-	file://debian/fixes/respect_umask.diff \
-	file://debian/writable_site_dirs.diff \
-	file://debian/extutils_set_libperl_path.diff \
-	file://debian/no_packlist_perllocal.diff \
-	file://debian/prefix_changes.diff \
-	file://debian/instmodsh_doc.diff \
-	file://debian/ld_run_path.diff \
-	file://debian/libnet_config_path.diff \
-	file://debian/mod_paths.diff \
-	file://debian/prune_libs.diff \
-	file://debian/fixes/net_smtp_docs.diff \
-	file://debian/perlivp.diff \
-	file://debian/squelch-locale-warnings.diff \
-	file://debian/skip-upstream-git-tests.diff \
-	file://debian/skip-kfreebsd-crash.diff \
-	file://debian/fixes/document_makemaker_ccflags.diff \
-	file://debian/find_html2text.diff \
-	file://debian/perl5db-x-terminal-emulator.patch \
-	file://debian/cpan-missing-site-dirs.diff \
-	file://debian/fixes/memoize_storable_nstore.diff \
-	file://debian/regen-skip.diff \
-"
-
-SRC_URI += " \
-        file://Makefile.patch \
-        file://Makefile.SH.patch \
-        file://installperl.patch \
-        file://perl-dynloader.patch \
-        file://perl-moreconfig.patch \
-        file://letgcc-find-errno.patch \
-        file://generate-sh.patch \
-        file://native-perlinc.patch \
-        file://perl-enable-gdbm.patch \
-        file://cross-generate_uudmap.patch \
-        file://fix_bad_rpath.patch \
-        file://perl-archlib-exp.patch \
-        file://dynaloaderhack.patch \
-        file://config.sh \
-        file://config.sh-32 \
-        file://config.sh-32-le \
-        file://config.sh-32-be \
-        file://config.sh-64 \
-        file://config.sh-64-le \
-        file://config.sh-64-be \
-        file://make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch \
-        file://t-run-switches.t-perl5-perl.patch \
-        file://ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch \
-        file://ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch \
-        file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
-        file://perl-errno-generation-gcc5.patch \
-        file://perl-fix-conflict-between-skip_all-and-END.patch \
-        file://perl-test-customized.patch \
-        file://perl-fix-CVE-2016-2381.patch \
-        file://perl-fix-CVE-2016-6185.patch \
-        file://perl-fix-CVE-2015-8607.patch \
-        file://perl-fix-CVE-2016-1238.patch \
-"
-
-# Fix test case issues
-SRC_URI_append_class-target = " \
-            file://test/dist-threads-t-join.t-adjust-ps-option.patch \
-            file://test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch \
-           "
-
-SRC_URI[md5sum] = "6671e4829cbaf9cecafa9a84f141b0a3"
-SRC_URI[sha256sum] = "9e87317d693ce828095204be0d09af8d60b8785533fadea1a82b6f0e071e5c79"
-
-inherit perlnative siteinfo
-
-# Where to find the native perl
-HOSTPERL = "${STAGING_BINDIR_NATIVE}/perl-native/perl${PV}"
-
-# Where to find .so files - use the -native versions not those from the target build
-export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
-
-# Where to find perl @INC/#include files
-# - use the -native versions not those from the target build
-export PERL_LIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
-export PERL_ARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
-
-EXTRA_OEMAKE = "-e MAKEFLAGS="
-
-# LDFLAGS for shared libraries
-export LDDLFLAGS = "${LDFLAGS} -shared"
-
-LDFLAGS_append = " -fstack-protector"
-
-# We're almost Debian, aren't we?
-CFLAGS += "-DDEBIAN"
-
-do_nolargefile() {
-	sed -i -e "s,\(uselargefiles=\)'define',\1'undef',g" \
-		-e "s,\(d_readdir64_r=\)'define',\1'undef',g" \
-		-e "s,\(readdir64_r_proto=\)'\w+',\1'0',g" \
-		-e "/ccflags_uselargefiles/d" \
-		-e "s/-Duselargefiles//" \
-		-e "s/-D_FILE_OFFSET_BITS=64//" \
-		-e "s/-D_LARGEFILE_SOURCE//" \
-		${S}/Cross/config.sh-${TARGET_ARCH}-${TARGET_OS}
-}
-
-do_configure() {
-        # Make hostperl in build directory be the native perl
-        ln -sf ${HOSTPERL} hostperl
-
-	if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
-		if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a -e Makefile ]; then
-			${MAKE} clean
-		fi
-		find ${S} -name *.so -delete
-	fi
-	if [ -n "${CONFIGURESTAMPFILE}" ]; then
-		echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
-	fi
-
-        # Do our work in the cross subdir
-        cd Cross
-
-        # Generate configuration
-        rm -f config.sh-${TARGET_ARCH}-${TARGET_OS}
-        for i in ${WORKDIR}/config.sh \
-                 ${WORKDIR}/config.sh-${SITEINFO_BITS} \
-                 ${WORKDIR}/config.sh-${SITEINFO_BITS}-${SITEINFO_ENDIANNESS}; do
-            cat $i >> config.sh-${TARGET_ARCH}-${TARGET_OS}
-        done
-
-        # Fixups for uclibc
-        if [ "${TARGET_OS}" = "linux-uclibc" -o "${TARGET_OS}" = "linux-uclibceabi" ]; then
-                sed -i -e "s,\(d_crypt_r=\)'define',\1'undef',g" \
-                       -e "s,\(d_futimes=\)'define',\1'undef',g" \
-                       -e "s,\(d_finitel=\)'define',\1'undef',g" \
-                       -e "s,\(crypt_r_proto=\)'\w+',\1'0',g" \
-                       -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
-                       -e "s,\(getnetbyname_r_proto=\)'\w+',\1'0',g" \
-                       -e "s,\(d_getnetbyaddr_r=\)'define',\1'undef',g" \
-                       -e "s,\(getnetbyaddr_r_proto=\)'\w+',\1'0',g" \
-                       -e "s,\(d_getnetent_r=\)'define',\1'undef',g" \
-                       -e "s,\(getnetent_r_proto=\)'\w+',\1'0',g" \
-                       -e "s,\(d_sockatmark=\)'define',\1'undef',g" \
-                       -e "s,\(d_sockatmarkproto=\)'\w+',\1'0',g" \
-                       -e "s,\(d_eaccess=\)'define',\1'undef',g" \
-                       -e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
-                       -e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
-                       -e "s,\(d_stdiobase=\)'define',\1'undef',g" \
-                       -e "s,\(d_stdstdio=\)'define',\1'undef',g" \
-                       -e "s,-fstack-protector,-fno-stack-protector,g" \
-                    config.sh-${TARGET_ARCH}-${TARGET_OS}
-        fi
-        # Fixups for musl
-        if [ "${TARGET_OS}" = "linux-musl" -o "${TARGET_OS}" = "linux-musleabi" ]; then
-                sed -i -e "s,\(d_libm_lib_version=\)'define',\1'undef',g" \
-                       -e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
-                       -e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
-                       -e "s,\(d_stdiobase=\)'define',\1'undef',g" \
-                       -e "s,\(d_stdstdio=\)'define',\1'undef',g" \
-                       -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
-                       -e "s,\(d_finitel=\)'define',\1'undef',g" \
-                       -e "s,\(getprotobyname_r=\)'define',\1'undef',g" \
-                       -e "s,\(getpwent_r=\)'define',\1'undef',g" \
-                       -e "s,\(getservent_r=\)'define',\1'undef',g" \
-                       -e "s,\(gethostent_r=\)'define',\1'undef',g" \
-                       -e "s,\(getnetent_r=\)'define',\1'undef',g" \
-                       -e "s,\(getnetbyaddr_r=\)'define',\1'undef',g" \
-                       -e "s,\(getprotoent_r=\)'define',\1'undef',g" \
-                       -e "s,\(getprotobynumber_r=\)'define',\1'undef',g" \
-                       -e "s,\(getgrent_r=\)'define',\1'undef',g" \
-                       -e "s,\(i_fcntl=\)'undef',\1'define',g" \
-                       -e "s,\(h_fcntl=\)'false',\1'true',g" \
-                       -e "s,-fstack-protector,-fno-stack-protector,g" \
-                       -e "s,-lnsl,,g" \
-                    config.sh-${TARGET_ARCH}-${TARGET_OS}
-        fi
-
-	${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '', 'do_nolargefile', d)}
-
-        # Update some paths in the configuration
-        sed -i -e 's,@ARCH@-thread-multi,,g' \
-               -e 's,@ARCH@,${TARGET_ARCH}-${TARGET_OS},g' \
-               -e 's,@STAGINGDIR@,${STAGING_DIR_HOST},g' \
-               -e "s,@INCLUDEDIR@,${STAGING_INCDIR},g" \
-               -e "s,@LIBDIR@,${libdir},g" \
-               -e "s,@BASELIBDIR@,${base_libdir},g" \
-               -e "s,@EXECPREFIX@,${exec_prefix},g" \
-               -e 's,@USRBIN@,${bindir},g' \
-            config.sh-${TARGET_ARCH}-${TARGET_OS}
-
-	case "${TARGET_ARCH}" in
-		x86_64 | powerpc | s390)
-			sed -i -e "s,\(need_va_copy=\)'undef',\1'define',g" \
-				config.sh-${TARGET_ARCH}-${TARGET_OS}
-			;;
-		arm)
-			sed -i -e "s,\(d_u32align=\)'undef',\1'define',g" \
-				config.sh-${TARGET_ARCH}-${TARGET_OS}
-			;;
-	esac
-        # These are strewn all over the source tree
-        for foo in `grep -I --exclude="*.patch" --exclude="*.diff" --exclude="*.pod" --exclude="README*" -m1 "/usr/include/.*\.h" ${S}/* -r -l` ${S}/utils/h2xs.PL ; do
-            echo Fixing: $foo
-            sed -e 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i $foo
-        done
-
-        rm -f config
-        echo "ARCH = ${TARGET_ARCH}" > config
-        echo "OS = ${TARGET_OS}" >> config
-}
-
-do_compile() {
-        # Fix to avoid recursive substitution of path
-        sed -i -e 's|(@libpath, ".*"|(@libpath, "${STAGING_LIBDIR}"|g' cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
-
-        cd Cross
-        oe_runmake perl LD="${CCLD}"
-}
-
-do_install() {
-	#export hostperl="${STAGING_BINDIR_NATIVE}/perl-native/perl${PV}"
-	oe_runmake install DESTDIR=${D}
-        # Add perl pointing at current version
-        ln -sf perl${PV} ${D}${bindir}/perl
-
-        ln -sf perl ${D}/${libdir}/perl5
-
-        # Remove unwanted file and empty directories
-        rm -f ${D}/${libdir}/perl/${PV}/.packlist
-	rmdir ${D}/${libdir}/perl/site_perl/${PV}
-	rmdir ${D}/${libdir}/perl/site_perl
-
-        # Fix up shared library
-        mv ${D}/${libdir}/perl/${PV}/CORE/libperl.so ${D}/${libdir}/libperl.so.${PV}
-        ln -sf libperl.so.${PV} ${D}/${libdir}/libperl.so.5
-        ln -sf ../../../libperl.so.${PV} ${D}/${libdir}/perl/${PV}/CORE/libperl.so
-
-        # target config, used by cpan.bbclass to extract version information
-        install config.sh ${D}${libdir}/perl
-
-        ln -s Config_heavy.pl ${D}${libdir}/perl/${PV}/Config_heavy-target.pl
-}
-
-do_install_append_class-nativesdk () {
-        create_wrapper ${D}${bindir}/perl \
-            PERL5LIB='$PERL5LIB:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/site_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/vendor_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/${PV}'
-}
-
-PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess"
-
-perl_package_preprocess () {
-        # Fix up installed configuration
-        sed -i -e "s,${D},,g" \
-               -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
-               -e "s,-isystem${STAGING_INCDIR} ,,g" \
-               -e "s,${STAGING_LIBDIR},${libdir},g" \
-               -e "s,${STAGING_BINDIR},${bindir},g" \
-               -e "s,${STAGING_INCDIR},${includedir},g" \
-               -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
-               -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
-               -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
-            ${PKGD}${bindir}/h2xs \
-            ${PKGD}${bindir}/h2ph \
-            ${PKGD}${bindir}/pod2man \
-            ${PKGD}${bindir}/pod2text \
-            ${PKGD}${bindir}/pod2usage \
-            ${PKGD}${bindir}/podchecker \
-            ${PKGD}${bindir}/podselect \
-            ${PKGD}${libdir}/perl/${PV}/CORE/config.h \
-            ${PKGD}${libdir}/perl/${PV}/CORE/perl.h \
-            ${PKGD}${libdir}/perl/${PV}/CORE/pp.h \
-            ${PKGD}${libdir}/perl/${PV}/Config.pm \
-            ${PKGD}${libdir}/perl/${PV}/Config.pod \
-            ${PKGD}${libdir}/perl/${PV}/Config_heavy.pl \
-            ${PKGD}${libdir}/perl/${PV}/ExtUtils/Liblist/Kid.pm \
-            ${PKGD}${libdir}/perl/${PV}/FileCache.pm \
-            ${PKGD}${libdir}/perl/${PV}/pod/*.pod \
-            ${PKGD}${libdir}/perl/config.sh
-}
-
-PACKAGES = "perl-dbg perl perl-misc perl-dev perl-pod perl-doc perl-lib \
-            perl-module-cpan perl-module-cpanplus perl-module-unicore"
-FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV} \
-               ${libdir}/perl/${PV}/Config.pm \
-               ${libdir}/perl/${PV}/strict.pm \
-               ${libdir}/perl/${PV}/warnings.pm \
-               ${libdir}/perl/${PV}/warnings \
-               ${libdir}/perl/${PV}/vars.pm \
-              "
-FILES_${PN}_append_class-nativesdk = " ${bindir}/perl.real"
-RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
-                    perl-module-warnings-register"
-FILES_${PN}-dev = "${libdir}/perl/${PV}/CORE"
-FILES_${PN}-lib = "${libdir}/libperl.so* \
-                   ${libdir}/perl5 \
-                   ${libdir}/perl/config.sh \
-                   ${libdir}/perl/${PV}/Config_heavy.pl \
-                   ${libdir}/perl/${PV}/Config_heavy-target.pl"
-FILES_${PN}-pod = "${libdir}/perl/${PV}/pod \
-		   ${libdir}/perl/${PV}/*.pod \
-                   ${libdir}/perl/${PV}/*/*.pod \
-                   ${libdir}/perl/${PV}/*/*/*.pod "
-FILES_perl-misc = "${bindir}/*"
-FILES_${PN}-doc = "${libdir}/perl/${PV}/*/*.txt \
-                   ${libdir}/perl/${PV}/*/*/*.txt \
-                   ${libdir}/perl/${PV}/auto/XS/Typemap \
-                   ${libdir}/perl/${PV}/B/assemble \
-                   ${libdir}/perl/${PV}/B/cc_harness \
-                   ${libdir}/perl/${PV}/B/disassemble \
-                   ${libdir}/perl/${PV}/B/makeliblinks \
-                   ${libdir}/perl/${PV}/CGI/eg \
-                   ${libdir}/perl/${PV}/CPAN/PAUSE2003.pub \
-                   ${libdir}/perl/${PV}/CPAN/SIGNATURE \
-		   ${libdir}/perl/${PV}/CPANPLUS/Shell/Default/Plugins/HOWTO.pod \
-                   ${libdir}/perl/${PV}/Encode/encode.h \
-                   ${libdir}/perl/${PV}/ExtUtils/MANIFEST.SKIP \
-                   ${libdir}/perl/${PV}/ExtUtils/NOTES \
-                   ${libdir}/perl/${PV}/ExtUtils/PATCHING \
-                   ${libdir}/perl/${PV}/ExtUtils/typemap \
-                   ${libdir}/perl/${PV}/ExtUtils/xsubpp \
-		   ${libdir}/perl/${PV}/ExtUtils/Changes_EU-Install \
-                   ${libdir}/perl/${PV}/Net/*.eg \
-                   ${libdir}/perl/${PV}/unicore/mktables \
-                   ${libdir}/perl/${PV}/unicore/mktables.lst \
-                   ${libdir}/perl/${PV}/unicore/version "
-
-FILES_perl-module-cpan += "${libdir}/perl/${PV}/CPAN \
-                           ${libdir}/perl/${PV}/CPAN.pm"
-FILES_perl-module-cpanplus += "${libdir}/perl/${PV}/CPANPLUS \
-                               ${libdir}/perl/${PV}/CPANPLUS.pm"
-FILES_perl-module-unicore += "${libdir}/perl/${PV}/unicore"
-
-# Create a perl-modules package recommending all the other perl
-# packages (actually the non modules packages and not created too)
-ALLOW_EMPTY_perl-modules = "1"
-PACKAGES_append = " perl-modules "
-
-PACKAGESPLITFUNCS_prepend = "split_perl_packages "
-
-python split_perl_packages () {
-    libdir = d.expand('${libdir}/perl/${PV}')
-    do_split_packages(d, libdir, 'auto/([^.]*)/[^/]*\.(so|ld|ix|al)', 'perl-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
-    do_split_packages(d, libdir, 'Module/([^\/]*)\.pm', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
-    do_split_packages(d, libdir, 'Module/([^\/]*)/.*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
-    do_split_packages(d, libdir, '(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|auto\/)[^\/]).*)\.(pm|pl|e2x)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
-
-    # perl-modules should recommend every perl module, and only the
-    # modules. Don't attempt to use the result of do_split_packages() as some
-    # modules are manually split (eg. perl-module-unicore).
-    packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES', True).split())
-    d.setVar(d.expand("RRECOMMENDS_${PN}-modules"), ' '.join(packages))
-}
-
-PACKAGES_DYNAMIC += "^perl-module-.*"
-PACKAGES_DYNAMIC_class-nativesdk += "^nativesdk-perl-module-.*"
-
-RPROVIDES_perl-lib = "perl-lib"
-
-require perl-rdepends_${PV}.inc
-require perl-ptest.inc
-
-SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
-
-BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.24.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.24.1.bb
new file mode 100644
index 0000000..cf7a8e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.24.1.bb
@@ -0,0 +1,358 @@
+require perl.inc
+
+# We need gnugrep (for -I)
+DEPENDS = "virtual/db grep-native"
+DEPENDS += "gdbm zlib"
+
+# Pick up patches from debian
+# http://ftp.de.debian.org/debian/pool/main/p/perl/perl_5.22.0-1.debian.tar.xz
+SRC_URI += " \
+	file://debian/cpan_definstalldirs.diff \
+	file://debian/db_file_ver.diff \
+	file://debian/doc_info.diff \
+	file://debian/enc2xs_inc.diff \
+	file://debian/errno_ver.diff \
+	file://debian/libperl_embed_doc.diff \
+	file://debian/fixes/respect_umask.diff \
+	file://debian/writable_site_dirs.diff \
+	file://debian/extutils_set_libperl_path.diff \
+	file://debian/no_packlist_perllocal.diff \
+	file://debian/prefix_changes.diff \
+	file://debian/instmodsh_doc.diff \
+	file://debian/ld_run_path.diff \
+	file://debian/libnet_config_path.diff \
+	file://debian/mod_paths.diff \
+	file://debian/prune_libs.diff \
+	file://debian/fixes/net_smtp_docs.diff \
+	file://debian/perlivp.diff \
+	file://debian/squelch-locale-warnings.diff \
+	file://debian/skip-upstream-git-tests.diff \
+	file://debian/skip-kfreebsd-crash.diff \
+	file://debian/fixes/document_makemaker_ccflags.diff \
+	file://debian/find_html2text.diff \
+	file://debian/perl5db-x-terminal-emulator.patch \
+	file://debian/cpan-missing-site-dirs.diff \
+	file://debian/fixes/memoize_storable_nstore.diff \
+	file://debian/regen-skip.diff \
+"
+
+SRC_URI += " \
+        file://Makefile.patch \
+        file://Makefile.SH.patch \
+        file://installperl.patch \
+        file://perl-archlib-exp.patch \
+        file://perl-dynloader.patch \
+        file://perl-moreconfig.patch \
+        file://letgcc-find-errno.patch \
+        file://generate-sh.patch \
+        file://native-perlinc.patch \
+        file://perl-enable-gdbm.patch \
+        file://cross-generate_uudmap.patch \
+        file://fix_bad_rpath.patch \
+        file://dynaloaderhack.patch \
+        file://config.sh \
+        file://config.sh-32 \
+        file://config.sh-32-le \
+        file://config.sh-32-be \
+        file://config.sh-64 \
+        file://config.sh-64-le \
+        file://config.sh-64-be \
+        file://make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch \
+        file://t-run-switches.t-perl5-perl.patch \
+        file://ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch \
+        file://ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch \
+        file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
+        file://perl-errno-generation-gcc5.patch \
+        file://perl-fix-conflict-between-skip_all-and-END.patch \
+        file://perl-test-customized.patch \
+"
+
+# Fix test case issues
+SRC_URI_append_class-target = " \
+            file://test/dist-threads-t-join.t-adjust-ps-option.patch \
+            file://test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch \
+           "
+
+SRC_URI[md5sum] = "af6a84c7c3e2b8b269c105a5db2f6d53"
+SRC_URI[sha256sum] = "03a77bac4505c270f1890ece75afc7d4b555090b41aa41ea478747e23b2afb3f"
+
+inherit perlnative siteinfo
+
+# Where to find the native perl
+HOSTPERL = "${STAGING_BINDIR_NATIVE}/perl-native/perl${PV}"
+
+# Where to find .so files - use the -native versions not those from the target build
+export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
+
+# Where to find perl @INC/#include files
+# - use the -native versions not those from the target build
+export PERL_LIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
+export PERL_ARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+# LDFLAGS for shared libraries
+export LDDLFLAGS = "${LDFLAGS} -shared"
+
+LDFLAGS_append = " -fstack-protector"
+
+# We're almost Debian, aren't we?
+CFLAGS += "-DDEBIAN"
+
+do_configure() {
+        # Make hostperl in build directory be the native perl
+        ln -sf ${HOSTPERL} hostperl
+
+	if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
+		if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a -e Makefile ]; then
+			${MAKE} clean
+		fi
+		find ${S} -name *.so -delete
+	fi
+	if [ -n "${CONFIGURESTAMPFILE}" ]; then
+		echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+	fi
+
+        # Do our work in the cross subdir
+        cd Cross
+
+        # Generate configuration
+        rm -f config.sh-${TARGET_ARCH}-${TARGET_OS}
+        for i in ${WORKDIR}/config.sh \
+                 ${WORKDIR}/config.sh-${SITEINFO_BITS} \
+                 ${WORKDIR}/config.sh-${SITEINFO_BITS}-${SITEINFO_ENDIANNESS}; do
+            cat $i >> config.sh-${TARGET_ARCH}-${TARGET_OS}
+        done
+
+        # Fixups for uclibc
+        if [ "${TARGET_OS}" = "linux-uclibc" -o "${TARGET_OS}" = "linux-uclibceabi" ]; then
+                sed -i -e "s,\(d_crypt_r=\)'define',\1'undef',g" \
+                       -e "s,\(d_futimes=\)'define',\1'undef',g" \
+                       -e "s,\(d_finitel=\)'define',\1'undef',g" \
+                       -e "s,\(crypt_r_proto=\)'\w+',\1'0',g" \
+                       -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
+                       -e "s,\(getnetbyname_r_proto=\)'\w+',\1'0',g" \
+                       -e "s,\(d_getnetbyaddr_r=\)'define',\1'undef',g" \
+                       -e "s,\(getnetbyaddr_r_proto=\)'\w+',\1'0',g" \
+                       -e "s,\(d_getnetent_r=\)'define',\1'undef',g" \
+                       -e "s,\(getnetent_r_proto=\)'\w+',\1'0',g" \
+                       -e "s,\(d_sockatmark=\)'define',\1'undef',g" \
+                       -e "s,\(d_sockatmarkproto=\)'\w+',\1'0',g" \
+                       -e "s,\(d_eaccess=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdiobase=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdstdio=\)'define',\1'undef',g" \
+                       -e "s,-fstack-protector,-fno-stack-protector,g" \
+                    config.sh-${TARGET_ARCH}-${TARGET_OS}
+        fi
+        # Fixups for musl
+        if [ "${TARGET_OS}" = "linux-musl" -o "${TARGET_OS}" = "linux-musleabi" ]; then
+                sed -i -e "s,\(d_libm_lib_version=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdiobase=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdstdio=\)'define',\1'undef',g" \
+                       -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
+                       -e "s,\(d_finitel=\)'define',\1'undef',g" \
+                       -e "s,\(getprotobyname_r=\)'define',\1'undef',g" \
+                       -e "s,\(getpwent_r=\)'define',\1'undef',g" \
+                       -e "s,\(getservent_r=\)'define',\1'undef',g" \
+                       -e "s,\(gethostent_r=\)'define',\1'undef',g" \
+                       -e "s,\(getnetent_r=\)'define',\1'undef',g" \
+                       -e "s,\(getnetbyaddr_r=\)'define',\1'undef',g" \
+                       -e "s,\(getprotoent_r=\)'define',\1'undef',g" \
+                       -e "s,\(getprotobynumber_r=\)'define',\1'undef',g" \
+                       -e "s,\(getgrent_r=\)'define',\1'undef',g" \
+                       -e "s,\(i_fcntl=\)'undef',\1'define',g" \
+                       -e "s,\(h_fcntl=\)'false',\1'true',g" \
+                       -e "s,-fstack-protector,-fno-stack-protector,g" \
+                       -e "s,-lnsl,,g" \
+                    config.sh-${TARGET_ARCH}-${TARGET_OS}
+        fi
+
+        # Update some paths in the configuration
+        sed -i -e 's,@ARCH@-thread-multi,,g' \
+               -e 's,@ARCH@,${TARGET_ARCH}-${TARGET_OS},g' \
+               -e 's,@STAGINGDIR@,${STAGING_DIR_HOST},g' \
+               -e "s,@INCLUDEDIR@,${STAGING_INCDIR},g" \
+               -e "s,@LIBDIR@,${libdir},g" \
+               -e "s,@BASELIBDIR@,${base_libdir},g" \
+               -e "s,@EXECPREFIX@,${exec_prefix},g" \
+               -e 's,@USRBIN@,${bindir},g' \
+            config.sh-${TARGET_ARCH}-${TARGET_OS}
+
+	case "${TARGET_ARCH}" in
+		x86_64 | powerpc | s390)
+			sed -i -e "s,\(need_va_copy=\)'undef',\1'define',g" \
+				config.sh-${TARGET_ARCH}-${TARGET_OS}
+			;;
+		arm)
+			sed -i -e "s,\(d_u32align=\)'undef',\1'define',g" \
+				config.sh-${TARGET_ARCH}-${TARGET_OS}
+			;;
+	esac
+        # These are strewn all over the source tree
+        for foo in `grep -I --exclude="*.patch" --exclude="*.diff" --exclude="*.pod" --exclude="README*" -m1 "/usr/include/.*\.h" ${S}/* -r -l` ${S}/utils/h2xs.PL ; do
+            echo Fixing: $foo
+            sed -e 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i $foo
+        done
+
+        rm -f config
+        echo "ARCH = ${TARGET_ARCH}" > config
+        echo "OS = ${TARGET_OS}" >> config
+}
+
+do_compile() {
+        # Fix to avoid recursive substitution of path
+        sed -i -e 's|(@libpath, ".*"|(@libpath, "${STAGING_LIBDIR}"|g' cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+
+        cd Cross
+        oe_runmake perl LD="${CCLD}"
+}
+
+do_install() {
+	#export hostperl="${STAGING_BINDIR_NATIVE}/perl-native/perl${PV}"
+	oe_runmake install DESTDIR=${D}
+        # Add perl pointing at current version
+        ln -sf perl${PV} ${D}${bindir}/perl
+
+        ln -sf perl ${D}/${libdir}/perl5
+
+        # Remove unwanted file and empty directories
+        rm -f ${D}/${libdir}/perl/${PV}/.packlist
+	rmdir ${D}/${libdir}/perl/site_perl/${PV}
+	rmdir ${D}/${libdir}/perl/site_perl
+
+        # Fix up shared library
+        mv ${D}/${libdir}/perl/${PV}/CORE/libperl.so ${D}/${libdir}/libperl.so.${PV}
+        ln -sf libperl.so.${PV} ${D}/${libdir}/libperl.so.5
+        ln -sf ../../../libperl.so.${PV} ${D}/${libdir}/perl/${PV}/CORE/libperl.so
+
+        # target config, used by cpan.bbclass to extract version information
+        install config.sh ${D}${libdir}/perl
+
+        ln -s Config_heavy.pl ${D}${libdir}/perl/${PV}/Config_heavy-target.pl
+}
+
+do_install_append_class-nativesdk () {
+        create_wrapper ${D}${bindir}/perl \
+            PERL5LIB='$PERL5LIB:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/site_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/vendor_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/${PV}'
+}
+
+PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess"
+
+perl_package_preprocess () {
+        # Fix up installed configuration
+        sed -i -e "s,${D},,g" \
+               -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
+               -e "s,-isystem${STAGING_INCDIR} ,,g" \
+               -e "s,${STAGING_LIBDIR},${libdir},g" \
+               -e "s,${STAGING_BINDIR},${bindir},g" \
+               -e "s,${STAGING_INCDIR},${includedir},g" \
+               -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
+               -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
+               -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
+            ${PKGD}${bindir}/h2xs \
+            ${PKGD}${bindir}/h2ph \
+            ${PKGD}${bindir}/pod2man \
+            ${PKGD}${bindir}/pod2text \
+            ${PKGD}${bindir}/pod2usage \
+            ${PKGD}${bindir}/podchecker \
+            ${PKGD}${bindir}/podselect \
+            ${PKGD}${libdir}/perl/${PV}/CORE/config.h \
+            ${PKGD}${libdir}/perl/${PV}/CORE/perl.h \
+            ${PKGD}${libdir}/perl/${PV}/CORE/pp.h \
+            ${PKGD}${libdir}/perl/${PV}/Config.pm \
+            ${PKGD}${libdir}/perl/${PV}/Config.pod \
+            ${PKGD}${libdir}/perl/${PV}/Config_heavy.pl \
+            ${PKGD}${libdir}/perl/${PV}/ExtUtils/Liblist/Kid.pm \
+            ${PKGD}${libdir}/perl/${PV}/FileCache.pm \
+            ${PKGD}${libdir}/perl/${PV}/pod/*.pod \
+            ${PKGD}${libdir}/perl/config.sh
+}
+
+PACKAGES = "perl-dbg perl perl-misc perl-dev perl-pod perl-doc perl-lib \
+            perl-module-cpan perl-module-cpanplus perl-module-unicore"
+FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV} \
+               ${libdir}/perl/${PV}/Config.pm \
+               ${libdir}/perl/${PV}/strict.pm \
+               ${libdir}/perl/${PV}/warnings.pm \
+               ${libdir}/perl/${PV}/warnings \
+               ${libdir}/perl/${PV}/vars.pm \
+              "
+FILES_${PN}_append_class-nativesdk = " ${bindir}/perl.real"
+RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
+                    perl-module-warnings-register"
+FILES_${PN}-dev = "${libdir}/perl/${PV}/CORE"
+FILES_${PN}-lib = "${libdir}/libperl.so* \
+                   ${libdir}/perl5 \
+                   ${libdir}/perl/config.sh \
+                   ${libdir}/perl/${PV}/Config_heavy.pl \
+                   ${libdir}/perl/${PV}/Config_heavy-target.pl"
+FILES_${PN}-pod = "${libdir}/perl/${PV}/pod \
+		   ${libdir}/perl/${PV}/*.pod \
+                   ${libdir}/perl/${PV}/*/*.pod \
+                   ${libdir}/perl/${PV}/*/*/*.pod "
+FILES_perl-misc = "${bindir}/*"
+FILES_${PN}-doc = "${libdir}/perl/${PV}/*/*.txt \
+                   ${libdir}/perl/${PV}/*/*/*.txt \
+                   ${libdir}/perl/${PV}/auto/XS/Typemap \
+                   ${libdir}/perl/${PV}/B/assemble \
+                   ${libdir}/perl/${PV}/B/cc_harness \
+                   ${libdir}/perl/${PV}/B/disassemble \
+                   ${libdir}/perl/${PV}/B/makeliblinks \
+                   ${libdir}/perl/${PV}/CGI/eg \
+                   ${libdir}/perl/${PV}/CPAN/PAUSE2003.pub \
+                   ${libdir}/perl/${PV}/CPAN/SIGNATURE \
+		   ${libdir}/perl/${PV}/CPANPLUS/Shell/Default/Plugins/HOWTO.pod \
+                   ${libdir}/perl/${PV}/Encode/encode.h \
+                   ${libdir}/perl/${PV}/ExtUtils/MANIFEST.SKIP \
+                   ${libdir}/perl/${PV}/ExtUtils/NOTES \
+                   ${libdir}/perl/${PV}/ExtUtils/PATCHING \
+                   ${libdir}/perl/${PV}/ExtUtils/typemap \
+                   ${libdir}/perl/${PV}/ExtUtils/xsubpp \
+		   ${libdir}/perl/${PV}/ExtUtils/Changes_EU-Install \
+                   ${libdir}/perl/${PV}/Net/*.eg \
+                   ${libdir}/perl/${PV}/unicore/mktables \
+                   ${libdir}/perl/${PV}/unicore/mktables.lst \
+                   ${libdir}/perl/${PV}/unicore/version "
+
+FILES_perl-module-cpan += "${libdir}/perl/${PV}/CPAN \
+                           ${libdir}/perl/${PV}/CPAN.pm"
+FILES_perl-module-cpanplus += "${libdir}/perl/${PV}/CPANPLUS \
+                               ${libdir}/perl/${PV}/CPANPLUS.pm"
+FILES_perl-module-unicore += "${libdir}/perl/${PV}/unicore"
+
+# Create a perl-modules package recommending all the other perl
+# packages (actually the non modules packages and not created too)
+ALLOW_EMPTY_perl-modules = "1"
+PACKAGES_append = " perl-modules "
+
+PACKAGESPLITFUNCS_prepend = "split_perl_packages "
+
+python split_perl_packages () {
+    libdir = d.expand('${libdir}/perl/${PV}')
+    do_split_packages(d, libdir, 'auto/([^.]*)/[^/]*\.(so|ld|ix|al)', 'perl-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
+    do_split_packages(d, libdir, 'Module/([^\/]*)\.pm', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+    do_split_packages(d, libdir, 'Module/([^\/]*)/.*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+    do_split_packages(d, libdir, '(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|auto\/)[^\/]).*)\.(pm|pl|e2x)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+
+    # perl-modules should recommend every perl module, and only the
+    # modules. Don't attempt to use the result of do_split_packages() as some
+    # modules are manually split (eg. perl-module-unicore).
+    packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES').split())
+    d.setVar(d.expand("RRECOMMENDS_${PN}-modules"), ' '.join(packages))
+}
+
+PACKAGES_DYNAMIC += "^perl-module-.*"
+PACKAGES_DYNAMIC_class-nativesdk += "^nativesdk-perl-module-.*"
+
+RPROVIDES_perl-lib = "perl-lib"
+
+require perl-rdepends_${PV}.inc
+require perl-ptest.inc
+
+SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
index ff8254c..dc44992 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
@@ -8,10 +8,6 @@
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
-DEPENDS = "glib-2.0"
-DEPENDS_class-native = ""
-DEPENDS_class-nativesdk = ""
-
 SRCREV = "87152c05be88ca8be71a3a563f275b3686d32c28"
 PV = "0.29.1+git${SRCPV}"
 
@@ -26,9 +22,16 @@
 
 inherit autotools
 
-EXTRA_OECONF = "--without-internal-glib"
-EXTRA_OECONF_class-native = "--with-internal-glib"
-EXTRA_OECONF_class-nativesdk = "--with-internal-glib"
+# Because of a faulty test, the current auto mode always evaluates to no,
+# so just continue that behaviour.
+#
+EXTRA_OECONF += "--disable-indirect-deps"
+
+PACKAGECONFIG ??= "glib"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[glib] = "--without-internal-glib,--with-internal-glib,glib-2.0 pkgconfig-native"
 
 acpaths = "-I ."
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb
index 7dc45c6..938ac8a 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb
@@ -1,6 +1,5 @@
 SUMMARY = "Postinstall scriptlets"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 FILES_${PN}_append = " ${datadir}/postinst-intercepts/*"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink_git.bb
index 0856b1c..4529dbf 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink_git.bb
@@ -132,7 +132,7 @@
 }
 
 python () {
-    overrides = d.getVar("OVERRIDES", True).split(":")
+    overrides = d.getVar("OVERRIDES").split(":")
     if "class-target" in overrides:
         bb.build.addtask('do_linkerpaths', 'do_configure', 'do_patch', d)
 }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Don-t-send-SIGUSR1-to-init.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Don-t-send-SIGUSR1-to-init.patch
deleted file mode 100644
index 6c694ce..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Don-t-send-SIGUSR1-to-init.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From befc6dbd6469d428c9e0830dbe51bdf7ac39d9ae Mon Sep 17 00:00:00 2001
-From: Seebs <seebs@seebs.net>
-Date: Thu, 22 Sep 2016 14:35:04 -0500
-Subject: [PATCH] Don't send SIGUSR1 to init.
-
-If the parent exits due to child process being slow, getppid() will return
-1, and we'll send SIGUSR1 to init, which can break things like dumbinit
-which aren't adequately protected against non-root processes sending them
-signals.
-
-Signed-off-by: Seebs <seebs@seebs.net>
-
-Upstream-Status: Backport (commit befc6dbd6469d428c9e0830dbe51bdf7ac39d9ae)
-
-[YOCTO #10324]
-
-This resolves an issue where a docker container running builds would die
-due to it's 'mini init' being signaled by pseudo.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
----
- pseudo_server.c | 11 ++++++++---
-
-diff --git a/pseudo_server.c b/pseudo_server.c
-index 65102dd..8731d20 100644
---- a/pseudo_server.c
-+++ b/pseudo_server.c
-@@ -358,9 +358,14 @@ pseudo_server_start(int daemonize) {
- 	signal(SIGTERM, quit_now);
- 	/* tell parent process to stop waiting */
- 	if (daemonize) {
--		pseudo_diag("Setup complete, sending SIGUSR1 to pid %d.\n",
--			getppid());
--		kill(getppid(), SIGUSR1);
-+		pid_t ppid = getppid();
-+		if (ppid == 1) {
-+			pseudo_diag("Setup complete, but parent is init, not sending SIGUSR1.\n");
-+		} else {
-+			pseudo_diag("Setup complete, sending SIGUSR1 to pid %d.\n",
-+				ppid);
-+			kill(ppid, SIGUSR1);
-+		}
- 	}
- 	pseudo_server_loop();
- 	return 0;
--- 
-2.5.5
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch
deleted file mode 100644
index d4b9f6a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From eead8a505245a292c43f070c0e836cdfeb7bd7bd Mon Sep 17 00:00:00 2001
-From: Seebs <seebs@seebs.net>
-Date: Wed, 28 Sep 2016 17:05:17 -0500
-Subject: [PATCH 1/2] Quiet diagnostics during startup for pseudo -d
-
-When the client spawns a pseudo server, it starts out sending diagnostics
-to stderr. This can be spammy in some cases with races during startup;
-everything resolves, but we get scary-looking diagnostics. So shove
-those into a log file.
-
-Signed-off-by: Seebs <seebs@seebs.net>
-
-Upstream-Status: Backport
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- ChangeLog.txt   | 5 +++++
- pseudo_server.c | 4 +++-
- 2 files changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/ChangeLog.txt b/ChangeLog.txt
-index d6359ca..4cc24de 100644
---- a/ChangeLog.txt
-+++ b/ChangeLog.txt
-@@ -1,3 +1,8 @@
-+2016-09-28:
-+	* (seebs) Send errors to log when daemonizing, but do that a lot
-+	  sooner to prevent startup messages which can show up spuriously
-+	  with multiple clients.
-+
- 2016-07-28:
- 	* (seebs) Fix performance issue on deletion with xattr changes.
- 
-diff --git a/pseudo_server.c b/pseudo_server.c
-index 8731d20..7c2db2f 100644
---- a/pseudo_server.c
-+++ b/pseudo_server.c
-@@ -162,6 +162,9 @@ pseudo_server_start(int daemonize) {
- 	 * SIGUSR1, or until too much time has passed. */
- 	if (daemonize) {
- 		int child;
-+
-+		/* make startup messages go away when invoked-as-daemon */
-+		pseudo_debug_logfile(PSEUDO_LOGFILE, 2);
- 		child = fork();
- 		if (child == -1) {
- 			pseudo_diag("Couldn't fork child process: %s\n",
-@@ -231,7 +234,6 @@ pseudo_server_start(int daemonize) {
- 			setsid();
- 			fclose(stdin);
- 			fclose(stdout);
--			pseudo_debug_logfile(PSEUDO_LOGFILE, 2);
- 			/* and then just execute the server code normally.  */
- 			/* Any logging will presumably go to logfile, but
- 			 * exit status will make it back to the parent for
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch
deleted file mode 100644
index dd6fd87..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 7a0632cad851826d804db0540d9a59773e6bf29c Mon Sep 17 00:00:00 2001
-From: Seebs <seebs@seebs.net>
-Date: Wed, 28 Sep 2016 22:12:29 -0500
-Subject: [PATCH 2/2] Use correct file descriptor
-
-So it turns out that pseudo_logfile() was returning 0 or -1, and
-pseudo_debug_logfile() was expecting it to be the correct file descriptor
-to use. And it's basically a mystery that any of that ever worked.
-
-Signed-off-by: Seebs <seebs@seebs.net>
-
-Upstream-Status: Backport
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- ChangeLog.txt | 3 +++
- pseudo_util.c | 3 ++-
- 2 files changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/ChangeLog.txt b/ChangeLog.txt
-index 4cc24de..49a6c36 100644
---- a/ChangeLog.txt
-+++ b/ChangeLog.txt
-@@ -2,6 +2,9 @@
- 	* (seebs) Send errors to log when daemonizing, but do that a lot
- 	  sooner to prevent startup messages which can show up spuriously
- 	  with multiple clients.
-+	* (seebs) return file descriptor from pseudo_logfile, so we set
-+	  pseudo_util_debug_fd to the right value instead of to stdin.
-+	  Nice bug.
- 
- 2016-07-28:
- 	* (seebs) Fix performance issue on deletion with xattr changes.
-diff --git a/pseudo_util.c b/pseudo_util.c
-index 0c156cf..a60c74b 100644
---- a/pseudo_util.c
-+++ b/pseudo_util.c
-@@ -1569,7 +1569,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) {
- 	if (fd == -1)
- 		return -1;
- 	else
--		return 0;
-+		return fd;
- }
- 
- int
-@@ -1579,6 +1579,7 @@ pseudo_debug_logfile(char *defname, int prefer_fd) {
- 
- 	fd = pseudo_logfile(filename, defname, prefer_fd);
- 	if (fd > -1) {
-+		pseudo_diag("debug_logfile: fd %d\n", fd);
- 		pseudo_util_debug_fd = fd;
- 		return 0;
- 	}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch
deleted file mode 100644
index 739c03e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From d9ab3a0acc94151048498b1ea4d69e7707df1526 Mon Sep 17 00:00:00 2001
-From: Seebs <seebs@seebs.net>
-Date: Fri, 30 Sep 2016 10:56:35 -0500
-Subject: [PATCH 3/3] Fix renameat (parallel to previous fix to rename)
-
-There was a bug in rename(), which was duplicated when renameat() was
-implemented, and which got fixed two years ago for rename(), but no
-one ever uses renameat() so it didn't get fixed there. Thanks
-to Anton Gerasimov <anton@advancedtelematic.com> for the bug report
-and patch.
-
-Signed-off-by: Seebs <seebs@seebs.net>
-
-Upstream-Status: Backport
-Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
-
----
- ChangeLog.txt              | 4 ++++
- ports/unix/guts/renameat.c | 7 ++++++-
- 2 files changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/ChangeLog.txt b/ChangeLog.txt
-index 65b9759..ca04cc0 100644
---- a/ChangeLog.txt
-+++ b/ChangeLog.txt
-@@ -1,3 +1,7 @@
-+2016-09-30:
-+	* (seebs) Fix rename at, matching fix from ee00f63d for rename. Bug
-+	  and fix provided by Anton Gerasimov <anton@advancedtelematic.com>.
-+
- 2016-09-28:
- 	* (seebs) Send errors to log when daemonizing, but do that a lot
- 	  sooner to prevent startup messages which can show up spuriously
-diff --git a/ports/unix/guts/renameat.c b/ports/unix/guts/renameat.c
-index ade0509..d5e36fa 100644
---- a/ports/unix/guts/renameat.c
-+++ b/ports/unix/guts/renameat.c
-@@ -11,6 +11,7 @@
- 	int oldrc, newrc;
- 	int save_errno;
- 	int old_db_entry = 0;
-+	int may_unlinked = 0;
- 
- 	pseudo_debug(PDBGF_FILE, "renameat: %d,%s->%d,%s\n",
- 		olddirfd, oldpath ? oldpath : "<nil>",
-@@ -44,10 +45,14 @@
- 	/* as with unlink, we have to mark that the file may get deleted */
- 	msg = pseudo_client_op(OP_MAY_UNLINK, 0, -1, newdirfd, newpath, newrc ? NULL : &newbuf);
- 	if (msg && msg->result == RESULT_SUCCEED)
-+		may_unlinked = 1;
-+	msg = pseudo_client_op(OP_STAT, 0, -1, olddirfd, oldpath, oldrc ? NULL : &oldbuf);
-+	if (msg && msg->result == RESULT_SUCCEED)
- 		old_db_entry = 1;
-+
- 	rc = real_renameat(olddirfd, oldpath, newdirfd, newpath);
- 	save_errno = errno;
--	if (old_db_entry) {
-+	if (may_unlinked) {
- 		if (rc == -1) {
- 			/* since we failed, that wasn't really unlinked -- put
- 			 * it back.
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch
deleted file mode 100644
index 4e072e6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-From 0d9071f3090bbd7880558f3b488b236ac19b44fc Mon Sep 17 00:00:00 2001
-From: seebs <seebs@seebs.net>
-Date: Thu, 28 Jul 2016 14:02:12 -0500
-Subject: [PATCH 1/2] Fix xattr performance
-
-When deleting files, we *do* know the inode and attribute, most of the
-time, so we pass those in whenever possible. The full purge of unmatched
-xattrs should not happen when the correct dev/ino are believed to be known.
-
-Signed-off-by: Seebs <seebs@seebs.net>
-
-[YOCTO #9929]
-Upstream-Status: Backport (0d9071f3090bbd7880558f3b488b236ac19b44fc)
-Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
----
- ChangeLog.txt |  3 +++
- pseudo.c      | 11 ++++++++---
- pseudo_db.c   | 15 +++++++++------
- pseudo_db.h   |  2 +-
- 4 files changed, 21 insertions(+), 10 deletions(-)
-
-diff --git a/ChangeLog.txt b/ChangeLog.txt
-index 131f163..d6359ca 100644
---- a/ChangeLog.txt
-+++ b/ChangeLog.txt
-@@ -1,3 +1,6 @@
-+2016-07-28:
-+	* (seebs) Fix performance issue on deletion with xattr changes.
-+
- 2016-07-08:
- 	* (RP) release 1.8.1
- 	* (joshuagl) Fix log table creation issue
-diff --git a/pseudo.c b/pseudo.c
-index 52f649f..db1c400 100644
---- a/pseudo.c
-+++ b/pseudo.c
-@@ -600,7 +600,12 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
- 				if (by_path.deleting != 0) {
- 					pseudo_debug(PDBGF_FILE, "inode mismatch for '%s' -- old one was marked for deletion, deleting.\n",
- 						msg->path);
--					pdb_did_unlink_file(msg->path, by_path.deleting);
-+					/* in this case, we don't trust the
-+					 * existing entries, so we will do the
-+					 * more expensive sweep for stray
-+					 * xattrs.
-+					 */
-+					pdb_did_unlink_file(msg->path, NULL, by_path.deleting);
- 				} else {
- 					pseudo_diag("inode mismatch: '%s' ino %llu in db, %llu in request.\n",
- 						msg->path,
-@@ -698,7 +703,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
- 				if (by_ino.deleting != 0) {
- 					pseudo_debug(PDBGF_FILE, "inode mismatch for '%s' -- old one was marked for deletion, deleting.\n",
- 						msg->path);
--					pdb_did_unlink_file(path_by_ino, by_ino.deleting);
-+					pdb_did_unlink_file(path_by_ino, &by_ino, by_ino.deleting);
- 				} else {
- 					pseudo_diag("path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n",
- 						msg->nlink,
-@@ -930,7 +935,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
- 		}
- 		break;
- 	case OP_DID_UNLINK:
--		pdb_did_unlink_file(msg->path, msg->client);
-+		pdb_did_unlink_file(msg->path, msg, msg->client);
- 		break;
- 	case OP_CANCEL_UNLINK:
- 		pdb_cancel_unlink_file(msg);
-diff --git a/pseudo_db.c b/pseudo_db.c
-index 289bb29..e7dd193 100644
---- a/pseudo_db.c
-+++ b/pseudo_db.c
-@@ -1848,7 +1848,7 @@ pdb_did_unlink_files(int deleting) {
- 
- /* confirm deletion of a specific file by a given client */
- int
--pdb_did_unlink_file(char *path, int deleting) {
-+pdb_did_unlink_file(char *path, pseudo_msg_t *msg, int deleting) {
- 	static sqlite3_stmt *delete_exact;
- 	int rc, exact;
- 	char *sql_delete_exact = "DELETE FROM files WHERE path = ? AND deleting = ?;";
-@@ -1878,11 +1878,14 @@ pdb_did_unlink_file(char *path, int deleting) {
- 	exact = sqlite3_changes(file_db);
- 	pseudo_debug(PDBGF_DB, "(exact %d)\n", exact);
- 	sqlite3_reset(delete_exact);
--	sqlite3_clear_bindings(delete_exact);
--	/* we have to clean everything because we don't know for sure the
--	 * device/inode...
--	 */
--	pdb_clear_unused_xattrs();
-+	if (msg) {
-+		pdb_clear_xattrs(msg);
-+	} else {
-+		/* we have to clean everything because we don't know for sure the
-+		 * device/inode...
-+		 */
-+		pdb_clear_unused_xattrs();
-+	}
- 	return rc != SQLITE_DONE;
- }
- 
-diff --git a/pseudo_db.h b/pseudo_db.h
-index a54f3c1..1b2599c 100644
---- a/pseudo_db.h
-+++ b/pseudo_db.h
-@@ -39,7 +39,7 @@ typedef struct {
- 
- extern int pdb_maybe_backup(void);
- extern int pdb_cancel_unlink_file(pseudo_msg_t *msg);
--extern int pdb_did_unlink_file(char *path, int deleting);
-+extern int pdb_did_unlink_file(char *path, pseudo_msg_t *msg, int deleting);
- extern int pdb_did_unlink_files(int deleting);
- extern int pdb_link_file(pseudo_msg_t *msg);
- extern int pdb_may_unlink_file(pseudo_msg_t *msg, int deleting);
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/More-correctly-fix-xattrs.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/More-correctly-fix-xattrs.patch
deleted file mode 100644
index 3d178f9..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/More-correctly-fix-xattrs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 45eca34c754d416a38bee90fb2d3c110a0b6cc5f Mon Sep 17 00:00:00 2001
-From: Seebs <seebs@seebs.net>
-Date: Thu, 3 Nov 2016 11:36:12 -0500
-Subject: [PATCH] More-correctly fix xattrs
-
-Fix provided by Patrick Ohly <patrick.ohly@intel.com>. This resolves
-the actual cause of the path length mismatches, and explains why
-I couldn't quite explain why the previous one had only sometimes
-worked, also why it showed up on directories but not plain files.
-
-Signed-off-by: Seebs <seebs@seebs.net>
-
-Fixes [YOCTO #10623]
-
-Upstream-Status: Backport [commit 45eca34c754d416a38bee90fb2d3c110a0b6cc5f]
-
-Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
----
- pseudo_client.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pseudo_client.c b/pseudo_client.c
-index 6a08df3..b1a00fa 100644
---- a/pseudo_client.c
-+++ b/pseudo_client.c
-@@ -1676,7 +1676,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path
- 	 * empty path for that.
- 	 */
- 	if (path_extra_1) {
--		size_t full_len = path_extra_1len + 1 + pathlen;
-+		size_t full_len = path_extra_1len + 1 + pathlen - strip_slash;
- 		size_t partial_len = pathlen - 1 - strip_slash;
- 		if (path_extra_2) {
- 			full_len += path_extra_2len + 1;
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch
new file mode 100644
index 0000000..3045a3b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch
@@ -0,0 +1,48 @@
+From b6b68db896f9963558334aff7fca61adde4ec10f Mon Sep 17 00:00:00 2001
+From: Seebs <seebs@seebs.net>
+Date: Thu, 13 Apr 2017 18:12:01 -0500
+Subject: Prevent bash from segfaulting when unloading pseudo
+
+bash's extremely fancy internal awareness of how the environment looks
+means that, if you directly call the underlying libc "unsetenv" on
+a variable, bash can end up trying to access a null pointer. Fixing
+this generically is actually rather hard; you can't really avoid
+writing to environ on fork() or popen(), even if you change all
+execv*() functions to use the execv*e() variants. So for now, instead
+of unsetting the variable, set it to an empty string.
+
+Thanks to Saur in IRC for spotting this and helping debug it.
+
+Signed-off-by: Seebs <seebs@seebs.net>
+
+Upstream-Status: Backport
+
+diff --git a/ChangeLog.txt b/ChangeLog.txt
+index a2d30e9..8ba1ffa 100644
+--- a/ChangeLog.txt
++++ b/ChangeLog.txt
+@@ -1,3 +1,8 @@
++2017-04-13:
++	* (seebs) don't unset LD_PRELOAD or the like, because if you
++	  do that, bash can segfault because it "knows" how many
++	  fields are in environ.
++
+ 2017-02-24:
+ 	* (seebs) import posix_acl_default fix from Anton Gerasimov
+ 	  <anton@advancedtelematic.com>
+diff --git a/pseudo_util.c b/pseudo_util.c
+index 172990b..6a1fac2 100644
+--- a/pseudo_util.c
++++ b/pseudo_util.c
+@@ -844,7 +844,7 @@ void pseudo_dropenv() {
+ 		if (ld_preload && strlen(ld_preload)) {
+ 			SETENV(PRELINK_LIBRARIES, ld_preload, 1);
+ 		} else {
+-			UNSETENV(PRELINK_LIBRARIES);
++			SETENV(PRELINK_LIBRARIES, "", 1);
+ 		}
+ 	}
+ }
+-- 
+cgit v0.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/efe0be279901006f939cd357ccee47b651c786da.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/efe0be279901006f939cd357ccee47b651c786da.patch
new file mode 100644
index 0000000..64fc58c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/efe0be279901006f939cd357ccee47b651c786da.patch
@@ -0,0 +1,99 @@
+From efe0be279901006f939cd357ccee47b651c786da Mon Sep 17 00:00:00 2001
+From: Seebs <seebs@seebs.net>
+Date: Fri, 24 Feb 2017 12:47:38 -0600
+Subject: Don't try to record 0-length posix_acl_default xattrs
+
+Based on a submission from Anton Gerasimov <anton@advancedtelematic.com>
+
+On some systems, with some kernel configs, "cp -a" apparently tries to
+set an empty ACL list, with a valid header but no contents, which causes
+strange and mysterious behavior later if we actually create such an entry.
+So filter that out, also sanity-check a couple of other things.
+
+Signed-off-by: Seebs <seebs@seebs.net>
+
+Upstream-Status: Backport
+
+diff --git a/ChangeLog.txt b/ChangeLog.txt
+index ae2a6e9..a2d30e9 100644
+--- a/ChangeLog.txt
++++ b/ChangeLog.txt
+@@ -1,3 +1,6 @@
++2017-02-24:
++	* (seebs) import posix_acl_default fix from Anton Gerasimov
++	  <anton@advancedtelematic.com>
+ 2017-02-01:
+    * (seebs) handle xattr deletion slightly more carefully.
+    * (seebs) tag this as 1.8.2
+diff --git a/ports/linux/xattr/pseudo_wrappers.c b/ports/linux/xattr/pseudo_wrappers.c
+index 46bc053..d69d53e 100644
+--- a/ports/linux/xattr/pseudo_wrappers.c
++++ b/ports/linux/xattr/pseudo_wrappers.c
+@@ -62,9 +62,9 @@ static int
+ posix_permissions(const acl_header *header, int entries, int *extra, int *mode) {
+ 	int acl_seen = 0;
+ 	if (le32(header->version) != 2) {
+-		pseudo_diag("Fatal: ACL support no available for header version %d.\n",
++		pseudo_diag("Fatal: ACL support not available for header version %d.\n",
+ 			le32(header->version));
+-		return 1;
++		return -1;
+ 	}
+ 	*mode = 0;
+ 	*extra = 0;
+@@ -140,12 +140,38 @@ static int shared_setxattr(const char *path, int fd, const char *name, const voi
+ 	pseudo_debug(PDBGF_XATTR, "setxattr(%s [fd %d], %s => '%.*s')\n",
+ 		path ? path : "<no path>", fd, name, (int) size, (char *) value);
+ 
++	/* Filter out erroneous sizes for POSIX ACL
++	 *  see posix_acl_xattr_count in include/linux/posix_acl_xattr.h of Linux source code */
++	/* I don't think there's any posix_acl_* values that aren't in this format */
++	if (!strncmp(name, "system.posix_acl_", 17)) {
++		// ACL is corrupt, issue an error
++		if(size < sizeof(acl_header) || (size - sizeof(acl_header)) % sizeof(acl_entry) != 0) {
++			pseudo_debug(PDBGF_XATTR, "invalid data size for %s: %d\n",
++				name, (int) size);
++			errno = EINVAL;
++			return -1;
++		}
++
++		// ACL is empty, do nothing
++		if((size - sizeof(acl_header)) / sizeof(acl_entry) == 0) {
++			/* on some systems, "cp -a" will attempt to clone the
++			 * posix_acl_default entry for a directory (which would specify
++			 * default ACLs for new files in that directory), but if the
++			 * original was empty, we get a header but no entries. With
++			 * real xattr, that ends up being silently discarded, apparently,
++			 * so we discard it too.
++			 */
++			pseudo_debug(PDBGF_XATTR, "0-length ACL entry %s.\n", name);
++			return 0;
++		}
++	}
+ 	/* this may be a plain chmod */
+ 	if (!strcmp(name, "system.posix_acl_access")) {
+ 		int extra;
+ 		int mode;
+ 		int entries = (size - sizeof(acl_header)) / sizeof(acl_entry);
+-		if (!posix_permissions(value, entries, &extra, &mode)) {
++		int res = posix_permissions(value, entries, &extra, &mode);
++		if (res == 0) {
+ 			pseudo_debug(PDBGF_XATTR, "posix_acl_access translated to mode %04o. Remaining attribute(s): %d.\n",
+ 				mode, extra);
+ 			buf.st_mode = mode;
+@@ -164,8 +190,12 @@ static int shared_setxattr(const char *path, int fd, const char *name, const voi
+ 			if (!extra) {
+ 				return 0;
+ 			}
++		} else if (res == -1) {
++			errno = EOPNOTSUPP;
++			return -1;
+ 		}
+ 	}
++
+ 	if (!strcmp(name, "user.pseudo_data")) {
+ 		pseudo_debug(PDBGF_XATTR | PDBGF_XATTRDB, "user.pseudo_data xattribute does not get to go in database.\n");
+ 		return -1;
+-- 
+cgit v0.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd
index 0889c57..08611ba 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd
@@ -1,2 +1,3 @@
 root::0:0:root:/home/root:/bin/sh
+pseudopasswd:*:1:1:this-is-the-pseudo-passwd:/nonexistent:/bin/sh
 nobody:*:65534:65534:nobody:/nonexistent:/bin/sh
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
deleted file mode 100644
index 90b53c0..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-require pseudo.inc
-
-SRC_URI = "http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \
-           file://0001-configure-Prune-PIE-flags.patch \
-           file://fallback-passwd \
-           file://fallback-group \
-           file://moreretries.patch \
-           file://Fix-xattr-performance.patch \
-           file://0001-Don-t-send-SIGUSR1-to-init.patch \
-           file://0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch \
-           file://0002-Use-correct-file-descriptor.patch \
-           file://0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch \
-           file://More-correctly-fix-xattrs.patch \
-           "
-
-SRC_URI[md5sum] = "ee38e4fb62ff88ad067b1a5a3825bac7"
-SRC_URI[sha256sum] = "dac4ad2d21228053151121320f629d41dd5c0c87695ac4e7aea286c414192ab5"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb
new file mode 100644
index 0000000..b427b9a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb
@@ -0,0 +1,13 @@
+require pseudo.inc
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \
+           file://0001-configure-Prune-PIE-flags.patch \
+           file://fallback-passwd \
+           file://fallback-group \
+           file://moreretries.patch \
+           file://efe0be279901006f939cd357ccee47b651c786da.patch \
+           file://b6b68db896f9963558334aff7fca61adde4ec10f.patch \
+           "
+
+SRC_URI[md5sum] = "7d41e72188fbea1f696c399c1a435675"
+SRC_URI[sha256sum] = "ceb456bd47770a37ca20784a91d715c5a7601e07e26ab11b0c77e9203ed3d196"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb
index ac923bb..42c7b2e 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -1,7 +1,7 @@
 require pseudo.inc
 
-SRCREV = "45eca34c754d416a38bee90fb2d3c110a0b6cc5f"
-PV = "1.8.1+git${SRCPV}"
+SRCREV = "02168305b0a19f981ffe857f36eb256ba8810b77"
+PV = "1.8.2+git${SRCPV}"
 
 DEFAULT_PREFERENCE = "-1"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64n32/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64n32/config.h
deleted file mode 100644
index c30b868..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64n32/config.h
+++ /dev/null
@@ -1,139 +0,0 @@
-#define HAVE_ENDIAN_H 1
-#define SIZEOF_PY_INTPTR_T 8
-#define SIZEOF_PY_LONG_LONG 8
-#define MATHLIB m
-#define HAVE_SIN 1
-#define HAVE_COS 1
-#define HAVE_TAN 1
-#define HAVE_SINH 1
-#define HAVE_COSH 1
-#define HAVE_TANH 1
-#define HAVE_FABS 1
-#define HAVE_FLOOR 1
-#define HAVE_CEIL 1
-#define HAVE_SQRT 1
-#define HAVE_LOG10 1
-#define HAVE_LOG 1
-#define HAVE_EXP 1
-#define HAVE_ASIN 1
-#define HAVE_ACOS 1
-#define HAVE_ATAN 1
-#define HAVE_FMOD 1
-#define HAVE_MODF 1
-#define HAVE_FREXP 1
-#define HAVE_LDEXP 1
-#define HAVE_RINT 1
-#define HAVE_TRUNC 1
-#define HAVE_EXP2 1
-#define HAVE_LOG2 1
-#define HAVE_ATAN2 1
-#define HAVE_POW 1
-#define HAVE_NEXTAFTER 1
-#define HAVE_SINF 1
-#define HAVE_COSF 1
-#define HAVE_TANF 1
-#define HAVE_SINHF 1
-#define HAVE_COSHF 1
-#define HAVE_TANHF 1
-#define HAVE_FABSF 1
-#define HAVE_FLOORF 1
-#define HAVE_CEILF 1
-#define HAVE_RINTF 1
-#define HAVE_TRUNCF 1
-#define HAVE_SQRTF 1
-#define HAVE_LOG10F 1
-#define HAVE_LOGF 1
-#define HAVE_LOG1PF 1
-#define HAVE_EXPF 1
-#define HAVE_EXPM1F 1
-#define HAVE_ASINF 1
-#define HAVE_ACOSF 1
-#define HAVE_ATANF 1
-#define HAVE_ASINHF 1
-#define HAVE_ACOSHF 1
-#define HAVE_ATANHF 1
-#define HAVE_HYPOTF 1
-#define HAVE_ATAN2F 1
-#define HAVE_POWF 1
-#define HAVE_FMODF 1
-#define HAVE_MODFF 1
-#define HAVE_FREXPF 1
-#define HAVE_LDEXPF 1
-#define HAVE_EXP2F 1
-#define HAVE_LOG2F 1
-#define HAVE_COPYSIGNF 1
-#define HAVE_NEXTAFTERF 1
-#define HAVE_SINL 1
-#define HAVE_COSL 1
-#define HAVE_TANL 1
-#define HAVE_SINHL 1
-#define HAVE_COSHL 1
-#define HAVE_TANHL 1
-#define HAVE_FABSL 1
-#define HAVE_FLOORL 1
-#define HAVE_CEILL 1
-#define HAVE_RINTL 1
-#define HAVE_TRUNCL 1
-#define HAVE_SQRTL 1
-#define HAVE_LOG10L 1
-#define HAVE_LOGL 1
-#define HAVE_LOG1PL 1
-#define HAVE_EXPL 1
-#define HAVE_EXPM1L 1
-#define HAVE_ASINL 1
-#define HAVE_ACOSL 1
-#define HAVE_ATANL 1
-#define HAVE_ASINHL 1
-#define HAVE_ACOSHL 1
-#define HAVE_ATANHL 1
-#define HAVE_HYPOTL 1
-#define HAVE_ATAN2L 1
-#define HAVE_POWL 1
-#define HAVE_FMODL 1
-#define HAVE_MODFL 1
-#define HAVE_FREXPL 1
-#define HAVE_LDEXPL 1
-#define HAVE_EXP2L 1
-#define HAVE_LOG2L 1
-#define HAVE_COPYSIGNL 1
-#define HAVE_NEXTAFTERL 1
-#define HAVE_DECL_SIGNBIT
-#define HAVE_COMPLEX_H 1
-#define HAVE_CREAL 1
-#define HAVE_CIMAG 1
-#define HAVE_CABS 1
-#define HAVE_CARG 1
-#define HAVE_CEXP 1
-#define HAVE_CSQRT 1
-#define HAVE_CLOG 1
-#define HAVE_CCOS 1
-#define HAVE_CSIN 1
-#define HAVE_CPOW 1
-#define HAVE_CREALF 1
-#define HAVE_CIMAGF 1
-#define HAVE_CABSF 1
-#define HAVE_CARGF 1
-#define HAVE_CEXPF 1
-#define HAVE_CSQRTF 1
-#define HAVE_CLOGF 1
-#define HAVE_CCOSF 1
-#define HAVE_CSINF 1
-#define HAVE_CPOWF 1
-#define HAVE_CREALL 1
-#define HAVE_CIMAGL 1
-#define HAVE_CABSL 1
-#define HAVE_CARGL 1
-#define HAVE_CEXPL 1
-#define HAVE_CSQRTL 1
-#define HAVE_CLOGL 1
-#define HAVE_CCOSL 1
-#define HAVE_CSINL 1
-#define HAVE_CPOWL 1
-#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
-#ifndef __cplusplus
-/* #undef inline */
-#endif
-
-#ifndef _NPY_NPY_CONFIG_H_
-#error config.h should never be included directly, include npy_config.h instead
-#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64n32/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/_numpyconfig.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64n32/_numpyconfig.h
rename to import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/_numpyconfig.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/config.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64/config.h
rename to import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/config.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64n32/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/_numpyconfig.h
similarity index 100%
copy from import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64n32/_numpyconfig.h
copy to import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/_numpyconfig.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/config.h
new file mode 100644
index 0000000..4872703
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/config.h
@@ -0,0 +1,138 @@
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/_numpyconfig.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64/_numpyconfig.h
rename to import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/_numpyconfig.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/config.h
similarity index 100%
copy from import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64/config.h
copy to import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/config.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/_numpyconfig.h
similarity index 100%
copy from import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips64/_numpyconfig.h
copy to import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/_numpyconfig.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/config.h
new file mode 100644
index 0000000..4872703
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/config.h
@@ -0,0 +1,138 @@
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/_numpyconfig.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips/_numpyconfig.h
rename to import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/_numpyconfig.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/config.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mips/config.h
rename to import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/config.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsel/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/config.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsel/config.h
rename to import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/config.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsel/numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/numpyconfig.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsel/numpyconfig.h
rename to import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/numpyconfig.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.1.bb
deleted file mode 100644
index c94f5c3..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.1.bb
+++ /dev/null
@@ -1,105 +0,0 @@
-SUMMARY = "A sophisticated Numeric Processing Package for Python"
-SECTION = "devel/python"
-LICENSE = "PSF"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=7e51a5677b22b865abbfb3dff6ffb2d0"
-
-SRCNAME = "numpy"
-
-SRC_URI = "https://files.pythonhosted.org/packages/source/n/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
-           file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
-           file://remove-build-path-in-comments.patch \
-           file://fix_shebang_f2py.patch \
-           file://d70d37b7c4aa2af3fe879a0d858c54f2aa32a725.patch \
-           ${CONFIGFILESURI} "
-UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/numpy/files/"
-
-CONFIGFILESURI ?= ""
-
-CONFIGFILESURI_aarch64 = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_arm = " \
-    file://config.h \
-    file://numpyconfig.h \
-"
-CONFIGFILESURI_armeb = " \
-    file://config.h \
-    file://numpyconfig.h \
-"
-CONFIGFILESURI_mipsel = " \
-    file://config.h \
-    file://numpyconfig.h \
-"
-CONFIGFILESURI_x86 = " \
-    file://config.h \
-    file://numpyconfig.h \
-"
-CONFIGFILESURI_x86-64 = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_mips = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_powerpc = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_powerpc64 = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_mips64 = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_mips64n32 = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-
-S = "${WORKDIR}/numpy-${PV}"
-
-inherit setuptools
-
-# Make the build fail and replace *config.h with proper one
-# This is a ugly, ugly hack - Koen
-do_compile_prepend_class-target() {
-    ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build ${DISTUTILS_BUILD_ARGS} || \
-    true
-    cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/
-}
-
-FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a"
-
-SRC_URI[md5sum] = "2f44a895a8104ffac140c3a70edbd450"
-SRC_URI[sha256sum] = "dc4082c43979cc856a2bf352a8297ea109ccb3244d783ae067eb2ee5b0d577cd"
-
-# install what is needed for numpy.test()
-RDEPENDS_${PN} = "python-unittest \
-                  python-difflib \
-                  python-pprint \
-                  python-pickle \
-                  python-shell \
-                  python-nose \
-                  python-doctest \
-                  python-datetime \
-                  python-distutils \
-                  python-misc \
-                  python-mmap \
-                  python-netclient \
-                  python-numbers \
-                  python-pydoc \
-                  python-pkgutil \
-                  python-email \
-                  python-subprocess \
-                  python-compression \
-                  python-ctypes \
-                  python-threading \
-"
-
-RDEPENDS_${PN}_class-native = ""
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.2.bb
new file mode 100644
index 0000000..04c96d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.2.bb
@@ -0,0 +1,113 @@
+SUMMARY = "A sophisticated Numeric Processing Package for Python"
+SECTION = "devel/python"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=7e51a5677b22b865abbfb3dff6ffb2d0"
+
+SRCNAME = "numpy"
+
+SRC_URI = "https://files.pythonhosted.org/packages/source/n/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
+           file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
+           file://remove-build-path-in-comments.patch \
+           file://fix_shebang_f2py.patch \
+           file://d70d37b7c4aa2af3fe879a0d858c54f2aa32a725.patch \
+           ${CONFIGFILESURI} "
+UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/numpy/files/"
+
+CONFIGFILESURI ?= ""
+
+CONFIGFILESURI_aarch64 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_arm = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_armeb = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_mipsarcho32el = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_x86 = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_x86-64 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarcho32eb = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_powerpc = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_powerpc64 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn64eb = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn64el = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn32eb = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn32el = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+
+S = "${WORKDIR}/numpy-${PV}"
+
+inherit setuptools
+
+# Make the build fail and replace *config.h with proper one
+# This is a ugly, ugly hack - Koen
+do_compile_prepend_class-target() {
+    ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build ${DISTUTILS_BUILD_ARGS} || \
+    true
+    cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/
+}
+
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a"
+
+SRC_URI[md5sum] = "03bd7927c314c43780271bf1ab795ebc"
+SRC_URI[sha256sum] = "04db2fbd64e2e7c68e740b14402b25af51418fc43a59d9e54172b38b906b0f69"
+
+# install what is needed for numpy.test()
+RDEPENDS_${PN} = "python-unittest \
+                  python-difflib \
+                  python-pprint \
+                  python-pickle \
+                  python-shell \
+                  python-nose \
+                  python-doctest \
+                  python-datetime \
+                  python-distutils \
+                  python-misc \
+                  python-mmap \
+                  python-netclient \
+                  python-numbers \
+                  python-pydoc \
+                  python-pkgutil \
+                  python-email \
+                  python-subprocess \
+                  python-compression \
+                  python-ctypes \
+                  python-threading \
+"
+
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb
deleted file mode 100644
index 8b502fe..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb
+++ /dev/null
@@ -1,106 +0,0 @@
-SUMMARY = "A sophisticated Numeric Processing Package for Python"
-SECTION = "devel/python"
-LICENSE = "PSF"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=7e51a5677b22b865abbfb3dff6ffb2d0"
-
-SRCNAME = "numpy"
-
-SRC_URI = "https://files.pythonhosted.org/packages/source/n/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
-           file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
-           file://remove-build-path-in-comments.patch \
-           file://fix_shebang_f2py.patch \
-           file://d70d37b7c4aa2af3fe879a0d858c54f2aa32a725.patch \
-           ${CONFIGFILESURI} "
-UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/numpy/files/"
-
-CONFIGFILESURI ?= ""
-
-CONFIGFILESURI_aarch64 = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_arm = " \
-    file://config.h \
-    file://numpyconfig.h \
-"
-CONFIGFILESURI_armeb = " \
-    file://config.h \
-    file://numpyconfig.h \
-"
-CONFIGFILESURI_mipsel = " \
-    file://config.h \
-    file://numpyconfig.h \
-"
-CONFIGFILESURI_x86 = " \
-    file://config.h \
-    file://numpyconfig.h \
-"
-CONFIGFILESURI_x86-64 = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_mips = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_powerpc = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_powerpc64 = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_mips64 = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-CONFIGFILESURI_mips64n32 = " \
-    file://config.h \
-    file://_numpyconfig.h \
-"
-
-S = "${WORKDIR}/numpy-${PV}"
-
-inherit setuptools3
-
-# Make the build fail and replace *config.h with proper one
-# This is a ugly, ugly hack - Koen
-do_compile_prepend_class-target() {
-    ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build ${DISTUTILS_BUILD_ARGS} || \
-    true
-    cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/
-}
-
-FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a"
-
-SRC_URI[md5sum] = "bc56fb9fc2895aa4961802ffbdb31d0b"
-SRC_URI[sha256sum] = "a1d1268d200816bfb9727a7a27b78d8e37ecec2e4d5ebd33eb64e2789e0db43e"
-
-# install what is needed for numpy.test()
-RDEPENDS_${PN} = "python3-unittest \
-                  python3-difflib \
-                  python3-pprint \
-                  python3-pickle \
-                  python3-shell \
-                  python3-nose \
-                  python3-doctest \
-                  python3-datetime \
-                  python3-distutils \
-                  python3-misc \
-                  python3-mmap \
-                  python3-netclient \
-                  python3-numbers \
-                  python3-pydoc \
-                  python3-pkgutil \
-                  python3-email \
-                  python3-subprocess \
-                  python3-compression \
-                  python3-ctypes \
-                  python3-threading \
-                  python3-textutils \
-"
-
-RDEPENDS_${PN}_class-native = ""
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.2.bb
new file mode 100644
index 0000000..8f9665f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.2.bb
@@ -0,0 +1,114 @@
+SUMMARY = "A sophisticated Numeric Processing Package for Python"
+SECTION = "devel/python"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=7e51a5677b22b865abbfb3dff6ffb2d0"
+
+SRCNAME = "numpy"
+
+SRC_URI = "https://files.pythonhosted.org/packages/source/n/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
+           file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
+           file://remove-build-path-in-comments.patch \
+           file://fix_shebang_f2py.patch \
+           file://d70d37b7c4aa2af3fe879a0d858c54f2aa32a725.patch \
+           ${CONFIGFILESURI} "
+UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/numpy/files/"
+
+CONFIGFILESURI ?= ""
+
+CONFIGFILESURI_aarch64 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_arm = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_armeb = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_mipsarcho32el = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_x86 = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_x86-64 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarcho32eb = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_powerpc = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_powerpc64 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn64eb = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn64el = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn32eb = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn32el = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+
+S = "${WORKDIR}/numpy-${PV}"
+
+inherit setuptools3
+
+# Make the build fail and replace *config.h with proper one
+# This is a ugly, ugly hack - Koen
+do_compile_prepend_class-target() {
+    ${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build ${DISTUTILS_BUILD_ARGS} || \
+    true
+    cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/
+}
+
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a"
+
+SRC_URI[md5sum] = "03bd7927c314c43780271bf1ab795ebc"
+SRC_URI[sha256sum] = "04db2fbd64e2e7c68e740b14402b25af51418fc43a59d9e54172b38b906b0f69"
+
+# install what is needed for numpy.test()
+RDEPENDS_${PN} = "python3-unittest \
+                  python3-difflib \
+                  python3-pprint \
+                  python3-pickle \
+                  python3-shell \
+                  python3-nose \
+                  python3-doctest \
+                  python3-datetime \
+                  python3-distutils \
+                  python3-misc \
+                  python3-mmap \
+                  python3-netclient \
+                  python3-numbers \
+                  python3-pydoc \
+                  python3-pkgutil \
+                  python3-email \
+                  python3-subprocess \
+                  python3-compression \
+                  python3-ctypes \
+                  python3-threading \
+                  python3-textutils \
+"
+
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc
index 621024f..7ed254b 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc
@@ -1,7 +1,6 @@
 
 # WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
 # Generator: '../../../scripts/contrib/python/generate-manifest-2.7.py' Version 20110222.2 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
-# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
 
  
 
@@ -47,7 +46,7 @@
 
 SUMMARY_${PN}-core="Python interpreter and core modules"
 RDEPENDS_${PN}-core="${PN}-lang ${PN}-re"
-FILES_${PN}-core="${libdir}/python2.7/__future__.* ${libdir}/python2.7/_abcoll.* ${libdir}/python2.7/abc.* ${libdir}/python2.7/ast.* ${libdir}/python2.7/copy.* ${libdir}/python2.7/copy_reg.* ${libdir}/python2.7/ConfigParser.* ${libdir}/python2.7/genericpath.* ${libdir}/python2.7/getopt.* ${libdir}/python2.7/linecache.* ${libdir}/python2.7/new.* ${libdir}/python2.7/os.* ${libdir}/python2.7/posixpath.* ${libdir}/python2.7/struct.* ${libdir}/python2.7/warnings.* ${libdir}/python2.7/site.* ${libdir}/python2.7/stat.* ${libdir}/python2.7/UserDict.* ${libdir}/python2.7/UserList.* ${libdir}/python2.7/UserString.* ${libdir}/python2.7/lib-dynload/binascii.so ${libdir}/python2.7/lib-dynload/_struct.so ${libdir}/python2.7/lib-dynload/time.so ${libdir}/python2.7/lib-dynload/xreadlines.so ${libdir}/python2.7/types.* ${libdir}/python2.7/platform.* ${bindir}/python* ${libdir}/python2.7/_weakrefset.* ${libdir}/python2.7/sysconfig.* ${libdir}/python2.7/_sysconfigdata.* ${libdir}/python2.7/config/Makefile ${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
+FILES_${PN}-core="${libdir}/python2.7/__future__.* ${libdir}/python2.7/_abcoll.* ${libdir}/python2.7/abc.* ${libdir}/python2.7/ast.* ${libdir}/python2.7/copy.* ${libdir}/python2.7/copy_reg.* ${libdir}/python2.7/ConfigParser.* ${libdir}/python2.7/genericpath.* ${libdir}/python2.7/getopt.* ${libdir}/python2.7/linecache.* ${libdir}/python2.7/new.* ${libdir}/python2.7/os.* ${libdir}/python2.7/posixpath.* ${libdir}/python2.7/struct.* ${libdir}/python2.7/warnings.* ${libdir}/python2.7/site.* ${libdir}/python2.7/stat.* ${libdir}/python2.7/UserDict.* ${libdir}/python2.7/UserList.* ${libdir}/python2.7/UserString.* ${libdir}/python2.7/lib-dynload/binascii.so ${libdir}/python2.7/lib-dynload/_struct.so ${libdir}/python2.7/lib-dynload/time.so ${libdir}/python2.7/lib-dynload/xreadlines.so ${libdir}/python2.7/types.* ${libdir}/python2.7/platform.* ${bindir}/python* ${libdir}/python2.7/_weakrefset.* ${libdir}/python2.7/sysconfig.* ${libdir}/python2.7/_sysconfigdata.* ${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
 
 SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support"
 RDEPENDS_${PN}-crypt="${PN}-core"
@@ -75,7 +74,7 @@
 
 SUMMARY_${PN}-dev="Python development package"
 RDEPENDS_${PN}-dev="${PN}-core"
-FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig "
+FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig ${libdir}/python2.7/config/Makefile "
 
 SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects"
 RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc
index 6c690db..1e20f00 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc
@@ -1,280 +1,283 @@
 
 # WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
 # Generator: '../../../scripts/contrib/python/generate-manifest-3.5.py' Version 20140131 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
-# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
 
  
 
-PROVIDES+="${PN}-2to3 ${PN}-argparse ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils ${PN}-distutils-staticdev ${PN}-doctest ${PN}-email ${PN}-enum ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-selectors ${PN}-shell ${PN}-signal ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc "
+PROVIDES+="${PN}-2to3 ${PN}-argparse ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils ${PN}-distutils-staticdev ${PN}-doctest ${PN}-email ${PN}-enum ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-selectors ${PN}-shell ${PN}-signal ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-typing ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc "
 
-PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-argparse ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils-staticdev ${PN}-distutils ${PN}-doctest ${PN}-email ${PN}-enum ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-selectors ${PN}-shell ${PN}-signal ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-modules"
+PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-argparse ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils-staticdev ${PN}-distutils ${PN}-doctest ${PN}-email ${PN}-enum ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-selectors ${PN}-shell ${PN}-signal ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-typing ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-modules"
 
 SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator"
 RDEPENDS_${PN}-2to3="${PN}-core"
-FILES_${PN}-2to3="${libdir}/python3.5/lib2to3 "
+FILES_${PN}-2to3="${libdir}/python3.5/lib2to3 ${libdir}/python3.5/lib2to3/__pycache__ "
 
 SUMMARY_${PN}-argparse="Python command line argument parser"
 RDEPENDS_${PN}-argparse="${PN}-core ${PN}-codecs ${PN}-textutils"
-FILES_${PN}-argparse="${libdir}/python3.5/argparse.* "
+FILES_${PN}-argparse="${libdir}/python3.5/argparse.* ${libdir}/python3.5/__pycache__/argparse.* "
 
 SUMMARY_${PN}-asyncio="Python Asynchronous I/O, event loop, coroutines and tasks"
 RDEPENDS_${PN}-asyncio="${PN}-core"
-FILES_${PN}-asyncio="${libdir}/python3.5/asyncio "
+FILES_${PN}-asyncio="${libdir}/python3.5/asyncio ${libdir}/python3.5/asyncio/__pycache__ "
 
 SUMMARY_${PN}-audio="Python Audio Handling"
 RDEPENDS_${PN}-audio="${PN}-core"
-FILES_${PN}-audio="${libdir}/python3.5/wave.* ${libdir}/python3.5/chunk.* ${libdir}/python3.5/sndhdr.* ${libdir}/python3.5/lib-dynload/ossaudiodev.*.so ${libdir}/python3.5/lib-dynload/audioop.*.so ${libdir}/python3.5/audiodev.* ${libdir}/python3.5/sunaudio.* ${libdir}/python3.5/sunau.* ${libdir}/python3.5/toaiff.* "
+FILES_${PN}-audio="${libdir}/python3.5/wave.* ${libdir}/python3.5/__pycache__/wave.* ${libdir}/python3.5/chunk.* ${libdir}/python3.5/__pycache__/chunk.* ${libdir}/python3.5/sndhdr.* ${libdir}/python3.5/__pycache__/sndhdr.* ${libdir}/python3.5/lib-dynload/ossaudiodev.*.so ${libdir}/python3.5/lib-dynload/__pycache__/ossaudiodev.*.so ${libdir}/python3.5/lib-dynload/audioop.*.so ${libdir}/python3.5/lib-dynload/__pycache__/audioop.*.so ${libdir}/python3.5/audiodev.* ${libdir}/python3.5/__pycache__/audiodev.* ${libdir}/python3.5/sunaudio.* ${libdir}/python3.5/__pycache__/sunaudio.* ${libdir}/python3.5/sunau.* ${libdir}/python3.5/__pycache__/sunau.* ${libdir}/python3.5/toaiff.* ${libdir}/python3.5/__pycache__/toaiff.* "
 
 SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support"
 RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang"
-FILES_${PN}-codecs="${libdir}/python3.5/codecs.* ${libdir}/python3.5/encodings ${libdir}/python3.5/gettext.* ${libdir}/python3.5/locale.* ${libdir}/python3.5/lib-dynload/_locale.*.so ${libdir}/python3.5/lib-dynload/_codecs* ${libdir}/python3.5/lib-dynload/_multibytecodec.*.so ${libdir}/python3.5/lib-dynload/unicodedata.*.so ${libdir}/python3.5/stringprep.* ${libdir}/python3.5/xdrlib.* "
+FILES_${PN}-codecs="${libdir}/python3.5/codecs.* ${libdir}/python3.5/__pycache__/codecs.* ${libdir}/python3.5/encodings ${libdir}/python3.5/encodings/__pycache__ ${libdir}/python3.5/gettext.* ${libdir}/python3.5/__pycache__/gettext.* ${libdir}/python3.5/locale.* ${libdir}/python3.5/__pycache__/locale.* ${libdir}/python3.5/lib-dynload/_locale.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_locale.*.so ${libdir}/python3.5/lib-dynload/_codecs* ${libdir}/python3.5/lib-dynload/_codecs*/__pycache__ ${libdir}/python3.5/lib-dynload/_multibytecodec.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_multibytecodec.*.so ${libdir}/python3.5/lib-dynload/unicodedata.*.so ${libdir}/python3.5/lib-dynload/__pycache__/unicodedata.*.so ${libdir}/python3.5/stringprep.* ${libdir}/python3.5/__pycache__/stringprep.* ${libdir}/python3.5/xdrlib.* ${libdir}/python3.5/__pycache__/xdrlib.* "
 
 SUMMARY_${PN}-compile="Python bytecode compilation support"
 RDEPENDS_${PN}-compile="${PN}-core"
-FILES_${PN}-compile="${libdir}/python3.5/py_compile.* ${libdir}/python3.5/compileall.* "
+FILES_${PN}-compile="${libdir}/python3.5/py_compile.* ${libdir}/python3.5/__pycache__/py_compile.* ${libdir}/python3.5/compileall.* ${libdir}/python3.5/__pycache__/compileall.* "
 
 SUMMARY_${PN}-compression="Python high-level compression support"
 RDEPENDS_${PN}-compression="${PN}-core ${PN}-codecs ${PN}-importlib ${PN}-threading ${PN}-shell"
-FILES_${PN}-compression="${libdir}/python3.5/gzip.* ${libdir}/python3.5/zipfile.* ${libdir}/python3.5/tarfile.* ${libdir}/python3.5/lib-dynload/bz2.*.so ${libdir}/python3.5/lib-dynload/zlib.*.so "
+FILES_${PN}-compression="${libdir}/python3.5/gzip.* ${libdir}/python3.5/__pycache__/gzip.* ${libdir}/python3.5/zipfile.* ${libdir}/python3.5/__pycache__/zipfile.* ${libdir}/python3.5/tarfile.* ${libdir}/python3.5/__pycache__/tarfile.* ${libdir}/python3.5/lib-dynload/bz2.*.so ${libdir}/python3.5/lib-dynload/__pycache__/bz2.*.so ${libdir}/python3.5/lib-dynload/zlib.*.so ${libdir}/python3.5/lib-dynload/__pycache__/zlib.*.so "
 
 SUMMARY_${PN}-core="Python interpreter and core modules"
 RDEPENDS_${PN}-core="${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math"
-FILES_${PN}-core="${libdir}/python3.5/__future__.* ${libdir}/python3.5/_abcoll.* ${libdir}/python3.5/abc.* ${libdir}/python3.5/ast.* ${libdir}/python3.5/copy.* ${libdir}/python3.5/copyreg.* ${libdir}/python3.5/configparser.* ${libdir}/python3.5/genericpath.* ${libdir}/python3.5/getopt.* ${libdir}/python3.5/linecache.* ${libdir}/python3.5/new.* ${libdir}/python3.5/os.* ${libdir}/python3.5/posixpath.* ${libdir}/python3.5/struct.* ${libdir}/python3.5/warnings.* ${libdir}/python3.5/site.* ${libdir}/python3.5/stat.* ${libdir}/python3.5/UserDict.* ${libdir}/python3.5/UserList.* ${libdir}/python3.5/UserString.* ${libdir}/python3.5/lib-dynload/binascii.*.so ${libdir}/python3.5/lib-dynload/_struct.*.so ${libdir}/python3.5/lib-dynload/time.*.so ${libdir}/python3.5/lib-dynload/xreadlines.*.so ${libdir}/python3.5/types.* ${libdir}/python3.5/platform.* ${bindir}/python* ${libdir}/python3.5/_weakrefset.* ${libdir}/python3.5/sysconfig.* ${libdir}/python3.5/_sysconfigdata.* ${libdir}/python3.5/config/Makefile ${includedir}/python${PYTHON_BINABI}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/collections ${libdir}/python${PYTHON_MAJMIN}/_collections_abc.* ${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.* ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
+FILES_${PN}-core="${libdir}/python3.5/__future__.* ${libdir}/python3.5/__pycache__/__future__.* ${libdir}/python3.5/_abcoll.* ${libdir}/python3.5/__pycache__/_abcoll.* ${libdir}/python3.5/abc.* ${libdir}/python3.5/__pycache__/abc.* ${libdir}/python3.5/ast.* ${libdir}/python3.5/__pycache__/ast.* ${libdir}/python3.5/copy.* ${libdir}/python3.5/__pycache__/copy.* ${libdir}/python3.5/copyreg.* ${libdir}/python3.5/__pycache__/copyreg.* ${libdir}/python3.5/configparser.* ${libdir}/python3.5/__pycache__/configparser.* ${libdir}/python3.5/genericpath.* ${libdir}/python3.5/__pycache__/genericpath.* ${libdir}/python3.5/getopt.* ${libdir}/python3.5/__pycache__/getopt.* ${libdir}/python3.5/linecache.* ${libdir}/python3.5/__pycache__/linecache.* ${libdir}/python3.5/new.* ${libdir}/python3.5/__pycache__/new.* ${libdir}/python3.5/os.* ${libdir}/python3.5/__pycache__/os.* ${libdir}/python3.5/posixpath.* ${libdir}/python3.5/__pycache__/posixpath.* ${libdir}/python3.5/struct.* ${libdir}/python3.5/__pycache__/struct.* ${libdir}/python3.5/warnings.* ${libdir}/python3.5/__pycache__/warnings.* ${libdir}/python3.5/site.* ${libdir}/python3.5/__pycache__/site.* ${libdir}/python3.5/stat.* ${libdir}/python3.5/__pycache__/stat.* ${libdir}/python3.5/UserDict.* ${libdir}/python3.5/__pycache__/UserDict.* ${libdir}/python3.5/UserList.* ${libdir}/python3.5/__pycache__/UserList.* ${libdir}/python3.5/UserString.* ${libdir}/python3.5/__pycache__/UserString.* ${libdir}/python3.5/lib-dynload/binascii.*.so ${libdir}/python3.5/lib-dynload/__pycache__/binascii.*.so ${libdir}/python3.5/lib-dynload/_struct.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_struct.*.so ${libdir}/python3.5/lib-dynload/time.*.so ${libdir}/python3.5/lib-dynload/__pycache__/time.*.so ${libdir}/python3.5/lib-dynload/xreadlines.*.so ${libdir}/python3.5/lib-dynload/__pycache__/xreadlines.*.so ${libdir}/python3.5/types.* ${libdir}/python3.5/__pycache__/types.* ${libdir}/python3.5/platform.* ${libdir}/python3.5/__pycache__/platform.* ${bindir}/python* ${libdir}/python3.5/_weakrefset.* ${libdir}/python3.5/__pycache__/_weakrefset.* ${libdir}/python3.5/sysconfig.* ${libdir}/python3.5/__pycache__/sysconfig.* ${libdir}/python3.5/_sysconfigdata.* ${libdir}/python3.5/__pycache__/_sysconfigdata.* ${includedir}/python${PYTHON_BINABI}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/collections ${libdir}/python${PYTHON_MAJMIN}/_collections_abc.* ${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.* ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
 
 SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support"
 RDEPENDS_${PN}-crypt="${PN}-core"
-FILES_${PN}-crypt="${libdir}/python3.5/hashlib.* ${libdir}/python3.5/md5.* ${libdir}/python3.5/sha.* ${libdir}/python3.5/lib-dynload/crypt.*.so ${libdir}/python3.5/lib-dynload/_hashlib.*.so ${libdir}/python3.5/lib-dynload/_sha256.*.so ${libdir}/python3.5/lib-dynload/_sha512.*.so "
+FILES_${PN}-crypt="${libdir}/python3.5/hashlib.* ${libdir}/python3.5/__pycache__/hashlib.* ${libdir}/python3.5/md5.* ${libdir}/python3.5/__pycache__/md5.* ${libdir}/python3.5/sha.* ${libdir}/python3.5/__pycache__/sha.* ${libdir}/python3.5/lib-dynload/crypt.*.so ${libdir}/python3.5/lib-dynload/__pycache__/crypt.*.so ${libdir}/python3.5/lib-dynload/_hashlib.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_hashlib.*.so ${libdir}/python3.5/lib-dynload/_sha256.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_sha256.*.so ${libdir}/python3.5/lib-dynload/_sha512.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_sha512.*.so "
 
 SUMMARY_${PN}-ctypes="Python C types support"
 RDEPENDS_${PN}-ctypes="${PN}-core ${PN}-subprocess"
-FILES_${PN}-ctypes="${libdir}/python3.5/ctypes ${libdir}/python3.5/lib-dynload/_ctypes.*.so ${libdir}/python3.5/lib-dynload/_ctypes_test.*.so "
+FILES_${PN}-ctypes="${libdir}/python3.5/ctypes ${libdir}/python3.5/ctypes/__pycache__ ${libdir}/python3.5/lib-dynload/_ctypes.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_ctypes.*.so ${libdir}/python3.5/lib-dynload/_ctypes_test.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_ctypes_test.*.so "
 
 SUMMARY_${PN}-curses="Python curses support"
 RDEPENDS_${PN}-curses="${PN}-core"
-FILES_${PN}-curses="${libdir}/python3.5/curses ${libdir}/python3.5/lib-dynload/_curses.*.so ${libdir}/python3.5/lib-dynload/_curses_panel.*.so "
+FILES_${PN}-curses="${libdir}/python3.5/curses ${libdir}/python3.5/curses/__pycache__ ${libdir}/python3.5/lib-dynload/_curses.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_curses.*.so ${libdir}/python3.5/lib-dynload/_curses_panel.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_curses_panel.*.so "
 
 SUMMARY_${PN}-datetime="Python calendar and time support"
 RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs"
-FILES_${PN}-datetime="${libdir}/python3.5/_strptime.* ${libdir}/python3.5/calendar.* ${libdir}/python3.5/datetime.* ${libdir}/python3.5/lib-dynload/_datetime.*.so "
+FILES_${PN}-datetime="${libdir}/python3.5/_strptime.* ${libdir}/python3.5/__pycache__/_strptime.* ${libdir}/python3.5/calendar.* ${libdir}/python3.5/__pycache__/calendar.* ${libdir}/python3.5/datetime.* ${libdir}/python3.5/__pycache__/datetime.* ${libdir}/python3.5/lib-dynload/_datetime.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_datetime.*.so "
 
 SUMMARY_${PN}-db="Python file-based database support"
 RDEPENDS_${PN}-db="${PN}-core"
-FILES_${PN}-db="${libdir}/python3.5/anydbm.* ${libdir}/python3.5/dumbdbm.* ${libdir}/python3.5/whichdb.* ${libdir}/python3.5/dbm ${libdir}/python3.5/lib-dynload/_dbm.*.so "
+FILES_${PN}-db="${libdir}/python3.5/anydbm.* ${libdir}/python3.5/__pycache__/anydbm.* ${libdir}/python3.5/dumbdbm.* ${libdir}/python3.5/__pycache__/dumbdbm.* ${libdir}/python3.5/whichdb.* ${libdir}/python3.5/__pycache__/whichdb.* ${libdir}/python3.5/dbm ${libdir}/python3.5/dbm/__pycache__ ${libdir}/python3.5/lib-dynload/_dbm.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_dbm.*.so "
 
 SUMMARY_${PN}-debugger="Python debugger"
 RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint ${PN}-importlib ${PN}-pkgutil"
-FILES_${PN}-debugger="${libdir}/python3.5/bdb.* ${libdir}/python3.5/pdb.* "
+FILES_${PN}-debugger="${libdir}/python3.5/bdb.* ${libdir}/python3.5/__pycache__/bdb.* ${libdir}/python3.5/pdb.* ${libdir}/python3.5/__pycache__/pdb.* "
 
 SUMMARY_${PN}-dev="Python development package"
 RDEPENDS_${PN}-dev="${PN}-core"
-FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig "
+FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig ${libdir}/python3.5/config/Makefile ${libdir}/python3.5/config/Makefile/__pycache__ "
 
 SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects"
 RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
-FILES_${PN}-difflib="${libdir}/python3.5/difflib.* "
+FILES_${PN}-difflib="${libdir}/python3.5/difflib.* ${libdir}/python3.5/__pycache__/difflib.* "
 
 SUMMARY_${PN}-distutils="Python Distribution Utilities"
 RDEPENDS_${PN}-distutils="${PN}-core ${PN}-email"
-FILES_${PN}-distutils="${libdir}/python3.5/config ${libdir}/python3.5/distutils "
+FILES_${PN}-distutils="${libdir}/python3.5/config ${libdir}/python3.5/config/__pycache__ ${libdir}/python3.5/distutils ${libdir}/python3.5/distutils/__pycache__ "
 
 SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)"
 RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils"
-FILES_${PN}-distutils-staticdev="${libdir}/python3.5/config/lib*.a "
+FILES_${PN}-distutils-staticdev="${libdir}/python3.5/config/lib*.a ${libdir}/python3.5/config/__pycache__/lib*.a "
 
 SUMMARY_${PN}-doctest="Python framework for running examples in docstrings"
 RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib"
-FILES_${PN}-doctest="${libdir}/python3.5/doctest.* "
+FILES_${PN}-doctest="${libdir}/python3.5/doctest.* ${libdir}/python3.5/__pycache__/doctest.* "
 
 SUMMARY_${PN}-email="Python email support"
 RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient"
-FILES_${PN}-email="${libdir}/python3.5/imaplib.* ${libdir}/python3.5/email "
+FILES_${PN}-email="${libdir}/python3.5/imaplib.* ${libdir}/python3.5/__pycache__/imaplib.* ${libdir}/python3.5/email ${libdir}/python3.5/email/__pycache__ "
 
 SUMMARY_${PN}-enum="Python support for enumerations"
 RDEPENDS_${PN}-enum="${PN}-core"
-FILES_${PN}-enum="${libdir}/python3.5/enum.* "
+FILES_${PN}-enum="${libdir}/python3.5/enum.* ${libdir}/python3.5/__pycache__/enum.* "
 
 SUMMARY_${PN}-fcntl="Python's fcntl interface"
 RDEPENDS_${PN}-fcntl="${PN}-core"
-FILES_${PN}-fcntl="${libdir}/python3.5/lib-dynload/fcntl.*.so "
+FILES_${PN}-fcntl="${libdir}/python3.5/lib-dynload/fcntl.*.so ${libdir}/python3.5/lib-dynload/__pycache__/fcntl.*.so "
 
 SUMMARY_${PN}-gdbm="Python GNU database support"
 RDEPENDS_${PN}-gdbm="${PN}-core"
-FILES_${PN}-gdbm="${libdir}/python3.5/lib-dynload/_gdbm.*.so "
+FILES_${PN}-gdbm="${libdir}/python3.5/lib-dynload/_gdbm.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_gdbm.*.so "
 
 SUMMARY_${PN}-html="Python HTML processing support"
 RDEPENDS_${PN}-html="${PN}-core"
-FILES_${PN}-html="${libdir}/python3.5/formatter.* ${libdir}/python3.5/htmlentitydefs.* ${libdir}/python3.5/htmllib.* ${libdir}/python3.5/markupbase.* ${libdir}/python3.5/sgmllib.* ${libdir}/python3.5/HTMLParser.* "
+FILES_${PN}-html="${libdir}/python3.5/formatter.* ${libdir}/python3.5/__pycache__/formatter.* ${libdir}/python3.5/htmlentitydefs.* ${libdir}/python3.5/__pycache__/htmlentitydefs.* ${libdir}/python3.5/html ${libdir}/python3.5/html/__pycache__ ${libdir}/python3.5/htmllib.* ${libdir}/python3.5/__pycache__/htmllib.* ${libdir}/python3.5/markupbase.* ${libdir}/python3.5/__pycache__/markupbase.* ${libdir}/python3.5/sgmllib.* ${libdir}/python3.5/__pycache__/sgmllib.* ${libdir}/python3.5/HTMLParser.* ${libdir}/python3.5/__pycache__/HTMLParser.* "
 
 SUMMARY_${PN}-idle="Python Integrated Development Environment"
 RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
-FILES_${PN}-idle="${bindir}/idle ${libdir}/python3.5/idlelib "
+FILES_${PN}-idle="${bindir}/idle ${libdir}/python3.5/idlelib ${libdir}/python3.5/idlelib/__pycache__ "
 
 SUMMARY_${PN}-image="Python graphical image handling"
 RDEPENDS_${PN}-image="${PN}-core"
-FILES_${PN}-image="${libdir}/python3.5/colorsys.* ${libdir}/python3.5/imghdr.* ${libdir}/python3.5/lib-dynload/imageop.*.so ${libdir}/python3.5/lib-dynload/rgbimg.*.so "
+FILES_${PN}-image="${libdir}/python3.5/colorsys.* ${libdir}/python3.5/__pycache__/colorsys.* ${libdir}/python3.5/imghdr.* ${libdir}/python3.5/__pycache__/imghdr.* ${libdir}/python3.5/lib-dynload/imageop.*.so ${libdir}/python3.5/lib-dynload/__pycache__/imageop.*.so ${libdir}/python3.5/lib-dynload/rgbimg.*.so ${libdir}/python3.5/lib-dynload/__pycache__/rgbimg.*.so "
 
 SUMMARY_${PN}-importlib="Python import implementation library"
 RDEPENDS_${PN}-importlib="${PN}-core ${PN}-lang"
-FILES_${PN}-importlib="${libdir}/python3.5/importlib ${libdir}/python3.5/imp.* "
+FILES_${PN}-importlib="${libdir}/python3.5/importlib ${libdir}/python3.5/importlib/__pycache__ ${libdir}/python3.5/imp.* ${libdir}/python3.5/__pycache__/imp.* "
 
 SUMMARY_${PN}-io="Python low-level I/O"
 RDEPENDS_${PN}-io="${PN}-core ${PN}-math"
-FILES_${PN}-io="${libdir}/python3.5/lib-dynload/_socket.*.so ${libdir}/python3.5/lib-dynload/_io.*.so ${libdir}/python3.5/lib-dynload/_ssl.*.so ${libdir}/python3.5/lib-dynload/select.*.so ${libdir}/python3.5/lib-dynload/termios.*.so ${libdir}/python3.5/lib-dynload/cStringIO.*.so ${libdir}/python3.5/pipes.* ${libdir}/python3.5/socket.* ${libdir}/python3.5/ssl.* ${libdir}/python3.5/tempfile.* ${libdir}/python3.5/StringIO.* ${libdir}/python3.5/io.* ${libdir}/python3.5/_pyio.* "
+FILES_${PN}-io="${libdir}/python3.5/lib-dynload/_socket.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_socket.*.so ${libdir}/python3.5/lib-dynload/_io.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_io.*.so ${libdir}/python3.5/lib-dynload/_ssl.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_ssl.*.so ${libdir}/python3.5/lib-dynload/select.*.so ${libdir}/python3.5/lib-dynload/__pycache__/select.*.so ${libdir}/python3.5/lib-dynload/termios.*.so ${libdir}/python3.5/lib-dynload/__pycache__/termios.*.so ${libdir}/python3.5/lib-dynload/cStringIO.*.so ${libdir}/python3.5/lib-dynload/__pycache__/cStringIO.*.so ${libdir}/python3.5/ipaddress.* ${libdir}/python3.5/__pycache__/ipaddress.* ${libdir}/python3.5/pipes.* ${libdir}/python3.5/__pycache__/pipes.* ${libdir}/python3.5/socket.* ${libdir}/python3.5/__pycache__/socket.* ${libdir}/python3.5/ssl.* ${libdir}/python3.5/__pycache__/ssl.* ${libdir}/python3.5/tempfile.* ${libdir}/python3.5/__pycache__/tempfile.* ${libdir}/python3.5/StringIO.* ${libdir}/python3.5/__pycache__/StringIO.* ${libdir}/python3.5/io.* ${libdir}/python3.5/__pycache__/io.* ${libdir}/python3.5/_pyio.* ${libdir}/python3.5/__pycache__/_pyio.* "
 
 SUMMARY_${PN}-json="Python JSON support"
 RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re"
-FILES_${PN}-json="${libdir}/python3.5/json ${libdir}/python3.5/lib-dynload/_json.*.so "
+FILES_${PN}-json="${libdir}/python3.5/json ${libdir}/python3.5/json/__pycache__ ${libdir}/python3.5/lib-dynload/_json.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_json.*.so "
 
 SUMMARY_${PN}-lang="Python low-level language support"
 RDEPENDS_${PN}-lang="${PN}-core ${PN}-importlib"
-FILES_${PN}-lang="${libdir}/python3.5/lib-dynload/_bisect.*.so ${libdir}/python3.5/lib-dynload/_collections.*.so ${libdir}/python3.5/lib-dynload/_heapq.*.so ${libdir}/python3.5/lib-dynload/_weakref.*.so ${libdir}/python3.5/lib-dynload/_functools.*.so ${libdir}/python3.5/lib-dynload/array.*.so ${libdir}/python3.5/lib-dynload/itertools.*.so ${libdir}/python3.5/lib-dynload/operator.*.so ${libdir}/python3.5/lib-dynload/parser.*.so ${libdir}/python3.5/atexit.* ${libdir}/python3.5/bisect.* ${libdir}/python3.5/code.* ${libdir}/python3.5/codeop.* ${libdir}/python3.5/collections.* ${libdir}/python3.5/_collections_abc.* ${libdir}/python3.5/contextlib.* ${libdir}/python3.5/dis.* ${libdir}/python3.5/functools.* ${libdir}/python3.5/heapq.* ${libdir}/python3.5/inspect.* ${libdir}/python3.5/keyword.* ${libdir}/python3.5/opcode.* ${libdir}/python3.5/operator.* ${libdir}/python3.5/symbol.* ${libdir}/python3.5/repr.* ${libdir}/python3.5/token.* ${libdir}/python3.5/tokenize.* ${libdir}/python3.5/traceback.* ${libdir}/python3.5/weakref.* "
+FILES_${PN}-lang="${libdir}/python3.5/lib-dynload/_bisect.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_bisect.*.so ${libdir}/python3.5/lib-dynload/_collections.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_collections.*.so ${libdir}/python3.5/lib-dynload/_heapq.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_heapq.*.so ${libdir}/python3.5/lib-dynload/_weakref.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_weakref.*.so ${libdir}/python3.5/lib-dynload/_functools.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_functools.*.so ${libdir}/python3.5/lib-dynload/array.*.so ${libdir}/python3.5/lib-dynload/__pycache__/array.*.so ${libdir}/python3.5/lib-dynload/itertools.*.so ${libdir}/python3.5/lib-dynload/__pycache__/itertools.*.so ${libdir}/python3.5/lib-dynload/operator.*.so ${libdir}/python3.5/lib-dynload/__pycache__/operator.*.so ${libdir}/python3.5/lib-dynload/parser.*.so ${libdir}/python3.5/lib-dynload/__pycache__/parser.*.so ${libdir}/python3.5/atexit.* ${libdir}/python3.5/__pycache__/atexit.* ${libdir}/python3.5/bisect.* ${libdir}/python3.5/__pycache__/bisect.* ${libdir}/python3.5/code.* ${libdir}/python3.5/__pycache__/code.* ${libdir}/python3.5/codeop.* ${libdir}/python3.5/__pycache__/codeop.* ${libdir}/python3.5/collections.* ${libdir}/python3.5/__pycache__/collections.* ${libdir}/python3.5/_collections_abc.* ${libdir}/python3.5/__pycache__/_collections_abc.* ${libdir}/python3.5/contextlib.* ${libdir}/python3.5/__pycache__/contextlib.* ${libdir}/python3.5/dis.* ${libdir}/python3.5/__pycache__/dis.* ${libdir}/python3.5/functools.* ${libdir}/python3.5/__pycache__/functools.* ${libdir}/python3.5/heapq.* ${libdir}/python3.5/__pycache__/heapq.* ${libdir}/python3.5/inspect.* ${libdir}/python3.5/__pycache__/inspect.* ${libdir}/python3.5/keyword.* ${libdir}/python3.5/__pycache__/keyword.* ${libdir}/python3.5/opcode.* ${libdir}/python3.5/__pycache__/opcode.* ${libdir}/python3.5/operator.* ${libdir}/python3.5/__pycache__/operator.* ${libdir}/python3.5/symbol.* ${libdir}/python3.5/__pycache__/symbol.* ${libdir}/python3.5/repr.* ${libdir}/python3.5/__pycache__/repr.* ${libdir}/python3.5/token.* ${libdir}/python3.5/__pycache__/token.* ${libdir}/python3.5/tokenize.* ${libdir}/python3.5/__pycache__/tokenize.* ${libdir}/python3.5/traceback.* ${libdir}/python3.5/__pycache__/traceback.* ${libdir}/python3.5/weakref.* ${libdir}/python3.5/__pycache__/weakref.* "
 
 SUMMARY_${PN}-logging="Python logging support"
 RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold"
-FILES_${PN}-logging="${libdir}/python3.5/logging "
+FILES_${PN}-logging="${libdir}/python3.5/logging ${libdir}/python3.5/logging/__pycache__ "
 
 SUMMARY_${PN}-mailbox="Python mailbox format support"
 RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
-FILES_${PN}-mailbox="${libdir}/python3.5/mailbox.* "
+FILES_${PN}-mailbox="${libdir}/python3.5/mailbox.* ${libdir}/python3.5/__pycache__/mailbox.* "
 
 SUMMARY_${PN}-math="Python math support"
 RDEPENDS_${PN}-math="${PN}-core ${PN}-crypt"
-FILES_${PN}-math="${libdir}/python3.5/lib-dynload/cmath.*.so ${libdir}/python3.5/lib-dynload/math.*.so ${libdir}/python3.5/lib-dynload/_random.*.so ${libdir}/python3.5/random.* ${libdir}/python3.5/sets.* "
+FILES_${PN}-math="${libdir}/python3.5/lib-dynload/cmath.*.so ${libdir}/python3.5/lib-dynload/__pycache__/cmath.*.so ${libdir}/python3.5/lib-dynload/math.*.so ${libdir}/python3.5/lib-dynload/__pycache__/math.*.so ${libdir}/python3.5/lib-dynload/_random.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_random.*.so ${libdir}/python3.5/random.* ${libdir}/python3.5/__pycache__/random.* ${libdir}/python3.5/sets.* ${libdir}/python3.5/__pycache__/sets.* "
 
 SUMMARY_${PN}-mime="Python MIME handling APIs"
 RDEPENDS_${PN}-mime="${PN}-core ${PN}-io"
-FILES_${PN}-mime="${libdir}/python3.5/mimetools.* ${libdir}/python3.5/uu.* ${libdir}/python3.5/quopri.* ${libdir}/python3.5/rfc822.* ${libdir}/python3.5/MimeWriter.* "
+FILES_${PN}-mime="${libdir}/python3.5/mimetools.* ${libdir}/python3.5/__pycache__/mimetools.* ${libdir}/python3.5/uu.* ${libdir}/python3.5/__pycache__/uu.* ${libdir}/python3.5/quopri.* ${libdir}/python3.5/__pycache__/quopri.* ${libdir}/python3.5/rfc822.* ${libdir}/python3.5/__pycache__/rfc822.* ${libdir}/python3.5/MimeWriter.* ${libdir}/python3.5/__pycache__/MimeWriter.* "
 
 SUMMARY_${PN}-mmap="Python memory-mapped file support"
 RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io"
-FILES_${PN}-mmap="${libdir}/python3.5/lib-dynload/mmap.*.so "
+FILES_${PN}-mmap="${libdir}/python3.5/lib-dynload/mmap.*.so ${libdir}/python3.5/lib-dynload/__pycache__/mmap.*.so "
 
 SUMMARY_${PN}-multiprocessing="Python multiprocessing support"
 RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap"
-FILES_${PN}-multiprocessing="${libdir}/python3.5/lib-dynload/_multiprocessing.*.so ${libdir}/python3.5/multiprocessing "
+FILES_${PN}-multiprocessing="${libdir}/python3.5/lib-dynload/_multiprocessing.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_multiprocessing.*.so ${libdir}/python3.5/multiprocessing ${libdir}/python3.5/multiprocessing/__pycache__ "
 
 SUMMARY_${PN}-netclient="Python Internet Protocol clients"
-RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime"
-FILES_${PN}-netclient="${libdir}/python3.5/*Cookie*.* ${libdir}/python3.5/base64.* ${libdir}/python3.5/cookielib.* ${libdir}/python3.5/ftplib.* ${libdir}/python3.5/gopherlib.* ${libdir}/python3.5/hmac.* ${libdir}/python3.5/httplib.* ${libdir}/python3.5/mimetypes.* ${libdir}/python3.5/nntplib.* ${libdir}/python3.5/poplib.* ${libdir}/python3.5/smtplib.* ${libdir}/python3.5/telnetlib.* ${libdir}/python3.5/urllib ${libdir}/python3.5/uuid.* ${libdir}/python3.5/rfc822.* ${libdir}/python3.5/mimetools.* "
+RDEPENDS_${PN}-netclient="${PN}-argparse ${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime ${PN}-html"
+FILES_${PN}-netclient="${libdir}/python3.5/*Cookie*.* ${libdir}/python3.5/__pycache__/*Cookie*.* ${libdir}/python3.5/base64.* ${libdir}/python3.5/__pycache__/base64.* ${libdir}/python3.5/cookielib.* ${libdir}/python3.5/__pycache__/cookielib.* ${libdir}/python3.5/ftplib.* ${libdir}/python3.5/__pycache__/ftplib.* ${libdir}/python3.5/gopherlib.* ${libdir}/python3.5/__pycache__/gopherlib.* ${libdir}/python3.5/hmac.* ${libdir}/python3.5/__pycache__/hmac.* ${libdir}/python3.5/http* ${libdir}/python3.5/http*/__pycache__ ${libdir}/python3.5/httplib.* ${libdir}/python3.5/__pycache__/httplib.* ${libdir}/python3.5/mimetypes.* ${libdir}/python3.5/__pycache__/mimetypes.* ${libdir}/python3.5/nntplib.* ${libdir}/python3.5/__pycache__/nntplib.* ${libdir}/python3.5/poplib.* ${libdir}/python3.5/__pycache__/poplib.* ${libdir}/python3.5/smtplib.* ${libdir}/python3.5/__pycache__/smtplib.* ${libdir}/python3.5/telnetlib.* ${libdir}/python3.5/__pycache__/telnetlib.* ${libdir}/python3.5/urllib ${libdir}/python3.5/urllib/__pycache__ ${libdir}/python3.5/uuid.* ${libdir}/python3.5/__pycache__/uuid.* ${libdir}/python3.5/rfc822.* ${libdir}/python3.5/__pycache__/rfc822.* ${libdir}/python3.5/mimetools.* ${libdir}/python3.5/__pycache__/mimetools.* "
 
 SUMMARY_${PN}-netserver="Python Internet Protocol servers"
 RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient ${PN}-shell ${PN}-threading"
-FILES_${PN}-netserver="${libdir}/python3.5/cgi.* ${libdir}/python3.5/*HTTPServer.* ${libdir}/python3.5/SocketServer.* "
+FILES_${PN}-netserver="${libdir}/python3.5/cgi.* ${libdir}/python3.5/__pycache__/cgi.* ${libdir}/python3.5/socketserver.* ${libdir}/python3.5/__pycache__/socketserver.* ${libdir}/python3.5/*HTTPServer.* ${libdir}/python3.5/__pycache__/*HTTPServer.* ${libdir}/python3.5/SocketServer.* ${libdir}/python3.5/__pycache__/SocketServer.* "
 
 SUMMARY_${PN}-numbers="Python number APIs"
 RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re"
-FILES_${PN}-numbers="${libdir}/python3.5/decimal.* ${libdir}/python3.5/fractions.* ${libdir}/python3.5/numbers.* "
+FILES_${PN}-numbers="${libdir}/python3.5/decimal.* ${libdir}/python3.5/__pycache__/decimal.* ${libdir}/python3.5/fractions.* ${libdir}/python3.5/__pycache__/fractions.* ${libdir}/python3.5/numbers.* ${libdir}/python3.5/__pycache__/numbers.* "
 
 SUMMARY_${PN}-pickle="Python serialisation/persistence support"
 RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re"
-FILES_${PN}-pickle="${libdir}/python3.5/pickle.* ${libdir}/python3.5/shelve.* ${libdir}/python3.5/lib-dynload/cPickle.*.so ${libdir}/python3.5/pickletools.* "
+FILES_${PN}-pickle="${libdir}/python3.5/_compat_pickle.* ${libdir}/python3.5/__pycache__/_compat_pickle.* ${libdir}/python3.5/pickle.* ${libdir}/python3.5/__pycache__/pickle.* ${libdir}/python3.5/shelve.* ${libdir}/python3.5/__pycache__/shelve.* ${libdir}/python3.5/lib-dynload/cPickle.*.so ${libdir}/python3.5/lib-dynload/__pycache__/cPickle.*.so ${libdir}/python3.5/pickletools.* ${libdir}/python3.5/__pycache__/pickletools.* "
 
 SUMMARY_${PN}-pkgutil="Python package extension utility support"
 RDEPENDS_${PN}-pkgutil="${PN}-core"
-FILES_${PN}-pkgutil="${libdir}/python3.5/pkgutil.* "
+FILES_${PN}-pkgutil="${libdir}/python3.5/pkgutil.* ${libdir}/python3.5/__pycache__/pkgutil.* "
 
 SUMMARY_${PN}-pprint="Python pretty-print support"
 RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
-FILES_${PN}-pprint="${libdir}/python3.5/pprint.* "
+FILES_${PN}-pprint="${libdir}/python3.5/pprint.* ${libdir}/python3.5/__pycache__/pprint.* "
 
 SUMMARY_${PN}-profile="Python basic performance profiling support"
 RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils"
-FILES_${PN}-profile="${libdir}/python3.5/profile.* ${libdir}/python3.5/pstats.* ${libdir}/python3.5/cProfile.* ${libdir}/python3.5/lib-dynload/_lsprof.*.so "
+FILES_${PN}-profile="${libdir}/python3.5/profile.* ${libdir}/python3.5/__pycache__/profile.* ${libdir}/python3.5/pstats.* ${libdir}/python3.5/__pycache__/pstats.* ${libdir}/python3.5/cProfile.* ${libdir}/python3.5/__pycache__/cProfile.* ${libdir}/python3.5/lib-dynload/_lsprof.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_lsprof.*.so "
 
 SUMMARY_${PN}-pydoc="Python interactive help support"
 RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re"
-FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python3.5/pydoc.* ${libdir}/python3.5/pydoc_data "
+FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python3.5/pydoc.* ${libdir}/python3.5/__pycache__/pydoc.* ${libdir}/python3.5/pydoc_data ${libdir}/python3.5/pydoc_data/__pycache__ "
 
 SUMMARY_${PN}-re="Python Regular Expression APIs"
 RDEPENDS_${PN}-re="${PN}-core"
-FILES_${PN}-re="${libdir}/python3.5/re.* ${libdir}/python3.5/sre.* ${libdir}/python3.5/sre_compile.* ${libdir}/python3.5/sre_constants* ${libdir}/python3.5/sre_parse.* "
+FILES_${PN}-re="${libdir}/python3.5/re.* ${libdir}/python3.5/__pycache__/re.* ${libdir}/python3.5/sre.* ${libdir}/python3.5/__pycache__/sre.* ${libdir}/python3.5/sre_compile.* ${libdir}/python3.5/__pycache__/sre_compile.* ${libdir}/python3.5/sre_constants* ${libdir}/python3.5/sre_constants*/__pycache__ ${libdir}/python3.5/sre_parse.* ${libdir}/python3.5/__pycache__/sre_parse.* "
 
 SUMMARY_${PN}-readline="Python readline support"
 RDEPENDS_${PN}-readline="${PN}-core"
-FILES_${PN}-readline="${libdir}/python3.5/lib-dynload/readline.*.so ${libdir}/python3.5/rlcompleter.* "
+FILES_${PN}-readline="${libdir}/python3.5/lib-dynload/readline.*.so ${libdir}/python3.5/lib-dynload/__pycache__/readline.*.so ${libdir}/python3.5/rlcompleter.* ${libdir}/python3.5/__pycache__/rlcompleter.* "
 
 SUMMARY_${PN}-reprlib="Python alternate repr() implementation"
 RDEPENDS_${PN}-reprlib="${PN}-core"
-FILES_${PN}-reprlib="${libdir}/python3.5/reprlib.py "
+FILES_${PN}-reprlib="${libdir}/python3.5/reprlib.py ${libdir}/python3.5/__pycache__/reprlib.py "
 
 SUMMARY_${PN}-resource="Python resource control interface"
 RDEPENDS_${PN}-resource="${PN}-core"
-FILES_${PN}-resource="${libdir}/python3.5/lib-dynload/resource.*.so "
+FILES_${PN}-resource="${libdir}/python3.5/lib-dynload/resource.*.so ${libdir}/python3.5/lib-dynload/__pycache__/resource.*.so "
 
 SUMMARY_${PN}-selectors="Python High-level I/O multiplexing"
 RDEPENDS_${PN}-selectors="${PN}-core"
-FILES_${PN}-selectors="${libdir}/python3.5/selectors.* "
+FILES_${PN}-selectors="${libdir}/python3.5/selectors.* ${libdir}/python3.5/__pycache__/selectors.* "
 
 SUMMARY_${PN}-shell="Python shell-like functionality"
 RDEPENDS_${PN}-shell="${PN}-core ${PN}-re ${PN}-compression"
-FILES_${PN}-shell="${libdir}/python3.5/cmd.* ${libdir}/python3.5/commands.* ${libdir}/python3.5/dircache.* ${libdir}/python3.5/fnmatch.* ${libdir}/python3.5/glob.* ${libdir}/python3.5/popen2.* ${libdir}/python3.5/shlex.* ${libdir}/python3.5/shutil.* "
+FILES_${PN}-shell="${libdir}/python3.5/cmd.* ${libdir}/python3.5/__pycache__/cmd.* ${libdir}/python3.5/commands.* ${libdir}/python3.5/__pycache__/commands.* ${libdir}/python3.5/dircache.* ${libdir}/python3.5/__pycache__/dircache.* ${libdir}/python3.5/fnmatch.* ${libdir}/python3.5/__pycache__/fnmatch.* ${libdir}/python3.5/glob.* ${libdir}/python3.5/__pycache__/glob.* ${libdir}/python3.5/popen2.* ${libdir}/python3.5/__pycache__/popen2.* ${libdir}/python3.5/shlex.* ${libdir}/python3.5/__pycache__/shlex.* ${libdir}/python3.5/shutil.* ${libdir}/python3.5/__pycache__/shutil.* "
 
 SUMMARY_${PN}-signal="Python set handlers for asynchronous events support"
 RDEPENDS_${PN}-signal="${PN}-core ${PN}-enum"
-FILES_${PN}-signal="${libdir}/python3.5/signal.* "
+FILES_${PN}-signal="${libdir}/python3.5/signal.* ${libdir}/python3.5/__pycache__/signal.* "
 
 SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon"
 RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime"
-FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python3.5/smtpd.* "
+FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python3.5/smtpd.* ${libdir}/python3.5/__pycache__/smtpd.* "
 
 SUMMARY_${PN}-sqlite3="Python Sqlite3 database support"
 RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading"
-FILES_${PN}-sqlite3="${libdir}/python3.5/lib-dynload/_sqlite3.*.so ${libdir}/python3.5/sqlite3/dbapi2.* ${libdir}/python3.5/sqlite3/__init__.* ${libdir}/python3.5/sqlite3/dump.* "
+FILES_${PN}-sqlite3="${libdir}/python3.5/lib-dynload/_sqlite3.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_sqlite3.*.so ${libdir}/python3.5/sqlite3/dbapi2.* ${libdir}/python3.5/sqlite3/__pycache__/dbapi2.* ${libdir}/python3.5/sqlite3/__init__.* ${libdir}/python3.5/sqlite3/__pycache__/__init__.* ${libdir}/python3.5/sqlite3/dump.* ${libdir}/python3.5/sqlite3/__pycache__/dump.* "
 
 SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests"
 RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3"
-FILES_${PN}-sqlite3-tests="${libdir}/python3.5/sqlite3/test "
+FILES_${PN}-sqlite3-tests="${libdir}/python3.5/sqlite3/test ${libdir}/python3.5/sqlite3/test/__pycache__ "
 
 SUMMARY_${PN}-stringold="Python string APIs [deprecated]"
 RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
-FILES_${PN}-stringold="${libdir}/python3.5/lib-dynload/strop.*.so ${libdir}/python3.5/string.* ${libdir}/python3.5/stringold.* "
+FILES_${PN}-stringold="${libdir}/python3.5/lib-dynload/strop.*.so ${libdir}/python3.5/lib-dynload/__pycache__/strop.*.so ${libdir}/python3.5/string.* ${libdir}/python3.5/__pycache__/string.* ${libdir}/python3.5/stringold.* ${libdir}/python3.5/__pycache__/stringold.* "
 
 SUMMARY_${PN}-subprocess="Python subprocess support"
 RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle ${PN}-threading ${PN}-signal ${PN}-selectors"
-FILES_${PN}-subprocess="${libdir}/python3.5/subprocess.* ${libdir}/python3.5/lib-dynload/_posixsubprocess.*.so "
+FILES_${PN}-subprocess="${libdir}/python3.5/subprocess.* ${libdir}/python3.5/__pycache__/subprocess.* ${libdir}/python3.5/lib-dynload/_posixsubprocess.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_posixsubprocess.*.so "
 
 SUMMARY_${PN}-syslog="Python syslog interface"
 RDEPENDS_${PN}-syslog="${PN}-core"
-FILES_${PN}-syslog="${libdir}/python3.5/lib-dynload/syslog.*.so "
+FILES_${PN}-syslog="${libdir}/python3.5/lib-dynload/syslog.*.so ${libdir}/python3.5/lib-dynload/__pycache__/syslog.*.so "
 
 SUMMARY_${PN}-terminal="Python terminal controlling support"
 RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io"
-FILES_${PN}-terminal="${libdir}/python3.5/pty.* ${libdir}/python3.5/tty.* "
+FILES_${PN}-terminal="${libdir}/python3.5/pty.* ${libdir}/python3.5/__pycache__/pty.* ${libdir}/python3.5/tty.* ${libdir}/python3.5/__pycache__/tty.* "
 
 SUMMARY_${PN}-tests="Python tests"
 RDEPENDS_${PN}-tests="${PN}-core"
-FILES_${PN}-tests="${libdir}/python3.5/test "
+FILES_${PN}-tests="${libdir}/python3.5/test ${libdir}/python3.5/test/__pycache__ "
 
 SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support"
 RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold"
-FILES_${PN}-textutils="${libdir}/python3.5/lib-dynload/_csv.*.so ${libdir}/python3.5/csv.* ${libdir}/python3.5/optparse.* ${libdir}/python3.5/textwrap.* "
+FILES_${PN}-textutils="${libdir}/python3.5/lib-dynload/_csv.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_csv.*.so ${libdir}/python3.5/csv.* ${libdir}/python3.5/__pycache__/csv.* ${libdir}/python3.5/optparse.* ${libdir}/python3.5/__pycache__/optparse.* ${libdir}/python3.5/textwrap.* ${libdir}/python3.5/__pycache__/textwrap.* "
 
 SUMMARY_${PN}-threading="Python threading & synchronization support"
 RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang"
-FILES_${PN}-threading="${libdir}/python3.5/_threading_local.* ${libdir}/python3.5/dummy_thread.* ${libdir}/python3.5/dummy_threading.* ${libdir}/python3.5/mutex.* ${libdir}/python3.5/threading.* ${libdir}/python3.5/queue.* "
+FILES_${PN}-threading="${libdir}/python3.5/_threading_local.* ${libdir}/python3.5/__pycache__/_threading_local.* ${libdir}/python3.5/dummy_thread.* ${libdir}/python3.5/__pycache__/dummy_thread.* ${libdir}/python3.5/dummy_threading.* ${libdir}/python3.5/__pycache__/dummy_threading.* ${libdir}/python3.5/mutex.* ${libdir}/python3.5/__pycache__/mutex.* ${libdir}/python3.5/threading.* ${libdir}/python3.5/__pycache__/threading.* ${libdir}/python3.5/queue.* ${libdir}/python3.5/__pycache__/queue.* "
 
 SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings"
 RDEPENDS_${PN}-tkinter="${PN}-core"
-FILES_${PN}-tkinter="${libdir}/python3.5/lib-dynload/_tkinter.*.so ${libdir}/python3.5/lib-tk ${libdir}/python3.5/tkinter "
+FILES_${PN}-tkinter="${libdir}/python3.5/lib-dynload/_tkinter.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_tkinter.*.so ${libdir}/python3.5/lib-tk ${libdir}/python3.5/lib-tk/__pycache__ ${libdir}/python3.5/tkinter ${libdir}/python3.5/tkinter/__pycache__ "
+
+SUMMARY_${PN}-typing="Python typing support"
+RDEPENDS_${PN}-typing="${PN}-core"
+FILES_${PN}-typing="${libdir}/python3.5/typing.* ${libdir}/python3.5/__pycache__/typing.* "
 
 SUMMARY_${PN}-unittest="Python unit testing framework"
 RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell"
-FILES_${PN}-unittest="${libdir}/python3.5/unittest/ "
+FILES_${PN}-unittest="${libdir}/python3.5/unittest/ ${libdir}/python3.5/unittest/__pycache__ "
 
 SUMMARY_${PN}-unixadmin="Python Unix administration support"
 RDEPENDS_${PN}-unixadmin="${PN}-core"
-FILES_${PN}-unixadmin="${libdir}/python3.5/lib-dynload/nis.*.so ${libdir}/python3.5/lib-dynload/grp.*.so ${libdir}/python3.5/lib-dynload/pwd.*.so ${libdir}/python3.5/getpass.* "
+FILES_${PN}-unixadmin="${libdir}/python3.5/lib-dynload/nis.*.so ${libdir}/python3.5/lib-dynload/__pycache__/nis.*.so ${libdir}/python3.5/lib-dynload/grp.*.so ${libdir}/python3.5/lib-dynload/__pycache__/grp.*.so ${libdir}/python3.5/lib-dynload/pwd.*.so ${libdir}/python3.5/lib-dynload/__pycache__/pwd.*.so ${libdir}/python3.5/getpass.* ${libdir}/python3.5/__pycache__/getpass.* "
 
 SUMMARY_${PN}-xml="Python basic XML support"
 RDEPENDS_${PN}-xml="${PN}-core ${PN}-re"
-FILES_${PN}-xml="${libdir}/python3.5/lib-dynload/_elementtree.*.so ${libdir}/python3.5/lib-dynload/pyexpat.*.so ${libdir}/python3.5/xml ${libdir}/python3.5/xmllib.* "
+FILES_${PN}-xml="${libdir}/python3.5/lib-dynload/_elementtree.*.so ${libdir}/python3.5/lib-dynload/__pycache__/_elementtree.*.so ${libdir}/python3.5/lib-dynload/pyexpat.*.so ${libdir}/python3.5/lib-dynload/__pycache__/pyexpat.*.so ${libdir}/python3.5/xml ${libdir}/python3.5/xml/__pycache__ ${libdir}/python3.5/xmllib.* ${libdir}/python3.5/__pycache__/xmllib.* "
 
 SUMMARY_${PN}-xmlrpc="Python XML-RPC support"
-RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang"
-FILES_${PN}-xmlrpc="${libdir}/python3.5/xmlrpclib.* ${libdir}/python3.5/SimpleXMLRPCServer.* ${libdir}/python3.5/DocXMLRPCServer.* ${libdir}/python3.5/xmlrpc "
+RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang ${PN}-pydoc"
+FILES_${PN}-xmlrpc="${libdir}/python3.5/xmlrpclib.* ${libdir}/python3.5/__pycache__/xmlrpclib.* ${libdir}/python3.5/SimpleXMLRPCServer.* ${libdir}/python3.5/__pycache__/SimpleXMLRPCServer.* ${libdir}/python3.5/DocXMLRPCServer.* ${libdir}/python3.5/__pycache__/DocXMLRPCServer.* ${libdir}/python3.5/xmlrpc ${libdir}/python3.5/xmlrpc/__pycache__ "
 
 SUMMARY_${PN}-modules="All Python modules"
-RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-argparse ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-email ${PN}-enum ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-selectors ${PN}-shell ${PN}-signal ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc  "
+RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-argparse ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-email ${PN}-enum ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-selectors ${PN}-shell ${PN}-signal ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-typing ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc  "
 ALLOW_EMPTY_${PN}-modules = "1"
 
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-git.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-git.inc
index 13c097a..feddf27 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-git.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-git.inc
@@ -10,8 +10,8 @@
 
 SRC_URI = "https://files.pythonhosted.org/packages/source/G/GitPython/GitPython-${PV}.tar.gz"
 
-SRC_URI[md5sum] = "aa0ba9df0abe4c8f35dd7bb9be85d56e"
-SRC_URI[sha256sum] = "d8e7adaacceedd3d043e6cd2544f57dbe00c53fc26374880b7cea67f3188aa68"
+SRC_URI[md5sum] = "77f8339e68dedb6d7c4e26371a588ed9"
+SRC_URI[sha256sum] = "e96f8e953cf9fee0a7599fc587667591328760b6341a0081ef311a942fc96204"
 
 UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/GitPython/"
 UPSTREAM_CHECK_REGEX = "/GitPython/(?P<pver>(\d+[\.\-_]*)+)"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-git_2.0.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-git_2.1.1.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python/python-git_2.0.7.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/python/python-git_2.1.1.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako.inc
index 85ec217..10364db 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako.inc
@@ -5,8 +5,8 @@
 
 SRC_URI = "https://files.pythonhosted.org/packages/source/M/Mako/Mako-${PV}.tar.gz"
 
-SRC_URI[md5sum] = "c5fc31a323dd4990683d2f2da02d4e20"
-SRC_URI[sha256sum] = "fed99dbe4d0ddb27a33ee4910d8708aca9ef1fe854e668387a9ab9a90cbf9059"
+SRC_URI[md5sum] = "a28e22a339080316b2acc352b9ee631c"
+SRC_URI[sha256sum] = "48559ebd872a8e77f92005884b3d88ffae552812cdf17db6768e5c3be5ebbe0d"
 
 UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/mako/"
 UPSTREAM_CHECK_REGEX = "/Mako/(?P<pver>(\d+[\.\-_]*)+)"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.6.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.4.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.6.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native-2.7-manifest.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native-2.7-manifest.inc
new file mode 100644
index 0000000..581a37a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native-2.7-manifest.inc
@@ -0,0 +1,10 @@
+
+# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
+# Generator: '../../../scripts/contrib/python/generate-manifest-2.7.py --native' Version 20110222.2 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+
+ 
+
+RPROVIDES+="python-2to3-native python-argparse-native python-audio-native python-bsddb-native python-codecs-native python-compile-native python-compiler-native python-compression-native python-contextlib-native python-core-native python-crypt-native python-ctypes-native python-curses-native python-datetime-native python-db-native python-debugger-native python-dev-native python-difflib-native python-distutils-native python-distutils-staticdev-native python-doctest-native python-email-native python-fcntl-native python-gdbm-native python-hotshot-native python-html-native python-idle-native python-image-native python-importlib-native python-io-native python-json-native python-lang-native python-logging-native python-mailbox-native python-math-native python-mime-native python-mmap-native python-multiprocessing-native python-netclient-native python-netserver-native python-numbers-native python-pickle-native python-pkgutil-native python-plistlib-native python-pprint-native python-profile-native python-pydoc-native python-re-native python-readline-native python-resource-native python-robotparser-native python-shell-native python-smtpd-native python-sqlite3-native python-sqlite3-tests-native python-stringold-native python-subprocess-native python-syslog-native python-terminal-native python-tests-native python-textutils-native python-threading-native python-tkinter-native python-unittest-native python-unixadmin-native python-xml-native python-xmlrpc-native python-zlib-native "
+
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native-3.5-manifest.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native-3.5-manifest.inc
new file mode 100644
index 0000000..10be3e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native-3.5-manifest.inc
@@ -0,0 +1,10 @@
+
+# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
+# Generator: '../../../scripts/contrib/python/generate-manifest-3.5.py --native' Version 20140131 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+
+ 
+
+RPROVIDES+="python3-2to3-native python3-argparse-native python3-asyncio-native python3-audio-native python3-codecs-native python3-compile-native python3-compression-native python3-core-native python3-crypt-native python3-ctypes-native python3-curses-native python3-datetime-native python3-db-native python3-debugger-native python3-dev-native python3-difflib-native python3-distutils-native python3-distutils-staticdev-native python3-doctest-native python3-email-native python3-enum-native python3-fcntl-native python3-gdbm-native python3-html-native python3-idle-native python3-image-native python3-importlib-native python3-io-native python3-json-native python3-lang-native python3-logging-native python3-mailbox-native python3-math-native python3-mime-native python3-mmap-native python3-multiprocessing-native python3-netclient-native python3-netserver-native python3-numbers-native python3-pickle-native python3-pkgutil-native python3-pprint-native python3-profile-native python3-pydoc-native python3-re-native python3-readline-native python3-reprlib-native python3-resource-native python3-selectors-native python3-shell-native python3-signal-native python3-smtpd-native python3-sqlite3-native python3-sqlite3-tests-native python3-stringold-native python3-subprocess-native python3-syslog-native python3-terminal-native python3-tests-native python3-textutils-native python3-threading-native python3-tkinter-native python3-typing-native python3-unittest-native python3-unixadmin-native python3-xml-native python3-xmlrpc-native "
+
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch
deleted file mode 100644
index a592ea4..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Upstream-Status: Pending
-
-Avoids parallel make races linking errors when making Parser/PGEN
-
-- Implements Richard Purdie's idea
-
-Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
-
-Index: Python-2.7.9/Makefile.pre.in
-===================================================================
---- Python-2.7.9.orig/Makefile.pre.in
-+++ Python-2.7.9/Makefile.pre.in
-@@ -610,12 +610,10 @@ Modules/grpmodule.o: $(srcdir)/Modules/g
- 
- Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
- 
--$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
-+$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN)
- 		@$(MKDIR_P) Include
--		$(MAKE) $(PGEN)
- 		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
- $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
--		$(MAKE) $(GRAMMAR_H)
- 		touch $(GRAMMAR_C)
- 
- $(PGEN):	$(PGENOBJS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/multilib.patch
index 916b40f..ad46085 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/multilib.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/multilib.patch
@@ -12,10 +12,10 @@
 
 Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
 
-Index: Python-2.7.12/Include/pythonrun.h
+Index: Python-2.7.13/Include/pythonrun.h
 ===================================================================
---- Python-2.7.12.orig/Include/pythonrun.h
-+++ Python-2.7.12/Include/pythonrun.h
+--- Python-2.7.13.orig/Include/pythonrun.h
++++ Python-2.7.13/Include/pythonrun.h
 @@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
  /* In their own files */
  PyAPI_FUNC(const char *) Py_GetVersion(void);
@@ -24,10 +24,10 @@
  PyAPI_FUNC(const char *) Py_GetCopyright(void);
  PyAPI_FUNC(const char *) Py_GetCompiler(void);
  PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
-Index: Python-2.7.12/Lib/distutils/command/install.py
+Index: Python-2.7.13/Lib/distutils/command/install.py
 ===================================================================
---- Python-2.7.12.orig/Lib/distutils/command/install.py
-+++ Python-2.7.12/Lib/distutils/command/install.py
+--- Python-2.7.13.orig/Lib/distutils/command/install.py
++++ Python-2.7.13/Lib/distutils/command/install.py
 @@ -22,6 +22,8 @@ from site import USER_BASE
  from site import USER_SITE
  
@@ -46,23 +46,23 @@
          'headers': '$base/include/python$py_version_short/$dist_name',
          'scripts': '$base/bin',
          'data'   : '$base',
-Index: Python-2.7.12/Lib/pydoc.py
+Index: Python-2.7.13/Lib/pydoc.py
 ===================================================================
---- Python-2.7.12.orig/Lib/pydoc.py
-+++ Python-2.7.12/Lib/pydoc.py
-@@ -384,7 +384,7 @@ class Doc:
+--- Python-2.7.13.orig/Lib/pydoc.py
++++ Python-2.7.13/Lib/pydoc.py
+@@ -375,7 +375,7 @@ class Doc:
+     docmodule = docclass = docroutine = docother = docproperty = docdata = fail
  
-         docloc = os.environ.get("PYTHONDOCS",
-                                 "http://docs.python.org/library")
--        basedir = os.path.join(sys.exec_prefix, "lib",
-+        basedir = os.path.join(sys.exec_prefix, sys.lib,
-                                "python"+sys.version[0:3])
-         if (isinstance(object, type(os)) and
-             (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
-Index: Python-2.7.12/Lib/site.py
+     def getdocloc(self, object,
+-                  basedir=os.path.join(sys.exec_prefix, "lib",
++                  basedir=os.path.join(sys.exec_prefix, "sys.lib",
+                                        "python"+sys.version[0:3])):
+         """Return the location of module docs or None"""
+ 
+Index: Python-2.7.13/Lib/site.py
 ===================================================================
---- Python-2.7.12.orig/Lib/site.py
-+++ Python-2.7.12/Lib/site.py
+--- Python-2.7.13.orig/Lib/site.py
++++ Python-2.7.13/Lib/site.py
 @@ -288,13 +288,19 @@ def getsitepackages():
          if sys.platform in ('os2emx', 'riscos'):
              sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
@@ -83,13 +83,13 @@
              sitepackages.append(prefix)
 -            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
 +            sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
-         if sys.platform == "darwin":
-             # for framework builds *only* we add the standard Apple
-             # locations.
-Index: Python-2.7.12/Lib/test/test_dl.py
+     return sitepackages
+ 
+ def addsitepackages(known_paths):
+Index: Python-2.7.13/Lib/test/test_dl.py
 ===================================================================
---- Python-2.7.12.orig/Lib/test/test_dl.py
-+++ Python-2.7.12/Lib/test/test_dl.py
+--- Python-2.7.13.orig/Lib/test/test_dl.py
++++ Python-2.7.13/Lib/test/test_dl.py
 @@ -4,10 +4,11 @@
  import unittest
  from test.test_support import verbose, import_module
@@ -104,10 +104,10 @@
      ('/usr/bin/cygwin1.dll', 'getpid'),
      ('/usr/lib/libc.dylib', 'getpid'),
      ]
-Index: Python-2.7.12/Lib/trace.py
+Index: Python-2.7.13/Lib/trace.py
 ===================================================================
---- Python-2.7.12.orig/Lib/trace.py
-+++ Python-2.7.12/Lib/trace.py
+--- Python-2.7.13.orig/Lib/trace.py
++++ Python-2.7.13/Lib/trace.py
 @@ -754,10 +754,10 @@ def main(argv=None):
                  # should I also call expanduser? (after all, could use $HOME)
  
@@ -121,10 +121,10 @@
                                             "python" + sys.version[:3]))
                  s = os.path.normpath(s)
                  ignore_dirs.append(s)
-Index: Python-2.7.12/Makefile.pre.in
+Index: Python-2.7.13/Makefile.pre.in
 ===================================================================
---- Python-2.7.12.orig/Makefile.pre.in
-+++ Python-2.7.12/Makefile.pre.in
+--- Python-2.7.13.orig/Makefile.pre.in
++++ Python-2.7.13/Makefile.pre.in
 @@ -92,6 +92,7 @@ PY_CFLAGS=	$(CFLAGS) $(CPPFLAGS) $(CFLAG
  
  # Machine-dependent subdirectories
@@ -142,7 +142,7 @@
  
  # Detailed destination directories
  BINLIBDEST=	$(LIBDIR)/python$(VERSION)
-@@ -669,6 +670,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+@@ -668,6 +669,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
  		-DEXEC_PREFIX='"$(exec_prefix)"' \
  		-DVERSION='"$(VERSION)"' \
  		-DVPATH='"$(VPATH)"' \
@@ -150,7 +150,7 @@
  		-o $@ $(srcdir)/Modules/getpath.c
  
  Modules/python.o: $(srcdir)/Modules/python.c
-@@ -720,7 +722,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
+@@ -708,7 +710,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
  Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
  
  Python/getplatform.o: $(srcdir)/Python/getplatform.c
@@ -159,10 +159,10 @@
  
  Python/importdl.o: $(srcdir)/Python/importdl.c
  		$(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
-Index: Python-2.7.12/Modules/getpath.c
+Index: Python-2.7.13/Modules/getpath.c
 ===================================================================
---- Python-2.7.12.orig/Modules/getpath.c
-+++ Python-2.7.12/Modules/getpath.c
+--- Python-2.7.13.orig/Modules/getpath.c
++++ Python-2.7.13/Modules/getpath.c
 @@ -100,6 +100,13 @@
  #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
  #endif
@@ -186,10 +186,10 @@
  
  static void
  reduce(char *dir)
-Index: Python-2.7.12/Python/getplatform.c
+Index: Python-2.7.13/Python/getplatform.c
 ===================================================================
---- Python-2.7.12.orig/Python/getplatform.c
-+++ Python-2.7.12/Python/getplatform.c
+--- Python-2.7.13.orig/Python/getplatform.c
++++ Python-2.7.13/Python/getplatform.c
 @@ -10,3 +10,13 @@ Py_GetPlatform(void)
  {
  	return PLATFORM;
@@ -204,10 +204,10 @@
 +{
 +	return LIB;
 +}
-Index: Python-2.7.12/Python/sysmodule.c
+Index: Python-2.7.13/Python/sysmodule.c
 ===================================================================
---- Python-2.7.12.orig/Python/sysmodule.c
-+++ Python-2.7.12/Python/sysmodule.c
+--- Python-2.7.13.orig/Python/sysmodule.c
++++ Python-2.7.13/Python/sysmodule.c
 @@ -1437,6 +1437,8 @@ _PySys_Init(void)
                          PyString_FromString(Py_GetCopyright()));
      SET_SYS_FROM_STRING("platform",
@@ -217,11 +217,11 @@
      SET_SYS_FROM_STRING("executable",
                          PyString_FromString(Py_GetProgramFullPath()));
      SET_SYS_FROM_STRING("prefix",
-Index: Python-2.7.12/configure.ac
+Index: Python-2.7.13/configure.ac
 ===================================================================
---- Python-2.7.12.orig/configure.ac
-+++ Python-2.7.12/configure.ac
-@@ -756,6 +756,11 @@ SunOS*)
+--- Python-2.7.13.orig/configure.ac
++++ Python-2.7.13/configure.ac
+@@ -759,6 +759,11 @@ SunOS*)
      ;;
  esac
  
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.12.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.12.bb
deleted file mode 100644
index de83cbd..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.12.bb
+++ /dev/null
@@ -1,61 +0,0 @@
-require python.inc
-
-EXTRANATIVEPATH += "bzip2-native"
-DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native expat-native"
-PR = "${INC_PR}.1"
-
-SRC_URI += "\
-            file://05-enable-ctypes-cross-build.patch \
-            file://10-distutils-fix-swig-parameter.patch \
-            file://11-distutils-never-modify-shebang-line.patch \
-            file://0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch \
-            file://debug.patch \
-            file://unixccompiler.patch \
-            file://nohostlibs.patch \
-            file://multilib.patch \
-            file://add-md5module-support.patch \
-            file://builddir.patch \
-            file://parallel-makeinst-create-bindir.patch \
-            file://revert_use_of_sysconfigdata.patch \
-           "
-
-S = "${WORKDIR}/Python-${PV}"
-
-FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:"
-
-inherit native
-
-RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-codecs-native python-core-native python-unittest-native"
-
-EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --with-system-expat=${STAGING_DIR_HOST}"
-
-EXTRA_OEMAKE = '\
-  LIBC="" \
-  STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
-  STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
-'
-
-do_configure_append() {
-	autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
-}
-
-do_install() {
-	oe_runmake 'DESTDIR=${D}' install
-	install -d ${D}${bindir}/${PN}
-	install -m 0755 Parser/pgen ${D}${bindir}/${PN}
-
-	# Make sure we use /usr/bin/env python
-	for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
-		sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
-	done
-
-	# Add a symlink to the native Python so that scripts can just invoke
-	# "nativepython" and get the right one without needing absolute paths
-	# (these often end up too long for the #! parser in the kernel as the
-	# buffer is 128 bytes long).
-	ln -s python-native/python ${D}${bindir}/nativepython
-
-	# We don't want modules in ~/.local being used in preference to those
-	# installed in the native sysroot, so disable user site support.
-	sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.13.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.13.bb
new file mode 100644
index 0000000..7edf153
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.13.bb
@@ -0,0 +1,61 @@
+require python.inc
+
+EXTRANATIVEPATH += "bzip2-native"
+DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native expat-native"
+PR = "${INC_PR}.1"
+
+SRC_URI += "\
+            file://05-enable-ctypes-cross-build.patch \
+            file://10-distutils-fix-swig-parameter.patch \
+            file://11-distutils-never-modify-shebang-line.patch \
+            file://0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch \
+            file://debug.patch \
+            file://unixccompiler.patch \
+            file://nohostlibs.patch \
+            file://multilib.patch \
+            file://add-md5module-support.patch \
+            file://builddir.patch \
+            file://parallel-makeinst-create-bindir.patch \
+            file://revert_use_of_sysconfigdata.patch \
+           "
+
+S = "${WORKDIR}/Python-${PV}"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:"
+
+inherit native
+
+require python-native-${PYTHON_MAJMIN}-manifest.inc
+
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --with-system-expat=${STAGING_DIR_HOST}"
+
+EXTRA_OEMAKE = '\
+  LIBC="" \
+  STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
+  STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
+'
+
+do_configure_append() {
+	autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_install() {
+	oe_runmake 'DESTDIR=${D}' install
+	install -d ${D}${bindir}/${PN}
+	install -m 0755 Parser/pgen ${D}${bindir}/${PN}
+
+	# Make sure we use /usr/bin/env python
+	for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
+		sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
+	done
+
+	# Add a symlink to the native Python so that scripts can just invoke
+	# "nativepython" and get the right one without needing absolute paths
+	# (these often end up too long for the #! parser in the kernel as the
+	# buffer is 128 bytes long).
+	ln -s python-native/python ${D}${bindir}/nativepython
+
+	# We don't want modules in ~/.local being used in preference to those
+	# installed in the native sysroot, so disable user site support.
+	sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.2.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.2.0.bb
deleted file mode 100644
index 82e0fa8..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.2.0.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-SUMMARY = "A Pure Python Expect like Module for Python"
-HOMEPAGE = "http://pexpect.readthedocs.org/"
-SECTION = "devel/python"
-LICENSE = "ISC"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1c7a725251880af8c6a148181665385b"
-
-SRCNAME = "pexpect"
-
-SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
-SRC_URI[md5sum] = "8071ec5df0f3d515daedafad672d1632"
-SRC_URI[sha256sum] = "bf6816b8cc8d301a499e7adf338828b39bc7548eb64dbed4dd410ed93d95f853"
-
-UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/pexpect"
-
-S = "${WORKDIR}/pexpect-${PV}"
-
-inherit setuptools
-
-RDEPENDS_${PN} = "\
-    python-core \
-    python-io \
-    python-terminal \
-    python-resource \
-    python-fcntl \
-    python-ptyprocess \
-"
-
-BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.2.1.bb
new file mode 100644
index 0000000..1321797
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.2.1.bb
@@ -0,0 +1,28 @@
+SUMMARY = "A Pure Python Expect like Module for Python"
+HOMEPAGE = "http://pexpect.readthedocs.org/"
+SECTION = "devel/python"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1c7a725251880af8c6a148181665385b"
+
+SRCNAME = "pexpect"
+
+SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+SRC_URI[md5sum] = "3694410001a99dff83f0b500a1ca1c95"
+SRC_URI[sha256sum] = "3d132465a75b57aa818341c6521392a06cc660feb3988d7f1074f39bd23c9a92"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/pexpect"
+
+S = "${WORKDIR}/pexpect-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} = "\
+    python-core \
+    python-io \
+    python-terminal \
+    python-resource \
+    python-fcntl \
+    python-ptyprocess \
+"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-ptyprocess_0.5.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-ptyprocess_0.5.1.bb
index 931e5a7..eed24ad 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-ptyprocess_0.5.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-ptyprocess_0.5.1.bb
@@ -20,4 +20,4 @@
     python-core \
 "
 
-BBCLASSEXTEND = "nativesdk"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl.inc
new file mode 100644
index 0000000..d26318b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl.inc
@@ -0,0 +1,31 @@
+SUMMARY = "Python bindings for libcurl"
+HOMEPAGE = "http://pycurl.sourceforge.net/"
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1+ | MIT"
+LIC_FILES_CHKSUM = "file://README.rst;beginline=166;endline=182;md5=a84a1caa65b89d4584b693d3680062fb \
+                    file://COPYING-LGPL;md5=3579a9fd0221d49a237aaa33492f988c \
+                    file://COPYING-MIT;md5=b7e434aeb228ed731c00bcf177e79b19"
+
+DEPENDS = "curl ${PYTHON_PN}"
+RDEPENDS_${PN} = "${PYTHON_PN}-core curl"
+SRCNAME = "pycurl"
+
+SRC_URI = "\
+  http://${SRCNAME}.sourceforge.net/download/${SRCNAME}-${PV}.tar.gz;name=archive \
+  file://no-static-link.patch \
+"
+
+SRC_URI[archive.md5sum] = "bca7bf47320082588db544ced2ba8717"
+SRC_URI[archive.sha256sum] = "8a1e0eb55573388275a1d6c2534ca4cfca5d7fa772b99b505c08fa149b27aed0"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+BBCLASSEXTEND = "native"
+
+# Ensure the docstrings are generated as make clean will remove them
+do_compile_prepend() {
+	${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py docstrings
+}
+
+do_install_append() {
+	rm -rf ${D}${datadir}/share
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl_7.21.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl_7.21.5.bb
index 7b41f6d..eb70cea 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl_7.21.5.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl_7.21.5.bb
@@ -1,33 +1,3 @@
-SUMMARY = "Python bindings for libcurl"
-HOMEPAGE = "http://pycurl.sourceforge.net/"
-SECTION = "devel/python"
-LICENSE = "LGPLv2.1+ | MIT"
-LIC_FILES_CHKSUM = "file://README.rst;beginline=166;endline=182;md5=a84a1caa65b89d4584b693d3680062fb \
-                    file://COPYING-LGPL;md5=3579a9fd0221d49a237aaa33492f988c \
-                    file://COPYING-MIT;md5=b7e434aeb228ed731c00bcf177e79b19"
-
-DEPENDS = "curl python"
-RDEPENDS_${PN} = "python-core curl"
-SRCNAME = "pycurl"
-
-SRC_URI = "\
-  http://${SRCNAME}.sourceforge.net/download/${SRCNAME}-${PV}.tar.gz;name=archive \
-  file://no-static-link.patch \
-"
-
-SRC_URI[archive.md5sum] = "bca7bf47320082588db544ced2ba8717"
-SRC_URI[archive.sha256sum] = "8a1e0eb55573388275a1d6c2534ca4cfca5d7fa772b99b505c08fa149b27aed0"
-S = "${WORKDIR}/${SRCNAME}-${PV}"
+require python-pycurl.inc
 
 inherit distutils
-
-BBCLASSEXTEND = "native"
-
-# Ensure the docstrings are generated as make clean will remove them
-do_compile_prepend() {
-	${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py docstrings
-}
-
-do_install_append() {
-	rm -rf ${D}${datadir}/share
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.5.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.5.1.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.5.0.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.5.1.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.5.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.5.0.bb
deleted file mode 100644
index 8543c41..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.5.0.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-SUMMARY = "Software Construction tool (make/autotools replacement)"
-SECTION = "devel/python"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3a885dff6d14e4cd876d9008a09a42de"
-SRCNAME = "scons"
-
-SRC_URI = "https://files.pythonhosted.org/packages/source/s/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "bda5530a70a41a7831d83c8b191c021e"
-SRC_URI[sha256sum] = "01f1b3d6023516a8e1b5e77799e5a82a23b32953b1102d339059ffeca8600493"
-
-UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/SCons/"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit setuptools
-
-RDEPENDS_${PN} = "\
-  python-fcntl \
-  python-io \
-  python-json \
-  python-subprocess \
-  "
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.5.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.5.1.bb
new file mode 100644
index 0000000..3f43856
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.5.1.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Software Construction tool (make/autotools replacement)"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3a885dff6d14e4cd876d9008a09a42de"
+SRCNAME = "scons"
+
+SRC_URI = "https://files.pythonhosted.org/packages/source/s/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "3eac81e5e8206304a9b4683c57665aa4"
+SRC_URI[sha256sum] = "c8de85fc02ed1a687b1f2ac791eaa0c1707b4382a204f17d782b5b111b9fdf07"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/SCons/"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} = "\
+  python-fcntl \
+  python-io \
+  python-json \
+  python-subprocess \
+  "
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools.inc
index 92ca9a0..40f47d4 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools.inc
@@ -3,14 +3,14 @@
 SECTION = "devel/python"
 LICENSE = "MIT"
 
-LIC_FILES_CHKSUM = "file://setup.py;beginline=134;endline=134;md5=3e8df024d6c1442d18e84acf8fbbc475"
+LIC_FILES_CHKSUM = "file://setup.py;beginline=146;endline=146;md5=3e8df024d6c1442d18e84acf8fbbc475"
 
 SRCNAME = "setuptools"
 
 SRC_URI = "https://files.pythonhosted.org/packages/source/s/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
 
-SRC_URI[md5sum] = "869f3029dcc66a64ba39875e2a2f044a"
-SRC_URI[sha256sum] = "19aad19471052d5daefe96f2c1fa2e88dcdb17488bf8708d7e6356881ea833cb"
+SRC_URI[md5sum] = "8b67868c3430e978833ebd0d1b766694"
+SRC_URI[sha256sum] = "8303fb24306385f09bf8b0e5a385c1548e42e8efc08558d64049bc0d55ea012d"
 
 UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/setuptools"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_22.0.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_32.1.1.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_22.0.5.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_32.1.1.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch
deleted file mode 100644
index 2f14a12..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-channels/rpm_sys: use md5sum instead of mtime as the digest
-
-Use the internal getFileDigest() function (which defaults to md5) instead of
-mtime for getting the file digest. On some systems mtime proved to be
-unreliable because of delayed update. This caused smart to miss rpm db updates
-and thus get its understanding of installed packages out of sync.
-
-Upstream-Status: Pending
-
-Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
----
- smart/channels/rpm_sys.py | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/smart/channels/rpm_sys.py b/smart/channels/rpm_sys.py
-index b9fda27..6f1fe94 100644
---- a/smart/channels/rpm_sys.py
-+++ b/smart/channels/rpm_sys.py
-@@ -22,6 +22,7 @@
- from smart.backends.rpm.header import RPMDBLoader
- from smart.backends.rpm.base import getTS, rpm_join_dbpath
- from smart.channel import PackageChannel
-+from smart.util.filetools import getFileDigest
- from smart import *
- import os
- 
-@@ -35,7 +36,7 @@ class RPMSysChannel(PackageChannel):
-         dbdir = rpm_join_dbpath(sysconf.get("rpm-root", "/"),
-                             sysconf.get("rpm-dbpath", "var/lib/rpm"))
-         path = os.path.join(dbdir, "Packages")
--        digest = os.path.getmtime(path)
-+        digest = getFileDigest(path)
-         if digest == self._digest:
-             return True
-         self.removeLoaders()
--- 
-2.6.6
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-deugging-when-targetpath-is-empty.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-deugging-when-targetpath-is-empty.patch
deleted file mode 100644
index 5e80804..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-deugging-when-targetpath-is-empty.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 01e51afd03131947f8d74b9a23fdbc0078249499 Mon Sep 17 00:00:00 2001
-From: Mariano Lopez <mariano.lopez@linux.intel.com>
-Date: Wed, 3 Aug 2016 07:47:09 +0000
-Subject: [PATCH] fetcher.py: Add debugging when targetpath is empty
-
-There are several errors when openining files or manipulating
-path strings, those errors point targetpath passed to
-setSucceeded() is empty. This patch won't solve the problems,
-but will add debugging to give an idea why is failing.
-
-Upstream-Status: Inappropriate [debugging]
-
-Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
----
- smart/fetcher.py | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
-
-diff --git a/smart/fetcher.py b/smart/fetcher.py
-index dd3ff6b..64aa979 100644
---- a/smart/fetcher.py
-+++ b/smart/fetcher.py
-@@ -594,6 +594,22 @@ class FetchItem(object):
-                 self._eta = None
- 
-     def setSucceeded(self, targetpath, fetchedsize=0):
-+        # It seems the in some odd cases targetpath here
-+        # is empty, this will lead to bugs in several places
-+        if not targetpath:
-+            import traceback
-+            tb_str = ""
-+            for threadId, stack in sys._current_frames().items():
-+                tb_str += '\nThreadID: %s' % threadId
-+                for filename, lineno, name, line in traceback.extract_stack(stack):
-+                    tb_str += '\nFile: "%s", line %d, in %s' % (filename, lineno, name)
-+                    if line:
-+                        tb_str += "\n  %s" % line.strip()
-+            error_string = ["No file path specified",
-+                            "URL: %s" % self._url,
-+                            "Status: %s" % self._status,
-+                            "Traceback: %s" % tb_str]
-+            raise Error, _("\n".join(error_string))
-         if self._status is not FAILED:
-             self._status = SUCCEEDED
-             self._targetpath = targetpath
--- 
-2.6.6
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch
deleted file mode 100644
index fe98d07..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-python-smartpm: Add checking for "rpm-ignoresize" option
-
-The do_rootfs takes a very long time when build host has mounted many NFS
-devices. syscall lstat() was being called on every filesystem mounted on the
-build host during building.
-The reason for the lstat() is that rpm is verifying that enough free disk space
-is available to do the install. However, since the install is into the target
-rootfs it should not matter how much free space there is in the host mounts.
-Add checking for "rpm-ignoresize", by it, smart can make whether RPM skip
-checking for diskspace when install a rpm package.
-
-Upstream-Status: Pending
-
-Signed-off-by: wenlin.kang <wenlin.kang@windriver.com>
-Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
----
- smart/backends/rpm/pm.py | 4 ++++
- 1 file changed, 4 insertions(+)
-
-Index: git/smart/backends/rpm/pm.py
-===================================================================
---- git.orig/smart/backends/rpm/pm.py
-+++ git/smart/backends/rpm/pm.py
-@@ -233,6 +233,11 @@ class RPMPackageManager(PackageManager):
-         if sysconf.get("rpm-order"):
-             ts.order()
-         probfilter = rpm.RPMPROB_FILTER_OLDPACKAGE
-+
-+        if sysconf.get("rpm-ignoresize", False):
-+            probfilter |= rpm.RPMPROB_FILTER_DISKNODES
-+            probfilter |= rpm.RPMPROB_FILTER_DISKSPACE
-+
-         if force or reinstall:
-             probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG
-             probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch
deleted file mode 100644
index 9055555..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From a74a9a9eb9d75964a0e978950e8b191d7a18d763 Mon Sep 17 00:00:00 2001
-From: Paul Eggleton <paul.eggleton@linux.intel.com>
-Date: Fri, 5 Jun 2015 17:07:16 +0100
-Subject: [PATCH] smart: change "is already installed" message from warning to
- info
-
-This doesn't need to be a warning.
-
-Upstream-Status: Pending
-
-Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
----
- smart/commands/install.py            | 4 ++--
- smart/interfaces/text/interactive.py | 2 +-
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/smart/commands/install.py b/smart/commands/install.py
-index 6ef9682..80d456b 100644
---- a/smart/commands/install.py
-+++ b/smart/commands/install.py
-@@ -152,7 +152,7 @@ def main(ctrl, opts):
-             for obj in results:
-                 for pkg in obj.packages:
-                     if pkg.installed:
--                        iface.warning(_("%s (for %s) is already installed")
-+                        iface.info(_("%s (for %s) is already installed")
-                                       % (pkg, arg))
-                         installed = True
-                         break
-@@ -184,7 +184,7 @@ def main(ctrl, opts):
-         for name in names:
-             pkg = names[name][0]
-             if pkg.installed:
--                iface.warning(_("%s is already installed") % pkg)
-+                iface.info(_("%s is already installed") % pkg)
-             else:
-                 trans.enqueue(pkg, INSTALL)
- 
-diff --git a/smart/interfaces/text/interactive.py b/smart/interfaces/text/interactive.py
-index 9865584..190867b 100644
---- a/smart/interfaces/text/interactive.py
-+++ b/smart/interfaces/text/interactive.py
-@@ -278,7 +278,7 @@ class Interpreter(Cmd):
-             for name in names:
-                 pkg = names[name][0]
-                 if pkg.installed:
--                    iface.warning(_("%s is already installed") % pkg)
-+                    iface.info(_("%s is already installed") % pkg)
-                 else:
-                     found = True
-                     transaction.enqueue(pkg, INSTALL)
--- 
-2.1.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch
deleted file mode 100644
index 6e672b3..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-Sadly, smart is not deterministic so the same build can go down multiple different
-pathways. We'd expect to see the same warnings however depending on the pathway
-taken, it may or may not warn, particularly with Recommends since they're optional.
-
-For example, where a Recommended package is available but has Conflicts, we'd expect
-to see an warning that we couldn't install it. Some code paths silently hide this
-(its a LOCKED_CONFLICT). We add printing of warnings for this case.
-
-Also, if there are two compatible feeds available (e.g. i586 and core2_32), this 
-changes the code path from direct _install() to _pending() since there are multiple
-providers. This patch adds warning handling to _pending() so we don't hit hard 
-failures there. This is as seen with the mysterious libspeexdsp failures for x86-lsb
-on the autobuilder.
-
-Upstream-Status: Pending
-RP
-2015/7/16
-
-Index: git/smart/transaction.py
-===================================================================
---- git.orig/smart/transaction.py
-+++ git/smart/transaction.py
-@@ -651,13 +651,14 @@ class Transaction(object):
- 
-             if not prvpkgs:
-                 # No packages provide it at all. Give up.
-+
-+                reasons = []
-+                for prv in req.providedby:
-+                    for prvpkg in prv.packages:
-+                        lockedres = lockedpkgs.get(prvpkg, None)
-+                        if lockedres:
-+                            reasons.append(lock_reason(prvpkg, lockedres))
-                 if reqrequired:
--                    reasons = []
--                    for prv in req.providedby:
--                        for prvpkg in prv.packages:
--                            lockedres = lockedpkgs.get(prvpkg, None)
--                            if lockedres:
--                                reasons.append(lock_reason(prvpkg, lockedres))
-                     if reasons:
-                         raise Failed, _("Can't install %s: unable to install provider for %s:\n    %s") % \
-                                 (pkg, req, '\n    '.join(reasons))
-@@ -665,7 +666,11 @@ class Transaction(object):
-                         raise Failed, _("Can't install %s: no package provides %s") % \
-                                 (pkg, req)
-                 else:
-+                    if reasons:
-+                        iface.warning(_("Can't install %s: unable to install provider for %s:\n    %s") % \
-+                                (pkg, req, '\n    '.join(reasons)))
-+
-                     # It's only a recommend, skip
-                     continue
- 
-             if len(prvpkgs) == 1:
-@@ -846,6 +852,14 @@ class Transaction(object):
-         isinst = changeset.installed
-         getweight = self._policy.getWeight
- 
-+        attempt = sysconf.has("attempt-install", soft=True)
-+
-+        def handle_failure(msg):
-+            if attempt:
-+                iface.warning(msg)
-+            else:
-+                raise Failed, msg
-+
-         updown = []
-         while pending:
-             item = pending.pop(0)
-@@ -870,8 +884,9 @@ class Transaction(object):
- 
-                 if not prvpkgs:
-                     # No packages provide it at all. Give up.
--                    raise Failed, _("Can't install %s: no package "
--                                    "provides %s") % (pkg, req)
-+                    handle_failure(_("Can't install %s: no package "
-+                                    "provides %s") % (pkg, req))
-+                    continue
- 
-                 if len(prvpkgs) > 1:
-                     # More than one package provide it. We use _pending here,
-@@ -894,9 +909,10 @@ class Transaction(object):
-                                                  keeporder, cs, lk))
-                             keeporder += 0.000001
-                     if not alternatives:
--                        raise Failed, _("Can't install %s: all packages "
-+                        handle_failure(_("Can't install %s: all packages "
-                                         "providing %s failed to install:\n%s")\
--                                      % (pkg, req,  "\n".join(failures))
-+                                      % (pkg, req,  "\n".join(failures)))
-+                        continue
-                     alternatives.sort()
-                     changeset.setState(alternatives[0][1])
-                     if len(alternatives) == 1:
-@@ -954,18 +970,20 @@ class Transaction(object):
- 
-                     for reqpkg in reqpkgs:
-                         if reqpkg in locked and isinst(reqpkg):
--                            raise Failed, _("Can't remove %s: requiring "
-+                            handle_failure(_("Can't remove %s: requiring "
-                                             "package %s is locked") % \
--                                          (pkg, reqpkg)
-+                                          (pkg, reqpkg))
-+                            continue
-                     for reqpkg in reqpkgs:
-                         # We check again, since other actions may have
-                         # changed their state.
-                         if not isinst(reqpkg):
-                             continue
-                         if reqpkg in locked:
--                            raise Failed, _("Can't remove %s: requiring "
-+                            handle_failure(_("Can't remove %s: requiring "
-                                             "package %s is locked") % \
--                                          (pkg, reqpkg)
-+                                          (pkg, reqpkg))
-+                            continue
-                         self._remove(reqpkg, changeset, locked,
-                                      pending, depth)
-                     continue
-@@ -978,12 +996,14 @@ class Transaction(object):
-                 try:
-                     for reqpkg in reqpkgs:
-                         if reqpkg in locked and isinst(reqpkg):
--                            raise Failed, _("%s is locked") % reqpkg
-+                            handle_failure(_("%s is locked") % reqpkg)
-+                            continue
-                     for reqpkg in reqpkgs:
-                         if not cs.installed(reqpkg):
-                             continue
-                         if reqpkg in lk:
--                            raise Failed, _("%s is locked") % reqpkg
-+                            handle_failure(_("%s is locked") % reqpkg)
-+                            continue
-                         self._remove(reqpkg, cs, lk, None, depth)
-                 except Failed, e:
-                     failures.append(unicode(e))
-@@ -991,9 +1011,10 @@ class Transaction(object):
-                     alternatives.append((getweight(cs), cs, lk))
- 
-                 if not alternatives:
--                    raise Failed, _("Can't install %s: all packages providing "
-+                    handle_failure(_("Can't install %s: all packages providing "
-                                     "%s failed to install:\n%s") \
--                                  % (pkg, prv,  "\n".join(failures))
-+                                  % (pkg, prv,  "\n".join(failures)))
-+                    continue
- 
-                 alternatives.sort()
-                 changeset.setState(alternatives[0][1])
-@@ -1246,6 +1267,7 @@ class Transaction(object):
-                             changeset.setRequested(pkg, True)
-                     except Failed, e:
-                         if sysconf.has("attempt-install", soft=True):
-+                            iface.warning(_("Can't install %s: %s") % (pkg, str(e)))
-                             if pkg in changeset:
-                                 del changeset[pkg]
-                             continue
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
deleted file mode 100644
index 5aedc88..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From b105e7fe812da3ccaf7155c0fe14c8728b0d39a5 Mon Sep 17 00:00:00 2001
-From: Mark Hatle <mark.hatle@windriver.com>
-Date: Mon, 20 Jan 2014 14:30:52 +0000
-Subject: [PATCH] Add mechanism to attempt install without failing
-
-In OpenEmbedded, for complementary and 'attemptonly' package processing,
-we need a way to instruct smart to try to install, but ignore any
-failures (usually conflicts).
-
-This option only works for the install operation.
-
-If a complementary install fails, an actual error occurred, one that
-we can't ignore without losing the entire attempted transaction.  Keep
-this as an error so that we can catch these cases in the futre.
-
-Upstream-Status: Pending
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
----
- backends/rpm/pm.py |   35 ++++++++++++++++++++++++++++++++++-
- transaction.py     |   50 +++++++++++++++++++++++++++++++++++++-------------
- 2 files changed, 71 insertions(+), 14 deletions(-)
-
-diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py
-index 9bbd952..ba6405a 100644
---- a/smart/backends/rpm/pm.py
-+++ b/smart/backends/rpm/pm.py
-@@ -241,15 +241,48 @@ class RPMPackageManager(PackageManager):
-         cb = RPMCallback(prog, upgradednames)
-         cb.grabOutput(True)
-         probs = None
-+        retry = 0
-         try:
-             probs = ts.run(cb, None)
-         finally:
-             del getTS.ts
-             cb.grabOutput(False)
-+            if (probs is not None) and sysconf.has("attempt-install", soft=True):
-+                def remove_conflict(pkgNEVR):
-+                    for key in changeset.keys():
-+                        if pkgNEVR == str(key):
-+                            del changeset[key]
-+                            del pkgpaths[key]
-+                            iface.warning("Removing %s due to file %s conflicting with %s" % (pkgNEVR, fname, altNEVR))
-+                            break
-+
-+                retry = 1
-+                for prob in probs:
-+                    if prob[1][0] == rpm.RPMPROB_NEW_FILE_CONFLICT:
-+                        msg = prob[0].split()
-+                        fname = msg[1]
-+                        pkgNEVR = msg[7]
-+                        altNEVR = msg[9]
-+                        pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1]
-+                        altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1]
-+                        remove_conflict(pkgNEVR)
-+                    elif prob[1][0] == rpm.RPMPROB_FILE_CONFLICT:
-+                        msg = prob[0].split()
-+                        fname = msg[1]
-+                        pkgNEVR = msg[5]
-+                        altNEVR = msg[11]
-+                        pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1]
-+                        altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1]
-+                        remove_conflict(pkgNEVR)
-+                    else:
-+                        retry = 0
-+
-             prog.setDone()
--            if probs is not None:
-+            if (probs is not None) and (not retry):
-                 raise Error, "\n".join([x[0] for x in probs])
-             prog.stop()
-+            if retry and len(changeset):
-+                self.commit(changeset, pkgpaths)
- 
- class RPMCallback:
-     def __init__(self, prog, upgradednames):
-diff --git a/smart/transaction.py b/smart/transaction.py
-index 4b90cb7..3e043e9 100644
---- a/smart/transaction.py
-+++ b/smart/transaction.py
-@@ -555,6 +555,8 @@ class Transaction(object):
-         changeset.set(pkg, INSTALL)
-         isinst = changeset.installed
- 
-+        attempt = sysconf.has("attempt-install", soft=True)
-+
-         # Remove packages conflicted by this one.
-         for cnf in pkg.conflicts:
-             for prv in cnf.providedby:
-@@ -564,11 +566,16 @@ class Transaction(object):
-                     if not isinst(prvpkg):
-                         locked[prvpkg] = (LOCKED_CONFLICT_BY, pkg)
-                         continue
--                    if prvpkg in locked:
--                        raise Failed, _("Can't install %s: conflicted package "
--                                        "%s is locked") % (pkg, prvpkg)
--                    self._remove(prvpkg, changeset, locked, pending, depth)
--                    pending.append((PENDING_UPDOWN, prvpkg))
-+                    if attempt:
-+                        del changeset[pkg]
-+                        raise Failed, _("Can't install %s: it conflicts with package "
-+                                        "%s") % (pkg, prvpkg)
-+                    else:
-+                        if prvpkg in locked:
-+                            raise Failed, _("Can't install %s: conflicted package "
-+                                            "%s is locked") % (pkg, prvpkg)
-+                        self._remove(prvpkg, changeset, locked, pending, depth)
-+                        pending.append((PENDING_UPDOWN, prvpkg))
- 
-         # Remove packages conflicting with this one.
-         for prv in pkg.provides:
-@@ -579,12 +586,18 @@ class Transaction(object):
-                     if not isinst(cnfpkg):
-                         locked[cnfpkg] = (LOCKED_CONFLICT, pkg)
-                         continue
--                    if cnfpkg in locked:
-+                    if attempt:
-+                        del changeset[pkg]
-                         raise Failed, _("Can't install %s: it's conflicted by "
--                                        "the locked package %s") \
--                                      % (pkg, cnfpkg)
--                    self._remove(cnfpkg, changeset, locked, pending, depth)
--                    pending.append((PENDING_UPDOWN, cnfpkg))
-+                                        "the package %s") \
-+                                    % (pkg, cnfpkg)
-+                    else:
-+                        if cnfpkg in locked:
-+                            raise Failed, _("Can't install %s: it's conflicted by "
-+                                            "the locked package %s") \
-+                                        % (pkg, cnfpkg)
-+                        self._remove(cnfpkg, changeset, locked, pending, depth)
-+                        pending.append((PENDING_UPDOWN, cnfpkg))
- 
-         # Remove packages with the same name that can't
-         # coexist with this one.
-@@ -594,10 +607,15 @@ class Transaction(object):
-                 if not isinst(namepkg):
-                     locked[namepkg] = (LOCKED_NO_COEXIST, pkg)
-                     continue
--                if namepkg in locked:
-+                if attempt:
-+                    del changeset[pkg]
-                     raise Failed, _("Can't install %s: it can't coexist "
-                                     "with %s") % (pkg, namepkg)
--                self._remove(namepkg, changeset, locked, pending, depth)
-+                else:
-+                    if namepkg in locked:
-+                        raise Failed, _("Can't install %s: it can't coexist "
-+                                        "with %s") % (pkg, namepkg)
-+                    self._remove(namepkg, changeset, locked, pending, depth)
- 
-         # Install packages required by this one.
-         for req in pkg.requires + pkg.recommends:
-@@ -1176,6 +1194,8 @@ class Transaction(object):
- 
-         self._policy.runStarting()
- 
-+        attempt = sysconf.has("attempt-install", soft=True)
-+
-         try:
-             changeset = self._changeset.copy()
-             isinst = changeset.installed
-@@ -1190,7 +1210,11 @@ class Transaction(object):
-                     locked[pkg] = (LOCKED_KEEP, None)
-                 elif op is INSTALL:
-                     if not isinst(pkg) and pkg in locked:
--                        raise Failed, _("Can't install %s: it's locked") % pkg
-+                        if attempt:
-+                            iface.warning(_("Can't install %s: it's locked") % pkg)
-+                            del changeset[pkg]
-+                        else:
-+                            raise Failed, _("Can't install %s: it's locked") % pkg
-                     changeset.set(pkg, INSTALL)
-                     locked[pkg] = (LOCKED_INSTALL, None)
-                 elif op is REMOVE:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch
deleted file mode 100644
index 225b02f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From ee05e55e84b53f4bb0d0baba13ca47a8f84b7cb4 Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Wed, 30 Sep 2015 01:12:52 -0700
-Subject: [PATCH] smart:cache.py: getPackages() matches name + arch
-
-It only matched name ony in the past, for example:
-smart install busybox (matched)
-but:
-smart install busybox@core2_64 (didn't match)
-
-The installation is very slow when no match since it would seach all the
-packages in the repo
-This patch makes it match both.
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- smart/cache.py |    3 ++-
- smart/ccache.c |    9 ++++++++-
- 2 files changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/smart/control.py b/smart/control.py
-index d44abe7..f23a604 100644
---- a/smart/control.py
-+++ b/smart/control.py
-@@ -876,9 +876,13 @@ class Control(object):
-         objects = []
- 
-         # If we find packages with exactly the given
--        # name or name-version, use them.
--        for pkg in self._cache.getPackages(s):
--            if pkg.name == s or "%s-%s" % (pkg.name, pkg.version) == s:
-+        # name, name-version, or name@arch, use them.
-+        s_name = s
-+        if "@" in s:
-+            s_name = s.split("@")[0]
-+        for pkg in self._cache.getPackages(s_name):
-+            if pkg.name == s or "%s-%s" % (pkg.name, pkg.version) == s \
-+                    or "%s@%s" % (pkg.name, pkg.version.split('@')[1]) == s:
-                 objects.append((1.0, pkg))
-          
-         if not objects:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channel-remove-all.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channel-remove-all.patch
deleted file mode 100644
index da23e7c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channel-remove-all.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 6d2363a705697f615d9e5af5d6703b291e618b46 Mon Sep 17 00:00:00 2001
-From: Daniel Klauer <daniel.klauer@gin.de>
-Date: Thu, 12 May 2016 17:55:01 +0200
-Subject: [PATCH] Fix channel command --remove-all option parsing
-
-Option.take_action() stores a list of options given for validation later.
-It strips leading dashes and turns remaining dashes into underscores.
-This list is what ensure_action() will compare its arguments against,
-thus we must use underscores here.
-
-Upstream-Status: Pending
-
-Signed-off-by: Daniel Klauer <daniel.klauer@gin.de>
----
- smart/commands/channel.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/smart/commands/channel.py b/smart/commands/channel.py
-index 108f3f1..6234f69 100644
---- a/smart/commands/channel.py
-+++ b/smart/commands/channel.py
-@@ -164,7 +164,7 @@ def main(ctrl, opts):
-     opts.check_args_of_option("edit", 0)
-     opts.check_args_of_option("enable", -1)
-     opts.check_args_of_option("disable", -1)
--    opts.ensure_action("channel", ["add", "set", "remove", "remove-all",
-+    opts.ensure_action("channel", ["add", "set", "remove", "remove_all",
-                        "list", "show", "yaml", "enable", "disable"])
-     opts.check_remaining_args()
- 
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch
deleted file mode 100644
index e621b33..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Make CHANNELSDIR in smart empty, since this causes host contamination issues
-on some RPM-based hosts on which smart is already installed.
-
-[YOCTO #3881]
-
-Upstream-Status: Inappropriate [embedded specific]
-
-diff --git a/smart/plugins/channelsync.py b/smart/plugins/channelsync.py
-index 3ba95ff..646d696 100644
---- a/smart/plugins/channelsync.py
-+++ b/smart/plugins/channelsync.py
-@@ -23,7 +23,11 @@ from smart.channel import *
- from smart import *
- import os
- 
--CHANNELSDIR = "/etc/smart/channels/"
-+# For now, we leave the definition of CHANNELSDIR empty. This prevents smart
-+# from erroneously consider the  build host's channels while setting up its
-+# channels [YOCTO #3881]. If this feature will be used in the future, CHANNELSDIR
-+# should be set to a proper value.
-+CHANNELSDIR = ""
- 
- def syncChannels(channelsdir, force=None):
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-locale.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-locale.patch
deleted file mode 100644
index 0f1dfb9..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-locale.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-rpm or commands run by rpm can use output which isn't strictly acsii such
-as quotation characters around expression which are character 0xe2.
-
-Use utf-8 as an encoding rather than whatever the system suggests to
-ensure smart copes with this rather than erroring with unicode errors.
-
-RP 2016/5/19
-Upstream-Status: Pending
-
-
-Index: git/smart/backends/rpm/pm.py
-===================================================================
---- git.orig/smart/backends/rpm/pm.py
-+++ git/smart/backends/rpm/pm.py
-@@ -32,11 +32,7 @@ from smart.pm import PackageManager
- from smart import sysconf, iface, Error, _
- 
- 
--try:
--    ENCODING = locale.getpreferredencoding()
--except locale.Error:
--    ENCODING = "ascii"
--
-+ENCODING = "utf-8"
- 
- def get_public_key(header):
-     return header.sprintf("%|DSAHEADER?{%{DSAHEADER:pgpsig}}:"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch
deleted file mode 100644
index d607fc4..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch
+++ /dev/null
@@ -1,381 +0,0 @@
-Handle recommended packages in core and rpm backends
-
-Identify and store recommended packages in the cache, add a query option
-to read them and ignore them if they are not present when installing.
-
-Initial identification code from Mark Hatle <mark.hatle@windriver.com>.
-
-Upstream-Status: Pending
-
-Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-
-diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
-index 9332ea0..4fcfbee 100644
---- a/smart/backends/rpm/base.py
-+++ b/smart/backends/rpm/base.py
-@@ -225,6 +225,52 @@ class RPMPackage(Package):
-                         break
-                 else:
-                     return False
-+        srecs = fk(self.recommends)
-+        orecs = fk(other.recommends)
-+        if srecs != orecs:
-+            for srec in srecs:
-+                if srec.name[0] == "/" or srec in orecs:
-+                    continue
-+                for orec in orecs:
-+                    if (srec.name == orec.name and
-+                        srec.relation == orec.relation and
-+                        checkver(srec.version, orec.version)):
-+                        break
-+                else:
-+                    return False
-+            for orec in orecs:
-+                if orec.name[0] == "/" or orec in srecs:
-+                    continue
-+                for srec in srecs:
-+                    if (srec.name == orec.name and
-+                        srec.relation == orec.relation and
-+                        checkver(srec.version, orec.version)):
-+                        break
-+                else:
-+                    return False
-+        srecs = fk(self.recommends)
-+        orecs = fk(other.recommends)
-+        if srecs != orecs:
-+            for srec in srecs:
-+                if srec.name[0] == "/" or srec in orecs:
-+                    continue
-+                for orec in orecs:
-+                    if (srec.name == orec.name and
-+                        srec.relation == orec.relation and
-+                        checkver(srec.version, orec.version)):
-+                        break
-+                else:
-+                    return False
-+            for orec in orecs:
-+                if orec.name[0] == "/" or orec in srecs:
-+                    continue
-+                for srec in srecs:
-+                    if (srec.name == orec.name and
-+                        srec.relation == orec.relation and
-+                        checkver(srec.version, orec.version)):
-+                        break
-+                else:
-+                    return False
-         return True
- 
-     def coexists(self, other):
-diff --git a/smart/ccache.c b/smart/ccache.c
-index 7193185..8b66515 100644
---- a/smart/ccache.c
-+++ b/smart/ccache.c
-@@ -500,6 +500,46 @@ Package_equals(PackageObject *self, PackageObject *other)
-         }
-     }
- 
-+    ilen = 0;
-+    jlen = 0;
-+    for (i = 0; i != PyList_GET_SIZE(self->recommends); i++) {
-+        PyObject *item = PyList_GET_ITEM(self->recommends, i);
-+        if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) {
-+            PyErr_SetString(PyExc_TypeError, "Depends instance expected");
-+            return NULL;
-+        }
-+        if (STR(((DependsObject *)item)->name)[0] != '/')
-+            ilen += 1;
-+    }
-+    for (j = 0; j != PyList_GET_SIZE(other->recommends); j++) {
-+        PyObject *item = PyList_GET_ITEM(other->recommends, j);
-+        if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) {
-+            PyErr_SetString(PyExc_TypeError, "Depends instance expected");
-+            return NULL;
-+        }
-+        if (STR(((DependsObject *)item)->name)[0] != '/')
-+            jlen += 1;
-+    }
-+    if (ilen != jlen) {
-+        ret = Py_False;
-+        goto exit;
-+    }
-+
-+    ilen = PyList_GET_SIZE(self->recommends);
-+    jlen = PyList_GET_SIZE(other->recommends);
-+    for (i = 0; i != ilen; i++) {
-+        PyObject *item = PyList_GET_ITEM(self->recommends, i);
-+        if (STR(((DependsObject *)item)->name)[0] != '/') {
-+            for (j = 0; j != jlen; j++)
-+                if (item == PyList_GET_ITEM(other->recommends, j))
-+                    break;
-+            if (j == jlen) {
-+                ret = Py_False;
-+                goto exit;
-+            }
-+        }
-+    }
-+
- exit:
-     Py_INCREF(ret);
-     return ret;
-@@ -1813,6 +1853,59 @@ Loader_buildPackage(LoaderObject *self, PyObject *args)
-         }
-     }
- 
-+    /* if recargs: */
-+    if (recargs) {
-+        int i = 0;
-+        int len = PyList_GET_SIZE(recargs);
-+        /* pkg.recommends = [] */
-+        Py_DECREF(pkgobj->recommends);
-+        pkgobj->recommends = PyList_New(len);
-+        /* for args in recargs: */
-+        for (; i != len; i++) {
-+            PyObject *args = PyList_GET_ITEM(recargs, i);
-+            DependsObject *recobj;
-+            PyObject *rec;
-+            
-+            if (!PyTuple_Check(args)) {
-+                PyErr_SetString(PyExc_TypeError,
-+                                "Item in recargs is not a tuple");
-+                return NULL;
-+            }
-+
-+            /* rec = cache._objmap.get(args) */
-+            rec = PyDict_GetItem(cache->_objmap, args);
-+            recobj = (DependsObject *)rec;
-+
-+            /* if not rec: */
-+            if (!rec) {
-+                if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 2) {
-+                    PyErr_SetString(PyExc_ValueError, "Invalid recargs tuple");
-+                    return NULL;
-+                }
-+                /* rec = args[0](*args[1:]) */
-+                callargs = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
-+                rec = PyObject_CallObject(PyTuple_GET_ITEM(args, 0), callargs);
-+                Py_DECREF(callargs);
-+                if (!rec) return NULL;
-+                recobj = (DependsObject *)rec;
-+
-+                /* cache._objmap[args] = rec */
-+                PyDict_SetItem(cache->_objmap, args, rec);
-+                Py_DECREF(rec);
-+
-+                /* cache._recommends.append(rec) */
-+                PyList_Append(cache->_recommends, rec);
-+            }
-+
-+            /* relpkgs.append(rec.packages) */
-+            PyList_Append(relpkgs, recobj->packages);
-+
-+            /* pkg.recommends.append(rec) */
-+            Py_INCREF(rec);
-+            PyList_SET_ITEM(pkgobj->recommends, i, rec);
-+        }
-+    }
-+
-     /* if upgargs: */
-     if (upgargs) {
-         int i = 0;
-@@ -2592,6 +2685,16 @@ Cache_reset(CacheObject *self, PyObject *args)
-         if (PyList_Check(reqobj->providedby))
-             LIST_CLEAR(reqobj->providedby);
-     }
-+    len = PyList_GET_SIZE(self->_recommends);
-+    for (i = 0; i != len; i++) {
-+        DependsObject *reqobj;
-+        PyObject *req;
-+        req = PyList_GET_ITEM(self->_recommends, i);
-+        reqobj = (DependsObject *)req;
-+        LIST_CLEAR(reqobj->packages);
-+        if (PyList_Check(reqobj->providedby))
-+            LIST_CLEAR(reqobj->providedby);
-+    }
-     len = PyList_GET_SIZE(self->_upgrades);
-     for (i = 0; i != len; i++) {
-         DependsObject *upgobj;
-@@ -2834,6 +2937,30 @@ Cache__reload(CacheObject *self, PyObject *args)
-                 }
- 
-                 /*
-+                   for rec in pkg.recommends:
-+                       rec.packages.append(pkg)
-+                       if rec not in recommends:
-+                           recommends[rec] = True
-+                           objmap[rec.getInitArgs()] = rec
-+                */
-+                if (PyList_Check(pkg->recommends)) {
-+                    klen = PyList_GET_SIZE(pkg->recommends);
-+                    for (k = 0; k != klen; k++) {
-+                        PyObject *rec = PyList_GET_ITEM(pkg->recommends, k);
-+                        PyList_Append(((DependsObject *)rec)->packages,
-+                                      (PyObject *)pkg);
-+                        if (!PyDict_GetItem(recommends, rec)) {
-+                            PyDict_SetItem(recommends, rec, Py_True);
-+                            args = PyObject_CallMethod(rec, "getInitArgs",
-+                                                       NULL);
-+                            if (!args) return NULL;
-+                            PyDict_SetItem(objmap, args, rec);
-+                            Py_DECREF(args);
-+                        }
-+                    }
-+                }
-+
-+                /*
-                    for upg in pkg.upgrades:
-                        upg.packages.append(pkg)
-                        if upg not in upgrades:
-@@ -3097,6 +3224,47 @@ Cache_linkDeps(CacheObject *self, PyObject *args)
-         Py_DECREF(seq);
-     }
- 
-+    /* recnames = {} */
-+    recnames = PyDict_New();
-+    /* for rec in self._recommends: */
-+    len = PyList_GET_SIZE(self->_recommends);
-+    for (i = 0; i != len; i++) {
-+        PyObject *rec = PyList_GET_ITEM(self->_recommends, i);
-+
-+        /* for name in rec.getMatchNames(): */
-+        PyObject *names = PyObject_CallMethod(rec, "getMatchNames", NULL);
-+        PyObject *seq = PySequence_Fast(names, "getMatchNames() returned "
-+                                               "non-sequence object");
-+        int nameslen;
-+        if (!seq) return NULL;
-+        nameslen = PySequence_Fast_GET_SIZE(seq);
-+        for (j = 0; j != nameslen; j++) {
-+            PyObject *name = PySequence_Fast_GET_ITEM(seq, j);
-+            
-+            /* lst = recnames.get(name) */
-+            lst = PyDict_GetItem(recnames, name);
-+
-+            /* 
-+               if lst:
-+                   lst.append(rec)
-+               else:
-+                   recnames[name] = [rec]
-+            */
-+            if (lst) {
-+                PyList_Append(lst, rec);
-+            } else {
-+                lst = PyList_New(1);
-+                Py_INCREF(rec);
-+                PyList_SET_ITEM(lst, 0, rec);
-+                PyDict_SetItem(recnames, name, lst);
-+                Py_DECREF(lst);
-+            }
-+        }
-+
-+        Py_DECREF(names);
-+        Py_DECREF(seq);
-+    }
-+
-     /* upgnames = {} */
-     upgnames = PyDict_New();
-     /* for upg in self._upgrades: */
-@@ -3286,6 +3454,56 @@ Cache_linkDeps(CacheObject *self, PyObject *args)
-             }
-         }
- 
-+        /* lst = recnames.get(prv.name) */
-+        lst = PyDict_GetItem(recnames, prv->name);
-+
-+        /* if lst: */
-+        if (lst) {
-+            /* for rec in lst: */
-+            int reclen = PyList_GET_SIZE(lst);
-+            for (j = 0; j != reclen; j++) {
-+                DependsObject *rec = (DependsObject *)PyList_GET_ITEM(lst, j);
-+                /* if rec.matches(prv): */
-+                PyObject *ret = PyObject_CallMethod((PyObject *)rec, "matches",
-+                                                    "O", (PyObject *)prv);
-+                if (!ret) return NULL;
-+                if (PyObject_IsTrue(ret)) {
-+                    /*
-+                       if rec.providedby:
-+                           rec.providedby.append(prv)
-+                       else:
-+                           rec.providedby = [prv]
-+                    */
-+                    if (PyList_Check(rec->providedby)) {
-+                        PyList_Append(rec->providedby, (PyObject *)prv);
-+                    } else {
-+                        PyObject *_lst = PyList_New(1);
-+                        Py_INCREF(prv);
-+                        PyList_SET_ITEM(_lst, 0, (PyObject *)prv);
-+                        Py_DECREF(rec->providedby);
-+                        rec->providedby = _lst;
-+                    }
-+
-+                    /*
-+                       if prv.recommendedby:
-+                           prv.recommendedby.append(prv)
-+                       else:
-+                           prv.recommendedby = [prv]
-+                    */
-+                    if (PyList_Check(prv->recommendedby)) {
-+                        PyList_Append(prv->recommendedby, (PyObject *)rec);
-+                    } else {
-+                        PyObject *_lst = PyList_New(1);
-+                        Py_INCREF(rec);
-+                        PyList_SET_ITEM(_lst, 0, (PyObject *)rec);
-+                        Py_DECREF(prv->recommendedby);
-+                        prv->recommendedby = _lst;
-+                    }
-+                }
-+                Py_DECREF(ret);
-+            }
-+        }
-+
-         /* lst = upgnames.get(prv.name) */
-         lst = PyDict_GetItem(upgnames, prv->name);
- 
-@@ -3821,6 +4094,21 @@ Cache__setstate__(CacheObject *self, PyObject *state)
-         }
- 
-         /*
-+           for rec in pkg.recommends:
-+               rec.packages.append(pkg)
-+               recommends[rec] = True
-+        */
-+        if (PyList_Check(pkgobj->recommends)) {
-+            jlen = PyList_GET_SIZE(pkgobj->recommends);
-+            for (j = 0; j != jlen; j++) {
-+                PyObject *rec = PyList_GET_ITEM(pkgobj->recommends, j);
-+                DependsObject *recobj = (DependsObject *)rec;
-+                PyList_Append(recobj->packages, pkg);
-+                PyDict_SetItem(recommends, rec, Py_True);
-+            }
-+        }
-+
-+        /*
-            for upg in pkg.upgrades:
-                upg.packages.append(pkg)
-                upgrades[upg] = True
-diff --git a/smart/commands/query.py b/smart/commands/query.py
-index 9265cd9..b6f5697 100644
---- a/smart/commands/query.py
-+++ b/smart/commands/query.py
-@@ -750,6 +750,22 @@ class TextOutput(NullOutput):
-             name = str(prvpkg)
-         print "       ", "%s (%s)" % (name, prv)
- 
-+    def showRecommends(self, pkg, rec):
-+        if self._firstrecommends:
-+            self._firstrecommends = False
-+            print " ", _("Recommends:")
-+        print "   ", rec
-+
-+    def showRecommendsProvidedBy(self, pkg, req, prv, prvpkg):
-+        if self._firstrecommendsprovidedby:
-+            self._firstrecommendsprovidedby = False
-+            print "     ", _("Provided By:")
-+        if self.opts.hide_version:
-+            name = prvpkg.name
-+        else:
-+            name = str(prvpkg)
-+        print "       ", "%s (%s)" % (name, prv)
-+
-     def showUpgrades(self, pkg, upg):
-         if self._firstupgrades:
-             self._firstupgrades = False
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-rpm-transaction-failure-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-rpm-transaction-failure-check.patch
deleted file mode 100644
index bb8c3af..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-rpm-transaction-failure-check.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 0c55d7e18f40465e95e8e4bf22af01f5d4477d3c Mon Sep 17 00:00:00 2001
-From: Daniel Klauer <daniel.klauer@gin.de>
-Date: Wed, 11 May 2016 17:22:49 +0200
-Subject: [PATCH] rpm: Don't ignore transaction error with empty problems list
-
-SmartPM could misinterpret RPM transaction error as success,
-if ts.run() (RPM Python API) returns an empty problems list,
-because of incorrect check for None which treated empty list
-to be the same as None when it has different meaning.
-
-ts.run() returns:
-* None in case of success
-* problems list in case of error, may be empty
-(look at rpmts_Run() in rpm-5.4.14/python/rpmts-py.c [1])
-
-"if mylist" is not good enough to check for error here, because it will
-treat an empty list as "false" because its len() == 0 [2].
-
-ts.check() seems to be different (it's ok for it to return an empty list),
-but for consistency it should be made clear that it can return either None,
-an empty list or a non-empty list.
-
-[1] http://rpm5.org/cvs/fileview?f=rpm/python/rpmts-py.c&v=1.111.2.3
-[2] https://docs.python.org/2/library/stdtypes.html#truth-value-testing
-
-Upstream-Status: Pending
-
-Signed-off-by: Daniel Klauer <daniel.klauer@gin.de>
----
- smart/backends/rpm/pm.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py
-index 9bbd952..635f726 100644
---- a/smart/backends/rpm/pm.py
-+++ b/smart/backends/rpm/pm.py
-@@ -208,7 +208,7 @@ class RPMPackageManager(PackageManager):
-         force = sysconf.get("rpm-force", False)
-         if not force:
-             probs = ts.check()
--            if probs:
-+            if (probs is not None) and (len(probs) != 0):
-                 problines = []
-                 for prob in probs:
-                     name1 = "%s-%s-%s" % prob[0]
-@@ -247,7 +247,7 @@ class RPMPackageManager(PackageManager):
-             del getTS.ts
-             cb.grabOutput(False)
-             prog.setDone()
--            if probs:
-+            if probs is not None:
-                 raise Error, "\n".join([x[0] for x in probs])
-             prog.stop()
-
---
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch
deleted file mode 100644
index 2885998..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Set NOPROGRESS for pycurl just as same as default operation in pycurl module itself.
-If set NOPROGRESS with 0 for pycurl, it causes dead lock issue of Python GIL when
-call smart library by python gui just like pygtk.
-
-Upstream-Status: Pending
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-diff -u smart-1.4.1/smart.orig/fetcher.py smart-1.4.1/smart/fetcher.py
---- smart-1.4.1/smart.orig/fetcher.py	2014-07-15 16:42:19.240437080 +0800
-+++ smart-1.4.1/smart/fetcher.py	2014-07-15 17:02:37.812470289 +0800
-@@ -1720,7 +1720,7 @@
-                         handle.setopt(pycurl.OPT_FILETIME, 1)
-                         handle.setopt(pycurl.LOW_SPEED_LIMIT, 1)
-                         handle.setopt(pycurl.LOW_SPEED_TIME, SOCKETTIMEOUT)
--                        handle.setopt(pycurl.NOPROGRESS, 0)
-+                        handle.setopt(pycurl.NOPROGRESS, 1)
-                         handle.setopt(pycurl.PROGRESSFUNCTION, progress)
-                         handle.setopt(pycurl.WRITEDATA, local)
-                         handle.setopt(pycurl.FOLLOWLOCATION, 1)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-support-check-signatures.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-support-check-signatures.patch
deleted file mode 100644
index 4067a90..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-support-check-signatures.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From 5b79e28bd70a0ec5b34c5ff19b66cbbdd1e48835 Mon Sep 17 00:00:00 2001
-From: Haiqing Bai <Haiqing.Bai@windriver.com>
-Date: Fri, 18 Mar 2016 13:34:07 +0800
-Subject: [PATCH] Make smartpm to support check signatures of rpmv5.
-
-The original support for 'rpm-check-signatures' has been
-disabled for the RPMv5 does not support '_RPMVSF_NOSIGNATURES'
-now. This fix replaces the '_RPMVSF_NOSIGNATURES' with
-rpm VS flags set:RPMVSF_NODSAHEADER|RPMVSF_NORSAHEADER|
-RPMVSF_NODSA|RPMVSF_NORSA.
-
-Upstream-Status: Pending
-Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
----
- smart/backends/rpm/base.py      | 43 +++++++++++++++++++++++++++++++----------
- smart/backends/rpm/pm.py        |  2 +-
- smart/plugins/yumchannelsync.py |  5 +++--
- 3 files changed, 37 insertions(+), 13 deletions(-)
-
-diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
-index 85f4d49..dbd6165 100644
---- a/smart/backends/rpm/base.py
-+++ b/smart/backends/rpm/base.py
-@@ -63,11 +63,23 @@ def getTS(new=False):
-         if sysconf.get("rpm-dbpath"):
-             rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
-         getTS.ts = rpm.ts(getTS.root)
--        if not sysconf.get("rpm-check-signatures", False):
--            if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
--                getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
--            else:
--                raise Error, _("rpm requires checking signatures")
-+
-+        # _RPMVSF_NOSIGNATURES is not supported in RPMv5, so here uses
-+        # RPMVSF_NODSAHEADER|RPMVSF_NORSAHEADER|RPMVSF_NODSA|RPMVSF_NORSA
-+        # to replace '_RPMVSF_NOSIGNATURES' to continue to support check
-+        # rpm signatures
-+
-+        #if not sysconf.get("rpm-check-signatures", False):
-+        #    if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
-+        #        getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
-+        #    else:
-+        #        raise Error, _("rpm requires checking signatures")
-+        if sysconf.get("rpm-check-signatures") == False:
-+            getTS.ts.setVSFlags(rpm.RPMVSF_NODSAHEADER|rpm.RPMVSF_NORSAHEADER|\
-+                                rpm.RPMVSF_NODSA|rpm.RPMVSF_NORSA)
-+        else:
-+            getTS.ts.setVSFlags(0)
-+
-         rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm")
-         dbdir = rpm_join_dbpath(getTS.root, rpm_dbpath)
-         if not os.path.isdir(dbdir):
-@@ -89,11 +101,22 @@ def getTS(new=False):
-         if sysconf.get("rpm-dbpath"):
-             rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
-         ts = rpm.ts(getTS.root)
--        if not sysconf.get("rpm-check-signatures", False):
--            if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
--                ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
--            else:
--                raise Error, _("rpm requires checking signatures")
-+
-+        # _RPMVSF_NOSIGNATURES is not supported in RPMv5, so here uses
-+        # RPMVSF_NODSAHEADER|RPMVSF_NORSAHEADER|RPMVSF_NODSA|RPMVSF_NORSA
-+        # to replace '_RPMVSF_NOSIGNATURES' to continue to support check
-+        # rpm signatures
-+
-+        #if not sysconf.get("rpm-check-signatures", False):
-+        #    if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
-+        #        ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
-+        #    else:
-+        #        raise Error, _("rpm requires checking signatures")
-+        if sysconf.get("rpm-check-signatures") == False:
-+            ts.setVSFlags(rpm.RPMVSF_NODSAHEADER|rpm.RPMVSF_NORSAHEADER|\
-+                                rpm.RPMVSF_NODSA|rpm.RPMVSF_NORSA)
-+        else:
-+            ts.setVSFlags(0)
-         return ts
-     else:
-         return getTS.ts
-diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py
-index b57a844..7b651b5 100644
---- a/smart/backends/rpm/pm.py
-+++ b/smart/backends/rpm/pm.py
-@@ -180,7 +180,7 @@ class RPMPackageManager(PackageManager):
-                 fd = os.open(path, os.O_RDONLY)
-                 try:
-                     h = ts.hdrFromFdno(fd)
--                    if sysconf.get("rpm-check-signatures", False):
-+                    if sysconf.get("rpm-check-signatures", True):
-                          if get_public_key(h) == '(none)':
-                              raise rpm.error('package is not signed')
-                 except rpm.error, e:
-diff --git a/smart/plugins/yumchannelsync.py b/smart/plugins/yumchannelsync.py
-index f8107e6..2dc5482 100644
---- a/smart/plugins/yumchannelsync.py
-+++ b/smart/plugins/yumchannelsync.py
-@@ -56,8 +56,9 @@ def _getreleasever():
- 
-     rpmroot = sysconf.get("rpm-root", "/")
-     ts = rpmUtils.transaction.initReadOnlyTransaction(root=rpmroot)
--    if hasattr(rpm, '_RPMVSF_NOSIGNATURES') and hasattr(rpm, '_RPMVSF_NODIGESTS'):
--        ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
-+    #_RPMVSF_NOSIGNATURES is not supported in RPMv5
-+    #if hasattr(rpm, '_RPMVSF_NOSIGNATURES') and hasattr(rpm, '_RPMVSF_NODIGESTS'):
-+    #    ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
-     releasever = None
-     # HACK: we're hard-coding the most used distros, will add more if needed
-     idx = ts.dbMatch('provides', 'fedora-release')
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm_git.bb
deleted file mode 100644
index 861910c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm_git.bb
+++ /dev/null
@@ -1,141 +0,0 @@
-SUMMARY = "The Smart Package Manager"
-DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \
-smart and portable algorithms for solving adequately the problem of managing software \
-upgrades and installation."
-
-HOMEPAGE = "http://labix.org/smart/"
-SECTION = "devel/python"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"
-
-DEPENDS = "python rpm gettext-native python-rpm"
-SRCNAME = "smart"
-
-SRC_URI = "\
-          git://github.com/smartpm/smart.git \
-          file://smart-recommends.patch \
-          file://smart-channelsdir.patch \
-          file://smart-rpm-transaction-failure-check.patch \
-          file://smart-attempt.patch \
-          file://smart-attempt-fix.patch \
-          file://smart-add-for-rpm-ignoresize-check.patch \
-          file://smart-already-installed-message.patch \
-          file://smart-set-noprogress-for-pycurl.patch \
-          file://smart-cache.py-getPackages-matches-name-version.patch \
-          file://smart-channel-remove-all.patch \
-          file://smart-locale.patch \
-          file://smartpm-rpm5-support-check-signatures.patch \
-          file://smart-add-deugging-when-targetpath-is-empty.patch \
-          file://channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch \
-         "
-
-SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0"
-PV = "1.5+git${SRCPV}"
-
-S = "${WORKDIR}/git"
-
-# Options - rpm, qt4, gtk
-PACKAGECONFIG ??= "rpm"
-
-RPM_RDEP = "${PN}-backend-rpm"
-QT_RDEP = "${PN}-interface-qt4"
-GTK_RDEP = "${PN}-interface-gtk"
-
-RPM_RDEP_class-native = ""
-QT_RDEP_class-native = ""
-GTK_RDEP_class-native = ""
-
-RPM_RDEP_class-nativesdk = ""
-QT_RDEP_class-nativesdk = ""
-GTK_RDEP_class-nativesdk = ""
-
-PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}"
-PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}"
-PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}"
-
-inherit distutils
-
-do_install_append() {
-   # We don't support the following items
-   rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/slack
-   rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/arch
-   rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt
-
-   # Temporary, debian support in OE is missing the python module
-   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/aptchannelsync.py*
-   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/debdir.py*
-   rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/deb
-
-   # Disable automatic channel detection
-   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/detectsys.py*
-
-   # Disable landscape support
-   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/landscape.py*
-
-   # Disable urpmi channel support
-   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/urpmichannelsync.py*
-
-   # Disable yum channel support
-   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/yumchannelsync.py*
-
-   # Disable zypper channel support
-   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/zyppchannelsync.py*
-
-   if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
-      rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/rpmdir.py*
-      rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/rpm
-   fi
-
-   if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
-      rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt4
-   fi
-
-   if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
-      rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/gtk
-   fi
-}
-
-add_native_wrapper() {
-        create_wrapper ${D}/${bindir}/smart \
-		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
-		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
-		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
-}
-
-do_install_append_class-native() {
-        sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/smart
-        add_native_wrapper
-}
-
-do_install_append_class-nativesdk() {
-        add_native_wrapper
-}
-
-PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
-            ${@bb.utils.contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \
-            ${@bb.utils.contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \
-            ${@bb.utils.contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \
-            ${PN}-interface-images ${PN}"
-
-RDEPENDS_smartpm = "${PN}"
-
-RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \
-                   python-pickle python-crypt python-compression python-shell \
-                   python-resource python-netclient python-threading python-unixadmin python-pprint"
-RDEPENDS_${PN}_class-native = ""
-
-RDEPENDS_${PN}-backend-rpm = "python-rpm"
-
-RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images"
-RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images"
-
-FILES_smartpm = "${bindir}/smart"
-
-FILES_${PN}-backend-rpm = "${PYTHON_SITEPACKAGES_DIR}/smart/backends/rpm"
-
-FILES_${PN}-interface-qt4 = "${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt4"
-FILES_${PN}-interface-gtk = "${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/gtk"
-FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images"
-
-BBCLASSEXTEND = "native nativesdk"
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python.inc
index 79a431c..b40f551 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python.inc
@@ -9,16 +9,18 @@
 
 SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz"
 
-SRC_URI[md5sum] = "57dffcee9cee8bb2ab5f82af1d8e9a69"
-SRC_URI[sha256sum] = "d7837121dd5652a05fef807c361909d255d173280c4e1a4ded94d73d80a1f978"
+SRC_URI[md5sum] = "53b43534153bb2a0363f08bae8b9d990"
+SRC_URI[sha256sum] = "35d543986882f78261f97787fd3e06274bfa6df29fac9b4a94f73930ff98f731"
 
 # python recipe is actually python 2.x
 # also, exclude pre-releases for both python 2.x and 3.x
 UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>2(\.\d+)+).tar"
 
+CVE_PRODUCT = "python"
+
 PYTHON_MAJMIN = "2.7"
 
-inherit autotools
+inherit autotools pkgconfig
 
 EXTRA_OECONF = "\
   --with-threads \
@@ -30,3 +32,9 @@
   ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no \
   ${PYTHONLSBOPTS} \
 "
+
+do_install_append () {
+	sed -i -e 's:${HOSTTOOLS_DIR}/install:install:g' \
+		-e 's:${HOSTTOOLS_DIR}/mkdir:mkdir:g' \
+		${D}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
index b2a8c3b..366ce3e 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
@@ -9,11 +9,11 @@
 Rebased for python-2.7.9
 Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
 
-Index: Python-2.7.12/Makefile.pre.in
+Index: Python-2.7.13/Makefile.pre.in
 ===================================================================
---- Python-2.7.12.orig/Makefile.pre.in
-+++ Python-2.7.12/Makefile.pre.in
-@@ -246,6 +246,7 @@ LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
+--- Python-2.7.13.orig/Makefile.pre.in
++++ Python-2.7.13/Makefile.pre.in
+@@ -245,6 +245,7 @@ LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
  ##########################################################################
  # Parser
  PGEN=		Parser/pgen$(EXE)
@@ -21,7 +21,7 @@
  
  PSRCS=		\
  		Parser/acceler.c \
-@@ -513,7 +514,7 @@ $(BUILDPYTHON):	Modules/python.o $(LIBRA
+@@ -512,7 +513,7 @@ $(BUILDPYTHON):	Modules/python.o $(LIBRA
  			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
  
  platform: $(BUILDPYTHON) pybuilddir.txt
@@ -30,16 +30,16 @@
  
  # Create build directory and generate the sysconfig build-time data there.
  # pybuilddir.txt contains the name of the build dir and is used for
-@@ -684,7 +685,7 @@ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
+@@ -681,7 +682,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/p
+ 
+ $(GRAMMAR_H): @GENERATED_COMMENT@ $(GRAMMAR_INPUT) $(PGEN)
  	@$(MKDIR_P) Include
- 	# Avoid copying the file onto itself for an in-tree build
- 	if test "$(cross_compiling)" != "yes"; then \
--		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C); \
-+		$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C); \
- 	else \
- 		cp $(srcdir)/Include/graminit.h $(GRAMMAR_H).tmp; \
- 		mv $(GRAMMAR_H).tmp $(GRAMMAR_H); \
-@@ -1133,27 +1134,27 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
+-	$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++	$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): @GENERATED_COMMENT@ $(GRAMMAR_H)
+ 	touch $(GRAMMAR_C)
+ 
+@@ -1121,27 +1122,27 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
  			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
  	fi
  	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
@@ -73,10 +73,10 @@
  
  # Create the PLATDIR source directory, if one wasn't distributed..
  $(srcdir)/Lib/$(PLATDIR):
-Index: Python-2.7.12/setup.py
+Index: Python-2.7.13/setup.py
 ===================================================================
---- Python-2.7.12.orig/setup.py
-+++ Python-2.7.12/setup.py
+--- Python-2.7.13.orig/setup.py
++++ Python-2.7.13/setup.py
 @@ -350,6 +350,7 @@ class PyBuildExt(build_ext):
              self.failed.append(ext.name)
              self.announce('*** WARNING: renaming "%s" since importing it'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/CVE-2016-5636.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/CVE-2016-5636.patch
deleted file mode 100644
index 9a37471..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python/CVE-2016-5636.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-
-# HG changeset patch
-# User Benjamin Peterson <benjamin@python.org>
-# Date 1453357424 28800
-# Node ID 985fc64c60d6adffd1138b6cc46df388ca91ca5d
-# Parent  7ec954b9fc54448a35b56d271340ba109eb381b9
-prevent buffer overflow in get_data (closes #26171)
-
-Upstream-Status: Backport
-https://hg.python.org/cpython/rev/985fc64c60d6
-
-CVE: CVE-2016-5636
-Signed-off-by: Armin Kuster <akuster@mvista.com>
-
-Index: Python-2.7.11/Misc/NEWS
-===================================================================
---- Python-2.7.11.orig/Misc/NEWS
-+++ Python-2.7.11/Misc/NEWS
-@@ -7,6 +7,9 @@ What's New in Python 2.7.11?
- 
- *Release date: 2015-12-05*
- 
-+- Issue #26171: Fix possible integer overflow and heap corruption in
-+  zipimporter.get_data().
-+
- Library
- -------
- 
-Index: Python-2.7.11/Modules/zipimport.c
-===================================================================
---- Python-2.7.11.orig/Modules/zipimport.c
-+++ Python-2.7.11/Modules/zipimport.c
-@@ -895,6 +895,11 @@ get_data(char *archive, PyObject *toc_en
-         PyMarshal_ReadShortFromFile(fp);        /* local header size */
-     file_offset += l;           /* Start of file data */
- 
-+    if (data_size > LONG_MAX - 1) {
-+        fclose(fp);
-+        PyErr_NoMemory();
-+        return NULL;
-+    }
-     raw_data = PyString_FromStringAndSize((char *)NULL, compress == 0 ?
-                                           data_size : data_size + 1);
-     if (raw_data == NULL) {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/Don-t-use-getentropy-on-Linux.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/Don-t-use-getentropy-on-Linux.patch
new file mode 100644
index 0000000..38e5377
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/Don-t-use-getentropy-on-Linux.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Backport
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+From 905d1b30ac7cb0e31c57cec0533825c8f170b942 Mon Sep 17 00:00:00 2001
+From: Victor Stinner <victor.stinner@gmail.com>
+Date: Mon, 9 Jan 2017 11:10:41 +0100
+Subject: [PATCH] Don't use getentropy() on Linux
+
+Issue #29188: Support glibc 2.24 on Linux: don't use getentropy() function but
+read from /dev/urandom to get random bytes, for example in os.urandom().  On
+Linux, getentropy() is implemented which getrandom() is blocking mode, whereas
+os.urandom() should not block.
+
+(cherry picked from commit 2687486756721e39164fa9f597e468c35d495227)
+---
+ Python/random.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/Python/random.c b/Python/random.c
+index b4bc1f3..f3f5d14 100644
+--- a/Python/random.c
++++ b/Python/random.c
+@@ -94,8 +94,15 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
+ }
+ 
+ /* Issue #25003: Don't use getentropy() on Solaris (available since
+- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
+-#elif defined(HAVE_GETENTROPY) && !defined(sun)
++   Solaris 11.3), it is blocking whereas os.urandom() should not block.
++
++   Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
++   implements it with the getrandom() syscall which can fail with ENOSYS,
++   and this error is not supported in py_getentropy() and getrandom() is called
++   with flags=0 which blocks until system urandom is initialized, which is not
++   the desired behaviour to seed the Python hash secret nor for os.urandom():
++   see the PEP 524 which was only implemented in Python 3.6. */
++#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
+ #define PY_GETENTROPY 1
+ 
+ /* Fill buffer with size pseudo-random bytes generated by getentropy().
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch
deleted file mode 100644
index 8012245..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Upstream-Status: Pending
-
-Avoids parallel make races linking errors when making Parser/PGEN
-
-- Implements Richard Purdie's idea
-
-Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
-
-Index: Python-2.7.9/Makefile.pre.in
-===================================================================
---- Python-2.7.9.orig/Makefile.pre.in
-+++ Python-2.7.9/Makefile.pre.in
-@@ -611,12 +611,10 @@ Modules/grpmodule.o: $(srcdir)/Modules/g
- 
- Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
- 
--$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
-+$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN)
- 		@$(MKDIR_P) Include
--		$(MAKE) $(PGEN)
- 		$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
- $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
--		$(MAKE) $(GRAMMAR_H)
- 		touch $(GRAMMAR_C)
- 
- $(PGEN):	$(PGENOBJS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/multilib.patch
index b169133..50cc591 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python/multilib.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/multilib.patch
@@ -1,11 +1,11 @@
 Rebased for python-2.7.9
 Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
 
-Index: Python-2.7.12/configure.ac
+Index: Python-2.7.13/configure.ac
 ===================================================================
---- Python-2.7.12.orig/configure.ac
-+++ Python-2.7.12/configure.ac
-@@ -756,6 +756,10 @@ SunOS*)
+--- Python-2.7.13.orig/configure.ac
++++ Python-2.7.13/configure.ac
+@@ -759,6 +759,10 @@ SunOS*)
      ;;
  esac
  
@@ -16,10 +16,10 @@
  
  AC_SUBST(LIBRARY)
  AC_MSG_CHECKING(LIBRARY)
-Index: Python-2.7.12/Include/pythonrun.h
+Index: Python-2.7.13/Include/pythonrun.h
 ===================================================================
---- Python-2.7.12.orig/Include/pythonrun.h
-+++ Python-2.7.12/Include/pythonrun.h
+--- Python-2.7.13.orig/Include/pythonrun.h
++++ Python-2.7.13/Include/pythonrun.h
 @@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
  /* In their own files */
  PyAPI_FUNC(const char *) Py_GetVersion(void);
@@ -28,10 +28,10 @@
  PyAPI_FUNC(const char *) Py_GetCopyright(void);
  PyAPI_FUNC(const char *) Py_GetCompiler(void);
  PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
-Index: Python-2.7.12/Lib/distutils/command/install.py
+Index: Python-2.7.13/Lib/distutils/command/install.py
 ===================================================================
---- Python-2.7.12.orig/Lib/distutils/command/install.py
-+++ Python-2.7.12/Lib/distutils/command/install.py
+--- Python-2.7.13.orig/Lib/distutils/command/install.py
++++ Python-2.7.13/Lib/distutils/command/install.py
 @@ -22,6 +22,8 @@ from site import USER_BASE
  from site import USER_SITE
  
@@ -50,10 +50,10 @@
          'headers': '$base/include/python$py_version_short/$dist_name',
          'scripts': '$base/bin',
          'data'   : '$base',
-Index: Python-2.7.12/Lib/distutils/sysconfig.py
+Index: Python-2.7.13/Lib/distutils/sysconfig.py
 ===================================================================
---- Python-2.7.12.orig/Lib/distutils/sysconfig.py
-+++ Python-2.7.12/Lib/distutils/sysconfig.py
+--- Python-2.7.13.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.13/Lib/distutils/sysconfig.py
 @@ -119,8 +119,11 @@ def get_python_lib(plat_specific=0, stan
          prefix = plat_specific and EXEC_PREFIX or PREFIX
  
@@ -68,23 +68,23 @@
          if standard_lib:
              return libpython
          else:
-Index: Python-2.7.12/Lib/pydoc.py
+Index: Python-2.7.13/Lib/pydoc.py
 ===================================================================
---- Python-2.7.12.orig/Lib/pydoc.py
-+++ Python-2.7.12/Lib/pydoc.py
-@@ -384,7 +384,7 @@ class Doc:
+--- Python-2.7.13.orig/Lib/pydoc.py
++++ Python-2.7.13/Lib/pydoc.py
+@@ -375,7 +375,7 @@ class Doc:
+     docmodule = docclass = docroutine = docother = docproperty = docdata = fail
  
-         docloc = os.environ.get("PYTHONDOCS",
-                                 "http://docs.python.org/library")
--        basedir = os.path.join(sys.exec_prefix, "lib",
-+        basedir = os.path.join(sys.exec_prefix, sys.lib,
-                                "python"+sys.version[0:3])
-         if (isinstance(object, type(os)) and
-             (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
-Index: Python-2.7.12/Lib/site.py
+     def getdocloc(self, object,
+-                  basedir=os.path.join(sys.exec_prefix, "lib",
++                  basedir=os.path.join(sys.exec_prefix, "sys.lib",
+                                        "python"+sys.version[0:3])):
+         """Return the location of module docs or None"""
+ 
+Index: Python-2.7.13/Lib/site.py
 ===================================================================
---- Python-2.7.12.orig/Lib/site.py
-+++ Python-2.7.12/Lib/site.py
+--- Python-2.7.13.orig/Lib/site.py
++++ Python-2.7.13/Lib/site.py
 @@ -288,13 +288,18 @@ def getsitepackages():
          if sys.platform in ('os2emx', 'riscos'):
              sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
@@ -104,13 +104,13 @@
              sitepackages.append(prefix)
 -            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
 +            sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
-         if sys.platform == "darwin":
-             # for framework builds *only* we add the standard Apple
-             # locations.
-Index: Python-2.7.12/Lib/sysconfig.py
+     return sitepackages
+ 
+ def addsitepackages(known_paths):
+Index: Python-2.7.13/Lib/sysconfig.py
 ===================================================================
---- Python-2.7.12.orig/Lib/sysconfig.py
-+++ Python-2.7.12/Lib/sysconfig.py
+--- Python-2.7.13.orig/Lib/sysconfig.py
++++ Python-2.7.13/Lib/sysconfig.py
 @@ -7,10 +7,10 @@ from os.path import pardir, realpath
  
  _INSTALL_SCHEMES = {
@@ -139,10 +139,10 @@
          'include': '{userbase}/include/python{py_version_short}',
          'scripts': '{userbase}/bin',
          'data'   : '{userbase}',
-Index: Python-2.7.12/Lib/test/test_dl.py
+Index: Python-2.7.13/Lib/test/test_dl.py
 ===================================================================
---- Python-2.7.12.orig/Lib/test/test_dl.py
-+++ Python-2.7.12/Lib/test/test_dl.py
+--- Python-2.7.13.orig/Lib/test/test_dl.py
++++ Python-2.7.13/Lib/test/test_dl.py
 @@ -4,10 +4,11 @@
  import unittest
  from test.test_support import verbose, import_module
@@ -157,14 +157,14 @@
      ('/usr/bin/cygwin1.dll', 'getpid'),
      ('/usr/lib/libc.dylib', 'getpid'),
      ]
-Index: Python-2.7.12/Lib/test/test_site.py
+Index: Python-2.7.13/Lib/test/test_site.py
 ===================================================================
---- Python-2.7.12.orig/Lib/test/test_site.py
-+++ Python-2.7.12/Lib/test/test_site.py
-@@ -246,12 +246,16 @@ class HelperFunctionsTests(unittest.Test
-             self.assertEqual(dirs[2], wanted)
+--- Python-2.7.13.orig/Lib/test/test_site.py
++++ Python-2.7.13/Lib/test/test_site.py
+@@ -235,12 +235,16 @@ class HelperFunctionsTests(unittest.Test
+             self.assertEqual(dirs[0], wanted)
          elif os.sep == '/':
-             # OS X non-framwework builds, Linux, FreeBSD, etc
+             # OS X, Linux, FreeBSD, etc
 -            self.assertEqual(len(dirs), 2)
              wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
                                    'site-packages')
@@ -181,10 +181,10 @@
          else:
              # other platforms
              self.assertEqual(len(dirs), 2)
-Index: Python-2.7.12/Lib/trace.py
+Index: Python-2.7.13/Lib/trace.py
 ===================================================================
---- Python-2.7.12.orig/Lib/trace.py
-+++ Python-2.7.12/Lib/trace.py
+--- Python-2.7.13.orig/Lib/trace.py
++++ Python-2.7.13/Lib/trace.py
 @@ -754,10 +754,10 @@ def main(argv=None):
                  # should I also call expanduser? (after all, could use $HOME)
  
@@ -198,10 +198,10 @@
                                             "python" + sys.version[:3]))
                  s = os.path.normpath(s)
                  ignore_dirs.append(s)
-Index: Python-2.7.12/Makefile.pre.in
+Index: Python-2.7.13/Makefile.pre.in
 ===================================================================
---- Python-2.7.12.orig/Makefile.pre.in
-+++ Python-2.7.12/Makefile.pre.in
+--- Python-2.7.13.orig/Makefile.pre.in
++++ Python-2.7.13/Makefile.pre.in
 @@ -92,6 +92,7 @@ PY_CFLAGS=	$(CFLAGS) $(CPPFLAGS) $(CFLAG
  
  # Machine-dependent subdirectories
@@ -219,7 +219,7 @@
  
  # Detailed destination directories
  BINLIBDEST=	$(LIBDIR)/python$(VERSION)
-@@ -670,6 +671,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+@@ -669,6 +670,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
  		-DEXEC_PREFIX='"$(exec_prefix)"' \
  		-DVERSION='"$(VERSION)"' \
  		-DVPATH='"$(VPATH)"' \
@@ -227,7 +227,7 @@
  		-o $@ $(srcdir)/Modules/getpath.c
  
  Modules/python.o: $(srcdir)/Modules/python.c
-@@ -721,7 +723,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
+@@ -709,7 +711,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
  Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
  
  Python/getplatform.o: $(srcdir)/Python/getplatform.c
@@ -236,10 +236,10 @@
  
  Python/importdl.o: $(srcdir)/Python/importdl.c
  		$(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
-Index: Python-2.7.12/Modules/getpath.c
+Index: Python-2.7.13/Modules/getpath.c
 ===================================================================
---- Python-2.7.12.orig/Modules/getpath.c
-+++ Python-2.7.12/Modules/getpath.c
+--- Python-2.7.13.orig/Modules/getpath.c
++++ Python-2.7.13/Modules/getpath.c
 @@ -100,6 +100,13 @@
  #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
  #endif
@@ -263,10 +263,10 @@
  
  static void
  reduce(char *dir)
-Index: Python-2.7.12/Python/getplatform.c
+Index: Python-2.7.13/Python/getplatform.c
 ===================================================================
---- Python-2.7.12.orig/Python/getplatform.c
-+++ Python-2.7.12/Python/getplatform.c
+--- Python-2.7.13.orig/Python/getplatform.c
++++ Python-2.7.13/Python/getplatform.c
 @@ -10,3 +10,13 @@ Py_GetPlatform(void)
  {
  	return PLATFORM;
@@ -281,10 +281,10 @@
 +{
 +	return LIB;
 +}
-Index: Python-2.7.12/Python/sysmodule.c
+Index: Python-2.7.13/Python/sysmodule.c
 ===================================================================
---- Python-2.7.12.orig/Python/sysmodule.c
-+++ Python-2.7.12/Python/sysmodule.c
+--- Python-2.7.13.orig/Python/sysmodule.c
++++ Python-2.7.13/Python/sysmodule.c
 @@ -1437,6 +1437,8 @@ _PySys_Init(void)
                          PyString_FromString(Py_GetCopyright()));
      SET_SYS_FROM_STRING("platform",
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/python-fix-CVE-2016-1000110.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/python-fix-CVE-2016-1000110.patch
deleted file mode 100644
index 97888e2..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python/python-fix-CVE-2016-1000110.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-From cb25fbd5abc0f4eb07dbb8ea819e9c26bda4fc99 Mon Sep 17 00:00:00 2001
-From: Senthil Kumaran <senthil@uthcode.com>
-Date: Sat, 30 Jul 2016 05:49:53 -0700
-Subject: [PATCH] python: fix CVE-2016-1000110
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Prevent HTTPoxy attack (CVE-2016-1000110)
-
-Ignore the HTTP_PROXY variable when REQUEST_METHOD environment is set, which
-indicates that the script is in CGI mode.
-
-Issue reported and patch contributed by Rémi Rampin.
-
-Backport patch from https://hg.python.org/cpython/rev/ba915d561667/
-
-Upstream-Status: Backport
-CVE: CVE-2016-1000110
-Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
----
- Doc/howto/urllib2.rst   |  5 +++++
- Doc/library/urllib.rst  | 10 ++++++++++
- Doc/library/urllib2.rst |  5 +++++
- Lib/test/test_urllib.py | 12 ++++++++++++
- Lib/urllib.py           |  9 +++++++++
- Misc/ACKS               |  1 +
- Misc/NEWS               |  4 ++++
- 7 files changed, 46 insertions(+)
-
-diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst
-index 6bb06d4..5cf2c0c 100644
---- a/Doc/howto/urllib2.rst
-+++ b/Doc/howto/urllib2.rst
-@@ -525,6 +525,11 @@ setting up a `Basic Authentication`_ handler: ::
-     through a proxy.  However, this can be enabled by extending urllib2 as
-     shown in the recipe [#]_.
- 
-+.. note::
-+
-+    ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see
-+    the documentation on :func:`~urllib.getproxies`.
-+
- 
- Sockets and Layers
- ==================
-diff --git a/Doc/library/urllib.rst b/Doc/library/urllib.rst
-index 3b5dc16..bddcba9 100644
---- a/Doc/library/urllib.rst
-+++ b/Doc/library/urllib.rst
-@@ -295,6 +295,16 @@ Utility functions
-    If both lowercase and uppercase environment variables exist (and disagree),
-    lowercase is preferred.
- 
-+    .. note::
-+
-+        If the environment variable ``REQUEST_METHOD`` is set, which usually
-+        indicates your script is running in a CGI environment, the environment
-+        variable ``HTTP_PROXY`` (uppercase ``_PROXY``) will be ignored. This is
-+        because that variable can be injected by a client using the "Proxy:"
-+        HTTP header. If you need to use an HTTP proxy in a CGI environment,
-+        either use ``ProxyHandler`` explicitly, or make sure the variable name
-+        is in lowercase (or at least the ``_proxy`` suffix).
-+
- .. note::
-     urllib also exposes certain utility functions like splittype, splithost and
-     others parsing URL into various components. But it is recommended to use
-diff --git a/Doc/library/urllib2.rst b/Doc/library/urllib2.rst
-index 8a4c80e..b808b98 100644
---- a/Doc/library/urllib2.rst
-+++ b/Doc/library/urllib2.rst
-@@ -229,6 +229,11 @@ The following classes are provided:
- 
-    To disable autodetected proxy pass an empty dictionary.
- 
-+    .. note::
-+
-+       ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set;
-+       see the documentation on :func:`~urllib.getproxies`.
-+
- 
- .. class:: HTTPPasswordMgr()
- 
-diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
-index 434d533..27a1d38 100644
---- a/Lib/test/test_urllib.py
-+++ b/Lib/test/test_urllib.py
-@@ -170,6 +170,18 @@ class ProxyTests(unittest.TestCase):
-         self.assertTrue(urllib.proxy_bypass_environment('anotherdomain.com:8888'))
-         self.assertTrue(urllib.proxy_bypass_environment('newdomain.com:1234'))
- 
-+    def test_proxy_cgi_ignore(self):
-+        try:
-+            self.env.set('HTTP_PROXY', 'http://somewhere:3128')
-+            proxies = urllib.getproxies_environment()
-+            self.assertEqual('http://somewhere:3128', proxies['http'])
-+            self.env.set('REQUEST_METHOD', 'GET')
-+            proxies = urllib.getproxies_environment()
-+            self.assertNotIn('http', proxies)
-+        finally:
-+            self.env.unset('REQUEST_METHOD')
-+            self.env.unset('HTTP_PROXY')
-+
-     def test_proxy_bypass_environment_host_match(self):
-         bypass = urllib.proxy_bypass_environment
-         self.env.set('NO_PROXY',
-diff --git a/Lib/urllib.py b/Lib/urllib.py
-index 139fab9..c3ba2c9 100644
---- a/Lib/urllib.py
-+++ b/Lib/urllib.py
-@@ -1380,12 +1380,21 @@ def getproxies_environment():
-     If you need a different way, you can pass a proxies dictionary to the
-     [Fancy]URLopener constructor.
-     """
-+    # Get all variables
-     proxies = {}
-     for name, value in os.environ.items():
-         name = name.lower()
-         if value and name[-6:] == '_proxy':
-             proxies[name[:-6]] = value
- 
-+    # CVE-2016-1000110 - If we are running as CGI script, forget HTTP_PROXY
-+    # (non-all-lowercase) as it may be set from the web server by a "Proxy:"
-+    # header from the client
-+    # If "proxy" is lowercase, it will still be used thanks to the next block
-+    if 'REQUEST_METHOD' in os.environ:
-+        proxies.pop('http', None)
-+
-+    # Get lowercase variables
-     for name, value in os.environ.items():
-         if name[-6:] == '_proxy':
-             name = name.lower()
-diff --git a/Misc/ACKS b/Misc/ACKS
-index ee3a465..9c374b7 100644
---- a/Misc/ACKS
-+++ b/Misc/ACKS
-@@ -1121,6 +1121,7 @@ Burton Radons
- Jeff Ramnani
- Varpu Rantala
- Brodie Rao
-+Rémi Rampin
- Senko Rasic
- Antti Rasinen
- Nikolaus Rath
-diff --git a/Misc/NEWS b/Misc/NEWS
-index 4ab3a70..cc2f65b 100644
---- a/Misc/NEWS
-+++ b/Misc/NEWS
-@@ -187,6 +187,10 @@ Library
- - Issue #26644: Raise ValueError rather than SystemError when a negative
-   length is passed to SSLSocket.recv() or read().
- 
-+- Issue #27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the
-+  HTTP_PROXY variable when REQUEST_METHOD environment is set, which indicates
-+  that the script is in CGI mode.
-+
- - Issue #23804: Fix SSL recv(0) and read(0) methods to return zero bytes
-   instead of up to 1024.
- 
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-docutils_0.12.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-docutils_0.12.bb
deleted file mode 100644
index e78fa3b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-docutils_0.12.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "Text processing system for documentation"
-HOMEPAGE = "http://docutils.sourceforge.net"
-SECTION = "devel/python"
-LICENSE = "PSF & BSD-2-Clause & GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING.txt;md5=a722fbdc20347db7b69223594dd54574"
-
-DEPENDS = "python3"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz"
-SRC_URI[md5sum] = "4622263b62c5c771c03502afa3157768"
-SRC_URI[sha256sum] = "c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa"
-
-S = "${WORKDIR}/docutils-${PV}"
-
-inherit distutils3
-
-BBCLASSEXTEND = "native"
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-docutils_0.13.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-docutils_0.13.1.bb
new file mode 100644
index 0000000..e36388c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-docutils_0.13.1.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Text processing system for documentation"
+HOMEPAGE = "http://docutils.sourceforge.net"
+SECTION = "devel/python"
+LICENSE = "PSF & BSD-2-Clause & GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7a4646907ab9083c826280b19e103106"
+
+DEPENDS = "python3"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz"
+SRC_URI[md5sum] = "ea4a893c633c788be9b8078b6b305d53"
+SRC_URI[sha256sum] = "718c0f5fb677be0f34b781e04241c4067cbd9327b66bdd8e763201130f5175be"
+
+S = "${WORKDIR}/docutils-${PV}"
+
+inherit distutils3
+
+BBCLASSEXTEND = "native"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-git_2.0.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-git_2.0.7.bb
deleted file mode 100644
index c9fe9ba..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-git_2.0.7.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require python-git.inc
-
-DEPENDS = "python3-gitdb"
-
-inherit setuptools3
-
-RDEPENDS_${PN} += "python3-gitdb python3-lang python3-io python3-shell python3-math python3-re python3-subprocess python3-stringold python3-unixadmin python3-enum python3-logging python3-datetime python3-netclient"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-git_2.1.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-git_2.1.1.bb
new file mode 100644
index 0000000..7a2d452
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-git_2.1.1.bb
@@ -0,0 +1,7 @@
+require python-git.inc
+
+DEPENDS = "python3-gitdb"
+
+inherit setuptools3
+
+RDEPENDS_${PN} += "python3-gitdb python3-lang python3-io python3-shell python3-math python3-re python3-subprocess python3-stringold python3-unixadmin python3-enum python3-logging python3-datetime python3-netclient python3-unittest python3-argparse"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch
new file mode 100644
index 0000000..44090a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch
@@ -0,0 +1,552 @@
+From 8a98e4d44a5e59439a4b6bd95368cc362412c995 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 24 Mar 2017 18:06:08 +0200
+Subject: [PATCH] Add python 3 compatibility.
+
+Taken from
+http://pkgs.fedoraproject.org/cgit/rpms/python-iniparse.git/tree/python-iniparse-python3-compat.patch
+
+Upstream-Status: Inappropriate [upstream is defunct]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ iniparse/__init__.py     | 20 ++++++++++----------
+ iniparse/compat.py       | 30 ++++++++++++++++--------------
+ iniparse/config.py       | 16 ++++++++--------
+ iniparse/configparser.py |  7 +++++++
+ iniparse/ini.py          | 20 ++++++++++++--------
+ iniparse/utils.py        |  4 ++--
+ tests/__init__.py        | 14 +++++++-------
+ tests/test_compat.py     | 23 +++++++++++++++--------
+ tests/test_fuzz.py       | 18 +++++++++---------
+ tests/test_ini.py        |  8 ++++----
+ tests/test_misc.py       |  4 ++--
+ tests/test_tidy.py       |  2 +-
+ tests/test_unicode.py    | 10 +++++-----
+ 13 files changed, 98 insertions(+), 78 deletions(-)
+ create mode 100644 iniparse/configparser.py
+
+diff --git a/iniparse/__init__.py b/iniparse/__init__.py
+index 8de756f..7193f92 100644
+--- a/iniparse/__init__.py
++++ b/iniparse/__init__.py
+@@ -3,17 +3,17 @@
+ # Copyright (c) 2007 Tim Lauridsen <tla@rasmil.dk>
+ # All Rights Reserved.  See LICENSE-PSF & LICENSE for details.
+ 
+-from ini import INIConfig, change_comment_syntax
+-from config import BasicConfig, ConfigNamespace
+-from compat import RawConfigParser, ConfigParser, SafeConfigParser
+-from utils import tidy
++from .ini import INIConfig, change_comment_syntax
++from .config import BasicConfig, ConfigNamespace
++from .compat import RawConfigParser, ConfigParser, SafeConfigParser
++from .utils import tidy
+ 
+-from ConfigParser import DuplicateSectionError,    \
+-                  NoSectionError, NoOptionError,   \
+-                  InterpolationMissingOptionError, \
+-                  InterpolationDepthError,         \
+-                  InterpolationSyntaxError,        \
+-                  DEFAULTSECT, MAX_INTERPOLATION_DEPTH
++from .configparser import DuplicateSectionError,    \
++                   NoSectionError, NoOptionError,   \
++                   InterpolationMissingOptionError, \
++                   InterpolationDepthError,         \
++                   InterpolationSyntaxError,        \
++                   DEFAULTSECT, MAX_INTERPOLATION_DEPTH
+ 
+ __all__ = [
+     'BasicConfig', 'ConfigNamespace',
+diff --git a/iniparse/compat.py b/iniparse/compat.py
+index db89ed8..f95c25c 100644
+--- a/iniparse/compat.py
++++ b/iniparse/compat.py
+@@ -12,19 +12,21 @@ The underlying INIConfig object can be accessed as cfg.data
+ """
+ 
+ import re
+-from ConfigParser import DuplicateSectionError,    \
+-                  NoSectionError, NoOptionError,   \
+-                  InterpolationMissingOptionError, \
+-                  InterpolationDepthError,         \
+-                  InterpolationSyntaxError,        \
+-                  DEFAULTSECT, MAX_INTERPOLATION_DEPTH
++from .configparser import DuplicateSectionError,    \
++                   NoSectionError, NoOptionError,   \
++                   InterpolationMissingOptionError, \
++                   InterpolationDepthError,         \
++                   InterpolationSyntaxError,        \
++                   DEFAULTSECT, MAX_INTERPOLATION_DEPTH
+ 
+ # These are imported only for compatiability.
+ # The code below does not reference them directly.
+-from ConfigParser import Error, InterpolationError, \
+-                  MissingSectionHeaderError, ParsingError
++from .configparser import Error, InterpolationError, \
++                   MissingSectionHeaderError, ParsingError
+ 
+-import ini
++import six
++
++from . import ini
+ 
+ class RawConfigParser(object):
+     def __init__(self, defaults=None, dict_type=dict):
+@@ -56,7 +58,7 @@ class RawConfigParser(object):
+         # The default section is the only one that gets the case-insensitive
+         # treatment - so it is special-cased here.
+         if section.lower() == "default":
+-            raise ValueError, 'Invalid section name: %s' % section
++            raise ValueError('Invalid section name: %s' % section)
+ 
+         if self.has_section(section):
+             raise DuplicateSectionError(section)
+@@ -88,7 +90,7 @@ class RawConfigParser(object):
+         filename may also be given.
+         """
+         files_read = []
+-        if isinstance(filenames, basestring):
++        if isinstance(filenames, six.string_types):
+             filenames = [filenames]
+         for filename in filenames:
+             try:
+@@ -143,7 +145,7 @@ class RawConfigParser(object):
+     def getboolean(self, section, option):
+         v = self.get(section, option)
+         if v.lower() not in self._boolean_states:
+-            raise ValueError, 'Not a boolean: %s' % v
++            raise ValueError('Not a boolean: %s' % v)
+         return self._boolean_states[v.lower()]
+ 
+     def has_option(self, section, option):
+@@ -234,7 +236,7 @@ class ConfigParser(RawConfigParser):
+             if "%(" in value:
+                 try:
+                     value = value % vars
+-                except KeyError, e:
++                except KeyError as e:
+                     raise InterpolationMissingOptionError(
+                         option, section, rawval, e.args[0])
+             else:
+@@ -283,7 +285,7 @@ class SafeConfigParser(ConfigParser):
+     _badpercent_re = re.compile(r"%[^%]|%$")
+ 
+     def set(self, section, option, value):
+-        if not isinstance(value, basestring):
++        if not isinstance(value, six.string_types):
+             raise TypeError("option values must be strings")
+         # check for bad percent signs:
+         # first, replace all "good" interpolations
+diff --git a/iniparse/config.py b/iniparse/config.py
+index 5cfa2ea..3b28549 100644
+--- a/iniparse/config.py
++++ b/iniparse/config.py
+@@ -143,7 +143,7 @@ class BasicConfig(ConfigNamespace):
+ 
+     >>> n.aaa = 42
+     >>> del n.x
+-    >>> print n
++    >>> print(n)
+     aaa = 42
+     name.first = paramjit
+     name.last = oberoi
+@@ -152,7 +152,7 @@ class BasicConfig(ConfigNamespace):
+ 
+     >>> isinstance(n.name, ConfigNamespace)
+     True
+-    >>> print n.name
++    >>> print(n.name)
+     first = paramjit
+     last = oberoi
+     >>> sorted(list(n.name))
+@@ -160,7 +160,7 @@ class BasicConfig(ConfigNamespace):
+ 
+     Finally, values can be read from a file as follows:
+ 
+-    >>> from StringIO import StringIO
++    >>> from six import StringIO
+     >>> sio = StringIO('''
+     ... # comment
+     ... ui.height = 100
+@@ -171,7 +171,7 @@ class BasicConfig(ConfigNamespace):
+     ... ''')
+     >>> n = BasicConfig()
+     >>> n._readfp(sio)
+-    >>> print n
++    >>> print(n)
+     complexity = medium
+     data.secret.password = goodness=gracious me
+     have_python
+@@ -199,7 +199,7 @@ class BasicConfig(ConfigNamespace):
+ 
+     def __str__(self, prefix=''):
+         lines = []
+-        keys = self._data.keys()
++        keys = list(self._data.keys())
+         keys.sort()
+         for name in keys:
+             value = self._data[name]
+@@ -258,7 +258,7 @@ def update_config(target, source):
+     >>> n.ui.display_clock = True
+     >>> n.ui.display_qlength = True
+     >>> n.ui.width = 150
+-    >>> print n
++    >>> print(n)
+     playlist.expand_playlist = True
+     ui.display_clock = True
+     ui.display_qlength = True
+@@ -267,7 +267,7 @@ def update_config(target, source):
+     >>> from iniparse import ini
+     >>> i = ini.INIConfig()
+     >>> update_config(i, n)
+-    >>> print i
++    >>> print(i)
+     [playlist]
+     expand_playlist = True
+     <BLANKLINE>
+@@ -277,7 +277,7 @@ def update_config(target, source):
+     width = 150
+ 
+     """
+-    for name in source:
++    for name in sorted(source):
+         value = source[name]
+         if isinstance(value, ConfigNamespace):
+             if name in target:
+diff --git a/iniparse/configparser.py b/iniparse/configparser.py
+new file mode 100644
+index 0000000..c543d50
+--- /dev/null
++++ b/iniparse/configparser.py
+@@ -0,0 +1,7 @@
++try:
++    from ConfigParser import *
++    # not all objects get imported with __all__
++    from ConfigParser import Error, InterpolationMissingOptionError
++except ImportError:
++    from configparser import *
++    from configparser import Error, InterpolationMissingOptionError
+diff --git a/iniparse/ini.py b/iniparse/ini.py
+index 408354d..052d9e9 100644
+--- a/iniparse/ini.py
++++ b/iniparse/ini.py
+@@ -7,7 +7,7 @@
+ 
+ Example:
+ 
+-    >>> from StringIO import StringIO
++    >>> from six import StringIO
+     >>> sio = StringIO('''# configure foo-application
+     ... [foo]
+     ... bar1 = qualia
+@@ -16,14 +16,14 @@ Example:
+     ... special = 1''')
+ 
+     >>> cfg = INIConfig(sio)
+-    >>> print cfg.foo.bar1
++    >>> print(cfg.foo.bar1)
+     qualia
+-    >>> print cfg['foo-ext'].special
++    >>> print(cfg['foo-ext'].special)
+     1
+     >>> cfg.foo.newopt = 'hi!'
+     >>> cfg.baz.enabled = 0
+ 
+-    >>> print cfg
++    >>> print(cfg)
+     # configure foo-application
+     [foo]
+     bar1 = qualia
+@@ -42,9 +42,11 @@ Example:
+ # Backward-compatiable with ConfigParser
+ 
+ import re
+-from ConfigParser import DEFAULTSECT, ParsingError, MissingSectionHeaderError
++from .configparser import DEFAULTSECT, ParsingError, MissingSectionHeaderError
+ 
+-import config
++import six
++
++from . import config
+ 
+ class LineType(object):
+     line = None
+@@ -278,6 +280,8 @@ class LineContainer(object):
+     value = property(get_value, set_value)
+ 
+     def __str__(self):
++        for c in self.contents:
++            pass#print(c.__str__())
+         s = [x.__str__() for x in self.contents]
+         return '\n'.join(s)
+ 
+@@ -465,7 +469,7 @@ class INIConfig(config.ConfigNamespace):
+         self._sections = {}
+         if defaults is None: defaults = {}
+         self._defaults = INISection(LineContainer(), optionxformsource=self)
+-        for name, value in defaults.iteritems():
++        for name, value in defaults.items():
+             self._defaults[name] = value
+         if fp is not None:
+             self._readfp(fp)
+@@ -551,7 +555,7 @@ class INIConfig(config.ConfigNamespace):
+ 
+         for line in readline_iterator(fp):
+             # Check for BOM on first line
+-            if linecount == 0 and isinstance(line, unicode):
++            if linecount == 0 and isinstance(line, six.text_type):
+                 if line[0] == u'\ufeff':
+                     line = line[1:]
+                     self._bom = True
+diff --git a/iniparse/utils.py b/iniparse/utils.py
+index 829fc28..f8b773a 100644
+--- a/iniparse/utils.py
++++ b/iniparse/utils.py
+@@ -1,5 +1,5 @@
+-import compat
+-from ini import LineContainer, EmptyLine
++from . import compat
++from .ini import LineContainer, EmptyLine
+ 
+ def tidy(cfg):
+     """Clean up blank lines.
+diff --git a/tests/__init__.py b/tests/__init__.py
+index f1fa321..88689fb 100644
+--- a/tests/__init__.py
++++ b/tests/__init__.py
+@@ -1,12 +1,12 @@
+ import unittest, doctest
+ 
+-import test_ini
+-import test_misc
+-import test_fuzz
+-import test_compat
+-import test_unicode
+-import test_tidy
+-import test_multiprocessing
++from . import test_ini
++from . import test_misc
++from . import test_fuzz
++from . import test_compat
++from . import test_unicode
++from . import test_tidy
++from . import test_multiprocessing
+ from iniparse import config
+ from iniparse import ini
+ 
+diff --git a/tests/test_compat.py b/tests/test_compat.py
+index b8da3d5..b6dfb5c 100644
+--- a/tests/test_compat.py
++++ b/tests/test_compat.py
+@@ -1,9 +1,16 @@
+ from iniparse import compat as ConfigParser
+-import StringIO
++from six import StringIO
++try:
++    import UserDict
++except ImportError:
++    import collections as UserDict
+ import unittest
+-import UserDict
+ 
+-from test import test_support
++import sys
++if sys.version_info[0] < 3:
++    from test import test_support
++else:
++    from test import support as test_support
+ 
+ class SortedDict(UserDict.UserDict):
+     def items(self):
+@@ -35,7 +42,7 @@ class TestCaseBase(unittest.TestCase):
+ 
+     def fromstring(self, string, defaults=None):
+         cf = self.newconfig(defaults)
+-        sio = StringIO.StringIO(string)
++        sio = StringIO(string)
+         cf.readfp(sio)
+         return cf
+ 
+@@ -161,7 +168,7 @@ class TestCaseBase(unittest.TestCase):
+                          "No Section!\n")
+ 
+     def parse_error(self, exc, src):
+-        sio = StringIO.StringIO(src)
++        sio = StringIO(src)
+         self.assertRaises(exc, self.cf.readfp, sio)
+ 
+     def test_query_errors(self):
+@@ -181,7 +188,7 @@ class TestCaseBase(unittest.TestCase):
+     def get_error(self, exc, section, option):
+         try:
+             self.cf.get(section, option)
+-        except exc, e:
++        except exc as e:
+             return e
+         else:
+             self.fail("expected exception type %s.%s"
+@@ -227,7 +234,7 @@ class TestCaseBase(unittest.TestCase):
+             "foo: another very\n"
+             " long line"
+             )
+-        output = StringIO.StringIO()
++        output = StringIO()
+         cf.write(output)
+         self.assertEqual(
+             output.getvalue(),
+@@ -465,7 +472,7 @@ class SortedTestCase(RawConfigParserTestCase):
+                         "o1=4\n"
+                         "[a]\n"
+                         "k=v\n")
+-        output = StringIO.StringIO()
++        output = StringIO()
+         self.cf.write(output)
+         self.assertEquals(output.getvalue(),
+                           "[a]\n"
+diff --git a/tests/test_fuzz.py b/tests/test_fuzz.py
+index 5420dcc..b219500 100644
+--- a/tests/test_fuzz.py
++++ b/tests/test_fuzz.py
+@@ -1,9 +1,10 @@
+ import re
+ import os
+ import random
++import sys
+ import unittest
+-import ConfigParser
+-from StringIO import StringIO
++from six import StringIO
++from six.moves import configparser
+ from iniparse import compat, ini, tidy
+ 
+ # TODO:
+@@ -96,24 +97,25 @@ class test_fuzz(unittest.TestCase):
+                 s = '\n'.join(good_lines)
+                 cc = compat.RawConfigParser()
+                 cc.readfp(StringIO(s))
+-                cc_py = ConfigParser.RawConfigParser()
++                cc_py = configparser.RawConfigParser()
+                 cc_py.readfp(StringIO(s))
+                 # compare the two configparsers
+                 self.assertEqualConfig(cc_py, cc)
+                 # check that tidy does not change semantics
+                 tidy(cc)
+-                cc_tidy = ConfigParser.RawConfigParser()
++                cc_tidy = configparser.RawConfigParser()
+                 cc_tidy.readfp(StringIO(str(cc.data)))
+                 self.assertEqualConfig(cc_py, cc_tidy)
+             except AssertionError:
+                 fname = 'fuzz-test-iter-%d.ini' % fuzz_iter
+-                print 'Fuzz test failed at iteration', fuzz_iter
+-                print 'Writing out failing INI file as', fname
++                print('Fuzz test failed at iteration', fuzz_iter)
++                print('Writing out failing INI file as', fname)
+                 f = open(fname, 'w')
+                 f.write(s)
+                 f.close()
+                 raise
+ 
++    @unittest.skipIf(sys.version_info[0] > 2, 'http://code.google.com/p/iniparse/issues/detail?id=22#c9')
+     def assertEqualConfig(self, c1, c2):
+         self.assertEqualSorted(c1.sections(), c2.sections())
+         self.assertEqualSorted(c1.defaults().items(), c2.defaults().items())
+@@ -123,9 +125,7 @@ class test_fuzz(unittest.TestCase):
+                 self.assertEqual(c1.get(sec, opt), c2.get(sec, opt))
+ 
+     def assertEqualSorted(self, l1, l2):
+-        l1.sort()
+-        l2.sort()
+-        self.assertEqual(l1, l2)
++        self.assertEqual(sorted(l1), sorted(l2))
+ 
+ class suite(unittest.TestSuite):
+     def __init__(self):
+diff --git a/tests/test_ini.py b/tests/test_ini.py
+index 6a76edb..07d4f4e 100644
+--- a/tests/test_ini.py
++++ b/tests/test_ini.py
+@@ -1,5 +1,5 @@
+ import unittest
+-from StringIO import StringIO
++from six import StringIO
+ 
+ from iniparse import ini
+ from iniparse import compat
+@@ -196,13 +196,13 @@ but = also me
+         self.assertEqual(p._data.find('section2').find('just').value, 'kidding')
+ 
+         itr = p._data.finditer('section1')
+-        v = itr.next()
++        v = next(itr)
+         self.assertEqual(v.find('help').value, 'yourself')
+         self.assertEqual(v.find('but').value, 'also me')
+-        v = itr.next()
++        v = next(itr)
+         self.assertEqual(v.find('help').value, 'me')
+         self.assertEqual(v.find('I\'m').value, 'desperate')
+-        self.assertRaises(StopIteration, itr.next)
++        self.assertRaises(StopIteration, next, itr)
+ 
+         self.assertRaises(KeyError, p._data.find, 'section')
+         self.assertRaises(KeyError, p._data.find('section2').find, 'ahem')
+diff --git a/tests/test_misc.py b/tests/test_misc.py
+index 31cf4da..96ef035 100644
+--- a/tests/test_misc.py
++++ b/tests/test_misc.py
+@@ -1,9 +1,9 @@
+ import re
+ import unittest
+ import pickle
+-import ConfigParser
++from six.moves import configparser
++from six import StringIO
+ from textwrap import dedent
+-from StringIO import StringIO
+ from iniparse import compat, ini
+ 
+ class CaseSensitiveConfigParser(compat.ConfigParser):
+diff --git a/tests/test_tidy.py b/tests/test_tidy.py
+index 7304747..26b6cde 100644
+--- a/tests/test_tidy.py
++++ b/tests/test_tidy.py
+@@ -1,6 +1,6 @@
+ import unittest
+ from textwrap import dedent
+-from StringIO import StringIO
++from six import StringIO
+ 
+ from iniparse import tidy,INIConfig
+ from iniparse.ini import  EmptyLine
+diff --git a/tests/test_unicode.py b/tests/test_unicode.py
+index a56fcab..14d4fbd 100644
+--- a/tests/test_unicode.py
++++ b/tests/test_unicode.py
+@@ -1,5 +1,5 @@
+ import unittest
+-from StringIO import StringIO
++import six
+ from iniparse import compat, ini
+ 
+ class test_unicode(unittest.TestCase):
+@@ -17,14 +17,14 @@ baz = Marc-Andr\202
+     """
+ 
+     def basic_tests(self, s, strable):
+-        f = StringIO(s)
++        f = six.StringIO(s)
+         i = ini.INIConfig(f)
+-        self.assertEqual(unicode(i), s)
+-        self.assertEqual(type(i.foo.bar), unicode)
++        self.assertEqual(six.text_type(i), s)
++        self.assertEqual(type(i.foo.bar), six.text_type)
+         if strable:
+             self.assertEqual(str(i), str(s))
+         else:
+-            self.assertRaises(UnicodeEncodeError, lambda: str(i))
++            self.assertRaises(UnicodeEncodeError, lambda: six.text_type(i).encode('ascii'))
+         return i
+ 
+     def test_ascii(self):
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb
new file mode 100644
index 0000000..f51ce64
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Accessing and Modifying INI files"
+HOMEPAGE = "https://pypi.python.org/pypi/iniparse/"
+LICENSE = "MIT & PSF"
+LIC_FILES_CHKSUM = "file://LICENSE-PSF;md5=1c78a5bb3584b353496d5f6f34edb4b2 \
+                    file://LICENSE;md5=52f28065af11d69382693b45b5a8eb54"
+
+SRC_URI = "https://files.pythonhosted.org/packages/source/i/iniparse/iniparse-${PV}.tar.gz \
+           file://0001-Add-python-3-compatibility.patch "
+SRC_URI[md5sum] = "5e573e9e9733d97623881ce9bbe5eca6"
+SRC_URI[sha256sum] = "abc1ee12d2cfb2506109072d6c21e40b6c75a3fe90a9c924327d80bc0d99c054"
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/iniparse/"
+
+inherit distutils3
+
+RDEPENDS_${PN} += "python3-core python3-six"
+DEPENDS += "python3-six"
+
+BBCLASSEXTEND = "native nativesdk"
+
+S = "${WORKDIR}/iniparse-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-mako_1.0.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-mako_1.0.6.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python/python3-mako_1.0.4.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/python/python3-mako_1.0.6.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.2.bb
index f32f05c..782e2cd 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.2.bb
@@ -8,7 +8,6 @@
 file://12-distutils-prefix-is-inside-staging-area.patch \
 file://python-config.patch \
 file://000-cross-compile.patch \
-file://020-dont-compile-python-files.patch \
 file://030-fixup-include-dirs.patch \
 file://070-dont-clean-ipkg-install.patch \
 file://080-distutils-dont_adjust_files.patch \
@@ -42,28 +41,7 @@
 
 inherit native
 
-RPROVIDES += " \
-    python3-compression-native \
-    python3-core-native \
-    python3-distutils-native \
-    python3-email-native \
-    python3-importlib-native \
-    python3-io-native \
-    python3-json-native \
-    python3-lang-native \
-    python3-misc-native \
-    python3-netclient-native \
-    python3-netserver-native \
-    python3-numbers-native \
-    python3-pkgutil-native \
-    python3-pprint-native \
-    python3-re-native \
-    python3-shell-native \
-    python3-subprocess-native \
-    python3-textutils-native \
-    python3-threading-native \
-    python3-unittest-native \
-"
+require python-native-${PYTHON_MAJMIN}-manifest.inc
 
 # uninative may be used on pre glibc 2.25 systems which don't have getentropy
 EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --without-ensurepip ac_cv_func_getentropy=no"
@@ -97,4 +75,9 @@
 	for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
 		sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
 	done
+
+	# Tests are large and we don't need them in the native sysroot
+	rm ${D}${libdir}/python${PYTHON_MAJMIN}/test -rf
 }
+
+RPROVIDES += "python3-misc-native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.1.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.1.2.bb
deleted file mode 100644
index eefb4cb..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.1.2.bb
+++ /dev/null
@@ -1,47 +0,0 @@
-SUMMARY = "The PyPA recommended tool for installing Python packages"
-sHOMEPAGEsss = "https://pypi.python.org/pypi/pip"
-SECTION = "devel/python"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=25fba45109565f87de20bae85bc39452"
-
-SRCNAME = "pip"
-DEPENDS += "python3 python3-setuptools-native"
-
-SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "87083c0b9867963b29f7aba3613e8f4a"
-SRC_URI[sha256sum] = "4d24b03ffa67638a3fa931c09fd9e0273ffa904e95ebebe7d4b1a54c93d7b732"
-
-UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/pip"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-inherit distutils3
-
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR}"
-
-do_install_prepend() {
-    install -d ${D}${PYTHON_SITEPACKAGES_DIR}
-}
-
-# Use setuptools site.py instead, avoid shared state issue
-do_install_append() {
-    rm ${D}${PYTHON_SITEPACKAGES_DIR}/site.py
-    rm ${D}${PYTHON_SITEPACKAGES_DIR}/__pycache__/site.cpython-*.pyc
-
-    # Install as pip3 and leave pip2 as default
-    rm ${D}/${bindir}/pip
-
-    # Installed eggs need to be passed directly to the interpreter via a pth file
-    echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}-${PV}.pth
-}
-
-RDEPENDS_${PN} = "\
-  python3-compile \
-  python3-io \
-  python3-json \
-  python3-netserver \
-  python3-setuptools \
-  python3-unixadmin \
-  python3-xmlrpc \
-"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_9.0.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_9.0.1.bb
new file mode 100644
index 0000000..4456b9b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_9.0.1.bb
@@ -0,0 +1,56 @@
+SUMMARY = "The PyPA recommended tool for installing Python packages"
+sHOMEPAGEsss = "https://pypi.python.org/pypi/pip"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=25fba45109565f87de20bae85bc39452"
+
+SRCNAME = "pip"
+DEPENDS += "python3 python3-setuptools-native"
+
+SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "35f01da33009719497f01a4ba69d63c9"
+SRC_URI[sha256sum] = "09f243e1a7b461f654c26a725fa373211bb7ff17a9300058b205c61658ca940d"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/pip"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils3
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR}"
+
+do_install_prepend() {
+    install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+}
+
+# Use setuptools site.py instead, avoid shared state issue
+do_install_append() {
+    rm ${D}${PYTHON_SITEPACKAGES_DIR}/site.py
+    rm ${D}${PYTHON_SITEPACKAGES_DIR}/__pycache__/site.cpython-*.pyc
+
+    # Install as pip3 and leave pip2 as default
+    rm ${D}/${bindir}/pip
+
+    # Installed eggs need to be passed directly to the interpreter via a pth file
+    echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}-${PV}.pth
+
+    # Make sure we use /usr/bin/env python3
+    for PYTHSCRIPT in `grep -rIl ${bindir} ${D}${bindir}/pip3*`; do
+        sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
+    done
+}
+
+RDEPENDS_${PN} = "\
+  python3-compile \
+  python3-io \
+  python3-enum \
+  python3-html \
+  python3-json \
+  python3-netserver \
+  python3-setuptools \
+  python3-unixadmin \
+  python3-xmlrpc \
+"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pycurl_7.21.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pycurl_7.21.5.bb
new file mode 100644
index 0000000..5d11192
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pycurl_7.21.5.bb
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/python-pycurl:"
+
+require python-pycurl.inc
+
+inherit distutils3
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pygobject_3.20.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pygobject_3.20.1.bb
deleted file mode 100644
index cda16f1..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pygobject_3.20.1.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-SUMMARY = "Python GObject bindings"
-SECTION = "devel/python"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
-
-inherit autotools pkgconfig gnomebase distutils3-base gobject-introspection upstream-version-is-even
-
-DEPENDS += "python3 glib-2.0"
-
-SRCNAME="pygobject"
-SRC_URI = " \
-    http://ftp.gnome.org/pub/GNOME/sources/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \
-    file://0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch \
-"
-
-SRC_URI[md5sum] = "4354c6283b135f859563b72457f6a321"
-SRC_URI[sha256sum] = "3d261005d6fed6a92ac4c25f283792552f7dad865d1b7e0c03c2b84c04dbd745"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-BBCLASSEXTEND = "native"
-
-EXTRA_OECONF = "--disable-cairo"
-
-RDEPENDS_${PN} += "python3-setuptools python3-importlib"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pygobject_3.22.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pygobject_3.22.0.bb
new file mode 100644
index 0000000..143048d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pygobject_3.22.0.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Python GObject bindings"
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
+
+inherit autotools pkgconfig gnomebase distutils3-base gobject-introspection upstream-version-is-even
+
+DEPENDS += "gnome-common-native python3 glib-2.0"
+
+SRCNAME="pygobject"
+SRC_URI = " \
+    http://ftp.gnome.org/pub/GNOME/sources/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \
+    file://0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch \
+"
+
+SRC_URI[md5sum] = "ed4117ed5d554d25fd7718807fbf819f"
+SRC_URI[sha256sum] = "08b29cfb08efc80f7a8630a2734dec65a99c1b59f1e5771c671d2e4ed8a5cbe7"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+
+PACKAGECONFIG ??= "${@bb.utils.contains_any('DISTRO_FEATURES', [ 'directfb', 'wayland', 'x11' ], 'cairo', '', d)}"
+
+# python3-pycairo is checked on configuration -> DEPENDS
+# we don't link against python3-pycairo -> RDEPENDS
+PACKAGECONFIG[cairo] = "--enable-cairo,--disable-cairo,cairo python3-pycairo, python3-pycairo"
+
+RDEPENDS_${PN} += "python3-setuptools python3-importlib"
+
+BBCLASSEXTEND = "native"
+PACKAGECONFIG_class-native = ""
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pygpgme_0.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pygpgme_0.3.bb
new file mode 100644
index 0000000..495f677
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pygpgme_0.3.bb
@@ -0,0 +1,18 @@
+SUMMARY = "A Python module for working with OpenPGP messages"
+HOMEPAGE = "https://launchpad.net/pygpgme"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://README;md5=2dc15a76acf01e126188c8de634ae4b3"
+
+SRC_URI = "https://launchpad.net/pygpgme/trunk/${PV}/+download/pygpgme-${PV}.tar.gz"
+SRC_URI[md5sum] = "d38355af73f0352cde3d410b25f34fd0"
+SRC_URI[sha256sum] = "5fd887c407015296a8fd3f4b867fe0fcca3179de97ccde90449853a3dfb802e1"
+
+S = "${WORKDIR}/pygpgme-${PV}"
+
+inherit distutils3
+
+DEPENDS = "gpgme python3"
+
+RDEPENDS_${PN} += "python3-core"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_22.0.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_32.1.1.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_22.0.5.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_32.1.1.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
deleted file mode 100644
index 819ba69..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-Dont cross compile site packages
-
--Khem
-
-Upstream-Status: Inappropriate[Embedded-Specific]
-
----
- Makefile.pre.in |   16 ----------------
- 1 file changed, 16 deletions(-)
-
-Index: Python-3.5.0/Makefile.pre.in
-===================================================================
---- Python-3.5.0.orig/Makefile.pre.in
-+++ Python-3.5.0/Makefile.pre.in
-@@ -1262,33 +1262,6 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
- 		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
- 			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
- 	fi
--	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
--		-d $(LIBDEST) -f \
--		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
--		$(DESTDIR)$(LIBDEST)
--	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
--		-d $(LIBDEST) -f \
--		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
--		$(DESTDIR)$(LIBDEST)
--	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
--		-d $(LIBDEST) -f \
--		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
--		$(DESTDIR)$(LIBDEST)
--	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
--		-d $(LIBDEST)/site-packages -f \
--		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
--	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
--		-d $(LIBDEST)/site-packages -f \
--		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
--	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--		$(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
--		-d $(LIBDEST)/site-packages -f \
--		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
- 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- 		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
- 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/CVE-2016-5636.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/CVE-2016-5636.patch
deleted file mode 100644
index 0d494d2..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/CVE-2016-5636.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-
-# HG changeset patch
-# User Benjamin Peterson <benjamin@python.org>
-# Date 1453357506 28800
-# Node ID 10dad6da1b28ea4af78ad9529e469fdbf4ebbc8f
-# Parent  a3ac2cd93db9d5336dfd7b5b27efde2c568d8794# Parent  01ddd608b85c85952537d95a43bbabf4fb655057
-merge 3.4 (#26171)
-
-Upstream-Status: Backport
-CVE: CVE-2016-5636
-
-https://hg.python.org/cpython/raw-rev/10dad6da1b28
-Signed-off-by: Armin Kuster <akuster@mvista.com>
-
-Index: Python-3.5.1/Misc/NEWS
-===================================================================
---- Python-3.5.1.orig/Misc/NEWS
-+++ Python-3.5.1/Misc/NEWS
-@@ -91,6 +91,9 @@ Core and Builtins
-   Python.h header to fix a compilation error with OpenMP. PyThreadState_GET()
-   becomes an alias to PyThreadState_Get() to avoid ABI incompatibilies.
- 
-+- Issue #26171: Fix possible integer overflow and heap corruption in
-+  zipimporter.get_data().
-+
- Library
- -------
- 
-Index: Python-3.5.1/Modules/zipimport.c
-===================================================================
---- Python-3.5.1.orig/Modules/zipimport.c
-+++ Python-3.5.1/Modules/zipimport.c
-@@ -1112,6 +1112,11 @@ get_data(PyObject *archive, PyObject *to
-     }
-     file_offset += l;           /* Start of file data */
- 
-+    if (data_size > LONG_MAX - 1) {
-+        fclose(fp);
-+        PyErr_NoMemory();
-+        return NULL;
-+    }
-     bytes_size = compress == 0 ? data_size : data_size + 1;
-     if (bytes_size == 0)
-         bytes_size++;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
index 056e8e7..08c4403 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
@@ -1,16 +1,34 @@
-Upstream-Status: Pending
-
-get the sys.lib from python itself and do not use hardcoded value of 'lib'
+From 51fe6f22d0ba113674fb358bd11d75fe659bd26e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 14 May 2013 15:00:26 -0700
+Subject: [PATCH 01/13] get the sys.lib from python itself and do not use
+ hardcoded value of 'lib'
 
 02/2015 Rebased for 3.4.2
 
+Upstream-Status: Pending
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
 
-Index: Python-3.5.2/Include/pythonrun.h
-===================================================================
---- Python-3.5.2.orig/Include/pythonrun.h
-+++ Python-3.5.2/Include/pythonrun.h
+---
+ Include/pythonrun.h              |  3 +++
+ Lib/distutils/command/install.py |  4 +++-
+ Lib/pydoc.py                     |  2 +-
+ Lib/site.py                      |  4 ++--
+ Lib/sysconfig.py                 | 18 +++++++++---------
+ Lib/trace.py                     |  4 ++--
+ Makefile.pre.in                  |  7 +++++--
+ Modules/getpath.c                | 10 +++++++++-
+ Python/getplatform.c             | 20 ++++++++++++++++++++
+ Python/sysmodule.c               |  4 ++++
+ configure.ac                     | 35 +++++++++++++++++++++++++++++++++++
+ setup.py                         |  9 ++++-----
+ 12 files changed, 97 insertions(+), 23 deletions(-)
+
+diff --git a/Include/pythonrun.h b/Include/pythonrun.h
+index 9c2e813..2f79cb6 100644
+--- a/Include/pythonrun.h
++++ b/Include/pythonrun.h
 @@ -23,6 +23,9 @@ typedef struct {
  } PyCompilerFlags;
  #endif
@@ -21,10 +39,10 @@
  #ifndef Py_LIMITED_API
  PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
  PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
-Index: Python-3.5.2/Lib/distutils/command/install.py
-===================================================================
---- Python-3.5.2.orig/Lib/distutils/command/install.py
-+++ Python-3.5.2/Lib/distutils/command/install.py
+diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
+index 67db007..b46b45b 100644
+--- a/Lib/distutils/command/install.py
++++ b/Lib/distutils/command/install.py
 @@ -19,6 +19,8 @@ from site import USER_BASE
  from site import USER_SITE
  HAS_USER_SITE = True
@@ -43,10 +61,10 @@
          'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
          'scripts': '$base/bin',
          'data'   : '$base',
-Index: Python-3.5.2/Lib/pydoc.py
-===================================================================
---- Python-3.5.2.orig/Lib/pydoc.py
-+++ Python-3.5.2/Lib/pydoc.py
+diff --git a/Lib/pydoc.py b/Lib/pydoc.py
+index 3ca08c9..6528730 100755
+--- a/Lib/pydoc.py
++++ b/Lib/pydoc.py
 @@ -384,7 +384,7 @@ class Doc:
      docmodule = docclass = docroutine = docother = docproperty = docdata = fail
  
@@ -56,172 +74,29 @@
                                         "python%d.%d" %  sys.version_info[:2])):
          """Return the location of module docs or None"""
  
-Index: Python-3.5.2/Lib/trace.py
-===================================================================
---- Python-3.5.2.orig/Lib/trace.py
-+++ Python-3.5.2/Lib/trace.py
-@@ -749,10 +749,10 @@ def main(argv=None):
-                 # should I also call expanduser? (after all, could use $HOME)
+diff --git a/Lib/site.py b/Lib/site.py
+index 3f78ef5..511931e 100644
+--- a/Lib/site.py
++++ b/Lib/site.py
+@@ -303,12 +303,12 @@ def getsitepackages(prefixes=None):
+         seen.add(prefix)
  
-                 s = s.replace("$prefix",
--                              os.path.join(sys.base_prefix, "lib",
-+                              os.path.join(sys.base_prefix, sys.lib,
-                                            "python" + sys.version[:3]))
-                 s = s.replace("$exec_prefix",
--                              os.path.join(sys.base_exec_prefix, "lib",
-+                              os.path.join(sys.base_exec_prefix, sys.lib,
-                                            "python" + sys.version[:3]))
-                 s = os.path.normpath(s)
-                 ignore_dirs.append(s)
-Index: Python-3.5.2/Makefile.pre.in
-===================================================================
---- Python-3.5.2.orig/Makefile.pre.in
-+++ Python-3.5.2/Makefile.pre.in
-@@ -106,6 +106,8 @@ PY_CORE_CFLAGS=	$(PY_CFLAGS) $(PY_CFLAGS
- 
- # Machine-dependent subdirectories
- MACHDEP=	@MACHDEP@
-+LIB=		@LIB@
-+ARCH=		@ARCH@
- 
- # Multiarch directory (may be empty)
- MULTIARCH=	@MULTIARCH@
-@@ -125,7 +127,7 @@ LIBDIR=		@libdir@
- MANDIR=		@mandir@
- INCLUDEDIR=	@includedir@
- CONFINCLUDEDIR=	$(exec_prefix)/include
--SCRIPTDIR=	$(prefix)/lib
-+SCRIPTDIR=	@libdir@
- ABIFLAGS=	@ABIFLAGS@
- 
- # Detailed destination directories
-@@ -755,6 +757,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
- 		-DEXEC_PREFIX='"$(exec_prefix)"' \
- 		-DVERSION='"$(VERSION)"' \
- 		-DVPATH='"$(VPATH)"' \
-+		-DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
- 		-o $@ $(srcdir)/Modules/getpath.c
- 
- Programs/python.o: $(srcdir)/Programs/python.c
-@@ -835,7 +838,7 @@ $(OPCODE_H): $(srcdir)/Lib/opcode.py $(O
- Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
- 
- Python/getplatform.o: $(srcdir)/Python/getplatform.c
--		$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
-+		$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
- 
- Python/importdl.o: $(srcdir)/Python/importdl.c
- 		$(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
-Index: Python-3.5.2/Modules/getpath.c
-===================================================================
---- Python-3.5.2.orig/Modules/getpath.c
-+++ Python-3.5.2/Modules/getpath.c
-@@ -105,6 +105,13 @@
- #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
- #endif
- 
-+#define LIB_PYTHON LIB "/python" VERSION
-+
-+#ifndef PYTHONPATH
-+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
-+        EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
-+#endif
-+
- #ifndef LANDMARK
- #define LANDMARK L"os.py"
- #endif
-@@ -113,6 +120,7 @@ static wchar_t prefix[MAXPATHLEN+1];
- static wchar_t exec_prefix[MAXPATHLEN+1];
- static wchar_t progpath[MAXPATHLEN+1];
- static wchar_t *module_search_path = NULL;
-+static wchar_t *lib_python = L"" LIB_PYTHON;
- 
- /* Get file status. Encode the path to the locale encoding. */
- 
-Index: Python-3.5.2/Python/getplatform.c
-===================================================================
---- Python-3.5.2.orig/Python/getplatform.c
-+++ Python-3.5.2/Python/getplatform.c
-@@ -10,3 +10,23 @@ Py_GetPlatform(void)
- {
- 	return PLATFORM;
- }
-+
-+#ifndef ARCH
-+#define ARCH "unknown"
-+#endif
-+
-+const char *
-+Py_GetArch(void)
-+{
-+	return ARCH;
-+}
-+
-+#ifndef LIB
-+#define LIB "lib"
-+#endif
-+
-+const char *
-+Py_GetLib(void)
-+{
-+	return LIB;
-+}
-Index: Python-3.5.2/Python/sysmodule.c
-===================================================================
---- Python-3.5.2.orig/Python/sysmodule.c
-+++ Python-3.5.2/Python/sysmodule.c
-@@ -1790,6 +1790,10 @@ _PySys_Init(void)
-                         PyUnicode_FromString(Py_GetCopyright()));
-     SET_SYS_FROM_STRING("platform",
-                         PyUnicode_FromString(Py_GetPlatform()));
-+    SET_SYS_FROM_STRING("arch",
-+                        PyUnicode_FromString(Py_GetArch()));
-+    SET_SYS_FROM_STRING("lib",
-+                        PyUnicode_FromString(Py_GetLib()));
-     SET_SYS_FROM_STRING("executable",
-                         PyUnicode_FromWideChar(
-                                Py_GetProgramFullPath(), -1));
-Index: Python-3.5.2/setup.py
-===================================================================
---- Python-3.5.2.orig/setup.py
-+++ Python-3.5.2/setup.py
-@@ -492,7 +492,7 @@ class PyBuildExt(build_ext):
-         # directories (i.e. '.' and 'Include') must be first.  See issue
-         # 10520.
-         if not cross_compiling:
--            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+            add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
-             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-         # only change this for cross builds for 3.3, issues on Mageia
-         if cross_compiling:
-@@ -550,8 +550,7 @@ class PyBuildExt(build_ext):
-         # be assumed that no additional -I,-L directives are needed.
-         if not cross_compiling:
-             lib_dirs = self.compiler.library_dirs + [
--                '/lib64', '/usr/lib64',
--                '/lib', '/usr/lib',
-+                '/' + sys.lib, '/usr/' + sys.lib,
-                 ]
-             inc_dirs = self.compiler.include_dirs + ['/usr/include']
+         if os.sep == '/':
+-            sitepackages.append(os.path.join(prefix, "lib",
++            sitepackages.append(os.path.join(prefix, sys.lib,
+                                         "python" + sys.version[:3],
+                                         "site-packages"))
          else:
-@@ -743,11 +742,11 @@ class PyBuildExt(build_ext):
-             elif curses_library:
-                 readline_libs.append(curses_library)
-             elif self.compiler.find_library_file(lib_dirs +
--                                                     ['/usr/lib/termcap'],
-+                                                     ['/usr/'+sys.lib+'/termcap'],
-                                                      'termcap'):
-                 readline_libs.append('termcap')
-             exts.append( Extension('readline', ['readline.c'],
--                                   library_dirs=['/usr/lib/termcap'],
-+                                   library_dirs=['/usr/'+sys.lib+'/termcap'],
-                                    extra_link_args=readline_extra_link_args,
-                                    libraries=readline_libs) )
-         else:
-Index: Python-3.5.2/Lib/sysconfig.py
-===================================================================
---- Python-3.5.2.orig/Lib/sysconfig.py
-+++ Python-3.5.2/Lib/sysconfig.py
+             sitepackages.append(prefix)
+-            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++            sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
+         if sys.platform == "darwin":
+             # for framework builds *only* we add the standard Apple
+             # locations.
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index 9c34be0..3d1181a 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
 @@ -20,10 +20,10 @@ __all__ = [
  
  _INSTALL_SCHEMES = {
@@ -264,11 +139,145 @@
          'include': '{userbase}/include/python{py_version_short}',
          'scripts': '{userbase}/bin',
          'data': '{userbase}',
-Index: Python-3.5.2/configure.ac
-===================================================================
---- Python-3.5.2.orig/configure.ac
-+++ Python-3.5.2/configure.ac
-@@ -876,6 +876,41 @@ PLATDIR=plat-$MACHDEP
+diff --git a/Lib/trace.py b/Lib/trace.py
+index f108266..7fd83f2 100755
+--- a/Lib/trace.py
++++ b/Lib/trace.py
+@@ -749,10 +749,10 @@ def main(argv=None):
+                 # should I also call expanduser? (after all, could use $HOME)
+ 
+                 s = s.replace("$prefix",
+-                              os.path.join(sys.base_prefix, "lib",
++                              os.path.join(sys.base_prefix, sys.lib,
+                                            "python" + sys.version[:3]))
+                 s = s.replace("$exec_prefix",
+-                              os.path.join(sys.base_exec_prefix, "lib",
++                              os.path.join(sys.base_exec_prefix, sys.lib,
+                                            "python" + sys.version[:3]))
+                 s = os.path.normpath(s)
+                 ignore_dirs.append(s)
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 109f402..61a41e2 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -106,6 +106,8 @@ PY_CORE_CFLAGS=	$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARE
+ 
+ # Machine-dependent subdirectories
+ MACHDEP=	@MACHDEP@
++LIB=		@LIB@
++ARCH=		@ARCH@
+ 
+ # Multiarch directory (may be empty)
+ MULTIARCH=	@MULTIARCH@
+@@ -125,7 +127,7 @@ LIBDIR=		@libdir@
+ MANDIR=		@mandir@
+ INCLUDEDIR=	@includedir@
+ CONFINCLUDEDIR=	$(exec_prefix)/include
+-SCRIPTDIR=	$(prefix)/lib
++SCRIPTDIR=	@libdir@
+ ABIFLAGS=	@ABIFLAGS@
+ 
+ # Detailed destination directories
+@@ -755,6 +757,7 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
+ 		-DEXEC_PREFIX='"$(exec_prefix)"' \
+ 		-DVERSION='"$(VERSION)"' \
+ 		-DVPATH='"$(VPATH)"' \
++		-DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
+ 		-o $@ $(srcdir)/Modules/getpath.c
+ 
+ Programs/python.o: $(srcdir)/Programs/python.c
+@@ -835,7 +838,7 @@ $(OPCODE_H): $(srcdir)/Lib/opcode.py $(OPCODE_H_SCRIPT)
+ Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
+ 
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+-		$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++		$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+ 
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ 		$(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+diff --git a/Modules/getpath.c b/Modules/getpath.c
+index 18deb60..a01c3f8 100644
+--- a/Modules/getpath.c
++++ b/Modules/getpath.c
+@@ -105,6 +105,13 @@
+ #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
+ #endif
+ 
++#define LIB_PYTHON LIB "/python" VERSION
++
++#ifndef PYTHONPATH
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++        EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
++#endif
++
+ #ifndef LANDMARK
+ #define LANDMARK L"os.py"
+ #endif
+@@ -113,6 +120,7 @@ static wchar_t prefix[MAXPATHLEN+1];
+ static wchar_t exec_prefix[MAXPATHLEN+1];
+ static wchar_t progpath[MAXPATHLEN+1];
+ static wchar_t *module_search_path = NULL;
++static wchar_t *lib_python = L"" LIB_PYTHON;
+ 
+ /* Get file status. Encode the path to the locale encoding. */
+ 
+@@ -494,7 +502,7 @@ calculate_path(void)
+     _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
+     _prefix = Py_DecodeLocale(PREFIX, NULL);
+     _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
+-    lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
++    lib_python = Py_DecodeLocale(LIB_PYTHON, NULL);
+ 
+     if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
+         Py_FatalError(
+diff --git a/Python/getplatform.c b/Python/getplatform.c
+index 6899140..66a49c6 100644
+--- a/Python/getplatform.c
++++ b/Python/getplatform.c
+@@ -10,3 +10,23 @@ Py_GetPlatform(void)
+ {
+ 	return PLATFORM;
+ }
++
++#ifndef ARCH
++#define ARCH "unknown"
++#endif
++
++const char *
++Py_GetArch(void)
++{
++	return ARCH;
++}
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++	return LIB;
++}
+diff --git a/Python/sysmodule.c b/Python/sysmodule.c
+index 8d7e05a..d9dee0f 100644
+--- a/Python/sysmodule.c
++++ b/Python/sysmodule.c
+@@ -1790,6 +1790,10 @@ _PySys_Init(void)
+                         PyUnicode_FromString(Py_GetCopyright()));
+     SET_SYS_FROM_STRING("platform",
+                         PyUnicode_FromString(Py_GetPlatform()));
++    SET_SYS_FROM_STRING("arch",
++                        PyUnicode_FromString(Py_GetArch()));
++    SET_SYS_FROM_STRING("lib",
++                        PyUnicode_FromString(Py_GetLib()));
+     SET_SYS_FROM_STRING("executable",
+                         PyUnicode_FromWideChar(
+                                Py_GetProgramFullPath(), -1));
+diff --git a/configure.ac b/configure.ac
+index 707324d..e8d59a3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -883,6 +883,41 @@ PLATDIR=plat-$MACHDEP
  AC_SUBST(PLATDIR)
  AC_SUBST(PLATFORM_TRIPLET)
  
@@ -310,3 +319,43 @@
  
  AC_MSG_CHECKING([for -Wl,--no-as-needed])
  save_LDFLAGS="$LDFLAGS"
+diff --git a/setup.py b/setup.py
+index 6d26deb..7b14215 100644
+--- a/setup.py
++++ b/setup.py
+@@ -495,7 +495,7 @@ class PyBuildExt(build_ext):
+         # directories (i.e. '.' and 'Include') must be first.  See issue
+         # 10520.
+         if not cross_compiling:
+-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++            add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
+             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+         # only change this for cross builds for 3.3, issues on Mageia
+         if cross_compiling:
+@@ -553,8 +553,7 @@ class PyBuildExt(build_ext):
+         # be assumed that no additional -I,-L directives are needed.
+         if not cross_compiling:
+             lib_dirs = self.compiler.library_dirs + [
+-                '/lib64', '/usr/lib64',
+-                '/lib', '/usr/lib',
++                '/' + sys.lib, '/usr/' + sys.lib,
+                 ]
+             inc_dirs = self.compiler.include_dirs + ['/usr/include']
+         else:
+@@ -746,11 +745,11 @@ class PyBuildExt(build_ext):
+             elif curses_library:
+                 readline_libs.append(curses_library)
+             elif self.compiler.find_library_file(lib_dirs +
+-                                                     ['/usr/lib/termcap'],
++                                                     ['/usr/'+sys.lib+'/termcap'],
+                                                      'termcap'):
+                 readline_libs.append('termcap')
+             exts.append( Extension('readline', ['readline.c'],
+-                                   library_dirs=['/usr/lib/termcap'],
++                                   library_dirs=['/usr/'+sys.lib+'/termcap'],
+                                    extra_link_args=readline_extra_link_args,
+                                    libraries=readline_libs) )
+         else:
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/upstream-random-fixes.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/upstream-random-fixes.patch
new file mode 100644
index 0000000..0d9152c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/upstream-random-fixes.patch
@@ -0,0 +1,721 @@
+This patch updates random.c to match upstream python's code at revision 
+8125d9a8152b. This addresses various issues around problems with glibc 2.24 
+and 2.25 such that python would fail to start with:
+
+[rpurdie@centos7 ~]$ /tmp/t2/sysroots/x86_64-pokysdk-linux/usr/bin/python3
+Fatal Python error: getentropy() failed
+Aborted
+
+(taken from our buildtools-tarball also breaks eSDK)
+
+Upstream-Status: Backport
+
+# HG changeset patch
+# User Victor Stinner <victor.stinner@gmail.com>
+# Date 1483957133 -3600
+# Node ID 8125d9a8152b79e712cb09c7094b9129b9bcea86
+# Parent  337461574c90281630751b6095c4e1baf380cf7d
+Issue #29157: Prefer getrandom() over getentropy()
+
+Copy and then adapt Python/random.c from default branch. Difference between 3.5
+and default branches:
+
+* Python 3.5 only uses getrandom() in non-blocking mode: flags=GRND_NONBLOCK
+* If getrandom() fails with EAGAIN: py_getrandom() immediately fails and
+  remembers that getrandom() doesn't work.
+* Python 3.5 has no _PyOS_URandomNonblock() function: _PyOS_URandom()
+  works in non-blocking mode on Python 3.5
+
+RP 2017/1/22
+
+Index: Python-3.5.2/Python/random.c
+===================================================================
+--- Python-3.5.2.orig/Python/random.c
++++ Python-3.5.2/Python/random.c
+@@ -1,6 +1,9 @@
+ #include "Python.h"
+ #ifdef MS_WINDOWS
+ #  include <windows.h>
++/* All sample MSDN wincrypt programs include the header below. It is at least
++ * required with Min GW. */
++#  include <wincrypt.h>
+ #else
+ #  include <fcntl.h>
+ #  ifdef HAVE_SYS_STAT_H
+@@ -36,10 +39,9 @@ win32_urandom_init(int raise)
+     return 0;
+ 
+ error:
+-    if (raise)
++    if (raise) {
+         PyErr_SetFromWindowsErr(0);
+-    else
+-        Py_FatalError("Failed to initialize Windows random API (CryptoGen)");
++    }
+     return -1;
+ }
+ 
+@@ -52,8 +54,9 @@ win32_urandom(unsigned char *buffer, Py_
+ 
+     if (hCryptProv == 0)
+     {
+-        if (win32_urandom_init(raise) == -1)
++        if (win32_urandom_init(raise) == -1) {
+             return -1;
++        }
+     }
+ 
+     while (size > 0)
+@@ -62,11 +65,9 @@ win32_urandom(unsigned char *buffer, Py_
+         if (!CryptGenRandom(hCryptProv, (DWORD)chunk, buffer))
+         {
+             /* CryptGenRandom() failed */
+-            if (raise)
++            if (raise) {
+                 PyErr_SetFromWindowsErr(0);
+-            else
+-                Py_FatalError("Failed to initialized the randomized hash "
+-                        "secret using CryptoGen)");
++            }
+             return -1;
+         }
+         buffer += chunk;
+@@ -75,55 +76,29 @@ win32_urandom(unsigned char *buffer, Py_
+     return 0;
+ }
+ 
+-/* Issue #25003: Don't use getentropy() on Solaris (available since
+- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
+-#elif defined(HAVE_GETENTROPY) && !defined(sun)
+-#define PY_GETENTROPY 1
+-
+-/* Fill buffer with size pseudo-random bytes generated by getentropy().
+-   Return 0 on success, or raise an exception and return -1 on error.
+-
+-   If fatal is nonzero, call Py_FatalError() instead of raising an exception
+-   on error. */
+-static int
+-py_getentropy(unsigned char *buffer, Py_ssize_t size, int fatal)
+-{
+-    while (size > 0) {
+-        Py_ssize_t len = Py_MIN(size, 256);
+-        int res;
+-
+-        if (!fatal) {
+-            Py_BEGIN_ALLOW_THREADS
+-            res = getentropy(buffer, len);
+-            Py_END_ALLOW_THREADS
+-
+-            if (res < 0) {
+-                PyErr_SetFromErrno(PyExc_OSError);
+-                return -1;
+-            }
+-        }
+-        else {
+-            res = getentropy(buffer, len);
+-            if (res < 0)
+-                Py_FatalError("getentropy() failed");
+-        }
+-
+-        buffer += len;
+-        size -= len;
+-    }
+-    return 0;
+-}
+-
+-#else
++#else /* !MS_WINDOWS */
+ 
+ #if defined(HAVE_GETRANDOM) || defined(HAVE_GETRANDOM_SYSCALL)
+ #define PY_GETRANDOM 1
+ 
++/* Call getrandom() to get random bytes:
++
++   - Return 1 on success
++   - Return 0 if getrandom() is not available (failed with ENOSYS or EPERM),
++     or if getrandom(GRND_NONBLOCK) failed with EAGAIN (system urandom not
++     initialized yet).
++   - Raise an exception (if raise is non-zero) and return -1 on error:
++     if getrandom() failed with EINTR, raise is non-zero and the Python signal
++     handler raised an exception, or if getrandom() failed with a different
++     error.
++
++   getrandom() is retried if it failed with EINTR: interrupted by a signal. */
+ static int
+ py_getrandom(void *buffer, Py_ssize_t size, int raise)
+ {
+-    /* Is getrandom() supported by the running kernel?
+-     * Need Linux kernel 3.17 or newer, or Solaris 11.3 or newer */
++    /* Is getrandom() supported by the running kernel? Set to 0 if getrandom()
++       failed with ENOSYS or EPERM. Need Linux kernel 3.17 or newer, or Solaris
++       11.3 or newer */
+     static int getrandom_works = 1;
+ 
+     /* getrandom() on Linux will block if called before the kernel has
+@@ -132,84 +107,165 @@ py_getrandom(void *buffer, Py_ssize_t si
+      * see https://bugs.python.org/issue26839. To avoid this, use the
+      * GRND_NONBLOCK flag. */
+     const int flags = GRND_NONBLOCK;
+-    int n;
++    char *dest;
++    long n;
+ 
+-    if (!getrandom_works)
++    if (!getrandom_works) {
+         return 0;
++    }
+ 
++    dest = buffer;
+     while (0 < size) {
+ #ifdef sun
+         /* Issue #26735: On Solaris, getrandom() is limited to returning up
+-           to 1024 bytes */
++           to 1024 bytes. Call it multiple times if more bytes are
++           requested. */
+         n = Py_MIN(size, 1024);
+ #else
+-        n = size;
++        n = Py_MIN(size, LONG_MAX);
+ #endif
+ 
+         errno = 0;
+ #ifdef HAVE_GETRANDOM
+         if (raise) {
+             Py_BEGIN_ALLOW_THREADS
+-            n = getrandom(buffer, n, flags);
++            n = getrandom(dest, n, flags);
+             Py_END_ALLOW_THREADS
+         }
+         else {
+-            n = getrandom(buffer, n, flags);
++            n = getrandom(dest, n, flags);
+         }
+ #else
+         /* On Linux, use the syscall() function because the GNU libc doesn't
+-         * expose the Linux getrandom() syscall yet. See:
+-         * https://sourceware.org/bugzilla/show_bug.cgi?id=17252 */
++           expose the Linux getrandom() syscall yet. See:
++           https://sourceware.org/bugzilla/show_bug.cgi?id=17252 */
+         if (raise) {
+             Py_BEGIN_ALLOW_THREADS
+-            n = syscall(SYS_getrandom, buffer, n, flags);
++            n = syscall(SYS_getrandom, dest, n, flags);
+             Py_END_ALLOW_THREADS
+         }
+         else {
+-            n = syscall(SYS_getrandom, buffer, n, flags);
++            n = syscall(SYS_getrandom, dest, n, flags);
+         }
+ #endif
+ 
+         if (n < 0) {
+-            if (errno == ENOSYS) {
++            /* ENOSYS: the syscall is not supported by the kernel.
++               EPERM: the syscall is blocked by a security policy (ex: SECCOMP)
++               or something else. */
++            if (errno == ENOSYS || errno == EPERM) {
+                 getrandom_works = 0;
+                 return 0;
+             }
++
+             if (errno == EAGAIN) {
+-                /* If we failed with EAGAIN, the entropy pool was
+-                 * uninitialized. In this case, we return failure to fall
+-                 * back to reading from /dev/urandom.
+-                 *
+-                 * Note: In this case the data read will not be random so
+-                 * should not be used for cryptographic purposes. Retaining
+-                 * the existing semantics for practical purposes. */
++                /* getrandom(GRND_NONBLOCK) fails with EAGAIN if the system
++                   urandom is not initialiazed yet. In this case, fall back on
++                   reading from /dev/urandom.
++
++                   Note: In this case the data read will not be random so
++                   should not be used for cryptographic purposes. Retaining
++                   the existing semantics for practical purposes. */
+                 getrandom_works = 0;
+                 return 0;
+             }
+ 
+             if (errno == EINTR) {
+-                if (PyErr_CheckSignals()) {
+-                    if (!raise)
+-                        Py_FatalError("getrandom() interrupted by a signal");
+-                    return -1;
++                if (raise) {
++                    if (PyErr_CheckSignals()) {
++                        return -1;
++                    }
+                 }
+-                /* retry getrandom() */
++
++                /* retry getrandom() if it was interrupted by a signal */
+                 continue;
+             }
+ 
+-            if (raise)
++            if (raise) {
+                 PyErr_SetFromErrno(PyExc_OSError);
+-            else
+-                Py_FatalError("getrandom() failed");
++            }
+             return -1;
+         }
+ 
+-        buffer += n;
++        dest += n;
+         size -= n;
+     }
+     return 1;
+ }
+-#endif
++
++#elif defined(HAVE_GETENTROPY)
++#define PY_GETENTROPY 1
++
++/* Fill buffer with size pseudo-random bytes generated by getentropy():
++
++   - Return 1 on success
++   - Return 0 if getentropy() syscall is not available (failed with ENOSYS or
++     EPERM).
++   - Raise an exception (if raise is non-zero) and return -1 on error:
++     if getentropy() failed with EINTR, raise is non-zero and the Python signal
++     handler raised an exception, or if getentropy() failed with a different
++     error.
++
++   getentropy() is retried if it failed with EINTR: interrupted by a signal. */
++static int
++py_getentropy(char *buffer, Py_ssize_t size, int raise)
++{
++    /* Is getentropy() supported by the running kernel? Set to 0 if
++       getentropy() failed with ENOSYS or EPERM. */
++    static int getentropy_works = 1;
++
++    if (!getentropy_works) {
++        return 0;
++    }
++
++    while (size > 0) {
++        /* getentropy() is limited to returning up to 256 bytes. Call it
++           multiple times if more bytes are requested. */
++        Py_ssize_t len = Py_MIN(size, 256);
++        int res;
++
++        if (raise) {
++            Py_BEGIN_ALLOW_THREADS
++            res = getentropy(buffer, len);
++            Py_END_ALLOW_THREADS
++        }
++        else {
++            res = getentropy(buffer, len);
++        }
++
++        if (res < 0) {
++            /* ENOSYS: the syscall is not supported by the running kernel.
++               EPERM: the syscall is blocked by a security policy (ex: SECCOMP)
++               or something else. */
++            if (errno == ENOSYS || errno == EPERM) {
++                getentropy_works = 0;
++                return 0;
++            }
++
++            if (errno == EINTR) {
++                if (raise) {
++                    if (PyErr_CheckSignals()) {
++                        return -1;
++                    }
++                }
++
++                /* retry getentropy() if it was interrupted by a signal */
++                continue;
++            }
++
++            if (raise) {
++                PyErr_SetFromErrno(PyExc_OSError);
++            }
++            return -1;
++        }
++
++        buffer += len;
++        size -= len;
++    }
++    return 1;
++}
++#endif /* defined(HAVE_GETENTROPY) && !defined(sun) */
++
+ 
+ static struct {
+     int fd;
+@@ -217,127 +273,123 @@ static struct {
+     ino_t st_ino;
+ } urandom_cache = { -1 };
+ 
++/* Read random bytes from the /dev/urandom device:
+ 
+-/* Read size bytes from /dev/urandom into buffer.
+-   Call Py_FatalError() on error. */
+-static void
+-dev_urandom_noraise(unsigned char *buffer, Py_ssize_t size)
+-{
+-    int fd;
+-    Py_ssize_t n;
++   - Return 0 on success
++   - Raise an exception (if raise is non-zero) and return -1 on error
+ 
+-    assert (0 < size);
++   Possible causes of errors:
+ 
+-#ifdef PY_GETRANDOM
+-    if (py_getrandom(buffer, size, 0) == 1)
+-        return;
+-    /* getrandom() is not supported by the running kernel, fall back
+-     * on reading /dev/urandom */
+-#endif
++   - open() failed with ENOENT, ENXIO, ENODEV, EACCES: the /dev/urandom device
++     was not found. For example, it was removed manually or not exposed in a
++     chroot or container.
++   - open() failed with a different error
++   - fstat() failed
++   - read() failed or returned 0
+ 
+-    fd = _Py_open_noraise("/dev/urandom", O_RDONLY);
+-    if (fd < 0)
+-        Py_FatalError("Failed to open /dev/urandom");
++   read() is retried if it failed with EINTR: interrupted by a signal.
+ 
+-    while (0 < size)
+-    {
+-        do {
+-            n = read(fd, buffer, (size_t)size);
+-        } while (n < 0 && errno == EINTR);
+-        if (n <= 0)
+-        {
+-            /* stop on error or if read(size) returned 0 */
+-            Py_FatalError("Failed to read bytes from /dev/urandom");
+-            break;
+-        }
+-        buffer += n;
+-        size -= (Py_ssize_t)n;
+-    }
+-    close(fd);
+-}
++   The file descriptor of the device is kept open between calls to avoid using
++   many file descriptors when run in parallel from multiple threads:
++   see the issue #18756.
++
++   st_dev and st_ino fields of the file descriptor (from fstat()) are cached to
++   check if the file descriptor was replaced by a different file (which is
++   likely a bug in the application): see the issue #21207.
+ 
+-/* Read size bytes from /dev/urandom into buffer.
+-   Return 0 on success, raise an exception and return -1 on error. */
++   If the file descriptor was closed or replaced, open a new file descriptor
++   but don't close the old file descriptor: it probably points to something
++   important for some third-party code. */
+ static int
+-dev_urandom_python(char *buffer, Py_ssize_t size)
++dev_urandom(char *buffer, Py_ssize_t size, int raise)
+ {
+     int fd;
+     Py_ssize_t n;
+-    struct _Py_stat_struct st;
+-#ifdef PY_GETRANDOM
+-    int res;
+-#endif
+ 
+-    if (size <= 0)
+-        return 0;
++    if (raise) {
++        struct _Py_stat_struct st;
+ 
+-#ifdef PY_GETRANDOM
+-    res = py_getrandom(buffer, size, 1);
+-    if (res < 0)
+-        return -1;
+-    if (res == 1)
+-        return 0;
+-    /* getrandom() is not supported by the running kernel, fall back
+-     * on reading /dev/urandom */
+-#endif
+-
+-    if (urandom_cache.fd >= 0) {
+-        /* Does the fd point to the same thing as before? (issue #21207) */
+-        if (_Py_fstat_noraise(urandom_cache.fd, &st)
+-            || st.st_dev != urandom_cache.st_dev
+-            || st.st_ino != urandom_cache.st_ino) {
+-            /* Something changed: forget the cached fd (but don't close it,
+-               since it probably points to something important for some
+-               third-party code). */
+-            urandom_cache.fd = -1;
+-        }
+-    }
+-    if (urandom_cache.fd >= 0)
+-        fd = urandom_cache.fd;
+-    else {
+-        fd = _Py_open("/dev/urandom", O_RDONLY);
+-        if (fd < 0) {
+-            if (errno == ENOENT || errno == ENXIO ||
+-                errno == ENODEV || errno == EACCES)
+-                PyErr_SetString(PyExc_NotImplementedError,
+-                                "/dev/urandom (or equivalent) not found");
+-            /* otherwise, keep the OSError exception raised by _Py_open() */
+-            return -1;
+-        }
+         if (urandom_cache.fd >= 0) {
+-            /* urandom_fd was initialized by another thread while we were
+-               not holding the GIL, keep it. */
+-            close(fd);
+-            fd = urandom_cache.fd;
++            /* Does the fd point to the same thing as before? (issue #21207) */
++            if (_Py_fstat_noraise(urandom_cache.fd, &st)
++                || st.st_dev != urandom_cache.st_dev
++                || st.st_ino != urandom_cache.st_ino) {
++                /* Something changed: forget the cached fd (but don't close it,
++                   since it probably points to something important for some
++                   third-party code). */
++                urandom_cache.fd = -1;
++            }
+         }
++        if (urandom_cache.fd >= 0)
++            fd = urandom_cache.fd;
+         else {
+-            if (_Py_fstat(fd, &st)) {
+-                close(fd);
++            fd = _Py_open("/dev/urandom", O_RDONLY);
++            if (fd < 0) {
++                if (errno == ENOENT || errno == ENXIO ||
++                    errno == ENODEV || errno == EACCES) {
++                    PyErr_SetString(PyExc_NotImplementedError,
++                                    "/dev/urandom (or equivalent) not found");
++                }
++                /* otherwise, keep the OSError exception raised by _Py_open() */
+                 return -1;
+             }
++            if (urandom_cache.fd >= 0) {
++                /* urandom_fd was initialized by another thread while we were
++                   not holding the GIL, keep it. */
++                close(fd);
++                fd = urandom_cache.fd;
++            }
+             else {
+-                urandom_cache.fd = fd;
+-                urandom_cache.st_dev = st.st_dev;
+-                urandom_cache.st_ino = st.st_ino;
++                if (_Py_fstat(fd, &st)) {
++                    close(fd);
++                    return -1;
++                }
++                else {
++                    urandom_cache.fd = fd;
++                    urandom_cache.st_dev = st.st_dev;
++                    urandom_cache.st_ino = st.st_ino;
++                }
+             }
+         }
+-    }
+ 
+-    do {
+-        n = _Py_read(fd, buffer, (size_t)size);
+-        if (n == -1)
+-            return -1;
+-        if (n == 0) {
+-            PyErr_Format(PyExc_RuntimeError,
+-                    "Failed to read %zi bytes from /dev/urandom",
+-                    size);
++        do {
++            n = _Py_read(fd, buffer, (size_t)size);
++            if (n == -1)
++                return -1;
++            if (n == 0) {
++                PyErr_Format(PyExc_RuntimeError,
++                        "Failed to read %zi bytes from /dev/urandom",
++                        size);
++                return -1;
++            }
++
++            buffer += n;
++            size -= n;
++        } while (0 < size);
++    }
++    else {
++        fd = _Py_open_noraise("/dev/urandom", O_RDONLY);
++        if (fd < 0) {
+             return -1;
+         }
+ 
+-        buffer += n;
+-        size -= n;
+-    } while (0 < size);
++        while (0 < size)
++        {
++            do {
++                n = read(fd, buffer, (size_t)size);
++            } while (n < 0 && errno == EINTR);
+ 
++            if (n <= 0) {
++                /* stop on error or if read(size) returned 0 */
++                close(fd);
++                return -1;
++            }
++
++            buffer += n;
++            size -= n;
++        }
++        close(fd);
++    }
+     return 0;
+ }
+ 
+@@ -349,8 +401,8 @@ dev_urandom_close(void)
+         urandom_cache.fd = -1;
+     }
+ }
++#endif /* !MS_WINDOWS */
+ 
+-#endif
+ 
+ /* Fill buffer with pseudo-random bytes generated by a linear congruent
+    generator (LCG):
+@@ -373,29 +425,98 @@ lcg_urandom(unsigned int x0, unsigned ch
+     }
+ }
+ 
+-/* Fill buffer with size pseudo-random bytes from the operating system random
+-   number generator (RNG). It is suitable for most cryptographic purposes
+-   except long living private keys for asymmetric encryption.
++/* Read random bytes:
+ 
+-   Return 0 on success, raise an exception and return -1 on error. */
+-int
+-_PyOS_URandom(void *buffer, Py_ssize_t size)
++   - Return 0 on success
++   - Raise an exception (if raise is non-zero) and return -1 on error
++
++   Used sources of entropy ordered by preference, preferred source first:
++
++   - CryptGenRandom() on Windows
++   - getrandom() function (ex: Linux and Solaris): call py_getrandom()
++   - getentropy() function (ex: OpenBSD): call py_getentropy()
++   - /dev/urandom device
++
++   Read from the /dev/urandom device if getrandom() or getentropy() function
++   is not available or does not work.
++
++   Prefer getrandom() over getentropy() because getrandom() supports blocking
++   and non-blocking mode and Python requires non-blocking RNG at startup to
++   initialize its hash secret: see the PEP 524.
++
++   Prefer getrandom() and getentropy() over reading directly /dev/urandom
++   because these functions don't need file descriptors and so avoid ENFILE or
++   EMFILE errors (too many open files): see the issue #18756.
++
++   Only use RNG running in the kernel. They are more secure because it is
++   harder to get the internal state of a RNG running in the kernel land than a
++   RNG running in the user land. The kernel has a direct access to the hardware
++   and has access to hardware RNG, they are used as entropy sources.
++
++   Note: the OpenSSL RAND_pseudo_bytes() function does not automatically reseed
++   its RNG on fork(), two child processes (with the same pid) generate the same
++   random numbers: see issue #18747. Kernel RNGs don't have this issue,
++   they have access to good quality entropy sources.
++
++   If raise is zero:
++
++   - Don't raise an exception on error
++   - Don't call the Python signal handler (don't call PyErr_CheckSignals()) if
++     a function fails with EINTR: retry directly the interrupted function
++   - Don't release the GIL to call functions.
++*/
++static int
++pyurandom(void *buffer, Py_ssize_t size, int raise)
+ {
++#if defined(PY_GETRANDOM) || defined(PY_GETENTROPY)
++    int res;
++#endif
++
+     if (size < 0) {
+-        PyErr_Format(PyExc_ValueError,
+-                     "negative argument not allowed");
++        if (raise) {
++            PyErr_Format(PyExc_ValueError,
++                         "negative argument not allowed");
++        }
+         return -1;
+     }
+-    if (size == 0)
++
++    if (size == 0) {
+         return 0;
++    }
+ 
+ #ifdef MS_WINDOWS
+-    return win32_urandom((unsigned char *)buffer, size, 1);
+-#elif defined(PY_GETENTROPY)
+-    return py_getentropy(buffer, size, 0);
++    return win32_urandom((unsigned char *)buffer, size, raise);
++#else
++
++#if defined(PY_GETRANDOM) || defined(PY_GETENTROPY)
++#ifdef PY_GETRANDOM
++    res = py_getrandom(buffer, size, raise);
+ #else
+-    return dev_urandom_python((char*)buffer, size);
++    res = py_getentropy(buffer, size, raise);
+ #endif
++    if (res < 0) {
++        return -1;
++    }
++    if (res == 1) {
++        return 0;
++    }
++    /* getrandom() or getentropy() function is not available: failed with
++       ENOSYS, EPERM or EAGAIN. Fall back on reading from /dev/urandom. */
++#endif
++
++    return dev_urandom(buffer, size, raise);
++#endif
++}
++
++/* Fill buffer with size pseudo-random bytes from the operating system random
++   number generator (RNG). It is suitable for most cryptographic purposes
++   except long living private keys for asymmetric encryption.
++
++   Return 0 on success. Raise an exception and return -1 on error. */
++int
++_PyOS_URandom(void *buffer, Py_ssize_t size)
++{
++    return pyurandom(buffer, size, 1);
+ }
+ 
+ void
+@@ -436,13 +557,14 @@ _PyRandom_Init(void)
+         }
+     }
+     else {
+-#ifdef MS_WINDOWS
+-        (void)win32_urandom(secret, secret_size, 0);
+-#elif defined(PY_GETENTROPY)
+-        (void)py_getentropy(secret, secret_size, 1);
+-#else
+-        dev_urandom_noraise(secret, secret_size);
+-#endif
++        int res;
++
++        /* _PyRandom_Init() is called very early in the Python initialization
++           and so exceptions cannot be used (use raise=0). */
++        res = pyurandom(secret, secret_size, 0);
++        if (res < 0) {
++            Py_FatalError("failed to get random numbers to initialize Python");
++        }
+     }
+ }
+ 
+@@ -454,8 +576,6 @@ _PyRandom_Fini(void)
+         CryptReleaseContext(hCryptProv, 0);
+         hCryptProv = 0;
+     }
+-#elif defined(PY_GETENTROPY)
+-    /* nothing to clean */
+ #else
+     dev_urandom_close();
+ #endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch
deleted file mode 100644
index 70708a0..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-
-Upstream-Status: Inappropriate [embedded specific] 
-  
-The binary _freeze_importlib is built and also used during build time to generate
-importlib*.h files, this is impossible to do on a cross-compile environment,
-this avoids executing the binary and forces it to use the packed importlib*.h files.
-
- 
-Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> 
-
-Index: Python-3.5.0/Makefile.pre.in
-===================================================================
---- Python-3.5.0.orig/Makefile.pre.in
-+++ Python-3.5.0/Makefile.pre.in
-@@ -700,12 +700,12 @@ Programs/_freeze_importlib.o: Programs/_
- Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
- 	$(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
- 
--Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
--	./Programs/_freeze_importlib \
-+#Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
-+#	./Programs/_freeze_importlib \
- 		$(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h
- 
--Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib
--	./Programs/_freeze_importlib \
-+#Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib
-+#	./Programs/_freeze_importlib \
- 		$(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h
- 
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.2.bb
index e6cbb9c..2ff7c9e 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.2.bb
@@ -9,7 +9,6 @@
 SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
 file://python-config.patch \
 file://000-cross-compile.patch \
-file://020-dont-compile-python-files.patch \
 file://030-fixup-include-dirs.patch \
 file://070-dont-clean-ipkg-install.patch \
 file://080-distutils-dont_adjust_files.patch \
@@ -37,6 +36,7 @@
             file://setup.py-find-libraries-in-staging-dirs.patch \
             file://configure.ac-fix-LIBPL.patch \
             file://python3-fix-CVE-2016-1000110.patch \
+            file://upstream-random-fixes.patch \
            "
 SRC_URI[md5sum] = "8906efbacfcdc7c3c9198aeefafd159e"
 SRC_URI[sha256sum] = "0010f56100b9b74259ebcd5d4b295a32324b58b517403a10d1a2aa7cb22bca40"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.12.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.12.bb
deleted file mode 100644
index 9fe35db..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.12.bb
+++ /dev/null
@@ -1,171 +0,0 @@
-require python.inc
-DEPENDS = "python-native libffi bzip2 db gdbm openssl readline sqlite3 zlib"
-PR = "${INC_PR}"
-
-DISTRO_SRC_URI ?= "file://sitecustomize.py"
-DISTRO_SRC_URI_linuxstdbase = ""
-SRC_URI += "\
-  file://01-use-proper-tools-for-cross-build.patch \
-  file://03-fix-tkinter-detection.patch \
-  file://06-avoid_usr_lib_termcap_path_in_linking.patch \
-  ${DISTRO_SRC_URI} \
-  file://multilib.patch \
-  file://cgi_py.patch \
-  file://setup_py_skip_cross_import_check.patch \
-  file://add-md5module-support.patch \
-  file://host_include_contamination.patch \
-  file://fix_for_using_different_libdir.patch \
-  file://setuptweaks.patch \
-  file://check-if-target-is-64b-not-host.patch \
-  file://search_db_h_in_inc_dirs_and_avoid_warning.patch \
-  file://avoid_warning_about_tkinter.patch \
-  file://avoid_warning_for_sunos_specific_module.patch \
-  file://python-2.7.3-remove-bsdb-rpath.patch \
-  file://fix-makefile-for-ptest.patch \
-  file://run-ptest \
-  file://parallel-makeinst-create-bindir.patch \
-  file://use_sysroot_ncurses_instead_of_host.patch \
-  file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
-  file://python-fix-CVE-2016-1000110.patch \
-"
-
-S = "${WORKDIR}/Python-${PV}"
-
-inherit autotools multilib_header python-dir pythonnative
-
-CONFIGUREOPTS += " --with-system-ffi "
-
-EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no"
-
-do_configure_append() {
-	rm -f ${S}/Makefile.orig
-        autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
-}
-
-do_compile() {
-        # regenerate platform specific files, because they depend on system headers
-        cd ${S}/Lib/plat-linux2
-        include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \
-                ${S}/Tools/scripts/h2py.py -i '(u_long)' \
-                ${STAGING_INCDIR}/dlfcn.h \
-                ${STAGING_INCDIR}/linux/cdrom.h \
-                ${STAGING_INCDIR}/netinet/in.h \
-                ${STAGING_INCDIR}/sys/types.h
-        sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
-        cd -
-
-	# remove any bogus LD_LIBRARY_PATH
-	sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
-
-	if [ ! -f Makefile.orig ]; then
-		install -m 0644 Makefile Makefile.orig
-	fi
-	sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \
-		-e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
-		-e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
-		-e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
-		-e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
-		-e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
-		-e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
-		Makefile
-	# save copy of it now, because if we do it in do_install and 
-	# then call do_install twice we get Makefile.orig == Makefile.sysroot
-	install -m 0644 Makefile Makefile.sysroot
-
-	export CROSS_COMPILE="${TARGET_PREFIX}"
-	export PYTHONBUILDDIR="${B}"
-
-	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
-		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
-		STAGING_LIBDIR=${STAGING_LIBDIR} \
-		STAGING_INCDIR=${STAGING_INCDIR} \
-		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
-		OPT="${CFLAGS}"
-}
-
-do_install() {
-	# make install needs the original Makefile, or otherwise the inclues would
-	# go to ${D}${STAGING...}/...
-	install -m 0644 Makefile.orig Makefile
-
-	export CROSS_COMPILE="${TARGET_PREFIX}"
-	export PYTHONBUILDDIR="${B}"
-
-	# After swizzling the makefile, we need to run the build again.
-	# install can race with the build so we have to run this first, then install
-	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
-		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
-		CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
-		STAGING_LIBDIR=${STAGING_LIBDIR} \
-		STAGING_INCDIR=${STAGING_INCDIR} \
-		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
-		DESTDIR=${D} LIBDIR=${libdir}
-	
-	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
-		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
-		CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
-		STAGING_LIBDIR=${STAGING_LIBDIR} \
-		STAGING_INCDIR=${STAGING_INCDIR} \
-		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
-		DESTDIR=${D} LIBDIR=${libdir} install
-
-	install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
-
-	if [ -e ${WORKDIR}/sitecustomize.py ]; then
-		install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
-	fi
-
-	oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
-}
-
-do_install_append_class-nativesdk () {
-	create_wrapper ${D}${bindir}/python2.7 PYTHONHOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
-}
-
-SSTATE_SCAN_FILES += "Makefile"
-PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
-
-py_package_preprocess () {
-	# copy back the old Makefile to fix target package
-	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
-
-	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
-	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
-    python -m py_compile ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
-}
-
-require python-${PYTHON_MAJMIN}-manifest.inc
-
-# manual dependency additions
-RPROVIDES_${PN}-core = "${PN}"
-RRECOMMENDS_${PN}-core = "${PN}-readline"
-RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules"
-RRECOMMENDS_${PN}-crypt = "openssl"
-
-# package libpython2
-PACKAGES =+ "lib${BPN}2"
-FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
-
-# catch all the rest (unsorted)
-PACKAGES += "${PN}-misc"
-FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
-RDEPENDS_${PN}-modules += "${PN}-misc"
-RDEPENDS_${PN}-ptest = "${PN}-modules"
-#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
-inherit ptest
-
-# This must come after inherit ptest for the override to take effect
-do_install_ptest() {
-	cp ${B}/Makefile ${D}${PTEST_PATH}
-	sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \
-	 -e s:LIBDIR:${libdir}:g \
-	 -i ${D}${PTEST_PATH}/run-ptest
-}
-
-# catch manpage
-PACKAGES += "${PN}-man"
-FILES_${PN}-man = "${datadir}/man"
-
-BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.13.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.13.bb
new file mode 100644
index 0000000..4ef9952
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.13.bb
@@ -0,0 +1,171 @@
+require python.inc
+DEPENDS = "python-native libffi bzip2 db gdbm openssl readline sqlite3 zlib"
+PR = "${INC_PR}"
+
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI += "\
+  file://01-use-proper-tools-for-cross-build.patch \
+  file://03-fix-tkinter-detection.patch \
+  file://06-avoid_usr_lib_termcap_path_in_linking.patch \
+  ${DISTRO_SRC_URI} \
+  file://multilib.patch \
+  file://cgi_py.patch \
+  file://setup_py_skip_cross_import_check.patch \
+  file://add-md5module-support.patch \
+  file://host_include_contamination.patch \
+  file://fix_for_using_different_libdir.patch \
+  file://setuptweaks.patch \
+  file://check-if-target-is-64b-not-host.patch \
+  file://search_db_h_in_inc_dirs_and_avoid_warning.patch \
+  file://avoid_warning_about_tkinter.patch \
+  file://avoid_warning_for_sunos_specific_module.patch \
+  file://python-2.7.3-remove-bsdb-rpath.patch \
+  file://fix-makefile-for-ptest.patch \
+  file://run-ptest \
+  file://parallel-makeinst-create-bindir.patch \
+  file://use_sysroot_ncurses_instead_of_host.patch \
+  file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
+  file://Don-t-use-getentropy-on-Linux.patch \
+"
+
+S = "${WORKDIR}/Python-${PV}"
+
+inherit autotools multilib_header python-dir pythonnative
+
+CONFIGUREOPTS += " --with-system-ffi "
+
+EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no"
+
+do_configure_append() {
+	rm -f ${S}/Makefile.orig
+        autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_compile() {
+        # regenerate platform specific files, because they depend on system headers
+        cd ${S}/Lib/plat-linux2
+        include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \
+                ${S}/Tools/scripts/h2py.py -i '(u_long)' \
+                ${STAGING_INCDIR}/dlfcn.h \
+                ${STAGING_INCDIR}/linux/cdrom.h \
+                ${STAGING_INCDIR}/netinet/in.h \
+                ${STAGING_INCDIR}/sys/types.h
+        sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
+        cd -
+
+	# remove any bogus LD_LIBRARY_PATH
+	sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
+
+	if [ ! -f Makefile.orig ]; then
+		install -m 0644 Makefile Makefile.orig
+	fi
+	sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \
+		-e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
+		-e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
+		-e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
+		-e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
+		-e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
+		-e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
+		Makefile
+	# save copy of it now, because if we do it in do_install and 
+	# then call do_install twice we get Makefile.orig == Makefile.sysroot
+	install -m 0644 Makefile Makefile.sysroot
+
+	export CROSS_COMPILE="${TARGET_PREFIX}"
+	export PYTHONBUILDDIR="${B}"
+
+	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+		STAGING_LIBDIR=${STAGING_LIBDIR} \
+		STAGING_INCDIR=${STAGING_INCDIR} \
+		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+		OPT="${CFLAGS}"
+}
+
+do_install() {
+	# make install needs the original Makefile, or otherwise the inclues would
+	# go to ${D}${STAGING...}/...
+	install -m 0644 Makefile.orig Makefile
+
+	export CROSS_COMPILE="${TARGET_PREFIX}"
+	export PYTHONBUILDDIR="${B}"
+
+	# After swizzling the makefile, we need to run the build again.
+	# install can race with the build so we have to run this first, then install
+	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+		CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
+		STAGING_LIBDIR=${STAGING_LIBDIR} \
+		STAGING_INCDIR=${STAGING_INCDIR} \
+		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+		DESTDIR=${D} LIBDIR=${libdir}
+	
+	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+		CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
+		STAGING_LIBDIR=${STAGING_LIBDIR} \
+		STAGING_INCDIR=${STAGING_INCDIR} \
+		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+		DESTDIR=${D} LIBDIR=${libdir} install
+
+	install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+
+	if [ -e ${WORKDIR}/sitecustomize.py ]; then
+		install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+	fi
+
+	oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
+}
+
+do_install_append_class-nativesdk () {
+	create_wrapper ${D}${bindir}/python2.7 PYTHONHOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
+}
+
+SSTATE_SCAN_FILES += "Makefile"
+PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
+
+py_package_preprocess () {
+	# copy back the old Makefile to fix target package
+	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+
+	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
+	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+    python -m py_compile ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+}
+
+require python-${PYTHON_MAJMIN}-manifest.inc
+
+# manual dependency additions
+RPROVIDES_${PN}-core = "${PN}"
+RRECOMMENDS_${PN}-core = "${PN}-readline"
+RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules"
+RRECOMMENDS_${PN}-crypt = "openssl"
+
+# package libpython2
+PACKAGES =+ "lib${BPN}2"
+FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
+
+# catch all the rest (unsorted)
+PACKAGES += "${PN}-misc"
+FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
+RDEPENDS_${PN}-modules += "${PN}-misc"
+RDEPENDS_${PN}-ptest = "${PN}-modules"
+#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
+inherit ptest
+
+# This must come after inherit ptest for the override to take effect
+do_install_ptest() {
+	cp ${B}/Makefile ${D}${PTEST_PATH}
+	sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \
+	 -e s:LIBDIR:${libdir}:g \
+	 -i ${D}${PTEST_PATH}/run-ptest
+}
+
+# catch manpage
+PACKAGES += "${PN}-man"
+FILES_${PN}-man = "${datadir}/man"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
index 8d27c4d..27d5315 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
@@ -19,3 +19,7 @@
 	install -d ${D}${bindir}
 	install tunctl ${D}${bindir}/
 }
+
+RM_WORK_EXCLUDE_ITEMS += "recipe-sysroot-native"
+DEPENDS += "qemu-native"
+addtask addto_recipe_sysroot after do_populate_sysroot before do_build
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-targets.inc b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-targets.inc
index a3e46a8..66dd675 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-targets.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-targets.inc
@@ -4,8 +4,8 @@
 
 def get_qemu_target_list(d):
     import bb
-    archs = d.getVar('QEMU_TARGETS', True).split()
-    tos = d.getVar('HOST_OS', True)
+    archs = d.getVar('QEMU_TARGETS').split()
+    tos = d.getVar('HOST_OS')
     softmmuonly = ""
     for arch in ['ppcemb']:
         if arch in archs:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc
index b46e7f7..0e1411a 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc
@@ -3,35 +3,33 @@
 LICENSE = "GPLv2 & LGPLv2.1"
 DEPENDS = "glib-2.0 zlib pixman"
 RDEPENDS_${PN}_class-target += "bash"
-RDEPENDS_${PN}-ptest = "bash make"
 
 require qemu-targets.inc
-inherit autotools ptest
+inherit autotools pkgconfig bluetooth
 BBCLASSEXTEND = "native nativesdk"
 
-PR = "r1"
-
 # QEMU_TARGETS is overridable variable
 QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc sh4 x86_64"
 
-SRC_URI = "\
-    file://powerpc_rom.bin \
-    file://disable-grabs.patch \
-    file://exclude-some-arm-EABI-obsolete-syscalls.patch \
-    file://wacom.patch \
-    file://add-ptest-in-makefile.patch \
-    file://run-ptest \
-    file://0001-target-mips-add-24KEc-CPU-definition.patch \
+EXTRA_OECONF = " \
+    --prefix=${prefix} \
+    --bindir=${bindir} \
+    --includedir=${includedir} \
+    --libdir=${libdir} \
+    --mandir=${mandir} \
+    --datadir=${datadir} \
+    --docdir=${docdir}/${BPN} \
+    --sysconfdir=${sysconfdir} \
+    --libexecdir=${libexecdir} \
+    --localstatedir=${localstatedir} \
+    --with-confsuffix=/${BPN} \
+    --disable-strip \
+    --disable-werror \
+    --target-list=${@get_qemu_target_list(d)} \
+    --with-system-pixman \
+    --extra-cflags='${CFLAGS}' \
     "
-
-SRC_URI_append_class-native = "\
-    file://fix-libcap-header-issue-on-some-distro.patch \
-    file://cpus.c-qemu_cpu_kick_thread_debugging.patch \
-    "
-
-EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
-
-EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror"
+EXTRA_OECONF_append_class-native = " --python=${USRBINPATH}/python2.7"
 
 EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
 
@@ -52,38 +50,14 @@
 		"${S}"/Makefile "${S}"/Makefile.target
 }
 
-KVMENABLE = "--enable-kvm"
-KVMENABLE_darwin = "--disable-kvm"
-KVMENABLE_mingw32 = "--disable-kvm"
-
 do_configure() {
-    # Handle distros such as CentOS 5 32-bit that do not have kvm support
-    KVMOPTS="--disable-kvm"
-    if [ "${PN}" != "qemu-native" -a "${PN}" != "nativesdk-qemu" ] \
-       || [ -f /usr/include/linux/kvm.h ] ; then
-       KVMOPTS="${KVMENABLE}"
-    fi
-
-    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --libexecdir=${libexecdir} --localstatedir=${localstatedir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
+    ${S}/configure ${EXTRA_OECONF}
     test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
 }
 
-do_compile_ptest() {
-	make buildtest-TESTS
-}
-
-do_install_ptest() {
-	cp -rL ${B}/tests ${D}${PTEST_PATH}
-	find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
-
-	cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
-}
-
 do_install () {
 	export STRIP="true"
 	autotools_do_install
-	install -d ${D}${datadir}/qemu
-	install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
 }
 
 # The following fragment will create a wrapper for qemu-mips user emulation
@@ -102,11 +76,18 @@
 
 PACKAGECONFIG ??= " \
 	fdt sdl \
-	${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
-	${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen', '', d)} \
+	fdt sdl kvm \
+	${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \
 	"
-PACKAGECONFIG_class-native ??= "fdt alsa uuid"
-PACKAGECONFIG_class-nativesdk ??= "fdt sdl"
+PACKAGECONFIG_class-native ??= "fdt alsa kvm"
+PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm"
+
+# Handle distros such as CentOS 5 32-bit that do not have kvm support
+PACKAGECONFIG_class-native_remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}"
+
+# Disable kvm on targets that do not support it
+PACKAGECONFIG_remove_darwin = "kvm"
+PACKAGECONFIG_remove_mingw32 = "kvm"
 
 PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl"
 PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr,"
@@ -118,22 +99,22 @@
 PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng,"
 PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,libcurl,"
 PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss,"
-PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux,"
 PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
 PACKAGECONFIG[gtk+] = "--enable-gtk --with-gtkabi=3.0 --enable-vte,--disable-gtk --disable-vte,gtk+3 vte"
 PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
 PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2,"
-PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,gcrypt,"
+PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
 PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
 PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
 PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
-PACKAGECONFIG[alsa] = ",,alsa-lib"
+PACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib"
 PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa"
 PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
 PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
 PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
 PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
-
-EXTRA_OECONF += "${@bb.utils.contains('PACKAGECONFIG', 'alsa', '--audio-drv-list=oss,alsa', '', d)}"
+PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,${BLUEZ}"
+PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi"
+PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm"
 
 INSANE_SKIP_${PN} = "arch"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-Provide-support-for-the-CUSE-TPM.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-Provide-support-for-the-CUSE-TPM.patch
new file mode 100644
index 0000000..74dc6f5d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-Provide-support-for-the-CUSE-TPM.patch
@@ -0,0 +1,870 @@
+From 8737eef18f39ed087fd911d0a0886e8174d0468c Mon Sep 17 00:00:00 2001
+From: Stefan Berger <stefanb@linux.vnet.ibm.com>
+Date: Sat, 31 Dec 2016 11:23:32 -0500
+Subject: [PATCH 1/4] Provide support for the CUSE TPM
+
+Rather than integrating TPM functionality into QEMU directly
+using the TPM emulation of libtpms, we now integrate an external
+emulated TPM device. This device is expected to implement a Linux
+CUSE interface (CUSE = character device in userspace).
+
+QEMU talks to the CUSE TPM using much functionality of the
+passthrough driver. For example, the TPM commands and responses
+are sent to the CUSE TPM using the read()/write() interface.
+However, some out-of-band control needs to be done using the CUSE
+TPM's ioctls. The CUSE TPM currently defines and implements 15
+different ioctls for controlling certain life-cycle aspects of
+the emulated TPM. The ioctls can be regarded as a replacement for
+direct function calls to a TPM emulator if the TPM were to be
+directly integrated into QEMU.
+
+One of the ioctls allows to get a bitmask of supported capabilities.
+Each returned bit indicates which capabilities have been implemented.
+An include file defining the various ioctls is added to QEMU.
+
+The CUSE TPM and associated tools can be found here:
+
+https://github.com/stefanberger/swtpm
+
+(please use the latest version)
+
+To use the external CUSE TPM, the CUSE TPM should be started as follows:
+
+/usr/bin/swtpm_ioctl -s /dev/vtpm-test
+
+/usr/bin/swtpm_cuse -n vtpm-test
+
+QEMU can then be started using the following parameters:
+
+qemu-system-x86_64 \
+	[...] \
+        -tpmdev cuse-tpm,id=tpm0,cancel-path=/dev/null,path=/dev/vtpm-test \
+        -device tpm-tis,id=tpm0,tpmdev=tpm0 \
+	[...]
+
+Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
+Cc: Eric Blake <eblake@redhat.com>
+
+Conflicts:
+	docs/qmp-commands.txt
+
+Patch cherry-picked from https://github.com/stefanberger/qemu-tpm, branch v2.8.0+tpm,
+commit 27d6cd856d5a14061955df7a93ee490697a7a174. Applied cleanly except for
+docs/qmp-commands.txt which did not exist yet in qemu 2.7.
+
+Upstream-Status: Pending [https://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg00252.html]
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ hmp.c                    |   6 ++
+ hw/tpm/tpm_int.h         |   1 +
+ hw/tpm/tpm_ioctl.h       | 215 +++++++++++++++++++++++++++++++++++++
+ hw/tpm/tpm_passthrough.c | 274 +++++++++++++++++++++++++++++++++++++++++++++--
+ qapi-schema.json         |  18 +++-
+ qemu-options.hx          |  21 +++-
+ tpm.c                    |  11 +-
+ 7 files changed, 529 insertions(+), 17 deletions(-)
+ create mode 100644 hw/tpm/tpm_ioctl.h
+
+diff --git a/hmp.c b/hmp.c
+index cc2056e9e2..277b45ef5a 100644
+--- a/hmp.c
++++ b/hmp.c
+@@ -883,6 +883,12 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict)
+                            tpo->has_cancel_path ? ",cancel-path=" : "",
+                            tpo->has_cancel_path ? tpo->cancel_path : "");
+             break;
++        case TPM_TYPE_OPTIONS_KIND_CUSE_TPM:
++            tpo = ti->options->u.passthrough.data;
++            monitor_printf(mon, "%s%s",
++                           tpo->has_path ? ",path=" : "",
++                           tpo->has_path ? tpo->path : "");
++            break;
+         case TPM_TYPE_OPTIONS_KIND__MAX:
+             break;
+         }
+diff --git a/hw/tpm/tpm_int.h b/hw/tpm/tpm_int.h
+index f2f285b3cc..6b2c9c953a 100644
+--- a/hw/tpm/tpm_int.h
++++ b/hw/tpm/tpm_int.h
+@@ -61,6 +61,7 @@ struct tpm_resp_hdr {
+ #define TPM_TAG_RSP_AUTH1_COMMAND 0xc5
+ #define TPM_TAG_RSP_AUTH2_COMMAND 0xc6
+ 
++#define TPM_SUCCESS               0
+ #define TPM_FAIL                  9
+ 
+ #define TPM_ORD_ContinueSelfTest  0x53
+diff --git a/hw/tpm/tpm_ioctl.h b/hw/tpm/tpm_ioctl.h
+new file mode 100644
+index 0000000000..a341e15741
+--- /dev/null
++++ b/hw/tpm/tpm_ioctl.h
+@@ -0,0 +1,215 @@
++/*
++ * tpm_ioctl.h
++ *
++ * (c) Copyright IBM Corporation 2014, 2015.
++ *
++ * This file is licensed under the terms of the 3-clause BSD license
++ */
++#ifndef _TPM_IOCTL_H_
++#define _TPM_IOCTL_H_
++
++#include <stdint.h>
++#include <sys/uio.h>
++#include <sys/types.h>
++#include <sys/ioctl.h>
++
++/*
++ * Every response from a command involving a TPM command execution must hold
++ * the ptm_res as the first element.
++ * ptm_res corresponds to the error code of a command executed by the TPM.
++ */
++
++typedef uint32_t ptm_res;
++
++/* PTM_GET_TPMESTABLISHED: get the establishment bit */
++struct ptm_est {
++    union {
++        struct {
++            ptm_res tpm_result;
++            unsigned char bit; /* TPM established bit */
++        } resp; /* response */
++    } u;
++};
++
++/* PTM_RESET_TPMESTABLISHED: reset establishment bit */
++struct ptm_reset_est {
++    union {
++        struct {
++            uint8_t loc; /* locality to use */
++        } req; /* request */
++        struct {
++            ptm_res tpm_result;
++        } resp; /* response */
++    } u;
++};
++
++/* PTM_INIT */
++struct ptm_init {
++    union {
++        struct {
++            uint32_t init_flags; /* see definitions below */
++        } req; /* request */
++        struct {
++            ptm_res tpm_result;
++        } resp; /* response */
++    } u;
++};
++
++/* above init_flags */
++#define PTM_INIT_FLAG_DELETE_VOLATILE (1 << 0)
++    /* delete volatile state file after reading it */
++
++/* PTM_SET_LOCALITY */
++struct ptm_loc {
++    union {
++        struct {
++            uint8_t loc; /* locality to set */
++        } req; /* request */
++        struct {
++            ptm_res tpm_result;
++        } resp; /* response */
++    } u;
++};
++
++/* PTM_HASH_DATA: hash given data */
++struct ptm_hdata {
++    union {
++        struct {
++            uint32_t length;
++            uint8_t data[4096];
++        } req; /* request */
++        struct {
++            ptm_res tpm_result;
++        } resp; /* response */
++    } u;
++};
++
++/*
++ * size of the TPM state blob to transfer; x86_64 can handle 8k,
++ * ppc64le only ~7k; keep the response below a 4k page size
++ */
++#define PTM_STATE_BLOB_SIZE (3 * 1024)
++
++/*
++ * The following is the data structure to get state blobs from the TPM.
++ * If the size of the state blob exceeds the PTM_STATE_BLOB_SIZE, multiple reads
++ * with this ioctl and with adjusted offset are necessary. All bytes
++ * must be transferred and the transfer is done once the last byte has been
++ * returned.
++ * It is possible to use the read() interface for reading the data; however,
++ * the first bytes of the state blob will be part of the response to the ioctl();
++ * a subsequent read() is only necessary if the total length (totlength) exceeds
++ * the number of received bytes. seek() is not supported.
++ */
++struct ptm_getstate {
++    union {
++        struct {
++            uint32_t state_flags; /* may be: PTM_STATE_FLAG_DECRYPTED */
++            uint32_t type;        /* which blob to pull */
++            uint32_t offset;      /* offset from where to read */
++        } req; /* request */
++        struct {
++            ptm_res tpm_result;
++            uint32_t state_flags; /* may be: PTM_STATE_FLAG_ENCRYPTED */
++            uint32_t totlength;   /* total length that will be transferred */
++            uint32_t length;      /* number of bytes in following buffer */
++            uint8_t  data[PTM_STATE_BLOB_SIZE];
++        } resp; /* response */
++    } u;
++};
++
++/* TPM state blob types */
++#define PTM_BLOB_TYPE_PERMANENT  1
++#define PTM_BLOB_TYPE_VOLATILE   2
++#define PTM_BLOB_TYPE_SAVESTATE  3
++
++/* state_flags above : */
++#define PTM_STATE_FLAG_DECRYPTED     1 /* on input:  get decrypted state */
++#define PTM_STATE_FLAG_ENCRYPTED     2 /* on output: state is encrypted */
++
++/*
++ * The following is the data structure to set state blobs in the TPM.
++ * If the size of the state blob exceeds the PTM_STATE_BLOB_SIZE, multiple
++ * 'writes' using this ioctl are necessary. The last packet is indicated
++ * by the length being smaller than the PTM_STATE_BLOB_SIZE.
++ * The very first packet may have a length indicator of '0' enabling
++ * a write() with all the bytes from a buffer. If the write() interface
++ * is used, a final ioctl with a non-full buffer must be made to indicate
++ * that all data were transferred (a write with 0 bytes would not work).
++ */
++struct ptm_setstate {
++    union {
++        struct {
++            uint32_t state_flags; /* may be PTM_STATE_FLAG_ENCRYPTED */
++            uint32_t type;        /* which blob to set */
++            uint32_t length;      /* length of the data;
++                                     use 0 on the first packet to
++                                     transfer using write() */
++            uint8_t data[PTM_STATE_BLOB_SIZE];
++        } req; /* request */
++        struct {
++            ptm_res tpm_result;
++        } resp; /* response */
++    } u;
++};
++
++/*
++ * PTM_GET_CONFIG: Data structure to get runtime configuration information
++ * such as which keys are applied.
++ */
++struct ptm_getconfig {
++    union {
++        struct {
++            ptm_res tpm_result;
++            uint32_t flags;
++        } resp; /* response */
++    } u;
++};
++
++#define PTM_CONFIG_FLAG_FILE_KEY        0x1
++#define PTM_CONFIG_FLAG_MIGRATION_KEY   0x2
++
++
++typedef uint64_t ptm_cap;
++typedef struct ptm_est ptm_est;
++typedef struct ptm_reset_est ptm_reset_est;
++typedef struct ptm_loc ptm_loc;
++typedef struct ptm_hdata ptm_hdata;
++typedef struct ptm_init ptm_init;
++typedef struct ptm_getstate ptm_getstate;
++typedef struct ptm_setstate ptm_setstate;
++typedef struct ptm_getconfig ptm_getconfig;
++
++/* capability flags returned by PTM_GET_CAPABILITY */
++#define PTM_CAP_INIT               (1)
++#define PTM_CAP_SHUTDOWN           (1<<1)
++#define PTM_CAP_GET_TPMESTABLISHED (1<<2)
++#define PTM_CAP_SET_LOCALITY       (1<<3)
++#define PTM_CAP_HASHING            (1<<4)
++#define PTM_CAP_CANCEL_TPM_CMD     (1<<5)
++#define PTM_CAP_STORE_VOLATILE     (1<<6)
++#define PTM_CAP_RESET_TPMESTABLISHED (1<<7)
++#define PTM_CAP_GET_STATEBLOB      (1<<8)
++#define PTM_CAP_SET_STATEBLOB      (1<<9)
++#define PTM_CAP_STOP               (1<<10)
++#define PTM_CAP_GET_CONFIG         (1<<11)
++
++enum {
++    PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
++    PTM_INIT               = _IOWR('P', 1, ptm_init),
++    PTM_SHUTDOWN           = _IOR('P', 2, ptm_res),
++    PTM_GET_TPMESTABLISHED = _IOR('P', 3, ptm_est),
++    PTM_SET_LOCALITY       = _IOWR('P', 4, ptm_loc),
++    PTM_HASH_START         = _IOR('P', 5, ptm_res),
++    PTM_HASH_DATA          = _IOWR('P', 6, ptm_hdata),
++    PTM_HASH_END           = _IOR('P', 7, ptm_res),
++    PTM_CANCEL_TPM_CMD     = _IOR('P', 8, ptm_res),
++    PTM_STORE_VOLATILE     = _IOR('P', 9, ptm_res),
++    PTM_RESET_TPMESTABLISHED = _IOWR('P', 10, ptm_reset_est),
++    PTM_GET_STATEBLOB      = _IOWR('P', 11, ptm_getstate),
++    PTM_SET_STATEBLOB      = _IOWR('P', 12, ptm_setstate),
++    PTM_STOP               = _IOR('P', 13, ptm_res),
++    PTM_GET_CONFIG         = _IOR('P', 14, ptm_getconfig),
++};
++
++#endif /* _TPM_IOCTL_H */
+diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
+index e88c0d20bc..050f2ba850 100644
+--- a/hw/tpm/tpm_passthrough.c
++++ b/hw/tpm/tpm_passthrough.c
+@@ -33,6 +33,7 @@
+ #include "sysemu/tpm_backend_int.h"
+ #include "tpm_tis.h"
+ #include "tpm_util.h"
++#include "tpm_ioctl.h"
+ 
+ #define DEBUG_TPM 0
+ 
+@@ -45,6 +46,7 @@
+ #define TYPE_TPM_PASSTHROUGH "tpm-passthrough"
+ #define TPM_PASSTHROUGH(obj) \
+     OBJECT_CHECK(TPMPassthruState, (obj), TYPE_TPM_PASSTHROUGH)
++#define TYPE_TPM_CUSE "tpm-cuse"
+ 
+ static const TPMDriverOps tpm_passthrough_driver;
+ 
+@@ -71,12 +73,18 @@ struct TPMPassthruState {
+     bool had_startup_error;
+ 
+     TPMVersion tpm_version;
++    ptm_cap cuse_cap; /* capabilities of the CUSE TPM */
++    uint8_t cur_locty_number; /* last set locality */
+ };
+ 
+ typedef struct TPMPassthruState TPMPassthruState;
+ 
+ #define TPM_PASSTHROUGH_DEFAULT_DEVICE "/dev/tpm0"
+ 
++#define TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt) (tpm_pt->cuse_cap != 0)
++
++#define TPM_CUSE_IMPLEMENTS_ALL(S, cap) (((S)->cuse_cap & (cap)) == (cap))
++
+ /* functions */
+ 
+ static void tpm_passthrough_cancel_cmd(TPMBackend *tb);
+@@ -148,7 +156,28 @@ static bool tpm_passthrough_is_selftest(const uint8_t *in, uint32_t in_len)
+     return false;
+ }
+ 
++static int tpm_passthrough_set_locality(TPMPassthruState *tpm_pt,
++                                        uint8_t locty_number)
++{
++    ptm_loc loc;
++
++    if (TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt)) {
++        if (tpm_pt->cur_locty_number != locty_number) {
++            loc.u.req.loc = locty_number;
++            if (ioctl(tpm_pt->tpm_fd, PTM_SET_LOCALITY, &loc) < 0) {
++                error_report("tpm_cuse: could not set locality on "
++                             "CUSE TPM: %s",
++                             strerror(errno));
++                return -1;
++            }
++            tpm_pt->cur_locty_number = locty_number;
++        }
++    }
++    return 0;
++}
++
+ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
++                                        uint8_t locality_number,
+                                         const uint8_t *in, uint32_t in_len,
+                                         uint8_t *out, uint32_t out_len,
+                                         bool *selftest_done)
+@@ -157,6 +186,11 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
+     bool is_selftest;
+     const struct tpm_resp_hdr *hdr;
+ 
++    ret = tpm_passthrough_set_locality(tpm_pt, locality_number);
++    if (ret < 0) {
++        goto err_exit;
++    }
++
+     tpm_pt->tpm_op_canceled = false;
+     tpm_pt->tpm_executing = true;
+     *selftest_done = false;
+@@ -207,10 +241,12 @@ err_exit:
+ }
+ 
+ static int tpm_passthrough_unix_transfer(TPMPassthruState *tpm_pt,
++                                         uint8_t locality_number,
+                                          const TPMLocality *locty_data,
+                                          bool *selftest_done)
+ {
+     return tpm_passthrough_unix_tx_bufs(tpm_pt,
++                                        locality_number,
+                                         locty_data->w_buffer.buffer,
+                                         locty_data->w_offset,
+                                         locty_data->r_buffer.buffer,
+@@ -231,6 +267,7 @@ static void tpm_passthrough_worker_thread(gpointer data,
+     switch (cmd) {
+     case TPM_BACKEND_CMD_PROCESS_CMD:
+         tpm_passthrough_unix_transfer(tpm_pt,
++                                      thr_parms->tpm_state->locty_number,
+                                       thr_parms->tpm_state->locty_data,
+                                       &selftest_done);
+ 
+@@ -247,6 +284,93 @@ static void tpm_passthrough_worker_thread(gpointer data,
+ }
+ 
+ /*
++ * Gracefully shut down the external CUSE TPM
++ */
++static void tpm_passthrough_shutdown(TPMPassthruState *tpm_pt)
++{
++    ptm_res res;
++
++    if (TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt)) {
++        if (ioctl(tpm_pt->tpm_fd, PTM_SHUTDOWN, &res) < 0) {
++            error_report("tpm_cuse: Could not cleanly shut down "
++                         "the CUSE TPM: %s",
++                         strerror(errno));
++        }
++    }
++}
++
++/*
++ * Probe for the CUSE TPM by sending an ioctl() requesting its
++ * capability flags.
++ */
++static int tpm_passthrough_cuse_probe(TPMPassthruState *tpm_pt)
++{
++    int rc = 0;
++
++    if (ioctl(tpm_pt->tpm_fd, PTM_GET_CAPABILITY, &tpm_pt->cuse_cap) < 0) {
++        error_report("Error: CUSE TPM was requested, but probing failed");
++        rc = -1;
++    }
++
++    return rc;
++}
++
++static int tpm_passthrough_cuse_check_caps(TPMPassthruState *tpm_pt)
++{
++    int rc = 0;
++    ptm_cap caps = 0;
++    const char *tpm = NULL;
++
++    /* check for min. required capabilities */
++    switch (tpm_pt->tpm_version) {
++    case TPM_VERSION_1_2:
++        caps = PTM_CAP_INIT | PTM_CAP_SHUTDOWN | PTM_CAP_GET_TPMESTABLISHED |
++               PTM_CAP_SET_LOCALITY;
++        tpm = "1.2";
++        break;
++    case TPM_VERSION_2_0:
++        caps = PTM_CAP_INIT | PTM_CAP_SHUTDOWN | PTM_CAP_GET_TPMESTABLISHED |
++               PTM_CAP_SET_LOCALITY | PTM_CAP_RESET_TPMESTABLISHED;
++        tpm = "2";
++        break;
++    case TPM_VERSION_UNSPEC:
++        error_report("tpm_cuse: %s: TPM version has not been set",
++                     __func__);
++        return -1;
++    }
++
++    if (!TPM_CUSE_IMPLEMENTS_ALL(tpm_pt, caps)) {
++        error_report("tpm_cuse: TPM does not implement minimum set of required "
++                     "capabilities for TPM %s (0x%x)", tpm, (int)caps);
++        rc = -1;
++    }
++
++    return rc;
++}
++
++/*
++ * Initialize the external CUSE TPM
++ */
++static int tpm_passthrough_cuse_init(TPMPassthruState *tpm_pt)
++{
++    int rc = 0;
++    ptm_init init = {
++        .u.req.init_flags = PTM_INIT_FLAG_DELETE_VOLATILE,
++    };
++
++    if (TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt)) {
++        if (ioctl(tpm_pt->tpm_fd, PTM_INIT, &init) < 0) {
++            error_report("tpm_cuse: Detected CUSE TPM but could not "
++                         "send INIT: %s",
++                         strerror(errno));
++            rc = -1;
++        }
++    }
++
++    return rc;
++}
++
++/*
+  * Start the TPM (thread). If it had been started before, then terminate
+  * and start it again.
+  */
+@@ -261,6 +385,8 @@ static int tpm_passthrough_startup_tpm(TPMBackend *tb)
+                               tpm_passthrough_worker_thread,
+                               &tpm_pt->tpm_thread_params);
+ 
++    tpm_passthrough_cuse_init(tpm_pt);
++
+     return 0;
+ }
+ 
+@@ -291,14 +417,43 @@ static int tpm_passthrough_init(TPMBackend *tb, TPMState *s,
+ 
+ static bool tpm_passthrough_get_tpm_established_flag(TPMBackend *tb)
+ {
++    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
++    ptm_est est;
++
++    if (TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt)) {
++        if (ioctl(tpm_pt->tpm_fd, PTM_GET_TPMESTABLISHED, &est) < 0) {
++            error_report("tpm_cuse: Could not get the TPM established "
++                         "flag from the CUSE TPM: %s",
++                         strerror(errno));
++            return false;
++        }
++        return (est.u.resp.bit != 0);
++    }
+     return false;
+ }
+ 
+ static int tpm_passthrough_reset_tpm_established_flag(TPMBackend *tb,
+                                                       uint8_t locty)
+ {
++    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
++    int rc = 0;
++    ptm_reset_est ptmreset_est;
++
+     /* only a TPM 2.0 will support this */
+-    return 0;
++    if (tpm_pt->tpm_version == TPM_VERSION_2_0) {
++        if (TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt)) {
++            ptmreset_est.u.req.loc = tpm_pt->cur_locty_number;
++
++            if (ioctl(tpm_pt->tpm_fd, PTM_RESET_TPMESTABLISHED,
++                      &ptmreset_est) < 0) {
++                error_report("tpm_cuse: Could not reset the establishment bit "
++                             "failed: %s",
++                             strerror(errno));
++                rc = -1;
++            }
++        }
++    }
++    return rc;
+ }
+ 
+ static bool tpm_passthrough_get_startup_error(TPMBackend *tb)
+@@ -329,7 +484,8 @@ static void tpm_passthrough_deliver_request(TPMBackend *tb)
+ static void tpm_passthrough_cancel_cmd(TPMBackend *tb)
+ {
+     TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+-    int n;
++    ptm_res res;
++    static bool error_printed;
+ 
+     /*
+      * As of Linux 3.7 the tpm_tis driver does not properly cancel
+@@ -338,17 +494,34 @@ static void tpm_passthrough_cancel_cmd(TPMBackend *tb)
+      * command, e.g., a command executed on the host.
+      */
+     if (tpm_pt->tpm_executing) {
+-        if (tpm_pt->cancel_fd >= 0) {
+-            n = write(tpm_pt->cancel_fd, "-", 1);
+-            if (n != 1) {
+-                error_report("Canceling TPM command failed: %s",
+-                             strerror(errno));
+-            } else {
+-                tpm_pt->tpm_op_canceled = true;
++        if (TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt)) {
++            if (TPM_CUSE_IMPLEMENTS_ALL(tpm_pt, PTM_CAP_CANCEL_TPM_CMD)) {
++                if (ioctl(tpm_pt->tpm_fd, PTM_CANCEL_TPM_CMD, &res) < 0) {
++                    error_report("tpm_cuse: Could not cancel command on "
++                                 "CUSE TPM: %s",
++                                 strerror(errno));
++                } else if (res != TPM_SUCCESS) {
++                    if (!error_printed) {
++                        error_report("TPM error code from command "
++                                     "cancellation of CUSE TPM: 0x%x", res);
++                        error_printed = true;
++                    }
++                } else {
++                    tpm_pt->tpm_op_canceled = true;
++                }
+             }
+         } else {
+-            error_report("Cannot cancel TPM command due to missing "
+-                         "TPM sysfs cancel entry");
++            if (tpm_pt->cancel_fd >= 0) {
++                if (write(tpm_pt->cancel_fd, "-", 1) != 1) {
++                    error_report("Canceling TPM command failed: %s",
++                                 strerror(errno));
++                } else {
++                    tpm_pt->tpm_op_canceled = true;
++                }
++            } else {
++                error_report("Cannot cancel TPM command due to missing "
++                             "TPM sysfs cancel entry");
++            }
+         }
+     }
+ }
+@@ -378,6 +551,11 @@ static int tpm_passthrough_open_sysfs_cancel(TPMBackend *tb)
+     char *dev;
+     char path[PATH_MAX];
+ 
++    if (TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt)) {
++        /* not needed, but so we have a fd */
++        return qemu_open("/dev/null", O_WRONLY);
++    }
++
+     if (tb->cancel_path) {
+         fd = qemu_open(tb->cancel_path, O_WRONLY);
+         if (fd < 0) {
+@@ -412,12 +590,22 @@ static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb)
+ {
+     TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+     const char *value;
++    bool have_cuse = false;
++
++    value = qemu_opt_get(opts, "type");
++    if (value != NULL && !strcmp("cuse-tpm", value)) {
++        have_cuse = true;
++    }
+ 
+     value = qemu_opt_get(opts, "cancel-path");
+     tb->cancel_path = g_strdup(value);
+ 
+     value = qemu_opt_get(opts, "path");
+     if (!value) {
++        if (have_cuse) {
++            error_report("Missing path to access CUSE TPM");
++            goto err_free_parameters;
++        }
+         value = TPM_PASSTHROUGH_DEFAULT_DEVICE;
+     }
+ 
+@@ -432,15 +620,36 @@ static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb)
+         goto err_free_parameters;
+     }
+ 
++    tpm_pt->cur_locty_number = ~0;
++
++    if (have_cuse) {
++        if (tpm_passthrough_cuse_probe(tpm_pt)) {
++            goto err_close_tpmdev;
++        }
++        /* init TPM for probing */
++        if (tpm_passthrough_cuse_init(tpm_pt)) {
++            goto err_close_tpmdev;
++        }
++    }
++
+     if (tpm_util_test_tpmdev(tpm_pt->tpm_fd, &tpm_pt->tpm_version)) {
+         error_report("'%s' is not a TPM device.",
+                      tpm_pt->tpm_dev);
+         goto err_close_tpmdev;
+     }
+ 
++    if (have_cuse) {
++        if (tpm_passthrough_cuse_check_caps(tpm_pt)) {
++            goto err_close_tpmdev;
++        }
++    }
++
++
+     return 0;
+ 
+  err_close_tpmdev:
++    tpm_passthrough_shutdown(tpm_pt);
++
+     qemu_close(tpm_pt->tpm_fd);
+     tpm_pt->tpm_fd = -1;
+ 
+@@ -491,6 +700,8 @@ static void tpm_passthrough_destroy(TPMBackend *tb)
+ 
+     tpm_backend_thread_end(&tpm_pt->tbt);
+ 
++    tpm_passthrough_shutdown(tpm_pt);
++
+     qemu_close(tpm_pt->tpm_fd);
+     qemu_close(tpm_pt->cancel_fd);
+ 
+@@ -564,3 +775,44 @@ static void tpm_passthrough_register(void)
+ }
+ 
+ type_init(tpm_passthrough_register)
++
++/* CUSE TPM */
++static const char *tpm_passthrough_cuse_create_desc(void)
++{
++    return "CUSE TPM backend driver";
++}
++
++static const TPMDriverOps tpm_cuse_driver = {
++    .type                     = TPM_TYPE_CUSE_TPM,
++    .opts                     = tpm_passthrough_cmdline_opts,
++    .desc                     = tpm_passthrough_cuse_create_desc,
++    .create                   = tpm_passthrough_create,
++    .destroy                  = tpm_passthrough_destroy,
++    .init                     = tpm_passthrough_init,
++    .startup_tpm              = tpm_passthrough_startup_tpm,
++    .realloc_buffer           = tpm_passthrough_realloc_buffer,
++    .reset                    = tpm_passthrough_reset,
++    .had_startup_error        = tpm_passthrough_get_startup_error,
++    .deliver_request          = tpm_passthrough_deliver_request,
++    .cancel_cmd               = tpm_passthrough_cancel_cmd,
++    .get_tpm_established_flag = tpm_passthrough_get_tpm_established_flag,
++    .reset_tpm_established_flag = tpm_passthrough_reset_tpm_established_flag,
++    .get_tpm_version          = tpm_passthrough_get_tpm_version,
++};
++
++static const TypeInfo tpm_cuse_info = {
++    .name = TYPE_TPM_CUSE,
++    .parent = TYPE_TPM_BACKEND,
++    .instance_size = sizeof(TPMPassthruState),
++    .class_init = tpm_passthrough_class_init,
++    .instance_init = tpm_passthrough_inst_init,
++    .instance_finalize = tpm_passthrough_inst_finalize,
++};
++
++static void tpm_cuse_register(void)
++{
++    type_register_static(&tpm_cuse_info);
++    tpm_register_driver(&tpm_cuse_driver);
++}
++
++type_init(tpm_cuse_register)
+diff --git a/qapi-schema.json b/qapi-schema.json
+index 5658723b37..53120d0f63 100644
+--- a/qapi-schema.json
++++ b/qapi-schema.json
+@@ -3522,10 +3522,12 @@
+ # An enumeration of TPM types
+ #
+ # @passthrough: TPM passthrough type
++# @cuse-tpm: CUSE TPM type
++#            Since: 2.6
+ #
+ # Since: 1.5
+ ##
+-{ 'enum': 'TpmType', 'data': [ 'passthrough' ] }
++{ 'enum': 'TpmType', 'data': [ 'passthrough', 'cuse-tpm' ] }
+ 
+ ##
+ # @query-tpm-types:
+@@ -3554,6 +3556,17 @@
+                                              '*cancel-path' : 'str'} }
+ 
+ ##
++# @TPMCuseOptions:
++#
++# Information about the CUSE TPM type
++#
++# @path: string describing the path used for accessing the TPM device
++#
++# Since: 2.6
++##
++{ 'struct': 'TPMCuseOptions', 'data': { 'path' : 'str'}}
++
++##
+ # @TpmTypeOptions:
+ #
+ # A union referencing different TPM backend types' configuration options
+@@ -3563,7 +3576,8 @@
+ # Since: 1.5
+ ##
+ { 'union': 'TpmTypeOptions',
+-   'data': { 'passthrough' : 'TPMPassthroughOptions' } }
++   'data': { 'passthrough' : 'TPMPassthroughOptions',
++             'cuse-tpm' : 'TPMCuseOptions' } }
+ 
+ ##
+ # @TpmInfo:
+diff --git a/qemu-options.hx b/qemu-options.hx
+index a71aaf8ea8..e0f1d8e676 100644
+--- a/qemu-options.hx
++++ b/qemu-options.hx
+@@ -2763,7 +2763,10 @@ DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
+     "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
+     "                use path to provide path to a character device; default is /dev/tpm0\n"
+     "                use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
+-    "                not provided it will be searched for in /sys/class/misc/tpm?/device\n",
++    "                not provided it will be searched for in /sys/class/misc/tpm?/device\n"
++    "-tpmdev cuse-tpm,id=id,path=path\n"
++    "                use path to provide path to a character device to talk to the\n"
++    "                TPM emulator providing a CUSE interface\n",
+     QEMU_ARCH_ALL)
+ STEXI
+ 
+@@ -2772,8 +2775,8 @@ The general form of a TPM device option is:
+ 
+ @item -tpmdev @var{backend} ,id=@var{id} [,@var{options}]
+ @findex -tpmdev
+-Backend type must be:
+-@option{passthrough}.
++Backend type must be either one of the following:
++@option{passthrough}, @option{cuse-tpm}.
+ 
+ The specific backend type will determine the applicable options.
+ The @code{-tpmdev} option creates the TPM backend and requires a
+@@ -2823,6 +2826,18 @@ To create a passthrough TPM use the following two options:
+ Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by
+ @code{tpmdev=tpm0} in the device option.
+ 
++@item -tpmdev cuse-tpm, id=@var{id}, path=@var{path}
++
++(Linux-host only) Enable access to a TPM emulator with a CUSE interface.
++
++@option{path} specifies the path to the CUSE TPM character device.
++
++To create a backend device accessing the CUSE TPM emulator using /dev/vtpm
++use the following two options:
++@example
++-tpmdev cuse-tpm,id=tpm0,path=/dev/vtpm -device tpm-tis,tpmdev=tpm0
++@end example
++
+ @end table
+ 
+ ETEXI
+diff --git a/tpm.c b/tpm.c
+index 9a7c7114d3..5ec2373286 100644
+--- a/tpm.c
++++ b/tpm.c
+@@ -25,7 +25,7 @@ static QLIST_HEAD(, TPMBackend) tpm_backends =
+ 
+ 
+ #define TPM_MAX_MODELS      1
+-#define TPM_MAX_DRIVERS     1
++#define TPM_MAX_DRIVERS     2
+ 
+ static TPMDriverOps const *be_drivers[TPM_MAX_DRIVERS] = {
+     NULL,
+@@ -272,6 +272,15 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv)
+             tpo->has_cancel_path = true;
+         }
+         break;
++    case TPM_TYPE_CUSE_TPM:
++        res->options->type = TPM_TYPE_OPTIONS_KIND_CUSE_TPM;
++        tpo = g_new0(TPMPassthroughOptions, 1);
++        res->options->u.passthrough.data = tpo;
++        if (drv->path) {
++            tpo->path = g_strdup(drv->path);
++            tpo->has_path = true;
++        }
++        break;
+     case TPM_TYPE__MAX:
+         break;
+     }
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-target-mips-add-24KEc-CPU-definition.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-target-mips-add-24KEc-CPU-definition.patch
deleted file mode 100644
index c4dbee7..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-target-mips-add-24KEc-CPU-definition.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 926bc194f918d46bd93557b15da8153b6a94a1d5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
-Date: Mon, 25 Jul 2016 23:58:22 +0100
-Subject: [PATCH] target-mips: add 24KEc CPU definition
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Define a new CPU definition supporting 24KEc cores, similar to
-the existing 24Kc, but with added support for DSP instructions
-and MIPS16e (and without FPU).
-
-Signed-off-by: André Draszik <git@andred.net>
----
-Upstream-Status: Submitted [http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg05778.html]
- target-mips/translate_init.c | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
-
-diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c
-index 39ed5c4..6ae23e4 100644
---- a/target-mips/translate_init.c
-+++ b/target-mips/translate_init.c
-@@ -256,6 +256,28 @@ static const mips_def_t mips_defs[] =
-         .mmu_type = MMU_TYPE_R4000,
-     },
-     {
-+        .name = "24KEc",
-+        .CP0_PRid = 0x00019600,
-+        .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) |
-+                       (MMU_TYPE_R4000 << CP0C0_MT),
-+        .CP0_Config1 = MIPS_CONFIG1 | (15 << CP0C1_MMU) |
-+                       (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) |
-+                       (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) |
-+                       (1 << CP0C1_CA),
-+        .CP0_Config2 = MIPS_CONFIG2,
-+        .CP0_Config3 = MIPS_CONFIG3 | (1 << CP0C3_DSPP) | (0 << CP0C3_VInt),
-+        .CP0_LLAddr_rw_bitmask = 0,
-+        .CP0_LLAddr_shift = 4,
-+        .SYNCI_Step = 32,
-+        .CCRes = 2,
-+        /* we have a DSP, but no FPU */
-+        .CP0_Status_rw_bitmask = 0x1378FF1F,
-+        .SEGBITS = 32,
-+        .PABITS = 32,
-+        .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP,
-+        .mmu_type = MMU_TYPE_R4000,
-+    },
-+    {
-         .name = "24Kf",
-         .CP0_PRid = 0x00019300,
-         .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) |
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-virtio-zero-vq-inuse-in-virtio_reset.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-virtio-zero-vq-inuse-in-virtio_reset.patch
deleted file mode 100644
index 86955d0..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-virtio-zero-vq-inuse-in-virtio_reset.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-Upstream-Status: Backport
-
-Supplementary fix of CVE-2016-5403 which is backported from:
-
-http://git.qemu.org/?p=qemu.git;a=commit;h=4b7f91e
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From 4b7f91ed0270a371e1933efa21ba600b6da23ab9 Mon Sep 17 00:00:00 2001
-From: Stefan Hajnoczi <stefanha@redhat.com>
-Date: Wed, 7 Sep 2016 11:51:25 -0400
-Subject: [PATCH] virtio: zero vq->inuse in virtio_reset()
-
-vq->inuse must be zeroed upon device reset like most other virtqueue
-fields.
-
-In theory, virtio_reset() just needs assert(vq->inuse == 0) since
-devices must clean up in-flight requests during reset (requests cannot
-not be leaked!).
-
-In practice, it is difficult to achieve vq->inuse == 0 across reset
-because balloon, blk, 9p, etc implement various different strategies for
-cleaning up requests.  Most devices call g_free(elem) directly without
-telling virtio.c that the VirtQueueElement is cleaned up.  Therefore
-vq->inuse is not decremented during reset.
-
-This patch zeroes vq->inuse and trusts that devices are not leaking
-VirtQueueElements across reset.
-
-I will send a follow-up series that refactors request life-cycle across
-all devices and converts vq->inuse = 0 into assert(vq->inuse == 0) but
-this more invasive approach is not appropriate for stable trees.
-
-Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-Cc: qemu-stable <qemu-stable@nongnu.org>
-Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
-Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-Reviewed-by: Ladi Prosek <lprosek@redhat.com>
----
- hw/virtio/virtio.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
-index 74c085c..e8a13a5 100644
---- a/hw/virtio/virtio.c
-+++ b/hw/virtio/virtio.c
-@@ -822,6 +822,7 @@ void virtio_reset(void *opaque)
-         vdev->vq[i].signalled_used_valid = false;
-         vdev->vq[i].notification = true;
-         vdev->vq[i].vring.num = vdev->vq[i].vring.num_default;
-+        vdev->vq[i].inuse = 0;
-     }
- }
- 
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0002-Introduce-condition-to-notify-waiters-of-completed-c.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0002-Introduce-condition-to-notify-waiters-of-completed-c.patch
new file mode 100644
index 0000000..c88c98e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0002-Introduce-condition-to-notify-waiters-of-completed-c.patch
@@ -0,0 +1,86 @@
+From b5ffd3aa4e9bd4edb09cc84c46f78da72697a946 Mon Sep 17 00:00:00 2001
+From: Stefan Berger <stefanb@linux.vnet.ibm.com>
+Date: Sat, 31 Dec 2016 11:23:32 -0500
+Subject: [PATCH 2/4] Introduce condition to notify waiters of completed
+ command
+
+Introduce a lock and a condition to notify anyone waiting for the completion
+of the execution of a TPM command by the backend (thread). The backend
+uses the condition to signal anyone waiting for command completion.
+We need to place the condition in two locations: one is invoked by the
+backend thread, the other by the bottom half thread.
+We will use the signalling to wait for command completion before VM
+suspend.
+
+Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
+
+Upstream-Status: Pending [https://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg00252.html]
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ hw/tpm/tpm_int.h |  3 +++
+ hw/tpm/tpm_tis.c | 14 ++++++++++++++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/hw/tpm/tpm_int.h b/hw/tpm/tpm_int.h
+index 6b2c9c953a..70be1ad8d9 100644
+--- a/hw/tpm/tpm_int.h
++++ b/hw/tpm/tpm_int.h
+@@ -30,6 +30,9 @@ struct TPMState {
+     char *backend;
+     TPMBackend *be_driver;
+     TPMVersion be_tpm_version;
++
++    QemuMutex state_lock;
++    QemuCond cmd_complete;
+ };
+ 
+ #define TPM(obj) OBJECT_CHECK(TPMState, (obj), TYPE_TPM_TIS)
+diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
+index 381e7266ea..14d9e83ea2 100644
+--- a/hw/tpm/tpm_tis.c
++++ b/hw/tpm/tpm_tis.c
+@@ -368,6 +368,8 @@ static void tpm_tis_receive_bh(void *opaque)
+     TPMTISEmuState *tis = &s->s.tis;
+     uint8_t locty = s->locty_number;
+ 
++    qemu_mutex_lock(&s->state_lock);
++
+     tpm_tis_sts_set(&tis->loc[locty],
+                     TPM_TIS_STS_VALID | TPM_TIS_STS_DATA_AVAILABLE);
+     tis->loc[locty].state = TPM_TIS_STATE_COMPLETION;
+@@ -384,6 +386,10 @@ static void tpm_tis_receive_bh(void *opaque)
+     tpm_tis_raise_irq(s, locty,
+                       TPM_TIS_INT_DATA_AVAILABLE | TPM_TIS_INT_STS_VALID);
+ #endif
++
++    /* notify of completed command */
++    qemu_cond_signal(&s->cmd_complete);
++    qemu_mutex_unlock(&s->state_lock);
+ }
+ 
+ /*
+@@ -403,6 +409,11 @@ static void tpm_tis_receive_cb(TPMState *s, uint8_t locty,
+         }
+     }
+ 
++    qemu_mutex_lock(&s->state_lock);
++    /* notify of completed command */
++    qemu_cond_signal(&s->cmd_complete);
++    qemu_mutex_unlock(&s->state_lock);
++
+     qemu_bh_schedule(tis->bh);
+ }
+ 
+@@ -1072,6 +1083,9 @@ static void tpm_tis_initfn(Object *obj)
+     memory_region_init_io(&s->mmio, OBJECT(s), &tpm_tis_memory_ops,
+                           s, "tpm-tis-mmio",
+                           TPM_TIS_NUM_LOCALITIES << TPM_TIS_LOCALITY_SHIFT);
++
++    qemu_mutex_init(&s->state_lock);
++    qemu_cond_init(&s->cmd_complete);
+ }
+ 
+ static void tpm_tis_class_init(ObjectClass *klass, void *data)
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0002-fix-CVE-2016-7423.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0002-fix-CVE-2016-7423.patch
deleted file mode 100644
index fdf58a3..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0002-fix-CVE-2016-7423.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-Upstream-Status: Backport
-
-Backport patch to fix CVE-2016-7423 from:
-
-http://git.qemu.org/?p=qemu.git;a=commit;h=670e56d3ed
-
-CVE: CVE-2016-7423
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From 670e56d3ed2918b3861d9216f2c0540d9e9ae0d5 Mon Sep 17 00:00:00 2001
-From: Li Qiang <liqiang6-s@360.cn>
-Date: Mon, 12 Sep 2016 18:14:11 +0530
-Subject: [PATCH] scsi: mptsas: use g_new0 to allocate MPTSASRequest object
-
-When processing IO request in mptsas, it uses g_new to allocate
-a 'req' object. If an error occurs before 'req->sreq' is
-allocated, It could lead to an OOB write in mptsas_free_request
-function. Use g_new0 to avoid it.
-
-Reported-by: Li Qiang <liqiang6-s@360.cn>
-Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
-Message-Id: <1473684251-17476-1-git-send-email-ppandit@redhat.com>
-Cc: qemu-stable@nongnu.org
-Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
----
- hw/scsi/mptsas.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
-index 0e0a22f..eaae1bb 100644
---- a/hw/scsi/mptsas.c
-+++ b/hw/scsi/mptsas.c
-@@ -304,7 +304,7 @@ static int mptsas_process_scsi_io_request(MPTSASState *s,
-         goto bad;
-     }
- 
--    req = g_new(MPTSASRequest, 1);
-+    req = g_new0(MPTSASRequest, 1);
-     QTAILQ_INSERT_TAIL(&s->pending, req, next);
-     req->scsi_io = *scsi_io;
-     req->dev = s;
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0003-Introduce-condition-in-TPM-backend-for-notification.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0003-Introduce-condition-in-TPM-backend-for-notification.patch
new file mode 100644
index 0000000..e58f019
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0003-Introduce-condition-in-TPM-backend-for-notification.patch
@@ -0,0 +1,79 @@
+From 732a8e046948fd62b32cd1dd76a6798eb1caf4d6 Mon Sep 17 00:00:00 2001
+From: Stefan Berger <stefanb@linux.vnet.ibm.com>
+Date: Sat, 31 Dec 2016 11:23:32 -0500
+Subject: [PATCH 3/4] Introduce condition in TPM backend for notification
+
+TPM backends will suspend independently of the frontends. Also
+here we need to be able to wait for the TPM command to have been
+completely processed.
+
+Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
+
+Upstream-Status: Pending [https://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg00252.html]
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ hw/tpm/tpm_passthrough.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
+index 050f2ba850..44739ebad2 100644
+--- a/hw/tpm/tpm_passthrough.c
++++ b/hw/tpm/tpm_passthrough.c
+@@ -75,6 +75,10 @@ struct TPMPassthruState {
+     TPMVersion tpm_version;
+     ptm_cap cuse_cap; /* capabilities of the CUSE TPM */
+     uint8_t cur_locty_number; /* last set locality */
++
++    QemuMutex state_lock;
++    QemuCond cmd_complete;  /* singnaled once tpm_busy is false */
++    bool tpm_busy;
+ };
+ 
+ typedef struct TPMPassthruState TPMPassthruState;
+@@ -274,6 +278,11 @@ static void tpm_passthrough_worker_thread(gpointer data,
+         thr_parms->recv_data_callback(thr_parms->tpm_state,
+                                       thr_parms->tpm_state->locty_number,
+                                       selftest_done);
++        /* result delivered */
++        qemu_mutex_lock(&tpm_pt->state_lock);
++        tpm_pt->tpm_busy = false;
++        qemu_cond_signal(&tpm_pt->cmd_complete);
++        qemu_mutex_unlock(&tpm_pt->state_lock);
+         break;
+     case TPM_BACKEND_CMD_INIT:
+     case TPM_BACKEND_CMD_END:
+@@ -401,6 +410,7 @@ static void tpm_passthrough_reset(TPMBackend *tb)
+     tpm_backend_thread_end(&tpm_pt->tbt);
+ 
+     tpm_pt->had_startup_error = false;
++    tpm_pt->tpm_busy = false;
+ }
+ 
+ static int tpm_passthrough_init(TPMBackend *tb, TPMState *s,
+@@ -478,6 +488,11 @@ static void tpm_passthrough_deliver_request(TPMBackend *tb)
+ {
+     TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+ 
++    /* TPM considered busy once TPM Request scheduled for processing */
++    qemu_mutex_lock(&tpm_pt->state_lock);
++    tpm_pt->tpm_busy = true;
++    qemu_mutex_unlock(&tpm_pt->state_lock);
++
+     tpm_backend_thread_deliver_request(&tpm_pt->tbt);
+ }
+ 
+@@ -746,6 +761,11 @@ static const TPMDriverOps tpm_passthrough_driver = {
+ 
+ static void tpm_passthrough_inst_init(Object *obj)
+ {
++    TPMBackend *tb = TPM_BACKEND(obj);
++    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
++
++    qemu_mutex_init(&tpm_pt->state_lock);
++    qemu_cond_init(&tpm_pt->cmd_complete);
+ }
+ 
+ static void tpm_passthrough_inst_finalize(Object *obj)
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0003-fix-CVE-2016-7908.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0003-fix-CVE-2016-7908.patch
deleted file mode 100644
index 05cc3d9..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0003-fix-CVE-2016-7908.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-Upstream-Status: Backport
-
-Backport patch to fix CVE-2016-7908 from:
-
-http://git.qemu.org/?p=qemu.git;a=commit;h=070c4b92b8c
-
-CVE: CVE-2016-7908
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From 070c4b92b8cd5390889716677a0b92444d6e087a Mon Sep 17 00:00:00 2001
-From: Prasad J Pandit <pjp@fedoraproject.org>
-Date: Thu, 22 Sep 2016 16:02:37 +0530
-Subject: [PATCH] net: mcf: limit buffer descriptor count
-
-ColdFire Fast Ethernet Controller uses buffer descriptors to manage
-data flow to/fro receive & transmit queues. While transmitting
-packets, it could continue to read buffer descriptors if a buffer
-descriptor has length of zero and has crafted values in bd.flags.
-Set upper limit to number of buffer descriptors.
-
-Reported-by: Li Qiang <liqiang6-s@360.cn>
-Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
-Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
-Signed-off-by: Jason Wang <jasowang@redhat.com>
----
- hw/net/mcf_fec.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/hw/net/mcf_fec.c b/hw/net/mcf_fec.c
-index 0ee8ad9..d31fea1 100644
---- a/hw/net/mcf_fec.c
-+++ b/hw/net/mcf_fec.c
-@@ -23,6 +23,7 @@ do { printf("mcf_fec: " fmt , ## __VA_ARGS__); } while (0)
- #define DPRINTF(fmt, ...) do {} while(0)
- #endif
- 
-+#define FEC_MAX_DESC 1024
- #define FEC_MAX_FRAME_SIZE 2032
- 
- typedef struct {
-@@ -149,7 +150,7 @@ static void mcf_fec_do_tx(mcf_fec_state *s)
-     uint32_t addr;
-     mcf_fec_bd bd;
-     int frame_size;
--    int len;
-+    int len, descnt = 0;
-     uint8_t frame[FEC_MAX_FRAME_SIZE];
-     uint8_t *ptr;
- 
-@@ -157,7 +158,7 @@ static void mcf_fec_do_tx(mcf_fec_state *s)
-     ptr = frame;
-     frame_size = 0;
-     addr = s->tx_descriptor;
--    while (1) {
-+    while (descnt++ < FEC_MAX_DESC) {
-         mcf_fec_read_bd(&bd, addr);
-         DPRINTF("tx_bd %x flags %04x len %d data %08x\n",
-                 addr, bd.flags, bd.length, bd.data);
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0004-Add-support-for-VM-suspend-resume-for-TPM-TIS.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0004-Add-support-for-VM-suspend-resume-for-TPM-TIS.patch
new file mode 100644
index 0000000..b8a783d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0004-Add-support-for-VM-suspend-resume-for-TPM-TIS.patch
@@ -0,0 +1,719 @@
+From 5e9dd9063f514447ea4f54046793f4f01c297ed4 Mon Sep 17 00:00:00 2001
+From: Stefan Berger <stefanb@linux.vnet.ibm.com>
+Date: Sat, 31 Dec 2016 11:23:32 -0500
+Subject: [PATCH 4/4] Add support for VM suspend/resume for TPM TIS
+
+Extend the TPM TIS code to support suspend/resume. In case a command
+is being processed by the external TPM when suspending, wait for the command
+to complete to catch the result. In case the bottom half did not run,
+run the one function the bottom half is supposed to run. This then
+makes the resume operation work.
+
+The passthrough backend does not support suspend/resume operation
+and is therefore blocked from suspend/resume and migration.
+
+The CUSE TPM's supported capabilities are tested and if sufficient
+capabilities are implemented, suspend/resume, snapshotting and
+migration are supported by the CUSE TPM.
+
+Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
+
+Upstream-Status: Pending [https://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg00252.html]
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ hw/tpm/tpm_passthrough.c     | 130 +++++++++++++++++++++++--
+ hw/tpm/tpm_tis.c             | 137 +++++++++++++++++++++++++-
+ hw/tpm/tpm_tis.h             |   2 +
+ hw/tpm/tpm_util.c            | 223 +++++++++++++++++++++++++++++++++++++++++++
+ hw/tpm/tpm_util.h            |   7 ++
+ include/sysemu/tpm_backend.h |  12 +++
+ 6 files changed, 503 insertions(+), 8 deletions(-)
+
+diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
+index 44739ebad2..bc8072d0bc 100644
+--- a/hw/tpm/tpm_passthrough.c
++++ b/hw/tpm/tpm_passthrough.c
+@@ -34,6 +34,8 @@
+ #include "tpm_tis.h"
+ #include "tpm_util.h"
+ #include "tpm_ioctl.h"
++#include "migration/migration.h"
++#include "qapi/error.h"
+ 
+ #define DEBUG_TPM 0
+ 
+@@ -49,6 +51,7 @@
+ #define TYPE_TPM_CUSE "tpm-cuse"
+ 
+ static const TPMDriverOps tpm_passthrough_driver;
++static const VMStateDescription vmstate_tpm_cuse;
+ 
+ /* data structures */
+ typedef struct TPMPassthruThreadParams {
+@@ -79,6 +82,10 @@ struct TPMPassthruState {
+     QemuMutex state_lock;
+     QemuCond cmd_complete;  /* singnaled once tpm_busy is false */
+     bool tpm_busy;
++
++    Error *migration_blocker;
++
++    TPMBlobBuffers tpm_blobs;
+ };
+ 
+ typedef struct TPMPassthruState TPMPassthruState;
+@@ -306,6 +313,10 @@ static void tpm_passthrough_shutdown(TPMPassthruState *tpm_pt)
+                          strerror(errno));
+         }
+     }
++    if (tpm_pt->migration_blocker) {
++        migrate_del_blocker(tpm_pt->migration_blocker);
++        error_free(tpm_pt->migration_blocker);
++    }
+ }
+ 
+ /*
+@@ -360,12 +371,14 @@ static int tpm_passthrough_cuse_check_caps(TPMPassthruState *tpm_pt)
+ /*
+  * Initialize the external CUSE TPM
+  */
+-static int tpm_passthrough_cuse_init(TPMPassthruState *tpm_pt)
++static int tpm_passthrough_cuse_init(TPMPassthruState *tpm_pt,
++                                     bool is_resume)
+ {
+     int rc = 0;
+-    ptm_init init = {
+-        .u.req.init_flags = PTM_INIT_FLAG_DELETE_VOLATILE,
+-    };
++    ptm_init init;
++    if (is_resume) {
++        init.u.req.init_flags = PTM_INIT_FLAG_DELETE_VOLATILE;
++    }
+ 
+     if (TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt)) {
+         if (ioctl(tpm_pt->tpm_fd, PTM_INIT, &init) < 0) {
+@@ -394,7 +407,7 @@ static int tpm_passthrough_startup_tpm(TPMBackend *tb)
+                               tpm_passthrough_worker_thread,
+                               &tpm_pt->tpm_thread_params);
+ 
+-    tpm_passthrough_cuse_init(tpm_pt);
++    tpm_passthrough_cuse_init(tpm_pt, false);
+ 
+     return 0;
+ }
+@@ -466,6 +479,32 @@ static int tpm_passthrough_reset_tpm_established_flag(TPMBackend *tb,
+     return rc;
+ }
+ 
++static int tpm_cuse_get_state_blobs(TPMBackend *tb,
++                                    bool decrypted_blobs,
++                                    TPMBlobBuffers *tpm_blobs)
++{
++    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
++
++    assert(TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt));
++
++    return tpm_util_cuse_get_state_blobs(tpm_pt->tpm_fd, decrypted_blobs,
++                                         tpm_blobs);
++}
++
++static int tpm_cuse_set_state_blobs(TPMBackend *tb,
++                                    TPMBlobBuffers *tpm_blobs)
++{
++    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
++
++    assert(TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt));
++
++    if (tpm_util_cuse_set_state_blobs(tpm_pt->tpm_fd, tpm_blobs)) {
++        return 1;
++    }
++
++    return tpm_passthrough_cuse_init(tpm_pt, true);
++}
++
+ static bool tpm_passthrough_get_startup_error(TPMBackend *tb)
+ {
+     TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+@@ -488,7 +527,7 @@ static void tpm_passthrough_deliver_request(TPMBackend *tb)
+ {
+     TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+ 
+-    /* TPM considered busy once TPM Request scheduled for processing */
++    /* TPM considered busy once TPM request scheduled for processing */
+     qemu_mutex_lock(&tpm_pt->state_lock);
+     tpm_pt->tpm_busy = true;
+     qemu_mutex_unlock(&tpm_pt->state_lock);
+@@ -601,6 +640,25 @@ static int tpm_passthrough_open_sysfs_cancel(TPMBackend *tb)
+     return fd;
+ }
+ 
++static void tpm_passthrough_block_migration(TPMPassthruState *tpm_pt)
++{
++    ptm_cap caps;
++
++    if (TPM_PASSTHROUGH_USES_CUSE_TPM(tpm_pt)) {
++        caps = PTM_CAP_GET_STATEBLOB | PTM_CAP_SET_STATEBLOB |
++               PTM_CAP_STOP;
++        if (!TPM_CUSE_IMPLEMENTS_ALL(tpm_pt, caps)) {
++            error_setg(&tpm_pt->migration_blocker,
++                       "Migration disabled: CUSE TPM lacks necessary capabilities");
++            migrate_add_blocker(tpm_pt->migration_blocker);
++        }
++    } else {
++        error_setg(&tpm_pt->migration_blocker,
++                   "Migration disabled: Passthrough TPM does not support migration");
++        migrate_add_blocker(tpm_pt->migration_blocker);
++    }
++}
++
+ static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb)
+ {
+     TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+@@ -642,7 +700,7 @@ static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb)
+             goto err_close_tpmdev;
+         }
+         /* init TPM for probing */
+-        if (tpm_passthrough_cuse_init(tpm_pt)) {
++        if (tpm_passthrough_cuse_init(tpm_pt, false)) {
+             goto err_close_tpmdev;
+         }
+     }
+@@ -659,6 +717,7 @@ static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb)
+         }
+     }
+ 
++    tpm_passthrough_block_migration(tpm_pt);
+ 
+     return 0;
+ 
+@@ -766,10 +825,13 @@ static void tpm_passthrough_inst_init(Object *obj)
+ 
+     qemu_mutex_init(&tpm_pt->state_lock);
+     qemu_cond_init(&tpm_pt->cmd_complete);
++
++    vmstate_register(NULL, -1, &vmstate_tpm_cuse, obj);
+ }
+ 
+ static void tpm_passthrough_inst_finalize(Object *obj)
+ {
++    vmstate_unregister(NULL, &vmstate_tpm_cuse, obj);
+ }
+ 
+ static void tpm_passthrough_class_init(ObjectClass *klass, void *data)
+@@ -802,6 +864,60 @@ static const char *tpm_passthrough_cuse_create_desc(void)
+     return "CUSE TPM backend driver";
+ }
+ 
++static void tpm_cuse_pre_save(void *opaque)
++{
++    TPMPassthruState *tpm_pt = opaque;
++    TPMBackend *tb = &tpm_pt->parent;
++
++     qemu_mutex_lock(&tpm_pt->state_lock);
++     /* wait for TPM to finish processing */
++     if (tpm_pt->tpm_busy) {
++        qemu_cond_wait(&tpm_pt->cmd_complete, &tpm_pt->state_lock);
++     }
++     qemu_mutex_unlock(&tpm_pt->state_lock);
++
++    /* get the decrypted state blobs from the TPM */
++    tpm_cuse_get_state_blobs(tb, TRUE, &tpm_pt->tpm_blobs);
++}
++
++static int tpm_cuse_post_load(void *opaque,
++                              int version_id __attribute__((unused)))
++{
++    TPMPassthruState *tpm_pt = opaque;
++    TPMBackend *tb = &tpm_pt->parent;
++
++    return tpm_cuse_set_state_blobs(tb, &tpm_pt->tpm_blobs);
++}
++
++static const VMStateDescription vmstate_tpm_cuse = {
++    .name = "cuse-tpm",
++    .version_id = 1,
++    .minimum_version_id = 0,
++    .minimum_version_id_old = 0,
++    .pre_save  = tpm_cuse_pre_save,
++    .post_load = tpm_cuse_post_load,
++    .fields = (VMStateField[]) {
++        VMSTATE_UINT32(tpm_blobs.permanent_flags, TPMPassthruState),
++        VMSTATE_UINT32(tpm_blobs.permanent.size, TPMPassthruState),
++        VMSTATE_VBUFFER_ALLOC_UINT32(tpm_blobs.permanent.buffer,
++                                     TPMPassthruState, 1, NULL, 0,
++                                     tpm_blobs.permanent.size),
++
++        VMSTATE_UINT32(tpm_blobs.volatil_flags, TPMPassthruState),
++        VMSTATE_UINT32(tpm_blobs.volatil.size, TPMPassthruState),
++        VMSTATE_VBUFFER_ALLOC_UINT32(tpm_blobs.volatil.buffer,
++                                     TPMPassthruState, 1, NULL, 0,
++                                     tpm_blobs.volatil.size),
++
++        VMSTATE_UINT32(tpm_blobs.savestate_flags, TPMPassthruState),
++        VMSTATE_UINT32(tpm_blobs.savestate.size, TPMPassthruState),
++        VMSTATE_VBUFFER_ALLOC_UINT32(tpm_blobs.savestate.buffer,
++                                     TPMPassthruState, 1, NULL, 0,
++                                     tpm_blobs.savestate.size),
++        VMSTATE_END_OF_LIST()
++    }
++};
++
+ static const TPMDriverOps tpm_cuse_driver = {
+     .type                     = TPM_TYPE_CUSE_TPM,
+     .opts                     = tpm_passthrough_cmdline_opts,
+diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
+index 14d9e83ea2..9b660cf737 100644
+--- a/hw/tpm/tpm_tis.c
++++ b/hw/tpm/tpm_tis.c
+@@ -368,6 +368,8 @@ static void tpm_tis_receive_bh(void *opaque)
+     TPMTISEmuState *tis = &s->s.tis;
+     uint8_t locty = s->locty_number;
+ 
++    tis->bh_scheduled = false;
++
+     qemu_mutex_lock(&s->state_lock);
+ 
+     tpm_tis_sts_set(&tis->loc[locty],
+@@ -415,6 +417,8 @@ static void tpm_tis_receive_cb(TPMState *s, uint8_t locty,
+     qemu_mutex_unlock(&s->state_lock);
+ 
+     qemu_bh_schedule(tis->bh);
++
++    tis->bh_scheduled = true;
+ }
+ 
+ /*
+@@ -1030,9 +1034,140 @@ static void tpm_tis_reset(DeviceState *dev)
+     tpm_tis_do_startup_tpm(s);
+ }
+ 
++
++/* persistent state handling */
++
++static void tpm_tis_pre_save(void *opaque)
++{
++    TPMState *s = opaque;
++    TPMTISEmuState *tis = &s->s.tis;
++    uint8_t locty = tis->active_locty;
++
++    DPRINTF("tpm_tis: suspend: locty = %d : r_offset = %d, w_offset = %d\n",
++            locty, tis->loc[0].r_offset, tis->loc[0].w_offset);
++#ifdef DEBUG_TIS
++    tpm_tis_dump_state(opaque, 0);
++#endif
++
++    qemu_mutex_lock(&s->state_lock);
++
++    /* wait for outstanding request to complete */
++    if (TPM_TIS_IS_VALID_LOCTY(locty) &&
++        tis->loc[locty].state == TPM_TIS_STATE_EXECUTION) {
++        /*
++         * If we get here when the bh is scheduled but did not run,
++         * we won't get notified...
++         */
++        if (!tis->bh_scheduled) {
++            /* backend thread to notify us */
++            qemu_cond_wait(&s->cmd_complete, &s->state_lock);
++        }
++        if (tis->loc[locty].state == TPM_TIS_STATE_EXECUTION) {
++            /* bottom half did not run - run its function */
++            qemu_mutex_unlock(&s->state_lock);
++            tpm_tis_receive_bh(opaque);
++            qemu_mutex_lock(&s->state_lock);
++        }
++    }
++
++    qemu_mutex_unlock(&s->state_lock);
++
++    /* copy current active read or write buffer into the buffer
++       written to disk */
++    if (TPM_TIS_IS_VALID_LOCTY(locty)) {
++        switch (tis->loc[locty].state) {
++        case TPM_TIS_STATE_RECEPTION:
++            memcpy(tis->buf,
++                   tis->loc[locty].w_buffer.buffer,
++                   MIN(sizeof(tis->buf),
++                       tis->loc[locty].w_buffer.size));
++            tis->offset = tis->loc[locty].w_offset;
++        break;
++        case TPM_TIS_STATE_COMPLETION:
++            memcpy(tis->buf,
++                   tis->loc[locty].r_buffer.buffer,
++                   MIN(sizeof(tis->buf),
++                       tis->loc[locty].r_buffer.size));
++            tis->offset = tis->loc[locty].r_offset;
++        break;
++        default:
++            /* leak nothing */
++            memset(tis->buf, 0x0, sizeof(tis->buf));
++        break;
++        }
++    }
++}
++
++static int tpm_tis_post_load(void *opaque,
++                             int version_id __attribute__((unused)))
++{
++    TPMState *s = opaque;
++    TPMTISEmuState *tis = &s->s.tis;
++
++    uint8_t locty = tis->active_locty;
++
++    if (TPM_TIS_IS_VALID_LOCTY(locty)) {
++        switch (tis->loc[locty].state) {
++        case TPM_TIS_STATE_RECEPTION:
++            memcpy(tis->loc[locty].w_buffer.buffer,
++                   tis->buf,
++                   MIN(sizeof(tis->buf),
++                       tis->loc[locty].w_buffer.size));
++            tis->loc[locty].w_offset = tis->offset;
++        break;
++        case TPM_TIS_STATE_COMPLETION:
++            memcpy(tis->loc[locty].r_buffer.buffer,
++                   tis->buf,
++                   MIN(sizeof(tis->buf),
++                       tis->loc[locty].r_buffer.size));
++            tis->loc[locty].r_offset = tis->offset;
++        break;
++        default:
++        break;
++        }
++    }
++
++    DPRINTF("tpm_tis: resume : locty = %d : r_offset = %d, w_offset = %d\n",
++            locty, tis->loc[0].r_offset, tis->loc[0].w_offset);
++
++    return 0;
++}
++
++static const VMStateDescription vmstate_locty = {
++    .name = "loc",
++    .version_id = 1,
++    .minimum_version_id = 0,
++    .minimum_version_id_old = 0,
++    .fields      = (VMStateField[]) {
++        VMSTATE_UINT32(state, TPMLocality),
++        VMSTATE_UINT32(inte, TPMLocality),
++        VMSTATE_UINT32(ints, TPMLocality),
++        VMSTATE_UINT8(access, TPMLocality),
++        VMSTATE_UINT32(sts, TPMLocality),
++        VMSTATE_UINT32(iface_id, TPMLocality),
++        VMSTATE_END_OF_LIST(),
++    }
++};
++
+ static const VMStateDescription vmstate_tpm_tis = {
+     .name = "tpm",
+-    .unmigratable = 1,
++    .version_id = 1,
++    .minimum_version_id = 0,
++    .minimum_version_id_old = 0,
++    .pre_save  = tpm_tis_pre_save,
++    .post_load = tpm_tis_post_load,
++    .fields = (VMStateField[]) {
++        VMSTATE_UINT32(s.tis.offset, TPMState),
++        VMSTATE_BUFFER(s.tis.buf, TPMState),
++        VMSTATE_UINT8(s.tis.active_locty, TPMState),
++        VMSTATE_UINT8(s.tis.aborting_locty, TPMState),
++        VMSTATE_UINT8(s.tis.next_locty, TPMState),
++
++        VMSTATE_STRUCT_ARRAY(s.tis.loc, TPMState, TPM_TIS_NUM_LOCALITIES, 1,
++                             vmstate_locty, TPMLocality),
++
++        VMSTATE_END_OF_LIST()
++    }
+ };
+ 
+ static Property tpm_tis_properties[] = {
+diff --git a/hw/tpm/tpm_tis.h b/hw/tpm/tpm_tis.h
+index a1df41fa21..b7fc0ea1a9 100644
+--- a/hw/tpm/tpm_tis.h
++++ b/hw/tpm/tpm_tis.h
+@@ -54,6 +54,8 @@ typedef struct TPMLocality {
+ 
+ typedef struct TPMTISEmuState {
+     QEMUBH *bh;
++    bool bh_scheduled; /* bh scheduled but did not run yet */
++
+     uint32_t offset;
+     uint8_t buf[TPM_TIS_BUFFER_MAX];
+ 
+diff --git a/hw/tpm/tpm_util.c b/hw/tpm/tpm_util.c
+index 7b35429725..b6ff74d946 100644
+--- a/hw/tpm/tpm_util.c
++++ b/hw/tpm/tpm_util.c
+@@ -22,6 +22,17 @@
+ #include "qemu/osdep.h"
+ #include "tpm_util.h"
+ #include "tpm_int.h"
++#include "tpm_ioctl.h"
++#include "qemu/error-report.h"
++
++#define DEBUG_TPM 0
++
++#define DPRINTF(fmt, ...) do { \
++    if (DEBUG_TPM) { \
++        fprintf(stderr, fmt, ## __VA_ARGS__); \
++    } \
++} while (0)
++
+ 
+ /*
+  * A basic test of a TPM device. We expect a well formatted response header
+@@ -125,3 +136,215 @@ int tpm_util_test_tpmdev(int tpm_fd, TPMVersion *tpm_version)
+ 
+     return 1;
+ }
++
++static void tpm_sized_buffer_reset(TPMSizedBuffer *tsb)
++{
++    g_free(tsb->buffer);
++    tsb->buffer = NULL;
++    tsb->size = 0;
++}
++
++/*
++ * Transfer a TPM state blob from the TPM into a provided buffer.
++ *
++ * @fd: file descriptor to talk to the CUSE TPM
++ * @type: the type of blob to transfer
++ * @decrypted_blob: whether we request to receive decrypted blobs
++ * @tsb: the TPMSizeBuffer to fill with the blob
++ * @flags: the flags to return to the caller
++ */
++static int tpm_util_cuse_get_state_blob(int fd,
++                                        uint8_t type,
++                                        bool decrypted_blob,
++                                        TPMSizedBuffer *tsb,
++                                        uint32_t *flags)
++{
++    ptm_getstate pgs;
++    uint16_t offset = 0;
++    ptm_res res;
++    ssize_t n;
++    size_t to_read;
++
++    tpm_sized_buffer_reset(tsb);
++
++    pgs.u.req.state_flags = (decrypted_blob) ? PTM_STATE_FLAG_DECRYPTED : 0;
++    pgs.u.req.type = type;
++    pgs.u.req.offset = offset;
++
++    if (ioctl(fd, PTM_GET_STATEBLOB, &pgs) < 0) {
++        error_report("CUSE TPM PTM_GET_STATEBLOB ioctl failed: %s",
++                     strerror(errno));
++        goto err_exit;
++    }
++    res = pgs.u.resp.tpm_result;
++    if (res != 0 && (res & 0x800) == 0) {
++        error_report("Getting the stateblob (type %d) failed with a TPM "
++                     "error 0x%x", type, res);
++        goto err_exit;
++    }
++
++    *flags = pgs.u.resp.state_flags;
++
++    tsb->buffer = g_malloc(pgs.u.resp.totlength);
++    memcpy(tsb->buffer, pgs.u.resp.data, pgs.u.resp.length);
++    tsb->size = pgs.u.resp.length;
++
++    /* if there are bytes left to get use read() interface */
++    while (tsb->size < pgs.u.resp.totlength) {
++        to_read = pgs.u.resp.totlength - tsb->size;
++        if (unlikely(to_read > SSIZE_MAX)) {
++            to_read = SSIZE_MAX;
++        }
++
++        n = read(fd, &tsb->buffer[tsb->size], to_read);
++        if (n != to_read) {
++            error_report("Could not read stateblob (type %d) : %s",
++                         type, strerror(errno));
++            goto err_exit;
++        }
++        tsb->size += to_read;
++    }
++
++    DPRINTF("tpm_util: got state blob type %d, %d bytes, flags 0x%08x, "
++            "decrypted=%d\n", type, tsb->size, *flags, decrypted_blob);
++
++    return 0;
++
++err_exit:
++    return 1;
++}
++
++int tpm_util_cuse_get_state_blobs(int tpm_fd,
++                                  bool decrypted_blobs,
++                                  TPMBlobBuffers *tpm_blobs)
++{
++    if (tpm_util_cuse_get_state_blob(tpm_fd, PTM_BLOB_TYPE_PERMANENT,
++                                     decrypted_blobs,
++                                     &tpm_blobs->permanent,
++                                     &tpm_blobs->permanent_flags) ||
++       tpm_util_cuse_get_state_blob(tpm_fd, PTM_BLOB_TYPE_VOLATILE,
++                                     decrypted_blobs,
++                                     &tpm_blobs->volatil,
++                                     &tpm_blobs->volatil_flags) ||
++       tpm_util_cuse_get_state_blob(tpm_fd, PTM_BLOB_TYPE_SAVESTATE,
++                                     decrypted_blobs,
++                                     &tpm_blobs->savestate,
++                                     &tpm_blobs->savestate_flags)) {
++        goto err_exit;
++    }
++
++    return 0;
++
++ err_exit:
++    tpm_sized_buffer_reset(&tpm_blobs->volatil);
++    tpm_sized_buffer_reset(&tpm_blobs->permanent);
++    tpm_sized_buffer_reset(&tpm_blobs->savestate);
++
++    return 1;
++}
++
++static int tpm_util_cuse_do_set_stateblob_ioctl(int fd,
++                                                uint32_t flags,
++                                                uint32_t type,
++                                                uint32_t length)
++{
++    ptm_setstate pss;
++
++    pss.u.req.state_flags = flags;
++    pss.u.req.type = type;
++    pss.u.req.length = length;
++
++    if (ioctl(fd, PTM_SET_STATEBLOB, &pss) < 0) {
++        error_report("CUSE TPM PTM_SET_STATEBLOB ioctl failed: %s",
++                     strerror(errno));
++        return 1;
++    }
++
++    if (pss.u.resp.tpm_result != 0) {
++        error_report("Setting the stateblob (type %d) failed with a TPM "
++                     "error 0x%x", type, pss.u.resp.tpm_result);
++        return 1;
++    }
++
++    return 0;
++}
++
++
++/*
++ * Transfer a TPM state blob to the CUSE TPM.
++ *
++ * @fd: file descriptor to talk to the CUSE TPM
++ * @type: the type of TPM state blob to transfer
++ * @tsb: TPMSizeBuffer containing the TPM state blob
++ * @flags: Flags describing the (encryption) state of the TPM state blob
++ */
++static int tpm_util_cuse_set_state_blob(int fd,
++                                        uint32_t type,
++                                        TPMSizedBuffer *tsb,
++                                        uint32_t flags)
++{
++    uint32_t offset = 0;
++    ssize_t n;
++    size_t to_write;
++
++    /* initiate the transfer to the CUSE TPM */
++    if (tpm_util_cuse_do_set_stateblob_ioctl(fd, flags, type, 0)) {
++        return 1;
++    }
++
++    /* use the write() interface for transferring the state blob */
++    while (offset < tsb->size) {
++        to_write = tsb->size - offset;
++        if (unlikely(to_write > SSIZE_MAX)) {
++            to_write = SSIZE_MAX;
++        }
++
++        n = write(fd, &tsb->buffer[offset], to_write);
++        if (n != to_write) {
++            error_report("Writing the stateblob (type %d) failed: %s",
++                         type, strerror(errno));
++            goto err_exit;
++        }
++        offset += to_write;
++    }
++
++    /* inidicate that the transfer is finished */
++    if (tpm_util_cuse_do_set_stateblob_ioctl(fd, flags, type, 0)) {
++        goto err_exit;
++    }
++
++    DPRINTF("tpm_util: set the state blob type %d, %d bytes, flags 0x%08x\n",
++            type, tsb->size, flags);
++
++    return 0;
++
++err_exit:
++    return 1;
++}
++
++int tpm_util_cuse_set_state_blobs(int tpm_fd,
++                                  TPMBlobBuffers *tpm_blobs)
++{
++    ptm_res res;
++
++    if (ioctl(tpm_fd, PTM_STOP, &res) < 0) {
++        error_report("tpm_passthrough: Could not stop "
++                     "the CUSE TPM: %s (%i)",
++                     strerror(errno), errno);
++        return 1;
++    }
++
++    if (tpm_util_cuse_set_state_blob(tpm_fd, PTM_BLOB_TYPE_PERMANENT,
++                                     &tpm_blobs->permanent,
++                                     tpm_blobs->permanent_flags) ||
++        tpm_util_cuse_set_state_blob(tpm_fd, PTM_BLOB_TYPE_VOLATILE,
++                                     &tpm_blobs->volatil,
++                                     tpm_blobs->volatil_flags) ||
++        tpm_util_cuse_set_state_blob(tpm_fd, PTM_BLOB_TYPE_SAVESTATE,
++                                     &tpm_blobs->savestate,
++                                     tpm_blobs->savestate_flags)) {
++        return 1;
++    }
++
++    return 0;
++}
+diff --git a/hw/tpm/tpm_util.h b/hw/tpm/tpm_util.h
+index df76245e6e..c24071d812 100644
+--- a/hw/tpm/tpm_util.h
++++ b/hw/tpm/tpm_util.h
+@@ -26,4 +26,11 @@
+ 
+ int tpm_util_test_tpmdev(int tpm_fd, TPMVersion *tpm_version);
+ 
++int tpm_util_cuse_get_state_blobs(int tpm_fd,
++                                  bool decrypted_blobs,
++                                  TPMBlobBuffers *tpm_blobs);
++
++int tpm_util_cuse_set_state_blobs(int tpm_fd,
++                                  TPMBlobBuffers *tpm_blobs);
++
+ #endif /* TPM_TPM_UTIL_H */
+diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h
+index b58f52d39f..3403821b9d 100644
+--- a/include/sysemu/tpm_backend.h
++++ b/include/sysemu/tpm_backend.h
+@@ -62,6 +62,18 @@ typedef struct TPMSizedBuffer {
+     uint8_t  *buffer;
+ } TPMSizedBuffer;
+ 
++/* blobs from the TPM; part of VM state when migrating */
++typedef struct TPMBlobBuffers {
++    uint32_t permanent_flags;
++    TPMSizedBuffer permanent;
++
++    uint32_t volatil_flags;
++    TPMSizedBuffer volatil;
++
++    uint32_t savestate_flags;
++    TPMSizedBuffer savestate;
++} TPMBlobBuffers;
++
+ struct TPMDriverOps {
+     enum TpmType type;
+     const QemuOptDesc *opts;
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0004-fix-CVE-2016-7909.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0004-fix-CVE-2016-7909.patch
deleted file mode 100644
index e71bbf6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0004-fix-CVE-2016-7909.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Upstream-Status: Backport [http://git.qemu.org/?p=qemu.git;a=commit;h=34e29ce]
-CVE: CVE-2016-7909
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From 34e29ce754c02bb6b3bdd244fbb85033460feaff Mon Sep 17 00:00:00 2001
-From: Prasad J Pandit <pjp@fedoraproject.org>
-Date: Fri, 30 Sep 2016 00:27:33 +0530
-Subject: [PATCH] net: pcnet: check rx/tx descriptor ring length
-
-The AMD PC-Net II emulator has set of control and status(CSR)
-registers. Of these, CSR76 and CSR78 hold receive and transmit
-descriptor ring length respectively. This ring length could range
-from 1 to 65535. Setting ring length to zero leads to an infinite
-loop in pcnet_rdra_addr() or pcnet_transmit(). Add check to avoid it.
-
-Reported-by: Li Qiang <liqiang6-s@360.cn>
-Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
-Signed-off-by: Jason Wang <jasowang@redhat.com>
----
- hw/net/pcnet.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
-index 198a01f..3078de8 100644
---- a/hw/net/pcnet.c
-+++ b/hw/net/pcnet.c
-@@ -1429,8 +1429,11 @@ static void pcnet_csr_writew(PCNetState *s, uint32_t rap, uint32_t new_value)
-     case 47: /* POLLINT */
-     case 72:
-     case 74:
-+        break;
-     case 76: /* RCVRL */
-     case 78: /* XMTRL */
-+        val = (val > 0) ? val : 512;
-+        break;
-     case 112:
-        if (CSR_STOP(s) || CSR_SPND(s))
-            break;
--- 
-2.10.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-9908.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-9908.patch
new file mode 100644
index 0000000..e0f7a1a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-9908.patch
@@ -0,0 +1,44 @@
+From 7139ccbc907441337b4b59cde2c5b5a54cb5b2cc Mon Sep 17 00:00:00 2001
+From: Sona Sarmadi <sona.sarmadi@enea.com>
+
+virtio-gpu: fix information leak in capset get dispatch
+
+In virgl_cmd_get_capset function, it uses g_malloc to allocate
+a response struct to the guest. As the 'resp'struct hasn't been full
+initialized it will lead the 'resp->padding' field to the guest.
+Use g_malloc0 to avoid this.
+
+Signed-off-by: Li Qiang <liqiang6-s@360.cn>
+Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
+Message-id: 58188cae.4a6ec20a.3d2d1.aff2@mx.google.com
+
+[Sona: backported from master to v2.8.0 and resolved conflict]
+
+Reference to upstream patch:
+http://git.qemu-project.org/?p=qemu.git;a=commit;h=85d9d044471f93c48c5c396f7e217b4ef12f69f8
+
+CVE: CVE-2016-9908
+Upstream-Status: Backport
+
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ hw/display/virtio-gpu-3d.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
+index 23f39de..d98b140 100644
+--- a/hw/display/virtio-gpu-3d.c
++++ b/hw/display/virtio-gpu-3d.c
+@@ -371,7 +371,7 @@ static void virgl_cmd_get_capset(VirtIOGPU *g,
+ 
+     virgl_renderer_get_cap_set(gc.capset_id, &max_ver,
+                                &max_size);
+-    resp = g_malloc(sizeof(*resp) + max_size);
++    resp = g_malloc0(sizeof(*resp) + max_size);
+ 
+     resp->hdr.type = VIRTIO_GPU_RESP_OK_CAPSET;
+     virgl_renderer_fill_caps(gc.capset_id,
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-9912.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-9912.patch
new file mode 100644
index 0000000..c009ffd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-9912.patch
@@ -0,0 +1,45 @@
+From b8e23926c568f2e963af39028b71c472e3023793 Mon Sep 17 00:00:00 2001
+From: Li Qiang <liq3ea@gmail.com>
+Date: Mon, 28 Nov 2016 21:29:25 -0500
+Subject: [PATCH] virtio-gpu: call cleanup mapping function in resource destroy
+
+If the guest destroy the resource before detach banking, the 'iov'
+and 'addrs' field in resource is not freed thus leading memory
+leak issue. This patch avoid this.
+
+CVE: CVE-2016-9912
+Upstream-Status: Backport
+
+Signed-off-by: Li Qiang <liq3ea@gmail.com>
+Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
+Message-id: 1480386565-10077-1-git-send-email-liq3ea@gmail.com
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ hw/display/virtio-gpu.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
+index ed2b6d3..6a26258 100644
+--- a/hw/display/virtio-gpu.c
++++ b/hw/display/virtio-gpu.c
+@@ -28,6 +28,8 @@
+ static struct virtio_gpu_simple_resource*
+ virtio_gpu_find_resource(VirtIOGPU *g, uint32_t resource_id);
+ 
++static void virtio_gpu_cleanup_mapping(struct virtio_gpu_simple_resource *res);
++
+ #ifdef CONFIG_VIRGL
+ #include <virglrenderer.h>
+ #define VIRGL(_g, _virgl, _simple, ...)                     \
+@@ -364,6 +366,7 @@ static void virtio_gpu_resource_destroy(VirtIOGPU *g,
+                                         struct virtio_gpu_simple_resource *res)
+ {
+     pixman_image_unref(res->image);
++    virtio_gpu_cleanup_mapping(res);
+     QTAILQ_REMOVE(&g->reslist, res, next);
+     g->hostmem -= res->hostmem;
+     g_free(res);
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
deleted file mode 100644
index 1a6cf51..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 896fa02c24347e6e9259812cfda187b1d6ca6199 Mon Sep 17 00:00:00 2001
-From: Jiang Lu <lu.jiang@windriver.com>
-Date: Wed, 13 Nov 2013 10:38:08 +0800
-Subject: [PATCH] Qemu:Arm:versatilepb: Add memory size checking
-
-The machine can not work with memory over 256M, so add a checking
-at startup. If the memory size exceed 256M, just stop emulation then
-throw out warning about memory limitation.
-
-Upstream-Status: Pending
-
-Signed-off-by: Jiang Lu <lu.jiang@windriver.com>
-
-Updated it on 2014-01-15 for rebasing
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-
-Update it when upgrade qemu to 2.2.0
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
-Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
----
- hw/arm/versatilepb.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
-index 6c69f4e..9278d90 100644
---- a/hw/arm/versatilepb.c
-+++ b/hw/arm/versatilepb.c
-@@ -204,6 +204,13 @@ static void versatile_init(MachineState *machine, int board_id)
-         exit(1);
-     }
-
-+    if (machine->ram_size > (256 << 20)) {
-+        fprintf(stderr,
-+                "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n",
-+                ((unsigned int)ram_size / (1 << 20)));
-+        exit(1);
-+    }
-+
-     cpuobj = object_new(object_class_get_name(cpu_oc));
-
-     /* By default ARM1176 CPUs have EL3 enabled.  This board does not
--- 
-2.1.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch
index 171bda7..f593cf9 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch
@@ -27,14 +27,14 @@
 
 Signed-off-by: Roy.Li <rongqing.li@windriver.com>
 ---
- qemu-seccomp.c | 14 ++++++++------
- 1 file changed, 8 insertions(+), 6 deletions(-)
+ qemu-seccomp.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
 
 diff --git a/qemu-seccomp.c b/qemu-seccomp.c
-index caa926e..5a78502 100644
+index df75d9c..0e577f8 100644
 --- a/qemu-seccomp.c
 +++ b/qemu-seccomp.c
-@@ -25,15 +25,21 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+@@ -35,15 +35,21 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
      { SCMP_SYS(timer_settime), 255 },
      { SCMP_SYS(timer_gettime), 254 },
      { SCMP_SYS(futex), 253 },
@@ -58,7 +58,7 @@
      { SCMP_SYS(mprotect), 246 },
      { SCMP_SYS(execve), 245 },
      { SCMP_SYS(open), 245 },
-@@ -48,13 +54,11 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+@@ -58,7 +64,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
      { SCMP_SYS(bind), 245 },
      { SCMP_SYS(listen), 245 },
      { SCMP_SYS(semget), 245 },
@@ -66,13 +66,7 @@
      { SCMP_SYS(gettimeofday), 245 },
      { SCMP_SYS(readlink), 245 },
      { SCMP_SYS(access), 245 },
-     { SCMP_SYS(prctl), 245 },
-     { SCMP_SYS(signalfd), 245 },
--    { SCMP_SYS(getrlimit), 245 },
-     { SCMP_SYS(set_tid_address), 245 },
-     { SCMP_SYS(statfs), 245 },
-     { SCMP_SYS(unlink), 245 },
-@@ -93,7 +97,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+@@ -104,7 +109,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
      { SCMP_SYS(times), 245 },
      { SCMP_SYS(exit), 245 },
      { SCMP_SYS(clock_gettime), 245 },
@@ -80,7 +74,7 @@
      { SCMP_SYS(restart_syscall), 245 },
      { SCMP_SYS(pwrite64), 245 },
      { SCMP_SYS(nanosleep), 245 },
-@@ -182,7 +185,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+@@ -194,7 +198,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
      { SCMP_SYS(lstat64), 241 },
      { SCMP_SYS(sendfile64), 241 },
      { SCMP_SYS(ugetrlimit), 241 },
@@ -89,5 +83,5 @@
      { SCMP_SYS(rt_sigqueueinfo), 241 },
      { SCMP_SYS(rt_tgsigqueueinfo), 241 },
 -- 
-1.9.1
+2.1.4
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/glibc-2.25.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/glibc-2.25.patch
new file mode 100644
index 0000000..a6908bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/glibc-2.25.patch
@@ -0,0 +1,88 @@
+From: Christopher Covington
+Date: Wed, 28 Dec 2016 15:04:33 -0500
+Subject: [Qemu-devel] [PATCH v3] build: include sys/sysmacros.h for major() and minor()a
+
+The definition of the major() and minor() macros are moving within glibc to
+<sys/sysmacros.h>. Include this header when it is available to avoid the
+following sorts of build-stopping messages:
+
+qga/commands-posix.c: In function ‘dev_major_minor’:
+qga/commands-posix.c:656:13: error: In the GNU C Library, "major" is defined
+ by <sys/sysmacros.h>. For historical compatibility, it is
+ currently defined by <sys/types.h> as well, but we plan to
+ remove this soon. To use "major", include <sys/sysmacros.h>
+ directly. If you did not intend to use a system-defined macro
+ "major", you should undefine it after including <sys/types.h>. [-Werror]
+         *devmajor = major(st.st_rdev);
+             ^~~~~~~~~~~~~~~~~~~~~~~~~~
+
+qga/commands-posix.c:657:13: error: In the GNU C Library, "minor" is defined
+ by <sys/sysmacros.h>. For historical compatibility, it is
+ currently defined by <sys/types.h> as well, but we plan to
+ remove this soon. To use "minor", include <sys/sysmacros.h>
+ directly. If you did not intend to use a system-defined macro
+ "minor", you should undefine it after including <sys/types.h>. [-Werror]
+         *devminor = minor(st.st_rdev);
+             ^~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The additional include allows the build to complete on Fedora 26 (Rawhide)
+with glibc version 2.24.90.
+
+Signed-off-by: Christopher Covington <address@hidden>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Upstream-Status: Submitted https://lists.gnu.org/archive/html/qemu-devel/2016-12/msg03548.html
+
+diff -uNr qemu-2.8.0.orig/configure qemu-2.8.0/configure
+--- qemu-2.8.0.orig/configure  2017-02-21 19:05:13.180094708 +0100
++++ qemu-2.8.0/configure       2017-02-21 19:08:53.114087084 +0100
+@@ -4727,6 +4727,20 @@
+ then
+ fi
+ 
+ ##########################################
++# check for sysmacros.h
++
++have_sysmacros=no
++cat > $TMPC << EOF
++#include <sys/sysmacros.h>
++int main(void) {
++    return makedev(0, 0);
++}
++EOF
++if compile_prog "" "" ; then
++    have_sysmacros=yes
++fi
++
++##########################################
+ # End of CC checks
+ # After here, no more $cc or $ld runs
+ 
+diff -uNr qemu-2.8.0.orig/configure qemu-2.8.0/configure
+--- qemu-2.8.0.orig/configure  2017-02-21 19:05:13.180094708 +0100
++++ qemu-2.8.0/configure       2017-02-21 19:08:53.114087084 +0100
+@@ -5695,6 +5709,10 @@
+   echo "CONFIG_AF_VSOCK=y" >> $config_host_mak
+ fi
+ 
++if test "$have_sysmacros" = "yes" ; then
++  echo "CONFIG_SYSMACROS=y" >> $config_host_mak
++fi
++
+ # Hold two types of flag:
+ #   CONFIG_THREAD_SETNAME_BYTHREAD  - we've got a way of setting the name on
+ #                                     a thread we have a handle to
+diff -uNr qemu-2.8.0.orig/include/sysemu/os-posix.h qemu-2.8.0/include/sysemu/os-posix.h
+--- qemu-2.8.0.orig/include/sysemu/os-posix.h	2016-12-20 21:16:48.000000000 +0100
++++ qemu-2.8.0/include/sysemu/os-posix.h	2017-02-21 19:07:18.009090381 +0100
+@@ -34,6 +34,10 @@
+ #include <netdb.h>
+ #include <sys/un.h>
+ 
++#ifdef CONFIG_SYSMACROS
++#include <sys/sysmacros.h>
++#endif
++
+ void os_set_line_buffering(void);
+ void os_set_proc_name(const char *s);
+ void os_setup_signal_handling(void);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch
new file mode 100644
index 0000000..ba21e71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch
@@ -0,0 +1,48 @@
+[Qemu-ppc] [PATCH 1/1] target-ppc, tcg: fix usermode segfault with pthread
+
+From: Sam Bobroff
+Subject: [Qemu-ppc] [PATCH 1/1] target-ppc, tcg: fix usermode segfault with pthread_create()
+Date: Mon, 30 Jan 2017 16:08:07 +1100
+Programs run under qemu-ppc64 on an x86_64 host currently segfault
+if they use pthread_create() due to the adjustment made to the NIP in
+commit bd6fefe71cec5a0c7d2be4ac96307f25db56abf9.
+
+This patch changes cpu_loop() to set the NIP back to the
+pre-incremented value before calling do_syscall(), which causes the
+correct address to be used for the new thread and corrects the fault.
+
+Signed-off-by: Sam Bobroff <address@hidden>
+
+Upstream-Status: Backport
+
+---
+
+linux-user/main.c | 4 +++-
+1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/linux-user/main.c b/linux-user/main.c
+index 30049581ef..b5dee01541 100644
+--- a/linux-user/main.c
++++ b/linux-user/main.c
+@@ -1712,18 +1712,20 @@ void cpu_loop(CPUPPCState *env)
+              * in syscalls.
+              */
+             env->crf[0] &= ~0x1;
++            env->nip += 4;
+             ret = do_syscall(env, env->gpr[0], env->gpr[3], env->gpr[4],
+                              env->gpr[5], env->gpr[6], env->gpr[7],
+                              env->gpr[8], 0, 0);
+             if (ret == -TARGET_ERESTARTSYS) {
++                env->nip -= 4;
+                 break;
+             }
+             if (ret == (target_ulong)(-TARGET_QEMU_ESIGRETURN)) {
++                env->nip -= 4;
+                 /* Returning from a successful sigreturn syscall.
+                    Avoid corrupting register state.  */
+                 break;
+             }
+-            env->nip += 4;
+             if (ret > (target_ulong)(-515)) {
+                 env->crf[0] |= 0x1;
+                 ret = -ret;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.7.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.7.0.bb
deleted file mode 100644
index 85aadec..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.7.0.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-require qemu.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
-                    file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
-
-SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
-            file://qemu-enlarge-env-entry-size.patch \
-            file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
-            file://no-valgrind.patch \
-            file://pathlimit.patch \
-            file://qemu-2.5.0-cflags.patch \
-            file://0001-virtio-zero-vq-inuse-in-virtio_reset.patch \
-            file://0002-fix-CVE-2016-7423.patch \
-            file://0003-fix-CVE-2016-7908.patch \
-            file://0004-fix-CVE-2016-7909.patch \
-            file://04b33e21866412689f18b7ad6daf0a54d8f959a7.patch \
-"
-
-SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
-SRC_URI[md5sum] = "08d4d06d1cb598efecd796137f4844ab"
-SRC_URI[sha256sum] = "326e739506ba690daf69fc17bd3913a6c313d9928d743bd8eddb82f403f81e53"
-
-COMPATIBLE_HOST_class-target_mips64 = "null"
-
-do_install_append() {
-    # Prevent QA warnings about installed ${localstatedir}/run
-    if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.8.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.8.0.bb
new file mode 100644
index 0000000..fa70009
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.8.0.bb
@@ -0,0 +1,65 @@
+require qemu.inc
+
+inherit ptest
+
+RDEPENDS_${PN}-ptest = "bash make"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
+                    file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
+
+SRC_URI += " \
+            file://powerpc_rom.bin \
+            file://disable-grabs.patch \
+            file://exclude-some-arm-EABI-obsolete-syscalls.patch \
+            file://wacom.patch \
+            file://add-ptest-in-makefile.patch \
+            file://run-ptest \
+            file://configure-fix-Darwin-target-detection.patch \
+            file://qemu-enlarge-env-entry-size.patch \
+            file://no-valgrind.patch \
+            file://pathlimit.patch \
+            file://qemu-2.5.0-cflags.patch \
+            file://target-ppc-fix-user-mode.patch \
+            file://glibc-2.25.patch \
+            file://04b33e21866412689f18b7ad6daf0a54d8f959a7.patch \
+"
+
+SRC_URI += " \
+            file://0001-Provide-support-for-the-CUSE-TPM.patch \
+            file://0002-Introduce-condition-to-notify-waiters-of-completed-c.patch \
+            file://0003-Introduce-condition-in-TPM-backend-for-notification.patch \
+            file://0004-Add-support-for-VM-suspend-resume-for-TPM-TIS.patch \
+            file://CVE-2016-9908.patch \
+            file://CVE-2016-9912.patch \
+"
+
+SRC_URI_append_class-native = " \
+            file://fix-libcap-header-issue-on-some-distro.patch \
+            file://cpus.c-qemu_cpu_kick_thread_debugging.patch \
+            "
+
+SRC_URI =+ "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "17940dce063b6ce450a12e719a6c9c43"
+SRC_URI[sha256sum] = "dafd5d7f649907b6b617b822692f4c82e60cf29bc0fc58bc2036219b591e5e62"
+
+COMPATIBLE_HOST_mipsarchn32 = "null"
+COMPATIBLE_HOST_mipsarchn64 = "null"
+
+do_install_append() {
+    # Prevent QA warnings about installed ${localstatedir}/run
+    if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
+    install -Dm 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
+}
+
+do_compile_ptest() {
+	make buildtest-TESTS
+}
+
+do_install_ptest() {
+	cp -rL ${B}/tests ${D}${PTEST_PATH}
+	find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
+
+	cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
index 53b302d..e40cdaf 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
@@ -1,11 +1,14 @@
 SUMMARY = "QEMU wrapper script"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 S = "${WORKDIR}"
 
+DEPENDS += "qemu-native"
+
 inherit qemu
 
+do_populate_sysroot[depends] = ""
+
 do_install () {
 	install -d ${D}${bindir_crossscripts}/
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native.inc b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native.inc
index 5c4b0a2..c706704 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native.inc
@@ -5,7 +5,7 @@
 inherit native
 
 PATCHTOOL = "patch"
-EXTRA_OECONF = "--disable-nls"
+EXTRA_OECONF_append = " --disable-nls"
 
 do_configure () {
 	oe_runconf
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native_0.64.bb b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native_0.65.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native_0.64.bb
rename to import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native_0.65.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc
index 512b798..c7bb741 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc
@@ -5,14 +5,14 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
 SRC_URI = "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \
-        file://install.patch \
         file://run-ptest \
         file://Makefile \
-	file://test.sh \
+        file://test.sh \
+        file://0001-tests-Allow-different-output-from-mv.patch \
 "
 
-SRC_URI[md5sum] = "fc0310db5868a0873d602d4332a76d43"
-SRC_URI[sha256sum] = "c4bfd3282214a288e8d3e921ae4d52e73e24c4fead72b5446752adee99a7affd"
+SRC_URI[md5sum] = "c67ba0228f5b7b8bbe469474661f92d6"
+SRC_URI[sha256sum] = "f6cbc788e5cbbb381a3c6eab5b9efce67c776a8662a7795c7432fd27aa096819"
 
 inherit autotools-brokensep ptest
 
@@ -34,8 +34,21 @@
 EXTRA_OE_MAKE_ARGS_darwin ?= ""
 EXTRA_OE_MAKE_ARGS ?= "BUILD_ROOT=${D}"
 
+EXTRA_OECONF = "--with-perl='${USRBINPATH}/env perl' --with-patch=patch"
+
 CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash"
 
+# Make sure we don't have "-w" in shebang lines: it breaks using
+# "/usr/bin/env perl" as parser
+do_configure_prepend () {
+	find ${S} -name "*.in" -exec sed -i -e "1s,^#\!.*@PERL@ -w$,#\! @PERL@\nuse warnings;," {} \;
+}
+
+# Don't setup symlinks to host utilities, we don't need them
+do_configure_append () {
+	sed -e 's,^COMPAT_SYMLINKS.*:=.*,COMPAT_SYMLINKS	:=,' -i ${S}/Makefile
+}
+
 # quilt ignores DESTDIR
 do_install () {
 	oe_runmake ${EXTRA_OE_MAKE_ARGS} install
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/0001-tests-Allow-different-output-from-mv.patch b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/0001-tests-Allow-different-output-from-mv.patch
new file mode 100644
index 0000000..21219a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/0001-tests-Allow-different-output-from-mv.patch
@@ -0,0 +1,29 @@
+From 1530138960cfafbeefb95f2a760954c00b4d0ef0 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 29 Mar 2017 15:11:59 +0300
+Subject: [PATCH] tests: Allow different output from mv
+
+busybox mv has different error messages: fix the test
+
+Upstream-Status: Inappropriate [embedded]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ test/failbackup.test | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/failbackup.test b/test/failbackup.test
+index 37046f7..fce6725 100644
+--- a/test/failbackup.test
++++ b/test/failbackup.test
+@@ -16,7 +16,7 @@ What happens when refresh fails because of a permission error?
+ 	$ cat > test.txt
+ 	< This is updated test.txt.
+ 	$ quilt refresh --backup
+-	>~ mv: cannot move [`']?%{P}test.diff'? to [`']?%{P}test.diff~'?: Permission denied
++	>~ mv: .*: Permission denied
+ 	$ echo %{?}
+ 	> 1
+ 
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/install.patch b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/install.patch
deleted file mode 100644
index e2a7af6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/install.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Upstream-Status: Pending
-
---- quilt-0.47/Makefile.in	2008-12-31 19:09:13.000000000 +0000
-+++ quilt-0.47/Makefile.in.orig	2008-08-21 13:21:32.000000000 +0100
-@@ -13,7 +13,7 @@
- mandir :=	@mandir@
- localedir :=	$(datadir)/locale
- emacsdir :=	$(datadir)/emacs/site-lisp
--etcdir :=	$(subst /usr/etc,/etc,$(prefix)/etc)
-+etcdir :=	@sysconfdir@
- 
- INSTALL :=	@INSTALL@
- POD2MAN :=	@POD2MAN@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.64.bb b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.64.bb
deleted file mode 100644
index 00f900a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.64.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-require quilt.inc
-inherit gettext
-RDEPENDS_${PN} += "patch diffstat bzip2 util-linux"
-SRC_URI += "file://aclocal.patch \
-            file://gnu_patch_test_fix_target.patch \
-           "
-
-# fix build-distro specific perl path in the target perl scripts
-do_install_append() {
-	for perlscript in ${D}${datadir}/quilt/scripts/remove-trailing-ws ${D}${datadir}/quilt/scripts/dependency-graph ${D}${datadir}/quilt/scripts/edmail ${D}${bindir}/guards
-	do
-		if [ -f $perlscript ]; then
-			sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' $perlscript
-		fi
-	done
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.65.bb b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.65.bb
new file mode 100644
index 0000000..12859f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.65.bb
@@ -0,0 +1,6 @@
+require quilt.inc
+inherit gettext
+RDEPENDS_${PN} += "patch diffstat bzip2 util-linux"
+SRC_URI += "file://aclocal.patch \
+            file://gnu_patch_test_fix_target.patch \
+           "
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Add-PYTHON_ABI-when-searching-for-python-libraries.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Add-PYTHON_ABI-when-searching-for-python-libraries.patch
new file mode 100644
index 0000000..b809332
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Add-PYTHON_ABI-when-searching-for-python-libraries.patch
@@ -0,0 +1,30 @@
+From 36cf0ff26ece53e529e8b4f2d2f09acd8794b055 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 24 Mar 2017 15:35:47 +0200
+Subject: [PATCH] Add PYTHON_ABI when searching for python libraries.
+
+It has a value of 'm' when using Python3, and so without it
+configure will not find the libraries.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9c58467c1..a506ec819 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -642,7 +642,7 @@ AS_IF([test "$enable_python" = yes],[
+       ])
+     CPPFLAGS="$save_CPPFLAGS"
+     save_LIBS="$LIBS"
+-    AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[
++    AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION}${PYTHON_ABI} python],[
+       WITH_PYTHON_LIB="$ac_res"
+     ],[AC_MSG_ERROR([missing python library])
+     ])
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch
new file mode 100644
index 0000000..ac6dcaf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch
@@ -0,0 +1,40 @@
+From e3eff024826550aec4a6a5baef7210a29faf299d Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 9 Mar 2017 18:54:02 +0200
+Subject: [PATCH] Add a color setting for mips64_n32 binaries
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ build/rpmfc.c | 1 +
+ rpmrc.in      | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/build/rpmfc.c b/build/rpmfc.c
+index d38a10916..c8e2f876a 100644
+--- a/build/rpmfc.c
++++ b/build/rpmfc.c
+@@ -622,6 +622,7 @@ exit:
+ static const struct rpmfcTokens_s rpmfcTokens[] = {
+   { "directory",		RPMFC_INCLUDE },
+ 
++  { "N32 MIPS64",		RPMFC_ELFMIPSN32|RPMFC_INCLUDE },
+   { "ELF 32-bit",		RPMFC_ELF32|RPMFC_INCLUDE },
+   { "ELF 64-bit",		RPMFC_ELF64|RPMFC_INCLUDE },
+ 
+diff --git a/rpmrc.in b/rpmrc.in
+index abc08fc31..f5bc820d8 100644
+--- a/rpmrc.in
++++ b/rpmrc.in
+@@ -133,6 +133,8 @@ archcolor: mipsr6el 1
+ archcolor: mips64r6 2
+ archcolor: mips64r6el 2
+ 
++archcolor: mips64_n32 4
++
+ archcolor: m68k 1
+ 
+ archcolor: m68kmint 1
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
new file mode 100644
index 0000000..80e2f0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
@@ -0,0 +1,33 @@
+From 87cfc0db1ed6fe381a5ed5f0016d8c3344a31a11 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 9 Jan 2017 18:52:11 +0200
+Subject: [PATCH] Do not add an unsatisfiable dependency when building rpms in
+ a short-circuited way.
+
+Upstream permits short-circuiting only for local testing; Yocto on the other
+hand produces rpms that way by design.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ build/pack.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/build/pack.c b/build/pack.c
+index 1261cdbba..bb2d6f4f6 100644
+--- a/build/pack.c
++++ b/build/pack.c
+@@ -595,10 +595,6 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
+ 	    headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
+ 	}
+ 
+-	if (cheating) {
+-	    (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1");
+-	}
+-	
+ 	{   char *binFormat = rpmGetPath("%{_rpmfilename}", NULL);
+ 	    char *binRpm, *binDir;
+ 	    binRpm = headerFormat(pkg->header, binFormat, &errorString);
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
new file mode 100644
index 0000000..d99ddeb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
@@ -0,0 +1,61 @@
+From d82691b8d58201dd03e30585daacd8ffd1556ae2 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 27 Feb 2017 09:43:30 +0200
+Subject: [PATCH] Do not hardcode "lib/rpm" as the installation path for
+ default configuration and macros.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ configure.ac | 2 +-
+ macros.in    | 2 +-
+ rpm.am       | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4f3be8770..92ffd3d68 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -875,7 +875,7 @@ else
+     usrprefix=$prefix
+ fi
+ 
+-RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
++RPMCONFIGDIR="`echo ${libdir}/rpm`"
+ AC_SUBST(RPMCONFIGDIR)
+ 
+ AC_SUBST(OBJDUMP)
+diff --git a/macros.in b/macros.in
+index c6d5a6b03..84ae25275 100644
+--- a/macros.in
++++ b/macros.in
+@@ -877,7 +877,7 @@ package or when debugging this package.\
+ %_sharedstatedir	%{_prefix}/com
+ %_localstatedir		%{_prefix}/var
+ %_lib			lib
+-%_libdir		%{_exec_prefix}/%{_lib}
++%_libdir		@libdir@
+ %_includedir		%{_prefix}/include
+ %_infodir		%{_datadir}/info
+ %_mandir		%{_datadir}/man
+diff --git a/rpm.am b/rpm.am
+index 1f43ad8a0..6854ff6ba 100644
+--- a/rpm.am
++++ b/rpm.am
+@@ -1,10 +1,10 @@
+ # Internal binaries
+ ## HACK: It probably should be $(libexecdir)/rpm or $(libdir)/rpm
+-rpmlibexecdir = $(prefix)/lib/rpm
++rpmlibexecdir = $(libdir)/rpm
+ 
+ # Host independent config files
+ ## HACK: it probably should be $(datadir)/rpm
+-rpmconfigdir = $(prefix)/lib/rpm
++rpmconfigdir = $(libdir)/rpm
+ 
+ # Libtool version (current-revision-age) for all our libraries
+ rpm_version_info = 7:0:0
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch
new file mode 100644
index 0000000..96eb418
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch
@@ -0,0 +1,38 @@
+From 35381b6cd6c1b571bf7e6b0640de0f54dbf94386 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 10 Jan 2017 14:11:30 +0200
+Subject: [PATCH] Do not read config files from $HOME
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lib/rpmrc.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/lib/rpmrc.c b/lib/rpmrc.c
+index 4ed991321..19fe80f98 100644
+--- a/lib/rpmrc.c
++++ b/lib/rpmrc.c
+@@ -458,8 +458,7 @@ static void setDefaults(void)
+     if (!defrcfiles) {
+ 	defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
+ 				confdir, "/" RPMCANONVENDOR "/rpmrc", ":",
+-				SYSCONFDIR "/rpmrc", ":",
+-			  	"~/.rpmrc", NULL);
++				SYSCONFDIR "/rpmrc", ":");
+     }
+ 
+ #ifndef MACROFILES
+@@ -471,8 +470,7 @@ static void setDefaults(void)
+   				confdir, "/" RPMCANONVENDOR "/macros", ":",
+ 				SYSCONFDIR "/rpm/macros.*", ":",
+ 				SYSCONFDIR "/rpm/macros", ":",
+-				SYSCONFDIR "/rpm/%{_target}/macros", ":",
+-				"~/.rpmmacros", NULL);
++				SYSCONFDIR "/rpm/%{_target}/macros", ":");
+     }
+ #else
+     macrofiles = MACROFILES;
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch
new file mode 100644
index 0000000..a38675f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch
@@ -0,0 +1,30 @@
+From ffb5301a8594140ad7a58bc0f2053be8ca2b2946 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 20 Jan 2017 13:32:06 +0200
+Subject: [PATCH 1/2] Do not reset the PATH environment variable before running
+ scriptlets.
+
+We add lots of native stuff into it and scriptlets rely on that.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lib/rpmscript.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/rpmscript.c b/lib/rpmscript.c
+index 92f949fa2..7c1aa75a8 100644
+--- a/lib/rpmscript.c
++++ b/lib/rpmscript.c
+@@ -201,7 +201,7 @@ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes,
+ 	if (ipath && ipath[5] != '%')
+ 	    path = ipath;
+ 
+-	xx = setenv("PATH", path, 1);
++	//xx = setenv("PATH", path, 1);
+ 	free(ipath);
+     }
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch
new file mode 100644
index 0000000..95c7013
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch
@@ -0,0 +1,74 @@
+From 211c2d11200e6657132c52e7ac68f8c118231262 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 27 Feb 2017 14:43:21 +0200
+Subject: [PATCH] Fix build with musl C library.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac        | 3 ++-
+ misc/Makefile.am    | 3 +--
+ misc/rpmxprogname.c | 3 +--
+ 3 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 92ffd3d68..9c58467c1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -229,6 +229,7 @@ AC_SEARCH_LIBS(dlopen, [dl])
+ # Check for libelf library. Prefer external, otherwise none.
+ WITH_LIBELF_LIB=
+ AC_CHECK_HEADER([libelf.h])
++AC_CHECK_HEADERS([error.h], [WITH_ERROR_H=yes])
+ AC_CHECK_HEADERS([gelf.h], [
+ 	AC_CHECK_LIB(elf, gelf_getvernaux, [
+ 	    AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
+@@ -237,7 +238,7 @@ AC_CHECK_HEADERS([gelf.h], [
+ 	])
+ ])
+ AC_SUBST(WITH_LIBELF_LIB)
+-AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes])
++AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes && test "$WITH_ERROR_H" = yes])
+ 
+ AC_CHECK_HEADERS([dwarf.h], [
+   WITH_LIBDWARF=yes
+diff --git a/misc/Makefile.am b/misc/Makefile.am
+index 8bf0093d9..b9db3d31a 100644
+--- a/misc/Makefile.am
++++ b/misc/Makefile.am
+@@ -5,10 +5,9 @@ AM_CPPFLAGS += -I$(top_srcdir)/misc
+ 
+ EXTRA_DIST = \
+ 	fnmatch.c	fnmatch.h \
+-	rpmxprogname.c	rpmxprogname.h \
+ 	stpcpy.c	stpncpy.c
+ 
+ noinst_LTLIBRARIES = libmisc.la
+ 
+-libmisc_la_SOURCES = fts.c fts.h
++libmisc_la_SOURCES = fts.c fts.h rpmxprogname.c rpmxprogname.h
+ libmisc_la_LIBADD = @LTLIBOBJS@
+diff --git a/misc/rpmxprogname.c b/misc/rpmxprogname.c
+index f89600613..e94625ea8 100644
+--- a/misc/rpmxprogname.c
++++ b/misc/rpmxprogname.c
+@@ -13,7 +13,7 @@ char *_rpmxgetprogname(void)
+ {
+   const char *empty = "";
+ 
+-  if (_rpmxprognam != NULL) /* never return NULL string */
++  if (_rpmxprogname != NULL) /* never return NULL string */
+     return _rpmxprogname;
+   else
+     return empty;
+@@ -30,4 +30,3 @@ void _rpmxsetprogname(const char *pn)
+   }
+ }
+ 
+-#endif /* _RPMXPROGNAME_H */
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch
new file mode 100644
index 0000000..2be3cb5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch
@@ -0,0 +1,37 @@
+From a6f269f879221f2777169c5f7291322afe6b661b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 17 Jan 2017 14:07:17 +0200
+Subject: [PATCH] When cross-installing, execute package scriptlets without
+ chrooting into destination rootfs
+
+This is triggered only when RPM_NO_CHROOT_FOR_SCRIPTS environment variable is defined.
+Otherwise they will trigger an explosion of failures, obviously.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lib/rpmscript.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/lib/rpmscript.c b/lib/rpmscript.c
+index 98d3f420d..b95b5d606 100644
+--- a/lib/rpmscript.c
++++ b/lib/rpmscript.c
+@@ -467,7 +467,13 @@ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd,
+ 
+     if (rc != RPMRC_FAIL) {
+ 	if (script_type & RPMSCRIPTLET_EXEC) {
+-	    rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
++	    if (getenv("RPM_NO_CHROOT_FOR_SCRIPTS") != NULL) {
++		rpmChrootOut();
++		rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
++		rpmChrootIn();
++	    } else {
++		rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
++	    }
+ 	} else {
+ 	    rc = runLuaScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
+ 	}
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch
new file mode 100644
index 0000000..9648cac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch
@@ -0,0 +1,31 @@
+From d42ece6fa15b98d7f9221b90b85b78631df2c0a0 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 14 Feb 2017 13:51:19 +0200
+Subject: [PATCH] When nice value cannot be reset, issue a notice instead of a
+ warning
+
+Otherwise build logs on the autobuilder get very clutter, as it
+doesn't allow the nice value to be reset for some reason.
+
+Upstream-Status: Inappropriate [oe specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lib/rpmscript.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/rpmscript.c b/lib/rpmscript.c
+index 5e1e99906..3975aead8 100644
+--- a/lib/rpmscript.c
++++ b/lib/rpmscript.c
+@@ -347,7 +347,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes,
+         int ret;
+         ret = setpriority(PRIO_PROCESS, 0, 0);
+         if (ret == -1) {
+-            rpmlog(RPMLOG_WARNING, _("Unable to reset nice value: %s"),
++            rpmlog(RPMLOG_NOTICE, _("Unable to reset nice value: %s\n"),
+                 strerror(errno));
+         }
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch
new file mode 100644
index 0000000..a6c5869
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch
@@ -0,0 +1,32 @@
+perl: disable auto requires
+
+When generating automatic requirements, it's possible for perl scripts to
+declare 'optional' dependencies.  These seem to often be incorrect and will
+cause installation failures in OE.  Instead of fixing the perl scripts, it
+was decided it is better to simply disable the automatic dependency
+generation.  This matches the behavior from the previous RPM5 implementation.
+
+Upstream-Status: Inappropriate [OE specific configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: git/fileattrs/perl.attr
+===================================================================
+--- git.orig/fileattrs/perl.attr
++++ git/fileattrs/perl.attr
+@@ -1,3 +1,3 @@
+-%__perl_requires	%{_rpmconfigdir}/perl.req
++#__perl_requires	%{_rpmconfigdir}/perl.req
+ %__perl_magic		^.*[Pp]erl .*$
+ %__perl_flags		exeonly
+Index: git/fileattrs/perllib.attr
+===================================================================
+--- git.orig/fileattrs/perllib.attr
++++ git/fileattrs/perllib.attr
+@@ -1,5 +1,5 @@
+ %__perllib_provides	%{_rpmconfigdir}/perl.prov
+-%__perllib_requires	%{_rpmconfigdir}/perl.req
++#__perllib_requires	%{_rpmconfigdir}/perl.req
+ %__perllib_magic	^Perl[[:digit:]] module source.*
+ %__perllib_path		\\.pm$
+ %__perllib_flags	magic_and_path
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch
new file mode 100644
index 0000000..b3dbc31
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch
@@ -0,0 +1,72 @@
+From 383c0b097b7eba16801a9e3c4b8e36a4b6de74ab Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 20 Jan 2017 13:33:05 +0200
+Subject: [PATCH 2/2] Add support for prefixing /etc from RPM_ETCCONFIGDIR
+ environment variable
+
+This is needed so that rpm can pick up target-specific configuration
+from target rootfs instead of its own native sysroot.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lib/rpmrc.c | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/lib/rpmrc.c b/lib/rpmrc.c
+index 19fe80f98..6b27b3941 100644
+--- a/lib/rpmrc.c
++++ b/lib/rpmrc.c
+@@ -455,10 +455,14 @@ const char * lookupInDefaultTable(const char * name,
+ static void setDefaults(void)
+ {
+     const char *confdir = rpmConfigDir();
++    const char *etcconfdir = getenv("RPM_ETCCONFIGDIR");
++    if (etcconfdir == NULL)
++        etcconfdir = "";
++
+     if (!defrcfiles) {
+ 	defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
+ 				confdir, "/" RPMCANONVENDOR "/rpmrc", ":",
+-				SYSCONFDIR "/rpmrc", ":");
++				etcconfdir, SYSCONFDIR "/rpmrc", ":", NULL);
+     }
+ 
+ #ifndef MACROFILES
+@@ -468,9 +472,9 @@ static void setDefaults(void)
+ 				confdir, "/platform/%{_target}/macros", ":",
+ 				confdir, "/fileattrs/*.attr", ":",
+   				confdir, "/" RPMCANONVENDOR "/macros", ":",
+-				SYSCONFDIR "/rpm/macros.*", ":",
+-				SYSCONFDIR "/rpm/macros", ":",
+-				SYSCONFDIR "/rpm/%{_target}/macros", ":");
++				etcconfdir, SYSCONFDIR "/rpm/macros.*", ":",
++				etcconfdir, SYSCONFDIR "/rpm/macros", ":",
++				etcconfdir, SYSCONFDIR "/rpm/%{_target}/macros", ":", NULL);
+     }
+ #else
+     macrofiles = MACROFILES;
+@@ -989,7 +993,11 @@ static void read_auxv(void)
+  */
+ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
+ {
+-    const char * const platform_path = SYSCONFDIR "/rpm/platform";
++    const char *etcconfdir = getenv("RPM_ETCCONFIGDIR");
++    if (etcconfdir == NULL)
++        etcconfdir = "";
++
++    const char * const platform_path = rstrscat(NULL, etcconfdir, SYSCONFDIR "/rpm/platform", NULL);
+     static struct utsname un;
+     char * chptr;
+     canonEntry canon;
+@@ -1286,6 +1294,7 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
+ 
+     if (arch) *arch = un.machine;
+     if (os) *os = un.sysname;
++    free(platform_path);
+ }
+ 
+ static
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch
new file mode 100644
index 0000000..c910a47
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch
@@ -0,0 +1,32 @@
+From d65d6e8760afbd7f70b22a1f3297a037bc475fea Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Mon, 15 May 2017 10:21:08 +0200
+Subject: [PATCH 11/13] Do not require that ELF binaries are executable to be
+ identifiable
+
+There is nothing that requires, e.g., a DSO to be executable, but it
+is still an ELF binary and should be identified as such.
+
+Upstream probably expects all ELF binaries to be marked as executable,
+but rather than imposing such a limitation for OE, allow any file to
+be identified as an ELF binary regardless of whether it is executable
+or not.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ fileattrs/elf.attr | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/fileattrs/elf.attr b/fileattrs/elf.attr
+index 595b33e09..bac52649d 100644
+--- a/fileattrs/elf.attr
++++ b/fileattrs/elf.attr
+@@ -1,4 +1,3 @@
+ %__elf_provides		%{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
+ %__elf_requires		%{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
+ %__elf_magic		^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*$
+-%__elf_flags		exeonly
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0012-Use-conditional-to-access-_docdir-in-macros.in.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0012-Use-conditional-to-access-_docdir-in-macros.in.patch
new file mode 100644
index 0000000..996da90
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0012-Use-conditional-to-access-_docdir-in-macros.in.patch
@@ -0,0 +1,36 @@
+From 77808db4036dc4a012c47aca36255549ed764a6a Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Tue, 16 May 2017 10:58:18 +0200
+Subject: [PATCH 12/13] Use conditional to access %{_docdir} in macros.in
+
+This avoids the following warning:
+
+warning: Ignoring invalid regex %{_docdir}
+
+when runing `rpmdeps -R <file>`, since %{_docdir} is only defined when
+parsing a spec file (in parseSpec()).
+
+Upstream-Status: Accepted [https://github.com/rpm-software-management/rpm/pull/216]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ macros.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/macros.in b/macros.in
+index 84ae25275..cca67a500 100644
+--- a/macros.in
++++ b/macros.in
+@@ -200,8 +200,8 @@ package or when debugging this package.\
+ # Their purpouse is to set up global filtering for all packages. If you need
+ # to set up specific filtering for your package use %__requires_exclude_from
+ # and %__provides_exclude_from instead.
+-%__global_requires_exclude_from		%{_docdir}
+-%__global_provides_exclude_from		%{_docdir}
++%__global_requires_exclude_from		%{?_docdir:%{_docdir}}
++%__global_provides_exclude_from		%{?_docdir:%{_docdir}}
+ 
+ #	The path to the gzip executable (legacy, use %{__gzip} instead).
+ %_gzipbin		%{__gzip}
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch
new file mode 100644
index 0000000..faaf629
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch
@@ -0,0 +1,152 @@
+From 3bf20a6116ae3e1a5a3a6907bee7e881b17efb2f Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Mon, 15 May 2017 11:23:26 +0200
+Subject: [PATCH 13/13] Add a new option --alldeps to rpmdeps
+
+This will send the output from rpmfcPrint() to stdout. This is an
+alternative to using the --rpmfcdebug option, which will send the same
+output to stderr. The two options have totally different use cases
+though. While --alldeps is used when the output from rpmfcPrint() is
+what is wanted, --rpmfcdebug can be used together with the other
+output options, e.g., --requires, without affecting their output.
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/220]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ build/rpmfc.c   | 27 ++++++++++++++-------------
+ build/rpmfc.h   |  1 -
+ tools/rpmdeps.c | 44 +++++++++++++++++++++++++-------------------
+ 3 files changed, 39 insertions(+), 33 deletions(-)
+
+diff --git a/build/rpmfc.c b/build/rpmfc.c
+index c8e2f876a..44f1cdc9a 100644
+--- a/build/rpmfc.c
++++ b/build/rpmfc.c
+@@ -732,7 +732,6 @@ static rpm_color_t rpmfcColor(const char * fmstr)
+ 
+ void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp)
+ {
+-    rpm_color_t fcolor;
+     int ndx;
+     int dx;
+     int fx;
+@@ -744,21 +743,23 @@ void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp)
+ 
+     if (fc)
+     for (fx = 0; fx < fc->nfiles; fx++) {
+-	rpmsid cx = fc->fcdictx[fx] + 1; /* id's are one off */
+-	fcolor = fc->fcolor[fx];
+-	ARGV_t fattrs = fc->fattrs[fx];
+-
+ 	fprintf(fp, "%3d %s", fx, fc->fn[fx]);
+-	if (fcolor != RPMFC_BLACK)
++	if (_rpmfc_debug) {
++	    rpmsid cx = fc->fcdictx[fx] + 1; /* id's are one off */
++	    rpm_color_t fcolor = fc->fcolor[fx];
++	    ARGV_t fattrs = fc->fattrs[fx];
++
++	    if (fcolor != RPMFC_BLACK)
+ 		fprintf(fp, "\t0x%x", fc->fcolor[fx]);
+-	else
++	    else
+ 		fprintf(fp, "\t%s", rpmstrPoolStr(fc->cdict, cx));
+-	if (fattrs) {
+-	    char *attrs = argvJoin(fattrs, ",");
+-	    fprintf(fp, " [%s]", attrs);
+-	    free(attrs);
+-	} else {
+-	    fprintf(fp, " [none]");
++	    if (fattrs) {
++		char *attrs = argvJoin(fattrs, ",");
++		fprintf(fp, " [%s]", attrs);
++		free(attrs);
++	    } else {
++		fprintf(fp, " [none]");
++	    }
+ 	}
+ 	fprintf(fp, "\n");
+ 
+diff --git a/build/rpmfc.h b/build/rpmfc.h
+index dae8ea5b1..3d87b31cf 100644
+--- a/build/rpmfc.h
++++ b/build/rpmfc.h
+@@ -45,7 +45,6 @@ typedef const struct rpmfcTokens_s * rpmfcToken;
+ 
+ /** \ingroup rpmfc
+  * Print results of file classification.
+- * @todo Remove debugging routine.
+  * @param msg		message prefix (NULL for none)
+  * @param fc		file classifier
+  * @param fp		output file handle (NULL for stderr)
+diff --git a/tools/rpmdeps.c b/tools/rpmdeps.c
+index a414b6343..f260a38c4 100644
+--- a/tools/rpmdeps.c
++++ b/tools/rpmdeps.c
+@@ -23,6 +23,8 @@ static int print_conflicts;
+ 
+ static int print_obsoletes;
+ 
++static int print_alldeps;
++
+ static void rpmdsPrint(const char * msg, rpmds ds, FILE * fp)
+ {
+     if (fp == NULL) fp = stderr;
+@@ -57,6 +59,8 @@ static struct poptOption optionsTable[] = {
+         NULL, NULL },
+  { "obsoletes", '\0', POPT_ARG_VAL, &print_obsoletes, -1,
+         NULL, NULL },
++ { "alldeps", '\0', POPT_ARG_VAL, &print_alldeps, -1,
++        NULL, NULL },
+ 
+    POPT_AUTOALIAS
+    POPT_AUTOHELP
+@@ -100,25 +104,27 @@ main(int argc, char *argv[])
+     if (rpmfcClassify(fc, av, NULL) || rpmfcApply(fc))
+ 	goto exit;
+ 
+-    if (_rpmfc_debug)
+-	rpmfcPrint(buf, fc, NULL);
+-
+-    if (print_provides)
+-	rpmdsPrint(NULL, rpmfcProvides(fc), stdout);
+-    if (print_requires)
+-	rpmdsPrint(NULL, rpmfcRequires(fc), stdout);
+-    if (print_recommends)
+-	rpmdsPrint(NULL, rpmfcRecommends(fc), stdout);
+-    if (print_suggests)
+-	rpmdsPrint(NULL, rpmfcSuggests(fc), stdout);
+-    if (print_supplements)
+-	rpmdsPrint(NULL, rpmfcSupplements(fc), stdout);
+-    if (print_enhances)
+-	rpmdsPrint(NULL, rpmfcEnhances(fc), stdout);
+-    if (print_conflicts)
+-	rpmdsPrint(NULL, rpmfcConflicts(fc), stdout);
+-    if (print_obsoletes)
+-	rpmdsPrint(NULL, rpmfcObsoletes(fc), stdout);
++    if (print_alldeps || _rpmfc_debug)
++	rpmfcPrint(NULL, fc, print_alldeps ? stdout : NULL);
++
++    if (!print_alldeps) {
++	if (print_provides)
++	    rpmdsPrint(NULL, rpmfcProvides(fc), stdout);
++	if (print_requires)
++	    rpmdsPrint(NULL, rpmfcRequires(fc), stdout);
++	if (print_recommends)
++	    rpmdsPrint(NULL, rpmfcRecommends(fc), stdout);
++	if (print_suggests)
++	    rpmdsPrint(NULL, rpmfcSuggests(fc), stdout);
++	if (print_supplements)
++	    rpmdsPrint(NULL, rpmfcSupplements(fc), stdout);
++	if (print_enhances)
++	    rpmdsPrint(NULL, rpmfcEnhances(fc), stdout);
++	if (print_conflicts)
++	    rpmdsPrint(NULL, rpmfcConflicts(fc), stdout);
++	if (print_obsoletes)
++	    rpmdsPrint(NULL, rpmfcObsoletes(fc), stdout);
++    }
+ 
+     ec = 0;
+ 
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-Disable-__sync_add_and_fetch_8-on-nios2.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-Disable-__sync_add_and_fetch_8-on-nios2.patch
deleted file mode 100644
index e9b73b8..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-Disable-__sync_add_and_fetch_8-on-nios2.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 06967a50f20095f5ca30b8214f4c98ba0f5262bf Mon Sep 17 00:00:00 2001
-From: Marek Vasut <marex@denx.de>
-Date: Sun, 3 Apr 2016 06:55:25 +0200
-Subject: [PATCH] Disable __sync_add_and_fetch_8 on nios2
-
-The NIOS2 softcore does not implement the __sync_add_and_fetch_8,
-so disable it accordingly.
-
-Signed-off-by: Marek Vasut <marex@denx.de>
-Upstream-Status: Submitted
----
- rpmio/bson.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/rpmio/bson.h b/rpmio/bson.h
-index 57023f1..60c7d02 100644
---- a/rpmio/bson.h
-+++ b/rpmio/bson.h
-@@ -880,7 +880,7 @@ BSON_END_DECLS
- BSON_BEGIN_DECLS
- 
- /* Some architectures do not support __sync_add_and_fetch_8 */
--#if (__mips == 32) || (defined(__PPC__) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8))
-+#if (__mips == 32) || (__nios2__) || (defined(__PPC__) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8))
- # define __BSON_NEED_ATOMIC_64 1
- #endif
- 
--- 
-2.8.0.rc3
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-define-EM_AARCH64.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-define-EM_AARCH64.patch
deleted file mode 100644
index c9fb268..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-define-EM_AARCH64.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-[PATCH] define EM_AARCH64
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-EM_AARCH64 maybe not be defined due to old version elf.h, and lead to
-that debugedit can not work on aarch64 elf object files, since there is
-no other dependence, except these two macro, define them to make
-debugedit work on aarch64 elf files.
-
-Signed-off-by: Roy Li <rongqing.li@windriver.com>
----
- tools/debugedit.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/tools/debugedit.c b/tools/debugedit.c
-index de693ed..d16a641 100644
---- a/tools/debugedit.c
-+++ b/tools/debugedit.c
-@@ -35,6 +35,13 @@
- 
- #include <gelf.h>
- 
-+#ifndef EM_AARCH64
-+#define EM_AARCH64      183             /* ARM AARCH64 */
-+#endif
-+#ifndef R_AARCH64_ABS32
-+#define R_AARCH64_ABS32 258
-+#endif 
-+
- /* some defines taken from the dwarf standard */
- 
- #define DW_TAG_compile_unit	0x11
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-macros-add-_gpg_sign_cmd_extra_args.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-macros-add-_gpg_sign_cmd_extra_args.patch
deleted file mode 100644
index eb43a87..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-macros-add-_gpg_sign_cmd_extra_args.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From fa9726ff69f86d6a87c4c4bd7e3d2881999a872a Mon Sep 17 00:00:00 2001
-From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-Date: Thu, 23 Feb 2017 11:14:20 +0200
-Subject: [PATCH] macros: add %_gpg_sign_cmd_extra_args
-
-Similar to what rpm4 has. This macro can be used to customize the
-gpg command line options when signing packages. This is needed for
-gpg 2.1 which requires "--pinentry-mode loopback" to allow
-non-interactive signing.
-
-Upstream-Status: Pending
-
-Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
----
- macros/macros.in | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/macros/macros.in b/macros/macros.in
-index 8bc5840..fda3c66 100644
---- a/macros/macros.in
-+++ b/macros/macros.in
-@@ -524,7 +524,9 @@ $_arbitrary_tags_tests	Foo:Bar
- %_gpg_passphrase_way %{?_gpg_passphrase:--passphrase "%{_gpg_passphrase}"}%{!?_gpg_passphrase:--passphrase-fd 3}
- 
- %__gpg_check_password_cmd	%{__gpg} \
--	gpg --batch --no-verbose %{_gpg_passphrase_way} -u "%{_gpg_name}" -so -
-+	gpg --batch --no-verbose %{_gpg_passphrase_way} \
-+	%{?_gpg_sign_cmd_extra_args:%{_gpg_sign_cmd_extra_args}} \
-+	-u "%{_gpg_name}" -so -
- #%__pgp_check_password_cmd	%{__pgp} \
- #	pgp +batchmode=on +verbose=0 "%{_pgp_name}" -sf
- #%__pgp5_check_password_cmd	%{__pgp} \
-@@ -532,6 +534,7 @@ $_arbitrary_tags_tests	Foo:Bar
- 
- %__gpg_sign_cmd			%{__gpg} \
- 	gpg --batch --no-verbose --no-armor %{_gpg_passphrase_way}  --no-secmem-warning \
-+	%{?_gpg_sign_cmd_extra_args:%{_gpg_sign_cmd_extra_args}} \
- 	-u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
- #%__pgp_sign_cmd			%{__pgp} \
- #	pgp +batchmode=on +verbose=0 +armor=off \
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch
deleted file mode 100644
index 70dd4ff..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch
+++ /dev/null
@@ -1,294 +0,0 @@
-From 0af17c2ae86c1e8e42b96f6dface08f535bb55ad Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 14 Feb 2016 08:33:24 +0000
-Subject: [PATCH] rpm: Fix build on musl
-
-Provide alternatives to assumptions about glibc
-on linux
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Updated to 5.4.16 (CVS)
-
-The patch will likely need additional rework before it can be accepted upsteam
-due to the way MUSL changes are patched in.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
----
-Upstream-Status: Pending
-
- lib/poptALL.c          |    2 ++
- rpmio/fts.c            |    4 ++++
- rpmio/poptIO.c         |    2 ++
- rpmqv.c                |    2 ++
- system.h               |   13 ++++++-------
- tools/debugedit.c      |   47 +++++++++++++++++++++++++++++++++++++++++++++++
- tools/rpm2cpio.c       |    2 ++
- tools/rpmcache.c       |    2 ++
- tools/rpmcmp.c         |    2 ++
- tools/rpmdeps-oecore.c |    2 ++
- tools/rpmdeps.c        |    2 ++
- tools/rpmdigest.c      |    2 ++
- tools/rpmfind.c        |    6 +++---
- 13 files changed, 78 insertions(+), 10 deletions(-)
-
-Index: rpm-5.4.15/rpmio/fts.c
-===================================================================
---- rpm-5.4.15.orig/rpmio/fts.c
-+++ rpm-5.4.15/rpmio/fts.c
-@@ -124,6 +124,10 @@ static char sccsid[] = "@(#)fts.c	8.6 (B
- #   define __fxstat64(_stat_ver, _fd, _sbp)    fstat((_fd), (_sbp))
- #endif
- 
-+#ifndef _STAT_VER
-+#   define _STAT_VER      0
-+#endif
-+
- #if !defined(_D_EXACT_NAMLEN)
- #   define _D_EXACT_NAMLEN(d) (strlen((d)->d_name))
- #endif
-Index: rpm-5.4.15/tools/debugedit.c
-===================================================================
---- rpm-5.4.15.orig/tools/debugedit.c
-+++ rpm-5.4.15/tools/debugedit.c
-@@ -22,7 +22,12 @@
- #include <byteswap.h>
- #include <endian.h>
- #include <errno.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#else
-+#include <stdarg.h>
-+void error(int, int, const char *, ...);
-+#endif
- #include <limits.h>
- #include <string.h>
- #include <stdlib.h>
-@@ -1535,6 +1540,48 @@ handle_build_id (DSO *dso, Elf_Data *bui
-     puts (hex);
-   }
- }
-+#ifndef __GLIBC__
-+extern char *__progname;
-+
-+void (*error_print_progname)(void) = 0;
-+unsigned int error_message_count = 0;
-+int error_one_per_line = 0;
-+
-+static void eprint(int status, int e, const char *file, unsigned int line, const char *fmt, va_list ap)
-+{
-+       if (file && error_one_per_line) {
-+               static const char *oldfile;
-+               static unsigned int oldline;
-+               if (line == oldline && strcmp(file, oldfile) == 0)
-+                       return;
-+               oldfile = file;
-+               oldline = line;
-+       }
-+       if (error_print_progname)
-+               error_print_progname();
-+       else
-+               fprintf(stderr, "%s: ", __progname);
-+       if (file)
-+               fprintf(stderr, "%s:%u: ", file, line);
-+       vfprintf(stderr, fmt, ap);
-+      if (e)
-+               fprintf(stderr, ": %s", strerror(e));
-+       putc('\n', stderr);
-+       fflush(stderr);
-+       error_message_count++;
-+       if (status)
-+               exit(status);
-+}
-+
-+void error(int status, int e, const char *fmt, ...)
-+{
-+       va_list ap;
-+       va_start(ap,fmt);
-+       eprint(status, e, 0, 0, fmt, ap);
-+       va_end(ap);
-+}
-+
-+#endif
- 
- /* It avoided the segment fault while file's bss offset have a large number.
-    See https://bugzilla.redhat.com/show_bug.cgi?id=1019707
-Index: rpm-5.4.15/tools/rpmfind.c
-===================================================================
---- rpm-5.4.15.orig/tools/rpmfind.c
-+++ rpm-5.4.15/tools/rpmfind.c
-@@ -1175,7 +1175,7 @@ find_parsenum(PLAN *plan, const char *op
-      * and endchar points to the beginning of the string we know we have
-      * a syntax error.
-      */
--#if defined(__sun)
-+#if defined(__sun) || !defined(__GLIBC_)
-     value = strtoll(str, &endchar, 10);
- #else
-     value = strtoq(str, &endchar, 10);
-@@ -1215,7 +1215,7 @@ find_parsetime(PLAN *plan, const char *o
- 	break;
-     }
- 
--#if defined(__sun)
-+#if defined(__sun) || !defined(__GLIBC_)
-     value = strtoll(str, &unit, 10);
- #else
-     value = strtoq(str, &unit, 10);
-@@ -1253,7 +1253,7 @@ find_parsetime(PLAN *plan, const char *o
- 	str = unit + 1;
- 	if (*str == '\0')	/* EOS */
- 	    break;
--#if defined(__sun)
-+#if defined(__sun) || !defined(__GLIBC_)
- 	value = strtoll(str, &unit, 10);
- #else
- 	value = strtoq(str, &unit, 10);
-Index: rpm-5.4.15/system.h
-===================================================================
---- rpm-5.4.15.orig/system.h
-+++ rpm-5.4.15/system.h
-@@ -372,16 +372,15 @@ extern int _tolower(int) __THROW	/*@*/;
- #define	__progname	__assert_program_name
- #endif
- #define	setprogname(pn)
-+/*@unchecked@*/
-+extern const char *__progname;
- #else
--#define	__progname	program_name
--#define	setprogname(pn)	\
--  { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
--    else __progname = pn;		\
--  }
--#endif
-+#define	setprogname(pn)
-+#define	progname	__progname
- 
- /*@unchecked@*/
--extern const char *__progname;
-+extern char *__progname;
-+#endif
- 
- /* -- Retrofit missing prototypes (if needed). */
- #ifdef __cplusplus
-Index: rpm-5.4.15/rpmio/poptIO.c
-===================================================================
---- rpm-5.4.15.orig/rpmio/poptIO.c
-+++ rpm-5.4.15/rpmio/poptIO.c
-@@ -65,7 +65,9 @@ extern int _rpmsvn_debug;
- GENfree(rpmioP)
- #endif	/* __cplusplus */
- 
-+#ifdef __GLIBC__
- const char *__progname;
-+#endif
- 
- #if !defined(POPT_ARGFLAG_TOGGLE)	/* XXX compat with popt < 1.15 */
- #define	POPT_ARGFLAG_TOGGLE	0
-Index: rpm-5.4.15/lib/poptALL.c
-===================================================================
---- rpm-5.4.15.orig/lib/poptALL.c
-+++ rpm-5.4.15/lib/poptALL.c
-@@ -4,7 +4,9 @@
-  */
- 
- #include "system.h"
-+#ifdef __GLIBC__
- extern const char *__progname;
-+#endif
- 
- #if defined(RPM_VENDOR_WINDRIVER)
- const char *__usrlibrpm = USRLIBRPM;
-Index: rpm-5.4.15/tools/rpm2cpio.c
-===================================================================
---- rpm-5.4.15.orig/tools/rpm2cpio.c
-+++ rpm-5.4.15/tools/rpm2cpio.c
-@@ -1,7 +1,9 @@
- /* rpmarchive: spit out the main archive portion of a package */
- 
- #include "system.h"
-+#ifdef __GLIBC__
- const char *__progname;
-+#endif
- 
- #include <rpmio.h>
- #include <rpmiotypes.h>	/* XXX fnpyKey */
-Index: rpm-5.4.15/tools/rpmcache.c
-===================================================================
---- rpm-5.4.15.orig/tools/rpmcache.c
-+++ rpm-5.4.15/tools/rpmcache.c
-@@ -3,7 +3,9 @@
-  */
- 
- #include "system.h"
-+#ifdef __GLIBC__
- const char *__progname;
-+#endif
- 
- #include <fnmatch.h>
- #include <fts.h>
-Index: rpm-5.4.15/tools/rpmdeps-oecore.c
-===================================================================
---- rpm-5.4.15.orig/tools/rpmdeps-oecore.c
-+++ rpm-5.4.15/tools/rpmdeps-oecore.c
-@@ -1,5 +1,7 @@
- #include "system.h"
-+#ifdef __GLIBC__
- const char *__progname;
-+#endif
- 
- #include <rpmio.h>
- #include <rpmiotypes.h>
-Index: rpm-5.4.15/tools/rpmdeps.c
-===================================================================
---- rpm-5.4.15.orig/tools/rpmdeps.c
-+++ rpm-5.4.15/tools/rpmdeps.c
-@@ -1,5 +1,7 @@
- #include "system.h"
-+#ifdef __GLIBC__
- const char *__progname;
-+#endif
- 
- #include <rpmio.h>
- #include <rpmiotypes.h>
-Index: rpm-5.4.15/tools/rpmdigest.c
-===================================================================
---- rpm-5.4.15.orig/tools/rpmdigest.c
-+++ rpm-5.4.15/tools/rpmdigest.c
-@@ -1,6 +1,8 @@
- #include "system.h"
-+#ifdef __GLIBC__
- /*@unchecked@*/
- extern const char * __progname;
-+#endif
- 
- #define	_RPMIOB_INTERNAL
- #include <rpmiotypes.h>
-Index: rpm-5.4.15/tools/rpmcmp.c
-===================================================================
---- rpm-5.4.15.orig/tools/rpmcmp.c
-+++ rpm-5.4.15/tools/rpmcmp.c
-@@ -13,8 +13,10 @@
- 
- #include "debug.h"
- 
-+#ifdef __GLIBC__
- const char *__progname;
- #define	progname	__progname
-+#endif
- 
- static int pointRpmEVR(ARGV_t av)
- {
-Index: rpm-5.4.15/rpmqv.c
-===================================================================
---- rpm-5.4.15.orig/rpmqv.c
-+++ rpm-5.4.15/rpmqv.c
-@@ -1,5 +1,7 @@
- #include "system.h"
-+#ifdef __GLIBC__
- extern const char *__progname;
-+#endif
- 
- /* Copyright (C) 1998-2002 - Red Hat, Inc. */
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-system.h-query.c-support-nosignature.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-system.h-query.c-support-nosignature.patch
deleted file mode 100644
index 77dc5b6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-system.h-query.c-support-nosignature.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From d8fcc3cbeec4defb5babde5bd09ea294dd3fd08b Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Sun, 3 Jul 2016 19:01:59 -0700
-Subject: [PATCH] system.h/query.c: support nosignature
-
-* Define SUPPORT_NOSIGNATURES to 1 in system.h
-* !QVA_ISSET(qva->qva_flags, SIGNATURE) -> QVA_ISSET(qva->qva_flags, SIGNATURE),
-  otherwise, when use --nosignature would read database and verify
-  signature, this is not expected.
-
-Upstream-Status: Submitted [Sent email to rpm-devel@rpm5.org]
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- lib/query.c | 6 +++---
- system.h    | 4 ++--
- 2 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/lib/query.c b/lib/query.c
-index 50a7453..b761d76 100644
---- a/lib/query.c
-+++ b/lib/query.c
-@@ -954,19 +954,19 @@ JBJDEBUG((stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, qva, argv));
-     vsflags = (rpmVSFlags) rpmExpandNumeric("%{?_vsflags_query}");
-     vsflags = (rpmVSFlags) 0;	/* XXX FIXME: ignore default disablers. */
- #if defined(SUPPORT_NOSIGNATURES)
--    if (!QVA_ISSET(qva->qva_flags, DIGEST)) {
-+    if (QVA_ISSET(qva->qva_flags, DIGEST)) {
- 	VSF_SET(vsflags, NOSHA1HEADER);
- 	VSF_SET(vsflags, NOMD5HEADER);
- 	VSF_SET(vsflags, NOSHA1);
- 	VSF_SET(vsflags, NOMD5);
-     }
--    if (!QVA_ISSET(qva->qva_flags, SIGNATURE)) {
-+    if (QVA_ISSET(qva->qva_flags, SIGNATURE)) {
- 	VSF_SET(vsflags, NODSAHEADER);
- 	VSF_SET(vsflags, NORSAHEADER);
- 	VSF_SET(vsflags, NODSA);
- 	VSF_SET(vsflags, NORSA);
-     }
--    if (!QVA_ISSET(qva->qva_flags, HDRCHK)) {
-+    if (QVA_ISSET(qva->qva_flags, HDRCHK)) {
- 	VSF_SET(vsflags, NOHDRCHK);
-     }
-     VSF_CLR(vsflags, NEEDPAYLOAD);	/* XXX needed? */
-diff --git a/system.h b/system.h
-index 2ff8906..ad4619a 100644
---- a/system.h
-+++ b/system.h
-@@ -787,9 +787,9 @@ static inline const char *rcsid(const char *p) { \
- #define SUPPORT_I18NSTRING_TYPE	1
- 
- /**
-- * Eliminate signature/digest disablers.
-+ * Signature/digest disablers.
-  */
--#undef	SUPPORT_NOSIGNATURES
-+#define SUPPORT_NOSIGNATURES 1
- 
- /**
-  * Permit ar(1) payloads. Disabled while rpmio/iosm.c is under development.
--- 
-2.9.0
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
deleted file mode 100644
index 7128250..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 64851c6622aff64787a9fcea26cccde183b7c743 Mon Sep 17 00:00:00 2001
-From: "Roy.Li" <rongqing.li@windriver.com>
-Date: Tue, 11 Nov 2014 16:28:22 +0800
-Subject: [PATCH] using poptParseArgvString to parse the
- _gpg_check_password_cmd
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Both __gpg_check_password_cmd and __gpg_sign_cmd include "%{_gpg_name}", but
-strace shows that gpg_name has a quote when run _gpg_check_password,
-but not when run __gpg_sign_cmd; for example, if gpg_name is "tester"
-
-    execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose",
-    "--passphrase-fd", "3", "-u", "\"tester\"", "-so", "-"], [/* 20 vars */]) = 0
-
-    execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose", "--no-armor",
-    "--passphrase-fd", "3", "--no-secmem-warning", "-u", "tester", "-sbo"..,) = 0
-
-it can be fixed by removing the quote around %{gpg_name} when define
-__gpg_check_password_cmd in macros/macros, like below, but if gpg_name includes
-space, it will not work.
-
-     %__gpg_check_password_cmd       %{__gpg} \
-        gpg --batch --no-verbose --passphrase-fd 3 -u %{_gpg_name} -so -
-
-The poptParseArgvString function is used to parse _gpg_sign_cmd, so using
-poptParseArgvString to parse __gpg_check_password_cmd to fix this issue.
-
-Signed-off-by: Roy.Li <rongqing.li@windriver.com>
----
- rpmdb/signature.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/rpmdb/signature.c b/rpmdb/signature.c
-index c35e0ab..016e8d1 100644
---- a/rpmdb/signature.c
-+++ b/rpmdb/signature.c
-@@ -529,7 +529,7 @@ int rpmCheckPassPhrase(const char * passPhrase)
-   		(void) setenv("GNUPGHOME", gpg_path, 1);
- 
- 	    cmd = rpmExpand("%{?__gpg_check_password_cmd}", NULL);
--	    rc = argvSplit(&av, cmd, NULL);
-+	    rc = poptParseArgvString(cmd, NULL, (const char ***)&av);
- 	    if (!rc)
- 		rc = execve(av[0], (char *const *)av+1, environ);
- 
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/configure.ac-check-for-both-gpg2-and-gpg.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/configure.ac-check-for-both-gpg2-and-gpg.patch
deleted file mode 100644
index 7894a42..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/configure.ac-check-for-both-gpg2-and-gpg.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-configure.ac: search for both gpg2 and gpg
-
-On some platforms the GnuPG binary is named 'gpg2' whereas others have 'gpg'.
-This patch increases compatibility by searching for 'gpg' in addition to
-'gpg2'.
-
-Upstream-Status: Pending
-
-Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index 6746b4c..f6922ae 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -562,7 +562,7 @@ AC_PATH_PROG(__DIFF, diff, /bin/diff, $MYPATH)
- AC_PATH_PROG(__DITTO, ditto, %{_bindir}/ditto, $MYPATH)
- AC_PATH_PROG(__FILE, file, %{_bindir}/file, $MYPATH)
- AC_PATH_PROG(__GIT, git, %{_bindir}/git, $MYPATH)
--AC_PATH_PROG(__GPG, gpg2, %{_bindir}/gpg2, $MYPATH)
-+AC_PATH_PROGS(__GPG, [gpg2 gpg], %{_bindir}/gpg2, $MYPATH)
- AC_PATH_PROG(__GSR, gsr, %{_bindir}/gsr, $MYPATH)
- AC_PATH_PROG(__GST_INSPECT, gst-inspect-0.10, %{_bindir}/gst-inspect-0.10, $MYPATH)
- AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH)
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/dbconvert.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/dbconvert.patch
deleted file mode 100644
index 1fdbf09..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/dbconvert.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Upstream-Status: Inappropriate
-
-Hack to prevent unneeded demo app from building on older libc
-where it will break the build
-
-Index: rpm-5.4.14/tools/Makefile.am
-===================================================================
---- rpm-5.4.14.orig/tools/Makefile.am
-+++ rpm-5.4.14/tools/Makefile.am
-@@ -29,7 +29,7 @@ EXTRA_PROGRAMS = nix-copy-closure nix-en
- 	xiu-instantiate xiu-store
- noinst_PROGRAMS =
- 
--EXTRA_PROGRAMS += augtool cudftool dbconvert debugedit \
-+EXTRA_PROGRAMS += augtool cudftool debugedit \
- 	nix-build nix-channel nix-collect-garbage \
- 	nix-log2xml nix-prefetch-url nix-pull nix-push \
- 	xiu-echo xiu-hash \
-@@ -64,7 +64,7 @@ pkgbin_PROGRAMS =	\
- 	rpmcache rpmdigest rpmrepo rpmspecdump \
- 	rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
- if WITH_DB
--pkgbin_PROGRAMS +=	dbconvert
-+pkgbin_PROGRAMS +=	
- endif
- dist_man_MANS =		rpmgrep.1
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
deleted file mode 100644
index c83c8b5..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-During the recalculation of the buildid, it's necessary to change the word
-back to the original endian.  However, if we do this in-place, we've also
-affected the headers that we're also working on.  The side effect of this is
-we can no longer rely on 'sh_type' as it may have been changed.
-
-This patch ensures that any time we translate the loaded data to the machine
-format, we only do it in a backup copy and never the original copy.
-
-Note: in all other places a backup copy was used, just not buildid processing.
-
-Also the process (...) function was modified to verify the data is not
-NULL as well.  This is an extra check and is not strictly necessary.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/tools/debugedit.c
-===================================================================
---- rpm.orig/tools/debugedit.c
-+++ rpm/tools/debugedit.c
-@@ -1403,7 +1403,8 @@ static inline void process (hashFunction
- 		const void *data, size_t size)
- {
-     memchunk chunk = { .data = (void *) data, .size = size };
--    hashFunctionContextUpdateMC (ctx, &chunk);
-+    if (data != NULL && size != 0)
-+      hashFunctionContextUpdateMC (ctx, &chunk);
- }
- 
- /* Compute a fresh build ID bit-string from the editted file contents.  */
-@@ -1456,14 +1457,16 @@ handle_build_id (DSO *dso, Elf_Data *bui
-       GElf_Ehdr ehdr;
-       GElf_Phdr phdr;
-       GElf_Shdr shdr;
--    } u;
--    Elf_Data x = { .d_version = EV_CURRENT, .d_buf = &u };
--
--    x.d_type = ELF_T_EHDR;
--    x.d_size = sizeof u.ehdr;
--    u.ehdr = dso->ehdr;
--    u.ehdr.e_phoff = u.ehdr.e_shoff = 0;
--    if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
-+    } u1, u2;
-+    Elf_Data src  = { .d_version = EV_CURRENT, .d_buf = &u1 };
-+    Elf_Data dest = { .d_version = EV_CURRENT, .d_buf = &u2 };
-+
-+    src.d_type = ELF_T_EHDR;
-+    src.d_size = sizeof u1.ehdr;
-+    dest.d_size = sizeof u2.ehdr;
-+    u1.ehdr = dso->ehdr;
-+    u1.ehdr.e_phoff = u1.ehdr.e_shoff = 0;
-+    if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
-       {
-       bad:
- 	fprintf (stderr, "Failed to compute header checksum: %s\n",
-@@ -1471,29 +1474,31 @@ handle_build_id (DSO *dso, Elf_Data *bui
- 	exit (1);
-       }
- 
--    x.d_type = ELF_T_PHDR;
--    x.d_size = sizeof u.phdr;
-+    src.d_type = ELF_T_PHDR;
-+    src.d_size = sizeof u1.phdr;
-+    dest.d_size = sizeof u2.phdr;
-     for (i = 0; i < dso->ehdr.e_phnum; ++i)
-       {
--	if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL)
-+	if (gelf_getphdr (dso->elf, i, &u1.phdr) == NULL)
- 	  goto bad;
--	if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
-+	if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
- 	  goto bad;
--	process (&ctx, x.d_buf, x.d_size);
-+	process (&ctx, dest.d_buf, dest.d_size);
-       }
- 
--    x.d_type = ELF_T_SHDR;
--    x.d_size = sizeof u.shdr;
-+    src.d_type = ELF_T_SHDR;
-+    src.d_size = sizeof u1.shdr;
-+    dest.d_size = sizeof u2.shdr;
-     for (i = 0; i < dso->ehdr.e_shnum; ++i)
-       if (dso->scn[i] != NULL)
- 	{
--	  u.shdr = dso->shdr[i];
--	  u.shdr.sh_offset = 0;
--	  if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
-+	  u1.shdr = dso->shdr[i];
-+	  u1.shdr.sh_offset = 0;
-+	  if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
- 	    goto bad;
--	  process (&ctx, x.d_buf, x.d_size);
-+	  process (&ctx, dest.d_buf, dest.d_size);
- 
--	  if (u.shdr.sh_type != SHT_NOBITS)
-+	  if (u1.shdr.sh_type != SHT_NOBITS)
- 	    {
- 	      Elf_Data *d = elf_rawdata (dso->scn[i], NULL);
- 	      if (d == NULL)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch
deleted file mode 100644
index 8040482..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-debugedit: fix segment fault while file's bss offset have a large number
-
-While ELF_C_RDWR_MMAP was used, elf_begin invoked mmap() to map file
-into memory. While the file's bss Offset has a large number, elf_update
-caculated file size by __elf64_updatenull_wrlock and the size was
-enlarged.
-
-In this situation, elf_update invoked ftruncate to enlarge the file,
-and memory size (elf->maximum_size) also was incorrectly updated.
-There was segment fault in elf_end which invoked munmap with the
-length is the enlarged file size, not the mmap's length.
-
-Before the above operations, invoke elf_begin/elf_update/elf_end
-with ELF_C_RDWR and ELF_F_LAYOUT set to enlarge the above file, it
-could make sure the file is safe for the following elf operations.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- tools/debugedit.c | 25 +++++++++++++++++++++++++
- 1 file changed, 25 insertions(+)
-
-Index: rpm-5.4.14/tools/debugedit.c
-===================================================================
---- rpm-5.4.14.orig/tools/debugedit.c
-+++ rpm-5.4.14/tools/debugedit.c
-@@ -1525,6 +1525,28 @@ handle_build_id (DSO *dso, Elf_Data *bui
-   }
- }
- 
-+/* It avoided the segment fault while file's bss offset have a large number.
-+   See https://bugzilla.redhat.com/show_bug.cgi?id=1019707
-+       https://bugzilla.redhat.com/show_bug.cgi?id=1020842 for detail. */
-+void valid_file(int fd)
-+{
-+  Elf *elf = elf_begin (fd, ELF_C_RDWR, NULL);
-+  if (elf == NULL)
-+  {
-+    error (1, 0, "elf_begin: %s", elf_errmsg (-1));
-+    return;
-+  }
-+
-+  elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT);
-+
-+  if (elf_update (elf, ELF_C_WRITE) < 0)
-+    error (1, 0, "elf_update: %s", elf_errmsg (-1));
-+
-+  elf_end (elf);
-+
-+  return;
-+}
-+
- int
- main (int argc, char *argv[])
- {
-@@ -1621,6 +1643,9 @@ main (int argc, char *argv[])
-       exit (1);
-     }
- 
-+  /* Make sure the file is valid. */
-+  valid_file(fd);
-+
-   dso = fdopen_dso (fd, file);
-   if (dso == NULL)
-     exit (1);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/gcc6-stdlib.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/gcc6-stdlib.patch
deleted file mode 100644
index 0a372c6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/gcc6-stdlib.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-gcc6 has fixed a long standing c++ include issue where <cheader>
-was different from <header.h> inclusion via
-
-https://gcc.gnu.org/ml/libstdc++/2016-01/msg00025.html
-
-and its also descibed in https://gcc.gnu.org/gcc-6/porting_to.html
-rpmio component uses some .cpp and .cc fies which need to use
-C stdlib.h from C library and not the C++ libstdc++ header
-therefore we pass _GLIBCXX_INCLUDE_NEXT_C_HEADERS so that it
-keeps the old behavior
-
-/a/build/tmp/sysroots/raspberrypi2/usr/include/c++/6.0.1/cstdlib:143:11: error: '::getenv' has not been declared
-   using ::getenv;
-           ^~~~~~
-In file included from ../../rpm-5.4.15/system.h:201:0,
-                 from ../../rpm-5.4.15/rpmio/rpmjs.cpp:1:
-/a/build/tmp/sysroots/raspberrypi2/usr/include/c++/6.0.1/stdlib.h:62:12: error: 'std::getenv' has not been declared
- using std::getenv;
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Index: rpm-5.4.15/rpmio/Makefile.am
-===================================================================
---- rpm-5.4.15.orig/rpmio/Makefile.am
-+++ rpm-5.4.15/rpmio/Makefile.am
-@@ -151,7 +151,7 @@ librpmio_la_SOURCES = \
- 	groestl.c hamsi.c jh.c keccak.c lane.c luffa.c md2.c md6.c radiogatun.c\
- 	salsa10.c salsa20.c shabal.c shavite3.c simd.c skein.c tib3.c tiger.c \
- 	rpmgit.c rpmio-stub.c \
--	rpmjs.cpp rpmjsio.c rpmkeyring.c \
-+	rpmjni.cc rpmjs.cpp rpmjsio.c rpmkeyring.c \
- 	rpmnix.c rpmodbc.c rpmsql.c set.c \
- 	ar.c \
- 	argv.c \
-@@ -195,7 +195,6 @@ librpmio_la_SOURCES = \
- 	rpmhook.c \
- 	rpmio.c \
- 	rpmiob.c \
--	rpmjni.cc \
- 	rpmku.c \
- 	rpmlog.c \
- 	rpmltc.c \
-@@ -279,7 +278,9 @@ keccak.lo: $(top_srcdir)/rpmio/keccak.c
- #rpmjs.lo: $(top_srcdir)/rpmio/rpmjs.c
- #	@$(LTCOMPILE) -O0 -c $<
- rpmjs.lo: $(top_srcdir)/rpmio/rpmjs.cpp
--	@$(LTCOMPILE) -O0 -c $<
-+	@$(LTCOMPILE) -O0 -c -D_GLIBCXX_INCLUDE_NEXT_C_HEADERS $<
-+rpmjni.lo: $(top_srcdir)/rpmio/rpmjni.cc
-+	@$(LTCOMPILE) -O0 -c -D_GLIBCXX_INCLUDE_NEXT_C_HEADERS $<
- 
- YACC = byacc -d
- getdate.c: getdate.y
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/header-include-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/header-include-fix.patch
deleted file mode 100644
index e72df45..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/header-include-fix.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Update two rpm headers to include other headers.
-
-Using rpmdb.h w/o including errno.h may result in a warning.
-
-Using rpmtag.h w/o also adding stdint.h will result in numerous failures
-about unknown types on modern compilers.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Qing He <qing.he@intel.com>
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/rpmdb/rpmdb.h
-===================================================================
---- rpm-5.4.14.orig/rpmdb/rpmdb.h
-+++ rpm-5.4.14/rpmdb/rpmdb.h
-@@ -9,6 +9,7 @@
- 
- #include <assert.h>
- #include <mire.h>
-+#include <errno.h>
- 
- #include <rpmtypes.h>
- #include <rpmtag.h>	/* XXX Header typedef */
-Index: rpm-5.4.14/rpmdb/rpmtag.h
-===================================================================
---- rpm-5.4.14.orig/rpmdb/rpmtag.h
-+++ rpm-5.4.14/rpmdb/rpmtag.h
-@@ -7,6 +7,7 @@
- 
- #include <rpmiotypes.h>
- #include <rpmsw.h>
-+#include <stdint.h>
- 
- #ifdef __cplusplus
- extern "C" {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch
deleted file mode 100644
index 5d936db..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-rpm: Resolve parallel install issue when installing lua
-
-When lua is being installed on some systems that are being run with high levels
-of parallelization there are cases where install-data-am and install-exec-hook
-are processed at the same or a very short time apart. This causes
-install-pkgbinPROGRAMS, which is a dependency of both, to be run at around the
-same time This sometimes causes file contention and will sometimes be in a state
-where install-exec-hook is looking for a file that is being installed or both
-install-pkgbinPROGRAMS being run are installing the same file and fail because
-it cannon create a new file.
-
-This patch allows install-exec-hook to be called by install-data-am instead of
-install-exec-am. It also removed the dependency in install-data-hook on
-install-pkgbinPROGRAMS. This means install-pkgbinPROGRAMS will only be run once
-so there whould be any file contention.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Morgan Little <morgan.little@windriver.com>
-
-Index: rpm-5.4.14/lua/Makefile.am
-===================================================================
---- rpm-5.4.14.orig/lua/Makefile.am
-+++ rpm-5.4.14/lua/Makefile.am
-@@ -326,7 +326,7 @@ clean-local:
- # XXX Build & install as rpmlua/rpmluac with hardlinks to lua/luac post install.
- # XXX CVS has lua/luac sub-directories in the Attic that collide with the
- # XXX lua/luac executable names when using cvs update.
--install-exec-hook:	install-pkgbinPROGRAMS
-+install-data-hook:	
- 	mkdir -p $(DESTDIR)$(pkgbindir)
- 	$(__RM) -f $(DESTDIR)$(pkgbindir)/lua
- 	$(__LN) $(DESTDIR)$(pkgbindir)/rpmlua $(DESTDIR)$(pkgbindir)/lua
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch
deleted file mode 100644
index 410623f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Don't put LDFLAGS into the Libs.private, all it generally contains is a linker
-hash selection (harmless) and the absolute path to the libdir in the sysroot
-(actively harmful).
-
-Upstream-Status: Pending
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-diff --git a/scripts/rpm.pc.in b/scripts/rpm.pc.in
-index 8293471..2ea469c 100644
---- a/scripts/rpm.pc.in
-+++ b/scripts/rpm.pc.in
-@@ -17 +17 @@ Libs: -L${libdir} -lrpmbuild${suffix} -lrpm${suffix} -lrpmdb${suffix} -lrpmio${s
--Libs.private: @LDFLAGS@ @LIBS@
-+Libs.private: @LIBS@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh
deleted file mode 100755
index b72c9f0..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-
-: ${RPMDEPS:=rpmdeps}
-
-process() {
-	while read file_name ; do
-		printf "%s\t" ${file_name}
-		if [ ! -d $file_name ]; then
-			printf "%s " $($RPMDEPS $1 $file_name | sed -e 's,rpmlib(.*,,' -e 's,\([<>\=]\+ \+[^ ]*\),(\1),g')
-		fi
-		printf "\n"
-	done
-}
-
-usage() {
-	echo "$0 {-P|--provides} {-R|--requires} FILE ..."
-}
-
-while [ $# -gt 0 ]; do
-   case "$1" in
-	--rpmdeps)
-		RPMDEPS=$2
-		shift
-		shift
-		;;
-	-R|--requires)
-		process_type=--requires
-		shift
-		;;
-	-P|--provides)
-		process_type=--provides
-		shift
-		;;
-	*)
-		break;
-		;;
-   esac
-done
-
-if [ -z "$process_type" ]; then
-	usage
-	exit 1
-fi
-
-if [ $# -gt 0 ]; then
-	find "$@" | process $process_type
-	exit $?
-fi
-
-process $process_type
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/popt-disable-auto-stack-protector.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/popt-disable-auto-stack-protector.patch
deleted file mode 100644
index bcad8dcb..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/popt-disable-auto-stack-protector.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-popt: Disable default stack protection on internal version of popt
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.15/popt/configure.ac
-===================================================================
---- rpm-5.4.15.orig/popt/configure.ac
-+++ rpm-5.4.15/popt/configure.ac
-@@ -123,7 +123,6 @@ AS_IF([test "x$popt_gcc_warnings" = xyes
-   popt_CFLAGS_ADD([-Wjump-misses-init],[POPT_CFLAGS])
-   popt_CFLAGS_ADD([-Wno-format-nonliteral],[POPT_CFLAGS])
-   popt_CFLAGS_ADD([-Wframe-larger-than=$MAX_STACK_SIZE],[POPT_CFLAGS])
--  popt_CFLAGS_ADD([-fstack-protector-all],[POPT_CFLAGS])
-   popt_CFLAGS_ADD([-fasynchronous-unwind-tables],[POPT_CFLAGS])
-   popt_CFLAGS_ADD([-fdiagnostics-show-option],[POPT_CFLAGS])
-   popt_CFLAGS_ADD([-funit-at-a-time],[POPT_CFLAGS])
-@@ -203,7 +202,7 @@ AC_SUBST([POPT_LDFLAGS])
- # -fno-delete-null-pointer as the kernel does http://patchwork.kernel.org/patch/36060/
- # GNU GCC (usually "gcc")
- AS_IF([test "x$GCC" != x],
-- [ for c in -fno-delete-null-pointer-checks -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions
-+ [ for c in -fno-delete-null-pointer-checks -fexceptions
-    do
-   	popt_CFLAGS_ADD([$c], [POPT_CFLAGS])
-    done
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch
deleted file mode 100644
index 590f58d..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-rpmmodule.c: Export a few additional RPMSENSE values
-
-We want to see the RPMSENSE_SCRIPT values for use with SMART.  We also
-want to see the MISSINGOK value so we can avoid recommended packages causing
-failures.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/python/rpmmodule.c
-===================================================================
---- rpm.orig/python/rpmmodule.c
-+++ rpm/python/rpmmodule.c
-@@ -525,12 +525,15 @@ static int initModule(PyObject *m)
-     REGISTER_ENUM(RPMSENSE_PREREQ);
-     REGISTER_ENUM(RPMSENSE_PRETRANS);
-     REGISTER_ENUM(RPMSENSE_INTERP);
-+#else
-+ #if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
-     REGISTER_ENUM(RPMSENSE_SCRIPT_PRE);
-     REGISTER_ENUM(RPMSENSE_SCRIPT_POST);
-     REGISTER_ENUM(RPMSENSE_SCRIPT_PREUN);
-     REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN);
-     REGISTER_ENUM(RPMSENSE_SCRIPT_VERIFY);
--#else
-+    REGISTER_ENUM(RPMSENSE_MISSINGOK);
-+ #endif
-     REGISTER_ENUM(RPMSENSE_NOTEQUAL);
- #endif
-     REGISTER_ENUM(RPMSENSE_FIND_REQUIRES);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/pythondeps.sh b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/pythondeps.sh
deleted file mode 100755
index 083b174..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/pythondeps.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-[ $# -ge 1 ] || {
-    cat > /dev/null
-    exit 0
-}
-
-case $1 in
--R|--requires)
-    shift
-    grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python"
-    exit 0
-    ;;
-esac
-
-exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-atomic-ops.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-atomic-ops.patch
deleted file mode 100644
index cc241f4..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-atomic-ops.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-Some architectures do not have __sync_add_and_fetch_8 implemented.
-
-MIPS (32-bit) and some PPC systems do not have sync_add_and_fetch_8.
-
-Provide an alternative.  This alternative function is based on code from:
-  https://github.com/mongodb/libbson/blob/master/src/bson/bson-atomic.c
-
-Code is under an Apache 2.0 License.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.15/rpmio/bson.h
-===================================================================
---- rpm-5.4.15.orig/rpmio/bson.h
-+++ rpm-5.4.15/rpmio/bson.h
-@@ -879,10 +879,18 @@ BSON_END_DECLS
- 
- BSON_BEGIN_DECLS
- 
-+/* Some architectures do not support __sync_add_and_fetch_8 */
-+#if (__mips == 32) || (defined(__PPC__) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8))
-+# define __BSON_NEED_ATOMIC_64 1
-+#endif
- 
- #if defined(__GNUC__)
- # define bson_atomic_int_add(p, v)   (__sync_add_and_fetch(p, v))
--# define bson_atomic_int64_add(p, v) (__sync_add_and_fetch_8(p, v))
-+#ifndef __BSON_NEED_ATOMIC_64
-+#  define bson_atomic_int64_add(p, v) (__sync_add_and_fetch_8(p, v))
-+# else
-+   int64_t bson_atomic_int64_add (volatile int64_t *p, int64_t n);
-+# endif
- # define bson_memory_barrier         __sync_synchronize
- #elif defined(_MSC_VER) || defined(_WIN32)
- # define bson_atomic_int_add(p, v)   (InterlockedExchangeAdd((long int *)(p), v))
-Index: rpm-5.4.15/rpmio/bson.c
-===================================================================
---- rpm-5.4.15.orig/rpmio/bson.c
-+++ rpm-5.4.15/rpmio/bson.c
-@@ -3863,13 +3863,30 @@ _bson_context_get_oid_seq64_threadsafe (
- #elif defined BSON_OS_WIN32
-    uint64_t seq = InterlockedIncrement64 ((int64_t *)&context->seq64);
- #else
--   uint64_t seq = __sync_fetch_and_add_8 (&context->seq64, 1);
-+   uint64_t seq = bson_atomic_int64_add (&context->seq64, 1);
- #endif
- 
-    seq = BSON_UINT64_TO_BE (seq);
-    memcpy (&oid->bytes[4], &seq, 8);
- }
- 
-+#ifdef __BSON_NEED_ATOMIC_64
-+#include <pthread.h>
-+static pthread_mutex_t gSync64 = PTHREAD_MUTEX_INITIALIZER;
-+int64_t
-+bson_atomic_int64_add (volatile int64_t *p,
-+                       int64_t           n)
-+{
-+   int64_t ret;
-+
-+   pthread_mutex_lock (&gSync64);
-+   *p += n;
-+   ret = *p;
-+   pthread_mutex_unlock (&gSync64);
-+
-+   return ret;
-+}
-+#endif
- 
- /**
-  * bson_context_new:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch
deleted file mode 100644
index 258a7f6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-In order to enable musl or other libc support, force update the config.guess
-
-In order to reliably replace config.guess and config.sub, we need to remove
-them prior to the call to automake.  Adding the --force-missing is likely
-not necessary, but matching normal OE autoreconf usage.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.15/autogen.sh
-===================================================================
---- rpm-5.4.15.orig/autogen.sh
-+++ rpm-5.4.15/autogen.sh
-@@ -73,7 +73,8 @@ rm -f aclocal.m4
- aclocal -I m4
- autoheader -I m4
- echo "---> generate files via GNU automake (automake)"
--automake -Wall -Wno-override -a -c
-+rm -f config.guess config.sub
-+automake -Wall -Wno-override -a -c --force-missing
- echo "---> generate files via GNU autoconf (autoconf)"
- autoconf -I m4
- echo "<=== rpm"
-Index: rpm-5.4.15/beecrypt/autogen.sh
-===================================================================
---- rpm-5.4.15.orig/beecrypt/autogen.sh
-+++ rpm-5.4.15/beecrypt/autogen.sh
-@@ -25,6 +25,7 @@ libtoolize () {
- 
- libtoolize --force --copy
- aclocal
--automake -a -c
-+rm -f config.guess config.sub
-+automake -a -c --force-missing
- autoconf
- autoheader
-Index: rpm-5.4.15/libtpm/autogen.sh
-===================================================================
---- rpm-5.4.15.orig/libtpm/autogen.sh
-+++ rpm-5.4.15/libtpm/autogen.sh
-@@ -46,7 +46,8 @@ echo "---> generate files via GNU autoco
- aclocal
- autoheader
- echo "---> generate files via GNU automake (automake)"
--automake -Wall -Wno-override -a -c
-+rm -f config.guess config.sub
-+automake -Wall -Wno-override -a -c --force-missing
- echo "---> generate files via GNU autoconf (autoconf)"
- autoconf
- 
-Index: rpm-5.4.15/neon/autogen.sh
-===================================================================
---- rpm-5.4.15.orig/neon/autogen.sh
-+++ rpm-5.4.15/neon/autogen.sh
-@@ -63,7 +63,8 @@ echo "---> generate files via GNU autoco
- ${ACLOCAL:-aclocal} -I macros
- ${AUTOHEADER:-autoheader}
- echo "---> generate files via GNU automake (automake)"
--${AUTOMAKE:-automake} -Wall -Wno-override -a -c
-+rm -f config.guess config.sub
-+${AUTOMAKE:-automake} -Wall -Wno-override -a -c --force-missing
- echo "---> generate files via GNU autoconf (autoconf)"
- ${AUTOCONF:-autoconf} -Wall
- 
-Index: rpm-5.4.15/syck/autogen.sh
-===================================================================
---- rpm-5.4.15.orig/syck/autogen.sh
-+++ rpm-5.4.15/syck/autogen.sh
-@@ -40,6 +40,7 @@ echo "---> generate files via GNU autoco
- aclocal
- autoheader
- echo "---> generate files via GNU automake (automake)"
--automake -Wall -Wno-override -a -c
-+rm -f config.guess config.sub
-+automake -Wall -Wno-override -a -c --force-missing
- echo "---> generate files via GNU autoconf (autoconf)"
- autoconf
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
deleted file mode 100644
index 8771235..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Remove the sanity checking from the rpm autogen.sh.  This is required because
-we may have slightly different, but yet compatible versions.  If we do end
-up breaking things, we'll deal with it at that time.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/syck/autogen.sh
-===================================================================
---- rpm-5.4.14.orig/syck/autogen.sh
-+++ rpm-5.4.14/syck/autogen.sh
-@@ -34,12 +34,6 @@ libtoolize () {
-     eval $_libtoolize $_libtoolize_args
- }
- 
--#   requirements sanity check
--[ "`automake   --version | head -1`" != "$AMV" ] && echo "$USAGE" # && exit 1
--[ "`autoconf   --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1
--[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1
--[ "`gettextize --version | head -1 | sed -e 's;^.*/\\(gettextize\\);\\1;'`" != "$GTT" ] && echo "$USAGE" # && exit 1
--
- echo "---> generate files via GNU libtool (libtoolize)"
- libtoolize --quiet --copy --force --install
- echo "---> generate files via GNU autoconf (aclocal, autoheader)"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch
deleted file mode 100644
index 81fc849..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-lib/rpmrc.c: Update --target processing to support full GNU canonical arch
-
-Prior to this patch, when using --target, RPM supported the format:
-  <arch>
-  <arch>-<os>
-  <arch>-<os>-gnu
-  <arch>-<arbitrary items>-<os>
-  <arch>-<arbitrary items>-<os>-gnu
-
-This patch changes the list of supported items to:
-  <arch>
-  <arch>-<os>
-  <arch>-<os>-gnu
-  <arch>-<vendor>-<os>
-  <arch>-<vendor>-<os>-<extension>
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/lib/rpmrc.c
-===================================================================
---- rpm-5.4.14.orig/lib/rpmrc.c
-+++ rpm-5.4.14/lib/rpmrc.c
-@@ -925,8 +925,8 @@ static void getMachineInfo(int type, /*@
- 
- static void rpmRebuildTargetVars(const char ** target, const char ** canontarget)
- {
--
--    char *ca = NULL, *co = NULL, *ct = NULL;
-+    /* ca = arch, cv = vendor, co = os, ce = extension, ct = canon target */
-+    char *ca = NULL, *cv = NULL, *co = NULL, *ce = NULL, *ct = NULL;
-     int x;
- 
-     /* Rebuild the compat table to recalculate the current target arch.  */
-@@ -936,23 +936,60 @@ static void rpmRebuildTargetVars(const c
-     rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS);
- 
-     if (target && *target) {
-+	/* GNU canonical format is:
-+	 *  <arch>-<vendor>-<os>[-extension]
-+	 *
-+	 * We support the both the GNU canonical format
-+	 * as well as the traditional RPM formats: 
-+	 *  <arch>
-+	 *  <arch>-<os>[-gnu]
-+	 */
- 	char *c;
- 	/* Set arch and os from specified build target */
- 	ca = xstrdup(*target);
--	if ((c = strchr(ca, '-')) != NULL) {
-+	if ((c = strchr(ca, '-')) == NULL) {
-+	    /* Format is <arch> */
-+	    ;
-+	} else {
- 	    *c++ = '\0';
--	    
--	    if ((co = strrchr(c, '-')) == NULL) {
--		co = c;
-+	    cv = c;
-+
-+	    if ((c = strchr(c, '-')) == NULL) {
-+		/* Format is <arch>-<os> */
-+		co = cv;
-+		cv = NULL;
- 	    } else {
--		if (!xstrcasecmp(co, "-gnu"))
--		    *co = '\0';
--		if ((co = strrchr(c, '-')) == NULL)
--		    co = c;
--		else
--		    co++;
-+		*c++ = '\0';
-+		co = c;
-+
-+		if ((c = strchr(c, '-')) == NULL) {
-+		    /* Might be:
-+		     *  <arch>-<vendor>-<os>
-+		     *  <arch>-<os>-gnu
-+		     */
-+		    if (!xstrcasecmp(co, "gnu")) {
-+			/* Format was <arch>-<os>-gnu */
-+			ce = co;
-+			co = cv;
-+			cv = NULL;
-+		    }
-+		} else {
-+		    /* Format was <arch>-<vendor>-<os>-<extension> */
-+		    *c++ = '\0';
-+		    ce = c;
-+		}
- 	    }
-+	    if (cv != NULL) cv = xstrdup(cv);
- 	    if (co != NULL) co = xstrdup(co);
-+	    if (ce != NULL) {
-+		/* We need to prefix it with a "-" */
-+		char * lce = NULL;
-+
-+		lce = xmalloc(strlen(ce) + sizeof("-"));
-+		sprintf(lce, "-%s", ce);
-+
-+		ce = lce;
-+	    }
- 	}
-     } else {
- 	const char *a = NULL;
-@@ -995,8 +1032,16 @@ static void rpmRebuildTargetVars(const c
-     addMacro(NULL, "_target", NULL, ct, RMIL_RPMRC);
-     delMacro(NULL, "_target_cpu");
-     addMacro(NULL, "_target_cpu", NULL, ca, RMIL_RPMRC);
-+    if (cv) {
-+	delMacro(NULL, "_target_vendor");
-+	addMacro(NULL, "_target_vendor", NULL, cv, RMIL_RPMRC);
-+    }
-     delMacro(NULL, "_target_os");
-     addMacro(NULL, "_target_os", NULL, co, RMIL_RPMRC);
-+    if (ce) {
-+	delMacro(NULL, "_gnu");
-+	addMacro(NULL, "_gnu", NULL, ce, RMIL_RPMRC);
-+    }
- 
-     if (canontarget)
- 	*canontarget = ct;
-@@ -1004,8 +1049,12 @@ static void rpmRebuildTargetVars(const c
- 	ct = _free(ct);
-     ca = _free(ca);
-     /*@-usereleased@*/
-+    cv = _free(cv);
-+    /*@-usereleased@*/
-     co = _free(co);
-     /*@=usereleased@*/
-+    ce = _free(ce);
-+    /*@-usereleased@*/
- }
- 
- void rpmFreeRpmrc(void)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch
deleted file mode 100644
index 3d8d645..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-rpm: check if the argument(rootpath) exists or be writable
-
-When user execute the command "rpm -qai --root=$dir",if $dir doesn't
-exist or is unwritable as result of making a typo in rootpath,then
-it will create dirent $dir and subdirectory.
-So we should add the check function to fix it before creating relational
-subdirectory,and warn the incorrect rootpath to user. It just checks the
-rootpath reasonableness when the user input the argument(--root=/-r=).
-
-Upstream-Status: Pending
-
-Signed-off-by: Zhixiong Chi <zchi@windriver.com>
----
- rpmqv.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 45 insertions(+)
-
-diff --git a/rpmqv.c b/rpmqv.c
-index 40c42bd..88d85ab 100644
---- a/rpmqv.c
-+++ b/rpmqv.c
-@@ -206,6 +206,8 @@ static struct poptOption optionsTable[] = {
-    POPT_TABLEEND
- };
- 
-+static int _rpmqv_rootpath_state = 0;
-+
- #ifdef __MINT__
- /* MiNT cannot dynamically increase the stack.  */
- long _stksize = 64 * 1024L;
-@@ -427,6 +429,41 @@ static void integrity_check(const char *progname, enum modes progmode_num)
- }
- #endif
- 
-+/*check if the rootdir is writable or exists */
-+int access_file(const char *rootdir)
-+{
-+    int ret,rootdir_len;
-+
-+    if(rootdir == NULL) {
-+        return -1;
-+    }
-+
-+    rootdir_len = strlen(rootdir);
-+    /*make sure that dirent argument trailing is "/" */
-+    if(!(rootdir_len && rootdir[rootdir_len - 1] == '/')){
-+        char *t = (char *)malloc(rootdir_len + 2);
-+        *t = '\0';
-+        (void)stpcpy(stpcpy(t,rootdir),"/");
-+        ret = access(t,F_OK|W_OK);
-+        free(t);
-+    }else{
-+        ret = access(rootdir,F_OK|W_OK);
-+    }
-+    return ret;
-+}
-+
-+/*check if input the argument "--root/-r"  */
-+void check_argument_root(int argc,char * const argv[])
-+{
-+    int i;
-+    for (i = 0; i < argc; i++) {
-+        if(strncmp(argv[i],"--root=",7) == 0 || strncmp(argv[i],"-r=",3) == 0) {
-+            _rpmqv_rootpath_state = 1;
-+            break;
-+        }
-+    }
-+}
-+
- /*@-bounds@*/ /* LCL: segfault */
- /*@-mods@*/ /* FIX: shrug */
- #if !defined(__GLIBC__) && !defined(__LCLINT__)
-@@ -476,6 +513,8 @@ int main(int argc, const char ** argv)
-     int xx;
- #endif
- 	
-+    check_argument_root(argc,(char *const *)argv);
-+
- #if !defined(__GLIBC__) && !defined(__LCLINT__)
-     environ = envp;
- #else
-@@ -715,6 +754,12 @@ int main(int argc, const char ** argv)
- 		argerror(_("arguments to --root (-r) must begin with a /"));
- 	    break;
- 	}
-+        if (_rpmqv_rootpath_state) {
-+            if (access_file(rpmioRootDir)) {
-+                fprintf(stderr, _("Invalid directory:%s, ensure it exists or be writable\n"),rpmioRootDir);
-+                exit(EXIT_FAILURE);
-+            }
-+        }
-     }
- 
- #if defined(RPM_VENDOR_OPENPKG) /* integrity-checking */
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch
deleted file mode 100644
index c869376..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Upstream-Status: Inappropriate [configuration]
-
-Change cache size to reduce the usage of disk space from 62MB to 26MB. 
-
-Signed-off-by: Mei Lei <lei.mei@intel.com>
-
-Index: rpm-5.4.14/rpmdb/DB_CONFIG.in
-===================================================================
---- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in
-+++ rpm-5.4.14/rpmdb/DB_CONFIG.in
-@@ -29,7 +29,7 @@ set_thread_count 64
- 
- # ================ Memory Pool
- #XXX initializing dbenv with set_cachesize has unimplemented prerequsites
--#set_cachesize 0 1048576 0 
-+set_cachesize 0 1048576 0 
- set_mp_mmapsize 268435456
- 
- # ================ Locking
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch
deleted file mode 100644
index 5d08d27..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch
+++ /dev/null
@@ -1,174 +0,0 @@
-From 7bad268de8b32281e2a12ccd88038b3ec5eb1be3 Mon Sep 17 00:00:00 2001
-From: Yuanjie Huang <Yuanjie.Huang@windriver.com>
-Date: Tue, 15 Dec 2015 18:50:21 +0800
-Subject: [PATCH] Support both db5 and db6.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
----
- configure.ac | 103 ++++++++++++++++++++++++++++++++++++++++++++++-------------
- 1 file changed, 81 insertions(+), 22 deletions(-)
-
-Index: rpm/configure.ac
-===================================================================
---- rpm.orig/configure.ac
-+++ rpm/configure.ac
-@@ -871,8 +871,6 @@ else
-     MYPATH=$PATH
- fi
- 
--DBXY=db61
--
- AC_PATH_PROG(__BASH, bash, %{_bindir}/bash, $MYPATH)
- AC_PATH_PROG(__BZIP2, bzip2, %{_bindir}/bzip2, $MYPATH)
- AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
-@@ -884,22 +882,6 @@ AC_PATH_PROG(__CMAKE, cmake, %{_bindir}/
- AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH)
- AC_PATH_PROG(__CURL, curl, %{_bindir}/curl, $MYPATH)
- AC_PATH_PROG(__CVS, cvs, %{_bindir}/cvs, $MYPATH)
--AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH)
--AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH)
--AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH)
--AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH)
--AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH)
--AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH)
--AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH)
--AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH)
--AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH)
--AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH)
--AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH)
--AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH)
--AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH)
--AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH)
--AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH)
--AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH)
- AC_PATH_PROG(__DIFF, diff, /bin/diff, $MYPATH)
- AC_PATH_PROG(__DITTO, ditto, %{_bindir}/ditto, $MYPATH)
- AC_PATH_PROG(__FILE, file, %{_bindir}/file, $MYPATH)
-@@ -2050,13 +2032,46 @@ RPM_CHECK_LIB(
- 
- dnl # Berkeley-DB & SQLite
- DBLIBSRCS=""
-+DBXY=db
-+
- # XXX won't handle --includedir override
--CPPFLAGS="${CPPFLAGS} -I${prefix}/include/${DBXY}"
--RPM_CHECK_LIB(
-+CPPFLAGS_save="${CPPFLAGS}"
-+CPPFLAGS="${CPPFLAGS_save}"
-+with_db_save="${with_db}"
-+
-+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-+#include <db.h>
-+]],
-+[[
-+#if DB_VERSION_MAJOR < 6
-+#error DB_VERSION_MAJOR is below 6
-+#endif
-+]])],
-+[RPM_CHECK_LIB(
-     [Berkeley-DB], [db],
-     [db-6.1], [db_create], [db.h],
--    [yes,external], [db3],
-+    [yes,external], [db6],
-     [ DBLIBSRCS="$DBLIBSRCS db3.c"
-+      DBXY=db61
-+      AM_CONDITIONAL(WITH_DB, [ true ])
-+      AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ])
-+      if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
-+          AC_DEFINE(HAVE_DB_H, 1, [Have <db.h> header])
-+      else
-+          WITH_DB_SUBDIR=""
-+      fi
-+    ],
-+    [ AM_CONDITIONAL(WITH_DB, [ false ])
-+      AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ])
-+    ])],
-+[with_db="${with_db_save}"
-+ CPPFLAGS="${CPPFLAGS_save}"
-+ RPM_CHECK_LIB(
-+    [Berkeley-DB], [db],
-+    [db-5.3], [db_create], [db.h],
-+    [yes,external], [db53],
-+    [ DBLIBSRCS="$DBLIBSRCS db3.c"
-+      DBXY=db53
-       AM_CONDITIONAL(WITH_DB, [ true ])
-       AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ])
-       if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
-@@ -2068,6 +2083,11 @@ RPM_CHECK_LIB(
-     [ AM_CONDITIONAL(WITH_DB, [ false ])
-       AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ])
-     ])
-+])
-+
-+if test ".$ac_cv_lib_db_6_1_db_create" != .yes -a ".$ac_cv_lib_db_5_3_db_create" != .yes; then
-+    CPPFLAGS="${CPPFLAGS_save}"
-+fi
- 
- dnl # Sqlite external
- RPM_CHECK_LIB(
-@@ -2078,10 +2098,11 @@ RPM_CHECK_LIB(
-     [])
- 
- dnl # Sqlite 3.8.3.1 from db-6.1.19
-+if test ".$ac_cv_lib_db_6_1_db_create" = .yes; then
- RPM_CHECK_LIB(
-     [Berkeley-DB (+SQLite3)], [dbsql],
-     [db_sql-6.1], [sqlite3_open], [dbsql.h],
--    [yes,external], [db3/sql],
-+    [yes,external], [db6/sql],
-     [
-       AM_CONDITIONAL(WITH_DBSQL, [ true ])
-       AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library])
-@@ -2095,12 +2116,50 @@ RPM_CHECK_LIB(
-     ], [
-       AM_CONDITIONAL(WITH_DBSQL, [ false ])
-     ])
-+elif test ".$ac_cv_lib_db_5_3_db_create" = .yes; then
-+RPM_CHECK_LIB(
-+    [Berkeley-DB (+SQLite3)], [dbsql],
-+    [db_sql-5.3], [sqlite3_open], [dbsql.h],
-+    [yes,external], [db53/sql],
-+    [
-+      AM_CONDITIONAL(WITH_DBSQL, [ true ])
-+      AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library])
-+      if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
-+        WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I\$(top_srcdir)/db/sql/generated"
-+        WITH_DB_LIBS="${WITH_DBSQL_LIBS}"
-+        DBLIBSRCS="$DBLIBSRCS sqlite.c"
-+      else
-+        WITH_DBSQL_SUBDIR=""
-+      fi
-+    ], [
-+      AM_CONDITIONAL(WITH_DBSQL, [ false ])
-+    ])
-+else
-+AM_CONDITIONAL(WITH_DBSQL, [ false ])
-+fi
- 
- DBLIBOBJS=`echo $DBLIBSRCS | sed -e "s/\.c/\.lo/g"`
- 
- AC_SUBST(DBLIBSRCS)
- AC_SUBST(DBLIBOBJS)
- 
-+AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH)
-+AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH)
-+AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH)
-+AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH)
-+AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH)
-+AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH)
-+AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH)
-+AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH)
-+AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH)
-+AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH)
-+AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH)
-+AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH)
-+AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH)
-+AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH)
-+AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH)
-+AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH)
-+
- AC_ARG_WITH(db-largefile, AS_HELP_STRING([--with-db-largefile], [build Berkeley-DB with LARGEFILE support]))
- AC_ARG_WITH(db-mutex,     AS_HELP_STRING([--with-db-mutex=ARG], [build Berkeley-DB with MUTEX type ARG]))
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db60.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db60.patch
deleted file mode 100644
index b4df8b7..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db60.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-Set the DB 6 version to match oe-core db 6.0.30
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/configure.ac
-===================================================================
---- rpm.orig/configure.ac
-+++ rpm/configure.ac
-@@ -2049,10 +2049,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- ]])],
- [RPM_CHECK_LIB(
-     [Berkeley-DB], [db],
--    [db-6.1], [db_create], [db.h],
-+    [db-6.0], [db_create], [db.h],
-     [yes,external], [db6],
-     [ DBLIBSRCS="$DBLIBSRCS db3.c"
--      DBXY=db61
-+      DBXY=db60
-       AM_CONDITIONAL(WITH_DB, [ true ])
-       AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ])
-       if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
-@@ -2085,7 +2085,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-     ])
- ])
- 
--if test ".$ac_cv_lib_db_6_1_db_create" != .yes -a ".$ac_cv_lib_db_5_3_db_create" != .yes; then
-+if test ".$ac_cv_lib_db_6_0_db_create" != .yes -a ".$ac_cv_lib_db_5_3_db_create" != .yes; then
-     CPPFLAGS="${CPPFLAGS_save}"
- fi
- 
-@@ -2097,11 +2097,11 @@ RPM_CHECK_LIB(
-     [ DBLIBSRCS="$DBLIBSRCS sqlite.c" ],
-     [])
- 
--dnl # Sqlite 3.8.3.1 from db-6.1.19
--if test ".$ac_cv_lib_db_6_1_db_create" = .yes; then
-+dnl # Sqlite 3.8.3.1 from db-6.0.30
-+if test ".$ac_cv_lib_db_6_0_db_create" = .yes; then
- RPM_CHECK_LIB(
-     [Berkeley-DB (+SQLite3)], [dbsql],
--    [db_sql-6.1], [sqlite3_open], [dbsql.h],
-+    [db_sql-6.0], [sqlite3_open], [dbsql.h],
-     [yes,external], [db6/sql],
-     [
-       AM_CONDITIONAL(WITH_DBSQL, [ true ])
-@@ -2253,7 +2253,7 @@ AC_SUBST(WITH_RUBY_CPPFLAGS)
- AC_SUBST(WITH_RUBY_SUBDIR)
- AC_SUBST(WITH_RUBY_VENDORARCHDIR)
- 
--dnl # Java prerequisites (swiped from db-6.1.19/dist/aclocal_java et al)
-+dnl # Java prerequisites (swiped from db-6.0.30/dist/aclocal_java et al)
- WITH_JAVA=no
- AC_ARG_WITH([java],
-     AS_HELP_STRING([--with-java], [build RPM with java support]),
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch
deleted file mode 100644
index 16b8e30..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-In certain cases with BerkleyDB 5.3.x we are getting the error:
-
-db3.c:1443: dbcursor->pget(-30999): BDB0063 DB_BUFFER_SMALL: User memory too small for return value
-
-See https://bugs.launchpad.net/rpm/+bug/934420 for more information.
-
-It appears to be some type of a bug in the BerkleyDB 5.3.x.  In an attempt
-to workaround the problem, when we encounter this situation we attempt
-to adjust the size of the mmap buffer until the call works, or we
-end up trying 10 times.  The new size is either the updated vp->size
-from the failed pget call, or the previous size + 1024.
-
-If DBI debugging is enabled, additional diagnostics are printed, otherwise
-a basic retry and success message is added to show that the failure was
-resolved.
-
-Upstream-Status: Inappropriate (workaround)
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/rpmdb/rpmdb.c
-===================================================================
---- rpm-5.4.14.orig/rpmdb/rpmdb.c
-+++ rpm-5.4.14/rpmdb/rpmdb.c
-@@ -2212,8 +2212,12 @@ static int rpmmiGet(dbiIndex dbi, DBC *
- 	vp->flags |= DB_DBT_USERMEM;
- 	rc = dbiGet(dbi, dbcursor, kp, vp, flags);
- 	if (rc == DB_BUFFER_SMALL) {
-+	    int retry = 0;
-+	    size_t origlen = vp->size;
- 	    size_t uhlen = vp->size;
--	    void * uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off);
-+	    void * uh;
-+retry_get:
-+	    uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off);
- 	    if (uh == NULL || uh == (void *)-1)
- 		fprintf(stderr,
- 		    "==> mmap(%p[%u], 0x%x, 0x%x, %d, 0x%x) error(%d): %s\n",
-@@ -2235,6 +2239,25 @@ static int rpmmiGet(dbiIndex dbi, DBC *
- 		if (munmap(uh, uhlen) != 0)
- 		    fprintf(stderr, "==> munmap(%p[%u]) error(%d): %s\n",
-                 	uh, (unsigned)uhlen, errno, strerror(errno));
-+	        /* We want to be sure to limit the number of retry attempts to avoid a loop! */
-+	        if (rc == DB_BUFFER_SMALL && retry < 10) {
-+		   /* If we got a largr vp-size back, use that, otherwise increment the size by 1k */
-+	           uhlen = vp->size > uhlen ? vp->size : uhlen + 1024;
-+		   retry++;
-+	           if ((dbi)->dbi_debug)
-+	               fprintf(stderr, "==> DB_BUFFER_SMALL orig requested (%d), configured (%d), forcing larger buffer (%d), new size (%d)\n",
-+	                    origlen, vp->ulen, uhlen, vp->size);
-+	           else
-+	               fprintf(stderr, "==> retry (%d) db3cpget (%d)\n", retry, uhlen);
-+	           goto retry_get;
-+	        }
-+	    }
-+	    if (retry) {
-+	        if ((dbi)->dbi_debug)
-+	           fprintf(stderr, "==> success orig requested (%d), configured buffer (%d), buffer (%d), size after dbiGet (%d)\n",
-+			origlen, vp->ulen, uhlen, vp->size);
-+	        else
-+	           fprintf(stderr, "==> success\n");
- 	    }
- 	}
-     } else
-Index: rpm-5.4.14/rpmdb/db3.c
-===================================================================
---- rpm-5.4.14.orig/rpmdb/db3.c
-+++ rpm-5.4.14/rpmdb/db3.c
-@@ -1509,7 +1509,7 @@ assert(db != NULL);
- #endif
-     }
- 
--DBIDEBUG(dbi, (stderr, "<-- %s(%p,%p,%p,%p,%p,0x%x) rc %d %s%s\n", __FUNCTION__, dbi, dbcursor, key, pkey, data, flags, rc, _DBCFLAGS(flags), _KEYDATA(key, pkey, data, NULL)));
-+DBIDEBUG(dbi, (stderr, "<-- %s(%p,%p,%p,%p,%p,0x%x) rc %d %s%s\n", __FUNCTION__, dbi, dbcursor, key, pkey, data, flags, rc, _DBCFLAGS(flags), _KEYDATA(key, pkey, rc == DB_BUFFER_SMALL ? NULL : data, NULL)));
-     return rc;
- }
- /*@=mustmod@*/
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
deleted file mode 100644
index 2eb6e0f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-Debug the platform score generation...
-
-Index: rpm-5.4.14/lib/rpmrc.c
-===================================================================
---- rpm-5.4.14.orig/lib/rpmrc.c
-+++ rpm-5.4.14/lib/rpmrc.c
-@@ -465,6 +465,8 @@ static rpmRC rpmPlatform(const char * pl
- 
-     rc = (rpmRC) rpmiobSlurp(platform, &iob);
- 
-+    fprintf(stderr, "D: rpmPlatform file %s\n", platform);
-+
-     if (rc || iob == NULL) {
- 	rc = RPMRC_FAIL;
- 	goto exit;
-@@ -486,6 +488,7 @@ static rpmRC rpmPlatform(const char * pl
- 	    while (--t > p && xisspace(*t))
- 		*t = '\0';
- 	    if (t > p) {
-+		fprintf(stderr, "D: rpmPlatform mireAppend REGEX %s\n", p);
- 		xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre);
- 	    }
- 	    continue;
-@@ -503,6 +506,11 @@ static rpmRC rpmPlatform(const char * pl
- 		_gnu = rpmExpand("-", cvog->gnu, NULL);
- 
- 	    addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
-+	    fprintf(stderr, "D: rpmPlatform addMacro %s-%s-%s(%s)\n",
-+	    	rpmExpand("%{_platform_cpu}", NULL),
-+		rpmExpand("%{_platform_vendor}", NULL),
-+		rpmExpand("%{_platform_os}", NULL),
-+		rpmExpand("%{_platform_gnu}", NULL));
- #else
- 	    addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
- 	    addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
-@@ -510,6 +518,7 @@ static rpmRC rpmPlatform(const char * pl
- #endif
- 	}
- 
-+	fprintf(stderr, "D: rpmPlatform mireAppend STRCMP %s -- ", p);
- #if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */
- #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
- 	/* do not use vendor and GNU attribution */
-@@ -519,6 +528,7 @@ static rpmRC rpmPlatform(const char * pl
- 		(cvog && *cvog->gnu ? "-" : NULL),
- 		(cvog ? cvog->gnu : NULL), NULL);
- #endif
-+	fprintf(stderr, "%s\n", p);
- 	xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
- 	p = _free(p);
- #endif
-@@ -688,9 +698,12 @@ int rpmPlatformScore(const char * platfo
- 
-     if ((mire = (miRE) mi_re) != NULL)
-     for (i = 0; i < mi_nre; i++) {
--	if (mireRegexec(mire + i, platform, 0) >= 0)
-+	if (mireRegexec(mire + i, platform, 0) >= 0) {
-+	    fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, i + 1);
- 	    return (i + 1);
-+	}
-     }
-+    fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, 0);
-     return 0;
- }
- /*@=onlytrans@*/
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-auto-stack-protector.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-auto-stack-protector.patch
deleted file mode 100644
index 124606c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-auto-stack-protector.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Make security switches manual settings
-
-RPM checks for the availability of the stack protector switch and
-transactional-memory support.  If supported it unconditionally
-enables the compiler options which can cause errors if the support has
-not been built into the compiler.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.15/configure.ac
-===================================================================
---- rpm-5.4.15.orig/configure.ac
-+++ rpm-5.4.15/configure.ac
-@@ -425,7 +425,7 @@ dnl #  rpm_CFLAGS_ADD([-fstack-arrays],[
- dnl # build RPM instrumented for extra optimization/security (GCC only)
- dnl # --- other optimizations
-   rpm_CFLAGS_ADD([-fexceptions], [RPM_CFLAGS])
--  rpm_CFLAGS_ADD([-D_FORTIFY_SOURCE=2 -fstack-protector], [RPM_CFLAGS])
-+dnl  rpm_CFLAGS_ADD([-D_FORTIFY_SOURCE=2 -fstack-protector], [RPM_CFLAGS])
- dnl #  rpm_CFLAGS_ADD([-fstack-protector-all],[RPM_CFLAGS])
- 
-      if test \( ".`$CC --version 2>&1 | grep 'GCC'`" != . \); then
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-blaketest.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-blaketest.patch
deleted file mode 100644
index adbef6d..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-blaketest.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-rpmio: Disable building of the tblake2 test(s).
-
-There is some type of a dependency fault here that can occasionally result in:
-
-gcc: error: tblake2b.o: No such file or directory
-or
-gcc: error: tblake2bp.o: No such file or directory
-
-These items are simply test cases that are not packaged, so they can be
-safely disabled to resolve the dependency issue.
-
-Upstream-Status: Inappropriate [workaround]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.15/rpmio/Makefile.am
-===================================================================
---- rpm-5.4.15.orig/rpmio/Makefile.am
-+++ rpm-5.4.15/rpmio/Makefile.am
-@@ -29,7 +29,7 @@ EXTRA_PROGRAMS += bsdiff bspatch pcrsed
- 	tmire todbc toid tperl tpython tput trpmio tsexp tsvn tsw ttcl \
- 	dumpasn1 lookup3 trel twitter github tmicrojson duk
- 
--noinst_PROGRAMS += b2sum tset tblake2b tblake2bp tblake2s tblake2sp tgfs
-+#noinst_PROGRAMS += b2sum tset tblake2b tblake2bp tblake2s tblake2sp tgfs
- if WITH_LIBGIT2
- noinst_PROGRAMS += tgit
- else
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ensure-rpm2cpio-call-rpm-relocation-code.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ensure-rpm2cpio-call-rpm-relocation-code.patch
deleted file mode 100644
index 63af100..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ensure-rpm2cpio-call-rpm-relocation-code.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-We need to call rpmcliInit to ensure the rpm relocation code is called
-and it correctly honours the relocation environmental variables.
-
-when we export the wrsdk and source the sdk, then execute rpm2cpio xxx.rpm|cpio -t.
-we will get the following error :
-"rpm-5.4.14/rpmdb/dbconfig.c:493:
-db3New: Assertion `dbOpts != ((void *)0) && *dbOpts != '\0'' failed.
-
-Upstream-Status: Pending
-
-Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
-Index: rpm-5.4.15/tools/rpm2cpio.c
-===================================================================
---- rpm-5.4.15.orig/tools/rpm2cpio.c	2012-04-27 01:46:51.000000000 +0800
-+++ rpm-5.4.15/tools/rpm2cpio.c	2016-09-05 11:07:30.419903338 +0800
-@@ -87,6 +87,8 @@
- #endif
- 	(void) rpmtsSetVSFlags(ts, vsflags);
- 
-+	rpmcliInit(argc, argv, NULL);
-+
- 	/*@-mustmod@*/      /* LCL: segfault */
- 	rc = rpmReadPackageFile(ts, fdi, "rpm2cpio", &h);
- 	/*@=mustmod@*/
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch
deleted file mode 100644
index b1db6ff..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-rpmfc.c:  Always generate per-file information
-
-Even when the per-file dependency generate is disabled, we want to generate
-per file classification and other associated data.
-
-Note: this is a temporary workaround.  Eventually we will want to have a way
-to seed per-file dependency and other information in order to generate a
-package from previously determined information.
-
-Upstream-Status: Pending
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/lib/rpmfc.c
-===================================================================
---- rpm-5.4.14.orig/lib/rpmfc.c
-+++ rpm-5.4.14/lib/rpmfc.c
-@@ -1734,7 +1734,6 @@ rpmRC rpmfcGenerateDepends(void * _spec,
- 	/* ... then generate dependencies using %{__find_requires} et al. */
- 	rc = rpmfcGenerateDependsHelper(spec, pkg, fi);
- 	printDeps(pkg->header);
--	return rc;
-     }
- 
-     /* Generate scriptlet Dependencies. */
-@@ -1762,8 +1761,8 @@ rpmRC rpmfcGenerateDepends(void * _spec,
-     av[ac] = NULL;
- 
-     fc = rpmfcNew();
--    fc->skipProv = !pkg->autoProv;
--    fc->skipReq = !pkg->autoReq;
-+    fc->skipProv = !pkg->autoProv || !internaldeps;
-+    fc->skipReq = !pkg->autoReq || !internaldeps;
-     fc->tracked = 0;
- 
-     {	const char * buildRootURL;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch
deleted file mode 100644
index 290ec1a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Occasionally the cp -p fails with a non-zero return code.  This will cause
-the system abort the build.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/rpmdb/Makefile.am
-===================================================================
---- rpm.orig/rpmdb/Makefile.am
-+++ rpm/rpmdb/Makefile.am
-@@ -234,11 +234,14 @@ lcov-report:
- #lcov-upload: lcov
- #	rsync -rvz -e ssh --delete lcov/* ???
- 
-+$(builddir)/logio_recover_template: $(srcdir)/logio_recover_template
-+	@if test ".$(builddir)" != ".$(srcdir)"; then \
-+		cp -fp $(srcdir)/logio_recover_template \
-+		      $(builddir)/logio_recover_template ; \
-+	 fi
-+
- logio_BUILT = logio_auto.c logio_autop.c logio_auto.h logio_template
--$(logio_BUILT):	logio.awk logio.src logio_recover_template
--	@test -e $(builddir)/logio_recover_template || \
--		cp -p $(srcdir)/logio_recover_template \
--		      $(builddir)/logio_recover_template
-+$(logio_BUILT):	logio.awk logio.src $(builddir)/logio_recover_template
- 	@rm -f $(logio_BUILT)
- 	@$(AWK) -f $(srcdir)/logio.awk \
- 		-v header_file=logio_auto.h \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-lua-tests-compilation-failure.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-lua-tests-compilation-failure.patch
deleted file mode 100644
index 1a08243..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-lua-tests-compilation-failure.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Upstream-Status: Pending
-
-Subject: lua: fix to build test libs correctly
-
-This patch fixes errors like below.
-
-  | gcc: error: lib21.c: No such file or directory
-  | gcc: fatal error: no input files
-
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
----
- lua/tests/libs/Makefile.am | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/lua/tests/libs/Makefile.am b/lua/tests/libs/Makefile.am
-index 19d1a0b..1e5de72 100644
---- a/lua/tests/libs/Makefile.am
-+++ b/lua/tests/libs/Makefile.am
-@@ -28,16 +28,16 @@ clean:
- 	rm -f lib1.so lib11.so lib2.so lib21.so lib2-v2.so
- 
- lib1.so: lib1.c
--	$(CC) $(CFLAGS) -o lib1.so lib1.c
-+	$(CC) $(CFLAGS) -o lib1.so $(top_srcdir)/lua/tests/libs/lib1.c
- 
- lib11.so: lib11.c
--	$(CC) $(CFLAGS) -o lib11.so lib11.c
-+	$(CC) $(CFLAGS) -o lib11.so $(top_srcdir)/lua/tests/libs/lib11.c
- 
- lib2.so: lib2.c
--	$(CC) $(CFLAGS) -o lib2.so lib2.c
-+	$(CC) $(CFLAGS) -o lib2.so $(top_srcdir)/lua/tests/libs/lib2.c
- 
- lib21.so: lib21.c
--	$(CC) $(CFLAGS) -o lib21.so lib21.c
-+	$(CC) $(CFLAGS) -o lib21.so $(top_srcdir)/lua/tests/libs/lib21.c
- 
- lib2-v2.so: lib2.so
- 	mv lib2.so ./lib2-v2.so
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-parseEmbedded.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-parseEmbedded.patch
deleted file mode 100644
index c57f24c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-parseEmbedded.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Fix an issue where parseEmbedded is not defined, but is still used.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/rpmio/macro.c
-===================================================================
---- rpm.orig/rpmio/macro.c
-+++ rpm/rpmio/macro.c
-@@ -1616,8 +1616,6 @@ exit:
-  * @retval *avp		invocation args
-  * @return		script string
-  */
--#if defined(WITH_AUGEAS) || defined(WITH_FICL) || defined(WITH_MOZJS) || defined(WITH_JNIEMBED) || defined(WITH_PERLEMBED) || defined(WITH_PYTHONEMBED) || defined(WITH_RUBYEMBED) || defined(WITH_MRUBY_EMBED) || defined(WITH_SQLITE) || defined(WITH_SQUIRREL) || defined(WITH_TCL)
--
- static char _FIXME_embedded_interpreter_eval_returned_null[] =
-     "FIXME: embedded interpreter eval returned null.";
- 
-@@ -1668,7 +1666,6 @@ bingo:
-     script[nb] = '\0';
-     return script;
- }
--#endif
- 
- /**
-  * The main macro recursion loop.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-gnu-atomic.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-gnu-atomic.patch
deleted file mode 100644
index 36a418f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-gnu-atomic.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-configure.ac: Check if the current compiler supports the transactions
-
-Some distributions appear to have compilers that are built without support
-for transactions, even though they are GCC 4.7 or newer.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.15/configure.ac
-===================================================================
---- rpm-5.4.15.orig/configure.ac
-+++ rpm-5.4.15/configure.ac
-@@ -425,9 +425,34 @@ dnl # --- other optimizations
-   rpm_CFLAGS_ADD([-D_FORTIFY_SOURCE=2 -fstack-protector], [RPM_CFLAGS])
- dnl #  rpm_CFLAGS_ADD([-fstack-protector-all],[RPM_CFLAGS])
- 
--     if test \( ".`$CC --version 2>&1 | grep 'GCC'`" != . \); then
--         rpm_CFLAGS_ADD([-fgnu-tm], [RPM_CFLAGS])
--     fi
-+dnl # Check if the current gcc supports -fgnu-tm and __transaction_atomic
-+AC_MSG_CHECKING([If the compiler supports __transaction_atomic])
-+save_CFLAGS="$CFLAGS"
-+save_LDFLAGS="$LDFLAGS"
-+CFLAGS="${CFLAGS} -fgnu-tm -litm"
-+LDFLAGS="${LDFLAGS} -litm"
-+AC_LINK_IFELSE([AC_LANG_SOURCE([[
-+int
-+main()
-+{
-+#if !__clang__ &&  ((__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)) /* XXX gud enuf? */
-+        int i = 0;
-+        __transaction_atomic { i++; }
-+#else
-+# error Compiler does not support __transaction_atomic
-+#endif
-+        return 0;
-+}
-+]])], [
-+        AC_DEFINE([HAVE_GNUC_TM_ATOMIC], [1],
-+                [Define to 1 if the compiler supports __transaction_atomic.])
-+        AC_MSG_RESULT([yes])
-+], [
-+	CFLAGS="$save_CFLAGS"
-+	LDFLAGS="$save_LDFLAGS"
-+	AC_MSG_RESULT([no])
-+])
-+
- 
- dnl # --- options below are added to RPM_CFLAGS but _NOT_ added to CFLAGS
-             CPPFLAGS="$CPPFLAGS $RPM_CPPFLAGS"
-Index: rpm-5.4.15/rpmio/rpmutil.h
-===================================================================
---- rpm-5.4.15.orig/rpmio/rpmutil.h
-+++ rpm-5.4.15/rpmio/rpmutil.h
-@@ -105,7 +105,7 @@
- #  define RPM_GNUC_INTERNAL
- #endif
- 
--#if !__clang__ &&  __GNUC__ == 4 && __GNUC_MINOR__ >= 7	/* XXX gud enuf? */
-+#ifdef HAVE_GNUC_TM_ATOMIC
- #  define RPM_GNUC_TM_SAFE	__attribute__((transaction_safe))
- #  define RPM_GNUC_TM_PURE	__attribute__((transaction_pure))
- #  define RPM_GNUC_TM_CALLABLE	__attribute__((transaction_callable))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch
deleted file mode 100644
index 057925f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-We need to sanity check that the nlink size and our linksLeft counter
-do match. If an rpm is badly constructed with identical inode values
-for multiple hardlinked files, such an rpm will otherwise access memory
-out of array bounds and cause memory corruption and crashes.
-
-The fix is to add in the sanity check and exit if bad circumstances
-are found. We need to fix the caller to check the return code too.
-
-RP 2014/6/10
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Index: rpm-5.4.14/lib/fsm.c
-===================================================================
---- rpm-5.4.14.orig/lib/fsm.c
-+++ rpm-5.4.14/lib/fsm.c
-@@ -495,6 +495,11 @@ static int saveHardLink(/*@special@*/ /*
-     }
- 
-     if (fsm->goal == IOSM_PKGBUILD) --fsm->li->linksLeft;
-+    if (fsm->li->linksLeft > st->st_nlink) {
-+	rpmlog(RPMLOG_ERR, _("Corrupted hardlinks found (count %d does not match %d), exiting.\n"), fsm->li->linksLeft, st->st_nlink);
-+	return -1;
-+    }
-+
-     fsm->li->filex[fsm->li->linksLeft] = fsm->ix;
-     /*@-observertrans -dependenttrans@*/
-     fsm->li->nsuffix[fsm->li->linksLeft] = fsm->nsuffix;
-@@ -1878,8 +1883,13 @@ if (!(fsmGetFi(fsm)->mapflags & IOSM_PAY
- 	fsm->postpone = iosmFileActionSkipped(fsm->action);
- 	if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) {
- 	    /*@-evalorder@*/ /* FIX: saveHardLink can modify fsm */
--	    if (S_ISREG(st->st_mode) && st->st_nlink > 1)
-+	    if (S_ISREG(st->st_mode) && st->st_nlink > 1) {
- 		fsm->postpone = saveHardLink(fsm);
-+		if (fsm->postpone < 0) {
-+		    rc = RPMRC_FAIL;
-+		    break;
-+		}
-+	    }
- 	    /*@=evalorder@*/
- 	}
- if (fsmGetFi(fsm)->mapflags & IOSM_PAYLOAD_LIST) fsm->postpone = 1;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-keccak-sse-intrin.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-keccak-sse-intrin.patch
deleted file mode 100644
index 72884d4..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-keccak-sse-intrin.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-rpm - rpmio/keccak.c: make SSE/MMX dependent upon gcc config
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.15/rpmio/keccak.c
-===================================================================
---- rpm-5.4.15.orig/rpmio/keccak.c
-+++ rpm-5.4.15/rpmio/keccak.c
-@@ -17,9 +17,13 @@ http://keccak.noekeon.org/
- #if OPTIMIZED == 64
- /* ===== "KeccakOpt64-settings.h" */
- #define Unrolling 18
--//#define UseBebigokimisa
--#define UseSSE
--//#define UseMMX
-+#if defined(__SSE2__)
-+ #define UseSSE
-+#elif defined(__MMX__)
-+ #define UseMMX
-+#else
-+ #define UseBebigokimisa
-+#endif
- /* ===== */
- #endif
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch
deleted file mode 100644
index 1a48db6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 67ec7531e6297200eaa97ef917d49b0a75876cb4 Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Wed, 2 Dec 2015 00:56:07 -0800
-Subject: [PATCH] lib/transaction.c: fix file conflicts for MIPS64 N32
-
-The following error can occur:
-  smart install libc6-2.22-r0.1@lib32_mips32r2octeon3 libc6-dbg-2.22-r0.1@lib32_mips32r2octeon3
-error: file /sbin/ldconfig conflicts between attempted installs of libc6-2.22-r0.1.lib32_mips32r2octeon3 and libc6-2.22-r0.1.octeon3_n32
-error: file /sbin/.debug/ldconfig conflicts between attempted installs of libc6-dbg-2.22-r0.1.lib32_mips32r2octeon3 and libc6-dbg-2.22-r0.1.octeon3_n32
-
-This was because:
-transactions_color = 001 (ELF32) & 010 (ELF64) & 100 (ELF32 N32 MIPS64)
-FColor = Current file color (001) & transaction_color (111)
-oFcolor = Previous file color (100) & transaction_color (111)
-
-There are two places where the conflict comparisons occur.  In both places
-the 'else' clause was too restrictive (opposite of the 'positive' clause).
-This caused the system to only permit a binary comparison - "new preferred" or
-"old preferred".  It did not permissing "neither preferred".  By removing the
-else comparison the system will now perform a 'last-in-wins' resolution when
-"neither is preferred".
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
----
- lib/transaction.c |    3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-Index: rpm-5.4.14/lib/transaction.c
-===================================================================
---- rpm-5.4.14.orig/lib/transaction.c
-+++ rpm-5.4.14/lib/transaction.c
-@@ -154,7 +154,7 @@ static int handleInstInstalledFile(const
- 		fi->actions[fx] = FA_SKIPCOLOR;
- #endif
- 		rConflicts = 0;
--	    } else if (FColor & prefcolor) {
-+	    } else {
- #ifdef	REFERENCE
- 		rpmfsSetAction(fs, fx, FA_CREATE);
- #else
-@@ -420,7 +420,7 @@ assert(otherFi != NULL);
- 			fi->actions[i] = FA_SKIPCOLOR;
- 			rConflicts = 0;
- 		    } else
--		    if (FColor == 0 && oFColor == 0) {
-+		    {
- 			/* ... otherwise, do both, last in wins. */
- 			otherFi->actions[otherFileNum] = FA_CREATE;
- 			fi->actions[i] = FA_CREATE;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
deleted file mode 100644
index e87e02b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-During installation, the libtool relink attempts to link to -lrpm...
-The problem is that it hasn't been installed yet!  So small change causes
-the libtool to instead use the build version.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/lib/Makefile.am
-===================================================================
---- rpm-5.4.14.orig/lib/Makefile.am
-+++ rpm-5.4.14/lib/Makefile.am
-@@ -120,6 +120,9 @@ librpm.la: $(librpm_la_OBJECTS) $(librpm
- #libsql_la_SOURCES	= libsql.c
- #libsql_la_LIBADD	= librpm.la $(RPMDB_LDADD_COMMON)
- 
-+# pkglib libraries needs to have usrlib libraries already installed!
-+install-pkglibLTLIBRARIES: install-usrlibLTLIBRARIES
-+
- install-data-hook:
- if !ENABLE_BUILD_LAFILES
- 	-for l in $(usrlib_LTLIBRARIES); do \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch
deleted file mode 100644
index 3153f7a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-
-Upstream-Status: Inappropriate [configuration]
-
-Index: rpm-5.4.14/rpmdb/DB_CONFIG.in
-===================================================================
---- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in
-+++ rpm-5.4.14/rpmdb/DB_CONFIG.in
-@@ -4,6 +4,7 @@ set_data_dir .
- set_create_dir .
- set_lg_dir ./log
- set_tmp_dir ./tmp
-+set_flags db_log_autoremove on
- 
- # -- thread_count must be >= 8
- set_thread_count 64
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch
deleted file mode 100644
index a87518b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Enable platform tag matching workaround in OE.
-
-When installing some LSB packages the 'platform' field in the package
-appears to be invalid.  Instead of relying solely on the platform comparison
-we also want to generate a perceived platform based on the valid rpm contents
-of arch and os.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/lib/depends.c
-===================================================================
---- rpm-5.4.14.orig/lib/depends.c
-+++ rpm-5.4.14/lib/depends.c
-@@ -595,7 +595,7 @@ int rpmtsAddInstallElement(rpmts ts, Hea
- 	    platform = rpmExpand(arch, "-unknown-", os, NULL);
- 
- 	rc = rpmPlatformScore(platform, platpat, nplatpat);
--#if defined(RPM_VENDOR_MANDRIVA)
-+#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE)
- 	/*
- 	 * If no match on platform tag, we'll try again with arch tag
- 	 * in case platform tag is inconsistent with it, which is the case
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lua.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lua.patch
deleted file mode 100644
index a9930d6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lua.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Add support for cross compiling lua
-
-Upstream-Status: Pending
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/configure.ac
-===================================================================
---- rpm-5.4.14.orig/configure.ac
-+++ rpm-5.4.14/configure.ac
-@@ -121,6 +121,9 @@ AC_PROG_YACC
- 
- AC_PATH_PROG(AS, as, as)
- 
-+CC_FOR_BUILD=${CC_FOR_BUILD-\$(CC)}
-+AC_SUBST(CC_FOR_BUILD)
-+
- dnl # GCC specifics
- AC_PROG_GCC_TRADITIONAL
- AC_ARG_ENABLE(build-pic,
-Index: rpm-5.4.14/lua/Makefile.am
-===================================================================
---- rpm-5.4.14.orig/lua/Makefile.am
-+++ rpm-5.4.14/lua/Makefile.am
-@@ -41,7 +41,7 @@ rpmluac_LDADD = liblua.la
- 
- # --- bin2c doesn't need anything but a compiler
- bin2c$(EXEEXT):  bin2c.c
--	$(CC) -o $@ $<
-+	$(CC_FOR_BUILD) -o $@ $<
- 
- liblua_la_SOURCES =
- liblua_la_CFLAGS = @WITH_LUA_SUBDIR_DEF@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch
deleted file mode 100644
index a08412a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-disable external key server
-
-Upstream-Status: Pending
-
-When RPM experiences a signed package, with a signature that it does NOT know.
-By default it will send the -fingerprint- (and only the 16 digit fingerprint) to
-an external HKP server, trying to get the key down.
-
-This is probably not a reasonable default behavior for the system to do, instead
-it should simply fail the key lookup.  If someone wants to enable the HKP server
-it's easy enough to do by enabling the necessary macros.
-
-Signed-off-by: yzhu1 <yanjun.zhu@windriver.com>
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-Index: rpm/macros/macros.in
-===================================================================
---- rpm.orig/macros/macros.in
-+++ rpm/macros/macros.in
-@@ -563,10 +563,10 @@ $_arbitrary_tags_tests	Foo:Bar
- 
- # Horowitz Key Protocol server configuration
- #
--%_hkp_keyserver         hkp://keys.rpm5.org
-+#%_hkp_keyserver         hkp://keys.rpm5.org
- #%_hkp_keyserver         hkp://keys.n3npq.net
- #%_hkp_keyserver         hkp://pool.sks-keyservers.net
--%_hkp_keyserver_query   %{_hkp_keyserver}/pks/lookup?op=get&search=
-+#%_hkp_keyserver_query   %{_hkp_keyserver}/pks/lookup?op=get&search=
- 
- 
- # NSS_InitContext() parameter configuration
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.patch
deleted file mode 100644
index c7ab2d2..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-macros/macros.in: Revert settings to the same as RPM 5.4.0
-
-Enable a reasonable set of rpmdeps dependency helper macros.  These sets
-were used by RPM 5.4.0.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/macros/macros.in
-===================================================================
---- rpm-5.4.14.orig/macros/macros.in
-+++ rpm-5.4.14/macros/macros.in
-@@ -1022,7 +1022,7 @@ $_arbitrary_tags_tests	Foo:Bar
- 
- #==============================================================================
- # ---- rpmbuild macros.
--#%%{load:%{_usrlibrpm}/macros.rpmbuild}
-+%{load:%{_usrlibrpm}/macros.rpmbuild}
- 
- #------------------------------------------------------------------------
- # cmake(...) configuration
-@@ -1038,15 +1038,15 @@ $_arbitrary_tags_tests	Foo:Bar
- 
- #------------------------------------------------------------------------
- # perl(...) configuration
--#%%{load:%{_usrlibrpm}/macros.d/perl}
-+%{load:%{_usrlibrpm}/macros.d/perl}
- 
- #------------------------------------------------------------------------
- # python(...) configuration.
--#%%{load:%{_usrlibrpm}/macros.d/python}
-+%{load:%{_usrlibrpm}/macros.d/python}
- 
- #------------------------------------------------------------------------
- # php(...) configuration.
--#%%{load:%{_usrlibrpm}/macros.d/php}
-+%{load:%{_usrlibrpm}/macros.d/php}
- 
- #------------------------------------------------------------------------
- # java(...) configuration.
-@@ -1054,11 +1054,11 @@ $_arbitrary_tags_tests	Foo:Bar
- 
- #------------------------------------------------------------------------
- # libtool(...) configuration.
--#%%{load:%{_usrlibrpm}/macros.d/libtool}
-+%{load:%{_usrlibrpm}/macros.d/libtool}
- 
- #------------------------------------------------------------------------
- # pkgconfig(...) configuration.
--#%%{load:%{_usrlibrpm}/macros.d/pkgconfig}
-+%{load:%{_usrlibrpm}/macros.d/pkgconfig}
- 
- #------------------------------------------------------------------------
- # mono(...) configuration.
-@@ -1070,7 +1070,7 @@ $_arbitrary_tags_tests	Foo:Bar
- 
- #------------------------------------------------------------------------
- # tcl(...) configuration.
--#%%{load:%{_usrlibrpm}/macros.d/tcl}
-+%{load:%{_usrlibrpm}/macros.d/tcl}
- 
- #------------------------------------------------------------------------
- # typelib(...) configuration.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-mongodb-sasl.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-mongodb-sasl.patch
deleted file mode 100644
index 6c3e471..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-mongodb-sasl.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-Fix errors when building with sasl2 disabled
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/rpmio/mongoc.c
-===================================================================
---- rpm.orig/rpmio/mongoc.c
-+++ rpm/rpmio/mongoc.c
-@@ -39,8 +39,10 @@
- # include <winerror.h>
- #endif
- 
-+#ifdef HAVE_LIBSASL2
- #include <sasl/sasl.h>
- #include <sasl/saslutil.h>
-+#endif
- 
- #include <openssl/bio.h>
- #include <openssl/ssl.h>
-@@ -14228,6 +14230,7 @@ mongoc_read_prefs_copy (const mongoc_rea
-    return ret;
- }
- 
-+#ifdef MONGOC_ENABLE_SASL
- /*==============================================================*/
- /* --- mongoc-sasl.c */
- 
-@@ -14555,6 +14558,7 @@ _mongoc_sasl_step (mongoc_sasl_t *sasl,
- 
-    return true;
- }
-+#endif
- 
- /*==============================================================*/
- /* --- mongoc-socket.c */
-Index: rpm/rpmio/mongoc.h
-===================================================================
---- rpm.orig/rpmio/mongoc.h
-+++ rpm/rpmio/mongoc.h
-@@ -38,8 +38,10 @@
- # include <sys/un.h>
- #endif
- 
-+#ifdef HAVE_LIBSASL2
- #include <sasl/sasl.h>
- #include <sasl/saslutil.h>
-+#endif
- 
- #include <openssl/bio.h>
- #include <openssl/ssl.h>
-@@ -2455,6 +2457,8 @@ BSON_END_DECLS
- /*==============================================================*/
- /* --- mongoc-sasl-private.h */
- 
-+#ifdef MONGOC_ENABLE_SASL
-+
- BSON_BEGIN_DECLS
- 
- 
-@@ -2498,6 +2502,7 @@ bool _mongoc_sasl_step             (mong
- 
- 
- BSON_END_DECLS
-+#endif
- 
- /*==============================================================*/
- /* --- mongoc-ssl-private.h */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch
deleted file mode 100644
index e58cc13..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-lib/order.c: Make the dependency loop messages into debug msgs
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/lib/order.c
-===================================================================
---- rpm-5.4.14.orig/lib/order.c
-+++ rpm-5.4.14/lib/order.c
-@@ -2175,7 +2175,7 @@ rescan:
- 		const char * dp;
- 		rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS))
- 			? RPMLOG_WARNING : RPMLOG_ERR;
--#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */
-+#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE) /* loop-detection-optional-loglevel */
- 		// Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable
- 		msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}");
- #endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch
deleted file mode 100644
index 5818229..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Disable perl-URPM support
-
-This causes a configure failure when perl-URPM is not used.
-
-| configure.ac:1159: required file `perl-URPM/Makefile.PL.in' not found
-| configure.ac:1159: required file `perl-URPM/Makefile.in' not found
-
-Upstream-Status: Inappropriate [disable feature]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/configure.ac
-===================================================================
---- rpm-5.4.14.orig/configure.ac
-+++ rpm-5.4.14/configure.ac
-@@ -1186,30 +1186,10 @@ AC_SUBST(WITH_PERL_SUBDIR)
- AC_SUBST(WITH_PERL_SUBPACKAGE)
- AC_SUBST(WITH_PERL_LIBS)
- 
--dnl # optional Perl-URPM language bindings
-+dnl # disable Perl-URPM language bindings
- WITH_PERL_URPM_SUBDIR=""
- WITH_PERL_URPM_SUBPACKAGE=0
- WITH_PERL_URPM_LIBS=""
--if test ".$WITH_PTHREADS" = .yes; then
--    WITH_PERL_URPM_LIBS="$LIBS"
--fi
--AC_ARG_WITH(perl-urpm, AS_HELP_STRING([--with-perl-urpm], [build with Perl URPM language bindings]), [
--    if test ".$withval" != .no; then
--	PERL_URPM_INSTALLDIRS=""
--	   if test "$withval" == "vendor"; then
--		    PERL_URPM_INSTALLDIRS="'INSTALLDIRS'	=> 'vendor',"
--	    fi
--	    if test "$withval" == "site"; then
--		    PERL_URPM_INSTALLDIRS="'INSTALLDIRS'     => 'site',"
--	    fi
--	    AC_DEFINE_UNQUOTED([PERL_URPM_INSTALLDIRS], [$PERL_URPM_INSTALLDIRS], [Perl install directory (vendor/site)])
--	    AC_SUBST(PERL_URPM_INSTALLDIRS)
--        WITH_PERL_URPM_SUBDIR=perl-URPM
--        WITH_PERL_URPM_SUBPACKAGE=1
--        AC_CONFIG_FILES([perl-URPM/Makefile.PL])
--        AC_CONFIG_FILES([perl-URPM/Makefile])
--    fi
--])
- AC_SUBST(WITH_PERL_URPM_SUBDIR)
- AC_SUBST(WITH_PERL_URPM_SUBPACKAGE)
- AC_SUBST(WITH_PERL_URPM_LIBS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch
deleted file mode 100644
index e219124..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-rpm: opendb before rpmverifyscript to avoid null point input
-
-If the command is "rpm -V" and the return value of (headerIsEntry(h, RPMTAG_VERIFYSCRIPT) 
-|| headerIsEntry(h, RPMTAG_SANITYCHECK)) located in /lib/verify.c is true, it will call
-rpmpsmStage function(rpmVerifyScript->rpmpsmScriptStage->rpmpsmStage) and occur segment
-fault because of null point(rpmtsGetRdb(ts) == NULL and rpmtsGetRdb(ts)->db_txn).
-So we open rpmdb to avoid bad input when find headerIsEntry true.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
-Index: rpm-5.4.14/lib/verify.c
-===================================================================
---- rpm-5.4.14.orig/lib/verify.c	2015-07-22 22:09:59.992895355 +0800
-+++ rpm-5.4.14/lib/verify.c	2015-08-13 10:20:33.752177906 +0800
-@@ -613,6 +613,8 @@
- 	{
- 	    FD_t fdo = fdDup(STDOUT_FILENO);
- 
-+	    rpmtsOpenDB(ts, O_RDONLY);            /*Open the DB to avoid null point input in function rpmpsmStage()*/
-+
- 	    rc = rpmfiSetHeader(fi, h);
- 	    if ((rc = rpmVerifyScript(qva, ts, fi, fdo)) != 0)
- 		ec += rc;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch
deleted file mode 100644
index 691aba9..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Fix integration of ossp-uuid
-
-We need to avoid including the util-linux uuid library, instead
-we need ossp-uuid.  There is a related hack in do_configure to
-make sure that we use the right .pc file as well.
-
-Upstream-Status: Inappropriate [disable feature]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/configure.ac
-===================================================================
---- rpm-5.4.14.orig/configure.ac
-+++ rpm-5.4.14/configure.ac
-@@ -1951,7 +1951,7 @@ grep -v 'define HAVE_UNISTD_H' confdefs.
- esac
- RPM_CHECK_LIB(
-     [OSSP uuid], [uuid],
--    [ossp-uuid uuid], [uuid_import], [uuid.h],
-+    [ossp-uuid], [uuid_import], [uuid.h],
-     [no,external:none], [],
-     [ dnl # enable OSSP uuid native API support for embedded Lua
-       if test ".$WITH_LUA" = .yes; then
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
deleted file mode 100644
index 57fc6ce..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Add the ability to query the packageorigin
-
-Written by jbj at rpm5.org
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/rpmdb/hdrfmt.c
-===================================================================
---- rpm-5.4.14.orig/rpmdb/hdrfmt.c
-+++ rpm-5.4.14/rpmdb/hdrfmt.c
-@@ -2409,8 +2409,10 @@ static int pkgoriginTag(Header h, HE_t h
-     int rc = 1;
- 
-     he->tag = RPMTAG_PACKAGEORIGIN;
--    if (!headerGet(h, he, HEADERGET_NOEXTENSION)
--     && (origin = headerGetOrigin(h)) != NULL)
-+    /* XXX two sources for tag data: what search precedence? */
-+    if (headerGet(h, he, HEADERGET_NOEXTENSION))
-+	rc = 0;
-+    else if ((origin = headerGetOrigin(h)) != NULL)
-     {
- 	he->t = RPM_STRING_TYPE;
- 	he->p.str = xstrdup(origin);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch
deleted file mode 100644
index af643b1..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-If we run builds on a filesystem with 64 bit inodes like XFS, we need to
-map the inode numbers to something 32 bit since the cpio header only allows
-for 32 bit inode values. If we don't do this:
-
-#define SET_NUM_FIELD(phys, val, space) \
-        sprintf(space, "%8.8lx", (unsigned long) (val)); \
-        memcpy(phys, space, 8)
-
-from cpio.c will print larger that 8 character values and then truncate the 
-LSBs. This generates cpio files where hardlinked files may have the same
-inode number. The resulting rpms are then corrupted.
-
-There is a separate patch for the crash the identical inode numbers causes
-when extracting the rpm.
-
-Patch taken from http://git.pld-linux.org/?p=packages/rpm.git;a=commitdiff;h=10526c23aac60b7b636e4c93862887dbef8e8f15
-
-RP 2014/6/10
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Index: rpm-5.4.14/build/files.c
-===================================================================
---- rpm-5.4.14.orig/build/files.c
-+++ rpm-5.4.14/build/files.c
-@@ -1328,6 +1328,26 @@ static rpmuint32_t getDigestAlgo(Header
-     return dalgo;
- }
- 
-+static int isHardLink(FileListRec flp, FileListRec tlp)
-+{
-+    return ((S_ISREG(flp->fl_mode) && S_ISREG(tlp->fl_mode)) &&
-+            ((flp->fl_nlink > 1) && (flp->fl_nlink == tlp->fl_nlink)) &&
-+            (flp->fl_ino == tlp->fl_ino) &&
-+            (flp->fl_dev == tlp->fl_dev));
-+}
-+
-+static int seenHardLink(FileList fl, FileListRec flp, ino_t *fileid)
-+{
-+    FileListRec ilp;
-+    for (ilp = fl->fileList; ilp < flp; ilp++) {
-+        if (isHardLink(flp, ilp)) {
-+            *fileid = ilp - fl->fileList;
-+            return 1;
-+        }
-+    }
-+    return 0;
-+}
-+
- /**
-  * Add file entries to header.
-  * @todo Should directories have %doc/%config attributes? (#14531)
-@@ -1374,6 +1394,7 @@ memset(buf, 0, sizeof(buf));	/* XXX valg
- 
-     for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
- 	const char *s;
-+	ino_t fileid = flp - fl->fileList;
- 
-  	/* Merge duplicate entries. */
- 	while (i < (fl->fileListRecsUsed - 1) &&
-@@ -1436,6 +1457,13 @@ memset(buf, 0, sizeof(buf));	/* XXX valg
- 	/* Leave room for both dirname and basename NUL's */
- 	dpathlen += (strlen(flp->diskURL) + 2);
- 
-+	/* Excludes and dupes have been filtered out by now. */
-+	if (S_ISREG(flp->fl_mode)) {
-+	    if (flp->fl_nlink == 1 || !seenHardLink(fl, flp, &fileid)) {
-+		fl->totalFileSize += flp->fl_size;
-+	    }
-+	}
-+
- 	/*
- 	 * Make the header, the OLDFILENAMES will get converted to a 
- 	 * compressed file list write before we write the actual package to
-@@ -1518,7 +1546,11 @@ memset(buf, 0, sizeof(buf));	/* XXX valg
- 
- 	/* XXX Hash instead of 64b->32b truncate to prevent aliasing. */
- 	{   ino_t _ino = flp->fl_ino;
-+	/* don't use hash here, as hash collisions which happen on large packages
-+	   cause bus errors in rpmbuild
- 	    ui32 = hashFunctionString(0, &_ino, sizeof(_ino));
-+	*/
-+	    ui32 = fileid + 1;
- 	}
- 	he->tag = RPMTAG_FILEINODES;
- 	he->t = RPM_UINT32_TYPE;
-@@ -1751,39 +1783,6 @@ if (_rpmbuildFlags & 4) {
- 		IOSM_MAP_TYPE | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID;
- 	if (isSrc)
- 	    fi->fmapflags[i] |= IOSM_FOLLOW_SYMLINKS;
--
--	if (S_ISREG(flp->fl_mode)) {
--	    int bingo = 1;
--	    /* Hard links need be tallied only once. */
--	    if (flp->fl_nlink > 1) {
--		FileListRec jlp = flp + 1;
--		int j = i + 1;
--		for (; (unsigned)j < fi->fc; j++, jlp++) {
--		    /* follow outer loop logic */
--		    while (((jlp - fl->fileList) < (fl->fileListRecsUsed - 1)) &&
--			    !strcmp(jlp->fileURL, jlp[1].fileURL))
--			jlp++;
--		    if (jlp->flags & RPMFILE_EXCLUDE) {
--			j--;
--			/*@innercontinue@*/ continue;
--		    }
--		    if (jlp->flags & RPMFILE_GHOST)
--		        /*@innercontinue@*/ continue;
--		    if (!S_ISREG(jlp->fl_mode))
--			/*@innercontinue@*/ continue;
--		    if (flp->fl_nlink != jlp->fl_nlink)
--			/*@innercontinue@*/ continue;
--		    if (flp->fl_ino != jlp->fl_ino)
--			/*@innercontinue@*/ continue;
--		    if (flp->fl_dev != jlp->fl_dev)
--			/*@innercontinue@*/ continue;
--		    bingo = 0;	/* don't tally hardlink yet. */
--		    /*@innerbreak@*/ break;
--		}
--	    }
--	    if (bingo)
--		fl->totalFileSize += flp->fl_size;
--	}
-     }
- 
-     ui32 = fl->totalFileSize;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch
deleted file mode 100644
index 656de86..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-pkgconfigdeps.sh: Change to restricting pkgconfig to the local directory
-
-Using PKG_CONFIG_PATH will allow pkg-config to fall back to the system paths,
-we don't want this as it may lead to inaccurate results in some corner cases.
-
-PKG_CONFIG_LIBDIR will ensure pkg-config stays within the install directory.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/scripts/pkgconfigdeps.sh
-===================================================================
---- rpm.orig/scripts/pkgconfigdeps.sh
-+++ rpm/scripts/pkgconfigdeps.sh
-@@ -18,8 +18,8 @@ case $1 in
-     *.pc)
- 	# Query the dependencies of the package.
- 	DIR=$(dirname ${filename})
--	PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
--	export PKG_CONFIG_PATH
-+	PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig"
-+	export PKG_CONFIG_LIBDIR
- 	$pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do
- 	    [ -n "$n" ] || continue
- 	    # We have a dependency.  Make a note that we need the pkgconfig
-@@ -42,8 +42,8 @@ case $1 in
- 	[ -n "$oneshot" ] && echo "$oneshot"; oneshot=""
- 	# Query the dependencies of the package.
- 	DIR=$(dirname ${filename})
--	PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
--	export PKG_CONFIG_PATH
-+	PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig"
-+	export PKG_CONFIG_LIBDIR
- 	$pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
- 	    [ -n "$n" ] || continue
- 	    if  [ -n "$r" ] && [ -n "$v" ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch
deleted file mode 100644
index 200964f..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Don't add the first line of /etc/rpm/platform to the list of patterns
-to match when computing an arch score, use it just for getting
-information about the platform (cpu/vendor/os). Fixes #3864.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Index: rpm-5.4.14/lib/rpmrc.c
-===================================================================
---- rpm-5.4.14.orig/lib/rpmrc.c
-+++ rpm-5.4.14/lib/rpmrc.c
-@@ -510,6 +510,7 @@ static rpmRC rpmPlatform(const char * pl
- #endif
- 	}
- 
-+#if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */
- #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
- 	/* do not use vendor and GNU attribution */
- 	p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL);
-@@ -520,7 +521,8 @@ static rpmRC rpmPlatform(const char * pl
- #endif
- 	xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
- 	p = _free(p);
--	
-+#endif
-+
- 	init_platform++;
-     }
-     rc = (init_platform ? RPMRC_OK : RPMRC_FAIL);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
deleted file mode 100644
index 3b40fea..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-Fix up platform and related sysinfo file loading.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-This ensures that RPM knows the compatible set of package types at all times.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/lib/depends.c
-===================================================================
---- rpm-5.4.14.orig/lib/depends.c
-+++ rpm-5.4.14/lib/depends.c
-@@ -250,7 +250,7 @@ static int rpmtsAddUpgrades(rpmts ts, rp
- 	    he->p.ptr = _free(he->p.ptr);
- 	}
- 
--#if defined(RPM_VENDOR_WINDRIVER)
-+#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
- 	/*
- 	 * If we're capable of installing multiple colors
- 	 * but at least one of the packages are white (0), we
-@@ -507,7 +507,7 @@ assert(lastx >= 0 && lastx < ts->orderCo
-     return 0;
- }
- 
--#if defined(RPM_VENDOR_WINDRIVER)
-+#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
- /* Is "compat" compatible w/ arch? */
- int _isCompatibleArch(const char * arch, const char * compat)
- {
-@@ -663,7 +663,7 @@ assert(he->p.str != NULL);
- 
- 	    if (arch == NULL || (parch = rpmteA(p)) == NULL)
- 		continue;
--#if defined(RPM_VENDOR_WINDRIVER)
-+#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
- 	    /* XXX hackery for alias matching. */
- 	    if (!_isCompatibleArch(arch, parch))
- 		continue;
-@@ -829,6 +829,12 @@ int rpmtsAddEraseElement(rpmts ts, Heade
-     return rc;
- }
- 
-+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
-+#define _ETC_RPM_SYSINFO        "%{_etcrpm}/sysinfo"
-+#else
-+#define _ETC_RPM_SYSINFO        SYSCONFIGDIR "/sysinfo"
-+#endif
-+
- /*@only@*/ /*@null@*/ /*@unchecked@*/
- static char *sysinfo_path = NULL;
- 
-@@ -1311,7 +1317,7 @@ retry:
- 	sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL);
- 	if (!(sysinfo_path != NULL && *sysinfo_path == '/')) {
- 	    sysinfo_path = _free(sysinfo_path);
--	    sysinfo_path = xstrdup(SYSCONFIGDIR "/sysinfo");
-+	    sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL);
- 	}
-     }
- 
-Index: rpm-5.4.14/lib/rpmds.c
-===================================================================
---- rpm-5.4.14.orig/lib/rpmds.c
-+++ rpm-5.4.14/lib/rpmds.c
-@@ -1759,7 +1759,7 @@ int rpmdsSysinfo(rpmPRCO PRCO, const cha
- /*@-observertrans @*/
- 	    _sysinfo_path = _free(_sysinfo_path);
- /*@=observertrans @*/
--	    _sysinfo_path = xstrdup(_ETC_RPM_SYSINFO);
-+	    _sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL);
- 	}
-     }
- /*@=modobserver@*/
-Index: rpm-5.4.14/lib/rpmrc.c
-===================================================================
---- rpm-5.4.14.orig/lib/rpmrc.c
-+++ rpm-5.4.14/lib/rpmrc.c
-@@ -38,7 +38,13 @@
- static const char * configTarget = NULL;
- 
- /*@observer@*/ /*@unchecked@*/
--static const char * platform = SYSCONFIGDIR "/platform";
-+#if defined(RPM_VENDOR_WINDRIVER)
-+#define _ETC_RPM_PLATFORM        "%{_etcrpm}/platform"
-+#else
-+#define _ETC_RPM_PLATFORM        SYSCONFIGDIR "/platform"
-+#endif
-+
-+static const char * _platform = NULL;
- 
- /*@only@*/ /*@relnull@*/ /*@unchecked@*/
- void * platpat = NULL;
-@@ -694,16 +700,17 @@ static void defaultMachine(/*@out@*/ con
-     int rc;
- 
-     while (!gotDefaults) {
--#if defined(RPM_VENDOR_WINDRIVER)
--	const char * _platform = rpmGetPath(__etcrpm, "/platform", NULL);
--#else
--	const char * _platform = platform;
--#endif
-+	if (_platform == NULL) {
-+	    _platform = rpmExpand("%{?_rpmrc_platform_path}", NULL);
-+	    /* XXX may need to validate path existence somewhen. */
-+	    if (!(_platform != NULL && *_platform == '/')) {
-+		_platform = _free(_platform);
-+		_platform = rpmExpand(_ETC_RPM_PLATFORM, NULL);
-+	    }
-+	}
- 	CVOG_t cvog = NULL;
- #if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */
- 	const char *cp;
--#endif
--#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */
- 	/* utsname fields on some platforms (like HP-UX) are very small
- 	   (just about 8 characters). This is too small for OpenPKG, so cheat! */
- 	rc = uname(&un_real);
-@@ -780,9 +787,7 @@ static void defaultMachine(/*@out@*/ con
- 	if (cp != NULL && cp != _platform)
- 	    cp = _free(cp);
- #endif
--#if defined(RPM_VENDOR_WINDRIVER)
- 	_platform = _free(_platform);
--#endif
- 
- 	if (configTarget && !parseCVOG(configTarget, &cvog) && cvog != NULL) {
- 	    gotDefaults = 1;
-@@ -1101,6 +1106,8 @@ int rpmReadConfigFiles(/*@unused@*/ cons
- 
- #ifdef PREMACROFILES
-     if (rpmReadRC(PREMACROFILES)) return -1;
-+#else
-+    if (rpmReadRC(NULL)) return -1;
- #endif
- 
-     /* Reset umask to its default umask(2) value. */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
deleted file mode 100644
index b9675c7..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-Fix up platform and related sysinfo file loading (part 2).
-
-We need to ensure that we set the _gnu flag somehow.  We do this by reading
-from the platform file, and setting a new _platform_gnu and related vars.
-
-The default values of _host_cpu, _host_vendor and _host_os are changed to
-reference either the automatically determined _target_... or _platform_...
-values.  The macros file uses the configure time defaults in _platform_...
-versions have not been defined.  This preserves existing behavior, but
-ensures reasonable defaults are always available.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/lib/rpmrc.c
-===================================================================
---- rpm-5.4.14.orig/lib/rpmrc.c
-+++ rpm-5.4.14/lib/rpmrc.c
-@@ -328,10 +328,15 @@ static void setDefaults(void)
- 	/*@modifies rpmGlobalMacroContext, internalState @*/
- {
- 
--#if defined(RPM_VENDOR_WINDRIVER)
-+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
-     addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT);
-     addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT);
-     addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT);
-+
-+    addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT);
-+    addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT);
-+    addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT);
-+    addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT);
- #endif
- 
-     addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT);
-@@ -487,9 +492,22 @@ static rpmRC rpmPlatform(const char * pl
- 	}
- 
- 	if (!parseCVOG(p, &cvog) && cvog != NULL) {
-+#if defined(RPM_VENDOR_OE)
-+	    char * _gnu = NULL;
-+
-+	    addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1);
-+	    addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1);
-+	    addMacro(NULL, "_platform_os", NULL, cvog->os, -1);
-+
-+	    if (cvog->gnu && cvog->gnu[0] != '\0')
-+		_gnu = rpmExpand("-", cvog->gnu, NULL);
-+
-+	    addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
-+#else
- 	    addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
- 	    addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
- 	    addMacro(NULL, "_host_os", NULL, cvog->os, -1);
-+#endif
- 	}
- 
- #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
-Index: rpm-5.4.14/macros/macros.in
-===================================================================
---- rpm-5.4.14.orig/macros/macros.in
-+++ rpm-5.4.14/macros/macros.in
-@@ -900,9 +900,9 @@ $_arbitrary_tags_tests	Foo:Bar
- %_os			@RPMCANONOS@
- %_gnu			@RPMCANONGNU@
- 
--%_host_platform		%{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
--%_build_platform	%{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
--%_target_platform	%{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
-+%_host_platform		%{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
-+%_build_platform	%{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
-+%_target_platform	%{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
- 
- #==============================================================================
- # ---- configure macros.
-@@ -945,9 +945,10 @@ $_arbitrary_tags_tests	Foo:Bar
- %_build_os		%{_host_os}
- %_host			@host@
- %_host_alias		@host_alias@%{nil}
--%_host_cpu		@host_cpu@
--%_host_vendor		@host_vendor@
--%_host_os		@host_os@
-+%_host_cpu		%{?_platform_cpu}%{!?_platform_cpu:%{_arch}}
-+%_host_vendor		%{?_platform_vendor}%{!?_platform_vendor:%{_vendor}}
-+%_host_os		%{?_platform_os}%{!?_platform_os:%{_os}}
-+%_host_gnu		%{?_platform_gnu}%{!?_platform_gnu:%{_gnu}}
- %_target		%{_host}
- %_target_alias		%{_host_alias}
- %_target_cpu		%{_host_cpu}
-Index: rpm-5.4.14/python/rpmmodule.c
-===================================================================
---- rpm-5.4.14.orig/python/rpmmodule.c
-+++ rpm-5.4.14/python/rpmmodule.c
-@@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s
-     if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch))
- 	return NULL;
- 
--#if defined(RPM_VENDOR_WINDRIVER)
--    platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL);
-+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
-+    platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL);
- #else
-     platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL);
- #endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch
deleted file mode 100644
index 92ef1dc..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-python/rpmmodules.c: Change the way the python module loads the RPM config
-
-In order to support the RPM_VENDOR_WINDRIVER enhancement of dynamic
-runtime relocation paths, we need to call rpmcliInit instead of 
-rpmReadConfigFiles.  The rpmcliInit will end up calling rpmReadConfigFiles
-after the necessary relocation processing (if enabled).
-
-Code derived from changes suggested by Paul Eggleton.
-
-Upstream-Status: Pending
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/python/rpmmodule.c
-===================================================================
---- rpm.orig/python/rpmmodule.c
-+++ rpm/python/rpmmodule.c
-@@ -382,9 +382,8 @@ static int initModule(PyObject *m)
-     /* XXX add --noparentdirs --nolinktos to rpmtsCheck() */
-     global_depFlags = (RPMDEPS_FLAG_NOPARENTDIRS | RPMDEPS_FLAG_NOLINKTOS);
- 
--    /* failure to initialize rpm (crypto and all) is rather fatal too... */
--    if (rpmReadConfigFiles(NULL, NULL) == -1)
--	return 0;
-+    const char *argv[1] = {"rpmmodule", 0};
-+    rpmcliInit(1, argv, NULL);
- 
-     d = PyModule_GetDict(m);
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-AddErase.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-AddErase.patch
deleted file mode 100644
index df6f472..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-AddErase.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-rpm/python: The RPM5 API requires a hdrNum to be passed in
-
-The former behavior of passing in -1 as the hdrNum resulting in erase
-operations that did not complete, but also did not error.  Changing to
-using the header instance resolves this problem.
-
-Upstream-Status: Pending
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.15/python/rpmts-py.c
-===================================================================
---- rpm-5.4.15.orig/python/rpmts-py.c
-+++ rpm-5.4.15/python/rpmts-py.c
-@@ -241,12 +241,19 @@ static PyObject *
- rpmts_AddErase(rpmtsObject * s, PyObject * args)
- {
-     Header h;
-+    uint32_t hdrNum;
- 
-     if (!PyArg_ParseTuple(args, "O&:AddErase", hdrFromPyObject, &h))
-         return NULL;
- 
--SPEW((stderr, "*** %s(%p,%p) ts %p\n", __FUNCTION__, s, h, s->ts));
-+    hdrNum = headerGetInstance(h);
-+
-+SPEW((stderr, "*** %s(%p,%p) ts %p hdrNum %ld\n", __FUNCTION__, s, h, s->ts, hdrNum));
-+#ifdef REFERENCE /* this doesn't work, RPM5 requires a unique hdrNum */
-     return PyBool_FromLong(rpmtsAddEraseElement(s->ts, h, -1) == 0);
-+#else
-+    return PyBool_FromLong(rpmtsAddEraseElement(s->ts, h, hdrNum) == 0);
-+#endif
- }
- 
- static int
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-restore-origin.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-restore-origin.patch
deleted file mode 100644
index 7a473db..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-restore-origin.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Fix an issue where the PACKAGEORIGIN is not properly stored.
-
-Restore the rpmtsCallback fdSetOpen call and related code.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/python/rpmts-py.c
-===================================================================
---- rpm.orig/python/rpmts-py.c
-+++ rpm/python/rpmts-py.c
-@@ -672,6 +672,8 @@ rpmtsCallback(const void * hd, const rpm
-     Header h = (Header) hd;
-     struct rpmtsCallbackType_s * cbInfo = data;
-     PyObject * pkgObj = (PyObject *) pkgKey;
-+    PyObject * oh = NULL;
-+    const char * origin = NULL;
-     PyObject * args, * result;
-     static FD_t fd;
- 
-@@ -693,8 +695,16 @@ rpmtsCallback(const void * hd, const rpm
- 	    pkgObj = Py_None;
- 	    Py_INCREF(pkgObj);
- 	}
--    } else
-+    } else {
- 	Py_INCREF(pkgObj);
-+	/* XXX yum has (h, rpmloc) tuple as pkgKey. Extract the path. */
-+	if (!(PyTuple_Check(pkgObj) && PyArg_ParseTuple(pkgObj, "|Os", &oh, &origin)))
-+	    origin = NULL;
-+	/* XXX clean up the path, yum paths start "//..." */
-+	if (origin && origin[0] == '/' && origin[1] == '/')
-+	    origin++;
-+    }
-+
- 
-     PyEval_RestoreThread(cbInfo->_save);
- 
-@@ -723,6 +733,9 @@ SPEW((stderr, "\t%p = fdDup(%d)\n", fd,
- 
- 	fcntl(Fileno(fd), F_SETFD, FD_CLOEXEC);
- 
-+	if (origin != NULL)
-+	    (void) fdSetOpen(fd, origin, 0, 0);
-+
- 	return fd;
-     } else
-     if (what == RPMCALLBACK_INST_CLOSE_FILE) {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-tagname.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-tagname.patch
deleted file mode 100644
index dfb5513..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-tagname.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-rpm-python-module: Change the extension tag from PyCObject to PyInt
-
-Use the tagValue to determine the custom PyInt value to use for the extension
-tag.  Without this, any custom tag extensions will be returned in a format
-that the tagNumFromPyObject and related functions like hdr_subscript will
-failed to process.  Usually the failure is error: expected a string or integer
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.15/python/rpmmodule.c
-===================================================================
---- rpm-5.4.15.orig/python/rpmmodule.c
-+++ rpm-5.4.15/python/rpmmodule.c
-@@ -316,7 +316,7 @@ static void addRpmTags(PyObject *module)
-     {
- 	if (ext->name == NULL || ext->type != HEADER_EXT_TAG)
- 	    continue;
--	PyDict_SetItemString(d, (char *) ext->name, to=PyCObject_FromVoidPtr((void *)ext, NULL));
-+	PyDict_SetItemString(d, (char *) ext->name, to=PyInt_FromLong(tagValue(ext->name)));
- 	Py_XDECREF(to);
-         PyDict_SetItem(dict, to, o=PyString_FromString(ext->name + 7));
- 	Py_XDECREF(o);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
deleted file mode 100644
index a810123..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-chroot: realpath is required before expanding _dbpath
-
-_usr turned out to be a relative path to support dyanmic config, but it's
-being used somewhere as a indicator to locate substrings, so we must get
-the real path of it in advance.
-
-Upstream-Status: Inappropriate (OpenEmbedded specific)
-
-Signed-off-by: Ming Liu <ming.liu@windriver.com>
-
-diff -urpN a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c
---- a/rpmio/rpmrpc.c
-+++ b/rpmio/rpmrpc.c
-@@ -257,7 +257,9 @@ int Open(const char * path, int flags, m
-     /* XXX if the open(2) fails, try to strip a possible chroot(2) prefix. */
-     if (fdno < 0 && errno == ENOENT) {
- 	const char *dbpath = rpmExpand("%{?_dbpath}/", NULL);
--	const char * fn = strstr(path + 1, dbpath);
-+	char resolved_dbpath[PATH_MAX];
-+	realpath(dbpath, resolved_dbpath);
-+	const char * fn = strstr(path + 1, resolved_dbpath);
- 	if (fn)
- 	    fdno = open(fn, flags, mode);
- 	dbpath = _free(dbpath);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch
deleted file mode 100644
index 59fe524..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-macros: Use dyanmic config vs hard coded settings
-
-When the dynamic, runtime relocation is enables we need to make sure that the 
-RPM macro file does not override the dynamic settings.  Fix this by forcing the
-dynamic version to be used in all cases.
-
-Upstream-Status: Inappropriate (OpenEmbedded specific)
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/macros/macros.in
-===================================================================
---- rpm-5.4.14.orig/macros/macros.in
-+++ rpm-5.4.14/macros/macros.in
-@@ -27,11 +27,12 @@
- #==============================================================================
- # ---- filesystem macros.
- #
--%_usr			@usrprefix@
-+%_usr			%{_usrlibrpm}/../..
- %_usrsrc		%{_usr}/src
--%_var			@varprefix@
--%_usrlibrpm		@USRLIBRPM@
--%_etcrpm		@SYSCONFIGDIR@
-+%_var			%{_usr}/../var
-+# The dynamic relocation code sets the following two items
-+#%_usrlibrpm		@USRLIBRPM@
-+#%_etcrpm		@SYSCONFIGDIR@
- 
- %__objext		@objext@
- %__libext		@libext@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
deleted file mode 100644
index 526106d..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-lib/rpmts.c: Ensure that we check both providename and filepaths
-
-When looking up a missing dependencies, such as /bin/sh, we need to lookup
-in both the providename and filepaths DB, not just the filepaths DB.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/lib/rpmts.c
-===================================================================
---- rpm-5.4.14.orig/lib/rpmts.c
-+++ rpm-5.4.14/lib/rpmts.c
-@@ -410,8 +410,8 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __
- 	if (sdb == NULL)
- 	    continue;
- 
--	/* Look for a matching Provides: in suggested universe. */
--	rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME);
-+	rpmtag = RPMTAG_PROVIDENAME;
-+       do {
- 	mi = rpmmiInit(sdb, rpmtag, keyp, keylen);
- 	while ((h = rpmmiNext(mi)) != NULL) {
- 	    size_t hnamelen;
-@@ -446,6 +446,15 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __
- 	    bhnamelen = hnamelen;
- 	}
- 	mi = rpmmiFree(mi);
-+
-+	if (bh == NULL && *keyp == '/' && rpmtag == RPMTAG_PROVIDENAME) {
-+	   rpmtag = RPMTAG_FILEPATHS;
-+	   continue;
-+        }
-+
-+        break;
-+      } while (1);
-+
-     }
- 
-     /* Is there a suggested resolution? */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmdb-grammar.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmdb-grammar.patch
deleted file mode 100644
index 71dae49..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmdb-grammar.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-Disable various items that do not cross compile well.
-
-Upstream-Status: Inappropriate [Configuration]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/rpmdb/Makefile.am
-===================================================================
---- rpm.orig/rpmdb/Makefile.am
-+++ rpm/rpmdb/Makefile.am
-@@ -34,10 +34,10 @@ EXTRA_DIST = \
- 	db3.c sqlite.c db_emu.h librpmdb.vers bdb.sql libsqldb.c \
- 	logio.awk logio.src logio_recover_template logio_template logio.c \
- 	logio_rec.c logio_auto.c logio_autop.c logio_auto.h \
--	qf.l qf.y qf.inp tqf.l tqf.y tqf.inp grammar.y scanner.l json1.js
-+	tqf.l tqf.y tqf.inp grammar.y scanner.l json1.js
- 
--EXTRA_PROGRAMS = qfcalc qfgraph logio tjfn tqf # tbdb
--noinst_PROGRAMS = json
-+EXTRA_PROGRAMS = qfcalc qfgraph logio # tjfn tqf tbdb
-+noinst_PROGRAMS = # json
- 
- RPMMISC_LDADD_COMMON = \
- 	$(top_builddir)/misc/librpmmisc.la \
-@@ -321,54 +321,39 @@ BUILT_SOURCES += .syntastic_c_config
- .syntastic_c_config: Makefile
- 	@echo $(COMPILE) | tr ' ' '\n' | sed -e '1d' > $@
- 
--tjfn_SOURCES = tjfn.c
--tjfn_LDADD = $(mylibs)
--
--LEX =	flex
--LFLAGS=	-d -T -v -8 -b --yylineno --reentrant --bison-bridge --perf-report
--YACC =	bison
--YFLAGS=	-Dapi.pure -t -d -v --report=all
--
--BUILT_SOURCES += Jgrammar.c Jgrammar.h Jscanner.c
--Jgrammar.c: grammar.y
--	$(YACC) $(YFLAGS) -o $@ $<
--Jscanner.c: scanner.l
--	$(LEX) -R -o $@ $<
--json_SOURCES = Jgrammar.c Jscanner.c json.c
--
--testjson: json1.js json
--	./json json1.js
--
--BUILT_SOURCES += Qgrammar.c Qgrammar.h Qscanner.c
--Qgrammar.c: qf.y
--	$(YACC) $(YFLAGS) -o $@ $<
--Qscanner.c: qf.l
--	$(LEX) -R -o $@ $<
--qfcalc_SOURCES = Qgrammar.c Qscanner.c interpreter.c
--qfgraph_SOURCES = Qgrammar.c Qscanner.c graph.c
--
--testqf: qfcalc qfgraph
--	./qfcalc < qf.inp
--	./qfgraph < qf.inp
--
--BUILT_SOURCES += Tgrammar.c Tgrammar.h Tscanner.c
--Tgrammar.c Tgrammar.h: tqf.y
--	$(YACC) $(YFLAGS) -o $@ $<
--Tscanner.c Tscanner.h: tqf.l
--	$(LEX) --prefix="Tyy" $(LFLAGS) -o $@ $<
--tqf_SOURCES =	Tgrammar.c Tscanner.c tgraph.c
--tqf_CFLAGS =	$(CFLAGS) -fsanitize=address # -DTSCANNER_MAIN
--tqf_LDADD =	../lib/librpm.la \
--		./librpmdb.la \
--		../popt/libpopt.la
--
--testdir =	$(abs_top_builddir)/tests
--foo: tqf
--	-../libtool --mode=execute \
--	    ./tqf \
--		--dbpath=$(testdir) \
--		-r $(testdir)/fodder/*.rpm \
--		   $(testdir)/fodder/fmtmod.qf
-+#tjfn_SOURCES = tjfn.c
-+#tjfn_LDADD = $(mylibs)
-+#
-+#LFLAGS=	-d -T -v -8 -b --yylineno --reentrant --bison-bridge --perf-report
-+#
-+#BUILT_SOURCES += Jgrammar.c Jgrammar.h Jscanner.c
-+#Jgrammar.c Jgrammar.h: grammar.y
-+#	$(YACC) $(YFLAGS) -t -d -v -o $@ $<
-+#Jscanner.c: scanner.l
-+#	$(LEX) -R -o $@ $<
-+#json_SOURCES = Jgrammar.c Jscanner.c json.c
-+#
-+#testjson: json1.js json
-+#	./json json1.js
-+#
-+#BUILT_SOURCES += Tgrammar.c Tgrammar.h Tscanner.c
-+#Tgrammar.c Tgrammar.h: tqf.y
-+#	$(YACC) $(YFLAGS) -t -d -v -o $@ $<
-+#Tscanner.c Tscanner.h: tqf.l
-+#	$(LEX) --prefix="Tyy" $(LFLAGS) -o $@ $<
-+#tqf_SOURCES =	Tgrammar.c Tscanner.c tgraph.c
-+#tqf_CFLAGS =	$(CFLAGS) -fsanitize=address # -DTSCANNER_MAIN
-+#tqf_LDADD =	../lib/librpm.la \
-+#		./librpmdb.la \
-+#		../popt/libpopt.la
-+
-+#testdir =	$(abs_top_builddir)/tests
-+#foo: tqf
-+#	-../libtool --mode=execute \
-+#	    ./tqf \
-+#		--dbpath=$(testdir) \
-+#		-r $(testdir)/fodder/*.rpm \
-+#		   $(testdir)/fodder/fmtmod.qf
- 
- #tbdb_SOURCES = tbdb.c bdb.c
- #tbdb_LDADD = $(mylibs)
-Index: rpm/configure.ac
-===================================================================
---- rpm.orig/configure.ac
-+++ rpm/configure.ac
-@@ -119,6 +119,7 @@ AC_PROG_MAKE_SET
- AC_PROG_LIBTOOL
- AC_PROG_RANLIB
- AC_PROG_YACC
-+AM_PROG_LEX
- 
- AC_PATH_PROG(AS, as, as)
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmfc.c-fix-for-N32-MIPS64.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmfc.c-fix-for-N32-MIPS64.patch
deleted file mode 100644
index b9a2cbc..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmfc.c-fix-for-N32-MIPS64.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 16dc683aa50be9789d1674734b06a8a955ff22ad Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Thu, 26 Nov 2015 01:36:40 -0800
-Subject: [PATCH] lib/rpmfc.c: fix for N32 MIPS64
-
-It is 'N32 MIPS64', not 'N32 MIPS32' as command file shows:
-$ file image/usr/bin/getent
-getent: ELF 32-bit MSB executable, MIPS, N32 MIPS64 [snip]
-
-And "rpm -qp --filecolor" was wrong (it was 1, but should be 4).
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- lib/rpmfc.c |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/rpmfc.c b/lib/rpmfc.c
-index fde00c7..49779f8 100644
---- a/lib/rpmfc.c
-+++ b/lib/rpmfc.c
-@@ -575,7 +575,7 @@ static struct rpmfcTokens_s rpmfcTokens[] = {
-   { " not stripped",		RPMFC_NOTSTRIPPED },
-   { " archive",			RPMFC_ARCHIVE },
- 
--  { "MIPS, N32 MIPS32",		RPMFC_ELFMIPSN32|RPMFC_INCLUDE },
-+  { "MIPS, N32 MIPS64",		RPMFC_ELFMIPSN32|RPMFC_INCLUDE },
-   { "ELF 32-bit",		RPMFC_ELF32|RPMFC_INCLUDE },
-   { "ELF 64-bit",		RPMFC_ELF64|RPMFC_INCLUDE },
- 
--- 
-1.7.9.5
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmio-headers.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmio-headers.patch
deleted file mode 100644
index 9364576..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmio-headers.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Fix a typo in the rpmio Makefile.am
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/rpmio/Makefile.am
-===================================================================
---- rpm.orig/rpmio/Makefile.am
-+++ rpm/rpmio/Makefile.am
-@@ -121,7 +121,7 @@ luaLPATHdir =	${pkgsharedir)/lua
- 
- pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX)
- pkginc_HEADERS = argv.h mire.h rpmzlog.h yarn.h \
--	rpmbf.h rpmcb.h rpmio.h rpmlog.h rpmiotypes.h rpmmacro.h
-+	rpmbf.h rpmcb.h rpmio.h rpmlog.h rpmiotypes.h rpmmacro.h \
- 	rpmpgp.h rpmsw.h rpmutil.h
- noinst_HEADERS = \
- 	ar.h bcon.h bson.h cpio.h crc.h envvar.h fnmatch.h fts.h glob.h iosm.h \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-popt.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-popt.patch
deleted file mode 100644
index 915d7ef..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-popt.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-rpmpgp.h: We do not require the popt header in order to use rpmpgp functions
-
-This can cause failures if the internal libpopt is used, as it's header is
-not exported.
-
-Upstream-Status: Pending
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/rpmio/rpmpgp.h
-===================================================================
---- rpm-5.4.14.orig/rpmio/rpmpgp.h
-+++ rpm-5.4.14/rpmio/rpmpgp.h
-@@ -11,11 +11,11 @@
-  */
- 
- #include <string.h>
--#include <popt.h>
- #include <rpmiotypes.h>
- #include <yarn.h>
- 
- #if defined(_RPMPGP_INTERNAL)
-+#include <popt.h>
- #include <rpmsw.h>
- 
- /*@unchecked@*/
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch
deleted file mode 100644
index b55fe22..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-Enable a cross-install scriptlet helper.
-
-The helper is called from outside of the chroot with the arguments:
-
-<root> <prog> <script> <arg1> [<arg2> ... <argN>]
-
-The helper script is used by oe-core to facilitate shell script actions that
-can not be run from within a chroot on a foreign target system during a
-cross install.
-
-Upstream-Status: Pending
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/lib/psm.c
-===================================================================
---- rpm.orig/lib/psm.c
-+++ rpm/lib/psm.c
-@@ -846,6 +846,9 @@ static rpmRC runScript(rpmpsm psm, Heade
-     pid_t pid;
-     int xx;
-     int i;
-+#ifdef RPM_VENDOR_OE
-+    const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
-+#endif
- 
- #ifdef	__clang__
- #pragma clang diagnostic push
-@@ -923,14 +926,29 @@ assert(he->p.str != NULL);
- 		(F_ISSET(psm, UNORDERED) ? "a" : ""));
- 
-     if (Phe->p.argv == NULL) {
--	argv = (const char **) alloca(5 * sizeof(*argv));
--	argv[0] = "/bin/sh";
--	argc = 1;
-+	argv = (const char **) alloca(7 * sizeof(*argv));
-+	argc = 0;
-+    } else {
-+	argv = (const char **) alloca((Phe->c + 6) * sizeof(*argv));
-+	argc = 0;
-+    }
-+
-+#ifdef RPM_VENDOR_OE
-+    if (scriptletWrapper && *scriptletWrapper) {
-+	argv[argc++] = scriptletWrapper;
-+	argv[argc] = rpmtsRootDir(ts);
-+	if (!argv[argc] || !*argv[argc])
-+	   argv[argc] = "/";
-+	argc++;
-+    }
-+#endif
-+
-+    if (Phe->p.argv == NULL) {
-+	argv[argc++] = "/bin/sh";
- 	ldconfig_done = 0;
-     } else {
--	argv = (const char **) alloca((Phe->c + 4) * sizeof(*argv));
--	memcpy(argv, Phe->p.argv, Phe->c * sizeof(*argv));
--	argc = Phe->c;
-+	memcpy((argv + argc), Phe->p.argv, Phe->c * sizeof(*argv));
-+	argc += Phe->c;
- 	ldconfig_done = (ldconfig_path && !strcmp(argv[0], ldconfig_path)
- 		? 1 : 0);
-     }
-@@ -981,7 +999,12 @@ assert(he->p.str != NULL);
- 	    goto exit;
- 
- 	if (rpmIsDebug() &&
--	    (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash")))
-+	    (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))
-+#ifdef RPM_VENDOR_OE
-+	    || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/sh"))
-+	    || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/bash"))
-+#endif
-+	   )
- 	{
- 	    static const char set_x[] = "set -x\n";
- 	    nw = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd);
-@@ -1116,12 +1139,22 @@ assert(he->p.str != NULL);
- 
- 	{   const char * rootDir = rpmtsRootDir(ts);
- 	    if (!rpmtsChrootDone(ts) && rootDir != NULL &&
-+#ifdef RPM_VENDOR_OE
-+		!(scriptletWrapper && *scriptletWrapper) &&
-+#endif
- 		!(rootDir[0] == '/' && rootDir[1] == '\0'))
- 	    {
- 		/*@-modobserver@*/
- 		xx = Chroot(rootDir);
- 		/*@=modobserver@*/
- 	    }
-+#ifdef RPM_VENDOR_OE
-+	    if (!rpmtsChrootDone(ts) && rootDir != NULL &&
-+		(scriptletWrapper && *scriptletWrapper) &&
-+		!(rootDir[0] == '/' && rootDir[1] == '\0'))
-+		xx = Chdir(rootDir);
-+	    else 
-+#endif
- 	    xx = Chdir("/");
- 	    rpmlog(RPMLOG_DEBUG, D_("%s: %s(%s)\texecv(%s) pid %d\n"),
- 			psm->stepName, sln, NVRA,
-@@ -3052,6 +3085,13 @@ assert(psm->te != NULL);
-     case PSM_SCRIPT:	/* Run current package scriptlets. */
- 	/* XXX running %verifyscript/%sanitycheck doesn't have psm->te */
-     {	rpmtxn _parent = (psm && psm->te ? psm->te->txn : NULL);
-+
-+#ifdef RPM_VENDOR_OE
-+        const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
-+	if (scriptletWrapper && *scriptletWrapper)
-+	     rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
-+#endif
-+
- 	xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL);
- 	rc = runInstScript(psm);
- 	if (rc)
-@@ -3059,11 +3099,24 @@ assert(psm->te != NULL);
- 	else
- 	     xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn);
- 	rpmtsGetRdb(ts)->db_txn = NULL;
-+#ifdef RPM_VENDOR_OE
-+	if (scriptletWrapper && *scriptletWrapper)
-+	     rc = rpmpsmNext(psm, PSM_CHROOT_IN);
-+#endif
-     }	break;
-     case PSM_TRIGGERS:
- 	/* Run triggers in other package(s) this package sets off. */
- 	if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)	break;
-+#ifdef RPM_VENDOR_OE
-+        const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
-+	if (scriptletWrapper && *scriptletWrapper)
-+	     rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
-+#endif
- 	rc = runTriggers(psm);
-+#ifdef RPM_VENDOR_OE
-+	if (scriptletWrapper && *scriptletWrapper)
-+	     rc = rpmpsmNext(psm, PSM_CHROOT_IN);
-+#endif
- 	break;
-     case PSM_IMMED_TRIGGERS:
- 	/* Run triggers in this package other package(s) set off. */
-@@ -3073,7 +3126,18 @@ assert(psm->te != NULL);
- 	    F_SET(psm, GOTTRIGGERS);
- 	}
- 	if (psm->triggers != NULL)
-+#ifdef RPM_VENDOR_OE
-+	{
-+            const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
-+	    if (scriptletWrapper && *scriptletWrapper)
-+	         rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
-+#endif
- 	    rc = runImmedTriggers(psm);
-+#ifdef RPM_VENDOR_OE
-+	    if (scriptletWrapper && *scriptletWrapper)
-+	         rc = rpmpsmNext(psm, PSM_CHROOT_IN);
-+	}
-+#endif
- 	break;
- 
-     case PSM_RPMIO_FLAGS:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch
deleted file mode 100644
index ec38b95..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Workaround for a memory leak in --showrc.
-
-Upstream-Status: Pending
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.14/lib/rpmrc.c
-===================================================================
---- rpm-5.4.14.orig/lib/rpmrc.c
-+++ rpm-5.4.14/lib/rpmrc.c
-@@ -1228,11 +1228,15 @@ int rpmShowRC(FILE * fp)
- 		if (DNEVR != NULL)
- 		    fprintf(fp, "    %s\n", DNEVR+2);
- 	    }
-+#if 0
- 	    (void)rpmdsFree(ds);
- 	    ds = NULL;
-+#endif
- 	    fprintf(fp, "\n");
- 	}
-+#if 0
- 	PRCO = rpmdsFreePRCO(PRCO);
-+#endif
-     }
- 
-     if (rpmIsVerbose()) {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-syck-fix-gram.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-syck-fix-gram.patch
deleted file mode 100644
index d6493c1..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-syck-fix-gram.patch
+++ /dev/null
@@ -1,1081 +0,0 @@
-Fix the syck/lib/gram.y
-
-This resolves a problem during compilation:
-
-../../../rpm/syck/lib/gram.y:66:27: error: 'parser' undeclared (first use in this function)
-            ((SyckParser *)parser)->root = syck_hdlr_add_node( (SyckParser *)parser, $1 );
-                           ^
-../../../rpm/syck/lib/gram.y:66:27: note: each undeclared identifier is reported only once for each function it appears in
-../../../rpm/syck/lib/syck.c: In function 'syck_parse':
-../../../rpm/syck/lib/syck.c:516:5: warning: implicit declaration of function 'syckparse' [-Wimplicit-function-declaration]
-     syckparse( p );
-     ^
-
-This patch was generated by reverting the grammer back to a previous
-version.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/syck/lib/gram.y
-===================================================================
---- rpm.orig/syck/lib/gram.y
-+++ rpm/syck/lib/gram.y
-@@ -9,18 +9,10 @@
- 
- %start doc
- %pure-parser
--%parse-param {void* parser}
--%lex-param {void* parser}
- 
- 
- %{
- 
--#define YYDEBUG 1
--#define YYERROR_VERBOSE 1
--#ifndef YYSTACK_USE_ALLOCA
--#define YYSTACK_USE_ALLOCA 0
--#endif
--
- #include "system.h"
- #include "syck.h"
- #include "debug.h"
-@@ -28,6 +20,9 @@
- void apply_seq_in_map( SyckParser *parser, SyckNode *n )
- 	/*@*/;
- 
-+#define YYPARSE_PARAM   parser
-+#define YYLEX_PARAM     parser
-+
- #define NULL_NODE(parser, node) \
-         SyckNode *node = syck_new_str( "", scalar_plain ); \
-         if ( ((SyckParser *)parser)->taguri_expansion == 1 ) \
-Index: rpm/syck/lib/Makefile.am
-===================================================================
---- rpm.orig/syck/lib/Makefile.am
-+++ rpm/syck/lib/Makefile.am
-@@ -49,25 +49,25 @@ SYCK_SPLINT_SRCS = \
- 	token.c \
- 	implicit.c
- 
--#gram.c:	gram.y
--#	$(YACC) -d -t -v -p syck -o $@ $<
--#	-@if test -f gram.c; then \
--#	{ echo "/*@-globs -mods -modnomods -moduncon -modunconnomods @*/";\
--#	  echo "/*@-noeffect -noeffectuncon @*/";\
--#	  echo "/*@-nullassign @*/";\
--#	  echo "/*@-readonlytrans @*/";\
--#	  echo "/*@-uniondef @*/";\
--#	  echo "/*@-warnlintcomments @*/";\
--#	  cat gram.c;\
--#	  echo "/*@=warnlintcomments @*/";\
--#	  echo "/*@=uniondef @*/";\
--#	  echo "/*@=readonlytrans @*/";\
--#	  echo "/*@=nullassign @*/";\
--#	  echo "/*@=noeffect =noeffectuncon @*/";\
--#	  echo "/*@=globs =mods =modnomods =moduncon =modunconnomods @*/";\
--#	} > _gram.c ;\
--#	  mv -f _gram.c gram.c; \
--#	fi
-+gram.c:	gram.y
-+	$(YACC) -d -t -v -p syck -o $@ $<
-+	-@if test -f gram.c; then \
-+	{ echo "/*@-globs -mods -modnomods -moduncon -modunconnomods @*/";\
-+	  echo "/*@-noeffect -noeffectuncon @*/";\
-+	  echo "/*@-nullassign @*/";\
-+	  echo "/*@-readonlytrans @*/";\
-+	  echo "/*@-uniondef @*/";\
-+	  echo "/*@-warnlintcomments @*/";\
-+	  cat gram.c;\
-+	  echo "/*@=warnlintcomments @*/";\
-+	  echo "/*@=uniondef @*/";\
-+	  echo "/*@=readonlytrans @*/";\
-+	  echo "/*@=nullassign @*/";\
-+	  echo "/*@=noeffect =noeffectuncon @*/";\
-+	  echo "/*@=globs =mods =modnomods =moduncon =modunconnomods @*/";\
-+	} > _gram.c ;\
-+	  mv -f _gram.c gram.c; \
-+	fi
- 
- BUILT_SOURCES = gram.c gram.h
- 
-Index: rpm/syck/lib/implicit.c
-===================================================================
---- rpm.orig/syck/lib/implicit.c
-+++ rpm/syck/lib/implicit.c
-@@ -19,11 +19,6 @@
- #define YYLIMIT     limit
- #define YYFILL(n)
- 
--#ifdef  __clang__
--#pragma clang diagnostic push
--#pragma clang diagnostic ignored "-Wempty-body"
--#endif
--
- void
- try_tag_implicit( SyckNode *n, int taguri )
- {
-@@ -3000,8 +2995,4 @@ yy270:	++YYCURSOR;
- 
- }
- 
--#ifdef  __clang__
--#pragma clang diagnostic pop
--#endif
--
- /*@=noret@*/
-Index: rpm/syck/lib/syck.c
-===================================================================
---- rpm.orig/syck/lib/syck.c
-+++ rpm/syck/lib/syck.c
-@@ -519,7 +519,7 @@ syck_parse( SyckParser *p )
- }
- 
- void
--syck_default_error_handler( SyckParser *p, const char *msg )
-+syck_default_error_handler( SyckParser *p, char *msg )
- {
-     printf( "Error at [Line %d, Col %ld]: %s\n", 
-         p->linect,
-Index: rpm/syck/lib/syck.h
-===================================================================
---- rpm.orig/syck/lib/syck.h
-+++ rpm/syck/lib/syck.h
-@@ -175,7 +175,7 @@ typedef struct _syck_str SyckIoStr;
- typedef struct _syck_level SyckLevel;
- 
- typedef SYMID (*SyckNodeHandler)(SyckParser *p, SyckNode *n);
--typedef void (*SyckErrorHandler)(SyckParser *p, const char *);
-+typedef void (*SyckErrorHandler)(SyckParser *p, char *);
- typedef SyckNode * (*SyckBadAnchorHandler)(SyckParser *p, char *);
- typedef long (*SyckIoFileRead)(char *, SyckIoFile *, long, long); 
- typedef long (*SyckIoStrRead)(char *, SyckIoStr *, long, long);
-@@ -546,7 +546,7 @@ long syck_parser_readlen( SyckParser *p,
- SYMID syck_parse( SyckParser *p )
- 	/*@globals fileSystem @*/
- 	/*@modifies p, fileSystem @*/;
--void syck_default_error_handler( SyckParser *p, const char * )
-+void syck_default_error_handler( SyckParser *p, char * )
- 	/*@globals fileSystem @*/
- 	/*@modifies p, fileSystem @*/;
- SYMID syck_yaml2byte_handler( SyckParser *p, SyckNode *n )
-@@ -619,7 +619,7 @@ long syck_seq_count( SyckNode *seq )
- /*
-  * Lexer prototypes
-  */
--void syckerror( void *, const char *msg )
-+void syckerror( char *msg )
- 	/*@*/;
- /* XXX union YYSTYPE *sycklval has issues on Mac OS X. */
- int sycklex( void *_sycklval, SyckParser *parser )
-Index: rpm/syck/lib/token.c
-===================================================================
---- rpm.orig/syck/lib/token.c
-+++ rpm/syck/lib/token.c
-@@ -270,11 +270,11 @@ sycklex( void * _sycklval, SyckParser *p
-         return sycklex_yaml_utf8( sycklval, parser );
- 
-         case syck_yaml_utf16:
--            syckerror( parser, "UTF-16 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
-+            syckerror( "UTF-16 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
-         break;
- 
-         case syck_yaml_utf32:
--            syckerror( parser, "UTF-32 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
-+            syckerror( "UTF-32 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
-         break;
- 
-         case syck_bytecode_utf8:
-@@ -2739,15 +2739,14 @@ syckwrap(void)
- }
- 
- void 
--syckerror( void *p, const char *msg )
-+syckerror( char *msg )
- {
--    SyckParser * parser = (SyckParser *)p;
- /*@-mods@*/
--    if ( parser->error_handler == NULL )
--        parser->error_handler = syck_default_error_handler;
-+    if ( syck_parser_ptr->error_handler == NULL )
-+        syck_parser_ptr->error_handler = syck_default_error_handler;
- 
--    parser->root = parser->root_on_error;
-+    syck_parser_ptr->root = syck_parser_ptr->root_on_error;
- /*@=mods@*/
--    (parser->error_handler)(parser, msg);
-+    (syck_parser_ptr->error_handler)(syck_parser_ptr, msg);
- }
- 
-Index: rpm/syck/lib/bytecode.c
-===================================================================
---- rpm.orig/syck/lib/bytecode.c
-+++ rpm/syck/lib/bytecode.c
-@@ -1,10 +1,10 @@
--/* Generated by re2c 0.9.12 on Tue Mar 14 00:14:53 2006 */
-+/* Generated by re2c 0.13.5 on Tue Feb 23 12:04:00 2016 */
- #line 1 "bytecode.re"
- /*
-  * bytecode.re
-  *
-  * $Author: why $
-- * $Date: 2005-09-20 08:21:06 +0300 (Tue, 20 Sep 2005) $
-+ * $Date: 2005/09/20 05:21:06 $
-  *
-  * Copyright (C) 2003 why the lucky stiff
-  */
-@@ -27,14 +27,11 @@
- #define YYLINEPTR   parser->lineptr
- #define YYLINECTPTR parser->linectptr
- #define YYLINE      parser->linect
--#define YYFILL(n)   (void) syck_parser_read(parser)
-+#define YYFILL(n)   syck_parser_read(parser)
- 
--/*@unchecked@*/ /*@null@*/
- extern SyckParser *syck_parser_ptr;
- 
--/*@null@*/
--char *get_inline( SyckParser *parser )
--	/*@modifies parser @*/;
-+char *get_inline( SyckParser *parser );
- 
- /*
-  * Repositions the cursor at `n' offset from the token start.
-@@ -137,14 +134,12 @@ char *get_inline( SyckParser *parser )
-  */
- int
- sycklex_bytecode_utf8( YYSTYPE *sycklval, SyckParser *parser )
--	/*@globals syck_parser_ptr @*/
--	/*@modifies sycklval, parser, syck_parser_ptr @*/
- {
-     SyckLevel *lvl;
-     syck_parser_ptr = parser;
-     if ( YYCURSOR == NULL ) 
-     {
--        (void) syck_parser_read( parser );
-+        syck_parser_read( parser );
-     }
- 
-     if ( parser->force_token != 0 )
-@@ -171,42 +166,37 @@ sycklex_bytecode_utf8( YYSTYPE *sycklval
- #line 165 "<stdout>"
- {
- 	YYCTYPE yych;
--	unsigned int yyaccept = 0;
--	goto yy0;
--	/*@notreached@*/
--	++YYCURSOR;
--yy0:
--	if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
-+
-+	if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- 	yych = *YYCURSOR;
--	switch(yych){
-+	switch (yych) {
- 	case 0x00:	goto yy2;
- 	case 'D':	goto yy3;
- 	default:	goto yy5;
- 	}
--yy2:	YYCURSOR = YYMARKER;
--	switch(yyaccept){
--	case 0:	goto yy4;
--	}
--yy3:	yyaccept = 0;
-+yy2:
-+	YYCURSOR = YYMARKER;
-+	goto yy4;
-+yy3:
- 	yych = *(YYMARKER = ++YYCURSOR);
--	switch(yych){
--	case 0x0A:	goto yy6;
--	case 0x0D:	goto yy8;
-+	switch (yych) {
-+	case '\n':	goto yy6;
-+	case '\r':	goto yy8;
- 	default:	goto yy4;
- 	}
- yy4:
- #line 199 "bytecode.re"
--{   YYPOS(0);
-+	{   YYPOS(0);
-             goto Document;
-         }
--#line 195 "<stdout>"
--yy5:	yych = *++YYCURSOR;
-+#line 191 "<stdout>"
-+yy5:
-+	yych = *++YYCURSOR;
- 	goto yy4;
--yy6:	++YYCURSOR;
--	goto yy7;
--yy7:
-+yy6:
-+	++YYCURSOR;
- #line 186 "bytecode.re"
--{   if ( lvl->status == syck_lvl_header )
-+	{   if ( lvl->status == syck_lvl_header )
-             {
-                 CHK_NL(YYCURSOR);
-                 goto Directive;
-@@ -218,10 +208,11 @@ yy7:
-                 return 0;
-             }
-         }
--#line 214 "<stdout>"
--yy8:	++YYCURSOR;
--	switch((yych = *YYCURSOR)) {
--	case 0x0A:	goto yy6;
-+#line 210 "<stdout>"
-+yy8:
-+	++YYCURSOR;
-+	switch ((yych = *YYCURSOR)) {
-+	case '\n':	goto yy6;
- 	default:	goto yy2;
- 	}
- }
-@@ -239,19 +230,15 @@ Document:
-         YYTOKEN = YYCURSOR;
- 
- 
--#line 235 "<stdout>"
-+#line 232 "<stdout>"
- {
- 	YYCTYPE yych;
--	goto yy9;
--	/*@notreached@*/
--	++YYCURSOR;
--yy9:
--	if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
-+	if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- 	yych = *YYCURSOR;
--	switch(yych){
-+	switch (yych) {
- 	case 0x00:	goto yy30;
--	case 0x0A:	goto yy27;
--	case 0x0D:	goto yy29;
-+	case '\n':	goto yy27;
-+	case '\r':	goto yy29;
- 	case 'A':	goto yy19;
- 	case 'D':	goto yy12;
- 	case 'E':	goto yy16;
-@@ -264,71 +251,73 @@ yy9:
- 	case 'c':	goto yy25;
- 	default:	goto yy11;
- 	}
--yy11:yy12:	yych = *++YYCURSOR;
--	switch(yych){
--	case 0x0A:	goto yy41;
--	case 0x0D:	goto yy44;
-+yy11:
-+yy12:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
-+	case '\n':	goto yy41;
-+	case '\r':	goto yy44;
- 	default:	goto yy11;
- 	}
--yy13:	yych = *++YYCURSOR;
--	switch(yych){
--	case 0x0A:	goto yy41;
--	case 0x0D:	goto yy43;
-+yy13:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
-+	case '\n':	goto yy41;
-+	case '\r':	goto yy43;
- 	default:	goto yy11;
- 	}
--yy14:	yych = *++YYCURSOR;
--	switch(yych){
--	case 0x0A:	goto yy38;
--	case 0x0D:	goto yy40;
-+yy14:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
-+	case '\n':	goto yy38;
-+	case '\r':	goto yy40;
- 	default:	goto yy11;
- 	}
--yy15:	yych = *++YYCURSOR;
--	switch(yych){
--	case 0x0A:	goto yy35;
--	case 0x0D:	goto yy37;
-+yy15:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
-+	case '\n':	goto yy35;
-+	case '\r':	goto yy37;
- 	default:	goto yy11;
- 	}
--yy16:	yych = *++YYCURSOR;
--	switch(yych){
--	case 0x0A:	goto yy32;
--	case 0x0D:	goto yy34;
-+yy16:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
-+	case '\n':	goto yy32;
-+	case '\r':	goto yy34;
- 	default:	goto yy11;
- 	}
--yy17:	++YYCURSOR;
--	goto yy18;
--yy18:
-+yy17:
-+	++YYCURSOR;
- #line 288 "bytecode.re"
--{   ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str); 
-+	{   ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str); 
-             goto Scalar;
-         }
--#line 296 "<stdout>"
--yy19:	++YYCURSOR;
--	goto yy20;
--yy20:
-+#line 295 "<stdout>"
-+yy19:
-+	++YYCURSOR;
- #line 292 "bytecode.re"
--{   ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open);
-+	{   ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open);
-             sycklval->name = get_inline( parser );
-             syck_hdlr_remove_anchor( parser, sycklval->name );
-             CHK_NL(YYCURSOR);
-             return YAML_ANCHOR;
-         }
--#line 307 "<stdout>"
--yy21:	++YYCURSOR;
--	goto yy22;
--yy22:
-+#line 305 "<stdout>"
-+yy21:
-+	++YYCURSOR;
- #line 299 "bytecode.re"
--{   ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str);
-+	{   ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str);
-             sycklval->name = get_inline( parser );
-             POP_LEVEL();
-             if ( *( YYCURSOR - 1 ) == '\n' ) YYCURSOR--;
-             return YAML_ALIAS;
-         }
--#line 318 "<stdout>"
--yy23:	++YYCURSOR;
--	goto yy24;
--yy24:
-+#line 315 "<stdout>"
-+yy23:
-+	++YYCURSOR;
- #line 306 "bytecode.re"
--{   char *qstr;
-+	{   char *qstr;
-             ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open);
-             qstr = get_inline( parser );
-             CHK_NL(YYCURSOR);
-@@ -387,18 +376,16 @@ yy24:
-             sycklval->name = qstr;
-             return YAML_TAGURI;
-         }
--#line 382 "<stdout>"
--yy25:	++YYCURSOR;
--	goto yy26;
--yy26:
-+#line 378 "<stdout>"
-+yy25:
-+	++YYCURSOR;
- #line 366 "bytecode.re"
--{   goto Comment; }
--#line 388 "<stdout>"
--yy27:	++YYCURSOR;
--	goto yy28;
--yy28:
-+	{   goto Comment; }
-+#line 383 "<stdout>"
-+yy27:
-+	++YYCURSOR;
- #line 368 "bytecode.re"
--{   CHK_NL(YYCURSOR);
-+	{   CHK_NL(YYCURSOR);
-             if ( lvl->status == syck_lvl_seq )
-             {
-                 return YAML_INDENT; 
-@@ -410,26 +397,25 @@ yy28:
-             }
-             goto Document;
-         }
--#line 405 "<stdout>"
--yy29:	yych = *++YYCURSOR;
--	switch(yych){
--	case 0x0A:	goto yy27;
-+#line 399 "<stdout>"
-+yy29:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
-+	case '\n':	goto yy27;
- 	default:	goto yy11;
- 	}
--yy30:	++YYCURSOR;
--	goto yy31;
--yy31:
-+yy30:
-+	++YYCURSOR;
- #line 381 "bytecode.re"
--{   ENSURE_YAML_IEND(lvl, -1);
-+	{   ENSURE_YAML_IEND(lvl, -1);
-             YYPOS(0);
-             return 0;
-         }
--#line 419 "<stdout>"
--yy32:	++YYCURSOR;
--	goto yy33;
--yy33:
-+#line 413 "<stdout>"
-+yy32:
-+	++YYCURSOR;
- #line 252 "bytecode.re"
--{   if ( lvl->status == syck_lvl_seq && lvl->ncount == 0 )
-+	{   if ( lvl->status == syck_lvl_seq && lvl->ncount == 0 )
-             {
-                 lvl->ncount++;
-                 YYPOS(0);
-@@ -464,17 +450,17 @@ yy33:
-             CHK_NL(YYCURSOR);
-             return YAML_IEND;
-         }
--#line 459 "<stdout>"
--yy34:	yych = *++YYCURSOR;
--	switch(yych){
--	case 0x0A:	goto yy32;
-+#line 452 "<stdout>"
-+yy34:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
-+	case '\n':	goto yy32;
- 	default:	goto yy11;
- 	}
--yy35:	++YYCURSOR;
--	goto yy36;
--yy36:
-+yy35:
-+	++YYCURSOR;
- #line 237 "bytecode.re"
--{   int complex = 0;
-+	{   int complex = 0;
-             if ( lvl->ncount % 2 == 0 && ( lvl->status == syck_lvl_map || lvl->status == syck_lvl_seq ) )
-             {
-                 complex = 1;
-@@ -488,17 +474,17 @@ yy36:
-             }
-             return YAML_IOPEN;
-         }
--#line 483 "<stdout>"
--yy37:	yych = *++YYCURSOR;
--	switch(yych){
--	case 0x0A:	goto yy35;
-+#line 476 "<stdout>"
-+yy37:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
-+	case '\n':	goto yy35;
- 	default:	goto yy11;
- 	}
--yy38:	++YYCURSOR;
--	goto yy39;
--yy39:
-+yy38:
-+	++YYCURSOR;
- #line 222 "bytecode.re"
--{   int complex = 0;
-+	{   int complex = 0;
-             if ( lvl->ncount % 2 == 0 && ( lvl->status == syck_lvl_map || lvl->status == syck_lvl_seq ) )
-             {
-                 complex = 1;
-@@ -512,29 +498,31 @@ yy39:
-             }
-             return YAML_IOPEN;
-         }
--#line 507 "<stdout>"
--yy40:	yych = *++YYCURSOR;
--	switch(yych){
--	case 0x0A:	goto yy38;
-+#line 500 "<stdout>"
-+yy40:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
-+	case '\n':	goto yy38;
- 	default:	goto yy11;
- 	}
--yy41:	++YYCURSOR;
--	goto yy42;
--yy42:
-+yy41:
-+	++YYCURSOR;
- #line 217 "bytecode.re"
--{   ENSURE_YAML_IEND(lvl, -1);
-+	{   ENSURE_YAML_IEND(lvl, -1);
-                 YYPOS(0);
-                 return 0;
-             }
--#line 521 "<stdout>"
--yy43:	yych = *++YYCURSOR;
--	switch(yych){
--	case 0x0A:	goto yy41;
-+#line 514 "<stdout>"
-+yy43:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
-+	case '\n':	goto yy41;
- 	default:	goto yy11;
- 	}
--yy44:	++YYCURSOR;
--	switch((yych = *YYCURSOR)) {
--	case 0x0A:	goto yy41;
-+yy44:
-+	++YYCURSOR;
-+	switch ((yych = *YYCURSOR)) {
-+	case '\n':	goto yy41;
- 	default:	goto yy11;
- 	}
- }
-@@ -548,28 +536,22 @@ Directive:
-         YYTOKEN = YYCURSOR;
- 
- 
--#line 543 "<stdout>"
-+#line 538 "<stdout>"
- {
- 	YYCTYPE yych;
--	unsigned int yyaccept = 0;
--	goto yy45;
--	/*@notreached@*/
--	++YYCURSOR;
--yy45:
--	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
-+	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- 	yych = *YYCURSOR;
--	switch(yych){
-+	switch (yych) {
- 	case 0x00:	goto yy47;
- 	case 'V':	goto yy48;
- 	default:	goto yy50;
- 	}
--yy47:	YYCURSOR = YYMARKER;
--	switch(yyaccept){
--	case 0:	goto yy49;
--	}
--yy48:	yyaccept = 0;
-+yy47:
-+	YYCURSOR = YYMARKER;
-+	goto yy49;
-+yy48:
- 	yych = *(YYMARKER = ++YYCURSOR);
--	switch(yych){
-+	switch (yych) {
- 	case '.':
- 	case '/':
- 	case '0':
-@@ -619,7 +601,8 @@ yy48:	yyaccept = 0;
- 	case '\\':
- 	case ']':
- 	case '^':
--	case '_':	case 'a':
-+	case '_':
-+	case 'a':
- 	case 'b':
- 	case 'c':
- 	case 'd':
-@@ -649,17 +632,18 @@ yy48:	yyaccept = 0;
- 	}
- yy49:
- #line 399 "bytecode.re"
--{   YYCURSOR = YYTOKEN;
-+	{   YYCURSOR = YYTOKEN;
-                return YAML_DOCSEP;
-            }
--#line 646 "<stdout>"
--yy50:	yych = *++YYCURSOR;
-+#line 637 "<stdout>"
-+yy50:
-+	yych = *++YYCURSOR;
- 	goto yy49;
--yy51:	++YYCURSOR;
--	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
-+yy51:
-+	++YYCURSOR;
-+	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- 	yych = *YYCURSOR;
--	goto yy52;
--yy52:	switch(yych){
-+	switch (yych) {
- 	case '.':
- 	case '/':
- 	case '0':
-@@ -671,7 +655,8 @@ yy52:	switch(yych){
- 	case '6':
- 	case '7':
- 	case '8':
--	case '9':	case ';':
-+	case '9':
-+	case ';':
- 	case '<':
- 	case '=':
- 	case '>':
-@@ -707,7 +692,8 @@ yy52:	switch(yych){
- 	case '\\':
- 	case ']':
- 	case '^':
--	case '_':	case 'a':
-+	case '_':
-+	case 'a':
- 	case 'b':
- 	case 'c':
- 	case 'd':
-@@ -736,8 +722,9 @@ yy52:	switch(yych){
- 	case ':':	goto yy53;
- 	default:	goto yy47;
- 	}
--yy53:	yych = *++YYCURSOR;
--	switch(yych){
-+yy53:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
- 	case '.':
- 	case '/':
- 	case '0':
-@@ -787,7 +774,8 @@ yy53:	yych = *++YYCURSOR;
- 	case '\\':
- 	case ']':
- 	case '^':
--	case '_':	case 'a':
-+	case '_':
-+	case 'a':
- 	case 'b':
- 	case 'c':
- 	case 'd':
-@@ -815,13 +803,13 @@ yy53:	yych = *++YYCURSOR;
- 	case 'z':	goto yy54;
- 	default:	goto yy47;
- 	}
--yy54:	++YYCURSOR;
--	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
-+yy54:
-+	++YYCURSOR;
-+	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- 	yych = *YYCURSOR;
--	goto yy55;
--yy55:	switch(yych){
--	case 0x0A:	goto yy56;
--	case 0x0D:	goto yy58;
-+	switch (yych) {
-+	case '\n':	goto yy56;
-+	case '\r':	goto yy58;
- 	case '.':
- 	case '/':
- 	case '0':
-@@ -871,7 +859,8 @@ yy55:	switch(yych){
- 	case '\\':
- 	case ']':
- 	case '^':
--	case '_':	case 'a':
-+	case '_':
-+	case 'a':
- 	case 'b':
- 	case 'c':
- 	case 'd':
-@@ -899,16 +888,16 @@ yy55:	switch(yych){
- 	case 'z':	goto yy54;
- 	default:	goto yy47;
- 	}
--yy56:	++YYCURSOR;
--	goto yy57;
--yy57:
-+yy56:
-+	++YYCURSOR;
- #line 396 "bytecode.re"
--{   CHK_NL(YYCURSOR);
-+	{   CHK_NL(YYCURSOR);
-                goto Directive; }
--#line 899 "<stdout>"
--yy58:	++YYCURSOR;
--	switch((yych = *YYCURSOR)) {
--	case 0x0A:	goto yy56;
-+#line 895 "<stdout>"
-+yy58:
-+	++YYCURSOR;
-+	switch ((yych = *YYCURSOR)) {
-+	case '\n':	goto yy56;
- 	default:	goto yy47;
- 	}
- }
-@@ -922,40 +911,40 @@ Comment:
-         YYTOKEN = YYCURSOR;
- 
- 
--#line 916 "<stdout>"
-+#line 913 "<stdout>"
- {
- 	YYCTYPE yych;
--	goto yy59;
--	/*@notreached@*/
--	++YYCURSOR;
--yy59:
--	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
-+	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- 	yych = *YYCURSOR;
--	switch(yych){
-+	switch (yych) {
- 	case 0x00:	goto yy61;
--	case 0x0A:	goto yy62;
--	case 0x0D:	goto yy64;
-+	case '\n':	goto yy62;
-+	case '\r':	goto yy64;
- 	default:	goto yy66;
- 	}
--yy61:yy62:	++YYCURSOR;
--	goto yy63;
-+yy61:
-+yy62:
-+	++YYCURSOR;
- yy63:
- #line 412 "bytecode.re"
--{   CHK_NL(YYCURSOR);
-+	{   CHK_NL(YYCURSOR);
-                 goto Document; }
--#line 936 "<stdout>"
--yy64:	++YYCURSOR;
--	switch((yych = *YYCURSOR)) {
--	case 0x0A:	goto yy67;
-+#line 931 "<stdout>"
-+yy64:
-+	++YYCURSOR;
-+	switch ((yych = *YYCURSOR)) {
-+	case '\n':	goto yy67;
- 	default:	goto yy65;
- 	}
- yy65:
- #line 415 "bytecode.re"
--{   goto Comment; }
--#line 945 "<stdout>"
--yy66:	yych = *++YYCURSOR;
-+	{   goto Comment; }
-+#line 941 "<stdout>"
-+yy66:
-+	yych = *++YYCURSOR;
- 	goto yy65;
--yy67:	++YYCURSOR;
-+yy67:
-+	++YYCURSOR;
- 	yych = *YYCURSOR;
- 	goto yy63;
- }
-@@ -977,23 +966,20 @@ Scalar2:
-     tok = YYCURSOR;
- 
- 
--#line 970 "<stdout>"
-+#line 968 "<stdout>"
- {
- 	YYCTYPE yych;
--	goto yy68;
--	/*@notreached@*/
--	++YYCURSOR;
--yy68:
--	if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
-+	if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- 	yych = *YYCURSOR;
--	switch(yych){
-+	switch (yych) {
- 	case 0x00:	goto yy74;
--	case 0x0A:	goto yy70;
--	case 0x0D:	goto yy72;
-+	case '\n':	goto yy70;
-+	case '\r':	goto yy72;
- 	default:	goto yy76;
- 	}
--yy70:	++YYCURSOR;
--	switch((yych = *YYCURSOR)) {
-+yy70:
-+	++YYCURSOR;
-+	switch ((yych = *YYCURSOR)) {
- 	case 'C':	goto yy78;
- 	case 'N':	goto yy80;
- 	case 'Z':	goto yy83;
-@@ -1001,50 +987,51 @@ yy70:	++YYCURSOR;
- 	}
- yy71:
- #line 461 "bytecode.re"
--{   YYCURSOR = tok;
-+	{   YYCURSOR = tok;
-             goto ScalarEnd; 
-         }
--#line 996 "<stdout>"
--yy72:	++YYCURSOR;
--	switch((yych = *YYCURSOR)) {
--	case 0x0A:	goto yy77;
-+#line 992 "<stdout>"
-+yy72:
-+	++YYCURSOR;
-+	switch ((yych = *YYCURSOR)) {
-+	case '\n':	goto yy77;
- 	default:	goto yy73;
- 	}
- yy73:
- #line 469 "bytecode.re"
--{   CAT(str, cap, idx, tok[0]);
-+	{   CAT(str, cap, idx, tok[0]);
-             goto Scalar2; 
-         }
--#line 1007 "<stdout>"
--yy74:	++YYCURSOR;
--	goto yy75;
--yy75:
-+#line 1004 "<stdout>"
-+yy74:
-+	++YYCURSOR;
- #line 465 "bytecode.re"
--{   YYCURSOR = tok;
-+	{   YYCURSOR = tok;
-             goto ScalarEnd;
-         }
--#line 1015 "<stdout>"
--yy76:	yych = *++YYCURSOR;
-+#line 1011 "<stdout>"
-+yy76:
-+	yych = *++YYCURSOR;
- 	goto yy73;
--yy77:	yych = *++YYCURSOR;
--	switch(yych){
-+yy77:
-+	yych = *++YYCURSOR;
-+	switch (yych) {
- 	case 'C':	goto yy78;
- 	case 'N':	goto yy80;
- 	case 'Z':	goto yy83;
- 	default:	goto yy71;
- 	}
--yy78:	++YYCURSOR;
--	goto yy79;
--yy79:
-+yy78:
-+	++YYCURSOR;
- #line 435 "bytecode.re"
--{   CHK_NL(tok+1);
-+	{   CHK_NL(tok+1);
-             goto Scalar2; }
--#line 1031 "<stdout>"
--yy80:	++YYCURSOR;
--	if(YYLIMIT == YYCURSOR) YYFILL(1);
-+#line 1028 "<stdout>"
-+yy80:
-+	++YYCURSOR;
-+	if (YYLIMIT <= YYCURSOR) YYFILL(1);
- 	yych = *YYCURSOR;
--	goto yy81;
--yy81:	switch(yych){
-+	switch (yych) {
- 	case '0':
- 	case '1':
- 	case '2':
-@@ -1059,7 +1046,7 @@ yy81:	switch(yych){
- 	}
- yy82:
- #line 438 "bytecode.re"
--{   CHK_NL(tok+1);
-+	{   CHK_NL(tok+1);
-             if ( tok + 2 < YYCURSOR )
-             {
-                 char *count = tok + 2;
-@@ -1076,16 +1063,15 @@ yy82:
-             }
-             goto Scalar2;
-         }
--#line 1068 "<stdout>"
--yy83:	++YYCURSOR;
--	goto yy84;
--yy84:
-+#line 1065 "<stdout>"
-+yy83:
-+	++YYCURSOR;
- #line 456 "bytecode.re"
--{   CHK_NL(tok+1);
-+	{   CHK_NL(tok+1);
-             CAT(str, cap, idx, '\0');
-             goto Scalar2; 
-         }
--#line 1077 "<stdout>"
-+#line 1073 "<stdout>"
- }
- #line 473 "bytecode.re"
- 
-@@ -1122,50 +1108,48 @@ Inline:
-         tok = YYCURSOR;
- 
- 
--#line 1114 "<stdout>"
-+#line 1110 "<stdout>"
- {
- 	YYCTYPE yych;
--	goto yy85;
--	/*@notreached@*/
--	++YYCURSOR;
--yy85:
--	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
-+	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- 	yych = *YYCURSOR;
--	switch(yych){
-+	switch (yych) {
- 	case 0x00:	goto yy91;
--	case 0x0A:	goto yy87;
--	case 0x0D:	goto yy89;
-+	case '\n':	goto yy87;
-+	case '\r':	goto yy89;
- 	default:	goto yy93;
- 	}
--yy87:	++YYCURSOR;
--	goto yy88;
-+yy87:
-+	++YYCURSOR;
- yy88:
- #line 508 "bytecode.re"
--{   CHK_NL(YYCURSOR);
-+	{   CHK_NL(YYCURSOR);
-                 return str; }
--#line 1134 "<stdout>"
--yy89:	++YYCURSOR;
--	switch((yych = *YYCURSOR)) {
--	case 0x0A:	goto yy94;
-+#line 1127 "<stdout>"
-+yy89:
-+	++YYCURSOR;
-+	switch ((yych = *YYCURSOR)) {
-+	case '\n':	goto yy94;
- 	default:	goto yy90;
- 	}
- yy90:
- #line 515 "bytecode.re"
--{   CAT(str, cap, idx, tok[0]);
-+	{   CAT(str, cap, idx, tok[0]);
-                 goto Inline; 
-             }
--#line 1145 "<stdout>"
--yy91:	++YYCURSOR;
--	goto yy92;
--yy92:
-+#line 1139 "<stdout>"
-+yy91:
-+	++YYCURSOR;
- #line 511 "bytecode.re"
--{   YYCURSOR = tok;
-+	{   YYCURSOR = tok;
-                 return str;
-             }
--#line 1153 "<stdout>"
--yy93:	yych = *++YYCURSOR;
-+#line 1146 "<stdout>"
-+yy93:
-+	yych = *++YYCURSOR;
- 	goto yy90;
--yy94:	++YYCURSOR;
-+yy94:
-+	++YYCURSOR;
- 	yych = *YYCURSOR;
- 	goto yy88;
- }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch
deleted file mode 100644
index 5fb40b6..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-fix a endian incompatible error in generating rpm tag
-
-A flaw was found in the way rpm generating arbitrary tags, which leads to a
-incorrect query result, this issue is introduced by a incompatible endianess
-when the generating process is executed on different architectures.
-
-This patch resolves it by taking the byte order that host uses.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Ming Liu <ming.liu@windriver.com>
----
- tagname.c |   16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
-
-Index: rpm-5.4.14/rpmdb/tagname.c
-===================================================================
---- rpm-5.4.14.orig/rpmdb/tagname.c
-+++ rpm-5.4.14/rpmdb/tagname.c
-@@ -3,6 +3,19 @@
-  */
- 
- #include "system.h"
-+#include <endian.h>
-+
-+/* Don't redefine this macro if it already exists */
-+#ifndef le32toh
-+#ifdef __USE_BSD
-+#include <byteswap.h>
-+#if __BYTE_ORDER == __LITTLE_ENDIAN
-+#define le32toh(x) (x)
-+#else
-+#define le32toh(x) __bswap_32(x)
-+#endif
-+#endif /* __USE_BSD */
-+#endif /* le32toh */
- 
- #include <rpmio_internal.h>	/* XXX DIGEST_CTX, xtolower, xstrcasecmp */
- #include <rpmmacro.h>
-@@ -152,7 +165,10 @@ static rpmTag _tagGenerate(const char *s
-     xx = rpmDigestUpdate(ctx, s, nb);
-     xx = rpmDigestFinal(ctx, &digest, &digestlen, 0);
-     if (digest && digestlen > 4) {
-+	/* The tag is stored in a uniform byte order for cross-endian compatibility.
-+	   Swap to the host uses. */
- 	memcpy(&tag, digest + (digestlen - 4), 4);
-+	tag = le32toh(tag);
- 	tag = (rpmTag) (tag & 0x3fffffff);
- 	tag = (rpmTag) (tag | 0x40000000);
-     }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tagname-type.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tagname-type.patch
deleted file mode 100644
index 9eb675b..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tagname-type.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-rpmdb/tagname.c: Add the 0x54aafb71 (filenames) type to rpmTagGetType
-
-There is already a workaround in the _tagName function to show that the
-special 'filenames' item is value.  This adds a similar patch to the
-_tagType to return the proper type, otherwise it comes back as a simple
-RPM_STRING_ARRAY_TYPE which limits the response to the first element.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm-5.4.15/rpmdb/tagname.c
-===================================================================
---- rpm-5.4.15.orig/rpmdb/tagname.c
-+++ rpm-5.4.15/rpmdb/tagname.c
-@@ -353,6 +353,9 @@ static unsigned int _tagType(rpmTag tag)
-     case RPMDBI_RECNO:
-     case RPMDBI_HEAP:
- 	break;
-+    /* XXX make sure that h.['filenames'] in python "works". */
-+    case 0x54aafb71:
-+	return (RPM_STRING_ARRAY_TYPE + RPM_ARRAY_RETURN_TYPE);
-     default:
- 	if (_rpmTags.byValue == NULL)
- 	    break;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch
deleted file mode 100644
index 72d3509..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Source: None
-Upstream-Status: Submitted [RPM5 maintainer]
-Author: Khem Raj <raj.khem@gmail.com>
-Date: 2011-03-03
-Description:
-This patch fixes build issue found when compiling rpm-native on ubuntu
-11.04-alpha. Problem is that linker does not get correct set of dependent
-libraries when linking mtree binary which results in undefined symbols
-in librpmio.so. This patch adds correct flags to mtree_LDADD to account
-for rpmio deps
-
-Index: rpm-5.4.14/tools/Makefile.am
-===================================================================
---- rpm-5.4.14.orig/tools/Makefile.am
-+++ rpm-5.4.14/tools/Makefile.am
-@@ -186,7 +186,7 @@ grep_LDADD =		$(RPMIO_LDADD_COMMON)
- 
- mtree_SOURCES =		rpmmtree.c
- mtree_LDFLAGS =		@LDFLAGS_STATIC@ $(LDFLAGS)
--mtree_LDADD =		$(RPM_LDADD_COMMON)
-+mtree_LDADD =		$(RPMIO_LDADD_COMMON)
- 
- rpmrepo_SOURCES =	rpmrepo.c
- rpmrepo_CPPFLAGS =	$(AM_CPPFLAGS) -I$(top_srcdir)/scripts -I$(top_builddir)/scripts $(CPPFLAGS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch
deleted file mode 100644
index 713f84e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-A patch to fix a problem when compiling with uuid.
-
-When attempting to build with uuid and all tests compiling will error because
-uuid.h doesn't exist in the rpm tarball. Fix this by changing the include to
-use the one in ossp which solves the issue. 
-
-The recipe already depends on ossp so ossp/uuid.h will be there when rpm-native
-is built.
-
-Upstream-Status: Pending
-
-Signed-off-by: Morgan Little <morgan.little@windriver.com>
-
-
-Index: rpm-5.4.14/lua/local/luuid.c
-===================================================================
---- rpm-5.4.14.orig/lua/local/luuid.c
-+++ rpm-5.4.14/lua/local/luuid.c
-@@ -21,7 +21,7 @@
- 
- #ifdef LUA_USE_UUID
- 
--#include "uuid.h"
-+#include <ossp/uuid.h>
- 
- /*  Lua method: <uuid> = uuid.generate(<version>[, <uuid-namespace>, <data>])  */
- static int luuid_generate(lua_State *L)
-Index: rpm-5.4.14/rpmio/rpmuuid.c
-===================================================================
---- rpm-5.4.14.orig/rpmio/rpmuuid.c
-+++ rpm-5.4.14/rpmio/rpmuuid.c
-@@ -16,7 +16,7 @@
- #include "rpmlog.h"
- #include "rpmuuid.h"
- #ifdef WITH_UUID
--#include "uuid.h"
-+#include <ossp/uuid.h>
- #endif
- #include "debug.h"
- 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm2cpio b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm2cpio
deleted file mode 100755
index 6bcef6a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm2cpio
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-# Prevent gawk >= 4.0.x from getting funny ideas wrt UTF in printf()
-LANG=C
-
-pkg=$1
-if [ "$pkg" = "" -o ! -e "$pkg" ]; then
-    echo "no package supplied" 1>&2
-   exit 1
-fi
-
-leadsize=96
-o=`expr $leadsize + 8`
-set `od -j $o -N 8 -t u1 $pkg`
-il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
-dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
-# echo "sig il: $il dl: $dl"
-
-sigsize=`expr 8 + 16 \* $il + $dl`
-o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`
-set `od -j $o -N 8 -t u1 $pkg`
-il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
-dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
-# echo "hdr il: $il dl: $dl"
-
-hdrsize=`expr 8 + 16 \* $il + $dl`
-o=`expr $o + $hdrsize`
-comp=`dd if=$pkg ibs=$o skip=1 count=1 2>/dev/null | dd bs=3 count=1 2> /dev/null`
-
-gz="`echo . | awk '{ printf("%c%c", 0x1f, 0x8b); }'`"
-lzma="`echo . | awk '{ printf("%cLZ", 0xff); }'`"
-xz="`echo . | awk '{ printf("%c7z", 0xfd); }'`"
-case "$comp" in
-    BZh)      dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 ;;
-    "$gz"*)   dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip ;;
-    "$xz"*)   dd if="$pkg" ibs=$o skip=1 2>/dev/null | xzcat ;;
-    "$lzma"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | unlzma ;;
-    *)        echo "Unrecognized rpm file: $pkg"; exit 1 ;;
-esac
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmatch.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmatch.patch
deleted file mode 100644
index 9bbf580..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmatch.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Create a compatable macro if rpmatch() is not provided by the C library.
-
-This uses an existing configure check.
-
-This is needed for uclibc since it does not have the above function
-implemented.
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Updated to rpm 5.4.15+.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-Index: rpm/system.h
-===================================================================
---- rpm.orig/system.h
-+++ rpm/system.h
-@@ -358,6 +358,14 @@ extern int _tolower(int) __THROW	/*@*/;
- #include <libgen.h>
- #endif
- 
-+#ifndef HAVE_RPMATCH
-+#define rpmatch(line) \
-+	( (line == NULL)? -1 : \
-+	  (*line == 'y' || *line == 'Y')? 1 : \
-+	  (*line == 'n' || *line == 'N')? 0 : \
-+	  -1 )
-+#endif
-+
- /* -- Retrofit glibc __progname */
- #if defined __GLIBC__ && __GLIBC__ >= 2
- #if __GLIBC_MINOR__ >= 1
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch
deleted file mode 100644
index 3a6f874..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-rpmdb: more verbose error logging in rpmTempFile()
-
-Upstream-Status: Inappropriate [debugging]
-
-Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-
-diff --git a/rpmdb/signature.c b/rpmdb/signature.c
-index 100204b..e56ab3d 100644
---- a/rpmdb/signature.c
-+++ b/rpmdb/signature.c
-@@ -72,12 +72,16 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr)
- #endif
- 
- 	temput = urlPath(tempfn, &tfn);
--	if (*tfn == '\0') goto errxit;
-+	if (*tfn == '\0') {
-+            rpmlog(RPMLOG_ERR, _("error creating tempfile: empty filename\n"));
-+            goto errxit;
-+        }
- 
- 	switch (temput) {
- 	case URL_IS_DASH:
- 	case URL_IS_HKP:
- 	case URL_IS_MONGO:	/* XXX FIXME */
-+            rpmlog(RPMLOG_ERR, _("error creating temporary file, invalid uri type: %d\n"), temput);
- 	    goto errxit;
- 	    /*@notreached@*/ /*@switchbreak@*/ break;
- 	case URL_IS_HTTPS:
--- 
-2.6.6
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-prevent-race-in-tmpdir-creation.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-prevent-race-in-tmpdir-creation.patch
deleted file mode 100644
index f483f3a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-prevent-race-in-tmpdir-creation.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-rpmdb: prevent race in tmpdir creation
-
-If two (or more) instances of rpm are running at the same time they may
-be trying to create the same (base-)temporary directory at the same time
-which causes the other mkdir to fail with EEXIST. This patch prevents a
-failure caused by this race by ignoring EEXIST error on directory
-creation.
-
-Upstream-Status: Pending
-
-Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-
-diff --git a/rpmdb/signature.c b/rpmdb/signature.c
-index dce6c4e..100204b 100644
---- a/rpmdb/signature.c
-+++ b/rpmdb/signature.c
-@@ -37,6 +37,7 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr)
-     int temput;
-     FD_t fd = NULL;
-     unsigned int ran;
-+    int ret = 0;
- 
-     if (!prefix) prefix = "";
- 
-@@ -44,8 +45,11 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr)
-     if (!_initialized) {
- 	_initialized = 1;
- 	tempfn = rpmGenPath(prefix, tpmacro, NULL);
--	if (rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1))
--	    goto errxit;
-+        ret = rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1);
-+        if (ret && ret != EEXIST) {
-+            rpmlog(RPMLOG_ERR, _("error creating temporary directory %s: %d\n"), tempfn, ret);
-+            goto errxit;
-+        }
-     }
- 
-     /* XXX should probably use mkstemp here */
--- 
-2.6.6
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch
deleted file mode 100644
index 9bdd1d4..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-Add an "rpmdeps-oecore" binary which allows batch processing of individual file
-dependencies in a similar manner to rpmdeps --provides --requires -v, prefixing
-each line of output with the filename that has the dependency.
-
-This is much faster than individually calling rpmdeps on each file.
-
-This binary is used by package.bbclass.
-
-Upstream-Status: Inappropriate [OE Specific]
-
-RP 2012/2/7
-
----
- tools/Makefile.am      |    6 ++-
- tools/rpmdeps-oecore.c |  147 ++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 152 insertions(+), 1 deletions(-)
- create mode 100644 tools/rpmdeps-oecore.c
-
-Index: rpm-5.4.14/tools/Makefile.am
-===================================================================
---- rpm-5.4.14.orig/tools/Makefile.am
-+++ rpm-5.4.14/tools/Makefile.am
-@@ -62,7 +62,7 @@ pkgbin_PROGRAMS =	\
- 	@WITH_AUGEAS_AUGTOOL@ chroot cp @WITH_CUDF_CUDFTOOL@ find mtree \
- 	@WITH_SEMANAGE_SEMODULE@ wget \
- 	rpmcache rpmdigest rpmrepo rpmspecdump \
--	rpmcmp rpmdeps sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
-+	rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
- if WITH_DB
- pkgbin_PROGRAMS +=	dbconvert
- endif
-@@ -172,6 +172,10 @@ rpmdeps_SOURCES =	rpmdeps.c
- rpmdeps_LDFLAGS =	@LDFLAGS_STATIC@ $(LDFLAGS)
- rpmdeps_LDADD =		$(RPM_LDADD_COMMON)
- 
-+rpmdeps_oecore_SOURCES =  rpmdeps-oecore.c
-+rpmdeps_oecore_LDFLAGS =  @LDFLAGS_STATIC@ $(LDFLAGS)
-+rpmdeps_oecore_LDADD =    $(RPM_LDADD_COMMON)
-+
- rpmdigest_SOURCES =	rpmdigest.c
- rpmdigest_LDFLAGS =	@LDFLAGS_STATIC@ $(LDFLAGS)
- rpmdigest_LDADD =	$(RPMIO_LDADD_COMMON)
-Index: rpm-5.4.14/tools/rpmdeps-oecore.c
-===================================================================
---- /dev/null
-+++ rpm-5.4.14/tools/rpmdeps-oecore.c
-@@ -0,0 +1,147 @@
-+#include "system.h"
-+const char *__progname;
-+
-+#include <rpmio.h>
-+#include <rpmiotypes.h>
-+#include <rpmcb.h>
-+#include <argv.h>
-+#include <rpmtypes.h>
-+#include <rpmtag.h>
-+
-+#include <rpmds.h>
-+#define   _RPMFC_INTERNAL     /* XXX for debugging */
-+#include <rpmfc.h>
-+
-+#include <rpmcli.h>
-+
-+#include "debug.h"
-+
-+/*@unchecked@*/
-+char *progname;
-+
-+#define   RPMDEP_RPMFC        1
-+
-+static int rpmdepPrint(char *filename, rpmds ds, FILE * fp)
-+{
-+    if (fp == NULL) fp = stderr;
-+
-+    ds = rpmdsInit(ds);
-+    while (rpmdsNext(ds) >= 0) {
-+  fprintf(fp, "%s %s: %s\n", filename, rpmdsType(ds), rpmdsDNEVR(ds)+2);
-+    }
-+    return 0;
-+}
-+
-+static struct poptOption optionsTable[] = {
-+
-+ { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
-+  N_("Common options:"),
-+  NULL }, 
-+
-+   POPT_AUTOALIAS
-+   POPT_AUTOHELP
-+   POPT_TABLEEND
-+};
-+
-+
-+int
-+main(int argc, char *argv[])
-+{
-+    poptContext optCon;
-+    ARGV_t av = NULL;
-+    rpmfc fc = NULL;
-+    FILE * fp = NULL;
-+    int flags = 0;
-+    int ac = 0;
-+    int ec = 1;
-+    int xx;
-+    int i;
-+    char buf[BUFSIZ];
-+    int nddict;
-+    const char * s;
-+    char * se;
-+    const char * fn;
-+    const char * N;
-+    const char * EVR;
-+    evrFlags Flags;
-+    unsigned char deptype;
-+    int ix;
-+    rpmds ds;
-+
-+/*@-modobserver@*/
-+    if ((progname = strrchr(argv[0], '/')) != NULL)
-+  progname++;
-+    else
-+  progname = argv[0];
-+/*@=modobserver@*/
-+
-+    optCon = rpmcliInit(argc, argv, optionsTable);
-+    if (optCon == NULL)
-+  goto exit;
-+
-+    av = poptGetArgs(optCon);
-+    ac = argvCount(av);
-+
-+    if (ac == 0) {
-+  av = NULL;
-+  xx = argvFgets(&av, NULL);
-+  ac = argvCount(av);
-+    }
-+
-+    /* Make sure file names are sorted. */
-+    xx = argvSort(av, NULL);
-+
-+    /* Build file class dictionary. */
-+    fc = rpmfcNew();
-+    xx = rpmfcClassify(fc, av, NULL);
-+
-+    /* Build file/package dependency dictionary. */
-+    xx = rpmfcApply(fc);
-+
-+    /* Generate per-file indices into package dependencies. */
-+    nddict = argvCount(fc->ddict);
-+
-+    for (i = 0; i < nddict; i++) {
-+  s = fc->ddict[i];
-+
-+  /* Parse out (file#,deptype,N,EVR,Flags) */
-+  ix = strtol(s, &se, 10);
-+  assert(se != NULL);
-+  deptype = *se++;
-+  se++;
-+  N = se;
-+  while (*se && *se != ' ')
-+      se++;
-+  *se++ = '\0';
-+  EVR = se;
-+  while (*se && *se != ' ')
-+      se++;
-+  *se++ = '\0';
-+  Flags = strtol(se, NULL, 16);
-+
-+  switch (deptype) {
-+  default:
-+      /*@switchbreak@*/ break;
-+  case 'P':   
-+      ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags);
-+      rpmdepPrint((char *)fc->fn[ix], ds, stdout);
-+      (void)rpmdsFree(ds);
-+      ds = NULL;
-+      /*@switchbreak@*/ break;
-+  case 'R':
-+      ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags);
-+      rpmdepPrint((char *)fc->fn[ix], ds, stdout);
-+      (void)rpmdsFree(ds);
-+      ds = NULL;
-+      /*@switchbreak@*/ break;
-+  }
-+    }
-+
-+    fc = rpmfcFree(fc);
-+
-+    ec = 0;
-+
-+exit:
-+    optCon = rpmcliFini(optCon);
-+    return ec;
-+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch
deleted file mode 100644
index c68681c..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From bb48dbc88a58bc05a43d71a3375fb05358119ec5 Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Sun, 20 Mar 2016 20:20:16 -0700
-Subject: [PATCH] rpmqv.c: check _gpg_passphrase before ask for input
-
-rpm always asked for pass phrasae when add signature, which made it
-can't work non-interactively, this patch fix the problem. It will work
-non-interactively if _gpg_passphrase is defined, and work as before if
-not.
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- macros/macros.in |    7 +++++--
- rpmqv.c          |   17 ++++++++++-------
- 2 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/macros/macros.in b/macros/macros.in
-index 2e5b07d..01b3aad 100644
---- a/macros/macros.in
-+++ b/macros/macros.in
-@@ -520,15 +520,18 @@ $_arbitrary_tags_tests	Foo:Bar
- #	Macro(s) to hold the arguments passed to GPG/PGP for package
- #	signing and verification.
- #
-+
-+%_gpg_passphrase_way %{?_gpg_passphrase:--passphrase "%{_gpg_passphrase}"}%{!?_gpg_passphrase:--passphrase-fd 3}
-+
- %__gpg_check_password_cmd	%{__gpg} \
--	gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
-+	gpg --batch --no-verbose %{_gpg_passphrase_way} -u "%{_gpg_name}" -so -
- #%__pgp_check_password_cmd	%{__pgp} \
- #	pgp +batchmode=on +verbose=0 "%{_pgp_name}" -sf
- #%__pgp5_check_password_cmd	%{__pgp} \
- #	pgps +batchmode=on +verbose=0 +armor=off "%{_pgp_name}" -f
- 
- %__gpg_sign_cmd			%{__gpg} \
--	gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \
-+	gpg --batch --no-verbose --no-armor %{_gpg_passphrase_way}  --no-secmem-warning \
- 	-u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
- #%__pgp_sign_cmd			%{__pgp} \
- #	pgp +batchmode=on +verbose=0 +armor=off \
-diff --git a/rpmqv.c b/rpmqv.c
-index b306486..7604396 100644
---- a/rpmqv.c
-+++ b/rpmqv.c
-@@ -831,13 +831,16 @@ int main(int argc, const char ** argv)
- #endif
- 	    )
- 	    {
--		passPhrase = Getpass(_("Enter pass phrase: "));
--		if (rpmCheckPassPhrase(passPhrase)) {
--		    fprintf(stderr, _("Pass phrase check failed\n"));
--		    ec = EXIT_FAILURE;
--		    goto exit;
-+		passPhrase = rpmExpand("%{?_gpg_passphrase}", NULL);
-+		if (passPhrase == NULL || passPhrase[0] == '\0') {
-+			passPhrase = Getpass(_("Enter pass phrase: "));
-+			if (rpmCheckPassPhrase(passPhrase)) {
-+			    fprintf(stderr, _("Pass phrase check failed\n"));
-+			    ec = EXIT_FAILURE;
-+			    goto exit;
-+			}
-+			fprintf(stderr, _("Pass phrase is good.\n"));
- 		}
--		fprintf(stderr, _("Pass phrase is good.\n"));
- 		/* XXX Getpass() should realloc instead. */
- 		passPhrase = xstrdup(passPhrase);
- 	    }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch
deleted file mode 100644
index b2437a8..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From e8bae261615e19ff8a28683765c9539cfb22a086 Mon Sep 17 00:00:00 2001
-From: Joe Slater <jslater@windriver.com>
-Date: Thu, 17 Jul 2014 18:14:54 -0700
-Subject: [PATCH 1/9] rpm: compile rpmqv.c instead of rpmqv.cc
-
-Some versions of gcc, 4.4.5 for example, will put a reference to __gxx_personality_v0
-into rpm.o and rpmbuild.o.  This means we must link with g++, and the Makefile we
-generate does not.
-
-So, go back to using rpmqv.c (which is currently identical to rpmqv.cc).
-
-Upstream-Status: Inappropriate [other]
-
-   When linking with g++ is really necessary, the upstream package will do that.
-
-Also instead of symlinking files in two places, which can and does race in
-parallel builds, simply refer to the file's full location [RB]
-
-Signed-off-by: Joe Slater <joe.slater@windriver.com>
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
----
- Makefile.am | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 1dade0a..55f8669 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -201,15 +201,13 @@ rpm_SOURCES =		build.c
- rpm_LDFLAGS =		@LDFLAGS_STATIC@ $(LDFLAGS)
- rpm_LDADD =		rpm.o $(myLDADD)
- rpm.o:	$(top_srcdir)/rpmqv.c
--	ln -sf $< rpmqv.cc
--	$(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c rpmqv.cc
-+	$(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $^
- 
- rpmbuild_SOURCES =	build.c
- rpmbuild_LDFLAGS =	@LDFLAGS_STATIC@ $(LDFLAGS)
- rpmbuild_LDADD =	rpmbuild.o $(myLDADD)
- rpmbuild.o:	$(top_srcdir)/rpmqv.c
--	ln -sf $< rpmqv.cc
--	$(COMPILE) -DIAM_RPMBT -o $@ -c rpmqv.cc
-+	$(COMPILE) -DIAM_RPMBT -o $@ -c $^
- 
- .syntastic_c_config: Makefile
- 	@echo $(COMPILE) | tr ' ' '\n' | sed -e '1d' > $@
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/uclibc-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/uclibc-support.patch
deleted file mode 100644
index dc7b048..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/uclibc-support.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-Define the x* wrappers for uclibc as well
-
-Upstream-Status: Submitted [RPM5 maintainer]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Index: rpm/rpmio/rpmio.h
-===================================================================
---- rpm.orig/rpmio/rpmio.h
-+++ rpm/rpmio/rpmio.h
-@@ -23,7 +23,8 @@
-  */
- /*@{*/
- #if !defined(__LCLINT__) && !defined(__UCLIBC__) && defined(__GLIBC__) && \
--	(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
-+	(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && \
-+	!defined(__UCLIBC__)
- #define USE_COOKIE_SEEK_POINTER 1
- typedef _IO_off64_t 	_libio_off_t;
- typedef _libio_off_t *	_libio_pos_t;
-Index: rpm/system.h
-===================================================================
---- rpm.orig/system.h
-+++ rpm/system.h
-@@ -489,7 +489,7 @@ extern void muntrace (void)
- #endif /* defined(__LCLINT__) */
- 
- /* Memory allocation via macro defs to get meaningful locations from mtrace() */
--#if defined(__GNUC__)
-+#if defined(__GNUC__) || defined(__UCLIBC__)
- #define	xmalloc(_size) 		(malloc(_size) ? : vmefail(_size))
- #define	xcalloc(_nmemb, _size)	(calloc((_nmemb), (_size)) ? : vmefail(_size))
- #define	xrealloc(_ptr, _size)	(realloc((_ptr), (_size)) ? : vmefail(_size))
-Index: rpm/lib/librpm.vers
-===================================================================
---- rpm.orig/lib/librpm.vers
-+++ rpm/lib/librpm.vers
-@@ -406,6 +406,10 @@ LIBRPM_0
-     specedit;
-     strict_erasures;
-     XrpmtsiInit;
-+    xmalloc;
-+    xrealloc;
-+    xcalloc;
-+    xstrdup;
-   local:
-     *;
- };
-Index: rpm/rpmio/librpmio.vers
-===================================================================
---- rpm.orig/rpmio/librpmio.vers
-+++ rpm/rpmio/librpmio.vers
-@@ -1455,6 +1455,10 @@ LIBRPMIO_0
-     _mongoc_write_result_init;
-     _mongoc_write_result_merge;
-     _mongoc_write_result_merge_legacy;
-+    xmalloc;
-+    xrealloc;
-+    xcalloc;
-+    xstrdup;
-   local:
-     *;
- };
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb
deleted file mode 100644
index 497af8e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb
+++ /dev/null
@@ -1,709 +0,0 @@
-SUMMARY = "The RPM package management system"
-DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
-package management system capable of installing, uninstalling, \
-verifying, querying, and updating software packages. Each software \
-package consists of an archive of files along with information about \
-the package like its version, a description, etc."
-
-SUMMARY_${PN}-libs = "Libraries for manipulating RPM packages"
-DESCRIPTION_${PN}-libs = "This package contains the RPM shared libraries."
-
-SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
-DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
-development files will simplify the process of writing programs that \
-manipulate RPM packages and databases. These files are intended to \
-simplify the process of creating graphical package managers or any \
-other tools that need an intimate knowledge of RPM packages in order \
-to function."
-
-SUMMARY_${PN}-common = "Common RPM paths, scripts, documentation and configuration"
-DESCRIPTION_${PN}-common = "The rpm-common package contains paths, scripts, documentation \
-and configuration common between RPM Package Manager."
-
-SUMMARY_${PN}-build = "Scripts and executable programs used to build packages"
-DESCRIPTION_${PN}-build = "The rpm-build packagec ontains the scripts and executable programs \
-that are used to build packages using the RPM Package Manager."
-
-SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages"
-DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \
-written in the Python programming language to use the interface \
-supplied by the RPM Package Manager libraries."
-
-SUMMARY_perl-module-rpm = "Perl bindings for apps which will manipulate RPM packages"
-DESCRIPTION_perl-modules-rpm = "The perl-modules-rpm package contains a module that permits applications \
-written in the Perl programming language to use the interface \
-supplied by the RPM Package Manager libraries."
-
-HOMEPAGE = "http://rpm5.org/"
-LICENSE = "LGPLv2.1 & Apache-2.0"
-LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
-LIC_FILES_CHKSUM += "file://rpmio/mongo.c;begin=5;end=18;md5=d8327ba2c71664c059143e6d333b8901"
-
-# We must have gettext-native, we need gettextize, which may not be provided
-DEPENDS = "libpcre attr acl ossp-uuid file byacc-native gettext-native"
-DEPENDS_append_class-native = " file-replacement-native"
-
-# rpm2cpio is a shell script, which is part of the rpm src.rpm.  It is needed
-# in order to extract the distribution SRPM into a format we can extract...
-
-# There is no official 5.4.16 release yet, so start w/ 5.4.15 and patch it
-# based on CVS
-S = "${WORKDIR}/rpm-5.4.15"
-
-SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.15-0.20140824.src.rpm;name=srpm;extract=rpm-5.4.15.tar.gz \
-	   http://downloads.yoctoproject.org/releases/rpm5/rpm-5.4.15-to-5.4.16-20160225.patch.gz;name=rpm-patch \
-	   http://downloads.yoctoproject.org/releases/rpm5/syck-5.4.15-to-5.4.16-20160225.patch.gz;name=syck-patch \
-	   http://downloads.yoctoproject.org/releases/rpm5/beecrypt-5.4.15-to-5.4.16-20160225.patch.gz;name=beecrypt-patch \
-	   http://downloads.yoctoproject.org/releases/rpm5/lua-5.4.15-to-5.4.16-20160225.patch.gz;name=lua-patch \
-	   file://perfile_rpmdeps.sh \
-	   file://pythondeps.sh \
-"
-
-SRC_URI[srpm.md5sum] = "d53782842ac11b3100a43fb2958c9bc0"
-SRC_URI[srpm.sha256sum] = "d4ae5e9ed5df8ab9931b660f491418d20ab5c4d72eb17ed9055b80b71ef6c4ee"
-
-SRC_URI[rpm-patch.md5sum] = "8b7deb1c9574d3d47ed8ba8c690fd8bf"
-SRC_URI[rpm-patch.sha256sum] = "1c1983d001b04eaa23eb2c8d9598b9d0899acb0a89f54a2d4c4e974086fd17a5"
-
-SRC_URI[syck-patch.md5sum] = "f31d7a32105a364688354419ec3559e4"
-SRC_URI[syck-patch.sha256sum] = "4dd1d04489206d8b5d1970f2a8d143a002f2895cefbe15d73459785096545e8a"
-
-SRC_URI[beecrypt-patch.md5sum] = "9e71ee3ccb0a52985a071dd250279132"
-SRC_URI[beecrypt-patch.sha256sum] ="df7c0708a7fab9bdf6d46194519b42e736f99cb0599dcc1c3c1bf1b228705cde"
-
-SRC_URI[lua-patch.md5sum] = "ca10d03d83b1fc1c31a0b50819534cd7"
-SRC_URI[lua-patch.sha256sum] = "6bde435cc827a7d4b2520e8f3e1c9bd2ca74375de0a4402aa99ef4d48eab9a7e"
-
-# Bug fixes
-SRC_URI += " \
-	   file://header-include-fix.patch \
-	   file://rpm-libsql-fix.patch \
-	   file://rpm-platform.patch \
-	   file://rpm-platform2.patch \
-	   file://rpm-tools-mtree-LDFLAGS.patch \
-	   file://rpm-canonarch.patch \
-	   file://rpm-no-loopmsg.patch \
-	   file://rpm-resolvedep.patch \
-	   file://rpm-packageorigin.patch \
-	   file://uclibc-support.patch \
-	   file://rpmatch.patch \
-	   file://makefile-am-exec-hook.patch \
-	   file://python-rpm-rpmsense.patch \
-	   file://debugedit-segv.patch \
-	   file://debugedit-valid-file-to-fix-segment-fault.patch \
-	   file://rpm-platform-file-fix.patch \
-	   file://rpm-lsb-compatibility.patch \
-	   file://rpm-tag-generate-endian-conversion-fix.patch \
-	   file://rpm-hardlink-segfault-fix.patch \
-	   file://rpm-payload-use-hashed-inode.patch \
-	   file://rpm-fix-logio-cp.patch \
-	   file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \
-	   file://rpm-opendb-before-verifyscript-to-avoid-null-point.patch \
-	   file://0001-define-EM_AARCH64.patch \
-	   file://rpm-rpmfc.c-fix-for-N32-MIPS64.patch \
-	   file://rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch \
-	   file://rpm-mongodb-sasl.patch \
-	   file://rpm-fix-parseEmbedded.patch \
-	   file://rpm-rpmio-headers.patch \
-	   file://rpm-python-restore-origin.patch \
-	   file://rpm-keccak-sse-intrin.patch \
-	   file://rpm-atomic-ops.patch \
-	   file://rpm-gnu-atomic.patch \
-	   file://rpm-tagname-type.patch \
-	   file://rpm-python-tagname.patch \
-	   file://rpm-python-AddErase.patch \
-	   file://rpm-rpmpgp-popt.patch \
-	   file://rpm-fix-lua-tests-compilation-failure.patch \
-	   file://rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch \
-	   file://0001-Disable-__sync_add_and_fetch_8-on-nios2.patch \
-	   file://gcc6-stdlib.patch \
-	   file://0001-system.h-query.c-support-nosignature.patch \
-	   file://rpm-ensure-rpm2cpio-call-rpm-relocation-code.patch \
-	   file://0001-macros-add-_gpg_sign_cmd_extra_args.patch \
-"
-
-# OE specific changes
-SRC_URI += " \
-	   file://rpm-log-auto-rm.patch \
-	   file://rpm-db-reduce.patch \
-	   file://rpm-autogen.patch \
-	   file://rpm-showrc.patch \
-	   file://rpm-fileclass.patch \
-	   file://rpm-scriptletexechelper.patch \
-	   file://rpmdeps-oecore.patch \
-	   file://rpm-no-perl-urpm.patch \
-	   file://rpm-macros.patch \
-	   file://rpm-lua.patch \
-	   file://rpm-ossp-uuid.patch \
-	   file://rpm-uuid-include.patch \
-	   file://rpm-pkgconfigdeps.patch \
-	   file://no-ldflags-in-pkgconfig.patch \
-	   file://dbconvert.patch \
-	   file://rpm-db_buffer_small.patch \
-	   file://rpm-py-init.patch \
-	   file://rpm-reloc-macros.patch \
-	   file://rpm-db5-or-db6.patch \
-	   file://rpm-db60.patch \
-	   file://rpmqv_cc_b_gone.patch \
-	   file://rpm-realpath.patch \
-	   file://rpm-check-rootpath-reasonableness.patch \
-	   file://rpm-macros.in-disable-external-key-server.patch \
-	   file://configure.ac-check-for-both-gpg2-and-gpg.patch \
-	   file://rpm-disable-auto-stack-protector.patch \
-	   file://popt-disable-auto-stack-protector.patch \
-	   file://rpm-syck-fix-gram.patch \
-	   file://rpm-rpmdb-grammar.patch \
-	   file://rpm-disable-blaketest.patch \
-	   file://rpm-autogen-force.patch \
-	   file://rpmdb-prevent-race-in-tmpdir-creation.patch \
-	   file://rpmdb-more-verbose-error-logging-in-rpmTempFile.patch \
-"
-
-SRC_URI_append_libc-musl = "\
-           file://0001-rpm-Fix-build-on-musl.patch \
-"
-# Uncomment the following line to enable platform score debugging
-# This is useful when identifying issues with Smart being unable
-# to process certain package feeds.
-#SRC_URI += "file://rpm-debug-platform.patch"
-
-UPSTREAM_CHECK_REGEX = "rpm-(?P<pver>(\d+[\.\-_]*)+)-.*$"
-
-inherit autotools gettext python-dir
-
-acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java"
-
-# The local distribution macro directory
-distromacrodir = "${libdir}/rpm/poky"
-
-# Specify the default rpm macros in terms of adjustable variables
-rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros"
-rpm_macros_class-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
-rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
-
-# sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux
-
-# Set the digest algorithm used for verifying file integrity
-# If this value changes, and two different packages have different values
-# the "same file" validation (two packages have a non-conflict file)
-# will fail.  This may lead to upgrade problems.  You should treat this
-# value as a distribution wide setting, and only change it when you intend
-# a full system upgrade!
-#
-# Defined file digest algorithm values (note: not all are available!):
-#       1       MD5 (legacy RPM default)
-#       2       SHA1
-#       3       RIPEMD-160
-#       5       MD2
-#       6       TIGER-192
-#       8       SHA256
-#       9       SHA384
-#       10      SHA512
-#       11      SHA224
-#       104     MD4
-#       105     RIPEMD-128
-#       106     CRC-32
-#       107     ADLER-32
-#       108     CRC-64 (ECMA-182 polynomial, untested uint64_t problems)
-#       109     Jenkins lookup3.c hashlittle()
-#       111     RIPEMD-256
-#       112     RIPEMD-320
-#       188     BLAKE2B
-#       189     BLAKE2BP
-#       190     BLAKE2S
-#       191     BLAKE2SP
-RPM_FILE_DIGEST_ALGO ?= "1"
-
-# All packages build with RPM5 contain a non-repudiable signature.
-# The purpose of this signature is not to show authenticity of a package,
-# but instead act as a secondary package wide validation that shows it
-# wasn't damaged by accident in transport.  (When later you sign the package, 
-# this signature may or may not be replaced as there are three signature 
-# slots, one for DSA/RSA, one for ECSDA, and one reserved.)
-#
-# There is a known issue w/ RSA signatures that if they start with an 0x00
-# the signing and validation may fail.
-#
-# The following is the list of choices for the non-rpudiable signature
-# (note: not all of these are implemented):
-#       DSA             (default)
-#       RSA             (implies SHA1)
-#       ECDSA           (implies SHA256)
-#       DSA/SHA1
-#       DSA/SHA224
-#       DSA/SHA256
-#       DSA/SHA384
-#       DSA/SHA512
-#       RSA/SHA1
-#       RSA/SHA224
-#       RSA/SHA256
-#       RSA/SHA384
-#       RSA/SHA512
-#       ECDSA/SHA224    (using NIST P-224)
-#       ECDSA/SHA256    (using NIST P-256)
-#       ECDSA/SHA384    (using NIST P-384)
-#       ECDSA/SHA512    (using NIST P-521)
-RPM_SELF_SIGN_ALGO ?= "DSA"
-
-# Note: perl and sqlite w/o db specified does not currently work.
-#       tcl, augeas, nss, gcrypt, xar and keyutils support is untested.
-PACKAGECONFIG ??= "db bzip2 zlib popt openssl libelf python"
-
-# Note: switching to internal popt may not work, as it will generate
-# a shared library which will intentionally not be packaged.
-#
-# If you intend to use the internal version, additional work may be required.
-PACKAGECONFIG[popt] = "--with-popt=external,--with-popt=internal,popt,"
-
-PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2,"
-PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz,"
-PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
-PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar,"
-
-WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \
-		--with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
-		--with-python-lib-dir=${PYTHON_SITEPACKAGES_DIR} \
-		--without-pythonembed"
-PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python,"
-
-# Perl modules are not built, but they could be enabled fairly easily
-# the perl module creation and installation would need to be patched.
-# (currently has host perl contamination issues)
-WITH_PERL = "--with-perl --without-perlembed --without-perl-urpm"
-WITHOUT_PERL = "--without-perl --without-perl-urpm"
-PACKAGECONFIG[perl] = "${WITH_PERL},${WITHOUT_PERL},perl,"
-
-# The --with-dbsql will only tell RPM to check for support, db
-# may or may not be built w/ the dbsql support.
-WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated"
-PACKAGECONFIG[db] = "${WITH_DB},--without-db,db,"
-
-PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3,"
-
-# This switch simply disables external beecrypt, RPM5 always uses beecrypt
-# for base64 processing and various digest algorithms.
-# Beecrypt is only the preferred crypto engine if it's the only engine enabled.
-PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--with-beecrypt=internal,beecrypt,"
-
-# --with-usecrypto= setting defined the item as the preferred system
-# crypto engine, which will take priority over the included beecrypt
-PACKAGECONFIG[openssl] = "--with-openssl --with-usecrypto=openssl,--without-openssl,openssl,"
-PACKAGECONFIG[nss] = "--with-nss --with-usecrypto=nss,--without-nss,nss,"
-PACKAGECONFIG[gcrypt] = "--with-gcrypt --with-usecrypto=gcrypt,--without-gcrypt,gcrypt,"
-
-PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils,"
-PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils,"
-
-WITH_SELINUX = "--with-selinux --with-sepol --with-semanage"
-WITHOUT_SELINUX = "--without-selinux --without-sepol --without-semanage"
-PACKAGECONFIG[selinux] = "${WITH_SELINUX},${WITHOUT_SELINUX},libselinux,"
-
-WITH_NEON = "--with-neon --with-libproxy --with-expat --without-gssapi"
-WITHOUT_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi"
-PACKAGECONFIG[neon] = "${WITH_NEON},${WITHOUT_NEON},neon expat,"
-
-PACKAGECONFIG[lua] = "--with-lua,--without-lua,expat,"
-PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl,"
-
-PACKAGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas,"
-
-EXTRA_OECONF += "--verbose \
-		--sysconfdir=${sysconfdir} \
-		--with-file \
-		--with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \
-		--with-syck=internal \
-		--without-readline \
-		--without-libtasn1 \
-		--without-pakchois \
-		--without-gnutls \
-		--with-pcre \
-		--enable-utf8 \
-		--with-uuid \
-		--with-attr \
-		--with-acl \
-		--with-pthreads \
-		--without-cudf \
-		--without-ficl \
-		--without-aterm \
-		--without-nix \
-		--without-bash \
-		--without-rc \
-		--without-js \
-		--without-gpsee \
-		--without-ruby \
-		--without-squirrel \
-		--without-sasl2 \
-		--without-tomcrypt \
-		--with-build-extlibdep \
-		--with-build-maxextlibdep \
-		--without-valgrind \
-		--disable-openmp \
-		--enable-build-pic \
-		--enable-build-versionscript \
-		--enable-build-warnings \
-		--enable-build-debug \
-		--enable-maintainer-mode \
-		--with-path-macros=${rpm_macros} \
-		--with-path-lib=${libdir}/rpm \
-		--with-bugreport=http://bugzilla.yoctoproject.org \
-		--program-prefix= \
-		YACC=byacc"
-
-CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE -D_GLIBCXX_INCLUDE_NEXT_C_HEADERS"
-
-LDFLAGS_append_libc-uclibc = "-lrt -lpthread"
-
-PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm perl-module-rpm ${PN}-locale"
-
-SOLIBS = "5.4.so"
-
-# Based on %files section in the rpm.spec
-
-FILES_${PN} =  "${bindir}/rpm \
-		${bindir}/rpmconstant \
-		${libdir}/rpm/rpm.* \
-		${libdir}/rpm/tgpg \
-		${libdir}/rpm/macros \
-		${libdir}/rpm/rpmpopt \
-		${libdir}/rpm/rpm2cpio \
-		${libdir}/rpm/vcheck \
-		${libdir}/rpm/helpers \
-		${libdir}/rpm/qf \
-		${libdir}/rpm/cpuinfo.yaml \
-		${libdir}/rpm/bin/mtree \
-		${libdir}/rpm/bin/rpmkey \
-		${libdir}/rpm/bin/rpmrepo \
-		${libdir}/rpm/bin/rpmrepo.real \
-		${libdir}/rpm/bin/rpmspecdump \
-		${libdir}/rpm/bin/rpmspecdump.real \
-		${libdir}/rpm/bin/wget \
-		${localstatedir}/cache \
-		${localstatedir}/cache/rpm \
-		${localstatedir}/cache/wdj \
-		${localstatedir}/lib \
-		${localstatedir}/lib/rpm \
-		${localstatedir}/lib/wdj \
-		${bindir}/rpm.real \
-		${bindir}/rpmconstant.real \
-		"
-
-FILES_${PN}-common = "${bindir}/rpm2cpio \
-		${bindir}/rpm2cpio.real \
-		${bindir}/gendiff \
-		${sysconfdir}/rpm \
-		${localstatedir}/spool/repackage \
-		"
-
-FILES_${PN}-libs = "${libdir}/librpm-*.so \
-		${libdir}/librpmconstant-*.so \
-		${libdir}/librpmdb-*.so \
-		${libdir}/librpmio-*.so \
-		${libdir}/librpmmisc-*.so \
-		${libdir}/librpmbuild-*.so \
-		"
-
-FILES_${PN}-build = "${prefix}/src/rpm \
-		${bindir}/rpmbuild \
-		${bindir}/rpmbuild.real \
-		${libdir}/rpm/brp-* \
-		${libdir}/rpm/check-files \
-		${libdir}/rpm/cross-build \
-		${libdir}/rpm/find-debuginfo.sh \
-		${libdir}/rpm/find-lang.sh \
-		${libdir}/rpm/find-prov.pl \
-		${libdir}/rpm/find-provides.perl \
-		${libdir}/rpm/find-req.pl \
-		${libdir}/rpm/find-requires.perl \
-		${libdir}/rpm/getpo.sh \
-		${libdir}/rpm/http.req \
-		${libdir}/rpm/javadeps.sh \
-		${libdir}/rpm/mono-find-provides \
-		${libdir}/rpm/mono-find-requires \
-		${libdir}/rpm/executabledeps.sh \
-		${libdir}/rpm/libtooldeps.sh \
-		${libdir}/rpm/osgideps.pl \
-		${libdir}/rpm/perldeps.pl \
-		${libdir}/rpm/perl.prov \
-		${libdir}/rpm/perl.req \
-		${libdir}/rpm/php.prov \
-		${libdir}/rpm/php.req \
-		${libdir}/rpm/pkgconfigdeps.sh \
-		${libdir}/rpm/pythondeps.sh \
-		${libdir}/rpm/bin/debugedit \
-		${libdir}/rpm/bin/debugedit.real \
-		${libdir}/rpm/bin/rpmcache \
-		${libdir}/rpm/bin/rpmcache.real \
-		${libdir}/rpm/bin/rpmcmp \
-		${libdir}/rpm/bin/rpmcmp.real \
-		${libdir}/rpm/bin/rpmdeps \
-		${libdir}/rpm/bin/rpmdeps.real \
-		${libdir}/rpm/bin/rpmdeps-oecore \
-		${libdir}/rpm/bin/rpmdeps-oecore.real \
-		${libdir}/rpm/bin/rpmdigest \
-		${libdir}/rpm/bin/rpmdigest.real \
-		${libdir}/rpm/bin/abi-compliance-checker.pl \
-		${libdir}/rpm/bin/api-sanity-autotest.pl \
-		${libdir}/rpm/bin/chroot \
-		${libdir}/rpm/bin/cp \
-		${libdir}/rpm/bin/dbsql \
-		${libdir}/rpm/bin/find \
-		${libdir}/rpm/bin/install-sh \
-		${libdir}/rpm/bin/lua \
-		${libdir}/rpm/bin/luac \
-		${libdir}/rpm/bin/mkinstalldirs \
-		${libdir}/rpm/bin/rpmlua \
-		${libdir}/rpm/bin/rpmluac \
-		${libdir}/rpm/bin/sqlite3 \
-		${libdir}/rpm/macros.d/cmake \
-		${libdir}/rpm/macros.d/java \
-		${libdir}/rpm/macros.d/libtool \
-		${libdir}/rpm/macros.d/mandriva \
-		${libdir}/rpm/macros.d/mono \
-		${libdir}/rpm/macros.d/perl \
-		${libdir}/rpm/macros.d/php \
-		${libdir}/rpm/macros.d/pkgconfig \
-		${libdir}/rpm/macros.d/python \
-		${libdir}/rpm/macros.d/ruby \
-		${libdir}/rpm/macros.d/selinux \
-		${libdir}/rpm/macros.d/tcl \
-		${libdir}/rpm/macros.rpmbuild \
-		${libdir}/rpm/u_pkg.sh \
-		${libdir}/rpm/vpkg-provides.sh \
-		${libdir}/rpm/vpkg-provides2.sh \
-		${libdir}/rpm/perfile_rpmdeps.sh \
-		${distromacrodir} \
-		"
-RDEPENDS_${PN} = "base-files run-postinsts"
-RDEPENDS_${PN}_class-native = ""
-RDEPENDS_${PN}_class-nativesdk = ""
-RDEPENDS_${PN}-build = "file bash perl"
-
-RDEPENDS_python-rpm = "${PN} python"
-
-FILES_python-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm"
-PROVIDES += "python-rpm"
-
-FILES_perl-module-rpm = "${libdir}/perl/*/* \
-		"
-
-RDEPENDS_${PN}-dev += "bash"
-
-FILES_${PN}-dev = "${includedir}/rpm \
-		${libdir}/librpm.la \
-		${libdir}/librpm.so \
-		${libdir}/librpmconstant.la \
-		${libdir}/librpmconstant.so \
-		${libdir}/librpmdb.la \
-		${libdir}/librpmdb.so \
-		${libdir}/librpmio.la \
-		${libdir}/librpmio.so \
-		${libdir}/librpmmisc.la \
-		${libdir}/librpmmisc.so \
-		${libdir}/librpmbuild.la \
-		${libdir}/librpmbuild.so \
-		${libdir}/rpm/lib/liblua.la \
-		${libdir}/pkgconfig/rpm.pc \
-		${libdir}/rpm/rpmdb_loadcvt \
-		${libdir}/rpm/include \
-		"
-
-FILES_${PN}-staticdev = " \
-		${libdir}/librpm.a \
-		${libdir}/librpmconstant.a \
-		${libdir}/librpmdb.a \
-		${libdir}/librpmio.a \
-		${libdir}/librpmmisc.a \
-		${libdir}/librpmbuild.a \
-		${libdir}/rpm/lib/liblua.a \
-		${PYTHON_SITEPACKAGES_DIR}/rpm/*.a \
-		"
-
-do_configure() {
-	# Disable tests!
-	echo "all:" > ${S}/tests/Makefile.am
-	sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in
-
-	( cd ${S}; ${S}/autogen.sh )
-
-	# NASTY hack to make sure configure files the right pkg-config file...
-	sed -e 's/pkg-config --exists uuid/pkg-config --exists ossp-uuid/g' \
-	    -e 's/pkg-config uuid/pkg-config ossp-uuid/g' -i ${S}/configure
-
-	( cd ${S}/syck ; set +e ; rm -- -l* ; rm Makefile config.h config.status lib/Makefile libtool stamp-h1 tests/.deps tests/Makefile  ) || :
-
-	export varprefix=${localstatedir}
-	oe_runconf
-}
-
-do_install_append() {
-	# Configure -distribution wide- package crypto settings
-	# If these change, effectively all packages have to be upgraded!
-	sed -i -e 's,%_build_file_digest_algo.*,%_build_sign ${RPM_FILE_DIGEST_ALGO},' ${D}/${libdir}/rpm/macros.rpmbuild
-	sed -i -e 's,%_build_sign.*,%_build_sign ${RPM_SELF_SIGN_ALGO},' ${D}/${libdir}/rpm/macros.rpmbuild
-
-	sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
-	sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
-	sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
-	sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros
-	sed -i -e 's,^#%_openall_before_chroot.*,%_openall_before_chroot\t1,' ${D}/${libdir}/rpm/macros
-
-	# Enable MIPS64 N32 transactions.  (This is a no-op on non-MIPS targets.)
-	sed -i -e 's,%_transaction_color[^_].*,%_transaction_color 7,' ${D}/${libdir}/rpm/macros
-
-	# Enable Debian style arbitrary tags...
-	sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros
-
-	install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
-	install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
-
-	rm -f ${D}/${includedir}/popt.h
-	rm -f ${D}/${libdir}/libpopt.*
-	rm -f ${D}/${libdir}/pkgconfig/popt.pc
-	rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
-	rm -f ${D}/${mandir}/man3/popt.3
-
-	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/*.a
-	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/*.la
-	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/*.a
-	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/*.la
-
-	rm -f ${D}/${libdir}/rpm/dbconvert.sh
-	rm -f ${D}/${libdir}/rpm/libsqldb.*
-
-	rm -f ${D}/${libdir}/rpm/gstreamer.sh
-	rm -f ${D}/${libdir}/rpm/gem_helper.rb
-	rm -f ${D}/${libdir}/rpm/rubygems.rb
-	rm -f ${D}/${libdir}/rpm/kmod-deps.sh
-	rm -f ${D}/${libdir}/rpm/pythoneggs.py
-	rm -f ${D}/${libdir}/rpm/macros.d/kernel
-	rm -f ${D}/${libdir}/rpm/macros.d/gstreamer
-	rm -f ${D}/${libdir}/rpm/bin/mgo
-	rm -f ${D}/${libdir}/rpm/bin/pom2spec
-
-	rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj
-	rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl
-}
-
-do_install_append_class-target() {
-	# Create and install distribution specific macros
-	mkdir -p ${D}/${distromacrodir}
-	cat << EOF > ${D}/${distromacrodir}/macros
-%_defaultdocdir		${docdir}
-
-%_prefix                ${prefix}
-%_exec_prefix           ${exec_prefix}
-%_datarootdir           ${datadir}
-%_bindir                ${bindir}
-%_sbindir               ${sbindir}
-%_libexecdir            %{_libdir}/%{name}
-%_datadir               ${datadir}
-%_sysconfdir            ${sysconfdir}
-%_sharedstatedir        ${sharedstatedir}
-%_localstatedir         ${localstatedir}
-%_lib                   lib
-%_libdir                %{_exec_prefix}/%{_lib}
-%_includedir            ${includedir}
-%_oldincludedir         ${oldincludedir}
-%_infodir               ${infodir}
-%_mandir                ${mandir}
-%_localedir             %{_libdir}/locale
-EOF
-
-	# Create and install multilib specific macros
-	${@multilib_rpmmacros(d)}
-}
-
-do_install_append_class-native () {
-	sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env nativepython|' ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/transaction.py
-}
-
-do_install_append_class-nativesdk () {
-	sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env python|' ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/transaction.py
-}
-
-def multilib_rpmmacros(d):
-    localdata = d.createCopy()
-    # We need to clear the TOOLCHAIN_OPTIONS (--sysroot)
-    localdata.delVar('TOOLCHAIN_OPTIONS')
-
-    # Set 'localdata' values to be consistent with 'd' values.
-    localdata.setVar('distromacrodir', d.getVar('distromacrodir', True))
-    localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
-
-    ret = gen_arch_macro(localdata)
-
-    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
-    for item in variants.split():
-        # Load overrides from 'd' to avoid having to reset the value...
-        localdata = d.createCopy()
-        overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
-        localdata.setVar("OVERRIDES", overrides)
-        localdata.setVar("MLPREFIX", item + "-")
-        bb.data.update_data(localdata)
-        ret += gen_arch_macro(localdata)
-    return ret
-
-def gen_arch_macro(d):
-    # Generate shell script to produce the file as part of do_install
-    val  = "mkdir -p ${D}/${distromacrodir}/${TARGET_ARCH}-${TARGET_OS}\n"
-    val += "cat << EOF > ${D}/${distromacrodir}/${TARGET_ARCH}-${TARGET_OS}/macros\n"
-    val += "%_lib               ${baselib}\n"
-    val += "%_libdir            ${libdir}\n"
-    val += "%_localedir         ${localedir}\n"
-    val += "\n"
-    val += "# Toolchain configuration\n"
-    val += "%TOOLCHAIN_OPTIONS  %{nil}\n"
-    val += "%__ar               ${@d.getVar('AR', True).replace('$','%')}\n"
-    val += "%__as               ${@d.getVar('AS', True).replace('$','%')}\n"
-    val += "%__cc               ${@d.getVar('CC', True).replace('$','%')}\n"
-    val += "%__cpp              ${@d.getVar('CPP', True).replace('$','%')}\n"
-    val += "%__cxx              ${@d.getVar('CXX', True).replace('$','%')}\n"
-    val += "%__ld               ${@d.getVar('LD', True).replace('$','%')}\n"
-    val += "%__nm               ${@d.getVar('NM', True).replace('$','%')}\n"
-    val += "%__objcopy          ${@d.getVar('OBJCOPY', True).replace('$','%')}\n"
-    val += "%__objdump          ${@d.getVar('OBJDUMP', True).replace('$','%')}\n"
-    val += "%__ranlib           ${@d.getVar('RANLIB', True).replace('$','%')}\n"
-    val += "%__strip            ${@d.getVar('STRIP', True).replace('$','%')}\n"
-    val += "EOF\n"
-    val += "\n"
-    return d.expand(val)
-
-
-add_native_wrapper() {
-        create_wrapper ${D}/${bindir}/rpm \
-		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
-		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
-		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
-
-        create_wrapper ${D}/${bindir}/rpm2cpio \
-		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
-		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
-		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
-
-        create_wrapper ${D}/${bindir}/rpmbuild \
-		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
-		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
-		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
-
-        create_wrapper ${D}/${bindir}/rpmconstant \
-		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
-		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
-		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
-
-	for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do
-        	create_wrapper $rpm_binary \
-			RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
-			RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
-			RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
-	done
-}
-
-do_install_append_class-native() {
-	add_native_wrapper
-}
-
-do_install_append_class-nativesdk() {
-	add_native_wrapper
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_git.bb
new file mode 100644
index 0000000..b0f5780
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_git.bb
@@ -0,0 +1,121 @@
+SUMMARY = "The RPM package management system"
+DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
+package management system capable of installing, uninstalling, \
+verifying, querying, and updating software packages. Each software \
+package consists of an archive of files along with information about \
+the package like its version, a description, etc."
+
+SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
+DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
+development files will simplify the process of writing programs that \
+manipulate RPM packages and databases. These files are intended to \
+simplify the process of creating graphical package managers or any \
+other tools that need an intimate knowledge of RPM packages in order \
+to function."
+
+SUMMARY_python3-rpm = "Python bindings for apps which will manupulate RPM packages"
+DESCRIPTION_python3-rpm = "The python3-rpm package contains a module that permits applications \
+written in the Python programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+HOMEPAGE = "http://www.rpm.org"
+
+# libraries are also LGPL - how to express this?
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f5259151d26ff18e78023450a5ac8d96"
+
+SRC_URI = "git://github.com/rpm-software-management/rpm \
+           file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
+           file://0001-Do-not-read-config-files-from-HOME.patch \
+           file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
+           file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
+           file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
+           file://0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch \
+           file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
+           file://0001-Fix-build-with-musl-C-library.patch \
+           file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
+           file://0001-Add-PYTHON_ABI-when-searching-for-python-libraries.patch \
+           file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
+           file://0012-Use-conditional-to-access-_docdir-in-macros.in.patch \
+           file://0013-Add-a-new-option-alldeps-to-rpmdeps.patch \
+           file://0001-perl-disable-auto-reqs.patch \
+           "
+
+PV = "4.13.90+git${SRCPV}"
+PE = "1"
+SRCREV = "a8e51b3bb05c6acb1d9b2e3d34f859ddda1677be"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "nss libarchive db file popt xz dbus elfutils python3"
+DEPENDS_append_class-native = " file-replacement-native"
+
+inherit autotools gettext pkgconfig python3native
+export PYTHON_ABI
+
+# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
+EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
+
+EXTRA_OECONF_append = " --without-lua --enable-python"
+EXTRA_OECONF_append_libc-musl = " --disable-nls"
+
+# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
+#
+# --localstatedir prevents rpm from writing its database to native sysroot when building images
+#
+# Also disable plugins, so that rpm doesn't attempt to inhibit shutdown via session dbus
+EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
+# libmagic also has sysroot path contamination, so override it
+do_install_append_class-native() {
+        tools="\
+                ${bindir}/rpm \
+                ${bindir}/rpm2archive \
+                ${bindir}/rpm2cpio \
+                ${bindir}/rpmbuild \
+                ${bindir}/rpmdb \
+                ${bindir}/rpmgraph \
+                ${bindir}/rpmkeys \
+                ${bindir}/rpmsign \
+                ${bindir}/rpmspec \
+                ${libdir}/rpm/rpmdeps \
+        "
+
+        for tool in $tools; do
+                create_wrapper ${D}$tool \
+                        RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
+                        RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
+                        MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
+                        RPM_NO_CHROOT_FOR_SCRIPTS=1
+        done
+}
+
+# Rpm's make install creates var/tmp which clashes with base-files packaging
+do_install_append_class-target() {
+    rm -rf ${D}/var
+}
+
+do_install_append () {
+	sed -i -e 's:${HOSTTOOLS_DIR}/::g' ${D}/${libdir}/rpm/macros
+
+	sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
+	    ${D}${libdir}/rpm/pythondistdeps.py
+}
+
+FILES_${PN} += "${libdir}/rpm-plugins/*.so \
+               "
+
+FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
+                    "
+
+PACKAGES += "python3-rpm"
+PROVIDES += "python3-rpm"
+FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
+
+# rpm 5.x was packaging the rpm build tools separately
+RPROVIDES_${PN} += "rpm-build"
+
+RDEPENDS_${PN} = "bash perl python3-core"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
deleted file mode 100644
index c0b4d56..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/* OpenEmbedded RPM resolver utility
-
-  Written by: Paul Eggleton <paul.eggleton@linux.intel.com>
-
-  Copyright 2012 Intel Corporation
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License version 2 as
-  published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License along
-  with this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#include <rpmdb.h>
-#include <rpmtypes.h>
-#include <rpmtag.h>
-#include <rpmts.h>
-#include <rpmmacro.h>
-#include <rpmcb.h>
-#include <rpmlog.h>
-#include <argv.h>
-#include <mire.h>
-
-int debugmode;
-FILE *outf;
-
-int getPackageStr(rpmts ts, const char *NVRA, rpmTag tag, char **value)
-{
-    int rc = -1;
-    rpmmi mi = rpmmiInit(rpmtsGetRdb(ts), RPMTAG_NVRA, NVRA, 0);
-    Header h;
-    if ((h = rpmmiNext(mi)) != NULL) {
-        HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he));
-        he->tag = tag;
-        rc = (headerGet(h, he, 0) != 1);
-        if(rc==0)
-            *value = strdup((char *)he->p.ptr);
-    }
-    (void)rpmmiFree(mi);
-    return rc;
-}
-
-int loadTs(rpmts **ts, int *tsct, const char *dblistfn)
-{
-    int count = 0;
-    int sz = 5;
-    int rc = 0;
-    int listfile = 1;
-    struct stat st_buf;
-
-    rc = stat(dblistfn, &st_buf);
-    if(rc != 0) {
-        perror("stat");
-        return 1;
-    }
-    if(S_ISDIR(st_buf.st_mode))
-        listfile = 0;
-
-    if(listfile) {
-        if(debugmode)
-            printf("DEBUG: reading database list file '%s'\n", dblistfn);
-        *ts = malloc(sz * sizeof(rpmts));
-        FILE *f = fopen(dblistfn, "r" );
-        if(f) {
-            char line[2048];
-            while(fgets(line, sizeof(line), f)) {
-                int len = strlen(line) - 1;
-                if(len > 0)
-                    // Trim trailing whitespace
-                    while(len > 0 && isspace(line[len]))
-                        line[len--] = '\0';
-
-                if(len > 0) {
-                    // Expand array if needed
-                    if(count == sz) {
-                        sz += 5;
-                        *ts = (rpmts *)realloc(*ts, sz);
-                    }
-
-                    if(debugmode)
-                        printf("DEBUG: opening database '%s'\n", line);
-                    char *dbpathm = malloc(strlen(line) + 10);
-                    sprintf(dbpathm, "_dbpath %s", line);
-                    rpmDefineMacro(NULL, dbpathm, RMIL_CMDLINE);
-                    free(dbpathm);
-
-                    rpmts tsi = rpmtsCreate();
-                    (*ts)[count] = tsi;
-                    rc = rpmtsOpenDB(tsi, O_RDONLY);
-                    if( rc ) {
-                        fprintf(stderr, "Failed to open database %s\n", line);
-                        rc = -1;
-                        break;
-                    }
-
-                    count++;
-                }
-            }
-            fclose(f);
-            *tsct = count;
-        }
-        else {
-            perror(dblistfn);
-            rc = -1;
-        }
-    }
-    else {
-        if(debugmode)
-            printf("DEBUG: opening database '%s'\n", dblistfn);
-        // Load from single database
-        *ts = malloc(sizeof(rpmts));
-        char *dbpathm = malloc(strlen(dblistfn) + 10);
-        sprintf(dbpathm, "_dbpath %s", dblistfn);
-        rpmDefineMacro(NULL, dbpathm, RMIL_CMDLINE);
-        free(dbpathm);
-
-        rpmts tsi = rpmtsCreate();
-        (*ts)[0] = tsi;
-        rc = rpmtsOpenDB(tsi, O_RDONLY);
-        if( rc ) {
-            fprintf(stderr, "Failed to open database %s\n", dblistfn);
-            rc = -1;
-        }
-        *tsct = 1;
-    }
-
-    return rc;
-}
-
-int processPackages(rpmts *ts, int tscount, const char *packagelistfn, int ignoremissing)
-{
-    int rc = 0;
-    int count = 0;
-    int sz = 100;
-    int i = 0;
-    int missing = 0;
-
-    FILE *f = fopen(packagelistfn, "r" );
-    if(f) {
-        char line[255];
-        while(fgets(line, sizeof(line), f)) {
-            int len = strlen(line) - 1;
-            if(len > 0)
-                // Trim trailing whitespace
-                while(len > 0 && isspace(line[len]))
-                    line[len--] = '\0';
-
-            if(len > 0) {
-                int found = 0;
-                for(i=0; i<tscount; i++) {
-                    ARGV_t keys = NULL;
-                    rpmdb db = rpmtsGetRdb(ts[i]);
-                    rc = rpmdbMireApply(db, RPMTAG_NAME,
-                                RPMMIRE_STRCMP, line, &keys);
-                    if (keys) {
-                        int nkeys = argvCount(keys);
-                        if( nkeys == 1 ) {
-                            char *value = NULL;
-                            rc = getPackageStr(ts[i], keys[0], RPMTAG_PACKAGEORIGIN, &value);
-                            if(rc == 0)
-                                fprintf(outf, "%s\n", value);
-                            else
-                                fprintf(stderr, "Failed to get package origin for %s\n", line);
-                            found = 1;
-                        }
-                        else if( nkeys > 1 ) {
-                            int keyindex = 0;
-                            fprintf(stderr, "Multiple matches for %s:\n", line);
-                            for( keyindex=0; keyindex<nkeys; keyindex++) {
-                                char *value = NULL;
-                                rc = getPackageStr(ts[i], keys[keyindex], RPMTAG_PACKAGEORIGIN, &value);
-                                if(rc == 0)
-                                    fprintf(stderr, "  %s\n", value);
-                                else
-                                    fprintf(stderr, "  (%s)\n", keys[keyindex]);
-                            }
-                        }
-                    }
-                    if(found)
-                        break;
-                }
-
-                if( !found ) {
-                    if( ignoremissing ) {
-                        fprintf(stderr, "Unable to resolve package %s - ignoring\n", line);
-                    }
-                    else {
-                        fprintf(stderr, "Unable to resolve package %s\n", line);
-                        missing = 1;
-                    }
-                }
-            }
-            count++;
-        }
-        fclose(f);
-
-        if( missing ) {
-            fprintf(stderr, "ERROR: some packages were missing\n");
-            rc = 1;
-        }
-    }
-    else {
-        perror(packagelistfn);
-        rc = -1;
-    }
-
-    return rc;
-}
-
-int lookupProvider(rpmts ts, const char *req, char **provider)
-{
-    int rc = 0;
-    rpmmi provmi = rpmmiInit(rpmtsGetRdb(ts), RPMTAG_PROVIDENAME, req, 0);
-    if(provmi) {
-        Header h;
-        if ((h = rpmmiNext(provmi)) != NULL) {
-            HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he));
-            he->tag = RPMTAG_NAME;
-            rc = (headerGet(h, he, 0) != 1);
-            if(rc==0)
-                *provider = strdup((char *)he->p.ptr);
-        }
-        (void)rpmmiFree(provmi);
-    }
-    else {
-        rc = -1;
-    }
-    return rc;
-}
-
-int printDepList(rpmts *ts, int tscount)
-{
-    int rc = 0;
-
-    if( tscount > 1 )
-        fprintf(stderr, ">1 database specified with dependency list, using first only\n");
-
-    /* Get list of names */
-    rpmdb db = rpmtsGetRdb(ts[0]);
-    ARGV_t names = NULL;
-    rc = rpmdbMireApply(db, RPMTAG_NAME,
-                RPMMIRE_STRCMP, NULL, &names);
-    int nnames = argvCount(names);
-
-    /* Get list of NVRAs */
-    ARGV_t keys = NULL;
-    rc = rpmdbMireApply(db, RPMTAG_NVRA,
-                RPMMIRE_STRCMP, NULL, &keys);
-    if (keys) {
-        int i, j;
-        HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he));
-        int nkeys = argvCount(keys);
-        for(i=0; i<nkeys; i++) {
-            rpmmi mi = rpmmiInit(db, RPMTAG_NVRA, keys[i], 0);
-            Header h;
-            if ((h = rpmmiNext(mi)) != NULL) {
-                /* Get name of package */
-                he->tag = RPMTAG_NAME;
-                rc = (headerGet(h, he, 0) != 1);
-                char *name = strdup((char *)he->p.ptr);
-                /* Get its requires */
-                he->tag = RPMTAG_REQUIRENAME;
-                if (rc = (headerGet(h, he, 0) != 1)) {
-                    if (debugmode) {
-                        printf("DEBUG: %s requires null\n", name);
-                    }
-                    rc = 0;
-                    free(name);
-                    (void)rpmmiFree(mi);
-                    continue;
-                }
-                ARGV_t reqs = (ARGV_t)he->p.ptr;
-                /* Get its requireflags */
-                he->tag = RPMTAG_REQUIREFLAGS;
-                rc = (headerGet(h, he, 0) != 1);
-                rpmuint32_t *reqflags = (rpmuint32_t *)he->p.ui32p;
-                for(j=0; j<he->c; j++) {
-                    int k;
-                    char *prov = NULL;
-                    for(k=0; k<nnames; k++) {
-                        if(strcmp(names[k], reqs[j]) == 0) {
-                            prov = names[k];
-                            break;
-                        }
-                    }
-                    if(prov) {
-                        if((int)reqflags[j] & 0x80000)
-                            fprintf(outf, "%s|%s [REC]\n", name, prov);
-                        else
-                            fprintf(outf, "%s|%s\n", name, prov);
-                    }
-                    else {
-                        rc = lookupProvider(ts[0], reqs[j], &prov);
-                        if(rc==0 && prov) {
-                            if((int)reqflags[j] & 0x80000)
-                                fprintf(outf, "%s|%s [REC]\n", name, prov);
-                            else
-                                fprintf(outf, "%s|%s\n", name, prov);
-                            free(prov);
-                        }
-                    }
-                }
-                free(name);
-            }
-            (void)rpmmiFree(mi);
-        }
-    }
-
-    return rc;
-}
-
-void usage()
-{
-    fprintf(stderr, "OpenEmbedded rpm resolver utility\n");
-    fprintf(stderr, "syntax: rpmresolve [-i] [-d] [-t] <dblistfile> <packagelistfile>\n");
-}
-
-int main(int argc, char **argv)
-{
-    rpmts *ts = NULL;
-    int tscount = 0;
-    int rc = 0;
-    int i;
-    int c;
-    int ignoremissing = 0;
-    int deplistmode = 0;
-    char *outfile = NULL;
-
-    debugmode = 0;
-    outf = stdout;
-
-    opterr = 0;
-    while ((c = getopt (argc, argv, "itdo:")) != -1) {
-        switch (c) {
-            case 'i':
-                ignoremissing = 1;
-                break;
-            case 't':
-                deplistmode = 1;
-                break;
-            case 'd':
-                debugmode = 1;
-                break;
-            case 'o':
-                outfile = strdup(optarg);
-                break;
-            case '?':
-                if(isprint(optopt))
-                    fprintf(stderr, "Unknown option `-%c'.\n", optopt);
-                else
-                    fprintf(stderr, "Unknown option character `\\x%x'.\n",
-                        optopt);
-                usage();
-                return 1;
-            default:
-                abort();
-        }
-    }
-
-    if( argc - optind < 1 ) {
-        usage();
-        return 1;
-    }
-
-    if( outfile ) {
-        if(debugmode)
-            printf("DEBUG: Using output file %s\n", outfile);
-        outf = fopen(outfile, "w");
-    }
-
-    const char *dblistfn = argv[optind];
-
-    rpmcliInit(argc, argv, NULL);
-
-    if(debugmode)
-        rpmSetVerbosity(RPMLOG_DEBUG);
-
-    rpmDefineMacro(NULL, "__dbi_txn create nofsync", RMIL_CMDLINE);
-
-    rc = loadTs(&ts, &tscount, dblistfn);
-    if( rc )
-        return 1;
-    if( tscount == 0 ) {
-        fprintf(stderr, "Please specify database list file or database location\n");
-        return 1;
-    }
-
-    if(deplistmode) {
-        rc = printDepList(ts, tscount);
-    }
-    else {
-        if( argc - optind < 2 ) {
-            fprintf(stderr, "Please specify package list file\n");
-        }
-        else {
-            const char *pkglistfn = argv[optind+1];
-            rc = processPackages(ts, tscount, pkglistfn, ignoremissing);
-        }
-    }
-
-    for(i=0; i<tscount; i++)
-        (void)rpmtsFree(ts[i]);
-    free(ts);
-
-    if( outfile ) {
-        fclose(outf);
-        free(outfile);
-    }
-
-    return rc;
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve_1.0.bb
deleted file mode 100644
index 0c13a67..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve_1.0.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-SUMMARY = "OpenEmbedded RPM resolver utility"
-DESCRIPTION = "OpenEmbedded RPM resolver - performs RPM database lookups in batches to avoid \
- repeated invocations of rpm on the command line."
-DEPENDS = "rpm"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
-PR = "r2"
-
-SRC_URI = "file://rpmresolve.c"
-
-S = "${WORKDIR}"
-
-do_compile() {
-	${CC} ${CFLAGS} -ggdb -I${STAGING_INCDIR}/rpm ${LDFLAGS} rpmresolve.c -o rpmresolve -lrpmbuild -lrpm -lrpmio -lrpmdb
-}
-
-do_install() {
-	install -d ${D}${bindir}
-	install -m 0755 rpmresolve ${D}${bindir}
-}
-
-do_install_append_class-native() {
-	create_wrapper ${D}/${bindir}/rpmresolve \
-			RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
-			RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
-			RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch
deleted file mode 100644
index bea325e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-Upstream-Status: Backport [ The patch is rsync-2.6.9 specific ]
-CVE: CVE-2007-4091
-
-The patch is from https://issues.rpath.com/browse/RPL-1647 and is used to
-address http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-4091
-
-Date:   Tue May 10 10:07:36 2011 +0800
-Dexuan Cui <dexuan.cui@intel.com>
-
-diff --git a/sender.c b/sender.c
-index 6fcaa65..053a8f1 100644
---- a/sender.c
-+++ b/sender.c
-@@ -123,6 +123,7 @@ void successful_send(int ndx)
- 	char fname[MAXPATHLEN];
- 	struct file_struct *file;
- 	unsigned int offset;
-+	size_t l = 0;
- 
- 	if (ndx < 0 || ndx >= the_file_list->count)
- 		return;
-@@ -133,6 +134,20 @@ void successful_send(int ndx)
- 				    file->dir.root, "/", NULL);
- 	} else
- 		offset = 0;
-+
-+	l = offset + 1;
-+	if (file) {
-+		if (file->dirname)
-+			l += strlen(file->dirname);
-+		if (file->basename)
-+			l += strlen(file->basename);
-+	}
-+
-+	if (l >= sizeof(fname)) {
-+		rprintf(FERROR, "Overlong pathname\n");
-+		exit_cleanup(RERR_FILESELECT);
-+	}
-+
- 	f_name(file, fname + offset);
- 	if (remove_source_files) {
- 		if (do_unlink(fname) == 0) {
-@@ -224,6 +239,7 @@ void send_files(struct file_list *flist, int f_out, int f_in)
- 	enum logcode log_code = log_before_transfer ? FLOG : FINFO;
- 	int f_xfer = write_batch < 0 ? batch_fd : f_out;
- 	int i, j;
-+	size_t l = 0;
- 
- 	if (verbose > 2)
- 		rprintf(FINFO, "send_files starting\n");
-@@ -259,6 +275,20 @@ void send_files(struct file_list *flist, int f_out, int f_in)
- 				fname[offset++] = '/';
- 		} else
- 			offset = 0;
-+
-+		l = offset + 1;
-+		if (file) {
-+			if (file->dirname)
-+				l += strlen(file->dirname);
-+			if (file->basename)
-+				l += strlen(file->basename);
-+		}
-+
-+		if (l >= sizeof(fname)) {
-+			rprintf(FERROR, "Overlong pathname\n");
-+			exit_cleanup(RERR_FILESELECT);
-+		}
-+
- 		fname2 = f_name(file, fname + offset);
- 
- 		if (verbose > 2)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf
deleted file mode 100644
index 845f5b3..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf
+++ /dev/null
@@ -1,15 +0,0 @@
-# /etc/rsyncd.conf
-
-# Minimal configuration file for rsync daemon
-# See rsync(1) and rsyncd.conf(5) man pages for help
-
-# This file is required by rsync --daemon
-pid file = /var/run/rsyncd.pid
-use chroot = yes
-read only = yes
-
-# Simple example for enabling your own local rsync server
-#[everything]
-#	path = /
-#	comment = Everything except /etc exposed
-#	exclude = /etc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync.inc b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync.inc
index 37897ab..26c023a 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync.inc
@@ -5,7 +5,7 @@
 
 DEPENDS = "popt"
 
-SRC_URI = "http://rsync.samba.org/ftp/rsync/src/rsync-${PV}.tar.gz \
+SRC_URI = "https://download.samba.org/pub/${BPN}/src/${BP}.tar.gz \
            file://rsyncd.conf"
 
 inherit autotools
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_2.6.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_2.6.9.bb
deleted file mode 100644
index efdf255..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_2.6.9.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-require rsync.inc
-
-SRC_URI += "file://rsync-2.6.9-fname-obo.patch \
-            file://rsyncd.conf \
-"
-
-SRC_URI[md5sum] = "996d8d8831dbca17910094e56dcb5942"
-SRC_URI[sha256sum] = "ca437301becd890e73300bc69a39189ff1564baa761948ff149b3dd7bde633f9"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=6d5a9d4c4d3af25cd68fd83e8a8cb09c"
-
-PR = "r4"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb
index c6cb331..1031984 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb
@@ -10,7 +10,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 PACKAGECONFIG ??= "acl attr \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
 "
 PACKAGECONFIG[acl] = "--enable-acl-support,--disable-acl-support,acl,"
 PACKAGECONFIG[attr] = "--enable-xattr-support,--disable-xattr-support,attr,"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc
index fde67e9..d719898 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc
@@ -8,10 +8,10 @@
 SECTION = "devel/ruby"
 LICENSE = "Ruby | BSD | GPLv2"
 LIC_FILES_CHKSUM = "\
-    file://COPYING;md5=837b32593517ae48b9c3b5c87a5d288c \
+    file://COPYING;md5=8a960b08d972f43f91ae84a6f00dcbfb \
     file://BSDL;md5=19aaf65c88a40b508d17ae4be539c4b5\
     file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263\
-    file://LEGAL;md5=c440adb575ba4e6e2344c2630b6a5584\
+    file://LEGAL;md5=daf349ad59dd19bd8c919171bff3c5d6 \
 "
 
 DEPENDS = "ruby-native zlib openssl tcl libyaml db gdbm readline"
@@ -22,6 +22,7 @@
            file://extmk.patch \
            file://0002-Obey-LDFLAGS-for-the-link-of-libruby.patch \
            "
+UPSTREAM_CHECK_URI = "https://www.ruby-lang.org/en/downloads/"
 
 inherit autotools
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/CVE-2017-14064.patch b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/CVE-2017-14064.patch
new file mode 100644
index 0000000..700d1bc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/CVE-2017-14064.patch
@@ -0,0 +1,353 @@
+From d86d283fcb35d1442a121b92030884523908a331 Mon Sep 17 00:00:00 2001
+From: nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
+Date: Sat, 22 Apr 2017 07:29:01 +0000
+Subject: [PATCH] merge revision(s) 58323,58324:
+
+	Merge json-2.0.4.
+
+	  * https://github.com/flori/json/releases/tag/v2.0.4
+	  * https://github.com/flori/json/blob/09fabeb03e73ed88dc8ce8f19d76ac59e51dae20/CHANGES.md#2017-03-23-204
+	Use `assert_raise` instead of `assert_raises`.
+
+git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@58445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
+
+Upstream-Status: Backport
+CVE: CVE-2017-14064
+
+Signed-off-by: Armin Kuster <akuster@mvisa.com>
+
+---
+ ext/json/fbuffer/fbuffer.h       |   3 ---
+ ext/json/generator/generator.c   |  12 +++++-----
+ ext/json/generator/generator.h   |   1 -
+ ext/json/json.gemspec            | Bin 5473 -> 5474 bytes
+ ext/json/lib/json/version.rb     |   2 +-
+ ext/json/parser/parser.c         |  48 +++++++++++++++++++++++----------------
+ ext/json/parser/parser.rl        |  14 +++++++++---
+ test/json/json_encoding_test.rb  |   2 ++
+ test/json/json_generator_test.rb |   0
+ version.h                        |   2 +-
+ 10 files changed, 49 insertions(+), 35 deletions(-)
+ mode change 100755 => 100644 test/json/json_generator_test.rb
+
+Index: ruby-2.4.0/ext/json/fbuffer/fbuffer.h
+===================================================================
+--- ruby-2.4.0.orig/ext/json/fbuffer/fbuffer.h
++++ ruby-2.4.0/ext/json/fbuffer/fbuffer.h
+@@ -12,9 +12,6 @@
+ #define RFLOAT_VALUE(val) (RFLOAT(val)->value)
+ #endif
+ 
+-#ifndef RARRAY_PTR
+-#define RARRAY_PTR(ARRAY) RARRAY(ARRAY)->ptr
+-#endif
+ #ifndef RARRAY_LEN
+ #define RARRAY_LEN(ARRAY) RARRAY(ARRAY)->len
+ #endif
+Index: ruby-2.4.0/ext/json/generator/generator.c
+===================================================================
+--- ruby-2.4.0.orig/ext/json/generator/generator.c
++++ ruby-2.4.0/ext/json/generator/generator.c
+@@ -308,7 +308,7 @@ static char *fstrndup(const char *ptr, u
+   char *result;
+   if (len <= 0) return NULL;
+   result = ALLOC_N(char, len);
+-  memccpy(result, ptr, 0, len);
++  memcpy(result, ptr, len);
+   return result;
+ }
+ 
+@@ -1062,7 +1062,7 @@ static VALUE cState_indent_set(VALUE sel
+         }
+     } else {
+         if (state->indent) ruby_xfree(state->indent);
+-        state->indent = strdup(RSTRING_PTR(indent));
++        state->indent = fstrndup(RSTRING_PTR(indent), len);
+         state->indent_len = len;
+     }
+     return Qnil;
+@@ -1100,7 +1100,7 @@ static VALUE cState_space_set(VALUE self
+         }
+     } else {
+         if (state->space) ruby_xfree(state->space);
+-        state->space = strdup(RSTRING_PTR(space));
++        state->space = fstrndup(RSTRING_PTR(space), len);
+         state->space_len = len;
+     }
+     return Qnil;
+@@ -1136,7 +1136,7 @@ static VALUE cState_space_before_set(VAL
+         }
+     } else {
+         if (state->space_before) ruby_xfree(state->space_before);
+-        state->space_before = strdup(RSTRING_PTR(space_before));
++        state->space_before = fstrndup(RSTRING_PTR(space_before), len);
+         state->space_before_len = len;
+     }
+     return Qnil;
+@@ -1173,7 +1173,7 @@ static VALUE cState_object_nl_set(VALUE
+         }
+     } else {
+         if (state->object_nl) ruby_xfree(state->object_nl);
+-        state->object_nl = strdup(RSTRING_PTR(object_nl));
++        state->object_nl = fstrndup(RSTRING_PTR(object_nl), len);
+         state->object_nl_len = len;
+     }
+     return Qnil;
+@@ -1208,7 +1208,7 @@ static VALUE cState_array_nl_set(VALUE s
+         }
+     } else {
+         if (state->array_nl) ruby_xfree(state->array_nl);
+-        state->array_nl = strdup(RSTRING_PTR(array_nl));
++        state->array_nl = fstrndup(RSTRING_PTR(array_nl), len);
+         state->array_nl_len = len;
+     }
+     return Qnil;
+Index: ruby-2.4.0/ext/json/generator/generator.h
+===================================================================
+--- ruby-2.4.0.orig/ext/json/generator/generator.h
++++ ruby-2.4.0/ext/json/generator/generator.h
+@@ -1,7 +1,6 @@
+ #ifndef _GENERATOR_H_
+ #define _GENERATOR_H_
+ 
+-#include <string.h>
+ #include <math.h>
+ #include <ctype.h>
+ 
+Index: ruby-2.4.0/ext/json/lib/json/version.rb
+===================================================================
+--- ruby-2.4.0.orig/ext/json/lib/json/version.rb
++++ ruby-2.4.0/ext/json/lib/json/version.rb
+@@ -1,7 +1,7 @@
+ # frozen_string_literal: false
+ module JSON
+   # JSON version
+-  VERSION         = '2.0.2'
++  VERSION         = '2.0.4'
+   VERSION_ARRAY   = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
+   VERSION_MAJOR   = VERSION_ARRAY[0] # :nodoc:
+   VERSION_MINOR   = VERSION_ARRAY[1] # :nodoc:
+Index: ruby-2.4.0/ext/json/parser/parser.c
+===================================================================
+--- ruby-2.4.0.orig/ext/json/parser/parser.c
++++ ruby-2.4.0/ext/json/parser/parser.c
+@@ -1435,13 +1435,21 @@ static VALUE json_string_unescape(VALUE
+                     break;
+                 case 'u':
+                     if (pe > stringEnd - 4) {
+-                        return Qnil;
++                      rb_enc_raise(
++                        EXC_ENCODING eParserError,
++                        "%u: incomplete unicode character escape sequence at '%s'", __LINE__, p
++                      );
+                     } else {
+                         UTF32 ch = unescape_unicode((unsigned char *) ++pe);
+                         pe += 3;
+                         if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
+                             pe++;
+-                            if (pe > stringEnd - 6) return Qnil;
++                            if (pe > stringEnd - 6) {
++                              rb_enc_raise(
++                                EXC_ENCODING eParserError,
++                                "%u: incomplete surrogate pair at '%s'", __LINE__, p
++                                );
++                            }
+                             if (pe[0] == '\\' && pe[1] == 'u') {
+                                 UTF32 sur = unescape_unicode((unsigned char *) pe + 2);
+                                 ch = (((ch & 0x3F) << 10) | ((((ch >> 6) & 0xF) + 1) << 16)
+@@ -1471,7 +1479,7 @@ static VALUE json_string_unescape(VALUE
+ }
+ 
+ 
+-#line 1475 "parser.c"
++#line 1483 "parser.c"
+ enum {JSON_string_start = 1};
+ enum {JSON_string_first_final = 8};
+ enum {JSON_string_error = 0};
+@@ -1479,7 +1487,7 @@ enum {JSON_string_error = 0};
+ enum {JSON_string_en_main = 1};
+ 
+ 
+-#line 504 "parser.rl"
++#line 512 "parser.rl"
+ 
+ 
+ static int
+@@ -1501,15 +1509,15 @@ static char *JSON_parse_string(JSON_Pars
+ 
+     *result = rb_str_buf_new(0);
+ 
+-#line 1505 "parser.c"
++#line 1513 "parser.c"
+ 	{
+ 	cs = JSON_string_start;
+ 	}
+ 
+-#line 525 "parser.rl"
++#line 533 "parser.rl"
+     json->memo = p;
+ 
+-#line 1513 "parser.c"
++#line 1521 "parser.c"
+ 	{
+ 	if ( p == pe )
+ 		goto _test_eof;
+@@ -1534,7 +1542,7 @@ case 2:
+ 		goto st0;
+ 	goto st2;
+ tr2:
+-#line 490 "parser.rl"
++#line 498 "parser.rl"
+ 	{
+         *result = json_string_unescape(*result, json->memo + 1, p);
+         if (NIL_P(*result)) {
+@@ -1545,14 +1553,14 @@ tr2:
+             {p = (( p + 1))-1;}
+         }
+     }
+-#line 501 "parser.rl"
++#line 509 "parser.rl"
+ 	{ p--; {p++; cs = 8; goto _out;} }
+ 	goto st8;
+ st8:
+ 	if ( ++p == pe )
+ 		goto _test_eof8;
+ case 8:
+-#line 1556 "parser.c"
++#line 1564 "parser.c"
+ 	goto st0;
+ st3:
+ 	if ( ++p == pe )
+@@ -1628,7 +1636,7 @@ case 7:
+ 	_out: {}
+ 	}
+ 
+-#line 527 "parser.rl"
++#line 535 "parser.rl"
+ 
+     if (json->create_additions && RTEST(match_string = json->match_string)) {
+           VALUE klass;
+@@ -1675,7 +1683,7 @@ static VALUE convert_encoding(VALUE sour
+     }
+     FORCE_UTF8(source);
+   } else {
+-    source = rb_str_conv_enc(source, NULL, rb_utf8_encoding());
++    source = rb_str_conv_enc(source, rb_enc_get(source), rb_utf8_encoding());
+   }
+ #endif
+     return source;
+@@ -1808,7 +1816,7 @@ static VALUE cParser_initialize(int argc
+ }
+ 
+ 
+-#line 1812 "parser.c"
++#line 1820 "parser.c"
+ enum {JSON_start = 1};
+ enum {JSON_first_final = 10};
+ enum {JSON_error = 0};
+@@ -1816,7 +1824,7 @@ enum {JSON_error = 0};
+ enum {JSON_en_main = 1};
+ 
+ 
+-#line 720 "parser.rl"
++#line 728 "parser.rl"
+ 
+ 
+ /*
+@@ -1833,16 +1841,16 @@ static VALUE cParser_parse(VALUE self)
+   GET_PARSER;
+ 
+ 
+-#line 1837 "parser.c"
++#line 1845 "parser.c"
+ 	{
+ 	cs = JSON_start;
+ 	}
+ 
+-#line 736 "parser.rl"
++#line 744 "parser.rl"
+   p = json->source;
+   pe = p + json->len;
+ 
+-#line 1846 "parser.c"
++#line 1854 "parser.c"
+ 	{
+ 	if ( p == pe )
+ 		goto _test_eof;
+@@ -1876,7 +1884,7 @@ st0:
+ cs = 0;
+ 	goto _out;
+ tr2:
+-#line 712 "parser.rl"
++#line 720 "parser.rl"
+ 	{
+         char *np = JSON_parse_value(json, p, pe, &result, 0);
+         if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;}
+@@ -1886,7 +1894,7 @@ st10:
+ 	if ( ++p == pe )
+ 		goto _test_eof10;
+ case 10:
+-#line 1890 "parser.c"
++#line 1898 "parser.c"
+ 	switch( (*p) ) {
+ 		case 13: goto st10;
+ 		case 32: goto st10;
+@@ -1975,7 +1983,7 @@ case 9:
+ 	_out: {}
+ 	}
+ 
+-#line 739 "parser.rl"
++#line 747 "parser.rl"
+ 
+   if (cs >= JSON_first_final && p == pe) {
+     return result;
+Index: ruby-2.4.0/ext/json/parser/parser.rl
+===================================================================
+--- ruby-2.4.0.orig/ext/json/parser/parser.rl
++++ ruby-2.4.0/ext/json/parser/parser.rl
+@@ -446,13 +446,21 @@ static VALUE json_string_unescape(VALUE
+                     break;
+                 case 'u':
+                     if (pe > stringEnd - 4) {
+-                        return Qnil;
++                      rb_enc_raise(
++                        EXC_ENCODING eParserError,
++                        "%u: incomplete unicode character escape sequence at '%s'", __LINE__, p
++                      );
+                     } else {
+                         UTF32 ch = unescape_unicode((unsigned char *) ++pe);
+                         pe += 3;
+                         if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
+                             pe++;
+-                            if (pe > stringEnd - 6) return Qnil;
++                            if (pe > stringEnd - 6) {
++                              rb_enc_raise(
++                                EXC_ENCODING eParserError,
++                                "%u: incomplete surrogate pair at '%s'", __LINE__, p
++                                );
++                            }
+                             if (pe[0] == '\\' && pe[1] == 'u') {
+                                 UTF32 sur = unescape_unicode((unsigned char *) pe + 2);
+                                 ch = (((ch & 0x3F) << 10) | ((((ch >> 6) & 0xF) + 1) << 16)
+@@ -570,7 +578,7 @@ static VALUE convert_encoding(VALUE sour
+     }
+     FORCE_UTF8(source);
+   } else {
+-    source = rb_str_conv_enc(source, NULL, rb_utf8_encoding());
++    source = rb_str_conv_enc(source, rb_enc_get(source), rb_utf8_encoding());
+   }
+ #endif
+     return source;
+Index: ruby-2.4.0/test/json/json_encoding_test.rb
+===================================================================
+--- ruby-2.4.0.orig/test/json/json_encoding_test.rb
++++ ruby-2.4.0/test/json/json_encoding_test.rb
+@@ -79,6 +79,8 @@ class JSONEncodingTest < Test::Unit::Tes
+     json = '["\ud840\udc01"]'
+     assert_equal json, generate(utf8, :ascii_only => true)
+     assert_equal utf8, parse(json)
++    assert_raise(JSON::ParserError) { parse('"\u"') }
++    assert_raise(JSON::ParserError) { parse('"\ud800"') }
+   end
+ 
+   def test_chars
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9224.patch b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9224.patch
new file mode 100644
index 0000000..848139b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9224.patch
@@ -0,0 +1,41 @@
+From 690313a061f7a4fa614ec5cc8368b4f2284e059b Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <kosako@sofnec.co.jp>
+Date: Tue, 23 May 2017 10:28:58 +0900
+Subject: [PATCH] fix #57 : DATA_ENSURE() check must be before data access
+
+---
+ regexec.c |    5 -----
+ 1 file changed, 5 deletions(-)
+
+--- end of original header
+
+CVE: CVE-2017-9224
+
+Context modified so that patch applies for version 2.4.1.
+
+Upstream-Status: Pending
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+diff --git a/regexec.c b/regexec.c
+index 35fef11..d4e577d 100644
+--- a/regexec.c
++++ b/regexec.c
+@@ -1473,14 +1473,9 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
+       NEXT;
+
+     CASE(OP_EXACT1)  MOP_IN(OP_EXACT1);
+-#if 0
+       DATA_ENSURE(1);
+       if (*p != *s) goto fail;
+       p++; s++;
+-#endif
+-      if (*p != *s++) goto fail;
+-      DATA_ENSURE(0);
+-      p++;
+       MOP_OUT;
+       break;
+ 
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch
new file mode 100644
index 0000000..0f2a430
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch
@@ -0,0 +1,41 @@
+From b4bf968ad52afe14e60a2dc8a95d3555c543353a Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <kosako@sofnec.co.jp>
+Date: Thu, 18 May 2017 17:05:27 +0900
+Subject: [PATCH] fix #55 : check too big code point value for single byte
+ value in next_state_val()
+
+---
+ regparse.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- end of original header
+
+CVE: CVE-2017-9226
+
+Add check for octal number bigger than 255.
+
+Upstream-Status: Pending
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+--- ruby-2.4.1.orig/regparse.c
++++ ruby-2.4.1/regparse.c
+@@ -3644,7 +3644,7 @@ fetch_token(OnigToken* tok, UChar** src,
+       if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
+ 	prev = p;
+ 	num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc);
+-	if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
++	if (num < 0 || 0xff < num) return ONIGERR_TOO_BIG_NUMBER;
+ 	if (p == prev) {  /* can't read nothing. */
+ 	  num = 0; /* but, it's not error */
+ 	}
+@@ -4450,6 +4450,9 @@ next_state_val(CClassNode* cc, CClassNod
+   switch (*state) {
+   case CCS_VALUE:
+     if (*type == CCV_SB) {
++      if (*vs > 0xff)
++          return ONIGERR_INVALID_CODE_POINT_VALUE;
++
+       BITSET_SET_BIT_CHKDUP(cc->bs, (int )(*vs));
+       if (IS_NOT_NULL(asc_cc))
+ 	BITSET_SET_BIT(asc_cc->bs, (int )(*vs));
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9227.patch b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9227.patch
new file mode 100644
index 0000000..85e7ccb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9227.patch
@@ -0,0 +1,32 @@
+From 9690d3ab1f9bcd2db8cbe1fe3ee4a5da606b8814 Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <kosako@sofnec.co.jp>
+Date: Tue, 23 May 2017 16:15:35 +0900
+Subject: [PATCH] fix #58 : access to invalid address by reg->dmin value
+
+---
+ regexec.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- end of original header
+
+CVE: CVE-2017-9227
+
+Upstream-Status: Inappropriate [not author]
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/regexec.c b/regexec.c
+index d4e577d..2fa0f3d 100644
+--- a/regexec.c
++++ b/regexec.c
+@@ -3154,6 +3154,8 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
+     }
+     else {
+       UChar *q = p + reg->dmin;
++
++      if (q >= end) return 0; /* fail */
+       while (p < q) p += enclen(reg->enc, p, end);
+     }
+   }
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch
new file mode 100644
index 0000000..d8bfba4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch
@@ -0,0 +1,34 @@
+From 3b63d12038c8d8fc278e81c942fa9bec7c704c8b Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <kosako@sofnec.co.jp>
+Date: Wed, 24 May 2017 13:43:25 +0900
+Subject: [PATCH] fix #60 : invalid state(CCS_VALUE) in parse_char_class()
+
+---
+ regparse.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9228
+
+Upstream-Status: Inappropriate [not author]
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/regparse.c b/regparse.c
+index 69875fa..1988747 100644
+--- a/regparse.c
++++ b/regparse.c
+@@ -4081,7 +4081,9 @@ next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,
+     }
+   }
+ 
+-  *state = CCS_VALUE;
++  if (*state != CCS_START)
++    *state = CCS_VALUE;
++
+   *type  = CCV_CLASS;
+   return 0;
+ }
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9229.patch b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9229.patch
new file mode 100644
index 0000000..6e765bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9229.patch
@@ -0,0 +1,59 @@
+From b690371bbf97794b4a1d3f295d4fb9a8b05d402d Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <kosako@sofnec.co.jp>
+Date: Wed, 24 May 2017 10:27:04 +0900
+Subject: [PATCH] fix #59 : access to invalid address by reg->dmax value
+
+---
+ regexec.c |   27 +++++++++++++++++----------
+ 1 file changed, 17 insertions(+), 10 deletions(-)
+
+--- end of original header
+
+CVE: CVE-2017-9229
+
+Upstream-Status: Inappropriate [not author]
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/regexec.c b/regexec.c
+index 49bcc50..c0626ef 100644
+--- a/regexec.c
++++ b/regexec.c
+@@ -3756,18 +3756,25 @@ forward_search_range(regex_t* reg, const
+     }
+     else {
+       if (reg->dmax != ONIG_INFINITE_DISTANCE) {
+-	*low = p - reg->dmax;
+-	if (*low > s) {
+-	  *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
+-							      *low, end, (const UChar** )low_prev);
+-	  if (low_prev && IS_NULL(*low_prev))
+-	    *low_prev = onigenc_get_prev_char_head(reg->enc,
+-						   (pprev ? pprev : s), *low, end);
++        if (p - str < reg->dmax) {
++          *low = (UChar* )str;
++          if (low_prev)
++            *low_prev = onigenc_get_prev_char_head(reg->enc, str, *low, end);
+ 	}
+ 	else {
+-	  if (low_prev)
+-	    *low_prev = onigenc_get_prev_char_head(reg->enc,
+-					       (pprev ? pprev : str), *low, end);
++          *low = p - reg->dmax;
++          if (*low > s) {
++            *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
++                                                 *low, end, (const UChar** )low_prev);
++            if (low_prev && IS_NULL(*low_prev))
++              *low_prev = onigenc_get_prev_char_head(reg->enc,
++                                                     (pprev ? pprev : s), *low, end);
++          }
++          else {
++            if (low_prev)
++              *low_prev = onigenc_get_prev_char_head(reg->enc,
++                                                     (pprev ? pprev : str), *low, end);
++          }
+ 	}
+       }
+     }
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.5.bb
deleted file mode 100644
index 5a64582..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.5.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-require ruby.inc
-
-SRC_URI[md5sum] = "bd8e349d4fb2c75d90817649674f94be"
-SRC_URI[sha256sum] = "30c4b31697a4ca4ea0c8db8ad30cf45e6690a0f09687e5d483c933c03ca335e3"
-
-# it's unknown to configure script, but then passed to extconf.rb
-# maybe it's not really needed as we're hardcoding the result with
-# 0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch
-UNKNOWN_CONFIGURE_WHITELIST += "--enable-wide-getaddrinfo"
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
-
-PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
-PACKAGECONFIG[gpm] = "--with-gmp=yes, --with-gmp=no, gmp"
-PACKAGECONFIG[ipv6] = ",--enable-wide-getaddrinfo,"
-
-EXTRA_OECONF = "\
-    --disable-versioned-paths \
-    --disable-rpath \
-    --disable-dtrace \
-    --enable-shared \
-    --enable-load-relative \
-"
-
-do_install() {
-    oe_runmake 'DESTDIR=${D}' install
-}
-
-PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
-
-SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
-RDEPENDS_${PN}-ri-docs = "${PN}"
-FILES_${PN}-ri-docs += "${datadir}/ri"
-
-SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source"
-RDEPENDS_${PN}-rdoc = "${PN}"
-FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
-
-FILES_${PN} += "${datadir}/rubygems"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.4.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.4.0.bb
new file mode 100644
index 0000000..8cc52d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.4.0.bb
@@ -0,0 +1,53 @@
+require ruby.inc
+
+SRC_URI += " \
+           file://ruby-CVE-2017-9224.patch \
+           file://ruby-CVE-2017-9226.patch \
+           file://ruby-CVE-2017-9227.patch \
+           file://ruby-CVE-2017-9228.patch \
+           file://ruby-CVE-2017-9229.patch \
+           file://CVE-2017-14064.patch \
+           "
+
+SRC_URI[md5sum] = "7e9485dcdb86ff52662728de2003e625"
+SRC_URI[sha256sum] = "152fd0bd15a90b4a18213448f485d4b53e9f7662e1508190aa5b702446b29e3d"
+
+# it's unknown to configure script, but then passed to extconf.rb
+# maybe it's not really needed as we're hardcoding the result with
+# 0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch
+UNKNOWN_CONFIGURE_WHITELIST += "--enable-wide-getaddrinfo"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+
+PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
+PACKAGECONFIG[gpm] = "--with-gmp=yes, --with-gmp=no, gmp"
+PACKAGECONFIG[ipv6] = ",--enable-wide-getaddrinfo,"
+
+EXTRA_AUTORECONF += "--exclude=aclocal"
+
+EXTRA_OECONF = "\
+    --disable-versioned-paths \
+    --disable-rpath \
+    --disable-dtrace \
+    --enable-shared \
+    --enable-load-relative \
+"
+
+do_install() {
+    oe_runmake 'DESTDIR=${D}' install
+}
+
+PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
+
+SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
+RDEPENDS_${PN}-ri-docs = "${PN}"
+FILES_${PN}-ri-docs += "${datadir}/ri"
+
+SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source"
+RDEPENDS_${PN}-rdoc = "${PN}"
+FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
+
+FILES_${PN} += "${datadir}/rubygems"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
index 04ba394..50c0a1a 100755
--- a/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
+++ b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -16,23 +16,25 @@
 for pm in $backend_list; do
 	pi_dir="#SYSCONFDIR#/$pm-postinsts"
 
-	[ -d $pi_dir ] && break
+	if [ ! -d $pi_dir ]; then
+		continue
+	fi
 
+	# found the package manager, it has postinsts
 	case $pm in
 		"deb")
 			if [ -s "#LOCALSTATEDIR#/lib/dpkg/status" ]; then
 				pm_installed=true
-				break
 			fi
 			;;
 
 		"ipk")
-			if [ -s "/var/lib/opkg/status" ]; then
+			if [ -s "#LOCALSTATEDIR#/lib/opkg/status" ]; then
 				pm_installed=true
-				break
 			fi
 			;;
 	esac
+	break
 done
 
 remove_rcsd_link () {
@@ -46,6 +48,9 @@
 	exit 0
 fi
 
+echo "Configuring packages on first boot...."
+echo " (This may take several minutes. Please do not power off the machine.)"
+
 [ -e #SYSCONFDIR#/default/postinst ] && . #SYSCONFDIR#/default/postinst
 
 if [ "$POSTINST_LOGGING" = "1" ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
index 11c94e5..31c98ec 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
@@ -2,8 +2,7 @@
 SECTION = "devel"
 PR = "r9"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 SRC_URI = "file://run-postinsts \
            file://run-postinsts.init \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch
deleted file mode 100644
index 1f39b03..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Patch obtained from OpenEmbedded.
-
-Upstream-Status: Pending
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
---- sgml-common-0.6.3/bin/Makefile.am~autohell.patch	2001-01-30 15:42:21.000000000 +0100
-+++ sgml-common-0.6.3/bin/Makefile.am	2004-06-17 11:51:11.000000000 +0200
-@@ -1,6 +1,5 @@
- primitive_scripts = sgmlwhich
- 
--bindir = $(prefix)/bin
- bin_SCRIPTS = install-catalog $(primitive_scripts)
- 
- EXTRA_DIST =  install-catalog.in $(primitive_scripts)
---- /dev/null	2003-09-23 19:59:22.000000000 +0200
-+++ sgml-common-0.6.3/bin/sgmlwhich.in	2004-06-17 11:51:11.000000000 +0200
-@@ -0,0 +1,7 @@
-+#!/bin/sh
-+# Location of the main configuration file for consistency with non-LSB platforms
-+# Send any comments to Eric Bischoff <eric@caldera.de>
-+# This program is under GPL license. See LICENSE file for details.
-+
-+echo "@sysconfdir@/sgml/sgml.conf"
-+# Simple, isn't it? ;-)
---- /dev/null	2003-09-23 19:59:22.000000000 +0200
-+++ sgml-common-0.6.3/config/sgml.conf.in	2004-06-17 11:51:11.000000000 +0200
-@@ -0,0 +1,2 @@
-+SGML_BASE_DIR=@datadir@/sgml
-+SGML_CATALOGS_DIR=@sysconfdir@/sgml
---- sgml-common-0.6.3/configure.in~autohell.patch	2001-05-25 18:40:54.000000000 +0200
-+++ sgml-common-0.6.3/configure.in	2004-06-17 11:53:22.000000000 +0200
-@@ -3,11 +3,6 @@
- 
- AM_INIT_AUTOMAKE(sgml-common, 0.6.3)
- 
--docdir='$(prefix)/doc'
--AC_SUBST(docdir)
--
--dnl Checks for programs.
--
- dnl Checks for libraries.
- 
- dnl Checks for header files.
-@@ -18,6 +13,5 @@
- 
- AC_OUTPUT(Makefile \
-           bin/Makefile bin/install-catalog \
--          config/Makefile \
--          doc/Makefile doc/HTML/Makefile doc/man/Makefile doc/refentry/Makefile \
-+          config/Makefile config/sgml.conf bin/sgmlwhich \
-           sgml-iso-entities/Makefile xml-iso-entities/Makefile)
-
---- sgml-common-0.6.3/Makefile.am~no-docs	2001-05-25 18:22:01.000000000 +0200
-+++ sgml-common-0.6.3/Makefile.am	2004-06-17 11:49:09.000000000 +0200
-@@ -1,4 +1,4 @@
--SUBDIRS = bin config doc sgml-iso-entities xml-iso-entities
-+SUBDIRS = bin config sgml-iso-entities xml-iso-entities
- 
- sgmlcodir = $(prefix)/share/sgml
- sgmlco_DATA = xml.dcl
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch
deleted file mode 100644
index 54b3f54..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-The COPYING file sgml-common ships with is just a symlink to
-/usr/share/automake/COPYING, which means we can't verify it
-using our normal means. We workaround this by using this patch
-to create our own license file. 
-
-Upstream was notified about this on 2011-01-24. When upgrading
-this recipe, this should be fixed and you should remove this
-patch.
-
-Upstream-Status: Pending
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
-diff -urN sgml-common-0.6.3.orig/LICENSE-GPLv2 sgml-common-0.6.3/LICENSE-GPLv2
---- sgml-common-0.6.3.orig/LICENSE-GPLv2	1969-12-31 16:00:00.000000000 -0800
-+++ sgml-common-0.6.3/LICENSE-GPLv2	2011-01-28 17:05:17.299528001 -0800
-@@ -0,0 +1,12 @@
-+Copyright (C) 1997 Christian Schwarz <schwarz@debian.org>.
-+Copyright (C) 2001-2004 Ardo van Rangelrooij <ardo@debian.org>
-+
-+This is free software; you may redistribute it and/or modify it under
-+the terms of the GNU General Public License as published by the Free
-+Software Foundation; either version 2, or (at your option) any later
-+version.
-+
-+This is distributed in the hope that it will be useful, but without
-+any warranty; without even the implied warranty of merchantability or
-+fitness for a particular purpose.  See the GNU General Public License
-+for more details.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb
deleted file mode 100644
index 97b308a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb
+++ /dev/null
@@ -1,70 +0,0 @@
-SUMMARY = "Base utilities for working with SGML and XML"
-DESCRIPTION = "The sgml-common package gathers very basic \
-stuff necessary to work with SGML and XML, such as xml.dcl, \
-a SGML declaration of XML; iso-entities, a list of the basic \
-SGML ISO entities; and install-catalog, a script used to \
-add entries to (or remove entries from) centralized catalogs \
-whose entries are pointers to SGML open catalogs, \
-as defined by OASIS."
-HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
-LICENSE = "GPLv2+"
-# See the comments in license.patch when upgrading this recipe.
-# This is inteded to be a temporary workaround.
-LIC_FILES_CHKSUM = "file://LICENSE-GPLv2;md5=ab8a50abe86dfc859e148baae043c89b"
-SECTION = "base"
-
-PR = "r1"
-
-require sgml-common_${PV}.bb
-inherit native
-
-S = "${WORKDIR}/sgml-common-${PV}"
-
-SYSROOT_PREPROCESS_FUNCS += "sgml_common_native_mangle"
-SSTATEPOSTINSTFUNCS += "sgml_common_sstate_postinst"
-
-do_install_append() {
-	# install-catalog script contains hard-coded references to
-	# {sysconfdir}. Change it to ${D}${sysconfdir}.
-	sed -i -e "s|${sysconfdir}/sgml|${D}${sysconfdir}/sgml|g" ${D}${bindir}/install-catalog
-
-	${D}${bindir}/install-catalog \
-		--add ${D}${sysconfdir}/sgml/sgml-ent.cat \
-		${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
-
-	# The sgml-docbook.cat will be regenerated by sstate_postinst
-	rm -f ${D}${sysconfdir}/sgml/sgml-docbook.cat
-}
-
-sgml_common_native_mangle () {
-	# Revert back to ${sysconfdir} path in install-catalog
-	sed -i -e "s|${D}${sysconfdir}/sgml|${sysconfdir}/sgml|g" ${SYSROOT_DESTDIR}${STAGING_BINDIR}/install-catalog
-	# Change path from ${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog to ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog in sgml-ent.cat
-	sed -i -e "s|${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog|${datadir}/sgml/sgml-iso-entities-8879.1986/catalog|g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/sgml-ent.cat
-	# Remove ${D} path from catalog file created by install-catalog script
-	sed -i -e "s|${D}||g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/catalog
-}
-
-sgml_common_sstate_postinst() {
-	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
-	then
-		${bindir}/install-catalog --add ${sysconfdir}/sgml/sgml-docbook.cat ${sysconfdir}/sgml/sgml-ent.cat
-		if [ -e ${sysconfdir}/sgml/sgml-docbook.bak ]; then
-			for catalog in `awk '{print $2}' ${sysconfdir}/sgml/sgml-docbook.bak`; do
-				if [ ! `grep $catalog ${sysconfdir}/sgml/sgml-docbook.cat 1> /dev/null 2>&1` ]; then
-					${bindir}/install-catalog \
-						--add ${sysconfdir}/sgml/sgml-docbook.cat $catalog
-				fi
-			done
-		fi
-		cat << EOF > ${SSTATE_INST_POSTRM}
-#!/bin/sh
-
-# Ensure that the catalog file sgml-docbook.cat is properly
-# updated when the package is removed from sstate cache.
-if [ -f ${sysconfdir}/sgml/sgml-docbook.cat ]; then
-	sed -i '/\/sgml\/sgml-ent.cat/d' ${sysconfdir}/sgml/sgml-docbook.cat
-fi
-EOF
-	fi
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb
deleted file mode 100644
index 64a6b92..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb
+++ /dev/null
@@ -1,68 +0,0 @@
-SUMMARY = "Base utilities for working with SGML and XML"
-DESCRIPTION = "The sgml-common package gathers very basic \
-stuff necessary to work with SGML and XML, such as xml.dcl, \
-a SGML declaration of XML; iso-entities, a list of the basic \
-SGML ISO entities; and install-catalog, a script used to \
-add entries to (or remove entries from) centralized catalogs \
-whose entries are pointers to SGML open catalogs, \
-as defined by OASIS."
-HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
-LICENSE = "GPLv2+"
-# See the comments in license.patch when upgrading this recipe.
-# This is inteded to be a temporary workaround.
-LIC_FILES_CHKSUM = "file://LICENSE-GPLv2;md5=ab8a50abe86dfc859e148baae043c89b"
-SECTION = "base"
-
-PR = "r1"
-
-SRC_URI = "https://ftp.osuosl.org/pub/blfs/conglomeration/sgml-common/sgml-common-${PV}.tgz \
-           file://autohell.patch \
-           file://license.patch"
-
-SRC_URI[md5sum] = "103c9828f24820df86e55e7862e28974"
-SRC_URI[sha256sum] = "7dc418c1d361123ffc5e45d61f1b97257940a8eb35d0bfbbc493381cc5b1f959"
-
-inherit autotools
-
-do_compile_append() {
-	# install-catalog script contains hardcoded references to /etc/sgml
-	sed -i -e 's|\([ "]\+\)/etc/sgml|\1${sysconfdir}/sgml|g' bin/install-catalog
-}
-
-FILES_${PN} += "${datadir}/sgml"
-
-pkg_postinst_${PN}() {
-    if [ "x$D" = "x" ]; then
-	install-catalog \
-		--add ${sysconfdir}/sgml/sgml-ent.cat \
-		${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
-
-	install-catalog \
-		--add ${sysconfdir}/sgml/sgml-docbook.cat \
-		${sysconfdir}/sgml/sgml-ent.cat
-    else
-	if ! grep -q ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog $D${sysconfdir}/sgml/sgml-ent.cat; then
-	    echo "CATALOG ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog" >> $D${sysconfdir}/sgml/sgml-ent.cat
-	fi
-	if ! grep -q ${sysconfdir}/sgml/sgml-ent.cat $D${sysconfdir}/sgml/catalog; then
-	    echo "CATALOG ${sysconfdir}/sgml/sgml-ent.cat" >> $D${sysconfdir}/sgml/catalog
-	fi
-
-	if ! grep -q ${sysconfdir}/sgml/sgml-ent.cat $D${sysconfdir}/sgml/sgml-docbook.cat; then
-	    echo "CATALOG ${sysconfdir}/sgml/sgml-ent.cat" >> $D${sysconfdir}/sgml/sgml-docbook.cat
-	fi
-	if ! grep -q ${sysconfdir}/sgml/sgml-docbook.cat $D${sysconfdir}/sgml/catalog; then
-	    echo "CATALOG ${sysconfdir}/sgml/sgml-docbook.cat" >> $D${sysconfdir}/sgml/catalog
-	fi
-    fi
-}
-
-pkg_postrm_${PN}() {
-	install-catalog \
-		--remove ${sysconfdir}/sgml/sgml-ent.cat \
-		${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
-
-	install-catalog \
-		--remove ${sysconfdir}/sgml/sgml-docbook.cat \
-		${sysconfdir}/sgml/sgml-ent.cat
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb
deleted file mode 100644
index 01581c1..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "A simple post-processor for SGMLS and NSGMLS"
-HOMEPAGE = "https://github.com/gitpan/SGMLSpm"
-SECTION = "libs"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-SRC_URI = "git://github.com/gitpan/SGMLSpm \
-          "
-
-SRCREV = "71595b9b5e36bfc00046995e058926bd27793fef"
-
-PV = "1.1+git${SRCPV}"
-
-S = "${WORKDIR}/git"
-
-inherit native cpan
-
-do_install_append() {
-    ln -s sgmlspl.pl ${D}${bindir}/sgmlspl
-}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-caps-abbrev.awk-fix-gawk-s-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-caps-abbrev.awk-fix-gawk-s-path.patch
new file mode 100644
index 0000000..4f13706
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-caps-abbrev.awk-fix-gawk-s-path.patch
@@ -0,0 +1,49 @@
+From 83757523c50748ea845c1e220b1c3b2080d3cc49 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 9 Feb 2017 01:27:49 -0800
+Subject: [PATCH] caps-abbrev.awk: fix gawk's path
+
+It should be /usr/bin/gawk as other scripts use in this package.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ tests-m32/caps-abbrev.awk  | 2 +-
+ tests-mx32/caps-abbrev.awk | 2 +-
+ tests/caps-abbrev.awk      | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests-m32/caps-abbrev.awk b/tests-m32/caps-abbrev.awk
+index 86de7f2..0535cac 100644
+--- a/tests-m32/caps-abbrev.awk
++++ b/tests-m32/caps-abbrev.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # This file is part of caps strace test.
+ #
+diff --git a/tests-mx32/caps-abbrev.awk b/tests-mx32/caps-abbrev.awk
+index 86de7f2..0535cac 100644
+--- a/tests-mx32/caps-abbrev.awk
++++ b/tests-mx32/caps-abbrev.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # This file is part of caps strace test.
+ #
+diff --git a/tests/caps-abbrev.awk b/tests/caps-abbrev.awk
+index 86de7f2..0535cac 100644
+--- a/tests/caps-abbrev.awk
++++ b/tests/caps-abbrev.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # This file is part of caps strace test.
+ #
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
index 2b76e8a..876c2d8 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
@@ -10,25 +10,26 @@
  2 files changed, 19 insertions(+), 1 deletion(-)
 
 diff --git a/configure.ac b/configure.ac
+index b2b03c6..464a9dc 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -36,7 +36,7 @@ AC_INIT([strace],
+@@ -39,7 +39,7 @@ AC_COPYRIGHT([Copyright (C) 1999-2017 The strace developers.])
  AC_CONFIG_SRCDIR([strace.c])
  AC_CONFIG_AUX_DIR([.])
  AC_CONFIG_HEADERS([config.h])
 -AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests])
 +AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules serial-tests])
+ AM_EXTRA_RECURSIVE_TARGETS([check-valgrind])
  AM_MAINTAINER_MODE
  AC_CANONICAL_HOST
- 
 diff --git a/tests/Makefile.am b/tests/Makefile.am
-index 9023029..e1917fa 100644
+index 311d3bb..72f9022 100644
 --- a/tests/Makefile.am
 +++ b/tests/Makefile.am
-@@ -784,3 +784,21 @@ ksysent.h: $(srcdir)/ksysent.sed
- 
- BUILT_SOURCES = ksysent.h
+@@ -960,3 +960,21 @@ $(objects): scno.h
  CLEANFILES = ksysent.h $(TESTS:=.tmp)
+ 
+ include ../scno.am
 +
 +buildtest-TESTS: $(check_PROGRAMS) $(TESTS)
 +
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch
index 7bc1436..76daf3a 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch
@@ -5,16 +5,16 @@
 
 Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
 
-Index: strace-4.10/configure.ac
-===================================================================
---- strace-4.10.orig/configure.ac
-+++ strace-4.10/configure.ac
-@@ -1,7 +1,7 @@
- dnl Process this file with autoconf to create configure.  Use autoreconf.
+diff --git a/configure.ac b/configure.ac
+index 7004bd3..b2b03c6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -31,7 +31,7 @@
+ 
  AC_PREREQ(2.57)
  AC_INIT([strace],
 -	m4_esyscmd([./git-version-gen .tarball-version]),
 +	m4_esyscmd_s([cat .tarball-version]),
- 	[strace-devel@lists.sourceforge.net])
- AC_CONFIG_SRCDIR([strace.c])
- AC_CONFIG_AUX_DIR([.])
+ 	[strace-devel@lists.sourceforge.net],
+ 	[strace],
+ 	[https://strace.io])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch
deleted file mode 100644
index db83d11..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 2995245d7e3f46e8b3995002995ebd28beca7d55 Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <armccurdy@gmail.com>
-Date: Fri, 5 Feb 2016 14:00:00 -0800
-Subject: [PATCH] use <asm/sgidefs.h>
-
-Build fix for MIPS with musl libc.
-
-The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
-but not by musl. Regardless of the libc, the kernel headers provide
-<asm/sgidefs.h> which provides the same definitions, so use that
-instead.
-
-Upstream-Status: Pending
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
----
- configure.ac | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 1524b9b..287e03d 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -196,20 +196,20 @@ AC_SUBST(arch_mx32)
- if test "$arch" = mips; then
- 	AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
- 		       [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM],
--				       [#include <sgidefs.h>],
-+				       [#include <asm/sgidefs.h>],
- 				       [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
- 
- 	AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
- 		[AC_COMPILE_IFELSE(
--			[AC_LANG_PROGRAM([[#include <sgidefs.h>]],
-+			[AC_LANG_PROGRAM([[#include <asm/sgidefs.h>]],
- 					 [[int i[_MIPS_SIM == _MIPS_SIM_ABI32 ? 1 : - 1];]])],
- 			[st_cv_mips_abi=o32],
- 		[AC_COMPILE_IFELSE(
--			[AC_LANG_PROGRAM([[#include <sgidefs.h>]],
-+			[AC_LANG_PROGRAM([[#include <asm/sgidefs.h>]],
- 					 [[int i[_MIPS_SIM == _MIPS_SIM_NABI32 ? 1 : - 1];]])],
- 			[st_cv_mips_abi=n32],
- 		[AC_COMPILE_IFELSE(
--			[AC_LANG_PROGRAM([[#include <sgidefs.h>]],
-+			[AC_LANG_PROGRAM([[#include <asm/sgidefs.h>]],
- 					 [[int i[_MIPS_SIM == _MIPS_SIM_ABI64 ? 1 : - 1];]])],
- 			[st_cv_mips_abi=n64],
- 			[st_cv_mips_abi=unknown])])])])
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.13.bb b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.13.bb
deleted file mode 100644
index cae7f21..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.13.bb
+++ /dev/null
@@ -1,49 +0,0 @@
-SUMMARY = "System call tracing tool"
-HOMEPAGE = "http://strace.sourceforge.net"
-SECTION = "console/utils"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=124500c21e856f0912df29295ba104c7"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \
-           file://disable-git-version-gen.patch \
-           file://more-robust-test-for-m32-mx32-compile-support.patch \
-           file://update-gawk-paths.patch \
-           file://use-asm-sgidefs.h.patch \
-           file://Makefile-ptest.patch \
-           file://run-ptest \
-           file://0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch \
-           file://mips-SIGEMT.patch \
-           "
-
-SRC_URI[md5sum] = "4b78c7febdd24c79d5147824d1a080a3"
-SRC_URI[sha256sum] = "d48f732576c91ece36a5843d63f9be054c40ef59f1e4773986042636861625d7"
-
-inherit autotools ptest bluetooth
-
-RDEPENDS_${PN}-ptest += "make coreutils grep gawk sed"
-
-PACKAGECONFIG_class-target ??= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
-"
-
-PACKAGECONFIG[bluez] = "ac_cv_header_bluetooth_bluetooth_h=yes,ac_cv_header_bluetooth_bluetooth_h=no,${BLUEZ}"
-PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind"
-
-TESTDIR = "tests"
-
-do_install_append() {
-	# We don't ship strace-graph here because it needs perl
-	rm ${D}${bindir}/strace-graph
-}
-
-do_compile_ptest() {
-	oe_runmake -C ${TESTDIR} buildtest-TESTS
-}
-
-do_install_ptest() {
-	oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR}
-	sed -i -e '/^src/s/strace.*[1-9]/ptest/' ${D}/${PTEST_PATH}/${TESTDIR}/Makefile
-}
-
-BBCLASSEXTEND = "native"
-TOOLCHAIN = "gcc"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.16.bb b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.16.bb
new file mode 100644
index 0000000..b6cd2ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.16.bb
@@ -0,0 +1,49 @@
+SUMMARY = "System call tracing tool"
+HOMEPAGE = "http://strace.sourceforge.net"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=488acb3aaaf5d14a2e1a852d13668a70"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \
+           file://disable-git-version-gen.patch \
+           file://more-robust-test-for-m32-mx32-compile-support.patch \
+           file://update-gawk-paths.patch \
+           file://Makefile-ptest.patch \
+           file://run-ptest \
+           file://0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch \
+           file://mips-SIGEMT.patch \
+           file://0001-caps-abbrev.awk-fix-gawk-s-path.patch \
+           "
+
+SRC_URI[md5sum] = "2873366cac98770efcbed6e748d5ef23"
+SRC_URI[sha256sum] = "98487cb5178ec1259986cc9f6e2a844f50e5d1208c112cc22431a1e4d9adf0ef"
+
+inherit autotools ptest bluetooth
+
+RDEPENDS_${PN}-ptest += "make coreutils grep gawk sed"
+
+PACKAGECONFIG_class-target ??= "\
+    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+"
+
+PACKAGECONFIG[bluez] = "ac_cv_header_bluetooth_bluetooth_h=yes,ac_cv_header_bluetooth_bluetooth_h=no,${BLUEZ}"
+PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind"
+
+TESTDIR = "tests"
+
+do_install_append() {
+	# We don't ship strace-graph here because it needs perl
+	rm ${D}${bindir}/strace-graph
+}
+
+do_compile_ptest() {
+	oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+	oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR}
+	sed -i -e '/^src/s/strace.*[1-9]/ptest/' ${D}/${PTEST_PATH}/${TESTDIR}/Makefile
+}
+
+BBCLASSEXTEND = "native"
+TOOLCHAIN = "gcc"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-fix-svnadmin-create-fail-on-x86.patch b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-fix-svnadmin-create-fail-on-x86.patch
deleted file mode 100644
index d440528..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-fix-svnadmin-create-fail-on-x86.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 09475e0befca8d120c957177ce8568fa2209a1a9 Mon Sep 17 00:00:00 2001
-From: Dengke Du <dengke.du@windriver.com>
-Date: Wed, 2 Nov 2016 11:09:44 +0800
-Subject: [PATCH] fix "svnadmin create" fail on x86
-
-When run the following command on x86:
-
-        svnadmin create /var/test_repo
-
-It cause segmentation fault error like the following:
-
-        [16499.751837] svnadmin[21117]: segfault at 83 ip 00000000f74bf7f6 sp 00000000ffdd9b34 error 4 in libc-2.24.so[f7441000+1af000]
-        Segmentation fault (core dumped)
-
-This is because in source code ./subversion/libsvn_fs_fs/low_level.c,
-function svn_fs_fs__unparse_footer, when:
-
-        target arch:    x86
-        apr_off_t:      4 bytes
-
-if the "APR_OFF_T_FMT" is "lld", it still use type "apr_off_t" to pass
-data to apr, but in apr source code file apr_snprintf.c the function
-apr_vformatter meet "lld", it would use the:
-
-        i_quad = va_arg(ap, apr_int64_t);
-
-It uses the apr_int64_t to deal data, it read 8 bytes, so the follow-up
-data may be error.
-
-Upstream-Status: Pending
-
-Signed-off-by: Dengke Du <dengke.du@windriver.com>
----
- subversion/libsvn_fs_fs/low_level.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/subversion/libsvn_fs_fs/low_level.c b/subversion/libsvn_fs_fs/low_level.c
-index a27bbcc..6ddbe28 100644
---- a/subversion/libsvn_fs_fs/low_level.c
-+++ b/subversion/libsvn_fs_fs/low_level.c
-@@ -250,10 +250,10 @@ svn_fs_fs__unparse_footer(apr_off_t l2p_offset,
- {
-   return svn_stringbuf_createf(result_pool,
-                                "%" APR_OFF_T_FMT " %s %" APR_OFF_T_FMT " %s",
--                               l2p_offset,
-+                               (APR_OFF_T_FMT=="lld") ? (apr_int64_t)l2p_offset : l2p_offset,
-                                svn_checksum_to_cstring(l2p_checksum,
-                                                        scratch_pool),
--                               p2l_offset,
-+                               (APR_OFF_T_FMT=="lld") ? (apr_int64_t)p2l_offset : p2l_offset,
-                                svn_checksum_to_cstring(p2l_checksum,
-                                                        scratch_pool));
- }
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.4.bb
deleted file mode 100644
index 3e35940..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.4.bb
+++ /dev/null
@@ -1,56 +0,0 @@
-SUMMARY = "Subversion (svn) version control system client"
-SECTION = "console/network"
-DEPENDS = "apr-util serf sqlite3 file"
-DEPENDS_append_class-native = " file-replacement-native"
-RDEPENDS_${PN} = "serf"
-LICENSE = "Apache-2"
-HOMEPAGE = "http://subversion.tigris.org"
-
-BBCLASSEXTEND = "native"
-
-inherit gettext
-
-SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
-           file://disable_macos.patch \
-           file://serf.m4-Regex-modified-to-allow-D-in-paths.patch \
-           file://0001-Fix-libtool-name-in-configure.ac.patch \
-           file://0001-fix-svnadmin-create-fail-on-x86.patch \
-           file://serfmacro.patch \
-           "
-
-SRC_URI[md5sum] = "29121a038f87641055a8183f49e9739f"
-SRC_URI[sha256sum] = "1267f9e2ab983f260623bee841e6c9cc458bf4bf776238ed5f100983f79e9299"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=af81ae49ba359e70626c05e9bf313709"
-
-PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl"
-PACKAGECONFIG[gnome-keyring] = "--with-gnome-keyring,--without-gnome-keyring,glib-2.0 gnome-keyring"
-
-EXTRA_OECONF = " \
-                --without-berkeley-db --without-apxs \
-                --without-swig --with-apr=${STAGING_BINDIR_CROSS} \
-                --with-apr-util=${STAGING_BINDIR_CROSS} \
-                --disable-keychain \
-                ac_cv_path_RUBY=none"
-
-inherit autotools
-
-export LDFLAGS += " -L${STAGING_LIBDIR} "
-CPPFLAGS += "-P"
-BUILD_CPPFLAGS += "-P"
-
-acpaths = "-I build/ -I build/ac-macros/"
-
-do_configure_prepend () {
-	rm -f ${S}/libtool
-	rm -f ${S}/build/libtool.m4 ${S}/build/ltmain.sh ${S}/build/ltoptions.m4 ${S}/build/ltsugar.m4 ${S}/build/ltversion.m4 ${S}/build/lt~obsolete.m4
-	rm -f ${S}/aclocal.m4
-	sed -i -e 's:with_sasl="/usr/local":with_sasl="${STAGING_DIR}":' ${S}/build/ac-macros/sasl.m4
-}
-
-#| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_local/libsvn_ra_local-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_repos/libsvn_repos-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| /usr/bin/ld: cannot find -lsvn_delta-1| collect2: ld returned 1 exit status| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_svn/libsvn_ra_svn-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_serf/libsvn_ra_serf-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'
-#| x86_64-linux-libtool: install: error: relink `libsvn_ra_serf-1.la' with the above command before installing it
-#| x86_64-linux-libtool: install: warning: `../../subversion/libsvn_repos/libsvn_repos-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'
-#| /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/subversion-1.8.9/build-outputs.mk:1090: recipe for target 'install-serf-lib' failed
-#| make: *** [install-serf-lib] Error 1
-PARALLEL_MAKEINST = ""
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.5.bb
new file mode 100644
index 0000000..05fba67
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.5.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Subversion (svn) version control system client"
+SECTION = "console/network"
+DEPENDS = "apr-util serf sqlite3 file"
+DEPENDS_append_class-native = " file-replacement-native"
+RDEPENDS_${PN} = "serf"
+LICENSE = "Apache-2"
+HOMEPAGE = "http://subversion.tigris.org"
+
+BBCLASSEXTEND = "native"
+
+inherit gettext
+
+SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
+           file://disable_macos.patch \
+           file://serf.m4-Regex-modified-to-allow-D-in-paths.patch \
+           file://0001-Fix-libtool-name-in-configure.ac.patch \
+           file://serfmacro.patch \
+           "
+
+SRC_URI[md5sum] = "9fcbae352a5efe73d46a88c97c6bba14"
+SRC_URI[sha256sum] = "8a4fc68aff1d18dcb4dd9e460648d24d9e98657fbed496c582929c6b3ce555e5"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=af81ae49ba359e70626c05e9bf313709"
+
+PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl"
+PACKAGECONFIG[gnome-keyring] = "--with-gnome-keyring,--without-gnome-keyring,glib-2.0 gnome-keyring"
+
+EXTRA_OECONF = " \
+                --without-berkeley-db --without-apxs \
+                --without-swig --with-apr=${STAGING_BINDIR_CROSS} \
+                --with-apr-util=${STAGING_BINDIR_CROSS} \
+                --disable-keychain \
+                ac_cv_path_RUBY=none"
+
+inherit autotools
+
+export LDFLAGS += " -L${STAGING_LIBDIR} "
+CPPFLAGS += "-P"
+BUILD_CPPFLAGS += "-P"
+
+acpaths = "-I build/ -I build/ac-macros/"
+
+do_configure_prepend () {
+	rm -f ${S}/libtool
+	rm -f ${S}/build/libtool.m4 ${S}/build/ltmain.sh ${S}/build/ltoptions.m4 ${S}/build/ltsugar.m4 ${S}/build/ltversion.m4 ${S}/build/lt~obsolete.m4
+	rm -f ${S}/aclocal.m4
+	sed -i -e 's:with_sasl="/usr/local":with_sasl="${STAGING_DIR}":' ${S}/build/ac-macros/sasl.m4
+}
+
+#| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_local/libsvn_ra_local-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_repos/libsvn_repos-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| /usr/bin/ld: cannot find -lsvn_delta-1| collect2: ld returned 1 exit status| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_svn/libsvn_ra_svn-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_serf/libsvn_ra_serf-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'
+#| x86_64-linux-libtool: install: error: relink `libsvn_ra_serf-1.la' with the above command before installing it
+#| x86_64-linux-libtool: install: warning: `../../subversion/libsvn_repos/libsvn_repos-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'
+#| /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/subversion-1.8.9/build-outputs.mk:1090: recipe for target 'install-serf-lib' failed
+#| make: *** [install-serf-lib] Error 1
+PARALLEL_MAKEINST = ""
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc
index 704bb27..8cb6fbd 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc
@@ -54,8 +54,8 @@
 }
 
 def swiglib_relpath(d):
-    swiglib = d.getVar('datadir', True) + "/" + d.getVar('BPN', True) + "/" + d.getVar('PV', True)
-    return os.path.relpath(swiglib, d.getVar('bindir', True))
+    swiglib = d.getVar('datadir') + "/" + d.getVar('BPN') + "/" + d.getVar('PV')
+    return os.path.relpath(swiglib, d.getVar('bindir'))
 
 do_install_append_class-native() {
     create_wrapper ${D}${bindir}/swig SWIG_LIB='`dirname $''realpath`'/${@swiglib_relpath(d)}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.12.bb b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.12.bb
new file mode 100644
index 0000000..d5caa67
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.12.bb
@@ -0,0 +1,8 @@
+require ${BPN}.inc
+
+SRC_URI += "file://0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch \
+            file://0001-configure-use-pkg-config-for-pcre-detection.patch \
+           "
+SRC_URI[md5sum] = "82133dfa7bba75ff9ad98a7046be687c"
+SRC_URI[sha256sum] = "7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.8.bb
deleted file mode 100644
index c1b820e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.8.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-require ${BPN}.inc
-
-SRC_URI += "file://0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch \
-            file://0001-configure-use-pkg-config-for-pcre-detection.patch \
-           "
-SRC_URI[md5sum] = "c96a1d5ecb13d38604d7e92148c73c97"
-SRC_URI[sha256sum] = "58a475dbbd4a4d7075e5fe86d4e54c9edde39847cdb96a3053d87cb64a23a453"
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-6.03-sysmacros.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-6.03-sysmacros.patch
new file mode 100644
index 0000000..3ce46da
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-6.03-sysmacros.patch
@@ -0,0 +1,45 @@
+https://bugs.gentoo.org/579928
+
+From d84db34dbe39d55b4d7e868764c056689aa0793b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 19 Apr 2016 01:56:41 -0400
+Subject: [PATCH] extlinux: pull in sys/sysmacros.h for major/minor/makedev
+
+These functions are defined in sys/sysmacros.h, so add the include to
+main.c.  This is already handled correctly in mountinfo.c.  Otherwise
+we get build failures like:
+
+main.o: In function 'find_device_sysfs':
+extlinux/main.c:1131: undefined reference to 'minor'
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+The first part wasn't enough in OE build, I had to add the same for syslinuxext.c.
+---
+ extlinux/main.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/extlinux/main.c b/extlinux/main.c
+index a7ebd49..ebff7ea 100644
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -38,6 +38,7 @@
+ #include <sysexits.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/vfs.h>
+--- a/libinstaller/syslinuxext.c	2017-02-22 20:17:05.336869181 +0100
++++ b/libinstaller/syslinuxext.c	2017-02-22 20:16:47.500868751 +0100
+@@ -2,6 +2,7 @@
+ 
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <getopt.h>
+ #include <ext2fs/ext2fs.h>
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb
index ab8a51a..69bce1f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb
@@ -23,6 +23,7 @@
            file://0009-linux-syslinux-implement-install_bootblock.patch \
            file://0010-gcc46-compatibility.patch \
            file://0011-mk-MMD-does-not-take-any-arguments.patch \
+           file://syslinux-6.03-sysmacros.patch \
            "
 
 SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_230.bb b/import-layers/yocto-poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_230.bb
deleted file mode 100644
index 9ce629a..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_230.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-LICENSE = "LGPLv2.1 & GPLv2"
-LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \
-                    file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe"
-
-SRC_URI = "git://github.com/systemd/systemd-bootchart.git;protocol=https"
-
-# Modify these as desired
-PV = "230+git${SRCPV}"
-SRCREV = "dcb246b46239259ec99b3c6e6ab7d27e1a5a8a84"
-
-S = "${WORKDIR}/git"
-
-DEPENDS = "systemd libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native intltool"
-
-inherit pkgconfig autotools systemd distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "systemd"
-
-SYSTEMD_SERVICE_${PN} = "systemd-bootchart.service"
-
-do_configure_prepend() {
-    # intltool.m4 is a soft link to /usr/share/aclocal/m4, delete it and use the one in our sysroot
-    rm -f ${S}/m4/intltool.m4
-}
-
-FILES_${PN} += "${systemd_unitdir}/systemd-bootchart"
-
-EXTRA_OECONF = " --with-rootprefix=${base_prefix} \
-                 --with-rootlibdir=${base_libdir}"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_231.bb b/import-layers/yocto-poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_231.bb
new file mode 100644
index 0000000..1d88036
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_231.bb
@@ -0,0 +1,29 @@
+LICENSE = "LGPLv2.1 & GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \
+                    file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "git://github.com/systemd/systemd-bootchart.git;protocol=https"
+
+# Modify these as desired
+PV = "231+git${SRCPV}"
+SRCREV = "9ee2ffc1dc6c8209725e625954bbd89f96cb7139"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "systemd libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native intltool"
+
+inherit pkgconfig autotools systemd distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+SYSTEMD_SERVICE_${PN} = "systemd-bootchart.service"
+
+do_configure_prepend() {
+    # intltool.m4 is a soft link to /usr/share/aclocal/m4, delete it and use the one in our sysroot
+    rm -f ${S}/m4/intltool.m4
+}
+
+FILES_${PN} += "${systemd_unitdir}/systemd-bootchart"
+
+EXTRA_OECONF = " --with-rootprefix=${base_prefix} \
+                 --with-rootlibdir=${base_libdir}"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
index 6303280..f902085 100755
--- a/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
@@ -33,16 +33,7 @@
 
     stop)
         echo -n "Stopping $DAEMON_NAME: "
-        count=0
-        while [ -n "`/bin/pidof $DAEMON_PATH`" -a $count -lt 10 ] ; do
-            killproc $DAEMON_PATH >& /dev/null
-            sleep 1
-            RETVAL=$?
-            if [ $RETVAL != 0 -o -n "`/bin/pidof $DAEMON_PATH`" ] ; then
-                sleep 3
-            fi
-            count=`expr $count + 1`
-        done
+        start-stop-daemon -K -q -x $DAEMON_PATH -s USR2
         rm -f /var/lock/subsys/$DAEMON_NAME
         if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
             echo "FAIL"
@@ -72,4 +63,3 @@
 esac
 
 exit $RETVAL
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
index fd9a6c4..a486ac7 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
@@ -5,6 +5,8 @@
 [Service]
 Type=forking
 ExecStart=@SBINDIR@/tcf-agent -d -L- -l0
+KillSignal=USR2
+SuccessExitStatus=USR2
 
 [Install]
 WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.6.bb
index 2dd0a7a..40cd18f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.6.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.6.bb
@@ -54,8 +54,8 @@
 	autotools_do_install install-private-headers
 	ln -sf ./tclsh${VER} ${D}${bindir}/tclsh
 	ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
-	sed -i "s+-L${B}+-L${STAGING_LIBDIR}+g" tclConfig.sh
-	sed -i "s+${WORKDIR}+${STAGING_INCDIR}+g" tclConfig.sh
+	sed -i "s;-L${B};-L${STAGING_LIBDIR};g" tclConfig.sh
+	sed -i "s;'${WORKDIR};'${STAGING_INCDIR};g" tclConfig.sh
 	install -d ${D}${bindir_crossscripts}
 	install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
 	install -m 0755 tclConfig.sh ${D}${libdir}
@@ -78,7 +78,7 @@
 RDEPENDS_${PN}_class-native = ""
 RDEPENDS_${PN}-ptest += "libgcc"
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
 
 do_compile_ptest() {
 	oe_runmake tcltest
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb
index e7574fb..52aa17e 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb
@@ -14,7 +14,10 @@
 
 MOD_PV = "497"
 S = "${WORKDIR}/trunk"
-SRC_URI = "svn://svn.code.sf.net/p/unfs3/code;module=trunk;rev=${MOD_PV};protocol=http \
+# Only subversion url left in OE-Core, use a mirror tarball instead since
+# this rarely changes.
+# svn://svn.code.sf.net/p/unfs3/code;module=trunk;rev=${MOD_PV};protocol=http
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/trunk_svn.code.sf.net_.p.unfs3.code_497_.tar.gz \
            file://unfs3_parallel_build.patch \
            file://alternate_rpc_ports.patch \
            file://fix_pid_race_parent_writes_child_pid.patch \
@@ -23,8 +26,8 @@
            file://relative_max_socket_path_len.patch \
            file://tcp_no_delay.patch \
           "
-SRC_URI[md5sum] = "3687acc4ee992e536472365dd99712a7"
-SRC_URI[sha256sum] = "274b43ada9c6eea1da26eb7010d72889c5278984ba0b50dff4e093057d4d64f8"
+SRC_URI[md5sum] = "2e43e471c77ade0331901c40b8f8e9a3"
+SRC_URI[sha256sum] = "21009468a9ba07b72ea93780d025a63ab4e55bf8fc3127803c296f0900fe1bac"
 
 BBCLASSEXTEND = "native nativesdk"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb
index 1d13b9a..1ffc11e 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb
@@ -10,6 +10,8 @@
 SRC_URI[md5sum] = "337053fd8a7d9ab3adf5e50f88af95b7"
 SRC_URI[sha256sum] = "828ffc270ac262b88fe011136acef2780c05b0dc3c5435d005651740788d4537"
 
+UPSTREAM_CHECK_REGEX = "unifdef-(?P<pver>((\d+\.*)+)(?![a-f0-9]{6,})).tar"
+
 do_install() {
 	oe_runmake install DESTDIR=${D} prefix=${prefix}
 }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc
index 34c9db9..b338ea0 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc
@@ -11,7 +11,7 @@
 LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
 
-SHRT_VER = "${@d.getVar('PV', True).split('.')[0]}.${@d.getVar('PV', True).split('.')[1]}"
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 
 SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
 inherit autotools pkgconfig upstream-version-is-even
@@ -46,5 +46,5 @@
         # up our wrapper.
         sed -i \
            -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \
-           ${SYSROOT_DESTDIR}${datadir}/pkgconfig/vapigen-${SHRT_VER}.pc
+           ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
 }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.32.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.32.1.bb
deleted file mode 100644
index b34086e..0000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.32.1.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-require ${BPN}.inc
-
-SRC_URI += " file://0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch \
-             file://0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch \
-"
-
-SRC_URI[md5sum] = "755881770bffac020b5ea5f625fbe528"
-SRC_URI[sha256sum] = "dd0d47e548a34cfb1e4b04149acd082a86414c49057ffb79902eb9a508a161a9"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.34.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.34.4.bb
new file mode 100644
index 0000000..d1b49ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.34.4.bb
@@ -0,0 +1,8 @@
+require ${BPN}.inc
+
+SRC_URI += " file://0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch \
+             file://0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch \
+"
+
+SRC_URI[md5sum] = "a856989d749fc5e472a3592b96f9ca48"
+SRC_URI[sha256sum] = "6b17bd339414563ebc51f64b0b837919ea7552d8a8ffa71cdc837d25c9696b83"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
index f5ac989..7985308 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
@@ -100,7 +100,7 @@
                  unlink("$name.$mid.out");
                  unlink(<$name.$mid.diff*>);
 -                return;
-+                return 1;
++                return 0;
              }
          }
      }
@@ -113,7 +113,7 @@
         print "Failure encountered, stopping to loop\n";
         exit 1
      }
-+    return 0;
++    return 1;
  }
  
  sub do_one_test($$) 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
index b054d05..b431d33 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
@@ -1,3 +1,8 @@
+From 67e7a690107efb16d6d5aebfe420b64a552accdf Mon Sep 17 00:00:00 2001
+From: Qing He <qing.he@intel.com>
+Date: Tue, 31 Aug 2010 22:51:58 +0800
+Subject: [PATCH] valgrind: fix perl scripts
+
 this is a temporary patch to workaround cross compilation.
 otherwise @PERL@ will be replaced to perl-native binary,
 this creates unusable scripts and fails FILERDEPENDS mechanism
@@ -11,8 +16,16 @@
 
 Upstream-Status: Inappropriate [configuration]
 
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ cachegrind/cg_annotate.in | 2 +-
+ cachegrind/cg_diff.in     | 2 +-
+ massif/ms_print.in        | 2 +-
+ perf/vg_perf.in           | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
 diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in
-index 9dc9565..cc4ef05 100644
+index 69365e8..978265d 100644
 --- a/cachegrind/cg_annotate.in
 +++ b/cachegrind/cg_annotate.in
 @@ -1,4 +1,4 @@
@@ -22,7 +35,7 @@
  ##--------------------------------------------------------------------##
  ##--- Cachegrind's annotator.                       cg_annotate.in ---##
 diff --git a/cachegrind/cg_diff.in b/cachegrind/cg_diff.in
-index 951066e..84c2dde 100644
+index 395460b..05873cc 100755
 --- a/cachegrind/cg_diff.in
 +++ b/cachegrind/cg_diff.in
 @@ -1,4 +1,4 @@
@@ -32,7 +45,7 @@
  ##--------------------------------------------------------------------##
  ##--- Cachegrind's differencer.                         cg_diff.in ---##
 diff --git a/massif/ms_print.in b/massif/ms_print.in
-index e6ffdbf..fb45906 100755
+index e6fae89..3b85b40 100755
 --- a/massif/ms_print.in
 +++ b/massif/ms_print.in
 @@ -1,4 +1,4 @@
@@ -42,7 +55,7 @@
  ##--------------------------------------------------------------------##
  ##--- Massif's results printer                         ms_print.in ---##
 diff --git a/perf/vg_perf.in b/perf/vg_perf.in
-index 2188a31..83ad024 100644
+index 7a80cb0..28f6156 100644
 --- a/perf/vg_perf.in
 +++ b/perf/vg_perf.in
 @@ -1,4 +1,4 @@
@@ -51,3 +64,15 @@
  ##--------------------------------------------------------------------##
  ##--- Valgrind performance testing script                  vg_perf ---##
  ##--------------------------------------------------------------------##
+diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
+index cb05b52..032e947 100755
+--- a/tests/vg_regtest.in
++++ b/tests/vg_regtest.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+ ##--------------------------------------------------------------------##
+ ##--- Valgrind regression testing script                vg_regtest ---##
+ ##--------------------------------------------------------------------##
+---
+2.4.0
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.12.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.12.0.bb
index d82541b..4f8cd3f 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.12.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.12.0.bb
@@ -37,20 +37,25 @@
 COMPATIBLE_HOST_armv5 = 'null'
 COMPATIBLE_HOST_armv6 = 'null'
 
-# valgrind doesn't like mips soft float
-COMPATIBLE_HOST_mips = "${@bb.utils.contains("TARGET_FPU", "soft", "null", ".*-linux", d)}"
-COMPATIBLE_HOST_mipsel = "${@bb.utils.contains("TARGET_FPU", "soft", "null", ".*-linux", d)}"
+# X32 isn't supported by valgrind at this time
+COMPATIBLE_HOST_linux-gnux32 = 'null'
+
+# Disable for some MIPS variants
+COMPATIBLE_HOST_mipsarchn32 = 'null'
+COMPATIBLE_HOST_mipsarchr6 = 'null'
 
 inherit autotools ptest
 
 EXTRA_OECONF = "--enable-tls --without-mpicc"
-EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS', True) != '32']}"
+EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}"
 
 # valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option
 EXTRA_OECONF_append_arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}"
 
 EXTRA_OEMAKE = "-w"
 
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
+
 # valgrind likes to control its own optimisation flags. It generally defaults
 # to -O2 but uses -O0 for some specific test apps etc. Passing our own flags
 # (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
index 6072a7b..6216d77 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
@@ -26,7 +26,7 @@
                   libxslt-bin \
                   coreutils \
 "
-CACHED_CONFIGUREVARS += "ac_cv_path_TAIL=${bindir}/tail"
+CACHED_CONFIGUREVARS += "ac_cv_path_TAIL=tail"
 
 BBCLASSEXTEND = "native"
 
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb
index 78702ed..31af1e2 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb
@@ -9,6 +9,8 @@
 SRC_URI[md5sum] = "fc9e586751ff789b34b1f21d572d96af"
 SRC_URI[sha256sum] = "3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f"
 
+export CCLD_FOR_BUILD = "${CC_FOR_BUILD}"
+
 inherit autotools gettext
 
 BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/acpica_20150515.bb b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpica_20150515.bb
new file mode 100644
index 0000000..1326ebd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpica_20150515.bb
@@ -0,0 +1,49 @@
+SUMMARY = "ACPICA tools for the development and debug of ACPI tables"
+DESCRIPTION = "The ACPI Component Architecture (ACPICA) project provides an \
+OS-independent reference implementation of the Advanced Configuration and \
+Power Interface Specification (ACPI). ACPICA code contains those portions of \
+ACPI meant to be directly integrated into the host OS as a kernel-resident \
+subsystem, and a small set of tools to assist in developing and debugging \
+ACPI tables."
+
+HOMEPAGE = "http://www.acpica.org/"
+SECTION = "console/tools"
+
+LICENSE = "BSD | GPLv2"
+LIC_FILES_CHKSUM = "file://generate/unix/readme.txt;md5=204407e197c1a01154a48f6c6280c3aa"
+
+COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
+
+DEPENDS = "bison flex"
+
+SRC_URI = "https://acpica.org/sites/acpica/files/acpica-unix2-${PV}.tar.gz \
+    file://no-werror.patch \
+    file://rename-yy_scan_string-manually.patch \
+    file://manipulate-fds-instead-of-FILE.patch \
+    "
+SRC_URI[md5sum] = "2bc4a7ccc82de9df9fa964f784ecb29c"
+SRC_URI[sha256sum] = "61204ec56d71bc9bfa2ee2ade4c66f7e8541772ac72ef8ccc20b3f339cc96374"
+UPSTREAM_CHECK_URI = "https://acpica.org/downloads"
+
+S = "${WORKDIR}/acpica-unix2-${PV}"
+
+EXTRA_OEMAKE = "CC='${CC}' 'OPT_CFLAGS=-Wall'"
+
+do_install() {
+    install -D -p -m0755 generate/unix/bin*/iasl ${D}${bindir}/iasl
+    install -D -p -m0755 generate/unix/bin*/acpibin ${D}${bindir}/acpibin
+    install -D -p -m0755 generate/unix/bin*/acpiexec ${D}${bindir}/acpiexec
+    install -D -p -m0755 generate/unix/bin*/acpihelp ${D}${bindir}/acpihelp
+    install -D -p -m0755 generate/unix/bin*/acpinames ${D}${bindir}/acpinames
+    install -D -p -m0755 generate/unix/bin*/acpisrc ${D}${bindir}/acpisrc
+    install -D -p -m0755 generate/unix/bin*/acpixtract ${D}${bindir}/acpixtract
+}
+
+# iasl*.bb is a subset of this recipe, so RREPLACE it
+PROVIDES = "iasl"
+RPROVIDES_${PN} += "iasl"
+RREPLACES_${PN} += "iasl"
+RCONFLIGHTS_${PN} += "iasl"
+
+NATIVE_INSTALL_WORKS = "1"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/acpitests/aapits-linux.patch b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests/aapits-linux.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/acpitests/aapits-linux.patch
rename to import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests/aapits-linux.patch
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/acpitests/aapits-makefile.patch b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests/aapits-makefile.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/acpitests/aapits-makefile.patch
rename to import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests/aapits-makefile.patch
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests_20140828.bb b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests_20140828.bb
new file mode 100644
index 0000000..45ac157
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests_20140828.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Test suite used to validate ACPICA"
+HOMEPAGE = "http://www.acpica.org/"
+
+LICENSE = "Intel"
+LIC_FILES_CHKSUM = "file://tests/aapits/atexec.c;beginline=1;endline=115;md5=e92bcdfcd01d117d1bda3e814bb2030a"
+
+DEPENDS = "bison flex"
+
+SRC_URI = "https://acpica.org/sites/acpica/files/acpitests-unix-${PV}.tar.gz;name=acpitests \
+           https://acpica.org/sites/acpica/files/acpica-unix2-${PV}.tar.gz;name=acpica \
+           file://aapits-linux.patch \
+           file://aapits-makefile.patch \
+"
+SRC_URI[acpitests.md5sum] = "db9d6fdaa8e3eb101d700ee5ba4938ed"
+SRC_URI[acpitests.sha256sum] = "e576c74bf1bf1c9f7348bf9419e05c8acfece7105abcdc052e66670c7af2cf00"
+SRC_URI[acpica.md5sum] = "6f05f0d10166a1b1ff6107f3d1cdf1e5"
+SRC_URI[acpica.sha256sum] = "01d8867656c5ba41dec307c4383ce676196ad4281ac2c9dec9f5be5fac6d888e"
+UPSTREAM_CHECK_URI = "https://acpica.org/downloads"
+
+S = "${WORKDIR}/acpitests-unix-${PV}"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'OPT_CFLAGS=-Wall'"
+
+# The Makefiles expect a specific layout
+do_compile() {
+    cp -af ${WORKDIR}/acpica-unix2-${PV}/source ${S}
+    cd tests/aapits
+    oe_runmake
+}
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m0755 tests/aapits/bin/aapits ${D}${bindir}
+}
+
+COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch
new file mode 100644
index 0000000..6944bb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch
@@ -0,0 +1,71 @@
+From 33a57979738e5ab13950ec1c0e7298e41ef50929 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Thu, 23 Feb 2017 18:10:47 +0100
+Subject: [PATCH] aslfiles.c: manipulate fds instead of FILE
+
+Copying what stdout/stderr point to is not portable and fails with
+musl because FILE is an undefined struct.
+
+Instead, use lower-level Unix functions to modify the file that stderr
+writes into. This works on the platforms that Yocto targets.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ source/compiler/aslfiles.c | 20 +++++++++++---------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/source/compiler/aslfiles.c b/source/compiler/aslfiles.c
+index 947e465..7a352b4 100644
+--- a/source/compiler/aslfiles.c
++++ b/source/compiler/aslfiles.c
+@@ -44,6 +44,11 @@
+ #include "aslcompiler.h"
+ #include "acapps.h"
+ 
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
++#include <unistd.h>
++
+ #define _COMPONENT          ACPI_COMPILER
+         ACPI_MODULE_NAME    ("aslfiles")
+ 
+@@ -569,6 +574,8 @@ FlOpenMiscOutputFiles (
+ 
+     if (Gbl_DebugFlag)
+     {
++        int fd;
++
+         Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG);
+         if (!Filename)
+         {
+@@ -582,20 +589,15 @@ FlOpenMiscOutputFiles (
+         /* TBD: hide this behind a FlReopenFile function */
+ 
+         Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename;
+-        Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle =
+-            freopen (Filename, "w+t", stderr);
+-
+-        if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle)
++        fd = open(Filename, O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
++        if (fd < 0 ||
++            dup2(fd, fileno(stderr)))
+         {
+-            /*
+-             * A problem with freopen is that on error,
+-             * we no longer have stderr.
+-             */
+             Gbl_DebugFlag = FALSE;
+-            memcpy (stderr, stdout, sizeof (FILE));
+             FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME);
+             AslAbort ();
+         }
++        Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = stderr;
+ 
+         AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
+         AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
+-- 
+2.1.4
+
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/files/no-werror.patch b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/no-werror.patch
similarity index 100%
rename from import-layers/meta-openembedded/meta-oe/recipes-extended/acpica/files/no-werror.patch
rename to import-layers/yocto-poky/meta/recipes-extended/acpica/files/no-werror.patch
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/files/rename-yy_scan_string-manually.patch b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/rename-yy_scan_string-manually.patch
new file mode 100644
index 0000000..b62ca25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/rename-yy_scan_string-manually.patch
@@ -0,0 +1,64 @@
+From 2ab61e6ad5a9cfcde838379bc36babfaaa61afb8 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Fri, 20 Jan 2017 13:50:17 +0100
+Subject: [PATCH] rename yy_scan_string manually
+
+flex 2.6.0 used to generate code where yy_scan_string was mapped
+to <custom prefix>_scan_string directly in the generated .c code.
+
+For example, generate/unix/iasl/obj/prparserlex.c:
+
+int
+PrInitLexer (
+    char                    *String)
+{
+
+    LexBuffer = PrParser_scan_string (String);
+    return (LexBuffer == NULL);
+}
+
+flex 2.6.3 no longer does that, leading to a compiler warning
+and link error about yy_scan_string().
+
+Both versions generate a preamble in the beginning of prparserlex.c
+that maps several yy_* names, but yy_scan_string is not among those:
+
+...
+...
+
+Upstream-Status: Inappropriate [workaround for https://github.com/westes/flex/issues/164]
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ source/compiler/dtparser.l | 2 +-
+ source/compiler/prparser.l | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/source/compiler/dtparser.l b/source/compiler/dtparser.l
+index 3f4c2f3..eaa43ff 100644
+--- a/source/compiler/dtparser.l
++++ b/source/compiler/dtparser.l
+@@ -120,7 +120,7 @@ DtInitLexer (
+     char                    *String)
+ {
+ 
+-    LexBuffer = yy_scan_string (String);
++    LexBuffer = DtParser_scan_string (String);
+     return (LexBuffer == NULL);
+ }
+ 
+diff --git a/source/compiler/prparser.l b/source/compiler/prparser.l
+index 10bd130..9cb3573 100644
+--- a/source/compiler/prparser.l
++++ b/source/compiler/prparser.l
+@@ -127,7 +127,7 @@ PrInitLexer (
+     char                    *String)
+ {
+ 
+-    LexBuffer = yy_scan_string (String);
++    LexBuffer = PrParser_scan_string (String);
+     return (LexBuffer == NULL);
+ }
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.20.bb b/import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.20.bb
index 85459b6..904899f 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.20.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.20.bb
@@ -65,7 +65,7 @@
 	install -m 0644 ${WORKDIR}/atd.service ${D}${systemd_unitdir}/system
 	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/atd.service
 
-	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
 		install -D -m 0644 ${WORKDIR}/${BP}/pam.conf ${D}${sysconfdir}/pam.d/atd
 	fi
 }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/build-tests.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/build-tests.patch
deleted file mode 100644
index e63457c..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/build-tests.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-Add 'ptest' target to Makefile, to run tests without checking dependencies.
-
-Signed-off-by: Anders Roxell <anders.roxell@enea.com>
-Upstream-Status: Pending
----
-diff -dNaur bash-3.2.48/Makefile.in.orig bash-3.2.48/Makefile.in
---- bash-3.2.48/Makefile.in.orig	2006-08-17 23:03:35.000000000 +0500
-+++ bash-3.2.48/Makefile.in	2013-07-02 20:20:07.512709327 +0500
-@@ -803,17 +803,31 @@
- 	fi
- 
- recho$(EXEEXT):		$(SUPPORT_SRC)recho.c
--	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
-+	@$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $<
- 
- zecho$(EXEEXT):		$(SUPPORT_SRC)zecho.c
--	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
-+	@$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $<
- 
- printenv$(EXEEXT):	$(SUPPORT_SRC)printenv.c
--	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
-+	@$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $<
- 
--test tests check:	force $(Program) $(TESTS_SUPPORT)
-+test tests check:
-+	@$(MAKE) install-test
-+	@$(MAKE) runtest
-+
-+install-test: buildtest
-+ifeq ($(origin INSTALL_TEST_DIR), undefined)
- 	@-test -d tests || mkdir tests
- 	@cp $(TESTS_SUPPORT) tests
-+else
-+	@-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
-+	@cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
-+	@cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
-+endif
-+
-+buildtest: force $(Program) $(TESTS_SUPPORT)
-+
-+runtest:
- 	@( cd $(srcdir)/tests && \
- 		PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
- 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/dont-include-target-CFLAGS-in-host-LDFLAGS.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/dont-include-target-CFLAGS-in-host-LDFLAGS.patch
deleted file mode 100644
index ee756dc..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/dont-include-target-CFLAGS-in-host-LDFLAGS.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 933bd886af49667e88e2385409449ab598813dab Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <armccurdy@gmail.com>
-Date: Wed, 15 Jul 2015 00:54:33 -0700
-Subject: [PATCH] dont include target CFLAGS in host LDFLAGS
-
-Building the host tool 'mkbuiltins' will fail if the target CFLAGS
-contains an option which isn't supported by the host's gcc. To prevent
-the issue, define LDFLAGS_FOR_BUILD based on CFLAGS_FOR_BUILD instead
-of CFLAGS.
-
-Upstream-Status: Inappropriate [required for bash 3.2.57 (GPLv2) recipe only]
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
----
- builtins/Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/builtins/Makefile.in b/builtins/Makefile.in
-index e027f7a..ebfddf3 100644
---- a/builtins/Makefile.in
-+++ b/builtins/Makefile.in
-@@ -63,7 +63,7 @@ LOCAL_DEFS = @LOCAL_DEFS@
- 
- LIBS = @LIBS@
- LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS)
--LDFLAGS_FOR_BUILD = $(LDFLAGS)
-+LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ $(LOCAL_LDFLAGS) $(CFLAGS_FOR_BUILD)
- LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
- #LIBS_FOR_BUILD = @LIBS_FOR_BUILD@
- LIBS_FOR_BUILD = $(LIBS)
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/mkbuiltins_have_stringize.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/mkbuiltins_have_stringize.patch
deleted file mode 100644
index c4229a7..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/mkbuiltins_have_stringize.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by
-the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers
-use the STRING() macro from unistd.h. A header in the bash sources overrides
-the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the
-wrappers to generate calls to 'xread' and 'xopen', which do not exist,
-resulting in a failure to link.
-
-Assume we have stringize support when cross-compiling, which works around the
-issue.
-
-It may be best for upstream to either give up on supporting compilers without
-stringize support, or to not define STRING() at all when FORTIFY_SOURCES is
-defined, letting the unistd.h one be used, instead.
-
-Upstream-Status: Pending
-
-Signed-off-by: Christopher Larson <chris_larson@mentor.com>
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
---- bash-4.2.orig/builtins/mkbuiltins.c
-+++ bash-4.2/builtins/mkbuiltins.c
-@@ -28,6 +28,7 @@
- #  define HAVE_STDLIB_H
-
- #  define HAVE_RENAME
-+#  define HAVE_STRINGIZE
- #endif /* CROSS_COMPILING */
-
- #if defined (HAVE_UNISTD_H)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/run-ptest
deleted file mode 100644
index 8dd3b99..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/run-ptest
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-make -k THIS_SH=/bin/bash BUILD_DIR=. runtest
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/string-format.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/string-format.patch
deleted file mode 100644
index eda3964..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/string-format.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Fix a string format warning when using security flags:
-
-| ../bash-3.2.48/print_cmd.c:1152:3: error: format not a string literal and no format arguments [-Werror=format-security]
-|    cprintf (indentation_string);
-
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-diff --git a/print_cmd.c b/print_cmd.c
-index d1dfd1a..956db53 100644
---- a/print_cmd.c
-+++ b/print_cmd.c
-@@ -1149,7 +1149,7 @@ indent (amount)
-   for (i = 0; amount > 0; amount--)
-     indentation_string[i++] = ' ';
-   indentation_string[i] = '\0';
--  cprintf (indentation_string);
-+  cprintf ("%s", indentation_string);
- }
- 
- static void
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/test-output.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/test-output.patch
deleted file mode 100644
index 2b09b7d..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.57/test-output.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Add FAIL/PASS output to test output.
-
-Signed-off-by: Björn Stenberg <bjst@enea.com>
-Upstream-Status: Pending
----
-diff -uNr a/tests/run-all b/tests/run-all
---- a/tests/run-all	1999-10-08 17:07:46.000000000 +0200
-+++ b/tests/run-all	2012-10-27 21:04:18.663331887 +0200
-@@ -22,7 +22,15 @@
- 	case $x in
- 	$0|run-minimal|run-gprof)	;;
- 	*.orig|*~) ;;
--	*)	echo $x ; sh $x ;;
-+    *)  echo $x
-+         output=`sh $x`
-+         if [ -n "$output" ]; then
-+             echo "$output"
-+             echo "FAIL: $x"
-+         else
-+             echo "PASS: $x"
-+         fi
-+         ;;
- 	esac
- done
- 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc b/import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc
index 1d08526..3e9c662 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc
@@ -14,9 +14,11 @@
 # This is what other major distros do. And this is what we wanted. See bug#5359 and bug#7137.
 CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS"
 
-ALTERNATIVE_${PN} = "sh"
+ALTERNATIVE_${PN} = "bash sh"
+ALTERNATIVE_LINK_NAME[bash] = "${base_bindir}/bash"
+ALTERNATIVE_TARGET[bash] = "${base_bindir}/bash"
 ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
-ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash"
+ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash.${BPN}"
 ALTERNATIVE_PRIORITY = "100"
 
 RDEPENDS_${PN} += "base-files"
@@ -63,3 +65,7 @@
 pkg_postrm_${PN} () {
 	printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
 }
+
+PACKAGES += "${PN}-bashbug"
+FILES_${PN} = "${bindir}/bash ${base_bindir}/bash.bash"
+FILES_${PN}-bashbug = "${bindir}/bashbug"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch
new file mode 100644
index 0000000..9fb6ba9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch
@@ -0,0 +1,35 @@
+From d3b6303a6853f612a56848ee4e59eaa0b0ab9489 Mon Sep 17 00:00:00 2001
+From: Zhang Xiao <xiao.zhang@windriver.com>
+Date: Tue, 21 Feb 2017 11:30:14 +0800
+Subject: [PATCH] bash: memleak bug fix for builtin command read
+
+Built in command "read" with "-e" use Readline to obtain the line
+in an interactive shell. In this process, a string "rlbuf" is
+just allocated without free operation thus cause memory leak. Fix it.
+
+Upstream-Status: Submitted [http://lists.gnu.org/archive/html/bug-bash/2017-02/msg00061.html]
+
+Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
+---
+ builtins/read.def | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/builtins/read.def b/builtins/read.def
+index 4397154..ee0c5a6 100644
+--- a/builtins/read.def
++++ b/builtins/read.def
+@@ -674,6 +674,11 @@ add_char:
+   input_string[i] = '\0';
+   CHECK_ALRM;
+ 
++#if defined (READLINE)
++  if (edit)
++    xfree (rlbuf);
++#endif
++
+   if (retval < 0)
+     {
+       t_errno = errno;
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.57.bb b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.57.bb
deleted file mode 100644
index 5c288b3..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.57.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require bash.inc
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=fd5d9bcabd8ed5a54a01ce8d183d592a"
-
-SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
-           file://mkbuiltins_have_stringize.patch \
-           file://build-tests.patch \
-           file://test-output.patch \
-           file://run-ptest \
-           file://dont-include-target-CFLAGS-in-host-LDFLAGS.patch \
-           file://string-format.patch \
-          "
-
-SRC_URI[md5sum] = "237a8767c990b43ae2c89895c2dbc062"
-SRC_URI[sha256sum] = "3fa9daf85ebf35068f090ce51283ddeeb3c75eb5bc70b1a4a7cb05868bfe06a4"
-
-PARALLEL_MAKE = ""
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb
index b40059f..2648faf 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb
@@ -32,6 +32,7 @@
            file://0001-help-fix-printf-format-security-warning.patch \
            file://fix-run-intl.patch \
            file://CVE-2016-9401.patch \
+           file://bash-memleak-bug-fix-for-builtin-command-read.patch \
            "
 
 SRC_URI[tarball.md5sum] = "a27b3ee9be83bd3ba448c0ff52b28447"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc
index f9f8d6b..adb0719 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc
+++ b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc
@@ -6,7 +6,8 @@
 LICENSE = "PD"
 
 SRC_URI = "ftp://invisible-island.net/byacc/byacc-${PV}.tgz \
-           file://byacc-open.patch"
+           file://byacc-open.patch \
+           file://0001-byacc-do-not-reorder-CC-and-CFLAGS.patch"
 
 EXTRA_OECONF += "--program-transform-name='s,^,b,'"
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/0001-byacc-do-not-reorder-CC-and-CFLAGS.patch b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/0001-byacc-do-not-reorder-CC-and-CFLAGS.patch
new file mode 100644
index 0000000..7cd2510
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/0001-byacc-do-not-reorder-CC-and-CFLAGS.patch
@@ -0,0 +1,161 @@
+Subject: byacc: do not reorder $CC and $CFLAGS
+
+byacc tries to process $CC and decide which part should belong to CC and which
+part should below to CFLAGS and then do reordering. It doesn't make much sense
+for OE. And it doesn't do its work correctly. Some options are dropped.
+
+Delete all these stuff so that we could have all options we need.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ aclocal.m4 |   1 -
+ configure  | 119 -------------------------------------------------------------
+ 2 files changed, 120 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 917a848..62ef241 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -1021,7 +1021,6 @@ CF_GCC_VERSION
+ CF_ACVERSION_CHECK(2.52,
+ 	[AC_PROG_CC_STDC],
+ 	[CF_ANSI_CC_REQD])
+-CF_CC_ENV_FLAGS
+ ])dnl
+ dnl ---------------------------------------------------------------------------
+ dnl CF_PROG_GROFF version: 2 updated: 2015/07/04 11:16:27
+diff --git a/configure b/configure
+index 9707e50..4f0497c 100755
+--- a/configure
++++ b/configure
+@@ -1946,125 +1946,6 @@ esac
+ # This should have been defined by AC_PROG_CC
+ : ${CC:=cc}
+ 
+-echo "$as_me:1949: checking \$CC variable" >&5
+-echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
+-case "$CC" in
+-(*[\ \	]-*)
+-	echo "$as_me:1953: result: broken" >&5
+-echo "${ECHO_T}broken" >&6
+-	{ echo "$as_me:1955: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
+-echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
+-	# humor him...
+-	cf_flags=`echo "$CC" | sed -e 's/^.*[ 	]\(-[^ 	]\)/\1/'`
+-	CC=`echo "$CC " | sed -e 's/[ 	]-[^ 	].*$//' -e 's/[ 	]*$//'`
+-	for cf_arg in $cf_flags
+-	do
+-		case "x$cf_arg" in
+-		(x-[IUDfgOW]*)
+-
+-cf_fix_cppflags=no
+-cf_new_cflags=
+-cf_new_cppflags=
+-cf_new_extra_cppflags=
+-
+-for cf_add_cflags in $cf_flags
+-do
+-case $cf_fix_cppflags in
+-(no)
+-	case $cf_add_cflags in
+-	(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+-		case $cf_add_cflags in
+-		(-D*)
+-			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+-
+-			test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+-				&& test -z "${cf_tst_cflags}" \
+-				&& cf_fix_cppflags=yes
+-
+-			if test $cf_fix_cppflags = yes ; then
+-				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+-				continue
+-			elif test "${cf_tst_cflags}" = "\"'" ; then
+-				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+-				continue
+-			fi
+-			;;
+-		esac
+-		case "$CPPFLAGS" in
+-		(*$cf_add_cflags)
+-			;;
+-		(*)
+-			case $cf_add_cflags in
+-			(-D*)
+-				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+-
+-CPPFLAGS=`echo "$CPPFLAGS" | \
+-	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+-		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+-
+-				;;
+-			esac
+-			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+-			;;
+-		esac
+-		;;
+-	(*)
+-		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+-		;;
+-	esac
+-	;;
+-(yes)
+-	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+-
+-	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+-
+-	test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+-		&& test -z "${cf_tst_cflags}" \
+-		&& cf_fix_cppflags=no
+-	;;
+-esac
+-done
+-
+-if test -n "$cf_new_cflags" ; then
+-
+-	CFLAGS="$CFLAGS $cf_new_cflags"
+-fi
+-
+-if test -n "$cf_new_cppflags" ; then
+-
+-	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+-fi
+-
+-if test -n "$cf_new_extra_cppflags" ; then
+-
+-	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+-fi
+-
+-			;;
+-		(*)
+-			CC="$CC $cf_arg"
+-			;;
+-		esac
+-	done
+-	test -n "$verbose" && echo "	resulting CC: '$CC'" 1>&6
+-
+-echo "${as_me:-configure}:2051: testing resulting CC: '$CC' ..." 1>&5
+-
+-	test -n "$verbose" && echo "	resulting CFLAGS: '$CFLAGS'" 1>&6
+-
+-echo "${as_me:-configure}:2055: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
+-
+-	test -n "$verbose" && echo "	resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
+-
+-echo "${as_me:-configure}:2059: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
+-
+-	;;
+-(*)
+-	echo "$as_me:2063: result: ok" >&5
+-echo "${ECHO_T}ok" >&6
+-	;;
+-esac
+-
+ echo "$as_me:2068: checking whether ${MAKE-make} sets \${MAKE}" >&5
+ echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
+ set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+-- 
+2.8.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20160606.bb b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20160606.bb
deleted file mode 100644
index 98129d0..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20160606.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-# Sigh. This is one of those places where everyone licenses it differently. Someone
-# even apply UCB to it (Free/Net/OpenBSD). The maintainer states that:
-# "I've found no reliable source which states that byacc must bear a UCB copyright."
-# Setting to PD as this is what the upstream has it as.
-
-LICENSE = "PD"
-LIC_FILES_CHKSUM = "file://package/debian/copyright;md5=74533d32ffd38bca4cbf1f1305f8bc60"
-require byacc.inc
-
-
-SRC_URI[md5sum] = "d527c811b360f04a8c5f5a0a90625966"
-SRC_URI[sha256sum] = "cc8fdced486cb70cec7a7c9358de836bfd267d19d6456760bb4721ccfea5ac91"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20161202.bb b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20161202.bb
new file mode 100644
index 0000000..755f8ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20161202.bb
@@ -0,0 +1,12 @@
+# Sigh. This is one of those places where everyone licenses it differently. Someone
+# even apply UCB to it (Free/Net/OpenBSD). The maintainer states that:
+# "I've found no reliable source which states that byacc must bear a UCB copyright."
+# Setting to PD as this is what the upstream has it as.
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://package/debian/copyright;md5=74533d32ffd38bca4cbf1f1305f8bc60"
+require byacc.inc
+
+
+SRC_URI[md5sum] = "48ef38447f2cc864c70ef864b26cf817"
+SRC_URI[sha256sum] = "30dc58cfcdb708eea7ba022db29b41d2d392f20727491b956954366f2f2117f0"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
index ef7bc89..0512a75 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
@@ -25,7 +25,7 @@
 
 CFLAGS_append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64"
 
-inherit autotools update-alternatives ptest
+inherit autotools update-alternatives ptest relative_symlinks
 
 ALTERNATIVE_PRIORITY = "100"
 ALTERNATIVE_${PN} = "bunzip2 bzcat"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb
index c0f7f16..87fa8eb 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb
@@ -21,7 +21,7 @@
 # into the sysroot, as we may use them to construct the rootfs. As such, we
 # only adjust the paths to match the metadata for the target, not native.
 obey_variables () {
-	sed -i 's,ALTERNATIVES_ROOT,OPKG_OFFLINE_ROOT,' alternatives.c
+	sed -i 's,ALTERNATIVES_ROOT,OPKG_OFFLINE_ROOT,' ${S}/alternatives.c
 }
 
 do_compile () {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch
deleted file mode 100644
index a315735..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624]
-CVE: CVE-2010-0624
-
-This patch avoids heap overflow reported by :
-http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624
-
-This is a clean patch for the GPLv2 tar recipe.
-
-the GPLv2 tar recipe patch is also applicable to this GPLv2 cpio 
-recipe, as they share code.
-
-Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25
-
-Index: tar-1.17/lib/rtapelib.c
-===================================================================
---- tar-1.17.orig/lib/rtapelib.c
-+++ tar-1.17/lib/rtapelib.c
-@@ -570,7 +570,7 @@ rmt_read__ (int handle, char *buffer, si
- 
-   sprintf (command_buffer, "R%lu\n", (unsigned long) length);
-   if (do_command (handle, command_buffer) == -1
--      || (status = get_status (handle)) == SAFE_READ_ERROR)
-+      || ((status = get_status (handle)) == SAFE_READ_ERROR) || (status > length))
-     return SAFE_READ_ERROR;
- 
-   for (counter = 0; counter < status; counter += rlen, buffer += rlen)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch
deleted file mode 100644
index 0148e70..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch
+++ /dev/null
@@ -1,217 +0,0 @@
-cpio: Fix memory overrun on reading improperly created link records
-
-Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
-
-http://git.savannah.gnu.org/cgit/cpio.git/commit/?id=746f3ff670dcfcdd28fcc990e79cd6fccc7ae48d
-
-  * src/copyin.c (get_link_name): New function.
-  (list_file, copyin_link): use get_link_name
-
-  * tests/symlink-bad-length.at: New file.
-  * tests/symlink-long.at: New file.
-  * tests/Makefile.am: Add new files.
-  * tests/testsuite.at: Likewise.
-
-  See http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
-
-Upstream-Status: Backport
-
-Signed-off-by: Sergey Poznyakoff <gray@gnu.org.ua>
-
-diff -Nurp cpio-2.8.orig/src/copyin.c cpio-2.8/src/copyin.c
---- cpio-2.8.orig/src/copyin.c	2007-06-07 19:58:03.000000000 +0800
-+++ cpio-2.8/src/copyin.c	2014-12-08 11:30:01.159791484 +0800
-@@ -126,6 +126,28 @@ tape_skip_padding (int in_file_des, int
- }
- 
- 
-+static char *
-+get_link_name (struct cpio_file_stat *file_hdr, int in_file_des)
-+{
-+  off_t n = file_hdr->c_filesize + 1;
-+  char *link_name;
-+
-+  if (n == 0 || n > SIZE_MAX)
-+    {
-+      error (0, 0, _("%s: stored filename length too big"), file_hdr->c_name);
-+      link_name = NULL;
-+    }
-+  else
-+    {
-+      link_name = xmalloc (n);
-+      tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
-+      link_name[file_hdr->c_filesize] = '\0';
-+      tape_skip_padding (in_file_des, file_hdr->c_filesize);
-+    }
-+  return link_name;
-+}
-+
-+
- static void
- list_file(struct cpio_file_stat* file_hdr, int in_file_des)
- {
-@@ -136,21 +158,16 @@ list_file(struct cpio_file_stat* file_hd
- 	{
- 	  if (archive_format != arf_tar && archive_format != arf_ustar)
- 	    {
--	      char *link_name = NULL;	/* Name of hard and symbolic links.  */
--
--	      link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1);
--	      link_name[file_hdr->c_filesize] = '\0';
--	      tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
--	      long_format (file_hdr, link_name);
--	      free (link_name);
--	      tape_skip_padding (in_file_des, file_hdr->c_filesize);
--	      return;
-+	      char *link_name = get_link_name (file_hdr, in_file_des);
-+	      if (link_name)
-+		{
-+		  long_format (file_hdr, link_name);
-+		  free (link_name);
-+		}
- 	    }
- 	  else
--	    {
- 	      long_format (file_hdr, file_hdr->c_tar_linkname);
--	      return;
--	    }
-+	  return;
- 	}
-       else
- #endif
-@@ -732,10 +749,7 @@ copyin_link(struct cpio_file_stat *file_
- 
-   if (archive_format != arf_tar && archive_format != arf_ustar)
-     {
--      link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1);
--      link_name[file_hdr->c_filesize] = '\0';
--      tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
--      tape_skip_padding (in_file_des, file_hdr->c_filesize);
-+      link_name = get_link_name (file_hdr, in_file_des);
-     }
-   else
-     {
-diff -Nurp cpio-2.8.orig/tests/Makefile.am cpio-2.8/tests/Makefile.am
---- cpio-2.8.orig/tests/Makefile.am	2006-10-24 18:32:13.000000000 +0800
-+++ cpio-2.8/tests/Makefile.am	2014-12-08 11:30:52.387789482 +0800
-@@ -45,6 +45,8 @@ TESTSUITE_AT = \
-  testsuite.at\
-  inout.at\
-  symlink.at\
-+ symlink-bad-length.at\
-+ symlink-long.at\
-  version.at
- 
- TESTSUITE = $(srcdir)/testsuite
-diff -Nurp cpio-2.8.orig/tests/symlink-bad-length.at cpio-2.8/tests/symlink-bad-length.at
---- cpio-2.8.orig/tests/symlink-bad-length.at	1970-01-01 08:00:00.000000000 +0800
-+++ cpio-2.8/tests/symlink-bad-length.at	2014-12-08 11:33:25.283783507 +0800
-@@ -0,0 +1,49 @@
-+# Process this file with autom4te to create testsuite.  -*- Autotest -*-
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3, or (at your option)
-+# any later version.
-+
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+# 02110-1301 USA.
-+
-+# Cpio v2.11 did segfault with badly set symlink length.
-+# References:
-+# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
-+
-+AT_SETUP([symlink-bad-length])
-+AT_KEYWORDS([symlink-long copyout])
-+
-+AT_DATA([ARCHIVE.base64],
-+[x3EjAIBAtIEtJy8nAQAAAHRUYW0FAAAADQBGSUxFAABzb21lIGNvbnRlbnQKAMdxIwBgQ/+hLScv
-+JwEAAAB0VEhuBQD/////TElOSwAARklMRcdxAAAAAAAAAAAAAAEAAAAAAAAACwAAAAAAVFJBSUxF
-+UiEhIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
-+])
-+
-+AT_CHECK([
-+base64 -d ARCHIVE.base64 > ARCHIVE || AT_SKIP_TEST
-+cpio -ntv < ARCHIVE
-+test $? -eq 2
-+],
-+[0],
-+[-rw-rw-r--   1 10029    10031          13 Nov 25 13:52 FILE
-+],[cpio: LINK: stored filename length too big
-+cpio: premature end of file
-+])
-+
-+AT_CLEANUP
-diff -Nurp cpio-2.8.orig/tests/symlink-long.at cpio-2.8/tests/symlink-long.at
---- cpio-2.8.orig/tests/symlink-long.at	1970-01-01 08:00:00.000000000 +0800
-+++ cpio-2.8/tests/symlink-long.at	2014-12-08 11:34:28.807781024 +0800
-@@ -0,0 +1,46 @@
-+# Process this file with autom4te to create testsuite.  -*- Autotest -*-
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3, or (at your option)
-+# any later version.
-+
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+# 02110-1301 USA.
-+
-+# Cpio v2.11.90 changed the way symlink name is read from archive.
-+# References:
-+# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
-+
-+AT_SETUP([symlink-long])
-+AT_KEYWORDS([symlink-long copyout])
-+
-+AT_CHECK([
-+
-+# len(dirname) > READBUFSIZE
-+dirname=
-+for i in {1..52}; do
-+    dirname="xxxxxxxxx/$dirname"
-+    mkdir "$dirname"
-+done
-+ln -s "$dirname" x || AT_SKIP_TEST
-+
-+echo x | cpio -o > ar
-+list=`cpio -tv < ar | sed 's|.*-> ||'`
-+test "$list" = "$dirname" && echo success || echo fail
-+],
-+[0],
-+[success
-+],[2 blocks
-+2 blocks
-+])
-+
-+AT_CLEANUP
-diff -Nurp cpio-2.8.orig/tests/testsuite.at cpio-2.8/tests/testsuite.at
---- cpio-2.8.orig/tests/testsuite.at	2006-10-24 18:32:13.000000000 +0800
-+++ cpio-2.8/tests/testsuite.at	2014-12-08 11:34:56.515779942 +0800
-@@ -31,3 +31,5 @@ m4_include([version.at])
- 
- m4_include([inout.at])
- m4_include([symlink.at])
-+m4_include([symlink-bad-length.at])
-+m4_include([symlink-long.at])
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch
deleted file mode 100644
index e16585d..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Upstream-Status: Inappropriate [licensing]
-
-# Define AC_USE_SYSTEM_EXTENSIONS only if it was previously undefined.
-# This is needed to configure correctly with newer versions of autoconf.
-
-diff -urN cpio-2.8.orig/m4/extensions.m4 cpio-2.8/m4/extensions.m4
---- cpio-2.8.orig/m4/extensions.m4	2006-10-12 04:34:45.000000000 -0700
-+++ cpio-2.8/m4/extensions.m4	2010-07-23 14:37:36.000000000 -0700
-@@ -1,4 +1,4 @@
--# serial 4  -*- Autoconf -*-
-+# serial 5  -*- Autoconf -*-
- # Enable extensions on systems that normally disable them.
- 
- # Copyright (C) 2003, 2006 Free Software Foundation, Inc.
-@@ -16,6 +16,7 @@
- # ------------------------
- # Enable extensions on systems that normally disable them,
- # typically due to standards-conformance issues.
-+m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [], [
- AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
- [
-   AC_BEFORE([$0], [AC_COMPILE_IFELSE])
-@@ -48,7 +49,7 @@
-     AC_DEFINE([__EXTENSIONS__])
-   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
-   AC_DEFINE([_TANDEM_SOURCE])
--])
-+])])
- 
- # gl_USE_SYSTEM_EXTENSIONS
- # ------------------------
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch
deleted file mode 100644
index a00799f..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Upstream-Status: Inappropriate [licensing]
-
-# Avoid multiple stat definitions
-# Patch taken from cpio mailing list posting 2010-03-19
-
-diff -urN cpio-2.11.orig/src/filetypes.h cpio-2.11/src/filetypes.h
---- cpio-2.11.orig/src/filetypes.h	2010-02-12 02:19:23.000000000 -0800
-+++ cpio-2.11/src/filetypes.h	2010-07-23 13:17:25.000000000 -0700
-@@ -82,4 +82,6 @@
- #define lstat stat
- #endif
- int lstat ();
-+#ifndef stat
- int stat ();
-+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb
index e743999..405a90e 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb
@@ -1,4 +1,4 @@
-include cpio_v2.inc
+require cpio_v2.inc
 
 LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb
deleted file mode 100644
index 624906b..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-require cpio_v2.inc
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b7f772ea3a2489231cb4872656cac34b"
-
-PR = "r4"
-
-SRC_URI += " \
-	    file://statdef.patch \
-	    file://m4extensions.patch \
-	    file://avoid_heap_overflow.patch \
-	    file://fix-memory-overrun.patch \
-	   "
-
-SRC_URI[md5sum] = "0caa356e69e149fb49b76bacc64615a1"
-SRC_URI[sha256sum] = "1b203248874c3b5a728b351f06513e5282f73e0170b7f207fbf8c39f28f6b4ad"
-
-# Required to build with gcc 4.3 and later:
-CFLAGS += "-fgnu89-inline"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.1.bb b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.1.bb
index 6d46629..cfb8c21 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.1.bb
@@ -30,7 +30,7 @@
 
 inherit autotools update-rc.d useradd systemd
 
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 
 PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
 PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,${PAM_DEPS}"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc b/import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc
index 02b6358..c3fa459 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc
+++ b/import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc
@@ -3,7 +3,7 @@
 LICENSE = "GPLv2 & LGPLv2"
 DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb"
 
-SRC_URI = "https://github.com/apple/cups/releases/download/release-${PV}/${BP}-source.tar.gz \
+SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.tar.gz \
            file://use_echo_only_in_init.patch \
            file://0001-don-t-try-to-run-generated-binaries.patch \
            file://cups_serverbin.patch \
@@ -16,7 +16,7 @@
 
 CLEANBROKEN = "1"
 
-inherit autotools-brokensep binconfig useradd systemd
+inherit autotools-brokensep binconfig useradd systemd pkgconfig
 
 USERADD_PACKAGES = "${PN}"
 GROUPADD_PARAM_${PN} = "--system lpadmin"
@@ -24,8 +24,7 @@
 SYSTEMD_SERVICE_${PN} = "org.cups.cupsd.socket org.cups.cupsd.path org.cups.cupsd.service org.cups.cups-lpd.socket org.cups.cups-lpd@.service"
 
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
 PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
 PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
 PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam"
@@ -83,7 +82,7 @@
 python do_package_append() {
     import subprocess
     # Change permissions back the way they were, they probably had a reason...
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
     subprocess.call('chmod 0511 %s/install/cups/var/run/cups/certs' % workdir, shell=True)
 }
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.4.bb b/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.4.bb
deleted file mode 100644
index 0fab806..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.4.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require cups.inc
-
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=6c5a350596fba02754bd96eb6df3afd0"
-
-SRC_URI[md5sum] = "9f9bf6e3b9c20a3519b4dc409666d6e7"
-SRC_URI[sha256sum] = "4b14fd833180ac529ebebea766a09094c2568bf8426e219cb3a1715304ef728d"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.2.2.bb b/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.2.2.bb
new file mode 100644
index 0000000..5174c30
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.2.2.bb
@@ -0,0 +1,6 @@
+require cups.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f212b4338db0da8cb892e94bf2949460"
+
+SRC_URI[md5sum] = "036f6bda6202ae3e280ac00c710b5ca4"
+SRC_URI[sha256sum] = "f589bb7d5d1dc3aa0915d7cf2b808571ef2e1530cd1a6ebe76ae8f9f4994e4f6"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch
deleted file mode 100644
index f8638bb..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Upstream-Status: Pending
-
-automake 1.12 has depricated automatic de-ANSI-fication support
-
-this patch avoids these kinds of errors:
-
-| configure.ac:90: error: automatic de-ANSI-fication support has been removed
-| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
-| /srv/home/nitin/builds/build-gcc47/tmp/work/i586-poky-linux/diffutils-2.8.1-r4/diffutils-2.8.1/m4/prereq.m4:110: jm_PREREQ_QUOTEARG is expanded from...
-| configure.ac:90: the top level
-| autom4te: m4 failed with exit status: 1
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
-2012/05/04
-
-Index: diffutils-2.8.1/m4/prereq.m4
-===================================================================
---- diffutils-2.8.1.orig/m4/prereq.m4
-+++ diffutils-2.8.1/m4/prereq.m4
-@@ -115,7 +115,6 @@ AC_DEFUN([jm_PREREQ_QUOTEARG],
-   AC_HEADER_STDC
-   AC_C_BACKSLASH_A
-   AC_MBSTATE_T
--  AM_C_PROTOTYPES
- ])
- 
- AC_DEFUN([jm_PREREQ_REGEX],
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/fix_gcc6.patch b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/fix_gcc6.patch
deleted file mode 100644
index f915287..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/fix_gcc6.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Fixes to allow diffutils to build with gcc v6.
-
-RP
-2016/5/25
-
-Index: diffutils-2.8.1/lib/posix/regex.h
-===================================================================
---- diffutils-2.8.1.orig/lib/posix/regex.h
-+++ diffutils-2.8.1/lib/posix/regex.h
-@@ -529,7 +529,9 @@ extern int re_exec _RE_ARGS ((const char
- /* For now unconditionally define __restrict_arr to expand to nothing.
-    Ideally we would have a test for the compiler which allows defining
-    it to restrict.  */
-+#ifndef __restrict_arr
- #define __restrict_arr
-+#endif
- 
- /* POSIX compatibility.  */
- extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
-Index: diffutils-2.8.1/src/diff.c
-===================================================================
---- diffutils-2.8.1.orig/src/diff.c
-+++ diffutils-2.8.1/src/diff.c
-@@ -71,6 +71,7 @@ static void usage (void);
- static bool recursive;
- 
- /* In context diffs, show previous lines that match these regexps.  */
-+struct re_pattern_buffer function_regexp;
- static struct regexp_list function_regexp_list;
- 
- /* Ignore changes affecting only lines that match these regexps.  */
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.4/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.5/0001-Unset-need_charset_alias-when-building-for-musl.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.4/0001-Unset-need_charset_alias-when-building-for-musl.patch
rename to import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.5/0001-Unset-need_charset_alias-when-building-for-musl.patch
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.4/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.5/run-ptest
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.4/run-ptest
rename to import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.5/run-ptest
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb
deleted file mode 100644
index fe56f9c..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-require diffutils.inc
-
-PR = "r7.0"
-
-SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.gz \
-           file://diffutils_fix_for_automake-1.12.patch \
-           file://fix_gcc6.patch"
-
-SRC_URI[md5sum] = "71f9c5ae19b60608f6c7f162da86a428"
-SRC_URI[sha256sum] = "c5001748b069224dd98bf1bb9ee877321c7de8b332c8aad5af3e2a7372d23f5a"
-
-do_configure_prepend () {
-	chmod u+w ${S}/po/Makefile.in.in
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.4.bb b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.4.bb
deleted file mode 100644
index be280ec..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.4.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-require diffutils.inc
-
-SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \
-           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
-           file://run-ptest \
-"
-
-EXTRA_OECONF += "--without-libsigsegv-prefix"
-
-# Fix "Argument list too long" error when len(TMPDIR) = 410
-acpaths = "-I ./m4"
-
-do_configure_prepend () {
-	# Need to remove gettext macros with weird mix of versions
-	for i in codeset.m4 gettext_gl.m4 intlmacosx.m4 inttypes-pri.m4 lib-ld_gl.m4 lib-prefix_gl.m4 po_gl.m4 ssize_t.m4 wchar_t.m4 wint_t.m4; do
-		rm -f ${S}/m4/$i
-	done
-}
-
-SRC_URI[md5sum] = "df9ca465f30307cffd03da176a43a5d4"
-SRC_URI[sha256sum] = "db53c025f2ac3d217bcf753dad6dee7b410b33d0948495ff015aaf8b91189ce2"
-
-inherit ptest
-
-do_install_ptest() {
-	t=${D}${PTEST_PATH}
-	install -D ${S}/build-aux/test-driver $t/build-aux/test-driver
-	cp -r ${S}/tests $t/
-	install ${B}/tests/Makefile $t/tests/
-	sed -e 's|^Makefile:|_Makefile:|' \
-	    -e 's|bash|sh|' \
-	    -e 's|^top_srcdir = \(.*\)|top_srcdir = ..\/|' \
-	    -e 's|^srcdir = \(.*\)|srcdir = .|' \
-	    -e 's|"`$(built_programs)`"|diff|' \
-	    -e 's|gawk|awk|g' \
-	    -i $t/tests/Makefile
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.5.bb b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.5.bb
new file mode 100644
index 0000000..243584b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.5.bb
@@ -0,0 +1,40 @@
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+require diffutils.inc
+
+SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           file://run-ptest \
+"
+
+EXTRA_OECONF += "--without-libsigsegv-prefix"
+
+# Fix "Argument list too long" error when len(TMPDIR) = 410
+acpaths = "-I ./m4"
+
+do_configure_prepend () {
+	# Need to remove gettext macros with weird mix of versions
+	for i in codeset.m4 gettext_gl.m4 intlmacosx.m4 inttypes-pri.m4 lib-ld_gl.m4 lib-prefix_gl.m4 po_gl.m4 ssize_t.m4 wchar_t.m4 wint_t.m4; do
+		rm -f ${S}/m4/$i
+	done
+}
+
+SRC_URI[md5sum] = "569354697ff1cfc9a9de3781361015fa"
+SRC_URI[sha256sum] = "dad398ccd5b9faca6b0ab219a036453f62a602a56203ac659b43e889bec35533"
+
+inherit ptest
+
+do_install_ptest() {
+	t=${D}${PTEST_PATH}
+	install -D ${S}/build-aux/test-driver $t/build-aux/test-driver
+	cp -r ${S}/tests $t/
+	install ${B}/tests/Makefile $t/tests/
+	sed -e 's|^Makefile:|_Makefile:|' \
+	    -e 's|bash|sh|' \
+	    -e 's|^top_srcdir = \(.*\)|top_srcdir = ..\/|' \
+	    -e 's|^srcdir = \(.*\)|srcdir = .|' \
+	    -e 's|"`$(built_programs)`"|diff|' \
+	    -e 's|gawk|awk|g' \
+	    -i $t/tests/Makefile
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb
deleted file mode 100644
index e2df13f..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SUMMARY = "Line-oriented text editor"
-HOMEPAGE = "http://www.gnu.org/software/ed/"
-SECTION = "base"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=6ddd5335ef96fb858a138230af773710 \
-                    file://main.c;beginline=1;endline=17;md5=36d4b85e5ae9028e918d1cc775c2475e"
-
-PR = "r2"
-SRC_URI = "${SAVANNAH_GNU_MIRROR}/ed/ed-${PV}.tar.bz2"
-
-SRC_URI[md5sum] = "4ee21e9dcc9b5b6012c23038734e1632"
-SRC_URI[sha256sum] = "edef2bbde0fbf0d88232782a0eded323f483a0519d6fde9a3b1809056fd35f3e"
-
-inherit autotools texinfo
-
-EXTRA_OECONF = "'CC=${CC}' 'CXX=${CXX}' 'CFLAGS=${CFLAGS}' 'CXXFLAGS=${CXXFLAGS}' 'CPPFLAGS=${CPPFLAGS}' 'LDFLAGS=${LDFLAGS}'"
-
-CONFIGUREOPTS_remove = "--disable-dependency-tracking"
-CONFIGUREOPTS_remove = "--disable-silent-rules"
-EXTRA_OECONF_remove = "--disable-static"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.14.1.bb b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.14.1.bb
new file mode 100644
index 0000000..7e6bde4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.14.1.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Line-oriented text editor"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7 \
+                    file://ed.h;endline=20;md5=4e36b7a40e137f42aee718165590d125 \
+                    file://main.c;endline=17;md5=c5b8f78f115df187af76868a2aead16a"
+
+SECTION = "base"
+
+# LSB states that ed should be in /bin/
+bindir = "${base_bindir}"
+
+# Upstream regularly removes previous releases from https://ftp.gnu.org/gnu/ed/
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/${BP}.tar.lz"
+UPSTREAM_CHECK_URI = "${GNU_MIRROR}/ed/"
+
+SRC_URI[md5sum] = "7f4a54fa7f366479f03654b8af645fd0"
+SRC_URI[sha256sum] = "ffb97eb8f2a2b5a71a9b97e3872adce953aa1b8958e04c5b7bf11d556f32552a"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+inherit texinfo
+
+do_configure() {
+	${S}/configure
+}
+
+do_install() {
+	oe_runmake 'DESTDIR=${D}' install
+	# Info dir listing isn't interesting at this point so remove it if it exists.
+	if [ -e "${D}${infodir}/dir" ]; then
+		rm -f ${D}${infodir}/dir
+	fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb
deleted file mode 100644
index d128de3..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb
+++ /dev/null
@@ -1,33 +0,0 @@
-SUMMARY = "Line-oriented text editor"
-HOMEPAGE = "http://www.gnu.org/software/ed/"
-
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
-                    file://ed.h;endline=20;md5=375a20cc2545ac1115eeb7b323c60ae3 \
-                    file://main.c;endline=17;md5=14dbb325c1f2d4daf50e0aa5c5038e96"
-
-SECTION = "base"
-
-# LSB states that ed should be in /bin/
-bindir = "${base_bindir}"
-
-SRC_URI = "https://ftp.osuosl.org/pub/blfs/conglomeration/ed/ed-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "565b6d1d5a9a8816b9b304fc4ed9405d"
-SRC_URI[sha256sum] = "d5b372cfadf073001823772272fceac2cfa87552c5cd5a8efc1c8aae61f45a88"
-
-EXTRA_OEMAKE = "-e MAKEFLAGS="
-
-inherit texinfo
-
-do_configure() {
-	${S}/configure
-}
-
-do_install() {
-	oe_runmake 'DESTDIR=${D}' install
-	# Info dir listing isn't interesting at this point so remove it if it exists.
-	if [ -e "${D}${infodir}/dir" ]; then
-		rm -f ${D}${infodir}/dir
-	fi
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.6.bb b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.6.bb
deleted file mode 100644
index 788d4ea..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.6.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-SUMMARY = "Display or change ethernet card settings"
-DESCRIPTION = "A small utility for examining and tuning the settings of your ethernet-based network interfaces."
-HOMEPAGE = "http://www.kernel.org/pub/software/network/ethtool/"
-SECTION = "console/network"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://ethtool.c;beginline=4;endline=17;md5=c19b30548c582577fc6b443626fc1216"
-
-SRC_URI = "${KERNELORG_MIRROR}/software/network/ethtool/ethtool-${PV}.tar.gz \
-           file://run-ptest \
-           file://avoid_parallel_tests.patch \
-           "
-
-SRC_URI[md5sum] = "1186dd83a0384109b92c6cd40a7bb0e5"
-SRC_URI[sha256sum] = "ad45620887f7e61312fc2f9ca3fd50d49ac7737ed874b0b02845d07e0fa3ca49"
-
-inherit autotools ptest
-RDEPENDS_${PN}-ptest += "make"
-
-do_compile_ptest() {
-   oe_runmake buildtest-TESTS
-}
-
-do_install_ptest () {
-   cp ${B}/Makefile                 ${D}${PTEST_PATH}
-   install ${B}/test-cmdline        ${D}${PTEST_PATH}
-   install ${B}/test-features       ${D}${PTEST_PATH}
-   install ${B}/ethtool             ${D}${PTEST_PATH}/ethtool
-   sed -i 's/^Makefile/_Makefile/'  ${D}${PTEST_PATH}/Makefile
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.8.bb b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.8.bb
new file mode 100644
index 0000000..afaf2e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.8.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Display or change ethernet card settings"
+DESCRIPTION = "A small utility for examining and tuning the settings of your ethernet-based network interfaces."
+HOMEPAGE = "http://www.kernel.org/pub/software/network/ethtool/"
+SECTION = "console/network"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://ethtool.c;beginline=4;endline=17;md5=c19b30548c582577fc6b443626fc1216"
+
+SRC_URI = "https://downloads.yoctoproject.org/mirror/sources/ethtool-${PV}.tar.gz \
+           file://run-ptest \
+           file://avoid_parallel_tests.patch \
+           "
+
+SRC_URI[md5sum] = "28c4a4d85c33f573c49ff6d81ec094fd"
+SRC_URI[sha256sum] = "1bd82ebe3d41de1b7b0d8f4fb18a8e8466fba934c952bc5c5002836ffa8bb606"
+
+inherit autotools ptest
+RDEPENDS_${PN}-ptest += "make"
+
+do_compile_ptest() {
+   oe_runmake buildtest-TESTS
+}
+
+do_install_ptest () {
+   cp ${B}/Makefile                 ${D}${PTEST_PATH}
+   install ${B}/test-cmdline        ${D}${PTEST_PATH}
+   install ${B}/test-features       ${D}${PTEST_PATH}
+   install ${B}/ethtool             ${D}${PTEST_PATH}/ethtool
+   sed -i 's/^Makefile/_Makefile/'  ${D}${PTEST_PATH}/Makefile
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch
deleted file mode 100644
index 2076e44..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 33cba24cba7b0973a702e9627bd5b93962948ae4 Mon Sep 17 00:00:00 2001
-From: Jackie Huang <jackie.huang@windriver.com>
-Date: Tue, 17 Sep 2013 16:11:16 +0800
-Subject: [PATCH] findutils: fix doc build error
-
-Upstream-Status: Backport
-
-Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
----
- doc/find.texi |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/doc/find.texi b/doc/find.texi
-index 5b5f0cf..b3d9c6b 100644
---- a/doc/find.texi
-+++ b/doc/find.texi
-@@ -63,7 +63,7 @@ translation approved by the Foundation.
-
- @page
- @vskip 0pt plus 1filll
--@insertcopying{}
-+@insertcopying
- @end titlepage
-
- @contents
-@@ -1466,6 +1466,7 @@ no output is ever sent to it.
- * Escapes::
- * Format Directives::
- * Time Formats::
-+* Formatting Flags::
- @end menu
-
- @node Escapes
-@@ -1534,7 +1535,6 @@ from the novel you are reading.
- * Size Directives::
- * Location Directives::
- * Time Directives::
--* Formatting Flags::
- @end menu
-
- @node Name Directives
-@@ -1780,7 +1780,7 @@ setting the TZ environment variable).  This is a GNU extension.
- @end table
-
- @node Formatting Flags
--@subsubsection Formatting Flags
-+@subsection Formatting Flags
-
- The @samp{%m} and @samp{%d} directives support the @samp{#}, @samp{0}
- and @samp{+} flags, but the other directives do not, even if they
---
-1.7.4.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch
deleted file mode 100644
index 1b7f8cf..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Upstream-Status: Pending
-
-automake 1.12 has depricated automatic de-ANSI-fication support
-
-this patch avoids these kinds of errors:
-
-| configure.in:75: error: automatic de-ANSI-fication support has been removed
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
-2012/05/04
-
-Index: findutils-4.2.31/configure.in
-===================================================================
---- findutils-4.2.31.orig/configure.in
-+++ findutils-4.2.31/configure.in
-@@ -72,7 +72,6 @@ dnl gl_EARLY calls AC_GNU_SOURCE anyway.
- 
- 
- AC_ISC_POSIX
--AM_C_PROTOTYPES
- 
- AC_PROG_INSTALL
- AC_PROG_RANLIB
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
deleted file mode 100644
index 65bd642..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-Upstream-Status: Inappropriate [legacy version]
-
-the old AC_USE_SYSTEM_EXTENSIONS won't work with AC_GNU_SOURCE
-
-against 4.2.31
-07/08/2010 - qhe
-
-diff --git a/gnulib/m4/extensions.m4 b/gnulib/m4/extensions.m4
-index 143a9e5..0f27ceb 100644
---- a/gnulib/m4/extensions.m4
-+++ b/gnulib/m4/extensions.m4
-@@ -12,44 +12,6 @@
- # enough in this area it's likely we'll need to redefine
- # AC_USE_SYSTEM_EXTENSIONS for quite some time.
- 
--# AC_USE_SYSTEM_EXTENSIONS
--# ------------------------
--# Enable extensions on systems that normally disable them,
--# typically due to standards-conformance issues.
--AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
--[
--  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
--  AC_BEFORE([$0], [AC_RUN_IFELSE])
--
--  AC_REQUIRE([AC_GNU_SOURCE])
--  AC_REQUIRE([AC_AIX])
--  AC_REQUIRE([AC_MINIX])
--
--  AH_VERBATIM([__EXTENSIONS__],
--[/* Enable extensions on Solaris.  */
--#ifndef __EXTENSIONS__
--# undef __EXTENSIONS__
--#endif
--#ifndef _POSIX_PTHREAD_SEMANTICS
--# undef _POSIX_PTHREAD_SEMANTICS
--#endif
--#ifndef _TANDEM_SOURCE
--# undef _TANDEM_SOURCE
--#endif])
--  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
--    [ac_cv_safe_to_define___extensions__],
--    [AC_COMPILE_IFELSE(
--       [AC_LANG_PROGRAM([
--#	  define __EXTENSIONS__ 1
--	  AC_INCLUDES_DEFAULT])],
--       [ac_cv_safe_to_define___extensions__=yes],
--       [ac_cv_safe_to_define___extensions__=no])])
--  test $ac_cv_safe_to_define___extensions__ = yes &&
--    AC_DEFINE([__EXTENSIONS__])
--  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
--  AC_DEFINE([_TANDEM_SOURCE])
--])
--
- # gl_USE_SYSTEM_EXTENSIONS
- # ------------------------
- # Enable extensions on systems that normally disable them,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb
deleted file mode 100644
index 7dee018..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-PR = "r4"
-
-require findutils.inc
-
-SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
-           file://gnulib-extension.patch \
-           file://findutils_fix_for_automake-1.12.patch \
-           file://findutils-fix-doc-build-error.patch \
-           "
-
-SRC_URI[md5sum] = "a0e31a0f18a49709bf5a449867c8049a"
-SRC_URI[sha256sum] = "e0d34b8faca0b3cca0703f6c6b498afbe72f0ba16c35980c10ec9ef7724d6204"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/0001-gawk-fix-non-glibc-gcc-4-compilation.patch b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/0001-gawk-fix-non-glibc-gcc-4-compilation.patch
deleted file mode 100644
index bc9201b..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/0001-gawk-fix-non-glibc-gcc-4-compilation.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 53496e2e306b16ac59801553f775bcca164e6a39 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
-Date: Wed, 14 Sep 2016 16:20:37 +0100
-Subject: [PATCH] fix gcc >= 4 compilation
-
-| ../gawk-3.1.5/hard-locale.h: In function 'hard_locale':
-| ../gawk-3.1.5/hard-locale.h:43:20: error: invalid storage class for function 'xmalloc'
-|        static ptr_t xmalloc PARAMS ((size_t n));
-|                     ^~~~~~~
-
-| ../gawk-3.1.5/hard-locale.h:45:22: warning: implicit declaration of function 'xmalloc' [-Wimplicit-function-declaration]
-|        char *locale = xmalloc (strlen (p) + 1);
-|                       ^~~~~~~
-| ../gawk-3.1.5/hard-locale.h:45:22: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
-| ../gawk-3.1.5/dfa.c: At top level:
-| ../gawk-3.1.5/dfa.c:125:14: error: conflicting types for 'xmalloc'
-|  static ptr_t xmalloc PARAMS ((size_t n));
-|               ^~~~~~~
-| In file included from ../gawk-3.1.5/dfa.c:112:0:
-| ../gawk-3.1.5/hard-locale.h:45:22: note: previous implicit declaration of 'xmalloc' was here
-|        char *locale = xmalloc (strlen (p) + 1);
-|                       ^~~~~~~
-
-Upstream-Status: Inappropriate [required for gawk 3.1.5 (GPLv2) recipe only]
-
-Signed-off-by: André Draszik <git@andred.net>
----
- dfa.c         | 2 +-
- hard-locale.h | 2 --
- 2 files changed, 1 insertion(+), 3 deletions(-)
-
-diff --git a/dfa.c b/dfa.c
-index 71e3736..97f6045 100644
---- a/dfa.c
-+++ b/dfa.c
-@@ -109,6 +109,7 @@ extern void free();
- 
- #include "regex.h"
- #include "dfa.h"
-+static ptr_t xmalloc PARAMS ((size_t n));
- #include "hard-locale.h"
- 
- /* HPUX, define those as macros in sys/param.h */
-@@ -122,7 +123,6 @@ extern void free();
- static void dfamust PARAMS ((struct dfa *dfa));
- 
- static ptr_t xcalloc PARAMS ((size_t n, size_t s));
--static ptr_t xmalloc PARAMS ((size_t n));
- static ptr_t xrealloc PARAMS ((ptr_t p, size_t n));
- #ifdef DEBUG
- static void prtok PARAMS ((token t));
-diff --git a/hard-locale.h b/hard-locale.h
-index 0f4986b..9ee57e0 100644
---- a/hard-locale.h
-+++ b/hard-locale.h
-@@ -40,8 +40,6 @@ hard_locale (int category)
-       if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)
- 	hard = 0;
- # else
--      static ptr_t xmalloc PARAMS ((size_t n));
--
-       char *locale = xmalloc (strlen (p) + 1);
-       strcpy (locale, p);
- 
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch
deleted file mode 100644
index c42c33c..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-Upstream-Status: Pending
-
-automake 1.12 has depricated automatic de-ANSI-fication support
-
-this patch avoids these kinds of errors:
-
-| configure.ac:127: error: automatic de-ANSI-fication support has been removed
-| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
-| configure.ac:127: the top level
-| autom4te: m4 failed with exit status: 1
-...
-| Makefile.am:27: error: automatic de-ANSI-fication support has been removed
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
-2012/05/04
-
-Index: gawk-3.1.5/configure.ac
-===================================================================
---- gawk-3.1.5.orig/configure.ac
-+++ gawk-3.1.5/configure.ac
-@@ -124,7 +124,6 @@ fi
- 
- dnl check for C compiler for automake
- AM_PROG_CC_STDC
--AM_C_PROTOTYPES
- 
- dnl Cygwin doesn't like to get libs with full paths
- dnl since that overrides linking against DLLs.
-Index: gawk-3.1.5/Makefile.am
-===================================================================
---- gawk-3.1.5.orig/Makefile.am
-+++ gawk-3.1.5/Makefile.am
-@@ -24,7 +24,7 @@
- ## process this file with automake to produce Makefile.in
- 
- # Automatic de-ANSI-fication if needed, make .bz2 files also.
--AUTOMAKE_OPTIONS = ansi2knr dist-bzip2
-+AUTOMAKE_OPTIONS = dist-bzip2
- 
- # This undocumented variable insures that aclocal runs
- # correctly after changing configure.ac
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.4/run-ptest
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest
rename to import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.4/run-ptest
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.4/test-arrayind1-Remove-hashbang-line.patch b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.4/test-arrayind1-Remove-hashbang-line.patch
new file mode 100644
index 0000000..d4262ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.4/test-arrayind1-Remove-hashbang-line.patch
@@ -0,0 +1,30 @@
+From a3a3f26078223c47871c7b53e5c015ad163ae045 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Thu, 3 Nov 2016 14:50:52 -0200
+Subject: [PATCH] test/arrayind1: Remove hashbang line
+Organization: O.S. Systems Software LTDA.
+
+Remove "#!/usr/local/bin/awk -f" as none of the other awk scripts in the
+test suite have a hashbang.
+
+Upstream-Status: Submitted [1]
+
+[1] https://lists.gnu.org/archive/html/bug-gawk/2016-11/msg00003.html
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ test/arrayind1.awk | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/test/arrayind1.awk b/test/arrayind1.awk
+index 5d4a6f3..59e8b4e 100755
+--- a/test/arrayind1.awk
++++ b/test/arrayind1.awk
+@@ -1,4 +1,3 @@
+-#!/usr/local/bin/awk -f
+ # this script renums pedigrees with metafounders
+ # so that they are added *before*regular animals
+ # mf are ascertained because they are not in the 1st column
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb
deleted file mode 100644
index 63fd32f..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb
+++ /dev/null
@@ -1,44 +0,0 @@
-SUMMARY = "GNU awk text processing utility"
-DESCRIPTION = "The GNU version of awk, a text processing utility. \
-Awk interprets a special-purpose programming language to do \
-quick and easy text pattern matching and reformatting jobs."
-HOMEPAGE = "www.gnu.org/software/gawk"
-BUGTRACKER  = "bug-gawk@gnu.org"
-SECTION = "console/utils"
-
-# gawk <= 3.1.5: GPLv2
-# gawk >= 3.1.6: GPLv3
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-
-RDEPENDS_gawk += "gawk-common"
-RDEPENDS_pgawk += "gawk-common"
-PR = "r2"
-
-SRC_URI = "\
-    ${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
-    file://gawk-3.1.5_fix_for_automake-1.12.patch \
-    file://0001-gawk-fix-non-glibc-gcc-4-compilation.patch \
-"
-
-SRC_URI[md5sum] = "4760325489479cac17fe0114b8f62f30"
-SRC_URI[sha256sum] = "463dcb9d0ca398b1d4f5a332f6cd9cec56441265fca616f2ea1b44d459e9f0f8"
-
-inherit autotools gettext texinfo update-alternatives
-
-PACKAGES += "gawk-common pgawk"
-
-FILES_${PN} = "${bindir}/gawk* ${bindir}/igawk"
-FILES_gawk-common += "${datadir}/awk/* ${libexecdir}/awk/*"
-FILES_pgawk = "${bindir}/pgawk*"
-
-ALTERNATIVE_${PN} = "awk"
-ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
-ALTERNATIVE_PRIORITY = "100"
-
-CFLAGS += "-D PROTOTYPES"
-
-do_install_append() {
-	# remove the link since we don't package it
-	rm ${D}${bindir}/awk
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb
deleted file mode 100644
index 6ca7f3e..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb
+++ /dev/null
@@ -1,46 +0,0 @@
-SUMMARY = "GNU awk text processing utility"
-DESCRIPTION = "The GNU version of awk, a text processing utility. \
-Awk interprets a special-purpose programming language to do \
-quick and easy text pattern matching and reformatting jobs."
-HOMEPAGE = "https://www.gnu.org/software/gawk/"
-BUGTRACKER  = "bug-gawk@gnu.org"
-SECTION = "console/utils"
-
-# gawk <= 3.1.5: GPLv2
-# gawk >= 3.1.6: GPLv3
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-DEPENDS += "readline"
-
-PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
-
-SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
-           file://run-ptest \
-"
-
-SRC_URI[md5sum] = "55d37f4069502677f25d1340df8eec97"
-SRC_URI[sha256sum] = "524effa5b9ecd4ed940f2581c5d3c1df4e4bd7e6f768aa033c1916f47dfc6e29"
-
-inherit autotools gettext texinfo update-alternatives
-
-FILES_${PN} += "${datadir}/awk"
-FILES_${PN}-dev += "${libdir}/${BPN}/*.la"
-
-ALTERNATIVE_${PN} = "awk"
-ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
-ALTERNATIVE_PRIORITY = "100"
-
-do_install_append() {
-	# remove the link since we don't package it
-	rm ${D}${bindir}/awk
-}
-
-inherit ptest
-
-do_install_ptest() {
-	mkdir ${D}${PTEST_PATH}/test
-	for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests; \
-	  do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \
-	done
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.4.bb b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.4.bb
new file mode 100644
index 0000000..dda38ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.4.bb
@@ -0,0 +1,49 @@
+SUMMARY = "GNU awk text processing utility"
+DESCRIPTION = "The GNU version of awk, a text processing utility. \
+Awk interprets a special-purpose programming language to do \
+quick and easy text pattern matching and reformatting jobs."
+HOMEPAGE = "https://www.gnu.org/software/gawk/"
+BUGTRACKER  = "bug-gawk@gnu.org"
+SECTION = "console/utils"
+
+# gawk <= 3.1.5: GPLv2
+# gawk >= 3.1.6: GPLv3
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS += "readline"
+
+PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
+
+SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
+           file://run-ptest \
+           file://test-arrayind1-Remove-hashbang-line.patch \
+"
+
+SRC_URI[md5sum] = "f20c94ca51b6ebfc9bffb90f95c8ffbb"
+SRC_URI[sha256sum] = "8c03080e2b5a56263e8783f6f1f306398d4591be18254041f3f547efef944d35"
+
+inherit autotools gettext texinfo update-alternatives
+
+FILES_${PN} += "${datadir}/awk"
+FILES_${PN}-dev += "${libdir}/${BPN}/*.la"
+
+ALTERNATIVE_${PN} = "awk"
+ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
+ALTERNATIVE_PRIORITY = "100"
+
+do_install_append() {
+	# remove the link since we don't package it
+	rm ${D}${bindir}/awk
+}
+
+inherit ptest
+
+do_install_ptest() {
+	mkdir ${D}${PTEST_PATH}/test
+	for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests; \
+	  do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \
+	done
+}
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-7977.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-7977.patch
new file mode 100644
index 0000000..b7eed12
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-7977.patch
@@ -0,0 +1,33 @@
+From 8abd22010eb4db0fb1b10e430d5f5d83e015ef70 Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Mon, 3 Oct 2016 01:46:28 +0100
+Subject: [PATCH] Bug 697169: Be rigorous with SAFER permissions
+
+Once we've opened our input file from the command line, enforce the SAFER
+rules.
+
+Upstream-Status: Backport
+CVE: CVE-2016-7977
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ psi/zfile.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/psi/zfile.c b/psi/zfile.c
+index b6caea2..2c6c958 100644
+--- a/psi/zfile.c
++++ b/psi/zfile.c
+@@ -1081,6 +1081,9 @@ lib_file_open(gs_file_path_ptr  lib_path, const gs_memory_t *mem, i_ctx_t *i_ctx
+     gs_main_instance *minst = get_minst_from_memory(mem);
+     int code;
+ 
++    if (i_ctx_p && starting_arg_file)
++        i_ctx_p->starting_arg_file = false;
++
+     /* when starting arg files (@ files) iodev_default is not yet set */
+     if (iodev == 0)
+         iodev = (gx_io_device *)gx_io_device_table[0];
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-7978.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-7978.patch
new file mode 100644
index 0000000..668f205
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-7978.patch
@@ -0,0 +1,30 @@
+From 6f749c0c44e7b9e09737b9f29edf29925a34f0cf Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Wed, 5 Oct 2016 09:59:25 +0100
+Subject: [PATCH] Bug 697179: Reference count device icc profile
+
+when copying a device
+
+Upstream-Status: Backport
+CVE: CVE-2016-7978
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ base/gsdevice.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/base/gsdevice.c b/base/gsdevice.c
+index 778106f..aea986a 100644
+--- a/base/gsdevice.c
++++ b/base/gsdevice.c
+@@ -614,6 +614,7 @@ gx_device_init(gx_device * dev, const gx_device * proto, gs_memory_t * mem,
+     dev->memory = mem;
+     dev->retained = !internal;
+     rc_init(dev, mem, (internal ? 0 : 1));
++    rc_increment(dev->icc_struct);
+ }
+ 
+ void
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-7979.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-7979.patch
new file mode 100644
index 0000000..9e930d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-7979.patch
@@ -0,0 +1,48 @@
+From 875a0095f37626a721c7ff57d606a0f95af03913 Mon Sep 17 00:00:00 2001
+From: Ken Sharp <ken.sharp@artifex.com>
+Date: Wed, 5 Oct 2016 10:10:58 +0100
+Subject: [PATCH] DSC parser - validate parameters
+
+Bug #697190 ".initialize_dsc_parser doesn't validate the parameter is a dict type before using it."
+
+Regardless of any security implications, its simply wrong for a PostScript
+operator not to validate its parameter(s).
+
+No differences expected.
+
+Upstream-Status: Backport
+CVE: CVE-2016-7979
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ psi/zdscpars.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/psi/zdscpars.c b/psi/zdscpars.c
+index c05e154..9b4b605 100644
+--- a/psi/zdscpars.c
++++ b/psi/zdscpars.c
+@@ -150,11 +150,16 @@ zinitialize_dsc_parser(i_ctx_t *i_ctx_p)
+     ref local_ref;
+     int code;
+     os_ptr const op = osp;
+-    dict * const pdict = op->value.pdict;
+-    gs_memory_t * const mem = (gs_memory_t *)dict_memory(pdict);
+-    dsc_data_t * const data =
+-        gs_alloc_struct(mem, dsc_data_t, &st_dsc_data_t, "DSC parser init");
++    dict *pdict;
++    gs_memory_t *mem;
++    dsc_data_t *data;
+ 
++    check_read_type(*op, t_dictionary);
++
++    pdict = op->value.pdict;
++    mem = (gs_memory_t *)dict_memory(pdict);
++
++    data = gs_alloc_struct(mem, dsc_data_t, &st_dsc_data_t, "DSC parser init");
+     if (!data)
+         return_error(gs_error_VMerror);
+     data->document_level = 0;
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-8602.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-8602.patch
new file mode 100644
index 0000000..e58567c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-8602.patch
@@ -0,0 +1,47 @@
+From f5c7555c30393e64ec1f5ab0dfae5b55b3b3fc78 Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Sat, 8 Oct 2016 16:10:27 +0100
+Subject: [PATCH] Bug 697203: check for sufficient params in .sethalftone5
+
+and param types
+
+Upstream-Status: Backport
+CVE: CVE-2016-8602
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ psi/zht2.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/psi/zht2.c b/psi/zht2.c
+index fb4a264..dfa27a4 100644
+--- a/psi/zht2.c
++++ b/psi/zht2.c
+@@ -82,14 +82,22 @@ zsethalftone5(i_ctx_t *i_ctx_p)
+     gs_memory_t *mem;
+     uint edepth = ref_stack_count(&e_stack);
+     int npop = 2;
+-    int dict_enum = dict_first(op);
++    int dict_enum;
+     ref rvalue[2];
+     int cname, colorant_number;
+     byte * pname;
+     uint name_size;
+     int halftonetype, type = 0;
+     gs_gstate *pgs = igs;
+-    int space_index = r_space_index(op - 1);
++    int space_index;
++
++    if (ref_stack_count(&o_stack) < 2)
++        return_error(gs_error_stackunderflow);
++    check_type(*op, t_dictionary);
++    check_type(*(op - 1), t_dictionary);
++
++    dict_enum = dict_first(op);
++    space_index = r_space_index(op - 1);
+ 
+     mem = (gs_memory_t *) idmemory->spaces_indexed[space_index];
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-11714.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-11714.patch
new file mode 100644
index 0000000..84983c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-11714.patch
@@ -0,0 +1,61 @@
+From 671fd59eb657743aa86fbc1895cb15872a317caa Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Thu, 6 Jul 2017 14:54:02 +0100
+Subject: [PATCH] Bug 698158: prevent trying to reloc a freed object
+
+In the token reader, we pass the scanner state structure around as a
+t_struct ref on the Postscript operand stack.
+
+But we explicitly free the scanner state when we're done, which leaves a
+dangling reference on the operand stack and, unless that reference gets
+overwritten before the next garbager run, we can end up with the garbager
+trying to deal with an already freed object - that can cause a crash, or
+memory corruption.
+---
+ psi/ztoken.c |   14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-11714
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/psi/ztoken.c b/psi/ztoken.c
+index 4dba7c5..af1ceeb 100644
+--- a/psi/ztoken.c
++++ b/psi/ztoken.c
+@@ -107,6 +107,12 @@ token_continue(i_ctx_t *i_ctx_p, scanner_state * pstate, bool save)
+     int code;
+     ref token;
+ 
++    /* Since we might free pstate below, and we're dealing with
++     * gc memory referenced by the stack, we need to explicitly
++     * remove the reference to pstate from the stack, otherwise
++     * the garbager will fall over
++     */
++    make_null(osp);
+     /* Note that gs_scan_token may change osp! */
+     pop(1);                     /* remove the file or scanner state */
+ again:
+@@ -183,8 +189,14 @@ ztokenexec_continue(i_ctx_t *i_ctx_p)
+ static int
+ tokenexec_continue(i_ctx_t *i_ctx_p, scanner_state * pstate, bool save)
+ {
+-    os_ptr op;
++    os_ptr op = osp;
+     int code;
++    /* Since we might free pstate below, and we're dealing with
++     * gc memory referenced by the stack, we need to explicitly
++     * remove the reference to pstate from the stack, otherwise
++     * the garbager will fall over
++     */
++    make_null(osp);
+     /* Note that gs_scan_token may change osp! */
+     pop(1);
+ again:
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7975.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7975.patch
new file mode 100644
index 0000000..d0886c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7975.patch
@@ -0,0 +1,36 @@
+From 5e57e483298dae8b8d4ec9aab37a526736ac2e97 Mon Sep 17 00:00:00 2001
+From: Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
+Date: Wed, 26 Apr 2017 22:12:14 +0100
+Subject: [PATCH] Bug 697693: Prevent SEGV due to integer overflow.
+
+While building a Huffman table, the start and end points were susceptible
+to integer overflow.
+
+Thank you to Jiaqi for finding this issue and suggesting a patch.
+
+Upstream-Status: Backport
+CVE: CVE-2017-7975
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ jbig2dec/jbig2_huffman.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/jbig2dec/jbig2_huffman.c b/jbig2dec/jbig2_huffman.c
+index 511e461..b4189a1 100644
+--- a/jbig2dec/jbig2_huffman.c
++++ b/jbig2dec/jbig2_huffman.c
+@@ -421,8 +421,8 @@ jbig2_build_huffman_table(Jbig2Ctx *ctx, const Jbig2HuffmanParams *params)
+ 
+             if (PREFLEN == CURLEN) {
+                 int RANGELEN = lines[CURTEMP].RANGELEN;
+-                int start_j = CURCODE << shift;
+-                int end_j = (CURCODE + 1) << shift;
++                uint32_t start_j = CURCODE << shift;
++                uint32_t end_j = (CURCODE + 1) << shift;
+                 byte eflags = 0;
+ 
+                 if (end_j > max_j) {
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9216.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9216.patch
new file mode 100644
index 0000000..1caeb3e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9216.patch
@@ -0,0 +1,36 @@
+From 3ebffb1d96ba0cacec23016eccb4047dab365853 Mon Sep 17 00:00:00 2001
+From: Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
+Date: Wed, 24 May 2017 19:29:57 +0100
+Subject: [PATCH] Bug 697934: Fix SEGV due to error code being ignored.
+
+The return code from jbig2_decode_text_region was being ignored so the
+code continued to try and parse the invalid file using incomplete/empty
+structures.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9216
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ jbig2dec/jbig2_symbol_dict.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/jbig2dec/jbig2_symbol_dict.c b/jbig2dec/jbig2_symbol_dict.c
+index 3cc1731..672425d 100644
+--- a/jbig2dec/jbig2_symbol_dict.c
++++ b/jbig2dec/jbig2_symbol_dict.c
+@@ -493,8 +493,10 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+                         }
+ 
+                         /* multiple symbols are handled as a text region */
+-                        jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,
++                        code = jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,
+                                                  n_refagg_dicts, image, data, size, GR_stats, as, ws);
++                        if (code < 0)
++                            goto cleanup4;
+ 
+                         SDNEWSYMS->glyphs[NSYMSDECODED] = image;
+                         refagg_dicts[0]->glyphs[params->SDNUMINSYMS + NSYMSDECODED] = jbig2_image_clone(ctx, SDNEWSYMS->glyphs[NSYMSDECODED]);
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9611.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9611.patch
new file mode 100644
index 0000000..58ef04d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9611.patch
@@ -0,0 +1,34 @@
+From c7c55972758a93350882c32147801a3485b010fe Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Mon, 12 Jun 2017 13:08:40 +0100
+Subject: [PATCH] Bug 698024: bounds check zone pointer in Ins_MIRP()
+
+---
+ base/ttinterp.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9611
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/base/ttinterp.c b/base/ttinterp.c
+index e56aec6..f6a6d95 100644
+--- a/base/ttinterp.c
++++ b/base/ttinterp.c
+@@ -3858,7 +3858,8 @@ static int nInstrCount=0;
+     /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */
+ 
+     if ( BOUNDS( args[0],   CUR.zp1.n_points ) ||
+-         BOUNDS( args[1]+1, CUR.cvtSize+1 )    )
++         BOUNDS( args[1]+1, CUR.cvtSize+1 )    ||
++         BOUNDS(CUR.GS.rp0,  CUR.zp0.n_points) )
+     {
+       CUR.error = TT_Err_Invalid_Reference;
+       return;
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9612.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9612.patch
new file mode 100644
index 0000000..b737cc5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9612.patch
@@ -0,0 +1,35 @@
+From 98f6da60b9d463c617e631fc254cf6d66f2e8e3c Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Mon, 12 Jun 2017 13:15:17 +0100
+Subject: [PATCH] Bug 698026: bounds check zone pointers in Ins_IP()
+
+---
+ base/ttinterp.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9612
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/base/ttinterp.c b/base/ttinterp.c
+index f6a6d95..e7c9d68 100644
+--- a/base/ttinterp.c
++++ b/base/ttinterp.c
+@@ -4129,7 +4129,9 @@ static int nInstrCount=0;
+     Int         point;
+     (void)args;
+ 
+-    if ( CUR.top < CUR.GS.loop )
++    if ( CUR.top < CUR.GS.loop ||
++         BOUNDS(CUR.GS.rp1, CUR.zp0.n_points) ||
++         BOUNDS(CUR.GS.rp2, CUR.zp1.n_points))
+     {
+       CUR.error = TT_Err_Invalid_Reference;
+       return;
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9726.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9726.patch
new file mode 100644
index 0000000..3e6c656
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9726.patch
@@ -0,0 +1,33 @@
+From 7755e67116e8973ee0e3b22d653df026a84fa01b Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Thu, 15 Jun 2017 08:58:31 +0100
+Subject: [PATCH] Bug 698055: bounds check zone pointer in Ins_MDRP
+
+---
+ base/ttinterp.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9726
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+diff --git a/base/ttinterp.c b/base/ttinterp.c
+index e7c9d68..af457e8 100644
+--- a/base/ttinterp.c
++++ b/base/ttinterp.c
+@@ -3770,7 +3770,8 @@ static int nInstrCount=0;
+ 
+     point = (Int)args[0];
+ 
+-    if ( BOUNDS( args[0], CUR.zp1.n_points ) )
++    if ( BOUNDS( args[0], CUR.zp1.n_points ) ||
++         BOUNDS( CUR.GS.rp0, CUR.zp0.n_points) )
+     {
+         /* Current version of FreeType silently ignores this out of bounds error
+          * and drops the instruction, see bug #691121
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9727.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9727.patch
new file mode 100644
index 0000000..a2f7bfa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9727.patch
@@ -0,0 +1,35 @@
+From 937ccd17ac65935633b2ebc06cb7089b91e17e6b Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Thu, 15 Jun 2017 09:05:20 +0100
+Subject: [PATCH] Bug 698056: make bounds check in gx_ttfReader__Read more
+ robust
+
+---
+ base/gxttfb.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9727
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/base/gxttfb.c b/base/gxttfb.c
+index 0e9a444..e1561af 100644
+--- a/base/gxttfb.c
++++ b/base/gxttfb.c
+@@ -79,7 +79,8 @@ static void gx_ttfReader__Read(ttfReader *self, void *p, int n)
+     if (!r->error) {
+         if (r->extra_glyph_index != -1) {
+             q = r->glyph_data.bits.data + r->pos;
+-            r->error = (r->glyph_data.bits.size - r->pos < n ?
++            r->error = ((r->pos >= r->glyph_data.bits.size ||
++                        r->glyph_data.bits.size - r->pos < n) ?
+                             gs_note_error(gs_error_invalidfont) : 0);
+             if (r->error == 0)
+                 memcpy(p, q, n);
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9739.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9739.patch
new file mode 100644
index 0000000..69a94df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9739.patch
@@ -0,0 +1,37 @@
+From c501a58f8d5650c8ba21d447c0d6f07eafcb0f15 Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Fri, 16 Jun 2017 08:29:25 +0100
+Subject: [PATCH] Bug 698063: Bounds check Ins_JMPR
+
+---
+ base/ttinterp.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- end of original header
+
+CVE: CVE-2017-9739
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/base/ttinterp.c b/base/ttinterp.c
+index af457e8..adf3f0c 100644
+--- a/base/ttinterp.c
++++ b/base/ttinterp.c
+@@ -1794,6 +1794,12 @@ static int nInstrCount=0;
+ 
+   static void  Ins_JMPR( INS_ARG )
+   {
++    if ( BOUNDS(CUR.IP + args[0], CUR.codeSize ) )
++    {
++      CUR.error = TT_Err_Invalid_Reference;
++      return;
++    }
++
+     CUR.IP      += (Int)(args[0]);
+     CUR.step_ins = FALSE;
+ 
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9835.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9835.patch
new file mode 100644
index 0000000..7c65690
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9835.patch
@@ -0,0 +1,125 @@
+From cfde94be1d4286bc47633c6e6eaf4e659bd78066 Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Wed, 7 Jun 2017 14:55:12 +0100
+Subject: [PATCH] Bug 697985: bounds check the array allocations methods
+
+The clump allocator has four allocation functions that use 'number of elements'
+and 'size of elements' parameters (rather than a simple 'number of bytes').
+
+Those need specific bounds checking.
+---
+ base/gsalloc.c |   42 ++++++++++++++++++++++++++++--------------
+ 1 file changed, 28 insertions(+), 14 deletions(-)
+
+--- end of original header
+
+CVE: CVE-2017-9835
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/base/gsalloc.c b/base/gsalloc.c
+index 741ba00..10c04dd 100644
+--- a/base/gsalloc.c
++++ b/base/gsalloc.c
+@@ -1248,19 +1248,32 @@ i_alloc_struct_immovable(gs_memory_t * mem, gs_memory_type_ptr_t pstype,
+     alloc_trace("|+<.", imem, cname, pstype, size, obj);
+     return obj;
+ }
++
++static inline bool
++alloc_array_check_size(ulong num_elements, ulong elt_size, ulong *lsize)
++{
++    int64_t s = (int64_t)num_elements * elt_size;
++    if (s > max_uint) {
++        return false;
++    }
++    *lsize = (ulong)s;
++    return true;
++}
++
+ static byte *
+ i_alloc_byte_array(gs_memory_t * mem, uint num_elements, uint elt_size,
+                    client_name_t cname)
+ {
+     gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
+     obj_header_t *obj;
+-
++    ulong lsize;
+ #ifdef MEMENTO
+     if (Memento_failThisEvent())
+         return NULL;
+ #endif
+-
+-    obj = alloc_obj(imem, (ulong) num_elements * elt_size,
++    if (alloc_array_check_size(num_elements, elt_size, &lsize) == false)
++        return NULL;
++    obj = alloc_obj(imem, lsize,
+                     &st_bytes, ALLOC_DIRECT, cname);
+ 
+     if_debug6m('A', mem, "[a%d:+b.]%s -bytes-*(%lu=%u*%u) = 0x%lx\n",
+@@ -1275,13 +1288,14 @@ i_alloc_byte_array_immovable(gs_memory_t * mem, uint num_elements,
+ {
+     gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
+     obj_header_t *obj;
+-
++    ulong lsize;
+ #ifdef MEMENTO
+     if (Memento_failThisEvent())
+         return NULL;
+ #endif
+-
+-    obj = alloc_obj(imem, (ulong) num_elements * elt_size,
++    if (alloc_array_check_size(num_elements, elt_size, &lsize) == false)
++        return NULL;
++    obj = alloc_obj(imem, lsize,
+                     &st_bytes, ALLOC_IMMOVABLE | ALLOC_DIRECT,
+                     cname);
+ 
+@@ -1297,7 +1311,7 @@ i_alloc_struct_array(gs_memory_t * mem, uint num_elements,
+ {
+     gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
+     obj_header_t *obj;
+-
++    ulong lsize;
+ #ifdef MEMENTO
+     if (Memento_failThisEvent())
+         return NULL;
+@@ -1311,9 +1325,9 @@ i_alloc_struct_array(gs_memory_t * mem, uint num_elements,
+         return NULL;		/* fail */
+     }
+ #endif
+-    obj = alloc_obj(imem,
+-                    (ulong) num_elements * pstype->ssize,
+-                    pstype, ALLOC_DIRECT, cname);
++    if (alloc_array_check_size(num_elements, pstype->ssize, &lsize) == false)
++        return NULL;
++    obj = alloc_obj(imem, lsize, pstype, ALLOC_DIRECT, cname);
+     if_debug7m('A', mem, "[a%d:+<.]%s %s*(%lu=%u*%u) = 0x%lx\n",
+                alloc_trace_space(imem), client_name_string(cname),
+                struct_type_name_string(pstype),
+@@ -1327,16 +1341,16 @@ i_alloc_struct_array_immovable(gs_memory_t * mem, uint num_elements,
+ {
+     gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
+     obj_header_t *obj;
+-
++    ulong lsize;
+ #ifdef MEMENTO
+     if (Memento_failThisEvent())
+         return NULL;
+ #endif
+ 
+     ALLOC_CHECK_SIZE(mem,pstype);
+-    obj = alloc_obj(imem,
+-                    (ulong) num_elements * pstype->ssize,
+-                    pstype, ALLOC_IMMOVABLE | ALLOC_DIRECT, cname);
++    if (alloc_array_check_size(num_elements, pstype->ssize, &lsize) == false)
++        return NULL;
++    obj = alloc_obj(imem, lsize, pstype, ALLOC_IMMOVABLE | ALLOC_DIRECT, cname);
+     if_debug7m('A', mem, "[a%d|+<.]%s %s*(%lu=%u*%u) = 0x%lx\n",
+                alloc_trace_space(imem), client_name_string(cname),
+                struct_type_name_string(pstype),
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
index 797b894..8fa2c40 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
@@ -1,40 +1,39 @@
-From be1e1b33191afdcfe3c2ecc4ff3e361a5859e9c6 Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Fri, 30 Jan 2015 00:40:22 -0800
-Subject: [PATCH] contrib.mak: fix for parallel build
+From 14937d9247330065359ca0fb648c28dfa5c3b224 Mon Sep 17 00:00:00 2001
+From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+Date: Tue, 13 Dec 2016 18:16:41 +0900
+Subject: [PATCH] ghostscript-9.15-parallel-make
 
-Fixed:
-rm: cannot remove `/usr/share/ghostscript/9.15/lib': Is a directory
+From 767bdf8a412b0cce2b734998e9b7e55abeaf932c Mon Sep 17 00:00:00 2001
+From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+Date: Tue, 13 Dec 2016 17:55:54 +0900
+Subject: [PATCH] Robert Yang <liezhi.yang@windriver.com> Date: Fri, 30 Jan
+2015 00:40:22 -0800  Subject: [PATCH] contrib.mak: fix for parallel build
 
-Create lib before install to fix the race issue.
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
 ---
- contrib/contrib.mak |    2 ++
+ contrib/contrib.mak | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/contrib/contrib.mak b/contrib/contrib.mak
-index 08a80d1..de2e20d 100644
+index 55415b3..0b6b5ae 100644
 --- a/contrib/contrib.mak
 +++ b/contrib/contrib.mak
-@@ -947,6 +947,7 @@ $(DEVOBJ)dviprlib.$(OBJ) : $(JAPSRC)dviprlib.c $(JAPSRC)dviprlib.h
+@@ -1099,6 +1099,7 @@ $(DEVOBJ)dviprlib.$(OBJ) : $(JAPSRC)dviprlib.c $(JAPSRC)dviprlib.h \
  	$(DEVCC) $(O_)$@ $(C_) $(JAPSRC)dviprlib.c
  
- extra-dmprt-install:
+ extra-dmprt-install: install-libdata
 +	mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib
  	$(INSTALL_DATA) $(JAPSRC)dmp_init.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
  	$(INSTALL_DATA) $(JAPSRC)dmp_site.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
  	$(INSTALL_DATA) $(JAPSRC)escp_24.src $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
-@@ -1088,6 +1089,7 @@ $(DEVOBJ)gdevalps.$(OBJ) : $(JAPSRC)gdevalps.c $(PDEVH)
+@@ -1267,6 +1268,7 @@ $(DEVOBJ)gdevalps.$(OBJ) : $(JAPSRC)gdevalps.c $(PDEVH) \
  ### ----------------- Additional .upp files ---------------- ###
  
- extra-upp-install:
+ extra-upp-install: install-libdata
 +	mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib
  	for f in $(CONTRIBSRC)uniprint$(D)*.upp; do \
  	    $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)$(D)lib || exit 1; \
  	done
 -- 
-1.7.9.5
+2.7.4
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h
deleted file mode 100644
index a05de29..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Parameters derived from machine and compiler architecture. */
-/* This file is generated mechanically by genarch.c. */
-
-	 /* ---------------- Scalar alignments ---------------- */
-
-#define ARCH_ALIGN_SHORT_MOD 2
-#define ARCH_ALIGN_INT_MOD 4
-#define ARCH_ALIGN_LONG_MOD 8
-#define ARCH_ALIGN_PTR_MOD 8
-#define ARCH_ALIGN_FLOAT_MOD 4
-#define ARCH_ALIGN_DOUBLE_MOD 8
-
-	 /* ---------------- Scalar sizes ---------------- */
-
-#define ARCH_LOG2_SIZEOF_CHAR 0
-#define ARCH_LOG2_SIZEOF_SHORT 1
-#define ARCH_LOG2_SIZEOF_INT 2
-#define ARCH_LOG2_SIZEOF_LONG 3
-#define ARCH_LOG2_SIZEOF_LONG_LONG 3
-#define ARCH_SIZEOF_GX_COLOR_INDEX 8
-#define ARCH_SIZEOF_PTR 8
-#define ARCH_SIZEOF_FLOAT 4
-#define ARCH_SIZEOF_DOUBLE 8
-#define ARCH_FLOAT_MANTISSA_BITS 24
-#define ARCH_DOUBLE_MANTISSA_BITS 53
-
-	 /* ---------------- Unsigned max values ---------------- */
-
-#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
-#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
-#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
-#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
-
-	 /* ---------------- Miscellaneous ---------------- */
-
-#define ARCH_IS_BIG_ENDIAN 0
-#define ARCH_PTRS_ARE_SIGNED 0
-#define ARCH_FLOATS_ARE_IEEE 1
-#define ARCH_ARITH_RSHIFT 2
-#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h
deleted file mode 100644
index 0d0a16b..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Parameters derived from machine and compiler architecture. */
-/* This file is generated mechanically by genarch.c. */
-
-	 /* ---------------- Scalar alignments ---------------- */
-
-#define ARCH_ALIGN_SHORT_MOD 2
-#define ARCH_ALIGN_INT_MOD 4
-#define ARCH_ALIGN_LONG_MOD 8
-#define ARCH_ALIGN_PTR_MOD 8
-#define ARCH_ALIGN_FLOAT_MOD 4
-#define ARCH_ALIGN_DOUBLE_MOD 8
-
-	 /* ---------------- Scalar sizes ---------------- */
-
-#define ARCH_LOG2_SIZEOF_CHAR 0
-#define ARCH_LOG2_SIZEOF_SHORT 1
-#define ARCH_LOG2_SIZEOF_INT 2
-#define ARCH_LOG2_SIZEOF_LONG 3
-#define ARCH_LOG2_SIZEOF_LONG_LONG 3
-#define ARCH_SIZEOF_GX_COLOR_INDEX 8
-#define ARCH_SIZEOF_PTR 8
-#define ARCH_SIZEOF_FLOAT 4
-#define ARCH_SIZEOF_DOUBLE 8
-#define ARCH_FLOAT_MANTISSA_BITS 24
-#define ARCH_DOUBLE_MANTISSA_BITS 53
-
-	 /* ---------------- Unsigned max values ---------------- */
-
-#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
-#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
-#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
-#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
-
-	 /* ---------------- Miscellaneous ---------------- */
-
-#define ARCH_IS_BIG_ENDIAN 1
-#define ARCH_PTRS_ARE_SIGNED 0
-#define ARCH_FLOATS_ARE_IEEE 1
-#define ARCH_ARITH_RSHIFT 2
-#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32eb/objarch.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h
rename to import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32eb/objarch.h
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32el/objarch.h
similarity index 100%
copy from import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h
copy to import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32el/objarch.h
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64eb/objarch.h
similarity index 100%
copy from import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h
copy to import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64eb/objarch.h
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64el/objarch.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h
rename to import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64el/objarch.h
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32eb/objarch.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h
rename to import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32eb/objarch.h
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32el/objarch.h
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h
rename to import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32el/objarch.h
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.19.bb b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.19.bb
deleted file mode 100644
index ab58157..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.19.bb
+++ /dev/null
@@ -1,110 +0,0 @@
-SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter"
-DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing.  Usually as \
-a back-end to a program such as ghostview, it can display PostScript and PDF \
-documents in an X11 environment. \
-\
-Furthermore, it can render PostScript and PDF files as graphics to be printed \
-on non-PostScript printers. Supported printers include common \
-dot-matrix, inkjet and laser models. \
-"
-HOMEPAGE = "http://www.ghostscript.com"
-SECTION = "console/utils"
-
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=b17cea54743435ab2a581c237bea294a"
-
-DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng"
-DEPENDS_class-native = "libpng-native"
-
-UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"
-
-SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs919/${BPN}-${PV}.tar.gz \
-                file://ghostscript-9.15-parallel-make.patch \
-                file://ghostscript-9.16-Werror-return-type.patch \
-                file://png_mak.patch \
-                file://do-not-check-local-libpng-source.patch \
-"
-
-SRC_URI = "${SRC_URI_BASE} \
-           file://ghostscript-9.02-prevent_recompiling.patch \
-           file://ghostscript-9.02-genarch.patch \
-           file://objarch.h \
-           file://cups-no-gcrypt.patch \
-           file://CVE-2017-7207.patch \
-           file://CVE-2016-10219.patch \
-           file://CVE-2016-10220.patch \
-           file://CVE-2017-5951.patch \
-           "
-
-SRC_URI_class-native = "${SRC_URI_BASE} \
-                        file://ghostscript-native-fix-disable-system-libtiff.patch \
-                        file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
-                        "
-
-SRC_URI[md5sum] = "c9682ce6b852f9197c69905a43928907"
-SRC_URI[sha256sum] = "cf3c0dce67db1557a87366969945f9c5235887989c0b585e037af366dc035989"
-
-EXTRA_OECONF = "--without-x --with-system-libtiff --without-jbig2dec \
-                --with-fontpath=${datadir}/fonts \
-                --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
-                --with-cups-datadir=${datadir}/cups \
-                "
-
-EXTRA_OECONF_append_mips = " --with-large_color_index=0"
-EXTRA_OECONF_append_mipsel = " --with-large_color_index=0"
-
-# Explicity disable libtiff, fontconfig,
-# freetype, cups for ghostscript-native
-EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \
-                             --without-jbig2dec \
-                             --with-fontpath=${datadir}/fonts \
-                             --without-libidn --disable-fontconfig \
-                             --disable-freetype --disable-cups"
-
-# This has been fixed upstream but for now we need to subvert the check for time.h
-# http://bugs.ghostscript.com/show_bug.cgi?id=692443
-# http://bugs.ghostscript.com/show_bug.cgi?id=692426
-CFLAGS += "-DHAVE_SYS_TIME_H=1"
-BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1"
-
-inherit autotools
-
-do_configure_prepend () {
-	mkdir -p obj
-	mkdir -p soobj
-	if [ -e ${WORKDIR}/objarch.h ]; then
-		cp ${WORKDIR}/objarch.h obj/arch.h
-	fi
-}
-
-do_configure_append () {
-	# copy tools from the native ghostscript build
-	if [ "${PN}" != "ghostscript-native" ]; then
-		mkdir -p obj/aux soobj
-		for i in genarch genconf mkromfs echogs gendev genht; do
-			cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i
-		done
-	fi
-}
-
-do_install_append () {
-    mkdir -p ${D}${datadir}/ghostscript/${PV}/
-    cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
-    cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
-}
-
-do_compile_class-native () {
-    mkdir -p obj
-    for i in genarch genconf mkromfs echogs gendev genht; do
-        oe_runmake obj/aux/$i
-    done
-}
-
-do_install_class-native () {
-    install -d ${D}${bindir}/ghostscript-${PV}
-    for i in genarch genconf mkromfs echogs gendev genht; do
-        install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i
-    done
-}
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.20.bb b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.20.bb
new file mode 100644
index 0000000..e1d9700
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.20.bb
@@ -0,0 +1,123 @@
+SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter"
+DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing.  Usually as \
+a back-end to a program such as ghostview, it can display PostScript and PDF \
+documents in an X11 environment. \
+\
+Furthermore, it can render PostScript and PDF files as graphics to be printed \
+on non-PostScript printers. Supported printers include common \
+dot-matrix, inkjet and laser models. \
+"
+HOMEPAGE = "http://www.ghostscript.com"
+SECTION = "console/utils"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=70dc2bac4d0ce4448da873cd86b123fc"
+
+DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng"
+DEPENDS_class-native = "libpng-native"
+
+UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
+
+SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/${BPN}-${PV}.tar.gz \
+                file://ghostscript-9.15-parallel-make.patch \
+                file://ghostscript-9.16-Werror-return-type.patch \
+                file://png_mak.patch \
+                file://do-not-check-local-libpng-source.patch \
+"
+
+SRC_URI = "${SRC_URI_BASE} \
+           file://ghostscript-9.02-prevent_recompiling.patch \
+           file://ghostscript-9.02-genarch.patch \
+           file://objarch.h \
+           file://cups-no-gcrypt.patch \
+           file://CVE-2017-7207.patch \
+           file://CVE-2016-10219.patch \
+           file://CVE-2016-10220.patch \
+           file://CVE-2017-5951.patch \
+           file://CVE-2016-8602.patch \
+           file://CVE-2017-7975.patch \
+           file://CVE-2016-7977.patch \
+           file://CVE-2016-7978.patch \
+           file://CVE-2016-7979.patch \
+           file://CVE-2017-9216.patch \
+           file://CVE-2017-9611.patch \
+           file://CVE-2017-9612.patch \
+           file://CVE-2017-9739.patch \
+           file://CVE-2017-9726.patch \
+           file://CVE-2017-9727.patch \
+           file://CVE-2017-9835.patch \
+           file://CVE-2017-11714.patch \
+           "
+
+SRC_URI_class-native = "${SRC_URI_BASE} \
+                        file://ghostscript-native-fix-disable-system-libtiff.patch \
+                        file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
+                        "
+
+SRC_URI[md5sum] = "93c5987cd3ab341108be1ebbaadc24fe"
+SRC_URI[sha256sum] = "949b64b46ecf8906db54a94ecf83ab97534ebf946f770d3c3f283cb469cb6e14"
+
+EXTRA_OECONF = "--without-x --with-system-libtiff --without-jbig2dec \
+                --with-fontpath=${datadir}/fonts \
+                --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
+                --with-cups-datadir=${datadir}/cups \
+                "
+
+EXTRA_OECONF_append_mipsarcho32 = " --with-large_color_index=0"
+
+# Explicity disable libtiff, fontconfig,
+# freetype, cups for ghostscript-native
+EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \
+                             --without-jbig2dec \
+                             --with-fontpath=${datadir}/fonts \
+                             --without-libidn --disable-fontconfig \
+                             --disable-freetype --disable-cups"
+
+# This has been fixed upstream but for now we need to subvert the check for time.h
+# http://bugs.ghostscript.com/show_bug.cgi?id=692443
+# http://bugs.ghostscript.com/show_bug.cgi?id=692426
+CFLAGS += "-DHAVE_SYS_TIME_H=1"
+BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1"
+
+inherit autotools
+
+do_configure_prepend () {
+	mkdir -p obj
+	mkdir -p soobj
+	if [ -e ${WORKDIR}/objarch.h ]; then
+		cp ${WORKDIR}/objarch.h obj/arch.h
+	fi
+}
+
+do_configure_append () {
+	# copy tools from the native ghostscript build
+	if [ "${PN}" != "ghostscript-native" ]; then
+		mkdir -p obj/aux soobj
+		for i in genarch genconf mkromfs echogs gendev genht; do
+			cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i
+		done
+	fi
+}
+
+do_install_append () {
+    mkdir -p ${D}${datadir}/ghostscript/${PV}/
+    cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
+    cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
+}
+
+do_compile_class-native () {
+    mkdir -p obj
+    for i in genarch genconf mkromfs echogs gendev genht; do
+        oe_runmake obj/aux/$i
+    done
+}
+
+do_install_class-native () {
+    install -d ${D}${bindir}/ghostscript-${PV}
+    for i in genarch genconf mkromfs echogs gendev genht; do
+        install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i
+    done
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/go-examples/files/helloworld.go b/import-layers/yocto-poky/meta/recipes-extended/go-examples/files/helloworld.go
new file mode 100644
index 0000000..0253c40
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/go-examples/files/helloworld.go
@@ -0,0 +1,10 @@
+// You can edit this code!
+// Click here and start typing.
+// taken from https://golang.org/
+package main
+
+import "fmt"
+
+func main() {
+	fmt.Println("Hello, 世界")
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/go-examples/go-examples.inc b/import-layers/yocto-poky/meta/recipes-extended/go-examples/go-examples.inc
new file mode 100644
index 0000000..c63268116
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/go-examples/go-examples.inc
@@ -0,0 +1,10 @@
+DESCRIPTION = "This is a simple example recipe that cross-compiles a Go program."
+SECTION = "examples"
+HOMEPAGE = "https://golang.org/"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+S = "${WORKDIR}"
+
+inherit go
diff --git a/import-layers/yocto-poky/meta/recipes-extended/go-examples/go-helloworld_0.1.bb b/import-layers/yocto-poky/meta/recipes-extended/go-examples/go-helloworld_0.1.bb
new file mode 100644
index 0000000..930c57d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/go-examples/go-helloworld_0.1.bb
@@ -0,0 +1,13 @@
+require go-examples.inc
+
+SRC_URI += " \
+  file://helloworld.go \
+"
+
+do_compile() {
+	go build helloworld.go
+}
+
+do_install() {
+	install -D -m 0755 ${S}/helloworld ${D}${bindir}/helloworld
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb
deleted file mode 100644
index 7728861..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-require gperf.inc
-
-LICENSE  = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a5f84abb0070adf8a0925d7d534b6e0a \
-                    file://src/main.cc;beginline=8;endline=19;md5=72a3034a19e72f08ee48ef8244a121fd"
-
-PR = "r1"
-
-SRC_URI[md5sum] = "cc20e58975a38075440423c8fb85fd00"
-SRC_URI[sha256sum] = "63287527c8d9e27e801cf0804436f3494bd569db05d49dcdd2a942ae72fa9055"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars
deleted file mode 100644
index 8b09f53..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars
+++ /dev/null
@@ -1,25 +0,0 @@
-# Makefile variables for PO directory in any package using GNU gettext.
-
-# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ..
-
-# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
-
-# This is the copyright holder that gets inserted into the header of the
-# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
-# package.  (Note that the msgstr strings, extracted from the package's
-# sources, belong to the copyright holder of the package.)  Translators are
-# expected to transfer the copyright for their translations to this person
-# or entity, or to disclaim their copyright.  The empty string stands for
-# the public domain; in this case the translators are expected to disclaim
-# their copyright.
-COPYRIGHT_HOLDER = Free Software Foundation, Inc.
-
-# This is the list of locale categories, beyond LC_MESSAGES, for which the
-# message catalogs shall be used.  It is usually empty.
-EXTRA_LOCALE_CATEGORIES =
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch
deleted file mode 100644
index ce59509..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Upstream-Status: Inappropriate [Poky Specific this is gplv2 version]
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-Index: grep-2.5.1a/doc/grep.texi
-===================================================================
---- grep-2.5.1a.orig/doc/grep.texi
-+++ grep-2.5.1a/doc/grep.texi
-@@ -288,7 +288,7 @@ This version number should be included i
- Print a usage message briefly summarizing these command-line options
- and the bug-reporting address, then exit.
- 
--@itemx --binary-files=@var{type}
-+@item --binary-files=@var{type}
- @opindex --binary-files
- @cindex binary files
- If the first few bytes of a file indicate that the file contains binary
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch
deleted file mode 100644
index 3b91520..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Always use locale.h as HAVE_LOCALE_H is no longer handled by ./configure
-Upstream-Status: Inappropriate [ old version that will not be maintained ]
-Signed-off-by: Alex DAMIAN <alexandru.damian@intel.com>
-
-diff --recursive --unified grep-2.5.1a-orig/lib/hard-locale.c grep-2.5.1a/lib/hard-locale.c
---- grep-2.5.1a-orig/lib/hard-locale.c	2001-03-04 07:33:12.000000000 +0200
-+++ grep-2.5.1a/lib/hard-locale.c	2013-03-11 17:05:52.086444891 +0200
-@@ -38,9 +38,7 @@
- # endif
- #endif
- 
--#if HAVE_LOCALE_H
- # include <locale.h>
--#endif
- 
- #if HAVE_STRING_H
- # include <string.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch
deleted file mode 100644
index 5746335..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Enable operation with later versions of gettext.
-
-Upstream-Status: Inappropriate
-RP 2012/10/19
-
-Index: grep-2.5.1a/configure.in
-===================================================================
---- grep-2.5.1a.orig/configure.in	2012-10-19 12:57:51.646970204 +0000
-+++ grep-2.5.1a/configure.in	2012-10-19 12:59:49.946968803 +0000
-@@ -140,4 +140,4 @@
- 	AC_CHECK_LIB(pcre, pcre_exec)
- fi
- 
--AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h])
-+AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [echo timestamp > stamp-h])
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch
deleted file mode 100644
index a40a9f3..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-The patch to fix CVE-2012-5667
-Reference: https://bugzilla.redhat.com/attachment.cgi?id=686605&action=diff
-
-Multiple integer overflows in GNU Grep before 2.11 might allow
-context-dependent attackers to execute arbitrary code via vectors
-involving a long input line that triggers a heap-based buffer overflow.
-
-http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-5667
-
-Upstream-Status: Inappropriate [other]
-This version of GNU Grep has been abandoned upstream and they are no longer
-accepting patches.  This is not a backport.
-CVE: CVE-2012-5667
-
-Signed-off-by: Ming Liu <ming.liu@windriver.com>
----
- grep.c |    7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
---- a/src/grep.c	2013-05-15 13:39:33.359191769 +0800
-+++ a/src/grep.c	2013-05-15 13:50:22.609191882 +0800
-@@ -306,6 +306,11 @@ fillbuf (size_t save, struct stats const
-   int cc = 1;
-   char *readbuf;
-   size_t readsize;
-+  const size_t max_save = INT_MAX / 2;
-+
-+  /* Limit the amount of saved data to INT_MAX to fix CVE-2012-5667 */
-+  if (save > max_save)
-+     error (2, 0, _("line too long"));
- 
-   /* Offset from start of buffer to start of old stuff
-      that we want to save.  */
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch
deleted file mode 100644
index 327ee56..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch
+++ /dev/null
@@ -1,1342 +0,0 @@
-From c884dd12ec062569335702848fc5f29f436c28fa Mon Sep 17 00:00:00 2001
-From: Li xin <lixin.fnst@cn.fujitsu.com>
-Date: Mon, 25 May 2015 10:15:57 +0900
-Subject: [PATCH] grep egrep fgrep: Fix LSB NG cases.
-
-The LSB core test requires grep egrep and fgrep can
-perform pattern matching in searches without regard
-to case if -i option is specified.
-
-Upstream-Status: backport.
-
-Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
----
- lib/posix/regex.h |   4 +
- src/dfa.c         |  22 +-
- src/grep.c        |  96 ++++---
- src/search.c      | 833 +++++++++++++++++++++++++++++++++++++++++++++---------
- 4 files changed, 768 insertions(+), 187 deletions(-)
-
-diff --git a/lib/posix/regex.h b/lib/posix/regex.h
-index 63c2fef..7bb2b0e 100644
---- a/lib/posix/regex.h
-+++ b/lib/posix/regex.h
-@@ -109,6 +109,10 @@ typedef unsigned long int reg_syntax_t;
-    If not set, \{, \}, {, and } are literals.  */
- #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
- 
-+/* If this bit is set, then ignore case when matching.
-+   If not set, then case is significant.  */
-+#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
-+
- /* If this bit is set, +, ? and | aren't recognized as operators.
-    If not set, they are.  */
- #define RE_LIMITED_OPS (RE_INTERVALS << 1)
-diff --git a/src/dfa.c b/src/dfa.c
-index 590bfa7..27c876a 100644
---- a/src/dfa.c
-+++ b/src/dfa.c
-@@ -414,7 +414,7 @@ update_mb_len_index (unsigned char const *p, int len)
- 
- /* This function fetch a wide character, and update cur_mb_len,
-    used only if the current locale is a multibyte environment.  */
--static wchar_t
-+static wint_t
- fetch_wc (char const *eoferr)
- {
-   wchar_t wc;
-@@ -423,7 +423,7 @@ fetch_wc (char const *eoferr)
-       if (eoferr != 0)
- 	dfaerror (eoferr);
-       else
--	return -1;
-+	return WEOF;
-     }
- 
-   cur_mb_len = mbrtowc(&wc, lexptr, lexleft, &mbs);
-@@ -459,7 +459,7 @@ fetch_wc (char const *eoferr)
- static void
- parse_bracket_exp_mb ()
- {
--  wchar_t wc, wc1, wc2;
-+  wint_t wc, wc1, wc2;
- 
-   /* Work area to build a mb_char_classes.  */
-   struct mb_char_classes *work_mbc;
-@@ -496,7 +496,7 @@ parse_bracket_exp_mb ()
-     work_mbc->invert = 0;
-   do
-     {
--      wc1 = -1; /* mark wc1 is not initialized".  */
-+      wc1 = WEOF; /* mark wc1 is not initialized".  */
- 
-       /* Note that if we're looking at some other [:...:] construct,
- 	 we just treat it as a bunch of ordinary characters.  We can do
-@@ -586,7 +586,7 @@ parse_bracket_exp_mb ()
- 		      work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem;
- 		    }
-  		}
--	      wc = -1;
-+	      wc1 = wc = WEOF;
- 	    }
- 	  else
- 	    /* We treat '[' as a normal character here.  */
-@@ -600,7 +600,7 @@ parse_bracket_exp_mb ()
- 	    wc = fetch_wc(("Unbalanced ["));
- 	}
- 
--      if (wc1 == -1)
-+      if (wc1 == WEOF)
- 	wc1 = fetch_wc(_("Unbalanced ["));
- 
-       if (wc1 == L'-')
-@@ -630,17 +630,17 @@ parse_bracket_exp_mb ()
- 	    }
- 	  REALLOC_IF_NECESSARY(work_mbc->range_sts, wchar_t,
- 			       range_sts_al, work_mbc->nranges + 1);
--	  work_mbc->range_sts[work_mbc->nranges] = wc;
-+	  work_mbc->range_sts[work_mbc->nranges] = (wchar_t)wc;
- 	  REALLOC_IF_NECESSARY(work_mbc->range_ends, wchar_t,
- 			       range_ends_al, work_mbc->nranges + 1);
--	  work_mbc->range_ends[work_mbc->nranges++] = wc2;
-+	  work_mbc->range_ends[work_mbc->nranges++] = (wchar_t)wc2;
- 	}
--      else if (wc != -1)
-+      else if (wc != WEOF)
- 	/* build normal characters.  */
- 	{
- 	  REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
- 			       work_mbc->nchars + 1);
--	  work_mbc->chars[work_mbc->nchars++] = wc;
-+	  work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc;
- 	}
-     }
-   while ((wc = wc1) != L']');
-@@ -2552,6 +2552,8 @@ match_mb_charset (struct dfa *d, int s, position pos, int index)
-     }
- 
-   /* match with a character?  */
-+  if (case_fold)
-+    wc = towlower (wc);
-   for (i = 0; i<work_mbc->nchars; i++)
-     {
-       if (wc == work_mbc->chars[i])
-diff --git a/src/grep.c b/src/grep.c
-index 2fb2fac..3fd4b47 100644
---- a/src/grep.c
-+++ b/src/grep.c
-@@ -30,6 +30,12 @@
- # include <sys/time.h>
- # include <sys/resource.h>
- #endif
-+#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
-+/* We can handle multibyte string.  */
-+# define MBS_SUPPORT
-+# include <wchar.h>
-+# include <wctype.h>
-+#endif
- #include <stdio.h>
- #include "system.h"
- #include "getopt.h"
-@@ -255,19 +261,6 @@ reset (int fd, char const *file, struct stats *stats)
-   bufbeg[-1] = eolbyte;
-   bufdesc = fd;
- 
--  if (fstat (fd, &stats->stat) != 0)
--    {
--      error (0, errno, "fstat");
--      return 0;
--    }
--  if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
--    return 0;
--#ifndef DJGPP
--  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
--#else
--  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
--#endif
--    return 0;
-   if (S_ISREG (stats->stat.st_mode))
-     {
-       if (file)
-@@ -558,33 +551,6 @@ prline (char const *beg, char const *lim, int sep)
-     {
-       size_t match_size;
-       size_t match_offset;
--      if(match_icase)
--        {
--	  /* Yuck, this is tricky */
--          char *buf = (char*) xmalloc (lim - beg);
--	  char *ibeg = buf;
--	  char *ilim = ibeg + (lim - beg);
--	  int i;
--	  for (i = 0; i < lim - beg; i++)
--	    ibeg[i] = tolower (beg[i]);
--	  while ((match_offset = (*execute) (ibeg, ilim-ibeg, &match_size, 1))
--		 != (size_t) -1)
--	    {
--	      char const *b = beg + match_offset;
--	      if (b == lim)
--		break;
--	      fwrite (beg, sizeof (char), match_offset, stdout);
--	      printf ("\33[%sm", grep_color);
--	      fwrite (b, sizeof (char), match_size, stdout);
--	      fputs ("\33[00m", stdout);
--	      beg = b + match_size;
--	      ibeg = ibeg + match_offset + match_size;
--	    }
--	  fwrite (beg, 1, lim - beg, stdout);
--	  free (buf);
--	  lastout = lim;
--	  return;
--	}
-       while (lim-beg && (match_offset = (*execute) (beg, lim - beg, &match_size, 1))
- 	     != (size_t) -1)
- 	{
-@@ -601,6 +567,7 @@ prline (char const *beg, char const *lim, int sep)
- 	  fputs ("\33[00m", stdout);
- 	  beg = b + match_size;
- 	}
-+      fputs ("\33[K", stdout);
-     }
-   fwrite (beg, 1, lim - beg, stdout);
-   if (ferror (stdout))
-@@ -623,7 +590,7 @@ prpending (char const *lim)
-       size_t match_size;
-       --pending;
-       if (outleft
--	  || (((*execute) (lastout, nl - lastout, &match_size, 0) == (size_t) -1)
-+	  || (((*execute) (lastout, nl + 1 - lastout, &match_size, 0) == (size_t) -1)
- 	      == !out_invert))
- 	prline (lastout, nl + 1, '-');
-       else
-@@ -895,6 +862,19 @@ grepfile (char const *file, struct stats *stats)
-     }
-   else
-     {
-+      if (stat (file, &stats->stat) != 0)
-+        {
-+          suppressible_error (file, errno);
-+          return 1;
-+        }
-+      if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
-+        return 1;
-+#ifndef DJGPP
-+      if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) || S_ISFIFO(stats->stat.st_mode)))
-+#else
-+      if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
-+#endif
-+        return 1;
-       while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
- 	continue;
- 
-@@ -1681,9 +1661,6 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"))
- 	  out_invert ^= 1;
- 	  match_lines = match_words = 0;
- 	}
--      else
--	/* Strip trailing newline. */
--        --keycc;
-     }
-   else
-     if (optind < argc)
-@@ -1697,6 +1674,37 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"))
-   if (!install_matcher (matcher) && !install_matcher ("default"))
-     abort ();
- 
-+#ifdef MBS_SUPPORT
-+  if (MB_CUR_MAX != 1 && match_icase)
-+    {
-+      wchar_t wc;
-+      mbstate_t cur_state, prev_state;
-+      int i, len = strlen(keys);
-+
-+      memset(&cur_state, 0, sizeof(mbstate_t));
-+      for (i = 0; i <= len ;)
-+	{
-+	  size_t mbclen;
-+	  mbclen = mbrtowc(&wc, keys + i, len - i, &cur_state);
-+	  if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
-+	    {
-+	      /* An invalid sequence, or a truncated multibyte character.
-+		 We treat it as a singlebyte character.  */
-+	      mbclen = 1;
-+	    }
-+	  else
-+	    {
-+	      if (iswupper((wint_t)wc))
-+		{
-+		  wc = towlower((wint_t)wc);
-+		  wcrtomb(keys + i, wc, &cur_state);
-+		}
-+	    }
-+	  i += mbclen;
-+	}
-+    }
-+#endif /* MBS_SUPPORT */
-+
-   (*compile)(keys, keycc);
- 
-   if ((argc - optind > 1 && !no_filenames) || with_filenames)
-diff --git a/src/search.c b/src/search.c
-index 7bd233f..3c6a485 100644
---- a/src/search.c
-+++ b/src/search.c
-@@ -18,9 +18,13 @@
- 
- /* Written August 1992 by Mike Haertel. */
- 
-+#ifndef _GNU_SOURCE
-+# define _GNU_SOURCE 1
-+#endif
- #ifdef HAVE_CONFIG_H
- # include <config.h>
- #endif
-+#include <assert.h>
- #include <sys/types.h>
- #if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
- /* We can handle multibyte string.  */
-@@ -31,7 +35,7 @@
- 
- #include "system.h"
- #include "grep.h"
--#include "regex.h"
-+#include <regex.h>
- #include "dfa.h"
- #include "kwset.h"
- #include "error.h"
-@@ -39,6 +43,9 @@
- #ifdef HAVE_LIBPCRE
- # include <pcre.h>
- #endif
-+#ifdef HAVE_LANGINFO_CODESET
-+# include <langinfo.h>
-+#endif
- 
- #define NCHAR (UCHAR_MAX + 1)
- 
-@@ -70,9 +77,10 @@ static kwset_t kwset;
-    call the regexp matcher at all. */
- static int kwset_exact_matches;
- 
--#if defined(MBS_SUPPORT)
--static char* check_multibyte_string PARAMS ((char const *buf, size_t size));
--#endif
-+/* UTF-8 encoding allows some optimizations that we can't otherwise
-+   assume in a multibyte encoding. */
-+static int using_utf8;
-+
- static void kwsinit PARAMS ((void));
- static void kwsmusts PARAMS ((void));
- static void Gcompile PARAMS ((char const *, size_t));
-@@ -84,6 +92,15 @@ static void Pcompile PARAMS ((char const *, size_t ));
- static size_t Pexecute PARAMS ((char const *, size_t, size_t *, int));
- 
- void
-+check_utf8 (void)
-+{
-+#ifdef HAVE_LANGINFO_CODESET
-+  if (strcmp (nl_langinfo (CODESET), "UTF-8") == 0)
-+    using_utf8 = 1;
-+#endif
-+}
-+
-+void
- dfaerror (char const *mesg)
- {
-   error (2, 0, mesg);
-@@ -141,38 +158,6 @@ kwsmusts (void)
-     }
- }
- 
--#ifdef MBS_SUPPORT
--/* This function allocate the array which correspond to "buf".
--   Then this check multibyte string and mark on the positions which
--   are not singlebyte character nor the first byte of a multibyte
--   character.  Caller must free the array.  */
--static char*
--check_multibyte_string(char const *buf, size_t size)
--{
--  char *mb_properties = malloc(size);
--  mbstate_t cur_state;
--  int i;
--  memset(&cur_state, 0, sizeof(mbstate_t));
--  memset(mb_properties, 0, sizeof(char)*size);
--  for (i = 0; i < size ;)
--    {
--      size_t mbclen;
--      mbclen = mbrlen(buf + i, size - i, &cur_state);
--
--      if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
--	{
--	  /* An invalid sequence, or a truncated multibyte character.
--	     We treat it as a singlebyte character.  */
--	  mbclen = 1;
--	}
--      mb_properties[i] = mbclen;
--      i += mbclen;
--    }
--
--  return mb_properties;
--}
--#endif
--
- static void
- Gcompile (char const *pattern, size_t size)
- {
-@@ -181,7 +166,8 @@ Gcompile (char const *pattern, size_t size)
-   size_t total = size;
-   char const *motif = pattern;
- 
--  re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE);
-+  check_utf8 ();
-+  re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0));
-   dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte);
- 
-   /* For GNU regex compiler we have to pass the patterns separately to detect
-@@ -218,6 +204,10 @@ Gcompile (char const *pattern, size_t size)
-       motif = sep;
-     } while (sep && total != 0);
- 
-+  /* Strip trailing newline. */
-+  if (size && pattern[size - 1] == '\n')
-+    size--;
-+
-   /* In the match_words and match_lines cases, we use a different pattern
-      for the DFA matcher that will quickly throw out cases that won't work.
-      Then if DFA succeeds we do some hairy stuff using the regex matcher
-@@ -233,7 +223,7 @@ Gcompile (char const *pattern, size_t size)
-       static char const line_end[] = "\\)$";
-       static char const word_beg[] = "\\(^\\|[^[:alnum:]_]\\)\\(";
-       static char const word_end[] = "\\)\\([^[:alnum:]_]\\|$\\)";
--      char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end);
-+      char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end);
-       size_t i;
-       strcpy (n, match_lines ? line_beg : word_beg);
-       i = strlen (n);
-@@ -257,14 +247,15 @@ Ecompile (char const *pattern, size_t size)
-   size_t total = size;
-   char const *motif = pattern;
- 
-+  check_utf8 ();
-   if (strcmp (matcher, "awk") == 0)
-     {
--      re_set_syntax (RE_SYNTAX_AWK);
-+      re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0));
-       dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte);
-     }
-   else
-     {
--      re_set_syntax (RE_SYNTAX_POSIX_EGREP);
-+      re_set_syntax (RE_SYNTAX_POSIX_EGREP | (match_icase ? RE_ICASE : 0));
-       dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte);
-     }
- 
-@@ -301,6 +292,10 @@ Ecompile (char const *pattern, size_t size)
-       motif = sep;
-     } while (sep && total != 0);
- 
-+  /* Strip trailing newline. */
-+  if (size && pattern[size - 1] == '\n')
-+    size--;
-+
-   /* In the match_words and match_lines cases, we use a different pattern
-      for the DFA matcher that will quickly throw out cases that won't work.
-      Then if DFA succeeds we do some hairy stuff using the regex matcher
-@@ -316,7 +311,7 @@ Ecompile (char const *pattern, size_t size)
-       static char const line_end[] = ")$";
-       static char const word_beg[] = "(^|[^[:alnum:]_])(";
-       static char const word_end[] = ")([^[:alnum:]_]|$)";
--      char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end);
-+      char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end);
-       size_t i;
-       strcpy (n, match_lines ? line_beg : word_beg);
-       i = strlen(n);
-@@ -339,15 +334,34 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
-   char eol = eolbyte;
-   int backref, start, len;
-   struct kwsmatch kwsm;
--  size_t i;
-+  size_t i, ret_val;
-+  static int use_dfa;
-+  static int use_dfa_checked = 0;
- #ifdef MBS_SUPPORT
--  char *mb_properties = NULL;
-+  int mb_cur_max = MB_CUR_MAX;
-+  mbstate_t mbs;
-+  memset (&mbs, '\0', sizeof (mbstate_t));
- #endif /* MBS_SUPPORT */
- 
-+  if (!use_dfa_checked)
-+    {
-+      char *grep_use_dfa = getenv ("GREP_USE_DFA");
-+      if (!grep_use_dfa)
-+	{
- #ifdef MBS_SUPPORT
--  if (MB_CUR_MAX > 1 && kwset)
--    mb_properties = check_multibyte_string(buf, size);
-+	  /* Turn off DFA when processing multibyte input. */
-+	  use_dfa = (MB_CUR_MAX == 1);
-+#else
-+	  use_dfa = 1;
- #endif /* MBS_SUPPORT */
-+	}
-+      else
-+	{
-+	  use_dfa = atoi (grep_use_dfa);
-+	}
-+
-+      use_dfa_checked = 1;
-+    }
- 
-   buflim = buf + size;
- 
-@@ -358,47 +372,120 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
- 	  if (kwset)
- 	    {
- 	      /* Find a possible match using the KWset matcher. */
--	      size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm);
-+#ifdef MBS_SUPPORT
-+	      size_t bytes_left = 0;
-+#endif /* MBS_SUPPORT */
-+	      size_t offset;
-+#ifdef MBS_SUPPORT
-+	      /* kwsexec doesn't work with match_icase and multibyte input. */
-+	      if (match_icase && mb_cur_max > 1)
-+		/* Avoid kwset */
-+		offset = 0;
-+	      else
-+#endif /* MBS_SUPPORT */
-+	      offset = kwsexec (kwset, beg, buflim - beg, &kwsm);
- 	      if (offset == (size_t) -1)
--		{
-+	        goto failure;
- #ifdef MBS_SUPPORT
--		  if (MB_CUR_MAX > 1)
--		    free(mb_properties);
--#endif
--		  return (size_t)-1;
-+	      if (mb_cur_max > 1 && !using_utf8)
-+		{
-+		  bytes_left = offset;
-+		  while (bytes_left)
-+		    {
-+		      size_t mlen = mbrlen (beg, bytes_left, &mbs);
-+		      if (mlen == (size_t) -1 || mlen == 0)
-+			{
-+			  /* Incomplete character: treat as single-byte. */
-+			  memset (&mbs, '\0', sizeof (mbstate_t));
-+			  beg++;
-+			  bytes_left--;
-+			  continue;
-+			}
-+
-+		      if (mlen == (size_t) -2)
-+			/* Offset points inside multibyte character:
-+			 * no good. */
-+			break;
-+
-+		      beg += mlen;
-+		      bytes_left -= mlen;
-+		    }
- 		}
-+	      else
-+#endif /* MBS_SUPPORT */
- 	      beg += offset;
- 	      /* Narrow down to the line containing the candidate, and
- 		 run it through DFA. */
- 	      end = memchr(beg, eol, buflim - beg);
- 	      end++;
- #ifdef MBS_SUPPORT
--	      if (MB_CUR_MAX > 1 && mb_properties[beg - buf] == 0)
-+	      if (mb_cur_max > 1 && bytes_left)
- 		continue;
--#endif
-+#endif /* MBS_SUPPORT */
- 	      while (beg > buf && beg[-1] != eol)
- 		--beg;
--	      if (kwsm.index < kwset_exact_matches)
--		goto success;
--	      if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
-+	      if (
-+#ifdef MBS_SUPPORT
-+		  !(match_icase && mb_cur_max > 1) &&
-+#endif /* MBS_SUPPORT */
-+		  (kwsm.index < kwset_exact_matches))
-+		goto success_in_beg_and_end;
-+	      if (use_dfa &&
-+		  dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
- 		continue;
- 	    }
- 	  else
- 	    {
- 	      /* No good fixed strings; start with DFA. */
--	      size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref);
-+#ifdef MBS_SUPPORT
-+	      size_t bytes_left = 0;
-+#endif /* MBS_SUPPORT */
-+	      size_t offset = 0;
-+	      if (use_dfa)
-+		offset = dfaexec (&dfa, beg, buflim - beg, &backref);
- 	      if (offset == (size_t) -1)
- 		break;
- 	      /* Narrow down to the line we've found. */
-+#ifdef MBS_SUPPORT
-+	      if (mb_cur_max > 1 && !using_utf8)
-+		{
-+		  bytes_left = offset;
-+		  while (bytes_left)
-+		    {
-+		      size_t mlen = mbrlen (beg, bytes_left, &mbs);
-+		      if (mlen == (size_t) -1 || mlen == 0)
-+			{
-+			  /* Incomplete character: treat as single-byte. */
-+			  memset (&mbs, '\0', sizeof (mbstate_t));
-+			  beg++;
-+			  bytes_left--;
-+			  continue;
-+			}
-+
-+		      if (mlen == (size_t) -2)
-+			/* Offset points inside multibyte character:
-+			 * no good. */
-+			break;
-+
-+		      beg += mlen;
-+		      bytes_left -= mlen;
-+		    }
-+		}
-+	      else
-+#endif /* MBS_SUPPORT */
- 	      beg += offset;
- 	      end = memchr (beg, eol, buflim - beg);
- 	      end++;
-+#ifdef MBS_SUPPORT
-+	      if (mb_cur_max > 1 && bytes_left)
-+		continue;
-+#endif /* MBS_SUPPORT */
- 	      while (beg > buf && beg[-1] != eol)
- 		--beg;
- 	    }
- 	  /* Successful, no backreferences encountered! */
--	  if (!backref)
--	    goto success;
-+	  if (use_dfa && !backref)
-+	    goto success_in_beg_and_end;
- 	}
-       else
- 	end = beg + size;
-@@ -413,14 +500,11 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
- 				       end - beg - 1, &(patterns[i].regs))))
- 	    {
- 	      len = patterns[i].regs.end[0] - start;
--	      if (exact)
--		{
--		  *match_size = len;
--		  return start;
--		}
-+	      if (exact && !match_words)
-+	        goto success_in_start_and_len;
- 	      if ((!match_lines && !match_words)
- 		  || (match_lines && len == end - beg - 1))
--		goto success;
-+		goto success_in_beg_and_end;
- 	      /* If -w, check if the match aligns with word boundaries.
- 		 We do this iteratively because:
- 		 (a) the line may contain more than one occurence of the
-@@ -431,10 +515,114 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
- 	      if (match_words)
- 		while (start >= 0)
- 		  {
--		    if ((start == 0 || !WCHAR ((unsigned char) beg[start - 1]))
--			&& (len == end - beg - 1
--			    || !WCHAR ((unsigned char) beg[start + len])))
--		      goto success;
-+		    int lword_match = 0;
-+		    if (start == 0)
-+		      lword_match = 1;
-+		    else
-+		      {
-+			assert (start > 0);
-+#ifdef MBS_SUPPORT
-+			if (mb_cur_max > 1)
-+			  {
-+			    const char *s;
-+			    size_t mr;
-+			    wchar_t pwc;
-+
-+			    /* Locate the start of the multibyte character
-+			       before the match position (== beg + start). */
-+			    if (using_utf8)
-+			      {
-+				/* UTF-8 is a special case: scan backwards
-+				   until we find a 7-bit character or a
-+				   lead byte. */
-+				s = beg + start - 1;
-+				while (s > buf
-+				       && (unsigned char) *s >= 0x80
-+				       && (unsigned char) *s <= 0xbf)
-+				  --s;
-+			      }
-+			    else
-+			      {
-+				/* Scan forwards to find the start of the
-+				   last complete character before the
-+				   match position.  */
-+				size_t bytes_left = start - 1;
-+				s = beg;
-+				while (bytes_left > 0)
-+				  {
-+				    mr = mbrlen (s, bytes_left, &mbs);
-+				    if (mr == (size_t) -1 || mr == 0)
-+				      {
-+					memset (&mbs, '\0', sizeof (mbs));
-+					s++;
-+					bytes_left--;
-+					continue;
-+				      }
-+				    if (mr == (size_t) -2)
-+				      {
-+					memset (&mbs, '\0', sizeof (mbs));
-+					break;
-+				      }
-+				    s += mr;
-+				    bytes_left -= mr;
-+				  }
-+			      }
-+			    mr = mbrtowc (&pwc, s, beg + start - s, &mbs);
-+			    if (mr == (size_t) -2 || mr == (size_t) -1 ||
-+				mr == 0)
-+			      {
-+				memset (&mbs, '\0', sizeof (mbstate_t));
-+				lword_match = 1;
-+			      }
-+			    else if (!(iswalnum (pwc) || pwc == L'_')
-+				     && mr == beg + start - s)
-+			      lword_match = 1;
-+			  }
-+			else
-+#endif /* MBS_SUPPORT */
-+			if (!WCHAR ((unsigned char) beg[start - 1]))
-+			  lword_match = 1;
-+		      }
-+
-+		    if (lword_match)
-+		      {
-+			int rword_match = 0;
-+			if (start + len == end - beg - 1)
-+			  rword_match = 1;
-+			else
-+			  {
-+#ifdef MBS_SUPPORT
-+			    if (mb_cur_max > 1)
-+			      {
-+				wchar_t nwc;
-+				int mr;
-+
-+				mr = mbtowc (&nwc, beg + start + len,
-+					     end - beg - start - len - 1);
-+				if (mr <= 0)
-+				  {
-+				    memset (&mbs, '\0', sizeof (mbstate_t));
-+				    rword_match = 1;
-+				  }
-+				else if (!iswalnum (nwc) && nwc != L'_')
-+				  rword_match = 1;
-+			      }
-+			    else
-+#endif /* MBS_SUPPORT */
-+			    if (!WCHAR ((unsigned char) beg[start + len]))
-+			      rword_match = 1;
-+			  }
-+
-+			if (rword_match)
-+			  {
-+			    if (!exact)
-+			      /* Returns the whole line. */
-+			      goto success_in_beg_and_end;
-+			    else
-+			      /* Returns just this word match. */
-+			      goto success_in_start_and_len;
-+			  }
-+		      }
- 		    if (len > 0)
- 		      {
- 			/* Try a shorter length anchored at the same place. */
-@@ -461,26 +649,154 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
- 	    }
- 	} /* for Regex patterns.  */
-     } /* for (beg = end ..) */
--#ifdef MBS_SUPPORT
--  if (MB_CUR_MAX > 1 && mb_properties)
--    free (mb_properties);
--#endif /* MBS_SUPPORT */
-+
-+ failure:
-   return (size_t) -1;
- 
-- success:
--#ifdef MBS_SUPPORT
--  if (MB_CUR_MAX > 1 && mb_properties)
--    free (mb_properties);
--#endif /* MBS_SUPPORT */
--  *match_size = end - beg;
--  return beg - buf;
-+ success_in_beg_and_end:
-+  len = end - beg;
-+  start = beg - buf;
-+  /* FALLTHROUGH */
-+
-+ success_in_start_and_len:
-+  *match_size = len;
-+  return start;
- }
- 
-+#ifdef MBS_SUPPORT
-+static int f_i_multibyte; /* whether we're using the new -Fi MB method */
-+static struct
-+{
-+  wchar_t **patterns;
-+  size_t count, maxlen;
-+  unsigned char *match;
-+} Fimb;
-+#endif
-+
- static void
- Fcompile (char const *pattern, size_t size)
- {
-+  int mb_cur_max = MB_CUR_MAX;
-   char const *beg, *lim, *err;
- 
-+  check_utf8 ();
-+#ifdef MBS_SUPPORT
-+  /* Support -F -i for UTF-8 input. */
-+  if (match_icase && mb_cur_max > 1)
-+    {
-+      mbstate_t mbs;
-+      wchar_t *wcpattern = xmalloc ((size + 1) * sizeof (wchar_t));
-+      const char *patternend = pattern;
-+      size_t wcsize;
-+      kwset_t fimb_kwset = NULL;
-+      char *starts = NULL;
-+      wchar_t *wcbeg, *wclim;
-+      size_t allocated = 0;
-+
-+      memset (&mbs, '\0', sizeof (mbs));
-+# ifdef __GNU_LIBRARY__
-+      wcsize = mbsnrtowcs (wcpattern, &patternend, size, size, &mbs);
-+      if (patternend != pattern + size)
-+	wcsize = (size_t) -1;
-+# else
-+      {
-+	char *patterncopy = xmalloc (size + 1);
-+
-+	memcpy (patterncopy, pattern, size);
-+	patterncopy[size] = '\0';
-+	patternend = patterncopy;
-+	wcsize = mbsrtowcs (wcpattern, &patternend, size, &mbs);
-+	if (patternend != patterncopy + size)
-+	  wcsize = (size_t) -1;
-+	free (patterncopy);
-+      }
-+# endif
-+      if (wcsize + 2 <= 2)
-+	{
-+fimb_fail:
-+	  free (wcpattern);
-+	  free (starts);
-+	  if (fimb_kwset)
-+	    kwsfree (fimb_kwset);
-+	  free (Fimb.patterns);
-+	  Fimb.patterns = NULL;
-+	}
-+      else
-+	{
-+	  if (!(fimb_kwset = kwsalloc (NULL)))
-+	    error (2, 0, _("memory exhausted"));
-+
-+	  starts = xmalloc (mb_cur_max * 3);
-+	  wcbeg = wcpattern;
-+	  do
-+	    {
-+	      int i;
-+	      size_t wclen;
-+
-+	      if (Fimb.count >= allocated)
-+		{
-+		  if (allocated == 0)
-+		    allocated = 128;
-+		  else
-+		    allocated *= 2;
-+		  Fimb.patterns = xrealloc (Fimb.patterns,
-+					    sizeof (wchar_t *) * allocated);
-+		}
-+	      Fimb.patterns[Fimb.count++] = wcbeg;
-+	      for (wclim = wcbeg;
-+		   wclim < wcpattern + wcsize && *wclim != L'\n'; ++wclim)
-+		*wclim = towlower (*wclim);
-+	      *wclim = L'\0';
-+	      wclen = wclim - wcbeg;
-+	      if (wclen > Fimb.maxlen)
-+		Fimb.maxlen = wclen;
-+	      if (wclen > 3)
-+		wclen = 3;
-+	      if (wclen == 0)
-+		{
-+		  if ((err = kwsincr (fimb_kwset, "", 0)) != 0)
-+		    error (2, 0, err);
-+		}
-+	      else
-+		for (i = 0; i < (1 << wclen); i++)
-+		  {
-+		    char *p = starts;
-+		    int j, k;
-+
-+		    for (j = 0; j < wclen; ++j)
-+		      {
-+			wchar_t wc = wcbeg[j];
-+			if (i & (1 << j))
-+			  {
-+			    wc = towupper (wc);
-+			    if (wc == wcbeg[j])
-+			      continue;
-+			  }
-+			k = wctomb (p, wc);
-+			if (k <= 0)
-+			  goto fimb_fail;
-+			p += k;
-+		      }
-+		    if ((err = kwsincr (fimb_kwset, starts, p - starts)) != 0)
-+		      error (2, 0, err);
-+		  }
-+	      if (wclim < wcpattern + wcsize)
-+		++wclim;
-+	      wcbeg = wclim;
-+	    }
-+	  while (wcbeg < wcpattern + wcsize);
-+	  f_i_multibyte = 1;
-+	  kwset = fimb_kwset;
-+	  free (starts);
-+	  Fimb.match = xmalloc (Fimb.count);
-+	  if ((err = kwsprep (kwset)) != 0)
-+	    error (2, 0, err);
-+	  return;
-+	}
-+    }
-+#endif /* MBS_SUPPORT */
-+
-+
-   kwsinit ();
-   beg = pattern;
-   do
-@@ -499,6 +815,76 @@ Fcompile (char const *pattern, size_t size)
-     error (2, 0, err);
- }
- 
-+#ifdef MBS_SUPPORT
-+static int
-+Fimbexec (const char *buf, size_t size, size_t *plen, int exact)
-+{
-+  size_t len, letter, i;
-+  int ret = -1;
-+  mbstate_t mbs;
-+  wchar_t wc;
-+  int patterns_left;
-+
-+  assert (match_icase && f_i_multibyte == 1);
-+  assert (MB_CUR_MAX > 1);
-+
-+  memset (&mbs, '\0', sizeof (mbs));
-+  memset (Fimb.match, '\1', Fimb.count);
-+  letter = len = 0;
-+  patterns_left = 1;
-+  while (patterns_left && len <= size)
-+    {
-+      size_t c;
-+
-+      patterns_left = 0;
-+      if (len < size)
-+	{
-+	  c = mbrtowc (&wc, buf + len, size - len, &mbs);
-+	  if (c + 2 <= 2)
-+	    return ret;
-+
-+	  wc = towlower (wc);
-+	}
-+      else
-+	{
-+	  c = 1;
-+	  wc = L'\0';
-+	}
-+
-+      for (i = 0; i < Fimb.count; i++)
-+	{
-+	  if (Fimb.match[i])
-+	    {
-+	      if (Fimb.patterns[i][letter] == L'\0')
-+		{
-+		  /* Found a match. */
-+		  *plen = len;
-+		  if (!exact && !match_words)
-+		    return 0;
-+		  else
-+		    {
-+		      /* For -w or exact look for longest match.  */
-+		      ret = 0;
-+		      Fimb.match[i] = '\0';
-+		      continue;
-+		    }
-+		}
-+
-+	      if (Fimb.patterns[i][letter] == wc)
-+		patterns_left = 1;
-+	      else
-+		Fimb.match[i] = '\0';
-+	    }
-+	}
-+
-+      len += c;
-+      letter++;
-+    }
-+
-+  return ret;
-+}
-+#endif /* MBS_SUPPORT */
-+
- static size_t
- Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
- {
-@@ -506,88 +892,268 @@ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
-   register size_t len;
-   char eol = eolbyte;
-   struct kwsmatch kwsmatch;
-+  size_t ret_val;
- #ifdef MBS_SUPPORT
--  char *mb_properties;
--  if (MB_CUR_MAX > 1)
--    mb_properties = check_multibyte_string (buf, size);
-+  int mb_cur_max = MB_CUR_MAX;
-+  mbstate_t mbs;
-+  memset (&mbs, '\0', sizeof (mbstate_t));
-+  const char *last_char = NULL;
- #endif /* MBS_SUPPORT */
- 
--  for (beg = buf; beg <= buf + size; ++beg)
-+  for (beg = buf; beg < buf + size; ++beg)
-     {
--      size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch);
-+      size_t offset;
-+      offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch);
-+
-       if (offset == (size_t) -1)
--	{
-+	goto failure;
- #ifdef MBS_SUPPORT
--	  if (MB_CUR_MAX > 1)
--	    free(mb_properties);
--#endif /* MBS_SUPPORT */
--	  return offset;
-+      if (mb_cur_max > 1 && !using_utf8)
-+	{
-+	  size_t bytes_left = offset;
-+	  while (bytes_left)
-+	    {
-+	      size_t mlen = mbrlen (beg, bytes_left, &mbs);
-+
-+	      last_char = beg;
-+	      if (mlen == (size_t) -1 || mlen == 0)
-+		{
-+		  /* Incomplete character: treat as single-byte. */
-+		  memset (&mbs, '\0', sizeof (mbstate_t));
-+		  beg++;
-+		  bytes_left--;
-+		  continue;
-+		}
-+
-+	      if (mlen == (size_t) -2)
-+		/* Offset points inside multibyte character: no good. */
-+		break;
-+
-+	      beg += mlen;
-+	      bytes_left -= mlen;
-+	    }
-+
-+	  if (bytes_left)
-+	    continue;
- 	}
--#ifdef MBS_SUPPORT
--      if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0)
--	continue; /* It is a part of multibyte character.  */
-+      else
- #endif /* MBS_SUPPORT */
-       beg += offset;
--      len = kwsmatch.size[0];
--      if (exact)
--	{
--	  *match_size = len;
- #ifdef MBS_SUPPORT
--	  if (MB_CUR_MAX > 1)
--	    free (mb_properties);
-+      /* For f_i_multibyte, the string at beg now matches first 3 chars of
-+	 one of the search strings (less if there are shorter search strings).
-+	 See if this is a real match.  */
-+      if (f_i_multibyte
-+	  && Fimbexec (beg, buf + size - beg, &kwsmatch.size[0], exact))
-+	goto next_char;
- #endif /* MBS_SUPPORT */
--	  return beg - buf;
--	}
-+      len = kwsmatch.size[0];
-+      if (exact && !match_words)
-+	goto success_in_beg_and_len;
-       if (match_lines)
- 	{
- 	  if (beg > buf && beg[-1] != eol)
--	    continue;
-+	    goto next_char;
- 	  if (beg + len < buf + size && beg[len] != eol)
--	    continue;
-+	    goto next_char;
- 	  goto success;
- 	}
-       else if (match_words)
--	for (try = beg; len; )
--	  {
--	    if (try > buf && WCHAR((unsigned char) try[-1]))
--	      break;
--	    if (try + len < buf + size && WCHAR((unsigned char) try[len]))
--	      {
--		offset = kwsexec (kwset, beg, --len, &kwsmatch);
--		if (offset == (size_t) -1)
--		  {
-+	{
-+	  while (len)
-+	    {
-+	      int word_match = 0;
-+	      if (beg > buf)
-+		{
- #ifdef MBS_SUPPORT
--		    if (MB_CUR_MAX > 1)
--		      free (mb_properties);
-+		  if (mb_cur_max > 1)
-+		    {
-+		      const char *s;
-+		      int mr;
-+		      wchar_t pwc;
-+
-+		      if (using_utf8)
-+			{
-+			  s = beg - 1;
-+			  while (s > buf
-+				 && (unsigned char) *s >= 0x80
-+				 && (unsigned char) *s <= 0xbf)
-+			    --s;
-+			}
-+		      else
-+			s = last_char;
-+		      mr = mbtowc (&pwc, s, beg - s);
-+		      if (mr <= 0)
-+			memset (&mbs, '\0', sizeof (mbstate_t));
-+		      else if ((iswalnum (pwc) || pwc == L'_')
-+			       && mr == (int) (beg - s))
-+			goto next_char;
-+		    }
-+		  else
- #endif /* MBS_SUPPORT */
--		    return offset;
--		  }
--		try = beg + offset;
--		len = kwsmatch.size[0];
--	      }
--	    else
--	      goto success;
--	  }
-+		  if (WCHAR ((unsigned char) beg[-1]))
-+		    goto next_char;
-+		}
-+#ifdef MBS_SUPPORT
-+	      if (mb_cur_max > 1)
-+		{
-+		  wchar_t nwc;
-+		  int mr;
-+
-+		  mr = mbtowc (&nwc, beg + len, buf + size - beg - len);
-+		  if (mr <= 0)
-+		    {
-+		      memset (&mbs, '\0', sizeof (mbstate_t));
-+		      word_match = 1;
-+		    }
-+		  else if (!iswalnum (nwc) && nwc != L'_')
-+		    word_match = 1;
-+		}
-+	      else
-+#endif /* MBS_SUPPORT */
-+		if (beg + len >= buf + size || !WCHAR ((unsigned char) beg[len]))
-+		  word_match = 1;
-+	      if (word_match)
-+		{
-+		  if (!exact)
-+		    /* Returns the whole line now we know there's a word match. */
-+		    goto success;
-+		  else
-+		    /* Returns just this word match. */
-+		    goto success_in_beg_and_len;
-+		}
-+	      if (len > 0)
-+		{
-+		  /* Try a shorter length anchored at the same place. */
-+		  --len;
-+		  offset = kwsexec (kwset, beg, len, &kwsmatch);
-+
-+		  if (offset == -1)
-+		    goto next_char; /* Try a different anchor. */
-+#ifdef MBS_SUPPORT
-+		  if (mb_cur_max > 1 && !using_utf8)
-+		    {
-+		      size_t bytes_left = offset;
-+		      while (bytes_left)
-+			{
-+			  size_t mlen = mbrlen (beg, bytes_left, &mbs);
-+
-+			  last_char = beg;
-+			  if (mlen == (size_t) -1 || mlen == 0)
-+			    {
-+			      /* Incomplete character: treat as single-byte. */
-+			      memset (&mbs, '\0', sizeof (mbstate_t));
-+			      beg++;
-+			      bytes_left--;
-+			      continue;
-+			    }
-+
-+			  if (mlen == (size_t) -2)
-+			    {
-+			      /* Offset points inside multibyte character:
-+			       * no good. */
-+			      break;
-+			    }
-+
-+			  beg += mlen;
-+			  bytes_left -= mlen;
-+			}
-+
-+		      if (bytes_left)
-+			{
-+			  memset (&mbs, '\0', sizeof (mbstate_t));
-+			  goto next_char; /* Try a different anchor. */
-+			}
-+		    }
-+		  else
-+#endif /* MBS_SUPPORT */
-+		  beg += offset;
-+#ifdef MBS_SUPPORT
-+		  /* The string at beg now matches first 3 chars of one of
-+		     the search strings (less if there are shorter search
-+		     strings).  See if this is a real match.  */
-+		  if (f_i_multibyte
-+		      && Fimbexec (beg, len - offset, &kwsmatch.size[0],
-+				   exact))
-+		    goto next_char;
-+#endif /* MBS_SUPPORT */
-+		  len = kwsmatch.size[0];
-+		}
-+	    }
-+	}
-       else
- 	goto success;
--    }
--
-+next_char:;
- #ifdef MBS_SUPPORT
--  if (MB_CUR_MAX > 1)
--    free (mb_properties);
-+      /* Advance to next character.  For MB_CUR_MAX == 1 case this is handled
-+	 by ++beg above.  */
-+      if (mb_cur_max > 1)
-+	{
-+	  if (using_utf8)
-+	    {
-+	      unsigned char c = *beg;
-+	      if (c >= 0xc2)
-+		{
-+		  if (c < 0xe0)
-+		    ++beg;
-+		  else if (c < 0xf0)
-+		    beg += 2;
-+		  else if (c < 0xf8)
-+		    beg += 3;
-+		  else if (c < 0xfc)
-+		    beg += 4;
-+		  else if (c < 0xfe)
-+		    beg += 5;
-+		}
-+	    }
-+	  else
-+	    {
-+	      size_t l = mbrlen (beg, buf + size - beg, &mbs);
-+
-+	      last_char = beg;
-+	      if (l + 2 >= 2)
-+		beg += l - 1;
-+	      else
-+		memset (&mbs, '\0', sizeof (mbstate_t));
-+	    }
-+	}
- #endif /* MBS_SUPPORT */
-+    }
-+
-+ failure:
-   return -1;
- 
-  success:
-+#ifdef MBS_SUPPORT
-+  if (mb_cur_max > 1 && !using_utf8)
-+    {
-+      end = beg + len;
-+      while (end < buf + size)
-+	{
-+	  size_t mlen = mbrlen (end, buf + size - end, &mbs);
-+	  if (mlen == (size_t) -1 || mlen == (size_t) -2 || mlen == 0)
-+	    {
-+	      memset (&mbs, '\0', sizeof (mbstate_t));
-+	      mlen = 1;
-+	    }
-+	  if (mlen == 1 && *end == eol)
-+	    break;
-+
-+	  end += mlen;
-+	}
-+    }
-+  else
-+#endif /* MBS_SUPPORT */
-   end = memchr (beg + len, eol, (buf + size) - (beg + len));
-+
-   end++;
-   while (buf < beg && beg[-1] != eol)
-     --beg;
--  *match_size = end - beg;
--#ifdef MBS_SUPPORT
--  if (MB_CUR_MAX > 1)
--    free (mb_properties);
--#endif /* MBS_SUPPORT */
-+  len = end - beg;
-+  /* FALLTHROUGH */
-+
-+ success_in_beg_and_len:
-+  *match_size = len;
-   return beg - buf;
- }
- 
-@@ -701,8 +1267,9 @@ Pexecute (char const *buf, size_t size, size_t *match_size, int exact)
-       char eol = eolbyte;
-       if (!exact)
- 	{
--	  end = memchr (end, eol, buflim - end);
--	  end++;
-+	  while (end < buflim)
-+	    if (*end++ == eol)
-+	      break;
- 	  while (buf < beg && beg[-1] != eol)
- 	    --beg;
- 	}
--- 
-1.8.4.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch
deleted file mode 100644
index d9b1e35..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-Upstream-Status: Pending
-
-automake 1.12 has depricated automatic de-ANSI-fication support
-
-this patch avoids these kinds of errors:
-
-| configure.in:33: error: automatic de-ANSI-fication support has been removed
-| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
-| configure.in:33: the top level
-| autom4te: m4 failed with exit status: 1
-...
-| lib/Makefile.am:2: error: automatic de-ANSI-fication support has been removed
-| src/Makefile.am:2: error: automatic de-ANSI-fication support has been removed
-| autoreconf: automake failed with exit status: 1
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
-2012/05/04
-
-Index: grep-2.5.1a/configure.in
-===================================================================
---- grep-2.5.1a.orig/configure.in
-+++ grep-2.5.1a/configure.in
-@@ -30,7 +30,6 @@ AC_PROG_RANLIB
- 
- dnl Checks for typedefs, structures, and compiler characteristics.
- AC_SYS_LARGEFILE
--AM_C_PROTOTYPES
- AC_TYPE_SIZE_T
- AC_CHECK_TYPE(ssize_t, int)
- AC_C_CONST
-Index: grep-2.5.1a/lib/Makefile.am
-===================================================================
---- grep-2.5.1a.orig/lib/Makefile.am
-+++ grep-2.5.1a/lib/Makefile.am
-@@ -1,5 +1,5 @@
- #
--AUTOMAKE_OPTIONS = ../src/ansi2knr
-+AUTOMAKE_OPTIONS = 
- 
- SUBDIRS = posix
- 
-Index: grep-2.5.1a/src/Makefile.am
-===================================================================
---- grep-2.5.1a.orig/src/Makefile.am
-+++ grep-2.5.1a/src/Makefile.am
-@@ -1,5 +1,5 @@
- ## Process this file with automake to create Makefile.in
--AUTOMAKE_OPTIONS = ansi2knr no-dependencies
-+AUTOMAKE_OPTIONS = no-dependencies
- 
- LN = ln
- 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
deleted file mode 100644
index de054fc..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-Upstream-Status: Inappropriate [licensing]
-
-# Fix to use mempcpy instead of __mempcpy. This is needed for uclibc which
-# doesn't define __mempcpy, only mempcpy. Since both uclibc and glibc have
-# mempcpy, we'll just use that instead.
-# Patch source: OpenEmbedded
-
-Index: grep-2.5.1/intl/localealias.c
-===================================================================
---- grep-2.5.1.orig/intl/localealias.c	2002-03-14 00:39:06.000000000 +1100
-+++ grep-2.5.1/intl/localealias.c	2007-05-17 13:53:58.000000000 +1000
-@@ -65,7 +65,7 @@
- # define strcasecmp __strcasecmp
- 
- # ifndef mempcpy
--#  define mempcpy __mempcpy
-+#  error "mempcpy not detected"
- # endif
- # define HAVE_MEMPCPY	1
- # define HAVE___FSETLOCKING	1
-Index: grep-2.5.1/lib/getopt.c
-===================================================================
---- grep-2.5.1.orig/lib/getopt.c	2001-03-04 16:33:12.000000000 +1100
-+++ grep-2.5.1/lib/getopt.c	2007-05-17 13:51:44.000000000 +1000
-@@ -326,7 +326,7 @@
- 	nonoption_flags_len = nonoption_flags_max_len = 0;
-       else
- 	{
--	  memset (__mempcpy (new_str, __getopt_nonoption_flags,
-+	  memset (mempcpy (new_str, __getopt_nonoption_flags,
- 			     nonoption_flags_max_len),
- 		  '\0', top + 1 - nonoption_flags_max_len);
- 	  nonoption_flags_max_len = top + 1;
-@@ -437,7 +437,7 @@
- 	      if (__getopt_nonoption_flags == NULL)
- 		nonoption_flags_max_len = -1;
- 	      else
--		memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
-+		memset (mempcpy (__getopt_nonoption_flags, orig_str, len),
- 			'\0', nonoption_flags_max_len - len);
- 	    }
- 	}
-Index: grep-2.5.1/lib/regex.c
-===================================================================
---- grep-2.5.1.orig/lib/regex.c	2001-04-03 04:04:45.000000000 +1000
-+++ grep-2.5.1/lib/regex.c	2007-05-17 13:51:48.000000000 +1000
-@@ -7842,7 +7842,7 @@
-       if (msg_size > errbuf_size)
-         {
- #if defined HAVE_MEMPCPY || defined _LIBC
--	  *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
-+	  *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
- #else
-           memcpy (errbuf, msg, errbuf_size - 1);
-           errbuf[errbuf_size - 1] = 0;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.25.bb b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.25.bb
deleted file mode 100644
index 9720d9f..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.25.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-SUMMARY = "GNU grep utility"
-HOMEPAGE = "http://savannah.gnu.org/projects/grep/"
-BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep"
-SECTION = "console/utils"
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=8006d9c814277c1bfc4ca22af94b59ee"
-
-SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
-           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
-          "
-
-SRC_URI[md5sum] = "04e96b0e6f0fe6a180ae62c88fcd0af6"
-SRC_URI[sha256sum] = "e21e83bac50450e0d0d61a42c154ee0dceaacdbf4f604ef6e79071cb8e596830"
-
-inherit autotools gettext texinfo
-
-EXTRA_OECONF = "--disable-perl-regexp"
-
-do_configure_prepend () {
-	rm -f ${S}/m4/init.m4
-}
-
-do_install () {
-	autotools_do_install
-	if [ "${base_bindir}" != "${bindir}" ]; then
-		install -d ${D}${base_bindir}
-		mv ${D}${bindir}/grep ${D}${base_bindir}/grep
-		mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
-		mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
-		rmdir ${D}${bindir}/
-	fi
-}
-
-inherit update-alternatives
-
-ALTERNATIVE_PRIORITY = "100"
-
-ALTERNATIVE_${PN} = "grep egrep fgrep"
-ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
-ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
-ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
-
-export CONFIG_SHELL="/bin/sh"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb
deleted file mode 100644
index 5a2da28..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb
+++ /dev/null
@@ -1,56 +0,0 @@
-SUMMARY = "Pattern matching utilities"
-DESCRIPTION = "The GNU versions of commonly used grep utilities.  The grep command searches one or more input \
-files for lines containing a match to a specified pattern."
-SECTION = "console/utils"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
-
-PR = "r2"
-
-SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.bz2 \
-           file://uclibc-fix.patch \
-           file://grep_fix_for_automake-1.12.patch \
-           file://gettext.patch \
-           file://fix64-int-to-pointer.patch \
-           file://Makevars \
-           file://grep-CVE-2012-5667.patch \
-           file://fix-for-texinfo-5.1.patch \
-           file://grep-egrep-fgrep-Fix-LSB-NG-cases.patch \
-          "
-
-SRC_URI[md5sum] = "52202fe462770fa6be1bb667bd6cf30c"
-SRC_URI[sha256sum] = "38c8a2bb9223d1fb1b10bdd607cf44830afc92fd451ac4cd07619bf92bdd3132"
-
-inherit autotools gettext texinfo
-
-EXTRA_OECONF_INCLUDED_REGEX = "--without-included-regex"
-EXTRA_OECONF_INCLUDED_REGEX_libc-musl = "--with-included-regex"
-
-EXTRA_OECONF = "--disable-perl-regexp \
-                ${EXTRA_OECONF_INCLUDED_REGEX}"
-
-CFLAGS += "-D PROTOTYPES"
-do_configure_prepend () {
-	rm -f ${S}/m4/init.m4
-	cp -f ${WORKDIR}/Makevars ${S}/po/
-}
-
-do_install () {
-	autotools_do_install
-	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/grep ${D}${base_bindir}/grep
-	mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
-	mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
-	rmdir ${D}${bindir}/
-}
-
-inherit update-alternatives
-
-ALTERNATIVE_PRIORITY = "100"
-
-ALTERNATIVE_${PN} = "grep egrep fgrep"
-ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
-ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
-ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
-
-export CONFIG_SHELL="/bin/sh"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep_3.0.bb b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_3.0.bb
new file mode 100644
index 0000000..b2940d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_3.0.bb
@@ -0,0 +1,46 @@
+SUMMARY = "GNU grep utility"
+HOMEPAGE = "http://savannah.gnu.org/projects/grep/"
+BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep"
+SECTION = "console/utils"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8006d9c814277c1bfc4ca22af94b59ee"
+
+SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+          "
+
+SRC_URI[md5sum] = "fa07c1616adeb9c3262be5177d10ad4a"
+SRC_URI[sha256sum] = "e2c81db5056e3e8c5995f0bb5d0d0e1cad1f6f45c3b2fc77b6e81435aed48ab5"
+
+inherit autotools gettext texinfo pkgconfig
+
+EXTRA_OECONF = "--disable-perl-regexp"
+
+# Fix "Argument list too long" error when len(TMPDIR) = 410
+acpaths = "-I ./m4"
+
+do_configure_prepend () {
+	rm -f ${S}/m4/init.m4
+}
+
+do_install () {
+	autotools_do_install
+	if [ "${base_bindir}" != "${bindir}" ]; then
+		install -d ${D}${base_bindir}
+		mv ${D}${bindir}/grep ${D}${base_bindir}/grep
+		mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
+		mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
+		rmdir ${D}${bindir}/
+	fi
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "grep egrep fgrep"
+ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
+ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
+ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/fix-narrowing-conversion-error.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/fix-narrowing-conversion-error.patch
deleted file mode 100644
index 4b0176f..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/fix-narrowing-conversion-error.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From fc289ab69c6d7e4ad489172509a85f68afec43ea Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Fri, 29 Jul 2016 03:19:39 -0400
-Subject: [PATCH] fix narrowing conversion error
-
-While gcc6 used, build old groff (for anti-GPLv3 reasons) failed:
-.....
-|groff-1.18.1.4/src/devices/grolbp/charset.h:69:1: error: narrowing
-conversion of '130' from 'int' to 'char' inside { } [-Wnarrowing]
-......
-
-In upstream git://git.savannah.gnu.org/groff.git,
-the following commit fix the issue, but the license is GPLV3,
-we could not backport it to the old groff which license is GPLV2.
-...
-commit d180038ae0da19655bc2760ae2043efa0550a76c
-Author: Werner LEMBERG <wl@gnu.org>
-Date:   Wed Apr 16 21:11:07 2003 +0000
-    * src/devices/grolbp/charset.h (symset): Use `unsigned char'.
-...
-
-We use another different way to fix the issue.
-
-Upstream-Status: Pending
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- src/devices/grolbp/charset.h | 2 +-
- src/devices/grolbp/lbp.cc    | 4 ++--
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/devices/grolbp/charset.h b/src/devices/grolbp/charset.h
-index adc76f4..e9c6c5b 100644
---- a/src/devices/grolbp/charset.h
-+++ b/src/devices/grolbp/charset.h
-@@ -1,6 +1,6 @@
- // Definition of the WP54 character set
- 
--char symset[] = {
-+int symset[] = {
- 0x57,0x50,0x35,0x34,0x00,0x41,0x76,0x61,0x6e,0x74,0x47,0x61,
- 0x72,0x64,0x65,0x2d,0x42,0x6f,0x6f,0x6b,0x00,0x41,0x76,
- 0x61,0x6e,0x74,0x47,0x61,0x72,0x64,0x65,0x2d,0x44,0x65,
-diff --git a/src/devices/grolbp/lbp.cc b/src/devices/grolbp/lbp.cc
-index 76db32a..00d4ca7 100644
---- a/src/devices/grolbp/lbp.cc
-+++ b/src/devices/grolbp/lbp.cc
-@@ -152,8 +152,8 @@ static void wp54charset()
- {
-   unsigned int i;
-   lbpputs("\033[714;100;29;0;32;120.}");
--  for (i = 0; i < sizeof(symset); i++)
--    lbpputc(symset[i]);
-+  for (i = 0; i < sizeof(symset)/sizeof(symset[0]); i++)
-+    lbpputc((char)symset[i]&0xFF);
-   lbpputs("\033[100;0 D");
-   return;
- }
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch
deleted file mode 100644
index 559ae72..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Upstream-Status: Inappropriate [embedded]
-
-Signed-off-by: Ming Liu <ming.liu@windriver.com>
----
- Makefile.sub |   10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
---- a/contrib/groffer/Makefile.sub
-+++ b/contrib/groffer/Makefile.sub
-@@ -38,16 +38,16 @@ groffer: groffer.sh groffer2.sh version.
- 	$(RM) $@;
- 	sed \
-             -e "s|@g@|$(g)|g" \
--	    -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
-+	    -e "s|@BINDIR@|$(bindir)|g" \
- 	    -e "s|@libdir@|$(DESTDIR)$(libdir)|g" \
- 	    -e "s|@VERSION@|$(version)$(revision)|g" \
- 	    $(srcdir)/groffer.sh >$@;
- 	chmod +x $@
- 
- install_data: groffer
--	-test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
--	-$(RM) $(DESTDIR)$(bindir)/groffer
--	$(INSTALL_SCRIPT) groffer $(DESTDIR)$(bindir)/groffer
-+	-test -d $(bindir) || $(mkinstalldirs) $(bindir)
-+	-$(RM) $(bindir)/groffer
-+	$(INSTALL_SCRIPT) groffer $(bindir)/groffer
- 	-test -d $(DESTDIR)$(libdir)/groff/groffer || \
-           $(mkinstalldirs) $(DESTDIR)$(libdir)/groff/groffer
- 	-$(RM) $(DESTDIR)$(libdir)/groff/groffer/groffer2.sh
-@@ -58,7 +58,7 @@ install_data: groffer
- 	$(DESTDIR)$(libdir)/groff/groffer/version.sh
- 
- uninstall_sub:
--	-$(RM) $(DESTDIR)$(bindir)/groffer
-+	-$(RM) $(bindir)/groffer
- 	-$(RM) $(DESTDIR)$(libdir)/groff/groffer/groffer2.sh
- 	-$(RM) $(DESTDIR)$(libdir)/groff/groffer/version.sh
- 	-rmdir $(DESTDIR)$(libdir)/groff/groffer
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch
deleted file mode 100644
index c24eff9..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-
-Upstream-Status: Inappropriate [embedded]
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
----
- groff-1.18.1.4/Makefile.in |    7 +------
- 1 file changed, 1 insertion(+), 6 deletions(-)
-
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -460,27 +460,22 @@ OTHERDIRS=\
-   src/roff/grog \
-   src/roff/nroff \
-   contrib/mm \
-   contrib/pic2graph \
-   contrib/eqn2graph \
--  contrib/groffer \
--  contrib/mom \
--  doc
-+  contrib/groffer
- ALLDIRS=$(INCDIRS) $(LIBDIRS) $(PROGDIRS) \
-   $(DEVDIRS) $(OTHERDEVDIRS) $(TTYDEVDIRS) $(OTHERDIRS)
- EXTRADIRS=\
-   font/devps/generate \
-   font/devdvi/generate \
-   font/devlj4/generate \
--  src/xditview \
-   doc
- NOMAKEDIRS=\
-   arch/djgpp \
-   contrib/mm/examples \
-   contrib/mm/mm \
--  contrib/mom/examples \
--  contrib/mom/momdoc \
-   src/libs/snprintf
- DISTDIRS=\
-   $(INCDIRS) $(LIBDIRS) $(PROGDIRS) $(DEVDIRS) $(OTHERDEVDIRS) \
-   $(ALLTTYDEVDIRS) $(OTHERDIRS) $(EXTRADIRS) $(NOMAKEDIRS)
- TARGETS=all install install_bin install_data clean distclean mostlyclean \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch
deleted file mode 100644
index e3f1aa6..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Upstream-Status: Inappropriate [embedded]
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-Index: groff-1.18.1.4/tmac/man.local
-===================================================================
---- groff-1.18.1.4.orig/tmac/man.local	2000-10-26 22:15:17.000000000 +0800
-+++ groff-1.18.1.4/tmac/man.local	2010-08-24 14:17:52.070006664 +0800
-@@ -1,2 +1,27 @@
- .\" This file is loaded after an-old.tmac.
- .\" Put any local modifications to an-old.tmac here.
-+.
-+.if n \{\
-+.  \" Debian: Map \(oq to ' rather than ` in nroff mode for devices other
-+.  \" than utf8.
-+.  if !'\*[.T]'utf8' \
-+.    tr \[oq]'
-+.
-+.  \" Debian: Disable the use of SGR (ANSI colour) escape sequences by
-+.  \" grotty.
-+.  if '\V[GROFF_SGR]'' \
-+.    output x X tty: sgr 0
-+.
-+.  \" Debian: Map \- to the Unicode HYPHEN-MINUS character, to make
-+.  \" searching in man pages easier.
-+.  if '\*[.T]'utf8' \
-+.    char \- \N'45'
-+.
-+.  \" Debian: Many UTF-8 man pages use "-" instead of "\-" for dashes such
-+.  \" as those in command-line options. This is a bug in those pages, but
-+.  \" too many fonts are missing the Unicode HYPHEN character, so we render
-+.  \" this as the ASCII-compatible HYPHEN-MINUS instead.
-+.  if '\*[.T]'utf8' \
-+.    char - \N'45'
-+.\}
-+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch
deleted file mode 100644
index 409c1a5..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-
-Upstream-Status: Inappropriate [embedded]
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-Index: groff-1.18.1.4/tmac/mdoc.local
-===================================================================
---- groff-1.18.1.4.orig/tmac/mdoc.local	2001-03-23 08:17:51.000000000 +0800
-+++ groff-1.18.1.4/tmac/mdoc.local	2010-08-24 14:20:22.014006846 +0800
-@@ -1,2 +1,26 @@
- .\" This file is loaded after doc.tmac.
- .\" Put any local modifications to doc.tmac here.
-+.
-+.if n \{\
-+.  \" Debian: Map \(oq to ' rather than ` in nroff mode for devices other
-+.  \" than utf8.
-+.  if !'\*[.T]'utf8' \
-+.    tr \[oq]'
-+.
-+.  \" Debian: Disable the use of SGR (ANSI colour) escape sequences by
-+.  \" grotty.
-+.  if '\V[GROFF_SGR]'' \
-+.    output x X tty: sgr 0
-+.
-+.  \" Debian: Map \- to the Unicode HYPHEN-MINUS character, to make
-+.  \" searching in man pages easier.
-+.  if '\*[.T]'utf8' \
-+.    char \- \N'45'
-+.
-+.  \" Debian: Many UTF-8 man pages use "-" instead of "\-" for dashes such
-+.  \" as those in command-line options. This is a bug in those pages, but
-+.  \" too many fonts are missing the Unicode HYPHEN character, so we render
-+.  \" this as the ASCII-compatible HYPHEN-MINUS instead.
-+.  if '\*[.T]'utf8' \
-+.    char - \N'45'
-+.\}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch
new file mode 100644
index 0000000..f1db5b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch
@@ -0,0 +1,102 @@
+From 5b574542070db286c89b3827e8f15ed4b3b39034 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 6 Apr 2017 01:46:00 -0700
+Subject: [PATCH] replace "perl -w" with "use warnings"
+
+The shebang's max length is usually 128 as defined in
+/usr/include/linux/binfmts.h:
+  #define BINPRM_BUF_SIZE 128
+
+There would be errors when @PERL@ is longer than 128, use
+'/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w'
+doesn't work:
+
+/usr/bin/env: perl -w: No such file or directory
+
+So replace "perl -w" with "use warnings" to make it work.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ font/devpdf/util/BuildFoundries.pl | 3 ++-
+ src/devices/gropdf/gropdf.pl       | 3 ++-
+ src/devices/gropdf/pdfmom.pl       | 3 ++-
+ src/utils/afmtodit/afmtodit.pl     | 3 ++-
+ 4 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/font/devpdf/util/BuildFoundries.pl b/font/devpdf/util/BuildFoundries.pl
+index 39f2f0d..a2bfd8e 100644
+--- a/font/devpdf/util/BuildFoundries.pl
++++ b/font/devpdf/util/BuildFoundries.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl -w
++#!/usr/bin/perl
+ #
+ #   BuildFoundries   : Given a Foundry file generate groff and download files
+ #   Deri James       : Monday 07 Feb 2011
+@@ -22,6 +22,7 @@
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+ 
+ use strict;
++use warnings;
+ 
+ my $where=shift||'';
+ my $devps=shift||'../devps';
+diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
+index 035d123..b933b32 100644
+--- a/src/devices/gropdf/gropdf.pl
++++ b/src/devices/gropdf/gropdf.pl
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ #
+ #	gropdf		: PDF post processor for groff
+ #
+@@ -21,6 +21,7 @@
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+ 
+ use strict;
++use warnings;
+ use Getopt::Long qw(:config bundling);
+ use Compress::Zlib;
+ 
+diff --git a/src/devices/gropdf/pdfmom.pl b/src/devices/gropdf/pdfmom.pl
+index beec820..4b46ea4 100644
+--- a/src/devices/gropdf/pdfmom.pl
++++ b/src/devices/gropdf/pdfmom.pl
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ #
+ #	pdfmom		: Frontend to run groff -mom to produce PDFs
+ #	Deri James	: Friday 16 Mar 2012
+@@ -24,6 +24,7 @@
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+ 
+ use strict;
++use warnings;
+ use File::Temp qw/tempfile/;
+ my @cmd;
+ my $dev='pdf';
+diff --git a/src/utils/afmtodit/afmtodit.pl b/src/utils/afmtodit/afmtodit.pl
+index 4f2ce83..5c078ff 100644
+--- a/src/utils/afmtodit/afmtodit.pl
++++ b/src/utils/afmtodit/afmtodit.pl
+@@ -1,4 +1,4 @@
+-#! /usr/bin/perl -w
++#! /usr/bin/perl
+ # -*- Perl -*-
+ # Copyright (C) 1989-2014  Free Software Foundation, Inc.
+ #      Written by James Clark (jjc@jclark.com)
+@@ -19,6 +19,7 @@
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+ 
+ use strict;
++use warnings;
+ 
+ @afmtodit.tables@
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb
deleted file mode 100644
index fc7eb44..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb
+++ /dev/null
@@ -1,50 +0,0 @@
-SUMMARY = "GNU Troff software"
-DESCRIPTION = "The groff (GNU troff) software is a typesetting package which reads plain text mixed with \
-formatting commands and produces formatted output."
-SECTION = "console/utils"
-HOMEPAGE = "http://www.gnu.org/software/groff/"
-LICENSE = "GPLv2"
-PR = "r1"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=e43fc16fccd8519fba405f0a0ff6e8a3"
-
-SRC_URI = "${GNU_MIRROR}/${BPN}/old/${BP}.tar.gz \
-          file://groff-1.18.1.4-remove-mom.patch;striplevel=1 \
-          file://man-local.patch \
-          file://mdoc-local.patch \
-          file://groff-1.18.1.4-fix-bindir.patch \
-          file://fix-narrowing-conversion-error.patch \
-" 
-
-inherit autotools texinfo
-
-EXTRA_OECONF="--without-x --prefix=${D} --exec-prefix=${D} --bindir=${D}${bindir} --datadir=${D}${datadir} --mandir=${D}${datadir}/man --infodir=${D}${datadir}info --with-appresdir=${D}${datadir}"
-
-SRC_URI[md5sum] = "ceecb81533936d251ed015f40e5f7287"
-SRC_URI[sha256sum] = "ff3c7c3b6cae5e8cc5062a144de5eff0022e8e970e1774529cc2d5dde46ce50d"
-PARALLEL_MAKE = ""
-
-do_configure (){
-    oe_runconf
-}
-
-do_install_append() {
-	# Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
-	# for target as /usr/bin/perl, so fix it to /usr/bin/perl.
-	for i in afmtodit mmroff; do
-		if [ -f ${D}${bindir}/$i ]; then
-			sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
-		fi
-	done
-
-	mkdir -p ${D}${sysconfdir}/groff
-	cp -rf ${D}${datadir}/groff/site-tmac/* ${D}${sysconfdir}/groff/
-	cp -rf ${D}${datadir}/groff/site-tmac/* ${D}${datadir}/groff/${PV}/tmac/
-}
-
-pkg_postinst_${PN}() {
-	ln -s tbl $D${bindir}/gtbl
-	echo "export GROFF_FONT_PATH=/usr/share/groff/${PV}/font" >> $D${sysconfdir}/profile
-	echo "export GROFF_TMAC_PATH=/usr/share/groff/${PV}/tmac" >> $D${sysconfdir}/profile
-}
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb
index dd241f3..7472f59 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb
@@ -10,6 +10,7 @@
 SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
 	file://groff-1.22.2-correct-man.local-install-path.patch \
 	file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+	file://0001-replace-perl-w-with-use-warnings.patch \
 "
 
 SRC_URI[md5sum] = "cc825fa64bc7306a885f2fb2268d3ec5"
@@ -24,6 +25,8 @@
 EXTRA_OECONF = "--without-x"
 PARALLEL_MAKE = ""
 
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
+
 do_configure_prepend() {
 	if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
 		sed -i \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch
deleted file mode 100644
index d9e8d21..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-gzip uses gnulib, whose header conflict with glibc. This patch rename some function to avoid conflict.
-
-Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
-
-Upstream-Status: Inappropriate [licensing]
-
-Index: gzip-1.3.12/gzip.c
-===================================================================
---- gzip-1.3.12.orig/gzip.c	2010-08-13 10:29:38.000000000 +0800
-+++ gzip-1.3.12/gzip.c	2010-08-13 10:29:44.000000000 +0800
-@@ -1637,7 +1637,7 @@
- 	}
-       }
- 
--    if (futimens (ofd, ofname, timespec) != 0)
-+    if (futimens_gnulib (ofd, ofname, timespec) != 0)
-       {
- 	int e = errno;
- 	WARN ((stderr, "%s: ", program_name));
-Index: gzip-1.3.12/lib/utimens.c
-===================================================================
---- gzip-1.3.12.orig/lib/utimens.c	2010-08-13 10:33:47.000000000 +0800
-+++ gzip-1.3.12/lib/utimens.c	2010-08-13 10:34:02.000000000 +0800
-@@ -75,7 +75,7 @@
-    Return 0 on success, -1 (setting errno) on failure.  */
- 
- int
--futimens (int fd ATTRIBUTE_UNUSED,
-+futimens_gnulib (int fd ATTRIBUTE_UNUSED,
- 	  char const *file, struct timespec const timespec[2])
- {
-   /* Some Linux-based NFS clients are buggy, and mishandle time stamps
-@@ -185,5 +185,5 @@
- int
- utimens (char const *file, struct timespec const timespec[2])
- {
--  return futimens (-1, file, timespec);
-+  return futimens_gnulib (-1, file, timespec);
- }
-Index: gzip-1.3.12/lib/utimens.h
-===================================================================
---- gzip-1.3.12.orig/lib/utimens.h	2010-08-13 10:14:57.000000000 +0800
-+++ gzip-1.3.12/lib/utimens.h	2010-08-13 10:21:45.000000000 +0800
-@@ -1,3 +1,3 @@
- #include <time.h>
--int futimens (int, char const *, struct timespec const [2]);
-+int futimens_gnulib (int, char const *, struct timespec const [2]);
- int utimens (char const *, struct timespec const [2]);
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch
deleted file mode 100644
index 6b2f698..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-remove AC_USE_SYSTEM_EXTENSIONS to fix the autoconf error "AC_REQUIRE: circular
-dependency of AC_GNU_SOURCE"
-
-Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
-
-Upstream-Status: Inappropriate [licensing]
-
-Index: gzip-1.3.12/m4/extensions.m4
-===================================================================
---- gzip-1.3.12.orig/m4/extensions.m4	2010-08-16 14:18:16.000000000 +0800
-+++ gzip-1.3.12/m4/extensions.m4	2010-08-16 14:21:54.000000000 +0800
-@@ -12,44 +12,6 @@
- # enough in this area it's likely we'll need to redefine
- # AC_USE_SYSTEM_EXTENSIONS for quite some time.
- 
--# AC_USE_SYSTEM_EXTENSIONS
--# ------------------------
--# Enable extensions on systems that normally disable them,
--# typically due to standards-conformance issues.
--AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
--[
--  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
--  AC_BEFORE([$0], [AC_RUN_IFELSE])
--
--  AC_REQUIRE([AC_GNU_SOURCE])
--  AC_REQUIRE([AC_AIX])
--  AC_REQUIRE([AC_MINIX])
--
--  AH_VERBATIM([__EXTENSIONS__],
--[/* Enable extensions on Solaris.  */
--#ifndef __EXTENSIONS__
--# undef __EXTENSIONS__
--#endif
--#ifndef _POSIX_PTHREAD_SEMANTICS
--# undef _POSIX_PTHREAD_SEMANTICS
--#endif
--#ifndef _TANDEM_SOURCE
--# undef _TANDEM_SOURCE
--#endif])
--  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
--    [ac_cv_safe_to_define___extensions__],
--    [AC_COMPILE_IFELSE(
--       [AC_LANG_PROGRAM([
--#	  define __EXTENSIONS__ 1
--	  AC_INCLUDES_DEFAULT])],
--       [ac_cv_safe_to_define___extensions__=yes],
--       [ac_cv_safe_to_define___extensions__=no])])
--  test $ac_cv_safe_to_define___extensions__ = yes &&
--    AC_DEFINE([__EXTENSIONS__])
--  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
--  AC_DEFINE([_TANDEM_SOURCE])
--])
--
- # gl_USE_SYSTEM_EXTENSIONS
- # ------------------------
- # Enable extensions on systems that normally disable them,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb
deleted file mode 100644
index e406282..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-require gzip.inc
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
-                    file://gzip.h;endline=22;md5=c0934ad1900d927f86556153d4c76d23 \
-                    file://lzw.h;endline=19;md5=c273e09a02edd9801cc74d39683049e9 "
-
-SRC_URI = "${GNU_MIRROR}/gzip/gzip-${PV}.tar.gz \
-           file://m4-extensions-fix.patch \
-           file://dup-def-fix.patch"
-
-SRC_URI[md5sum] = "b5bac2d21840ae077e0217bc5e4845b1"
-SRC_URI[sha256sum] = "3f565be05f7f3d1aff117c030eb7c738300510b7d098cedea796ca8e4cd587af"
-
-PR = "r2"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.8.bb b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.8.bb
index a19b965..11be846 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.8.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.8.bb
@@ -9,7 +9,6 @@
                     file://gzip.h;beginline=8;endline=20;md5=6e47caaa630e0c8bf9f1bc8d94a8ed0e"
 
 PROVIDES_append_class-native = " gzip-replacement-native"
-NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
 
 BBCLASSEXTEND = "native"
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb b/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb
deleted file mode 100644
index cd85776..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-SUMMARY = "Utility for viewing/manipulating IDE disk drive/driver parameters"
-DESCRIPTION = "hdparm is a Linux shell utility for viewing \
-and manipulating various IDE drive and driver parameters."
-SECTION = "console/utils"
-
-LICENSE = "BSD & GPLv2"
-LICENSE_${PN} = "BSD"
-LICENSE_${PN}-dbg = "BSD"
-LICENSE_wiper = "GPLv2"
-
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=910a8a42c962d238619c75fdb78bdb24 \
-                    file://debian/copyright;md5=a82d7ba3ade9e8ec902749db98c592f3 \
-                    file://wiper/GPLv2.txt;md5=fcb02dc552a041dee27e4b85c7396067 \
-                    file://wiper/wiper.sh;beginline=7;endline=31;md5=b7bc642addc152ea307505bf1a296f09"
-
-
-PACKAGES =+ "wiper"
-
-FILES_wiper = "${bindir}/wiper.sh"
-
-RDEPENDS_wiper = "bash gawk stat"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/hdparm/${BP}.tar.gz "
-
-SRC_URI[md5sum] = "213efdbe7471fad3408198918e164354"
-SRC_URI[sha256sum] = "ce97b4a71cb04146f54cf6f69787e7f97ddfda9836dc803b459d3b3df3a4fbee"
-
-EXTRA_OEMAKE = '-e MAKEFLAGS= STRIP="echo"'
-
-inherit update-alternatives
-
-ALTERNATIVE_${PN} = "hdparm"
-ALTERNATIVE_LINK_NAME[hdparm] = "${base_sbindir}/hdparm"
-ALTERNATIVE_PRIORITY = "100"
-
-do_install () {
-	install -d ${D}/${base_sbindir} ${D}/${mandir}/man8 ${D}/${bindir}
-	oe_runmake 'DESTDIR=${D}' 'sbindir=${base_sbindir}' install
-	cp ${S}/wiper/wiper.sh ${D}/${bindir}
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.51.bb b/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.51.bb
new file mode 100644
index 0000000..fa00927
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.51.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Utility for viewing/manipulating IDE disk drive/driver parameters"
+DESCRIPTION = "hdparm is a Linux shell utility for viewing \
+and manipulating various IDE drive and driver parameters."
+SECTION = "console/utils"
+
+LICENSE = "BSD & GPLv2"
+LICENSE_${PN} = "BSD"
+LICENSE_${PN}-dbg = "BSD"
+LICENSE_wiper = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=910a8a42c962d238619c75fdb78bdb24 \
+                    file://debian/copyright;md5=a82d7ba3ade9e8ec902749db98c592f3 \
+                    file://wiper/GPLv2.txt;md5=fcb02dc552a041dee27e4b85c7396067 \
+                    file://wiper/wiper.sh;beginline=7;endline=31;md5=b7bc642addc152ea307505bf1a296f09"
+
+
+PACKAGES =+ "wiper"
+
+FILES_wiper = "${bindir}/wiper.sh"
+
+RDEPENDS_wiper = "bash gawk stat"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/hdparm/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "8fe0a71db02f7ffc602d14a69f766cff"
+SRC_URI[sha256sum] = "1afad8891ecbe644c283f7d725157660ebf8bd5b4d9d67232afd45f83d2d5d91"
+
+EXTRA_OEMAKE = 'STRIP="echo" LDFLAGS="${LDFLAGS}"'
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "hdparm"
+ALTERNATIVE_LINK_NAME[hdparm] = "${base_sbindir}/hdparm"
+ALTERNATIVE_PRIORITY = "100"
+
+do_install () {
+	install -d ${D}/${base_sbindir} ${D}/${mandir}/man8 ${D}/${bindir}
+	oe_runmake 'DESTDIR=${D}' 'sbindir=${base_sbindir}' install
+	cp ${S}/wiper/wiper.sh ${D}/${bindir}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb
index c3b6e7c..a3d602e 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb
@@ -7,3 +7,6 @@
 IMAGE_FEATURES += "tools-sdk dev-pkgs tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks"
 
 IMAGE_INSTALL += "kernel-devsrc"
+
+# Reduce this to try and keep below the 4GB image size for now
+IMAGE_OVERHEAD_FACTOR = "1.2"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
index b711b7a..03c36cc 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
@@ -1,4 +1,7 @@
-[PATCH] configure: Add option to enable/disable libnfnetlink
+From c46db7c2e1f63ec525835553587e70c635565310 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Tue, 21 Feb 2017 11:16:31 +0200
+Subject: [PATCH] configure: Add option to enable/disable libnfnetlink
 
 This changes the configure behaviour from autodetecting
 for libnfnetlink to having an option to disable it explicitly
@@ -8,20 +11,24 @@
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 Signed-off-by: Maxin B. John <maxin.john@intel.com>
 ---
-diff -Naur iptables-1.6.0-old/configure.ac iptables-1.6.0/configure.ac
---- iptables-1.6.0-old/configure.ac	2015-12-28 18:40:35.255417976 +0200
-+++ iptables-1.6.0/configure.ac	2015-12-29 13:01:12.388840200 +0200
-@@ -63,6 +63,9 @@
+ configure.ac | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index eda7871..03ddc50 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -63,6 +63,9 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
  AC_ARG_ENABLE([nftables],
  	AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]),
  	[enable_nftables="$enableval"], [enable_nftables="yes"])
 +AC_ARG_ENABLE([libnfnetlink],
 +    AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]),
 +    [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"])
- 
- libiptc_LDFLAGS2="";
- AX_CHECK_LINKER_FLAGS([-Wl,--no-as-needed],
-@@ -123,9 +126,10 @@
+ AC_ARG_ENABLE([connlabel],
+ 	AS_HELP_STRING([--disable-connlabel],
+ 	[Do not build libnetfilter_conntrack]),
+@@ -115,9 +118,10 @@ if test "x$enable_bpfc" = "xyes" || test "x$enable_nfsynproxy" = "xyes"; then
  	AC_CHECK_LIB(pcap, pcap_compile,, AC_MSG_ERROR(missing libpcap library required by bpf compiler or nfsynproxy tool))
  fi
  
@@ -35,3 +42,6 @@
  
  if test "x$enable_nftables" = "xyes"; then
  	PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0])
+-- 
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch
index 89ad8f6..7842c64 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch
@@ -1,34 +1,51 @@
+From 26090b3dbcdf6a11e60535da949b726a6e86426d Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Tue, 21 Feb 2017 11:49:07 +0200
+Subject: [PATCH] configure.ac:
+ only-check-conntrack-when-libnfnetlink-enabled.patch
+
 Package libnetfilter-conntrack depends on package libnfnetlink. iptables
 checks package libnetfilter-conntrack whatever its package config
 libnfnetlink is enabled or not. When libnfnetlink is disabled but
 package libnetfilter-conntrack exists, it fails randomly with:
 
-| In file included from .../iptables/1.4.21-r0/iptables-1.4.21/extensions/libxt_connlabel.c:8:0:
-| .../tmp/sysroots/qemumips/usr/include/libnetfilter_conntrack/libnetfilter_conntrack.h:14:42: fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory
-| compilation terminated.
-| GNUmakefile:96: recipe for target 'libxt_connlabel.oo' failed
+In file included from
+.../iptables/1.4.21-r0/iptables-1.4.21/extensions/libxt_connlabel.c:8:0:
 
+.../tmp/sysroots/qemumips/usr/include/libnetfilter_conntrack/libnetfilter_conntrack.h:14:42:
+fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory
+
+compilation terminated.
+GNUmakefile:96: recipe for target 'libxt_connlabel.oo' failed
 Only check libnetfilter-conntrack when libnfnetlink is enabled to fix it.
 
 Upstream-Status: Pending
 
 Signed-off-by: Kai Kang <kai.kang@windriver.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ configure.ac | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 5d7e62b..e331ee7 100644
+index 03ddc50..523caea 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -88,8 +88,12 @@ if test "$ac_cv_header_linux_ip_vs_h" != "yes"; then
- 	blacklist_modules="$blacklist_modules ipvs";
- fi;
+@@ -172,10 +172,12 @@ if test "$nftables" != 1; then
+ fi
  
--PKG_CHECK_MODULES([libnetfilter_conntrack], [libnetfilter_conntrack >= 1.0.4],
-+nfconntrack=0
-+AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
-+  PKG_CHECK_MODULES([libnetfilter_conntrack], [libnetfilter_conntrack >= 1.0.4],
- 	[nfconntrack=1], [nfconntrack=0])
-+  ])
-+
- AM_CONDITIONAL([HAVE_LIBNETFILTER_CONNTRACK], [test "$nfconntrack" = 1])
- 
- if test "$nfconntrack" -ne 1; then
+ if test "x$enable_connlabel" = "xyes"; then
+-	PKG_CHECK_MODULES([libnetfilter_conntrack],
++    nfconntrack=0
++    AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
++    PKG_CHECK_MODULES([libnetfilter_conntrack],
+ 		[libnetfilter_conntrack >= 1.0.6],
+ 		[nfconntrack=1], [nfconntrack=0])
+-
++    ])
+ 	if test "$nfconntrack" -ne 1; then
+ 		blacklist_modules="$blacklist_modules connlabel";
+ 		echo "WARNING: libnetfilter_conntrack not found, connlabel match will not be built";
+-- 
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb
deleted file mode 100644
index fbbe418..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb
+++ /dev/null
@@ -1,50 +0,0 @@
-SUMMARY = "Tools for managing kernel packet filtering capabilities"
-DESCRIPTION = "iptables is the userspace command line program used to configure and control network packet \
-filtering code in Linux."
-HOMEPAGE = "http://www.netfilter.org/"
-BUGTRACKER = "http://bugzilla.netfilter.org/"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
-                    file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc"
-
-RRECOMMENDS_${PN} = "kernel-module-x-tables \
-                     kernel-module-ip-tables \
-                     kernel-module-iptable-filter \
-                     kernel-module-iptable-nat \
-                     kernel-module-nf-defrag-ipv4 \
-                     kernel-module-nf-conntrack \
-                     kernel-module-nf-conntrack-ipv4 \
-                     kernel-module-nf-nat \
-                     kernel-module-ipt-masquerade"
-FILES_${PN} =+ "${libdir}/xtables/ ${datadir}/xtables"
-
-SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
-           file://types.h-add-defines-that-are-required-for-if_packet.patch \
-           file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \
-           file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \
-          "
-SRC_URI_append_libc-musl = " file://0001-fix-build-with-musl.patch"
-
-SRC_URI[md5sum] = "27ba3451cb622467fc9267a176f19a31"
-SRC_URI[sha256sum] = "4bb72a0a0b18b5a9e79e87631ddc4084528e5df236bc7624472dcaa8480f1c60"
-
-inherit autotools pkgconfig
-
-EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR} \
-               "
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-                 "
-
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
-
-# libnfnetlink recipe is in meta-networking layer
-PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libnfnetlink libnetfilter-conntrack"
-
-# libnftnl recipe is in meta-networking layer(previously known as libnftables)
-PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl"
-
-do_configure_prepend() {
-	# Remove some libtool m4 files
-	# Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
-	rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.1.bb b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.1.bb
new file mode 100644
index 0000000..b37c55a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.1.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Tools for managing kernel packet filtering capabilities"
+DESCRIPTION = "iptables is the userspace command line program used to configure and control network packet \
+filtering code in Linux."
+HOMEPAGE = "http://www.netfilter.org/"
+BUGTRACKER = "http://bugzilla.netfilter.org/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
+                    file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc"
+
+RRECOMMENDS_${PN} = "kernel-module-x-tables \
+                     kernel-module-ip-tables \
+                     kernel-module-iptable-filter \
+                     kernel-module-iptable-nat \
+                     kernel-module-nf-defrag-ipv4 \
+                     kernel-module-nf-conntrack \
+                     kernel-module-nf-conntrack-ipv4 \
+                     kernel-module-nf-nat \
+                     kernel-module-ipt-masquerade"
+FILES_${PN} =+ "${libdir}/xtables/ ${datadir}/xtables"
+
+SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
+           file://types.h-add-defines-that-are-required-for-if_packet.patch \
+           file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \
+           file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \
+           file://0001-fix-build-with-musl.patch \
+"
+
+SRC_URI[md5sum] = "ab38a33806b6182c6f53d6afb4619add"
+SRC_URI[sha256sum] = "0fc2d7bd5d7be11311726466789d4c65fb4c8e096c9182b56ce97440864f0cf5"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR} \
+               "
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+# libnfnetlink recipe is in meta-networking layer
+PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libnfnetlink libnetfilter-conntrack"
+
+# libnftnl recipe is in meta-networking layer(previously known as libnftables)
+PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl"
+
+do_configure_prepend() {
+	# Remove some libtool m4 files
+	# Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
+	rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb b/import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb
index 7150454..0d4dd1b 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb
@@ -11,7 +11,7 @@
                     file://arping.c;beginline=1;endline=11;md5=fe84301b5c2655c950f8b92a057fafa6 \
                     file://tftpd.c;beginline=1;endline=32;md5=28834bf8a91a5b8a92755dbee709ef96 "
 
-DEPENDS = "gnutls docbook-utils-native sgmlspl-native libcap libgcrypt"
+DEPENDS = "gnutls libcap libgcrypt"
 
 
 SRC_URI = "http://www.skbuff.net/iputils/${BPN}-${PV}.tar.bz2 \
@@ -30,11 +30,11 @@
 EXTRA_OEMAKE = "-e MAKEFLAGS="
 
 do_compile () {
-	oe_runmake 'CC=${CC} -D_GNU_SOURCE' VPATH="${STAGING_LIBDIR}:${STAGING_DIR_HOST}/${base_libdir}" all man
+	oe_runmake 'CC=${CC} -D_GNU_SOURCE' VPATH="${STAGING_LIBDIR}:${STAGING_DIR_HOST}/${base_libdir}" all
 }
 
 do_install () {
-	install -m 0755 -d ${D}${base_bindir} ${D}${mandir}/man8
+	install -m 0755 -d ${D}${base_bindir}
 	# SUID root programs
 	install -m 4555 ping ${D}${base_bindir}/ping
 	install -m 4555 ping6 ${D}${base_bindir}/ping6
@@ -44,10 +44,6 @@
 	for i in arping tracepath tracepath6; do
 	  install -m 0755 $i ${D}${base_bindir}/
 	done
-	# Manual pages for things we build packages for
-	for i in tracepath.8 traceroute6.8 ping.8 arping.8; do
-	  install -m 0644 doc/$i ${D}${mandir}/man8/ || true
-	done
 }
 
 inherit update-alternatives
@@ -73,4 +69,3 @@
 FILES_${PN}-tracepath6 = "${base_bindir}/tracepath6"
 FILES_${PN}-traceroute6	= "${base_bindir}/traceroute6"
 FILES_${PN}-clockdiff = "${base_bindir}/clockdiff"
-FILES_${PN}-doc	= "${mandir}/man8"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/less/less_481.bb b/import-layers/yocto-poky/meta/recipes-extended/less/less_481.bb
deleted file mode 100644
index 0fcd819..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/less/less_481.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-SUMMARY = "Text file viewer similar to more"
-DESCRIPTION = "Less is a program similar to more, i.e. a terminal \
-based program for viewing text files and the output from other \
-programs. Less offers many features beyond those that more does."
-HOMEPAGE = "http://www.greenwoodsoftware.com/"
-SECTION = "console/utils"
-
-# (GPLv2+ (<< 418), GPLv3+ (>= 418)) | less
-# Including email author giving permissing to use BSD
-#
-# From: Mark Nudelman <markn@greenwoodsoftware.com>
-# To: Elizabeth Flanagan <elizabeth.flanagan@intel.com
-# Date: 12/19/11
-#
-# Hi Elizabeth,
-# Using a generic BSD license for less is fine with me.
-# Thanks,
-#
-# --Mark
-#
-
-LICENSE = "GPLv3+ | BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://LICENSE;md5=48c26a307f91af700e1f00585f215aaf"
-DEPENDS = "ncurses"
-
-SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \
-	  "
-
-SRC_URI[md5sum] = "50ef46065c65257141a7340123527767"
-SRC_URI[sha256sum] = "3fa38f2cf5e9e040bb44fffaa6c76a84506e379e47f5a04686ab78102090dda5"
-
-UPSTREAM_CHECK_URI = "http://www.greenwoodsoftware.com/less/download.html"
-
-inherit autotools update-alternatives
-
-do_install () {
-        oe_runmake 'bindir=${D}${bindir}' 'mandir=${D}${mandir}' install
-}
-
-ALTERNATIVE_${PN} = "less"
-ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/less/less_487.bb b/import-layers/yocto-poky/meta/recipes-extended/less/less_487.bb
new file mode 100644
index 0000000..23ae484
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/less/less_487.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Text file viewer similar to more"
+DESCRIPTION = "Less is a program similar to more, i.e. a terminal \
+based program for viewing text files and the output from other \
+programs. Less offers many features beyond those that more does."
+HOMEPAGE = "http://www.greenwoodsoftware.com/"
+SECTION = "console/utils"
+
+# (GPLv2+ (<< 418), GPLv3+ (>= 418)) | less
+# Including email author giving permissing to use BSD
+#
+# From: Mark Nudelman <markn@greenwoodsoftware.com>
+# To: Elizabeth Flanagan <elizabeth.flanagan@intel.com
+# Date: 12/19/11
+#
+# Hi Elizabeth,
+# Using a generic BSD license for less is fine with me.
+# Thanks,
+#
+# --Mark
+#
+
+LICENSE = "GPLv3+ | BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://LICENSE;md5=2ef3e4b8dafc85612bc5254b8081e234"
+DEPENDS = "ncurses"
+
+SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \
+	  "
+
+SRC_URI[md5sum] = "dcc8bf183a83b362d37fe9ef8df1fb60"
+SRC_URI[sha256sum] = "f3dc8455cb0b2b66e0c6b816c00197a71bf6d1787078adeee0bcf2aea4b12706"
+
+UPSTREAM_CHECK_URI = "http://www.greenwoodsoftware.com/less/download.html"
+
+inherit autotools update-alternatives
+
+do_install () {
+        oe_runmake 'bindir=${D}${bindir}' 'mandir=${D}${mandir}' install
+}
+
+ALTERNATIVE_${PN} = "less"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
new file mode 100644
index 0000000..e911a7c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/files/0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch
@@ -0,0 +1,245 @@
+From 90881d24d3f6d5fb207e97df3b91bbea8598e84e Mon Sep 17 00:00:00 2001
+From: Martin Matuska <martin@matuska.org>
+Date: Tue, 29 Nov 2016 16:47:37 +0100
+Subject: [PATCH 1/2] archive_write_disk_posix.c: make *_fsobj functions more
+ readable
+
+Upstream-Status: Backported
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ libarchive/archive_write_disk_posix.c | 121 +++++++++++++++++-----------------
+ 1 file changed, 61 insertions(+), 60 deletions(-)
+
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index 17c23b0..d786bc2 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -336,6 +336,8 @@ struct archive_write_disk {
+ 
+ #define HFS_BLOCKS(s)	((s) >> 12)
+ 
++static void	fsobj_error(int *, struct archive_string *, int, const char *,
++		    const char *);
+ static int	check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags);
+ static int	check_symlinks(struct archive_write_disk *);
+ static int	create_filesystem_object(struct archive_write_disk *);
+@@ -2005,8 +2007,9 @@ restore_entry(struct archive_write_disk *a)
+ 
+ 	if (en) {
+ 		/* Everything failed; give up here. */
+-		archive_set_error(&a->archive, en, "Can't create '%s'",
+-		    a->name);
++		if ((&a->archive)->error == NULL)
++			archive_set_error(&a->archive, en, "Can't create '%s'",
++			    a->name);
+ 		return (ARCHIVE_FAILED);
+ 	}
+ 
+@@ -2388,6 +2391,17 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
+ 	return (a->current_fixup);
+ }
+ 
++/* Error helper for new *_fsobj functions */
++static void
++fsobj_error(int *a_eno, struct archive_string *a_estr,
++    int err, const char *errstr, const char *path)
++{
++	if (a_eno)
++		*a_eno = err;
++	if (a_estr)
++		archive_string_sprintf(a_estr, errstr, path);
++}
++
+ /*
+  * TODO: Someday, integrate this with the deep dir support; they both
+  * scan the path and both can be optimized by comparing against other
+@@ -2400,7 +2414,7 @@ current_fixup(struct archive_write_disk *a, const char *pathname)
+  * ARCHIVE_OK if there are none, otherwise puts an error in errmsg.
+  */
+ static int
+-check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
++check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int flags)
+ {
+ #if !defined(HAVE_LSTAT)
+ 	/* Platform doesn't have lstat, so we can't look for symlinks. */
+@@ -2474,19 +2488,20 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 			if (errno == ENOENT) {
+ 				break;
+ 			} else {
+-				/* Treat any other error as fatal - best to be paranoid here
+-				 * Note: This effectively disables deep directory
+-				 * support when security checks are enabled.
+-				 * Otherwise, very long pathnames that trigger
+-				 * an error here could evade the sandbox.
+-				 * TODO: We could do better, but it would probably
+-				 * require merging the symlink checks with the
+-				 * deep-directory editing. */
+-				if (error_number) *error_number = errno;
+-				if (error_string)
+-					archive_string_sprintf(error_string,
+-							"Could not stat %s",
+-							path);
++				/*
++				 * Treat any other error as fatal - best to be
++				 * paranoid here.
++				 * Note: This effectively disables deep
++				 * directory support when security checks are
++				 * enabled. Otherwise, very long pathnames that
++				 * trigger an error here could evade the
++				 * sandbox.
++				 * TODO: We could do better, but it would
++				 * probably require merging the symlink checks
++				 * with the deep-directory editing.
++				 */
++				fsobj_error(a_eno, a_estr, errno,
++				    "Could not stat %s", path);
+ 				res = ARCHIVE_FAILED;
+ 				break;
+ 			}
+@@ -2494,11 +2509,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 			if (!last) {
+ 				if (chdir(head) != 0) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = errno;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Could not chdir %s",
+-								path);
++					fsobj_error(a_eno, a_estr, errno,
++					    "Could not chdir %s", path);
+ 					res = (ARCHIVE_FATAL);
+ 					break;
+ 				}
+@@ -2514,11 +2526,9 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				 */
+ 				if (unlink(head)) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = errno;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Could not remove symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, errno,
++					    "Could not remove symlink %s",
++					    path);
+ 					res = ARCHIVE_FAILED;
+ 					break;
+ 				}
+@@ -2529,13 +2539,14 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				 * symlink with another symlink.
+ 				 */
+ 				tail[0] = c;
+-				/* FIXME:  not sure how important this is to restore
++				/*
++				 * FIXME:  not sure how important this is to
++				 * restore
++				 */
++				/*
+ 				if (!S_ISLNK(path)) {
+-					if (error_number) *error_number = 0;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Removing symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, 0,
++					    "Removing symlink %s", path);
+ 				}
+ 				*/
+ 				/* Symlink gone.  No more problem! */
+@@ -2545,22 +2556,17 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 				/* User asked us to remove problems. */
+ 				if (unlink(head) != 0) {
+ 					tail[0] = c;
+-					if (error_number) *error_number = 0;
+-					if (error_string)
+-						archive_string_sprintf(error_string,
+-								"Cannot remove intervening symlink %s",
+-								path);
++					fsobj_error(a_eno, a_estr, 0,
++					    "Cannot remove intervening "
++					    "symlink %s", path);
+ 					res = ARCHIVE_FAILED;
+ 					break;
+ 				}
+ 				tail[0] = c;
+ 			} else {
+ 				tail[0] = c;
+-				if (error_number) *error_number = 0;
+-				if (error_string)
+-					archive_string_sprintf(error_string,
+-							"Cannot extract through symlink %s",
+-							path);
++				fsobj_error(a_eno, a_estr, 0,
++				    "Cannot extract through symlink %s", path);
+ 				res = ARCHIVE_FAILED;
+ 				break;
+ 			}
+@@ -2577,10 +2583,8 @@ check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error
+ 	if (restore_pwd >= 0) {
+ 		r = fchdir(restore_pwd);
+ 		if (r != 0) {
+-			if(error_number) *error_number = errno;
+-			if(error_string)
+-				archive_string_sprintf(error_string,
+-						"chdir() failure");
++			fsobj_error(a_eno, a_estr, errno,
++			    "chdir() failure", "");
+ 		}
+ 		close(restore_pwd);
+ 		restore_pwd = -1;
+@@ -2688,17 +2692,16 @@ cleanup_pathname_win(struct archive_write_disk *a)
+  * is set) if the path is absolute.
+  */
+ static int
+-cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
++cleanup_pathname_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
++    int flags)
+ {
+ 	char *dest, *src;
+ 	char separator = '\0';
+ 
+ 	dest = src = path;
+ 	if (*src == '\0') {
+-		if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-		if (error_string)
+-		    archive_string_sprintf(error_string,
+-			    "Invalid empty pathname");
++		fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
++		    "Invalid empty ", "pathname");
+ 		return (ARCHIVE_FAILED);
+ 	}
+ 
+@@ -2708,10 +2711,8 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err
+ 	/* Skip leading '/'. */
+ 	if (*src == '/') {
+ 		if (flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {
+-			if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-			if (error_string)
+-			    archive_string_sprintf(error_string,
+-				    "Path is absolute");
++			fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
++			    "Path is ", "absolute");
+ 			return (ARCHIVE_FAILED);
+ 		}
+ 
+@@ -2738,11 +2739,11 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err
+ 			} else if (src[1] == '.') {
+ 				if (src[2] == '/' || src[2] == '\0') {
+ 					/* Conditionally warn about '..' */
+-					if (flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
+-						if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
+-						if (error_string)
+-						    archive_string_sprintf(error_string,
+-							    "Path contains '..'");
++					if (flags
++					    & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
++						fsobj_error(a_eno, a_estr,
++						    ARCHIVE_ERRNO_MISC,
++						    "Path contains ", "'..'");
+ 						return (ARCHIVE_FAILED);
+ 					}
+ 				}
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch
new file mode 100644
index 0000000..3741863
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/files/0002-Fix-extracting-hardlinks-over-symlinks.patch
@@ -0,0 +1,120 @@
+From ece28103885a079a129a23c5001252a1648517af Mon Sep 17 00:00:00 2001
+From: Martin Matuska <martin@matuska.org>
+Date: Tue, 29 Nov 2016 16:55:41 +0100
+Subject: [PATCH 2/2] Fix extracting hardlinks over symlinks
+
+Closes #821
+
+Upstream-Status: Backported
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ libarchive/archive_write_disk_posix.c | 43 +++++++++++++++++++++++++++++++++++
+ tar/test/test_symlink_dir.c           | 18 ++++++++++++++-
+ 2 files changed, 60 insertions(+), 1 deletion(-)
+
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index d786bc2..80b03cd 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -2563,6 +2563,49 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, int
+ 					break;
+ 				}
+ 				tail[0] = c;
++			} else if ((flags &
++			    ARCHIVE_EXTRACT_SECURE_SYMLINKS) == 0) {
++				/*
++				 * We are not the last element and we want to
++				 * follow symlinks if they are a directory.
++				 * 
++				 * This is needed to extract hardlinks over
++				 * symlinks.
++				 */
++				r = stat(head, &st);
++				if (r != 0) {
++					tail[0] = c;
++					if (errno == ENOENT) {
++						break;
++					} else {
++						fsobj_error(a_eno, a_estr,
++						    errno,
++						    "Could not stat %s", path);
++						res = (ARCHIVE_FAILED);
++						break;
++					}
++				} else if (S_ISDIR(st.st_mode)) {
++					if (chdir(head) != 0) {
++						tail[0] = c;
++						fsobj_error(a_eno, a_estr,
++						    errno,
++						    "Could not chdir %s", path);
++						res = (ARCHIVE_FATAL);
++						break;
++					}
++					/*
++					 * Our view is now from inside
++					 * this dir:
++					 */
++					head = tail + 1;
++				} else {
++					tail[0] = c;
++					fsobj_error(a_eno, a_estr, 0,
++					    "Cannot extract through "
++					    "symlink %s", path);
++					res = ARCHIVE_FAILED;
++					break;
++				}
+ 			} else {
+ 				tail[0] = c;
+ 				fsobj_error(a_eno, a_estr, 0,
+diff --git a/tar/test/test_symlink_dir.c b/tar/test/test_symlink_dir.c
+index 25bd8b1..852e00b 100644
+--- a/tar/test/test_symlink_dir.c
++++ b/tar/test/test_symlink_dir.c
+@@ -47,11 +47,18 @@ DEFINE_TEST(test_symlink_dir)
+ 	assertMakeDir("source/dir3", 0755);
+ 	assertMakeDir("source/dir3/d3", 0755);
+ 	assertMakeFile("source/dir3/f3", 0755, "abcde");
++	assertMakeDir("source/dir4", 0755);
++	assertMakeFile("source/dir4/file3", 0755, "abcdef");
++	assertMakeHardlink("source/dir4/file4", "source/dir4/file3");
+ 
+ 	assertEqualInt(0,
+ 	    systemf("%s -cf test.tar -C source dir dir2 dir3 file file2",
+ 		testprog));
+ 
++	/* Second archive with hardlinks */
++	assertEqualInt(0,
++	    systemf("%s -cf test2.tar -C source dir4", testprog));
++
+ 	/*
+ 	 * Extract with -x and without -P.
+ 	 */
+@@ -118,9 +125,15 @@ DEFINE_TEST(test_symlink_dir)
+ 		assertMakeSymlink("dest2/file2", "real_file2");
+ 	assertEqualInt(0, systemf("%s -xPf test.tar -C dest2", testprog));
+ 
+-	/* dest2/dir symlink should be followed */
++	/* "dir4" is a symlink to existing "real_dir" */
++	if (canSymlink())
++		assertMakeSymlink("dest2/dir4", "real_dir");
++	assertEqualInt(0, systemf("%s -xPf test2.tar -C dest2", testprog));
++
++	/* dest2/dir and dest2/dir4 symlinks should be followed */
+ 	if (canSymlink()) {
+ 		assertIsSymlink("dest2/dir", "real_dir");
++		assertIsSymlink("dest2/dir4", "real_dir");
+ 		assertIsDir("dest2/real_dir", -1);
+ 	}
+ 
+@@ -141,4 +154,7 @@ DEFINE_TEST(test_symlink_dir)
+ 	/* dest2/file2 symlink should be removed */
+ 	failure("Symlink to non-existing file should be removed");
+ 	assertIsReg("dest2/file2", -1);
++
++	/* dest2/dir4/file3 and dest2/dir4/file4 should be hard links */
++	assertIsHardlink("dest2/dir4/file3", "dest2/dir4/file4");
+ }
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/files/non-recursive-extract-and-list.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/files/non-recursive-extract-and-list.patch
new file mode 100644
index 0000000..61f8f3e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/files/non-recursive-extract-and-list.patch
@@ -0,0 +1,153 @@
+From d6271709d2deb980804f92e75f9b5cb600dc42ed Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Mon, 24 Oct 2016 12:54:48 +0200
+Subject: [PATCH 1/2] non-recursive extract and list
+
+Sometimes it makes sense to extract or list a directory contained in
+an archive without also doing the same for the content of the
+directory, i.e. allowing -n (= --no-recursion) in combination with the
+x and t modes.
+
+bsdtar uses the match functionality in libarchive to track include
+matches. A new libarchive API call
+archive_match_include_directories_recursively() gets introduced to
+influence the matching behavior, with the default behavior as before.
+
+Non-recursive matching can be achieved by anchoring the path match at
+both start and end. Asking for a directory which itself isn't in the
+archive when in non-recursive mode is an error and handled by the
+existing mechanism for tracking unused inclusion entries.
+
+Upstream-Status: Submitted [https://github.com/libarchive/libarchive/pull/812]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+
+---
+ libarchive/archive.h       |  2 ++
+ libarchive/archive_match.c | 30 +++++++++++++++++++++++++++++-
+ tar/bsdtar.1               |  3 +--
+ tar/bsdtar.c               | 12 ++++++++++--
+ 4 files changed, 42 insertions(+), 5 deletions(-)
+
+diff --git a/libarchive/archive.h b/libarchive/archive.h
+index ff401e9..38d8746 100644
+--- a/libarchive/archive.h
++++ b/libarchive/archive.h
+@@ -1085,6 +1085,8 @@ __LA_DECL int	archive_match_excluded(struct archive *,
+  */
+ __LA_DECL int	archive_match_path_excluded(struct archive *,
+ 		    struct archive_entry *);
++/* Control recursive inclusion of directory content when directory is included. Default on. */
++__LA_DECL int	archive_match_include_directories_recursively(struct archive *, int _enabled);
+ /* Add exclusion pathname pattern. */
+ __LA_DECL int	archive_match_exclude_pattern(struct archive *, const char *);
+ __LA_DECL int	archive_match_exclude_pattern_w(struct archive *,
+diff --git a/libarchive/archive_match.c b/libarchive/archive_match.c
+index 0719cbd..6d03a65 100644
+--- a/libarchive/archive_match.c
++++ b/libarchive/archive_match.c
+@@ -93,6 +93,9 @@ struct archive_match {
+ 	/* exclusion/inclusion set flag. */
+ 	int			 setflag;
+ 
++	/* Recursively include directory content? */
++	int			 recursive_include;
++
+ 	/*
+ 	 * Matching filename patterns.
+ 	 */
+@@ -223,6 +226,7 @@ archive_match_new(void)
+ 		return (NULL);
+ 	a->archive.magic = ARCHIVE_MATCH_MAGIC;
+ 	a->archive.state = ARCHIVE_STATE_NEW;
++	a->recursive_include = 1;
+ 	match_list_init(&(a->inclusions));
+ 	match_list_init(&(a->exclusions));
+ 	__archive_rb_tree_init(&(a->exclusion_tree), &rb_ops_mbs);
+@@ -471,6 +475,28 @@ archive_match_path_excluded(struct archive *_a,
+ }
+ 
+ /*
++ * When recursive inclusion of directory content is enabled,
++ * an inclusion pattern that matches a directory will also
++ * include everything beneath that directory. Enabled by default.
++ *
++ * For compatibility with GNU tar, exclusion patterns always
++ * match if a subset of the full patch matches (i.e., they are
++ * are not rooted at the beginning of the path) and thus there
++ * is no corresponding non-recursive exclusion mode.
++ */
++int
++archive_match_include_directories_recursively(struct archive *_a, int _enabled)
++{
++	struct archive_match *a;
++
++	archive_check_magic(_a, ARCHIVE_MATCH_MAGIC,
++	    ARCHIVE_STATE_NEW, "archive_match_include_directories_recursively");
++	a = (struct archive_match *)_a;
++	a->recursive_include = _enabled;
++	return (ARCHIVE_OK);
++}
++
++/*
+  * Utilty functions to get statistic information for inclusion patterns.
+  */
+ int
+@@ -781,7 +807,9 @@ static int
+ match_path_inclusion(struct archive_match *a, struct match *m,
+     int mbs, const void *pn)
+ {
+-	int flag = PATHMATCH_NO_ANCHOR_END;
++	int flag = a->recursive_include ?
++		PATHMATCH_NO_ANCHOR_END : /* Prefix match is good enough. */
++		0; /* Full match required. */
+ 	int r;
+ 
+ 	if (mbs) {
+diff --git a/tar/bsdtar.1 b/tar/bsdtar.1
+index 9eadaaf..f5d6457 100644
+--- a/tar/bsdtar.1
++++ b/tar/bsdtar.1
+@@ -346,8 +346,7 @@ In extract or list modes, this option is ignored.
+ Do not extract modification time.
+ By default, the modification time is set to the time stored in the archive.
+ .It Fl n , Fl Fl norecurse , Fl Fl no-recursion
+-(c, r, u modes only)
+-Do not recursively archive the contents of directories.
++Do not recursively archive (c, r, u), extract (x) or list (t) the contents of directories.
+ .It Fl Fl newer Ar date
+ (c, r, u modes only)
+ Only include files and directories newer than the specified date.
+diff --git a/tar/bsdtar.c b/tar/bsdtar.c
+index 93bf60a..001d5ed 100644
+--- a/tar/bsdtar.c
++++ b/tar/bsdtar.c
+@@ -738,8 +738,6 @@ main(int argc, char **argv)
+ 			break;
+ 		}
+ 	}
+-	if (bsdtar->option_no_subdirs)
+-		only_mode(bsdtar, "-n", "cru");
+ 	if (bsdtar->option_stdout)
+ 		only_mode(bsdtar, "-O", "xt");
+ 	if (bsdtar->option_unlink_first)
+@@ -788,6 +786,16 @@ main(int argc, char **argv)
+ 		only_mode(bsdtar, buff, "cru");
+ 	}
+ 
++	/*
++	 * When creating an archive from a directory tree, the directory
++	 * walking code will already avoid entering directories when
++	 * recursive inclusion of directory content is disabled, therefore
++	 * changing the matching behavior has no effect for creation modes.
++	 * It is relevant for extraction or listing.
++	 */
++	archive_match_include_directories_recursively(bsdtar->matching,
++						      !bsdtar->option_no_subdirs);
++
+ 	/* Filename "-" implies stdio. */
+ 	if (strcmp(bsdtar->filename, "-") == 0)
+ 		bsdtar->filename = NULL;
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.2.2.bb b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
index 7917ce7..da959a2 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.2.2.bb
@@ -11,18 +11,16 @@
 
 PACKAGECONFIG_append_class-target = "\
 	libxml2 \
-	${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
-	${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)} \
-	${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
+	${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
 "
 
-PACKAGECONFIG_append_class-nativesdk = " largefile"
+DEPENDS_BZIP2 = "bzip2-replacement-native"
+DEPENDS_BZIP2_class-target = "bzip2"
 
 PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
 PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
-PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
 PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
-PACKAGECONFIG[bz2] = "--with-bz2lib,--without-bz2lib,bzip2,"
+PACKAGECONFIG[bz2] = "--with-bz2lib,--without-bz2lib,${DEPENDS_BZIP2},"
 PACKAGECONFIG[xz] = "--with-lzmadec --with-lzma,--without-lzmadec --without-lzma,xz,"
 PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl,"
 PACKAGECONFIG[libxml2] = "--with-xml2,--without-xml2,libxml2,"
@@ -31,7 +29,12 @@
 PACKAGECONFIG[nettle] = "--with-nettle,--without-nettle,nettle,"
 PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
 
+EXTRA_OECONF += "--enable-largefile"
+
 SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
+           file://non-recursive-extract-and-list.patch \
+	   file://0001-archive_write_disk_posix.c-make-_fsobj-functions-mor.patch \
+	   file://0002-Fix-extracting-hardlinks-over-symlinks.patch \
            "
 
 SRC_URI[md5sum] = "1ec00b7dcaf969dd2a5712f85f23c764"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb
deleted file mode 100644
index c681560..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-SUMMARY = "Internationalized Domain Name support library"
-DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group."
-HOMEPAGE = "http://www.gnu.org/software/libidn/"
-SECTION = "libs"
-LICENSE = "LGPLv2.1+ & GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
-                    file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
-                    file://lib/idna.h;beginline=6;endline=18;md5=1336e848ca7b8e25767c3c7e8fa38a89 \
-                    file://src/idn.c;beginline=6;endline=18;md5=56c89e359652a71cda128d75f0ffdac4"
-PR = "r1"
-
-inherit pkgconfig autotools gettext texinfo
-
-SRC_URI = "http://alpha.gnu.org/gnu/libidn/${BPN}-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "040f012a45feb56168853998bb87ad4d"
-SRC_URI[sha256sum] = "98910c2ad664bdf4eed2c2fff88e24f8882636ec9d26669366ff03b469c05ae3"
-
-do_configure_prepend() {
-	# this version of libidn copies AC_USE_SYSTEM_EXTENSIONS from 
-	# autoconf CVS because atm the autoconf it uses is a bit old
-	# now with cross autotool, that macro is already there and this
-	# local definition causes circular dependency. Actually AC_GNU_SOURCE
-	# is identical to AC_USE_SYSTEM_EXTENSIONS. So remove all local
-	# references to the latter here.
-	sed -i -e "/AC_REQUIRE(\[gl_USE_SYSTEM_EXTENSIONS/d" ${S}/lib/gl/m4/gnulib-comp.m4
-	rm -f ${S}/lib/gl/m4/extensions.m4
-}
-
-do_install_append() {
-	rm -rf ${D}${libdir}/Libidn.dll
-	rm -rf ${D}${datadir}/emacs
-}
-
-BBCLASSEXTEND = "native nativesdk"
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch
index 24e2228..a575d0e 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch
@@ -1,32 +1,29 @@
-From 5b6e113f548bd8a2b100267bc5d54cee861a4b98 Mon Sep 17 00:00:00 2001
+From 4d9b6ec30b78d00ead0a22eb5d047dcdba37e99c Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?=
  =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?=
  <ngompa13@gmail.com>
 Date: Wed, 11 Nov 2015 20:32:17 -0500
-Subject: [PATCH] Add fallback fopencookie() implementation
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
+Subject: [PATCH 1/2] Add fallback fopencookie() implementation
 
 In environments where neither fopencookie() nor funopen()
 are implemented, we need to provide a suitable implementation
 of fopencookie() that we can use.
 
-Upstream-Status: Submitted [ https://github.com/openSUSE/libsolv/pull/112 ]
+Alex Kanavin: rebased CMakeLists.txt change to apply to latest upstream code.
 
-Signed-off-by: Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>com>
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
+Upstream-Status: Denied [https://github.com/openSUSE/libsolv/pull/112]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
 ---
  ext/CMakeLists.txt                     |   7 ++
  ext/solv_xfopen.c                      |  10 +--
- ext/solv_xfopen_fallback_fopencookie.c | 124 +++++++++++++++++++++++++++++++++
+ ext/solv_xfopen_fallback_fopencookie.c | 123 +++++++++++++++++++++++++++++++++
  ext/solv_xfopen_fallback_fopencookie.h |  28 ++++++++
- 4 files changed, 165 insertions(+), 4 deletions(-)
+ 4 files changed, 164 insertions(+), 4 deletions(-)
  create mode 100644 ext/solv_xfopen_fallback_fopencookie.c
  create mode 100644 ext/solv_xfopen_fallback_fopencookie.h
 
 diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt
-index ad52495..4f282ce 100644
+index 586eda8..477a2ef 100644
 --- a/ext/CMakeLists.txt
 +++ b/ext/CMakeLists.txt
 @@ -4,6 +4,13 @@ SET (libsolvext_SRCS
@@ -40,7 +37,7 @@
 +        solv_xfopen_fallback_fopencookie.h)
 +ENDIF (NOT HAVE_FOPENCOOKIE AND NOT HAVE_FUNOPEN)
 +
- IF (ENABLE_RPMDB)
+ IF (ENABLE_RPMDB OR ENABLE_RPMPKG)
      SET (libsolvext_SRCS ${libsolvext_SRCS}
          pool_fileconflicts.c repo_rpmdb.c)
 diff --git a/ext/solv_xfopen.c b/ext/solv_xfopen.c
@@ -87,17 +84,17 @@
  
 diff --git a/ext/solv_xfopen_fallback_fopencookie.c b/ext/solv_xfopen_fallback_fopencookie.c
 new file mode 100644
-index 0000000..89426a9
+index 0000000..0ce2571
 --- /dev/null
 +++ b/ext/solv_xfopen_fallback_fopencookie.c
-@@ -0,0 +1,124 @@
-+/*
+@@ -0,0 +1,123 @@
++/* 
 + *	Provides a very limited fopencookie() for environments with a libc
 + *	that lacks it.
-+ *
-+ *	Authors: zhasha & nsz
++ *	
++ *	Author: zhasha
 + *	Modified for libsolv by Neal Gompa
-+ *
++ *	
 + *	This program is licensed under the BSD license, read LICENSE.BSD
 + *	for further information.
 + *
@@ -126,7 +123,7 @@
 +{
 +    struct ctx *ctx = arg;
 +    ssize_t r;
-+    size_t n, k;
++    size_t n;
 +
 +    pthread_detach(pthread_self());
 +
@@ -140,18 +137,17 @@
 +        }
 +        if (r == 0) { break; }
 +
-+        n = r, k = 0;
 +        while (n > 0) {
 +            r = ctx->io.write ?
-+                (ctx->io.write)(ctx->cookie, ctx->buf + k, n) :
-+                write(ctx->fd, ctx->buf + k, n);
++                (ctx->io.write)(ctx->cookie, ctx->buf + ((size_t)r - n), n) :
++                write(ctx->fd, ctx->buf + ((size_t)r - n), n);
 +            if (r < 0) {
 +                if (errno != EINTR) { break; }
 +                continue;
 +            }
 +            if (r == 0) { break; }
 +
-+            n -= r, k += r;
++            n -= (size_t)r;
 +        }
 +        if (n > 0) { break; }
 +    }
@@ -171,8 +167,8 @@
 +
 +    switch (mode[0]) {
 +        case 'a':
-+        case 'w': wr = 1; break;
 +        case 'r': rd = 1; break;
++        case 'w': wr = 1; break;
 +        default:
 +            errno = EINVAL;
 +            return NULL;
@@ -217,20 +213,20 @@
 +}
 diff --git a/ext/solv_xfopen_fallback_fopencookie.h b/ext/solv_xfopen_fallback_fopencookie.h
 new file mode 100644
-index 0000000..7223e3f
+index 0000000..6a7bfee
 --- /dev/null
 +++ b/ext/solv_xfopen_fallback_fopencookie.h
 @@ -0,0 +1,28 @@
-+/*
++/* 
 + *	Provides a very limited fopencookie() for environments with a libc
 + *	that lacks it.
-+ *
-+ *	Authors: zhasha & nsz
++ *	
++ *	Author: zhasha
 + *	Modified for libsolv by Neal Gompa
-+ *
++ *	
 + *	This program is licensed under the BSD license, read LICENSE.BSD
 + *	for further information.
-+ *
++ *	
 + */
 +
 +#ifndef SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H
@@ -250,5 +246,5 @@
 +
 +#endif
 -- 
-2.4.0
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch
new file mode 100644
index 0000000..efb4e3a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch
@@ -0,0 +1,104 @@
+From 99b10cdf6a0f8a24e1670c1813b1d9563ae3f5b5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?=
+ =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?=
+ <ngompa13@gmail.com>
+Date: Mon, 23 Nov 2015 18:19:41 -0500
+Subject: [PATCH 2/2] Fixes to internal fopencookie() implementation
+
+Credits to the fixes go to nsz on #musl on Freenode,
+who gloriously fixed the implementation such that
+the tests all pass.
+
+Upstream-Status: Denied [https://github.com/openSUSE/libsolv/pull/112]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ ext/solv_xfopen_fallback_fopencookie.c | 19 ++++++++++---------
+ ext/solv_xfopen_fallback_fopencookie.h | 10 +++++-----
+ 2 files changed, 15 insertions(+), 14 deletions(-)
+
+diff --git a/ext/solv_xfopen_fallback_fopencookie.c b/ext/solv_xfopen_fallback_fopencookie.c
+index 0ce2571..89426a9 100644
+--- a/ext/solv_xfopen_fallback_fopencookie.c
++++ b/ext/solv_xfopen_fallback_fopencookie.c
+@@ -1,10 +1,10 @@
+-/* 
++/*
+  *	Provides a very limited fopencookie() for environments with a libc
+  *	that lacks it.
+- *	
+- *	Author: zhasha
++ *
++ *	Authors: zhasha & nsz
+  *	Modified for libsolv by Neal Gompa
+- *	
++ *
+  *	This program is licensed under the BSD license, read LICENSE.BSD
+  *	for further information.
+  *
+@@ -33,7 +33,7 @@ static void *proxy(void *arg)
+ {
+     struct ctx *ctx = arg;
+     ssize_t r;
+-    size_t n;
++    size_t n, k;
+ 
+     pthread_detach(pthread_self());
+ 
+@@ -47,17 +47,18 @@ static void *proxy(void *arg)
+         }
+         if (r == 0) { break; }
+ 
++        n = r, k = 0;
+         while (n > 0) {
+             r = ctx->io.write ?
+-                (ctx->io.write)(ctx->cookie, ctx->buf + ((size_t)r - n), n) :
+-                write(ctx->fd, ctx->buf + ((size_t)r - n), n);
++                (ctx->io.write)(ctx->cookie, ctx->buf + k, n) :
++                write(ctx->fd, ctx->buf + k, n);
+             if (r < 0) {
+                 if (errno != EINTR) { break; }
+                 continue;
+             }
+             if (r == 0) { break; }
+ 
+-            n -= (size_t)r;
++            n -= r, k += r;
+         }
+         if (n > 0) { break; }
+     }
+@@ -77,8 +78,8 @@ FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t i
+ 
+     switch (mode[0]) {
+         case 'a':
+-        case 'r': rd = 1; break;
+         case 'w': wr = 1; break;
++        case 'r': rd = 1; break;
+         default:
+             errno = EINVAL;
+             return NULL;
+diff --git a/ext/solv_xfopen_fallback_fopencookie.h b/ext/solv_xfopen_fallback_fopencookie.h
+index 6a7bfee..7223e3f 100644
+--- a/ext/solv_xfopen_fallback_fopencookie.h
++++ b/ext/solv_xfopen_fallback_fopencookie.h
+@@ -1,13 +1,13 @@
+-/* 
++/*
+  *	Provides a very limited fopencookie() for environments with a libc
+  *	that lacks it.
+- *	
+- *	Author: zhasha
++ *
++ *	Authors: zhasha & nsz
+  *	Modified for libsolv by Neal Gompa
+- *	
++ *
+  *	This program is licensed under the BSD license, read LICENSE.BSD
+  *	for further information.
+- *	
++ *
+  */
+ 
+ #ifndef SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_0.6.23.bb b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_0.6.23.bb
deleted file mode 100644
index f3f3d6e..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_0.6.23.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-SUMMARY = "Library for solving packages and reading repositories"
-HOMEPAGE = "https://github.com/openSUSE/libsolv"
-BUGTRACKER = "https://github.com/openSUSE/libsolv/issues"
-SECTION = "devel"
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8"
-
-DEPENDS = "expat zlib"
-
-SRC_URI = "git://github.com/openSUSE/libsolv.git \
-          "
-SRC_URI_append_libc-musl = " file://0001-Add-fallback-fopencookie-implementation.patch"
-
-SRCREV = "f654c8cfa52427ed42d7142e58452dae08c0c2d0"
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
-
-S = "${WORKDIR}/git"
-
-inherit cmake
-
-EXTRA_OECMAKE = "-DLIB=${baselib} -DMULTI_SEMANTICS=ON"
-
-PACKAGES =+ "${PN}-tools ${PN}ext"
-
-FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibSolv.cmake"
-FILES_${PN}-tools = "${bindir}/*"
-FILES_${PN}ext = "${libdir}/${PN}ext.so.*"
-
-BBCLASSEXTEND =+ "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_0.6.26.bb b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_0.6.26.bb
new file mode 100644
index 0000000..42d63ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_0.6.26.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Library for solving packages and reading repositories"
+HOMEPAGE = "https://github.com/openSUSE/libsolv"
+BUGTRACKER = "https://github.com/openSUSE/libsolv/issues"
+SECTION = "devel"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8"
+
+DEPENDS = "expat zlib rpm"
+
+SRC_URI = "git://github.com/openSUSE/libsolv.git \
+           "
+SRC_URI_append_libc-musl = " file://0001-Add-fallback-fopencookie-implementation.patch \
+                             file://0002-Fixes-to-internal-fopencookie-implementation.patch \
+                           "
+
+SRCREV = "ba32f8286d3deec6faaabc79762a4760e9af0a07"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DLIB=${baselib} -DMULTI_SEMANTICS=ON -DENABLE_RPMMD=ON -DENABLE_RPMDB=ON"
+
+PACKAGES =+ "${PN}-tools ${PN}ext"
+
+FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibSolv.cmake"
+FILES_${PN}-tools = "${bindir}/*"
+FILES_${PN}ext = "${libdir}/${PN}ext.so.*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb
index 07028d5..1765346 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb
@@ -20,7 +20,7 @@
 SRC_URI[md5sum] = "63e5e5c551e99dc5302b40b80bd6d4f2"
 SRC_URI[sha256sum] = "a58ff4fabb01a25043b142185a33eeea961109dd60d4b40b6a9df4fa3cace20b"
 
-DEPENDS = "popt libpam glib-2.0 docbook-utils-native linuxdoc-tools-native python3"
+DEPENDS = "popt libpam glib-2.0 python3"
 
 inherit autotools gettext python3native python3-dir pkgconfig gtk-doc
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.41.bb b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.41.bb
deleted file mode 100644
index 1a3f323..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.41.bb
+++ /dev/null
@@ -1,79 +0,0 @@
-SUMMARY = "Lightweight high-performance web server"
-HOMEPAGE = "http://www.lighttpd.net/"
-BUGTRACKER = "http://redmine.lighttpd.net/projects/lighttpd/issues"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=e4dac5c6ab169aa212feb5028853a579"
-
-SECTION = "net"
-DEPENDS = "zlib libpcre"
-RDEPENDS_${PN} += " \
-               lighttpd-module-access \
-               lighttpd-module-accesslog \
-               lighttpd-module-indexfile \
-               lighttpd-module-dirlisting \
-               lighttpd-module-staticfile \
-"
-
-SRC_URI = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${PV}.tar.xz \
-        file://index.html.lighttpd \
-        file://lighttpd.conf \
-        file://lighttpd \
-        file://lighttpd.service \
-        file://0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch \
-        "
-
-SRC_URI[md5sum] = "1df2e4dbc965cfe6f99f008ac3db4d8d"
-SRC_URI[sha256sum] = "4bcc383ef6d6dc7b284f68882d71a178e2986c83c4e85eeb3c8f3b882e346b6c"
-
-PACKAGECONFIG ??= "openssl \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
-"
-PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
-
-EXTRA_OECONF = " \
-             --without-bzip2 \
-             --without-ldap \
-             --without-lua \
-             --without-memcached \
-             --with-pcre \
-             --without-webdav-props \
-             --without-webdav-locks \
-             --disable-static \
-"
-
-inherit autotools pkgconfig update-rc.d gettext systemd
-
-INITSCRIPT_NAME = "lighttpd"
-INITSCRIPT_PARAMS = "defaults 70"
-
-SYSTEMD_SERVICE_${PN} = "lighttpd.service"
-
-do_install_append() {
-	install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/lighttpd.d ${D}/www/pages/dav
-	install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d
-	install -m 0644 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir}
-	install -m 0644 ${WORKDIR}/index.html.lighttpd ${D}/www/pages/index.html
-
-	install -d ${D}${systemd_unitdir}/system
-	install -m 0644 ${WORKDIR}/lighttpd.service ${D}${systemd_unitdir}/system
-	sed -i -e 's,@SBINDIR@,${sbindir},g' \
-		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
-		-e 's,@BASE_BINDIR@,${base_bindir},g' \
-		${D}${systemd_unitdir}/system/lighttpd.service
-	#For FHS compliance, create symbolic links to /var/log and /var/tmp for logs and temporary data
-	ln -sf ${localstatedir}/log ${D}/www/logs
-	ln -sf ${localstatedir}/tmp ${D}/www/var
-}
-
-FILES_${PN} += "${sysconfdir} /www"
-
-CONFFILES_${PN} = "${sysconfdir}/lighttpd.conf"
-
-PACKAGES_DYNAMIC += "^lighttpd-module-.*"
-
-python populate_packages_prepend () {
-    lighttpd_libdir = d.expand('${libdir}')
-    do_split_packages(d, lighttpd_libdir, '^mod_(.*)\.so$', 'lighttpd-module-%s', 'Lighttpd module for %s', extra_depends='')
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.45.bb b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.45.bb
new file mode 100644
index 0000000..08dda33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.45.bb
@@ -0,0 +1,85 @@
+SUMMARY = "Lightweight high-performance web server"
+HOMEPAGE = "http://www.lighttpd.net/"
+BUGTRACKER = "http://redmine.lighttpd.net/projects/lighttpd/issues"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e4dac5c6ab169aa212feb5028853a579"
+
+SECTION = "net"
+RDEPENDS_${PN} = "lighttpd-module-dirlisting \
+                  lighttpd-module-indexfile \
+                  lighttpd-module-staticfile"
+RRECOMMENDS_${PN} = "lighttpd-module-access \
+                     lighttpd-module-accesslog"
+
+SRC_URI = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${PV}.tar.xz \
+        file://index.html.lighttpd \
+        file://lighttpd.conf \
+        file://lighttpd \
+        file://lighttpd.service \
+        file://0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch \
+        "
+
+SRC_URI[md5sum] = "a128e1eda76899ce3fd115efae5fe631"
+SRC_URI[sha256sum] = "1c97225deea33eefba6d4158c2cef27913d47553263516bbe9d2e2760fc43a3f"
+
+PACKAGECONFIG ??= "openssl pcre zlib \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
+"
+
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6"
+PACKAGECONFIG[mmap] = "--enable-mmap,--disable-mmap"
+PACKAGECONFIG[libev] = "--with-libev,--without-libev,libev"
+PACKAGECONFIG[mysql] = "--with-mysql,--without-mysql,mariadb"
+PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
+PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
+PACKAGECONFIG[krb5] = "--with-krb5,--without-krb5,krb5"
+PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
+PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2"
+PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin"
+PACKAGECONFIG[webdav-props] = "--with-webdav-props,--without-webdav-props,libxml2 sqlite3"
+PACKAGECONFIG[webdav-locks] = "--with-webdav-locks,--without-webdav-locks,util-linux"
+PACKAGECONFIG[gdbm] = "--with-gdbm,--without-gdbm,gdbm"
+PACKAGECONFIG[memcache] = "--with-memcached,--without-memcached,libmemcached"
+PACKAGECONFIG[lua] = "--with-lua,--without-lua,lua5.1"
+
+EXTRA_OECONF += "--enable-lfs"
+
+inherit autotools pkgconfig update-rc.d gettext systemd
+
+INITSCRIPT_NAME = "lighttpd"
+INITSCRIPT_PARAMS = "defaults 70"
+
+SYSTEMD_SERVICE_${PN} = "lighttpd.service"
+
+do_install_append() {
+	install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/lighttpd.d ${D}/www/pages/dav
+	install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d
+	install -m 0644 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir}
+	install -m 0644 ${WORKDIR}/index.html.lighttpd ${D}/www/pages/index.html
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/lighttpd.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' \
+		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
+		-e 's,@BASE_BINDIR@,${base_bindir},g' \
+		${D}${systemd_unitdir}/system/lighttpd.service
+	#For FHS compliance, create symbolic links to /var/log and /var/tmp for logs and temporary data
+	ln -sf ${localstatedir}/log ${D}/www/logs
+	ln -sf ${localstatedir}/tmp ${D}/www/var
+}
+
+FILES_${PN} += "${sysconfdir} /www"
+
+CONFFILES_${PN} = "${sysconfdir}/lighttpd.conf"
+
+PACKAGES_DYNAMIC += "^lighttpd-module-.*"
+
+python populate_packages_prepend () {
+    lighttpd_libdir = d.expand('${libdir}')
+    do_split_packages(d, lighttpd_libdir, '^mod_(.*)\.so$', 'lighttpd-module-%s', 'Lighttpd module for %s', extra_depends='')
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb
index 5bd3381..c938d9f 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb
@@ -28,10 +28,7 @@
 SRC_URI[md5sum] = "8572b7c2cf9ade09a8a8e10098500fb3"
 SRC_URI[sha256sum] = "5bf8e478c428e7744fefa465118f8296e7e771c981fb6dffb7527856a0ea3617"
 
-PACKAGECONFIG ?= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
-"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}"
 
 PACKAGECONFIG[acl] = ",,acl"
 PACKAGECONFIG[selinux] = ",,libselinux"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch
new file mode 100644
index 0000000..0175752
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch
@@ -0,0 +1,38 @@
+From cba901945c5a6da9586550498f8e3787c57c3098 Mon Sep 17 00:00:00 2001
+From: Athanasios Oikonomou <athoik@gmail.com>
+Date: Fri, 17 Feb 2017 21:04:04 +0200
+Subject: [PATCH] fix lsb_release to work with busybox head and find
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Athanasios Oikonomou <athoik@gmail.com>
+
+diff --git a/lsb_release b/lsb_release
+index e7d6024..233b8c1 100755
+--- a/lsb_release
++++ b/lsb_release
+@@ -209,7 +209,7 @@ EASE ($DISTRIB_CODENAME)"
+             || [ -n "$(echo $DISTRIB_DESCRIPTION |                            \
+                        sed -e "s/.*$DESCSTR_DELI.*//")" ]
+         then
+-            TMP_DISTRIB_DESC=$(head -1 $FILENAME 2>/dev/null)
++            TMP_DISTRIB_DESC=$(head -n 1 $FILENAME 2>/dev/null)
+             [ -z "$DISTRIB_DESCRIPTION" ]                                     \
+                 && DISTRIB_DESCRIPTION=$TMP_DISTRIB_DESC
+         else
+@@ -249,10 +249,10 @@ GetDistribInfo() {
+         then
+             CHECKFIRST=$(find $INFO_ROOT/ -maxdepth 1                         \
+                    -name \*$INFO_DISTRIB_SUFFIX                               \
+-                   -and ! -name $INFO_LSB_FILE                                \
+-                   -and -type f                                               \
++                   -type f                                                    \
+                    2>/dev/null                                                \
+-                   | head -1 ) # keep one of the files found (if many)
++                   | grep -v $INFO_LSB_FILE                                   \
++                   | head -n 1 ) # keep one of the files found (if many)
+         fi
+         InitDistribInfo $CHECKFIRST
+     fi
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb
index ece0eab..cedf39e 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb
@@ -15,6 +15,7 @@
 LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/lsb/lsb_release/1.4/lsb-release-1.4.tar.gz \
+           file://0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch \
            file://init-functions \
            file://lsb_killproc \
            file://lsb_log_message \
@@ -32,19 +33,18 @@
 
 CLEANBROKEN = "1"
 
-do_install(){
-	oe_runmake install prefix=${D}  mandir=${D}/${datadir}/man/ DESTDIR=${D}
+do_install() {
+	oe_runmake install prefix=${D}${base_prefix} mandir=${D}${datadir}/man/ DESTDIR=${D}
 
-	# this 2 dirs are needed by package lsb-dist-checker
+	# these two dirs are needed by package lsb-dist-checker
 	mkdir -p ${D}${sysconfdir}/opt
 	mkdir -p ${D}${localstatedir}/opt
 
-	mkdir -p ${D}${base_bindir}
-	mkdir -p ${D}/${baselib}
+	mkdir -p ${D}${base_libdir}
 	mkdir -p ${D}${sysconfdir}/lsb-release.d
 	printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
 
-	if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+	if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then
 		printf "core-4.1-ia32" >>  ${D}${sysconfdir}/lsb-release
 	else
 		printf "core-4.1-${TARGET_ARCH}" >>  ${D}${sysconfdir}/lsb-release
@@ -57,76 +57,76 @@
 	fi
 	echo "DISTRIB_DESCRIPTION=\"${DISTRO_NAME} ${DISTRO_VERSION}\"" >> ${D}${sysconfdir}/lsb-release
 
-	if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+	if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then
 		mkdir -p ${D}${sysconfdir}/lsb-release.d
 		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
 		touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-noarch
 		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ia32
 		touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ia32
-	elif [ "${TARGET_ARCH}" = "x86_64" ];then
+	elif [ "${TARGET_ARCH}" = "x86_64" ]; then
 		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
 		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-amd64
 		touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-amd64
 	fi
-	if [ "${TARGET_ARCH}" = "powerpc" ];then
+	if [ "${TARGET_ARCH}" = "powerpc" ]; then
 		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
 		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc32
 		touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc32
-	elif [ "${TARGET_ARCH}" = "powerpc64" ];then
+	elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
 		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
 		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc64
 		touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc64
 	fi
 }
 
-do_install_append(){
+do_install_append() {
        install -d ${D}${sysconfdir}/core-lsb
        for i in lsb_killproc lsb_log_message lsb_pidofproc lsb_start_daemon
        do
-           install -m 0755 ${WORKDIR}/${i} ${D}${sysconfdir}/core-lsb
+           install -m 0755 ${WORKDIR}/$i ${D}${sysconfdir}/core-lsb
        done
 
-       install -d ${D}/lib/lsb
-       install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
+       install -d ${D}${nonarch_base_libdir}/lsb
+       install -m 0755 ${WORKDIR}/init-functions ${D}${nonarch_base_libdir}/lsb
 
-       # creat links for LSB test
-       install -d ${D}/usr/lib/lsb
-       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
-       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
+       # create links for LSB test
+       if [ "${nonarch_base_libdir}" != "${nonarch_libdir}" ] ; then
+               install -d ${D}${nonarch_libdir}/lsb
+       fi
+       ln -sf ${sbindir}/chkconfig ${D}${nonarch_libdir}/lsb/install_initd
+       ln -sf ${sbindir}/chkconfig ${D}${nonarch_libdir}/lsb/remove_initd
 
-       if [ "${TARGET_ARCH}" = "x86_64" ];then
-	       cd ${D}
-               if [ "${baselib}" != "lib64" ]; then
-                   ln -sf ${baselib} lib64
+       if [ "${TARGET_ARCH}" = "x86_64" ]; then
+               if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then
+                   lnr ${D}${base_libdir} ${D}${base_prefix}/lib64
                fi
-	       cd ${D}/${baselib}
+	       cd ${D}${base_libdir}
                ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
                ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
        fi
-       if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
-	       cd ${D}/${baselib}
+       if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then
+	       cd ${D}${base_libdir}
                ln -sf ld-linux.so.2 ld-lsb.so.2
                ln -sf ld-linux.so.2 ld-lsb.so.3
        fi
 
-       if [ "${TARGET_ARCH}" = "powerpc64" ];then
-               cd ${D}
-               if [ "${baselib}" != "lib64" ]; then
-                   ln -sf ${baselib} lib64
+       if [ "${TARGET_ARCH}" = "powerpc64" ]; then
+               if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then
+                   lnr ${D}${base_libdir} ${D}${base_prefix}/lib64
                fi
-               cd ${D}/${baselib}
+               cd ${D}${base_libdir}
                ln -sf ld64.so.1 ld-lsb-ppc64.so.2
                ln -sf ld64.so.1 ld-lsb-ppc64.so.3
        fi
-       if [ "${TARGET_ARCH}" = "powerpc" ];then
-	       cd ${D}/${baselib}
+       if [ "${TARGET_ARCH}" = "powerpc" ]; then
+	       cd ${D}${base_libdir}
                ln -sf ld.so.1 ld-lsb-ppc32.so.2
                ln -sf ld.so.1 ld-lsb-ppc32.so.3
        fi
 }
-FILES_${PN} += "/lib64 \
+
+FILES_${PN} += "${@'${base_prefix}/lib64' if d.getVar('TARGET_ARCH') == ('x86_64' or 'powerpc64') and '${base_libdir}' != '${base_prefix}/lib64' else ''} \
                 ${base_libdir} \
-                /usr/lib/lsb \
-                ${base_libdir}/lsb/* \
-                /lib/lsb/* \
-               "
+                ${nonarch_libdir}/lsb \
+                ${nonarch_base_libdir}/lsb/* \
+                "
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
index c31a3eb..0eb2793 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
@@ -252,8 +252,8 @@
 
 PLATFORM_FILE="/etc/rpm/platform"
 
-RPM_INSTALL_CMD="rpm --quiet --nodeps --replacepkgs --nosignature -i"
-RPM_INSTALL_CMD_NOSCRIPTS="rpm --quiet --nodeps --replacepkgs --noscripts --nosignature -i"
+RPM_INSTALL_CMD="rpm --quiet --nodeps --replacepkgs --nosignature -i --ignoreos"
+RPM_INSTALL_CMD_NOSCRIPTS="rpm --quiet --nodeps --replacepkgs --noscripts --nosignature -i --ignoreos"
 
 # If the lsb has been started, stop it first.
 if [ -x ${LSB_STOP_CMD} ]
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch
new file mode 100644
index 0000000..7ec66f8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch
@@ -0,0 +1,39 @@
+From ae10245c15a617bd57337981bb42eb36629f9b59 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 8 Feb 2017 15:53:31 +0800
+Subject: [PATCH 01/26] add _GNU_SOURCE to pec_listener.c
+
+In previous patch 0007-replace-SIGCLD-with-SIGCHLD.patch made by Khem Raj
+contains two aspects:
+
+	1. replace SIGCLD with SIGCHLD
+	2. add _GNU_SOURCE to pec_listener.c
+
+The replace SIGCLD with SIGCHLD have been integrated upstream, so make a
+another patch to add _GNU_SOURCE to pec_listener.c comply with Khem Raj's
+previous patch.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+Upstream-Status: Pending
+
+%% original patch: 0001-add-_GNU_SOURCE-to-pec_listener.c.patch
+---
+ testcases/kernel/connectors/pec/pec_listener.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c
+index d11e4dc..b8b5e0d 100644
+--- a/testcases/kernel/connectors/pec/pec_listener.c
++++ b/testcases/kernel/connectors/pec/pec_listener.c
+@@ -20,6 +20,7 @@
+ /*                                                                            */
+ /******************************************************************************/
+ 
++#define _GNU_SOURCE
+ #include <sys/socket.h>
+ #include <sys/poll.h>
+ #include <sys/types.h>
+-- 
+2.8.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch
deleted file mode 100644
index 585b7cb..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 14985fccf7428eaa0b45decc22bfd20fd780f621 Mon Sep 17 00:00:00 2001
-From: Chong Lu <Chong.Lu@windriver.com>
-Date: Tue, 11 Mar 2014 14:47:22 +0800
-Subject: [PATCH 01/32] ltp: Don't link against libfl
-
-We have already defined yywrap function in scan.l file. After this, we no longer need to
-link against libfl and so no longer get errors about undefined references to yylex.
-
-Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- pan/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pan/Makefile b/pan/Makefile
-index 4cc6466..a4b575b 100644
---- a/pan/Makefile
-+++ b/pan/Makefile
-@@ -31,7 +31,7 @@ CPPFLAGS		+= -Wno-error
- 
- CPPFLAGS		+= -I$(abs_srcdir)
- 
--LDLIBS			+= -lm $(LEXLIB)
-+LDLIBS			+= -lm
- 
- LFLAGS			+= -l
- 
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch
new file mode 100644
index 0000000..8874b95
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch
@@ -0,0 +1,30 @@
+From 32644bde4d33b677614534ec37030e57883b8e15 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 9 Feb 2017 16:41:12 +0800
+Subject: [PATCH 1/3] fix PATH_MAX undeclared when building with musl
+
+fix PATH_MAX undeclared when building with musl.
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+Upstream-Status: Pending
+---
+ include/tst_test.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/tst_test.h b/include/tst_test.h
+index 7ff33b2..9779c0e 100644
+--- a/include/tst_test.h
++++ b/include/tst_test.h
+@@ -19,6 +19,9 @@
+ #define TST_TEST_H__
+ 
+ #include <unistd.h>
++#ifndef __GLIBC__
++#include <limits.h>
++#endif
+ 
+ #include "tst_common.h"
+ #include "tst_res_flags.h"
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch
deleted file mode 100644
index 56a48ab..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From fb8b895385a641d74f2186fe5f20a872209692ed Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 7 Jan 2016 18:24:20 +0000
-Subject: [PATCH 06/32] sendfile: Use off64_t instead of __off64_t
-
-__off64_t is specific to glibc where as off64_t is widely available
-Add _GNU_SOURCE for off64_t defines from sys/types.h
-Fixes
-<command-line>:0:7: error: unknown type name 'off64_t'
-sendfile02.c:97:18: note: in expansion of macro 'OFF_T'
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/syscalls/sendfile/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/testcases/kernel/syscalls/sendfile/Makefile b/testcases/kernel/syscalls/sendfile/Makefile
-index df7b63f..1bd1b57 100644
---- a/testcases/kernel/syscalls/sendfile/Makefile
-+++ b/testcases/kernel/syscalls/sendfile/Makefile
-@@ -21,6 +21,6 @@ top_srcdir		?= ../../../..
- include $(top_srcdir)/include/mk/testcases.mk
- include $(abs_srcdir)/../utils/newer_64.mk
- 
--%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t
-+%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=off64_t -D_GNU_SOURCE
- 
- include $(top_srcdir)/include/mk/generic_leaf_target.mk
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch
new file mode 100644
index 0000000..8d0e739
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch
@@ -0,0 +1,30 @@
+From a2639bd0f0d3f9f3049ee33e6710fed06225f54f Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 9 Feb 2017 18:20:58 +0800
+Subject: [PATCH 1/2] fix __WORDSIZE undeclared when building with musl
+
+fix __WORDSIZE undeclared when building with musl.
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+Upstream-Status: Pending
+---
+ include/old/test.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/old/test.h b/include/old/test.h
+index d492560..263e92e 100644
+--- a/include/old/test.h
++++ b/include/old/test.h
+@@ -58,6 +58,9 @@
+ #include "tst_clone.h"
+ #include "old_device.h"
+ #include "old_tmpdir.h"
++#ifndef __GLIBC__
++#include <bits/reg.h>
++#endif
+ 
+ /*
+  * Ensure that NUMSIGS is defined.
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch
deleted file mode 100644
index 4be906e..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch
+++ /dev/null
@@ -1,394 +0,0 @@
-From 405c03171e4bf0edd698cb602cf7bd7fe1d0401a Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 7 Jan 2016 19:33:53 +0000
-Subject: [PATCH 07/32] replace SIGCLD with SIGCHLD
-
-its defined to use SIGCHLD anyway in
-
-bits/signum.h:#define     SIGCLD          SIGCHLD /* Same as SIGCHLD
-(System V).  */
-
-plus it helps these tests compile with musl which adheres to posix
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- lib/tst_sig.c                                   |  8 ++++----
- testcases/kernel/connectors/pec/pec_listener.c  |  1 +
- testcases/kernel/fs/doio/doio.c                 |  4 ++--
- testcases/kernel/fs/doio/growfiles.c            |  2 +-
- testcases/kernel/syscalls/fcntl/fcntl11.c       |  8 ++++----
- testcases/kernel/syscalls/fcntl/fcntl17.c       |  8 ++++----
- testcases/kernel/syscalls/fcntl/fcntl19.c       |  8 ++++----
- testcases/kernel/syscalls/fcntl/fcntl20.c       |  8 ++++----
- testcases/kernel/syscalls/fcntl/fcntl21.c       |  8 ++++----
- testcases/kernel/syscalls/kill/kill02.c         |  6 +++---
- testcases/kernel/syscalls/kill/kill12.c         |  8 ++++----
- testcases/kernel/syscalls/mkdir/mkdir09.c       | 12 ++++++------
- testcases/kernel/syscalls/sighold/sighold02.c   |  2 +-
- testcases/network/tcp_cmds/perf_lan/pingpong.c  |  2 +-
- testcases/network/tcp_cmds/perf_lan/pingpong6.c |  2 +-
- 15 files changed, 44 insertions(+), 43 deletions(-)
-
-diff --git a/lib/tst_sig.c b/lib/tst_sig.c
-index 3af5ffd..36565e1 100644
---- a/lib/tst_sig.c
-+++ b/lib/tst_sig.c
-@@ -49,7 +49,7 @@
- 		fork_flag - set to FORK or NOFORK depending upon whether the
- 			calling program executes a fork() system call.  It
- 			is normally the case that the calling program treats
--			SIGCLD as an expected signal if fork() is being used.
-+			SIGCHLD as an expected signal if fork() is being used.
- 
- 		handler - a pointer to the unexpected signal handler to
- 			be executed after an unexpected signal has been
-@@ -82,7 +82,7 @@ static void (*tst_setup_signal(int, void (*)(int))) (int);
- 
- /****************************************************************************
-  * tst_sig() : set-up to catch unexpected signals.  fork_flag is set to NOFORK
-- *    if SIGCLD is to be an "unexpected signal", otherwise it is set to
-+ *    if SIGCHLD is to be an "unexpected signal", otherwise it is set to
-  *    FORK.  cleanup points to a cleanup routine to be executed before
-  *    tst_exit is called (cleanup is set to NULL if no cleanup is desired).
-  *    handler is a pointer to the signal handling routine (if handler is
-@@ -117,7 +117,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ())
- 	for (sig = 1; sig < NSIG; sig++) {
- 		/*
- 		 * SIGKILL is never unexpected.
--		 * SIGCLD is only unexpected when
-+		 * SIGCHLD is only unexpected when
- 		 *    no forking is being done.
- 		 * SIGINFO is used for file quotas and should be expected
- 		 */
-@@ -205,7 +205,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ())
- #endif
- 			break;
- 
--		case SIGCLD:
-+		case SIGCHLD:
- 			if (fork_flag == FORK)
- 				continue;
- 
-diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c
-index a1beb13..002750a 100644
---- a/testcases/kernel/connectors/pec/pec_listener.c
-+++ b/testcases/kernel/connectors/pec/pec_listener.c
-@@ -20,6 +20,7 @@
- /*                                                                            */
- /******************************************************************************/
- 
-+#define _GNU_SOURCE
- #include <sys/socket.h>
- #include <sys/poll.h>
- #include <sys/types.h>
-diff --git a/testcases/kernel/fs/doio/doio.c b/testcases/kernel/fs/doio/doio.c
-index 4b0dec5..5f65ef9 100644
---- a/testcases/kernel/fs/doio/doio.c
-+++ b/testcases/kernel/fs/doio/doio.c
-@@ -573,7 +573,7 @@ int main(int argc, char **argv)
- 		case SIGTSTP:
- 		case SIGSTOP:
- 		case SIGCONT:
--		case SIGCLD:
-+		case SIGCHLD:
- 		case SIGBUS:
- 		case SIGSEGV:
- 		case SIGQUIT:
-@@ -615,7 +615,7 @@ int main(int argc, char **argv)
- 	}
- 
- 	sigemptyset(&block_mask);
--	sigaddset(&block_mask, SIGCLD);
-+	sigaddset(&block_mask, SIGCHLD);
- 	sigprocmask(SIG_BLOCK, &block_mask, &omask);
- 
- 	/*
-diff --git a/testcases/kernel/fs/doio/growfiles.c b/testcases/kernel/fs/doio/growfiles.c
-index 09e7f35..bbad230 100644
---- a/testcases/kernel/fs/doio/growfiles.c
-+++ b/testcases/kernel/fs/doio/growfiles.c
-@@ -1640,7 +1640,7 @@ int set_sig(void)
- #ifdef SIGRESTART
- 		case SIGRESTART:
- #endif /* SIGRESTART */
--		case SIGCLD:
-+		case SIGCHLD:
- 			break;
- 
- 		default:
-diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c
-index fa6ce53..2de2b6c 100644
---- a/testcases/kernel/syscalls/fcntl/fcntl11.c
-+++ b/testcases/kernel/syscalls/fcntl/fcntl11.c
-@@ -105,10 +105,10 @@ void setup(void)
- 	memset(&act, 0, sizeof(act));
- 	act.sa_handler = catch_child;
- 	sigemptyset(&act.sa_mask);
--	sigaddset(&act.sa_mask, SIGCLD);
--	if ((sigaction(SIGCLD, &act, NULL)) < 0)
-+	sigaddset(&act.sa_mask, SIGCHLD);
-+	if ((sigaction(SIGCHLD, &act, NULL)) < 0)
- 		tst_brkm(TBROK | TERRNO, cleanup,
--			 "sigaction(SIGCLD, ..) failed");
-+			 "sigaction(SIGCHLD, ..) failed");
- }
- 
- void do_child(void)
-@@ -227,7 +227,7 @@ void stop_child(void)
- {
- 	struct flock fl;
- 
--	signal(SIGCLD, SIG_DFL);
-+	signal(SIGCHLD, SIG_DFL);
- 	fl.l_type = STOP;
- 	parent_put(&fl);
- 	wait(0);
-diff --git a/testcases/kernel/syscalls/fcntl/fcntl17.c b/testcases/kernel/syscalls/fcntl/fcntl17.c
-index 5b03e39..6598b20 100644
---- a/testcases/kernel/syscalls/fcntl/fcntl17.c
-+++ b/testcases/kernel/syscalls/fcntl/fcntl17.c
-@@ -150,9 +150,9 @@ int setup(void)
- 	memset(&act, 0, sizeof(act));
- 	act.sa_handler = catch_child;
- 	sigemptyset(&act.sa_mask);
--	sigaddset(&act.sa_mask, SIGCLD);
--	if (sigaction(SIGCLD, &act, NULL) < 0) {
--		tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
-+	sigaddset(&act.sa_mask, SIGCHLD);
-+	if (sigaction(SIGCHLD, &act, NULL) < 0) {
-+		tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
- 		return 1;
- 	}
- 	return 0;
-@@ -381,7 +381,7 @@ void stop_children(void)
- {
- 	int arg;
- 
--	signal(SIGCLD, SIG_DFL);
-+	signal(SIGCHLD, SIG_DFL);
- 	arg = STOP;
- 	child_free(child_pipe1[1], arg);
- 	child_free(child_pipe2[1], arg);
-diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c
-index a542cfc..88c91d6 100644
---- a/testcases/kernel/syscalls/fcntl/fcntl19.c
-+++ b/testcases/kernel/syscalls/fcntl/fcntl19.c
-@@ -112,9 +112,9 @@ void setup(void)
- 	memset(&act, 0, sizeof(act));
- 	act.sa_handler = catch_child;
- 	sigemptyset(&act.sa_mask);
--	sigaddset(&act.sa_mask, SIGCLD);
--	if ((sigaction(SIGCLD, &act, NULL)) < 0) {
--		tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
-+	sigaddset(&act.sa_mask, SIGCHLD);
-+	if ((sigaction(SIGCHLD, &act, NULL)) < 0) {
-+		tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
- 		fail = 1;
- 	}
- }
-@@ -265,7 +265,7 @@ void stop_child(void)
- {
- 	struct flock fl;
- 
--	signal(SIGCLD, SIG_DFL);
-+	signal(SIGCHLD, SIG_DFL);
- 	fl.l_type = STOP;
- 	parent_put(&fl);
- 	wait(0);
-diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c
-index aa06bab..99fd783 100644
---- a/testcases/kernel/syscalls/fcntl/fcntl20.c
-+++ b/testcases/kernel/syscalls/fcntl/fcntl20.c
-@@ -109,9 +109,9 @@ void setup(void)
- 	memset(&act, 0, sizeof(act));
- 	act.sa_handler = catch_child;
- 	sigemptyset(&act.sa_mask);
--	sigaddset(&act.sa_mask, SIGCLD);
--	if (sigaction(SIGCLD, &act, NULL) == -1)
--		tst_brkm(TFAIL | TERRNO, cleanup, "SIGCLD signal setup failed");
-+	sigaddset(&act.sa_mask, SIGCHLD);
-+	if (sigaction(SIGCHLD, &act, NULL) == -1)
-+		tst_brkm(TFAIL | TERRNO, cleanup, "SIGCHLD signal setup failed");
- }
- 
- void cleanup(void)
-@@ -264,7 +264,7 @@ void stop_child(void)
- {
- 	struct flock fl;
- 
--	signal(SIGCLD, SIG_DFL);
-+	signal(SIGCHLD, SIG_DFL);
- 	fl.l_type = STOP;
- 	parent_put(&fl);
- 	wait(0);
-diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c
-index 5307021..8f1a67c 100644
---- a/testcases/kernel/syscalls/fcntl/fcntl21.c
-+++ b/testcases/kernel/syscalls/fcntl/fcntl21.c
-@@ -110,9 +110,9 @@ void setup(void)
- 	memset(&act, 0, sizeof(act));
- 	act.sa_handler = catch_child;
- 	sigemptyset(&act.sa_mask);
--	sigaddset(&act.sa_mask, SIGCLD);
--	if ((sigaction(SIGCLD, &act, NULL)) < 0) {
--		tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
-+	sigaddset(&act.sa_mask, SIGCHLD);
-+	if ((sigaction(SIGCHLD, &act, NULL)) < 0) {
-+		tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
- 		fail = 1;
- 	}
- }
-@@ -272,7 +272,7 @@ void stop_child(void)
- {
- 	struct flock fl;
- 
--	signal(SIGCLD, SIG_DFL);
-+	signal(SIGCHLD, SIG_DFL);
- 	fl.l_type = STOP;
- 	parent_put(&fl);
- 	wait(0);
-diff --git a/testcases/kernel/syscalls/kill/kill02.c b/testcases/kernel/syscalls/kill/kill02.c
-index 9d6cc68..08360dd 100644
---- a/testcases/kernel/syscalls/kill/kill02.c
-+++ b/testcases/kernel/syscalls/kill/kill02.c
-@@ -701,7 +701,7 @@ void setup(void)
- 
- 	/*
- 	 *  Set to catch unexpected signals.
--	 *  SIGCLD is set to be ignored because we do not wait for termination status.
-+	 *  SIGCHLD is set to be ignored because we do not wait for termination status.
- 	 *  SIGUSR1 is set to be ignored because this is the signal we are using for
- 	 *  the test and we are not concerned with the parent getting it.
- 	 */
-@@ -713,9 +713,9 @@ void setup(void)
- 			 "signal(SIGUSR1, SIG_IGN) failed");
- 	}
- 
--	if (signal(SIGCLD, SIG_IGN) == SIG_ERR) {
-+	if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) {
- 		tst_brkm(TBROK | TERRNO, NULL,
--			 "signal(SIGCLD, SIG_IGN) failed");
-+			 "signal(SIGCHLD, SIG_IGN) failed");
- 	}
- 
- 	TEST_PAUSE;
-diff --git a/testcases/kernel/syscalls/kill/kill12.c b/testcases/kernel/syscalls/kill/kill12.c
-index 7a47a4a..d7c4147 100644
---- a/testcases/kernel/syscalls/kill/kill12.c
-+++ b/testcases/kernel/syscalls/kill/kill12.c
-@@ -98,7 +98,7 @@ int main(int argc, char **argv)
- 
- 	exno = 1;
- 
--	if (sigset(SIGCLD, chsig) == SIG_ERR) {
-+	if (sigset(SIGCHLD, chsig) == SIG_ERR) {
- 		fprintf(temp, "\tsigset failed, errno = %d\n", errno);
- 		fail_exit();
- 	}
-@@ -128,7 +128,7 @@ int main(int argc, char **argv)
- 				sleep(1);
- 
- 			kill(pid, sig);	/* child should ignroe this sig */
--			kill(pid, SIGCLD);	/* child should exit */
-+			kill(pid, SIGCHLD);	/* child should exit */
- 
- #ifdef BCS
- 			while ((npid = wait(&status)) != pid
-@@ -222,14 +222,14 @@ void do_child(void)
- 	int exno = 1;
- 
- #ifdef UCLINUX
--	if (sigset(SIGCLD, chsig) == SIG_ERR) {
-+	if (sigset(SIGCHLD, chsig) == SIG_ERR) {
- 		fprintf(temp, "\tsigset failed, errno = %d\n", errno);
- 		fail_exit();
- 	}
- #endif
- 
- 	sigset(sig, SIG_IGN);	/* set to ignore signal */
--	kill(getppid(), SIGCLD);	/* tell parent we are ready */
-+	kill(getppid(), SIGCHLD);	/* tell parent we are ready */
- 	while (!chflag)
- 		sleep(1);	/* wait for parent */
- 
-diff --git a/testcases/kernel/syscalls/mkdir/mkdir09.c b/testcases/kernel/syscalls/mkdir/mkdir09.c
-index 41c20e9..07b4fb8 100644
---- a/testcases/kernel/syscalls/mkdir/mkdir09.c
-+++ b/testcases/kernel/syscalls/mkdir/mkdir09.c
-@@ -122,10 +122,10 @@ int main(int argc, char *argv[])
- 
- 	}
- 
--	/* Set up to catch SIGCLD signal */
--	if (signal(SIGCLD, chld) == SIG_ERR) {
-+	/* Set up to catch SIGCHLD signal */
-+	if (signal(SIGCHLD, chld) == SIG_ERR) {
- 		tst_brkm(TFAIL, cleanup,
--			 "Error setting up SIGCLD signal, ERRNO = %d", errno);
-+			 "Error setting up SIGCHLD signal, ERRNO = %d", errno);
- 
- 	}
- 
-@@ -236,9 +236,9 @@ int runtest(void)
- 		tst_brkm(TFAIL, cleanup,
- 			 "Error resetting SIGTERM signal, ERRNO = %d", errno);
- 	}
--	if (signal(SIGCLD, SIG_DFL) == SIG_ERR) {
-+	if (signal(SIGCHLD, SIG_DFL) == SIG_ERR) {
- 		tst_brkm(TFAIL, cleanup,
--			 "Error resetting SIGCLD signal, ERRNO = %d", errno);
-+			 "Error resetting SIGCHLD signal, ERRNO = %d", errno);
- 	}
- 
- 	if (test_time) {
-@@ -372,7 +372,7 @@ void term(int sig)
- 
- void chld(int sig)
- {
--	/* Routine to handle SIGCLD signal. */
-+	/* Routine to handle SIGCHLD signal. */
- 
- 	sigchld++;
- 	if (jump) {
-diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
-index e3076fb..be01874 100644
---- a/testcases/kernel/syscalls/sighold/sighold02.c
-+++ b/testcases/kernel/syscalls/sighold/sighold02.c
-@@ -77,7 +77,7 @@ static int sigs_map[NUMSIGS];
- static int skip_sig(int sig)
- {
- 	switch (sig) {
--	case SIGCLD:
-+	case SIGCHLD:
- 	case SIGKILL:
- 	case SIGALRM:
- 	case SIGSTOP:
-diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong.c b/testcases/network/tcp_cmds/perf_lan/pingpong.c
-index 1196312..5b06798 100644
---- a/testcases/network/tcp_cmds/perf_lan/pingpong.c
-+++ b/testcases/network/tcp_cmds/perf_lan/pingpong.c
-@@ -182,7 +182,7 @@ int main(int argc, char *argv[])
- 
- 	/* Setup traps */
- 	signal(SIGINT, finish);
--	signal(SIGCLD, finish);
-+	signal(SIGCHLD, finish);
- 
- 	/* Fork a child process to continue sending packets */
- 	tst_resm(TINFO, "Create a child process to continue to send packets");
-diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong6.c b/testcases/network/tcp_cmds/perf_lan/pingpong6.c
-index 9747f58..0a0fb1d 100644
---- a/testcases/network/tcp_cmds/perf_lan/pingpong6.c
-+++ b/testcases/network/tcp_cmds/perf_lan/pingpong6.c
-@@ -153,7 +153,7 @@ char *argv[];
- 
- 	/* Setup traps */
- 	signal(SIGINT, finish);
--	signal(SIGCLD, finish);
-+	signal(SIGCHLD, finish);
- 
- 	/* Fork a child process to continue sending packets */
- 	printf("Create a child process to continue to send packets \n");
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
index d123074..41f2623 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
@@ -88,22 +88,19 @@
  
  void cleanup(void);
  void setup(void);
-@@ -164,9 +172,14 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id,
+@@ -164,7 +172,11 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id,
  {
  #if defined(__i386__)
  	return syscall(318, cpu_id, node_id, cache_struct);
 -#elif __GLIBC_PREREQ(2,6)
-+#if defined(__GLIBC__)
++#elif defined(__GLIBC__)
 +#if __GLIBC_PREREQ(2,6)
 +	*cpu_id = sched_getcpu();
 +#endif
 +#else
  	*cpu_id = sched_getcpu();
  #endif
-+#endif
  	return 0;
- }
- 
 @@ -191,15 +204,20 @@ unsigned int set_cpu_affinity(void)
  	cpu_set_t *set;
  	size_t size;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch
deleted file mode 100644
index e58e5a9..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch
+++ /dev/null
@@ -1,270 +0,0 @@
-From 4ba19d64e95a874995d0b554b891b5ec35bd9495 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 7 Jan 2016 19:45:35 +0000
-Subject: [PATCH 09/32] Guard error.h with __GLIBC__
-
-error API is specific to glibc so use the guard to make it conditional
-on glibc
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/syscalls/faccessat/faccessat01.c   | 2 ++
- testcases/kernel/syscalls/fallocate/fallocate01.c   | 2 ++
- testcases/kernel/syscalls/fchmodat/fchmodat01.c     | 2 ++
- testcases/kernel/syscalls/fchownat/fchownat01.c     | 2 ++
- testcases/kernel/syscalls/fchownat/fchownat02.c     | 2 ++
- testcases/kernel/syscalls/fstatat/fstatat01.c       | 2 ++
- testcases/kernel/syscalls/futimesat/futimesat01.c   | 2 ++
- testcases/kernel/syscalls/linkat/linkat01.c         | 2 ++
- testcases/kernel/syscalls/linkat/linkat02.c         | 2 ++
- testcases/kernel/syscalls/mkdirat/mkdirat01.c       | 2 ++
- testcases/kernel/syscalls/mknodat/mknodat01.c       | 2 ++
- testcases/kernel/syscalls/mknodat/mknodat02.c       | 2 ++
- testcases/kernel/syscalls/openat/openat01.c         | 2 ++
- testcases/kernel/syscalls/readlinkat/readlinkat01.c | 2 ++
- testcases/kernel/syscalls/renameat/renameat01.c     | 2 ++
- testcases/kernel/syscalls/symlinkat/symlinkat01.c   | 2 ++
- testcases/kernel/syscalls/unlinkat/unlinkat01.c     | 2 ++
- 17 files changed, 34 insertions(+)
-
-diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
-index 7f0e87a..c72dcf0 100644
---- a/testcases/kernel/syscalls/faccessat/faccessat01.c
-+++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
-@@ -37,7 +37,9 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <unistd.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/fallocate/fallocate01.c b/testcases/kernel/syscalls/fallocate/fallocate01.c
-index e72b123..643c0e2 100644
---- a/testcases/kernel/syscalls/fallocate/fallocate01.c
-+++ b/testcases/kernel/syscalls/fallocate/fallocate01.c
-@@ -96,7 +96,9 @@
- #include <fcntl.h>
- #include <sys/syscall.h>
- #include <unistd.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <inttypes.h>
- #include <sys/utsname.h>
- 
-diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
-index 19e9ad5..ae6d807 100644
---- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
-+++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
-@@ -37,7 +37,9 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <unistd.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/fchownat/fchownat01.c b/testcases/kernel/syscalls/fchownat/fchownat01.c
-index b361253..a5218af 100644
---- a/testcases/kernel/syscalls/fchownat/fchownat01.c
-+++ b/testcases/kernel/syscalls/fchownat/fchownat01.c
-@@ -28,7 +28,9 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <unistd.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/fchownat/fchownat02.c b/testcases/kernel/syscalls/fchownat/fchownat02.c
-index 6b0304c..8d2863f 100644
---- a/testcases/kernel/syscalls/fchownat/fchownat02.c
-+++ b/testcases/kernel/syscalls/fchownat/fchownat02.c
-@@ -26,7 +26,9 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <unistd.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/fstatat/fstatat01.c b/testcases/kernel/syscalls/fstatat/fstatat01.c
-index 61531c6..e99fbd2 100644
---- a/testcases/kernel/syscalls/fstatat/fstatat01.c
-+++ b/testcases/kernel/syscalls/fstatat/fstatat01.c
-@@ -48,7 +48,9 @@
- #include <sys/stat.h>
- #include <sys/time.h>
- #include <fcntl.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/futimesat/futimesat01.c b/testcases/kernel/syscalls/futimesat/futimesat01.c
-index ae8d4fe..316dd78 100644
---- a/testcases/kernel/syscalls/futimesat/futimesat01.c
-+++ b/testcases/kernel/syscalls/futimesat/futimesat01.c
-@@ -37,7 +37,9 @@
- #include <sys/stat.h>
- #include <sys/time.h>
- #include <fcntl.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c
-index fc0687b..83cbfe7 100644
---- a/testcases/kernel/syscalls/linkat/linkat01.c
-+++ b/testcases/kernel/syscalls/linkat/linkat01.c
-@@ -49,7 +49,9 @@
- #include <sys/time.h>
- #include <fcntl.h>
- #include <unistd.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/linkat/linkat02.c b/testcases/kernel/syscalls/linkat/linkat02.c
-index e9a752a..8d7e431 100644
---- a/testcases/kernel/syscalls/linkat/linkat02.c
-+++ b/testcases/kernel/syscalls/linkat/linkat02.c
-@@ -23,7 +23,9 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <unistd.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat01.c b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
-index 7e15947..1dbc038 100644
---- a/testcases/kernel/syscalls/mkdirat/mkdirat01.c
-+++ b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
-@@ -30,7 +30,9 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/mknodat/mknodat01.c b/testcases/kernel/syscalls/mknodat/mknodat01.c
-index 26e5538..f034f05 100644
---- a/testcases/kernel/syscalls/mknodat/mknodat01.c
-+++ b/testcases/kernel/syscalls/mknodat/mknodat01.c
-@@ -29,7 +29,9 @@
- #include <sys/types.h>
- #include <fcntl.h>
- #include <sys/stat.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/mknodat/mknodat02.c b/testcases/kernel/syscalls/mknodat/mknodat02.c
-index f6368fa..7d0f7c0 100644
---- a/testcases/kernel/syscalls/mknodat/mknodat02.c
-+++ b/testcases/kernel/syscalls/mknodat/mknodat02.c
-@@ -29,7 +29,9 @@
- #include <sys/types.h>
- #include <fcntl.h>
- #include <sys/stat.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/openat/openat01.c b/testcases/kernel/syscalls/openat/openat01.c
-index 85f9a91..4ee0117 100644
---- a/testcases/kernel/syscalls/openat/openat01.c
-+++ b/testcases/kernel/syscalls/openat/openat01.c
-@@ -29,7 +29,9 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/readlinkat/readlinkat01.c b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
-index 97a49e8..b162853 100644
---- a/testcases/kernel/syscalls/readlinkat/readlinkat01.c
-+++ b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
-@@ -29,7 +29,9 @@
- #include <sys/stat.h>
- #include <sys/time.h>
- #include <fcntl.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/renameat/renameat01.c b/testcases/kernel/syscalls/renameat/renameat01.c
-index f4cd51b..105a05b 100644
---- a/testcases/kernel/syscalls/renameat/renameat01.c
-+++ b/testcases/kernel/syscalls/renameat/renameat01.c
-@@ -42,7 +42,9 @@
- #include <sys/stat.h>
- #include <sys/time.h>
- #include <fcntl.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/symlinkat/symlinkat01.c b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
-index 5c238d8..cb7a7e8 100644
---- a/testcases/kernel/syscalls/symlinkat/symlinkat01.c
-+++ b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
-@@ -37,7 +37,9 @@
- #include <sys/stat.h>
- #include <sys/time.h>
- #include <fcntl.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-diff --git a/testcases/kernel/syscalls/unlinkat/unlinkat01.c b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
-index 31fe4e7..26f6d9a 100644
---- a/testcases/kernel/syscalls/unlinkat/unlinkat01.c
-+++ b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
-@@ -37,7 +37,9 @@
- #include <sys/stat.h>
- #include <sys/time.h>
- #include <fcntl.h>
-+#ifdef __GLIBC__
- #include <error.h>
-+#endif
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch
new file mode 100644
index 0000000..6886c55
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch
@@ -0,0 +1,35 @@
+From 2d7ea67e8eaa41cbd6816f7ab654254b40b530a1 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 9 Feb 2017 17:17:37 +0800
+Subject: [PATCH] fix redefinition of 'struct msgbuf' error building with musl
+
+When building with musl the file "sys/msg.h" already contain 'struct msgbuf'
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+Upstream-Status: Pending
+---
+ testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
+index a757c0d..e023114 100644
+--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
++++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
+@@ -47,11 +47,13 @@ const char *TCID = "msgrcv08";
+ const int TST_TOTAL = 1;
+ 
+ #if __WORDSIZE == 32
+-
++#ifdef __GLIBC__
+ struct msgbuf {
+ 	long mtype;     /* message type, must be > 0 */
+ 	char mtext[16]; /* message data */
+ };
++#else
++#endif
+ 
+ static void msr(int msqid)
+ {
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
index 945280c..4ac14dc 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
@@ -1,11 +1,12 @@
-From aff0e2a8f011fa80b472355355a7e8cdacd50189 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 7 Jan 2016 19:53:30 +0000
-Subject: [PATCH 11/32] Rename sigset variable to sigset1
+From dc1905b6d972f9176b40da270c83d8fb4d1751b5 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 8 Feb 2017 16:12:34 +0800
+Subject: [PATCH 2/5] Rename sigset variable to sigset1
 
 sigset API from signal.h is shadowed by this name conflict
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
 ---
  testcases/kernel/mem/shmt/shmt04.c                    | 10 +++++-----
  testcases/kernel/mem/shmt/shmt06.c                    | 10 +++++-----
@@ -13,15 +14,15 @@
  3 files changed, 15 insertions(+), 15 deletions(-)
 
 diff --git a/testcases/kernel/mem/shmt/shmt04.c b/testcases/kernel/mem/shmt/shmt04.c
-index 7203e9e..fce87d6 100644
+index b2682da..3f35fad 100644
 --- a/testcases/kernel/mem/shmt/shmt04.c
 +++ b/testcases/kernel/mem/shmt/shmt04.c
 @@ -56,7 +56,7 @@ int TST_TOTAL = 2;		/* Total number of test cases. */
  /**************/
  
  key_t key;
--sigset_t sigset;
-+sigset_t sigset1;
+-sigset_t set;
++sigset_t set1;
  
  #define  SIZE  16*1024
  
@@ -29,12 +30,12 @@
  
  	key = (key_t) getpid();
  
--	sigemptyset(&sigset);
--	sigaddset(&sigset, SIGUSR1);
--	sigprocmask(SIG_BLOCK, &sigset, NULL);
-+	sigemptyset(&sigset1);
-+	sigaddset(&sigset1, SIGUSR1);
-+	sigprocmask(SIG_BLOCK, &sigset1, NULL);
+-	sigemptyset(&set);
+-	sigaddset(&set, SIGUSR1);
+-	sigprocmask(SIG_BLOCK, &set, NULL);
++	sigemptyset(&set1);
++	sigaddset(&set1, SIGUSR1);
++	sigprocmask(SIG_BLOCK, &set1, NULL);
  
  	pid = fork();
  	switch (pid) {
@@ -42,21 +43,21 @@
  	char *cp;
  	int sig;
  
--	sigwait(&sigset, &sig);
-+	sigwait(&sigset1, &sig);
+-	sigwait(&set, &sig);
++	sigwait(&set1, &sig);
  	chld_pid = getpid();
  /*--------------------------------------------------------*/
  
 diff --git a/testcases/kernel/mem/shmt/shmt06.c b/testcases/kernel/mem/shmt/shmt06.c
-index a3c9ca3..77b0fc9 100644
+index dd69de7..56fb1da 100644
 --- a/testcases/kernel/mem/shmt/shmt06.c
 +++ b/testcases/kernel/mem/shmt/shmt06.c
 @@ -57,7 +57,7 @@ int TST_TOTAL = 2;		/* Total number of test cases. */
  /**************/
  
  key_t key;
--sigset_t sigset;
-+sigset_t sigset1;
+-sigset_t set;
++sigset_t set1;
  
  int child();
  static int rm_shm(int);
@@ -64,12 +65,12 @@
  
  	key = (key_t) getpid();
  
--	sigemptyset(&sigset);
--	sigaddset(&sigset, SIGUSR1);
--	sigprocmask(SIG_BLOCK, &sigset, NULL);
-+	sigemptyset(&sigset1);
-+	sigaddset(&sigset1, SIGUSR1);
-+	sigprocmask(SIG_BLOCK, &sigset1, NULL);
+-	sigemptyset(&set);
+-	sigaddset(&set, SIGUSR1);
+-	sigprocmask(SIG_BLOCK, &set, NULL);
++	sigemptyset(&set1);
++	sigaddset(&set1, SIGUSR1);
++	sigprocmask(SIG_BLOCK, &set1, NULL);
  
  	pid = fork();
  	switch (pid) {
@@ -77,21 +78,21 @@
  	char *cp;
  	int sig;
  
--	sigwait(&sigset, &sig);
-+	sigwait(&sigset1, &sig);
+-	sigwait(&set, &sig);
++	sigwait(&set1, &sig);
  	chld_pid = getpid();
  
  	if ((shmid = shmget(key, SIZE, 0)) < 0) {
 diff --git a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
-index 20fca52..6fb1d57 100644
+index 232d25a..06d902f 100644
 --- a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
 +++ b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
 @@ -91,7 +91,7 @@ int TST_TOTAL = 1;
  int sig_catch = 0;		/* variable to blocked/unblocked signals */
  
  struct sigaction sa_new;	/* struct to hold signal info */
--sigset_t sigset;		/* signal set to hold signal lists */
-+sigset_t sigset1;		/* signal set to hold signal lists */
+-sigset_t set;		/* signal set to hold signal lists */
++sigset_t set1;		/* signal set to hold signal lists */
  sigset_t sigset2;
  
  int main(int ac, char **av)
@@ -99,8 +100,8 @@
  		 * so that, signal will not be delivered to
  		 * the test process.
  		 */
--		TEST(sigprocmask(SIG_BLOCK, &sigset, 0));
-+		TEST(sigprocmask(SIG_BLOCK, &sigset1, 0));
+-		TEST(sigprocmask(SIG_BLOCK, &set, 0));
++		TEST(sigprocmask(SIG_BLOCK, &set1, 0));
  
  		/* Get the process id of test process */
  		my_pid = getpid();
@@ -108,8 +109,8 @@
  				 */
  				errno = 0;
  				if (sigprocmask(SIG_UNBLOCK,
--						&sigset, 0) == -1) {
-+						&sigset1, 0) == -1) {
+-						&set, 0) == -1) {
++						&set1, 0) == -1) {
  					tst_brkm(TFAIL, cleanup,
  						 "sigprocmask() failed "
  						 "to unblock signal, "
@@ -117,8 +118,8 @@
  	 * Initialise the signal sets with the list that
  	 * excludes/includes  all system-defined signals.
  	 */
--	if (sigemptyset(&sigset) == -1) {
-+	if (sigemptyset(&sigset1) == -1) {
+-	if (sigemptyset(&set) == -1) {
++	if (sigemptyset(&set1) == -1) {
  		tst_brkm(TFAIL, cleanup,
  			 "sigemptyset() failed, errno=%d : %s",
  			 errno, strerror(errno));
@@ -126,11 +127,11 @@
  	 * Add specified signal (SIGINT) to the signal set
  	 * which excludes system-defined signals.
  	 */
--	if (sigaddset(&sigset, SIGINT) == -1) {
-+	if (sigaddset(&sigset1, SIGINT) == -1) {
+-	if (sigaddset(&set, SIGINT) == -1) {
++	if (sigaddset(&set1, SIGINT) == -1) {
  		tst_brkm(TFAIL, cleanup,
  			 "sigaddset() failed, errno=%d : %s",
  			 errno, strerror(errno));
 -- 
-2.7.0
+2.7.4
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fix-faccessat01.c-build-fails-with-security-flags.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fix-faccessat01.c-build-fails-with-security-flags.patch
new file mode 100644
index 0000000..2600bd6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fix-faccessat01.c-build-fails-with-security-flags.patch
@@ -0,0 +1,70 @@
+From 32f563008f95975d26d1c4fcb266c72c56f934be Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 22 Feb 2017 01:21:55 -0500
+Subject: [PATCH] fix faccessat01.c build fails with security flags
+
+When the distro is poky-lsb, fix the following error:
+
+| In file included from ../../../../include/old/test.h:47:0,
+|                  from faccessat01.c:44:
+| faccessat01.c: In function 'setup':
+| ../../../../include/old/old_safe_file_ops.h:55:27: error: format not a string literal and no format arguments [-Werror=format-security]
+|                    (path), (fmt), ## __VA_ARGS__)
+|                            ^
+| faccessat01.c:132:2: note: in expansion of macro 'SAFE_FILE_PRINTF'
+|   SAFE_FILE_PRINTF(cleanup, testfile, testfile);
+|   ^~~~~~~~~~~~~~~~
+| ../../../../include/old/old_safe_file_ops.h:55:27: error: format not a string literal and no format arguments [-Werror=format-security]
+|                    (path), (fmt), ## __VA_ARGS__)
+|                            ^
+| faccessat01.c:133:2: note: in expansion of macro 'SAFE_FILE_PRINTF'
+|   SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
+|   ^~~~~~~~~~~~~~~~
+
+This is because in macro "SAFE_FILE_PRINTF", its third argument should be a
+format arguments, but in file faccessat01.c, it passed the same argument to
+macro "SAFE_FILE_PRINTF", so it results in the fails. It should pass the format
+string to the third argument.
+
+The same for file fchmodat01.c.
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+Upstream-Status: Pending
+---
+ testcases/kernel/syscalls/faccessat/faccessat01.c | 4 ++--
+ testcases/kernel/syscalls/fchmodat/fchmodat01.c   | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
+index 622dfd3..1ca90e9 100644
+--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
++++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
+@@ -129,8 +129,8 @@ void setup(void)
+ 	fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
+ 	fds[1] = fds[4] = fds[0];
+ 
+-	SAFE_FILE_PRINTF(cleanup, testfile, testfile);
+-	SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
++	SAFE_FILE_PRINTF(cleanup, testfile, "faccessattestfile%d.txt");
++	SAFE_FILE_PRINTF(cleanup, testfile2, "%s/faccessattestfile%d.txt");
+ 
+ 	fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
+ 
+diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
+index 6bf66d8..89d072a 100644
+--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
++++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
+@@ -127,8 +127,8 @@ void setup(void)
+ 	fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
+ 	fds[1] = fds[4] = fds[0];
+ 
+-	SAFE_FILE_PRINTF(cleanup, testfile, testfile);
+-	SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
++	SAFE_FILE_PRINTF(cleanup, testfile, "fchmodattest%d.txt");
++	SAFE_FILE_PRINTF(cleanup, testfile2, "%s/fchmodattest%d.txt");
+ 
+ 	fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
+ 	fds[3] = 100;
+-- 
+2.8.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch
deleted file mode 100644
index e1532c1..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch
+++ /dev/null
@@ -1,351 +0,0 @@
-From 54e098a366a1d773c4d7d4124f2f5aab976681c3 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 7 Jan 2016 19:58:08 +0000
-Subject: [PATCH 12/32] fsstress.c: Replace __int64_t with int64_t
-
-int64_t is defined in ISO C99
-include limits.h to get defintions of PATH_MAX
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/fs/fsstress/fsstress.c       | 31 +++++++++---------
- testcases/network/nfs/nfs_fsstress/fsstress.c | 47 ++++++++++++++-------------
- 2 files changed, 40 insertions(+), 38 deletions(-)
-
-diff --git a/testcases/kernel/fs/fsstress/fsstress.c b/testcases/kernel/fs/fsstress/fsstress.c
-index 2f89903..89f0b19 100644
---- a/testcases/kernel/fs/fsstress/fsstress.c
-+++ b/testcases/kernel/fs/fsstress/fsstress.c
-@@ -36,6 +36,7 @@
- #ifdef HAVE_SYS_PRCTL_H
- # include <sys/prctl.h>
- #endif
-+#include <limits.h>
- 
- #define XFS_ERRTAG_MAX		17
- 
-@@ -1572,7 +1573,7 @@ void bulkstat_f(int opno, long r)
- 	__u64 last;
- 	__s32 nent;
- 	xfs_bstat_t *t;
--	__int64_t total;
-+	int64_t total;
- 	xfs_fsop_bulkreq_t bsr;
- 
- 	last = 0;
-@@ -1764,14 +1765,14 @@ int setdirect(int fd)
- 
- void dread_f(int opno, long r)
- {
--	__int64_t align;
-+	int64_t align;
- 	char *buf = NULL;
- 	struct dioattr diob;
- 	int e;
- 	pathname_t f;
- 	int fd;
- 	size_t len;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -1835,8 +1836,8 @@ void dread_f(int opno, long r)
- 		return;
- 	}
- #endif
--	align = (__int64_t) diob.d_miniosz;
--	lr = ((__int64_t) random() << 32) + random();
-+	align = (int64_t) diob.d_miniosz;
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % stb.st_size);
- 	off -= (off % align);
- 	lseek64(fd, off, SEEK_SET);
-@@ -1865,14 +1866,14 @@ void dread_f(int opno, long r)
- 
- void dwrite_f(int opno, long r)
- {
--	__int64_t align;
-+	int64_t align;
- 	char *buf = NULL;
- 	struct dioattr diob;
- 	int e;
- 	pathname_t f;
- 	int fd;
- 	size_t len;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -1925,8 +1926,8 @@ void dwrite_f(int opno, long r)
- 		return;
- 	}
- #endif
--	align = (__int64_t) diob.d_miniosz;
--	lr = ((__int64_t) random() << 32) + random();
-+	align = (int64_t) diob.d_miniosz;
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
- 	off -= (off % align);
- 	lseek64(fd, off, SEEK_SET);
-@@ -2224,7 +2225,7 @@ void read_f(int opno, long r)
- 	pathname_t f;
- 	int fd;
- 	size_t len;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -2262,7 +2263,7 @@ void read_f(int opno, long r)
- 		close(fd);
- 		return;
- 	}
--	lr = ((__int64_t) random() << 32) + random();
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % stb.st_size);
- 	lseek64(fd, off, SEEK_SET);
- 	len = (random() % (getpagesize() * 32)) + 1;
-@@ -2509,7 +2510,7 @@ void truncate_f(int opno, long r)
- {
- 	int e;
- 	pathname_t f;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -2530,7 +2531,7 @@ void truncate_f(int opno, long r)
- 		free_pathname(&f);
- 		return;
- 	}
--	lr = ((__int64_t) random() << 32) + random();
-+	lr = ((int64_t) random() << 32) + random();
- 	off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE);
- 	off %= maxfsize;
- 	e = truncate64_path(&f, off) < 0 ? errno : 0;
-@@ -2626,7 +2627,7 @@ void write_f(int opno, long r)
- 	pathname_t f;
- 	int fd;
- 	size_t len;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -2656,7 +2657,7 @@ void write_f(int opno, long r)
- 		close(fd);
- 		return;
- 	}
--	lr = ((__int64_t) random() << 32) + random();
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
- 	off %= maxfsize;
- 	lseek64(fd, off, SEEK_SET);
-diff --git a/testcases/network/nfs/nfs_fsstress/fsstress.c b/testcases/network/nfs/nfs_fsstress/fsstress.c
-index ac91262..a34c416 100644
---- a/testcases/network/nfs/nfs_fsstress/fsstress.c
-+++ b/testcases/network/nfs/nfs_fsstress/fsstress.c
-@@ -31,6 +31,7 @@
-  */
- 
- #include "global.h"
-+#include <limits.h>
- 
- #define XFS_ERRTAG_MAX		17
- 
-@@ -1368,7 +1369,7 @@ void allocsp_f(int opno, long r)
- 	pathname_t f;
- 	int fd;
- 	struct flock64 fl;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -1398,7 +1399,7 @@ void allocsp_f(int opno, long r)
- 		close(fd);
- 		return;
- 	}
--	lr = ((__int64_t) random() << 32) + random();
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
- 	off %= maxfsize;
- 	fl.l_whence = SEEK_SET;
-@@ -1519,7 +1520,7 @@ void bulkstat_f(int opno, long r)
- 	__uint64_t last;
- 	int nent;
- 	xfs_bstat_t *t;
--	__int64_t total;
-+	int64_t total;
- 	xfs_fsop_bulkreq_t bsr;
- 
- 	last = 0;
-@@ -1708,14 +1709,14 @@ int setdirect(int fd)
- 
- void dread_f(int opno, long r)
- {
--	__int64_t align;
-+	int64_t align;
- 	char *buf;
- 	struct dioattr diob;
- 	int e;
- 	pathname_t f;
- 	int fd;
- 	size_t len;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -1775,8 +1776,8 @@ void dread_f(int opno, long r)
- 		return;
- 	}
- #endif
--	align = (__int64_t) diob.d_miniosz;
--	lr = ((__int64_t) random() << 32) + random();
-+	align = (int64_t) diob.d_miniosz;
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % stb.st_size);
- 	off -= (off % align);
- 	lseek64(fd, off, SEEK_SET);
-@@ -1798,14 +1799,14 @@ void dread_f(int opno, long r)
- 
- void dwrite_f(int opno, long r)
- {
--	__int64_t align;
-+	int64_t align;
- 	char *buf;
- 	struct dioattr diob;
- 	int e;
- 	pathname_t f;
- 	int fd;
- 	size_t len;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -1854,8 +1855,8 @@ void dwrite_f(int opno, long r)
- 		return;
- 	}
- #endif
--	align = (__int64_t) diob.d_miniosz;
--	lr = ((__int64_t) random() << 32) + random();
-+	align = (int64_t) diob.d_miniosz;
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
- 	off -= (off % align);
- 	lseek64(fd, off, SEEK_SET);
-@@ -1917,7 +1918,7 @@ void freesp_f(int opno, long r)
- 	pathname_t f;
- 	int fd;
- 	struct flock64 fl;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -1947,7 +1948,7 @@ void freesp_f(int opno, long r)
- 		close(fd);
- 		return;
- 	}
--	lr = ((__int64_t) random() << 32) + random();
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
- 	off %= maxfsize;
- 	fl.l_whence = SEEK_SET;
-@@ -2145,7 +2146,7 @@ void read_f(int opno, long r)
- 	pathname_t f;
- 	int fd;
- 	size_t len;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -2183,7 +2184,7 @@ void read_f(int opno, long r)
- 		close(fd);
- 		return;
- 	}
--	lr = ((__int64_t) random() << 32) + random();
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % stb.st_size);
- 	lseek64(fd, off, SEEK_SET);
- 	len = (random() % (getpagesize() * 32)) + 1;
-@@ -2281,7 +2282,7 @@ void resvsp_f(int opno, long r)
- 	pathname_t f;
- 	int fd;
- 	struct flock64 fl;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -2311,7 +2312,7 @@ void resvsp_f(int opno, long r)
- 		close(fd);
- 		return;
- 	}
--	lr = ((__int64_t) random() << 32) + random();
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
- 	off %= maxfsize;
- 	fl.l_whence = SEEK_SET;
-@@ -2428,7 +2429,7 @@ void truncate_f(int opno, long r)
- {
- 	int e;
- 	pathname_t f;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -2449,7 +2450,7 @@ void truncate_f(int opno, long r)
- 		free_pathname(&f);
- 		return;
- 	}
--	lr = ((__int64_t) random() << 32) + random();
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
- 	off %= maxfsize;
- 	e = truncate64_path(&f, off) < 0 ? errno : 0;
-@@ -2491,7 +2492,7 @@ void unresvsp_f(int opno, long r)
- 	pathname_t f;
- 	int fd;
- 	struct flock64 fl;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -2521,7 +2522,7 @@ void unresvsp_f(int opno, long r)
- 		close(fd);
- 		return;
- 	}
--	lr = ((__int64_t) random() << 32) + random();
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
- 	off %= maxfsize;
- 	fl.l_whence = SEEK_SET;
-@@ -2543,7 +2544,7 @@ void write_f(int opno, long r)
- 	pathname_t f;
- 	int fd;
- 	size_t len;
--	__int64_t lr;
-+	int64_t lr;
- 	off64_t off;
- 	struct stat64 stb;
- 	int v;
-@@ -2573,7 +2574,7 @@ void write_f(int opno, long r)
- 		close(fd);
- 		return;
- 	}
--	lr = ((__int64_t) random() << 32) + random();
-+	lr = ((int64_t) random() << 32) + random();
- 	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
- 	off %= maxfsize;
- 	lseek64(fd, off, SEEK_SET);
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch
deleted file mode 100644
index 4266e4f..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 1ef8c32317064438ec3b37a114f5d82957f4e0c6 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 7 Jan 2016 20:05:54 +0000
-Subject: [PATCH 13/32] include fcntl.h for getting O_* definitions
-
-musl exposes this issue, with glibc fcntl.h is included via some other
-header and this problem remained latent
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/ipc/ipc_stress/shmem_test_03.c   | 1 +
- testcases/kernel/syscalls/mq_notify/mq_notify01.c | 1 +
- testcases/network/tcp_cmds/sendfile/testsf_c.c    | 1 +
- testcases/network/tcp_cmds/sendfile/testsf_s.c    | 1 +
- 4 files changed, 4 insertions(+)
-
-diff --git a/testcases/kernel/ipc/ipc_stress/shmem_test_03.c b/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
-index c1b11fd..8be156f 100644
---- a/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
-+++ b/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
-@@ -72,6 +72,7 @@
- #include <string.h>
- #include <unistd.h>
- #include <limits.h>
-+#include <fcntl.h>
- #include <sys/file.h>
- #include <sys/ipc.h>
- #include <sys/mman.h>
-diff --git a/testcases/kernel/syscalls/mq_notify/mq_notify01.c b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
-index 4728c70..5c7846c 100644
---- a/testcases/kernel/syscalls/mq_notify/mq_notify01.c
-+++ b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
-@@ -41,6 +41,7 @@
- #include <mqueue.h>
- #include <signal.h>
- #include <stdlib.h>
-+#include <fcntl.h>
- 
- #include "../utils/include_j_h.h"
- 
-diff --git a/testcases/network/tcp_cmds/sendfile/testsf_c.c b/testcases/network/tcp_cmds/sendfile/testsf_c.c
-index 449784f..38d3274 100644
---- a/testcases/network/tcp_cmds/sendfile/testsf_c.c
-+++ b/testcases/network/tcp_cmds/sendfile/testsf_c.c
-@@ -9,6 +9,7 @@
- #include <sys/types.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <fcntl.h>
- #include <sys/file.h>
- #include <arpa/inet.h>
- #include <netinet/in.h>
-diff --git a/testcases/network/tcp_cmds/sendfile/testsf_s.c b/testcases/network/tcp_cmds/sendfile/testsf_s.c
-index 17e98ad..bce8dd1 100644
---- a/testcases/network/tcp_cmds/sendfile/testsf_s.c
-+++ b/testcases/network/tcp_cmds/sendfile/testsf_s.c
-@@ -6,6 +6,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
-+#include <fcntl.h>
- #include <sys/file.h>
- #include <errno.h>
- #include <sys/signal.h>
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch
deleted file mode 100644
index 84d81e9..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From d63fefa86dac437c47b9ebbea0a82a1240aaba2c Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 7 Jan 2016 20:09:56 +0000
-Subject: [PATCH 14/32] hyperthreading: Include sys/types.h for pid_t
- definition
-
-If sys/types.h is not included then it will not define pid_t_needed
-and therefore typedef wont be included and we get errors about pid_t
-being not known
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h  | 1 +
- testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h   | 1 +
- testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h | 1 +
- 3 files changed, 3 insertions(+)
-
-diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
-index 1ec9794..9084aa7 100644
---- a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
-+++ b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
-@@ -3,6 +3,7 @@
- #define _HTUTILS_H_
- 
- #include <stdlib.h>
-+#include <sys/types.h>
- 
- int is_cmdline_para(const char *para);
- 
-diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
-index 1ec9794..c03a124 100644
---- a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
-+++ b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
-@@ -2,6 +2,7 @@
- #ifndef _HTUTILS_H_
- #define _HTUTILS_H_
- 
-+#include <sys/types.h>
- #include <stdlib.h>
- 
- int is_cmdline_para(const char *para);
-diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
-index 2977ad0..6b484e1 100644
---- a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
-+++ b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
-@@ -3,6 +3,7 @@
- #define _HTUTILS_H_
- 
- #include <stdlib.h>
-+#include <sys/types.h>
- 
- int is_cmdline_para(const char *para);
- 
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch
deleted file mode 100644
index 963536f..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From f091839532f3afe0a58e8ba0b45615c899a43a47 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 7 Jan 2016 20:12:09 +0000
-Subject: [PATCH 15/32] mincore01: Rename PAGESIZE to pagesize
-
-PAGESIZE conflicts with system headers on musl
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/syscalls/mincore/mincore01.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/testcases/kernel/syscalls/mincore/mincore01.c b/testcases/kernel/syscalls/mincore/mincore01.c
-index 97a3d95..fa426d1 100644
---- a/testcases/kernel/syscalls/mincore/mincore01.c
-+++ b/testcases/kernel/syscalls/mincore/mincore01.c
-@@ -45,7 +45,7 @@
- #include "test.h"
- #include "safe_macros.h"
- 
--static int PAGESIZE;
-+static int pagesize;
- static rlim_t STACK_LIMIT = 10485760;
- 
- static void cleanup(void);
-@@ -146,7 +146,7 @@ static void setup4(struct test_case_t *tc)
- 	}
- 
- 	tc->addr = global_pointer;
--	tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + PAGESIZE;
-+	tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + pagesize;
- 	tc->vector = global_vec;
- 
- 	/*
-@@ -161,7 +161,7 @@ static void setup(void)
- 	char *buf;
- 	int fd;
- 
--	PAGESIZE = getpagesize();
-+	pagesize = getpagesize();
- 
- 	tst_sig(NOFORK, DEF_HANDLER, cleanup);
- 
-@@ -170,7 +170,7 @@ static void setup(void)
- 	TEST_PAUSE;
- 
- 	/* global_pointer will point to a mmapped area of global_len bytes */
--	global_len = PAGESIZE * 2;
-+	global_len = pagesize * 2;
- 
- 	buf = SAFE_MALLOC(cleanup, global_len);
- 	memset(buf, 42, global_len);
-@@ -186,7 +186,7 @@ static void setup(void)
- 				   PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- 
- 	global_vec = SAFE_MALLOC(cleanup,
--				 (global_len + PAGESIZE - 1) / PAGESIZE);
-+				 (global_len + pagesize - 1) / pagesize);
- 
- 	SAFE_CLOSE(cleanup, fd);
- }
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch
deleted file mode 100644
index 1b5b93a..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 2b9be924bbad8a1f84ae553fdd1aa8391aa8d2f4 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 7 Jan 2016 20:15:07 +0000
-Subject: [PATCH 16/32] ustat: Change header from ustat.h to sys/ustat.h
-
-makes it portable for musl, on glibc ustat.h is just including
-sys/ustat.h too
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/syscalls/ustat/ustat01.c | 2 +-
- testcases/kernel/syscalls/ustat/ustat02.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/testcases/kernel/syscalls/ustat/ustat01.c b/testcases/kernel/syscalls/ustat/ustat01.c
-index 01b7688..494647b 100644
---- a/testcases/kernel/syscalls/ustat/ustat01.c
-+++ b/testcases/kernel/syscalls/ustat/ustat01.c
-@@ -20,8 +20,8 @@
-  */
- 
- #include <unistd.h>
--#include <ustat.h>
- #include <errno.h>
-+#include <sys/ustat.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include "test.h"
-diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c
-index 4e66236..edada31 100644
---- a/testcases/kernel/syscalls/ustat/ustat02.c
-+++ b/testcases/kernel/syscalls/ustat/ustat02.c
-@@ -21,8 +21,8 @@
-  */
- 
- #include <unistd.h>
--#include <ustat.h>
- #include <errno.h>
-+#include <sys/ustat.h>
- #include <sys/stat.h>
- #include <sys/types.h>
- #include "test.h"
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch
deleted file mode 100644
index ed25802..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From c882bcd18820b44a685f0d5edd7aaff77a88c912 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 7 Jan 2016 20:17:55 +0000
-Subject: [PATCH 17/32] replace sigval_t with union sigval
-
-This makes it compatible across musl and glibc
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c | 2 +-
- testcases/kernel/syscalls/timer_gettime/timer_gettime01.c       | 2 +-
- testcases/kernel/timers/timer_create/timer_create02.c           | 4 ++--
- testcases/kernel/timers/timer_create/timer_create03.c           | 4 ++--
- 4 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
-index d186c1f..bc03544 100644
---- a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
-+++ b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
-@@ -54,7 +54,7 @@ int main(int ac, char **av)
- 
- 	setup();
- 
--	ev.sigev_value = (sigval_t) 0;
-+	ev.sigev_value = (union sigval) 0;
- 	ev.sigev_signo = SIGALRM;
- 	ev.sigev_notify = SIGEV_SIGNAL;
- 	TEST(ltp_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
-diff --git a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
-index b583aee..9371a6a 100644
---- a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
-+++ b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
-@@ -55,7 +55,7 @@ int main(int ac, char **av)
- 
- 	setup();
- 
--	ev.sigev_value = (sigval_t) 0;
-+	ev.sigev_value = (union sigval) 0;
- 	ev.sigev_signo = SIGALRM;
- 	ev.sigev_notify = SIGEV_SIGNAL;
- 	TEST(ltp_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
-diff --git a/testcases/kernel/timers/timer_create/timer_create02.c b/testcases/kernel/timers/timer_create/timer_create02.c
-index 7f528ed..1127400 100644
---- a/testcases/kernel/timers/timer_create/timer_create02.c
-+++ b/testcases/kernel/timers/timer_create/timer_create02.c
-@@ -142,7 +142,7 @@ void setup_test(int option)
- {
- 	switch (option) {
- 	case 0:
--		evp.sigev_value = (sigval_t) 0;
-+		evp.sigev_value = (union sigval) 0;
- 		evp.sigev_signo = SIGALRM;
- 		evp.sigev_notify = SIGEV_SIGNAL;
- 		evp_ptr = &evp;
-@@ -151,7 +151,7 @@ void setup_test(int option)
- 		evp_ptr = NULL;
- 		break;
- 	case 2:
--		evp.sigev_value = (sigval_t) 0;
-+		evp.sigev_value = (union sigval) 0;
- 		evp.sigev_signo = SIGALRM;	/* any will do */
- 		evp.sigev_notify = SIGEV_NONE;
- 		evp_ptr = &evp;
-diff --git a/testcases/kernel/timers/timer_create/timer_create03.c b/testcases/kernel/timers/timer_create/timer_create03.c
-index 291fcfa..8b01bf7 100644
---- a/testcases/kernel/timers/timer_create/timer_create03.c
-+++ b/testcases/kernel/timers/timer_create/timer_create03.c
-@@ -129,7 +129,7 @@ void setup_test(int option)
- {
- 	switch (option) {
- 	case 0:
--		evp.sigev_value = (sigval_t) 0;
-+		evp.sigev_value = (union sigval) 0;
- 		evp.sigev_signo = SIGALRM;
- 		evp.sigev_notify = SIGEV_SIGNAL;
- 		evp_ptr = &evp;
-@@ -138,7 +138,7 @@ void setup_test(int option)
- 		evp_ptr = NULL;
- 		break;
- 	case 2:
--		evp.sigev_value = (sigval_t) 0;
-+		evp.sigev_value = (union sigval) 0;
- 		evp.sigev_signo = SIGALRM;	/* any will do */
- 		evp.sigev_notify = SIGEV_NONE;
- 		evp_ptr = &evp;
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch
deleted file mode 100644
index 0a4c5f0..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 721e94985b9cff3e2724af7ea5be7d005bc12dec Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 8 Jan 2016 06:55:27 +0000
-Subject: [PATCH 19/32] tomoyo: Replace canonicalize_file_name() with
- realpath()
-
-canonicalize_file_name() API is specific to glibc
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c b/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
-index da4af0f..5c1a3ca 100644
---- a/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
-+++ b/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
-@@ -274,9 +274,9 @@ int main(int argc, char *argv[])
- 	/* Test mount(). */
- 	{
- 		static char buf[4096];
--		char *dev_ram_path = canonicalize_file_name("/dev/ram0");
-+		char *dev_ram_path = realpath("/dev/ram0", NULL);
- 		if (!dev_ram_path)
--			dev_ram_path = canonicalize_file_name("/dev/ram");
-+			dev_ram_path = realpath("/dev/ram", NULL);
- 		if (!dev_ram_path) {
- 			dev_ram_path = "/dev/ram0";
- 			mknod(dev_ram_path, S_IFBLK, MKDEV(1, 0));
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch
deleted file mode 100644
index 413b44a..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 7ac6fd51991ac61d1d7594f601d87842060ee284 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 8 Jan 2016 07:06:11 +0000
-Subject: [PATCH 22/32] include sys/types.h
-
-Fixes
-
-error: unknown type name 'uint'
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/ipc/ipc_stress/shmem_test_04.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/testcases/kernel/ipc/ipc_stress/shmem_test_04.c b/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
-index 72c2e60..e7e5f61 100644
---- a/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
-+++ b/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
-@@ -65,6 +65,7 @@
- #include <signal.h>
- #include <stdint.h>
- #include <sys/mman.h>
-+#include <sys/types.h>
- 
- #ifdef _LINUX_
- typedef unsigned long ulong_t;
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
index b47d097..f75e33b 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
@@ -1,29 +1,30 @@
-From 4a74b275acc8158850f2500928a1467c3482c986 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 8 Jan 2016 07:23:11 +0000
-Subject: [PATCH 27/32] sysconf01: Use _SC_2_C_VERSION conditionally
+From 1471012164ba8f26046d4b1ce5531a0d92805ef5 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 8 Feb 2017 16:21:16 +0800
+Subject: [PATCH 4/5] sysconf01: Use _SC_2_C_VERSION conditionally
 
 _SC_2_C_VERSION is not available on musl
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
 ---
  testcases/kernel/syscalls/sysconf/sysconf01.c | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/testcases/kernel/syscalls/sysconf/sysconf01.c b/testcases/kernel/syscalls/sysconf/sysconf01.c
-index 8542e77..e806943 100644
+index 583deef..de93695 100644
 --- a/testcases/kernel/syscalls/sysconf/sysconf01.c
 +++ b/testcases/kernel/syscalls/sysconf/sysconf01.c
-@@ -102,7 +102,9 @@ int main(void)
- 	test_sysconf(_SC_ATEXIT_MAX);
+@@ -103,7 +103,9 @@ int main(void)
  	test_sysconf(_SC_2_C_BIND);
  	test_sysconf(_SC_2_C_DEV);
+ #ifdef _SC_2_C_VERSION
 +#ifdef __GLIBC__
  	test_sysconf(_SC_2_C_VERSION);
 +#endif
- 	/* 21 - 25 */
- 	test_sysconf(_SC_2_CHAR_TERM);
- 	test_sysconf(_SC_2_FORT_DEV);
+ #else
+ 	tst_resm(TCONF, "_SC_2_C_VERSION not defined");
+ #endif
 -- 
-2.7.0
+2.7.4
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch
index fc82ff9..b26aa13 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch
@@ -13,23 +13,29 @@
  testcases/kernel/syscalls/rt_sigsuspend/Makefile | 3 +++
  2 files changed, 4 insertions(+), 1 deletion(-)
 
-diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h
-index 3a5a763..870918c 100644
---- a/include/lapi/rt_sigaction.h
-+++ b/include/lapi/rt_sigaction.h
-@@ -34,7 +34,7 @@
- #define INVAL_SA_PTR ((void *)-1)
- 
+Index: git/include/lapi/rt_sigaction.h
+===================================================================
+--- git.orig/include/lapi/rt_sigaction.h
++++ git/include/lapi/rt_sigaction.h
+@@ -36,12 +36,12 @@
+ #if defined(__mips__)
+ struct kernel_sigaction {
+ 	unsigned int sa_flags;
+-	__sighandler_t k_sa_handler;
++	sighandler_t k_sa_handler;
+ 	sigset_t sa_mask;
+ };
+ #else
  struct kernel_sigaction {
 -	__sighandler_t k_sa_handler;
 +	sighandler_t k_sa_handler;
  	unsigned long sa_flags;
  	void (*sa_restorer) (void);
  	sigset_t sa_mask;
-diff --git a/testcases/kernel/syscalls/rt_sigsuspend/Makefile b/testcases/kernel/syscalls/rt_sigsuspend/Makefile
-index 37bc3a9..2ca7f7c 100644
---- a/testcases/kernel/syscalls/rt_sigsuspend/Makefile
-+++ b/testcases/kernel/syscalls/rt_sigsuspend/Makefile
+Index: git/testcases/kernel/syscalls/rt_sigsuspend/Makefile
+===================================================================
+--- git.orig/testcases/kernel/syscalls/rt_sigsuspend/Makefile
++++ git/testcases/kernel/syscalls/rt_sigsuspend/Makefile
 @@ -19,4 +19,7 @@
  top_srcdir		?= ../../../..
  
@@ -38,6 +44,3 @@
 +CFLAGS	+= -D_GNU_SOURCE
 +
  include $(top_srcdir)/include/mk/generic_leaf_target.mk
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch
deleted file mode 100644
index f7ece9e..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 2f8a57f66a94210d34dd0361659a8297cf3d813f Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 8 Jan 2016 07:29:24 +0000
-Subject: [PATCH 29/32] trace_shed: Fix build with musl
-
-Errors on musl are
-
-trace_sched.c:425:16: error: invalid operands to binary & (have
-'thread_sched_t * {aka struct <anonymous> *}' and 'int')
-      thrd_ndx, WEXITSTATUS(status));
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/sched/tool/trace_sched.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/testcases/kernel/sched/tool/trace_sched.c b/testcases/kernel/sched/tool/trace_sched.c
-index 7815686..30dca5f 100644
---- a/testcases/kernel/sched/tool/trace_sched.c
-+++ b/testcases/kernel/sched/tool/trace_sched.c
-@@ -422,7 +422,7 @@ int main(int argc,		/* number of input parameters.                        */
- 			if (status == (thread_sched_t *) - 1) {
- 				fprintf(stderr,
- 					"thread [%d] - process exited with errors %d\n",
--					thrd_ndx, WEXITSTATUS(status));
-+					thrd_ndx, WEXITSTATUS((int)status));
- 				exit(-1);
- 			} else {
- 				exp_prio[thrd_ndx] = status->exp_prio;
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
index d2d6d76..c5fac9b 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
@@ -1,33 +1,33 @@
-From 77c95dacffe90382a1f131c801ac569120d95949 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 8 Jan 2016 07:32:24 +0000
-Subject: [PATCH 30/32] lib: Use PTHREAD_MUTEX_RECURSIVE in place of
+From 00ba7cdd0608b1507027428f9f87b1cb9747372b Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 9 Feb 2017 15:54:53 +0800
+Subject: [PATCH] lib: Use PTHREAD_MUTEX_RECURSIVE in place of
  PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP for non-glibc
 
 e.g. musl does not implement the _NP mutex types
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
 ---
- lib/tst_res.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
+ lib/tst_res.c | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 diff --git a/lib/tst_res.c b/lib/tst_res.c
-index 5c1c58c..3244b5e 100644
+index 61daaeb..435224f 100644
 --- a/lib/tst_res.c
 +++ b/lib/tst_res.c
-@@ -104,8 +104,11 @@ int TEST_ERRNO;
+@@ -79,7 +79,11 @@ int TEST_ERRNO;
  	assert(strlen(buf) > 0);		\
  } while (0)
  
 +#ifdef __GLIBC__
  static pthread_mutex_t tmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
--
 +#else
 +static pthread_mutex_t tmutex = {  PTHREAD_MUTEX_RECURSIVE };
 +#endif
- /*
-  * Define local function prototypes.
-  */
+ 
+ static void check_env(void);
+ static void tst_condense(int tnum, int ttype, const char *tmesg);
 -- 
-2.7.0
+2.7.4
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch
deleted file mode 100644
index 473ca4c..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 293ff1da06748ed4c69be6ece262d42e562e7298 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 8 Jan 2016 07:36:19 +0000
-Subject: [PATCH 31/32] vma03: fix page size offset as per page size alignment
-
-the offset the param of mmap2() doesn't align the page size, but,
-this param allow must be a multiple of the page size as returned
-by sysconf(_SC_PAGE_SIZE).meanwhile offset * 4096 must be a
-multiple of the system page size, so modify the input param of offset
-pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
-
-Signed-off-by: Chuang Dong <Chuang.Dong@windriver.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/mem/vma/vma03.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/testcases/kernel/mem/vma/vma03.c b/testcases/kernel/mem/vma/vma03.c
-index ad8a7b4..a539233 100644
---- a/testcases/kernel/mem/vma/vma03.c
-+++ b/testcases/kernel/mem/vma/vma03.c
-@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
- 		if (fd == -1)
- 			tst_brkm(TBROK | TERRNO, NULL, "open %s", TESTFILE);
- 
--		pgoff = ULONG_MAX - 1;
-+		pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
- 		map = mmap2(NULL, pgsz, PROT_READ | PROT_WRITE, MAP_PRIVATE,
- 			    fd, pgoff);
- 		if (map == MAP_FAILED)
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch
deleted file mode 100644
index 5c6bf91..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 4f1905ff09c730091674818bd1b48ee221347101 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 8 Jan 2016 08:30:29 +0000
-Subject: [PATCH 32/32] regen.sh: Include asm/unistd.h explicitly
-
-on musl this is not included indirectly and it results in errors like
-testcases/kernel/include/linux_syscall_numbers.h:1035:25: error:
-'__NR_SYSCALL_BASE' undeclared (first use in this function)
-|  #  define __NR_readdir (__NR_SYSCALL_BASE+ 89)
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- testcases/kernel/include/regen.sh | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/testcases/kernel/include/regen.sh b/testcases/kernel/include/regen.sh
-index f93f49b..ee790af 100755
---- a/testcases/kernel/include/regen.sh
-+++ b/testcases/kernel/include/regen.sh
-@@ -32,6 +32,7 @@ cat << EOF > "${output_pid}"
- 
- #include <errno.h>
- #include <sys/syscall.h>
-+#include <asm/unistd.h>
- #include "cleanup.c"
- 
- #define ltp_syscall(NR, ...) ({ \\
--- 
-2.7.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
index 32ae8aa..71e32a5 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
@@ -1,23 +1,32 @@
-Fix test_proc_kill hanging
+From f7c602b639db0d118e07d3fa7b6deead0be0c72b Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 8 Feb 2017 16:17:17 +0800
+Subject: [PATCH 3/5] Fix test_proc_kill hanging
 
 Sometimes the signal is delivered to memcg_process before the framework took
 into consideration its pid entered in the tasks. Fixed by delaying the signal
 send command.
 
 Signed-off-by: George Nita <george.nita@enea.com>
-Upstream-Status: Pending 
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+
+Upstream-Status: Pending
+---
+ testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 1 +
+ 1 file changed, 1 insertion(+)
 
 diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
-index ffbe006..e81bf74 100755
+index b785fe3..2918cc5 100755
 --- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
 +++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
-@@ -220,8 +220,8 @@ test_proc_kill()
- 
- 	$TEST_PATH/memcg_process $2 -s $3 &
+@@ -283,6 +283,7 @@ test_proc_kill()
  	pid=$!
--	sleep 1
+ 	TST_CHECKPOINT_WAIT 0
  	echo $pid > tasks
 +	sleep 1
  
- 	kill -s USR1 $pid 2> /dev/null
- 	sleep 1
+ 	signal_memcg_process $pid $3
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
rename to import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0039-fcntl-fix-the-time-def-to-use-time_t.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0039-fcntl-fix-the-time-def-to-use-time_t.patch
new file mode 100644
index 0000000..c0c1dad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0039-fcntl-fix-the-time-def-to-use-time_t.patch
@@ -0,0 +1,29 @@
+From 7bce3d223494803cb32897cabe66119076e53d89 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 8 Feb 2017 16:23:51 +0800
+Subject: [PATCH 5/5] fcntl: fix the time() def to use time_t
+
+This fixes the build on X32, where long is 32-bit rather than 64-bit.
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ testcases/kernel/syscalls/fcntl/fcntl14.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl14.c b/testcases/kernel/syscalls/fcntl/fcntl14.c
+index c61eb24..99e3867 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl14.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl14.c
+@@ -775,7 +775,7 @@ void dochild(void)
+ 
+ void run_test(int file_flag, int file_mode, int seek, int start, int end)
+ {
+-	extern long time();
++	extern time_t time();
+ 
+ 	fail = 0;
+ 
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb
deleted file mode 100644
index 7631e0e..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb
+++ /dev/null
@@ -1,118 +0,0 @@
-SUMMARY = "Linux Test Project"
-DESCRIPTION = "The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The Linux Test Project is a collection of tools for testing the Linux kernel and related features."
-HOMEPAGE = "http://ltp.sourceforge.net"
-SECTION = "console/utils"
-LICENSE = "GPLv2 & GPLv2+ & LGPLv2+ & LGPLv2.1+ & BSD-2-Clause"
-LIC_FILES_CHKSUM = "\
-    file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-    file://testcases/kernel/controllers/freezer/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
-    file://testcases/kernel/controllers/freezer/run_freezer.sh;beginline=5;endline=17;md5=86a61d2c042d59836ffb353a21456498 \
-    file://testcases/kernel/hotplug/memory_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
-    file://testcases/kernel/hotplug/cpu_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
-    file://testcases/open_posix_testsuite/COPYING;md5=216e43b72efbe4ed9017cc19c4c68b01 \
-    file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
-    file://tools/netpipe-2.4/COPYING;md5=9e3781bb5fe787aa80e1f51f5006b6fa \
-    file://tools/netpipe-2.4-ipv6/COPYING;md5=9e3781bb5fe787aa80e1f51f5006b6fa \
-    file://tools/top-LTP/proc/COPYING;md5=aefc88eb8a41672fbfcfe6b69ab8c49c \
-    file://tools/pounder21/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
-    file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
-    file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \
-"
-
-DEPENDS = "attr libaio libcap acl openssl zip-native"
-DEPENDS_append_libc-musl = " fts "
-EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
-CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
-CFLAGS_append_mips64 = " -D__SANE_USERSPACE_TYPES__"
-SRCREV = "fce797676b14f50406718e7ef640b50da66c9b36"
-
-SRC_URI = "git://github.com/linux-test-project/ltp.git \
-           file://0001-ltp-Don-t-link-against-libfl.patch \
-           file://0002-Add-knob-to-control-whether-numa-support-should-be-c.patch \
-           file://0003-Add-knob-to-control-tirpc-support.patch \
-           file://0004-build-Add-option-to-select-libc-implementation.patch \
-           file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
-           file://0006-sendfile-Use-off64_t-instead-of-__off64_t.patch \
-           file://0007-replace-SIGCLD-with-SIGCHLD.patch \
-           file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \
-           file://0009-Guard-error.h-with-__GLIBC__.patch \
-           file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \
-           file://0011-Rename-sigset-variable-to-sigset1.patch \
-           file://0012-fsstress.c-Replace-__int64_t-with-int64_t.patch \
-           file://0013-include-fcntl.h-for-getting-O_-definitions.patch \
-           file://0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch \
-           file://0015-mincore01-Rename-PAGESIZE-to-pagesize.patch \
-           file://0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch \
-           file://0017-replace-sigval_t-with-union-sigval.patch \
-           file://0018-guard-mallocopt-with-__GLIBC__.patch \
-           file://0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch \
-           file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \
-           file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \
-           file://0022-include-sys-types.h.patch \
-           file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \
-           file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \
-           file://0025-mc_gethost-include-sys-types.h.patch \
-           file://0026-crash01-Define-_GNU_SOURCE.patch \
-           file://0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch \
-           file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \
-           file://0029-trace_shed-Fix-build-with-musl.patch \
-           file://0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch \
-           file://0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch \
-           file://0032-regen.sh-Include-asm-unistd.h-explicitly.patch \
-           file://0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch \
-           file://0034-periodic_output.patch \
-           file://0035-fix-test_proc_kill-hang.patch \
-           file://0001-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
-           "
-
-S = "${WORKDIR}/git"
-
-inherit autotools-brokensep
-
-TARGET_CC_ARCH += "${LDFLAGS}"
-
-export prefix = "/opt/ltp"
-export exec_prefix = "/opt/ltp"
-
-PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl,"
-EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4"
-EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite "
-# ltp network/rpc test cases ftbfs when libtirpc is found
-EXTRA_OECONF += " --without-tirpc "
-
-# The makefiles make excessive use of make -C and several include testcases.mk
-# which triggers a build of the syscall header. To reproduce, build ltp,
-# then delete the header, then "make -j XX" and watch regen.sh run multiple
-# times. Its easier to generate this once here instead.
-do_compile_prepend () {
-	( make -C ${B}/testcases/kernel include/linux_syscall_numbers.h )
-}
-
-do_install(){
-    install -d ${D}/opt/ltp/
-    oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install
-
-    # fixup not deploy STPfailure_report.pl to avoid confusing about it fails to run
-    # as it lacks dependency on some perl moudle such as LWP::Simple
-    # And this script previously works as a tool for analyzing failures from LTP
-    # runs on the OSDL's Scaleable Test Platform (STP) and it mainly accesses
-    # http://khack.osdl.org to retrieve ltp test results run on
-    # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible
-    rm -rf ${D}/opt/ltp/bin/STPfailure_report.pl
-
-    # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual
-    cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases
-}
-
-RDEPENDS_${PN} = "perl e2fsprogs-mke2fs python-core libaio bash gawk expect ldd"
-
-FILES_${PN}-staticdev += "/opt/ltp/lib/libmem.a"
-
-FILES_${PN} += "/opt/ltp/* /opt/ltp/runtest/* /opt/ltp/scenario_groups/* /opt/ltp/testcases/bin/* /opt/ltp/testcases/bin/*/bin/* /opt/ltp/testscripts/* /opt/ltp/testcases/open_posix_testsuite/* /opt/ltp/testcases/open_posix_testsuite/conformance/* /opt/ltp/testcases/open_posix_testsuite/Documentation/* /opt/ltp/testcases/open_posix_testsuite/functional/* /opt/ltp/testcases/open_posix_testsuite/include/* /opt/ltp/testcases/open_posix_testsuite/scripts/* /opt/ltp/testcases/open_posix_testsuite/stress/* /opt/ltp/testcases/open_posix_testsuite/tools/*"
-
-# Avoid generated binaries stripping. Otherwise some of the ltp tests such as ldd01 & nm01 fails
-INHIBIT_PACKAGE_STRIP = "1"
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-# However, test_arch_stripped is already stripped, so...
-INSANE_SKIP_${PN} += "already-stripped"
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20170116.bb b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20170116.bb
new file mode 100644
index 0000000..58af104
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20170116.bb
@@ -0,0 +1,114 @@
+SUMMARY = "Linux Test Project"
+DESCRIPTION = "The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The Linux Test Project is a collection of tools for testing the Linux kernel and related features."
+HOMEPAGE = "http://ltp.sourceforge.net"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & GPLv2+ & LGPLv2+ & LGPLv2.1+ & BSD-2-Clause"
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+    file://testcases/kernel/controllers/freezer/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+    file://testcases/kernel/controllers/freezer/run_freezer.sh;beginline=5;endline=17;md5=86a61d2c042d59836ffb353a21456498 \
+    file://testcases/kernel/hotplug/memory_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
+    file://testcases/kernel/hotplug/cpu_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
+    file://testcases/open_posix_testsuite/COPYING;md5=216e43b72efbe4ed9017cc19c4c68b01 \
+    file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+    file://tools/pounder21/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+    file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+    file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \
+"
+
+DEPENDS = "attr libaio libcap acl openssl zip-native"
+DEPENDS_append_libc-musl = " fts "
+EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
+CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
+SRCREV = "2c8457b0769fc026e4e1772f4c2a6da0be63a631"
+
+SRC_URI = "git://github.com/linux-test-project/ltp.git \
+           file://0001-add-_GNU_SOURCE-to-pec_listener.c.patch \
+           file://0002-Add-knob-to-control-whether-numa-support-should-be-c.patch \
+           file://0003-Add-knob-to-control-tirpc-support.patch \
+           file://0004-build-Add-option-to-select-libc-implementation.patch \
+           file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
+           file://0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch \
+           file://0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch \
+           file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \
+           file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \
+           file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \
+           file://0011-Rename-sigset-variable-to-sigset1.patch \
+           file://0012-fix-faccessat01.c-build-fails-with-security-flags.patch \
+           file://0018-guard-mallocopt-with-__GLIBC__.patch \
+           file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \
+           file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \
+           file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \
+           file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \
+           file://0025-mc_gethost-include-sys-types.h.patch \
+           file://0026-crash01-Define-_GNU_SOURCE.patch \
+           file://0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch \
+           file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \
+           file://0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch \
+           file://0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch \
+           file://0034-periodic_output.patch \
+           file://0035-fix-test_proc_kill-hang.patch \
+           file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
+           file://0039-fcntl-fix-the-time-def-to-use-time_t.patch \
+           "
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+export prefix = "/opt/ltp"
+export exec_prefix = "/opt/ltp"
+
+PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl,"
+EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4"
+EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite "
+# ltp network/rpc test cases ftbfs when libtirpc is found
+EXTRA_OECONF += " --without-tirpc "
+
+# The makefiles make excessive use of make -C and several include testcases.mk
+# which triggers a build of the syscall header. To reproduce, build ltp,
+# then delete the header, then "make -j XX" and watch regen.sh run multiple
+# times. Its easier to generate this once here instead.
+do_compile_prepend () {
+	( make -C ${B}/testcases/kernel include/linux_syscall_numbers.h )
+}
+
+do_install(){
+    install -d ${D}/opt/ltp/
+    oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install
+
+    # fixup not deploy STPfailure_report.pl to avoid confusing about it fails to run
+    # as it lacks dependency on some perl moudle such as LWP::Simple
+    # And this script previously works as a tool for analyzing failures from LTP
+    # runs on the OSDL's Scaleable Test Platform (STP) and it mainly accesses
+    # http://khack.osdl.org to retrieve ltp test results run on
+    # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible
+    rm -rf ${D}/opt/ltp/bin/STPfailure_report.pl
+
+    # In oe-core, we doesn't support ksh and csh now, so remove in.csh and in.ksh.
+    rm ${D}/opt/ltp/testcases/data/file01/in.csh
+    rm ${D}/opt/ltp/testcases/data/file01/in.ksh
+    # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual
+    cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases
+}
+
+RDEPENDS_${PN} = "perl e2fsprogs-mke2fs python-core libaio bash gawk expect ldd unzip gzip cpio cronie logrotate which at"
+
+FILES_${PN}-staticdev += "/opt/ltp/lib/libmem.a /opt/ltp/testcases/data/nm01/lib.a"
+
+FILES_${PN} += "/opt/ltp/* /opt/ltp/runtest/* /opt/ltp/scenario_groups/* /opt/ltp/testcases/bin/* /opt/ltp/testcases/bin/*/bin/* /opt/ltp/testscripts/* /opt/ltp/testcases/open_posix_testsuite/* /opt/ltp/testcases/open_posix_testsuite/conformance/* /opt/ltp/testcases/open_posix_testsuite/Documentation/* /opt/ltp/testcases/open_posix_testsuite/functional/* /opt/ltp/testcases/open_posix_testsuite/include/* /opt/ltp/testcases/open_posix_testsuite/scripts/* /opt/ltp/testcases/open_posix_testsuite/stress/* /opt/ltp/testcases/open_posix_testsuite/tools/*"
+
+# Avoid generated binaries stripping. Otherwise some of the ltp tests such as ldd01 & nm01 fails
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+# However, test_arch_stripped is already stripped, so...
+INSANE_SKIP_${PN} += "already-stripped"
+
+# Avoid file dependency scans, as LTP checks for things that may or may not
+# exist on the running system.  For instance it has specific checks for
+# csh and ksh which are not typically part of OpenEmbedded systems (but
+# can be added via additional layers.)
+SKIP_FILEDEPS_${PN} = '1'
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lzip/lzip_1.18.bb b/import-layers/yocto-poky/meta/recipes-extended/lzip/lzip_1.18.bb
new file mode 100644
index 0000000..c1dc8ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lzip/lzip_1.18.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Lossless data compressor based on the LZMA algorithm"
+HOMEPAGE = "http://lzip.nongnu.org/lzip.html"
+SECTION = "console/utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=76d6e300ffd8fb9d18bd9b136a9bba13 \
+                    file://decoder.cc;beginline=3;endline=16;md5=db09fe3f9573f94d0076f7f07959e6e1"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/lzip/lzip-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "3838567460ce4a10143de4bccc64fe1c"
+SRC_URI[sha256sum] = "47f9882a104ab05532f467a7b8f4ddbb898fa2f1e8d9d468556d6c2d04db14dd"
+
+CONFIGUREOPTS = "\
+    '--srcdir=${S}' \
+    '--prefix=${prefix}' \
+    '--exec-prefix=${exec_prefix}' \
+    '--bindir=${bindir}' \
+    '--datadir=${datadir}' \
+    '--infodir=${infodir}' \
+    '--sysconfdir=${sysconfdir}' \
+    'CXX=${CXX}' \
+    'CPPFLAGS=${CPPFLAGS}' \
+    'CXXFLAGS=${CXXFLAGS}' \
+    'LDFLAGS=${LDFLAGS}' \
+"
+EXTRA_OEMAKE = ""
+
+B = "${S}/obj"
+do_configure () {
+    ${S}/configure ${CONFIGUREOPTS}
+}
+
+do_install () {
+    oe_runmake 'DESTDIR=${D}' install
+    # Info dir listing isn't interesting at this point so remove it if it exists.
+    if [ -e "${D}${infodir}/dir" ]; then
+        rm -f ${D}${infodir}/dir
+    fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.07.bb b/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.07.bb
deleted file mode 100644
index 76a3fd8..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.07.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-SUMMARY = "Linux man-pages"
-DESCRIPTION = "The Linux man-pages project documents the Linux kernel and C library interfaces that are employed by user programs"
-SECTION = "console/utils"
-HOMEPAGE = "http://www.kernel.org/pub/linux/docs/man-pages"
-LICENSE = "GPLv2+"
-
-LIC_FILES_CHKSUM = "file://README;md5=8f2a3d43057d458e5066714980567a60"
-SRC_URI = "${KERNELORG_MIRROR}/linux/docs/${BPN}/Archive/${BP}.tar.gz"
-
-SRC_URI[md5sum] = "05ba1cb21e99d02bd7bc1a59378965d2"
-SRC_URI[sha256sum] = "c973351131931f7700f5e9fbf4ef366c43ea7c1515d282e8d5db9c77590c4c93"
-
-RDEPENDS_${PN} = "man"
-
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
-
-do_install() {
-        oe_runmake install DESTDIR=${D}
-}
-
-# Only deliveres man-pages so FILES_${PN} gets everything
-FILES_${PN}-doc = ""
-FILES_${PN} = "${mandir}/*"
-
-inherit update-alternatives
-
-ALTERNATIVE_PRIORITY = "100"
-ALTERNATIVE_${PN} = "passwd.5 getspnam.3"
-ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
-ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.09.bb b/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.09.bb
new file mode 100644
index 0000000..55fc21e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.09.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Linux man-pages"
+DESCRIPTION = "The Linux man-pages project documents the Linux kernel and C library interfaces that are employed by user programs"
+SECTION = "console/utils"
+HOMEPAGE = "http://www.kernel.org/pub/linux/docs/man-pages"
+LICENSE = "GPLv2+"
+
+LIC_FILES_CHKSUM = "file://README;md5=8f2a3d43057d458e5066714980567a60"
+SRC_URI = "${KERNELORG_MIRROR}/linux/docs/${BPN}/Archive/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "9e3c7b12a5fecda9a717a4bcc0ae3a67"
+SRC_URI[sha256sum] = "5fac324cefce0fbfae0df6c06ef3f6d6ab5227b9aad2a94f8657a0e3901f9185"
+
+RDEPENDS_${PN} = "man"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+        oe_runmake install DESTDIR=${D}
+}
+
+# Only deliveres man-pages so FILES_${PN} gets everything
+FILES_${PN}-doc = ""
+FILES_${PN} = "${mandir}/*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "passwd.5 getspnam.3"
+ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
+ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb b/import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb
index e78aa18..ff603f8 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb
@@ -10,8 +10,8 @@
 DEPENDS = "groff less"
 
 def compress_pkg(d):
-    if "compress_doc" in (d.getVar("INHERIT", True) or "").split():
-         compress = d.getVar("DOC_COMPRESS", True)
+    if "compress_doc" in (d.getVar("INHERIT") or "").split():
+         compress = d.getVar("DOC_COMPRESS")
          if compress == "gz":
              return "gzip"
          elif compress == "bz2":
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch b/import-layers/yocto-poky/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch
new file mode 100644
index 0000000..bf8037c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch
@@ -0,0 +1,129 @@
+From cdc7c278212ae836eecb4cc9d42c29443cc128a0 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 6 Apr 2017 02:24:28 -0700
+Subject: [PATCH] mc: replace "perl -w" with "use warnings"
+
+The shebang's max length is usually 128 as defined in
+/usr/include/linux/binfmts.h:
+  #define BINPRM_BUF_SIZE 128
+
+There would be errors when @PERL@ is longer than 128, use
+'/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w'
+doesn't work:
+
+/usr/bin/env: perl -w: No such file or directory
+
+So replace "perl -w" with "use warnings" to make it work.
+
+The man2hlp.in already has "use warnings;", so just remove '-w' is OK.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ src/man2hlp/man2hlp.in           | 2 +-
+ src/vfs/extfs/helpers/a+.in      | 4 +++-
+ src/vfs/extfs/helpers/mailfs.in  | 3 ++-
+ src/vfs/extfs/helpers/patchfs.in | 3 ++-
+ src/vfs/extfs/helpers/ulib.in    | 4 +++-
+ src/vfs/extfs/helpers/uzip.in    | 3 ++-
+ 6 files changed, 13 insertions(+), 6 deletions(-)
+
+diff --git a/src/man2hlp/man2hlp.in b/src/man2hlp/man2hlp.in
+index f095830..558a674 100644
+--- a/src/man2hlp/man2hlp.in
++++ b/src/man2hlp/man2hlp.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ #  Man page to help file converter
+ #  Copyright (C) 1994, 1995, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
+diff --git a/src/vfs/extfs/helpers/a+.in b/src/vfs/extfs/helpers/a+.in
+index 579441c..fe446f4 100644
+--- a/src/vfs/extfs/helpers/a+.in
++++ b/src/vfs/extfs/helpers/a+.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # External filesystem for mc, using mtools
+ # Written Ludek Brukner <lubr@barco.cz>, 1997
+@@ -9,6 +9,8 @@
+ 
+ # These mtools components must be in PATH for this to work
+ 
++use warnings;
++
+ sub quote {
+     $_ = shift(@_);
+     s/([^\w\/.+-])/\\$1/g;
+diff --git a/src/vfs/extfs/helpers/mailfs.in b/src/vfs/extfs/helpers/mailfs.in
+index e9455be..059f41f 100644
+--- a/src/vfs/extfs/helpers/mailfs.in
++++ b/src/vfs/extfs/helpers/mailfs.in
+@@ -1,6 +1,7 @@
+-#! @PERL@ -w
++#! @PERL@
+ 
+ use bytes;
++use warnings;
+ 
+ # MC extfs for (possibly compressed) Berkeley style mailbox files
+ # Peter Daum <gator@cs.tu-berlin.de> (Jan 1998, mc-4.1.24)
+diff --git a/src/vfs/extfs/helpers/patchfs.in b/src/vfs/extfs/helpers/patchfs.in
+index ef407de..3ad4b53 100644
+--- a/src/vfs/extfs/helpers/patchfs.in
++++ b/src/vfs/extfs/helpers/patchfs.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # Written by Adam Byrtek <alpha@debian.org>, 2002
+ # Rewritten by David Sterba <dave@jikos.cz>, 2009
+@@ -9,6 +9,7 @@
+ 
+ use bytes;
+ use strict;
++use warnings;
+ use POSIX;
+ use File::Temp 'tempfile';
+ 
+diff --git a/src/vfs/extfs/helpers/ulib.in b/src/vfs/extfs/helpers/ulib.in
+index 418611f..82c7ccf 100644
+--- a/src/vfs/extfs/helpers/ulib.in
++++ b/src/vfs/extfs/helpers/ulib.in
+@@ -1,9 +1,11 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # VFS to manage the gputils archives.
+ # Written by Molnár Károly (proton7@freemail.hu) 2012
+ #
+ 
++use warnings;
++
+ my %month = ('jan' => '01', 'feb' => '02', 'mar' => '03',
+              'apr' => '04', 'may' => '05', 'jun' => '06',
+              'jul' => '07', 'aug' => '08', 'sep' => '09',
+diff --git a/src/vfs/extfs/helpers/uzip.in b/src/vfs/extfs/helpers/uzip.in
+index b1c4f90..c8eb335 100644
+--- a/src/vfs/extfs/helpers/uzip.in
++++ b/src/vfs/extfs/helpers/uzip.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # zip file archive Virtual File System for Midnight Commander
+ # Version 1.4.0 (2001-08-07).
+@@ -9,6 +9,7 @@
+ use POSIX;
+ use File::Basename;
+ use strict;
++use warnings;
+ 
+ #
+ # Configuration options
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch b/import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch
deleted file mode 100644
index ee4ba9f..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Fix build with musl by ensuring CTRL is defined.
-
-musl does not define CTRL in <termios.h>, we could include <sys/ttydefaults.h>
-explicitly but it's easier just to ensure CTRL is defined.
-
-This patch is taken from Sabotage Linux, the license statement for patches and
-build scripts in Sabotage Linux says:
-
-    To the extent possible under law, Christian Neukirchen has waived
-    all copyright and related or neighboring rights to this work.
-
-    http://creativecommons.org/publicdomain/zero/1.0/
-
-Therefore this should be good to include in OpenEmbedded.
-
-Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
-
-Upstream-Status: Accepted (should be included in v4.8.14)
-
-diff -u mc-4.8.1.7.org/lib/tty/tty-ncurses.c mc-4.8.1.7/lib/tty/tty-ncurses.c
---- mc-4.8.1.7.org/lib/tty/tty-ncurses.c
-+++ mc-4.8.1.7/lib/tty/tty-ncurses.c
-@@ -65,7 +65,7 @@
- 
- /*** file scope macro definitions ****************************************************************/
- 
--#if defined(_AIX) && !defined(CTRL)
-+#if !defined(CTRL)
- #define CTRL(x) ((x) & 0x1f)
- #endif
- 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb
deleted file mode 100644
index b38964d..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb
+++ /dev/null
@@ -1,47 +0,0 @@
-SUMMARY = "Midnight Commander is an ncurses based file manager"
-HOMEPAGE = "http://www.midnight-commander.org/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-SECTION = "console/utils"
-DEPENDS = "ncurses glib-2.0"
-RDEPENDS_${PN} = "ncurses-terminfo"
-
-PR = "r3"
-
-SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
-           file://mc-CTRL.patch \
-           "
-
-SRC_URI[md5sum] = "bdae966244496cd4f6d282d80c9cf3c6"
-SRC_URI[sha256sum] = "a68338862bb30017eb65ed569a58e80ab66ae8cef11c886440c9e9f4d1efc6ab"
-
-inherit autotools gettext pkgconfig
-
-EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x --without-samba"
-
-do_install_append () {
-	sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
-	sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
-}
-
-PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers-python ${BPN}-helpers ${BPN}-fish"
-
-SUMMARY_${BPN}-helpers-perl = "Midnight Commander Perl-based helper scripts"
-FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs.d/apt+ \
-                             ${libexecdir}/mc/extfs.d/deb ${libexecdir}/mc/extfs.d/deba \
-                             ${libexecdir}/mc/extfs.d/debd ${libexecdir}/mc/extfs.d/dpkg+ \
-                             ${libexecdir}/mc/extfs.d/mailfs ${libexecdir}/mc/extfs.d/patchfs \ 
-                             ${libexecdir}/mc/extfs.d/rpms+ ${libexecdir}/mc/extfs.d/ulib \ 
-                             ${libexecdir}/mc/extfs.d/uzip"
-RDEPENDS_${BPN}-helpers-perl = "perl"
-
-SUMMARY_${BPN}-helpers-python = "Midnight Commander Python-based helper scripts"
-FILES_${BPN}-helpers-python = "${libexecdir}/mc/extfs.d/s3+ ${libexecdir}/mc/extfs.d/uc1541"
-RDEPENDS_${BPN}-helpers-python = "python"
-
-SUMMARY_${BPN}-helpers = "Midnight Commander shell helper scripts"
-FILES_${BPN}-helpers = "${libexecdir}/mc/extfs.d/* ${libexecdir}/mc/ext.d/*"
-
-SUMMARY_${BPN}-fish = "Midnight Commander Fish scripts"
-FILES_${BPN}-fish = "${libexecdir}/mc/fish"
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.17.bb b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.17.bb
deleted file mode 100644
index a5c4ece..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.17.bb
+++ /dev/null
@@ -1,49 +0,0 @@
-SUMMARY = "Midnight Commander is an ncurses based file manager"
-HOMEPAGE = "http://www.midnight-commander.org/"
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=270bbafe360e73f9840bd7981621f9c2"
-SECTION = "console/utils"
-DEPENDS = "ncurses glib-2.0 util-linux"
-RDEPENDS_${PN} = "ncurses-terminfo"
-
-SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
-           "
-SRC_URI[md5sum] = "6e9c07066e40af06b263a13fad17a07f"
-SRC_URI[sha256sum] = "66d0cb37baaed8ef930f8ad25a634adad4f264eb61820893920ac87b9dfb783b"
-
-inherit autotools gettext pkgconfig
-
-#
-# Both Samba (smb) and sftp require package delivered from meta-openembedded
-#
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[smb] = "--enable-vfs-smb,--disable-vfs-smb,samba,"
-PACKAGECONFIG[sftp] = "--enable-vfs-sftp,--disable-vfs-sftp,libssh2,"
-
-EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x"
-
-do_install_append () {
-	sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
-	sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
-}
-
-PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers-python ${BPN}-helpers ${BPN}-fish"
-
-SUMMARY_${BPN}-helpers-perl = "Midnight Commander Perl-based helper scripts"
-FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs.d/apt+ \
-                             ${libexecdir}/mc/extfs.d/deb ${libexecdir}/mc/extfs.d/deba \
-                             ${libexecdir}/mc/extfs.d/debd ${libexecdir}/mc/extfs.d/dpkg+ \
-                             ${libexecdir}/mc/extfs.d/mailfs ${libexecdir}/mc/extfs.d/patchfs \ 
-                             ${libexecdir}/mc/extfs.d/rpms+ ${libexecdir}/mc/extfs.d/ulib \ 
-                             ${libexecdir}/mc/extfs.d/uzip"
-RDEPENDS_${BPN}-helpers-perl = "perl"
-
-SUMMARY_${BPN}-helpers-python = "Midnight Commander Python-based helper scripts"
-FILES_${BPN}-helpers-python = "${libexecdir}/mc/extfs.d/s3+ ${libexecdir}/mc/extfs.d/uc1541"
-RDEPENDS_${BPN}-helpers-python = "python"
-
-SUMMARY_${BPN}-helpers = "Midnight Commander shell helper scripts"
-FILES_${BPN}-helpers = "${libexecdir}/mc/extfs.d/* ${libexecdir}/mc/ext.d/*"
-
-SUMMARY_${BPN}-fish = "Midnight Commander Fish scripts"
-FILES_${BPN}-fish = "${libexecdir}/mc/fish"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.18.bb b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.18.bb
new file mode 100644
index 0000000..17f3f73
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.18.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Midnight Commander is an ncurses based file manager"
+HOMEPAGE = "http://www.midnight-commander.org/"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=270bbafe360e73f9840bd7981621f9c2"
+SECTION = "console/utils"
+DEPENDS = "ncurses glib-2.0 util-linux"
+RDEPENDS_${PN} = "ncurses-terminfo"
+
+SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
+           file://0001-mc-replace-perl-w-with-use-warnings.patch \
+           "
+SRC_URI[md5sum] = "cc56f0c9abd63c4caa3636bba3a08bfb"
+SRC_URI[sha256sum] = "5b591e10dcbea95233434da40cdad4663d360229adf89826576c319667c103cb"
+
+inherit autotools gettext pkgconfig
+
+#
+# Both Samba (smb) and sftp require package delivered from meta-openembedded
+#
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[smb] = "--enable-vfs-smb,--disable-vfs-smb,samba,"
+PACKAGECONFIG[sftp] = "--enable-vfs-sftp,--disable-vfs-sftp,libssh2,"
+
+EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
+
+do_install_append () {
+	sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
+	sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
+}
+
+PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers-python ${BPN}-helpers ${BPN}-fish"
+
+SUMMARY_${BPN}-helpers-perl = "Midnight Commander Perl-based helper scripts"
+FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs.d/apt+ \
+                             ${libexecdir}/mc/extfs.d/deb ${libexecdir}/mc/extfs.d/deba \
+                             ${libexecdir}/mc/extfs.d/debd ${libexecdir}/mc/extfs.d/dpkg+ \
+                             ${libexecdir}/mc/extfs.d/mailfs ${libexecdir}/mc/extfs.d/patchfs \ 
+                             ${libexecdir}/mc/extfs.d/rpms+ ${libexecdir}/mc/extfs.d/ulib \ 
+                             ${libexecdir}/mc/extfs.d/uzip"
+RDEPENDS_${BPN}-helpers-perl = "perl"
+
+SUMMARY_${BPN}-helpers-python = "Midnight Commander Python-based helper scripts"
+FILES_${BPN}-helpers-python = "${libexecdir}/mc/extfs.d/s3+ ${libexecdir}/mc/extfs.d/uc1541"
+RDEPENDS_${BPN}-helpers-python = "python"
+
+SUMMARY_${BPN}-helpers = "Midnight Commander shell helper scripts"
+FILES_${BPN}-helpers = "${libexecdir}/mc/extfs.d/* ${libexecdir}/mc/ext.d/*"
+
+SUMMARY_${BPN}-fish = "Midnight Commander Fish scripts"
+FILES_${BPN}-fish = "${libexecdir}/mc/fish"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch
deleted file mode 100644
index f829467..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 835baf02fd42012bbc0603dffb1f80c6ecf0fb9e Mon Sep 17 00:00:00 2001
-From: Xiao Ni <xni@redhat.com>
-Date: Mon, 8 Feb 2016 11:18:52 +0200
-Subject: [PATCH] Fix some type comparison problems
-
-As 26714713cd2bad9e0bf7f4669f6cc4659ceaab6c said, 32 bit signed
-timestamps will overflow in the year 2038. It already changed the
-utime and ctime in struct mdu_array_info_s from int to unsigned
-int. So we need to change the values that compared with them to
-unsigned int too.
-
-Upstream-Status: Backport
-
-Signed-off-by: : Xiao Ni <xni@redhat.com>
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
-
- Monitor.c | 2 +-
- util.c    | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Monitor.c b/Monitor.c
-index f19c2e5..6df80f9 100644
---- a/Monitor.c
-+++ b/Monitor.c
-@@ -33,7 +33,7 @@
- struct state {
- 	char *devname;
- 	char devnm[32];	/* to sync with mdstat info */
--	long utime;
-+	unsigned int utime;
- 	int err;
- 	char *spare_group;
- 	int active, working, failed, spare, raid;
-diff --git a/util.c b/util.c
-index 3e6d293..96a806d 100644
---- a/util.c
-+++ b/util.c
-@@ -1267,7 +1267,7 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)
- 	 */
- 	struct superswitch  *ss;
- 	struct supertype *st;
--	time_t besttime = 0;
-+	unsigned int besttime = 0;
- 	int bestsuper = -1;
- 	int i;
- 
--- 
-2.4.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
index deb7486..a891614 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
@@ -10,6 +10,17 @@
 
 Signed-off-by: Maxin B. John <maxin.john@intel.com>
 ---
+mdadm only works with corosync 2.x which provides header file corosync/cmap.h.
+If build mdadm with corosync 1.x, it fails with:
+
+| member.c:12:27: fatal error: corosync/cmap.h: No such file or directory
+|  #include <corosync/cmap.h>
+|                            ^
+
+Build with corosync only header file corosync/cmap.h exists.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
  Makefile | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
@@ -23,7 +34,7 @@
  
 -COROSYNC:=$(shell [ -d /usr/include/corosync ] || echo -DNO_COROSYNC)
 -DLM:=$(shell [ -f /usr/include/libdlm.h ] || echo -DNO_DLM)
-+COROSYNC:=$(shell [ -d $(SYSROOT)/usr/include/corosync ] || echo -DNO_COROSYNC)
++COROSYNC:=$(shell [ -f $(SYSROOT)/usr/include/corosync/cmap.h ] || echo -DNO_COROSYNC)
 +DLM:=$(shell [ -f $(SYSROOT)/usr/include/libdlm.h ] || echo -DNO_DLM)
  
  DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch
deleted file mode 100644
index df70b1c..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 18d360d74271a066a849bc1fba4f10dbb23ed251 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 8 Sep 2015 08:17:42 +0000
-Subject: [PATCH] Fix typo in comparision
-
-error: comparison of array 'devnm' equal to a null pointer is always false
-
-User bitwise '&' operator as it is a mask
-
-Fixes
-error: use of logical '&&' with constant operand
-
-Remove extraneous parens
-
-error: equality comparison with extraneous parentheses
-
-Remove dead code
-
-restripe.c:465:21: error: explicitly assigning value of variable of type 'int' to itself
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- mdmon.h       | 2 +-
- mdopen.c      | 2 +-
- restripe.c    | 3 ---
- super-intel.c | 2 +-
- 4 files changed, 3 insertions(+), 6 deletions(-)
-
-diff --git a/mdmon.h b/mdmon.h
-index aa750c6..0b08c3d 100644
---- a/mdmon.h
-+++ b/mdmon.h
-@@ -101,7 +101,7 @@ static inline int is_resync_complete(struct mdinfo *array)
- 		break;
- 	case 10:
- 		l = array->array.layout;
--		ncopies = (l & 0xff) * ((l >> 8) && 0xff);
-+		ncopies = (l & 0xff) * ((l >> 8) & 0xff);
- 		sync_size = array->component_size * array->array.raid_disks;
- 		sync_size /= ncopies;
- 		break;
-diff --git a/mdopen.c b/mdopen.c
-index 28410f4..c5ee2a6 100644
---- a/mdopen.c
-+++ b/mdopen.c
-@@ -318,7 +318,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
- 	else if (num < 0) {
- 		/* need to choose a free number. */
- 		char *_devnm = find_free_devnm(use_mdp);
--		if (devnm == NULL) {
-+		if (_devnm == NULL) {
- 			pr_err("No avail md devices - aborting\n");
- 			return -1;
- 		}
-diff --git a/restripe.c b/restripe.c
-index 4d92190..cfe9666 100644
---- a/restripe.c
-+++ b/restripe.c
-@@ -461,9 +461,6 @@ int raid6_check_disks(int data_disks, int start, int chunk_size,
- 			curr_broken_disk = diskD;
- 		}
- 
--		if((Px == 0) && (Qx == 0))
--			curr_broken_disk = curr_broken_disk;
--
- 		if(curr_broken_disk >= data_disks + 2)
- 			broken_status = 2;
- 
-diff --git a/super-intel.c b/super-intel.c
-index 3f812d6..1838012 100644
---- a/super-intel.c
-+++ b/super-intel.c
-@@ -10027,7 +10027,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
- 				geo->size = max_size;
- 		}
- 
--		if ((direction == ROLLBACK_METADATA_CHANGES)) {
-+		if (direction == ROLLBACK_METADATA_CHANGES) {
- 			/* accept size for rollback only
- 			*/
- 		} else {
--- 
-2.5.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch
new file mode 100644
index 0000000..acd64ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch
@@ -0,0 +1,48 @@
+From 943616e5dffb79f307e4bd9b249d316212998750 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 18 Dec 2016 08:30:51 +0000
+Subject: [PATCH] include <sys/sysmacros.h> for major/minor defintions
+
+glibc 2.25 is warning about it if applications depend on
+sys/types.h for these macros, it expects to be included
+from <sys/sysmacros.h>
+
+Fixes
+| Grow.c:3534:13: error: In the GNU C Library, "minor" is defined
+|  by <sys/sysmacros.h>. For historical compatibility, it is
+|  currently defined by <sys/types.h> as well, but we plan to
+|  remove this soon. To use "minor", include <sys/sysmacros.h>
+|  directly. If you did not intend to use a system-defined macro
+|  "minor", you should undefine it after including <sys/types.h>. [-Werror]
+| Query.c: In function 'Query':
+| Query.c:105:13: error: In the GNU C Library, "makedev" is defined
+|  by <sys/sysmacros.h>. For historical compatibility, it is
+|  currently defined by <sys/types.h> as well, but we plan to
+|  remove this soon. To use "makedev", include <sys/sysmacros.h>
+|  directly. If you did not intend to use a system-defined macro
+|  "makedev", you should undefine it after including <sys/types.h>. [-Werror]
+|           makedev((unsigned)disc.major,(unsigned)disc.minor) == stb.st_rdev)
+|              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ mdadm.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/mdadm.h b/mdadm.h
+index 8c8f4d1..3ce13b5 100755
+--- a/mdadm.h
++++ b/mdadm.h
+@@ -34,6 +34,7 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
+ #endif
+ 
+ #include	<sys/types.h>
++#include	<sys/sysmacros.h>
+ #include	<sys/stat.h>
+ #include	<stdint.h>
+ #include	<stdlib.h>
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch
deleted file mode 100644
index 1395473..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From cf14a9987ea1040457ce53bc2ab7d096818cb780 Mon Sep 17 00:00:00 2001
-From: "Maxin B. John" <maxin.john@intel.com>
-Date: Fri, 5 Feb 2016 18:06:32 +0200
-Subject: [PATCH] mdadm.h: bswap is already defined in uclibc
-
-Fixes this build error:
-
-| In file included from mdadm.c:28:0:
-| mdadm.h:142:0: error: "bswap_16" redefined [-Werror]
-|  #define bswap_16(x) (((x) & 0x00ffU) << 8 | \
-|  ^
-
-Upstream-Status: Submitted
-
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
- mdadm.h | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/mdadm.h b/mdadm.h
-index dd02be7..230e60f 100755
---- a/mdadm.h
-+++ b/mdadm.h
-@@ -139,12 +139,20 @@ struct dlm_lksb {
-  * and there is no standard conversion function so... */
- /* And dietlibc doesn't think byteswap is ok, so.. */
- /*  #include <byteswap.h> */
-+
-+#ifndef bswap_16
- #define bswap_16(x) (((x) & 0x00ffU) << 8 | \
- 		     ((x) & 0xff00U) >> 8)
-+#endif
-+
-+#ifndef bswap_32
- #define bswap_32(x) (((x) & 0x000000ffU) << 24 | \
- 		     ((x) & 0xff000000U) >> 24 | \
- 		     ((x) & 0x0000ff00U) << 8  | \
- 		     ((x) & 0x00ff0000U) >> 8)
-+#endif
-+
-+#ifndef bswap_64
- #define bswap_64(x) (((x) & 0x00000000000000ffULL) << 56 | \
- 		     ((x) & 0xff00000000000000ULL) >> 56 | \
- 		     ((x) & 0x000000000000ff00ULL) << 40 | \
-@@ -153,6 +161,7 @@ struct dlm_lksb {
- 		     ((x) & 0x0000ff0000000000ULL) >> 24 | \
- 		     ((x) & 0x00000000ff000000ULL) << 8 | \
- 		     ((x) & 0x000000ff00000000ULL) >> 8)
-+#endif
- 
- #if !defined(__KLIBC__)
- #if BYTE_ORDER == LITTLE_ENDIAN
--- 
-2.4.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-raid6check-Fix-if-else-indentation.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-raid6check-Fix-if-else-indentation.patch
deleted file mode 100644
index 0b34b84..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-raid6check-Fix-if-else-indentation.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 1b0aa1debf6fbe9923c9aac671d2894f76c32f9d Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 20 Apr 2016 16:38:13 +0000
-Subject: [PATCH] raid6check: Fix if-else indentation
-
-gcc 6 warns about ambiguity due to this indentation
-| raid6check.c: In function 'manual_repair':
-| raid6check.c:267:4: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
-|     else
-|     ^~~~
-| raid6check.c:269:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
-|      printf("Repairing D(%d) and P\n", failed_data);
-|      ^~~~~~
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Submitted
-
- raid6check.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/raid6check.c b/raid6check.c
-index ad7ffe7..409b1b6 100644
---- a/raid6check.c
-+++ b/raid6check.c
-@@ -266,7 +266,7 @@ int manual_repair(int chunk_size, int syndrome_disks,
- 				failed_data = failed_slot2;
- 			else
- 				failed_data = failed_slot1;
--				printf("Repairing D(%d) and P\n", failed_data);
-+			printf("Repairing D(%d) and P\n", failed_data);
- 			raid6_datap_recov(syndrome_disks+2, chunk_size,
- 					  failed_data, (uint8_t**)blocks, 1);
- 		} else {
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch
deleted file mode 100644
index d5cf003..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 2645673a7ea948a1297d5b8f0daab29b898f044f Mon Sep 17 00:00:00 2001
-From: "Maxin B. John" <maxin.john@intel.com>
-Date: Fri, 5 Feb 2016 17:14:04 +0200
-Subject: [PATCH] util.c: include poll.h instead of sys/poll.h
-
-This fixes a compile warning when building with musl:
-
- In file included from util.c:27:0:
- |
- qemux86-64/usr/include/sys/poll.h:1:2:
- error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
- [-Werror=cpp]
- |  #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
- |   ^
-
-Upstream-Status: Accepted
-
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
- util.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/util.c b/util.c
-index 970d484..3e6d293 100644
---- a/util.c
-+++ b/util.c
-@@ -24,7 +24,6 @@
- 
- #include	"mdadm.h"
- #include	"md_p.h"
--#include	<sys/poll.h>
- #include	<sys/socket.h>
- #include	<sys/utsname.h>
- #include	<sys/wait.h>
-@@ -32,6 +31,7 @@
- #include	<sys/resource.h>
- #include	<sys/vfs.h>
- #include	<linux/magic.h>
-+#include	<poll.h>
- #include	<ctype.h>
- #include	<dirent.h>
- #include	<signal.h>
--- 
-2.4.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch
deleted file mode 100644
index 84c382d..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Upstream-Status: Accepted
-
-By hardcoding CC's definition in the Makefile, all the gcc parameters 
-set by tune settings are lost. Causing compile failure with x32 toolchain
-
-As the bitbake defined CC is good, there is no need to redfine CC in the 
-make file, hence making the CC definition in the Makefile conditional.
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/07
-
-Index: mdadm-3.3/Makefile
-===================================================================
---- mdadm-3.3.orig/Makefile	2013-09-03 07:47:47.000000000 +0300
-+++ mdadm-3.3/Makefile	2013-10-16 16:44:23.542295487 +0300
-@@ -41,7 +41,7 @@
- 
- KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
- 
--CC = $(CROSS_COMPILE)gcc
-+CC ?= $(CROSS_COMPILE)gcc
- CXFLAGS ?= -ggdb
- CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
- ifdef WARN_UNUSED
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb b/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb
deleted file mode 100644
index 261054e..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb
+++ /dev/null
@@ -1,75 +0,0 @@
-SUMMARY = "Tool for managing software RAID under Linux"
-HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/"
-
-# Some files are GPLv2+ while others are GPLv2.
-LICENSE = "GPLv2 & GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \
-                    file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161"
-
-
-SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
-           file://mdadm-3.2.2_fix_for_x32.patch \
-           file://gcc-4.9.patch \
-           file://mdadm-3.3.2_x32_abi_time_t.patch \
-           file://0001-Fix-typo-in-comparision.patch \
-           file://mdadm-fix-ptest-build-errors.patch \
-           file://0001-util.c-include-poll.h-instead-of-sys-poll.h.patch \
-           file://0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch \
-           file://0001-Fix-some-type-comparison-problems.patch \
-           file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \
-           file://run-ptest \
-           file://0001-raid6check-Fix-if-else-indentation.patch \
-           file://0001-mdadm.h-Undefine-dprintf-before-redefining.patch \
-           "
-SRC_URI[md5sum] = "04b8b21f637540350f8517c7e68d3c63"
-SRC_URI[sha256sum] = "27d0be4627d38a12ddcd1c1c3721d649d4e89e1093914497e22b57245cda8808"
-
-CFLAGS += "-fno-strict-aliasing"
-inherit autotools-brokensep
-
-EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"'
-# PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h
-# prevents 64-bit userland from seeing this definition, instead defaulting
-# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get
-# int-ll64.h included
-CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__'
-CFLAGS_append_mips64 = ' -D__SANE_USERSPACE_TYPES__'
-CFLAGS_append_mips64n32 = ' -D__SANE_USERSPACE_TYPES__'
-
-do_compile() {
-	oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
-}
-
-do_install() {
-	export STRIP=""
-	autotools_do_install
-}
-
-inherit ptest
-
-do_compile_ptest() {
-	oe_runmake test
-}
-
-do_install_ptest() {
-	cp -a ${S}/tests ${D}${PTEST_PATH}/tests
-	cp ${S}/test ${D}${PTEST_PATH}
-	sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
-	ln -s /sbin/mdadm ${D}${PTEST_PATH}/mdadm
-	for prg in test_stripe swap_super raid6check
-	do
-		install -D -m 755 $prg ${D}${PTEST_PATH}/
-	done
-}
-RDEPENDS_${PN}-ptest += "bash"
-RRECOMMENDS_${PN}-ptest += " \
-    coreutils \
-    util-linux \
-    kernel-module-loop \
-    kernel-module-linear \
-    kernel-module-raid0 \
-    kernel-module-raid1 \
-    kernel-module-raid10 \
-    kernel-module-raid456 \
-"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_4.0.bb b/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_4.0.bb
new file mode 100644
index 0000000..62614f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_4.0.bb
@@ -0,0 +1,72 @@
+SUMMARY = "Tool for managing software RAID under Linux"
+HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/"
+
+# Some files are GPLv2+ while others are GPLv2.
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \
+                    file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161"
+
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
+           file://gcc-4.9.patch \
+           file://mdadm-3.3.2_x32_abi_time_t.patch \
+           file://mdadm-fix-ptest-build-errors.patch \
+           file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \
+           file://run-ptest \
+           file://0001-mdadm.h-Undefine-dprintf-before-redefining.patch \
+           file://0001-include-sys-sysmacros.h-for-major-minor-defintions.patch \
+           "
+SRC_URI[md5sum] = "2cb4feffea9167ba71b5f346a0c0a40d"
+SRC_URI[sha256sum] = "1d6ae7f24ced3a0fa7b5613b32f4a589bb4881e3946a5a2c3724056254ada3a9"
+
+CFLAGS += "-fno-strict-aliasing"
+inherit autotools-brokensep
+
+EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"'
+# PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h
+# prevents 64-bit userland from seeing this definition, instead defaulting
+# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get
+# int-ll64.h included
+CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__'
+CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__'
+CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__'
+
+do_compile() {
+	# Point to right sbindir
+	sed -i -e "s;BINDIR  = /sbin;BINDIR = $base_sbindir;" ${S}/Makefile
+	oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
+}
+
+do_install() {
+	export STRIP=""
+	autotools_do_install
+}
+
+inherit ptest
+
+do_compile_ptest() {
+	oe_runmake test
+}
+
+do_install_ptest() {
+	cp -a ${S}/tests ${D}${PTEST_PATH}/tests
+	cp ${S}/test ${D}${PTEST_PATH}
+	sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
+	ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm
+	for prg in test_stripe swap_super raid6check
+	do
+		install -D -m 755 $prg ${D}${PTEST_PATH}/
+	done
+}
+RDEPENDS_${PN}-ptest += "bash"
+RRECOMMENDS_${PN}-ptest += " \
+    coreutils \
+    util-linux \
+    kernel-module-loop \
+    kernel-module-linear \
+    kernel-module-raid0 \
+    kernel-module-raid1 \
+    kernel-module-raid10 \
+    kernel-module-raid456 \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb b/import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb
index 9accc6e..e8ae5c6 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb
@@ -20,9 +20,11 @@
 EXTRA_OECONF = "--with-libc"
 
 do_install_append () {
-	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
-	rmdir ${D}${bindir}
+	if [ "${base_bindir}" != "${bindir}" ] ; then
+		install -d ${D}${base_bindir}
+		mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
+		rmdir ${D}${bindir}
+	fi
 }
 
 ALTERNATIVE_${PN} = "mktemp"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.5.bb b/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.5.bb
deleted file mode 100644
index d0c39eb..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.5.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-SUMMARY = "msmtp is an SMTP client"
-DESCRIPTION = "A sendmail replacement for use in MTAs like mutt"
-HOMEPAGE = "http://msmtp.sourceforge.net/"
-SECTION = "console/network"
-
-LICENSE = "GPLv3"
-DEPENDS = "zlib gnutls"
-
-#COPYING or Licence
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-SRC_URI = "http://sourceforge.net/projects/msmtp/files/msmtp/${PV}/${BPN}-${PV}.tar.xz \
-          "
-
-SRC_URI[md5sum] = "50a8c9bb72f8222779db6b4aae2965e0"
-SRC_URI[sha256sum] = "76a0d60693c7e65d0c7a12f01d300882d280b1e1be0202f54730ae44d44a5006"
-
-inherit gettext autotools update-alternatives pkgconfig
-
-EXTRA_OECONF += "--without-libsecret --without-libgsasl --without-libidn"
-
-ALTERNATIVE_${PN} = "sendmail"
-ALTERNATIVE_TARGET[sendmail] = "${bindir}/msmtp"
-ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
-ALTERNATIVE_PRIORITY = "100"
-
-pkg_postinst_${PN}_linuxstdbase () {
-	# /usr/lib/sendmial is required by LSB core test
-	[ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.6.bb b/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.6.bb
new file mode 100644
index 0000000..e172193
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.6.bb
@@ -0,0 +1,30 @@
+SUMMARY = "msmtp is an SMTP client"
+DESCRIPTION = "A sendmail replacement for use in MTAs like mutt"
+HOMEPAGE = "http://msmtp.sourceforge.net/"
+SECTION = "console/network"
+
+LICENSE = "GPLv3"
+DEPENDS = "zlib gnutls"
+
+#COPYING or Licence
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "http://sourceforge.net/projects/msmtp/files/msmtp/${PV}/${BPN}-${PV}.tar.xz \
+          "
+
+SRC_URI[md5sum] = "82b0520b57db4b2cf05333d11fb5974d"
+SRC_URI[sha256sum] = "da15db1f62bd0201fce5310adb89c86188be91cd745b7cb3b62b81a501e7fb5e"
+
+inherit gettext autotools update-alternatives pkgconfig
+
+EXTRA_OECONF += "--without-libsecret --without-libgsasl --without-libidn"
+
+ALTERNATIVE_${PN} = "sendmail"
+ALTERNATIVE_TARGET[sendmail] = "${bindir}/msmtp"
+ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
+ALTERNATIVE_PRIORITY = "100"
+
+pkg_postinst_${PN}_linuxstdbase () {
+	# /usr/lib/sendmial is required by LSB core test
+	[ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
index 47a68a5..45d7bf4 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
@@ -75,6 +75,10 @@
 	# we pre-generate desired options and copy to source directory instead
 	cp ${WORKDIR}/net-tools-config.h    ${S}/config.h
 	cp ${WORKDIR}/net-tools-config.make ${S}/config.make
+
+	if [ "${USE_NLS}" = "no" ]; then
+		sed -i -e 's/^I18N=1/# I18N=1/' ${S}/config.make
+	fi
 }
 
 do_compile() {
@@ -93,6 +97,17 @@
 	unset CFLAGS
 	unset LDFLAGS
 	oe_runmake 'BASEDIR=${D}' install
+
+	if [ "${base_bindir}" != "/bin" ]; then
+		mkdir -p ${D}/${base_bindir}
+		mv ${D}/bin/* ${D}/${base_bindir}/
+		rmdir ${D}/bin
+	fi
+	if [ "${base_sbindir}" != "/sbin" ]; then
+		mkdir ${D}/${base_sbindir}
+		mv ${D}/sbin/* ${D}/${base_sbindir}/
+		rmdir ${D}/sbin
+	fi
 }
 
 inherit update-alternatives
@@ -101,15 +116,17 @@
 base_bindir_progs  = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname"
 
 ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}"
-ALTERNATIVE_${PN}-doc += "hostname.1"
+ALTERNATIVE_${PN}-doc += "hostname.1 dnsdomainname.1"
 ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
+ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1"
 ALTERNATIVE_PRIORITY[hostname.1] = "10"
 
 python __anonymous() {
-	for prog in d.getVar('base_sbindir_progs', True).split():
-		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
-	for prog in d.getVar('base_bindir_progs', True).split():
-		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+	for prog in d.getVar('base_sbindir_progs').split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog))
+	for prog in d.getVar('base_bindir_progs').split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
 }
 ALTERNATIVE_PRIORITY = "100"
 
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
index a60a68c..d8975f2 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
@@ -31,7 +31,7 @@
     namemap["packagegroup-core-full-cmdline-initscripts"] = "packagegroup-core-initscripts"
     namemap["packagegroup-core-full-cmdline-sys-services"] = "packagegroup-core-sys-services"
 
-    packages = d.getVar("PACKAGES", True).split()
+    packages = d.getVar("PACKAGES").split()
     for pkg in packages:
         if pkg.endswith('-dev'):
             mapped = namemap.get(pkg[:-4], None)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
index 29564e0..a156bcb 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
@@ -11,13 +11,16 @@
 # The libxt, libxtst and others require x11 in DISTRO_FEATURES
 REQUIRED_DISTRO_FEATURES = "x11"
 
+# libglu needs virtual/libgl, which requires opengl in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES += "opengl"
+
 #
 # We will skip parsing this packagegeoup for non-glibc systems
 #
 python __anonymous () {
-    if d.getVar('TCLIBC', True) != "glibc":
+    if d.getVar('TCLIBC') != "glibc":
         raise bb.parse.SkipPackage("incompatible with %s C library" %
-                                   d.getVar('TCLIBC', True))
+                                   d.getVar('TCLIBC'))
 }
 
 PACKAGES = "\
@@ -222,6 +225,8 @@
                 'libraries. Its intended use is for passing LSB tests as Qt4 is ' \
                 'a requirement for LSB.')
     return ''
+# We don't want this to rebuild every time you change your layer config
+get_libqt4[vardepsexclude] += "BBFILE_COLLECTIONS"
 
 SUMMARY_packagegroup-core-lsb-desktop = "LSB Desktop"
 DESCRIPTION_packagegroup-core-lsb-desktop = "Packages required to support libraries \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.3.0.bb b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.3.0.bb
index bb5a4bd..df56d27 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.3.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.3.0.bb
@@ -62,7 +62,7 @@
 PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*"
 
 def get_multilib_bit(d):
-    baselib = d.getVar('baselib', True) or ''
+    baselib = d.getVar('baselib') or ''
     return baselib.replace('lib', '')
 
 libpam_suffix = "suffix${@get_multilib_bit(d)}"
@@ -92,31 +92,31 @@
 python populate_packages_prepend () {
     def pam_plugin_append_file(pn, dir, file):
         nf = os.path.join(dir, file)
-        of = d.getVar('FILES_' + pn, True)
+        of = d.getVar('FILES_' + pn)
         if of:
             nf = of + " " + nf
         d.setVar('FILES_' + pn, nf)
 
     def pam_plugin_hook(file, pkg, pattern, format, basename):
-        pn = d.getVar('PN', True)
-        libpam_suffix = d.getVar('libpam_suffix', True)
+        pn = d.getVar('PN')
+        libpam_suffix = d.getVar('libpam_suffix')
 
-        rdeps = d.getVar('RDEPENDS_' + pkg, True)
+        rdeps = d.getVar('RDEPENDS_' + pkg)
         if rdeps:
             rdeps = rdeps + " " + pn + "-" + libpam_suffix
         else:
             rdeps = pn + "-" + libpam_suffix
         d.setVar('RDEPENDS_' + pkg, rdeps)
 
-        provides = d.getVar('RPROVIDES_' + pkg, True)
+        provides = d.getVar('RPROVIDES_' + pkg)
         if provides:
             provides = provides + " " + pkg + "-" + libpam_suffix
         else:
             provides = pkg + "-" + libpam_suffix
         d.setVar('RPROVIDES_' + pkg, provides)
 
-    mlprefix = d.getVar('MLPREFIX', True) or ''
-    dvar = bb.data.expand('${WORKDIR}/package', d, True)
+    mlprefix = d.getVar('MLPREFIX') or ''
+    dvar = d.expand('${WORKDIR}/package')
     pam_libdir = d.expand('${base_libdir}/security')
     pam_sbindir = d.expand('${sbindir}')
     pam_filterdir = d.expand('${base_libdir}/security/pam_filter')
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch
new file mode 100644
index 0000000..bd2b5c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch
@@ -0,0 +1,34 @@
+From 5c99d7e4c2b5e7a957dc922aff03debfebbd6154 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 3 Mar 2017 21:49:15 +0100
+Subject: [PATCH] libparted_fs_resize: link against libuuid explicitly to
+ unbreak gold linking on test
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| ../libparted/fs/.libs/libparted-fs-resize.so: error: undefined reference to 'uuid_generate'
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ libparted/fs/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am
+index d3cc8bc..c301b0b 100644
+--- a/libparted/fs/Makefile.am
++++ b/libparted/fs/Makefile.am
+@@ -113,6 +113,8 @@ libparted_fs_resize_la_SOURCES = \
+   r/hfs/reloc_plus.c		\
+   r/hfs/reloc_plus.h
+ 
++libparted_fs_resize_la_LIBADD   = $(UUID_LIBS)
++
+ AM_CPPFLAGS = \
+   -I$(top_srcdir)/libparted/labels	\
+   $(partedincludedir)			\
+-- 
+2.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/parted/parted-3.2-sysmacros.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/parted/parted-3.2-sysmacros.patch
new file mode 100644
index 0000000..211e6c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/parted/parted-3.2-sysmacros.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/580022
+
+From dec8995fe80508374beba6356f6ecbba8ef6b18b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 21 Jun 2016 15:01:08 -0400
+Subject: [PATCH] include sysmacros.h for major/minor/makedev
+
+Linux C libs are moving away from including this header implicitly via
+sys/types.h, so include it explicitly.
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+---
+ libparted/arch/linux.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
+index 326b95619d31..e5c168be3c68 100644
+--- a/libparted/arch/linux.c
++++ b/libparted/arch/linux.c
+@@ -37,6 +37,7 @@
+ #include <dirent.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/utsname.h>        /* for uname() */
+ #include <scsi/scsi.h>
+-- 
+2.8.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb b/import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb
index 30c00c8..9ce2dfe 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb
@@ -13,6 +13,8 @@
            file://fix-compile-failure-while-dis.patch \
            file://0001-Include-fcntl.h-in-platform_defs.h.patch \
            file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           file://0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch \
+	   file://parted-3.2-sysmacros.patch \
            file://run-ptest \
            file://Makefile \
 "
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-include-sys-sysmacros.h-for-major-minor-definitions.patch b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-include-sys-sysmacros.h-for-major-minor-definitions.patch
new file mode 100644
index 0000000..1d969bc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-include-sys-sysmacros.h-for-major-minor-definitions.patch
@@ -0,0 +1,65 @@
+From 7f4f379f8343c0ce92aa30f3f9037288a089a902 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 18 Dec 2016 08:24:56 +0000
+Subject: [PATCH] include <sys/sysmacros.h> for major/minor definitions
+
+glibc 2.25 will error out if the applications are expecting
+this to come from sys/types.h, it is being removed from
+there.
+
+Fixes
+
+error: In the GNU C Library, "minor" is defined
+|  by <sys/sysmacros.h>. For historical compatibility, it is
+|  currently defined by <sys/types.h> as well, but we plan to
+|  remove this soon. To use "minor", include <sys/sysmacros.h>
+|  directly. If you did not intend to use a system-defined macro
+|  "minor", you should undefine it after including <sys/types.h>. [-Werror]
+|        ul_oct ((u_long) MINOR (arcn->sb.st_rdev), hd->devminor,
+|              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/cpio.c     | 2 +-
+ src/gen_subs.c | 2 +-
+ src/tar.c      | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+Index: pax-3.4/src/cpio.c
+===================================================================
+--- pax-3.4.orig/src/cpio.c
++++ pax-3.4/src/cpio.c
+@@ -36,6 +36,7 @@
+ #include "config.h"
+ #endif
+ 
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/stat.h>
+Index: pax-3.4/src/gen_subs.c
+===================================================================
+--- pax-3.4.orig/src/gen_subs.c
++++ pax-3.4/src/gen_subs.c
+@@ -37,6 +37,7 @@
+ #include "config.h"
+ #endif
+ 
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/stat.h>
+Index: pax-3.4/src/tar.c
+===================================================================
+--- pax-3.4.orig/src/tar.c
++++ pax-3.4/src/tar.c
+@@ -37,6 +37,7 @@
+ #include "config.h"
+ #endif
+ 
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/stat.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb b/import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb
index 9d1abfb..9b4e17b 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb
@@ -16,7 +16,9 @@
 
 SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.bz2/fbd9023b590b45ac3ade95870702a0d6/${BP}.tar.bz2 \
 	file://fix_for_compile_with_gcc-4.6.0.patch \
-	file://pax-3.4_fix_for_x32.patch"
+	file://pax-3.4_fix_for_x32.patch \
+        file://0001-include-sys-sysmacros.h-for-major-minor-definitions.patch \
+"
 
 SRC_URI_append_libc-musl = " file://0001-Fix-build-with-musl.patch \
                              file://0001-use-strtoll-instead-of-strtoq.patch \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc
index 86f434c..978f905 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc
+++ b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc
@@ -7,8 +7,6 @@
 SECTION = "console/utils"
 LICENSE = "Zlib & Apache-2.0"
 
-SRC_URI = "http://zlib.net/${BPN}/${BP}.tar.gz"
-
 PROVIDES_class-native += "gzip-native"
 
 DEPENDS = "zlib"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch
deleted file mode 100644
index 4becc0e..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-This patch avoids underlinking issues since we pass -lz via LDFLAGS but it appears
-before pigz.o which needs symbols from libz however due to order linker happily discards libz
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Index: pigz-2.3.3/Makefile
-===================================================================
---- pigz-2.3.3.orig/Makefile	2015-01-19 20:12:31.000000000 -0800
-+++ pigz-2.3.3/Makefile	2015-01-28 09:11:50.266669184 -0800
-@@ -5,7 +5,7 @@
- # use gcc and gmake on Solaris
- 
- pigz: pigz.o yarn.o try.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
--	$(CC) $(LDFLAGS) -o pigz $^ -lpthread -lm
-+	$(CC) -o pigz $^ $(LDFLAGS) -lz -lpthread -lm
- 	ln -f pigz unpigz
- 
- pigz.o: pigz.c yarn.h try.h ${ZOPFLI}deflate.h ${ZOPFLI}util.h
-@@ -35,7 +35,7 @@
- dev: pigz pigzt pigzn
- 
- pigzt: pigzt.o yarnt.o try.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
--	$(CC) $(LDFLAGS) -o pigzt $^ -lpthread -lm
-+	$(CC) -o pigzt $^ $(LDFLAGS) -lz -lpthread -lm
- 
- pigzt.o: pigz.c yarn.h try.h
- 	$(CC) $(CFLAGS) -DDEBUG -g -c -o pigzt.o pigz.c
-@@ -44,7 +44,7 @@
- 	$(CC) $(CFLAGS) -DDEBUG -g -c -o yarnt.o yarn.c
- 
- pigzn: pigzn.o tryn.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
--	$(CC) $(LDFLAGS) -o pigzn $^ -lm
-+	$(CC) -o pigzn $^ $(LDFLAGS) -lz -lm
- 
- pigzn.o: pigz.c try.h
- 	$(CC) $(CFLAGS) -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb
deleted file mode 100644
index 9e97273..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-require pigz.inc
-LIC_FILES_CHKSUM = "file://pigz.c;beginline=7;endline=21;md5=a21d4075cb00ab4ca17fce5e7534ca95"
-
-UPSTREAM_CHECK_URI := "${SRC_URI}"
-SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/${BP}.tar.gz"
-SRC_URI += "file://link-order.patch"
-
-SRC_URI[md5sum] = "01d7a16cce77929cc1a78aa1bdfb68cb"
-SRC_URI[sha256sum] = "4e8b67b432ce7907575a549f3e1cac4709781ba0f6b48afea9f59369846b509c"
-
-NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
-
-BBCLASSEXTEND = "native nativesdk"
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.4.bb b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.4.bb
new file mode 100644
index 0000000..f4832df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.4.bb
@@ -0,0 +1,11 @@
+require pigz.inc
+LIC_FILES_CHKSUM = "file://pigz.c;beginline=7;endline=21;md5=a21d4075cb00ab4ca17fce5e7534ca95"
+
+UPSTREAM_CHECK_URI = "http://zlib.net/${BPN}/"
+UPSTREAM_CHECK_REGEX = "pigz-(?P<pver>.*)\.tar"
+SRC_URI = "https://github.com/madler/pigz/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz"
+SRC_URI[md5sum] = "c109057050b15edf3eb9bb4d0805235e"
+SRC_URI[sha256sum] = "763f2fdb203aa0b7b640e63385e38e5dd4e5aaa041bc8e42aa96f2ef156b06e8"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb
index 0e51472..3032586 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb
@@ -15,10 +15,11 @@
 "
 UPSTREAM_CHECK_URI = "https://github.com/vasi/pixz/releases"
 
-EXTRA_OECONF += "--without-manpage"
+PACKAGECONFIG[manpages] = "--with-manpage, --without-manpage, asciidoc-native"
+
 CFLAGS_append_libc-musl = " -D_GNU_SOURCE"
 CACHED_CONFIGUREVARS += "ac_cv_file_src_pixz_1=no"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig manpages
 
 BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.12.bb b/import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.12.bb
index 4ca1a50..adabd75 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.12.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.12.bb
@@ -49,6 +49,7 @@
 base_sbindir_progs += "sysctl"
 
 ALTERNATIVE_PRIORITY = "200"
+ALTERNATIVE_PRIORITY[pidof] = "150"
 
 ALTERNATIVE_${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}"
 
@@ -57,10 +58,10 @@
 ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
 
 python __anonymous() {
-    for prog in d.getVar('base_bindir_progs', True).split():
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+    for prog in d.getVar('base_bindir_progs').split():
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
 
-    for prog in d.getVar('base_sbindir_progs', True).split():
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
+    for prog in d.getVar('base_sbindir_progs').split():
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog))
 }
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc
index 98a8470..22b2e85 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc
+++ b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc
@@ -15,7 +15,7 @@
 
 inherit autotools gettext
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
 ALLOW_EMPTY_${PN} = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb b/import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb
index 22aab41..28b3854 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb
@@ -22,6 +22,8 @@
 SRC_URI[md5sum] = "6b09f9c93515c25a528be5754cdfb6f5"
 SRC_URI[sha256sum] = "9c6c4d9ae7bf30506dd2aa3d8056c4ff2f8d087930d7c721616f5c093bdc674b"
 
+CVE_PRODUCT = "linux_diskquota"
+
 UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/linuxquota/files/quota-tools/"
 UPSTREAM_CHECK_REGEX = "/quota-tools/(?P<pver>(\d+[\.\-_]*)+)/"
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch
deleted file mode 100644
index eeef9f1..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch
+++ /dev/null
@@ -1,221 +0,0 @@
-From 2a44d862233f2126581e290d568e1c8b8f2eb9f5 Mon Sep 17 00:00:00 2001
-From: Carlo Landmeter <clandmeter@gmail.com>
-Date: Thu, 19 Feb 2015 15:28:45 +0000
-Subject: [PATCH] Avoid use of glibc sys/cdefs.h header
-
-Upstream-Status: Pending
----
- src/check_bound.c  |    2 +-
- src/pmap_svc.c     |   10 +++++-----
- src/rpcb_svc.c     |   10 +++++-----
- src/rpcb_svc_4.c   |   14 +++++++-------
- src/rpcb_svc_com.c |   46 +++++++++++++++++++++++-----------------------
- src/rpcbind.c      |   12 ++++++------
- src/util.c         |    2 +-
- src/warmstart.c    |    4 ++--
- 8 files changed, 50 insertions(+), 50 deletions(-)
-
-diff --git a/src/check_bound.c b/src/check_bound.c
-index c70b845..5d21730 100644
---- a/src/check_bound.c
-+++ b/src/check_bound.c
-@@ -70,7 +70,7 @@ static struct fdlist *fdhead;	/* Link list of the check fd's */
- static struct fdlist *fdtail;
- static char *nullstring = "";
- 
--static bool_t check_bound __P((struct fdlist *, char *uaddr));
-+static bool_t check_bound (struct fdlist *, char *uaddr);
- 
- /*
-  * Returns 1 if the given address is bound for the given addr & transport
-diff --git a/src/pmap_svc.c b/src/pmap_svc.c
-index ad28b93..9c7d409 100644
---- a/src/pmap_svc.c
-+++ b/src/pmap_svc.c
-@@ -60,11 +60,11 @@ static	char sccsid[] = "@(#)pmap_svc.c 1.23 89/04/05 Copyr 1984 Sun Micro";
- #include "rpcbind.h"
- #include "xlog.h"
- #include <rpc/svc_soc.h> /* svc_getcaller routine definition */
--static struct pmaplist *find_service_pmap __P((rpcprog_t, rpcvers_t,
--					       rpcprot_t));
--static bool_t pmapproc_change __P((struct svc_req *, SVCXPRT *, u_long));
--static bool_t pmapproc_getport __P((struct svc_req *, SVCXPRT *));
--static bool_t pmapproc_dump __P((struct svc_req *, SVCXPRT *));
-+static struct pmaplist *find_service_pmap (rpcprog_t, rpcvers_t,
-+					       rpcprot_t);
-+static bool_t pmapproc_change (struct svc_req *, SVCXPRT *, u_long);
-+static bool_t pmapproc_getport (struct svc_req *, SVCXPRT *);
-+static bool_t pmapproc_dump (struct svc_req *, SVCXPRT *);
- 
- /*
-  * Called for all the version 2 inquiries.
-diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c
-index bd92201..6c7f7fe 100644
---- a/src/rpcb_svc.c
-+++ b/src/rpcb_svc.c
-@@ -53,10 +53,10 @@
- #include "rpcbind.h"
- #include "xlog.h"
- 
--static void *rpcbproc_getaddr_3_local __P((void *, struct svc_req *, SVCXPRT *,
--					   rpcvers_t));
--static void *rpcbproc_dump_3_local __P((void *, struct svc_req *, SVCXPRT *,
--					rpcvers_t));
-+static void *rpcbproc_getaddr_3_local (void *, struct svc_req *, SVCXPRT *,
-+					   rpcvers_t);
-+static void *rpcbproc_dump_3_local (void *, struct svc_req *, SVCXPRT *,
-+					rpcvers_t);
- 
- /*
-  * Called by svc_getreqset. There is a separate server handle for
-@@ -75,7 +75,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
- 	} argument;
- 	char *result;
- 	xdrproc_t xdr_argument, xdr_result;
--	void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
-+	void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
- 	rpcprog_t setprog = 0;
- 
- 	rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc);
-diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c
-index b673452..6764c0a 100644
---- a/src/rpcb_svc_4.c
-+++ b/src/rpcb_svc_4.c
-@@ -54,13 +54,13 @@
- #include "rpcbind.h"
- #include "xlog.h"
- 
--static void *rpcbproc_getaddr_4_local __P((void *, struct svc_req *, SVCXPRT *,
--				      rpcvers_t));
--static void *rpcbproc_getversaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
-+static void *rpcbproc_getaddr_4_local (void *, struct svc_req *, SVCXPRT *,
-+				      rpcvers_t);
-+static void *rpcbproc_getversaddr_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
- static void *rpcbproc_getaddrlist_4_local
--	__P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
--static void free_rpcb_entry_list __P((rpcb_entry_list_ptr *));
--static void *rpcbproc_dump_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
-+	(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
-+static void free_rpcb_entry_list (rpcb_entry_list_ptr *);
-+static void *rpcbproc_dump_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
- 
- /*
-  * Called by svc_getreqset. There is a separate server handle for
-@@ -78,7 +78,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
- 	} argument;
- 	char *result;
- 	xdrproc_t xdr_argument, xdr_result;
--	void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
-+	void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
- 	rpcprog_t setprog = 0;
- 
- 	rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc);
-diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
-index ff9ce6b..8aef9e5 100644
---- a/src/rpcb_svc_com.c
-+++ b/src/rpcb_svc_com.c
-@@ -100,29 +100,29 @@ struct finfo {
- static struct finfo     FINFO[NFORWARD];
- 
- 
--static bool_t xdr_encap_parms __P((XDR *, struct encap_parms *));
--static bool_t xdr_rmtcall_args __P((XDR *, struct r_rmtcall_args *));
--static bool_t xdr_rmtcall_result __P((XDR *, struct r_rmtcall_args *));
--static bool_t xdr_opaque_parms __P((XDR *, struct r_rmtcall_args *));
--static int find_rmtcallfd_by_netid __P((char *));
--static SVCXPRT *find_rmtcallxprt_by_fd __P((int));
--static int forward_register __P((u_int32_t, struct netbuf *, int, char *,
--    rpcproc_t, rpcvers_t, u_int32_t *));
--static struct finfo *forward_find __P((u_int32_t));
--static int free_slot_by_xid __P((u_int32_t));
--static int free_slot_by_index __P((int));
--static int netbufcmp __P((struct netbuf *, struct netbuf *));
--static struct netbuf *netbufdup __P((struct netbuf *));
--static void netbuffree __P((struct netbuf *));
--static int check_rmtcalls __P((struct pollfd *, int));
--static void xprt_set_caller __P((SVCXPRT *, struct finfo *));
--static void send_svcsyserr __P((SVCXPRT *, struct finfo *));
--static void handle_reply __P((int, SVCXPRT *));
--static void find_versions __P((rpcprog_t, char *, rpcvers_t *, rpcvers_t *));
--static rpcblist_ptr find_service __P((rpcprog_t, rpcvers_t, char *));
--static char *getowner __P((SVCXPRT *, char *, size_t));
--static int add_pmaplist __P((RPCB *));
--static int del_pmaplist __P((RPCB *));
-+static bool_t xdr_encap_parms (XDR *, struct encap_parms *);
-+static bool_t xdr_rmtcall_args (XDR *, struct r_rmtcall_args *);
-+static bool_t xdr_rmtcall_result (XDR *, struct r_rmtcall_args *);
-+static bool_t xdr_opaque_parms (XDR *, struct r_rmtcall_args *);
-+static int find_rmtcallfd_by_netid (char *);
-+static SVCXPRT *find_rmtcallxprt_by_fd (int);
-+static int forward_register (u_int32_t, struct netbuf *, int, char *,
-+    rpcproc_t, rpcvers_t, u_int32_t *);
-+static struct finfo *forward_find (u_int32_t);
-+static int free_slot_by_xid (u_int32_t);
-+static int free_slot_by_index (int);
-+static int netbufcmp (struct netbuf *, struct netbuf *);
-+static struct netbuf *netbufdup (struct netbuf *);
-+static void netbuffree (struct netbuf *);
-+static int check_rmtcalls (struct pollfd *, int);
-+static void xprt_set_caller (SVCXPRT *, struct finfo *);
-+static void send_svcsyserr (SVCXPRT *, struct finfo *);
-+static void handle_reply (int, SVCXPRT *);
-+static void find_versions (rpcprog_t, char *, rpcvers_t *, rpcvers_t *);
-+static rpcblist_ptr find_service (rpcprog_t, rpcvers_t, char *);
-+static char *getowner (SVCXPRT *, char *, size_t);
-+static int add_pmaplist (RPCB *);
-+static int del_pmaplist (RPCB *);
- 
- /*
-  * Set a mapping of program, version, netid
-diff --git a/src/rpcbind.c b/src/rpcbind.c
-index 045daa1..137011b 100644
---- a/src/rpcbind.c
-+++ b/src/rpcbind.c
-@@ -135,13 +135,13 @@ char *tcp_uaddr;	/* Universal TCP address */
- static char servname[] = "rpcbind";
- static char superuser[] = "superuser";
- 
--int main __P((int, char *[]));
-+int main (int, char *[]);
- 
--static int init_transport __P((struct netconfig *));
--static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *,
--			     struct netbuf *));
--static void terminate __P((int));
--static void parseargs __P((int, char *[]));
-+static int init_transport (struct netconfig *);
-+static void rbllist_add (rpcprog_t, rpcvers_t, struct netconfig *,
-+			     struct netbuf *);
-+static void terminate (int);
-+static void parseargs (int, char *[]);
- 
- int
- main(int argc, char *argv[])
-diff --git a/src/util.c b/src/util.c
-index a6c835b..33b9e4f 100644
---- a/src/util.c
-+++ b/src/util.c
-@@ -70,7 +70,7 @@ static struct sockaddr_in *local_in4;
- static struct sockaddr_in6 *local_in6;
- #endif
- 
--static int bitmaskcmp __P((void *, void *, void *, int));
-+static int bitmaskcmp (void *, void *, void *, int);
- 
- /*
-  * For all bits set in "mask", compare the corresponding bits in
-diff --git a/src/warmstart.c b/src/warmstart.c
-index b6eb73e..42dd3af 100644
---- a/src/warmstart.c
-+++ b/src/warmstart.c
-@@ -58,8 +58,8 @@
- #define	PMAPFILE	RPCBIND_STATEDIR "/portmap.xdr"
- #endif
- 
--static bool_t write_struct __P((char *, xdrproc_t, void *));
--static bool_t read_struct __P((char *, xdrproc_t, void *));
-+static bool_t write_struct (char *, xdrproc_t, void *);
-+static bool_t read_struct (char *, xdrproc_t, void *);
- 
- static bool_t
- write_struct(char *filename, xdrproc_t structproc, void *list)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch
deleted file mode 100644
index 16b763e..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 9194122389f2a56b1cd1f935e64307e2e963c2da Mon Sep 17 00:00:00 2001
-From: Steve Dickson <steved@redhat.com>
-Date: Mon, 2 Nov 2015 17:05:18 -0500
-Subject: [PATCH] handle_reply: Don't use the xp_auth pointer directly
-
-In the latest libtirpc version to access the xp_auth
-one must use the SVC_XP_AUTH macro. To be backwards
-compatible a couple ifdefs were added to use the
-macro when it exists.
-
-Upstream-Status: Backport
-
-Signed-off-by: Steve Dickson <steved@redhat.com>
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
- src/rpcb_svc_com.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
-index 4ae93f1..22d6c84 100644
---- a/src/rpcb_svc_com.c
-+++ b/src/rpcb_svc_com.c
-@@ -1295,10 +1295,17 @@ handle_reply(int fd, SVCXPRT *xprt)
- 	a.rmt_localvers = fi->versnum;
- 
- 	xprt_set_caller(xprt, fi);
-+#if defined(SVC_XP_AUTH)
-+	SVC_XP_AUTH(xprt) = svc_auth_none;
-+#else 
- 	xprt->xp_auth = &svc_auth_none;
-+#endif
- 	svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a);
-+#if !defined(SVC_XP_AUTH)
- 	SVCAUTH_DESTROY(xprt->xp_auth);
- 	xprt->xp_auth = NULL;
-+#endif
-+
- done:
- 	if (buffer)
- 		free(buffer);
--- 
-2.4.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch
new file mode 100644
index 0000000..bf7aaef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch
@@ -0,0 +1,221 @@
+From 7ea36eeece56b59f98e469934e4c20b4da043346 Mon Sep 17 00:00:00 2001
+From: Doran Moppert <dmoppert@redhat.com>
+Date: Thu, 11 May 2017 11:42:54 -0400
+Subject: [PATCH] rpcbind: pair all svc_getargs() calls with svc_freeargs() to
+ avoid memory leak
+
+This patch is to address CVE-2017-8779 "rpcbomb" in rpcbind, discussed
+at [1], [2], [3].  The last link suggests this issue is actually a bug
+in rpcbind, which led me here.
+
+The leak caused by the reproducer at [4] appears to come from
+rpcb_service_4(), in the case where svc_getargs() returns false and the
+function had an early return, rather than passing through the cleanup
+path at done:, as would otherwise occur.
+
+It also addresses a couple of other locations where the same fault seems
+to exist, though I haven't been able to exercise those.  I hope someone
+more intimate with rpc(3) can confirm my understanding is correct, and
+that I haven't introduced any new bugs.
+
+Without this patch, using the reproducer (and variants) repeatedly
+against rpcbind with a numBytes argument of 1_000_000_000, /proc/$(pidof
+rpcbind)/status reports VmSize increase of 976564 kB each call, and
+VmRSS increase of around 260 kB every 33 calls - the specific numbers
+are probably an artifact of my rhel/glibc version.  With the patch,
+there is a small (~50 kB) VmSize increase with the first message, but
+thereafter both VmSize and VmRSS remain steady.
+
+[1]: http://seclists.org/oss-sec/2017/q2/209
+[2]: https://bugzilla.redhat.com/show_bug.cgi?id=1448124
+[3]: https://sourceware.org/ml/libc-alpha/2017-05/msg00129.html
+[4]: https://github.com/guidovranken/rpcbomb/
+
+
+CVE: CVE-2017-8779
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+---
+ src/pmap_svc.c     | 56 +++++++++++++++++++++++++++++++++++++++++++++---------
+ src/rpcb_svc.c     |  2 +-
+ src/rpcb_svc_4.c   |  2 +-
+ src/rpcb_svc_com.c |  8 ++++++++
+ 4 files changed, 57 insertions(+), 11 deletions(-)
+
+diff --git a/src/pmap_svc.c b/src/pmap_svc.c
+index 4c744fe..e926cdc 100644
+--- a/src/pmap_svc.c
++++ b/src/pmap_svc.c
+@@ -175,6 +175,7 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long
+ 	long ans;
+ 	uid_t uid;
+ 	char uidbuf[32];
++	int rc = TRUE;
+ 
+ 	/*
+ 	 * Can't use getpwnam here. We might end up calling ourselves
+@@ -194,7 +195,8 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long
+ 
+ 	if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg)) {
+ 		svcerr_decode(xprt);
+-		return (FALSE);
++		rc = FALSE;
++		goto done;
+ 	}
+ #ifdef RPCBIND_DEBUG
+ 	if (debugging)
+@@ -205,7 +207,8 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long
+ 
+ 	if (!check_access(xprt, op, reg.pm_prog, PMAPVERS)) {
+ 		svcerr_weakauth(xprt);
+-		return (FALSE);
++		rc = (FALSE);
++		goto done;
+ 	}
+ 
+ 	rpcbreg.r_prog = reg.pm_prog;
+@@ -258,7 +261,16 @@ done_change:
+ 		rpcbs_set(RPCBVERS_2_STAT, ans);
+ 	else
+ 		rpcbs_unset(RPCBVERS_2_STAT, ans);
+-	return (TRUE);
++done:
++	if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg)) {
++		if (debugging) {
++			/*(void) xlog(LOG_DEBUG, "unable to free arguments\n");*/
++			if (doabort) {
++				rpcbind_abort();
++			}
++		}
++	}
++	return (rc);
+ }
+ 
+ /* ARGSUSED */
+@@ -272,15 +284,18 @@ pmapproc_getport(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
+ #ifdef RPCBIND_DEBUG
+ 	char *uaddr;
+ #endif
++	int rc = TRUE;
+ 
+ 	if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg)) {
+ 		svcerr_decode(xprt);
+-		return (FALSE);
++		rc = FALSE;
++		goto done;
+ 	}
+ 
+ 	if (!check_access(xprt, PMAPPROC_GETPORT, reg.pm_prog, PMAPVERS)) {
+ 		svcerr_weakauth(xprt);
+-		return FALSE;
++		rc = FALSE;
++		goto done;
+ 	}
+ 
+ #ifdef RPCBIND_DEBUG
+@@ -330,21 +345,34 @@ pmapproc_getport(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
+ 		pmap_ipprot2netid(reg.pm_prot) ?: "<unknown>",
+ 		port ? udptrans : "");
+ 
+-	return (TRUE);
++done:
++	if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg)) {
++		if (debugging) {
++			/* (void) xlog(LOG_DEBUG, "unable to free arguments\n");*/
++			if (doabort) {
++				rpcbind_abort();
++			}
++		}
++	}
++	return (rc);
+ }
+ 
+ /* ARGSUSED */
+ static bool_t
+ pmapproc_dump(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
+ {
++	int rc = TRUE;
++
+ 	if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL)) {
+ 		svcerr_decode(xprt);
+-		return (FALSE);
++		rc = FALSE;
++		goto done;
+ 	}
+ 
+ 	if (!check_access(xprt, PMAPPROC_DUMP, 0, PMAPVERS)) {
+ 		svcerr_weakauth(xprt);
+-		return FALSE;
++		rc = FALSE;
++		goto done;
+ 	}
+ 	
+ 	if ((!svc_sendreply(xprt, (xdrproc_t) xdr_pmaplist_ptr,
+@@ -354,7 +382,17 @@ pmapproc_dump(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
+ 			rpcbind_abort();
+ 		}
+ 	}
+-	return (TRUE);
++
++done:
++	if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)NULL)) {
++		if (debugging) {
++			/*(void) xlog(LOG_DEBUG, "unable to free arguments\n");*/
++			if (doabort) {
++				rpcbind_abort();
++			}
++		}
++	}
++	return (rc);
+ }
+ 
+ int pmap_netid2ipprot(const char *netid)
+diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c
+index 709e3fb..091f530 100644
+--- a/src/rpcb_svc.c
++++ b/src/rpcb_svc.c
+@@ -166,7 +166,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
+ 		svcerr_decode(transp);
+ 		if (debugging)
+ 			(void) xlog(LOG_DEBUG, "rpcbind: could not decode");
+-		return;
++		goto done;
+ 	}
+ 
+ 	if (rqstp->rq_proc == RPCBPROC_SET
+diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c
+index 5094879..eebbbbe 100644
+--- a/src/rpcb_svc_4.c
++++ b/src/rpcb_svc_4.c
+@@ -218,7 +218,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
+ 		svcerr_decode(transp);
+ 		if (debugging)
+ 			(void) xlog(LOG_DEBUG, "rpcbind: could not decode\n");
+-		return;
++		goto done;
+ 	}
+ 
+ 	if (rqstp->rq_proc == RPCBPROC_SET
+diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
+index 5862c26..cb63afd 100644
+--- a/src/rpcb_svc_com.c
++++ b/src/rpcb_svc_com.c
+@@ -927,6 +927,14 @@ error:
+ 	if (call_msg.rm_xid != 0)
+ 		(void) free_slot_by_xid(call_msg.rm_xid);
+ out:
++	if (!svc_freeargs(transp, (xdrproc_t) xdr_rmtcall_args, (char *) &a)) {
++		if (debugging) {
++			(void) xlog(LOG_DEBUG, "unable to free arguments\n");
++			if (doabort) {
++				rpcbind_abort();
++			}
++		}
++	}
+ 	if (local_uaddr)
+ 		free(local_uaddr);
+ 	if (buf_alloc)
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch
deleted file mode 100644
index 741a990..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-commit 06f7ebb1dade2f0dbf872ea2bedf17cff4734bdd
-Author: Olaf Kirch <okir@...e.de>
-Date:   Thu Aug 6 16:27:20 2015 +0200
-
-    Fix memory corruption in PMAP_CALLIT code
-    
-     - A PMAP_CALLIT call comes in on IPv4 UDP
-     - rpcbind duplicates the caller's address to a netbuf and stores it in
-       FINFO[0].caller_addr. caller_addr->buf now points to a memory region A
-       with a size of 16 bytes
-     - rpcbind forwards the call to the local service, receives a reply
-     - when processing the reply, it does this in xprt_set_caller:
-         xprt->xp_rtaddr = *FINFO[0].caller_addr
-       It sends out the reply, and then frees the netbuf caller_addr and
-       caller_addr.buf.
-       However, it does not clear xp_rtaddr, so xp_rtaddr.buf now refers
-       to memory region A, which is free.
-     - When the next call comes in on the UDP/IPv4 socket, svc_dg_recv will
-       be called, which will set xp_rtaddr to the client's address.
-       It will reuse the buffer inside xp_rtaddr, ie it will write a
-       sockaddr_in to region A
-    
-    Some time down the road, an incoming TCP connection is accepted,
-    allocating a fresh SVCXPRT. The memory region A is inside the
-    new SVCXPRT
-    
-     - While processing the TCP call, another UDP call comes in, again
-       overwriting region A with the client's address
-     - TCP client closes connection. In svc_destroy, we now trip over
-       the garbage left in region A
-    
-    We ran into the case where a commercial scanner was triggering
-    occasional rpcbind segfaults. The core file that was captured showed
-    a corrupted xprt->xp_netid pointer that was really a sockaddr_in.
-    
-    Signed-off-by: Olaf Kirch <okir@...e.de>
-
-    Upstream-Status: Backport
-    CVE: CVE-2015-7236
-
-    Signed-off-by: Li Zhou <li.zhou@windriver.com>
----
- src/rpcb_svc_com.c |   23 ++++++++++++++++++++++-
- 1 file changed, 22 insertions(+), 1 deletion(-)
-
-Index: rpcbind-0.1.6+git20080930/src/rpcb_svc_com.c
-===================================================================
---- rpcbind-0.1.6+git20080930.orig/src/rpcb_svc_com.c
-+++ rpcbind-0.1.6+git20080930/src/rpcb_svc_com.c
-@@ -1298,12 +1298,33 @@ check_rmtcalls(struct pollfd *pfds, int
- 	return (ncallbacks_found);
- }
- 
-+/*
-+ * This is really a helper function defined in libtirpc, but unfortunately, it hasn't
-+ * been exported yet.
-+ */
-+static struct netbuf *
-+__rpc_set_netbuf(struct netbuf *nb, const void *ptr, size_t len)
-+{
-+	if (nb->len != len) {
-+		if (nb->len)
-+			mem_free(nb->buf, nb->len);
-+		nb->buf = mem_alloc(len);
-+		if (nb->buf == NULL)
-+			return NULL;
-+
-+		nb->maxlen = nb->len = len;
-+	}
-+	memcpy(nb->buf, ptr, len);
-+	return nb;
-+}
-+
- static void
- xprt_set_caller(SVCXPRT *xprt, struct finfo *fi)
- {
-+	const struct netbuf *caller = fi->caller_addr;
- 	u_int32_t *xidp;
- 
--	*(svc_getrpccaller(xprt)) = *(fi->caller_addr);
-+	__rpc_set_netbuf(svc_getrpccaller(xprt), caller->buf, caller->len);
- 	xidp = __rpcb_get_dg_xidp(xprt);
- 	*xidp = fi->caller_xid;
- }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb
deleted file mode 100644
index c19a197..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb
+++ /dev/null
@@ -1,73 +0,0 @@
-SUMMARY = "Universal Addresses to RPC Program Number Mapper"
-DESCRIPTION = "The rpcbind utility is a server that converts RPC \
-               program numbers into universal addresses."
-SECTION = "console/network"
-HOMEPAGE = "http://sourceforge.net/projects/rpcbind/"
-BUGTRACKER = "http://sourceforge.net/tracker/?group_id=201237&atid=976751"
-DEPENDS = "libtirpc quota"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \
-                    file://src/rpcinfo.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \
-           file://init.d \
-           file://0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch \
-           file://remove-sys-queue.patch \
-           file://0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch \
-           ${UCLIBCPATCHES} \
-           ${MUSLPATCHES} \
-           file://rpcbind.conf \
-           file://rpcbind.socket \
-           file://rpcbind.service \
-           file://cve-2015-7236.patch \
-          "
-MUSLPATCHES_libc-musl = "file://musl-sunrpc.patch"
-
-UCLIBCPATCHES ?= ""
-MUSLPATCHES ?= ""
-
-SRC_URI[md5sum] = "c8875246b2688a1adfbd6ad43480278d"
-SRC_URI[sha256sum] = "9897823a9d820ea011d9ea02054d5ab99469b9ca5346265fee380713c8fed27b"
-
-inherit autotools update-rc.d systemd pkgconfig
-
-PACKAGECONFIG ??= "tcp-wrappers"
-PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
-
-INITSCRIPT_NAME = "rpcbind"
-INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ."
-
-SYSTEMD_SERVICE_${PN} = "rpcbind.service"
-
-inherit useradd
-
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "--system --no-create-home --home-dir / \
-                       --shell /bin/false --user-group rpc"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
-PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/, \
-                          --without-systemdsystemunitdir, \
-                          systemd \
-"
-
-EXTRA_OECONF += " --enable-warmstarts --with-rpcuser=rpc"
-
-do_install_append () {
-	mv ${D}${bindir} ${D}${sbindir}
-
-	install -d ${D}${sysconfdir}/init.d
-	sed -e 's,/etc/,${sysconfdir}/,g' \
-		-e 's,/sbin/,${sbindir}/,g' \
-		${WORKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind
-	chmod 0755 ${D}${sysconfdir}/init.d/rpcbind
-
-	install -m 0755 ${WORKDIR}/rpcbind.conf ${D}${sysconfdir}
-	install -d ${D}${systemd_unitdir}/system
-	install -m 0644 ${WORKDIR}/rpcbind.socket ${D}${systemd_unitdir}/system
-	install -m 0644 ${WORKDIR}/rpcbind.service ${D}${systemd_unitdir}/system
-	sed -i -e 's,@SBINDIR@,${sbindir},g' \
-		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
-		${D}${systemd_unitdir}/system/rpcbind.service
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb
new file mode 100644
index 0000000..1a12055
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Universal Addresses to RPC Program Number Mapper"
+DESCRIPTION = "The rpcbind utility is a server that converts RPC \
+               program numbers into universal addresses."
+SECTION = "console/network"
+HOMEPAGE = "http://sourceforge.net/projects/rpcbind/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=201237&atid=976751"
+DEPENDS = "libtirpc quota"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \
+                    file://src/rpcinfo.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \
+           file://init.d \
+           file://remove-sys-queue.patch \
+           ${UCLIBCPATCHES} \
+           ${MUSLPATCHES} \
+           file://rpcbind.conf \
+           file://rpcbind.socket \
+           file://rpcbind.service \
+           file://0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch \
+          "
+MUSLPATCHES_libc-musl = "file://musl-sunrpc.patch"
+
+UCLIBCPATCHES ?= ""
+MUSLPATCHES ?= ""
+
+SRC_URI[md5sum] = "cf10cd41ed8228fc54c316191c1f07fe"
+SRC_URI[sha256sum] = "074a9a530dc7c11e0d905aa59bcb0847c009313f02e98d3d798aa9568f414c66"
+
+inherit autotools update-rc.d systemd pkgconfig
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+
+INITSCRIPT_NAME = "rpcbind"
+INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ."
+
+SYSTEMD_SERVICE_${PN} = "rpcbind.service"
+
+inherit useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home --home-dir / \
+                       --shell /bin/false --user-group rpc"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/, \
+                          --without-systemdsystemunitdir, \
+                          systemd \
+"
+
+EXTRA_OECONF += " --enable-warmstarts --with-rpcuser=rpc"
+
+do_install_append () {
+	mv ${D}${bindir} ${D}${sbindir}
+
+	install -d ${D}${sysconfdir}/init.d
+	sed -e 's,/etc/,${sysconfdir}/,g' \
+		-e 's,/sbin/,${sbindir}/,g' \
+		${WORKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind
+	chmod 0755 ${D}${sysconfdir}/init.d/rpcbind
+
+	install -m 0755 ${WORKDIR}/rpcbind.conf ${D}${sysconfdir}
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/rpcbind.socket ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/rpcbind.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' \
+		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
+		${D}${systemd_unitdir}/system/rpcbind.service
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.4.0.bb b/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.4.0.bb
deleted file mode 100644
index 769bac1..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.4.0.bb
+++ /dev/null
@@ -1,52 +0,0 @@
-SUMMARY = "Multiplexing terminal manager"
-DESCRIPTION = "Screen is a full-screen window manager \
-that multiplexes a physical terminal between several \
-processes, typically interactive shells."
-HOMEPAGE = "http://www.gnu.org/software/screen/"
-BUGTRACKER = "https://savannah.gnu.org/bugs/?func=additem&group=screen"
-
-SECTION = "console/utils"
-
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://screen.h;endline=26;md5=3971142989289a8198a544220703c2bf"
-
-DEPENDS = "ncurses \
-          ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
-RDEPENDS_${PN} = "base-files"
-
-SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz \
-           file://fix-parallel-make.patch \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'file://screen.pam', '', d)} \
-           file://Remove-redundant-compiler-sanity-checks.patch \
-           file://Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch \
-           file://Skip-host-file-system-checks-when-cross-compiling.patch \
-           file://Avoid-mis-identifying-systems-as-SVR4.patch \
-           file://0002-comm.h-now-depends-on-term.h.patch \
-           file://0001-fix-for-multijob-build.patch \
-          "
-
-SRC_URI[md5sum] = "d26e11a3648c2b11aaefa215a55dfd39"
-SRC_URI[sha256sum] = "ef722a54759a3bf23aad272bbf33c414c1078cad6bcd982fada93c0d7917218b"
-
-inherit autotools texinfo
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[utempter] = "ac_cv_header_utempter_h=yes,ac_cv_header_utempter_h=no,libutempter,"
-
-EXTRA_OECONF = "--with-pty-mode=0620 --with-pty-group=5 \
-               ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
-
-do_install_append () {
-	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
-		install -D -m 644 ${WORKDIR}/screen.pam ${D}/${sysconfdir}/pam.d/screen
-	fi
-}
-
-pkg_postinst_${PN} () {
-	grep -q "^${bindir}/screen$" $D${sysconfdir}/shells || echo ${bindir}/screen >> $D${sysconfdir}/shells
-}
-
-pkg_postrm_${PN} () {
-	printf "$(grep -v "^${bindir}/screen$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.5.1.bb b/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.5.1.bb
new file mode 100644
index 0000000..32c1a5a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.5.1.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Multiplexing terminal manager"
+DESCRIPTION = "Screen is a full-screen window manager \
+that multiplexes a physical terminal between several \
+processes, typically interactive shells."
+HOMEPAGE = "http://www.gnu.org/software/screen/"
+BUGTRACKER = "https://savannah.gnu.org/bugs/?func=additem&group=screen"
+
+SECTION = "console/utils"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://screen.h;endline=26;md5=3971142989289a8198a544220703c2bf"
+
+DEPENDS = "ncurses \
+          ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} = "base-files"
+
+SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz \
+           file://fix-parallel-make.patch \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'file://screen.pam', '', d)} \
+           file://Remove-redundant-compiler-sanity-checks.patch \
+           file://Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch \
+           file://Skip-host-file-system-checks-when-cross-compiling.patch \
+           file://Avoid-mis-identifying-systems-as-SVR4.patch \
+           file://0002-comm.h-now-depends-on-term.h.patch \
+           file://0001-fix-for-multijob-build.patch \
+          "
+
+SRC_URI[md5sum] = "a8c5da2f42f8a18fa4dada2419d1549b"
+SRC_URI[sha256sum] = "97db2114dd963b016cd4ded34831955dcbe3251e5eee45ac2606e67e9f097b2d"
+
+inherit autotools texinfo
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[utempter] = "ac_cv_header_utempter_h=yes,ac_cv_header_utempter_h=no,libutempter,"
+
+EXTRA_OECONF = "--with-pty-mode=0620 --with-pty-group=5 \
+               ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
+
+do_install_append () {
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+		install -D -m 644 ${WORKDIR}/screen.pam ${D}/${sysconfdir}/pam.d/screen
+	fi
+}
+
+pkg_postinst_${PN} () {
+	grep -q "^${bindir}/screen$" $D${sysconfdir}/shells || echo ${bindir}/screen >> $D${sysconfdir}/shells
+}
+
+pkg_postrm_${PN} () {
+	printf "$(grep -v "^${bindir}/screen$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars
deleted file mode 100644
index 8b09f53..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars
+++ /dev/null
@@ -1,25 +0,0 @@
-# Makefile variables for PO directory in any package using GNU gettext.
-
-# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ..
-
-# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
-
-# This is the copyright holder that gets inserted into the header of the
-# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
-# package.  (Note that the msgstr strings, extracted from the package's
-# sources, belong to the copyright holder of the package.)  Translators are
-# expected to transfer the copyright for their translations to this person
-# or entity, or to disclaim their copyright.  The empty string stands for
-# the public domain; in this case the translators are expected to disclaim
-# their copyright.
-COPYRIGHT_HOLDER = Free Software Foundation, Inc.
-
-# This is the list of locale categories, beyond LC_MESSAGES, for which the
-# message catalogs shall be used.  It is usually empty.
-EXTRA_LOCALE_CATEGORIES =
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch
deleted file mode 100644
index 836551e..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Upstream-Status: Pending
-
-Change the getline return type to match its declaration.
-
-Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
-
-diff -urN sed-4.1.2-orig/lib/getline.c sed-4.1.2/lib/getline.c
---- sed-4.1.2-orig/lib/getline.c	2010-08-31 08:47:50.070094024 +0800
-+++ sed-4.1.2/lib/getline.c	2010-08-31 08:48:50.982178172 +0800
-@@ -30,7 +30,7 @@
-    necessary.  Returns the number of characters read (not including the
-    null terminator), or -1 on error or EOF.  */
- 
--size_t
-+ssize_t
- getline (lineptr, n, stream)
-      char **lineptr;
-      size_t *n;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch
deleted file mode 100644
index c7c0aa0..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Upstream-Status: Pending
-
-automake-1.12.x has deprecated use of @mkdir_p@, fix the issue by using @MKDIR_P@ instead.
-
-Avoid this build issue:
-| make[1]: mkdir_p@: Command not found
-| make[1]: *** [install-data-yes] Error 127
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
-2012/07/13
-
-Index: sed-4.1.2/intl/Makefile.in
-===================================================================
---- sed-4.1.2.orig/intl/Makefile.in
-+++ sed-4.1.2/intl/Makefile.in
-@@ -40,7 +40,7 @@ subdir = intl
- INSTALL = @INSTALL@
- INSTALL_DATA = @INSTALL_DATA@
- mkinstalldirs = $(mkdir_p)
--mkdir_p = @mkdir_p@
-+mkdir_p = @MKDIR_P@
- 
- l = @INTL_LIBTOOL_SUFFIX_PREFIX@
- 
-Index: sed-4.1.2/po/Makefile.in.in
-===================================================================
---- sed-4.1.2.orig/po/Makefile.in.in
-+++ sed-4.1.2/po/Makefile.in.in
-@@ -29,7 +29,7 @@ gettextsrcdir = $(datadir)/gettext/po
- INSTALL = /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/bin/install -c
- INSTALL_DATA = ${INSTALL} -m 644
- mkinstalldirs = $(mkdir_p)
--mkdir_p = @mkdir_p@
-+mkdir_p = @MKDIR_P@
- 
- CC = i586-poky-linux-gcc  -m32   -march=i586 --sysroot=/srv/home/nitin/builds2/build0/tmp/sysroots/qemux86
- GMSGFMT = /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/bin/msgfmt
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb b/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb
deleted file mode 100644
index 40e3a53..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-SUMMARY = "Stream EDitor (text filtering utility)"
-HOMEPAGE = "http://www.gnu.org/software/sed/"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
-                    file://sed/sed.h;beginline=1;endline=17;md5=e00ffd1837f298439a214fd197f6a407"
-SECTION = "console/utils"
-PR = "r7"
-
-SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \
-           file://fix_return_type.patch \
-           file://sed-4.1.2_fix_for_automake-1.12.patch \
-           file://Makevars"
-
-SRC_URI[md5sum] = "928f0e06422f414091917401f1a834d0"
-SRC_URI[sha256sum] = "638e837ba765d5da0a30c98b57c2953cecea96827882f594612acace93ceeeab"
-
-inherit autotools texinfo update-alternatives gettext
-
-do_configure_prepend () {
-	cp ${WORKDIR}/Makevars ${S}/po/
-}
-
-do_install () {
-	autotools_do_install
-	install -d ${D}${base_bindir}
-	if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
-	    mv ${D}${bindir}/sed ${D}${base_bindir}/sed
-	    rmdir ${D}${bindir}/
-	fi
-}
-
-ALTERNATIVE_${PN} = "sed"
-ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed"
-ALTERNATIVE_PRIORITY = "100"
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch
new file mode 100644
index 0000000..60a46e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch
@@ -0,0 +1,47 @@
+From acec93540eba6899661c607408498ac72ab07a47 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
+Date: Tue, 7 Mar 2017 16:03:03 +0100
+Subject: [PATCH] useradd: copy extended attributes of home
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The Home directory wasn't getting the extended attributes
+of /etc/skel. This patch fixes that issue and adds the copy
+of the extended attributes of the root of the home directory.
+
+Upstream-Status: Submitted [http://lists.alioth.debian.org/pipermail/pkg-shadow-commits/2017-March/003804.html]
+
+Change-Id: Icd633f7c6c494efd2a30cb8f04c306f749ad0c3b
+Signed-off-by: José Bollo <jose.bollo@iot.bzh>
+---
+ src/useradd.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/useradd.c b/src/useradd.c
+index a8a1f76..8aefb9c 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -52,6 +52,9 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <time.h>
++#ifdef WITH_ATTR
++#include <attr/libattr.h>
++#endif
+ #include "chkname.h"
+ #include "defines.h"
+ #include "faillog.h"
+@@ -1915,6 +1918,9 @@ static void create_home (void)
+ 		chown (user_home, user_id, user_gid);
+ 		chmod (user_home,
+ 		       0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
++#ifdef WITH_ATTR
++		attr_copy_file (def_template, user_home, NULL, NULL);
++#endif
+ 		home_added = true;
+ #ifdef WITH_AUDIT
+ 		audit_logger (AUDIT_ADD_USER, Prog,
+-- 
+2.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
index 85dde8e..2f084b4 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
@@ -11,7 +11,7 @@
 index 4bd969d..cb5dd6c 100644
 --- a/src/useradd.c
 +++ b/src/useradd.c
-@@ -1893,6 +1893,35 @@ static void usr_update (void)
+@@ -1896,6 +1896,35 @@ static void usr_update (void)
  }
  
  /*
@@ -47,7 +47,7 @@
   * create_home - create the user's home directory
   *
   *	create_home() creates the user's home directory if it does not
-@@ -1907,36 +1936,33 @@ static void create_home (void)
+@@ -1910,39 +1939,36 @@ static void create_home (void)
  			fail_exit (E_HOMEDIR);
  		}
  #endif
@@ -67,6 +67,9 @@
 -		chown (user_home, user_id, user_gid);
 -		chmod (user_home,
 -		       0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
+-#ifdef WITH_ATTR
+-		attr_copy_file (def_template, user_home, NULL, NULL);
+-#endif
 -		home_added = true;
 +		mkdir_p(user_home);
 +	}
@@ -88,6 +91,9 @@
 +	chown (user_home, user_id, user_gid);
 +	chmod (user_home,
 +	       0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
++#ifdef WITH_ATTR
++	attr_copy_file (def_template, user_home, NULL, NULL);
++#endif
 +	home_added = true;
 +#ifdef WITH_AUDIT
 +	audit_logger (AUDIT_ADD_USER, Prog,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
index 68da25f..615c6e0 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
@@ -118,7 +118,7 @@
 index b3bd451..4416f90 100644
 --- a/src/useradd.c
 +++ b/src/useradd.c
-@@ -773,6 +773,7 @@ static void usage (int status)
+@@ -776,6 +776,7 @@ static void usage (int status)
  	(void) fputs (_("  -o, --non-unique              allow to create users with duplicate\n"
  	                "                                (non-unique) UID\n"), usageout);
  	(void) fputs (_("  -p, --password PASSWORD       encrypted password of the new account\n"), usageout);
@@ -126,7 +126,7 @@
  	(void) fputs (_("  -r, --system                  create a system account\n"), usageout);
  	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), usageout);
  	(void) fputs (_("  -s, --shell SHELL             login shell of the new account\n"), usageout);
-@@ -1047,6 +1048,7 @@ static void process_flags (int argc, char **argv)
+@@ -1050,6 +1051,7 @@ static void process_flags (int argc, char **argv)
  			{"no-user-group",  no_argument,       NULL, 'N'},
  			{"non-unique",     no_argument,       NULL, 'o'},
  			{"password",       required_argument, NULL, 'p'},
@@ -134,7 +134,7 @@
  			{"system",         no_argument,       NULL, 'r'},
  			{"root",           required_argument, NULL, 'R'},
  			{"shell",          required_argument, NULL, 's'},
-@@ -1059,9 +1061,9 @@ static void process_flags (int argc, char **argv)
+@@ -1062,9 +1064,9 @@ static void process_flags (int argc, char **argv)
  		};
  		while ((c = getopt_long (argc, argv,
  #ifdef WITH_SELINUX
@@ -146,7 +146,7 @@
  #endif				/* !WITH_SELINUX */
  		                         long_options, NULL)) != -1) {
  			switch (c) {
-@@ -1227,6 +1229,9 @@ static void process_flags (int argc, char **argv)
+@@ -1230,6 +1232,9 @@ static void process_flags (int argc, char **argv)
  				}
  				user_pass = optarg;
  				break;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc
index f79565b..70ff68e 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc
@@ -6,7 +6,6 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=ed80ff1c2b40843cf5768e5229cf16e5 \
                     file://src/passwd.c;beginline=8;endline=30;md5=d83888ea14ae61951982d77125947661"
 
-DEPENDS = "shadow-native"
 DEPENDS_class-native = ""
 DEPENDS_class-nativesdk = ""
 
@@ -16,6 +15,7 @@
            file://fix-installation-failure-with-subids-disabled.patch \
            file://0001-Do-not-read-login.defs-before-doing-chroot.patch \
            file://check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch \
+           file://0001-useradd-copy-extended-attributes-of-home.patch \
            ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \
            "
 
@@ -75,8 +75,9 @@
                pam-plugin-shells \
                pam-plugin-rootok"
 
-PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
-PACKAGECONFIG_class-native = ""
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}"
+PACKAGECONFIG_class-native ??= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}"
 PACKAGECONFIG_class-nativesdk = ""
 PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,${PAM_PLUGINS}"
 PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
@@ -171,10 +172,11 @@
 
 ALTERNATIVE_PRIORITY = "200"
 
-ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr"
+ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr nologin"
 ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
 ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
 ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
 ALTERNATIVE_${PN}-base = "newgrp groups login su"
 ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
@@ -187,6 +189,7 @@
 ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1"
 ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8"
 
+PACKAGE_WRITE_DEPS += "shadow-native"
 pkg_postinst_${PN} () {
 	if [ "x$D" != "x" ]; then
 	  rootarg="--root $D"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch
deleted file mode 100644
index 57ebfe4..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 96eb7e29822151823a66a1eb59f1fa4aead5ae08 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 31 Aug 2015 06:33:21 +0000
-Subject: [PATCH] Fix  error: conflicting types for 'posix_close'
-
-Exposed while compiling on musl
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- src/slposio.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/slposio.c b/src/slposio.c
-index 9ce9697..9ff9bfe 100644
---- a/src/slposio.c
-+++ b/src/slposio.c
-@@ -363,7 +363,7 @@ static int posix_close_fd (int *fd)
-    return 0;
- }
- 
--static int posix_close (SLFile_FD_Type *f)
-+static int posix_closex (SLFile_FD_Type *f)
- {
-    int status = do_close (f);
- 
-@@ -1001,7 +1001,7 @@ static SLang_Intrin_Fun_Type Fd_Name_Table [] =
-    MAKE_INTRINSIC_2("write", posix_write, V, F, B),
-    MAKE_INTRINSIC_1("dup_fd", posix_dup, V, F),
-    MAKE_INTRINSIC_2("dup2_fd", posix_dup2, I, F, I),
--   MAKE_INTRINSIC_1("close", posix_close, I, F),
-+   MAKE_INTRINSIC_1("close", posix_closex, I, F),
-    MAKE_INTRINSIC_1("_close", posix_close_fd, I, I),
- #if defined(TTYNAME_R)
-    MAKE_INTRINSIC_0("ttyname", posix_ttyname, V),
--- 
-2.5.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/dont-link-to-host.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/dont-link-to-host.patch
new file mode 100644
index 0000000..42dba0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/dont-link-to-host.patch
@@ -0,0 +1,16 @@
+SLANG_INST_LIB is the location of where slang will end up, but when building for
+packaging this doesn't have DESTDIR appended so can potentially link to the host
+for cross builds and will trigger QA errors.
+
+As this is obviously wrong, delete it.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/slsh/Makefile.in b/slsh/Makefile.in
+index cba9d81..4c1c370 100644
+--- a/slsh/Makefile.in
++++ b/slsh/Makefile.in
+@@ -80 +80 @@ SHELL = /bin/sh
+-INST_LIBS = $(DEST_LIB_DIR) $(RPATH) $(SLANG_INST_LIB) -lslang $(READLINE_LIB) $(DYNAMIC_LIBS)
++INST_LIBS = $(DEST_LIB_DIR) $(RPATH) -lslang $(READLINE_LIB) $(DYNAMIC_LIBS)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch
deleted file mode 100644
index a0ec0ff..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-fix the pcre existence checking
-
-when check if there is pcre, the configure file always check
-the host dir. now we make it work by adding correct prefix for
-cross-compile environment.
-
-When enable pcre-module, we see a QA warning because rpaths
-hardcoded into the build, rpaths are not needed, so lets turn
-this off.
-
-Upstream-Status: Inappropriate
-Signed-off-by: Roy.Li <rongqing.li@windriver.com>
----
- configure |   72 +++++---------------------------------------------------------
- 1 file changed, 6 insertions(+), 66 deletions(-)
-
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -7191,6 +7191,7 @@ $as_echo_n "checking for the pcre library and header files ... " >&6; }
- 	 /usr/include/pcre,/usr/lib \
- 	 /usr/pcre/include,/usr/pcre/lib \
- 	 /usr/include,/usr/lib \
-+	 /usr/include,/usr/lib64 \
- 	 /opt/include/pcre,/opt/lib \
- 	 /opt/pcre/include,/opt/pcre/lib \
- 	 /opt/include,/opt/lib"
-@@ -7221,14 +7222,14 @@ $as_echo_n "checking for the pcre library and header files ... " >&6; }
-         xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'`
- 	xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'`
- 	found=0
--	if test -r $xincdir/$xincfile
-+	if test -r $PKG_CONFIG_SYSROOT_DIR/$xincdir/$xincfile
- 	then
- 	  for E in $exts
- 	  do
--	    if test -r "$xlibdir/$xlibfile.$E"
-+	    if test -r "$PKG_CONFIG_SYSROOT_DIR/$xlibdir/$xlibfile.$E"
- 	    then
--	      jd_pcre_include_dir="$xincdir"
--	      jd_pcre_library_dir="$xlibdir"
-+	      jd_pcre_include_dir="$PKG_CONFIG_SYSROOT_DIR/$xincdir"
-+	      jd_pcre_library_dir="$PKG_CONFIG_SYSROOT_DIR/$xlibdir"
- 	      jd_with_pcre_library="yes"
- 	      found=1
- 	      break
-@@ -7255,68 +7255,7 @@ $as_echo "yes: $jd_pcre_library_dir and $jd_pcre_include_dir" >&6; }
-     then
-       PCRE_LIB=""
-     else
--
--if test "X$jd_pcre_library_dir" != "X"
--then
--  if test "X$RPATH" = "X"
--  then
--
--case "$host_os" in
--  *linux*|*solaris* )
--    if test "X$GCC" = Xyes
--    then
--      if test "X$ac_R_nospace" = "Xno"
--      then
--        RPATH="-Wl,-R,"
--      else
--        RPATH="-Wl,-R"
--      fi
--    else
--      if test "X$ac_R_nospace" = "Xno"
--      then
--        RPATH="-R "
--      else
--	RPATH="-R"
--      fi
--    fi
--  ;;
--  *osf*|*openbsd*|*freebsd*)
--    if test "X$GCC" = Xyes
--    then
--      RPATH="-Wl,-rpath,"
--    else
--      RPATH="-rpath "
--    fi
--  ;;
--  *netbsd*)
--    if test "X$GCC" = Xyes
--    then
--      RPATH="-Wl,-R"
--    fi
--  ;;
--esac
--
--    if test "X$RPATH" != "X"
--    then
--      RPATH="$RPATH$jd_pcre_library_dir"
--    fi
--  else
--    _already_there=0
--    for X in `echo $RPATH | sed 's/:/ /g'`
--    do
--      if test "$X" = "$jd_pcre_library_dir"
--      then
--        _already_there=1
--	break
--      fi
--    done
--    if test $_already_there = 0
--    then
--      RPATH="$RPATH:$jd_pcre_library_dir"
--    fi
--  fi
--fi
--
-+      RPATH=""
-     fi
- 
-     PCRE_INC=-I$jd_pcre_include_dir
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/no-x.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/no-x.patch
index d7666bf..7dc1602 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/no-x.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/no-x.patch
@@ -12,3 +12,7 @@
 -# For the socket module
 -AC_PATH_XTRA
 -
+--- a/modules/Makefile.in
++++ b/modules/Makefile.in
+@@ -67 +66,0 @@ ZLIB_LIB        = @Z_LIB@ -lz
+-SOCKET_LIBS = @X_EXTRA_LIBS@
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch
deleted file mode 100644
index f82a531..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-Without this patch we see rpaths hardcoded into the build which results in QA
-warnings. These rpaths are not needed so lets turn this off.
-
-Upstream-Status: Inappropriate
-(but could be turned into a proper configure option)
-
-RP 2012/03/14
-
-Index: slang-2.2.4/configure
-===================================================================
---- slang-2.2.4.orig/configure	2012-03-14 23:40:01.283560679 +0000
-+++ slang-2.2.4/configure	2012-03-14 23:41:18.023558900 +0000
-@@ -6246,68 +6246,7 @@ esac
- ELF_CFLAGS="$ELF_CFLAGS $IEEE_CFLAGS"
- CFLAGS="$CFLAGS $IEEE_CFLAGS"
- 
--
--if test "X$libdir" != "X"
--then
--  if test "X$RPATH" = "X"
--  then
--
--case "$host_os" in
--  *linux*|*solaris* )
--    if test "X$GCC" = Xyes
--    then
--      if test "X$ac_R_nospace" = "Xno"
--      then
--        RPATH="-Wl,-R,"
--      else
--        RPATH="-Wl,-R"
--      fi
--    else
--      if test "X$ac_R_nospace" = "Xno"
--      then
--        RPATH="-R "
--      else
--	RPATH="-R"
--      fi
--    fi
--  ;;
--  *osf*|*openbsd*|*freebsd*)
--    if test "X$GCC" = Xyes
--    then
--      RPATH="-Wl,-rpath,"
--    else
--      RPATH="-rpath "
--    fi
--  ;;
--  *netbsd*)
--    if test "X$GCC" = Xyes
--    then
--      RPATH="-Wl,-R"
--    fi
--  ;;
--esac
--
--    if test "X$RPATH" != "X"
--    then
--      RPATH="$RPATH$libdir"
--    fi
--  else
--    _already_there=0
--    for X in `echo $RPATH | sed 's/:/ /g'`
--    do
--      if test "$X" = "$libdir"
--      then
--        _already_there=1
--	break
--      fi
--    done
--    if test $_already_there = 0
--    then
--      RPATH="$RPATH:$libdir"
--    fi
--  fi
--fi
--
-+RPATH=""
- 
- # The cast to long int works around a bug in the HP C Compiler
- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch
deleted file mode 100644
index 850551e..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From 4588f4a0287787788eb86fb16f326cbaa7454e1d Mon Sep 17 00:00:00 2001
-From: Zheng Junling <zhengjunling@huawei.com>
-Date: Mon, 16 Jun 2014 12:51:25 +0000
-Subject: [PATCH] slang: fix the iconv existence checking
-
-When checking whether there is iconv, the configure file always check 
-the host env.
-
-Now we make it working properly by adding correct prefix for cross-
-compiling environment.
-
-When enabling iconv-module, we see a QA warning because rpaths hardcoded
-into the build. And rpaths are not needed, so let's turn this off.
-
-This patch is generated by referencing the existing "fix-check-pcre"
-patch.
-
-Upstream-Status: Inappropriate
-
-Signed-off-by: Zheng Junling <zhengjunling@huawei.com>
----
- configure |   72 +++++---------------------------------------------------------
- 1 file changed, 6 insertions(+), 66 deletions(-)
-
-diff --git a/configure b/configure
-index fa395ff..7fa769c 100755
---- a/configure
-+++ b/configure
-@@ -8259,6 +8259,7 @@ $as_echo_n "checking for the iconv library and header files ... " >&6; }
- 	 /usr/include/iconv,/usr/lib \
- 	 /usr/iconv/include,/usr/iconv/lib \
- 	 /usr/include,/usr/lib \
-+	 /usr/include,/usr/lib64 \
- 	 /opt/include/iconv,/opt/lib \
- 	 /opt/iconv/include,/opt/iconv/lib \
- 	 /opt/include,/opt/lib"
-@@ -8289,14 +8290,14 @@ $as_echo_n "checking for the iconv library and header files ... " >&6; }
-         xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'`
- 	xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'`
- 	found=0
--	if test -r $xincdir/$xincfile
-+	if test -r $PKG_CONFIG_SYSROOT_DIR/$xincdir/$xincfile
- 	then
- 	  for E in $exts
- 	  do
--	    if test -r "$xlibdir/$xlibfile.$E"
-+	    if test -r "$PKG_CONFIG_SYSROOT_DIR/$xlibdir/$xlibfile.$E"
- 	    then
--	      jd_iconv_include_dir="$xincdir"
--	      jd_iconv_library_dir="$xlibdir"
-+	      jd_iconv_include_dir="$PKG_CONFIG_SYSROOT_DIR/$xincdir"
-+	      jd_iconv_library_dir="$PKG_CONFIG_SYSROOT_DIR/$xlibdir"
- 	      jd_with_iconv_library="yes"
- 	      found=1
- 	      break
-@@ -8201,68 +8201,7 @@ $as_echo "yes: $jd_iconv_library_dir and $jd_iconv_include_dir" >&6; }
-     then
-       ICONV_LIB=""
-     else
--
--if test "X$jd_iconv_library_dir" != "X"
--then
--  if test "X$RPATH" = "X"
--  then
--
--case "$host_os" in
--  *linux*|*solaris* )
--    if test "X$GCC" = Xyes
--    then
--      if test "X$ac_R_nospace" = "Xno"
--      then
--        RPATH="-Wl,-R,"
--      else
--        RPATH="-Wl,-R"
--      fi
--    else
--      if test "X$ac_R_nospace" = "Xno"
--      then
--        RPATH="-R "
--      else
--	RPATH="-R"
--      fi
--    fi
--  ;;
--  *osf*|*openbsd*|*freebsd*)
--    if test "X$GCC" = Xyes
--    then
--      RPATH="-Wl,-rpath,"
--    else
--      RPATH="-rpath "
--    fi
--  ;;
--  *netbsd*)
--    if test "X$GCC" = Xyes
--    then
--      RPATH="-Wl,-R"
--    fi
--  ;;
--esac
--
--    if test "X$RPATH" != "X"
--    then
--      RPATH="$RPATH$jd_iconv_library_dir"
--    fi
--  else
--    _already_there=0
--    for X in `echo $RPATH | sed 's/:/ /g'`
--    do
--      if test "$X" = "$jd_iconv_library_dir"
--      then
--        _already_there=1
--	break
--      fi
--    done
--    if test $_already_there = 0
--    then
--      RPATH="$RPATH:$jd_iconv_library_dir"
--    fi
--  fi
--fi
--
-+      RPATH=""
-     fi
- 
-     ICONV_INC=-I$jd_iconv_include_dir
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.3.0.bb b/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.3.0.bb
deleted file mode 100644
index d5967d2..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.3.0.bb
+++ /dev/null
@@ -1,58 +0,0 @@
-SUMMARY = "The shared library for the S-Lang extension language"
-
-DESCRIPTION = "S-Lang is an interpreted language and a programming library.  The \
-S-Lang language was designed so that it can be easily embedded into \
-a program to provide the program with a powerful extension language. \
-The S-Lang library, provided in this package, provides the S-Lang \
-extension language.  S-Lang's syntax resembles C, which makes it easy \
-to recode S-Lang procedures in C if you need to."
-
-HOMEPAGE = "http://www.jedsoft.org/slang/"
-SECTION = "libs"
-DEPENDS = "ncurses virtual/libiconv"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a52a18a472d4f7e45479b06563717c02"
-
-
-SRC_URI = "http://www.jedsoft.org/releases/${BPN}/${BP}.tar.bz2 \
-           file://rpathfix.patch \
-           file://fix-check-pcre.patch \
-           file://slang-fix-the-iconv-existence-checking.patch \
-           file://0001-Fix-error-conflicting-types-for-posix_close.patch \
-           file://no-x.patch \
-          "
-SRC_URI[md5sum] = "3bcc790460d52db1316c20395b7ac2f1"
-SRC_URI[sha256sum] = "f95224060f45e0d8212a5039b339afa5f1a94a1bb0298e796104e5b12e926129"
-
-UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/"
-PREMIRRORS_append = "\n http://www.jedsoft.org/releases/slang/.* http://www.jedsoft.org/releases/slang/old/ \n"
-
-inherit autotools-brokensep
-CLEANBROKEN = "1"
-
-EXTRA_OECONF = "--without-onig"
-
-PACKAGECONFIG ??= "pcre"
-PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,pcre"
-PACKAGECONFIG[png] = "--with-png,--without-png,libpng"
-PACKAGECONFIG[zlib] = "--with-z,--without-z,zlib"
-
-do_configure_prepend() {
-    # slang keeps configure.ac and rest of autoconf files in autoconf/ directory
-    # we have to go there to be able to run gnu-configize cause it expects configure.{in,ac}
-    # to be present. Resulting files land in autoconf/autoconf/ so we need to move them.
-    cd ${S}/autoconf && gnu-configize --force && mv autoconf/config.* .
-    cd ${B}
-}
-
-do_install() {
-	oe_runmake install DESTDIR=${D} -e 'INST_LIB_DIR=${STAGING_DIR_HOST}/usr/lib'
-}
-
-FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/"
-
-PARALLEL_MAKE = ""
-PARALLEL_MAKEINST = ""
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.3.1a.bb b/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.3.1a.bb
new file mode 100644
index 0000000..c71d804
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.3.1a.bb
@@ -0,0 +1,57 @@
+SUMMARY = "The shared library for the S-Lang extension language"
+
+DESCRIPTION = "S-Lang is an interpreted language and a programming library.  The \
+S-Lang language was designed so that it can be easily embedded into \
+a program to provide the program with a powerful extension language. \
+The S-Lang library, provided in this package, provides the S-Lang \
+extension language.  S-Lang's syntax resembles C, which makes it easy \
+to recode S-Lang procedures in C if you need to."
+
+HOMEPAGE = "http://www.jedsoft.org/slang/"
+SECTION = "libs"
+DEPENDS = "ncurses virtual/libiconv"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a52a18a472d4f7e45479b06563717c02"
+
+SRC_URI = "http://www.jedsoft.org/releases/${BPN}/${BP}.tar.bz2 \
+           file://no-x.patch \
+           file://dont-link-to-host.patch \
+          "
+
+SRC_URI[md5sum] = "c5235313042ed0e71ec708f7b85ec241"
+SRC_URI[sha256sum] = "54f0c3007fde918039c058965dffdfd6c5aec0bad0f4227192cc486021f08c36"
+
+UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/"
+PREMIRRORS_append = "\n http://www.jedsoft.org/releases/slang/.* http://www.jedsoft.org/releases/slang/old/ \n"
+
+inherit autotools-brokensep
+CLEANBROKEN = "1"
+
+EXTRA_OECONF = "--without-onig"
+# There's no way to turn off rpaths and slang will -rpath to the default search
+# path. Unset RPATH to stop this.
+EXTRA_OEMAKE = "RPATH=''"
+
+PACKAGECONFIG ??= "pcre"
+PACKAGECONFIG[pcre] = "--with-pcre=${STAGING_DIR_HOST}${prefix},--without-pcre,pcre"
+PACKAGECONFIG[png] = "--with-png=${STAGING_DIR_HOST}${prefix},--without-png,libpng"
+PACKAGECONFIG[zlib] = "--with-z=${STAGING_DIR_HOST}${prefix},--without-z,zlib"
+
+do_configure_prepend() {
+    cd ${S}/autoconf
+    # slang keeps configure.ac and rest of autoconf files in autoconf/ directory
+    # we have to go there to be able to run gnu-configize cause it expects configure.{in,ac}
+    # to be present. Resulting files land in autoconf/autoconf/ so we need to move them.
+    gnu-configize --force && mv autoconf/config.* .
+    # For the same reason we also need to run autoconf manually.
+    autoconf && mv configure ..
+    cd ${B}
+}
+
+FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/"
+
+PARALLEL_MAKE = ""
+PARALLEL_MAKEINST = ""
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc
index a25876b..d42a04a 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc
+++ b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc
@@ -4,7 +4,7 @@
 BUGTRACKER = "http://www.sudo.ws/bugs/"
 SECTION = "admin"
 LICENSE = "ISC & BSD & Zlib"
-LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=c16e542408abda013d672be8eb88d174 \
+LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=f600a47c2a2cdde5899e449607810ed1 \
                     file://plugins/sudoers/redblack.c;beginline=1;endline=41;md5=cfe41112f96c19a074934d128f45c693 \
                     file://lib/util/reallocarray.c;beginline=3;endline=16;md5=85b0905b795d4d58bf2e00635649eec6 \
                     file://lib/util/fnmatch.c;beginline=3;endline=27;md5=67f83ee9bd456557397082f8f1be0efd \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.17p1.bb b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.17p1.bb
deleted file mode 100644
index 614ad5c..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.17p1.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-require sudo.inc
-
-SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-${PV}.tar.gz \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
-           file://0001-Include-sys-types.h-for-id_t-definition.patch \
-           "
-
-PAM_SRC_URI = "file://sudo.pam"
-
-SRC_URI[md5sum] = "50a840a688ceb6fa3ab24fc0adf4fa23"
-SRC_URI[sha256sum] = "c690d707fb561b3ecdf6a6de5563bc0b769388eff201c851edbace408bb155cc"
-
-DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
-RDEPENDS_${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}"
-
-EXTRA_OECONF += " \
-             ac_cv_type_rsize_t=no \
-             ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
-             ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-tmpfiles.d=${libdir}/tmpfiles.d', '--disable-tmpfiles.d', d)} \
-             "
-
-do_install_append () {
-	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
-		install -D -m 644 ${WORKDIR}/sudo.pam ${D}/${sysconfdir}/pam.d/sudo
-	fi
-
-	chmod 4111 ${D}${bindir}/sudo
-	chmod 0440 ${D}${sysconfdir}/sudoers
-
-	# Explicitly remove the ${localstatedir}/run directory to avoid QA error
-	rmdir -p --ignore-fail-on-non-empty ${D}${localstatedir}/run/sudo
-}
-
-FILES_${PN} += "${libdir}/tmpfiles.d"
-FILES_${PN}-dev += "${libexecdir}/${BPN}/lib*${SOLIBSDEV} ${libexecdir}/${BPN}/*.la \
-                    ${libexecdir}/lib*${SOLIBSDEV} ${libexecdir}/*.la"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.19p2.bb b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.19p2.bb
new file mode 100644
index 0000000..a9659c3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.19p2.bb
@@ -0,0 +1,36 @@
+require sudo.inc
+
+SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-${PV}.tar.gz \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+           file://0001-Include-sys-types.h-for-id_t-definition.patch \
+           "
+
+PAM_SRC_URI = "file://sudo.pam"
+
+SRC_URI[md5sum] = "31a6090ed1d0946fa22cba19e86aafef"
+SRC_URI[sha256sum] = "237e18e67c2ad59ecacfa4b7707198b09fcf84914621585a9bc670dcc31a52e0"
+
+DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}"
+
+EXTRA_OECONF += " \
+             ac_cv_type_rsize_t=no \
+             ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
+             ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-tmpfiles.d=${libdir}/tmpfiles.d', '--disable-tmpfiles.d', d)} \
+             "
+
+do_install_append () {
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+		install -D -m 644 ${WORKDIR}/sudo.pam ${D}/${sysconfdir}/pam.d/sudo
+	fi
+
+	chmod 4111 ${D}${bindir}/sudo
+	chmod 0440 ${D}${sysconfdir}/sudoers
+
+	# Explicitly remove the ${localstatedir}/run directory to avoid QA error
+	rmdir -p --ignore-fail-on-non-empty ${D}${localstatedir}/run/sudo
+}
+
+FILES_${PN} += "${libdir}/tmpfiles.d"
+FILES_${PN}-dev += "${libexecdir}/${BPN}/lib*${SOLIBSDEV} ${libexecdir}/${BPN}/*.la \
+                    ${libexecdir}/lib*${SOLIBSDEV} ${libexecdir}/*.la"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/klogd.service b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/klogd.service
new file mode 100644
index 0000000..0c888c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/klogd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Kernel Logging Service
+After=syslogd.service
+
+[Service]
+Type=forking
+ExecStart=/sbin/klogd
+PIDFile=/var/run/klogd.pid
+StandardOutput=null
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslogd.service b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslogd.service
new file mode 100644
index 0000000..eeaff3d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslogd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=System Logging Service
+Requires=syslog.socket
+
+[Service]
+Type=forking
+ExecStart=/sbin/syslogd
+PIDFile=/var/run/syslogd.pid
+StandardOutput=null
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+Alias=syslog.service
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf
new file mode 100644
index 0000000..f4aecd3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf
@@ -0,0 +1 @@
+p /dev/xconsole 0640 root adm
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc
index 5c15ffe..78b8d7a 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -11,17 +11,24 @@
                     file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \
                    "
 
-inherit update-rc.d update-alternatives
+inherit update-rc.d update-alternatives systemd
 
 SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \
            file://no-strip-install.patch \
            file://0001-Fix-build-with-musl.patch \
            file://sysklogd \
            file://syslog.conf \
+           file://syslogd.service \
+           file://klogd.service \
+           file://tmpfiles.sysklogd.conf \
            "
 
 SRC_URI_append_e500v2 = " file://no-vectorization.patch"
 
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "syslogd.service klogd.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
 INITSCRIPT_NAME = "syslog"
 CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}"
 
@@ -39,13 +46,26 @@
 	install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
 	install -d ${D}${sysconfdir}/init.d
 	install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
+	install -d ${D}${systemd_unitdir}/system
+	install -m 644 ${WORKDIR}/syslogd.service ${D}${systemd_unitdir}/system
+	install -m 644 ${WORKDIR}/klogd.service ${D}${systemd_unitdir}/system
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true', 'false', d)}; then
+		install -d ${D}${exec_prefix}/lib/tmpfiles.d
+		install -m 644 ${WORKDIR}/tmpfiles.sysklogd.conf ${D}${exec_prefix}/lib/tmpfiles.d/sysklogd.conf
+	fi
 }
 
+FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/sysklogd.conf', '', d)}"
+
 # sysklogd package has no internal systemd support, so we weigh busybox's
 # sysklogd utility over it in case of systemd
 ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}"
 
-ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
+ALTERNATIVE_${PN} = "syslogd klogd syslog-conf \
+    ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','syslog-init','',d)}"
+
+ALTERNATIVE_${PN}-doc = "syslogd.8"
+ALTERNATIVE_LINK_NAME[syslogd.8] = "${mandir}/man8/syslogd.8"
 
 ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
 ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.4.0.bb b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.4.0.bb
deleted file mode 100644
index 69f83fc..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.4.0.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-require sysstat.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=a23a74b3f4caf9616230789d94217acb"
-
-SRC_URI += "file://0001-Include-needed-headers-explicitly.patch"
-
-SRC_URI[md5sum] = "ee7b8c0b139a11a7a3418dc0658ca1be"
-SRC_URI[sha256sum] = "b8518ca88acfcbc474a406022ee9c0c3210ccef4f0ec80e5b3e8c41dda8c16f2"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.5.4.bb b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.5.4.bb
new file mode 100644
index 0000000..7ff363b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.5.4.bb
@@ -0,0 +1,8 @@
+require sysstat.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a23a74b3f4caf9616230789d94217acb"
+
+SRC_URI += "file://0001-Include-needed-headers-explicitly.patch"
+
+SRC_URI[md5sum] = "f16ae8edd462f5199ee033f7c0e2c197"
+SRC_URI[sha256sum] = "1e1008656575e70486b456e79775e98d3b8732d7e2cb408559209bd0318e0807"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch
deleted file mode 100644
index af5026f..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624]
-CVE: CVE-2010-0624
-
-This patch avoids heap overflow reported by :
-http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624
-
-This is a clean patch for the GPLv2 tar recipe.
-
-Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25
-
-Index: tar-1.17/lib/rtapelib.c
-===================================================================
---- tar-1.17.orig/lib/rtapelib.c
-+++ tar-1.17/lib/rtapelib.c
-@@ -570,7 +570,7 @@ rmt_read__ (int handle, char *buffer, si
- 
-   sprintf (command_buffer, "R%lu\n", (unsigned long) length);
-   if (do_command (handle, command_buffer) == -1
--      || (status = get_status (handle)) == SAFE_READ_ERROR)
-+      || ((status = get_status (handle)) == SAFE_READ_ERROR) || (status > length))
-     return SAFE_READ_ERROR;
- 
-   for (counter = 0; counter < status; counter += rlen, buffer += rlen)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch
deleted file mode 100644
index f8059a0..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Upstream-Status: Inappropriate [licensing]
-
-# Fix errors when built with gcc 4.3
-# Patch taken from Debian bug #452096
-
-diff -urN tar-1.17.orig/lib/argp-fmtstream.h tar-1.17/lib/argp-fmtstream.h
---- tar-1.17.orig/lib/argp-fmtstream.h	2006-01-11 12:24:05.000000000 -0800
-+++ tar-1.17/lib/argp-fmtstream.h	2010-07-22 22:36:12.000000000 -0700
-@@ -198,7 +198,11 @@
- #endif
- 
- #ifndef ARGP_FS_EI
--#define ARGP_FS_EI extern inline
-+ #if defined __GNUC_STDC_INLINE__
-+   #define ARGP_FS_EI extern inline __attribute__((__gnu_inline__))
-+ #else
-+   #define ARGP_FS_EI extern inline
-+ #endif
- #endif
- 
- ARGP_FS_EI size_t
-diff -urN tar-1.17.orig/lib/argp.h tar-1.17/lib/argp.h
---- tar-1.17.orig/lib/argp.h	2007-03-30 00:09:11.000000000 -0700
-+++ tar-1.17/lib/argp.h	2010-07-22 22:38:44.000000000 -0700
-@@ -580,7 +580,11 @@
- # endif
- 
- # ifndef ARGP_EI
--#  define ARGP_EI extern __inline__
-+#  if defined __GNUC_STDC_INLINE__
-+#    define ARGP_EI extern __inline__ __attribute__((__gnu_inline__))
-+#  else
-+#    define ARGP_EI extern __inline__
-+#  endif
- # endif
- 
- ARGP_EI void
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch
deleted file mode 100644
index 30534c2..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Upstream-Status: Inappropriate [licensing]
-
-# Define AC_USE_SYSTEM_EXTENSIONS only if it was previously undefined.
-# This is needed to configure correctly with newer versions of autoconf.
-
---- tar-1.17/m4/extensions.m4.orig	2010-07-22 22:21:35.000000000 -0700
-+++ tar-1.17/m4/extensions.m4	2010-07-22 22:23:41.000000000 -0700
-@@ -1,4 +1,4 @@
--# serial 4  -*- Autoconf -*-
-+# serial 5  -*- Autoconf -*-
- # Enable extensions on systems that normally disable them.
- 
- # Copyright (C) 2003, 2006 Free Software Foundation, Inc.
-@@ -16,6 +16,7 @@
- # ------------------------
- # Enable extensions on systems that normally disable them,
- # typically due to standards-conformance issues.
-+m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [], [
- AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
- [
-   AC_BEFORE([$0], [AC_COMPILE_IFELSE])
-@@ -48,7 +49,7 @@
-     AC_DEFINE([__EXTENSIONS__])
-   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
-   AC_DEFINE([_TANDEM_SOURCE])
--])
-+])])
- 
- # gl_USE_SYSTEM_EXTENSIONS
- # ------------------------
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb b/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb
deleted file mode 100644
index b9ca206..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-require tar.inc
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-
-PR = "r3"
-
-SRC_URI += "file://m4extensions.patch \
-    file://gcc43build.patch \
-    file://avoid_heap_overflow.patch \
-    "
-
-SRC_URI[md5sum] = "c6c4f1c075dbf0f75c29737faa58f290"
-SRC_URI[sha256sum] = "19f9021dda51a16295e4706e80870e71f87107675e51c176a491eba0fc4ca492"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb b/import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb
index ae64816..afd125b 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb
@@ -27,3 +27,5 @@
 }
 
 FILES_${PN}-doc += "${datadir}/texinfo"
+
+RDEPENDS_${PN} = "perl"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch
deleted file mode 100644
index f4d6660..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-fix the macro check
-
-Upstream-Status: Pending
-
-configure does not check if locale.h exists, but check setlocale,
-if setlocale exist, the locale.h should exist.
-
-Signed-off-by: Roy Li <rongqing.li@windriver.com>
----
- lib/system.h |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/system.h b/lib/system.h
-index 946eb3c..c70037b 100644
---- a/lib/system.h
-+++ b/lib/system.h
-@@ -42,7 +42,7 @@ extern char *substring (const char *, const char *);
- #include <ctype.h>
- 
- /* All systems nowadays probably have these functions, but ... */
--#ifdef HAVE_LOCALE_H
-+#ifdef HAVE_SETLOCALE
- #include <locale.h>
- #endif
- #ifndef HAVE_SETLOCALE
--- 
-1.7.10.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch
deleted file mode 100644
index 81ebe26..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 458e9450cecf703f55536e609365162719585900 Mon Sep 17 00:00:00 2001
-From: "Roy.Li" <rongqing.li@windriver.com>
-Date: Wed, 10 Sep 2014 17:03:29 +0800
-Subject: [PATCH] do not compile host tools, since we have native
-
-Upstream-Status: Pending
-
-Signed-off-by: Roy.Li <rongqing.li@windriver.com>
----
- configure.ac | 23 +----------------------
- 1 file changed, 1 insertion(+), 22 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index b46130d..cf58654 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -90,28 +90,7 @@ AC_CANONICAL_BUILD
- # $native_tools is also added to SUBDIRS in the main Makefile.am,
- # so that make compiles the native tools first.
- #
--if test "$cross_compiling" = no; then
--  native_tools=
--else
--  native_tools=tools
--  test -d "$native_tools" || mkdir "$native_tools"
--  confdir=`(cd "$srcdir";pwd)`
--  # Make sure the secondary configure won't fail with
--  # "error: source directory already configured".
--  rm -f config.status
--  AC_MSG_NOTICE([[Doing configure of native tools (${build}).]])
--  cd "$native_tools" || exit 1
--  # Run secondary configure in alternate environment or
--  # it gets the wrong CC etc.  env -i gives this build host configure
--  # a clean environment.
--  env -i CC="${BUILD_CC}" AR="${BUILD_AR}" RANLIB="${BUILD_RANLIB}" \
--      PATH="${PATH}" \
--      tools_only=1 \
--    ${confdir}/configure --build=${build} --host=${build} \
--                         --disable-rpath --disable-nls
--  cd .. || exit 1
--  AC_MSG_NOTICE([[Continuing with main configure (${host}).]])
--fi
-+native_tools=
- AC_SUBST(native_tools)
- AM_CONDITIONAL(TOOLS_ONLY, [[test "x$tools_only" = x1]])
- 
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch
deleted file mode 100644
index 2297051..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 9b0df7d6d3c18cfac82c291d60a5357d1bc8d9d0 Mon Sep 17 00:00:00 2001
-From: "Roy.Li" <rongqing.li@windriver.com>
-Date: Wed, 10 Sep 2014 17:10:03 +0800
-Subject: [PATCH] using native makeinfo
-
-Upstream-Status: Pending
-
-Signed-off-by: Roy.Li <rongqing.li@windriver.com>
----
- doc/Makefile.am                                |   2 +-
-
-diff --git a/doc/Makefile.am b/doc/Makefile.am
-index 63df818..b6ceb34 100644
---- a/doc/Makefile.am
-+++ b/doc/Makefile.am
-@@ -19,7 +19,7 @@ man_MANS = info.1 infokey.1 install-info.1 makeinfo.1 texindex.1 texi2dvi.1 \
- 
- # Use the programs built in our distribution, taking account of possible
- # cross-compiling.
--MAKEINFO = $(top_builddir)/$(native_tools)/makeinfo/makeinfo
-+MAKEINFO = makeinfo
- INSTALL_INFO = $(top_builddir)/$(native_tools)/util/install-info
- 
- TXI_XLATE = txi-cs.tex txi-de.tex txi-en.tex txi-es.tex txi-fr.tex \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
index 0ce47ec..f418439 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
@@ -1,31 +1,32 @@
-From 6f1f3912fcb900b3a3e6cbe3360306fade333497 Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Thu, 6 Aug 2015 14:55:08 +0300
+From e89b1c57d76f5cf5acbb0d0187374f7a77bce1e2 Mon Sep 17 00:00:00 2001
+From: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
+Date: Tue, 29 Nov 2016 13:43:24 -0600
 Subject: [PATCH] dont-depend-on-help2man
 
 Upstream-Status: Inappropriate
 
 Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
 ---
  doc/Makefile.am |  2 +-
  man/Makefile.am | 12 ++++++------
  2 files changed, 7 insertions(+), 7 deletions(-)
 
 diff --git a/doc/Makefile.am b/doc/Makefile.am
-index 7198a6b..4bba550 100644
+index 39db834..1bb2a4f
 --- a/doc/Makefile.am
 +++ b/doc/Makefile.am
-@@ -40,7 +40,7 @@ refcard_files = refcard/Makefile refcard/txicmdcheck \
+@@ -38,7 +38,7 @@ refcard_files = refcard/Makefile refcard/txicmdcheck \
  # Include our texinfo.tex, not Automake's.
  EXTRA_DIST = epsf.tex texinfo.tex \
               fdl.texi \
 -	     $(man_MANS) $(TXI_XLATE) \
 +	     $(TXI_XLATE) \
- 	     $(refcard_files)
+              $(refcard_files) texinfo-tex-test.texi \
+              texinfo-ja.tex short-sample-ja.texi
  
- if INSTALL_WARNINGS
 diff --git a/man/Makefile.am b/man/Makefile.am
-index a08d603..bdfc9a4 100644
+index 6bfcb3d..a820c96
 --- a/man/Makefile.am
 +++ b/man/Makefile.am
 @@ -13,24 +13,24 @@
@@ -60,5 +61,5 @@
  # Maintainers should be able to regenerate.
  MAINTAINERCLEANFILES = $(man_MANS)
 -- 
-2.1.4
+2.9.3
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
index 41bd220..f25352c 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
@@ -1,19 +1,22 @@
-From 20e1d8a9481dc13dd1d4d168b90e0ed2ff097b98 Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Thu, 6 Aug 2015 14:29:57 +0300
+From fe4f00459601efe0cfa75d92749a32237800a530 Mon Sep 17 00:00:00 2001
+From: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
+Date: Tue, 29 Nov 2016 12:27:17 -0600
 Subject: [PATCH] texinfo-4.12-zlib
 
 Upstream-Status: Pending
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
 ---
- install-info/Makefile.in    |  2 +-
- install-info/install-info.c | 67 +++++++++++++++++++++++++++------------------
- 2 files changed, 42 insertions(+), 27 deletions(-)
+ install-info/Makefile.in    | 12 ++-----
+ install-info/install-info.c | 79 +++++++++++++++++++++++++++------------------
+ 2 files changed, 49 insertions(+), 42 deletions(-)
 
 diff --git a/install-info/Makefile.in b/install-info/Makefile.in
-index ad73abb..eaa2153 100644
+index 837d020..ba96579 100644
 --- a/install-info/Makefile.in
 +++ b/install-info/Makefile.in
-@@ -241,7 +241,7 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
+@@ -216,7 +208,7 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
  PROGRAMS = $(bin_PROGRAMS)
  am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
  ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS)
@@ -23,7 +26,7 @@
  ginstall_info_DEPENDENCIES = $(top_builddir)/gnulib/lib/libgnu.a \
  	$(am__DEPENDENCIES_1)
 diff --git a/install-info/install-info.c b/install-info/install-info.c
-index b454c15..4e39122 100644
+index e58189c..8617787 100644
 --- a/install-info/install-info.c
 +++ b/install-info/install-info.c
 @@ -22,6 +22,7 @@
@@ -43,7 +46,7 @@
  open_possibly_compressed_file (char *filename,
      void (*create_callback) (char *),
 -    char **opened_filename, char **compression_program) 
-+    char **opened_filename, char **compression_program, int *is_pipe) 
++    char **opened_filename, char **compression_program, int *is_pipe)
  {
    char *local_opened_filename, *local_compression_program;
    int nread;
@@ -119,7 +122,7 @@
            if (!f)
              return 0;
          }
-@@ -767,12 +768,12 @@ open_possibly_compressed_file (char *filename,
+@@ -767,26 +768,26 @@ open_possibly_compressed_file (char *filename,
  
    /* Read first few bytes of file rather than relying on the filename.
       If the file is shorter than this it can't be usable anyway.  */
@@ -128,14 +131,34 @@
 +  nread = gzread (f, data, sizeof (data));
 +  if (nread != sizeof (data))
      {
-       /* Empty files don't set errno.  Calling code can check for
-          this, so make sure errno == 0 just in case it isn't already. */
 -      if (nread == 0)
 +      if (nread >= 0)
-         errno = 0;
-       return 0;
-     }
-@@ -838,35 +839,40 @@ open_possibly_compressed_file (char *filename,
+         {
+           /* Try to create the file if its empty. */
+-          if (feof (f) && create_callback)
++          if (gzeof(f) && create_callback)
+             {
+-              if (fclose (f) != 0)
++              if (gzclose(f) != 0)
+                 return 0; /* unknown error closing file */
+ 
+-              if (remove (filename) != 0)
++              if (remove(filename) != 0)
+                 return 0; /* unknown error deleting file */
+ 
+               (*create_callback) (filename);
+-              f = fopen (*opened_filename, FOPEN_RBIN);
++              f = gzopen (*opened_filename, FOPEN_RBIN);
+               if (!f)
+                 return 0;
+-              nread = fread (data, sizeof (data), 1, f);
+-              if (nread == 0)
++              nread = gzread(f, data, sizeof (data));
++              if (nread >= 0)
+                 return 0;
+               goto determine_file_type; /* success */
+             }
+@@ -857,35 +858,40 @@ determine_file_type:
      *compression_program = NULL;
  
    /* Seek back over the magic bytes.  */
@@ -183,7 +206,7 @@
      }
  
    return f;
-@@ -885,7 +891,8 @@ readfile (char *filename, int *sizep,
+@@ -904,7 +910,8 @@ readfile (char *filename, int *sizep,
      void (*create_callback) (char *), char **opened_filename,
      char **compression_program)
  {
@@ -193,7 +216,7 @@
    int filled = 0;
    int data_size = 8192;
    char *data = xmalloc (data_size);
-@@ -893,14 +900,20 @@ readfile (char *filename, int *sizep,
+@@ -912,14 +919,20 @@ readfile (char *filename, int *sizep,
    /* If they passed the space for the file name to return, use it.  */
    f = open_possibly_compressed_file (filename, create_callback,
                                       opened_filename,
@@ -216,7 +239,7 @@
        if (nread < 0)
          return 0;
        if (nread == 0)
-@@ -919,8 +932,10 @@ readfile (char *filename, int *sizep,
+@@ -938,8 +951,10 @@ readfile (char *filename, int *sizep,
    /* We need to close the stream, since on some systems the pipe created
       by popen is simulated by a temporary file which only gets removed
       inside pclose.  */
@@ -229,5 +252,5 @@
    *sizep = filled;
    return data;
 -- 
-2.1.4
+2.9.3
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb
deleted file mode 100644
index 13678e0..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb
+++ /dev/null
@@ -1,55 +0,0 @@
-SUMMARY = "Documentation system for on-line information and printed output"
-DESCRIPTION = "Texinfo is a documentation system that can produce both \
-online information and printed output from a single source file. The \
-GNU Project uses the Texinfo file format for most of its documentation."
-HOMEPAGE = "http://www.gnu.org/software/texinfo/"
-SECTION = "console/utils"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-PROVIDES_append_class-native = " texinfo-4.8-replacement-native"
-
-DEPENDS = "zlib ncurses texinfo-4.8-replacement-native"
-DEPENDS_class-native = "zlib-native ncurses-native"
-
-TARGET_PATCH = "file://use_host_makedoc.patch \
-           file://using-native-makeinfo.patch \
-"
-TARGET_PATCH_class-native = ""
-
-SRC_URI = "${GNU_MIRROR}/texinfo/${BP}.tar.gz \
-           file://check-locale-h.patch \
-           file://do-compile-native-tools.patch \
-           ${TARGET_PATCH} \
-          "
-
-SRC_URI[md5sum] = "4e9a1a591ed236003d0d4b008bf07eef"
-SRC_URI[sha256sum] = "1f3cdeebe65fdf510f55d765ab1031b54416aa5bc2635b6a54ef9bcb2367c917"
-
-tex_texinfo = "texmf/tex/texinfo"
-
-inherit gettext autotools
-
-do_install_append() {
-	mkdir -p ${D}${datadir}/${tex_texinfo}
-	install -p -m644 ${S}/doc/texinfo.tex ${S}/doc/txi-??.tex ${D}${datadir}/${tex_texinfo}
-}
-
-do_install_append_class-native() {
-	install -m 755 info/makedoc ${D}${bindir}
-	install -m 755 makeinfo/makeinfo ${D}${bindir}
-}
-
-PACKAGES += "info info-doc"
-
-FILES_info = "${bindir}/info ${bindir}/infokey ${bindir}/install-info"
-FILES_info-doc = "${infodir}/info.info ${infodir}/dir ${infodir}/info-*.info \
-                  ${mandir}/man1/info.1* ${mandir}/man5/info.5* \
-                  ${mandir}/man1/infokey.1* ${mandir}/man1/install-info.1*"
-
-FILES_${PN} = "${bindir}/makeinfo ${bindir}/texi* ${bindir}/pdftexi2dvi ${bindir}/pod2texi ${datadir}/texinfo"
-FILES_${PN}-doc = "${infodir}/texinfo* \
-                   ${datadir}/${tex_texinfo} \
-                   ${mandir}/man1 ${mandir}/man5"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb
deleted file mode 100644
index 8638bb1..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb
+++ /dev/null
@@ -1,82 +0,0 @@
-SUMMARY = "Documentation system for on-line information and printed output"
-DESCRIPTION = "Texinfo is a documentation system that can produce both \
-online information and printed output from a single source file. The \
-GNU Project uses the Texinfo file format for most of its documentation."
-HOMEPAGE = "http://www.gnu.org/software/texinfo/"
-SECTION = "console/utils"
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-PROVIDES_append_class-native = " texinfo-replacement-native"
-
-def compress_pkg(d):
-    if bb.data.inherits_class('compress_doc', d):
-         compress = d.getVar("DOC_COMPRESS", True)
-         if compress == "gz":
-             return "gzip"
-         elif compress == "bz2":
-             return "bzip2"
-         elif compress == "xz":
-             return "xz"
-    return ""
-
-RDEPENDS_info += "${@compress_pkg(d)}"
-
-DEPENDS = "zlib ncurses texinfo-replacement-native"
-DEPENDS_class-native = "zlib-native ncurses-native"
-
-TARGET_PATCH = "file://use_host_makedoc.patch"
-TARGET_PATCH_class-native = ""
-
-SRC_URI = "${GNU_MIRROR}/texinfo/${BP}.tar.gz \
-           file://texinfo-4.12-zlib.patch \
-           file://disable-native-tools.patch \
-           file://link-zip.patch \
-           file://dont-depend-on-help2man.patch \
-           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
-           ${TARGET_PATCH} \
-          "
-
-SRC_URI[md5sum] = "e1a2ef5dce5018b53f0f6eed45b247a7"
-SRC_URI[sha256sum] = "83d3183290f34e7f958d209d0b20022c6fe9e921eb6fe94c27d988827d4878d2"
-
-tex_texinfo = "texmf/tex/texinfo"
-
-inherit gettext autotools
-
-do_configure_prepend () {
-	# autotools_do_configure updates po/Makefile.in.in, we also need
-	# update po_document.
-	cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_document/
-}
-
-do_compile_prepend() {
-	if [ -d tools ];then
-		oe_runmake -C tools/gnulib/lib
-	fi
-}
-
-do_install_append() {
-	mkdir -p ${D}${datadir}/${tex_texinfo}
-	install -p -m644 ${S}/doc/texinfo.tex ${S}/doc/txi-??.tex ${D}${datadir}/${tex_texinfo}
-	sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/texi2any ${D}${bindir}/pod2texi
-}
-
-do_install_append_class-native() {
-	install -m 755 info/makedoc ${D}${bindir}
-}
-
-PACKAGES += "info info-doc"
-
-FILES_info = "${bindir}/info ${bindir}/infokey ${bindir}/install-info"
-FILES_info-doc = "${infodir}/info.info* ${infodir}/dir ${infodir}/info-*.info* \
-                  ${mandir}/man1/info.1* ${mandir}/man5/info.5* \
-                  ${mandir}/man1/infokey.1* ${mandir}/man1/install-info.1*"
-
-FILES_${PN} = "${bindir}/makeinfo ${bindir}/texi* ${bindir}/pdftexi2dvi ${bindir}/pod2texi ${datadir}/texinfo"
-RDEPENDS_${PN} = "perl"
-FILES_${PN}-doc = "${infodir}/texinfo* \
-                   ${datadir}/${tex_texinfo} \
-                   ${mandir}/man1 ${mandir}/man5"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.3.bb b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.3.bb
new file mode 100644
index 0000000..d82731e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.3.bb
@@ -0,0 +1,82 @@
+SUMMARY = "Documentation system for on-line information and printed output"
+DESCRIPTION = "Texinfo is a documentation system that can produce both \
+online information and printed output from a single source file. The \
+GNU Project uses the Texinfo file format for most of its documentation."
+HOMEPAGE = "http://www.gnu.org/software/texinfo/"
+SECTION = "console/utils"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+PROVIDES_append_class-native = " texinfo-replacement-native"
+
+def compress_pkg(d):
+    if bb.data.inherits_class('compress_doc', d):
+         compress = d.getVar("DOC_COMPRESS")
+         if compress == "gz":
+             return "gzip"
+         elif compress == "bz2":
+             return "bzip2"
+         elif compress == "xz":
+             return "xz"
+    return ""
+
+RDEPENDS_info += "${@compress_pkg(d)}"
+
+DEPENDS = "zlib ncurses texinfo-replacement-native"
+DEPENDS_class-native = "zlib-native ncurses-native"
+
+TARGET_PATCH = "file://use_host_makedoc.patch"
+TARGET_PATCH_class-native = ""
+
+SRC_URI = "${GNU_MIRROR}/texinfo/${BP}.tar.gz \
+           file://texinfo-4.12-zlib.patch \
+           file://disable-native-tools.patch \
+           file://link-zip.patch \
+           file://dont-depend-on-help2man.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           ${TARGET_PATCH} \
+          "
+
+SRC_URI[md5sum] = "9b08daca9bf8eccae9b0f884aba41f9e"
+SRC_URI[sha256sum] = "300a6ba4958c2dd4a6d5ce60f0a335daf7e379f5374f276f6ba31a221f02f606"
+
+tex_texinfo = "texmf/tex/texinfo"
+
+inherit gettext autotools
+
+do_configure_prepend () {
+	# autotools_do_configure updates po/Makefile.in.in, we also need
+	# update po_document.
+	cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_document/
+}
+
+do_compile_prepend() {
+	if [ -d tools ];then
+		oe_runmake -C tools/gnulib/lib
+	fi
+}
+
+do_install_append() {
+	mkdir -p ${D}${datadir}/${tex_texinfo}
+	install -p -m644 ${S}/doc/texinfo.tex ${S}/doc/txi-??.tex ${D}${datadir}/${tex_texinfo}
+	sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/texi2any ${D}${bindir}/pod2texi
+}
+
+do_install_append_class-native() {
+	install -m 755 info/makedoc ${D}${bindir}
+}
+
+PACKAGES += "info info-doc"
+
+FILES_info = "${bindir}/info ${bindir}/infokey ${bindir}/install-info"
+FILES_info-doc = "${infodir}/info.info* ${infodir}/dir ${infodir}/info-*.info* \
+                  ${mandir}/man1/info.1* ${mandir}/man5/info.5* \
+                  ${mandir}/man1/infokey.1* ${mandir}/man1/install-info.1*"
+
+FILES_${PN} = "${bindir}/makeinfo ${bindir}/texi* ${bindir}/pdftexi2dvi ${bindir}/pod2texi ${datadir}/texinfo"
+RDEPENDS_${PN} = "perl"
+FILES_${PN}-doc = "${infodir}/texinfo* \
+                   ${datadir}/${tex_texinfo} \
+                   ${mandir}/man1 ${mandir}/man5"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/time/time.inc b/import-layers/yocto-poky/meta/recipes-extended/time/time.inc
index 8586217..6b20d7c 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/time/time.inc
+++ b/import-layers/yocto-poky/meta/recipes-extended/time/time.inc
@@ -10,3 +10,5 @@
 
 ALTERNATIVE_${PN} = "time"
 ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2017a.bb b/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2017a.bb
deleted file mode 100644
index 2c26744..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2017a.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-# note that we allow for us to use data later than our code version
-#
-SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
-LICENSE = "PD & BSD & BSD-3-Clause"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=ef1a352b901ee7b75a75df8171d6aca7"
-
-SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \
-           http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
-UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
-
-SRC_URI[tzcode.md5sum] = "eef0bfac7a52dce6989a7d8b40d86fe0"
-SRC_URI[tzcode.sha256sum] = "02f2c6b58b99edd0d47f0cad34075b359fd1a4dab71850f493b0404ded3b38ac"
-SRC_URI[tzdata.md5sum] = "cb8274cd175f8a4d9d1b89895df876dc"
-SRC_URI[tzdata.sha256sum] = "df3a5c4d0a2cf0cde0b3f35796ccf6c9acfd598b8e70f8dece5404cd7626bbd6"
-
-S = "${WORKDIR}"
-
-inherit native
-
-EXTRA_OEMAKE += "cc=${CC}"
-
-do_install () {
-        install -d ${D}${bindir}/
-        install -m 755 zic ${D}${bindir}/
-        install -m 755 zdump ${D}${bindir}/
-        install -m 755 tzselect ${D}${bindir}/
-}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2017b.bb b/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2017b.bb
new file mode 100644
index 0000000..165d2c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2017b.bb
@@ -0,0 +1,28 @@
+# note that we allow for us to use data later than our code version
+#
+SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
+LICENSE = "PD & BSD & BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ef1a352b901ee7b75a75df8171d6aca7"
+
+SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \
+           http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
+UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
+
+SRC_URI[tzcode.md5sum] = "afaf15deb13759e8b543d86350385b16"
+SRC_URI[tzcode.sha256sum] = "4d1735bb54e22b8d7443d4d1f1a13d007ae11be79a35e51f8e8322fb8e292d40"
+SRC_URI[tzdata.md5sum] = "50dc0dc50c68644c1f70804f2e7a1625"
+SRC_URI[tzdata.sha256sum] = "f8242a522ea3496b0ce4ff4f2e75a049178da21001a08b8e666d8cbe07d18086"
+
+S = "${WORKDIR}"
+
+inherit native
+
+EXTRA_OEMAKE += "cc='${CC}'"
+
+do_install () {
+        install -d ${D}${bindir}/
+        install -m 755 zic ${D}${bindir}/
+        install -m 755 zdump ${D}${bindir}/
+        install -m 755 tzselect ${D}${bindir}/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2017a.bb b/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2017a.bb
deleted file mode 100644
index ce59d71..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2017a.bb
+++ /dev/null
@@ -1,213 +0,0 @@
-SUMMARY = "Timezone data"
-HOMEPAGE = "http://www.iana.org/time-zones"
-SECTION = "base"
-LICENSE = "PD & BSD & BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=ef1a352b901ee7b75a75df8171d6aca7"
-
-DEPENDS = "tzcode-native"
-
-SRC_URI = "http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
-UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
-
-SRC_URI[tzdata.md5sum] = "cb8274cd175f8a4d9d1b89895df876dc"
-SRC_URI[tzdata.sha256sum] = "df3a5c4d0a2cf0cde0b3f35796ccf6c9acfd598b8e70f8dece5404cd7626bbd6"
-
-inherit allarch
-
-RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarctica \
-             timezone-arctic timezone-asia timezone-atlantic \
-             timezone-australia timezone-europe timezone-indian \
-             timezone-iso3166.tab timezone-pacific timezone-zone.tab"
-
-S = "${WORKDIR}"
-
-DEFAULT_TIMEZONE ?= "Universal"
-INSTALL_TIMEZONE_FILE ?= "1"
-
-TZONES= "africa antarctica asia australasia europe northamerica southamerica  \
-         factory etcetera backward systemv \
-        "
-# pacificnew 
-
-do_compile () {
-        for zone in ${TZONES}; do \
-            ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \
-                -y ${S}/yearistype.sh ${S}/${zone} ; \
-            ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \
-                -y ${S}/yearistype.sh ${S}/${zone} ; \
-            ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \
-                -y ${S}/yearistype.sh ${S}/${zone} ; \
-        done
-}
-
-do_install () {
-        install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo
-        cp -pPR ${S}/$exec_prefix ${D}/
-        # libc is removing zoneinfo files from package
-        cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo
-        cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo
-
-        # Install default timezone
-        if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
-            install -d ${D}${sysconfdir}
-            if [ "${INSTALL_TIMEZONE_FILE}" = "1" ]; then
-                echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
-            fi
-            ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
-        else
-            bberror "DEFAULT_TIMEZONE is set to an invalid value."
-            exit 1
-        fi
-
-        chown -R root:root ${D}
-}
-
-pkg_postinst_${PN} () {
-	etc_lt="$D${sysconfdir}/localtime"
-	src="$D${sysconfdir}/timezone"
-
-	if [ -e ${src} ] ; then
-		tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
-	fi
-	
-	if [ -z "${tz}" ] ; then
-		exit 0
-	fi
-	
-	if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then
-		echo "You have an invalid TIMEZONE setting in ${src}"
-		echo "Your ${etc_lt} has been reset to Universal; enjoy!"
-		tz="Universal"
-		echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
-		if [ -L ${etc_lt} ] ; then
-			rm -f "${etc_lt}"
-		fi
-		ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}"
-	fi
-}
-
-# Packages primarily organized by directory with a major city
-# in most time zones in the base package
-
-PACKAGES = "tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \
-    tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
-    tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific"
-
-FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*"
-RPROVIDES_tzdata-africa = "tzdata-africa"
-
-FILES_tzdata-americas += "${datadir}/zoneinfo/America/*  \
-                ${datadir}/zoneinfo/US/*                \
-                ${datadir}/zoneinfo/Brazil/*            \
-                ${datadir}/zoneinfo/Canada/*            \
-                ${datadir}/zoneinfo/Mexico/*            \
-                ${datadir}/zoneinfo/Chile/*"
-RPROVIDES_tzdata-americas = "tzdata-americas"
-
-FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*"
-RPROVIDES_tzdata-antarctica = "tzdata-antarctica"
-
-FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*"
-RPROVIDES_tzdata-arctic = "tzdata-arctic"
-
-FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/*        \
-                ${datadir}/zoneinfo/Indian/*            \
-                ${datadir}/zoneinfo/Mideast/*"
-RPROVIDES_tzdata-asia = "tzdata-asia"
-
-FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*"
-RPROVIDES_tzdata-atlantic = "tzdata-atlantic"
-
-FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*"
-RPROVIDES_tzdata-australia = "tzdata-australia"
-
-FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*"
-RPROVIDES_tzdata-europe = "tzdata-europe"
-
-FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*"
-RPROVIDES_tzdata-pacific = "tzdata-pacific"
-
-FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*"
-RPROVIDES_tzdata-posix = "tzdata-posix"
-
-FILES_tzdata-right += "${datadir}/zoneinfo/right/*"
-RPROVIDES_tzdata-right = "tzdata-right"
-
-
-FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba           \
-                ${datadir}/zoneinfo/Egypt                \
-                ${datadir}/zoneinfo/Eire                 \
-                ${datadir}/zoneinfo/Factory              \
-                ${datadir}/zoneinfo/GB-Eire              \
-                ${datadir}/zoneinfo/Hongkong             \
-                ${datadir}/zoneinfo/Iceland              \
-                ${datadir}/zoneinfo/Iran                 \
-                ${datadir}/zoneinfo/Israel               \
-                ${datadir}/zoneinfo/Jamaica              \
-                ${datadir}/zoneinfo/Japan                \
-                ${datadir}/zoneinfo/Kwajalein            \
-                ${datadir}/zoneinfo/Libya                \
-                ${datadir}/zoneinfo/Navajo               \
-                ${datadir}/zoneinfo/Poland               \
-                ${datadir}/zoneinfo/Portugal             \
-                ${datadir}/zoneinfo/Singapore            \
-                ${datadir}/zoneinfo/Turkey"
-RPROVIDES_tzdata-misc = "tzdata-misc"
-
-
-FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu     \
-                ${datadir}/zoneinfo/America/Anchorage    \
-                ${datadir}/zoneinfo/America/Los_Angeles  \
-                ${datadir}/zoneinfo/America/Denver       \
-                ${datadir}/zoneinfo/America/Chicago      \
-                ${datadir}/zoneinfo/America/New_York     \
-                ${datadir}/zoneinfo/America/Caracas      \
-                ${datadir}/zoneinfo/America/Sao_Paulo    \
-                ${datadir}/zoneinfo/Europe/London        \
-                ${datadir}/zoneinfo/Europe/Paris         \
-                ${datadir}/zoneinfo/Africa/Cairo         \
-                ${datadir}/zoneinfo/Europe/Moscow        \
-                ${datadir}/zoneinfo/Asia/Dubai           \
-                ${datadir}/zoneinfo/Asia/Karachi         \
-                ${datadir}/zoneinfo/Asia/Dhaka           \
-                ${datadir}/zoneinfo/Asia/Bankok          \
-                ${datadir}/zoneinfo/Asia/Hong_Kong       \
-                ${datadir}/zoneinfo/Asia/Tokyo           \
-                ${datadir}/zoneinfo/Australia/Darwin     \
-                ${datadir}/zoneinfo/Australia/Adelaide   \
-                ${datadir}/zoneinfo/Australia/Brisbane   \
-                ${datadir}/zoneinfo/Australia/Sydney     \
-                ${datadir}/zoneinfo/Pacific/Noumea       \
-                ${datadir}/zoneinfo/CET                  \
-                ${datadir}/zoneinfo/CST6CDT              \
-                ${datadir}/zoneinfo/EET                  \
-                ${datadir}/zoneinfo/EST                  \
-                ${datadir}/zoneinfo/EST5EDT              \
-                ${datadir}/zoneinfo/GB                   \
-                ${datadir}/zoneinfo/GMT                  \
-                ${datadir}/zoneinfo/GMT+0                \
-                ${datadir}/zoneinfo/GMT-0                \
-                ${datadir}/zoneinfo/GMT0                 \
-                ${datadir}/zoneinfo/Greenwich            \
-                ${datadir}/zoneinfo/HST                  \
-                ${datadir}/zoneinfo/MET                  \
-                ${datadir}/zoneinfo/MST                  \
-                ${datadir}/zoneinfo/MST7MDT              \
-                ${datadir}/zoneinfo/NZ                   \
-                ${datadir}/zoneinfo/NZ-CHAT              \
-                ${datadir}/zoneinfo/PRC                  \
-                ${datadir}/zoneinfo/PST8PDT              \
-                ${datadir}/zoneinfo/ROC                  \
-                ${datadir}/zoneinfo/ROK                  \
-                ${datadir}/zoneinfo/UCT                  \
-                ${datadir}/zoneinfo/UTC                  \
-                ${datadir}/zoneinfo/Universal            \
-                ${datadir}/zoneinfo/W-SU                 \
-                ${datadir}/zoneinfo/WET                  \
-                ${datadir}/zoneinfo/Zulu                 \
-                ${datadir}/zoneinfo/zone.tab             \
-                ${datadir}/zoneinfo/iso3166.tab          \
-                ${datadir}/zoneinfo/Etc/*"
-
-CONFFILES_${PN} += "${@ "${sysconfdir}/timezone" if bb.utils.to_boolean(d.getVar('INSTALL_TIMEZONE_FILE', True)) else "" }"
-CONFFILES_${PN} += "${sysconfdir}/localtime"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2017b.bb b/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2017b.bb
new file mode 100644
index 0000000..55e8976
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2017b.bb
@@ -0,0 +1,215 @@
+SUMMARY = "Timezone data"
+HOMEPAGE = "http://www.iana.org/time-zones"
+SECTION = "base"
+LICENSE = "PD & BSD & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ef1a352b901ee7b75a75df8171d6aca7"
+
+DEPENDS = "tzcode-native"
+
+SRC_URI = "http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
+UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
+
+SRC_URI[tzdata.md5sum] = "50dc0dc50c68644c1f70804f2e7a1625"
+SRC_URI[tzdata.sha256sum] = "f8242a522ea3496b0ce4ff4f2e75a049178da21001a08b8e666d8cbe07d18086"
+
+inherit allarch
+
+RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarctica \
+             timezone-arctic timezone-asia timezone-atlantic \
+             timezone-australia timezone-europe timezone-indian \
+             timezone-iso3166.tab timezone-pacific timezone-zone.tab"
+
+S = "${WORKDIR}"
+
+DEFAULT_TIMEZONE ?= "Universal"
+INSTALL_TIMEZONE_FILE ?= "1"
+
+TZONES= "africa antarctica asia australasia europe northamerica southamerica  \
+         factory etcetera backward systemv \
+        "
+# pacificnew 
+
+do_compile () {
+        for zone in ${TZONES}; do \
+            ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \
+                -y ${S}/yearistype.sh ${S}/${zone} ; \
+            ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \
+                -y ${S}/yearistype.sh ${S}/${zone} ; \
+            ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \
+                -y ${S}/yearistype.sh ${S}/${zone} ; \
+        done
+}
+
+do_install () {
+        install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo
+        cp -pPR ${S}/$exec_prefix ${D}/
+        # libc is removing zoneinfo files from package
+        cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo
+        cp -pP "${S}/zone1970.tab" ${D}${datadir}/zoneinfo
+        cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo
+
+        # Install default timezone
+        if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
+            install -d ${D}${sysconfdir}
+            if [ "${INSTALL_TIMEZONE_FILE}" = "1" ]; then
+                echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
+            fi
+            ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
+        else
+            bberror "DEFAULT_TIMEZONE is set to an invalid value."
+            exit 1
+        fi
+
+        chown -R root:root ${D}
+}
+
+pkg_postinst_${PN} () {
+	etc_lt="$D${sysconfdir}/localtime"
+	src="$D${sysconfdir}/timezone"
+
+	if [ -e ${src} ] ; then
+		tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
+	fi
+	
+	if [ -z "${tz}" ] ; then
+		exit 0
+	fi
+	
+	if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then
+		echo "You have an invalid TIMEZONE setting in ${src}"
+		echo "Your ${etc_lt} has been reset to Universal; enjoy!"
+		tz="Universal"
+		echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
+		if [ -L ${etc_lt} ] ; then
+			rm -f "${etc_lt}"
+		fi
+		ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}"
+	fi
+}
+
+# Packages primarily organized by directory with a major city
+# in most time zones in the base package
+
+PACKAGES = "tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \
+    tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
+    tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific"
+
+FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*"
+RPROVIDES_tzdata-africa = "tzdata-africa"
+
+FILES_tzdata-americas += "${datadir}/zoneinfo/America/*  \
+                ${datadir}/zoneinfo/US/*                \
+                ${datadir}/zoneinfo/Brazil/*            \
+                ${datadir}/zoneinfo/Canada/*            \
+                ${datadir}/zoneinfo/Mexico/*            \
+                ${datadir}/zoneinfo/Chile/*"
+RPROVIDES_tzdata-americas = "tzdata-americas"
+
+FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*"
+RPROVIDES_tzdata-antarctica = "tzdata-antarctica"
+
+FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*"
+RPROVIDES_tzdata-arctic = "tzdata-arctic"
+
+FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/*        \
+                ${datadir}/zoneinfo/Indian/*            \
+                ${datadir}/zoneinfo/Mideast/*"
+RPROVIDES_tzdata-asia = "tzdata-asia"
+
+FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*"
+RPROVIDES_tzdata-atlantic = "tzdata-atlantic"
+
+FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*"
+RPROVIDES_tzdata-australia = "tzdata-australia"
+
+FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*"
+RPROVIDES_tzdata-europe = "tzdata-europe"
+
+FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*"
+RPROVIDES_tzdata-pacific = "tzdata-pacific"
+
+FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*"
+RPROVIDES_tzdata-posix = "tzdata-posix"
+
+FILES_tzdata-right += "${datadir}/zoneinfo/right/*"
+RPROVIDES_tzdata-right = "tzdata-right"
+
+
+FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba           \
+                ${datadir}/zoneinfo/Egypt                \
+                ${datadir}/zoneinfo/Eire                 \
+                ${datadir}/zoneinfo/Factory              \
+                ${datadir}/zoneinfo/GB-Eire              \
+                ${datadir}/zoneinfo/Hongkong             \
+                ${datadir}/zoneinfo/Iceland              \
+                ${datadir}/zoneinfo/Iran                 \
+                ${datadir}/zoneinfo/Israel               \
+                ${datadir}/zoneinfo/Jamaica              \
+                ${datadir}/zoneinfo/Japan                \
+                ${datadir}/zoneinfo/Kwajalein            \
+                ${datadir}/zoneinfo/Libya                \
+                ${datadir}/zoneinfo/Navajo               \
+                ${datadir}/zoneinfo/Poland               \
+                ${datadir}/zoneinfo/Portugal             \
+                ${datadir}/zoneinfo/Singapore            \
+                ${datadir}/zoneinfo/Turkey"
+RPROVIDES_tzdata-misc = "tzdata-misc"
+
+
+FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu     \
+                ${datadir}/zoneinfo/America/Anchorage    \
+                ${datadir}/zoneinfo/America/Los_Angeles  \
+                ${datadir}/zoneinfo/America/Denver       \
+                ${datadir}/zoneinfo/America/Chicago      \
+                ${datadir}/zoneinfo/America/New_York     \
+                ${datadir}/zoneinfo/America/Caracas      \
+                ${datadir}/zoneinfo/America/Sao_Paulo    \
+                ${datadir}/zoneinfo/Europe/London        \
+                ${datadir}/zoneinfo/Europe/Paris         \
+                ${datadir}/zoneinfo/Africa/Cairo         \
+                ${datadir}/zoneinfo/Europe/Moscow        \
+                ${datadir}/zoneinfo/Asia/Dubai           \
+                ${datadir}/zoneinfo/Asia/Karachi         \
+                ${datadir}/zoneinfo/Asia/Dhaka           \
+                ${datadir}/zoneinfo/Asia/Bankok          \
+                ${datadir}/zoneinfo/Asia/Hong_Kong       \
+                ${datadir}/zoneinfo/Asia/Tokyo           \
+                ${datadir}/zoneinfo/Australia/Darwin     \
+                ${datadir}/zoneinfo/Australia/Adelaide   \
+                ${datadir}/zoneinfo/Australia/Brisbane   \
+                ${datadir}/zoneinfo/Australia/Sydney     \
+                ${datadir}/zoneinfo/Pacific/Noumea       \
+                ${datadir}/zoneinfo/CET                  \
+                ${datadir}/zoneinfo/CST6CDT              \
+                ${datadir}/zoneinfo/EET                  \
+                ${datadir}/zoneinfo/EST                  \
+                ${datadir}/zoneinfo/EST5EDT              \
+                ${datadir}/zoneinfo/GB                   \
+                ${datadir}/zoneinfo/GMT                  \
+                ${datadir}/zoneinfo/GMT+0                \
+                ${datadir}/zoneinfo/GMT-0                \
+                ${datadir}/zoneinfo/GMT0                 \
+                ${datadir}/zoneinfo/Greenwich            \
+                ${datadir}/zoneinfo/HST                  \
+                ${datadir}/zoneinfo/MET                  \
+                ${datadir}/zoneinfo/MST                  \
+                ${datadir}/zoneinfo/MST7MDT              \
+                ${datadir}/zoneinfo/NZ                   \
+                ${datadir}/zoneinfo/NZ-CHAT              \
+                ${datadir}/zoneinfo/PRC                  \
+                ${datadir}/zoneinfo/PST8PDT              \
+                ${datadir}/zoneinfo/ROC                  \
+                ${datadir}/zoneinfo/ROK                  \
+                ${datadir}/zoneinfo/UCT                  \
+                ${datadir}/zoneinfo/UTC                  \
+                ${datadir}/zoneinfo/Universal            \
+                ${datadir}/zoneinfo/W-SU                 \
+                ${datadir}/zoneinfo/WET                  \
+                ${datadir}/zoneinfo/Zulu                 \
+                ${datadir}/zoneinfo/zone.tab             \
+                ${datadir}/zoneinfo/zone1970.tab         \
+                ${datadir}/zoneinfo/iso3166.tab          \
+                ${datadir}/zoneinfo/Etc/*"
+
+CONFFILES_${PN} += "${@ "${sysconfdir}/timezone" if bb.utils.to_boolean(d.getVar('INSTALL_TIMEZONE_FILE')) else "" }"
+CONFFILES_${PN} += "${sysconfdir}/localtime"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/18-cve-2014-9913-unzip-buffer-overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/18-cve-2014-9913-unzip-buffer-overflow.patch
new file mode 100644
index 0000000..3c02d59
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/18-cve-2014-9913-unzip-buffer-overflow.patch
@@ -0,0 +1,33 @@
+From: "Steven M. Schweda" <sms@antinode.info>
+Subject: Fix CVE-2014-9913, buffer overflow in unzip
+Bug: https://sourceforge.net/p/infozip/bugs/27/
+Bug-Debian: https://bugs.debian.org/847485
+Bug-Ubuntu: https://launchpad.net/bugs/387350
+X-Debian-version: 6.0-21
+
+Upstream-Status: Backport
+CVE: CVE-2014-9913
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+
+--- a/list.c
++++ b/list.c
+@@ -339,7 +339,18 @@
+                 G.crec.compression_method == ENHDEFLATED) {
+                 methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3];
+             } else if (methnum >= NUM_METHODS) {
+-                sprintf(&methbuf[4], "%03u", G.crec.compression_method);
++                /* 2013-02-26 SMS.
++                 * http://sourceforge.net/p/infozip/bugs/27/  CVE-2014-9913.
++                 * Unexpectedly large compression methods overflow
++                 * &methbuf[].  Use the old, three-digit decimal format
++                 * for values which fit.  Otherwise, sacrifice the
++                 * colon, and use four-digit hexadecimal.
++                 */
++                if (G.crec.compression_method <= 999) {
++                    sprintf( &methbuf[ 4], "%03u", G.crec.compression_method);
++                } else {
++                    sprintf( &methbuf[ 3], "%04X", G.crec.compression_method);
++                }
+             }
+ 
+ #if 0       /* GRR/Euro:  add this? */
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/19-cve-2016-9844-zipinfo-buffer-overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/19-cve-2016-9844-zipinfo-buffer-overflow.patch
new file mode 100644
index 0000000..ffadbc2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/19-cve-2016-9844-zipinfo-buffer-overflow.patch
@@ -0,0 +1,32 @@
+From: "Steven M. Schweda" <sms@antinode.info>
+Subject: Fix CVE-2016-9844, buffer overflow in zipinfo
+Bug-Debian: https://bugs.debian.org/847486
+Bug-Ubuntu: https://launchpad.net/bugs/1643750
+X-Debian-version: 6.0-21
+
+Upstream-Status: Backport
+CVE: CVE-2016-9844
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+
+--- a/zipinfo.c
++++ b/zipinfo.c
+@@ -1921,7 +1921,18 @@
+         ush  dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3);
+         methbuf[3] = dtype[dnum];
+     } else if (methnum >= NUM_METHODS) {   /* unknown */
+-        sprintf(&methbuf[1], "%03u", G.crec.compression_method);
++        /* 2016-12-05 SMS.
++         * https://launchpad.net/bugs/1643750
++         * Unexpectedly large compression methods overflow
++         * &methbuf[].  Use the old, three-digit decimal format
++         * for values which fit.  Otherwise, sacrifice the "u",
++         * and use four-digit hexadecimal.
++         */
++        if (G.crec.compression_method <= 999) {
++            sprintf( &methbuf[ 1], "%03u", G.crec.compression_method);
++        } else {
++            sprintf( &methbuf[ 0], "%04X", G.crec.compression_method);
++        }
+     }
+ 
+     for (k = 0;  k < 15;  ++k)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb
index 547379c..d4ee487 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb
@@ -16,7 +16,9 @@
 	file://11-cve-2014-8141-getzip64data.patch \
 	file://CVE-2015-7696.patch \
 	file://CVE-2015-7697.patch \
-        file://fix-security-format.patch \
+	file://fix-security-format.patch \
+	file://18-cve-2014-9913-unzip-buffer-overflow.patch \
+	file://19-cve-2016-9844-zipinfo-buffer-overflow.patch \
 "
 
 SRC_URI[md5sum] = "62b490407489521db863b523a7f86375"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.15.bb b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.15.bb
index cedfc04..9659f27 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.15.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.15.bb
@@ -52,8 +52,9 @@
     ${sbindir}/wd_keepalive \
 "
 
-RDEPENDS_${PN} += "${PN}-config ${PN}-keepalive"
+RDEPENDS_${PN} += "${PN}-config"
+RRECOMMENDS_${PN} += "kernel-module-softdog"
+
 RDEPENDS_${PN}-keepalive += "${PN}-config"
-
-RRECOMMENDS_${PN} = "kernel-module-softdog"
-
+RCONFLICTS_${PN}-keepalive += "${PN}"
+RRECOMMENDS_${PN}-keepalive += "kernel-module-softdog"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc b/import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc
index c4abfe4..1299edb 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc
+++ b/import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc
@@ -5,8 +5,6 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 DEPENDS = "gnutls zlib libpcre"
 
-INC_PR = "r16"
-
 inherit autotools gettext texinfo update-alternatives pkgconfig
 
 EXTRA_OECONF = "--with-ssl=gnutls --disable-rpath --disable-iri \
@@ -18,9 +16,9 @@
 
 RRECOMMENDS_${PN} += "ca-certificates"
 
-BBCLASSEXTEND += "nativesdk"
+BBCLASSEXTEND = "nativesdk"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[libuuid] = "--with-libuuid, --without-libuuid,util-linux"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/wget/wget/CVE-2017-6508.patch b/import-layers/yocto-poky/meta/recipes-extended/wget/wget/CVE-2017-6508.patch
new file mode 100644
index 0000000..b9c290f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/wget/wget/CVE-2017-6508.patch
@@ -0,0 +1,44 @@
+From 4d729e322fae359a1aefaafec1144764a54e8ad4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
+Date: Mon, 6 Mar 2017 10:04:22 +0100
+Subject: [PATCH] Fix CRLF injection in Wget host part
+
+* src/url.c (url_parse): Reject control characters in host part of URL
+
+Reported-by: Orange Tsai
+
+Upstream-Status: Backport
+[http://git.savannah.gnu.org/cgit/wget.git/commit/?id=4d729e322fae359a1aefaafec1144764a54e8ad4]
+
+CVE: CVE-2017-6508
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ src/url.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/src/url.c b/src/url.c
+index 8f8ff0b..7d36b27 100644
+--- a/src/url.c
++++ b/src/url.c
+@@ -925,6 +925,17 @@ url_parse (const char *url, int *error, struct iri *iri, bool percent_encode)
+       url_unescape (u->host);
+       host_modified = true;
+ 
++      /* check for invalid control characters in host name */
++      for (p = u->host; *p; p++)
++        {
++          if (c_iscntrl(*p))
++            {
++              url_free(u);
++              error_code = PE_INVALID_HOST_NAME;
++              goto error;
++            }
++        }
++
+       /* Apply IDNA regardless of iri->utf8_encode status */
+       if (opt.enable_iri && iri)
+         {
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.18.bb b/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.18.bb
deleted file mode 100644
index c969b98..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.18.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \
-           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
-          "
-
-SRC_URI[md5sum] = "fc2debd8399e3b933a9b226794e2a886"
-SRC_URI[sha256sum] = "a00a65fab84cc46e24c53ce88c45604668a7a479276e037dc2f558e34717fb2d"
-
-require wget.inc
diff --git a/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.19.1.bb b/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.19.1.bb
new file mode 100644
index 0000000..78bde95
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.19.1.bb
@@ -0,0 +1,9 @@
+SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           file://CVE-2017-6508.patch \
+          "
+
+SRC_URI[md5sum] = "87cea36b7161fd43e3fd51a4e8b89689"
+SRC_URI[sha256sum] = "9e4f12da38cc6167d0752d934abe27c7b1599a9af294e73829be7ac7b5b4da40"
+
+require wget.inc
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch
deleted file mode 100644
index 495cdc6..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Subject: [PATCH] automake foreign strictness
-
-Use foreign strictness to avoid automake errors.
-
-Upstream-Status: Inappropriate [upstream no longer active]
-
-Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
----
- configure.ac |    5 +++--
- 1 files changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index b30b6f5..bd3222c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1,6 +1,7 @@
- dnl Process this file with autoconf to produce a configure script.
--AC_INIT(which.c)
--AM_INIT_AUTOMAKE(which, 2.18)
-+AC_INIT([which],[2.18])
-+AC_CONFIG_SRCDIR(which.c)
-+AM_INIT_AUTOMAKE([foreign])
- AM_CONFIG_HEADER(config.h)
- AM_MAINTAINER_MODE
- 
--- 
-1.7.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch
deleted file mode 100644
index 0e0988b..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Upstream-Status: Inappropriate [this is 2.18(GPLv2) specific]
-
-# glibc also implements the function group_member. To avoid name conflict,
-# here let us append a "_" to which's version.
-#
-# Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>, 2010-08-20
-# (this patch is licensed under GPLv2)
-
---- which-2.18/bash.c
-+++ which-2.18/bash.c
-@@ -45,7 +45,12 @@
-  * - changed all occurences of 'gid_t' into 'GID_T'.
-  * - exported functions needed in which.c
-  */
--static int group_member (GID_T gid);
-+
-+/*
-+ * glibc also implements the function group_member. To avoid name conflict,
-+ * here let us append a "_" to which's version.
-+ */
-+static int _group_member (GID_T gid);
- static char* extract_colon_unit (char const* string, int *p_index);
- 
- /*===========================================================================
-@@ -200,8 +205,8 @@
- 
- /* From bash-2.05b / general.c / line 805 */
- /* Return non-zero if GID is one that we have in our groups list. */
--int
--group_member (GID_T gid)
-+static int
-+_group_member (GID_T gid)
- {
- #if defined (HAVE_GETGROUPS)
-   register int i;
-@@ -290,7 +295,7 @@
-     return (X_BIT (u_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS;
- 
-   /* Otherwise, if we are in the owning group, the group permissions apply. */
--  if (group_member (finfo.st_gid))
-+  if (_group_member (finfo.st_gid))
-     return (X_BIT (g_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS;
- 
-   /* Otherwise, if we are in the other group, the other permissions apply. */
-@@ -331,7 +336,7 @@
- /* Given a string containing units of information separated by colons,
-    return the next one pointed to by (P_INDEX), or NULL if there are no more.
-    Advance (P_INDEX) to the character after the colon. */
--char*
-+static char*
- extract_colon_unit (char const* string, int* p_index)
- {
-   int i, start, len;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb
deleted file mode 100644
index eb6cc99..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-SUMMARY = "Displays the full path of shell commands"
-DESCRIPTION = "Which is a utility that prints out the full path of the \
-executables that bash(1) would execute when the passed \
-program names would have been entered on the shell prompt. \
-It does this by using the exact same algorithm as bash."
-SECTION = "libs"
-HOMEPAGE = "http://carlo17.home.xs4all.nl/which/"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-
-PR = "r2"
-
-SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/which/which-2.18.tar.gz/42d51938e48b91f6e19fabf216f5c3e9/which-${PV}.tar.gz \
-           file://fix_name_conflict_group_member.patch \
-           file://automake-foreign.patch \
-"
-
-SRC_URI[md5sum] = "42d51938e48b91f6e19fabf216f5c3e9"
-SRC_URI[sha256sum] = "9445cd7e02ec0c26a44fd56098464ded064ba5d93dd2e15ec12410ba56b2e544"
-
-DEPENDS = "cwautomacros-native"
-
-inherit autotools texinfo update-alternatives
-
-do_configure_prepend() {
-	OLD="@ACLOCAL_CWFLAGS@"
-	NEW="-I ${STAGING_DIR_NATIVE}/${datadir}/cwautomacros/m4"
-	sed -i "s#${OLD}#${NEW}#g" `grep -rl ${OLD} ${S}`
-}
-
-ALTERNATIVE_${PN} = "which"
-ALTERNATIVE_PRIORITY = "100"
-
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb
index a7687f6..fac0fd3 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb
@@ -30,3 +30,6 @@
 
 ALTERNATIVE_${PN} = "which"
 ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}-doc = "which.1"
+ALTERNATIVE_LINK_NAME[which.1] = "${mandir}/man1/which.1"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.bb b/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.bb
deleted file mode 100644
index d118f3a..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-SUMMARY = "Utilities for managing LZMA compressed files"
-HOMEPAGE = "http://tukaani.org/xz/"
-SECTION = "base"
-
-# The source includes bits of PD, GPLv2, GPLv3, LGPLv2.1+, but the only file
-# which is GPLv3 is an m4 macro which isn't shipped in any of our packages,
-# and the LGPL bits are under lib/, which appears to be used for libgnu, which
-# appears to be used for DOS builds. So we're left with GPLv2+ and PD.
-LICENSE = "GPLv2+ & GPL-3.0-with-autoconf-exception & LGPLv2.1+ & PD"
-LICENSE_${PN} = "GPLv2+"
-LICENSE_${PN}-dev = "GPLv2+"
-LICENSE_${PN}-staticdev = "GPLv2+"
-LICENSE_${PN}-doc = "GPLv2+"
-LICENSE_${PN}-dbg = "GPLv2+"
-LICENSE_${PN}-locale = "GPLv2+"
-LICENSE_liblzma = "PD"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=c475b6c7dca236740ace4bba553e8e1c \
-                    file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \
-                    file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 "
-
-SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.gz"
-SRC_URI[md5sum] = "7cf6a8544a7dae8e8106fdf7addfa28c"
-SRC_URI[sha256sum] = "73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2"
-
-inherit autotools gettext
-
-PACKAGES =+ "liblzma"
-
-FILES_liblzma = "${libdir}/liblzma*${SOLIBS}"
-
-BBCLASSEXTEND = "native nativesdk"
-
-export CONFIG_SHELL="/bin/sh"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.3.bb b/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.3.bb
new file mode 100644
index 0000000..c0f8b82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.3.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utilities for managing LZMA compressed files"
+HOMEPAGE = "http://tukaani.org/xz/"
+SECTION = "base"
+
+# The source includes bits of PD, GPLv2, GPLv3, LGPLv2.1+, but the only file
+# which is GPLv3 is an m4 macro which isn't shipped in any of our packages,
+# and the LGPL bits are under lib/, which appears to be used for libgnu, which
+# appears to be used for DOS builds. So we're left with GPLv2+ and PD.
+LICENSE = "GPLv2+ & GPL-3.0-with-autoconf-exception & LGPLv2.1+ & PD"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_${PN}-dev = "GPLv2+"
+LICENSE_${PN}-staticdev = "GPLv2+"
+LICENSE_${PN}-doc = "GPLv2+"
+LICENSE_${PN}-dbg = "GPLv2+"
+LICENSE_${PN}-locale = "GPLv2+"
+LICENSE_liblzma = "PD"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c475b6c7dca236740ace4bba553e8e1c \
+                    file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \
+                    file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 "
+
+SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.gz"
+SRC_URI[md5sum] = "ef68674fb47a8b8e741b34e429d86e9d"
+SRC_URI[sha256sum] = "71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb"
+
+inherit autotools gettext
+
+PACKAGES =+ "liblzma"
+
+FILES_liblzma = "${libdir}/liblzma*${SOLIBS}"
+
+BBCLASSEXTEND = "native nativesdk"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/epiphany/epiphany_3.20.3.bb b/import-layers/yocto-poky/meta/recipes-gnome/epiphany/epiphany_3.20.3.bb
deleted file mode 100644
index eba480b..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/epiphany/epiphany_3.20.3.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-SUMMARY = "WebKit based web browser for GNOME"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-
-DEPENDS = "libsoup-2.4 webkitgtk gtk+3 iso-codes ca-certificates avahi libnotify gcr libwnck3 \
-	   gsettings-desktop-schemas gnome-desktop3 libxml2-native intltool-native"
-
-inherit gnomebase gsettings distro_features_check upstream-version-is-even
-# libwnck3 is x11 only
-REQUIRED_DISTRO_FEATURES = "x11"
-
-SRC_URI += "file://0001-yelp.m4-drop-the-check-for-itstool.patch"
-SRC_URI[archive.md5sum] = "31822b6b199f724f212ae9200bc055f1"
-SRC_URI[archive.sha256sum] = "4d9de1bdb44c14adf25aa6dc02ea3de60925cff5eb01fe89545e6032c9b424a2"
-
-EXTRA_OECONF += " --disable-nss --with-distributor-name=${DISTRO}"
-
-do_configure_prepend() {
-    sed -i -e s:help::g ${S}/Makefile.am
-}
-
-FILES_${PN} += "${datadir}/appdata ${datadir}/dbus-1 ${datadir}/gnome-shell/search-providers"
-RDEPENDS_${PN} = "iso-codes adwaita-icon-theme"
-RRECOMMENDS_${PN} = "ca-certificates"
-
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/epiphany/epiphany_3.22.6.bb b/import-layers/yocto-poky/meta/recipes-gnome/epiphany/epiphany_3.22.6.bb
new file mode 100644
index 0000000..651fef1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/epiphany/epiphany_3.22.6.bb
@@ -0,0 +1,23 @@
+SUMMARY = "WebKit based web browser for GNOME"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "libsoup-2.4 webkitgtk gtk+3 iso-codes avahi libnotify gcr \
+	   gsettings-desktop-schemas gnome-desktop3 libxml2-native \
+	   intltool-native glib-2.0 glib-2.0-native"
+
+inherit gnomebase gsettings distro_features_check upstream-version-is-even gettext
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI += "file://0001-yelp.m4-drop-the-check-for-itstool.patch"
+SRC_URI[archive.md5sum] = "e08762c6bb01c4d291b3d22c7adb1a65"
+SRC_URI[archive.sha256sum] = "de7ea87dc450702bde620033f9e2ce807859727d007396d86b09f2b82397fcc2"
+
+EXTRA_OECONF += " --with-distributor-name=${DISTRO}"
+
+do_configure_prepend() {
+    sed -i -e s:help::g ${S}/Makefile.am
+}
+
+FILES_${PN} += "${datadir}/appdata ${datadir}/dbus-1 ${datadir}/gnome-shell/search-providers"
+RDEPENDS_${PN} = "iso-codes adwaita-icon-theme"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gcr/files/gcr-add-missing-dependencies-for-vapi.patch b/import-layers/yocto-poky/meta/recipes-gnome/gcr/files/gcr-add-missing-dependencies-for-vapi.patch
new file mode 100644
index 0000000..a205429
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gcr/files/gcr-add-missing-dependencies-for-vapi.patch
@@ -0,0 +1,51 @@
+From e7e0c56ca82031121f192f7f711b78418b154c9f Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 28 Nov 2016 10:17:34 +0800
+Subject: [PATCH] gcr: add missing dependencies for vapi
+
+According to the vapi_DEPS definition:
+gcr-3.vapi depends on gck-1.vapi,
+gcr-ui-3.vapi depends on gck-1.vapi and gcr-3.vapi
+
+But these dependencies are missing for the make targets,
+so it will fail when build in parallel:
+error: Package `gck-1' not found in specified Vala API directories or GObject-Introspection GIR directories
+error: Package `gcr-3' not found in specified Vala API directories or GObject-Introspection GIR directories
+
+Upstream-Status: Submitted [https://bug775966.bugzilla-attachments.gnome.org/attachment.cgi?id=341791]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ gcr/Makefile.am | 2 +-
+ ui/Makefile.am  | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcr/Makefile.am b/gcr/Makefile.am
+index eda302f..6e78dba 100644
+--- a/gcr/Makefile.am
++++ b/gcr/Makefile.am
+@@ -221,7 +221,7 @@ gir_DATA += Gcr-@GCR_MAJOR@.gir
+ 
+ if ENABLE_VAPIGEN
+ 
+-gcr-@GCR_MAJOR@.vapi: Gcr-@GCR_MAJOR@.gir gcr/Gcr-@GCR_MAJOR@.metadata gcr-@GCR_MAJOR@.deps
++gcr-@GCR_MAJOR@.vapi: Gcr-@GCR_MAJOR@.gir gcr/Gcr-@GCR_MAJOR@.metadata gcr-@GCR_MAJOR@.deps gck-@GCK_MAJOR@.vapi
+ 
+ VAPIGEN_VAPIS += gcr-@GCR_MAJOR@.vapi
+ 
+diff --git a/ui/Makefile.am b/ui/Makefile.am
+index aa52476..6612f0d 100644
+--- a/ui/Makefile.am
++++ b/ui/Makefile.am
+@@ -160,7 +160,7 @@ gir_DATA += GcrUi-@GCR_MAJOR@.gir
+ 
+ if ENABLE_VAPIGEN
+ 
+-gcr-ui-@GCR_MAJOR@.vapi: GcrUi-@GCR_MAJOR@.gir ui/GcrUi-@GCR_MAJOR@.metadata gcr-ui-@GCR_MAJOR@.deps
++gcr-ui-@GCR_MAJOR@.vapi: GcrUi-@GCR_MAJOR@.gir ui/GcrUi-@GCR_MAJOR@.metadata gcr-ui-@GCR_MAJOR@.deps gck-@GCK_MAJOR@.vapi gcr-@GCR_MAJOR@.vapi
+ 
+ VAPIGEN_VAPIS += gcr-ui-@GCR_MAJOR@.vapi
+ 
+-- 
+2.8.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gcr/gcr_3.20.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gcr/gcr_3.20.0.bb
index b32a455..f31abce 100644
--- a/import-layers/yocto-poky/meta/recipes-gnome/gcr/gcr_3.20.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gcr/gcr_3.20.0.bb
@@ -11,6 +11,8 @@
 # depends on gtk+3, but also x11 through gtk+-x11
 REQUIRED_DISTRO_FEATURES = "x11"
 
+SRC_URI += "file://gcr-add-missing-dependencies-for-vapi.patch"
+
 SRC_URI[archive.md5sum] = "4314bf89eac293dd0a9d806593ff1b35"
 SRC_URI[archive.sha256sum] = "90572c626d8a708225560c42b4421f7941315247fa1679d4ef569bde7f4bb379"
 
@@ -34,7 +36,3 @@
 #
 # This will be investigated later.
 EXTRA_OECONF_append_x86-64 = " --disable-introspection --disable-gtk-doc"
-
-# Gcr-3.broken: poky/build-mips64/tmp/work/mips64-poky-linux/libgpg-error/1.19-r0/libgpg-error-1.19/src/posix-lock.c:119: get_lock_object: Assertion `!"sizeof lock obj"' failed.
-# qemu: uncaught target signal 6 (Aborted) - core dumped
-EXTRA_OECONF_append_mips64 = " --disable-introspection --disable-gtk-doc"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Work-around-thumbnailer-cross-compile-failure.patch b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Work-around-thumbnailer-cross-compile-failure.patch
new file mode 100644
index 0000000..31ed988
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Work-around-thumbnailer-cross-compile-failure.patch
@@ -0,0 +1,47 @@
+From 6646e8aadc4030d891ac27c25494e5793d59dc85 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 22 Feb 2017 11:24:39 +0200
+Subject: [PATCH] Work-around thumbnailer cross-compile failure
+
+Install gdk-pixbuf-print-mime-types that's needed for thumbnail
+metadata generation.
+
+Use native gdk-pixbuf-print-mime-types when generating the thumbnail
+metadata. This works but the mime types will come from native
+loader.cache (which will only contain in-tree loaders), not from the
+target loader.cache.
+
+The upstream issue is https://bugzilla.gnome.org/show_bug.cgi?id=779057
+
+Upstream-Status: Inappropriate [workaround]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ thumbnailer/Makefile.am | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/thumbnailer/Makefile.am b/thumbnailer/Makefile.am
+index c9fe123..b0c6c70 100644
+--- a/thumbnailer/Makefile.am
++++ b/thumbnailer/Makefile.am
+@@ -1,5 +1,4 @@
+-bin_PROGRAMS = gdk-pixbuf-thumbnailer
+-noinst_PROGRAMS = gdk-pixbuf-print-mime-types
++bin_PROGRAMS = gdk-pixbuf-thumbnailer gdk-pixbuf-print-mime-types
+ 
+ gdk_pixbuf_thumbnailer_SOURCES = gdk-pixbuf-thumbnailer.c gnome-thumbnailer-skeleton.c gnome-thumbnailer-skeleton.h
+ gdk_pixbuf_thumbnailer_CPPFLAGS =			\
+@@ -25,9 +24,9 @@ gdk_pixbuf_print_mime_types_LDADD =			\
+ 
+ thumbnailerdir = $(datadir)/thumbnailers/
+ thumbnailer_DATA = gdk-pixbuf-thumbnailer.thumbnailer
+-gdk-pixbuf-thumbnailer.thumbnailer: gdk-pixbuf-thumbnailer.thumbnailer.in Makefile gdk-pixbuf-print-mime-types$(EXEEXT) $(top_builddir)/gdk-pixbuf/loaders.cache
++gdk-pixbuf-thumbnailer.thumbnailer: gdk-pixbuf-thumbnailer.thumbnailer.in Makefile gdk-pixbuf-print-mime-types$(EXEEXT)
+ 	$(AM_V_GEN) $(SED) -e "s|\@bindir\@|$(bindir)|"						\
+-	-e "s|\@mimetypes\@|`GDK_PIXBUF_MODULE_FILE=$(top_builddir)/gdk-pixbuf/loaders.cache GDK_PIXBUF_PIXDATA=$(top_builddir)/gdk-pixbuf/gdk-pixbuf-pixdata $(builddir)/gdk-pixbuf-print-mime-types`|" \
++	-e "s|\@mimetypes\@|`gdk-pixbuf-print-mime-types`|" \
+ 	$< > $@
+ 
+ EXTRA_DIST = gdk-pixbuf-thumbnailer.thumbnailer.in
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.34.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.34.0.bb
deleted file mode 100644
index 4f39494..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.34.0.bb
+++ /dev/null
@@ -1,102 +0,0 @@
-SUMMARY = "Image loading library for GTK+"
-HOMEPAGE = "http://www.gtk.org/"
-BUGTRACKER = "https://bugzilla.gnome.org/"
-
-LICENSE = "LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
-                    file://gdk-pixbuf/gdk-pixbuf.h;endline=26;md5=72b39da7cbdde2e665329fef618e1d6b"
-
-SECTION = "libs"
-
-DEPENDS = "glib-2.0"
-
-MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
-
-SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
-           file://hardcoded_libtool.patch \
-           file://extending-libinstall-dependencies.patch \
-           file://run-ptest \
-           file://fatal-loader.patch \
-           "
-
-SRC_URI[md5sum] = "63cb19f92cf7709ccf44bbb6fe1ff70c"
-SRC_URI[sha256sum] = "d55e5b383ee219bd0e23bf6ed4427d56a7db5379729a6e3e0a0e0eba9a8d8879"
-
-inherit autotools pkgconfig gettext pixbufcache ptest-gnome upstream-version-is-even gobject-introspection gtk-doc
-
-LIBV = "2.10.0"
-
-GDK_PIXBUF_LOADERS ?= "png jpeg"
-
-PACKAGECONFIG ??= "${GDK_PIXBUF_LOADERS}"
-PACKAGECONFIG_linuxstdbase = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} ${GDK_PIXBUF_LOADERS}"
-PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
-
-PACKAGECONFIG[png] = "--with-libpng,--without-libpng,libpng"
-PACKAGECONFIG[jpeg] = "--with-libjpeg,--without-libjpeg,jpeg"
-PACKAGECONFIG[tiff] = "--with-libtiff,--without-libtiff,tiff"
-PACKAGECONFIG[jpeg2000] = "--with-libjasper,--without-libjasper,jasper"
-
-# Use GIO to sniff image format instead of trying all loaders
-PACKAGECONFIG[gio-sniff] = "--enable-gio-sniffing,--disable-gio-sniffing,,shared-mime-info"
-PACKAGECONFIG[x11] = "--with-x11,--without-x11,virtual/libx11"
-
-PACKAGES =+ "${PN}-xlib"
-
-FILES_${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
-ALLOW_EMPTY_${PN}-xlib = "1"
-
-FILES_${PN} += "${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders"
-
-FILES_${PN}-dev += " \
-	${bindir}/gdk-pixbuf-csource \
-	${bindir}/gdk-pixbuf-pixdata \
-	${includedir}/* \
-	${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.la \
-"
-
-PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*"
-PACKAGES_DYNAMIC_class-native = ""
-
-python populate_packages_prepend () {
-    postinst_pixbufloader = d.getVar("postinst_pixbufloader", True)
-
-    loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders')
-
-    packages = ' '.join(do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
-    d.setVar('PIXBUF_PACKAGES', packages)
-
-    # The test suite exercises all the loaders, so ensure they are all
-    # dependencies of the ptest package.
-    d.appendVar("RDEPENDS_gdk-pixbuf-ptest", " " + packages)
-}
-
-do_install_append() {
-	# Move gdk-pixbuf-query-loaders into libdir so it is always available
-	# in multilib builds.
-	mv ${D}/${bindir}/gdk-pixbuf-query-loaders ${D}/${libdir}/gdk-pixbuf-2.0/
-}
-
-do_install_append_class-native() {
-	find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
-
-	create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
-		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
-
-	create_wrapper ${D}/${bindir}/gdk-pixbuf-pixdata \
-		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
-
-	create_wrapper ${D}/${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
-		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
-		GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
-}
-BBCLASSEXTEND = "native"
-
-SSTATEPREINSTFUNCS_append_class-native = " gdkpixbuf_sstate_preinst"
-SYSROOT_PREPROCESS_FUNCS_append_class-native = " gdkpixbuf_sstate_preinst"
-
-gdkpixbuf_sstate_preinst() {
-	if [ "${BB_CURRENTTASK}" = "populate_sysroot" ]; then
-		rm -rf ${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/*
-	fi
-}
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.36.5.bb b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.36.5.bb
new file mode 100644
index 0000000..7da6d16
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.36.5.bb
@@ -0,0 +1,99 @@
+SUMMARY = "Image loading library for GTK+"
+HOMEPAGE = "http://www.gtk.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+                    file://gdk-pixbuf/gdk-pixbuf.h;endline=26;md5=72b39da7cbdde2e665329fef618e1d6b"
+
+SECTION = "libs"
+
+DEPENDS = "glib-2.0 gdk-pixbuf-native"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+           file://hardcoded_libtool.patch \
+           file://extending-libinstall-dependencies.patch \
+           file://run-ptest \
+           file://fatal-loader.patch \
+           file://0001-Work-around-thumbnailer-cross-compile-failure.patch \
+           "
+SRC_URI[md5sum] = "0173fd5c11a5d2030d09201090636477"
+SRC_URI[sha256sum] = "7ace06170291a1f21771552768bace072ecdea9bd4a02f7658939b9a314c40fc"
+
+inherit autotools pkgconfig gettext pixbufcache ptest-gnome upstream-version-is-even gobject-introspection gtk-doc lib_package
+
+LIBV = "2.10.0"
+
+GDK_PIXBUF_LOADERS ?= "png jpeg"
+
+PACKAGECONFIG ??= "${GDK_PIXBUF_LOADERS}"
+PACKAGECONFIG_linuxstdbase = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} ${GDK_PIXBUF_LOADERS}"
+PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
+
+PACKAGECONFIG[png] = "--with-libpng,--without-libpng,libpng"
+PACKAGECONFIG[jpeg] = "--with-libjpeg,--without-libjpeg,jpeg"
+PACKAGECONFIG[tiff] = "--with-libtiff,--without-libtiff,tiff"
+PACKAGECONFIG[jpeg2000] = "--with-libjasper,--without-libjasper,jasper"
+
+# Use GIO to sniff image format instead of trying all loaders
+PACKAGECONFIG[gio-sniff] = "--enable-gio-sniffing,--disable-gio-sniffing,,shared-mime-info"
+PACKAGECONFIG[x11] = "--with-x11,--without-x11,virtual/libx11"
+
+PACKAGES =+ "${PN}-xlib"
+
+FILES_${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
+ALLOW_EMPTY_${PN}-xlib = "1"
+
+FILES_${PN} += "${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders"
+
+FILES_${PN}-bin += "${datadir}/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer"
+
+FILES_${PN}-dev += " \
+	${bindir}/gdk-pixbuf-csource \
+	${bindir}/gdk-pixbuf-pixdata \
+        ${bindir}/gdk-pixbuf-print-mime-types \
+	${includedir}/* \
+	${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.la \
+"
+
+PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*"
+PACKAGES_DYNAMIC_class-native = ""
+
+python populate_packages_prepend () {
+    postinst_pixbufloader = d.getVar("postinst_pixbufloader")
+
+    loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders')
+
+    packages = ' '.join(do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
+    d.setVar('PIXBUF_PACKAGES', packages)
+
+    # The test suite exercises all the loaders, so ensure they are all
+    # dependencies of the ptest package.
+    d.appendVar("RDEPENDS_gdk-pixbuf-ptest", " " + packages)
+}
+
+do_install_append() {
+	# Move gdk-pixbuf-query-loaders into libdir so it is always available
+	# in multilib builds.
+	mv ${D}/${bindir}/gdk-pixbuf-query-loaders ${D}/${libdir}/gdk-pixbuf-2.0/
+}
+
+do_install_append_class-native() {
+	find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
+
+	create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
+
+	create_wrapper ${D}/${bindir}/gdk-pixbuf-pixdata \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
+
+	create_wrapper ${D}/${bindir}/gdk-pixbuf-print-mime-types \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
+
+	create_wrapper ${D}/${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
+		GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
+}
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-convert-time_t-to-long.patch b/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-convert-time_t-to-long.patch
new file mode 100644
index 0000000..18a069f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-convert-time_t-to-long.patch
@@ -0,0 +1,72 @@
+From adfa0c8f9fec1faac4bea6a94d947ea32e585923 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 20:39:51 -0700
+Subject: [PATCH] gnome-desktop-thumbnail: don't convert time_t to long
+
+Explicitly use strftime+strptime rather than snprintf+atol. This fixes the
+build for X32, where long's size doesn't match that of time_t.
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ libgnome-desktop/gnome-desktop-thumbnail.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/libgnome-desktop/gnome-desktop-thumbnail.c b/libgnome-desktop/gnome-desktop-thumbnail.c
+index 3946309..b756333 100644
+--- a/libgnome-desktop/gnome-desktop-thumbnail.c
++++ b/libgnome-desktop/gnome-desktop-thumbnail.c
+@@ -126,6 +126,8 @@
+  * Since: 2.2
+  */
+ 
++#define _XOPEN_SOURCE
++
+ #include <config.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+@@ -1483,6 +1485,7 @@ save_thumbnail (GdkPixbuf  *pixbuf,
+   char *tmp_path = NULL;
+   int tmp_fd;
+   char mtime_str[21];
++  struct tm *tmp_mtime = NULL;
+   gboolean ret = FALSE;
+   GError *error = NULL;
+   const char *width, *height;
+@@ -1502,7 +1505,11 @@ save_thumbnail (GdkPixbuf  *pixbuf,
+     goto out;
+   close (tmp_fd);
+ 
+-  g_snprintf (mtime_str, 21, "%ld",  mtime);
++  tmp_mtime = localtime (&mtime);
++  if (!tmp_mtime)
++    goto out;
++  strftime (mtime_str, 21, "%s", tmp_mtime);
++  free (tmp_mtime);
+   width = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Width");
+   height = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Height");
+ 
+@@ -1695,6 +1702,7 @@ gnome_desktop_thumbnail_is_valid (GdkPixbuf          *pixbuf,
+ {
+   const char *thumb_uri, *thumb_mtime_str;
+   time_t thumb_mtime;
++  struct tm tmp_mtime;
+   
+   thumb_uri = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::URI");
+   if (!thumb_uri)
+@@ -1705,7 +1713,11 @@ gnome_desktop_thumbnail_is_valid (GdkPixbuf          *pixbuf,
+   thumb_mtime_str = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::MTime");
+   if (!thumb_mtime_str)
+     return FALSE;
+-  thumb_mtime = atol (thumb_mtime_str);
++  if (!strptime (thumb_mtime_str, "%s", &tmp_mtime))
++    return FALSE;
++  thumb_mtime = mktime (&tmp_mtime);
++  if (!thumb_mtime)
++    return FALSE;
+   if (mtime != thumb_mtime)
+     return FALSE;
+   
+-- 
+2.8.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.20.2.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.20.2.bb
deleted file mode 100644
index 6ef7049..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.20.2.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-SUMMARY = "GNOME library for reading .desktop files"
-SECTION = "x11/gnome"
-LICENSE = "GPLv2 & LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://COPYING.LIB;md5=5f30f0716dfdd0d91eb439ebec522ec2"
-
-BPN = "gnome-desktop"
-
-inherit gnome pkgconfig upstream-version-is-even gobject-introspection
-SRC_URI[archive.md5sum] = "8354ed38624f5eb6b5d34267b658a9c9"
-SRC_URI[archive.sha256sum] = "492c2da7aa8c3a8b65796e8171fc8f0dfb5d322dd2799c0d76392e1fb061e2b2"
-
-DEPENDS += "intltool-native gsettings-desktop-schemas gconf virtual/libx11 gtk+3 glib-2.0 startup-notification xkeyboard-config iso-codes udev"
-
-inherit distro_features_check gtk-doc
-REQUIRED_DISTRO_FEATURES = "x11"
-
-EXTRA_OECONF = "--disable-desktop-docs"
-
-PACKAGES =+ "libgnome-desktop3"
-FILES_libgnome-desktop3 = "${libdir}/lib*${SOLIBS} ${datadir}/libgnome-desktop*/pnp.ids ${datadir}/gnome/*xml"
-
-RRECOMMENDS_libgnome-desktop3 += "gsettings-desktop-schemas"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.22.2.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.22.2.bb
new file mode 100644
index 0000000..e72c6ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.22.2.bb
@@ -0,0 +1,25 @@
+SUMMARY = "GNOME library for reading .desktop files"
+SECTION = "x11/gnome"
+LICENSE = "GPLv2 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.LIB;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+BPN = "gnome-desktop"
+
+inherit gnome pkgconfig upstream-version-is-even gobject-introspection
+SRC_URI[archive.md5sum] = "3d7222d5305f3db022eca31d8108e02d"
+SRC_URI[archive.sha256sum] = "51d7ebf7a6c359be14c3dd7a022213e931484653815eb10b0131bef4c8979e1c"
+
+SRC_URI += "file://gnome-desktop-thumbnail-don-t-convert-time_t-to-long.patch"
+
+DEPENDS += "intltool-native gnome-common-native gsettings-desktop-schemas gconf virtual/libx11 gtk+3 glib-2.0 startup-notification xkeyboard-config iso-codes udev"
+
+inherit distro_features_check gtk-doc
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OECONF = "--disable-desktop-docs"
+
+PACKAGES =+ "libgnome-desktop3"
+FILES_libgnome-desktop3 = "${libdir}/lib*${SOLIBS} ${datadir}/libgnome-desktop*/pnp.ids ${datadir}/gnome/*xml"
+
+RRECOMMENDS_libgnome-desktop3 += "gsettings-desktop-schemas"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.20.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.20.bb
deleted file mode 100644
index bb0eaeb..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.20.bb
+++ /dev/null
@@ -1,41 +0,0 @@
-SUMMARY = "GTK+ icon theme"
-HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/adwaita-icon-theme/"
-BUGTRACKER = "https://bugzilla.gnome.org/"
-SECTION = "x11/gnome"
-
-LICENSE = "LGPL-3.0 | CC-BY-SA-3.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=c84cac88e46fc07647ea07e6c24eeb7c"
-
-inherit allarch autotools pkgconfig gettext gtk-icon-cache upstream-version-is-even
-
-
-MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
-SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
-          "
-
-SRC_URI[md5sum] = "411be2bd68dd8b0a3c86aca2eb351ce4"
-SRC_URI[sha256sum] = "7a0a887349f340dd644032f89d81264b694c4b006bd51af1c2c368d431e7ae35"
-
-do_install_append() {
-	# Build uses gtk-encode-symbolic-svg to create png versions:
-        # no need to store the svgs anymore.
-	rm -f ${D}${prefix}/share/icons/Adwaita/scalable/*/*-symbolic.svg \
-	      ${D}${prefix}/share/icons/Adwaita/scalable/*/*-symbolic-rtl.svg
-}
-
-PACKAGES = "${PN}-cursors ${PN}-symbolic-hires ${PN}-symbolic ${PN}-hires ${PN}"
-
-RREPLACES_${PN} = "gnome-icon-theme"
-RCONFLICTS_${PN} = "gnome-icon-theme"
-RPROVIDES_${PN} = "gnome-icon-theme"
-
-FILES_${PN}-cursors = "${prefix}/share/icons/Adwaita/cursors/"
-FILES_${PN}-symbolic-hires = "${prefix}/share/icons/Adwaita/96x96/*/*.symbolic.png \
-                              ${prefix}/share/icons/Adwaita/64x64/*/*.symbolic.png \
-                              ${prefix}/share/icons/Adwaita/48x48/*/*.symbolic.png \
-                              ${prefix}/share/icons/Adwaita/32x32/*/*.symbolic.png"
-FILES_${PN}-symbolic = "${prefix}/share/icons/Adwaita/16x16/*/*.symbolic.png \
-                        ${prefix}/share/icons/Adwaita/24x24/*/*.symbolic.png"
-FILES_${PN}-hires = "${prefix}/share/icons/Adwaita/256x256/"
-FILES_${PN} = "${prefix}/share/icons/Adwaita/ \
-               ${prefix}/share/pkgconfig/adwaita-icon-theme.pc"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.22.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.22.0.bb
new file mode 100644
index 0000000..1cbc1e6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.22.0.bb
@@ -0,0 +1,42 @@
+SUMMARY = "GTK+ icon theme"
+HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/adwaita-icon-theme/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "x11/gnome"
+
+LICENSE = "LGPL-3.0 | CC-BY-SA-3.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c84cac88e46fc07647ea07e6c24eeb7c"
+
+inherit allarch autotools pkgconfig gettext gtk-icon-cache upstream-version-is-even
+
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+          "
+
+SRC_URI[md5sum] = "cde51d7dfcbcfa3b8cdc3e5f0df8c799"
+SRC_URI[sha256sum] = "c18bf6e26087d9819a962c77288b291efab25d0419b73d909dd771716a45dcb7"
+
+do_install_append() {
+	# Build uses gtk-encode-symbolic-svg to create png versions:
+        # no need to store the svgs anymore.
+	rm -f ${D}${prefix}/share/icons/Adwaita/scalable/*/*-symbolic.svg \
+	      ${D}${prefix}/share/icons/Adwaita/scalable/*/*-symbolic-rtl.svg
+}
+
+PACKAGES = "${PN}-cursors ${PN}-symbolic-hires ${PN}-symbolic ${PN}-hires ${PN}"
+
+RREPLACES_${PN} = "gnome-icon-theme"
+RCONFLICTS_${PN} = "gnome-icon-theme"
+RPROVIDES_${PN} = "gnome-icon-theme"
+
+FILES_${PN}-cursors = "${prefix}/share/icons/Adwaita/cursors/"
+FILES_${PN}-symbolic-hires = "${prefix}/share/icons/Adwaita/96x96/*/*.symbolic.png \
+                              ${prefix}/share/icons/Adwaita/64x64/*/*.symbolic.png \
+                              ${prefix}/share/icons/Adwaita/48x48/*/*.symbolic.png \
+                              ${prefix}/share/icons/Adwaita/32x32/*/*.symbolic.png"
+FILES_${PN}-symbolic = "${prefix}/share/icons/Adwaita/16x16/*/*.symbolic.png \
+                        ${prefix}/share/icons/Adwaita/24x24/*/*.symbolic.png"
+FILES_${PN}-hires = "${prefix}/share/icons/Adwaita/256x256/ \
+                     ${prefix}/share/icons/Adwaita/512x512/"
+FILES_${PN} = "${prefix}/share/icons/Adwaita/ \
+               ${prefix}/share/pkgconfig/adwaita-icon-theme.pc"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-themes-standard_3.20.2.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-themes-standard_3.20.2.bb
deleted file mode 100644
index c98d870..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-themes-standard_3.20.2.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-SUMMARY = "GTK+2 standard themes"
-HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/gnome-themes-standard/"
-BUGTRACKER = "https://bugzilla.gnome.org/"
-SECTION = "x11/gnome"
-
-LICENSE = "LGPL-2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
-
-inherit autotools pkgconfig gettext gtk-icon-cache upstream-version-is-even distro_features_check
-
-ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
-
-DEPENDS += "intltool-native gtk+"
-
-MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
-SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
-          "
-
-SRC_URI[md5sum] = "adc3b1d57330561fea524842d0c0b485"
-SRC_URI[sha256sum] = "9d0d9c4b2c9f9008301c3c1878ebb95859a735b7fd4a6a518802b9637e4a7915"
-
-EXTRA_OECONF = "--disable-gtk3-engine"
-
-do_install_append() {
-        # Only building Adwaita, remove highcontrast files
-        rm -rf ${D}${prefix}/share/themes/HighContrast \
-               ${D}${prefix}/share/icons
-}
-
-# There could be gnome-theme-highcontrast as well but that requires
-# gtk+3 and includes lots of icons (is also broken with B != S).
-PACKAGES += "gnome-theme-adwaita \
-             gnome-theme-adwaita-dbg \
-             gnome-theme-adwaita-dev"
-
-FILES_gnome-theme-adwaita = "${prefix}/share/themes/Adwaita \
-                              ${libdir}/gtk-2.0/2.10.0/engines/libadwaita.so"
-FILES_gnome-theme-adwaita-dev = "${libdir}/gtk-2.0/2.10.0/engines/libadwaita.la"
-FILES_gnome-theme-adwaita-dbg = "${libdir}/gtk-2.0/2.10.0/engines/.debug/libadwaita.so"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-themes-standard_3.22.2.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-themes-standard_3.22.2.bb
new file mode 100644
index 0000000..2b3cc97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-themes-standard_3.22.2.bb
@@ -0,0 +1,45 @@
+SUMMARY = "GTK+2 standard themes"
+HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/gnome-themes-standard/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "x11/gnome"
+
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+inherit autotools pkgconfig gettext gtk-icon-cache upstream-version-is-even distro_features_check
+
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+DEPENDS += "intltool-native gtk+"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+          "
+
+SRC_URI[md5sum] = "84624dbcecab7add32672abae030314d"
+SRC_URI[sha256sum] = "b34516cd59b873c187c1897c25bac3b9ce2d30a472f1fd7ae9d7105d93e17da5"
+
+EXTRA_OECONF = "--disable-gtk3-engine"
+
+do_install_append() {
+        # Only building Adwaita, remove highcontrast files
+        rm -rf ${D}${prefix}/share/themes/HighContrast \
+               ${D}${prefix}/share/icons
+}
+
+# There could be gnome-theme-highcontrast as well but that requires
+# gtk+3 and includes lots of icons (is also broken with B != S).
+PACKAGES += "gnome-theme-adwaita \
+             gnome-theme-adwaita-dbg \
+             gnome-theme-adwaita-dev \
+             gnome-theme-adwaita-dark \
+             "
+
+FILES_gnome-theme-adwaita = "${prefix}/share/themes/Adwaita \
+                              ${libdir}/gtk-2.0/2.10.0/engines/libadwaita.so"
+FILES_gnome-theme-adwaita-dev = "${libdir}/gtk-2.0/2.10.0/engines/libadwaita.la"
+FILES_gnome-theme-adwaita-dbg = "${libdir}/gtk-2.0/2.10.0/engines/.debug/libadwaita.so"
+
+FILES_gnome-theme-adwaita-dark = "${prefix}/share/themes/Adwaita-dark"
+RDEPENDS_gnome-theme-adwaita-dark = "gnome-theme-adwaita"
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb
deleted file mode 100644
index abaa485..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb
+++ /dev/null
@@ -1,173 +0,0 @@
-SUMMARY = "Middleware layer between GObject-using C libraries and language bindings"
-HOMEPAGE = "https://wiki.gnome.org/action/show/Projects/GObjectIntrospection"
-BUGTRACKER = "https://bugzilla.gnome.org/"
-SECTION = "libs"
-LICENSE = "LGPLv2+ & GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=90d577535a3898e1ae5dbf0ae3509a8c \
-                    file://tools/compiler.c;endline=20;md5=fc5007fc20022720e6c0b0cdde41fabd \
-                    file://giscanner/sourcescanner.c;endline=22;md5=194d6e0c1d00662f32d030ce44de8d39 \
-                    file://girepository/giregisteredtypeinfo.c;endline=21;md5=661847611ae6979465415f31a759ba27"
-
-SRC_URI = "${GNOME_MIRROR}/${BPN}/1.48/${BPN}-${PV}.tar.xz \
-           file://0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch \
-           file://0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch \
-           file://0003-giscanner-add-use-binary-wrapper-option.patch \
-           file://0004-giscanner-add-a-use-ldd-wrapper-option.patch \
-           file://0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch \
-           "
-SRC_URI[md5sum] = "01301fa9019667d48e927353e08bc218"
-SRC_URI[sha256sum] = "fa275aaccdbfc91ec0bc9a6fd0562051acdba731e7d584b64a277fec60e75877"
-
-inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even
-BBCLASSEXTEND = "native"
-
-# needed for writing out the qemu wrapper script
-export STAGING_DIR_HOST
-export B
-
-DEPENDS_append = " libffi zlib glib-2.0 python3 flex-native bison-native"
-
-# target build needs qemu to run temporary introspection binaries created
-# on the fly by g-ir-scanner and a native version of itself to run
-# native versions of its own tools during build.
-# Also prelink-rtld is used to find out library dependencies of introspection binaries
-# (standard ldd doesn't work when cross-compiling).
-DEPENDS_class-target_append = " gobject-introspection-native qemu-native prelink-native"
-
-SSTATE_SCAN_FILES += "g-ir-scanner-qemuwrapper g-ir-scanner-wrapper g-ir-compiler-wrapper g-ir-scanner-lddwrapper Gio-2.0.gir"
-
-do_configure_prepend_class-native() {
-        # Tweak the native python scripts so that they don't refer to the
-        # full path of native python binary (the solution is taken from glib-2.0 recipe)
-        # This removes the risk of exceeding Linux kernel's shebang line limit (128 bytes)
-        sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/tools/g-ir-tool-template.in
-}
-
-do_configure_prepend_class-target() {
-        # Write out a qemu wrapper that will be given to gi-scanner so that it
-        # can run target helper binaries through that.
-        qemu_binary="${@qemu_wrapper_cmdline(d, '$STAGING_DIR_HOST', ['\$GIR_EXTRA_LIBS_PATH','.libs','$STAGING_DIR_HOST/${libdir}','$STAGING_DIR_HOST/${base_libdir}'])}"
-        cat > ${B}/g-ir-scanner-qemuwrapper << EOF
-#!/bin/sh
-# Use a modules directory which doesn't exist so we don't load random things
-# which may then get deleted (or their dependencies) and potentially segfault
-export GIO_MODULE_DIR=${STAGING_LIBDIR}/gio/modules-dummy
-
-$qemu_binary "\$@"
-if [ \$? -ne 0 ]; then
-    echo "If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the recipe should help."
-    echo "(typically like this: GIR_EXTRA_LIBS_PATH=\"$""{B}/something/.libs\" )"
-    exit 1
-fi
-EOF
-        chmod +x ${B}/g-ir-scanner-qemuwrapper
-
-        # Write out a wrapper for g-ir-scanner itself, which will be used when building introspection files
-        # for glib-based packages. This wrapper calls the native version of the scanner, and tells it to use
-        # a qemu wrapper for running transient target binaries produced by the scanner, and an include directory 
-        # from the target sysroot.
-        cat > ${B}/g-ir-scanner-wrapper << EOF
-#!/bin/sh
-# This prevents g-ir-scanner from writing cache data to $HOME
-export GI_SCANNER_DISABLE_CACHE=1
-
-g-ir-scanner --use-binary-wrapper=${STAGING_BINDIR}/g-ir-scanner-qemuwrapper --use-ldd-wrapper=${STAGING_BINDIR}/g-ir-scanner-lddwrapper --add-include-path=${STAGING_DATADIR}/gir-1.0 "\$@"
-EOF
-        chmod +x ${B}/g-ir-scanner-wrapper
-
-        # Write out a wrapper for g-ir-compiler, which runs the target version of it through qemu.
-        # g-ir-compiler writes out the raw content of a C struct to disk, and therefore is architecture dependent.
-        cat > ${B}/g-ir-compiler-wrapper << EOF
-#!/bin/sh
-${STAGING_BINDIR}/g-ir-scanner-qemuwrapper ${STAGING_BINDIR}/g-ir-compiler "\$@"
-EOF
-        chmod +x ${B}/g-ir-compiler-wrapper
-
-        # Write out a wrapper to use instead of ldd, which does not work when a binary is built
-        # for a different architecture
-        cat > ${B}/g-ir-scanner-lddwrapper << EOF
-#!/bin/sh
-prelink-rtld --root=$STAGING_DIR_HOST "\$@"
-EOF
-        chmod +x ${B}/g-ir-scanner-lddwrapper
-
-        # Also tweak the target python scripts so that they don't refer to the
-        # native version of python binary (the solution is taken from glib-2.0 recipe)
-        sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/tools/g-ir-tool-template.in
-}
-
-# Configure target build to use native tools of itself and to use a qemu wrapper
-# and optionally to generate introspection data
-EXTRA_OECONF_class-target += "--enable-host-gi \
-                              --enable-gi-cross-wrapper=${B}/g-ir-scanner-qemuwrapper \
-                              --enable-gi-ldd-wrapper=${B}/g-ir-scanner-lddwrapper \
-                              ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection-data', '--disable-introspection-data', d)} \
-                             "
-
-PACKAGECONFIG ?= ""
-PACKAGECONFIG[doctool] = "--enable-doctool,--disable-doctool,python3-mako,"
-
-do_compile_prepend() {
-        # This prevents g-ir-scanner from writing cache data to $HOME
-        export GI_SCANNER_DISABLE_CACHE=1
-
-        # Needed to run g-ir unit tests, which won't be able to find the built libraries otherwise
-        export GIR_EXTRA_LIBS_PATH=$B/.libs
-}
-
-# Our wrappers need to be available system-wide, because they will be used 
-# to build introspection files for all other gobject-based packages
-do_install_append_class-target() {
-        install -d ${D}${bindir}/
-        install ${B}/g-ir-scanner-qemuwrapper ${D}${bindir}/
-        install ${B}/g-ir-scanner-wrapper ${D}${bindir}/
-        install ${B}/g-ir-compiler-wrapper ${D}${bindir}/
-        install ${B}/g-ir-scanner-lddwrapper ${D}${bindir}/
-}
-
-# .typelib files are needed at runtime and so they go to the main package
-FILES_${PN}_append = " ${libdir}/girepository-*/*.typelib"
-
-# .gir files go to dev package, as they're needed for developing (but not for running)
-# things that depends on introspection.
-FILES_${PN}-dev_append = " ${datadir}/gir-*/*.gir"
-
-# These are used by gobject-based packages
-# to generate transient introspection binaries
-FILES_${PN}-dev_append = " ${datadir}/gobject-introspection-1.0/gdump.c \
-               ${datadir}/gobject-introspection-1.0/Makefile.introspection"
-
-# These are used by dependent packages (e.g. pygobject) to build their
-# testsuites.
-FILES_${PN}-dev_append = " ${datadir}/gobject-introspection-1.0/tests/*.c \
-                   ${datadir}/gobject-introspection-1.0/tests/*.h"
-
-FILES_${PN}-dbg += "${libdir}/gobject-introspection/giscanner/.debug/"
-FILES_${PN}-staticdev += "${libdir}/gobject-introspection/giscanner/*.a"
-
-# we need target versions of introspection tools in sysroot so that they can be run via qemu
-# when building introspection files in other packages
-SYSROOT_DIRS_append_class-target = " ${bindir}"
-
-SYSROOT_PREPROCESS_FUNCS_append_class-target = " gi_binaries_sysroot_preprocess"
-gi_binaries_sysroot_preprocess() {
-        # Tweak the binary names in the introspection pkgconfig file, so that it
-        # picks up our wrappers which do the cross-compile and qemu magic.
-        sed -i \
-           -e "s|g_ir_scanner=.*|g_ir_scanner=${bindir}/g-ir-scanner-wrapper|" \
-           -e "s|g_ir_compiler=.*|g_ir_compiler=${bindir}/g-ir-compiler-wrapper|" \
-           ${SYSROOT_DESTDIR}${libdir}/pkgconfig/gobject-introspection-1.0.pc
-}
-
-# Need to ensure ld.so.conf exists so prelink-native works
-# both before we build and if we install from sstate
-do_configure[prefuncs] += "gobject_introspection_preconfigure"
-python gobject_introspection_preconfigure () {
-    oe.utils.write_ld_so_conf(d)
-}
-
-SSTATEPOSTINSTFUNCS += "gobject_introspection_postinst"
-python gobject_introspection_postinst () {
-    if d.getVar("BB_CURRENTTASK", True).startswith("populate_sysroot"):
-        oe.utils.write_ld_so_conf(d)
-}
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.50.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.50.0.bb
new file mode 100644
index 0000000..509fc5f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.50.0.bb
@@ -0,0 +1,178 @@
+SUMMARY = "Middleware layer between GObject-using C libraries and language bindings"
+HOMEPAGE = "https://wiki.gnome.org/action/show/Projects/GObjectIntrospection"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "libs"
+LICENSE = "LGPLv2+ & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=90d577535a3898e1ae5dbf0ae3509a8c \
+                    file://tools/compiler.c;endline=20;md5=fc5007fc20022720e6c0b0cdde41fabd \
+                    file://giscanner/sourcescanner.c;endline=22;md5=194d6e0c1d00662f32d030ce44de8d39 \
+                    file://girepository/giregisteredtypeinfo.c;endline=21;md5=661847611ae6979465415f31a759ba27"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/1.50/${BPN}-${PV}.tar.xz \
+           file://0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch \
+           file://0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch \
+           file://0003-giscanner-add-use-binary-wrapper-option.patch \
+           file://0004-giscanner-add-a-use-ldd-wrapper-option.patch \
+           file://0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch \
+           "
+SRC_URI[md5sum] = "5af8d724f25d0c9cfbe6df41b77e5dc0"
+SRC_URI[sha256sum] = "1c6597c666f543c70ef3d7c893ab052968afae620efdc080c36657f4226337c5"
+
+inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even
+BBCLASSEXTEND = "native"
+
+# needed for writing out the qemu wrapper script
+export STAGING_DIR_HOST
+export B
+
+DEPENDS_append = " libffi zlib glib-2.0 python3 flex-native bison-native"
+
+# target build needs qemu to run temporary introspection binaries created
+# on the fly by g-ir-scanner and a native version of itself to run
+# native versions of its own tools during build.
+# Also prelink-rtld is used to find out library dependencies of introspection binaries
+# (standard ldd doesn't work when cross-compiling).
+DEPENDS_class-target_append = " gobject-introspection-native qemu-native prelink-native"
+
+SSTATE_SCAN_FILES += "g-ir-scanner-qemuwrapper g-ir-scanner-wrapper g-ir-compiler-wrapper g-ir-scanner-lddwrapper Gio-2.0.gir postinst-ldsoconf-${PN}"
+
+do_configure_prepend_class-native() {
+        # Tweak the native python scripts so that they don't refer to the
+        # full path of native python binary (the solution is taken from glib-2.0 recipe)
+        # This removes the risk of exceeding Linux kernel's shebang line limit (128 bytes)
+        sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/tools/g-ir-tool-template.in
+}
+
+do_configure_prepend_class-target() {
+        # Write out a qemu wrapper that will be given to gi-scanner so that it
+        # can run target helper binaries through that.
+        qemu_binary="${@qemu_wrapper_cmdline(d, '$STAGING_DIR_HOST', ['\$GIR_EXTRA_LIBS_PATH','.libs','$STAGING_DIR_HOST/${libdir}','$STAGING_DIR_HOST/${base_libdir}'])}"
+        cat > ${B}/g-ir-scanner-qemuwrapper << EOF
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${STAGING_LIBDIR}/gio/modules-dummy
+
+$qemu_binary "\$@"
+if [ \$? -ne 0 ]; then
+    echo "If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the recipe should help."
+    echo "(typically like this: GIR_EXTRA_LIBS_PATH=\"$""{B}/something/.libs\" )"
+    exit 1
+fi
+EOF
+        chmod +x ${B}/g-ir-scanner-qemuwrapper
+
+        # Write out a wrapper for g-ir-scanner itself, which will be used when building introspection files
+        # for glib-based packages. This wrapper calls the native version of the scanner, and tells it to use
+        # a qemu wrapper for running transient target binaries produced by the scanner, and an include directory 
+        # from the target sysroot.
+        cat > ${B}/g-ir-scanner-wrapper << EOF
+#!/bin/sh
+# This prevents g-ir-scanner from writing cache data to $HOME
+export GI_SCANNER_DISABLE_CACHE=1
+
+g-ir-scanner --use-binary-wrapper=${STAGING_BINDIR}/g-ir-scanner-qemuwrapper --use-ldd-wrapper=${STAGING_BINDIR}/g-ir-scanner-lddwrapper --add-include-path=${STAGING_DATADIR}/gir-1.0 "\$@"
+EOF
+        chmod +x ${B}/g-ir-scanner-wrapper
+
+        # Write out a wrapper for g-ir-compiler, which runs the target version of it through qemu.
+        # g-ir-compiler writes out the raw content of a C struct to disk, and therefore is architecture dependent.
+        cat > ${B}/g-ir-compiler-wrapper << EOF
+#!/bin/sh
+${STAGING_BINDIR}/g-ir-scanner-qemuwrapper ${STAGING_BINDIR}/g-ir-compiler "\$@"
+EOF
+        chmod +x ${B}/g-ir-compiler-wrapper
+
+        # Write out a wrapper to use instead of ldd, which does not work when a binary is built
+        # for a different architecture
+        cat > ${B}/g-ir-scanner-lddwrapper << EOF
+#!/bin/sh
+prelink-rtld --root=$STAGING_DIR_HOST "\$@"
+EOF
+        chmod +x ${B}/g-ir-scanner-lddwrapper
+
+        # Also tweak the target python scripts so that they don't refer to the
+        # native version of python binary (the solution is taken from glib-2.0 recipe)
+        sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/tools/g-ir-tool-template.in
+}
+
+# Configure target build to use native tools of itself and to use a qemu wrapper
+# and optionally to generate introspection data
+EXTRA_OECONF_class-target += "--enable-host-gi \
+                              --enable-gi-cross-wrapper=${B}/g-ir-scanner-qemuwrapper \
+                              --enable-gi-ldd-wrapper=${B}/g-ir-scanner-lddwrapper \
+                              ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection-data', '--disable-introspection-data', d)} \
+                             "
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[doctool] = "--enable-doctool,--disable-doctool,python3-mako,"
+
+do_compile_prepend() {
+        # This prevents g-ir-scanner from writing cache data to $HOME
+        export GI_SCANNER_DISABLE_CACHE=1
+
+        # Needed to run g-ir unit tests, which won't be able to find the built libraries otherwise
+        export GIR_EXTRA_LIBS_PATH=$B/.libs
+}
+
+# Our wrappers need to be available system-wide, because they will be used 
+# to build introspection files for all other gobject-based packages
+do_install_append_class-target() {
+        install -d ${D}${bindir}/
+        install ${B}/g-ir-scanner-qemuwrapper ${D}${bindir}/
+        install ${B}/g-ir-scanner-wrapper ${D}${bindir}/
+        install ${B}/g-ir-compiler-wrapper ${D}${bindir}/
+        install ${B}/g-ir-scanner-lddwrapper ${D}${bindir}/
+}
+
+# .typelib files are needed at runtime and so they go to the main package
+FILES_${PN}_append = " ${libdir}/girepository-*/*.typelib"
+
+# .gir files go to dev package, as they're needed for developing (but not for running)
+# things that depends on introspection.
+FILES_${PN}-dev_append = " ${datadir}/gir-*/*.gir"
+
+# These are used by gobject-based packages
+# to generate transient introspection binaries
+FILES_${PN}-dev_append = " ${datadir}/gobject-introspection-1.0/gdump.c \
+               ${datadir}/gobject-introspection-1.0/Makefile.introspection"
+
+# These are used by dependent packages (e.g. pygobject) to build their
+# testsuites.
+FILES_${PN}-dev_append = " ${datadir}/gobject-introspection-1.0/tests/*.c \
+                   ${datadir}/gobject-introspection-1.0/tests/*.h"
+
+FILES_${PN}-dbg += "${libdir}/gobject-introspection/giscanner/.debug/"
+FILES_${PN}-staticdev += "${libdir}/gobject-introspection/giscanner/*.a"
+
+# we need target versions of introspection tools in sysroot so that they can be run via qemu
+# when building introspection files in other packages
+SYSROOT_DIRS_append_class-target = " ${bindir}"
+
+SYSROOT_PREPROCESS_FUNCS_append_class-target = " gi_binaries_sysroot_preprocess"
+gi_binaries_sysroot_preprocess() {
+        # Tweak the binary names in the introspection pkgconfig file, so that it
+        # picks up our wrappers which do the cross-compile and qemu magic.
+        sed -i \
+           -e "s|g_ir_scanner=.*|g_ir_scanner=${bindir}/g-ir-scanner-wrapper|" \
+           -e "s|g_ir_compiler=.*|g_ir_compiler=${bindir}/g-ir-compiler-wrapper|" \
+           ${SYSROOT_DESTDIR}${libdir}/pkgconfig/gobject-introspection-1.0.pc
+}
+
+# Need to ensure ld.so.conf exists so prelink-native works
+# both before we build and if we install from sstate
+do_configure[prefuncs] += "gobject_introspection_preconfigure"
+python gobject_introspection_preconfigure () {
+    oe.utils.write_ld_so_conf(d)
+}
+
+SYSROOT_PREPROCESS_FUNCS_append = " gi_ldsoconf_sysroot_preprocess"
+gi_ldsoconf_sysroot_preprocess () {
+	mkdir -p ${SYSROOT_DESTDIR}${bindir}
+	dest=${SYSROOT_DESTDIR}${bindir}/postinst-ldsoconf-${PN}
+	echo "#!/bin/sh" > $dest
+	echo "mkdir -p ${STAGING_DIR_TARGET}${sysconfdir}" >> $dest
+	echo "echo ${base_libdir} >> ${STAGING_DIR_TARGET}${sysconfdir}/ld.so.conf" >> $dest
+	echo "echo ${libdir} >> ${STAGING_DIR_TARGET}${sysconfdir}/ld.so.conf" >> $dest
+	chmod 755 $dest
+}
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.20.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.20.0.bb
deleted file mode 100644
index bb924ce..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.20.0.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-SUMMARY = "GNOME desktop-wide GSettings schemas"
-HOMEPAGE = "http://live.gnome.org/gsettings-desktop-schemas"
-BUGTRACKER = "https://bugzilla.gnome.org/"
-
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
-
-DEPENDS = "glib-2.0 intltool-native"
-
-inherit gnomebase gsettings gettext gobject-introspection upstream-version-is-even
-
-SRC_URI[archive.md5sum] = "c5d87ea480aa9bf66b134ddb5b8ea0f8"
-SRC_URI[archive.sha256sum] = "55a41b533c0ab955e0a36a84d73829451c88b027d8d719955d8f695c35c6d9c1"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.22.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.22.0.bb
new file mode 100644
index 0000000..d84a4f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.22.0.bb
@@ -0,0 +1,13 @@
+SUMMARY = "GNOME desktop-wide GSettings schemas"
+HOMEPAGE = "http://live.gnome.org/gsettings-desktop-schemas"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "glib-2.0 intltool-native"
+
+inherit gnomebase gsettings gettext gobject-introspection upstream-version-is-even
+
+SRC_URI[archive.md5sum] = "5b9056ab6eff42a0117f2912edff5f20"
+SRC_URI[archive.sha256sum] = "0f06c7ba34c3a99e4d58b10889496133c9aaad6698ea2d8405d481c7f1a7eae1"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+.inc b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+.inc
index c240baa..558bc48 100644
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+.inc
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+.inc
@@ -18,18 +18,17 @@
 UPSTREAM_CHECK_REGEX = "(?P<pver>2\.([0-8]*[02468])+(\.\d+)+)"
 
 X11DEPENDS = "virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
-DEPENDS = "glib-2.0 pango atk jpeg libpng gdk-pixbuf-native docbook-utils-native \
+DEPENDS = "glib-2.0 pango atk jpeg libpng gdk-pixbuf-native \
  cairo gdk-pixbuf"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
-"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'directfb x11', d)}"
 
 PACKAGECONFIG[x11] = "--with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}"
 # without --with-gdktarget=directfb it will check for cairo-xlib which isn't available without X11 DISTRO_FEATURE
 PACKAGECONFIG[directfb] = "--with-gdktarget=directfb,,directfb"
+PACKAGECONFIG[manpages] = "--enable-man --with-xml-catalog=${STAGING_ETCDIR_NATIVE}/xml/catalog.xml, --disable-man, libxslt-native xmlto-native"
 
-inherit autotools gtk-doc pkgconfig update-alternatives gtk-immodules-cache gobject-introspection
+inherit autotools gtk-doc pkgconfig update-alternatives gtk-immodules-cache gobject-introspection manpages
 
 PACKAGES += "libgail gtk-demo"
 
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3.inc b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3.inc
index 83e9b92..27da844 100644
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3.inc
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3.inc
@@ -6,11 +6,11 @@
 SECTION = "libs"
 
 DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \
-           docbook-utils-native gdk-pixbuf-native"
+           gdk-pixbuf-native"
 
 LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
 
-inherit autotools pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings distro_features_check upstream-version-is-even gobject-introspection
+inherit autotools gettext pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings distro_features_check upstream-version-is-even gobject-introspection
 ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
 
 # This should be in autotools.bbclass, but until something elses uses it putting
@@ -31,7 +31,7 @@
                  --enable-modules \
                  --disable-cups \
                  --disable-colord \
-                 WAYLAND_PROTOCOLS_SYSROOT_DIR=${STAGING_DIR}/${MACHINE} \
+                 WAYLAND_PROTOCOLS_SYSROOT_DIR=${RECIPE_SYSROOT} \
                  ${@bb.utils.contains("DISTRO_FEATURES", "x11", "", "--disable-gtk-doc", d)} \
                  "
 EXTRA_OECONF[vardepsexclude] = "MACHINE"
@@ -40,10 +40,8 @@
         export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs"
 }
 
-PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "x11", "", d)} \
-                   ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "opengl", "", d)} \
-                   ${@bb.utils.contains("DISTRO_FEATURES", "opengl x11", "glx", "", d)} \
-                   ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "wayland", "", d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)}"
 
 PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes"
 # this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build
@@ -125,6 +123,6 @@
 
     do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s')
 
-    if (d.getVar('DEBIAN_NAMES', True)):
+    if (d.getVar('DEBIAN_NAMES')):
         d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0')
 }
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch
index 0bda1f1..c210bbc 100644
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch
@@ -1,4 +1,4 @@
-From 5a73a5b92566e314bbc8a1bd40f1ec204837c111 Mon Sep 17 00:00:00 2001
+From 0ecaa5bab162abf0cb2057d77beeb7b89d5873b4 Mon Sep 17 00:00:00 2001
 From: Jussi Kukkonen <jussi.kukkonen@intel.com>
 Date: Tue, 21 Jun 2016 14:53:56 +0300
 Subject: [PATCH 1/4] Hardcoded libtool
@@ -12,10 +12,10 @@
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 23d3077..b6931d6 100644
+index 6628e21..f43ac09 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -610,7 +610,7 @@ AC_MSG_CHECKING([whether to write dependencies into .pc files])
+@@ -617,7 +617,7 @@ AC_MSG_CHECKING([whether to write dependencies into .pc files])
  case $enable_explicit_deps in
    auto)
      export SED
@@ -24,7 +24,7 @@
      if test "x$deplibs_check_method" != xpass_all || test "x$enable_static" = xyes ; then
        enable_explicit_deps=yes
      else
-@@ -876,7 +876,7 @@ else
+@@ -895,7 +895,7 @@ else
      dnl Now we check to see if our libtool supports shared lib deps
      dnl (in a rather ugly way even)
      if $dynworks; then
@@ -33,7 +33,7 @@
          module_deplibs_check=`$module_libtool_config | \
              grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
              sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
-@@ -1630,7 +1630,7 @@ AC_SUBST(GTK_PRINT_BACKENDS)
+@@ -1649,7 +1649,7 @@ AC_SUBST(GTK_PRINT_BACKENDS)
  # We are using gmodule-no-export now, but I'm leaving the stripping
  # code in place for now, since pango and atk still require gmodule.
  export SED
@@ -43,5 +43,5 @@
    GDK_DEP_LIBS=`echo $GDK_DEP_LIBS | sed -e "s/$export_dynamic//"`
    GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"`
 -- 
-2.1.4
+2.12.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0001-Redo-focus-handling-in-treeview-once-more.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0001-Redo-focus-handling-in-treeview-once-more.patch
deleted file mode 100644
index e819add..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0001-Redo-focus-handling-in-treeview-once-more.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Upstream-Status: Backport [29faa2db]
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-
-
-From 29faa2db44b04b9cf7f4d96e32691f424490c730 Mon Sep 17 00:00:00 2001
-From: Matthias Clasen <mclasen@redhat.com>
-Date: Sun, 11 Sep 2016 11:47:55 -0400
-Subject: [PATCH] Redo focus handling in treeview once more
-
-The fix for bug 767468 had some unintended side-effects. This is
-an attempt at doing the same fix (don't grab focus when we are
-grab-shadowed), while avoiding the breakage, by using GTK+'s
-internal tracking for grab-shadowed-ness.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=770508
----
- gtk/gtktreeview.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
-index a7463cc..73d3557 100644
---- a/gtk/gtktreeview.c
-+++ b/gtk/gtktreeview.c
-@@ -3050,11 +3050,10 @@ static void
- grab_focus_and_unset_draw_keyfocus (GtkTreeView *tree_view)
- {
-   GtkWidget *widget = GTK_WIDGET (tree_view);
--  GtkWidget *grab_widget = gtk_grab_get_current ();
- 
-   if (gtk_widget_get_can_focus (widget) &&
-       !gtk_widget_has_focus (widget) &&
--      (!grab_widget || grab_widget == widget))
-+      !_gtk_widget_get_shadowed (widget))
-     gtk_widget_grab_focus (widget);
- 
-   tree_view->priv->draw_keyfocus = 0;
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch
index 989716e..ab7b659 100644
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch
@@ -1,4 +1,4 @@
-From d63b926f8c8d8b5c9f9ec33d078b775f0409d88a Mon Sep 17 00:00:00 2001
+From 2d2361f24be1e51201063dbbda570debe8702b6f Mon Sep 17 00:00:00 2001
 From: Jussi Kukkonen <jussi.kukkonen@intel.com>
 Date: Fri, 16 Oct 2015 16:35:16 +0300
 Subject: [PATCH 2/4] Do not try to initialize GL without libGL
@@ -21,10 +21,10 @@
  2 files changed, 12 insertions(+)
 
 diff --git a/configure.ac b/configure.ac
-index b6931d6..e27da49 100644
+index f43ac09..965eec9 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -342,6 +342,13 @@ AC_ARG_ENABLE(mir-backend,
+@@ -346,6 +346,13 @@ AC_ARG_ENABLE(mir-backend,
                                [enable the Mir gdk backend])],
  			      [backend_set=yes])
  
@@ -56,5 +56,5 @@
  
  gint
 -- 
-2.1.4
+2.12.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch
index 0912c44..eaf6aec 100644
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch
@@ -1,4 +1,4 @@
-From a8fa547fdc1416b330aced805f5343ad912932ae Mon Sep 17 00:00:00 2001
+From a2e6b7cbbd6d741fed38d91b3742aa4a08395aba Mon Sep 17 00:00:00 2001
 From: Jussi Kukkonen <jussi.kukkonen@intel.com>
 Date: Tue, 21 Jun 2016 15:11:39 +0300
 Subject: [PATCH 3/4] Add --disable-opengl configure option
@@ -14,40 +14,43 @@
 
 The patch is _not_ great from a maintenance point of view and
 modifying the library API is also a fairly nasty thing to do.
-Long-term it would be good to find an alternative solution to this
-(maybe a no-op backend for libepoxy?)
+Next long term release (4.0) will require alternative solutions
+as it actually will depend on OpenGL.
 
 Upstream-Status: Inappropriate [Evil eye expected from upstream]
 Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
 ---
- configure.ac                      | 13 +++++++++++--
- demos/gtk-demo/glarea.c           | 13 +++++++++++++
- docs/tools/Makefile.am            |  9 +++++++--
- docs/tools/widgets.c              |  4 +++-
- gdk/gdkdisplay.c                  |  4 +++-
- gdk/gdkgl.c                       | 10 ++++++++++
- gdk/gdkglcontext.c                |  6 ++++++
- gdk/gdkwindow.c                   | 13 +++++++++++++
- gdk/x11/Makefile.am               | 30 ++++++++++++++++++++++++++----
- gdk/x11/gdkdisplay-x11.c          |  6 +++++-
- gdk/x11/gdkscreen-x11.c           |  5 +++++
- gdk/x11/gdkwindow-x11.c           |  4 ++++
+ configure.ac                      | 13 +++++++--
+ demos/gtk-demo/glarea.c           | 14 +++++++++
+ docs/tools/Makefile.am            |  9 ++++--
+ docs/tools/widgets.c              |  4 ++-
+ gdk/gdkdisplay.c                  |  4 ++-
+ gdk/gdkgl.c                       | 10 +++++++
+ gdk/gdkglcontext.c                |  6 ++++
+ gdk/gdkwindow.c                   | 13 +++++++++
+ gdk/x11/Makefile.am               | 30 +++++++++++++++++---
+ gdk/x11/gdkdisplay-x11.c          |  6 +++-
+ gdk/x11/gdkscreen-x11.c           |  5 ++++
+ gdk/x11/gdkwindow-x11.c           |  4 +++
  gdk/x11/gdkx-autocleanups.h       |  2 ++
- gdk/x11/gdkx-with-gl-context.h    | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- gdk/x11/gdkx-without-gl-context.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- gdk/x11/gdkx.h                    | 59 -----------------------------------------------------------
- gtk/Makefile.am                   |  3 +--
- gtk/gtkglarea.c                   | 20 +++++++++++++++++++-
- gtk/inspector/general.c           |  6 ++++++
- tests/Makefile.am                 | 10 +++++++---
+ gdk/x11/gdkx-with-gl-context.h    | 59 ++++++++++++++++++++++++++++++++++++++
+ gdk/x11/gdkx-without-gl-context.h | 58 +++++++++++++++++++++++++++++++++++++
+ gdk/x11/gdkx.h                    | 60 ---------------------------------------
+ gtk/Makefile.am                   |  3 +-
+ gtk/gtkglarea.c                   | 20 ++++++++++++-
+ gtk/inspector/general.c           |  6 ++++
+ tests/Makefile.am                 | 10 +++++--
  testsuite/gtk/objects-finalize.c  |  2 ++
- 21 files changed, 260 insertions(+), 76 deletions(-)
+ 21 files changed, 261 insertions(+), 77 deletions(-)
+ create mode 100644 gdk/x11/gdkx-with-gl-context.h
+ create mode 100644 gdk/x11/gdkx-without-gl-context.h
+ delete mode 100644 gdk/x11/gdkx.h
 
 diff --git a/configure.ac b/configure.ac
-index a01824e..dde9dc5 100644
+index 965eec9..00bf544 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -342,6 +342,15 @@ AC_ARG_ENABLE(mir-backend,
+@@ -346,6 +346,15 @@ AC_ARG_ENABLE(mir-backend,
                                [enable the Mir gdk backend])],
  			      [backend_set=yes])
  
@@ -63,7 +66,7 @@
  AC_ARG_ENABLE(glx,
                [AS_HELP_STRING([--enable-glx],
                                [When enabled Gdk will try to initialize GLX])])
-@@ -1333,7 +1342,7 @@ CFLAGS="$saved_cflags"
+@@ -1352,7 +1361,7 @@ CFLAGS="$saved_cflags"
  LDFLAGS="$saved_ldflags"
  
  GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 >= gdk_pixbuf_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version"
@@ -72,7 +75,7 @@
  
  PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES)
  GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB"
-@@ -1367,7 +1376,7 @@ fi
+@@ -1386,7 +1395,7 @@ fi
  PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
  
  GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= glib_required_version"
@@ -82,11 +85,14 @@
    GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
  fi
 diff --git a/demos/gtk-demo/glarea.c b/demos/gtk-demo/glarea.c
-index 3aba729..c6c79f7 100644
+index b51e4ae..82409c7 100644
 --- a/demos/gtk-demo/glarea.c
 +++ b/demos/gtk-demo/glarea.c
-@@ -5,7 +5,9 @@
+@@ -3,9 +3,12 @@
+  * GtkGLArea is a widget that allows custom drawing using OpenGL calls.
+  */
  
++#include "config.h"
  #include <math.h>
  #include <gtk/gtk.h>
 +#if HAVE_OPENGL
@@ -95,7 +101,7 @@
  
  static GtkWidget *demo_window = NULL;
  
-@@ -23,6 +25,8 @@ enum {
+@@ -23,6 +26,8 @@ enum {
  /* Rotation angles on each axis */
  static float rotation_angles[N_AXIS] = { 0.0 };
  
@@ -104,7 +110,7 @@
  /* The object we are drawing */
  static const GLfloat vertex_data[] = {
    0.f,   0.5f,   0.f, 1.f,
-@@ -213,6 +217,7 @@ compute_mvp (float *res,
+@@ -215,6 +220,7 @@ compute_mvp (float *res,
  static GLuint position_buffer;
  static GLuint program;
  static GLuint mvp_location;
@@ -112,18 +118,18 @@
  
  /* We need to set up our state when we realize the GtkGLArea widget */
  static void
-@@ -223,8 +228,10 @@ realize (GtkWidget *widget)
-   if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL)
-     return;
+@@ -241,8 +247,10 @@ realize (GtkWidget *widget)
+       fragment_path = "/glarea/glarea-gl.fs.glsl";
+     }
  
 +#ifdef HAVE_OPENGL
    init_buffers (&position_buffer, NULL);
-   init_shaders (&program, &mvp_location);
+   init_shaders (vertex_path, fragment_path, &program, &mvp_location);
 +#endif
  }
  
  /* We should tear down the state when unrealizing */
-@@ -236,10 +243,13 @@ unrealize (GtkWidget *widget)
+@@ -254,10 +262,13 @@ unrealize (GtkWidget *widget)
    if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL)
      return;
  
@@ -137,7 +143,7 @@
  static void
  draw_triangle (void)
  {
-@@ -272,6 +282,7 @@ draw_triangle (void)
+@@ -290,6 +301,7 @@ draw_triangle (void)
    glBindBuffer (GL_ARRAY_BUFFER, 0);
    glUseProgram (0);
  }
@@ -145,7 +151,7 @@
  
  static gboolean
  render (GtkGLArea    *area,
-@@ -280,6 +291,7 @@ render (GtkGLArea    *area,
+@@ -298,6 +310,7 @@ render (GtkGLArea    *area,
    if (gtk_gl_area_get_error (area) != NULL)
      return FALSE;
  
@@ -153,7 +159,7 @@
    /* Clear the viewport */
    glClearColor (0.5, 0.5, 0.5, 1.0);
    glClear (GL_COLOR_BUFFER_BIT);
-@@ -289,6 +301,7 @@ render (GtkGLArea    *area,
+@@ -307,6 +320,7 @@ render (GtkGLArea    *area,
  
    /* Flush the contents of the pipeline */
    glFlush ();
@@ -204,10 +210,10 @@
  
    return info;
 diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
-index 6150ef7..2223629 100644
+index 6b012ca..311c7f7 100644
 --- a/gdk/gdkdisplay.c
 +++ b/gdk/gdkdisplay.c
-@@ -2360,7 +2360,9 @@ gboolean
+@@ -2409,7 +2409,9 @@ gboolean
  gdk_display_make_gl_context_current (GdkDisplay   *display,
                                       GdkGLContext *context)
  {
@@ -219,7 +225,7 @@
  
  GdkRenderingMode
 diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
-index e8ba770..ba7c84b 100644
+index 8e7b8c2..b579b22 100644
 --- a/gdk/gdkgl.c
 +++ b/gdk/gdkgl.c
 @@ -22,7 +22,9 @@
@@ -240,7 +246,7 @@
  static const char *
  get_vertex_type_name (int type)
  {
-@@ -254,6 +257,7 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data)
+@@ -208,6 +211,7 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data)
        glUseProgram (paint_data->current_program->program);
      }
  }
@@ -248,15 +254,15 @@
  
  void
  gdk_gl_texture_quads (GdkGLContext *paint_context,
-@@ -261,6 +265,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
-                       int n_quads,
-                       GdkTexturedQuad *quads)
+@@ -216,6 +220,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
+                       GdkTexturedQuad *quads,
+                       gboolean flip_colors)
  {
 +#ifdef HAVE_OPENGL
    GdkGLContextPaintData *paint_data  = gdk_gl_context_get_paint_data (paint_context);
    GdkGLContextProgram *program;
    GdkWindow *window = gdk_gl_context_get_window (paint_context);
-@@ -324,6 +329,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
+@@ -289,6 +294,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
  
    glDisableVertexAttribArray (program->position_location);
    glDisableVertexAttribArray (program->uv_location);
@@ -264,7 +270,7 @@
  }
  
  /* x,y,width,height describes a rectangle in the gl render buffer
-@@ -372,6 +378,7 @@ gdk_cairo_draw_from_gl (cairo_t              *cr,
+@@ -337,6 +343,7 @@ gdk_cairo_draw_from_gl (cairo_t              *cr,
                          int                   width,
                          int                   height)
  {
@@ -272,7 +278,7 @@
    GdkGLContext *paint_context;
    cairo_surface_t *image;
    cairo_matrix_t matrix;
-@@ -692,6 +699,7 @@ gdk_cairo_draw_from_gl (cairo_t              *cr,
+@@ -707,6 +714,7 @@ out:
    if (clip_region)
      cairo_region_destroy (clip_region);
  
@@ -280,7 +286,7 @@
  }
  
  /* This is always called with the paint context current */
-@@ -699,6 +707,7 @@ void
+@@ -714,6 +722,7 @@ void
  gdk_gl_texture_from_surface (cairo_surface_t *surface,
  			     cairo_region_t  *region)
  {
@@ -288,14 +294,14 @@
    GdkGLContext *paint_context;
    cairo_surface_t *image;
    double device_x_offset, device_y_offset;
-@@ -799,4 +808,5 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
+@@ -814,4 +823,5 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
  
    glDisable (GL_SCISSOR_TEST);
    glDeleteTextures (1, &texture_id);
 +#endif
  }
 diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
-index 00a33eb..bd8a793 100644
+index c79dca0..8a7bec2 100644
 --- a/gdk/gdkglcontext.c
 +++ b/gdk/gdkglcontext.c
 @@ -85,7 +85,9 @@
@@ -308,23 +314,23 @@
  
  typedef struct {
    GdkDisplay *display;
-@@ -239,6 +241,7 @@ gdk_gl_context_upload_texture (GdkGLContext    *context,
+@@ -243,6 +245,7 @@ gdk_gl_context_upload_texture (GdkGLContext    *context,
                                 int              height,
                                 guint            texture_target)
  {
 +#ifdef HAVE_OPENGL
-   g_return_if_fail (GDK_IS_GL_CONTEXT (context));
+   GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
  
-   glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
-@@ -246,6 +249,7 @@ gdk_gl_context_upload_texture (GdkGLContext    *context,
-   glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
-                 cairo_image_surface_get_data (image_surface));
-   glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
+   g_return_if_fail (GDK_IS_GL_CONTEXT (context));
+@@ -286,6 +289,7 @@ gdk_gl_context_upload_texture (GdkGLContext    *context,
+             glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, (unsigned char*) data + (i * stride));
+         }
+     }
 +#endif
  }
  
- static void
-@@ -635,6 +639,7 @@ gdk_gl_context_realize (GdkGLContext  *context,
+ static gboolean
+@@ -774,6 +778,7 @@ gdk_gl_context_realize (GdkGLContext  *context,
  static void
  gdk_gl_context_check_extensions (GdkGLContext *context)
  {
@@ -332,7 +338,7 @@
    GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
    gboolean has_npot, has_texture_rectangle;
  
-@@ -677,6 +682,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
+@@ -847,6 +852,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
                         priv->use_texture_rectangle ? "yes" : "no"));
  
    priv->extensions_checked = TRUE;
@@ -341,10 +347,10 @@
  
  /**
 diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
-index 66ebb9d..74a0c3a 100644
+index 689d666..fb84256 100644
 --- a/gdk/gdkwindow.c
 +++ b/gdk/gdkwindow.c
-@@ -44,7 +44,9 @@
+@@ -45,7 +45,9 @@
  
  #include <math.h>
  
@@ -354,7 +360,7 @@
  
  /* for the use of round() */
  #include "fallback-c89.c"
-@@ -2759,6 +2761,13 @@ gdk_window_get_paint_gl_context (GdkWindow  *window,
+@@ -2819,6 +2821,13 @@ gdk_window_get_paint_gl_context (GdkWindow  *window,
  {
    GError *internal_error = NULL;
  
@@ -368,7 +374,7 @@
    if (_gdk_gl_flags & GDK_GL_DISABLE)
      {
        g_set_error_literal (error, GDK_GL_ERROR,
-@@ -2955,6 +2964,7 @@ gdk_window_begin_paint_region (GdkWindow       *window,
+@@ -2954,6 +2963,7 @@ gdk_window_begin_paint_internal (GdkWindow            *window,
          }
        else
          {
@@ -376,7 +382,7 @@
  	  gdk_gl_context_make_current (context);
            /* With gl we always need a surface to combine the gl
               drawing with the native drawing. */
-@@ -2969,6 +2979,7 @@ gdk_window_begin_paint_region (GdkWindow       *window,
+@@ -2968,6 +2978,7 @@ gdk_window_begin_paint_internal (GdkWindow            *window,
            glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
  
            glViewport (0, 0, ww, wh);
@@ -384,7 +390,7 @@
          }
      }
  
-@@ -3117,6 +3128,7 @@ gdk_window_end_paint (GdkWindow *window)
+@@ -3031,6 +3042,7 @@ gdk_window_end_paint_internal (GdkWindow *window)
  
            gdk_gl_context_make_current (window->gl_paint_context);
  
@@ -392,7 +398,7 @@
            if (!cairo_region_is_empty (opaque_region))
              gdk_gl_texture_from_surface (window->current_paint.surface,
                                           opaque_region);
-@@ -3127,6 +3139,7 @@ gdk_window_end_paint (GdkWindow *window)
+@@ -3041,6 +3053,7 @@ gdk_window_end_paint_internal (GdkWindow *window)
                                             window->current_paint.need_blend_region);
                glDisable(GL_BLEND);
              }
@@ -401,10 +407,10 @@
            cairo_region_destroy (opaque_region);
  
 diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
-index c488a31..4ce3c07 100644
+index 6289f3a..cbbac79 100644
 --- a/gdk/x11/Makefile.am
 +++ b/gdk/x11/Makefile.am
-@@ -39,8 +39,6 @@ libgdk_x11_la_SOURCES = 	\
+@@ -40,8 +40,6 @@ libgdk_x11_la_SOURCES = 	\
  	gdkeventtranslator.c	\
  	gdkeventtranslator.h	\
  	gdkgeometry-x11.c  	\
@@ -412,8 +418,8 @@
 -	gdkglcontext-x11.h	\
  	gdkkeys-x11.c		\
  	gdkmain-x11.c		\
- 	gdkproperty-x11.c	\
-@@ -53,14 +51,32 @@ libgdk_x11_la_SOURCES = 	\
+ 	gdkmonitor-x11.c	\
+@@ -56,14 +54,32 @@ libgdk_x11_la_SOURCES = 	\
  	gdkwindow-x11.h		\
  	gdkxftdefaults.c	\
  	gdkxid.c		\
@@ -447,15 +453,15 @@
  libgdkx11include_HEADERS = 	\
  	gdkx-autocleanups.h	\
  	gdkx11applaunchcontext.h \
-@@ -74,7 +90,6 @@ libgdkx11include_HEADERS = 	\
+@@ -77,7 +93,6 @@ libgdkx11include_HEADERS = 	\
  	gdkx11display.h		\
  	gdkx11displaymanager.h	\
  	gdkx11dnd.h		\
 -	gdkx11glcontext.h	\
  	gdkx11keys.h		\
+ 	gdkx11monitor.h		\
  	gdkx11property.h	\
- 	gdkx11screen.h		\
-@@ -83,9 +98,16 @@ libgdkx11include_HEADERS = 	\
+@@ -87,9 +102,16 @@ libgdkx11include_HEADERS = 	\
  	gdkx11visual.h		\
  	gdkx11window.h
  
@@ -473,7 +479,7 @@
 +
  -include $(top_srcdir)/git.mk
 diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
-index de91c64..42d50f6 100644
+index ad65e29..91345ee 100644
 --- a/gdk/x11/gdkdisplay-x11.c
 +++ b/gdk/x11/gdkdisplay-x11.c
 @@ -37,7 +37,9 @@
@@ -486,7 +492,7 @@
  #include "gdk-private.h"
  
  #include <glib.h>
-@@ -2959,7 +2961,9 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
+@@ -2994,7 +2996,9 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
    display_class->text_property_to_utf8_list = _gdk_x11_display_text_property_to_utf8_list;
    display_class->utf8_to_string_target = _gdk_x11_display_utf8_to_string_target;
  
@@ -498,10 +504,10 @@
    display_class->get_default_seat = gdk_x11_display_get_default_seat;
  
 diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
-index 9d8ed20..bd46b00 100644
+index 7bf9979..cd1cc9d 100644
 --- a/gdk/x11/gdkscreen-x11.c
 +++ b/gdk/x11/gdkscreen-x11.c
-@@ -1968,3 +1968,8 @@ gdk_x11_screen_get_current_desktop (GdkScreen *screen)
+@@ -1643,3 +1643,8 @@ gdk_x11_screen_get_current_desktop (GdkScreen *screen)
  {
    return get_netwm_cardinal_property (screen, "_NET_CURRENT_DESKTOP");
  }
@@ -511,7 +517,7 @@
 +void _gdk_x11_screen_update_visuals_for_gl (GdkScreen *screen) {}
 +#endif
 diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
-index 9ed087a..30d6eb7 100644
+index 3d6fd3b..2bd5c87 100644
 --- a/gdk/x11/gdkwindow-x11.c
 +++ b/gdk/x11/gdkwindow-x11.c
 @@ -36,7 +36,9 @@
@@ -524,7 +530,7 @@
  #include "gdkprivate-x11.h"
  #include "gdk-private.h"
  
-@@ -5782,7 +5784,9 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
+@@ -5801,7 +5803,9 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
    impl_class->set_opaque_region = gdk_x11_window_set_opaque_region;
    impl_class->set_shadow_width = gdk_x11_window_set_shadow_width;
    impl_class->show_window_menu = gdk_x11_window_show_window_menu;
@@ -679,10 +685,10 @@
 +#endif /* __GDK_X_H__ */
 diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
 deleted file mode 100644
-index ae05fa6..0000000
+index 1f64bcc..0000000
 --- a/gdk/x11/gdkx.h
 +++ /dev/null
-@@ -1,59 +0,0 @@
+@@ -1,60 +0,0 @@
 -/* GDK - The GIMP Drawing Kit
 - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 - *
@@ -730,6 +736,7 @@
 -#include <gdk/x11/gdkx11dnd.h>
 -#include <gdk/x11/gdkx11glcontext.h>
 -#include <gdk/x11/gdkx11keys.h>
+-#include <gdk/x11/gdkx11monitor.h>
 -#include <gdk/x11/gdkx11property.h>
 -#include <gdk/x11/gdkx11screen.h>
 -#include <gdk/x11/gdkx11selection.h>
@@ -743,10 +750,10 @@
 -
 -#endif /* __GDK_X_H__ */
 diff --git a/gtk/Makefile.am b/gtk/Makefile.am
-index 6a53a2b..49a35e6 100644
+index 45fb7c2..ce81011 100644
 --- a/gtk/Makefile.am
 +++ b/gtk/Makefile.am
-@@ -1351,14 +1351,13 @@ gtkprivatetypebuiltins.c: $(gtk_private_type_h_sources)  gtkprivatetypebuiltins.
+@@ -1411,14 +1411,13 @@ gtkprivatetypebuiltins.c: $(gtk_private_type_h_sources)  gtkprivatetypebuiltins.
  	&& cp xgen-gptbc gtkprivatetypebuiltins.c  \
  	&& rm -f xgen-gptbc
  
@@ -763,7 +770,7 @@
  gtktestutils.c: gtktypefuncs.c
  
 diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
-index 245fc6b..4214ad1 100644
+index 094378e..f7c7f47 100644
 --- a/gtk/gtkglarea.c
 +++ b/gtk/gtkglarea.c
 @@ -28,7 +28,9 @@
@@ -776,7 +783,7 @@
  
  /**
   * SECTION:gtkglarea
-@@ -357,9 +359,12 @@ gtk_gl_area_real_create_context (GtkGLArea *area)
+@@ -368,9 +370,12 @@ gtk_gl_area_real_create_context (GtkGLArea *area)
  static void
  gtk_gl_area_resize (GtkGLArea *area, int width, int height)
  {
@@ -789,7 +796,7 @@
  /*
   * Creates all the buffer objects needed for rendering the scene
   */
-@@ -467,6 +472,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area)
+@@ -482,6 +487,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area)
  
    priv->needs_render = TRUE;
  }
@@ -797,7 +804,7 @@
  
  /**
   * gtk_gl_area_attach_buffers:
-@@ -485,6 +491,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area)
+@@ -500,6 +506,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area)
  void
  gtk_gl_area_attach_buffers (GtkGLArea *area)
  {
@@ -805,7 +812,7 @@
    GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
  
    g_return_if_fail (GTK_IS_GL_AREA (area));
-@@ -517,11 +524,13 @@ gtk_gl_area_attach_buffers (GtkGLArea *area)
+@@ -532,11 +539,13 @@ gtk_gl_area_attach_buffers (GtkGLArea *area)
          glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
                                        GL_RENDERBUFFER_EXT, priv->depth_stencil_buffer);
      }
@@ -819,7 +826,7 @@
    GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
  
    if (priv->context == NULL)
-@@ -553,6 +562,7 @@ gtk_gl_area_delete_buffers (GtkGLArea *area)
+@@ -568,6 +577,7 @@ gtk_gl_area_delete_buffers (GtkGLArea *area)
        glDeleteFramebuffersEXT (1, &priv->frame_buffer);
        priv->frame_buffer = 0;
      }
@@ -827,7 +834,7 @@
  }
  
  static void
-@@ -663,6 +673,7 @@ gtk_gl_area_draw (GtkWidget *widget,
+@@ -678,6 +688,7 @@ gtk_gl_area_draw (GtkWidget *widget,
    GtkGLArea *area = GTK_GL_AREA (widget);
    GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
    gboolean unused;
@@ -835,7 +842,7 @@
    int w, h, scale;
    GLenum status;
  
-@@ -674,7 +685,6 @@ gtk_gl_area_draw (GtkWidget *widget,
+@@ -689,7 +700,6 @@ gtk_gl_area_draw (GtkWidget *widget,
                                       gtk_widget_get_allocated_height (widget));
        return FALSE;
      }
@@ -843,7 +850,7 @@
    if (priv->context == NULL)
      return FALSE;
  
-@@ -720,6 +730,14 @@ gtk_gl_area_draw (GtkWidget *widget,
+@@ -735,6 +745,14 @@ gtk_gl_area_draw (GtkWidget *widget,
      }
  
    return TRUE;
@@ -859,7 +866,7 @@
  
  static gboolean
 diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c
-index 4eab3a7..c4e900e 100644
+index c241ec8..24576dd 100644
 --- a/gtk/inspector/general.c
 +++ b/gtk/inspector/general.c
 @@ -33,8 +33,10 @@
@@ -873,7 +880,7 @@
  
  #ifdef GDK_WINDOWING_WIN32
  #include "win32/gdkwin32.h"
-@@ -147,6 +149,7 @@ append_extension_row (GtkInspectorGeneral *gen,
+@@ -196,6 +198,7 @@ add_label_row (GtkInspectorGeneral *gen,
    gtk_size_group_add_widget (GTK_SIZE_GROUP (gen->priv->labels), label);
  }
  
@@ -881,15 +888,15 @@
  #ifdef GDK_WINDOWING_X11
  static void
  append_glx_extension_row (GtkInspectorGeneral *gen,
-@@ -156,6 +159,7 @@ append_glx_extension_row (GtkInspectorGeneral *gen,
-   append_extension_row (gen, ext, epoxy_has_glx_extension (dpy, 0, ext));
+@@ -205,6 +208,7 @@ append_glx_extension_row (GtkInspectorGeneral *gen,
+   add_check_row (gen, GTK_LIST_BOX (gen->priv->gl_box), ext, epoxy_has_glx_extension (dpy, 0, ext), 0);
  }
  #endif
 +#endif
  
  #ifdef GDK_WINDOWING_WAYLAND
  static void
-@@ -171,6 +175,7 @@ append_egl_extension_row (GtkInspectorGeneral *gen,
+@@ -254,6 +258,7 @@ wayland_get_display (struct wl_display *wl_display)
  static void
  init_gl (GtkInspectorGeneral *gen)
  {
@@ -897,7 +904,7 @@
  #ifdef GDK_WINDOWING_X11
    if (GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
      {
-@@ -197,6 +202,7 @@ init_gl (GtkInspectorGeneral *gen)
+@@ -280,6 +285,7 @@ init_gl (GtkInspectorGeneral *gen)
      }
    else
  #endif
@@ -906,7 +913,7 @@
    if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ()))
      {
 diff --git a/tests/Makefile.am b/tests/Makefile.am
-index 681807d..2941a36 100644
+index f86c166..ba1acad 100644
 --- a/tests/Makefile.am
 +++ b/tests/Makefile.am
 @@ -80,8 +80,6 @@ noinst_PROGRAMS =  $(TEST_PROGS)	\
@@ -918,19 +925,20 @@
  	testgrid			\
  	testgtk				\
  	testheaderbar			\
-@@ -169,11 +167,17 @@ noinst_PROGRAMS =  $(TEST_PROGS)	\
+@@ -170,12 +168,18 @@ noinst_PROGRAMS =  $(TEST_PROGS)	\
  	testactionbar			\
  	testwindowsize			\
  	testpopover			\
 -	gdkgears			\
  	listmodel			\
  	testpopup			\
+ 	testpopupat			\
  	$(NULL)
  
 +if HAVE_OPENGL
 +noinst_PROGRAMS +=
-+	testglarea                      \
-+	testglblending                  \
++	testglarea			\
++	testglblending			\
 +	gdkgears
 +endif
 +
@@ -938,7 +946,7 @@
  noinst_PROGRAMS += testerrors
  endif
 diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c
-index e0ebee0..703643c 100644
+index 0b3a519..07b096f 100644
 --- a/testsuite/gtk/objects-finalize.c
 +++ b/testsuite/gtk/objects-finalize.c
 @@ -115,8 +115,10 @@ main (int argc, char **argv)
@@ -951,4 +959,7 @@
 +#endif
  	  /* Not allowed to finalize a GdkPixbufLoader without calling gdk_pixbuf_loader_close() */
  	  all_types[i] != GDK_TYPE_PIXBUF_LOADER &&
- 	  all_types[i] != gdk_pixbuf_simple_anim_iter_get_type())
+ 	  all_types[i] != GDK_TYPE_DRAWING_CONTEXT &&
+-- 
+2.12.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0004-configure.ac-Fix-wayland-protocols-path.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0004-configure.ac-Fix-wayland-protocols-path.patch
index 634b3a4..aca55ce 100644
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0004-configure.ac-Fix-wayland-protocols-path.patch
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/0004-configure.ac-Fix-wayland-protocols-path.patch
@@ -1,4 +1,4 @@
-From 97b78e566634579bbae51be914aeaaa921137a8b Mon Sep 17 00:00:00 2001
+From 34f4d3928e8206a89b0a601bdf79d6194b3cc77e Mon Sep 17 00:00:00 2001
 From: Jussi Kukkonen <jussi.kukkonen@intel.com>
 Date: Thu, 9 Jun 2016 11:21:36 +0300
 Subject: [PATCH 4/4] configure.ac: Fix wayland-protocols path
@@ -19,10 +19,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/configure.ac b/configure.ac
-index a3e9beb..dde9dc5 100644
+index 00bf544..5515915 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -461,7 +461,7 @@ fi
+@@ -465,7 +465,7 @@ fi
  if test "$enable_wayland_backend" = "yes"; then
    # For the cairo image backend
    cairo_backends="$cairo_backends cairo"
@@ -32,5 +32,5 @@
    GDK_WINDOWING="$GDK_WINDOWING
  #define GDK_WINDOWING_WAYLAND"
 -- 
-2.1.4
+2.12.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3_3.20.9.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3_3.20.9.bb
deleted file mode 100644
index 38e095a..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3_3.20.9.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-require gtk+3.inc
-
-MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
-
-SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
-           file://0001-Hardcoded-libtool.patch \
-           file://0002-Do-not-try-to-initialize-GL-without-libGL.patch \
-           file://0003-Add-disable-opengl-configure-option.patch \
-           file://0004-configure.ac-Fix-wayland-protocols-path.patch \
-           file://0001-Redo-focus-handling-in-treeview-once-more.patch \
-          "
-SRC_URI[md5sum] = "cc76cac5e18c772c6784bf19a3dff08b"
-SRC_URI[sha256sum] = "83a609ba2f3424b5509e73967c49c67833af466d6f91081b24ee5c64fce6ac17"
-
-S = "${WORKDIR}/gtk+-${PV}"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
-                    file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
-                    file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
-                    file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3_3.22.8.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3_3.22.8.bb
new file mode 100644
index 0000000..1cc57f9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3_3.22.8.bb
@@ -0,0 +1,19 @@
+require gtk+3.inc
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
+           file://0001-Hardcoded-libtool.patch \
+           file://0002-Do-not-try-to-initialize-GL-without-libGL.patch \
+           file://0003-Add-disable-opengl-configure-option.patch \
+           file://0004-configure.ac-Fix-wayland-protocols-path.patch \
+          "
+SRC_URI[md5sum] = "b4fb39a829e4425b3fa05adbe7f52fef"
+SRC_URI[sha256sum] = "c7254a88df5c17e9609cee9e848c3d0104512707edad4c3b4f256b131f8d3af1"
+
+S = "${WORKDIR}/gtk+-${PV}"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
+                    file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
+                    file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
+                    file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+_2.24.30.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+_2.24.30.bb
deleted file mode 100644
index 4fe990d..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+_2.24.30.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-require gtk+.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
-                    file://gtk/gtk.h;endline=27;md5=c59e0b4490dd135a5726ebf851f9b17f \
-                    file://gdk/gdk.h;endline=27;md5=07db285ec208fb3e0bf7d861b0614202 \
-                    file://tests/testgtk.c;endline=27;md5=262db5db5f776f9863e56df31423e24c"
-SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-${PV}.tar.xz \
-           file://xsettings.patch \
-           file://hardcoded_libtool.patch \
-           file://toggle-font.diff;striplevel=0 \
-           file://doc-fixes.patch \
-           file://strict-prototypes.patch \
-	  "
-
-SRC_URI[md5sum] = "04568ba5c58b75e3c7543e45628ad789"
-SRC_URI[sha256sum] = "0d15cec3b6d55c60eac205b1f3ba81a1ed4eadd9d0f8e7c508bc7065d0c4ca50"
-
-EXTRA_OECONF = "--enable-xkb --disable-glibtest --disable-cups --disable-xinerama"
-
-LIBV = "2.10.0"
-
-PACKAGES_DYNAMIC += "^gtk-immodule-.* ^gtk-printbackend-.*"
-
-python populate_packages_prepend () {
-    gtk_libdir = d.expand('${libdir}/gtk-2.0/${LIBV}')
-    immodules_root = os.path.join(gtk_libdir, 'immodules')
-    printmodules_root = os.path.join(gtk_libdir, 'printbackends');
-
-    d.setVar('GTKIMMODULES_PACKAGES', ' '.join(do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s')))
-    do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
-
-    if (d.getVar('DEBIAN_NAMES', True)):
-        d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-2.0')
-}
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+_2.24.31.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+_2.24.31.bb
new file mode 100644
index 0000000..cc31bab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+_2.24.31.bb
@@ -0,0 +1,34 @@
+require gtk+.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+                    file://gtk/gtk.h;endline=27;md5=c59e0b4490dd135a5726ebf851f9b17f \
+                    file://gdk/gdk.h;endline=27;md5=07db285ec208fb3e0bf7d861b0614202 \
+                    file://tests/testgtk.c;endline=27;md5=262db5db5f776f9863e56df31423e24c"
+SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-${PV}.tar.xz \
+           file://xsettings.patch \
+           file://hardcoded_libtool.patch \
+           file://toggle-font.diff;striplevel=0 \
+           file://doc-fixes.patch \
+           file://strict-prototypes.patch \
+	  "
+
+SRC_URI[md5sum] = "526a1008586094a2cbb4592fd3f9ee10"
+SRC_URI[sha256sum] = "68c1922732c7efc08df4656a5366dcc3afdc8791513400dac276009b40954658"
+
+EXTRA_OECONF = "--enable-xkb --disable-glibtest --disable-cups --disable-xinerama"
+
+LIBV = "2.10.0"
+
+PACKAGES_DYNAMIC += "^gtk-immodule-.* ^gtk-printbackend-.*"
+
+python populate_packages_prepend () {
+    gtk_libdir = d.expand('${libdir}/gtk-2.0/${LIBV}')
+    immodules_root = os.path.join(gtk_libdir, 'immodules')
+    printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+
+    d.setVar('GTKIMMODULES_PACKAGES', ' '.join(do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s')))
+    do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
+
+    if (d.getVar('DEBIAN_NAMES')):
+        d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-2.0')
+}
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.20.9.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.20.9.bb
deleted file mode 100644
index 71c1d62..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.20.9.bb
+++ /dev/null
@@ -1,60 +0,0 @@
-SUMMARY = "Native icon utils for GTK+"
-DESCRIPTION = "gtk-update-icon-cache and gtk-encode-symbolic-svg built from GTK+ natively, for build time and on-host postinst script execution."
-SECTION = "libs"
-
-DEPENDS = "glib-2.0-native gdk-pixbuf-native librsvg-native"
-
-LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
-
-MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
-
-SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
-          file://Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch"
-SRC_URI[md5sum] = "cc76cac5e18c772c6784bf19a3dff08b"
-SRC_URI[sha256sum] = "83a609ba2f3424b5509e73967c49c67833af466d6f91081b24ee5c64fce6ac17"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
-                    file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
-                    file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
-                    file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
-
-S = "${WORKDIR}/gtk+-${PV}"
-
-inherit pkgconfig native upstream-version-is-even
-
-PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
-
-do_configure() {
-	# Quite ugly but defines enough to compile the tools.
-	if ! test -f gtk/config.h; then
-		echo "#define GETTEXT_PACKAGE \"gtk30\"" >> gtk/config.h
-		echo "#define HAVE_UNISTD_H 1" >> gtk/config.h
-		echo "#define HAVE_FTW_H 1" >> gtk/config.h
-	fi
-	if ! test -f gdk/config.h; then
-		touch gdk/config.h
-	fi
-}
-
-do_compile() {
-	${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
-		${S}/gtk/updateiconcache.c \
-		$(${PKG_CONFIG_FOR_BUILD} --cflags --libs gdk-pixbuf-2.0) \
-		-o gtk-update-icon-cache
-
-	${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
-		${S}/gtk/encodesymbolic.c \
-		$(${PKG_CONFIG_FOR_BUILD} --cflags --libs gio-2.0 gdk-pixbuf-2.0) \
-		-o gtk-encode-symbolic-svg
-}
-
-do_install() {
-	install -d ${D}${bindir}
-	install -m 0755 ${B}/gtk-update-icon-cache ${D}${bindir}
-	install -m 0755 ${B}/gtk-encode-symbolic-svg ${D}${bindir}
-
-	create_wrapper ${D}/${bindir}/gtk-update-icon-cache \
-		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
-	create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \
-		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
-}
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.8.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.8.bb
new file mode 100644
index 0000000..7283418
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.8.bb
@@ -0,0 +1,60 @@
+SUMMARY = "Native icon utils for GTK+"
+DESCRIPTION = "gtk-update-icon-cache and gtk-encode-symbolic-svg built from GTK+ natively, for build time and on-host postinst script execution."
+SECTION = "libs"
+
+DEPENDS = "glib-2.0-native gdk-pixbuf-native librsvg-native"
+
+LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
+          file://Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch"
+SRC_URI[md5sum] = "b4fb39a829e4425b3fa05adbe7f52fef"
+SRC_URI[sha256sum] = "c7254a88df5c17e9609cee9e848c3d0104512707edad4c3b4f256b131f8d3af1"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
+                    file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
+                    file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
+                    file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
+
+S = "${WORKDIR}/gtk+-${PV}"
+
+inherit pkgconfig native upstream-version-is-even
+
+PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
+
+do_configure() {
+	# Quite ugly but defines enough to compile the tools.
+	if ! test -f gtk/config.h; then
+		echo "#define GETTEXT_PACKAGE \"gtk30\"" >> gtk/config.h
+		echo "#define HAVE_UNISTD_H 1" >> gtk/config.h
+		echo "#define HAVE_FTW_H 1" >> gtk/config.h
+	fi
+	if ! test -f gdk/config.h; then
+		touch gdk/config.h
+	fi
+}
+
+do_compile() {
+	${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
+		${S}/gtk/updateiconcache.c \
+		$(${PKG_CONFIG_FOR_BUILD} --cflags --libs gdk-pixbuf-2.0) \
+		-o gtk-update-icon-cache
+
+	${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
+		${S}/gtk/encodesymbolic.c \
+		$(${PKG_CONFIG_FOR_BUILD} --cflags --libs gio-2.0 gdk-pixbuf-2.0) \
+		-o gtk-encode-symbolic-svg
+}
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 ${B}/gtk-update-icon-cache ${D}${bindir}
+	install -m 0755 ${B}/gtk-encode-symbolic-svg ${D}${bindir}
+
+	create_wrapper ${D}/${bindir}/gtk-update-icon-cache \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
+	create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
+}
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk-doc/gtk-doc_1.25.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk-doc/gtk-doc_1.25.bb
index 6af996e..7de36ae9 100644
--- a/import-layers/yocto-poky/meta/recipes-gnome/gtk-doc/gtk-doc_1.25.bb
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk-doc/gtk-doc_1.25.bb
@@ -29,7 +29,7 @@
 SRC_URI[archive.md5sum] = "0dc6570953112a464a409fb99258ccbc"
 SRC_URI[archive.sha256sum] = "1ea46ed400e6501f975acaafea31479cea8f32f911dca4dff036f59e6464fd42"
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
 
 # Do not check for XML catalogs when building because that
 # information is not used for anything during build. Recipe
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/json-glib/json-glib_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-gnome/json-glib/json-glib_1.2.2.bb
index 8df2a42..6869ba9 100644
--- a/import-layers/yocto-poky/meta/recipes-gnome/json-glib/json-glib_1.2.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-gnome/json-glib/json-glib_1.2.2.bb
@@ -13,6 +13,8 @@
 SRC_URI[archive.md5sum] = "c1daefb8d0fb59612af0c072c8aabb58"
 SRC_URI[archive.sha256sum] = "ea128ab52a824fcd06e5448fbb2bd8d9a13740d51c66d445828edba71321a621"
 
-inherit gnomebase gettext lib_package gobject-introspection gtk-doc
+inherit gnomebase gettext lib_package gobject-introspection gtk-doc manpages
 
-BBCLASSEXTEND = "native"
+PACKAGECONFIG[manpages] = "--enable-man --with-xml-catalog=${STAGING_ETCDIR_NATIVE}/xml/catalog.xml, --disable-man, libxslt-native xmlto-native"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libgudev/libgudev_230.bb b/import-layers/yocto-poky/meta/recipes-gnome/libgudev/libgudev_230.bb
deleted file mode 100644
index 709553b..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/libgudev/libgudev_230.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-SUMMARY = "GObject wrapper for libudev"
-
-SRC_URI[archive.md5sum] = "e4dee8f3f349e9372213d33887819a4d"
-SRC_URI[archive.sha256sum] = "a2e77faced0c66d7498403adefcc0707105e03db71a2b2abd620025b86347c18"
-
-DEPENDS = "glib-2.0 udev"
-
-RCONFLICTS_${PN} = "systemd (<= 220)"
-
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
-
-inherit gnomebase gobject-introspection gtk-doc
-
-UPSTREAM_CHECK_URI = "http://ftp.gnome.org/pub/GNOME/sources/libgudev/"
-UPSTREAM_CHECK_REGEX = "(?P<pver>(\d+))"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libgudev/libgudev_231.bb b/import-layers/yocto-poky/meta/recipes-gnome/libgudev/libgudev_231.bb
new file mode 100644
index 0000000..ae0f1c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libgudev/libgudev_231.bb
@@ -0,0 +1,18 @@
+SUMMARY = "GObject wrapper for libudev"
+
+SRC_URI[archive.md5sum] = "916c10c51ec61131e244c3936bbb2e0c"
+SRC_URI[archive.sha256sum] = "3b1ef99d4a8984c35044103d8ddfc3cc52c80035c36abab2bcc5e3532e063f96"
+
+DEPENDS = "glib-2.0 udev"
+
+EXTRA_OECONF = "--disable-umockdev"
+
+RCONFLICTS_${PN} = "systemd (<= 220)"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+inherit gnomebase gobject-introspection gtk-doc
+
+UPSTREAM_CHECK_URI = "http://ftp.gnome.org/pub/GNOME/sources/libgudev/"
+UPSTREAM_CHECK_REGEX = "(?P<pver>(\d+))"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libnotify/libnotify_0.7.6.bb b/import-layers/yocto-poky/meta/recipes-gnome/libnotify/libnotify_0.7.6.bb
deleted file mode 100644
index ce8e5ae..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/libnotify/libnotify_0.7.6.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SUMMARY = "Library for sending desktop notifications to a notification daemon"
-SECTION = "libs"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
-
-DEPENDS = "dbus gtk+3 dbus-glib"
-
-inherit gnomebase gtk-doc distro_features_check gobject-introspection
-# depends on gtk+3
-ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
-
-SRC_URI[archive.md5sum] = "a4997019d08f46f3bf57b78e6f795a59"
-SRC_URI[archive.sha256sum] = "0ef61ca400d30e28217979bfa0e73a7406b19c32dd76150654ec5b2bdf47d837"
-
-# there were times, we had two versions of libnotify (oe-core libnotify:0.6.x /
-# meta-gnome libnotify3: 0.7.x)
-PROVIDES += "libnotify3"
-RPROVIDES_${PN} += "libnotify3"
-RCONFLICTS_${PN} += "libnotify3"
-RREPLACES_${PN} += "libnotify3"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libnotify/libnotify_0.7.7.bb b/import-layers/yocto-poky/meta/recipes-gnome/libnotify/libnotify_0.7.7.bb
new file mode 100644
index 0000000..2ab2f1f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libnotify/libnotify_0.7.7.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Library for sending desktop notifications to a notification daemon"
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+DEPENDS = "dbus gtk+3 dbus-glib"
+
+inherit gnomebase gtk-doc distro_features_check gobject-introspection
+# depends on gtk+3
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+SRC_URI[archive.md5sum] = "e9d911f6a22435e0b922f2fe71212b59"
+SRC_URI[archive.sha256sum] = "9cb4ce315b2655860c524d46b56010874214ec27e854086c1a1d0260137efc04"
+
+# there were times, we had two versions of libnotify (oe-core libnotify:0.6.x /
+# meta-gnome libnotify3: 0.7.x)
+PROVIDES += "libnotify3"
+RPROVIDES_${PN} += "libnotify3"
+RCONFLICTS_${PN} += "libnotify3"
+RREPLACES_${PN} += "libnotify3"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libsecret/libsecret_0.18.5.bb b/import-layers/yocto-poky/meta/recipes-gnome/libsecret/libsecret_0.18.5.bb
index bcb3046..2b917ec 100644
--- a/import-layers/yocto-poky/meta/recipes-gnome/libsecret/libsecret_0.18.5.bb
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libsecret/libsecret_0.18.5.bb
@@ -2,11 +2,11 @@
 LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=23c2a5e0106b99d75238986559bb5fc6"
 
-inherit gnomebase gtk-doc vala gobject-introspection
+inherit gnomebase gtk-doc vala gobject-introspection manpages
 
 DEPENDS += "glib-2.0 libgcrypt gettext-native intltool-native"
 
-EXTRA_OECONF += "--disable-manpages"
+PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
 
 SRC_URI[archive.md5sum] = "2d688825921313da8731313b0a7f394c"
 SRC_URI[archive.sha256sum] = "9ce7bd8dd5831f2786c935d82638ac428fa085057cc6780aba0e39375887ccb3"
@@ -18,8 +18,3 @@
 do_configure_prepend() {
     rm -f ${S}/build/m4/vapigen.m4
 }
-
-# Secret-1: poky/build-mips64/tmp/work/mips64-poky-linux/libgpg-error/1.19-r0/libgpg-error-1.19/src/posix-lock.c:119: get_lock_object: Assertion `!"sizeof lock obj"' failed.
-# qemu: uncaught target signal 6 (Aborted) - core dumped
-EXTRA_OECONF_append_mips64 = " --disable-introspection --disable-gtk-doc"
-
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libwnck/libwnck3_3.20.1.bb b/import-layers/yocto-poky/meta/recipes-gnome/libwnck/libwnck3_3.20.1.bb
deleted file mode 100644
index fd4ef69..0000000
--- a/import-layers/yocto-poky/meta/recipes-gnome/libwnck/libwnck3_3.20.1.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-SUMMARY = "Window navigation construction toolkit"
-LICENSE = "LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
-
-BPN = "libwnck"
-
-SECTION = "x11/libs"
-DEPENDS = "intltool-native gtk+3 gdk-pixbuf-native libxres"
-
-PACKAGECONFIG ??= "startup-notification"
-PACKAGECONFIG[startup-notification] = "--enable-startup-notification,--disable-startup-notification,startup-notification"
-
-inherit gnomebase gobject-introspection gtk-doc
-SRC_URI[archive.md5sum] = "487938d65d4bfae1f2501052b1bd7492"
-SRC_URI[archive.sha256sum] = "1cb03716bc477058dfdf3ebfa4f534de3b13b1aa067fcd064d0b7813291cba72"
-
-inherit distro_features_check
-# libxres means x11 only
-REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo-fpu.inc b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo-fpu.inc
index ef72e89..fe7c533 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo-fpu.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo-fpu.inc
@@ -1,6 +1,6 @@
 
 def get_cairo_fpu_setting(bb, d):
-    if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+    if d.getVar('TARGET_FPU') in [ 'soft' ]:
         return "--disable-some-floating-point"
     return ""
 
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo.inc b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo.inc
index c4b6f32..8e1e2e1 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo.inc
@@ -13,6 +13,7 @@
 LICENSE = "MPL-1 & LGPLv2.1 & GPLv3+"
 LICENSE_${PN} = "MPL-1 & LGPLv2.1"
 LICENSE_${PN}-dev = "MPL-1 & LGPLv2.1"
+LICENSE_${PN}-doc = "MPL-1 & LGPLv2.1"
 LICENSE_${PN}-gobject = "MPL-1 & LGPLv2.1"
 LICENSE_${PN}-script-interpreter = "MPL-1 & LGPLv2.1"
 LICENSE_${PN}-perf-utils = "GPLv3+"
@@ -21,7 +22,7 @@
 DEPENDS = "libpng fontconfig pixman glib-2.0 zlib"
 
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)} \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)}"
+           ${@bb.utils.filter('DISTRO_FEATURES', 'directfb', d)}"
 
 PACKAGECONFIG[x11] = "--with-x=yes -enable-xlib,--with-x=no --disable-xlib,${X11DEPENDS}"
 PACKAGECONFIG[xcb] = "--enable-xcb,--disable-xcb,libxcb"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo_1.14.6.bb b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo_1.14.6.bb
deleted file mode 100644
index d2c1e12..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo_1.14.6.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-require cairo.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=e73e999e0c72b5ac9012424fa157ad77"
-
-SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "23a0b2f0235431d35238df1d3a517fdb"
-SRC_URI[sha256sum] = "613cb38447b76a93ff7235e17acd55a78b52ea84a9df128c3f2257f8eaa7b252"
-
-PACKAGES =+ "cairo-gobject cairo-script-interpreter cairo-perf-utils"
-
-SUMMARY_${PN} = "The Cairo 2D vector graphics library"
-DESCRIPTION_${PN} = "Cairo is a multi-platform library providing anti-aliased \
-vector-based rendering for multiple target backends. Paths consist \
-of line segments and cubic splines and can be rendered at any width \
-with various join and cap styles. All colors may be specified with \
-optional translucence (opacity/alpha) and combined using the \
-extended Porter/Duff compositing algebra as found in the X Render \
-Extension."
-
-SUMMARY_cairo-gobject = "The Cairo library GObject wrapper library"
-DESCRIPTION_cairo-gobject = "A GObject wrapper library for the Cairo API."
-
-SUMMARY_cairo-script-interpreter = "The Cairo library script interpreter"
-DESCRIPTION_cairo-script-interpreter = "The Cairo script interpreter implements \
-CairoScript.  CairoScript is used by tracing utilities to enable the ability \
-to replay rendering."
-
-DESCRIPTION_cairo-perf-utils = "The Cairo library performance utilities"
-
-FILES_${PN} = "${libdir}/libcairo.so.*"
-FILES_${PN}-dev += "${libdir}/cairo/*.so"
-FILES_${PN}-gobject = "${libdir}/libcairo-gobject.so.*"
-FILES_${PN}-script-interpreter = "${libdir}/libcairo-script-interpreter.so.*"
-FILES_${PN}-perf-utils = "${bindir}/cairo-trace ${libdir}/cairo/*.la ${libdir}/cairo/libcairo-trace.so.*"
-
-do_install_append () {
-	rm -rf ${D}${bindir}/cairo-sphinx
-	rm -rf ${D}${libdir}/cairo/cairo-fdr*
-	rm -rf ${D}${libdir}/cairo/cairo-sphinx*
-	rm -rf ${D}${libdir}/cairo/.debug/cairo-fdr*
-	rm -rf ${D}${libdir}/cairo/.debug/cairo-sphinx*
-}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo_1.14.8.bb b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo_1.14.8.bb
new file mode 100644
index 0000000..5a3c74f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo_1.14.8.bb
@@ -0,0 +1,43 @@
+require cairo.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e73e999e0c72b5ac9012424fa157ad77"
+
+SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "4ef0db2eacb271c74f8a3fd87822aa98"
+SRC_URI[sha256sum] = "d1f2d98ae9a4111564f6de4e013d639cf77155baf2556582295a0f00a9bc5e20"
+
+PACKAGES =+ "cairo-gobject cairo-script-interpreter cairo-perf-utils"
+
+SUMMARY_${PN} = "The Cairo 2D vector graphics library"
+DESCRIPTION_${PN} = "Cairo is a multi-platform library providing anti-aliased \
+vector-based rendering for multiple target backends. Paths consist \
+of line segments and cubic splines and can be rendered at any width \
+with various join and cap styles. All colors may be specified with \
+optional translucence (opacity/alpha) and combined using the \
+extended Porter/Duff compositing algebra as found in the X Render \
+Extension."
+
+SUMMARY_cairo-gobject = "The Cairo library GObject wrapper library"
+DESCRIPTION_cairo-gobject = "A GObject wrapper library for the Cairo API."
+
+SUMMARY_cairo-script-interpreter = "The Cairo library script interpreter"
+DESCRIPTION_cairo-script-interpreter = "The Cairo script interpreter implements \
+CairoScript.  CairoScript is used by tracing utilities to enable the ability \
+to replay rendering."
+
+DESCRIPTION_cairo-perf-utils = "The Cairo library performance utilities"
+
+FILES_${PN} = "${libdir}/libcairo.so.*"
+FILES_${PN}-dev += "${libdir}/cairo/*.so"
+FILES_${PN}-gobject = "${libdir}/libcairo-gobject.so.*"
+FILES_${PN}-script-interpreter = "${libdir}/libcairo-script-interpreter.so.*"
+FILES_${PN}-perf-utils = "${bindir}/cairo-trace ${libdir}/cairo/*.la ${libdir}/cairo/libcairo-trace.so.*"
+
+do_install_append () {
+	rm -rf ${D}${bindir}/cairo-sphinx
+	rm -rf ${D}${libdir}/cairo/cairo-fdr*
+	rm -rf ${D}${libdir}/cairo/cairo-sphinx*
+	rm -rf ${D}${libdir}/cairo/.debug/cairo-fdr*
+	rm -rf ${D}${libdir}/cairo/.debug/cairo-sphinx*
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb
index e3e4cde..c71ab11 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb
@@ -18,7 +18,7 @@
 
 S = "${WORKDIR}/git"
 
-inherit autotools allarch fontcache
+inherit autotools allarch fontcache pkgconfig
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[fontforge] = "--enable-source-rebuild=yes,--enable-source-rebuild=no,fontforge-native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0.inc b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0.inc
index c6ecd08..6dbbf4d 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0.inc
@@ -35,7 +35,7 @@
 
 # Default configuration, distros might want to override
 PACKAGECONFIG ??= "egl \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glx x11', '', d)}"
 
 FILES_${PN}-examples = "${libdir}/clutter/examples"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.18.bb b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.18.bb
deleted file mode 100644
index 9626cd9..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.18.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require clutter-gst-3.0.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
-                    file://clutter-gst/clutter-gst.h;beginline=1;endline=24;md5=95baacba194e814c110ea3bdf25ddbf4"
-
-SRC_URI[archive.md5sum] = "3e4f64477f26d9cfd2db06d3aaed203a"
-SRC_URI[archive.sha256sum] = "0aec0d0c6020cd19a5bb0dab1165a92748f81a9a3acdfabb0f966d5f53bc8093"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.22.bb b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.22.bb
new file mode 100644
index 0000000..6177c91
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.22.bb
@@ -0,0 +1,7 @@
+require clutter-gst-3.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+                    file://clutter-gst/clutter-gst.h;beginline=1;endline=24;md5=95baacba194e814c110ea3bdf25ddbf4"
+
+SRC_URI[archive.md5sum] = "88eea2dd5fc4357b5b18f1dfeed56c62"
+SRC_URI[archive.sha256sum] = "f1fc57fb32ea7e3d9234b58db35eb9ef3028cf0b266d85235f959edc0fe3dfd4"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.8.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.8.0.bb
deleted file mode 100644
index 675365c..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.8.0.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require clutter-gtk-1.0.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
-
-SRC_URI[archive.md5sum] = "351cf9229cf941d36b441ede2236d742"
-SRC_URI[archive.sha256sum] = "742ef9d68ece36cbb1b2e1a4a6fbdad932f6645360be7e6de75abbb140dfbf1d"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.8.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.8.2.bb
new file mode 100644
index 0000000..78050df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.8.2.bb
@@ -0,0 +1,6 @@
+require clutter-gtk-1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+SRC_URI[archive.md5sum] = "6698207ee6e3d5a1c0ffc0a23444e12f"
+SRC_URI[archive.sha256sum] = "da27d486325490ad3f65d2abf9413aeb8b4a8f7b559e4b2f73567a5344a26b94"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0/0001-Fix-an-incorrect-preprocessor-conditional.patch b/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0/0001-Fix-an-incorrect-preprocessor-conditional.patch
new file mode 100644
index 0000000..2a9d8f8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0/0001-Fix-an-incorrect-preprocessor-conditional.patch
@@ -0,0 +1,32 @@
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Backport
+
+
+Original upstream commit follows:
+
+From b583e21d8698dbd58013320cfb47739102efdea7 Mon Sep 17 00:00:00 2001
+From: Kalev Lember <klember@redhat.com>
+Date: Wed, 19 Oct 2016 23:38:28 +0200
+Subject: [PATCH] Fix an incorrect preprocessor conditional
+
+This fixes the build with wayland wayland egl server support disabled.
+---
+ cogl/winsys/cogl-winsys-egl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
+index 39bfd884..4a9f3aa6 100644
+--- a/cogl/winsys/cogl-winsys-egl.c
++++ b/cogl/winsys/cogl-winsys-egl.c
+@@ -1029,7 +1029,7 @@ _cogl_egl_create_image (CoglContext *ctx,
+     egl_ctx = EGL_NO_CONTEXT;
+   else
+ #endif
+-#if COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT
++#ifdef COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT
+   /* The WL_bind_wayland_display spec states that EGL_NO_CONTEXT is to be used
+    * in conjunction with the EGL_WAYLAND_BUFFER_WL target */
+   if (target == EGL_WAYLAND_BUFFER_WL)
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.0.bb
deleted file mode 100644
index ed10c7a..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.0.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require cogl-1.0.inc
-
-SRC_URI += "file://test-backface-culling.c-fix-may-be-used-uninitialize.patch"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=1b1a508d91d25ca607c83f92f3e31c84"
-SRC_URI[archive.md5sum] = "ab684ec96848d79d22757fb3064820c8"
-SRC_URI[archive.sha256sum] = "689dfb5d14fc1106e9d2ded0f7930dcf7265d0bc84fa846b4f03941633eeaa91"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb
new file mode 100644
index 0000000..5901062
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb
@@ -0,0 +1,8 @@
+require cogl-1.0.inc
+
+SRC_URI += "file://test-backface-culling.c-fix-may-be-used-uninitialize.patch \
+            file://0001-Fix-an-incorrect-preprocessor-conditional.patch"
+SRC_URI[archive.md5sum] = "d53b708ca7c4af03d7254e46945d6b33"
+SRC_URI[archive.sha256sum] = "39a718cdb64ea45225a7e94f88dddec1869ab37a21b339ad058a9d898782c00d"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=1b1a508d91d25ca607c83f92f3e31c84"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/installtests.patch b/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/installtests.patch
index 30e0a61..ec1fb02 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/installtests.patch
+++ b/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/installtests.patch
@@ -1,15 +1,25 @@
-tests: also install tests app
+From 5c6eb43c2f6e7f2ee7c25c92e42f4e4403fa0527 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 21 Feb 2017 14:37:52 +0200
+Subject: [PATCH] tests: also install test apps
 
 Upstream-Status: Inappropriate [configuration]
 
 Signed-off-by: Yu Ke <ke.yu@intel.com>
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ tests/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
 
-Index: libdrm-2.4.66/tests/Makefile.am
-===================================================================
---- libdrm-2.4.66.orig/tests/Makefile.am
-+++ libdrm-2.4.66/tests/Makefile.am
-@@ -73,3 +73,4 @@ TESTS +=					\
- endif
- 
- check_PROGRAMS += $(TESTS)
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 0355a92..b4882cd 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -45,3 +45,4 @@ TESTS = \
+ check_PROGRAMS = \
+ 	$(TESTS) \
+ 	drmdevice
 +bin_PROGRAMS = $(check_PROGRAMS)
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm_2.4.70.bb b/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm_2.4.70.bb
deleted file mode 100644
index a2b5282..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm_2.4.70.bb
+++ /dev/null
@@ -1,47 +0,0 @@
-SUMMARY = "Userspace interface to the kernel DRM services"
-DESCRIPTION = "The runtime library for accessing the kernel DRM services.  DRM \
-stands for \"Direct Rendering Manager\", which is the kernel portion of the \
-\"Direct Rendering Infrastructure\" (DRI).  DRI is required for many hardware \
-accelerated OpenGL drivers."
-HOMEPAGE = "http://dri.freedesktop.org"
-SECTION = "x11/base"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71"
-PROVIDES = "drm"
-DEPENDS = "libpthread-stubs udev libpciaccess"
-
-SRC_URI = "http://dri.freedesktop.org/libdrm/${BP}.tar.bz2 \
-           file://installtests.patch \
-           file://fix_O_CLOEXEC_undeclared.patch \
-           file://0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch \
-          "
-
-SRC_URI[md5sum] = "920957cfe25a80efb02be9bd90bf3c1e"
-SRC_URI[sha256sum] = "b17d4b39ed97ca0e4cffa0db06ff609e617bac94646ec38e8e0579d530540e7b"
-
-inherit autotools pkgconfig
-
-EXTRA_OECONF += "--disable-cairo-tests \
-                 --without-cunit \
-                 --enable-omap-experimental-api \
-                 --enable-install-test-programs \
-                 --disable-manpages \
-                 --disable-valgrind \
-                "
-
-ALLOW_EMPTY_${PN}-drivers = "1"
-PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-radeon ${PN}-nouveau ${PN}-omap \
-             ${PN}-intel ${PN}-exynos ${PN}-kms ${PN}-freedreno ${PN}-amdgpu"
-
-RRECOMMENDS_${PN}-drivers = "${PN}-radeon ${PN}-nouveau ${PN}-omap ${PN}-intel \
-                             ${PN}-exynos ${PN}-freedreno ${PN}-amdgpu"
-
-FILES_${PN}-tests = "${bindir}/*"
-FILES_${PN}-radeon = "${libdir}/libdrm_radeon.so.*"
-FILES_${PN}-nouveau = "${libdir}/libdrm_nouveau.so.*"
-FILES_${PN}-omap = "${libdir}/libdrm_omap.so.*"
-FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
-FILES_${PN}-exynos = "${libdir}/libdrm_exynos.so.*"
-FILES_${PN}-kms = "${libdir}/libkms*.so.*"
-FILES_${PN}-freedreno = "${libdir}/libdrm_freedreno.so.*"
-FILES_${PN}-amdgpu = "${libdir}/libdrm_amdgpu.so.*"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm_2.4.75.bb b/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm_2.4.75.bb
new file mode 100644
index 0000000..56963d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm_2.4.75.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Userspace interface to the kernel DRM services"
+DESCRIPTION = "The runtime library for accessing the kernel DRM services.  DRM \
+stands for \"Direct Rendering Manager\", which is the kernel portion of the \
+\"Direct Rendering Infrastructure\" (DRI).  DRI is required for many hardware \
+accelerated OpenGL drivers."
+HOMEPAGE = "http://dri.freedesktop.org"
+SECTION = "x11/base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71"
+PROVIDES = "drm"
+DEPENDS = "libpthread-stubs libpciaccess"
+
+SRC_URI = "http://dri.freedesktop.org/libdrm/${BP}.tar.bz2 \
+           file://installtests.patch \
+           file://fix_O_CLOEXEC_undeclared.patch \
+           file://0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch \
+          "
+
+SRC_URI[md5sum] = "57b0589122ec4b8d5dfb9e430a21f0b3"
+SRC_URI[sha256sum] = "2d5a500eef412cc287d12268eed79d571e262d4957a2ec9258073f305985054f"
+
+inherit autotools pkgconfig manpages
+
+EXTRA_OECONF += "--disable-cairo-tests \
+                 --without-cunit \
+                 --enable-omap-experimental-api \
+                 --enable-etnaviv-experimental-api \
+                 --enable-install-test-programs \
+                 --disable-valgrind \
+                "
+PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
+
+ALLOW_EMPTY_${PN}-drivers = "1"
+PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-radeon ${PN}-nouveau ${PN}-omap \
+             ${PN}-intel ${PN}-exynos ${PN}-kms ${PN}-freedreno ${PN}-amdgpu \
+             ${PN}-etnaviv"
+
+RRECOMMENDS_${PN}-drivers = "${PN}-radeon ${PN}-nouveau ${PN}-omap ${PN}-intel \
+                             ${PN}-exynos ${PN}-freedreno ${PN}-amdgpu \
+                             ${PN}-etnaviv"
+
+FILES_${PN}-tests = "${bindir}/*"
+FILES_${PN}-radeon = "${libdir}/libdrm_radeon.so.*"
+FILES_${PN}-nouveau = "${libdir}/libdrm_nouveau.so.*"
+FILES_${PN}-omap = "${libdir}/libdrm_omap.so.*"
+FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
+FILES_${PN}-exynos = "${libdir}/libdrm_exynos.so.*"
+FILES_${PN}-kms = "${libdir}/libkms*.so.*"
+FILES_${PN}-freedreno = "${libdir}/libdrm_freedreno.so.*"
+FILES_${PN}-amdgpu = "${libdir}/libdrm_amdgpu.so.*"
+FILES_${PN}-etnaviv = "${libdir}/libdrm_etnaviv.so.*"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb
index 455d31e..dc2820c 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb
@@ -1,6 +1,6 @@
 EGLINFO_PLATFORM ?= "fb"
 EGLINFO_BINARY_NAME ?= "eglinfo-fb"
 
-include eglinfo.inc
+require eglinfo.inc
 
 SUMMARY += "(Framebuffer version)"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb
index 3427fdf..48ab880 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb
@@ -1,12 +1,13 @@
 EGLINFO_PLATFORM ?= "x11"
 EGLINFO_BINARY_NAME ?= "eglinfo-x11"
 
-include eglinfo.inc
+require eglinfo.inc
 
 DEPENDS += "virtual/libx11"
 
 inherit distro_features_check
+
 # depends on virtual/libx11
-REQUIRED_DISTRO_FEATURES = "x11"
+REQUIRED_DISTRO_FEATURES += "x11"
 
 SUMMARY += "(X11 version)"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo.inc b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo.inc
index d0c0c27..8e7d9bd 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo.inc
@@ -11,6 +11,8 @@
           "
 SRCREV = "4b317648ec6cf39556a9e5d8078f605bc0edd5de"
 
+CVE_PRODUCT = "eglinfo"
+
 S = "${WORKDIR}/git"
 
 inherit waf distro_features_check
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig/0001-Avoid-conflicts-with-integer-width-macros-from-TS-18.patch b/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig/0001-Avoid-conflicts-with-integer-width-macros-from-TS-18.patch
new file mode 100644
index 0000000..cad7170
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig/0001-Avoid-conflicts-with-integer-width-macros-from-TS-18.patch
@@ -0,0 +1,72 @@
+From 20cddc824c6501c2082cac41b162c34cd5fcc530 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 11 Dec 2016 14:32:00 -0800
+Subject: [PATCH] Avoid conflicts with integer width macros from TS
+ 18661-1:2014
+
+glibc 2.25+ has now defined these macros in <limits.h>
+https://sourceware.org/git/?p=glibc.git;a=commit;h=5b17fd0da62bf923cb61d1bb7b08cf2e1f1f9c1a
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ fontconfig/fontconfig.h | 2 +-
+ src/fcobjs.h            | 2 +-
+ src/fcobjshash.gperf    | 2 +-
+ src/fcobjshash.h        | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+Index: fontconfig-2.12.1/fontconfig/fontconfig.h
+===================================================================
+--- fontconfig-2.12.1.orig/fontconfig/fontconfig.h
++++ fontconfig-2.12.1/fontconfig/fontconfig.h
+@@ -128,7 +128,8 @@ typedef int		FcBool;
+ #define FC_USER_CACHE_FILE	    ".fonts.cache-" FC_CACHE_VERSION
+ 
+ /* Adjust outline rasterizer */
+-#define FC_CHAR_WIDTH	    "charwidth"	/* Int */
++#define FC_CHARWIDTH	    "charwidth"	/* Int */
++#define FC_CHAR_WIDTH	    FC_CHARWIDTH
+ #define FC_CHAR_HEIGHT	    "charheight"/* Int */
+ #define FC_MATRIX	    "matrix"    /* FcMatrix */
+ 
+Index: fontconfig-2.12.1/src/fcobjs.h
+===================================================================
+--- fontconfig-2.12.1.orig/src/fcobjs.h
++++ fontconfig-2.12.1/src/fcobjs.h
+@@ -51,7 +51,7 @@ FC_OBJECT (DPI,			FcTypeDouble,	NULL)
+ FC_OBJECT (RGBA,		FcTypeInteger,	NULL)
+ FC_OBJECT (SCALE,		FcTypeDouble,	NULL)
+ FC_OBJECT (MINSPACE,		FcTypeBool,	NULL)
+-FC_OBJECT (CHAR_WIDTH,		FcTypeInteger,	NULL)
++FC_OBJECT (CHARWIDTH,		FcTypeInteger,	NULL)
+ FC_OBJECT (CHAR_HEIGHT,		FcTypeInteger,	NULL)
+ FC_OBJECT (MATRIX,		FcTypeMatrix,	NULL)
+ FC_OBJECT (CHARSET,		FcTypeCharSet,	FcCompareCharSet)
+Index: fontconfig-2.12.1/src/fcobjshash.gperf
+===================================================================
+--- fontconfig-2.12.1.orig/src/fcobjshash.gperf
++++ fontconfig-2.12.1/src/fcobjshash.gperf
+@@ -44,7 +44,7 @@ int id;
+ "rgba",FC_RGBA_OBJECT
+ "scale",FC_SCALE_OBJECT
+ "minspace",FC_MINSPACE_OBJECT
+-"charwidth",FC_CHAR_WIDTH_OBJECT
++"charwidth",FC_CHARWIDTH_OBJECT
+ "charheight",FC_CHAR_HEIGHT_OBJECT
+ "matrix",FC_MATRIX_OBJECT
+ "charset",FC_CHARSET_OBJECT
+Index: fontconfig-2.12.1/src/fcobjshash.h
+===================================================================
+--- fontconfig-2.12.1.orig/src/fcobjshash.h
++++ fontconfig-2.12.1/src/fcobjshash.h
+@@ -284,7 +284,7 @@ FcObjectTypeLookup (register const char
+       {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str43,FC_CHARSET_OBJECT},
+       {-1},
+ #line 47 "fcobjshash.gperf"
+-      {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_CHAR_WIDTH_OBJECT},
++      {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_CHARWIDTH_OBJECT},
+ #line 48 "fcobjshash.gperf"
+       {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str46,FC_CHAR_HEIGHT_OBJECT},
+ #line 55 "fcobjshash.gperf"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig_2.12.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig_2.12.1.bb
index 115f558..95b066c 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig_2.12.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig_2.12.1.bb
@@ -22,6 +22,7 @@
 
 SRC_URI = "http://fontconfig.org/release/fontconfig-${PV}.tar.gz \
            file://revert-static-pkgconfig.patch \
+           file://0001-Avoid-conflicts-with-integer-width-macros-from-TS-18.patch \
            "
 SRC_URI[md5sum] = "ce55e525c37147eee14cc2de6cc09f6c"
 SRC_URI[sha256sum] = "a9f42d03949f948a3a4f762287dbc16e53a927c91a07ee64207ebd90a9e5e292"
@@ -36,7 +37,7 @@
 RCONFLICTS_fontconfig-utils = "libfontconfig-utils"
 DEBIAN_NOAUTONAME_fontconfig-utils = "1"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig relative_symlinks
 
 FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
 
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype_2.6.5.bb b/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype_2.6.5.bb
deleted file mode 100644
index 97dde3a..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype_2.6.5.bb
+++ /dev/null
@@ -1,49 +0,0 @@
-SUMMARY = "Freetype font rendering library"
-DESCRIPTION = "FreeType is a software font engine that is designed to be small, efficient, \
-highly customizable, and portable while capable of producing high-quality output (glyph \
-images). It can be used in graphics libraries, display servers, font conversion tools, text \
-image generation tools, and many other products as well."
-HOMEPAGE = "http://www.freetype.org/"
-BUGTRACKER = "https://savannah.nongnu.org/bugs/?group=freetype"
-SECTION = "libs"
-
-LICENSE = "FreeType | GPLv2+"
-LIC_FILES_CHKSUM = "file://docs/LICENSE.TXT;md5=4af6221506f202774ef74f64932878a1 \
-                    file://docs/FTL.TXT;md5=13b25413274c9b3b09b63e4028216ff4 \
-                    file://docs/GPLv2.TXT;md5=8ef380476f642c20ebf40fecb0add2ec"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/freetype/freetype-${PV}.tar.bz2 \
-           file://use-right-libtool.patch"
-
-UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/freetype/files/freetype2/"
-UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
-
-SRC_URI[md5sum] = "6a386964e18ba28cb93370e57a19031b"
-SRC_URI[sha256sum] = "e20a6e1400798fd5e3d831dd821b61c35b1f9a6465d6b18a53a9df4cf441acf0"
-
-inherit autotools pkgconfig binconfig-disabled multilib_header
-
-# Adapt autotools to work with the minimal autoconf usage in freetype
-AUTOTOOLS_SCRIPT_PATH = "${S}/builds/unix"
-CONFIGURE_SCRIPT = "${S}/configure"
-EXTRA_AUTORECONF += "--exclude=autoheader --exclude=automake"
-
-PACKAGECONFIG ??= "zlib"
-
-PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2"
-# harfbuzz results in a circular dependency so enabling is non-trivial
-PACKAGECONFIG[harfbuzz] = "--with-harfbuzz,--without-harfbuzz,harfbuzz"
-PACKAGECONFIG[pixmap] = "--with-png,--without-png,libpng"
-PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
-
-EXTRA_OECONF = "CC_BUILD='${BUILD_CC}'"
-
-TARGET_CPPFLAGS += "-D_FILE_OFFSET_BITS=64"
-
-do_install_append() {
-	oe_multilib_header freetype2/freetype/config/ftconfig.h
-}
-
-BINCONFIG = "${bindir}/freetype-config"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype_2.7.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype_2.7.1.bb
new file mode 100644
index 0000000..544f835
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype_2.7.1.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Freetype font rendering library"
+DESCRIPTION = "FreeType is a software font engine that is designed to be small, efficient, \
+highly customizable, and portable while capable of producing high-quality output (glyph \
+images). It can be used in graphics libraries, display servers, font conversion tools, text \
+image generation tools, and many other products as well."
+HOMEPAGE = "http://www.freetype.org/"
+BUGTRACKER = "https://savannah.nongnu.org/bugs/?group=freetype"
+SECTION = "libs"
+
+LICENSE = "FreeType | GPLv2+"
+LIC_FILES_CHKSUM = "file://docs/LICENSE.TXT;md5=4af6221506f202774ef74f64932878a1 \
+                    file://docs/FTL.TXT;md5=13b25413274c9b3b09b63e4028216ff4 \
+                    file://docs/GPLv2.TXT;md5=8ef380476f642c20ebf40fecb0add2ec"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/freetype/freetype-${PV}.tar.bz2 \
+           file://use-right-libtool.patch"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/freetype/files/freetype2/"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
+
+SRC_URI[md5sum] = "b3230110e0cab777e0df7631837ac36e"
+SRC_URI[sha256sum] = "3a3bb2c4e15ffb433f2032f50a5b5a92558206822e22bfe8cbe339af4aa82f88"
+
+inherit autotools pkgconfig binconfig-disabled multilib_header
+
+# Adapt autotools to work with the minimal autoconf usage in freetype
+AUTOTOOLS_SCRIPT_PATH = "${S}/builds/unix"
+CONFIGURE_SCRIPT = "${S}/configure"
+EXTRA_AUTORECONF += "--exclude=autoheader --exclude=automake"
+
+PACKAGECONFIG ??= "zlib"
+
+PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2"
+# harfbuzz results in a circular dependency so enabling is non-trivial
+PACKAGECONFIG[harfbuzz] = "--with-harfbuzz,--without-harfbuzz,harfbuzz"
+PACKAGECONFIG[pixmap] = "--with-png,--without-png,libpng"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
+
+EXTRA_OECONF = "CC_BUILD='${BUILD_CC}'"
+
+TARGET_CPPFLAGS += "-D_FILE_OFFSET_BITS=64"
+
+do_install_append() {
+	oe_multilib_header freetype2/freetype/config/ftconfig.h
+}
+
+BINCONFIG = "${bindir}/freetype-config"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/glew/glew_2.0.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/glew/glew_2.0.0.bb
index 489dd7c..1c93ca0 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/glew/glew_2.0.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/glew/glew_2.0.0.bb
@@ -2,12 +2,9 @@
 DESCRIPTION = "The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library."
 HOMEPAGE = "http://glew.sourceforge.net/"
 BUGTRACKER = "http://sourceforge.net/tracker/?group_id=67586"
-SECTION = "x11"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ac251558de685c6b9478d89be3149c2"
 
-DEPENDS = "virtual/libx11 virtual/libgl libglu libxext libxi libxmu"
-
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/glew/glew/${PV}/glew-${PV}.tgz \
            file://no-strip.patch"
 
@@ -19,12 +16,18 @@
 
 inherit lib_package pkgconfig distro_features_check
 
-REQUIRED_DISTRO_FEATURES = "x11"
+REQUIRED_DISTRO_FEATURES = "opengl"
 
-# Override SYSTEM to avoid calling config.guess, we're cross-compiling.  Pass
-# our CFLAGS via POPT as that's the optimisation variable and safely
-# overwritten.
-EXTRA_OEMAKE = "SYSTEM='linux' \
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'opengl', 'egl-gles2', d)}"
+
+# The opengl and egl-XXX options are exclusive, enable only one.
+PACKAGECONFIG[opengl] = "SYSTEM='linux',,virtual/libx11 virtual/libgl libglu libxext libxi libxmu"
+PACKAGECONFIG[egl-gles2] = "SYSTEM='linux-egl' GLEW_NO_GLU='-DGLEW_NO_GLU' LDFLAGS.GL='-lEGL -lGLESv2',,virtual/egl virtual/libgles2"
+
+# Override SYSTEM (via PACKAGECONFIG_CONFARGS) to avoid calling config.guess,
+# we're cross-compiling. Pass our CFLAGS via POPT as that's the optimisation
+# variable and safely overwritten.
+EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS} \
                 CC='${CC}' LD='${CC}' STRIP='' \
                 LDFLAGS.EXTRA='${LDFLAGS}' \
                 POPT='${CFLAGS}' \
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.3.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.3.0.bb
deleted file mode 100644
index f24c443..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.3.0.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-SUMMARY = "Text shaping library"
-DESCRIPTION = "HarfBuzz is an OpenType text shaping engine."
-HOMEPAGE = "http://www.freedesktop.org/wiki/Software/HarfBuzz"
-BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=HarfBuzz"
-SECTION = "libs"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=e021dd6dda6ff1e6b1044002fc662b9b \
-                    file://src/hb-ucdn/COPYING;md5=994ba0f1295f15b4bda4999a5bbeddef \
-"
-
-DEPENDS = "glib-2.0 cairo fontconfig freetype"
-
-SRC_URI = "http://www.freedesktop.org/software/harfbuzz/release/${BP}.tar.bz2"
-
-SRC_URI[md5sum] = "a82d49ff67197bc3c96ea34b98880c52"
-SRC_URI[sha256sum] = "b04be31633efee2cae1d62d46434587302554fa837224845a62565ec68a0334d"
-
-inherit autotools pkgconfig lib_package gtk-doc
-
-PACKAGECONFIG ??= "icu"
-PACKAGECONFIG[icu] = "--with-icu,--without-icu,icu"
-
-EXTRA_OECONF = " \
-    --with-cairo \
-    --with-fontconfig \
-    --with-freetype \
-    --with-glib \
-    --without-graphite2 \
-"
-
-PACKAGES =+ "${PN}-icu ${PN}-icu-dev"
-
-FILES_${PN}-icu = "${libdir}/libharfbuzz-icu.so.*"
-FILES_${PN}-icu-dev = "${libdir}/libharfbuzz-icu.la \
-                       ${libdir}/libharfbuzz-icu.so \
-                       ${libdir}/pkgconfig/harfbuzz-icu.pc \
-"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.4.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.4.1.bb
new file mode 100644
index 0000000..fc4773e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.4.1.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Text shaping library"
+DESCRIPTION = "HarfBuzz is an OpenType text shaping engine."
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/HarfBuzz"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=HarfBuzz"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e021dd6dda6ff1e6b1044002fc662b9b \
+                    file://src/hb-ucdn/COPYING;md5=994ba0f1295f15b4bda4999a5bbeddef \
+"
+
+DEPENDS = "glib-2.0 cairo fontconfig freetype"
+
+SRC_URI = "http://www.freedesktop.org/software/harfbuzz/release/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "7b3f445d0a58485a31c18c03ce9b4e3c"
+SRC_URI[sha256sum] = "85a27fab639a1d651737dcb6b69e4101e3fd09522fdfdcb793df810b5cb315bd"
+
+inherit autotools pkgconfig lib_package gtk-doc
+
+PACKAGECONFIG ??= "icu"
+PACKAGECONFIG[icu] = "--with-icu,--without-icu,icu"
+
+EXTRA_OECONF = " \
+    --with-cairo \
+    --with-fontconfig \
+    --with-freetype \
+    --with-glib \
+    --without-graphite2 \
+"
+
+PACKAGES =+ "${PN}-icu ${PN}-icu-dev"
+
+FILES_${PN}-icu = "${libdir}/libharfbuzz-icu.so.*"
+FILES_${PN}-icu-dev = "${libdir}/libharfbuzz-icu.la \
+                       ${libdir}/libharfbuzz-icu.so \
+                       ${libdir}/pkgconfig/harfbuzz-icu.pc \
+"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo/fix-mips.patch b/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo/fix-mips.patch
new file mode 100644
index 0000000..4d41237
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo/fix-mips.patch
@@ -0,0 +1,45 @@
+Fix a regression that causes the MIPS code from building.
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 7bfb22af123ac10798a9a4c9ec7b23e5065db35e Mon Sep 17 00:00:00 2001
+From: DRC <information@libjpeg-turbo.org>
+Date: Mon, 26 Sep 2016 17:59:14 -0500
+Subject: [PATCH] Fix broken MIPS build
+
+Regression introduced by 9055fb408dcb585ce9392d395e16630d51002152
+
+Fixes #104
+---
+ ChangeLog.md      | 3 +++
+ simd/jsimd_mips.c | 2 ++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/ChangeLog.md b/ChangeLog.md
+index e2b9df3..71ddcaa 100644
+--- a/ChangeLog.md
++++ b/ChangeLog.md
+@@ -6,6 +6,9 @@
+ 1. Fixed a regression introduced by 1.5.1[7] that prevented libjpeg-turbo from
+ building with Android NDK platforms prior to android-21 (5.0).
+ 
++2. Fixed a regression introduced by 1.5.1[1] that prevented the MIPS DSPR2 SIMD
++code in libjpeg-turbo from building.
++
+ 
+ 1.5.1
+ =====
+diff --git a/simd/jsimd_mips.c b/simd/jsimd_mips.c
+index 63b8115..02e90cd 100644
+--- a/simd/jsimd_mips.c
++++ b/simd/jsimd_mips.c
+@@ -63,6 +63,8 @@ parse_proc_cpuinfo(const char* search_string)
+ LOCAL(void)
+ init_simd (void)
+ {
++  char *env = NULL;
++
+   if (simd_support != ~0U)
+     return;
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo_1.5.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo_1.5.0.bb
deleted file mode 100644
index c9e70d7..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo_1.5.0.bb
+++ /dev/null
@@ -1,46 +0,0 @@
-SUMMARY = "Hardware accelerated JPEG compression/decompression library"
-DESCRIPTION = "libjpeg-turbo is a derivative of libjpeg that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression"
-HOMEPAGE = "http://libjpeg-turbo.org/"
-
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://cdjpeg.h;endline=13;md5=05bab7c7ad899d85bfba60da1a1271f2 \
-                    file://jpeglib.h;endline=16;md5=f67d70e547a2662c079781c72f877f72 \
-                    file://djpeg.c;endline=11;md5=b90b6d2b4119f9e5807cd273f525d2af \
-"
-DEPENDS = "nasm-native"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
-SRC_URI[md5sum] = "3fc5d9b6a8bce96161659ae7a9939257"
-SRC_URI[sha256sum] = "9f397c31a67d2b00ee37597da25898b03eb282ccd87b135a50a69993b6a2035f"
-UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libjpeg-turbo/files/"
-UPSTREAM_CHECK_REGEX = "/libjpeg-turbo/files/(?P<pver>(\d+[\.\-_]*)+)/"
-
-PE= "1"
-
-# Drop-in replacement for jpeg
-PROVIDES = "jpeg"
-RPROVIDES_${PN} += "jpeg"
-RREPLACES_${PN} += "jpeg"
-RCONFLICTS_${PN} += "jpeg"
-
-inherit autotools pkgconfig
-
-# Work around missing x32 ABI support
-EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", "--without-simd", "", d)}"
-
-# Work around missing non-floating point ABI support in MIPS
-EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("MIPSPKGSFX_FPU", "-nf", "--without-simd", "", d)}"
-
-# Provide a workaround if Altivec unit is not present in PPC
-EXTRA_OECONF_append_class-target_powerpc = "${@bb.utils.contains("TUNE_FEATURES", "altivec", "", "--without-simd", d)}"
-EXTRA_OECONF_append_class-target_powerpc64 = "${@bb.utils.contains("TUNE_FEATURES", "altivec", "", "--without-simd", d)}"
-
-PACKAGES =+ "jpeg-tools libturbojpeg"
-
-DESCRIPTION_jpeg-tools = "The jpeg-tools package includes client programs to access libjpeg functionality.  These tools allow for the compression, decompression, transformation and display of JPEG files and benchmarking of the libjpeg library."
-FILES_jpeg-tools = "${bindir}/*"
-
-DESCRIPTION_libturbojpeg = "A SIMD-accelerated JPEG codec which provides only TurboJPEG APIs"
-FILES_libturbojpeg = "${libdir}/libturbojpeg.so.*"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo_1.5.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo_1.5.1.bb
new file mode 100644
index 0000000..de2eeaf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo_1.5.1.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Hardware accelerated JPEG compression/decompression library"
+DESCRIPTION = "libjpeg-turbo is a derivative of libjpeg that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression"
+HOMEPAGE = "http://libjpeg-turbo.org/"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://cdjpeg.h;endline=13;md5=05bab7c7ad899d85bfba60da1a1271f2 \
+                    file://jpeglib.h;endline=16;md5=f67d70e547a2662c079781c72f877f72 \
+                    file://djpeg.c;endline=11;md5=b90b6d2b4119f9e5807cd273f525d2af \
+"
+DEPENDS_append_x86-64_class-target = " nasm-native"
+DEPENDS_append_x86_class-target    = " nasm-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+           file://fix-mips.patch"
+SRC_URI[md5sum] = "55deb139b0cac3c8200b75d485fc13f3"
+SRC_URI[sha256sum] = "41429d3d253017433f66e3d472b8c7d998491d2f41caa7306b8d9a6f2a2c666c"
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libjpeg-turbo/files/"
+UPSTREAM_CHECK_REGEX = "/libjpeg-turbo/files/(?P<pver>(\d+[\.\-_]*)+)/"
+
+PE= "1"
+
+# Drop-in replacement for jpeg
+PROVIDES = "jpeg"
+RPROVIDES_${PN} += "jpeg"
+RREPLACES_${PN} += "jpeg"
+RCONFLICTS_${PN} += "jpeg"
+
+inherit autotools pkgconfig
+
+# Add nasm-native dependency consistently for all build arches is hard
+EXTRA_OECONF_append_class-native = " --without-simd"
+
+# Work around missing x32 ABI support
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", "--without-simd", "", d)}"
+
+# Work around missing non-floating point ABI support in MIPS
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("MIPSPKGSFX_FPU", "-nf", "--without-simd", "", d)}"
+
+# Provide a workaround if Altivec unit is not present in PPC
+EXTRA_OECONF_append_class-target_powerpc = " ${@bb.utils.contains("TUNE_FEATURES", "altivec", "", "--without-simd", d)}"
+EXTRA_OECONF_append_class-target_powerpc64 = " ${@bb.utils.contains("TUNE_FEATURES", "altivec", "", "--without-simd", d)}"
+
+PACKAGES =+ "jpeg-tools libturbojpeg"
+
+DESCRIPTION_jpeg-tools = "The jpeg-tools package includes client programs to access libjpeg functionality.  These tools allow for the compression, decompression, transformation and display of JPEG files and benchmarking of the libjpeg library."
+FILES_jpeg-tools = "${bindir}/*"
+
+DESCRIPTION_libturbojpeg = "A SIMD-accelerated JPEG codec which provides only TurboJPEG APIs"
+FILES_libturbojpeg = "${libdir}/libturbojpeg.so.*"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch
deleted file mode 100644
index 674c8e8..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From 3a93150bc0aec86afdb7d053247dc2448925e09a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
-Date: Wed, 6 May 2015 10:45:22 +0200
-Subject: [PATCH 1/2] select platforms based on configuration results
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Upstream-Status: Submitted [1]
-
-[1] https://github.com/anholt/libepoxy/pull/52
-
-Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
----
- configure.ac          | 13 +++++--------
- src/dispatch_common.c |  9 ++++++---
- src/dispatch_common.h |  9 +++++----
- 3 files changed, 16 insertions(+), 15 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index a52fc58..bdd70da 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -58,6 +58,10 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
- # uintptr_t to a void *") by default.  Kill that.
- XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
- 
-+PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
-+
-+AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
-+
- has_znow=yes
- 
- case $host_os in
-@@ -86,7 +90,7 @@ case $host_os in
-         ;;
-     *)
-         build_egl=yes
--        build_glx=yes
-+        build_glx=$x11
-         build_wgl=no
-         # On platforms with dlopen, we load everything dynamically and
-         # don't link against a specific window system or GL implementation.
-@@ -144,13 +148,6 @@ esac
- 
- AC_SUBST([VISIBILITY_CFLAGS])
- 
--PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
--if test x$x11 = xno -a x$build_glx = xyes; then
--    AC_MSG_ERROR([libX11 headers (libx11-dev) required to build with GLX support])
--fi
--
--AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
--
- PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no])
- 
- AC_CONFIG_FILES([
-diff --git a/src/dispatch_common.c b/src/dispatch_common.c
-index 4e34d6e..2ab84ed 100644
---- a/src/dispatch_common.c
-+++ b/src/dispatch_common.c
-@@ -615,10 +615,13 @@ epoxy_get_proc_address(const char *name)
- #elif defined(__APPLE__)
-     return epoxy_gl_dlsym(name);
- #else
-+#if PLATFORM_HAS_GLX
-     if (epoxy_current_context_is_glx()) {
-         return glXGetProcAddressARB((const GLubyte *)name);
--    } else {
-+    } else
-+#endif /* PLATFORM_HAS_GLX */
- #if PLATFORM_HAS_EGL
-+    {
-         GLenum egl_api = epoxy_egl_get_current_gl_context_api();
- 
-         switch (egl_api) {
-@@ -628,10 +631,10 @@ epoxy_get_proc_address(const char *name)
-         case EGL_NONE:
-             break;
-         }
--#endif
-     }
-+#endif /* PLATFORM_HAS_EGL */
-     errx(1, "Couldn't find current GLX or EGL context.\n");
--#endif
-+#endif /* _WIN32 | __APPLE__*/
- }
- 
- void
-diff --git a/src/dispatch_common.h b/src/dispatch_common.h
-index 6b8503a..82681e4 100644
---- a/src/dispatch_common.h
-+++ b/src/dispatch_common.h
-@@ -21,12 +21,13 @@
-  * IN THE SOFTWARE.
-  */
- 
-+#include <config.h>
- #include <stdbool.h>
- 
- #ifdef _WIN32
- #define PLATFORM_HAS_EGL 0
- #define PLATFORM_HAS_GLX 0
--#define PLATFORM_HAS_WGL 1
-+#define PLATFORM_HAS_WGL BUILD_WGL
- #define EPOXY_IMPORTEXPORT __declspec(dllexport)
- #elif defined(__APPLE__)
- #define PLATFORM_HAS_EGL 0
-@@ -34,13 +35,13 @@
- #define PLATFORM_HAS_WGL 0
- #define EPOXY_IMPORTEXPORT
- #elif defined(ANDROID)
--#define PLATFORM_HAS_EGL 1
-+#define PLATFORM_HAS_EGL BUILD_EGL
- #define PLATFORM_HAS_GLX 0
- #define PLATFORM_HAS_WGL 0
- #define EPOXY_IMPORTEXPORT
- #else
--#define PLATFORM_HAS_EGL 1
--#define PLATFORM_HAS_GLX 1
-+#define PLATFORM_HAS_EGL BUILD_EGL
-+#define PLATFORM_HAS_GLX BUILD_GLX
- #define PLATFORM_HAS_WGL 0
- #define EPOXY_IMPORTEXPORT
- #endif
--- 
-1.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
deleted file mode 100644
index 262d684..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 24868cbfb9dda5f6929dd277c47d35df016e8754 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
-Date: Wed, 6 May 2015 11:05:48 +0200
-Subject: [PATCH 2/2] add an option to disable glx support
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-this option would help us in yocto to get deterministic build results
-
-Upstream-Status: Submitted [1]
-
-[1] https://github.com/anholt/libepoxy/pull/52
-
-Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
----
- configure.ac | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index bdd70da..6c7153d 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -58,7 +58,14 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
- # uintptr_t to a void *") by default.  Kill that.
- XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
- 
--PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
-+AC_ARG_ENABLE([glx],
-+                [AS_HELP_STRING([--disable-glx],
-+				[disable if you don't want x11/glx support])],
-+                [],
-+                [enable_glx=yes]
-+             )
-+
-+PKG_CHECK_MODULES(X11, [x11], [x11=$enable_glx], [x11=no])
- 
- AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
- 
--- 
-1.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/no-need-for-python3.patch b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/no-need-for-python3.patch
deleted file mode 100644
index 4b8fea5..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/no-need-for-python3.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-There is no need to use python3 by this package (the python scripts
-that are using during configuration only need python2.7+)
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Gary Thomas <gary@mlbassoc.com>
---
-Index: git/configure.ac
-===================================================================
---- git.orig/configure.ac
-+++ git/configure.ac
-@@ -40,7 +40,7 @@ m4_ifndef([XORG_MACROS_VERSION],
- XORG_MACROS_VERSION(1.8)
- XORG_DEFAULT_OPTIONS
- 
--AC_CHECK_PROGS([PYTHON], [python3 python2 python])
-+AC_CHECK_PROGS([PYTHON], [python2 python])
- 
- # Initialize libtool
- AC_DISABLE_STATIC
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy_1.4.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy_1.4.0.bb
new file mode 100644
index 0000000..ee9f694
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy_1.4.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "OpenGL function pointer management library"
+HOMEPAGE = "https://github.com/anholt/libepoxy/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=58ef4c80d401e07bd9ee8b6b58cf464b"
+
+SRC_URI = "https://github.com/anholt/${BPN}/releases/download/v1.4/${BP}.tar.xz"
+SRC_URI[md5sum] = "d8d8cbf2beb64975d424fcc5167a2a38"
+SRC_URI[sha256sum] = "25a906b14a921bc2b488cfeaa21a00486fe92630e4a9dd346e4ecabeae52ab41"
+UPSTREAM_CHECK_URI = "https://github.com/anholt/libepoxy/releases"
+
+inherit autotools pkgconfig distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+DEPENDS = "util-macros virtual/egl"
+
+PACKAGECONFIG[x11] = "--enable-glx, --disable-glx, virtual/libx11"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy_git.bb
deleted file mode 100644
index 6c247cc..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy_git.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY = "OpenGL function pointer management library"
-HOMEPAGE = "https://github.com/anholt/libepoxy/"
-SECTION = "libs"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=58ef4c80d401e07bd9ee8b6b58cf464b"
-
-
-SRC_URI = " \
-    git://github.com/anholt/libepoxy.git \
-    file://0001-select-platforms-based-on-configuration-results.patch \
-    file://0002-add-an-option-to-disable-glx-support.patch \
-    file://no-need-for-python3.patch \
-"
-SRCREV="e2c33af5bfcfc9d168f9e776156dd47c33f428b3"
-PV = "1.3.1"
-
-S = "${WORKDIR}/git"
-
-inherit autotools pkgconfig distro_features_check
-# depends on virtual/egl
-REQUIRED_DISTRO_FEATURES = "opengl"
-
-DEPENDS = "util-macros virtual/egl"
-
-PACKAGECONFIG[x11] = "--enable-glx, --disable-glx, virtual/libx11"
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb b/import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
index 9c0ec54..c802a6f 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
@@ -41,13 +41,10 @@
                 --disable-video-picogui --disable-video-qtopia --enable-sdl-dlopen \
                 --disable-rpath"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)}"
 PACKAGECONFIG_class-native = "x11"
-PACKAGECONFIG_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 
 PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib"
 PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/0001-prepend-our-sysroot-path-so-that-make-finds-our-wayl.patch b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/0001-prepend-our-sysroot-path-so-that-make-finds-our-wayl.patch
new file mode 100644
index 0000000..efc8418
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/0001-prepend-our-sysroot-path-so-that-make-finds-our-wayl.patch
@@ -0,0 +1,34 @@
+From b44808e43130dcd13b43e5b978b9b24aeb4c134c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Thu, 20 Oct 2016 14:57:51 +0200
+Subject: [PATCH] prepend our sysroot path so that make finds our
+ wayland-protocol files
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.in | 4 +-
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 726ded3..3376600 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1206,7 +1206,7 @@ AC_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for
+                 WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
+                 WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
+                 WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
+-                WAYLAND_CORE_PROTOCOL_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-client`
+-                WAYLAND_PROTOCOLS_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
++                WAYLAND_CORE_PROTOCOL_DIR=${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-client`
++                WAYLAND_PROTOCOLS_DIR=${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
+                 video_wayland=yes
+             fi
+         fi
+-- 
+2.5.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/0001-src-video-make-it-compatible-with-wayland-1.10.patch b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/0001-src-video-make-it-compatible-with-wayland-1.10.patch
deleted file mode 100644
index 44e6d4d..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/0001-src-video-make-it-compatible-with-wayland-1.10.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From b1ed3533433501ec52c8289a5b3a294e57e7f798 Mon Sep 17 00:00:00 2001
-From: Martin Jansa <martin.jansa@gmail.com>
-Date: Thu, 26 May 2016 11:31:52 +0000
-Subject: [PATCH] src/video: make it compatible with wayland 1.10
-
-| build/.libs/SDL_waylandevents.o: In function `wl_registry_bind':
-| /usr/include/wayland-client-protocol.h:305: undefined reference to `wl_proxy_marshal_constructor_versioned'
-| /usr/include/wayland-client-protocol.h:305: undefined reference to `wl_proxy_marshal_constructor_versioned'
-| build/.libs/SDL_waylandkeyboard.o: In function `wl_registry_bind':
-| /usr/include/wayland-client-protocol.h:305: undefined reference to `wl_proxy_marshal_constructor_versioned'
-| /usr/include/wayland-client-protocol.h:305: undefined reference to `wl_proxy_marshal_constructor_versioned'
-| build/.libs/SDL_waylandvideo.o: In function `wl_registry_bind':
-| /usr/include/wayland-client-protocol.h:305: undefined reference to `wl_proxy_marshal_constructor_versioned'
-| collect2: error: ld returned 1 exit status
-| make: *** [build/libSDL2.la] Error 1
-| ERROR: oe_runmake failed
-
-Upstream-Status: Pending
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-
----
- src/video/wayland/SDL_waylanddyn.h | 1 +
- src/video/wayland/SDL_waylandsym.h | 4 ++++
- src/video/webos/SDL_waylanddyn.h   | 1 +
- src/video/webos/SDL_waylandsym.h   | 4 ++++
- 4 files changed, 10 insertions(+)
-
-diff --git a/src/video/wayland/SDL_waylanddyn.h b/src/video/wayland/SDL_waylanddyn.h
-index 8d9313a..c7b0157 100644
---- a/src/video/wayland/SDL_waylanddyn.h
-+++ b/src/video/wayland/SDL_waylanddyn.h
-@@ -79,6 +79,7 @@ void SDL_WAYLAND_UnloadSymbols(void);
- #define wl_proxy_get_user_data (*WAYLAND_wl_proxy_get_user_data)
- #define wl_proxy_add_listener (*WAYLAND_wl_proxy_add_listener)
- #define wl_proxy_marshal_constructor (*WAYLAND_wl_proxy_marshal_constructor)
-+#define wl_proxy_marshal_constructor_versioned (*WAYLAND_wl_proxy_marshal_constructor_versioned)
- 
- #define wl_seat_interface (*WAYLAND_wl_seat_interface)
- #define wl_surface_interface (*WAYLAND_wl_surface_interface)
-diff --git a/src/video/wayland/SDL_waylandsym.h b/src/video/wayland/SDL_waylandsym.h
-index c3b4fa5..b9a0d97 100644
---- a/src/video/wayland/SDL_waylandsym.h
-+++ b/src/video/wayland/SDL_waylandsym.h
-@@ -55,6 +55,10 @@ SDL_WAYLAND_SYM(void, wl_list_insert_list, (struct wl_list *, struct wl_list *))
- SDL_WAYLAND_MODULE(WAYLAND_CLIENT_1_4)
- SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor, (struct wl_proxy *, uint32_t opcode, const struct wl_interface *interface, ...))
- 
-+/* These functions are available in Wayland >= 1.10 */
-+SDL_WAYLAND_MODULE(WAYLAND_CLIENT_1_10)
-+SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor_versioned, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, ...))
-+
- SDL_WAYLAND_INTERFACE(wl_seat_interface)
- SDL_WAYLAND_INTERFACE(wl_surface_interface)
- SDL_WAYLAND_INTERFACE(wl_shm_pool_interface)
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/0002-Avoid-finding-build-host-s-wayland-scanner.patch b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/0002-Avoid-finding-build-host-s-wayland-scanner.patch
new file mode 100644
index 0000000..7837315
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/0002-Avoid-finding-build-host-s-wayland-scanner.patch
@@ -0,0 +1,31 @@
+From ae879091cf65cb70293b375ec7e61ed12a96d8a7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 2 Dec 2016 09:39:25 +0100
+Subject: [PATCH] Avoid finding build host's wayland-scanner
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 3376600..2aa6ed4 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1204,7 +1204,7 @@ AC_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for
+             if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon ; then
+                 WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
+                 WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
+-                WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
++                AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
+                 WAYLAND_CORE_PROTOCOL_DIR=${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-client`
+                 WAYLAND_PROTOCOLS_DIR=${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
+                 video_wayland=yes
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/fix-build-failure-on-ppc.patch b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/fix-build-failure-on-ppc.patch
new file mode 100644
index 0000000..1520bcf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/fix-build-failure-on-ppc.patch
@@ -0,0 +1,50 @@
+Upstream-Status: Backport [https://hg.libsdl.org/SDL/rev/5184186d4366]
+
+Backport patch from upstream to fix build failures on ppc and ppc64.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+# HG changeset patch
+# User Sam Lantinga <slouken@libsdl.org>
+# Date 1477159315 25200
+# Node ID 5184186d4366169617b434f5b71c618a7035cde4
+# Parent  71d4148e32de5088c4bc2f04c1e5ded647a2bf82
+Fixed bug 3466 - Can't build 2.0.5 on ppc64
+
+/home/fedora/SDL2-2.0.5/src/video/SDL_blit_N.c: In function 'calc_swizzle32':
+/home/fedora/SDL2-2.0.5/src/video/SDL_blit_N.c:127:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
+     const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00,
+     ^
+
+diff -r 71d4148e32de -r 5184186d4366 src/video/SDL_blit_N.c
+--- a/src/video/SDL_blit_N.c	Wed Oct 19 21:22:42 2016 -0700
++++ b/src/video/SDL_blit_N.c	Sat Oct 22 11:01:55 2016 -0700
+@@ -118,12 +118,6 @@
+         16, 8, 0, 24,
+         0, NULL
+     };
+-    if (!srcfmt) {
+-        srcfmt = &default_pixel_format;
+-    }
+-    if (!dstfmt) {
+-        dstfmt = &default_pixel_format;
+-    }
+     const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00,
+                                                        0x04, 0x04, 0x04, 0x04,
+                                                        0x08, 0x08, 0x08, 0x08,
+@@ -136,6 +130,14 @@
+     Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
+     Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
+     Uint32 amask;
++
++    if (!srcfmt) {
++        srcfmt = &default_pixel_format;
++    }
++    if (!dstfmt) {
++        dstfmt = &default_pixel_format;
++    }
++
+     /* Use zero for alpha if either surface doesn't have alpha */
+     if (dstfmt->Amask) {
+         amask =
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.4.bb
deleted file mode 100644
index 844ff33..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.4.bb
+++ /dev/null
@@ -1,68 +0,0 @@
-SUMMARY = "Simple DirectMedia Layer"
-DESCRIPTION = "Simple DirectMedia Layer is a cross-platform multimedia \
-library designed to provide low level access to audio, keyboard, mouse, \
-joystick, 3D hardware via OpenGL, and 2D video framebuffer."
-HOMEPAGE = "http://www.libsdl.org"
-BUGTRACKER = "http://bugzilla.libsdl.org/"
-
-SECTION = "libs"
-
-LICENSE = "Zlib"
-LIC_FILES_CHKSUM = "file://COPYING.txt;md5=b2304ad7e91711027590d3f102a754b7"
-
-PROVIDES = "virtual/libsdl2"
-
-DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
-
-SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
-           file://linkage.patch \
-           file://0001-src-video-make-it-compatible-with-wayland-1.10.patch \
-"
-
-S = "${WORKDIR}/SDL2-${PV}"
-
-SRC_URI[md5sum] = "44fc4a023349933e7f5d7a582f7b886e"
-SRC_URI[sha256sum] = "da55e540bf6331824153805d58b590a29c39d2d506c6d02fa409aedeab21174b"
-
-inherit autotools lib_package binconfig pkgconfig
-
-EXTRA_OECONF = "--disable-oss --disable-esd --disable-arts \
-                --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
-                --disable-video-dummy \
-                --enable-pthreads \
-                --enable-sdl-dlopen \
-                --disable-rpath"
-
-# opengl packageconfig factored out to make it easy for distros
-# and BSP layers to pick either (desktop) opengl, gles2, or no GL
-PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl', '', d)}"
-
-PACKAGECONFIG ??= " \
-    ${PACKAGECONFIG_GL} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland gles2', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
-"
-PACKAGECONFIG[alsa]       = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib,"
-PACKAGECONFIG[directfb]   = "--enable-video-directfb,--disable-video-directfb,directfb"
-PACKAGECONFIG[gles2]      = "--enable-video-opengles,--disable-video-opengles,virtual/libgles2"
-PACKAGECONFIG[opengl]     = "--enable-video-opengl,--disable-video-opengl,virtual/libgl"
-PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
-PACKAGECONFIG[tslib]      = "--enable-input-tslib,--disable-input-tslib,tslib"
-PACKAGECONFIG[wayland]    = "--enable-video-wayland,--disable-video-wayland,wayland libxkbcommon"
-PACKAGECONFIG[x11]        = "--enable-video-x11,--disable-video-x11,virtual/libx11 libxext libxrandr libxrender"
-
-EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
-
-do_configure_prepend() {
-        # Remove old libtool macros.
-        MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
-        for i in ${MACROS}; do
-               rm -f ${S}/acinclude/$i
-        done
-        export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
-}
-
-FILES_${PN}-dev += "${libdir}/cmake"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb
new file mode 100644
index 0000000..12d3aaf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb
@@ -0,0 +1,69 @@
+SUMMARY = "Simple DirectMedia Layer"
+DESCRIPTION = "Simple DirectMedia Layer is a cross-platform multimedia \
+library designed to provide low level access to audio, keyboard, mouse, \
+joystick, 3D hardware via OpenGL, and 2D video framebuffer."
+HOMEPAGE = "http://www.libsdl.org"
+BUGTRACKER = "http://bugzilla.libsdl.org/"
+
+SECTION = "libs"
+
+LICENSE = "Zlib"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=b2304ad7e91711027590d3f102a754b7"
+
+PROVIDES = "virtual/libsdl2"
+
+DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
+
+SRC_URI = " \
+    http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
+    file://linkage.patch \
+    file://0001-prepend-our-sysroot-path-so-that-make-finds-our-wayl.patch \
+    file://0002-Avoid-finding-build-host-s-wayland-scanner.patch \
+    file://fix-build-failure-on-ppc.patch \
+"
+
+S = "${WORKDIR}/SDL2-${PV}"
+
+SRC_URI[md5sum] = "d4055424d556b4a908aa76fad63abd3c"
+SRC_URI[sha256sum] = "442038cf55965969f2ff06d976031813de643af9c9edc9e331bd761c242e8785"
+
+inherit autotools lib_package binconfig pkgconfig
+
+EXTRA_OECONF = "--disable-oss --disable-esd --disable-arts \
+                --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+                --disable-video-dummy \
+                --enable-pthreads \
+                --enable-sdl-dlopen \
+                --disable-rpath \
+                WAYLAND_PROTOCOLS_SYSROOT_DIR=${RECIPE_SYSROOT}"
+
+# opengl packageconfig factored out to make it easy for distros
+# and BSP layers to pick either (desktop) opengl, gles2, or no GL
+PACKAGECONFIG_GL ?= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
+
+PACKAGECONFIG ??= " \
+    ${PACKAGECONFIG_GL} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland gles2', '', d)} \
+"
+PACKAGECONFIG[alsa]       = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib,"
+PACKAGECONFIG[directfb]   = "--enable-video-directfb,--disable-video-directfb,directfb"
+PACKAGECONFIG[gles2]      = "--enable-video-opengles,--disable-video-opengles,virtual/libgles2"
+PACKAGECONFIG[opengl]     = "--enable-video-opengl,--disable-video-opengl,virtual/libgl"
+PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
+PACKAGECONFIG[tslib]      = "--enable-input-tslib,--disable-input-tslib,tslib"
+PACKAGECONFIG[wayland]    = "--enable-video-wayland,--disable-video-wayland,wayland-native wayland wayland-protocols libxkbcommon"
+PACKAGECONFIG[x11]        = "--enable-video-x11,--disable-video-x11,virtual/libx11 libxext libxrandr libxrender"
+
+EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
+
+do_configure_prepend() {
+        # Remove old libtool macros.
+        MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
+        for i in ${MACROS}; do
+               rm -f ${S}/acinclude/$i
+        done
+        export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
+}
+
+FILES_${PN}-dev += "${libdir}/cmake"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libva/files/0001-configure.ac-Use-wayland-scanner-in-PATH.patch b/import-layers/yocto-poky/meta/recipes-graphics/libva/files/0001-configure.ac-Use-wayland-scanner-in-PATH.patch
new file mode 100644
index 0000000..a99c225
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libva/files/0001-configure.ac-Use-wayland-scanner-in-PATH.patch
@@ -0,0 +1,37 @@
+From 0af30602502035155929dd2a14482b82a9747cf8 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 23 Feb 2017 15:23:15 +0200
+Subject: [PATCH] configure.ac: Use wayland-scanner in PATH
+
+pkg-config will give us the wrong wayland-scanner location.
+Use the one in path instead: it will be from native sysroot.
+
+This is a workaround and should be fixed upstream: preferably
+with the same fix as all the other wayland-scanner users
+(see YOCTO #11100).
+
+Upstream-Status: Inappropriate [workaround]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 64eddf2..5536f35 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -273,10 +273,7 @@ if test "$enable_wayland" = "yes"; then
+     PKG_CHECK_MODULES([WAYLAND], [wayland-client >= wayland_api_version],
+         [USE_WAYLAND="yes"], [:])
+     if test "$USE_WAYLAND" = "yes"; then
+-
+-        WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
+-        AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
+-                     [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
++        AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
+ 
+         AC_DEFINE([HAVE_VA_WAYLAND], [1],
+                   [Defined to 1 if VA/Wayland API is built])
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libva/files/0001-wayland-Don-t-commit-and-ship-generated-files.patch b/import-layers/yocto-poky/meta/recipes-graphics/libva/files/0001-wayland-Don-t-commit-and-ship-generated-files.patch
new file mode 100644
index 0000000..bd97e22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libva/files/0001-wayland-Don-t-commit-and-ship-generated-files.patch
@@ -0,0 +1,339 @@
+From 5993a7710cc8fd9a392d5015be5109987a42b498 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 23 Feb 2017 16:10:09 +0200
+Subject: [PATCH] wayland: Don't commit and ship generated files
+
+I believe shipping wayland-drm-client-protocol.h is wrong: The header
+should always be generated by the wayland-scanner that matches the
+runtime wayland version. Currently when someone clones the repo and
+builds, the shipped version is used.
+
+Upstream-Status: Submitted [https://github.com/01org/libva/pull/33]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ va/wayland/Makefile.am                   |   5 +-
+ va/wayland/wayland-drm-client-protocol.h | 290 -------------------------------
+ 2 files changed, 4 insertions(+), 291 deletions(-)
+ delete mode 100644 va/wayland/wayland-drm-client-protocol.h
+
+diff --git a/va/wayland/Makefile.am b/va/wayland/Makefile.am
+index 4f8262c..4ab8d07 100644
+--- a/va/wayland/Makefile.am
++++ b/va/wayland/Makefile.am
+@@ -53,7 +53,7 @@ protocol_source_h = \
+ noinst_LTLIBRARIES		= libva_wayland.la
+ libva_waylandincludedir		= ${includedir}/va
+ libva_waylandinclude_HEADERS	= $(source_h)
+-libva_wayland_la_SOURCES	= $(source_c) $(protocol_source_h)
++libva_wayland_la_SOURCES	= $(source_c)
+ noinst_HEADERS			= $(source_h_priv)
+ 
+ # Wayland protocol
+@@ -65,5 +65,8 @@ EXTRA_DIST = \
+ 	wayland-drm.xml         \
+ 	$(NULL)
+ 
++BUILT_SOURCES = $(protocol_source_h)
++CLEANFILES = $(BUILT_SOURCES)
++
+ # Extra clean files so that maintainer-clean removes *everything*
+ MAINTAINERCLEANFILES = Makefile.in
+diff --git a/va/wayland/wayland-drm-client-protocol.h b/va/wayland/wayland-drm-client-protocol.h
+deleted file mode 100644
+index da267e8..0000000
+--- a/va/wayland/wayland-drm-client-protocol.h
++++ /dev/null
+@@ -1,290 +0,0 @@
+-/* Generated by wayland-scanner 1.11.90 */
+-
+-#ifndef DRM_CLIENT_PROTOCOL_H
+-#define DRM_CLIENT_PROTOCOL_H
+-
+-#include <stdint.h>
+-#include <stddef.h>
+-#include "wayland-client.h"
+-
+-#ifdef  __cplusplus
+-extern "C" {
+-#endif
+-
+-/**
+- * @page page_drm The drm protocol
+- * @section page_ifaces_drm Interfaces
+- * - @subpage page_iface_wl_drm - 
+- * @section page_copyright_drm Copyright
+- * <pre>
+- *
+- * Copyright © 2008-2011 Kristian Høgsberg
+- * Copyright © 2010-2011 Intel Corporation
+- *
+- * Permission to use, copy, modify, distribute, and sell this
+- * software and its documentation for any purpose is hereby granted
+- * without fee, provided that\n the above copyright notice appear in
+- * all copies and that both that copyright notice and this permission
+- * notice appear in supporting documentation, and that the name of
+- * the copyright holders not be used in advertising or publicity
+- * pertaining to distribution of the software without specific,
+- * written prior permission.  The copyright holders make no
+- * representations about the suitability of this software for any
+- * purpose.  It is provided "as is" without express or implied
+- * warranty.
+- *
+- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+- * THIS SOFTWARE.
+- * </pre>
+- */
+-struct wl_buffer;
+-struct wl_drm;
+-
+-/**
+- * @page page_iface_wl_drm wl_drm
+- * @section page_iface_wl_drm_api API
+- * See @ref iface_wl_drm.
+- */
+-/**
+- * @defgroup iface_wl_drm The wl_drm interface
+- */
+-extern const struct wl_interface wl_drm_interface;
+-
+-#ifndef WL_DRM_ERROR_ENUM
+-#define WL_DRM_ERROR_ENUM
+-enum wl_drm_error {
+-	WL_DRM_ERROR_AUTHENTICATE_FAIL = 0,
+-	WL_DRM_ERROR_INVALID_FORMAT = 1,
+-	WL_DRM_ERROR_INVALID_NAME = 2,
+-};
+-#endif /* WL_DRM_ERROR_ENUM */
+-
+-#ifndef WL_DRM_FORMAT_ENUM
+-#define WL_DRM_FORMAT_ENUM
+-enum wl_drm_format {
+-	WL_DRM_FORMAT_C8 = 0x20203843,
+-	WL_DRM_FORMAT_RGB332 = 0x38424752,
+-	WL_DRM_FORMAT_BGR233 = 0x38524742,
+-	WL_DRM_FORMAT_XRGB4444 = 0x32315258,
+-	WL_DRM_FORMAT_XBGR4444 = 0x32314258,
+-	WL_DRM_FORMAT_RGBX4444 = 0x32315852,
+-	WL_DRM_FORMAT_BGRX4444 = 0x32315842,
+-	WL_DRM_FORMAT_ARGB4444 = 0x32315241,
+-	WL_DRM_FORMAT_ABGR4444 = 0x32314241,
+-	WL_DRM_FORMAT_RGBA4444 = 0x32314152,
+-	WL_DRM_FORMAT_BGRA4444 = 0x32314142,
+-	WL_DRM_FORMAT_XRGB1555 = 0x35315258,
+-	WL_DRM_FORMAT_XBGR1555 = 0x35314258,
+-	WL_DRM_FORMAT_RGBX5551 = 0x35315852,
+-	WL_DRM_FORMAT_BGRX5551 = 0x35315842,
+-	WL_DRM_FORMAT_ARGB1555 = 0x35315241,
+-	WL_DRM_FORMAT_ABGR1555 = 0x35314241,
+-	WL_DRM_FORMAT_RGBA5551 = 0x35314152,
+-	WL_DRM_FORMAT_BGRA5551 = 0x35314142,
+-	WL_DRM_FORMAT_RGB565 = 0x36314752,
+-	WL_DRM_FORMAT_BGR565 = 0x36314742,
+-	WL_DRM_FORMAT_RGB888 = 0x34324752,
+-	WL_DRM_FORMAT_BGR888 = 0x34324742,
+-	WL_DRM_FORMAT_XRGB8888 = 0x34325258,
+-	WL_DRM_FORMAT_XBGR8888 = 0x34324258,
+-	WL_DRM_FORMAT_RGBX8888 = 0x34325852,
+-	WL_DRM_FORMAT_BGRX8888 = 0x34325842,
+-	WL_DRM_FORMAT_ARGB8888 = 0x34325241,
+-	WL_DRM_FORMAT_ABGR8888 = 0x34324241,
+-	WL_DRM_FORMAT_RGBA8888 = 0x34324152,
+-	WL_DRM_FORMAT_BGRA8888 = 0x34324142,
+-	WL_DRM_FORMAT_XRGB2101010 = 0x30335258,
+-	WL_DRM_FORMAT_XBGR2101010 = 0x30334258,
+-	WL_DRM_FORMAT_RGBX1010102 = 0x30335852,
+-	WL_DRM_FORMAT_BGRX1010102 = 0x30335842,
+-	WL_DRM_FORMAT_ARGB2101010 = 0x30335241,
+-	WL_DRM_FORMAT_ABGR2101010 = 0x30334241,
+-	WL_DRM_FORMAT_RGBA1010102 = 0x30334152,
+-	WL_DRM_FORMAT_BGRA1010102 = 0x30334142,
+-	WL_DRM_FORMAT_YUYV = 0x56595559,
+-	WL_DRM_FORMAT_YVYU = 0x55595659,
+-	WL_DRM_FORMAT_UYVY = 0x59565955,
+-	WL_DRM_FORMAT_VYUY = 0x59555956,
+-	WL_DRM_FORMAT_AYUV = 0x56555941,
+-	WL_DRM_FORMAT_NV12 = 0x3231564e,
+-	WL_DRM_FORMAT_NV21 = 0x3132564e,
+-	WL_DRM_FORMAT_NV16 = 0x3631564e,
+-	WL_DRM_FORMAT_NV61 = 0x3136564e,
+-	WL_DRM_FORMAT_YUV410 = 0x39565559,
+-	WL_DRM_FORMAT_YVU410 = 0x39555659,
+-	WL_DRM_FORMAT_YUV411 = 0x31315559,
+-	WL_DRM_FORMAT_YVU411 = 0x31315659,
+-	WL_DRM_FORMAT_YUV420 = 0x32315559,
+-	WL_DRM_FORMAT_YVU420 = 0x32315659,
+-	WL_DRM_FORMAT_YUV422 = 0x36315559,
+-	WL_DRM_FORMAT_YVU422 = 0x36315659,
+-	WL_DRM_FORMAT_YUV444 = 0x34325559,
+-	WL_DRM_FORMAT_YVU444 = 0x34325659,
+-};
+-#endif /* WL_DRM_FORMAT_ENUM */
+-
+-#ifndef WL_DRM_CAPABILITY_ENUM
+-#define WL_DRM_CAPABILITY_ENUM
+-/**
+- * @ingroup iface_wl_drm
+- * wl_drm capability bitmask
+- *
+- * Bitmask of capabilities.
+- */
+-enum wl_drm_capability {
+-	/**
+-	 * wl_drm prime available
+-	 */
+-	WL_DRM_CAPABILITY_PRIME = 1,
+-};
+-#endif /* WL_DRM_CAPABILITY_ENUM */
+-
+-/**
+- * @ingroup iface_wl_drm
+- * @struct wl_drm_listener
+- */
+-struct wl_drm_listener {
+-	/**
+-	 */
+-	void (*device)(void *data,
+-		       struct wl_drm *wl_drm,
+-		       const char *name);
+-	/**
+-	 */
+-	void (*format)(void *data,
+-		       struct wl_drm *wl_drm,
+-		       uint32_t format);
+-	/**
+-	 */
+-	void (*authenticated)(void *data,
+-			      struct wl_drm *wl_drm);
+-	/**
+-	 */
+-	void (*capabilities)(void *data,
+-			     struct wl_drm *wl_drm,
+-			     uint32_t value);
+-};
+-
+-/**
+- * @ingroup wl_drm_iface
+- */
+-static inline int
+-wl_drm_add_listener(struct wl_drm *wl_drm,
+-		    const struct wl_drm_listener *listener, void *data)
+-{
+-	return wl_proxy_add_listener((struct wl_proxy *) wl_drm,
+-				     (void (**)(void)) listener, data);
+-}
+-
+-#define WL_DRM_AUTHENTICATE 0
+-#define WL_DRM_CREATE_BUFFER 1
+-#define WL_DRM_CREATE_PLANAR_BUFFER 2
+-#define WL_DRM_CREATE_PRIME_BUFFER 3
+-
+-/**
+- * @ingroup iface_wl_drm
+- */
+-#define WL_DRM_AUTHENTICATE_SINCE_VERSION 1
+-/**
+- * @ingroup iface_wl_drm
+- */
+-#define WL_DRM_CREATE_BUFFER_SINCE_VERSION 1
+-/**
+- * @ingroup iface_wl_drm
+- */
+-#define WL_DRM_CREATE_PLANAR_BUFFER_SINCE_VERSION 1
+-/**
+- * @ingroup iface_wl_drm
+- */
+-#define WL_DRM_CREATE_PRIME_BUFFER_SINCE_VERSION 2
+-
+-/** @ingroup iface_wl_drm */
+-static inline void
+-wl_drm_set_user_data(struct wl_drm *wl_drm, void *user_data)
+-{
+-	wl_proxy_set_user_data((struct wl_proxy *) wl_drm, user_data);
+-}
+-
+-/** @ingroup iface_wl_drm */
+-static inline void *
+-wl_drm_get_user_data(struct wl_drm *wl_drm)
+-{
+-	return wl_proxy_get_user_data((struct wl_proxy *) wl_drm);
+-}
+-
+-static inline uint32_t
+-wl_drm_get_version(struct wl_drm *wl_drm)
+-{
+-	return wl_proxy_get_version((struct wl_proxy *) wl_drm);
+-}
+-
+-/** @ingroup iface_wl_drm */
+-static inline void
+-wl_drm_destroy(struct wl_drm *wl_drm)
+-{
+-	wl_proxy_destroy((struct wl_proxy *) wl_drm);
+-}
+-
+-/**
+- * @ingroup iface_wl_drm
+- */
+-static inline void
+-wl_drm_authenticate(struct wl_drm *wl_drm, uint32_t id)
+-{
+-	wl_proxy_marshal((struct wl_proxy *) wl_drm,
+-			 WL_DRM_AUTHENTICATE, id);
+-}
+-
+-/**
+- * @ingroup iface_wl_drm
+- */
+-static inline struct wl_buffer *
+-wl_drm_create_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, int32_t height, uint32_t stride, uint32_t format)
+-{
+-	struct wl_proxy *id;
+-
+-	id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_drm,
+-			 WL_DRM_CREATE_BUFFER, &wl_buffer_interface, NULL, name, width, height, stride, format);
+-
+-	return (struct wl_buffer *) id;
+-}
+-
+-/**
+- * @ingroup iface_wl_drm
+- */
+-static inline struct wl_buffer *
+-wl_drm_create_planar_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, int32_t height, uint32_t format, int32_t offset0, int32_t stride0, int32_t offset1, int32_t stride1, int32_t offset2, int32_t stride2)
+-{
+-	struct wl_proxy *id;
+-
+-	id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_drm,
+-			 WL_DRM_CREATE_PLANAR_BUFFER, &wl_buffer_interface, NULL, name, width, height, format, offset0, stride0, offset1, stride1, offset2, stride2);
+-
+-	return (struct wl_buffer *) id;
+-}
+-
+-/**
+- * @ingroup iface_wl_drm
+- */
+-static inline struct wl_buffer *
+-wl_drm_create_prime_buffer(struct wl_drm *wl_drm, int32_t name, int32_t width, int32_t height, uint32_t format, int32_t offset0, int32_t stride0, int32_t offset1, int32_t stride1, int32_t offset2, int32_t stride2)
+-{
+-	struct wl_proxy *id;
+-
+-	id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_drm,
+-			 WL_DRM_CREATE_PRIME_BUFFER, &wl_buffer_interface, NULL, name, width, height, format, offset0, stride0, offset1, stride1, offset2, stride2);
+-
+-	return (struct wl_buffer *) id;
+-}
+-
+-#ifdef  __cplusplus
+-}
+-#endif
+-
+-#endif
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libva/libva_1.7.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/libva/libva_1.7.3.bb
new file mode 100644
index 0000000..6c0b90f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libva/libva_1.7.3.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Video Acceleration (VA) API for Linux"
+DESCRIPTION = "Video Acceleration API (VA API) is a library (libVA) \
+and API specification which enables and provides access to graphics \
+hardware (GPU) acceleration for video processing on Linux and UNIX \
+based operating systems. Accelerated processing includes video \
+decoding, video encoding, subpicture blending and rendering. The \
+specification was originally designed by Intel for its GMA (Graphics \
+Media Accelerator) series of GPU hardware, the API is however not \
+limited to GPUs or Intel specific hardware, as other hardware and \
+manufacturers can also freely use this API for hardware accelerated \
+video decoding."
+
+HOMEPAGE = "https://01.org/linuxmedia/vaapi"
+BUGTRACKER = "https://github.com/01org/libva/issues"
+
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2e48940f94acb0af582e5ef03537800f"
+
+SRC_URI = "git://github.com/01org/libva.git;protocol=http;branch=v1.7-branch \
+           file://0001-configure.ac-Use-wayland-scanner-in-PATH.patch \
+           file://0001-wayland-Don-t-commit-and-ship-generated-files.patch"
+SRCREV = "dbf9f7e33349c3cee8d131e93a6a4f91255635cb"
+UPSTREAM_CHECK_GITTAGREGEX = "libva-(?P<pver>(\d+(\.\d+)+))"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "libdrm virtual/mesa virtual/libgles1 virtual/libgles2 virtual/egl"
+
+inherit autotools pkgconfig distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+EXTRA_OECONF = "--disable-dummy-driver"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxext libxfixes"
+PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland-native wayland"
+
+PACKAGES =+ "${PN}-x11 ${PN}-tpi ${PN}-glx ${PN}-egl ${PN}-wayland"
+
+RDEPENDS_${PN}-tpi =+ "${PN}"
+RDEPENDS_${PN}-x11 =+ "${PN}"
+RDEPENDS_${PN}-glx =+ "${PN}-x11"
+RDEPENDS_${PN}-egl =+ "${PN}-x11"
+
+FILES_${PN}-dbg += "${libdir}/dri/.debug"
+
+FILES_${PN}-x11 =+ "${libdir}/libva-x11*${SOLIBS}"
+FILES_${PN}-tpi =+ "${libdir}/libva-tpi*${SOLIBS}"
+FILES_${PN}-glx =+ "${libdir}/libva-glx*${SOLIBS}"
+FILES_${PN}-egl =+ "${libdir}/libva-egl*${SOLIBS}"
+FILES_${PN}-wayland =+ "${libdir}/libva-wayland*${SOLIBS}"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_1.2.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_1.2.1.bb
deleted file mode 100644
index c3d2d23..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_1.2.1.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-SUMMARY = "Matchbox lightweight window manager"
-HOMEPAGE = "http://matchbox-project.org"
-BUGTRACKER = "http://bugzilla.yoctoproject.org/"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://src/wm.h;endline=21;md5=a7e844465edbcf79c282369f93caa835 \
-                    file://src/main.c;endline=21;md5=3e5d9f832b527b0d72dbe8e3c4c60b95 \
-                    file://src/wm.c;endline=21;md5=8dc9d24477d87ef5dfbc2e4927146aab"
-
-SECTION = "x11/wm"
-DEPENDS = "libmatchbox virtual/libx11 libxext libxrender startup-notification expat gconf libxcursor libxfixes"
-
-# SRCREV tagged 1.2.1
-SRCREV = "9fd1806dfa7c8f2202db18b7bc880857a3019f8c"
-SRC_URI = "git://git.yoctoproject.org/matchbox-window-manager \
-           file://kbdconfig"
-
-S = "${WORKDIR}/git"
-
-inherit autotools pkgconfig distro_features_check
-# depends on virtual/libx11
-REQUIRED_DISTRO_FEATURES = "x11"
-
-FILES_${PN} = "${bindir}/* \
-               ${datadir}/matchbox \
-               ${sysconfdir}/matchbox \
-               ${datadir}/themes/blondie/matchbox \
-               ${datadir}/themes/Default/matchbox \
-               ${datadir}/themes/MBOpus/matchbox"
-
-EXTRA_OECONF = " --enable-startup-notification \
-                 --disable-xrm \
-                 --enable-expat \
-                 --with-expat-lib=${STAGING_LIBDIR} \
-                 --with-expat-includes=${STAGING_INCDIR}"
-
-do_install_prepend() {
-	install ${WORKDIR}/kbdconfig ${S}/data/kbdconfig
-}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_1.2.2.bb
new file mode 100644
index 0000000..815a75f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_1.2.2.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Matchbox lightweight window manager"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://src/wm.h;endline=21;md5=a7e844465edbcf79c282369f93caa835 \
+                    file://src/main.c;endline=21;md5=3e5d9f832b527b0d72dbe8e3c4c60b95 \
+                    file://src/wm.c;endline=21;md5=8dc9d24477d87ef5dfbc2e4927146aab"
+
+SECTION = "x11/wm"
+DEPENDS = "libmatchbox virtual/libx11 libxext libxrender startup-notification expat gconf libxcursor libxfixes"
+
+# SRCREV tagged 1.2.2
+SRCREV = "27da947e7fbdf9659f7e5bd1e92af92af6c03970"
+SRC_URI = "git://git.yoctoproject.org/matchbox-window-manager \
+           file://kbdconfig"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+FILES_${PN} = "${bindir}/* \
+               ${datadir}/matchbox \
+               ${sysconfdir}/matchbox \
+               ${datadir}/themes/blondie/matchbox \
+               ${datadir}/themes/Default/matchbox \
+               ${datadir}/themes/MBOpus/matchbox"
+
+EXTRA_OECONF = " --enable-startup-notification \
+                 --disable-xrm \
+                 --enable-expat \
+                 --with-expat-lib=${STAGING_LIBDIR} \
+                 --with-expat-includes=${STAGING_INCDIR}"
+
+do_install_prepend() {
+	install ${WORKDIR}/kbdconfig ${S}/data/kbdconfig
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.1.bb
deleted file mode 100644
index a1a8e26..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.1.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "Library for caching application menus"
-DESCRIPTION = "A library creating and utilizing caches to speed up freedesktop.org application menus"
-HOMEPAGE = "http://lxde.sourceforge.net/"
-
-LICENSE = "LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=0964c689fcf4c21c6797ea87408416b6"
-
-SECTION = "x11/libs"
-DEPENDS = "glib-2.0 libfm-extra"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/lxde/menu-cache-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "a856ba860b16fdc8c69ee784bc4ade36"
-SRC_URI[sha256sum] = "0ac72649919946070258320aafc320467dd040bcef7b3a225e2ab7241ddffd59"
-
-UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lxde/files/menu-cache/1.0/"
-
-inherit autotools gettext pkgconfig gtk-doc
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.2.bb
new file mode 100644
index 0000000..71540cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.2.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Library for caching application menus"
+DESCRIPTION = "A library creating and utilizing caches to speed up freedesktop.org application menus"
+HOMEPAGE = "http://lxde.sourceforge.net/"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0964c689fcf4c21c6797ea87408416b6"
+
+SECTION = "x11/libs"
+DEPENDS = "glib-2.0 libfm-extra"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lxde/menu-cache-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "8dde7a3f5bd9798d0129d1979a5d7640"
+SRC_URI[sha256sum] = "6f83edf2de34f83e701dcb52145d755250a5677580cd413476cc4d7f2d2012d5"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lxde/files/menu-cache/1.0/"
+
+inherit autotools gettext pkgconfig gtk-doc
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch
new file mode 100644
index 0000000..e49695b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch
@@ -0,0 +1,37 @@
+From 2f68fcaaf4964e7feeb383f5c26851965cda037c Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 15 Nov 2016 15:20:49 +0200
+Subject: [PATCH] Simplify wayland-scanner lookup
+
+Don't use pkg-config to lookup the path of a binary that's in the path.
+
+Alternatively we'd have to prefix the path returned by pkg-config with
+PKG_CONFIG_SYSROOT_DIR.
+
+Upstream-Status: Pending
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index e56e35a..a92005a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2020,12 +2020,7 @@ if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
+     AC_MSG_ERROR([cannot build egl state tracker without EGL library])
+ fi
+ 
+-PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
+-        WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`,
+-        WAYLAND_SCANNER='')
+-if test "x$WAYLAND_SCANNER" = x; then
+-    AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
+-fi
++AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
+ 
+ # Do per-EGL platform setups and checks
+ egl_platforms=`IFS=', '; echo $with_egl_platforms`
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/clang-compile-PR89599.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/clang-compile-PR89599.patch
deleted file mode 100644
index 48bd325..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/clang-compile-PR89599.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From 5ec140c17b54c25920091501b665b9aa809cc5e8 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Mon, 11 Jul 2016 10:44:25 -0700
-Subject: mapi: Massage code to allow clang to compile.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-According to https://llvm.org/bugs/show_bug.cgi?id=19778#c3 this code
-was violating the spec, resulting in it failing to compile.
-
-Cc: mesa-stable@lists.freedesktop.org
-Co-authored-by: Tomasz Paweł Gajc <tpgxyz@gmail.com>
-Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89599
-Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
-
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-diff --git a/configure.ac b/configure.ac
-index 3799d8d..1ca8359 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -226,6 +226,7 @@ AX_GCC_FUNC_ATTRIBUTE([packed])
- AX_GCC_FUNC_ATTRIBUTE([pure])
- AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
- AX_GCC_FUNC_ATTRIBUTE([unused])
-+AX_GCC_FUNC_ATTRIBUTE([visibility])
- AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
- AX_GCC_FUNC_ATTRIBUTE([weak])
- 
-diff --git a/src/mapi/entry_x86-64_tls.h b/src/mapi/entry_x86-64_tls.h
-index 38faccc..c5262a1 100644
---- a/src/mapi/entry_x86-64_tls.h
-+++ b/src/mapi/entry_x86-64_tls.h
-@@ -25,6 +25,11 @@
-  *    Chia-I Wu <olv@lunarg.com>
-  */
- 
-+#ifdef HAVE_FUNC_ATTRIBUTE_VISIBIITY
-+#define HIDDEN __attribute__((visibility("hidden")))
-+#else
-+#define HIDDEN
-+#endif
- 
- __asm__(".text\n"
-         ".balign 32\n"
-@@ -54,8 +59,8 @@ entry_patch_public(void)
- {
- }
- 
--static char
--x86_64_entry_start[];
-+extern char
-+x86_64_entry_start[] HIDDEN;
- 
- mapi_func
- entry_get_public(int slot)
-diff --git a/src/mapi/entry_x86_tls.h b/src/mapi/entry_x86_tls.h
-index 46d2ece..231b409 100644
---- a/src/mapi/entry_x86_tls.h
-+++ b/src/mapi/entry_x86_tls.h
-@@ -27,6 +27,12 @@
- 
- #include <string.h>
- 
-+#ifdef HAVE_FUNC_ATTRIBUTE_VISIBIITY
-+#define HIDDEN __attribute__((visibility("hidden")))
-+#else
-+#define HIDDEN
-+#endif
-+
- __asm__(".text");
- 
- __asm__("x86_current_tls:\n\t"
-@@ -71,8 +77,8 @@ __asm__(".text");
- extern unsigned long
- x86_current_tls();
- 
--static char x86_entry_start[];
--static char x86_entry_end[];
-+extern char x86_entry_start[] HIDDEN;
-+extern char x86_entry_end[] HIDDEN;
- 
- void
- entry_patch_public(void)
-diff --git a/src/mapi/entry_x86_tsd.h b/src/mapi/entry_x86_tsd.h
-index ea7bacb..03d9735 100644
---- a/src/mapi/entry_x86_tsd.h
-+++ b/src/mapi/entry_x86_tsd.h
-@@ -25,6 +25,11 @@
-  *    Chia-I Wu <olv@lunarg.com>
-  */
- 
-+#ifdef HAVE_FUNC_ATTRIBUTE_VISIBIITY
-+#define HIDDEN __attribute__((visibility("hidden")))
-+#else
-+#define HIDDEN
-+#endif
- 
- #define X86_ENTRY_SIZE 32
- 
-@@ -58,8 +63,8 @@ __asm__(".balign 32\n"
- #include <string.h>
- #include "u_execmem.h"
- 
--static const char x86_entry_start[];
--static const char x86_entry_end[];
-+extern const char x86_entry_start[] HIDDEN;
-+extern const char x86_entry_end[] HIDDEN;
- 
- void
- entry_patch_public(void)
--- 
-cgit v0.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch
index e4461ef..0280ee8 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch
@@ -2,16 +2,25 @@
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 Upstream-Status: Pending
-Index: mesa-11.1.1/src/gallium/include/pipe/p_config.h
-===================================================================
---- mesa-11.1.1.orig/src/gallium/include/pipe/p_config.h
-+++ mesa-11.1.1/src/gallium/include/pipe/p_config.h
-@@ -130,7 +130,7 @@
-  * Endian detection.
-  */
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ src/util/u_endian.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/util/u_endian.h b/src/util/u_endian.h
+index b9d563d..2d5eab9 100644
+--- a/src/util/u_endian.h
++++ b/src/util/u_endian.h
+@@ -27,7 +27,7 @@
+ #ifndef U_ENDIAN_H
+ #define U_ENDIAN_H
  
--#ifdef __GLIBC__
+-#if defined(__GLIBC__) || defined(ANDROID)
 +#if defined(__linux__)
  #include <endian.h>
  
  #if __BYTE_ORDER == __LITTLE_ENDIAN
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb
index 010998d..8b94613 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb
@@ -24,7 +24,7 @@
 inherit autotools pkgconfig distro_features_check
 
 # Requires libGL.so which is provided by mesa when x11 in DISTRO_FEATURES
-REQUIRED_DISTRO_FEATURES = "x11"
+REQUIRED_DISTRO_FEATURES = "x11 opengl"
 
 # Remove the mesa-glu dependency in mesa-glu-dev, as mesa-glu is empty
 RDEPENDS_${PN}-dev = ""
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos_8.3.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos_8.3.0.bb
index fab0bdb..e43b9ef 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos_8.3.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos_8.3.0.bb
@@ -30,7 +30,7 @@
                   x11 glew glu glx"
 
 # The Wayland code doesn't work with Wayland 1.0, so disable it for now
-#${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
+#${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)}"
 
 EXTRA_OECONF = "--with-system-data-files"
 
@@ -40,7 +40,7 @@
 PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgl"
 PACKAGECONFIG[gles1] = "--enable-gles1,--disable-gles1,virtual/libgles1"
 PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2"
-PACKAGECONFIG[glut] = "--with-glut=${STAGING_EXECPREFIXDIR},--without-glut,"
+PACKAGECONFIG[glut] = "--with-glut=${STAGING_EXECPREFIXDIR},--without-glut,freeglut"
 PACKAGECONFIG[osmesa] = "--enable-osmesa,--disable-osmesa,"
 PACKAGECONFIG[vg] = "--enable-vg,--disable-vg,virtual/libopenvg"
 PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,virtual/libgl wayland"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_12.0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_12.0.1.bb
deleted file mode 100644
index f06a3e9..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_12.0.1.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require mesa_${PV}.bb
-
-SUMMARY += " (OpenGL only, no EGL/GLES)"
-
-FILESEXTRAPATHS =. "${FILE_DIRNAME}/mesa:"
-
-PROVIDES = "virtual/libgl virtual/mesa"
-
-S = "${WORKDIR}/mesa-${PV}"
-
-PACKAGECONFIG ??= "dri ${MESA_CRYPTO} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-
-EXCLUDE_FROM_WORLD = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_17.0.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_17.0.2.bb
new file mode 100644
index 0000000..e3604f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_17.0.2.bb
@@ -0,0 +1,13 @@
+require mesa_${PV}.bb
+
+SUMMARY += " (OpenGL only, no EGL/GLES)"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/mesa:"
+
+PROVIDES = "virtual/libgl virtual/mesa"
+
+S = "${WORKDIR}/mesa-${PV}"
+
+PACKAGECONFIG ??= "dri ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc
index 525a2d5..25cbf63 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc
@@ -14,7 +14,7 @@
 
 PE = "2"
 
-DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native udev"
+DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native"
 
 PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa"
 
@@ -22,13 +22,12 @@
 
 REQUIRED_DISTRO_FEATURES = "opengl"
 
+export LLVM_CONFIG = "${STAGING_BINDIR_CROSS}/llvm-config"
 EXTRA_OECONF = "--enable-shared-glapi"
 
-PACKAGECONFIG ??= "gbm egl gles dri ${MESA_CRYPTO} \
-		${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\
-		${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\
+PACKAGECONFIG ??= "gbm egl gles dri \
+		${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)} \
 		"
-
 PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm"
 
 X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
@@ -42,6 +41,10 @@
 PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm"
 PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence"
 
+# Vulkan drivers need dri3 enabled
+# radeon could be enabled as well but requires gallium-llvm with llvm >= 3.9
+PACKAGECONFIG[vulkan] = "--with-vulkan-drivers=intel, --without-vulkan-drivers"
+
 PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2"
 
 EGL_PLATFORMS  = "drm"
@@ -49,7 +52,12 @@
 EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'wayland', ',wayland', '', d)}"
 PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
 
+PACKAGECONFIG[etnaviv] = ""
+PACKAGECONFIG[imx] = ""
+
 GALLIUMDRIVERS = "swrast"
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'imx', ',imx', '', d)}"
 GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}"
 PACKAGECONFIG[r600] = ""
 GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"
@@ -64,11 +72,8 @@
 export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
 PACKAGECONFIG[xa]  = "--enable-xa, --disable-xa"
 
-# Mesa requires one of the following crypto implementation, pick one of them
-MESA_CRYPTO ??= "openssl"
-PACKAGECONFIG[openssl] = "--with-sha1=libcrypto,,openssl"
-PACKAGECONFIG[nettle] = "--with-sha1=libnettle,,nettle"
-PACKAGECONFIG[gcrypt] = "--with-sha1=libgcrypt,,libgcrypt"
+OSMESA = "${@bb.utils.contains('PACKAGECONFIG', 'gallium', 'gallium-osmesa', 'osmesa', d)}"
+PACKAGECONFIG[osmesa] = "--enable-${OSMESA},--disable-${OSMESA}"
 
 # llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
 FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer"
@@ -91,9 +96,8 @@
              libgles2-mesa libgles2-mesa-dev \
              libgles3-mesa libgles3-mesa-dev \
              libwayland-egl libwayland-egl-dev \
-             libxvmcsoftpipe libxvmcsoftpipe-dev \
              libxatracker libxatracker-dev \
-             mesa-megadriver \
+             mesa-megadriver mesa-vulkan-drivers \
             "
 
 do_install_append () {
@@ -111,7 +115,7 @@
 # they don't get Debian-renamed (which would remove the -mesa suffix), and
 # RPROVIDEs/RCONFLICTs on the generic libgl name.
 python __anonymous() {
-    pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
+    pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
     for p in (("egl", "libegl", "libegl1"),
               ("dri", "libgl", "libgl1"),
               ("gles", "libgles1", "libglesv1-cm1"),
@@ -145,7 +149,7 @@
         d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
 
     import re
-    dri_drivers_root = oe.path.join(d.getVar('PKGD', True), d.getVar('libdir', True), "dri")
+    dri_drivers_root = oe.path.join(d.getVar('PKGD'), d.getVar('libdir'), "dri")
     if os.path.isdir(dri_drivers_root):
         dri_pkgs = os.listdir(dri_drivers_root)
         lib_name = d.expand("${MLPREFIX}mesa-megadriver")
@@ -157,7 +161,7 @@
                 d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name)
                 d.appendVar("RREPLACES_%s" % lib_name, pkg_name)
 
-    pipe_drivers_root = os.path.join(d.getVar('libdir', True), "gallium-pipe")
+    pipe_drivers_root = os.path.join(d.getVar('libdir'), "gallium-pipe")
     do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
 }
 
@@ -167,6 +171,7 @@
 
 FILES_${PN} += "${sysconfdir}/drirc"
 FILES_mesa-megadriver = "${libdir}/dri/*"
+FILES_mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan"
 FILES_libegl-mesa = "${libdir}/libEGL.so.*"
 FILES_libgbm = "${libdir}/libgbm.so.*"
 FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*"
@@ -175,10 +180,9 @@
 FILES_libglapi = "${libdir}/libglapi.so.*"
 FILES_libosmesa = "${libdir}/libOSMesa.so.*"
 FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*"
-FILES_libxvmcsoftpipe = "${libdir}/libXvMCsoftpipe.so.*"
 FILES_libxatracker = "${libdir}/libxatracker.so.*"
 
-FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
+FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan"
 FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
 FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
 FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
@@ -186,9 +190,8 @@
 FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
 FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
 FILES_libgles3-mesa-dev = "${includedir}/GLES3"
-FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
+FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
 FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
-FILES_libxvmcsoftpipe-dev = "${libdir}/libXvMCsoftpipe.so ${libdir}/libXvMCsoftpipe.la"
 FILES_libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
                           ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
                           ${libdir}/pkgconfig/xatracker.pc"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_12.0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_12.0.1.bb
deleted file mode 100644
index 80189e3..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_12.0.1.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require ${BPN}.inc
-
-SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/mesa-${PV}.tar.xz \
-           file://replace_glibc_check_with_linux.patch \
-           file://clang-compile-PR89599.patch \
-           file://disable-asm-on-non-gcc.patch \
-"
-
-SRC_URI[md5sum] = "972fd5ad5a63aeabf173fb9adefc6522"
-SRC_URI[sha256sum] = "bab24fb79f78c876073527f515ed871fc9c81d816f66c8a0b051d8d653896389"
-
-#because we cannot rely on the fact that all apps will use pkgconfig,
-#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
-do_install_append() {
-    if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
-        sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
-    fi
-}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_17.0.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_17.0.2.bb
new file mode 100644
index 0000000..2689e8f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_17.0.2.bb
@@ -0,0 +1,18 @@
+require ${BPN}.inc
+
+SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/mesa-${PV}.tar.xz \
+           file://replace_glibc_check_with_linux.patch \
+           file://disable-asm-on-non-gcc.patch \
+           file://0001-Use-wayland-scanner-in-the-path.patch \
+"
+
+SRC_URI[md5sum] = "8f808e92b893d412fbd6510e1d16f5c5"
+SRC_URI[sha256sum] = "f8f191f909e01e65de38d5bdea5fb057f21649a3aed20948be02348e77a689d4"
+
+#because we cannot rely on the fact that all apps will use pkgconfig,
+#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
+do_install_append() {
+    if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
+        sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
+    fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb
index 6b50028..97dcac5 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb
@@ -11,7 +11,7 @@
 # rdepends on XSERVER
 REQUIRED_DISTRO_FEATURES = "x11"
 
-XSERVER ?= "xserver-xorg xf86-video-fbdev xf86-input-evdev"
+XSERVER ?= "xserver-xorg xf86-video-fbdev"
 XSERVERCODECS ?= ""
 
 RDEPENDS_${PN} = "\
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
index 4291424..001db9e 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
@@ -5,13 +5,12 @@
 PR = "r40"
 
 inherit packagegroup distro_features_check
-# rdepends on x11-common
 REQUIRED_DISTRO_FEATURES = "x11"
 
 PACKAGES = "${PN} ${PN}-utils"
 
-# xserver-common, x11-common
-VIRTUAL-RUNTIME_xserver_common ?= "x11-common"
+# backwards compatibility for xserver-common
+VIRTUAL-RUNTIME_xserver_common ?= ""
 
 # elsa, xserver-nodm-init
 VIRTUAL-RUNTIME_graphical_init_manager ?= "xserver-nodm-init"
@@ -30,4 +29,8 @@
     xhost \
     xset \
     xrandr \
+    xmodmap \
+    xdpyinfo \
+    xinput-calibrator \
+    dbus-x11 \
     "
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/pango/pango_1.40.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/pango/pango_1.40.1.bb
deleted file mode 100644
index f9f344a..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/pango/pango_1.40.1.bb
+++ /dev/null
@@ -1,52 +0,0 @@
-SUMMARY = "Framework for layout and rendering of internationalized text"
-DESCRIPTION = "Pango is a library for laying out and rendering of text, \
-with an emphasis on internationalization. Pango can be used anywhere \
-that text layout is needed, though most of the work on Pango so far has \
-been done in the context of the GTK+ widget toolkit. Pango forms the \
-core of text and font handling for GTK+-2.x."
-HOMEPAGE = "http://www.pango.org/"
-BUGTRACKER = "http://bugzilla.gnome.org"
-SECTION = "libs"
-LICENSE = "LGPLv2.0+"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
-
-inherit gnomebase gtk-doc ptest-gnome upstream-version-is-even gobject-introspection
-
-SRC_URI += "file://run-ptest \
-            file://0001-Drop-introspection-macros-from-acinclude.m4.patch \
-            file://0001-Enforce-recreation-of-docs-pango.types-it-is-build-c.patch \
-"
-SRC_URI[archive.md5sum] = "6fc88c6529890d6c8e03074d57a3eceb"
-SRC_URI[archive.sha256sum] = "e27af54172c72b3ac6be53c9a4c67053e16c905e02addcf3a603ceb2005c1a40"
-
-DEPENDS = "glib-2.0 glib-2.0-native fontconfig freetype virtual/libiconv cairo harfbuzz"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-PACKAGECONFIG[x11] = "--with-xft,--without-xft,virtual/libx11 libxft"
-
-EXTRA_AUTORECONF = ""
-
-EXTRA_OECONF = " \
-	        --disable-debug \
-	        "
-
-LEAD_SONAME = "libpango-1.0*"
-LIBV = "1.8.0"
-
-# This binary needs to be compiled for the host architecture.  This isn't pretty!
-do_compile_prepend_class-target () {
-	if ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'true', 'false', d)}; then
-		make CC="${BUILD_CC}" CFLAGS="" LDFLAGS="${BUILD_LDFLAGS}" AM_CPPFLAGS="$(pkg-config-native --cflags glib-2.0)" gen_all_unicode_LDADD="$(pkg-config-native --libs glib-2.0)" -C ${B}/tests gen-all-unicode
-	fi
-}
-
-FILES_${PN} = "${bindir}/* ${libdir}/libpango*${SOLIBS}"
-FILES_${PN}-dev += "${libdir}/pango/${LIBV}/modules/*.la"
-
-RDEPENDS_${PN}-ptest += "liberation-fonts cantarell-fonts"
-
-RPROVIDES_${PN} += "pango-modules pango-module-indic-lang \
-                    pango-module-basic-fc pango-module-arabic-lang"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/pango/pango_1.40.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/pango/pango_1.40.3.bb
new file mode 100644
index 0000000..e259a82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/pango/pango_1.40.3.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Framework for layout and rendering of internationalized text"
+DESCRIPTION = "Pango is a library for laying out and rendering of text, \
+with an emphasis on internationalization. Pango can be used anywhere \
+that text layout is needed, though most of the work on Pango so far has \
+been done in the context of the GTK+ widget toolkit. Pango forms the \
+core of text and font handling for GTK+-2.x."
+HOMEPAGE = "http://www.pango.org/"
+BUGTRACKER = "http://bugzilla.gnome.org"
+SECTION = "libs"
+LICENSE = "LGPLv2.0+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
+
+inherit gnomebase gtk-doc ptest-gnome upstream-version-is-even gobject-introspection
+
+SRC_URI += "file://run-ptest \
+            file://0001-Drop-introspection-macros-from-acinclude.m4.patch \
+            file://0001-Enforce-recreation-of-docs-pango.types-it-is-build-c.patch \
+"
+SRC_URI[archive.md5sum] = "17c26720f5a862a12f7e1745e2f1d966"
+SRC_URI[archive.sha256sum] = "abba8b5ce728520c3a0f1535eab19eac3c14aeef7faa5aded90017ceac2711d3"
+
+DEPENDS = "glib-2.0 glib-2.0-native fontconfig freetype virtual/libiconv cairo harfbuzz"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+PACKAGECONFIG[x11] = "--with-xft,--without-xft,virtual/libx11 libxft"
+
+EXTRA_AUTORECONF = ""
+
+EXTRA_OECONF = " \
+	        --disable-debug \
+	        "
+
+LEAD_SONAME = "libpango-1.0*"
+LIBV = "1.8.0"
+
+# This binary needs to be compiled for the host architecture.  This isn't pretty!
+do_compile_prepend_class-target () {
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'true', 'false', d)}; then
+		make CC="${BUILD_CC}" CFLAGS="" LDFLAGS="${BUILD_LDFLAGS}" AM_CPPFLAGS="$(pkg-config-native --cflags glib-2.0)" gen_all_unicode_LDADD="$(pkg-config-native --libs glib-2.0)" -C ${B}/tests gen-all-unicode
+	fi
+}
+
+FILES_${PN} = "${bindir}/* ${libdir}/libpango*${SOLIBS}"
+FILES_${PN}-dev += "${libdir}/pango/${LIBV}/modules/*.la"
+
+RDEPENDS_${PN}-ptest += "liberation-fonts cantarell-fonts"
+
+RPROVIDES_${PN} += "pango-modules pango-module-indic-lang \
+                    pango-module-basic-fc pango-module-arabic-lang"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-CMake-define-GBM_BO_MAP-only-when-symbol-is-found.patch b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-CMake-define-GBM_BO_MAP-only-when-symbol-is-found.patch
new file mode 100644
index 0000000..8b63424
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-CMake-define-GBM_BO_MAP-only-when-symbol-is-found.patch
@@ -0,0 +1,51 @@
+From 47697aee05a112422acf203982085e7b3e6c05b2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org>
+Date: Thu, 4 May 2017 00:57:39 -0500
+Subject: [PATCH 1/4] CMake: define GBM_BO_MAP only when symbol is found
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+gbm_bo_map() and _unmap() have been added recently to Mesa,
+and this update may not have reached all implementations of
+GBM, such as the one provided by Mali r6, where said
+definitions can be found in the header file but not in the
+library itself. This leads to errors like the following when
+linking:
+  ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_unmap'
+  ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_map'
+  collect2: error: ld returned 1 exit status
+  make[2]: *** [bin/point-sprite] Error 1
+
+Instead of relying on the header file, actually try to link
+using that symbol to determine if PIGLIT_HAS_GBM_BO_MAP
+should be defined.
+
+Upstream-Status: Submitted [piglit@lists.freedesktop.org]
+
+Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
+Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
+Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
+---
+ CMakeLists.txt | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a4ff99e..cc26fa8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -141,8 +141,9 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ 	if(GBM_FOUND)
+ 		set(PIGLIT_HAS_GBM True)
+ 		add_definitions(-DPIGLIT_HAS_GBM)
+-		if (GBM_VERSION VERSION_EQUAL "12.1" OR GBM_VERSION VERSION_GREATER "12.1")
+-			set(PIGLIT_HAS_GBM_BO_MAP True)
++		set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GBM_LIBRARIES})
++		CHECK_FUNCTION_EXISTS(gbm_bo_map PIGLIT_HAS_GBM_BO_MAP)
++		if (PIGLIT_HAS_GBM_BO_MAP)
+ 			add_definitions(-DPIGLIT_HAS_GBM_BO_MAP)
+ 		endif()
+ 	endif(GBM_FOUND)
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-cmake-Link-test-utils-with-ldl.patch b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-cmake-Link-test-utils-with-ldl.patch
deleted file mode 100644
index 2e1c947..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-cmake-Link-test-utils-with-ldl.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-Backport patch to fix build with gold linker.
-
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Upstream-Status: Backport
-
-
-
-From 93a7113485cf1c55fd7076116faf5b3a690706b2 Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Tue, 30 Aug 2016 17:17:28 +0300
-Subject: [PATCH] cmake: Link test utils with "-ldl"
-
-Without this linking CXX executables (e.g. fbo-blit-stretch) fails
-with gold linker:
-
-| libpiglitutil_gl.so.0: error: undefined reference to 'dlsym'
-| libpiglitutil_gl.so.0: error: undefined reference to 'dlerror'
-| libpiglitutil_gl.so.0: error: undefined reference to 'dlopen'
-
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
----
- tests/util/CMakeLists.txt | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
-index e1f8073..3d5bef5 100644
---- a/tests/util/CMakeLists.txt
-+++ b/tests/util/CMakeLists.txt
-@@ -11,6 +11,8 @@ set_source_files_properties(
- 	PROPERTIES GENERATED 1
- 	)
- 
-+link_libraries(${CMAKE_DL_LIBS})
-+
- if(HAVE_LIBCACA)
-     link_libraries(caca)
- endif()
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-cmake-Link-utils-with-xcb-explicitly.patch b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-cmake-Link-utils-with-xcb-explicitly.patch
deleted file mode 100644
index 845804d..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-cmake-Link-utils-with-xcb-explicitly.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 73e4fbc5777eddd89bb0fb16e90343551fe3e0ef Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Tue, 5 Jul 2016 10:56:23 +0300
-Subject: [PATCH] cmake: Link utils with xcb explicitly
-
-Linking with g++ can reportedly lead to:
-
-libpiglitutil_gl.so.0: error: undefined reference to 'xcb_connect'
-libpiglitutil_gl.so.0: error: undefined reference to 'xcb_get_setup'
-libpiglitutil_gl.so.0: error: undefined reference to 'xcb_setup_roots_iterator'
-
-This may have appeared now because xcb-dri2 used to overlink publicly
-but now does not.
-
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Upstream-Status: Accepted
----
- CMakeLists.txt            | 1 +
- tests/util/CMakeLists.txt | 2 ++
- 2 files changed, 3 insertions(+)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 8e2abba..2e1a473 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -151,6 +151,7 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- 
- 	pkg_check_modules(LIBDRM QUIET libdrm)
- 	pkg_check_modules(LIBDRM_INTEL QUIET libdrm_intel)
-+	pkg_check_modules(XCB QUIET xcb)
- 	pkg_check_modules(XCB_DRI2 QUIET xcb-dri2)
- 	pkg_check_modules(GLPROTO QUIET glproto)
- ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
-diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
-index fb22ffa..e1f8073 100644
---- a/tests/util/CMakeLists.txt
-+++ b/tests/util/CMakeLists.txt
-@@ -121,11 +121,13 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- 
- 		list(APPEND UTIL_GL_LIBS
- 			${LIBDRM_LDFLAGS}
-+			${XCB_LDFLAGS}
- 			${XCB_DRI2_LDFLAGS}
- 		)
- 
- 		list(APPEND UTIL_GL_INCLUDES
- 			${LIBDRM_INCLUDE_DIRS}
-+			${XCB_INCLUDE_DIRS}
- 			${XCB_DRI2_INCLUDE_DIRS}
- 		)
- 
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0002-util-egl-Honour-Surfaceless-MESA-in-get_default_disp.patch b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0002-util-egl-Honour-Surfaceless-MESA-in-get_default_disp.patch
new file mode 100644
index 0000000..f3aa1ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0002-util-egl-Honour-Surfaceless-MESA-in-get_default_disp.patch
@@ -0,0 +1,54 @@
+From a6608f218b5023cef36b3de5ec3c5f00b0211d1c Mon Sep 17 00:00:00 2001
+From: Daniel Diaz <daniel.diaz@linaro.org>
+Date: Wed, 17 May 2017 18:00:15 -0500
+Subject: [PATCH 2/4] util/egl: Honour Surfaceless MESA in get_default_display
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The EGL_MESA_platform_surfaceless extension was introduced not too long
+ago. Add support for it our helper.
+
+Upstream-Status: Accepted, since git 7b74602.
+
+Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
+Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
+---
+ tests/util/piglit-util-egl.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/tests/util/piglit-util-egl.c b/tests/util/piglit-util-egl.c
+index 106c735..389fe12 100644
+--- a/tests/util/piglit-util-egl.c
++++ b/tests/util/piglit-util-egl.c
+@@ -85,6 +85,7 @@ piglit_egl_get_default_display(EGLenum platform)
+ 	static bool has_x11 = false;
+ 	static bool has_wayland = false;
+ 	static bool has_gbm = false;
++	static bool has_surfaceless_mesa = false;
+ 
+ 	static EGLDisplay (*peglGetPlatformDisplayEXT)(EGLenum platform, void *native_display, const EGLint *attrib_list);
+ 
+@@ -99,6 +100,7 @@ piglit_egl_get_default_display(EGLenum platform)
+ 		has_x11 = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_EXT_platform_x11");
+ 		has_wayland = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_EXT_platform_wayland");
+ 		has_gbm = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_EXT_platform_gbm");
++		has_surfaceless_mesa = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_MESA_platform_surfaceless");
+ 
+ 		peglGetPlatformDisplayEXT = (void*) eglGetProcAddress("eglGetPlatformDisplayEXT");
+ 	}
+@@ -123,6 +125,11 @@ piglit_egl_get_default_display(EGLenum platform)
+ 			return EGL_NO_DISPLAY;
+ 		}
+ 		break;
++	case EGL_PLATFORM_SURFACELESS_MESA:
++		if (!has_surfaceless_mesa) {
++			return EGL_NO_DISPLAY;
++		}
++		break;
+ 	default:
+ 		fprintf(stderr, "%s: unrecognized platform %#x\n", __func__, platform);
+ 		return EGL_NO_DISPLAY;
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0003-egl_mesa_platform_surfaceless-Don-t-use-eglGetPlatfo.patch b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0003-egl_mesa_platform_surfaceless-Don-t-use-eglGetPlatfo.patch
new file mode 100644
index 0000000..0f24dc1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0003-egl_mesa_platform_surfaceless-Don-t-use-eglGetPlatfo.patch
@@ -0,0 +1,36 @@
+From c0dc430b8f5deeacdb11cd188195e16f512af233 Mon Sep 17 00:00:00 2001
+From: Daniel Diaz <daniel.diaz@linaro.org>
+Date: Wed, 17 May 2017 18:00:16 -0500
+Subject: [PATCH 3/4] egl_mesa_platform_surfaceless: Don't use
+ eglGetPlatformDisplay directly
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The entry point is not guaranteed to exist, so use the
+piglit_egl_get_default_display() helper which does the correct thing.
+
+Upstream-Status: Accepted, since git 7b74602.
+
+Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
+Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
+---
+ .../spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c  | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c b/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c
+index 3bbd6aa..81a3919 100644
+--- a/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c
++++ b/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c
+@@ -31,7 +31,7 @@ test_setup(EGLDisplay *dpy)
+ 
+ 	piglit_require_egl_extension(EGL_NO_DISPLAY, "EGL_MESA_platform_surfaceless");
+ 
+-	*dpy = eglGetPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, NULL, NULL);
++	*dpy = piglit_egl_get_default_display(EGL_PLATFORM_SURFACELESS_MESA);
+ 	if (*dpy == EGL_NO_DISPLAY) {
+ 		printf("failed to get EGLDisplay\n");
+ 		piglit_report_result(PIGLIT_SKIP);
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0004-egl_mesa_platform_surfaceless-Use-EXT-functions-for-.patch b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0004-egl_mesa_platform_surfaceless-Use-EXT-functions-for-.patch
new file mode 100644
index 0000000..0952af5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0004-egl_mesa_platform_surfaceless-Use-EXT-functions-for-.patch
@@ -0,0 +1,78 @@
+From 57de1ff6758ec5ea4a52637f233e3e3150086255 Mon Sep 17 00:00:00 2001
+From: Daniel Diaz <daniel.diaz@linaro.org>
+Date: Wed, 17 May 2017 18:00:17 -0500
+Subject: [PATCH 4/4] egl_mesa_platform_surfaceless: Use EXT functions for
+ surfaces
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+These EXT symbols are guaranteed to exist since they require
+EGL_EXT_platform_base.
+
+Upstream-Status: Accepted, since git 7b74602.
+
+Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
+Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
+---
+ .../egl_mesa_platform_surfaceless.c                | 23 ++++++++++++++++++++--
+ 1 file changed, 21 insertions(+), 2 deletions(-)
+
+diff --git a/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c b/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c
+index 81a3919..264ed71 100644
+--- a/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c
++++ b/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c
+@@ -24,6 +24,24 @@
+ #include "piglit-util.h"
+ #include "piglit-util-egl.h"
+ 
++/* Extension function pointers.
++ *
++ * Use prefix 'pegl' (piglit egl) instead of 'egl' to avoid collisions with
++ * prototypes in eglext.h. */
++EGLSurface (*peglCreatePlatformPixmapSurfaceEXT)(EGLDisplay display, EGLConfig config,
++	    NativePixmapType native_pixmap, const EGLint *attrib_list);
++EGLSurface (*peglCreatePlatformWindowSurfaceEXT)(EGLDisplay display, EGLConfig config,
++	    NativeWindowType native_window, const EGLint *attrib_list);
++
++static void
++init_egl_extension_funcs(void)
++{
++	peglCreatePlatformPixmapSurfaceEXT = (void*)
++		eglGetProcAddress("eglCreatePlatformPixmapSurfaceEXT");
++	peglCreatePlatformWindowSurfaceEXT = (void*)
++		eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
++}
++
+ static void
+ test_setup(EGLDisplay *dpy)
+ {
+@@ -72,7 +90,7 @@ test_create_window(void *test_data)
+ 
+ 	test_setup(&dpy);
+ 
+-	surf = eglCreatePlatformWindowSurface(dpy, EGL_NO_CONFIG_KHR,
++	surf = peglCreatePlatformWindowSurfaceEXT(dpy, EGL_NO_CONFIG_KHR,
+ 					      /*native_window*/ NULL,
+ 					      /*attrib_list*/ NULL);
+ 	if (surf) {
+@@ -103,7 +121,7 @@ test_create_pixmap(void *test_data)
+ 
+ 	test_setup(&dpy);
+ 
+-	surf = eglCreatePlatformPixmapSurface(dpy, EGL_NO_CONFIG_KHR,
++	surf = peglCreatePlatformPixmapSurfaceEXT(dpy, EGL_NO_CONFIG_KHR,
+ 					      /*native_window*/ NULL,
+ 					      /*attrib_list*/ NULL);
+ 	if (surf) {
+@@ -205,6 +223,7 @@ main(int argc, char **argv)
+ 		piglit_report_result(PIGLIT_FAIL);
+ 	}
+ 
++	init_egl_extension_funcs();
+ 	result = piglit_run_selected_subtests(subtests, selected_names,
+ 					      num_selected, result);
+ 	piglit_report_result(result);
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit_git.bb
index 82adcde..2ea5779 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit_git.bb
@@ -5,23 +5,28 @@
 SRC_URI = "git://anongit.freedesktop.org/piglit \
            file://0001-cmake-install-bash-completions-in-the-right-place.patch \
            file://0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch \
-           file://0001-cmake-Link-utils-with-xcb-explicitly.patch \
-           file://0001-cmake-Link-test-utils-with-ldl.patch \
+           file://0001-CMake-define-GBM_BO_MAP-only-when-symbol-is-found.patch \
+           file://0002-util-egl-Honour-Surfaceless-MESA-in-get_default_disp.patch \
+           file://0003-egl_mesa_platform_surfaceless-Don-t-use-eglGetPlatfo.patch \
+           file://0004-egl_mesa_platform_surfaceless-Use-EXT-functions-for-.patch \
            "
 
-# From 2016-07-07
-SRCREV = "c39e41a86551eb390b8da23232dc8577639403d0"
+# From 2017-02-06
+SRCREV = "ca58eec0b965655c7eba592a634cbf4aadfbc675"
 # (when PV goes above 1.0 remove the trailing r)
 PV = "1.0+gitr${SRCPV}"
 
 S = "${WORKDIR}/git"
 
-DEPENDS = "libpng virtual/libx11 libxrender waffle virtual/libgl libglu python3-mako-native python3-numpy-native python3-six-native"
+DEPENDS = "libpng virtual/libx11 libxkbcommon libxrender waffle virtual/libgl libglu python3-mako-native python3-numpy-native python3-six-native virtual/egl"
 
 inherit cmake python3native distro_features_check bash-completion
 # depends on virtual/libx11
 REQUIRED_DISTRO_FEATURES = "x11"
 
+# depends on virtual/libgl
+REQUIRED_DISTRO_FEATURES += "opengl"
+
 # The built scripts go into the temporary directory according to tempfile
 # (typically /tmp) which can race if multiple builds happen on the same machine,
 # so tell it to use a directory in ${B} to avoid overwriting.
@@ -46,7 +51,7 @@
 	python3-subprocess python3-misc python3-importlib \
 	python3-unixadmin python3-xml python3-multiprocessing \
 	python3-six python3-shell python3-io python3-argparse \
-	mesa-demos bash \
+	python3-netserver mesa-demos bash \
 	"
 
 INSANE_SKIP_${PN} += "dev-so already-stripped"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb
index 6c3bcd8..cdfe38a 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb
@@ -2,7 +2,7 @@
 LICENSE = "GPLv2+"
 DEPENDS = "virtual/libx11 xdmcp xau"
 
-inherit distro_features_check
+inherit distro_features_check pkgconfig
 # depends on virtual/libx11
 REQUIRED_DISTRO_FEATURES = "x11"
 
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/vulkan/vulkan/0001-Use-getenv-if-secure_getenv-does-not-exist.patch b/import-layers/yocto-poky/meta/recipes-graphics/vulkan/vulkan/0001-Use-getenv-if-secure_getenv-does-not-exist.patch
new file mode 100644
index 0000000..694922c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/vulkan/vulkan/0001-Use-getenv-if-secure_getenv-does-not-exist.patch
@@ -0,0 +1,34 @@
+From 20525add1df8e1fb13fef90ac068f982def8b958 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 8 Mar 2017 13:23:58 +0200
+Subject: [PATCH] Use getenv() if secure_getenv() does not exist
+
+musl does not implement secure version: default to getenv() in that
+case.
+
+https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/1538
+
+Upstream-Status: Pending
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ loader/loader.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/loader/loader.c b/loader/loader.c
+index 24758f4..bff79c1 100644
+--- a/loader/loader.c
++++ b/loader/loader.c
+@@ -54,6 +54,10 @@
+ #endif
+ #endif
+ 
++#if !defined(__secure_getenv)
++#define __secure_getenv getenv
++#endif
++
+ struct loader_struct loader = {0};
+ // TLS for instance for alloc/free callbacks
+ THREAD_LOCAL_DECL struct loader_instance *tls_instance;
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/vulkan/vulkan/demos-Don-t-build-tri-or-cube.patch b/import-layers/yocto-poky/meta/recipes-graphics/vulkan/vulkan/demos-Don-t-build-tri-or-cube.patch
new file mode 100644
index 0000000..3cf241d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/vulkan/vulkan/demos-Don-t-build-tri-or-cube.patch
@@ -0,0 +1,106 @@
+commit f63cbe944107b5cd8f150ceaaec43b26099d5688
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Tue Feb 16 10:05:25 2016 -0500
+
+    demos: Don't build tri or cube
+    
+    There are more interesting demos, all we really want here is vulkaninfo.
+    This helps because we don't need to pre-build glslang/llvm/lunarglass
+    just to get the loader and layers.
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+--- a/demos/CMakeLists.txt
++++ b/demos/CMakeLists.txt
+@@ -61,46 +61,6 @@
+ else()
+ endif()
+ 
+-if(WIN32)
+-    # For Windows, since 32-bit and 64-bit items can co-exist, we build each in its own build directory.
+-    # 32-bit target data goes in build32, and 64-bit target data goes into build.  So, include/link the
+-    # appropriate data at build time.
+-    if (CMAKE_CL_64)
+-        set (BUILDTGT_DIR build)
+-    else ()
+-        set (BUILDTGT_DIR build32)
+-    endif()
+-
+-    # Use static MSVCRT libraries
+-    foreach(configuration in CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
+-                             CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+-        if(${configuration} MATCHES "/MD")
+-            string(REGEX REPLACE "/MD" "/MT" ${configuration} "${${configuration}}")
+-        endif()
+-    endforeach()
+-
+-    add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.spv
+-       COMMAND ${GLSLANG_VALIDATOR} -s -V -o ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${PROJECT_SOURCE_DIR}/demos/cube.vert
+-       DEPENDS cube.vert ${GLSLANG_VALIDATOR}
+-       )
+-    add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.spv
+-       COMMAND ${GLSLANG_VALIDATOR} -s -V -o ${CMAKE_BINARY_DIR}/demos/cube-frag.spv ${PROJECT_SOURCE_DIR}/demos/cube.frag
+-       DEPENDS cube.frag ${GLSLANG_VALIDATOR}
+-       )
+-   file(COPY cube.vcxproj.user DESTINATION ${CMAKE_BINARY_DIR}/demos)
+-   file(COPY vulkaninfo.vcxproj.user DESTINATION ${CMAKE_BINARY_DIR}/demos)
+-else()
+-    if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+-        add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.spv
+-            COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-vert.spv ${PROJECT_SOURCE_DIR}/demos/cube.vert
+-            DEPENDS cube.vert ${GLSLANG_VALIDATOR}
+-            )
+-        add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.spv
+-            COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-frag.spv ${PROJECT_SOURCE_DIR}/demos/cube.frag
+-            DEPENDS cube.frag ${GLSLANG_VALIDATOR}
+-            )
+-    endif()         
+-endif()
+ 
+ if(WIN32)
+     include_directories (
+@@ -114,43 +74,6 @@
+ add_executable(${API_LOWERCASE}info vulkaninfo.c)
+ target_link_libraries(${API_LOWERCASE}info ${LIBRARIES})
+ 
+-if(NOT WIN32)
+-    if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+-        add_executable(cube cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+-        target_link_libraries(cube ${LIBRARIES})
+-    endif()
+-else()
+-    if (CMAKE_CL_64)
+-        set (LIB_DIR "Win64")
+-    else()
+-        set (LIB_DIR "Win32")
+-    endif()
+-
+-    add_executable(cube WIN32 cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+-    target_link_libraries(cube ${LIBRARIES})
+-endif()
+-
+-if(NOT WIN32)
+-    if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+-        add_executable(cubepp cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+-        target_link_libraries(cubepp ${LIBRARIES})
+-    endif()
+-else()
+-    if (CMAKE_CL_64)
+-        set (LIB_DIR "Win64")
+-    else()
+-        set (LIB_DIR "Win32")
+-    endif()
+-
+-    add_executable(cubepp WIN32 cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+-    target_link_libraries(cubepp ${LIBRARIES})
+-endif()
+-
+-if ((${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}))
+-    if  ((DEMOS_WSI_SELECTION STREQUAL "XCB") OR (DEMOS_WSI_SELECTION STREQUAL "WAYLAND") OR WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Android"))
+-        add_subdirectory(smoke)
+-    endif()
+-endif()
+ 
+ if(UNIX)
+     install(TARGETS ${API_LOWERCASE}info DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/vulkan/vulkan_1.0.39.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/vulkan/vulkan_1.0.39.1.bb
new file mode 100644
index 0000000..45d1c49
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/vulkan/vulkan_1.0.39.1.bb
@@ -0,0 +1,34 @@
+SUMMARY = "3D graphics and compute API common loader"
+DESCRIPTION = "Vulkan is a new generation graphics and compute API \
+that provides efficient access to modern GPUs. These packages \
+provide only the common vendor-agnostic library loader, headers and \
+the vulkaninfo utility."
+HOMEPAGE = "https://www.khronos.org/vulkan/"
+BUGTRACKER = "https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers"
+SECTION = "libs"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=99c647ca3d4f6a4b9d8628f757aad156 \
+                    file://loader/loader.c;endline=25;md5=a87cd5442291c23d1fce4eece4cfde9d"
+SRC_URI = "git://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers.git;branch=sdk-1.0.39 \
+           file://demos-Don-t-build-tri-or-cube.patch \
+           file://0001-Use-getenv-if-secure_getenv-does-not-exist.patch \
+"
+SRCREV = "9c21ed0fb275589c3af6118aec9ef4f1d1544dc1"
+
+S = "${WORKDIR}/git"
+
+
+inherit cmake python3native lib_package distro_features_check
+ANY_OF_DISTRO_FEATURES = "x11 wayland"
+
+EXTRA_OECMAKE = "-DBUILD_WSI_MIR_SUPPORT=OFF \
+                 -DBUILD_LAYERS=OFF \
+                 -DBUILD_TESTS=OFF"
+
+# must choose x11 or wayland or both
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '' ,d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '' ,d)}"
+PACKAGECONFIG[x11] = "-DBUILD_WSI_XLIB_SUPPORT=ON -DBUILD_WSI_XCB_SUPPORT=ON -DDEMOS_WSI_SELECTION=XCB, -DBUILD_WSI_XLIB_SUPPORT=OFF -DBUILD_WSI_XCB_SUPPORT=OFF -DDEMOS_WSI_SELECTION=WAYLAND, libxcb libx11 libxrandr"
+PACKAGECONFIG[wayland] = "-DBUILD_WSI_WAYLAND_SUPPORT=ON, -DBUILD_WSI_WAYLAND_SUPPORT=OFF, wayland"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb
index f7db1bc..a5179db 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb
@@ -20,18 +20,21 @@
 # libx11 requires x11 in DISTRO_FEATURES.
 REQUIRED_DISTRO_FEATURES = "${@bb.utils.contains('PACKAGECONFIG', 'glx', 'x11', '', d)}"
 
+# virtual/libgl requires opengl in DISTRO_FEATURES.
+REQUIRED_DISTRO_FEATURES += "${@bb.utils.contains('DEPENDS', 'virtual/${MLPREFIX}libgl', 'opengl', '', d)}"
+
 # I say virtual/libgl, actually wants gl.pc
-PACKAGECONFIG[glx] = "-Dwaffle_has_glx=1,-Dwaffle_has_glx=0,virtual/libgl libx11"
+PACKAGECONFIG[glx] = "-Dwaffle_has_glx=1,-Dwaffle_has_glx=0,virtual/${MLPREFIX}libgl libx11"
 
 # I say virtual/libgl, actually wants wayland-egl.pc, egl.pc, and the wayland
 # DISTRO_FEATURE.
-PACKAGECONFIG[wayland] = "-Dwaffle_has_wayland=1,-Dwaffle_has_wayland=0,virtual/libgl wayland"
+PACKAGECONFIG[wayland] = "-Dwaffle_has_wayland=1,-Dwaffle_has_wayland=0,virtual/${MLPREFIX}libgl wayland"
 
 # I say virtual/libgl, actually wants gbm.pc egl.pc
-PACKAGECONFIG[gbm] = "-Dwaffle_has_gbm=1,-Dwaffle_has_gbm=0,virtual/libgl udev"
+PACKAGECONFIG[gbm] = "-Dwaffle_has_gbm=1,-Dwaffle_has_gbm=0,virtual/${MLPREFIX}libgl udev"
 
 # I say virtual/libgl, actually wants egl.pc
-PACKAGECONFIG[x11-egl] = "-Dwaffle_has_x11_egl=1,-Dwaffle_has_x11_egl=0,virtual/libgl libxcb"
+PACKAGECONFIG[x11-egl] = "-Dwaffle_has_x11_egl=1,-Dwaffle_has_x11_egl=0,virtual/${MLPREFIX}libgl libxcb"
 
 FILES_${PN}-dev += "${datadir}/cmake/Modules/FindWaffle.cmake \
                     ${libdir}/cmake/Waffle/"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput_1.4.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput_1.4.1.bb
deleted file mode 100644
index 3580392..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput_1.4.1.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-SUMMARY = "Library to handle input devices in Wayland compositors"
-HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libinput/"
-SECTION = "libs"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=2184aef38ff137ed33ce9a63b9d1eb8f"
-
-DEPENDS = "libevdev udev mtdev"
-
-SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BP}.tar.xz \
-           file://touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch \
-"
-SRC_URI[md5sum] = "2e7ba577ed74d8d1baeb07dbd4fb912a"
-SRC_URI[sha256sum] = "26e7b3ab499358caba499705680ea7e5851af2bd37dc32f2be64181610d6392a"
-
-inherit autotools pkgconfig
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind"
-PACKAGECONFIG[libwacom] = "--enable-libwacom,--disable-libwacom,libwacom"
-PACKAGECONFIG[gui] = "--enable-event-gui,--disable-event-gui,cairo gtk+3"
-
-UDEVDIR = "`pkg-config --variable=udevdir udev`"
-
-EXTRA_OECONF += "--with-udev-dir=${UDEVDIR}"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput_1.6.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput_1.6.1.bb
new file mode 100644
index 0000000..c8714f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput_1.6.1.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Library to handle input devices in Wayland compositors"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libinput/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2184aef38ff137ed33ce9a63b9d1eb8f"
+
+DEPENDS = "libevdev udev mtdev"
+
+SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BP}.tar.xz \
+           file://touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch \
+"
+SRC_URI[md5sum] = "7e282344f8ed7ec5cf87ca9fc22674fb"
+SRC_URI[sha256sum] = "9d816f13eee63bcca0e9c3bb652c52ab55f39be4d1b90b54e4bfd1dc92ef55a8"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind"
+PACKAGECONFIG[libwacom] = "--enable-libwacom,--disable-libwacom,libwacom"
+PACKAGECONFIG[gui] = "--enable-event-gui,--disable-event-gui,cairo gtk+3"
+
+UDEVDIR = "`pkg-config --variable=udevdir udev`"
+
+EXTRA_OECONF += "--with-udev-dir=${UDEVDIR}"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland/0001-scanner-Use-unit32_t-instead-of-uint.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland/0001-scanner-Use-unit32_t-instead-of-uint.patch
deleted file mode 100644
index dece95c..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland/0001-scanner-Use-unit32_t-instead-of-uint.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 5516d32e694badca35b6c71b02a3f08f650308bf Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 15 Jul 2016 16:23:48 -0700
-Subject: [PATCH] scanner: Use unit32_t instead of uint
-
-uint32_t is C99 defined stdint type
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Upstream-Status: Submitted
----
- src/scanner.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/scanner.c b/src/scanner.c
-index 5f06e8e..10a4023 100644
---- a/src/scanner.c
-+++ b/src/scanner.c
-@@ -808,7 +808,7 @@ find_enumeration(struct protocol *protocol,
- 	struct interface *i;
- 	struct enumeration *e;
- 	char *enum_name;
--	uint idx = 0, j;
-+	uint32_t idx = 0, j;
- 
- 	for (j = 0; j + 1 < strlen(enum_attribute); j++) {
- 		if (enum_attribute[j] == '.') {
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland_1.11.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland_1.11.0.bb
deleted file mode 100644
index 3413406..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland_1.11.0.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-SUMMARY = "Wayland, a protocol between a compositor and clients"
-DESCRIPTION = "Wayland is a protocol for a compositor to talk to its clients \
-as well as a C library implementation of that protocol. The compositor can be \
-a standalone display server running on Linux kernel modesetting and evdev \
-input devices, an X application, or a wayland client itself. The clients can \
-be traditional applications, X servers (rootless or fullscreen) or other \
-display servers."
-HOMEPAGE = "http://wayland.freedesktop.org"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b31d8f53b6aaf2b4985d7dd7810a70d1 \
-                    file://src/wayland-server.c;endline=24;md5=b8e046164a766bb1ede8ba38e9dcd7ce"
-
-SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
-           file://0001-scanner-Use-unit32_t-instead-of-uint.patch \
-           "
-SRC_URI[md5sum] = "fccf680be066e234729d5b69e0bd0fa9"
-SRC_URI[sha256sum] = "9540925f7928becfdf5e3b84c70757f6589bf1ceef09bea78784d8e4772c0db0"
-
-EXTRA_OECONF_class-native = "--disable-documentation --disable-libraries"
-
-inherit autotools pkgconfig
-
-BBCLASSEXTEND = "native nativesdk"
-
-DEPENDS = "expat libxml2 libffi wayland-native"
-
-EXTRA_OECONF = "--disable-documentation --with-host-scanner"
-
-# Wayland installs a M4 macro for other projects to use, which uses the target
-# pkg-config to find files.  Replace pkg-config with pkg-config-native.
-do_install_append_class-native() {
-  sed -e 's,PKG_CHECK_MODULES(.*),,g' \
-      -e 's,$PKG_CONFIG,pkg-config-native,g' \
-      -i ${D}/${datadir}/aclocal/wayland-scanner.m4
-}
-
-sysroot_stage_all_append_class-target () {
-	rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4
-	cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/
-}
-
-FILES_${PN} = "${libdir}/*${SOLIBS}"
-FILES_${PN}-dev += "${bindir} ${datadir}/wayland"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland_1.13.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland_1.13.0.bb
new file mode 100644
index 0000000..b9396b6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland_1.13.0.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Wayland, a protocol between a compositor and clients"
+DESCRIPTION = "Wayland is a protocol for a compositor to talk to its clients \
+as well as a C library implementation of that protocol. The compositor can be \
+a standalone display server running on Linux kernel modesetting and evdev \
+input devices, an X application, or a wayland client itself. The clients can \
+be traditional applications, X servers (rootless or fullscreen) or other \
+display servers."
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b31d8f53b6aaf2b4985d7dd7810a70d1 \
+                    file://src/wayland-server.c;endline=24;md5=b8e046164a766bb1ede8ba38e9dcd7ce"
+
+DEPENDS = "expat libxml2 libffi wayland-native"
+
+SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+           "
+SRC_URI[md5sum] = "cae152ed956da6de53f9727bc1c45039"
+SRC_URI[sha256sum] = "69b052c031a61e89af7cc8780893d0da1e301492352aa449dee9345043e6fe51"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-documentation --with-host-scanner"
+EXTRA_OECONF_class-native = "--disable-documentation --disable-libraries"
+
+# Wayland installs a M4 macro for other projects to use, which uses the target
+# pkg-config to find files.  Replace pkg-config with pkg-config-native.
+do_install_append_class-native() {
+  sed -e 's,PKG_CHECK_MODULES(.*),,g' \
+      -e 's,$PKG_CONFIG,pkg-config-native,g' \
+      -i ${D}/${datadir}/aclocal/wayland-scanner.m4
+}
+
+sysroot_stage_all_append_class-target () {
+	rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4
+	cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/
+}
+
+FILES_${PN} = "${libdir}/*${SOLIBS}"
+FILES_${PN}-dev += "${bindir} ${datadir}/wayland"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init.bb
index 291cd16..22ba5f3 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init.bb
@@ -1,6 +1,6 @@
 SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 SRC_URI = "file://init \
            file://weston.service \
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-configure.ac-Fix-wayland-protocols-path.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-configure.ac-Fix-wayland-protocols-path.patch
index 00118d7..5f4d79c 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-configure.ac-Fix-wayland-protocols-path.patch
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-configure.ac-Fix-wayland-protocols-path.patch
@@ -13,22 +13,17 @@
 Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
 Upstream-Status: Inappropriate [embedded specific]
 ---
- configure.ac | 2 +-
+ configure.ac |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/configure.ac b/configure.ac
-index bc7c329..15a05d3 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -187,7 +187,7 @@ PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
+@@ -187,7 +187,7 @@ PKG_CHECK_MODULES(LIBINPUT_BACKEND, [lib
  PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
  
- PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.2],
+ PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.7],
 -		  [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
 +		  [ac_wayland_protocols_pkgdatadir=${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
  AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
  
  AC_ARG_ENABLE(wayland-compositor, [  --enable-wayland-compositor],,
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
index 148848d..e2213ac 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
@@ -10,17 +10,15 @@
 ---
 Upstream-Status: Submitted
 
- configure.ac        |  2 ++
- src/weston-error.h  | 20 ++++++++++++++++++++
- src/weston-launch.c |  2 +-
+ configure.ac              |    2 ++
+ libweston/weston-error.h  |   20 ++++++++++++++++++++
+ libweston/weston-launch.c |    2 +-
  3 files changed, 23 insertions(+), 1 deletion(-)
  create mode 100644 src/weston-error.h
 
-diff --git a/configure.ac b/configure.ac
-index 263fc22..f52cd62 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -57,6 +57,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
+@@ -60,6 +60,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
  	      [[#include <time.h>]])
  AC_CHECK_HEADERS([execinfo.h])
  
@@ -28,12 +26,9 @@
 +
  AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
  
- COMPOSITOR_MODULES="wayland-server >= 1.7.93 pixman-1 >= 0.25.2"
-diff --git a/src/weston-error.h b/src/weston-error.h
-new file mode 100644
-index 0000000..2089d02
+ COMPOSITOR_MODULES="wayland-server >= $WAYLAND_PREREQ_VERSION pixman-1 >= 0.25.2"
 --- /dev/null
-+++ b/src/weston-error.h
++++ b/libweston/weston-error.h
 @@ -0,0 +1,20 @@
 +#ifndef _WESTON_ERROR_H
 +#define _WESTON_ERROR_H
@@ -55,11 +50,9 @@
 +
 +#endif
 +
-diff --git a/src/weston-launch.c b/src/weston-launch.c
-index 10c66de..3e6d30a 100644
---- a/src/weston-launch.c
-+++ b/src/weston-launch.c
-@@ -30,7 +30,6 @@
+--- a/libweston/weston-launch.c
++++ b/libweston/weston-launch.c
+@@ -33,7 +33,6 @@
  #include <poll.h>
  #include <errno.h>
  
@@ -67,7 +60,7 @@
  #include <getopt.h>
  
  #include <sys/types.h>
-@@ -56,6 +55,7 @@
+@@ -59,6 +58,7 @@
  #endif
  
  #include "weston-launch.h"
@@ -75,6 +68,3 @@
  
  #define DRM_MAJOR 226
  
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-shared-include-stdint.h-for-int32_t.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-shared-include-stdint.h-for-int32_t.patch
deleted file mode 100644
index 91ef727..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-shared-include-stdint.h-for-int32_t.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From ba02b8abe4e2afac2bfbf2559972d5059d75a041 Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Sat, 16 Jul 2016 22:50:19 +0300
-Subject: [PATCH weston] shared: include stdint.h for int32_t
-
-This fixes build on musl.
-
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Upstream-Status: Submitted
----
- shared/xalloc.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/shared/xalloc.h b/shared/xalloc.h
-index 85fccb4..484de2d 100644
---- a/shared/xalloc.h
-+++ b/shared/xalloc.h
-@@ -30,6 +30,7 @@
- extern "C" {
- #endif
- 
-+#include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
- 
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
index 5542036..70b9888 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
@@ -1,6 +1,6 @@
-From d02226b3d5872b184c1d50c7f4706ac9467ffb81 Mon Sep 17 00:00:00 2001
+From 8ff6ed03ec4079f32e9b34085414e57be4730e04 Mon Sep 17 00:00:00 2001
 From: Tom Hochstein <tom.hochstein@nxp.com>
-Date: Fri, 15 Jul 2016 11:00:15 +0300
+Date: Wed, 22 Feb 2017 15:53:30 +0200
 Subject: [PATCH] weston-launch: Provide a default version that doesn't require
  PAM
 
@@ -13,16 +13,17 @@
 Upstream-Status: Pending
 
 Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
 ---
- configure.ac        |  9 +++++++--
- src/weston-launch.c | 20 ++++++++++++++++++++
+ configure.ac              |  9 +++++++--
+ libweston/weston-launch.c | 20 ++++++++++++++++++++
  2 files changed, 27 insertions(+), 2 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 32fdde7..240966f 100644
+index 46cb2c7..bb45f46 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -416,13 +416,17 @@ AC_ARG_ENABLE(resize-optimization,
+@@ -435,13 +435,17 @@ AC_ARG_ENABLE(resize-optimization,
  AS_IF([test "x$enable_resize_optimization" = "xyes"],
        [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
  
@@ -30,11 +31,11 @@
 +            AS_HELP_STRING([--with-pam], [Use PAM]),
 +            [use_pam=$withval], [use_pam=yes])
  AC_ARG_ENABLE(weston-launch, [  --enable-weston-launch],, enable_weston_launch=yes)
- AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
--if test x$enable_weston_launch == xyes; then
+ AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes)
+-if test x$enable_weston_launch = xyes; then
 +if test x$enable_weston_launch = xyes -a x$use_pam = xyes; then
    WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no])
-   if test x$have_pam == xno; then
+   if test x$have_pam = xno; then
 -    AC_ERROR([weston-launch requires pam])
 +    AC_ERROR([PAM support is explicitly requested, but libpam couldn't be found])
    fi
@@ -42,7 +43,7 @@
  fi
  
  AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
-@@ -673,6 +677,7 @@ AC_MSG_RESULT([
+@@ -701,6 +705,7 @@ AC_MSG_RESULT([
  	Enable developer documentation	${enable_devdocs}
  
  	weston-launch utility		${enable_weston_launch}
@@ -50,10 +51,10 @@
  	systemd-login support		${have_systemd_login}
  	systemd notify support		${enable_systemd_notify}
  
-diff --git a/src/weston-launch.c b/src/weston-launch.c
-index b8b2ba0..a865061 100644
---- a/src/weston-launch.c
-+++ b/src/weston-launch.c
+diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
+index 0491896..07e7469 100644
+--- a/libweston/weston-launch.c
++++ b/libweston/weston-launch.c
 @@ -51,7 +51,9 @@
  
  #include <pwd.h>
@@ -107,7 +108,7 @@
  
  	if (ioctl(wl->tty, KDSKBMUTE, 0) &&
  	    ioctl(wl->tty, KDSKBMODE, wl->kb_mode))
-@@ -600,6 +608,7 @@ setup_session(struct weston_launch *wl)
+@@ -600,6 +608,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
  	setenv("HOME", wl->pw->pw_dir, 1);
  	setenv("SHELL", wl->pw->pw_shell, 1);
  
@@ -115,15 +116,15 @@
  	env = pam_getenvlist(wl->ph);
  	if (env) {
  		for (i = 0; env[i]; ++i) {
-@@ -608,6 +617,7 @@ setup_session(struct weston_launch *wl)
+@@ -608,6 +617,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
  		}
  		free(env);
  	}
 +#endif
- }
  
- static void
-@@ -665,7 +675,9 @@ static void
+ 	/*
+ 	 * We open a new session, so it makes sense
+@@ -675,7 +685,9 @@ static void
  help(const char *name)
  {
  	fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
@@ -133,7 +134,7 @@
  	fprintf(stderr, "  -t, --tty       Start session on alternative tty\n");
  	fprintf(stderr, "  -v, --verbose   Be verbose\n");
  	fprintf(stderr, "  -h, --help      Display this help message\n");
-@@ -678,7 +690,9 @@ main(int argc, char *argv[])
+@@ -688,7 +700,9 @@ main(int argc, char *argv[])
  	int i, c;
  	char *tty = NULL;
  	struct option opts[] = {
@@ -143,7 +144,7 @@
  		{ "tty",     required_argument, NULL, 't' },
  		{ "verbose", no_argument,       NULL, 'v' },
  		{ "help",    no_argument,       NULL, 'h' },
-@@ -690,9 +704,13 @@ main(int argc, char *argv[])
+@@ -700,9 +714,13 @@ main(int argc, char *argv[])
  	while ((c = getopt_long(argc, argv, "u:t::vh", opts, &i)) != -1) {
  		switch (c) {
  		case 'u':
@@ -157,7 +158,7 @@
  			break;
  		case 't':
  			tty = optarg;
-@@ -730,8 +748,10 @@ main(int argc, char *argv[])
+@@ -740,8 +758,10 @@ main(int argc, char *argv[])
  	if (setup_tty(&wl, tty) < 0)
  		exit(EXIT_FAILURE);
  
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-weston-launch-exit-for-unrecognized-option.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-weston-launch-exit-for-unrecognized-option.patch
deleted file mode 100644
index 0c408a4..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-weston-launch-exit-for-unrecognized-option.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From e8b615250f700f7854b423aaaf0a0aeea92c05a9 Mon Sep 17 00:00:00 2001
-From: Tom Hochstein <tom.hochstein@nxp.com>
-Date: Sat, 7 May 2016 08:51:58 -0300
-Subject: [PATCH] weston-launch: Handle invalid command line options
-Organization: O.S. Systems Software LTDA.
-
-Exit the program if an unrecognized command line option is found.
-
-Upstream-Status: Submitted
-
-Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
-Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
----
-
- src/weston-launch.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/weston-launch.c b/src/weston-launch.c
-index b8dfb17..9987d8e 100644
---- a/src/weston-launch.c
-+++ b/src/weston-launch.c
-@@ -703,6 +703,8 @@ main(int argc, char *argv[])
- 		case 'h':
- 			help("weston-launch");
- 			exit(EXIT_FAILURE);
-+		default:
-+			exit(EXIT_FAILURE);
- 		}
- 	}
- 
--- 
-2.8.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston-1.11-config-option-for-no-input-device.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston-1.11-config-option-for-no-input-device.patch
deleted file mode 100644
index 6f5ad66..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston-1.11-config-option-for-no-input-device.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From bbf2e6ebbd9c051775f43e1e3c3a2f41322342e8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org>
-Date: Fri, 21 Oct 2016 14:03:13 -0500
-Subject: [PATCH] Add configuration option for no input device.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-[Backported from master, 75b7197.]
-
-As it has been discussed in the past [1], running Weston
-without any input device at launch might be beneficial for
-some use cases.
-
-Certainly, it's best for the vast majority of users (and
-the project) to require an input device to be present, as
-to avoid frustration and hassle, but for those brave souls
-that so prefer, this patch lets them run without any input
-device at all.
-
-This introduces a simple configuration in weston.ini:
-  [core]
-  require-input=true
-
-True is the default, so no behavioral change is introduced.
-
-[1] https://lists.freedesktop.org/archives/wayland-devel/2015-November/025193.html
-
-Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
----
- man/weston.ini.man  | 5 +++++
- src/compositor.h    | 4 ++++
- src/libinput-seat.c | 6 ++++++
- src/main.c          | 5 +++++
- weston.ini.in       | 1 +
- 5 files changed, 21 insertions(+)
-
-diff --git a/man/weston.ini.man b/man/weston.ini.man
-index d7c4a6f..c7d0f01 100644
---- a/man/weston.ini.man
-+++ b/man/weston.ini.man
-@@ -169,6 +169,11 @@ time, the one specified in the command-line will be used. On the other
- hand, if none of these sets the value, default idle timeout will be
- set to 300 seconds.
- .RS
-+.PP
-+.RE
-+.TP 7
-+.BI "require-input=" true
-+require an input device for launch
- 
- .SH "LIBINPUT SECTION"
- The
-diff --git a/src/compositor.h b/src/compositor.h
-index 0bbf458..476b650 100644
---- a/src/compositor.h
-+++ b/src/compositor.h
-@@ -803,6 +803,10 @@ struct weston_compositor {
- 
- 	void *user_data;
- 	void (*exit)(struct weston_compositor *c);
-+
-+	/* Whether to let the compositor run without any input device. */
-+	bool require_input;
-+
- };
- 
- struct weston_buffer {
-diff --git a/src/libinput-seat.c b/src/libinput-seat.c
-index 8ce0ee0..e1fdcf0 100644
---- a/src/libinput-seat.c
-+++ b/src/libinput-seat.c
-@@ -255,6 +255,12 @@ udev_input_enable(struct udev_input *input)
- 			devices_found = 1;
- 	}
- 
-+	if (devices_found == 0 && !c->require_input) {
-+		weston_log("warning: no input devices found, but none required "
-+			   "as per configuration.\n");
-+		return 0;
-+	}
-+
- 	if (devices_found == 0) {
- 		weston_log(
- 			"warning: no input devices on entering Weston. "
-diff --git a/src/main.c b/src/main.c
-index 3279ac6..09905ea 100644
---- a/src/main.c
-+++ b/src/main.c
-@@ -1298,6 +1298,7 @@ int main(int argc, char *argv[])
- 	struct wl_client *primary_client;
- 	struct wl_listener primary_client_destroyed;
- 	struct weston_seat *seat;
-+	int require_input;
- 
- 	const struct weston_option core_options[] = {
- 		{ WESTON_OPTION_STRING, "backend", 'B', &backend },
-@@ -1373,6 +1374,10 @@ int main(int argc, char *argv[])
- 	if (weston_compositor_init_config(ec, config) < 0)
- 		goto out;
- 
-+	weston_config_section_get_bool(section, "require-input",
-+				       &require_input, true);
-+	ec->require_input = require_input;
-+
- 	if (load_backend(ec, backend, &argc, argv, config) < 0) {
- 		weston_log("fatal: failed to create compositor backend\n");
- 		goto out;
-diff --git a/weston.ini.in b/weston.ini.in
-index 14a4c0c..d837fb5 100644
---- a/weston.ini.in
-+++ b/weston.ini.in
-@@ -2,6 +2,7 @@
- #modules=xwayland.so,cms-colord.so
- #shell=desktop-shell.so
- #gbm-format=xrgb2101010
-+#require-input=true
- 
- [shell]
- background-image=/usr/share/backgrounds/gnome/Aqua.jpg
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch
new file mode 100644
index 0000000..c188018
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch
@@ -0,0 +1,55 @@
+Multi-plane sub-sampled textures have partial width/height, e.g.
+YUV420/I420 has a full-size Y plane, followed by a half-width/height U
+plane, and a half-width/height V plane.
+
+zwp_linux_dmabuf_v1 allows clients to pass an explicit pitch for each
+plane, but for wl_shm this must be inferred. gl-renderer was correctly
+accounting for the width and height when subsampling, but the pitch was
+being taken as the pitch for the first plane.
+
+This does not match the requirements for GStreamer's waylandsink, in
+particular, as well as other clients. Fix the SHM upload path to
+correctly set the pitch for each plane, according to subsampling.
+
+Tested with:
+  $ gst-launch-1.0 videotestsrc ! waylandsink
+
+Upstream-Status: Backport [https://patchwork.freedesktop.org/patch/180767/]
+
+Signed-off-by: Daniel Stone <daniels@collabora.com>
+Fixes: fdeefe42418 ("gl-renderer: add support of WL_SHM_FORMAT_YUV420")
+Reported-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103063
+
+---
+ libweston/gl-renderer.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
+index 244ce309..40bf0bb6 100644
+--- a/libweston/gl-renderer.c
++++ b/libweston/gl-renderer.c
+@@ -1285,14 +1285,13 @@ gl_renderer_flush_damage(struct weston_surface *surface)
+ 		goto done;
+ 	}
+ 
+-	glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch);
+-
+ 	if (gs->needs_full_upload) {
+ 		glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
+ 		glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
+ 		wl_shm_buffer_begin_access(buffer->shm_buffer);
+ 		for (j = 0; j < gs->num_textures; j++) {
+ 			glBindTexture(GL_TEXTURE_2D, gs->textures[j]);
++			glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch / gs->hsub[j]);
+ 			glTexImage2D(GL_TEXTURE_2D, 0,
+ 				     gs->gl_format[j],
+ 				     gs->pitch / gs->hsub[j],
+@@ -1317,6 +1316,7 @@ gl_renderer_flush_damage(struct weston_surface *surface)
+ 		glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, r.y1);
+ 		for (j = 0; j < gs->num_textures; j++) {
+ 			glBindTexture(GL_TEXTURE_2D, gs->textures[j]);
++			glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch / gs->hsub[j]);
+ 			glTexSubImage2D(GL_TEXTURE_2D, 0,
+ 					r.x1 / gs->hsub[j],
+ 					r.y1 / gs->vsub[j],
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston_1.11.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston_1.11.0.bb
deleted file mode 100644
index 9740ce9..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston_1.11.0.bb
+++ /dev/null
@@ -1,118 +0,0 @@
-SUMMARY = "Weston, a Wayland compositor"
-DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
-HOMEPAGE = "http://wayland.freedesktop.org"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
-                    file://src/compositor.c;endline=23;md5=1d535fed266cf39f6d8c0647f52ac331"
-
-SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
-           file://weston.png \
-           file://weston.desktop \
-           file://0001-make-error-portable.patch \
-           file://0001-configure.ac-Fix-wayland-protocols-path.patch \
-           file://0001-shared-include-stdint.h-for-int32_t.patch \
-           file://xwayland.weston-start \
-           file://make-weston-launch-exit-for-unrecognized-option.patch \
-           file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
-           file://weston-1.11-config-option-for-no-input-device.patch \
-"
-SRC_URI[md5sum] = "bc6f90a2039163804aecfa663b69c4c2"
-SRC_URI[sha256sum] = "05e086e9f186a06843b9f7a5e1abf19347b1a6e4be26d7e74927abc17b6b7125"
-
-inherit autotools pkgconfig useradd distro_features_check
-# depends on virtual/egl
-REQUIRED_DISTRO_FEATURES = "opengl"
-
-DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
-DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
-
-EXTRA_OECONF = "--enable-setuid-install \
-                --disable-rpi-compositor \
-                --disable-rdp-compositor \
-                WAYLAND_PROTOCOLS_SYSROOT_DIR=${STAGING_DIR}/${MACHINE} \
-                "
-EXTRA_OECONF[vardepsexclude] = "MACHINE"
-
-EXTRA_OECONF_append_qemux86 = "\
-		WESTON_NATIVE_BACKEND=fbdev-backend.so \
-		"
-EXTRA_OECONF_append_qemux86-64 = "\
-		WESTON_NATIVE_BACKEND=fbdev-backend.so \
-		"
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
-                   clients launch"
-#
-# Compositor choices
-#
-# Weston on KMS
-PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev"
-# Weston on Wayland (nested Weston)
-PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa"
-# Weston on X11
-PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
-# Headless Weston
-PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor"
-# Weston on framebuffer
-PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev"
-# weston-launch
-PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm"
-# VA-API desktop recorder
-PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva"
-# Weston with EGL support
-PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl"
-# Weston with cairo glesv2 support
-PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo"
-# Weston with lcms support
-PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms"
-# Weston with webp support
-PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp"
-# Weston with unwinding support
-PACKAGECONFIG[libunwind] = "--enable-libunwind,--disable-libunwind,libunwind"
-# Weston with systemd-login support
-PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus"
-# Weston with Xwayland support (requires X11 and Wayland)
-PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland"
-# colord CMS support
-PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord"
-# Clients support
-PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients"
-# Weston with PAM support
-PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
-
-do_install_append() {
-	# Weston doesn't need the .la files to load modules, so wipe them
-	rm -f ${D}/${libdir}/weston/*.la
-
-	# If X11, ship a desktop file to launch it
-	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" = "x11" ]; then
-		install -d ${D}${datadir}/applications
-		install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
-
-		install -d ${D}${datadir}/icons/hicolor/48x48/apps
-		install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
-	fi
-
-	if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
-		install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
-	fi
-}
-
-PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)}"
-PACKAGES += "${PN}-examples"
-
-FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}"
-FILES_${PN}-examples = "${bindir}/*"
-
-FILES_${PN}-xwayland = "${libdir}/${BPN}/xwayland.so"
-RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland"
-
-RDEPENDS_${PN} += "xkeyboard-config"
-RRECOMMENDS_${PN} = "liberation-fonts"
-RRECOMMENDS_${PN}-dev += "wayland-protocols"
-
-USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system weston-launch"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston_2.0.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston_2.0.0.bb
new file mode 100644
index 0000000..063494c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston_2.0.0.bb
@@ -0,0 +1,115 @@
+SUMMARY = "Weston, a Wayland compositor"
+DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
+                    file://libweston/compositor.c;endline=26;md5=e342df749174a8ee11065583157c7a38"
+
+SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+           file://weston.png \
+           file://weston.desktop \
+           file://0001-make-error-portable.patch \
+           file://0001-configure.ac-Fix-wayland-protocols-path.patch \
+           file://xwayland.weston-start \
+           file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
+           file://weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch \
+"
+SRC_URI[md5sum] = "15f38945942bf2a91fe2687145fb4c7d"
+SRC_URI[sha256sum] = "b4e446ac27f118196f1609dab89bb3cb3e81652d981414ad860e733b355365d8"
+
+inherit autotools pkgconfig useradd distro_features_check
+# depends on virtual/egl
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
+DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
+
+EXTRA_OECONF = "--enable-setuid-install \
+                --disable-rdp-compositor \
+                WAYLAND_PROTOCOLS_SYSROOT_DIR=${RECIPE_SYSROOT} \
+                "
+EXTRA_OECONF_append_qemux86 = "\
+		WESTON_NATIVE_BACKEND=fbdev-backend.so \
+		"
+EXTRA_OECONF_append_qemux86-64 = "\
+		WESTON_NATIVE_BACKEND=fbdev-backend.so \
+		"
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \
+                   clients launch"
+#
+# Compositor choices
+#
+# Weston on KMS
+PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev"
+# Weston on Wayland (nested Weston)
+PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa"
+# Weston on X11
+PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
+# Headless Weston
+PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor"
+# Weston on framebuffer
+PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev"
+# weston-launch
+PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm"
+# VA-API desktop recorder
+PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva"
+# Weston with EGL support
+PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl"
+# Weston with cairo glesv2 support
+PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo"
+# Weston with lcms support
+PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms"
+# Weston with webp support
+PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp"
+# Weston with unwinding support
+PACKAGECONFIG[libunwind] = "--enable-libunwind,--disable-libunwind,libunwind"
+# Weston with systemd-login support
+PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus"
+# Weston with Xwayland support (requires X11 and Wayland)
+PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland"
+# colord CMS support
+PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord"
+# Clients support
+PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients"
+# Weston with PAM support
+PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
+
+do_install_append() {
+	# Weston doesn't need the .la files to load modules, so wipe them
+	rm -f ${D}/${libdir}/libweston-2/*.la
+
+	# If X11, ship a desktop file to launch it
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
+		install -d ${D}${datadir}/applications
+		install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
+
+		install -d ${D}${datadir}/icons/hicolor/48x48/apps
+		install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
+	fi
+
+	if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
+		install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
+	fi
+}
+
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \
+             libweston-2 ${PN}-examples"
+
+FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}"
+
+FILES_libweston-2 = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-2/*.so"
+SUMMARY_libweston-2 = "Helper library for implementing 'wayland window managers'."
+
+FILES_${PN}-examples = "${bindir}/*"
+
+FILES_${PN}-xwayland = "${libdir}/libweston-2/xwayland.so"
+RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland"
+
+RDEPENDS_${PN} += "xkeyboard-config"
+RRECOMMENDS_${PN} = "liberation-fonts"
+RRECOMMENDS_${PN}-dev += "wayland-protocols"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system weston-launch"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults
deleted file mode 100644
index f5b69dd..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults
+++ /dev/null
@@ -1,3 +0,0 @@
-Rxvt*scrollBar_right: true
-Rxvt*font: xft:Mono:pixelsize=9
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh
deleted file mode 100644
index a9d102c..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-# kdrive 1.4 does not have default keymap in server
-#xmodmap - </etc/X11/default.xmodmap
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap
deleted file mode 100644
index 05a13fa..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap
+++ /dev/null
@@ -1,260 +0,0 @@
-keycode   8 =
-keycode   9 = Escape
-keycode  10 = 1 exclam
-keycode  11 = 2 at
-keycode  12 = 3 numbersign
-keycode  13 = 4 dollar
-keycode  14 = 5 percent
-keycode  15 = 6 asciicircum
-keycode  16 = 7 ampersand braceleft
-keycode  17 = 8 asterisk bracketleft
-keycode  18 = 9 parenleft bracketright
-keycode  19 = 0 parenright braceright
-keycode  20 = minus underscore backslash
-keycode  21 = equal plus
-keycode  22 = BackSpace
-keycode  23 = Tab
-keycode  24 = q Q q
-keycode  25 = w W w
-keycode  26 = e E
-keycode  27 = r R r
-keycode  28 = t T t
-keycode  29 = y Y y
-keycode  30 = u U u
-keycode  31 = i I i
-keycode  32 = o O o
-keycode  33 = p P p
-keycode  34 = bracketleft braceleft
-keycode  35 = bracketright braceright asciitilde
-keycode  36 = Return
-keycode  37 = Control_L
-keycode  38 = a A
-keycode  39 = s S s
-keycode  40 = d D
-keycode  41 = f F
-keycode  42 = g G g
-keycode  43 = h H h
-keycode  44 = j J j
-keycode  45 = k K k
-keycode  46 = l L l
-keycode  47 = semicolon colon
-keycode  48 = apostrophe quotedbl
-keycode  49 = grave asciitilde
-keycode  50 = Shift_L
-keycode  51 = backslash bar
-keycode  52 = z Z z
-keycode  53 = x X x
-keycode  54 = c C
-keycode  55 = v V v
-keycode  56 = b B
-keycode  57 = n N n
-keycode  58 = m M m
-keycode  59 = comma less
-keycode  60 = period greater
-keycode  61 = slash question
-keycode  62 = Shift_R
-keycode  63 = KP_Multiply
-keycode  64 = Alt_L
-keycode  65 = space
-keycode  66 = Caps_Lock
-keycode  67 = F1 F11
-keycode  68 = F2 F12
-keycode  69 = F3 F13
-keycode  70 = F4 F14
-keycode  71 = F5 F15
-keycode  72 = F6 F16
-keycode  73 = F7 F17
-keycode  74 = F8 F18
-keycode  75 = F9 F19
-keycode  76 = F10 F20
-keycode  77 = Num_Lock
-keycode  78 = Scroll_Lock
-keycode  79 = KP_7
-keycode  80 = KP_8
-keycode  81 = KP_9
-keycode  82 = KP_Subtract
-keycode  83 = KP_4
-keycode  84 = KP_5
-keycode  85 = KP_6
-keycode  86 = KP_Add
-keycode  87 = KP_1
-keycode  88 = KP_2
-keycode  89 = KP_3
-keycode  90 = KP_0
-keycode  91 = KP_Decimal
-keycode  92 =
-keycode  93 =
-keycode  94 = less greater bar
-keycode  95 = F11
-keycode  96 = F12
-keycode  97 =
-keycode  98 =
-keycode  99 =
-keycode 100 =
-keycode 101 =
-keycode 102 =
-keycode 103 =
-keycode 104 = KP_Enter
-keycode 105 = Control_R
-keycode 106 = KP_Divide
-keycode 107 =
-keycode 108 = Mode_switch
-keycode 109 = Break
-keycode 110 = Home
-keycode 111 = Up
-keycode 112 = Prior
-keycode 113 = Left
-keycode 114 = Right
-keycode 115 = End
-keycode 116 = Down
-keycode 117 = Next
-keycode 118 = Insert
-keycode 119 = Delete
-keycode 120 = Menu
-keycode 121 = F13
-keycode 122 = F14
-keycode 123 = Help
-keycode 124 = Execute
-keycode 125 = F17
-keycode 126 = KP_Subtract
-keycode 127 = Pause
-keycode 128 =
-keycode 129 =
-keycode 130 =
-keycode 131 =
-keycode 132 =
-keycode 133 =
-keycode 134 =
-keycode 135 =
-keycode 136 =
-keycode 137 =
-keycode 138 =
-keycode 139 =
-keycode 140 =
-keycode 141 =
-keycode 142 =
-keycode 143 =
-keycode 144 =
-keycode 145 =
-keycode 146 =
-keycode 147 =
-keycode 148 =
-keycode 149 =
-keycode 150 =
-keycode 151 =
-keycode 152 =
-keycode 153 =
-keycode 154 =
-keycode 155 =
-keycode 156 =
-keycode 157 =
-keycode 158 =
-keycode 159 =
-keycode 160 =
-keycode 161 =
-keycode 162 =
-keycode 163 =
-keycode 164 =
-keycode 165 =
-keycode 166 =
-keycode 167 =
-keycode 168 =
-keycode 169 =
-keycode 170 =
-keycode 171 =
-keycode 172 =
-keycode 173 =
-keycode 174 =
-keycode 175 =
-keycode 176 =
-keycode 177 =
-keycode 178 =
-keycode 179 =
-keycode 180 =
-keycode 181 =
-keycode 182 =
-keycode 183 =
-keycode 184 =
-keycode 185 =
-keycode 186 =
-keycode 187 =
-keycode 188 =
-keycode 189 =
-keycode 190 =
-keycode 191 =
-keycode 192 =
-keycode 193 =
-keycode 194 =
-keycode 195 =
-keycode 196 =
-keycode 197 =
-keycode 198 =
-keycode 199 =
-keycode 200 =
-keycode 201 =
-keycode 202 =
-keycode 203 =
-keycode 204 =
-keycode 205 =
-keycode 206 =
-keycode 207 =
-keycode 208 =
-keycode 209 =
-keycode 210 =
-keycode 211 =
-keycode 212 =
-keycode 213 =
-keycode 214 =
-keycode 215 =
-keycode 216 =
-keycode 217 =
-keycode 218 =
-keycode 219 =
-keycode 220 =
-keycode 221 =
-keycode 222 =
-keycode 223 =
-keycode 224 =
-keycode 225 =
-keycode 226 =
-keycode 227 =
-keycode 228 =
-keycode 229 =
-keycode 230 =
-keycode 231 =
-keycode 232 =
-keycode 233 =
-keycode 234 =
-keycode 235 =
-keycode 236 =
-keycode 237 =
-keycode 238 =
-keycode 239 =
-keycode 240 =
-keycode 241 =
-keycode 242 =
-keycode 243 =
-keycode 244 =
-keycode 245 =
-keycode 246 =
-keycode 247 =
-keycode 248 =
-keycode 249 =
-keycode 250 =
-keycode 251 =
-keycode 252 =
-keycode 253 =
-keycode 254 =
-
-add shift = Shift_L
-add shift = Shift_R
-add shift = Menu
-add lock = Caps_Lock
-add control = Control_L
-add control = Control_R
-add mod1 = Alt_L
-add mod2 = Num_Lock
-!mod3      
-add mod4 = Mode_switch
-!mod5      
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch
deleted file mode 100644
index eff975e..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch
+++ /dev/null
@@ -1,355 +0,0 @@
-COPYING: add GPLv2 license file
-
-this is a local file recipe and the license file is missing.In order
-to pass the license checksum checking, the license file is needed. So
-this patch add the GPLv2 license file.
-
-Upstream-Status: Inappropriate [licensing]
-
-Signed-off-by: Yu Ke <ke.yu@intel.com>
-
-diff --git a/COPYING b/COPYING
-new file mode 100644
-index 0000000..d511905
---- /dev/null
-+++ b/COPYING
-@@ -0,0 +1,339 @@
-+		    GNU GENERAL PUBLIC LICENSE
-+		       Version 2, June 1991
-+
-+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
-+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+ Everyone is permitted to copy and distribute verbatim copies
-+ of this license document, but changing it is not allowed.
-+
-+			    Preamble
-+
-+  The licenses for most software are designed to take away your
-+freedom to share and change it.  By contrast, the GNU General Public
-+License is intended to guarantee your freedom to share and change free
-+software--to make sure the software is free for all its users.  This
-+General Public License applies to most of the Free Software
-+Foundation's software and to any other program whose authors commit to
-+using it.  (Some other Free Software Foundation software is covered by
-+the GNU Lesser General Public License instead.)  You can apply it to
-+your programs, too.
-+
-+  When we speak of free software, we are referring to freedom, not
-+price.  Our General Public Licenses are designed to make sure that you
-+have the freedom to distribute copies of free software (and charge for
-+this service if you wish), that you receive source code or can get it
-+if you want it, that you can change the software or use pieces of it
-+in new free programs; and that you know you can do these things.
-+
-+  To protect your rights, we need to make restrictions that forbid
-+anyone to deny you these rights or to ask you to surrender the rights.
-+These restrictions translate to certain responsibilities for you if you
-+distribute copies of the software, or if you modify it.
-+
-+  For example, if you distribute copies of such a program, whether
-+gratis or for a fee, you must give the recipients all the rights that
-+you have.  You must make sure that they, too, receive or can get the
-+source code.  And you must show them these terms so they know their
-+rights.
-+
-+  We protect your rights with two steps: (1) copyright the software, and
-+(2) offer you this license which gives you legal permission to copy,
-+distribute and/or modify the software.
-+
-+  Also, for each author's protection and ours, we want to make certain
-+that everyone understands that there is no warranty for this free
-+software.  If the software is modified by someone else and passed on, we
-+want its recipients to know that what they have is not the original, so
-+that any problems introduced by others will not reflect on the original
-+authors' reputations.
-+
-+  Finally, any free program is threatened constantly by software
-+patents.  We wish to avoid the danger that redistributors of a free
-+program will individually obtain patent licenses, in effect making the
-+program proprietary.  To prevent this, we have made it clear that any
-+patent must be licensed for everyone's free use or not licensed at all.
-+
-+  The precise terms and conditions for copying, distribution and
-+modification follow.
-+
-+		    GNU GENERAL PUBLIC LICENSE
-+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-+
-+  0. This License applies to any program or other work which contains
-+a notice placed by the copyright holder saying it may be distributed
-+under the terms of this General Public License.  The "Program", below,
-+refers to any such program or work, and a "work based on the Program"
-+means either the Program or any derivative work under copyright law:
-+that is to say, a work containing the Program or a portion of it,
-+either verbatim or with modifications and/or translated into another
-+language.  (Hereinafter, translation is included without limitation in
-+the term "modification".)  Each licensee is addressed as "you".
-+
-+Activities other than copying, distribution and modification are not
-+covered by this License; they are outside its scope.  The act of
-+running the Program is not restricted, and the output from the Program
-+is covered only if its contents constitute a work based on the
-+Program (independent of having been made by running the Program).
-+Whether that is true depends on what the Program does.
-+
-+  1. You may copy and distribute verbatim copies of the Program's
-+source code as you receive it, in any medium, provided that you
-+conspicuously and appropriately publish on each copy an appropriate
-+copyright notice and disclaimer of warranty; keep intact all the
-+notices that refer to this License and to the absence of any warranty;
-+and give any other recipients of the Program a copy of this License
-+along with the Program.
-+
-+You may charge a fee for the physical act of transferring a copy, and
-+you may at your option offer warranty protection in exchange for a fee.
-+
-+  2. You may modify your copy or copies of the Program or any portion
-+of it, thus forming a work based on the Program, and copy and
-+distribute such modifications or work under the terms of Section 1
-+above, provided that you also meet all of these conditions:
-+
-+    a) You must cause the modified files to carry prominent notices
-+    stating that you changed the files and the date of any change.
-+
-+    b) You must cause any work that you distribute or publish, that in
-+    whole or in part contains or is derived from the Program or any
-+    part thereof, to be licensed as a whole at no charge to all third
-+    parties under the terms of this License.
-+
-+    c) If the modified program normally reads commands interactively
-+    when run, you must cause it, when started running for such
-+    interactive use in the most ordinary way, to print or display an
-+    announcement including an appropriate copyright notice and a
-+    notice that there is no warranty (or else, saying that you provide
-+    a warranty) and that users may redistribute the program under
-+    these conditions, and telling the user how to view a copy of this
-+    License.  (Exception: if the Program itself is interactive but
-+    does not normally print such an announcement, your work based on
-+    the Program is not required to print an announcement.)
-+
-+These requirements apply to the modified work as a whole.  If
-+identifiable sections of that work are not derived from the Program,
-+and can be reasonably considered independent and separate works in
-+themselves, then this License, and its terms, do not apply to those
-+sections when you distribute them as separate works.  But when you
-+distribute the same sections as part of a whole which is a work based
-+on the Program, the distribution of the whole must be on the terms of
-+this License, whose permissions for other licensees extend to the
-+entire whole, and thus to each and every part regardless of who wrote it.
-+
-+Thus, it is not the intent of this section to claim rights or contest
-+your rights to work written entirely by you; rather, the intent is to
-+exercise the right to control the distribution of derivative or
-+collective works based on the Program.
-+
-+In addition, mere aggregation of another work not based on the Program
-+with the Program (or with a work based on the Program) on a volume of
-+a storage or distribution medium does not bring the other work under
-+the scope of this License.
-+
-+  3. You may copy and distribute the Program (or a work based on it,
-+under Section 2) in object code or executable form under the terms of
-+Sections 1 and 2 above provided that you also do one of the following:
-+
-+    a) Accompany it with the complete corresponding machine-readable
-+    source code, which must be distributed under the terms of Sections
-+    1 and 2 above on a medium customarily used for software interchange; or,
-+
-+    b) Accompany it with a written offer, valid for at least three
-+    years, to give any third party, for a charge no more than your
-+    cost of physically performing source distribution, a complete
-+    machine-readable copy of the corresponding source code, to be
-+    distributed under the terms of Sections 1 and 2 above on a medium
-+    customarily used for software interchange; or,
-+
-+    c) Accompany it with the information you received as to the offer
-+    to distribute corresponding source code.  (This alternative is
-+    allowed only for noncommercial distribution and only if you
-+    received the program in object code or executable form with such
-+    an offer, in accord with Subsection b above.)
-+
-+The source code for a work means the preferred form of the work for
-+making modifications to it.  For an executable work, complete source
-+code means all the source code for all modules it contains, plus any
-+associated interface definition files, plus the scripts used to
-+control compilation and installation of the executable.  However, as a
-+special exception, the source code distributed need not include
-+anything that is normally distributed (in either source or binary
-+form) with the major components (compiler, kernel, and so on) of the
-+operating system on which the executable runs, unless that component
-+itself accompanies the executable.
-+
-+If distribution of executable or object code is made by offering
-+access to copy from a designated place, then offering equivalent
-+access to copy the source code from the same place counts as
-+distribution of the source code, even though third parties are not
-+compelled to copy the source along with the object code.
-+
-+  4. You may not copy, modify, sublicense, or distribute the Program
-+except as expressly provided under this License.  Any attempt
-+otherwise to copy, modify, sublicense or distribute the Program is
-+void, and will automatically terminate your rights under this License.
-+However, parties who have received copies, or rights, from you under
-+this License will not have their licenses terminated so long as such
-+parties remain in full compliance.
-+
-+  5. You are not required to accept this License, since you have not
-+signed it.  However, nothing else grants you permission to modify or
-+distribute the Program or its derivative works.  These actions are
-+prohibited by law if you do not accept this License.  Therefore, by
-+modifying or distributing the Program (or any work based on the
-+Program), you indicate your acceptance of this License to do so, and
-+all its terms and conditions for copying, distributing or modifying
-+the Program or works based on it.
-+
-+  6. Each time you redistribute the Program (or any work based on the
-+Program), the recipient automatically receives a license from the
-+original licensor to copy, distribute or modify the Program subject to
-+these terms and conditions.  You may not impose any further
-+restrictions on the recipients' exercise of the rights granted herein.
-+You are not responsible for enforcing compliance by third parties to
-+this License.
-+
-+  7. If, as a consequence of a court judgment or allegation of patent
-+infringement or for any other reason (not limited to patent issues),
-+conditions are imposed on you (whether by court order, agreement or
-+otherwise) that contradict the conditions of this License, they do not
-+excuse you from the conditions of this License.  If you cannot
-+distribute so as to satisfy simultaneously your obligations under this
-+License and any other pertinent obligations, then as a consequence you
-+may not distribute the Program at all.  For example, if a patent
-+license would not permit royalty-free redistribution of the Program by
-+all those who receive copies directly or indirectly through you, then
-+the only way you could satisfy both it and this License would be to
-+refrain entirely from distribution of the Program.
-+
-+If any portion of this section is held invalid or unenforceable under
-+any particular circumstance, the balance of the section is intended to
-+apply and the section as a whole is intended to apply in other
-+circumstances.
-+
-+It is not the purpose of this section to induce you to infringe any
-+patents or other property right claims or to contest validity of any
-+such claims; this section has the sole purpose of protecting the
-+integrity of the free software distribution system, which is
-+implemented by public license practices.  Many people have made
-+generous contributions to the wide range of software distributed
-+through that system in reliance on consistent application of that
-+system; it is up to the author/donor to decide if he or she is willing
-+to distribute software through any other system and a licensee cannot
-+impose that choice.
-+
-+This section is intended to make thoroughly clear what is believed to
-+be a consequence of the rest of this License.
-+
-+  8. If the distribution and/or use of the Program is restricted in
-+certain countries either by patents or by copyrighted interfaces, the
-+original copyright holder who places the Program under this License
-+may add an explicit geographical distribution limitation excluding
-+those countries, so that distribution is permitted only in or among
-+countries not thus excluded.  In such case, this License incorporates
-+the limitation as if written in the body of this License.
-+
-+  9. The Free Software Foundation may publish revised and/or new versions
-+of the General Public License from time to time.  Such new versions will
-+be similar in spirit to the present version, but may differ in detail to
-+address new problems or concerns.
-+
-+Each version is given a distinguishing version number.  If the Program
-+specifies a version number of this License which applies to it and "any
-+later version", you have the option of following the terms and conditions
-+either of that version or of any later version published by the Free
-+Software Foundation.  If the Program does not specify a version number of
-+this License, you may choose any version ever published by the Free Software
-+Foundation.
-+
-+  10. If you wish to incorporate parts of the Program into other free
-+programs whose distribution conditions are different, write to the author
-+to ask for permission.  For software which is copyrighted by the Free
-+Software Foundation, write to the Free Software Foundation; we sometimes
-+make exceptions for this.  Our decision will be guided by the two goals
-+of preserving the free status of all derivatives of our free software and
-+of promoting the sharing and reuse of software generally.
-+
-+			    NO WARRANTY
-+
-+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-+REPAIR OR CORRECTION.
-+
-+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-+POSSIBILITY OF SUCH DAMAGES.
-+
-+		     END OF TERMS AND CONDITIONS
-+
-+	    How to Apply These Terms to Your New Programs
-+
-+  If you develop a new program, and you want it to be of the greatest
-+possible use to the public, the best way to achieve this is to make it
-+free software which everyone can redistribute and change under these terms.
-+
-+  To do so, attach the following notices to the program.  It is safest
-+to attach them to the start of each source file to most effectively
-+convey the exclusion of warranty; and each file should have at least
-+the "copyright" line and a pointer to where the full notice is found.
-+
-+    <one line to give the program's name and a brief idea of what it does.>
-+    Copyright (C) <year>  <name of author>
-+
-+    This program is free software; you can redistribute it and/or modify
-+    it under the terms of the GNU General Public License as published by
-+    the Free Software Foundation; either version 2 of the License, or
-+    (at your option) any later version.
-+
-+    This program is distributed in the hope that it will be useful,
-+    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+    GNU General Public License for more details.
-+
-+    You should have received a copy of the GNU General Public License along
-+    with this program; if not, write to the Free Software Foundation, Inc.,
-+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-+
-+Also add information on how to contact you by electronic and paper mail.
-+
-+If the program is interactive, make it output a short notice like this
-+when it starts in an interactive mode:
-+
-+    Gnomovision version 69, Copyright (C) year name of author
-+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-+    This is free software, and you are welcome to redistribute it
-+    under certain conditions; type `show c' for details.
-+
-+The hypothetical commands `show w' and `show c' should show the appropriate
-+parts of the General Public License.  Of course, the commands you use may
-+be called something other than `show w' and `show c'; they could even be
-+mouse-clicks or menu items--whatever suits your program.
-+
-+You should also get your employer (if you work as a programmer) or your
-+school, if any, to sign a "copyright disclaimer" for the program, if
-+necessary.  Here is a sample; alter the names:
-+
-+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-+
-+  <signature of Ty Coon>, 1 April 1989
-+  Ty Coon, President of Vice
-+
-+This General Public License does not permit incorporating your program into
-+proprietary programs.  If your program is a subroutine library, you may
-+consider it more useful to permit linking proprietary applications with the
-+library.  If this is what you want to do, use the GNU Lesser General
-+Public License instead of this License.
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common_0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common_0.1.bb
deleted file mode 100644
index ab9a939..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common_0.1.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-SUMMARY = "Common X11 scripts and configuration files"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-SECTION = "x11"
-PR = "r47"
-
-inherit distro_features_check
-# rdepends on xdypinfo xmodmap xinit
-REQUIRED_DISTRO_FEATURES = "x11"
-
-SRC_URI = "file://etc \
-           file://gplv2-license.patch"
-
-S = "${WORKDIR}"
-
-do_install() {
-	cp -R ${S}/etc ${D}${sysconfdir}
-	chmod -R 755 ${D}${sysconfdir}
-}
-
-RDEPENDS_${PN} = "dbus-x11 xmodmap xdpyinfo xinput-calibrator formfactor"
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init.bb b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
deleted file mode 100644
index a6d0d5e..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
+++ /dev/null
@@ -1,61 +0,0 @@
-SUMMARY = "Simple Xserver Init Script (no dm)"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-SECTION = "x11"
-PR = "r31"
-
-SRC_URI = "file://xserver-nodm \
-           file://Xserver \
-           file://gplv2-license.patch \
-           file://xserver-nodm.service.in \
-           file://xserver-nodm.conf.in \
-"
-
-S = "${WORKDIR}"
-
-# Since we refer to ROOTLESS_X which is normally enabled per-machine
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-inherit update-rc.d systemd distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "x11"
-
-PACKAGECONFIG ??= "blank"
-# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
-PACKAGECONFIG[blank] = ""
-
-do_install() {
-    install -d ${D}${sysconfdir}/default
-    install xserver-nodm.conf.in ${D}${sysconfdir}/default/xserver-nodm
-    install -d ${D}${sysconfdir}/xserver-nodm
-    install Xserver ${D}${sysconfdir}/xserver-nodm/Xserver
-
-    BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}"
-    if [ "${ROOTLESS_X}" = "1" ] ; then
-        XUSER_HOME="/home/xuser"
-        XUSER="xuser"
-    else
-        XUSER_HOME=${ROOT_HOME}
-        XUSER="root"
-    fi
-    sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \
-        ${D}${sysconfdir}/default/xserver-nodm
-
-    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-        install -d ${D}${systemd_unitdir}/system
-        install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service
-        sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service
-    fi
-
-    if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
-        install -d ${D}${sysconfdir}/init.d
-        install xserver-nodm ${D}${sysconfdir}/init.d
-    fi
-}
-
-RDEPENDS_${PN} = "xinit ${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
-
-INITSCRIPT_NAME = "xserver-nodm"
-INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
-SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession
rename to import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/13xdgbasedirs.sh
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh
rename to import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/13xdgbasedirs.sh
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/89xdgautostart.sh b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/89xdgautostart.sh
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/89xdgautostart.sh
rename to import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/89xdgautostart.sh
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/90XWindowManager.sh
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh
rename to import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/90XWindowManager.sh
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in
index 757c23d..4a9670d 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in
@@ -2,6 +2,6 @@
 
 XSERVER=/usr/bin/Xorg
 DISPLAY=:0
-ARGS=" -br -pn @BLANK_ARGS@ "
+ARGS=" -br -pn @BLANK_ARGS@ @NO_CURSOR_ARG@ "
 HOME=@HOME@
 USER=@USER@
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
new file mode 100644
index 0000000..345b589
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
@@ -0,0 +1,69 @@
+SUMMARY = "Simple Xserver Init Script (no dm)"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+SECTION = "x11"
+PR = "r31"
+
+SRC_URI = "file://xserver-nodm \
+           file://Xserver \
+           file://X11 \
+           file://gplv2-license.patch \
+           file://xserver-nodm.service.in \
+           file://xserver-nodm.conf.in \
+"
+
+S = "${WORKDIR}"
+
+# Since we refer to ROOTLESS_X which is normally enabled per-machine
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit update-rc.d systemd distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGECONFIG ??= "blank"
+# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
+PACKAGECONFIG[blank] = ""
+PACKAGECONFIG[nocursor] = ""
+
+do_install() {
+    install -d ${D}${sysconfdir}/default
+    install xserver-nodm.conf.in ${D}${sysconfdir}/default/xserver-nodm
+    install -d ${D}${sysconfdir}/xserver-nodm
+    install Xserver ${D}${sysconfdir}/xserver-nodm/Xserver
+    install -d ${D}${sysconfdir}/X11/Xsession.d
+    install X11/Xsession.d/* ${D}${sysconfdir}/X11/Xsession.d/
+    install X11/Xsession ${D}${sysconfdir}/X11/
+
+    BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}"
+    NO_CURSOR_ARG="${@bb.utils.contains('PACKAGECONFIG', 'nocursor', '-nocursor', '', d)}"
+    if [ "${ROOTLESS_X}" = "1" ] ; then
+        XUSER_HOME="/home/xuser"
+        XUSER="xuser"
+    else
+        XUSER_HOME=${ROOT_HOME}
+        XUSER="root"
+    fi
+    sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \
+        ${D}${sysconfdir}/default/xserver-nodm
+    sed -i "s:@NO_CURSOR_ARG@:${NO_CURSOR_ARG}:" ${D}${sysconfdir}/default/xserver-nodm
+
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        install -d ${D}${systemd_unitdir}/system
+        install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service
+        sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service
+    fi
+
+    if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+        install -d ${D}${sysconfdir}/init.d
+        install xserver-nodm ${D}${sysconfdir}/init.d
+    fi
+}
+
+RDEPENDS_${PN} = "xinit ${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
+
+INITSCRIPT_NAME = "xserver-nodm"
+INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
+SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
+
+RCONFLICTS_${PN} = "xserver-common (< 1.34-r9) x11-common"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/add-geometry-input-when-calibrating.patch b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/add-geometry-input-when-calibrating.patch
deleted file mode 100644
index 9dc94ae..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/add-geometry-input-when-calibrating.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 1cb83759632bb218559c4d0d65ff79f868c03dc5 Mon Sep 17 00:00:00 2001
-From: "Maxin B. John" <maxin.john@intel.com>
-Date: Tue, 9 Aug 2016 17:03:31 +0300
-Subject: [PATCH] add geometry input when calibrating
-
-Send monitor geometry to xinput_calibrator when running the script
-Update:
-        Remove bashism
-
-Upstream-Status: Inappropriate [no longer maintained]
-
-Signed-off-by: Jonathan David <jonathan.david@ni.com>
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
- scripts/xinput_calibrator_pointercal.sh | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/scripts/xinput_calibrator_pointercal.sh b/scripts/xinput_calibrator_pointercal.sh
-index fccb197..fea7c2f 100755
---- a/scripts/xinput_calibrator_pointercal.sh
-+++ b/scripts/xinput_calibrator_pointercal.sh
-@@ -24,7 +24,8 @@ if [ -e $CALFILE ] ; then
-   fi
- fi
- 
--CALDATA=`$BINARY --output-type xinput -v | tee $LOGFILE | grep '    xinput set' | sed 's/^    //g; s/$/;/g'`
-+RESOLUTION=$(xrandr | awk -F '[[:space:]+]' '/ connected/ { if ($3 != "primary") print $3; if ($3 == "primary") print $4 }')
-+CALDATA=`$BINARY --geometry $RESOLUTION --output-type xinput -v | tee $LOGFILE | grep '    xinput set' | sed 's/^    //g; s/$/;/g'`
- if [ ! -z "$CALDATA" ] ; then
-   echo $CALDATA > $CALFILE
-   echo "Calibration data stored in $CALFILE (log in $LOGFILE)"
--- 
-2.4.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
index 57c3a7a..68e62ea 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
@@ -2,7 +2,7 @@
 HOMEPAGE = "http://www.freedesktop.org/wiki/Software/xinput_calibrator"
 LICENSE = "MIT-X"
 LIC_FILES_CHKSUM = "file://src/calibrator.cpp;endline=22;md5=1bcba08f67cdb56f34021557898e4b5a"
-DEPENDS = "virtual/libx11 libxi"
+DEPENDS = "virtual/libx11 libxi libxrandr"
 
 PV = "0.7.5+git${SRCPV}"
 PR = "r6"
@@ -11,11 +11,10 @@
 # depends on virtual/libx11
 REQUIRED_DISTRO_FEATURES = "x11"
 
-SRCREV = "c01c5af807cb4b0157b882ab07a893df9a810111"
+SRCREV = "03dadf55109bd43d3380f040debe9f82f66f2f35"
 SRC_URI = "git://github.com/tias/xinput_calibrator.git \
            file://30xinput_calibrate.sh \
-           file://Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch \
-           file://add-geometry-input-when-calibrating.patch"
+           file://Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch"
 
 S = "${WORKDIR}/git"
 
@@ -34,5 +33,5 @@
 }
 
 FILES_${PN} += "${sysconfdir}/xdg/autostart"
-RDEPENDS_${PN} = "xinput formfactor xrandr"
+RDEPENDS_${PN} = "xinput formfactor"
 RRECOMMENDS_${PN} = "pointercal-xinput"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb
index 737bc9d..a453e24 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb
@@ -11,9 +11,6 @@
 PE = "1"
 PR = "${INC_PR}.0"
 
-DEPENDS = "util-macros-native"
-REQUIRED_DISTRO_FEATURES_class-native = ""
-
 RDEPENDS_${PN} += "mkfontscale"
 RDEPENDS_${PN}_class-native += "mkfontscale-native"
 
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb
index d1aa9b3..31cf186 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb
@@ -10,8 +10,6 @@
 
 DEPENDS = "util-macros-native zlib libfontenc freetype xproto"
 
-REQUIRED_DISTRO_FEATURES_class-native = ""
-
 BBCLASSEXTEND = "native"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=2e0d129d05305176d1a790e0ac1acb7f"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xauth_1.0.10.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xauth_1.0.10.bb
new file mode 100644
index 0000000..0e90ffd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xauth_1.0.10.bb
@@ -0,0 +1,15 @@
+require xorg-app-common.inc
+SUMMARY = "X authority utilities"
+DESCRIPTION = "X application to edit and display the authorization \
+information used in connecting to the X server."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5ec74dd7ea4d10c4715a7c44f159a40b"
+
+DEPENDS += "libxau libxext libxmu"
+PE = "1"
+
+SRC_URI[md5sum] = "f3f76cb10f69b571c43893ea6a634aa4"
+SRC_URI[sha256sum] = "5afe42ce3cdf4f60520d1658d2b17face45c74050f39af45dccdc95e73fafc4d"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xauth_1.0.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xauth_1.0.9.bb
deleted file mode 100644
index 59b3323..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xauth_1.0.9.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-require xorg-app-common.inc
-SUMMARY = "X authority utilities"
-DESCRIPTION = "X application to edit and display the authorization \
-information used in connecting to the X server."
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=5ec74dd7ea4d10c4715a7c44f159a40b"
-
-DEPENDS += "libxau libxext libxmu"
-PE = "1"
-
-SRC_URI[md5sum] = "7d6003f32838d5b688e2c8a131083271"
-SRC_URI[sha256sum] = "56ce1523eb48b1f8a4f4244fe1c3d8e6af1a3b7d4b0e6063582421b0b68dc28f"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb
index f23d258..77490f5 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb
@@ -16,5 +16,5 @@
 SRC_URI[md5sum] = "f5d490738b148cb7f2fe760f40f92516"
 SRC_URI[sha256sum] = "93e619ee15471f576cfb30c663e18f5bc70aca577a63d2c2c03f006a7837c29a"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.3.bb
deleted file mode 100644
index f81c3ec..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.3.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-require xorg-driver-input.inc
-
-SUMMARY = "X.Org X server -- event devices (evdev) input driver"
-
-DESCRIPTION = "evdev is an Xorg input driver for Linux's generic event \
-devices. It therefore supports all input devices that the kernel knows \
-about, including most mice and keyboards. \
-\
-The evdev driver can serve as both a pointer and a keyboard input \
-device, and may be used as both the core keyboard and the core pointer. \
-Multiple input devices are supported by multiple instances of this \
-driver, with one Load directive for evdev in the Module section of your \
-xorg.conf for each input device that will use this driver. "
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=fefe33b1cf0cacba0e72e3b0fa0f0e16"
-
-DEPENDS += "mtdev libevdev"
-
-SRC_URI[md5sum] = "aa3363ce5061d0c4d1e7f7019b99716d"
-SRC_URI[sha256sum] = "5aa21ba4be8df927e5676a99c7f4f0343abc089f5451b7e73e39536f29b332a2"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.5.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.5.bb
new file mode 100644
index 0000000..96b220c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.5.bb
@@ -0,0 +1,21 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- event devices (evdev) input driver"
+
+DESCRIPTION = "evdev is an Xorg input driver for Linux's generic event \
+devices. It therefore supports all input devices that the kernel knows \
+about, including most mice and keyboards. \
+\
+The evdev driver can serve as both a pointer and a keyboard input \
+device, and may be used as both the core keyboard and the core pointer. \
+Multiple input devices are supported by multiple instances of this \
+driver, with one Load directive for evdev in the Module section of your \
+xorg.conf for each input device that will use this driver. "
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=fefe33b1cf0cacba0e72e3b0fa0f0e16"
+
+DEPENDS += "mtdev libevdev"
+
+SRC_URI[md5sum] = "94c2c8354c74ab1cfbbb0a222078b9c6"
+SRC_URI[sha256sum] = "9edaa6205baf6d2922cc4db3d8e54a7e7773b5f733b0ae90f6be7725f983b70d"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.8.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.8.1.bb
deleted file mode 100644
index 6fe51ac..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.8.1.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require xorg-driver-input.inc
-
-SUMMARY = "X.Org X server -- keyboard input driver"
-
-DESCRIPTION = "keyboard is an Xorg input driver for keyboards. The \
-driver supports the standard OS-provided keyboard interface.  The driver \
-functions as a keyboard input device, and may be used as the X server's \
-core keyboard."
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=ea2099d24ac9e316a6d4b9f20b3d4e10"
-
-SRC_URI[md5sum] = "96ccc43d389b970afbd3893875dfd678"
-SRC_URI[sha256sum] = "1ac8ff39bf9da7d2fc7fd6c24515726e8138340c0518ab8c606e008cf93ca211"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.9.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.9.0.bb
new file mode 100644
index 0000000..1896fff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.9.0.bb
@@ -0,0 +1,13 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- keyboard input driver"
+
+DESCRIPTION = "keyboard is an Xorg input driver for keyboards. The \
+driver supports the standard OS-provided keyboard interface.  The driver \
+functions as a keyboard input device, and may be used as the X server's \
+core keyboard."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea2099d24ac9e316a6d4b9f20b3d4e10"
+
+SRC_URI[md5sum] = "a3a3f0dd32361dcdbd406e894dafe090"
+SRC_URI[sha256sum] = "f7c900f21752683402992b288d5a2826de7a6c0c0abac2aadd7e8a409e170388"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_git.bb
deleted file mode 100644
index dfb08f7..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_git.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-require xorg-driver-input.inc
-
-SUMMARY = "X.Org X server -- keyboard input driver"
-
-DESCRIPTION = "keyboard is an Xorg input driver for keyboards. The \
-driver supports the standard OS-provided keyboard interface.  The driver \
-functions as a keyboard input device, and may be used as the X server's \
-core keyboard."
-
-SRCREV = "3e28d68b50d291938734e9684b8296ca864f3892"
-PV = "1.3.2+git${SRCPV}"
-PR = "${INC_PR}.0"
-
-SRC_URI = "git://anongit.freedesktop.org/git/xorg/driver/xf86-input-keyboard"
-S = "${WORKDIR}/git"
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.19.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.19.0.bb
deleted file mode 100644
index 5e5c471..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.19.0.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-require xorg-driver-input.inc
-
-SUMMARY = "Generic input driver for the X.Org server based on libinput"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5e6b20ea2ef94a998145f0ea3f788ee0"
-
-DEPENDS += "libinput"
-
-SRC_URI[md5sum] = "52c38b1369764243bfcf6ead1e4c6d32"
-SRC_URI[sha256sum] = "6c5d30dc7c8b8ae34261340e1dc9cbb8ef435078e084b8ef507527a8a21af477"
-
-FILES_${PN} += "${datadir}/X11/xorg.conf.d"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.24.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.24.0.bb
new file mode 100644
index 0000000..14b1271
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.24.0.bb
@@ -0,0 +1,11 @@
+require xorg-driver-input.inc
+
+SUMMARY = "Generic input driver for the X.Org server based on libinput"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5e6b20ea2ef94a998145f0ea3f788ee0"
+
+DEPENDS += "libinput"
+
+SRC_URI[md5sum] = "bd3fa118e4abadb8804dc6a099bb4ab3"
+SRC_URI[sha256sum] = "ddcb07350aed59b2996a92a1b4ff64d1c0b0c86a3f0ddca15b2b1c8c8bb13628"
+
+FILES_${PN} += "${datadir}/X11/xorg.conf.d"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse/unbreak.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse/unbreak.patch
deleted file mode 100644
index 6930864..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse/unbreak.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Unbreak the linux mouse driver by using config.h
-
-RP - 4/11/07
-
-Upstream-Status: Pending
-
-Index: git/src/lnx_mouse.c
-===================================================================
---- git.orig/src/lnx_mouse.c	2008-11-04 23:46:05.000000000 +0000
-+++ git/src/lnx_mouse.c	2008-11-04 23:46:15.000000000 +0000
-@@ -3,8 +3,8 @@
-  * Copyright 1999 by The XFree86 Project, Inc.
-  */
- 
--#ifdef HAVE_XORG_CONFIG_H
--#include <xorg-config.h>
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
- #endif
- 
- #include <X11/X.h>
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.1.bb
deleted file mode 100644
index 1f0b78a..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.1.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-require xorg-driver-input.inc
-
-SUMMARY = "X.Org X server -- mouse input driver"
-
-DESCRIPTION = "mouse is an Xorg input driver for mice. The driver \
-supports most available mouse types and interfaces.  The mouse driver \
-functions as a pointer input device, and may be used as the X server's \
-core pointer. Multiple mice are supported by multiple instances of this \
-driver."
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=90ea9f90d72b6d9327dede5ffdb2a510"
-
-SRC_URI[md5sum] = "77085b649c5c0b333565ba562f573951"
-SRC_URI[sha256sum] = "3485d375779c08406f0789feedde15933dc703158a086ddac638598f479fc5ce"
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.2.bb
new file mode 100644
index 0000000..0750476
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.2.bb
@@ -0,0 +1,14 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- mouse input driver"
+
+DESCRIPTION = "mouse is an Xorg input driver for mice. The driver \
+supports most available mouse types and interfaces.  The mouse driver \
+functions as a pointer input device, and may be used as the X server's \
+core pointer. Multiple mice are supported by multiple instances of this \
+driver."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=90ea9f90d72b6d9327dede5ffdb2a510"
+
+SRC_URI[md5sum] = "ce2d679283a22c8e0dccdd9248594845"
+SRC_URI[sha256sum] = "f425d5b05c6ab412a27e0a1106bb83f9e2662b307210abbe48270892387f4b2f"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_git.bb
deleted file mode 100644
index d79a2e4..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_git.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require xorg-driver-input.inc
-
-SUMMARY = "X.Org X server -- mouse input driver"
-
-DESCRIPTION = "mouse is an Xorg input driver for mice. The driver \
-supports most available mouse types and interfaces.  The mouse driver \
-functions as a pointer input device, and may be used as the X server's \
-core pointer. Multiple mice are supported by multiple instances of this \
-driver."
-
-SRCREV = "ea5cfe804e112f320f14ad896c7802d53551d3e6"
-PV = "1.3.0+git${SRCPV}"
-PR = "${INC_PR}.0"
-
-SRC_URI = "git://anongit.freedesktop.org/git/xorg/driver/xf86-input-mouse \
-           file://unbreak.patch"
-S = "${WORKDIR}/git"
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.8.3.bb
deleted file mode 100644
index b47c82c..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.8.3.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-require xorg-driver-input.inc
-
-SUMMARY = "X.Org X server -- synaptics touchpad input driver"
-
-DESCRIPTION = "synaptics is an Xorg input driver for the touchpads from \
-Synaptics Incorporated. Even though these touchpads (by default, \
-operating in a compatibility mode emulating a standard mouse) can be \
-handled by the normal evdev or mouse drivers, this driver allows more \
-advanced features of the touchpad to become available."
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=55aacd3535a741824955c5eb8f061398"
-
-SRC_URI[md5sum] = "4e3c8bed1ab4a67db2160c2c3d7e2a34"
-SRC_URI[sha256sum] = "d39f100c74f3673778b53f17bab7690161925e25dd998a15dd8cc69b52e83f01"
-
-DEPENDS += "libxi mtdev libxtst libevdev"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.9.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.9.0.bb
new file mode 100644
index 0000000..d327a3b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.9.0.bb
@@ -0,0 +1,16 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- synaptics touchpad input driver"
+
+DESCRIPTION = "synaptics is an Xorg input driver for the touchpads from \
+Synaptics Incorporated. Even though these touchpads (by default, \
+operating in a compatibility mode emulating a standard mouse) can be \
+handled by the normal evdev or mouse drivers, this driver allows more \
+advanced features of the touchpad to become available."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=55aacd3535a741824955c5eb8f061398"
+
+SRC_URI[md5sum] = "58e5b7722a402114093bf193962d1e3a"
+SRC_URI[sha256sum] = "afba3289d7a40217a19d90db98ce181772f9ca6d77e1898727b0afcf02073b5a"
+
+DEPENDS += "libxi mtdev libxtst libevdev"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_git.bb
deleted file mode 100644
index 140f633..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_git.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require xorg-driver-input.inc
-
-SUMMARY = "X.Org X server -- synaptics touchpad input driver"
-
-DESCRIPTION = "synaptics is an Xorg input driver for the touchpads from \
-Synaptics Incorporated. Even though these touchpads (by default, \
-operating in a compatibility mode emulating a standard mouse) can be \
-handled by the normal evdev or mouse drivers, this driver allows more \
-advanced features of the touchpad to become available."
-
-SRCREV = "934bc0012f948c52aadc8eda912f7728fb7394a2"
-PV = "0.15.2+git${SRCPV}"
-PR = "${INC_PR}.1"
-
-SRC_URI = "git://anongit.freedesktop.org/git/xorg/driver/xf86-input-synaptics"
-S = "${WORKDIR}/git"
-
-DEPENDS += "libxi mtdev libxtst"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_git.bb
index 06cc730..f86de6f 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_git.bb
@@ -9,7 +9,7 @@
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=8730ad58d11c7bbad9a7066d69f7808e"
 
-SRCREV = "8f33f80100096f7790c7b819ce37a3ed8ce8b5fa"
+SRCREV = "e4fe79cf0d9a05ee3f3a027148ef0aeb2b1b34e1"
 PV = "2.99.917+git${SRCPV}"
 S = "${WORKDIR}/git"
 
@@ -20,6 +20,7 @@
 
 SRC_URI[md5sum] = "fa196a66e52c0c624fe5d350af7a5e7b"
 SRC_URI[sha256sum] = "00b781eea055582820a123c47b62411bdf6aabf4f03dc0568faec55faf9667c9"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
 
 DEPENDS += "virtual/libx11 drm libpciaccess pixman"
 
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.4.bb
deleted file mode 100644
index 7895449..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.4.bb
+++ /dev/null
@@ -1,41 +0,0 @@
-require xorg-driver-video.inc
-
-SUMMARY = "X.Org X server -- Texas Instruments OMAP framebuffer driver"
-
-SUMMARY = "X.Org X server -- TI OMAP integrated graphics chipsets driver"
-
-DESCRIPTION = "Open-source X.org graphics driver for TI OMAP graphics \
-Currently relies on a closed-source submodule for EXA acceleration on \
-the following chipsets: \
-  + OMAP3430 \
-  + OMAP3630 \
-  + OMAP4430 \
-  + OMAP4460 \
-  + OMAP5430 \
-  + OMAP5432 \
-\
-NOTE: this driver is work in progress..  you probably don't want to try \
-and use it yet.  The API/ABI between driver and kernel, and driver and \
-acceleration submodules is not stable yet.  This driver requires the \
-omapdrm kernel driver w/ GEM support. \
-"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=10ce5de3b111315ea652a5f74ec0c602"
-DEPENDS += "virtual/libx11 libdrm xf86driproto"
-
-SRC_URI[md5sum] = "a364e151a537948f75bb8c9b840a31da"
-SRC_URI[sha256sum] = "a7192690b8638f5c8d611a1bae07cc13081e22edd4070f37a2f5c3f8d79e7ebc"
-
-CFLAGS += " -I${STAGING_INCDIR}/xorg "
-
-# Use overlay 2 on omap3 to enable other apps to use overlay 1 (e.g. dmai or omapfbplay)
-do_compile_prepend_armv7a () {
-        sed -i -e s:fb1:fb2:g ${S}/src/omap_xv.c
-}
-
-python () {
-    if not bb.utils.contains ('DISTRO_FEATURES', 'opengl', True, False, d):
-        raise bb.parse.SkipPackage("'opengl' not in DISTRO_FEATURES")
-}
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.5.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.5.bb
new file mode 100644
index 0000000..e652394
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.5.bb
@@ -0,0 +1,41 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- Texas Instruments OMAP framebuffer driver"
+
+SUMMARY = "X.Org X server -- TI OMAP integrated graphics chipsets driver"
+
+DESCRIPTION = "Open-source X.org graphics driver for TI OMAP graphics \
+Currently relies on a closed-source submodule for EXA acceleration on \
+the following chipsets: \
+  + OMAP3430 \
+  + OMAP3630 \
+  + OMAP4430 \
+  + OMAP4460 \
+  + OMAP5430 \
+  + OMAP5432 \
+\
+NOTE: this driver is work in progress..  you probably don't want to try \
+and use it yet.  The API/ABI between driver and kernel, and driver and \
+acceleration submodules is not stable yet.  This driver requires the \
+omapdrm kernel driver w/ GEM support. \
+"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10ce5de3b111315ea652a5f74ec0c602"
+DEPENDS += "virtual/libx11 libdrm xf86driproto"
+
+SRC_URI[md5sum] = "3b8ea5e8fba63355c0dc6681c49d5fe5"
+SRC_URI[sha256sum] = "93e7d42107521e61f61980eaea64fb452e87b7b94272e48938ac8d904ccfab5a"
+
+CFLAGS += " -I${STAGING_INCDIR}/xorg "
+
+# Use overlay 2 on omap3 to enable other apps to use overlay 1 (e.g. dmai or omapfbplay)
+do_compile_prepend_armv7a () {
+        sed -i -e s:fb1:fb2:g ${S}/src/omap_xv.c
+}
+
+python () {
+    if not bb.utils.contains ('DISTRO_FEATURES', 'opengl', True, False, d):
+        raise bb.parse.SkipPackage("'opengl' not in DISTRO_FEATURES")
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch
index 6039d08..5bda720 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch
@@ -1,17 +1,18 @@
+From da6612659a279bcb02f70622b53a3894fbc11052 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 9 Dec 2016 14:35:45 +0200
+Subject: [PATCH] Add option for vmwgfx
+
 Upstream-Status:Submitted
+
 Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-From f103d6f570671c649ccd7b225e6d6c9f14371888 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Wed, 25 Jun 2014 16:16:44 +0100
-Subject: [PATCH 2/2] add option for vmwgfx
-
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
 ---
- configure.ac |   49 ++++++++++++++++++++-----------------------------
- 1 file changed, 20 insertions(+), 29 deletions(-)
+ configure.ac | 51 +++++++++++++++++++++------------------------------
+ 1 file changed, 21 insertions(+), 30 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index be40ed7..8e15307 100644
+index 9f259ce..f3fec57 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -64,6 +64,13 @@ AC_ARG_ENABLE(vmwarectrl-client,
@@ -40,7 +41,7 @@
  PKG_CHECK_EXISTS([xorg-server >= 1.12.0],
                   [AC_DEFINE([HAVE_XORG_SERVER_1_12_0], 1,
                   [Has version 1.12.0 or greater of the Xserver])])
-@@ -114,39 +116,28 @@ AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
+@@ -114,34 +116,22 @@ AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
  
  AC_SUBST([moduledir])
  
@@ -62,6 +63,7 @@
 -#
 +AC_MSG_CHECKING([whether to build Kernel Mode Setting and 3D])
 +if test x$VMWGFX = xyes; then
++	AC_MSG_RESULT([yes])
 +	PKG_CHECK_MODULES([LIBDRM], [libdrm])
 +	# Check for prime.
  	PKG_CHECK_EXISTS([libdrm >= 2.4.38],
@@ -75,15 +77,18 @@
 -AC_MSG_CHECKING([whether to build Kernel Mode Setting and 3D])
 -if test x$BUILD_VMWGFX = xyes; then
 -	AC_MSG_RESULT([yes])
+-        AC_DEFINE([BUILD_VMWGFX], 1, [Building the vmwgfx driver path])
 +	# Early versions of mesa 10 forgot to bump the XA major version number
 +	# in the xa_tracker.h header
 +	PKG_CHECK_MODULES([XATRACKER], [xatracker >= 0.4.0],
 +			  [PKG_CHECK_EXISTS([xatracker = 2.0.0],
-+	                  [AC_DEFINE([HAVE_XA_2], 1,
-+               		  [Has version 2 of XA])])])
-         AC_DEFINE([BUILD_VMWGFX], 1, [Building the vmwgfx driver path])
-+	AC_MSG_RESULT([yes])
- else
++			  [AC_DEFINE([HAVE_XA_2], 1,
++				     [Has version 2 of XA])])])
++	AC_DEFINE([BUILD_VMWGFX], 1, [Building the vmwgfx driver path])
+ 	libudev_check=yes
+ 	AC_ARG_WITH([libudev],
+ 		[AS_HELP_STRING([--without-libudev],
+@@ -158,7 +148,8 @@ else
  	AC_MSG_RESULT([no])
  fi
  
@@ -94,5 +99,5 @@
  AC_CONFIG_FILES([
                  Makefile
 -- 
-1.7.10.4
+2.1.4
 
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.1.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.1.0.bb
deleted file mode 100644
index 8c891e6..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.1.0.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-require xorg-driver-video.inc
-
-SUMMARY = "X.Org X server -- VMware SVGA display driver"
-
-DESCRIPTION = "vmware is an Xorg driver for VMware virtual video cards."
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=5fcd7d437a959a15fbee8707747c6b53"
-
-DEPENDS += "virtual/libx11 xineramaproto videoproto libpciaccess"
-
-SRC_URI += "file://0002-add-option-for-vmwgfx.patch"
-
-SRC_URI[md5sum] = "0cba22fed4cb639d5c4276f7892c543d"
-SRC_URI[sha256sum] = "3c1d244e4b1b77e92126957965cdc9fb82de4c215c0706a3a8aaff6939e4a0cc"
-
-COMPATIBLE_HOST = '(i.86.*-linux|x86_64.*-linux)'
-
-PACKAGECONFIG ?= ""
-PACKAGECONFIG[vmwgfx] = "--enable-vmwgfx, --disable-vmwgfx, libdrm virtual/mesa"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.2.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.2.1.bb
new file mode 100644
index 0000000..706d35d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.2.1.bb
@@ -0,0 +1,19 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- VMware SVGA display driver"
+
+DESCRIPTION = "vmware is an Xorg driver for VMware virtual video cards."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5fcd7d437a959a15fbee8707747c6b53"
+
+DEPENDS += "virtual/libx11 xineramaproto videoproto libpciaccess"
+
+SRC_URI += "file://0002-add-option-for-vmwgfx.patch"
+
+SRC_URI[md5sum] = "4c3912e4d8947f6c2fc1ee9e2f211d74"
+SRC_URI[sha256sum] = "e2f7f7101fba7f53b268e7a25908babbf155b3984fb5268b3d244eb6c11bf62b"
+
+COMPATIBLE_HOST = '(i.86.*-linux|x86_64.*-linux)'
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[vmwgfx] = "--enable-vmwgfx, --disable-vmwgfx, libdrm virtual/mesa"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
index 57a4c82..fe42f11 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
@@ -33,8 +33,8 @@
     }
 
     output = os.popen("pkg-config xorg-server --variable=%s" % abis[name]).read()
-    mlprefix = d.getVar('MLPREFIX', True) or ''
+    mlprefix = d.getVar('MLPREFIX') or ''
     abi = "%sxorg-abi-%s-%s" % (mlprefix, name, output.split(".")[0])
 
-    pn = d.getVar("PN", True)
+    pn = d.getVar("PN")
     d.appendVar('RDEPENDS_' + pn, ' ' + abi)
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc
index c4dba1b..342067d 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc
@@ -1,4 +1,4 @@
-include xorg-driver-common.inc
+require xorg-driver-common.inc
 
 DEPENDS += "inputproto kbproto "
 
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc
index 38281e0..b5862da 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc
@@ -1,4 +1,4 @@
-include xorg-driver-common.inc
+require xorg-driver-common.inc
 
 DEPENDS =+ "renderproto videoproto xextproto fontsproto"
 
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc
index da20ab9..cdbebcf 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc
@@ -4,7 +4,7 @@
 SECTION = "x11/fonts"
 LICENSE = "MIT-X"
 
-DEPENDS = " encodings font-alias font-util-native mkfontdir-native mkfontscale-native"
+DEPENDS = " encodings font-alias font-util-native"
 RDEPENDS_${PN} = "encodings font-util font-alias"
 
 XORG_PN = "${BPN}"
@@ -18,7 +18,6 @@
 
 # The mkfontscale-native requires x11 in DISTRO_FEATURES
 REQUIRED_DISTRO_FEATURES = "x11"
-REQUIRED_DISTRO_FEATURES_class-native = ""
 
 EXTRA_OEMAKE += "FCCACHE=/bin/true UTIL_DIR=${STAGING_DIR_TARGET}\$\(MAPFILES_PATH\)"
 
@@ -31,6 +30,7 @@
 
 FILES_${PN} += " ${libdir}/X11/fonts ${datadir}"
 
+PACKAGE_WRITE_DEPS += "mkfontdir-native mkfontscale-native"
 pkg_postinst_${PN} () {
         for fontdir in `find $D/usr/lib/X11/fonts -type d`; do
                 mkfontdir $fontdir
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb
index b361ad6..f069749 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb
@@ -23,6 +23,6 @@
 SRC_URI[md5sum] = "addfb1e897ca8079531669c7c7711726"
 SRC_URI[sha256sum] = "8f7032f2c1c64352b5423f6b48a8ebdc339cc63064af34d66a6c9aa79759e202"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[arc4] = "ac_cv_lib_bsd_arc4random_buf=yes,ac_cv_lib_bsd_arc4random_buf=no,libbsd"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb
index da4ed92..48922cb 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb
@@ -27,5 +27,5 @@
 SRC_URI[md5sum] = "499a7773c65aba513609fe651853c5f3"
 SRC_URI[sha256sum] = "0baca8c9f5d934450a70896c4ad38d06475521255ca63b717a6510fdb6e287bd"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.3.bb
deleted file mode 100644
index c0d0148..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.3.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-require libx11.inc
-
-DESCRIPTION += " Support for XCMS and XLOCALE is disabled in \
-this version."
-
-SRC_URI += "file://X18NCMSstubs.diff \
-            file://fix-disable-xlocale.diff \
-            file://fix-utf8-wrong-define.patch \
-           "
-
-RPROVIDES_${PN}-dev = "libx11-dev"
-RPROVIDES_${PN}-locale = "libx11-locale"
-
-SRC_URI[md5sum] = "2e36b73f8a42143142dda8129f02e4e0"
-SRC_URI[sha256sum] = "cf31a7c39f2f52e8ebd0db95640384e63451f9b014eed2bb7f5de03e8adc8111"
-
-EXTRA_OECONF += "--disable-xlocale"
-
-PACKAGECONFIG ??= ""
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.4.bb
new file mode 100644
index 0000000..0c761d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.4.bb
@@ -0,0 +1,19 @@
+require libx11.inc
+
+DESCRIPTION += " Support for XCMS and XLOCALE is disabled in \
+this version."
+
+SRC_URI += "file://X18NCMSstubs.diff \
+            file://fix-disable-xlocale.diff \
+            file://fix-utf8-wrong-define.patch \
+           "
+
+RPROVIDES_${PN}-dev = "libx11-dev"
+RPROVIDES_${PN}-locale = "libx11-locale"
+
+SRC_URI[md5sum] = "6d54227082f3aa2c596f0b3a3fbb9175"
+SRC_URI[sha256sum] = "b7c748be3aa16ec2cbd81edc847e9b6ee03f88143ab270fb59f58a044d34e441"
+
+EXTRA_OECONF += "--disable-xlocale"
+
+PACKAGECONFIG ??= ""
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/CVE-2016-7942.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/CVE-2016-7942.patch
deleted file mode 100644
index f5b4d69..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/CVE-2016-7942.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 8ea762f94f4c942d898fdeb590a1630c83235c17 Mon Sep 17 00:00:00 2001
-From: Tobias Stoeckmann <tobias@stoeckmann.org>
-Date: Sun, 25 Sep 2016 21:25:25 +0200
-Subject: Validation of server responses in XGetImage()
-
-Check if enough bytes were received for specified image type and
-geometry. Otherwise GetPixel and other functions could trigger an
-out of boundary read later on.
-
-CVE: CVE-2016-7942
-Upstream-Status: Backport
-
-Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
-Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
-Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
-
-diff --git a/src/GetImage.c b/src/GetImage.c
-index c461abc..ff32d58 100644
---- a/src/GetImage.c
-+++ b/src/GetImage.c
-@@ -59,6 +59,7 @@ XImage *XGetImage (
- 	char *data;
- 	unsigned long nbytes;
- 	XImage *image;
-+	int planes;
- 	LockDisplay(dpy);
- 	GetReq (GetImage, req);
- 	/*
-@@ -91,18 +92,28 @@ XImage *XGetImage (
- 	    return (XImage *) NULL;
- 	}
-         _XReadPad (dpy, data, nbytes);
--        if (format == XYPixmap)
--	   image = XCreateImage(dpy, _XVIDtoVisual(dpy, rep.visual),
--		  Ones (plane_mask &
--			(((unsigned long)0xFFFFFFFF) >> (32 - rep.depth))),
--		  format, 0, data, width, height, dpy->bitmap_pad, 0);
--	else /* format == ZPixmap */
--           image = XCreateImage (dpy, _XVIDtoVisual(dpy, rep.visual),
--		 rep.depth, ZPixmap, 0, data, width, height,
--		  _XGetScanlinePad(dpy, (int) rep.depth), 0);
-+        if (format == XYPixmap) {
-+	    image = XCreateImage(dpy, _XVIDtoVisual(dpy, rep.visual),
-+		Ones (plane_mask &
-+		    (((unsigned long)0xFFFFFFFF) >> (32 - rep.depth))),
-+		format, 0, data, width, height, dpy->bitmap_pad, 0);
-+	    planes = image->depth;
-+	} else { /* format == ZPixmap */
-+            image = XCreateImage (dpy, _XVIDtoVisual(dpy, rep.visual),
-+		rep.depth, ZPixmap, 0, data, width, height,
-+		    _XGetScanlinePad(dpy, (int) rep.depth), 0);
-+	    planes = 1;
-+	}
- 
- 	if (!image)
- 	    Xfree(data);
-+	if (planes < 1 || image->height < 1 || image->bytes_per_line < 1 ||
-+	    INT_MAX / image->height <= image->bytes_per_line ||
-+	    INT_MAX / planes <= image->height * image->bytes_per_line ||
-+	    nbytes < planes * image->height * image->bytes_per_line) {
-+	    XDestroyImage(image);
-+	    image = NULL;
-+	}
- 	UnlockDisplay(dpy);
- 	SyncHandle();
- 	return (image);
--- 
-cgit v0.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/CVE-2016-7943.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/CVE-2016-7943.patch
deleted file mode 100644
index 5002423..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/CVE-2016-7943.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 8c29f1607a31dac0911e45a0dd3d74173822b3c9 Mon Sep 17 00:00:00 2001
-From: Tobias Stoeckmann <tobias@stoeckmann.org>
-Date: Sun, 25 Sep 2016 21:22:57 +0200
-Subject: The validation of server responses avoids out of boundary accesses.
-
-v2: FontNames.c  return a NULL list whenever a single
-length field from the server is incohent.
-
-CVE: CVE-2016-7943
-Upstream-Status: Backport
-
-Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
-Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
-Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
-
-diff --git a/src/FontNames.c b/src/FontNames.c
-index 21dcafe..e55f338 100644
---- a/src/FontNames.c
-+++ b/src/FontNames.c
-@@ -66,7 +66,7 @@ int *actualCount)	/* RETURN */
- 
-     if (rep.nFonts) {
- 	flist = Xmalloc (rep.nFonts * sizeof(char *));
--	if (rep.length < (INT_MAX >> 2)) {
-+	if (rep.length > 0 && rep.length < (INT_MAX >> 2)) {
- 	    rlen = rep.length << 2;
- 	    ch = Xmalloc(rlen + 1);
- 	    /* +1 to leave room for last null-terminator */
-@@ -93,11 +93,22 @@ int *actualCount)	/* RETURN */
- 	    if (ch + length < chend) {
- 		flist[i] = ch + 1;  /* skip over length */
- 		ch += length + 1;  /* find next length ... */
--		length = *(unsigned char *)ch;
--		*ch = '\0';  /* and replace with null-termination */
--		count++;
--	    } else
--		flist[i] = NULL;
-+		if (ch <= chend) {
-+		    length = *(unsigned char *)ch;
-+		    *ch = '\0';  /* and replace with null-termination */
-+		    count++;
-+		} else {
-+                    Xfree(flist);
-+                    flist = NULL;
-+                    count = 0;
-+                    break;
-+		}
-+	    } else {
-+                Xfree(flist);
-+                flist = NULL;
-+                count = 0;
-+                break;
-+            }
- 	}
-     }
-     *actualCount = count;
-diff --git a/src/ListExt.c b/src/ListExt.c
-index be6b989..0516e45 100644
---- a/src/ListExt.c
-+++ b/src/ListExt.c
-@@ -55,7 +55,7 @@ char **XListExtensions(
- 
- 	if (rep.nExtensions) {
- 	    list = Xmalloc (rep.nExtensions * sizeof (char *));
--	    if (rep.length < (INT_MAX >> 2)) {
-+	    if (rep.length > 0 && rep.length < (INT_MAX >> 2)) {
- 		rlen = rep.length << 2;
- 		ch = Xmalloc (rlen + 1);
-                 /* +1 to leave room for last null-terminator */
-@@ -80,9 +80,13 @@ char **XListExtensions(
- 		if (ch + length < chend) {
- 		    list[i] = ch+1;  /* skip over length */
- 		    ch += length + 1; /* find next length ... */
--		    length = *ch;
--		    *ch = '\0'; /* and replace with null-termination */
--		    count++;
-+		    if (ch <= chend) {
-+			length = *ch;
-+			*ch = '\0'; /* and replace with null-termination */
-+			count++;
-+		    } else {
-+			list[i] = NULL;
-+		    }
- 		} else
- 		    list[i] = NULL;
- 	    }
-diff --git a/src/ModMap.c b/src/ModMap.c
-index a809aa2..49a5d08 100644
---- a/src/ModMap.c
-+++ b/src/ModMap.c
-@@ -42,7 +42,8 @@ XGetModifierMapping(register Display *dpy)
-     GetEmptyReq(GetModifierMapping, req);
-     (void) _XReply (dpy, (xReply *)&rep, 0, xFalse);
- 
--    if (rep.length < (INT_MAX >> 2)) {
-+    if (rep.length < (INT_MAX >> 2) &&
-+	(rep.length >> 1) == rep.numKeyPerModifier) {
- 	nbytes = (unsigned long)rep.length << 2;
- 	res = Xmalloc(sizeof (XModifierKeymap));
- 	if (res)
--- 
-cgit v0.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch
deleted file mode 100644
index f2abf7c..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 4d85d5f3bd8afac893738fd88e19d8cb5cf998ff Mon Sep 17 00:00:00 2001
-From: Drew Moseley <drew_moseley@mentor.com>
-Date: Sun, 27 Jul 2014 13:10:07 -0400
-Subject: [PATCH] libX11: Add missing NULL check on im and im->methods
-
-Upstream-Status: Backport (c827edcd1c4a7f920aa25208083b5b58d60d2b44)
-Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
-
----
- src/xlibi18n/ICWrap.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff -ru libX11-1.6.2-orig/src/xlibi18n/ICWrap.c libX11-1.6.2/src/xlibi18n/ICWrap.c
---- libX11-1.6.2-orig/src/xlibi18n/ICWrap.c	2014-07-27 13:38:29.586666449 -0400
-+++ libX11-1.6.2/src/xlibi18n/ICWrap.c	2014-07-27 13:41:39.671609030 -0400
-@@ -169,7 +169,7 @@
-     va_list var;
-     int     total_count;
-     XIMArg *args;
--    char   *ret;
-+    char   *ret = NULL;
- 
-     /*
-      * so count the stuff dangling here
-@@ -185,7 +185,8 @@
-     _XIMVaToNestedList(var, total_count, &args);
-     va_end(var);
- 
--    ret = (*im->methods->set_values) (im, args);
-+    if (im && im->methods)
-+	ret = (*im->methods->set_values) (im, args);
-     Xfree(args);
-     return ret;
- }
-@@ -196,7 +197,7 @@
-     va_list var;
-     int     total_count;
-     XIMArg *args;
--    char   *ret;
-+    char   *ret = NULL;
- 
-     /*
-      * so count the stuff dangling here
-@@ -212,7 +213,8 @@
-     _XIMVaToNestedList(var, total_count, &args);
-     va_end(var);
- 
--    ret = (*im->methods->get_values) (im, args);
-+    if (im && im->methods)
-+	ret = (*im->methods->get_values) (im, args);
-     Xfree(args);
-     return ret;
- }
-@@ -228,7 +230,7 @@
-     va_list var;
-     int     total_count;
-     XIMArg *args;
--    XIC     ic;
-+    XIC     ic = NULL;
- 
-     /*
-      * so count the stuff dangling here
-@@ -244,7 +246,8 @@
-     _XIMVaToNestedList(var, total_count, &args);
-     va_end(var);
- 
--    ic = (XIC) (*im->methods->create_ic) (im, args);
-+    if (im && im->methods)
-+	ic = (XIC) (*im->methods->create_ic) (im, args);
-     Xfree(args);
-     if (ic) {
- 	ic->core.next = im->core.ic_chain;
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11_1.6.3.bb
deleted file mode 100644
index 23a7789..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11_1.6.3.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require libx11.inc
-inherit gettext
-
-BBCLASSEXTEND = "native nativesdk"
-
-SRC_URI += "file://disable_tests.patch \
-            file://libX11-Add-missing-NULL-check.patch \
-            file://CVE-2016-7942.patch \
-            file://CVE-2016-7943.patch \
-           "
-
-SRC_URI[md5sum] = "2e36b73f8a42143142dda8129f02e4e0"
-SRC_URI[sha256sum] = "cf31a7c39f2f52e8ebd0db95640384e63451f9b014eed2bb7f5de03e8adc8111"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11_1.6.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11_1.6.4.bb
new file mode 100644
index 0000000..caa95fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11_1.6.4.bb
@@ -0,0 +1,10 @@
+require libx11.inc
+inherit gettext
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI += "file://disable_tests.patch \
+           "
+
+SRC_URI[md5sum] = "6d54227082f3aa2c596f0b3a3fbb9175"
+SRC_URI[sha256sum] = "b7c748be3aa16ec2cbd81edc847e9b6ee03f88143ab270fb59f58a044d34e441"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.2.bb
deleted file mode 100644
index f078aed..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.2.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-SUMMARY = "XFixes: X Fixes extension library"
-
-DESCRIPTION = "X applications have often needed to work around various \
-shortcomings in the core X window system.  This extension is designed to \
-provide the minimal server-side support necessary to eliminate problems \
-caused by these workarounds."
-
-require xorg-lib-common.inc
-
-LICENSE = "MIT-style"
-LIC_FILES_CHKSUM = "file://COPYING;md5=3c1ce42c334a6f5cccb0277556a053e0"
-
-DEPENDS += "virtual/libx11 xproto fixesproto xextproto"
-
-PE = "1"
-
-XORG_PN = "libXfixes"
-
-BBCLASSEXTEND = "native nativesdk"
-
-SRC_URI[md5sum] = "544d73df94e638ba7b64147be416e576"
-SRC_URI[sha256sum] = "9bd20edfec084a1bed481d48dd4815dee88139fffad091418cdda081129a9aea"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.3.bb
new file mode 100644
index 0000000..c80042d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.3.bb
@@ -0,0 +1,23 @@
+SUMMARY = "XFixes: X Fixes extension library"
+
+DESCRIPTION = "X applications have often needed to work around various \
+shortcomings in the core X window system.  This extension is designed to \
+provide the minimal server-side support necessary to eliminate problems \
+caused by these workarounds."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3c1ce42c334a6f5cccb0277556a053e0"
+
+DEPENDS += "virtual/libx11 xproto fixesproto xextproto"
+
+PE = "1"
+
+XORG_PN = "libXfixes"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "07e01e046a0215574f36a3aacb148be0"
+SRC_URI[sha256sum] = "de1cd33aff226e08cefd0e6759341c2c8e8c9faf8ce9ac6ec38d43e287b22ad6"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont2_2.0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont2_2.0.1.bb
new file mode 100644
index 0000000..4bfb290
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont2_2.0.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "XFont2: X Font rasterisation library"
+
+DESCRIPTION = "libXfont2 provides various services for X servers, most \
+notably font selection and rasterisation (through external libraries \
+such as freetype)."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a46c8040f2f737bcd0c435feb2ab1c2c"
+
+DEPENDS += "freetype xtrans fontsproto libfontenc zlib"
+
+XORG_PN = "libXfont2"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "0d9f6dd9c23bf4bcbfb00504b566baf5"
+SRC_URI[sha256sum] = "e9fbbb475ddd171b3a6a54b989cbade1f6f874fc35d505ebc5be426bc6e4db7e"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.1.bb
deleted file mode 100644
index e01f331..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.1.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-SUMMARY = "XFont: X Font rasterisation library"
-
-DESCRIPTION = "libXfont provides various services for X servers, most \
-notably font selection and rasterisation (through external libraries \
-such as freetype)."
-
-require xorg-lib-common.inc
-
-LICENSE = "MIT & MIT-style & BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a46c8040f2f737bcd0c435feb2ab1c2c"
-
-DEPENDS += "freetype xtrans fontsproto libfontenc zlib"
-PROVIDES = "xfont"
-
-PE = "1"
-
-XORG_PN = "libXfont"
-
-BBCLASSEXTEND = "native"
-
-SRC_URI[md5sum] = "96f76ba94b4c909230bac1e2dcd551c4"
-SRC_URI[sha256sum] = "b70898527c73f9758f551bbab612af611b8a0962202829568d94f3edf4d86098"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.2.bb
new file mode 100644
index 0000000..b11dda5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.2.bb
@@ -0,0 +1,25 @@
+SUMMARY = "XFont: X Font rasterisation library"
+
+DESCRIPTION = "libXfont provides various services for X servers, most \
+notably font selection and rasterisation (through external libraries \
+such as freetype)."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a46c8040f2f737bcd0c435feb2ab1c2c"
+
+DEPENDS += "freetype xtrans fontsproto libfontenc zlib"
+PROVIDES = "xfont"
+
+PE = "1"
+
+XORG_PN = "libXfont"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "254ee42bd178d18ebc7a73aacfde7f79"
+SRC_URI[sha256sum] = "02945ea68da447102f3e6c2b896c1d2061fd115de99404facc2aca3ad7010d71"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb
index a967cdc..b454781 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb
@@ -28,6 +28,6 @@
 BBCLASSEXTEND = "native"
 
 python () {
-        if d.getVar('DEBIAN_NAMES', True):
+        if d.getVar('DEBIAN_NAMES'):
             d.setVar('PKG_${PN}', '${MLPREFIX}libxft2')
 }
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxi_1.7.6.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxi_1.7.6.bb
deleted file mode 100644
index 7523479..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxi_1.7.6.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-require xorg-lib-common.inc
-
-SUMMARY = "XI: X Input extension library"
-
-DESCRIPTION = "libxi is an extension to the X11 protocol to support \
-input devices other than the core X keyboard and pointer.  It allows \
-client programs to select input from these devices independently from \
-each other and independently from the core devices."
-
-LICENSE = "MIT & MIT-style"
-LIC_FILES_CHKSUM = "file://COPYING;md5=17b064789fab936a1c58c4e13d965b0f \
-                    file://src/XIGetDevFocus.c;endline=23;md5=cdfb0d435a33ec57ea0d1e8e395b729f"
-
-DEPENDS += "libxext inputproto libxfixes"
-
-PE = "1"
-
-XORG_PN = "libXi"
-
-SRC_URI[md5sum] = "510e555ecfffa8d2298a0f42b725e563"
-SRC_URI[sha256sum] = "1f32a552cec0f056c0260bdb32e853cec0673d2f40646ce932ad5a9f0205b7ac"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxi_1.7.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxi_1.7.9.bb
new file mode 100644
index 0000000..74f0527
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxi_1.7.9.bb
@@ -0,0 +1,22 @@
+require xorg-lib-common.inc
+
+SUMMARY = "XI: X Input extension library"
+
+DESCRIPTION = "libxi is an extension to the X11 protocol to support \
+input devices other than the core X keyboard and pointer.  It allows \
+client programs to select input from these devices independently from \
+each other and independently from the core devices."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=17b064789fab936a1c58c4e13d965b0f \
+                    file://src/XIGetDevFocus.c;endline=23;md5=cdfb0d435a33ec57ea0d1e8e395b729f"
+
+DEPENDS += "libxext inputproto libxfixes"
+
+PE = "1"
+
+XORG_PN = "libXi"
+
+SRC_URI[md5sum] = "1f0f2719c020655a60aee334ddd26d67"
+SRC_URI[sha256sum] = "c2e6b8ff84f9448386c1b5510a5cf5a16d788f76db018194dacdc200180faf45"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.6.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.6.1.bb
deleted file mode 100644
index fc08109..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.6.1.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-SUMMARY = "Generic XKB keymap library"
-DESCRIPTION = "libxkbcommon is a keymap compiler and support library which \
-processes a reduced subset of keymaps as defined by the XKB specification."
-HOMEPAGE = "http://www.xkbcommon.org"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=09457b156e3155972abebcaaaa0cb434"
-LICENSE = "MIT & MIT-style"
-
-DEPENDS = "util-macros flex-native bison-native"
-
-SRC_URI = "http://xkbcommon.org/download/${BPN}-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "67a8f322b5fa32352272e811bb90dd73"
-SRC_URI[sha256sum] = "5b0887b080b42169096a61106661f8d35bae783f8b6c58f97ebcd3af83ea8760"
-
-UPSTREAM_CHECK_URI = "http://xkbcommon.org/"
-
-inherit autotools pkgconfig
-
-EXTRA_OECONF = "--disable-docs"
-
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,libxcb xkeyboard-config,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.7.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.7.1.bb
new file mode 100644
index 0000000..81df1dd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.7.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Generic XKB keymap library"
+DESCRIPTION = "libxkbcommon is a keymap compiler and support library which \
+processes a reduced subset of keymaps as defined by the XKB specification."
+HOMEPAGE = "http://www.xkbcommon.org"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e525ed9809e1f8a07cf4bce8b09e8b87"
+LICENSE = "MIT & MIT-style"
+
+DEPENDS = "util-macros flex-native bison-native"
+
+SRC_URI = "http://xkbcommon.org/download/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "947ba609cb0239b9462127d5cf8908ee"
+SRC_URI[sha256sum] = "ba59305d2e19e47c27ea065c2e0df96ebac6a3c6e97e28ae5620073b6084e68b"
+
+UPSTREAM_CHECK_URI = "http://xkbcommon.org/"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-docs"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,libxcb xkeyboard-config,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb
index d5935ff..4740c15 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb
@@ -31,5 +31,5 @@
 SRC_URI[md5sum] = "41d92ab627dfa06568076043f3e089e4"
 SRC_URI[sha256sum] = "756edc7c383254eef8b4e1b733c3bf1dc061b523c9f9833ac7058378b8349d0b"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.11.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.11.bb
deleted file mode 100644
index 545874c..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.11.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-require xorg-lib-common.inc
-
-# libxpm requires xgettext to build
-inherit gettext
-
-SUMMARY = "Xpm: X Pixmap extension library"
-
-DESCRIPTION = "libXpm provides support and common operation for the XPM \
-pixmap format, which is commonly used in legacy X applications.  XPM is \
-an extension of the monochrome XBM bitmap specificied in the X \
-protocol."
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=51f4270b012ecd4ab1a164f5f4ed6cf7"
-DEPENDS += "libxext libsm libxt"
-PE = "1"
-
-XORG_PN = "libXpm"
-
-PACKAGES =+ "sxpm cxpm"
-FILES_cxpm = "${bindir}/cxpm"
-FILES_sxpm = "${bindir}/sxpm"
-
-SRC_URI[md5sum] = "769ee12a43611cdebd38094eaf83f3f0"
-SRC_URI[sha256sum] = "c5bdafa51d1ae30086fac01ab83be8d47fe117b238d3437f8e965434090e041c"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb
new file mode 100644
index 0000000..13a1b91
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb
@@ -0,0 +1,27 @@
+require xorg-lib-common.inc
+
+# libxpm requires xgettext to build
+inherit gettext
+
+SUMMARY = "Xpm: X Pixmap extension library"
+
+DESCRIPTION = "libXpm provides support and common operation for the XPM \
+pixmap format, which is commonly used in legacy X applications.  XPM is \
+an extension of the monochrome XBM bitmap specificied in the X \
+protocol."
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=51f4270b012ecd4ab1a164f5f4ed6cf7"
+DEPENDS += "libxext libsm libxt"
+PE = "1"
+
+XORG_PN = "libXpm"
+
+PACKAGES =+ "sxpm cxpm"
+FILES_cxpm = "${bindir}/cxpm"
+FILES_sxpm = "${bindir}/sxpm"
+
+SRC_URI[md5sum] = "20f4627672edb2bd06a749f11aa97302"
+SRC_URI[sha256sum] = "fd6a6de3da48de8d1bb738ab6be4ad67f7cb0986c39bd3f7d51dd24f7854bdec"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr/CVE-2016-7947_CVE-2016-7948.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr/CVE-2016-7947_CVE-2016-7948.patch
deleted file mode 100644
index a9b3dbc..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr/CVE-2016-7947_CVE-2016-7948.patch
+++ /dev/null
@@ -1,439 +0,0 @@
-From a0df3e1c7728205e5c7650b2e6dce684139254a6 Mon Sep 17 00:00:00 2001
-From: Tobias Stoeckmann <tobias@stoeckmann.org>
-Date: Sun, 25 Sep 2016 22:21:40 +0200
-Subject: Avoid out of boundary accesses on illegal responses
-
-The responses of the connected X server have to be properly checked
-to avoid out of boundary accesses that could otherwise be triggered
-by a malicious server.
-
-CVE: CVE-2016-7947
-libXrandr: Insufficient validation of server responses result in Integer overflows
-
-CVE: CVE-2016-7948
-libXrandr: Insufficient validation of server responses result in various data mishandlings
-
-Upstream-Status: Backport
-
-Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
-Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
-Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
-
-diff --git a/src/XrrConfig.c b/src/XrrConfig.c
-index 2f0282b..e68c45a 100644
---- a/src/XrrConfig.c
-+++ b/src/XrrConfig.c
-@@ -29,6 +29,7 @@
- #include <config.h>
- #endif
- 
-+#include <limits.h>
- #include <stdio.h>
- #include <X11/Xlib.h>
- /* we need to be able to manipulate the Display structure on events */
-@@ -272,23 +273,30 @@ static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy,
- 	rep.rate = 0;
- 	rep.nrateEnts = 0;
-     }
-+    if (rep.length < INT_MAX >> 2) {
-+	nbytes = (long) rep.length << 2;
- 
--    nbytes = (long) rep.length << 2;
-+	nbytesRead = (long) (rep.nSizes * SIZEOF (xScreenSizes) +
-+			    ((rep.nrateEnts + 1)& ~1) * 2 /* SIZEOF(CARD16) */);
- 
--    nbytesRead = (long) (rep.nSizes * SIZEOF (xScreenSizes) +
--			 ((rep.nrateEnts + 1)& ~1) * 2 /* SIZEOF (CARD16) */);
-+	/*
-+	 * first we must compute how much space to allocate for
-+	 * randr library's use; we'll allocate the structures in a single
-+	 * allocation, on cleanlyness grounds.
-+	 */
- 
--    /*
--     * first we must compute how much space to allocate for
--     * randr library's use; we'll allocate the structures in a single
--     * allocation, on cleanlyness grounds.
--     */
-+	rbytes = sizeof (XRRScreenConfiguration) +
-+	  (rep.nSizes * sizeof (XRRScreenSize) +
-+	   rep.nrateEnts * sizeof (int));
- 
--    rbytes = sizeof (XRRScreenConfiguration) +
--      (rep.nSizes * sizeof (XRRScreenSize) +
--       rep.nrateEnts * sizeof (int));
-+	scp = (struct _XRRScreenConfiguration *) Xmalloc(rbytes);
-+    } else {
-+	nbytes = 0;
-+	nbytesRead = 0;
-+	rbytes = 0;
-+	scp = NULL;
-+    }
- 
--    scp = (struct _XRRScreenConfiguration *) Xmalloc(rbytes);
-     if (scp == NULL) {
- 	_XEatData (dpy, (unsigned long) nbytes);
- 	return NULL;
-diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
-index 5ae35c5..6665092 100644
---- a/src/XrrCrtc.c
-+++ b/src/XrrCrtc.c
-@@ -24,6 +24,7 @@
- #include <config.h>
- #endif
- 
-+#include <limits.h>
- #include <stdio.h>
- #include <X11/Xlib.h>
- /* we need to be able to manipulate the Display structure on events */
-@@ -57,22 +58,33 @@ XRRGetCrtcInfo (Display *dpy, XRRScreenResources *resources, RRCrtc crtc)
- 	return NULL;
-     }
- 
--    nbytes = (long) rep.length << 2;
-+    if (rep.length < INT_MAX >> 2)
-+    {
-+	nbytes = (long) rep.length << 2;
- 
--    nbytesRead = (long) (rep.nOutput * 4 +
--			 rep.nPossibleOutput * 4);
-+	nbytesRead = (long) (rep.nOutput * 4 +
-+			     rep.nPossibleOutput * 4);
- 
--    /*
--     * first we must compute how much space to allocate for
--     * randr library's use; we'll allocate the structures in a single
--     * allocation, on cleanlyness grounds.
--     */
-+	/*
-+	 * first we must compute how much space to allocate for
-+	 * randr library's use; we'll allocate the structures in a single
-+	 * allocation, on cleanlyness grounds.
-+	 */
- 
--    rbytes = (sizeof (XRRCrtcInfo) +
--	      rep.nOutput * sizeof (RROutput) +
--	      rep.nPossibleOutput * sizeof (RROutput));
-+	rbytes = (sizeof (XRRCrtcInfo) +
-+		  rep.nOutput * sizeof (RROutput) +
-+		  rep.nPossibleOutput * sizeof (RROutput));
-+
-+	xci = (XRRCrtcInfo *) Xmalloc(rbytes);
-+    }
-+    else
-+    {
-+	nbytes = 0;
-+	nbytesRead = 0;
-+	rbytes = 0;
-+	xci = NULL;
-+    }
- 
--    xci = (XRRCrtcInfo *) Xmalloc(rbytes);
-     if (xci == NULL) {
- 	_XEatDataWords (dpy, rep.length);
- 	UnlockDisplay (dpy);
-@@ -194,12 +206,21 @@ XRRGetCrtcGamma (Display *dpy, RRCrtc crtc)
-     if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
- 	goto out;
- 
--    nbytes = (long) rep.length << 2;
-+    if (rep.length < INT_MAX >> 2)
-+    {
-+	nbytes = (long) rep.length << 2;
- 
--    /* three channels of CARD16 data */
--    nbytesRead = (rep.size * 2 * 3);
-+	/* three channels of CARD16 data */
-+	nbytesRead = (rep.size * 2 * 3);
- 
--    crtc_gamma = XRRAllocGamma (rep.size);
-+	crtc_gamma = XRRAllocGamma (rep.size);
-+    }
-+    else
-+    {
-+	nbytes = 0;
-+	nbytesRead = 0;
-+	crtc_gamma = NULL;
-+    }
- 
-     if (!crtc_gamma)
-     {
-@@ -357,7 +378,7 @@ XRRGetCrtcTransform (Display	*dpy,
-     xRRGetCrtcTransformReq	*req;
-     int				major_version, minor_version;
-     XRRCrtcTransformAttributes	*attr;
--    char			*extra = NULL, *e;
-+    char			*extra = NULL, *end = NULL, *e;
-     int				p;
- 
-     *attributes = NULL;
-@@ -395,9 +416,17 @@ XRRGetCrtcTransform (Display	*dpy,
- 	else
- 	{
- 	    int extraBytes = rep.length * 4 - CrtcTransformExtra;
--	    extra = Xmalloc (extraBytes);
-+	    if (rep.length < INT_MAX / 4 &&
-+		rep.length * 4 >= CrtcTransformExtra) {
-+		extra = Xmalloc (extraBytes);
-+		end = extra + extraBytes;
-+	    } else
-+		extra = NULL;
- 	    if (!extra) {
--		_XEatDataWords (dpy, rep.length - (CrtcTransformExtra >> 2));
-+		if (rep.length > (CrtcTransformExtra >> 2))
-+		    _XEatDataWords (dpy, rep.length - (CrtcTransformExtra >> 2));
-+		else
-+		    _XEatDataWords (dpy, rep.length);
- 		UnlockDisplay (dpy);
- 		SyncHandle ();
- 		return False;
-@@ -429,22 +458,38 @@ XRRGetCrtcTransform (Display	*dpy,
- 
-     e = extra;
- 
-+    if (e + rep.pendingNbytesFilter > end) {
-+	XFree (extra);
-+	return False;
-+    }
-     memcpy (attr->pendingFilter, e, rep.pendingNbytesFilter);
-     attr->pendingFilter[rep.pendingNbytesFilter] = '\0';
-     e += (rep.pendingNbytesFilter + 3) & ~3;
-     for (p = 0; p < rep.pendingNparamsFilter; p++) {
- 	INT32	f;
-+	if (e + 4 > end) {
-+	    XFree (extra);
-+	    return False;
-+	}
- 	memcpy (&f, e, 4);
- 	e += 4;
- 	attr->pendingParams[p] = (XFixed) f;
-     }
-     attr->pendingNparams = rep.pendingNparamsFilter;
- 
-+    if (e + rep.currentNbytesFilter > end) {
-+	XFree (extra);
-+	return False;
-+    }
-     memcpy (attr->currentFilter, e, rep.currentNbytesFilter);
-     attr->currentFilter[rep.currentNbytesFilter] = '\0';
-     e += (rep.currentNbytesFilter + 3) & ~3;
-     for (p = 0; p < rep.currentNparamsFilter; p++) {
- 	INT32	f;
-+	if (e + 4 > end) {
-+	    XFree (extra);
-+	    return False;
-+	}
- 	memcpy (&f, e, 4);
- 	e += 4;
- 	attr->currentParams[p] = (XFixed) f;
-diff --git a/src/XrrMonitor.c b/src/XrrMonitor.c
-index a9eaa7b..adc5330 100644
---- a/src/XrrMonitor.c
-+++ b/src/XrrMonitor.c
-@@ -24,6 +24,7 @@
- #include <config.h>
- #endif
- 
-+#include <limits.h>
- #include <stdio.h>
- #include <X11/Xlib.h>
- /* we need to be able to manipulate the Display structure on events */
-@@ -65,6 +66,15 @@ XRRGetMonitors(Display *dpy, Window window, Bool get_active, int *nmonitors)
- 	return NULL;
-     }
- 
-+    if (rep.length > INT_MAX >> 2 ||
-+	rep.nmonitors > INT_MAX / SIZEOF(xRRMonitorInfo) ||
-+	rep.noutputs > INT_MAX / 4 ||
-+	rep.nmonitors * SIZEOF(xRRMonitorInfo) > INT_MAX - rep.noutputs * 4) {
-+	_XEatData (dpy, rep.length);
-+	UnlockDisplay (dpy);
-+	SyncHandle ();
-+	return NULL;
-+    }
-     nbytes = (long) rep.length << 2;
-     nmon = rep.nmonitors;
-     noutput = rep.noutputs;
-@@ -111,6 +121,14 @@ XRRGetMonitors(Display *dpy, Window window, Bool get_active, int *nmonitors)
- 	    mon[m].outputs = output;
- 	    buf += SIZEOF (xRRMonitorInfo);
- 	    xoutput = (CARD32 *) buf;
-+	    if (xmon->noutput > rep.noutputs) {
-+	        Xfree(buf);
-+	        Xfree(mon);
-+	        UnlockDisplay (dpy);
-+	        SyncHandle ();
-+	        return NULL;
-+	    }
-+	    rep.noutputs -= xmon->noutput;
- 	    for (o = 0; o < xmon->noutput; o++)
- 		output[o] = xoutput[o];
- 	    output += xmon->noutput;
-diff --git a/src/XrrOutput.c b/src/XrrOutput.c
-index 85f0b6e..30f3d40 100644
---- a/src/XrrOutput.c
-+++ b/src/XrrOutput.c
-@@ -25,6 +25,7 @@
- #include <config.h>
- #endif
- 
-+#include <limits.h>
- #include <stdio.h>
- #include <X11/Xlib.h>
- /* we need to be able to manipulate the Display structure on events */
-@@ -60,6 +61,16 @@ XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output)
- 	return NULL;
-     }
- 
-+    if (rep.length > INT_MAX >> 2 || rep.length < (OutputInfoExtra >> 2))
-+    {
-+        if (rep.length > (OutputInfoExtra >> 2))
-+	    _XEatDataWords (dpy, rep.length - (OutputInfoExtra >> 2));
-+	else
-+	    _XEatDataWords (dpy, rep.length);
-+	UnlockDisplay (dpy);
-+	SyncHandle ();
-+	return NULL;
-+    }
-     nbytes = ((long) (rep.length) << 2) - OutputInfoExtra;
- 
-     nbytesRead = (long) (rep.nCrtcs * 4 +
-diff --git a/src/XrrProvider.c b/src/XrrProvider.c
-index 9e620c7..d796cd0 100644
---- a/src/XrrProvider.c
-+++ b/src/XrrProvider.c
-@@ -25,6 +25,7 @@
- #include <config.h>
- #endif
- 
-+#include <limits.h>
- #include <stdio.h>
- #include <X11/Xlib.h>
- /* we need to be able to manipulate the Display structure on events */
-@@ -59,12 +60,20 @@ XRRGetProviderResources(Display *dpy, Window window)
-       return NULL;
-     }
- 
--    nbytes = (long) rep.length << 2;
-+    if (rep.length < INT_MAX >> 2) {
-+	nbytes = (long) rep.length << 2;
- 
--    nbytesRead = (long) (rep.nProviders * 4);
-+	nbytesRead = (long) (rep.nProviders * 4);
- 
--    rbytes = (sizeof(XRRProviderResources) + rep.nProviders * sizeof(RRProvider));
--    xrpr = (XRRProviderResources *) Xmalloc(rbytes);
-+	rbytes = (sizeof(XRRProviderResources) + rep.nProviders *
-+		  sizeof(RRProvider));
-+	xrpr = (XRRProviderResources *) Xmalloc(rbytes);
-+    } else {
-+	nbytes = 0;
-+	nbytesRead = 0;
-+	rbytes = 0;
-+	xrpr = NULL;
-+    }
- 
-     if (xrpr == NULL) {
-        _XEatDataWords (dpy, rep.length);
-@@ -121,6 +130,17 @@ XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provi
- 	return NULL;
-     }
- 
-+    if (rep.length > INT_MAX >> 2 || rep.length < ProviderInfoExtra >> 2)
-+    {
-+	if (rep.length < ProviderInfoExtra >> 2)
-+	    _XEatDataWords (dpy, rep.length);
-+	else
-+	    _XEatDataWords (dpy, rep.length - (ProviderInfoExtra >> 2));
-+	UnlockDisplay (dpy);
-+	SyncHandle ();
-+	return NULL;
-+    }
-+
-     nbytes = ((long) rep.length << 2) - ProviderInfoExtra;
- 
-     nbytesRead = (long)(rep.nCrtcs * 4 +
-diff --git a/src/XrrScreen.c b/src/XrrScreen.c
-index b8ce7e5..1f7ffe6 100644
---- a/src/XrrScreen.c
-+++ b/src/XrrScreen.c
-@@ -24,6 +24,7 @@
- #include <config.h>
- #endif
- 
-+#include <limits.h>
- #include <stdio.h>
- #include <X11/Xlib.h>
- /* we need to be able to manipulate the Display structure on events */
-@@ -105,27 +106,36 @@ doGetScreenResources (Display *dpy, Window window, int poll)
- 	xrri->has_rates = _XRRHasRates (xrri->minor_version, xrri->major_version);
-     }
- 
--    nbytes = (long) rep.length << 2;
-+    if (rep.length < INT_MAX >> 2) {
-+	nbytes = (long) rep.length << 2;
- 
--    nbytesRead = (long) (rep.nCrtcs * 4 +
--			 rep.nOutputs * 4 +
--			 rep.nModes * SIZEOF (xRRModeInfo) +
--			 ((rep.nbytesNames + 3) & ~3));
-+	nbytesRead = (long) (rep.nCrtcs * 4 +
-+			     rep.nOutputs * 4 +
-+			     rep.nModes * SIZEOF (xRRModeInfo) +
-+			     ((rep.nbytesNames + 3) & ~3));
- 
--    /*
--     * first we must compute how much space to allocate for
--     * randr library's use; we'll allocate the structures in a single
--     * allocation, on cleanlyness grounds.
--     */
-+	/*
-+	 * first we must compute how much space to allocate for
-+	 * randr library's use; we'll allocate the structures in a single
-+	 * allocation, on cleanlyness grounds.
-+	 */
-+
-+	rbytes = (sizeof (XRRScreenResources) +
-+		  rep.nCrtcs * sizeof (RRCrtc) +
-+		  rep.nOutputs * sizeof (RROutput) +
-+		  rep.nModes * sizeof (XRRModeInfo) +
-+		  rep.nbytesNames + rep.nModes);    /* '\0' terminate names */
- 
--    rbytes = (sizeof (XRRScreenResources) +
--	      rep.nCrtcs * sizeof (RRCrtc) +
--	      rep.nOutputs * sizeof (RROutput) +
--	      rep.nModes * sizeof (XRRModeInfo) +
--	      rep.nbytesNames + rep.nModes);	/* '\0' terminate names */
-+	xrsr = (XRRScreenResources *) Xmalloc(rbytes);
-+	wire_names = (char *) Xmalloc (rep.nbytesNames);
-+    } else {
-+	nbytes = 0;
-+	nbytesRead = 0;
-+	rbytes = 0;
-+	xrsr = NULL;
-+	wire_names = NULL;
-+    }
- 
--    xrsr = (XRRScreenResources *) Xmalloc(rbytes);
--    wire_names = (char *) Xmalloc (rep.nbytesNames);
-     if (xrsr == NULL || wire_names == NULL) {
- 	Xfree (xrsr);
- 	Xfree (wire_names);
-@@ -174,6 +184,14 @@ doGetScreenResources (Display *dpy, Window window, int poll)
-     wire_name = wire_names;
-     for (i = 0; i < rep.nModes; i++)  {
- 	xrsr->modes[i].name = names;
-+	if (xrsr->modes[i].nameLength > rep.nbytesNames) {
-+	    Xfree (xrsr);
-+	    Xfree (wire_names);
-+	    UnlockDisplay (dpy);
-+	    SyncHandle ();
-+	    return NULL;
-+	}
-+	rep.nbytesNames -= xrsr->modes[i].nameLength;
- 	memcpy (names, wire_name, xrsr->modes[i].nameLength);
- 	names[xrsr->modes[i].nameLength] = '\0';
- 	names += xrsr->modes[i].nameLength + 1;
--- 
-cgit v0.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.0.bb
deleted file mode 100644
index 35c60b4..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.0.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "XRandR: X Resize, Rotate and Reflect extension library"
-
-DESCRIPTION = "The X Resize, Rotate and Reflect Extension, called RandR \
-for short, brings the ability to resize, rotate and reflect the root \
-window of a screen. It is based on the X Resize and Rotate Extension as \
-specified in the Proceedings of the 2001 Usenix Technical Conference \
-[RANDR]."
-
-require xorg-lib-common.inc
-
-LICENSE = "MIT-style"
-LIC_FILES_CHKSUM = "file://COPYING;md5=c9d1a2118a6cd5727521db8e7a2fee69"
-
-DEPENDS += "virtual/libx11 randrproto libxrender libxext"
-
-PE = "1"
-
-XORG_PN = "libXrandr"
-
-BBCLASSEXTEND = "native nativesdk"
-
-SRC_URI += "file://CVE-2016-7947_CVE-2016-7948.patch \
-	"
-
-SRC_URI[md5sum] = "309762867e41c6fd813da880d8a1bc93"
-SRC_URI[sha256sum] = "6f864959b7fc35db11754b270d71106ef5b5cf363426aa58589cb8ac8266de58"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.1.bb
new file mode 100644
index 0000000..48e88d2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.1.bb
@@ -0,0 +1,23 @@
+SUMMARY = "XRandR: X Resize, Rotate and Reflect extension library"
+
+DESCRIPTION = "The X Resize, Rotate and Reflect Extension, called RandR \
+for short, brings the ability to resize, rotate and reflect the root \
+window of a screen. It is based on the X Resize and Rotate Extension as \
+specified in the Proceedings of the 2001 Usenix Technical Conference \
+[RANDR]."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c9d1a2118a6cd5727521db8e7a2fee69"
+
+DEPENDS += "virtual/libx11 randrproto libxrender libxext"
+
+PE = "1"
+
+XORG_PN = "libXrandr"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "28e486f1d491b757173dd85ba34ee884"
+SRC_URI[sha256sum] = "1ff9e7fa0e4adea912b16a5f0cfa7c1d35b0dcda0e216831f7715c8a3abcf51a"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender/CVE-2016-7949.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender/CVE-2016-7949.patch
deleted file mode 100644
index 73315b1..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender/CVE-2016-7949.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 9362c7ddd1af3b168953d0737877bc52d79c94f4 Mon Sep 17 00:00:00 2001
-From: Tobias Stoeckmann <tobias@stoeckmann.org>
-Date: Sun, 25 Sep 2016 21:43:09 +0200
-Subject: Validate lengths while parsing server data.
-
-Individual lengths inside received server data can overflow
-the previously reserved memory.
-
-It is therefore important to validate every single length
-field to not overflow the previously agreed sum of all invidual
-length fields.
-
-v2: consume remaining bytes in the reply buffer on error.
-
-CVE: CVE-2016-7949
-Upstream-Status: Backport
-
-Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
-Reviewed-by: Matthieu Herrb@laas.fr
-Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
-
-diff --git a/src/Xrender.c b/src/Xrender.c
-index 3102eb2..71cf3e6 100644
---- a/src/Xrender.c
-+++ b/src/Xrender.c
-@@ -533,12 +533,30 @@ XRenderQueryFormats (Display *dpy)
- 	screen->fallback = _XRenderFindFormat (xri, xScreen->fallback);
- 	screen->subpixel = SubPixelUnknown;
- 	xDepth = (xPictDepth *) (xScreen + 1);
-+	if (screen->ndepths > rep.numDepths) {
-+	    Xfree (xri);
-+	    Xfree (xData);
-+	    _XEatDataWords (dpy, rep.length);
-+	    UnlockDisplay (dpy);
-+	    SyncHandle ();
-+	    return 0;
-+	}
-+	rep.numDepths -= screen->ndepths;
- 	for (nd = 0; nd < screen->ndepths; nd++)
- 	{
- 	    depth->depth = xDepth->depth;
- 	    depth->nvisuals = xDepth->nPictVisuals;
- 	    depth->visuals = visual;
- 	    xVisual = (xPictVisual *) (xDepth + 1);
-+	    if (depth->nvisuals > rep.numVisuals) {
-+		Xfree (xri);
-+		Xfree (xData);
-+		_XEatDataWords (dpy, rep.length);
-+		UnlockDisplay (dpy);
-+		SyncHandle ();
-+		return 0;
-+	    }
-+	    rep.numVisuals -= depth->nvisuals;
- 	    for (nv = 0; nv < depth->nvisuals; nv++)
- 	    {
- 		visual->visual = _XRenderFindVisual (dpy, xVisual->visual);
--- 
-cgit v0.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.10.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.10.bb
new file mode 100644
index 0000000..92b3102
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.10.bb
@@ -0,0 +1,24 @@
+SUMMARY = "XRender: X Rendering Extension library"
+
+DESCRIPTION = "The X Rendering Extension (Render) introduces digital \
+image composition as the foundation of a new rendering model within the \
+X Window System. Rendering geometric figures is accomplished by \
+client-side tessellation into either triangles or trapezoids.  Text is \
+drawn by loading glyphs into the server and rendering sets of them."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8bc71986d3b9b3639f6dfd6fac8f196"
+
+DEPENDS += "virtual/libx11 renderproto xproto"
+
+PE = "1"
+
+XORG_PN = "libXrender"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "802179a76bded0b658f4e9ec5e1830a4"
+SRC_URI[sha256sum] = "c06d5979f86e64cabbde57c223938db0b939dff49fdb5a793a1d3d0396650949"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb
deleted file mode 100644
index eac3679..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "XRender: X Rendering Extension library"
-
-DESCRIPTION = "The X Rendering Extension (Render) introduces digital \
-image composition as the foundation of a new rendering model within the \
-X Window System. Rendering geometric figures is accomplished by \
-client-side tessellation into either triangles or trapezoids.  Text is \
-drawn by loading glyphs into the server and rendering sets of them."
-
-require xorg-lib-common.inc
-
-LICENSE = "MIT-style"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d8bc71986d3b9b3639f6dfd6fac8f196"
-
-DEPENDS += "virtual/libx11 renderproto xproto"
-
-PE = "1"
-
-XORG_PN = "libXrender"
-
-BBCLASSEXTEND = "native nativesdk"
-
-SRC_URI += "file://CVE-2016-7949.patch \
-        "
-
-SRC_URI[md5sum] = "5db92962b124ca3a8147daae4adbd622"
-SRC_URI[sha256sum] = "fc2fe57980a14092426dffcd1f2d9de0987b9d40adea663bd70d6342c0e9be1a"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.3.bb
index 31ea439..5717fa5 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.3.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.3.bb
@@ -18,3 +18,4 @@
 
 SRC_URI[md5sum] = "ef8c2c1d16a00bd95b9fdcef63b8a2ca"
 SRC_URI[sha256sum] = "4655498a1b8e844e3d6f21f3b2c4e2b571effb5fd83199d428a6ba7ea4bf5204"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxv_1.0.10.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxv_1.0.10.bb
deleted file mode 100644
index f02b8b6..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxv_1.0.10.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "Xv: X Video extension library"
-
-DESCRIPTION = "libXv provides an X Window System client interface to the \
-X Video extension to the X protocol. The X Video extension allows for \
-accelerated drawing of videos.  Hardware adaptors are exposed to \
-clients, which may draw in a number of colourspaces, including YUV."
-
-require xorg-lib-common.inc
-
-LICENSE = "MIT-style"
-LIC_FILES_CHKSUM = "file://COPYING;md5=827da9afab1f727f2a66574629e0f39c"
-
-DEPENDS += "libxext videoproto"
-
-XORG_PN = "libXv"
-
-SRC_URI[md5sum] = "e0af49d7d758b990e6fef629722d4aca"
-SRC_URI[sha256sum] = "55fe92f8686ce8612e2c1bfaf58c057715534419da700bda8d517b1d97914525"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxv_1.0.11.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxv_1.0.11.bb
new file mode 100644
index 0000000..a226c27
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxv_1.0.11.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Xv: X Video extension library"
+
+DESCRIPTION = "libXv provides an X Window System client interface to the \
+X Video extension to the X protocol. The X Video extension allows for \
+accelerated drawing of videos.  Hardware adaptors are exposed to \
+clients, which may draw in a number of colourspaces, including YUV."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=827da9afab1f727f2a66574629e0f39c"
+
+DEPENDS += "libxext videoproto"
+
+XORG_PN = "libXv"
+
+SRC_URI[md5sum] = "210b6ef30dda2256d54763136faa37b9"
+SRC_URI[sha256sum] = "d26c13eac99ac4504c532e8e76a1c8e4bd526471eb8a0a4ff2a88db60cb0b088"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.10.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.10.bb
new file mode 100644
index 0000000..6ed49b1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.10.bb
@@ -0,0 +1,19 @@
+SUMMARY = "XvMC: X Video Motion Compensation extension library"
+
+DESCRIPTION = "XvMC extends the X Video extension (Xv) and enables \
+hardware rendered motion compensation support."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0a207f08d4961489c55046c9a5e500da \
+                    file://wrapper/XvMCWrapper.c;endline=26;md5=5151daa8172a3f1bb0cb0e0ff157d9de"
+
+DEPENDS += "libxext libxv videoproto"
+
+PE = "1"
+
+XORG_PN = "libXvMC"
+
+SRC_URI[md5sum] = "4cbe1c1def7a5e1b0ed5fce8e512f4c6"
+SRC_URI[sha256sum] = "e501a079b5dfaef0897c56152770c77e05e362065cec58910289aa567277ee2e"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.9.bb
deleted file mode 100644
index 41e8498..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.9.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-SUMMARY = "XvMC: X Video Motion Compensation extension library"
-
-DESCRIPTION = "XvMC extends the X Video extension (Xv) and enables \
-hardware rendered motion compensation support."
-
-require xorg-lib-common.inc
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=0a207f08d4961489c55046c9a5e500da \
-                    file://wrapper/XvMCWrapper.c;endline=26;md5=5151daa8172a3f1bb0cb0e0ff157d9de"
-
-DEPENDS += "libxext libxv videoproto"
-
-PE = "1"
-
-XORG_PN = "libXvMC"
-
-SRC_URI[md5sum] = "eba6b738ed5fdcd8f4203d7c8a470c79"
-SRC_URI[sha256sum] = "0703d7dff6ffc184f1735ca5d4eb9dbb402b522e08e008f2f96aee16c40a5756"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.18.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.18.bb
deleted file mode 100644
index 79fcbd8..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.18.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-SUMMARY = "Keyboard configuration database for X Window"
-
-DESCRIPTION = "The non-arch keyboard configuration database for X \
-Window.  The goal is to provide the consistent, well-structured, \
-frequently released open source of X keyboard configuration data for X \
-Window System implementations.  The project is targeted to XKB-based \
-systems."
-
-HOMEPAGE = "http://freedesktop.org/wiki/Software/XKeyboardConfig"
-BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xkeyboard-config"
-
-LICENSE = "MIT & MIT-style"
-LIC_FILES_CHKSUM = "file://COPYING;md5=0e7f21ca7db975c63467d2e7624a12f9"
-
-SRC_URI = "${XORG_MIRROR}/individual/data/xkeyboard-config/${BPN}-${PV}.tar.bz2"
-SRC_URI[md5sum] = "c28cf45616bfec276879360bc36c6b27"
-SRC_URI[sha256sum] = "c41d917d6c8a59feb7ccbda51c40a6ada824fdd1e9684b52dd48c9530617ddd0"
-
-SECTION = "x11/libs"
-DEPENDS = "intltool-native virtual/gettext util-macros libxslt-native"
-
-EXTRA_OECONF = "--with-xkb-rules-symlink=xorg --disable-runtime-deps"
-
-FILES_${PN} += "${datadir}/X11/xkb"
-
-inherit autotools pkgconfig gettext
-
-do_install_append () {
-    install -d ${D}${datadir}/X11/xkb/compiled
-    cd ${D}${datadir}/X11/xkb/rules && ln -sf base xorg
-}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.20.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.20.bb
new file mode 100644
index 0000000..d00904d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.20.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Keyboard configuration database for X Window"
+
+DESCRIPTION = "The non-arch keyboard configuration database for X \
+Window.  The goal is to provide the consistent, well-structured, \
+frequently released open source of X keyboard configuration data for X \
+Window System implementations.  The project is targeted to XKB-based \
+systems."
+
+HOMEPAGE = "http://freedesktop.org/wiki/Software/XKeyboardConfig"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xkeyboard-config"
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0e7f21ca7db975c63467d2e7624a12f9"
+
+SRC_URI = "${XORG_MIRROR}/individual/data/xkeyboard-config/${BPN}-${PV}.tar.bz2"
+SRC_URI[md5sum] = "1f68886339116ae3877052204c9b9b88"
+SRC_URI[sha256sum] = "d1bfc72553c4e3ef1cd6f13eec0488cf940498b612ab8a0b362e7090c94bc134"
+
+SECTION = "x11/libs"
+DEPENDS = "intltool-native virtual/gettext util-macros libxslt-native"
+
+EXTRA_OECONF = "--with-xkb-rules-symlink=xorg --disable-runtime-deps"
+
+FILES_${PN} += "${datadir}/X11/xkb"
+
+inherit autotools pkgconfig gettext
+
+do_install_append () {
+    install -d ${D}${datadir}/X11/xkb/compiled
+    cd ${D}${datadir}/X11/xkb/rules && ln -sf base xorg
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb
index dbb6f32..e6d32f9 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb
@@ -9,16 +9,14 @@
 
 LICENSE = "GPLv2"
 
-SRCREV = "24f3a56e541b0a9e6c6ee76081f441221a120ef9"
-PV = "1.0+git${SRCPV}"
+SRCREV = "bfdc7e052302c79c5803ad95a73c9b63b350c40c"
+PV = "1.1+git${SRCPV}"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=47e508ca280fde97906eacb77892c3ac"
 
 SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/presentproto"
 S = "${WORKDIR}/git"
 
-PR = "r1"
-
 inherit autotools
 
 BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto_7.0.29.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto_7.0.29.bb
deleted file mode 100644
index 412b6a2..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto_7.0.29.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-require xorg-proto-common.inc
-
-SUMMARY = "Xlib: C Language X interface headers"
-
-DESCRIPTION = "This package provides the basic headers for the X Window \
-System."
-
-LICENSE = "MIT & MIT-style"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b9e051107d5628966739a0b2e9b32676"
-
-PE = "1"
-
-SRC_URI += "file://xproto_fix_for_x32.patch"
-
-EXTRA_OECONF_append = " --enable-specs=no"
-BBCLASSEXTEND = "native nativesdk"
-
-SRC_URI[md5sum] = "eeeae1f47d43a33ef0d5c56727410326"
-SRC_URI[sha256sum] = "6c1a477092ca73233902b8d5f33012635c4b0208f17e7833cc7efe5c93ba9f8a"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto_7.0.31.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto_7.0.31.bb
new file mode 100644
index 0000000..febcc67
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto_7.0.31.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xlib: C Language X interface headers"
+
+DESCRIPTION = "This package provides the basic headers for the X Window \
+System."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b9e051107d5628966739a0b2e9b32676"
+
+PE = "1"
+
+SRC_URI += "file://xproto_fix_for_x32.patch"
+
+EXTRA_OECONF_append = " --enable-specs=no"
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "16791f7ca8c51a20608af11702e51083"
+SRC_URI[sha256sum] = "c6f9747da0bd3a95f86b17fb8dd5e717c8f3ab7f0ece3ba1b247899ec1ef7747"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/util-macros_1.19.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/util-macros_1.19.0.bb
deleted file mode 100644
index 26cf50f..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/util-macros_1.19.0.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-SUMMARY = "X autotools macros"
-
-DESCRIPTION = "M4 autotools macros used by various X.org programs."
-
-require xorg-util-common.inc
-
-LICENSE = "MIT & MIT-style"
-LIC_FILES_CHKSUM = "file://COPYING;md5=1970511fddd439b07a6ba789d28ff662"
-
-PE = "1"
-
-SRC_URI[md5sum] = "40e1caa49a71a26e0aa68ddd00203717"
-SRC_URI[sha256sum] = "0d4df51b29023daf2f63aebf3ebc638ea88efedfd560ab5866741ab3f92acaa1"
-
-# ${PN} is empty so we need to tweak -dev and -dbg package dependencies
-RDEPENDS_${PN}-dev = ""
-RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/util-macros_1.19.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/util-macros_1.19.1.bb
new file mode 100644
index 0000000..b39d787
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/util-macros_1.19.1.bb
@@ -0,0 +1,19 @@
+SUMMARY = "X autotools macros"
+
+DESCRIPTION = "M4 autotools macros used by various X.org programs."
+
+require xorg-util-common.inc
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1970511fddd439b07a6ba789d28ff662"
+
+PE = "1"
+
+SRC_URI[md5sum] = "3f8a8e6100556f7f28e469809805dee8"
+SRC_URI[sha256sum] = "472ad0e41d1e0abf5ecafd29460bf1b8d47e53d4b7d3abf1f66d02dc576547b8"
+
+# ${PN} is empty so we need to tweak -dev and -dbg package dependencies
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/10-preload-modules.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/10-preload-modules.conf
deleted file mode 100644
index 72e4fbf..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/10-preload-modules.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-Section "Module"
-    Load "fbdevhw"
-    Load "fb"
-    Load "shadow"
-    Load "shadowfb"
-    Load "int10"
-    Load "vbe"
-    Load "vgahw"
-EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf
index 629ae21..f4cd139 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf
@@ -2,34 +2,6 @@
 Section "Files"
 EndSection
 
-Section "InputDevice"
-    Identifier    "Generic Keyboard"
-    Driver        "evdev"
-    Option        "CoreKeyboard"
-    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
-    Option        "XkbRules"    "xorg"
-    Option        "XkbModel"    "evdev"
-    Option        "XkbLayout"    "us"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Configured Mouse"
-    Driver        "mouse"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/mice"
-    Option        "Protocol"        "ImPS/2"
-    Option        "ZAxisMapping"        "4 5"
-    Option        "Emulate3Buttons"    "true"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Qemu Tablet"
-    Driver        "evdev"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/touchscreen0"
-    Option        "USB"           "on"
-EndSection
-
 Section "Device"
     Identifier    "Graphics Controller"
     Driver        "fbdev"
@@ -62,8 +34,5 @@
 Section "ServerLayout"
     Identifier    "Default Layout"
     Screen        "Default Screen"
-    InputDevice    "Generic Keyboard"
-    # InputDevice    "Configured Mouse"
-    InputDevice    "QEMU Tablet"
     Option         "AllowEmptyInput" "no"
 EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf
index e6c8b51..1d3c64f 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf
@@ -2,34 +2,6 @@
 Section "Files"
 EndSection
 
-Section "InputDevice"
-    Identifier    "Generic Keyboard"
-    Driver        "evdev"
-    Option        "CoreKeyboard"
-    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
-    Option        "XkbRules"    "xorg"
-    Option        "XkbModel"    "evdev"
-    Option        "XkbLayout"    "us"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Configured Mouse"
-    Driver        "mouse"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/mice"
-    Option        "Protocol"        "ImPS/2"
-    Option        "ZAxisMapping"        "4 5"
-    Option        "Emulate3Buttons"    "true"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Qemu Tablet"
-    Driver        "evdev"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/touchscreen0"
-    Option        "USB"           "on"
-EndSection
-
 Section "Device"
     Identifier    "Graphics Controller"
     Driver        "fbdev"
@@ -63,8 +35,5 @@
 Section "ServerLayout"
     Identifier    "Default Layout"
     Screen        "Default Screen"
-    InputDevice    "Generic Keyboard"
-    # InputDevice    "Configured Mouse"
-    InputDevice    "QEMU Tablet"
     Option         "AllowEmptyInput" "no"
 EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf
index 629ae21..f4cd139 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf
@@ -2,34 +2,6 @@
 Section "Files"
 EndSection
 
-Section "InputDevice"
-    Identifier    "Generic Keyboard"
-    Driver        "evdev"
-    Option        "CoreKeyboard"
-    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
-    Option        "XkbRules"    "xorg"
-    Option        "XkbModel"    "evdev"
-    Option        "XkbLayout"    "us"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Configured Mouse"
-    Driver        "mouse"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/mice"
-    Option        "Protocol"        "ImPS/2"
-    Option        "ZAxisMapping"        "4 5"
-    Option        "Emulate3Buttons"    "true"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Qemu Tablet"
-    Driver        "evdev"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/touchscreen0"
-    Option        "USB"           "on"
-EndSection
-
 Section "Device"
     Identifier    "Graphics Controller"
     Driver        "fbdev"
@@ -62,8 +34,5 @@
 Section "ServerLayout"
     Identifier    "Default Layout"
     Screen        "Default Screen"
-    InputDevice    "Generic Keyboard"
-    # InputDevice    "Configured Mouse"
-    InputDevice    "QEMU Tablet"
     Option         "AllowEmptyInput" "no"
 EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf
index 629ae21..f4cd139 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf
@@ -2,34 +2,6 @@
 Section "Files"
 EndSection
 
-Section "InputDevice"
-    Identifier    "Generic Keyboard"
-    Driver        "evdev"
-    Option        "CoreKeyboard"
-    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
-    Option        "XkbRules"    "xorg"
-    Option        "XkbModel"    "evdev"
-    Option        "XkbLayout"    "us"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Configured Mouse"
-    Driver        "mouse"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/mice"
-    Option        "Protocol"        "ImPS/2"
-    Option        "ZAxisMapping"        "4 5"
-    Option        "Emulate3Buttons"    "true"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Qemu Tablet"
-    Driver        "evdev"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/touchscreen0"
-    Option        "USB"           "on"
-EndSection
-
 Section "Device"
     Identifier    "Graphics Controller"
     Driver        "fbdev"
@@ -62,8 +34,5 @@
 Section "ServerLayout"
     Identifier    "Default Layout"
     Screen        "Default Screen"
-    InputDevice    "Generic Keyboard"
-    # InputDevice    "Configured Mouse"
-    InputDevice    "QEMU Tablet"
     Option         "AllowEmptyInput" "no"
 EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf
index 629ae21..f4cd139 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf
@@ -2,34 +2,6 @@
 Section "Files"
 EndSection
 
-Section "InputDevice"
-    Identifier    "Generic Keyboard"
-    Driver        "evdev"
-    Option        "CoreKeyboard"
-    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
-    Option        "XkbRules"    "xorg"
-    Option        "XkbModel"    "evdev"
-    Option        "XkbLayout"    "us"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Configured Mouse"
-    Driver        "mouse"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/mice"
-    Option        "Protocol"        "ImPS/2"
-    Option        "ZAxisMapping"        "4 5"
-    Option        "Emulate3Buttons"    "true"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Qemu Tablet"
-    Driver        "evdev"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/touchscreen0"
-    Option        "USB"           "on"
-EndSection
-
 Section "Device"
     Identifier    "Graphics Controller"
     Driver        "fbdev"
@@ -62,8 +34,5 @@
 Section "ServerLayout"
     Identifier    "Default Layout"
     Screen        "Default Screen"
-    InputDevice    "Generic Keyboard"
-    # InputDevice    "Configured Mouse"
-    InputDevice    "QEMU Tablet"
     Option         "AllowEmptyInput" "no"
 EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf
index bbda9ea..c12d92c 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf
@@ -2,34 +2,6 @@
 Section "Files"
 EndSection
 
-Section "InputDevice"
-    Identifier    "Generic Keyboard"
-    Driver        "evdev"
-    Option        "CoreKeyboard"
-    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
-    Option        "XkbRules"    "xorg"
-    Option        "XkbModel"    "evdev"
-    Option        "XkbLayout"    "us"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Configured Mouse"
-    Driver        "vmmouse"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/mice"
-    Option        "Protocol"        "ImPS/2"
-    Option        "ZAxisMapping"        "4 5"
-    Option        "Emulate3Buttons"    "true"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Qemu Tablet"
-    Driver        "evdev"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/touchscreen0"
-    Option        "USB"           "on"
-EndSection
-
 Section "Monitor"
     Identifier    "Generic Monitor"
     Option        "DPMS"
@@ -57,8 +29,5 @@
 Section "ServerLayout"
     Identifier    "Default Layout"
     Screen        "Default Screen"
-    InputDevice    "Generic Keyboard"
-    # InputDevice    "Configured Mouse"
-    InputDevice    "QEMU Tablet"
     Option         "AllowEmptyInput" "no"
 EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf
index bbda9ea..c12d92c 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf
@@ -2,34 +2,6 @@
 Section "Files"
 EndSection
 
-Section "InputDevice"
-    Identifier    "Generic Keyboard"
-    Driver        "evdev"
-    Option        "CoreKeyboard"
-    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
-    Option        "XkbRules"    "xorg"
-    Option        "XkbModel"    "evdev"
-    Option        "XkbLayout"    "us"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Configured Mouse"
-    Driver        "vmmouse"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/mice"
-    Option        "Protocol"        "ImPS/2"
-    Option        "ZAxisMapping"        "4 5"
-    Option        "Emulate3Buttons"    "true"
-EndSection
-
-Section "InputDevice"
-    Identifier    "Qemu Tablet"
-    Driver        "evdev"
-    Option        "CorePointer"
-    Option        "Device"        "/dev/input/touchscreen0"
-    Option        "USB"           "on"
-EndSection
-
 Section "Monitor"
     Identifier    "Generic Monitor"
     Option        "DPMS"
@@ -57,8 +29,5 @@
 Section "ServerLayout"
     Identifier    "Default Layout"
     Screen        "Default Screen"
-    InputDevice    "Generic Keyboard"
-    # InputDevice    "Configured Mouse"
-    InputDevice    "QEMU Tablet"
     Option         "AllowEmptyInput" "no"
 EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
index e07c204..4c442bc 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
@@ -7,10 +7,6 @@
 
 SRC_URI = "file://xorg.conf"
 
-SRC_URI_append_libc-musl = "\
-          file://10-preload-modules.conf \
-"
-
 S = "${WORKDIR}"
 
 CONFFILES_${PN} = "${sysconfdir}/X11/xorg.conf"
@@ -25,7 +21,3 @@
 		install -m 0644 ${WORKDIR}/xorg.conf ${D}/${sysconfdir}/X11/
 	fi
 }
-
-do_install_append_libc-musl () {
-	install -Dm 0644 ${WORKDIR}/10-preload-modules.conf ${D}/${sysconfdir}/X11/xorg.conf.d/10-preload-modules.conf
-}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
index 29503b1..1650c79 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
@@ -27,7 +27,7 @@
 REQUIRED_DISTRO_FEATURES = "x11"
 
 PROTO_DEPS = "randrproto renderproto fixesproto damageproto xextproto xproto xf86dgaproto xf86miscproto xf86vidmodeproto compositeproto recordproto resourceproto videoproto scrnsaverproto  xineramaproto fontsproto kbproto inputproto bigreqsproto xcmiscproto presentproto"
-LIB_DEPS = "pixman libxfont xtrans libxau libxext libxdmcp libdrm libxkbfile libpciaccess"
+LIB_DEPS = "pixman libxfont2 xtrans libxau libxext libxdmcp libdrm libxkbfile libpciaccess"
 DEPENDS = "${PROTO_DEPS} ${LIB_DEPS} font-util"
 
 # Split out some modules and extensions from the main package
@@ -71,7 +71,7 @@
 SUMMARY_xf86-video-modesetting = "X.Org X server -- modesetting display driver"
 INSANE_SKIP_${MLPREFIX}xf86-video-modesetting = "xorg-driver-abi"
 
-XSERVER_RRECOMMENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp"
+XSERVER_RRECOMMENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput"
 RRECOMMENDS_${PN} += "${XSERVER_RRECOMMENDS}"
 RRECOMMENDS_${PN}-xwayland += "${XSERVER_RRECOMMENDS}"
 RDEPENDS_${PN}-xvfb += "xkeyboard-config"
@@ -117,12 +117,14 @@
                  --sysconfdir=/etc/X11 \
                  --localstatedir=/var \
                  --with-xkb-output=/var/lib/xkb \
+                 WAYLAND_PROTOCOLS_SYSROOT_DIR=${RECIPE_SYSROOT} \
 "
 
+OPENGL_PKGCONFIGS = "dri glx glamor dri3 xshmfence"
 PACKAGECONFIG ??= "dri2 udev ${XORG_CRYPTO} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'dri glx', '', d)} \
-                   ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "xwayland", "", d)} \
-                   ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "", d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '${OPENGL_PKGCONFIGS}', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'xwayland', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
 "
 
 PACKAGECONFIG[udev] = "--enable-config-udev,--disable-config-udev,udev"
@@ -138,7 +140,7 @@
 PACKAGECONFIG[systemd-logind] = "--enable-systemd-logind=yes,--enable-systemd-logind=no,dbus,"
 PACKAGECONFIG[systemd] = "--with-systemd-daemon,--without-systemd-daemon,systemd"
 PACKAGECONFIG[xinerama] = "--enable-xinerama,--disable-xinerama,xineramaproto"
-PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland,wayland libepoxy"
+PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland,wayland wayland-native wayland-protocols libepoxy"
 
 # Xorg requires a SHA1 implementation, pick one
 XORG_CRYPTO ??= "openssl"
@@ -170,10 +172,10 @@
                              shell=True, env=newenv, stdout=subprocess.PIPE)
         stdout, stderr = p.communicate()
         output = stdout.decode("utf-8").split(".")[0]
-        mlprefix = d.getVar('MLPREFIX', True) or ''
+        mlprefix = d.getVar('MLPREFIX') or ''
         return "%sxorg-abi-%s-%s" % (mlprefix, name, output)
 
-    pn = d.getVar("PN", True)
+    pn = d.getVar("PN")
     d.appendVar("RPROVIDES_" + pn, " " + get_abi("input"))
     d.appendVar("RPROVIDES_" + pn, " " + get_abi("video"))
 }
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch
new file mode 100644
index 0000000..16ec3ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch
@@ -0,0 +1,61 @@
+Discover monotonic clock using compile-time check
+
+monotonic clock check does not work when cross-compiling.
+
+Upstream-Status: Denied [Does not work on OpenBSD]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+
+Original patch follows:
+
+When xorg-xserver is being cross-compiled, there is currently no way
+for us to detect whether the monotonic clock is available on the
+target system, because we aren't able to run a test program on the host
+system. Currently, in this situation, we default to not use the
+monotonic clock. One problem with this situation is that the user will
+be treated as idle when the date is updated.
+
+To fix this situation, we now use a compile-time check to detect whether the
+monotonic clock is available. This check can run just fine when we are
+cross-compiling.
+
+Signed-off-by: David James <davidjames at google.com>
+---
+ configure.ac | 17 +++++++----------
+ 1 file changed, 7 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f7ab48c..26e85cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1048,19 +1048,16 @@ if ! test "x$have_clock_gettime" = xno; then
+         CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
+     fi
+ 
+-    AC_RUN_IFELSE([AC_LANG_SOURCE([
++    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #include <time.h>
+-
+-int main(int argc, char *argv[[]]) {
+-    struct timespec tp;
+-
+-    if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
++#include <unistd.h>
++int main() {
++#if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC))
++        #error No monotonic clock
++#endif
+         return 0;
+-    else
+-        return 1;
+ }
+-    ])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
+-       [MONOTONIC_CLOCK="cross compiling"])
++]])],[MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no])
+ 
+     LIBS="$LIBS_SAVE"
+     CPPFLAGS="$CPPFLAGS_SAVE"
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0002-configure.ac-Fix-wayland-scanner-and-protocols-locat.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0002-configure.ac-Fix-wayland-scanner-and-protocols-locat.patch
new file mode 100644
index 0000000..eafd07a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0002-configure.ac-Fix-wayland-scanner-and-protocols-locat.patch
@@ -0,0 +1,38 @@
+From 963428f914c42270d3312d4f0c0840565521534e Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 16 Nov 2016 00:41:51 +0200
+Subject: [PATCH 2/2] configure.ac: Fix wayland-scanner and protocols locations
+
+We want to use the wayland-scanner in path (native sysroot)
+instead of using pkg-config which gives us target paths.
+
+The protocols paths on the other hand need to be prefixed with the
+(allarch) sysroot because, again, pkg-config gives us target paths.
+
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 58f1567..383a7df 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2525,11 +2525,9 @@ if test "x$XWAYLAND" = xyes; then
+ 		AC_MSG_ERROR([Xwayland requires CLOCK_MONOTONIC support.])
+ 	fi
+ 
+-	WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
+-	AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
+-		     [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
++	AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
+ 
+-	AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
++	AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, ${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
+ fi
+ 
+ 
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch
new file mode 100644
index 0000000..beed6cb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch
@@ -0,0 +1,47 @@
+From cf407b16cd65ad6e26a9c8e5984e163409a5c0f7 Mon Sep 17 00:00:00 2001
+From: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
+Date: Mon, 30 Jan 2017 16:32:06 -0600
+Subject: [PATCH] Remove check for useSIGIO option
+
+Commit 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 removes the configure of useSIGIO
+option.
+
+As the xfree86 SIGIO support is reworked to use internal versions of OsBlockSIGIO
+and OsReleaseSIGIO.
+
+No longer the check for useSIGIO is needed
+
+Upstream-Status: Pending
+
+Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
+---
+ hw/xfree86/os-support/shared/sigio.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
+index 884a71c..be76498 100644
+--- a/hw/xfree86/os-support/shared/sigio.c
++++ b/hw/xfree86/os-support/shared/sigio.c
+@@ -185,9 +185,6 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
+     int i;
+     int installed = FALSE;
+ 
+-    if (!xf86Info.useSIGIO)
+-        return 0;
+-
+     for (i = 0; i < MAX_FUNCS; i++) {
+         if (!xf86SigIOFuncs[i].f) {
+             if (xf86IsPipe(fd))
+@@ -256,9 +253,6 @@ xf86RemoveSIGIOHandler(int fd)
+     int max;
+     int ret;
+ 
+-    if (!xf86Info.useSIGIO)
+-        return 0;
+-
+     max = 0;
+     ret = 0;
+     for (i = 0; i < MAX_FUNCS; i++) {
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch
new file mode 100644
index 0000000..5243761
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch
@@ -0,0 +1,46 @@
+From 5028ef46ff4ab0930224b71024a7349b05610d42 Mon Sep 17 00:00:00 2001
+From: Stefan Agner <stefan@agner.ch>
+Date: Thu, 22 Dec 2016 15:41:06 +0100
+Subject: [PATCH] modesetting: Fix 16 bit depth/bpp mode
+
+When setting DefaultDepth to 16 in the Screen section, the current
+code requests a 32 bpp framebuffer, however the X-Server seems to
+assumes 16 bpp.
+
+Fixes commit 21217d02168d ("modesetting: Implement 32->24 bpp
+conversion in shadow update")
+
+Signed-off-by: Stefan Agner <stefan@agner.ch>
+
+Upstream-Status: Submitted [1]
+
+[1] https://lists.x.org/archives/xorg-devel/2016-December/052113.html
+---
+ hw/xfree86/drivers/modesetting/driver.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
+index d7030e5..647ad83 100644
+--- a/hw/xfree86/drivers/modesetting/driver.c
++++ b/hw/xfree86/drivers/modesetting/driver.c
+@@ -930,7 +930,7 @@ PreInit(ScrnInfoPtr pScrn, int flags)
+                    "Using 24bpp hw front buffer with 32bpp shadow\n");
+         defaultbpp = 32;
+     } else {
+-        ms->drmmode.kbpp = defaultbpp;
++        ms->drmmode.kbpp = 0;
+     }
+     bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb;
+ 
+@@ -950,6 +950,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
+         return FALSE;
+     }
+     xf86PrintDepthBpp(pScrn);
++    if (!ms->drmmode.kbpp)
++        ms->drmmode.kbpp = pScrn->bitsPerPixel;
+ 
+     /* Process the options */
+     xf86CollectOptions(pScrn, NULL);
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2017-10971-1.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2017-10971-1.patch
new file mode 100644
index 0000000..23c8049
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2017-10971-1.patch
@@ -0,0 +1,76 @@
+From 215f894965df5fb0bb45b107d84524e700d2073c Mon Sep 17 00:00:00 2001
+From: Michal Srb <msrb@suse.com>
+Date: Wed, 24 May 2017 15:54:40 +0300
+Subject: [PATCH] dix: Disallow GenericEvent in SendEvent request.
+
+The SendEvent request holds xEvent which is exactly 32 bytes long, no more,
+no less. Both ProcSendEvent and SProcSendEvent verify that the received data
+exactly match the request size. However nothing stops the client from passing
+in event with xEvent::type = GenericEvent and any value of
+xGenericEvent::length.
+
+In the case of ProcSendEvent, the event will be eventually passed to
+WriteEventsToClient which will see that it is Generic event and copy the
+arbitrary length from the receive buffer (and possibly past it) and send it to
+the other client. This allows clients to copy unitialized heap memory out of X
+server or to crash it.
+
+In case of SProcSendEvent, it will attempt to swap the incoming event by
+calling a swapping function from the EventSwapVector array. The swapped event
+is written to target buffer, which in this case is local xEvent variable. The
+xEvent variable is 32 bytes long, but the swapping functions for GenericEvents
+expect that the target buffer has size matching the size of the source
+GenericEvent. This allows clients to cause stack buffer overflows.
+
+Signed-off-by: Michal Srb <msrb@suse.com>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+CVE: CVE-2017-10971
+
+Upstream-Status: Backport [https://cgit.freedesktop.org/xorg/xserver/commit/?id=215f894965df5fb0bb45b107d84524e700d2073c]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ dix/events.c  |    6 ++++++
+ dix/swapreq.c |    7 +++++++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/dix/events.c b/dix/events.c
+index 3e3a01e..d3a33ea 100644
+--- a/dix/events.c
++++ b/dix/events.c
+@@ -5366,6 +5366,12 @@ ProcSendEvent(ClientPtr client)
+         client->errorValue = stuff->event.u.u.type;
+         return BadValue;
+     }
++    /* Generic events can have variable size, but SendEvent request holds
++       exactly 32B of event data. */
++    if (stuff->event.u.u.type == GenericEvent) {
++        client->errorValue = stuff->event.u.u.type;
++        return BadValue;
++    }
+     if (stuff->event.u.u.type == ClientMessage &&
+         stuff->event.u.u.detail != 8 &&
+         stuff->event.u.u.detail != 16 && stuff->event.u.u.detail != 32) {
+diff --git a/dix/swapreq.c b/dix/swapreq.c
+index 719e9b8..6785059 100644
+--- a/dix/swapreq.c
++++ b/dix/swapreq.c
+@@ -292,6 +292,13 @@ SProcSendEvent(ClientPtr client)
+     swapl(&stuff->destination);
+     swapl(&stuff->eventMask);
+ 
++    /* Generic events can have variable size, but SendEvent request holds
++       exactly 32B of event data. */
++    if (stuff->event.u.u.type == GenericEvent) {
++        client->errorValue = stuff->event.u.u.type;
++        return BadValue;
++    }
++
+     /* Swap event */
+     proc = EventSwapVector[stuff->event.u.u.type & 0177];
+     if (!proc || proc == NotImplemented)        /* no swapping proc; invalid event type? */
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2017-10971-2.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2017-10971-2.patch
new file mode 100644
index 0000000..5c9887a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2017-10971-2.patch
@@ -0,0 +1,55 @@
+From 8caed4df36b1f802b4992edcfd282cbeeec35d9d Mon Sep 17 00:00:00 2001
+From: Michal Srb <msrb@suse.com>
+Date: Wed, 24 May 2017 15:54:41 +0300
+Subject: [PATCH] Xi: Verify all events in ProcXSendExtensionEvent.
+
+The requirement is that events have type in range
+EXTENSION_EVENT_BASE..lastEvent, but it was tested
+only for first event of all.
+
+Signed-off-by: Michal Srb <msrb@suse.com>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+CVE: CVE-2017-10971
+
+Upstream-Status: Backport [https://cgit.freedesktop.org/xorg/xserver/commit/?id=8caed4df36b1f802b4992edcfd282cbeeec35d9d]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ Xi/sendexev.c |   12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/Xi/sendexev.c b/Xi/sendexev.c
+index 1cf118a..5e63bfc 100644
+--- a/Xi/sendexev.c
++++ b/Xi/sendexev.c
+@@ -117,7 +117,7 @@ SProcXSendExtensionEvent(ClientPtr client)
+ int
+ ProcXSendExtensionEvent(ClientPtr client)
+ {
+-    int ret;
++    int ret, i;
+     DeviceIntPtr dev;
+     xEvent *first;
+     XEventClass *list;
+@@ -141,10 +141,12 @@ ProcXSendExtensionEvent(ClientPtr client)
+     /* The client's event type must be one defined by an extension. */
+ 
+     first = ((xEvent *) &stuff[1]);
+-    if (!((EXTENSION_EVENT_BASE <= first->u.u.type) &&
+-          (first->u.u.type < lastEvent))) {
+-        client->errorValue = first->u.u.type;
+-        return BadValue;
++    for (i = 0; i < stuff->num_events; i++) {
++        if (!((EXTENSION_EVENT_BASE <= first[i].u.u.type) &&
++            (first[i].u.u.type < lastEvent))) {
++            client->errorValue = first[i].u.u.type;
++            return BadValue;
++        }
+     }
+ 
+     list = (XEventClass *) (first + stuff->num_events);
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2017-10971-3.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2017-10971-3.patch
new file mode 100644
index 0000000..54ba481
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2017-10971-3.patch
@@ -0,0 +1,50 @@
+From ba336b24052122b136486961c82deac76bbde455 Mon Sep 17 00:00:00 2001
+From: Michal Srb <msrb@suse.com>
+Date: Wed, 24 May 2017 15:54:42 +0300
+Subject: [PATCH] Xi: Do not try to swap GenericEvent.
+
+The SProcXSendExtensionEvent must not attempt to swap GenericEvent because
+it is assuming that the event has fixed size and gives the swapping function
+xEvent-sized buffer.
+
+A GenericEvent would be later rejected by ProcXSendExtensionEvent anyway.
+
+Signed-off-by: Michal Srb <msrb@suse.com>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+CVE: CVE-2017-10971
+
+Upstream-Status: Backport [https://cgit.freedesktop.org/xorg/xserver/commit/?id=ba336b24052122b136486961c82deac76bbde455]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ Xi/sendexev.c |   10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/Xi/sendexev.c b/Xi/sendexev.c
+index 5e63bfc..5c2e0fc 100644
+--- a/Xi/sendexev.c
++++ b/Xi/sendexev.c
+@@ -95,9 +95,17 @@ SProcXSendExtensionEvent(ClientPtr client)
+ 
+     eventP = (xEvent *) &stuff[1];
+     for (i = 0; i < stuff->num_events; i++, eventP++) {
++        if (eventP->u.u.type == GenericEvent) {
++            client->errorValue = eventP->u.u.type;
++            return BadValue;
++        }
++
+         proc = EventSwapVector[eventP->u.u.type & 0177];
+-        if (proc == NotImplemented)     /* no swapping proc; invalid event type? */
++        /* no swapping proc; invalid event type? */
++        if (proc == NotImplemented) {
++            client->errorValue = eventP->u.u.type;
+             return BadValue;
++        }
+         (*proc) (eventP, &eventT);
+         *eventP = eventT;
+     }
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.4.bb
deleted file mode 100644
index 6700565..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.4.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-require xserver-xorg.inc
-
-SRC_URI += "file://musl-arm-inb-outb.patch"
-SRC_URI[md5sum] = "d4842dfe3bd9a9d062f2fa1df9104a46"
-SRC_URI[sha256sum] = "278459b2c31d61a15655d95a72fb79930c480a6bb8cf9226e48a07df8b1d31c8"
-
-# These extensions are now integrated into the server, so declare the migration
-# path for in-place upgrades.
-
-RREPLACES_${PN} =  "${PN}-extension-dri \
-                    ${PN}-extension-dri2 \
-                    ${PN}-extension-record \
-                    ${PN}-extension-extmod \
-                    ${PN}-extension-dbe \
-                   "
-RPROVIDES_${PN} =  "${PN}-extension-dri \
-                    ${PN}-extension-dri2 \
-                    ${PN}-extension-record \
-                    ${PN}-extension-extmod \
-                    ${PN}-extension-dbe \
-                   "
-RCONFLICTS_${PN} = "${PN}-extension-dri \
-                    ${PN}-extension-dri2 \
-                    ${PN}-extension-record \
-                    ${PN}-extension-extmod \
-                    ${PN}-extension-dbe \
-                   "
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.19.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.19.1.bb
new file mode 100644
index 0000000..0d6df32
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.19.1.bb
@@ -0,0 +1,35 @@
+require xserver-xorg.inc
+
+SRC_URI += "file://musl-arm-inb-outb.patch \
+            file://0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch \
+            file://0002-configure.ac-Fix-wayland-scanner-and-protocols-locat.patch \
+            file://0003-modesetting-Fix-16-bit-depth-bpp-mode.patch \
+            file://0003-Remove-check-for-useSIGIO-option.patch \
+            file://CVE-2017-10971-1.patch \
+            file://CVE-2017-10971-2.patch \
+            file://CVE-2017-10971-3.patch \
+            "
+SRC_URI[md5sum] = "caa8ee7b2950abbf734347d137529fb6"
+SRC_URI[sha256sum] = "79ae2cf39d3f6c4a91201d8dad549d1d774b3420073c5a70d390040aa965a7fb"
+
+# These extensions are now integrated into the server, so declare the migration
+# path for in-place upgrades.
+
+RREPLACES_${PN} =  "${PN}-extension-dri \
+                    ${PN}-extension-dri2 \
+                    ${PN}-extension-record \
+                    ${PN}-extension-extmod \
+                    ${PN}-extension-dbe \
+                   "
+RPROVIDES_${PN} =  "${PN}-extension-dri \
+                    ${PN}-extension-dri2 \
+                    ${PN}-extension-record \
+                    ${PN}-extension-extmod \
+                    ${PN}-extension-dbe \
+                   "
+RCONFLICTS_${PN} = "${PN}-extension-dri \
+                    ${PN}-extension-dri2 \
+                    ${PN}-extension-record \
+                    ${PN}-extension-extmod \
+                    ${PN}-extension-dbe \
+                   "
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev.inc b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev.inc
index 22c6977..4ae0a2b 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev.inc
+++ b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev.inc
@@ -5,7 +5,9 @@
 
 SRC_URI = "http://nwl.cc/pub/cryptodev-linux/cryptodev-linux-${PV}.tar.gz \
            file://06d6b560c6e45dc317dae47c74706fa43f4a31d8.patch \
-           file://cb186f682679383e8b5806240927903730ce85d9.patch"
+           file://cb186f682679383e8b5806240927903730ce85d9.patch \
+           file://0001-Adjust-to-another-change-in-the-user-page-API.patch \
+           file://kernel-4-10-changes.patch"
 
 SRC_URI[md5sum] = "02644cc4cd02301e0b503a332eb2f0b5"
 SRC_URI[sha256sum] = "67fabde9fb67b286a96c4f45b594b0eccd0f761b495705c18f2ae9461b831376"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/0001-Adjust-to-another-change-in-the-user-page-API.patch b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/0001-Adjust-to-another-change-in-the-user-page-API.patch
new file mode 100644
index 0000000..fb75278
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/0001-Adjust-to-another-change-in-the-user-page-API.patch
@@ -0,0 +1,40 @@
+From f126e4837e6334d0464540995df7426fedf6b175 Mon Sep 17 00:00:00 2001
+From: Michael Weiser <michael.weiser@gmx.de>
+Date: Fri, 11 Nov 2016 18:09:32 +0100
+Subject: [PATCH] Adjust to another change in the user page API
+
+4.9.0 will replace the write and force flags of get_user_pages_remote()
+with a gup_flags parameter[1]. Distinguish the two APIs based on kernel
+version we're compiling for.
+
+[1] https://github.com/torvalds/linux/commit/9beae1ea89305a9667ceaab6d0bf46a045ad71e7
+
+Upstream-Status: Backport
+
+Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
+---
+ zc.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/zc.c b/zc.c
+index a97b49f..e766ee3 100644
+--- a/zc.c
++++ b/zc.c
+@@ -65,7 +65,13 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
+ 	ret = get_user_pages(
+ #endif
+ 			task, mm,
+-			(unsigned long)addr, pgcount, write, 0, pg, NULL);
++			(unsigned long)addr, pgcount,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
++			write ? FOLL_WRITE : 0,
++#else
++			write, 0,
++#endif
++			pg, NULL);
+ 	up_read(&mm->mmap_sem);
+ 	if (ret != pgcount)
+ 		return -EINVAL;
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/kernel-4-10-changes.patch b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/kernel-4-10-changes.patch
new file mode 100644
index 0000000..93d608b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/kernel-4-10-changes.patch
@@ -0,0 +1,57 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 2b29be8ac41414ed19cb4f5d5626d9bd0d7b11a8 Mon Sep 17 00:00:00 2001
+From: Cristian Stoica <cristian.stoica@nxp.com>
+Date: Wed, 8 Feb 2017 12:11:04 +0200
+Subject: [PATCH] adjust to API changes in kernel >=4.10
+
+There are many changes related to get_user_pages and the code is rewritten
+for clarity.
+
+Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
+---
+ zc.c | 28 +++++++++++++++++-----------
+ 1 file changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/zc.c b/zc.c
+index e766ee3..2f4ea99 100644
+--- a/zc.c
++++ b/zc.c
+@@ -59,19 +59,25 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
+ 	}
+ 
+ 	down_read(&mm->mmap_sem);
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
+-	ret = get_user_pages_remote(
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0))
++	ret = get_user_pages(task, mm,
++			(unsigned long)addr, pgcount, write, 0, pg, NULL);
+ #else
+-	ret = get_user_pages(
+-#endif
+-			task, mm,
+-			(unsigned long)addr, pgcount,
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
+-			write ? FOLL_WRITE : 0,
+-#else
+-			write, 0,
+-#endif
++#  if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0))
++	ret = get_user_pages_remote(task, mm,
++			(unsigned long)addr, pgcount, write, 0, pg, NULL);
++#  else
++#    if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0))
++	ret = get_user_pages_remote(task, mm,
++			(unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
+ 			pg, NULL);
++#    else
++	ret = get_user_pages_remote(task, mm,
++			(unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
++			pg, NULL, NULL);
++#    endif
++#  endif
++#endif
+ 	up_read(&mm->mmap_sem);
+ 	if (ret != pgcount)
+ 		return -EINVAL;
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc_1.4.2.bb b/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc_1.4.2.bb
new file mode 100644
index 0000000..cc72adc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc_1.4.2.bb
@@ -0,0 +1,10 @@
+require dtc.inc
+
+LIC_FILES_CHKSUM = "file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
+		    file://libfdt/libfdt.h;beginline=3;endline=52;md5=fb360963151f8ec2d6c06b055bcbb68c"
+
+SRCREV = "ec02b34c05be04f249ffaaca4b666f5246877dea"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc_git.bb
deleted file mode 100644
index 4446142..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc_git.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-require dtc.inc
-
-LIC_FILES_CHKSUM = "file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
-		    file://libfdt/libfdt.h;beginline=3;endline=52;md5=fb360963151f8ec2d6c06b055bcbb68c"
-
-SRCREV = "302fca9f4c283e1994cf0a5a9ce1cf43ca15e6d2"
-PV = "1.4.1+git${SRCPV}"
-
-S = "${WORKDIR}/git"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
index 8af0155..5e65469 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
@@ -4,7 +4,7 @@
 
 DEPENDS = "git-native"
 
-SRCREV = "85564e69555b713c2759d58ec5ade54424d051d8"
+SRCREV = "bd7447cd6274d764a129dcdc246cdbfd8c47b991"
 PR = "r12"
 PV = "0.2+git${SRCPV}"
 
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-kexec-exntend-the-semantics-of-kexec_iomem_for_each_.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-kexec-exntend-the-semantics-of-kexec_iomem_for_each_.patch
new file mode 100644
index 0000000..822f28c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-kexec-exntend-the-semantics-of-kexec_iomem_for_each_.patch
@@ -0,0 +1,78 @@
+From 02eed0f8f2748fd7579f69e5373445b52b2b8754 Mon Sep 17 00:00:00 2001
+From: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Date: Mon, 17 Oct 2016 13:56:58 +0900
+Subject: [PATCH 1/9] kexec: exntend the semantics of kexec_iomem_for_each_line
+
+The current kexec_iomem_for_each_line() counts up all the lines for which
+a callback function returns zero(0) or positive, and otherwise it stops
+further scanning.
+This behavior is incovenient in some cases. For instance, on arm64, we want
+to count up "System RAM" entries, but need to skip "reserved" entries.
+
+So this patch extends the semantics so that we will continue to scan
+succeeding entries but not count lines for which a callback function
+returns positive.
+
+The current users of kexec_iomem_for_each_line(), arm, sh and x86, will not
+be affected by this change because
+* arm
+  The callback function only returns -1 or 0, and the return value of
+  kexec_iomem_for_each_line() will never be used.
+* sh, x86
+  The callback function may return (-1 for sh,) 0 or 1, but always returns
+  1 once we have reached the maximum number of entries allowed.
+  Even so the current kexec_iomem_for_each_line() counts them up.
+  This change actually fixes this bug.
+
+Upstream-Status: Backport [https://git.linaro.org/people/takahiro.akashi/kexec-tools.git]
+
+Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ kexec/kexec-iomem.c | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/kexec/kexec-iomem.c b/kexec/kexec-iomem.c
+index 485a2e8..0a0277a 100644
+--- a/kexec/kexec-iomem.c
++++ b/kexec/kexec-iomem.c
+@@ -18,6 +18,9 @@
+  * Iterate over each line in the file returned by proc_iomem(). If match is
+  * NULL or if the line matches with our match-pattern then call the
+  * callback if non-NULL.
++ * If match is NULL, callback should return a negative if error.
++ * Otherwise the interation goes on, incrementing nr but only if callback
++ * returns 0 (matched).
+  *
+  * Return the number of lines matched.
+  */
+@@ -37,7 +40,7 @@ int kexec_iomem_for_each_line(char *match,
+ 	char *str;
+ 	int consumed;
+ 	int count;
+-	int nr = 0;
++	int nr = 0, ret;
+ 
+ 	fp = fopen(iomem, "r");
+ 	if (!fp)
+@@ -50,11 +53,13 @@ int kexec_iomem_for_each_line(char *match,
+ 		str = line + consumed;
+ 		size = end - start + 1;
+ 		if (!match || memcmp(str, match, strlen(match)) == 0) {
+-			if (callback
+-			    && callback(data, nr, str, start, size) < 0) {
+-				break;
++			if (callback) {
++				ret = callback(data, nr, str, start, size);
++				if (ret < 0)
++					break;
++				else if (ret == 0)
++					nr++;
+ 			}
+-			nr++;
+ 		}
+ 	}
+ 
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-x86-x86_64-Fix-format-warning-with-die.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-x86-x86_64-Fix-format-warning-with-die.patch
new file mode 100644
index 0000000..e601f52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-x86-x86_64-Fix-format-warning-with-die.patch
@@ -0,0 +1,78 @@
+Upstream-Status: Backport
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+From 1550f81bf1886aa0520da0b6181cd61c1a75d4ad Mon Sep 17 00:00:00 2001
+From: Pratyush Anand <panand@redhat.com>
+Date: Tue, 14 Mar 2017 17:59:22 +0530
+Subject: [PATCH 1/2] x86/x86_64: Fix format warning with die()
+
+Fedora koji uses gcc version 7.0.1-0.12.fc27, and it generates a build
+warning
+
+   kexec/arch/i386/kexec-elf-x86.c:299:3: error: format not a string
+   literal and no format arguments [-Werror=format-security]
+       die(error_msg);
+       ^~~
+    cc1: some warnings being treated as errors
+
+error_msg can have a format specifier as well in string. In such cases,
+if there is no other arguments for the format variable then code will
+try to access a non existing argument. Therefore, use 1st argument as
+format specifier for string print and pass error_msg as the string to be
+printed.
+
+While doing that,also use const qualifier before "char *error_msg".
+
+Signed-off-by: Pratyush Anand <panand@redhat.com>
+Signed-off-by: Simon Horman <horms@verge.net.au>
+---
+ kexec/arch/i386/kexec-elf-x86.c      | 4 ++--
+ kexec/arch/x86_64/kexec-elf-x86_64.c | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/kexec/arch/i386/kexec-elf-x86.c b/kexec/arch/i386/kexec-elf-x86.c
+index de00dcb..fedf031 100644
+--- a/kexec/arch/i386/kexec-elf-x86.c
++++ b/kexec/arch/i386/kexec-elf-x86.c
+@@ -91,7 +91,7 @@ int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
+ 	char *command_line = NULL, *modified_cmdline = NULL;
+ 	const char *append = NULL;
+ 	char *tmp_cmdline = NULL;
+-	char *error_msg = NULL;
++	const char *error_msg = NULL;
+ 	int result;
+ 	int command_line_len;
+ 	const char *ramdisk;
+@@ -296,6 +296,6 @@ out:
+ 	free(command_line);
+ 	free(modified_cmdline);
+ 	if (error_msg)
+-		die(error_msg);
++		die("%s", error_msg);
+ 	return result;
+ }
+diff --git a/kexec/arch/x86_64/kexec-elf-x86_64.c b/kexec/arch/x86_64/kexec-elf-x86_64.c
+index ae65692..ad22311 100644
+--- a/kexec/arch/x86_64/kexec-elf-x86_64.c
++++ b/kexec/arch/x86_64/kexec-elf-x86_64.c
+@@ -99,7 +99,7 @@ int elf_x86_64_load(int argc, char **argv, const char *buf, off_t len,
+ #define ARG_STYLE_NONE  2
+ 	int opt;
+ 	int result = 0;
+-	char *error_msg = NULL;
++	const char *error_msg = NULL;
+ 
+ 	/* See options.h and add any new options there too! */
+ 	static const struct option options[] = {
+@@ -276,6 +276,6 @@ out:
+ 	free(command_line);
+ 	free(modified_cmdline);
+ 	if (error_msg)
+-		die(error_msg);
++		die("%s", error_msg);
+ 	return result;
+ }
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0002-kexec-generalize-and-rename-get_kernel_stext_sym.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0002-kexec-generalize-and-rename-get_kernel_stext_sym.patch
new file mode 100644
index 0000000..953f13b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0002-kexec-generalize-and-rename-get_kernel_stext_sym.patch
@@ -0,0 +1,194 @@
+From d29f37bb6e9114aba96c606103b110f511bee9a1 Mon Sep 17 00:00:00 2001
+From: Pratyush Anand <panand@redhat.com>
+Date: Wed, 2 Nov 2016 15:05:25 +0530
+Subject: [PATCH 2/9] kexec: generalize and rename get_kernel_stext_sym()
+
+get_kernel_stext_sym() has been defined for both arm and i386. Other
+architecture might need some other kernel symbol address. Therefore rewrite
+this function as generic function to get any kernel symbol address.
+
+More over, kallsyms is not arch specific representation, therefore have
+common function for all arches.
+
+Upstream-Status: Backport [https://git.linaro.org/people/takahiro.akashi/kexec-tools.git]
+
+Signed-off-by: Pratyush Anand <panand@redhat.com>
+[created symbols.c]
+Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ kexec/Makefile                  |  1 +
+ kexec/arch/arm/crashdump-arm.c  | 40 +---------------------------------------
+ kexec/arch/i386/crashdump-x86.c | 29 -----------------------------
+ kexec/kexec.h                   |  2 ++
+ kexec/symbols.c                 | 41 +++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 45 insertions(+), 68 deletions(-)
+ create mode 100644 kexec/symbols.c
+
+diff --git a/kexec/Makefile b/kexec/Makefile
+index 39f365f..2b4fb3d 100644
+--- a/kexec/Makefile
++++ b/kexec/Makefile
+@@ -26,6 +26,7 @@ KEXEC_SRCS_base += kexec/kernel_version.c
+ KEXEC_SRCS_base += kexec/lzma.c
+ KEXEC_SRCS_base += kexec/zlib.c
+ KEXEC_SRCS_base += kexec/kexec-xen.c
++KEXEC_SRCS_base += kexec/symbols.c
+ 
+ KEXEC_GENERATED_SRCS += $(PURGATORY_HEX_C)
+ 
+diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
+index 4a89b5e..245c21a 100644
+--- a/kexec/arch/arm/crashdump-arm.c
++++ b/kexec/arch/arm/crashdump-arm.c
+@@ -73,48 +73,10 @@ static struct crash_elf_info elf_info = {
+ 
+ extern unsigned long long user_page_offset;
+ 
+-/* Retrieve kernel _stext symbol virtual address from /proc/kallsyms */
+-static unsigned long long get_kernel_stext_sym(void)
+-{
+-	const char *kallsyms = "/proc/kallsyms";
+-	const char *stext = "_stext";
+-	char sym[128];
+-	char line[128];
+-	FILE *fp;
+-	unsigned long long vaddr = 0;
+-	char type;
+-
+-	fp = fopen(kallsyms, "r");
+-	if (!fp) {
+-		fprintf(stderr, "Cannot open %s\n", kallsyms);
+-		return 0;
+-	}
+-
+-	while(fgets(line, sizeof(line), fp) != NULL) {
+-		unsigned long long addr;
+-
+-		if (sscanf(line, "%Lx %c %s", &addr, &type, sym) != 3)
+-			continue;
+-
+-		if (strcmp(sym, stext) == 0) {
+-			dbgprintf("kernel symbol %s vaddr = %#llx\n", stext, addr);
+-			vaddr = addr;
+-			break;
+-		}
+-	}
+-
+-	fclose(fp);
+-
+-	if (vaddr == 0)
+-		fprintf(stderr, "Cannot get kernel %s symbol address\n", stext);
+-
+-	return vaddr;
+-}
+-
+ static int get_kernel_page_offset(struct kexec_info *info,
+ 		struct crash_elf_info *elf_info)
+ {
+-	unsigned long long stext_sym_addr = get_kernel_stext_sym();
++	unsigned long long stext_sym_addr = get_kernel_sym("_stext");
+ 	if (stext_sym_addr == 0) {
+ 		if (user_page_offset != (-1ULL)) {
+ 			elf_info->page_offset = user_page_offset;
+diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
+index ab833d4..abf82a5 100644
+--- a/kexec/arch/i386/crashdump-x86.c
++++ b/kexec/arch/i386/crashdump-x86.c
+@@ -102,35 +102,6 @@ static int get_kernel_paddr(struct kexec_info *UNUSED(info),
+ 	return -1;
+ }
+ 
+-/* Retrieve kernel symbol virtual address from /proc/kallsyms */
+-static unsigned long long get_kernel_sym(const char *symbol)
+-{
+-	const char *kallsyms = "/proc/kallsyms";
+-	char sym[128];
+-	char line[128];
+-	FILE *fp;
+-	unsigned long long vaddr;
+-	char type;
+-
+-	fp = fopen(kallsyms, "r");
+-	if (!fp) {
+-		fprintf(stderr, "Cannot open %s\n", kallsyms);
+-		return 0;
+-	}
+-
+-	while(fgets(line, sizeof(line), fp) != NULL) {
+-		if (sscanf(line, "%Lx %c %s", &vaddr, &type, sym) != 3)
+-			continue;
+-		if (strcmp(sym, symbol) == 0) {
+-			dbgprintf("kernel symbol %s vaddr = %16llx\n", symbol, vaddr);
+-			return vaddr;
+-		}
+-	}
+-
+-	fprintf(stderr, "Cannot get kernel %s symbol address\n", symbol);
+-	return 0;
+-}
+-
+ /* Retrieve info regarding virtual address kernel has been compiled for and
+  * size of the kernel from /proc/kcore. Current /proc/kcore parsing from
+  * from kexec-tools fails because of malformed elf notes. A kernel patch has
+diff --git a/kexec/kexec.h b/kexec/kexec.h
+index 9194f1c..b4fafad 100644
+--- a/kexec/kexec.h
++++ b/kexec/kexec.h
+@@ -312,4 +312,6 @@ int xen_kexec_load(struct kexec_info *info);
+ int xen_kexec_unload(uint64_t kexec_flags);
+ void xen_kexec_exec(void);
+ 
++extern unsigned long long get_kernel_sym(const char *text);
++
+ #endif /* KEXEC_H */
+diff --git a/kexec/symbols.c b/kexec/symbols.c
+new file mode 100644
+index 0000000..ea6e327
+--- /dev/null
++++ b/kexec/symbols.c
+@@ -0,0 +1,41 @@
++#include <stdio.h>
++#include <string.h>
++#include "kexec.h"
++
++/* Retrieve kernel symbol virtual address from /proc/kallsyms */
++unsigned long long get_kernel_sym(const char *text)
++{
++	const char *kallsyms = "/proc/kallsyms";
++	char sym[128];
++	char line[128];
++	FILE *fp;
++	unsigned long long vaddr = 0;
++	char type;
++
++	fp = fopen(kallsyms, "r");
++	if (!fp) {
++		fprintf(stderr, "Cannot open %s\n", kallsyms);
++		return 0;
++	}
++
++	while (fgets(line, sizeof(line), fp) != NULL) {
++		unsigned long long addr;
++
++		if (sscanf(line, "%Lx %c %s", &addr, &type, sym) != 3)
++			continue;
++
++		if (strcmp(sym, text) == 0) {
++			dbgprintf("kernel symbol %s vaddr = %#llx\n",
++								text, addr);
++			vaddr = addr;
++			break;
++		}
++	}
++
++	fclose(fp);
++
++	if (vaddr == 0)
++		fprintf(stderr, "Cannot get kernel %s symbol address\n", text);
++
++	return vaddr;
++}
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0002-ppc-Fix-format-warning-with-die.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0002-ppc-Fix-format-warning-with-die.patch
new file mode 100644
index 0000000..6a1c06d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0002-ppc-Fix-format-warning-with-die.patch
@@ -0,0 +1,43 @@
+From 1c956fc8c6b6324d8d38bba5f9e60a018051c6f5 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 16 Mar 2017 15:39:06 +0200
+Subject: [PATCH 2/2] ppc: Fix format warning with die()
+
+Enable compiling kexec-tools for ppc with -Werror=format-security.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Submitted [Mailing list]
+---
+ kexec/arch/ppc/kexec-elf-ppc.c    | 2 +-
+ kexec/arch/ppc/kexec-uImage-ppc.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/kexec/arch/ppc/kexec-elf-ppc.c b/kexec/arch/ppc/kexec-elf-ppc.c
+index 291f06d..ad43ad1 100644
+--- a/kexec/arch/ppc/kexec-elf-ppc.c
++++ b/kexec/arch/ppc/kexec-elf-ppc.c
+@@ -453,7 +453,7 @@ out:
+ 	if (!tmp_cmdline)
+ 		free(command_line);
+ 	if (error_msg)
+-		die(error_msg);
++		die("%s", error_msg);
+ 
+ 	return result;
+ }
+diff --git a/kexec/arch/ppc/kexec-uImage-ppc.c b/kexec/arch/ppc/kexec-uImage-ppc.c
+index 5eec6e4..e8f7adc 100644
+--- a/kexec/arch/ppc/kexec-uImage-ppc.c
++++ b/kexec/arch/ppc/kexec-uImage-ppc.c
+@@ -306,7 +306,7 @@ out:
+ 	if (!tmp_cmdline)
+ 		free(command_line);
+ 	if (error_msg)
+-		die(error_msg);
++		die("%s", error_msg);
+ 	return ret;
+ }
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0003-arm64-identify-PHYS_OFFSET-correctly.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0003-arm64-identify-PHYS_OFFSET-correctly.patch
new file mode 100644
index 0000000..1a1c317
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0003-arm64-identify-PHYS_OFFSET-correctly.patch
@@ -0,0 +1,76 @@
+From 16df170ad4808d12acd5e919ac4f6e7f33a247b3 Mon Sep 17 00:00:00 2001
+From: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Date: Thu, 1 Sep 2016 10:57:42 +0900
+Subject: [PATCH 3/9] arm64: identify PHYS_OFFSET correctly
+
+Due to the kernel patch, commit e7cd190385d1 ("arm64: mark reserved
+memblock regions explicitly in iomem"), the current code will not be able
+to identify the correct value of PHYS_OFFSET if some "reserved" memory
+region, which is likely to be UEFI runtime services code/data, exists at
+an address below the first "System RAM" regions.
+
+This patch fixes this issue.
+
+Upstream-Status: Backport [https://git.linaro.org/people/takahiro.akashi/kexec-tools.git]
+
+Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ kexec/arch/arm64/iomem.h       |  7 +++++++
+ kexec/arch/arm64/kexec-arm64.c | 12 ++++++++++--
+ 2 files changed, 17 insertions(+), 2 deletions(-)
+ create mode 100644 kexec/arch/arm64/iomem.h
+
+diff --git a/kexec/arch/arm64/iomem.h b/kexec/arch/arm64/iomem.h
+new file mode 100644
+index 0000000..7fd66eb
+--- /dev/null
++++ b/kexec/arch/arm64/iomem.h
+@@ -0,0 +1,7 @@
++#ifndef IOMEM_H
++#define IOMEM_H
++
++#define SYSTEM_RAM		"System RAM\n"
++#define IOMEM_RESERVED		"reserved\n"
++
++#endif
+diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
+index 2e8839a..8ac811d 100644
+--- a/kexec/arch/arm64/kexec-arm64.c
++++ b/kexec/arch/arm64/kexec-arm64.c
+@@ -21,6 +21,7 @@
+ #include "crashdump-arm64.h"
+ #include "dt-ops.h"
+ #include "fs2dt.h"
++#include "iomem.h"
+ #include "kexec-syscall.h"
+ #include "arch/options.h"
+ 
+@@ -475,7 +476,14 @@ static int get_memory_ranges_iomem_cb(void *data, int nr, char *str,
+ 		return -1;
+ 
+ 	r = (struct memory_range *)data + nr;
+-	r->type = RANGE_RAM;
++
++	if (!strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM)))
++		r->type = RANGE_RAM;
++	else if (!strncmp(str, IOMEM_RESERVED, strlen(IOMEM_RESERVED)))
++		r->type = RANGE_RESERVED;
++	else
++		return 1;
++
+ 	r->start = base;
+ 	r->end = base + length - 1;
+ 
+@@ -494,7 +502,7 @@ static int get_memory_ranges_iomem_cb(void *data, int nr, char *str,
+ static int get_memory_ranges_iomem(struct memory_range *array,
+ 	unsigned int *count)
+ {
+-	*count = kexec_iomem_for_each_line("System RAM\n",
++	*count = kexec_iomem_for_each_line(NULL,
+ 		get_memory_ranges_iomem_cb, array);
+ 
+ 	if (!*count) {
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0004-arm64-kdump-identify-memory-regions.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0004-arm64-kdump-identify-memory-regions.patch
new file mode 100644
index 0000000..66600f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0004-arm64-kdump-identify-memory-regions.patch
@@ -0,0 +1,202 @@
+From 48a4c7874d8264ddbfaec2e9858d7866a2d2eb60 Mon Sep 17 00:00:00 2001
+From: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Date: Wed, 5 Aug 2015 13:16:30 +0900
+Subject: [PATCH 4/9] arm64: kdump: identify memory regions
+
+The following regions need to be identified for later use:
+ a) memory regions which belong to the 1st kernel
+ b) usable memory reserved for crash dump kernel
+
+We go through /proc/iomem to find out a) and b) which are marked
+as "System RAM" and "Crash kernel", respectively.
+
+Upstream-Status: Backport [https://git.linaro.org/people/takahiro.akashi/kexec-tools.git]
+
+Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ kexec/arch/arm64/Makefile          |   2 +
+ kexec/arch/arm64/crashdump-arm64.c | 100 ++++++++++++++++++++++++++++++++++++-
+ kexec/arch/arm64/crashdump-arm64.h |  14 +++++-
+ kexec/arch/arm64/iomem.h           |   1 +
+ 4 files changed, 114 insertions(+), 3 deletions(-)
+
+diff --git a/kexec/arch/arm64/Makefile b/kexec/arch/arm64/Makefile
+index 74b677f..2d4ae0e 100644
+--- a/kexec/arch/arm64/Makefile
++++ b/kexec/arch/arm64/Makefile
+@@ -6,6 +6,8 @@ arm64_FS2DT_INCLUDE += \
+ 
+ arm64_DT_OPS += kexec/dt-ops.c
+ 
++arm64_MEM_REGIONS = kexec/mem_regions.c
++
+ arm64_CPPFLAGS += -I $(srcdir)/kexec/
+ 
+ arm64_KEXEC_SRCS += \
+diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
+index d2272c8..dcaca43 100644
+--- a/kexec/arch/arm64/crashdump-arm64.c
++++ b/kexec/arch/arm64/crashdump-arm64.c
+@@ -1,5 +1,13 @@
+ /*
+  * ARM64 crashdump.
++ *     partly derived from arm implementation
++ *
++ * Copyright (c) 2014-2016 Linaro Limited
++ * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
+  */
+ 
+ #define _GNU_SOURCE
+@@ -10,12 +18,102 @@
+ #include "kexec.h"
+ #include "crashdump.h"
+ #include "crashdump-arm64.h"
++#include "iomem.h"
+ #include "kexec-arm64.h"
+ #include "kexec-elf.h"
++#include "mem_regions.h"
+ 
+-struct memory_ranges usablemem_rgns = {};
++/* memory ranges on crashed kernel */
++static struct memory_range crash_memory_ranges[CRASH_MAX_MEMORY_RANGES];
++static struct memory_ranges crash_memory_rgns = {
++	.size = 0,
++	.max_size = CRASH_MAX_MEMORY_RANGES,
++	.ranges = crash_memory_ranges,
++};
++
++/* memory range reserved for crashkernel */
++struct memory_range crash_reserved_mem;
++struct memory_ranges usablemem_rgns = {
++	.size = 0,
++	.max_size = 1,
++	.ranges = &crash_reserved_mem,
++};
++
++/*
++ * iomem_range_callback() - callback called for each iomem region
++ * @data: not used
++ * @nr: not used
++ * @str: name of the memory region
++ * @base: start address of the memory region
++ * @length: size of the memory region
++ *
++ * This function is called once for each memory region found in /proc/iomem.
++ * It locates system RAM and crashkernel reserved memory and places these to
++ * variables, respectively, crash_memory_ranges and crash_reserved_mem.
++ */
++
++static int iomem_range_callback(void *UNUSED(data), int UNUSED(nr),
++				char *str, unsigned long long base,
++				unsigned long long length)
++{
++	if (strncmp(str, CRASH_KERNEL, strlen(CRASH_KERNEL)) == 0)
++		return mem_regions_add(&usablemem_rgns,
++				       base, length, RANGE_RAM);
++	else if (strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM)) == 0)
++		return mem_regions_add(&crash_memory_rgns,
++				       base, length, RANGE_RAM);
++
++	return 0;
++}
+ 
+ int is_crashkernel_mem_reserved(void)
+ {
++	if (!crash_reserved_mem.end)
++		kexec_iomem_for_each_line(NULL, iomem_range_callback, NULL);
++
++	return crash_reserved_mem.start != crash_reserved_mem.end;
++}
++
++/*
++ * crash_get_memory_ranges() - read system physical memory
++ *
++ * Function reads through system physical memory and stores found memory
++ * regions in crash_memory_ranges.
++ * Regions are sorted in ascending order.
++ *
++ * Returns 0 in case of success and -1 otherwise (errno is set).
++ */
++static int crash_get_memory_ranges(void)
++{
++	/*
++	 * First read all memory regions that can be considered as
++	 * system memory including the crash area.
++	 */
++	if (!usablemem_rgns.size)
++		kexec_iomem_for_each_line(NULL, iomem_range_callback, NULL);
++
++	/* allow only a single region for crash dump kernel */
++	if (usablemem_rgns.size != 1) {
++		errno = EINVAL;
++		return -1;
++	}
++
++	dbgprint_mem_range("Reserved memory range", &crash_reserved_mem, 1);
++
++	if (mem_regions_exclude(&crash_memory_rgns, &crash_reserved_mem)) {
++		fprintf(stderr,
++			"Error: Number of crash memory ranges excedeed the max limit\n");
++		errno = ENOMEM;
++		return -1;
++	}
++
++	/*
++	 * Make sure that the memory regions are sorted.
++	 */
++	mem_regions_sort(&crash_memory_rgns);
++
++	dbgprint_mem_range("Coredump memory ranges",
++			   crash_memory_rgns.ranges, crash_memory_rgns.size);
++
+ 	return 0;
+ }
+diff --git a/kexec/arch/arm64/crashdump-arm64.h b/kexec/arch/arm64/crashdump-arm64.h
+index f33c7a2..07a0ed0 100644
+--- a/kexec/arch/arm64/crashdump-arm64.h
++++ b/kexec/arch/arm64/crashdump-arm64.h
+@@ -1,12 +1,22 @@
+ /*
+  * ARM64 crashdump.
++ *
++ * Copyright (c) 2014-2016 Linaro Limited
++ * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
+  */
+ 
+-#if !defined(CRASHDUMP_ARM64_H)
++#ifndef CRASHDUMP_ARM64_H
+ #define CRASHDUMP_ARM64_H
+ 
+ #include "kexec.h"
+ 
++#define CRASH_MAX_MEMORY_RANGES	32
++
+ extern struct memory_ranges usablemem_rgns;
++extern struct memory_range crash_reserved_mem;
+ 
+-#endif
++#endif /* CRASHDUMP_ARM64_H */
+diff --git a/kexec/arch/arm64/iomem.h b/kexec/arch/arm64/iomem.h
+index 7fd66eb..20cda87 100644
+--- a/kexec/arch/arm64/iomem.h
++++ b/kexec/arch/arm64/iomem.h
+@@ -2,6 +2,7 @@
+ #define IOMEM_H
+ 
+ #define SYSTEM_RAM		"System RAM\n"
++#define CRASH_KERNEL		"Crash kernel\n"
+ #define IOMEM_RESERVED		"reserved\n"
+ 
+ #endif
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0005-arm64-kdump-add-elf-core-header-segment.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0005-arm64-kdump-add-elf-core-header-segment.patch
new file mode 100644
index 0000000..fe535b6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0005-arm64-kdump-add-elf-core-header-segment.patch
@@ -0,0 +1,191 @@
+From 769da25627cebb2a53caee5d5be78a32d376adc1 Mon Sep 17 00:00:00 2001
+From: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Date: Wed, 5 Aug 2015 13:45:15 +0900
+Subject: [PATCH 5/9] arm64: kdump: add elf core header segment
+
+Elf core header contains the information necessary for the coredump of
+the 1st kernel, including its physcal memory layout as well as cpu register
+states at the panic.
+The segment is allocated inside the reserved memory of crash dump kernel.
+
+Upstream-Status: Backport [https://git.linaro.org/people/takahiro.akashi/kexec-tools.git]
+
+Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ kexec/arch/arm64/crashdump-arm64.c | 96 ++++++++++++++++++++++++++++++++++++++
+ kexec/arch/arm64/crashdump-arm64.h |  3 ++
+ kexec/arch/arm64/iomem.h           |  2 +
+ kexec/arch/arm64/kexec-elf-arm64.c | 10 ++++
+ 4 files changed, 111 insertions(+)
+
+diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
+index dcaca43..8346131 100644
+--- a/kexec/arch/arm64/crashdump-arm64.c
++++ b/kexec/arch/arm64/crashdump-arm64.c
+@@ -39,6 +39,39 @@ struct memory_ranges usablemem_rgns = {
+ 	.ranges = &crash_reserved_mem,
+ };
+ 
++struct memory_range elfcorehdr_mem;
++
++static struct crash_elf_info elf_info = {
++	.class		= ELFCLASS64,
++#if (__BYTE_ORDER == __LITTLE_ENDIAN)
++	.data		= ELFDATA2LSB,
++#else
++	.data		= ELFDATA2MSB,
++#endif
++	.machine	= EM_AARCH64,
++};
++
++/*
++ * Note: The returned value is correct only if !CONFIG_RANDOMIZE_BASE.
++ */
++static uint64_t get_kernel_page_offset(void)
++{
++	int i;
++
++	if (elf_info.kern_vaddr_start == UINT64_MAX)
++		return UINT64_MAX;
++
++	/* Current max virtual memory range is 48-bits. */
++	for (i = 48; i > 0; i--)
++		if (!(elf_info.kern_vaddr_start & (1UL << i)))
++			break;
++
++	if (i <= 0)
++		return UINT64_MAX;
++	else
++		return UINT64_MAX << i;
++}
++
+ /*
+  * iomem_range_callback() - callback called for each iomem region
+  * @data: not used
+@@ -62,6 +95,10 @@ static int iomem_range_callback(void *UNUSED(data), int UNUSED(nr),
+ 	else if (strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM)) == 0)
+ 		return mem_regions_add(&crash_memory_rgns,
+ 				       base, length, RANGE_RAM);
++	else if (strncmp(str, KERNEL_CODE, strlen(KERNEL_CODE)) == 0)
++		elf_info.kern_paddr_start = base;
++	else if (strncmp(str, KERNEL_DATA, strlen(KERNEL_DATA)) == 0)
++		elf_info.kern_size = base + length - elf_info.kern_paddr_start;
+ 
+ 	return 0;
+ }
+@@ -115,5 +152,64 @@ static int crash_get_memory_ranges(void)
+ 	dbgprint_mem_range("Coredump memory ranges",
+ 			   crash_memory_rgns.ranges, crash_memory_rgns.size);
+ 
++	/*
++	 * For additional kernel code/data segment.
++	 * kern_paddr_start/kern_size are determined in iomem_range_callback
++	 */
++	elf_info.kern_vaddr_start = get_kernel_sym("_text");
++	if (!elf_info.kern_vaddr_start)
++		elf_info.kern_vaddr_start = UINT64_MAX;
++
++	return 0;
++}
++
++/*
++ * load_crashdump_segments() - load the elf core header
++ * @info: kexec info structure
++ *
++ * This function creates and loads an additional segment of elf core header
++ : which is used to construct /proc/vmcore on crash dump kernel.
++ *
++ * Return 0 in case of success and -1 in case of error.
++ */
++
++int load_crashdump_segments(struct kexec_info *info)
++{
++	unsigned long elfcorehdr;
++	unsigned long bufsz;
++	void *buf;
++	int err;
++
++	/*
++	 * First fetch all the memory (RAM) ranges that we are going to
++	 * pass to the crash dump kernel during panic.
++	 */
++
++	err = crash_get_memory_ranges();
++
++	if (err)
++		return err;
++
++	elf_info.page_offset = get_kernel_page_offset();
++	dbgprintf("%s: page_offset:   %016llx\n", __func__,
++			elf_info.page_offset);
++
++	err = crash_create_elf64_headers(info, &elf_info,
++			crash_memory_rgns.ranges, crash_memory_rgns.size,
++			&buf, &bufsz, ELF_CORE_HEADER_ALIGN);
++
++	if (err)
++		return err;
++
++	elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 0,
++		crash_reserved_mem.start, crash_reserved_mem.end,
++		-1, 0);
++
++	elfcorehdr_mem.start = elfcorehdr;
++	elfcorehdr_mem.end = elfcorehdr + bufsz - 1;
++
++	dbgprintf("%s: elfcorehdr 0x%llx-0x%llx\n", __func__,
++			elfcorehdr_mem.start, elfcorehdr_mem.end);
++
+ 	return 0;
+ }
+diff --git a/kexec/arch/arm64/crashdump-arm64.h b/kexec/arch/arm64/crashdump-arm64.h
+index 07a0ed0..da75a2d 100644
+--- a/kexec/arch/arm64/crashdump-arm64.h
++++ b/kexec/arch/arm64/crashdump-arm64.h
+@@ -18,5 +18,8 @@
+ 
+ extern struct memory_ranges usablemem_rgns;
+ extern struct memory_range crash_reserved_mem;
++extern struct memory_range elfcorehdr_mem;
++
++extern int load_crashdump_segments(struct kexec_info *info);
+ 
+ #endif /* CRASHDUMP_ARM64_H */
+diff --git a/kexec/arch/arm64/iomem.h b/kexec/arch/arm64/iomem.h
+index 20cda87..d4864bb 100644
+--- a/kexec/arch/arm64/iomem.h
++++ b/kexec/arch/arm64/iomem.h
+@@ -2,6 +2,8 @@
+ #define IOMEM_H
+ 
+ #define SYSTEM_RAM		"System RAM\n"
++#define KERNEL_CODE		"Kernel code\n"
++#define KERNEL_DATA		"Kernel data\n"
+ #define CRASH_KERNEL		"Crash kernel\n"
+ #define IOMEM_RESERVED		"reserved\n"
+ 
+diff --git a/kexec/arch/arm64/kexec-elf-arm64.c b/kexec/arch/arm64/kexec-elf-arm64.c
+index daf8bf0..c70a37a 100644
+--- a/kexec/arch/arm64/kexec-elf-arm64.c
++++ b/kexec/arch/arm64/kexec-elf-arm64.c
+@@ -119,6 +119,16 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
+ 	dbgprintf("%s: PE format:      %s\n", __func__,
+ 		(arm64_header_check_pe_sig(header) ? "yes" : "no"));
+ 
++	if (info->kexec_flags & KEXEC_ON_CRASH) {
++		/* create and initialize elf core header segment */
++		result = load_crashdump_segments(info);
++		if (result) {
++			dbgprintf("%s: Creating eflcorehdr failed.\n",
++								__func__);
++			goto exit;
++		}
++	}
++
+ 	/* load the kernel */
+ 	result = elf_exec_load(&ehdr, info);
+ 
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0006-arm64-kdump-set-up-kernel-image-segment.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0006-arm64-kdump-set-up-kernel-image-segment.patch
new file mode 100644
index 0000000..4149551
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0006-arm64-kdump-set-up-kernel-image-segment.patch
@@ -0,0 +1,137 @@
+From 4079c93ac5453ef5f7889ab64920c1e9427690ef Mon Sep 17 00:00:00 2001
+From: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Date: Tue, 17 Feb 2015 16:06:55 +0900
+Subject: [PATCH 6/9] arm64: kdump: set up kernel image segment
+
+On arm64, we can use the same kernel image as 1st kernel, but
+we have to modify the entry point as well as segments' addresses
+in the kernel's elf header in order to load them into correct places.
+
+Upstream-Status: Backport [https://git.linaro.org/people/takahiro.akashi/kexec-tools.git]
+
+Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ kexec/arch/arm64/crashdump-arm64.c | 23 +++++++++++++++++++++++
+ kexec/arch/arm64/crashdump-arm64.h |  1 +
+ kexec/arch/arm64/kexec-arm64.c     | 25 ++++++++++++++++++++-----
+ kexec/arch/arm64/kexec-elf-arm64.c | 10 +++++++++-
+ 4 files changed, 53 insertions(+), 6 deletions(-)
+
+diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
+index 8346131..9517329 100644
+--- a/kexec/arch/arm64/crashdump-arm64.c
++++ b/kexec/arch/arm64/crashdump-arm64.c
+@@ -213,3 +213,26 @@ int load_crashdump_segments(struct kexec_info *info)
+ 
+ 	return 0;
+ }
++
++/*
++ * e_entry and p_paddr are actually in virtual address space.
++ * Those values will be translated to physcal addresses by
++ * using virt_to_phys().
++ * So let's get ready for later use so the memory base (phys_offset)
++ * will be correctly replaced with crash_reserved_mem.start.
++ */
++void modify_ehdr_for_crashdump(struct mem_ehdr *ehdr)
++{
++	struct mem_phdr *phdr;
++	int i;
++
++	ehdr->e_entry += - arm64_mem.phys_offset + crash_reserved_mem.start;
++
++	for (i = 0; i < ehdr->e_phnum; i++) {
++		phdr = &ehdr->e_phdr[i];
++		if (phdr->p_type != PT_LOAD)
++			continue;
++		phdr->p_paddr +=
++			(-arm64_mem.phys_offset + crash_reserved_mem.start);
++	}
++}
+diff --git a/kexec/arch/arm64/crashdump-arm64.h b/kexec/arch/arm64/crashdump-arm64.h
+index da75a2d..382f571 100644
+--- a/kexec/arch/arm64/crashdump-arm64.h
++++ b/kexec/arch/arm64/crashdump-arm64.h
+@@ -21,5 +21,6 @@ extern struct memory_range crash_reserved_mem;
+ extern struct memory_range elfcorehdr_mem;
+ 
+ extern int load_crashdump_segments(struct kexec_info *info);
++extern void modify_ehdr_for_crashdump(struct mem_ehdr *ehdr);
+ 
+ #endif /* CRASHDUMP_ARM64_H */
+diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
+index 8ac811d..cec4e41 100644
+--- a/kexec/arch/arm64/kexec-arm64.c
++++ b/kexec/arch/arm64/kexec-arm64.c
+@@ -307,12 +307,27 @@ unsigned long arm64_locate_kernel_segment(struct kexec_info *info)
+ {
+ 	unsigned long hole;
+ 
+-	hole = locate_hole(info,
+-		arm64_mem.text_offset + arm64_mem.image_size,
+-		MiB(2), 0, ULONG_MAX, 1);
++	if (info->kexec_flags & KEXEC_ON_CRASH) {
++		unsigned long hole_end;
++
++		hole = (crash_reserved_mem.start < mem_min ?
++				mem_min : crash_reserved_mem.start);
++		hole = _ALIGN_UP(hole, MiB(2));
++		hole_end = hole + arm64_mem.text_offset + arm64_mem.image_size;
++
++		if ((hole_end > mem_max) ||
++		    (hole_end > crash_reserved_mem.end)) {
++			dbgprintf("%s: Crash kernel out of range\n", __func__);
++			hole = ULONG_MAX;
++		}
++	} else {
++		hole = locate_hole(info,
++			arm64_mem.text_offset + arm64_mem.image_size,
++			MiB(2), 0, ULONG_MAX, 1);
+ 
+-	if (hole == ULONG_MAX)
+-		dbgprintf("%s: locate_hole failed\n", __func__);
++		if (hole == ULONG_MAX)
++			dbgprintf("%s: locate_hole failed\n", __func__);
++	}
+ 
+ 	return hole;
+ }
+diff --git a/kexec/arch/arm64/kexec-elf-arm64.c b/kexec/arch/arm64/kexec-elf-arm64.c
+index c70a37a..842ce21 100644
+--- a/kexec/arch/arm64/kexec-elf-arm64.c
++++ b/kexec/arch/arm64/kexec-elf-arm64.c
+@@ -9,6 +9,7 @@
+ #include <stdlib.h>
+ #include <linux/elf.h>
+ 
++#include "crashdump-arm64.h"
+ #include "kexec-arm64.h"
+ #include "kexec-elf.h"
+ #include "kexec-syscall.h"
+@@ -105,7 +106,8 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
+ 	}
+ 
+ 	arm64_mem.vp_offset = _ALIGN_DOWN(ehdr.e_entry, MiB(2));
+-	arm64_mem.vp_offset -= kernel_segment - get_phys_offset();
++	if (!(info->kexec_flags & KEXEC_ON_CRASH))
++		arm64_mem.vp_offset -= kernel_segment - get_phys_offset();
+ 
+ 	dbgprintf("%s: kernel_segment: %016lx\n", __func__, kernel_segment);
+ 	dbgprintf("%s: text_offset:    %016lx\n", __func__,
+@@ -127,6 +129,12 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
+ 								__func__);
+ 			goto exit;
+ 		}
++
++		/*
++		 * offset addresses in order to fit vmlinux
++		 * (elf_exec) into crash kernel's memory
++		 */
++		modify_ehdr_for_crashdump(&ehdr);
+ 	}
+ 
+ 	/* load the kernel */
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0007-arm64-kdump-set-up-other-segments.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0007-arm64-kdump-set-up-other-segments.patch
new file mode 100644
index 0000000..2745466
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0007-arm64-kdump-set-up-other-segments.patch
@@ -0,0 +1,35 @@
+From 07ad14e12665221d754fde8e47c32ac18c24586a Mon Sep 17 00:00:00 2001
+From: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Date: Fri, 31 Jul 2015 20:01:39 +0900
+Subject: [PATCH 7/9] arm64: kdump: set up other segments
+
+We make sure that all the other segments, initrd and device-tree blob,
+also be loaded into the reserved memory of crash dump kernel.
+
+Upstream-Status: Backport [https://git.linaro.org/people/takahiro.akashi/kexec-tools.git]
+
+Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ kexec/arch/arm64/kexec-arm64.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
+index cec4e41..78a0035 100644
+--- a/kexec/arch/arm64/kexec-arm64.c
++++ b/kexec/arch/arm64/kexec-arm64.c
+@@ -374,7 +374,10 @@ int arm64_load_other_segments(struct kexec_info *info,
+ 	/* Put the other segments after the image. */
+ 
+ 	hole_min = image_base + arm64_mem.image_size;
+-	hole_max = ULONG_MAX;
++	if (info->kexec_flags & KEXEC_ON_CRASH)
++		hole_max = crash_reserved_mem.end;
++	else
++		hole_max = ULONG_MAX;
+ 
+ 	if (arm64_opts.initrd) {
+ 		initrd_buf = slurp_file(arm64_opts.initrd, &initrd_size);
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch
new file mode 100644
index 0000000..31c3d85
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch
@@ -0,0 +1,150 @@
+From 23bf7ac189cc3b87ceb9d1d3b69b5c4815354add Mon Sep 17 00:00:00 2001
+From: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Date: Wed, 27 Jan 2016 13:38:39 +0900
+Subject: [PATCH 8/9] arm64: kdump: add DT properties to crash dump kernel's
+ dtb
+
+We pass the following properties to crash dump kernel:
+linux,elfcorehdr: elf core header segment,
+		  same as "elfcorehdr=" kernel parameter on other archs
+linux,usable-memory-range: usable memory reserved for crash dump kernel
+
+Upstream-Status: Backport [https://git.linaro.org/people/takahiro.akashi/kexec-tools.git]
+
+Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ kexec/arch/arm64/kexec-arm64.c     | 76 +++++++++++++++++++++++++++++++++++---
+ kexec/arch/arm64/kexec-elf-arm64.c |  5 ---
+ 2 files changed, 71 insertions(+), 10 deletions(-)
+
+diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
+index 78a0035..a8fb64f 100644
+--- a/kexec/arch/arm64/kexec-arm64.c
++++ b/kexec/arch/arm64/kexec-arm64.c
+@@ -128,9 +128,6 @@ int arch_process_options(int argc, char **argv)
+ 		case OPT_INITRD:
+ 			arm64_opts.initrd = optarg;
+ 			break;
+-		case OPT_PANIC:
+-			die("load-panic (-p) not supported");
+-			break;
+ 		default:
+ 			break; /* Ignore core and unknown options. */
+ 		}
+@@ -285,8 +282,12 @@ on_success:
+  * setup_2nd_dtb - Setup the 2nd stage kernel's dtb.
+  */
+ 
+-static int setup_2nd_dtb(struct dtb *dtb, char *command_line)
++static int setup_2nd_dtb(struct dtb *dtb, char *command_line, int on_crash)
+ {
++	char *new_buf;
++	int new_size;
++	int nodeoffset;
++	uint64_t range[2];
+ 	int result;
+ 
+ 	result = fdt_check_header(dtb->buf);
+@@ -298,8 +299,72 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line)
+ 
+ 	result = set_bootargs(dtb, command_line);
+ 
++	/* remove those anyway */
++	nodeoffset = fdt_path_offset(dtb->buf, "/chosen");
++	fdt_delprop(dtb->buf, nodeoffset, "linux,crashkernel-base");
++	fdt_delprop(dtb->buf, nodeoffset, "linux,crashkernel-size");
++
++	if (on_crash) {
++		nodeoffset = fdt_path_offset(dtb->buf, "/chosen");
++		fdt_delprop(dtb->buf, nodeoffset, "linux,elfcorehdr");
++		fdt_delprop(dtb->buf, nodeoffset, "linux,usable-memory-range");
++		new_size = fdt_totalsize(dtb->buf)
++			+ 2 * (sizeof(struct fdt_property)
++					+ FDT_TAGALIGN(sizeof(range)))
++			+ strlen("linux,elfcorehdr") + 1
++			+ strlen("linux,usable-memory-range") + 1;
++
++		new_buf = xmalloc(new_size);
++		result = fdt_open_into(dtb->buf, new_buf, new_size);
++		if (result) {
++			dbgprintf("%s: fdt_open_into failed: %s\n", __func__,
++				fdt_strerror(result));
++			result = -ENOSPC;
++			goto on_error;
++		}
++
++		range[0] = cpu_to_be64(elfcorehdr_mem.start);
++		range[1] = cpu_to_be64(elfcorehdr_mem.end
++				- elfcorehdr_mem.start + 1);
++		nodeoffset = fdt_path_offset(new_buf, "/chosen");
++		result = fdt_setprop(new_buf, nodeoffset, "linux,elfcorehdr",
++				(void *)range, sizeof(range));
++		if (result) {
++			dbgprintf("%s: fdt_setprop failed: %s\n", __func__,
++				fdt_strerror(result));
++			result = -EINVAL;
++			goto on_error;
++		}
++
++		range[0] = cpu_to_be64(crash_reserved_mem.start);
++		range[1] = cpu_to_be64(crash_reserved_mem.end
++				- crash_reserved_mem.start + 1);
++		nodeoffset = fdt_path_offset(new_buf, "/chosen");
++		result = fdt_setprop(new_buf, nodeoffset,
++				"linux,usable-memory-range",
++				(void *)range, sizeof(range));
++		if (result) {
++			dbgprintf("%s: fdt_setprop failed: %s\n", __func__,
++				fdt_strerror(result));
++			result = -EINVAL;
++			goto on_error;
++		}
++
++		fdt_pack(new_buf);
++		dtb->buf = new_buf;
++		dtb->size = fdt_totalsize(new_buf);
++	}
++
+ 	dump_reservemap(dtb);
+ 
++
++	return result;
++
++on_error:
++	fprintf(stderr, "kexec: %s failed.\n", __func__);
++	if (new_buf)
++		free(new_buf);
++
+ 	return result;
+ }
+ 
+@@ -366,7 +431,8 @@ int arm64_load_other_segments(struct kexec_info *info,
+ 		}
+ 	}
+ 
+-	result = setup_2nd_dtb(&dtb, command_line);
++	result = setup_2nd_dtb(&dtb, command_line,
++			info->kexec_flags & KEXEC_ON_CRASH);
+ 
+ 	if (result)
+ 		return -EFAILED;
+diff --git a/kexec/arch/arm64/kexec-elf-arm64.c b/kexec/arch/arm64/kexec-elf-arm64.c
+index 842ce21..b17a31a 100644
+--- a/kexec/arch/arm64/kexec-elf-arm64.c
++++ b/kexec/arch/arm64/kexec-elf-arm64.c
+@@ -47,11 +47,6 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
+ 	int result;
+ 	int i;
+ 
+-	if (info->kexec_flags & KEXEC_ON_CRASH) {
+-		fprintf(stderr, "kexec: kdump not yet supported on arm64\n");
+-		return -EFAILED;
+-	}
+-
+ 	result = build_elf_exec_info(kernel_buf, kernel_size, &ehdr, 0);
+ 
+ 	if (result < 0) {
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0009-arm64-kdump-Add-support-for-binary-image-files.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0009-arm64-kdump-Add-support-for-binary-image-files.patch
new file mode 100644
index 0000000..8b1c018
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0009-arm64-kdump-Add-support-for-binary-image-files.patch
@@ -0,0 +1,52 @@
+From 5a4958f01a793c3e7f440f5bae75666a4349cc50 Mon Sep 17 00:00:00 2001
+From: Pratyush Anand <panand@redhat.com>
+Date: Thu, 14 May 2015 11:25:37 +0530
+Subject: [PATCH 9/9] arm64: kdump: Add support for binary image files
+
+This patch adds support to use binary image ie arch/arm64/boot/Image with
+kdump.
+
+Upstream-Status: Backport [https://git.linaro.org/people/takahiro.akashi/kexec-tools.git]
+
+Signed-off-by: Pratyush Anand <panand@redhat.com>
+[takahiro.akashi@linaro.org: a bit reworked]
+Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ kexec/arch/arm64/kexec-image-arm64.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/kexec/arch/arm64/kexec-image-arm64.c b/kexec/arch/arm64/kexec-image-arm64.c
+index 960ed96..982e431 100644
+--- a/kexec/arch/arm64/kexec-image-arm64.c
++++ b/kexec/arch/arm64/kexec-image-arm64.c
+@@ -4,7 +4,9 @@
+ 
+ #define _GNU_SOURCE
+ 
++#include "crashdump-arm64.h"
+ #include "kexec-arm64.h"
++#include "kexec-syscall.h"
+ #include <limits.h>
+ 
+ int image_arm64_probe(const char *kernel_buf, off_t kernel_size)
+@@ -58,6 +60,16 @@ int image_arm64_load(int argc, char **argv, const char *kernel_buf,
+ 	dbgprintf("%s: PE format:      %s\n", __func__,
+ 		(arm64_header_check_pe_sig(header) ? "yes" : "no"));
+ 
++	if (info->kexec_flags & KEXEC_ON_CRASH) {
++		/* create and initialize elf core header segment */
++		result = load_crashdump_segments(info);
++		if (result) {
++			dbgprintf("%s: Creating eflcorehdr failed.\n",
++								__func__);
++			goto exit;
++		}
++	}
++
+ 	/* load the kernel */
+ 	add_segment_phys_virt(info, kernel_buf, kernel_size,
+ 			kernel_segment + arm64_mem.text_offset,
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch
new file mode 100644
index 0000000..6c6c66d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch
@@ -0,0 +1,52 @@
+From 78e497fb69950665e639cfab8f4fb50cc404a1eb Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Mon, 9 Jan 2017 15:26:29 +0800
+Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue
+
+When "CONFIG_ARM_LPAE" is enabled,3 level page table
+is used by MMU, the "SECTION_SIZE" is defined with
+(1 << 21), but 'add_buffer_phys_virt()' hardcode this
+to (1 << 20).
+
+Upstream-Status: Pending
+
+Suggested-By:fredrik.markstrom@gmail.com
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ kexec/arch/arm/crashdump-arm.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
+index 245c21a..12139c3 100644
+--- a/kexec/arch/arm/crashdump-arm.c
++++ b/kexec/arch/arm/crashdump-arm.c
+@@ -240,6 +240,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ 	void *buf;
+ 	int err;
+ 	int last_ranges;
++	unsigned short align_bit_shift = 20;
+ 
+ 	/*
+ 	 * First fetch all the memory (RAM) ranges that we are going to pass to
+@@ -281,6 +282,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ 
+ 		/* for support LPAE enabled kernel*/
+ 		elf_info.class = ELFCLASS64;
++		align_bit_shift = 21;
+ 
+ 		err = crash_create_elf64_headers(info, &elf_info,
+ 					 usablemem_rgns.ranges,
+@@ -302,8 +304,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ 	 * 1MB) so that available memory passed in kernel command line will be
+ 	 * aligned to 1MB. This is because kernel create_mapping() wants memory
+ 	 * regions to be aligned to SECTION_SIZE.
++	 * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h
+ 	 */
+-	elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
++	elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift,
+ 					  crash_kernel_mem.start,
+ 					  crash_kernel_mem.end, -1, 0);
+ 
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump
index 2347205..69e3caf 100755
--- a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump
@@ -89,7 +89,7 @@
 		return 0
 	fi
 
-	#check the running kernel cmdline option,insure "crashkenrel=" always set.
+	#check the running kernel cmdline option,insure "crashkernel=" always set.
 	grep -q crashkernel= /proc/cmdline
 	if [ $? != 0 ]; then
 		echo "Kdump isn't supported on the running kernel,please check boot option!!!"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
deleted file mode 100644
index 59376c8..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.12.bb
+++ /dev/null
@@ -1,37 +0,0 @@
-require kexec-tools.inc
-export LDFLAGS = "-L${STAGING_LIBDIR}"
-EXTRA_OECONF = " --with-zlib=yes"
-
-SRC_URI += " \
-            file://kexec-aarch64.patch \
-            file://kexec-x32.patch \
-            file://0002-powerpc-change-the-memory-size-limit.patch \
-            file://0001-purgatory-Pass-r-directly-to-linker.patch \
-            file://0001-vmcore-dmesg-Define-_GNU_SOURCE.patch \
-         "
-
-SRC_URI[md5sum] = "10ddaae0e86af54407b164a1f5a39cc3"
-SRC_URI[sha256sum] = "cc7b60dad0da202004048a6179d8a53606943062dd627a2edba45a8ea3a85135"
-
-PACKAGES =+ "kexec kdump vmcore-dmesg"
-
-ALLOW_EMPTY_${PN} = "1"
-RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg"
-
-FILES_kexec = "${sbindir}/kexec"
-FILES_kdump = "${sbindir}/kdump ${sysconfdir}/init.d/kdump \
-               ${sysconfdir}/sysconfig/kdump.conf"
-FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg"
-
-inherit update-rc.d
-
-INITSCRIPT_PACKAGES = "kdump"
-INITSCRIPT_NAME_kdump = "kdump"
-INITSCRIPT_PARAMS_kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ."
-
-do_install_append () {
-        install -d ${D}${sysconfdir}/init.d
-        install -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump
-        install -d ${D}${sysconfdir}/sysconfig
-        install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig
-}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb
new file mode 100644
index 0000000..90d5985
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb
@@ -0,0 +1,48 @@
+require kexec-tools.inc
+export LDFLAGS = "-L${STAGING_LIBDIR}"
+EXTRA_OECONF = " --with-zlib=yes"
+
+SRC_URI += "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
+            file://0002-powerpc-change-the-memory-size-limit.patch \
+            file://0001-purgatory-Pass-r-directly-to-linker.patch \
+            file://0001-vmcore-dmesg-Define-_GNU_SOURCE.patch \
+            file://0001-kexec-exntend-the-semantics-of-kexec_iomem_for_each_.patch \
+            file://0002-kexec-generalize-and-rename-get_kernel_stext_sym.patch \
+            file://0003-arm64-identify-PHYS_OFFSET-correctly.patch \
+            file://0004-arm64-kdump-identify-memory-regions.patch \
+            file://0005-arm64-kdump-add-elf-core-header-segment.patch \
+            file://0006-arm64-kdump-set-up-kernel-image-segment.patch \
+            file://0007-arm64-kdump-set-up-other-segments.patch \
+            file://0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch \
+            file://0009-arm64-kdump-Add-support-for-binary-image-files.patch \
+            file://0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \
+            file://0001-x86-x86_64-Fix-format-warning-with-die.patch \
+            file://0002-ppc-Fix-format-warning-with-die.patch \
+            file://kexec-x32.patch \
+         "
+
+SRC_URI[md5sum] = "b2b2c5e6b29d467d6e99d587fb6b7cf5"
+SRC_URI[sha256sum] = "b3e69519d2acced256843b1e8f1ecfa00d9b54fa07449ed78f05b9193f239370"
+
+PACKAGES =+ "kexec kdump vmcore-dmesg"
+
+ALLOW_EMPTY_${PN} = "1"
+RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg"
+
+FILES_kexec = "${sbindir}/kexec"
+FILES_kdump = "${sbindir}/kdump ${sysconfdir}/init.d/kdump \
+               ${sysconfdir}/sysconfig/kdump.conf"
+FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg"
+
+inherit update-rc.d
+
+INITSCRIPT_PACKAGES = "kdump"
+INITSCRIPT_NAME_kdump = "kdump"
+INITSCRIPT_PARAMS_kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ."
+
+do_install_append () {
+        install -d ${D}${sysconfdir}/init.d
+        install -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump
+        install -d ${D}${sysconfdir}/sysconfig
+        install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/import-layers/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
index 5c7dd52..44d013f 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -1,6 +1,5 @@
 SUMMARY = "Wrapper script for the Linux kernel module dependency indexer"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 S = "${WORKDIR}"
 
@@ -10,6 +9,9 @@
 
 # We need the following for the sstate code to process the wrapper
 SSTATE_SCAN_FILES += "depmodwrapper"
+EXTRA_STAGING_FIXMES += "PKGDATA_DIR"
+
+do_populate_sysroot[depends] = ""
 
 do_install() {
 	install -d ${D}${bindir_crossscripts}/
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod.inc b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod.inc
index 166b3f0..ba80fc5 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod.inc
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod.inc
@@ -12,7 +12,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
                     file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
                    "
-inherit autotools gtk-doc pkgconfig
+inherit autotools gtk-doc pkgconfig manpages
 
 SRCREV = "65a885df5f6f15222b44fd695c5eaca17e837a14"
 # Lookout for PV bump too when SRCREV is changed
@@ -22,15 +22,19 @@
            file://depmod-search.conf \
            file://avoid_parallel_tests.patch \
            file://fix-O_CLOEXEC.patch \
+           file://kcmdline_quotes.patch \
           "
 
 S = "${WORKDIR}/git"
 
 EXTRA_AUTORECONF += "--install --symlink"
-EXTRA_OECONF +=" --enable-tools --disable-manpages --with-zlib"
+EXTRA_OECONF +=" --enable-tools --with-zlib"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_DOLT_BASH='/usr/bin/env bash'"
 
 PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
 PACKAGECONFIG[logging] = " --enable-logging,--disable-logging"
+PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
 
 do_configure_prepend () {
         gtkdocize --docdir ${S}/libkmod/docs --srcdir ${S}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/kcmdline_quotes.patch b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/kcmdline_quotes.patch
new file mode 100644
index 0000000..46bdec5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/kcmdline_quotes.patch
@@ -0,0 +1,44 @@
+From 4a6f92a10680e7e36807f5e2ae8e497e8d73a048 Mon Sep 17 00:00:00 2001
+From: James Minor <james.minor@ni.com>
+Date: Fri, 20 Jan 2017 17:15:50 -0600
+Subject: [PATCH] libkmod: Fix handling of quotes in kernel command line
+
+If a module parameter on the command line contains quotes, any
+spaces inside those quotes should be included as part of the
+parameter.
+
+Signed-off-by: James Minor <james.minor@ni.com>
+
+Upstream-Status: Accepted
+---
+ libkmod/libkmod-config.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
+index 57fbe37..ea40d19 100644
+--- a/libkmod/libkmod-config.c
++++ b/libkmod/libkmod-config.c
+@@ -497,6 +497,7 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
+ 	char buf[KCMD_LINE_SIZE];
+ 	int fd, err;
+ 	char *p, *modname,  *param = NULL, *value = NULL, is_module = 1;
++	bool is_quoted = false;
+ 
+ 	fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
+ 	if (fd < 0) {
+@@ -514,6 +515,12 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
+ 	}
+ 
+ 	for (p = buf, modname = buf; *p != '\0' && *p != '\n'; p++) {
++		if (*p == '"') {
++			is_quoted = !is_quoted;
++			continue;
++		}
++		if (is_quoted)
++			continue;
+ 		switch (*p) {
+ 		case ' ':
+ 			*p = '\0';
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop_0.5.bb b/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop_0.5.bb
index f31f1bb..eb19471 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop_0.5.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop_0.5.bb
@@ -4,6 +4,8 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://latencytop.c;endline=23;md5=ee9ea9b1415356e5734adad4a87dc7fa"
 
+inherit pkgconfig
+
 DEPENDS = "virtual/libintl ncurses glib-2.0"
 
 PR = "r3"
@@ -17,7 +19,7 @@
 SRC_URI[md5sum] = "73bb3371c6ee0b0e68e25289027e865c"
 SRC_URI[sha256sum] = "9e7f72fbea7bd918e71212a1eabaad8488d2c602205d2e3c95d62cd57e9203ef"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 
 PACKAGECONFIG[x11] = ",,gtk+"
 
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
index 8e68ae8..ff60d30 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -19,6 +19,7 @@
     & Firmware-ene_firmware \
     & Firmware-fw_sst_0f28 \
     & Firmware-go7007 \
+    & Firmware-GPLv2 \
     & Firmware-hfi1_firmware \
     & Firmware-i2400m \
     & Firmware-i915 \
@@ -29,8 +30,8 @@
     & Firmware-kaweth \
     & Firmware-Marvell \
     & Firmware-moxa \
-    & Firmware-mwl8335 \
     & Firmware-myri10ge_firmware \
+    & Firmware-netronome \
     & Firmware-nvidia \
     & Firmware-OLPC \
     & Firmware-ath9k-htc \
@@ -45,6 +46,7 @@
     & Firmware-ralink_a_mediatek_company_firmware \
     & Firmware-ralink-firmware \
     & Firmware-rtlwifi_firmware \
+    & Firmware-imx-sdma_firmware \
     & Firmware-siano \
     & Firmware-tda7706-firmware \
     & Firmware-ti-connectivity \
@@ -62,7 +64,7 @@
     file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
     file://LICENCE.adsp_sst;md5=615c45b91a5a4a9fe046d6ab9a2df728 \
     file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \
-    file://LICENSE.amdgpu;md5=3fe8a3430700a518990c3b3d75297209 \
+    file://LICENSE.amdgpu;md5=0aa3c2f3e736af320a08a3aeeccecf29 \
     file://LICENSE.amd-ucode;md5=3a0de451253cc1edbf30a3c621effee3 \
     file://LICENCE.atheros_firmware;md5=30a14c7823beedac9fa39c64fdd01a13 \
     file://LICENSE.atmel;md5=aa74ac0c60595dee4d4e239107ea77a3 \
@@ -76,6 +78,7 @@
     file://LICENCE.ene_firmware;md5=ed67f0f62f8f798130c296720b7d3921 \
     file://LICENCE.fw_sst_0f28;md5=6353931c988ad52818ae733ac61cd293 \
     file://LICENCE.go7007;md5=c0bb9f6aaaba55b0529ee9b30aa66beb \
+    file://GPL-2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
     file://LICENSE.hfi1_firmware;md5=5e7b6e586ce7339d12689e49931ad444 \
     file://LICENCE.i2400m;md5=14b901969e23c41881327c0d9e4b7d36 \
     file://LICENSE.i915;md5=2b0b2e0d20984affd4490ba2cba02570 \
@@ -86,23 +89,24 @@
     file://LICENCE.kaweth;md5=b1d876e562f4b3b8d391ad8395dfe03f \
     file://LICENCE.Marvell;md5=9ddea1734a4baf3c78d845151f42a37a \
     file://LICENCE.moxa;md5=1086614767d8ccf744a923289d3d4261 \
-    file://LICENCE.mwl8335;md5=9a6271ee0e644404b2ff3c61fd070983 \
     file://LICENCE.myri10ge_firmware;md5=42e32fb89f6b959ca222e25ac8df8fed \
+    file://LICENCE.Netronome;md5=cd2a3e6effe3cdf42731575b8e9477ed \
     file://LICENCE.nvidia;md5=4428a922ed3ba2ceec95f076a488ce07 \
     file://LICENCE.OLPC;md5=5b917f9d8c061991be4f6f5f108719cd \
     file://LICENCE.open-ath9k-htc-firmware;md5=1b33c9f4d17bc4d457bdb23727046837 \
     file://LICENCE.phanfw;md5=954dcec0e051f9409812b561ea743bfa \
     file://LICENCE.qat_firmware;md5=9e7d8bea77612d7cc7d9e9b54b623062 \
     file://LICENCE.qla1280;md5=d6895732e622d950609093223a2c4f5d \
-    file://LICENCE.qla2xxx;md5=f5ce8529ec5c17cb7f911d2721d90e91 \
+    file://LICENCE.qla2xxx;md5=505855e921b75f1be4a437ad9b79dff0 \
     file://LICENSE.QualcommAtheros_ar3k;md5=b5fe244fb2b532311de1472a3bc06da5 \
-    file://LICENSE.QualcommAtheros_ath10k;md5=b5fe244fb2b532311de1472a3bc06da5 \
+    file://LICENSE.QualcommAtheros_ath10k;md5=cb42b686ee5f5cb890275e4321db60a8 \
     file://LICENCE.r8a779x_usb3;md5=4c1671656153025d7076105a5da7e498 \
-    file://LICENSE.radeon;md5=69612f4f7b141a97659cb1d609a1bde2 \
+    file://LICENSE.radeon;md5=68ec28bacb3613200bca44f404c69b16 \
     file://LICENCE.ralink_a_mediatek_company_firmware;md5=728f1a85fd53fd67fa8d7afb080bc435 \
     file://LICENCE.ralink-firmware.txt;md5=ab2c269277c45476fb449673911a2dfd \
     file://LICENCE.rtlwifi_firmware.txt;md5=00d06cfd3eddd5a2698948ead2ad54a5 \
-    file://LICENCE.siano;md5=602c79ae3f98f1e73d880fd9f940a418 \
+    file://LICENSE.sdma_firmware;md5=51e8c19ecc2270f4b8ea30341ad63ce9 \
+    file://LICENCE.siano;md5=4556c1bf830067f12ca151ad953ec2a5 \
     file://LICENCE.tda7706-firmware.txt;md5=835997cf5e3c131d0dddd695c7d9103e \
     file://LICENCE.ti-connectivity;md5=c5e02be633f1499c109d1652514d85ec \
     file://LICENCE.ti-keystone;md5=3a86335d32864b0bef996bee26cc0f2c \
@@ -112,7 +116,7 @@
     file://LICENCE.xc4000;md5=0ff51d2dc49fce04814c9155081092f0 \
     file://LICENCE.xc5000;md5=1e170c13175323c32c7f4d0998d53f66 \
     file://LICENCE.xc5000c;md5=12b02efa3049db65d524aeb418dd87ca \
-    file://WHENCE;md5=f514a0c53c5d73c2fe98d5861103f0c6 \
+    file://WHENCE;md5=038edbc9e744171d8b6235e0224028ba \
 "
 
 # These are not common licenses, set NO_GENERIC_LICENSE for them
@@ -134,6 +138,7 @@
 NO_GENERIC_LICENSE[Firmware-ene_firmware] = "LICENCE.ene_firmware"
 NO_GENERIC_LICENSE[Firmware-fw_sst_0f28] = "LICENCE.fw_sst_0f28"
 NO_GENERIC_LICENSE[Firmware-go7007] = "LICENCE.go7007"
+NO_GENERIC_LICENSE[Firmware-GPLv2] = "GPL-2"
 NO_GENERIC_LICENSE[Firmware-hfi1_firmware] = "LICENSE.hfi1_firmware"
 NO_GENERIC_LICENSE[Firmware-i2400m] = "LICENCE.i2400m"
 NO_GENERIC_LICENSE[Firmware-i915] = "LICENSE.i915"
@@ -144,8 +149,8 @@
 NO_GENERIC_LICENSE[Firmware-kaweth] = "LICENCE.kaweth"
 NO_GENERIC_LICENSE[Firmware-Marvell] = "LICENCE.Marvell"
 NO_GENERIC_LICENSE[Firmware-moxa] = "LICENCE.moxa"
-NO_GENERIC_LICENSE[Firmware-mwl8335] = "LICENCE.mwl8335"
 NO_GENERIC_LICENSE[Firmware-myri10ge_firmware] = "LICENCE.myri10ge_firmware"
+NO_GENERIC_LICENSE[Firmware-netronome] = "LICENCE.Netronome"
 NO_GENERIC_LICENSE[Firmware-nvidia] = "LICENCE.nvidia"
 NO_GENERIC_LICENSE[Firmware-OLPC] = "LICENCE.OLPC"
 NO_GENERIC_LICENSE[Firmware-ath9k-htc] = "LICENCE.open-ath9k-htc-firmware"
@@ -161,6 +166,7 @@
 NO_GENERIC_LICENSE[Firmware-ralink-firmware] = "LICENCE.ralink-firmware.txt"
 NO_GENERIC_LICENSE[Firmware-rtlwifi_firmware] = "LICENCE.rtlwifi_firmware.txt"
 NO_GENERIC_LICENSE[Firmware-siano] = "LICENCE.siano"
+NO_GENERIC_LICENSE[Firmware-imx-sdma_firmware] = "LICENSE.sdma_firmware"
 NO_GENERIC_LICENSE[Firmware-tda7706-firmware] = "LICENCE.tda7706-firmware.txt"
 NO_GENERIC_LICENSE[Firmware-ti-connectivity] = "LICENCE.ti-connectivity"
 NO_GENERIC_LICENSE[Firmware-ti-keystone] = "LICENCE.ti-keystone"
@@ -172,21 +178,15 @@
 NO_GENERIC_LICENSE[Firmware-xc5000c] = "LICENCE.xc5000c"
 NO_GENERIC_LICENSE[WHENCE] = "WHENCE"
 
-SRCREV = "42ad5367dd38371b2a1bb263b6efa85f9b92fc93"
+SRCREV = "bf04291309d3169c0ad3b8db52564235bbd08e30"
 PE = "1"
 PV = "0.0+git${SRCPV}"
 
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
 
-# Some devices need a specific version, not the latest
-SRC_URI += "https://git.kernel.org/cgit/linux/kernel/git/iwlwifi/linux-firmware.git/plain/iwlwifi-8000C-19.ucode;name=iwlwifi-19"
-
-SRC_URI[iwlwifi-19.md5sum] = "132fbaee36beec5e98714f0bd66f7a1d"
-SRC_URI[iwlwifi-19.sha256sum] = "2034470df64d323b827c4f2d4d0d55be2846b7360179b5574aa28ff77b6c9471"
-
 S = "${WORKDIR}/git"
 
-inherit allarch update-alternatives
+inherit allarch
 
 CLEANBROKEN = "1"
 
@@ -195,53 +195,67 @@
 }
 
 do_install() {
-	install -d  ${D}/lib/firmware/
-	cp -r * ${D}/lib/firmware/
+	install -d  ${D}${nonarch_base_libdir}/firmware/
+	cp -r * ${D}${nonarch_base_libdir}/firmware/
 
 	# Avoid Makefile to be deployed
-	rm ${D}/lib/firmware/Makefile
+	rm ${D}${nonarch_base_libdir}/firmware/Makefile
 
 	# Remove unbuild firmware which needs cmake and bash
-	rm ${D}/lib/firmware/carl9170fw -rf
+	rm ${D}${nonarch_base_libdir}/firmware/carl9170fw -rf
 
 	# Remove pointless bash script
-	rm ${D}/lib/firmware/configure
+	rm ${D}${nonarch_base_libdir}/firmware/configure
+
+	# Remove python script used to check the WHENCE file
+	rm ${D}${nonarch_base_libdir}/firmware/check_whence.py
 
 	# Libertas sd8686
-	ln -sf libertas/sd8686_v9.bin ${D}/lib/firmware/sd8686.bin
-	ln -sf libertas/sd8686_v9_helper.bin ${D}/lib/firmware/sd8686_helper.bin
+	ln -sf libertas/sd8686_v9.bin ${D}${nonarch_base_libdir}/firmware/sd8686.bin
+	ln -sf libertas/sd8686_v9_helper.bin ${D}${nonarch_base_libdir}/firmware/sd8686_helper.bin
 
 	# fixup wl12xx location, after 2.6.37 the kernel searches a different location for it
-	( cd ${D}/lib/firmware ; ln -sf ti-connectivity/* . )
+	( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )
 
-        # Copy the iwlwifi ucode
-        cp ${WORKDIR}/iwlwifi-8000C-19.ucode ${D}/lib/firmware/
 }
 
 
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
+             ${PN}-mt7601u-license ${PN}-mt7601u \
              ${PN}-radeon-license ${PN}-radeon \
-             ${PN}-marvell-license ${PN}-sd8686 ${PN}-sd8688 ${PN}-sd8787 ${PN}-sd8797 \
+             ${PN}-marvell-license ${PN}-pcie8897 ${PN}-pcie8997 \
+             ${PN}-sd8686 ${PN}-sd8688 ${PN}-sd8787 ${PN}-sd8797 ${PN}-sd8801 ${PN}-sd8887 ${PN}-sd8897 \
              ${PN}-ti-connectivity-license ${PN}-wl12xx ${PN}-wl18xx \
              ${PN}-vt6656-license ${PN}-vt6656 \
-             ${PN}-rtl-license ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su \
-             ${PN}-broadcom-license ${PN}-bcm4329 ${PN}-bcm4330 ${PN}-bcm4334 ${PN}-bcm43340 ${PN}-bcm4339 ${PN}-bcm43430 ${PN}-bcm4354 \
-             ${PN}-atheros-license ${PN}-ar9170 ${PN}-carl9170 ${PN}-ath6k ${PN}-ath9k \
-             ${PN}-ar3k-license  ${PN}-ar3k  ${PN}-ath10k-license  ${PN}-ath10k  \
+             ${PN}-rtl-license ${PN}-rtl8188 ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su ${PN}-rtl8723 ${PN}-rtl8821 \
+             ${PN}-broadcom-license \
+             ${PN}-bcm4329 ${PN}-bcm4330 ${PN}-bcm4334 ${PN}-bcm43340 \
+             ${PN}-bcm43362 ${PN}-bcm4339 ${PN}-bcm43430 ${PN}-bcm4354 \
+             ${PN}-atheros-license ${PN}-ar9170 ${PN}-ath6k ${PN}-ath9k \
+             ${PN}-gplv2-license ${PN}-carl9170 \
+             ${PN}-ar3k-license ${PN}-ar3k ${PN}-ath10k-license ${PN}-ath10k ${PN}-qca \
+             \
+             ${PN}-imx-sdma-license ${PN}-imx-sdma-imx6q ${PN}-imx-sdma-imx7d \
              \
              ${PN}-iwlwifi-license ${PN}-iwlwifi \
              ${PN}-iwlwifi-135-6 \
              ${PN}-iwlwifi-3160-7 ${PN}-iwlwifi-3160-8 ${PN}-iwlwifi-3160-9 \
+             ${PN}-iwlwifi-3160-10 ${PN}-iwlwifi-3160-12 ${PN}-iwlwifi-3160-13 \
+             ${PN}-iwlwifi-3160-16 ${PN}-iwlwifi-3160-17 \
              ${PN}-iwlwifi-6000-4 ${PN}-iwlwifi-6000g2a-5 ${PN}-iwlwifi-6000g2a-6 \
              ${PN}-iwlwifi-6000g2b-5 ${PN}-iwlwifi-6000g2b-6 \
              ${PN}-iwlwifi-6050-4 ${PN}-iwlwifi-6050-5 \
              ${PN}-iwlwifi-7260 \
              ${PN}-iwlwifi-7265 \
-             ${PN}-iwlwifi-7265d ${PN}-iwlwifi-8000c ${PN}-iwlwifi-8265 \
+             ${PN}-iwlwifi-7265d ${PN}-iwlwifi-8265 \
              ${PN}-iwlwifi-misc \
+             ${PN}-ibt-license ${PN}-ibt ${PN}-ibt-misc \
+             ${PN}-ibt-11-5 ${PN}-ibt-12-16 ${PN}-ibt-hw-37-7 ${PN}-ibt-hw-37-8 \
              ${PN}-i915-license ${PN}-i915 \
              ${PN}-adsp-sst-license ${PN}-adsp-sst \
              ${PN}-bnx2-mips \
+             ${PN}-netronome-license ${PN}-netronome \
+             ${PN}-qat ${PN}-qat-license \
              ${PN}-whence-license \
              ${PN}-license \
              "
@@ -252,135 +266,216 @@
 LICENSE_${PN}-ath9k = "Firmware-atheros_firmware"
 LICENSE_${PN}-atheros-license = "Firmware-atheros_firmware"
 
-FILES_${PN}-atheros-license = "/lib/firmware/LICENCE.atheros_firmware"
+FILES_${PN}-atheros-license = "${nonarch_base_libdir}/firmware/LICENCE.atheros_firmware"
 FILES_${PN}-ar9170 = " \
-  /lib/firmware/ar9170*.fw \
-"
-FILES_${PN}-carl9170 = " \
-  /lib/firmware/carl9170*.fw \
+  ${nonarch_base_libdir}/firmware/ar9170*.fw \
 "
 FILES_${PN}-ath6k = " \
-  /lib/firmware/ath6k \
+  ${nonarch_base_libdir}/firmware/ath6k \
 "
 FILES_${PN}-ath9k = " \
-  /lib/firmware/ar9271.fw \
-  /lib/firmware/ar7010*.fw \
-  /lib/firmware/htc_9271.fw \
-  /lib/firmware/htc_7010.fw \
+  ${nonarch_base_libdir}/firmware/ar9271.fw \
+  ${nonarch_base_libdir}/firmware/ar7010*.fw \
+  ${nonarch_base_libdir}/firmware/htc_9271.fw \
+  ${nonarch_base_libdir}/firmware/htc_7010.fw \
+  ${nonarch_base_libdir}/firmware/ath9k_htc/htc_7010-1.4.0.fw \
+  ${nonarch_base_libdir}/firmware/ath9k_htc/htc_9271-1.4.0.fw \
 "
 
 RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
-RDEPENDS_${PN}-carl9170 += "${PN}-atheros-license"
 RDEPENDS_${PN}-ath6k += "${PN}-atheros-license"
 RDEPENDS_${PN}-ath9k += "${PN}-atheros-license"
 
+# For carl9170
+LICENSE_${PN}-carl9170 = "Firmware-GPLv2"
+LICENSE_${PN}-gplv2-license = "Firmware-GPLv2"
+
+FILES_${PN}-gplv2-license = "${nonarch_base_libdir}/firmware/GPL-2"
+FILES_${PN}-carl9170 = " \
+  ${nonarch_base_libdir}/firmware/carl9170*.fw \
+"
+
+RDEPENDS_${PN}-carl9170 += "${PN}-gplv2-license"
+
 # For QualCommAthos
 LICENSE_${PN}-ar3k = "Firmware-qualcommAthos_ar3k"
 LICENSE_${PN}-ar3k-license = "Firmware-qualcommAthos_ar3k"
 LICENSE_${PN}-ath10k = "Firmware-qualcommAthos_ath10k"
 LICENSE_${PN}-ath10k-license = "Firmware-qualcommAthos_ath10k"
+LICENSE_${PN}-qca = "Firmware-qualcommAthos_ath10k"
 
-FILES_${PN}-ar3k-license = "/lib/firmware/LICENSE.QualcommAtheros_ar3k"
+FILES_${PN}-ar3k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ar3k"
 FILES_${PN}-ar3k = " \
-  /lib/firmware/ar3k \
+  ${nonarch_base_libdir}/firmware/ar3k \
 "
 
-FILES_${PN}-ath10k-license = "/lib/firmware/LICENSE.QualcommAtheros_ath10k"
+FILES_${PN}-ath10k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ath10k"
 FILES_${PN}-ath10k = " \
-  /lib/firmware/ath10k \
+  ${nonarch_base_libdir}/firmware/ath10k \
+"
+
+FILES_${PN}-qca = " \
+  ${nonarch_base_libdir}/firmware/qca \
 "
 
 RDEPENDS_${PN}-ar3k += "${PN}-ar3k-license"
 RDEPENDS_${PN}-ath10k += "${PN}-ath10k-license"
+RDEPENDS_${PN}-qca += "${PN}-ath10k-license"
 
 # For ralink
 LICENSE_${PN}-ralink = "Firmware-ralink-firmware"
 LICENSE_${PN}-ralink-license = "Firmware-ralink-firmware"
 
-FILES_${PN}-ralink-license = "/lib/firmware/LICENCE.ralink-firmware.txt"
+FILES_${PN}-ralink-license = "${nonarch_base_libdir}/firmware/LICENCE.ralink-firmware.txt"
 FILES_${PN}-ralink = " \
-  /lib/firmware/rt*.bin \
+  ${nonarch_base_libdir}/firmware/rt*.bin \
 "
 
 RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
 
+# For mediatek MT7601U
+LICENSE_${PN}-mt7601u = "Firmware-ralink_a_mediatek_company_firmware"
+LICENSE_${PN}-mt7601u-license = "Firmware-ralink_a_mediatek_company_firmware"
+
+FILES_${PN}-mt7601u-license = "${nonarch_base_libdir}/firmware/LICENCE.ralink_a_mediatek_company_firmware"
+FILES_${PN}-mt7601u = " \
+  ${nonarch_base_libdir}/firmware/mt7601u.bin \
+"
+
+RDEPENDS_${PN}-mt7601u += "${PN}-mt7601u-license"
+
 # For radeon
 LICENSE_${PN}-radeon = "Firmware-radeon"
 LICENSE_${PN}-radeon-license = "Firmware-radeon"
 
-FILES_${PN}-radeon-license = "/lib/firmware/LICENSE.radeon"
+FILES_${PN}-radeon-license = "${nonarch_base_libdir}/firmware/LICENSE.radeon"
 FILES_${PN}-radeon = " \
-  /lib/firmware/radeon \
+  ${nonarch_base_libdir}/firmware/radeon \
 "
 
 RDEPENDS_${PN}-radeon += "${PN}-radeon-license"
 
 # For marvell
+LICENSE_${PN}-pcie8897 = "Firmware-Marvell"
+LICENSE_${PN}-pcie8997 = "Firmware-Marvell"
 LICENSE_${PN}-sd8686 = "Firmware-Marvell"
 LICENSE_${PN}-sd8688 = "Firmware-Marvell"
 LICENSE_${PN}-sd8787 = "Firmware-Marvell"
 LICENSE_${PN}-sd8797 = "Firmware-Marvell"
+LICENSE_${PN}-sd8801 = "Firmware-Marvell"
+LICENSE_${PN}-sd8887 = "Firmware-Marvell"
+LICENSE_${PN}-sd8897 = "Firmware-Marvell"
 LICENSE_${PN}-marvell-license = "Firmware-Marvell"
 
-FILES_${PN}-marvell-license = "/lib/firmware/LICENCE.Marvell"
+FILES_${PN}-marvell-license = "${nonarch_base_libdir}/firmware/LICENCE.Marvell"
+FILES_${PN}-pcie8897 = " \
+  ${nonarch_base_libdir}/firmware/mrvl/pcie8897_uapsta.bin \
+"
+FILES_${PN}-pcie8997 = " \
+  ${nonarch_base_libdir}/firmware/mrvl/pcie8997_wlan_v4.bin \
+  ${nonarch_base_libdir}/firmware/mrvl/pcieuart8997_combo_v4.bin \
+  ${nonarch_base_libdir}/firmware/mrvl/pcieusb8997_combo_v4.bin \
+"
 FILES_${PN}-sd8686 = " \
-  /lib/firmware/libertas/sd8686_v9* \
-  /lib/firmware/sd8686* \
+  ${nonarch_base_libdir}/firmware/libertas/sd8686_v9* \
+  ${nonarch_base_libdir}/firmware/sd8686* \
 "
 FILES_${PN}-sd8688 = " \
-  /lib/firmware/libertas/sd8688* \
-  /lib/firmware/mrvl/sd8688* \
+  ${nonarch_base_libdir}/firmware/libertas/sd8688* \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8688* \
 "
 FILES_${PN}-sd8787 = " \
-  /lib/firmware/mrvl/sd8787_uapsta.bin \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8787_uapsta.bin \
 "
 FILES_${PN}-sd8797 = " \
-  /lib/firmware/mrvl/sd8797_uapsta.bin \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8797_uapsta.bin \
+"
+FILES_${PN}-sd8801 = " \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8801_uapsta.bin \
+"
+FILES_${PN}-sd8887 = " \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8887_uapsta.bin \
+"
+FILES_${PN}-sd8897 = " \
+  ${nonarch_base_libdir}/firmware/mrvl/sd8897_uapsta.bin \
 "
 
 RDEPENDS_${PN}-sd8686 += "${PN}-marvell-license"
 RDEPENDS_${PN}-sd8688 += "${PN}-marvell-license"
 RDEPENDS_${PN}-sd8787 += "${PN}-marvell-license"
 RDEPENDS_${PN}-sd8797 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8801 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8887 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8897 += "${PN}-marvell-license"
+
+# For netronome
+LICENSE_${PN}-netronome = "Firmware-netronome"
+
+FILES_${PN}-netronome-license = " \
+  ${nonarch_base_libdir}/firmware/LICENCE.Netronome \
+"
+FILES_${PN}-netronome = " \
+  ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0081*.nffw \
+  ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0096*.nffw \
+  ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0097*.nffw \
+  ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0099*.nffw \
+"
+
+RDEPENDS_${PN}-netronome += "${PN}-netronome-license"
 
 # For rtl
+LICENSE_${PN}-rtl8188 = "Firmware-rtlwifi_firmware"
 LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi_firmware"
 LICENSE_${PN}-rtl8192ce = "Firmware-rtlwifi_firmware"
 LICENSE_${PN}-rtl8192su = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8723 = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8821 = "Firmware-rtlwifi_firmware"
 LICENSE_${PN}-rtl-license = "Firmware-rtlwifi_firmware"
 
 FILES_${PN}-rtl-license = " \
-  /lib/firmware/LICENCE.rtlwifi_firmware.txt \
+  ${nonarch_base_libdir}/firmware/LICENCE.rtlwifi_firmware.txt \
+"
+FILES_${PN}-rtl8188 = " \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8188*.bin \
 "
 FILES_${PN}-rtl8192cu = " \
-  /lib/firmware/rtlwifi/rtl8192cufw*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cufw*.bin \
 "
 FILES_${PN}-rtl8192ce = " \
-  /lib/firmware/rtlwifi/rtl8192cfw*.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cfw*.bin \
 "
 FILES_${PN}-rtl8192su = " \
-  /lib/firmware/rtlwifi/rtl8712u.bin \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8712u.bin \
+"
+FILES_${PN}-rtl8723 = " \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8723*.bin \
+"
+FILES_${PN}-rtl8821 = " \
+  ${nonarch_base_libdir}/firmware/rtlwifi/rtl8821*.bin \
 "
 
+RDEPENDS_${PN}-rtl8188 += "${PN}-rtl-license"
 RDEPENDS_${PN}-rtl8192ce += "${PN}-rtl-license"
 RDEPENDS_${PN}-rtl8192cu += "${PN}-rtl-license"
 RDEPENDS_${PN}-rtl8192su = "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8723 += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8821 += "${PN}-rtl-license"
 
 # For ti-connectivity
 LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity"
 LICENSE_${PN}-wl18xx = "Firmware-ti-connectivity"
 LICENSE_${PN}-ti-connectivity-license = "Firmware-ti-connectivity"
 
-FILES_${PN}-ti-connectivity-license = "/lib/firmware/LICENCE.ti-connectivity"
+FILES_${PN}-ti-connectivity-license = "${nonarch_base_libdir}/firmware/LICENCE.ti-connectivity"
 FILES_${PN}-wl12xx = " \
-  /lib/firmware/wl12* \
-  /lib/firmware/TI* \
-  /lib/firmware/ti-connectivity \
+  ${nonarch_base_libdir}/firmware/wl12* \
+  ${nonarch_base_libdir}/firmware/TI* \
+  ${nonarch_base_libdir}/firmware/ti-connectivity \
 "
 FILES_${PN}-wl18xx = " \
-  /lib/firmware/wl18* \
-  /lib/firmware/TI* \
-  /lib/firmware/ti-connectivity \
+  ${nonarch_base_libdir}/firmware/wl18* \
+  ${nonarch_base_libdir}/firmware/TI* \
+  ${nonarch_base_libdir}/firmware/ti-connectivity \
 "
 
 RDEPENDS_${PN}-wl12xx = "${PN}-ti-connectivity-license"
@@ -390,75 +485,58 @@
 LICENSE_${PN}-vt6656 = "Firmware-via_vt6656"
 LICENSE_${PN}-vt6656-license = "Firmware-via_vt6656"
 
-FILES_${PN}-vt6656-license = "/lib/firmware/LICENCE.via_vt6656"
+FILES_${PN}-vt6656-license = "${nonarch_base_libdir}/firmware/LICENCE.via_vt6656"
 FILES_${PN}-vt6656 = " \
-  /lib/firmware/vntwusb.fw \
+  ${nonarch_base_libdir}/firmware/vntwusb.fw \
 "
 
 RDEPENDS_${PN}-vt6656 = "${PN}-vt6656-license"
 
 # For broadcom
-#
-# WARNING: The ALTERNATIVE_* variables are not using ${PN} because of
-# a bug in bitbake; when this is fixed and bitbake learns how to proper
-# pass variable flags with expansion we can rework this patch.
 
 LICENSE_${PN}-bcm4329 = "Firmware-broadcom_bcm43xx"
 LICENSE_${PN}-bcm4330 = "Firmware-broadcom_bcm43xx"
 LICENSE_${PN}-bcm4334 = "Firmware-broadcom_bcm43xx"
 LICENSE_${PN}-bcm43340 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm43362 = "Firmware-broadcom_bcm43xx"
 LICENSE_${PN}-bcm4339 = "Firmware-broadcom_bcm43xx"
 LICENSE_${PN}-bcm43430 = "Firmware-broadcom_bcm43xx"
 LICENSE_${PN}-bcm4354 = "Firmware-broadcom_bcm43xx"
 LICENSE_${PN}-broadcom-license = "Firmware-broadcom_bcm43xx"
 
 FILES_${PN}-broadcom-license = " \
-  /lib/firmware/LICENCE.broadcom_bcm43xx \
+  ${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx \
 "
 FILES_${PN}-bcm4329 = " \
-  /lib/firmware/brcm/brcmfmac4329-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4329-sdio.bin \
 "
 FILES_${PN}-bcm4330 = " \
-  /lib/firmware/brcm/brcmfmac4330-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.bin \
 "
 FILES_${PN}-bcm4334 = " \
-  /lib/firmware/brcm/brcmfmac4334-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4334-sdio.bin \
 "
 FILES_${PN}-bcm43340 = " \
-  /lib/firmware/brcm/brcmfmac43340-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac43340-sdio.bin \
+"
+FILES_${PN}-bcm43362 = " \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac43362-sdio.bin \
 "
 FILES_${PN}-bcm4339 = " \
-  /lib/firmware/brcm/brcmfmac4339-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4339-sdio.bin \
 "
 FILES_${PN}-bcm43430 = " \
-  /lib/firmware/brcm/brcmfmac43430-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.bin \
 "
 FILES_${PN}-bcm4354 = " \
-  /lib/firmware/brcm/brcmfmac4354-sdio.bin \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin \
 "
 
-ALTERNATIVE_LINK_NAME[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac-sdio.bin"
-
-ALTERNATIVE_linux-firmware-bcm4334 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm4334[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4334-sdio.bin"
-ALTERNATIVE_linux-firmware-bcm43340 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm43340[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac43340-sdio.bin"
-ALTERNATIVE_linux_firmware-bcm4354 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm4354[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4354-sdio.bin"
-ALTERNATIVE_linux-firmware-bcm4329 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm4329[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4329-sdio.bin"
-ALTERNATIVE_linux-firmware-bcm4330 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm4330[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4330-sdio.bin"
-ALTERNATIVE_linux-firmware-bcm4339 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm4339[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4339-sdio.bin"
-ALTERNATIVE_PRIORITY_linux-firmware-bcm4339[brcmfmac-sdio.bin] = "20"
-ALTERNATIVE_linux-firmware-bcm43430 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm43430[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac43430-sdio.bin"
-
 RDEPENDS_${PN}-bcm4329 += "${PN}-broadcom-license"
 RDEPENDS_${PN}-bcm4330 += "${PN}-broadcom-license"
 RDEPENDS_${PN}-bcm4334 += "${PN}-broadcom-license"
 RDEPENDS_${PN}-bcm43340 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm43362 += "${PN}-broadcom-license"
 RDEPENDS_${PN}-bcm4339 += "${PN}-broadcom-license"
 RDEPENDS_${PN}-bcm43430 += "${PN}-broadcom-license"
 RDEPENDS_${PN}-bcm4354 += "${PN}-broadcom-license"
@@ -471,17 +549,40 @@
 LICENSE_${PN}-bnx2-mips = "WHENCE"
 LICENSE_${PN}-whence-license = "WHENCE"
 
-FILES_${PN}-bnx2-mips = "/lib/firmware/bnx2/bnx2-mips-09-6.2.1b.fw"
-FILES_${PN}-whence-license = "/lib/firmware/WHENCE"
+FILES_${PN}-bnx2-mips = "${nonarch_base_libdir}/firmware/bnx2/bnx2-mips-09-6.2.1b.fw"
+FILES_${PN}-whence-license = "${nonarch_base_libdir}/firmware/WHENCE"
 
 RDEPENDS_${PN}-bnx2-mips += "${PN}-whence-license"
 
+# For imx-sdma
+LICENSE_${PN}-imx-sdma-imx6q       = "Firmware-imx-sdma_firmware"
+LICENSE_${PN}-imx-sdma-imx7d       = "Firmware-imx-sdma_firmware"
+LICENSE_${PN}-imx-sdma-license       = "Firmware-imx-sdma_firmware"
+
+FILES_${PN}-imx-sdma-imx6q = "${nonarch_base_libdir}/firmware/imx/sdma/sdma-imx6q.bin"
+
+RPROVIDES_${PN}-imx-sdma-imx6q = "firmware-imx-sdma-imx6q"
+RREPLACES_${PN}-imx-sdma-imx6q = "firmware-imx-sdma-imx6q"
+RCONFLICTS_${PN}-imx-sdma-imx6q = "firmware-imx-sdma-imx6q"
+
+FILES_${PN}-imx-sdma-imx7d = "${nonarch_base_libdir}/firmware/imx/sdma/sdma-imx7d.bin"
+
+FILES_${PN}-imx-sdma-license = "${nonarch_base_libdir}/firmware/LICENSE.sdma_firmware"
+
+RDEPENDS_${PN}-imx-sdma-imx6q += "${PN}-imx-sdma-license"
+RDEPENDS_${PN}-imx-sdma-imx7d += "${PN}-imx-sdma-license"
+
 # For iwlwifi
 LICENSE_${PN}-iwlwifi           = "Firmware-iwlwifi_firmware"
 LICENSE_${PN}-iwlwifi-135-6     = "Firmware-iwlwifi_firmware"
 LICENSE_${PN}-iwlwifi-3160-7    = "Firmware-iwlwifi_firmware"
 LICENSE_${PN}-iwlwifi-3160-8    = "Firmware-iwlwifi_firmware"
 LICENSE_${PN}-iwlwifi-3160-9    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-10   = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-12   = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-13   = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-16   = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-17   = "Firmware-iwlwifi_firmware"
 LICENSE_${PN}-iwlwifi-6000-4    = "Firmware-iwlwifi_firmware"
 LICENSE_${PN}-iwlwifi-6000g2a-5 = "Firmware-iwlwifi_firmware"
 LICENSE_${PN}-iwlwifi-6000g2a-6 = "Firmware-iwlwifi_firmware"
@@ -498,29 +599,38 @@
 LICENSE_${PN}-iwlwifi-license   = "Firmware-iwlwifi_firmware"
 
 
-FILES_${PN}-iwlwifi-license = "/lib/firmware/LICENCE.iwlwifi_firmware"
-FILES_${PN}-iwlwifi-135-6 = "/lib/firmware/iwlwifi-135-6.ucode"
-FILES_${PN}-iwlwifi-3160-7 = "/lib/firmware/iwlwifi-3160-7.ucode"
-FILES_${PN}-iwlwifi-3160-8 = "/lib/firmware/iwlwifi-3160-8.ucode"
-FILES_${PN}-iwlwifi-3160-9 = "/lib/firmware/iwlwifi-3160-9.ucode"
-FILES_${PN}-iwlwifi-6000-4 = "/lib/firmware/iwlwifi-6000-4.ucode"
-FILES_${PN}-iwlwifi-6000g2a-5 = "/lib/firmware/iwlwifi-6000g2a-5.ucode"
-FILES_${PN}-iwlwifi-6000g2a-6 = "/lib/firmware/iwlwifi-6000g2a-6.ucode"
-FILES_${PN}-iwlwifi-6000g2b-5 = "/lib/firmware/iwlwifi-6000g2b-5.ucode"
-FILES_${PN}-iwlwifi-6000g2b-6 = "/lib/firmware/iwlwifi-6000g2b-6.ucode"
-FILES_${PN}-iwlwifi-6050-4 = "/lib/firmware/iwlwifi-6050-4.ucode"
-FILES_${PN}-iwlwifi-6050-5 = "/lib/firmware/iwlwifi-6050-5.ucode"
-FILES_${PN}-iwlwifi-7260   = "/lib/firmware/iwlwifi-7260-*.ucode"
-FILES_${PN}-iwlwifi-7265   = "/lib/firmware/iwlwifi-7265-*.ucode"
-FILES_${PN}-iwlwifi-7265d   = "/lib/firmware/iwlwifi-7265D-*.ucode"
-FILES_${PN}-iwlwifi-8000c   = "/lib/firmware/iwlwifi-8000C-*.ucode"
-FILES_${PN}-iwlwifi-8265   = "/lib/firmware/iwlwifi-8265-*.ucode"
-FILES_${PN}-iwlwifi-misc   = "/lib/firmware/iwlwifi-*.ucode"
+FILES_${PN}-iwlwifi-license = "${nonarch_base_libdir}/firmware/LICENCE.iwlwifi_firmware"
+FILES_${PN}-iwlwifi-135-6 = "${nonarch_base_libdir}/firmware/iwlwifi-135-6.ucode"
+FILES_${PN}-iwlwifi-3160-7 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-7.ucode"
+FILES_${PN}-iwlwifi-3160-8 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-8.ucode"
+FILES_${PN}-iwlwifi-3160-9 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-9.ucode"
+FILES_${PN}-iwlwifi-3160-10 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-10.ucode"
+FILES_${PN}-iwlwifi-3160-12 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-12.ucode"
+FILES_${PN}-iwlwifi-3160-13 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-13.ucode"
+FILES_${PN}-iwlwifi-3160-16 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-16.ucode"
+FILES_${PN}-iwlwifi-3160-17 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-17.ucode"
+FILES_${PN}-iwlwifi-6000-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6000-4.ucode"
+FILES_${PN}-iwlwifi-6000g2a-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-5.ucode"
+FILES_${PN}-iwlwifi-6000g2a-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-6.ucode"
+FILES_${PN}-iwlwifi-6000g2b-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-5.ucode"
+FILES_${PN}-iwlwifi-6000g2b-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-6.ucode"
+FILES_${PN}-iwlwifi-6050-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-4.ucode"
+FILES_${PN}-iwlwifi-6050-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-5.ucode"
+FILES_${PN}-iwlwifi-7260   = "${nonarch_base_libdir}/firmware/iwlwifi-7260-*.ucode"
+FILES_${PN}-iwlwifi-7265   = "${nonarch_base_libdir}/firmware/iwlwifi-7265-*.ucode"
+FILES_${PN}-iwlwifi-7265d   = "${nonarch_base_libdir}/firmware/iwlwifi-7265D-*.ucode"
+FILES_${PN}-iwlwifi-8265   = "${nonarch_base_libdir}/firmware/iwlwifi-8265-*.ucode"
+FILES_${PN}-iwlwifi-misc   = "${nonarch_base_libdir}/firmware/iwlwifi-*.ucode"
 
 RDEPENDS_${PN}-iwlwifi-135-6     = "${PN}-iwlwifi-license"
 RDEPENDS_${PN}-iwlwifi-3160-7    = "${PN}-iwlwifi-license"
 RDEPENDS_${PN}-iwlwifi-3160-8    = "${PN}-iwlwifi-license"
 RDEPENDS_${PN}-iwlwifi-3160-9    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-10   = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-12   = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-13   = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-16   = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-17   = "${PN}-iwlwifi-license"
 RDEPENDS_${PN}-iwlwifi-6000-4    = "${PN}-iwlwifi-license"
 RDEPENDS_${PN}-iwlwifi-6000g2a-5 = "${PN}-iwlwifi-license"
 RDEPENDS_${PN}-iwlwifi-6000g2a-6 = "${PN}-iwlwifi-license"
@@ -552,18 +662,49 @@
 RREPLACES_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}-iwlwifi-7260-9"
 RCONFLICTS_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}-iwlwifi-7260-9"
 
+# For ibt
+LICENSE_${PN}-ibt-license = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-hw-37-7 = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-hw-37-8 = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-11-5    = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-12-16   = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-misc    = "Firmware-ibt_firmware"
+
+FILES_${PN}-ibt-license = "${nonarch_base_libdir}/firmware/LICENCE.ibt_firmware"
+FILES_${PN}-ibt-hw-37-7 = "${nonarch_base_libdir}/firmware/intel/ibt-hw-37.7*.bseq"
+FILES_${PN}-ibt-hw-37-8 = "${nonarch_base_libdir}/firmware/intel/ibt-hw-37.8*.bseq"
+FILES_${PN}-ibt-11-5    = "${nonarch_base_libdir}/firmware/intel/ibt-11-5.sfi /lib/firmware/intel/ibt-11-5.ddc"
+FILES_${PN}-ibt-12-16   = "${nonarch_base_libdir}/firmware/intel/ibt-12-16.sfi /lib/firmware/intel/ibt-12-16.ddc"
+FILES_${PN}-ibt-misc    = "${nonarch_base_libdir}/firmware/ibt-*"
+
+RDEPENDS_${PN}-ibt-hw-37-7 = "${PN}-ibt-license"
+RDEPENDS_${PN}-ibt-hw-37.8 = "${PN}-ibt-license"
+RDEPENDS_${PN}-ibt-11-5    = "${PN}-ibt-license"
+RDEPENDS_${PN}-ibt-12-16   = "${PN}-ibt-license"
+RDEPENDS_${PN}-ibt-misc    = "${PN}-ibt-license"
+
+ALLOW_EMPTY_${PN}-ibt= "1"
+ALLOW_EMPTY_${PN}-ibt-misc = "1"
+
 LICENSE_${PN}-i915       = "Firmware-i915"
 LICENSE_${PN}-i915-license = "Firmware-i915"
-FILES_${PN}-i915-license = "/lib/firmware/LICENSE.i915"
-FILES_${PN}-i915         = "/lib/firmware/i915"
+FILES_${PN}-i915-license = "${nonarch_base_libdir}/firmware/LICENSE.i915"
+FILES_${PN}-i915         = "${nonarch_base_libdir}/firmware/i915"
 RDEPENDS_${PN}-i915      = "${PN}-i915-license"
 
-FILES_${PN}-adsp-sst-license      = "/lib/firmware/LICENCE.adsp_sst"
+FILES_${PN}-adsp-sst-license      = "${nonarch_base_libdir}/firmware/LICENCE.adsp_sst"
 LICENSE_${PN}-adsp-sst            = "Firmware-adsp_sst"
 LICENSE_${PN}-adsp-sst-license    = "Firmware-adsp_sst"
-FILES_${PN}-adsp-sst              = "/lib/firmware/intel/dsp_fw*"
+FILES_${PN}-adsp-sst              = "${nonarch_base_libdir}/firmware/intel/dsp_fw*"
 RDEPENDS_${PN}-adsp-sst           = "${PN}-adsp-sst-license"
 
+# For QAT
+LICENSE_${PN}-qat         = "Firmware-qat"
+LICENSE_${PN}-qat-license = "Firmware-qat"
+FILES_${PN}-qat-license   = "${nonarch_base_libdir}/firmware/LICENCE.qat_firmware"
+FILES_${PN}-qat           = "${nonarch_base_libdir}/firmware/qat*.bin"
+RDEPENDS_${PN}-qat        = "${PN}-qat-license"
+
 # For other firmwares
 # Maybe split out to separate packages when needed.
 LICENSE_${PN} = "\
@@ -588,7 +729,6 @@
     & Firmware-IntcSST2 \
     & Firmware-kaweth \
     & Firmware-moxa \
-    & Firmware-mwl8335 \
     & Firmware-myri10ge_firmware \
     & Firmware-nvidia \
     & Firmware-OLPC \
@@ -601,6 +741,7 @@
     & Firmware-radeon \
     & Firmware-ralink_a_mediatek_company_firmware \
     & Firmware-ralink-firmware \
+    & Firmware-imx-sdma_firmware \
     & Firmware-siano \
     & Firmware-tda7706-firmware \
     & Firmware-ti-connectivity \
@@ -613,17 +754,25 @@
     & WHENCE \
 "
 
-FILES_${PN}-license += "/lib/firmware/LICEN*"
-FILES_${PN} += "/lib/firmware/*"
+FILES_${PN}-license += "${nonarch_base_libdir}/firmware/LICEN*"
+FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
 RDEPENDS_${PN} += "${PN}-license"
 RDEPENDS_${PN} += "${PN}-whence-license"
 
 # Make linux-firmware depend on all of the split-out packages.
 # Make linux-firmware-iwlwifi depend on all of the split-out iwlwifi packages.
+# Make linux-firmware-ibt depend on all of the split-out ibt packages.
 python populate_packages_prepend () {
     firmware_pkgs = oe.utils.packages_filter_out_system(d)
     d.appendVar('RDEPENDS_linux-firmware', ' ' + ' '.join(firmware_pkgs))
 
     iwlwifi_pkgs = filter(lambda x: x.find('-iwlwifi-') != -1, firmware_pkgs)
     d.appendVar('RDEPENDS_linux-firmware-iwlwifi', ' ' + ' '.join(iwlwifi_pkgs))
+
+    ibt_pkgs = filter(lambda x: x.find('-ibt-') != -1, firmware_pkgs)
+    d.appendVar('RDEPENDS_linux-firmware-ibt', ' ' + ' '.join(ibt_pkgs))
 }
+
+# Firmware files are generally not ran on the CPU, so they can be
+# allarch despite being architecture specific
+INSANE_SKIP = "arch"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
index 078d752..1657df6 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -33,7 +33,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
 
 python __anonymous () {
-    major = d.getVar("PV",True).split('.')[0]
+    major = d.getVar("PV").split('.')[0]
     if major == "3":
         d.setVar("HEADER_FETCH_VER", "3.0")
     elif major == "4":
@@ -42,11 +42,12 @@
         d.setVar("HEADER_FETCH_VER", "2.6")
 }
 
-inherit kernel-arch
+inherit kernel-arch pkgconfig multilib_header
 
 KORG_ARCHIVE_COMPRESSION ?= "xz"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}"
+UPSTREAM_CHECK_URI = "https://www.kernel.org/"
 
 S = "${WORKDIR}/linux-${PV}"
 
@@ -68,9 +69,21 @@
 	find ${D}${includedir} -name ..install.cmd | xargs rm -f
 }
 
+do_install_append_aarch64 () {
+        do_install_armmultilib
+}
+
+do_install_append_arm () {
+	do_install_armmultilib
+}
+
+do_install_armmultilib () {
+	oe_multilib_header asm/auxvec.h asm/bitsperlong.h asm/byteorder.h asm/fcntl.h asm/hwcap.h asm/ioctls.h asm/kvm.h asm/mman.h asm/param.h asm/perf_regs.h
+	oe_multilib_header asm/posix_types.h asm/ptrace.h  asm/setup.h  asm/sigcontext.h asm/siginfo.h asm/signal.h asm/stat.h  asm/statfs.h asm/swab.h  asm/types.h asm/unistd.h
+}
+
 BBCLASSEXTEND = "nativesdk"
 
-#DEPENDS = "cross-linkage"
 RDEPENDS_${PN}-dev = ""
 RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
 
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch
new file mode 100644
index 0000000..bde2132
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch
@@ -0,0 +1,46 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,2/3] uapi glibc compat: fix build if libc defines IFF_ECHO
+From: Hauke Mehrtens <hauke@hauke-m.de>
+X-Patchwork-Id: 9686293
+Message-Id: <20170418210036.26039-3-hauke@hauke-m.de>
+To: davem@davemloft.net, netdev@vger.kernel.org
+Cc: linux-kernel@vger.kernel.org, jarod@redhat.com, jogo@openwrt.org,
+ david.heidelberger@ixit.cz, maillist-linux@barfooze.de,
+ mikko.rapeli@iki.fi, dwmw2@infradead.org, Hauke Mehrtens <hauke@hauke-m.de>
+Date: Tue, 18 Apr 2017 23:00:35 +0200
+
+musl 1.1.15 defines IFF_ECHO and the other net_device_flags options.
+When a user application includes linux/if.h and net/if.h the compile
+will fail.
+
+Activate __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO only when
+it is needed. This should also make this work in case glibc will add
+these defines.
+
+Acked-by: Mikko Rapeli <mikko.rapeli@iki.fi>
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+Upstream-Status: Submitted [https://patchwork.kernel.org/patch/9686293/]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+Acked-by: Stephane Ayotte <sayotte@tycoint.com>
+ include/uapi/linux/libc-compat.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
+index 43a81136ea6e..ce2fa8a4ced6 100644
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -64,9 +64,11 @@
+ /* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
+ /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
++#ifndef IFF_ECHO
+ #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
+ #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
++#endif /* IFF_ECHO */
+ 
+ #else /* _NET_IF_H */
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.10.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.10.bb
new file mode 100644
index 0000000..2926278
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.10.bb
@@ -0,0 +1,11 @@
+require linux-libc-headers.inc
+
+SRC_URI_append_libc-musl = "\
+    file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch \
+    file://0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch \
+    file://0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch \
+    file://0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch \
+   "
+
+SRC_URI[md5sum] = "b5e7f6b9b2fe1b6cc7bc56a3a0bfc090"
+SRC_URI[sha256sum] = "3c95d9f049bd085e5c346d2c77f063b8425f191460fcd3ae9fe7e94e0477dc4b"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb
deleted file mode 100644
index 3763dc0..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-require linux-libc-headers.inc
-
-SRC_URI_append_libc-musl = "\
-    file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch \
-    file://0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch \
-    file://0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch \
-   "
-SRC_URI[md5sum] = "9a78fa2eb6c68ca5a40ed5af08142599"
-SRC_URI[sha256sum] = "401d7c8fef594999a460d10c72c5a94e9c2e1022f16795ec51746b0d165418b2"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.8.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.8.bb
deleted file mode 100644
index 77e0870..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.8.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-require linux-libc-headers.inc
-
-PV = "4.8"
-
-SRC_URI_append_libc-musl = "\
-    file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch \
-    file://0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch \
-    file://0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch \
-   "
-
-SRC_URI[md5sum] = "c1af0afbd3df35c1ccdc7a5118cd2d07"
-SRC_URI[sha256sum] = "3e9150065f193d3d94bcf46a1fe9f033c7ef7122ab71d75a7fb5a2f0c9a7e11a"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb
index 0fdd0ad..7004261 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -6,7 +6,6 @@
 SECTION = "kernel"
 
 LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
 
 inherit linux-kernel-base
 
@@ -54,6 +53,13 @@
         # architecture (since scripts and helpers are native format).
         KBUILD_OUTPUT="$kerneldir"
         oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts
+        # make clean generates an absolute path symlink called "source"
+        # in $kerneldir points to $kerneldir, which doesn't make any
+        # sense, so remove it.
+        if [ -L $kerneldir/source ]; then
+            bbnote "Removing $kerneldir/source symlink"
+            rm -f $kerneldir/source
+        fi
 
         # As of Linux kernel version 3.0.1, the clean target removes
         # arch/powerpc/lib/crtsavres.o which is present in
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dtb.inc b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dtb.inc
index 2f378a1..0174c80 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dtb.inc
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dtb.inc
@@ -1,6 +1,8 @@
 # Support for device tree generation
 FILES_kernel-devicetree = "/${KERNEL_IMAGEDEST}/devicetree*"
 
+PACKAGE_WRITE_DEPS += "virtual/update-alternatives-native"
+
 python __anonymous () {
     d.appendVar("PACKAGES", " kernel-devicetree")
 }
@@ -70,7 +72,7 @@
 			DTB_EXT=${DTB##*.}
 			DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
 			DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
-			update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} ${DTB_BASE_NAME}.${DTB_EXT} /boot/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
+			update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} ${DTB_BASE_NAME}.${DTB_EXT} devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
 		done
 	done
 }
@@ -83,7 +85,7 @@
 			DTB_EXT=${DTB##*.}
 			DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
 			DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
-			update-alternatives --remove ${DTB_BASE_NAME}.${DTB_EXT} /boot/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
+			update-alternatives --remove ${DTB_BASE_NAME}.${DTB_EXT} devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
 		done
 	done
 }
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-dev.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-dev.bb
index 0cda553..bf67f81 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-dev.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-dev.bb
@@ -28,7 +28,7 @@
 SRCREV_machine ?= '${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "${AUTOREV}", "29594404d7fe73cd80eaa4ee8c43dcc53970c60e", d)}'
 SRCREV_meta ?= '${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "${AUTOREV}", "29594404d7fe73cd80eaa4ee8c43dcc53970c60e", d)}'
 
-LINUX_VERSION ?= "4.9-rc+"
+LINUX_VERSION ?= "4.11-rc+"
 LINUX_VERSION_EXTENSION ?= "-yoctodev-${LINUX_KERNEL_TYPE}"
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
@@ -39,7 +39,9 @@
 # Functionality flags
 KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
 KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
 KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
 KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
 KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
 
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
index 0e413f0..c82468a 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
@@ -7,17 +7,17 @@
 # to build multiple virtual/kernel providers, e.g. as dependency of
 # core-image-rt-sdk, core-image-rt.
 python () {
-    if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-yocto-rt":
+    if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
         raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
 }
 
-SRCREV_machine ?= "f793c71d51277bdb14d6854c8cbcc09b4f5936b4"
-SRCREV_meta ?= "7140ddb86e4b01529185e6d4a606001ad152b8f3"
+SRCREV_machine ?= "8cc62ac3f26bd6dde68ad2d86026a252fe7add44"
+SRCREV_meta ?= "9f9c9a66ef3452343586adf150137967e955d71a"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;branch=${KBRANCH};name=machine \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
 
-LINUX_VERSION ?= "4.1.38"
+LINUX_VERSION ?= "4.1.43"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.10.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.10.bb
new file mode 100644
index 0000000..f93d953
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.10.bb
@@ -0,0 +1,38 @@
+KBRANCH ?= "standard/preempt-rt/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# Skip processing of this recipe if it is not explicitly specified as the
+# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
+# to build multiple virtual/kernel providers, e.g. as dependency of
+# core-image-rt-sdk, core-image-rt.
+python () {
+    if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
+        raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
+}
+
+SRCREV_machine ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_meta ?= "40ee48ac099c04f60d2c132031d9625a4e0c4c9e"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.10.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.10;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.10.17"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+LINUX_KERNEL_TYPE = "preempt-rt"
+
+COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
index 1f73f0c..25d8883 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
@@ -7,17 +7,17 @@
 # to build multiple virtual/kernel providers, e.g. as dependency of
 # core-image-rt-sdk, core-image-rt.
 python () {
-    if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-yocto-rt":
+    if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
         raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
 }
 
-SRCREV_machine ?= "1af95315c6ab3672c8c7191873ef041a6c29ad70"
-SRCREV_meta ?= "d6733af2080f8c0775569adc0826eb0c8954fc5e"
+SRCREV_machine ?= "1e691db7af642fff0222a1f1d1e9043c172699d5"
+SRCREV_meta ?= "804d2b3164ec25ed519fd695de9aa0908460c92e"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;branch=${KBRANCH};name=machine \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA}"
 
-LINUX_VERSION ?= "4.4.60"
+LINUX_VERSION ?= "4.4.87"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.8.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.8.bb
deleted file mode 100644
index e65bc18..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.8.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-KBRANCH ?= "standard/preempt-rt/base"
-
-require recipes-kernel/linux/linux-yocto.inc
-
-# Skip processing of this recipe if it is not explicitly specified as the
-# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
-# to build multiple virtual/kernel providers, e.g. as dependency of
-# core-image-rt-sdk, core-image-rt.
-python () {
-    if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-yocto-rt":
-        raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
-}
-
-SRCREV_machine ?= "7f56c6365d0d677d5fe6ca73f1b2ab6640b523a3"
-SRCREV_meta ?= "c84532b6475fd78b878507a481e2c04714341c07"
-
-SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.8.git;branch=${KBRANCH};name=machine \
-           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.8;destsuffix=${KMETA}"
-
-LINUX_VERSION ?= "4.8.24"
-
-PV = "${LINUX_VERSION}+git${SRCPV}"
-
-KMETA = "kernel-meta"
-KCONF_BSP_AUDIT_LEVEL = "2"
-
-LINUX_KERNEL_TYPE = "preempt-rt"
-
-COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
-
-KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
-
-# Functionality flags
-KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
-KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
-KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
-KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
-KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.9.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.9.bb
new file mode 100644
index 0000000..6734dc0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.9.bb
@@ -0,0 +1,38 @@
+KBRANCH ?= "standard/preempt-rt/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# Skip processing of this recipe if it is not explicitly specified as the
+# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
+# to build multiple virtual/kernel providers, e.g. as dependency of
+# core-image-rt-sdk, core-image-rt.
+python () {
+    if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
+        raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
+}
+
+SRCREV_machine ?= "0817a7b3a853d1bdd3b87a2654ed2ee62f624806"
+SRCREV_meta ?= "6acae6f7200af17b3c2be5ecab2cffdc59a02b35"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.9.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.9;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.9.49"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+LINUX_KERNEL_TYPE = "preempt-rt"
+
+COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
index ce8aea6..537efb1 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
@@ -4,13 +4,13 @@
 
 require recipes-kernel/linux/linux-yocto.inc
 
-LINUX_VERSION ?= "4.1.38"
+LINUX_VERSION ?= "4.1.43"
 
 KMETA = "kernel-meta"
 KCONF_BSP_AUDIT_LEVEL = "2"
 
-SRCREV_machine ?= "2ce56d130ddff67f43ec857cc51cd347666a0078"
-SRCREV_meta ?= "7140ddb86e4b01529185e6d4a606001ad152b8f3"
+SRCREV_machine ?= "782133d8166ac71ef1ffaba58b7cf81ec9e532a1"
+SRCREV_meta ?= "9f9c9a66ef3452343586adf150137967e955d71a"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.10.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.10.bb
new file mode 100644
index 0000000..31396ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.10.bb
@@ -0,0 +1,25 @@
+KBRANCH ?= "standard/tiny/common-pc"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "4.10.17"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_meta ?= "40ee48ac099c04f60d2c132031d9625a4e0c4c9e"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.10.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.10;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "(qemux86$)"
+
+# Functionality flags
+KERNEL_FEATURES = ""
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb
index 04f719c..50b9a56 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb
@@ -4,13 +4,13 @@
 
 require recipes-kernel/linux/linux-yocto.inc
 
-LINUX_VERSION ?= "4.4.60"
+LINUX_VERSION ?= "4.4.87"
 
 KMETA = "kernel-meta"
 KCONF_BSP_AUDIT_LEVEL = "2"
 
-SRCREV_machine ?= "0298d3765a5c474ff5776284d49111276510d4b4"
-SRCREV_meta ?= "d6733af2080f8c0775569adc0826eb0c8954fc5e"
+SRCREV_machine ?= "b71c7b786aed26c0a1e4eca66f1d874ec017d699"
+SRCREV_meta ?= "804d2b3164ec25ed519fd695de9aa0908460c92e"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.8.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.8.bb
deleted file mode 100644
index a0aa085..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.8.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-KBRANCH ?= "standard/tiny/common-pc"
-LINUX_KERNEL_TYPE = "tiny"
-KCONFIG_MODE = "--allnoconfig"
-
-require recipes-kernel/linux/linux-yocto.inc
-
-LINUX_VERSION ?= "4.8.24"
-
-KMETA = "kernel-meta"
-KCONF_BSP_AUDIT_LEVEL = "2"
-
-SRCREV_machine ?= "6a134d2553b9c25ce8acb67b807fe0feb1b01430"
-SRCREV_meta ?= "c84532b6475fd78b878507a481e2c04714341c07"
-
-PV = "${LINUX_VERSION}+git${SRCPV}"
-
-SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.8.git;branch=${KBRANCH};name=machine \
-           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.8;destsuffix=${KMETA}"
-
-COMPATIBLE_MACHINE = "(qemux86$)"
-
-# Functionality flags
-KERNEL_FEATURES = ""
-
-KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.9.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.9.bb
new file mode 100644
index 0000000..e0c5236
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.9.bb
@@ -0,0 +1,25 @@
+KBRANCH ?= "standard/tiny/common-pc"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "4.9.49"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "480ee599fb8df712c10dcf4b7aa6398b79f7d404"
+SRCREV_meta ?= "6acae6f7200af17b3c2be5ecab2cffdc59a02b35"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.9.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.9;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "(qemux86$)"
+
+# Functionality flags
+KERNEL_FEATURES = ""
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto.inc b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto.inc
index 09cd1f1..637506a 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto.inc
@@ -12,9 +12,9 @@
 # PREFERRED_PROVIDER for virtual/kernel. This avoids network access required
 # by the use of AUTOREV SRCREVs, which are the default for this recipe.
 python () {
-    if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != d.getVar("PN", True):
+    if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != d.getVar("PN"):
         d.delVar("BB_DONT_CACHE")
-        raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to %s to enable it" % (d.getVar("PN", True)))
+        raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to %s to enable it" % (d.getVar("PN")))
 }
 
 DEPENDS += "xz-native bc-native"
@@ -65,6 +65,5 @@
 
 # extra tasks
 addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before do_compile
-addtask kernel_link_images after do_compile before do_strip
 addtask validate_branches before do_patch after do_kernel_checkout
 addtask kernel_configcheck after do_configure before do_compile
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.1.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.1.bb
index bf7f266..316bc32 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.1.bb
@@ -11,20 +11,20 @@
 KBRANCH_qemux86-64 ?= "standard/base"
 KBRANCH_qemumips64 ?= "standard/mti-malta64"
 
-SRCREV_machine_qemuarm ?= "4d2c95e78cdc7d312b7ab231ce90dce317f45df9"
-SRCREV_machine_qemuarm64 ?= "2ce56d130ddff67f43ec857cc51cd347666a0078"
-SRCREV_machine_qemumips ?= "81454f95166056a253c8950980e025ee243d8074"
-SRCREV_machine_qemuppc ?= "42c41e606b70fd73a202f4146c0480f5624b0a0e"
-SRCREV_machine_qemux86 ?= "2ce56d130ddff67f43ec857cc51cd347666a0078"
-SRCREV_machine_qemux86-64 ?= "2ce56d130ddff67f43ec857cc51cd347666a0078"
-SRCREV_machine_qemumips64 ?= "8a481005da41f82d2a40bf8cb40334547160ab5b"
-SRCREV_machine ?= "2ce56d130ddff67f43ec857cc51cd347666a0078"
-SRCREV_meta ?= "7140ddb86e4b01529185e6d4a606001ad152b8f3"
+SRCREV_machine_qemuarm ?= "642e9b95f97f8e00ef819bbfb2f281c1079bfbb1"
+SRCREV_machine_qemuarm64 ?= "782133d8166ac71ef1ffaba58b7cf81ec9e532a1"
+SRCREV_machine_qemumips ?= "54d4575d0df1805e127c5fa59201cd978849fb3f"
+SRCREV_machine_qemuppc ?= "58906f2737c644e67a7c9754b7e36630005a0011"
+SRCREV_machine_qemux86 ?= "782133d8166ac71ef1ffaba58b7cf81ec9e532a1"
+SRCREV_machine_qemux86-64 ?= "782133d8166ac71ef1ffaba58b7cf81ec9e532a1"
+SRCREV_machine_qemumips64 ?= "03f0c0293abfe5226c2fdd22328476854fa0127f"
+SRCREV_machine ?= "782133d8166ac71ef1ffaba58b7cf81ec9e532a1"
+SRCREV_meta ?= "9f9c9a66ef3452343586adf150137967e955d71a"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;name=machine;branch=${KBRANCH}; \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
 
-LINUX_VERSION ?= "4.1.38"
+LINUX_VERSION ?= "4.1.43"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.10.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.10.bb
new file mode 100644
index 0000000..7fcc753
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.10.bb
@@ -0,0 +1,44 @@
+KBRANCH ?= "standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm  ?= "standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "standard/qemuarm64"
+KBRANCH_qemumips ?= "standard/mti-malta32"
+KBRANCH_qemuppc  ?= "standard/qemuppc"
+KBRANCH_qemux86  ?= "standard/base"
+KBRANCH_qemux86-64 ?= "standard/base"
+KBRANCH_qemumips64 ?= "standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "ae12e19cecc19af66f64a50538909cb1cad185f9"
+SRCREV_machine_qemuarm64 ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_machine_qemumips ?= "b71b80fd679a17dfb4f73b352263c49273f721d4"
+SRCREV_machine_qemuppc ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_machine_qemux86 ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_machine_qemux86-64 ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_machine_qemumips64 ?= "8bb135e71037c46175bbcc7acf387309b2e17133"
+SRCREV_machine ?= "c1d8c4408b8aedd88eeb6ccc89ce834dd41b3f09"
+SRCREV_meta ?= "40ee48ac099c04f60d2c132031d9625a4e0c4c9e"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.10.git;name=machine;branch=${KBRANCH}; \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.10;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.10.17"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.4.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.4.bb
index d0eed65..d300e69 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.4.bb
@@ -11,20 +11,20 @@
 KBRANCH_qemux86-64 ?= "standard/base"
 KBRANCH_qemumips64 ?= "standard/mti-malta64"
 
-SRCREV_machine_qemuarm ?= "7d2a3c70d62f1e7f4eba571c49ff299db2bb3829"
-SRCREV_machine_qemuarm64 ?= "0298d3765a5c474ff5776284d49111276510d4b4"
-SRCREV_machine_qemumips ?= "6100965a51cf6b99f57cf8234aa982beb79455c9"
-SRCREV_machine_qemuppc ?= "0298d3765a5c474ff5776284d49111276510d4b4"
-SRCREV_machine_qemux86 ?= "0298d3765a5c474ff5776284d49111276510d4b4"
-SRCREV_machine_qemux86-64 ?= "0298d3765a5c474ff5776284d49111276510d4b4"
-SRCREV_machine_qemumips64 ?= "522e709fd7088e1a55e7a4708b1a07caa2ca4336"
-SRCREV_machine ?= "0298d3765a5c474ff5776284d49111276510d4b4"
-SRCREV_meta ?= "d6733af2080f8c0775569adc0826eb0c8954fc5e"
+SRCREV_machine_qemuarm ?= "840e2c02dde98ee9c584cacdd5bb0812e9dcd016"
+SRCREV_machine_qemuarm64 ?= "b71c7b786aed26c0a1e4eca66f1d874ec017d699"
+SRCREV_machine_qemumips ?= "27a547fe77b05ae63c3b973a029c3933ef62c164"
+SRCREV_machine_qemuppc ?= "b71c7b786aed26c0a1e4eca66f1d874ec017d699"
+SRCREV_machine_qemux86 ?= "b71c7b786aed26c0a1e4eca66f1d874ec017d699"
+SRCREV_machine_qemux86-64 ?= "b71c7b786aed26c0a1e4eca66f1d874ec017d699"
+SRCREV_machine_qemumips64 ?= "7e333c223b568704cc3303b2e922ff85a2a8f7ef"
+SRCREV_machine ?= "b71c7b786aed26c0a1e4eca66f1d874ec017d699"
+SRCREV_meta ?= "804d2b3164ec25ed519fd695de9aa0908460c92e"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;name=machine;branch=${KBRANCH}; \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA}"
 
-LINUX_VERSION ?= "4.4.60"
+LINUX_VERSION ?= "4.4.87"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb
deleted file mode 100644
index bfd52d2..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb
+++ /dev/null
@@ -1,44 +0,0 @@
-KBRANCH ?= "standard/base"
-
-require recipes-kernel/linux/linux-yocto.inc
-
-# board specific branches
-KBRANCH_qemuarm  ?= "standard/arm-versatile-926ejs"
-KBRANCH_qemuarm64 ?= "standard/qemuarm64"
-KBRANCH_qemumips ?= "standard/mti-malta32"
-KBRANCH_qemuppc  ?= "standard/qemuppc"
-KBRANCH_qemux86  ?= "standard/base"
-KBRANCH_qemux86-64 ?= "standard/base"
-KBRANCH_qemumips64 ?= "standard/mti-malta64"
-
-SRCREV_machine_qemuarm ?= "f25e3a184bf0ac7b12ec9c98d71439f4ac911974"
-SRCREV_machine_qemuarm64 ?= "b9c5f19c82c717b014eab5dc404b9489badbfc8f"
-SRCREV_machine_qemumips ?= "79e11192ca2c1acc714214c2125a8c0296c00413"
-SRCREV_machine_qemuppc ?= "7a688297cc810a614f0329371d1389e550a98504"
-SRCREV_machine_qemux86 ?= "f6329fd2875778192c03e08be02730180cb0dc71"
-SRCREV_machine_qemux86-64 ?= "f6329fd2875778192c03e08be02730180cb0dc71"
-SRCREV_machine_qemumips64 ?= "d619311dd8ea9ee95d80d937f08fb2c70c1dc50c"
-SRCREV_machine ?= "f6329fd2875778192c03e08be02730180cb0dc71"
-SRCREV_meta ?= "c84532b6475fd78b878507a481e2c04714341c07"
-
-SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.8.git;name=machine;branch=${KBRANCH}; \
-           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.8;destsuffix=${KMETA}"
-
-LINUX_VERSION ?= "4.8.24"
-
-PV = "${LINUX_VERSION}+git${SRCPV}"
-
-KMETA = "kernel-meta"
-KCONF_BSP_AUDIT_LEVEL = "2"
-
-KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
-
-COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
-
-# Functionality flags
-KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
-KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
-KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
-KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
-KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
-KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.9.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.9.bb
new file mode 100644
index 0000000..dbe40a3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.9.bb
@@ -0,0 +1,44 @@
+KBRANCH ?= "standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm  ?= "standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "standard/qemuarm64"
+KBRANCH_qemumips ?= "standard/mti-malta32"
+KBRANCH_qemuppc  ?= "standard/qemuppc"
+KBRANCH_qemux86  ?= "standard/base"
+KBRANCH_qemux86-64 ?= "standard/base"
+KBRANCH_qemumips64 ?= "standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "8caa35a74753d45178720933f03d8d5150a8ff17"
+SRCREV_machine_qemuarm64 ?= "480ee599fb8df712c10dcf4b7aa6398b79f7d404"
+SRCREV_machine_qemumips ?= "fc2a3b9f932779fdf053675a5a73e8f9917507a5"
+SRCREV_machine_qemuppc ?= "480ee599fb8df712c10dcf4b7aa6398b79f7d404"
+SRCREV_machine_qemux86 ?= "480ee599fb8df712c10dcf4b7aa6398b79f7d404"
+SRCREV_machine_qemux86-64 ?= "480ee599fb8df712c10dcf4b7aa6398b79f7d404"
+SRCREV_machine_qemumips64 ?= "aee63978005c04ea853099764acaa08130e65554"
+SRCREV_machine ?= "480ee599fb8df712c10dcf4b7aa6398b79f7d404"
+SRCREV_meta ?= "6acae6f7200af17b3c2be5ecab2cffdc59a02b35"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.9.git;name=machine;branch=${KBRANCH}; \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.9;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.9.49"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace_1.4.0.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace_1.4.0.bb
deleted file mode 100644
index 0fadeb0..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace_1.4.0.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SUMMARY = "Babeltrace - Trace Format Babel Tower"
-DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log."
-HOMEPAGE = "http://www.efficios.com/babeltrace/"
-BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
-
-LICENSE = "MIT & GPLv2"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
-
-DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
-
-inherit autotools pkgconfig
-
-SRC_URI = "http://www.efficios.com/files/babeltrace/babeltrace-${PV}.tar.bz2 \
-"
-
-EXTRA_OECONF = "--disable-debug-info"
-
-SRC_URI[md5sum] = "fa99064048af5c9c6ff00e489ac809c2"
-SRC_URI[sha256sum] = "9469eeb22617cd12668683b04c27003e5337e9ac66ade914988df3642fc0d0e4"
-
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace_1.5.2.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace_1.5.2.bb
new file mode 100644
index 0000000..c7ea5c1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace_1.5.2.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Babeltrace - Trace Format Babel Tower"
+DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log."
+HOMEPAGE = "http://www.efficios.com/babeltrace/"
+BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
+
+LICENSE = "MIT & GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
+
+DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
+
+inherit autotools pkgconfig
+
+SRC_URI = "http://www.efficios.com/files/babeltrace/babeltrace-${PV}.tar.bz2 \
+"
+
+EXTRA_OECONF = "--disable-debug-info"
+
+SRC_URI[md5sum] = "1176e7f69e128112d5f29fefec39c6ce"
+SRC_URI[sha256sum] = "696ee46e5750ab57a258663e73915d2901b7cd4fc53b06eb3f7a0d7b1012fa56"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-modules_2.9.1.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-modules_2.9.1.bb
new file mode 100644
index 0000000..abff79d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-modules_2.9.1.bb
@@ -0,0 +1,32 @@
+SECTION = "devel"
+SUMMARY = "Linux Trace Toolkit KERNEL MODULE"
+DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules"
+LICENSE = "LGPLv2.1 & GPLv2 & MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=362844633a08753bd96ab322a6c7f9f6 \
+                    file://gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \
+                    file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
+
+inherit module
+
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|nios2|arm).*-linux'
+
+SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \
+           file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch"
+
+SRC_URI[md5sum] = "5a16bca52233cc2bdff572b1120a88f6"
+SRC_URI[sha256sum] = "62078fe3254ca65969db4b72e59042cd797dbf2740848f8f82384877ae460d54"
+
+export INSTALL_MOD_DIR="kernel/lttng-modules"
+
+EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'"
+
+do_install_append() {
+	# Delete empty directories to avoid QA failures if no modules were built
+	find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \;
+}
+
+python do_package_prepend() {
+    if not os.path.exists(os.path.join(d.getVar('D'), d.getVar('nonarch_base_libdir')[1:], 'modules')):
+        bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN'))
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-modules_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-modules_git.bb
deleted file mode 100644
index 7014541..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-modules_git.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-SECTION = "devel"
-SUMMARY = "Linux Trace Toolkit KERNEL MODULE"
-DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules"
-LICENSE = "LGPLv2.1 & GPLv2 & MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=362844633a08753bd96ab322a6c7f9f6 \
-                    file://gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \
-                    file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
-
-inherit module
-
-SRCREV = "6e4fc6f36d68fb3c8d40113f8670eb6e9c8ffd76"
-PV = "2.8.0+git${SRCPV}"
-
-COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|nios2|arm).*-linux'
-
-SRC_URI = "git://git.lttng.org/lttng-modules.git;branch=stable-2.8 \
-           file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch"
-
-export INSTALL_MOD_DIR="kernel/lttng-modules"
-
-EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'"
-
-S = "${WORKDIR}/git"
-
-do_install_append() {
-	# Delete empty directories to avoid QA failures if no modules were built
-	find ${D}/lib -depth -type d -empty -exec rmdir {} \;
-}
-
-python do_package_prepend() {
-    if not os.path.exists(os.path.join(d.getVar('D', True), 'lib/modules')):
-        bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN', True))
-}
-
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-error.h-common-error.h.patch b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-error.h-common-error.h.patch
deleted file mode 100644
index 6c8a9b2..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-error.h-common-error.h.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 6712db617fe9155ea236f6840c2bd18dbec4c871 Mon Sep 17 00:00:00 2001
-From: Michael Jeanson <mjeanson@efficios.com>
-Date: Wed, 15 Jun 2016 17:18:03 -0400
-Subject: [PATCH] Fix: error.h -> common/error.h
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Upstream-Status: Backport
-
-Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
-Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
-Signed-off-by: Peter Liu <peter.x.liu@external.atlascopco.com>
----
- src/bin/lttng-sessiond/agent.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/bin/lttng-sessiond/agent.c b/src/bin/lttng-sessiond/agent.c
-index 7cbbbde..310a7e8 100644
---- a/src/bin/lttng-sessiond/agent.c
-+++ b/src/bin/lttng-sessiond/agent.c
-@@ -29,7 +29,7 @@
- #include "agent.h"
- #include "ust-app.h"
- #include "utils.h"
--#include "error.h"
-+#include "common/error.h"
- 
- #define AGENT_RET_CODE_INDEX(code) (code - AGENT_RET_CODE_SUCCESS)
- 
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest
index 6230063..705030e 100755
--- a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest
@@ -1,5 +1,6 @@
 #!/bin/sh
 # Without --ignore-exit, the tap harness causes any FAILs within a
 # test plan to raise ERRORs; this is just noise.
-makeargs="LOG_DRIVER_FLAGS=--ignore-exit"
-make -t all >/dev/null 2>&1 && exec make -s $makeargs check 2>/dev/null
+makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD"
+make -k -t all >/dev/null 2>&1
+exec make -s $makeargs check 2>/dev/null
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/x32.patch b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/x32.patch
new file mode 100644
index 0000000..b1bb8e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/x32.patch
@@ -0,0 +1,16 @@
+Fix build for x32
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+--- lttng-tools-2.6.0/src/bin/lttng/utils.c~	2015-01-26 18:17:15.000000000 +0100
++++ lttng-tools-2.6.0/src/bin/lttng/utils.c	2015-07-30 19:45:25.632045712 +0200
+@@ -130,7 +130,7 @@
+ #define HAS_FLS_U32
+ #endif
+ 
+-#if defined(__x86_64)
++#if defined(__x86_64) && !defined(__ILP32__)
+ static inline
+ unsigned int fls_u64(uint64_t x)
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools_2.9.4.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools_2.9.4.bb
new file mode 100644
index 0000000..fbf3ae9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools_2.9.4.bb
@@ -0,0 +1,122 @@
+SECTION = "devel"
+SUMMARY = "Linux Trace Toolkit Control"
+DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \
+to extract program execution details from the Linux operating system \
+and interpret them."
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \
+                    file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca"
+
+DEPENDS = "liburcu popt libxml2 util-linux"
+RDEPENDS_${PN} = "libgcc"
+RDEPENDS_${PN}-ptest += "make perl bash gawk ${PN} babeltrace procps"
+# babelstats.pl wants getopt-long
+RDEPENDS_${PN}-ptest += "perl-module-getopt-long"
+
+PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
+                 am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
+                 PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
+"
+PACKAGECONFIG ??= "lttng-ust"
+PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native"
+PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust"
+PACKAGECONFIG[kmod] = "--enable-kmod, --disable-kmod, kmod"
+PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
+PACKAGECONFIG_remove_libc-musl = "lttng-ust"
+
+SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
+           file://x32.patch \
+           file://run-ptest \
+           "
+
+SRC_URI[md5sum] = "10f47abfa214b167580358388428770d"
+SRC_URI[sha256sum] = "3c72456bceef961fad1d0861f07478db16b7659efa69099ba36645da89ca2cc5"
+
+inherit autotools ptest pkgconfig useradd python3-dir manpages
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "tracing"
+
+FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
+                ${PYTHON_SITEPACKAGES_DIR}/*"
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
+FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
+
+# Since files are installed into ${libdir}/lttng/libexec we match 
+# the libexec insane test so skip it.
+# Python module needs to keep _lttng.so
+INSANE_SKIP_${PN} = "libexec dev-so"
+INSANE_SKIP_${PN}-dbg = "libexec"
+
+do_install_ptest () {
+    for f in Makefile tests/Makefile tests/utils/utils.sh ; do
+        install -D "${B}/$f" "${D}${PTEST_PATH}/$f"
+    done
+
+    for f in config/tap-driver.sh config/test-driver ; do
+        install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
+    done
+
+    # Prevent 'make check' from recursing into non-test subdirectories.
+    sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile"
+
+    # We don't need these
+    sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile"
+
+    # We shouldn't need to build anything in tests/utils
+    sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \
+        "${D}${PTEST_PATH}/tests/Makefile"
+
+    # Copy the tests directory tree and the executables and
+    # Makefiles found within.
+    for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do
+        install -d "${D}${PTEST_PATH}/tests/$d"
+        find "${B}/tests/$d" -maxdepth 1 -executable -type f \
+            -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
+        test -r "${B}/tests/$d/Makefile" && \
+            install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile"
+    done
+
+    # We shouldn't need to build anything in tests/regression/tools
+    sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \
+        "${D}${PTEST_PATH}/tests/regression/Makefile"
+
+    # Prevent attempts to update Makefiles during test runs, and
+    # silence "Making check in $SUBDIR" messages.
+    find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
+        sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
+        -e '/echo "Making $$target in $$subdir"; \\/d' \
+        -e 's/^srcdir = \(.*\)/srcdir = ./' \
+        -e 's/^builddir = \(.*\)/builddir = ./' \
+        -e 's/^all-am:.*/all-am:/' \
+        {} +
+
+    # These objects trigger [rpaths] QA checks; the test harness
+    # skips the associated tests if they're missing, so delete
+    # them.
+    objs=""
+    objs="$objs regression/ust/ust-dl/libbar.so"
+    objs="$objs regression/ust/ust-dl/libfoo.so"
+    for obj in $objs ; do
+        rm -f "${D}${PTEST_PATH}/tests/${obj}"
+    done
+
+    find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
+        touch -r "${B}/Makefile" {} +
+
+    # Substitute links to installed binaries.
+    for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd ; do
+        exedir="${D}${PTEST_PATH}/src/bin/${prog}"
+        install -d "$exedir"
+        case "$prog" in
+            lttng-consumerd)
+                ln -s "${libdir}/lttng/libexec/$prog" "$exedir"
+                ;;
+            *)
+                ln -s "${bindir}/$prog" "$exedir"
+                ;;
+        esac
+    done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools_git.bb
deleted file mode 100644
index b00ce8d..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools_git.bb
+++ /dev/null
@@ -1,119 +0,0 @@
-SECTION = "devel"
-SUMMARY = "Linux Trace Toolkit Control"
-DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \
-to extract program execution details from the Linux operating system \
-and interpret them."
-
-LICENSE = "GPLv2 & LGPLv2.1"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \
-                    file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca"
-
-DEPENDS = "liburcu popt libxml2 util-linux"
-RDEPENDS_${PN} = "libgcc"
-RDEPENDS_${PN}-ptest += "make perl bash gawk ${PN} babeltrace procps"
-# babelstats.pl wants getopt-long
-RDEPENDS_${PN}-ptest += "perl-module-getopt-long"
-
-SRCREV = "d11e0dba0df9024b8613c51e167a379b91e8b20b"
-PV = "2.8.1+git${SRCPV}"
-
-PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
-                 am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
-                 PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
-"
-PACKAGECONFIG ??= "lttng-ust"
-PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native"
-PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust"
-PACKAGECONFIG[kmod] = "--enable-kmod, --disable-kmod, kmod"
-PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native"
-PACKAGECONFIG_remove_libc-musl = "lttng-ust"
-
-SRC_URI = "git://git.lttng.org/lttng-tools.git;branch=stable-2.8 \
-           file://0001-Fix-error.h-common-error.h.patch \
-           file://run-ptest"
-
-S = "${WORKDIR}/git"
-
-inherit autotools-brokensep ptest pkgconfig useradd python3-dir
-
-USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "tracing"
-
-FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
-                ${PYTHON_SITEPACKAGES_DIR}/*"
-FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
-FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
-
-# Since files are installed into ${libdir}/lttng/libexec we match 
-# the libexec insane test so skip it.
-# Python module needs to keep _lttng.so
-INSANE_SKIP_${PN} = "libexec dev-so"
-INSANE_SKIP_${PN}-dbg = "libexec"
-
-do_configure_prepend () {
-	# Delete a shipped m4 file that overrides our patched one
-	rm -f ${S}/m4/libxml.m4
-}
-
-do_install_ptest () {
-	mkdir -p ${D}${PTEST_PATH}
-
-	cp -a -T ${B} ${D}${PTEST_PATH}
-
-	# Prevent attempts to update Makefiles during test runs, and
-	# silence "Making check in $SUBDIR" messages.
-	find ${D}${PTEST_PATH} -name Makefile -type f -exec \
-		sed -i -e 's!^Makefile:!_Makefile:!' \
-		-e '/echo "Making $$target in $$subdir"; \\/d' {} +
-
-	# Prevent attempts to update version.h during test runs.
-	sed -i -e '/^\.PHONY: version\.h$/d' ${D}${PTEST_PATH}/include/Makefile
-
-	# Silence "Making check in $SUBDIR" messages.
-	find ${D}${PTEST_PATH} -name Makefile -type f -exec \
-		sed -i -e '/echo "Making $$target in $$subdir"; \\/d' {} +
-
-	# Substitute links to installed binaries.
-	for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd ; do
-		orig="${D}${PTEST_PATH}/src/bin/${prog}/${prog}"
-		rm "$orig"
-		case "$prog" in
-			lttng-consumerd)
-				ln -s "${libdir}/lttng/libexec/$prog" "$orig"
-				;;
-			*)
-				ln -s "${bindir}/$prog" "$orig"
-				;;
-		esac
-	done
-
-	# Remove libtool artifacts.
-	find ${D}${PTEST_PATH} \( -name '*.l[ao]' -o -name '*.lai' \) -delete
-
-	# Remove object files and archives.
-	find ${D}${PTEST_PATH} -name '*.[oa]' -type f -delete
-
-	# Remove Makefile.am and Makefile.in.
-	find ${D}${PTEST_PATH} -name 'Makefile.*' -type f -delete
-
-	# Remove autom4te.cache.
-	rm -rf ${D}${PTEST_PATH}/autom4te.cache
-
-	# Replace libtool wrapper scripts (which won't work on the
-	# target) with their corresponding binaries.
-	for prog in unit/ini_config/ini_config \
-		regression/tools/live/live_test \
-		regression/tools/health/health_check ; do
-		basename=${prog##*/}
-		ldir=${D}${PTEST_PATH}/tests/${prog%/*}
-		mv -f ${ldir}/.libs/${basename} ${ldir}
-	done
-
-	# checkpatch.pl is unneeded on target and causes file-rdeps QA
-	# warnings.
-	rm -f ${D}${PTEST_PATH}/extras/checkpatch.pl
-
-        # Remove built libraries as they confuse the packages' runtime dependency resolution
-        rm -rf ${D}${PTEST_PATH}/src/lib/lttng-ctl/.libs/
-}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
index caf0b8b..0f18c5d 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
@@ -12,7 +12,7 @@
 +++ b/doc/Makefile.am
 @@ -1,4 +1,4 @@
 -SUBDIRS = . man examples
-+SUBDIRS = .
++SUBDIRS = . man
  
  dist_man_MANS = man/lttng-gen-tp.1 \
  	man/lttng-ust.3 \
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust_2.9.0.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust_2.9.0.bb
new file mode 100644
index 0000000..288b5ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust_2.9.0.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Linux Trace Toolkit Userspace Tracer 2.x"
+DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library to trace userspace codes."
+HOMEPAGE = "http://lttng.org/ust"
+BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust"
+
+LICENSE = "LGPLv2.1+ & MIT & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \
+                    file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \
+                    file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44"
+
+inherit autotools lib_package manpages
+
+DEPENDS = "liburcu util-linux"
+RDEPENDS_${PN}-bin = "python3-core"
+
+# For backwards compatibility after rename
+RPROVIDES_${PN} = "lttng2-ust"
+RREPLACES_${PN} = "lttng2-ust"
+RCONFLICTS_${PN} = "lttng2-ust"
+
+PE = "2"
+
+SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \
+           file://lttng-ust-doc-examples-disable.patch \
+          "
+SRC_URI[md5sum] = "77f3378ba37a36801420bce87b702e9c"
+SRC_URI[sha256sum] = "4d541a863f42dfc685ca05024027a442c70d03594c154a43e62bc109b1ea5daf"
+
+CVE_PRODUCT = "ust"
+
+PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
+
+do_install_append() {
+        # Patch python tools to use Python 3; they should be source compatible, but
+        # still refer to Python 2 in the shebang
+        sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust_git.bb
deleted file mode 100644
index baff71f..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust_git.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-SUMMARY = "Linux Trace Toolkit Userspace Tracer 2.x"
-DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library to trace userspace codes."
-HOMEPAGE = "http://lttng.org/ust"
-BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust"
-
-LICENSE = "LGPLv2.1+ & MIT & GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \
-                    file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \
-                    file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44"
-
-inherit autotools lib_package
-
-DEPENDS = "liburcu util-linux"
-RDEPENDS_${PN}-bin = "python3-core"
-
-# For backwards compatibility after rename
-RPROVIDES_${PN} = "lttng2-ust"
-RREPLACES_${PN} = "lttng2-ust"
-RCONFLICTS_${PN} = "lttng2-ust"
-
-SRCREV = "514a87f3b64181e384399935a5708a8f85b0cc83"
-PE = "2"
-PV = "2.8.1+git${SRCPV}"
-
-SRC_URI = "git://git.lttng.org/lttng-ust.git;branch=stable-2.8 \
-           file://lttng-ust-doc-examples-disable.patch \
-          "
-
-EXTRA_OECONF += "--disable-man-pages"
-
-do_install_append() {
-        # Patch python tools to use Python 3; they should be source compatible, but
-        # still refer to Python 2 in the shebang
-        sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp
-}
-
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend () {
-	( cd ${S}; ${S}/bootstrap )
-}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb b/import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
index db670cf..0f3df55 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
@@ -22,7 +22,7 @@
 	install -m 0755 ${WORKDIR}/modutils.sh ${D}${sysconfdir}/init.d/
 }
 
-DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
 pkg_postinst_${PN} () {
 	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
 		if [ -n "$D" ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/perf/perf-features.inc b/import-layers/yocto-poky/meta/recipes-kernel/perf/perf-features.inc
deleted file mode 100644
index b8859ab..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/perf/perf-features.inc
+++ /dev/null
@@ -1,22 +0,0 @@
-PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui"
-
-def perf_feature_enabled(feature, trueval, falseval, d):
-    """
-    Check which perf features are enabled.
-
-    The PERF_FEATURES_ENABLE variable lists the perf features to
-    enable.  Override it if you want something different from what's
-    listed above, which is the default.  If empty, the build won't
-    enable any features (which may be exactly what you want, just a
-    barebones perf without any extra baggage, what you get if you
-    specify an empty feature list).
-
-    Available perf features:
-      perf-scripting: enable support for Perl and Python bindings
-      perf-tui: enable support for the perf TUI (via libnewt)
-
-    """
-    enabled_features = d.getVar("PERF_FEATURES_ENABLE", True) or ""
-    if feature in enabled_features:
-        return trueval
-    return falseval
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/perf/perf.bb b/import-layers/yocto-poky/meta/recipes-kernel/perf/perf.bb
index 8cf0f51..1bad6f4 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/perf/perf.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/perf/perf.bb
@@ -205,7 +205,7 @@
 }
 
 python do_package_prepend() {
-    d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0])
+    d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0])
 }
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/0001-Forward-port-mips-arm-memory-barrier-patches.patch b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/0001-Forward-port-mips-arm-memory-barrier-patches.patch
deleted file mode 100644
index 92e804f..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/0001-Forward-port-mips-arm-memory-barrier-patches.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From a2d385e504323641b1127821833c61e77301c90b Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Sat, 11 Jun 2016 22:45:37 +0300
-Subject: [PATCH] Forward port mips & arm memory barrier patches
-
-Upstream-Status: Pending
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
----
- lib/util/util.h | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
-diff --git a/lib/util/util.h b/lib/util/util.h
-index 591722d..0768056 100644
---- a/lib/util/util.h
-+++ b/lib/util/util.h
-@@ -29,4 +29,19 @@
- #define read_barrier()           asm volatile("" ::: "memory")
- #endif
- 
-+#ifdef __arm__
-+/*
-+ * Use the __kuser_memory_barrier helper in the CPU helper page. See
-+ * arch/arm/kernel/entry-armv.S in the kernel source for details.
-+ */
-+#define read_barrier()         ((void(*)(void))0xffff0fa0)()
-+#endif
-+
-+#ifdef __mips__
-+#define read_barrier()         asm volatile(".set   mips2\n\t" \
-+                                            "sync\n\t" \
-+                                            ".set   mips0" ::: "memory")
-+#endif
-+
-+
- #endif /* SP_UTIL_H */
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/0001-callgraph-Use-U64_TO_POINTER.patch b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/0001-callgraph-Use-U64_TO_POINTER.patch
deleted file mode 100644
index ac1384c..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/0001-callgraph-Use-U64_TO_POINTER.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 05816e6f9cd65b2624bb04de65fdf61031c7017f Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Fri, 10 Jun 2016 14:01:54 +0300
-Subject: [PATCH] callgraph: Use U64_TO_POINTER
-
-This fixes a "cast to pointer from integer of different size" on i586.
-
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Upstream-Status: Pending
----
- lib/sp-callgraph-view.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/sp-callgraph-view.c b/lib/sp-callgraph-view.c
-index 02cc17b..58315b0 100644
---- a/lib/sp-callgraph-view.c
-+++ b/lib/sp-callgraph-view.c
-@@ -135,7 +135,7 @@ build_functions_store (StackNode *node,
- 
-   gtk_list_store_append (state->store, &iter);
-   gtk_list_store_set (state->store, &iter,
--                      COLUMN_NAME, (const gchar *)node->data,
-+                      COLUMN_NAME, U64_TO_POINTER(node->data),
-                       COLUMN_SELF, 100.0 * size / state->profile_size,
-                       COLUMN_TOTAL, 100.0 * total / state->profile_size,
-                       COLUMN_POINTER, node,
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/sysprof/sysprof_3.22.3.bb b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/sysprof_3.22.3.bb
new file mode 100644
index 0000000..2631063
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/sysprof_3.22.3.bb
@@ -0,0 +1,34 @@
+SUMMARY = "System-wide Performance Profiler for Linux"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://src/sp-application.c;endline=17;md5=40e55577ef122c88fe20052acda64875"
+
+inherit gnomebase gettext systemd upstream-version-is-even
+
+DEPENDS = "glib-2.0 libxml2-native glib-2.0-native"
+
+SRC_URI += " \
+           file://define-NT_GNU_BUILD_ID.patch \
+           file://0001-configure-Add-option-to-enable-disable-polkit.patch \
+           file://0001-Disable-check-for-polkit-for-UI.patch \
+           file://0001-Avoid-building-docs.patch \
+          "
+SRC_URI[archive.sha256sum] = "e6dca325b3014440f457a92db18ffe342a35888db3f0756694a99b9652796367"
+SRC_URI[archive.md5sum] = "9514065dc752105240e5567c13708af4"
+
+AUTOTOOLS_AUXDIR = "${S}/build-aux"
+
+EXTRA_OECONF = "--enable-compile-warnings"
+
+PACKAGECONFIG ?= "${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK3DISTROFEATURES}', 'gtk', '', d)}"
+PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3"
+PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit,polkit dbus"
+
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
+FILES_${PN} += "${datadir}/icons/"
+
+SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'sysprof2.service', '', d)}"
+
+# We do not yet work for aarch64.
+COMPATIBLE_HOST = "^(?!aarch64).*"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/sysprof/sysprof_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/sysprof_git.bb
deleted file mode 100644
index 8d8b626..0000000
--- a/import-layers/yocto-poky/meta/recipes-kernel/sysprof/sysprof_git.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-SUMMARY = "System-wide Performance Profiler for Linux"
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://src/sp-application.c;endline=17;md5=40e55577ef122c88fe20052acda64875"
-
-inherit gnomebase gettext systemd
-
-DEPENDS = "glib-2.0"
-
-S = "${WORKDIR}/git"
-SRCREV = "9c6cec9b49766bf77c1713bc5a7c6d651e628068"
-PV = "3.20.0+git${SRCPV}"
-
-SRC_URI = "git://git.gnome.org/sysprof \
-           file://define-NT_GNU_BUILD_ID.patch \
-           file://0001-configure-Add-option-to-enable-disable-polkit.patch \
-           file://0001-Disable-check-for-polkit-for-UI.patch \
-           file://0001-Avoid-building-docs.patch \
-           file://0001-callgraph-Use-U64_TO_POINTER.patch \
-           file://0001-Forward-port-mips-arm-memory-barrier-patches.patch \
-          "
-SRC_URI[archive.md5sum] = "d56e8492033b60e247634731e7f760b9"
-SRC_URI[archive.sha256sum] = "4a338ad41bfffae87ef281f6e75c9660b3e0c6671bf5233be0c3f55a5e5b1ce5"
-
-AUTOTOOLS_AUXDIR = "${S}/build-aux"
-
-EXTRA_OECONF = "--enable-compile-warnings"
-
-PACKAGECONFIG ?= "${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK3DISTROFEATURES}', 'gtk', '', d)}"
-PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3"
-PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit,polkit dbus"
-
-SOLIBS = ".so"
-FILES_SOLIBSDEV = ""
-FILES_${PN} += "${datadir}/icons/"
-
-SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'sysprof2.service', '', d)}"
-
-# We do not yet work for aarch64.
-COMPATIBLE_HOST = "^(?!aarch64).*"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap-native_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap-native_git.bb
new file mode 100644
index 0000000..c3da77c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap-native_git.bb
@@ -0,0 +1,7 @@
+
+require systemtap_git.bb
+
+inherit native
+
+RM_WORK_EXCLUDE_ITEMS += "recipe-sysroot-native"
+addtask addto_recipe_sysroot after do_populate_sysroot before do_build
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb
index fed368a..b3fd973 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb
@@ -25,4 +25,4 @@
 
 inherit autotools gettext pkgconfig distutils3-base
 
-BBCLASSEXTEND = "native nativesdk"
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-lsb4/libpng/libpng12_1.2.56.bb b/import-layers/yocto-poky/meta/recipes-lsb4/libpng/libpng12_1.2.56.bb
deleted file mode 100644
index 277d69f..0000000
--- a/import-layers/yocto-poky/meta/recipes-lsb4/libpng/libpng12_1.2.56.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-SUMMARY = "PNG image format decoding library"
-HOMEPAGE = "http://www.libpng.org/"
-SECTION = "libs"
-LICENSE = "Libpng"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e7f289af309d98b46321d0f9892def16 \
-                    file://png.h;beginline=19;endline=109;md5=10c940148fe379a535b310c1c54e609c"
-DEPENDS = "zlib"
-
-PN = "libpng12"
-S = "${WORKDIR}/libpng-${PV}"
-
-LIBV = "12"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/project/libpng/libpng${LIBV}/${PV}/libpng-${PV}.tar.xz"
-
-MIRRORS += "${SOURCEFORGE_MIRROR}/project/libpng/libpng${LIBV}/${PV}/ ${SOURCEFORGE_MIRROR}/project/libpng/libpng${LIBV}/older-releases/${PV}"
-
-SRC_URI[md5sum] = "868562bd1c58b76ed8703f135a2e439a"
-SRC_URI[sha256sum] = "24ce54581468b937734a6ecc86f7e121bc46a90d76a0d948dca08f32ee000dbe"
-
-UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libpng/files/libpng12/"
-UPSTREAM_CHECK_REGEX = "/libpng12/(?P<pver>(\d+[\.\-_]*)+)/"
-
-BINCONFIG_GLOB = "${PN}-config"
-
-inherit autotools binconfig pkgconfig
-
-do_install_append() {
-	# The follow link files link to corresponding png12*.h and libpng12* files
-	# They conflict with higher verison, so drop them
-	unlink ${D}/${includedir}/png.h
-	unlink ${D}/${includedir}/pngconf.h
-
-	unlink ${D}/${libdir}/libpng.la
-	unlink ${D}/${libdir}/libpng.so
-	unlink ${D}/${libdir}/libpng.a || true
-	unlink ${D}/${libdir}/pkgconfig/libpng.pc
-
-	unlink ${D}/${bindir}/libpng-config
-}
diff --git a/import-layers/yocto-poky/meta/recipes-lsb4/libpng/libpng12_1.2.57.bb b/import-layers/yocto-poky/meta/recipes-lsb4/libpng/libpng12_1.2.57.bb
new file mode 100644
index 0000000..9f74f5f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-lsb4/libpng/libpng12_1.2.57.bb
@@ -0,0 +1,36 @@
+SUMMARY = "PNG image format decoding library"
+HOMEPAGE = "http://www.libpng.org/"
+SECTION = "libs"
+LICENSE = "Libpng"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=597b8a91994a3e27ae6aa79bf02677d9 \
+                    file://png.h;beginline=19;endline=109;md5=166406397718925b660f0033f7558ef7"
+DEPENDS = "zlib"
+
+PN = "libpng12"
+S = "${WORKDIR}/libpng-${PV}"
+
+SRC_URI = "${GENTOO_MIRROR}/libpng-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "307052e5e8af97b82b17b64fb1b3677a"
+SRC_URI[sha256sum] = "0f4620e11fa283fedafb474427c8e96bf149511a1804bdc47350963ae5cf54d8"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libpng/files/libpng12/"
+UPSTREAM_CHECK_REGEX = "/libpng12/(?P<pver>(\d+[\.\-_]*)+)/"
+
+BINCONFIG_GLOB = "${PN}-config"
+
+inherit autotools binconfig pkgconfig
+
+do_install_append() {
+	# The follow link files link to corresponding png12*.h and libpng12* files
+	# They conflict with higher verison, so drop them
+	rm ${D}/${includedir}/png.h
+	rm ${D}/${includedir}/pngconf.h
+
+	rm ${D}/${libdir}/libpng.la
+	rm ${D}/${libdir}/libpng.so
+	rm ${D}/${libdir}/libpng.a || true
+	rm ${D}/${libdir}/pkgconfig/libpng.pc
+
+	rm ${D}/${bindir}/libpng-config
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-fpu.inc b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-fpu.inc
index 5040230..355a9df 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-fpu.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-fpu.inc
@@ -1,6 +1,4 @@
-
 def get_alsa_fpu_setting(bb, d):
-	if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
-		return "--with-softfloat"
-	return ""
-
+    if d.getVar('TARGET_FPU') in [ 'soft' ]:
+        return "--with-softfloat"
+    return ""
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/0001-ucm-parser-needs-limits.h.patch b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/0001-ucm-parser-needs-limits.h.patch
new file mode 100644
index 0000000..4edaf4d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/0001-ucm-parser-needs-limits.h.patch
@@ -0,0 +1,33 @@
+From 005ac9d2fa000912c8fb8257020a0471b1c6176c Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Wed, 21 Dec 2016 19:46:34 -0300
+Subject: [PATCH] ucm: parser needs limits.h
+
+It's using PATH_MAX which is defined there, otherwise the build fails on
+musl libc.
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+Upstream-Status: Accepted [expected in 1.1.4]
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ src/ucm/parser.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/ucm/parser.c b/src/ucm/parser.c
+index c98373a9..f520abc5 100644
+--- a/src/ucm/parser.c
++++ b/src/ucm/parser.c
+@@ -32,6 +32,7 @@
+ 
+ #include "ucm_local.h"
+ #include <dirent.h>
++#include <limits.h>
+ 
+ /** The name of the environment variable containing the UCM directory */
+ #define ALSA_CONFIG_UCM_VAR "ALSA_CONFIG_UCM"
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.2.bb
deleted file mode 100644
index e313da7..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.2.bb
+++ /dev/null
@@ -1,44 +0,0 @@
-SUMMARY = "ALSA sound library"
-HOMEPAGE = "http://www.alsa-project.org"
-BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
-SECTION = "libs/multimedia"
-LICENSE = "LGPLv2.1 & GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
-                    file://src/socket.c;beginline=1;endline=26;md5=11ff89a8a7a4a690a5c78effe8159545"
-
-BBCLASSEXTEND = "native nativesdk"
-
-SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/${BP}.tar.bz2 \
-           file://Check-if-wordexp-function-is-supported.patch \
-           file://avoid-including-sys-poll.h-directly.patch \
-"
-SRC_URI[md5sum] = "1946e6438b8262a7b8fdadacd0e06ba7"
-SRC_URI[sha256sum] = "d38dacd9892b06b8bff04923c380b38fb2e379ee5538935ff37e45b395d861d6"
-
-inherit autotools pkgconfig
-
-require alsa-fpu.inc
-EXTRA_OECONF += "${@get_alsa_fpu_setting(bb, d)} "
-
-EXTRA_OECONF = "--disable-python"
-
-EXTRA_OECONF_append_libc-uclibc = " --with-versioned=no "
-
-PACKAGES =+ "alsa-server libasound alsa-conf-base alsa-conf alsa-doc"
-FILES_${PN} += "${libdir}/${BPN}/smixer/*.so"
-FILES_${PN}-dev += "${libdir}/${BPN}/smixer/*.la"
-FILES_libasound = "${libdir}/libasound.so.*"
-FILES_alsa-server = "${bindir}/*"
-FILES_alsa-conf = "${datadir}/alsa/"
-FILES_alsa-conf-base = "\
-${datadir}/alsa/alsa.conf \
-${datadir}/alsa/cards/aliases.conf \
-${datadir}/alsa/pcm/default.conf \
-${datadir}/alsa/pcm/dmix.conf \
-${datadir}/alsa/pcm/dsnoop.conf"
-
-RDEPENDS_libasound = "alsa-conf-base alsa-conf"
-# upgrade path
-RPROVIDES_${PN}-dev = "alsa-dev"
-RREPLACES_${PN}-dev = "alsa-dev"
-RCONFLICTS_${PN}-dev = "alsa-dev"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.3.bb
new file mode 100644
index 0000000..191a036
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.3.bb
@@ -0,0 +1,46 @@
+SUMMARY = "ALSA sound library"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
+SECTION = "libs/multimedia"
+LICENSE = "LGPLv2.1 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
+                    file://src/socket.c;beginline=1;endline=26;md5=11ff89a8a7a4a690a5c78effe8159545"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/${BP}.tar.bz2 \
+           file://Check-if-wordexp-function-is-supported.patch \
+           file://avoid-including-sys-poll.h-directly.patch \
+           file://0001-ucm-parser-needs-limits.h.patch \
+"
+SRC_URI[md5sum] = "eefe5992567ba00d6110a540657aaf5c"
+SRC_URI[sha256sum] = "71282502184c592c1a008e256c22ed0ba5728ca65e05273ceb480c70f515969c"
+
+inherit autotools pkgconfig
+
+require alsa-fpu.inc
+EXTRA_OECONF += "${@get_alsa_fpu_setting(bb, d)} "
+
+EXTRA_OECONF += "--disable-python"
+
+EXTRA_OECONF_append_libc-uclibc = " --with-versioned=no "
+
+PACKAGES =+ "alsa-server libasound alsa-conf alsa-doc"
+FILES_libasound = "${libdir}/libasound.so.*"
+FILES_alsa-server = "${bindir}/*"
+FILES_alsa-conf = "${datadir}/alsa/"
+
+RDEPENDS_libasound = "alsa-conf"
+
+# alsa-lib gets automatically added to alsa-lib-dev dependencies, but the
+# alsa-lib package doesn't exist. libasound is the real library package.
+RDEPENDS_${PN}-dev = "libasound"
+
+# upgrade path
+RPROVIDES_${PN}-dev = "alsa-dev"
+RREPLACES_${PN}-dev = "alsa-dev"
+RCONFLICTS_${PN}-dev = "alsa-dev"
+
+RPROVIDES_alsa-conf = "alsa-conf-base"
+RREPLACES_alsa-conf = "alsa-conf-base"
+RCONFLICTS_alsa-conf = "alsa-conf-base"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.1.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.1.bb
index c95ea54..16686a0 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.1.bb
@@ -31,7 +31,7 @@
 PACKAGECONFIG ??= "\
         samplerate \
         speexdsp \
-        ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
+        ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
 "
 PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec,libav"
 PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
@@ -59,7 +59,7 @@
 }
 
 python populate_packages_prepend() {
-    plugindir = bb.data.expand('${libdir}/alsa-lib/', d)
+    plugindir = d.expand('${libdir}/alsa-lib/')
     packages = " ".join(do_split_packages(d, plugindir, '^libasound_module_(.*)\.so$', 'libasound-module-%s', 'Alsa plugin for %s', extra_depends=''))
     d.setVar("RDEPENDS_alsa-plugins", packages)
 }
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/0001-Cus428Midi-Explicitly-cast-constant-to-char-type.patch b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/0001-Cus428Midi-Explicitly-cast-constant-to-char-type.patch
deleted file mode 100644
index bf95cac..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/0001-Cus428Midi-Explicitly-cast-constant-to-char-type.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 1cc0aa4dbd3c7f1267809e0e1ca57d46f4803bfd Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 17 Apr 2016 23:25:18 +0000
-Subject: [PATCH] Cus428Midi: Explicitly cast constant to char type
-
-This is flagged by gcc6
-Cus428Midi.cc:83:1: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- us428control/Cus428Midi.cc | 30 +++++++++++++++---------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/us428control/Cus428Midi.cc b/us428control/Cus428Midi.cc
-index b9e6783..bef7bb1 100644
---- a/us428control/Cus428Midi.cc
-+++ b/us428control/Cus428Midi.cc
-@@ -32,22 +32,22 @@ char Cus428Midi::KnobParam[] = {
- 	0x2A,
- 	0x29,
- 	0x28,
--	-1,
-+	static_cast<char>(-1),
- 	0x10,
- 	0x11,
- 	0x18,
- 	0x19,
- 	0x1A,
--	-1,
--	-1,
--	-1,
--	-1,
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
- 	0x2C,
- 	0x2D,
- 	0x2E,
- 	0x2F,
--	-1,
--	-1,
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
- 	0x20,
- 	0x21,
- 	0x22,
-@@ -64,14 +64,14 @@ char Cus428Midi::KnobParam[] = {
- 	5,
- 	6,
- 	7,
--	-1,
--	-1,
--	-1,
--	-1,
--	-1,
--	-1,
--	-1,
--	-1,
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
-+	static_cast<char>(-1),
- 	0x30,
- 	0x31,
- 	0x32,
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.0.bb
deleted file mode 100644
index 8d4a146..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.0.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-SUMMARY = "Advanced tools for certain ALSA sound card drivers"
-HOMEPAGE = "http://www.alsa-project.org"
-BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
-SECTION = "console/utils"
-LICENSE = "GPLv2 & LGPLv2+"
-DEPENDS = "alsa-lib ncurses glib-2.0"
-
-LIC_FILES_CHKSUM = "file://hdsploader/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
-                    file://ld10k1/COPYING.LIB;md5=7fbc338309ac38fefcd64b04bb903e34"
-
-SRC_URI = "ftp://ftp.alsa-project.org/pub/tools/${BP}.tar.bz2 \
-           file://autotools.patch \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'file://makefile_no_gtk.patch', d)} \
-           file://gitcompile_hdajacksensetest \
-           file://0001-as10k1-Make-output_tram_line-static-inline.patch \
-           file://0001-Cus428Midi-Explicitly-cast-constant-to-char-type.patch \
-           "
-
-SRC_URI[md5sum] = "b476a5afaa3ea3230855553ad59d259d"
-SRC_URI[sha256sum] = "7d34558c590a50294b36576d257316a1ac5cd951eb8cd7d330e09f8cc757ab51"
-
-inherit autotools-brokensep pkgconfig
-
-CLEANBROKEN = "1"
-
-EXTRA_OEMAKE += "GITCOMPILE_ARGS='--host=${HOST_SYS} --build=${BUILD_SYS} --target=${TARGET_SYS} --with-libtool-sysroot=${STAGING_DIR_HOST} --prefix=${prefix}'"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk+', '', d)}"
-PACKAGECONFIG[gtk+] = ",,gtk+ gtk+3,"
-
-# configure.ac/.in doesn't exist so force copy
-AUTOTOOLS_COPYACLOCAL = "1"
-
-do_compile_prepend () {
-    #Automake dir is not correctly detected in cross compilation case
-    export AUTOMAKE_DIR="$(automake --print-libdir)"
-    export ACLOCAL_FLAGS="--system-acdir=${ACLOCALDIR}/"
-
-    cp ${WORKDIR}/gitcompile_hdajacksensetest ${S}/hdajacksensetest/gitcompile
-}
-
-FILES_${PN} += "${datadir}/ld10k1"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.3.bb
new file mode 100644
index 0000000..9e97c0e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.3.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Advanced tools for certain ALSA sound card drivers"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & LGPLv2+"
+DEPENDS = "alsa-lib ncurses glib-2.0"
+
+LIC_FILES_CHKSUM = "file://hdsploader/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://ld10k1/COPYING.LIB;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/tools/${BP}.tar.bz2 \
+           file://autotools.patch \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'file://makefile_no_gtk.patch', d)} \
+           file://gitcompile_hdajacksensetest \
+           file://0001-as10k1-Make-output_tram_line-static-inline.patch \
+           "
+
+SRC_URI[md5sum] = "b23eaae687d55410b92587c2053b301f"
+SRC_URI[sha256sum] = "d88f1dcd6872121383eded5fa24e328e68c54e527db4547e1435d5eabc2b6709"
+
+inherit autotools-brokensep pkgconfig
+
+CLEANBROKEN = "1"
+
+EXTRA_OEMAKE += "GITCOMPILE_ARGS='--host=${HOST_SYS} --build=${BUILD_SYS} --target=${TARGET_SYS} --with-libtool-sysroot=${STAGING_DIR_HOST} --prefix=${prefix}'"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk+', '', d)}"
+PACKAGECONFIG[gtk+] = ",,gtk+ gtk+3,"
+
+# configure.ac/.in doesn't exist so force copy
+AUTOTOOLS_COPYACLOCAL = "1"
+
+do_compile_prepend () {
+    #Automake dir is not correctly detected in cross compilation case
+    export AUTOMAKE_DIR="$(automake --print-libdir)"
+    export ACLOCAL_FLAGS="--system-acdir=${ACLOCALDIR}/ ${ACLOCALEXTRAPATH}"
+
+    cp ${WORKDIR}/gitcompile_hdajacksensetest ${S}/hdajacksensetest/gitcompile
+}
+
+FILES_${PN} += "${datadir}/ld10k1"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.3.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.2.bb
rename to import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.3.bb
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.2.bb
deleted file mode 100644
index a22d999..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.2.bb
+++ /dev/null
@@ -1,109 +0,0 @@
-SUMMARY = "ALSA sound utilities"
-HOMEPAGE = "http://www.alsa-project.org"
-BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
-SECTION = "console/utils"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
-                    file://alsactl/utils.c;beginline=1;endline=20;md5=fe9526b055e246b5558809a5ae25c0b9"
-DEPENDS = "alsa-lib ncurses libsamplerate0"
-
-PACKAGECONFIG ??= "udev"
-
-# alsabat can be built also without fftw support (with reduced functionality).
-# It would be better to always enable alsabat, but provide an option for
-# enabling/disabling fftw. The configure script doesn't support that, however
-# (at least in any obvious way), so for now we only support alsabat with fftw
-# or no alsabat at all.
-PACKAGECONFIG[bat] = "--enable-bat,--disable-bat,fftwf"
-
-PACKAGECONFIG[udev] = "--with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d,,udev"
-PACKAGECONFIG[xmlto] = "--enable-xmlto, --disable-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
-
-SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \
-           file://0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch \
-          "
-
-SRC_URI[md5sum] = "38ac7c781f80c41c02b4664d8cbafa87"
-SRC_URI[sha256sum] = "7af603c0877d1251599d65b4fbc372e63a54371b888f5c26c6a86ac1d0519071"
-
-# lazy hack. needs proper fixing in gettext.m4, see
-# http://bugs.openembedded.org/show_bug.cgi?id=2348
-# please close bug and remove this comment when properly fixed
-#
-EXTRA_OECONF_append_libc-uclibc = " --disable-nls"
-
-inherit autotools gettext pkgconfig
-
-# This are all packages that we need to make. Also, the now empty alsa-utils
-# ipk depends on them.
-
-ALSA_UTILS_PKGS = "\
-             ${@bb.utils.contains('PACKAGECONFIG', 'bat', 'alsa-utils-alsabat', '', d)} \
-             alsa-utils-alsamixer \
-             alsa-utils-alsatplg \
-             alsa-utils-midi \
-             alsa-utils-aplay \
-             alsa-utils-amixer \
-             alsa-utils-aconnect \
-             alsa-utils-iecset \
-             alsa-utils-speakertest \
-             alsa-utils-aseqnet \
-             alsa-utils-aseqdump \
-             alsa-utils-alsactl \
-             alsa-utils-alsaloop \
-             alsa-utils-alsaucm \
-            "
-
-PACKAGES += "${ALSA_UTILS_PKGS}"
-RDEPENDS_${PN} += "${ALSA_UTILS_PKGS}"
-
-FILES_${PN} = ""
-FILES_alsa-utils-alsabat     = "${bindir}/alsabat"
-FILES_alsa-utils-alsatplg    = "${bindir}/alsatplg"
-FILES_alsa-utils-aplay       = "${bindir}/aplay ${bindir}/arecord"
-FILES_alsa-utils-amixer      = "${bindir}/amixer"
-FILES_alsa-utils-alsamixer   = "${bindir}/alsamixer"
-FILES_alsa-utils-speakertest = "${bindir}/speaker-test ${datadir}/sounds/alsa/ ${datadir}/alsa/speaker-test/"
-FILES_alsa-utils-midi        = "${bindir}/aplaymidi ${bindir}/arecordmidi ${bindir}/amidi"
-FILES_alsa-utils-aconnect    = "${bindir}/aconnect"
-FILES_alsa-utils-aseqnet     = "${bindir}/aseqnet"
-FILES_alsa-utils-iecset      = "${bindir}/iecset"
-FILES_alsa-utils-alsactl     = "${sbindir}/alsactl */udev/rules.d */*/udev/rules.d ${systemd_unitdir} ${localstatedir}/lib/alsa ${datadir}/alsa/init/"
-FILES_alsa-utils-aseqdump    = "${bindir}/aseqdump"
-FILES_alsa-utils-alsaloop    = "${bindir}/alsaloop"
-FILES_alsa-utils-alsaucm     = "${bindir}/alsaucm"
-
-SUMMARY_alsa-utils-alsabat      = "Command-line sound tester for ALSA sound card driver"
-SUMMARY_alsa-utils-alsatplg     = "Converts topology text files into binary format for kernel"
-SUMMARY_alsa-utils-aplay        = "Play (and record) sound files using ALSA"
-SUMMARY_alsa-utils-amixer       = "Command-line control for ALSA mixer and settings"
-SUMMARY_alsa-utils-alsamixer    = "ncurses-based control for ALSA mixer and settings"
-SUMMARY_alsa-utils-speakertest  = "ALSA surround speaker test utility"
-SUMMARY_alsa-utils-midi         = "Miscellaneous MIDI utilities for ALSA"
-SUMMARY_alsa-utils-aconnect     = "ALSA sequencer connection manager"
-SUMMARY_alsa-utils-aseqnet      = "Network client/server for ALSA sequencer"
-SUMMARY_alsa-utils-iecset       = "ALSA utility for setting/showing IEC958 (S/PDIF) status bits"
-SUMMARY_alsa-utils-alsactl      = "Saves/restores ALSA-settings in /etc/asound.state"
-SUMMARY_alsa-utils-aseqdump     = "Shows the events received at an ALSA sequencer port"
-SUMMARY_alsa-utils-alsaloop     = "ALSA PCM loopback utility"
-SUMMARY_alsa-utils-alsaucm      = "ALSA Use Case Manager"
-
-RRECOMMENDS_alsa-utils-alsactl = "alsa-states"
-
-ALLOW_EMPTY_alsa-utils = "1"
-
-do_install() {
-	autotools_do_install
-
-	# We don't ship this here because it requires a dependency on bash.
-	# See alsa-utils-scripts_${PV}.bb
-	rm ${D}${sbindir}/alsaconf
-	rm ${D}${sbindir}/alsa-info.sh
-	rm -f ${D}${sbindir}/alsabat-test.sh
-
-	if ${@bb.utils.contains('PACKAGECONFIG', 'udev', 'false', 'true', d)}; then
-		# This is where alsa-utils will install its rules if we don't tell it anything else.
-		rm -rf ${D}/lib/udev
-		rmdir --ignore-fail-on-non-empty ${D}/lib
-	fi
-}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.3.bb
new file mode 100644
index 0000000..f374a17
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.3.bb
@@ -0,0 +1,115 @@
+SUMMARY = "ALSA sound utilities"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
+SECTION = "console/utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://alsactl/utils.c;beginline=1;endline=20;md5=fe9526b055e246b5558809a5ae25c0b9"
+DEPENDS = "alsa-lib ncurses libsamplerate0"
+
+PACKAGECONFIG ??= "udev"
+
+# alsabat can be built also without fftw support (with reduced functionality).
+# It would be better to always enable alsabat, but provide an option for
+# enabling/disabling fftw. The configure script doesn't support that, however
+# (at least in any obvious way), so for now we only support alsabat with fftw
+# or no alsabat at all.
+PACKAGECONFIG[bat] = "--enable-bat,--disable-bat,fftwf"
+
+PACKAGECONFIG[udev] = "--with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d,,udev"
+PACKAGECONFIG[manpages] = "--enable-xmlto, --disable-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \
+           file://0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch \
+          "
+
+SRC_URI[md5sum] = "2bf94d3e3410dcc74bb0dae10d46a979"
+SRC_URI[sha256sum] = "127217a54eea0f9a49700a2f239a2d4f5384aa094d68df04a8eb80132eb6167c"
+
+# On build machines with python-docutils (not python3-docutils !!) installed
+# rst2man (not rst2man.py) is detected and compile fails with
+# | make[1]: *** No rule to make target 'alsaucm.1', needed by 'all-am'.  Stop.
+# Avoid this by disabling expicitly
+EXTRA_OECONF = "--disable-rst2man"
+
+# lazy hack. needs proper fixing in gettext.m4, see
+# http://bugs.openembedded.org/show_bug.cgi?id=2348
+# please close bug and remove this comment when properly fixed
+#
+EXTRA_OECONF_append_libc-uclibc = " --disable-nls"
+
+inherit autotools gettext pkgconfig manpages
+
+# This are all packages that we need to make. Also, the now empty alsa-utils
+# ipk depends on them.
+
+ALSA_UTILS_PKGS = "\
+             ${@bb.utils.contains('PACKAGECONFIG', 'bat', 'alsa-utils-alsabat', '', d)} \
+             alsa-utils-alsamixer \
+             alsa-utils-alsatplg \
+             alsa-utils-midi \
+             alsa-utils-aplay \
+             alsa-utils-amixer \
+             alsa-utils-aconnect \
+             alsa-utils-iecset \
+             alsa-utils-speakertest \
+             alsa-utils-aseqnet \
+             alsa-utils-aseqdump \
+             alsa-utils-alsactl \
+             alsa-utils-alsaloop \
+             alsa-utils-alsaucm \
+            "
+
+PACKAGES += "${ALSA_UTILS_PKGS}"
+RDEPENDS_${PN} += "${ALSA_UTILS_PKGS}"
+
+FILES_${PN} = ""
+FILES_alsa-utils-alsabat     = "${bindir}/alsabat"
+FILES_alsa-utils-alsatplg    = "${bindir}/alsatplg"
+FILES_alsa-utils-aplay       = "${bindir}/aplay ${bindir}/arecord"
+FILES_alsa-utils-amixer      = "${bindir}/amixer"
+FILES_alsa-utils-alsamixer   = "${bindir}/alsamixer"
+FILES_alsa-utils-speakertest = "${bindir}/speaker-test ${datadir}/sounds/alsa/ ${datadir}/alsa/speaker-test/"
+FILES_alsa-utils-midi        = "${bindir}/aplaymidi ${bindir}/arecordmidi ${bindir}/amidi"
+FILES_alsa-utils-aconnect    = "${bindir}/aconnect"
+FILES_alsa-utils-aseqnet     = "${bindir}/aseqnet"
+FILES_alsa-utils-iecset      = "${bindir}/iecset"
+FILES_alsa-utils-alsactl     = "${sbindir}/alsactl */udev/rules.d */*/udev/rules.d ${systemd_unitdir} ${localstatedir}/lib/alsa ${datadir}/alsa/init/"
+FILES_alsa-utils-aseqdump    = "${bindir}/aseqdump"
+FILES_alsa-utils-alsaloop    = "${bindir}/alsaloop"
+FILES_alsa-utils-alsaucm     = "${bindir}/alsaucm"
+
+SUMMARY_alsa-utils-alsabat      = "Command-line sound tester for ALSA sound card driver"
+SUMMARY_alsa-utils-alsatplg     = "Converts topology text files into binary format for kernel"
+SUMMARY_alsa-utils-aplay        = "Play (and record) sound files using ALSA"
+SUMMARY_alsa-utils-amixer       = "Command-line control for ALSA mixer and settings"
+SUMMARY_alsa-utils-alsamixer    = "ncurses-based control for ALSA mixer and settings"
+SUMMARY_alsa-utils-speakertest  = "ALSA surround speaker test utility"
+SUMMARY_alsa-utils-midi         = "Miscellaneous MIDI utilities for ALSA"
+SUMMARY_alsa-utils-aconnect     = "ALSA sequencer connection manager"
+SUMMARY_alsa-utils-aseqnet      = "Network client/server for ALSA sequencer"
+SUMMARY_alsa-utils-iecset       = "ALSA utility for setting/showing IEC958 (S/PDIF) status bits"
+SUMMARY_alsa-utils-alsactl      = "Saves/restores ALSA-settings in /etc/asound.state"
+SUMMARY_alsa-utils-aseqdump     = "Shows the events received at an ALSA sequencer port"
+SUMMARY_alsa-utils-alsaloop     = "ALSA PCM loopback utility"
+SUMMARY_alsa-utils-alsaucm      = "ALSA Use Case Manager"
+
+RRECOMMENDS_alsa-utils-alsactl = "alsa-states"
+
+ALLOW_EMPTY_alsa-utils = "1"
+
+do_install() {
+	autotools_do_install
+
+	# We don't ship this here because it requires a dependency on bash.
+	# See alsa-utils-scripts_${PV}.bb
+	rm ${D}${sbindir}/alsaconf
+	rm ${D}${sbindir}/alsa-info.sh
+	rm -f ${D}${sbindir}/alsabat-test.sh
+
+	if ${@bb.utils.contains('PACKAGECONFIG', 'udev', 'false', 'true', d)}; then
+		# This is where alsa-utils will install its rules if we don't tell it anything else.
+		rm -rf ${D}${nonarch_base_libdir}/udev
+		rmdir --ignore-fail-on-non-empty ${D}${nonarch_base_libdir}
+	fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.1.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.1.3.bb
deleted file mode 100644
index 050f1ee..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.1.3.bb
+++ /dev/null
@@ -1,142 +0,0 @@
-SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video."
-DESCRIPTION = "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, \
-               mux, demux, stream, filter and play pretty much anything that humans and machines \
-               have created. It supports the most obscure ancient formats up to the cutting edge."
-HOMEPAGE = "https://www.ffmpeg.org/"
-SECTION = "libs"
-
-LICENSE = "GPLv2+"
-LICENSE_FLAGS = "commercial"
-
-LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
-                    file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
-
-SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
-           file://mips64_cpu_detection.patch \
-          "
-SRC_URI[md5sum] = "72769316a4b2b8809c7f6d5a8b6766f4"
-SRC_URI[sha256sum] = "f8575c071e2a64437aeb70c8c030b385cddbe0b5cde20c9b18a6def840128822"
-
-# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
-ARM_INSTRUCTION_SET = "arm"
-
-# Should be API compatible with libav (which was a fork of ffmpeg)
-# libpostproc was previously packaged from a separate recipe
-PROVIDES = "libav libpostproc"
-
-DEPENDS = "alsa-lib zlib libogg yasm-native"
-
-inherit autotools pkgconfig
-
-PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc \
-                   bzlib gpl lzma theora x264 \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xv', '', d)}"
-
-# libraries to build in addition to avutil
-PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice"
-PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter"
-PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec"
-PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat"
-PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample"
-PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale"
-PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc"
-PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample"
-
-# features to support
-PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2"
-PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
-PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl"
-PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
-PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
-PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
-PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz"
-PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
-PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
-PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
-PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
-PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
-PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
-PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
-PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
-PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
-PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv"
-
-# Check codecs that require --enable-nonfree
-USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"
-
-EXTRA_OECONF = " \
-    --disable-stripping \
-    --enable-pic \
-    --enable-shared \
-    --enable-pthreads \
-    ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
-    \
-    --cross-prefix=${TARGET_PREFIX} \
-    \
-    --ld="${CCLD}" \
-    --cc="${CC}" \
-    --cxx="${CXX}" \
-    --arch=${TARGET_ARCH} \
-    --target-os="linux" \
-    --enable-cross-compile \
-    --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
-    --extra-ldflags="${TARGET_LDFLAGS}" \
-    --sysroot="${STAGING_DIR_TARGET}" \
-    --enable-hardcoded-tables \
-    ${EXTRA_FFCONF} \
-    --libdir=${libdir} \
-    --shlibdir=${libdir} \
-    --datadir=${datadir}/ffmpeg \
-"
-
-do_configure() {
-    ${S}/configure ${EXTRA_OECONF}
-}
-
-PACKAGES_DYNAMIC += "^lib(av(codec|device|filter|format|util|resample)|swscale|swresample|postproc).*"
-
-# ffmpeg disables PIC on some platforms (e.g. x86-32)
-INSANE_SKIP_${MLPREFIX}libavcodec = "textrel"
-INSANE_SKIP_${MLPREFIX}libavdevice = "textrel"
-INSANE_SKIP_${MLPREFIX}libavfilter = "textrel"
-INSANE_SKIP_${MLPREFIX}libavformat = "textrel"
-INSANE_SKIP_${MLPREFIX}libavutil = "textrel"
-INSANE_SKIP_${MLPREFIX}libavresample = "textrel"
-INSANE_SKIP_${MLPREFIX}libswscale = "textrel"
-INSANE_SKIP_${MLPREFIX}libswresample = "textrel"
-INSANE_SKIP_${MLPREFIX}libpostproc = "textrel"
-
-python populate_packages_prepend() {
-    av_libdir = d.expand('${libdir}')
-    av_pkgconfig = d.expand('${libdir}/pkgconfig')
-
-    # Runtime package
-    do_split_packages(d, av_libdir, '^lib(.*)\.so\..*',
-                      output_pattern='lib%s',
-                      description='libav %s library',
-                      extra_depends='',
-                      prepend=True,
-                      allow_links=True)
-
-    # Development packages (-dev, -staticdev)
-    do_split_packages(d, av_libdir, '^lib(.*)\.so$',
-                      output_pattern='lib%s-dev',
-                      description='libav %s development package',
-                      extra_depends='${PN}-dev',
-                      prepend=True,
-                      allow_links=True)
-    do_split_packages(d, av_pkgconfig, '^lib(.*)\.pc$',
-                      output_pattern='lib%s-dev',
-                      description='libav %s development package',
-                      extra_depends='${PN}-dev',
-                      prepend=True)
-    do_split_packages(d, av_libdir, '^lib(.*)\.a$',
-                      output_pattern='lib%s-staticdev',
-                      description='libav %s development package - static library',
-                      extra_depends='${PN}-dev',
-                      prepend=True,
-                      allow_links=True)
-
-}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.4.bb
new file mode 100644
index 0000000..3216f8e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.4.bb
@@ -0,0 +1,147 @@
+SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video."
+DESCRIPTION = "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, \
+               mux, demux, stream, filter and play pretty much anything that humans and machines \
+               have created. It supports the most obscure ancient formats up to the cutting edge."
+HOMEPAGE = "https://www.ffmpeg.org/"
+SECTION = "libs"
+
+LICENSE = "BSD & GPLv2+ & LGPLv2.1+ & MIT"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libpostproc = "GPLv2+"
+LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_FLAGS = "commercial"
+
+LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
+                    file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
+           file://mips64_cpu_detection.patch \
+          "
+SRC_URI[md5sum] = "39fd71024ac76ba35f04397021af5606"
+SRC_URI[sha256sum] = "6e38ff14f080c98b58cf5967573501b8cb586e3a173b591f3807d8f0660daf7a"
+
+# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
+ARM_INSTRUCTION_SET = "arm"
+
+# Should be API compatible with libav (which was a fork of ffmpeg)
+# libpostproc was previously packaged from a separate recipe
+PROVIDES = "libav libpostproc"
+
+DEPENDS = "alsa-lib zlib libogg yasm-native"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc \
+                   bzlib gpl lzma theora x264 \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xv', '', d)}"
+
+# libraries to build in addition to avutil
+PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice"
+PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter"
+PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec"
+PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat"
+PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample"
+PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale"
+PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc"
+PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample"
+
+# features to support
+PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2"
+PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl"
+PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
+PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
+PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz"
+PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
+PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
+PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
+PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
+PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
+PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
+PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
+PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv"
+
+# Check codecs that require --enable-nonfree
+USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}"
+
+def cpu(d):
+    for arg in (d.getVar('TUNE_CCARGS') or '').split():
+        if arg.startswith('-mcpu='):
+            return arg[6:]
+    return 'generic'
+
+EXTRA_OECONF = " \
+    --disable-stripping \
+    --enable-pic \
+    --enable-shared \
+    --enable-pthreads \
+    ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
+    \
+    --cross-prefix=${TARGET_PREFIX} \
+    \
+    --ld="${CCLD}" \
+    --cc="${CC}" \
+    --cxx="${CXX}" \
+    --arch=${TARGET_ARCH} \
+    --target-os="linux" \
+    --enable-cross-compile \
+    --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
+    --extra-ldflags="${TARGET_LDFLAGS}" \
+    --sysroot="${STAGING_DIR_TARGET}" \
+    --enable-hardcoded-tables \
+    ${EXTRA_FFCONF} \
+    --libdir=${libdir} \
+    --shlibdir=${libdir} \
+    --datadir=${datadir}/ffmpeg \
+    ${@bb.utils.contains('AVAILTUNES', 'mips32r2', '', '--disable-mipsdsp --disable-mipsdspr2', d)} \
+    --cpu=${@cpu(d)} \
+"
+
+EXTRA_OECONF_append_linux-gnux32 = " --disable-asm"
+
+do_configure() {
+    ${S}/configure ${EXTRA_OECONF}
+}
+
+PACKAGES =+ "libavcodec \
+             libavdevice \
+             libavfilter \
+             libavformat \
+             libavresample \
+             libavutil \
+             libpostproc \
+             libswresample \
+             libswscale"
+
+FILES_libavcodec = "${libdir}/libavcodec${SOLIBS}"
+FILES_libavdevice = "${libdir}/libavdevice${SOLIBS}"
+FILES_libavfilter = "${libdir}/libavfilter${SOLIBS}"
+FILES_libavformat = "${libdir}/libavformat${SOLIBS}"
+FILES_libavresample = "${libdir}/libavresample${SOLIBS}"
+FILES_libavutil = "${libdir}/libavutil${SOLIBS}"
+FILES_libpostproc = "${libdir}/libpostproc${SOLIBS}"
+FILES_libswresample = "${libdir}/libswresample${SOLIBS}"
+FILES_libswscale = "${libdir}/libswscale${SOLIBS}"
+
+# ffmpeg disables PIC on some platforms (e.g. x86-32)
+INSANE_SKIP_${MLPREFIX}libavcodec = "textrel"
+INSANE_SKIP_${MLPREFIX}libavdevice = "textrel"
+INSANE_SKIP_${MLPREFIX}libavfilter = "textrel"
+INSANE_SKIP_${MLPREFIX}libavformat = "textrel"
+INSANE_SKIP_${MLPREFIX}libavutil = "textrel"
+INSANE_SKIP_${MLPREFIX}libavresample = "textrel"
+INSANE_SKIP_${MLPREFIX}libswscale = "textrel"
+INSANE_SKIP_${MLPREFIX}libswresample = "textrel"
+INSANE_SKIP_${MLPREFIX}libpostproc = "textrel"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/flac/flac_1.3.1.bb b/import-layers/yocto-poky/meta/recipes-multimedia/flac/flac_1.3.1.bb
deleted file mode 100644
index f25271f..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/flac/flac_1.3.1.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-SUMMARY = "Free Lossless Audio Codec"
-DESCRIPTION = "FLAC stands for Free Lossless Audio Codec, a lossless audio compression format."
-HOMEPAGE = "https://xiph.org/flac/"
-BUGTRACKER = "http://sourceforge.net/p/flac/bugs/"
-SECTION = "libs"
-LICENSE = "GFDL-1.2 & GPLv2+ & LGPLv2.1+ & BSD"
-LIC_FILES_CHKSUM = "file://COPYING.FDL;md5=ad1419ecc56e060eccf8184a87c4285f \
-                    file://src/Makefile.am;beginline=1;endline=17;md5=0a853b81d9d43d8aad3b53b05cfcc37e \
-                    file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://src/flac/main.c;beginline=1;endline=18;md5=d03a766558d233f9cc3ac5dfafd49deb \
-                    file://COPYING.LGPL;md5=fbc093901857fcd118f065f900982c24 \
-                    file://src/plugin_common/all.h;beginline=1;endline=18;md5=7c8a3b9e1e66ed0aba765bc6f35da85d \
-                    file://COPYING.Xiph;md5=a2c4b71c0198682376d483eb5bcc9197 \
-                    file://include/FLAC/all.h;beginline=65;endline=70;md5=64474f2b22e9e77b28d8b8b25c983a48"
-DEPENDS = "libogg"
-
-SRC_URI = "http://downloads.xiph.org/releases/flac/${BP}.tar.xz"
-
-SRC_URI[md5sum] = "b9922c9a0378c88d3e901b234f852698"
-SRC_URI[sha256sum] = "4773c0099dba767d963fd92143263be338c48702172e8754b9bc5103efe1c56c"
-
-inherit autotools gettext
-
-EXTRA_OECONF = "--disable-oggtest \
-                --with-ogg-libraries=${STAGING_LIBDIR} \
-                --with-ogg-includes=${STAGING_INCDIR} \
-                --disable-xmms-plugin \
-                --without-libiconv-prefix \
-                ac_cv_prog_NASM="" \
-                "
-
-EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "altivec", " --enable-altivec", " --disable-altivec", d)}"
-EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "core2", " --enable-sse", "", d)}"
-EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "corei7", " --enable-sse", "", d)}"
-
-PACKAGES += "libflac libflac++ liboggflac liboggflac++"
-FILES_${PN} = "${bindir}/*"
-FILES_libflac = "${libdir}/libFLAC.so.*"
-FILES_libflac++ = "${libdir}/libFLAC++.so.*"
-FILES_liboggflac = "${libdir}/libOggFLAC.so.*"
-FILES_liboggflac++ = "${libdir}/libOggFLAC++.so.*"
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/flac/flac_1.3.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/flac/flac_1.3.2.bb
new file mode 100644
index 0000000..8315ab5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/flac/flac_1.3.2.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Free Lossless Audio Codec"
+DESCRIPTION = "FLAC stands for Free Lossless Audio Codec, a lossless audio compression format."
+HOMEPAGE = "https://xiph.org/flac/"
+BUGTRACKER = "http://sourceforge.net/p/flac/bugs/"
+SECTION = "libs"
+LICENSE = "GFDL-1.2 & GPLv2+ & LGPLv2.1+ & BSD"
+LIC_FILES_CHKSUM = "file://COPYING.FDL;md5=ad1419ecc56e060eccf8184a87c4285f \
+                    file://src/Makefile.am;beginline=1;endline=17;md5=09501c864f89dfc7ead65553129817ca \
+                    file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://src/flac/main.c;beginline=1;endline=18;md5=09777e2934947a36f13568d0beb81199 \
+                    file://COPYING.LGPL;md5=fbc093901857fcd118f065f900982c24 \
+                    file://src/plugin_common/all.h;beginline=1;endline=18;md5=f56cb4ba9a3bc9ec6102e8df03215271 \
+                    file://COPYING.Xiph;md5=b59c1b6d7fc0fb7965f821a3d36505e3 \
+                    file://include/FLAC/all.h;beginline=65;endline=70;md5=64474f2b22e9e77b28d8b8b25c983a48"
+DEPENDS = "libogg"
+
+SRC_URI = "http://downloads.xiph.org/releases/flac/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "454f1bfa3f93cc708098d7890d0499bd"
+SRC_URI[sha256sum] = "91cfc3ed61dc40f47f050a109b08610667d73477af6ef36dcad31c31a4a8d53f"
+
+CVE_PRODUCT = "libflac"
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--disable-oggtest \
+                --with-ogg-libraries=${STAGING_LIBDIR} \
+                --with-ogg-includes=${STAGING_INCDIR} \
+                --disable-xmms-plugin \
+                --without-libiconv-prefix \
+                ac_cv_prog_NASM="" \
+                "
+
+EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "altivec", " --enable-altivec", " --disable-altivec", d)}"
+EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "core2", " --enable-sse", "", d)}"
+EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "corei7", " --enable-sse", "", d)}"
+
+PACKAGES += "libflac libflac++ liboggflac liboggflac++"
+FILES_${PN} = "${bindir}/*"
+FILES_libflac = "${libdir}/libFLAC.so.*"
+FILES_libflac++ = "${libdir}/libFLAC++.so.*"
+FILES_liboggflac = "${libdir}/libOggFLAC.so.*"
+FILES_liboggflac++ = "${libdir}/libOggFLAC++.so.*"
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/0001-gtk-play-Disable-visualizations.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/0001-gtk-play-Disable-visualizations.patch
new file mode 100644
index 0000000..ea88120
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/0001-gtk-play-Disable-visualizations.patch
@@ -0,0 +1,59 @@
+From 6cf42c468e93b0aaa171961e059bc3e2fb915889 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 28 Apr 2017 14:35:19 +0300
+Subject: [PATCH] gtk-play: Disable visualizations
+
+This is a workaround for [YOCTO #11410] (audio playback is broken in
+mediaplayer if vaapi is used). It disables visualizations and makes
+sure we clear the window (otherwise nothing does that and result is
+very ugly).
+
+This patch should be removed when 11410 is fixed.
+
+Upstream-Status: Inappropriate [bug workaround]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ gtk/gtk-play.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
+index 8ae0fea..63b9bb0 100644
+--- a/gtk/gtk-play.c
++++ b/gtk/gtk-play.c
+@@ -1401,6 +1401,15 @@ get_child_position (GtkOverlay * overlay, GtkWidget * widget,
+   return TRUE;
+ }
+ 
++/* Hack to make sure something gets drawn if visualizations are disabled */
++static gboolean
++draw_cb (GtkWidget *widget, cairo_t *cr, gpointer data)
++{
++  cairo_set_source_rgb (cr, 0, 0, 0);
++  cairo_paint (cr);
++  return FALSE;
++}
++
+ static void
+ create_ui (GtkPlay * play)
+ {
+@@ -1431,6 +1440,8 @@ create_ui (GtkPlay * play)
+     play->video_area = gtk_drawing_area_new ();
+     g_signal_connect (play->video_area, "realize",
+         G_CALLBACK (video_area_realize_cb), play);
++    g_signal_connect (play->video_area, "draw",
++        G_CALLBACK (draw_cb), NULL);
+   }
+   gtk_widget_set_events (play->video_area, GDK_EXPOSURE_MASK
+       | GDK_LEAVE_NOTIFY_MASK
+@@ -1753,7 +1764,7 @@ gtk_play_constructor (GType type, guint n_construct_params,
+ 
+   /* enable visualization (by default playbin uses goom) */
+   /* if visualization is enabled then use the first element */
+-  gst_player_set_visualization_enabled (self->player, TRUE);
++  gst_player_set_visualization_enabled (self->player, FALSE);
+ 
+   g_signal_connect (G_OBJECT (self), "show", G_CALLBACK (show_cb), NULL);
+ 
+-- 
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/0001-gtk-play-provide-similar-behaviour-for-quit-and-clos.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/0001-gtk-play-provide-similar-behaviour-for-quit-and-clos.patch
deleted file mode 100644
index e3f1c4f..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/0001-gtk-play-provide-similar-behaviour-for-quit-and-clos.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 220c2659a45dd354270a465c45197970dae5f548 Mon Sep 17 00:00:00 2001
-From: "Maxin B. John" <maxin.john@intel.com>
-Date: Fri, 5 Aug 2016 17:52:18 +0300
-Subject: [PATCH] gtk-play: provide similar behaviour for quit and close
-
-In x86 targets, gtk-play just pause rather than quitting the application
-when we click the close button (delete-event). Change the callback function
-to get similar behaviour when we click on "Quit" menu option.
-
-Upstream-Status: Accepted
-
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
- gtk/gtk-play.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
-index a520bef..16afc6b 100644
---- a/gtk/gtk-play.c
-+++ b/gtk/gtk-play.c
-@@ -177,7 +177,7 @@ load_from_builder (const gchar * filename, gboolean register_sig_handler,
- static void
- delete_event_cb (GtkWidget * widget, GdkEvent * event, GtkPlay * play)
- {
--  gst_player_stop (play->player);
-+  gtk_widget_destroy (GTK_WIDGET (play));
- }
- 
- static void
--- 
-2.4.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb
index 2a4c9dc..cb12a46 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb
@@ -2,16 +2,16 @@
 LICENSE = "LGPL-2.0+"
 LIC_FILES_CHKSUM = "file://gtk/gtk-play.c;beginline=1;endline=20;md5=f8c72dae3d36823ec716a9ebcae593b9"
 
-DEPENDS = "glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gtk+3"
+DEPENDS = "glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gtk+3 glib-2.0-native"
 
 SRC_URI = "git://github.com/sdroege/gst-player.git \
            file://filechooser.patch;apply=0 \
            file://Fix-pause-play.patch;apply=0 \
            file://Add-error-signal-emission-for-missing-plugins.patch;apply=0 \
-           file://0001-gtk-play-provide-similar-behaviour-for-quit-and-clos.patch \
+           file://0001-gtk-play-Disable-visualizations.patch \
            file://gst-player.desktop"
 
-SRCREV = "ea90e63c1064503f9ba5d59aa4ca604f13ca5def"
+SRCREV = "ee3c226c82767a089743e4e06058743e67f73cdb"
 PV = "0.0.1+git${SRCPV}"
 
 S = "${WORKDIR}/git"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc
index c24493e..3fdb10e 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc
@@ -3,8 +3,8 @@
 
 python split_gstreamer10_packages () {
     gst_libdir = d.expand('${libdir}/gstreamer-${LIBV}')
-    postinst = d.getVar('plugin_postinst', True)
-    glibdir = d.getVar('libdir', True)
+    postinst = d.getVar('plugin_postinst')
+    glibdir = d.getVar('libdir')
 
     do_split_packages(d, glibdir, '^lib(.*)\.so\.*', 'lib%s', 'gstreamer %s library', extra_depends='', allow_links=True)
     do_split_packages(d, gst_libdir, 'libgst(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer plugin for %s', postinst=postinst, extra_depends='')
@@ -16,14 +16,14 @@
 python set_metapkg_rdepends () {
     import os
 
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
     metapkg =  pn + '-meta'
     d.setVar('ALLOW_EMPTY_' + metapkg, "1")
     d.setVar('FILES_' + metapkg, "")
     blacklist = [ pn, pn + '-locale', pn + '-dev', pn + '-dbg', pn + '-doc', pn + '-meta' ]
     metapkg_rdepends = []
-    packages = d.getVar('PACKAGES', True).split()
-    pkgdest = d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES').split()
+    pkgdest = d.getVar('PKGDEST')
     for pkg in packages[1:]:
         if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.count('locale') and not pkg.count('-staticdev'):
             # See if the package is empty by looking at the contents of its PKGDEST subdirectory. 
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer-vaapi/vaapivideobufferpool-create-allocator-if-needed.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer-vaapi/vaapivideobufferpool-create-allocator-if-needed.patch
new file mode 100644
index 0000000..f666adc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer-vaapi/vaapivideobufferpool-create-allocator-if-needed.patch
@@ -0,0 +1,61 @@
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Backport [commit 59a731be6b in '1.10' branch]
+
+
+From 02a6002c3a80b3a5301c0943b1a1518bbdf439fc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?=
+ <vjaquez@igalia.com>
+Date: Fri, 21 Apr 2017 19:07:18 +0200
+Subject: [PATCH] vaapivideobufferpool: create allocator if needed
+
+Backport to branch 1.10
+
+Sometimes a video decoder could set different buffer pool
+configurations, because their frame size changes. In this case we
+did not reconfigure the allocator.
+
+This patch enables this use case, creating a new allocator inside
+the VAAPI buffer pool if the caps changed, if it is not dmabuf-based.
+If so, it is just reconfigured, since it doesn't have a surface pool.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=781577
+---
+ gst/vaapi/gstvaapivideobufferpool.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/gst/vaapi/gstvaapivideobufferpool.c b/gst/vaapi/gstvaapivideobufferpool.c
+index a3b9223f..9a50614b 100644
+--- a/gst/vaapi/gstvaapivideobufferpool.c
++++ b/gst/vaapi/gstvaapivideobufferpool.c
+@@ -159,6 +159,27 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
+     gst_object_replace ((GstObject **) & priv->allocator, NULL);
+   priv->video_info = new_vip;
+ 
++  {
++    guint surface_alloc_flags;
++    gboolean vinfo_changed = FALSE;
++
++    if (allocator) {
++      const GstVideoInfo *alloc_vinfo =
++          gst_allocator_get_vaapi_video_info (allocator, &surface_alloc_flags);
++      vinfo_changed = gst_video_info_changed (alloc_vinfo, &new_vip);
++    }
++
++    if (vinfo_changed && allocator && priv->use_dmabuf_memory) {
++      gst_allocator_set_vaapi_video_info (allocator, &new_vip,
++          surface_alloc_flags);
++    } else if (!priv->use_dmabuf_memory && (vinfo_changed || !allocator)) {
++      /* let's destroy the other allocator and create a new one */
++      allocator = gst_vaapi_video_allocator_new (priv->display, &new_vip,
++          surface_alloc_flags);
++      gst_buffer_pool_config_set_allocator (config, allocator, NULL);
++    }
++  }
++
+   if (!gst_buffer_pool_config_has_option (config,
+           GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META))
+     goto error_no_vaapi_video_meta_option;
+-- 
+2.11.0
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc
index ea01163..c228306 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc
@@ -30,6 +30,10 @@
   ${GSTREAMER_1_0_DEBUG} \
   --cross-prefix='${HOST_PREFIX}'"
 
+# Disable assembly optimizations for X32, as this libav lacks the support
+PACKAGECONFIG_remove_linux-gnux32 = "yasm"
+LIBAV_EXTRA_CONFIGURE_COMMON_ARG_append_linux-gnux32 = " --disable-asm"
+
 LIBAV_EXTRA_CONFIGURE_COMMON = \
 '${LIBAV_EXTRA_CONFIGURE}="${LIBAV_EXTRA_CONFIGURE_COMMON_ARG}"'
 
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch
new file mode 100644
index 0000000..7a0b448
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch
@@ -0,0 +1,32 @@
+It will add -mips64r6 and -mips64r2 to cmdline which will
+cause conflicts
+
+in OE we user mips32r2 and mips64r2 for mips arch versions
+so there is no benefit of detecting it automatically by
+poking at tools especially in cross env
+
+Fixes errors like
+
+linking -mnan=2008 module with previous -mnan=legacy modules
+failed to merge target specific data of file
+
+-Khem
+Upstream-Status: Inappropriate [OE-Specific]
+
+Index: gst-libav-1.10.1/gst-libs/ext/libav/configure
+===================================================================
+--- gst-libav-1.10.1.orig/gst-libs/ext/libav/configure
++++ gst-libav-1.10.1/gst-libs/ext/libav/configure
+@@ -5269,12 +5269,9 @@ elif enabled mips; then
+ 
+     # Enable minimum ISA based on selected options
+     if enabled mips64; then
+-        enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
+         enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
+         disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
+     else
+-        enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
+-        enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
+         enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
+         disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
+     fi
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.10.4.bb
new file mode 100644
index 0000000..59d81db
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.10.4.bb
@@ -0,0 +1,20 @@
+require gstreamer1.0-libav.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
+                    file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
+                    file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
+                    file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = " \
+    http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
+    file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
+    file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
+    file://mips64_cpu_detection.patch \
+"
+SRC_URI[md5sum] = "e2bdd9fde6ca3ff7efffb93df121f4fd"
+SRC_URI[sha256sum] = "6ca0feca75e3d48315e07f20ec37cf6260ed1e9dde58df355febd5016246268b"
+
+S = "${WORKDIR}/gst-libav-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.8.3.bb
deleted file mode 100644
index 3d86221..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.8.3.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-include gstreamer1.0-libav.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
-                    file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
-                    file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
-                    file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
-
-SRC_URI = " \
-    http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
-    file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
-    file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
-"
-
-SRC_URI[md5sum] = "b51a736147bacb40f85827a4e0ae0d2c"
-SRC_URI[sha256sum] = "9006a05990089f7155ee0e848042f6bb24e52ab1d0a59ff8d1b5d7e33001a495"
-
-S = "${WORKDIR}/gst-libav-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb
deleted file mode 100644
index f4604a3..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-libav.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
-                    file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
-                    file://gst-libs/ext/libav/LICENSE.md;md5=acda96fe91ccaabc9cd9d541806a0d37 \
-                    file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
-                    file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
-
-# To build using the system libav/ffmpeg, append "libav" to PACKAGECONFIG
-# and remove the ffmpeg sources from SRC_URI below. However, first note the
-# warnings in gstreamer1.0-libav.inc
-SRC_URI = " \
-    git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \
-    git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
-    git://source.ffmpeg.org/ffmpeg;destsuffix=git/gst-libs/ext/libav;name=ffmpeg;branch=release/3.0 \
-    file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
-    file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
-"
-
-PV = "1.8.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "f285cf0fd799cc3b46b5cecaaa439d5a2a38a9b7"
-SRCREV_common = "f363b3205658a38e84fa77f19dee218cd4445275"
-SRCREV_ffmpeg = "c66f4d1ae64dffaf456d05cbdade02054446f499"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
-	${S}/autogen.sh --noconfigure
-}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
index 07e5b7d..05562b1 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
@@ -18,7 +18,7 @@
 EXTRA_OECONF += "--disable-valgrind --with-omx-target=${GSTREAMER_1_0_OMX_TARGET}"
 
 python __anonymous () {
-    omx_target = d.getVar("GSTREAMER_1_0_OMX_TARGET", True)
+    omx_target = d.getVar("GSTREAMER_1_0_OMX_TARGET")
     if omx_target in ['generic', 'bellagio']:
         # Bellagio headers are incomplete (they are missing the OMX_VERSION_MAJOR,#
         # OMX_VERSION_MINOR, OMX_VERSION_REVISION, and OMX_VERSION_STEP macros);
@@ -26,7 +26,7 @@
         d.appendVar("CFLAGS", " -I${S}/omx/openmax")
     elif omx_target == "rpi":
         # Dedicated Raspberry Pi OpenMAX IL support makes this package machine specific
-        d.setVar("PACKAGE_ARCH", d.getVar("MACHINE_ARCH", True))
+        d.setVar("PACKAGE_ARCH", d.getVar("MACHINE_ARCH"))
 }
 
 set_omx_core_name() {
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch
deleted file mode 100644
index a428ac9..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From f629e041e9f678fcd86ad764a15117dff63c271c Mon Sep 17 00:00:00 2001
-From: Carlos Rafael Giani <dv@pseudoterminal.org>
-Date: Sat, 27 Apr 2013 02:50:25 +0200
-Subject: [PATCH] omx: fixed type error in printf call
-
-%zu expects size_t
-
-Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=699008]
-
-Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
----
- omx/gstomx.c |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/omx/gstomx.c b/omx/gstomx.c
-index a2945ed..1eca7cc 100644
---- a/omx/gstomx.c
-+++ b/omx/gstomx.c
-@@ -1630,7 +1630,7 @@ gst_omx_port_allocate_buffers_unlocked (GstOMXPort * port,
- 
-   GST_INFO_OBJECT (comp->parent,
-       "Allocating %d buffers of size %zu for %s port %u", n,
--      port->port_def.nBufferSize, comp->name, (guint) port->index);
-+      (size_t) (port->port_def.nBufferSize), comp->name, (guint) port->index);
- 
-   if (!port->buffers)
-     port->buffers = g_ptr_array_sized_new (n);
--- 
-1.7.9.5
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.10.4.bb
new file mode 100644
index 0000000..dfeefa5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.10.4.bb
@@ -0,0 +1,11 @@
+include gstreamer1.0-omx.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+                    file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/gst-omx/gst-omx-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "cedb230f1c47d0cf4b575d70dff66ff2"
+SRC_URI[sha256sum] = "45072925cf262f0fd528fab78f0de52734e46a5a88aa802fae51c67c09c81aa2"
+
+S = "${WORKDIR}/gst-omx-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb
deleted file mode 100644
index 74358a7..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-include gstreamer1.0-omx.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
-                    file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
-
-SRC_URI = "http://gstreamer.freedesktop.org/src/gst-omx/gst-omx-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "d24e8c0153c35dfefee3e26b1c2c35f8"
-SRC_URI[sha256sum] = "0b4874961e6488ad9e5808114bd486ea981c540907262caab1419355fd82d745"
-
-S = "${WORKDIR}/gst-omx-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb
deleted file mode 100644
index 9705543..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-omx.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
-                    file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
-
-SRC_URI = " \
-    git://anongit.freedesktop.org/gstreamer/gst-omx;branch=master;name=gst-omx \
-    git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;branch=master;name=common \
-    file://0001-omx-fixed-type-error-in-printf-call.patch \
-"
-
-SRCREV_gst-omx = "a2db76b048db278ef0aa798e106b7594264e06c0"
-SRCREV_common = "5edcd857b2107cd8b78c16232dd10877513ec157"
-
-SRCREV_FORMAT = "gst-omx"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
-	cd ${S}
-	./autogen.sh --noconfigure
-	cd ${B}
-}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
index 0fe5564..0ccfc89 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
@@ -12,7 +12,7 @@
 
 # opengl packageconfig factored out to make it easy for distros
 # and BSP layers to pick either (desktop) opengl, gles2, or no GL
-PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)}"
+PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2 egl', '', d)}"
 
 # gtk is not in the PACKAGECONFIG variable by default until
 # the transition to gtk+3 is finished
@@ -20,7 +20,7 @@
     ${GSTREAMER_ORC} \
     ${PACKAGECONFIG_GL} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'directfb', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} \
     bz2 curl dash dtls hls neon rsvg sbc smoothstreaming sndfile uvch264 webp \
 "
@@ -30,6 +30,7 @@
 PACKAGECONFIG[bz2]             = "--enable-bz2,--disable-bz2,bzip2"
 PACKAGECONFIG[curl]            = "--enable-curl,--disable-curl,curl"
 PACKAGECONFIG[dash]            = "--enable-dash,--disable-dash,libxml2"
+PACKAGECONFIG[dc1394]          = "--enable-dc1394,--disable-dc1394,libdc1394"
 PACKAGECONFIG[directfb]        = "--enable-directfb,--disable-directfb,directfb"
 PACKAGECONFIG[dtls]            = "--enable-dtls,--disable-dtls,openssl"
 PACKAGECONFIG[egl]             = "--enable-egl,--disable-egl,virtual/egl"
@@ -42,6 +43,7 @@
 # ensure OpenSSL is used for HLS AES description instead of nettle
 # (OpenSSL is a shared dependency with dtls)
 PACKAGECONFIG[hls]             = "--enable-hls --with-hls-crypto=openssl,--disable-hls,openssl"
+PACKAGECONFIG[kms]             = "--enable-kms,--disable-kms,libdrm"
 PACKAGECONFIG[libmms]          = "--enable-libmms,--disable-libmms,libmms"
 PACKAGECONFIG[libssh2]         = "--enable-libssh2,--disable-libssh2,libssh2"
 PACKAGECONFIG[modplug]         = "--enable-modplug,--disable-modplug,libmodplug"
@@ -49,6 +51,7 @@
 PACKAGECONFIG[openal]          = "--enable-openal,--disable-openal,openal-soft"
 PACKAGECONFIG[opencv]          = "--enable-opencv,--disable-opencv,opencv"
 PACKAGECONFIG[opengl]          = "--enable-opengl,--disable-opengl,virtual/libgl libglu"
+PACKAGECONFIG[openjpeg]        = "--enable-openjpeg,--disable-openjpeg,openjpeg"
 # the opus encoder/decoder elements are now in the -base package,
 # but the opus parser remains in -bad
 PACKAGECONFIG[opusparse]       = "--enable-opus,--disable-opus,libopus"
@@ -63,18 +66,18 @@
 PACKAGECONFIG[uvch264]         = "--enable-uvch264,--disable-uvch264,libusb1 libgudev"
 PACKAGECONFIG[voaacenc]        = "--enable-voaacenc,--disable-voaacenc,vo-aacenc"
 PACKAGECONFIG[voamrwbenc]      = "--enable-voamrwbenc,--disable-voamrwbenc,vo-amrwbenc"
-PACKAGECONFIG[wayland]         = "--enable-wayland,--disable-wayland,wayland-native wayland"
+PACKAGECONFIG[wayland]         = "--enable-wayland,--disable-wayland,wayland-native wayland wayland-protocols"
 PACKAGECONFIG[webp]            = "--enable-webp,--disable-webp,libwebp"
 
 # these plugins have not been ported to 1.0 (yet):
-#   apexsink dc1394 lv2 linsys musepack nas timidity sdl xvid wininet
+#   apexsink linsys nas timidity sdl xvid wininet
 #   sndio cdxaparse dccp faceoverlay hdvparse tta mve nuvdemux
 #   patchdetect sdi videomeasure
 
 # these plugins have no corresponding library in OE-core or meta-openembedded:
-#   openni2 winks direct3d directsound winscreencap acm
-#   apple_media android_media avc bs2b chromaprint daala dts gme gsm kate ladspa
-#   libde265 mimic mpeg2enc mplex nvenc ofa openh264 opensles pvr soundtouch spandsp
+#   openni2 winks direct3d directsound winscreencap acm apple_media
+#   android_media avc bs2b chromaprint daala dts fdkaac gme gsm kate ladspa libde265
+#   lv2 mimic mpeg2enc mplex musepack nvenc ofa openh264 opensles pvr soundtouch spandsp
 #   spc teletextdec tinyalsa vdpau vulkan wasapi x265 zbar
 
 # qt5 support is disabled, because it is not present in OE core, and requires more work than
@@ -98,10 +101,10 @@
     --disable-chromaprint \
     --disable-cocoa \
     --disable-daala \
-    --disable-dc1394 \
     --disable-direct3d \
     --disable-directsound \
     --disable-dts \
+    --disable-fdk_aac \
     --disable-gme \
     --disable-gsm \
     --disable-kate \
@@ -119,7 +122,6 @@
     --disable-ofa \
     --disable-openexr \
     --disable-openh264 \
-    --disable-openjpeg \
     --disable-openni2 \
     --disable-opensles \
     --disable-pvr \
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
index 33efc50..43f1ee0 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
@@ -13,24 +13,24 @@
  gst-libs/gst/mpegts/Makefile.am    | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
 
-diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am
-index f968357..7cc2c7a 100644
---- a/gst-libs/gst/gl/Makefile.am
-+++ b/gst-libs/gst/gl/Makefile.am
-@@ -167,7 +167,7 @@ GstGL-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstgl-@GST_API_VERSION@
- 		--library=libgstgl-@GST_API_VERSION@.la \
+Index: gst-plugins-bad-1.10.1/gst-libs/gst/gl/Makefile.am
+===================================================================
+--- gst-plugins-bad-1.10.1.orig/gst-libs/gst/gl/Makefile.am
++++ gst-plugins-bad-1.10.1/gst-libs/gst/gl/Makefile.am
+@@ -171,7 +171,7 @@ GstGL-@GST_API_VERSION@.gir: $(INTROSPEC
  		--include=Gst-@GST_API_VERSION@ \
  		--include=GstBase-@GST_API_VERSION@ \
+ 		--include=GstVideo-@GST_API_VERSION@ \
 -		--libtool="$(top_builddir)/libtool" \
 +		--libtool="$(LIBTOOL)" \
  		--pkg gstreamer-@GST_API_VERSION@ \
  		--pkg gstreamer-base-@GST_API_VERSION@ \
  		--pkg gstreamer-video-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/insertbin/Makefile.am b/gst-libs/gst/insertbin/Makefile.am
-index 09eb97c..b746885 100644
---- a/gst-libs/gst/insertbin/Makefile.am
-+++ b/gst-libs/gst/insertbin/Makefile.am
-@@ -44,7 +44,7 @@ GstInsertBin-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstinsertbin-@GS
+Index: gst-plugins-bad-1.10.1/gst-libs/gst/insertbin/Makefile.am
+===================================================================
+--- gst-plugins-bad-1.10.1.orig/gst-libs/gst/insertbin/Makefile.am
++++ gst-plugins-bad-1.10.1/gst-libs/gst/insertbin/Makefile.am
+@@ -45,7 +45,7 @@ GstInsertBin-@GST_API_VERSION@.gir: $(IN
  		--library=libgstinsertbin-@GST_API_VERSION@.la \
  		--include=Gst-@GST_API_VERSION@ \
  		--include=GstBase-@GST_API_VERSION@ \
@@ -39,11 +39,11 @@
  		--pkg gstreamer-@GST_API_VERSION@ \
  		--pkg gstreamer-base-@GST_API_VERSION@ \
  		--pkg-export gstreamer-insertbin-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/mpegts/Makefile.am b/gst-libs/gst/mpegts/Makefile.am
-index 2511d49..c1cbce6 100644
---- a/gst-libs/gst/mpegts/Makefile.am
-+++ b/gst-libs/gst/mpegts/Makefile.am
-@@ -78,7 +78,7 @@ GstMpegts-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstmpegts-@GST_API_
+Index: gst-plugins-bad-1.10.1/gst-libs/gst/mpegts/Makefile.am
+===================================================================
+--- gst-plugins-bad-1.10.1.orig/gst-libs/gst/mpegts/Makefile.am
++++ gst-plugins-bad-1.10.1/gst-libs/gst/mpegts/Makefile.am
+@@ -79,7 +79,7 @@ GstMpegts-@GST_API_VERSION@.gir: $(INTRO
  		--add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-video-@GST_API_VERSION@` \
  		--library=libgstmpegts-@GST_API_VERSION@.la \
  		--include=Gst-@GST_API_VERSION@ \
@@ -52,6 +52,3 @@
  		--pkg gstreamer-@GST_API_VERSION@ \
  		--pkg gstreamer-video-@GST_API_VERSION@ \
  		--pkg-export gstreamer-mpegts-@GST_API_VERSION@ \
--- 
-2.6.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Prepend-PKG_CONFIG_SYSROOT_DIR-to-pkg-config-output.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Prepend-PKG_CONFIG_SYSROOT_DIR-to-pkg-config-output.patch
new file mode 100644
index 0000000..86a4495
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Prepend-PKG_CONFIG_SYSROOT_DIR-to-pkg-config-output.patch
@@ -0,0 +1,34 @@
+From c271503d7e233428ac0323c51d6517113e26bef7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 1 Dec 2016 00:27:13 -0800
+Subject: [PATCH] Prepend PKG_CONFIG_SYSROOT_DIR to pkg-config output
+
+In cross environment we have to prepend the sysroot to the path found by
+pkgconfig since the path returned from pkgconfig does not have sysroot prefixed
+it ends up using the files from host system. If build host has wayland installed
+the build will succeed but if you dont have wayland-protocols installed on build host then
+it wont find the files on build host
+
+This should work ok with non sysrooted builds too since in those cases PKG_CONFIG_SYSROOT_DIR
+will be empty
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: gst-plugins-bad-1.10.1/configure.ac
+===================================================================
+--- gst-plugins-bad-1.10.1.orig/configure.ac
++++ gst-plugins-bad-1.10.1/configure.ac
+@@ -2233,7 +2233,7 @@ AG_GST_CHECK_FEATURE(WAYLAND, [wayland s
+     PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, wayland-protocols >= 1.4, [
+       if test "x$wayland_scanner" != "x"; then
+         HAVE_WAYLAND="yes"
+-        AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
++        AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, ${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
+       else
+         AC_MSG_RESULT([wayland-scanner is required to build the wayland plugin])
+         HAVE_WAYLAND="no"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch
index e81b065..9fc91d8 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch
@@ -12,16 +12,13 @@
  pkgconfig/gstreamer-gl.pc.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/pkgconfig/gstreamer-gl.pc.in b/pkgconfig/gstreamer-gl.pc.in
-index 5589e2a..b986450 100644
---- a/pkgconfig/gstreamer-gl.pc.in
-+++ b/pkgconfig/gstreamer-gl.pc.in
+Index: gst-plugins-bad-1.10.1/pkgconfig/gstreamer-gl.pc.in
+===================================================================
+--- gst-plugins-bad-1.10.1.orig/pkgconfig/gstreamer-gl.pc.in
++++ gst-plugins-bad-1.10.1/pkgconfig/gstreamer-gl.pc.in
 @@ -10,4 +10,4 @@ Version: @VERSION@
  Requires: gstreamer-base-@GST_API_VERSION@ gstreamer-@GST_API_VERSION@
  
  Libs: -L${libdir} -lgstgl-@GST_API_VERSION@ @GL_LIBS@
--Cflags: -I${includedir} @GL_CFLAGS@
-+Cflags: -I${includedir}
--- 
-2.7.0
-
+-Cflags: -I${includedir} -I${libdir}/gstreamer-@GST_API_VERSION@/include @GL_CFLAGS@
++Cflags: -I${includedir} -I${libdir}/gstreamer-@GST_API_VERSION@/include
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mssdemux-improved-live-playback-support.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mssdemux-improved-live-playback-support.patch
new file mode 100644
index 0000000..4832c18
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mssdemux-improved-live-playback-support.patch
@@ -0,0 +1,929 @@
+From 73721ad4e9e2d32e1c8b6a3b4aaa98401530e58a Mon Sep 17 00:00:00 2001
+From: Philippe Normand <philn@igalia.com>
+Date: Tue, 29 Nov 2016 14:43:41 +0100
+Subject: [PATCH] mssdemux: improved live playback support
+
+When a MSS server hosts a live stream the fragments listed in the
+manifest usually don't have accurate timestamps and duration, except
+for the first fragment, which additionally stores timing information
+for the few upcoming fragments. In this scenario it is useless to
+periodically fetch and update the manifest and the fragments list can
+be incrementally built by parsing the first/current fragment.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=755036
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ ext/smoothstreaming/Makefile.am               |   2 +
+ ext/smoothstreaming/gstmssdemux.c             |  60 ++++++
+ ext/smoothstreaming/gstmssfragmentparser.c    | 266 ++++++++++++++++++++++++++
+ ext/smoothstreaming/gstmssfragmentparser.h    |  84 ++++++++
+ ext/smoothstreaming/gstmssmanifest.c          | 158 ++++++++++++++-
+ ext/smoothstreaming/gstmssmanifest.h          |   7 +
+ gst-libs/gst/adaptivedemux/gstadaptivedemux.c |  27 ++-
+ gst-libs/gst/adaptivedemux/gstadaptivedemux.h |  14 ++
+ 8 files changed, 606 insertions(+), 12 deletions(-)
+ create mode 100644 ext/smoothstreaming/gstmssfragmentparser.c
+ create mode 100644 ext/smoothstreaming/gstmssfragmentparser.h
+
+diff --git a/ext/smoothstreaming/Makefile.am b/ext/smoothstreaming/Makefile.am
+index 4faf9df9f..a5e1ad6ae 100644
+--- a/ext/smoothstreaming/Makefile.am
++++ b/ext/smoothstreaming/Makefile.am
+@@ -13,8 +13,10 @@ libgstsmoothstreaming_la_LIBADD = \
+ libgstsmoothstreaming_la_LDFLAGS = ${GST_PLUGIN_LDFLAGS}
+ libgstsmoothstreaming_la_SOURCES = gstsmoothstreaming-plugin.c \
+ 	gstmssdemux.c \
++	gstmssfragmentparser.c \
+ 	gstmssmanifest.c
+ libgstsmoothstreaming_la_LIBTOOLFLAGS = --tag=disable-static
+ 
+ noinst_HEADERS = gstmssdemux.h \
++	gstmssfragmentparser.h \
+ 	gstmssmanifest.h
+diff --git a/ext/smoothstreaming/gstmssdemux.c b/ext/smoothstreaming/gstmssdemux.c
+index 12fb40497..120d9c22b 100644
+--- a/ext/smoothstreaming/gstmssdemux.c
++++ b/ext/smoothstreaming/gstmssdemux.c
+@@ -135,11 +135,18 @@ gst_mss_demux_stream_update_fragment_info (GstAdaptiveDemuxStream * stream);
+ static gboolean gst_mss_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek);
+ static gint64
+ gst_mss_demux_get_manifest_update_interval (GstAdaptiveDemux * demux);
++static gint64
++gst_mss_demux_stream_get_fragment_waiting_time (GstAdaptiveDemuxStream *
++    stream);
+ static GstFlowReturn
+ gst_mss_demux_update_manifest_data (GstAdaptiveDemux * demux,
+     GstBuffer * buffer);
+ static gboolean gst_mss_demux_get_live_seek_range (GstAdaptiveDemux * demux,
+     gint64 * start, gint64 * stop);
++static GstFlowReturn gst_mss_demux_data_received (GstAdaptiveDemux * demux,
++    GstAdaptiveDemuxStream * stream, GstBuffer * buffer);
++static gboolean
++gst_mss_demux_requires_periodical_playlist_update (GstAdaptiveDemux * demux);
+ 
+ static void
+ gst_mss_demux_class_init (GstMssDemuxClass * klass)
+@@ -192,10 +199,15 @@ gst_mss_demux_class_init (GstMssDemuxClass * klass)
+       gst_mss_demux_stream_select_bitrate;
+   gstadaptivedemux_class->stream_update_fragment_info =
+       gst_mss_demux_stream_update_fragment_info;
++  gstadaptivedemux_class->stream_get_fragment_waiting_time =
++      gst_mss_demux_stream_get_fragment_waiting_time;
+   gstadaptivedemux_class->update_manifest_data =
+       gst_mss_demux_update_manifest_data;
+   gstadaptivedemux_class->get_live_seek_range =
+       gst_mss_demux_get_live_seek_range;
++  gstadaptivedemux_class->data_received = gst_mss_demux_data_received;
++  gstadaptivedemux_class->requires_periodical_playlist_update =
++      gst_mss_demux_requires_periodical_playlist_update;
+ 
+   GST_DEBUG_CATEGORY_INIT (mssdemux_debug, "mssdemux", 0, "mssdemux plugin");
+ }
+@@ -650,6 +662,13 @@ gst_mss_demux_get_manifest_update_interval (GstAdaptiveDemux * demux)
+   return interval;
+ }
+ 
++static gint64
++gst_mss_demux_stream_get_fragment_waiting_time (GstAdaptiveDemuxStream * stream)
++{
++  /* Wait a second for live streams so we don't try premature fragments downloading */
++  return GST_SECOND;
++}
++
+ static GstFlowReturn
+ gst_mss_demux_update_manifest_data (GstAdaptiveDemux * demux,
+     GstBuffer * buffer)
+@@ -670,3 +689,44 @@ gst_mss_demux_get_live_seek_range (GstAdaptiveDemux * demux, gint64 * start,
+ 
+   return gst_mss_manifest_get_live_seek_range (mssdemux->manifest, start, stop);
+ }
++
++static GstFlowReturn
++gst_mss_demux_data_received (GstAdaptiveDemux * demux,
++    GstAdaptiveDemuxStream * stream, GstBuffer * buffer)
++{
++  GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
++  GstMssDemuxStream *mssstream = (GstMssDemuxStream *) stream;
++  gsize available;
++
++  if (!gst_mss_manifest_is_live (mssdemux->manifest)) {
++    return GST_ADAPTIVE_DEMUX_CLASS (parent_class)->data_received (demux,
++        stream, buffer);
++  }
++
++  if (gst_mss_stream_fragment_parsing_needed (mssstream->manifest_stream)) {
++    gst_mss_manifest_live_adapter_push (mssstream->manifest_stream, buffer);
++    available =
++        gst_mss_manifest_live_adapter_available (mssstream->manifest_stream);
++    // FIXME: try to reduce this minimal size.
++    if (available < 4096) {
++      return GST_FLOW_OK;
++    } else {
++      GST_LOG_OBJECT (stream->pad, "enough data, parsing fragment.");
++      buffer =
++          gst_mss_manifest_live_adapter_take_buffer (mssstream->manifest_stream,
++          available);
++      gst_mss_stream_parse_fragment (mssstream->manifest_stream, buffer);
++    }
++  }
++
++  return GST_ADAPTIVE_DEMUX_CLASS (parent_class)->data_received (demux, stream,
++      buffer);
++}
++
++static gboolean
++gst_mss_demux_requires_periodical_playlist_update (GstAdaptiveDemux * demux)
++{
++  GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
++
++  return (!gst_mss_manifest_is_live (mssdemux->manifest));
++}
+diff --git a/ext/smoothstreaming/gstmssfragmentparser.c b/ext/smoothstreaming/gstmssfragmentparser.c
+new file mode 100644
+index 000000000..b554d4f31
+--- /dev/null
++++ b/ext/smoothstreaming/gstmssfragmentparser.c
+@@ -0,0 +1,266 @@
++/*
++ * Microsoft Smooth-Streaming fragment parsing library
++ *
++ * gstmssfragmentparser.h
++ *
++ * Copyright (C) 2016 Igalia S.L
++ * Copyright (C) 2016 Metrological
++ *   Author: Philippe Normand <philn@igalia.com>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Library General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Library General Public License for more details.
++ *
++ * You should have received a copy of the GNU Library General Public
++ * License along with this library (COPYING); if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++#include "gstmssfragmentparser.h"
++#include <gst/base/gstbytereader.h>
++#include <string.h>
++
++GST_DEBUG_CATEGORY_EXTERN (mssdemux_debug);
++#define GST_CAT_DEFAULT mssdemux_debug
++
++void
++gst_mss_fragment_parser_init (GstMssFragmentParser * parser)
++{
++  parser->status = GST_MSS_FRAGMENT_HEADER_PARSER_INIT;
++  parser->tfrf.entries_count = 0;
++}
++
++void
++gst_mss_fragment_parser_clear (GstMssFragmentParser * parser)
++{
++  parser->tfrf.entries_count = 0;
++  if (parser->tfrf.entries) {
++    g_free (parser->tfrf.entries);
++    parser->tfrf.entries = 0;
++  }
++}
++
++static gboolean
++_parse_tfrf_box (GstMssFragmentParser * parser, GstByteReader * reader)
++{
++  guint8 version;
++  guint32 flags = 0;
++  guint8 fragment_count = 0;
++  guint8 index = 0;
++
++  if (!gst_byte_reader_get_uint8 (reader, &version)) {
++    GST_ERROR ("Error getting box's version field");
++    return FALSE;
++  }
++
++  if (!gst_byte_reader_get_uint24_be (reader, &flags)) {
++    GST_ERROR ("Error getting box's flags field");
++    return FALSE;
++  }
++
++  gst_byte_reader_get_uint8 (reader, &fragment_count);
++  parser->tfrf.entries_count = fragment_count;
++  parser->tfrf.entries =
++      g_malloc (sizeof (GstTfrfBoxEntry) * parser->tfrf.entries_count);
++  for (index = 0; index < fragment_count; index++) {
++    guint64 absolute_time = 0;
++    guint64 absolute_duration = 0;
++    if (version & 0x01) {
++      gst_byte_reader_get_uint64_be (reader, &absolute_time);
++      gst_byte_reader_get_uint64_be (reader, &absolute_duration);
++    } else {
++      guint32 time = 0;
++      guint32 duration = 0;
++      gst_byte_reader_get_uint32_be (reader, &time);
++      gst_byte_reader_get_uint32_be (reader, &duration);
++      time = ~time;
++      duration = ~duration;
++      absolute_time = ~time;
++      absolute_duration = ~duration;
++    }
++    parser->tfrf.entries[index].time = absolute_time;
++    parser->tfrf.entries[index].duration = absolute_duration;
++  }
++
++  GST_LOG ("tfrf box parsed");
++  return TRUE;
++}
++
++static gboolean
++_parse_tfxd_box (GstMssFragmentParser * parser, GstByteReader * reader)
++{
++  guint8 version;
++  guint32 flags = 0;
++  guint64 absolute_time = 0;
++  guint64 absolute_duration = 0;
++
++  if (!gst_byte_reader_get_uint8 (reader, &version)) {
++    GST_ERROR ("Error getting box's version field");
++    return FALSE;
++  }
++
++  if (!gst_byte_reader_get_uint24_be (reader, &flags)) {
++    GST_ERROR ("Error getting box's flags field");
++    return FALSE;
++  }
++
++  if (version & 0x01) {
++    gst_byte_reader_get_uint64_be (reader, &absolute_time);
++    gst_byte_reader_get_uint64_be (reader, &absolute_duration);
++  } else {
++    guint32 time = 0;
++    guint32 duration = 0;
++    gst_byte_reader_get_uint32_be (reader, &time);
++    gst_byte_reader_get_uint32_be (reader, &duration);
++    time = ~time;
++    duration = ~duration;
++    absolute_time = ~time;
++    absolute_duration = ~duration;
++  }
++
++  parser->tfxd.time = absolute_time;
++  parser->tfxd.duration = absolute_duration;
++  GST_LOG ("tfxd box parsed");
++  return TRUE;
++}
++
++gboolean
++gst_mss_fragment_parser_add_buffer (GstMssFragmentParser * parser,
++    GstBuffer * buffer)
++{
++  GstByteReader reader;
++  GstMapInfo info;
++  guint32 size;
++  guint32 fourcc;
++  const guint8 *uuid;
++  gboolean error = FALSE;
++  gboolean mdat_box_found = FALSE;
++
++  static const guint8 tfrf_uuid[] = {
++    0xd4, 0x80, 0x7e, 0xf2, 0xca, 0x39, 0x46, 0x95,
++    0x8e, 0x54, 0x26, 0xcb, 0x9e, 0x46, 0xa7, 0x9f
++  };
++
++  static const guint8 tfxd_uuid[] = {
++    0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
++    0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
++  };
++
++  static const guint8 piff_uuid[] = {
++    0xa2, 0x39, 0x4f, 0x52, 0x5a, 0x9b, 0x4f, 0x14,
++    0xa2, 0x44, 0x6c, 0x42, 0x7c, 0x64, 0x8d, 0xf4
++  };
++
++  if (!gst_buffer_map (buffer, &info, GST_MAP_READ)) {
++    return FALSE;
++  }
++
++  gst_byte_reader_init (&reader, info.data, info.size);
++  GST_TRACE ("Total buffer size: %u", gst_byte_reader_get_size (&reader));
++
++  size = gst_byte_reader_get_uint32_be_unchecked (&reader);
++  fourcc = gst_byte_reader_get_uint32_le_unchecked (&reader);
++  if (fourcc == GST_MSS_FRAGMENT_FOURCC_MOOF) {
++    GST_TRACE ("moof box found");
++    size = gst_byte_reader_get_uint32_be_unchecked (&reader);
++    fourcc = gst_byte_reader_get_uint32_le_unchecked (&reader);
++    if (fourcc == GST_MSS_FRAGMENT_FOURCC_MFHD) {
++      gst_byte_reader_skip_unchecked (&reader, size - 8);
++
++      size = gst_byte_reader_get_uint32_be_unchecked (&reader);
++      fourcc = gst_byte_reader_get_uint32_le_unchecked (&reader);
++      if (fourcc == GST_MSS_FRAGMENT_FOURCC_TRAF) {
++        size = gst_byte_reader_get_uint32_be_unchecked (&reader);
++        fourcc = gst_byte_reader_get_uint32_le_unchecked (&reader);
++        if (fourcc == GST_MSS_FRAGMENT_FOURCC_TFHD) {
++          gst_byte_reader_skip_unchecked (&reader, size - 8);
++
++          size = gst_byte_reader_get_uint32_be_unchecked (&reader);
++          fourcc = gst_byte_reader_get_uint32_le_unchecked (&reader);
++          if (fourcc == GST_MSS_FRAGMENT_FOURCC_TRUN) {
++            GST_TRACE ("trun box found, size: %" G_GUINT32_FORMAT, size);
++            if (!gst_byte_reader_skip (&reader, size - 8)) {
++              GST_WARNING ("Failed to skip trun box, enough data?");
++              error = TRUE;
++              goto beach;
++            }
++          }
++        }
++      }
++    }
++  }
++
++  while (!mdat_box_found) {
++    GST_TRACE ("remaining data: %u", gst_byte_reader_get_remaining (&reader));
++    if (!gst_byte_reader_get_uint32_be (&reader, &size)) {
++      GST_WARNING ("Failed to get box size, enough data?");
++      error = TRUE;
++      break;
++    }
++
++    GST_TRACE ("box size: %" G_GUINT32_FORMAT, size);
++    if (!gst_byte_reader_get_uint32_le (&reader, &fourcc)) {
++      GST_WARNING ("Failed to get fourcc, enough data?");
++      error = TRUE;
++      break;
++    }
++
++    if (fourcc == GST_MSS_FRAGMENT_FOURCC_MDAT) {
++      GST_LOG ("mdat box found");
++      mdat_box_found = TRUE;
++      break;
++    }
++
++    if (fourcc != GST_MSS_FRAGMENT_FOURCC_UUID) {
++      GST_ERROR ("invalid UUID fourcc: %" GST_FOURCC_FORMAT,
++          GST_FOURCC_ARGS (fourcc));
++      error = TRUE;
++      break;
++    }
++
++    if (!gst_byte_reader_peek_data (&reader, 16, &uuid)) {
++      GST_ERROR ("not enough data in UUID box");
++      error = TRUE;
++      break;
++    }
++
++    if (memcmp (uuid, piff_uuid, 16) == 0) {
++      gst_byte_reader_skip_unchecked (&reader, size - 8);
++      GST_LOG ("piff box detected");
++    }
++
++    if (memcmp (uuid, tfrf_uuid, 16) == 0) {
++      gst_byte_reader_get_data (&reader, 16, &uuid);
++      if (!_parse_tfrf_box (parser, &reader)) {
++        GST_ERROR ("txrf box parsing error");
++        error = TRUE;
++        break;
++      }
++    }
++
++    if (memcmp (uuid, tfxd_uuid, 16) == 0) {
++      gst_byte_reader_get_data (&reader, 16, &uuid);
++      if (!_parse_tfxd_box (parser, &reader)) {
++        GST_ERROR ("tfrf box parsing error");
++        error = TRUE;
++        break;
++      }
++    }
++  }
++
++beach:
++
++  if (!error)
++    parser->status = GST_MSS_FRAGMENT_HEADER_PARSER_FINISHED;
++
++  GST_LOG ("Fragment parsing successful: %s", error ? "no" : "yes");
++  gst_buffer_unmap (buffer, &info);
++  return !error;
++}
+diff --git a/ext/smoothstreaming/gstmssfragmentparser.h b/ext/smoothstreaming/gstmssfragmentparser.h
+new file mode 100644
+index 000000000..cf4711865
+--- /dev/null
++++ b/ext/smoothstreaming/gstmssfragmentparser.h
+@@ -0,0 +1,84 @@
++/*
++ * Microsoft Smooth-Streaming fragment parsing library
++ *
++ * gstmssfragmentparser.h
++ *
++ * Copyright (C) 2016 Igalia S.L
++ * Copyright (C) 2016 Metrological
++ *   Author: Philippe Normand <philn@igalia.com>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Library General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Library General Public License for more details.
++ *
++ * You should have received a copy of the GNU Library General Public
++ * License along with this library (COPYING); if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++#ifndef __GST_MSS_FRAGMENT_PARSER_H__
++#define __GST_MSS_FRAGMENT_PARSER_H__
++
++#include <gst/gst.h>
++
++G_BEGIN_DECLS
++
++#define GST_MSS_FRAGMENT_FOURCC_MOOF GST_MAKE_FOURCC('m','o','o','f')
++#define GST_MSS_FRAGMENT_FOURCC_MFHD GST_MAKE_FOURCC('m','f','h','d')
++#define GST_MSS_FRAGMENT_FOURCC_TRAF GST_MAKE_FOURCC('t','r','a','f')
++#define GST_MSS_FRAGMENT_FOURCC_TFHD GST_MAKE_FOURCC('t','f','h','d')
++#define GST_MSS_FRAGMENT_FOURCC_TRUN GST_MAKE_FOURCC('t','r','u','n')
++#define GST_MSS_FRAGMENT_FOURCC_UUID GST_MAKE_FOURCC('u','u','i','d')
++#define GST_MSS_FRAGMENT_FOURCC_MDAT GST_MAKE_FOURCC('m','d','a','t')
++
++typedef struct _GstTfxdBox
++{
++  guint8 version;
++  guint32 flags;
++
++  guint64 time;
++  guint64 duration;
++} GstTfxdBox;
++
++typedef struct _GstTfrfBoxEntry
++{
++  guint64 time;
++  guint64 duration;
++} GstTfrfBoxEntry;
++
++typedef struct _GstTfrfBox
++{
++  guint8 version;
++  guint32 flags;
++
++  gint entries_count;
++  GstTfrfBoxEntry *entries;
++} GstTfrfBox;
++
++typedef enum _GstFragmentHeaderParserStatus
++{
++  GST_MSS_FRAGMENT_HEADER_PARSER_INIT,
++  GST_MSS_FRAGMENT_HEADER_PARSER_FINISHED
++} GstFragmentHeaderParserStatus;
++
++typedef struct _GstMssFragmentParser
++{
++  GstFragmentHeaderParserStatus status;
++  GstTfxdBox tfxd;
++  GstTfrfBox tfrf;
++} GstMssFragmentParser;
++
++void gst_mss_fragment_parser_init (GstMssFragmentParser * parser);
++void gst_mss_fragment_parser_clear (GstMssFragmentParser * parser);
++gboolean gst_mss_fragment_parser_add_buffer (GstMssFragmentParser * parser, GstBuffer * buf);
++
++G_END_DECLS
++
++#endif /* __GST_MSS_FRAGMENT_PARSER_H__ */
+diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
+index 144bbb42d..e1031ba55 100644
+--- a/ext/smoothstreaming/gstmssmanifest.c
++++ b/ext/smoothstreaming/gstmssmanifest.c
+@@ -1,5 +1,7 @@
+ /* GStreamer
+  * Copyright (C) 2012 Smart TV Alliance
++ * Copyright (C) 2016 Igalia S.L
++ * Copyright (C) 2016 Metrological
+  *  Author: Thiago Sousa Santos <thiago.sousa.santos@collabora.com>, Collabora Ltd.
+  *
+  * gstmssmanifest.c:
+@@ -31,6 +33,7 @@
+ #include <gst/codecparsers/gsth264parser.h>
+ 
+ #include "gstmssmanifest.h"
++#include "gstmssfragmentparser.h"
+ 
+ GST_DEBUG_CATEGORY_EXTERN (mssdemux_debug);
+ #define GST_CAT_DEFAULT mssdemux_debug
+@@ -74,12 +77,17 @@ struct _GstMssStream
+   gboolean active;              /* if the stream is currently being used */
+   gint selectedQualityIndex;
+ 
++  gboolean has_live_fragments;
++  GstAdapter *live_adapter;
++
+   GList *fragments;
+   GList *qualities;
+ 
+   gchar *url;
+   gchar *lang;
+ 
++  GstMssFragmentParser fragment_parser;
++
+   guint fragment_repetition_index;
+   GList *current_fragment;
+   GList *current_quality;
+@@ -96,6 +104,7 @@ struct _GstMssManifest
+ 
+   gboolean is_live;
+   gint64 dvr_window;
++  guint64 look_ahead_fragment_count;
+ 
+   GString *protection_system_id;
+   gchar *protection_data;
+@@ -235,7 +244,8 @@ compare_bitrate (GstMssStreamQuality * a, GstMssStreamQuality * b)
+ }
+ 
+ static void
+-_gst_mss_stream_init (GstMssStream * stream, xmlNodePtr node)
++_gst_mss_stream_init (GstMssManifest * manifest, GstMssStream * stream,
++    xmlNodePtr node)
+ {
+   xmlNodePtr iter;
+   GstMssFragmentListBuilder builder;
+@@ -248,9 +258,21 @@ _gst_mss_stream_init (GstMssStream * stream, xmlNodePtr node)
+   stream->url = (gchar *) xmlGetProp (node, (xmlChar *) MSS_PROP_URL);
+   stream->lang = (gchar *) xmlGetProp (node, (xmlChar *) MSS_PROP_LANGUAGE);
+ 
++  /* for live playback each fragment usually has timing
++   * information for the few next look-ahead fragments so the
++   * playlist can be built incrementally from the first fragment
++   * of the manifest.
++   */
++
++  GST_DEBUG ("Live stream: %s, look-ahead fragments: %" G_GUINT64_FORMAT,
++      manifest->is_live ? "yes" : "no", manifest->look_ahead_fragment_count);
++  stream->has_live_fragments = manifest->is_live
++      && manifest->look_ahead_fragment_count;
++
+   for (iter = node->children; iter; iter = iter->next) {
+     if (node_has_type (iter, MSS_NODE_STREAM_FRAGMENT)) {
+-      gst_mss_fragment_list_builder_add (&builder, iter);
++      if (!stream->has_live_fragments || !builder.fragments)
++        gst_mss_fragment_list_builder_add (&builder, iter);
+     } else if (node_has_type (iter, MSS_NODE_STREAM_QUALITY)) {
+       GstMssStreamQuality *quality = gst_mss_stream_quality_new (iter);
+       stream->qualities = g_list_prepend (stream->qualities, quality);
+@@ -259,17 +281,24 @@ _gst_mss_stream_init (GstMssStream * stream, xmlNodePtr node)
+     }
+   }
+ 
+-  stream->fragments = g_list_reverse (builder.fragments);
++  if (stream->has_live_fragments) {
++    stream->live_adapter = gst_adapter_new ();
++  }
++
++  if (builder.fragments) {
++    stream->fragments = g_list_reverse (builder.fragments);
++    stream->current_fragment = stream->fragments;
++  }
+ 
+   /* order them from smaller to bigger based on bitrates */
+   stream->qualities =
+       g_list_sort (stream->qualities, (GCompareFunc) compare_bitrate);
+-
+-  stream->current_fragment = stream->fragments;
+   stream->current_quality = stream->qualities;
+ 
+   stream->regex_bitrate = g_regex_new ("\\{[Bb]itrate\\}", 0, 0, NULL);
+   stream->regex_position = g_regex_new ("\\{start[ _]time\\}", 0, 0, NULL);
++
++  gst_mss_fragment_parser_init (&stream->fragment_parser);
+ }
+ 
+ 
+@@ -315,6 +344,7 @@ gst_mss_manifest_new (GstBuffer * data)
+   xmlNodePtr nodeiter;
+   gchar *live_str;
+   GstMapInfo mapinfo;
++  gchar *look_ahead_fragment_count_str;
+ 
+   if (!gst_buffer_map (data, &mapinfo, GST_MAP_READ)) {
+     return NULL;
+@@ -335,6 +365,7 @@ gst_mss_manifest_new (GstBuffer * data)
+   /* the entire file is always available for non-live streams */
+   if (!manifest->is_live) {
+     manifest->dvr_window = 0;
++    manifest->look_ahead_fragment_count = 0;
+   } else {
+     /* if 0, or non-existent, the length is infinite */
+     gchar *dvr_window_str = (gchar *) xmlGetProp (root,
+@@ -346,6 +377,17 @@ gst_mss_manifest_new (GstBuffer * data)
+         manifest->dvr_window = 0;
+       }
+     }
++
++    look_ahead_fragment_count_str =
++        (gchar *) xmlGetProp (root, (xmlChar *) "LookAheadFragmentCount");
++    if (look_ahead_fragment_count_str) {
++      manifest->look_ahead_fragment_count =
++          g_ascii_strtoull (look_ahead_fragment_count_str, NULL, 10);
++      xmlFree (look_ahead_fragment_count_str);
++      if (manifest->look_ahead_fragment_count <= 0) {
++        manifest->look_ahead_fragment_count = 0;
++      }
++    }
+   }
+ 
+   for (nodeiter = root->children; nodeiter; nodeiter = nodeiter->next) {
+@@ -354,7 +396,7 @@ gst_mss_manifest_new (GstBuffer * data)
+       GstMssStream *stream = g_new0 (GstMssStream, 1);
+ 
+       manifest->streams = g_slist_append (manifest->streams, stream);
+-      _gst_mss_stream_init (stream, nodeiter);
++      _gst_mss_stream_init (manifest, stream, nodeiter);
+     }
+ 
+     if (nodeiter->type == XML_ELEMENT_NODE
+@@ -371,6 +413,11 @@ gst_mss_manifest_new (GstBuffer * data)
+ static void
+ gst_mss_stream_free (GstMssStream * stream)
+ {
++  if (stream->live_adapter) {
++    gst_adapter_clear (stream->live_adapter);
++    g_object_unref (stream->live_adapter);
++  }
++
+   g_list_free_full (stream->fragments, g_free);
+   g_list_free_full (stream->qualities,
+       (GDestroyNotify) gst_mss_stream_quality_free);
+@@ -379,6 +426,7 @@ gst_mss_stream_free (GstMssStream * stream)
+   g_regex_unref (stream->regex_position);
+   g_regex_unref (stream->regex_bitrate);
+   g_free (stream);
++  gst_mss_fragment_parser_clear (&stream->fragment_parser);
+ }
+ 
+ void
+@@ -1079,6 +1127,9 @@ GstFlowReturn
+ gst_mss_stream_advance_fragment (GstMssStream * stream)
+ {
+   GstMssStreamFragment *fragment;
++  const gchar *stream_type_name =
++      gst_mss_stream_type_name (gst_mss_stream_get_type (stream));
++
+   g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
+ 
+   if (stream->current_fragment == NULL)
+@@ -1086,14 +1137,20 @@ gst_mss_stream_advance_fragment (GstMssStream * stream)
+ 
+   fragment = stream->current_fragment->data;
+   stream->fragment_repetition_index++;
+-  if (stream->fragment_repetition_index < fragment->repetitions) {
+-    return GST_FLOW_OK;
+-  }
++  if (stream->fragment_repetition_index < fragment->repetitions)
++    goto beach;
+ 
+   stream->fragment_repetition_index = 0;
+   stream->current_fragment = g_list_next (stream->current_fragment);
++
++  GST_DEBUG ("Advanced to fragment #%d on %s stream", fragment->number,
++      stream_type_name);
+   if (stream->current_fragment == NULL)
+     return GST_FLOW_EOS;
++
++beach:
++  gst_mss_fragment_parser_clear (&stream->fragment_parser);
++  gst_mss_fragment_parser_init (&stream->fragment_parser);
+   return GST_FLOW_OK;
+ }
+ 
+@@ -1173,6 +1230,11 @@ gst_mss_stream_seek (GstMssStream * stream, gboolean forward,
+   GST_DEBUG ("Stream %s seeking to %" G_GUINT64_FORMAT, stream->url, time);
+   for (iter = stream->fragments; iter; iter = g_list_next (iter)) {
+     fragment = iter->data;
++    if (stream->has_live_fragments) {
++      if (fragment->time + fragment->repetitions * fragment->duration > time)
++        stream->current_fragment = iter;
++      break;
++    }
+     if (fragment->time + fragment->repetitions * fragment->duration > time) {
+       stream->current_fragment = iter;
+       stream->fragment_repetition_index =
+@@ -1256,9 +1318,14 @@ static void
+ gst_mss_stream_reload_fragments (GstMssStream * stream, xmlNodePtr streamIndex)
+ {
+   xmlNodePtr iter;
+-  guint64 current_gst_time = gst_mss_stream_get_fragment_gst_timestamp (stream);
++  guint64 current_gst_time;
+   GstMssFragmentListBuilder builder;
+ 
++  if (stream->has_live_fragments)
++    return;
++
++  current_gst_time = gst_mss_stream_get_fragment_gst_timestamp (stream);
++
+   gst_mss_fragment_list_builder_init (&builder);
+ 
+   GST_DEBUG ("Current position: %" GST_TIME_FORMAT,
+@@ -1514,3 +1581,74 @@ gst_mss_manifest_get_live_seek_range (GstMssManifest * manifest, gint64 * start,
+ 
+   return ret;
+ }
++
++void
++gst_mss_manifest_live_adapter_push (GstMssStream * stream, GstBuffer * buffer)
++{
++  gst_adapter_push (stream->live_adapter, buffer);
++}
++
++gsize
++gst_mss_manifest_live_adapter_available (GstMssStream * stream)
++{
++  return gst_adapter_available (stream->live_adapter);
++}
++
++GstBuffer *
++gst_mss_manifest_live_adapter_take_buffer (GstMssStream * stream, gsize nbytes)
++{
++  return gst_adapter_take_buffer (stream->live_adapter, nbytes);
++}
++
++gboolean
++gst_mss_stream_fragment_parsing_needed (GstMssStream * stream)
++{
++  return stream->fragment_parser.status == GST_MSS_FRAGMENT_HEADER_PARSER_INIT;
++}
++
++void
++gst_mss_stream_parse_fragment (GstMssStream * stream, GstBuffer * buffer)
++{
++  GstMssStreamFragment *current_fragment = NULL;
++  const gchar *stream_type_name;
++  guint8 index;
++
++  if (!stream->has_live_fragments)
++    return;
++
++  if (!gst_mss_fragment_parser_add_buffer (&stream->fragment_parser, buffer))
++    return;
++
++  current_fragment = stream->current_fragment->data;
++  current_fragment->time = stream->fragment_parser.tfxd.time;
++  current_fragment->duration = stream->fragment_parser.tfxd.duration;
++
++  stream_type_name =
++      gst_mss_stream_type_name (gst_mss_stream_get_type (stream));
++
++  for (index = 0; index < stream->fragment_parser.tfrf.entries_count; index++) {
++    GList *l = g_list_last (stream->fragments);
++    GstMssStreamFragment *last;
++    GstMssStreamFragment *fragment;
++
++    if (l == NULL)
++      break;
++
++    last = (GstMssStreamFragment *) l->data;
++
++    if (last->time == stream->fragment_parser.tfrf.entries[index].time)
++      continue;
++
++    fragment = g_new (GstMssStreamFragment, 1);
++    fragment->number = last->number + 1;
++    fragment->repetitions = 1;
++    fragment->time = stream->fragment_parser.tfrf.entries[index].time;
++    fragment->duration = stream->fragment_parser.tfrf.entries[index].duration;
++
++    stream->fragments = g_list_append (stream->fragments, fragment);
++    GST_LOG ("Adding fragment number: %u to %s stream, time: %" G_GUINT64_FORMAT
++        ", duration: %" G_GUINT64_FORMAT ", repetitions: %u",
++        fragment->number, stream_type_name,
++        fragment->time, fragment->duration, fragment->repetitions);
++  }
++}
+diff --git a/ext/smoothstreaming/gstmssmanifest.h b/ext/smoothstreaming/gstmssmanifest.h
+index 6b7b1f971..03b066ae5 100644
+--- a/ext/smoothstreaming/gstmssmanifest.h
++++ b/ext/smoothstreaming/gstmssmanifest.h
+@@ -26,6 +26,7 @@
+ #include <glib.h>
+ #include <gio/gio.h>
+ #include <gst/gst.h>
++#include <gst/base/gstadapter.h>
+ 
+ G_BEGIN_DECLS
+ 
+@@ -73,5 +74,11 @@ const gchar * gst_mss_stream_get_lang (GstMssStream * stream);
+ 
+ const gchar * gst_mss_stream_type_name (GstMssStreamType streamtype);
+ 
++void gst_mss_manifest_live_adapter_push(GstMssStream * stream, GstBuffer * buffer);
++gsize gst_mss_manifest_live_adapter_available(GstMssStream * stream);
++GstBuffer * gst_mss_manifest_live_adapter_take_buffer(GstMssStream * stream, gsize nbytes);
++gboolean gst_mss_stream_fragment_parsing_needed(GstMssStream * stream);
++void gst_mss_stream_parse_fragment(GstMssStream * stream, GstBuffer * buffer);
++
+ G_END_DECLS
+ #endif /* __GST_MSS_MANIFEST_H__ */
+diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
+index 634e4f388..ddca726b6 100644
+--- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
++++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
+@@ -291,6 +291,9 @@ gst_adaptive_demux_wait_until (GstClock * clock, GCond * cond, GMutex * mutex,
+     GstClockTime end_time);
+ static gboolean gst_adaptive_demux_clock_callback (GstClock * clock,
+     GstClockTime time, GstClockID id, gpointer user_data);
++static gboolean
++gst_adaptive_demux_requires_periodical_playlist_update_default (GstAdaptiveDemux
++    * demux);
+ 
+ /* we can't use G_DEFINE_ABSTRACT_TYPE because we need the klass in the _init
+  * method to get to the padtemplates */
+@@ -412,6 +415,9 @@ gst_adaptive_demux_class_init (GstAdaptiveDemuxClass * klass)
+   klass->data_received = gst_adaptive_demux_stream_data_received_default;
+   klass->finish_fragment = gst_adaptive_demux_stream_finish_fragment_default;
+   klass->update_manifest = gst_adaptive_demux_update_manifest_default;
++  klass->requires_periodical_playlist_update =
++      gst_adaptive_demux_requires_periodical_playlist_update_default;
++
+ }
+ 
+ static void
+@@ -686,7 +692,9 @@ gst_adaptive_demux_sink_event (GstPad * pad, GstObject * parent,
+             demux->priv->stop_updates_task = FALSE;
+             g_mutex_unlock (&demux->priv->updates_timed_lock);
+             /* Task to periodically update the manifest */
+-            gst_task_start (demux->priv->updates_task);
++            if (demux_class->requires_periodical_playlist_update (demux)) {
++              gst_task_start (demux->priv->updates_task);
++            }
+           }
+         } else {
+           /* no streams */
+@@ -2125,6 +2133,13 @@ gst_adaptive_demux_stream_data_received_default (GstAdaptiveDemux * demux,
+   return gst_adaptive_demux_stream_push_buffer (stream, buffer);
+ }
+ 
++static gboolean
++gst_adaptive_demux_requires_periodical_playlist_update_default (GstAdaptiveDemux
++    * demux)
++{
++  return TRUE;
++}
++
+ static GstFlowReturn
+ _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
+ {
+@@ -3338,7 +3353,15 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
+       GST_DEBUG_OBJECT (stream->pad, "EOS, checking to stop download loop");
+       /* we push the EOS after releasing the object lock */
+       if (gst_adaptive_demux_is_live (demux)) {
+-        if (gst_adaptive_demux_stream_wait_manifest_update (demux, stream)) {
++        GstAdaptiveDemuxClass *demux_class =
++            GST_ADAPTIVE_DEMUX_GET_CLASS (demux);
++
++        /* this might be a fragment download error, refresh the manifest, just in case */
++        if (!demux_class->requires_periodical_playlist_update (demux)) {
++          ret = gst_adaptive_demux_update_manifest (demux);
++          break;
++        } else if (gst_adaptive_demux_stream_wait_manifest_update (demux,
++                stream)) {
+           goto end;
+         }
+         gst_task_stop (stream->download_task);
+diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.h b/gst-libs/gst/adaptivedemux/gstadaptivedemux.h
+index 780f4d93f..9a1a1b7d1 100644
+--- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.h
++++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.h
+@@ -459,6 +459,20 @@ struct _GstAdaptiveDemuxClass
+    * selected period.
+    */
+   GstClockTime (*get_period_start_time) (GstAdaptiveDemux *demux);
++
++  /**
++   * requires_periodical_playlist_update:
++   * @demux: #GstAdaptiveDemux
++   *
++   * Some adaptive streaming protocols allow the client to download
++   * the playlist once and build up the fragment list based on the
++   * current fragment metadata. For those protocols the demuxer
++   * doesn't need to periodically refresh the playlist. This vfunc
++   * is relevant only for live playback scenarios.
++   *
++   * Return: %TRUE if the playlist needs to be refreshed periodically by the demuxer.
++   */
++  gboolean (*requires_periodical_playlist_update) (GstAdaptiveDemux * demux);
+ };
+ 
+ GType    gst_adaptive_demux_get_type (void);
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-implement-adaptivedemux-s-get_live_s.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-implement-adaptivedemux-s-get_live_s.patch
new file mode 100644
index 0000000..76d29e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-implement-adaptivedemux-s-get_live_s.patch
@@ -0,0 +1,183 @@
+From e9178fa082116d4bf733b184a8b6951112c17900 Mon Sep 17 00:00:00 2001
+From: Matthew Waters <matthew@centricular.com>
+Date: Thu, 10 Nov 2016 17:18:36 +1100
+Subject: [PATCH] smoothstreaming: implement adaptivedemux's
+ get_live_seek_range()
+
+Allows seeking through the available fragments that are still available
+on the server as specified by the DVRWindowLength attribute in the
+manifest.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=774178
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ ext/smoothstreaming/gstmssdemux.c    | 13 ++++++
+ ext/smoothstreaming/gstmssmanifest.c | 84 ++++++++++++++++++++++++++++++++++++
+ ext/smoothstreaming/gstmssmanifest.h |  1 +
+ 3 files changed, 98 insertions(+)
+
+diff --git a/ext/smoothstreaming/gstmssdemux.c b/ext/smoothstreaming/gstmssdemux.c
+index 9d0aece2b..b66e19514 100644
+--- a/ext/smoothstreaming/gstmssdemux.c
++++ b/ext/smoothstreaming/gstmssdemux.c
+@@ -138,6 +138,8 @@ gst_mss_demux_get_manifest_update_interval (GstAdaptiveDemux * demux);
+ static GstFlowReturn
+ gst_mss_demux_update_manifest_data (GstAdaptiveDemux * demux,
+     GstBuffer * buffer);
++static gboolean gst_mss_demux_get_live_seek_range (GstAdaptiveDemux * demux,
++    gint64 * start, gint64 * stop);
+ 
+ static void
+ gst_mss_demux_class_init (GstMssDemuxClass * klass)
+@@ -192,6 +194,8 @@ gst_mss_demux_class_init (GstMssDemuxClass * klass)
+       gst_mss_demux_stream_update_fragment_info;
+   gstadaptivedemux_class->update_manifest_data =
+       gst_mss_demux_update_manifest_data;
++  gstadaptivedemux_class->get_live_seek_range =
++      gst_mss_demux_get_live_seek_range;
+ 
+   GST_DEBUG_CATEGORY_INIT (mssdemux_debug, "mssdemux", 0, "mssdemux plugin");
+ }
+@@ -659,3 +663,12 @@ gst_mss_demux_update_manifest_data (GstAdaptiveDemux * demux,
+   gst_mss_manifest_reload_fragments (mssdemux->manifest, buffer);
+   return GST_FLOW_OK;
+ }
++
++static gboolean
++gst_mss_demux_get_live_seek_range (GstAdaptiveDemux * demux, gint64 * start,
++    gint64 * stop)
++{
++  GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
++
++  return gst_mss_manifest_get_live_seek_range (mssdemux->manifest, start, stop);
++}
+diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
+index 1b72e8de1..317b3cef9 100644
+--- a/ext/smoothstreaming/gstmssmanifest.c
++++ b/ext/smoothstreaming/gstmssmanifest.c
+@@ -42,6 +42,7 @@ GST_DEBUG_CATEGORY_EXTERN (mssdemux_debug);
+ 
+ #define MSS_PROP_BITRATE              "Bitrate"
+ #define MSS_PROP_DURATION             "d"
++#define MSS_PROP_DVR_WINDOW_LENGTH    "DVRWindowLength"
+ #define MSS_PROP_LANGUAGE             "Language"
+ #define MSS_PROP_NUMBER               "n"
+ #define MSS_PROP_REPETITIONS          "r"
+@@ -94,6 +95,7 @@ struct _GstMssManifest
+   xmlNodePtr xmlrootnode;
+ 
+   gboolean is_live;
++  gint64 dvr_window;
+ 
+   GString *protection_system_id;
+   gchar *protection_data;
+@@ -330,6 +332,22 @@ gst_mss_manifest_new (GstBuffer * data)
+     xmlFree (live_str);
+   }
+ 
++  /* the entire file is always available for non-live streams */
++  if (!manifest->is_live) {
++    manifest->dvr_window = 0;
++  } else {
++    /* if 0, or non-existent, the length is infinite */
++    gchar *dvr_window_str = (gchar *) xmlGetProp (root,
++        (xmlChar *) MSS_PROP_DVR_WINDOW_LENGTH);
++    if (dvr_window_str) {
++      manifest->dvr_window = g_ascii_strtoull (dvr_window_str, NULL, 10);
++      xmlFree (dvr_window_str);
++      if (manifest->dvr_window <= 0) {
++        manifest->dvr_window = 0;
++      }
++    }
++  }
++
+   for (nodeiter = root->children; nodeiter; nodeiter = nodeiter->next) {
+     if (nodeiter->type == XML_ELEMENT_NODE
+         && (strcmp ((const char *) nodeiter->name, "StreamIndex") == 0)) {
+@@ -1406,3 +1424,69 @@ gst_mss_stream_get_lang (GstMssStream * stream)
+ {
+   return stream->lang;
+ }
++
++static GstClockTime
++gst_mss_manifest_get_dvr_window_length_clock_time (GstMssManifest * manifest)
++{
++  gint64 timescale;
++
++  /* the entire file is always available for non-live streams */
++  if (manifest->dvr_window == 0)
++    return GST_CLOCK_TIME_NONE;
++
++  timescale = gst_mss_manifest_get_timescale (manifest);
++  return (GstClockTime) gst_util_uint64_scale_round (manifest->dvr_window,
++      GST_SECOND, timescale);
++}
++
++static gboolean
++gst_mss_stream_get_live_seek_range (GstMssStream * stream, gint64 * start,
++    gint64 * stop)
++{
++  GList *l;
++  GstMssStreamFragment *fragment;
++  guint64 timescale = gst_mss_stream_get_timescale (stream);
++
++  g_return_val_if_fail (stream->active, FALSE);
++
++  /* XXX: assumes all the data in the stream is still available */
++  l = g_list_first (stream->fragments);
++  fragment = (GstMssStreamFragment *) l->data;
++  *start = gst_util_uint64_scale_round (fragment->time, GST_SECOND, timescale);
++
++  l = g_list_last (stream->fragments);
++  fragment = (GstMssStreamFragment *) l->data;
++  *stop = gst_util_uint64_scale_round (fragment->time + fragment->duration *
++      fragment->repetitions, GST_SECOND, timescale);
++
++  return TRUE;
++}
++
++gboolean
++gst_mss_manifest_get_live_seek_range (GstMssManifest * manifest, gint64 * start,
++    gint64 * stop)
++{
++  GSList *iter;
++  gboolean ret = FALSE;
++
++  for (iter = manifest->streams; iter; iter = g_slist_next (iter)) {
++    GstMssStream *stream = iter->data;
++
++    if (stream->active) {
++      /* FIXME: bound this correctly for multiple streams */
++      if (!(ret = gst_mss_stream_get_live_seek_range (stream, start, stop)))
++        break;
++    }
++  }
++
++  if (ret && gst_mss_manifest_is_live (manifest)) {
++    GstClockTime dvr_window =
++        gst_mss_manifest_get_dvr_window_length_clock_time (manifest);
++
++    if (GST_CLOCK_TIME_IS_VALID (dvr_window) && *stop - *start > dvr_window) {
++      *start = *stop - dvr_window;
++    }
++  }
++
++  return ret;
++}
+diff --git a/ext/smoothstreaming/gstmssmanifest.h b/ext/smoothstreaming/gstmssmanifest.h
+index af7419c23..6b7b1f971 100644
+--- a/ext/smoothstreaming/gstmssmanifest.h
++++ b/ext/smoothstreaming/gstmssmanifest.h
+@@ -54,6 +54,7 @@ void gst_mss_manifest_reload_fragments (GstMssManifest * manifest, GstBuffer * d
+ GstClockTime gst_mss_manifest_get_min_fragment_duration (GstMssManifest * manifest);
+ const gchar * gst_mss_manifest_get_protection_system_id (GstMssManifest * manifest);
+ const gchar * gst_mss_manifest_get_protection_data (GstMssManifest * manifest);
++gboolean gst_mss_manifest_get_live_seek_range (GstMssManifest * manifest, gint64 * start, gint64 * stop);
+ 
+ GstMssStreamType gst_mss_stream_get_type (GstMssStream *stream);
+ GstCaps * gst_mss_stream_get_caps (GstMssStream * stream);
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-use-the-duration-from-the-list-of-fr.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-use-the-duration-from-the-list-of-fr.patch
new file mode 100644
index 0000000..4e51040
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-use-the-duration-from-the-list-of-fr.patch
@@ -0,0 +1,62 @@
+From 0fbee8f37427b88339194b22ba9aa210772a8613 Mon Sep 17 00:00:00 2001
+From: Matthew Waters <matthew@centricular.com>
+Date: Thu, 10 Nov 2016 17:20:27 +1100
+Subject: [PATCH] smoothstreaming: use the duration from the list of fragments
+ if not present in the manifest
+
+Provides a more accurate duration for live streams that may be minutes
+or hours in front of the earliest fragment.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=774178
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ ext/smoothstreaming/gstmssmanifest.c | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
+index 317b3cef9..144bbb42d 100644
+--- a/ext/smoothstreaming/gstmssmanifest.c
++++ b/ext/smoothstreaming/gstmssmanifest.c
+@@ -888,6 +888,7 @@ gst_mss_manifest_get_duration (GstMssManifest * manifest)
+   gchar *duration;
+   guint64 dur = -1;
+ 
++  /* try the property */
+   duration =
+       (gchar *) xmlGetProp (manifest->xmlrootnode,
+       (xmlChar *) MSS_PROP_STREAM_DURATION);
+@@ -895,6 +896,29 @@ gst_mss_manifest_get_duration (GstMssManifest * manifest)
+     dur = g_ascii_strtoull (duration, NULL, 10);
+     xmlFree (duration);
+   }
++  /* else use the fragment list */
++  if (dur <= 0) {
++    guint64 max_dur = 0;
++    GSList *iter;
++
++    for (iter = manifest->streams; iter; iter = g_slist_next (iter)) {
++      GstMssStream *stream = iter->data;
++
++      if (stream->active) {
++        if (stream->fragments) {
++          GList *l = g_list_last (stream->fragments);
++          GstMssStreamFragment *fragment = (GstMssStreamFragment *) l->data;
++          guint64 frag_dur =
++              fragment->time + fragment->duration * fragment->repetitions;
++          max_dur = MAX (frag_dur, max_dur);
++        }
++      }
++    }
++
++    if (max_dur != 0)
++      dur = max_dur;
++  }
++
+   return dur;
+ }
+ 
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-enable-gldeinterlace-on-OpenGL-ES.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-enable-gldeinterlace-on-OpenGL-ES.patch
deleted file mode 100755
index 51f4eb4..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-enable-gldeinterlace-on-OpenGL-ES.patch
+++ /dev/null
@@ -1,634 +0,0 @@
-From 8a0e97f7e672301cc76e394855e8c7a3448b0249 Mon Sep 17 00:00:00 2001
-From: Haihua Hu <jared.hu@nxp.com>
-Date: Fri, 8 Apr 2016 16:47:15 +0800
-Subject: [PATCH 4/6] [glplugin] enable gldeinterlace on OpenGL ES
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-1.Porting the exist deinterlace shader and OpenGL callback
-  to be compatible with OpenGL ES.
-2.Add a our blur vertical shader to gldeinterlace.
-3.Add a property named “method” to let user choose which
-  deinterlace function to use. Default to choose blur vertical
-  method for better performance.
-
-Upstream-Status: Backport [1.9.1]
-
-https://bugzilla.gnome.org/show_bug.cgi?id=764873
-
-Signed-off-by: Haihua Hu <jared.hu@nxp.com>
----
- ext/gl/Makefile.am        |   4 +-
- ext/gl/gstgldeinterlace.c | 344 +++++++++++++++++++++++++++++++++++-----------
- ext/gl/gstgldeinterlace.h |   6 +-
- ext/gl/gstopengl.c        |  13 +-
- 4 files changed, 275 insertions(+), 92 deletions(-)
-
-diff --git a/ext/gl/Makefile.am b/ext/gl/Makefile.am
-index 5d55f54..46419a7 100644
---- a/ext/gl/Makefile.am
-+++ b/ext/gl/Makefile.am
-@@ -40,6 +40,7 @@ libgstopengl_la_SOURCES = \
- 	gstglfilterapp.c \
- 	gstglviewconvert.c \
- 	gstglstereosplit.c \
-+	gstgldeinterlace.c \
- 	gstglstereomix.c
- 
- noinst_HEADERS = \
-@@ -63,20 +64,19 @@ noinst_HEADERS = \
- 	gstglfilterapp.h \
- 	gstglstereosplit.h \
- 	gstglstereomix.h \
-+	gstgldeinterlace.h \
- 	gstglviewconvert.h
- 
- # full opengl required
- if USE_OPENGL
- libgstopengl_la_SOURCES += \
- 	gstglfilterglass.c \
--	gstgldeinterlace.c \
- 	gltestsrc.c \
- 	gstgltestsrc.c \
- 	gstglmosaic.c
- 
- noinst_HEADERS += \
- 	gstglfilterglass.h \
--	gstgldeinterlace.h \
- 	gltestsrc.h \
- 	gstgltestsrc.h \
- 	gstglmosaic.h \
-diff --git a/ext/gl/gstgldeinterlace.c b/ext/gl/gstgldeinterlace.c
-index bd0eff0..c1250dc 100644
---- a/ext/gl/gstgldeinterlace.c
-+++ b/ext/gl/gstgldeinterlace.c
-@@ -43,7 +43,8 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
- 
- enum
- {
--  PROP_0
-+  PROP_0,
-+  PROP_METHOD
- };
- 
- #define DEBUG_INIT \
-@@ -57,17 +58,23 @@ static void gst_gl_deinterlace_set_property (GObject * object,
- static void gst_gl_deinterlace_get_property (GObject * object,
-     guint prop_id, GValue * value, GParamSpec * pspec);
- 
-+static gboolean gst_gl_deinterlace_start (GstBaseTransform * trans);
- static gboolean gst_gl_deinterlace_reset (GstBaseTransform * trans);
--static gboolean gst_gl_deinterlace_init_shader (GstGLFilter * filter);
-+static gboolean gst_gl_deinterlace_init_fbo (GstGLFilter * filter);
- static gboolean gst_gl_deinterlace_filter (GstGLFilter * filter,
-     GstBuffer * inbuf, GstBuffer * outbuf);
- static gboolean gst_gl_deinterlace_filter_texture (GstGLFilter * filter,
-     guint in_tex, guint out_tex);
--static void gst_gl_deinterlace_callback (gint width, gint height,
-+static void gst_gl_deinterlace_vfir_callback (gint width, gint height,
-+    guint texture, gpointer stuff);
-+static void gst_gl_deinterlace_greedyh_callback (gint width, gint height,
-     guint texture, gpointer stuff);
- 
- /* *INDENT-OFF* */
- static const gchar *greedyh_fragment_source =
-+  "#ifdef GL_ES\n"
-+  "precision mediump float;\n"
-+  "#endif\n"
-   "uniform sampler2D tex;\n"
-   "uniform sampler2D tex_prev;\n"
-   "uniform float max_comb;\n"
-@@ -75,35 +82,35 @@ static const gchar *greedyh_fragment_source =
-   "uniform float motion_sense;\n"
-   "uniform float width;\n"
-   "uniform float height;\n"
-+  "varying vec2 v_texcoord;\n"
- 
-   "void main () {\n"
--  "  vec2 texcoord = gl_TexCoord[0].xy;\n"
--  "  if (int(mod(texcoord.y * height, 2.0)) == 0) {\n"
--  "    gl_FragColor = vec4(texture2D(tex_prev, texcoord).rgb, 1.0);\n"
-+  "  if (int(mod(v_texcoord.y * height, 2.0)) == 0) {\n"
-+  "    gl_FragColor = vec4(texture2D(tex_prev, v_texcoord).rgb, 1.0);\n"
-   "  } else {\n"
-   "    vec2 texcoord_L1_a1, texcoord_L3_a1, texcoord_L1, texcoord_L3, texcoord_L1_1, texcoord_L3_1;\n"
-   "    vec3 L1_a1, L3_a1, L1, L3, L1_1, L3_1;\n"
- 
--  "    texcoord_L1 = vec2(texcoord.x, texcoord.y - 1.0 / height);\n"
--  "    texcoord_L3 = vec2(texcoord.x, texcoord.y + 1.0 / height);\n"
-+  "    texcoord_L1 = vec2(v_texcoord.x, v_texcoord.y - 1.0 / height);\n"
-+  "    texcoord_L3 = vec2(v_texcoord.x, v_texcoord.y + 1.0 / height);\n"
-   "    L1 = texture2D(tex_prev, texcoord_L1).rgb;\n"
-   "    L3 = texture2D(tex_prev, texcoord_L3).rgb;\n"
--  "    if (texcoord.x == 1.0 && texcoord.y == 1.0) {\n"
-+  "    if (v_texcoord.x == 1.0 && v_texcoord.y == 1.0) {\n"
-   "      L1_1 = L1;\n"
-   "      L3_1 = L3;\n"
-   "    } else {\n"
--  "      texcoord_L1_1 = vec2(texcoord.x + 1.0 / width, texcoord.y - 1.0 / height);\n"
--  "      texcoord_L3_1 = vec2(texcoord.x + 1.0 / width, texcoord.y + 1.0 / height);\n"
-+  "      texcoord_L1_1 = vec2(v_texcoord.x + 1.0 / width, v_texcoord.y - 1.0 / height);\n"
-+  "      texcoord_L3_1 = vec2(v_texcoord.x + 1.0 / width, v_texcoord.y + 1.0 / height);\n"
-   "      L1_1 = texture2D(tex_prev, texcoord_L1_1).rgb;\n"
-   "      L3_1 = texture2D(tex_prev, texcoord_L3_1).rgb;\n"
-   "    }\n"
- 
--  "    if (int(ceil(texcoord.x + texcoord.y)) == 0) {\n"
-+  "    if (int(ceil(v_texcoord.x + v_texcoord.y)) == 0) {\n"
-   "      L1_a1 = L1;\n"
-   "      L3_a1 = L3;\n"
-   "    } else {\n"
--  "      texcoord_L1_a1 = vec2(texcoord.x - 1.0 / width, texcoord.y - 1.0 / height);\n"
--  "      texcoord_L3_a1 = vec2(texcoord.x - 1.0 / width, texcoord.y + 1.0 / height);\n"
-+  "      texcoord_L1_a1 = vec2(v_texcoord.x - 1.0 / width, v_texcoord.y - 1.0 / height);\n"
-+  "      texcoord_L3_a1 = vec2(v_texcoord.x - 1.0 / width, v_texcoord.y + 1.0 / height);\n"
-   "      L1_a1 = texture2D(tex_prev, texcoord_L1_a1).rgb;\n"
-   "      L3_a1 = texture2D(tex_prev, texcoord_L3_a1).rgb;\n"
-   "    }\n"
-@@ -113,8 +120,8 @@ static const gchar *greedyh_fragment_source =
-   "    vec3 avg_1 = (L1_1 + L3_1) / 2.0;\n"
-   "    vec3 avg_s = (avg_a1 + avg_1) / 2.0;\n"
-   "    vec3 avg_sc = (avg_s + avg) / 2.0;\n"
--  "    vec3 L2 = texture2D(tex, texcoord).rgb;\n"
--  "    vec3 LP2 = texture2D(tex_prev, texcoord).rgb;\n"
-+  "    vec3 L2 = texture2D(tex, v_texcoord).rgb;\n"
-+  "    vec3 LP2 = texture2D(tex_prev, v_texcoord).rgb;\n"
-   "    vec3 best;\n"
-   "    if (abs(L2.r - avg_sc.r) < abs(LP2.r - avg_sc.r)) {\n"
-   "      best.r = L2.r;\n" "    } else {\n"
-@@ -144,8 +151,87 @@ static const gchar *greedyh_fragment_source =
-   "    gl_FragColor = vec4(last, 1.0);\n"
-   "  }\n"
-   "}\n";
-+
-+const gchar *vfir_fragment_source =
-+  "#ifdef GL_ES\n"
-+  "precision mediump float;\n"
-+  "#endif\n"
-+  "uniform sampler2D tex;\n"
-+  "uniform float width;\n"
-+  "uniform float height;\n"
-+  "varying vec2 v_texcoord;\n"
-+  "void main()\n"
-+  "{\n"
-+  "  vec2 topcoord, botcoord;\n"
-+  "  vec4 cur_color, top_color, bot_color;\n"
-+  "  topcoord.x = v_texcoord.x;\n"
-+  "  botcoord.x = v_texcoord.x;\n"
-+  "  if (v_texcoord.y == 0.0 || v_texcoord.y == 1.0) {\n"
-+  "    topcoord.y = v_texcoord.y ;\n"
-+  "    botcoord.y = v_texcoord.y ;\n"
-+  "  }\n"
-+  "  else {\n"
-+  "    topcoord.y = v_texcoord.y - 1.0/height;\n"
-+  "    botcoord.y = v_texcoord.y + 1.0/height;\n"
-+  "  }\n"
-+  "  cur_color = texture2D(tex, v_texcoord);\n"
-+  "  top_color = texture2D(tex, topcoord);\n"
-+  "  bot_color = texture2D(tex, botcoord);\n"
-+  "  gl_FragColor = 0.5*cur_color + 0.25*top_color + 0.25*bot_color;\n"
-+  "}";
- /* *INDENT-ON* */
- 
-+/* dont' forget to edit the following when a new method is added */
-+typedef enum
-+{
-+  GST_GL_DEINTERLACE_VFIR,
-+  GST_GL_DEINTERLACE_GREEDYH
-+} GstGLDeinterlaceMethod;
-+
-+static const GEnumValue *
-+gst_gl_deinterlace_get_methods (void)
-+{
-+  static const GEnumValue method_types[] = {
-+    {GST_GL_DEINTERLACE_VFIR, "Blur Vertical", "vfir"},
-+    {GST_GL_DEINTERLACE_GREEDYH, "Motion Adaptive: Advanced Detection",
-+          "greedhy"},
-+    {0, NULL, NULL}
-+  };
-+  return method_types;
-+}
-+
-+#define GST_TYPE_GL_DEINTERLACE_METHODS (gst_gl_deinterlace_method_get_type ())
-+static GType
-+gst_gl_deinterlace_method_get_type (void)
-+{
-+  static GType gl_deinterlace_method_type = 0;
-+  if (!gl_deinterlace_method_type) {
-+    gl_deinterlace_method_type =
-+        g_enum_register_static ("GstGLDeinterlaceMethod",
-+        gst_gl_deinterlace_get_methods ());
-+  }
-+  return gl_deinterlace_method_type;
-+}
-+
-+static void
-+gst_gl_deinterlace_set_method (GstGLDeinterlace * deinterlace,
-+    guint method_types)
-+{
-+  switch (method_types) {
-+    case GST_GL_DEINTERLACE_VFIR:
-+      deinterlace->deinterlacefunc = gst_gl_deinterlace_vfir_callback;
-+      deinterlace->current_method = method_types;
-+      break;
-+    case GST_GL_DEINTERLACE_GREEDYH:
-+      deinterlace->deinterlacefunc = gst_gl_deinterlace_greedyh_callback;
-+      deinterlace->current_method = method_types;
-+      break;
-+    default:
-+      g_assert_not_reached ();
-+      break;
-+  }
-+}
-+
- static void
- gst_gl_deinterlace_class_init (GstGLDeinterlaceClass * klass)
- {
-@@ -163,25 +249,60 @@ gst_gl_deinterlace_class_init (GstGLDeinterlaceClass * klass)
-       "Deinterlacing based on fragment shaders",
-       "Julien Isorce <julien.isorce@mail.com>");
- 
-+  g_object_class_install_property (gobject_class,
-+      PROP_METHOD,
-+      g_param_spec_enum ("method",
-+          "Deinterlace Method",
-+          "Select which deinterlace method apply to GL video texture",
-+          GST_TYPE_GL_DEINTERLACE_METHODS,
-+          GST_GL_DEINTERLACE_VFIR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-+
-+  GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_deinterlace_start;
-   GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_deinterlace_reset;
- 
-   GST_GL_FILTER_CLASS (klass)->filter = gst_gl_deinterlace_filter;
-   GST_GL_FILTER_CLASS (klass)->filter_texture =
-       gst_gl_deinterlace_filter_texture;
--  GST_GL_FILTER_CLASS (klass)->init_fbo = gst_gl_deinterlace_init_shader;
-+  GST_GL_FILTER_CLASS (klass)->init_fbo = gst_gl_deinterlace_init_fbo;
- 
--  GST_GL_BASE_FILTER_CLASS (klass)->supported_gl_api = GST_GL_API_OPENGL;
-+  GST_GL_BASE_FILTER_CLASS (klass)->supported_gl_api =
-+      GST_GL_API_OPENGL | GST_GL_API_GLES2 | GST_GL_API_OPENGL3;
- }
- 
- static void
- gst_gl_deinterlace_init (GstGLDeinterlace * filter)
- {
--  filter->shader = NULL;
-+  filter->shaderstable = NULL;
-+  filter->deinterlacefunc = gst_gl_deinterlace_vfir_callback;
-+  filter->current_method = GST_GL_DEINTERLACE_VFIR;
-   filter->prev_buffer = NULL;
-   filter->prev_tex = 0;
- }
- 
- static gboolean
-+gst_gl_deinterlace_start (GstBaseTransform * trans)
-+{
-+  GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (trans);
-+
-+  deinterlace_filter->shaderstable = g_hash_table_new (g_str_hash, g_str_equal);
-+
-+  return GST_BASE_TRANSFORM_CLASS (parent_class)->start (trans);
-+}
-+
-+static void
-+gst_gl_deinterlace_ghash_func_clean (gpointer key, gpointer value,
-+    gpointer data)
-+{
-+  GstGLShader *shader = (GstGLShader *) value;
-+  GstGLFilter *filter = (GstGLFilter *) data;
-+
-+  //blocking call, wait the opengl thread has destroyed the shader
-+  gst_gl_context_del_shader (GST_GL_BASE_FILTER (filter)->context, shader);
-+
-+  value = NULL;
-+}
-+
-+static gboolean
- gst_gl_deinterlace_reset (GstBaseTransform * trans)
- {
-   GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (trans);
-@@ -189,10 +310,17 @@ gst_gl_deinterlace_reset (GstBaseTransform * trans)
-   gst_buffer_replace (&deinterlace_filter->prev_buffer, NULL);
- 
-   //blocking call, wait the opengl thread has destroyed the shader
--  if (deinterlace_filter->shader)
--    gst_gl_context_del_shader (GST_GL_BASE_FILTER (trans)->context,
--        deinterlace_filter->shader);
--  deinterlace_filter->shader = NULL;
-+  if (deinterlace_filter->shaderstable) {
-+    /* release shaders in the gl thread */
-+    g_hash_table_foreach (deinterlace_filter->shaderstable,
-+        gst_gl_deinterlace_ghash_func_clean, deinterlace_filter);
-+
-+    /* clean the htable without calling values destructors
-+     * because shaders have been released in the glthread
-+     * through the foreach func */
-+    g_hash_table_unref (deinterlace_filter->shaderstable);
-+    deinterlace_filter->shaderstable = NULL;
-+  }
- 
-   return GST_BASE_TRANSFORM_CLASS (parent_class)->stop (trans);
- }
-@@ -201,9 +329,12 @@ static void
- gst_gl_deinterlace_set_property (GObject * object, guint prop_id,
-     const GValue * value, GParamSpec * pspec)
- {
--  //GstGLDeinterlace *filter = GST_GL_DEINTERLACE (object);
-+  GstGLDeinterlace *filter = GST_GL_DEINTERLACE (object);
- 
-   switch (prop_id) {
-+    case PROP_METHOD:
-+      gst_gl_deinterlace_set_method (filter, g_value_get_enum (value));
-+      break;
-     default:
-       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-       break;
-@@ -214,9 +345,12 @@ static void
- gst_gl_deinterlace_get_property (GObject * object, guint prop_id,
-     GValue * value, GParamSpec * pspec)
- {
--  //GstGLDeinterlace *filter = GST_GL_DEINTERLACE (object);
-+  GstGLDeinterlace *filter = GST_GL_DEINTERLACE (object);
- 
-   switch (prop_id) {
-+    case PROP_METHOD:
-+      g_value_set_enum (value, filter->current_method);
-+      break;
-     default:
-       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-       break;
-@@ -224,13 +358,9 @@ gst_gl_deinterlace_get_property (GObject * object, guint prop_id,
- }
- 
- static gboolean
--gst_gl_deinterlace_init_shader (GstGLFilter * filter)
-+gst_gl_deinterlace_init_fbo (GstGLFilter * filter)
- {
--  GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (filter);
--
--  //blocking call, wait the opengl thread has compiled the shader
--  return gst_gl_context_gen_shader (GST_GL_BASE_FILTER (filter)->context, 0,
--      greedyh_fragment_source, &deinterlace_filter->shader);
-+  return TRUE;
- }
- 
- static gboolean
-@@ -241,7 +371,7 @@ gst_gl_deinterlace_filter_texture (GstGLFilter * filter, guint in_tex,
- 
-   //blocking call, use a FBO
-   gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
--      gst_gl_deinterlace_callback, deinterlace_filter);
-+      deinterlace_filter->deinterlacefunc, deinterlace_filter);
- 
-   return TRUE;
- }
-@@ -259,36 +389,104 @@ gst_gl_deinterlace_filter (GstGLFilter * filter, GstBuffer * inbuf,
-   return TRUE;
- }
- 
--//opengl scene, params: input texture (not the output filter->texture)
-+static GstGLShader *
-+gst_gl_deinterlace_get_fragment_shader (GstGLFilter * filter,
-+    const gchar * shader_name, const gchar * shader_source)
-+{
-+  GstGLShader *shader = NULL;
-+  GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (filter);
-+  GstGLContext *context = GST_GL_BASE_FILTER (filter)->context;
-+
-+  shader = g_hash_table_lookup (deinterlace_filter->shaderstable, shader_name);
-+
-+  if (!shader) {
-+    GError *error = NULL;
-+
-+    if (!(shader = gst_gl_shader_new_link_with_stages (context, &error,
-+                gst_glsl_stage_new_default_vertex (context),
-+                gst_glsl_stage_new_with_string (context, GL_FRAGMENT_SHADER,
-+                    GST_GLSL_VERSION_NONE,
-+                    GST_GLSL_PROFILE_ES | GST_GLSL_PROFILE_COMPATIBILITY,
-+                    shader_source), NULL))) {
-+      GST_ELEMENT_ERROR (deinterlace_filter, RESOURCE, NOT_FOUND,
-+          ("Failed to initialize %s shader", shader_name), (NULL));
-+    }
-+
-+    filter->draw_attr_position_loc =
-+        gst_gl_shader_get_attribute_location (shader, "a_position");
-+    filter->draw_attr_texture_loc =
-+        gst_gl_shader_get_attribute_location (shader, "a_texcoord");
-+  }
-+
-+  g_hash_table_insert (deinterlace_filter->shaderstable, (gchar *) shader_name,
-+      shader);
-+
-+  return shader;
-+}
-+
- static void
--gst_gl_deinterlace_callback (gint width, gint height, guint texture,
-+gst_gl_deinterlace_vfir_callback (gint width, gint height, guint texture,
-     gpointer stuff)
- {
--  GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (stuff);
-+  GstGLShader *shader;
-   GstGLFilter *filter = GST_GL_FILTER (stuff);
--  GstGLFuncs *gl = GST_GL_BASE_FILTER (filter)->context->gl_vtable;
-+  GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (filter);
-+  GstGLContext *context = GST_GL_BASE_FILTER (filter)->context;
-+  GstGLFuncs *gl = context->gl_vtable;
-+
-+  shader = gst_gl_deinterlace_get_fragment_shader (deinterlace_filter, "vfir",
-+      vfir_fragment_source);
-+
-+  if (!shader)
-+    return;
-+
-+#if GST_GL_HAVE_OPENGL
-+  if (USING_OPENGL (context)) {
-+    gl->MatrixMode (GL_PROJECTION);
-+    gl->LoadIdentity ();
-+  }
-+#endif
-+
-+  gst_gl_shader_use (shader);
-+
-+  gl->ActiveTexture (GL_TEXTURE0);
-+  gl->BindTexture (GL_TEXTURE_2D, texture);
-+
-+  gst_gl_shader_set_uniform_1i (shader, "tex", 0);
-+  gst_gl_shader_set_uniform_1f (shader, "width",
-+      GST_VIDEO_INFO_WIDTH (&filter->out_info));
-+  gst_gl_shader_set_uniform_1f (shader, "height",
-+      GST_VIDEO_INFO_HEIGHT (&filter->out_info));
-+
-+  gst_gl_filter_draw_texture (filter, texture, width, height);
-+}
-+
-+static void
-+gst_gl_deinterlace_greedyh_callback (gint width, gint height, guint texture,
-+    gpointer stuff)
-+{
-+  GstGLShader *shader;
-+  GstGLFilter *filter = GST_GL_FILTER (stuff);
-+  GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (filter);
-+  GstGLContext *context = GST_GL_BASE_FILTER (filter)->context;
-+  GstGLFuncs *gl = context->gl_vtable;
-   guint temp;
- 
--  GLfloat verts[] = { -1.0, -1.0,
--    1.0, -1.0,
--    1.0, 1.0,
--    -1.0, 1.0
--  };
--  GLfloat texcoords0[] = { 0.0f, 0.0f,
--    1.0f, 0.0f,
--    1.0f, 1.0f,
--    0.0f, 1.0f
--  };
--  GLfloat texcoords1[] = { 0.0f, 0.0f,
--    1.0f, 0.0f,
--    1.0f, 1.0f,
--    0.0f, 1.0f
--  };
-+  shader =
-+      gst_gl_deinterlace_get_fragment_shader (deinterlace_filter, "greedhy",
-+      greedyh_fragment_source);
- 
--  gl->MatrixMode (GL_PROJECTION);
--  gl->LoadIdentity ();
-+  if (!shader)
-+    return;
- 
--  gst_gl_shader_use (deinterlace_filter->shader);
-+#if GST_GL_HAVE_OPENGL
-+  if (USING_OPENGL (context)) {
-+    gl->MatrixMode (GL_PROJECTION);
-+    gl->LoadIdentity ();
-+  }
-+#endif
-+
-+  gst_gl_shader_use (shader);
- 
-   if (G_UNLIKELY (deinterlace_filter->prev_tex == 0)) {
-     gst_gl_context_gen_texture (GST_GL_BASE_FILTER (filter)->context,
-@@ -298,44 +496,24 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
-         GST_VIDEO_INFO_HEIGHT (&filter->out_info));
-   } else {
-     gl->ActiveTexture (GL_TEXTURE1);
--    gst_gl_shader_set_uniform_1i (deinterlace_filter->shader, "tex_prev", 1);
-+    gst_gl_shader_set_uniform_1i (shader, "tex_prev", 1);
-     gl->BindTexture (GL_TEXTURE_2D, deinterlace_filter->prev_tex);
-   }
- 
-   gl->ActiveTexture (GL_TEXTURE0);
--  gst_gl_shader_set_uniform_1i (deinterlace_filter->shader, "tex", 0);
-+  gl->BindTexture (GL_TEXTURE_2D, texture);
- 
--  gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "max_comb",
--      5.0f / 255.0f);
--  gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "motion_threshold",
--      25.0f / 255.0f);
--  gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "motion_sense",
--      30.0f / 255.0f);
-+  gst_gl_shader_set_uniform_1i (shader, "tex", 0);
-+  gst_gl_shader_set_uniform_1f (shader, "max_comb", 5.0f / 255.0f);
-+  gst_gl_shader_set_uniform_1f (shader, "motion_threshold", 25.0f / 255.0f);
-+  gst_gl_shader_set_uniform_1f (shader, "motion_sense", 30.0f / 255.0f);
- 
--  gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "width",
-+  gst_gl_shader_set_uniform_1f (shader, "width",
-       GST_VIDEO_INFO_WIDTH (&filter->out_info));
--  gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "height",
-+  gst_gl_shader_set_uniform_1f (shader, "height",
-       GST_VIDEO_INFO_HEIGHT (&filter->out_info));
- 
--  gl->ClientActiveTexture (GL_TEXTURE0);
--
--  gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
--  gl->EnableClientState (GL_VERTEX_ARRAY);
--
--  gl->VertexPointer (2, GL_FLOAT, 0, &verts);
--  gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords0);
--
--  gl->ClientActiveTexture (GL_TEXTURE1);
--  gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
--  gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords1);
--
--  gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
--
--  gl->DisableClientState (GL_VERTEX_ARRAY);
--  gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
--
--  gl->ClientActiveTexture (GL_TEXTURE0);
--  gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
-+  gst_gl_filter_draw_texture (filter, texture, width, height);
- 
-   if (texture == filter->in_tex_id) {
-     temp = filter->in_tex_id;
-diff --git a/ext/gl/gstgldeinterlace.h b/ext/gl/gstgldeinterlace.h
-index a81a2e7..58a9c0c 100644
---- a/ext/gl/gstgldeinterlace.h
-+++ b/ext/gl/gstgldeinterlace.h
-@@ -38,9 +38,13 @@ typedef struct _GstGLDeinterlaceClass GstGLDeinterlaceClass;
- struct _GstGLDeinterlace
- {
-   GstGLFilter  filter;
--  GstGLShader  *shader;
-+
-+  GLCB	       deinterlacefunc; 
-+  GHashTable   *shaderstable;
-   GstBuffer    *prev_buffer;
-   guint         prev_tex;
-+
-+  gint	       current_method;
- };
- 
- struct _GstGLDeinterlaceClass
-diff --git a/ext/gl/gstopengl.c b/ext/gl/gstopengl.c
-index 50676c4..135862a 100644
---- a/ext/gl/gstopengl.c
-+++ b/ext/gl/gstopengl.c
-@@ -62,6 +62,7 @@
- #include "gstglstereosplit.h"
- #include "gstglstereomix.h"
- #include "gstglviewconvert.h"
-+#include "gstgldeinterlace.h"
- 
- #if HAVE_GRAPHENE
- #include "gstgltransformation.h"
-@@ -77,7 +78,6 @@
- #include "gstgltestsrc.h"
- #include "gstglfilterglass.h"
- /* #include "gstglfilterreflectedscreen.h" */
--#include "gstgldeinterlace.h"
- #include "gstglmosaic.h"
- #if HAVE_PNG
- #include "gstgldifferencematte.h"
-@@ -226,6 +226,12 @@ plugin_init (GstPlugin * plugin)
-           GST_RANK_NONE, GST_TYPE_GL_STEREO_MIX)) {
-     return FALSE;
-   }
-+
-+  if (!gst_element_register (plugin, "gldeinterlace",
-+          GST_RANK_NONE, GST_TYPE_GL_DEINTERLACE)) {
-+    return FALSE;
-+  }
-+
- #if HAVE_JPEG
- #if HAVE_PNG
-   if (!gst_element_register (plugin, "gloverlay",
-@@ -250,11 +256,6 @@ plugin_init (GstPlugin * plugin)
-     return FALSE;
-   }
- #endif
--  if (!gst_element_register (plugin, "gldeinterlace",
--          GST_RANK_NONE, GST_TYPE_GL_DEINTERLACE)) {
--    return FALSE;
--  }
--
-   if (!gst_element_register (plugin, "glmosaic",
-           GST_RANK_NONE, GST_TYPE_GL_MOSAIC)) {
-     return FALSE;
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-glcolorconvert-implement-multiple-render-targets-for.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-glcolorconvert-implement-multiple-render-targets-for.patch
deleted file mode 100755
index 31d8e05..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-glcolorconvert-implement-multiple-render-targets-for.patch
+++ /dev/null
@@ -1,244 +0,0 @@
-From 127e517568490fc147211d8b2fb4da01cecbbeb5 Mon Sep 17 00:00:00 2001
-From: Matthew Waters <matthew@centricular.com>
-Date: Thu, 31 Mar 2016 19:50:28 +1100
-Subject: [PATCH 5/6] glcolorconvert: implement multiple render targets for
- GLES3
-
-There are numerous slight differences required between Desktop GL and GLES3 for
-multiple render targets.
-
-1. gl_FragData doesn't exist at all and one is required to use
-   'layout (location = ?) out ...' instead.
-2. gl_FragColor doesn't exist, same as 1
-3. texture2D() has been deprecated
-
-Fortunately most of these have been taken care of with GL3 and the shader
-mangling already exists so just expand the conditions they are used in.  The
-gl_FragData issue requires a new mangle pass though.  We also use this new
-pass on desktop GL for consistency.
-
-Upstream-Status: Backport [1.9.1]
-
----
- gst-libs/gst/gl/gstglcolorconvert.c | 125 ++++++++++++++++++++++++++++--------
- 1 file changed, 99 insertions(+), 26 deletions(-)
-
-diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c
-index 490ec54..f478faa 100644
---- a/gst-libs/gst/gl/gstglcolorconvert.c
-+++ b/gst-libs/gst/gl/gstglcolorconvert.c
-@@ -1802,10 +1802,11 @@ _mangle_sampler_type (const gchar * str, GstGLTextureTarget from,
- 
- static gchar *
- _mangle_varying_attribute (const gchar * str, guint shader_type,
--    GstGLAPI gl_api)
-+    GstGLAPI gl_api, guint gl_major, guint gl_minor)
- {
--  if (gl_api & GST_GL_API_OPENGL3) {
--    if (shader_type == GL_VERTEX_SHADER) {
-+  if (shader_type == GL_VERTEX_SHADER) {
-+    if ((gl_api & GST_GL_API_OPENGL3) || (gl_api & GST_GL_API_GLES2
-+            && gl_major >= 3)) {
-       gchar *tmp, *tmp2;
-       GRegex *regex;
- 
-@@ -1821,7 +1822,10 @@ _mangle_varying_attribute (const gchar * str, guint shader_type,
- 
-       g_free (tmp);
-       return tmp2;
--    } else if (shader_type == GL_FRAGMENT_SHADER) {
-+    }
-+  } else if (shader_type == GL_FRAGMENT_SHADER) {
-+    if ((gl_api & GST_GL_API_OPENGL3) || (gl_api & GST_GL_API_GLES2
-+            && gl_major > 3)) {
-       gchar *tmp;
-       GRegex *regex;
- 
-@@ -1837,28 +1841,48 @@ _mangle_varying_attribute (const gchar * str, guint shader_type,
- }
- 
- static gchar *
--_mangle_frag_color (const gchar * str)
-+_mangle_frag_color_data (const gchar * str)
- {
-   GRegex *regex;
--  gchar *ret;
-+  gchar *ret, *tmp;
- 
-   regex = g_regex_new ("gl_FragColor", 0, 0, NULL);
-   ret = g_regex_replace_literal (regex, str, -1, 0, "fragColor", 0, NULL);
-   g_regex_unref (regex);
- 
-+  tmp = ret;
-+  /* search and replace 'gl_FragData[NUM]' into fragColor_NUM */
-+  regex = g_regex_new ("gl_FragData\\[(\\d+)\\]", 0, 0, NULL);
-+  ret = g_regex_replace (regex, tmp, -1, 0, "fragColor_\\1", 0, NULL);
-+  g_regex_unref (regex);
-+  g_free (tmp);
-+
-   return ret;
- }
- 
- static void
--_mangle_version_profile_from_gl_api (GstGLAPI gl_api, GstGLSLVersion * version,
--    GstGLSLProfile * profile)
-+_mangle_version_profile_from_gl_api (GstGLAPI gl_api, gint gl_major,
-+    gint gl_minor, GstGLSLVersion * version, GstGLSLProfile * profile)
- {
-+  *version = GST_GLSL_VERSION_NONE;
-+  *profile = GST_GLSL_PROFILE_NONE;
-+
-   if (gl_api & GST_GL_API_OPENGL3) {
--    *version = GST_GLSL_VERSION_150;
--    *profile = GST_GLSL_PROFILE_NONE;
-+    if (gl_major > 3 || gl_minor >= 3) {
-+      *version = GST_GLSL_VERSION_330;
-+      *profile = GST_GLSL_PROFILE_CORE;
-+    } else {
-+      *version = GST_GLSL_VERSION_150;
-+      *profile = GST_GLSL_PROFILE_NONE;
-+    }
-   } else if (gl_api & GST_GL_API_GLES2) {
--    *version = GST_GLSL_VERSION_100;
--    *profile = GST_GLSL_PROFILE_ES;
-+    if (gl_major >= 3) {
-+      *version = GST_GLSL_VERSION_300;
-+      *profile = GST_GLSL_PROFILE_ES;
-+    } else if (gl_major >= 2) {
-+      *version = GST_GLSL_VERSION_100;
-+      *profile = GST_GLSL_PROFILE_ES;
-+    }
-   } else if (gl_api & GST_GL_API_OPENGL) {
-     *version = GST_GLSL_VERSION_110;
-     *profile = GST_GLSL_PROFILE_COMPATIBILITY;
-@@ -1867,22 +1891,28 @@ _mangle_version_profile_from_gl_api (GstGLAPI gl_api, GstGLSLVersion * version,
- 
- static gchar *
- _mangle_shader (const gchar * str, guint shader_type, GstGLTextureTarget from,
--    GstGLTextureTarget to, GstGLAPI gl_api, GstGLSLVersion * version,
--    GstGLSLProfile * profile)
-+    GstGLTextureTarget to, GstGLAPI gl_api, gint gl_major, gint gl_minor,
-+    GstGLSLVersion * version, GstGLSLProfile * profile)
- {
-   gchar *tmp, *tmp2;
- 
-+  _mangle_version_profile_from_gl_api (gl_api, gl_major, gl_minor, version,
-+      profile);
-   tmp = _mangle_texture_access (str, from, to, gl_api);
-   tmp2 = _mangle_sampler_type (tmp, from, to);
-   g_free (tmp);
--  tmp = _mangle_varying_attribute (tmp2, shader_type, gl_api);
-+  tmp =
-+      _mangle_varying_attribute (tmp2, shader_type, gl_api, gl_major, gl_minor);
-   g_free (tmp2);
--  if (shader_type == GL_FRAGMENT_SHADER && gl_api & GST_GL_API_OPENGL3) {
--    tmp2 = _mangle_frag_color (tmp);
--    g_free (tmp);
--    tmp = tmp2;
-+  if (shader_type == GL_FRAGMENT_SHADER) {
-+    if ((*profile == GST_GLSL_PROFILE_ES && *version >= GST_GLSL_VERSION_300)
-+        || (*profile == GST_GLSL_PROFILE_CORE
-+            && *version >= GST_GLSL_VERSION_150)) {
-+      tmp2 = _mangle_frag_color_data (tmp);
-+      g_free (tmp);
-+      tmp = tmp2;
-+    }
-   }
--  _mangle_version_profile_from_gl_api (gl_api, version, profile);
-   return tmp;
- }
- 
-@@ -1899,15 +1929,18 @@ _create_shader (GstGLColorConvert * convert)
-   const gchar *strings[2];
-   GError *error = NULL;
-   GstGLAPI gl_api;
-+  gint gl_major, gl_minor;
-   int i;
- 
-   gl_api = gst_gl_context_get_gl_api (convert->context);
-+  gst_gl_context_get_gl_version (convert->context, &gl_major, &gl_minor);
- 
-   ret = gst_gl_shader_new (convert->context);
- 
-   tmp =
-       _mangle_shader (text_vertex_shader, GL_VERTEX_SHADER, info->templ->target,
--      convert->priv->from_texture_target, gl_api, &version, &profile);
-+      convert->priv->from_texture_target, gl_api, gl_major, gl_minor, &version,
-+      &profile);
- 
-   tmp1 = gst_glsl_version_profile_to_string (version, profile);
-   version_str = g_strdup_printf ("#version %s\n", tmp1);
-@@ -1945,9 +1978,37 @@ _create_shader (GstGLColorConvert * convert)
-   if (info->templ->uniforms)
-     g_string_append (str, info->templ->uniforms);
- 
--  if (gl_api & GST_GL_API_OPENGL3) {
--    g_string_append_c (str, '\n');
--    g_string_append (str, "out vec4 fragColor;\n");
-+  g_string_append_c (str, '\n');
-+
-+  /* GL 3.3+ and GL ES 3.x */
-+  if ((profile == GST_GLSL_PROFILE_CORE && version >= GST_GLSL_VERSION_330)
-+      || (profile == GST_GLSL_PROFILE_ES && version >= GST_GLSL_VERSION_300)) {
-+    if (info->out_n_textures > 1) {
-+      gint i;
-+
-+      for (i = 0; i < info->out_n_textures; i++) {
-+        g_string_append_printf (str,
-+            "layout(location = %d) out vec4 fragColor_%d;\n", i, i);
-+      }
-+    } else {
-+      g_string_append (str, "layout (location = 0) out vec4 fragColor;\n");
-+    }
-+  } else if (profile == GST_GLSL_PROFILE_CORE
-+      && version >= GST_GLSL_VERSION_150) {
-+    /* no layout specifiers, use glBindFragDataLocation instead */
-+    if (info->out_n_textures > 1) {
-+      gint i;
-+
-+      for (i = 0; i < info->out_n_textures; i++) {
-+        gchar *var_name = g_strdup_printf ("fragColor_%d", i);
-+        g_string_append_printf (str, "out vec4 %s;\n", var_name);
-+        gst_gl_shader_bind_frag_data_location (ret, i, var_name);
-+        g_free (var_name);
-+      }
-+    } else {
-+      g_string_append (str, "out vec4 fragColor;\n");
-+      gst_gl_shader_bind_frag_data_location (ret, 0, "fragColor");
-+    }
-   }
- 
-   for (i = 0; i < MAX_FUNCTIONS; i++) {
-@@ -1959,7 +2020,19 @@ _create_shader (GstGLColorConvert * convert)
-     g_string_append_c (str, '\n');
-   }
- 
--  g_string_append (str, "\nvarying vec2 v_texcoord;\nvoid main (void) {\n");
-+  {
-+    const gchar *varying = NULL;
-+
-+    if ((profile == GST_GLSL_PROFILE_ES && version >= GST_GLSL_VERSION_300)
-+        || (profile == GST_GLSL_PROFILE_CORE
-+            && version >= GST_GLSL_VERSION_150)) {
-+      varying = "in";
-+    } else {
-+      varying = "varying";
-+    }
-+    g_string_append_printf (str, "\n%s vec2 v_texcoord;\nvoid main (void) {\n",
-+        varying);
-+  }
-   if (info->frag_body) {
-     g_string_append (str, "vec2 texcoord;\n");
-     if (convert->priv->from_texture_target == GST_GL_TEXTURE_TARGET_RECTANGLE
-@@ -1975,7 +2048,7 @@ _create_shader (GstGLColorConvert * convert)
-   tmp = g_string_free (str, FALSE);
-   info->frag_prog = _mangle_shader (tmp, GL_FRAGMENT_SHADER,
-       info->templ->target, convert->priv->from_texture_target, gl_api,
--      &version, &profile);
-+      gl_major, gl_minor, &version, &profile);
-   g_free (tmp);
- 
-   strings[1] = info->frag_prog;
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glcolorconvert-don-t-use-the-predefined-variable-nam.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glcolorconvert-don-t-use-the-predefined-variable-nam.patch
deleted file mode 100755
index b75f402..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glcolorconvert-don-t-use-the-predefined-variable-nam.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From b069672ace2b762f400ca6d318571cbedf5141f2 Mon Sep 17 00:00:00 2001
-From: Matthew Waters <matthew@centricular.com>
-Date: Thu, 31 Mar 2016 20:00:37 +1100
-Subject: [PATCH 1/3] glcolorconvert: don't use the predefined variable name
- sample
-
-Using 'sample' as a variable name is an error in GLES3
-
-Upstream-Status: Backport [1.9.1]
----
- gst-libs/gst/gl/gstglcolorconvert.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c
-index f478faa..c23624f 100644
---- a/gst-libs/gst/gl/gstglcolorconvert.c
-+++ b/gst-libs/gst/gl/gstglcolorconvert.c
-@@ -261,9 +261,9 @@ static const struct shader_templ templ_RGB_to_PLANAR_YUV =
-     "    for (int j = 0; j < int(chroma_sampling.y); j++) {\n"
-     "      int n = (i+1)*(j+1);\n"
-     "      delta.y = float(j);\n"
--    "      vec4 sample = texture2D(tex, (chroma_pos + delta) / unnormalization).%c%c%c%c;\n"
-+    "      vec4 s = texture2D(tex, (chroma_pos + delta) / unnormalization).%c%c%c%c;\n"
-            /* rolling average */
--    "      uv_texel = (float(n-1) * uv_texel + sample) / float(n);\n"
-+    "      uv_texel = (float(n-1) * uv_texel + s) / float(n);\n"
-     "    }\n"
-     "  }\n"
-     "}\n"
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-glshader-add-glBindFragDataLocation.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-glshader-add-glBindFragDataLocation.patch
deleted file mode 100755
index 57e9d1a..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-glshader-add-glBindFragDataLocation.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From 38221080181229d520522a20bcb1663ca19f7aff Mon Sep 17 00:00:00 2001
-From: Matthew Waters <matthew@centricular.com>
-Date: Thu, 31 Mar 2016 19:25:32 +1100
-Subject: [PATCH 2/3] glshader: add glBindFragDataLocation
-
-There are some cases where it's needed for binding in/out variables in shaders.
-e.g. glsl 150 (gl 3.2) doesn't support the 'layout (location = ?)' specifiers in
-the shader source so we have to bind them ourselves.
-
-Upstream-Status: Backport [1.9.1]
----
- gst-libs/gst/gl/glprototypes/shaders.h | 10 ++++++++++
- gst-libs/gst/gl/gstglshader.c          | 20 ++++++++++++++++++++
- gst-libs/gst/gl/gstglshader.h          |  1 +
- 3 files changed, 31 insertions(+)
-
-diff --git a/gst-libs/gst/gl/glprototypes/shaders.h b/gst-libs/gst/gl/glprototypes/shaders.h
-index 817e479..6d828db 100644
---- a/gst-libs/gst/gl/glprototypes/shaders.h
-+++ b/gst-libs/gst/gl/glprototypes/shaders.h
-@@ -362,3 +362,13 @@ GST_GL_EXT_FUNCTION (void, UniformMatrix3x4fv,
- GST_GL_EXT_FUNCTION (void, UniformMatrix4x3fv,
-                      (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
- GST_GL_EXT_END ()
-+
-+GST_GL_EXT_BEGIN (bind_frag_data,
-+                  GST_GL_API_OPENGL | GST_GL_API_OPENGL3,
-+                  3, 0,
-+                  255, 255,
-+                  "\0",
-+                  "\0")
-+GST_GL_EXT_FUNCTION (void, BindFragDataLocation,
-+                     (GLuint program, GLuint index, const GLchar * name))
-+GST_GL_EXT_END ()
-diff --git a/gst-libs/gst/gl/gstglshader.c b/gst-libs/gst/gl/gstglshader.c
-index 9d96784..9f09236 100644
---- a/gst-libs/gst/gl/gstglshader.c
-+++ b/gst-libs/gst/gl/gstglshader.c
-@@ -1306,3 +1306,23 @@ gst_gl_shader_bind_attribute_location (GstGLShader * shader, GLuint index,
- 
-   gl->BindAttribLocation (priv->program_handle, index, name);
- }
-+
-+void
-+gst_gl_shader_bind_frag_data_location (GstGLShader * shader,
-+    guint index, const gchar * name)
-+{
-+  GstGLShaderPrivate *priv;
-+  GstGLFuncs *gl;
-+
-+  g_return_if_fail (shader != NULL);
-+  if (!_ensure_program (shader))
-+    g_return_if_fail (shader->priv->program_handle);
-+  priv = shader->priv;
-+  gl = shader->context->gl_vtable;
-+  g_return_if_fail (gl->BindFragDataLocation);
-+
-+  GST_TRACE_OBJECT (shader, "binding program %i frag data \'%s\' location %i",
-+      (int) priv->program_handle, name, index);
-+
-+  gl->BindFragDataLocation (priv->program_handle, index, name);
-+}
-diff --git a/gst-libs/gst/gl/gstglshader.h b/gst-libs/gst/gl/gstglshader.h
-index 21410e2..2200b89 100644
---- a/gst-libs/gst/gl/gstglshader.h
-+++ b/gst-libs/gst/gl/gstglshader.h
-@@ -104,6 +104,7 @@ void gst_gl_shader_set_uniform_matrix_4x3fv (GstGLShader *shader, const gchar *n
- 
- gint gst_gl_shader_get_attribute_location  (GstGLShader *shader, const gchar *name);
- void gst_gl_shader_bind_attribute_location (GstGLShader * shader, guint index, const gchar * name);
-+void gst_gl_shader_bind_frag_data_location (GstGLShader * shader, guint index, const gchar * name);
- 
- G_END_DECLS
- 
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0006-glcolorconvert-GLES3-deprecates-texture2D-and-it-doe.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0006-glcolorconvert-GLES3-deprecates-texture2D-and-it-doe.patch
deleted file mode 100755
index 79ef4c8..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0006-glcolorconvert-GLES3-deprecates-texture2D-and-it-doe.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 764fd69f8482eca9f925cefe72ebae090ae59d43 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
-Date: Tue, 19 Apr 2016 19:27:33 +0300
-Subject: [PATCH 3/3] glcolorconvert: GLES3 deprecates texture2D() and it does
- not work at all in newer versions than 3.3
-
-Use the newer texture() function instead. This fixes glimagesink and other
-things on various Android devices.
-
-Upstream-Status: Backport [1.9.1]
-
-https://bugzilla.gnome.org/show_bug.cgi?id=765266
----
- gst-libs/gst/gl/gstglcolorconvert.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c
-index c23624f..f472d5d 100644
---- a/gst-libs/gst/gl/gstglcolorconvert.c
-+++ b/gst-libs/gst/gl/gstglcolorconvert.c
-@@ -1716,7 +1716,7 @@ _unbind_buffer (GstGLColorConvert * convert)
- 
- static gchar *
- _mangle_texture_access (const gchar * str, GstGLTextureTarget from,
--    GstGLTextureTarget to, GstGLAPI gl_api)
-+    GstGLTextureTarget to, GstGLAPI gl_api, guint gl_major, guint gl_minor)
- {
-   const gchar *from_str = NULL, *to_str = NULL;
-   gchar *ret, *tmp;
-@@ -1730,7 +1730,8 @@ _mangle_texture_access (const gchar * str, GstGLTextureTarget from,
-   if (from == GST_GL_TEXTURE_TARGET_EXTERNAL_OES)
-     from_str = "texture2D";
- 
--  if (gl_api & GST_GL_API_OPENGL3) {
-+  if ((gl_api & GST_GL_API_OPENGL3) || (gl_api & GST_GL_API_GLES2
-+          && gl_major >= 3)) {
-     to_str = "texture";
-   } else {
-     if (to == GST_GL_TEXTURE_TARGET_2D)
-@@ -1898,7 +1899,7 @@ _mangle_shader (const gchar * str, guint shader_type, GstGLTextureTarget from,
- 
-   _mangle_version_profile_from_gl_api (gl_api, gl_major, gl_minor, version,
-       profile);
--  tmp = _mangle_texture_access (str, from, to, gl_api);
-+  tmp = _mangle_texture_access (str, from, to, gl_api, gl_major, gl_minor);
-   tmp2 = _mangle_sampler_type (tmp, from, to);
-   g_free (tmp);
-   tmp =
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-gl-implement-GstGLMemoryEGL.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-gl-implement-GstGLMemoryEGL.patch
deleted file mode 100644
index a67381c..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-gl-implement-GstGLMemoryEGL.patch
+++ /dev/null
@@ -1,495 +0,0 @@
-From 806bbe75b0b6947f589bce3960c28fee51b5c6c2 Mon Sep 17 00:00:00 2001
-From: Gwang Yoon Hwang <yoon@igalia.com>
-Date: Thu, 21 Jan 2016 22:18:17 +0900
-Subject: [PATCH] gl: implement GstGLMemoryEGL
-
-Because current GstEGLImageMemory does not inherit GstGLMemory, GLUpload
-allocates additional GLMemory and upload the decoded contents from the decoder
-which uses EGLImage (e.g. gst-omx in RPi).
-
-This work adds GstGLMemoryEGL to avoid this overhead. Decoders allocate
-GstGLMemoryEGL and decode its contents to the EGLImage of GstGLMemoryEGL.  And
-GLUpload uses this memory without allocation of additional textures and blit
-operations.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=760916
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- gst-libs/gst/gl/egl/Makefile.am        |   2 +
- gst-libs/gst/gl/egl/gstgldisplay_egl.c |   2 +
- gst-libs/gst/gl/egl/gstglmemoryegl.c   | 241 +++++++++++++++++++++++++++++++++
- gst-libs/gst/gl/egl/gstglmemoryegl.h   | 108 +++++++++++++++
- gst-libs/gst/gl/gstgl_fwd.h            |   4 +
- gst-libs/gst/gl/gstgldisplay.c         |   2 +
- gst-libs/gst/gl/gstglupload.c          |   8 ++
- 7 files changed, 367 insertions(+)
- create mode 100644 gst-libs/gst/gl/egl/gstglmemoryegl.c
- create mode 100644 gst-libs/gst/gl/egl/gstglmemoryegl.h
-
-diff --git a/gst-libs/gst/gl/egl/Makefile.am b/gst-libs/gst/gl/egl/Makefile.am
-index b808178..878f16c 100644
---- a/gst-libs/gst/gl/egl/Makefile.am
-+++ b/gst-libs/gst/gl/egl/Makefile.am
-@@ -5,6 +5,7 @@ noinst_LTLIBRARIES = libgstgl-egl.la
- libgstgl_egl_la_SOURCES = \
- 	gstgldisplay_egl.c \
- 	gstglcontext_egl.c \
-+	gstglmemoryegl.c \
- 	gsteglimagememory.c
- 
- noinst_HEADERS =
-@@ -13,6 +14,7 @@ libgstgl_eglincludedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst/gl/egl
- libgstgl_eglinclude_HEADERS = \
- 	gstgldisplay_egl.h \
- 	gstglcontext_egl.h \
-+	gstglmemoryegl.h \
- 	gsteglimagememory.h \
- 	gstegl.h
- 
-diff --git a/gst-libs/gst/gl/egl/gstgldisplay_egl.c b/gst-libs/gst/gl/egl/gstgldisplay_egl.c
-index 9acf4f0..20816c2 100644
---- a/gst-libs/gst/gl/egl/gstgldisplay_egl.c
-+++ b/gst-libs/gst/gl/egl/gstgldisplay_egl.c
-@@ -24,6 +24,7 @@
- 
- #include <gst/gl/egl/gstgldisplay_egl.h>
- #include <gst/gl/egl/gsteglimagememory.h>
-+#include <gst/gl/egl/gstglmemoryegl.h>
- 
- GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug);
- #define GST_CAT_DEFAULT gst_gl_display_debug
-@@ -51,6 +52,7 @@ gst_gl_display_egl_init (GstGLDisplayEGL * display_egl)
-   display_egl->foreign_display = FALSE;
- 
-   gst_egl_image_memory_init ();
-+  gst_gl_memory_egl_init_once ();
- }
- 
- static void
-diff --git a/gst-libs/gst/gl/egl/gstglmemoryegl.c b/gst-libs/gst/gl/egl/gstglmemoryegl.c
-new file mode 100644
-index 0000000..03cf432
---- /dev/null
-+++ b/gst-libs/gst/gl/egl/gstglmemoryegl.c
-@@ -0,0 +1,241 @@
-+/*
-+ * GStreamer
-+ * Copyright (C) 2012 Collabora Ltd.
-+ *   @author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
-+ * Copyright (C) 2014 Julien Isorce <julien.isorce@gmail.com>
-+ * Copyright (C) 2015 Igalia
-+ *    Author: Gwang Yoon Hwang <yoon@igalia.com>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-+ * Boston, MA 02110-1301, USA.
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#include "config.h"
-+#endif
-+
-+#include <string.h>
-+
-+#include <gst/gl/egl/gstglmemoryegl.h>
-+
-+static GstAllocator *_gl_memory_egl_allocator;
-+
-+GST_DEBUG_CATEGORY_STATIC (GST_CAT_GL_MEMORY);
-+#define GST_CAT_DEFAULT GST_CAT_GL_MEMORY
-+
-+#define parent_class gst_gl_memory_egl_allocator_parent_class
-+G_DEFINE_TYPE (GstGLMemoryEGLAllocator, gst_gl_memory_egl_allocator,
-+    GST_TYPE_GL_MEMORY_ALLOCATOR);
-+
-+gboolean
-+gst_is_gl_memory_egl (GstMemory * mem)
-+{
-+  return mem != NULL && mem->allocator != NULL
-+      && g_type_is_a (G_OBJECT_TYPE (mem->allocator),
-+      GST_TYPE_GL_MEMORY_EGL_ALLOCATOR);
-+}
-+
-+static GstGLMemoryEGL *
-+_gl_mem_get_parent (GstGLMemoryEGL * gl_mem)
-+{
-+  GstGLMemoryEGL *parent = (GstGLMemoryEGL *)gl_mem->mem.mem.mem.parent;
-+  return parent ? parent : gl_mem;
-+}
-+
-+EGLImageKHR
-+gst_gl_memory_egl_get_image (GstGLMemoryEGL * mem)
-+{
-+  g_return_val_if_fail (gst_is_gl_memory_egl (GST_MEMORY_CAST (mem)),
-+                        EGL_NO_IMAGE_KHR);
-+  return _gl_mem_get_parent(mem)->image;
-+}
-+
-+EGLDisplay
-+gst_gl_memory_egl_get_display (GstGLMemoryEGL * mem)
-+{
-+  g_return_val_if_fail (gst_is_gl_memory_egl (GST_MEMORY_CAST (mem)), NULL);
-+  return GST_GL_CONTEXT_EGL(_gl_mem_get_parent(mem))->egl_display;
-+}
-+
-+GstVideoGLTextureOrientation
-+gst_gl_memory_egl_get_orientation (GstGLMemoryEGL * mem)
-+{
-+  g_return_val_if_fail (gst_is_gl_memory_egl (GST_MEMORY_CAST (mem)),
-+      GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_NORMAL);
-+
-+  return _gl_mem_get_parent(mem)->orientation;
-+}
-+
-+void
-+gst_gl_memory_egl_set_orientation (GstGLMemoryEGL * mem,
-+    GstVideoGLTextureOrientation orientation)
-+{
-+  g_return_if_fail (gst_is_gl_memory_egl (GST_MEMORY_CAST (mem)));
-+
-+  _gl_mem_get_parent(mem)->orientation = orientation;
-+}
-+
-+static GstMemory *
-+_gl_mem_alloc (GstAllocator * allocator, gsize size,
-+               GstAllocationParams * params)
-+{
-+  g_warning ("Use gst_gl_base_memory_allocator_alloc() to allocate from this "
-+      "GstGLMemoryEGL allocator");
-+
-+  return NULL;
-+}
-+
-+static void
-+_gl_mem_destroy (GstGLMemoryEGL * mem)
-+{
-+  /* Shared memory should not destroy all the data */
-+  if (!mem->mem.mem.mem.parent) {
-+    GstGLContextEGL *context = GST_GL_CONTEXT_EGL(mem->mem.mem.context);
-+    context->eglDestroyImage (context->egl_display, mem->image);
-+  }
-+
-+  GST_GL_BASE_MEMORY_ALLOCATOR_CLASS (parent_class)->destroy ((GstGLBaseMemory
-+          *) mem);
-+}
-+
-+static void
-+_gl_mem_init (GstGLMemoryEGL * mem, GstAllocator * allocator,
-+    GstMemory * parent, GstGLContext * context, GstGLTextureTarget target,
-+    GstAllocationParams * params, GstVideoInfo * info,
-+    guint plane, GstVideoAlignment * valign, gpointer user_data,
-+    GDestroyNotify notify)
-+{
-+  gst_gl_memory_init ((GstGLMemory *) mem, allocator, parent,
-+      context, target, params, info, plane, valign, user_data, notify);
-+}
-+
-+static GstGLMemoryEGL *
-+_gl_mem_egl_alloc (GstGLBaseMemoryAllocator * allocator,
-+    GstGLVideoAllocationParams * params)
-+{
-+  guint alloc_flags = params->parent.alloc_flags;
-+  GstGLMemoryEGL *mem;
-+
-+  g_return_val_if_fail (alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO,
-+      NULL);
-+  g_return_val_if_fail ((alloc_flags &
-+      GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE) == 0, NULL);
-+  g_return_val_if_fail ((alloc_flags &
-+      GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM) == 0, NULL);
-+
-+  mem = g_new0 (GstGLMemoryEGL, 1);
-+  mem->image = EGL_NO_IMAGE_KHR;
-+
-+  _gl_mem_init (mem, GST_ALLOCATOR_CAST (allocator), NULL,
-+      params->parent.context, params->target, params->parent.alloc_params,
-+      params->v_info, params->plane, params->valign, params->parent.user_data,
-+      params->parent.notify);
-+
-+  return mem;
-+}
-+
-+static gboolean
-+_gl_mem_create (GstGLMemoryEGL * gl_mem, GError ** error)
-+{
-+  GstGLContextEGL *context = GST_GL_CONTEXT_EGL (gl_mem->mem.mem.context);
-+  GstGLBaseMemoryAllocatorClass *alloc_class;
-+
-+  if (!gst_gl_context_check_feature (GST_GL_CONTEXT (context),
-+                                     "EGL_KHR_image_base")) {
-+    g_set_error (error, GST_GL_CONTEXT_ERROR, GST_GL_CONTEXT_ERROR_WRONG_API,
-+                 "EGL_KHR_image_base is not supported");
-+    return FALSE;
-+  }
-+
-+  alloc_class = GST_GL_BASE_MEMORY_ALLOCATOR_CLASS (parent_class);
-+  if (!alloc_class->create ((GstGLBaseMemory *) gl_mem, error))
-+    return FALSE;
-+
-+  gl_mem->image = context->eglCreateImage (context->egl_display,
-+      context->egl_context, EGL_GL_TEXTURE_2D_KHR,
-+      (EGLClientBuffer) GSIZE_TO_POINTER (gl_mem->mem.tex_id), NULL);
-+
-+  GST_TRACE ("Generating EGLImage handle:%p from a texture:%u",
-+              gl_mem->image, gl_mem->mem.tex_id);
-+
-+  if (eglGetError () != EGL_SUCCESS) {
-+    g_set_error (error, GST_GL_CONTEXT_ERROR, GST_GL_CONTEXT_ERROR_FAILED,
-+                 "Failed to create EGLImage");
-+    return FALSE;
-+  }
-+
-+  return TRUE;
-+}
-+
-+static GstMemory *
-+_gl_mem_copy (GstGLMemoryEGL * src, gssize offset, gssize size)
-+{
-+  GST_CAT_ERROR (GST_CAT_GL_MEMORY, "GstGLMemoryEGL does not support copy");
-+  return NULL;
-+}
-+
-+static void
-+gst_gl_memory_egl_allocator_class_init (GstGLMemoryEGLAllocatorClass * klass)
-+{
-+  GstGLBaseMemoryAllocatorClass *gl_base;
-+  GstGLMemoryAllocatorClass *gl_tex;
-+  GstAllocatorClass *allocator_class;
-+
-+  gl_tex = (GstGLMemoryAllocatorClass *) klass;
-+  gl_base = (GstGLBaseMemoryAllocatorClass *) klass;
-+  allocator_class = (GstAllocatorClass *) klass;
-+
-+  gl_base->alloc = (GstGLBaseMemoryAllocatorAllocFunction) _gl_mem_egl_alloc;
-+  gl_base->create = (GstGLBaseMemoryAllocatorCreateFunction) _gl_mem_create;
-+  gl_base->destroy = (GstGLBaseMemoryAllocatorDestroyFunction) _gl_mem_destroy;
-+  gl_tex->copy = (GstGLBaseMemoryAllocatorCopyFunction) _gl_mem_copy;
-+
-+  allocator_class->alloc = _gl_mem_alloc;
-+}
-+
-+static void
-+gst_gl_memory_egl_allocator_init (GstGLMemoryEGLAllocator * allocator)
-+{
-+  GstAllocator *alloc = GST_ALLOCATOR_CAST (allocator);
-+
-+  alloc->mem_type = GST_GL_MEMORY_EGL_ALLOCATOR_NAME;
-+
-+  GST_OBJECT_FLAG_SET (allocator, GST_ALLOCATOR_FLAG_CUSTOM_ALLOC);
-+}
-+
-+/**
-+ * gst_gl_memory_egl_init_once:
-+ *
-+ * Initializes the GL Memory allocator. It is safe to call this function
-+ * multiple times.  This must be called before any other GstGLMemoryEGL operation.
-+ */
-+void
-+gst_gl_memory_egl_init_once (void)
-+{
-+  static volatile gsize _init = 0;
-+
-+  if (g_once_init_enter (&_init)) {
-+    gst_gl_memory_init_once ();
-+
-+    GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_MEMORY, "glmemory", 0,
-+        "OpenGL Texture with EGLImage memory");
-+
-+    _gl_memory_egl_allocator = g_object_new (GST_TYPE_GL_MEMORY_EGL_ALLOCATOR, NULL);
-+
-+    gst_allocator_register (GST_GL_MEMORY_EGL_ALLOCATOR_NAME,
-+        gst_object_ref (_gl_memory_egl_allocator));
-+    g_once_init_leave (&_init, 1);
-+  }
-+}
-diff --git a/gst-libs/gst/gl/egl/gstglmemoryegl.h b/gst-libs/gst/gl/egl/gstglmemoryegl.h
-new file mode 100644
-index 0000000..7256d33
---- /dev/null
-+++ b/gst-libs/gst/gl/egl/gstglmemoryegl.h
-@@ -0,0 +1,108 @@
-+/*
-+ * GStreamer
-+ * Copyright (C) 2012 Collabora Ltd.
-+ *   @author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
-+ * Copyright (C) 2014 Julien Isorce <julien.isorce@gmail.com>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-+ * Boston, MA 02110-1301, USA.
-+ */
-+
-+#ifndef _GST_GL_MEMORY_EGL_H_
-+#define _GST_GL_MEMORY_EGL_H_
-+
-+#include <gst/gst.h>
-+#include <gst/gstallocator.h>
-+#include <gst/gstmemory.h>
-+#include <gst/video/video.h>
-+
-+#include <gst/gl/gl.h>
-+#include "gstglcontext_egl.h"
-+
-+#include <gst/gl/gstglmemory.h>
-+
-+G_BEGIN_DECLS
-+
-+#define GST_TYPE_GL_MEMORY_EGL_ALLOCATOR (gst_gl_memory_egl_allocator_get_type())
-+GType gst_gl_memory_egl_allocator_get_type(void);
-+
-+#define GST_IS_GL_MEMORY_EGL_ALLOCATOR(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR))
-+#define GST_IS_GL_MEMORY_EGL_ALLOCATOR_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR))
-+#define GST_GL_MEMORY_EGL_ALLOCATOR_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR, GstGLMemoryEGLAllocatorClass))
-+#define GST_GL_MEMORY_EGL_ALLOCATOR(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR, GstGLMemoryEGLAllocator))
-+#define GST_GL_MEMORY_EGL_ALLOCATOR_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR, GstGLAllocatorClass))
-+#define GST_GL_MEMORY_EGL_ALLOCATOR_CAST(obj)            ((GstGLMemoryEGLAllocator *)(obj))
-+
-+typedef void (*GstEGLImageDestroyNotify) (GstGLContextEGL * context,
-+    gpointer data);
-+
-+typedef struct _GstEGLImageMemory GstEGLImageMemory;
-+
-+
-+/**
-+ * GstGLMemoryEGL:
-+ *
-+ * Private instance
-+ */
-+struct _GstGLMemoryEGL
-+{
-+  GstGLMemory mem;
-+
-+  EGLImageKHR image;
-+  GstVideoGLTextureOrientation orientation;
-+};
-+
-+/**
-+ * GST_GL_MEMORY_EGL_ALLOCATOR:
-+ *
-+ * The name of the GL Memory EGL allocator
-+ */
-+#define GST_GL_MEMORY_EGL_ALLOCATOR_NAME "GLMemoryEGL"
-+
-+void          gst_gl_memory_egl_init_once               (void);
-+gboolean      gst_is_gl_memory_egl                      (GstMemory * mem);
-+
-+EGLImageKHR   gst_gl_memory_egl_get_image               (GstGLMemoryEGL * mem);
-+EGLDisplay    gst_gl_memory_egl_get_display             (GstGLMemoryEGL * mem);
-+
-+GstVideoGLTextureOrientation gst_gl_memory_egl_get_orientation
-+                                                        (GstGLMemoryEGL * mem);
-+
-+void          gst_gl_memory_egl_set_orientation         (GstGLMemoryEGL * mem,
-+                                      GstVideoGLTextureOrientation orientation);
-+
-+/**
-+ * GstGLAllocator
-+ *
-+ * Opaque #GstGLAllocator struct
-+ */
-+struct _GstGLMemoryEGLAllocator
-+{
-+  GstGLMemoryAllocator parent;
-+};
-+
-+/**
-+ * GstGLAllocatorClass:
-+ *
-+ * The #GstGLAllocatorClass only contains private data
-+ */
-+struct _GstGLMemoryEGLAllocatorClass
-+{
-+  GstGLMemoryAllocatorClass parent_class;
-+};
-+
-+G_END_DECLS
-+
-+#endif /* _GST_GL_MEMORY_EGL_H_ */
-diff --git a/gst-libs/gst/gl/gstgl_fwd.h b/gst-libs/gst/gl/gstgl_fwd.h
-index fb64ff6..73e17bd 100644
---- a/gst-libs/gst/gl/gstgl_fwd.h
-+++ b/gst-libs/gst/gl/gstgl_fwd.h
-@@ -55,6 +55,10 @@ typedef struct _GstGLMemoryPBO GstGLMemoryPBO;
- typedef struct _GstGLMemoryPBOAllocator GstGLMemoryPBOAllocator;
- typedef struct _GstGLMemoryPBOAllocatorClass GstGLMemoryPBOAllocatorClass;
- 
-+typedef struct _GstGLMemoryEGL GstGLMemoryEGL;
-+typedef struct _GstGLMemoryEGLAllocator GstGLMemoryEGLAllocator;
-+typedef struct _GstGLMemoryEGLAllocatorClass GstGLMemoryEGLAllocatorClass;
-+
- typedef struct _GstGLSLStage        GstGLSLStage;
- typedef struct _GstGLSLStagePrivate GstGLSLStagePrivate;
- typedef struct _GstGLSLStageClass   GstGLSLStageClass;
-diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c
-index 60dec6a..34770d0 100644
---- a/gst-libs/gst/gl/gstgldisplay.c
-+++ b/gst-libs/gst/gl/gstgldisplay.c
-@@ -68,6 +68,7 @@
- #if GST_GL_HAVE_PLATFORM_EGL
- #include <gst/gl/egl/gstgldisplay_egl.h>
- #include <gst/gl/egl/gsteglimagememory.h>
-+#include <gst/gl/egl/gstglmemoryegl.h>
- #endif
- 
- GST_DEBUG_CATEGORY_STATIC (gst_context);
-@@ -144,6 +145,7 @@ gst_gl_display_init (GstGLDisplay * display)
- 
- #if GST_GL_HAVE_PLATFORM_EGL
-   gst_egl_image_memory_init ();
-+  gst_gl_memory_egl_init_once ();
- #endif
- }
- 
-diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c
-index 16ed5ea..73a9029 100644
---- a/gst-libs/gst/gl/gstglupload.c
-+++ b/gst-libs/gst/gl/gstglupload.c
-@@ -29,6 +29,7 @@
- 
- #if GST_GL_HAVE_PLATFORM_EGL
- #include "egl/gsteglimagememory.h"
-+#include "egl/gstglmemoryegl.h"
- #endif
- 
- #if GST_GL_HAVE_DMABUF
-@@ -301,6 +302,13 @@ _gl_memory_upload_propose_allocation (gpointer impl, GstQuery * decide_query,
-             context));
-     gst_query_add_allocation_param (query, allocator, &params);
-     gst_object_unref (allocator);
-+
-+#if GST_GL_HAVE_PLATFORM_EGL
-+    allocator =
-+        GST_ALLOCATOR (gst_allocator_find (GST_GL_MEMORY_EGL_ALLOCATOR_NAME));
-+    gst_query_add_allocation_param (query, allocator, &params);
-+    gst_object_unref (allocator);
-+#endif
-   }
- 
-   n_pools = gst_query_get_n_allocation_pools (query);
--- 
-2.5.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
index 369ff93..20c9ffc 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
@@ -23,43 +23,45 @@
  sys/decklink/gstdecklinkvideosink.cpp |  2 +-
  3 files changed, 7 insertions(+), 7 deletions(-)
 
-diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp
-index 64637f1..bac956f 100644
---- a/sys/decklink/gstdecklink.cpp
-+++ b/sys/decklink/gstdecklink.cpp
-@@ -324,22 +324,22 @@ gst_decklink_mode_get_structure (GstDecklinkModeEnum e, BMDPixelFormat f)
-       "height", G_TYPE_INT, mode->height,
+Index: gst-plugins-bad-1.10.2/sys/decklink/gstdecklink.cpp
+===================================================================
+--- gst-plugins-bad-1.10.2.orig/sys/decklink/gstdecklink.cpp
++++ gst-plugins-bad-1.10.2/sys/decklink/gstdecklink.cpp
+@@ -476,7 +476,7 @@ gst_decklink_mode_get_structure (GstDeck
        "pixel-aspect-ratio", GST_TYPE_FRACTION, mode->par_n, mode->par_d,
-       "interlace-mode", G_TYPE_STRING, mode->interlaced ? "interleaved" : "progressive",
+       "interlace-mode", G_TYPE_STRING,
+       mode->interlaced ? "interleaved" : "progressive",
 -      "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, NULL);
-+      "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, (void *) NULL);
++      "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, (void*)NULL);
  
-   switch (f) {
-     case bmdFormat8BitYUV: /* '2vuy' */
+   if (input && mode->interlaced) {
+     if (mode->tff)
+@@ -489,16 +489,16 @@ gst_decklink_mode_get_structure (GstDeck
+     case bmdFormat8BitYUV:     /* '2vuy' */
        gst_structure_set (s, "format", G_TYPE_STRING, "UYVY",
            "colorimetry", G_TYPE_STRING, mode->colorimetry,
 -          "chroma-site", G_TYPE_STRING, "mpeg2", NULL);
-+          "chroma-site", G_TYPE_STRING, "mpeg2", (void *) NULL);
++          "chroma-site", G_TYPE_STRING, "mpeg2", (void*)NULL);
        break;
-     case bmdFormat10BitYUV: /* 'v210' */
+     case bmdFormat10BitYUV:    /* 'v210' */
 -      gst_structure_set (s, "format", G_TYPE_STRING, "v210", NULL);
-+      gst_structure_set (s, "format", G_TYPE_STRING, "v210", (void *) NULL);
++      gst_structure_set (s, "format", G_TYPE_STRING, "v210", (void*)NULL);
        break;
-     case bmdFormat8BitARGB: /* 'ARGB' */
+     case bmdFormat8BitARGB:    /* 'ARGB' */
 -      gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", NULL);
-+      gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", (void *) NULL);
++      gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", (void*)NULL);
        break;
-     case bmdFormat8BitBGRA: /* 'BGRA' */
+     case bmdFormat8BitBGRA:    /* 'BGRA' */
 -      gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", NULL);
-+      gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", (void *) NULL);
++      gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", (void*)NULL);
        break;
-     case bmdFormat10BitRGB: /* 'r210' Big-endian RGB 10-bit per component with SMPTE video levels (64-960). Packed as 2:10:10:10 */
-     case bmdFormat12BitRGB: /* 'R12B' Big-endian RGB 12-bit per component with full range (0-4095). Packed as 12-bit per component */
-diff --git a/sys/decklink/gstdecklinkaudiosrc.cpp b/sys/decklink/gstdecklinkaudiosrc.cpp
-index 9a701ee..26fb7ec 100644
---- a/sys/decklink/gstdecklinkaudiosrc.cpp
-+++ b/sys/decklink/gstdecklinkaudiosrc.cpp
-@@ -312,7 +312,7 @@ gst_decklink_audio_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
+     case bmdFormat10BitRGB:    /* 'r210' Big-endian RGB 10-bit per component with SMPTE video levels (64-960). Packed as 2:10:10:10 */
+     case bmdFormat12BitRGB:    /* 'R12B' Big-endian RGB 12-bit per component with full range (0-4095). Packed as 12-bit per component */
+Index: gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkaudiosrc.cpp
+===================================================================
+--- gst-plugins-bad-1.10.2.orig/sys/decklink/gstdecklinkaudiosrc.cpp
++++ gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkaudiosrc.cpp
+@@ -322,7 +322,7 @@ gst_decklink_audio_src_set_caps (GstBase
        g_mutex_unlock (&self->input->lock);
  
        if (videosrc) {
@@ -68,11 +70,11 @@
          gst_object_unref (videosrc);
  
          switch (vconn) {
-diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp
-index eebeff3..da6e486 100644
---- a/sys/decklink/gstdecklinkvideosink.cpp
-+++ b/sys/decklink/gstdecklinkvideosink.cpp
-@@ -158,7 +158,7 @@ reset_framerate (GstCapsFeatures * features, GstStructure * structure,
+Index: gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkvideosink.cpp
+===================================================================
+--- gst-plugins-bad-1.10.2.orig/sys/decklink/gstdecklinkvideosink.cpp
++++ gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkvideosink.cpp
+@@ -163,7 +163,7 @@ reset_framerate (GstCapsFeatures * featu
      gpointer user_data)
  {
    gst_structure_set (structure, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
@@ -81,6 +83,3 @@
  
    return TRUE;
  }
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb
new file mode 100644
index 0000000..0bb4053
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb
@@ -0,0 +1,28 @@
+require gstreamer1.0-plugins-bad.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
+                    file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
+                    file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50 \
+                    file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a"
+
+SRC_URI = " \
+    http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${PV}.tar.xz \
+    file://configure-allow-to-disable-libssh2.patch \
+    file://fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch \
+    file://avoid-including-sys-poll.h-directly.patch \
+    file://ensure-valid-sentinels-for-gst_structure_get-etc.patch \
+    file://0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch \
+    file://0009-glimagesink-Downrank-to-marginal.patch \
+    file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
+    file://0001-Prepend-PKG_CONFIG_SYSROOT_DIR-to-pkg-config-output.patch \
+    file://0001-smoothstreaming-implement-adaptivedemux-s-get_live_s.patch \
+    file://0001-smoothstreaming-use-the-duration-from-the-list-of-fr.patch \
+    file://0001-mssdemux-improved-live-playback-support.patch \
+"
+SRC_URI[md5sum] = "2757103e57a096a1a05b3ab85b8381af"
+SRC_URI[sha256sum] = "23ddae506b3a223b94869a0d3eea3e9a12e847f94d2d0e0b97102ce13ecd6966"
+
+S = "${WORKDIR}/gst-plugins-bad-${PV}"
+
+EXTRA_OECONF += "WAYLAND_PROTOCOLS_SYSROOT_DIR=${RECIPE_SYSROOT}"
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
deleted file mode 100644
index 108f4db..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-include gstreamer1.0-plugins-bad.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
-                    file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
-                    file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50 \
-                    file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a"
-
-SRC_URI = " \
-    http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${PV}.tar.xz \
-    file://configure-allow-to-disable-libssh2.patch \
-    file://fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch \
-    file://avoid-including-sys-poll.h-directly.patch \
-    file://ensure-valid-sentinels-for-gst_structure_get-etc.patch \
-    file://0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch \
-    file://0002-glplugin-enable-gldeinterlace-on-OpenGL-ES.patch \
-    file://0003-glcolorconvert-implement-multiple-render-targets-for.patch \
-    file://0004-glcolorconvert-don-t-use-the-predefined-variable-nam.patch \
-    file://0005-glshader-add-glBindFragDataLocation.patch \
-    file://0006-glcolorconvert-GLES3-deprecates-texture2D-and-it-doe.patch \
-    file://0008-gl-implement-GstGLMemoryEGL.patch \
-    file://0009-glimagesink-Downrank-to-marginal.patch \
-"
-SRC_URI[md5sum] = "955281a43e98c5464563fa049e0a0911"
-SRC_URI[sha256sum] = "7899fcb18e6a1af2888b19c90213af018a57d741c6e72ec56b133bc73ec8509b"
-
-S = "${WORKDIR}/gst-plugins-bad-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb
deleted file mode 100644
index 1370380..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb
+++ /dev/null
@@ -1,45 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-plugins-bad.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
-                    file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
-                    file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50 \
-                    file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a"
-
-SRC_URI = " \
-    git://anongit.freedesktop.org/gstreamer/gst-plugins-bad;branch=1.8;name=base \
-    git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
-    file://configure-allow-to-disable-libssh2.patch \
-    file://fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch \
-    file://avoid-including-sys-poll.h-directly.patch \
-    file://ensure-valid-sentinels-for-gst_structure_get-etc.patch \
-    file://0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch \
-"
-
-PV = "1.8.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "5e73b5a4843d9675246f4efec158624475ed9586"
-SRCREV_common = "f363b3205658a38e84fa77f19dee218cd4445275"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
-	${S}/autogen.sh --noconfigure
-}
-
-# In 1.6.2, the "--enable-hls" configure option generated an installable package
-# called "gstreamer1.0-plugins-bad-fragmented". In 1.7.1 that HLS plugin package
-# has become "gstreamer1.0-plugins-bad-hls". See:
-# http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=efe62292a3d045126654d93239fdf4cc8e48ae08
-
-PACKAGESPLITFUNCS_append = " handle_hls_rename "
-
-python handle_hls_rename () {
-    d.setVar('RPROVIDES_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented')
-    d.setVar('RREPLACES_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented')
-    d.setVar('RCONFLICTS_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented')
-}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc
index a04f155..08130c1 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc
@@ -17,9 +17,8 @@
 
 PACKAGECONFIG ??= " \
     ${GSTREAMER_ORC} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
-    gio-unix-2.0 ivorbis ogg pango theora vorbis \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'alsa x11', d)} \
+    gio-unix-2.0 ogg pango theora vorbis \
 "
 
 X11DEPENDS = "virtual/libx11 libsm libxrender libxv"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.4.bb
new file mode 100644
index 0000000..7c81670
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.4.bb
@@ -0,0 +1,19 @@
+require gstreamer1.0-plugins-base.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
+                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
+                    file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607"
+
+SRC_URI = " \
+    http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-${PV}.tar.xz \
+    file://get-caps-from-src-pad-when-query-caps.patch \
+    file://0003-ssaparse-enhance-SSA-text-lines-parsing.patch \
+    file://0004-subparse-set-need_segment-after-sink-pad-received-GS.patch \
+    file://encodebin-Need-more-buffers-in-output-queue-for-bett.patch \
+    file://make-gio_unix_2_0-dependency-configurable.patch \
+    file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
+"
+SRC_URI[md5sum] = "f6b46f8fac01eb773d556e3efc369e86"
+SRC_URI[sha256sum] = "f6d245b6b3d4cb733f81ebb021074c525ece83db0c10e932794b339b8d935eb7"
+
+S = "${WORKDIR}/gst-plugins-base-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.8.3.bb
deleted file mode 100644
index 986b5ac..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.8.3.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-include gstreamer1.0-plugins-base.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
-                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
-                    file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607"
-
-SRC_URI = " \
-    http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-${PV}.tar.xz \
-    file://get-caps-from-src-pad-when-query-caps.patch \
-    file://0003-ssaparse-enhance-SSA-text-lines-parsing.patch \
-    file://0004-subparse-set-need_segment-after-sink-pad-received-GS.patch \
-    file://encodebin-Need-more-buffers-in-output-queue-for-bett.patch \
-    file://make-gio_unix_2_0-dependency-configurable.patch \
-"
-
-SRC_URI[md5sum] = "4d03dd81828ea6b98a44c8f1ab7f4976"
-SRC_URI[sha256sum] = "114871d4d63606b4af424a8433cd923e4ff66896b244bb7ac97b9da47f71e79e"
-
-S = "${WORKDIR}/gst-plugins-base-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb
deleted file mode 100644
index 3c2b504..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-plugins-base.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
-                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
-                    file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607"
-
-SRC_URI = " \
-    git://anongit.freedesktop.org/gstreamer/gst-plugins-base;branch=1.8;name=base \
-    git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
-    file://get-caps-from-src-pad-when-query-caps.patch \
-    file://0003-ssaparse-enhance-SSA-text-lines-parsing.patch \
-    file://0004-subparse-set-need_segment-after-sink-pad-received-GS.patch \
-    file://encodebin-Need-more-buffers-in-output-queue-for-bett.patch \
-    file://make-gio_unix_2_0-dependency-configurable.patch \
-"
-
-PV = "1.8.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "70f3750773bf5dba4098f6d72d63aa6c84f1f539"
-SRCREV_common = "f363b3205658a38e84fa77f19dee218cd4445275"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
-	${S}/autogen.sh --noconfigure
-}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc
index f1e30ab..14c3d61 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc
@@ -8,8 +8,7 @@
 
 PACKAGECONFIG ??= " \
     ${GSTREAMER_ORC} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio x11', d)} \
     cairo flac gdk-pixbuf gudev jpeg libpng soup speex taglib v4l2 \
 "
 
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2object-Also-add-videometa-if-there-is-padding-to.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2object-Also-add-videometa-if-there-is-padding-to.patch
new file mode 100644
index 0000000..2a9a23e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2object-Also-add-videometa-if-there-is-padding-to.patch
@@ -0,0 +1,35 @@
+From 22be02612adc757f6a43cefc6ee65ecaef68f0d9 Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+Date: Thu, 23 Mar 2017 22:13:05 +0100
+Subject: [PATCH] v4l2object: Also add videometa if there is padding to the
+ right and bottom
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780478
+
+Upstream-Status: Backport [1.10.5]
+
+Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
+---
+ sys/v4l2/gstv4l2object.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
+index 91c8ff0..ed4654e 100644
+--- a/sys/v4l2/gstv4l2object.c
++++ b/sys/v4l2/gstv4l2object.c
+@@ -3070,9 +3070,10 @@ store_info:
+   GST_DEBUG_OBJECT (v4l2object->element, "Got sizeimage %" G_GSIZE_FORMAT,
+       info->size);
+ 
+-  /* to avoid copies we need video meta if top or left padding */
++  /* to avoid copies we need video meta if there is padding */
+   v4l2object->need_video_meta =
+-      ((align->padding_top + align->padding_left) != 0);
++      ((align->padding_top + align->padding_left + align->padding_right +
++          align->padding_bottom) != 0);
+ 
+   /* ... or if stride is non "standard" */
+   if (!standard_stride)
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.10.4.bb
new file mode 100644
index 0000000..57447bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.10.4.bb
@@ -0,0 +1,18 @@
+require gstreamer1.0-plugins-good.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                    file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
+                    file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
+
+SRC_URI = " \
+    http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${PV}.tar.xz \
+    file://0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch \
+    file://avoid-including-sys-poll.h-directly.patch \
+    file://ensure-valid-sentinel-for-gst_structure_get.patch \
+    file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
+    file://0001-v4l2object-Also-add-videometa-if-there-is-padding-to.patch \
+"
+SRC_URI[md5sum] = "cc0cc13cdb07d4237600b6886b81f31d"
+SRC_URI[sha256sum] = "8a86c61434a8c44665365bd0b3557a040937d1f44bf69caee4e9ea816ce74d7e"
+
+S = "${WORKDIR}/gst-plugins-good-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.8.3.bb
deleted file mode 100644
index 5cc6578..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.8.3.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-include gstreamer1.0-plugins-good.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
-                    file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
-                    file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
-
-SRC_URI = " \
-    http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${PV}.tar.xz \
-    file://0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch \
-    file://avoid-including-sys-poll.h-directly.patch \
-    file://ensure-valid-sentinel-for-gst_structure_get.patch \
-"
-
-SRC_URI[md5sum] = "473ebb1f15c67de99ddb6e4d027c0876"
-SRC_URI[sha256sum] = "a1d6579ba203a7734927c24b90bf6590d846c5a5fcec01a48201018c8ad2827a"
-
-S = "${WORKDIR}/gst-plugins-good-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb
deleted file mode 100644
index 9b79af2..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-plugins-good.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
-                    file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
-                    file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
-
-SRC_URI = " \
-    git://anongit.freedesktop.org/gstreamer/gst-plugins-good;branch=1.8;name=base \
-    git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
-    file://avoid-including-sys-poll.h-directly.patch \
-    file://ensure-valid-sentinel-for-gst_structure_get.patch \
-    file://0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch \
-"
-
-PV = "1.8.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "9f73b5818f98cd045e7049bb313da1c943635109"
-SRCREV_common = "f363b3205658a38e84fa77f19dee218cd4445275"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
-	${S}/autogen.sh --noconfigure
-}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.10.4.bb
new file mode 100644
index 0000000..92a2caa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.10.4.bb
@@ -0,0 +1,13 @@
+require gstreamer1.0-plugins-ugly.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                    file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
+
+SRC_URI = " \
+    http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${PV}.tar.xz \
+    file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
+"
+SRC_URI[md5sum] = "c68d0509c9980b0b70a4b836ff73fff1"
+SRC_URI[sha256sum] = "6386c77ca8459cba431ed0b63da780c7062c7cc48055d222024d8eaf198ffa59"
+
+S = "${WORKDIR}/gst-plugins-ugly-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.8.3.bb
deleted file mode 100644
index 2745937..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.8.3.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-include gstreamer1.0-plugins-ugly.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
-                    file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
-
-SRC_URI = " \
-    http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${PV}.tar.xz \
-"
-
-SRC_URI[md5sum] = "4fc66c77253b0ad5ce224bda654b2e7d"
-SRC_URI[sha256sum] = "6fa2599fdd072d31fbaf50c34af406e2be944a010b1f4eab67a5fe32a0310693"
-
-S = "${WORKDIR}/gst-plugins-ugly-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb
deleted file mode 100644
index 22cca3a..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb
+++ /dev/null
@@ -1,37 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-plugins-ugly.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
-                    file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
-
-SRC_URI = " \
-    git://anongit.freedesktop.org/gstreamer/gst-plugins-ugly;branch=1.8;name=base \
-    git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
-"
-
-PV = "1.8.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "79fe43c00925455a37fab6fc428e7f08655a9bbd"
-SRCREV_common = "f363b3205658a38e84fa77f19dee218cd4445275"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
-	${S}/autogen.sh --noconfigure
-}
-
-# In 1.7.2, the mpg123 plugin was moved from -bad to -ugly
-# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=08d8aefcdaaf89ecb6dd53ec1e4f95cd42d01664
-# https://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=43bd45ba991ef3247957ca37cdcb52f4b8c0acb1
-
-PACKAGESPLITFUNCS_append = " handle_mpg123_rename "
-
-python handle_mpg123_rename () {
-    d.setVar('RPROVIDES_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123')
-    d.setVar('RREPLACES_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123')
-    d.setVar('RCONFLICTS_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123')
-}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
index 9cfcec3..3f6d4c3 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
@@ -28,8 +28,6 @@
     --disable-examples \
 "
 
-SRC_URI_append = " file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch"
-
 delete_pkg_m4_file() {
 	# This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection
 	rm "${S}/common/m4/pkg.m4" || true
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
index 13ba40d..7191f98 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
@@ -3,7 +3,7 @@
 SECTION = "multimedia"
 LICENSE = "LGPLv2"
 
-DEPENDS = "gstreamer1.0 libcgroup gstreamer1.0-plugins-base"
+DEPENDS = "gstreamer1.0 libcgroup gstreamer1.0-plugins-base libcheck"
 
 PNREAL = "gst-rtsp-server"
 
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.10.4.bb
new file mode 100644
index 0000000..6aa9a53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.10.4.bb
@@ -0,0 +1,6 @@
+require gstreamer1.0-rtsp-server.inc
+
+SRC_URI[md5sum] = "ef587fa6393e09bc26f884510596e305"
+SRC_URI[sha256sum] = "2f6e12fd4e3568ee190dc24e57e4c3a878971c3a3fb6904a9674404fac256de6"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.8.3.bb
deleted file mode 100644
index 17059d0..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.8.3.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-include gstreamer1.0-rtsp-server.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d"
-
-SRC_URI[md5sum] = "e4b07b10dd65b6c26c9ca5f72e59297b"
-SRC_URI[sha256sum] = "010f06800c1c957851d1352e5ec7a8ba3ce6a857fec1b8afc7d1a9e5f53288bf"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc
new file mode 100644
index 0000000..ef0734b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc
@@ -0,0 +1,37 @@
+SUMMARY = "VA-API support to GStreamer"
+DESCRIPTION = "gstreamer-vaapi consists of a collection of VA-API \
+based plugins for GStreamer and helper libraries: `vaapidecode', \
+`vaapiconvert', and `vaapisink'."
+
+REALPN = "gstreamer-vaapi"
+FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${REALPN}", "${FILE_DIRNAME}/${REALPN}"], d)}"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "libva"
+
+SRC_URI = "https://gstreamer.freedesktop.org/src/${REALPN}/${REALPN}-${PV}.tar.xz \
+          "
+
+S = "${WORKDIR}/${REALPN}-${PV}"
+
+inherit autotools pkgconfig gtk-doc distro_features_check upstream-version-is-even
+
+REQUIRED_DISTRO_FEATURES ?= "opengl"
+
+PACKAGES =+ "${PN}-tests"
+
+PACKAGECONFIG ??= "drm \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
+
+PACKAGECONFIG[drm] = "--enable-drm,--disable-drm,udev libdrm"
+PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,virtual/mesa"
+PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxrandr libxrender"
+
+FILES_${PN} += "${libdir}/gstreamer-*/*.so"
+FILES_${PN}-dbg += "${libdir}/gstreamer-*/.debug"
+FILES_${PN}-dev += "${libdir}/gstreamer-*/*.la ${libdir}/gstreamer-*/*.a"
+FILES_${PN}-tests = "${bindir}/*"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.10.4.bb
new file mode 100644
index 0000000..44c66de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.10.4.bb
@@ -0,0 +1,7 @@
+require gstreamer1.0-vaapi.inc
+SRC_URI[md5sum] = "318af17f906637570b61dd7be9b5581d"
+SRC_URI[sha256sum] = "03e690621594d9f9495d86c7dac8b8590b3a150462770ed070dc76f66a70de75"
+
+SRC_URI += "file://vaapivideobufferpool-create-allocator-if-needed.patch"
+
+DEPENDS += "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
index cb0bd82..72d7ce6 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
@@ -24,7 +24,7 @@
 PACKAGECONFIG[tests] = "--enable-tests,--disable-tests"
 PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind,"
 PACKAGECONFIG[gst-tracer-hooks] = "--enable-gst-tracer-hooks,--disable-gst-tracer-hooks,"
-PACKAGECONFIG[trace-historic] = "--enable-trace,--disable-trace,"
+PACKAGECONFIG[unwind] = "--with-unwind,--without-unwind,libunwind"
 
 EXTRA_OECONF = " \
     --disable-dependency-tracking \
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/deterministic-unwind.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/deterministic-unwind.patch
new file mode 100644
index 0000000..e39e6ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/deterministic-unwind.patch
@@ -0,0 +1,24 @@
+Make the detection of libunwind deterministic.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index ac88fb2..182c19a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -829,3 +828,0 @@ AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
+-dnl libunwind is optionally used by the leaks tracer
+-PKG_CHECK_MODULES(UNWIND, libunwind, HAVE_UNWIND=yes, HAVE_UNWIND=no)
+-
+@@ -839,3 +836,7 @@ AC_CHECK_FUNC(backtrace, [
+-if test "x$HAVE_UNWIND" = "xyes"; then
+-  AC_DEFINE(HAVE_UNWIND, 1, [libunwind available])
+-fi
++dnl libunwind is optionally used by the leaks tracer
++AC_ARG_WITH([unwind],[AS_HELP_STRING([--with-unwind],[use libunwind])],
++            [], [with_unwind=yes])
++AS_IF([test "$with_unwind" = yes],
++      [PKG_CHECK_MODULES(UNWIND, libunwind)
++       AC_DEFINE(HAVE_UNWIND, 1, [libunwind available])]
++)
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.10.4.bb
new file mode 100644
index 0000000..2a67993
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.10.4.bb
@@ -0,0 +1,13 @@
+require gstreamer1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
+                    file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
+
+SRC_URI = " \
+    http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.xz \
+    file://deterministic-unwind.patch \
+"
+SRC_URI[md5sum] = "7c91a97e4a2dc81eafd59d0a2f8b0d6e"
+SRC_URI[sha256sum] = "50c2f5af50a6cc6c0a3f3ed43bdd8b5e2bff00bacfb766d4be139ec06d8b5218"
+
+S = "${WORKDIR}/gstreamer-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.8.3.bb
deleted file mode 100644
index d3561eb..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.8.3.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-include gstreamer1.0.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
-                    file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
-
-SRC_URI = " \
-    http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.xz \
-"
-
-SRC_URI[md5sum] = "e88dad542df9d986822e982105d2b530"
-SRC_URI[sha256sum] = "66b37762d4fdcd63bce5a2bec57e055f92420e95037361609900278c0db7c53f"
-
-S = "${WORKDIR}/gstreamer-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb
deleted file mode 100644
index 6112f2a..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
-                    file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
-
-SRC_URI = " \
-    git://anongit.freedesktop.org/gstreamer/gstreamer;branch=1.8;name=base \
-    git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
-"
-
-PV = "1.8.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "3de8a4f728a7194a12b784ec4085f6a8e7d9b5bd"
-SRCREV_common = "f363b3205658a38e84fa77f19dee218cd4445275"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
-	${S}/autogen.sh --noconfigure
-}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libpng/libpng_1.6.24.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libpng/libpng_1.6.24.bb
deleted file mode 100644
index f91ab7f..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/libpng/libpng_1.6.24.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-SUMMARY = "PNG image format decoding library"
-HOMEPAGE = "http://www.libpng.org/"
-SECTION = "libs"
-LICENSE = "Libpng"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=5089214833586ba444048fd1dbbc76a4 \
-                    file://png.h;endline=149;md5=376d8ff7f69b7c4ad3a09f4672cec696"
-DEPENDS = "zlib"
-
-SRC_URI = "${GENTOO_MIRROR}/libpng-${PV}.tar.xz \
-          "
-SRC_URI[md5sum] = "ffcdbd549814787fa8010c372e35ff25"
-SRC_URI[sha256sum] = "7932dc9e5e45d55ece9d204e90196bbb5f2c82741ccb0f7e10d07d364a6fd6dd"
-
-BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config"
-
-inherit autotools binconfig-disabled pkgconfig
-
-# Work around missing symbols
-EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}"
-
-PACKAGES =+ "${PN}-tools"
-
-FILES_${PN}-tools = "${bindir}/png-fix-itxt ${bindir}/pngfix ${bindir}/pngcp"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libpng/libpng_1.6.28.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libpng/libpng_1.6.28.bb
new file mode 100644
index 0000000..9cb2967
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libpng/libpng_1.6.28.bb
@@ -0,0 +1,25 @@
+SUMMARY = "PNG image format decoding library"
+HOMEPAGE = "http://www.libpng.org/"
+SECTION = "libs"
+LICENSE = "Libpng"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=67d8837410863f9821bbd606536f0329 \
+                    file://png.h;endline=144;md5=abfa0497feb393b5842d3d82c1009520"
+DEPENDS = "zlib"
+
+SRC_URI = "${GENTOO_MIRROR}/libpng-${PV}.tar.xz \
+          "
+SRC_URI[md5sum] = "425354f86c392318d31aedca71019372"
+SRC_URI[sha256sum] = "d8d3ec9de6b5db740fefac702c37ffcf96ae46cb17c18c1544635a3852f78f7a"
+
+BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config"
+
+inherit autotools binconfig-disabled pkgconfig
+
+# Work around missing symbols
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}"
+
+PACKAGES =+ "${PN}-tools"
+
+FILES_${PN}-tools = "${bindir}/png-fix-itxt ${bindir}/pngfix ${bindir}/pngcp"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0/0001-configure.ac-improve-alsa-handling.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0/0001-configure.ac-improve-alsa-handling.patch
new file mode 100644
index 0000000..d19b514
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0/0001-configure.ac-improve-alsa-handling.patch
@@ -0,0 +1,62 @@
+From 957ebce3837588f71016e37ffaf9aad0a9d41cec Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanuk@iki.fi>
+Date: Fri, 23 Sep 2016 12:02:06 +0300
+Subject: [PATCH] configure.ac: improve alsa handling
+
+Three improvements:
+
+1) "--enable-alsa" or "--disable-alsa" caused a warning about an
+unsupported configure option, because AC_ARG_ENABLE was not used.
+
+2) If alsa was disabled, the "Have ALSA" item in the summary would print
+an empty string instead of "no".
+
+3) If "--enable-alsa" was passed to configure, but the headers were not
+found, configure would still succeed (with alsa disabled). It's better
+to fail and abort configure if a feature that was explicitly requested
+can't be enabled.
+
+Upstream-Status: Submitted [sent to src@mega-nerd.com]
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ configure.ac | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 474c6ab..bad597e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -101,6 +101,9 @@ AC_ARG_ENABLE(cpu-clip,
+ 		AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper]),
+ 		ac_arg_cpu_clip="N", ac_arg_cpu_clip="Y")
+ 
++AC_ARG_ENABLE(alsa,
++                AC_HELP_STRING([--disable-alsa], [disable ALSA support in the varispeed-play example program]))
++
+ #====================================================================================
+ # Check types and their sizes.
+ 
+@@ -194,6 +197,10 @@ if test x$enable_alsa != xno ; then
+ 	if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then
+ 		ALSA_LIBS="-lasound"
+ 		enable_alsa=yes
++        elif test x$enable_alsa = xyes ; then
++                AC_MSG_ERROR(["ALSA headers not found"])
++        else
++                enable_alsa=no
+ 		fi
+ 	fi
+ 
+@@ -340,7 +347,7 @@ AC_MSG_RESULT([
+     Have FFTW : ................... ${ac_cv_fftw3}])
+ 
+ AC_MSG_RESULT([    Have libsndfile : ............. ${ac_cv_sndfile}])
+-AC_MSG_RESULT([    Have ALSA : ................... ${ac_cv_header_alsa_asoundlib_h}
++AC_MSG_RESULT([    Have ALSA : ................... ${enable_alsa}
+ ])
+ 
+ AC_MSG_RESULT([  Installation directories :
+-- 
+2.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.8.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.8.bb
deleted file mode 100644
index 1c37681..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.8.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "Audio Sample Rate Conversion library"
-HOMEPAGE = "http://www.mega-nerd.com/SRC/"
-SECTION = "libs"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
-                    file://src/samplerate.c;beginline=1;endline=17;md5=d0807c35fc906466d24a50463534815a"
-DEPENDS = "flac libsndfile1"
-PR = "r1"
-
-SRC_URI = "http://www.mega-nerd.com/SRC/libsamplerate-${PV}.tar.gz"
-
-SRC_URI[md5sum] = "1c7fb25191b4e6e3628d198a66a84f47"
-SRC_URI[sha256sum] = "93b54bdf46d5e6d2354b7034395fe329c222a966790de34520702bb9642f1c06"
-
-UPSTREAM_CHECK_URI = "http://www.mega-nerd.com/SRC/download.html"
-
-S = "${WORKDIR}/libsamplerate-${PV}"
-
-inherit autotools pkgconfig
-
-PACKAGECONFIG[fftw] = ",--disable-fftw,fftw"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.9.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.9.bb
new file mode 100644
index 0000000..ae08189
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.9.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Audio Sample Rate Conversion library"
+HOMEPAGE = "http://www.mega-nerd.com/SRC/"
+SECTION = "libs"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=336d6faf40fb600bafb0061f4052f1f4 \
+                    file://src/samplerate.c;beginline=1;endline=7;md5=5b6982a8c2811c7312c13cccbf55f55e"
+DEPENDS = "libsndfile1"
+PR = "r1"
+
+SRC_URI = "http://www.mega-nerd.com/SRC/libsamplerate-${PV}.tar.gz \
+           file://0001-configure.ac-improve-alsa-handling.patch \
+"
+
+SRC_URI[md5sum] = "2b78ae9fe63b36b9fbb6267fad93f259"
+SRC_URI[sha256sum] = "0a7eb168e2f21353fb6d84da152e4512126f7dc48ccb0be80578c565413444c1"
+
+CVE_PRODUCT = "libsamplerate"
+
+UPSTREAM_CHECK_URI = "http://www.mega-nerd.com/SRC/download.html"
+
+S = "${WORKDIR}/libsamplerate-${PV}"
+
+inherit autotools pkgconfig
+
+# FFTW and ALSA are only used in tests and examples, so they don't affect
+# normal builds. It should be safe to ignore these, but explicitly disabling
+# them adds some extra certainty that builds are deterministic.
+EXTRA_OECONF = "--disable-fftw --disable-alsa"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-6892.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-6892.patch
new file mode 100644
index 0000000..89552ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-6892.patch
@@ -0,0 +1,34 @@
+From f833c53cb596e9e1792949f762e0b33661822748 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Tue, 23 May 2017 20:15:24 +1000
+Subject: [PATCH] src/aiff.c: Fix a buffer read overflow
+
+Secunia Advisory SA76717.
+
+Found by: Laurent Delosieres, Secunia Research at Flexera Software
+
+CVE: CVE-2017-6892
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+---
+ src/aiff.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/aiff.c b/src/aiff.c
+index 5b5f9f5..45864b7 100644
+--- a/src/aiff.c
++++ b/src/aiff.c
+@@ -1759,7 +1759,7 @@ aiff_read_chanmap (SF_PRIVATE * psf, unsigned dword)
+ 		psf_binheader_readf (psf, "j", dword - bytesread) ;
+ 
+ 	if (map_info->channel_map != NULL)
+-	{	size_t chanmap_size = psf->sf.channels * sizeof (psf->channel_map [0]) ;
++	{	size_t chanmap_size = SF_MIN (psf->sf.channels, layout_tag & 0xffff) * sizeof (psf->channel_map [0]) ;
+ 
+ 		free (psf->channel_map) ;
+ 
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8361-8365.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8361-8365.patch
new file mode 100644
index 0000000..ac99516
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8361-8365.patch
@@ -0,0 +1,73 @@
+From fd0484aba8e51d16af1e3a880f9b8b857b385eb3 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Wed, 12 Apr 2017 19:45:30 +1000
+Subject: [PATCH] FLAC: Fix a buffer read overrun
+
+Buffer read overrun occurs when reading a FLAC file that switches
+from 2 channels to one channel mid-stream. Only option is to
+abort the read.
+
+Closes: https://github.com/erikd/libsndfile/issues/230
+
+CVE: CVE-2017-8361 CVE-2017-8365
+
+Upstream-Status: Backport [https://github.com/erikd/libsndfile/commit/fd0484aba8e51d16af1e3a880f9b8b857b385eb3]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/common.h  |  1 +
+ src/flac.c    | 13 +++++++++++++
+ src/sndfile.c |  1 +
+ 3 files changed, 15 insertions(+)
+
+diff --git a/src/common.h b/src/common.h
+index 0bd810c..e2669b6 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -725,6 +725,7 @@ enum
+ 	SFE_FLAC_INIT_DECODER,
+ 	SFE_FLAC_LOST_SYNC,
+ 	SFE_FLAC_BAD_SAMPLE_RATE,
++	SFE_FLAC_CHANNEL_COUNT_CHANGED,
+ 	SFE_FLAC_UNKOWN_ERROR,
+ 
+ 	SFE_WVE_NOT_WVE,
+diff --git a/src/flac.c b/src/flac.c
+index 84de0e2..986a7b8 100644
+--- a/src/flac.c
++++ b/src/flac.c
+@@ -434,6 +434,19 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
+ 
+ 	switch (metadata->type)
+ 	{	case FLAC__METADATA_TYPE_STREAMINFO :
++			if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
++			{	psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
++									"Nothing to be but to error out.\n" ,
++									psf->sf.channels, metadata->data.stream_info.channels) ;
++				psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
++				return ;
++				} ;
++
++			if (psf->sf.channels > 0 && psf->sf.samplerate != (int) metadata->data.stream_info.sample_rate)
++			{	psf_log_printf (psf, "Warning: FLAC stream changed sample rates from %d to %d.\n"
++									"Carrying on as if nothing happened.",
++									psf->sf.samplerate, metadata->data.stream_info.sample_rate) ;
++				} ;
+ 			psf->sf.channels = metadata->data.stream_info.channels ;
+ 			psf->sf.samplerate = metadata->data.stream_info.sample_rate ;
+ 			psf->sf.frames = metadata->data.stream_info.total_samples ;
+diff --git a/src/sndfile.c b/src/sndfile.c
+index 4187561..e2a87be 100644
+--- a/src/sndfile.c
++++ b/src/sndfile.c
+@@ -245,6 +245,7 @@ ErrorStruct SndfileErrors [] =
+ 	{	SFE_FLAC_INIT_DECODER	, "Error : problem with initialization of the flac decoder." },
+ 	{	SFE_FLAC_LOST_SYNC		, "Error : flac decoder lost sync." },
+ 	{	SFE_FLAC_BAD_SAMPLE_RATE, "Error : flac does not support this sample rate." },
++	{	SFE_FLAC_CHANNEL_COUNT_CHANGED, "Error : flac channel changed mid stream." },
+ 	{	SFE_FLAC_UNKOWN_ERROR	, "Error : unknown error in flac decoder." },
+ 
+ 	{	SFE_WVE_NOT_WVE			, "Error : not a WVE file." },
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch
new file mode 100644
index 0000000..771ec92
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch
@@ -0,0 +1,51 @@
+From ef1dbb2df1c0e741486646de40bd638a9c4cd808 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Fri, 14 Apr 2017 15:19:16 +1000
+Subject: [PATCH] src/flac.c: Fix a buffer read overflow
+
+A file (generated by a fuzzer) which increased the number of channels
+from one frame to the next could cause a read beyond the end of the
+buffer provided by libFLAC. Only option is to abort the read.
+
+Closes: https://github.com/erikd/libsndfile/issues/231
+
+CVE: CVE-2017-8362
+
+Upstream-Status: Backport [https://github.com/erikd/libsndfile/commit/ef1dbb2df1c0e741486646de40bd638a9c4cd808]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+removed hunk #2 as it was only cosmentic and caused a merge conflict.
+signef-off-by: Armin Kuster <akuster808@gmail.com>
+---
+ src/flac.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+Index: libsndfile-1.0.27/src/flac.c
+===================================================================
+--- libsndfile-1.0.27.orig/src/flac.c
++++ libsndfile-1.0.27/src/flac.c
+@@ -169,6 +169,14 @@ flac_buffer_copy (SF_PRIVATE *psf)
+ 	const FLAC__int32* const *buffer = pflac->wbuffer ;
+ 	unsigned i = 0, j, offset ;
+ 
++	if (psf->sf.channels != (int) frame->header.channels)
++	{	psf_log_printf (psf, "Error: FLAC frame changed from %d to %d channels\n"
++									"Nothing to do but to error out.\n" ,
++									psf->sf.channels, frame->header.channels) ;
++		psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
++		return 0 ;
++		} ;
++
+ 	/*
+ 	**	frame->header.blocksize is variable and we're using a constant blocksize
+ 	**	of FLAC__MAX_BLOCK_SIZE.
+@@ -410,7 +418,7 @@ sf_flac_meta_callback (const FLAC__Strea
+ 	{	case FLAC__METADATA_TYPE_STREAMINFO :
+ 			if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
+ 			{	psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
+-									"Nothing to be but to error out.\n" ,
++									"Nothing to do but to error out.\n" ,
+ 									psf->sf.channels, metadata->data.stream_info.channels) ;
+ 				psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
+ 				return ;
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8363.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8363.patch
new file mode 100644
index 0000000..e526e5a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8363.patch
@@ -0,0 +1,37 @@
+From cd7da8dbf6ee4310d21d9e44b385d6797160d9e8 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Wed, 12 Apr 2017 20:19:34 +1000
+Subject: [PATCH] src/flac.c: Fix another memory leak
+
+When the FLAC decoder was passed a malformed file, the associated
+`FLAC__StreamDecoder` object was not getting released.
+
+Closes: https://github.com/erikd/libsndfile/issues/233
+
+CVE: CVE-2017-8363
+
+Upstream-Status: Backport [https://github.com/erikd/libsndfile/commit/cd7da8dbf6ee4310d21d9e44b385d6797160d9e8]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/flac.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/flac.c b/src/flac.c
+index 986a7b8..5a4f8c2 100644
+--- a/src/flac.c
++++ b/src/flac.c
+@@ -841,7 +841,9 @@ flac_read_header (SF_PRIVATE *psf)
+ 
+ 	psf_log_printf (psf, "End\n") ;
+ 
+-	if (psf->error == 0)
++	if (psf->error != 0)
++		FLAC__stream_decoder_delete (pflac->fsd) ;
++	else
+ 	{	FLAC__uint64 position ;
+ 
+ 		FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.27.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.27.bb
index ec41719..c6df4e9 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.27.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.27.bb
@@ -5,16 +5,23 @@
 SECTION = "libs/multimedia"
 LICENSE = "LGPLv2.1"
 
-SRC_URI = "http://www.mega-nerd.com/libsndfile/files/libsndfile-${PV}.tar.gz"
+SRC_URI = "http://www.mega-nerd.com/libsndfile/files/libsndfile-${PV}.tar.gz \
+           file://CVE-2017-6892.patch \
+           file://CVE-2017-8361-8365.patch \
+           file://CVE-2017-8362.patch \
+           file://CVE-2017-8363.patch \
+          "
 
 SRC_URI[md5sum] = "fd1d97c6077f03b5d984d7956ffedb7a"
 SRC_URI[sha256sum] = "a391952f27f4a92ceb2b4c06493ac107896ed6c76be9a613a4731f076d30fac0"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=e77fe93202736b47c07035910f47974a"
 
+CVE_PRODUCT = "libsndfile"
+
 S = "${WORKDIR}/libsndfile-${PV}"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa', d)}"
 PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
 
 inherit autotools lib_package pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10093.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10093.patch
new file mode 100644
index 0000000..e09bb7f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10093.patch
@@ -0,0 +1,47 @@
+From 787c0ee906430b772f33ca50b97b8b5ca070faec Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Sat, 3 Dec 2016 16:40:01 +0000
+Subject: [PATCH] * tools/tiffcp.c: fix uint32 underflow/overflow that can
+ cause heap-based buffer overflow. Reported by Agostino Sarubbo. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2610
+
+Upstream-Status: Backport
+CVE: CVE-2016-10093
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+
+---
+ ChangeLog      | 7 +++++++
+ tools/tiffcp.c | 6 +++---
+ 2 files changed, 10 insertions(+), 3 deletions(-)
+
+Index: tiff-4.0.7/tools/tiffcp.c
+===================================================================
+--- tiff-4.0.7.orig/tools/tiffcp.c
++++ tiff-4.0.7/tools/tiffcp.c
+@@ -1163,7 +1163,7 @@ bad:
+ 
+ static void
+ cpStripToTile(uint8* out, uint8* in,
+-    uint32 rows, uint32 cols, int outskew, int inskew)
++    uint32 rows, uint32 cols, int outskew, int64 inskew)
+ {
+ 	while (rows-- > 0) {
+ 		uint32 j = cols;
+@@ -1320,7 +1320,7 @@ DECLAREreadFunc(readContigTilesIntoBuffe
+ 	tdata_t tilebuf;
+ 	uint32 imagew = TIFFScanlineSize(in);
+ 	uint32 tilew  = TIFFTileRowSize(in);
+-	int iskew = imagew - tilew;
++	int64 iskew = (int64)imagew - (int64)tilew;
+ 	uint8* bufp = (uint8*) buf;
+ 	uint32 tw, tl;
+ 	uint32 row;
+@@ -1348,7 +1348,7 @@ DECLAREreadFunc(readContigTilesIntoBuffe
+ 				status = 0;
+ 				goto done;
+ 			}
+-			if (colb + tilew > imagew) {
++			if (colb > iskew) {
+ 				uint32 width = imagew - colb;
+ 				uint32 oskew = tilew - width;
+ 				cpStripToTile(bufp + colb,
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10266.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10266.patch
new file mode 100644
index 0000000..e1c90c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10266.patch
@@ -0,0 +1,60 @@
+From 1855407c4e5a27ade006b26c2dec8a31745c356e Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Fri, 2 Dec 2016 21:56:56 +0000
+Subject: [PATCH] * libtiff/tif_read.c, libtiff/tiffiop.h: fix uint32 overflow
+ in TIFFReadEncodedStrip() that caused an integer division by zero. Reported
+ by Agostino Sarubbo. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2596
+
+Upstream-Status: Backport
+
+CVE: CVE-2016-10266
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+---
+ ChangeLog          | 7 +++++++
+ libtiff/tif_read.c | 2 +-
+ libtiff/tiffiop.h  | 4 ++++
+ 3 files changed, 12 insertions(+), 1 deletion(-)
+
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog
++++ tiff-4.0.7/ChangeLog
+@@ -1,3 +1,10 @@
++2016-12-02 Even Rouault <even.rouault at spatialys.com>
++
++       * libtiff/tif_read.c, libtiff/tiffiop.h: fix uint32 overflow in
++       TIFFReadEncodedStrip() that caused an integer division by zero.
++       Reported by Agostino Sarubbo.
++       Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2596
++
+ 2017-07-15  Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* tools/tiff2pdf.c: prevent heap buffer overflow write in "Raw"
+Index: tiff-4.0.7/libtiff/tif_read.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_read.c
++++ tiff-4.0.7/libtiff/tif_read.c
+@@ -346,7 +346,7 @@ TIFFReadEncodedStrip(TIFF* tif, uint32 s
+ 	rowsperstrip=td->td_rowsperstrip;
+ 	if (rowsperstrip>td->td_imagelength)
+ 		rowsperstrip=td->td_imagelength;
+-	stripsperplane=((td->td_imagelength+rowsperstrip-1)/rowsperstrip);
++	stripsperplane= TIFFhowmany_32_maxuint_compat(td->td_imagelength, rowsperstrip);
+ 	stripinplane=(strip%stripsperplane);
+ 	plane=(uint16)(strip/stripsperplane);
+ 	rows=td->td_imagelength-stripinplane*rowsperstrip;
+Index: tiff-4.0.7/libtiff/tiffiop.h
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tiffiop.h
++++ tiff-4.0.7/libtiff/tiffiop.h
+@@ -250,6 +250,10 @@ struct tiff {
+ #define TIFFhowmany_32(x, y) (((uint32)x < (0xffffffff - (uint32)(y-1))) ? \
+ 			   ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) : \
+ 			   0U)
++/* Variant of TIFFhowmany_32() that doesn't return 0 if x close to MAXUINT. */
++/* Caution: TIFFhowmany_32_maxuint_compat(x,y)*y might overflow */
++#define TIFFhowmany_32_maxuint_compat(x, y) \
++			   (((uint32)(x) / (uint32)(y)) + ((((uint32)(x) % (uint32)(y)) != 0) ? 1 : 0))
+ #define TIFFhowmany8_32(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
+ #define TIFFroundup_32(x, y) (TIFFhowmany_32(x,y)*(y))
+ #define TIFFhowmany_64(x, y) ((((uint64)(x))+(((uint64)(y))-1))/((uint64)(y)))
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10267.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10267.patch
new file mode 100644
index 0000000..f4c5791
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10267.patch
@@ -0,0 +1,70 @@
+From f8203c7ab1dbd7b5c59158576bec7da90191f42f Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Sat, 3 Dec 2016 11:15:18 +0000
+Subject: [PATCH] * libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case
+ of failure in OJPEGPreDecode(). This will avoid a divide by zero, and
+ potential other issues. Reported by Agostino Sarubbo. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2611
+
+Upstream-Status: Backport
+
+CVE: CVE-2016-10267
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+---
+ ChangeLog           | 7 +++++++
+ libtiff/tif_ojpeg.c | 8 ++++++++
+ 2 files changed, 15 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index 7339c1a..66fbcdc 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,10 @@
++2016-12-03 Even Rouault <even.rouault at spatialys.com>
++ 
++	* libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in
++	OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues.
++	Reported by Agostino Sarubbo.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2611
++
+ 2016-12-02 Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* libtiff/tif_read.c, libtiff/tiffiop.h: fix uint32 overflow in
+diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c
+index 1ccc3f9..f19e8fd 100644
+--- a/libtiff/tif_ojpeg.c
++++ b/libtiff/tif_ojpeg.c
+@@ -244,6 +244,7 @@ typedef enum {
+ 
+ typedef struct {
+ 	TIFF* tif;
++        int decoder_ok;
+ 	#ifndef LIBJPEG_ENCAP_EXTERNAL
+ 	JMP_BUF exit_jmpbuf;
+ 	#endif
+@@ -722,6 +723,7 @@ OJPEGPreDecode(TIFF* tif, uint16 s)
+ 		}
+ 		sp->write_curstrile++;
+ 	}
++	sp->decoder_ok = 1;
+ 	return(1);
+ }
+ 
+@@ -784,8 +786,14 @@ OJPEGPreDecodeSkipScanlines(TIFF* tif)
+ static int
+ OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+ {
++        static const char module[]="OJPEGDecode";
+ 	OJPEGState* sp=(OJPEGState*)tif->tif_data;
+ 	(void)s;
++        if( !sp->decoder_ok )
++        {
++            TIFFErrorExt(tif->tif_clientdata,module,"Cannot decode: decoder not correctly initialized");
++            return 0;
++        }
+ 	if (sp->libjpeg_jpeg_query_style==0)
+ 	{
+ 		if (OJPEGDecodeRaw(tif,buf,cc)==0)
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10268.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10268.patch
new file mode 100644
index 0000000..03b982a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10268.patch
@@ -0,0 +1,30 @@
+From 5397a417e61258c69209904e652a1f409ec3b9df Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Fri, 2 Dec 2016 22:13:32 +0000
+Subject: [PATCH] * tools/tiffcp.c: avoid uint32 underflow in cpDecodedStrips
+ that can cause various issues, such as buffer overflows in the library.
+ Reported by Agostino Sarubbo. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2598
+
+Upstream-Status: Backport
+CVE: CVE-2016-10268
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+
+---
+ ChangeLog      | 7 +++++++
+ tools/tiffcp.c | 2 +-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+Index: tiff-4.0.7/tools/tiffcp.c
+===================================================================
+--- tiff-4.0.7.orig/tools/tiffcp.c
++++ tiff-4.0.7/tools/tiffcp.c
+@@ -985,7 +985,7 @@ DECLAREcpFunc(cpDecodedStrips)
+ 		tstrip_t s, ns = TIFFNumberOfStrips(in);
+ 		uint32 row = 0;
+ 		_TIFFmemset(buf, 0, stripsize);
+-		for (s = 0; s < ns; s++) {
++		for (s = 0; s < ns && row < imagelength; s++) {
+ 			tsize_t cc = (row + rowsperstrip > imagelength) ?
+ 			    TIFFVStripSize(in, imagelength - row) : stripsize;
+ 			if (TIFFReadEncodedStrip(in, s, buf, cc) < 0
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10269.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10269.patch
new file mode 100644
index 0000000..d9f4a15
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10269.patch
@@ -0,0 +1,131 @@
+From 10f72dd232849d0142a0688bcc9aa71025f120a3 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Fri, 2 Dec 2016 23:05:51 +0000
+Subject: [PATCH 2/4] * libtiff/tif_pixarlog.c, libtiff/tif_luv.c: fix
+ heap-based buffer overflow on generation of PixarLog / LUV compressed files,
+ with ColorMap, TransferFunction attached and nasty plays with bitspersample.
+ The fix for LUV has not been tested, but suffers from the same kind of issue
+ of PixarLog. Reported by Agostino Sarubbo. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2604
+
+Upstream-Status: Backport
+
+CVE: CVE-2016-10269
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+---
+ ChangeLog              | 10 ++++++++++
+ libtiff/tif_luv.c      | 18 ++++++++++++++----
+ libtiff/tif_pixarlog.c | 17 +++++++++++++++--
+ 3 files changed, 39 insertions(+), 6 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 2e913b6..0a2c2a7 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,4 +1,14 @@
+ 2016-12-03 Even Rouault <even.rouault at spatialys.com>
++
++	* libtiff/tif_pixarlog.c, libtiff/tif_luv.c: fix heap-based buffer
++	overflow on generation of PixarLog / LUV compressed files, with
++	ColorMap, TransferFunction attached and nasty plays with bitspersample.
++	The fix for LUV has not been tested, but suffers from the same kind
++	of issue of PixarLog.
++	Reported by Agostino Sarubbo.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2604
++
++2016-12-03 Even Rouault <even.rouault at spatialys.com>
+  
+ 	* libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in
+ 	OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues.
+diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c
+index f68a9b1..e6783db 100644
+--- a/libtiff/tif_luv.c
++++ b/libtiff/tif_luv.c
+@@ -158,6 +158,7 @@
+ typedef struct logLuvState LogLuvState;
+ 
+ struct logLuvState {
++        int                     encoder_state;  /* 1 if encoder correctly initialized */
+ 	int                     user_datafmt;   /* user data format */
+ 	int                     encode_meth;    /* encoding method */
+ 	int                     pixel_size;     /* bytes per pixel */
+@@ -1552,6 +1553,7 @@ LogLuvSetupEncode(TIFF* tif)
+ 		    td->td_photometric, "must be either LogLUV or LogL");
+ 		break;
+ 	}
++	sp->encoder_state = 1;
+ 	return (1);
+ notsupported:
+ 	TIFFErrorExt(tif->tif_clientdata, module,
+@@ -1563,19 +1565,27 @@ notsupported:
+ static void
+ LogLuvClose(TIFF* tif)
+ {
++        LogLuvState* sp = (LogLuvState*) tif->tif_data;
+ 	TIFFDirectory *td = &tif->tif_dir;
+ 
++	assert(sp != 0);
+ 	/*
+ 	 * For consistency, we always want to write out the same
+ 	 * bitspersample and sampleformat for our TIFF file,
+ 	 * regardless of the data format being used by the application.
+ 	 * Since this routine is called after tags have been set but
+ 	 * before they have been recorded in the file, we reset them here.
++         * Note: this is really a nasty approach. See PixarLogClose
+ 	 */
+-	td->td_samplesperpixel =
+-	    (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3;
+-	td->td_bitspersample = 16;
+-	td->td_sampleformat = SAMPLEFORMAT_INT;
++        if( sp->encoder_state )
++        {
++            /* See PixarLogClose. Might avoid issues with tags whose size depends
++             * on those below, but not completely sure this is enough. */
++            td->td_samplesperpixel =
++                (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3;
++            td->td_bitspersample = 16;
++            td->td_sampleformat = SAMPLEFORMAT_INT;
++        }
+ }
+ 
+ static void
+diff --git a/libtiff/tif_pixarlog.c b/libtiff/tif_pixarlog.c
+index d1246c3..aa99bc9 100644
+--- a/libtiff/tif_pixarlog.c
++++ b/libtiff/tif_pixarlog.c
+@@ -1233,8 +1233,10 @@ PixarLogPostEncode(TIFF* tif)
+ static void
+ PixarLogClose(TIFF* tif)
+ {
++        PixarLogState* sp = (PixarLogState*) tif->tif_data;
+ 	TIFFDirectory *td = &tif->tif_dir;
+ 
++	assert(sp != 0);
+ 	/* In a really sneaky (and really incorrect, and untruthful, and
+ 	 * troublesome, and error-prone) maneuver that completely goes against
+ 	 * the spirit of TIFF, and breaks TIFF, on close, we covertly
+@@ -1243,8 +1245,19 @@ PixarLogClose(TIFF* tif)
+ 	 * readers that don't know about PixarLog, or how to set
+ 	 * the PIXARLOGDATFMT pseudo-tag.
+ 	 */
+-	td->td_bitspersample = 8;
+-	td->td_sampleformat = SAMPLEFORMAT_UINT;
++
++        if (sp->state&PLSTATE_INIT) {
++            /* We test the state to avoid an issue such as in
++             * http://bugzilla.maptools.org/show_bug.cgi?id=2604
++             * What appends in that case is that the bitspersample is 1 and
++             * a TransferFunction is set. The size of the TransferFunction
++             * depends on 1<<bitspersample. So if we increase it, an access
++             * out of the buffer will happen at directory flushing.
++             * Another option would be to clear those targs. 
++             */
++            td->td_bitspersample = 8;
++            td->td_sampleformat = SAMPLEFORMAT_UINT;
++        }
+ }
+ 
+ static void
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10270.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10270.patch
new file mode 100644
index 0000000..43ad6ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10270.patch
@@ -0,0 +1,134 @@
+From 6e7042c61e300cf9971c645c79d05de974b24308 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Sat, 3 Dec 2016 11:02:15 +0000
+Subject: [PATCH 3/4] * libtiff/tif_dirread.c: modify
+ ChopUpSingleUncompressedStrip() to instanciate compute ntrips as
+ TIFFhowmany_32(td->td_imagelength, rowsperstrip), instead of a logic based on
+ the total size of data. Which is faulty is the total size of data is not
+ sufficient to fill the whole image, and thus results in reading outside of
+ the StripByCounts/StripOffsets arrays when using TIFFReadScanline(). Reported
+ by Agostino Sarubbo. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2608.
+
+* libtiff/tif_strip.c: revert the change in TIFFNumberOfStrips() done
+for http://bugzilla.maptools.org/show_bug.cgi?id=2587 / CVE-2016-9273 since
+the above change is a better fix that makes it unnecessary.
+
+Upstream-Status: Backport
+
+CVE: CVE-2016-10270
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+---
+ ChangeLog             | 15 +++++++++++++++
+ libtiff/tif_dirread.c | 22 ++++++++++------------
+ libtiff/tif_strip.c   |  9 ---------
+ 3 files changed, 25 insertions(+), 21 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 0a2c2a7..6e30e41 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,5 +1,20 @@
+ 2016-12-03 Even Rouault <even.rouault at spatialys.com>
+ 
++	* libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to
++	instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip),
++	instead of a logic based on the total size of data. Which is faulty is
++	the total size of data is not sufficient to fill the whole image, and thus
++	results in reading outside of the StripByCounts/StripOffsets arrays when
++	using TIFFReadScanline().
++	Reported by Agostino Sarubbo.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2608.
++
++	* libtiff/tif_strip.c: revert the change in TIFFNumberOfStrips() done
++	for http://bugzilla.maptools.org/show_bug.cgi?id=2587 / CVE-2016-9273 since
++	the above change is a better fix that makes it unnecessary.
++
++2016-12-03 Even Rouault <even.rouault at spatialys.com>
++
+ 	* libtiff/tif_pixarlog.c, libtiff/tif_luv.c: fix heap-based buffer
+ 	overflow on generation of PixarLog / LUV compressed files, with
+ 	ColorMap, TransferFunction attached and nasty plays with bitspersample.
+diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
+index 3eec79c..570d0c3 100644
+--- a/libtiff/tif_dirread.c
++++ b/libtiff/tif_dirread.c
+@@ -5502,8 +5502,7 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
+ 	uint64 rowblockbytes;
+ 	uint64 stripbytes;
+ 	uint32 strip;
+-	uint64 nstrips64;
+-	uint32 nstrips32;
++	uint32 nstrips;
+ 	uint32 rowsperstrip;
+ 	uint64* newcounts;
+ 	uint64* newoffsets;
+@@ -5534,18 +5533,17 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
+ 	    return;
+ 
+ 	/*
+-	 * never increase the number of strips in an image
++	 * never increase the number of rows per strip
+ 	 */
+ 	if (rowsperstrip >= td->td_rowsperstrip)
+ 		return;
+-	nstrips64 = TIFFhowmany_64(bytecount, stripbytes);
+-	if ((nstrips64==0)||(nstrips64>0xFFFFFFFF)) /* something is wonky, do nothing. */
+-	    return;
+-	nstrips32 = (uint32)nstrips64;
++        nstrips = TIFFhowmany_32(td->td_imagelength, rowsperstrip);
++        if( nstrips == 0 )
++            return;
+ 
+-	newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips32, sizeof (uint64),
++	newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
+ 				"for chopped \"StripByteCounts\" array");
+-	newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips32, sizeof (uint64),
++	newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
+ 				"for chopped \"StripOffsets\" array");
+ 	if (newcounts == NULL || newoffsets == NULL) {
+ 		/*
+@@ -5562,18 +5560,18 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
+ 	 * Fill the strip information arrays with new bytecounts and offsets
+ 	 * that reflect the broken-up format.
+ 	 */
+-	for (strip = 0; strip < nstrips32; strip++) {
++	for (strip = 0; strip < nstrips; strip++) {
+ 		if (stripbytes > bytecount)
+ 			stripbytes = bytecount;
+ 		newcounts[strip] = stripbytes;
+-		newoffsets[strip] = offset;
++		newoffsets[strip] = stripbytes ? offset : 0;
+ 		offset += stripbytes;
+ 		bytecount -= stripbytes;
+ 	}
+ 	/*
+ 	 * Replace old single strip info with multi-strip info.
+ 	 */
+-	td->td_stripsperimage = td->td_nstrips = nstrips32;
++	td->td_stripsperimage = td->td_nstrips = nstrips;
+ 	TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
+ 
+ 	_TIFFfree(td->td_stripbytecount);
+diff --git a/libtiff/tif_strip.c b/libtiff/tif_strip.c
+index 4c46ecf..1676e47 100644
+--- a/libtiff/tif_strip.c
++++ b/libtiff/tif_strip.c
+@@ -63,15 +63,6 @@ TIFFNumberOfStrips(TIFF* tif)
+ 	TIFFDirectory *td = &tif->tif_dir;
+ 	uint32 nstrips;
+ 
+-    /* If the value was already computed and store in td_nstrips, then return it,
+-       since ChopUpSingleUncompressedStrip might have altered and resized the
+-       since the td_stripbytecount and td_stripoffset arrays to the new value
+-       after the initial affectation of td_nstrips = TIFFNumberOfStrips() in
+-       tif_dirread.c ~line 3612.
+-       See http://bugzilla.maptools.org/show_bug.cgi?id=2587 */
+-    if( td->td_nstrips )
+-        return td->td_nstrips;
+-
+ 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
+ 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
+ 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10271.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10271.patch
new file mode 100644
index 0000000..4fe5bcd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2016-10271.patch
@@ -0,0 +1,30 @@
+From 9657bbe3cdce4aaa90e07d50c1c70ae52da0ba6a Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Sat, 3 Dec 2016 11:35:56 +0000
+Subject: [PATCH] * tools/tiffcrop.c: fix readContigStripsIntoBuffer() in -i
+ (ignore) mode so that the output buffer is correctly incremented to avoid
+ write outside bounds. Reported by Agostino Sarubbo. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2620
+
+Upstream-Status: Backport
+CVE: CVE-2016-10271
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+
+---
+ ChangeLog        | 7 +++++++
+ tools/tiffcrop.c | 2 +-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+Index: tiff-4.0.7/tools/tiffcrop.c
+===================================================================
+--- tiff-4.0.7.orig/tools/tiffcrop.c
++++ tiff-4.0.7/tools/tiffcrop.c
+@@ -3698,7 +3698,7 @@ static int readContigStripsIntoBuffer (T
+                                   (unsigned long) strip, (unsigned long)rows);
+                         return 0;
+                 }
+-                bufp += bytes_read;
++                bufp += stripsize;
+         }
+ 
+         return 1;
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-10688.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-10688.patch
new file mode 100644
index 0000000..ed9c0f5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-10688.patch
@@ -0,0 +1,88 @@
+From 333ba5599e87bd7747516d7863d61764e4ca2d92 Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Fri, 30 Jun 2017 17:29:44 +0000
+Subject: [PATCH] * libtiff/tif_dirwrite.c: in
+ TIFFWriteDirectoryTagCheckedXXXX() functions associated with LONG8/SLONG8
+ data type, replace assertion that the file is BigTIFF, by a non-fatal error.
+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2712 Reported by team
+ OWL337
+
+Upstream-Status: Backport
+[https://github.com/vadz/libtiff/commit/6173a57d39e04d68b139f8c1aa499a24dbe74ba1]
+
+CVE: CVE-2017-10688
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ ChangeLog              |  8 ++++++++
+ libtiff/tif_dirwrite.c | 20 ++++++++++++++++----
+ 2 files changed, 24 insertions(+), 4 deletions(-)
+
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog
++++ tiff-4.0.7/ChangeLog
+@@ -1,3 +1,11 @@
++2017-06-30  Even Rouault <even.rouault at spatialys.com>
++
++	* libtiff/tif_dirwrite.c: in TIFFWriteDirectoryTagCheckedXXXX()
++	functions associated with LONG8/SLONG8 data type, replace assertion that
++	the file is BigTIFF, by a non-fatal error.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2712
++	Reported by team OWL337
++
+ 2017-06-26  Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* libtiff/tif_jbig.c: fix memory leak in error code path of JBIGDecode()
+Index: tiff-4.0.7/libtiff/tif_dirwrite.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_dirwrite.c
++++ tiff-4.0.7/libtiff/tif_dirwrite.c
+@@ -2047,7 +2047,10 @@ TIFFWriteDirectoryTagCheckedLong8(TIFF*
+ {
+ 	uint64 m;
+ 	assert(sizeof(uint64)==8);
+-	assert(tif->tif_flags&TIFF_BIGTIFF);
++	if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
++		TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","LONG8 not allowed for ClassicTIFF");
++		return(0);
++	}
+ 	m=value;
+ 	if (tif->tif_flags&TIFF_SWAB)
+ 		TIFFSwabLong8(&m);
+@@ -2060,7 +2063,10 @@ TIFFWriteDirectoryTagCheckedLong8Array(T
+ {
+ 	assert(count<0x20000000);
+ 	assert(sizeof(uint64)==8);
+-	assert(tif->tif_flags&TIFF_BIGTIFF);
++	if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
++		TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","LONG8 not allowed for ClassicTIFF");
++		return(0);
++	}
+ 	if (tif->tif_flags&TIFF_SWAB)
+ 		TIFFSwabArrayOfLong8(value,count);
+ 	return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_LONG8,count,count*8,value));
+@@ -2072,7 +2078,10 @@ TIFFWriteDirectoryTagCheckedSlong8(TIFF*
+ {
+ 	int64 m;
+ 	assert(sizeof(int64)==8);
+-	assert(tif->tif_flags&TIFF_BIGTIFF);
++	if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
++		TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","SLONG8 not allowed for ClassicTIFF");
++		return(0);
++	}
+ 	m=value;
+ 	if (tif->tif_flags&TIFF_SWAB)
+ 		TIFFSwabLong8((uint64*)(&m));
+@@ -2085,7 +2094,10 @@ TIFFWriteDirectoryTagCheckedSlong8Array(
+ {
+ 	assert(count<0x20000000);
+ 	assert(sizeof(int64)==8);
+-	assert(tif->tif_flags&TIFF_BIGTIFF);
++	if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
++		TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","SLONG8 not allowed for ClassicTIFF");
++		return(0);
++	}
+ 	if (tif->tif_flags&TIFF_SWAB)
+ 		TIFFSwabArrayOfLong8((uint64*)value,count);
+ 	return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG8,count,count*8,value));
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-11335.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-11335.patch
new file mode 100644
index 0000000..d08e761
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-11335.patch
@@ -0,0 +1,54 @@
+From e8b15ccf8c9c593000f8202cf34cc6c4b936d01e Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Sat, 15 Jul 2017 11:13:46 +0000
+Subject: [PATCH] * tools/tiff2pdf.c: prevent heap buffer overflow write in
+ "Raw" mode on PlanarConfig=Contig input images. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2715 Reported by team OWL337
+
+Upstream-Status: Backport
+[https://github.com/vadz/libtiff/commit/69bfeec247899776b1b396651adb47436e5f1556]
+
+CVE: CVE-2017-11355
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ ChangeLog        | 7 +++++++
+ tools/tiff2pdf.c | 7 ++++++-
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 42eaeb7..6980da8 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,10 @@
++2017-07-15  Even Rouault <even.rouault at spatialys.com>
++
++	* tools/tiff2pdf.c: prevent heap buffer overflow write in "Raw"
++	mode on PlanarConfig=Contig input images.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2715
++	Reported by team OWL337
++
+ 2017-06-30  Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* libtiff/tif_dirwrite.c: in TIFFWriteDirectoryTagCheckedXXXX()
+diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
+index db196e0..cd1e235 100644
+--- a/tools/tiff2pdf.c
++++ b/tools/tiff2pdf.c
+@@ -1737,7 +1737,12 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
+ 	    return;
+ 
+ 	t2p->pdf_transcode = T2P_TRANSCODE_ENCODE;
+-	if(t2p->pdf_nopassthrough==0){
++        /* It seems that T2P_TRANSCODE_RAW mode doesn't support separate->contig */
++        /* conversion. At least t2p_read_tiff_size and t2p_read_tiff_size_tile */
++        /* do not take into account the number of samples, and thus */
++        /* that can cause heap buffer overflows such as in */
++        /* http://bugzilla.maptools.org/show_bug.cgi?id=2715 */
++	if(t2p->pdf_nopassthrough==0 && t2p->tiff_planar!=PLANARCONFIG_SEPARATE){
+ #ifdef CCITT_SUPPORT
+ 		if(t2p->tiff_compression==COMPRESSION_CCITTFAX4  
+ 			){
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7592.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7592.patch
new file mode 100644
index 0000000..5b80445
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7592.patch
@@ -0,0 +1,40 @@
+From 48780b4fcc425cddc4ef8ffdf536f96a0d1b313b Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Wed, 11 Jan 2017 16:38:26 +0000
+Subject: [PATCH] * libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
+avoid UndefinedBehaviorSanitizer warning.
+Patch by Nicolas Pena.
+Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2658
+
+Upstream-Status: Backport
+CVE: CVE-2017-7592
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog	2017-04-24 14:25:10.143926025 +0530
++++ tiff-4.0.7/ChangeLog	2017-04-24 15:20:21.291839230 +0530
+@@ -1,3 +1,10 @@
++2017-01-11 Even Rouault <even.rouault at spatialys.com>
++
++	* libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
++	avoid UndefinedBehaviorSanitizer warning.
++	Patch by Nicolas Pena.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2658
++
+ 2016-12-03 Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to
+Index: tiff-4.0.7/libtiff/tif_getimage.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_getimage.c	2016-11-18 08:17:45.000000000 +0530
++++ tiff-4.0.7/libtiff/tif_getimage.c	2017-04-24 15:17:46.671843283 +0530
+@@ -1305,7 +1305,7 @@
+     while (h-- > 0) {
+ 	for (x = w; x-- > 0;)
+         {
+-            *cp++ = BWmap[*pp][0] & (*(pp+1) << 24 | ~A1);
++            *cp++ = BWmap[*pp][0] & ((uint32)*(pp+1) << 24 | ~A1);
+             pp += samplesperpixel;
+         }
+ 	cp += toskew;
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7593.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7593.patch
new file mode 100644
index 0000000..380dfcb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7593.patch
@@ -0,0 +1,98 @@
+From d60332057b9575ada4f264489582b13e30137be1 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Wed, 11 Jan 2017 19:02:49 +0000
+Subject: [PATCH] * libtiff/tiffiop.h, tif_unix.c, tif_win32.c, tif_vms.c: add
+ _TIFFcalloc()
+
+* libtiff/tif_read.c: TIFFReadBufferSetup(): use _TIFFcalloc() to zero
+initialize tif_rawdata.
+Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2651
+
+Upstream-Status: Backport
+
+CVE: CVE-2017-7593
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog	2017-04-25 19:03:20.584155452 +0530
++++ tiff-4.0.7/ChangeLog	2017-04-26 12:09:41.986866896 +0530
+@@ -44,6 +44,14 @@
+ 
+ 2017-01-11 Even Rouault <even.rouault at spatialys.com>
+ 
++	* libtiff/tiffiop.h, tif_unix.c, tif_win32.c : add _TIFFcalloc()
++
++	* libtiff/tif_read.c: TIFFReadBufferSetup(): use _TIFFcalloc() to zero
++	initialize tif_rawdata.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2651
++
++2017-01-11 Even Rouault <even.rouault at spatialys.com>
++
+ 	* libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
+ 	avoid UndefinedBehaviorSanitizer warning.
+ 	Patch by Nicolas Pena.
+Index: tiff-4.0.7/libtiff/tif_read.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_read.c	2017-04-25 19:03:20.584155452 +0530
++++ tiff-4.0.7/libtiff/tif_read.c	2017-04-26 12:11:42.814863729 +0530
+@@ -986,7 +986,9 @@
+ 				 "Invalid buffer size");
+ 		    return (0);
+ 		}
+-		tif->tif_rawdata = (uint8*) _TIFFmalloc(tif->tif_rawdatasize);
++                /* Initialize to zero to avoid uninitialized buffers in case of */
++                /* short reads (http://bugzilla.maptools.org/show_bug.cgi?id=2651) */
++                tif->tif_rawdata = (uint8*) _TIFFcalloc(1, tif->tif_rawdatasize);
+ 		tif->tif_flags |= TIFF_MYBUFFER;
+ 	}
+ 	if (tif->tif_rawdata == NULL) {
+Index: tiff-4.0.7/libtiff/tif_unix.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_unix.c	2015-08-29 03:46:22.707817041 +0530
++++ tiff-4.0.7/libtiff/tif_unix.c	2017-04-26 12:13:07.442861510 +0530
+@@ -316,6 +316,14 @@
+ 	return (malloc((size_t) s));
+ }
+ 
++void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)
++{
++    if( nmemb == 0 || siz == 0 )
++        return ((void *) NULL);
++
++    return calloc((size_t) nmemb, (size_t)siz);
++}
++
+ void
+ _TIFFfree(void* p)
+ {
+Index: tiff-4.0.7/libtiff/tif_win32.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_win32.c	2015-08-29 03:46:22.730570169 +0530
++++ tiff-4.0.7/libtiff/tif_win32.c	2017-04-26 12:14:12.918859794 +0530
+@@ -360,6 +360,14 @@
+ 	return (malloc((size_t) s));
+ }
+ 
++void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)
++{
++    if( nmemb == 0 || siz == 0 )
++        return ((void *) NULL);
++
++    return calloc((size_t) nmemb, (size_t)siz);
++}
++
+ void
+ _TIFFfree(void* p)
+ {
+Index: tiff-4.0.7/libtiff/tiffio.h
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tiffio.h	2016-01-24 21:09:51.894442042 +0530
++++ tiff-4.0.7/libtiff/tiffio.h	2017-04-26 12:15:55.034857117 +0530
+@@ -293,6 +293,7 @@
+  */
+ 
+ extern void* _TIFFmalloc(tmsize_t s);
++extern void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz);
+ extern void* _TIFFrealloc(void* p, tmsize_t s);
+ extern void _TIFFmemset(void* p, int v, tmsize_t c);
+ extern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7594-p1.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7594-p1.patch
new file mode 100644
index 0000000..5c7e460
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7594-p1.patch
@@ -0,0 +1,43 @@
+rom 8283e4d1b7e53340684d12932880cbcbaf23a8c1 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Thu, 12 Jan 2017 17:43:25 +0000
+
+* libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesAcTable
+  when read fails.
+  Patch by Nicolas Pena.
+  Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659
+
+Upstream-Status: Backport
+
+CVE: CVE-2017-7594 #patch1
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog	2017-04-24 16:13:15.000000000 +0530
++++ tiff-4.0.7/ChangeLog	2017-04-24 16:50:26.465897646 +0530
+@@ -1,3 +1,10 @@
++2017-01-12 Even Rouault <even.rouault at spatialys.com>
++
++	* libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesAcTable
++	when read fails.
++	Patch by Nicolás Peña.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659
++
+ 2017-01-11 Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
+Index: tiff-4.0.7/libtiff/tif_ojpeg.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_ojpeg.c	2017-04-24 16:02:29.817973051 +0530
++++ tiff-4.0.7/libtiff/tif_ojpeg.c	2017-04-24 16:52:27.349894477 +0530
+@@ -1918,7 +1918,10 @@
+ 				rb[sizeof(uint32)+5+n]=o[n];
+ 			p=(uint32)TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
+ 			if (p!=q)
++                        {
++                                _TIFFfree(rb);
+ 				return(0);
++                        }
+ 			sp->actable[m]=rb;
+ 			sp->sos_tda[m]=(sp->sos_tda[m]|m);
+ 		}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7594-p2.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7594-p2.patch
new file mode 100644
index 0000000..82a19c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7594-p2.patch
@@ -0,0 +1,50 @@
+From 2ea32f7372b65c24b2816f11c04bf59b5090d05b Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Thu, 12 Jan 2017 19:23:20 +0000
+Subject: [PATCH 2/2] * libtiff/tif_ojpeg.c: fix leak in
+ OJPEGReadHeaderInfoSecTablesQTable, OJPEGReadHeaderInfoSecTablesDcTable and
+ OJPEGReadHeaderInfoSecTablesAcTable
+
+Upstream-status: Backport
+
+CVE: CVE-2017-7594 #patch2
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog	2017-04-24 16:50:26.465897646 +0530
++++ tiff-4.0.7/ChangeLog	2017-04-24 16:56:20.685888360 +0530
+@@ -1,6 +1,7 @@
+ 2017-01-12 Even Rouault <even.rouault at spatialys.com>
+ 
+-	* libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesAcTable
++	* libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesQTable,
++	OJPEGReadHeaderInfoSecTablesDcTable and OJPEGReadHeaderInfoSecTablesAcTable
+ 	when read fails.
+ 	Patch by Nicolás Peña.
+ 	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659
+Index: tiff-4.0.7/libtiff/tif_ojpeg.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_ojpeg.c	2017-04-24 16:52:27.349894477 +0530
++++ tiff-4.0.7/libtiff/tif_ojpeg.c	2017-04-24 16:59:20.001883660 +0530
+@@ -1790,7 +1790,10 @@
+ 			TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET); 
+ 			p=(uint32)TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
+ 			if (p!=64)
++                        {
++                                _TIFFfree(ob);
+ 				return(0);
++                        }
+ 			sp->qtable[m]=ob;
+ 			sp->sof_tq[m]=m;
+ 		}
+@@ -1854,7 +1857,10 @@
+ 				rb[sizeof(uint32)+5+n]=o[n];
+ 			p=(uint32)TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
+ 			if (p!=q)
++                        {
++                                _TIFFfree(rb);
+ 				return(0);
++                        }
+ 			sp->dctable[m]=rb;
+ 			sp->sos_tda[m]=(m<<4);
+ 		}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7595.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7595.patch
new file mode 100644
index 0000000..851a37f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7595.patch
@@ -0,0 +1,48 @@
+commit 618d490090bfd10e613ac574ecff31a293904b44
+Author: erouault <erouault>
+Date:   Wed Jan 11 12:15:01 2017 +0000
+
+    * libtiff/tif_jpeg.c: avoid integer division by zero
+      in JPEGSetupEncode() when horizontal or vertical sampling is set to 0.
+      Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2653
+
+Upstream-Status: Backport
+
+CVE: CVE-2017-7595
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog	2017-04-24 17:31:40.013832807 +0530
++++ tiff-4.0.7/ChangeLog	2017-04-24 18:03:34.769782616 +0530
+@@ -8,6 +8,12 @@
+ 
+ 2017-01-11 Even Rouault <even.rouault at spatialys.com>
+ 
++	* libtiff/tif_jpeg.c: avoid integer division by zero in
++	JPEGSetupEncode() when horizontal or vertical sampling is set to 0.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2653
++
++2017-01-11 Even Rouault <even.rouault at spatialys.com>
++
+ 	* libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
+ 	avoid UndefinedBehaviorSanitizer warning.
+ 	Patch by Nicolas Pena.
+Index: tiff-4.0.7/libtiff/tif_jpeg.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_jpeg.c	2016-01-24 21:09:51.781641625 +0530
++++ tiff-4.0.7/libtiff/tif_jpeg.c	2017-04-24 18:05:59.777778815 +0530
+@@ -1626,6 +1626,13 @@
+ 	case PHOTOMETRIC_YCBCR:
+ 		sp->h_sampling = td->td_ycbcrsubsampling[0];
+ 		sp->v_sampling = td->td_ycbcrsubsampling[1];
++                if( sp->h_sampling == 0 || sp->v_sampling == 0 )
++                {
++                      TIFFErrorExt(tif->tif_clientdata, module,
++                                   "Invalig horizontal/vertical sampling value");
++                      return (0);
++                }
++
+ 		/*
+ 		 * A ReferenceBlackWhite field *must* be present since the
+ 		 * default value is inappropriate for YCbCr.  Fill in the
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7596.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7596.patch
new file mode 100644
index 0000000..1945c3d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7596.patch
@@ -0,0 +1,308 @@
+From 3144e57770c1e4d26520d8abee750f8ac8b75490 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Wed, 11 Jan 2017 16:09:02 +0000
+Subject: [PATCH] * libtiff/tif_dir.c, tif_dirread.c, tif_dirwrite.c: implement
+ various clampings of double to other data types to avoid undefined behaviour
+ if the output range isn't big enough to hold the input value. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2643
+ http://bugzilla.maptools.org/show_bug.cgi?id=2642
+ http://bugzilla.maptools.org/show_bug.cgi?id=2646
+ http://bugzilla.maptools.org/show_bug.cgi?id=2647
+
+Upstream-Status: Backport
+
+CVE: CVE-2017-7596
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog	2017-04-25 15:53:40.294592812 +0530
++++ tiff-4.0.7/ChangeLog	2017-04-25 16:02:03.238600641 +0530
+@@ -6,6 +6,16 @@
+ 	Patch by Nicolás Peña.
+ 	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659
+ 
++2017-01-11 Even Rouault <even.rouault at spatialys.com>
++
++	* libtiff/tif_dir.c, tif_dirread.c, tif_dirwrite.c: implement various clampings
++	of double to other data types to avoid undefined behaviour if the output range
++	isn't big enough to hold the input value.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2643
++	http://bugzilla.maptools.org/show_bug.cgi?id=2642
++	http://bugzilla.maptools.org/show_bug.cgi?id=2646
++	http://bugzilla.maptools.org/show_bug.cgi?id=2647
++
+ 2017-01-11 Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* libtiff/tif_jpeg.c: avoid integer division by zero in
+Index: tiff-4.0.7/libtiff/tif_dir.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_dir.c	2016-10-30 04:33:18.856598072 +0530
++++ tiff-4.0.7/libtiff/tif_dir.c	2017-04-25 16:02:03.238600641 +0530
+@@ -31,6 +31,7 @@
+  * (and also some miscellaneous stuff)
+  */
+ #include "tiffiop.h"
++#include <float.h>
+ 
+ /*
+  * These are used in the backwards compatibility code...
+@@ -154,6 +155,15 @@
+ 	return (0);
+ }
+ 
++static float TIFFClampDoubleToFloat( double val )
++{
++    if( val > FLT_MAX )
++        return FLT_MAX;
++    if( val < -FLT_MAX )
++        return -FLT_MAX;
++    return (float)val;
++}
++
+ static int
+ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
+ {
+@@ -312,13 +322,13 @@
+         dblval = va_arg(ap, double);
+         if( dblval < 0 )
+             goto badvaluedouble;
+-		td->td_xresolution = (float) dblval;
++		td->td_xresolution = TIFFClampDoubleToFloat( dblval );
+ 		break;
+ 	case TIFFTAG_YRESOLUTION:
+         dblval = va_arg(ap, double);
+         if( dblval < 0 )
+             goto badvaluedouble;
+-		td->td_yresolution = (float) dblval;
++		td->td_yresolution = TIFFClampDoubleToFloat( dblval );
+ 		break;
+ 	case TIFFTAG_PLANARCONFIG:
+ 		v = (uint16) va_arg(ap, uint16_vap);
+@@ -327,10 +337,10 @@
+ 		td->td_planarconfig = (uint16) v;
+ 		break;
+ 	case TIFFTAG_XPOSITION:
+-		td->td_xposition = (float) va_arg(ap, double);
++		td->td_xposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
+ 		break;
+ 	case TIFFTAG_YPOSITION:
+-		td->td_yposition = (float) va_arg(ap, double);
++		td->td_yposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
+ 		break;
+ 	case TIFFTAG_RESOLUTIONUNIT:
+ 		v = (uint16) va_arg(ap, uint16_vap);
+Index: tiff-4.0.7/libtiff/tif_dirread.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_dirread.c	2017-04-25 15:53:40.134592810 +0530
++++ tiff-4.0.7/libtiff/tif_dirread.c	2017-04-25 16:02:03.242600641 +0530
+@@ -40,6 +40,7 @@
+  */
+ 
+ #include "tiffiop.h"
++#include <float.h>
+ 
+ #define IGNORE 0          /* tag placeholder used below */
+ #define FAILED_FII    ((uint32) -1)
+@@ -2406,7 +2407,14 @@
+ 				ma=(double*)origdata;
+ 				mb=data;
+ 				for (n=0; n<count; n++)
+-					*mb++=(float)(*ma++);
++                                {
++                                    double val = *ma++;
++                                    if( val > FLT_MAX )
++                                        val = FLT_MAX;
++                                    else if( val < -FLT_MAX )
++                                        val = -FLT_MAX;
++                                    *mb++=(float)val;
++                                }
+ 			}
+ 			break;
+ 	}
+Index: tiff-4.0.7/libtiff/tif_dirwrite.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_dirwrite.c	2016-10-30 04:33:18.876854501 +0530
++++ tiff-4.0.7/libtiff/tif_dirwrite.c	2017-04-25 16:07:48.670606018 +0530
+@@ -30,6 +30,7 @@
+  * Directory Write Support Routines.
+  */
+ #include "tiffiop.h"
++#include <float.h>
+ 
+ #ifdef HAVE_IEEEFP
+ #define TIFFCvtNativeToIEEEFloat(tif, n, fp)
+@@ -939,6 +940,69 @@
+ 	return(0);
+ }
+ 
++static float TIFFClampDoubleToFloat( double val )
++{
++    if( val > FLT_MAX )
++        return FLT_MAX;
++    if( val < -FLT_MAX )
++        return -FLT_MAX;
++    return (float)val;
++}
++
++static int8 TIFFClampDoubleToInt8( double val )
++{
++    if( val > 127 )
++        return 127;
++    if( val < -128 || val != val )
++        return -128;
++    return (int8)val;
++}
++
++static int16 TIFFClampDoubleToInt16( double val )
++{
++    if( val > 32767 )
++        return 32767;
++    if( val < -32768 || val != val )
++        return -32768;
++    return (int16)val;
++}
++
++static int32 TIFFClampDoubleToInt32( double val )
++{
++    if( val > 0x7FFFFFFF )
++        return 0x7FFFFFFF;
++    if( val < -0x7FFFFFFF-1 || val != val )
++        return -0x7FFFFFFF-1;
++    return (int32)val;
++}
++
++static uint8 TIFFClampDoubleToUInt8( double val )
++{
++    if( val < 0 )
++        return 0;
++    if( val > 255 || val != val )
++        return 255;
++    return (uint8)val;
++}
++
++static uint16 TIFFClampDoubleToUInt16( double val )
++{
++    if( val < 0 )
++        return 0;
++    if( val > 65535 || val != val )
++        return 65535;
++    return (uint16)val;
++}
++
++static uint32 TIFFClampDoubleToUInt32( double val )
++{
++    if( val < 0 )
++        return 0;
++    if( val > 0xFFFFFFFFU || val != val )
++        return 0xFFFFFFFFU;
++    return (uint32)val;
++}
++
+ static int
+ TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
+ {
+@@ -959,7 +1023,7 @@
+ 			if (tif->tif_dir.td_bitspersample<=32)
+ 			{
+ 				for (i = 0; i < count; ++i)
+-					((float*)conv)[i] = (float)value[i];
++					((float*)conv)[i] = TIFFClampDoubleToFloat(value[i]);
+ 				ok = TIFFWriteDirectoryTagFloatArray(tif,ndir,dir,tag,count,(float*)conv);
+ 			}
+ 			else
+@@ -971,19 +1035,19 @@
+ 			if (tif->tif_dir.td_bitspersample<=8)
+ 			{
+ 				for (i = 0; i < count; ++i)
+-					((int8*)conv)[i] = (int8)value[i];
++					((int8*)conv)[i] = TIFFClampDoubleToInt8(value[i]);
+ 				ok = TIFFWriteDirectoryTagSbyteArray(tif,ndir,dir,tag,count,(int8*)conv);
+ 			}
+ 			else if (tif->tif_dir.td_bitspersample<=16)
+ 			{
+ 				for (i = 0; i < count; ++i)
+-					((int16*)conv)[i] = (int16)value[i];
++					((int16*)conv)[i] = TIFFClampDoubleToInt16(value[i]);
+ 				ok = TIFFWriteDirectoryTagSshortArray(tif,ndir,dir,tag,count,(int16*)conv);
+ 			}
+ 			else
+ 			{
+ 				for (i = 0; i < count; ++i)
+-					((int32*)conv)[i] = (int32)value[i];
++					((int32*)conv)[i] = TIFFClampDoubleToInt32(value[i]);
+ 				ok = TIFFWriteDirectoryTagSlongArray(tif,ndir,dir,tag,count,(int32*)conv);
+ 			}
+ 			break;
+@@ -991,19 +1055,19 @@
+ 			if (tif->tif_dir.td_bitspersample<=8)
+ 			{
+ 				for (i = 0; i < count; ++i)
+-					((uint8*)conv)[i] = (uint8)value[i];
++					((uint8*)conv)[i] = TIFFClampDoubleToUInt8(value[i]);
+ 				ok = TIFFWriteDirectoryTagByteArray(tif,ndir,dir,tag,count,(uint8*)conv);
+ 			}
+ 			else if (tif->tif_dir.td_bitspersample<=16)
+ 			{
+ 				for (i = 0; i < count; ++i)
+-					((uint16*)conv)[i] = (uint16)value[i];
++					((uint16*)conv)[i] = TIFFClampDoubleToUInt16(value[i]);
+ 				ok = TIFFWriteDirectoryTagShortArray(tif,ndir,dir,tag,count,(uint16*)conv);
+ 			}
+ 			else
+ 			{
+ 				for (i = 0; i < count; ++i)
+-					((uint32*)conv)[i] = (uint32)value[i];
++					((uint32*)conv)[i] = TIFFClampDoubleToUInt32(value[i]);
+ 				ok = TIFFWriteDirectoryTagLongArray(tif,ndir,dir,tag,count,(uint32*)conv);
+ 			}
+ 			break;
+@@ -2094,15 +2158,25 @@
+ static int
+ TIFFWriteDirectoryTagCheckedRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value)
+ {
++        static const char module[] = "TIFFWriteDirectoryTagCheckedRational";
+ 	uint32 m[2];
+-	assert(value>=0.0);
+ 	assert(sizeof(uint32)==4);
+-	if (value<=0.0)
++	if (value<0)
++	{
++            TIFFErrorExt(tif->tif_clientdata,module,"Negative value is illegal");
++            return 0;
++	}
++        else if( value != value )
++        {
++            TIFFErrorExt(tif->tif_clientdata,module,"Not-a-number value is illegal");
++            return 0;
++        }
++        else if (value==0.0)
+ 	{
+ 		m[0]=0;
+ 		m[1]=1;
+-	}
+-	else if (value==(double)(uint32)value)
++        }
++        else if (value <= 0xFFFFFFFFU && value==(double)(uint32)value)
+ 	{
+ 		m[0]=(uint32)value;
+ 		m[1]=1;
+@@ -2143,7 +2217,7 @@
+ 	}
+ 	for (na=value, nb=m, nc=0; nc<count; na++, nb+=2, nc++)
+ 	{
+-		if (*na<=0.0)
++                if (*na<=0.0 || *na != *na)
+ 		{
+ 			nb[0]=0;
+ 			nb[1]=1;
+@@ -2153,7 +2227,8 @@
+ 			nb[0]=(uint32)(*na);
+ 			nb[1]=1;
+ 		}
+-		else if (*na<1.0)
++		else if (*na >= 0 && *na <= (float)0xFFFFFFFFU &&
++                         *na==(float)(uint32)(*na))
+ 		{
+ 			nb[0]=(uint32)((double)(*na)*0xFFFFFFFF);
+ 			nb[1]=0xFFFFFFFF;
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7598.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7598.patch
new file mode 100644
index 0000000..6d082bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7598.patch
@@ -0,0 +1,65 @@
+From 3cfd62d77c2a7e147a05bd678524c345fa9c2bb8 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Wed, 11 Jan 2017 13:28:01 +0000
+Subject: [PATCH] * libtiff/tif_dirread.c: avoid division by floating point 0
+ in TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(),
+ and return 0 in that case (instead of infinity as before presumably)
+ Apparently some sanitizers do not like those divisions by zero. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2644
+
+Upstream-Status: Backport
+
+CVE: CVE-2017-7598
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog	2017-04-25 16:14:59.858612730 +0530
++++ tiff-4.0.7/ChangeLog	2017-04-25 18:11:36.048107127 +0530
+@@ -1,3 +1,4 @@
++
+ 2017-01-12 Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesQTable,
+@@ -8,6 +9,14 @@
+ 
+ 2017-01-11 Even Rouault <even.rouault at spatialys.com>
+ 
++	* libtiff/tif_dirread.c: avoid division by floating point 0 in
++	TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(),
++	and return 0 in that case (instead of infinity as before presumably)
++	Apparently some sanitizers do not like those divisions by zero.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2644
++
++2017-01-11 Even Rouault <even.rouault at spatialys.com>
++
+ 	* libtiff/tif_dir.c, tif_dirread.c, tif_dirwrite.c: implement various clampings
+ 	of double to other data types to avoid undefined behaviour if the output range
+ 	isn't big enough to hold the input value.
+Index: tiff-4.0.7/libtiff/tif_dirread.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_dirread.c	2017-04-25 16:14:59.858612730 +0530
++++ tiff-4.0.7/libtiff/tif_dirread.c	2017-04-25 18:16:21.836111576 +0530
+@@ -2880,7 +2880,10 @@
+ 		m.l = direntry->tdir_offset.toff_long8;
+ 	if (tif->tif_flags&TIFF_SWAB)
+ 		TIFFSwabArrayOfLong(m.i,2);
+-	if (m.i[0]==0)
++        /* Not completely sure what we should do when m.i[1]==0, but some */
++        /* sanitizers do not like division by 0.0: */
++        /* http://bugzilla.maptools.org/show_bug.cgi?id=2644 */
++	if (m.i[0]==0 || m.i[1]==0)
+ 		*value=0.0;
+ 	else
+ 		*value=(double)m.i[0]/(double)m.i[1];
+@@ -2908,7 +2911,10 @@
+ 		m.l=direntry->tdir_offset.toff_long8;
+ 	if (tif->tif_flags&TIFF_SWAB)
+ 		TIFFSwabArrayOfLong(m.i,2);
+-	if ((int32)m.i[0]==0)
++        /* Not completely sure what we should do when m.i[1]==0, but some */
++        /* sanitizers do not like division by 0.0: */
++        /* http://bugzilla.maptools.org/show_bug.cgi?id=2644 */
++	if ((int32)m.i[0]==0 || m.i[1]==0)
+ 		*value=0.0;
+ 	else
+ 		*value=(double)((int32)m.i[0])/(double)m.i[1];
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7601.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7601.patch
new file mode 100644
index 0000000..1b3c6c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7601.patch
@@ -0,0 +1,52 @@
+From 0a76a8c765c7b8327c59646284fa78c3c27e5490 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Wed, 11 Jan 2017 16:13:50 +0000
+Subject: [PATCH] * libtiff/tif_jpeg.c: validate BitsPerSample in
+ JPEGSetupEncode() to avoid undefined behaviour caused by invalid shift
+ exponent. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2648
+
+Upstream-Status: Backport
+
+CVE: CVE-2017-7601
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog	2017-04-25 18:21:32.856116417 +0530
++++ tiff-4.0.7/ChangeLog	2017-04-25 18:35:31.904129477 +0530
+@@ -1,4 +1,3 @@
+-
+ 2017-01-12 Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesQTable,
+@@ -9,6 +8,12 @@
+ 
+ 2017-01-11 Even Rouault <even.rouault at spatialys.com>
+ 
++	* libtiff/tif_jpeg.c: validate BitsPerSample in JPEGSetupEncode() to avoid
++	undefined behaviour caused by invalid shift exponent.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2648
++
++2017-01-11 Even Rouault <even.rouault at spatialys.com>
++
+ 	* libtiff/tif_dirread.c: avoid division by floating point 0 in
+ 	TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(),
+ 	and return 0 in that case (instead of infinity as before presumably)
+Index: tiff-4.0.7/libtiff/tif_jpeg.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_jpeg.c	2017-04-25 18:21:32.744116415 +0530
++++ tiff-4.0.7/libtiff/tif_jpeg.c	2017-04-25 18:38:02.200131817 +0530
+@@ -1632,7 +1632,13 @@
+                                    "Invalig horizontal/vertical sampling value");
+                       return (0);
+                 }
+-
++                if( td->td_bitspersample > 16 )
++                {
++                    TIFFErrorExt(tif->tif_clientdata, module,
++                                 "BitsPerSample %d not allowed for JPEG",
++                                 td->td_bitspersample);
++                    return (0);
++                }
+ 		/*
+ 		 * A ReferenceBlackWhite field *must* be present since the
+ 		 * default value is inappropriate for YCbCr.  Fill in the
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7602.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7602.patch
new file mode 100644
index 0000000..9ed97e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-7602.patch
@@ -0,0 +1,69 @@
+From 66e7bd59520996740e4df5495a830b42fae48bc4 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Wed, 11 Jan 2017 16:33:34 +0000
+Subject: [PATCH] * libtiff/tif_read.c: avoid potential undefined behaviour on
+ signed integer addition in TIFFReadRawStrip1() in isMapped() case. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2650
+
+Upstream-Status: Backport
+
+CVE: CVE-2017-7602
+Signed-off-by: Rajkumar Veer <rveer@mvista.com>
+
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog	2017-04-25 18:42:07.656135638 +0530
++++ tiff-4.0.7/ChangeLog	2017-04-25 18:54:36.812147299 +0530
+@@ -8,6 +8,12 @@
+ 
+ 2017-01-11 Even Rouault <even.rouault at spatialys.com>
+ 
++	* libtiff/tif_read.c: avoid potential undefined behaviour on signed integer
++	addition in TIFFReadRawStrip1() in isMapped() case.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2650
++
++2017-01-11 Even Rouault <even.rouault at spatialys.com>
++
+ 	* libtiff/tif_jpeg.c: validate BitsPerSample in JPEGSetupEncode() to avoid
+ 	undefined behaviour caused by invalid shift exponent.
+ 	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2648
+Index: tiff-4.0.7/libtiff/tif_read.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_read.c	2017-04-25 18:42:07.132135629 +0530
++++ tiff-4.0.7/libtiff/tif_read.c	2017-04-25 18:58:25.272150855 +0530
+@@ -420,16 +420,26 @@
+ 			return ((tmsize_t)(-1));
+ 		}
+ 	} else {
+-		tmsize_t ma,mb;
++		tmsize_t ma;
+ 		tmsize_t n;
+-		ma=(tmsize_t)td->td_stripoffset[strip];
+-		mb=ma+size;
+-		if ((td->td_stripoffset[strip] > (uint64)TIFF_TMSIZE_T_MAX)||(ma>tif->tif_size))
+-			n=0;
+-		else if ((mb<ma)||(mb<size)||(mb>tif->tif_size))
+-			n=tif->tif_size-ma;
+-		else
+-			n=size;
++                if ((td->td_stripoffset[strip] > (uint64)TIFF_TMSIZE_T_MAX)||
++                     ((ma=(tmsize_t)td->td_stripoffset[strip])>tif->tif_size))
++                {
++                    n=0;
++                }
++                else if( ma > TIFF_TMSIZE_T_MAX - size )
++                {
++                    n=0;
++                }
++                else
++                {
++                    tmsize_t mb=ma+size;
++                    if (mb>tif->tif_size)
++                            n=tif->tif_size-ma;
++                    else
++                            n=size;
++                }
++
+ 		if (n!=size) {
+ #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
+ 			TIFFErrorExt(tif->tif_clientdata, module,
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-9147.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-9147.patch
new file mode 100644
index 0000000..94f3390
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-9147.patch
@@ -0,0 +1,203 @@
+From 0acf01fea714af573b814e10cf105c3359a236c3 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Thu, 1 Jun 2017 12:44:04 +0000
+Subject: [PATCH] * libtiff/tif_dirinfo.c, tif_dirread.c: add _TIFFCheckFieldIsValidForCodec(),
+and use it in TIFFReadDirectory() so as to ignore fields whose tag is a
+codec-specified tag but this codec is not enabled. This avoids TIFFGetField()
+to behave differently depending on whether the codec is enabled or not, and
+thus can avoid stack based buffer overflows in a number of TIFF utilities
+such as tiffsplit, tiffcmp, thumbnail, etc.
+Patch derived from 0063-Handle-properly-CODEC-specific-tags.patch
+(http://bugzilla.maptools.org/show_bug.cgi?id=2580) by Raphaël Hertzog.
+Fixes:
+http://bugzilla.maptools.org/show_bug.cgi?id=2580
+http://bugzilla.maptools.org/show_bug.cgi?id=2693
+http://bugzilla.maptools.org/show_bug.cgi?id=2625 (CVE-2016-10095)
+http://bugzilla.maptools.org/show_bug.cgi?id=2564 (CVE-2015-7554)
+http://bugzilla.maptools.org/show_bug.cgi?id=2561 (CVE-2016-5318)
+http://bugzilla.maptools.org/show_bug.cgi?id=2499 (CVE-2014-8128)
+http://bugzilla.maptools.org/show_bug.cgi?id=2441
+http://bugzilla.maptools.org/show_bug.cgi?id=2433
+
+Upstream-Status: Backport
+[https://github.com/vadz/libtiff/commit/4d4fa0b68ae9ae038959ee4f69ebe288ec892f06]
+
+CVE: CVE-2017-9147
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ ChangeLog             |  20 ++++++++++
+ libtiff/tif_dir.h     |   1 +
+ libtiff/tif_dirinfo.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ libtiff/tif_dirread.c |   4 ++
+ 4 files changed, 128 insertions(+)
+
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog
++++ tiff-4.0.7/ChangeLog
+@@ -1,3 +1,23 @@
++2017-06-01  Even Rouault <even.rouault at spatialys.com>
++
++       * libtiff/tif_dirinfo.c, tif_dirread.c: add _TIFFCheckFieldIsValidForCodec(),
++       and use it in TIFFReadDirectory() so as to ignore fields whose tag is a
++       codec-specified tag but this codec is not enabled. This avoids TIFFGetField()
++       to behave differently depending on whether the codec is enabled or not, and
++       thus can avoid stack based buffer overflows in a number of TIFF utilities
++       such as tiffsplit, tiffcmp, thumbnail, etc.
++       Patch derived from 0063-Handle-properly-CODEC-specific-tags.patch
++       (http://bugzilla.maptools.org/show_bug.cgi?id=2580) by Raphaël Hertzog.
++       Fixes:
++       http://bugzilla.maptools.org/show_bug.cgi?id=2580
++       http://bugzilla.maptools.org/show_bug.cgi?id=2693
++       http://bugzilla.maptools.org/show_bug.cgi?id=2625 (CVE-2016-10095)
++       http://bugzilla.maptools.org/show_bug.cgi?id=2564 (CVE-2015-7554)
++       http://bugzilla.maptools.org/show_bug.cgi?id=2561 (CVE-2016-5318)
++       http://bugzilla.maptools.org/show_bug.cgi?id=2499 (CVE-2014-8128)
++       http://bugzilla.maptools.org/show_bug.cgi?id=2441
++       http://bugzilla.maptools.org/show_bug.cgi?id=2433
++
+ 2017-01-11 Even Rouault <even.rouault at spatialys.com>
+ 
+ 	* tools/tiffcp.c: error out cleanly in cpContig2SeparateByRow and
+Index: tiff-4.0.7/libtiff/tif_dir.h
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_dir.h
++++ tiff-4.0.7/libtiff/tif_dir.h
+@@ -291,6 +291,7 @@ struct _TIFFField {
+ extern int _TIFFMergeFields(TIFF*, const TIFFField[], uint32);
+ extern const TIFFField* _TIFFFindOrRegisterField(TIFF *, uint32, TIFFDataType);
+ extern  TIFFField* _TIFFCreateAnonField(TIFF *, uint32, TIFFDataType);
++extern int _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag);
+ 
+ #if defined(__cplusplus)
+ }
+Index: tiff-4.0.7/libtiff/tif_dirinfo.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_dirinfo.c
++++ tiff-4.0.7/libtiff/tif_dirinfo.c
+@@ -956,6 +956,109 @@ TIFFMergeFieldInfo(TIFF* tif, const TIFF
+ 	return 0;
+ }
+ 
++int
++_TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
++{
++	/* Filter out non-codec specific tags */
++	switch (tag) {
++	    /* Shared tags */
++	    case TIFFTAG_PREDICTOR:
++	    /* JPEG tags */
++	    case TIFFTAG_JPEGTABLES:
++	    /* OJPEG tags */
++	    case TIFFTAG_JPEGIFOFFSET:
++	    case TIFFTAG_JPEGIFBYTECOUNT:
++	    case TIFFTAG_JPEGQTABLES:
++	    case TIFFTAG_JPEGDCTABLES:
++	    case TIFFTAG_JPEGACTABLES:
++	    case TIFFTAG_JPEGPROC:
++	    case TIFFTAG_JPEGRESTARTINTERVAL:
++	    /* CCITT* */
++	    case TIFFTAG_BADFAXLINES:
++	    case TIFFTAG_CLEANFAXDATA:
++	    case TIFFTAG_CONSECUTIVEBADFAXLINES:
++	    case TIFFTAG_GROUP3OPTIONS:
++	    case TIFFTAG_GROUP4OPTIONS:
++		break;
++	    default:
++		return 1;
++	}
++	/* Check if codec specific tags are allowed for the current
++	 * compression scheme (codec) */
++	switch (tif->tif_dir.td_compression) {
++	    case COMPRESSION_LZW:
++		if (tag == TIFFTAG_PREDICTOR)
++		    return 1;
++		break;
++	    case COMPRESSION_PACKBITS:
++		/* No codec-specific tags */
++		break;
++	    case COMPRESSION_THUNDERSCAN:
++		/* No codec-specific tags */
++		break;
++	    case COMPRESSION_NEXT:
++		/* No codec-specific tags */
++		break;
++	    case COMPRESSION_JPEG:
++		if (tag == TIFFTAG_JPEGTABLES)
++		    return 1;
++		break;
++	    case COMPRESSION_OJPEG:
++		switch (tag) {
++		    case TIFFTAG_JPEGIFOFFSET:
++		    case TIFFTAG_JPEGIFBYTECOUNT:
++		    case TIFFTAG_JPEGQTABLES:
++		    case TIFFTAG_JPEGDCTABLES:
++		    case TIFFTAG_JPEGACTABLES:
++		    case TIFFTAG_JPEGPROC:
++		    case TIFFTAG_JPEGRESTARTINTERVAL:
++			return 1;
++		}
++		break;
++	    case COMPRESSION_CCITTRLE:
++	    case COMPRESSION_CCITTRLEW:
++	    case COMPRESSION_CCITTFAX3:
++	    case COMPRESSION_CCITTFAX4:
++		switch (tag) {
++		    case TIFFTAG_BADFAXLINES:
++		    case TIFFTAG_CLEANFAXDATA:
++		    case TIFFTAG_CONSECUTIVEBADFAXLINES:
++			return 1;
++		    case TIFFTAG_GROUP3OPTIONS:
++			if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX3)
++			    return 1;
++			break;
++		    case TIFFTAG_GROUP4OPTIONS:
++			if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4)
++			    return 1;
++			break;
++		}
++		break;
++	    case COMPRESSION_JBIG:
++		/* No codec-specific tags */
++		break;
++	    case COMPRESSION_DEFLATE:
++	    case COMPRESSION_ADOBE_DEFLATE:
++		if (tag == TIFFTAG_PREDICTOR)
++		    return 1;
++		break;
++	   case COMPRESSION_PIXARLOG:
++		if (tag == TIFFTAG_PREDICTOR)
++		    return 1;
++		break;
++	    case COMPRESSION_SGILOG:
++	    case COMPRESSION_SGILOG24:
++		/* No codec-specific tags */
++		break;
++	    case COMPRESSION_LZMA:
++		if (tag == TIFFTAG_PREDICTOR)
++		    return 1;
++		break;
++
++	}
++	return 0;
++}
++
+ /* vim: set ts=8 sts=8 sw=8 noet: */
+ 
+ /*
+Index: tiff-4.0.7/libtiff/tif_dirread.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_dirread.c
++++ tiff-4.0.7/libtiff/tif_dirread.c
+@@ -3566,6 +3566,10 @@ TIFFReadDirectory(TIFF* tif)
+ 							goto bad;
+ 						dp->tdir_tag=IGNORE;
+ 						break;
++                                        default:
++                                            if( !_TIFFCheckFieldIsValidForCodec(tif, dp->tdir_tag) )
++                                                dp->tdir_tag=IGNORE;
++                                            break;
+ 				}
+ 			}
+ 		}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-9936.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-9936.patch
new file mode 100644
index 0000000..204949b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/CVE-2017-9936.patch
@@ -0,0 +1,46 @@
+From 62efea76592647426deec5592fd7274d5c950646 Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Mon, 26 Jun 2017 15:19:59 +0000
+Subject: [PATCH] * libtiff/tif_jbig.c: fix memory leak in error code path of
+ JBIGDecode() Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2706 Reported
+ by team OWL337
+
+* libtiff/tif_jpeg.c: error out at decoding time if anticipated libjpeg
+
+Upstream-Status: Backport
+[https://github.com/vadz/libtiff/commit/fe8d7165956b88df4837034a9161dc5fd20cf67a]
+
+CVE: CVE-2017-9936
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ ChangeLog          | 6 ++++++
+ libtiff/tif_jbig.c | 1 +
+ 2 files changed, 7 insertions(+)
+
+Index: tiff-4.0.7/ChangeLog
+===================================================================
+--- tiff-4.0.7.orig/ChangeLog
++++ tiff-4.0.7/ChangeLog
+@@ -1,3 +1,9 @@
++2017-06-26  Even Rouault <even.rouault at spatialys.com>
++
++	* libtiff/tif_jbig.c: fix memory leak in error code path of JBIGDecode()
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2706
++	Reported by team OWL337
++
+ 2017-06-01  Even Rouault <even.rouault at spatialys.com>
+ 
+        * libtiff/tif_dirinfo.c, tif_dirread.c: add _TIFFCheckFieldIsValidForCodec(),
+Index: tiff-4.0.7/libtiff/tif_jbig.c
+===================================================================
+--- tiff-4.0.7.orig/libtiff/tif_jbig.c
++++ tiff-4.0.7/libtiff/tif_jbig.c
+@@ -94,6 +94,7 @@ static int JBIGDecode(TIFF* tif, uint8*
+ 			     jbg_strerror(decodeStatus)
+ #endif
+ 			     );
++		jbg_dec_free(&decoder);
+ 		return 0;
+ 	}
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/libtiff-CVE-2017-5225.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/libtiff-CVE-2017-5225.patch
new file mode 100644
index 0000000..3263353
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/libtiff-CVE-2017-5225.patch
@@ -0,0 +1,92 @@
+From a24df1e93833dfeaa69bf4d510518dc4684db64d Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Wed, 25 Jan 2017 17:07:21 +0800
+Subject: [PATCH] libtiff: fix CVE-2017-5225
+
+tools/tiffcp.c: error out cleanly in cpContig2SeparateByRow
+and cpSeparate2ContigByRow if BitsPerSample != 8 to avoid heap based
+overflow. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2656 and
+http://bugzilla.maptools.org/show_bug.cgi?id=2657
+
+Upstream-Status: Backport
+CVE: CVE-2017-5225
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ ChangeLog      |  7 +++++++
+ tools/tiffcp.c | 24 ++++++++++++++++++++++--
+ 2 files changed, 29 insertions(+), 2 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 9b9d397..7e82795 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,10 @@
++2017-01-11 Even Rouault <even.rouault at spatialys.com>
++
++	* tools/tiffcp.c: error out cleanly in cpContig2SeparateByRow and
++	cpSeparate2ContigByRow if BitsPerSample != 8 to avoid heap based overflow.
++	Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2656 and
++	http://bugzilla.maptools.org/show_bug.cgi?id=2657
++
+ 2016-11-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
+ 
+ 	* libtiff 4.0.7 released.
+diff --git a/tools/tiffcp.c b/tools/tiffcp.c
+index 338a3d1..2e84577 100644
+--- a/tools/tiffcp.c
++++ b/tools/tiffcp.c
+@@ -592,7 +592,7 @@ static	copyFunc pickCopyFunc(TIFF*, TIFF*, uint16, uint16);
+ static int
+ tiffcp(TIFF* in, TIFF* out)
+ {
+-	uint16 bitspersample, samplesperpixel = 1;
++	uint16 bitspersample = 1, samplesperpixel = 1;
+ 	uint16 input_compression, input_photometric = PHOTOMETRIC_MINISBLACK;
+ 	copyFunc cf;
+ 	uint32 width, length;
+@@ -1068,6 +1068,16 @@ DECLAREcpFunc(cpContig2SeparateByRow)
+ 	register uint32 n;
+ 	uint32 row;
+ 	tsample_t s;
++        uint16 bps = 0;
++
++        (void) TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps);
++        if( bps != 8 )
++        {
++            TIFFError(TIFFFileName(in),
++                      "Error, can only handle BitsPerSample=8 in %s",
++                      "cpContig2SeparateByRow");
++            return 0;
++        }
+ 
+ 	inbuf = _TIFFmalloc(scanlinesizein);
+ 	outbuf = _TIFFmalloc(scanlinesizeout);
+@@ -1121,6 +1131,16 @@ DECLAREcpFunc(cpSeparate2ContigByRow)
+ 	register uint32 n;
+ 	uint32 row;
+ 	tsample_t s;
++        uint16 bps = 0;
++
++        (void) TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps);
++        if( bps != 8 )
++        {
++            TIFFError(TIFFFileName(in),
++                      "Error, can only handle BitsPerSample=8 in %s",
++                      "cpSeparate2ContigByRow");
++            return 0;
++        }
+ 
+ 	inbuf = _TIFFmalloc(scanlinesizein);
+ 	outbuf = _TIFFmalloc(scanlinesizeout);
+@@ -1763,7 +1783,7 @@ pickCopyFunc(TIFF* in, TIFF* out, uint16 bitspersample, uint16 samplesperpixel)
+ 	uint32 w, l, tw, tl;
+ 	int bychunk;
+ 
+-	(void) TIFFGetField(in, TIFFTAG_PLANARCONFIG, &shortv);
++	(void) TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &shortv);
+ 	if (shortv != config && bitspersample != 8 && samplesperpixel > 1) {
+ 		fprintf(stderr,
+ 		    "%s: Cannot handle different planar configuration w/ bits/sample != 8\n",
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb
index 7296782..866e852 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/tiff_4.0.7.bb
@@ -6,7 +6,28 @@
 
 SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
            file://libtool2.patch \
-          "
+           file://libtiff-CVE-2017-5225.patch \
+           file://CVE-2017-9147.patch \
+           file://CVE-2017-9936.patch \
+           file://CVE-2017-10688.patch \
+           file://CVE-2017-11335.patch \
+           file://CVE-2016-10271.patch \
+           file://CVE-2016-10093.patch \
+           file://CVE-2016-10268.patch \
+           file://CVE-2016-10266.patch \
+           file://CVE-2016-10267.patch \
+           file://CVE-2016-10269.patch \
+           file://CVE-2016-10270.patch \
+           file://CVE-2017-7592.patch \
+           file://CVE-2017-7594-p1.patch \
+           file://CVE-2017-7594-p2.patch \
+           file://CVE-2017-7595.patch \
+           file://CVE-2017-7596.patch \
+           file://CVE-2017-7598.patch \
+           file://CVE-2017-7601.patch \
+           file://CVE-2017-7602.patch \
+           file://CVE-2017-7593.patch \
+        "
 
 SRC_URI[md5sum] = "77ae928d2c6b7fb46a21c3a29325157b"
 SRC_URI[sha256sum] = "9f43a2cfb9589e5cecaa66e16bf87f814c945f22df7ba600d63aac4632c4f019"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis/0001-configure-Check-for-clang.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis/0001-configure-Check-for-clang.patch
new file mode 100644
index 0000000..7dad0cd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis/0001-configure-Check-for-clang.patch
@@ -0,0 +1,56 @@
+From 44b4511784f9b51c514dff4ceb3cbeaf9c374d08 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Mar 2017 16:06:55 +0000
+Subject: [PATCH] configure: Check for clang
+
+Disable gcc specific options if using clang
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 19 +++++++++++++++++--
+ 1 file changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index eddd02d..00ecba5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -93,6 +93,16 @@ AC_ARG_ENABLE(examples,
+  	
+ AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$enable_examples" = xyes]) 
+ 
++AC_MSG_CHECKING([whether C compiler is clang])
++$CC -x c /dev/null -dM -E > conftest.txt 2>&1
++if grep "__clang__" conftest.txt >/dev/null 2>&1; then
++  AC_SUBST([CC_CLANG], [1])
++   AC_MSG_RESULT([yes])
++ else
++   AC_SUBST([CC_CLANG], [0])
++   AC_MSG_RESULT([no])
++fi
++
+ dnl --------------------------------------------------
+ dnl Set build flags based on environment
+ dnl --------------------------------------------------
+@@ -127,10 +137,15 @@ else
+ 	AC_MSG_RESULT([$GCC_VERSION])
+ 	case $host in 
+ 	*86-*-linux*)
++		if test "$CC_CLANG" = "1"; then
++			ieeefp=""
++		else
++			ieefp="-mno-ieee-fp"
++		fi
+ 		DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
+-		CFLAGS="-O3 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
++		CFLAGS="-O3 -ffast-math -D_REENTRANT -fsigned-char ${ieefp}"
+ #              	PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
+-		PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
++		PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math ${ieefp} -D_REENTRANT -fsigned-char -fno-inline"
+ 
+ 		# glibc < 2.1.3 has a serious FP bug in the math inline header
+ 		# that will cripple Vorbis.  Look to see if the magic FP stack
+-- 
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb
index 636e0f3..56c5b0a 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb
@@ -10,7 +10,9 @@
                     file://include/vorbis/vorbisenc.h;beginline=1;endline=11;md5=d1c1d138863d6315131193d4046d81cb"
 DEPENDS = "libogg"
 
-SRC_URI = "http://downloads.xiph.org/releases/vorbis/${BP}.tar.xz"
+SRC_URI = "http://downloads.xiph.org/releases/vorbis/${BP}.tar.xz \
+           file://0001-configure-Check-for-clang.patch \
+          "
 SRC_URI[md5sum] = "28cb28097c07a735d6af56e598e1c90f"
 SRC_URI[sha256sum] = "54f94a9527ff0a88477be0a71c0bab09a4c3febe0ed878b24824906cd4b0e1d1"
 
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb b/import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb
index 1666994..fe765da 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb
@@ -20,7 +20,7 @@
 
 EXTRA_OECONF = "--enable-shared --disable-sdl"
 
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[x11] = "--with-x,--without-x,virtual/libx11 libxext libxv"
 
 PACKAGES = "mpeg2dec-dbg mpeg2dec mpeg2dec-doc libmpeg2 libmpeg2-dev libmpeg2convert libmpeg2convert-dev libmpeg2-staticdev libmpeg2convert-staticdev"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/mpg123/mpg123_1.23.6.bb b/import-layers/yocto-poky/meta/recipes-multimedia/mpg123/mpg123_1.23.6.bb
deleted file mode 100644
index 6ee457d..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/mpg123/mpg123_1.23.6.bb
+++ /dev/null
@@ -1,63 +0,0 @@
-SUMMARY = "Audio decoder for MPEG-1 Layer 1/2/3"
-DESCRIPTION = "The core of mpg123 is an MPEG-1 Layer 1/2/3 decoding library, which can be used by other programs. \
-mpg123 also comes with a command-line tool which can playback using ALSA, PulseAudio, OSS, and several other APIs, \
-and also can write the decoded audio to WAV."
-HOMEPAGE = "http://mpg123.de/"
-BUGTRACKER = "http://sourceforge.net/p/mpg123/bugs/"
-SECTION = "multimedia"
-
-LICENSE = "LGPLv2.1"
-LICENSE_FLAGS = "commercial"
-LIC_FILES_CHKSUM = "file://COPYING;md5=1e86753638d3cf2512528b99079bc4f3"
-
-SRC_URI = "https://www.mpg123.de/download/${BP}.tar.bz2"
-
-SRC_URI[md5sum] = "ed22a3e664f076fa05131a3454ef8166"
-SRC_URI[sha256sum] = "4073d9c60a43872f6f5a3a322f5ea21ab7f0869d2ed25e79c3eb8521fa3c32d4"
-
-inherit autotools pkgconfig
-
-# The options should be mutually exclusive for configuration script.
-# If both alsa and pulseaudio are specified (as in the default distro features)
-# pulseaudio takes precedence.
-PACKAGECONFIG_ALSA = "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)}"
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '${PACKAGECONFIG_ALSA}', d)}"
-
-PACKAGECONFIG[alsa] = "--with-default-audio=alsa,,alsa-lib"
-PACKAGECONFIG[esd] = ",,esound"
-PACKAGECONFIG[jack] = ",,jack"
-PACKAGECONFIG[openal] = ",,openal-soft"
-PACKAGECONFIG[portaudio] = ",,portaudio-v19"
-PACKAGECONFIG[pulseaudio] = "--with-default-audio=pulse,,pulseaudio"
-PACKAGECONFIG[sdl] = ",,libsdl"
-
-# Following are possible sound output modules:
-# alsa arts coreaudio dummy esd jack nas openal os2 oss portaudio pulse sdl sndio sun tinyalsa win32 win32_wasapi
-AUDIOMODS += "${@bb.utils.contains('PACKAGECONFIG', 'alsa', 'alsa', '', d)}"
-AUDIOMODS += "${@bb.utils.contains('PACKAGECONFIG', 'esd', 'esd', '', d)}"
-AUDIOMODS += "${@bb.utils.contains('PACKAGECONFIG', 'jack', 'jack', '', d)}"
-AUDIOMODS += "${@bb.utils.contains('PACKAGECONFIG', 'openal', 'openal', '', d)}"
-AUDIOMODS += "${@bb.utils.contains('PACKAGECONFIG', 'portaudio', 'portaudio', '', d)}"
-AUDIOMODS += "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'pulse', '', d)}"
-AUDIOMODS += "${@bb.utils.contains('PACKAGECONFIG', 'sdl', 'sdl', '', d)}"
-
-EXTRA_OECONF = " \
-    --enable-shared \
-    --with-audio='${AUDIOMODS}' \
-    --with-module-suffix=.so \
-    ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-cpu=neon', '', d)} \
-    ${@bb.utils.contains('TUNE_FEATURES', 'altivec', '--with-cpu=altivec', '', d)} \
-"
-
-# The x86 assembler optimisations contains text relocations and there are no
-# upstream plans to fix them: http://sourceforge.net/p/mpg123/bugs/168/
-INSANE_SKIP_${PN}_append_x86 = " textrel"
-
-# Fails to build with thumb-1 (qemuarm)
-#| {standard input}: Assembler messages:
-#| {standard input}:47: Error: selected processor does not support Thumb mode `smull r5,r6,r7,r4'
-#| {standard input}:48: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r5,r5,lsr#24'
-#...
-#| make[3]: *** [equalizer.lo] Error 1
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/mpg123/mpg123_1.23.8.bb b/import-layers/yocto-poky/meta/recipes-multimedia/mpg123/mpg123_1.23.8.bb
new file mode 100644
index 0000000..e0a7038
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/mpg123/mpg123_1.23.8.bb
@@ -0,0 +1,58 @@
+SUMMARY = "Audio decoder for MPEG-1 Layer 1/2/3"
+DESCRIPTION = "The core of mpg123 is an MPEG-1 Layer 1/2/3 decoding library, which can be used by other programs. \
+mpg123 also comes with a command-line tool which can playback using ALSA, PulseAudio, OSS, and several other APIs, \
+and also can write the decoded audio to WAV."
+HOMEPAGE = "http://mpg123.de/"
+BUGTRACKER = "http://sourceforge.net/p/mpg123/bugs/"
+SECTION = "multimedia"
+
+LICENSE = "LGPLv2.1"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1e86753638d3cf2512528b99079bc4f3"
+
+SRC_URI = "https://www.mpg123.de/download/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "4dde045123a2ad1e385a0a82c0ef9268"
+SRC_URI[sha256sum] = "de2303c8ecb65593e39815c0a2f2f2d91f708c43b85a55fdd1934c82e677cf8e"
+
+inherit autotools pkgconfig
+
+# The options should be mutually exclusive for configuration script.
+# If both alsa and pulseaudio are specified (as in the default distro features)
+# pulseaudio takes precedence.
+PACKAGECONFIG_ALSA = "${@bb.utils.filter('DISTRO_FEATURES', 'alsa', d)}"
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '${PACKAGECONFIG_ALSA}', d)}"
+
+PACKAGECONFIG[alsa] = "--with-default-audio=alsa,,alsa-lib"
+PACKAGECONFIG[esd] = ",,esound"
+PACKAGECONFIG[jack] = ",,jack"
+PACKAGECONFIG[openal] = ",,openal-soft"
+PACKAGECONFIG[portaudio] = ",,portaudio-v19"
+PACKAGECONFIG[pulseaudio] = "--with-default-audio=pulse,,pulseaudio"
+PACKAGECONFIG[sdl] = ",,libsdl"
+
+# Following are possible sound output modules:
+# alsa arts coreaudio dummy esd jack nas openal os2 oss portaudio pulse sdl sndio sun tinyalsa win32 win32_wasapi
+AUDIOMODS += "${@bb.utils.filter('PACKAGECONFIG', 'alsa esd jack openal portaudio sdl', d)}"
+AUDIOMODS += "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'pulse', '', d)}"
+
+EXTRA_OECONF = " \
+    --enable-shared \
+    --with-audio='${AUDIOMODS}' \
+    --with-module-suffix=.so \
+    ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-cpu=neon', '', d)} \
+    ${@bb.utils.contains('TUNE_FEATURES', 'altivec', '--with-cpu=altivec', '', d)} \
+"
+
+# The x86 assembler optimisations contains text relocations and there are no
+# upstream plans to fix them: http://sourceforge.net/p/mpg123/bugs/168/
+INSANE_SKIP_${PN}_append_x86 = " textrel"
+
+# Fails to build with thumb-1 (qemuarm)
+#| {standard input}: Assembler messages:
+#| {standard input}:47: Error: selected processor does not support Thumb mode `smull r5,r6,r7,r4'
+#| {standard input}:48: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r5,r5,lsr#24'
+#...
+#| make[3]: *** [equalizer.lo] Error 1
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
index 7e54ad4..fdbf5ab 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
@@ -2,18 +2,71 @@
 HOMEPAGE = "http://www.pulseaudio.org"
 AUTHOR = "Lennart Poettering"
 SECTION = "libs/multimedia"
-LICENSE = "GPLv2+ & LGPLv2.1"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=d9ae089c8dc5339f8ac9d8563038a29f \
+
+# Most of PulseAudio code is under LGPLv2.1+. There are a few exceptions:
+#
+# The "adrian" echo canceller variant has code under a non-standard permissive
+# license. See src/modules/echo-cancel/adrian-license.txt for details. This
+# recipe disables the adrian echo canceller to avoid hassle with the unusual
+# license.
+#
+# The src/modules/reserve* and src/pulsecore/rtkit* files are under the MIT
+# license.
+#
+# The src/pulsecore/filter/ directory contains code under the 3-clause BSD
+# license.
+#
+# src/utils/qpaeq is licensed under AGPL. qpaeq is not installed by this
+# recipe, however, which is why AGPL is not mentioned in LICENSE.
+#
+# People who distribute PulseAudio binaries need to also consider that there
+# are some dependencies to GPL libraries. LGPL code that depends on GPL
+# libraries probably becomes effectively GPL-licensed (at compile-time? or at
+# at link-time?). I'm not a lawyer, though, so I'm not sure of the exact
+# implications. The GPL dependencies only affect the server, not the client
+# library, with the exception of libdbus that affects both. These are the GPL
+# library dependencies:
+#
+# One of the resampler implementations uses libsamplerate. This recipe doesn't
+# enable that resampler, however.
+#
+# One of the database implementations uses gdbm. This recipe doesn't enable
+# that database implementation, however.
+#
+# module-lirc (enabled by PACKAGECONFIG[lirc]) uses LIRC.
+#
+# module-equalizer-sink uses FFTW. This recipe disables that, however.
+#
+# The dependency with the most complicated licensing considerations is libdbus.
+# When PACKAGECONFIG[dbus] is enabled (like it is by default), libdbus will be
+# used by both the server and the client library (libpulse). Does this affect
+# applications that use libpulse? It should be also noted that libdbus is
+# dual-licensed: either GPLv2+ or AFL-2 terms apply. Whose decision is it which
+# of the licenses apply? What a mess. Some people hold the view that libdbus is
+# a system library that is covered by the "special exception" in GPLv2's
+# section 3, and therefore libdbus's GPL license doesn't affect PulseAudio.
+LICENSE = "LGPLv2.1+ & MIT & BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a848e8d03f04976778eab2348b59ed2b \
                     file://GPL;md5=4325afd396febcb659c36b49533135d4 \
                     file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
-                    file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84"
+                    file://AGPL;md5=73f1eb20517c55bf9493b7dd6e480788 \
+                    file://src/modules/echo-cancel/adrian-license.txt;md5=abbab006a561fbffccedf1c3531f34ab \
+                    file://src/pulsecore/filter/LICENSE.WEBKIT;md5=49defbaffddf8c51faf606ff7fc3b1f7 \
+                    file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84 \
+                    file://src/modules/reserve.h;beginline=6;endline=28;md5=0e23094760367d51b6609750e9b31fbb \
+                    file://src/pulsecore/rtkit.h;beginline=6;endline=29;md5=3f00ff966716ae0817c31576d1473528 \
+                    file://src/utils/qpaeq;beginline=2;endline=16;md5=7f62515a4762f0c3fc3d4201858bb964 \
+                    file://src/modules/echo-cancel/adrian-aec.h;beginline=3;endline=12;md5=d3ed4fad1c073f8b06f37495dc5d1026 \
+                    file://src/pulsecore/filter/biquad.h;beginline=1;endline=4;md5=6d46d1365206528a20137355924233c1 \
+"
 
 DEPENDS = "libatomic-ops libsndfile1 libtool intltool-native"
 # optional
 DEPENDS += "udev alsa-lib glib-2.0 gconf"
-DEPENDS += "json-c gdbm speexdsp libxml-parser-perl-native libcap"
+DEPENDS += "speexdsp libxml-parser-perl-native libcap"
 
-inherit autotools bash-completion pkgconfig useradd gettext perlnative bluetooth systemd
+inherit autotools bash-completion pkgconfig useradd gettext perlnative bluetooth systemd manpages
 
 # *.desktop rules wont be generated during configure and build will fail
 # if using --disable-nls
@@ -25,9 +78,7 @@
 		--enable-tcpwrap=no \
 		--with-access-group=audio \
 		--disable-openssl \
-		--disable-xen \
 		--with-database=simple \
-		--without-fftw \
 		--without-zsh-completion-dir \
 		--with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d \
                 ac_cv_header_valgrind_memcheck_h=no \
@@ -38,12 +89,27 @@
 # oe-core nor meta-oe, so let's not add a PACKAGECONFIG entry for it for now.
 EXTRA_OECONF += "--without-soxr"
 
+# The FFTW dependency (for module-equalizer-sink) was removed in commit
+# ddbd713293 without explaining why it was not made a PACKAGECONFIG item
+# instead. Oh well, let's keep it disabled until someone expresses some
+# interest in having it enabled.
+#
+# One nice thing about disabling this is that it also prevents qpaeq from
+# being installed, so we avoid adding AGPL to the list of licenses (nothing
+# else in PulseAudio is licensed under AGPL).
+EXTRA_OECONF += "--without-fftw"
+
+# The "adrian" echo canceller implementation has a non-standard license
+# (src/modules/echo-cancel/adrian-license.txt). It's a permissive license, so
+# the licensing terms are probably not problematic, but it would be an extra
+# hassle to add the license to OE-Core's set of licenses. The canceller isn't
+# very good anyway, better alternatives exist (such as the webrtc canceller).
+EXTRA_OECONF += "--disable-adrian-aec"
+
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
+                   ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd x11', d)} \
                    dbus \
                    "
 
@@ -62,6 +128,7 @@
 PACKAGECONFIG[lirc] = "--enable-lirc,--disable-lirc,lirc"
 PACKAGECONFIG[webrtc] = "--enable-webrtc-aec,--disable-webrtc-aec,webrtc-audio-processing"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, "
 
 EXTRA_OECONF_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
 EXTRA_OECONF_append_armeb = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch
deleted file mode 100644
index 2f72ceb..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 9c3cdfcd198ef9727ea542f284ac6d8c1bcd7a3a Mon Sep 17 00:00:00 2001
-From: Tanu Kaskinen <tanuk@iki.fi>
-Date: Fri, 23 Oct 2015 12:36:34 +0300
-Subject: [PATCH 1/5] alsa, bluetooth: fail if user-requested profile doesn't
- exist
-
-If we can't fulfill the user request fully, I think we shouldn't
-fulfill it at all, to make it clear that the requested operation
-didn't succeed.
-
-Upstream-Status: Accepted [expected in 10.0]
-
-Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
----
- src/modules/alsa/module-alsa-card.c          | 11 +++++++++--
- src/modules/bluetooth/module-bluez4-device.c |  7 +++++--
- 2 files changed, 14 insertions(+), 4 deletions(-)
-
-diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
-index e5cc4ae..d761683 100644
---- a/src/modules/alsa/module-alsa-card.c
-+++ b/src/modules/alsa/module-alsa-card.c
-@@ -799,8 +799,15 @@ int pa__init(pa_module *m) {
-         goto fail;
-     }
- 
--    if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL)))
--        pa_card_new_data_set_profile(&data, profile);
-+    if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
-+        if (pa_hashmap_get(data.profiles, profile))
-+            pa_card_new_data_set_profile(&data, profile);
-+        else {
-+            pa_log("No such profile: %s", profile);
-+            pa_card_new_data_done(&data);
-+            goto fail;
-+        }
-+    }
- 
-     u->card = pa_card_new(m->core, &data);
-     pa_card_new_data_done(&data);
-diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c
-index 9a921a5..a2de525 100644
---- a/src/modules/bluetooth/module-bluez4-device.c
-+++ b/src/modules/bluetooth/module-bluez4-device.c
-@@ -2301,8 +2301,11 @@ static int add_card(struct userdata *u) {
-     if ((default_profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
-         if (pa_hashmap_get(data.profiles, default_profile))
-             pa_card_new_data_set_profile(&data, default_profile);
--        else
--            pa_log_warn("Profile '%s' not valid or not supported by device.", default_profile);
-+        else {
-+            pa_log("Profile '%s' not valid or not supported by device.", default_profile);
-+            pa_card_new_data_done(&data);
-+            return -1;
-+        }
-     }
- 
-     u->card = pa_card_new(u->core, &data);
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-card-don-t-allow-the-CARD_NEW-hook-to-fail.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-card-don-t-allow-the-CARD_NEW-hook-to-fail.patch
deleted file mode 100644
index 80c291f..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-card-don-t-allow-the-CARD_NEW-hook-to-fail.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From d4e6d07fef28d1bd8bfbceab4cc196ef54c23dd8 Mon Sep 17 00:00:00 2001
-From: Tanu Kaskinen <tanuk@iki.fi>
-Date: Tue, 7 Jun 2016 16:51:00 +0300
-Subject: [PATCH 2/5] card: don't allow the CARD_NEW hook to fail
-
-There is currently no use for allowing modules to cancel card creation,
-and I don't see need for that in the future either. Let's simplify
-things by removing the failure handling code.
-
-Upstream-Status: Accepted [expected in 10.0]
-
-Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
----
- src/pulsecore/card.c | 7 +------
- 1 file changed, 1 insertion(+), 6 deletions(-)
-
-diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
-index 410746b..0ac70b9 100644
---- a/src/pulsecore/card.c
-+++ b/src/pulsecore/card.c
-@@ -149,12 +149,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
-     }
- 
-     pa_card_new_data_set_name(data, name);
--
--    if (pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_NEW], data) < 0) {
--        pa_xfree(c);
--        pa_namereg_unregister(core, name);
--        return NULL;
--    }
-+    pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_NEW], data);
- 
-     c->core = core;
-     c->name = pa_xstrdup(data->name);
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch
deleted file mode 100644
index e0f424b..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch
+++ /dev/null
@@ -1,429 +0,0 @@
-From 0b98309fdbcd36fa92ab53e33c51b485b905e294 Mon Sep 17 00:00:00 2001
-From: Tanu Kaskinen <tanuk@iki.fi>
-Date: Fri, 23 Oct 2015 12:59:53 +0300
-Subject: [PATCH 3/5] card: move profile selection after pa_card_new()
-
-I want module-alsa-card to set the availability of unavailable
-profiles before the initial card profile gets selected, so that the
-selection logic can use correct availability information.
-module-alsa-card initializes the jack state after calling
-pa_card_new(), however, and the profile selection happens in
-pa_card_new(). This patch solves that by moving parts of pa_card_new()
-to pa_card_choose_initial_profile() and pa_card_put().
-
-pa_card_choose_initial_profile() applies the profile selection policy,
-so module-alsa-card can first call pa_card_new(), then initialize the
-jack state, and then call pa_card_choose_initial_profile(). After that
-module-alsa-card can still override the profile selection policy, in
-case module-alsa-card was loaded with the "profile" argument. Finally,
-pa_card_put() finalizes the card creation.
-
-An alternative solution would have been to move the jack
-initialization to happen before pa_card_new() and use pa_card_new_data
-instead of pa_card in the jack initialization code, but I disliked
-that idea (I want to get rid of the "new data" pattern eventually).
-
-The order in which the initial profile policy is applied is reversed
-in this patch. Previously the first one to set it won, now the last
-one to set it wins. I think this is better, because if you have N
-parties that want to set the profile, we avoid checking N times
-whether someone else has already set the profile.
-
-Upstream-Status: Accepted [expected in 10.0]
-
-Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
----
- src/modules/alsa/module-alsa-card.c          | 32 +++++----
- src/modules/bluetooth/module-bluez4-device.c | 31 +++++----
- src/modules/bluetooth/module-bluez5-device.c |  2 +
- src/modules/macosx/module-coreaudio-device.c |  2 +
- src/modules/module-card-restore.c            | 36 +++++++---
- src/pulsecore/card.c                         | 99 +++++++++++++++++-----------
- src/pulsecore/card.h                         |  9 +++
- src/pulsecore/core.h                         |  1 +
- 8 files changed, 143 insertions(+), 69 deletions(-)
-
-diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
-index d761683..1976230 100644
---- a/src/modules/alsa/module-alsa-card.c
-+++ b/src/modules/alsa/module-alsa-card.c
-@@ -671,7 +671,7 @@ int pa__init(pa_module *m) {
-     struct userdata *u;
-     pa_reserve_wrapper *reserve = NULL;
-     const char *description;
--    const char *profile = NULL;
-+    const char *profile_str = NULL;
-     char *fn = NULL;
-     bool namereg_fail = false;
- 
-@@ -799,16 +799,6 @@ int pa__init(pa_module *m) {
-         goto fail;
-     }
- 
--    if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
--        if (pa_hashmap_get(data.profiles, profile))
--            pa_card_new_data_set_profile(&data, profile);
--        else {
--            pa_log("No such profile: %s", profile);
--            pa_card_new_data_done(&data);
--            goto fail;
--        }
--    }
--
-     u->card = pa_card_new(m->core, &data);
-     pa_card_new_data_done(&data);
- 
-@@ -822,6 +812,26 @@ int pa__init(pa_module *m) {
-             (pa_hook_cb_t) card_suspend_changed, u);
- 
-     init_jacks(u);
-+
-+    pa_card_choose_initial_profile(u->card);
-+
-+    /* If the "profile" modarg is given, we have to override whatever the usual
-+     * policy chose in pa_card_choose_initial_profile(). */
-+    profile_str = pa_modargs_get_value(u->modargs, "profile", NULL);
-+    if (profile_str) {
-+        pa_card_profile *profile;
-+
-+        profile = pa_hashmap_get(u->card->profiles, profile_str);
-+        if (!profile) {
-+            pa_log("No such profile: %s", profile_str);
-+            goto fail;
-+        }
-+
-+        pa_card_set_profile(u->card, profile, false);
-+    }
-+
-+    pa_card_put(u->card);
-+
-     init_profile(u);
-     init_eld_ctls(u);
- 
-diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c
-index a2de525..13fb7ab 100644
---- a/src/modules/bluetooth/module-bluez4-device.c
-+++ b/src/modules/bluetooth/module-bluez4-device.c
-@@ -2238,7 +2238,7 @@ static int add_card(struct userdata *u) {
-     pa_bluez4_profile_t *d;
-     pa_bluez4_form_factor_t ff;
-     char *n;
--    const char *default_profile;
-+    const char *profile_str;
-     const pa_bluez4_device *device;
-     const pa_bluez4_uuid *uuid;
- 
-@@ -2298,16 +2298,6 @@ static int add_card(struct userdata *u) {
-     *d = PA_BLUEZ4_PROFILE_OFF;
-     pa_hashmap_put(data.profiles, p->name, p);
- 
--    if ((default_profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
--        if (pa_hashmap_get(data.profiles, default_profile))
--            pa_card_new_data_set_profile(&data, default_profile);
--        else {
--            pa_log("Profile '%s' not valid or not supported by device.", default_profile);
--            pa_card_new_data_done(&data);
--            return -1;
--        }
--    }
--
-     u->card = pa_card_new(u->core, &data);
-     pa_card_new_data_done(&data);
- 
-@@ -2319,6 +2309,25 @@ static int add_card(struct userdata *u) {
-     u->card->userdata = u;
-     u->card->set_profile = card_set_profile;
- 
-+    pa_card_choose_initial_profile(u->card);
-+
-+    /* If the "profile" modarg is given, we have to override whatever the usual
-+     * policy chose in pa_card_choose_initial_profile(). */
-+    profile_str = pa_modargs_get_value(u->modargs, "profile", NULL);
-+    if (profile_str) {
-+        pa_card_profile *profile;
-+
-+        profile = pa_hashmap_get(u->card->profiles, profile_str);
-+        if (!profile) {
-+            pa_log("No such profile: %s", profile_str);
-+            return -1;
-+        }
-+
-+        pa_card_set_profile(u->card, profile, false);
-+    }
-+
-+    pa_card_put(u->card);
-+
-     d = PA_CARD_PROFILE_DATA(u->card->active_profile);
- 
-     if (*d != PA_BLUEZ4_PROFILE_OFF && (!device->transports[*d] ||
-diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
-index 84e6d55..498d0e1 100644
---- a/src/modules/bluetooth/module-bluez5-device.c
-+++ b/src/modules/bluetooth/module-bluez5-device.c
-@@ -1953,6 +1953,8 @@ static int add_card(struct userdata *u) {
- 
-     u->card->userdata = u;
-     u->card->set_profile = set_profile_cb;
-+    pa_card_choose_initial_profile(u->card);
-+    pa_card_put(u->card);
- 
-     p = PA_CARD_PROFILE_DATA(u->card->active_profile);
-     u->profile = *p;
-diff --git a/src/modules/macosx/module-coreaudio-device.c b/src/modules/macosx/module-coreaudio-device.c
-index 6c9e55d..d91c656 100644
---- a/src/modules/macosx/module-coreaudio-device.c
-+++ b/src/modules/macosx/module-coreaudio-device.c
-@@ -821,6 +821,8 @@ int pa__init(pa_module *m) {
-     pa_card_new_data_done(&card_new_data);
-     u->card->userdata = u;
-     u->card->set_profile = card_set_profile;
-+    pa_card_choose_initial_profile(u->card);
-+    pa_card_put(u->card);
- 
-     u->rtpoll = pa_rtpoll_new();
-     pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
-diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
-index 7545aa5..718a0dd 100644
---- a/src/modules/module-card-restore.c
-+++ b/src/modules/module-card-restore.c
-@@ -551,16 +551,6 @@ static pa_hook_result_t card_new_hook_callback(pa_core *c, pa_card_new_data *new
-     if (!(e = entry_read(u, new_data->name)))
-         return PA_HOOK_OK;
- 
--    if (e->profile[0]) {
--        if (!new_data->active_profile) {
--            pa_card_new_data_set_profile(new_data, e->profile);
--            pa_log_info("Restored profile '%s' for card %s.", new_data->active_profile, new_data->name);
--            new_data->save_profile = true;
--
--        } else
--            pa_log_debug("Not restoring profile for card %s, because already set.", new_data->name);
--    }
--
-     /* Always restore the latency offsets because their
-      * initial value is always 0 */
- 
-@@ -590,6 +580,30 @@ static pa_hook_result_t card_new_hook_callback(pa_core *c, pa_card_new_data *new
-     return PA_HOOK_OK;
- }
- 
-+static pa_hook_result_t card_choose_initial_profile_callback(pa_core *core, pa_card *card, struct userdata *u) {
-+    struct entry *e;
-+
-+    if (!(e = entry_read(u, card->name)))
-+        return PA_HOOK_OK;
-+
-+    if (e->profile[0]) {
-+        pa_card_profile *profile;
-+
-+        profile = pa_hashmap_get(card->profiles, e->profile);
-+        if (profile) {
-+            pa_log_info("Restoring profile '%s' for card %s.", card->active_profile->name, card->name);
-+            pa_card_set_profile(card, profile, true);
-+        } else {
-+            pa_log_debug("Tried to restore profile %s for card %s, but the card doesn't have such profile.",
-+                         e->profile, card->name);
-+        }
-+    }
-+
-+    entry_free(e);
-+
-+    return PA_HOOK_OK;
-+}
-+
- static pa_hook_result_t card_preferred_port_changed_callback(pa_core *core, pa_card_preferred_port_changed_hook_data *data,
-                                                              struct userdata *u) {
-     struct entry *e;
-@@ -634,6 +648,8 @@ int pa__init(pa_module*m) {
-     u->module = m;
- 
-     pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_CARD_NEW], PA_HOOK_EARLY, (pa_hook_cb_t) card_new_hook_callback, u);
-+    pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_CARD_CHOOSE_INITIAL_PROFILE], PA_HOOK_NORMAL,
-+                           (pa_hook_cb_t) card_choose_initial_profile_callback, u);
-     pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_CARD_PUT], PA_HOOK_NORMAL, (pa_hook_cb_t) card_put_hook_callback, u);
-     pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_CARD_PREFERRED_PORT_CHANGED], PA_HOOK_NORMAL, (pa_hook_cb_t) card_preferred_port_changed_callback, u);
-     pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_CARD_PROFILE_CHANGED], PA_HOOK_NORMAL, (pa_hook_cb_t) card_profile_changed_callback, u);
-diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
-index 0ac70b9..a0c3d93 100644
---- a/src/pulsecore/card.c
-+++ b/src/pulsecore/card.c
-@@ -176,38 +176,56 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
-     c->preferred_input_port = data->preferred_input_port;
-     c->preferred_output_port = data->preferred_output_port;
- 
--    if (data->active_profile)
--        if ((c->active_profile = pa_hashmap_get(c->profiles, data->active_profile)))
--            c->save_profile = data->save_profile;
-+    pa_device_init_description(c->proplist, c);
-+    pa_device_init_icon(c->proplist, true);
-+    pa_device_init_intended_roles(c->proplist);
- 
--    if (!c->active_profile) {
--        PA_HASHMAP_FOREACH(profile, c->profiles, state) {
--            if (profile->available == PA_AVAILABLE_NO)
--                continue;
-+    return c;
-+}
- 
--            if (!c->active_profile || profile->priority > c->active_profile->priority)
--                c->active_profile = profile;
--        }
--        /* If all profiles are not available, then we still need to pick one */
--        if (!c->active_profile) {
--            PA_HASHMAP_FOREACH(profile, c->profiles, state)
--                if (!c->active_profile || profile->priority > c->active_profile->priority)
--                    c->active_profile = profile;
-+void pa_card_choose_initial_profile(pa_card *card) {
-+    pa_card_profile *profile;
-+    void *state;
-+    pa_card_profile *best = NULL;
-+
-+    pa_assert(card);
-+
-+    /* By default, pick the highest priority profile that is not unavailable,
-+     * or if all profiles are unavailable, pick the profile with the highest
-+     * priority regardless of its availability. */
-+
-+    PA_HASHMAP_FOREACH(profile, card->profiles, state) {
-+        if (profile->available == PA_AVAILABLE_NO)
-+            continue;
-+
-+        if (!best || profile->priority > best->priority)
-+            best = profile;
-+    }
-+
-+    if (!best) {
-+        PA_HASHMAP_FOREACH(profile, card->profiles, state) {
-+            if (!best || profile->priority > best->priority)
-+                best = profile;
-         }
--        pa_assert(c->active_profile);
-     }
-+    pa_assert(best);
- 
--    pa_device_init_description(c->proplist, c);
--    pa_device_init_icon(c->proplist, true);
--    pa_device_init_intended_roles(c->proplist);
-+    card->active_profile = best;
-+    card->save_profile = false;
- 
--    pa_assert_se(pa_idxset_put(core->cards, c, &c->index) >= 0);
-+    /* Let policy modules override the default. */
-+    pa_hook_fire(&card->core->hooks[PA_CORE_HOOK_CARD_CHOOSE_INITIAL_PROFILE], card);
-+}
- 
--    pa_log_info("Created %u \"%s\"", c->index, c->name);
--    pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_NEW, c->index);
-+void pa_card_put(pa_card *card) {
-+    pa_assert(card);
- 
--    pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_PUT], c);
--    return c;
-+    pa_assert_se(pa_idxset_put(card->core->cards, card, &card->index) >= 0);
-+    card->linked = true;
-+
-+    pa_log_info("Created %u \"%s\"", card->index, card->name);
-+    pa_hook_fire(&card->core->hooks[PA_CORE_HOOK_CARD_PUT], card);
-+    pa_subscription_post(card->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_NEW, card->index);
- }
- 
- void pa_card_free(pa_card *c) {
-@@ -218,15 +236,15 @@ void pa_card_free(pa_card *c) {
- 
-     core = c->core;
- 
--    pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_UNLINK], c);
--
--    pa_namereg_unregister(core, c->name);
--
--    pa_idxset_remove_by_data(c->core->cards, c, NULL);
-+    if (c->linked) {
-+        pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_UNLINK], c);
- 
--    pa_log_info("Freed %u \"%s\"", c->index, c->name);
-+        pa_idxset_remove_by_data(c->core->cards, c, NULL);
-+        pa_log_info("Freed %u \"%s\"", c->index, c->name);
-+        pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_REMOVE, c->index);
-+    }
- 
--    pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_REMOVE, c->index);
-+    pa_namereg_unregister(core, c->name);
- 
-     pa_assert(pa_idxset_isempty(c->sinks));
-     pa_idxset_free(c->sinks, NULL);
-@@ -298,20 +316,27 @@ int pa_card_set_profile(pa_card *c, pa_card_profile *profile, bool save) {
-         return 0;
-     }
- 
--    if ((r = c->set_profile(c, profile)) < 0)
-+    /* If we're setting the initial profile, we shouldn't call set_profile(),
-+     * because the implementations don't expect that (for historical reasons).
-+     * We should just set c->active_profile, and the implementations will
-+     * properly set up that profile after pa_card_put() has returned. It would
-+     * be probably good to change this so that also the initial profile can be
-+     * set up in set_profile(), but if set_profile() fails, that would need
-+     * some better handling than what we do here currently. */
-+    if (c->linked && (r = c->set_profile(c, profile)) < 0)
-         return r;
- 
--    pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_CHANGE, c->index);
--
--    pa_log_info("Changed profile of card %u \"%s\" to %s", c->index, c->name, profile->name);
--
-     c->active_profile = profile;
-     c->save_profile = save;
- 
-     if (save)
-         update_port_preferred_profile(c);
- 
--    pa_hook_fire(&c->core->hooks[PA_CORE_HOOK_CARD_PROFILE_CHANGED], c);
-+    if (c->linked) {
-+        pa_log_info("Changed profile of card %u \"%s\" to %s", c->index, c->name, profile->name);
-+        pa_hook_fire(&c->core->hooks[PA_CORE_HOOK_CARD_PROFILE_CHANGED], c);
-+        pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_CHANGE, c->index);
-+    }
- 
-     return 0;
- }
-diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
-index d4970e3..fd1fe0a 100644
---- a/src/pulsecore/card.h
-+++ b/src/pulsecore/card.h
-@@ -86,6 +86,8 @@ struct pa_card {
- 
-     pa_suspend_cause_t suspend_cause;
- 
-+    bool linked;
-+
-     void *userdata;
- 
-     int (*set_profile)(pa_card *c, pa_card_profile *profile);
-@@ -128,6 +130,13 @@ void pa_card_new_data_set_preferred_port(pa_card_new_data *data, pa_direction_t
- void pa_card_new_data_done(pa_card_new_data *data);
- 
- pa_card *pa_card_new(pa_core *c, pa_card_new_data *data);
-+
-+/* Select the initial card profile according to the configured policies. This
-+ * must be called between pa_card_new() and pa_card_put(), after the port and
-+ * profile availablities have been initialized. */
-+void pa_card_choose_initial_profile(pa_card *card);
-+
-+void pa_card_put(pa_card *c);
- void pa_card_free(pa_card *c);
- 
- void pa_card_add_profile(pa_card *c, pa_card_profile *profile);
-diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
-index 00d7f2f..802111b 100644
---- a/src/pulsecore/core.h
-+++ b/src/pulsecore/core.h
-@@ -118,6 +118,7 @@ typedef enum pa_core_hook {
-     PA_CORE_HOOK_CLIENT_PROPLIST_CHANGED,
-     PA_CORE_HOOK_CLIENT_SEND_EVENT,
-     PA_CORE_HOOK_CARD_NEW,
-+    PA_CORE_HOOK_CARD_CHOOSE_INITIAL_PROFILE,
-     PA_CORE_HOOK_CARD_PUT,
-     PA_CORE_HOOK_CARD_UNLINK,
-     PA_CORE_HOOK_CARD_PREFERRED_PORT_CHANGED,
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-card-remove-pa_card_new_data.active_profile.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-card-remove-pa_card_new_data.active_profile.patch
deleted file mode 100644
index 480f2ce..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-card-remove-pa_card_new_data.active_profile.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 375bc56fd3d66f40a9650224e5bfea4002494ade Mon Sep 17 00:00:00 2001
-From: Tanu Kaskinen <tanuk@iki.fi>
-Date: Fri, 23 Oct 2015 13:50:35 +0300
-Subject: [PATCH 4/5] card: remove pa_card_new_data.active_profile
-
-It's not being used any more.
-
-Upstream-Status: Accepted [expected in 10.0]
-
-Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
----
- src/pulsecore/card.c | 8 --------
- src/pulsecore/card.h | 5 -----
- 2 files changed, 13 deletions(-)
-
-diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
-index a0c3d93..bc5b75b 100644
---- a/src/pulsecore/card.c
-+++ b/src/pulsecore/card.c
-@@ -96,13 +96,6 @@ void pa_card_new_data_set_name(pa_card_new_data *data, const char *name) {
-     data->name = pa_xstrdup(name);
- }
- 
--void pa_card_new_data_set_profile(pa_card_new_data *data, const char *profile) {
--    pa_assert(data);
--
--    pa_xfree(data->active_profile);
--    data->active_profile = pa_xstrdup(profile);
--}
--
- void pa_card_new_data_set_preferred_port(pa_card_new_data *data, pa_direction_t direction, pa_device_port *port) {
-     pa_assert(data);
- 
-@@ -125,7 +118,6 @@ void pa_card_new_data_done(pa_card_new_data *data) {
-         pa_hashmap_free(data->ports);
- 
-     pa_xfree(data->name);
--    pa_xfree(data->active_profile);
- }
- 
- pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
-diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
-index fd1fe0a..5699475 100644
---- a/src/pulsecore/card.h
-+++ b/src/pulsecore/card.h
-@@ -101,15 +101,11 @@ typedef struct pa_card_new_data {
-     pa_module *module;
- 
-     pa_hashmap *profiles;
--    char *active_profile;
--
-     pa_hashmap *ports;
-     pa_device_port *preferred_input_port;
-     pa_device_port *preferred_output_port;
- 
-     bool namereg_fail:1;
--
--    bool save_profile:1;
- } pa_card_new_data;
- 
- typedef struct {
-@@ -125,7 +121,6 @@ void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available)
- 
- pa_card_new_data *pa_card_new_data_init(pa_card_new_data *data);
- void pa_card_new_data_set_name(pa_card_new_data *data, const char *name);
--void pa_card_new_data_set_profile(pa_card_new_data *data, const char *profile);
- void pa_card_new_data_set_preferred_port(pa_card_new_data *data, pa_direction_t direction, pa_device_port *port);
- void pa_card_new_data_done(pa_card_new_data *data);
- 
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0005-alsa-set-availability-for-some-unavailable-profiles.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0005-alsa-set-availability-for-some-unavailable-profiles.patch
deleted file mode 100644
index 5563d2c..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0005-alsa-set-availability-for-some-unavailable-profiles.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From ae6a01ba204b480bda6a5b4431be3d22e53a7006 Mon Sep 17 00:00:00 2001
-From: Tanu Kaskinen <tanuk@iki.fi>
-Date: Fri, 23 Oct 2015 13:37:11 +0300
-Subject: [PATCH 5/5] alsa: set availability for (some) unavailable profiles
-
-The alsa card hasn't so far set any availability for profiles. That
-caused an issue with some HDMI hardware: the sound card has two HDMI
-outputs, but only the second of them is actually usable. The
-unavailable port is marked as unavailable and the available port is
-marked as available, but this information isn't propagated to the
-profile availability. Without profile availability information, the
-initial profile policy picks the unavailable one, since it has a
-higher priority value.
-
-This patch adds simple logic for marking some profiles unavailable:
-if the profile only contains unavailable ports, the profile is
-unavailable too. This can be improved in the future so that if a
-profile contains sinks or sources that only contain unavailable ports,
-the profile should be marked as unavailable. Implementing that
-requires adding more information about the sinks and sources to
-pa_card_profile, however.
-
-BugLink: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8448
-
-Upstream-Status: Accepted [expected in 10.0]
-
-Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
----
- src/modules/alsa/module-alsa-card.c | 27 +++++++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
-
-diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
-index 1976230..323e08a 100644
---- a/src/modules/alsa/module-alsa-card.c
-+++ b/src/modules/alsa/module-alsa-card.c
-@@ -366,6 +366,7 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) {
-     void *state;
-     pa_alsa_jack *jack;
-     struct temp_port_avail *tp, *tports;
-+    pa_card_profile *profile;
- 
-     pa_assert(u);
- 
-@@ -426,6 +427,32 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) {
-         if (tp->avail == PA_AVAILABLE_NO)
-            pa_device_port_set_available(tp->port, tp->avail);
- 
-+    /* Update profile availabilities. The logic could be improved; for now we
-+     * only set obviously unavailable profiles (those that contain only
-+     * unavailable ports) to PA_AVAILABLE_NO and all others to
-+     * PA_AVAILABLE_UNKNOWN. */
-+    PA_HASHMAP_FOREACH(profile, u->card->profiles, state) {
-+        pa_device_port *port;
-+        void *state2;
-+        pa_available_t available = PA_AVAILABLE_NO;
-+
-+        /* Don't touch the "off" profile. */
-+        if (profile->n_sources == 0 && profile->n_sinks == 0)
-+            continue;
-+
-+        PA_HASHMAP_FOREACH(port, u->card->ports, state2) {
-+            if (!pa_hashmap_get(port->profiles, profile->name))
-+                continue;
-+
-+            if (port->available != PA_AVAILABLE_NO) {
-+                available = PA_AVAILABLE_UNKNOWN;
-+                break;
-+            }
-+        }
-+
-+        pa_card_profile_set_available(profile, available);
-+    }
-+
-     pa_xfree(tports);
-     return 0;
- }
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio_10.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio_10.0.bb
new file mode 100644
index 0000000..f3a8573
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio_10.0.bb
@@ -0,0 +1,14 @@
+require pulseaudio.inc
+
+SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \
+           file://0001-padsp-Make-it-compile-on-musl.patch \
+           file://0001-client-conf-Add-allow-autospawn-for-root.patch \
+           file://volatiles.04_pulse \
+"
+SRC_URI[md5sum] = "4950d2799bf55ab91f6b7f990b7f0971"
+SRC_URI[sha256sum] = "a3186824de9f0d2095ded5d0d0db0405dc73133983c2fbb37291547e37462f57"
+
+do_compile_prepend() {
+    mkdir -p ${S}/libltdl
+    cp ${STAGING_LIBDIR}/libltdl* ${S}/libltdl
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio_9.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio_9.0.bb
deleted file mode 100644
index 00f5442..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio_9.0.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-require pulseaudio.inc
-
-SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \
-           file://0001-padsp-Make-it-compile-on-musl.patch \
-           file://0001-client-conf-Add-allow-autospawn-for-root.patch \
-           file://0001-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch \
-           file://0002-card-don-t-allow-the-CARD_NEW-hook-to-fail.patch \
-           file://0003-card-move-profile-selection-after-pa_card_new.patch \
-           file://0004-card-remove-pa_card_new_data.active_profile.patch \
-           file://0005-alsa-set-availability-for-some-unavailable-profiles.patch \
-           file://volatiles.04_pulse \
-"
-SRC_URI[md5sum] = "da7162541b3a9bc20576dbd0d7d1489a"
-SRC_URI[sha256sum] = "c3d3d66b827f18fbe903fe3df647013f09fc1e2191c035be1ee2d82a9e404686"
-
-do_compile_prepend() {
-    mkdir -p ${S}/libltdl
-    cp ${STAGING_LIBDIR}/libltdl* ${S}/libltdl
-}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/webp/libwebp_0.5.1.bb b/import-layers/yocto-poky/meta/recipes-multimedia/webp/libwebp_0.5.1.bb
deleted file mode 100644
index b882db7..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/webp/libwebp_0.5.1.bb
+++ /dev/null
@@ -1,54 +0,0 @@
-SUMMARY = "WebP is an image format designed for the Web"
-DESCRIPTION = "WebP is a method of lossy and lossless compression that can be \
-               used on a large variety of photographic, translucent and \
-               graphical images found on the web. The degree of lossy \
-               compression is adjustable so a user can choose the trade-off \
-               between file size and image quality. WebP typically achieves \
-               an average of 30% more compression than JPEG and JPEG 2000, \
-               without loss of image quality."
-HOMEPAGE = "https://developers.google.com/speed/webp/"
-SECTION = "libs"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=6e8dee932c26f2dab503abf70c96d8bb \
-                    file://PATENTS;md5=c6926d0cb07d296f886ab6e0cc5a85b7"
-
-SRC_URI = "http://downloads.webmproject.org/releases/webp/${BP}.tar.gz"
-SRC_URI[md5sum] = "3d7db92ebba5b4f679413d25c6040881"
-SRC_URI[sha256sum] = "6ad66c6fcd60a023de20b6856b03da8c7d347269d76b1fd9c3287e8b5e8813df"
-
-UPSTREAM_CHECK_URI = "http://downloads.webmproject.org/releases/webp/index.html"
-
-EXTRA_OECONF = " \
-    --disable-experimental \
-    --disable-wic \
-    --enable-libwebpmux \
-    --enable-libwebpdemux \
-    --enable-threading \
-"
-# Do not trust configure to determine if neon is available.
-#
-EXTRA_OECONF_append_arm = " \
-    ${@bb.utils.contains("TUNE_FEATURES","neon","--enable-neon","--disable-neon",d)} \
-"
-
-inherit autotools lib_package
-
-PACKAGECONFIG ??= ""
-
-# libwebpdecoder is a subset of libwebp, don't build it unless requested
-PACKAGECONFIG[decoder] = "--enable-libwebpdecoder,--disable-libwebpdecoder"
-
-# Apply for examples programs: cwebp and dwebp
-PACKAGECONFIG[gif] = "--enable-gif,--disable-gif,giflib"
-PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
-PACKAGECONFIG[png] = "--enable-png,--disable-png,,libpng"
-PACKAGECONFIG[tiff] = "--enable-tiff,--disable-tiff,tiff"
-
-# Apply only for example program vwebp
-PACKAGECONFIG[gl] = "--enable-gl,--disable-gl,mesa-glut"
-
-PACKAGES =+ "${PN}-gif2webp"
-
-DESCRIPTION_${PN}-gif2webp = "Simple tool to convert animated GIFs to WebP"
-FILES_${PN}-gif2webp = "${bindir}/gif2webp"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/webp/libwebp_0.6.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/webp/libwebp_0.6.0.bb
new file mode 100644
index 0000000..bc565e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/webp/libwebp_0.6.0.bb
@@ -0,0 +1,54 @@
+SUMMARY = "WebP is an image format designed for the Web"
+DESCRIPTION = "WebP is a method of lossy and lossless compression that can be \
+               used on a large variety of photographic, translucent and \
+               graphical images found on the web. The degree of lossy \
+               compression is adjustable so a user can choose the trade-off \
+               between file size and image quality. WebP typically achieves \
+               an average of 30% more compression than JPEG and JPEG 2000, \
+               without loss of image quality."
+HOMEPAGE = "https://developers.google.com/speed/webp/"
+SECTION = "libs"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6e8dee932c26f2dab503abf70c96d8bb \
+                    file://PATENTS;md5=c6926d0cb07d296f886ab6e0cc5a85b7"
+
+SRC_URI = "http://downloads.webmproject.org/releases/webp/${BP}.tar.gz"
+SRC_URI[md5sum] = "19a6e926ab1721268df03161b84bb4a0"
+SRC_URI[sha256sum] = "c928119229d4f8f35e20113ffb61f281eda267634a8dc2285af4b0ee27cf2b40"
+
+UPSTREAM_CHECK_URI = "http://downloads.webmproject.org/releases/webp/index.html"
+
+EXTRA_OECONF = " \
+    --disable-experimental \
+    --disable-wic \
+    --enable-libwebpmux \
+    --enable-libwebpdemux \
+    --enable-threading \
+"
+# Do not trust configure to determine if neon is available.
+#
+EXTRA_OECONF_append_arm = " \
+    ${@bb.utils.contains("TUNE_FEATURES","neon","--enable-neon","--disable-neon",d)} \
+"
+
+inherit autotools lib_package
+
+PACKAGECONFIG ??= ""
+
+# libwebpdecoder is a subset of libwebp, don't build it unless requested
+PACKAGECONFIG[decoder] = "--enable-libwebpdecoder,--disable-libwebpdecoder"
+
+# Apply for examples programs: cwebp and dwebp
+PACKAGECONFIG[gif] = "--enable-gif,--disable-gif,giflib"
+PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
+PACKAGECONFIG[png] = "--enable-png,--disable-png,,libpng"
+PACKAGECONFIG[tiff] = "--enable-tiff,--disable-tiff,tiff"
+
+# Apply only for example program vwebp
+PACKAGECONFIG[gl] = "--enable-gl,--disable-gl,mesa-glut"
+
+PACKAGES =+ "${PN}-gif2webp"
+
+DESCRIPTION_${PN}-gif2webp = "Simple tool to convert animated GIFs to WebP"
+FILES_${PN}-gif2webp = "${bindir}/gif2webp"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/Fix-X32-build-by-disabling-asm.patch b/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/Fix-X32-build-by-disabling-asm.patch
new file mode 100644
index 0000000..087a448
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/Fix-X32-build-by-disabling-asm.patch
@@ -0,0 +1,53 @@
+From 66b120079fb21ed38cab0900c63360b0a7853eaa Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 14:22:32 -0700
+Subject: [PATCH] Fix X32 build by disabling asm
+
+This applies gentoo's x32 patch, adjusted slightly, which disables asm support
+for x32 as well as correcting -m.
+
+Debian has a different patch which does the same, and there's a superior yet
+out of date patch series on the x264 list which keeps asm support enabled, but
+doesn't successfully build at this time, and my assembly is very rusty.
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ configure | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 3109ec4..844aeae 100755
+--- a/configure
++++ b/configure
+@@ -703,7 +703,13 @@ case $host_cpu in
+         AS_EXT=".asm"
+         ASFLAGS="$ASFLAGS -DARCH_X86_64=1 -I\$(SRCPATH)/common/x86/"
+         stack_alignment=16
+-        [ $compiler = GNU ] && CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
++        if [ $compiler = GNU ]; then
++            if cpp_check "" "" "__ILP32__" ; then
++                CFLAGS="-mx32 $CFLAGS" && LDFLAGS="-mx32 $LDFLAGS"
++            else
++                CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
++            fi
++        fi
+         if [ "$SYS" = MACOSX ]; then
+             ASFLAGS="$ASFLAGS -f macho64 -DPIC -DPREFIX"
+             if cc_check '' "-arch x86_64"; then
+@@ -722,7 +728,11 @@ case $host_cpu in
+                 RCFLAGS="--target=pe-x86-64 $RCFLAGS"
+             fi
+         else
+-            ASFLAGS="$ASFLAGS -f elf64"
++            if cpp_check "" "" "__ILP32__" ; then
++                asm=no
++            else
++                ASFLAGS="$ASFLAGS -f elf64"
++            fi
+         fi
+         ;;
+     powerpc*)
+-- 
+2.8.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch b/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch
index bf72fca..73f2aac 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch
@@ -5,10 +5,10 @@
 Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
 
 diff --git a/configure b/configure
-index 2916036..f4ece40 100755
+index 9d1586c..3109ec4 100755
 --- a/configure
 +++ b/configure
-@@ -773,9 +773,6 @@ if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
+@@ -874,9 +874,6 @@ if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
  fi
  
  if [ $asm = auto -a $ARCH = ARM ] ; then
@@ -18,12 +18,3 @@
      if  cc_check '' '' '__asm__("rev ip, ip");' ; then      define HAVE_ARMV6
          cc_check '' '' '__asm__("movt r0, #0");'         && define HAVE_ARMV6T2
          cc_check '' '' '__asm__("vadd.i16 q0, q0, q0");' && define HAVE_NEON
-@@ -788,8 +785,6 @@ if [ $asm = auto -a $ARCH = ARM ] ; then
- fi
- 
- if [ $asm = auto -a $ARCH = AARCH64 ] ; then
--    # set flags so neon is built by default
--    echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-arch)' || CFLAGS="$CFLAGS -arch arm64 -mfpu=neon"
- 
-     if  cc_check '' '' '__asm__("cmeq v0.8h, v0.8h, #0");' ; then define HAVE_NEON
-         ASFLAGS="$ASFLAGS -c"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264_git.bb
index 393310f..69f52c2 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264_git.bb
@@ -8,13 +8,14 @@
 
 DEPENDS = "yasm-native"
 
-SRC_URI = "git://git.videolan.org/x264.git \
+SRC_URI = "git://github.com/mirror/x264;branch=stable \
            file://don-t-default-to-cortex-a9-with-neon.patch \
+           file://Fix-X32-build-by-disabling-asm.patch \
            "
 
-SRCREV = "c8a773ebfca148ef04f5a60d42cbd7336af0baf6"
+SRCREV = "2b741f81e51f92d053d87a49f59ff1026553a0f6"
 
-PV = "r2491+git${SRCPV}"
+PV = "r2731+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
@@ -24,6 +25,7 @@
 X264_DISABLE_ASM_armv4 = "--disable-asm"
 X264_DISABLE_ASM_armv5 = "--disable-asm"
 X264_DISABLE_ASM_powerpc = "${@bb.utils.contains("TUNE_FEATURES", "spe", "--disable-asm", "", d)}"
+X264_DISABLE_ASM_mipsarch = "${@bb.utils.contains("TUNE_FEATURES", "r6", "", "--disable-asm", d)}"
 
 EXTRA_OECONF = '--prefix=${prefix} \
                 --host=${HOST_SYS} \
@@ -34,6 +36,7 @@
                 --enable-static \
                 --disable-lavf \
                 --disable-swscale \
+                --disable-opencl \
                 --enable-pic \
                 ${X264_DISABLE_ASM} \
                '
@@ -42,12 +45,8 @@
     ./configure ${EXTRA_OECONF}
 }
 
-AS = "${TARGET_PREFIX}gcc"
-
 do_install() {
     oe_runmake install DESTDIR=${D}
 }
 
-# PIC can't be enabled for few BSP's
-INSANE_SKIP_${PN}_append = " textrel"
-
+AS[unexport] = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt-sdk.bb b/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt-sdk.bb
index 7ddf671..7c1e5bf 100644
--- a/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt-sdk.bb
+++ b/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt-sdk.bb
@@ -4,7 +4,7 @@
 # PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
 # to build multiple virtual/kernel providers.
 python () {
-    if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-yocto-rt":
+    if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
         raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
 }
 
diff --git a/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt.bb b/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt.bb
index 9c86f25..d8bb04a 100644
--- a/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt.bb
+++ b/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt.bb
@@ -4,7 +4,7 @@
 # PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
 # to build multiple virtual/kernel providers.
 python () {
-    if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-yocto-rt":
+    if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
         raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
 }
 
diff --git a/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato.bb b/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato.bb
index e3246d2..99dad11 100644
--- a/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato.bb
+++ b/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato.bb
@@ -9,3 +9,6 @@
 inherit core-image
 
 IMAGE_INSTALL += "packagegroup-core-x11-sato-games"
+
+TOOLCHAIN_HOST_TASK_append = " nativesdk-intltool nativesdk-glib-2.0"
+TOOLCHAIN_HOST_TASK_remove_task-populate-sdk-ext = " nativesdk-intltool nativesdk-glib-2.0"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_2.1.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_2.1.bb
index d9a2f22..c9a7b4b 100644
--- a/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_2.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_2.1.bb
@@ -7,7 +7,7 @@
                     file://src/desktop.c;endline=20;md5=36c9bf295e6007f3423095f405af5a2d \
                     file://src/main.c;endline=19;md5=2044244f97a195c25b7dc602ac7e9a00"
 
-DEPENDS = "gtk+3 startup-notification dbus"
+DEPENDS = "gnome-common-native gtk+3 startup-notification dbus"
 SECTION = "x11/wm"
 
 # SRCREV tagged 2.1
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_2.11.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_2.11.bb
index d38e7f6..421740f 100644
--- a/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_2.11.bb
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_2.11.bb
@@ -7,15 +7,15 @@
                     file://matchbox-panel/mb-panel.h;endline=10;md5=0b7db28f4b6863fb853d0467e590019a \
                     file://applets/startup/startup.c;endline=22;md5=7cbcea60b667f609495222faf3e07917"
 
-DEPENDS = "gnome-common gtk+3 startup-notification dbus dbus-glib dbus-glib-native"
+DEPENDS = "gtk+3 startup-notification dbus dbus-glib dbus-glib-native"
 DEPENDS += " ${@bb.utils.contains("MACHINE_FEATURES", "acpi", "libacpi", "",d)}"
 DEPENDS += " ${@bb.utils.contains("MACHINE_FEATURES", "apm", "apmd", "",d)}"
 
 # The startup-notification requires x11 in DISTRO_FEATURES
 REQUIRED_DISTRO_FEATURES = "x11"
 
-# SRCREV tagged 2.11
-SRCREV = "850d5fffde7dbfb32015916524d88014cc2cfb30"
+# SRCREV tagged 2.11 plus some autotools fixes
+SRCREV = "f82ca3f42510fb3ef10f598b393eb373a2c34ca7"
 
 RPROVIDES_${PN} = "matchbox-panel"
 RREPLACES_${PN} = "matchbox-panel"
@@ -37,4 +37,4 @@
                 ${datadir}/icons/"
 FILES_${PN}-dev += "${libdir}/matchbox-panel/*.la"
 
-inherit autotools pkgconfig distro_features_check
+inherit autotools pkgconfig distro_features_check gettext
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb
index 42c742f..d146e83 100644
--- a/import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb
@@ -6,7 +6,6 @@
 LIC_FILES_CHKSUM = "file://session;endline=3;md5=f8a5c5b9c279e52dc094d10e11c2be63"
 
 SECTION = "x11"
-DEPENDS = "gconf-native"
 RDEPENDS_${PN} = "formfactor matchbox-theme-sato matchbox-panel-2 matchbox-desktop matchbox-session gconf"
 PR = "r30"
 
@@ -43,6 +42,7 @@
         chmod +x ${D}/${sysconfdir}/matchbox/session
 }
 
+PACKAGE_WRITE_DEPS += "gconf-native"
 pkg_postinst_${PN} () {
 	set_value() {
 		#type, name, value
diff --git a/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.4.bb b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.4.bb
deleted file mode 100644
index a6bf213..0000000
--- a/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.4.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-SUMMARY = "Fast lightweight tabbed filemanager"
-HOMEPAGE = "http://pcmanfm.sourceforge.net/"
-
-LICENSE = "GPLv2 & GPLv2+ & LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
-                    file://src/pcmanfm.h;endline=22;md5=417b3855771a3a87f8ad753d994491f0 \
-                    file://src/gseal-gtk-compat.h;endline=21;md5=46922c8691f58d124f9420fe16149ce2"
-
-SECTION = "x11"
-DEPENDS = "gtk+3 startup-notification libfm intltool-native gettext-native"
-
-
-COMPATIBLE_HOST = '(x86_64.*|i.86.*|aarch64.*|arm.*|mips.*|powerpc.*|sh.*)-(linux|freebsd.*)'
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/pcmanfm-${PV}.tar.xz \
-	   file://gnome-fs-directory.png \
-	   file://gnome-fs-regular.png \
-	   file://gnome-mime-text-plain.png \
-	   file://emblem-symbolic-link.png \
-	   file://no-desktop.patch"
-
-SRC_URI[md5sum] = "19764c2f59653724c8713e0064fa6829"
-SRC_URI[sha256sum] = "38cdbb5f01d24483b41b8e6846e4aa66a5751bb3982a8618899e88a853dbe313"
-
-UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/pcmanfm/files/PCManFM%20%2B%20Libfm%20%28tarball%20release%29/PCManFM/"
-
-inherit autotools pkgconfig distro_features_check
-
-# The startup-notification requires x11 in DISTRO_FEATURES
-REQUIRED_DISTRO_FEATURES = "x11"
-
-EXTRA_OECONF = "--with-gtk=3"
-
-do_install_append () {
-	install -d ${D}/${datadir}
-	install -d ${D}/${datadir}/pixmaps/
-
-	install -m 0644 ${WORKDIR}/*.png ${D}/${datadir}/pixmaps
-}
-
-FILES_${PN} += "${libdir}/pcmanfm"
-
-RRECOMMENDS_${PN} += "adwaita-icon-theme"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.5.bb b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.5.bb
new file mode 100644
index 0000000..75ff773
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.5.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Fast lightweight tabbed filemanager"
+HOMEPAGE = "http://pcmanfm.sourceforge.net/"
+
+LICENSE = "GPLv2 & GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://src/pcmanfm.h;endline=22;md5=417b3855771a3a87f8ad753d994491f0 \
+                    file://src/gseal-gtk-compat.h;endline=21;md5=46922c8691f58d124f9420fe16149ce2"
+
+SECTION = "x11"
+DEPENDS = "gtk+3 startup-notification libfm intltool-native gettext-native glib-2.0-native"
+
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|aarch64.*|arm.*|mips.*|powerpc.*|sh.*)-(linux|freebsd.*)'
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/pcmanfm-${PV}.tar.xz \
+	   file://gnome-fs-directory.png \
+	   file://gnome-fs-regular.png \
+	   file://gnome-mime-text-plain.png \
+	   file://emblem-symbolic-link.png \
+	   file://no-desktop.patch"
+
+SRC_URI[md5sum] = "b4d1f8ce08d87e4f27805a246fc51ac2"
+SRC_URI[sha256sum] = "0c86cac028b705ff314c7464d814c2cf7ff604c17491c20aa204b1ef1a80ad67"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/pcmanfm/files/PCManFM%20%2B%20Libfm%20%28tarball%20release%29/PCManFM/"
+
+inherit autotools pkgconfig distro_features_check
+
+# The startup-notification requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OECONF = "--with-gtk=3"
+
+do_install_append () {
+	install -d ${D}/${datadir}
+	install -d ${D}/${datadir}/pixmaps/
+
+	install -m 0644 ${WORKDIR}/*.png ${D}/${datadir}/pixmaps
+}
+
+FILES_${PN} += "${libdir}/pcmanfm"
+
+RRECOMMENDS_${PN} += "adwaita-icon-theme"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-Clarify-conditions-to-avoid-compiler-errors.patch b/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-Clarify-conditions-to-avoid-compiler-errors.patch
new file mode 100644
index 0000000..89aa158
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-Clarify-conditions-to-avoid-compiler-errors.patch
@@ -0,0 +1,48 @@
+From 72f2e9043ef509992dfa61791638db87bf0ae37b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 6 Dec 2016 01:20:00 +0000
+Subject: [PATCH] Clarify conditions to avoid compiler errors
+
+Fix errors pointed out by clang
+
+error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses]
+|         if (only_immutable && !copy->flags[i] & FLAG_IMMUTABLE) continue;
+|                               ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ signpost.c | 2 +-
+ tracks.c   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/signpost.c b/signpost.c
+index aa2e13a..2e2dff2 100644
+--- a/signpost.c
++++ b/signpost.c
+@@ -284,7 +284,7 @@ static int check_nums(game_state *orig, game_state *copy, int only_immutable)
+     int i, ret = 1;
+     assert(copy->n == orig->n);
+     for (i = 0; i < copy->n; i++) {
+-        if (only_immutable && !copy->flags[i] & FLAG_IMMUTABLE) continue;
++        if (only_immutable && !(copy->flags[i] & FLAG_IMMUTABLE)) continue;
+         assert(copy->nums[i] >= 0);
+         assert(copy->nums[i] <= copy->n);
+         if (copy->nums[i] != orig->nums[i]) {
+diff --git a/tracks.c b/tracks.c
+index 5b27350..ca44ce1 100644
+--- a/tracks.c
++++ b/tracks.c
+@@ -1072,7 +1072,7 @@ static int solve_check_single_sub(game_state *state, int si, int id, int n,
+         x = i%w;
+         y = i/w;
+         if (abs(ox-x) > 1 || abs(oy-y) > 1) {
+-            if (!state->sflags[i] & S_TRACK)
++            if (!(state->sflags[i] & S_TRACK))
+                 did += solve_set_sflag(state, x, y, S_NOTRACK, what);
+         }
+     }
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch b/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch
deleted file mode 100644
index 0b971c4..0000000
--- a/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 78d6d1706c21ad467520075ff7a8bf15cfbd68b3 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 30 Dec 2015 22:13:16 +0000
-Subject: [PATCH] rect: Fix compiler errors about uninitialized use of
- variables
-
-error: 'r2.x' may be used uninitialized in this function
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Submitted
-
- rect.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/rect.c b/rect.c
-index 55667c0..fa3a786 100644
---- a/rect.c
-+++ b/rect.c
-@@ -1317,7 +1317,8 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
-                     if (ndirs > 0) {
-                         int which, dir;
-                         struct rect r1, r2;
--
-+                        memset(&r1, 0, sizeof(struct rect));
-+                        memset(&r2, 0, sizeof(struct rect));
-                         which = random_upto(rs, ndirs);
-                         dir = dirs[which];
- 
--- 
-2.6.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-sato/puzzles/puzzles_git.bb b/import-layers/yocto-poky/meta/recipes-sato/puzzles/puzzles_git.bb
index 20b9889..a25c007 100644
--- a/import-layers/yocto-poky/meta/recipes-sato/puzzles/puzzles_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-sato/puzzles/puzzles_git.bb
@@ -12,10 +12,10 @@
 SRC_URI = "git://git.tartarus.org/simon/puzzles.git \
            file://fix-compiling-failure-with-option-g-O.patch \
            file://0001-Use-labs-instead-of-abs.patch \
-           file://0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch \
            file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
+           file://0001-Clarify-conditions-to-avoid-compiler-errors.patch \
 "
-SRCREV = "346584bf6e38232be8773c24fd7dedcbd7b3d9ed"
+SRCREV = "8dfe5cec31e784e4ece2955ecc8cc35ee7e8fbb3"
 PE = "1"
 PV = "0.0+git${SRCPV}"
 
diff --git a/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb b/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb
deleted file mode 100644
index 3480ec7..0000000
--- a/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-require rxvt-unicode.inc
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://src/main.C;beginline=1;endline=31;md5=775485398a09fa7aee6f90464af88432"
-
-SRC_URI[md5sum] = "4a5b823f08d21036f94a6c51e94d025b"
-SRC_URI[sha256sum] = "e73e13fe64b59fd3c8e6e20c00f149d388741f141b8155e4700d3ed40aa94b4e"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb b/import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb
index ebdd6d1..28d5096 100644
--- a/import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb
+++ b/import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb
@@ -1,7 +1,6 @@
 SUMMARY = "Provides an icon to shut down the system cleanly"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 SRC_URI = "file://shutdown.desktop"
 
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch
deleted file mode 100644
index 615fe4f..0000000
--- a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 5760d346b42807b596f479c81f7a6b42eb36065e Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 29 Aug 2016 16:38:11 +0300
-Subject: [PATCH] Fix racy parallel build of WebKit2-4.0.gir
-
-Upstream-Status: Pending
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- Source/WebKit2/PlatformGTK.cmake | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/Source/WebKit2/PlatformGTK.cmake b/Source/WebKit2/PlatformGTK.cmake
-index adaa010..f18cf8a 100644
---- a/Source/WebKit2/PlatformGTK.cmake
-+++ b/Source/WebKit2/PlatformGTK.cmake
-@@ -906,8 +906,9 @@ endif ()
- string(REGEX MATCHALL "-L[^ ]*"
-     INTROSPECTION_ADDITIONAL_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
- 
--add_custom_command(
--    OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
-+# This is a target and not a command because it's used to build another .gir
-+# and a .typelib, which would trigger two racy parallel builds when using command
-+add_custom_target(WebKit2-${WEBKITGTK_API_VERSION}-gir
-     DEPENDS WebKit2
-     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
-     COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS} LDFLAGS=
-@@ -950,7 +951,7 @@ add_custom_command(
- add_custom_command(
-     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
-     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
--    DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
-+    DEPENDS WebKit2-${WEBKITGTK_API_VERSION}-gir
-     COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS}
-         LDFLAGS="${INTROSPECTION_ADDITIONAL_LDFLAGS}"
-         ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
-@@ -1004,7 +1005,7 @@ add_custom_command(
- 
- add_custom_command(
-     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
--    DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
-+    DEPENDS WebKit2-${WEBKITGTK_API_VERSION}-gir
-     COMMAND ${INTROSPECTION_COMPILER} --includedir=${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
- )
- 
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch
deleted file mode 100644
index 586dd23..0000000
--- a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 4eeeaec775e190cf3f5885d7c6717acebd0201a8 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Thu, 11 Aug 2016 17:13:51 +0300
-Subject: [PATCH] Tweak gtkdoc settings so that gtkdoc generation works under
- OpenEmbedded build system
-
-This requires setting a few environment variables so that the transient
-binary is build and linked correctly, and disabling the tweaks to RUN
-variable from gtkdoc.py script so that our qemu wrapper is taken into use.
-
-Upstream-Status: Inappropriate [oe-specific]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- Source/PlatformGTK.cmake | 2 +-
- Tools/gtk/gtkdoc.py      | 4 ++--
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/Source/PlatformGTK.cmake b/Source/PlatformGTK.cmake
-index af4d2e3..b7b93c7 100644
---- a/Source/PlatformGTK.cmake
-+++ b/Source/PlatformGTK.cmake
-@@ -25,7 +25,7 @@ macro(ADD_GTKDOC_GENERATOR _stamp_name _extra_args)
-     add_custom_command(
-         OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}"
-         DEPENDS ${DocumentationDependencies}
--        COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
-+        COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS} LD=${CMAKE_C_COMPILER} LDFLAGS=${CMAKE_C_LINK_FLAGS} RUN=${CMAKE_BINARY_DIR}/gtkdoc-qemuwrapper GIR_EXTRA_LIBS_PATH=${CMAKE_BINARY_DIR}/lib ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
-         COMMAND touch ${_stamp_name}
-         WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
-     )
-diff --git a/Tools/gtk/gtkdoc.py b/Tools/gtk/gtkdoc.py
-index 4c8237b..c0205f0 100644
---- a/Tools/gtk/gtkdoc.py
-+++ b/Tools/gtk/gtkdoc.py
-@@ -318,9 +318,9 @@ class GTKDoc(object):
-                     additional_ldflags = '%s %s' % (additional_ldflags, arg)
-             ldflags = ' "-L%s" %s ' % (self.library_path, additional_ldflags) + ldflags
-             current_ld_library_path = env.get('LD_LIBRARY_PATH')
--            if current_ld_library_path:
-+            if current_ld_library_path and 'RUN' not in env:
-                 env['RUN'] = 'LD_LIBRARY_PATH="%s:%s" ' % (self.library_path, current_ld_library_path)
--            else:
-+            elif 'RUN' not in env:
-                 env['RUN'] = 'LD_LIBRARY_PATH="%s" ' % self.library_path
- 
-         if ldflags:
--- 
-2.8.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
deleted file mode 100644
index 25b3c9f..0000000
--- a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
+++ /dev/null
@@ -1,223 +0,0 @@
-From 53a00058184cd710c6f4375f4daab49d7e885a30 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 17 Apr 2016 12:35:41 -0700
-Subject: [PATCH] WebKitMacros: Append to -I and not to -isystem
-
-gcc-6 has now introduced stdlib.h in libstdc++ for better
-compliance and its including the C library stdlib.h using
-include_next which is sensitive to order of system header
-include paths. Its infact better to not tinker with the
-system header include paths at all. Since adding /usr/include
-to -system is redundant and compiler knows about it moreover
-now with gcc6 it interferes with compiler's functioning
-and ends up with compile errors e.g.
-
-/usr/include/c++/6.0.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- Source/cmake/WebKitMacros.cmake | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: webkitgtk-2.12.1/Source/JavaScriptCore/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Source/JavaScriptCore/CMakeLists.txt
-+++ webkitgtk-2.12.1/Source/JavaScriptCore/CMakeLists.txt
-@@ -1311,7 +1311,7 @@ add_subdirectory(shell)
- 
- WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
- include_directories(${JavaScriptCore_INCLUDE_DIRECTORIES})
--include_directories(SYSTEM ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
-+include_directories(${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
- add_library(JavaScriptCore ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
- target_link_libraries(JavaScriptCore ${JavaScriptCore_LIBRARIES})
- set_target_properties(JavaScriptCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_JavaScriptCore")
-Index: webkitgtk-2.12.1/Source/WTF/wtf/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Source/WTF/wtf/CMakeLists.txt
-+++ webkitgtk-2.12.1/Source/WTF/wtf/CMakeLists.txt
-@@ -286,7 +286,7 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
- 
- WEBKIT_WRAP_SOURCELIST(${WTF_SOURCES})
- include_directories(${WTF_INCLUDE_DIRECTORIES})
--include_directories(SYSTEM ${WTF_SYSTEM_INCLUDE_DIRECTORIES})
-+include_directories(${WTF_SYSTEM_INCLUDE_DIRECTORIES})
- add_library(WTF ${WTF_LIBRARY_TYPE} ${WTF_HEADERS} ${WTF_SOURCES})
- target_link_libraries(WTF ${WTF_LIBRARIES})
- set_target_properties(WTF PROPERTIES COMPILE_DEFINITIONS "BUILDING_WTF")
-Index: webkitgtk-2.12.1/Source/WebCore/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Source/WebCore/CMakeLists.txt
-+++ webkitgtk-2.12.1/Source/WebCore/CMakeLists.txt
-@@ -3748,7 +3748,7 @@ WEBKIT_WRAP_SOURCELIST(${WebCore_IDL_FIL
- WEBKIT_WRAP_SOURCELIST(${WebCoreTestSupport_IDL_FILES} ${WebCoreTestSupport_SOURCES})
- 
- include_directories(${WebCore_INCLUDE_DIRECTORIES} ${WebCoreTestSupport_INCLUDE_DIRECTORIES})
--include_directories(SYSTEM ${WebCore_SYSTEM_INCLUDE_DIRECTORIES})
-+include_directories(${WebCore_SYSTEM_INCLUDE_DIRECTORIES})
- 
- if (MSVC)
-     ADD_PRECOMPILED_HEADER("WebCorePrefix.h" "WebCorePrefix.cpp" WebCore_SOURCES)
-Index: webkitgtk-2.12.1/Source/WebKit/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Source/WebKit/CMakeLists.txt
-+++ webkitgtk-2.12.1/Source/WebKit/CMakeLists.txt
-@@ -28,7 +28,7 @@ set(WebKit_LIBRARIES
- WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
- 
- include_directories(${WebKit_INCLUDE_DIRECTORIES})
--include_directories(SYSTEM ${WebKit_SYSTEM_INCLUDE_DIRECTORIES})
-+include_directories(${WebKit_SYSTEM_INCLUDE_DIRECTORIES})
- 
- if (MSVC)
-     ADD_PRECOMPILED_HEADER("WebKitPrefix.h" "win/WebKitPrefix.cpp" WebKit_SOURCES)
-Index: webkitgtk-2.12.1/Source/WebKit2/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Source/WebKit2/CMakeLists.txt
-+++ webkitgtk-2.12.1/Source/WebKit2/CMakeLists.txt
-@@ -756,7 +756,7 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
- GENERATE_WEBKIT2_MESSAGE_SOURCES(WebKit2_DERIVED_SOURCES "${WebKit2_MESSAGES_IN_FILES}")
- 
- include_directories(${WebKit2_INCLUDE_DIRECTORIES})
--include_directories(SYSTEM ${WebKit2_SYSTEM_INCLUDE_DIRECTORIES})
-+include_directories(${WebKit2_SYSTEM_INCLUDE_DIRECTORIES})
- add_library(WebKit2 ${WebKit2_LIBRARY_TYPE} ${WebKit2_SOURCES} ${WebKit2_DERIVED_SOURCES})
- 
- add_dependencies(WebKit2 WebCore ${WEBKIT2_EXTRA_DEPENDENCIES})
-Index: webkitgtk-2.12.1/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt
-+++ webkitgtk-2.12.1/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt
-@@ -42,7 +42,7 @@ set(WebKitTestNetscapePlugin_SYSTEM_INCL
- )
- 
- include_directories(${WebKitTestNetscapePlugin_INCLUDE_DIRECTORIES})
--include_directories(SYSTEM ${WebKitTestNetscapePlugin_SYSTEM_INCLUDE_DIRECTORIES})
-+include_directories(${WebKitTestNetscapePlugin_SYSTEM_INCLUDE_DIRECTORIES})
- 
- set(WebKitTestNetscapePlugin_LIBRARIES
-     ${X11_LIBRARIES}
-Index: webkitgtk-2.12.1/Tools/ImageDiff/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Tools/ImageDiff/CMakeLists.txt
-+++ webkitgtk-2.12.1/Tools/ImageDiff/CMakeLists.txt
-@@ -14,7 +14,7 @@ set(IMAGE_DIFF_LIBRARIES
- WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
- 
- include_directories(${IMAGE_DIFF_INCLUDE_DIRECTORIES})
--include_directories(SYSTEM ${IMAGE_DIFF_SYSTEM_INCLUDE_DIRECTORIES})
-+include_directories(${IMAGE_DIFF_SYSTEM_INCLUDE_DIRECTORIES})
- add_executable(ImageDiff ${IMAGE_DIFF_SOURCES})
- target_link_libraries(ImageDiff ${IMAGE_DIFF_LIBRARIES})
- set_target_properties(ImageDiff PROPERTIES FOLDER "Tools")
-Index: webkitgtk-2.12.1/Tools/MiniBrowser/gtk/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Tools/MiniBrowser/gtk/CMakeLists.txt
-+++ webkitgtk-2.12.1/Tools/MiniBrowser/gtk/CMakeLists.txt
-@@ -55,7 +55,7 @@ endif ()
- add_definitions(-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_6)
- 
- include_directories(${MiniBrowser_INCLUDE_DIRECTORIES})
--include_directories(SYSTEM ${MiniBrowser_SYSTEM_INCLUDE_DIRECTORIES})
-+include_directories(${MiniBrowser_SYSTEM_INCLUDE_DIRECTORIES})
- add_executable(MiniBrowser ${MiniBrowser_SOURCES})
- target_link_libraries(MiniBrowser ${MiniBrowser_LIBRARIES})
- set_target_properties(MiniBrowser PROPERTIES FOLDER "Tools")
-Index: webkitgtk-2.12.1/Tools/WebKitTestRunner/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Tools/WebKitTestRunner/CMakeLists.txt
-+++ webkitgtk-2.12.1/Tools/WebKitTestRunner/CMakeLists.txt
-@@ -115,7 +115,7 @@ GENERATE_BINDINGS(WebKitTestRunner_SOURC
- WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
- 
- include_directories(${WebKitTestRunner_INCLUDE_DIRECTORIES})
--include_directories(SYSTEM ${WebKitTestRunner_SYSTEM_INCLUDE_DIRECTORIES})
-+include_directories(${WebKitTestRunner_SYSTEM_INCLUDE_DIRECTORIES})
- 
- add_library(TestRunnerInjectedBundle SHARED ${WebKitTestRunnerInjectedBundle_SOURCES})
- target_link_libraries(TestRunnerInjectedBundle ${WebKitTestRunner_LIBRARIES})
-Index: webkitgtk-2.12.1/Source/WebCore/PlatformGTK.cmake
-===================================================================
---- webkitgtk-2.12.1.orig/Source/WebCore/PlatformGTK.cmake
-+++ webkitgtk-2.12.1/Source/WebCore/PlatformGTK.cmake
-@@ -324,7 +324,7 @@ if (ENABLE_PLUGIN_PROCESS_GTK2)
-         ${GTK2_INCLUDE_DIRS}
-         ${GDK2_INCLUDE_DIRS}
-     )
--    target_include_directories(WebCorePlatformGTK2 SYSTEM PRIVATE
-+    target_include_directories(WebCorePlatformGTK2 PRIVATE
-         ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
-     )
-     target_link_libraries(WebCorePlatformGTK2
-@@ -366,7 +366,7 @@ WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCoreP
- target_include_directories(WebCorePlatformGTK PRIVATE
-     ${WebCore_INCLUDE_DIRECTORIES}
- )
--target_include_directories(WebCorePlatformGTK SYSTEM PRIVATE
-+target_include_directories(WebCorePlatformGTK PRIVATE
-     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
-     ${GTK_INCLUDE_DIRS}
-     ${GDK_INCLUDE_DIRS}
-@@ -384,7 +384,7 @@ include_directories(
-     "${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}"
- )
- 
--include_directories(SYSTEM
-+include_directories(
-     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
- )
- 
-Index: webkitgtk-2.12.1/Tools/TestWebKitAPI/PlatformGTK.cmake
-===================================================================
---- webkitgtk-2.12.1.orig/Tools/TestWebKitAPI/PlatformGTK.cmake
-+++ webkitgtk-2.12.1/Tools/TestWebKitAPI/PlatformGTK.cmake
-@@ -20,7 +20,7 @@ include_directories(
-     ${WEBKIT2_DIR}/UIProcess/API/gtk
- )
- 
--include_directories(SYSTEM
-+include_directories(
-     ${GDK3_INCLUDE_DIRS}
-     ${GLIB_INCLUDE_DIRS}
-     ${GTK3_INCLUDE_DIRS}
-Index: webkitgtk-2.12.1/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt
-+++ webkitgtk-2.12.1/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt
-@@ -23,7 +23,7 @@ include_directories(
-     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk
- )
- 
--include_directories(SYSTEM
-+include_directories(
-     ${ATSPI_INCLUDE_DIRS}
-     ${GLIB_INCLUDE_DIRS}
-     ${GSTREAMER_INCLUDE_DIRS}
-Index: webkitgtk-2.12.1/Source/WebKit2/PlatformGTK.cmake
-===================================================================
---- webkitgtk-2.12.1.orig/Source/WebKit2/PlatformGTK.cmake
-+++ webkitgtk-2.12.1/Source/WebKit2/PlatformGTK.cmake
-@@ -816,7 +816,7 @@ if (ENABLE_PLUGIN_PROCESS_GTK2)
-     target_include_directories(WebKitPluginProcess2 PRIVATE
-         ${WebKit2CommonIncludeDirectories}
-     )
--    target_include_directories(WebKitPluginProcess2 SYSTEM PRIVATE
-+    target_include_directories(WebKitPluginProcess2 PRIVATE
-          ${WebKit2CommonSystemIncludeDirectories}
-          ${GTK2_INCLUDE_DIRS}
-          ${GDK2_INCLUDE_DIRS}
-Index: webkitgtk-2.12.1/Source/JavaScriptCore/shell/CMakeLists.txt
-===================================================================
---- webkitgtk-2.12.1.orig/Source/JavaScriptCore/shell/CMakeLists.txt
-+++ webkitgtk-2.12.1/Source/JavaScriptCore/shell/CMakeLists.txt
-@@ -20,7 +20,7 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
- 
- WEBKIT_WRAP_SOURCELIST(${JSC_SOURCES})
- include_directories(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
--include_directories(SYSTEM ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
-+include_directories(${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
- add_executable(jsc ${JSC_SOURCES})
- target_link_libraries(jsc ${JSC_LIBRARIES})
- set_target_properties(jsc PROPERTIES FOLDER "JavaScriptCore")
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch
deleted file mode 100644
index 3f71297..0000000
--- a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From bae9f73b2c693b5aa156fed717d6481b60682786 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Wed, 28 Oct 2015 14:18:57 +0200
-Subject: [PATCH] When building introspection files, add CMAKE_C_FLAGS to the
- compiler flags.
-
-g-ir-compiler is using a C compiler internally, so it needs to set
-the proper flags for it.
-
-Upstream-Status: Pending [review on oe-core list]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- Source/WebKit2/PlatformGTK.cmake | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-Index: webkitgtk-2.12.1/Source/WebKit2/PlatformGTK.cmake
-===================================================================
---- webkitgtk-2.12.1.orig/Source/WebKit2/PlatformGTK.cmake
-+++ webkitgtk-2.12.1/Source/WebKit2/PlatformGTK.cmake
-@@ -910,7 +910,7 @@ add_custom_command(
-     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
-     DEPENDS WebKit2
-     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
--    COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations LDFLAGS=
-+    COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS} LDFLAGS=
-         ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
-         ${INTROSPECTION_SCANNER}
-         --quiet
-@@ -951,7 +951,7 @@ add_custom_command(
-     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
-     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
-     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
--    COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations
-+    COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS}
-         LDFLAGS="${INTROSPECTION_ADDITIONAL_LDFLAGS}"
-         ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
-         ${INTROSPECTION_SCANNER}
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/musl-fixes.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/musl-fixes.patch
deleted file mode 100644
index 4fdd56f..0000000
--- a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/musl-fixes.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-Replace __GLIBC__ with __linux__ since musl also supports it
-so checking __linux__ is more accomodating
-
-See http://git.alpinelinux.org/cgit/aports/tree/community/webkit2gtk/musl-fixes.patch?id=219435d86d7e8fac9474344a7431c62bd2525184
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Index: webkitgtk-2.12.1/Source/JavaScriptCore/heap/MachineStackMarker.cpp
-===================================================================
---- webkitgtk-2.12.1.orig/Source/JavaScriptCore/heap/MachineStackMarker.cpp
-+++ webkitgtk-2.12.1/Source/JavaScriptCore/heap/MachineStackMarker.cpp
-@@ -566,7 +566,7 @@ void* MachineThreads::Thread::Registers:
- #error Unknown Architecture
- #endif
- 
--#elif defined(__GLIBC__) && ENABLE(JIT)
-+#elif defined(__linux__) && ENABLE(JIT)
- 
- #if CPU(X86)
-     return reinterpret_cast<void*>((uintptr_t) regs.machineContext.gregs[REG_ESP]);
-@@ -665,7 +665,7 @@ void* MachineThreads::Thread::Registers:
- #error Unknown Architecture
- #endif
- 
--#elif defined(__GLIBC__)
-+#elif defined(__linux__) // glibc and musl
- 
- // The following sequence depends on glibc's sys/ucontext.h.
- #if CPU(X86)
-@@ -747,7 +747,7 @@ void* MachineThreads::Thread::Registers:
- #error Unknown Architecture
- #endif
- 
--#elif defined(__GLIBC__)
-+#elif defined(__linux__) // glibc and musl
- 
- // The following sequence depends on glibc's sys/ucontext.h.
- #if CPU(X86)
-@@ -838,7 +838,7 @@ void* MachineThreads::Thread::Registers:
- #error Unknown Architecture
- #endif
- 
--#elif defined(__GLIBC__)
-+#elif defined(__linux__) // glibc and musl
- 
- // The following sequence depends on glibc's sys/ucontext.h.
- #if CPU(X86)
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/ppc-musl-fix.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/ppc-musl-fix.patch
deleted file mode 100644
index 5f58e49..0000000
--- a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/ppc-musl-fix.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-ucontext structure is different between musl and glibc for ppc
-therefore its not enough just to check for arch alone, we also
-need to check for libc type.
-
-Fixes errors like
-
-Source/JavaScriptCore/heap/MachineStackMarker.cpp:90:65: error: 'struct mcontext_t' has no member named 'uc_regs'; did you mean 'gregs'?
-     thread->suspendedMachineContext = *userContext->uc_mcontext.uc_regs;
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Index: webkitgtk-2.12.3/Source/JavaScriptCore/heap/MachineStackMarker.cpp
-===================================================================
---- webkitgtk-2.12.3.orig/Source/JavaScriptCore/heap/MachineStackMarker.cpp
-+++ webkitgtk-2.12.3/Source/JavaScriptCore/heap/MachineStackMarker.cpp
-@@ -86,7 +86,7 @@ static void pthreadSignalHandlerSuspendR
-     }
- 
-     ucontext_t* userContext = static_cast<ucontext_t*>(ucontext);
--#if CPU(PPC)
-+#if CPU(PPC) && defined(__GLIBC__)
-     thread->suspendedMachineContext = *userContext->uc_mcontext.uc_regs;
- #else
-     thread->suspendedMachineContext = userContext->uc_mcontext;
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch
rename to import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch
new file mode 100644
index 0000000..7cc4514
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch
@@ -0,0 +1,77 @@
+From 415e31bd5444fa360af58b069f1b9db6607fca7d Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 6 Oct 2017 17:00:08 +0300
+Subject: [PATCH] Fix build with musl
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Source/JavaScriptCore/runtime/MachineContext.h | 10 +++++-----
+ Source/WTF/wtf/Platform.h                      |  2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Source/JavaScriptCore/runtime/MachineContext.h b/Source/JavaScriptCore/runtime/MachineContext.h
+index 95080b9..2bb689c 100644
+--- a/Source/JavaScriptCore/runtime/MachineContext.h
++++ b/Source/JavaScriptCore/runtime/MachineContext.h
+@@ -146,7 +146,7 @@ inline void*& stackPointer(mcontext_t& machineContext)
+ #error Unknown Architecture
+ #endif
+ 
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+ 
+ #if CPU(X86)
+     return reinterpret_cast<void*&>((uintptr_t&) machineContext.gregs[REG_ESP]);
+@@ -251,7 +251,7 @@ inline void*& framePointer(mcontext_t& machineContext)
+ #error Unknown Architecture
+ #endif
+ 
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+ 
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+@@ -354,7 +354,7 @@ inline void*& instructionPointer(mcontext_t& machineContext)
+ #error Unknown Architecture
+ #endif
+ 
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+ 
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+@@ -466,7 +466,7 @@ inline void*& argumentPointer<1>(mcontext_t& machineContext)
+ #error Unknown Architecture
+ #endif
+ 
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+ 
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+@@ -583,7 +583,7 @@ inline void*& llintInstructionPointer(mcontext_t& machineContext)
+ #error Unknown Architecture
+ #endif
+ 
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+ 
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
+index 5a2863b..b36c3ff 100644
+--- a/Source/WTF/wtf/Platform.h
++++ b/Source/WTF/wtf/Platform.h
+@@ -680,7 +680,7 @@
+ #define HAVE_CFNETWORK_STORAGE_PARTITIONING 1
+ #endif
+ 
+-#if OS(DARWIN) || ((OS(FREEBSD) || defined(__GLIBC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
++#if OS(DARWIN) || ((OS(FREEBSD) || defined(__linux__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
+ #define HAVE_MACHINE_CONTEXT 1
+ #endif
+ 
+-- 
+2.14.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch
new file mode 100644
index 0000000..896890b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch
@@ -0,0 +1,49 @@
+From b7f40eceef0f23bf88090789d4c5845c35f048ae Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 29 Aug 2016 16:38:11 +0300
+Subject: [PATCH 4/9] Fix racy parallel build of WebKit2-4.0.gir
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ Source/WebKit/PlatformGTK.cmake | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake
+index a33c6a86..d83a2e77 100644
+--- a/Source/WebKit/PlatformGTK.cmake
++++ b/Source/WebKit/PlatformGTK.cmake
+@@ -1122,8 +1122,9 @@ endif ()
+ string(REGEX MATCHALL "-L[^ ]*"
+     INTROSPECTION_ADDITIONAL_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
+ 
+-add_custom_command(
+-    OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
++# This is a target and not a command because it's used to build another .gir
++# and a .typelib, which would trigger two racy parallel builds when using command
++add_custom_target(WebKit2-${WEBKITGTK_API_VERSION}-gir
+     DEPENDS WebKit2
+     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+     COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS} LDFLAGS=
+@@ -1168,7 +1169,7 @@ add_custom_command(
+ add_custom_command(
+     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
+     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+-    DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
++    DEPENDS WebKit2-${WEBKITGTK_API_VERSION}-gir
+     COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS}
+         LDFLAGS="${INTROSPECTION_ADDITIONAL_LDFLAGS}"
+         ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
+@@ -1225,7 +1226,7 @@ add_custom_command(
+ 
+ add_custom_command(
+     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
+-    DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
++    DEPENDS WebKit2-${WEBKITGTK_API_VERSION}-gir
+     COMMAND ${INTROSPECTION_COMPILER} --includedir=${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
+ )
+ 
+-- 
+2.14.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch
rename to import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch
new file mode 100644
index 0000000..83fd512
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch
@@ -0,0 +1,50 @@
+From 9b09974003097c9a408bbeea568996768efe705b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 11 Aug 2016 17:13:51 +0300
+Subject: [PATCH 05/10] Tweak gtkdoc settings so that gtkdoc generation works
+ under OpenEmbedded build system
+
+This requires setting a few environment variables so that the transient
+binary is build and linked correctly, and disabling the tweaks to RUN
+variable from gtkdoc.py script so that our qemu wrapper is taken into use.
+
+Upstream-Status: Inappropriate [oe-specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ Source/PlatformGTK.cmake | 2 +-
+ Tools/gtk/gtkdoc.py      | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Source/PlatformGTK.cmake b/Source/PlatformGTK.cmake
+index 50b5393..7a31db5 100644
+--- a/Source/PlatformGTK.cmake
++++ b/Source/PlatformGTK.cmake
+@@ -24,7 +24,7 @@ macro(ADD_GTKDOC_GENERATOR _stamp_name _extra_args)
+     add_custom_command(
+         OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}"
+         DEPENDS ${DocumentationDependencies}
+-        COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} -Wno-unused-parameter" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
++        COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} -Wno-unused-parameter" "LD=${CMAKE_C_COMPILER}" "LDFLAGS=${CMAKE_C_LINK_FLAGS}" "RUN=${CMAKE_BINARY_DIR}/gtkdoc-qemuwrapper" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc -v ${_extra_args}
+         COMMAND touch ${_stamp_name}
+         WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+         VERBATIM
+diff --git a/Tools/gtk/gtkdoc.py b/Tools/gtk/gtkdoc.py
+index 03c8e8e..34fbaff 100644
+--- a/Tools/gtk/gtkdoc.py
++++ b/Tools/gtk/gtkdoc.py
+@@ -318,9 +318,9 @@ class GTKDoc(object):
+                     additional_ldflags = '%s %s' % (additional_ldflags, arg)
+             ldflags = ' "-L%s" %s ' % (self.library_path, additional_ldflags) + ldflags
+             current_ld_library_path = env.get('LD_LIBRARY_PATH')
+-            if current_ld_library_path:
++            if current_ld_library_path and 'RUN' not in env:
+                 env['LD_LIBRARY_PATH'] = '%s:%s' % (self.library_path, current_ld_library_path)
+-            else:
++            elif 'RUN' not in env:
+                 env['LD_LIBRARY_PATH'] = self.library_path
+ 
+         if ldflags:
+-- 
+2.15.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
new file mode 100644
index 0000000..dfdc116
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
@@ -0,0 +1,126 @@
+From ef832a115b40861c08df333339b1366da49e5393 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 17 Apr 2016 12:35:41 -0700
+Subject: [PATCH 9/9] WebKitMacros: Append to -I and not to -isystem
+
+gcc-6 has now introduced stdlib.h in libstdc++ for better
+compliance and its including the C library stdlib.h using
+include_next which is sensitive to order of system header
+include paths. Its infact better to not tinker with the
+system header include paths at all. Since adding /usr/include
+to -system is redundant and compiler knows about it moreover
+now with gcc6 it interferes with compiler's functioning
+and ends up with compile errors e.g.
+
+/usr/include/c++/6.0.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ Source/JavaScriptCore/shell/CMakeLists.txt | 2 +-
+ Source/WebCore/PlatformGTK.cmake           | 6 +++---
+ Source/WebKit/PlatformGTK.cmake            | 2 +-
+ Source/cmake/WebKitMacros.cmake            | 2 +-
+ Tools/MiniBrowser/gtk/CMakeLists.txt       | 2 +-
+ Tools/TestWebKitAPI/PlatformGTK.cmake      | 2 +-
+ 6 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt
+index bc37dd31..4e49871f 100644
+--- a/Source/JavaScriptCore/shell/CMakeLists.txt
++++ b/Source/JavaScriptCore/shell/CMakeLists.txt
+@@ -35,7 +35,7 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
+ WEBKIT_WRAP_SOURCELIST(${JSC_SOURCES})
+ WEBKIT_WRAP_SOURCELIST(${TESTAPI_SOURCES})
+ include_directories(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
+-include_directories(SYSTEM ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
++include_directories(${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
+ add_executable(jsc ${JSC_SOURCES})
+ target_link_libraries(jsc ${JSC_LIBRARIES})
+ 
+diff --git a/Source/WebCore/PlatformGTK.cmake b/Source/WebCore/PlatformGTK.cmake
+index 73506c74..8eb8b415 100644
+--- a/Source/WebCore/PlatformGTK.cmake
++++ b/Source/WebCore/PlatformGTK.cmake
+@@ -281,7 +281,7 @@ if (ENABLE_PLUGIN_PROCESS_GTK2)
+         ${GTK2_INCLUDE_DIRS}
+         ${GDK2_INCLUDE_DIRS}
+     )
+-    target_include_directories(WebCorePlatformGTK2 SYSTEM PRIVATE
++    target_include_directories(WebCorePlatformGTK2 PRIVATE
+         ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
+     )
+     target_link_libraries(WebCorePlatformGTK2
+@@ -305,7 +305,7 @@ add_dependencies(WebCorePlatformGTK WebCore)
+ target_include_directories(WebCorePlatformGTK PRIVATE
+     ${WebCore_INCLUDE_DIRECTORIES}
+ )
+-target_include_directories(WebCorePlatformGTK SYSTEM PRIVATE
++target_include_directories(WebCorePlatformGTK PRIVATE
+     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
+     ${GTK_INCLUDE_DIRS}
+     ${GDK_INCLUDE_DIRS}
+@@ -321,7 +321,7 @@ include_directories(
+     "${WEBCORE_DIR}/bindings/gobject/"
+ )
+ 
+-include_directories(SYSTEM
++include_directories(
+     ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
+ )
+ 
+diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake
+index d83a2e77..401246f4 100644
+--- a/Source/WebKit/PlatformGTK.cmake
++++ b/Source/WebKit/PlatformGTK.cmake
+@@ -1050,7 +1050,7 @@ if (ENABLE_PLUGIN_PROCESS_GTK2)
+     target_include_directories(WebKitPluginProcess2 PRIVATE
+         ${WebKit2CommonIncludeDirectories}
+     )
+-    target_include_directories(WebKitPluginProcess2 SYSTEM PRIVATE
++    target_include_directories(WebKitPluginProcess2 PRIVATE
+          ${WebKit2CommonSystemIncludeDirectories}
+          ${GTK2_INCLUDE_DIRS}
+          ${GDK2_INCLUDE_DIRS}
+diff --git a/Source/cmake/WebKitMacros.cmake b/Source/cmake/WebKitMacros.cmake
+index 7bc89543..d9818fa4 100644
+--- a/Source/cmake/WebKitMacros.cmake
++++ b/Source/cmake/WebKitMacros.cmake
+@@ -78,7 +78,7 @@ macro(WEBKIT_FRAMEWORK_DECLARE _target)
+ endmacro()
+ 
+ macro(WEBKIT_FRAMEWORK _target)
+-    include_directories(SYSTEM ${${_target}_SYSTEM_INCLUDE_DIRECTORIES})
++    include_directories(${${_target}_SYSTEM_INCLUDE_DIRECTORIES})
+     target_sources(${_target} PRIVATE
+         ${${_target}_HEADERS}
+         ${${_target}_SOURCES}
+diff --git a/Tools/MiniBrowser/gtk/CMakeLists.txt b/Tools/MiniBrowser/gtk/CMakeLists.txt
+index e832a86d..ce92c864 100644
+--- a/Tools/MiniBrowser/gtk/CMakeLists.txt
++++ b/Tools/MiniBrowser/gtk/CMakeLists.txt
+@@ -57,7 +57,7 @@ endif ()
+ add_definitions(-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_6)
+ 
+ include_directories(${MiniBrowser_INCLUDE_DIRECTORIES})
+-include_directories(SYSTEM ${MiniBrowser_SYSTEM_INCLUDE_DIRECTORIES})
++include_directories(${MiniBrowser_SYSTEM_INCLUDE_DIRECTORIES})
+ add_executable(MiniBrowser ${MiniBrowser_SOURCES})
+ target_link_libraries(MiniBrowser ${MiniBrowser_LIBRARIES})
+ 
+diff --git a/Tools/TestWebKitAPI/PlatformGTK.cmake b/Tools/TestWebKitAPI/PlatformGTK.cmake
+index 1be3dd52..7bdddf37 100644
+--- a/Tools/TestWebKitAPI/PlatformGTK.cmake
++++ b/Tools/TestWebKitAPI/PlatformGTK.cmake
+@@ -20,7 +20,7 @@ include_directories(
+     ${WEBKIT2_DIR}/UIProcess/API/gtk
+ )
+ 
+-include_directories(SYSTEM
++include_directories(
+     ${GDK3_INCLUDE_DIRS}
+     ${GLIB_INCLUDE_DIRS}
+     ${GTK3_INCLUDE_DIRS}
+-- 
+2.14.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch
new file mode 100644
index 0000000..fb4c4dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch
@@ -0,0 +1,41 @@
+From 98b1359a0cd87bbdb22cef98ba594440f4c57d92 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 28 Oct 2015 14:18:57 +0200
+Subject: [PATCH 2/9] When building introspection files, add CMAKE_C_FLAGS to
+ the compiler flags.
+
+g-ir-compiler is using a C compiler internally, so it needs to set
+the proper flags for it.
+
+Upstream-Status: Pending [review on oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ Source/WebKit/PlatformGTK.cmake | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake
+index 7f92ae72..a33c6a86 100644
+--- a/Source/WebKit/PlatformGTK.cmake
++++ b/Source/WebKit/PlatformGTK.cmake
+@@ -1126,7 +1126,7 @@ add_custom_command(
+     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
+     DEPENDS WebKit2
+     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+-    COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations LDFLAGS=
++    COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS} LDFLAGS=
+         ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
+         ${INTROSPECTION_SCANNER}
+         --quiet
+@@ -1169,7 +1169,7 @@ add_custom_command(
+     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
+     DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+     DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
+-    COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations
++    COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS}
+         LDFLAGS="${INTROSPECTION_ADDITIONAL_LDFLAGS}"
+         ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
+         ${INTROSPECTION_SCANNER}
+-- 
+2.14.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/cross-compile.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/cross-compile.patch
new file mode 100644
index 0000000..4d1de72
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/cross-compile.patch
@@ -0,0 +1,23 @@
+Disable the tests meant to run when compiling natively
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: webkitgtk-2.14.5/Source/cmake/OptionsCommon.cmake
+===================================================================
+--- webkitgtk-2.14.5.orig/Source/cmake/OptionsCommon.cmake
++++ webkitgtk-2.14.5/Source/cmake/OptionsCommon.cmake
+@@ -67,8 +67,11 @@ endif ()
+ # Detect Cortex-A53 core if CPU is ARM64 and OS is Linux.
+ # Query /proc/cpuinfo for each available core and check reported CPU part number: 0xd03 signals Cortex-A53.
+ # (see Main ID Register in ARM Cortex-A53 MPCore Processor Technical Reference Manual)
+-set(WTF_CPU_ARM64_CORTEXA53_INITIALVALUE OFF)
+-if (WTF_CPU_ARM64 AND (${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
++if( NOT WTF_CPU_ARM64_CORTEXA53_INITIALVALUE)
++    set(WTF_CPU_ARM64_CORTEXA53_INITIALVALUE OFF)
++endif(WTF_CPU_ARM64_CORTEXA53_INITIALVALUE)
++
++if (WTF_CPU_ARM64 AND NOT CMAKE_CROSSCOMPILING AND (${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
+     execute_process(COMMAND nproc OUTPUT_VARIABLE PROC_COUNT)
+     math(EXPR PROC_MAX ${PROC_COUNT}-1)
+     foreach (PROC_ID RANGE ${PROC_MAX})
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/detect-atomics-during-configure.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/detect-atomics-during-configure.patch
new file mode 100644
index 0000000..c6157e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/detect-atomics-during-configure.patch
@@ -0,0 +1,46 @@
+From 0b3811771ae6385503f2d949f9433d8f810d2ff9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 17 May 2017 22:34:24 -0700
+Subject: [PATCH 8/9] webkitgtk: Fix build for armv5
+
+Taken from
+https://bugs.webkit.org/show_bug.cgi?id=161900
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ Source/WTF/wtf/CMakeLists.txt | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/Source/WTF/wtf/CMakeLists.txt b/Source/WTF/wtf/CMakeLists.txt
+index 6b5e45b9..46ee3c22 100644
+--- a/Source/WTF/wtf/CMakeLists.txt
++++ b/Source/WTF/wtf/CMakeLists.txt
+@@ -205,7 +205,6 @@ set(WTF_HEADERS
+ 
+ set(WTF_SOURCES
+     Assertions.cpp
+-    Atomics.cpp
+     AutomaticThread.cpp
+     BitVector.cpp
+     CPUTime.cpp
+@@ -336,6 +335,15 @@ if (NOT USE_SYSTEM_MALLOC)
+     list(APPEND WTF_LIBRARIES bmalloc)
+ endif ()
+ 
++file(WRITE ${CMAKE_BINARY_DIR}/test_atomics.cpp
++     "int main(void)\n"
++     "{ long long x = 1; return (int) __sync_add_and_fetch_8(&x, 1); }\n")
++try_compile(ATOMICS_BUILD_SUCCEEDED ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/test_atomics.cpp)
++if (NOT ATOMICS_BUILD_SUCCEEDED)
++    list(APPEND WTF_SOURCES Atomics.cpp)
++endif ()
++file(REMOVE ${CMAKE_BINARY_DIR}/test_atomics.cpp)
++
+ list(APPEND WTF_SOURCES
+     unicode/icu/CollatorICU.cpp
+ )
+-- 
+2.14.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/x32_support.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/x32_support.patch
new file mode 100644
index 0000000..5f23837
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/x32_support.patch
@@ -0,0 +1,21 @@
+From: Daniel Schepler <dschepler@gmail.com>
+Subject: Fix FTBFS in x32
+Bug-Debian: https://bugs.debian.org/700795
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Index: webkitgtk-2.16.1/Source/WTF/wtf/Platform.h
+===================================================================
+--- webkitgtk-2.16.1.orig/Source/WTF/wtf/Platform.h
++++ webkitgtk-2.16.1/Source/WTF/wtf/Platform.h
+@@ -172,7 +172,11 @@
+ /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */
+ #if   defined(__x86_64__) \
+     || defined(_M_X64)
++#ifdef __ILP32__
++#define WTF_CPU_X86_64_32 1
++#else
+ #define WTF_CPU_X86_64 1
++#endif
+ #define WTF_CPU_X86_SSE2 1
+ #endif
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk_2.12.5.bb b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk_2.12.5.bb
deleted file mode 100644
index 11c91c1..0000000
--- a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk_2.12.5.bb
+++ /dev/null
@@ -1,108 +0,0 @@
-SUMMARY = "WebKit web rendering engine for the GTK+ platform"
-HOMEPAGE = "http://www.webkitgtk.org/"
-BUGTRACKER = "http://bugs.webkit.org/"
-
-LICENSE = "BSD & LGPLv2+"
-LIC_FILES_CHKSUM = "file://Source/JavaScriptCore/COPYING.LIB;md5=d0c6d6397a5d84286dda758da57bd691 \
-                    file://Source/WebKit/LICENSE;md5=4646f90082c40bcf298c285f8bab0b12 \
-                    file://Source/WebCore/LICENSE-APPLE;md5=4646f90082c40bcf298c285f8bab0b12 \
-		    file://Source/WebCore/LICENSE-LGPL-2;md5=36357ffde2b64ae177b2494445b79d21 \
-		    file://Source/WebCore/LICENSE-LGPL-2.1;md5=a778a33ef338abbaf8b8a7c36b6eec80 \
-		   "
-
-SRC_URI = "\
-  http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
-  file://0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch \
-  file://0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch \
-  file://0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch \
-  file://0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch \
-  file://musl-fixes.patch \
-  file://ppc-musl-fix.patch \
-  file://0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch \
-  file://0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch \
-  "
-SRC_URI[md5sum] = "7a9ea00ec195488db90fdeb2d174ddaf"
-SRC_URI[sha256sum] = "6b147854b864a5f115fadb97b2b6200b2f696db015216a34e7298d11c88b1c40"
-
-inherit cmake pkgconfig gobject-introspection perlnative distro_features_check upstream-version-is-even gtk-doc
-
-# We cannot inherit pythonnative because that would conflict with inheriting python3native
-# (which is done by gobject-introspection). But webkit only needs the path to native Python 2.x binary
-# so we simply set it explicitly here.
-EXTRANATIVEPATH += "python-native"
-
-# depends on libxt
-REQUIRED_DISTRO_FEATURES = "x11"
-
-DEPENDS = "zlib libsoup-2.4 curl libxml2 cairo libxslt libxt libidn gnutls \
-           gtk+3 gstreamer1.0 gstreamer1.0-plugins-base flex-native gperf-native sqlite3 \
-	   pango icu bison-native gawk intltool-native libwebp \
-	   atk udev harfbuzz jpeg libpng pulseaudio librsvg libtheora libvorbis libxcomposite libxtst \
-	   ruby-native libnotify gstreamer1.0-plugins-bad \
-          "
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'wayland' ,d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl', '' ,d)} \
-                   enchant \
-                   libsecret \
-                  "
-
-PACKAGECONFIG[wayland] = "-DENABLE_WAYLAND_TARGET=ON,-DENABLE_WAYLAND_TARGET=OFF,wayland"
-PACKAGECONFIG[x11] = "-DENABLE_X11_TARGET=ON,-DENABLE_X11_TARGET=OFF,virtual/libx11"
-PACKAGECONFIG[geoclue] = "-DENABLE_GEOLOCATION=ON,-DENABLE_GEOLOCATION=OFF,geoclue"
-PACKAGECONFIG[enchant] = "-DENABLE_SPELLCHECK=ON,-DENABLE_SPELLCHECK=OFF,enchant"
-PACKAGECONFIG[gtk2] = "-DENABLE_PLUGIN_PROCESS_GTK2=ON,-DENABLE_PLUGIN_PROCESS_GTK2=OFF,gtk+"
-PACKAGECONFIG[gles2] = "-DENABLE_GLES2=ON,-DENABLE_GLES2=OFF,virtual/libgles2"
-PACKAGECONFIG[webgl] = "-DENABLE_WEBGL=ON,-DENABLE_WEBGL=OFF,virtual/libgl"
-PACKAGECONFIG[libsecret] = "-DENABLE_CREDENTIAL_STORAGE=ON,-DENABLE_CREDENTIAL_STORAGE=OFF,libsecret"
-PACKAGECONFIG[libhyphen] = "-DUSE_LIBHYPHEN=ON,-DUSE_LIBHYPHEN=OFF,libhyphen"
-
-EXTRA_OECMAKE = " \
-		-DPORT=GTK \
-		-DCMAKE_BUILD_TYPE=Release \
-		${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
-		${@bb.utils.contains('GTKDOC_ENABLED', 'True', '-DENABLE_GTKDOC=ON', '-DENABLE_GTKDOC=OFF', d)} \
-		-DENABLE_MINIBROWSER=ON \
-		"
-
-# Javascript JIT is not supported on powerpc
-EXTRA_OECMAKE_append_powerpc = " -DENABLE_JIT=OFF "
-EXTRA_OECMAKE_append_powerpc64 = " -DENABLE_JIT=OFF "
-
-# ARM JIT code does not build on ARMv4/5/6 anymore
-EXTRA_OECMAKE_append_armv5 = " -DENABLE_JIT=OFF "
-EXTRA_OECMAKE_append_armv6 = " -DENABLE_JIT=OFF "
-EXTRA_OECMAKE_append_armv4 = " -DENABLE_JIT=OFF "
-
-# binutils 2.25.1 has a bug on aarch64:
-# https://sourceware.org/bugzilla/show_bug.cgi?id=18430
-EXTRA_OECMAKE_append_aarch64 = " -DUSE_LD_GOLD=OFF "
-EXTRA_OECMAKE_append_mips = " -DUSE_LD_GOLD=OFF "
-EXTRA_OECMAKE_append_mips64 = " -DUSE_LD_GOLD=OFF "
-EXTRA_OECMAKE_append_toolchain-clang = " -DUSE_LD_GOLD=OFF "
-
-# JIT not supported on MIPS either
-EXTRA_OECMAKE_append_mips = " -DENABLE_JIT=OFF "
-EXTRA_OECMAKE_append_mips64 = " -DENABLE_JIT=OFF "
-
-SECURITY_CFLAGS_remove_aarch64 = "-fpie"
-SECURITY_CFLAGS_append_aarch64 = " -fPIE"
-
-FILES_${PN} += "${libdir}/webkit2gtk-4.0/injected-bundle/libwebkit2gtkinjectedbundle.so"
-
-# http://errors.yoctoproject.org/Errors/Details/20370/
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
-ARM_INSTRUCTION_SET_armv6 = "arm"
-
-# https://bugzilla.yoctoproject.org/show_bug.cgi?id=9474
-# https://bugs.webkit.org/show_bug.cgi?id=159880
-# JSC JIT can build on ARMv7 with -marm, but doesn't work on runtime.
-# Upstream only tests regularly the JSC JIT on ARMv7 with Thumb2 (-mthumb).
-ARM_INSTRUCTION_SET_armv7a = "thumb"
-ARM_INSTRUCTION_SET_armv7r = "thumb"
-ARM_INSTRUCTION_SET_armv7ve = "thumb"
-
-# WebKit2-4.0: ../../libgpg-error-1.21/src/posix-lock.c:119: get_lock_object: Assertion `!"sizeof lock obj"' failed.
-# qemu: uncaught target signal 6 (Aborted) - core dumped
-EXTRA_OECMAKE_append_mips64 = " -DENABLE_INTROSPECTION=OFF -DENABLE_GTKDOC=OFF"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk_2.18.5.bb b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk_2.18.5.bb
new file mode 100644
index 0000000..a64aee2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk_2.18.5.bb
@@ -0,0 +1,121 @@
+SUMMARY = "WebKit web rendering engine for the GTK+ platform"
+HOMEPAGE = "http://www.webkitgtk.org/"
+BUGTRACKER = "http://bugs.webkit.org/"
+
+LICENSE = "BSD & LGPLv2+"
+LIC_FILES_CHKSUM = "file://Source/JavaScriptCore/COPYING.LIB;md5=d0c6d6397a5d84286dda758da57bd691 \
+                    file://Source/WebCore/LICENSE-APPLE;md5=4646f90082c40bcf298c285f8bab0b12 \
+		    file://Source/WebCore/LICENSE-LGPL-2;md5=36357ffde2b64ae177b2494445b79d21 \
+		    file://Source/WebCore/LICENSE-LGPL-2.1;md5=a778a33ef338abbaf8b8a7c36b6eec80 \
+		   "
+
+SRC_URI = "http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
+           file://0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch \
+           file://0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch \
+           file://0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch \
+           file://0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch \
+           file://0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch \
+           file://x32_support.patch \
+           file://cross-compile.patch \
+           file://detect-atomics-during-configure.patch \
+           file://0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch \
+           file://0001-Fix-build-with-musl.patch \
+           "
+
+SRC_URI[md5sum] = "af18c2cfa00cadfd0b4d8db21cab011d"
+SRC_URI[sha256sum] = "0c6d80cc7eb5d32f8063041fa11a1a6f17a29765c2f69c6bc862cd47c2d539b8"
+
+inherit cmake pkgconfig gobject-introspection perlnative distro_features_check upstream-version-is-even gtk-doc
+
+# depends on libxt
+REQUIRED_DISTRO_FEATURES = "x11"
+
+DEPENDS = "zlib libsoup-2.4 curl libxml2 cairo libxslt libxt libidn libgcrypt \
+           gtk+3 gstreamer1.0 gstreamer1.0-plugins-base flex-native gperf-native sqlite3 \
+	   pango icu bison-native gawk intltool-native libwebp \
+	   atk udev harfbuzz jpeg libpng pulseaudio librsvg libtheora libvorbis libxcomposite libxtst \
+	   ruby-native libnotify gstreamer1.0-plugins-bad \
+	   gettext-native glib-2.0 glib-2.0-native libtasn1 \
+          "
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'wayland' ,d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl opengl', '' ,d)} \
+                   enchant \
+                   libsecret \
+                  "
+
+PACKAGECONFIG[wayland] = "-DENABLE_WAYLAND_TARGET=ON,-DENABLE_WAYLAND_TARGET=OFF,wayland"
+PACKAGECONFIG[x11] = "-DENABLE_X11_TARGET=ON,-DENABLE_X11_TARGET=OFF,virtual/libx11"
+PACKAGECONFIG[geoclue] = "-DENABLE_GEOLOCATION=ON,-DENABLE_GEOLOCATION=OFF,geoclue"
+PACKAGECONFIG[enchant] = "-DENABLE_SPELLCHECK=ON,-DENABLE_SPELLCHECK=OFF,enchant"
+PACKAGECONFIG[gtk2] = "-DENABLE_PLUGIN_PROCESS_GTK2=ON,-DENABLE_PLUGIN_PROCESS_GTK2=OFF,gtk+"
+PACKAGECONFIG[gles2] = "-DENABLE_GLES2=ON,-DENABLE_GLES2=OFF,virtual/libgles2"
+PACKAGECONFIG[webgl] = "-DENABLE_WEBGL=ON,-DENABLE_WEBGL=OFF,virtual/libgl"
+PACKAGECONFIG[opengl] = "-DENABLE_OPENGL=ON,-DENABLE_OPENGL=OFF,virtual/libgl"
+PACKAGECONFIG[libsecret] = "-DUSE_LIBSECRET=ON,-DUSE_LIBSECRET=OFF,libsecret"
+PACKAGECONFIG[libhyphen] = "-DUSE_LIBHYPHEN=ON,-DUSE_LIBHYPHEN=OFF,libhyphen"
+
+EXTRA_OECMAKE = " \
+		-DPORT=GTK \
+		-DCMAKE_BUILD_TYPE=Release \
+		${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
+		${@bb.utils.contains('GTKDOC_ENABLED', 'True', '-DENABLE_GTKDOC=ON', '-DENABLE_GTKDOC=OFF', d)} \
+		-DENABLE_MINIBROWSER=ON \
+                -DPYTHON_EXECUTABLE=`which python` \
+		"
+
+# GL/GLES header clash: both define the same thing, differently, on 32 bit x86
+EXTRA_OECMAKE_append_x86 = " -DUSE_GSTREAMER_GL=OFF "
+EXTRA_OECMAKE_append_x86-x32 = " -DUSE_GSTREAMER_GL=OFF "
+
+# Javascript JIT is not supported on powerpc
+EXTRA_OECMAKE_append_powerpc = " -DENABLE_JIT=OFF "
+EXTRA_OECMAKE_append_powerpc64 = " -DENABLE_JIT=OFF "
+
+# ARM JIT code does not build on ARMv4/5/6 anymore
+EXTRA_OECMAKE_append_armv5 = " -DENABLE_JIT=OFF "
+EXTRA_OECMAKE_append_armv6 = " -DENABLE_JIT=OFF "
+EXTRA_OECMAKE_append_armv4 = " -DENABLE_JIT=OFF "
+
+# binutils 2.25.1 has a bug on aarch64:
+# https://sourceware.org/bugzilla/show_bug.cgi?id=18430
+EXTRA_OECMAKE_append_aarch64 = " -DUSE_LD_GOLD=OFF "
+EXTRA_OECMAKE_append_mipsarch = " -DUSE_LD_GOLD=OFF "
+EXTRA_OECMAKE_append_powerpc = " -DUSE_LD_GOLD=OFF "
+EXTRA_OECMAKE_append_toolchain-clang = " -DUSE_LD_GOLD=OFF "
+
+EXTRA_OECMAKE_append_aarch64 = " -DWTF_CPU_ARM64_CORTEXA53=ON"
+
+# JIT not supported on MIPS either
+EXTRA_OECMAKE_append_mipsarch = " -DENABLE_JIT=OFF "
+
+# JIT not supported on X32
+# An attempt was made to upstream JIT support for x32 in
+# https://bugs.webkit.org/show_bug.cgi?id=100450, but this was closed as
+# unresolved due to limited X32 adoption.
+EXTRA_OECMAKE_append_x86-x32 = " -DENABLE_JIT=OFF "
+
+SECURITY_CFLAGS_remove_aarch64 = "-fpie"
+SECURITY_CFLAGS_append_aarch64 = " -fPIE"
+
+FILES_${PN} += "${libdir}/webkit2gtk-4.0/injected-bundle/libwebkit2gtkinjectedbundle.so"
+
+RRECOMMENDS_${PN} += "ca-certificates shared-mime-info"
+
+# http://errors.yoctoproject.org/Errors/Details/20370/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+ARM_INSTRUCTION_SET_armv6 = "arm"
+
+# https://bugzilla.yoctoproject.org/show_bug.cgi?id=9474
+# https://bugs.webkit.org/show_bug.cgi?id=159880
+# JSC JIT can build on ARMv7 with -marm, but doesn't work on runtime.
+# Upstream only tests regularly the JSC JIT on ARMv7 with Thumb2 (-mthumb).
+ARM_INSTRUCTION_SET_armv7a = "thumb"
+ARM_INSTRUCTION_SET_armv7r = "thumb"
+ARM_INSTRUCTION_SET_armv7ve = "thumb"
+
+# qemu: uncaught target signal 11 (Segmentation fault) - core dumped
+# Segmentation fault
+GI_DATA_ENABLED_armv7a = "False"
+GI_DATA_ENABLED_armv7ve = "False"
diff --git a/import-layers/yocto-poky/meta/recipes-support/apr/apr/0001-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch b/import-layers/yocto-poky/meta/recipes-support/apr/apr/0001-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch
new file mode 100644
index 0000000..1237142
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr/0001-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch
@@ -0,0 +1,76 @@
+From f26e8b88d2c90ed7eb9d4e276412b0923c23d10f Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 14 Dec 2016 18:13:08 +0800
+Subject: [PATCH] apr: fix off_t size doesn't match in glibc when cross
+ compiling
+
+In configure.in, it contains the following:
+
+	APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
+
+the macro "APR_CHECK_SIZEOF_EXTENDED" was defined in build/apr_common.m4,
+it use the "AC_TRY_RUN" macro, this macro let the off_t to 8, when cross
+compiling enable.
+
+So it was hardcoded for cross compiling, we should detect it dynamic based on
+the sysroot's glibc. We change it to the following:
+
+	AC_CHECK_SIZEOF(off_t)
+
+The same for the following hardcoded types for cross compiling:
+
+	pid_t	8
+	ssize_t	8
+	size_t	8
+	off_t	8
+
+Change the above correspondingly.
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ configure.in | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 9d57ae6..5b19940 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1681,7 +1681,7 @@ else
+     socklen_t_value="int"
+ fi
+ 
+-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], pid_t, 8)
++AC_CHECK_SIZEOF(pid_t)
+ 
+ if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then
+     pid_t_fmt='#define APR_PID_T_FMT "hd"'
+@@ -1750,7 +1750,7 @@ APR_CHECK_TYPES_COMPATIBLE(ssize_t, long, [ssize_t_fmt="ld"])
+ APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned int, [size_t_fmt="u"])
+ APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned long, [size_t_fmt="lu"])
+ 
+-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
++AC_CHECK_SIZEOF(ssize_t)
+ 
+ AC_MSG_CHECKING([which format to use for apr_ssize_t])
+ if test -n "$ssize_t_fmt"; then
+@@ -1767,7 +1767,7 @@ fi
+ 
+ ssize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\""
+ 
+-APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
++AC_CHECK_SIZEOF(size_t)
+ 
+ AC_MSG_CHECKING([which format to use for apr_size_t])
+ if test -n "$size_t_fmt"; then
+@@ -1784,7 +1784,7 @@ fi
+ 
+ size_t_fmt="#define APR_SIZE_T_FMT \"$size_t_fmt\""
+ 
+-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
++AC_CHECK_SIZEOF(off_t)
+ 
+ if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then
+     # Enable LFS
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/apr/apr/0002-explicitly-link-libapr-against-phtread-to-make-gold-.patch b/import-layers/yocto-poky/meta/recipes-support/apr/apr/0002-explicitly-link-libapr-against-phtread-to-make-gold-.patch
new file mode 100644
index 0000000..7d0dddc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr/0002-explicitly-link-libapr-against-phtread-to-make-gold-.patch
@@ -0,0 +1,50 @@
+From 94d1ca0266a0f9c0446f1299b54f752e87b8a695 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 3 Mar 2017 22:24:17 +0100
+Subject: [PATCH] explicitly link libapr against phtread to make gold happy on
+ test
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_mutexattr_init'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_mutexattr_settype'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_mutexattr_destroy'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_mutex_trylock'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_attr_setstacksize'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_create'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_join'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_detach'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_sigmask'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_once'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_key_create'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_getspecific'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_key_delete'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_setspecific'
+| collect2: error: ld returned 1 exit status
+| Makefile:114: recipe for target 'globalmutexchild' failed
+| make[1]: *** [globalmutexchild] Error 1
+| make[1]: Leaving directory '/home/superandy/tmp/oe-core-glibc/work/cortexa7t2hf-neon-vfpv4-angstrom-linux-gnueabi/apr/1.5.2-r0/apr-1.5.2/test'
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.in b/configure.in
+index 5b19940..cdf4d58 100644
+--- a/configure.in
++++ b/configure.in
+@@ -766,6 +766,7 @@ else
+           APR_PTHREADS_CHECK_RESTORE ] )
+     fi
+     if test "$pthreadh" = "1"; then
++        APR_ADDTO(LIBS,[-lpthread])
+         APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS
+         APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG
+         APR_CHECK_PTHREAD_RECURSIVE_MUTEX
+-- 
+2.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/apr/apr_1.5.2.bb b/import-layers/yocto-poky/meta/recipes-support/apr/apr_1.5.2.bb
index 302c935..992b561 100644
--- a/import-layers/yocto-poky/meta/recipes-support/apr/apr_1.5.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr_1.5.2.bb
@@ -17,6 +17,8 @@
            file://upgrade-and-fix-1.5.1.patch \
            file://Fix-packet-discards-HTTP-redirect.patch \
            file://configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch \
+           file://0001-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch \
+           file://0002-explicitly-link-libapr-against-phtread-to-make-gold-.patch \
 "
 
 SRC_URI[md5sum] = "4e9769f3349fe11fc0a5e1b224c236aa"
@@ -38,7 +40,7 @@
 # x86_64-linux-libtool:   error: specify a tag with '--tag'
 CCACHE = ""
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
 do_configure_prepend() {
diff --git a/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-atk_2.20.1.bb b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-atk_2.20.1.bb
deleted file mode 100644
index d4120b6..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-atk_2.20.1.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "AT-SPI 2 Toolkit Bridge"
-LICENSE = "LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=e9f288ba982d60518f375b5898283886"
-
-MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
-
-SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz"
-SRC_URI[md5sum] = "23309b6f8e1623871ace6347fb734dce"
-SRC_URI[sha256sum] = "2358a794e918e8f47ce0c7370eee8fc8a6207ff1afe976ec9ff547a03277bf8e"
-
-DEPENDS = "dbus glib-2.0 atk at-spi2-core"
-
-inherit autotools pkgconfig distro_features_check upstream-version-is-even
-
-# The at-spi2-core requires x11 in DISTRO_FEATURES
-REQUIRED_DISTRO_FEATURES = "x11"
-
-PACKAGES =+ "${PN}-gnome ${PN}-gtk2"
-
-FILES_${PN}-gnome = "${libdir}/gnome-settings-daemon-3.0/gtk-modules"
-FILES_${PN}-gtk2 = "${libdir}/gtk-2.0/modules/libatk-bridge.*"
diff --git a/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-atk_2.22.0.bb b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-atk_2.22.0.bb
new file mode 100644
index 0000000..58edb6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-atk_2.22.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "AT-SPI 2 Toolkit Bridge"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e9f288ba982d60518f375b5898283886"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "aa62aed21b8e03dc44ab81ae49d893ca"
+SRC_URI[sha256sum] = "e8bdedbeb873eb229eb08c88e11d07713ec25ae175251648ad1a9da6c21113c1"
+
+DEPENDS = "dbus glib-2.0 glib-2.0-native atk at-spi2-core"
+
+inherit autotools pkgconfig distro_features_check upstream-version-is-even
+
+# The at-spi2-core requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGES =+ "${PN}-gnome ${PN}-gtk2"
+
+FILES_${PN}-gnome = "${libdir}/gnome-settings-daemon-3.0/gtk-modules"
+FILES_${PN}-gtk2 = "${libdir}/gtk-2.0/modules/libatk-bridge.*"
diff --git a/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core_2.20.2.bb b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core_2.20.2.bb
deleted file mode 100644
index 199243a..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core_2.20.2.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-SUMMARY = "Assistive Technology Service Provider Interface (dbus core)"
-LICENSE = "LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=e9f288ba982d60518f375b5898283886"
-
-MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
-
-SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
-           file://0001-nls.m4-Take-it-from-gettext-0.15.patch \
-           file://0001-build-Add-with-systemduserunitdir.patch \
-          "
-
-SRC_URI[md5sum] = "f6f6303da2e72317f881703f40bf0c62"
-SRC_URI[sha256sum] = "88a4de9d43139f13cca531b47b901bc1b56e0ab06ba899126644abd4ac16a143"
-
-DEPENDS = "dbus glib-2.0 virtual/libx11 libxi libxtst intltool-native"
-
-inherit autotools gtk-doc gettext systemd pkgconfig distro_features_check upstream-version-is-even gobject-introspection
-# depends on virtual/libx11
-REQUIRED_DISTRO_FEATURES = "x11"
-
-EXTRA_OECONF = "--disable-xevie \
-                --with-systemduserunitdir=${systemd_user_unitdir} \
-                --with-dbus-daemondir=${bindir}"
-
-FILES_${PN} += "${datadir}/dbus-1/services/*.service \
-                ${datadir}/dbus-1/accessibility-services/*.service \
-                ${datadir}/defaults/at-spi2 \
-                ${systemd_user_unitdir}/at-spi-dbus-bus.service \
-                "
diff --git a/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core_2.22.0.bb b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core_2.22.0.bb
new file mode 100644
index 0000000..272849e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core_2.22.0.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Assistive Technology Service Provider Interface (dbus core)"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e9f288ba982d60518f375b5898283886"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+           file://0001-nls.m4-Take-it-from-gettext-0.15.patch \
+           file://0001-build-Add-with-systemduserunitdir.patch \
+          "
+
+SRC_URI[md5sum] = "3da5fe62a653e49dad1c47f9a46fee56"
+SRC_URI[sha256sum] = "415ea3af21318308798e098be8b3a17b2f0cf2fe16cecde5ad840cf4e0f2c80a"
+
+DEPENDS = "dbus glib-2.0 virtual/libx11 libxi libxtst intltool-native"
+
+inherit autotools gtk-doc gettext systemd pkgconfig distro_features_check upstream-version-is-even gobject-introspection
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OECONF = "--disable-xevie \
+                --with-systemduserunitdir=${systemd_user_unitdir} \
+                --with-dbus-daemondir=${bindir}"
+
+FILES_${PN} += "${datadir}/dbus-1/services/*.service \
+                ${datadir}/dbus-1/accessibility-services/*.service \
+                ${datadir}/defaults/at-spi2 \
+                ${systemd_user_unitdir}/at-spi-dbus-bus.service \
+                "
diff --git a/import-layers/yocto-poky/meta/recipes-support/atk/atk_2.20.0.bb b/import-layers/yocto-poky/meta/recipes-support/atk/atk_2.20.0.bb
deleted file mode 100644
index 0422354..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/atk/atk_2.20.0.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "Accessibility toolkit for GNOME"
-HOMEPAGE = "http://live.gnome.org/GAP/"
-BUGTRACKER = "https://bugzilla.gnome.org/"
-SECTION = "x11/libs"
-
-LICENSE = "GPLv2+ & LGPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
-                    file://atk/atkutil.c;endline=18;md5=6fd31cd2fdc9b30f619ca8d819bc12d3 \
-                    file://atk/atk.h;endline=18;md5=fcd7710187e0eae485e356c30d1b0c3b"
-
-DEPENDS = "glib-2.0"
-
-inherit gnomebase gtk-doc gettext upstream-version-is-even gobject-introspection
-
-SRC_URI[archive.md5sum] = "5187b0972f4d3905f285540b31395e20"
-SRC_URI[archive.sha256sum] = "493a50f6c4a025f588d380a551ec277e070b28a82e63ef8e3c06b3ee7c1238f0"
-
-BBCLASSEXTEND = "native"
-
-EXTRA_OECONF = "--disable-glibtest \
-               "
diff --git a/import-layers/yocto-poky/meta/recipes-support/atk/atk_2.22.0.bb b/import-layers/yocto-poky/meta/recipes-support/atk/atk_2.22.0.bb
new file mode 100644
index 0000000..bc80f95
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/atk/atk_2.22.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Accessibility toolkit for GNOME"
+HOMEPAGE = "http://live.gnome.org/GAP/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "x11/libs"
+
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+                    file://atk/atkutil.c;endline=18;md5=6fd31cd2fdc9b30f619ca8d819bc12d3 \
+                    file://atk/atk.h;endline=18;md5=fcd7710187e0eae485e356c30d1b0c3b"
+
+DEPENDS = "glib-2.0"
+
+inherit gnomebase gtk-doc gettext upstream-version-is-even gobject-introspection
+
+SRC_URI[archive.md5sum] = "c7f2adcf75e4058727174cde970e9129"
+SRC_URI[archive.sha256sum] = "d349f5ca4974c9c76a4963e5b254720523b0c78672cbc0e1a3475dbd9b3d44b6"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF = "--disable-glibtest \
+               "
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/acl.inc b/import-layers/yocto-poky/meta/recipes-support/attr/acl.inc
deleted file mode 100644
index 37a0218..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/attr/acl.inc
+++ /dev/null
@@ -1,42 +0,0 @@
-SUMMARY = "Utilities for managing POSIX Access Control Lists"
-HOMEPAGE = "http://savannah.nongnu.org/projects/acl/"
-SECTION = "libs"
-
-LICENSE = "LGPLv2.1+ & GPLv2+"
-LICENSE_${PN} = "GPLv2+"
-LICENSE_lib${BPN} = "LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://doc/COPYING;md5=c781d70ed2b4d48995b790403217a249 \
-                    file://doc/COPYING.LGPL;md5=9e9a206917f8af112da634ce3ab41764"
-
-DEPENDS = "attr"
-SRC_URI = "${SAVANNAH_GNU_MIRROR}/acl/${BP}.src.tar.gz \
-           file://run-ptest \
-           file://acl-fix-the-order-of-expected-output-of-getfacl.patch \
-           file://test-fix-insufficient-quoting-of.patch \
-           file://test-fixups-on-SELinux-machines-for-root-testcases.patch \
-           file://test-fix-directory-permissions.patch \
-"
-
-require ea-acl.inc
-
-# avoid RPATH hardcode to staging dir
-do_configure_append() {
-	sed -i ${S}/config.status -e s,^\\\(hardcode_into_libs=\\\).*$,\\1\'no\',
-	${S}/config.status
-}
-
-# libdir should point to .la
-do_install_append() {
-	sed -i ${D}${libdir}/libacl.la -e \
-	    s,^libdir=\'${base_libdir}\'$,libdir=\'${libdir}\',
-}
-
-inherit ptest
-
-do_install_ptest() {
-	tar -c --exclude=nfs test/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
-	mkdir ${D}${PTEST_PATH}/include
-	cp ${S}/include/builddefs ${S}/include/buildmacros ${S}/include/buildrules ${D}${PTEST_PATH}/include/
-}
-
-RDEPENDS_${PN}-ptest = "acl bash coreutils perl perl-module-filehandle perl-module-getopt-std perl-module-posix shadow"
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch b/import-layers/yocto-poky/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch
new file mode 100644
index 0000000..4c7cba3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch
@@ -0,0 +1,51 @@
+From d82457ce5ca7455e336da5e244d95f90e52aaef8 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 18 Apr 2017 01:17:26 -0700
+Subject: [PATCH] Makefile: libacl should depend on include
+
+Fixed race issue:
+ In file included from acl_copy_entry.c:22:0:
+ libacl.h:19:21: fatal error: sys/acl.h: No such file or directory
+  #include <sys/acl.h>
+
+[snip]
+
+ compilation terminated.
+ acl_get_file.c:27:24: fatal error: acl/libacl.h: No such file or directory
+  #include <acl/libacl.h>
+                         ^
+
+The acl.h is in "include" directory, and include/Makefile creates
+symlink "sys" and "acl" poinst to current dirctory:
+$ ls include/ -l
+acl -> .
+sys -> .
+
+So if "libacl" target runs before "include", the error would happen
+since no "acl" or "sys" directory.
+
+Let libacl depend on include can fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index dce32d3..8a79379 100644
+--- a/Makefile
++++ b/Makefile
+@@ -48,7 +48,7 @@ else
+ endif
+ 
+ # tool/lib dependencies
+-libacl: libmisc
++libacl: include libmisc
+ getfacl setfacl chacl: libacl
+ 
+ ifeq ($(HAVE_BUILDDEFS), yes)
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/acl/add-missing-configure.ac.patch b/import-layers/yocto-poky/meta/recipes-support/attr/acl/add-missing-configure.ac.patch
deleted file mode 100644
index eb6979f..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/attr/acl/add-missing-configure.ac.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-Upstream-Status: Backport [configure.ac is missing from tarball]
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-Index: acl-2.2.52/configure.ac
-===================================================================
---- /dev/null
-+++ acl-2.2.52/configure.ac
-@@ -0,0 +1,50 @@
-+
-+# Copyright (C) 2009  Andreas Gruenbacher <agruen@suse.de>
-+#
-+# This program is free software: you can redistribute it and/or modify it
-+# under the terms of the GNU General Public License as published by
-+# the Free Software Foundation, either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+#
-+AC_INIT(include/acl.h)
-+AC_CONFIG_AUX_DIR([.])
-+AC_CONFIG_MACRO_DIR([m4])
-+AC_CONFIG_HEADER(include/config.h)
-+AC_PREFIX_DEFAULT(/usr)
-+
-+AC_PROG_LIBTOOL
-+
-+AC_ARG_ENABLE(shared,
-+[ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
-+	enable_shared=yes)
-+AC_SUBST(enable_shared)
-+
-+AC_ARG_ENABLE(gettext,
-+[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
-+	enable_gettext=yes)
-+AC_SUBST(enable_gettext)
-+
-+AC_ARG_ENABLE(lib64,
-+[ --enable-lib64=[yes/no] Enable lib64 support [default=no]],,
-+	enable_lib64=no)
-+AC_SUBST(enable_lib64)
-+
-+AC_PACKAGE_GLOBALS(acl)
-+AC_PACKAGE_UTILITIES(acl)
-+AC_PACKAGE_NEED_ATTR_XATTR_H
-+AC_PACKAGE_NEED_ATTR_ERROR_H
-+AC_MULTILIB($enable_lib64)
-+AC_PACKAGE_NEED_GETXATTR_LIBATTR
-+AC_MANUAL_FORMAT
-+
-+AC_FUNC_GCC_VISIBILITY
-+
-+AC_OUTPUT(include/builddefs)
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/acl/configure.ac b/import-layers/yocto-poky/meta/recipes-support/attr/acl/configure.ac
new file mode 100644
index 0000000..7af2e8d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/acl/configure.ac
@@ -0,0 +1,49 @@
+# Copyright (C) 2009  Andreas Gruenbacher <agruen@suse.de>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+AC_INIT(include/acl.h)
+AC_CONFIG_AUX_DIR([.])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_HEADER(include/config.h)
+AC_PREFIX_DEFAULT(/usr)
+
+AC_PROG_LIBTOOL
+
+AC_ARG_ENABLE(shared,
+[ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
+	enable_shared=yes)
+AC_SUBST(enable_shared)
+
+AC_ARG_ENABLE(gettext,
+[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
+	enable_gettext=yes)
+AC_SUBST(enable_gettext)
+
+AC_ARG_ENABLE(lib64,
+[ --enable-lib64=[yes/no] Enable lib64 support [default=no]],,
+	enable_lib64=no)
+AC_SUBST(enable_lib64)
+
+AC_PACKAGE_GLOBALS(acl)
+AC_PACKAGE_UTILITIES(acl)
+AC_PACKAGE_NEED_ATTR_XATTR_H
+AC_PACKAGE_NEED_ATTR_ERROR_H
+AC_MULTILIB($enable_lib64)
+AC_PACKAGE_NEED_GETXATTR_LIBATTR
+AC_MANUAL_FORMAT
+
+AC_FUNC_GCC_VISIBILITY
+
+AC_OUTPUT(include/builddefs)
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/acl_2.2.52.bb b/import-layers/yocto-poky/meta/recipes-support/attr/acl_2.2.52.bb
index ecdbdb6..306c7b5 100644
--- a/import-layers/yocto-poky/meta/recipes-support/attr/acl_2.2.52.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/acl_2.2.52.bb
@@ -1,9 +1,50 @@
-require acl.inc
+SUMMARY = "Utilities for managing POSIX Access Control Lists"
+HOMEPAGE = "http://savannah.nongnu.org/projects/acl/"
+SECTION = "libs"
 
-SRC_URI += "file://add-missing-configure.ac.patch"
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_lib${BPN} = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://doc/COPYING;md5=c781d70ed2b4d48995b790403217a249 \
+                    file://doc/COPYING.LGPL;md5=9e9a206917f8af112da634ce3ab41764"
+
+DEPENDS = "attr"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/acl/${BP}.src.tar.gz \
+           file://configure.ac;subdir=${S} \
+           file://run-ptest \
+           file://acl-fix-the-order-of-expected-output-of-getfacl.patch \
+           file://test-fix-insufficient-quoting-of.patch \
+           file://test-fixups-on-SELinux-machines-for-root-testcases.patch \
+           file://test-fix-directory-permissions.patch \
+           file://Makefile-libacl-should-depend-on-include.patch \
+"
 
 SRC_URI[md5sum] = "a61415312426e9c2212bd7dc7929abda"
 SRC_URI[sha256sum] = "179074bb0580c06c4b4137be4c5a92a701583277967acdb5546043c7874e0d23"
 
+require ea-acl.inc
+
+# avoid RPATH hardcode to staging dir
+do_configure_append() {
+	sed -i ${S}/config.status -e s,^\\\(hardcode_into_libs=\\\).*$,\\1\'no\',
+	${S}/config.status
+}
+
+# libdir should point to .la
+do_install_append() {
+	sed -i ${D}${libdir}/libacl.la -e \
+	    s,^libdir=\'${base_libdir}\'$,libdir=\'${libdir}\',
+}
+
+inherit ptest
+
+do_install_ptest() {
+	tar -c --exclude=nfs test/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	mkdir ${D}${PTEST_PATH}/include
+	cp ${S}/include/builddefs ${S}/include/buildmacros ${S}/include/buildrules ${D}${PTEST_PATH}/include/
+}
+
+RDEPENDS_${PN}-ptest = "acl bash coreutils perl perl-module-filehandle perl-module-getopt-std perl-module-posix shadow"
 
 BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/files/attr-Missing-configure.ac.patch b/import-layers/yocto-poky/meta/recipes-support/attr/attr/attr-Missing-configure.ac.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-support/attr/files/attr-Missing-configure.ac.patch
rename to import-layers/yocto-poky/meta/recipes-support/attr/attr/attr-Missing-configure.ac.patch
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/files/dont-use-decl-macros.patch b/import-layers/yocto-poky/meta/recipes-support/attr/attr/dont-use-decl-macros.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-support/attr/files/dont-use-decl-macros.patch
rename to import-layers/yocto-poky/meta/recipes-support/attr/attr/dont-use-decl-macros.patch
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/ea-acl.inc b/import-layers/yocto-poky/meta/recipes-support/attr/ea-acl.inc
index b3ca65e..c587b3c 100644
--- a/import-layers/yocto-poky/meta/recipes-support/attr/ea-acl.inc
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/ea-acl.inc
@@ -2,6 +2,8 @@
 
 SRC_URI += "file://relative-libdir.patch;striplevel=0 \
            "
+# This patch should be applied after '(attr\|acl)-Missing-configure.ac.patch' 
+SRC_URI_append = " file://0001-Added-configure-option-to-enable-disable-static-libr.patch"
 
 inherit autotools-brokensep gettext
 
@@ -10,7 +12,7 @@
 EXTRA_AUTORECONF += "--exclude=autoheader"
 EXTRA_OECONF = "INSTALL_USER=root INSTALL_GROUP=root"
 EXTRA_OECONF_append_class-native = " --enable-gettext=no"
-EXTRA_OECONF_append_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS', True) == 'no')]}"
+EXTRA_OECONF_append_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS') == 'no')]}"
 
 EXTRA_OEMAKE = "PKG_LIB_DIR=${base_libdir} PKG_DEVLIB_DIR=${libdir}"
 
@@ -22,8 +24,8 @@
 	if test "${libdir}" = "${base_libdir}" ; then
 		return
 	fi
-	librelpath=${@os.path.relpath(d.getVar('libdir',True), d.getVar('base_libdir', True))}
-	baselibrelpath=${@os.path.relpath(d.getVar('base_libdir',True), d.getVar('libdir', True))}
+	librelpath=${@os.path.relpath(d.getVar('libdir'), d.getVar('base_libdir'))}
+	baselibrelpath=${@os.path.relpath(d.getVar('base_libdir'), d.getVar('libdir'))}
 
 	# Remove bad symlinks & create the correct symlinks
 	if test -L ${D}${libdir}/lib${BPN}.so ; then
@@ -46,5 +48,5 @@
 
 BBCLASSEXTEND = "native"
 # Only append ldflags for target recipe and if USE_NLS is enabled
-LDFLAGS_append_libc-uclibc_class-target = "${@['', ' -lintl '][(d.getVar('USE_NLS', True) == 'yes')]}"
-EXTRA_OECONF_append_libc-uclibc_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS', True) == 'no')]}"
+LDFLAGS_append_libc-uclibc_class-target = "${@['', ' -lintl '][(d.getVar('USE_NLS') == 'yes')]}"
+EXTRA_OECONF_append_libc-uclibc_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS') == 'no')]}"
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch b/import-layers/yocto-poky/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
new file mode 100644
index 0000000..1c1159f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
@@ -0,0 +1,70 @@
+From 01256c61ba126449c46dd4ab5d5e145488b981fa Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Mon, 23 Jan 2017 13:25:13 +0200
+Subject: [PATCH] Added configure option to enable/disable static library
+
+Create static library archive only in case of --enable-static.
+
+Upstream-Status: Pending
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ configure.ac         | 6 ++++++
+ include/builddefs.in | 1 +
+ include/buildmacros  | 3 +++
+ 3 files changed, 10 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index b966d0e..e48268b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,6 +26,12 @@ AC_ARG_ENABLE(shared,
+ 	enable_shared=yes)
+ AC_SUBST(enable_shared)
+ 
++AC_ARG_ENABLE(static,
++[ --enable-static=[yes/no] Enable use of static libraries [default=yes]],,
++	enable_static=yes)
++AC_SUBST(enable_static)
++
++
+ AC_ARG_ENABLE(gettext,
+ [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
+ 	enable_gettext=yes)
+diff --git a/include/builddefs.in b/include/builddefs.in
+index d9931db..3b3dbd2 100644
+--- a/include/builddefs.in
++++ b/include/builddefs.in
+@@ -71,6 +71,7 @@ RPMBUILD	= @rpmbuild@
+ RPM_VERSION	= @rpm_version@
+ 
+ ENABLE_SHARED	= @enable_shared@
++ENABLE_STATIC 	= @enable_static@
+ ENABLE_GETTEXT	= @enable_gettext@
+ 
+ HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@
+diff --git a/include/buildmacros b/include/buildmacros
+index 39fa7e2..b0f25c5 100644
+--- a/include/buildmacros
++++ b/include/buildmacros
+@@ -80,6 +80,7 @@ endif
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
++	set -x; \
+ 	cd $(TOPDIR)/$(LIBNAME)/.libs; \
+ 	../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); \
+ 	../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_DEVLIB_DIR); \
+@@ -88,7 +89,9 @@ INSTALL_LTLIB_DEV = \
+ 	../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR); \
+ 	if test "x$(PKG_DEVLIB_DIR)" != "x$(PKG_LIB_DIR)" ; then \
+ 	rel_lib_prefix=$$(echo $(PKG_LIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
++	if test "$(ENABLE_STATIC)" = "yes" ; then \
+ 	../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
++	fi ;\
+ 	../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
+ 	rel_devlib_prefix=$$(echo $(PKG_DEVLIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
+ 	../$(INSTALL) -S $$rel_devlib_prefix$(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so; \
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/bash-completion/bash-completion_2.4.bb b/import-layers/yocto-poky/meta/recipes-support/bash-completion/bash-completion_2.4.bb
deleted file mode 100644
index 42719f1..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/bash-completion/bash-completion_2.4.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-SUMMARY = "Programmable Completion for Bash 4"
-HOMEPAGE = "http://bash-completion.alioth.debian.org/"
-BUGTRACKER = "https://alioth.debian.org/projects/bash-completion/"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-
-SECTION = "console/utils"
-
-SRC_URI = "https://github.com/scop/bash-completion/releases/download/${PV}/${BPN}-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "1ea94864fb2b2446fbbdf82f10bd25df"
-SRC_URI[sha256sum] = "c0f76b5202fec9ef8ffba82f5605025ca003f27cfd7a85115f838ba5136890f6"
-UPSTREAM_CHECK_REGEX = "bash-completion-(?P<pver>(?!2008).+)\.tar"
-UPSTREAM_CHECK_URI = "https://github.com/scop/bash-completion/releases"
-
-PARALLEL_MAKE = ""
-
-inherit autotools
-
-do_install_append() {
-	# compatdir
-	install -d ${D}${sysconfdir}/bash_completion.d/
-	echo '. ${datadir}/${BPN}/bash_completion' >${D}${sysconfdir}/bash_completion
-
-	# Delete files already provided by util-linux
-	local i
-	for i in mount umount; do
-		rm ${D}${datadir}/${BPN}/completions/$i
-	done
-}
-
-RDEPENDS_${PN} = "bash"
-
-# Some recipes are providing ${PN}-bash-completion packages
-PACKAGES =+ "${PN}-extra"
-FILES_${PN}-extra = "${datadir}/${BPN}/completions/ \
-    ${datadir}/${BPN}/helpers/"
-
-FILES_${PN}-dev += "${datadir}/cmake"
-
-BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/bash-completion/bash-completion_2.5.bb b/import-layers/yocto-poky/meta/recipes-support/bash-completion/bash-completion_2.5.bb
new file mode 100644
index 0000000..dd22857
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/bash-completion/bash-completion_2.5.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Programmable Completion for Bash 4"
+HOMEPAGE = "http://bash-completion.alioth.debian.org/"
+BUGTRACKER = "https://alioth.debian.org/projects/bash-completion/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SECTION = "console/utils"
+
+SRC_URI = "https://github.com/scop/bash-completion/releases/download/${PV}/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "15300010bd4034de12c3fc4f171692e3"
+SRC_URI[sha256sum] = "b0b9540c65532825eca030f1241731383f89b2b65e80f3492c5dd2f0438c95cf"
+UPSTREAM_CHECK_REGEX = "bash-completion-(?P<pver>(?!2008).+)\.tar"
+UPSTREAM_CHECK_URI = "https://github.com/scop/bash-completion/releases"
+
+PARALLEL_MAKE = ""
+
+inherit autotools
+
+do_install_append() {
+	# compatdir
+	install -d ${D}${sysconfdir}/bash_completion.d/
+	echo '. ${datadir}/${BPN}/bash_completion' >${D}${sysconfdir}/bash_completion
+
+	# Delete files already provided by util-linux
+	local i
+	for i in mount umount; do
+		rm ${D}${datadir}/${BPN}/completions/$i
+	done
+}
+
+RDEPENDS_${PN} = "bash"
+
+# Some recipes are providing ${PN}-bash-completion packages
+PACKAGES =+ "${PN}-extra"
+FILES_${PN}-extra = "${datadir}/${BPN}/completions/ \
+    ${datadir}/${BPN}/helpers/"
+
+FILES_${PN}-dev += "${datadir}/cmake"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/bjam-native_1.61.0.bb b/import-layers/yocto-poky/meta/recipes-support/boost/bjam-native_1.61.0.bb
deleted file mode 100644
index 32646d7..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/boost/bjam-native_1.61.0.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-include boost-${PV}.inc
-
-SUMMARY = "Portable Boost.Jam build tool for boost"
-SECTION = "devel"
-
-inherit native
-
-SRC_URI += "file://bjam-native-build-bjam.debug.patch"
-
-do_compile() {
-    ./bootstrap.sh --with-toolset=gcc
-}
-
-do_install() {
-    install -d ${D}${bindir}/
-    # install unstripped version for bjam
-    install -c -m 755 bjam.debug ${D}${bindir}/bjam
-}
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/bjam-native_1.63.0.bb b/import-layers/yocto-poky/meta/recipes-support/boost/bjam-native_1.63.0.bb
new file mode 100644
index 0000000..46013f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/bjam-native_1.63.0.bb
@@ -0,0 +1,18 @@
+require boost-${PV}.inc
+
+SUMMARY = "Portable Boost.Jam build tool for boost"
+SECTION = "devel"
+
+inherit native
+
+SRC_URI += "file://bjam-native-build-bjam.debug.patch"
+
+do_compile() {
+    ./bootstrap.sh --with-toolset=gcc
+}
+
+do_install() {
+    install -d ${D}${bindir}/
+    # install unstripped version for bjam
+    install -c -m 755 bjam.debug ${D}${bindir}/bjam
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost-1.61.0.inc b/import-layers/yocto-poky/meta/recipes-support/boost/boost-1.61.0.inc
deleted file mode 100644
index cd9d8a4..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/boost/boost-1.61.0.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-# The Boost web site provides free peer-reviewed portable
-# C++ source libraries. The emphasis is on libraries which
-# work well with the C++ Standard Library. The libraries are
-# intended to be widely useful, and are in regular use by
-# thousands of programmers across a broad spectrum of applications.
-HOMEPAGE = "http://www.boost.org/"
-LICENSE = "BSL-1.0 & MIT & Python-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
-
-BOOST_VER = "${@"_".join(d.getVar("PV", True).split("."))}"
-BOOST_MAJ = "${@"_".join(d.getVar("PV", True).split(".")[0:2])}"
-BOOST_P = "boost_${BOOST_VER}"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/boost/${BOOST_P}.tar.bz2"
-
-SRC_URI[md5sum] = "6095876341956f65f9d35939ccea1a9f"
-SRC_URI[sha256sum] = "a547bd06c2fd9a71ba1d169d9cf0339da7ebf4753849a8f7d6fdb8feee99b640"
-
-S = "${WORKDIR}/${BOOST_P}"
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost-1.63.0.inc b/import-layers/yocto-poky/meta/recipes-support/boost/boost-1.63.0.inc
new file mode 100644
index 0000000..b540a89
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost-1.63.0.inc
@@ -0,0 +1,24 @@
+# The Boost web site provides free peer-reviewed portable
+# C++ source libraries. The emphasis is on libraries which
+# work well with the C++ Standard Library. The libraries are
+# intended to be widely useful, and are in regular use by
+# thousands of programmers across a broad spectrum of applications.
+HOMEPAGE = "http://www.boost.org/"
+LICENSE = "BSL-1.0 & MIT & Python-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
+
+BOOST_VER = "${@"_".join(d.getVar("PV").split("."))}"
+BOOST_MAJ = "${@"_".join(d.getVar("PV").split(".")[0:2])}"
+BOOST_P = "boost_${BOOST_VER}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/boost/boost/${PV}/${BOOST_P}.tar.bz2"
+
+SRC_URI[md5sum] = "1c837ecd990bb022d07e7aab32b09847"
+SRC_URI[sha256sum] = "beae2529f759f6b3bf3f4969a19c2e9d6f0c503edcb2de4a61d1428519fcb3b0"
+
+UPSTREAM_CHECK_URI = "http://www.boost.org/users/download/"
+UPSTREAM_CHECK_REGEX = "boostorg/release/(?P<pver>.*)/source/"
+
+PR = "r1"
+
+S = "${WORKDIR}/${BOOST_P}"
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost.inc b/import-layers/yocto-poky/meta/recipes-support/boost/boost.inc
index 1966d3d..4ff70e3 100644
--- a/import-layers/yocto-poky/meta/recipes-support/boost/boost.inc
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost.inc
@@ -42,16 +42,15 @@
 PACKAGECONFIG[locale] = ",,icu"
 PACKAGECONFIG[graph_parallel] = ",,,boost-mpi mpich"
 PACKAGECONFIG[mpi] = ",,mpich"
-PACKAGECONFIG[python] = ",,python python3"
+PACKAGECONFIG[python] = ",,python3"
 
 BOOST_LIBS += "\
-    ${@bb.utils.contains('PACKAGECONFIG', 'locale', 'locale', '', d)} \
+    ${@bb.utils.filter('PACKAGECONFIG', 'locale python', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'graph_parallel', 'graph_parallel mpi', \
-                         bb.utils.contains('PACKAGECONFIG', 'mpi', 'mpi', '', d), d)} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python python3', '', d)} \
+                         bb.utils.filter('PACKAGECONFIG', 'mpi', d), d)} \
 "
 
-inherit python-dir
+inherit python3-dir
 PYTHON_ROOT = "${STAGING_DIR_HOST}/${prefix}"
 
 # Make a package for each library, plus -dev
@@ -59,25 +58,17 @@
 python __anonymous () {
     packages = []
     extras = []
-    for lib in d.getVar('BOOST_LIBS', True).split( ):
-        # BJAM does not know '--with-python3' (only --with-python)
-        if lib != "python3":
-            extras.append("--with-%s" % lib)
+    for lib in d.getVar('BOOST_LIBS').split():
+        extras.append("--with-%s" % lib)
         pkg = "boost-%s" % lib.replace("_", "-")
         packages.append(pkg)
-        if lib == "python":
-            # special: python*.so matches python3.so !!
-            if not d.getVar("FILES_%s" % pkg, True):
-                    d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s.so.*" % lib)
-        else:
-            if not d.getVar("FILES_%s" % pkg, True):
-                    d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s*.so.*" % lib)
+        if not d.getVar("FILES_%s" % pkg):
+                d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s*.so.*" % lib)
     d.setVar("BOOST_PACKAGES", " ".join(packages))
     d.setVar("BJAM_EXTRA", " ".join(extras))
 }
 
 # Override the contents of specific packages
-FILES_${PN}-graph = "${libdir}/libboost_graph.so.*"
 FILES_${PN}-graph_parallel = "${libdir}/libboost_graph_parallel.so.*"
 FILES_${PN}-locale = "${libdir}/libboost_locale.so.*"
 FILES_${PN}-mpi = "${libdir}/mpi.so ${libdir}/libboost_mpi*.so.*"
@@ -88,15 +79,15 @@
 
 # -dev last to pick up the remaining stuff
 PACKAGES += "${PN}-dev ${PN}-staticdev"
-FILES_${PN} = ""
 FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so"
 FILES_${PN}-staticdev = "${libdir}/libboost_*.a"
 
 # "boost" is a metapackage which pulls in all boost librabries
 PACKAGES += "${PN}"
+FILES_${PN} = ""
+ALLOW_EMPTY_${PN} = "1"
 RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
 RRECOMMENDS_${PN}_class-native = ""
-ALLOW_EMPTY_${PN} = "1"
 
 # to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works
 TARGET_CC_ARCH += "${LDFLAGS}"
@@ -145,7 +136,7 @@
 # use PARALLEL_MAKE to speed up the build, but limit it by -j 64, greater parallelism causes bjam to segfault or to ignore -j
 # https://svn.boost.org/trac/boost/ticket/7634
 def get_boost_parallel_make(d):
-    pm = d.getVar('PARALLEL_MAKE', True)
+    pm = d.getVar('PARALLEL_MAKE')
     if pm:
         # look for '-j' and throw other options (e.g. '-l') away
         # because they might have different meaning in bjam
@@ -177,34 +168,42 @@
 # Native compilation of bzip2 isn't working
 BJAM_OPTS_append_class-native = ' -sNO_BZIP2=1'
 
+# Adjust the build for x32
+BJAM_OPTS_append_linux-gnux32 = " abi=x32 address-model=64"
+
 do_configure() {
 	cp -f ${S}/boost/config/platform/linux.hpp ${S}/boost/config/platform/linux-gnueabi.hpp
 
 	# D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation.
 	rm -f ${WORKDIR}/user-config.jam
 	echo 'using gcc : 4.3.1 : ${CXX} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;' >> ${WORKDIR}/user-config.jam
-	echo "using python : ${PYTHON_BASEVERSION} : : ${STAGING_INCDIR}/python${PYTHON_BASEVERSION} ;" >> ${WORKDIR}/user-config.jam
-	echo "using python : 3.5 : : ${STAGING_INCDIR}/python3.5m ;" >> ${WORKDIR}/user-config.jam
+
+	# If we want Python then we need to tell Boost *exactly* where to find it
+	if ${@bb.utils.contains('BOOST_LIBS', 'python', 'true', 'false', d)}; then
+		echo "using python : ${PYTHON_BASEVERSION} : ${STAGING_DIR_HOST}${bindir}/python3 : ${STAGING_DIR_HOST}${includedir}/${PYTHON_DIR}${PYTHON_ABI} : ${STAGING_DIR_HOST}${libdir}/${PYTHON_DIR} ;" >> ${WORKDIR}/user-config.jam
+	fi
 
 	if ${@bb.utils.contains('BOOST_LIBS', 'mpi', 'true', 'false', d)}; then
 		echo "using mpi : : <find-shared-library>mpi ;" >> ${WORKDIR}/user-config.jam
 	fi
 
-	CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-bjam=bjam --with-toolset=gcc --with-python-root=${PYTHON_ROOT}
-	sed -i '/^using python/d' ${S}/project-config.jam
+	CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-bjam=bjam --with-toolset=gcc
+
+	# Boost can't be trusted to find Python on it's own, so remove any mention
+	# of it from the boost configuration
+	sed -i '/using python/d' ${S}/project-config.jam
 }
 
 do_compile() {
-	set -ex
 	rm -rf ${S}/${TARGET_SYS}
 	bjam ${BJAM_OPTS} --prefix=${prefix} \
 		--exec-prefix=${exec_prefix} \
 		--libdir=${libdir} \
-		--includedir=${includedir}
+		--includedir=${includedir} \
+		--debug-configuration
 }
 
 do_install() {
-	set -ex
 	bjam ${BJAM_OPTS} \
 		--libdir=${D}${libdir} \
 		--includedir=${D}${includedir} \
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost/0001-Apply-boost-1.62.0-no-forced-flags.patch.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0001-Apply-boost-1.62.0-no-forced-flags.patch.patch
new file mode 100644
index 0000000..1699063
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0001-Apply-boost-1.62.0-no-forced-flags.patch.patch
@@ -0,0 +1,100 @@
+From 8845a786598f1d9e83aa1b7d2966b0d1eb765ba0 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 10:14:31 -0700
+Subject: [PATCH 1/3] Apply boost-1.62.0-no-forced-flags.patch
+
+Upstream-Status: Inappropriate
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ libs/log/build/Jamfile.v2           |  4 ++--
+ libs/log/config/x86-ext/Jamfile.jam | 16 ++++++++--------
+ libs/log/src/dump_avx2.cpp          |  4 ++++
+ libs/log/src/dump_ssse3.cpp         |  4 ++++
+ 4 files changed, 18 insertions(+), 10 deletions(-)
+
+diff --git a/libs/log/build/Jamfile.v2 b/libs/log/build/Jamfile.v2
+index 4abbdbc..b3016fc 100644
+--- a/libs/log/build/Jamfile.v2
++++ b/libs/log/build/Jamfile.v2
+@@ -373,7 +373,7 @@ rule avx2-targets-cond ( properties * )
+             }
+             else if <toolset>clang in $(properties)
+             {
+-                result = <cxxflags>"-mavx -mavx2" ;
++                result = <cxxflags> ;
+             }
+             else if <toolset>intel in $(properties)
+             {
+@@ -383,7 +383,7 @@ rule avx2-targets-cond ( properties * )
+                 }
+                 else
+                 {
+-                    result = <cxxflags>"-xCORE-AVX2 -fabi-version=0" ;
++                    result = <cxxflags>"-fabi-version=0" ;
+                 }
+             }
+             else if <toolset>msvc in $(properties)
+diff --git a/libs/log/config/x86-ext/Jamfile.jam b/libs/log/config/x86-ext/Jamfile.jam
+index 0e9695a..dcc394d 100644
+--- a/libs/log/config/x86-ext/Jamfile.jam
++++ b/libs/log/config/x86-ext/Jamfile.jam
+@@ -15,19 +15,19 @@ project /boost/log/x86-extensions
+ 
+ obj ssse3 : ssse3.cpp
+     :
+-        <toolset>gcc:<cxxflags>"-msse -msse2 -msse3 -mssse3"
+-        <toolset>clang:<cxxflags>"-msse -msse2 -msse3 -mssse3"
+-        <toolset>intel-linux:<cxxflags>"-xSSSE3"
+-        <toolset>intel-darwin:<cxxflags>"-xSSSE3"
++        <toolset>gcc:<cxxflags>
++        <toolset>clang:<cxxflags>
++        <toolset>intel-linux:<cxxflags>
++        <toolset>intel-darwin:<cxxflags>
+         <toolset>intel-win:<cxxflags>"/QxSSSE3"
+     ;
+ 
+ obj avx2 : avx2.cpp
+     :
+-        <toolset>gcc:<cxxflags>"-mavx -mavx2 -fabi-version=0"
+-        <toolset>clang:<cxxflags>"-mavx -mavx2"
+-        <toolset>intel-linux:<cxxflags>"-xCORE-AVX2 -fabi-version=0"
+-        <toolset>intel-darwin:<cxxflags>"-xCORE-AVX2 -fabi-version=0"
++        <toolset>gcc:<cxxflags>"-fabi-version=0"
++        <toolset>clang:<cxxflags>
++        <toolset>intel-linux:<cxxflags>"-fabi-version=0"
++        <toolset>intel-darwin:<cxxflags>"-fabi-version=0"
+         <toolset>intel-win:<cxxflags>"/arch:CORE-AVX2"
+         <toolset>msvc:<cxxflags>"/arch:AVX"
+     ;
+diff --git a/libs/log/src/dump_avx2.cpp b/libs/log/src/dump_avx2.cpp
+index 4ab1250..610fc6d 100644
+--- a/libs/log/src/dump_avx2.cpp
++++ b/libs/log/src/dump_avx2.cpp
+@@ -22,6 +22,10 @@
+ #include <boost/cstdint.hpp>
+ #include <boost/log/detail/header.hpp>
+ 
++#if !defined(__AVX2__)
++#error "AVX2 Unsupported!"
++#endif
++
+ #if defined(__x86_64) || defined(__x86_64__) || \
+     defined(__amd64__) || defined(__amd64) || \
+     defined(_M_X64)
+diff --git a/libs/log/src/dump_ssse3.cpp b/libs/log/src/dump_ssse3.cpp
+index 1325b49..60d4112 100644
+--- a/libs/log/src/dump_ssse3.cpp
++++ b/libs/log/src/dump_ssse3.cpp
+@@ -22,6 +22,10 @@
+ #include <boost/cstdint.hpp>
+ #include <boost/log/detail/header.hpp>
+ 
++#if !defined(__SSSE3__)
++#error "SSSE3 Unsupported!"
++#endif
++
+ #if defined(__x86_64) || defined(__x86_64__) || \
+     defined(__amd64__) || defined(__amd64) || \
+     defined(_M_X64)
+-- 
+2.8.0
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost/0001-When-using-soft-float-on-ARM-we-should-not-expect-th.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0001-When-using-soft-float-on-ARM-we-should-not-expect-th.patch
new file mode 100644
index 0000000..bafd5ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0001-When-using-soft-float-on-ARM-we-should-not-expect-th.patch
@@ -0,0 +1,29 @@
+From 9ab0914207e6d0e6b75ce12147c54b96478feb64 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 21 Feb 2017 12:50:35 +0200
+Subject: [PATCH] When using soft-float, on ARM we should not expect the FE_*
+ symbols
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ boost/test/execution_monitor.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/boost/test/execution_monitor.hpp b/boost/test/execution_monitor.hpp
+index f53348a..86252d7 100644
+--- a/boost/test/execution_monitor.hpp
++++ b/boost/test/execution_monitor.hpp
+@@ -498,7 +498,7 @@ enum masks {
+ 
+     BOOST_FPE_ALL       = MCW_EM,
+ 
+-#elif defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG) /* *** */
++#elif defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG) || defined(__ARM_PCS) /* *** */
+     BOOST_FPE_ALL       = BOOST_FPE_OFF,
+ 
+ #else /* *** */
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost/0002-Don-t-set-up-m32-m64-we-do-that-ourselves.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0002-Don-t-set-up-m32-m64-we-do-that-ourselves.patch
new file mode 100644
index 0000000..e9c7e4c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0002-Don-t-set-up-m32-m64-we-do-that-ourselves.patch
@@ -0,0 +1,97 @@
+From c0e785f8da2caa6617052b1c7b347e0dffb1520d Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 10:29:17 -0700
+Subject: [PATCH 2/3] Don't set up -m32/-m64, we do that ourselves
+
+Upstream-Status: Inappropriate
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ tools/build/src/tools/gcc.jam | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+diff --git a/tools/build/src/tools/gcc.jam b/tools/build/src/tools/gcc.jam
+index 0f346a5..942f141 100644
+--- a/tools/build/src/tools/gcc.jam
++++ b/tools/build/src/tools/gcc.jam
+@@ -509,7 +509,6 @@ rule compile.c++.pch ( targets * : sources * : properties * )
+ {
+     setup-threading $(targets) : $(sources) : $(properties) ;
+     setup-fpic $(targets) : $(sources) : $(properties) ;
+-    setup-address-model $(targets) : $(sources) : $(properties) ;
+ }
+ 
+ actions compile.c++.pch
+@@ -521,7 +520,6 @@ rule compile.c.pch ( targets * : sources * : properties * )
+ {
+     setup-threading $(targets) : $(sources) : $(properties) ;
+     setup-fpic $(targets) : $(sources) : $(properties) ;
+-    setup-address-model $(targets) : $(sources) : $(properties) ;
+ }
+ 
+ actions compile.c.pch
+@@ -533,7 +531,6 @@ rule compile.c++.preprocess ( targets * : sources * : properties * )
+ {
+     setup-threading $(targets) : $(sources) : $(properties) ;
+     setup-fpic $(targets) : $(sources) : $(properties) ;
+-    setup-address-model $(targets) : $(sources) : $(properties) ;
+ 
+     # Some extensions are compiled as C++ by default. For others, we need to
+     # pass -x c++. We could always pass -x c++ but distcc does not work with it.
+@@ -548,7 +545,6 @@ rule compile.c.preprocess ( targets * : sources * : properties * )
+ {
+     setup-threading $(targets) : $(sources) : $(properties) ;
+     setup-fpic $(targets) : $(sources) : $(properties) ;
+-    setup-address-model $(targets) : $(sources) : $(properties) ;
+ 
+     # If we use the name g++ then default file suffix -> language mapping does
+     # not work. So have to pass -x option. Maybe, we can work around this by
+@@ -564,7 +560,6 @@ rule compile.c++ ( targets * : sources * : properties * )
+ {
+     setup-threading $(targets) : $(sources) : $(properties) ;
+     setup-fpic $(targets) : $(sources) : $(properties) ;
+-    setup-address-model $(targets) : $(sources) : $(properties) ;
+ 
+     # Some extensions are compiled as C++ by default. For others, we need to
+     # pass -x c++. We could always pass -x c++ but distcc does not work with it.
+@@ -594,7 +589,6 @@ rule compile.c ( targets * : sources * : properties * )
+ {
+     setup-threading $(targets) : $(sources) : $(properties) ;
+     setup-fpic $(targets) : $(sources) : $(properties) ;
+-    setup-address-model $(targets) : $(sources) : $(properties) ;
+ 
+     # If we use the name g++ then default file suffix -> language mapping does
+     # not work. So have to pass -x option. Maybe, we can work around this by
+@@ -610,7 +604,6 @@ rule compile.fortran ( targets * : sources * : properties * )
+ {
+     setup-threading $(targets) : $(sources) : $(properties) ;
+     setup-fpic $(targets) : $(sources) : $(properties) ;
+-    setup-address-model $(targets) : $(sources) : $(properties) ;
+ }
+ 
+ actions compile.c++ bind PCH_FILE
+@@ -641,7 +634,6 @@ actions compile.fortran
+ rule compile.asm ( targets * : sources * : properties * )
+ {
+     setup-fpic $(targets) : $(sources) : $(properties) ;
+-    setup-address-model $(targets) : $(sources) : $(properties) ;
+     LANG on $(<) = "-x assembler-with-cpp" ;
+ }
+ 
+@@ -950,7 +942,6 @@ rule quote-rpath ( targets * )
+ rule link ( targets * : sources * : properties * )
+ {
+     setup-threading $(targets) : $(sources) : $(properties) ;
+-    setup-address-model $(targets) : $(sources) : $(properties) ;
+     SPACE on $(targets) = " " ;
+     # Serialize execution of the 'link' action, since running N links in
+     # parallel is just slower. For now, serialize only gcc links, it might be a
+@@ -1018,7 +1009,6 @@ actions piecemeal archive
+ rule link.dll ( targets * : sources * : properties * )
+ {
+     setup-threading $(targets) : $(sources) : $(properties) ;
+-    setup-address-model $(targets) : $(sources) : $(properties) ;
+     SPACE on $(targets) = " " ;
+     JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;
+     quote-rpath $(targets) ;
+-- 
+2.8.0
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost/0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch
deleted file mode 100644
index 569c987..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/boost/boost/0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch
+++ /dev/null
@@ -1,145 +0,0 @@
-From 5c349a1c391c9ce171a1c80f5164fae764f27dba Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
-Date: Wed, 24 Aug 2016 20:58:59 +0100
-Subject: [PATCH 2/4] boost/test/execution_monitor.hpp: fix mips soft float
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-gcc.compile.c++ <builddir>/boost/bin.v2/libs/test/build/gcc-4.3.1/release/threading-multi/execution_monitor.o
-
-    "mipsel-poky-linux-musl-g++" "-mel" "-mabi=32" "-msoft-float" "-march=mips32r2" "-mips16" "-minterlink-compressed" "-mtune=24kec" "-mdsp" "-Wl,-O1" "-Wl,--as-needed" "-fstack-protector-strong" "-Wl,-z,relro,-z,now" "--sysroot=<sysroot>"  -ftemplate-depth-128 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=<srcdir>=/usr/src/debug/boost/1.61.0-r0 -fdebug-prefix-map=<sysroot_host>= -fdebug-prefix-map=<sysroot>= -fstack-protector-strong -pie -fpie -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -fvisibility-inlines-hidden -O3 -finline-functions -Wno-inline -Wall -pedantic -pthread -fPIC -Wno-variadic-macros -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_TEST_DYN_LINK=1 -DBOOST_TIMER_DYN_LINK=1 -DNDEBUG  -I"." -c -o "<builddir>/boost/bin.v2/libs/test/build/gcc-4.3.1/release/threading-multi/execution_monitor.o" "libs/test/src/execution_monitor.cpp"
-
-In file included from ./boost/test/impl/execution_monitor.ipp:31:0,
-                 from libs/test/src/execution_monitor.cpp:16:
-./boost/test/execution_monitor.hpp:491:27: error: 'FE_DIVBYZERO' was not declared in this scope
-     BOOST_FPE_DIVBYZERO = FE_DIVBYZERO,
-                           ^~~~~~~~~~~~
-./boost/test/execution_monitor.hpp:492:27: error: 'FE_INEXACT' was not declared in this scope
-     BOOST_FPE_INEXACT   = FE_INEXACT,
-                           ^~~~~~~~~~
-./boost/test/execution_monitor.hpp:493:27: error: 'FE_INVALID' was not declared in this scope
-     BOOST_FPE_INVALID   = FE_INVALID,
-                           ^~~~~~~~~~
-./boost/test/execution_monitor.hpp:494:27: error: 'FE_OVERFLOW' was not declared in this scope
-     BOOST_FPE_OVERFLOW  = FE_OVERFLOW,
-                           ^~~~~~~~~~~
-./boost/test/execution_monitor.hpp:495:27: error: 'FE_UNDERFLOW' was not declared in this scope
-     BOOST_FPE_UNDERFLOW = FE_UNDERFLOW,
-                           ^~~~~~~~~~~~
-
-The reason is that some (notably FPU-less) architectures,
-including mips*-nf, don't define/implement some of the
-floating point constants, even though fenv.h is
-available.
-
-The key point is:
-  A fully standards conforming fenv.h does not have to
-  define any FE_* macros, and if it does define them,
-  then it defines macros only for the FP exceptions it
-  actually supports.
-
-So correct usage requires a triple check:
-1) Check BOOST_NO_FENV_H to see if the header is supported.
-2) Include the header and then check FE_ALL_EXCEPT to see
-   if any FP exceptions are supported.
-3) Before using the individual FE_* macros, you need to
-   check for their existence too as not all may be
-   supported.
-
-https://svn.boost.org/trac/boost/ticket/11756
-
-Other projects have similar issues, e.g. pixman, and
-apply similar work-arounds:
-  https://lists.freedesktop.org/archives/pixman/2014-February/003172.html
-
-Architectures are notably also allowed to define FE_ALL_EXCEPT to 0!
-Keeping this in mind, and knowing that the compiler will eliminate
-code that can't be executed, we can change BOOST_FPE_ALL to be 0 for
-the case of compiling using Clang and/or fenv.h being unavailable
-as well, which allows simplification of the #ifdef's in
-execution_monitor.ipp a bit.
-
-Signed-off-by: André Draszik <adraszik@tycoint.com>
----
-Upstream-Status: Submitted https://svn.boost.org/trac/boost/ticket/11756
- boost/test/execution_monitor.hpp      | 26 +++++++++++++++++++++++++-
- boost/test/impl/execution_monitor.ipp | 10 ++++++++--
- 2 files changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/boost/test/execution_monitor.hpp b/boost/test/execution_monitor.hpp
-index 0eee497..44fe59d 100644
---- a/boost/test/execution_monitor.hpp
-+++ b/boost/test/execution_monitor.hpp
-@@ -486,15 +486,39 @@ enum masks {
-     BOOST_FPE_ALL       = MCW_EM,
- #elif defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG) \
-     || defined(__ARM_PCS)
--    BOOST_FPE_ALL       = 1,
-+    BOOST_FPE_ALL       = 0,
- #else
-+#if defined(FE_DIVBYZERO)
-     BOOST_FPE_DIVBYZERO = FE_DIVBYZERO,
-+#else
-+    BOOST_FPE_DIVBYZERO = 0,
-+#endif
-+#if defined(FE_INEXACT)
-     BOOST_FPE_INEXACT   = FE_INEXACT,
-+#else
-+    BOOST_FPE_INEXACT   = 0,
-+#endif
-+#if defined(FE_INVALID)
-     BOOST_FPE_INVALID   = FE_INVALID,
-+#else
-+    BOOST_FPE_INVALID   = 0,
-+#endif
-+#if defined(FE_OVERFLOW)
-     BOOST_FPE_OVERFLOW  = FE_OVERFLOW,
-+#else
-+    BOOST_FPE_OVERFLOW  = 0,
-+#endif
-+#if defined(FE_UNDERFLOW)
-     BOOST_FPE_UNDERFLOW = FE_UNDERFLOW,
-+#else
-+    BOOST_FPE_UNDERFLOW = 0,
-+#endif
- 
-+#if defined(FE_ALL_EXCEPT)
-     BOOST_FPE_ALL       = FE_ALL_EXCEPT,
-+#else
-+    BOOST_FPE_ALL       = 0,
-+#endif
- #endif
-     BOOST_FPE_INV       = BOOST_FPE_ALL+1
- };
-diff --git a/boost/test/impl/execution_monitor.ipp b/boost/test/impl/execution_monitor.ipp
-index f7fc8ea..d1088b9 100644
---- a/boost/test/impl/execution_monitor.ipp
-+++ b/boost/test/impl/execution_monitor.ipp
-@@ -1381,7 +1381,10 @@ enable( unsigned mask )
- #endif
- 
-     return ~old_cw & BOOST_FPE_ALL;
--#elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H)
-+#elif defined(__GLIBC__) && defined(__USE_GNU)
-+    if (BOOST_FPE_ALL == 0)
-+        /* Not Implemented */
-+        return 0;
-     feclearexcept(BOOST_FPE_ALL);
-     int res = feenableexcept( mask );
-     return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res;
-@@ -1418,7 +1421,10 @@ disable( unsigned mask )
- #endif
- 
-     return ~old_cw & BOOST_FPE_ALL;
--#elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H)
-+#elif defined(__GLIBC__) && defined(__USE_GNU)
-+    if (BOOST_FPE_ALL == 0)
-+        /* Not Implemented */
-+        return BOOST_FPE_INV;
-     feclearexcept(BOOST_FPE_ALL);
-     int res = fedisableexcept( mask );
-     return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res;
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost/0003-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0003-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch
new file mode 100644
index 0000000..6bb25f8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0003-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch
@@ -0,0 +1,143 @@
+From 7c49525812567f1219706c4ed330b3bd2cc8e94a Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 10:29:32 -0700
+Subject: [PATCH 3/3] Don't set up arch/instruction-set flags, we do that
+ ourselves
+
+Upstream-Status: Inappropriate
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ tools/build/src/tools/gcc.jam | 121 ------------------------------------------
+ 1 file changed, 121 deletions(-)
+
+diff --git a/tools/build/src/tools/gcc.jam b/tools/build/src/tools/gcc.jam
+index 942f141..d062c20 100644
+--- a/tools/build/src/tools/gcc.jam
++++ b/tools/build/src/tools/gcc.jam
+@@ -1068,124 +1068,3 @@ local rule cpu-flags ( toolset variable : architecture : instruction-set + :
+         <architecture>$(architecture)/<instruction-set>$(instruction-set)
+         : $(values) ;
+ }
+-
+-
+-# Set architecture/instruction-set options.
+-#
+-# x86 and compatible
+-# The 'native' option appeared in gcc 4.2 so we cannot safely use it as default.
+-# Use i686 instead for 32-bit.
+-toolset.flags gcc OPTIONS <architecture>x86/<address-model>32/<instruction-set> : -march=i686 ;
+-cpu-flags gcc OPTIONS : x86 : native : -march=native ;
+-cpu-flags gcc OPTIONS : x86 : i486 : -march=i486 ;
+-cpu-flags gcc OPTIONS : x86 : i586 : -march=i586 ;
+-cpu-flags gcc OPTIONS : x86 : i686 : -march=i686 ;
+-cpu-flags gcc OPTIONS : x86 : pentium : -march=pentium ;
+-cpu-flags gcc OPTIONS : x86 : pentium-mmx : -march=pentium-mmx ;
+-cpu-flags gcc OPTIONS : x86 : pentiumpro : -march=pentiumpro ;
+-cpu-flags gcc OPTIONS : x86 : pentium2 : -march=pentium2 ;
+-cpu-flags gcc OPTIONS : x86 : pentium3 : -march=pentium3 ;
+-cpu-flags gcc OPTIONS : x86 : pentium3m : -march=pentium3m ;
+-cpu-flags gcc OPTIONS : x86 : pentium-m : -march=pentium-m ;
+-cpu-flags gcc OPTIONS : x86 : pentium4 : -march=pentium4 ;
+-cpu-flags gcc OPTIONS : x86 : pentium4m : -march=pentium4m ;
+-cpu-flags gcc OPTIONS : x86 : prescott : -march=prescott ;
+-cpu-flags gcc OPTIONS : x86 : nocona : -march=nocona ;
+-cpu-flags gcc OPTIONS : x86 : core2 : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : conroe : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : conroe-xe : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : conroe-l : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : allendale : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : wolfdale : -march=core2 -msse4.1 ;
+-cpu-flags gcc OPTIONS : x86 : merom : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : merom-xe : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : kentsfield : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : kentsfield-xe : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : yorksfield : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : penryn : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : corei7 : -march=corei7 ;
+-cpu-flags gcc OPTIONS : x86 : nehalem : -march=corei7 ;
+-cpu-flags gcc OPTIONS : x86 : corei7-avx : -march=corei7-avx ;
+-cpu-flags gcc OPTIONS : x86 : sandy-bridge : -march=corei7-avx ;
+-cpu-flags gcc OPTIONS : x86 : core-avx-i : -march=core-avx-i ;
+-cpu-flags gcc OPTIONS : x86 : ivy-bridge : -march=core-avx-i ;
+-cpu-flags gcc OPTIONS : x86 : haswell : -march=core-avx-i -mavx2 -mfma -mbmi -mbmi2 -mlzcnt ;
+-cpu-flags gcc OPTIONS : x86 : k6 : -march=k6 ;
+-cpu-flags gcc OPTIONS : x86 : k6-2 : -march=k6-2 ;
+-cpu-flags gcc OPTIONS : x86 : k6-3 : -march=k6-3 ;
+-cpu-flags gcc OPTIONS : x86 : athlon : -march=athlon ;
+-cpu-flags gcc OPTIONS : x86 : athlon-tbird : -march=athlon-tbird ;
+-cpu-flags gcc OPTIONS : x86 : athlon-4 : -march=athlon-4 ;
+-cpu-flags gcc OPTIONS : x86 : athlon-xp : -march=athlon-xp ;
+-cpu-flags gcc OPTIONS : x86 : athlon-mp : -march=athlon-mp ;
+-##
+-cpu-flags gcc OPTIONS : x86 : k8 : -march=k8 ;
+-cpu-flags gcc OPTIONS : x86 : opteron : -march=opteron ;
+-cpu-flags gcc OPTIONS : x86 : athlon64 : -march=athlon64 ;
+-cpu-flags gcc OPTIONS : x86 : athlon-fx : -march=athlon-fx ;
+-cpu-flags gcc OPTIONS : x86 : k8-sse3 : -march=k8-sse3 ;
+-cpu-flags gcc OPTIONS : x86 : opteron-sse3 : -march=opteron-sse3 ;
+-cpu-flags gcc OPTIONS : x86 : athlon64-sse3 : -march=athlon64-sse3 ;
+-cpu-flags gcc OPTIONS : x86 : amdfam10 : -march=amdfam10 ;
+-cpu-flags gcc OPTIONS : x86 : barcelona : -march=barcelona ;
+-cpu-flags gcc OPTIONS : x86 : bdver1 : -march=bdver1 ;
+-cpu-flags gcc OPTIONS : x86 : bdver2 : -march=bdver2 ;
+-cpu-flags gcc OPTIONS : x86 : bdver3 : -march=bdver3 ;
+-cpu-flags gcc OPTIONS : x86 : btver1 : -march=btver1 ;
+-cpu-flags gcc OPTIONS : x86 : btver2 : -march=btver2 ;
+-cpu-flags gcc OPTIONS : x86 : winchip-c6 : -march=winchip-c6 ;
+-cpu-flags gcc OPTIONS : x86 : winchip2 : -march=winchip2 ;
+-cpu-flags gcc OPTIONS : x86 : c3 : -march=c3 ;
+-cpu-flags gcc OPTIONS : x86 : c3-2 : -march=c3-2 ;
+-##
+-cpu-flags gcc OPTIONS : x86 : atom : -march=atom ;
+-# Sparc
+-cpu-flags gcc OPTIONS : sparc : v7 : -mcpu=v7 : default ;
+-cpu-flags gcc OPTIONS : sparc : cypress : -mcpu=cypress ;
+-cpu-flags gcc OPTIONS : sparc : v8 : -mcpu=v8 ;
+-cpu-flags gcc OPTIONS : sparc : supersparc : -mcpu=supersparc ;
+-cpu-flags gcc OPTIONS : sparc : sparclite : -mcpu=sparclite ;
+-cpu-flags gcc OPTIONS : sparc : hypersparc : -mcpu=hypersparc ;
+-cpu-flags gcc OPTIONS : sparc : sparclite86x : -mcpu=sparclite86x ;
+-cpu-flags gcc OPTIONS : sparc : f930 : -mcpu=f930 ;
+-cpu-flags gcc OPTIONS : sparc : f934 : -mcpu=f934 ;
+-cpu-flags gcc OPTIONS : sparc : sparclet : -mcpu=sparclet ;
+-cpu-flags gcc OPTIONS : sparc : tsc701 : -mcpu=tsc701 ;
+-cpu-flags gcc OPTIONS : sparc : v9 : -mcpu=v9 ;
+-cpu-flags gcc OPTIONS : sparc : ultrasparc : -mcpu=ultrasparc ;
+-cpu-flags gcc OPTIONS : sparc : ultrasparc3 : -mcpu=ultrasparc3 ;
+-# RS/6000 & PowerPC
+-cpu-flags gcc OPTIONS : power : 403 : -mcpu=403 ;
+-cpu-flags gcc OPTIONS : power : 505 : -mcpu=505 ;
+-cpu-flags gcc OPTIONS : power : 601 : -mcpu=601 ;
+-cpu-flags gcc OPTIONS : power : 602 : -mcpu=602 ;
+-cpu-flags gcc OPTIONS : power : 603 : -mcpu=603 ;
+-cpu-flags gcc OPTIONS : power : 603e : -mcpu=603e ;
+-cpu-flags gcc OPTIONS : power : 604 : -mcpu=604 ;
+-cpu-flags gcc OPTIONS : power : 604e : -mcpu=604e ;
+-cpu-flags gcc OPTIONS : power : 620 : -mcpu=620 ;
+-cpu-flags gcc OPTIONS : power : 630 : -mcpu=630 ;
+-cpu-flags gcc OPTIONS : power : 740 : -mcpu=740 ;
+-cpu-flags gcc OPTIONS : power : 7400 : -mcpu=7400 ;
+-cpu-flags gcc OPTIONS : power : 7450 : -mcpu=7450 ;
+-cpu-flags gcc OPTIONS : power : 750 : -mcpu=750 ;
+-cpu-flags gcc OPTIONS : power : 801 : -mcpu=801 ;
+-cpu-flags gcc OPTIONS : power : 821 : -mcpu=821 ;
+-cpu-flags gcc OPTIONS : power : 823 : -mcpu=823 ;
+-cpu-flags gcc OPTIONS : power : 860 : -mcpu=860 ;
+-cpu-flags gcc OPTIONS : power : 970 : -mcpu=970 ;
+-cpu-flags gcc OPTIONS : power : 8540 : -mcpu=8540 ;
+-cpu-flags gcc OPTIONS : power : power : -mcpu=power ;
+-cpu-flags gcc OPTIONS : power : power2 : -mcpu=power2 ;
+-cpu-flags gcc OPTIONS : power : power3 : -mcpu=power3 ;
+-cpu-flags gcc OPTIONS : power : power4 : -mcpu=power4 ;
+-cpu-flags gcc OPTIONS : power : power5 : -mcpu=power5 ;
+-cpu-flags gcc OPTIONS : power : powerpc : -mcpu=powerpc ;
+-cpu-flags gcc OPTIONS : power : powerpc64 : -mcpu=powerpc64 ;
+-cpu-flags gcc OPTIONS : power : rios : -mcpu=rios ;
+-cpu-flags gcc OPTIONS : power : rios1 : -mcpu=rios1 ;
+-cpu-flags gcc OPTIONS : power : rios2 : -mcpu=rios2 ;
+-cpu-flags gcc OPTIONS : power : rsc : -mcpu=rsc ;
+-cpu-flags gcc OPTIONS : power : rs64a : -mcpu=rs64 ;
+-# AIX variant of RS/6000 & PowerPC
+-toolset.flags gcc AROPTIONS <address-model>64/<target-os>aix : "-X64" ;
+-- 
+2.8.0
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch
deleted file mode 100644
index 2b48d0d..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 4f19d72ca94418431e068cfd4ffb96ed9b289f6c Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
-Date: Wed, 24 Aug 2016 17:34:59 +0100
-Subject: [PATCH 3/4] smart_ptr: mips assembly doesn't compile in mips16e mode
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-gcc.compile.c++ <builddir>/boost/bin.v2/libs/date_time/build/gcc-4.3.1/release/threading-multi/gregorian/greg_month.o
-
-    "mipsel-poky-linux-musl-g++" "-mel" "-mabi=32" "-msoft-float" "-march=mips32r2" "-mips16" "-minterlink-compressed" "-mtune=24kec" "-mdsp" "-Wl,-O1" "-Wl,--as-needed" "-fstack-protector-strong" "-Wl,-z,relro,-z,now" "--sysroot=<sysroot>"  -ftemplate-depth-128 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=<srcdir>=/usr/src/debug/boost/1.61.0-r0 -fdebug-prefix-map=<sysroot_host>= -fdebug-prefix-map=<sysroot>= -fstack-protector-strong -pie -fpie -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -fvisibility-inlines-hidden -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC  -DBOOST_ALL_DYN_LINK=1 -DBOOST_ALL_NO_LIB=1 -DDATE_TIME_INLINE -DNDEBUG  -I"." -c -o "<builddir>/boost/bin.v2/libs/date_time/build/gcc-4.3.1/release/threading-multi/gregorian/greg_month.o" "libs/date_time/src/gregorian/greg_month.cpp"
-
-{standard input}: Assembler messages:
-{standard input}:17603: Warning: the `dsp' extension requires MIPS32 revision 2 or greater
-{standard input}:17604: Error: unrecognized opcode `ll $3,4($16)'
-{standard input}:17606: Error: unrecognized opcode `sc $2,4($16)'
-{standard input}:17734: Error: unrecognized opcode `ll $3,8($16)'
-{standard input}:17736: Error: unrecognized opcode `sc $2,8($16)'
-{standard input}:18084: Error: unrecognized opcode `ll $3,4($4)'
-{standard input}:18086: Error: unrecognized opcode `sc $2,4($4)'
-{standard input}:18318: Error: unrecognized opcode `ll $3,8($4)'
-{standard input}:18320: Error: unrecognized opcode `sc $2,8($4)'
-{standard input}:19921: Error: unrecognized opcode `ll $3,4($2)'
-{standard input}:19923: Error: unrecognized opcode `sc $3,4($2)'
-{standard input}:20199: Error: unrecognized opcode `ll $4,4($16)'
-{standard input}:20201: Error: unrecognized opcode `sc $2,4($16)'
-{standard input}:23392: Error: unrecognized opcode `ll $4,8($16)'
-{standard input}:23394: Error: unrecognized opcode `sc $2,8($16)'
-...failed updating 1 target...
-
-boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp
-contains hand-written MIPS assembly, which is not compatible
-with the MIPS16e instruction set.
-
-By not using this file in MIPS16e mode, we fallback to using
-g++ 4.1+ __sync intrinsics (__sync_fetch_and_add() and
-__sync_val_compare_and_swap()) which are working fine.
-
-Signed-off-by: André Draszik <adraszik@tycoint.com>
----
-Upstream-Status: Backport https://svn.boost.org/trac/boost/ticket/12418
- boost/smart_ptr/detail/sp_counted_base.hpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/boost/smart_ptr/detail/sp_counted_base.hpp b/boost/smart_ptr/detail/sp_counted_base.hpp
-index 0addf07..0995ca8 100644
---- a/boost/smart_ptr/detail/sp_counted_base.hpp
-+++ b/boost/smart_ptr/detail/sp_counted_base.hpp
-@@ -65,7 +65,7 @@
- #elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX )
- # include <boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp>
- 
--#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__)
-+#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) && !defined( __mips16 )
- # include <boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp>
- 
- #elif defined( BOOST_SP_HAS_SYNC )
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost/consider-hardfp.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/consider-hardfp.patch
deleted file mode 100644
index 66808a6..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/boost/boost/consider-hardfp.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-When using soft-float, on ARM we should not expect the FE_* symbols
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Pending
-
-Index: boost_1_60_0/boost/test/execution_monitor.hpp
-===================================================================
---- boost_1_60_0.orig/boost/test/execution_monitor.hpp
-+++ boost_1_60_0/boost/test/execution_monitor.hpp
-@@ -484,7 +484,8 @@ enum masks {
-     BOOST_FPE_UNDERFLOW = EM_UNDERFLOW|EM_DENORMAL,
- 
-     BOOST_FPE_ALL       = MCW_EM,
--#elif defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG)
-+#elif defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG) \
-+    || defined(__ARM_PCS)
-     BOOST_FPE_ALL       = 1,
- #else
-     BOOST_FPE_DIVBYZERO = FE_DIVBYZERO,
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost/py3.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/py3.patch
new file mode 100644
index 0000000..2b1ff18
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost/py3.patch
@@ -0,0 +1,269 @@
+Backport fixes from upstream (as of boost super-module commit 0d52b9) to improve
+the building of the Boost Python module with Python 3.
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/build/Jamfile b/build/Jamfile
+index 313fdab..f14dc11 100644
+--- a/libs/python/build/Jamfile
++++ b/libs/python/build/Jamfile
+@@ -6,6 +6,7 @@ import os ;
+ import indirect ;
+ import modules ;
+ import feature ;
++import property ;
+ 
+ import python ;
+ 
+@@ -30,21 +31,8 @@ else
+         ;
+ }
+ 
+-rule find-py3-version
+-{
+-    local versions = [ feature.values python ] ;
+-    local py3ver ;
+-    for local v in $(versions)
+-    {
+-        if $(v) >= 3.0
+-        {
+-            py3ver = $(v) ;
+-        }
+-    }
+-    return $(py3ver) ;
+-}
+-
+-py3-version = [ find-py3-version ] ;
++py2-version = [ py-version 2 ] ;
++py3-version = [ py-version 3 ] ;
+ 
+ project boost/python
+   : source-location ../src
+@@ -52,11 +40,17 @@ project boost/python
+ 
+ rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { return $(no) ; } }
+ rule unless ( test ? : yes * : no * ) { if ! $(test) { return $(yes) ; } else { return $(no) ; } }
++local rule eq ( a : b ) { if $(a) = $(b) { return 1 ; } }
+ 
+-rule lib_boost_python ( is-py3 ? )
+-{
++lib_boost_python(2) = boost_python ;
++lib_boost_python(3) = boost_python3 ;
+ 
+-    lib [ cond $(is-py3) : boost_python3 : boost_python ]
++lib_boost_python($(py2-version)) = $(lib_boost_python(2)) ;
++lib_boost_python($(py3-version)) = $(lib_boost_python(3)) ;
++
++rule lib_boost_python ( version )
++{
++    lib $(lib_boost_python($(version)))
+         : # sources
+         numeric.cpp
+         list.cpp
+@@ -112,11 +106,13 @@ rule lib_boost_python ( is-py3 ? )
+             <dependency>config-warning
+ 
+             <python-debugging>on:<define>BOOST_DEBUG_PYTHON
+-            [ cond $(is-py3) : <python>$(py3-version) ]
++            <python>$(version)
+ 
+             -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
+             <tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag
+ 
++            <conditional>@python.require-py
++
+         :   # default build
+             <link>shared
+         :   # usage requirements
+@@ -125,51 +121,68 @@ rule lib_boost_python ( is-py3 ? )
+         ;
+ }
+ 
+-rule lib_boost_numpy ( is-py3 ? )
++lib_boost_numpy(2) = boost_numpy ;
++lib_boost_numpy(3) = boost_numpy3 ;
++
++lib_boost_numpy($(py2-version)) = $(lib_boost_python(2)) ;
++lib_boost_numpy($(py3-version)) = $(lib_boost_python(3)) ;
++
++rule lib_boost_numpy ( version )
+ {
+     numpy-include = [ python.numpy-include ] ;
+-    lib [ cond $(is-py3) : boost_numpy3 : boost_numpy ]
++    lib $(lib_boost_numpy($(version)))
+         : # sources
+         numpy/dtype.cpp
+         numpy/matrix.cpp
+         numpy/ndarray.cpp
+-	numpy/numpy.cpp
+-	numpy/scalars.cpp
+-	numpy/ufunc.cpp
++        numpy/numpy.cpp
++        numpy/scalars.cpp
++        numpy/ufunc.cpp
+         :   # requirements
++            <link>static:<define>BOOST_NUMPY_STATIC_LIB 
++            <define>BOOST_NUMPY_SOURCE
+             [ cond [ python.numpy ] : <library>/python//python_for_extensions ]
+             [ unless [ python.numpy ] : <build>no ]
+-	    <include>$(numpy-include)
+-	    <library>boost_python
++            <include>$(numpy-include)
++            <library>$(lib_boost_python($(version)))
+             <python-debugging>on:<define>BOOST_DEBUG_PYTHON
+-            [ cond $(is-py3) : <python>$(py3-version) ]
++            <python>$(version)
+ 
+             -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
+             <tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag
+ 
++            <conditional>@python.require-py
++
+         :   # default build
+             <link>shared
+         :   # usage requirements
++			<link>static:<define>BOOST_NUMPY_STATIC_LIB
+             <python-debugging>on:<define>BOOST_DEBUG_PYTHON
+         ;
+ }
+ 
+-libraries = boost_python ;
+-libraries3 = boost_python3 ;
+-if [ python.numpy ]
+-{
+-    libraries += boost_numpy ;
+-    libraries3 += boost_numpy3 ;
+-}
+-
+-lib_boost_python ;
+-lib_boost_numpy ;
++libraries = ;
+ 
+-if $(py3-version)
++for local N in 2 3
+ {
+-    lib_boost_python yes ;
+-    lib_boost_numpy yes ;
+-    libraries += $(libraries3) ;
++    if $(py$(N)-version)
++    {
++        lib_boost_python $(py$(N)-version) ;
++        libraries += $(lib_boost_python($(py$(N)-version))) ;
++    }
++    else
++    {
++        alias $(lib_boost_python($(N))) ;
++    }
++    if $(py$(N)-version) && [ python.numpy ]
++    {
++        lib_boost_numpy $(py$(N)-version) ;
++        libraries += $(lib_boost_numpy($(py$(N)-version))) ;
++    }
++    else
++    {
++        alias $(lib_boost_numpy($(N))) ;
++    }
+ }
+ 
+ boost-install $(libraries) ;
+diff --git a/src/tools/python.jam b/src/tools/python.jam
+index cc13385..bf300b8 100644
+--- a/tools/build/src/tools/python.jam
++++ b/tools/build/src/tools/python.jam
+@@ -34,6 +34,7 @@ import path ;
+ import feature ;
+ import set ;
+ import builtin ;
++import property-set ;
+ 
+ 
+ # Make this module a project.
+@@ -60,6 +61,10 @@ lib rt ;
+ # installed in the development system's default paths.
+ feature.feature pythonpath : : free optional path ;
+ 
++# The best configured version of Python 2 and 3.
++py2-version = ;
++py3-version = ;
++
+ # Initializes the Python toolset. Note that all parameters are optional.
+ #
+ # - version -- the version of Python to use. Should be in Major.Minor format,
+@@ -861,6 +866,11 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
+         if ! $(version) in [ feature.values python ]
+         {
+             feature.extend python : $(version) ;
++            py$(major-minor[1])-version ?= $(version) ;
++            if $(py$(major-minor[1])-version) < $(version)
++            {
++                py$(major-minor[1])-version = $(version) ;
++            }
+         }
+         target-requirements += <python>$(version:E=default) ;
+     }
+@@ -916,6 +926,9 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
+         }
+     }
+ 
++    # In case we added duplicate requirements from what the user specified.
++    target-requirements = [ sequence.unique $(target-requirements) ] ;
++
+     # Global, but conditional, requirements to give access to the interpreter
+     # for general utilities, like other toolsets, that run Python scripts.
+     toolset.add-requirements
+@@ -934,19 +947,6 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
+         toolset.add-requirements <target-os>$(target-os):<python>$(version:E=default) ;
+     }
+ 
+-    # We also set a default requirement that assigns the first python configured
+-    # for a particular target OS as the default. This makes it so that we can
+-    # select a python interpreter with only knowledge of the target OS. And hence
+-    # can configure different Pythons based on the target OS only.
+-    local toolset-requirements = [ toolset.requirements ] ;
+-    local toolset-target-os-requirements
+-        = [ property.evaluate-conditionals-in-context
+-            [ $(toolset-requirements).raw ] : <target-os>$(target-os) ] ;
+-    if ! <python> in $(toolset-target-os-requirements:G)
+-    {
+-        toolset.add-requirements <target-os>$(target-os):<python>$(version:E=default) ;
+-    }
+-
+     # Register the right suffix for extensions.
+     register-extension-suffix $(extension-suffix) : $(target-requirements) ;
+ 
+@@ -1038,6 +1038,22 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
+             : $(usage-requirements)
+             ;
+     }
++    
++}
++
++# Conditional rule specification that will prevent building of a target
++# if there is no matching python configuration available with the given
++# required properties.
++rule require-py ( properties * )
++{
++    local py-ext-target = [ $(.project).find python_for_extensions ] ;
++    local property-set = [ property-set.create $(properties) ] ;
++    property-set = [ $(property-set).expand ] ;
++    local py-ext-alternative = [ $(py-ext-target).select-alternatives $(property-set) ] ;
++    if ! $(py-ext-alternative)
++    {
++        return <build>no ;
++    }
+ }
+ 
+ 
+@@ -1298,5 +1314,11 @@ rule numpy-test ( name : sources * : requirements * )
+         : $(name) ] ;
+ }
+ 
++rule py-version ( n )
++{
++    return $(py$(n)-version) ;
++}
++
+ IMPORT $(__name__) : bpl-test : : bpl-test ;
+ IMPORT $(__name__) : numpy-test : : numpy-test ;
++IMPORT $(__name__) : py-version : : py-version ;
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost_1.61.0.bb b/import-layers/yocto-poky/meta/recipes-support/boost/boost_1.61.0.bb
deleted file mode 100644
index 40e3870..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/boost/boost_1.61.0.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-include boost-${PV}.inc
-include boost.inc
-
-SRC_URI += "\
-    file://arm-intrinsics.patch \
-    file://consider-hardfp.patch \
-    file://boost-CVE-2012-2677.patch \
-    file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch \
-    file://0002-boost-test-execution_monitor.hpp-fix-mips-soft-float.patch \
-    file://0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch \
-    file://0004-Use-atomic-by-default-when-BOOST_NO_CXX11_HDR_ATOMIC.patch \
-    file://boost-math-disable-pch-for-gcc.patch \
-"
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost_1.63.0.bb b/import-layers/yocto-poky/meta/recipes-support/boost/boost_1.63.0.bb
new file mode 100644
index 0000000..1107686
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost_1.63.0.bb
@@ -0,0 +1,15 @@
+require boost-${PV}.inc
+require boost.inc
+
+SRC_URI += "\
+    file://arm-intrinsics.patch \
+    file://0001-When-using-soft-float-on-ARM-we-should-not-expect-th.patch \
+    file://boost-CVE-2012-2677.patch \
+    file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch \
+    file://0004-Use-atomic-by-default-when-BOOST_NO_CXX11_HDR_ATOMIC.patch \
+    file://boost-math-disable-pch-for-gcc.patch \
+    file://0001-Apply-boost-1.62.0-no-forced-flags.patch.patch \
+    file://0003-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch \
+    file://0002-Don-t-set-up-m32-m64-we-do-that-ourselves.patch \
+    file://py3.patch \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates_20160104.bb b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates_20160104.bb
deleted file mode 100644
index 1bea067..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates_20160104.bb
+++ /dev/null
@@ -1,82 +0,0 @@
-SUMMARY = "Common CA certificates"
-DESCRIPTION = "This package includes PEM files of CA certificates to allow \
-SSL-based applications to check for the authenticity of SSL connections. \
-This derived from Debian's CA Certificates."
-HOMEPAGE = "http://packages.debian.org/sid/ca-certificates"
-SECTION = "misc"
-LICENSE = "GPL-2.0+ & MPL-2.0"
-LIC_FILES_CHKSUM = "file://debian/copyright;md5=e7358b9541ccf3029e9705ed8de57968"
-
-# This is needed to ensure we can run the postinst at image creation time
-DEPENDS = "ca-certificates-native"
-DEPENDS_class-native = "openssl-native"
-DEPENDS_class-nativesdk = "ca-certificates-native openssl-native"
-
-SRCREV = "f54715702c5c0581c9461f78fd84e2c8d2ec243c"
-
-SRC_URI = "git://anonscm.debian.org/collab-maint/ca-certificates.git \
-           file://0002-update-ca-certificates-use-SYSROOT.patch \
-           file://0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch \
-           file://update-ca-certificates-support-Toybox.patch \
-           file://default-sysroot.patch \
-           file://sbindir.patch"
-
-S = "${WORKDIR}/git"
-
-inherit allarch
-
-EXTRA_OEMAKE = "\
-    'CERTSDIR=${datadir}/ca-certificates' \
-    'SBINDIR=${sbindir}' \
-"
-
-do_compile_prepend() {
-    oe_runmake clean
-}
-
-do_install () {
-    install -d ${D}${datadir}/ca-certificates \
-               ${D}${sysconfdir}/ssl/certs \
-               ${D}${sysconfdir}/ca-certificates/update.d
-    oe_runmake 'DESTDIR=${D}' install
-
-    install -d ${D}${mandir}/man8
-    install -m 0644 sbin/update-ca-certificates.8 ${D}${mandir}/man8/
-
-    install -d ${D}${sysconfdir}
-    {
-        echo "# Lines starting with # will be ignored"
-        echo "# Lines starting with ! will remove certificate on next update"
-        echo "#"
-        find ${D}${datadir}/ca-certificates -type f -name '*.crt' | \
-            sed 's,^${D}${datadir}/ca-certificates/,,'
-    } >${D}${sysconfdir}/ca-certificates.conf
-}
-
-do_install_append_class-target () {
-    sed -i -e 's,/etc/,${sysconfdir}/,' \
-           -e 's,/usr/share/,${datadir}/,' \
-           -e 's,/usr/local,${prefix}/local,' \
-        ${D}${sbindir}/update-ca-certificates \
-        ${D}${mandir}/man8/update-ca-certificates.8
-}
-
-pkg_postinst_${PN} () {
-    SYSROOT="$D" update-ca-certificates
-}
-
-CONFFILES_${PN} += "${sysconfdir}/ca-certificates.conf"
-
-# Postinsts don't seem to be run for nativesdk packages when populating SDKs.
-CONFFILES_${PN}_append_class-nativesdk = " ${sysconfdir}/ssl/certs/ca-certificates.crt"
-do_install_append_class-nativesdk () {
-    SYSROOT="${D}${SDKPATHNATIVE}" update-ca-certificates
-}
-
-do_install_append_class-native () {
-    SYSROOT="${D}${base_prefix}" ${D}${sbindir}/update-ca-certificates
-}
-
-RDEPENDS_${PN} += "openssl"
-
-BBCLASSEXTEND += "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates_20161130.bb b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates_20161130.bb
new file mode 100644
index 0000000..c282ace
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates_20161130.bb
@@ -0,0 +1,84 @@
+SUMMARY = "Common CA certificates"
+DESCRIPTION = "This package includes PEM files of CA certificates to allow \
+SSL-based applications to check for the authenticity of SSL connections. \
+This derived from Debian's CA Certificates."
+HOMEPAGE = "http://packages.debian.org/sid/ca-certificates"
+SECTION = "misc"
+LICENSE = "GPL-2.0+ & MPL-2.0"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=e7358b9541ccf3029e9705ed8de57968"
+
+# This is needed to ensure we can run the postinst at image creation time
+DEPENDS = ""
+DEPENDS_class-native = "openssl-native"
+DEPENDS_class-nativesdk = "openssl-native"
+# Need c_rehash from openssl and run-parts from debianutils
+PACKAGE_WRITE_DEPS += "openssl-native debianutils-native"
+
+SRCREV = "61b70a1007dc269d56881a0d480fc841daacc77c"
+
+SRC_URI = "git://anonscm.debian.org/collab-maint/ca-certificates.git \
+           file://0002-update-ca-certificates-use-SYSROOT.patch \
+           file://0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch \
+           file://update-ca-certificates-support-Toybox.patch \
+           file://default-sysroot.patch \
+           file://sbindir.patch"
+
+S = "${WORKDIR}/git"
+
+inherit allarch
+
+EXTRA_OEMAKE = "\
+    'CERTSDIR=${datadir}/ca-certificates' \
+    'SBINDIR=${sbindir}' \
+"
+
+do_compile_prepend() {
+    oe_runmake clean
+}
+
+do_install () {
+    install -d ${D}${datadir}/ca-certificates \
+               ${D}${sysconfdir}/ssl/certs \
+               ${D}${sysconfdir}/ca-certificates/update.d
+    oe_runmake 'DESTDIR=${D}' install
+
+    install -d ${D}${mandir}/man8
+    install -m 0644 sbin/update-ca-certificates.8 ${D}${mandir}/man8/
+
+    install -d ${D}${sysconfdir}
+    {
+        echo "# Lines starting with # will be ignored"
+        echo "# Lines starting with ! will remove certificate on next update"
+        echo "#"
+        find ${D}${datadir}/ca-certificates -type f -name '*.crt' | \
+            sed 's,^${D}${datadir}/ca-certificates/,,'
+    } >${D}${sysconfdir}/ca-certificates.conf
+}
+
+do_install_append_class-target () {
+    sed -i -e 's,/etc/,${sysconfdir}/,' \
+           -e 's,/usr/share/,${datadir}/,' \
+           -e 's,/usr/local,${prefix}/local,' \
+        ${D}${sbindir}/update-ca-certificates \
+        ${D}${mandir}/man8/update-ca-certificates.8
+}
+
+pkg_postinst_${PN} () {
+    SYSROOT="$D" $D${sbindir}/update-ca-certificates
+}
+
+CONFFILES_${PN} += "${sysconfdir}/ca-certificates.conf"
+
+# Postinsts don't seem to be run for nativesdk packages when populating SDKs.
+CONFFILES_${PN}_append_class-nativesdk = " ${sysconfdir}/ssl/certs/ca-certificates.crt"
+do_install_append_class-nativesdk () {
+    SYSROOT="${D}${SDKPATHNATIVE}" ${D}${sbindir}/update-ca-certificates
+}
+
+do_install_append_class-native () {
+    SYSROOT="${D}${base_prefix}" ${D}${sbindir}/update-ca-certificates
+}
+
+RDEPENDS_${PN} += "openssl"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb b/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb
index ceac0fe..80d48bf 100644
--- a/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb
@@ -23,8 +23,7 @@
 
 S = "${WORKDIR}/ConsoleKit-${PV}"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
 
 PACKAGECONFIG[pam] = "--enable-pam-module --with-pam-module-dir=${base_libdir}/security,--disable-pam-module,libpam"
 PACKAGECONFIG[policykit] = "--with-polkit,--without-polkit,polkit"
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch
deleted file mode 100644
index 7275598..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-createrepo: Implement --dbpath command line option
-
---dbpath option allows to specify path to the directory
-with rpm database. By default createrepo uses or creates
-rpm database in /var/lib/rpm/
-
-Upstream-Status: Pending
-
-Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
-
---- createrepo-0.4.11.orig/genpkgmetadata.py 2015-03-30 22:18:19.904000000 +0300
-+++ createrepo-0.4.11/genpkgmetadata.py 2015-03-30 22:28:49.208000000 +0300
-@@ -65,6 +65,7 @@
-      -p, --pretty = output xml files in pretty format.
-      --update = update existing metadata (if present)
-      -d, --database = generate the sqlite databases.
-+     --dbpath <dir> = specify path to rpm db directory.
-     """)
- 
-     sys.exit(retval)
-@@ -72,10 +73,13 @@
- class MetaDataGenerator:
-     def __init__(self, cmds):
-         self.cmds = cmds
--        self.ts = rpm.TransactionSet()
-         self.pkgcount = 0
-         self.files = []
- 
-+        if self.cmds['dbpath']:
-+            rpm.addMacro("_dbpath", self.cmds['dbpath'])
-+        self.ts = rpm.TransactionSet()
-+
-     def _os_path_walk(self, top, func, arg):
-         """Directory tree walk with callback function.
-          copy of os.path.walk, fixes the link/stating problem
-@@ -435,6 +439,7 @@
-     cmds['dir-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*']
-     cmds['skip-symlinks'] = False
-     cmds['pkglist'] = []
-+    cmds['dbpath'] = None
- 
-     try:
-         gopts, argsleft = getopt.getopt(args, 'phqVvndg:s:x:u:c:o:CSi:', ['help', 'exclude=',
-@@ -442,7 +447,7 @@
-                                                                   'baseurl=', 'groupfile=', 'checksum=',
-                                                                   'version', 'pretty', 'split', 'outputdir=',
-                                                                   'noepoch', 'checkts', 'database', 'update',
--                                                                  'skip-symlinks', 'pkglist='])
-+                                                                  'skip-symlinks', 'pkglist=', 'dbpath='])
-     except getopt.error, e:
-         errorprint(_('Options Error: %s.') % e)
-         usage()
-@@ -516,6 +521,8 @@
-                 cmds['skip-symlinks'] = True
-             elif arg in ['-i', '--pkglist']:
-                 cmds['pkglist'] = a
-+            elif arg == '--dbpath':
-+                cmds['dbpath'] = os.path.realpath(a)
-                                 
-     except ValueError, e:
-         errorprint(_('Options Error: %s') % e)
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch
deleted file mode 100644
index bc7200d..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-dumpMetadata.py: Fix for RPM5 - 5.4.9 integration
-
-RPM5 no longer has a switch to disable signature validation.  (Due to security
-validation concerns.)
-
-Upstream-Status: Inappropriate [other]
-  createrepo does not support RPM5 upstream
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-
-diff -u createrepo-0.4.11.orig/dumpMetadata.py createrepo-0.4.11/dumpMetadata.py
---- createrepo-0.4.11.orig/dumpMetadata.py	2012-06-05 10:12:55.687964222 -0500
-+++ createrepo-0.4.11/dumpMetadata.py	2012-06-05 10:40:08.154060600 -0500
-@@ -92,7 +92,7 @@
-             fdno = package # let's assume this is an fdno and go with it :)
-     except OSError:
-         raise MDError, "Error opening file"
--    ts.setVSFlags((rpm._RPMVSF_NOSIGNATURES|rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
-+    ts.setVSFlags((rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
-     try:
-         hdr = ts.hdrFromFdno(fdno)
-     except rpm.error:
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/dumpMetadata-disable-signature-validation.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/dumpMetadata-disable-signature-validation.patch
deleted file mode 100644
index 905531f..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/dumpMetadata-disable-signature-validation.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-dumpMetadata: disable signature validation
-
-Makes it possible to work on RPM repositories that contain signed packages
-without the need of importing the public part of the signing key into the RPM
-database.
-
-Upstream-Status: Pending
-
-Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
----
- dumpMetadata.py | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/dumpMetadata.py b/dumpMetadata.py
-index e40e8ac..ca6a82d 100644
---- a/dumpMetadata.py
-+++ b/dumpMetadata.py
-@@ -92,7 +92,9 @@ def returnHdr(ts, package):
-             fdno = package # let's assume this is an fdno and go with it :)
-     except OSError:
-         raise MDError, "Error opening file"
--    ts.setVSFlags((rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
-+    ts.setVSFlags((rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD|
-+                   rpm.RPMVSF_NODSA|rpm.RPMVSF_NORSA|
-+                   rpm.RPMVSF_NODSAHEADER|rpm.RPMVSF_NORSAHEADER))
-     try:
-         hdr = ts.hdrFromFdno(fdno)
-     except rpm.error:
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fix-native-install.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fix-native-install.patch
deleted file mode 100644
index d8202a4..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fix-native-install.patch
+++ /dev/null
@@ -1,163 +0,0 @@
-Upstream-Status: Inappropriate [configuration]
-
-Date: Jan 31, 2011
-
-There are two fixes:
-  1. -native needs to customize prefix
-  2. needs to change python reference in binaries
-
-Signed-off-by: Qing He <qing.he@intel.com>
-
-diff --git a/Makefile b/Makefile
-index b2d1a32..3c3639f 100644
---- a/Makefile
-+++ b/Makefile
-@@ -3,22 +3,22 @@ VERSION = 0.4.11
- SHELL = /bin/sh
- top_srcdir = .
- srcdir = .
--prefix = /usr
--exec_prefix = ${prefix}
--
--bindir = ${exec_prefix}/bin
--sbindir = ${exec_prefix}/sbin
--libexecdir = ${exec_prefix}/libexec
--datadir = ${prefix}/share
--sysconfdir = ${prefix}/etc
--sharedstatedir = ${prefix}/com
--localstatedir = ${prefix}/var
--libdir = ${exec_prefix}/lib
--infodir = ${prefix}/info
-+prefix ?= /usr
-+exec_prefix ?= ${prefix}
-+
-+bindir ?= ${exec_prefix}/bin
-+sbindir ?= ${exec_prefix}/sbin
-+libexecdir ?= ${exec_prefix}/libexec
-+datadir ?= ${prefix}/share
-+sysconfdir ?= ${prefix}/etc
-+sharedstatedir ?= ${prefix}/com
-+localstatedir ?= ${prefix}/var
-+libdir ?= ${exec_prefix}/lib
-+infodir ?= ${prefix}/info
- docdir = 
--includedir = ${prefix}/include
-+includedir ?= ${prefix}/include
- oldincludedir = /usr/include
--mandir = ${prefix}/share/man
-+mandir ?= ${prefix}/share/man
- 
- pkgdatadir = $(datadir)/$(PACKAGE)
- pkglibdir = $(libdir)/$(PACKAGE)
-diff --git a/bin/Makefile b/bin/Makefile
-index 52c1f50..e30610e 100644
---- a/bin/Makefile
-+++ b/bin/Makefile
-@@ -1,22 +1,22 @@
- SHELL = /bin/sh
- top_srcdir = ..
- srcdir = ../bin
--prefix = /usr
--exec_prefix = ${prefix}
--
--bindir = ${exec_prefix}/bin
--sbindir = ${exec_prefix}/sbin
--libexecdir = ${exec_prefix}/libexec
--datadir = ${prefix}/share
--sysconfdir = ${prefix}/etc
--sharedstatedir = ${prefix}/com
--localstatedir = ${prefix}/var
--libdir = ${exec_prefix}/lib
--infodir = ${prefix}/info
-+prefix ?= /usr
-+exec_prefix ?= ${prefix}
-+
-+bindir ?= ${exec_prefix}/bin
-+sbindir ?= ${exec_prefix}/sbin
-+libexecdir ?= ${exec_prefix}/libexec
-+datadir ?= ${prefix}/share
-+sysconfdir ?= ${prefix}/etc
-+sharedstatedir ?= ${prefix}/com
-+localstatedir ?= ${prefix}/var
-+libdir ?= ${exec_prefix}/lib
-+infodir ?= ${prefix}/info
- docdir = 
--includedir = ${prefix}/include
-+includedir ?= ${prefix}/include
- oldincludedir = /usr/include
--mandir = ${prefix}/man
-+mandir ?= ${prefix}/man
- 
- pkgdatadir = $(datadir)/$(PACKAGE)
- pkglibdir = $(libdir)/$(PACKAGE)
-@@ -40,8 +40,11 @@ all: $(srcdir)/$(PACKAGE)
- 
- 
- install: all installdirs
--	$(INSTALL_BIN) $(srcdir)/$(PACKAGE) $(DESTDIR)$(bindir)/$(PACKAGE)
--	$(INSTALL_BIN) $(srcdir)/modifyrepo $(DESTDIR)$(bindir)/modifyrepo
-+	sed -e "s|@DATADIR@|$(datadir)|" $(srcdir)/$(PACKAGE) > $(srcdir)/$(PACKAGE).tmp
-+	sed -e "s|@DATADIR@|$(datadir)|" $(srcdir)/modifyrepo > $(srcdir)/modifyrepo.tmp
-+	$(INSTALL_BIN) $(srcdir)/$(PACKAGE).tmp $(DESTDIR)$(bindir)/$(PACKAGE)
-+	$(INSTALL_BIN) $(srcdir)/modifyrepo.tmp $(DESTDIR)$(bindir)/modifyrepo
-+	rm -f $(srcdir)/$(PACKAGE).tmp $(srcdir)/modifyrepo.tmp
- 
- 
- uninstall:
-diff --git a/bin/createrepo b/bin/createrepo
-index b0de515..eaacb39 100755
---- a/bin/createrepo
-+++ b/bin/createrepo
-@@ -1,2 +1,2 @@
- #!/bin/sh
--exec /usr/share/createrepo/genpkgmetadata.py "$@"
-+exec @DATADIR@/createrepo/genpkgmetadata.py "$@"
-diff --git a/bin/modifyrepo b/bin/modifyrepo
-index c9732d8..6f7c1d4 100755
---- a/bin/modifyrepo
-+++ b/bin/modifyrepo
-@@ -1,2 +1,2 @@
- #!/bin/sh
--exec /usr/share/createrepo/modifyrepo.py "$@"
-+exec @DATADIR@/createrepo/modifyrepo.py "$@"
-diff --git a/docs/Makefile b/docs/Makefile
-index 0a41179..e128c85 100644
---- a/docs/Makefile
-+++ b/docs/Makefile
-@@ -1,22 +1,22 @@
- SHELL = /bin/sh
- top_srcdir = ..
- srcdir = ../docs
--prefix = /usr
--exec_prefix = ${prefix}
--
--bindir = ${exec_prefix}/bin
--sbindir = ${exec_prefix}/sbin
--libexecdir = ${exec_prefix}/libexec
--datadir = ${prefix}/share
--sysconfdir = ${prefix}/etc
--sharedstatedir = ${prefix}/com
--localstatedir = ${prefix}/var
--libdir = ${exec_prefix}/lib
--infodir = ${prefix}/info
-+prefix ?= /usr
-+exec_prefix ?= ${prefix}
-+
-+bindir ?= ${exec_prefix}/bin
-+sbindir ?= ${exec_prefix}/sbin
-+libexecdir ?= ${exec_prefix}/libexec
-+datadir ?= ${prefix}/share
-+sysconfdir ?= ${prefix}/etc
-+sharedstatedir ?= ${prefix}/com
-+localstatedir ?= ${prefix}/var
-+libdir ?= ${exec_prefix}/lib
-+infodir ?= ${prefix}/info
- docdir = 
--includedir = ${prefix}/include
-+includedir ?= ${prefix}/include
- oldincludedir = /usr/include
--mandir = ${datadir}/man
-+mandir ?= ${datadir}/man
- 
- pkgdatadir = $(datadir)/$(PACKAGE)
- pkglibdir = $(libdir)/$(PACKAGE)
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fixstat.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fixstat.patch
deleted file mode 100644
index d34eb56..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fixstat.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-When reading the mtime from disk, the system can get a floating point 
-value. Convert this to an int for comparision purposes, else some
-packages always get reindexed as the value in the index is an int.
-RP 2016/3/2
-Upstream-Status: Pending
-
-Index: createrepo-0.4.11/readMetadata.py
-===================================================================
---- createrepo-0.4.11.orig/readMetadata.py
-+++ createrepo-0.4.11/readMetadata.py
-@@ -126,7 +126,7 @@ class MetadataIndex(object):
-             if self.opts.get('verbose'):
-                 print _("Size (%i -> %i) changed for file %s") % (size,st.st_size,filepath)
-             return
--        if st.st_mtime != mtime:
-+        if int(st.st_mtime) != mtime:
-             if self.opts.get('verbose'):
-                 print _("Modification time changed for %s") % filepath
-             return
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch
deleted file mode 100644
index 80205a1..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Author: Andrei Gherzan <andrei@gherzan.ro>
-
-Python interpreter should be use from PATH - native python - and not the one from
-host.
-
-Upstream-Status: Inappropriate [configuration]
-
-Index: createrepo-0.4.11/genpkgmetadata.py
-===================================================================
---- createrepo-0.4.11.orig/genpkgmetadata.py	2012-04-10 17:14:05.278649384 +0300
-+++ createrepo-0.4.11/genpkgmetadata.py	2012-04-10 17:14:22.290648886 +0300
-@@ -1,4 +1,4 @@
--#!/usr/bin/python -t
-+#! /usr/bin/env python
- # primary functions and glue for generating the repository metadata
- #
- 
-Index: createrepo-0.4.11/modifyrepo.py
-===================================================================
---- createrepo-0.4.11.orig/modifyrepo.py	2012-04-10 17:14:09.106649272 +0300
-+++ createrepo-0.4.11/modifyrepo.py	2012-04-10 17:14:27.818648725 +0300
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#! /usr/bin/env python
- # $Id$
- #
- # This tools is used to insert arbitrary metadata into an RPM repository.
-Index: createrepo-0.4.11/dumpMetadata.py
-===================================================================
---- createrepo-0.4.11.orig/dumpMetadata.py	2012-04-10 17:19:23.874640068 +0300
-+++ createrepo-0.4.11/dumpMetadata.py	2012-04-10 17:19:34.502639756 +0300
-@@ -1,4 +1,4 @@
--#!/usr/bin/python -t
-+#! /usr/bin/env python
- # base classes and functions for dumping out package Metadata
- #
- # This program is free software; you can redistribute it and/or modify
-Index: createrepo-0.4.11/readMetadata.py
-===================================================================
---- createrepo-0.4.11.orig/readMetadata.py	2012-04-10 17:19:19.626640193 +0300
-+++ createrepo-0.4.11/readMetadata.py	2012-04-10 17:19:40.198639590 +0300
-@@ -1,4 +1,4 @@
--#!/usr/bin/python -t
-+#! /usr/bin/env python
- 
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/recommends.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/recommends.patch
deleted file mode 100644
index dc5de2b..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/recommends.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-createrepo: implement recommends support
-
-Record against the corresponding requires entry in the output metadata
-if a dependency relationship is marked with the RPMSENSE_MISSINGOK flag
-(indicating it is a recommendation, rather than a hard dependency).
-
-Upstream-Status: Pending
-
-Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-
-diff --git a/dumpMetadata.py b/dumpMetadata.py
-index 70bb2d8..e40e8ac 100644
---- a/dumpMetadata.py
-+++ b/dumpMetadata.py
-@@ -319,6 +319,23 @@ class RpmMetaData:
-                     reqs.append(0)
-         return reqs
- 
-+    def _checkMissingOk(self, flags):
-+        reqs=[]
-+        if flags is None:
-+            return reqs
-+
-+        if type(flags) is not types.ListType:
-+            flags = [flags]
-+        for flag in flags:
-+            newflag = flag
-+            if flag is not None:
-+                newflag = flag & rpm.RPMSENSE_MISSINGOK
-+                if newflag:
-+                    reqs.append(1)
-+                else:
-+                    reqs.append(0)
-+        return reqs
-+
- 
-     def _correctVersion(self, vers):
-         returnvers = []
-@@ -537,9 +554,10 @@ class RpmMetaData:
-         tmpflags = self.hdr[rpm.RPMTAG_REQUIREFLAGS]
-         flags = self._correctFlags(tmpflags)
-         prereq = self._checkPreReq(tmpflags)
-+        missingok = self._checkMissingOk(tmpflags)
-         ver = self._correctVersion(self.hdr[rpm.RPMTAG_REQUIREVERSION])
-         if names is not None:
--            lst = zip(names, flags, ver, prereq)
-+            lst = zip(names, flags, ver, prereq, missingok)
-         return self._uniq(lst)
-         
-     def obsoletesList(self):
-@@ -692,7 +710,7 @@ def generateXML(doc, node, formatns, rpmObj, sumtype):
-     depsList = rpmObj.depsList()
-     if len(depsList) > 0:
-         rpconode = format.newChild(formatns, 'requires', None)    
--        for (name, flags, (e,v,r), prereq) in depsList:
-+        for (name, flags, (e,v,r), prereq, missingok) in depsList:
-             entry = rpconode.newChild(formatns, 'entry', None)
-             entry.newProp('name', name)
-             if flags != 0:
-@@ -711,6 +729,8 @@ def generateXML(doc, node, formatns, rpmObj, sumtype):
-                     entry.newProp('rel', str(r))
-             if prereq == 1:
-                 entry.newProp('pre', str(prereq))
-+            if missingok:
-+                entry.newProp('missingok', '1')
-         
-     for file in rpmObj.usefulFiles():
-         files = format.newChild(None, 'file', None)
--- 
-1.7.9.5
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py
deleted file mode 100755
index a5b61ba..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-#
-# This script generates a solution database for a directory containing rpm packages
-# but tries to be efficient about this, only doing so when the packages have changed
-# in some way.
-#
-# It is assumed something already went through and removed all the solvedb.done stamp files
-# in advance.
-#
-# First argument - the rpm binary to use
-# Subsequent arguments - paths to process solution databases for
-#
-
-import sys, os
-import hashlib
-import stat
-import subprocess
-
-if len(sys.argv) < 1:
-    print("Error, rpm command not specified")
-    sys.exit(1)
-
-if len(sys.argv) < 2:
-    print("Error, no paths specified")
-    sys.exit(1)
-
-paths = sys.argv[2:]
-
-for path in paths:
-    if os.path.exists(path + "/solvedb.done"):
-        continue
-    data = ""
-    manifest = []
-    for root, dirs, files in os.walk(path):
-        for file in files:
-            f = os.path.join(root, file)
-            if f.startswith(path + "/" + "solvedb"):
-                continue
-            data = data + str(os.stat(f)[stat.ST_MTIME])
-            manifest.append(f)
-    checksum = hashlib.md5(data).hexdigest()
-
-    if os.path.exists(path + "/solvedb.checksum") and open(path + "/solvedb.checksum", "r").read() == checksum:
-        open(path + "/solvedb.done", "w")
-        continue
-
-    if os.path.exists(path + "/solvedb"):
-        subprocess.call("rm -rf %s" % (path + "/solvedb"), shell=True)
-    os.mkdir(path + "/solvedb")
-    m = open(path + "/solvedb/manifest", "w")
-    m.write("# Dynamically generated solve manifest\n")
-    for f in manifest:
-        m.write(f + "\n")
-    m.close()
-
-    cmd = sys.argv[1] + ' -i --replacepkgs --replacefiles --oldpackage -D "_dbpath ' + path + '/solvedb" --justdb \
-			--noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \
-			--ignoresize --nosignature --nodigest -D "__dbi_txn create nofsync" \
-			' + path + '/solvedb/manifest'
-    subprocess.call(cmd, shell=True)
-
-    open(path + "/solvedb.checksum", "w").write(checksum)
-    open(path + "/solvedb.done", "w")
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo_0.4.11.bb b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo_0.4.11.bb
deleted file mode 100644
index 2a3231b..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo_0.4.11.bb
+++ /dev/null
@@ -1,51 +0,0 @@
-SUMMARY = "Creates metadata indexes for RPM package repositories"
-HOMEPAGE = "http://createrepo.baseurl.org/"
-
-RECIPE_NO_UPDATE_REASON = "Versions after 0.9.* use YUM, so we hold at 0.4.11"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
-
-DEPENDS_class-native += "libxml2-native rpm-native"
-RDEPENDS_${PN}_class-target = "libxml2-python"
-
-PR = "r9"
-
-SRC_URI = "http://createrepo.baseurl.org/download/${BP}.tar.gz \
-           file://fix-native-install.patch \
-           file://python-scripts-should-use-interpreter-from-env.patch \
-           file://createrepo-rpm549.patch \
-           file://recommends.patch \
-           file://createrepo-dbpath.patch \
-           file://dumpMetadata-disable-signature-validation.patch \
-           file://rpm-createsolvedb.py \
-           file://fixstat.patch \
-           "
-
-SRC_URI[md5sum] = "3e9ccf4abcffe3f49af078c83611eda2"
-SRC_URI[sha256sum] = "a73ae11a0dcde8bde36d900bc3f7f8f1083ba752c70a5c61b72d1e1e7608f21b"
-
-BBCLASSEXTEND = "native"
-
-do_install () {
-	oe_runmake -e 'DESTDIR=${D}' install
-	install -m 0755 ${WORKDIR}/rpm-createsolvedb.py ${D}${bindir}/
-}
-
-# Wrap the python script since the native python is
-# ${bindir}/python-native/python, and the "#! /usr/bin/env python" can't
-# find it since it is not in PATH.
-do_install_append_class-native () {
-	# Not all the python scripts should be wrapped since some of
-	# them are modules (be imported).
-	for i in ${D}${datadir}/createrepo/genpkgmetadata.py \
-		 ${D}${datadir}/createrepo/modifyrepo.py \
-		 ${D}${bindir}/rpm-createsolvedb.py ; do
-		sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' $i
-	done
-
-	create_wrapper ${D}/${bindir}/createrepo \
-			RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
-			RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
-			RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
-}
diff --git a/import-layers/yocto-poky/meta/recipes-support/curl/curl/CVE-2017-1000100.patch b/import-layers/yocto-poky/meta/recipes-support/curl/curl/CVE-2017-1000100.patch
new file mode 100644
index 0000000..508df8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/curl/curl/CVE-2017-1000100.patch
@@ -0,0 +1,50 @@
+From 358b2b131ad6c095696f20dcfa62b8305263f898 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 1 Aug 2017 17:16:46 +0200
+Subject: [PATCH] tftp: reject file name lengths that don't fit
+
+... and thereby avoid telling send() to send off more bytes than the
+size of the buffer!
+
+CVE-2017-1000100
+
+Bug: https://curl.haxx.se/docs/adv_20170809B.html
+Reported-by: Even Rouault
+
+Credit to OSS-Fuzz for the discovery
+
+Upstream-Status: Backport
+https://github.com/curl/curl/commit/358b2b131ad6c095696f20dcfa62b8305263f898
+
+CVE: CVE-2017-1000100
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ lib/tftp.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+Index: curl-7.53.1/lib/tftp.c
+===================================================================
+--- curl-7.53.1.orig/lib/tftp.c
++++ curl-7.53.1/lib/tftp.c
+@@ -5,7 +5,7 @@
+  *                            | (__| |_| |  _ <| |___
+  *                             \___|\___/|_| \_\_____|
+  *
+- * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+  *
+  * This software is licensed as described in the file COPYING, which
+  * you should have received as part of this distribution. The terms
+@@ -490,6 +490,11 @@ static CURLcode tftp_send_first(tftp_sta
+     if(result)
+       return result;
+ 
++    if(strlen(filename) > (state->blksize - strlen(mode) - 4)) {
++      failf(data, "TFTP file name too long\n");
++      return CURLE_TFTP_ILLEGAL; /* too long file name field */
++    }
++
+     snprintf((char *)state->spacket.data+2,
+              state->blksize,
+              "%s%c%s%c", filename, '\0',  mode, '\0');
diff --git a/import-layers/yocto-poky/meta/recipes-support/curl/curl/CVE-2017-1000101.patch b/import-layers/yocto-poky/meta/recipes-support/curl/curl/CVE-2017-1000101.patch
new file mode 100644
index 0000000..9eef5e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/curl/curl/CVE-2017-1000101.patch
@@ -0,0 +1,92 @@
+From 453e7a7a03a2cec749abd3878a48e728c515cca7 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 1 Aug 2017 17:16:07 +0200
+Subject: [PATCH] glob: do not continue parsing after a strtoul() overflow
+ range
+
+Added test 1289 to verify.
+
+CVE-2017-1000101
+
+Bug: https://curl.haxx.se/docs/adv_20170809A.html
+Reported-by: Brian Carpenter
+
+Upstream-Status: Backport
+CVE: CVE-2017-1000101
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ src/tool_urlglob.c      |  5 ++++-
+ tests/data/Makefile.inc |  2 +-
+ tests/data/test1289     | 35 +++++++++++++++++++++++++++++++++++
+ 3 files changed, 40 insertions(+), 2 deletions(-)
+ create mode 100644 tests/data/test1289
+
+Index: curl-7.53.1/src/tool_urlglob.c
+===================================================================
+--- curl-7.53.1.orig/src/tool_urlglob.c
++++ curl-7.53.1/src/tool_urlglob.c
+@@ -269,7 +269,10 @@ static CURLcode glob_range(URLGlob *glob
+         }
+         errno = 0;
+         max_n = strtoul(pattern, &endp, 10);
+-        if(errno || (*endp == ':')) {
++        if(errno)
++          /* overflow */
++          endp = NULL;
++        else if(*endp == ':') {
+           pattern = endp+1;
+           errno = 0;
+           step_n = strtoul(pattern, &endp, 10);
+Index: curl-7.53.1/tests/data/Makefile.inc
+===================================================================
+--- curl-7.53.1.orig/tests/data/Makefile.inc
++++ curl-7.53.1/tests/data/Makefile.inc
+@@ -131,6 +131,7 @@ test1244 test1245 test1246 test1247 test
+ test1252 test1253 test1254 test1255 test1256 test1257 test1258 test1259 \
+ \
+ test1280 test1281 test1282 test1283 test1284 test1285 test1286 \
++test1289 \
+ \
+ test1300 test1301 test1302 test1303 test1304 test1305 test1306 test1307 \
+ test1308 test1309 test1310 test1311 test1312 test1313 test1314 test1315 \
+Index: curl-7.53.1/tests/data/test1289
+===================================================================
+--- /dev/null
++++ curl-7.53.1/tests/data/test1289
+@@ -0,0 +1,35 @@
++<testcase>
++<info>
++<keywords>
++HTTP
++HTTP GET
++globbing
++</keywords>
++</info>
++
++#
++# Server-side
++<reply>
++</reply>
++
++# Client-side
++<client>
++<server>
++http
++</server>
++<name>
++globbing with overflow and bad syntxx
++</name>
++<command>
++http://ur%20[0-60000000000000000000
++</command>
++</client>
++
++# Verify data after the test has been "shot"
++<verify>
++# curl: (3) [globbing] bad range in column 
++<errorcode>
++3
++</errorcode>
++</verify>
++</testcase>
diff --git a/import-layers/yocto-poky/meta/recipes-support/curl/curl_7.50.1.bb b/import-layers/yocto-poky/meta/recipes-support/curl/curl_7.50.1.bb
deleted file mode 100644
index 653fa2e..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/curl/curl_7.50.1.bb
+++ /dev/null
@@ -1,72 +0,0 @@
-SUMMARY = "Command line tool and library for client-side URL transfers"
-HOMEPAGE = "http://curl.haxx.se/"
-BUGTRACKER = "http://curl.haxx.se/mail/list.cgi?list=curl-tracker"
-SECTION = "console/network"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;beginline=8;md5=3a34942f4ae3fbf1a303160714e664ac"
-
-SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \
-           file://0001-replace-krb5-config-with-pkg-config.patch \
-"
-
-# curl likes to set -g0 in CFLAGS, so we stop it
-# from mucking around with debug options
-#
-SRC_URI += " file://configure_ac.patch"
-
-SRC_URI[md5sum] = "015f6a0217ca6f2c5442ca406476920b"
-SRC_URI[sha256sum] = "3c12c5f54ccaa1d40abc65d672107dcc75d3e1fcb38c267484334280096e5156"
-
-CVE_PRODUCT = "libcurl"
-inherit autotools pkgconfig binconfig multilib_header
-
-PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6", "", d)} gnutls proxy zlib"
-PACKAGECONFIG_class-native = "ipv6 proxy ssl zlib"
-PACKAGECONFIG_class-nativesdk = "ipv6 proxy ssl zlib"
-
-PACKAGECONFIG[dict] = "--enable-dict,--disable-dict,"
-PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
-PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher,"
-PACKAGECONFIG[imap] = "--enable-imap,--disable-imap,"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
-PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,"
-PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,"
-PACKAGECONFIG[libidn] = "--with-libidn,--without-libidn,libidn"
-PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
-PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3,"
-PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy,"
-PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump"
-PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp,"
-PACKAGECONFIG[smb] = "--enable-smb,--disable-smb,"
-PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp,"
-PACKAGECONFIG[ssl] = "--with-ssl --with-random=/dev/urandom,--without-ssl,openssl"
-PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet,"
-PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp,"
-PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib"
-PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5"
-
-EXTRA_OECONF = " \
-    --enable-crypto-auth \
-    --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
-    --without-libmetalink \
-    --without-libpsl \
-    --without-nghttp2 \
-"
-
-do_install_append() {
-	oe_multilib_header curl/curlbuild.h
-}
-
-do_install_append_class-target() {
-	# cleanup buildpaths from curl-config
-	sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${bindir}/curl-config
-}
-
-PACKAGES =+ "lib${BPN}"
-
-FILES_lib${BPN} = "${libdir}/lib*.so.*"
-RRECOMMENDS_lib${BPN} += "ca-certificates"
-
-FILES_${PN} += "${datadir}/zsh"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/curl/curl_7.53.1.bb b/import-layers/yocto-poky/meta/recipes-support/curl/curl_7.53.1.bb
new file mode 100644
index 0000000..c3e1f89
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/curl/curl_7.53.1.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Command line tool and library for client-side URL transfers"
+HOMEPAGE = "http://curl.haxx.se/"
+BUGTRACKER = "http://curl.haxx.se/mail/list.cgi?list=curl-tracker"
+SECTION = "console/network"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;beginline=8;md5=3a34942f4ae3fbf1a303160714e664ac"
+
+SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \
+           file://0001-replace-krb5-config-with-pkg-config.patch \
+"
+
+# curl likes to set -g0 in CFLAGS, so we stop it
+# from mucking around with debug options
+#
+SRC_URI += " file://configure_ac.patch \
+             file://CVE-2017-1000100.patch \
+             file://CVE-2017-1000101.patch \
+             "
+
+SRC_URI[md5sum] = "fb1f03a142236840c1a77c035fa4c542"
+SRC_URI[sha256sum] = "1c7207c06d75e9136a944a2e0528337ce76f15b9ec9ae4bb30d703b59bf530e8"
+
+CVE_PRODUCT = "libcurl"
+inherit autotools pkgconfig binconfig multilib_header
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} gnutls proxy threaded-resolver zlib"
+PACKAGECONFIG_class-native = "ipv6 proxy ssl threaded-resolver zlib"
+PACKAGECONFIG_class-nativesdk = "ipv6 proxy ssl threaded-resolver zlib"
+
+PACKAGECONFIG[dict] = "--enable-dict,--disable-dict,"
+PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
+PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher,"
+PACKAGECONFIG[imap] = "--enable-imap,--disable-imap,"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,"
+PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,"
+PACKAGECONFIG[libidn] = "--with-libidn,--without-libidn,libidn"
+PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
+PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3,"
+PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy,"
+PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump"
+PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp,"
+PACKAGECONFIG[smb] = "--enable-smb,--disable-smb,"
+PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp,"
+PACKAGECONFIG[ssl] = "--with-ssl --with-random=/dev/urandom,--without-ssl,openssl"
+PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet,"
+PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp,"
+PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver"
+PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib"
+PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5"
+
+EXTRA_OECONF = " \
+    --enable-crypto-auth \
+    --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
+    --without-libmetalink \
+    --without-libpsl \
+    --without-nghttp2 \
+"
+
+do_install_append() {
+	oe_multilib_header curl/curlbuild.h
+}
+
+do_install_append_class-target() {
+	# cleanup buildpaths from curl-config
+	sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${bindir}/curl-config
+}
+
+PACKAGES =+ "lib${BPN}"
+
+FILES_lib${BPN} = "${libdir}/lib*.so.*"
+RRECOMMENDS_lib${BPN} += "ca-certificates"
+
+FILES_${PN} += "${datadir}/zsh"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch b/import-layers/yocto-poky/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch
new file mode 100644
index 0000000..571708e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch
@@ -0,0 +1,45 @@
+From 29621d637e30982489693f2e207ce6a1790e3337 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Mar 2017 15:32:26 +0000
+Subject: [PATCH] atomic: Rename local __atomic_compare_exchange to avoid clash
+ with builtins
+
+Helps building with clang
+
+Fixes
+
+../db-5.3.28/src/dbinc/atomic.h:179:19: error: definition of builtin function '__atomic_compare_exchange'
+static inline int __atomic_compare_exchange(
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/dbinc/atomic.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h
+index 6a858f7..1b49de5 100644
+--- a/src/dbinc/atomic.h
++++ b/src/dbinc/atomic.h
+@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
+ #define	atomic_inc(env, p)	__atomic_inc(p)
+ #define	atomic_dec(env, p)	__atomic_dec(p)
+ #define	atomic_compare_exchange(env, p, o, n)	\
+-	__atomic_compare_exchange((p), (o), (n))
++	__db_atomic_compare_exchange((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ 	int	temp;
+@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
+  * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+  * which configure could be changed to use.
+  */
+-static inline int __atomic_compare_exchange(
++static inline int __db_atomic_compare_exchange(
+ 	db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ 	atomic_value_t was;
+-- 
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libdb-6.0.la-depend-os_map.l.patch b/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libdb-6.0.la-depend-os_map.l.patch
deleted file mode 100644
index 68a2131..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libdb-6.0.la-depend-os_map.l.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 2902dda6e3f7b2cd5796a96af20deece610e2eb9 Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Mon, 16 Nov 2015 22:20:49 -0800
-Subject: [PATCH] build_unix/Makefile: let libdb-6.0.la depend os_map.lo
-
-Fixed parallel issue:
-libtool: link: `os_map.lo' is not a valid libtool object
-Makefile:867: recipe for target 'libdb-6.0.la' failed
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- dist/Makefile.in |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: db-6.0.30/dist/Makefile.in
-===================================================================
---- db-6.0.30.orig/dist/Makefile.in
-+++ db-6.0.30/dist/Makefile.in
-@@ -863,7 +863,7 @@ $(libdb_version): $(C_OBJS)
- 	$(LN) -s $(libdb_version) $(libdb)
- 
- # Shared C library.
--$(libso_target): $(C_OBJS) bt_rec@o@
-+$(libso_target): $(C_OBJS) bt_rec@o@ os_map@o@
- 	$(SOLINK) $(SOFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
- 		$(LIBCSO_LIBS)
- 	$(RM) $(libdb)
diff --git a/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libso_target-depend-on-bt_rec.patch b/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libso_target-depend-on-bt_rec.patch
deleted file mode 100644
index 8680408..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libso_target-depend-on-bt_rec.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From c640ff9340f358a00835816d0fea03d27a7be978 Mon Sep 17 00:00:00 2001
-From: Robert Yang <liezhi.yang@windriver.com>
-Date: Tue, 31 Mar 2015 00:56:44 -0700
-Subject: [PATCH] Makefile: let libso_target depend on bt_rec
-
-Fixed parallel issue:
-libtool: link: `bt_rec.lo' is not a valid libtool object
-Makefile:867: recipe for target 'libdb-6.0.la' failed
-make: *** [libdb-6.0.la] Error 1
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
----
- Makefile.in |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: db-6.0.30/dist/Makefile.in
-===================================================================
---- db-6.0.30.orig/dist/Makefile.in
-+++ db-6.0.30/dist/Makefile.in
-@@ -863,7 +863,7 @@ $(libdb_version): $(C_OBJS)
- 	$(LN) -s $(libdb_version) $(libdb)
- 
- # Shared C library.
--$(libso_target): $(C_OBJS)
-+$(libso_target): $(C_OBJS) bt_rec@o@
- 	$(SOLINK) $(SOFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
- 		$(LIBCSO_LIBS)
- 	$(RM) $(libdb)
diff --git a/import-layers/yocto-poky/meta/recipes-support/db/db_5.3.28.bb b/import-layers/yocto-poky/meta/recipes-support/db/db_5.3.28.bb
index 0b51a1d..26065bb 100644
--- a/import-layers/yocto-poky/meta/recipes-support/db/db_5.3.28.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/db/db_5.3.28.bb
@@ -16,10 +16,12 @@
 RCONFLICTS_${PN} = "db3"
 
 PR = "r1"
+PE = "1"
 
 SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
 SRC_URI += "file://arm-thumb-mutex_db5.patch \
             file://fix-parallel-build.patch \
+            file://0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch \
            "
 
 SRC_URI[md5sum] = "b99454564d5b4479750567031d66fe24"
@@ -27,7 +29,7 @@
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=ed1158e31437f4f87cdd4ab2b8613955"
 
-inherit autotools
+inherit autotools multilib_header
 
 # Put virtual/db in any appropriate provider of a
 # relational database, use it as a dependency in
@@ -95,6 +97,8 @@
 	ln -s db51/db.h ${D}/${includedir}/db.h
 	ln -s db51/db_cxx.h ${D}/${includedir}/db_cxx.h
 
+        oe_multilib_header db51/db.h
+
 	# The docs end up in /usr/docs - not right.
 	if test -d "${D}/${prefix}/docs"
 	then
diff --git a/import-layers/yocto-poky/meta/recipes-support/db/db_6.0.35.bb b/import-layers/yocto-poky/meta/recipes-support/db/db_6.0.35.bb
deleted file mode 100644
index 0f69cab..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/db/db_6.0.35.bb
+++ /dev/null
@@ -1,113 +0,0 @@
-# Version 6 of the Berkeley DB from Oracle (formerly Sleepycat)
-#
-# At present this package only installs the DB code
-# itself (shared libraries, .a in the dev package),
-# documentation and headers.
-#
-# The headers have the same names as those as v3
-# of the DB, only one version can be used *for dev*
-# at once - DB3 and DB6 can both be installed on the
-# same system at the same time if really necessary.
-SECTION = "libs"
-SUMMARY = "Berkeley Database v6"
-HOMEPAGE = "http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
-LICENSE = "AGPL-3.0"
-VIRTUAL_NAME ?= "virtual/db"
-RCONFLICTS_${PN} = "db3"
-
-PR = "r1"
-
-# Note, when upgraded to 6.1.x, a patch in RPM will need to be removed to activate db 6.1 support.
-SRC_URI = "http://distfiles.gentoo.org/distfiles/db-${PV}.tar.gz \
-           file://arm-thumb-mutex_db5.patch \
-           file://fix-parallel-build.patch \
-           file://Makefile-let-libso_target-depend-on-bt_rec.patch \
-           file://Makefile-let-libdb-6.0.la-depend-os_map.l.patch \
-           "
-
-SRC_URI[md5sum] = "c65a4d3e930a116abaaf69edfc697f25"
-SRC_URI[sha256sum] = "24421affa8ae436fe427ae4f5f2d1634da83d3d55a5ad6354a98eeedb825de55"
-
-# Exclude NC versions which lack AES encryption
-UPSTREAM_CHECK_REGEX = "db-(?P<pver>\d+\.\d+(\.\d+)?).tar"
-UPSTREAM_CHECK_URI = "http://www.oracle.com/technetwork/products/berkeleydb/downloads/index-082944.html"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1ec8b0b17cc31513fe35ab10716f8490"
-
-# Put virtual/db in any appropriate provider of a
-# relational database, use it as a dependency in
-# place of a specific db and use:
-#
-# PREFERRED_PROVIDER_virtual/db
-#
-# to select the correct db in the build (distro) .conf
-PROVIDES += "${VIRTUAL_NAME}"
-
-inherit autotools
-
-# The executables go in a separate package - typically there
-# is no need to install these unless doing real database
-# management on the system.
-inherit lib_package
-
-PACKAGES =+ "${PN}-cxx"
-FILES_${PN}-cxx = "${libdir}/*cxx*so"
-
-# The dev package has the .so link (as in db3) and the .a's -
-# it is therefore incompatible (cannot be installed at the
-# same time) as the db3 package
-# sort out the .so since they do version prior to the .so
-SOLIBS = "-6*.so"
-FILES_SOLIBSDEV = "${libdir}/libdb.so ${libdir}/libdb_cxx.so"
-
-#configuration - set in local.conf to override
-# All the --disable-* options replace --enable-smallbuild, which breaks a bunch of stuff (eg. postfix)
-DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql"
-
-EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
-
-# Cancel the site stuff - it's set for db3 and destroys the configure.
-CONFIG_SITE = ""
-
-AUTOTOOLS_SCRIPT_PATH = "${S}/dist"
-
-do_configure() {
-	cd ${B}
-	gnu-configize --force ${AUTOTOOLS_SCRIPT_PATH}
-	oe_runconf
-}
-
-EXTRA_OEMAKE_append_class-target = " LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
-EXTRA_OEMAKE += "STRIP=true"
-
-do_compile_prepend() {
-	# Stop libtool adding RPATHs
-	sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' ${B}/libtool
-}
-
-do_install_append() {
-	mkdir -p ${D}/${includedir}/db60
-	mv ${D}/${includedir}/db.h ${D}/${includedir}/db60/.
-	mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db60/.
-	ln -s db60/db.h ${D}/${includedir}/db.h
-	ln -s db60/db_cxx.h ${D}/${includedir}/db_cxx.h
-
-	# The docs end up in /usr/docs - not right.
-	if test -d "${D}/${prefix}/docs"
-	then
-		mkdir -p "${D}/${datadir}"
-		test ! -d "${D}/${docdir}" || rm -rf "${D}/${docdir}"
-		mv "${D}/${prefix}/docs" "${D}/${docdir}"
-	fi
-
-	chown -R root:root ${D}
-}
-
-# libdb isn't versioned in the typical manner (libdb-6.0.so is the full library
-# name) so skip these checks.
-INSANE_SKIP_${PN} = "dev-so"
-INSANE_SKIP_${PN}-cxx = "dev-so"
-
-BBCLASSEXTEND = "native nativesdk"
-
-RECIPE_NO_UPDATE_REASON = "latest db does not work with RPM-5.x due to changes in locking semantics"
diff --git a/import-layers/yocto-poky/meta/recipes-support/debianutils/debianutils_4.8.1.bb b/import-layers/yocto-poky/meta/recipes-support/debianutils/debianutils_4.8.1.bb
new file mode 100644
index 0000000..12c63ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/debianutils/debianutils_4.8.1.bb
@@ -0,0 +1,54 @@
+SUMMARY = "Miscellaneous utilities specific to Debian"
+SECTION = "base"
+LICENSE = "GPLv2 & SMAIL_GPL"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=f01a5203d50512fc4830b4332b696a9f"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20161118T033019Z/pool/main/d/${BPN}/${BPN}_${PV}.tar.xz"
+# the package is taken from snapshots.debian.org; that source is static and goes stale
+# so we check the latest upstream from a directory that does get updated
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/${BPN}/"
+
+
+SRC_URI[md5sum] = "44083fc66164746880dffd30d62d054b"
+SRC_URI[sha256sum] = "2c395c0bdcfe89de30828b1d25cc5549ded5225a6d3625fbcb2cc0881ef5f026"
+
+inherit autotools update-alternatives
+
+do_configure_prepend() {
+    sed -i -e 's:tempfile.1 which.1:which.1:g' ${S}/Makefile.am
+}
+
+do_install_append() {
+    if [ "${base_bindir}" != "${bindir}" ]; then
+        # Debian places some utils into ${base_bindir} as does busybox
+        install -d ${D}${base_bindir}
+        for app in run-parts tempfile; do
+            mv ${D}${bindir}/$app ${D}${base_bindir}/$app
+        done
+    fi
+}
+
+# Note that we package the update-alternatives name.
+#
+PACKAGES =+ "${PN}-run-parts"
+FILES_${PN}-run-parts = "${base_bindir}/run-parts.debianutils"
+
+RDEPENDS_${PN} += "${PN}-run-parts"
+RDEPENDS_${PN}_class-native = ""
+
+ALTERNATIVE_PRIORITY="30"
+ALTERNATIVE_${PN} = "add-shell installkernel remove-shell savelog tempfile which"
+ALTERNATIVE_${PN}-run-parts = "run-parts"
+
+ALTERNATIVE_${PN}-doc = "which.1"
+ALTERNATIVE_LINK_NAME[which.1] = "${mandir}/man1/which.1"
+
+ALTERNATIVE_LINK_NAME[add-shell]="${sbindir}/add-shell"
+ALTERNATIVE_LINK_NAME[installkernel]="${sbindir}/installkernel"
+ALTERNATIVE_LINK_NAME[remove-shell]="${sbindir}/remove-shell"
+ALTERNATIVE_LINK_NAME[run-parts]="${base_bindir}/run-parts"
+ALTERNATIVE_LINK_NAME[savelog]="${bindir}/savelog"
+ALTERNATIVE_LINK_NAME[tempfile]="${base_bindir}/tempfile"
+ALTERNATIVE_LINK_NAME[which]="${bindir}/which"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/debianutils/debianutils_4.8.bb b/import-layers/yocto-poky/meta/recipes-support/debianutils/debianutils_4.8.bb
deleted file mode 100644
index d969fd3..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/debianutils/debianutils_4.8.bb
+++ /dev/null
@@ -1,48 +0,0 @@
-SUMMARY = "Miscellaneous utilities specific to Debian"
-SECTION = "base"
-LICENSE = "GPLv2 & SMAIL_GPL"
-LIC_FILES_CHKSUM = "file://debian/copyright;md5=f01a5203d50512fc4830b4332b696a9f"
-
-SRC_URI = "http://snapshot.debian.org/archive/debian/20160629T224408Z/pool/main/d/${BPN}/${BPN}_${PV}.tar.xz"
-# the package is taken from snapshots.debian.org; that source is static and goes stale
-# so we check the latest upstream from a directory that does get updated
-UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/${BPN}/"
-
-SRC_URI[md5sum] = "66a37e5ff17be431319bd0b43e9a46b5"
-SRC_URI[sha256sum] = "afa95bbe6b6fd3ef3c0c838b2d7232f09fabeff593ca4b5583cffa6748567ee2"
-
-inherit autotools update-alternatives
-
-do_configure_prepend() {
-    sed -i -e 's:tempfile.1 which.1:which.1:g' ${S}/Makefile.am
-}
-
-do_install_append() {
-    if [ "${base_bindir}" != "${bindir}" ]; then
-        # Debian places some utils into ${base_bindir} as does busybox
-        install -d ${D}${base_bindir}
-        for app in run-parts tempfile; do
-            mv ${D}${bindir}/$app ${D}${base_bindir}/$app
-        done
-    fi
-}
-
-# Note that we package the update-alternatives name.
-#
-PACKAGES =+ "${PN}-run-parts"
-FILES_${PN}-run-parts = "${base_bindir}/run-parts.debianutils"
-
-RDEPENDS_${PN} += "${PN}-run-parts"
-
-
-ALTERNATIVE_PRIORITY="30"
-ALTERNATIVE_${PN} = "add-shell installkernel remove-shell savelog tempfile which"
-ALTERNATIVE_${PN}-run-parts = "run-parts"
-
-ALTERNATIVE_LINK_NAME[add-shell]="${sbindir}/add-shell"
-ALTERNATIVE_LINK_NAME[installkernel]="${sbindir}/installkernel"
-ALTERNATIVE_LINK_NAME[remove-shell]="${sbindir}/remove-shell"
-ALTERNATIVE_LINK_NAME[run-parts]="${base_bindir}/run-parts"
-ALTERNATIVE_LINK_NAME[savelog]="${bindir}/savelog"
-ALTERNATIVE_LINK_NAME[tempfile]="${base_bindir}/tempfile"
-ALTERNATIVE_LINK_NAME[which]="${bindir}/which"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/ldflags.patch b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/ldflags.patch
deleted file mode 100644
index d3cb43b..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/ldflags.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Obey LDFLAGS
-
-Signed-off-by: Christopher Larson <chris_larson@mentor.com>
-Upstream-Status: Inappropriate [old version]
-
---- gdbm-1.8.3.orig/Makefile.in
-+++ gdbm-1.8.3/Makefile.in
-@@ -156,12 +156,12 @@ install-compat:
-
- libgdbm.la: $(LOBJS) gdbm.h
-	rm -f libgdbm.la
--	$(LIBTOOL) --mode=link $(CC) -o libgdbm.la -rpath $(libdir) \
-+	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libgdbm.la -rpath $(libdir) \
-		-version-info $(SHLIB_VER) $(LOBJS)
-
- libgdbm_compat.la: $(C_LOBJS) gdbm.h
-	rm -f libgdbm_compat.la
--	$(LIBTOOL) --mode=link $(CC) -o libgdbm_compat.la -rpath $(libdir) \
-+	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libgdbm_compat.la -rpath $(libdir) \
-		-version-info $(SHLIB_VER) $(C_LOBJS)
-
- gdbm.h:	gdbm.proto gdbmerrno.h gdbm.proto2
diff --git a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/libtool-mode.patch b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/libtool-mode.patch
deleted file mode 100644
index 0f9d04f..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/libtool-mode.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Upstream-Status: Pending
-
---- gdbm-1.8.3/Makefile.in.orig	2006-02-16 15:17:25.000000000 +0000
-+++ gdbm-1.8.3/Makefile.in	2006-02-16 15:18:08.000000000 +0000
-@@ -131,7 +131,7 @@
- 	$(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
- 		$(DESTDIR)$(includedir) $(DESTDIR)$(man3dir) \
- 		$(DESTDIR)$(infodir)
--	$(LIBTOOL) $(INSTALL) -c libgdbm.la $(DESTDIR)$(libdir)/libgdbm.la
-+	$(LIBTOOL) --mode=install $(INSTALL) -c libgdbm.la $(DESTDIR)$(libdir)/libgdbm.la
- 	$(INSTALL_DATA) gdbm.h \
- 		$(DESTDIR)$(includedir)/gdbm.h
- 	$(INSTALL_DATA) $(srcdir)/gdbm.3 \
-@@ -142,7 +142,7 @@
- install-compat:
- 	$(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
- 		$(DESTDIR)$(includedir)
--	$(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \
-+	$(LIBTOOL) --mode=install $(INSTALL) -c libgdbm_compat.la \
- 		$(DESTDIR)$(libdir)/libgdbm_compat.la
- 	$(INSTALL_DATA) $(srcdir)/dbm.h \
- 		$(DESTDIR)$(includedir)/dbm.h
diff --git a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/makefile.patch b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/makefile.patch
deleted file mode 100644
index 369145c..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/makefile.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-Upstream-Status: Pending
-
-#
-# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
-#
-
---- gdbm-1.8.3/Makefile.in~makefile
-+++ gdbm-1.8.3/Makefile.in
-@@ -22,6 +22,7 @@
- TEXI2DVI = texi2dvi
- 
- DEFS =
-+DESTDIR =
- 
- # Where the system [n]dbm routines are...
- LIBS = @LIBS@ -lc
-@@ -127,26 +128,26 @@
- progs: $(PROGS)
- 
- install: libgdbm.la gdbm.h gdbm.info
--	$(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
--		$(INSTALL_ROOT)$(includedir) $(INSTALL_ROOT)$(man3dir) \
--		$(INSTALL_ROOT)$(infodir)
--	$(LIBTOOL) $(INSTALL) -c libgdbm.la $(INSTALL_ROOT)$(libdir)/libgdbm.la
--	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h \
--		$(INSTALL_ROOT)$(includedir)/gdbm.h
--	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
--		$(INSTALL_ROOT)$(man3dir)/gdbm.3
--	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \
--		$(INSTALL_ROOT)$(infodir)/gdbm.info
-+	$(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
-+		$(DESTDIR)$(includedir) $(DESTDIR)$(man3dir) \
-+		$(DESTDIR)$(infodir)
-+	$(LIBTOOL) $(INSTALL) -c libgdbm.la $(DESTDIR)$(libdir)/libgdbm.la
-+	$(INSTALL_DATA) gdbm.h \
-+		$(DESTDIR)$(includedir)/gdbm.h
-+	$(INSTALL_DATA) $(srcdir)/gdbm.3 \
-+		$(DESTDIR)$(man3dir)/gdbm.3
-+	$(INSTALL_DATA) $(srcdir)/gdbm.info \
-+		$(DESTDIR)$(infodir)/gdbm.info
- 
- install-compat:
--	$(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
--		$(INSTALL_ROOT)$(includedir)
-+	$(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
-+		$(DESTDIR)$(includedir)
- 	$(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \
--		$(INSTALL_ROOT)$(libdir)/libgdbm_compat.la
--	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/dbm.h \
--		$(INSTALL_ROOT)$(includedir)/dbm.h
--	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/ndbm.h \
--		$(INSTALL_ROOT)$(includedir)/ndbm.h
-+		$(DESTDIR)$(libdir)/libgdbm_compat.la
-+	$(INSTALL_DATA) $(srcdir)/dbm.h \
-+		$(DESTDIR)$(includedir)/dbm.h
-+	$(INSTALL_DATA) $(srcdir)/ndbm.h \
-+		$(DESTDIR)$(includedir)/ndbm.h
- 
- #libgdbm.a: $(OBJS) gdbm.h
- #	rm -f libgdbm.a
diff --git a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.8.3.bb
deleted file mode 100644
index b253dc1..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.8.3.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-SUMMARY = "Key/value database library with extensible hashing"
-HOMEPAGE = "http://www.gnu.org/software/gdbm/"
-SECTION = "libs"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d8e20eece214df8ef953ed5857862150"
-
-PR = "r4"
-
-SRC_URI = "${GNU_MIRROR}/gdbm/gdbm-${PV}.tar.gz \
-	   file://makefile.patch \
-           file://libtool-mode.patch \
-           file://ldflags.patch"
-
-SRC_URI[md5sum] = "1d1b1d5c0245b1c00aff92da751e9aa1"
-SRC_URI[sha256sum] = "cc340338a2e28b40058ab9eb5354a21d53f88a1582ea21ba0bb185c37a281dc9"
-
-inherit autotools texinfo
-
-BBCLASSEXTEND = "native nativesdk"
-
-do_install_append () {
-    oe_runmake install-compat DESTDIR=${D}
-    install -d ${D}${includedir}/gdbm
-    install -m 0644 ${S}/dbm.h ${D}${includedir}/
-    install -m 0644 ${S}/ndbm.h ${D}${includedir}/
-    # Create a symlink to ndbm.h and gdbm.h in include/gdbm to let other packages to find
-    # these headers
-    ln -sf ../ndbm.h ${D}/${includedir}/gdbm/ndbm.h
-    ln -sf ../gdbm.h ${D}/${includedir}/gdbm/gdbm.h
-}
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch
deleted file mode 100644
index 627d71a..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 3cb33502bafd04b8ad4ca3454fab16d5ff313297 Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Tue, 22 Sep 2015 13:16:23 +0300
-Subject: [PATCH]  Use __gnu_inline__ attribute
-
-gcc5 uses C11 inline rules. This means the old "extern inline"
-semantics are not available without a special attribute.
-
-See: https://gcc.gnu.org/gcc-5/porting_to.html
-
-Upstream-Status: Inappropriate [Fixed in current versions]
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
----
- gmp-h.in | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/gmp-h.in b/gmp-h.in
-index eed6fe4..361dd1d 100644
---- a/gmp-h.in
-+++ b/gmp-h.in
-@@ -419,8 +419,11 @@ typedef __mpq_struct *mpq_ptr;
- /* gcc has __inline__ in all modes, including strict ansi.  Give a prototype
-    for an inline too, so as to correctly specify "dllimport" on windows, in
-    case the function is called rather than inlined.  */
-+
-+/* Use __gnu_inline__ attribute: later gcc uses different "extern inline"
-+   behaviour */
- #ifdef __GNUC__
--#define __GMP_EXTERN_INLINE      extern __inline__
-+#define __GMP_EXTERN_INLINE      extern __inline__ __attribute__ ((__gnu_inline__))
- #define __GMP_INLINE_PROTOTYPES  1
- #endif
- 
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch
deleted file mode 100644
index 6da0be9..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From d50686de0406a88ef9112f5252103f799982e84a Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <armccurdy@gmail.com>
-Date: Thu, 4 Feb 2016 14:00:00 -0800
-Subject: [PATCH] avoid h asm constraint for MIPS
-
-The h asm constrain (to extract the high part of a multiplication
-result) has not been recognised since gcc 4.4:
-
-  https://gcc.gnu.org/gcc-4.4/changes.html
-
-Drop the MIPS umul_ppmm() implementations which rely on "=h" and fall
-back to the older implementations (which use explicit mfhi and mflo
-instructions to move the high and low parts of the multiplication
-result into their destinations).
-
-Upstream-Status: Inappropriate [upstream has a different solution]
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
----
- longlong.h | 10 ----------
- 1 file changed, 10 deletions(-)
-
-diff --git a/longlong.h b/longlong.h
-index b53fbee..0193abb 100644
---- a/longlong.h
-+++ b/longlong.h
-@@ -1011,27 +1011,17 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO ((UWtype *, UWtype, UWtype, UWtype));
- #endif /* __m88000__ */
- 
- #if defined (__mips) && W_TYPE_SIZE == 32
--#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
--#define umul_ppmm(w1, w0, u, v) \
--  __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
--#else
- #define umul_ppmm(w1, w0, u, v) \
-   __asm__ ("multu %2,%3\n\tmflo %0\n\tmfhi %1"				\
- 	   : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
--#endif
- #define UMUL_TIME 10
- #define UDIV_TIME 100
- #endif /* __mips */
- 
- #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
--#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
--#define umul_ppmm(w1, w0, u, v) \
--  __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
--#else
- #define umul_ppmm(w1, w0, u, v) \
-   __asm__ ("dmultu %2,%3\n\tmflo %0\n\tmfhi %1"				\
- 	   : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
--#endif
- #define UMUL_TIME 20
- #define UDIV_TIME 140
- #endif /* __mips */
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch
deleted file mode 100644
index 26fd8ef..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-automake 1.12 has depricated automatic de-ANSI-fication support
-
-this patch avoids these kinds of errors:
-
-| configure.in:2240: error: automatic de-ANSI-fication support has been removed
-| Makefile.am:28: error: automatic de-ANSI-fication support has been removed
-
-Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
-2012/05/02
-
-
-This patch was removed in f181c6ce8b3 when gmp 4.2.1 was mistakenly
-dropped.
-
-Upstream is not interested in patches for ancient versions.
-
-Upstream-Status: Inappropriate
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-
-
-Index: gmp-4.2.1/configure.in
-===================================================================
---- gmp-4.2.1.orig/configure.in
-+++ gmp-4.2.1/configure.in
-@@ -67,7 +67,7 @@ dnl
- dnl  Note that there's a copy of these options in the top-level Makefile.am,
- dnl  so update there too if changing anything.
- dnl
--AM_INIT_AUTOMAKE([1.8 gnu no-dependencies $(top_builddir)/ansi2knr])
-+AM_INIT_AUTOMAKE([1.8 gnu no-dependencies])
- AM_CONFIG_HEADER(config.h:config.in)
- AM_MAINTAINER_MODE
- 
-@@ -2022,9 +2022,6 @@ fi
- echo "      MPN_PATH=\"$path\""
- 
- 
--# Automake ansi2knr support.
--AM_C_PROTOTYPES
--
- GMP_PROG_AR
- GMP_PROG_NM
- 
-Index: gmp-4.2.1/Makefile.am
-===================================================================
---- gmp-4.2.1.orig/Makefile.am
-+++ gmp-4.2.1/Makefile.am
-@@ -27,7 +27,7 @@
- # Makefiles in subdirectories, but here we must omit it so automake gives
- # the actual ansi2knr build rule, not "cd $(top_builddir) && make ansi2knr".
- #
--AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies ansi2knr
-+AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies
- 
- 
- # Libtool -version-info for libgmp.la and libmp.la.  See "Versioning" in the
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.1/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.2/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.1/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch
rename to import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.2/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.1/0001-confiure.ac-Believe-the-cflags-from-environment.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.2/0001-confiure.ac-Believe-the-cflags-from-environment.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.1/0001-confiure.ac-Believe-the-cflags-from-environment.patch
rename to import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.2/0001-confiure.ac-Believe-the-cflags-from-environment.patch
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.1/amd64.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.2/amd64.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.1/amd64.patch
rename to import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.2/amd64.patch
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.1/use-includedir.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.2/use-includedir.patch
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.1/use-includedir.patch
rename to import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.2/use-includedir.patch
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb
deleted file mode 100644
index 5e8ee29..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-require gmp.inc
-
-LICENSE = "LGPLv2.1+ & GPLv2+"
-LICENSE_${PN} = "LGPLv2.1+"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a \
-                    file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \
-                    file://gmp-h.in;beginline=6;endline=21;md5=e056f74a12c3277d730dbcfb85d2ca34"
-
-SRC_URI = "https://gmplib.org/download/${BPN}/archive/${BP}.tar.bz2 \
-           file://Use-__gnu_inline__-attribute.patch \
-           file://gmp_fix_for_automake-1.12.patch \
-           file://avoid-h-asm-constraint-for-MIPS.patch \
-"
-
-SRC_URI[md5sum] = "091c56e0e1cca6b09b17b69d47ef18e3"
-SRC_URI[sha256sum] = "d07ffcb37eecec35c5ec72516d10b35fdf6e6fef1fcf1dcd37e30b8cbf8bf941"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.1.bb b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.1.bb
deleted file mode 100644
index 614d21a..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.1.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-require gmp.inc
-
-LICENSE = "GPLv2+ | LGPLv3+"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
-                   file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \
-                   file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-"
-
-REVISION = ""
-SRC_URI = "https://gmplib.org/download/${BPN}/${BP}${REVISION}.tar.bz2 \
-           file://amd64.patch \
-           file://use-includedir.patch \
-           file://0001-Append-the-user-provided-flags-to-the-auto-detected-.patch \
-           file://0001-confiure.ac-Believe-the-cflags-from-environment.patch \
-           "
-
-SRC_URI[md5sum] = "4c175f86e11eb32d8bf9872ca3a8e11d"
-SRC_URI[sha256sum] = "a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6"
-
-acpaths = ""
-
-EXTRA_OECONF += " --enable-cxx=detect"
-EXTRA_OECONF_mipsarchr6_append = " --disable-assembly"
-
-PACKAGES =+ "libgmpxx"
-FILES_libgmpxx = "${libdir}/libgmpxx${SOLIBS}"
-
-do_install_append_class-target() {
-        sed -i "s|--sysroot=${STAGING_DIR_HOST}||g" ${D}${includedir}/gmp.h
-}
-
-SSTATE_SCAN_FILES += "gmp.h"
-
-# Doesn't compile in MIPS16e mode due to use of hand-written
-# assembly
-MIPS_INSTRUCTION_SET = "mips"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.2.bb b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.2.bb
new file mode 100644
index 0000000..5e65075
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.2.bb
@@ -0,0 +1,38 @@
+require gmp.inc
+
+LICENSE = "GPLv2+ | LGPLv3+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                   file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \
+                   file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+"
+
+REVISION = ""
+SRC_URI = "https://gmplib.org/download/${BPN}/${BP}${REVISION}.tar.bz2 \
+           file://amd64.patch \
+           file://use-includedir.patch \
+           file://0001-Append-the-user-provided-flags-to-the-auto-detected-.patch \
+           file://0001-confiure.ac-Believe-the-cflags-from-environment.patch \
+           "
+SRC_URI[md5sum] = "8ddbb26dc3bd4e2302984debba1406a5"
+SRC_URI[sha256sum] = "5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2"
+
+acpaths = ""
+
+EXTRA_OECONF += " --enable-cxx=detect"
+EXTRA_OECONF_mipsarchr6_append = " --disable-assembly"
+
+PACKAGES =+ "libgmpxx"
+FILES_libgmpxx = "${libdir}/libgmpxx${SOLIBS}"
+
+do_install_append_class-target() {
+        sed -i "s|--sysroot=${STAGING_DIR_HOST}||g" ${D}${includedir}/gmp.h
+}
+
+SSTATE_SCAN_FILES += "gmp.h"
+
+# Doesn't compile in MIPS16e mode due to use of hand-written
+# assembly
+MIPS_INSTRUCTION_SET = "mips"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4242.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4242.patch
deleted file mode 100644
index f066774..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4242.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From e2202ff2b704623efc6277fb5256e4e15bac5676 Mon Sep 17 00:00:00 2001
-From: Werner Koch <wk@gnupg.org>
-Date: Thu, 25 Jul 2013 11:17:52 +0200
-Subject: [PATCH] Mitigate a flush+reload cache attack on RSA secret
- exponents.
-
-commit e2202ff2b704623efc6277fb5256e4e15bac5676 from
-git://git.gnupg.org/libgcrypt.git
-
-* mpi/mpi-pow.c (gcry_mpi_powm): Always perfrom the mpi_mul for
-exponents in secure memory.
-
-Upstream-Status: Backport
-CVE: CVE-2013-4242
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
-
-The attack is published as http://eprint.iacr.org/2013/448 :
-
-Flush+Reload: a High Resolution, Low Noise, L3 Cache Side-Channel
-Attack by Yuval Yarom and Katrina Falkner. 18 July 2013.
-
-  Flush+Reload is a cache side-channel attack that monitors access to
-  data in shared pages. In this paper we demonstrate how to use the
-  attack to extract private encryption keys from GnuPG.  The high
-  resolution and low noise of the Flush+Reload attack enables a spy
-  program to recover over 98% of the bits of the private key in a
-  single decryption or signing round. Unlike previous attacks, the
-  attack targets the last level L3 cache. Consequently, the spy
-  program and the victim do not need to share the execution core of
-  the CPU. The attack is not limited to a traditional OS and can be
-  used in a virtualised environment, where it can attack programs
-  executing in a different VM.
-
-Index: gnupg-1.4.7/mpi/mpi-pow.c
-===================================================================
---- gnupg-1.4.7.orig/mpi/mpi-pow.c
-+++ gnupg-1.4.7/mpi/mpi-pow.c
-@@ -212,7 +212,13 @@ mpi_powm( MPI res, MPI base, MPI exponen
- 		tp = rp; rp = xp; xp = tp;
- 		rsize = xsize;
- 
--		if( (mpi_limb_signed_t)e < 0 ) {
-+            /* To mitigate the Yarom/Falkner flush+reload cache
-+             * side-channel attack on the RSA secret exponent, we do
-+             * the multiplication regardless of the value of the
-+             * high-bit of E.  But to avoid this performance penalty
-+             * we do it only if the exponent has been stored in secure
-+             * memory and we can thus assume it is a secret exponent.  */
-+		if (esec || (mpi_limb_signed_t)e < 0) {
- 		    /*mpihelp_mul( xp, rp, rsize, bp, bsize );*/
- 		    if( bsize < KARATSUBA_THRESHOLD ) {
- 			mpihelp_mul( xp, rp, rsize, bp, bsize );
-@@ -227,6 +233,8 @@ mpi_powm( MPI res, MPI base, MPI exponen
- 			mpihelp_divrem(xp + msize, 0, xp, xsize, mp, msize);
- 			xsize = msize;
- 		    }
-+		}
-+		if ( (mpi_limb_signed_t)e < 0 ) {
- 
- 		    tp = rp; rp = xp; xp = tp;
- 		    rsize = xsize;
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch
deleted file mode 100644
index b50a32f..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-Upstream-Status: Backport
-CVE: CVE-2013-4351
-
-Index: gnupg-1.4.7/g10/getkey.c
-===================================================================
---- gnupg-1.4.7.orig/g10/getkey.c	2007-03-05 16:54:41.000000000 +0800
-+++ gnupg-1.4.7/g10/getkey.c	2013-11-28 14:41:59.640212240 +0800
-@@ -1454,7 +1454,11 @@
- 
-       if(flags)
- 	key_usage |= PUBKEY_USAGE_UNKNOWN;
-+      if (!key_usage)
-+	key_usage |= PUBKEY_USAGE_NONE;
-     }
-+  else if (p)
-+    key_usage |= PUBKEY_USAGE_NONE;
- 
-   /* We set PUBKEY_USAGE_UNKNOWN to indicate that this key has a
-      capability that we do not handle.  This serves to distinguish
-Index: gnupg-1.4.7/g10/keygen.c
-===================================================================
---- gnupg-1.4.7.orig/g10/keygen.c	2007-02-05 00:27:40.000000000 +0800
-+++ gnupg-1.4.7/g10/keygen.c	2013-11-28 14:43:05.016670092 +0800
-@@ -209,9 +209,6 @@
-     if (use & PUBKEY_USAGE_AUTH)
-         buf[0] |= 0x20;
- 
--    if (!buf[0]) 
--        return;
--
-     build_sig_subpkt (sig, SIGSUBPKT_KEY_FLAGS, buf, 1);
- }
- 
-Index: gnupg-1.4.7/include/cipher.h
-===================================================================
---- gnupg-1.4.7.orig/include/cipher.h	2006-04-21 20:39:49.000000000 +0800
-+++ gnupg-1.4.7/include/cipher.h	2013-11-28 14:49:24.159322744 +0800
-@@ -52,6 +52,7 @@
- #define PUBKEY_USAGE_CERT    4      /* key is also good to certify other keys*/
- #define PUBKEY_USAGE_AUTH    8      /* key is good for authentication */
- #define PUBKEY_USAGE_UNKNOWN 128    /* key has an unknown usage bit */
-+#define PUBKEY_USAGE_NONE    256    /* No usage given. */
- 
- #define DIGEST_ALGO_MD5       1
- #define DIGEST_ALGO_SHA1      2
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4576.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4576.patch
deleted file mode 100644
index 5dcde1f..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4576.patch
+++ /dev/null
@@ -1,154 +0,0 @@
-Upstream-Status: Backport
-CVE: CVE-2013-4576
-
-Index: gnupg-1.4.7/cipher/dsa.c
-===================================================================
---- gnupg-1.4.7.orig/cipher/dsa.c	2006-12-12 02:27:21.000000000 +0800
-+++ gnupg-1.4.7/cipher/dsa.c	2014-01-23 11:30:17.300915919 +0800
-@@ -287,6 +287,8 @@
-     MPI kinv;
-     MPI tmp;
- 
-+    mpi_normalize (hash);
-+
-     /* select a random k with 0 < k < q */
-     k = gen_k( skey->q );
- 
-Index: gnupg-1.4.7/cipher/elgamal.c
-===================================================================
---- gnupg-1.4.7.orig/cipher/elgamal.c	2006-12-12 03:08:05.000000000 +0800
-+++ gnupg-1.4.7/cipher/elgamal.c	2014-01-23 11:30:17.300915919 +0800
-@@ -376,6 +376,9 @@
- {
-     MPI t1 = mpi_alloc_secure( mpi_get_nlimbs( skey->p ) );
- 
-+    mpi_normalize (a);
-+    mpi_normalize (b);
-+
-     /* output = b/(a^x) mod p */
-     mpi_powm( t1, a, skey->x, skey->p );
-     mpi_invm( t1, t1, skey->p );
-Index: gnupg-1.4.7/cipher/random.c
-===================================================================
---- gnupg-1.4.7.orig/cipher/random.c	2006-11-03 18:09:39.000000000 +0800
-+++ gnupg-1.4.7/cipher/random.c	2014-01-23 11:31:53.993495462 +0800
-@@ -273,6 +273,18 @@
- }
- 
- 
-+/* Randomize the MPI */ 
-+void
-+randomize_mpi (MPI mpi, size_t nbits, int level)
-+{
-+  unsigned char *buffer;
-+
-+  buffer = get_random_bits (nbits, level, mpi_is_secure (mpi));
-+  mpi_set_buffer (mpi, buffer, (nbits+7)/8, 0);
-+  xfree (buffer);
-+}
-+
-+
- int
- random_is_faked()
- {
-Index: gnupg-1.4.7/cipher/random.h
-===================================================================
---- gnupg-1.4.7.orig/cipher/random.h	2006-02-09 19:29:29.000000000 +0800
-+++ gnupg-1.4.7/cipher/random.h	2014-01-23 11:30:17.300915919 +0800
-@@ -32,6 +32,7 @@
- int  random_is_faked(void);
- void random_disable_locking (void);
- void randomize_buffer( byte *buffer, size_t length, int level );
-+void randomize_mpi (MPI mpi, size_t nbits, int level);
- byte *get_random_bits( size_t nbits, int level, int secure );
- void fast_random_poll( void );
- 
-Index: gnupg-1.4.7/cipher/rsa.c
-===================================================================
---- gnupg-1.4.7.orig/cipher/rsa.c	2006-12-12 03:09:00.000000000 +0800
-+++ gnupg-1.4.7/cipher/rsa.c	2014-01-23 11:35:04.330639125 +0800
-@@ -301,9 +301,26 @@
- #if 0
-     mpi_powm( output, input, skey->d, skey->n );
- #else
--    MPI m1   = mpi_alloc_secure( mpi_get_nlimbs(skey->n)+1 );
--    MPI m2   = mpi_alloc_secure( mpi_get_nlimbs(skey->n)+1 );
--    MPI h    = mpi_alloc_secure( mpi_get_nlimbs(skey->n)+1 );
-+    int nlimbs = mpi_get_nlimbs (skey->n)+1;
-+    MPI m1   = mpi_alloc_secure (nlimbs);
-+    MPI m2   = mpi_alloc_secure (nlimbs);
-+    MPI h    = mpi_alloc_secure (nlimbs);
-+# if 1
-+    MPI bdata= mpi_alloc_secure (nlimbs);
-+    MPI r    = mpi_alloc_secure (nlimbs);
-+# endif
-+
-+    /* Remove superfluous leading zeroes from INPUT.  */
-+    mpi_normalize (input);
-+
-+# if 1 
-+    /* Blind:  bdata = (data * r^e) mod n   */
-+    randomize_mpi (r, mpi_get_nbits (skey->n), 0);
-+    mpi_fdiv_r (r, r, skey->n);
-+    mpi_powm (bdata, r, skey->e, skey->n);
-+    mpi_mulm (bdata, bdata, input, skey->n);
-+    input = bdata;
-+# endif
- 
-     /* m1 = c ^ (d mod (p-1)) mod p */
-     mpi_sub_ui( h, skey->p, 1  );
-@@ -321,8 +338,15 @@
-     /* m = m2 + h * p */
-     mpi_mul ( h, h, skey->p );
-     mpi_add ( output, m1, h );
--    /* ready */
--    
-+
-+# if 1
-+    mpi_free (bdata);
-+    /* Unblind: output = (output * r^(-1)) mod n  */
-+    mpi_invm (r, r, skey->n);
-+    mpi_mulm (output, output, r, skey->n);
-+    mpi_free (r);
-+# endif
-+
-     mpi_free ( h );
-     mpi_free ( m1 );
-     mpi_free ( m2 );
-@@ -397,6 +421,7 @@
- rsa_decrypt( int algo, MPI *result, MPI *data, MPI *skey )
- {
-     RSA_secret_key sk;
-+    MPI input;
- 
-     if( algo != 1 && algo != 2 )
- 	return G10ERR_PUBKEY_ALGO;
-@@ -407,8 +432,14 @@
-     sk.p = skey[3];
-     sk.q = skey[4];
-     sk.u = skey[5];
--    *result = mpi_alloc_secure( mpi_get_nlimbs( sk.n ) );
--    secret( *result, data[0], &sk );
-+
-+    /* Mitigates side-channel attacks (CVE-2013-4576).  */
-+    input = mpi_alloc (0);
-+    mpi_normalize (data[0]);
-+    mpi_fdiv_r (input, data[0], sk.n);
-+    *result = mpi_alloc_secure (mpi_get_nlimbs (sk.n));
-+    secret (*result, input, &sk);
-+    mpi_free (input);
-     return 0;
- }
- 
-Index: gnupg-1.4.7/g10/gpgv.c
-===================================================================
---- gnupg-1.4.7.orig/g10/gpgv.c	2006-12-13 19:25:04.000000000 +0800
-+++ gnupg-1.4.7/g10/gpgv.c	2014-01-23 11:30:17.300915919 +0800
-@@ -390,6 +390,7 @@
- void random_dump_stats(void) {}
- int quick_random_gen( int onoff ) { return -1;}
- void randomize_buffer( byte *buffer, size_t length, int level ) {}
-+void randomize_mpi (MPI mpi, size_t nbits, int level) {}
- int random_is_faked() { return -1;}
- byte *get_random_bits( size_t nbits, int level, int secure ) { return NULL;}
- void set_random_seed_file( const char *name ) {}
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/GnuPG1-CVE-2012-6085.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/GnuPG1-CVE-2012-6085.patch
deleted file mode 100644
index 3627176..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/GnuPG1-CVE-2012-6085.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-commit f0b33b6fb8e0586e9584a7a409dcc31263776a67
-Author: Werner Koch <wk@gnupg.org>
-Date:   Thu Dec 20 09:43:41 2012 +0100
-
-    gpg: Import only packets which are allowed in a keyblock.
-    
-    * g10/import.c (valid_keyblock_packet): New.
-    (read_block): Store only valid packets.
-    --
-    
-    A corrupted key, which for example included a mangled public key
-    encrypted packet, used to corrupt the keyring.  This change skips all
-    packets which are not allowed in a keyblock.
-    
-    GnuPG-bug-id: 1455
-    
-    (cherry-picked from commit f795a0d59e197455f8723c300eebf59e09853efa)
-
-Upstream-Status: Backport
-CVE: CVE-2012-6085
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-diff --git a/g10/import.c b/g10/import.c
-index bfe02eb..a57b32e 100644
---- a/g10/import.c
-+++ b/g10/import.c
-@@ -384,6 +384,27 @@ import_print_stats (void *hd)
- }
- 
- 
-+/* Return true if PKTTYPE is valid in a keyblock.  */
-+static int
-+valid_keyblock_packet (int pkttype)
-+{
-+  switch (pkttype)
-+    {
-+    case PKT_PUBLIC_KEY:
-+    case PKT_PUBLIC_SUBKEY:
-+    case PKT_SECRET_KEY:
-+    case PKT_SECRET_SUBKEY:
-+    case PKT_SIGNATURE:
-+    case PKT_USER_ID:
-+    case PKT_ATTRIBUTE:
-+    case PKT_RING_TRUST:
-+      return 1;
-+    default:
-+      return 0;
-+    }
-+}
-+
-+
- /****************
-  * Read the next keyblock from stream A.
-  * PENDING_PKT should be initialzed to NULL
-@@ -461,7 +482,7 @@ read_block( IOBUF a, PACKET **pending_pkt, KBNODE *ret_root )
- 	    }
- 	    in_cert = 1;
- 	  default:
--	    if( in_cert ) {
-+	    if (in_cert && valid_keyblock_packet (pkt->pkttype)) {
- 		if( !root )
- 		    root = new_kbnode( pkt );
- 		else
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/configure.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/configure.patch
deleted file mode 100644
index e005ac6..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/configure.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-Index: gnupg-1.4.7/configure.ac
-===================================================================
---- gnupg-1.4.7.orig/configure.ac
-+++ gnupg-1.4.7/configure.ac
-@@ -827,7 +827,6 @@ else
-   AC_SUBST(USE_NLS)
-   AC_SUBST(USE_INCLUDED_LIBINTL)
-   AC_SUBST(BUILD_INCLUDED_LIBINTL)
--  AM_PO_SUBDIRS
- fi
- 
- if test "$try_extensions" = yes || test x"$card_support" = xyes ; then
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/curl_typeof_fix_backport.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/curl_typeof_fix_backport.patch
deleted file mode 100644
index e5fb24a..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/curl_typeof_fix_backport.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-
-This has been discussed in a couple of different bug reported
-upstream:
-
-http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=486250
-http://bugs.sourcemage.org/show_bug.cgi?id=14446
-
-Fix:
-http://lists.gnupg.org/pipermail/gnupg-devel/2008-April/024344.html
-
-Upstream-Status: Backport [Debian]
-
-Signed-off-by: Saul Wold <sgw@linux.intel.com>
-
-Index: gnupg-1.4.7/keyserver/gpgkeys_curl.c
-===================================================================
---- gnupg-1.4.7.orig/keyserver/gpgkeys_curl.c
-+++ gnupg-1.4.7/keyserver/gpgkeys_curl.c
-@@ -286,7 +286,7 @@ main(int argc,char *argv[])
-       curl_easy_setopt(curl,CURLOPT_VERBOSE,1);
-     }
- 
--  curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,opt->flags.check_cert);
-+  curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,(long)opt->flags.check_cert);
-   curl_easy_setopt(curl,CURLOPT_CAINFO,opt->ca_cert_file);
- 
-   if(proxy)
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/long-long-thumb.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/long-long-thumb.patch
deleted file mode 100644
index 2855cab..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/long-long-thumb.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Orignal Patch came from OpenWrt via OE-Classic
-https://dev.openwrt.org/browser/packages/utils/gnupg/patches/001-mips_gcc4.4
-which is no longer a valid revision!
-
-Upstream-Status: Inappropriate [configuration]
-
-
---- gnupg/mpi/longlong.h~      2006-02-14 10:09:55.000000000 +0000
-+++ gnupg/mpi/longlong.h       2008-10-27 13:11:09.000000000 +0000
-@@ -181,7 +181,7 @@
- /***************************************
-  **************  ARM  ******************
-  ***************************************/
--#if defined (__arm__) && W_TYPE_SIZE == 32
-+#if defined (__arm__) && W_TYPE_SIZE == 32 && !defined(__thumb__)
- #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
-   __asm__ ("adds %1, %4, %5\n"                                          \
-          "adc  %0, %2, %3"                                            \
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/mips_gcc4.4.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/mips_gcc4.4.patch
deleted file mode 100644
index 9a03b2b..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/mips_gcc4.4.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-
-From Openembedded-Classic
-
-    gnupg-1.4.10: Readd the ARM Thumb patch as debian has no thumb support
-
-
-Upstream-Status: Inappropriate [embedded-specific]
-
-Index: gnupg-1.4.10/mpi/longlong.h
-===================================================================
---- gnupg-1.4.10.orig/mpi/longlong.h	2008-12-11 17:39:43.000000000 +0100
-+++ gnupg-1.4.10/mpi/longlong.h	2010-03-27 14:27:53.000000000 +0100
-@@ -706,18 +706,35 @@
- #endif /* __m88110__ */
- #endif /* __m88000__ */
- 
-+/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
-+#if defined (__GNUC__) && defined (__GNUC_MINOR__)
-+#define __GNUC_PREREQ(maj, min) \
-+	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-+#else
-+#define __GNUC_PREREQ(maj, min)  0
-+#endif
-+
- /***************************************
-  **************  MIPS  *****************
-  ***************************************/
- #if defined (__mips__) && W_TYPE_SIZE == 32
--#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
-+#if __GNUC_PREREQ (4,4)
-+#define umul_ppmm(w1, w0, u, v) \
-+  do {                                                                 \
-+	UDItype __ll = (UDItype)(u) * (v);                                 \
-+	w1 = __ll >> 32;                                                   \
-+	w0 = __ll;                                                         \
-+  } while (0)
-+#endif
-+#if !defined (umul_ppmm) && __GNUC_PREREQ (2,7)
- #define umul_ppmm(w1, w0, u, v) \
-   __asm__ ("multu %2,%3"                                                \
- 	   : "=l" ((USItype)(w0)),                                      \
- 	     "=h" ((USItype)(w1))                                       \
- 	   : "d" ((USItype)(u)),                                        \
- 	     "d" ((USItype)(v)))
--#else
-+#endif
-+#if !defined (umul_ppmm)
- #define umul_ppmm(w1, w0, u, v) \
-   __asm__ ("multu %2,%3 \n" \
- 	   "mflo %0 \n"     \
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_1.4.7.bb b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_1.4.7.bb
deleted file mode 100644
index 6ccffd5..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_1.4.7.bb
+++ /dev/null
@@ -1,104 +0,0 @@
-SUMMARY = "GNU Privacy Guard - encryption and signing tools"
-HOMEPAGE = "http://www.gnupg.org/"
-DEPENDS = "zlib bzip2 readline"
-SECTION = "console/utils"
-
-LICENSE = "GPLv2"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
-
-PR = "r9"
-
-SRC_URI = "${GNUPG_MIRROR}/gnupg/gnupg-${PV}.tar.bz2 \
-           file://long-long-thumb.patch \
-           file://configure.patch \
-           file://mips_gcc4.4.patch \
-           file://GnuPG1-CVE-2012-6085.patch \
-           file://curl_typeof_fix_backport.patch \
-           file://CVE-2013-4351.patch \
-           file://CVE-2013-4576.patch \
-           file://CVE-2013-4242.patch \
-	  "
-
-SRC_URI[md5sum] = "b06a141cca5cd1a55bbdd25ab833303c"
-SRC_URI[sha256sum] = "69d18b7d193f62ca27ed4febcb4c9044aa0c95305d3258fe902e2fae5fc6468d"
-
-inherit autotools gettext texinfo
-
-#   --with-egd-socket=NAME  use NAME for the EGD socket
-#   --with-photo-viewer=FIXED_VIEWER  set a fixed photo ID viewer
-#   --with-included-zlib    use the zlib code included here
-#   --with-capabilities     use linux capabilities default=no
-#   --with-mailprog=NAME    use "NAME -t" for mail transport
-#   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
-#   --without-libiconv-prefix     don't search for libiconv in includedir and libdir
-#   --with-included-gettext use the GNU gettext library included here
-#   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
-#   --without-libintl-prefix     don't search for libintl in includedir and libdir
-#   --without-readline      do not support fancy command line editing
-#   --with-included-regex   use the included GNU regex library
-#   --with-zlib=DIR         use libz in DIR
-#   --with-bzip2=DIR        look for bzip2 in DIR
-#   --enable-static-rnd=egd|unix|linux|auto
-#   --disable-dev-random    disable the use of dev random
-#   --disable-asm           do not use assembler modules
-#   --enable-m-guard        enable memory guard facility
-#   --enable-selinux-support
-#                           enable SELinux support
-#   --disable-card-support  disable OpenPGP card support
-#   --disable-gnupg-iconv   disable the new iconv code
-#   --enable-backsigs       enable the experimental backsigs code
-#   --enable-minimal        build the smallest gpg binary possible
-#   --disable-rsa           disable the RSA public key algorithm
-#   --disable-idea          disable the IDEA cipher
-#   --disable-cast5         disable the CAST5 cipher
-#   --disable-blowfish      disable the BLOWFISH cipher
-#   --disable-aes           disable the AES, AES192, and AES256 ciphers
-#   --disable-twofish       disable the TWOFISH cipher
-#   --disable-sha256        disable the SHA-256 digest
-#   --disable-sha512        disable the SHA-384 and SHA-512 digests
-#   --disable-bzip2         disable the BZIP2 compression algorithm
-#   --disable-exec          disable all external program execution
-#   --disable-photo-viewers disable photo ID viewers
-#   --disable-keyserver-helpers  disable all external keyserver support
-#   --disable-ldap          disable LDAP keyserver interface
-#   --disable-hkp           disable HKP keyserver interface
-#   --disable-http          disable HTTP key fetching interface
-#   --disable-finger        disable Finger key fetching interface
-#   --disable-mailto        disable email keyserver interface
-#   --disable-keyserver-path disable the exec-path option for keyserver helpers
-#   --enable-key-cache=SIZE Set key cache to SIZE (default 4096)
-#   --disable-largefile     omit support for large files
-#   --disable-dns-srv       disable the use of DNS SRV in HKP and HTTP
-#   --disable-nls           do not use Native Language Support
-#   --disable-regex         do not handle regular expressions in trust sigs
-
-EXTRA_OECONF = "--disable-ldap \
-		--with-zlib=${STAGING_LIBDIR}/.. \
-		--with-bzip2=${STAGING_LIBDIR}/.. \
-		--disable-selinux-support \
-                --with-readline=${STAGING_LIBDIR}/.. \
-                ac_cv_sys_symbol_underscore=no \
-		"
-
-# Force gcc's traditional handling of inline to avoid issues with gcc 5
-CFLAGS += "-fgnu89-inline"
-
-do_install () {
-	autotools_do_install
-	install -d ${D}${docdir}/${BPN}
-	mv ${D}${datadir}/${BPN}/* ${D}/${docdir}/${BPN}/ || :
-	mv ${D}${prefix}/doc/* ${D}/${docdir}/${BPN}/ || :
-}
-
-# split out gpgv from main package
-RDEPENDS_${PN} = "gpgv"
-PACKAGES =+ "gpgv"
-FILES_gpgv = "${bindir}/gpgv"
-
-# Exclude debug files from the main packages
-FILES_${PN} = "${bindir}/* ${datadir}/${BPN} ${libexecdir}/${BPN}/*"
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[curl] = "--with-libcurl=${STAGING_LIBDIR},--without-libcurl,curl"
-PACKAGECONFIG[libusb] = "--with-libusb=${STAGING_LIBDIR},--without-libusb,libusb-compat"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_2.1.14.bb b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_2.1.14.bb
deleted file mode 100644
index 5ea9b96..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_2.1.14.bb
+++ /dev/null
@@ -1,46 +0,0 @@
-SUMMARY = "GNU Privacy Guard - encryption and signing tools (2.x)"
-HOMEPAGE = "http://www.gnupg.org/"
-LICENSE = "GPLv3 & LGPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
-                    file://COPYING.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
-
-DEPENDS = "npth libassuan libksba zlib bzip2 readline libgcrypt"
-
-inherit autotools gettext texinfo pkgconfig
-
-UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
-SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
-           file://pkgconfig.patch \
-           file://use-pkgconfig-instead-of-npth-config.patch \
-           file://dirmngr-uses-libgpg-error.patch \
-           file://autogen.sh-fix-find-version-for-beta-checking.patch \
-          "
-
-SRC_URI[md5sum] = "46cf0a42ffad6c2615cafd633580b2de"
-SRC_URI[sha256sum] = "9450dee9693b6a12bf0c374dae77b66c30f69ff8f35fc9266ab8dd76998eba42"
-
-EXTRA_OECONF = "--disable-ldap \
-		--disable-ccid-driver \
-		--with-zlib=${STAGING_LIBDIR}/.. \
-		--with-bzip2=${STAGING_LIBDIR}/.. \
-                --with-readline=${STAGING_LIBDIR}/.. \
-               "
-RRECOMMENDS_${PN} = "pinentry"
-
-do_configure_prepend () {
-	# Else these could be used in prefernce to those in aclocal-copy
-	rm -f ${S}/m4/gpg-error.m4
-	rm -f ${S}/m4/libassuan.m4
-	rm -f ${S}/m4/ksba.m4
-	rm -f ${S}/m4/libgcrypt.m4
-}
-
-do_install_append() {
-	ln -sf gpg2 ${D}${bindir}/gpg
-	ln -sf gpgv2 ${D}${bindir}/gpgv
-}
-
-RDEPENDS_${PN} = "gnutls"
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[sqlite3] = "--enable-sqlite, --disable-sqlite, sqlite3"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_2.1.18.bb b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_2.1.18.bb
new file mode 100644
index 0000000..a0611aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_2.1.18.bb
@@ -0,0 +1,46 @@
+SUMMARY = "GNU Privacy Guard - encryption and signing tools (2.x)"
+HOMEPAGE = "http://www.gnupg.org/"
+LICENSE = "GPLv3 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=189af8afca6d6075ba6c9e0aa8077626 \
+                    file://COPYING.LIB;md5=a2b6bf2cb38ee52619e60f30a1fc7257"
+
+DEPENDS = "npth libassuan libksba zlib bzip2 readline libgcrypt"
+
+inherit autotools gettext texinfo pkgconfig
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
+           file://pkgconfig.patch \
+           file://use-pkgconfig-instead-of-npth-config.patch \
+           file://dirmngr-uses-libgpg-error.patch \
+           file://autogen.sh-fix-find-version-for-beta-checking.patch \
+          "
+
+SRC_URI[md5sum] = "c67f908b0b35c7ebc62144f362757e1e"
+SRC_URI[sha256sum] = "d04c6fab7e5562ce4b915b22020e34d4c1a256847690cf149842264fc7cef994"
+
+EXTRA_OECONF = "--disable-ldap \
+		--disable-ccid-driver \
+		--with-zlib=${STAGING_LIBDIR}/.. \
+		--with-bzip2=${STAGING_LIBDIR}/.. \
+                --with-readline=${STAGING_LIBDIR}/.. \
+               "
+RRECOMMENDS_${PN} = "pinentry"
+
+do_configure_prepend () {
+	# Else these could be used in prefernce to those in aclocal-copy
+	rm -f ${S}/m4/gpg-error.m4
+	rm -f ${S}/m4/libassuan.m4
+	rm -f ${S}/m4/ksba.m4
+	rm -f ${S}/m4/libgcrypt.m4
+}
+
+do_install_append() {
+	ln -sf gpg2 ${D}${bindir}/gpg
+	ln -sf gpgv2 ${D}${bindir}/gpgv
+}
+
+RDEPENDS_${PN} = "gnutls"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[sqlite3] = "--enable-sqlite, --disable-sqlite, sqlite3"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls.inc b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls.inc
index 51b9d2b..1ecad1f 100644
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls.inc
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls.inc
@@ -12,10 +12,10 @@
                     file://doc/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
                     file://doc/COPYING.LESSER;md5=a6f89e2100d9b6cdffcea4f398e37343"
 
-DEPENDS = "nettle gmp virtual/libiconv"
+DEPENDS = "nettle gmp virtual/libiconv libunistring"
 DEPENDS_append_libc-musl = " argp-standalone"
 
-SHRT_VER = "${@d.getVar('PV', True).split('.')[0]}.${@d.getVar('PV', True).split('.')[1]}"
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 
 SRC_URI = "ftp://ftp.gnutls.org/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz"
 
@@ -23,6 +23,11 @@
 
 PACKAGECONFIG ??= "libidn zlib"
 
+# You must also have CONFIG_SECCOMP enabled in the kernel for
+# seccomp to work.
+#
+PACKAGECONFIG[seccomp] = "ac_cv_libseccomp=yes,ac_cv_libseccomp=no,libseccomp"
+
 PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn"
 PACKAGECONFIG[libtasn1] = "--with-included-libtasn1=no,--with-included-libtasn1,libtasn1"
 PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit"
@@ -37,6 +42,7 @@
     --enable-local-libopts \
     --enable-openssl-compatibility \
     --with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \
+    --without-libunistring-prefix \
 "
 
 LDFLAGS_append_libc-musl = " -largp"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-Use-correct-include-dir-with-minitasn.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-Use-correct-include-dir-with-minitasn.patch
deleted file mode 100644
index d7dd7cf..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-Use-correct-include-dir-with-minitasn.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 2651b08477f42dd7a05ea7d6df410fb2c46de4fb Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Wed, 31 Aug 2016 11:04:06 +0300
-Subject: [PATCH] Use correct include dir with minitasn
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This allows compiling certtool-cfg without libtasn headers.
-
-Upstream-Status: Submitted [https://gitlab.com/gnutls/gnutls/merge_requests/54]
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
----
- src/Makefile.am | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 182f3a5..cf65388 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -146,6 +146,7 @@ libcmd_cli_debug_la_SOURCES = cli-debug-args.def cli-debug-args.c cli-debug-args
- COMMON_LIBS = $(LIBOPTS) $(LTLIBINTL)
- if ENABLE_MINITASN1
- COMMON_LIBS += ../lib/minitasn1/libminitasn1.la ../gl/libgnu.la 
-+AM_CPPFLAGS += -I$(top_srcdir)/lib/minitasn1
- else
- COMMON_LIBS += $(LIBTASN1_LIBS)
- endif
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch
index c5b95eb..f0b7ca2 100644
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch
@@ -1,6 +1,6 @@
-From 67c638c7e209554d9b19627e9402a20fdabead21 Mon Sep 17 00:00:00 2001
+From eaab55bb6d48643163eebbc9ca575a9ca2a8e03f Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Fri, 4 Dec 2015 13:19:28 +0200
+Date: Tue, 21 Feb 2017 17:10:07 +0200
 Subject: [PATCH] configure.ac: fix sed command
 
 The "sed 's/.bak//g'" matchs "bitbake", which would cause strange errors
@@ -15,18 +15,18 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/configure.ac b/configure.ac
-index e634236..dc9e6a8 100644
+index 6907b21..7c70d9e 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -549,7 +549,7 @@ if test "$enable_tools" != "no" || test "$enable_doc" != "no"; then
- 		dnl replace libopts-generated files with distributed backups, if present
- 		missing_baks=
- 		for i in ${srcdir}/src/*-args.c.bak ${srcdir}/src/*-args.h.bak; do
--			nam=`echo $i|sed 's/.bak//g'`
-+                        nam=`echo $i|sed 's/\.bak$//'`
- 			if test -f $i;then
- 				cp -f $i $nam
- 			else
+@@ -948,7 +948,7 @@ YEAR=`date +%Y`
+ AC_SUBST([YEAR], $YEAR)
+ 
+ for i in ${srcdir}/src/*-args.c.bak ${srcdir}/src/*-args.h.bak; do
+-	nam=$(basename $i|sed 's/.bak//g')
++	nam=$(basename $i|sed 's/\.bak$//')
+ 	if test "$create_libopts_links" = "yes";then
+ 		rm -f "src/$nam"
+ 		AC_CONFIG_LINKS([src/$nam:$i])
 -- 
-2.6.2
+2.11.0
 
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/CVE-2016-7444.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/CVE-2016-7444.patch
deleted file mode 100644
index 215be5a..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/CVE-2016-7444.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-CVE: CVE-2016-7444
-Upstream-Status: Backport
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-
-Upstream commit follows:
-
-
-From 964632f37dfdfb914ebc5e49db4fa29af35b1de9 Mon Sep 17 00:00:00 2001
-From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-Date: Sat, 27 Aug 2016 17:00:22 +0200
-Subject: [PATCH] ocsp: corrected the comparison of the serial size in OCSP response
-
-Previously the OCSP certificate check wouldn't verify the serial length
-and could succeed in cases it shouldn't.
-
-Reported by Stefan Buehler.
----
- lib/x509/ocsp.c | 1 +
- 1 file changed, 1 insertion(+), 0 deletions(-)
-
-diff --git a/lib/x509/ocsp.c b/lib/x509/ocsp.c
-index 92db9b6..8181f2e 100644
---- a/lib/x509/ocsp.c
-+++ b/lib/x509/ocsp.c
-@@ -1318,6 +1318,7 @@ gnutls_ocsp_resp_check_crt(gnutls_ocsp_resp_t resp,
- 		gnutls_assert();
- 		goto cleanup;
- 	}
-+	cserial.size = t;
- 
- 	if (rserial.size != cserial.size
- 	    || memcmp(cserial.data, rserial.data, rserial.size) != 0) {
---
-libgit2 0.24.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/arm_eabi.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/arm_eabi.patch
new file mode 100644
index 0000000..34c8985
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/arm_eabi.patch
@@ -0,0 +1,19 @@
+Certain syscall's are not availabe for arm-eabi, so we eliminate
+reference to them.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/tests/seccomp.c
++++ b/tests/seccomp.c
+@@ -49,7 +49,9 @@ int disable_system_calls(void)
+ 	}
+ 
+ 	ADD_SYSCALL(nanosleep, 0);
++#if ! defined(__ARM_EABI__)
+ 	ADD_SYSCALL(time, 0);
++#endif
+ 	ADD_SYSCALL(getpid, 0);
+ 	ADD_SYSCALL(gettimeofday, 0);
+ #if defined(HAVE_CLOCK_GETTIME)
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch
index 5e452c5..96b023a46 100644
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch
@@ -1,7 +1,7 @@
-From ae3370788ed3447bba16969d9eb1bf1b9631e1b7 Mon Sep 17 00:00:00 2001
+From 81b0f04c14f673b99778d2e7d8e85461e0bf2018 Mon Sep 17 00:00:00 2001
 From: Valentin Popa <valentin.popa@intel.com>
 Date: Fri, 25 Apr 2014 13:58:55 +0300
-Subject: [PATCH] Correct rpl_gettimeofday signature
+Subject: [PATCH 1/3] Correct rpl_gettimeofday signature
 
 Currently we fail on uclibc like below
 
@@ -29,12 +29,13 @@
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 Upstream-Status: Pending
+
 ---
  gl/sys_time.in.h | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h
-index 84a17c9..6ceadc3 100644
+index 5a8caf3..2dc5718 100644
 --- a/gl/sys_time.in.h
 +++ b/gl/sys_time.in.h
 @@ -93,20 +93,20 @@ struct timeval
@@ -61,7 +62,7 @@
 +                       (struct timeval *__restrict, void *__restrict));
  # endif
  _GL_CXXALIASWARN (gettimeofday);
- #elif defined GNULIB_POSIXCHECK
+ # if defined __cplusplus && defined GNULIB_NAMESPACE
 -- 
-1.9.1
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls_3.5.3.bb b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls_3.5.3.bb
deleted file mode 100644
index b2dbb07..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls_3.5.3.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require gnutls.inc
-
-SRC_URI += "file://correct_rpl_gettimeofday_signature.patch \
-            file://0001-configure.ac-fix-sed-command.patch \
-            file://use-pkg-config-to-locate-zlib.patch \
-            file://0001-Use-correct-include-dir-with-minitasn.patch \
-            file://CVE-2016-7444.patch \
-           "
-SRC_URI[md5sum] = "6c2c7f40ddf52933ee3ca474cb8cb63c"
-SRC_URI[sha256sum] = "92c4bc999a10a1b95299ebefaeea8333f19d8a98d957a35b5eae74881bdb1fef"
-
-# x86 .text relocations should be fixed from 3.5.5 onwards
-INSANE_SKIP_${PN}_append_x86 = " textrel"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls_3.5.9.bb b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls_3.5.9.bb
new file mode 100644
index 0000000..8f84dbb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls_3.5.9.bb
@@ -0,0 +1,10 @@
+require gnutls.inc
+
+SRC_URI += "file://correct_rpl_gettimeofday_signature.patch \
+            file://0001-configure.ac-fix-sed-command.patch \
+            file://use-pkg-config-to-locate-zlib.patch \
+            file://arm_eabi.patch \
+           "
+SRC_URI[md5sum] = "0ab25eb6a1509345dd085bc21a387951"
+SRC_URI[sha256sum] = "82b10f0c4ef18f4e64ad8cef5dbaf14be732f5095a41cf366b4ecb4050382951"
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0001-configure-don-t-add-Werror-to-build-flags.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0001-configure-don-t-add-Werror-to-build-flags.patch
deleted file mode 100644
index ae64394..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0001-configure-don-t-add-Werror-to-build-flags.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 908e9fa4c1172f09e0e45420a403dc25ed0a466c Mon Sep 17 00:00:00 2001
-From: Nikos Mavrogiannopoulos <nmav@redhat.com>
-Date: Tue, 26 Jul 2016 08:45:33 +0200
-Subject: [PATCH 1/4] configure: don't add -Werror to build flags
-
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- configure.ac | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 7a14e04..066f5fe 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -70,8 +70,6 @@ AC_ARG_ENABLE([gcc-warnings],
- )
- 
- if test "$gl_gcc_warnings" = yes; then
--  gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
--
-   nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
-   nw="$nw -Wc++-compat"             # We don't care strongly about C++ compilers
-   nw="$nw -Wtraditional"            # Warns on #elif which we use often
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0001-stdint.m4-reintroduce-GNULIB_OVERRIDES_WINT_T-check.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0001-stdint.m4-reintroduce-GNULIB_OVERRIDES_WINT_T-check.patch
new file mode 100644
index 0000000..1e52d6a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0001-stdint.m4-reintroduce-GNULIB_OVERRIDES_WINT_T-check.patch
@@ -0,0 +1,63 @@
+From b17dbb8d3c5605db3a1d82861fcaeef4636d1117 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Thu, 26 Jan 2017 18:54:48 +0200
+Subject: [PATCH] stdint.m4: reintroduce GNULIB_OVERRIDES_WINT_T check
+
+Partially revert the gnulib commit: 5a400b3f5a1f5483dbfd75d38bdb7080218a063b
+to fix the build error with musl library.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ gl/m4/stdint.m4 | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
+index 4ac854d..3dc3da1 100644
+--- a/gl/m4/stdint.m4
++++ b/gl/m4/stdint.m4
+@@ -355,6 +355,32 @@ int32_t i32 = INT32_C (0x7fffffff);
+     gl_STDINT_TYPE_PROPERTIES
+   fi
+ 
++  dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
++  dnl override 'wint_t'.
++    AC_CACHE_CHECK([whether wint_t is too small],
++      [gl_cv_type_wint_t_too_small],
++      [AC_COMPILE_IFELSE(
++           [AC_LANG_PROGRAM([[
++  /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
++     <wchar.h>.
++     BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
++     included before <wchar.h>.  */
++  #if !(defined __GLIBC__ && !defined __UCLIBC__)
++  # include <stddef.h>
++  # include <stdio.h>
++  # include <time.h>
++  #endif
++  #include <wchar.h>
++              int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
++              ]])],
++           [gl_cv_type_wint_t_too_small=no],
++           [gl_cv_type_wint_t_too_small=yes])])
++    if test $gl_cv_type_wint_t_too_small = yes; then
++      GNULIB_OVERRIDES_WINT_T=1
++    else
++      GNULIB_OVERRIDES_WINT_T=0
++    fi
++
+   dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
+   LIMITS_H=limits.h
+   AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+@@ -363,6 +389,7 @@ int32_t i32 = INT32_C (0x7fffffff);
+   AC_SUBST([HAVE_SYS_BITYPES_H])
+   AC_SUBST([HAVE_SYS_INTTYPES_H])
+   AC_SUBST([STDINT_H])
++  AC_SUBST([GNULIB_OVERRIDES_WINT_T])
+   AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
+ ])
+ 
+-- 
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0002-ASN.y-corrected-compiler-warning.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0002-ASN.y-corrected-compiler-warning.patch
deleted file mode 100644
index dd36422..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0002-ASN.y-corrected-compiler-warning.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3542c01618fcde83b29640ea2c60bfd2629ae0b7 Mon Sep 17 00:00:00 2001
-From: Nikos Mavrogiannopoulos <nmav@redhat.com>
-Date: Tue, 26 Jul 2016 08:47:49 +0200
-Subject: [PATCH 2/4] ASN.y: corrected compiler warning
-
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- lib/ASN1.y | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/ASN1.y b/lib/ASN1.y
-index 731415d..6db638f 100644
---- a/lib/ASN1.y
-+++ b/lib/ASN1.y
-@@ -621,7 +621,7 @@ _asn1_create_errorDescription (int error, char *error_desc)
-     case ASN1_NAME_TOO_LONG:
-       snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
-                 "%s:%u: name too long (more than %u characters)", file_name,
--                line_number, ASN1_MAX_NAME_SIZE);
-+                line_number, (unsigned)ASN1_MAX_NAME_SIZE);
-       break;
-     case ASN1_IDENTIFIER_NOT_FOUND:
-       snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0003-parser_aux-corrected-potential-null-pointer-derefere.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0003-parser_aux-corrected-potential-null-pointer-derefere.patch
deleted file mode 100644
index 2420143..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0003-parser_aux-corrected-potential-null-pointer-derefere.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From c8903aa27dc9de1d9efeed9d1f7894f1019548f7 Mon Sep 17 00:00:00 2001
-From: Nikos Mavrogiannopoulos <nmav@redhat.com>
-Date: Tue, 26 Jul 2016 08:49:15 +0200
-Subject: [PATCH 3/4] parser_aux: corrected potential null pointer dereferences
-
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- lib/parser_aux.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/lib/parser_aux.c b/lib/parser_aux.c
-index 2285b20..12ee16f 100644
---- a/lib/parser_aux.c
-+++ b/lib/parser_aux.c
-@@ -637,7 +637,7 @@ _asn1_change_integer_value (asn1_node node)
- 		      p = NULL;
- 		      break;
- 		    }
--		  if (p->right)
-+		  if (p && p->right)
- 		    {
- 		      p = p->right;
- 		      break;
-@@ -753,7 +753,7 @@ _asn1_expand_object_id (asn1_node node)
- 
-       if (move == RIGHT)
- 	{
--	  if (p->right)
-+	  if (p && p->right)
- 	    p = p->right;
- 	  else
- 	    move = UP;
-@@ -828,7 +828,7 @@ _asn1_expand_object_id (asn1_node node)
- 
-       if (move == RIGHT)
- 	{
--	  if (p->right)
-+	  if (p && p->right)
- 	    p = p->right;
- 	  else
- 	    move = UP;
-@@ -898,7 +898,7 @@ _asn1_type_set_config (asn1_node node)
- 
-       if (move == RIGHT)
- 	{
--	  if (p->right)
-+	  if (p && p->right)
- 	    p = p->right;
- 	  else
- 	    move = UP;
-@@ -1007,7 +1007,7 @@ _asn1_check_identifier (asn1_node node)
- 		  p = NULL;
- 		  break;
- 		}
--	      if (p->right)
-+	      if (p && p->right)
- 		{
- 		  p = p->right;
- 		  break;
-@@ -1067,7 +1067,7 @@ _asn1_set_default_tag (asn1_node node)
- 		  p = NULL;
- 		  break;
- 		}
--	      if (p->right)
-+	      if (p && p->right)
- 		{
- 		  p = p->right;
- 		  break;
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0004-tools-eliminated-compiler-warnings.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0004-tools-eliminated-compiler-warnings.patch
deleted file mode 100644
index 7bda0e6..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/0004-tools-eliminated-compiler-warnings.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From d647bb2fa1bd288a6ac02c18318f3cba2a34c3a0 Mon Sep 17 00:00:00 2001
-From: Nikos Mavrogiannopoulos <nmav@redhat.com>
-Date: Tue, 26 Jul 2016 08:50:24 +0200
-Subject: [PATCH 4/4] tools: eliminated compiler warnings
-
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- src/asn1Coding.c   | 2 +-
- src/asn1Decoding.c | 2 +-
- src/asn1Parser.c   | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/asn1Coding.c b/src/asn1Coding.c
-index d4df593..b516bfe 100644
---- a/src/asn1Coding.c
-+++ b/src/asn1Coding.c
-@@ -188,7 +188,7 @@ main (int argc, char *argv[])
- 	default:
- 	  fprintf (stderr,
- 		   "asn1Coding: ?? getopt returned character code Ox%x ??\n",
--		   option_result);
-+		   (unsigned)option_result);
- 	}
-     }
- 
-diff --git a/src/asn1Decoding.c b/src/asn1Decoding.c
-index 078963e..20f91ac 100644
---- a/src/asn1Decoding.c
-+++ b/src/asn1Decoding.c
-@@ -131,7 +131,7 @@ main (int argc, char *argv[])
- 	default:
- 	  fprintf (stderr,
- 		   "asn1Decoding: ?? getopt returned character code Ox%x ??\n",
--		   option_result);
-+		   (unsigned)option_result);
- 	}
-     }
- 
-diff --git a/src/asn1Parser.c b/src/asn1Parser.c
-index 7a3ae67..475bfc9 100644
---- a/src/asn1Parser.c
-+++ b/src/asn1Parser.c
-@@ -139,7 +139,7 @@ main (int argc, char *argv[])
- 	default:
- 	  fprintf (stderr,
- 		   "asn1Parser: ?? getopt returned character code Ox%x ??\n",
--		   option_result);
-+		   (unsigned)option_result);
- 	}
- 
-     }
--- 
-1.9.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/CVE-2017-10790.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/CVE-2017-10790.patch
new file mode 100644
index 0000000..be84380
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/CVE-2017-10790.patch
@@ -0,0 +1,63 @@
+From d8d805e1f2e6799bb2dff4871a8598dc83088a39 Mon Sep 17 00:00:00 2001
+From: Nikos Mavrogiannopoulos <nmav@redhat.com>
+Date: Thu, 22 Jun 2017 16:31:37 +0200
+Subject: [PATCH] _asn1_check_identifier: safer access to values read
+
+Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
+
+http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=commit;h=d8d805e1f2e6799bb2dff4871a8598dc83088a39
+Upstream-Status: Backport
+
+CVE: CVE-2017-10790
+
+Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ lib/parser_aux.c |   17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/lib/parser_aux.c b/lib/parser_aux.c
+index 976ab38..786ea64 100644
+--- a/lib/parser_aux.c
++++ b/lib/parser_aux.c
+@@ -955,7 +955,7 @@ _asn1_check_identifier (asn1_node node)
+ 	  if (p2 == NULL)
+ 	    {
+ 	      if (p->value)
+-		_asn1_strcpy (_asn1_identifierMissing, p->value);
++		_asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p->value);
+ 	      else
+ 		_asn1_strcpy (_asn1_identifierMissing, "(null)");
+ 	      return ASN1_IDENTIFIER_NOT_FOUND;
+@@ -968,9 +968,15 @@ _asn1_check_identifier (asn1_node node)
+ 	  if (p2 && (type_field (p2->type) == ASN1_ETYPE_DEFAULT))
+ 	    {
+ 	      _asn1_str_cpy (name2, sizeof (name2), node->name);
+-	      _asn1_str_cat (name2, sizeof (name2), ".");
+-	      _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
+-	      _asn1_strcpy (_asn1_identifierMissing, p2->value);
++	      if (p2->value)
++	        {
++	          _asn1_str_cat (name2, sizeof (name2), ".");
++	          _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
++	          _asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p2->value);
++	        }
++	      else
++		_asn1_strcpy (_asn1_identifierMissing, "(null)");
++
+ 	      p2 = asn1_find_node (node, name2);
+ 	      if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID) ||
+ 		  !(p2->type & CONST_ASSIGN))
+@@ -990,7 +996,8 @@ _asn1_check_identifier (asn1_node node)
+ 		  _asn1_str_cpy (name2, sizeof (name2), node->name);
+ 		  _asn1_str_cat (name2, sizeof (name2), ".");
+ 		  _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
+-		  _asn1_strcpy (_asn1_identifierMissing, p2->value);
++		  _asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p2->value);
++
+ 		  p2 = asn1_find_node (node, name2);
+ 		  if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID)
+ 		      || !(p2->type & CONST_ASSIGN))
+-- 
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1_4.10.bb b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1_4.10.bb
new file mode 100644
index 0000000..dfc7f12
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1_4.10.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Library for ASN.1 and DER manipulation"
+HOMEPAGE = "http://www.gnu.org/software/libtasn1/"
+
+LICENSE = "GPLv3+ & LGPLv2.1+"
+LICENSE_${PN}-bin = "GPLv3+"
+LICENSE_${PN} = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
+                    file://README;endline=8;md5=c3803a3e8ca5ab5eb1e5912faa405351"
+
+SRC_URI = "${GNU_MIRROR}/libtasn1/libtasn1-${PV}.tar.gz \
+           file://dont-depend-on-help2man.patch \
+           file://0001-stdint.m4-reintroduce-GNULIB_OVERRIDES_WINT_T-check.patch \
+           file://CVE-2017-10790.patch \
+           "
+
+DEPENDS = "bison-native"
+
+SRC_URI[md5sum] = "f4faffdf63969d0e4e6df43b9679e8e5"
+SRC_URI[sha256sum] = "681a4d9a0d259f2125713f2e5766c5809f151b3a1392fd91390f780b4b8f5a02"
+
+inherit autotools texinfo binconfig lib_package gtk-doc
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1_4.9.bb b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1_4.9.bb
deleted file mode 100644
index b8ff9ea..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1_4.9.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-SUMMARY = "Library for ASN.1 and DER manipulation"
-HOMEPAGE = "http://www.gnu.org/software/libtasn1/"
-
-LICENSE = "GPLv3+ & LGPLv2.1+"
-LICENSE_${PN}-bin = "GPLv3+"
-LICENSE_${PN} = "LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
-                    file://README;endline=8;md5=c3803a3e8ca5ab5eb1e5912faa405351"
-
-SRC_URI = "${GNU_MIRROR}/libtasn1/libtasn1-${PV}.tar.gz \
-           file://dont-depend-on-help2man.patch \
-           file://0001-configure-don-t-add-Werror-to-build-flags.patch \
-           file://0002-ASN.y-corrected-compiler-warning.patch \
-           file://0003-parser_aux-corrected-potential-null-pointer-derefere.patch \
-           file://0004-tools-eliminated-compiler-warnings.patch \
-           "
-
-SRC_URI[md5sum] = "3018d0f466a32b66dde41bb122e6cab6"
-SRC_URI[sha256sum] = "4f6f7a8fd691ac2b8307c8ca365bad711db607d4ad5966f6938a9d2ecd65c920"
-
-inherit autotools texinfo binconfig lib_package gtk-doc
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/0001-Correctly-install-python-modules.patch b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/0001-Correctly-install-python-modules.patch
new file mode 100644
index 0000000..42655fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/0001-Correctly-install-python-modules.patch
@@ -0,0 +1,26 @@
+From 4d714c097e497b63d2e8b22a834c671045e215e9 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 9 Mar 2017 21:34:55 +0200
+Subject: [PATCH] Correctly install python modules
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lang/python/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am
+index e32fd12..5ecf6fb 100644
+--- a/lang/python/Makefile.am
++++ b/lang/python/Makefile.am
+@@ -102,6 +102,7 @@ install-exec-local:
+ 	for PYTHON in $(PYTHONS); do \
+ 	  $$PYTHON setup.py install \
+ 	  --prefix $(DESTDIR)$(prefix) \
++          --install-lib=$(DESTDIR)${pythondir} \
+ 	  --record files.txt \
+ 	  --verbose ; \
+ 	  cat files.txt >> install_files.txt ; \
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/0001-gpgme-config-skip-all-lib-or-usr-lib-directories-in-.patch b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/0001-gpgme-config-skip-all-lib-or-usr-lib-directories-in-.patch
new file mode 100644
index 0000000..84d55b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/0001-gpgme-config-skip-all-lib-or-usr-lib-directories-in-.patch
@@ -0,0 +1,31 @@
+From 8c317f6186bd3a9a1c80b4d1e872b3db95934bb6 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 13 Apr 2017 16:40:27 +0300
+Subject: [PATCH] gpgme-config: skip all /lib* or /usr/lib* directories in
+ output
+
+The logic was not working in multilib setups which use other
+directory names than plain /lib or /usr/lib.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ src/gpgme-config.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/gpgme-config.in b/src/gpgme-config.in
+index a4d152e..8342865 100644
+--- a/src/gpgme-config.in
++++ b/src/gpgme-config.in
+@@ -154,7 +154,7 @@ while test $# -gt 0; do
+             for i in $libs $tmp_l $assuan_libs $gpg_error_libs $tmp_x; do
+               skip=no
+               case $i in
+-                  -L/usr/lib|-L/lib)
++                  -L/usr/lib*|-L/lib*)
+                       skip=yes
+                       ;;
+                   -L*|-l*)
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/gpgme.pc b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/gpgme.pc
deleted file mode 100644
index 30a4d56..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/gpgme.pc
+++ /dev/null
@@ -1,10 +0,0 @@
-prefix=/usr
-libdir=${prefix}/lib
-includedir=${prefix}/include
-
-Name: gpgme
-Description: GNU Privacy Guard Made Easy
-Version: 1.4.3
-Requires:
-Libs: -L${libdir} -lgpgme -lassuan -lgpg-error
-Cflags: -I${includedir}
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/pkgconfig.patch
index e2f1f4f..341cabf 100644
--- a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/pkgconfig.patch
+++ b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/pkgconfig.patch
@@ -4,37 +4,50 @@
 Upstream-Status: Denied [Upstream not interested in pkg-config support]
 RP 2015/4/17
 
+Rebase to 1.8.0
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac            |   1 +
+ src/Makefile.am         |   4 +-
+ src/gpgme-pthread.pc.in |  15 +++++++
+ src/gpgme.m4            | 114 ++++--------------------------------------------
+ src/gpgme.pc.in         |  15 +++++++
+ 5 files changed, 42 insertions(+), 107 deletions(-)
+ create mode 100644 src/gpgme-pthread.pc.in
+ create mode 100644 src/gpgme.pc.in
+
 diff --git a/configure.ac b/configure.ac
-index 298a22b..c778b61 100644
+index 0a67b48..e402dd3 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -622,6 +622,7 @@ AC_CONFIG_FILES(Makefile src/Makefile
+@@ -875,6 +875,7 @@ AC_CONFIG_FILES(Makefile src/Makefile
                  src/versioninfo.rc
                  src/gpgme.h)
  AC_CONFIG_FILES(src/gpgme-config, chmod +x src/gpgme-config)
 +AC_CONFIG_FILES(src/gpgme.pc src/gpgme-pthread.pc)
- AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
- AC_OUTPUT
- 
+ AC_CONFIG_FILES(lang/cpp/Makefile lang/cpp/src/Makefile)
+ AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig-w32.cmake.in)
+ AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig.cmake.in)
 diff --git a/src/Makefile.am b/src/Makefile.am
-index 58922f9..40d0dca 100644
+index ce6f1d4..5f38fee 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
-@@ -20,11 +20,13 @@
+@@ -19,12 +19,14 @@
+ ## Process this file with automake to produce Makefile.in
  
- # Note: moc_kdpipeiodevice should actually be a dependecy below.
  EXTRA_DIST = gpgme-config.in gpgme.m4 libgpgme.vers ChangeLog-2011 \
--	     gpgme.h.in versioninfo.rc.in gpgme.def moc_kdpipeiodevice.cpp
-+	     gpgme.h.in versioninfo.rc.in gpgme.def moc_kdpipeiodevice.cpp gpgme.pc.in gpgme-pthread.pc.in
+-	     gpgme.h.in versioninfo.rc.in gpgme.def
++	     gpgme.h.in versioninfo.rc.in gpgme.def gpgme.pc.in gpgme-pthread.pc.in
  
  bin_SCRIPTS = gpgme-config
  m4datadir = $(datadir)/aclocal
  m4data_DATA = gpgme.m4
+ nodist_include_HEADERS = gpgme.h
 +pkgconfigdir = $(libdir)/pkgconfig
 +pkgconfig_DATA = gpgme.pc gpgme-pthread.pc
- nodist_include_HEADERS = gpgme.h
  
  bin_PROGRAMS = gpgme-tool
+ 
 diff --git a/src/gpgme-pthread.pc.in b/src/gpgme-pthread.pc.in
 new file mode 100644
 index 0000000..980a48e
@@ -51,9 +64,9 @@
 +host=@GPGME_CONFIG_HOST@
 +
 +Name: gpgme
-+Description: GnuPG Made Easy (GPGME) is a C language library that allows to addsupport for cryptography to a program (threaded version)
++Description: GnuPG Made Easy (GPGME) is a C language library that allows to addsupport for cryptography to a program (deprecated)
 +Version: @VERSION@
-+Libs: -L${libdir} -lgpgme-pthread -lpthread
++Libs: -L${libdir} -lgpgme -lpthread
 +Cflags: -I${includedir}
 +Requires: libassuan gpg-error
 diff --git a/src/gpgme.m4 b/src/gpgme.m4
@@ -277,3 +290,6 @@
 +Cflags: -I${includedir}
 +Requires: libassuan gpg-error
 \ No newline at end of file
+-- 
+2.8.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/python-import.patch b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/python-import.patch
new file mode 100644
index 0000000..61b77a1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/python-import.patch
@@ -0,0 +1,19 @@
+Don't check for output on stderr to know if an import worked, host inputrc and
+sysroot readline can cause warnings on stderr.
+
+Upstream-Status: Backport (from autoconf-archive 883a2abd)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4
+index b990d5b..318b089 100644
+--- a/m4/ax_python_devel.m4
++++ b/m4/ax_python_devel.m4
+@@ -137,7 +137,7 @@ variable to configure. See ``configure --help'' for reference.
+ 	#
+ 	AC_MSG_CHECKING([for the distutils Python package])
+ 	ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
+-	if test -z "$ac_distutils_result"; then
++	if test $? -eq 0; then
+ 		AC_MSG_RESULT([yes])
+ 	else
+ 		AC_MSG_RESULT([no])
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/python-lang-config.patch b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/python-lang-config.patch
new file mode 100644
index 0000000..132e426
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/python-lang-config.patch
@@ -0,0 +1,52 @@
+gpgme/lang/python: gpg-error-config should not be used.
+
+gpg-error-config was modified by OE to always return an error.  So we want
+to find an alternative way to retrieve whatever it is we need.  It turns
+out that the system is just trying to find the path to the gpg-error.h, which
+we can pull in from the STAGING_INC environment.
+
+Upstream-Status: Inappropriate [changes are specific to OE]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: gpgme-1.8.0/lang/python/setup.py.in
+===================================================================
+--- gpgme-1.8.0.orig/lang/python/setup.py.in
++++ gpgme-1.8.0/lang/python/setup.py.in
+@@ -24,7 +24,6 @@ import glob
+ import subprocess
+ 
+ # Out-of-tree build of the gpg bindings.
+-gpg_error_config = ["gpg-error-config"]
+ gpgme_config_flags = ["--thread=pthread"]
+ gpgme_config = ["gpgme-config"] + gpgme_config_flags
+ gpgme_h = ""
+@@ -52,13 +51,6 @@ else:
+     devnull = open(os.devnull, "w")
+ 
+ try:
+-    subprocess.check_call(gpg_error_config + ['--version'],
+-                          stdout=devnull)
+-except:
+-    sys.exit("Could not find gpg-error-config.  " +
+-             "Please install the libgpg-error development package.")
+-
+-try:
+     subprocess.check_call(gpgme_config + ['--version'],
+                           stdout=devnull)
+ except:
+@@ -81,12 +73,9 @@ if not (major > 1 or (major == 1 and min
+ if not gpgme_h:
+     gpgme_h = os.path.join(getconfig("prefix")[0], "include", "gpgme.h")
+ 
+-gpg_error_prefix = getconfig("prefix", config=gpg_error_config)[0]
+-gpg_error_h = os.path.join(gpg_error_prefix, "include", "gpg-error.h")
++gpg_error_h = os.path.join(os.getenv('STAGING_INCDIR'), "gpg-error.h")
+ if not os.path.exists(gpg_error_h):
+-    gpg_error_h = \
+-        glob.glob(os.path.join(gpg_error_prefix, "include",
+-                               "*", "gpg-error.h"))[0]
++    sys.exit("gpg_error_h not found: %s" % gpg_error_h)
+ 
+ print("Building python gpg module using {} and {}.".format(gpgme_h, gpg_error_h))
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme_1.6.0.bb b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme_1.6.0.bb
deleted file mode 100644
index a2d0587..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme_1.6.0.bb
+++ /dev/null
@@ -1,41 +0,0 @@
-SUMMARY = "High-level GnuPG encryption/signing API"
-DESCRIPTION = "GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG easier for applications. It provides a High-Level Crypto API for encryption, decryption, signing, signature verification and key management"
-HOMEPAGE = "http://www.gnupg.org/gpgme.html"
-BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
-
-LICENSE = "GPLv2+ & LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
-                    file://COPYING.LESSER;md5=bbb461211a33b134d42ed5ee802b37ff \
-                    file://src/gpgme.h.in;endline=23;md5=5027eec93a996272a9a0a6a86cf35775 \
-                    file://src/engine.h;endline=22;md5=4b6d8ba313d9b564cc4d4cfb1640af9d"
-
-UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
-SRC_URI = "${GNUPG_MIRROR}/gpgme/${BP}.tar.bz2 \
-           file://gpgme.pc \
-           file://pkgconfig.patch \
-          "
-
-SRC_URI[md5sum] = "60d730d22e8065fd5de309e8b98e304b"
-SRC_URI[sha256sum] = "b09de4197ac280b102080e09eaec6211d081efff1963bf7821cf8f4f9916099d"
-
-DEPENDS = "libgpg-error libassuan"
-
-BINCONFIG = "${bindir}/gpgme-config"
-
-inherit autotools texinfo binconfig-disabled pkgconfig
-
-PACKAGES =+ "${PN}-pthread"
-FILES_${PN}-pthread = "${libdir}/libgpgme-pthread.so.*"
-FILES_${PN}-dev += "${datadir}/common-lisp/source/gpgme/*"
-
-CFLAGS_append_libc-musl = " -D__error_t_defined "
-do_configure_prepend () {
-	# Else these could be used in preference to those in aclocal-copy
-	rm -f ${S}/m4/gpg-error.m4
-	rm -f ${S}/m4/libassuan.m4
-}
-
-do_install_append () {
-        install -d ${D}${libdir}/pkgconfig
-        install -m 0644 ${WORKDIR}/gpgme.pc ${D}${libdir}/pkgconfig/
-}
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme_1.8.0.bb b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme_1.8.0.bb
new file mode 100644
index 0000000..4ddf6ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme_1.8.0.bb
@@ -0,0 +1,76 @@
+SUMMARY = "High-level GnuPG encryption/signing API"
+DESCRIPTION = "GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG easier for applications. It provides a High-Level Crypto API for encryption, decryption, signing, signature verification and key management"
+HOMEPAGE = "http://www.gnupg.org/gpgme.html"
+BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://COPYING.LESSER;md5=bbb461211a33b134d42ed5ee802b37ff \
+                    file://src/gpgme.h.in;endline=23;md5=0f7059665c4b7897f4f4d0cb93aa9f98 \
+                    file://src/engine.h;endline=22;md5=4b6d8ba313d9b564cc4d4cfb1640af9d"
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/gpgme/${BP}.tar.bz2 \
+           file://pkgconfig.patch \
+           file://python-lang-config.patch \
+           file://0001-Correctly-install-python-modules.patch \
+           file://python-import.patch \
+           file://0001-gpgme-config-skip-all-lib-or-usr-lib-directories-in-.patch \
+          "
+
+SRC_URI[md5sum] = "722a4153904b9b5dc15485a22d29263b"
+SRC_URI[sha256sum] = "596097257c2ce22e747741f8ff3d7e24f6e26231fa198a41b2a072e62d1e5d33"
+
+DEPENDS = "libgpg-error libassuan"
+RDEPENDS_${PN}-cpp += "libstdc++"
+
+RDEPENDS_python2-gpg += "python-unixadmin"
+RDEPENDS_python3-gpg += "python3-unixadmin"
+
+BINCONFIG = "${bindir}/gpgme-config"
+
+# Note select python2 or python3, but you can't select both at the same time
+PACKAGECONFIG ??= "python3"
+PACKAGECONFIG[python2] = ",,python swig-native,"
+PACKAGECONFIG[python3] = ",,python3 swig-native,"
+
+# Default in configure.ac: "cl cpp python qt"
+# Supported: "cl cpp python python2 python3 qt"
+# python says 'search and find python2 or python3'
+
+# Building the C++ bindings for native requires a C++ compiler with C++11
+# support. Since these bindings are currently not needed, we can disable them.
+DEFAULT_LANGUAGES = ""
+DEFAULT_LANGUAGES_class-target = "cpp"
+LANGUAGES ?= "${DEFAULT_LANGUAGES}"
+LANGUAGES .= "${@bb.utils.contains('PACKAGECONFIG', 'python2', ' python2', '', d)}"
+LANGUAGES .= "${@bb.utils.contains('PACKAGECONFIG', 'python3', ' python3', '', d)}"
+
+PYTHON_INHERIT = "${@bb.utils.contains('PACKAGECONFIG', 'python2', 'pythonnative', '', d)}"
+PYTHON_INHERIT .= "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native', '', d)}"
+
+EXTRA_OECONF += '--enable-languages="${LANGUAGES}"'
+
+inherit autotools texinfo binconfig-disabled pkgconfig ${PYTHON_INHERIT}
+
+export PKG_CONFIG='pkg-config'
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGES =+ "${PN}-cpp"
+PACKAGES =. "${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python2-gpg ', '', d)}"
+PACKAGES =. "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-gpg ', '', d)}"
+
+FILES_${PN}-cpp = "${libdir}/libgpgmepp.so.*"
+FILES_python2-gpg = "${PYTHON_SITEPACKAGES_DIR}/*"
+FILES_python3-gpg = "${PYTHON_SITEPACKAGES_DIR}/*"
+FILES_${PN}-dev += "${datadir}/common-lisp/source/gpgme/* \
+                    ${libdir}/cmake/* \
+"
+
+CFLAGS_append_libc-musl = " -D__error_t_defined "
+do_configure_prepend () {
+	# Else these could be used in preference to those in aclocal-copy
+	rm -f ${S}/m4/gpg-error.m4
+	rm -f ${S}/m4/libassuan.m4
+}
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 cc6f222..fe48101 100644
--- a/import-layers/yocto-poky/meta/recipes-support/icu/icu.inc
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu.inc
@@ -9,6 +9,8 @@
 DEPENDS = "icu-native"
 DEPENDS_class-native = ""
 
+CVE_PRODUCT = "international_components_for_unicode"
+
 S = "${WORKDIR}/icu/source"
 SPDX_S = "${WORKDIR}/icu"
 STAGING_ICU_DIR_NATIVE = "${STAGING_DATADIR_NATIVE}/${BPN}/${PV}"
@@ -26,6 +28,14 @@
 EXTRA_OECONF_class-native = ""
 EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
 
+
+# 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
+# so monkey patching is needed.
+do_configure_prepend_libc-musl () {
+    sed -i -e 's,DU_HAVE_STRTOD_L=1,DU_HAVE_STRTOD_L=0,' ${S}/configure.ac
+}
+
 PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}"
 do_install_append_class-native() {
 	mkdir -p ${D}/${STAGING_ICU_DIR_NATIVE}/config
@@ -36,15 +46,13 @@
 	cp -r ${B}/tools ${D}/${STAGING_ICU_DIR_NATIVE}
 }
 
-PACKAGES =+ "libicudata libicuuc libicui18n libicule libiculx libicutu libicuio"
+PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio"
 
 FILES_${PN}-dev += "${libdir}/${BPN}/"
 
 FILES_libicudata = "${libdir}/libicudata.so.*"
 FILES_libicuuc = "${libdir}/libicuuc.so.*"
 FILES_libicui18n = "${libdir}/libicui18n.so.*"
-FILES_libicule = "${libdir}/libicule.so.*"
-FILES_libiculx = "${libdir}/libiculx.so.*"
 FILES_libicutu = "${libdir}/libicutu.so.*"
 FILES_libicuio = "${libdir}/libicuio.so.*"
 
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
new file mode 100644
index 0000000..add0d76
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch
@@ -0,0 +1,31 @@
+From c4254fd8ff1888ca285e3242b812010357ce2b3e 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>
+
+glibc 2.26 drops this header
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ 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 @@
+ #endif
+ 
+ #if U_USE_STRTOD_L
+-# if U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_CYGWIN
+-#   include <locale.h>
+-# else
+-#   include <xlocale.h>
+-# endif
++# include <locale.h>
+ #endif
+ 
+ // ***************************************************************************
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu_57.1.bb b/import-layers/yocto-poky/meta/recipes-support/icu/icu_57.1.bb
deleted file mode 100644
index 90c2b82..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/icu/icu_57.1.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-require icu.inc
-
-LIC_FILES_CHKSUM = "file://../LICENSE;md5=787d3b37867445c1cdd6f6167bd0e347"
-
-def icu_download_version(d):
-    pvsplit = d.getVar('PV', True).split('.')
-    return pvsplit[0] + "_" + pvsplit[1]
-
-ICU_PV = "${@icu_download_version(d)}"
-
-# http://errors.yoctoproject.org/Errors/Details/20486/
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
-
-BASE_SRC_URI = "http://download.icu-project.org/files/icu4c/${PV}/icu4c-${ICU_PV}-src.tgz"
-SRC_URI = "${BASE_SRC_URI} \
-           file://icu-pkgdata-large-cmd.patch \
-           file://fix-install-manx.patch \
-          "
-
-SRC_URI_append_class-target = "\
-           file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
-          "
-SRC_URI[md5sum] = "976734806026a4ef8bdd17937c8898b9"
-SRC_URI[sha256sum] = "ff8c67cb65949b1e7808f2359f2b80f722697048e90e7cfc382ec1fe229e9581"
-
-UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
-UPSTREAM_CHECK_URI = "http://download.icu-project.org/files/icu4c/"
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu_58.2.bb b/import-layers/yocto-poky/meta/recipes-support/icu/icu_58.2.bb
new file mode 100644
index 0000000..47684a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu_58.2.bb
@@ -0,0 +1,29 @@
+require icu.inc
+
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=1b3b75c1777cd49ad5c6a24cd338cfc9"
+
+def icu_download_version(d):
+    pvsplit = d.getVar('PV').split('.')
+    return pvsplit[0] + "_" + pvsplit[1]
+
+ICU_PV = "${@icu_download_version(d)}"
+
+# http://errors.yoctoproject.org/Errors/Details/20486/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+BASE_SRC_URI = "http://download.icu-project.org/files/icu4c/${PV}/icu4c-${ICU_PV}-src.tgz"
+SRC_URI = "${BASE_SRC_URI} \
+           file://icu-pkgdata-large-cmd.patch \
+           file://fix-install-manx.patch \
+           file://0001-i18n-Drop-include-xlocale.h.patch \
+           "
+
+SRC_URI_append_class-target = "\
+           file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
+          "
+SRC_URI[md5sum] = "fac212b32b7ec7ab007a12dff1f3aea1"
+SRC_URI[sha256sum] = "2b0a4410153a9b20de0e20c7d8b66049a72aef244b53683d0d7521371683da0c"
+
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
+UPSTREAM_CHECK_URI = "http://download.icu-project.org/files/icu4c/"
diff --git a/import-layers/yocto-poky/meta/recipes-support/iso-codes/iso-codes_3.70.bb b/import-layers/yocto-poky/meta/recipes-support/iso-codes/iso-codes_3.70.bb
deleted file mode 100644
index 7edd8b7..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/iso-codes/iso-codes_3.70.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "ISO language, territory, currency, script codes and their translations"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
-
-SRC_URI = "https://pkg-isocodes.alioth.debian.org/downloads/iso-codes-${PV}.tar.xz"
-SRC_URI[md5sum] = "c61f8f02eecf978d3710ff594e43ca7e"
-SRC_URI[sha256sum] = "41e2fbaec2ed57e767b94f175d0dcd31b627aeb23b75cd604605a6fb6109d61f"
-
-# inherit gettext cannot be used, because it adds gettext-native to BASEDEPENDS which
-# are inhibited by allarch
-DEPENDS = "gettext-native"
-
-inherit allarch autotools
-
-FILES_${PN} += "${datadir}/xml/"
diff --git a/import-layers/yocto-poky/meta/recipes-support/iso-codes/iso-codes_3.74.bb b/import-layers/yocto-poky/meta/recipes-support/iso-codes/iso-codes_3.74.bb
new file mode 100644
index 0000000..c436a1d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/iso-codes/iso-codes_3.74.bb
@@ -0,0 +1,15 @@
+SUMMARY = "ISO language, territory, currency, script codes and their translations"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = "https://pkg-isocodes.alioth.debian.org/downloads/iso-codes-${PV}.tar.xz"
+SRC_URI[md5sum] = "d5448475d087756b78391b8c53c5b83a"
+SRC_URI[sha256sum] = "21f4f3cea8fe09f5b53784522303a0e1e7d083964ecaf1c75b1441d4d9ec6aee"
+
+# inherit gettext cannot be used, because it adds gettext-native to BASEDEPENDS which
+# are inhibited by allarch
+DEPENDS = "gettext-native"
+
+inherit allarch autotools
+
+FILES_${PN} += "${datadir}/xml/"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan_2.4.3.bb b/import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan_2.4.3.bb
index 1b3916d..926c279 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan_2.4.3.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan_2.4.3.bb
@@ -28,4 +28,4 @@
 	rm -f ${S}/m4/*.m4
 }
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd/0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch b/import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd/0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch
new file mode 100644
index 0000000..7e3a5b3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd/0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch
@@ -0,0 +1,33 @@
+From b6972f1c29ebf073cbe19a4a669ee093259792a0 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Mon, 30 Jan 2017 12:00:33 -0200
+Subject: [PATCH] src/libbsd-overlay.pc.in: Set Cflags to use -I instead of
+ -isystem
+Organization: O.S. Systems Software LTDA.
+
+pkg-config currently only handles -I and -L correctly, but misses
+-isystem, so we need to do this workaround to fix this issue.
+
+There's a open bug in:
+https://bugzilla.freedesktop.org/show_bug.cgi?id=99516
+
+Upstream-Status: Pending
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ src/libbsd-overlay.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libbsd-overlay.pc.in b/src/libbsd-overlay.pc.in
+index ac8bf89..65dc3ae 100644
+--- a/src/libbsd-overlay.pc.in
++++ b/src/libbsd-overlay.pc.in
+@@ -8,4 +8,4 @@ Description: Utility functions from BSD systems (overlay)
+ Version: @VERSION@
+ URL: https://libbsd.freedesktop.org/
+ Libs: -L${libdir} -lbsd
+-Cflags: -isystem ${includedir}/bsd -DLIBBSD_OVERLAY
++Cflags: -I${includedir}/bsd -DLIBBSD_OVERLAY
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd_0.8.3.bb b/import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd_0.8.3.bb
index fadd788..e85ee21 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd_0.8.3.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd_0.8.3.bb
@@ -35,6 +35,7 @@
 
 SRC_URI = " \
     http://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+    file://0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch \
 "
 SRC_URI_append_libc-musl  = " \
     file://0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch \
diff --git a/import-layers/yocto-poky/meta/recipes-support/libcap/libcap_2.25.bb b/import-layers/yocto-poky/meta/recipes-support/libcap/libcap_2.25.bb
index 7ced4be..0587e77 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libcap/libcap_2.25.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/libcap/libcap_2.25.bb
@@ -5,7 +5,7 @@
 LICENSE = "BSD | GPLv2"
 LIC_FILES_CHKSUM = "file://License;md5=3f84fd6f29d453a56514cb7e4ead25f1"
 
-DEPENDS = "hostperl-runtime-native"
+DEPENDS = "hostperl-runtime-native gperf-native"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \
            file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \
@@ -27,11 +27,9 @@
 	sed -e '/shell gperf/cifeq (,yes)' -i libcap/Makefile
 }
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG_class-native ??= ""
 
-PACKAGECONFIG[attr] = "LIBATTR=yes,LIBATTR=no,attr"
 PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
 
 EXTRA_OEMAKE = " \
diff --git a/import-layers/yocto-poky/meta/recipes-support/libcheck/libcheck_0.10.0.bb b/import-layers/yocto-poky/meta/recipes-support/libcheck/libcheck_0.10.0.bb
index c0b459f..9d34198 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libcheck/libcheck_0.10.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/libcheck/libcheck_0.10.0.bb
@@ -21,4 +21,4 @@
 RDEPENDS_${PN} += "gawk"
 RDEPENDS_${PN}_class-native = ""
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libevdev/libevdev_1.5.2.bb b/import-layers/yocto-poky/meta/recipes-support/libevdev/libevdev_1.5.2.bb
deleted file mode 100644
index c76e1d7..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libevdev/libevdev_1.5.2.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "Wrapper library for evdev devices"
-HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libevdev/"
-SECTION = "libs"
-
-LICENSE = "MIT-X"
-LIC_FILES_CHKSUM = "file://COPYING;md5=75aae0d38feea6fda97ca381cb9132eb \
-                    file://libevdev/libevdev.h;endline=21;md5=7ff4f0b5113252c2f1a828e0bbad98d1"
-
-SRC_URI = "http://www.freedesktop.org/software/libevdev/${BP}.tar.xz"
-
-SRC_URI[md5sum] = "96ad6edb5ce5c4428f1b183cc180ff8c"
-SRC_URI[sha256sum] = "5ee2163656a61f5703cb5c08a05c9471ffb7b640bfbe2c55194ea50d908f629b"
-
-inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-support/libevdev/libevdev_1.5.6.bb b/import-layers/yocto-poky/meta/recipes-support/libevdev/libevdev_1.5.6.bb
new file mode 100644
index 0000000..2f84554
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libevdev/libevdev_1.5.6.bb
@@ -0,0 +1,14 @@
+SUMMARY = "Wrapper library for evdev devices"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libevdev/"
+SECTION = "libs"
+
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://COPYING;md5=75aae0d38feea6fda97ca381cb9132eb \
+                    file://libevdev/libevdev.h;endline=21;md5=7ff4f0b5113252c2f1a828e0bbad98d1"
+
+SRC_URI = "http://www.freedesktop.org/software/libevdev/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "d4ce9f061f8f954bea7adba0cb768a53"
+SRC_URI[sha256sum] = "ecec7e9d66b1d3692f10b3b20aa97fb25e874a784c5552a7b1698091fef5a688"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra_1.2.4.bb b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra_1.2.4.bb
deleted file mode 100644
index f204968..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra_1.2.4.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-SUMMARY = "Library for file management"
-HOMEPAGE = "http://pcmanfm.sourceforge.net/"
-
-LICENSE = "LGPLv2+"
-LIC_FILES_CHKSUM = "file://src/fm-extra.h;beginline=8;endline=21;md5=ef1f84da64b3c01cca447212f7ef6007"
-
-SECTION = "x11/libs"
-DEPENDS = "glib-2.0 intltool-native gettext-native"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/libfm-${PV}.tar.xz \
-           file://0001-nls.m4-Take-it-from-gettext-0.15.patch \
-          "
-
-SRC_URI[md5sum] = "74997d75e7e87dc73398746fd373bf52"
-SRC_URI[sha256sum] = "7804f6f28cb3d1bc8ffb3151ab7ff0c063b27c5f9b06c682eb903e01cf25502f"
-
-S = "${WORKDIR}/libfm-${PV}"
-
-EXTRA_OECONF = "--with-extra-only --with-gtk=no"
-
-inherit autotools pkgconfig gtk-doc
-
-do_configure[dirs] =+ "${S}/m4"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra_1.2.5.bb b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra_1.2.5.bb
new file mode 100644
index 0000000..0134572
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra_1.2.5.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Library for file management"
+HOMEPAGE = "http://pcmanfm.sourceforge.net/"
+
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://src/fm-extra.h;beginline=8;endline=21;md5=ef1f84da64b3c01cca447212f7ef6007"
+
+SECTION = "x11/libs"
+DEPENDS = "glib-2.0 intltool-native gettext-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/libfm-${PV}.tar.xz \
+           file://0001-nls.m4-Take-it-from-gettext-0.15.patch \
+          "
+
+SRC_URI[md5sum] = "a1ba9ae5e920f38b647dd511edd6c807"
+SRC_URI[sha256sum] = "c706bb1020cf5f2d6f5a9226f692ce1985947134dcf2bde64278bd0420779b5a"
+
+S = "${WORKDIR}/libfm-${PV}"
+
+EXTRA_OECONF = "--with-extra-only --with-gtk=no"
+
+inherit autotools pkgconfig gtk-doc
+
+do_configure[dirs] =+ "${S}/m4"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libfm/libfm/0001-Correctly-check-the-stamp-file-that-indicates-if-we-.patch b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm/0001-Correctly-check-the-stamp-file-that-indicates-if-we-.patch
new file mode 100644
index 0000000..fb91d90
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm/0001-Correctly-check-the-stamp-file-that-indicates-if-we-.patch
@@ -0,0 +1,28 @@
+From 23c6e9df611c86a5e97079e1b88c7a18474bf0bc Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 16 Dec 2016 16:52:04 +0200
+Subject: [PATCH] Correctly check the stamp file that indicates if we need to
+ re-build vala code
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index d043b3d..0e85590 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -42,7 +42,7 @@ AM_COND_IF(EXTRALIB_ONLY,
+     [enable_actions=no])
+ if test x"$enable_actions" = xyes; then
+     dnl no vala compiler required when sources are from dist tarball
+-    if test -f src/actions/libfmactions_la_vala.stamp; then
++    if test -f $srcdir/src/actions/libfmactions_la_vala.stamp; then
+         AM_PROG_VALAC
+     else
+         AM_PROG_VALAC([0.13.0])
+-- 
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libfm/libfm_1.2.4.bb b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm_1.2.4.bb
deleted file mode 100644
index 2218f9c..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libfm/libfm_1.2.4.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-SUMMARY = "Library for file management"
-HOMEPAGE = "http://pcmanfm.sourceforge.net/"
-
-LICENSE = "GPLv2+ & LGPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=4641e94ec96f98fabc56ff9cc48be14b \
-                    file://src/fm.h;beginline=8;endline=21;md5=ef1f84da64b3c01cca447212f7ef6007 \
-                    file://src/base/fm-config.h;beginline=10;endline=23;md5=ef1f84da64b3c01cca447212f7ef6007 \
-                    file://src/fm-gtk.h;beginline=6;endline=19;md5=646baa4955c04fe768f2ca27b92ac8dd"
-
-
-SECTION = "x11/libs"
-DEPENDS = "glib-2.0 pango gtk+3 menu-cache intltool-native libexif libfm-extra gettext-native"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/libfm-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "74997d75e7e87dc73398746fd373bf52"
-SRC_URI[sha256sum] = "7804f6f28cb3d1bc8ffb3151ab7ff0c063b27c5f9b06c682eb903e01cf25502f"
-
-inherit autotools pkgconfig gtk-doc distro_features_check
-ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
-
-EXTRA_OECONF = "--with-gtk=3"
-
-do_configure[dirs] =+ "${S}/m4"
-
-PACKAGES += "${PN}-mime"
-FILES_${PN}-mime = "${datadir}/mime/"
-
-do_install_append () {
-    # remove files which are part of libfm-extra
-    rm -f ${D}${includedir}/libfm-1.0/fm-xml-file.h
-    rm -f ${D}${includedir}/libfm-1.0/fm-version.h
-    rm -f ${D}${includedir}/libfm-1.0/fm-extra.h
-    rm -f ${D}${libdir}/pkgconfig/libfm-extra.pc
-    rm -f ${D}${libdir}/libfm-extra.so*
-    rm -f ${D}${libdir}/libfm-extra.a
-    rm -f ${D}${libdir}/libfm-extra.la
-}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libfm/libfm_1.2.5.bb b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm_1.2.5.bb
new file mode 100644
index 0000000..aca59e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm_1.2.5.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Library for file management"
+HOMEPAGE = "http://pcmanfm.sourceforge.net/"
+
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4641e94ec96f98fabc56ff9cc48be14b \
+                    file://src/fm.h;beginline=8;endline=21;md5=ef1f84da64b3c01cca447212f7ef6007 \
+                    file://src/base/fm-config.h;beginline=10;endline=23;md5=ef1f84da64b3c01cca447212f7ef6007 \
+                    file://src/fm-gtk.h;beginline=6;endline=19;md5=646baa4955c04fe768f2ca27b92ac8dd"
+
+
+SECTION = "x11/libs"
+DEPENDS = "glib-2.0 pango gtk+3 menu-cache intltool-native libexif libfm-extra gettext-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/libfm-${PV}.tar.xz \
+           file://0001-Correctly-check-the-stamp-file-that-indicates-if-we-.patch"
+
+SRC_URI[md5sum] = "a1ba9ae5e920f38b647dd511edd6c807"
+SRC_URI[sha256sum] = "c706bb1020cf5f2d6f5a9226f692ce1985947134dcf2bde64278bd0420779b5a"
+
+inherit autotools pkgconfig gtk-doc distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+EXTRA_OECONF = "--with-gtk=3"
+
+do_configure[dirs] =+ "${S}/m4"
+
+PACKAGES += "${PN}-mime"
+FILES_${PN}-mime = "${datadir}/mime/"
+
+do_install_append () {
+    # remove files which are part of libfm-extra
+    rm -f ${D}${includedir}/libfm-1.0/fm-xml-file.h
+    rm -f ${D}${includedir}/libfm-1.0/fm-version.h
+    rm -f ${D}${includedir}/libfm-1.0/fm-extra.h
+    rm -f ${D}${libdir}/pkgconfig/libfm-extra.pc
+    rm -f ${D}${libdir}/libfm-extra.so*
+    rm -f ${D}${libdir}/libfm-extra.a
+    rm -f ${D}${libdir}/libfm-extra.la
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch
index f6c4ca7..0a4dfe6 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch
+++ b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch
@@ -2,7 +2,7 @@
 Upstream-Status: Backport
 Signed-off-by: Ross Burton <ross.burton@intel.com>
 
-From b3cab278eb9c2ceda79f980bc26460d97f260041 Mon Sep 17 00:00:00 2001
+From 4a1768d683f6572ad86d833508c70e6b3dc1efdc Mon Sep 17 00:00:00 2001
 From: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
 Date: Thu, 19 Jan 2017 17:00:15 +0100
 Subject: [PATCH] ecc: Store EdDSA session key in secure memory.
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/CVE-2017-7526.patch b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/CVE-2017-7526.patch
index 7180e7a..384fa96 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/CVE-2017-7526.patch
+++ b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/CVE-2017-7526.patch
@@ -5,7 +5,7 @@
 Upstream-Status: Backport
 Signed-off-by: Ross Burton <ross.burton@intel.com>
 
-From 56bd068335500207dea2cece9cc662bcd9658951 Mon Sep 17 00:00:00 2001
+From 12ee400c39e0ebb5fb819c3926d459c278fc99fd Mon Sep 17 00:00:00 2001
 From: NIIBE Yutaka <gniibe@fsij.org>
 Date: Tue, 4 Apr 2017 17:38:05 +0900
 Subject: [PATCH 1/5] mpi: Simplify mpi_powm.
@@ -186,7 +186,7 @@
 2.11.0
 
 
-From 6e237c8c48d257dc315e364791d284c6bf3fa703 Mon Sep 17 00:00:00 2001
+From a4b275c4d5378837e820fdc84f4ada876f9c8ccd Mon Sep 17 00:00:00 2001
 From: NIIBE Yutaka <gniibe@fsij.org>
 Date: Sat, 24 Jun 2017 20:46:20 +0900
 Subject: [PATCH 2/5] Same computation for square and multiply.
@@ -287,7 +287,7 @@
 2.11.0
 
 
-From bf059348dafc1b8d29e07b9426d870ead853db84 Mon Sep 17 00:00:00 2001
+From 129c1960e55603ec3f6fd1cd9cd51b22e9a9a7ef Mon Sep 17 00:00:00 2001
 From: NIIBE Yutaka <gniibe@fsij.org>
 Date: Thu, 29 Jun 2017 11:48:44 +0900
 Subject: [PATCH 3/5] rsa: Add exponent blinding.
@@ -390,7 +390,7 @@
 2.11.0
 
 
-From 09b9df2675a24e679b7944352ad6385e9e68474f Mon Sep 17 00:00:00 2001
+From 8e1a6289b7d11a8bf6c94affa06c9794e7216e26 Mon Sep 17 00:00:00 2001
 From: NIIBE Yutaka <gniibe@fsij.org>
 Date: Thu, 29 Jun 2017 12:36:27 +0900
 Subject: [PATCH 4/5] rsa: Fix exponent blinding.
@@ -422,7 +422,7 @@
 2.11.0
 
 
-From 1323fdcf6f2f9fd1da8c5adf396650f15a2a1260 Mon Sep 17 00:00:00 2001
+From 4e5497752172edc444029af645f28cb88ce93906 Mon Sep 17 00:00:00 2001
 From: NIIBE Yutaka <gniibe@fsij.org>
 Date: Thu, 29 Jun 2017 12:40:19 +0900
 Subject: [PATCH 5/5] rsa: More fix.
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt.inc b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt.inc
index 00870e3..3403579 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt.inc
+++ b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt.inc
@@ -12,7 +12,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
                     file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff"
 
-DEPENDS = "libgpg-error libcap"
+DEPENDS = "libgpg-error"
 
 UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
 SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.gz \
@@ -28,7 +28,10 @@
 
 inherit autotools texinfo binconfig-disabled pkgconfig
 
-EXTRA_OECONF = "--disable-asm --with-capabilities"
+EXTRA_OECONF = "--disable-asm"
+
+PACKAGECONFIG ??= "capabilities"
+PACKAGECONFIG[capabilities] = "--with-capabilities,--without-capabilities,libcap"
 
 do_configure_prepend () {
 	# Else this could be used in preference to the one in aclocal-copy
@@ -48,4 +51,4 @@
 
 ARM_INSTRUCTION_SET = "arm"
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt_1.7.3.bb b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt_1.7.3.bb
deleted file mode 100644
index ddd7c53..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt_1.7.3.bb
+++ /dev/null
@@ -1,4 +0,0 @@
-require libgcrypt.inc
-
-SRC_URI[md5sum] = "bb5b00cb70b1215833857fd690080fbb"
-SRC_URI[sha256sum] = "c98470cf6a781f2af4bdfda710ad39f0f54b5044e8c43b878d4005737d6c213f"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt_1.7.6.bb b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt_1.7.6.bb
new file mode 100644
index 0000000..da0a1fe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt_1.7.6.bb
@@ -0,0 +1,4 @@
+require libgcrypt.inc
+
+SRC_URI[md5sum] = "eac6d11999650e8a1493674c1bdbc7f8"
+SRC_URI[sha256sum] = "fc0aec7714d75d812b665bd510d66031b1b2ce8fa855cc2c02238c954ea36982"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error_1.24.bb b/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error_1.24.bb
deleted file mode 100644
index 84a882a..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error_1.24.bb
+++ /dev/null
@@ -1,53 +0,0 @@
-SUMMARY = "Small library that defines common error values for all GnuPG components"
-HOMEPAGE = "http://www.gnupg.org/related_software/libgpg-error/"
-BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
-
-LICENSE = "GPLv2+ & LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
-                    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
-                    file://src/gpg-error.h.in;endline=23;md5=cf562f60b9dba7df20d6ee3f97ea1d5a \
-                    file://src/init.c;endline=20;md5=872b2389fe9bae7ffb80d2b91225afbc"
-
-
-SECTION = "libs"
-
-UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
-SRC_URI = "${GNUPG_MIRROR}/libgpg-error/libgpg-error-${PV}.tar.bz2 \
-           file://pkgconfig.patch \
-	  "
-SRC_URI[md5sum] = "feb42198c0aaf3b28eabe8f41a34b983"
-SRC_URI[sha256sum] = "9268e1cc487de5e6e4460fca612a06e4f383072ac43ae90603e5e46783d3e540"
-
-BINCONFIG = "${bindir}/gpg-error-config"
-
-inherit autotools binconfig-disabled pkgconfig gettext
-CPPFLAGS += "-P"
-do_compile_prepend() {
-	TARGET_FILE=linux-gnu
-	if [ ${TARGET_OS} != "linux" ]; then
-		TARGET_FILE=${TARGET_OS}
-	fi
-
-	case ${TARGET_ARCH} in
-	  aarch64_be) TUPLE=aarch64-unknown-linux-gnu ;;
-	  arm)	      TUPLE=arm-unknown-linux-gnueabi ;;
-	  armeb)      TUPLE=arm-unknown-linux-gnueabi ;;
-	  i586|i686)  TUPLE=i686-pc-linux-gnu ;;
-	  mips*el)    TUPLE=mipsel-unknown-linux-gnu ;;
-	  mips*)      TUPLE=mips-unknown-linux-gnu ;;
-	  x86_64)     TUPLE=x86_64-pc-linux-gnu ;;
-	  *)          TUPLE=${TARGET_ARCH}-unknown-linux-gnu ;; 
-	esac
-
-	cp ${S}/src/syscfg/lock-obj-pub.$TUPLE.h \
-	  ${S}/src/syscfg/lock-obj-pub.$TARGET_FILE.h
-}
-
-do_install_append() {
-	# we don't have common lisp in OE
-	rm -rf "${D}${datadir}/common-lisp/"
-}
-
-FILES_${PN}-dev += "${bindir}/gpg-error"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error_1.26.bb b/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error_1.26.bb
new file mode 100644
index 0000000..090db1b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error_1.26.bb
@@ -0,0 +1,62 @@
+SUMMARY = "Small library that defines common error values for all GnuPG components"
+HOMEPAGE = "http://www.gnupg.org/related_software/libgpg-error/"
+BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://src/gpg-error.h.in;endline=23;md5=64af9846baaf852793fd3a5af393acbf \
+                    file://src/init.c;endline=20;md5=872b2389fe9bae7ffb80d2b91225afbc"
+
+
+SECTION = "libs"
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/libgpg-error/libgpg-error-${PV}.tar.bz2 \
+           file://pkgconfig.patch \
+	  "
+
+SRC_URI[md5sum] = "97456709dbbcbb69354317ffe3e347cd"
+SRC_URI[sha256sum] = "4c4bcbc90116932e3acd37b37812d8653b1b189c1904985898e860af818aee69"
+PR = "r1"
+
+BINCONFIG = "${bindir}/gpg-error-config"
+
+inherit autotools binconfig-disabled pkgconfig gettext
+CPPFLAGS += "-P"
+do_compile_prepend() {
+	TARGET_FILE=linux-gnu
+	if [ ${TARGET_OS} = "mingw32" ]; then
+		# There are no arch specific syscfg files for mingw32
+		TARGET_FILE=
+	elif [ ${TARGET_OS} != "linux" ]; then
+		TARGET_FILE=${TARGET_OS}
+	fi
+
+	case ${TARGET_ARCH} in
+	  aarch64_be) TUPLE=aarch64-unknown-linux-gnu ;;
+	  arm)	      TUPLE=arm-unknown-linux-gnueabi ;;
+	  armeb)      TUPLE=arm-unknown-linux-gnueabi ;;
+	  i586|i686)  TUPLE=i686-pc-linux-gnu ;;
+	  mips64*)    TUPLE=mips64el-unknown-linux-gnuabi64 ;;
+	  mips*el)    TUPLE=mipsel-unknown-linux-gnu ;;
+	  mips*)      TUPLE=mips-unknown-linux-gnu ;;
+	  x86_64)     TUPLE=x86_64-pc-linux-gnu ;;
+	  *)          TUPLE=${TARGET_ARCH}-unknown-linux-gnu ;; 
+	esac
+
+	if [ -n "$TARGET_FILE" ]; then
+		cp ${S}/src/syscfg/lock-obj-pub.$TUPLE.h \
+			${S}/src/syscfg/lock-obj-pub.$TARGET_FILE.h
+	fi
+}
+
+do_install_append() {
+	# we don't have common lisp in OE
+	rm -rf "${D}${datadir}/common-lisp/"
+}
+
+FILES_${PN}-dev += "${bindir}/gpg-error"
+FILES_${PN}-doc += "${datadir}/libgpg-error/errorref.txt"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch
deleted file mode 100644
index 3cbf549..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-It adds the variables that are needed
-for autoconf 2.65 to reconfigure libiconv and defines the m4 macros 
-directory. Its imported from OE.
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Index: libiconv-1.11.1/configure.ac
-===================================================================
---- libiconv-1.11.1.orig/configure.ac
-+++ libiconv-1.11.1/configure.ac
-@@ -23,7 +23,7 @@ AC_CONFIG_AUX_DIR(build-aux)
- AM_INIT_AUTOMAKE(libiconv, 1.11)
- AC_CONFIG_HEADERS(config.h lib/config.h)
- AC_PROG_MAKE_SET
--
-+AC_CONFIG_MACRO_DIR([m4])
- dnl           checks for basic programs
- 
- AC_PROG_CC
-Index: libiconv-1.11.1/libcharset/configure.ac
-===================================================================
---- libiconv-1.11.1.orig/libcharset/configure.ac
-+++ libiconv-1.11.1/libcharset/configure.ac
-@@ -16,17 +16,17 @@ dnl along with the GNU CHARSET Library;
- dnl write to the Free Software Foundation, Inc., 51 Franklin Street,
- dnl Fifth Floor, Boston, MA 02110-1301, USA.
- 
--AC_PREREQ(2.13)
-+AC_PREREQ(2.61)
-+AC_INIT([libcharset],[1.4] )
-+AC_CONFIG_SRCDIR([lib/localcharset.c])
- 
--PACKAGE=libcharset
--VERSION=1.4
--
--AC_INIT(lib/localcharset.c)
- AC_CONFIG_AUX_DIR(build-aux)
- AC_CONFIG_HEADER(config.h)
- AC_PROG_MAKE_SET
--AC_SUBST(PACKAGE)
--AC_SUBST(VERSION)
-+dnl AC_SUBST(PACKAGE)
-+dnl AC_SUBST(VERSION)
-+
-+AC_CONFIG_MACRO_DIR([m4])
- 
- dnl           checks for basic programs
- 
diff --git a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch
deleted file mode 100644
index fb07f73..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-With libtool generating shared and static version of libraries needs -fPIC flags
-without this it will not generate the commands to create shared linked library
-Its more enforced by libtool 2.4. I have not checked it with older libtool
-libiconv 1.11.x is relatively old release and libtool 2.4 did not exist when it
-was released these kind of problem are more likely
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Index: libiconv-1.11.1/lib/Makefile.in
-===================================================================
---- libiconv-1.11.1.orig/lib/Makefile.in
-+++ libiconv-1.11.1/lib/Makefile.in
-@@ -70,9 +70,9 @@ preloadable_libiconv.so : preloadable_li
- 
- preloadable_libiconv_linux.so : $(SOURCES)
- 	if test -n "@GCC@"; then \
--	  $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -fPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -shared -o preloadable_libiconv_linux.so; \
-+	  $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -fPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -rpath $(libdir) -o libpreload_iconv.la && cp .libs/libpreload_iconv.so preloadable_libiconv_linux.so; \
- 	else \
--	  $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -KPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -shared -o preloadable_libiconv_linux.so; \
-+	  $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -KPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -rpath $(libdir) -o libpreload_iconv.la && cp .libs/libpreload_iconv.so preloadable_libiconv_linux.so; \
- 	fi
- 
- preloadable_libiconv_solaris.so : $(SOURCES)
diff --git a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.11.1.bb b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.11.1.bb
deleted file mode 100644
index 6ce4b96..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.11.1.bb
+++ /dev/null
@@ -1,47 +0,0 @@
-SUMMARY = "Character encoding support library"
-DESCRIPTION = "GNU libiconv - libiconv is for you if your application needs to support \
-multiple character encodings, but that support lacks from your system."
-HOMEPAGE = "http://www.gnu.org/software/libiconv"
-SECTION = "libs"
-NOTES = "Needs to be stripped down to: ascii iso8859-1 eucjp iso-2022jp gb utf8"
-PROVIDES = "virtual/libiconv"
-
-LICENSE = "LGPLv2.0"
-LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \
-                    file://libcharset/COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
-
-SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
-           file://autoconf.patch \
-	   file://shared_preloadable_libiconv_linux.patch \
-          "
-
-SRC_URI[md5sum] = "d42b97f6ef5dd0ba4469d520ed732fed"
-SRC_URI[sha256sum] = "e78c347a1a0cb15f2648519e9799151f4b4a934b61ad9ee7424478efe2b8257f"
-
-S = "${WORKDIR}/libiconv-${PV}"
-
-inherit autotools pkgconfig gettext
-
-python __anonymous() {
-    if d.getVar("TCLIBC", True) == "glibc":
-        raise bb.parse.SkipPackage("libiconv is provided for use with uClibc only - glibc already provides iconv")
-}
-
-EXTRA_OECONF += "--enable-shared --enable-static --enable-relocatable"
-
-LEAD_SONAME = "libiconv.so"
-
-do_configure_prepend () {
-	rm -f ${S}/m4/libtool.m4 ${S}/m4/ltoptions.m4 ${S}/m4/ltsugar.m4 ${S}/m4/ltversion.m4 ${S}/m4/lt~obsolete.m4 ${S}/libcharset/m4/libtool.m4 ${S}/libcharset/m4/ltoptions.m4 ${S}/libcharset/m4/ltsugar.m4 ${S}/libcharset/m4/ltversion.m4 ${S}/libcharset/m4/lt~obsolete.m4
-}
-
-do_configure_append () {
-        # forcibly remove RPATH from libtool
-        sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' *libtool
-        sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=_NO_RPATH_|g' *libtool
-}
-
-do_install_append () {
-	rm -rf ${D}${libdir}/preloadable_libiconv.so
-	rm -rf ${D}${libdir}/charset.alias
-}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.14.bb b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.14.bb
index 1b6fe09..9fd5114 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.14.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.14.bb
@@ -23,9 +23,9 @@
 inherit autotools pkgconfig gettext
 
 python __anonymous() {
-    if d.getVar("TARGET_OS", True) != "linux":
+    if d.getVar("TARGET_OS") != "linux":
         return
-    if d.getVar("TCLIBC", True) == "glibc":
+    if d.getVar("TCLIBC") == "glibc":
         raise bb.parse.SkipPackage("libiconv is provided for use with uClibc only - glibc already provides iconv")
 }
 
diff --git a/import-layers/yocto-poky/meta/recipes-support/libksba/libksba_1.3.4.bb b/import-layers/yocto-poky/meta/recipes-support/libksba/libksba_1.3.4.bb
deleted file mode 100644
index e68255c..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libksba/libksba_1.3.4.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "Easy API to create and parse X.509 and CMS related objects"
-HOMEPAGE = "http://www.gnupg.org/related_software/libksba/"
-LICENSE = "GPLv2+ | LGPLv3+ | GPLv3+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=fd541d83f75d038c4e0617b672ed8bda \
-                    file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://COPYING.GPLv3;md5=2f31b266d3440dd7ee50f92cf67d8e6c \
-                    file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02 \
-                   "
-
-DEPENDS = "libgpg-error"
-
-BINCONFIG = "${bindir}/ksba-config"
-
-inherit autotools binconfig-disabled pkgconfig texinfo
-
-UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
-SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
-           file://ksba-add-pkgconfig-support.patch"
-
-SRC_URI[md5sum] = "2bfc3d69053db7b6983b5627706033f4"
-SRC_URI[sha256sum] = "f6c2883cebec5608692d8730843d87f237c0964d923bbe7aa89c05f20558ad4f"
-
-do_configure_prepend () {
-	# Else these could be used in preference to those in aclocal-copy
-	rm -f ${S}/m4/gpg-error.m4
-}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libksba/libksba_1.3.5.bb b/import-layers/yocto-poky/meta/recipes-support/libksba/libksba_1.3.5.bb
new file mode 100644
index 0000000..36b6670
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libksba/libksba_1.3.5.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Easy API to create and parse X.509 and CMS related objects"
+HOMEPAGE = "http://www.gnupg.org/related_software/libksba/"
+LICENSE = "GPLv2+ | LGPLv3+ | GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd541d83f75d038c4e0617b672ed8bda \
+                    file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.GPLv3;md5=2f31b266d3440dd7ee50f92cf67d8e6c \
+                    file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02 \
+                   "
+
+DEPENDS = "libgpg-error"
+
+BINCONFIG = "${bindir}/ksba-config"
+
+inherit autotools binconfig-disabled pkgconfig texinfo
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
+           file://ksba-add-pkgconfig-support.patch"
+
+SRC_URI[md5sum] = "8302a3e263a7c630aa7dea7d341f07a2"
+SRC_URI[sha256sum] = "41444fd7a6ff73a79ad9728f985e71c9ba8cd3e5e53358e70d5f066d35c1a340"
+
+do_configure_prepend () {
+	# Else these could be used in preference to those in aclocal-copy
+	rm -f ${S}/m4/gpg-error.m4
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/0001-lib-add-utility-function-nl_strerror_l.patch b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/0001-lib-add-utility-function-nl_strerror_l.patch
deleted file mode 100644
index b734028..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/0001-lib-add-utility-function-nl_strerror_l.patch
+++ /dev/null
@@ -1,146 +0,0 @@
-From 683f27fbb68ca2028a7b3468f17164d484df2759 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
-Date: Thu, 25 Aug 2016 13:14:59 +0100
-Subject: [PATCH 1/3] lib: add utility function nl_strerror_l()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-libnl currently uses strerror_r() throughout, but this is
-problematic because there is a non-standard GNU version
-implemented in glibc, and the standard POSIX version, which
-differ in signature. When using glibc, one can choose
-between the two versions using feature test macros
-_GNU_SOURCE and _POSIX_C_SOURCE.
-
-Given libnl is built using the former, we always get the
-glibc special version, and all code so far has been written
-for that non-standard version.
-
-Other C libraries like musl on the other hand only try
-to be posix compliant, and only ever provide the posix
-version of strerror_r(), which has a different signature.
-
-The alternative is to use strerror_l() rather than
-strerror_r() http://austingroupbugs.net/view.php?id=655
-- this will avoid the non-confirming versions issue
-- strerror_l() is now recommended by POSIX to replace
-  strerror_r() usage
-
-So rather than changing all uses of strerror_r() to be in
-line with posix, we are going to switch to the recommended
-interface strerror_l().
-
-Since strerror_l() is slightly more difficuly to use, we
-add a little (private) wrapper that we can use from all
-current callsites of strerror_r().
-
-Signed-off-by: André Draszik <adraszik@tycoint.com>
-Reviewed-by: Stephane Ayotte <sayotte@tycoint.com>
-Signed-off-by: Thomas Haller <thaller@redhat.com>
----
-Upstream-Status: Backport https://github.com/thom311/libnl/commit/683f27fbb68ca2028a7b3468f17164d484df2759
- include/Makefile.am             |  1 +
- include/netlink-private/utils.h | 17 +++++++++++++++++
- lib/utils.c                     | 24 ++++++++++++++++++++++++
- libnl-3.sym                     |  5 +++++
- 4 files changed, 47 insertions(+)
- create mode 100644 include/netlink-private/utils.h
-
-diff --git a/include/Makefile.am b/include/Makefile.am
-index 804e984..f8b977a 100644
---- a/include/Makefile.am
-+++ b/include/Makefile.am
-@@ -166,6 +166,7 @@ noinst_HEADERS = \
- 	netlink-private/socket.h \
- 	netlink-private/tc.h \
- 	netlink-private/types.h \
-+	netlink-private/utils.h \
- 	netlink-private/cache-api.h \
- 	netlink-private/object-api.h \
- 	netlink-private/route/link/api.h \
-diff --git a/include/netlink-private/utils.h b/include/netlink-private/utils.h
-new file mode 100644
-index 0000000..77aadb3
---- /dev/null
-+++ b/include/netlink-private/utils.h
-@@ -0,0 +1,17 @@
-+/*
-+ * netlink-private/utils.h	Local Utility Functions
-+ *
-+ *	This library is free software; you can redistribute it and/or
-+ *	modify it under the terms of the GNU Lesser General Public
-+ *	License as published by the Free Software Foundation version 2.1
-+ *	of the License.
-+ *
-+ * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch>
-+ */
-+
-+#ifndef NETLINK_UTILS_PRIV_H_
-+#define NETLINK_UTILS_PRIV_H_
-+
-+extern const char *	nl_strerror_l(int err);
-+
-+#endif
-diff --git a/lib/utils.c b/lib/utils.c
-index 61c3d95..c1c1b72 100644
---- a/lib/utils.c
-+++ b/lib/utils.c
-@@ -25,10 +25,12 @@
-  */
- 
- #include <netlink-private/netlink.h>
-+#include <netlink-private/utils.h>
- #include <netlink/netlink.h>
- #include <netlink/utils.h>
- #include <linux/socket.h>
- #include <stdlib.h> /* exit() */
-+#include <locale.h>
- 
- /**
-  * Global variable indicating the desired level of debugging output.
-@@ -118,6 +120,28 @@ int __nl_read_num_str_file(const char *path, int (*cb)(long, const char *))
- 
- 	return 0;
- }
-+
-+const char *nl_strerror_l(int err)
-+{
-+	int errno_save = errno;
-+	locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0);
-+	const char *buf;
-+
-+	if (loc == (locale_t)0) {
-+		if (errno == ENOENT)
-+			loc = newlocale(LC_MESSAGES_MASK,
-+					"POSIX", (locale_t)0);
-+	}
-+	if (loc != (locale_t)0) {
-+		buf = strerror_l(err, loc);
-+		freelocale(loc);
-+	} else {
-+		buf = "newlocale() failed";
-+	}
-+
-+	errno = errno_save;
-+	return buf;
-+}
- /** @endcond */
- 
- /**
-diff --git a/libnl-3.sym b/libnl-3.sym
-index 4e09bdd..9119e66 100644
---- a/libnl-3.sym
-+++ b/libnl-3.sym
-@@ -351,3 +351,8 @@ libnl_3_2_28 {
- global:
- 	nl_object_diff64;
- } libnl_3_2_27;
-+
-+libnl_3_2_29 {
-+global:
-+	nl_strerror_l;
-+} libnl_3_2_28;
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/0002-lib-switch-to-using-strerror_l-instead-of-strerror_r.patch b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/0002-lib-switch-to-using-strerror_l-instead-of-strerror_r.patch
deleted file mode 100644
index 6347ec0..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/0002-lib-switch-to-using-strerror_l-instead-of-strerror_r.patch
+++ /dev/null
@@ -1,403 +0,0 @@
-From c1948ec29b8dcdc58d2d92700c325abdeab111a6 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
-Date: Thu, 25 Aug 2016 13:15:00 +0100
-Subject: [PATCH 2/3] lib: switch to using strerror_l() instead of strerror_r()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-glibc provides two versions of strerror_r(), which
-can be chosen between using feature test macros
-_GNU_SOURCE and _POSIX_C_SOURCE. libnl is built using
-the former, hence we get the glibc special version,
-and all code so far has been written for this.
-
-Other C libraries like musl on the other hand only try
-to be posix compliant, and only ever provide the posix
-version of strerror_r(), which has a different signature.
-
-Uses in libnl hence generally cause printf() of an *int*
-with a *string format* specifier for that reason.
-
-Additionally, strerror_r() has been deprecated:
-  http://austingroupbugs.net/view.php?id=655
-
-Switch to using strerror_l() (via our wrapper just
-introduced).
-
-Signed-off-by: André Draszik <adraszik@tycoint.com>
-Reviewed-by: Stephane Ayotte <sayotte@tycoint.com>
-Signed-off-by: Thomas Haller <thaller@redhat.com>
----
-Upstream-Status: Backport https://github.com/thom311/libnl/commit/c1948ec29b8dcdc58d2d92700c325abdeab111a6
- lib/cache_mngr.c        |  5 ++---
- lib/fib_lookup/lookup.c |  3 ++-
- lib/handlers.c          |  4 ++--
- lib/msg.c               |  4 ++--
- lib/nl.c                | 26 +++++++++-----------------
- lib/route/route_obj.c   |  3 ++-
- lib/socket.c            | 33 +++++++++++----------------------
- 7 files changed, 30 insertions(+), 48 deletions(-)
-
-diff --git a/lib/cache_mngr.c b/lib/cache_mngr.c
-index b9eb345..1f23eb1 100644
---- a/lib/cache_mngr.c
-+++ b/lib/cache_mngr.c
-@@ -33,6 +33,7 @@
-  */
- 
- #include <netlink-private/netlink.h>
-+#include <netlink-private/utils.h>
- #include <netlink/netlink.h>
- #include <netlink/cache.h>
- #include <netlink/utils.h>
-@@ -392,10 +393,8 @@ int nl_cache_mngr_poll(struct nl_cache_mngr *mngr, int timeout)
- 	ret = poll(&fds, 1, timeout);
- 	NL_DBG(3, "Cache manager %p, poll() returned %d\n", mngr, ret);
- 	if (ret < 0) {
--		char buf[64];
--
- 		NL_DBG(4, "nl_cache_mngr_poll(%p): poll() failed with %d (%s)\n",
--			mngr, errno, strerror_r(errno, buf, sizeof(buf)));
-+			mngr, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 
-diff --git a/lib/fib_lookup/lookup.c b/lib/fib_lookup/lookup.c
-index 43b6126..efc862b 100644
---- a/lib/fib_lookup/lookup.c
-+++ b/lib/fib_lookup/lookup.c
-@@ -17,6 +17,7 @@
-  */
- 
- #include <netlink-private/netlink.h>
-+#include <netlink-private/utils.h>
- #include <netlink/netlink.h>
- #include <netlink/attr.h>
- #include <netlink/utils.h>
-@@ -133,7 +134,7 @@ static void result_dump_line(struct nl_object *obj, struct nl_dump_params *p)
- 		     nl_rtntype2str(res->fr_type, buf, sizeof(buf)));
- 	nl_dump(p, "scope %s error %s (%d)\n",
- 		rtnl_scope2str(res->fr_scope, buf, sizeof(buf)),
--		strerror_r(-res->fr_error, buf, sizeof(buf)), res->fr_error);
-+		nl_strerror_l(-res->fr_error), res->fr_error);
- }
- 
- static void result_dump_details(struct nl_object *obj, struct nl_dump_params *p)
-diff --git a/lib/handlers.c b/lib/handlers.c
-index 97a0d9c..4a48b99 100644
---- a/lib/handlers.c
-+++ b/lib/handlers.c
-@@ -26,6 +26,7 @@
-  */
- 
- #include <netlink-private/netlink.h>
-+#include <netlink-private/utils.h>
- #include <netlink/netlink.h>
- #include <netlink/utils.h>
- #include <netlink/msg.h>
-@@ -79,10 +80,9 @@ static int nl_error_handler_verbose(struct sockaddr_nl *who,
- 				    struct nlmsgerr *e, void *arg)
- {
- 	FILE *ofd = arg ? arg : stderr;
--	char buf[256];
- 
- 	fprintf(ofd, "-- Error received: %s\n-- Original message: ",
--		strerror_r(-e->error, buf, sizeof(buf)));
-+		nl_strerror_l(-e->error));
- 	print_header_content(ofd, &e->msg);
- 	fprintf(ofd, "\n");
- 
-diff --git a/lib/msg.c b/lib/msg.c
-index e8a7e99..9af3f3a 100644
---- a/lib/msg.c
-+++ b/lib/msg.c
-@@ -27,6 +27,7 @@
-  */
- 
- #include <netlink-private/netlink.h>
-+#include <netlink-private/utils.h>
- #include <netlink/netlink.h>
- #include <netlink/utils.h>
- #include <netlink/cache.h>
-@@ -913,11 +914,10 @@ static void dump_error_msg(struct nl_msg *msg, FILE *ofd)
- 	fprintf(ofd, "  [ERRORMSG] %zu octets\n", sizeof(*err));
- 
- 	if (nlmsg_len(hdr) >= sizeof(*err)) {
--		char buf[256];
- 		struct nl_msg *errmsg;
- 
- 		fprintf(ofd, "    .error = %d \"%s\"\n", err->error,
--			strerror_r(-err->error, buf, sizeof(buf)));
-+			nl_strerror_l(-err->error));
- 		fprintf(ofd, "  [ORIGINAL MESSAGE] %zu octets\n", sizeof(*hdr));
- 
- 		errmsg = nlmsg_inherit(&err->msg);
-diff --git a/lib/nl.c b/lib/nl.c
-index 123f657..a45c3ea 100644
---- a/lib/nl.c
-+++ b/lib/nl.c
-@@ -27,6 +27,7 @@
- 
- #include <netlink-private/netlink.h>
- #include <netlink-private/socket.h>
-+#include <netlink-private/utils.h>
- #include <netlink/netlink.h>
- #include <netlink/utils.h>
- #include <netlink/handlers.h>
-@@ -105,7 +106,6 @@ int nl_connect(struct nl_sock *sk, int protocol)
- 	int errsv;
- 	socklen_t addrlen;
- 	struct sockaddr_nl local = { 0 };
--	char buf[64];
- 	int try_bind = 1;
- 
- #ifdef SOCK_CLOEXEC
-@@ -119,7 +119,7 @@ int nl_connect(struct nl_sock *sk, int protocol)
- 	if (sk->s_fd < 0) {
- 		errsv = errno;
- 		NL_DBG(4, "nl_connect(%p): socket() failed with %d (%s)\n", sk, errsv,
--			strerror_r(errsv, buf, sizeof(buf)));
-+			nl_strerror_l(errsv));
- 		err = -nl_syserr2nlerr(errsv);
- 		goto errout;
- 	}
-@@ -158,7 +158,7 @@ int nl_connect(struct nl_sock *sk, int protocol)
- 				_nl_socket_used_ports_set(used_ports, port);
- 			} else {
- 				NL_DBG(4, "nl_connect(%p): bind() for port %u failed with %d (%s)\n",
--					sk, (unsigned) port, errsv, strerror_r(errsv, buf, sizeof(buf)));
-+					sk, (unsigned) port, errsv, nl_strerror_l(errsv));
- 				_nl_socket_used_ports_release_all(used_ports);
- 				err = -nl_syserr2nlerr(errsv);
- 				goto errout;
-@@ -172,7 +172,7 @@ int nl_connect(struct nl_sock *sk, int protocol)
- 		if (err != 0) {
- 			errsv = errno;
- 			NL_DBG(4, "nl_connect(%p): bind() failed with %d (%s)\n",
--				sk, errsv, strerror_r(errsv, buf, sizeof(buf)));
-+				sk, errsv, nl_strerror_l(errsv));
- 			err = -nl_syserr2nlerr(errsv);
- 			goto errout;
- 		}
-@@ -183,7 +183,7 @@ int nl_connect(struct nl_sock *sk, int protocol)
- 			  &addrlen);
- 	if (err < 0) {
- 		NL_DBG(4, "nl_connect(%p): getsockname() failed with %d (%s)\n",
--			sk, errno, strerror_r(errno, buf, sizeof(buf)));
-+			sk, errno, nl_strerror_l(errno));
- 		err = -nl_syserr2nlerr(errno);
- 		goto errout;
- 	}
-@@ -280,10 +280,8 @@ int nl_sendto(struct nl_sock *sk, void *buf, size_t size)
- 	ret = sendto(sk->s_fd, buf, size, 0, (struct sockaddr *)
- 		     &sk->s_peer, sizeof(sk->s_peer));
- 	if (ret < 0) {
--		char errbuf[64];
--
- 		NL_DBG(4, "nl_sendto(%p): sendto() failed with %d (%s)\n",
--			sk, errno, strerror_r(errno, errbuf, sizeof(errbuf)));
-+			sk, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 
-@@ -343,10 +341,8 @@ int nl_sendmsg(struct nl_sock *sk, struct nl_msg *msg, struct msghdr *hdr)
- 
- 	ret = sendmsg(sk->s_fd, hdr, 0);
- 	if (ret < 0) {
--		char errbuf[64];
--
- 		NL_DBG(4, "nl_sendmsg(%p): sendmsg() failed with %d (%s)\n",
--			sk, errno, strerror_r(errno, errbuf, sizeof(errbuf)));
-+			sk, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 
-@@ -706,15 +702,13 @@ retry:
- 		goto abort;
- 	}
- 	if (n < 0) {
--		char errbuf[64];
--
- 		if (errno == EINTR) {
- 			NL_DBG(3, "recvmsg() returned EINTR, retrying\n");
- 			goto retry;
- 		}
- 
- 		NL_DBG(4, "nl_sendmsg(%p): nl_recv() failed with %d (%s)\n",
--			sk, errno, strerror_r(errno, errbuf, sizeof(errbuf)));
-+			sk, errno, nl_strerror_l(errno));
- 		retval = -nl_syserr2nlerr(errno);
- 		goto abort;
- 	}
-@@ -980,10 +974,8 @@ continue_reading:
- 					goto out;
- 				}
- 			} else if (e->error) {
--				char buf[64];
--
- 				NL_DBG(4, "recvmsgs(%p): RTNETLINK responded with %d (%s)\n",
--					sk, -e->error, strerror_r(-e->error, buf, sizeof(buf)));
-+					sk, -e->error, nl_strerror_l(-e->error));
- 
- 				/* Error message reported back from kernel. */
- 				if (cb->cb_err) {
-diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c
-index 7347ed2..21b67b1 100644
---- a/lib/route/route_obj.c
-+++ b/lib/route/route_obj.c
-@@ -31,6 +31,7 @@
-  */
- 
- #include <netlink-private/netlink.h>
-+#include <netlink-private/utils.h>
- #include <netlink/netlink.h>
- #include <netlink/cache.h>
- #include <netlink/utils.h>
-@@ -259,7 +260,7 @@ static void route_dump_details(struct nl_object *a, struct nl_dump_params *p)
- 	if ((r->ce_mask & ROUTE_ATTR_CACHEINFO) && r->rt_cacheinfo.rtci_error) {
- 		nl_dump_line(p, "    cacheinfo error %d (%s)\n",
- 			r->rt_cacheinfo.rtci_error,
--			strerror_r(-r->rt_cacheinfo.rtci_error, buf, sizeof(buf)));
-+			nl_strerror_l(-r->rt_cacheinfo.rtci_error));
- 	}
- 
- 	if (r->ce_mask & ROUTE_ATTR_METRICS) {
-diff --git a/lib/socket.c b/lib/socket.c
-index 97b2f69..55153b4 100644
---- a/lib/socket.c
-+++ b/lib/socket.c
-@@ -33,6 +33,7 @@
- 
- #include <netlink-private/netlink.h>
- #include <netlink-private/socket.h>
-+#include <netlink-private/utils.h>
- #include <netlink/netlink.h>
- #include <netlink/utils.h>
- #include <netlink/handlers.h>
-@@ -449,11 +450,9 @@ int nl_socket_add_memberships(struct nl_sock *sk, int group, ...)
- 		err = setsockopt(sk->s_fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
- 						 &group, sizeof(group));
- 		if (err < 0) {
--			char buf[64];
--
- 			va_end(ap);
- 			NL_DBG(4, "nl_socket_add_memberships(%p): setsockopt() failed with %d (%s)\n",
--				sk, errno, strerror_r(errno, buf, sizeof(buf)));
-+				sk, errno, nl_strerror_l(errno));
- 			return -nl_syserr2nlerr(errno);
- 		}
- 
-@@ -501,11 +500,9 @@ int nl_socket_drop_memberships(struct nl_sock *sk, int group, ...)
- 		err = setsockopt(sk->s_fd, SOL_NETLINK, NETLINK_DROP_MEMBERSHIP,
- 						 &group, sizeof(group));
- 		if (err < 0) {
--			char buf[64];
--
- 			va_end(ap);
- 			NL_DBG(4, "nl_socket_drop_memberships(%p): setsockopt() failed with %d (%s)\n",
--				sk, errno, strerror_r(errno, buf, sizeof(buf)));
-+				sk, errno, nl_strerror_l(errno));
- 			return -nl_syserr2nlerr(errno);
- 		}
- 
-@@ -619,7 +616,6 @@ int nl_socket_set_fd(struct nl_sock *sk, int protocol, int fd)
- {
- 	int err = 0;
- 	socklen_t addrlen;
--	char buf[64];
- 	struct sockaddr_nl local = { 0 };
- 	int so_type = -1, so_protocol = -1;
- 
-@@ -633,7 +629,7 @@ int nl_socket_set_fd(struct nl_sock *sk, int protocol, int fd)
- 	                  &addrlen);
- 	if (err < 0) {
- 		NL_DBG(4, "nl_socket_set_fd(%p,%d): getsockname() failed with %d (%s)\n",
--		       sk, fd, errno, strerror_r(errno, buf, sizeof(buf)));
-+		       sk, fd, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 	if (addrlen != sizeof(local))
-@@ -648,7 +644,7 @@ int nl_socket_set_fd(struct nl_sock *sk, int protocol, int fd)
- 	err = getsockopt(fd, SOL_SOCKET, SO_TYPE, &so_type, &addrlen);
- 	if (err < 0) {
- 		NL_DBG(4, "nl_socket_set_fd(%p,%d): getsockopt() for SO_TYPE failed with %d (%s)\n",
--		       sk, fd, errno, strerror_r(errno, buf, sizeof(buf)));
-+		       sk, fd, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 	if (addrlen != sizeof(so_type))
-@@ -666,7 +662,7 @@ int nl_socket_set_fd(struct nl_sock *sk, int protocol, int fd)
- 		if (errno == ENOPROTOOPT)
- 			goto no_so_protocol;
- 		NL_DBG(4, "nl_socket_set_fd(%p,%d): getsockopt() for SO_PROTOCOL failed with %d (%s)\n",
--		       sk, fd, errno, strerror_r(errno, buf, sizeof(buf)));
-+		       sk, fd, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 	if (addrlen != sizeof(so_protocol))
-@@ -709,10 +705,8 @@ int nl_socket_set_nonblocking(const struct nl_sock *sk)
- 		return -NLE_BAD_SOCK;
- 
- 	if (fcntl(sk->s_fd, F_SETFL, O_NONBLOCK) < 0) {
--		char buf[64];
--
- 		NL_DBG(4, "nl_socket_set_nonblocking(%p): fcntl() failed with %d (%s)\n",
--			sk, errno, strerror_r(errno, buf, sizeof(buf)));
-+			sk, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 
-@@ -813,7 +807,6 @@ int nl_socket_modify_err_cb(struct nl_sock *sk, enum nl_cb_kind kind,
- int nl_socket_set_buffer_size(struct nl_sock *sk, int rxbuf, int txbuf)
- {
- 	int err;
--	char buf[64];
- 
- 	if (rxbuf <= 0)
- 		rxbuf = 32768;
-@@ -828,7 +821,7 @@ int nl_socket_set_buffer_size(struct nl_sock *sk, int rxbuf, int txbuf)
- 			 &txbuf, sizeof(txbuf));
- 	if (err < 0) {
- 		NL_DBG(4, "nl_socket_set_buffer_size(%p): setsockopt() failed with %d (%s)\n",
--			sk, errno, strerror_r(errno, buf, sizeof(buf)));
-+			sk, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 
-@@ -836,7 +829,7 @@ int nl_socket_set_buffer_size(struct nl_sock *sk, int rxbuf, int txbuf)
- 			 &rxbuf, sizeof(rxbuf));
- 	if (err < 0) {
- 		NL_DBG(4, "nl_socket_set_buffer_size(%p): setsockopt() failed with %d (%s)\n",
--			sk, errno, strerror_r(errno, buf, sizeof(buf)));
-+			sk, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 
-@@ -890,10 +883,8 @@ int nl_socket_set_passcred(struct nl_sock *sk, int state)
- 	err = setsockopt(sk->s_fd, SOL_SOCKET, SO_PASSCRED,
- 			 &state, sizeof(state));
- 	if (err < 0) {
--		char buf[64];
--
- 		NL_DBG(4, "nl_socket_set_passcred(%p): setsockopt() failed with %d (%s)\n",
--			sk, errno, strerror_r(errno, buf, sizeof(buf)));
-+			sk, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 
-@@ -922,10 +913,8 @@ int nl_socket_recv_pktinfo(struct nl_sock *sk, int state)
- 	err = setsockopt(sk->s_fd, SOL_NETLINK, NETLINK_PKTINFO,
- 			 &state, sizeof(state));
- 	if (err < 0) {
--		char buf[64];
--
- 		NL_DBG(4, "nl_socket_recv_pktinfo(%p): setsockopt() failed with %d (%s)\n",
--			sk, errno, strerror_r(errno, buf, sizeof(buf)));
-+			sk, errno, nl_strerror_l(errno));
- 		return -nl_syserr2nlerr(errno);
- 	}
- 
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch
deleted file mode 100644
index a0f5a78..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 6c2d111177e91184073c44f83d4a6182aaba06d7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
-Date: Thu, 25 Aug 2016 13:15:01 +0100
-Subject: [PATCH 3/3] src: switch to using strerror_l() instead of strerror_r()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-glibc provides two versions of strerror_r(), which
-can be chosen between using feature test macros
-_GNU_SOURCE and _POSIX_C_SOURCE. libnl is built using
-the former, hence we get the glibc special version,
-and all code so far has been written for this.
-
-Other C libraries like musl on the other hand only try
-to be posix compliant, and only ever provide the posix
-version of strerror_r(), which has a different signature.
-
-Uses in libnl hence generally cause printf() of an *int*
-with a *string format* specifier for that reason.
-
-Additionally, strerror_r() has been deprecated:
-  http://austingroupbugs.net/view.php?id=655
-
-Switch to using strerror_l().
-
-Signed-off-by: André Draszik <adraszik@tycoint.com>
-Reviewed-by: Stephane Ayotte <sayotte@tycoint.com>
-Signed-off-by: Thomas Haller <thaller@redhat.com>
----
-Upstream-Status: Backport https://github.com/thom311/libnl/commit/6c2d111177e91184073c44f83d4a6182aaba06d7
- src/lib/utils.c | 20 +++++++++++++++++---
- 1 file changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/src/lib/utils.c b/src/lib/utils.c
-index 467aaed..5878f27 100644
---- a/src/lib/utils.c
-+++ b/src/lib/utils.c
-@@ -22,6 +22,7 @@
-  */
- 
- #include <netlink/cli/utils.h>
-+#include <locale.h>
- 
- /**
-  * Parse a text based 32 bit unsigned integer argument
-@@ -70,7 +71,6 @@ void nl_cli_print_version(void)
- void nl_cli_fatal(int err, const char *fmt, ...)
- {
- 	va_list ap;
--	char buf[256];
- 
- 	fprintf(stderr, "Error: ");
- 
-@@ -79,8 +79,22 @@ void nl_cli_fatal(int err, const char *fmt, ...)
- 		vfprintf(stderr, fmt, ap);
- 		va_end(ap);
- 		fprintf(stderr, "\n");
--	} else
--		fprintf(stderr, "%s\n", strerror_r(err, buf, sizeof(buf)));
-+	} else {
-+		char *buf;
-+		locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0);
-+		if (loc == (locale_t)0) {
-+			if (errno == ENOENT)
-+				loc = newlocale(LC_MESSAGES_MASK,
-+						"POSIX", (locale_t)0);
-+			if (loc == (locale_t)0)
-+				buf = "newlocale() failed";
-+		}
-+		if (loc != (locale_t)0)
-+			buf = strerror_l(err, loc);
-+		fprintf(stderr, "%s\n", buf);
-+		if (loc != (locale_t)0)
-+			freelocale(loc);
-+	}
- 
- 	exit(abs(err));
- }
--- 
-2.9.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl_3.2.28.bb b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl_3.2.28.bb
deleted file mode 100644
index 26982f3..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl_3.2.28.bb
+++ /dev/null
@@ -1,48 +0,0 @@
-SUMMARY = "A library for applications dealing with netlink sockets"
-HOMEPAGE = "http://www.infradead.org/~tgr/libnl/"
-SECTION = "libs/network"
-
-PE = "1"
-
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
-
-DEPENDS = "flex-native bison-native"
-
-SRC_URI = "https://github.com/thom311/${BPN}/releases/download/${BPN}${@d.getVar('PV', True).replace('.','_')}/${BP}.tar.gz \
-           file://fix-pktloc_syntax_h-race.patch \
-           file://fix-pc-file.patch \
-           file://0001-lib-add-utility-function-nl_strerror_l.patch \
-           file://0002-lib-switch-to-using-strerror_l-instead-of-strerror_r.patch \
-           file://0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch \
-"
-UPSTREAM_CHECK_URI = "https://github.com/thom311/${BPN}/releases"
-
-SRC_URI[md5sum] = "bab12db1eb94a42129f712a44be91a67"
-SRC_URI[sha256sum] = "cd608992c656e8f6e3ab6c1391b162a5a51c49336b9219f7f390e61fc5437c41"
-
-inherit autotools pkgconfig
-
-FILES_${PN} = "${libdir}/libnl-3.so.* \
-               ${libdir}/libnl.so.* \
-               ${sysconfdir}"
-RREPLACES_${PN} = "libnl2"
-RCONFLICTS_${PN} = "libnl2"
-FILES_${PN}-dev += "${libdir}/libnl/cli/*/*.la"
-FILES_${PN}-staticdev += "${libdir}/libnl/cli/*/*.a"
-
-PACKAGES += "${PN}-cli ${PN}-genl ${PN}-idiag ${PN}-nf ${PN}-route ${PN}-xfrm"
-FILES_${PN}-cli   = "${libdir}/libnl-cli-3.so.* \
-                     ${libdir}/libnl/cli/*/*.so \
-                     ${bindir}/genl-ctrl-list \
-                     ${bindir}/idiag-socket-details \
-                     ${bindir}/nf-* \
-                     ${bindir}/nl-*"
-FILES_${PN}-genl  = "${libdir}/libnl-genl-3.so.* \
-                     ${libdir}/libnl-genl.so.*"
-FILES_${PN}-idiag = "${libdir}/libnl-idiag-3.so.*"
-FILES_${PN}-nf    = "${libdir}/libnl-nf-3.so.*"
-FILES_${PN}-route = "${libdir}/libnl-route-3.so.*"
-FILES_${PN}-xfrm  = "${libdir}/libnl-xfrm-3.so.*"
-RREPLACES_${PN}-genl = "libnl-genl2"
-RCONFLICTS_${PN}-genl = "libnl-genl2"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl_3.2.29.bb b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl_3.2.29.bb
new file mode 100644
index 0000000..7d4839b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl_3.2.29.bb
@@ -0,0 +1,45 @@
+SUMMARY = "A library for applications dealing with netlink sockets"
+HOMEPAGE = "http://www.infradead.org/~tgr/libnl/"
+SECTION = "libs/network"
+
+PE = "1"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "flex-native bison-native"
+
+SRC_URI = "https://github.com/thom311/${BPN}/releases/download/${BPN}${@d.getVar('PV').replace('.','_')}/${BP}.tar.gz \
+           file://fix-pktloc_syntax_h-race.patch \
+           file://fix-pc-file.patch \
+"
+UPSTREAM_CHECK_URI = "https://github.com/thom311/${BPN}/releases"
+
+SRC_URI[md5sum] = "a8ba62a5c4f883f4e493a46d1f3733fe"
+SRC_URI[sha256sum] = "0beb593dc6abfffa18a5c787b27884979c1b7e7f1fd468c801e3cc938a685922"
+
+inherit autotools pkgconfig
+
+FILES_${PN} = "${libdir}/libnl-3.so.* \
+               ${libdir}/libnl.so.* \
+               ${sysconfdir}"
+RREPLACES_${PN} = "libnl2"
+RCONFLICTS_${PN} = "libnl2"
+FILES_${PN}-dev += "${libdir}/libnl/cli/*/*.la"
+FILES_${PN}-staticdev += "${libdir}/libnl/cli/*/*.a"
+
+PACKAGES += "${PN}-cli ${PN}-genl ${PN}-idiag ${PN}-nf ${PN}-route ${PN}-xfrm"
+FILES_${PN}-cli   = "${libdir}/libnl-cli-3.so.* \
+                     ${libdir}/libnl/cli/*/*.so \
+                     ${bindir}/genl-ctrl-list \
+                     ${bindir}/idiag-socket-details \
+                     ${bindir}/nf-* \
+                     ${bindir}/nl-*"
+FILES_${PN}-genl  = "${libdir}/libnl-genl-3.so.* \
+                     ${libdir}/libnl-genl.so.*"
+FILES_${PN}-idiag = "${libdir}/libnl-idiag-3.so.*"
+FILES_${PN}-nf    = "${libdir}/libnl-nf-3.so.*"
+FILES_${PN}-route = "${libdir}/libnl-route-3.so.*"
+FILES_${PN}-xfrm  = "${libdir}/libnl-xfrm-3.so.*"
+RREPLACES_${PN}-genl = "libnl-genl2"
+RCONFLICTS_${PN}-genl = "libnl-genl2"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre2/pcre-cross.patch b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre2/pcre-cross.patch
new file mode 100644
index 0000000..9516caf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre2/pcre-cross.patch
@@ -0,0 +1,65 @@
+Fix for cross compiling
+
+Fixed:
+| ./dftables src/pcre2_chartables.c
+| make: ./dftables: Command not found
+| make: *** [src/pcre2_chartables.c] Error 127
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index 38f1d41..2bde083 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -298,9 +298,21 @@ bin_SCRIPTS = pcre2-config
+ ## to copy a distributed set of tables that are defined for ASCII code. In this
+ ## case, dftables is not needed.
+ 
++CC_FOR_BUILD = @CC_FOR_BUILD@
++CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
++CCLD_FOR_BUILD = @CCLD_FOR_BUILD@
++LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
++
+ if WITH_REBUILD_CHARTABLES
+ noinst_PROGRAMS += dftables
+ dftables_SOURCES = src/dftables.c
++
++dftables_LINK = $(CCLD_FOR_BUILD) -o $@
++dftables_LDFLAGS = $(LDFLAGS_FOR_BUILD)
++
++src/dftables.o: $(srcdir)/src/dftables.c
++	$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/src/dftables.c
++
+ src/pcre2_chartables.c: dftables$(EXEEXT)
+ 	rm -f $@
+ 	./dftables$(EXEEXT) $@
+diff --git a/configure.ac b/configure.ac
+index d7c57aa..d6eb0aa 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -59,6 +59,23 @@ then
+   fi
+ fi
+ 
++if test x"$cross_compiling" = xyes; then
++    CC_FOR_BUILD="${CC_FOR_BUILD-gcc}"
++    CCLD_FOR_BUILD="${CCLD_FOR_BUILD-gcc}"
++    CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD}"
++    LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD}"
++else
++    CC_FOR_BUILD="${CC_FOR_BUILD-\$(CC)}"
++    CCLD_FOR_BUILD="${CCLD_FOR_BUILD-\$(CCLD)}"
++    CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD-\$(CFLAGS)}"
++    LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD-\$(LDFLAGS)}"
++fi
++AC_ARG_VAR(CC_FOR_BUILD, [build system C compiler])
++AC_ARG_VAR(CCLD_FOR_BUILD, [build system C linker frontend])
++AC_ARG_VAR(CFLAGS_FOR_BUILD, [build system C compiler arguments])
++AC_ARG_VAR(LDFLAGS_FOR_BUILD, [build system C linker frontend arguments])
++
++
+ # Check for a 64-bit integer type
+ AC_TYPE_INT64_T
+ 
diff --git a/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre2_10.22.bb b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre2_10.22.bb
new file mode 100644
index 0000000..0cf81c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre2_10.22.bb
@@ -0,0 +1,58 @@
+DESCRIPTION = "There are two major versions of the PCRE library. The \
+newest version is PCRE2, which is a re-working of the original PCRE \
+library to provide an entirely new API. The original, very widely \
+deployed PCRE library's API and feature are stable, future releases \
+ will be for bugfixes only. All new future features will be to PCRE2, \
+not the original PCRE 8.x series."
+SUMMARY = "Perl Compatible Regular Expressions version 2"
+HOMEPAGE = "http://www.pcre.org"
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=ab9633efd38d6f799398df2c248b5aec"
+
+SRC_URI = "https://ftp.pcre.org/pub/pcre/pcre2-${PV}.tar.bz2 \
+           file://pcre-cross.patch \
+"
+
+SRC_URI[md5sum] = "c0c02517938ee2b0d350d53edf450664"
+SRC_URI[sha256sum] = "b2b44619f4ac6c50ad74c2865fd56807571392496fae1c9ad7a70993d018f416"
+
+CVE_PRODUCT = "pcre2"
+
+S = "${WORKDIR}/pcre2-${PV}"
+
+PROVIDES += "pcre2"
+DEPENDS += "bzip2 zlib"
+
+BINCONFIG = "${bindir}/pcre2-config"
+
+inherit autotools binconfig-disabled
+
+EXTRA_OECONF = "\
+    --enable-newline-is-lf \
+    --enable-rebuild-chartables \
+    --with-link-size=2 \
+    --with-match-limit=10000000 \
+"
+
+# Set LINK_SIZE in BUILD_CFLAGS given that the autotools bbclass use it to
+# set CFLAGS_FOR_BUILD, required for the libpcre build.
+BUILD_CFLAGS =+ "-DLINK_SIZE=2 -I${B}/src"
+CFLAGS += "-D_REENTRANT"
+CXXFLAGS_append_powerpc = " -lstdc++"
+
+export CCLD_FOR_BUILD ="${BUILD_CCLD}"
+
+PACKAGES =+ "pcre2grep pcre2grep-doc pcre2test pcre2test-doc"
+
+SUMMARY_pcre2grep = "grep utility that uses perl 5 compatible regexes"
+SUMMARY_pcre2grep-doc = "grep utility that uses perl 5 compatible regexes - docs"
+SUMMARY_pcre2test = "program for testing Perl-comatible regular expressions"
+SUMMARY_pcre2test-doc = "program for testing Perl-comatible regular expressions - docs"
+
+FILES_pcre2grep = "${bindir}/pcre2grep"
+FILES_pcre2grep-doc = "${mandir}/man1/pcre2grep.1"
+FILES_pcre2test = "${bindir}/pcre2test"
+FILES_pcre2test-doc = "${mandir}/man1/pcre2test.1"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre_8.39.bb b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre_8.39.bb
deleted file mode 100644
index 90dfb33..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre_8.39.bb
+++ /dev/null
@@ -1,83 +0,0 @@
-DESCRIPTION = "The PCRE library is a set of functions that implement regular \
-expression pattern matching using the same syntax and semantics as Perl 5. PCRE \
-has its own native API, as well as a set of wrapper functions that correspond \
-to the POSIX regular expression API."
-SUMMARY = "Perl Compatible Regular Expressions"
-HOMEPAGE = "http://www.pcre.org"
-SECTION = "devel"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENCE;md5=b8221cbf43c5587f90ccf228f1185cc2"
-
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/projects/pcre/files/prce/8.39/pcre-${PV}.tar.bz2 \
-           file://pcre-cross.patch \
-           file://fix-pcre-name-collision.patch \
-           file://run-ptest \
-           file://Makefile \
-"
-
-SRC_URI[md5sum] = "e3fca7650a0556a2647821679d81f585"
-SRC_URI[sha256sum] = "b858099f82483031ee02092711689e7245586ada49e534a06e678b8ea9549e8b"
-
-S = "${WORKDIR}/pcre-${PV}"
-
-PROVIDES += "pcre"
-DEPENDS += "bzip2 zlib"
-
-PACKAGECONFIG ??= "pcre8 unicode-properties"
-
-PACKAGECONFIG[pcre8] = "--enable-pcre8,--disable-pcre8"
-PACKAGECONFIG[pcre16] = "--enable-pcre16,--disable-pcre16"
-PACKAGECONFIG[pcre32] = "--enable-pcre32,--disable-pcre32"
-PACKAGECONFIG[pcretest-readline] = "--enable-pcretest-libreadline,--disable-pcretest-libreadline,readline,"
-PACKAGECONFIG[unicode-properties] = "--enable-unicode-properties,--disable-unicode-properties"
-
-BINCONFIG = "${bindir}/pcre-config"
-
-inherit autotools binconfig-disabled ptest
-
-EXTRA_OECONF = "\
-    --enable-newline-is-lf \
-    --enable-rebuild-chartables \
-    --enable-utf \
-    --with-link-size=2 \
-    --with-match-limit=10000000 \
-"
-
-# Set LINK_SIZE in BUILD_CFLAGS given that the autotools bbclass use it to
-# set CFLAGS_FOR_BUILD, required for the libpcre build.
-BUILD_CFLAGS =+ "-DLINK_SIZE=2 -I${B}"
-CFLAGS += "-D_REENTRANT"
-CXXFLAGS_append_powerpc = " -lstdc++"
-
-export CCLD_FOR_BUILD ="${BUILD_CCLD}"
-
-PACKAGES =+ "libpcrecpp libpcreposix pcregrep pcregrep-doc pcretest pcretest-doc"
-
-SUMMARY_libpcrecpp = "${SUMMARY} - C++ wrapper functions"
-SUMMARY_libpcreposix = "${SUMMARY} - C wrapper functions based on the POSIX regex API"
-SUMMARY_pcregrep = "grep utility that uses perl 5 compatible regexes"
-SUMMARY_pcregrep-doc = "grep utility that uses perl 5 compatible regexes - docs"
-SUMMARY_pcretest = "program for testing Perl-comatible regular expressions"
-SUMMARY_pcretest-doc = "program for testing Perl-comatible regular expressions - docs"
-
-FILES_libpcrecpp = "${libdir}/libpcrecpp.so.*"
-FILES_libpcreposix = "${libdir}/libpcreposix.so.*"
-FILES_pcregrep = "${bindir}/pcregrep"
-FILES_pcregrep-doc = "${mandir}/man1/pcregrep.1"
-FILES_pcretest = "${bindir}/pcretest"
-FILES_pcretest-doc = "${mandir}/man1/pcretest.1"
-
-BBCLASSEXTEND = "native nativesdk"
-
-do_install_ptest() {
-	t=${D}${PTEST_PATH}
-	cp ${WORKDIR}/Makefile $t
-	cp -r ${S}/testdata $t
-	for i in pcre_stringpiece_unittest pcregrep pcretest; \
-	  do cp ${B}/.libs/$i $t; \
-	done
-	for i in RunTest RunGrepTest test-driver; \
-	  do cp ${S}/$i $t; \
-	done
-}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre_8.40.bb b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre_8.40.bb
new file mode 100644
index 0000000..8b6ab25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre_8.40.bb
@@ -0,0 +1,83 @@
+DESCRIPTION = "The PCRE library is a set of functions that implement regular \
+expression pattern matching using the same syntax and semantics as Perl 5. PCRE \
+has its own native API, as well as a set of wrapper functions that correspond \
+to the POSIX regular expression API."
+SUMMARY = "Perl Compatible Regular Expressions"
+HOMEPAGE = "http://www.pcre.org"
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=60da32d84d067f53e22071c4ecb4384d"
+SRC_URI = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${PV}.tar.bz2 \
+           file://pcre-cross.patch \
+           file://fix-pcre-name-collision.patch \
+           file://run-ptest \
+           file://Makefile \
+"
+
+SRC_URI[md5sum] = "41a842bf7dcecd6634219336e2167d1d"
+SRC_URI[sha256sum] = "00e27a29ead4267e3de8111fcaa59b132d0533cdfdbdddf4b0604279acbcf4f4"
+
+CVE_PRODUCT = "pcre"
+
+S = "${WORKDIR}/pcre-${PV}"
+
+PROVIDES += "pcre"
+DEPENDS += "bzip2 zlib"
+
+PACKAGECONFIG ??= "pcre8 unicode-properties"
+
+PACKAGECONFIG[pcre8] = "--enable-pcre8,--disable-pcre8"
+PACKAGECONFIG[pcre16] = "--enable-pcre16,--disable-pcre16"
+PACKAGECONFIG[pcre32] = "--enable-pcre32,--disable-pcre32"
+PACKAGECONFIG[pcretest-readline] = "--enable-pcretest-libreadline,--disable-pcretest-libreadline,readline,"
+PACKAGECONFIG[unicode-properties] = "--enable-unicode-properties,--disable-unicode-properties"
+
+BINCONFIG = "${bindir}/pcre-config"
+
+inherit autotools binconfig-disabled ptest
+
+EXTRA_OECONF = "\
+    --enable-newline-is-lf \
+    --enable-rebuild-chartables \
+    --enable-utf \
+    --with-link-size=2 \
+    --with-match-limit=10000000 \
+"
+
+# Set LINK_SIZE in BUILD_CFLAGS given that the autotools bbclass use it to
+# set CFLAGS_FOR_BUILD, required for the libpcre build.
+BUILD_CFLAGS =+ "-DLINK_SIZE=2 -I${B}"
+CFLAGS += "-D_REENTRANT"
+CXXFLAGS_append_powerpc = " -lstdc++"
+
+export CCLD_FOR_BUILD ="${BUILD_CCLD}"
+
+PACKAGES =+ "libpcrecpp libpcreposix pcregrep pcregrep-doc pcretest pcretest-doc"
+
+SUMMARY_libpcrecpp = "${SUMMARY} - C++ wrapper functions"
+SUMMARY_libpcreposix = "${SUMMARY} - C wrapper functions based on the POSIX regex API"
+SUMMARY_pcregrep = "grep utility that uses perl 5 compatible regexes"
+SUMMARY_pcregrep-doc = "grep utility that uses perl 5 compatible regexes - docs"
+SUMMARY_pcretest = "program for testing Perl-comatible regular expressions"
+SUMMARY_pcretest-doc = "program for testing Perl-comatible regular expressions - docs"
+
+FILES_libpcrecpp = "${libdir}/libpcrecpp.so.*"
+FILES_libpcreposix = "${libdir}/libpcreposix.so.*"
+FILES_pcregrep = "${bindir}/pcregrep"
+FILES_pcregrep-doc = "${mandir}/man1/pcregrep.1"
+FILES_pcretest = "${bindir}/pcretest"
+FILES_pcretest-doc = "${mandir}/man1/pcretest.1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_ptest() {
+	t=${D}${PTEST_PATH}
+	cp ${WORKDIR}/Makefile $t
+	cp -r ${S}/testdata $t
+	for i in pcre_stringpiece_unittest pcregrep pcretest; \
+	  do cp ${B}/.libs/$i $t; \
+	done
+	for i in RunTest RunGrepTest test-driver; \
+	  do cp ${S}/$i $t; \
+	done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy_0.4.13.bb b/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy_0.4.13.bb
deleted file mode 100644
index 3940e22..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy_0.4.13.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-SUMMARY = "Library providing automatic proxy configuration management"
-HOMEPAGE = "https://github.com/libproxy/libproxy"
-BUGTRACKER = "https://github.com/libproxy/libproxy/issues"
-SECTION = "libs"
-LICENSE = "LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
-                    file://utils/proxy.c;beginline=1;endline=18;md5=55152a1006d7dafbef32baf9c30a99c0"
-
-DEPENDS = "glib-2.0"
-
-SRC_URI = "https://github.com/${BPN}/${BPN}/archive/${PV}.tar.gz"
-
-UPSTREAM_CHECK_URI = "https://github.com/libproxy/libproxy/releases"
-
-SRC_URI[md5sum] = "de293bb311f185a2ffa3492700a694c2"
-SRC_URI[sha256sum] = "d610bc0ef81a18ba418d759c5f4f87bf7102229a9153fb397d7d490987330ffd"
-
-inherit cmake pkgconfig
-
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gnome', '', d)} gnome3"
-PACKAGECONFIG[gnome] = "-DWITH_GNOME=yes,-DWITH_GNOME=no,gconf"
-PACKAGECONFIG[gnome3] = "-DWITH_GNOME3=yes,-DWITH_GNOME3=no"
-
-EXTRA_OECMAKE += " \
-    -DWITH_KDE4=no \
-    -DWITH_MOZJS=no \
-    -DWITH_NM=no \
-    -DWITH_PERL=no \
-    -DWITH_PYTHON=no \
-    -DWITH_WEBKIT=no \
-    -DLIB_INSTALL_DIR=${libdir} \
-    -DLIBEXEC_INSTALL_DIR=${libexecdir} \
-"
-
-FILES_${PN} += "${libdir}/${BPN}/${PV}/modules"
-FILES_${PN}-dev += "${datadir}/cmake"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy_0.4.14.bb b/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy_0.4.14.bb
new file mode 100644
index 0000000..62a6a13
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy_0.4.14.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Library providing automatic proxy configuration management"
+HOMEPAGE = "https://github.com/libproxy/libproxy"
+BUGTRACKER = "https://github.com/libproxy/libproxy/issues"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+                    file://utils/proxy.c;beginline=1;endline=18;md5=55152a1006d7dafbef32baf9c30a99c0"
+
+DEPENDS = "glib-2.0"
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz"
+SRC_URI[md5sum] = "e7514f78f5432210e17a01b6b618dde2"
+SRC_URI[sha256sum] = "e25d046850346a505c0617646f1e68b660092efadf665548a89c280900262ea6"
+
+UPSTREAM_CHECK_URI = "https://github.com/libproxy/libproxy/releases"
+UPSTREAM_CHECK_REGEX = "libproxy-(?P<pver>.*)\.tar"
+
+inherit cmake pkgconfig
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gnome', '', d)} gnome3"
+PACKAGECONFIG[gnome] = "-DWITH_GNOME=yes,-DWITH_GNOME=no,gconf"
+PACKAGECONFIG[gnome3] = "-DWITH_GNOME3=yes,-DWITH_GNOME3=no"
+
+EXTRA_OECMAKE += " \
+    -DWITH_KDE4=no \
+    -DWITH_MOZJS=no \
+    -DWITH_NM=no \
+    -DWITH_PERL=no \
+    -DWITH_PYTHON=no \
+    -DWITH_WEBKIT=no \
+    -DLIB_INSTALL_DIR=${libdir} \
+    -DLIBEXEC_INSTALL_DIR=${libexecdir} \
+"
+
+FILES_${PN} += "${libdir}/${BPN}/${PV}/modules"
+FILES_${PN}-dev += "${datadir}/cmake"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libsoup/libsoup-2.4_2.54.1.bb b/import-layers/yocto-poky/meta/recipes-support/libsoup/libsoup-2.4_2.54.1.bb
deleted file mode 100644
index b93a9fd..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libsoup/libsoup-2.4_2.54.1.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-SUMMARY = "An HTTP library implementation in C"
-HOMEPAGE = "https://wiki.gnome.org/Projects/libsoup"
-BUGTRACKER = "https://bugzilla.gnome.org/"
-SECTION = "x11/gnome/libs"
-LICENSE = "LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
-
-DEPENDS = "glib-2.0 glib-2.0-native libxml2 sqlite3 intltool-native"
-
-SHRT_VER = "${@d.getVar('PV', True).split('.')[0]}.${@d.getVar('PV', True).split('.')[1]}"
-
-SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "73b1fb774de16c29b380f87016f9f9dd"
-SRC_URI[sha256sum] = "47b42c232034734d66e5f093025843a5d8cc4b2357c011085a2fd04ef02dd633"
-
-S = "${WORKDIR}/libsoup-${PV}"
-
-inherit autotools gettext pkgconfig upstream-version-is-even gobject-introspection gtk-doc
-
-# libsoup-gnome is entirely deprecated and just stubs in 2.42 onwards. Disable by default.
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome"
-PACKAGECONFIG[gssapi] = "--with-gssapi,--without-gssapi,krb5"
-
-EXTRA_OECONF = "--disable-vala"
-
-# When built without gnome support, libsoup-2.4 will contain only one shared lib
-# and will therefore become subject to renaming by debian.bbclass. Prevent
-# renaming in order to keep the package name consistent regardless of whether
-# gnome support is enabled or disabled.
-DEBIAN_NOAUTONAME_${PN} = "1"
-
-# glib-networking is needed for SSL, proxies, etc.
-RRECOMMENDS_${PN} = "glib-networking"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libsoup/libsoup-2.4_2.56.0.bb b/import-layers/yocto-poky/meta/recipes-support/libsoup/libsoup-2.4_2.56.0.bb
new file mode 100644
index 0000000..a1f294e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libsoup/libsoup-2.4_2.56.0.bb
@@ -0,0 +1,35 @@
+SUMMARY = "An HTTP library implementation in C"
+HOMEPAGE = "https://wiki.gnome.org/Projects/libsoup"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "x11/gnome/libs"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+DEPENDS = "glib-2.0 glib-2.0-native libxml2 sqlite3 intltool-native"
+
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
+
+SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "465083f74b7bb035959ddb0599313986"
+SRC_URI[sha256sum] = "d8216b71de8247bc6f274ec054c08547b2e04369c1f8add713e9350c8ef81fe5"
+
+S = "${WORKDIR}/libsoup-${PV}"
+
+inherit autotools gettext pkgconfig upstream-version-is-even gobject-introspection gtk-doc
+
+# libsoup-gnome is entirely deprecated and just stubs in 2.42 onwards. Disable by default.
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome"
+PACKAGECONFIG[gssapi] = "--with-gssapi,--without-gssapi,krb5"
+
+EXTRA_OECONF = "--disable-vala"
+
+# When built without gnome support, libsoup-2.4 will contain only one shared lib
+# and will therefore become subject to renaming by debian.bbclass. Prevent
+# renaming in order to keep the package name consistent regardless of whether
+# gnome support is enabled or disabled.
+DEBIAN_NOAUTONAME_${PN} = "1"
+
+# glib-networking is needed for SSL, proxies, etc.
+RRECOMMENDS_${PN} = "glib-networking"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring_0.9.6.bb b/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring_0.9.6.bb
deleted file mode 100644
index bb70122..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring_0.9.6.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-SUMMARY = "Library for manipulating C and Unicode strings"
-
-DESCRIPTION = "Text files are nowadays usually encoded in Unicode, and may\
- consist of very different scripts from Latin letters to Chinese Hanzi\
- with many kinds of special characters accents, right-to-left writing\
- marks, hyphens, Roman numbers, and much more. But the POSIX platform\
- APIs for text do not contain adequate functions for dealing with\
- particular properties of many Unicode characters. In fact, the POSIX\
- APIs for text have several assumptions at their base which don't hold\
- for Unicode text.  This library provides functions for manipulating\
- Unicode strings and for manipulating C strings according to the Unicode\
- standard.  This package contains documentation."
-
-HOMEPAGE = "http://www.gnu.org/software/libunistring/"
-SECTION = "devel"
-LICENSE = "GPLv3 & LGPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://COPYING.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
-
-SRC_URI = "${GNU_MIRROR}/libunistring/libunistring-${PV}.tar.gz \
-           file://iconv-m4-remove-the-test-to-convert-euc-jp.patch \
-           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
-"
-SRC_URI[md5sum] = "dfae4ff5583649ed24d8f368f1d0543b"
-SRC_URI[sha256sum] = "9625eec2507f4789ebb6fc48ebda98be0e0168979a2f68aa8b680bf8eeabbd47"
-
-inherit autotools texinfo
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring_0.9.7.bb b/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring_0.9.7.bb
new file mode 100644
index 0000000..f77a210
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring_0.9.7.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Library for manipulating C and Unicode strings"
+
+DESCRIPTION = "Text files are nowadays usually encoded in Unicode, and may\
+ consist of very different scripts from Latin letters to Chinese Hanzi\
+ with many kinds of special characters accents, right-to-left writing\
+ marks, hyphens, Roman numbers, and much more. But the POSIX platform\
+ APIs for text do not contain adequate functions for dealing with\
+ particular properties of many Unicode characters. In fact, the POSIX\
+ APIs for text have several assumptions at their base which don't hold\
+ for Unicode text.  This library provides functions for manipulating\
+ Unicode strings and for manipulating C strings according to the Unicode\
+ standard.  This package contains documentation."
+
+HOMEPAGE = "http://www.gnu.org/software/libunistring/"
+SECTION = "devel"
+LICENSE = "LGPLv3+ | GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+                    file://README;beginline=45;endline=65;md5=08287d16ba8d839faed8d2dc14d7d6a5 \
+                    file://doc/libunistring.texi;md5=b86c9fd7acaac623017239640631912c \
+                   "
+
+SRC_URI = "${GNU_MIRROR}/libunistring/libunistring-${PV}.tar.gz \
+           file://iconv-m4-remove-the-test-to-convert-euc-jp.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+"
+SRC_URI[md5sum] = "8e663454aa372181ee8e46edaa3ba4c8"
+SRC_URI[sha256sum] = "9ce081cbee1951b55597b30e7030bda9d7b2f034ef901a135ff3a020be5a41e5"
+
+inherit autotools texinfo
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind.inc b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind.inc
index e4ae8df..c8ff836 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind.inc
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind.inc
@@ -9,6 +9,7 @@
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,xz"
+PACKAGECONFIG[latexdocs] = "--enable-documentaiton, --disable-documentation, latex2man-native"
 
 EXTRA_OECONF_arm = "--enable-debug-frame"
 EXTRA_OECONF_aarch64 = "--enable-debug-frame"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind/libunwind-1.1-x32.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind/libunwind-1.1-x32.patch
new file mode 100644
index 0000000..3251646
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind/libunwind-1.1-x32.patch
@@ -0,0 +1,31 @@
+From 506bd37bd580d7382d7c58257dac4b1e502a887c Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 09:50:34 -0700
+Subject: [PATCH] Fix for X32
+
+Apply patch to fix the X32 build from https://github.com/sjnewbury/x32.
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ src/x86_64/Gos-linux.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/x86_64/Gos-linux.c b/src/x86_64/Gos-linux.c
+index 9e1acfc..8169d5a 100644
+--- a/src/x86_64/Gos-linux.c
++++ b/src/x86_64/Gos-linux.c
+@@ -143,8 +143,8 @@ x86_64_sigreturn (unw_cursor_t *cursor)
+ 
+   Debug (8, "resuming at ip=%llx via sigreturn(%p)\n",
+              (unsigned long long) c->dwarf.ip, sc);
+-  __asm__ __volatile__ ("mov %0, %%rsp;"
+-                        "mov %1, %%rax;"
++  __asm__ __volatile__ ("mov %q0, %%rsp;"
++                        "mov %q1, %%rax;"
+                         "syscall"
+                         :: "r"(sc), "i"(SYS_rt_sigreturn)
+                         : "memory");
+-- 
+2.8.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind_git.bb b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind_git.bb
index 4249430..b637c5c 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind_git.bb
@@ -11,6 +11,7 @@
            file://0001-Fix-build-on-mips-musl.patch \
            file://0001-add-knobs-to-disable-enable-tests.patch \
            file://0001-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch \
+           file://libunwind-1.1-x32.patch \
            "
 
 SRC_URI_append_libc-musl = " file://musl-header-conflict.patch"
diff --git a/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0001-Support-for-NIOS2-architecture.patch b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0001-Support-for-NIOS2-architecture.patch
index 690872b..6296238 100644
--- a/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0001-Support-for-NIOS2-architecture.patch
+++ b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0001-Support-for-NIOS2-architecture.patch
@@ -1,4 +1,4 @@
-From add566b913e1b5cd4974a2167157dc08d8245ab0 Mon Sep 17 00:00:00 2001
+From f37c5b56376d9bb506da68bb11d0d7463e6e563b Mon Sep 17 00:00:00 2001
 From: Marek Vasut <marex@denx.de>
 Date: Tue, 9 Feb 2016 01:52:26 +0100
 Subject: [PATCH] Support for NIOS2 architecture
@@ -9,6 +9,7 @@
 
 Signed-off-by: Marek Vasut <marex@denx.de>
 Upstream-Status: Backport [ http://git.lttng.org/?p=userspace-rcu.git;a=commit;h=859050b3088aa3f0cb59d7f51ce24b9a0f18faa5 ]
+
 ---
  LICENSE              |  1 +
  README.md            |  1 +
@@ -44,12 +45,12 @@
    - ia64
    - Sparcv9 32/64
 diff --git a/configure.ac b/configure.ac
-index 39a7777..71a7d71 100644
+index eebed56..8014e1d 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -124,6 +124,7 @@ AS_CASE([$host_cpu],
+@@ -136,6 +136,7 @@ AS_CASE([$host_cpu],
  	[arm*], [ARCHTYPE="arm"],
- 	[aarch64], [ARCHTYPE="aarch64"],
+ 	[aarch64*], [ARCHTYPE="aarch64"],
  	[mips*], [ARCHTYPE="mips"],
 +	[nios2*], [ARCHTYPE="nios2"],
  	[tile*], [ARCHTYPE="tile"],
@@ -57,7 +58,7 @@
  	[ARCHTYPE="unknown"]
 diff --git a/urcu/arch/nios2.h b/urcu/arch/nios2.h
 new file mode 100644
-index 0000000..030d1bc
+index 0000000..b4f3e50
 --- /dev/null
 +++ b/urcu/arch/nios2.h
 @@ -0,0 +1,40 @@
@@ -140,5 +141,5 @@
 +
 +#endif /* _URCU_UATOMIC_ARCH_NIOS2_H */
 -- 
-2.7.0
+2.10.2
 
diff --git a/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0002-Support-for-aarch64_be.patch b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0002-Support-for-aarch64_be.patch
deleted file mode 100644
index a10ccd7..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0002-Support-for-aarch64_be.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-liburcu: add support for aarch64_be
-
-Upstream-Status: Pending
-
-Signed-off-by: Tudor Florea <tudor.florea@enea.com>
-
-diff --git a/configure.ac b/configure.ac
-index 8ebfa8b..fe1c55d 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -121,7 +121,7 @@ AS_CASE([$host_cpu],
- 	[alpha*], [ARCHTYPE="alpha"],
- 	[ia64], [ARCHTYPE="ia64"],
- 	[arm*], [ARCHTYPE="arm"],
--	[aarch64], [ARCHTYPE="aarch64"],
-+	[aarch64*], [ARCHTYPE="aarch64"],
- 	[mips*], [ARCHTYPE="mips"],
- 	[nios2*], [ARCHTYPE="nios2"],
- 	[tile*], [ARCHTYPE="tile"],
diff --git a/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu_0.9.2.bb b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu_0.9.2.bb
deleted file mode 100644
index 23fb8c4..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu_0.9.2.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "Userspace RCU (read-copy-update) library"
-HOMEPAGE = "http://lttng.org/urcu"
-BUGTRACKER = "http://lttng.org/project/issues"
-
-LICENSE = "LGPLv2.1+ & MIT-style"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e548d28737289d75a8f1e01ba2fd7825 \
-                    file://urcu.h;beginline=4;endline=32;md5=4de0d68d3a997643715036d2209ae1d9 \
-                    file://urcu/uatomic/x86.h;beginline=4;endline=21;md5=58e50bbd8a2f073bb5500e6554af0d0b"
-
-SRC_URI = " \
-	http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2 \
-	file://0001-Support-for-NIOS2-architecture.patch \
-        file://0002-Support-for-aarch64_be.patch \
-	"
-
-SRC_URI[md5sum] = "49f86e68c1e2f41d303381a271b791d1"
-SRC_URI[sha256sum] = "8f7fa313b1e0a3f742cea24ce63a39c0efe63e615a769e2961e55bd2663ecaa3"
-
-S = "${WORKDIR}/userspace-rcu-${PV}"
-CFLAGS_append_libc-uclibc = " -D_GNU_SOURCE"
-inherit autotools
diff --git a/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu_0.9.3.bb b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu_0.9.3.bb
new file mode 100644
index 0000000..4486e0a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu_0.9.3.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Userspace RCU (read-copy-update) library"
+HOMEPAGE = "http://lttng.org/urcu"
+BUGTRACKER = "http://lttng.org/project/issues"
+
+LICENSE = "LGPLv2.1+ & MIT-style"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e548d28737289d75a8f1e01ba2fd7825 \
+                    file://urcu.h;beginline=4;endline=32;md5=4de0d68d3a997643715036d2209ae1d9 \
+                    file://urcu/uatomic/x86.h;beginline=4;endline=21;md5=58e50bbd8a2f073bb5500e6554af0d0b"
+
+SRC_URI = "http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2 \
+           file://0001-Support-for-NIOS2-architecture.patch \
+           "
+
+SRC_URI[md5sum] = "920970e35a1a2066c8353eabfeab8730"
+SRC_URI[sha256sum] = "1bce32e6a6c967fef6d37adaadf33df19878d69673f9ef9d3f2470e0c6ed4006"
+
+S = "${WORKDIR}/userspace-rcu-${PV}"
+CFLAGS_append_libc-uclibc = " -D_GNU_SOURCE"
+inherit autotools
diff --git a/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1_1.0.20.bb b/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1_1.0.20.bb
deleted file mode 100644
index 4cad2d4..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1_1.0.20.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-SUMMARY = "Userspace library to access USB (version 1.0)"
-HOMEPAGE = "http://libusb.sf.net"
-BUGTRACKER = "http://www.libusb.org/report"
-SECTION = "libs"
-
-LICENSE = "LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
-
-BBCLASSEXTEND = "native nativesdk"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.bz2 \
-           file://no-dll.patch \
-          "
-
-SRC_URI[md5sum] = "1d4eb194eaaa2bcfbba28102768c7dbf"
-SRC_URI[sha256sum] = "cb057190ba0a961768224e4dc6883104c6f945b2bf2ef90d7da39e7c1834f7ff"
-
-S = "${WORKDIR}/libusb-${PV}"
-
-inherit autotools pkgconfig
-
-# Don't configure udev by default since it will cause a circular
-# dependecy with udev package, which depends on libusb
-EXTRA_OECONF = "--libdir=${base_libdir} --disable-udev"
-
-do_install_append() {
-	install -d ${D}${libdir}
-	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
-		mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
-	fi
-}
-
-FILES_${PN} += "${base_libdir}/*.so.*"
-
-FILES_${PN}-dev += "${base_libdir}/*.so ${base_libdir}/*.la"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1_1.0.21.bb b/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1_1.0.21.bb
new file mode 100644
index 0000000..1fefd14
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1_1.0.21.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Userspace library to access USB (version 1.0)"
+HOMEPAGE = "http://libusb.sf.net"
+BUGTRACKER = "http://www.libusb.org/report"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.bz2 \
+           file://no-dll.patch \
+          "
+
+SRC_URI[md5sum] = "1da9ea3c27b3858fa85c5f4466003e44"
+SRC_URI[sha256sum] = "7dce9cce9a81194b7065ee912bcd55eeffebab694ea403ffb91b67db66b1824b"
+
+S = "${WORKDIR}/libusb-${PV}"
+
+inherit autotools pkgconfig
+
+# Don't configure udev by default since it will cause a circular
+# dependecy with udev package, which depends on libusb
+EXTRA_OECONF = "--libdir=${base_libdir} --disable-udev"
+
+do_install_append() {
+	install -d ${D}${libdir}
+	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+		mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
+	fi
+}
+
+FILES_${PN} += "${base_libdir}/*.so.*"
+
+FILES_${PN}-dev += "${base_libdir}/*.so ${base_libdir}/*.la"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libyaml/libyaml_0.1.7.bb b/import-layers/yocto-poky/meta/recipes-support/libyaml/libyaml_0.1.7.bb
index 5c422ef..b167f03 100644
--- a/import-layers/yocto-poky/meta/recipes-support/libyaml/libyaml_0.1.7.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/libyaml/libyaml_0.1.7.bb
@@ -17,4 +17,4 @@
 
 inherit autotools
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/lz4/lz4.bb b/import-layers/yocto-poky/meta/recipes-support/lz4/lz4.bb
index 18e56d0..03c5a7a 100644
--- a/import-layers/yocto-poky/meta/recipes-support/lz4/lz4.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/lz4/lz4.bb
@@ -18,4 +18,4 @@
 	oe_runmake install
 }
 
-BBCLASSEXTEND += "native nativesdk"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/lzop/lzop_1.03.bb b/import-layers/yocto-poky/meta/recipes-support/lzop/lzop_1.03.bb
index 649e724..6f09002 100644
--- a/import-layers/yocto-poky/meta/recipes-support/lzop/lzop_1.03.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/lzop/lzop_1.03.bb
@@ -26,4 +26,4 @@
     install -Dm 0644 ${WORKDIR}/acinclude.m4 ${S}/acinclude.m4
 }
 
-BBCLASSEXTEND += "native nativesdk"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr_3.1.4.bb b/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr_3.1.4.bb
deleted file mode 100644
index 230a862..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr_3.1.4.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require mpfr.inc
-
-LICENSE = "GPLv3 & LGPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
-		    file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6"
-DEPENDS = "gmp"
-
-SRC_URI = "http://www.mpfr.org/mpfr-${PV}/mpfr-${PV}.tar.xz \
-           file://long-long-thumb.patch \
-           "
-SRC_URI[md5sum] = "064b2c18185038e404a401b830d59be8"
-SRC_URI[sha256sum] = "761413b16d749c53e2bfd2b1dfaa3b027b0e793e404b90b5fbaeef60af6517f5"
-
-UPSTREAM_CHECK_URI = "http://www.mpfr.org/mpfr-current/"
-
-S = "${WORKDIR}/mpfr-${PV}"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr_3.1.5.bb b/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr_3.1.5.bb
new file mode 100644
index 0000000..2d59c4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr_3.1.5.bb
@@ -0,0 +1,18 @@
+require mpfr.inc
+
+LICENSE = "GPLv3 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+		    file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6"
+DEPENDS = "gmp"
+
+SRC_URI = "http://www.mpfr.org/mpfr-${PV}/mpfr-${PV}.tar.xz \
+           file://long-long-thumb.patch \
+           "
+SRC_URI[md5sum] = "c4ac246cf9795a4491e7766002cd528f"
+SRC_URI[sha256sum] = "015fde82b3979fbe5f83501986d328331ba8ddf008c1ff3da3c238f49ca062bc"
+
+UPSTREAM_CHECK_URI = "http://www.mpfr.org/mpfr-current/"
+
+S = "${WORKDIR}/mpfr-${PV}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/neon/neon/gnutls_4.3_fixup.patch b/import-layers/yocto-poky/meta/recipes-support/neon/neon/gnutls_4.3_fixup.patch
deleted file mode 100644
index 459f5e3..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/neon/neon/gnutls_4.3_fixup.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-replace deprecated GnuTLS functions with newer ones if available 
-
-Upstream-Status: Pending
-
-Signed-off-by: Armin Kuster <akuster808@gmail.com>
-
-Index: neon-0.30.1/macros/neon.m4
-===================================================================
---- neon-0.30.1.orig/macros/neon.m4
-+++ neon-0.30.1/macros/neon.m4
-@@ -987,6 +987,10 @@ gnutls)
-                   gnutls_certificate_get_x509_cas \
-                   gnutls_x509_crt_sign2])
- 
-+   # gnutls 4.3 check
-+   AC_CHECK_LIB(gnutls, gnutls_global_init)
-+   AC_CHECK_FUNCS(gnutls_certificate_set_retrieve_function,,)
-+
-    # fail if gnutls_x509_crt_sign2 is not found (it was introduced in 1.2.0, which is required)
-    if test x${ac_cv_func_gnutls_x509_crt_sign2} != xyes; then
-        AC_MSG_ERROR([GnuTLS version predates gnutls_x509_crt_sign2, newer version required (at least 1.2.0)])
-Index: neon-0.30.1/src/ne_gnutls.c
-===================================================================
---- neon-0.30.1.orig/src/ne_gnutls.c
-+++ neon-0.30.1/src/ne_gnutls.c
-@@ -553,7 +553,13 @@ dup_error:
- static int provide_client_cert(gnutls_session_t session,
-                                const gnutls_datum_t *req_ca_rdn, int nreqs,
-                                const gnutls_pk_algorithm_t *sign_algos,
--                               int sign_algos_length, gnutls_retr_st *st)
-+                               int sign_algos_length,
-+#if HAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION
-+    gnutls_retr2_st* st
-+#else
-+    gnutls_retr_st *st
-+#endif
-+    )
- {
-     ne_session *sess = gnutls_session_get_ptr(session);
-     
-@@ -617,8 +623,11 @@ static int provide_client_cert(gnutls_se
- #endif
-             ) {
-             NE_DEBUG(NE_DBG_SSL, "Supplying client certificate.\n");
--
-+#if HAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION
-+            st->cert_type = type;
-+#else
-             st->type = type;
-+#endif
-             st->ncerts = 1;
-             st->cert.x509 = &sess->client_cert->cert.subject;
-             st->key.x509 = sess->client_cert->pkey;
-@@ -649,8 +658,14 @@ ne_ssl_context *ne_ssl_context_create(in
-     ne_ssl_context *ctx = ne_calloc(sizeof *ctx);
-     gnutls_certificate_allocate_credentials(&ctx->cred);
-     if (flags == NE_SSL_CTX_CLIENT) {
-+
-+#if HAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION
-+        gnutls_certificate_set_retrieve_function(ctx->cred,
-+                                                       provide_client_cert);
-+#else
-         gnutls_certificate_client_set_retrieve_function(ctx->cred,
-                                                         provide_client_cert);
-+#endif
-     }
-     gnutls_certificate_set_verify_flags(ctx->cred, 
-                                         GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT);
diff --git a/import-layers/yocto-poky/meta/recipes-support/neon/neon_0.30.1.bb b/import-layers/yocto-poky/meta/recipes-support/neon/neon_0.30.1.bb
deleted file mode 100644
index b6cfd50..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/neon/neon_0.30.1.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-SUMMARY = "An HTTP and WebDAV client library with a C interface"
-HOMEPAGE = "http://www.webdav.org/neon/"
-SECTION = "libs"
-LICENSE = "LGPLv2+"
-LIC_FILES_CHKSUM = "file://src/COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a \
-                    file://src/ne_utils.h;beginline=1;endline=20;md5=2caca609538eddaa6f6adf120a218037"
-
-SRC_URI = "http://www.webdav.org/${BPN}/${BPN}-${PV}.tar.gz \
-           file://pkgconfig.patch \
-           file://gnutls_4.3_fixup.patch"
-
-SRC_URI[md5sum] = "231adebe5c2f78fded3e3df6e958878e"
-SRC_URI[sha256sum] = "00c626c0dc18d094ab374dbd9a354915bfe4776433289386ed489c2ec0845cdd"
-
-inherit autotools binconfig-disabled lib_package pkgconfig
-
-# Enable gnutls or openssl, not both
-PACKAGECONFIG ?= "expat gnutls libproxy webdav zlib"
-PACKAGECONFIG_class-native = "expat gnutls webdav zlib"
-
-PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat"
-PACKAGECONFIG[gnutls] = "--with-ssl=gnutls,,gnutls"
-PACKAGECONFIG[gssapi] = "--with-gssapi,--without-gssapi,krb5"
-PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy"
-PACKAGECONFIG[libxml2] = "--with-libxml2,--without-libxml2,libxml2"
-PACKAGECONFIG[openssl] = "--with-ssl=openssl,,openssl"
-PACKAGECONFIG[webdav] = "--enable-webdav,--disable-webdav,"
-PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
-
-EXTRA_OECONF += "--enable-shared"
-
-do_compile_append() {
-	oe_runmake -C test
-}
-
-BINCONFIG = "${bindir}/neon-config"
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/neon/neon_0.30.2.bb b/import-layers/yocto-poky/meta/recipes-support/neon/neon_0.30.2.bb
new file mode 100644
index 0000000..5792c56
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/neon/neon_0.30.2.bb
@@ -0,0 +1,38 @@
+SUMMARY = "An HTTP and WebDAV client library with a C interface"
+HOMEPAGE = "http://www.webdav.org/neon/"
+SECTION = "libs"
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://src/COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a \
+                    file://src/ne_utils.h;beginline=1;endline=20;md5=2caca609538eddaa6f6adf120a218037"
+
+SRC_URI = "http://www.webdav.org/${BPN}/${BPN}-${PV}.tar.gz \
+           file://pkgconfig.patch \
+          "
+
+SRC_URI[md5sum] = "e28d77bf14032d7f5046b3930704ef41"
+SRC_URI[sha256sum] = "db0bd8cdec329b48f53a6f00199c92d5ba40b0f015b153718d1b15d3d967fbca"
+
+inherit autotools binconfig-disabled lib_package pkgconfig
+
+# Enable gnutls or openssl, not both
+PACKAGECONFIG ?= "expat gnutls libproxy webdav zlib"
+PACKAGECONFIG_class-native = "expat gnutls webdav zlib"
+
+PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat"
+PACKAGECONFIG[gnutls] = "--with-ssl=gnutls,,gnutls"
+PACKAGECONFIG[gssapi] = "--with-gssapi,--without-gssapi,krb5"
+PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy"
+PACKAGECONFIG[libxml2] = "--with-libxml2,--without-libxml2,libxml2"
+PACKAGECONFIG[openssl] = "--with-ssl=openssl,,openssl"
+PACKAGECONFIG[webdav] = "--enable-webdav,--disable-webdav,"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
+
+EXTRA_OECONF += "--enable-shared"
+
+do_compile_append() {
+	oe_runmake -C test
+}
+
+BINCONFIG = "${bindir}/neon-config"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8803_8805.patch b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8803_8805.patch
deleted file mode 100644
index a956f42..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8803_8805.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-Upstream-Status: Backport
-https://git.lysator.liu.se/nettle/nettle/commit/c71d2c9d20eeebb985e3872e4550137209e3ce4d
-
-CVE: CVE-2015-8803
-CVE: CVE-2015-8805
-
-Same fix for both.
-
-Signed-off-by: Armin Kuster <akuster@mvista.com>
-
-Index: nettle-2.7.1/ecc-256.c
-===================================================================
---- nettle-2.7.1.orig/ecc-256.c
-+++ nettle-2.7.1/ecc-256.c
-@@ -96,9 +96,19 @@ ecc_256_modp (const struct ecc_curve *ec
-       q2 += t + (q1 < t);
- 
-       assert (q2 < 2);
-+      /*
-+   n-1 n-2 n-3 n-4
-+        +---+---+---+---+
-+        | u1| u0| u low |
-+        +---+---+---+---+
-+          - | q1(2^96-1)|
-+            +-------+---+
-+            |q2(2^.)|
-+            +-------+
- 
--      /* We multiply by two low limbs of p, 2^96 - 1, so we could use
--	 shifts rather than mul. */
-+   We multiply by two low limbs of p, 2^96 - 1, so we could use
-+   shifts rather than mul.
-+      */
-       t = mpn_submul_1 (rp + n - 4, ecc->p, 2, q1);
-       t += cnd_sub_n (q2, rp + n - 3, ecc->p, 1);
-       t += (-q2) & 0xffffffff;
-@@ -108,7 +118,10 @@ ecc_256_modp (const struct ecc_curve *ec
-       u0 -= t;
-       t = (u1 < cy);
-       u1 -= cy;
--      u1 += cnd_add_n (t, rp + n - 4, ecc->p, 3);
-+
-+      cy = cnd_add_n (t, rp + n - 4, ecc->p, 2);
-+      u0 += cy;
-+      u1 += (u0 < cy);
-       u1 -= (-t) & 0xffffffff;
-     }
-   rp[2] = u0;
-@@ -195,7 +208,7 @@ ecc_256_modq (const struct ecc_curve *ec
- 
-       /* Conditional add of p */
-       u1 += t;
--      u2 += (t<<32) + (u0 < t);
-+      u2 += (t<<32) + (u1 < t);
- 
-       t = cnd_add_n (t, rp + n - 4, ecc->q, 2);
-       u1 += t;
-Index: nettle-2.7.1/ChangeLog
-===================================================================
---- nettle-2.7.1.orig/ChangeLog
-+++ nettle-2.7.1/ChangeLog
-@@ -1,3 +1,9 @@
-+2015-12-10  Niels Möller  <nisse@lysator.liu.se>
-+
-+   * ecc-256.c (ecc_256_modp): Fixed carry propagation bug. Problem
-+   reported by Hanno Böck.
-+   (ecc_256_modq): Fixed another carry propagation bug.
-+
- 2013-05-28  Niels Möller  <nisse@lysator.liu.se>
- 
- 	* Released nettle-2.7.1.
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8804.patch b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8804.patch
deleted file mode 100644
index 73723a9..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8804.patch
+++ /dev/null
@@ -1,272 +0,0 @@
-Upstream-Status: Backport
- https://git.lysator.liu.se/nettle/nettle/commit/fa269b6ad06dd13c901dbd84a12e52b918a09cd7
-
-CVE: CVE-2015-8804
-Signed-off-by: Armin Kuster <akuster@mvista.com>
-
-Index: nettle-2.7.1/ChangeLog
-===================================================================
---- nettle-2.7.1.orig/ChangeLog
-+++ nettle-2.7.1/ChangeLog
-@@ -1,3 +1,11 @@
-+2015-12-15  Niels Möller  <nisse@lysator.liu.se>
-+
-+	* x86_64/ecc-384-modp.asm: Fixed carry propagation bug. Problem
-+	reported by Hanno Böck. Simplified the folding to always use
-+	non-negative carry, the old code attempted to add in a carry which
-+	could be either positive or negative, but didn't get that case
-+	right.
-+
- 2015-12-10  Niels Möller  <nisse@lysator.liu.se>
- 
-    * ecc-256.c (ecc_256_modp): Fixed carry propagation bug. Problem
-Index: nettle-2.7.1/x86_64/ecc-384-modp.asm
-===================================================================
---- nettle-2.7.1.orig/x86_64/ecc-384-modp.asm
-+++ nettle-2.7.1/x86_64/ecc-384-modp.asm
-@@ -20,7 +20,7 @@ C MA 02111-1301, USA.
- 	.file "ecc-384-modp.asm"
- 
- define(<RP>, <%rsi>)
--define(<D4>, <%rax>)
-+define(<D5>, <%rax>)
- define(<T0>, <%rbx>)
- define(<T1>, <%rcx>)
- define(<T2>, <%rdx>)
-@@ -35,8 +35,8 @@ define(<H4>, <%r13>)
- define(<H5>, <%r14>)
- define(<C2>, <%r15>)
- define(<C0>, H5)	C Overlap
--define(<D0>, RP)	C Overlap
--define(<TMP>, H4)	C Overlap
-+define(<TMP>, RP)	C Overlap
-+
- 
- PROLOGUE(nettle_ecc_384_modp)
- 	W64_ENTRY(2, 0)
-@@ -48,34 +48,38 @@ PROLOGUE(nettle_ecc_384_modp)
- 	push	%r14
- 	push	%r15
- 
--	C First get top 2 limbs, which need folding twice
-+	C First get top 2 limbs, which need folding twice.
-+	C B^10 = B^6 + B^4 + 2^32 (B-1)B^4.
-+	C We handle the terms as follow:
- 	C
--	C   H5 H4
--	C     -H5
--	C  ------
--	C   H0 D4
-+	C B^6: Folded immediatly.
- 	C
--	C Then shift right, (H1,H0,D4)  <--  (H0,D4) << 32
--	C and add
-+	C B^4: Delayed, added in in the next folding.
- 	C
--	C     H5 H4
--	C     H1 H0
--	C ----------
--	C  C2 H1 H0
--
--	mov	80(RP), D4
--	mov	88(RP), H0
--	mov	D4, H4
--	mov	H0, H5
--	sub	H0, D4
--	sbb	$0, H0
--
--	mov	D4, T2
--	mov	H0, H1
--	shl	$32, H0
--	shr	$32, T2
-+	C 2^32(B-1) B^4: Low half limb delayed until the next
-+	C folding. Top 1.5 limbs subtracted and shifter now, resulting
-+	C in 2.5 limbs. The low limb saved in D5, high 1.5 limbs added
-+	C in.
-+
-+	mov	80(RP), H4
-+	mov	88(RP), H5
-+	C Shift right 32 bits, into H1, H0
-+	mov	H4, H0
-+	mov	H5, H1
-+	mov	H5, D5
- 	shr	$32, H1
--	or	T2, H0
-+	shl	$32, D5
-+	shr	$32, H0
-+	or	D5, H0
-+
-+	C	H1 H0
-+	C       -  H1 H0
-+	C       --------
-+	C       H1 H0 D5
-+	mov	H0, D5
-+	neg	D5
-+	sbb	H1, H0
-+	sbb	$0, H1
- 
- 	xor	C2, C2
- 	add	H4, H0
-@@ -114,118 +118,95 @@ PROLOGUE(nettle_ecc_384_modp)
- 	adc	H3, T5
- 	adc	$0, C0
- 
--	C   H3 H2 H1 H0  0
--	C - H4 H3 H2 H1 H0
--	C  ---------------
--	C   H3 H2 H1 H0 D0
--
--	mov	XREG(D4), XREG(D4)
--	mov	H0, D0
--	neg	D0
--	sbb	H1, H0
--	sbb	H2, H1
--	sbb	H3, H2
--	sbb	H4, H3
--	sbb	$0, D4
--
--	C Shift right. High bits are sign, to be added to C0.
--	mov	D4, TMP
--	sar	$32, TMP
--	shl	$32, D4
--	add	TMP, C0
--
-+	C Shift left, including low half of H4
- 	mov	H3, TMP
-+	shl	$32, H4
- 	shr	$32, TMP
--	shl	$32, H3
--	or	TMP, D4
-+	or	TMP, H4
- 
- 	mov	H2, TMP
-+	shl	$32, H3
- 	shr	$32, TMP
--	shl	$32, H2
- 	or	TMP, H3
- 
- 	mov	H1, TMP
-+	shl	$32, H2
- 	shr	$32, TMP
--	shl	$32, H1
- 	or	TMP, H2
- 
- 	mov	H0, TMP
-+	shl	$32, H1
- 	shr	$32, TMP
--	shl	$32, H0
- 	or	TMP, H1
- 
--	mov	D0, TMP
--	shr	$32, TMP
--	shl	$32, D0
--	or	TMP, H0
-+	shl	$32, H0
-+
-+	C   H4 H3 H2 H1 H0  0
-+	C  -   H4 H3 H2 H1 H0
-+	C  ---------------
-+	C   H4 H3 H2 H1 H0 TMP
- 
--	add	D0, T0
-+	mov	H0, TMP
-+	neg	TMP
-+	sbb	H1, H0
-+	sbb	H2, H1
-+	sbb	H3, H2
-+	sbb	H4, H3
-+	sbb	$0, H4
-+
-+	add	TMP, T0
- 	adc	H0, T1
- 	adc	H1, T2
- 	adc	H2, T3
- 	adc	H3, T4
--	adc	D4, T5
-+	adc	H4, T5
- 	adc	$0, C0
- 
- 	C Remains to add in C2 and C0
--	C                         C0  C0<<32  (-2^32+1)C0
--	C    C2  C2<<32  (-2^32+1)C2
--	C where C2 is always positive, while C0 may be -1.
-+	C Set H1, H0 = (2^96 - 2^32 + 1) C0
- 	mov	C0, H0
- 	mov	C0, H1
--	mov	C0, H2
--	sar	$63, C0		C Get sign
- 	shl	$32, H1
--	sub	H1, H0		C Gives borrow iff C0 > 0
-+	sub	H1, H0
- 	sbb	$0, H1
--	add	C0, H2
- 
-+	C Set H3, H2 = (2^96 - 2^32 + 1) C2
-+	mov	C2, H2
-+	mov	C2, H3
-+	shl	$32, H3
-+	sub	H3, H2
-+	sbb	$0, H3
-+	add	C0, H2		C No carry. Could use lea trick
-+
-+	xor	C0, C0
- 	add	H0, T0
- 	adc	H1, T1
--	adc	$0, H2
--	adc	$0, C0
--
--	C Set (H1 H0)  <-- C2 << 96 - C2 << 32 + 1
--	mov	C2, H0
--	mov	C2, H1
--	shl	$32, H1
--	sub	H1, H0
--	sbb	$0, H1
--
--	add	H2, H0
--	adc	C0, H1
--	adc	C2, C0
--	mov	C0, H2
--	sar	$63, C0
--	add	H0, T2
--	adc	H1, T3
--	adc	H2, T4
--	adc	C0, T5
--	sbb	C0, C0
-+	adc	H2, T2
-+	adc	H3, T3
-+	adc	C2, T4
-+	adc	D5, T5		C Value delayed from initial folding
-+	adc	$0, C0		C Use sbb and switch sign?
- 
- 	C Final unlikely carry
- 	mov	C0, H0
- 	mov	C0, H1
--	mov	C0, H2
--	sar	$63, C0
- 	shl	$32, H1
- 	sub	H1, H0
- 	sbb	$0, H1
--	add	C0, H2
- 
- 	pop	RP
- 
--	sub	H0, T0
-+	add	H0, T0
- 	mov	T0, (RP)
--	sbb	H1, T1
-+	adc	H1, T1
- 	mov	T1, 8(RP)
--	sbb	H2, T2
-+	adc	C0, T2
- 	mov	T2, 16(RP)
--	sbb	C0, T3
-+	adc	$0, T3
- 	mov	T3, 24(RP)
--	sbb	C0, T4
-+	adc	$0, T4
- 	mov	T4, 32(RP)
--	sbb	C0, T5
-+	adc	$0, T5
- 	mov	T5, 40(RP)
- 
- 	pop	%r15
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-3.3/check-header-files-of-openssl-only-if-enable_.patch b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-3.3/check-header-files-of-openssl-only-if-enable_.patch
new file mode 100644
index 0000000..e7216ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-3.3/check-header-files-of-openssl-only-if-enable_.patch
@@ -0,0 +1,38 @@
+From ffee6b5f6204a0210f717968ec6ce514d70acca1 Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Fri, 9 Dec 2016 15:23:17 +0800
+Subject: [PATCH] nettle: check header files of openssl only if
+ 'enable_openssl=yes'.
+
+The original configure script checks openssl header files to generate
+config.h even if 'enable_openssl' is not set to yes, this made inconsistent
+building for nettle.
+
+Upstream-Status: Pending
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ configure.ac | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4ead52c..982760f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -185,9 +185,11 @@ AC_HEADER_TIME
+ AC_CHECK_SIZEOF(long)
+ AC_CHECK_SIZEOF(size_t)
+ 
+-AC_CHECK_HEADERS([openssl/blowfish.h openssl/des.h openssl/cast.h openssl/aes.h openssl/ecdsa.h],,
+-[enable_openssl=no
+- break])
++if test "x$enable_openssl" = "xyes"; then
++  AC_CHECK_HEADERS([openssl/blowfish.h openssl/des.h openssl/cast.h openssl/aes.h openssl/ecdsa.h],,
++  [enable_openssl=no
++  break])
++fi
+ 
+ AC_CHECK_HEADERS([valgrind/memcheck.h])
+ 
+-- 
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_2.7.1.bb b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_2.7.1.bb
deleted file mode 100644
index ae8e311..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_2.7.1.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require nettle.inc
-
-LICENSE = "LGPLv2.1+ & GPLv2"
-LICENSE_${PN} = "LGPLv2.1+"
-
-LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
-                    file://serpent-decrypt.c;beginline=53;endline=67;md5=bcfd4745d53ca57f82907089898e390d \
-                    file://serpent-set-key.c;beginline=56;endline=70;md5=bcfd4745d53ca57f82907089898e390d"
-
-SRC_URI[md5sum] = "003d5147911317931dd453520eb234a5"
-SRC_URI[sha256sum] = "bc71ebd43435537d767799e414fce88e521b7278d48c860651216e1fc6555b40"
-
-SRC_URI += "\
-            file://CVE-2015-8803_8805.patch \
-            file://CVE-2015-8804.patch \
-            "
-
-DISABLE_STATIC = ""
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_3.2.bb b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_3.2.bb
deleted file mode 100644
index 2b79779..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_3.2.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-require nettle.inc
-
-LICENSE = "LGPLv3+ | GPLv2+"
-
-LIC_FILES_CHKSUM = "file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \
-                    file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://serpent-decrypt.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e \
-                    file://serpent-set-key.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e"
-
-SRC_URI[md5sum] = "afb15b4764ebf1b4e6d06c62bd4d29e4"
-SRC_URI[sha256sum] = "ea4283def236413edab5a4cf9cf32adf540c8df1b9b67641cfc2302fca849d97"
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_3.3.bb b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_3.3.bb
new file mode 100644
index 0000000..b76babf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_3.3.bb
@@ -0,0 +1,15 @@
+require nettle.inc
+
+LICENSE = "LGPLv3+ | GPLv2+"
+
+LIC_FILES_CHKSUM = "file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \
+                    file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://serpent-decrypt.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e \
+                    file://serpent-set-key.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e"
+
+SRC_URI += "\
+            file://check-header-files-of-openssl-only-if-enable_.patch \
+            "
+
+SRC_URI[md5sum] = "10f969f78a463704ae73529978148dbe"
+SRC_URI[sha256sum] = "46942627d5d0ca11720fec18d81fc38f7ef837ea4197c1f630e71ce0d470b11e"
diff --git a/import-layers/yocto-poky/meta/recipes-support/npth/npth_1.2.bb b/import-layers/yocto-poky/meta/recipes-support/npth/npth_1.2.bb
deleted file mode 100644
index 66aa347..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/npth/npth_1.2.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-SUMMARY = "New GNU Portable Threads library"
-HOMEPAGE = "http://www.gnupg.org/software/pth/"
-SECTION = "libs"
-LICENSE = "LGPLv3+ & GPLv2+"
-LIC_FILES_CHKSUM = "\
-    file://COPYING;md5=751419260aa954499f7abaabaa882bbe\
-    file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6\
-    "
-UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
-SRC_URI = "${GNUPG_MIRROR}/npth/npth-${PV}.tar.bz2 \
-           file://pkgconfig.patch \
-          "
-
-SRC_URI[md5sum] = "226bac7374b9466c6ec26b1c34dab844"
-SRC_URI[sha256sum] = "6ddbdddb2cf49a4723f9d1ad6563c480d6760dcb63cb7726b8fc3bc2e1b6c08a"
-
-BINCONFIG = "${bindir}/npth-config"
-
-inherit autotools binconfig-disabled
-
-FILES_${PN} = "${libdir}/libnpth.so.*"
-FILES_${PN}-dev += "${bindir}/npth-config"
diff --git a/import-layers/yocto-poky/meta/recipes-support/npth/npth_1.3.bb b/import-layers/yocto-poky/meta/recipes-support/npth/npth_1.3.bb
new file mode 100644
index 0000000..d4fc064
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/npth/npth_1.3.bb
@@ -0,0 +1,22 @@
+SUMMARY = "New GNU Portable Threads library"
+HOMEPAGE = "http://www.gnupg.org/software/pth/"
+SECTION = "libs"
+LICENSE = "LGPLv3+ & GPLv2+"
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=751419260aa954499f7abaabaa882bbe\
+    file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6\
+    "
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/npth/npth-${PV}.tar.bz2 \
+           file://pkgconfig.patch \
+          "
+
+SRC_URI[md5sum] = "efe1524c53670b5755dc27893d2d68a0"
+SRC_URI[sha256sum] = "bca81940436aed0734eb8d0ff8b179e04cc8c087f5625204419f5f45d736a82a"
+
+BINCONFIG = "${bindir}/npth-config"
+
+inherit autotools binconfig-disabled
+
+FILES_${PN} = "${libdir}/libnpth.so.*"
+FILES_${PN}-dev += "${bindir}/npth-config"
diff --git a/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/0001-include-stdint.h-for-SSIZE_MAX-and-SIZE_MAX-definiti.patch b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/0001-include-stdint.h-for-SSIZE_MAX-and-SIZE_MAX-definiti.patch
new file mode 100644
index 0000000..b3bdd8e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/0001-include-stdint.h-for-SSIZE_MAX-and-SIZE_MAX-definiti.patch
@@ -0,0 +1,30 @@
+From f7551ec58e2f0a892295e0c2a650083101e12c54 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 20 May 2017 13:24:26 -0700
+Subject: [PATCH] include stdint.h for SSIZE_MAX and SIZE_MAX definitions
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ pr/tests/prfz.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/pr/tests/prfz.c b/pr/tests/prfz.c
+index 0c5a432..9c17590 100644
+--- a/pr/tests/prfz.c
++++ b/pr/tests/prfz.c
+@@ -10,7 +10,9 @@
+ #include <sys/types.h>
+ #include <limits.h>
+ #include <string.h>
+-
++#ifdef XP_UNIX
++#include <stdint.h>
++#endif
+ int
+ main(int argc, char **argv)
+ {
+-- 
+2.13.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/nspr/nspr_4.12.bb b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr_4.12.bb
deleted file mode 100644
index 9345a51..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/nspr/nspr_4.12.bb
+++ /dev/null
@@ -1,187 +0,0 @@
-SUMMARY = "Netscape Portable Runtime Library"
-HOMEPAGE =  "http://www.mozilla.org/projects/nspr/"
-LICENSE = "GPL-2.0 | MPL-2.0 | LGPL-2.1"
-LIC_FILES_CHKSUM = "file://configure.in;beginline=3;endline=6;md5=90c2fdee38e45d6302abcfe475c8b5c5 \
-                    file://Makefile.in;beginline=4;endline=38;md5=beda1dbb98a515f557d3e58ef06bca99"
-SECTION = "libs/network"
-
-SRC_URI = "http://ftp.mozilla.org/pub/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz \
-           file://remove-rpath-from-tests.patch \
-           file://fix-build-on-x86_64.patch \
-           file://remove-srcdir-from-configure-in.patch \
-           file://0002-Add-nios2-support.patch \
-           file://nspr.pc.in \
-"
-
-CACHED_CONFIGUREVARS_append_libc-musl = " CFLAGS='${CFLAGS} -D_PR_POLL_AVAILABLE \
-                                          -D_PR_HAVE_OFF64_T -D_PR_INET6 -D_PR_HAVE_INET_NTOP \
-                                          -D_PR_HAVE_GETHOSTBYNAME2 -D_PR_HAVE_GETADDRINFO \
-                                          -D_PR_INET6_PROBE'"
-
-UPSTREAM_CHECK_URI = "http://ftp.mozilla.org/pub/nspr/releases/"
-UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+)/"
-
-SRC_URI[md5sum] = "0de760c1e00a92e180e611cf06ce9589"
-SRC_URI[sha256sum] = "e0b10a1e569153668ff8bdea6c7e491b389fab69c2f18285a1ebf7c2ea4269de"
-
-S = "${WORKDIR}/nspr-${PV}/nspr"
-
-RDEPENDS_${PN}-dev += "perl"
-TARGET_CC_ARCH += "${LDFLAGS}"
-
-TESTS = " \
-    accept \
-    acceptread \
-    acceptreademu \
-    affinity \
-    alarm \
-    anonfm \
-    atomic \
-    attach \
-    bigfile \
-    cleanup \
-    cltsrv  \
-    concur \
-    cvar \
-    cvar2 \
-    dlltest \
-    dtoa \
-    errcodes \
-    exit \
-    fdcach \
-    fileio \
-    foreign \
-    formattm \
-    fsync \
-    gethost \
-    getproto \
-    i2l \
-    initclk \
-    inrval \
-    instrumt \
-    intrio \
-    intrupt \
-    io_timeout \
-    ioconthr \
-    join \
-    joinkk \
-    joinku \
-    joinuk \
-    joinuu \
-    layer \
-    lazyinit \
-    libfilename \
-    lltest \
-    lock \
-    lockfile \
-    logfile \
-    logger \
-    many_cv \
-    multiwait \
-    nameshm1 \
-    nblayer \
-    nonblock \
-    ntioto \
-    ntoh \
-    op_2long \
-    op_excl \
-    op_filnf \
-    op_filok \
-    op_nofil \
-    parent \
-    parsetm \
-    peek \
-    perf \
-    pipeping \
-    pipeping2 \
-    pipeself \
-    poll_nm \
-    poll_to \
-    pollable \
-    prftest \
-    primblok \
-    provider \
-    prpollml \
-    ranfile \
-    randseed \
-    reinit \
-    rwlocktest \
-    sel_spd \
-    selct_er \
-    selct_nm \
-    selct_to \
-    selintr \
-    sema \
-    semaerr \
-    semaping \
-    sendzlf \
-    server_test \
-    servr_kk \
-    servr_uk \
-    servr_ku \
-    servr_uu \
-    short_thread \
-    sigpipe \
-    socket \
-    sockopt \
-    sockping \
-    sprintf \
-    stack \
-    stdio \
-    str2addr \
-    strod \
-    switch \
-    system \
-    testbit \
-    testfile \
-    threads \
-    timemac \
-    timetest \
-    tpd \
-    udpsrv \
-    vercheck \
-    version \
-    writev \
-    xnotify \
-    zerolen"
-
-inherit autotools
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
-
-do_compile_prepend() {
-	oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX" LDFLAGS="" CC=gcc -C config export
-}
-
-do_compile_append() {
-	oe_runmake -C pr/tests
-}
-
-do_install_append() {
-    install -D ${WORKDIR}/nspr.pc.in ${D}${libdir}/pkgconfig/nspr.pc
-    sed -i  \
-    -e 's:NSPRVERSION:${PV}:g' \
-    -e 's:OEPREFIX:${prefix}:g' \
-    -e 's:OELIBDIR:${libdir}:g' \
-    -e 's:OEINCDIR:${includedir}:g' \
-    -e 's:OEEXECPREFIX:${exec_prefix}:g' \
-    ${D}${libdir}/pkgconfig/nspr.pc
-
-    mkdir -p ${D}${libdir}/nspr/tests
-    install -m 0755 ${S}/pr/tests/runtests.pl ${D}${libdir}/nspr/tests
-    install -m 0755 ${S}/pr/tests/runtests.sh ${D}${libdir}/nspr/tests
-    cd ${B}/pr/tests
-    install -m 0755 ${TESTS} ${D}${libdir}/nspr/tests
-
-    # delete compile-et.pl and perr.properties from ${bindir} because these are
-    # only used to generate prerr.c and prerr.h files from prerr.et at compile
-    # time
-    rm ${D}${bindir}/compile-et.pl ${D}${bindir}/prerr.properties
-}
-
-FILES_${PN} = "${libdir}/lib*.so"
-FILES_${PN}-dev = "${bindir}/* ${libdir}/nspr/tests/* ${libdir}/pkgconfig \
-                ${includedir}/* ${datadir}/aclocal/* "
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/nspr/nspr_4.13.1.bb b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr_4.13.1.bb
new file mode 100644
index 0000000..63ebecf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr_4.13.1.bb
@@ -0,0 +1,190 @@
+SUMMARY = "Netscape Portable Runtime Library"
+HOMEPAGE =  "http://www.mozilla.org/projects/nspr/"
+LICENSE = "GPL-2.0 | MPL-2.0 | LGPL-2.1"
+LIC_FILES_CHKSUM = "file://configure.in;beginline=3;endline=6;md5=90c2fdee38e45d6302abcfe475c8b5c5 \
+                    file://Makefile.in;beginline=4;endline=38;md5=beda1dbb98a515f557d3e58ef06bca99"
+SECTION = "libs/network"
+
+SRC_URI = "http://ftp.mozilla.org/pub/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz \
+           file://remove-rpath-from-tests.patch \
+           file://fix-build-on-x86_64.patch \
+           file://remove-srcdir-from-configure-in.patch \
+           file://0002-Add-nios2-support.patch \
+           file://0001-include-stdint.h-for-SSIZE_MAX-and-SIZE_MAX-definiti.patch \
+           file://nspr.pc.in \
+"
+
+CACHED_CONFIGUREVARS_append_libc-musl = " CFLAGS='${CFLAGS} -D_PR_POLL_AVAILABLE \
+                                          -D_PR_HAVE_OFF64_T -D_PR_INET6 -D_PR_HAVE_INET_NTOP \
+                                          -D_PR_HAVE_GETHOSTBYNAME2 -D_PR_HAVE_GETADDRINFO \
+                                          -D_PR_INET6_PROBE -DNO_DLOPEN_NULL'"
+
+UPSTREAM_CHECK_URI = "http://ftp.mozilla.org/pub/nspr/releases/"
+UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+)/"
+
+SRC_URI[md5sum] = "9c44298a6fc478b3c0a4e98f4f9981ed"
+SRC_URI[sha256sum] = "5e4c1751339a76e7c772c0c04747488d7f8c98980b434dc846977e43117833ab"
+
+CVE_PRODUCT = "netscape_portable_runtime"
+
+S = "${WORKDIR}/nspr-${PV}/nspr"
+
+RDEPENDS_${PN}-dev += "perl"
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+TESTS = " \
+    accept \
+    acceptread \
+    acceptreademu \
+    affinity \
+    alarm \
+    anonfm \
+    atomic \
+    attach \
+    bigfile \
+    cleanup \
+    cltsrv  \
+    concur \
+    cvar \
+    cvar2 \
+    dlltest \
+    dtoa \
+    errcodes \
+    exit \
+    fdcach \
+    fileio \
+    foreign \
+    formattm \
+    fsync \
+    gethost \
+    getproto \
+    i2l \
+    initclk \
+    inrval \
+    instrumt \
+    intrio \
+    intrupt \
+    io_timeout \
+    ioconthr \
+    join \
+    joinkk \
+    joinku \
+    joinuk \
+    joinuu \
+    layer \
+    lazyinit \
+    libfilename \
+    lltest \
+    lock \
+    lockfile \
+    logfile \
+    logger \
+    many_cv \
+    multiwait \
+    nameshm1 \
+    nblayer \
+    nonblock \
+    ntioto \
+    ntoh \
+    op_2long \
+    op_excl \
+    op_filnf \
+    op_filok \
+    op_nofil \
+    parent \
+    parsetm \
+    peek \
+    perf \
+    pipeping \
+    pipeping2 \
+    pipeself \
+    poll_nm \
+    poll_to \
+    pollable \
+    prftest \
+    primblok \
+    provider \
+    prpollml \
+    ranfile \
+    randseed \
+    reinit \
+    rwlocktest \
+    sel_spd \
+    selct_er \
+    selct_nm \
+    selct_to \
+    selintr \
+    sema \
+    semaerr \
+    semaping \
+    sendzlf \
+    server_test \
+    servr_kk \
+    servr_uk \
+    servr_ku \
+    servr_uu \
+    short_thread \
+    sigpipe \
+    socket \
+    sockopt \
+    sockping \
+    sprintf \
+    stack \
+    stdio \
+    str2addr \
+    strod \
+    switch \
+    system \
+    testbit \
+    testfile \
+    threads \
+    timemac \
+    timetest \
+    tpd \
+    udpsrv \
+    vercheck \
+    version \
+    writev \
+    xnotify \
+    zerolen"
+
+inherit autotools
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+do_compile_prepend() {
+	oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX" LDFLAGS="" CC=gcc -C config export
+}
+
+do_compile_append() {
+	oe_runmake -C pr/tests
+}
+
+do_install_append() {
+    install -D ${WORKDIR}/nspr.pc.in ${D}${libdir}/pkgconfig/nspr.pc
+    sed -i  \
+    -e 's:NSPRVERSION:${PV}:g' \
+    -e 's:OEPREFIX:${prefix}:g' \
+    -e 's:OELIBDIR:${libdir}:g' \
+    -e 's:OEINCDIR:${includedir}:g' \
+    -e 's:OEEXECPREFIX:${exec_prefix}:g' \
+    ${D}${libdir}/pkgconfig/nspr.pc
+
+    mkdir -p ${D}${libdir}/nspr/tests
+    install -m 0755 ${S}/pr/tests/runtests.pl ${D}${libdir}/nspr/tests
+    install -m 0755 ${S}/pr/tests/runtests.sh ${D}${libdir}/nspr/tests
+    cd ${B}/pr/tests
+    install -m 0755 ${TESTS} ${D}${libdir}/nspr/tests
+
+    # delete compile-et.pl and perr.properties from ${bindir} because these are
+    # only used to generate prerr.c and prerr.h files from prerr.et at compile
+    # time
+    rm ${D}${bindir}/compile-et.pl ${D}${bindir}/prerr.properties
+}
+
+FILES_${PN} = "${libdir}/lib*.so"
+FILES_${PN}-dev = "${bindir}/* ${libdir}/nspr/tests/* ${libdir}/pkgconfig \
+                ${includedir}/* ${datadir}/aclocal/* "
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/nss/nss/0001-nss-fix-support-cross-compiling.patch b/import-layers/yocto-poky/meta/recipes-support/nss/nss/0001-nss-fix-support-cross-compiling.patch
new file mode 100644
index 0000000..d540339
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nss/nss/0001-nss-fix-support-cross-compiling.patch
@@ -0,0 +1,48 @@
+From 0cf47ee432cc26a706864fcc09b2c3adc342a679 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 22 Feb 2017 11:36:11 +0200
+Subject: [PATCH] nss: fix support cross compiling
+
+Let some make variables be assigned from outside makefile.
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ nss/coreconf/arch.mk    | 2 +-
+ nss/lib/freebl/Makefile | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/nss/coreconf/arch.mk b/nss/coreconf/arch.mk
+index 06c276f..9c1eb51 100644
+--- a/nss/coreconf/arch.mk
++++ b/nss/coreconf/arch.mk
+@@ -30,7 +30,7 @@ OS_TEST := $(shell uname -m)
+ ifeq ($(OS_TEST),i86pc)
+     OS_RELEASE := $(shell uname -r)_$(OS_TEST)
+ else
+-    OS_RELEASE := $(shell uname -r)
++    OS_RELEASE ?= $(shell uname -r)
+ endif
+ 
+ #
+diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
+index 0ce1425..ebeb411 100644
+--- a/nss/lib/freebl/Makefile
++++ b/nss/lib/freebl/Makefile
+@@ -36,6 +36,12 @@ ifdef USE_64
+ 	DEFINES += -DNSS_USE_64
+ endif
+ 
++ifeq ($(OS_TEST),mips)
++ifndef USE_64
++       DEFINES += -DNS_PTR_LE_32
++endif
++endif
++
+ ifdef USE_ABI32_FPU
+ 	DEFINES += -DNSS_USE_ABI32_FPU
+ endif
+-- 
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch b/import-layers/yocto-poky/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch
new file mode 100644
index 0000000..f7f2c21
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch
@@ -0,0 +1,31 @@
+From c8eadfcdfbc1d5a4799e9a264b0f859cb5954c05 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 11:40:47 -0700
+Subject: [PATCH 7/7] Fix compilation for X32
+
+X32 uses 32-bit pointers, not 64-bit.
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c b/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c
+index 2a3301e..d4ade41 100644
+--- a/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c
++++ b/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c
+@@ -87,7 +87,11 @@ static poly1305_state_internal INLINE
+     *
+     poly1305_aligned_state(poly1305_state *state)
+ {
++#ifdef __ILP32__
++    return (poly1305_state_internal *)(((uint32_t)state + 63) & ~63);
++#else
+     return (poly1305_state_internal *)(((uint64_t)state + 63) & ~63);
++#endif
+ }
+ 
+ /* copy 0-63 bytes */
+-- 
+2.8.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-support-cross-compiling.patch b/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-support-cross-compiling.patch
deleted file mode 100644
index f0b3550..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-support-cross-compiling.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-nss: fix support cross compiling
-
-Let some make variables be assigned from outside makefile.
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-Upstream-Status: Inappropriate [configuration]
----
- nss/coreconf/Linux.mk   | 12 +++++++++++-
- nss/coreconf/arch.mk    |  2 +-
- nss/lib/freebl/Makefile |  6 ++++++
- 3 files changed, 18 insertions(+), 2 deletions(-)
-
-diff --git a/nss/coreconf/Linux.mk b/nss/coreconf/Linux.mk
---- a/nss/coreconf/Linux.mk
-+++ b/nss/coreconf/Linux.mk
-@@ -16,11 +16,21 @@ ifeq ($(USE_PTHREADS),1)
- 	IMPL_STRATEGY = _PTH
- endif
- 
-+ifndef CC
- CC			= gcc
-+endif
-+
-+ifdef CXX
-+CCC			= $(CXX)
-+else
- CCC			= g++
-+endif
-+
-+ifndef RANLIB
- RANLIB			= ranlib
-+endif
- 
--DEFAULT_COMPILER = gcc
-+DEFAULT_COMPILER = $(CC)
- 
- ifeq ($(OS_TARGET),Android)
- ifndef ANDROID_NDK
-diff --git a/nss/coreconf/arch.mk b/nss/coreconf/arch.mk
-index 6557348..b722412 100644
---- a/nss/coreconf/arch.mk
-+++ b/nss/coreconf/arch.mk
-@@ -37,7 +37,7 @@ OS_TEST := $(shell uname -m)
- ifeq ($(OS_TEST),i86pc)
-     OS_RELEASE := $(shell uname -r)_$(OS_TEST)
- else
--    OS_RELEASE := $(shell uname -r)
-+    OS_RELEASE ?= $(shell uname -r)
- endif
- 
- #
-diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
-index 0d293f1..678f506 100644
---- a/nss/lib/freebl/Makefile
-+++ b/nss/lib/freebl/Makefile
-@@ -36,6 +36,12 @@ ifdef USE_64
- 	DEFINES += -DNSS_USE_64
- endif
- 
-+ifeq ($(OS_TEST),mips)
-+ifndef USE_64
-+	DEFINES += -DNS_PTR_LE_32
-+endif
-+endif
-+
- ifdef USE_ABI32_FPU
- 	DEFINES += -DNSS_USE_ABI32_FPU
- endif
--- 
-1.8.1.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/nss/nss/pqg.c-ULL_addend.patch b/import-layers/yocto-poky/meta/recipes-support/nss/nss/pqg.c-ULL_addend.patch
index 9caaaeb..9942bf1 100644
--- a/import-layers/yocto-poky/meta/recipes-support/nss/nss/pqg.c-ULL_addend.patch
+++ b/import-layers/yocto-poky/meta/recipes-support/nss/nss/pqg.c-ULL_addend.patch
@@ -13,11 +13,11 @@
 @@ -322,8 +322,8 @@ generate_h_candidate(SECItem *hit, mp_in
  
  static SECStatus
- addToSeed(const SECItem * seed,
--          unsigned long   addend,
--          int             seedlen, /* g in 186-1 */
+ addToSeed(const SECItem *seed,
+-          unsigned long addend,
+-          int seedlen, /* g in 186-1 */
 +          unsigned long long  addend,
 +          int                 seedlen, /* g in 186-1 */
-           SECItem * seedout)
+           SECItem *seedout)
  {
      mp_int s, sum, modulus, tmp;
diff --git a/import-layers/yocto-poky/meta/recipes-support/nss/nss_3.25.bb b/import-layers/yocto-poky/meta/recipes-support/nss/nss_3.25.bb
deleted file mode 100644
index eff09eb..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/nss/nss_3.25.bb
+++ /dev/null
@@ -1,242 +0,0 @@
-SUMMARY = "Mozilla's SSL and TLS implementation"
-DESCRIPTION = "Network Security Services (NSS) is a set of libraries \
-designed to support cross-platform development of \
-security-enabled client and server applications. \
-Applications built with NSS can support SSL v2 and v3, \
-TLS, PKCS 5, PKCS 7, PKCS 11, PKCS 12, S/MIME, X.509 \
-v3 certificates, and other security standards."
-HOMEPAGE = "http://www.mozilla.org/projects/security/pki/nss/"
-SECTION = "libs"
-
-LICENSE = "MPL-2.0 | (MPL-2.0 & GPL-2.0+) | (MPL-2.0 & LGPL-2.1+)"
-
-LIC_FILES_CHKSUM = "file://nss/COPYING;md5=3b1e88e1b9c0b5a4b2881d46cce06a18 \
-                    file://nss/lib/freebl/mpi/doc/LICENSE;md5=491f158d09d948466afce85d6f1fe18f \
-                    file://nss/lib/freebl/mpi/doc/LICENSE-MPL;md5=5d425c8f3157dbf212db2ec53d9e5132"
-
-SRC_URI = "\
-    http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_25_RTM/src/${BP}.tar.gz \
-    file://nss-fix-support-cross-compiling.patch \
-    file://nss-no-rpath-for-cross-compiling.patch \
-    file://nss-fix-incorrect-shebang-of-perl.patch \
-    file://nss-fix-nsinstall-build.patch \
-    file://disable-Wvarargs-with-clang.patch \
-    file://pqg.c-ULL_addend.patch \
-    file://nss.pc.in \
-    file://signlibs.sh \
-"
-SRC_URI[md5sum] = "23169c406adc8ac3672d34bf9ea2433d"
-SRC_URI[sha256sum] = "5d1ad475da19d0c033a716350dc5f8a747999d3eba5ac07ee0368c5bad6e2359"
-
-UPSTREAM_CHECK_URI = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Releases"
-UPSTREAM_CHECK_REGEX = "NSS_(?P<pver>.+)_release_notes"
-
-inherit siteinfo
-
-DEPENDS = "sqlite3 nspr zlib nss-native"
-DEPENDS_class-native = "sqlite3-native nspr-native zlib-native"
-RDEPENDS_${PN}-smime = "perl"
-
-TD = "${S}/tentative-dist"
-TDS = "${S}/tentative-dist-staging"
-
-TARGET_CC_ARCH += "${LDFLAGS}"
-
-do_configure_prepend_libc-musl () {
-    sed -i -e '/-DHAVE_SYS_CDEFS_H/d' ${S}/nss/lib/dbm/config/config.mk
-}
-
-do_compile_prepend_class-native() {
-    export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
-    export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
-    export NSS_ENABLE_WERROR=0
-}
-
-do_compile_prepend_class-nativesdk() {
-    export LDFLAGS=""
-}
-
-do_compile_prepend_class-native() {
-    # Need to set RPATH so that chrpath will do its job correctly
-    RPATH="-Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE}"
-}
-
-do_compile() {
-    export CROSS_COMPILE=1
-    export NATIVE_CC="gcc"
-    export NATIVE_FLAGS="${HOST_CFLAGS}"
-    export BUILD_OPT=1
-
-    export FREEBL_NO_DEPEND=1
-    export FREEBL_LOWHASH=1
-
-    export LIBDIR=${libdir}
-    export MOZILLA_CLIENT=1
-    export NS_USE_GCC=1
-    export NSS_USE_SYSTEM_SQLITE=1
-    export NSS_ENABLE_ECC=1
-
-    export OS_RELEASE=3.4
-    export OS_TARGET=Linux
-    export OS_ARCH=Linux
-
-    if [ "${TARGET_ARCH}" = "powerpc" ]; then
-        OS_TEST=ppc
-    elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
-        OS_TEST=ppc64
-    elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
-        OS_TEST=mips
-    else
-        OS_TEST="${TARGET_ARCH}"
-    fi
-
-    if [ "${SITEINFO_BITS}" = "64" ]; then
-        export USE_64=1
-    elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
-        export USE_X32=1
-    fi
-
-    export NSS_DISABLE_GTESTS=1
-
-    # We can modify CC in the environment, but if we set it via an
-    # argument to make, nsinstall, a host program, will also build with it!
-    #
-    export CC="${CC} -g"
-    make -C ./nss CCC="${CXX} -g" \
-        OS_TEST=${OS_TEST} \
-        RPATH="${RPATH}"
-}
-
-
-do_install_prepend_class-nativesdk() {
-    export LDFLAGS=""
-}
-
-do_install() {
-    export CROSS_COMPILE=1
-    export NATIVE_CC="gcc"
-    export BUILD_OPT=1
-
-    export FREEBL_NO_DEPEND=1
-
-    export LIBDIR=${libdir}
-    export MOZILLA_CLIENT=1
-    export NS_USE_GCC=1
-    export NSS_USE_SYSTEM_SQLITE=1
-    export NSS_ENABLE_ECC=1
-
-    export OS_RELEASE=3.4
-    export OS_TARGET=Linux
-    export OS_ARCH=Linux
-
-    if [ "${TARGET_ARCH}" = "powerpc" ]; then
-        OS_TEST=ppc
-    elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
-        OS_TEST=ppc64
-    elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
-        OS_TEST=mips
-    else
-        OS_TEST="${TARGET_ARCH}"
-    fi
-    if [ "${SITEINFO_BITS}" = "64" ]; then
-        export USE_64=1
-    elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
-        export USE_X32=1
-    fi
-
-    export NSS_DISABLE_GTESTS=1
-
-    make -C ./nss \
-        CCC="${CXX}" \
-        OS_TEST=${OS_TEST} \
-        SOURCE_LIB_DIR="${TD}/${libdir}" \
-        SOURCE_BIN_DIR="${TD}/${bindir}" \
-        install
-
-    install -d ${D}/${libdir}/
-    for file in ${S}/dist/*.OBJ/lib/*.so; do
-        echo "Installing `basename $file`..."
-        cp $file  ${D}/${libdir}/
-    done
-
-    for shared_lib in ${TD}/${libdir}/*.so.*; do
-        if [ -f $shared_lib ]; then
-            cp $shared_lib ${D}/${libdir}
-            ln -sf $(basename $shared_lib) ${D}/${libdir}/$(basename $shared_lib .1oe)
-        fi
-    done
-    for shared_lib in ${TD}/${libdir}/*.so; do
-        if [ -f $shared_lib -a ! -e ${D}/${libdir}/$shared_lib ]; then
-            cp $shared_lib ${D}/${libdir}
-        fi
-    done
-
-    install -d ${D}/${includedir}/nss3
-    install -m 644 -t ${D}/${includedir}/nss3 dist/public/nss/*
-
-    install -d ${D}/${bindir}
-    for binary in ${TD}/${bindir}/*; do
-        install -m 755 -t ${D}/${bindir} $binary
-    done
-}
-
-do_install_append() {
-    # Create empty .chk files for the NSS libraries at build time. They could
-    # be regenerated at target's boot time.
-    for file in libsoftokn3.chk libfreebl3.chk libnssdbm3.chk; do
-        touch ${D}/${libdir}/$file
-        chmod 755 ${D}/${libdir}/$file
-    done
-    install -D -m 755 ${WORKDIR}/signlibs.sh ${D}/${bindir}/signlibs.sh
-
-    install -d ${D}${libdir}/pkgconfig/
-    sed 's/%NSS_VERSION%/${PV}/' ${WORKDIR}/nss.pc.in | sed 's/%NSPR_VERSION%/4.9.2/' > ${D}${libdir}/pkgconfig/nss.pc
-    sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nss.pc
-    sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nss.pc
-    sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nss.pc
-    sed -i s:OEINCDIR:${includedir}/nss3:g ${D}${libdir}/pkgconfig/nss.pc
-}
-
-do_install_append_class-target() {
-    # Create a blank certificate
-    mkdir -p ${D}${sysconfdir}/pki/nssdb/
-    touch ./empty_password
-    certutil -N -d ${D}${sysconfdir}/pki/nssdb/ -f ./empty_password
-    chmod 644 ${D}${sysconfdir}/pki/nssdb/*.db
-    rm ./empty_password
-}
-
-pkg_postinst_${PN} () {
-    if [ -n "$D" ]; then
-        for I in $D/${libdir}/lib*.chk; do
-            DN=`dirname $I`
-            BN=`basename $I .chk`
-            FN=$DN/$BN.so
-            shlibsign -i $FN
-	    if [ $? -ne 0 ]; then
-	       exit 1
-	    fi
-        done
-        exit 0
-    fi
-    signlibs.sh
-}
-
-PACKAGES =+ "${PN}-smime"
-FILES_${PN}-smime = "\
-    ${bindir}/smime \
-"
-FILES_${PN} = "\
-    ${sysconfdir} \
-    ${bindir} \
-    ${libdir}/lib*.chk \
-    ${libdir}/lib*.so \
-    "
-FILES_${PN}-dev = "\
-    ${libdir}/nss \
-    ${libdir}/pkgconfig/* \
-    ${includedir}/* \
-    "
-
-BBCLASSEXTEND = "native nativesdk"
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/nss/nss_3.28.1.bb b/import-layers/yocto-poky/meta/recipes-support/nss/nss_3.28.1.bb
new file mode 100644
index 0000000..fed86fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nss/nss_3.28.1.bb
@@ -0,0 +1,246 @@
+SUMMARY = "Mozilla's SSL and TLS implementation"
+DESCRIPTION = "Network Security Services (NSS) is a set of libraries \
+designed to support cross-platform development of \
+security-enabled client and server applications. \
+Applications built with NSS can support SSL v2 and v3, \
+TLS, PKCS 5, PKCS 7, PKCS 11, PKCS 12, S/MIME, X.509 \
+v3 certificates, and other security standards."
+HOMEPAGE = "http://www.mozilla.org/projects/security/pki/nss/"
+SECTION = "libs"
+
+LICENSE = "MPL-2.0 | (MPL-2.0 & GPL-2.0+) | (MPL-2.0 & LGPL-2.1+)"
+
+LIC_FILES_CHKSUM = "file://nss/COPYING;md5=3b1e88e1b9c0b5a4b2881d46cce06a18 \
+                    file://nss/lib/freebl/mpi/doc/LICENSE;md5=491f158d09d948466afce85d6f1fe18f \
+                    file://nss/lib/freebl/mpi/doc/LICENSE-MPL;md5=5d425c8f3157dbf212db2ec53d9e5132"
+
+SRC_URI = "\
+    http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_28_1_RTM/src/${BP}.tar.gz \
+    file://0001-nss-fix-support-cross-compiling.patch \
+    file://nss-no-rpath-for-cross-compiling.patch \
+    file://nss-fix-incorrect-shebang-of-perl.patch \
+    file://nss-fix-nsinstall-build.patch \
+    file://disable-Wvarargs-with-clang.patch \
+    file://pqg.c-ULL_addend.patch \
+    file://Fix-compilation-for-X32.patch \
+    file://nss.pc.in \
+    file://signlibs.sh \
+"
+SRC_URI[md5sum] = "e98d48435cee5792f97ef7fc35a602c3"
+SRC_URI[sha256sum] = "58cc0c05c0ed9523e6d820bea74f513538f48c87aac931876e3d3775de1a82ad"
+
+UPSTREAM_CHECK_URI = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Releases"
+UPSTREAM_CHECK_REGEX = "NSS_(?P<pver>.+)_release_notes"
+
+inherit siteinfo
+
+DEPENDS = "sqlite3 nspr zlib nss-native"
+DEPENDS_class-native = "sqlite3-native nspr-native zlib-native"
+RDEPENDS_${PN}-smime = "perl"
+
+TD = "${S}/tentative-dist"
+TDS = "${S}/tentative-dist-staging"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_configure_prepend_libc-musl () {
+    sed -i -e '/-DHAVE_SYS_CDEFS_H/d' ${S}/nss/lib/dbm/config/config.mk
+}
+
+do_compile_prepend_class-native() {
+    export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
+    export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
+    export NSS_ENABLE_WERROR=0
+}
+
+do_compile_prepend_class-nativesdk() {
+    export LDFLAGS=""
+}
+
+do_compile_prepend_class-native() {
+    # Need to set RPATH so that chrpath will do its job correctly
+    RPATH="-Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE}"
+}
+
+do_compile() {
+    export CROSS_COMPILE=1
+    export NATIVE_CC="gcc"
+    export NATIVE_FLAGS="${HOST_CFLAGS}"
+    export BUILD_OPT=1
+
+    export FREEBL_NO_DEPEND=1
+    export FREEBL_LOWHASH=1
+
+    export LIBDIR=${libdir}
+    export MOZILLA_CLIENT=1
+    export NS_USE_GCC=1
+    export NSS_USE_SYSTEM_SQLITE=1
+    export NSS_ENABLE_ECC=1
+
+    export OS_RELEASE=3.4
+    export OS_TARGET=Linux
+    export OS_ARCH=Linux
+
+    if [ "${TARGET_ARCH}" = "powerpc" ]; then
+        OS_TEST=ppc
+    elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
+        OS_TEST=ppc64
+    elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
+        OS_TEST=mips
+    else
+        OS_TEST="${TARGET_ARCH}"
+    fi
+
+    if [ "${SITEINFO_BITS}" = "64" ]; then
+        export USE_64=1
+    elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
+        export USE_X32=1
+    fi
+
+    export NSS_DISABLE_GTESTS=1
+
+    # We can modify CC in the environment, but if we set it via an
+    # argument to make, nsinstall, a host program, will also build with it!
+    #
+    export CC="${CC} -g"
+    make -C ./nss CCC="${CXX} -g" \
+        OS_TEST=${OS_TEST} \
+        RPATH="${RPATH}"
+}
+do_compile[vardepsexclude] += "SITEINFO_BITS"
+
+
+do_install_prepend_class-nativesdk() {
+    export LDFLAGS=""
+}
+
+do_install() {
+    export CROSS_COMPILE=1
+    export NATIVE_CC="gcc"
+    export BUILD_OPT=1
+
+    export FREEBL_NO_DEPEND=1
+
+    export LIBDIR=${libdir}
+    export MOZILLA_CLIENT=1
+    export NS_USE_GCC=1
+    export NSS_USE_SYSTEM_SQLITE=1
+    export NSS_ENABLE_ECC=1
+
+    export OS_RELEASE=3.4
+    export OS_TARGET=Linux
+    export OS_ARCH=Linux
+
+    if [ "${TARGET_ARCH}" = "powerpc" ]; then
+        OS_TEST=ppc
+    elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
+        OS_TEST=ppc64
+    elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
+        OS_TEST=mips
+    else
+        OS_TEST="${TARGET_ARCH}"
+    fi
+    if [ "${SITEINFO_BITS}" = "64" ]; then
+        export USE_64=1
+    elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
+        export USE_X32=1
+    fi
+
+    export NSS_DISABLE_GTESTS=1
+
+    make -C ./nss \
+        CCC="${CXX}" \
+        OS_TEST=${OS_TEST} \
+        SOURCE_LIB_DIR="${TD}/${libdir}" \
+        SOURCE_BIN_DIR="${TD}/${bindir}" \
+        install
+
+    install -d ${D}/${libdir}/
+    for file in ${S}/dist/*.OBJ/lib/*.so; do
+        echo "Installing `basename $file`..."
+        cp $file  ${D}/${libdir}/
+    done
+
+    for shared_lib in ${TD}/${libdir}/*.so.*; do
+        if [ -f $shared_lib ]; then
+            cp $shared_lib ${D}/${libdir}
+            ln -sf $(basename $shared_lib) ${D}/${libdir}/$(basename $shared_lib .1oe)
+        fi
+    done
+    for shared_lib in ${TD}/${libdir}/*.so; do
+        if [ -f $shared_lib -a ! -e ${D}/${libdir}/$shared_lib ]; then
+            cp $shared_lib ${D}/${libdir}
+        fi
+    done
+
+    install -d ${D}/${includedir}/nss3
+    install -m 644 -t ${D}/${includedir}/nss3 dist/public/nss/*
+
+    install -d ${D}/${bindir}
+    for binary in ${TD}/${bindir}/*; do
+        install -m 755 -t ${D}/${bindir} $binary
+    done
+}
+do_install[vardepsexclude] += "SITEINFO_BITS"
+
+do_install_append() {
+    # Create empty .chk files for the NSS libraries at build time. They could
+    # be regenerated at target's boot time.
+    for file in libsoftokn3.chk libfreebl3.chk libnssdbm3.chk; do
+        touch ${D}/${libdir}/$file
+        chmod 755 ${D}/${libdir}/$file
+    done
+    install -D -m 755 ${WORKDIR}/signlibs.sh ${D}/${bindir}/signlibs.sh
+
+    install -d ${D}${libdir}/pkgconfig/
+    sed 's/%NSS_VERSION%/${PV}/' ${WORKDIR}/nss.pc.in | sed 's/%NSPR_VERSION%/4.9.2/' > ${D}${libdir}/pkgconfig/nss.pc
+    sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nss.pc
+    sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nss.pc
+    sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nss.pc
+    sed -i s:OEINCDIR:${includedir}/nss3:g ${D}${libdir}/pkgconfig/nss.pc
+}
+
+do_install_append_class-target() {
+    # Create a blank certificate
+    mkdir -p ${D}${sysconfdir}/pki/nssdb/
+    touch ./empty_password
+    certutil -N -d ${D}${sysconfdir}/pki/nssdb/ -f ./empty_password
+    chmod 644 ${D}${sysconfdir}/pki/nssdb/*.db
+    rm ./empty_password
+}
+
+PACKAGE_WRITE_DEPS += "nss-native"
+pkg_postinst_${PN} () {
+    if [ -n "$D" ]; then
+        for I in $D${libdir}/lib*.chk; do
+            DN=`dirname $I`
+            BN=`basename $I .chk`
+            FN=$DN/$BN.so
+            shlibsign -i $FN
+            if [ $? -ne 0 ]; then
+                exit 1
+            fi
+        done
+    else
+        signlibs.sh
+    fi
+}
+
+PACKAGES =+ "${PN}-smime"
+FILES_${PN}-smime = "\
+    ${bindir}/smime \
+"
+FILES_${PN} = "\
+    ${sysconfdir} \
+    ${bindir} \
+    ${libdir}/lib*.chk \
+    ${libdir}/lib*.so \
+    "
+FILES_${PN}-dev = "\
+    ${libdir}/nss \
+    ${libdir}/pkgconfig/* \
+    ${includedir}/* \
+    "
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/ptest-runner/ptest-runner_2.0.2.bb b/import-layers/yocto-poky/meta/recipes-support/ptest-runner/ptest-runner_2.0.2.bb
new file mode 100644
index 0000000..a3e9a7e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/ptest-runner/ptest-runner_2.0.2.bb
@@ -0,0 +1,26 @@
+SUMMARY = "A C program to run all installed ptests"
+DESCRIPTION = "The ptest-runner2 package installs a ptest-runner \
+program which loops through all installed ptest test suites and \
+runs them in sequence."
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/ptest-runner2/about/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
+
+SRCREV = "6d2872116cd9d6e1617a768f9d72bbf091489b2d"
+PV = "2.0.2+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/ptest-runner2"
+S = "${WORKDIR}/git"
+
+FILES_${PN} = "${bindir}/ptest-runner"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_compile () {
+	oe_runmake
+}
+
+do_install () {
+	install -D -m 0755 ${S}/ptest-runner ${D}${bindir}/ptest-runner
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/ptest-runner/ptest-runner_2.0.bb b/import-layers/yocto-poky/meta/recipes-support/ptest-runner/ptest-runner_2.0.bb
deleted file mode 100644
index 9d45513..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/ptest-runner/ptest-runner_2.0.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "A C program to run all installed ptests"
-DESCRIPTION = "The ptest-runner2 package installs a ptest-runner \
-program which loops through all installed ptest test suites and \
-runs them in sequence."
-HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/ptest-runner2/about/"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
-
-SRCREV = "e2aa4256745377b784c8691f546041b59f6e046b"
-PV = "2.0.1+git${SRCPV}"
-
-SRC_URI = "git://git.yoctoproject.org/ptest-runner2"
-S = "${WORKDIR}/git"
-
-FILES_${PN} = "${bindir}/ptest-runner"
-
-EXTRA_OEMAKE = "-e MAKEFLAGS="
-
-do_compile () {
-	oe_runmake
-}
-
-do_install () {
-	install -D -m 0755 ${S}/ptest-runner ${D}${bindir}/ptest-runner
-}
diff --git a/import-layers/yocto-poky/meta/recipes-support/serf/serf_1.3.8.bb b/import-layers/yocto-poky/meta/recipes-support/serf/serf_1.3.8.bb
deleted file mode 100644
index c498d90..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/serf/serf_1.3.8.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-SUMMARY = "High-Performance Asynchronous HTTP Client Library"
-SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/s/${BPN}/${BPN}_${PV}.orig.tar.gz \
-           file://norpath.patch \
-           file://env.patch"
-
-SRC_URI[md5sum] = "713beaf05d7f3329de121e218e2fcb93"
-SRC_URI[sha256sum] = "77134cd5010664ca023585bce50978bd4005906ed280ff889f591f86df7c59e4"
-
-UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/s/serf/"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
-
-DEPENDS = "python-scons-native openssl apr apr-util util-linux expat"
-
-do_compile() {
-	${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} \
-		CC="${CC}" \
-		APR=`which apr-1-config` APU=`which apu-1-config` \
-		CFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" \
-		OPENSSL="${STAGING_EXECPREFIXDIR}"
-}
-
-do_install() {
-	${STAGING_BINDIR_NATIVE}/scons PREFIX=${D}${prefix} LIBDIR=${D}${libdir} install
-}
-
-BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/serf/serf_1.3.9.bb b/import-layers/yocto-poky/meta/recipes-support/serf/serf_1.3.9.bb
new file mode 100644
index 0000000..2be5a06
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/serf/serf_1.3.9.bb
@@ -0,0 +1,26 @@
+SUMMARY = "High-Performance Asynchronous HTTP Client Library"
+SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
+           file://norpath.patch \
+           file://env.patch"
+
+SRC_URI[md5sum] = "370a6340ff20366ab088012cd13f2b57"
+SRC_URI[sha256sum] = "549c2d21c577a8a9c0450facb5cca809f26591f048e466552240947bdf7a87cc"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
+
+DEPENDS = "python-scons-native openssl apr apr-util util-linux expat"
+
+do_compile() {
+	${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} \
+		CC="${CC}" \
+		APR=`which apr-1-config` APU=`which apu-1-config` \
+		CFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" \
+		OPENSSL="${STAGING_EXECPREFIXDIR}"
+}
+
+do_install() {
+	${STAGING_BINDIR_NATIVE}/scons PREFIX=${D}${prefix} LIBDIR=${D}${libdir} install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.6.bb b/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.6.bb
deleted file mode 100644
index 2cf5041..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.6.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require shared-mime-info.inc
-
-SRC_URI += "file://parallelmake.patch \
-	    file://install-data-hook.patch"
-
-SRC_URI[md5sum] = "10abc5c4e6b22223ff05c3bd70ff9e8f"
-SRC_URI[sha256sum] = "b2f8f85b6467933824180d0252bbcaee523f550a8fbc95cc4391bd43c03bc34c"
diff --git a/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.8.bb b/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.8.bb
new file mode 100644
index 0000000..849d999
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.8.bb
@@ -0,0 +1,7 @@
+require shared-mime-info.inc
+
+SRC_URI += "file://parallelmake.patch \
+	    file://install-data-hook.patch"
+
+SRC_URI[md5sum] = "f6dcadce764605552fc956563efa058c"
+SRC_URI[sha256sum] = "2af55ef1a0319805b74ab40d331a3962c905477d76c086f49e34dc96363589e9"
diff --git a/import-layers/yocto-poky/meta/recipes-support/sqlite/files/0001-revert-ad601c7962-that-brings-2-increase-of-build-ti.patch b/import-layers/yocto-poky/meta/recipes-support/sqlite/files/0001-revert-ad601c7962-that-brings-2-increase-of-build-ti.patch
deleted file mode 100644
index 26540b2..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/sqlite/files/0001-revert-ad601c7962-that-brings-2-increase-of-build-ti.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 4b286b441e8efa9a34eb0db8227748ebffd91c35 Mon Sep 17 00:00:00 2001
-From: Jianxun Zhang <jianxun.zhang@linux.intel.com>
-Date: Thu, 13 Oct 2016 09:24:21 -0700
-Subject: [PATCH] revert ad601c7962 that brings 2% increase of build time.
-
-The comment of the change in sqlite fossil project is:
-"For in-memory databases, it does not matter if pcache
-entries are marked "clean" or "writable"."
-
-Upstream Status: Inappropriate
-
-Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
----
- sqlite3.c | 12 +++---------
- 1 file changed, 3 insertions(+), 9 deletions(-)
-
-diff --git a/sqlite3.c b/sqlite3.c
-index ccddfe6..ecae550 100644
---- a/sqlite3.c
-+++ b/sqlite3.c
-@@ -13146,7 +13146,7 @@ struct PgHdr {
-   sqlite3_pcache_page *pPage;    /* Pcache object page handle */
-   void *pData;                   /* Page data */
-   void *pExtra;                  /* Extra content */
--  PgHdr *pDirty;                 /* Transient list of dirty sorted by pgno */
-+  PgHdr *pDirty;                 /* Transient list of dirty pages */
-   Pager *pPager;                 /* The pager this page is part of */
-   Pgno pgno;                     /* Page number for this page */
- #ifdef SQLITE_CHECK_PAGES
-@@ -43504,13 +43504,7 @@ bitvec_end:
- /* #include "sqliteInt.h" */
- 
- /*
--** A complete page cache is an instance of this structure.  Every
--** entry in the cache holds a single page of the database file.  The
--** btree layer only operates on the cached copy of the database pages.
--**
--** A page cache entry is "clean" if it exactly matches what is currently
--** on disk.  A page is "dirty" if it has been modified and needs to be
--** persisted to disk.
-+** A complete page cache is an instance of this structure.
- **
- ** pDirty, pDirtyTail, pSynced:
- **   All dirty pages are linked into the doubly linked list using
-@@ -48314,7 +48308,7 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){
-   pPager->pInJournal = 0;
-   pPager->nRec = 0;
-   if( rc==SQLITE_OK ){
--    if( pagerFlushOnCommit(pPager, bCommit) ){
-+    if( MEMDB || pagerFlushOnCommit(pPager, bCommit) ){
-       sqlite3PcacheCleanAll(pPager->pPCache);
-     }else{
-       sqlite3PcacheClearWritable(pPager->pPCache);
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3.inc b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3.inc
index 5bff33b..95ec89c 100644
--- a/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3.inc
+++ b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3.inc
@@ -5,7 +5,7 @@
 PE = "3"
 
 def sqlite_download_version(d):
-    pvsplit = d.getVar('PV', True).split('.')
+    pvsplit = d.getVar('PV').split('.')
     if len(pvsplit) < 4:
         pvsplit.append('0')
     return pvsplit[0] + ''.join([part.rjust(2,'0') for part in pvsplit[1:]])
@@ -17,6 +17,8 @@
 UPSTREAM_CHECK_URI = "http://www.sqlite.org/"
 UPSTREAM_CHECK_REGEX = "releaselog/(?P<pver>(\d+[\.\-_]*)+)\.html"
 
+CVE_PRODUCT = "sqlite"
+
 inherit autotools pkgconfig
 
 PACKAGECONFIG ?= ""
@@ -31,6 +33,8 @@
     --disable-static-shell \
 "
 
+CFLAGS_append = " -fPIC"
+
 # pread() is in POSIX.1-2001 so any reasonable system must surely support it
 BUILD_CFLAGS += "-DUSE_PREAD"
 TARGET_CFLAGS += "-DUSE_PREAD"
diff --git a/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3_3.14.1.bb b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3_3.14.1.bb
deleted file mode 100644
index 7c8fa40..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3_3.14.1.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-require sqlite3.inc
-
-LICENSE = "PD"
-LIC_FILES_CHKSUM = "file://sqlite3.h;endline=11;md5=65f0a57ca6928710b418c094b3570bb0"
-
-SRC_URI = "\
-  http://www.sqlite.org/2016/sqlite-autoconf-${SQLITE_PV}.tar.gz \
-  file://0001-revert-ad601c7962-that-brings-2-increase-of-build-ti.patch \
-  "
-
-SRC_URI[md5sum] = "3634a90a3f49541462bcaed3474b2684"
-SRC_URI[sha256sum] = "bc7182476900017becb81565ecea7775d46ab747a97281aa610f4f45881c47a6"
diff --git a/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3_3.17.0.bb b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3_3.17.0.bb
new file mode 100644
index 0000000..593cb32
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3_3.17.0.bb
@@ -0,0 +1,10 @@
+require sqlite3.inc
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://sqlite3.h;endline=11;md5=65f0a57ca6928710b418c094b3570bb0"
+
+SRC_URI = "\
+  http://www.sqlite.org/2017/sqlite-autoconf-${SQLITE_PV}.tar.gz \
+  "
+SRC_URI[md5sum] = "450a95a7bde697c9fe4de9ae2fffdcca"
+SRC_URI[sha256sum] = "a4e485ad3a16e054765baf6371826b5000beed07e626510896069c0bf013874c"
diff --git a/import-layers/yocto-poky/meta/recipes-support/taglib/taglib/CVE-2017-12678.patch b/import-layers/yocto-poky/meta/recipes-support/taglib/taglib/CVE-2017-12678.patch
new file mode 100644
index 0000000..4bd9f2b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/taglib/taglib/CVE-2017-12678.patch
@@ -0,0 +1,40 @@
+From eb9ded1206f18f2c319157337edea2533a40bea6 Mon Sep 17 00:00:00 2001
+From: "Stephen F. Booth" <me@sbooth.org>
+Date: Sun, 23 Jul 2017 10:11:09 -0400
+Subject: [PATCH] Don't assume TDRC is an instance of TextIdentificationFrame
+
+If TDRC is encrypted, FrameFactory::createFrame() returns UnknownFrame
+which causes problems in rebuildAggregateFrames() when it is assumed
+that TDRC is a TextIdentificationFrame
+
+Upstream-Status: Backport
+[https://github.com/taglib/taglib/pull/831/commits/eb9ded1206f18f2c319157337edea2533a40bea6]
+
+CVE: CVE-2017-12678
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ taglib/mpeg/id3v2/id3v2framefactory.cpp | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/taglib/mpeg/id3v2/id3v2framefactory.cpp b/taglib/mpeg/id3v2/id3v2framefactory.cpp
+index 759a9b7b..9347ab86 100644
+--- a/taglib/mpeg/id3v2/id3v2framefactory.cpp
++++ b/taglib/mpeg/id3v2/id3v2framefactory.cpp
+@@ -334,10 +334,11 @@ void FrameFactory::rebuildAggregateFrames(ID3v2::Tag *tag) const
+      tag->frameList("TDAT").size() == 1)
+   {
+     TextIdentificationFrame *tdrc =
+-      static_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front());
++      dynamic_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front());
+     UnknownFrame *tdat = static_cast<UnknownFrame *>(tag->frameList("TDAT").front());
+ 
+-    if(tdrc->fieldList().size() == 1 &&
++    if(tdrc &&
++       tdrc->fieldList().size() == 1 &&
+        tdrc->fieldList().front().size() == 4 &&
+        tdat->data().size() >= 5)
+     {
+-- 
+2.13.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/taglib/taglib_1.11.1.bb b/import-layers/yocto-poky/meta/recipes-support/taglib/taglib_1.11.1.bb
new file mode 100644
index 0000000..50439bc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/taglib/taglib_1.11.1.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Library for reading and editing the meta-data of popular audio formats"
+SECTION = "libs/multimedia"
+HOMEPAGE = "http://taglib.github.io/"
+LICENSE = "LGPLv2.1 | MPL-1"
+LIC_FILES_CHKSUM = "file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c \
+                    file://COPYING.MPL;md5=bfe1f75d606912a4111c90743d6c7325 \
+                    file://taglib/audioproperties.h;beginline=1;endline=24;md5=9df2c7399519b7310568a7c55042ecee"
+
+DEPENDS = "zlib"
+
+SRC_URI = "http://taglib.github.io/releases/${BP}.tar.gz \
+           file://CVE-2017-12678.patch \
+          "
+
+SRC_URI[md5sum] = "cee7be0ccfc892fa433d6c837df9522a"
+SRC_URI[sha256sum] = "b6d1a5a610aae6ff39d93de5efd0fdc787aa9e9dc1e7026fa4c961b26563526b"
+
+UPSTREAM_CHECK_URI = "http://github.com/taglib/taglib/releases/"
+
+BINCONFIG = "${bindir}/taglib-config"
+
+inherit cmake pkgconfig binconfig-disabled
+
+PACKAGES =+ "${PN}-c"
+FILES_${PN}-c = "${libdir}/libtag_c.so.*"
+
+EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
+                 -DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE \
+                 -DHAVE_BOOST_BYTESWAP=FALSE \
+                 -DCMAKE_CXX_STANDARD=11 \
+                 -DCMAKE_CXX_STANDARD_REQUIRED=OFF \
+                 -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
+"
+CXXFLAGS += "-std=c++11"
+
+do_configure_prepend () {
+	rm -f ${S}/admin/ltmain.sh
+	rm -f ${S}/admin/libtool.m4.in
+}
+
+# without -fPIC depending packages failed with many error like:
+# | <...>/ld: error: <...>/usr/lib/libtag.a(modfilebase.cpp.o): requires unsupported dynamic reloc R_ARM_THM_MOVW_ABS_NC; recompile with -fPIC
+CXXFLAGS += "-fPIC"
diff --git a/import-layers/yocto-poky/meta/recipes-support/taglib/taglib_1.9.1.bb b/import-layers/yocto-poky/meta/recipes-support/taglib/taglib_1.9.1.bb
deleted file mode 100644
index d125308..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/taglib/taglib_1.9.1.bb
+++ /dev/null
@@ -1,32 +0,0 @@
-SUMMARY = "Library for reading and editing the meta-data of popular audio formats"
-SECTION = "libs/multimedia"
-HOMEPAGE = "http://taglib.github.io/"
-LICENSE = "LGPLv2.1 | MPL-1"
-LIC_FILES_CHKSUM = "file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c \
-                    file://COPYING.MPL;md5=bfe1f75d606912a4111c90743d6c7325 \
-                    file://taglib/audioproperties.h;beginline=1;endline=24;md5=9df2c7399519b7310568a7c55042ecee"
-
-DEPENDS = "zlib"
-
-SRC_URI = "http://taglib.github.io/releases/${BP}.tar.gz"
-SRC_URI[md5sum] = "0d35df96822bbd564c5504cb3c2e4d86"
-SRC_URI[sha256sum] = "72d371cd1419a87ae200447a53bff2be219283071e80fd12337928cc967dc71a"
-
-UPSTREAM_CHECK_URI = "http://github.com/taglib/taglib/releases/"
-
-BINCONFIG = "${bindir}/taglib-config"
-
-inherit cmake pkgconfig binconfig-disabled
-
-PACKAGES =+ "${PN}-c"
-FILES_${PN}-c = "${libdir}/libtag_c.so.*"
-
-EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
-
-do_configure_prepend () {
-	rm -f ${S}/admin/ltmain.sh
-	rm -f ${S}/admin/libtool.m4.in
-	# Don't have a floating dependeny on boost
-	sed -i -e "s/atomic.hpp/atomic-not-exist.hpp/" ${S}/ConfigureChecks.cmake ${S}/taglib/toolkit/trefcounter.cpp
-}
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/vte/vte_0.44.2.bb b/import-layers/yocto-poky/meta/recipes-support/vte/vte_0.44.2.bb
deleted file mode 100644
index a0b671e..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/vte/vte_0.44.2.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-SUMMARY = "Virtual terminal emulator GTK+ widget library"
-BUGTRACKER = "https://bugzilla.gnome.org/buglist.cgi?product=vte"
-LICENSE = "LGPLv2.1+"
-DEPENDS = "glib-2.0 gtk+3 intltool-native"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
-
-inherit gnomebase gtk-doc distro_features_check upstream-version-is-even gobject-introspection
-
-# vapigen.m4 is required when vala is not present (but the one from vala should be used normally)
-SRC_URI += "file://0001-Don-t-enable-stack-protection-by-default.patch \
-            ${@bb.utils.contains('PACKAGECONFIG', 'vala', '', 'file://0001-Add-m4-vapigen.m4.patch', d) } \
-            "
-SRC_URI[archive.md5sum] = "eca8f8a9d9f9bb8e9d592d0acfeec015"
-SRC_URI[archive.sha256sum] = "a1ea594814bb136a3a9a6c7656b46240571f6a198825c1111007fe99194b0949"
-
-ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
-
-# Instead of "inherit vala" we do the relevant settings here so we can
-# set DEPENDS based on PACKAGECONFIG.
-
-# Our patched version of Vala looks in STAGING_DATADIR for .vapi files
-export STAGING_DATADIR
-# Upstream Vala >= 0.11 looks in XDG_DATA_DIRS for .vapi files
-export XDG_DATA_DIRS = "${STAGING_DATADIR}"
-
-# Package additional files
-FILES_${PN}-dev += "${datadir}/vala/vapi/*"
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[vala] = "--enable-vala,--disable-vala,vala-native vala"
-PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
-
-CFLAGS += "-D_GNU_SOURCE"
-
-EXTRA_OECONF = "--disable-test-application"
-
-# libtool adds "-nostdlib" when g++ is used. This breaks PIE builds.
-# Use libtool-cross (which has a hack to prevent that) instead.
-EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
-
-PACKAGES =+ "libvte"
-FILES_libvte = "${libdir}/*.so.* ${libdir}/girepository-1.0/*"
diff --git a/import-layers/yocto-poky/meta/recipes-support/vte/vte_0.46.1.bb b/import-layers/yocto-poky/meta/recipes-support/vte/vte_0.46.1.bb
new file mode 100644
index 0000000..0afe625
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/vte/vte_0.46.1.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Virtual terminal emulator GTK+ widget library"
+BUGTRACKER = "https://bugzilla.gnome.org/buglist.cgi?product=vte"
+LICENSE = "LGPLv2.1+"
+DEPENDS = "glib-2.0 gtk+3 libpcre2 intltool-native libxml2-native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+inherit gnomebase gtk-doc distro_features_check upstream-version-is-even gobject-introspection
+
+# vapigen.m4 is required when vala is not present (but the one from vala should be used normally)
+SRC_URI += "file://0001-Don-t-enable-stack-protection-by-default.patch \
+            ${@bb.utils.contains('PACKAGECONFIG', 'vala', '', 'file://0001-Add-m4-vapigen.m4.patch', d) } \
+            "
+SRC_URI[archive.md5sum] = "e8f4393b9f1ec2e2f3cdb3fd4f5a16de"
+SRC_URI[archive.sha256sum] = "8800cf8bc259704a12ad1853fb0eb43bfe3857af15242e6fb9f2c3fd95b3f5c6"
+
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+# Instead of "inherit vala" we do the relevant settings here so we can
+# set DEPENDS based on PACKAGECONFIG.
+
+# Our patched version of Vala looks in STAGING_DATADIR for .vapi files
+export STAGING_DATADIR
+# Upstream Vala >= 0.11 looks in XDG_DATA_DIRS for .vapi files
+export XDG_DATA_DIRS = "${STAGING_DATADIR}"
+
+# Package additional files
+FILES_${PN}-dev += "${datadir}/vala/vapi/*"
+
+PACKAGECONFIG ??= "gnutls"
+PACKAGECONFIG[vala] = "--enable-vala,--disable-vala,vala-native vala"
+PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
+
+CFLAGS += "-D_GNU_SOURCE"
+
+EXTRA_OECONF = "--disable-test-application"
+
+# libtool adds "-nostdlib" when g++ is used. This breaks PIE builds.
+# Use libtool-cross (which has a hack to prevent that) instead.
+EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
+
+PACKAGES =+ "libvte"
+FILES_libvte = "${libdir}/*.so.* ${libdir}/girepository-1.0/*"
diff --git a/import-layers/yocto-poky/scripts/buildhistory-collect-srcrevs b/import-layers/yocto-poky/scripts/buildhistory-collect-srcrevs
index 8a03580..d375b04 100755
--- a/import-layers/yocto-poky/scripts/buildhistory-collect-srcrevs
+++ b/import-layers/yocto-poky/scripts/buildhistory-collect-srcrevs
@@ -101,7 +101,7 @@
                 for name, value in srcrevs.items():
                     orig = orig_srcrevs.get(name, orig_srcrev)
                     if options.reportall or value != orig:
-                        all_srcrevs[curdir].append((pn, name, srcrev))
+                        all_srcrevs[curdir].append((pn, name, value))
 
     for curdir, srcrevs in sorted(all_srcrevs.items()):
         if srcrevs:
diff --git a/import-layers/yocto-poky/scripts/buildhistory-diff b/import-layers/yocto-poky/scripts/buildhistory-diff
index d8ca12d..dd9745e 100755
--- a/import-layers/yocto-poky/scripts/buildhistory-diff
+++ b/import-layers/yocto-poky/scripts/buildhistory-diff
@@ -33,6 +33,12 @@
     parser.add_option("-a", "--report-all",
             help = "Report all changes, not just the default significant ones",
             action="store_true", dest="report_all", default=False)
+    parser.add_option("-s", "--signatures",
+            help = "Report list of signatures differing instead of output",
+            action="store_true", dest="sigs", default=False)
+    parser.add_option("-S", "--signatures-with-diff",
+            help = "Report on actual signature differences instead of output (requires signature data to have been generated, either by running the actual tasks or using bitbake -S)",
+            action="store_true", dest="sigsdiff", default=False)
 
     options, args = parser.parse_args(sys.argv)
 
@@ -46,6 +52,11 @@
         sys.exit(1)
 
     if not os.path.exists(options.buildhistory_dir):
+        if options.buildhistory_dir == 'buildhistory/':
+            cwd = os.getcwd()
+            if os.path.basename(cwd) == 'buildhistory':
+                options.buildhistory_dir = cwd
+    if not os.path.exists(options.buildhistory_dir):
         sys.stderr.write('Buildhistory directory "%s" does not exist\n\n' % options.buildhistory_dir)
         parser.print_help()
         sys.exit(1)
@@ -81,7 +92,7 @@
 
     import gitdb
     try:
-        changes = oe.buildhistory_analysis.process_changes(options.buildhistory_dir, fromrev, torev, options.report_all, options.report_ver)
+        changes = oe.buildhistory_analysis.process_changes(options.buildhistory_dir, fromrev, torev, options.report_all, options.report_ver, options.sigs, options.sigsdiff)
     except gitdb.exc.BadObject as e:
         if len(args) == 1:
             sys.stderr.write("Unable to find previous build revision in buildhistory repository\n\n")
diff --git a/import-layers/yocto-poky/scripts/buildstats-diff b/import-layers/yocto-poky/scripts/buildstats-diff
index f918a6d..adeba44 100755
--- a/import-layers/yocto-poky/scripts/buildstats-diff
+++ b/import-layers/yocto-poky/scripts/buildstats-diff
@@ -22,7 +22,6 @@
 import re
 import sys
 from collections import namedtuple
-from datetime import datetime, timedelta, tzinfo
 from operator import attrgetter
 
 # Setup logging
@@ -35,38 +34,11 @@
     pass
 
 
-class TimeZone(tzinfo):
-    """Simple fixed-offset tzinfo"""
-    def __init__(self, seconds, name):
-        self._offset = timedelta(seconds=seconds)
-        self._name = name
-
-    def utcoffset(self, dt):
-        return self._offset
-
-    def tzname(self, dt):
-        return self._name
-
-    def dst(self, dt):
-        return None
-
-TIMEZONES = {'UTC': TimeZone(0, 'UTC'),
-             'EET': TimeZone(7200, 'EET'),
-             'EEST': TimeZone(10800, 'EEST')}
-
 taskdiff_fields = ('pkg', 'pkg_op', 'task', 'task_op', 'value1', 'value2',
                    'absdiff', 'reldiff')
 TaskDiff = namedtuple('TaskDiff', ' '.join(taskdiff_fields))
 
 
-def to_datetime_obj(obj):
-    """Helper for getting timestamps in datetime format"""
-    if isinstance(obj, datetime):
-        return obj
-    else:
-        return datetime.utcfromtimestamp(obj).replace(tzinfo=TIMEZONES['UTC'])
-
-
 class BSTask(dict):
     def __init__(self, *args, **kwargs):
         self['start_time'] = None
@@ -86,7 +58,7 @@
     @property
     def walltime(self):
         """Elapsed wall clock time"""
-        return self['elapsed_time'].total_seconds()
+        return self['elapsed_time']
 
     @property
     def read_bytes(self):
@@ -118,10 +90,10 @@
             key, val = line.split(':', 1)
             val = val.strip()
             if key == 'Started':
-                start_time = to_datetime_obj(float(val))
+                start_time = float(val)
                 bs_task['start_time'] = start_time
             elif key == 'Ended':
-                end_time = to_datetime_obj(float(val))
+                end_time = float(val)
             elif key.startswith('IO '):
                 split = key.split()
                 bs_task['iostat'][split[1]] = int(val)
@@ -329,7 +301,7 @@
         print("\nEPOCH CHANGED:")
         print("--------------")
         for pkg in sorted(echanged):
-            field1 = "{} -> {}".format(pkg, bs1[pkg]['epoch'], bs2[pkg]['epoch'])
+            field1 = "{} -> {}".format(bs1[pkg]['epoch'], bs2[pkg]['epoch'])
             field2 = "{} -> {}".format(bs1[pkg]['nevr'], bs2[pkg]['nevr'])
             print(fmt_str.format(pkg, field1, field2, maxlen=maxlen))
 
diff --git a/import-layers/yocto-poky/scripts/cleanup-workdir b/import-layers/yocto-poky/scripts/cleanup-workdir
deleted file mode 100755
index 98769f6..0000000
--- a/import-layers/yocto-poky/scripts/cleanup-workdir
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/usr/bin/env python3
-
-# Copyright (c) 2012 Wind River Systems, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-import os
-import sys
-import optparse
-import re
-import subprocess
-import shutil
-
-pkg_cur_dirs = {}
-obsolete_dirs = []
-parser = None
-
-def err_quit(msg):
-    print(msg)
-    parser.print_usage()
-    sys.exit(1)
-
-def parse_version(verstr):
-    elems = verstr.split(':')
-    epoch = elems[0]
-    if len(epoch) == 0:
-        return elems[1]
-    else:
-        return epoch + '_' + elems[1]
-
-def run_command(cmd):
-    pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
-    output = pipe.communicate()[0]
-    if pipe.returncode != 0:
-        print("Execute command '%s' failed." % cmd)
-        sys.exit(1)
-    return output.decode('utf-8')
-
-def get_cur_arch_dirs(workdir, arch_dirs):
-    pattern = workdir + '/(.*?)/'
-
-    cmd = "bitbake -e | grep ^SDK_SYS="
-    output = run_command(cmd)
-    sdk_sys = output.split('"')[1]
-
-    # select thest 5 packages to get the dirs of current arch
-    pkgs = ['hicolor-icon-theme', 'base-files', 'acl-native', 'binutils-crosssdk-' + sdk_sys, 'nativesdk-autoconf']
-
-    for pkg in pkgs:
-        cmd = "bitbake -e " + pkg + " | grep ^IMAGE_ROOTFS="
-        output = run_command(cmd)
-        output = output.split('"')[1]
-        m = re.match(pattern, output)
-        arch_dirs.append(m.group(1))
-
-def main():
-    global parser
-    parser = optparse.OptionParser(
-        usage = """%prog
-
-%prog removes the obsolete packages' build directories in WORKDIR.
-This script must be ran under BUILDDIR after source file \"oe-init-build-env\".
-
-Any file or directory under WORKDIR which is not created by Yocto
-will be deleted. Be CAUTIOUS.""")
-
-    options, args = parser.parse_args(sys.argv)
-
-    builddir = run_command('echo $BUILDDIR').strip()
-    if len(builddir) == 0:
-        err_quit("Please source file \"oe-init-build-env\" first.\n")
-
-    if os.getcwd() != builddir:
-        err_quit("Please run %s under: %s\n" % (os.path.basename(args[0]), builddir))
-
-    print('Updating bitbake caches...')
-    cmd = "bitbake -s"
-    output = run_command(cmd)
-
-    output = output.split('\n')
-    index = 0
-    while len(output[index]) > 0:
-        index += 1
-    alllines = output[index+1:]
-
-    for line in alllines:
-        # empty again means end of the versions output
-        if len(line) == 0:
-            break
-        line = line.strip()
-        line = re.sub('\s+', ' ', line)
-        elems = line.split(' ')
-        if len(elems) == 2:
-            version = parse_version(elems[1])
-        else:
-            version = parse_version(elems[2])
-        pkg_cur_dirs[elems[0]] = version
-
-    cmd = "bitbake -e"
-    output = run_command(cmd)
-
-    tmpdir = None
-    image_rootfs = None
-    output = output.split('\n')
-    for line in output:
-        if tmpdir and image_rootfs:
-            break
-
-        if not tmpdir:
-            m = re.match('TMPDIR="(.*)"', line)
-            if m:
-                tmpdir = m.group(1)
-
-        if not image_rootfs:
-            m = re.match('IMAGE_ROOTFS="(.*)"', line)
-            if m:
-                image_rootfs = m.group(1)
-
-    # won't fail just in case
-    if not tmpdir or not image_rootfs:
-        print("Can't get TMPDIR or IMAGE_ROOTFS.")
-        return 1
-
-    pattern = tmpdir + '/(.*?)/(.*?)/'
-    m = re.match(pattern, image_rootfs)
-    if not m:
-        print("Can't get WORKDIR.")
-        return 1
-
-    workdir = os.path.join(tmpdir, m.group(1))
-
-    # we only deal the dirs of current arch, total numbers of dirs are 6
-    cur_arch_dirs = [m.group(2)]
-    get_cur_arch_dirs(workdir, cur_arch_dirs)
-
-    for workroot, dirs, files in os.walk(workdir):
-        # For the files, they should NOT exist in WORKDIR. Remove them.
-        for f in files:
-            obsolete_dirs.append(os.path.join(workroot, f))
-
-        for d in dirs:
-            if d not in cur_arch_dirs:
-                continue
-
-            for pkgroot, pkgdirs, filenames in os.walk(os.path.join(workroot, d)):
-                for f in filenames:
-                    obsolete_dirs.append(os.path.join(pkgroot, f))
-
-                for pkgdir in sorted(pkgdirs):
-                    if pkgdir not in pkg_cur_dirs:
-                        obsolete_dirs.append(os.path.join(pkgroot, pkgdir))
-                    else:
-                        for verroot, verdirs, verfiles in os.walk(os.path.join(pkgroot, pkgdir)):
-                            for f in verfiles:
-                                obsolete_dirs.append(os.path.join(pkgroot, f))
-                            for v in sorted(verdirs):
-                               if v not in pkg_cur_dirs[pkgdir]:
-                                   obsolete_dirs.append(os.path.join(pkgroot, pkgdir, v))
-                            break
-
-                # just process the top dir of every package under tmp/work/*/,
-                # then jump out of the above os.walk()
-                break
-
-        # it is convenient to use os.walk() to get dirs and files at same time
-        # both of them have been dealed in the loop, so jump out
-        break
-
-    for d in obsolete_dirs:
-        print("Deleting %s" % d)
-        shutil.rmtree(d, True)
-
-    if len(obsolete_dirs):
-        print('\nTotal %d items.' % len(obsolete_dirs))
-    else:
-        print('\nNo obsolete directory found under %s.' % workdir)
-
-    return 0
-
-if __name__ == '__main__':
-    try:
-        ret = main()
-    except Exception:
-        ret = 2
-        import traceback
-        traceback.print_exc()
-    sys.exit(ret)
diff --git a/import-layers/yocto-poky/scripts/combo-layer b/import-layers/yocto-poky/scripts/combo-layer
index b90bfc8..d04d88b 100755
--- a/import-layers/yocto-poky/scripts/combo-layer
+++ b/import-layers/yocto-poky/scripts/combo-layer
@@ -294,6 +294,8 @@
                     # again. Uses the list of files created by tar (easier
                     # than walking the tree).
                     for file in files.split('\n'):
+                        if file.endswith(os.path.sep):
+                            continue
                         for pattern in exclude_patterns:
                             if fnmatch.fnmatch(file, pattern):
                                 os.unlink(os.path.join(*([extract_dir] + ['..'] * subdir_components + [file])))
@@ -329,7 +331,7 @@
                         # one. The commit should be in both repos with
                         # the same tree, but better check here.
                         tree = runcmd('git show -s --pretty=format:%%T %s' % rev).strip()
-                        with tempfile.NamedTemporaryFile() as editor:
+                        with tempfile.NamedTemporaryFile(mode='wt') as editor:
                             editor.write('''cat >$1 <<EOF
 tree %s
 author %s
@@ -353,7 +355,7 @@
                 # Optional: rewrite history to change commit messages or to move files.
                 if 'hook' in repo or dest_dir != ".":
                     filter_branch = ['git', 'filter-branch', '--force']
-                    with tempfile.NamedTemporaryFile() as hookwrapper:
+                    with tempfile.NamedTemporaryFile(mode='wt') as hookwrapper:
                         if 'hook' in repo:
                             # Create a shell script wrapper around the original hook that
                             # can be used by git filter-branch. Hook may or may not have
@@ -426,7 +428,7 @@
                 merge.append(name)
                 # Root all commits which have no parent in the common
                 # ancestor in the new repository.
-                for start in runcmd('git log --pretty=format:%%H --max-parents=0 %s' % name).split('\n'):
+                for start in runcmd('git log --pretty=format:%%H --max-parents=0 %s --' % name).split('\n'):
                     runcmd('git replace --graft %s %s' % (start, startrev))
             try:
                 runcmd(merge)
@@ -1137,7 +1139,7 @@
             if hook:
                 # Need to turn the verbatim commit message into something resembling a patch header
                 # for the hook.
-                with tempfile.NamedTemporaryFile(delete=False) as patch:
+                with tempfile.NamedTemporaryFile(mode='wt', delete=False) as patch:
                     patch.write('Subject: [PATCH] ')
                     patch.write(body)
                     patch.write('\n---\n')
diff --git a/import-layers/yocto-poky/scripts/contrib/bb-perf/buildstats-plot.sh b/import-layers/yocto-poky/scripts/contrib/bb-perf/buildstats-plot.sh
new file mode 100755
index 0000000..7e8ae04
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/bb-perf/buildstats-plot.sh
@@ -0,0 +1,157 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# DESCRIPTION
+#
+# Produces script data to be consumed by gnuplot. There are two possible plots
+# depending if either the -S parameter is present or not:
+#
+#     * without -S: Produces a histogram listing top N recipes/tasks versus
+#       stats. The first stat defined in the -s parameter is the one taken
+#       into account for ranking
+#     * -S: Produces a histogram listing tasks versus stats.  In this case,
+#       the value of each stat is the sum for that particular stat in all recipes found.
+#       Stats values  are in descending order defined by the first stat defined on -s
+#
+# EXAMPLES
+#
+# 1. Top recipes' tasks taking into account utime
+#
+#     $ buildstats-plot.sh -s utime | gnuplot -p
+#
+# 2. Tasks versus utime:stime
+#
+#     $ buildstats-plot.sh -s utime:stime -S | gnuplot -p
+#
+# 3. Tasks versus IO write_bytes:IO read_bytes
+#
+#     $ buildstats-plot.sh -s 'IO write_bytes:IO read_bytes' -S | gnuplot -p
+#
+# AUTHORS
+# Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
+#
+
+set -o nounset
+set -o errexit
+
+BS_DIR="tmp/buildstats"
+N=10
+STATS="utime"
+SUM=""
+OUTDATA_FILE="$PWD/buildstats-plot.out"
+
+function usage {
+    CMD=$(basename $0)
+    cat <<EOM
+Usage: $CMD [-b buildstats_dir] [-t do_task]
+  -b buildstats The path where the folder resides
+                (default: "$BS_DIR")
+  -n N          Top N recipes to display. Ignored if -S is present
+                (default: "$N")
+  -s stats      The stats to be matched. If more that one stat, units
+                should be the same because data is plot as histogram.
+                (see buildstats.sh -h for all options) or any other defined
+                (build)stat separated by colons, i.e. stime:utime
+                (default: "$STATS")
+  -S            Sum values for a particular stat for found recipes
+  -o            Output data file.
+                (default: "$OUTDATA_FILE")
+  -h            Display this help message
+EOM
+}
+
+# Parse and validate arguments
+while getopts "b:n:s:o:Sh" OPT; do
+	case $OPT in
+	b)
+		BS_DIR="$OPTARG"
+		;;
+	n)
+		N="$OPTARG"
+		;;
+	s)
+	        STATS="$OPTARG"
+	        ;;
+	S)
+	        SUM="y"
+	        ;;
+	o)
+	        OUTDATA_FILE="$OPTARG"
+	        ;;
+	h)
+		usage
+		exit 0
+		;;
+	*)
+		usage
+		exit 1
+		;;
+	esac
+done
+
+# Get number of stats
+IFS=':'; statsarray=(${STATS}); unset IFS
+nstats=${#statsarray[@]}
+
+# Get script folder, use to run buildstats.sh
+CD=$(dirname $0)
+
+# Parse buildstats recipes to produce a single table
+OUTBUILDSTATS="$PWD/buildstats.log"
+$CD/buildstats.sh -H -s "$STATS" -H > $OUTBUILDSTATS
+
+# Get headers
+HEADERS=$(cat $OUTBUILDSTATS | sed -n -e '1s/ /-/g' -e '1s/:/ /gp')
+
+echo -e "set boxwidth 0.9 relative"
+echo -e "set style data histograms"
+echo -e "set style fill solid 1.0 border lt -1"
+echo -e "set xtics rotate by 45 right"
+
+# Get output data
+if [ -z "$SUM" ]; then
+    cat $OUTBUILDSTATS | sed -e '1d' | sort -k3 -n -r | head -$N > $OUTDATA_FILE
+    # include task at recipe column
+    sed -i -e "1i\
+${HEADERS}" $OUTDATA_FILE
+    echo -e "set title \"Top task/recipes\""
+    echo -e "plot for [COL=3:`expr 3 + ${nstats} - 1`] '${OUTDATA_FILE}' using COL:xtic(stringcolumn(1).' '.stringcolumn(2)) title columnheader(COL)"
+else
+
+    # Construct datatamash sum argument (sum 3 sum 4 ...)
+    declare -a sumargs
+    j=0
+    for i in `seq $nstats`; do
+	sumargs[j]=sum; j=$(( $j + 1 ))
+	sumargs[j]=`expr 3 + $i - 1`;  j=$(( $j + 1 ))
+    done
+
+    # Do the processing with datamash
+    cat $OUTBUILDSTATS | sed -e '1d' | datamash -t ' ' -g1 ${sumargs[*]} | sort -k2 -n -r > $OUTDATA_FILE
+
+    # Include headers into resulted file, so we can include gnuplot xtics
+    HEADERS=$(echo $HEADERS | sed -e 's/recipe//1')
+    sed -i -e "1i\
+${HEADERS}" $OUTDATA_FILE
+
+    # Plot
+    echo -e "set title \"Sum stats values per task for all recipes\""
+    echo -e "plot for [COL=2:`expr 2 + ${nstats} - 1`] '${OUTDATA_FILE}' using COL:xtic(1) title columnheader(COL)"
+fi
+
diff --git a/import-layers/yocto-poky/scripts/contrib/bb-perf/buildstats.sh b/import-layers/yocto-poky/scripts/contrib/bb-perf/buildstats.sh
index 96158a9..8d7e248 100755
--- a/import-layers/yocto-poky/scripts/contrib/bb-perf/buildstats.sh
+++ b/import-layers/yocto-poky/scripts/contrib/bb-perf/buildstats.sh
@@ -18,24 +18,40 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 # DESCRIPTION
-# Given a 'buildstats' path (created by bitbake when setting
-# USER_CLASSES ?= "buildstats" on local.conf) and task names, outputs
-# '<task> <recipe> <elapsed time>' for all recipes. Elapsed times are in
-# seconds, and task should be given without the 'do_' prefix.
+# Given 'buildstats' data (generate by bitbake when setting
+# USER_CLASSES ?= "buildstats" on local.conf), task names and a stats values
+# (these are the ones preset on the buildstats files), outputs
+# '<task> <recipe> <value_1> <value_2> ... <value_n>'. The units are the ones
+# defined at buildstats, which in turn takes data from /proc/[pid] files
 #
 # Some useful pipelines
 #
-# 1. Tasks with largest elapsed times
-# $ buildstats.sh -b <buildstats> | sort -k3 -n -r | head
+# 1. Tasks with largest stime (Amount of time that this process has been scheduled
+#    in kernel mode) values
+# $ buildstats.sh -b <buildstats> -s stime | sort -k3 -n -r | head
 #
-# 2. Min, max, sum per task (in needs GNU datamash)
-# $ buildstats.sh -b <buildstats> | datamash -t' ' -g1 min 3 max 3 sum 3 | sort -k4 -n -r
+# 2. Min, max, sum utime (Amount  of  time  that  this process has been scheduled
+#    in user mode) per task (in needs GNU datamash)
+# $ buildstats.sh -b <buildstats> -s utime | datamash -t' ' -g1 min 3 max 3 sum 3 | sort -k4 -n -r
 #
 # AUTHORS
 # Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
 #
+
+# Stats, by type
+TIME="utime:stime:cutime:cstime"
+IO="IO wchar:IO write_bytes:IO syscr:IO read_bytes:IO rchar:IO syscw:IO cancelled_write_bytes"
+RUSAGE="rusage ru_utime:rusage ru_stime:rusage ru_maxrss:rusage ru_minflt:rusage ru_majflt:\
+rusage ru_inblock:rusage ru_oublock:rusage ru_nvcsw:rusage ru_nivcsw"
+
+CHILD_RUSAGE="Child rusage ru_utime:Child rusage ru_stime:Child rusage ru_maxrss:Child rusage ru_minflt:\
+Child rusage ru_majflt:Child rusage ru_inblock:Child rusage ru_oublock:Child rusage ru_nvcsw:\
+Child rusage ru_nivcsw"
+
 BS_DIR="tmp/buildstats"
 TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack"
+STATS="$TIME"
+HEADER="" # No header by default
 
 function usage {
 CMD=$(basename $0)
@@ -45,12 +61,20 @@
                 (default: "$BS_DIR")
   -t tasks      The tasks to be computed
                 (default: "$TASKS")
+  -s stats      The stats to be matched. Options: TIME, IO, RUSAGE, CHILD_RUSAGE
+                or any other defined buildstat separated by colons, i.e. stime:utime
+                (default: "$STATS")
+                Default stat sets:
+                    TIME=$TIME
+                    IO=$IO
+                    RUSAGE=$RUSAGE
+                    CHILD_RUSAGE=$CHILD_RUSAGE
   -h            Display this help message
 EOM
 }
 
 # Parse and validate arguments
-while getopts "b:t:h" OPT; do
+while getopts "b:t:s:Hh" OPT; do
 	case $OPT in
 	b)
 		BS_DIR="$OPTARG"
@@ -58,6 +82,12 @@
 	t)
 		TASKS="$OPTARG"
 		;;
+	s)
+		STATS="$OPTARG"
+		;;
+	H)
+	        HEADER="y"
+	        ;;
 	h)
 		usage
 		exit 0
@@ -76,15 +106,50 @@
 	exit 1
 fi
 
-RECIPE_FIELD=1
-TIME_FIELD=4
+stats=""
+IFS=":"
+for stat in ${STATS}; do
+	case $stat in
+	    TIME)
+		stats="${stats}:${TIME}"
+		;;
+	    IO)
+		stats="${stats}:${IO}"
+		;;
+	    RUSAGE)
+		stats="${stats}:${RUSAGE}"
+		;;
+	    CHILD_RUSAGE)
+		stats="${stats}:${CHILD_RUSAGE}"
+		;;
+	    *)
+		stats="${STATS}"
+	esac
+done
 
-tasks=(${TASKS//:/ })
-for task in "${tasks[@]}"; do
+# remove possible colon at the beginning
+stats="$(echo "$stats" | sed -e 's/^://1')"
+
+# Provide a header if required by the user
+[ -n "$HEADER" ] && { echo "task:recipe:$stats"; }
+
+for task in ${TASKS}; do
     task="do_${task}"
-    for file in $(find ${BS_DIR} -type f -name ${task}); do
-        recipe=$(sed -n -e "/$task/p" ${file} | cut -d ':' -f${RECIPE_FIELD})
-        time=$(sed -n -e "/$task/p" ${file} | cut -d ':' -f${TIME_FIELD} | cut -d ' ' -f2)
-        echo "${task} ${recipe} ${time}"
+    for file in $(find ${BS_DIR} -type f -name ${task} | awk 'BEGIN{ ORS=""; OFS=":" } { print $0,"" }'); do
+        recipe="$(basename $(dirname $file))"
+	times=""
+	for stat in ${stats}; do
+	    [ -z "$stat" ] && { echo "empty stats"; }
+	    time=$(sed -n -e "s/^\($stat\): \\(.*\\)/\\2/p" $file)
+	    # in case the stat is not present, set the value as NA
+	    [ -z "$time" ] && { time="NA"; }
+	    # Append it to times
+	    if [ -z "$times" ]; then
+		times="${time}"
+	    else
+		times="${times} ${time}"
+	    fi
+	done
+        echo "${task} ${recipe} ${times}"
     done
 done
diff --git a/import-layers/yocto-poky/scripts/contrib/build-perf-test-wrapper.sh b/import-layers/yocto-poky/scripts/contrib/build-perf-test-wrapper.sh
index e03ea97..3da3253 100755
--- a/import-layers/yocto-poky/scripts/contrib/build-perf-test-wrapper.sh
+++ b/import-layers/yocto-poky/scripts/contrib/build-perf-test-wrapper.sh
@@ -19,6 +19,7 @@
 # oe-build-perf-test and archives the results.
 
 script=`basename $0`
+script_dir=$(realpath $(dirname $0))
 archive_dir=~/perf-results/archives
 
 usage () {
@@ -29,29 +30,44 @@
   -h                show this help and exit.
   -a ARCHIVE_DIR    archive results tarball here, give an empty string to
                     disable tarball archiving (default: $archive_dir)
-  -c COMMITISH      test (checkout) this commit
+  -c COMMITISH      test (checkout) this commit, <branch>:<commit> can be
+                    specified to test specific commit of certain branch
   -C GIT_REPO       commit results into Git
+  -E EMAIL_ADDR     send email report
+  -P GIT_REMOTE     push results to a remote Git repository
   -w WORK_DIR       work dir for this script
                     (default: GIT_TOP_DIR/build-perf-test)
+  -x                create xml report (instead of json)
 EOF
 }
 
+get_os_release_var () {
+    ( source /etc/os-release; eval echo '$'$1 )
+}
+
 
 # Parse command line arguments
 commitish=""
-while getopts "ha:c:C:w:" opt; do
+oe_build_perf_test_extra_opts=()
+oe_git_archive_extra_opts=()
+while getopts "ha:c:C:E:P:w:x" opt; do
     case $opt in
         h)  usage
             exit 0
             ;;
-        a)  archive_dir=`realpath "$OPTARG"`
+        a)  archive_dir=`realpath -s "$OPTARG"`
             ;;
         c)  commitish=$OPTARG
             ;;
-        C)  results_repo=`realpath "$OPTARG"`
-            commit_results=("--commit-results" "$results_repo")
+        C)  results_repo=`realpath -s "$OPTARG"`
             ;;
-        w)  base_dir=`realpath "$OPTARG"`
+        E)  email_to="$OPTARG"
+            ;;
+        P)  oe_git_archive_extra_opts+=("--push" "$OPTARG")
+            ;;
+        w)  base_dir=`realpath -s "$OPTARG"`
+            ;;
+        x)  oe_build_perf_test_extra_opts+=("--xml")
             ;;
         *)  usage
             exit 1
@@ -67,6 +83,17 @@
     exit 1
 fi
 
+# Open a file descriptor for flock and acquire lock
+LOCK_FILE="/tmp/oe-build-perf-test-wrapper.lock"
+if ! exec 3> "$LOCK_FILE"; then
+    echo "ERROR: Unable to open lock file"
+    exit 1
+fi
+if ! flock -n 3; then
+    echo "ERROR: Another instance of this script is running"
+    exit 1
+fi
+
 echo "Running on `uname -n`"
 if ! git_topdir=$(git rev-parse --show-toplevel); then
         echo "The current working dir doesn't seem to be a git clone. Please cd there before running `basename $0`"
@@ -76,15 +103,33 @@
 cd "$git_topdir"
 
 if [ -n "$commitish" ]; then
-    # Checkout correct revision
-    echo "Checking out $commitish"
+    echo "Running git fetch"
     git fetch &> /dev/null
     git checkout HEAD^0 &> /dev/null
-    git branch -D $commitish &> /dev/null
-    if ! git checkout -f $commitish &> /dev/null; then
-        echo "Git checkout failed"
+
+    # Handle <branch>:<commit> format
+    if echo "$commitish" | grep -q ":"; then
+        commit=`echo "$commitish" | cut -d":" -f2`
+        branch=`echo "$commitish" | cut -d":" -f1`
+    else
+        commit="$commitish"
+        branch="$commitish"
+    fi
+
+    echo "Checking out $commitish"
+    git branch -D $branch &> /dev/null
+    if ! git checkout -f $branch &> /dev/null; then
+        echo "ERROR: Git checkout failed"
         exit 1
     fi
+
+    # Check that the specified branch really contains the commit
+    commit_hash=`git rev-parse --revs-only $commit --`
+    if [ -z "$commit_hash" -o "`git merge-base $branch $commit`" != "$commit_hash" ]; then
+        echo "ERROR: branch $branch does not contain commit $commit"
+        exit 1
+    fi
+    git reset --hard $commit > /dev/null
 fi
 
 # Setup build environment
@@ -119,10 +164,8 @@
 # Run actual test script
 oe-build-perf-test --out-dir "$results_dir" \
                    --globalres-file "$globalres_log" \
-                   --lock-file "$base_dir/oe-build-perf.lock" \
-                   "${commit_results[@]}" \
-                   --commit-results-branch "{tester_host}/{git_branch}/$machine" \
-                   --commit-results-tag "{tester_host}/{git_branch}/$machine/{git_commit_count}-g{git_commit}/{tag_num}"
+                   "${oe_build_perf_test_extra_opts[@]}" \
+                   --lock-file "$base_dir/oe-build-perf.lock"
 
 case $? in
     1)  echo "ERROR: oe-build-perf-test script failed!"
@@ -132,6 +175,29 @@
         ;;
 esac
 
+# Commit results to git
+if [ -n "$results_repo" ]; then
+    echo -e "\nArchiving results in $results_repo"
+    oe-git-archive \
+        --git-dir "$results_repo" \
+        --branch-name "{hostname}/{branch}/{machine}" \
+        --tag-name "{hostname}/{branch}/{machine}/{commit_count}-g{commit}/{tag_number}" \
+        --exclude "buildstats.json" \
+        --notes "buildstats/{branch_name}" "$results_dir/buildstats.json" \
+        "${oe_git_archive_extra_opts[@]}" \
+        "$results_dir"
+
+    # Send email report
+    if [ -n "$email_to" ]; then
+        echo -e "\nEmailing test report"
+        os_name=`get_os_release_var PRETTY_NAME`
+        oe-build-perf-report -r "$results_repo" > report.txt
+        oe-build-perf-report -r "$results_repo" --html > report.html
+        "$script_dir"/oe-build-perf-report-email.py --to "$email_to" --subject "Build Perf Test Report for $os_name" --text report.txt --html report.html "${OE_BUILD_PERF_REPORT_EMAIL_EXTRA_ARGS[@]}"
+    fi
+fi
+
+
 echo -ne "\n\n-----------------\n"
 echo "Global results file:"
 echo -ne "\n"
diff --git a/import-layers/yocto-poky/scripts/contrib/list-packageconfig-flags.py b/import-layers/yocto-poky/scripts/contrib/list-packageconfig-flags.py
index 389fb97..7ce7186 100755
--- a/import-layers/yocto-poky/scripts/contrib/list-packageconfig-flags.py
+++ b/import-layers/yocto-poky/scripts/contrib/list-packageconfig-flags.py
@@ -76,7 +76,7 @@
     for fn in data_dict:
         pkgconfigflags = data_dict[fn].getVarFlags("PACKAGECONFIG")
         pkgconfigflags.pop('doc', None)
-        pkgname = data_dict[fn].getVar("P", True)
+        pkgname = data_dict[fn].getVar("P")
         pkg_dict[pkgname] = sorted(pkgconfigflags.keys())
 
     return pkg_dict
@@ -124,9 +124,9 @@
     ''' Display all pkgs and PACKAGECONFIG information '''
     print(str("").ljust(50, '='))
     for fn in data_dict:
-        print('%s' % data_dict[fn].getVar("P", True))
+        print('%s' % data_dict[fn].getVar("P"))
         print(fn)
-        packageconfig = data_dict[fn].getVar("PACKAGECONFIG", True) or ''
+        packageconfig = data_dict[fn].getVar("PACKAGECONFIG") or ''
         if packageconfig.strip() == '':
             packageconfig = 'None'
         print('PACKAGECONFIG %s' % packageconfig)
diff --git a/import-layers/yocto-poky/scripts/contrib/mkefidisk.sh b/import-layers/yocto-poky/scripts/contrib/mkefidisk.sh
index d8db3c0..ac4ec9c 100755
--- a/import-layers/yocto-poky/scripts/contrib/mkefidisk.sh
+++ b/import-layers/yocto-poky/scripts/contrib/mkefidisk.sh
@@ -20,6 +20,11 @@
 
 LANG=C
 
+echo
+echo "WARNING: This script is deprecated and will be removed soon."
+echo "Please consider using wic EFI images instead."
+echo
+
 # Set to 1 to enable additional output
 DEBUG=0
 OUT="/dev/null"
@@ -379,7 +384,7 @@
 cp $HDDIMG_MNT/vmlinuz $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy vmlinuz"
 # Copy the efi loader and configs (booti*.efi and grub.cfg if it exists)
 cp -r $HDDIMG_MNT/EFI $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy EFI dir"
-# Silently ignore a missing gummiboot loader dir (we might just be a GRUB image)
+# Silently ignore a missing systemd-boot loader dir (we might just be a GRUB image)
 cp -r $HDDIMG_MNT/loader $BOOTFS_MNT >$OUT 2>&1
 
 # Update the boot loaders configurations for an installed image
@@ -405,25 +410,25 @@
 	sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GRUB_CFG
 fi
 
-# Look for a gummiboot installation
-GUMMI_ENTRIES="$BOOTFS_MNT/loader/entries"
-GUMMI_CFG="$GUMMI_ENTRIES/boot.conf"
-if [ -d "$GUMMI_ENTRIES" ]; then
-	info "Configuring Gummiboot"
+# Look for a systemd-boot installation
+SYSTEMD_BOOT_ENTRIES="$BOOTFS_MNT/loader/entries"
+SYSTEMD_BOOT_CFG="$SYSTEMD_BOOT_ENTRIES/boot.conf"
+if [ -d "$SYSTEMD_BOOT_ENTRIES" ]; then
+	info "Configuring SystemD-boot"
 	# remove the install target if it exists
-	rm $GUMMI_ENTRIES/install.conf >$OUT 2>&1
+	rm $SYSTEMD_BOOT_ENTRIES/install.conf >$OUT 2>&1
 
-	if [ ! -e "$GUMMI_CFG" ]; then
-		echo "ERROR: $GUMMI_CFG not found"
+	if [ ! -e "$SYSTEMD_BOOT_CFG" ]; then
+		echo "ERROR: $SYSTEMD_BOOT_CFG not found"
 	fi
 
-	sed -i "/initrd /d" $GUMMI_CFG
-	sed -i "s@ root=[^ ]*@ @" $GUMMI_CFG
-	sed -i "s@options *LABEL=boot @options LABEL=Boot root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GUMMI_CFG
+	sed -i "/initrd /d" $SYSTEMD_BOOT_CFG
+	sed -i "s@ root=[^ ]*@ @" $SYSTEMD_BOOT_CFG
+	sed -i "s@options *LABEL=boot @options LABEL=Boot root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $SYSTEMD_BOOT_CFG
 fi
 
 # Ensure we have at least one EFI bootloader configured
-if [ ! -e $GRUB_CFG ] && [ ! -e $GUMMI_CFG ]; then
+if [ ! -e $GRUB_CFG ] && [ ! -e $SYSTEMD_BOOT_CFG ]; then
 	die "No EFI bootloader configuration found"
 fi
 
@@ -439,7 +444,7 @@
 fi
 
 # Add startup.nsh script for automated boot
-echo "fs0:\EFI\BOOT\bootx64.efi" > $BOOTFS_MNT/startup.nsh
+printf "fs0:\%s\BOOT\%s\n" "EFI" "bootx64.efi" > $BOOTFS_MNT/startup.nsh
 
 
 # Call cleanup to unmount devices and images and remove the TMPDIR
diff --git a/import-layers/yocto-poky/scripts/contrib/oe-build-perf-report-email.py b/import-layers/yocto-poky/scripts/contrib/oe-build-perf-report-email.py
new file mode 100755
index 0000000..261ca51
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/oe-build-perf-report-email.py
@@ -0,0 +1,269 @@
+#!/usr/bin/python3
+#
+# Send build performance test report emails
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+import argparse
+import base64
+import logging
+import os
+import pwd
+import re
+import shutil
+import smtplib
+import socket
+import subprocess
+import sys
+import tempfile
+from email.mime.multipart import MIMEMultipart
+from email.mime.text import MIMEText
+
+
+# Setup logging
+logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
+log = logging.getLogger('oe-build-perf-report')
+
+
+# Find js scaper script
+SCRAPE_JS = os.path.join(os.path.dirname(__file__), '..', 'lib', 'build_perf',
+                         'scrape-html-report.js')
+if not os.path.isfile(SCRAPE_JS):
+    log.error("Unableto find oe-build-perf-report-scrape.js")
+    sys.exit(1)
+
+
+class ReportError(Exception):
+    """Local errors"""
+    pass
+
+
+def check_utils():
+    """Check that all needed utils are installed in the system"""
+    missing = []
+    for cmd in ('phantomjs', 'optipng'):
+        if not shutil.which(cmd):
+            missing.append(cmd)
+    if missing:
+        log.error("The following tools are missing: %s", ' '.join(missing))
+        sys.exit(1)
+
+
+def parse_args(argv):
+    """Parse command line arguments"""
+    description = """Email build perf test report"""
+    parser = argparse.ArgumentParser(
+        formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+        description=description)
+
+    parser.add_argument('--debug', '-d', action='store_true',
+                        help="Verbose logging")
+    parser.add_argument('--quiet', '-q', action='store_true',
+                        help="Only print errors")
+    parser.add_argument('--to', action='append',
+                        help="Recipients of the email")
+    parser.add_argument('--subject', default="Yocto build perf test report",
+                        help="Email subject")
+    parser.add_argument('--outdir', '-o',
+                        help="Store files in OUTDIR. Can be used to preserve "
+                             "the email parts")
+    parser.add_argument('--text',
+                        help="Plain text message")
+    parser.add_argument('--html',
+                        help="HTML peport generated by oe-build-perf-report")
+    parser.add_argument('--phantomjs-args', action='append',
+                        help="Extra command line arguments passed to PhantomJS")
+
+    args = parser.parse_args(argv)
+
+    if not args.html and not args.text:
+        parser.error("Please specify --html and/or --text")
+
+    return args
+
+
+def decode_png(infile, outfile):
+    """Parse/decode/optimize png data from a html element"""
+    with open(infile) as f:
+        raw_data = f.read()
+
+    # Grab raw base64 data
+    b64_data = re.sub('^.*href="data:image/png;base64,', '', raw_data, 1)
+    b64_data = re.sub('">.+$', '', b64_data, 1)
+
+    # Replace file with proper decoded png
+    with open(outfile, 'wb') as f:
+        f.write(base64.b64decode(b64_data))
+
+    subprocess.check_output(['optipng', outfile], stderr=subprocess.STDOUT)
+
+
+def encode_png(pngfile):
+    """Encode png into a <img> html element"""
+    with open(pngfile, 'rb') as f:
+        data = f.read()
+
+    b64_data = base64.b64encode(data)
+    return '<img src="data:image/png;base64,' + b64_data.decode('utf-8') + '">\n'
+
+
+def mangle_html_report(infile, outfile, pngs):
+    """Mangle html file into a email compatible format"""
+    paste = True
+    png_dir = os.path.dirname(outfile)
+    with open(infile) as f_in:
+        with open(outfile, 'w') as f_out:
+            for line in f_in.readlines():
+                stripped = line.strip()
+                # Strip out scripts
+                if stripped == '<!--START-OF-SCRIPTS-->':
+                    paste = False
+                elif stripped == '<!--END-OF-SCRIPTS-->':
+                    paste = True
+                elif paste:
+                    if re.match('^.+href="data:image/png;base64', stripped):
+                        # Strip out encoded pngs (as they're huge in size)
+                        continue
+                    elif 'www.gstatic.com' in stripped:
+                        # HACK: drop references to external static pages
+                        continue
+
+                    # Replace charts with <img> elements
+                    match = re.match('<div id="(?P<id>\w+)"', stripped)
+                    if match and match.group('id') in pngs:
+                        #f_out.write('<img src="{}">\n'.format(match.group('id') + '.png'))
+                        png_file = os.path.join(png_dir, match.group('id') + '.png')
+                        f_out.write(encode_png(png_file))
+                    else:
+                        f_out.write(line)
+
+
+def scrape_html_report(report, outdir, phantomjs_extra_args=None):
+    """Scrape html report into a format sendable by email"""
+    tmpdir = tempfile.mkdtemp(dir='.')
+    log.debug("Using tmpdir %s for phantomjs output", tmpdir)
+
+    if not os.path.isdir(outdir):
+        os.mkdir(outdir)
+    if os.path.splitext(report)[1] not in ('.html', '.htm'):
+        raise ReportError("Invalid file extension for report, needs to be "
+                          "'.html' or '.htm'")
+
+    try:
+        log.info("Scraping HTML report with PhangomJS")
+        extra_args = phantomjs_extra_args if phantomjs_extra_args else []
+        subprocess.check_output(['phantomjs', '--debug=true'] + extra_args +
+                                [SCRAPE_JS, report, tmpdir],
+                                stderr=subprocess.STDOUT)
+
+        pngs = []
+        attachments = []
+        for fname in os.listdir(tmpdir):
+            base, ext = os.path.splitext(fname)
+            if ext == '.png':
+                log.debug("Decoding %s", fname)
+                decode_png(os.path.join(tmpdir, fname),
+                           os.path.join(outdir, fname))
+                pngs.append(base)
+                attachments.append(fname)
+            elif ext in ('.html', '.htm'):
+                report_file = fname
+            else:
+                log.warning("Unknown file extension: '%s'", ext)
+                #shutil.move(os.path.join(tmpdir, fname), outdir)
+
+        log.debug("Mangling html report file %s", report_file)
+        mangle_html_report(os.path.join(tmpdir, report_file),
+                           os.path.join(outdir, report_file), pngs)
+        return report_file, attachments
+    finally:
+        shutil.rmtree(tmpdir)
+
+def send_email(text_fn, html_fn, subject, recipients):
+    """Send email"""
+    # Generate email message
+    text_msg = html_msg = None
+    if text_fn:
+        with open(text_fn) as f:
+            text_msg = MIMEText("Yocto build performance test report.\n" +
+                                f.read(), 'plain')
+    if html_fn:
+        with open(html_fn) as f:
+            html_msg = MIMEText(f.read(), 'html')
+
+    if text_msg and html_msg:
+        msg = MIMEMultipart('alternative')
+        msg.attach(text_msg)
+        msg.attach(html_msg)
+    elif text_msg:
+        msg = text_msg
+    elif html_msg:
+        msg = html_msg
+    else:
+        raise ReportError("Neither plain text nor html body specified")
+
+    pw_data = pwd.getpwuid(os.getuid())
+    full_name = pw_data.pw_gecos.split(',')[0]
+    email = os.environ.get('EMAIL',
+                           '{}@{}'.format(pw_data.pw_name, socket.getfqdn()))
+    msg['From'] = "{} <{}>".format(full_name, email)
+    msg['To'] = ', '.join(recipients)
+    msg['Subject'] = subject
+
+    # Send email
+    with smtplib.SMTP('localhost') as smtp:
+        smtp.send_message(msg)
+
+
+def main(argv=None):
+    """Script entry point"""
+    args = parse_args(argv)
+    if args.quiet:
+        log.setLevel(logging.ERROR)
+    if args.debug:
+        log.setLevel(logging.DEBUG)
+
+    check_utils()
+
+    if args.outdir:
+        outdir = args.outdir
+        if not os.path.exists(outdir):
+            os.mkdir(outdir)
+    else:
+        outdir = tempfile.mkdtemp(dir='.')
+
+    try:
+        log.debug("Storing email parts in %s", outdir)
+        html_report = None
+        if args.html:
+            scrape_html_report(args.html, outdir, args.phantomjs_args)
+            html_report = os.path.join(outdir, os.path.basename(args.html))
+
+        if args.to:
+            log.info("Sending email to %s", ', '.join(args.to))
+            send_email(args.text, html_report, args.subject, args.to)
+    except subprocess.CalledProcessError as err:
+        log.error("%s, with output:\n%s", str(err), err.output.decode())
+        return 1
+    except ReportError as err:
+        log.error(err)
+        return 1
+    finally:
+        if not args.outdir:
+            log.debug("Wiping %s", outdir)
+            shutil.rmtree(outdir)
+
+    return 0
+
+
+if __name__ == "__main__":
+    sys.exit(main())
diff --git a/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py b/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py
index f2ecf8d..8c3655d 100755
--- a/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py
+++ b/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py
@@ -9,10 +9,14 @@
 #  * Updated to no longer generate special -dbg package, instead use the
 #    single system -dbg
 #  * Update version with ".1" to indicate this change
+#
+# February 26, 2017 -- Ming Liu <peter.x.liu@external.atlascopco.com>
+#  * Updated to support generating manifest for native python
 
 import os
 import sys
 import time
+import argparse
 
 VERSION = "2.7.2"
 
@@ -21,16 +25,16 @@
 
 class MakefileMaker:
 
-    def __init__( self, outfile ):
+    def __init__( self, outfile, isNative ):
         """initialize"""
         self.packages = {}
         self.targetPrefix = "${libdir}/python%s/" % VERSION[:3]
+        self.isNative = isNative
         self.output = outfile
         self.out( """
 # WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
-# Generator: '%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
-# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
-""" % ( sys.argv[0], __version__ ) )
+# Generator: '%s%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+""" % ( sys.argv[0], ' --native' if isNative else '', __version__ ) )
 
     #
     # helper functions
@@ -66,6 +70,20 @@
         global VERSION
 
         #
+        # generate rprovides line for native
+        #
+
+        if self.isNative:
+            rprovideLine = 'RPROVIDES+="'
+            for name in sorted(self.packages):
+                rprovideLine += "%s-native " % name.replace( '${PN}', 'python' )
+            rprovideLine += '"'
+
+            self.out( rprovideLine )
+            self.out( "" )
+            return
+
+        #
         # generate provides line
         #
 
@@ -147,17 +165,21 @@
         self.doEpilog()
 
 if __name__ == "__main__":
+    parser = argparse.ArgumentParser( description='generate python manifest' )
+    parser.add_argument( '-n', '--native', help='generate manifest for native python', action='store_true' )
+    parser.add_argument( 'outfile', metavar='OUTPUT_FILE', nargs='?', default='', help='Output file (defaults to stdout)' )
+    args = parser.parse_args()
 
-    if len( sys.argv ) > 1:
+    if args.outfile:
         try:
-            os.unlink(sys.argv[1])
+            os.unlink( args.outfile )
         except Exception:
             sys.exc_clear()
-        outfile = open( sys.argv[1], "w" )
+        outfile = open( args.outfile, "w" )
     else:
         outfile = sys.stdout
 
-    m = MakefileMaker( outfile )
+    m = MakefileMaker( outfile, args.native )
 
     # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
     # Parameters: revision, name, description, dependencies, filenames
@@ -171,7 +193,7 @@
     "UserDict.* UserList.* UserString.* " +
     "lib-dynload/binascii.so lib-dynload/_struct.so lib-dynload/time.so " +
     "lib-dynload/xreadlines.so types.* platform.* ${bindir}/python* "  +
-    "_weakrefset.* sysconfig.* _sysconfigdata.* config/Makefile " +
+    "_weakrefset.* sysconfig.* _sysconfigdata.* " +
     "${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h " +
     "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py ")
 
@@ -185,7 +207,8 @@
     "${base_libdir}/*.a " +
     "${base_libdir}/*.o " +
     "${datadir}/aclocal " +
-    "${datadir}/pkgconfig " )
+    "${datadir}/pkgconfig " +
+    "config/Makefile ")
 
     m.addPackage( "${PN}-2to3", "Python automated Python 2 to 3 code translator", "${PN}-core",
     "${bindir}/2to3 lib2to3" ) # package
@@ -360,7 +383,7 @@
     m.addPackage( "${PN}-terminal", "Python terminal controlling support", "${PN}-core ${PN}-io",
     "pty.* tty.*" )
 
-    m.addPackage( "${PN}-tests", "Python tests", "${PN}-core",
+    m.addPackage( "${PN}-tests", "Python tests", "${PN}-core ${PN}-modules",
     "test" ) # package
 
     m.addPackage( "${PN}-threading", "Python threading & synchronization support", "${PN}-core ${PN}-lang",
diff --git a/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-3.5.py b/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-3.5.py
index 71a71f7..075860c 100755
--- a/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-3.5.py
+++ b/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-3.5.py
@@ -13,9 +13,13 @@
 # 2014 Khem Raj <raj.khem@gmail.com>
 # Added python3 support
 #
+# February 26, 2017 -- Ming Liu <peter.x.liu@external.atlascopco.com>
+# * Updated to support generating manifest for native python3
+
 import os
 import sys
 import time
+import argparse
 
 VERSION = "3.5.0"
 
@@ -24,16 +28,16 @@
 
 class MakefileMaker:
 
-    def __init__( self, outfile ):
+    def __init__( self, outfile, isNative ):
         """initialize"""
         self.packages = {}
         self.targetPrefix = "${libdir}/python%s/" % VERSION[:3]
+        self.isNative = isNative
         self.output = outfile
         self.out( """
 # WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
-# Generator: '%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
-# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
-""" % ( sys.argv[0], __version__ ) )
+# Generator: '%s%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+""" % ( sys.argv[0], ' --native' if isNative else '', __version__ ) )
 
     #
     # helper functions
@@ -59,16 +63,40 @@
         for filename in filenames:
             if filename[0] != "$":
                 fullFilenames.append( "%s%s" % ( self.targetPrefix, filename ) )
+                fullFilenames.append( "%s%s" % ( self.targetPrefix,
+                                                 self.pycachePath( filename ) ) )
             else:
                 fullFilenames.append( filename )
         self.packages[name] = description, dependencies, fullFilenames
 
+    def pycachePath( self, filename ):
+        dirname = os.path.dirname( filename )
+        basename = os.path.basename( filename )
+        if '.' in basename:
+            return os.path.join( dirname, '__pycache__', basename )
+        else:
+            return os.path.join( dirname, basename, '__pycache__' )
+
     def doBody( self ):
         """generate body of Makefile"""
 
         global VERSION
 
         #
+        # generate rprovides line for native
+        #
+
+        if self.isNative:
+            rprovideLine = 'RPROVIDES+="'
+            for name in sorted(self.packages):
+                rprovideLine += "%s-native " % name.replace( '${PN}', 'python3' )
+            rprovideLine += '"'
+
+            self.out( rprovideLine )
+            self.out( "" )
+            return
+
+        #
         # generate provides line
         #
 
@@ -150,17 +178,21 @@
         self.doEpilog()
 
 if __name__ == "__main__":
+    parser = argparse.ArgumentParser( description='generate python3 manifest' )
+    parser.add_argument( '-n', '--native', help='generate manifest for native python3', action='store_true' )
+    parser.add_argument( 'outfile', metavar='OUTPUT_FILE', nargs='?', default='', help='Output file (defaults to stdout)' )
+    args = parser.parse_args()
 
-    if len( sys.argv ) > 1:
+    if args.outfile:
         try:
-            os.unlink(sys.argv[1])
+            os.unlink( args.outfile )
         except Exception:
             sys.exc_clear()
-        outfile = open( sys.argv[1], "w" )
+        outfile = open( args.outfile, "w" )
     else:
         outfile = sys.stdout
 
-    m = MakefileMaker( outfile )
+    m = MakefileMaker( outfile, args.native )
 
     # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
     # Parameters: revision, name, description, dependencies, filenames
@@ -174,7 +206,7 @@
     "UserDict.* UserList.* UserString.* " +
     "lib-dynload/binascii.*.so lib-dynload/_struct.*.so lib-dynload/time.*.so " +
     "lib-dynload/xreadlines.*.so types.* platform.* ${bindir}/python* "  + 
-    "_weakrefset.* sysconfig.* _sysconfigdata.* config/Makefile " +
+    "_weakrefset.* sysconfig.* _sysconfigdata.* " +
     "${includedir}/python${PYTHON_BINABI}/pyconfig*.h " +
     "${libdir}/python${PYTHON_MAJMIN}/collections " +
     "${libdir}/python${PYTHON_MAJMIN}/_collections_abc.* " +
@@ -191,7 +223,8 @@
     "${base_libdir}/*.a " +
     "${base_libdir}/*.o " +
     "${datadir}/aclocal " +
-    "${datadir}/pkgconfig " )
+    "${datadir}/pkgconfig " +
+    "config/Makefile ")
 
     m.addPackage( "${PN}-2to3", "Python automated Python 2 to 3 code translator", "${PN}-core",
     "lib2to3" ) # package
@@ -266,7 +299,7 @@
     "lib-dynload/fcntl.*.so" )
 
     m.addPackage( "${PN}-html", "Python HTML processing support", "${PN}-core",
-    "formatter.* htmlentitydefs.* htmllib.* markupbase.* sgmllib.* HTMLParser.* " )
+    "formatter.* htmlentitydefs.* html htmllib.* markupbase.* sgmllib.* HTMLParser.* " )
 
     m.addPackage( "${PN}-importlib", "Python import implementation library", "${PN}-core ${PN}-lang",
     "importlib imp.*" )
@@ -279,7 +312,7 @@
 
     m.addPackage( "${PN}-io", "Python low-level I/O", "${PN}-core ${PN}-math",
     "lib-dynload/_socket.*.so lib-dynload/_io.*.so lib-dynload/_ssl.*.so lib-dynload/select.*.so lib-dynload/termios.*.so lib-dynload/cStringIO.*.so " +
-    "pipes.* socket.* ssl.* tempfile.* StringIO.* io.* _pyio.*" )
+    "ipaddress.* pipes.* socket.* ssl.* tempfile.* StringIO.* io.* _pyio.*" )
 
     m.addPackage( "${PN}-json", "Python JSON support", "${PN}-core ${PN}-math ${PN}-re",
     "json lib-dynload/_json.*.so" ) # package
@@ -308,18 +341,18 @@
     m.addPackage( "${PN}-multiprocessing", "Python multiprocessing support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap",
     "lib-dynload/_multiprocessing.*.so multiprocessing" ) # package
 
-    m.addPackage( "${PN}-netclient", "Python Internet Protocol clients", "${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime",
+    m.addPackage( "${PN}-netclient", "Python Internet Protocol clients", "${PN}-argparse ${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime ${PN}-html",
     "*Cookie*.* " +
-    "base64.* cookielib.* ftplib.* gopherlib.* hmac.* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib  uuid.* rfc822.* mimetools.*" )
+    "base64.* cookielib.* ftplib.* gopherlib.* hmac.* http* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib  uuid.* rfc822.* mimetools.*" )
 
     m.addPackage( "${PN}-netserver", "Python Internet Protocol servers", "${PN}-core ${PN}-netclient ${PN}-shell ${PN}-threading",
-    "cgi.* *HTTPServer.* SocketServer.*" )
+    "cgi.* socketserver.* *HTTPServer.* SocketServer.*" )
 
     m.addPackage( "${PN}-numbers", "Python number APIs", "${PN}-core ${PN}-lang ${PN}-re",
     "decimal.* fractions.* numbers.*" )
 
     m.addPackage( "${PN}-pickle", "Python serialisation/persistence support", "${PN}-core ${PN}-codecs ${PN}-io ${PN}-re",
-    "pickle.* shelve.* lib-dynload/cPickle.*.so pickletools.*" )
+    "_compat_pickle.* pickle.* shelve.* lib-dynload/cPickle.*.so pickletools.*" )
 
     m.addPackage( "${PN}-pkgutil", "Python package extension utility support", "${PN}-core",
     "pkgutil.*")
@@ -378,6 +411,9 @@
     m.addPackage( "${PN}-tkinter", "Python Tcl/Tk bindings", "${PN}-core",
     "lib-dynload/_tkinter.*.so lib-tk tkinter" ) # package
 
+    m.addPackage( "${PN}-typing", "Python typing support", "${PN}-core",
+    "typing.*" )
+
     m.addPackage( "${PN}-unittest", "Python unit testing framework", "${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell",
     "unittest/" )
 
@@ -387,7 +423,7 @@
     m.addPackage( "${PN}-xml", "Python basic XML support", "${PN}-core ${PN}-re",
     "lib-dynload/_elementtree.*.so lib-dynload/pyexpat.*.so xml xmllib.*" ) # package
 
-    m.addPackage( "${PN}-xmlrpc", "Python XML-RPC support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang",
+    m.addPackage( "${PN}-xmlrpc", "Python XML-RPC support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang ${PN}-pydoc",
     "xmlrpclib.* SimpleXMLRPCServer.* DocXMLRPCServer.* xmlrpc" )
 
     m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime",
diff --git a/import-layers/yocto-poky/scripts/contrib/verify-homepage.py b/import-layers/yocto-poky/scripts/contrib/verify-homepage.py
index d39dd1d..76f1749 100755
--- a/import-layers/yocto-poky/scripts/contrib/verify-homepage.py
+++ b/import-layers/yocto-poky/scripts/contrib/verify-homepage.py
@@ -44,7 +44,7 @@
             if realfn in checked:
                 continue
             data = bbhandler.parse_recipe_file(realfn)
-            homepage = data.getVar("HOMEPAGE", True)
+            homepage = data.getVar("HOMEPAGE")
             if homepage:
                 try:
                     urllib.request.urlopen(homepage, timeout=5)
diff --git a/import-layers/yocto-poky/scripts/contrib/yocto-bsp-kernel-update.sh b/import-layers/yocto-poky/scripts/contrib/yocto-bsp-kernel-update.sh
new file mode 100755
index 0000000..b3aa705
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/yocto-bsp-kernel-update.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# Copyright (c) 2017, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software;  you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY;  without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+# the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program;  if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Description: creates a new set of kernel templates based on version
+#
+
+set -o nounset
+set -o errexit
+
+if [ $# -ne 4 ]; then
+    cat << EOF
+usage: $0 from_mayor from_minor to_mayor to_minor
+EOF
+    exit 1
+else
+    fma=$1 # from mayor
+    fmi=$2 # from minor
+    tma=$3 # to mayor
+    tmi=$4 # to minor
+fi
+
+poky=$(readlink -e $(dirname $(dirname $(dirname $0))))
+arch=$poky/scripts/lib/bsp/substrate/target/arch
+
+
+# copy/rename templates
+for from in $(ls -1 $arch/*/recipes-kernel/linux/linux-yocto*_$fma\.$fmi.bbappend)
+do
+    to=$(echo $from | sed s/$fma\.$fmi/$tma\.$tmi/)
+    cp $from $to
+done
+
+# replace versions string inside new templates
+for bbappend in $(ls -1 $arch/*/recipes-kernel/linux/linux-yocto*_$tma\.$tmi.bbappend)
+do
+    sed -i 1s/$fma\.$fmi/$tma\.$tmi/ $bbappend
+    sed -i \$s/$fma\.$fmi/$tma\.$tmi/ $bbappend
+done
+
+# update the noinstall files
+for noinstall in $(ls -1 $arch/*/recipes-kernel/linux/kernel-list.noinstall)
+do
+    sed -i s/$fma\.$fmi/$tma\.$tmi/g $noinstall;
+done
diff --git a/import-layers/yocto-poky/scripts/create-pull-request b/import-layers/yocto-poky/scripts/create-pull-request
index a88f35a..e82858b 100755
--- a/import-layers/yocto-poky/scripts/create-pull-request
+++ b/import-layers/yocto-poky/scripts/create-pull-request
@@ -168,7 +168,7 @@
 		WEB_URL="http://git.pokylinux.org/cgit.cgi/$REMOTE_REPO/log/?h=$BRANCH"
 		;;
 	*git.openembedded.org*)
-		WEB_URL="http://cgit.openembedded.org/cgit.cgi/$REMOTE_REPO/log/?h=$BRANCH"
+		WEB_URL="http://cgit.openembedded.org/$REMOTE_REPO/log/?h=$BRANCH"
 		;;
 	*github.com*)
 		WEB_URL="https://github.com/$REMOTE_REPO/tree/$BRANCH"
diff --git a/import-layers/yocto-poky/scripts/crosstap b/import-layers/yocto-poky/scripts/crosstap
index 58317cf..39739bb 100755
--- a/import-layers/yocto-poky/scripts/crosstap
+++ b/import-layers/yocto-poky/scripts/crosstap
@@ -104,13 +104,19 @@
   | cut -d '=' -f2 | cut -d '"' -f2)
 STAGING_BINDIR_TOOLPREFIX=$(echo "$BITBAKE_VARS" | grep ^TARGET_PREFIX \
   | cut -d '=' -f2 | cut -d '"' -f2)
-SYSTEMTAP_HOST_INSTALLDIR=$(echo "$BITBAKE_VARS" | grep ^STAGING_DIR_NATIVE \
-  | cut -d '=' -f2 | cut -d '"' -f2)
 TARGET_ARCH=$(echo "$BITBAKE_VARS" | grep ^TRANSLATED_TARGET_ARCH \
   | cut -d '=' -f2 | cut -d '"' -f2)
 TARGET_KERNEL_BUILDDIR=$(echo "$BITBAKE_VARS" | grep ^B= \
   | cut -d '=' -f2 | cut -d '"' -f2)
 
+# Build and populate the recipe-sysroot-native with systemtap-native
+pushd $PWD
+cd $BUILDDIR
+BITBAKE_VARS=`bitbake -e systemtap-native`
+popd
+SYSTEMTAP_HOST_INSTALLDIR=$(echo "$BITBAKE_VARS" | grep ^STAGING_DIR_NATIVE \
+  | cut -d '=' -f2 | cut -d '"' -f2)
+
 systemtap_target_arch "$TARGET_ARCH"
 
 if [ ! -d $TARGET_KERNEL_BUILDDIR ] ||
@@ -125,6 +131,7 @@
     echo -e "\nError: Native (host) systemtap not found."
     echo -e "Did you accidentally build a local non-sdk image? (or forget to"
     echo -e "add 'tools-profile' to EXTRA_IMAGE_FEATURES in your local.conf)?"
+    echo -e "You can also: bitbake -c addto_recipe_sysroot systemtap-native"
     setup_usage
     exit 1
 fi
diff --git a/import-layers/yocto-poky/scripts/devtool b/import-layers/yocto-poky/scripts/devtool
index 0c32c50..c9ad9dd 100755
--- a/import-layers/yocto-poky/scripts/devtool
+++ b/import-layers/yocto-poky/scripts/devtool
@@ -215,6 +215,9 @@
     global config
     global context
 
+    if sys.getfilesystemencoding() != "utf-8":
+        sys.exit("Please use a locale setting which supports utf-8.\nPython can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.")
+
     context = Context(fixed_setup=False)
 
     # Default basepath
@@ -288,13 +291,17 @@
     scriptutils.logger_setup_color(logger, global_args.color)
 
     if global_args.bbpath is None:
-        tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
         try:
-            global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True)
-        finally:
-            tinfoil.shutdown()
+            tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+            try:
+                global_args.bbpath = tinfoil.config_data.getVar('BBPATH')
+            finally:
+                tinfoil.shutdown()
+        except bb.BBHandledException:
+            return 2
 
-    for path in [scripts_path] + global_args.bbpath.split(':'):
+    # Search BBPATH first to allow layers to override plugins in scripts_path
+    for path in global_args.bbpath.split(':') + [scripts_path]:
         pluginpath = os.path.join(path, 'lib', 'devtool')
         scriptutils.load_plugins(logger, plugins, pluginpath)
 
diff --git a/import-layers/yocto-poky/scripts/gen-lockedsig-cache b/import-layers/yocto-poky/scripts/gen-lockedsig-cache
index 49de74e..6765891 100755
--- a/import-layers/yocto-poky/scripts/gen-lockedsig-cache
+++ b/import-layers/yocto-poky/scripts/gen-lockedsig-cache
@@ -62,7 +62,11 @@
         os.remove(dst)
     if (os.stat(src).st_dev == os.stat(destdir).st_dev):
         print('linking')
-        os.link(src, dst)
+        try:
+            os.link(src, dst)
+        except OSError as e:
+            print('hard linking failed, copying')
+            shutil.copyfile(src, dst)
     else:
         print('copying')
         shutil.copyfile(src, dst)
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/kernel.py b/import-layers/yocto-poky/scripts/lib/bsp/kernel.py
index 32cab3b..a3ee325 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/kernel.py
+++ b/import-layers/yocto-poky/scripts/lib/bsp/kernel.py
@@ -331,7 +331,6 @@
     patch list [${machine}-user-patches.scc].
     """
     f = open_user_file(scripts_path, machine, machine+"-user-patches.scc", "w")
-    f.write("mark patching start\n")
     for item in patch_items:
         f.write("patch " + item + "\n")
     f.close()
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/machine.conf
index 588367a..624750c 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/machine.conf
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/machine.conf
@@ -8,10 +8,8 @@
 {{ if xserver == "y": }}
 PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
 XSERVER ?= "xserver-xorg \
-           xf86-input-evdev \
-           xf86-input-mouse \
            xf86-video-fbdev \
-           xf86-input-keyboard"
+           "
 
 MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree"
 
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
index 0120ed0..20f2059 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
 {{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.8) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.10) kernel? (y/n)" default:"y"}}
 
 {{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.8"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.10"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
index f4fc219..d15a178 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
new file mode 100644
index 0000000..5cc82e8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
@@ -0,0 +1,35 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-patches.scc \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
index 4ec3e48..070bd87 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
index 51cb012..c391322 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend
index 1d78865..4e7d7cb 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#LINUX_VERSION = "4.1"
\ No newline at end of file
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.10.bbappend
new file mode 100644
index 0000000..eaf4367
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.10.bbappend
@@ -0,0 +1,34 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.4.bbappend
index 1725bf4..56e8ad3 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.8.bbappend
index 15d6431..59752a9 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.8.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg
index 3b168b7..fe5b882 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg
@@ -1,5 +1,8 @@
 # yocto-bsp-filename {{=machine}}.cfg
 CONFIG_X86_32=y
+# Must explicitly disable 64BIT
+# CONFIG_64BIT is not set
+
 CONFIG_MATOM=y
 CONFIG_PRINTK=y
 
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
index 0120ed0..20f2059 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
 {{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.8) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.10) kernel? (y/n)" default:"y"}}
 
 {{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.8"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.10"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
index f4fc219..d15a178 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
new file mode 100644
index 0000000..5cc82e8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
@@ -0,0 +1,35 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-patches.scc \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
index 4ec3e48..070bd87 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
index 51cb012..c391322 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend
index 8d7e24e..5ed144b 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.10.bbappend
new file mode 100644
index 0000000..0205920
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.10.bbappend
@@ -0,0 +1,34 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.4.bbappend
index 16a24f0..ab644bd 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.8.bbappend
index 9a97de9..a535aea 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.8.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb
index 5fbf594..e534d36 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb
@@ -14,7 +14,7 @@
 S = "${WORKDIR}"
 
 do_compile() {
-	     ${CC} helloworld.c -o helloworld
+	     ${CC} ${LDFLAGS} helloworld.c -o helloworld
 }
 
 do_install() {
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf
index b319d62..37da253 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf
@@ -27,7 +27,6 @@
 {{ if xserver == "y": }}
 PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
 XSERVER ?= "xserver-xorg \
-            xf86-input-evdev \
             xf86-video-fbdev"
 
 SERIAL_CONSOLE = "115200 ttyS0"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
index 0120ed0..20f2059 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
 {{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.8) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.10) kernel? (y/n)" default:"y"}}
 
 {{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.8"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.10"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
index f4fc219..d15a178 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
new file mode 100644
index 0000000..5cc82e8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
@@ -0,0 +1,35 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-patches.scc \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
index 4ec3e48..070bd87 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
index 51cb012..c391322 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend
index f4efb75..4e7d7cb 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.10.bbappend
new file mode 100644
index 0000000..eaf4367
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.10.bbappend
@@ -0,0 +1,34 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.4.bbappend
index 1725bf4..56e8ad3 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.8.bbappend
index 15d6431..59752a9 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.8.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf
index 3afc5e0..a8eea2c 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf
@@ -27,7 +27,6 @@
 {{ if xserver == "y": }}
 PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
 XSERVER ?= "xserver-xorg \
-            xf86-input-evdev \
             xf86-video-fbdev"
 
 SERIAL_CONSOLE = "115200 ttyS0"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall
index 0120ed0..20f2059 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
 {{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.8) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.10) kernel? (y/n)" default:"y"}}
 
 {{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.8"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.10"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
index f4fc219..d15a178 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
new file mode 100644
index 0000000..5cc82e8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
@@ -0,0 +1,35 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-patches.scc \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
index 4ec3e48..070bd87 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
index 51cb012..c391322 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend
index 7d0f7df..802e5f4 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.10.bbappend
new file mode 100644
index 0000000..512b597
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.10.bbappend
@@ -0,0 +1,34 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/edgerouter" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/edgerouter" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.4.bbappend
index 4d89f5c..dbb0fd5 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.8.bbappend
index 17d1ea6..c2eb40d 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.8.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf
index 583c5e4..352b972 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf
@@ -71,7 +71,6 @@
 {{ if xserver == "y": }}
 PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
 XSERVER ?= "xserver-xorg \
-           xf86-input-evdev \
            xf86-video-fbdev"
 
 PREFERRED_VERSION_u-boot ?= "v2016.01%"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
index 0120ed0..20f2059 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
 {{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.8) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.10) kernel? (y/n)" default:"y"}}
 
 {{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.8"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.10"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
index f4fc219..d15a178 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
new file mode 100644
index 0000000..5cc82e8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
@@ -0,0 +1,35 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-patches.scc \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
index 4ec3e48..070bd87 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
index 51cb012..c391322 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend
index f4efb75..4e7d7cb 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.10.bbappend
new file mode 100644
index 0000000..eaf4367
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.10.bbappend
@@ -0,0 +1,34 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.4.bbappend
index 1725bf4..56e8ad3 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.8.bbappend
index 15d6431..59752a9 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.8.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf
index 67e1cbd..9188858 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf
@@ -54,9 +54,6 @@
 SERIAL_CONSOLE = "115200 ttyS0"
 XSERVER = "xserver-xorg \
            ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast', '', d)} \
-           xf86-input-vmmouse \
-           xf86-input-keyboard \
-           xf86-input-evdev \
            xf86-video-vmware"
 
 {{ if qemuarch == "arm": }}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
index 0120ed0..20f2059 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
 {{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.8) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.10) kernel? (y/n)" default:"y"}}
 
 {{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.8"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.10"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
index fe22d3e..81392ce 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -57,6 +57,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
new file mode 100644
index 0000000..29ad17b
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
@@ -0,0 +1,64 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/common-pc" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-patches.scc \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
index 828afe5..a73b1aa 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -57,6 +57,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
index df65fd0..7d40671 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
@@ -57,6 +57,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend
index 6895788..a9fd9ec 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -56,6 +56,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.10.bbappend
new file mode 100644
index 0000000..5873da4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.10.bbappend
@@ -0,0 +1,63 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base your new BSP branch on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose an existing machine branch to use for this BSP:" default:"standard/arm-versatile-926ejs" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard"  prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard"  prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta64" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.4.bbappend
index 3549de5..cdee773 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -56,6 +56,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.8.bbappend
index 4176e5a..24c2880 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.8.bbappend
@@ -56,6 +56,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
index 0120ed0..20f2059 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
 {{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.8) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.10) kernel? (y/n)" default:"y"}}
 
 {{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.8"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.10"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
index f4fc219..d15a178 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
new file mode 100644
index 0000000..5cc82e8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.10.bbappend
@@ -0,0 +1,35 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-patches.scc \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
index 4ec3e48..070bd87 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
index 51cb012..c391322 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.8.bbappend
@@ -28,6 +28,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
index f4efb75..4e7d7cb 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.1"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.10.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.10.bbappend
new file mode 100644
index 0000000..eaf4367
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.10.bbappend
@@ -0,0 +1,34 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.10": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}}  = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+            file://{{=machine}}-user-config.cfg \
+            file://{{=machine}}-user-features.scc \
+           "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.10"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend
index 1725bf4..56e8ad3 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.4"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.8.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.8.bbappend
index 15d6431..59752a9 100644
--- a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.8.bbappend
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.8.bbappend
@@ -27,6 +27,8 @@
 
 # replace these SRCREVs with the real commit ids once you've had
 # the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
 #LINUX_VERSION = "4.8"
+#Remove the following line once AUTOREV is locked to a certain SRCREV
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/import-layers/yocto-poky/scripts/lib/build_perf/__init__.py b/import-layers/yocto-poky/scripts/lib/build_perf/__init__.py
new file mode 100644
index 0000000..1f8b729
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/build_perf/__init__.py
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+"""Build performance test library functions"""
+
+def print_table(rows, row_fmt=None):
+    """Print data table"""
+    if not rows:
+        return
+    if not row_fmt:
+        row_fmt = ['{:{wid}} '] * len(rows[0])
+
+    # Go through the data to get maximum cell widths
+    num_cols = len(row_fmt)
+    col_widths = [0] * num_cols
+    for row in rows:
+        for i, val in enumerate(row):
+            col_widths[i] = max(col_widths[i], len(str(val)))
+
+    for row in rows:
+        print(*[row_fmt[i].format(col, wid=col_widths[i]) for i, col in enumerate(row)])
+
diff --git a/import-layers/yocto-poky/scripts/lib/build_perf/html.py b/import-layers/yocto-poky/scripts/lib/build_perf/html.py
new file mode 100644
index 0000000..578bb16
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/build_perf/html.py
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+"""Helper module for HTML reporting"""
+from jinja2 import Environment, PackageLoader
+
+
+env = Environment(loader=PackageLoader('build_perf', 'html'))
+
+template = env.get_template('report.html')
diff --git a/import-layers/yocto-poky/scripts/lib/build_perf/html/measurement_chart.html b/import-layers/yocto-poky/scripts/lib/build_perf/html/measurement_chart.html
new file mode 100644
index 0000000..65f1a22
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/build_perf/html/measurement_chart.html
@@ -0,0 +1,50 @@
+<script type="text/javascript">
+  chartsDrawing += 1;
+  google.charts.setOnLoadCallback(drawChart_{{ chart_elem_id }});
+  function drawChart_{{ chart_elem_id }}() {
+    var data = new google.visualization.DataTable();
+
+    // Chart options
+    var options = {
+      theme : 'material',
+      legend: 'none',
+      hAxis: { format: '', title: 'Commit number',
+               minValue: {{ chart_opts.haxis.min }},
+               maxValue: {{ chart_opts.haxis.max }} },
+      {% if measurement.type == 'time' %}
+      vAxis: { format: 'h:mm:ss' },
+      {% else %}
+      vAxis: { format: '' },
+      {% endif %}
+      pointSize: 5,
+      chartArea: { left: 80, right: 15 },
+    };
+
+    // Define data columns
+    data.addColumn('number', 'Commit');
+    data.addColumn('{{ measurement.value_type.gv_data_type }}',
+                   '{{ measurement.value_type.quantity }}');
+    // Add data rows
+    data.addRows([
+      {% for sample in measurement.samples %}
+        [{{ sample.commit_num }}, {{ sample.mean.gv_value() }}],
+      {% endfor %}
+    ]);
+
+    // Finally, draw the chart
+    chart_div = document.getElementById('{{ chart_elem_id }}');
+    var chart = new google.visualization.LineChart(chart_div);
+    google.visualization.events.addListener(chart, 'ready', function () {
+      //chart_div = document.getElementById('{{ chart_elem_id }}');
+      //chart_div.innerHTML = '<img src="' + chart.getImageURI() + '">';
+      png_div = document.getElementById('{{ chart_elem_id }}_png');
+      png_div.outerHTML = '<a id="{{ chart_elem_id }}_png" href="' + chart.getImageURI() + '">PNG</a>';
+      console.log("CHART READY: {{ chart_elem_id }}");
+      chartsDrawing -= 1;
+      if (chartsDrawing == 0)
+        console.log("ALL CHARTS READY");
+    });
+    chart.draw(data, options);
+}
+</script>
+
diff --git a/import-layers/yocto-poky/scripts/lib/build_perf/html/report.html b/import-layers/yocto-poky/scripts/lib/build_perf/html/report.html
new file mode 100644
index 0000000..165cbb8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/build_perf/html/report.html
@@ -0,0 +1,206 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+{# Scripts, for visualization#}
+<!--START-OF-SCRIPTS-->
+<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
+<script type="text/javascript">
+google.charts.load('current', {'packages':['corechart']});
+var chartsDrawing = 0;
+</script>
+
+{# Render measurement result charts #}
+{% for test in test_data %}
+  {% if test.status == 'SUCCESS' %}
+    {% for measurement in test.measurements %}
+      {% set chart_elem_id = test.name + '_' + measurement.name + '_chart' %}
+      {% include 'measurement_chart.html' %}
+    {% endfor %}
+  {% endif %}
+{% endfor %}
+
+<!--END-OF-SCRIPTS-->
+
+{# Styles #}
+<style>
+.meta-table {
+  font-size: 14px;
+  text-align: left;
+  border-collapse: collapse;
+}
+.meta-table tr:nth-child(even){background-color: #f2f2f2}
+meta-table th, .meta-table td {
+  padding: 4px;
+}
+.summary {
+  margin: 0;
+  font-size: 14px;
+  text-align: left;
+  border-collapse: collapse;
+}
+summary th, .meta-table td {
+  padding: 4px;
+}
+.measurement {
+  padding: 8px 0px 8px 8px;
+  border: 2px solid #f0f0f0;
+  margin-bottom: 10px;
+}
+.details {
+  margin: 0;
+  font-size: 12px;
+  text-align: left;
+  border-collapse: collapse;
+}
+.details th {
+  font-weight: normal;
+  padding-right: 8px;
+}
+.preformatted {
+  font-family: monospace;
+  white-space: pre-wrap;
+  background-color: #f0f0f0;
+  margin-left: 10px;
+}
+hr {
+  color: #f0f0f0;
+}
+h2 {
+  font-size: 20px;
+  margin-bottom: 0px;
+  color: #707070;
+}
+h3 {
+  font-size: 16px;
+  margin: 0px;
+  color: #707070;
+}
+</style>
+
+<title>{{ title }}</title>
+</head>
+
+{% macro poky_link(commit) -%}
+    <a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?id={{ commit }}">{{ commit[0:11] }}</a>
+{%- endmacro %}
+
+<body><div style="width: 700px">
+  {# Test metadata #}
+  <h2>General</h2>
+  <hr>
+  <table class="meta-table" style="width: 100%">
+    <tr>
+      <th></th>
+      <th>Current commit</th>
+      <th>Comparing with</th>
+    </tr>
+    {% for key, item in metadata.items() %}
+    <tr>
+      <th>{{ item.title }}</th>
+      {%if key == 'commit' %}
+        <td>{{ poky_link(item.value) }}</td>
+        <td>{{ poky_link(item.value_old) }}</td>
+      {% else %}
+        <td>{{ item.value }}</td>
+        <td>{{ item.value_old }}</td>
+      {% endif %}
+    </tr>
+    {% endfor %}
+  </table>
+
+  {# Test result summary #}
+  <h2>Test result summary</h2>
+  <hr>
+  <table class="summary" style="width: 100%">
+    {% for test in test_data %}
+      {% if loop.index is even %}
+        {% set row_style = 'style="background-color: #f2f2f2"' %}
+      {% else %}
+        {% set row_style = 'style="background-color: #ffffff"' %}
+      {% endif %}
+      <tr {{ row_style }}><td>{{ test.name }}: {{ test.description }}</td>
+      {% if test.status == 'SUCCESS' %}
+        {% for measurement in test.measurements %}
+          {# add empty cell in place of the test name#}
+          {% if loop.index > 1 %}<td></td>{% endif %}
+          {% if measurement.absdiff > 0 %}
+            {% set result_style = "color: red" %}
+          {% elif measurement.absdiff == measurement.absdiff %}
+            {% set result_style = "color: green" %}
+          {% else %}
+            {% set result_style = "color: orange" %}
+          {%endif %}
+          <td>{{ measurement.description }}</td>
+          <td style="font-weight: bold">{{ measurement.value.mean }}</td>
+          <td style="{{ result_style }}">{{ measurement.absdiff_str }}</td>
+          <td style="{{ result_style }}">{{ measurement.reldiff }}</td>
+          </tr><tr {{ row_style }}>
+        {% endfor %}
+      {% else %}
+        <td style="font-weight: bold; color: red;">{{test.status }}</td>
+        <td></td> <td></td> <td></td> <td></td>
+      {% endif %}
+      </tr>
+    {% endfor %}
+  </table>
+
+  {# Detailed test results #}
+  {% for test in test_data %}
+  <h2>{{ test.name }}: {{ test.description }}</h2>
+  <hr>
+    {% if test.status == 'SUCCESS' %}
+      {% for measurement in test.measurements %}
+        <div class="measurement">
+          <h3>{{ measurement.description }}</h3>
+          <div style="font-weight:bold;">
+            <span style="font-size: 23px;">{{ measurement.value.mean }}</span>
+            <span style="font-size: 20px; margin-left: 12px">
+            {% if measurement.absdiff > 0 %}
+            <span style="color: red">
+            {% elif measurement.absdiff == measurement.absdiff %}
+            <span style="color: green">
+            {% else %}
+            <span style="color: orange">
+            {% endif %}
+            {{ measurement.absdiff_str }} ({{measurement.reldiff}})
+            </span></span>
+          </div>
+          <table style="width: 100%">
+            <tr>
+              <td style="width: 75%">
+                {# Linechart #}
+                <div id="{{ test.name }}_{{ measurement.name }}_chart"></div>
+              </td>
+              <td>
+                {# Measurement statistics #}
+                <table class="details">
+                  <tr>
+                    <th>Test runs</th><td>{{ measurement.value.sample_cnt }}</td>
+                  </tr><tr>
+                    <th>-/+</th><td>-{{ measurement.value.minus }} / +{{ measurement.value.plus }}</td>
+                  </tr><tr>
+                    <th>Min</th><td>{{ measurement.value.min }}</td>
+                  </tr><tr>
+                    <th>Max</th><td>{{ measurement.value.max }}</td>
+                  </tr><tr>
+                    <th>Stdev</th><td>{{ measurement.value.stdev }}</td>
+                  </tr><tr>
+                    <th><div id="{{ test.name }}_{{ measurement.name }}_chart_png"></div></th>
+                  </tr>
+                </table>
+              </td>
+            </tr>
+          </table>
+        </div>
+      {% endfor %}
+    {# Unsuccessful test #}
+    {% else %}
+      <span style="font-size: 150%; font-weight: bold; color: red;">{{ test.status }}
+      {% if test.err_type %}<span style="font-size: 75%; font-weight: normal">({{ test.err_type }})</span>{% endif %}
+      </span>
+      <div class="preformatted">{{ test.message }}</div>
+    {% endif %}
+  {% endfor %}
+</div></body>
+</html>
+
diff --git a/import-layers/yocto-poky/scripts/lib/build_perf/report.py b/import-layers/yocto-poky/scripts/lib/build_perf/report.py
new file mode 100644
index 0000000..eb00ccc
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/build_perf/report.py
@@ -0,0 +1,342 @@
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+"""Handling of build perf test reports"""
+from collections import OrderedDict, Mapping
+from datetime import datetime, timezone
+from numbers import Number
+from statistics import mean, stdev, variance
+
+
+def isofmt_to_timestamp(string):
+    """Convert timestamp string in ISO 8601 format into unix timestamp"""
+    if '.' in string:
+        dt = datetime.strptime(string, '%Y-%m-%dT%H:%M:%S.%f')
+    else:
+        dt = datetime.strptime(string, '%Y-%m-%dT%H:%M:%S')
+    return dt.replace(tzinfo=timezone.utc).timestamp()
+
+
+def metadata_xml_to_json(elem):
+    """Convert metadata xml into JSON format"""
+    assert elem.tag == 'metadata', "Invalid metadata file format"
+
+    def _xml_to_json(elem):
+        """Convert xml element to JSON object"""
+        out = OrderedDict()
+        for child in elem.getchildren():
+            key = child.attrib.get('name', child.tag)
+            if len(child):
+                out[key] = _xml_to_json(child)
+            else:
+                out[key] = child.text
+        return out
+    return _xml_to_json(elem)
+
+
+def results_xml_to_json(elem):
+    """Convert results xml into JSON format"""
+    rusage_fields = ('ru_utime', 'ru_stime', 'ru_maxrss', 'ru_minflt',
+                     'ru_majflt', 'ru_inblock', 'ru_oublock', 'ru_nvcsw',
+                     'ru_nivcsw')
+    iostat_fields = ('rchar', 'wchar', 'syscr', 'syscw', 'read_bytes',
+                     'write_bytes', 'cancelled_write_bytes')
+
+    def _read_measurement(elem):
+        """Convert measurement to JSON"""
+        data = OrderedDict()
+        data['type'] = elem.tag
+        data['name'] = elem.attrib['name']
+        data['legend'] = elem.attrib['legend']
+        values = OrderedDict()
+
+        # SYSRES measurement
+        if elem.tag == 'sysres':
+            for subel in elem:
+                if subel.tag == 'time':
+                    values['start_time'] = isofmt_to_timestamp(subel.attrib['timestamp'])
+                    values['elapsed_time'] = float(subel.text)
+                elif subel.tag == 'rusage':
+                    rusage = OrderedDict()
+                    for field in rusage_fields:
+                        if 'time' in field:
+                            rusage[field] = float(subel.attrib[field])
+                        else:
+                            rusage[field] = int(subel.attrib[field])
+                    values['rusage'] = rusage
+                elif subel.tag == 'iostat':
+                    values['iostat'] = OrderedDict([(f, int(subel.attrib[f]))
+                        for f in iostat_fields])
+                elif subel.tag == 'buildstats_file':
+                    values['buildstats_file'] = subel.text
+                else:
+                    raise TypeError("Unknown sysres value element '{}'".format(subel.tag))
+        # DISKUSAGE measurement
+        elif elem.tag == 'diskusage':
+            values['size'] = int(elem.find('size').text)
+        else:
+            raise Exception("Unknown measurement tag '{}'".format(elem.tag))
+        data['values'] = values
+        return data
+
+    def _read_testcase(elem):
+        """Convert testcase into JSON"""
+        assert elem.tag == 'testcase', "Expecting 'testcase' element instead of {}".format(elem.tag)
+
+        data = OrderedDict()
+        data['name'] = elem.attrib['name']
+        data['description'] = elem.attrib['description']
+        data['status'] = 'SUCCESS'
+        data['start_time'] = isofmt_to_timestamp(elem.attrib['timestamp'])
+        data['elapsed_time'] = float(elem.attrib['time'])
+        measurements = OrderedDict()
+
+        for subel in elem.getchildren():
+            if subel.tag == 'error' or subel.tag == 'failure':
+                data['status'] = subel.tag.upper()
+                data['message'] = subel.attrib['message']
+                data['err_type'] = subel.attrib['type']
+                data['err_output'] = subel.text
+            elif subel.tag == 'skipped':
+                data['status'] = 'SKIPPED'
+                data['message'] = subel.text
+            else:
+                measurements[subel.attrib['name']] = _read_measurement(subel)
+        data['measurements'] = measurements
+        return data
+
+    def _read_testsuite(elem):
+        """Convert suite to JSON"""
+        assert elem.tag == 'testsuite', \
+                "Expecting 'testsuite' element instead of {}".format(elem.tag)
+
+        data = OrderedDict()
+        if 'hostname' in elem.attrib:
+            data['tester_host'] = elem.attrib['hostname']
+        data['start_time'] = isofmt_to_timestamp(elem.attrib['timestamp'])
+        data['elapsed_time'] = float(elem.attrib['time'])
+        tests = OrderedDict()
+
+        for case in elem.getchildren():
+            tests[case.attrib['name']] = _read_testcase(case)
+        data['tests'] = tests
+        return data
+
+    # Main function
+    assert elem.tag == 'testsuites', "Invalid test report format"
+    assert len(elem) == 1, "Too many testsuites"
+
+    return _read_testsuite(elem.getchildren()[0])
+
+
+def aggregate_metadata(metadata):
+    """Aggregate metadata into one, basically a sanity check"""
+    mutable_keys = ('pretty_name', 'version_id')
+
+    def aggregate_obj(aggregate, obj, assert_str=True):
+        """Aggregate objects together"""
+        assert type(aggregate) is type(obj), \
+                "Type mismatch: {} != {}".format(type(aggregate), type(obj))
+        if isinstance(obj, Mapping):
+            assert set(aggregate.keys()) == set(obj.keys())
+            for key, val in obj.items():
+                aggregate_obj(aggregate[key], val, key not in mutable_keys)
+        elif isinstance(obj, list):
+            assert len(aggregate) == len(obj)
+            for i, val in enumerate(obj):
+                aggregate_obj(aggregate[i], val)
+        elif not isinstance(obj, str) or (isinstance(obj, str) and assert_str):
+            assert aggregate == obj, "Data mismatch {} != {}".format(aggregate, obj)
+
+    if not metadata:
+        return {}
+
+    # Do the aggregation
+    aggregate = metadata[0].copy()
+    for testrun in metadata[1:]:
+        aggregate_obj(aggregate, testrun)
+    aggregate['testrun_count'] = len(metadata)
+    return aggregate
+
+
+def aggregate_data(data):
+    """Aggregate multiple test results JSON structures into one"""
+
+    mutable_keys = ('status', 'message', 'err_type', 'err_output')
+
+    class SampleList(list):
+        """Container for numerical samples"""
+        pass
+
+    def new_aggregate_obj(obj):
+        """Create new object for aggregate"""
+        if isinstance(obj, Number):
+            new_obj = SampleList()
+            new_obj.append(obj)
+        elif isinstance(obj, str):
+            new_obj = obj
+        else:
+            # Lists and and dicts are kept as is
+            new_obj = obj.__class__()
+            aggregate_obj(new_obj, obj)
+        return new_obj
+
+    def aggregate_obj(aggregate, obj, assert_str=True):
+        """Recursive "aggregation" of JSON objects"""
+        if isinstance(obj, Number):
+            assert isinstance(aggregate, SampleList)
+            aggregate.append(obj)
+            return
+
+        assert type(aggregate) == type(obj), \
+                "Type mismatch: {} != {}".format(type(aggregate), type(obj))
+        if isinstance(obj, Mapping):
+            for key, val in obj.items():
+                if not key in aggregate:
+                    aggregate[key] = new_aggregate_obj(val)
+                else:
+                    aggregate_obj(aggregate[key], val, key not in mutable_keys)
+        elif isinstance(obj, list):
+            for i, val in enumerate(obj):
+                if i >= len(aggregate):
+                    aggregate[key] = new_aggregate_obj(val)
+                else:
+                    aggregate_obj(aggregate[i], val)
+        elif isinstance(obj, str):
+            # Sanity check for data
+            if assert_str:
+                assert aggregate == obj, "Data mismatch {} != {}".format(aggregate, obj)
+        else:
+            raise Exception("BUG: unable to aggregate '{}' ({})".format(type(obj), str(obj)))
+
+    if not data:
+        return {}
+
+    # Do the aggregation
+    aggregate = data[0].__class__()
+    for testrun in data:
+        aggregate_obj(aggregate, testrun)
+    return aggregate
+
+
+class MeasurementVal(float):
+    """Base class representing measurement values"""
+    gv_data_type = 'number'
+
+    def gv_value(self):
+        """Value formatting for visualization"""
+        if self != self:
+            return "null"
+        else:
+            return self
+
+
+class TimeVal(MeasurementVal):
+    """Class representing time values"""
+    quantity = 'time'
+    gv_title = 'elapsed time'
+    gv_data_type = 'timeofday'
+
+    def hms(self):
+        """Split time into hours, minutes and seconeds"""
+        hhh = int(abs(self) / 3600)
+        mmm = int((abs(self) % 3600) / 60)
+        sss = abs(self) % 60
+        return hhh, mmm, sss
+
+    def __str__(self):
+        if self != self:
+            return "nan"
+        hh, mm, ss = self.hms()
+        sign = '-' if self < 0 else ''
+        if hh > 0:
+            return '{}{:d}:{:02d}:{:02.0f}'.format(sign, hh, mm, ss)
+        elif mm > 0:
+            return '{}{:d}:{:04.1f}'.format(sign, mm, ss)
+        elif ss > 1:
+            return '{}{:.1f} s'.format(sign, ss)
+        else:
+            return '{}{:.2f} s'.format(sign, ss)
+
+    def gv_value(self):
+        """Value formatting for visualization"""
+        if self != self:
+            return "null"
+        hh, mm, ss = self.hms()
+        return [hh, mm, int(ss), int(ss*1000) % 1000]
+
+
+class SizeVal(MeasurementVal):
+    """Class representing time values"""
+    quantity = 'size'
+    gv_title = 'size in MiB'
+    gv_data_type = 'number'
+
+    def __str__(self):
+        if self != self:
+            return "nan"
+        if abs(self) < 1024:
+            return '{:.1f} kiB'.format(self)
+        elif abs(self) < 1048576:
+            return '{:.2f} MiB'.format(self / 1024)
+        else:
+            return '{:.2f} GiB'.format(self / 1048576)
+
+    def gv_value(self):
+        """Value formatting for visualization"""
+        if self != self:
+            return "null"
+        return self / 1024
+
+def measurement_stats(meas, prefix=''):
+    """Get statistics of a measurement"""
+    if not meas:
+        return {prefix + 'sample_cnt': 0,
+                prefix + 'mean': MeasurementVal('nan'),
+                prefix + 'stdev': MeasurementVal('nan'),
+                prefix + 'variance': MeasurementVal('nan'),
+                prefix + 'min': MeasurementVal('nan'),
+                prefix + 'max': MeasurementVal('nan'),
+                prefix + 'minus': MeasurementVal('nan'),
+                prefix + 'plus': MeasurementVal('nan')}
+
+    stats = {'name': meas['name']}
+    if meas['type'] == 'sysres':
+        val_cls = TimeVal
+        values = meas['values']['elapsed_time']
+    elif meas['type'] == 'diskusage':
+        val_cls = SizeVal
+        values = meas['values']['size']
+    else:
+        raise Exception("Unknown measurement type '{}'".format(meas['type']))
+    stats['val_cls'] = val_cls
+    stats['quantity'] = val_cls.quantity
+    stats[prefix + 'sample_cnt'] = len(values)
+
+    mean_val = val_cls(mean(values))
+    min_val = val_cls(min(values))
+    max_val = val_cls(max(values))
+
+    stats[prefix + 'mean'] = mean_val
+    if len(values) > 1:
+        stats[prefix + 'stdev'] = val_cls(stdev(values))
+        stats[prefix + 'variance'] = val_cls(variance(values))
+    else:
+        stats[prefix + 'stdev'] = float('nan')
+        stats[prefix + 'variance'] = float('nan')
+    stats[prefix + 'min'] = min_val
+    stats[prefix + 'max'] = max_val
+    stats[prefix + 'minus'] = val_cls(mean_val - min_val)
+    stats[prefix + 'plus'] = val_cls(max_val - mean_val)
+
+    return stats
+
diff --git a/import-layers/yocto-poky/scripts/lib/build_perf/scrape-html-report.js b/import-layers/yocto-poky/scripts/lib/build_perf/scrape-html-report.js
new file mode 100644
index 0000000..05a1f57
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/build_perf/scrape-html-report.js
@@ -0,0 +1,56 @@
+var fs = require('fs');
+var system = require('system');
+var page = require('webpage').create();
+
+// Examine console log for message from chart drawing
+page.onConsoleMessage = function(msg) {
+    console.log(msg);
+    if (msg === "ALL CHARTS READY") {
+        window.charts_ready = true;
+    }
+    else if (msg.slice(0, 11) === "CHART READY") {
+        var chart_id = msg.split(" ")[2];
+        console.log('grabbing ' + chart_id);
+        var png_data = page.evaluate(function (chart_id) {
+            var chart_div = document.getElementById(chart_id + '_png');
+            return chart_div.outerHTML;
+        }, chart_id);
+        fs.write(args[2] + '/' + chart_id + '.png', png_data, 'w');
+    }
+};
+
+// Check command line arguments
+var args = system.args;
+if (args.length != 3) {
+    console.log("USAGE: " + args[0] + " REPORT_HTML OUT_DIR\n");
+    phantom.exit(1);
+}
+
+// Open the web page
+page.open(args[1], function(status) {
+    if (status == 'fail') {
+        console.log("Failed to open file '" + args[1] + "'");
+        phantom.exit(1);
+    }
+});
+
+// Check status every 100 ms
+interval = window.setInterval(function () {
+    //console.log('waiting');
+    if (window.charts_ready) {
+        clearTimeout(timer);
+        clearInterval(interval);
+
+        var fname = args[1].replace(/\/+$/, "").split("/").pop()
+        console.log("saving " + fname);
+        fs.write(args[2] + '/' + fname, page.content, 'w');
+        phantom.exit(0);
+    }
+}, 100);
+
+// Time-out after 10 seconds
+timer = window.setTimeout(function () {
+    clearInterval(interval);
+    console.log("ERROR: timeout");
+    phantom.exit(1);
+}, 10000);
diff --git a/import-layers/yocto-poky/scripts/lib/compatlayer/__init__.py b/import-layers/yocto-poky/scripts/lib/compatlayer/__init__.py
new file mode 100644
index 0000000..7197e85
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/compatlayer/__init__.py
@@ -0,0 +1,392 @@
+# Yocto Project compatibility layer tool
+#
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import re
+import subprocess
+from enum import Enum
+
+import bb.tinfoil
+
+class LayerType(Enum):
+    BSP = 0
+    DISTRO = 1
+    SOFTWARE = 2
+    ERROR_NO_LAYER_CONF = 98
+    ERROR_BSP_DISTRO = 99
+
+def _get_configurations(path):
+    configs = []
+
+    for f in os.listdir(path):
+        file_path = os.path.join(path, f)
+        if os.path.isfile(file_path) and f.endswith('.conf'):
+            configs.append(f[:-5]) # strip .conf
+    return configs
+
+def _get_layer_collections(layer_path, lconf=None, data=None):
+    import bb.parse
+    import bb.data
+
+    if lconf is None:
+        lconf = os.path.join(layer_path, 'conf', 'layer.conf')
+
+    if data is None:
+        ldata = bb.data.init()
+        bb.parse.init_parser(ldata)
+    else:
+        ldata = data.createCopy()
+
+    ldata.setVar('LAYERDIR', layer_path)
+    try:
+        ldata = bb.parse.handle(lconf, ldata, include=True)
+    except BaseException as exc:
+        raise LayerError(exc)
+    ldata.expandVarref('LAYERDIR')
+
+    collections = (ldata.getVar('BBFILE_COLLECTIONS', True) or '').split()
+    if not collections:
+        name = os.path.basename(layer_path)
+        collections = [name]
+
+    collections = {c: {} for c in collections}
+    for name in collections:
+        priority = ldata.getVar('BBFILE_PRIORITY_%s' % name, True)
+        pattern = ldata.getVar('BBFILE_PATTERN_%s' % name, True)
+        depends = ldata.getVar('LAYERDEPENDS_%s' % name, True)
+        collections[name]['priority'] = priority
+        collections[name]['pattern'] = pattern
+        collections[name]['depends'] = depends
+
+    return collections
+
+def _detect_layer(layer_path):
+    """
+        Scans layer directory to detect what type of layer
+        is BSP, Distro or Software.
+
+        Returns a dictionary with layer name, type and path.
+    """
+
+    layer = {}
+    layer_name = os.path.basename(layer_path)
+
+    layer['name'] = layer_name
+    layer['path'] = layer_path
+    layer['conf'] = {}
+
+    if not os.path.isfile(os.path.join(layer_path, 'conf', 'layer.conf')):
+        layer['type'] = LayerType.ERROR_NO_LAYER_CONF
+        return layer
+
+    machine_conf = os.path.join(layer_path, 'conf', 'machine')
+    distro_conf = os.path.join(layer_path, 'conf', 'distro')
+
+    is_bsp = False
+    is_distro = False
+
+    if os.path.isdir(machine_conf):
+        machines = _get_configurations(machine_conf)
+        if machines:
+            is_bsp = True
+
+    if os.path.isdir(distro_conf):
+        distros = _get_configurations(distro_conf)
+        if distros:
+            is_distro = True
+
+    if is_bsp and is_distro:
+        layer['type'] = LayerType.ERROR_BSP_DISTRO
+    elif is_bsp:
+        layer['type'] = LayerType.BSP
+        layer['conf']['machines'] = machines
+    elif is_distro:
+        layer['type'] = LayerType.DISTRO
+        layer['conf']['distros'] = distros
+    else:
+        layer['type'] = LayerType.SOFTWARE
+
+    layer['collections'] = _get_layer_collections(layer['path'])
+
+    return layer
+
+def detect_layers(layer_directories, no_auto):
+    layers = []
+
+    for directory in layer_directories:
+        directory = os.path.realpath(directory)
+        if directory[-1] == '/':
+            directory = directory[0:-1]
+
+        if no_auto:
+            conf_dir = os.path.join(directory, 'conf')
+            if os.path.isdir(conf_dir):
+                layer = _detect_layer(directory)
+                if layer:
+                    layers.append(layer)
+        else:
+            for root, dirs, files in os.walk(directory):
+                dir_name = os.path.basename(root)
+                conf_dir = os.path.join(root, 'conf')
+                if os.path.isdir(conf_dir):
+                    layer = _detect_layer(root)
+                    if layer:
+                        layers.append(layer)
+
+    return layers
+
+def _find_layer_depends(depend, layers):
+    for layer in layers:
+        for collection in layer['collections']:
+            if depend == collection:
+                return layer
+    return None
+
+def add_layer_dependencies(bblayersconf, layer, layers, logger):
+    def recurse_dependencies(depends, layer, layers, logger, ret = []):
+        logger.debug('Processing dependencies %s for layer %s.' % \
+                    (depends, layer['name']))
+
+        for depend in depends.split():
+            # core (oe-core) is suppose to be provided
+            if depend == 'core':
+                continue
+
+            layer_depend = _find_layer_depends(depend, layers)
+            if not layer_depend:
+                logger.error('Layer %s depends on %s and isn\'t found.' % \
+                        (layer['name'], depend))
+                ret = None
+                continue
+
+            # We keep processing, even if ret is None, this allows us to report
+            # multiple errors at once
+            if ret is not None and layer_depend not in ret:
+                ret.append(layer_depend)
+
+            # Recursively process...
+            if 'collections' not in layer_depend:
+                continue
+
+            for collection in layer_depend['collections']:
+                collect_deps = layer_depend['collections'][collection]['depends']
+                if not collect_deps:
+                    continue
+                ret = recurse_dependencies(collect_deps, layer_depend, layers, logger, ret)
+
+        return ret
+
+    layer_depends = []
+    for collection in layer['collections']:
+        depends = layer['collections'][collection]['depends']
+        if not depends:
+            continue
+
+        layer_depends = recurse_dependencies(depends, layer, layers, logger, layer_depends)
+
+    # Note: [] (empty) is allowed, None is not!
+    if layer_depends is None:
+        return False
+    else:
+        # Don't add a layer that is already present.
+        added = set()
+        output = check_command('Getting existing layers failed.', 'bitbake-layers show-layers').decode('utf-8')
+        for layer, path, pri in re.findall(r'^(\S+) +([^\n]*?) +(\d+)$', output, re.MULTILINE):
+            added.add(path)
+
+        for layer_depend in layer_depends:
+            name = layer_depend['name']
+            path = layer_depend['path']
+            if path in added:
+                continue
+            else:
+                added.add(path)
+            logger.info('Adding layer dependency %s' % name)
+            with open(bblayersconf, 'a+') as f:
+                f.write("\nBBLAYERS += \"%s\"\n" % path)
+    return True
+
+def add_layer(bblayersconf, layer, layers, logger):
+    logger.info('Adding layer %s' % layer['name'])
+    with open(bblayersconf, 'a+') as f:
+        f.write("\nBBLAYERS += \"%s\"\n" % layer['path'])
+
+    return True
+
+def check_command(error_msg, cmd):
+    '''
+    Run a command under a shell, capture stdout and stderr in a single stream,
+    throw an error when command returns non-zero exit code. Returns the output.
+    '''
+
+    p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+    output, _ = p.communicate()
+    if p.returncode:
+        msg = "%s\nCommand: %s\nOutput:\n%s" % (error_msg, cmd, output.decode('utf-8'))
+        raise RuntimeError(msg)
+    return output
+
+def get_signatures(builddir, failsafe=False, machine=None):
+    import re
+
+    # some recipes needs to be excluded like meta-world-pkgdata
+    # because a layer can add recipes to a world build so signature
+    # will be change
+    exclude_recipes = ('meta-world-pkgdata',)
+
+    sigs = {}
+    tune2tasks = {}
+
+    cmd = ''
+    if machine:
+        cmd += 'MACHINE=%s ' % machine
+    cmd += 'bitbake '
+    if failsafe:
+        cmd += '-k '
+    cmd += '-S none world'
+    sigs_file = os.path.join(builddir, 'locked-sigs.inc')
+    if os.path.exists(sigs_file):
+        os.unlink(sigs_file)
+    try:
+        check_command('Generating signatures failed. This might be due to some parse error and/or general layer incompatibilities.',
+                      cmd)
+    except RuntimeError as ex:
+        if failsafe and os.path.exists(sigs_file):
+            # Ignore the error here. Most likely some recipes active
+            # in a world build lack some dependencies. There is a
+            # separate test_machine_world_build which exposes the
+            # failure.
+            pass
+        else:
+            raise
+
+    sig_regex = re.compile("^(?P<task>.*:.*):(?P<hash>.*) .$")
+    tune_regex = re.compile("(^|\s)SIGGEN_LOCKEDSIGS_t-(?P<tune>\S*)\s*=\s*")
+    current_tune = None
+    with open(sigs_file, 'r') as f:
+        for line in f.readlines():
+            line = line.strip()
+            t = tune_regex.search(line)
+            if t:
+                current_tune = t.group('tune')
+            s = sig_regex.match(line)
+            if s:
+                exclude = False
+                for er in exclude_recipes:
+                    (recipe, task) = s.group('task').split(':')
+                    if er == recipe:
+                        exclude = True
+                        break
+                if exclude:
+                    continue
+
+                sigs[s.group('task')] = s.group('hash')
+                tune2tasks.setdefault(current_tune, []).append(s.group('task'))
+
+    if not sigs:
+        raise RuntimeError('Can\'t load signatures from %s' % sigs_file)
+
+    return (sigs, tune2tasks)
+
+def get_depgraph(targets=['world'], failsafe=False):
+    '''
+    Returns the dependency graph for the given target(s).
+    The dependency graph is taken directly from DepTreeEvent.
+    '''
+    depgraph = None
+    with bb.tinfoil.Tinfoil() as tinfoil:
+        tinfoil.prepare(config_only=False)
+        tinfoil.set_event_mask(['bb.event.NoProvider', 'bb.event.DepTreeGenerated', 'bb.command.CommandCompleted'])
+        if not tinfoil.run_command('generateDepTreeEvent', targets, 'do_build'):
+            raise RuntimeError('starting generateDepTreeEvent failed')
+        while True:
+            event = tinfoil.wait_event(timeout=1000)
+            if event:
+                if isinstance(event, bb.command.CommandFailed):
+                    raise RuntimeError('Generating dependency information failed: %s' % event.error)
+                elif isinstance(event, bb.command.CommandCompleted):
+                    break
+                elif isinstance(event, bb.event.NoProvider):
+                    if failsafe:
+                        # The event is informational, we will get information about the
+                        # remaining dependencies eventually and thus can ignore this
+                        # here like we do in get_signatures(), if desired.
+                        continue
+                    if event._reasons:
+                        raise RuntimeError('Nothing provides %s: %s' % (event._item, event._reasons))
+                    else:
+                        raise RuntimeError('Nothing provides %s.' % (event._item))
+                elif isinstance(event, bb.event.DepTreeGenerated):
+                    depgraph = event._depgraph
+
+    if depgraph is None:
+        raise RuntimeError('Could not retrieve the depgraph.')
+    return depgraph
+
+def compare_signatures(old_sigs, curr_sigs):
+    '''
+    Compares the result of two get_signatures() calls. Returns None if no
+    problems found, otherwise a string that can be used as additional
+    explanation in self.fail().
+    '''
+    # task -> (old signature, new signature)
+    sig_diff = {}
+    for task in old_sigs:
+        if task in curr_sigs and \
+           old_sigs[task] != curr_sigs[task]:
+            sig_diff[task] = (old_sigs[task], curr_sigs[task])
+
+    if not sig_diff:
+        return None
+
+    # Beware, depgraph uses task=<pn>.<taskname> whereas get_signatures()
+    # uses <pn>:<taskname>. Need to convert sometimes. The output follows
+    # the convention from get_signatures() because that seems closer to
+    # normal bitbake output.
+    def sig2graph(task):
+        pn, taskname = task.rsplit(':', 1)
+        return pn + '.' + taskname
+    def graph2sig(task):
+        pn, taskname = task.rsplit('.', 1)
+        return pn + ':' + taskname
+    depgraph = get_depgraph(failsafe=True)
+    depends = depgraph['tdepends']
+
+    # If a task A has a changed signature, but none of its
+    # dependencies, then we need to report it because it is
+    # the one which introduces a change. Any task depending on
+    # A (directly or indirectly) will also have a changed
+    # signature, but we don't need to report it. It might have
+    # its own changes, which will become apparent once the
+    # issues that we do report are fixed and the test gets run
+    # again.
+    sig_diff_filtered = []
+    for task, (old_sig, new_sig) in sig_diff.items():
+        deps_tainted = False
+        for dep in depends.get(sig2graph(task), ()):
+            if graph2sig(dep) in sig_diff:
+                deps_tainted = True
+                break
+        if not deps_tainted:
+            sig_diff_filtered.append((task, old_sig, new_sig))
+
+    msg = []
+    msg.append('%d signatures changed, initial differences (first hash before, second after):' %
+               len(sig_diff))
+    for diff in sorted(sig_diff_filtered):
+        recipe, taskname = diff[0].rsplit(':', 1)
+        cmd = 'bitbake-diffsigs --task %s %s --signature %s %s' % \
+              (recipe, taskname, diff[1], diff[2])
+        msg.append('   %s: %s -> %s' % diff)
+        msg.append('      %s' % cmd)
+        try:
+            output = check_command('Determining signature difference failed.',
+                                   cmd).decode('utf-8')
+        except RuntimeError as error:
+            output = str(error)
+        if output:
+            msg.extend(['      ' + line for line in output.splitlines()])
+            msg.append('')
+    return '\n'.join(msg)
diff --git a/import-layers/yocto-poky/scripts/lib/compatlayer/case.py b/import-layers/yocto-poky/scripts/lib/compatlayer/case.py
new file mode 100644
index 0000000..54ce78a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/compatlayer/case.py
@@ -0,0 +1,7 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+
+class OECompatLayerTestCase(OETestCase):
+    pass
diff --git a/import-layers/yocto-poky/scripts/lib/wic/imager/__init__.py b/import-layers/yocto-poky/scripts/lib/compatlayer/cases/__init__.py
similarity index 100%
rename from import-layers/yocto-poky/scripts/lib/wic/imager/__init__.py
rename to import-layers/yocto-poky/scripts/lib/compatlayer/cases/__init__.py
diff --git a/import-layers/yocto-poky/scripts/lib/compatlayer/cases/bsp.py b/import-layers/yocto-poky/scripts/lib/compatlayer/cases/bsp.py
new file mode 100644
index 0000000..43efae4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/compatlayer/cases/bsp.py
@@ -0,0 +1,204 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import unittest
+
+from compatlayer import LayerType, get_signatures, check_command, get_depgraph
+from compatlayer.case import OECompatLayerTestCase
+
+class BSPCompatLayer(OECompatLayerTestCase):
+    @classmethod
+    def setUpClass(self):
+        if self.tc.layer['type'] != LayerType.BSP:
+            raise unittest.SkipTest("BSPCompatLayer: Layer %s isn't BSP one." %\
+                self.tc.layer['name'])
+
+    def test_bsp_defines_machines(self):
+        self.assertTrue(self.tc.layer['conf']['machines'], 
+                "Layer is BSP but doesn't defines machines.")
+
+    def test_bsp_no_set_machine(self):
+        from oeqa.utils.commands import get_bb_var
+
+        machine = get_bb_var('MACHINE')
+        self.assertEqual(self.td['bbvars']['MACHINE'], machine,
+                msg="Layer %s modified machine %s -> %s" % \
+                    (self.tc.layer['name'], self.td['bbvars']['MACHINE'], machine))
+
+
+    def test_machine_world(self):
+        '''
+        "bitbake world" is expected to work regardless which machine is selected.
+        BSP layers sometimes break that by enabling a recipe for a certain machine
+        without checking whether that recipe actually can be built in the current
+        distro configuration (for example, OpenGL might not enabled).
+
+        This test iterates over all machines. It would be nicer to instantiate
+        it once per machine. It merely checks for errors during parse
+        time. It does not actually attempt to build anything.
+        '''
+
+        if not self.td['machines']:
+            self.skipTest('No machines set with --machines.')
+        msg = []
+        for machine in self.td['machines']:
+            # In contrast to test_machine_signatures() below, errors are fatal here.
+            try:
+                get_signatures(self.td['builddir'], failsafe=False, machine=machine)
+            except RuntimeError as ex:
+                msg.append(str(ex))
+        if msg:
+            msg.insert(0, 'The following machines broke a world build:')
+            self.fail('\n'.join(msg))
+
+    def test_machine_signatures(self):
+        '''
+        Selecting a machine may only affect the signature of tasks that are specific
+        to that machine. In other words, when MACHINE=A and MACHINE=B share a recipe
+        foo and the output of foo, then both machine configurations must build foo
+        in exactly the same way. Otherwise it is not possible to use both machines
+        in the same distribution.
+
+        This criteria can only be tested by testing different machines in combination,
+        i.e. one main layer, potentially several additional BSP layers and an explicit
+        choice of machines:
+        yocto-compat-layer --additional-layers .../meta-intel --machines intel-corei7-64 imx6slevk -- .../meta-freescale
+        '''
+
+        if not self.td['machines']:
+            self.skipTest('No machines set with --machines.')
+
+        # Collect signatures for all machines that we are testing
+        # and merge that into a hash:
+        # tune -> task -> signature -> list of machines with that combination
+        #
+        # It is an error if any tune/task pair has more than one signature,
+        # because that implies that the machines that caused those different
+        # signatures do not agree on how to execute the task.
+        tunes = {}
+        # Preserve ordering of machines as chosen by the user.
+        for machine in self.td['machines']:
+            curr_sigs, tune2tasks = get_signatures(self.td['builddir'], failsafe=True, machine=machine)
+            # Invert the tune -> [tasks] mapping.
+            tasks2tune = {}
+            for tune, tasks in tune2tasks.items():
+                for task in tasks:
+                    tasks2tune[task] = tune
+            for task, sighash in curr_sigs.items():
+                tunes.setdefault(tasks2tune[task], {}).setdefault(task, {}).setdefault(sighash, []).append(machine)
+
+        msg = []
+        pruned = 0
+        last_line_key = None
+        # do_fetch, do_unpack, ..., do_build
+        taskname_list = []
+        if tunes:
+            # The output below is most useful when we start with tasks that are at
+            # the bottom of the dependency chain, i.e. those that run first. If
+            # those tasks differ, the rest also does.
+            #
+            # To get an ordering of tasks, we do a topological sort of the entire
+            # depgraph for the base configuration, then on-the-fly flatten that list by stripping
+            # out the recipe names and removing duplicates. The base configuration
+            # is not necessarily representative, but should be close enough. Tasks
+            # that were not encountered get a default priority.
+            depgraph = get_depgraph()
+            depends = depgraph['tdepends']
+            WHITE = 1
+            GRAY = 2
+            BLACK = 3
+            color = {}
+            found = set()
+            def visit(task):
+                color[task] = GRAY
+                for dep in depends.get(task, ()):
+                    if color.setdefault(dep, WHITE) == WHITE:
+                        visit(dep)
+                color[task] = BLACK
+                pn, taskname = task.rsplit('.', 1)
+                if taskname not in found:
+                    taskname_list.append(taskname)
+                    found.add(taskname)
+            for task in depends.keys():
+                if color.setdefault(task, WHITE) == WHITE:
+                    visit(task)
+
+        taskname_order = dict([(task, index) for index, task in enumerate(taskname_list) ])
+        def task_key(task):
+            pn, taskname = task.rsplit(':', 1)
+            return (pn, taskname_order.get(taskname, len(taskname_list)), taskname)
+
+        for tune in sorted(tunes.keys()):
+            tasks = tunes[tune]
+            # As for test_signatures it would be nicer to sort tasks
+            # by dependencies here, but that is harder because we have
+            # to report on tasks from different machines, which might
+            # have different dependencies. We resort to pruning the
+            # output by reporting only one task per recipe if the set
+            # of machines matches.
+            #
+            # "bitbake-diffsigs -t -s" is intelligent enough to print
+            # diffs recursively, so often it does not matter that much
+            # if we don't pick the underlying difference
+            # here. However, sometimes recursion fails
+            # (https://bugzilla.yoctoproject.org/show_bug.cgi?id=6428).
+            #
+            # To mitigate that a bit, we use a hard-coded ordering of
+            # tasks that represents how they normally run and prefer
+            # to print the ones that run first.
+            for task in sorted(tasks.keys(), key=task_key):
+                signatures = tasks[task]
+                # do_build can be ignored: it is know to have
+                # different signatures in some cases, for example in
+                # the allarch ca-certificates due to RDEPENDS=openssl.
+                # That particular dependency is whitelisted via
+                # SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS, but still shows up
+                # in the sstate signature hash because filtering it
+                # out would be hard and running do_build multiple
+                # times doesn't really matter.
+                if len(signatures.keys()) > 1 and \
+                   not task.endswith(':do_build'):
+                    # Error!
+                    #
+                    # Sort signatures by machines, because the hex values don't mean anything.
+                    # => all-arch adwaita-icon-theme:do_build: 1234... (beaglebone, qemux86) != abcdf... (qemux86-64)
+                    #
+                    # Skip the line if it is covered already by the predecessor (same pn, same sets of machines).
+                    pn, taskname = task.rsplit(':', 1)
+                    next_line_key = (pn, sorted(signatures.values()))
+                    if next_line_key != last_line_key:
+                        line = '   %s %s: ' % (tune, task)
+                        line += ' != '.join(['%s (%s)' % (signature, ', '.join([m for m in signatures[signature]])) for
+                                             signature in sorted(signatures.keys(), key=lambda s: signatures[s])])
+                        last_line_key = next_line_key
+                        msg.append(line)
+                        # Randomly pick two mismatched signatures and remember how to invoke
+                        # bitbake-diffsigs for them.
+                        iterator = iter(signatures.items())
+                        a = next(iterator)
+                        b = next(iterator)
+                        diffsig_machines = '(%s) != (%s)' % (', '.join(a[1]), ', '.join(b[1]))
+                        diffsig_params = '-t %s %s -s %s %s' % (pn, taskname, a[0], b[0])
+                    else:
+                        pruned += 1
+
+        if msg:
+            msg.insert(0, 'The machines have conflicting signatures for some shared tasks:')
+            if pruned > 0:
+                msg.append('')
+                msg.append('%d tasks where not listed because some other task of the recipe already differed.' % pruned)
+                msg.append('It is likely that differences from different recipes also have the same root cause.')
+            msg.append('')
+            # Explain how to investigate...
+            msg.append('To investigate, run bitbake-diffsigs -t recipename taskname -s fromsig tosig.')
+            cmd = 'bitbake-diffsigs %s' % diffsig_params
+            msg.append('Example: %s in the last line' % diffsig_machines)
+            msg.append('Command: %s' % cmd)
+            # ... and actually do it automatically for that example, but without aborting
+            # when that fails.
+            try:
+                output = check_command('Comparing signatures failed.', cmd).decode('utf-8')
+            except RuntimeError as ex:
+                output = str(ex)
+            msg.extend(['   ' + line for line in output.splitlines()])
+            self.fail('\n'.join(msg))
diff --git a/import-layers/yocto-poky/scripts/lib/compatlayer/cases/common.py b/import-layers/yocto-poky/scripts/lib/compatlayer/cases/common.py
new file mode 100644
index 0000000..55e8ba4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/compatlayer/cases/common.py
@@ -0,0 +1,53 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import glob
+import os
+import unittest
+from compatlayer import get_signatures, LayerType, check_command, get_depgraph, compare_signatures
+from compatlayer.case import OECompatLayerTestCase
+
+class CommonCompatLayer(OECompatLayerTestCase):
+    def test_readme(self):
+        # The top-level README file may have a suffix (like README.rst or README.txt).
+        readme_files = glob.glob(os.path.join(self.tc.layer['path'], 'README*'))
+        self.assertTrue(len(readme_files) > 0,
+                        msg="Layer doesn't contains README file.")
+
+        # There might be more than one file matching the file pattern above
+        # (for example, README.rst and README-COPYING.rst). The one with the shortest
+        # name is considered the "main" one.
+        readme_file = sorted(readme_files)[0]
+        data = ''
+        with open(readme_file, 'r') as f:
+            data = f.read()
+        self.assertTrue(data,
+                msg="Layer contains a README file but it is empty.")
+
+    def test_parse(self):
+        check_command('Layer %s failed to parse.' % self.tc.layer['name'],
+                      'bitbake -p')
+
+    def test_show_environment(self):
+        check_command('Layer %s failed to show environment.' % self.tc.layer['name'],
+                      'bitbake -e')
+
+    def test_world(self):
+        '''
+        "bitbake world" is expected to work. test_signatures does not cover that
+        because it is more lenient and ignores recipes in a world build that
+        are not actually buildable, so here we fail when "bitbake -S none world"
+        fails.
+        '''
+        get_signatures(self.td['builddir'], failsafe=False)
+
+    def test_signatures(self):
+        if self.tc.layer['type'] == LayerType.SOFTWARE and \
+           not self.tc.test_software_layer_signatures:
+            raise unittest.SkipTest("Not testing for signature changes in a software layer %s." \
+                     % self.tc.layer['name'])
+
+        curr_sigs, _ = get_signatures(self.td['builddir'], failsafe=True)
+        msg = compare_signatures(self.td['sigs'], curr_sigs)
+        if msg is not None:
+            self.fail('Adding layer %s changed signatures.\n%s' % (self.tc.layer['name'], msg))
diff --git a/import-layers/yocto-poky/scripts/lib/compatlayer/cases/distro.py b/import-layers/yocto-poky/scripts/lib/compatlayer/cases/distro.py
new file mode 100644
index 0000000..523acc1
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/compatlayer/cases/distro.py
@@ -0,0 +1,26 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import unittest
+
+from compatlayer import LayerType
+from compatlayer.case import OECompatLayerTestCase
+
+class DistroCompatLayer(OECompatLayerTestCase):
+    @classmethod
+    def setUpClass(self):
+        if self.tc.layer['type'] != LayerType.DISTRO:
+            raise unittest.SkipTest("DistroCompatLayer: Layer %s isn't Distro one." %\
+                self.tc.layer['name'])
+
+    def test_distro_defines_distros(self):
+        self.assertTrue(self.tc.layer['conf']['distros'], 
+                "Layer is BSP but doesn't defines machines.")
+
+    def test_distro_no_set_distros(self):
+        from oeqa.utils.commands import get_bb_var
+
+        distro = get_bb_var('DISTRO')
+        self.assertEqual(self.td['bbvars']['DISTRO'], distro,
+                msg="Layer %s modified distro %s -> %s" % \
+                    (self.tc.layer['name'], self.td['bbvars']['DISTRO'], distro))
diff --git a/import-layers/yocto-poky/scripts/lib/compatlayer/context.py b/import-layers/yocto-poky/scripts/lib/compatlayer/context.py
new file mode 100644
index 0000000..7811d4a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/compatlayer/context.py
@@ -0,0 +1,15 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import glob
+import re
+
+from oeqa.core.context import OETestContext
+
+class CompatLayerTestContext(OETestContext):
+    def __init__(self, td=None, logger=None, layer=None, test_software_layer_signatures=True):
+        super(CompatLayerTestContext, self).__init__(td, logger)
+        self.layer = layer
+        self.test_software_layer_signatures = test_software_layer_signatures
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/__init__.py b/import-layers/yocto-poky/scripts/lib/devtool/__init__.py
index e675133..d646b0c 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/__init__.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/__init__.py
@@ -23,6 +23,7 @@
 import subprocess
 import logging
 import re
+import codecs
 
 logger = logging.getLogger('devtool')
 
@@ -67,10 +68,10 @@
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **options
     )
 
+    reader = codecs.getreader('utf-8')(process.stdout)
     buf = ''
     while True:
-        out = process.stdout.read(1)
-        out = out.decode('utf-8')
+        out = reader.read(1, 1)
         if out:
             sys.stdout.write(out)
             sys.stdout.flush()
@@ -86,13 +87,13 @@
 def exec_fakeroot(d, cmd, **kwargs):
     """Run a command under fakeroot (pseudo, in fact) so that it picks up the appropriate file permissions"""
     # Grab the command and check it actually exists
-    fakerootcmd = d.getVar('FAKEROOTCMD', True)
+    fakerootcmd = d.getVar('FAKEROOTCMD')
     if not os.path.exists(fakerootcmd):
         logger.error('pseudo executable %s could not be found - have you run a build yet? pseudo-native should install this and if you have run any build then that should have been built')
         return 2
     # Set up the appropriate environment
     newenv = dict(os.environ)
-    fakerootenv = d.getVar('FAKEROOTENV', True)
+    fakerootenv = d.getVar('FAKEROOTENV')
     for varvalue in fakerootenv.split():
         if '=' in varvalue:
             splitval = varvalue.split('=', 1)
@@ -113,40 +114,40 @@
 
         import bb.tinfoil
         tinfoil = bb.tinfoil.Tinfoil(tracking=tracking)
-        tinfoil.prepare(config_only)
-        tinfoil.logger.setLevel(logger.getEffectiveLevel())
+        try:
+            tinfoil.prepare(config_only)
+            tinfoil.logger.setLevel(logger.getEffectiveLevel())
+        except bb.tinfoil.TinfoilUIException:
+            tinfoil.shutdown()
+            raise DevtoolError('Failed to start bitbake environment')
+        except:
+            tinfoil.shutdown()
+            raise
     finally:
         os.chdir(orig_cwd)
     return tinfoil
 
-def get_recipe_file(cooker, pn):
-    """Find recipe file corresponding a package name"""
-    import oe.recipeutils
-    recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)
-    if not recipefile:
-        skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)
-        if skipreasons:
-            logger.error('\n'.join(skipreasons))
-        else:
-            logger.error("Unable to find any recipe file matching %s" % pn)
-    return recipefile
-
 def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True):
-    """Parse recipe of a package"""
-    import oe.recipeutils
-    recipefile = get_recipe_file(tinfoil.cooker, pn)
-    if not recipefile:
-        # Error already logged
+    """Parse the specified recipe"""
+    try:
+        recipefile = tinfoil.get_recipe_file(pn)
+    except bb.providers.NoProvider as e:
+        logger.error(str(e))
         return None
     if appends:
-        append_files = tinfoil.cooker.collection.get_file_appends(recipefile)
+        append_files = tinfoil.get_file_appends(recipefile)
         if filter_workspace:
             # Filter out appends from the workspace
             append_files = [path for path in append_files if
                             not path.startswith(config.workspace_path)]
     else:
         append_files = None
-    return oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, append_files)
+    try:
+        rd = tinfoil.parse_recipe_file(recipefile, appends, append_files)
+    except Exception as e:
+        logger.error(str(e))
+        return None
+    return rd
 
 def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False):
     """
@@ -190,7 +191,7 @@
         logger.info('Using source tree as build directory since --same-dir specified')
     elif bb.data.inherits_class('autotools-brokensep', d):
         logger.info('Using source tree as build directory since recipe inherits autotools-brokensep')
-    elif d.getVar('B', True) == os.path.abspath(d.getVar('S', True)):
+    elif d.getVar('B') == os.path.abspath(d.getVar('S')):
         logger.info('Using source tree as build directory since that would be the default for this recipe')
     else:
         b_is_s = False
@@ -260,23 +261,28 @@
                 targets.append('%s-%s' % (pn, variant))
     return targets
 
-def ensure_npm(config, basepath, fixed_setup=False):
+def ensure_npm(config, basepath, fixed_setup=False, check_exists=True):
     """
     Ensure that npm is available and either build it or show a
     reasonable error message
     """
-    tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
-    try:
-        nativepath = tinfoil.config_data.getVar('STAGING_BINDIR_NATIVE', True)
-    finally:
-        tinfoil.shutdown()
+    if check_exists:
+        tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
+        try:
+            rd = tinfoil.parse_recipe('nodejs-native')
+            nativepath = rd.getVar('STAGING_BINDIR_NATIVE')
+        finally:
+            tinfoil.shutdown()
+        npmpath = os.path.join(nativepath, 'npm')
+        build_npm = not os.path.exists(npmpath)
+    else:
+        build_npm = True
 
-    npmpath = os.path.join(nativepath, 'npm')
-    if not os.path.exists(npmpath):
+    if build_npm:
         logger.info('Building nodejs-native')
         try:
             exec_build_env_command(config.init_path, basepath,
-                                'bitbake -q nodejs-native', watch=True)
+                                'bitbake -q nodejs-native -c addto_recipe_sysroot', watch=True)
         except bb.process.ExecutionError as e:
             if "Nothing PROVIDES 'nodejs-native'" in e.stdout:
                 if fixed_setup:
@@ -286,5 +292,3 @@
                 raise DevtoolError(msg)
             else:
                 raise
-        if not os.path.exists(npmpath):
-            raise DevtoolError('Built nodejs-native but npm binary still could not be found at %s' % npmpath)
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/build.py b/import-layers/yocto-poky/scripts/lib/devtool/build.py
index 6be549d..252379e 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/build.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/build.py
@@ -80,7 +80,7 @@
     """Register devtool subcommands from this plugin"""
     parser_build = subparsers.add_parser('build', help='Build a recipe',
                                          description='Builds the specified recipe using bitbake (up to and including %s)' % ', '.join(_get_build_tasks(context.config)),
-                                         group='working')
+                                         group='working', order=50)
     parser_build.add_argument('recipename', help='Recipe to build')
     parser_build.add_argument('-s', '--disable-parallel-make', action="store_true", help='Disable make parallelism')
     parser_build.set_defaults(func=build)
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/build_image.py b/import-layers/yocto-poky/scripts/lib/devtool/build_image.py
index ae75511..e581038 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/build_image.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/build_image.py
@@ -34,8 +34,8 @@
     result = []
     for recipe in workspace:
         data = parse_recipe(config, tinfoil, recipe, True)
-        if 'class-target' in data.getVar('OVERRIDES', True).split(':'):
-            if recipe in data.getVar('PACKAGES', True).split():
+        if 'class-target' in data.getVar('OVERRIDES').split(':'):
+            if recipe in data.getVar('PACKAGES').split():
                 result.append(recipe)
             else:
                 logger.warning("Skipping recipe %s as it doesn't produce a "
@@ -95,7 +95,7 @@
             raise TargetNotImageError()
 
         # Get the actual filename used and strip the .bb and full path
-        target_basename = rd.getVar('FILE', True)
+        target_basename = rd.getVar('FILE')
         target_basename = os.path.splitext(os.path.basename(target_basename))[0]
         config.set('SDK', 'target_basename', target_basename)
         config.write()
@@ -132,9 +132,9 @@
                             afile.write('%s\n' % line)
 
             if task in ['populate_sdk', 'populate_sdk_ext']:
-                outputdir = rd.getVar('SDK_DEPLOY', True)
+                outputdir = rd.getVar('SDK_DEPLOY')
             else:
-                outputdir = rd.getVar('DEPLOY_DIR_IMAGE', True)
+                outputdir = rd.getVar('DEPLOY_DIR_IMAGE')
 
             tmp_tinfoil = tinfoil
             tinfoil = None
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/deploy.py b/import-layers/yocto-poky/scripts/lib/devtool/deploy.py
index c4c7bf6..b3730ae 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/deploy.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/deploy.py
@@ -156,11 +156,11 @@
     tinfoil = setup_tinfoil(basepath=basepath)
     try:
         try:
-            rd = oe.recipeutils.parse_recipe_simple(tinfoil.cooker, args.recipename, tinfoil.config_data)
+            rd = tinfoil.parse_recipe(args.recipename)
         except Exception as e:
             raise DevtoolError('Exception parsing recipe %s: %s' %
                             (args.recipename, e))
-        recipe_outdir = rd.getVar('D', True)
+        recipe_outdir = rd.getVar('D')
         if not os.path.exists(recipe_outdir) or not os.listdir(recipe_outdir):
             raise DevtoolError('No files to deploy - have you built the %s '
                             'recipe? If so, the install step has not installed '
@@ -192,6 +192,14 @@
         if not args.show_status:
             extraoptions += ' -q'
 
+        scp_port = ''
+        ssh_port = ''
+        if not args.port:
+            raise DevtoolError("If you specify -P/--port then you must provide the port to be used to connect to the target")
+        else:
+            scp_port = "-P %s" % args.port
+            ssh_port = "-p %s" % args.port
+
         # In order to delete previously deployed files and have the manifest file on
         # the target, we write out a shell script and then copy it to the target
         # so we can then run it (piping tar output to it).
@@ -213,7 +221,7 @@
                 for fpath, fsize in filelist:
                     f.write('%s %d\n' % (fpath, fsize))
             # Copy them to the target
-            ret = subprocess.call("scp %s %s/* %s:%s" % (extraoptions, tmpdir, args.target, os.path.dirname(tmpscript)), shell=True)
+            ret = subprocess.call("scp %s %s %s/* %s:%s" % (scp_port, extraoptions, tmpdir, args.target, os.path.dirname(tmpscript)), shell=True)
             if ret != 0:
                 raise DevtoolError('Failed to copy script to %s - rerun with -s to '
                                 'get a complete error message' % args.target)
@@ -221,7 +229,7 @@
             shutil.rmtree(tmpdir)
 
         # Now run the script
-        ret = exec_fakeroot(rd, 'tar cf - . | ssh %s %s \'sh %s %s %s %s\'' % (extraoptions, args.target, tmpscript, args.recipename, destdir, tmpfilelist), cwd=recipe_outdir, shell=True)
+        ret = exec_fakeroot(rd, 'tar cf - . | ssh  %s %s %s \'sh %s %s %s %s\'' % (ssh_port, extraoptions, args.target, tmpscript, args.recipename, destdir, tmpfilelist), cwd=recipe_outdir, shell=True)
         if ret != 0:
             raise DevtoolError('Deploy failed - rerun with -s to get a complete '
                             'error message')
@@ -251,6 +259,14 @@
     if not args.show_status:
         extraoptions += ' -q'
 
+    scp_port = ''
+    ssh_port = ''
+    if not args.port:
+        raise DevtoolError("If you specify -P/--port then you must provide the port to be used to connect to the target")
+    else:
+        scp_port = "-P %s" % args.port
+        ssh_port = "-p %s" % args.port
+
     args.target = args.target.split(':')[0]
 
     tmpdir = tempfile.mkdtemp(prefix='devtool')
@@ -261,7 +277,7 @@
         with open(os.path.join(tmpdir, os.path.basename(tmpscript)), 'w') as f:
             f.write(shellscript)
         # Copy it to the target
-        ret = subprocess.call("scp %s %s/* %s:%s" % (extraoptions, tmpdir, args.target, os.path.dirname(tmpscript)), shell=True)
+        ret = subprocess.call("scp %s %s %s/* %s:%s" % (scp_port, extraoptions, tmpdir, args.target, os.path.dirname(tmpscript)), shell=True)
         if ret != 0:
             raise DevtoolError('Failed to copy script to %s - rerun with -s to '
                                 'get a complete error message' % args.target)
@@ -269,7 +285,7 @@
         shutil.rmtree(tmpdir)
 
     # Now run the script
-    ret = subprocess.call('ssh %s %s \'sh %s %s\'' % (extraoptions, args.target, tmpscript, args.recipename), shell=True)
+    ret = subprocess.call('ssh %s %s %s \'sh %s %s\'' % (ssh_port, extraoptions, args.target, tmpscript, args.recipename), shell=True)
     if ret != 0:
         raise DevtoolError('Undeploy failed - rerun with -s to get a complete '
                            'error message')
@@ -292,6 +308,7 @@
     parser_deploy.add_argument('-n', '--dry-run', help='List files to be deployed only', action='store_true')
     parser_deploy.add_argument('-p', '--no-preserve', help='Do not preserve existing files', action='store_true')
     parser_deploy.add_argument('--no-check-space', help='Do not check for available space before deploying', action='store_true')
+    parser_deploy.add_argument('-P', '--port', default='22', help='Port to use for connection to the target')
     parser_deploy.set_defaults(func=deploy)
 
     parser_undeploy = subparsers.add_parser('undeploy-target',
@@ -304,4 +321,5 @@
     parser_undeploy.add_argument('-s', '--show-status', help='Show progress/status output', action='store_true')
     parser_undeploy.add_argument('-a', '--all', help='Undeploy all recipes deployed on the target', action='store_true')
     parser_undeploy.add_argument('-n', '--dry-run', help='List files to be undeployed only', action='store_true')
+    parser_undeploy.add_argument('-P', '--port', default='22', help='Port to use for connection to the target')
     parser_undeploy.set_defaults(func=undeploy)
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/package.py b/import-layers/yocto-poky/scripts/lib/devtool/package.py
index afb5809..af9e8f1 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/package.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/package.py
@@ -28,15 +28,13 @@
     """Entry point for the devtool 'package' subcommand"""
     check_workspace_recipe(workspace, args.recipename)
 
-    tinfoil = setup_tinfoil(basepath=basepath)
+    tinfoil = setup_tinfoil(basepath=basepath, config_only=True)
     try:
-        tinfoil.prepare(config_only=True)
-
         image_pkgtype = config.get('Package', 'image_pkgtype', '')
         if not image_pkgtype:
-            image_pkgtype = tinfoil.config_data.getVar('IMAGE_PKGTYPE', True)
+            image_pkgtype = tinfoil.config_data.getVar('IMAGE_PKGTYPE')
 
-        deploy_dir_pkg = tinfoil.config_data.getVar('DEPLOY_DIR_%s' % image_pkgtype.upper(), True)
+        deploy_dir_pkg = tinfoil.config_data.getVar('DEPLOY_DIR_%s' % image_pkgtype.upper())
     finally:
         tinfoil.shutdown()
 
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/runqemu.py b/import-layers/yocto-poky/scripts/lib/devtool/runqemu.py
index ae25cee..e26cf28 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/runqemu.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/runqemu.py
@@ -31,8 +31,10 @@
 
     tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
     try:
-        machine = tinfoil.config_data.getVar('MACHINE', True)
-        bindir_native = tinfoil.config_data.getVar('STAGING_BINDIR_NATIVE', True)
+        machine = tinfoil.config_data.getVar('MACHINE')
+        bindir_native = os.path.join(tinfoil.config_data.getVar('STAGING_DIR'),
+                                     tinfoil.config_data.getVar('BUILD_ARCH'),
+                                     tinfoil.config_data.getVar('bindir_native').lstrip(os.path.sep))
     finally:
         tinfoil.shutdown()
 
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/sdk.py b/import-layers/yocto-poky/scripts/lib/devtool/sdk.py
index 922277b..e8bf0ad 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/sdk.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/sdk.py
@@ -132,9 +132,9 @@
     # Grab variable values
     tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
     try:
-        stamps_dir = tinfoil.config_data.getVar('STAMPS_DIR', True)
-        sstate_mirrors = tinfoil.config_data.getVar('SSTATE_MIRRORS', True)
-        site_conf_version = tinfoil.config_data.getVar('SITE_CONF_VERSION', True)
+        stamps_dir = tinfoil.config_data.getVar('STAMPS_DIR')
+        sstate_mirrors = tinfoil.config_data.getVar('SSTATE_MIRRORS')
+        site_conf_version = tinfoil.config_data.getVar('SITE_CONF_VERSION')
     finally:
         tinfoil.shutdown()
 
@@ -273,7 +273,7 @@
             rd = parse_recipe(config, tinfoil, recipe, True)
             if not rd:
                 return 1
-            stampprefixes[recipe] = '%s.%s' % (rd.getVar('STAMP', True), tasks[0])
+            stampprefixes[recipe] = '%s.%s' % (rd.getVar('STAMP'), tasks[0])
             if checkstamp(recipe):
                 logger.info('%s is already installed' % recipe)
             else:
@@ -306,6 +306,12 @@
         if failed:
             return 2
 
+        try:
+            exec_build_env_command(config.init_path, basepath, 'bitbake build-sysroots', watch=True)
+        except bb.process.ExecutionError as e:
+            raise DevtoolError('Failed to bitbake build-sysroots:\n%s' % (str(e)))
+
+
 def register_commands(subparsers, context):
     """Register devtool subcommands from the sdk plugin"""
     if context.fixed_setup:
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/search.py b/import-layers/yocto-poky/scripts/lib/devtool/search.py
index b44bed7..054985b 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/search.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/search.py
@@ -31,7 +31,7 @@
 
     tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
     try:
-        pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR', True)
+        pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
         defsummary = tinfoil.config_data.getVar('SUMMARY', False) or ''
 
         keyword_rc = re.compile(args.keyword)
@@ -70,7 +70,7 @@
 
             if match:
                 rd = parse_recipe(config, tinfoil, fn, True)
-                summary = rd.getVar('SUMMARY', True)
+                summary = rd.getVar('SUMMARY')
                 if summary == rd.expand(defsummary):
                     summary = ''
                 print("%s  %s" % (fn.ljust(20), summary))
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/standard.py b/import-layers/yocto-poky/scripts/lib/devtool/standard.py
index 4eff6f8..5ff1e23 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/standard.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/standard.py
@@ -150,25 +150,32 @@
         extracmdopts += ' --src-subdir "%s"' % args.src_subdir
     if args.autorev:
         extracmdopts += ' -a'
+    if args.fetch_dev:
+        extracmdopts += ' --fetch-dev'
 
     tempdir = tempfile.mkdtemp(prefix='devtool')
     try:
+        builtnpm = False
         while True:
             try:
-                stdout, _ = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s "%s" %s' % (color, tempdir, source, extracmdopts))
+                stdout, _ = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create --devtool -o %s \'%s\' %s' % (color, tempdir, source, extracmdopts), watch=True)
             except bb.process.ExecutionError as e:
                 if e.exitcode == 14:
+                    if builtnpm:
+                        raise DevtoolError('Re-running recipetool still failed to find npm')
                     # FIXME this is a horrible hack that is unfortunately
                     # necessary due to the fact that we can't run bitbake from
                     # inside recipetool since recipetool keeps tinfoil active
                     # with references to it throughout the code, so we have
                     # to exit out and come back here to do it.
-                    ensure_npm(config, basepath, args.fixed_setup)
+                    ensure_npm(config, basepath, args.fixed_setup, check_exists=False)
+                    logger.info('Re-running recipe creation process after building nodejs')
+                    builtnpm = True
                     continue
                 elif e.exitcode == 15:
                     raise DevtoolError('Could not auto-determine recipe name, please specify it on the command line')
                 else:
-                    raise DevtoolError('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
+                    raise DevtoolError('Command \'%s\' failed' % e.command)
             break
 
         recipes = glob.glob(os.path.join(tempdir, '*.bb'))
@@ -223,8 +230,17 @@
 
     tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
     try:
-        rd = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, None)
+        try:
+            rd = tinfoil.parse_recipe_file(recipefile, False)
+        except Exception as e:
+            logger.error(str(e))
+            rd = None
         if not rd:
+            # Parsing failed. We just created this recipe and we shouldn't
+            # leave it in the workdir or it'll prevent bitbake from starting
+            movefn = '%s.parsefailed' % recipefile
+            logger.error('Parsing newly created recipe failed, moving recipe to %s for reference. If this looks to be caused by the recipe itself, please report this error.' % movefn)
+            shutil.move(recipefile, movefn)
             return 1
 
         if args.fetchuri and not args.no_git:
@@ -302,7 +318,7 @@
         raise DevtoolError("The %s recipe is a meta-recipe, and therefore is "
                            "not supported by this tool" % pn, 4)
 
-    if bb.data.inherits_class('externalsrc', d) and d.getVar('EXTERNALSRC', True):
+    if bb.data.inherits_class('externalsrc', d) and d.getVar('EXTERNALSRC'):
         # Not an incompatibility error per se, so we don't pass the error code
         raise DevtoolError("externalsrc is currently enabled for the %s "
                            "recipe. This prevents the normal do_patch task "
@@ -331,10 +347,11 @@
         cmd.append('-r')
     out, _ = bb.process.run(cmd, cwd=repodir)
     ret = {}
-    for line in out.split('\0'):
-        if line:
-            split = line.split(None, 4)
-            ret[split[3]] = split[0:3]
+    if out:
+        for line in out.split('\0'):
+            if line:
+                split = line.split(None, 4)
+                ret[split[3]] = split[0:3]
     return ret
 
 def _git_exclude_path(srctree, path):
@@ -376,7 +393,7 @@
             return 1
 
         srctree = os.path.abspath(args.srctree)
-        initial_rev = _extract_source(srctree, args.keep_temp, args.branch, False, rd)
+        initial_rev = _extract_source(srctree, args.keep_temp, args.branch, False, rd, tinfoil)
         logger.info('Source tree extracted to %s' % srctree)
 
         if initial_rev:
@@ -400,7 +417,7 @@
             return 1
 
         srctree = os.path.abspath(args.srctree)
-        initial_rev = _extract_source(srctree, args.keep_temp, args.branch, True, rd)
+        initial_rev = _extract_source(srctree, args.keep_temp, args.branch, True, rd, tinfoil)
         logger.info('Source tree %s synchronized' % srctree)
 
         if initial_rev:
@@ -410,70 +427,6 @@
     finally:
         tinfoil.shutdown()
 
-class BbTaskExecutor(object):
-    """Class for executing bitbake tasks for a recipe
-
-    FIXME: This is very awkward. Unfortunately it's not currently easy to
-    properly execute tasks outside of bitbake itself, until then this has to
-    suffice if we are to handle e.g. linux-yocto's extra tasks
-    """
-
-    def __init__(self, rdata):
-        self.rdata = rdata
-        self.executed = []
-
-    def exec_func(self, func, report):
-        """Run bitbake task function"""
-        if not func in self.executed:
-            deps = self.rdata.getVarFlag(func, 'deps', False)
-            if deps:
-                for taskdepfunc in deps:
-                    self.exec_func(taskdepfunc, True)
-            if report:
-                logger.info('Executing %s...' % func)
-            fn = self.rdata.getVar('FILE', True)
-            localdata = bb.build._task_data(fn, func, self.rdata)
-            try:
-                bb.build.exec_func(func, localdata)
-            except bb.build.FuncFailed as e:
-                raise DevtoolError(str(e))
-            self.executed.append(func)
-
-
-class PatchTaskExecutor(BbTaskExecutor):
-    def __init__(self, rdata):
-        import oe.patch
-        self.check_git = False
-        self.useroptions = []
-        oe.patch.GitApplyTree.gitCommandUserOptions(self.useroptions, d=rdata)
-        super(PatchTaskExecutor, self).__init__(rdata)
-
-    def exec_func(self, func, report):
-        from oe.patch import GitApplyTree
-        srcsubdir = self.rdata.getVar('S', True)
-        haspatches = False
-        if func == 'do_patch':
-            patchdir = os.path.join(srcsubdir, 'patches')
-            if os.path.exists(patchdir):
-                if os.listdir(patchdir):
-                    haspatches = True
-                else:
-                    os.rmdir(patchdir)
-
-        super(PatchTaskExecutor, self).exec_func(func, report)
-        if self.check_git and os.path.exists(srcsubdir):
-            if func == 'do_patch':
-                if os.path.exists(patchdir):
-                    shutil.rmtree(patchdir)
-                    if haspatches:
-                        stdout, _ = bb.process.run('git status --porcelain patches', cwd=srcsubdir)
-                        if stdout:
-                            bb.process.run('git checkout patches', cwd=srcsubdir)
-
-            stdout, _ = bb.process.run('git status --porcelain', cwd=srcsubdir)
-            if stdout:
-                bb.process.run('git add .; git %s commit -a -m "Committing changes from %s\n\n%s"' % (' '.join(self.useroptions), func, GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir)
-
 
 def _prep_extract_operation(config, basepath, recipename, tinfoil=None):
     """HACK: Ugly workaround for making sure that requirements are met when
@@ -497,22 +450,11 @@
     return tinfoil
 
 
-def _extract_source(srctree, keep_temp, devbranch, sync, d):
+def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
     """Extract sources of a recipe"""
-    import bb.event
     import oe.recipeutils
 
-    def eventfilter(name, handler, event, d):
-        """Bitbake event filter for devtool extract operation"""
-        if name == 'base_eventhandler':
-            return True
-        else:
-            return False
-
-    if hasattr(bb.event, 'set_eventfilter'):
-        bb.event.set_eventfilter(eventfilter)
-
-    pn = d.getVar('PN', True)
+    pn = d.getVar('PN')
 
     _check_compatible_recipe(pn, d)
 
@@ -537,45 +479,92 @@
         bb.utils.mkdirhier(srctree)
         os.rmdir(srctree)
 
-    # We don't want notes to be printed, they are too verbose
-    origlevel = bb.logger.getEffectiveLevel()
-    if logger.getEffectiveLevel() > logging.DEBUG:
-        bb.logger.setLevel(logging.WARNING)
-
     initial_rev = None
-    tempdir = tempfile.mkdtemp(prefix='devtool')
+    # We need to redirect WORKDIR, STAMPS_DIR etc. under a temporary
+    # directory so that:
+    # (a) we pick up all files that get unpacked to the WORKDIR, and
+    # (b) we don't disturb the existing build
+    # However, with recipe-specific sysroots the sysroots for the recipe
+    # will be prepared under WORKDIR, and if we used the system temporary
+    # directory (i.e. usually /tmp) as used by mkdtemp by default, then
+    # our attempts to hardlink files into the recipe-specific sysroots
+    # will fail on systems where /tmp is a different filesystem, and it
+    # would have to fall back to copying the files which is a waste of
+    # time. Put the temp directory under the WORKDIR to prevent that from
+    # being a problem.
+    tempbasedir = d.getVar('WORKDIR')
+    bb.utils.mkdirhier(tempbasedir)
+    tempdir = tempfile.mkdtemp(prefix='devtooltmp-', dir=tempbasedir)
     try:
+        tinfoil.logger.setLevel(logging.WARNING)
+
         crd = d.createCopy()
         # Make a subdir so we guard against WORKDIR==S
         workdir = os.path.join(tempdir, 'workdir')
         crd.setVar('WORKDIR', workdir)
-        crd.setVar('T', os.path.join(tempdir, 'temp'))
-        if not crd.getVar('S', True).startswith(workdir):
+        if not crd.getVar('S').startswith(workdir):
             # Usually a shared workdir recipe (kernel, gcc)
             # Try to set a reasonable default
             if bb.data.inherits_class('kernel', d):
                 crd.setVar('S', '${WORKDIR}/source')
             else:
-                crd.setVar('S', '${WORKDIR}/%s' % os.path.basename(d.getVar('S', True)))
+                crd.setVar('S', '${WORKDIR}/%s' % os.path.basename(d.getVar('S')))
         if bb.data.inherits_class('kernel', d):
             # We don't want to move the source to STAGING_KERNEL_DIR here
             crd.setVar('STAGING_KERNEL_DIR', '${S}')
 
-        task_executor = PatchTaskExecutor(crd)
+        is_kernel_yocto = bb.data.inherits_class('kernel-yocto', d)
+        if not is_kernel_yocto:
+            crd.setVar('PATCHTOOL', 'git')
+            crd.setVar('PATCH_COMMIT_FUNCTIONS', '1')
 
-        crd.setVar('EXTERNALSRC_forcevariable', '')
+        # Apply our changes to the datastore to the server's datastore
+        for key in crd.localkeys():
+            tinfoil.config_data.setVar('%s_pn-%s' % (key, pn), crd.getVar(key, False))
 
-        logger.info('Fetching %s...' % pn)
-        task_executor.exec_func('do_fetch', False)
-        logger.info('Unpacking...')
-        task_executor.exec_func('do_unpack', False)
+        tinfoil.config_data.setVar('STAMPS_DIR', os.path.join(tempdir, 'stamps'))
+        tinfoil.config_data.setVar('T', os.path.join(tempdir, 'temp'))
+        tinfoil.config_data.setVar('BUILDCFG_FUNCS', '')
+        tinfoil.config_data.setVar('BUILDCFG_HEADER', '')
+        tinfoil.config_data.setVar('BB_HASH_IGNORE_MISMATCH', '1')
+
+        tinfoil.set_event_mask(['bb.event.BuildStarted',
+                                'bb.event.BuildCompleted',
+                                'logging.LogRecord',
+                                'bb.command.CommandCompleted',
+                                'bb.command.CommandFailed',
+                                'bb.build.TaskStarted',
+                                'bb.build.TaskSucceeded',
+                                'bb.build.TaskFailed',
+                                'bb.build.TaskFailedSilent'])
+
+        def runtask(target, task):
+            if tinfoil.build_file(target, task):
+                while True:
+                    event = tinfoil.wait_event(0.25)
+                    if event:
+                        if isinstance(event, bb.command.CommandCompleted):
+                            break
+                        elif isinstance(event, bb.command.CommandFailed):
+                            raise DevtoolError('Task do_%s failed: %s' % (task, event.error))
+                        elif isinstance(event, bb.build.TaskFailed):
+                            raise DevtoolError('Task do_%s failed' % task)
+                        elif isinstance(event, bb.build.TaskStarted):
+                            logger.info('Executing %s...' % event._task)
+                        elif isinstance(event, logging.LogRecord):
+                            if event.levelno <= logging.INFO:
+                                continue
+                            logger.handle(event)
+
+        # we need virtual:native:/path/to/recipe if it's a BBCLASSEXTEND
+        fn = tinfoil.get_recipe_file(pn)
+        runtask(fn, 'unpack')
+
         if bb.data.inherits_class('kernel-yocto', d):
             # Extra step for kernel to populate the source directory
-            logger.info('Doing kernel checkout...')
-            task_executor.exec_func('do_kernel_checkout', False)
-        srcsubdir = crd.getVar('S', True)
+            runtask(fn, 'kernel_checkout')
 
-        task_executor.check_git = True
+        srcsubdir = crd.getVar('S')
 
         # Move local source files into separate subdir
         recipe_patches = [os.path.basename(patch) for patch in
@@ -605,7 +594,7 @@
                          os.path.basename(fname) not in recipe_patches]
             # Force separate S so that patch files can be left out from srctree
             srcsubdir = tempfile.mkdtemp(dir=workdir)
-            crd.setVar('S', srcsubdir)
+            tinfoil.config_data.setVar('S_task-patch', srcsubdir)
             # Move source files to S
             for path in src_files:
                 _move_file(os.path.join(workdir, path),
@@ -623,15 +612,13 @@
                            "doesn't use any source or the correct source "
                            "directory could not be determined" % pn)
 
-        setup_git_repo(srcsubdir, crd.getVar('PV', True), devbranch, d=d)
+        setup_git_repo(srcsubdir, crd.getVar('PV'), devbranch, d=d)
 
         (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
         initial_rev = stdout.rstrip()
 
-        crd.setVar('PATCHTOOL', 'git')
-
         logger.info('Patching...')
-        task_executor.exec_func('do_patch', False)
+        runtask(fn, 'patch')
 
         bb.process.run('git tag -f devtool-patched', cwd=srcsubdir)
 
@@ -639,8 +626,8 @@
         if bb.data.inherits_class('kernel-yocto', d):
             # Store generate and store kernel config
             logger.info('Generating kernel config')
-            task_executor.exec_func('do_configure', False)
-            kconfig = os.path.join(crd.getVar('B', True), '.config')
+            runtask(fn, 'configure')
+            kconfig = os.path.join(crd.getVar('B'), '.config')
 
 
         tempdir_localdir = os.path.join(tempdir, 'oe-local-files')
@@ -672,13 +659,34 @@
 
             shutil.move(srcsubdir, srctree)
 
+            if os.path.abspath(d.getVar('S')) == os.path.abspath(d.getVar('WORKDIR')):
+                # If recipe extracts to ${WORKDIR}, symlink the files into the srctree
+                # (otherwise the recipe won't build as expected)
+                local_files_dir = os.path.join(srctree, 'oe-local-files')
+                addfiles = []
+                for root, _, files in os.walk(local_files_dir):
+                    relpth = os.path.relpath(root, local_files_dir)
+                    if relpth != '.':
+                        bb.utils.mkdirhier(os.path.join(srctree, relpth))
+                    for fn in files:
+                        if fn == '.gitignore':
+                            continue
+                        destpth = os.path.join(srctree, relpth, fn)
+                        if os.path.exists(destpth):
+                            os.unlink(destpth)
+                        os.symlink('oe-local-files/%s' % fn, destpth)
+                        addfiles.append(os.path.join(relpth, fn))
+                if addfiles:
+                    bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree)
+                useroptions = []
+                oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d)
+                bb.process.run('git %s commit -a -m "Committing local file symlinks\n\n%s"' % (' '.join(useroptions), oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
+
         if kconfig:
             logger.info('Copying kernel config to srctree')
             shutil.copy2(kconfig, srctree)
 
     finally:
-        bb.logger.setLevel(origlevel)
-
         if keep_temp:
             logger.info('Preserving temporary directory %s' % tempdir)
         else:
@@ -748,7 +756,7 @@
         if not rd:
             return 1
 
-        pn = rd.getVar('PN', True)
+        pn = rd.getVar('PN')
         if pn != args.recipename:
             logger.info('Mapping %s to %s' % (args.recipename, pn))
         if pn in workspace:
@@ -769,8 +777,10 @@
             if not tinfoil:
                 # Error already shown
                 return 1
+            # We need to re-parse because tinfoil may have been re-initialised
+            rd = parse_recipe(config, tinfoil, args.recipename, True)
 
-        recipefile = rd.getVar('FILE', True)
+        recipefile = rd.getVar('FILE')
         appendfile = recipe_to_append(recipefile, config, args.wildcard)
         if os.path.exists(appendfile):
             raise DevtoolError("Another variant of recipe %s is already in your "
@@ -783,7 +793,7 @@
         initial_rev = None
         commits = []
         if not args.no_extract:
-            initial_rev = _extract_source(srctree, False, args.branch, False, rd)
+            initial_rev = _extract_source(srctree, args.keep_temp, args.branch, False, rd, tinfoil)
             if not initial_rev:
                 return 1
             logger.info('Source tree extracted to %s' % srctree)
@@ -807,8 +817,8 @@
                     initial_rev = stdout.rstrip()
 
         # Check that recipe isn't using a shared workdir
-        s = os.path.abspath(rd.getVar('S', True))
-        workdir = os.path.abspath(rd.getVar('WORKDIR', True))
+        s = os.path.abspath(rd.getVar('S'))
+        workdir = os.path.abspath(rd.getVar('WORKDIR'))
         if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir:
             # Handle if S is set to a subdirectory of the source
             srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
@@ -851,6 +861,199 @@
 
     return 0
 
+
+def rename(args, config, basepath, workspace):
+    """Entry point for the devtool 'rename' subcommand"""
+    import bb
+    import oe.recipeutils
+
+    check_workspace_recipe(workspace, args.recipename)
+
+    if not (args.newname or args.version):
+        raise DevtoolError('You must specify a new name, a version with -V/--version, or both')
+
+    recipefile = workspace[args.recipename]['recipefile']
+    if not recipefile:
+        raise DevtoolError('devtool rename can only be used where the recipe file itself is in the workspace (e.g. after devtool add)')
+
+    if args.newname and args.newname != args.recipename:
+        reason = oe.recipeutils.validate_pn(args.newname)
+        if reason:
+            raise DevtoolError(reason)
+        newname = args.newname
+    else:
+        newname = args.recipename
+
+    append = workspace[args.recipename]['bbappend']
+    appendfn = os.path.splitext(os.path.basename(append))[0]
+    splitfn = appendfn.split('_')
+    if len(splitfn) > 1:
+        origfnver = appendfn.split('_')[1]
+    else:
+        origfnver = ''
+
+    recipefilemd5 = None
+    tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+    try:
+        rd = parse_recipe(config, tinfoil, args.recipename, True)
+        if not rd:
+            return 1
+
+        bp = rd.getVar('BP')
+        bpn = rd.getVar('BPN')
+        if newname != args.recipename:
+            localdata = rd.createCopy()
+            localdata.setVar('PN', newname)
+            newbpn = localdata.getVar('BPN')
+        else:
+            newbpn = bpn
+        s = rd.getVar('S', False)
+        src_uri = rd.getVar('SRC_URI', False)
+        pv = rd.getVar('PV')
+
+        # Correct variable values that refer to the upstream source - these
+        # values must stay the same, so if the name/version are changing then
+        # we need to fix them up
+        new_s = s
+        new_src_uri = src_uri
+        if newbpn != bpn:
+            # ${PN} here is technically almost always incorrect, but people do use it
+            new_s = new_s.replace('${BPN}', bpn)
+            new_s = new_s.replace('${PN}', bpn)
+            new_s = new_s.replace('${BP}', '%s-${PV}' % bpn)
+            new_src_uri = new_src_uri.replace('${BPN}', bpn)
+            new_src_uri = new_src_uri.replace('${PN}', bpn)
+            new_src_uri = new_src_uri.replace('${BP}', '%s-${PV}' % bpn)
+        if args.version and origfnver == pv:
+            new_s = new_s.replace('${PV}', pv)
+            new_s = new_s.replace('${BP}', '${BPN}-%s' % pv)
+            new_src_uri = new_src_uri.replace('${PV}', pv)
+            new_src_uri = new_src_uri.replace('${BP}', '${BPN}-%s' % pv)
+        patchfields = {}
+        if new_s != s:
+            patchfields['S'] = new_s
+        if new_src_uri != src_uri:
+            patchfields['SRC_URI'] = new_src_uri
+        if patchfields:
+            recipefilemd5 = bb.utils.md5_file(recipefile)
+            oe.recipeutils.patch_recipe(rd, recipefile, patchfields)
+            newrecipefilemd5 = bb.utils.md5_file(recipefile)
+    finally:
+        tinfoil.shutdown()
+
+    if args.version:
+        newver = args.version
+    else:
+        newver = origfnver
+
+    if newver:
+        newappend = '%s_%s.bbappend' % (newname, newver)
+        newfile =  '%s_%s.bb' % (newname, newver)
+    else:
+        newappend = '%s.bbappend' % newname
+        newfile = '%s.bb' % newname
+
+    oldrecipedir = os.path.dirname(recipefile)
+    newrecipedir = os.path.join(config.workspace_path, 'recipes', newname)
+    if oldrecipedir != newrecipedir:
+        bb.utils.mkdirhier(newrecipedir)
+
+    newappend = os.path.join(os.path.dirname(append), newappend)
+    newfile = os.path.join(newrecipedir, newfile)
+
+    # Rename bbappend
+    logger.info('Renaming %s to %s' % (append, newappend))
+    os.rename(append, newappend)
+    # Rename recipe file
+    logger.info('Renaming %s to %s' % (recipefile, newfile))
+    os.rename(recipefile, newfile)
+
+    # Rename source tree if it's the default path
+    appendmd5 = None
+    if not args.no_srctree:
+        srctree = workspace[args.recipename]['srctree']
+        if os.path.abspath(srctree) == os.path.join(config.workspace_path, 'sources', args.recipename):
+            newsrctree = os.path.join(config.workspace_path, 'sources', newname)
+            logger.info('Renaming %s to %s' % (srctree, newsrctree))
+            shutil.move(srctree, newsrctree)
+            # Correct any references (basically EXTERNALSRC*) in the .bbappend
+            appendmd5 = bb.utils.md5_file(newappend)
+            appendlines = []
+            with open(newappend, 'r') as f:
+                for line in f:
+                    appendlines.append(line)
+            with open(newappend, 'w') as f:
+                for line in appendlines:
+                    if srctree in line:
+                        line = line.replace(srctree, newsrctree)
+                    f.write(line)
+            newappendmd5 = bb.utils.md5_file(newappend)
+
+    bpndir = None
+    newbpndir = None
+    if newbpn != bpn:
+        bpndir = os.path.join(oldrecipedir, bpn)
+        if os.path.exists(bpndir):
+            newbpndir = os.path.join(newrecipedir, newbpn)
+            logger.info('Renaming %s to %s' % (bpndir, newbpndir))
+            shutil.move(bpndir, newbpndir)
+
+    bpdir = None
+    newbpdir = None
+    if newver != origfnver or newbpn != bpn:
+        bpdir = os.path.join(oldrecipedir, bp)
+        if os.path.exists(bpdir):
+            newbpdir = os.path.join(newrecipedir, '%s-%s' % (newbpn, newver))
+            logger.info('Renaming %s to %s' % (bpdir, newbpdir))
+            shutil.move(bpdir, newbpdir)
+
+    if oldrecipedir != newrecipedir:
+        # Move any stray files and delete the old recipe directory
+        for entry in os.listdir(oldrecipedir):
+            oldpath = os.path.join(oldrecipedir, entry)
+            newpath = os.path.join(newrecipedir, entry)
+            logger.info('Renaming %s to %s' % (oldpath, newpath))
+            shutil.move(oldpath, newpath)
+        os.rmdir(oldrecipedir)
+
+    # Now take care of entries in .devtool_md5
+    md5entries = []
+    with open(os.path.join(config.workspace_path, '.devtool_md5'), 'r') as f:
+        for line in f:
+            md5entries.append(line)
+
+    if bpndir and newbpndir:
+        relbpndir = os.path.relpath(bpndir, config.workspace_path) + '/'
+    else:
+        relbpndir = None
+    if bpdir and newbpdir:
+        relbpdir = os.path.relpath(bpdir, config.workspace_path) + '/'
+    else:
+        relbpdir = None
+
+    with open(os.path.join(config.workspace_path, '.devtool_md5'), 'w') as f:
+        for entry in md5entries:
+            splitentry = entry.rstrip().split('|')
+            if len(splitentry) > 2:
+                if splitentry[0] == args.recipename:
+                    splitentry[0] = newname
+                    if splitentry[1] == os.path.relpath(append, config.workspace_path):
+                        splitentry[1] = os.path.relpath(newappend, config.workspace_path)
+                        if appendmd5 and splitentry[2] == appendmd5:
+                            splitentry[2] = newappendmd5
+                    elif splitentry[1] == os.path.relpath(recipefile, config.workspace_path):
+                        splitentry[1] = os.path.relpath(newfile, config.workspace_path)
+                        if recipefilemd5 and splitentry[2] == recipefilemd5:
+                            splitentry[2] = newrecipefilemd5
+                    elif relbpndir and splitentry[1].startswith(relbpndir):
+                        splitentry[1] = os.path.relpath(os.path.join(newbpndir, splitentry[1][len(relbpndir):]), config.workspace_path)
+                    elif relbpdir and splitentry[1].startswith(relbpdir):
+                        splitentry[1] = os.path.relpath(os.path.join(newbpdir, splitentry[1][len(relbpdir):]), config.workspace_path)
+                    entry = '|'.join(splitentry) + '\n'
+            f.write(entry)
+    return 0
+
+
 def _get_patchset_revs(srctree, recipe_path, initial_rev=None):
     """Get initial and update rev of a recipe. These are the start point of the
     whole patchset and start point for the patches to be re-generated/updated.
@@ -909,6 +1112,15 @@
                 break
     return entries, remaining
 
+def _replace_srcuri_entry(srcuri, filename, newentry):
+    """Replace entry corresponding to specified file with a new entry"""
+    basename = os.path.basename(filename)
+    for i in range(len(srcuri)):
+        if os.path.basename(srcuri[i].split(';')[0]) == basename:
+            srcuri.pop(i)
+            srcuri.insert(i, newentry)
+            break
+
 def _remove_source_files(append, files, destpath):
     """Unlink existing patch files"""
     for path in files:
@@ -933,7 +1145,7 @@
                     raise
 
 
-def _export_patches(srctree, rd, start_rev, destdir):
+def _export_patches(srctree, rd, start_rev, destdir, changed_revs=None):
     """Export patches from srctree to given location.
        Returns three-tuple of dicts:
          1. updated - patches that already exist in SRCURI
@@ -962,18 +1174,44 @@
         # revision This does assume that people are using unique shortlog
         # values, but they ought to be anyway...
         new_basename = seqpatch_re.match(new_patch).group(2)
-        found = False
+        match_name = None
         for old_patch in existing_patches:
             old_basename = seqpatch_re.match(old_patch).group(2)
-            if new_basename == old_basename:
-                updated[new_patch] = existing_patches.pop(old_patch)
-                found = True
-                # Rename patch files
-                if new_patch != old_patch:
-                    os.rename(os.path.join(destdir, new_patch),
-                              os.path.join(destdir, old_patch))
+            old_basename_splitext = os.path.splitext(old_basename)
+            if old_basename.endswith(('.gz', '.bz2', '.Z')) and old_basename_splitext[0] == new_basename:
+                old_patch_noext = os.path.splitext(old_patch)[0]
+                match_name = old_patch_noext
                 break
-        if not found:
+            elif new_basename == old_basename:
+                match_name = old_patch
+                break
+        if match_name:
+            # Rename patch files
+            if new_patch != match_name:
+                os.rename(os.path.join(destdir, new_patch),
+                          os.path.join(destdir, match_name))
+            # Need to pop it off the list now before checking changed_revs
+            oldpath = existing_patches.pop(old_patch)
+            if changed_revs is not None:
+                # Avoid updating patches that have not actually changed
+                with open(os.path.join(destdir, match_name), 'r') as f:
+                    firstlineitems = f.readline().split()
+                    # Looking for "From <hash>" line
+                    if len(firstlineitems) > 1 and len(firstlineitems[1]) == 40:
+                        if not firstlineitems[1] in changed_revs:
+                            continue
+            # Recompress if necessary
+            if oldpath.endswith(('.gz', '.Z')):
+                bb.process.run(['gzip', match_name], cwd=destdir)
+                if oldpath.endswith('.gz'):
+                    match_name += '.gz'
+                else:
+                    match_name += '.Z'
+            elif oldpath.endswith('.bz2'):
+                bb.process.run(['bzip2', match_name], cwd=destdir)
+                match_name += '.bz2'
+            updated[match_name] = oldpath
+        else:
             added[new_patch] = None
     return (updated, added, existing_patches)
 
@@ -991,7 +1229,7 @@
         stdout, stderr = pipe.communicate()
         if pipe.returncode == 1:
             logger.info("Updating config fragment %s" % outfile)
-            with open(outfile, 'w') as fobj:
+            with open(outfile, 'wb') as fobj:
                 fobj.write(stdout)
         elif pipe.returncode == 0:
             logger.info("Would remove config fragment %s" % outfile)
@@ -1072,8 +1310,8 @@
             elif fname != '.gitignore':
                 added[fname] = None
 
-        workdir = rd.getVar('WORKDIR', True)
-        s = rd.getVar('S', True)
+        workdir = rd.getVar('WORKDIR')
+        s = rd.getVar('S')
         if not s.endswith(os.sep):
             s += os.sep
 
@@ -1095,14 +1333,14 @@
 
 def _determine_files_dir(rd):
     """Determine the appropriate files directory for a recipe"""
-    recipedir = rd.getVar('FILE_DIRNAME', True)
-    for entry in rd.getVar('FILESPATH', True).split(':'):
+    recipedir = rd.getVar('FILE_DIRNAME')
+    for entry in rd.getVar('FILESPATH').split(':'):
         relpth = os.path.relpath(entry, recipedir)
         if not os.sep in relpth:
             # One (or zero) levels below only, so we don't put anything in machine-specific directories
             if os.path.isdir(entry):
                 return entry
-    return os.path.join(recipedir, rd.getVar('BPN', True))
+    return os.path.join(recipedir, rd.getVar('BPN'))
 
 
 def _update_recipe_srcrev(srctree, rd, appendlayerdir, wildcard_version, no_remove):
@@ -1110,7 +1348,7 @@
     import bb
     import oe.recipeutils
 
-    recipefile = rd.getVar('FILE', True)
+    recipefile = rd.getVar('FILE')
     logger.info('Updating SRCREV in recipe %s' % os.path.basename(recipefile))
 
     # Get HEAD revision
@@ -1192,7 +1430,7 @@
     import bb
     import oe.recipeutils
 
-    recipefile = rd.getVar('FILE', True)
+    recipefile = rd.getVar('FILE')
     append = workspace[recipename]['bbappend']
     if not os.path.exists(append):
         raise DevtoolError('unable to find workspace bbappend for recipe %s' %
@@ -1203,6 +1441,10 @@
         raise DevtoolError('Unable to find initial revision - please specify '
                            'it with --initial-rev')
 
+    dl_dir = rd.getVar('DL_DIR')
+    if not dl_dir.endswith('/'):
+        dl_dir += '/'
+
     tempdir = tempfile.mkdtemp(prefix='devtool')
     try:
         local_files_dir = tempfile.mkdtemp(dir=tempdir)
@@ -1220,7 +1462,7 @@
         # Get updated patches from source tree
         patches_dir = tempfile.mkdtemp(dir=tempdir)
         upd_p, new_p, del_p = _export_patches(srctree, rd, update_rev,
-                                              patches_dir)
+                                              patches_dir, changed_revs)
         updatefiles = False
         updaterecipe = False
         destpath = None
@@ -1247,6 +1489,7 @@
                 logger.info('No patches or local source files needed updating')
         else:
             # Update existing files
+            files_dir = _determine_files_dir(rd)
             for basepath, path in upd_f.items():
                 logger.info('Updating file %s' % basepath)
                 if os.path.isabs(basepath):
@@ -1258,18 +1501,19 @@
                 updatefiles = True
             for basepath, path in upd_p.items():
                 patchfn = os.path.join(patches_dir, basepath)
-                if changed_revs is not None:
-                    # Avoid updating patches that have not actually changed
-                    with open(patchfn, 'r') as f:
-                        firstlineitems = f.readline().split()
-                        if len(firstlineitems) > 1 and len(firstlineitems[1]) == 40:
-                            if not firstlineitems[1] in changed_revs:
-                                continue
-                logger.info('Updating patch %s' % basepath)
+                if os.path.dirname(path) + '/' == dl_dir:
+                    # This is a a downloaded patch file - we now need to
+                    # replace the entry in SRC_URI with our local version
+                    logger.info('Replacing remote patch %s with updated local version' % basepath)
+                    path = os.path.join(files_dir, basepath)
+                    _replace_srcuri_entry(srcuri, basepath, 'file://%s' % basepath)
+                    updaterecipe = True
+                else:
+                    logger.info('Updating patch %s' % basepath)
+                logger.debug('Moving new patch %s to %s' % (patchfn, path))
                 _move_file(patchfn, path)
                 updatefiles = True
             # Add any new files
-            files_dir = _determine_files_dir(rd)
             for basepath, path in new_f.items():
                 logger.info('Adding new file %s' % basepath)
                 _move_file(os.path.join(local_files_dir, basepath),
@@ -1356,7 +1600,7 @@
         updated = _update_recipe(args.recipename, workspace, rd, args.mode, args.append, args.wildcard_version, args.no_remove, args.initial_rev)
 
         if updated:
-            rf = rd.getVar('FILE', True)
+            rf = rd.getVar('FILE')
             if rf.startswith(config.workspace_path):
                 logger.warn('Recipe file %s has been updated but is inside the workspace - you will need to move it (and any associated files next to it) out to the desired layer before using "devtool reset" in order to keep any changes' % rf)
     finally:
@@ -1460,7 +1704,7 @@
 
 def _get_layer(layername, d):
     """Determine the base layer path for the specified layer name/path"""
-    layerdirs = d.getVar('BBLAYERS', True).split()
+    layerdirs = d.getVar('BBLAYERS').split()
     layers = {os.path.basename(p): p for p in layerdirs}
     # Provide some shortcuts
     if layername.lower() in ['oe-core', 'openembedded-core']:
@@ -1478,6 +1722,7 @@
 
     check_workspace_recipe(workspace, args.recipename)
 
+    no_clean = False
     tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
     try:
         rd = parse_recipe(config, tinfoil, args.recipename, True)
@@ -1485,7 +1730,7 @@
             return 1
 
         destlayerdir = _get_layer(args.destination, tinfoil.config_data)
-        origlayerdir = oe.recipeutils.find_layerdir(rd.getVar('FILE', True))
+        origlayerdir = oe.recipeutils.find_layerdir(rd.getVar('FILE'))
 
         if not os.path.isdir(destlayerdir):
             raise DevtoolError('Unable to find layer or directory matching "%s"' % args.destination)
@@ -1515,6 +1760,11 @@
             destpath = oe.recipeutils.get_bbfile_path(rd, destlayerdir, origrelpath)
             if not destpath:
                 raise DevtoolError("Unable to determine destination layer path - check that %s specifies an actual layer and %s/conf/layer.conf specifies BBFILES. You may also need to specify a more complete path." % (args.destination, destlayerdir))
+            # Warn if the layer isn't in bblayers.conf (the code to create a bbappend will do this in other cases)
+            layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
+            if not os.path.abspath(destlayerdir) in layerdirs:
+                bb.warn('Specified destination layer is not currently enabled in bblayers.conf, so the %s recipe will now be unavailable in your current configuration until you add the layer there' % args.recipename)
+
         elif destlayerdir == origlayerdir:
             # Same layer, update the original recipe
             appendlayerdir = None
@@ -1539,8 +1789,9 @@
         if origlayerdir == config.workspace_path and destpath:
             # Recipe file itself is in the workspace - need to move it and any
             # associated files to the specified layer
+            no_clean = True
             logger.info('Moving recipe file to %s' % destpath)
-            recipedir = os.path.dirname(rd.getVar('FILE', True))
+            recipedir = os.path.dirname(rd.getVar('FILE'))
             for root, _, files in os.walk(recipedir):
                 for fn in files:
                     srcpath = os.path.join(root, fn)
@@ -1553,7 +1804,7 @@
         tinfoil.shutdown()
 
     # Everything else has succeeded, we can now reset
-    _reset([args.recipename], no_clean=False, config=config, basepath=basepath, workspace=workspace)
+    _reset([args.recipename], no_clean=no_clean, config=config, basepath=basepath, workspace=workspace)
 
     return 0
 
@@ -1580,6 +1831,7 @@
     group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
     group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true")
     parser_add.add_argument('--fetch', '-f', help='Fetch the specified URI and extract it to create the source tree (deprecated - pass as positional argument instead)', metavar='URI')
+    parser_add.add_argument('--fetch-dev', help='For npm, also fetch devDependencies', action="store_true")
     parser_add.add_argument('--version', '-V', help='Version to use within recipe (PV)')
     parser_add.add_argument('--no-git', '-g', help='If fetching source, do not set up source tree as a git repository', action="store_true")
     parser_add.add_argument('--autorev', '-a', help='When fetching from a git repository, set SRCREV in the recipe to a floating revision instead of fixed', action="store_true")
@@ -1601,6 +1853,7 @@
     group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
     group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true")
     parser_modify.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout (when not using -n/--no-extract) (default "%(default)s")')
+    parser_modify.add_argument('--keep-temp', help='Keep temporary directory (for debugging)', action="store_true")
     parser_modify.set_defaults(func=modify)
 
     parser_extract = subparsers.add_parser('extract', help='Extract the source for an existing recipe',
@@ -1622,6 +1875,15 @@
     parser_sync.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)')
     parser_sync.set_defaults(func=sync)
 
+    parser_rename = subparsers.add_parser('rename', help='Rename a recipe file in the workspace',
+                                       description='Renames the recipe file for a recipe in the workspace, changing the name or version part or both, ensuring that all references within the workspace are updated at the same time. Only works when the recipe file itself is in the workspace, e.g. after devtool add. Particularly useful when devtool add did not automatically determine the correct name.',
+                                       group='working', order=10)
+    parser_rename.add_argument('recipename', help='Current name of recipe to rename')
+    parser_rename.add_argument('newname', nargs='?', help='New name for recipe (optional, not needed if you only want to change the version)')
+    parser_rename.add_argument('--version', '-V', help='Change the version (NOTE: this does not change the version fetched by the recipe, just the version in the recipe file name)')
+    parser_rename.add_argument('--no-srctree', '-s', action='store_true', help='Do not rename the source tree directory (if the default source tree path has been used) - keeping the old name may be desirable if there are internal/other external references to this path')
+    parser_rename.set_defaults(func=rename)
+
     parser_update_recipe = subparsers.add_parser('update-recipe', help='Apply changes from external source tree to recipe',
                                        description='Applies changes from external source tree to a recipe (updating/adding/removing patches as necessary, or by updating SRCREV). Note that these changes need to have been committed to the git repository in order to be recognised.',
                                        group='working', order=-90)
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/upgrade.py b/import-layers/yocto-poky/scripts/lib/devtool/upgrade.py
index a4239f1..05fb9e5 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/upgrade.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/upgrade.py
@@ -27,6 +27,10 @@
 import scriptutils
 import errno
 import bb
+
+devtool_path = os.path.dirname(os.path.realpath(__file__)) + '/../../../meta/lib'
+sys.path = sys.path + [devtool_path]
+
 import oe.recipeutils
 from devtool import standard
 from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build
@@ -68,7 +72,7 @@
             shutil.rmtree(os.path.join(root,d))
 
 def _recipe_contains(rd, var):
-    rf = rd.getVar('FILE', True)
+    rf = rd.getVar('FILE')
     varfiles = oe.recipeutils.get_var_files(rf, [var], rd)
     for var, fn in varfiles.items():
         if fn and fn.startswith(os.path.dirname(rf) + os.sep):
@@ -117,7 +121,7 @@
     brf = os.path.basename(os.path.splitext(rc)[0]) # rc basename
 
     srctree = os.path.abspath(srctree)
-    pn = d.getVar('PN',True)
+    pn = d.getVar('PN')
     af = os.path.join(appendpath, '%s.bbappend' % brf)
     with open(af, 'w') as f:
         f.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n\n')
@@ -132,7 +136,7 @@
         if rev:
             f.write('# initial_rev: %s\n' % rev)
         if copied:
-            f.write('# original_path: %s\n' % os.path.dirname(d.getVar('FILE', True)))
+            f.write('# original_path: %s\n' % os.path.dirname(d.getVar('FILE')))
             f.write('# original_files: %s\n' % ' '.join(copied))
     return af
 
@@ -154,7 +158,7 @@
     raise DevtoolError(e)
 
 def _get_uri(rd):
-    srcuris = rd.getVar('SRC_URI', True).split()
+    srcuris = rd.getVar('SRC_URI').split()
     if not len(srcuris):
         raise DevtoolError('SRC_URI not found on recipe')
     # Get first non-local entry in SRC_URI - usually by convention it's
@@ -185,7 +189,7 @@
 
     crd = rd.createCopy()
 
-    pv = crd.getVar('PV', True)
+    pv = crd.getVar('PV')
     crd.setVar('PV', newpv)
 
     tmpsrctree = None
@@ -270,15 +274,15 @@
 def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil, rd):
     """Creates the new recipe under workspace"""
 
-    bpn = rd.getVar('BPN', True)
+    bpn = rd.getVar('BPN')
     path = os.path.join(workspace, 'recipes', bpn)
     bb.utils.mkdirhier(path)
     copied, _ = oe.recipeutils.copy_recipe_files(rd, path)
 
-    oldpv = rd.getVar('PV', True)
+    oldpv = rd.getVar('PV')
     if not newpv:
         newpv = oldpv
-    origpath = rd.getVar('FILE', True)
+    origpath = rd.getVar('FILE')
     fullpath = _rename_recipe_files(origpath, bpn, oldpv, newpv, path)
     logger.debug('Upgraded %s => %s' % (origpath, fullpath))
 
@@ -320,7 +324,7 @@
         newvalues['SRC_URI[md5sum]'] = md5
         newvalues['SRC_URI[sha256sum]'] = sha256
 
-    rd = oe.recipeutils.parse_recipe(tinfoil.cooker, fullpath, None)
+    rd = tinfoil.parse_recipe_file(fullpath, False)
     oe.recipeutils.patch_recipe(rd, fullpath, newvalues)
 
     return fullpath, copied
@@ -341,7 +345,7 @@
         if not rd:
             return 1
 
-        pn = rd.getVar('PN', True)
+        pn = rd.getVar('PN')
         if pn != args.recipename:
             logger.info('Mapping %s to %s' % (args.recipename, pn))
         if pn in workspace:
@@ -353,17 +357,17 @@
             srctree = standard.get_default_srctree(config, pn)
 
         standard._check_compatible_recipe(pn, rd)
-        old_srcrev = rd.getVar('SRCREV', True)
+        old_srcrev = rd.getVar('SRCREV')
         if old_srcrev == 'INVALID':
             old_srcrev = None
         if old_srcrev and not args.srcrev:
             raise DevtoolError("Recipe specifies a SRCREV value; you must specify a new one when upgrading")
-        if rd.getVar('PV', True) == args.version and old_srcrev == args.srcrev:
+        if rd.getVar('PV') == args.version and old_srcrev == args.srcrev:
             raise DevtoolError("Current and upgrade versions are the same version")
 
         rf = None
         try:
-            rev1 = standard._extract_source(srctree, False, 'devtool-orig', False, rd)
+            rev1 = standard._extract_source(srctree, False, 'devtool-orig', False, rd, tinfoil)
             rev2, md5, sha256 = _extract_new_source(args.version, srctree, args.no_patch,
                                                     args.srcrev, args.branch, args.keep_temp,
                                                     tinfoil, rd)
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/utilcmds.py b/import-layers/yocto-poky/scripts/lib/devtool/utilcmds.py
index b761a80..0437e64 100644
--- a/import-layers/yocto-poky/scripts/lib/devtool/utilcmds.py
+++ b/import-layers/yocto-poky/scripts/lib/devtool/utilcmds.py
@@ -39,7 +39,7 @@
             rd = parse_recipe(config, tinfoil, args.recipename, True)
             if not rd:
                 return 1
-            recipefile = rd.getVar('FILE', True)
+            recipefile = rd.getVar('FILE')
         finally:
             tinfoil.shutdown()
     else:
@@ -62,20 +62,20 @@
         rd = parse_recipe(config, tinfoil, args.recipename, appends=True, filter_workspace=False)
         if not rd:
             return 1
-        b = rd.getVar('B', True)
-        s = rd.getVar('S', True)
+        b = rd.getVar('B')
+        s = rd.getVar('S')
         configurescript = os.path.join(s, 'configure')
         confdisabled = 'noexec' in rd.getVarFlags('do_configure') or 'do_configure' not in (rd.getVar('__BBTASKS', False) or [])
-        configureopts = oe.utils.squashspaces(rd.getVar('CONFIGUREOPTS', True) or '')
-        extra_oeconf = oe.utils.squashspaces(rd.getVar('EXTRA_OECONF', True) or '')
-        extra_oecmake = oe.utils.squashspaces(rd.getVar('EXTRA_OECMAKE', True) or '')
-        do_configure = rd.getVar('do_configure', True) or ''
+        configureopts = oe.utils.squashspaces(rd.getVar('CONFIGUREOPTS') or '')
+        extra_oeconf = oe.utils.squashspaces(rd.getVar('EXTRA_OECONF') or '')
+        extra_oecmake = oe.utils.squashspaces(rd.getVar('EXTRA_OECMAKE') or '')
+        do_configure = rd.getVar('do_configure') or ''
         do_configure_noexpand = rd.getVar('do_configure', False) or ''
         packageconfig = rd.getVarFlags('PACKAGECONFIG') or []
         autotools = bb.data.inherits_class('autotools', rd) and ('oe_runconf' in do_configure or 'autotools_do_configure' in do_configure)
         cmake = bb.data.inherits_class('cmake', rd) and ('cmake_do_configure' in do_configure)
-        cmake_do_configure = rd.getVar('cmake_do_configure', True)
-        pn = rd.getVar('PN', True)
+        cmake_do_configure = rd.getVar('cmake_do_configure')
+        pn = rd.getVar('PN')
     finally:
         tinfoil.shutdown()
 
diff --git a/import-layers/yocto-poky/scripts/lib/recipetool/append.py b/import-layers/yocto-poky/scripts/lib/recipetool/append.py
index 1e0fc1e..69c8bb7 100644
--- a/import-layers/yocto-poky/scripts/lib/recipetool/append.py
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/append.py
@@ -48,7 +48,7 @@
     """Find the recipe installing the specified target path, optionally limited to a select list of packages"""
     import json
 
-    pkgdata_dir = d.getVar('PKGDATA_DIR', True)
+    pkgdata_dir = d.getVar('PKGDATA_DIR')
 
     # The mix between /etc and ${sysconfdir} here may look odd, but it is just
     # being consistent with usage elsewhere
@@ -97,25 +97,12 @@
                             recipes[targetpath].append('!%s' % pn)
     return recipes
 
-def _get_recipe_file(cooker, pn):
-    import oe.recipeutils
-    recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)
-    if not recipefile:
-        skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)
-        if skipreasons:
-            logger.error('\n'.join(skipreasons))
-        else:
-            logger.error("Unable to find any recipe file matching %s" % pn)
-    return recipefile
-
 def _parse_recipe(pn, tinfoil):
-    import oe.recipeutils
-    recipefile = _get_recipe_file(tinfoil.cooker, pn)
-    if not recipefile:
-        # Error already logged
+    try:
+        rd = tinfoil.parse_recipe(pn)
+    except bb.providers.NoProvider as e:
+        logger.error(str(e))
         return None
-    append_files = tinfoil.cooker.collection.get_file_appends(recipefile)
-    rd = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, append_files)
     return rd
 
 def determine_file_source(targetpath, rd):
@@ -123,8 +110,8 @@
     import oe.recipeutils
 
     # See if it's in do_install for the recipe
-    workdir = rd.getVar('WORKDIR', True)
-    src_uri = rd.getVar('SRC_URI', True)
+    workdir = rd.getVar('WORKDIR')
+    src_uri = rd.getVar('SRC_URI')
     srcfile = ''
     modpatches = []
     elements = check_do_install(rd, targetpath)
@@ -134,7 +121,7 @@
         logger.debug('source path: %s' % srcpath)
         if not srcpath.startswith('/'):
             # Handle non-absolute path
-            srcpath = os.path.abspath(os.path.join(rd.getVarFlag('do_install', 'dirs', True).split()[-1], srcpath))
+            srcpath = os.path.abspath(os.path.join(rd.getVarFlag('do_install', 'dirs').split()[-1], srcpath))
         if srcpath.startswith(workdir):
             # OK, now we have the source file name, look for it in SRC_URI
             workdirfile = os.path.relpath(srcpath, workdir)
@@ -203,22 +190,22 @@
 
 def get_func_deps(func, d):
     """Find the function dependencies of a shell function"""
-    deps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func, True))
-    deps |= set((d.getVarFlag(func, "vardeps", True) or "").split())
+    deps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func))
+    deps |= set((d.getVarFlag(func, "vardeps") or "").split())
     funcdeps = []
     for dep in deps:
-        if d.getVarFlag(dep, 'func', True):
+        if d.getVarFlag(dep, 'func'):
             funcdeps.append(dep)
     return funcdeps
 
 def check_do_install(rd, targetpath):
     """Look at do_install for a command that installs/copies the specified target path"""
-    instpath = os.path.abspath(os.path.join(rd.getVar('D', True), targetpath.lstrip('/')))
-    do_install = rd.getVar('do_install', True)
+    instpath = os.path.abspath(os.path.join(rd.getVar('D'), targetpath.lstrip('/')))
+    do_install = rd.getVar('do_install')
     # Handle where do_install calls other functions (somewhat crudely, but good enough for this purpose)
     deps = get_func_deps('do_install', rd)
     for dep in deps:
-        do_install = do_install.replace(dep, rd.getVar(dep, True))
+        do_install = do_install.replace(dep, rd.getVar(dep))
 
     # Look backwards through do_install as we want to catch where a later line (perhaps
     # from a bbappend) is writing over the top
@@ -335,12 +322,12 @@
 def appendsrc(args, files, rd, extralines=None):
     import oe.recipeutils
 
-    srcdir = rd.getVar('S', True)
-    workdir = rd.getVar('WORKDIR', True)
+    srcdir = rd.getVar('S')
+    workdir = rd.getVar('WORKDIR')
 
     import bb.fetch
     simplified = {}
-    src_uri = rd.getVar('SRC_URI', True).split()
+    src_uri = rd.getVar('SRC_URI').split()
     for uri in src_uri:
         if uri.endswith(';'):
             uri = uri[:-1]
@@ -353,7 +340,7 @@
     for newfile, srcfile in files.items():
         src_destdir = os.path.dirname(srcfile)
         if not args.use_workdir:
-            if rd.getVar('S', True) == rd.getVar('STAGING_KERNEL_DIR', True):
+            if rd.getVar('S') == rd.getVar('STAGING_KERNEL_DIR'):
                 srcdir = os.path.join(workdir, 'git')
                 if not bb.data.inherits_class('kernel-yocto', rd):
                     logger.warn('S == STAGING_KERNEL_DIR and non-kernel-yocto, unable to determine path to srcdir, defaulting to ${WORKDIR}/git')
diff --git a/import-layers/yocto-poky/scripts/lib/recipetool/create.py b/import-layers/yocto-poky/scripts/lib/recipetool/create.py
index d427d32..4de52fc 100644
--- a/import-layers/yocto-poky/scripts/lib/recipetool/create.py
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/create.py
@@ -26,12 +26,24 @@
 import scriptutils
 from urllib.parse import urlparse, urldefrag, urlsplit
 import hashlib
-
+import bb.fetch2
 logger = logging.getLogger('recipetool')
 
 tinfoil = None
 plugins = None
 
+def log_error_cond(message, debugonly):
+    if debugonly:
+        logger.debug(message)
+    else:
+        logger.error(message)
+
+def log_info_cond(message, debugonly):
+    if debugonly:
+        logger.debug(message)
+    else:
+        logger.info(message)
+
 def plugin_init(pluginlist):
     # Take a reference to the list so we can use it later
     global plugins
@@ -47,6 +59,9 @@
     recipecmakefilemap = {}
     recipebinmap = {}
 
+    def __init__(self):
+        self._devtool = False
+
     @staticmethod
     def load_libmap(d):
         '''Load library->recipe mapping'''
@@ -56,8 +71,8 @@
             return
         # First build up library->package mapping
         shlib_providers = oe.package.read_shlib_providers(d)
-        libdir = d.getVar('libdir', True)
-        base_libdir = d.getVar('base_libdir', True)
+        libdir = d.getVar('libdir')
+        base_libdir = d.getVar('base_libdir')
         libpaths = list(set([base_libdir, libdir]))
         libname_re = re.compile('^lib(.+)\.so.*$')
         pkglibmap = {}
@@ -73,7 +88,7 @@
                         logger.debug('unable to extract library name from %s' % lib)
 
         # Now turn it into a library->recipe mapping
-        pkgdata_dir = d.getVar('PKGDATA_DIR', True)
+        pkgdata_dir = d.getVar('PKGDATA_DIR')
         for libname, pkg in pkglibmap.items():
             try:
                 with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
@@ -97,9 +112,9 @@
         '''Build up development file->recipe mapping'''
         if RecipeHandler.recipeheadermap:
             return
-        pkgdata_dir = d.getVar('PKGDATA_DIR', True)
-        includedir = d.getVar('includedir', True)
-        cmakedir = os.path.join(d.getVar('libdir', True), 'cmake')
+        pkgdata_dir = d.getVar('PKGDATA_DIR')
+        includedir = d.getVar('includedir')
+        cmakedir = os.path.join(d.getVar('libdir'), 'cmake')
         for pkg in glob.glob(os.path.join(pkgdata_dir, 'runtime', '*-dev')):
             with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
                 pn = None
@@ -128,9 +143,9 @@
         '''Build up native binary->recipe mapping'''
         if RecipeHandler.recipebinmap:
             return
-        sstate_manifests = d.getVar('SSTATE_MANIFESTS', True)
-        staging_bindir_native = d.getVar('STAGING_BINDIR_NATIVE', True)
-        build_arch = d.getVar('BUILD_ARCH', True)
+        sstate_manifests = d.getVar('SSTATE_MANIFESTS')
+        staging_bindir_native = d.getVar('STAGING_BINDIR_NATIVE')
+        build_arch = d.getVar('BUILD_ARCH')
         fileprefix = 'manifest-%s-' % build_arch
         for fn in glob.glob(os.path.join(sstate_manifests, '%s*-native.populate_sysroot' % fileprefix)):
             with open(fn, 'r') as f:
@@ -222,7 +237,8 @@
         if deps:
             values['DEPENDS'] = ' '.join(deps)
 
-    def genfunction(self, outlines, funcname, content, python=False, forcespace=False):
+    @staticmethod
+    def genfunction(outlines, funcname, content, python=False, forcespace=False):
         if python:
             prefix = 'python '
         else:
@@ -323,7 +339,7 @@
                 pn = res.group(1).strip().replace('_', '-')
                 pv = res.group(2).strip().replace('_', '.')
 
-        if not pn and not pv:
+        if not pn and not pv and parseres.scheme not in ['git', 'gitsm', 'svn', 'hg']:
             srcfile = os.path.basename(parseres.path.rstrip('/'))
             pn, pv = determine_from_filename(srcfile)
 
@@ -335,7 +351,6 @@
     # This is a bit sad, but if you don't have this set there can be some
     # odd interactions with the urldata cache which lead to errors
     localdata.setVar('SRCREV', '${AUTOREV}')
-    bb.data.update_data(localdata)
     try:
         fetcher = bb.fetch2.Fetch([uri], localdata)
         urldata = fetcher.ud
@@ -353,14 +368,31 @@
     '''Convert any http[s]://....git URI into git://...;protocol=http[s]'''
     checkuri = uri.split(';', 1)[0]
     if checkuri.endswith('.git') or '/git/' in checkuri or re.match('https?://github.com/[^/]+/[^/]+/?$', checkuri):
-        res = re.match('(http|https|ssh)://([^;]+(\.git)?)(;.*)?$', uri)
-        if res:
-            # Need to switch the URI around so that the git fetcher is used
-            return 'git://%s;protocol=%s%s' % (res.group(2), res.group(1), res.group(4) or '')
-        elif '@' in checkuri:
-            # Catch e.g. git@git.example.com:repo.git
-            return 'git://%s;protocol=ssh' % checkuri.replace(':', '/', 1)
-    return uri
+        # Appends scheme if the scheme is missing
+        if not '://' in uri:
+            uri = 'git://' + uri
+        scheme, host, path, user, pswd, parms = bb.fetch2.decodeurl(uri)
+        # Detection mechanism, this is required due to certain URL are formatter with ":" rather than "/"
+        # which causes decodeurl to fail getting the right host and path
+        if len(host.split(':')) > 1:
+            splitslash = host.split(':')
+            host = splitslash[0]
+            path = '/' + splitslash[1] + path
+        #Algorithm:
+        # if user is defined, append protocol=ssh or if a protocol is defined, then honor the user-defined protocol
+        # if no user & password is defined, check for scheme type and append the protocol with the scheme type
+        # finally if protocols or if the url is well-formed, do nothing and rejoin everything back to normal
+        # Need to repackage the arguments for encodeurl, the format is: (scheme, host, path, user, password, OrderedDict([('key', 'value')]))
+        if user:
+            if not 'protocol' in parms:
+                parms.update({('protocol', 'ssh')})
+        elif (scheme == "http" or scheme == 'https' or scheme == 'ssh') and not ('protocol' in parms):
+            parms.update({('protocol', scheme)})
+        # Always append 'git://'
+        fUrl = bb.fetch2.encodeurl(('git', host, path, user, pswd, parms))
+        return fUrl
+    else:
+        return uri
 
 def is_package(url):
     '''Check if a URL points to a package'''
@@ -404,12 +436,14 @@
             srcuri = rev_re.sub('', srcuri)
         tempsrc = tempfile.mkdtemp(prefix='recipetool-')
         srctree = tempsrc
+        d = bb.data.createCopy(tinfoil.config_data)
         if fetchuri.startswith('npm://'):
             # Check if npm is available
-            check_npm(tinfoil.config_data)
+            npm_bindir = check_npm(tinfoil, args.devtool)
+            d.prependVar('PATH', '%s:' % npm_bindir)
         logger.info('Fetching %s...' % srcuri)
         try:
-            checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev)
+            checksums = scriptutils.fetch_uri(d, fetchuri, srctree, srcrev)
         except bb.fetch2.BBFetchException as e:
             logger.error(str(e).rstrip())
             sys.exit(1)
@@ -448,8 +482,8 @@
 
                 if pkgfile:
                     if pkgfile.endswith(('.deb', '.ipk')):
-                        stdout, _ = bb.process.run('ar x %s control.tar.gz' % pkgfile, cwd=tmpfdir)
-                        stdout, _ = bb.process.run('tar xf control.tar.gz ./control', cwd=tmpfdir)
+                        stdout, _ = bb.process.run('ar x %s' % pkgfile, cwd=tmpfdir)
+                        stdout, _ = bb.process.run('tar xf control.tar.gz', cwd=tmpfdir)
                         values = convert_debian(tmpfdir)
                         extravalues.update(values)
                     elif pkgfile.endswith(('.rpm', '.srpm')):
@@ -554,7 +588,6 @@
         if name_pv and not realpv:
             realpv = name_pv
 
-
     if not srcuri:
         lines_before.append('# No information for SRC_URI yet (only an external source tree was specified)')
     lines_before.append('SRC_URI = "%s"' % srcuri)
@@ -588,6 +621,11 @@
         lines_after.append('INSANE_SKIP_${PN} += "already-stripped"')
         lines_after.append('')
 
+    if args.fetch_dev:
+        extravalues['fetchdev'] = True
+    else:
+        extravalues['fetchdev'] = None
+
     # Find all plugins that want to register handlers
     logger.debug('Loading recipe handlers')
     raw_handlers = []
@@ -604,6 +642,7 @@
     handlers.sort(key=lambda item: (item[1], -item[2]), reverse=True)
     for handler, priority, _ in handlers:
         logger.debug('Handler: %s (priority %d)' % (handler.__class__.__name__, priority))
+        setattr(handler, '_devtool', args.devtool)
     handlers = [item[0] for item in handlers]
 
     # Apply the handlers
@@ -640,7 +679,7 @@
 
     if not outfile:
         if not pn:
-            logger.error('Unable to determine short program name from source tree - please specify name with -N/--name or output file name with -o/--outfile')
+            log_error_cond('Unable to determine short program name from source tree - please specify name with -N/--name or output file name with -o/--outfile', args.devtool)
             # devtool looks for this specific exit code, so don't change it
             sys.exit(15)
         else:
@@ -710,6 +749,15 @@
         if not bbclassextend:
             lines_after.append('BBCLASSEXTEND = "native"')
 
+    postinst = ("postinst", extravalues.pop('postinst', None))
+    postrm = ("postrm", extravalues.pop('postrm', None))
+    preinst = ("preinst", extravalues.pop('preinst', None))
+    prerm = ("prerm", extravalues.pop('prerm', None))
+    funcs = [postinst, postrm, preinst, prerm]
+    for func in funcs:
+        if func[1]:
+            RecipeHandler.genfunction(lines_after, 'pkg_%s_${PN}' % func[0], func[1])
+
     outlines = []
     outlines.extend(lines_before)
     if classes:
@@ -736,7 +784,7 @@
         shutil.move(srctree, args.extract_to)
         if tempsrc == srctree:
             tempsrc = None
-        logger.info('Source extracted to %s' % args.extract_to)
+        log_info_cond('Source extracted to %s' % args.extract_to, args.devtool)
 
     if outfile == '-':
         sys.stdout.write('\n'.join(outlines) + '\n')
@@ -749,7 +797,7 @@
                     continue
                 f.write('%s\n' % line)
                 lastline = line
-        logger.info('Recipe %s has been created; further editing may be required to make it fully functional' % outfile)
+        log_info_cond('Recipe %s has been created; further editing may be required to make it fully functional' % outfile, args.devtool)
 
     if tempsrc:
         if args.keep_temp:
@@ -775,10 +823,12 @@
         lines_before.append('# your responsibility to verify that the values are complete and correct.')
         if len(licvalues) > 1:
             lines_before.append('#')
-            lines_before.append('# NOTE: multiple licenses have been detected; if that is correct you should separate')
-            lines_before.append('# these in the LICENSE value using & if the multiple licenses all apply, or | if there')
-            lines_before.append('# is a choice between the multiple licenses. If in doubt, check the accompanying')
-            lines_before.append('# documentation to determine which situation is applicable.')
+            lines_before.append('# NOTE: multiple licenses have been detected; they have been separated with &')
+            lines_before.append('# in the LICENSE value for now since it is a reasonable assumption that all')
+            lines_before.append('# of the licenses apply. If instead there is a choice between the multiple')
+            lines_before.append('# licenses then you should change the value to separate the licenses with |')
+            lines_before.append('# instead of &. If there is any doubt, check the accompanying documentation')
+            lines_before.append('# to determine which situation is applicable.')
         if lic_unknown:
             lines_before.append('#')
             lines_before.append('# The following license files were not able to be identified and are')
@@ -802,7 +852,7 @@
             licenses = [pkg_license]
         else:
             lines_before.append('# NOTE: Original package metadata indicates license is: %s' % pkg_license)
-    lines_before.append('LICENSE = "%s"' % ' '.join(licenses))
+    lines_before.append('LICENSE = "%s"' % ' & '.join(licenses))
     lines_before.append('LIC_FILES_CHKSUM = "%s"' % ' \\\n                    '.join(lic_files_chksum))
     lines_before.append('')
     handled.append(('license', licvalues))
@@ -813,7 +863,7 @@
     md5sums = {}
     if not static_only:
         # Gather md5sums of license files in common license dir
-        commonlicdir = d.getVar('COMMON_LICENSE_DIR', True)
+        commonlicdir = d.getVar('COMMON_LICENSE_DIR')
         for fn in os.listdir(commonlicdir):
             md5value = bb.utils.md5_file(os.path.join(commonlicdir, fn))
             md5sums[md5value] = fn
@@ -983,7 +1033,7 @@
     return outlicenses
 
 def read_pkgconfig_provides(d):
-    pkgdatadir = d.getVar('PKGDATA_DIR', True)
+    pkgdatadir = d.getVar('PKGDATA_DIR')
     pkgmap = {}
     for fn in glob.glob(os.path.join(pkgdatadir, 'shlibs2', '*.pclist')):
         with open(fn, 'r') as f:
@@ -1044,6 +1094,25 @@
                     varname = value_map.get(key, None)
                     if varname:
                         values[varname] = value
+    postinst = os.path.join(debpath, 'postinst')
+    postrm = os.path.join(debpath, 'postrm')
+    preinst = os.path.join(debpath, 'preinst')
+    prerm = os.path.join(debpath, 'prerm')
+    sfiles = [postinst, postrm, preinst, prerm]
+    for sfile in sfiles:
+        if os.path.isfile(sfile):
+            logger.info("Converting %s file to recipe function..." %
+                    os.path.basename(sfile).upper())
+            content = []
+            with open(sfile) as f:
+                for line in f:
+                    if "#!/" in line:
+                        continue
+                    line = line.rstrip("\n")
+                    if line.strip():
+                        content.append(line)
+                if content:
+                    values[os.path.basename(f.name)] = content
 
     #if depends:
     #    values['DEPENDS'] = ' '.join(depends)
@@ -1073,10 +1142,21 @@
     return values
 
 
-def check_npm(d):
-    if not os.path.exists(os.path.join(d.getVar('STAGING_BINDIR_NATIVE', True), 'npm')):
-        logger.error('npm required to process specified source, but npm is not available - you need to build nodejs-native first')
+def check_npm(tinfoil, debugonly=False):
+    try:
+        rd = tinfoil.parse_recipe('nodejs-native')
+    except bb.providers.NoProvider:
+        # We still conditionally show the message and exit with the special
+        # return code, otherwise we can't show the proper message for eSDK
+        # users
+        log_error_cond('nodejs-native is required for npm but is not available - you will likely need to add a layer that provides nodejs', debugonly)
         sys.exit(14)
+    bindir = rd.getVar('STAGING_BINDIR_NATIVE')
+    npmpath = os.path.join(bindir, 'npm')
+    if not os.path.exists(npmpath):
+        log_error_cond('npm required to process specified source, but npm is not available - you need to run bitbake -c addto_recipe_sysroot nodejs-native first', debugonly)
+        sys.exit(14)
+    return bindir
 
 def register_commands(subparsers):
     parser_create = subparsers.add_parser('create',
@@ -1093,5 +1173,10 @@
     parser_create.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR')
     parser_create.add_argument('-a', '--autorev', help='When fetching from a git repository, set SRCREV in the recipe to a floating revision instead of fixed', action="store_true")
     parser_create.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)')
-    parser_create.set_defaults(func=create_recipe)
+    parser_create.add_argument('--fetch-dev', action="store_true", help='For npm, also fetch devDependencies')
+    parser_create.add_argument('--devtool', action="store_true", help=argparse.SUPPRESS)
+    # FIXME I really hate having to set parserecipes for this, but given we may need
+    # to call into npm (and we don't know in advance if we will or not) and in order
+    # to do so we need to know npm's recipe sysroot path, there's not much alternative
+    parser_create.set_defaults(func=create_recipe, parserecipes=True)
 
diff --git a/import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys_python.py b/import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys_python.py
index 82a2be1..ec5449b 100644
--- a/import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys_python.py
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys_python.py
@@ -532,11 +532,11 @@
 
     def parse_pkgdata_for_python_packages(self):
         suffixes = [t[0] for t in imp.get_suffixes()]
-        pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR', True)
+        pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
 
         ldata = tinfoil.config_data.createCopy()
         bb.parse.handle('classes/python-dir.bbclass', ldata, True)
-        python_sitedir = ldata.getVar('PYTHON_SITEPACKAGES_DIR', True)
+        python_sitedir = ldata.getVar('PYTHON_SITEPACKAGES_DIR')
 
         dynload_dir = os.path.join(os.path.dirname(python_sitedir), 'lib-dynload')
         python_dirs = [python_sitedir + os.sep,
diff --git a/import-layers/yocto-poky/scripts/lib/recipetool/create_kernel.py b/import-layers/yocto-poky/scripts/lib/recipetool/create_kernel.py
index 7dac59f..ca4996c 100644
--- a/import-layers/yocto-poky/scripts/lib/recipetool/create_kernel.py
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/create_kernel.py
@@ -41,7 +41,7 @@
         handled.append('buildsystem')
         del lines_after[:]
         del classes[:]
-        template = os.path.join(tinfoil.config_data.getVar('COREBASE', True), 'meta-skeleton', 'recipes-kernel', 'linux', 'linux-yocto-custom.bb')
+        template = os.path.join(tinfoil.config_data.getVar('COREBASE'), 'meta-skeleton', 'recipes-kernel', 'linux', 'linux-yocto-custom.bb')
         def handle_var(varname, origvalue, op, newlines):
             if varname in ['SRCREV', 'SRCREV_machine']:
                 while newlines[-1].startswith('#'):
@@ -85,7 +85,7 @@
             elif varname == 'COMPATIBLE_MACHINE':
                 while newlines[-1].startswith('#'):
                     del newlines[-1]
-                machine = tinfoil.config_data.getVar('MACHINE', True)
+                machine = tinfoil.config_data.getVar('MACHINE')
                 return machine, op, 0, True
             return origvalue, op, 0, True
         with open(template, 'r') as f:
diff --git a/import-layers/yocto-poky/scripts/lib/recipetool/create_npm.py b/import-layers/yocto-poky/scripts/lib/recipetool/create_npm.py
index 7bb844c..cb8f338 100644
--- a/import-layers/yocto-poky/scripts/lib/recipetool/create_npm.py
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/create_npm.py
@@ -45,11 +45,29 @@
             license = data['license']
             if isinstance(license, dict):
                 license = license.get('type', None)
+            if license:
+                if 'OR' in license:
+                    license = license.replace('OR', '|')
+                    license = license.replace('AND', '&')
+                    license = license.replace(' ', '_')
+                    if not license[0] == '(':
+                        license = '(' + license + ')'
+                    print('LICENSE: {}'.format(license))
+                else:
+                    license = license.replace('AND', '&')
+                    if license[0] == '(':
+                        license = license[1:]
+                    if license[-1] == ')':
+                        license = license[:-1]
+                license = license.replace('MIT/X11', 'MIT')
+                license = license.replace('Public Domain', 'PD')
+                license = license.replace('SEE LICENSE IN EULA',
+                                          'SEE-LICENSE-IN-EULA')
         return license
 
-    def _shrinkwrap(self, srctree, localfilesdir, extravalues, lines_before):
+    def _shrinkwrap(self, srctree, localfilesdir, extravalues, lines_before, d):
         try:
-            runenv = dict(os.environ, PATH=tinfoil.config_data.getVar('PATH', True))
+            runenv = dict(os.environ, PATH=d.getVar('PATH'))
             bb.process.run('npm shrinkwrap', cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
         except bb.process.ExecutionError as e:
             logger.warn('npm shrinkwrap failed:\n%s' % e.stdout)
@@ -61,8 +79,8 @@
         extravalues['extrafiles']['npm-shrinkwrap.json'] = tmpfile
         lines_before.append('NPM_SHRINKWRAP := "${THISDIR}/${PN}/npm-shrinkwrap.json"')
 
-    def _lockdown(self, srctree, localfilesdir, extravalues, lines_before):
-        runenv = dict(os.environ, PATH=tinfoil.config_data.getVar('PATH', True))
+    def _lockdown(self, srctree, localfilesdir, extravalues, lines_before, d):
+        runenv = dict(os.environ, PATH=d.getVar('PATH'))
         if not NpmRecipeHandler.lockdownpath:
             NpmRecipeHandler.lockdownpath = tempfile.mkdtemp('recipetool-npm-lockdown')
             bb.process.run('npm install lockdown --prefix %s' % NpmRecipeHandler.lockdownpath,
@@ -83,7 +101,7 @@
         extravalues['extrafiles']['lockdown.json'] = tmpfile
         lines_before.append('NPM_LOCKDOWN := "${THISDIR}/${PN}/lockdown.json"')
 
-    def _handle_dependencies(self, d, deps, lines_before, srctree):
+    def _handle_dependencies(self, d, deps, optdeps, devdeps, lines_before, srctree):
         import scriptutils
         # If this isn't a single module we need to get the dependencies
         # and add them to SRC_URI
@@ -92,8 +110,21 @@
                 if not origvalue.startswith('npm://'):
                     src_uri = origvalue.split()
                     changed = False
-                    for dep, depdata in deps.items():
-                        version = self.get_node_version(dep, depdata, d)
+                    deplist = {}
+                    for dep, depver in optdeps.items():
+                        depdata = self.get_npm_data(dep, depver, d)
+                        if self.check_npm_optional_dependency(depdata):
+                            deplist[dep] = depdata
+                    for dep, depver in devdeps.items():
+                        depdata = self.get_npm_data(dep, depver, d)
+                        if self.check_npm_optional_dependency(depdata):
+                            deplist[dep] = depdata
+                    for dep, depver in deps.items():
+                        depdata = self.get_npm_data(dep, depver, d)
+                        deplist[dep] = depdata
+
+                    for dep, depdata in deplist.items():
+                        version = depdata.get('version', None)
                         if version:
                             url = 'npm://registry.npmjs.org;name=%s;version=%s;subdir=node_modules/%s' % (dep, version, dep)
                             scriptutils.fetch_uri(d, url, srctree)
@@ -157,7 +188,9 @@
 
         files = RecipeHandler.checkfiles(srctree, ['package.json'])
         if files:
-            check_npm(tinfoil.config_data)
+            d = bb.data.createCopy(tinfoil.config_data)
+            npm_bindir = check_npm(tinfoil, self._devtool)
+            d.prependVar('PATH', '%s:' % npm_bindir)
 
             data = read_package_json(files[0])
             if 'name' in data and 'version' in data:
@@ -170,18 +203,19 @@
                 if 'homepage' in data:
                     extravalues['HOMEPAGE'] = data['homepage']
 
-                deps = data.get('dependencies', {})
-                updated = self._handle_dependencies(tinfoil.config_data, deps, lines_before, srctree)
+                fetchdev = extravalues['fetchdev'] or None
+                deps, optdeps, devdeps = self.get_npm_package_dependencies(data, fetchdev)
+                updated = self._handle_dependencies(d, deps, optdeps, devdeps, lines_before, srctree)
                 if updated:
                     # We need to redo the license stuff
-                    self._replace_license_vars(srctree, lines_before, handled, extravalues, tinfoil.config_data)
+                    self._replace_license_vars(srctree, lines_before, handled, extravalues, d)
 
                 # Shrinkwrap
                 localfilesdir = tempfile.mkdtemp(prefix='recipetool-npm')
-                self._shrinkwrap(srctree, localfilesdir, extravalues, lines_before)
+                self._shrinkwrap(srctree, localfilesdir, extravalues, lines_before, d)
 
                 # Lockdown
-                self._lockdown(srctree, localfilesdir, extravalues, lines_before)
+                self._lockdown(srctree, localfilesdir, extravalues, lines_before, d)
 
                 # Split each npm module out to is own package
                 npmpackages = oe.package.npm_split_package_dirs(srctree)
@@ -207,7 +241,9 @@
                     packages = OrderedDict((x,y[0]) for x,y in npmpackages.items())
                     packages['${PN}'] = ''
                     pkglicenses = split_pkg_licenses(licvalues, packages, lines_after, licenses)
-                    all_licenses = list(set([item for pkglicense in pkglicenses.values() for item in pkglicense]))
+                    all_licenses = list(set([item.replace('_', ' ') for pkglicense in pkglicenses.values() for item in pkglicense]))
+                    if '&' in all_licenses:
+                        all_licenses.remove('&')
                     # Go back and update the LICENSE value since we have a bit more
                     # information than when that was written out (and we know all apply
                     # vs. there being a choice, so we can join them with &)
@@ -251,17 +287,58 @@
 
     # FIXME this is effectively duplicated from lib/bb/fetch2/npm.py
     # (split out from _getdependencies())
-    def get_node_version(self, pkg, version, d):
+    def get_npm_data(self, pkg, version, d):
         import bb.fetch2
         pkgfullname = pkg
         if version != '*' and not '/' in version:
             pkgfullname += "@'%s'" % version
         logger.debug(2, "Calling getdeps on %s" % pkg)
-        runenv = dict(os.environ, PATH=d.getVar('PATH', True))
+        runenv = dict(os.environ, PATH=d.getVar('PATH'))
         fetchcmd = "npm view %s --json" % pkgfullname
         output, _ = bb.process.run(fetchcmd, stderr=subprocess.STDOUT, env=runenv, shell=True)
         data = self._parse_view(output)
-        return data.get('version', None)
+        return data
+
+    # FIXME this is effectively duplicated from lib/bb/fetch2/npm.py
+    # (split out from _getdependencies())
+    def get_npm_package_dependencies(self, pdata, fetchdev):
+        dependencies = pdata.get('dependencies', {})
+        optionalDependencies = pdata.get('optionalDependencies', {})
+        dependencies.update(optionalDependencies)
+        if fetchdev:
+            devDependencies = pdata.get('devDependencies', {})
+            dependencies.update(devDependencies)
+        else:
+            devDependencies = {}
+        depsfound = {}
+        optdepsfound = {}
+        devdepsfound = {}
+        for dep in dependencies:
+            if dep in optionalDependencies:
+                optdepsfound[dep] = dependencies[dep]
+            elif dep in devDependencies:
+                devdepsfound[dep] = dependencies[dep]
+            else:
+                depsfound[dep] = dependencies[dep]
+        return depsfound, optdepsfound, devdepsfound
+
+    # FIXME this is effectively duplicated from lib/bb/fetch2/npm.py
+    # (split out from _getdependencies())
+    def check_npm_optional_dependency(self, pdata):
+        pkg_os = pdata.get('os', None)
+        if pkg_os:
+            if not isinstance(pkg_os, list):
+                pkg_os = [pkg_os]
+            blacklist = False
+            for item in pkg_os:
+                if item.startswith('!'):
+                    blacklist = True
+                    break
+            if (not blacklist and 'linux' not in pkg_os) or '!linux' in pkg_os:
+                logger.debug(2, "Skipping %s since it's incompatible with Linux" % pkg)
+                return False
+        return True
+
 
 def register_recipe_handlers(handlers):
     handlers.append((NpmRecipeHandler(), 60))
diff --git a/import-layers/yocto-poky/scripts/lib/recipetool/newappend.py b/import-layers/yocto-poky/scripts/lib/recipetool/newappend.py
index fbdd7bc..0b63759 100644
--- a/import-layers/yocto-poky/scripts/lib/recipetool/newappend.py
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/newappend.py
@@ -39,18 +39,6 @@
     tinfoil = instance
 
 
-def _get_recipe_file(cooker, pn):
-    import oe.recipeutils
-    recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)
-    if not recipefile:
-        skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)
-        if skipreasons:
-            logger.error('\n'.join(skipreasons))
-        else:
-            logger.error("Unable to find any recipe file matching %s" % pn)
-    return recipefile
-
-
 def layer(layerpath):
     if not os.path.exists(os.path.join(layerpath, 'conf', 'layer.conf')):
         raise argparse.ArgumentTypeError('{0!r} must be a path to a valid layer'.format(layerpath))
@@ -60,7 +48,7 @@
 def newappend(args):
     import oe.recipeutils
 
-    recipe_path = _get_recipe_file(tinfoil.cooker, args.target)
+    recipe_path = tinfoil.get_recipe_file(args.target)
 
     rd = tinfoil.config_data.createCopy()
     rd.setVar('FILE', recipe_path)
@@ -72,7 +60,7 @@
     if not path_ok:
         logger.warn('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.', os.path.join(args.destlayer, 'conf', 'layer.conf'), os.path.dirname(append_path))
 
-    layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS', True).split()]
+    layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
     if not os.path.abspath(args.destlayer) in layerdirs:
         logger.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active')
 
diff --git a/import-layers/yocto-poky/scripts/lib/recipetool/setvar.py b/import-layers/yocto-poky/scripts/lib/recipetool/setvar.py
index 85701c0..9de315a 100644
--- a/import-layers/yocto-poky/scripts/lib/recipetool/setvar.py
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/setvar.py
@@ -51,7 +51,7 @@
     if args.recipe_only:
         patches = [oe.recipeutils.patch_recipe_file(args.recipefile, varvalues, patch=args.patch)]
     else:
-        rd = oe.recipeutils.parse_recipe(tinfoil.cooker, args.recipefile, None)
+        rd = tinfoil.parse_recipe_file(args.recipefile, False)
         if not rd:
             return 1
         patches = oe.recipeutils.patch_recipe(rd, args.recipefile, varvalues, patch=args.patch)
diff --git a/import-layers/yocto-poky/scripts/lib/scriptutils.py b/import-layers/yocto-poky/scripts/lib/scriptutils.py
index 5ccc027..92b601c 100644
--- a/import-layers/yocto-poky/scripts/lib/scriptutils.py
+++ b/import-layers/yocto-poky/scripts/lib/scriptutils.py
@@ -21,10 +21,12 @@
 import glob
 import argparse
 import subprocess
+import tempfile
+import shutil
 
-def logger_create(name):
+def logger_create(name, stream=None):
     logger = logging.getLogger(name)
-    loggerhandler = logging.StreamHandler()
+    loggerhandler = logging.StreamHandler(stream=stream)
     loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
     logger.addHandler(loggerhandler)
     logger.setLevel(logging.INFO)
@@ -52,10 +54,14 @@
             if fp:
                 fp.close()
 
+    def plugin_name(filename):
+        return os.path.splitext(os.path.basename(filename))[0]
+
+    known_plugins = [plugin_name(p.__name__) for p in plugins]
     logger.debug('Loading plugins from %s...' % pluginpath)
     for fn in glob.glob(os.path.join(pluginpath, '*.py')):
-        name = os.path.splitext(os.path.basename(fn))[0]
-        if name != '__init__':
+        name = plugin_name(fn)
+        if name != '__init__' and name not in known_plugins:
             plugin = load_plugin(name)
             if hasattr(plugin, 'plugin_init'):
                 plugin.plugin_init(plugins)
@@ -74,32 +80,47 @@
 
 def fetch_uri(d, uri, destdir, srcrev=None):
     """Fetch a URI to a local directory"""
-    import bb.data
-    bb.utils.mkdirhier(destdir)
-    localdata = bb.data.createCopy(d)
-    localdata.setVar('BB_STRICT_CHECKSUM', '')
-    localdata.setVar('SRCREV', srcrev)
-    ret = (None, None)
-    olddir = os.getcwd()
+    import bb
+    tmpparent = d.getVar('BASE_WORKDIR')
+    bb.utils.mkdirhier(tmpparent)
+    tmpworkdir = tempfile.mkdtemp(dir=tmpparent)
     try:
-        fetcher = bb.fetch2.Fetch([uri], localdata)
-        for u in fetcher.ud:
-            ud = fetcher.ud[u]
-            ud.ignore_checksums = True
-        fetcher.download()
-        for u in fetcher.ud:
-            ud = fetcher.ud[u]
-            if ud.localpath.rstrip(os.sep) == localdata.getVar('DL_DIR', True).rstrip(os.sep):
-                raise Exception('Local path is download directory - please check that the URI "%s" is correct' % uri)
-        fetcher.unpack(destdir)
-        for u in fetcher.ud:
-            ud = fetcher.ud[u]
-            if ud.method.recommends_checksum(ud):
-                md5value = bb.utils.md5_file(ud.localpath)
-                sha256value = bb.utils.sha256_file(ud.localpath)
-                ret = (md5value, sha256value)
+        bb.utils.mkdirhier(destdir)
+        localdata = bb.data.createCopy(d)
+
+        # Set some values to allow extend_recipe_sysroot to work here we're we are not running from a task
+        localdata.setVar('WORKDIR', tmpworkdir)
+        localdata.setVar('BB_RUNTASK', 'do_fetch')
+        localdata.setVar('PN', 'dummy')
+        localdata.setVar('BB_LIMITEDDEPS', '1')
+        bb.build.exec_func("extend_recipe_sysroot", localdata)
+
+        # Set some values for the benefit of the fetcher code
+        localdata.setVar('BB_STRICT_CHECKSUM', '')
+        localdata.setVar('SRCREV', srcrev)
+        ret = (None, None)
+        olddir = os.getcwd()
+        try:
+            fetcher = bb.fetch2.Fetch([uri], localdata)
+            for u in fetcher.ud:
+                ud = fetcher.ud[u]
+                ud.ignore_checksums = True
+            fetcher.download()
+            for u in fetcher.ud:
+                ud = fetcher.ud[u]
+                if ud.localpath.rstrip(os.sep) == localdata.getVar('DL_DIR').rstrip(os.sep):
+                    raise Exception('Local path is download directory - please check that the URI "%s" is correct' % uri)
+            fetcher.unpack(destdir)
+            for u in fetcher.ud:
+                ud = fetcher.ud[u]
+                if ud.method.recommends_checksum(ud):
+                    md5value = bb.utils.md5_file(ud.localpath)
+                    sha256value = bb.utils.sha256_file(ud.localpath)
+                    ret = (md5value, sha256value)
+        finally:
+            os.chdir(olddir)
     finally:
-        os.chdir(olddir)
+        shutil.rmtree(tmpworkdir)
     return ret
 
 def run_editor(fn):
diff --git a/import-layers/yocto-poky/scripts/lib/wic/__init__.py b/import-layers/yocto-poky/scripts/lib/wic/__init__.py
index 63c1d9c..85876b1 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/__init__.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/__init__.py
@@ -1,4 +1,20 @@
-import os, sys
+#!/usr/bin/env python -tt
+#
+# Copyright (c) 2007 Red Hat, Inc.
+# Copyright (c) 2011 Intel, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; version 2 of the License
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc., 59
+# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-cur_path = os.path.dirname(__file__) or '.'
-sys.path.insert(0, cur_path + '/3rdparty')
+class WicError(Exception):
+    pass
diff --git a/import-layers/yocto-poky/scripts/lib/wic/__version__.py b/import-layers/yocto-poky/scripts/lib/wic/__version__.py
deleted file mode 100644
index 5452a46..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/__version__.py
+++ /dev/null
@@ -1 +0,0 @@
-VERSION = "2.00"
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg
index a16bd6a..d5a07d2 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg
+++ b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg
@@ -1,11 +1,27 @@
 # This is an example configuration file for syslinux.
-PROMPT 0
-TIMEOUT 10
-
+TIMEOUT 50
 ALLOWOPTIONS 1
 SERIAL 0 115200
+PROMPT 0
 
-DEFAULT boot
-LABEL boot
+UI vesamenu.c32
+menu title Select boot options
+menu tabmsg Press [Tab] to edit, [Return] to select
+
+DEFAULT Graphics console boot
+
+LABEL Graphics console boot
 KERNEL /vmlinuz
-APPEND label=boot root=/dev/sda2 rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0
+APPEND label=boot root=/dev/sda2 rootwait
+
+LABEL Serial console boot
+KERNEL /vmlinuz
+APPEND label=boot root=/dev/sda2 rootwait console=ttyS0,115200
+
+LABEL Graphics console install
+KERNEL /vmlinuz
+APPEND label=install root=/dev/sda2 rootwait
+
+LABEL Serial console install
+KERNEL /vmlinuz
+APPEND label=install root=/dev/sda2 rootwait console=ttyS0,115200
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkgummidisk.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkgummidisk.wks
deleted file mode 100644
index f3ae090..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkgummidisk.wks
+++ /dev/null
@@ -1,11 +0,0 @@
-# short-description: Create an EFI disk image
-# long-description: Creates a partitioned EFI disk image that the user
-# can directly dd to boot media.
-
-part /boot --source bootimg-efi --sourceparams="loader=gummiboot" --ondisk sda --label msdos --active --align 1024
-
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024
-
-part swap --ondisk sda --size 44 --label swap1 --fstype=swap
-
-bootloader --ptable gpt --timeout=5  --append="rootwait rootfstype=ext4 console=ttyS0,115200 console=tty0"
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks
index a6518a0..db30bbc 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks
+++ b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks
@@ -4,5 +4,5 @@
 
 include common.wks.inc
 
-bootloader  --timeout=0  --append="vga=0 uvesafb.mode_option=640x480-32 root=/dev/vda2 rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 "
+bootloader  --timeout=0  --append="vga=0 uvesafb.mode_option=640x480-32 root=/dev/sda2 rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 "
 
diff --git a/import-layers/yocto-poky/scripts/lib/wic/conf.py b/import-layers/yocto-poky/scripts/lib/wic/conf.py
deleted file mode 100644
index 070ec30..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/conf.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env python -tt
-#
-# Copyright (c) 2011 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-
-from wic.ksparser import KickStart, KickStartError
-from wic import msger
-from wic.utils import misc
-
-
-def get_siteconf():
-    wic_path = os.path.dirname(__file__)
-    eos = wic_path.find('scripts') + len('scripts')
-    scripts_path = wic_path[:eos]
-
-    return scripts_path + "/lib/image/config/wic.conf"
-
-class ConfigMgr(object):
-    DEFAULTS = {
-        'common': {
-            "distro_name": "Default Distribution",
-            "plugin_dir": "/usr/lib/wic/plugins"}, # TODO use prefix also?
-        'create': {
-            "tmpdir": '/var/tmp/wic',
-            "outdir": './wic-output',
-            "release": None,
-            "logfile": None,
-            "name_prefix": None,
-            "name_suffix": None}
-        }
-
-    # make the manager class as singleton
-    _instance = None
-    def __new__(cls, *args, **kwargs):
-        if not cls._instance:
-            cls._instance = super(ConfigMgr, cls).__new__(cls, *args, **kwargs)
-
-        return cls._instance
-
-    def __init__(self, ksconf=None, siteconf=None):
-        # reset config options
-        self.reset()
-
-        if not siteconf:
-            siteconf = get_siteconf()
-
-        # initial options from siteconf
-        self._siteconf = siteconf
-
-        if ksconf:
-            self._ksconf = ksconf
-
-    def reset(self):
-        self.__ksconf = None
-        self.__siteconf = None
-        self.create = {}
-
-        # initialize the values with defaults
-        for sec, vals in self.DEFAULTS.items():
-            setattr(self, sec, vals)
-
-    def __set_ksconf(self, ksconf):
-        if not os.path.isfile(ksconf):
-            msger.error('Cannot find ks file: %s' % ksconf)
-
-        self.__ksconf = ksconf
-        self._parse_kickstart(ksconf)
-    def __get_ksconf(self):
-        return self.__ksconf
-    _ksconf = property(__get_ksconf, __set_ksconf)
-
-    def _parse_kickstart(self, ksconf=None):
-        if not ksconf:
-            return
-
-        try:
-            ksobj = KickStart(ksconf)
-        except KickStartError as err:
-            msger.error(str(err))
-
-        self.create['ks'] = ksobj
-        self.create['name'] = os.path.splitext(os.path.basename(ksconf))[0]
-
-        self.create['name'] = misc.build_name(ksconf,
-                                              self.create['release'],
-                                              self.create['name_prefix'],
-                                              self.create['name_suffix'])
-
-configmgr = ConfigMgr()
diff --git a/import-layers/yocto-poky/scripts/lib/wic/config/wic.conf b/import-layers/yocto-poky/scripts/lib/wic/config/wic.conf
deleted file mode 100644
index a51bcb5..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/config/wic.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-[common]
-; general settings
-distro_name = OpenEmbedded
-
-[create]
-; settings for create subcommand
diff --git a/import-layers/yocto-poky/scripts/lib/wic/creator.py b/import-layers/yocto-poky/scripts/lib/wic/creator.py
deleted file mode 100644
index 8f7d150..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/creator.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/env python -tt
-#
-# Copyright (c) 2011 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os, sys
-from optparse import OptionParser, SUPPRESS_HELP
-
-from wic import msger
-from wic.utils import errors
-from wic.conf import configmgr
-from wic.plugin import pluginmgr
-
-
-class Creator():
-    """${name}: create an image
-
-    Usage:
-        ${name} SUBCOMMAND <ksfile> [OPTS]
-
-    ${command_list}
-    ${option_list}
-    """
-
-    name = 'wic create(cr)'
-
-    def __init__(self, *args, **kwargs):
-        self._subcmds = {}
-
-        # get cmds from pluginmgr
-        # mix-in do_subcmd interface
-        for subcmd, klass in pluginmgr.get_plugins('imager').items():
-            if not hasattr(klass, 'do_create'):
-                msger.warning("Unsupported subcmd: %s" % subcmd)
-                continue
-
-            func = getattr(klass, 'do_create')
-            self._subcmds[subcmd] = func
-
-    def get_optparser(self):
-        optparser = OptionParser()
-        optparser.add_option('-d', '--debug', action='store_true',
-                             dest='debug',
-                             help=SUPPRESS_HELP)
-        optparser.add_option('-v', '--verbose', action='store_true',
-                             dest='verbose',
-                             help=SUPPRESS_HELP)
-        optparser.add_option('', '--logfile', type='string', dest='logfile',
-                             default=None,
-                             help='Path of logfile')
-        optparser.add_option('-c', '--config', type='string', dest='config',
-                             default=None,
-                             help='Specify config file for wic')
-        optparser.add_option('-o', '--outdir', type='string', action='store',
-                             dest='outdir', default=None,
-                             help='Output directory')
-        optparser.add_option('', '--tmpfs', action='store_true', dest='enabletmpfs',
-                             help='Setup tmpdir as tmpfs to accelerate, experimental'
-                                  ' feature, use it if you have more than 4G memory')
-        optparser.add_option('', '--bmap', action='store_true', help='generate .bmap')
-        return optparser
-
-    def postoptparse(self, options):
-        abspath = lambda pth: os.path.abspath(os.path.expanduser(pth))
-
-        if options.verbose:
-            msger.set_loglevel('verbose')
-        if options.debug:
-            msger.set_loglevel('debug')
-
-        if options.logfile:
-            logfile_abs_path = abspath(options.logfile)
-            if os.path.isdir(logfile_abs_path):
-                raise errors.Usage("logfile's path %s should be file"
-                                   % options.logfile)
-            if not os.path.exists(os.path.dirname(logfile_abs_path)):
-                os.makedirs(os.path.dirname(logfile_abs_path))
-            msger.set_interactive(False)
-            msger.set_logfile(logfile_abs_path)
-            configmgr.create['logfile'] = options.logfile
-
-        if options.config:
-            configmgr.reset()
-            configmgr._siteconf = options.config
-
-        if options.outdir is not None:
-            configmgr.create['outdir'] = abspath(options.outdir)
-
-        cdir = 'outdir'
-        if os.path.exists(configmgr.create[cdir]) \
-           and not os.path.isdir(configmgr.create[cdir]):
-            msger.error('Invalid directory specified: %s' \
-                        % configmgr.create[cdir])
-
-        if options.enabletmpfs:
-            configmgr.create['enabletmpfs'] = options.enabletmpfs
-
-    def main(self, argv=None):
-        if argv is None:
-            argv = sys.argv
-        else:
-            argv = argv[:] # don't modify caller's list
-
-        pname = argv[0]
-        if pname not in self._subcmds:
-            msger.error('Unknown plugin: %s' % pname)
-
-        optparser = self.get_optparser()
-        options, args = optparser.parse_args(argv)
-
-        self.postoptparse(options)
-
-        return self._subcmds[pname](options, *args[1:])
diff --git a/import-layers/yocto-poky/scripts/lib/wic/engine.py b/import-layers/yocto-poky/scripts/lib/wic/engine.py
index 5b10463..f59821f 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/engine.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/engine.py
@@ -28,14 +28,14 @@
 # Tom Zanussi <tom.zanussi (at] linux.intel.com>
 #
 
+import logging
 import os
-import sys
 
-from wic import msger, creator
-from wic.utils import misc
-from wic.plugin import pluginmgr
-from wic.utils.oe import misc
+from wic import WicError
+from wic.pluginbase import PluginMgr
+from wic.utils.misc import get_bitbake_var
 
+logger = logging.getLogger('wic')
 
 def verify_build_env():
     """
@@ -44,23 +44,25 @@
     Returns True if it is, false otherwise
     """
     if not os.environ.get("BUILDDIR"):
-        print("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)")
-        sys.exit(1)
+        raise WicError("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)")
 
     return True
 
 
 CANNED_IMAGE_DIR = "lib/wic/canned-wks" # relative to scripts
 SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR
+WIC_DIR = "wic"
 
 def build_canned_image_list(path):
-    layers_path = misc.get_bitbake_var("BBLAYERS")
+    layers_path = get_bitbake_var("BBLAYERS")
     canned_wks_layer_dirs = []
 
     if layers_path is not None:
         for layer_path in layers_path.split():
-            cpath = os.path.join(layer_path, SCRIPTS_CANNED_IMAGE_DIR)
-            canned_wks_layer_dirs.append(cpath)
+            for wks_path in (WIC_DIR, SCRIPTS_CANNED_IMAGE_DIR):
+                cpath = os.path.join(layer_path, wks_path)
+                if os.path.isdir(cpath):
+                    canned_wks_layer_dirs.append(cpath)
 
     cpath = os.path.join(path, CANNED_IMAGE_DIR)
     canned_wks_layer_dirs.append(cpath)
@@ -137,26 +139,24 @@
     """
     List the available source plugins i.e. plugins available for --source.
     """
-    plugins = pluginmgr.get_source_plugins()
+    plugins = PluginMgr.get_plugins('source')
 
     for plugin in plugins:
         print("  %s" % plugin)
 
 
 def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
-               native_sysroot, scripts_path, image_output_dir,
-               compressor, bmap, debug):
-    """Create image
+               native_sysroot, options):
+    """
+    Create image
 
     wks_file - user-defined OE kickstart file
     rootfs_dir - absolute path to the build's /rootfs dir
     bootimg_dir - absolute path to the build's boot artifacts directory
     kernel_dir - absolute path to the build's kernel directory
     native_sysroot - absolute path to the build's native sysroots dir
-    scripts_path - absolute path to /scripts dir
     image_output_dir - dirname to create for image
-    compressor - compressor utility to compress the image
-    bmap - enable generation of .bmap
+    options - wic command line options (debug, bmap, etc)
 
     Normally, the values for the build artifacts values are determined
     by 'wic -e' from the output of the 'bitbake -e' command given an
@@ -179,22 +179,22 @@
     try:
         oe_builddir = os.environ["BUILDDIR"]
     except KeyError:
-        print("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)")
-        sys.exit(1)
+        raise WicError("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)")
 
-    if debug:
-        msger.set_loglevel('debug')
+    if not os.path.exists(options.outdir):
+        os.makedirs(options.outdir)
 
-    crobj = creator.Creator()
+    pname = 'direct'
+    plugin_class = PluginMgr.get_plugins('imager').get(pname)
+    if not plugin_class:
+        raise WicError('Unknown plugin: %s' % pname)
 
-    cmdline = ["direct", native_sysroot, kernel_dir, bootimg_dir, rootfs_dir,
-                wks_file, image_output_dir, oe_builddir, compressor or ""]
-    if bmap:
-        cmdline.append('--bmap')
+    plugin = plugin_class(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
+                          native_sysroot, oe_builddir, options)
 
-    crobj.main(cmdline)
+    plugin.do_create()
 
-    print("\nThe image(s) were created using OE kickstart file:\n  %s" % wks_file)
+    logger.info("The image(s) were created using OE kickstart file:\n  %s", wks_file)
 
 
 def wic_list(args, scripts_path):
@@ -214,12 +214,44 @@
         wks_file = args[0]
         fullpath = find_canned_image(scripts_path, wks_file)
         if not fullpath:
-            print("No image named %s found, exiting. "\
-                  "(Use 'wic list images' to list available images, or "\
-                  "specify a fully-qualified OE kickstart (.wks) "\
-                  "filename)\n" % wks_file)
-            sys.exit(1)
+            raise WicError("No image named %s found, exiting. "
+                           "(Use 'wic list images' to list available images, "
+                           "or specify a fully-qualified OE kickstart (.wks) "
+                           "filename)" % wks_file)
+
         list_canned_image_help(scripts_path, fullpath)
         return True
 
     return False
+
+def find_canned(scripts_path, file_name):
+    """
+    Find a file either by its path or by name in the canned files dir.
+
+    Return None if not found
+    """
+    if os.path.exists(file_name):
+        return file_name
+
+    layers_canned_wks_dir = build_canned_image_list(scripts_path)
+    for canned_wks_dir in layers_canned_wks_dir:
+        for root, dirs, files in os.walk(canned_wks_dir):
+            for fname in files:
+                if fname == file_name:
+                    fullpath = os.path.join(canned_wks_dir, fname)
+                    return fullpath
+
+def get_custom_config(boot_file):
+    """
+    Get the custom configuration to be used for the bootloader.
+
+    Return None if the file can't be found.
+    """
+    # Get the scripts path of poky
+    scripts_path = os.path.abspath("%s/../.." % os.path.dirname(__file__))
+
+    cfg_file = find_canned(scripts_path, boot_file)
+    if cfg_file:
+        with open(cfg_file, "r") as f:
+            config = f.read()
+        return config
diff --git a/import-layers/yocto-poky/scripts/lib/wic/filemap.py b/import-layers/yocto-poky/scripts/lib/wic/filemap.py
index 162603e..1f1aacc 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/filemap.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/filemap.py
@@ -530,13 +530,16 @@
     except ErrorNotSupp:
         return FilemapSeek(image, log)
 
-def sparse_copy(src_fname, dst_fname, offset=0, skip=0):
+def sparse_copy(src_fname, dst_fname, offset=0, skip=0, api=None):
     """Efficiently copy sparse file to or into another file."""
-    fmap = filemap(src_fname)
+    if not api:
+        api = filemap
+    fmap = api(src_fname)
     try:
         dst_file = open(dst_fname, 'r+b')
     except IOError:
         dst_file = open(dst_fname, 'wb')
+        dst_file.truncate(os.path.getsize(src_fname))
 
     for first, last in fmap.get_mapped_ranges(0, fmap.blocks_cnt):
         start = first * fmap.block_size
diff --git a/import-layers/yocto-poky/scripts/lib/wic/help.py b/import-layers/yocto-poky/scripts/lib/wic/help.py
index e5347ec..d6e027d 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/help.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/help.py
@@ -28,10 +28,12 @@
 import subprocess
 import logging
 
-from wic.plugin import pluginmgr, PLUGIN_TYPES
+from wic.pluginbase import PluginMgr, PLUGIN_TYPES
+
+logger = logging.getLogger('wic')
 
 def subcommand_error(args):
-    logging.info("invalid subcommand %s" % args[0])
+    logger.info("invalid subcommand %s", args[0])
 
 
 def display_help(subcommand, subcommands):
@@ -66,7 +68,7 @@
     result = wic_plugins_help
     for plugin_type in PLUGIN_TYPES:
         result += '\n\n%s PLUGINS\n\n' % plugin_type.upper()
-        for name, plugin in pluginmgr.get_plugins(plugin_type).items():
+        for name, plugin in PluginMgr.get_plugins(plugin_type).items():
             result += "\n %s plugin:\n" % name
             if plugin.__doc__:
                 result += plugin.__doc__
@@ -81,13 +83,13 @@
     Should use argparse, but has to work in 2.6.
     """
     if not args:
-        logging.error("No subcommand specified, exiting")
+        logger.error("No subcommand specified, exiting")
         parser.print_help()
         return 1
     elif args[0] == "help":
         wic_help(args, main_command_usage, subcommands)
     elif args[0] not in subcommands:
-        logging.error("Unsupported subcommand %s, exiting\n" % (args[0]))
+        logger.error("Unsupported subcommand %s, exiting\n", args[0])
         parser.print_help()
         return 1
     else:
@@ -371,12 +373,7 @@
 
     This scheme is extensible - adding more hooks is a simple matter
     of adding more plugin methods to SourcePlugin and derived classes.
-    The code that then needs to call the plugin methods uses
-    plugin.get_source_plugin_methods() to find the method(s) needed by
-    the call; this is done by filling up a dict with keys containing
-    the method names of interest - on success, these will be filled in
-    with the actual methods. Please see the implementation for
-    examples and details.
+    Please see the implementation for details.
 """
 
 wic_overview_help = """
@@ -646,6 +643,12 @@
                  not specified, the size is in MB.
                  You do not need this option if you use --source.
 
+         --fixed-size: Exact partition size. Value format is the same
+                       as for --size option. This option cannot be
+                       specified along with --size. If partition data
+                       is larger than --fixed-size and error will be
+                       raised when assembling disk image.
+
          --source: This option is a wic-specific option that names the
                    source of the data that will populate the
                    partition.  The most common value for this option
@@ -684,6 +687,8 @@
            apply to partitions created using '--source rootfs' (see
            --source above).  Valid values are:
 
+             vfat
+             msdos
              ext2
              ext3
              ext4
@@ -715,17 +720,25 @@
                      partition table. It may be useful for
                      bootloaders.
 
+         --exclude-path: This option is specific to wic. It excludes the given
+                         relative path from the resulting image. If the path
+                         ends with a slash, only the content of the directory
+                         is omitted, not the directory itself. This option only
+                         has an effect with the rootfs source plugin.
+
          --extra-space: This option is specific to wic. It adds extra
                         space after the space filled by the content
                         of the partition. The final size can go
                         beyond the size specified by --size.
-                        By default, 10MB.
+                        By default, 10MB. This option cannot be used
+                        with --fixed-size option.
 
          --overhead-factor: This option is specific to wic. The
                             size of the partition is multiplied by
                             this factor. It has to be greater than or
-                            equal to 1.
-                            The default value is 1.3.
+                            equal to 1. The default value is 1.3.
+                            This option cannot be used with --fixed-size
+                            option.
 
          --part-type: This option is specific to wic. It specifies partition
                       type GUID for GPT partitions.
diff --git a/import-layers/yocto-poky/scripts/lib/wic/imager/baseimager.py b/import-layers/yocto-poky/scripts/lib/wic/imager/baseimager.py
deleted file mode 100644
index 1a52dd8..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/imager/baseimager.py
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/usr/bin/env python -tt
-#
-# Copyright (c) 2007 Red Hat  Inc.
-# Copyright (c) 2009, 2010, 2011 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import tempfile
-import shutil
-
-from wic import msger
-from wic.utils.errors import CreatorError
-from wic.utils import runner
-
-class BaseImageCreator():
-    """Base class for image creation.
-
-    BaseImageCreator is the simplest creator class available; it will
-    create a system image according to the supplied kickstart file.
-
-    e.g.
-
-      import wic.imgcreate as imgcreate
-      ks = imgcreate.read_kickstart("foo.ks")
-      imgcreate.ImageCreator(ks, "foo").create()
-    """
-
-    def __del__(self):
-        self.cleanup()
-
-    def __init__(self, createopts=None):
-        """Initialize an ImageCreator instance.
-
-        ks -- a pykickstart.KickstartParser instance; this instance will be
-              used to drive the install by e.g. providing the list of packages
-              to be installed, the system configuration and %post scripts
-
-        name -- a name for the image; used for e.g. image filenames or
-                filesystem labels
-        """
-
-        self.__builddir = None
-
-        self.ks = None
-        self.name = "target"
-        self.tmpdir = "/var/tmp/wic"
-        self.workdir = "/var/tmp/wic/build"
-
-        # setup tmpfs tmpdir when enabletmpfs is True
-        self.enabletmpfs = False
-
-        if createopts:
-            # Mapping table for variables that have different names.
-            optmap = {"outdir" : "destdir",
-                     }
-
-            # update setting from createopts
-            for key in createopts:
-                if key in optmap:
-                    option = optmap[key]
-                else:
-                    option = key
-                setattr(self, option, createopts[key])
-
-            self.destdir = os.path.abspath(os.path.expanduser(self.destdir))
-
-        self._dep_checks = ["ls", "bash", "cp", "echo"]
-
-        # Output image file names
-        self.outimage = []
-
-        # No ks provided when called by convertor, so skip the dependency check
-        if self.ks:
-            # If we have btrfs partition we need to check necessary tools
-            for part in self.ks.partitions:
-                if part.fstype and part.fstype == "btrfs":
-                    self._dep_checks.append("mkfs.btrfs")
-                    break
-
-        # make sure the specified tmpdir and cachedir exist
-        if not os.path.exists(self.tmpdir):
-            os.makedirs(self.tmpdir)
-
-
-    #
-    # Hooks for subclasses
-    #
-    def _create(self):
-        """Create partitions for the disk image(s)
-
-        This is the hook where subclasses may create the partitions
-        that will be assembled into disk image(s).
-
-        There is no default implementation.
-        """
-        pass
-
-    def _cleanup(self):
-        """Undo anything performed in _create().
-
-        This is the hook where subclasses must undo anything which was
-        done in _create().
-
-        There is no default implementation.
-
-        """
-        pass
-
-    #
-    # Actual implementation
-    #
-    def __ensure_builddir(self):
-        if not self.__builddir is None:
-            return
-
-        try:
-            self.workdir = os.path.join(self.tmpdir, "build")
-            if not os.path.exists(self.workdir):
-                os.makedirs(self.workdir)
-            self.__builddir = tempfile.mkdtemp(dir=self.workdir,
-                                               prefix="imgcreate-")
-        except OSError as err:
-            raise CreatorError("Failed create build directory in %s: %s" %
-                               (self.tmpdir, err))
-
-    def __setup_tmpdir(self):
-        if not self.enabletmpfs:
-            return
-
-        runner.show('mount -t tmpfs -o size=4G tmpfs %s' % self.workdir)
-
-    def __clean_tmpdir(self):
-        if not self.enabletmpfs:
-            return
-
-        runner.show('umount -l %s' % self.workdir)
-
-    def create(self):
-        """Create partitions for the disk image(s)
-
-        Create the partitions that will be assembled into disk
-        image(s).
-        """
-        self.__setup_tmpdir()
-        self.__ensure_builddir()
-
-        self._create()
-
-    def cleanup(self):
-        """Undo anything performed in create().
-
-        Note, make sure to call this method once finished with the creator
-        instance in order to ensure no stale files are left on the host e.g.:
-
-          creator = ImageCreator(ks, name)
-          try:
-              creator.create()
-          finally:
-              creator.cleanup()
-
-        """
-        if not self.__builddir:
-            return
-
-        self._cleanup()
-
-        shutil.rmtree(self.__builddir, ignore_errors=True)
-        self.__builddir = None
-
-        self.__clean_tmpdir()
-
-
-    def print_outimage_info(self):
-        msg = "The new image can be found here:\n"
-        self.outimage.sort()
-        for path in self.outimage:
-            msg += '  %s\n' % os.path.abspath(path)
-
-        msger.info(msg)
diff --git a/import-layers/yocto-poky/scripts/lib/wic/imager/direct.py b/import-layers/yocto-poky/scripts/lib/wic/imager/direct.py
deleted file mode 100644
index 4c547e0..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/imager/direct.py
+++ /dev/null
@@ -1,419 +0,0 @@
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# Copyright (c) 2013, Intel Corporation.
-# All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# DESCRIPTION
-# This implements the 'direct' image creator class for 'wic'
-#
-# AUTHORS
-# Tom Zanussi <tom.zanussi (at] linux.intel.com>
-#
-
-import os
-import shutil
-import uuid
-
-from wic import msger
-from wic.utils.oe.misc import get_bitbake_var
-from wic.utils.partitionedfs import Image
-from wic.utils.errors import CreatorError, ImageError
-from wic.imager.baseimager import BaseImageCreator
-from wic.plugin import pluginmgr
-from wic.utils.oe.misc import exec_cmd, exec_native_cmd
-
-disk_methods = {
-    "do_install_disk":None,
-}
-
-class DiskImage():
-    """
-    A Disk backed by a file.
-    """
-    def __init__(self, device, size):
-        self.size = size
-        self.device = device
-        self.created = False
-
-    def exists(self):
-        return os.path.exists(self.device)
-
-    def create(self):
-        if self.created:
-            return
-        # create sparse disk image
-        cmd = "truncate %s -s %s" % (self.device, self.size)
-        exec_cmd(cmd)
-        self.created = True
-
-class DirectImageCreator(BaseImageCreator):
-    """
-    Installs a system into a file containing a partitioned disk image.
-
-    DirectImageCreator is an advanced ImageCreator subclass; an image
-    file is formatted with a partition table, each partition created
-    from a rootfs or other OpenEmbedded build artifact and dd'ed into
-    the virtual disk. The disk image can subsequently be dd'ed onto
-    media and used on actual hardware.
-    """
-
-    def __init__(self, oe_builddir, image_output_dir, rootfs_dir, bootimg_dir,
-                 kernel_dir, native_sysroot, compressor, creatoropts=None,
-                 bmap=False):
-        """
-        Initialize a DirectImageCreator instance.
-
-        This method takes the same arguments as ImageCreator.__init__()
-        """
-        BaseImageCreator.__init__(self, creatoropts)
-
-        self.__image = None
-        self.__disks = {}
-        self.__disk_format = "direct"
-        self._disk_names = []
-        self.ptable_format = self.ks.bootloader.ptable
-
-        self.oe_builddir = oe_builddir
-        if image_output_dir:
-            self.tmpdir = image_output_dir
-        self.rootfs_dir = rootfs_dir
-        self.bootimg_dir = bootimg_dir
-        self.kernel_dir = kernel_dir
-        self.native_sysroot = native_sysroot
-        self.compressor = compressor
-        self.bmap = bmap
-
-    def __get_part_num(self, num, parts):
-        """calculate the real partition number, accounting for partitions not
-        in the partition table and logical partitions
-        """
-        realnum = 0
-        for pnum, part in enumerate(parts, 1):
-            if not part.no_table:
-                realnum += 1
-            if pnum == num:
-                if  part.no_table:
-                    return 0
-                if self.ptable_format == 'msdos' and realnum > 3 and len(parts) > 4:
-                    # account for logical partition numbering, ex. sda5..
-                    return realnum + 1
-                return realnum
-
-    def _write_fstab(self, image_rootfs):
-        """overriden to generate fstab (temporarily) in rootfs. This is called
-        from _create, make sure it doesn't get called from
-        BaseImage.create()
-        """
-        if not image_rootfs:
-            return
-
-        fstab_path = image_rootfs + "/etc/fstab"
-        if not os.path.isfile(fstab_path):
-            return
-
-        with open(fstab_path) as fstab:
-            fstab_lines = fstab.readlines()
-
-        if self._update_fstab(fstab_lines, self._get_parts()):
-            shutil.copyfile(fstab_path, fstab_path + ".orig")
-
-            with open(fstab_path, "w") as fstab:
-                fstab.writelines(fstab_lines)
-
-            return fstab_path
-
-    def _update_fstab(self, fstab_lines, parts):
-        """Assume partition order same as in wks"""
-        updated = False
-        for num, part in enumerate(parts, 1):
-            pnum = self.__get_part_num(num, parts)
-            if not pnum or not part.mountpoint \
-               or part.mountpoint in ("/", "/boot"):
-                continue
-
-            # mmc device partitions are named mmcblk0p1, mmcblk0p2..
-            prefix = 'p' if  part.disk.startswith('mmcblk') else ''
-            device_name = "/dev/%s%s%d" % (part.disk, prefix, pnum)
-
-            opts = part.fsopts if part.fsopts else "defaults"
-            line = "\t".join([device_name, part.mountpoint, part.fstype,
-                              opts, "0", "0"]) + "\n"
-
-            fstab_lines.append(line)
-            updated = True
-
-        return updated
-
-    def set_bootimg_dir(self, bootimg_dir):
-        """
-        Accessor for bootimg_dir, the actual location used for the source
-        of the bootimg.  Should be set by source plugins (only if they
-        change the default bootimg source) so the correct info gets
-        displayed for print_outimage_info().
-        """
-        self.bootimg_dir = bootimg_dir
-
-    def _get_parts(self):
-        if not self.ks:
-            raise CreatorError("Failed to get partition info, "
-                               "please check your kickstart setting.")
-
-        # Set a default partition if no partition is given out
-        if not self.ks.partitions:
-            partstr = "part / --size 1900 --ondisk sda --fstype=ext3"
-            args = partstr.split()
-            part = self.ks.parse(args[1:])
-            if part not in self.ks.partitions:
-                self.ks.partitions.append(part)
-
-        # partitions list from kickstart file
-        return self.ks.partitions
-
-    def get_disk_names(self):
-        """ Returns a list of physical target disk names (e.g., 'sdb') which
-        will be created. """
-
-        if self._disk_names:
-            return self._disk_names
-
-        #get partition info from ks handler
-        parts = self._get_parts()
-
-        for i in range(len(parts)):
-            if parts[i].disk:
-                disk_name = parts[i].disk
-            else:
-                raise CreatorError("Failed to create disks, no --ondisk "
-                                   "specified in partition line of ks file")
-
-            if parts[i].mountpoint and not parts[i].fstype:
-                raise CreatorError("Failed to create disks, no --fstype "
-                                   "specified for partition with mountpoint "
-                                   "'%s' in the ks file")
-
-            self._disk_names.append(disk_name)
-
-        return self._disk_names
-
-    def _full_name(self, name, extention):
-        """ Construct full file name for a file we generate. """
-        return "%s-%s.%s" % (self.name, name, extention)
-
-    def _full_path(self, path, name, extention):
-        """ Construct full file path to a file we generate. """
-        return os.path.join(path, self._full_name(name, extention))
-
-    def get_default_source_plugin(self):
-        """
-        The default source plugin i.e. the plugin that's consulted for
-        overall image generation tasks outside of any particular
-        partition.  For convenience, we just hang it off the
-        bootloader handler since it's the one non-partition object in
-        any setup.  By default the default plugin is set to the same
-        plugin as the /boot partition; since we hang it off the
-        bootloader object, the default can be explicitly set using the
-        --source bootloader param.
-        """
-        return self.ks.bootloader.source
-
-    #
-    # Actual implemention
-    #
-    def _create(self):
-        """
-        For 'wic', we already have our build artifacts - we just create
-        filesystems from the artifacts directly and combine them into
-        a partitioned image.
-        """
-        parts = self._get_parts()
-
-        self.__image = Image(self.native_sysroot)
-
-        disk_ids = {}
-        for num, part in enumerate(parts, 1):
-            # as a convenience, set source to the boot partition source
-            # instead of forcing it to be set via bootloader --source
-            if not self.ks.bootloader.source and part.mountpoint == "/boot":
-                self.ks.bootloader.source = part.source
-
-            # generate parition UUIDs
-            if not part.uuid and part.use_uuid:
-                if self.ptable_format == 'gpt':
-                    part.uuid = str(uuid.uuid4())
-                else: # msdos partition table
-                    if part.disk not in disk_ids:
-                        disk_ids[part.disk] = int.from_bytes(os.urandom(4), 'little')
-                    disk_id = disk_ids[part.disk]
-                    part.uuid = '%0x-%02d' % (disk_id, self.__get_part_num(num, parts))
-
-        fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
-
-        shutil.rmtree(self.workdir)
-        os.mkdir(self.workdir)
-
-        for part in parts:
-            # get rootfs size from bitbake variable if it's not set in .ks file
-            if not part.size:
-                # and if rootfs name is specified for the partition
-                image_name = part.rootfs_dir
-                if image_name:
-                    # Bitbake variable ROOTFS_SIZE is calculated in
-                    # Image._get_rootfs_size method from meta/lib/oe/image.py
-                    # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT,
-                    # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE
-                    rsize_bb = get_bitbake_var('ROOTFS_SIZE', image_name)
-                    if rsize_bb:
-                        part.size = int(round(float(rsize_bb)))
-            # need to create the filesystems in order to get their
-            # sizes before we can add them and do the layout.
-            # Image.create() actually calls __format_disks() to create
-            # the disk images and carve out the partitions, then
-            # self.assemble() calls Image.assemble() which calls
-            # __write_partitition() for each partition to dd the fs
-            # into the partitions.
-            part.prepare(self, self.workdir, self.oe_builddir, self.rootfs_dir,
-                         self.bootimg_dir, self.kernel_dir, self.native_sysroot)
-
-
-            self.__image.add_partition(int(part.size),
-                                       part.disk,
-                                       part.mountpoint,
-                                       part.source_file,
-                                       part.fstype,
-                                       part.label,
-                                       fsopts=part.fsopts,
-                                       boot=part.active,
-                                       align=part.align,
-                                       no_table=part.no_table,
-                                       part_type=part.part_type,
-                                       uuid=part.uuid,
-                                       system_id=part.system_id)
-
-        if fstab_path:
-            shutil.move(fstab_path + ".orig", fstab_path)
-
-        self.__image.layout_partitions(self.ptable_format)
-
-        self.__imgdir = self.workdir
-        for disk_name, disk in self.__image.disks.items():
-            full_path = self._full_path(self.__imgdir, disk_name, "direct")
-            msger.debug("Adding disk %s as %s with size %s bytes" \
-                        % (disk_name, full_path, disk['min_size']))
-            disk_obj = DiskImage(full_path, disk['min_size'])
-            self.__disks[disk_name] = disk_obj
-            self.__image.add_disk(disk_name, disk_obj, disk_ids.get(disk_name))
-
-        self.__image.create()
-
-    def assemble(self):
-        """
-        Assemble partitions into disk image(s)
-        """
-        for disk_name, disk in self.__image.disks.items():
-            full_path = self._full_path(self.__imgdir, disk_name, "direct")
-            msger.debug("Assembling disk %s as %s with size %s bytes" \
-                        % (disk_name, full_path, disk['min_size']))
-            self.__image.assemble(full_path)
-
-    def finalize(self):
-        """
-        Finalize the disk image.
-
-        For example, prepare the image to be bootable by e.g.
-        creating and installing a bootloader configuration.
-
-        """
-        source_plugin = self.get_default_source_plugin()
-        if source_plugin:
-            self._source_methods = pluginmgr.get_source_plugin_methods(source_plugin, disk_methods)
-            for disk_name, disk in self.__image.disks.items():
-                self._source_methods["do_install_disk"](disk, disk_name, self,
-                                                        self.workdir,
-                                                        self.oe_builddir,
-                                                        self.bootimg_dir,
-                                                        self.kernel_dir,
-                                                        self.native_sysroot)
-
-        for disk_name, disk in self.__image.disks.items():
-            full_path = self._full_path(self.__imgdir, disk_name, "direct")
-            # Generate .bmap
-            if self.bmap:
-                msger.debug("Generating bmap file for %s" % disk_name)
-                exec_native_cmd("bmaptool create %s -o %s.bmap" % (full_path, full_path),
-                                self.native_sysroot)
-            # Compress the image
-            if self.compressor:
-                msger.debug("Compressing disk %s with %s" % (disk_name, self.compressor))
-                exec_cmd("%s %s" % (self.compressor, full_path))
-
-    def print_outimage_info(self):
-        """
-        Print the image(s) and artifacts used, for the user.
-        """
-        msg = "The new image(s) can be found here:\n"
-
-        parts = self._get_parts()
-
-        for disk_name in self.__image.disks:
-            extension = "direct" + {"gzip": ".gz",
-                                    "bzip2": ".bz2",
-                                    "xz": ".xz",
-                                    "": ""}.get(self.compressor)
-            full_path = self._full_path(self.__imgdir, disk_name, extension)
-            msg += '  %s\n\n' % full_path
-
-        msg += 'The following build artifacts were used to create the image(s):\n'
-        for part in parts:
-            if part.rootfs_dir is None:
-                continue
-            if part.mountpoint == '/':
-                suffix = ':'
-            else:
-                suffix = '["%s"]:' % (part.mountpoint or part.label)
-            msg += '  ROOTFS_DIR%s%s\n' % (suffix.ljust(20), part.rootfs_dir)
-
-        msg += '  BOOTIMG_DIR:                  %s\n' % self.bootimg_dir
-        msg += '  KERNEL_DIR:                   %s\n' % self.kernel_dir
-        msg += '  NATIVE_SYSROOT:               %s\n' % self.native_sysroot
-
-        msger.info(msg)
-
-    @property
-    def rootdev(self):
-        """
-        Get root device name to use as a 'root' parameter
-        in kernel command line.
-
-        Assume partition order same as in wks
-        """
-        parts = self._get_parts()
-        for num, part in enumerate(parts, 1):
-            if part.mountpoint == "/":
-                if part.uuid:
-                    return "PARTUUID=%s" % part.uuid
-                else:
-                    suffix = 'p' if part.disk.startswith('mmcblk') else ''
-                    pnum = self.__get_part_num(num, parts)
-                    return "/dev/%s%s%-d" % (part.disk, suffix, pnum)
-
-    def _cleanup(self):
-        if not self.__image is None:
-            try:
-                self.__image.cleanup()
-            except ImageError as err:
-                msger.warning("%s" % err)
-
diff --git a/import-layers/yocto-poky/scripts/lib/wic/ksparser.py b/import-layers/yocto-poky/scripts/lib/wic/ksparser.py
index 0894e2b..d026caa 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/ksparser.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/ksparser.py
@@ -27,11 +27,14 @@
 
 import os
 import shlex
+import logging
+
 from argparse import ArgumentParser, ArgumentError, ArgumentTypeError
 
-from wic import msger
+from wic.engine import find_canned
 from wic.partition import Partition
-from wic.utils.misc import find_canned
+
+logger = logging.getLogger('wic')
 
 class KickStartError(Exception):
     """Custom exception."""
@@ -113,6 +116,9 @@
 class KickStart():
     """"Kickstart parser implementation."""
 
+    DEFAULT_EXTRA_SPACE = 10*1024
+    DEFAULT_OVERHEAD_FACTOR = 1.3
+
     def __init__(self, confpath):
 
         self.partitions = []
@@ -127,16 +133,27 @@
         part.add_argument('mountpoint', nargs='?')
         part.add_argument('--active', action='store_true')
         part.add_argument('--align', type=int)
-        part.add_argument("--extra-space", type=sizetype, default=10*1024)
+        part.add_argument('--exclude-path', nargs='+')
+        part.add_argument("--extra-space", type=sizetype)
         part.add_argument('--fsoptions', dest='fsopts')
-        part.add_argument('--fstype')
+        part.add_argument('--fstype', default='vfat',
+                          choices=('ext2', 'ext3', 'ext4', 'btrfs',
+                                   'squashfs', 'vfat', 'msdos', 'swap'))
         part.add_argument('--label')
         part.add_argument('--no-table', action='store_true')
-        part.add_argument('--ondisk', '--ondrive', dest='disk')
-        part.add_argument("--overhead-factor", type=overheadtype, default=1.3)
+        part.add_argument('--ondisk', '--ondrive', dest='disk', default='sda')
+        part.add_argument("--overhead-factor", type=overheadtype)
         part.add_argument('--part-type')
         part.add_argument('--rootfs-dir')
-        part.add_argument('--size', type=sizetype, default=0)
+
+        # --size and --fixed-size cannot be specified together; options
+        # ----extra-space and --overhead-factor should also raise a parser
+        # --error, but since nesting mutually exclusive groups does not work,
+        # ----extra-space/--overhead-factor are handled later
+        sizeexcl = part.add_mutually_exclusive_group()
+        sizeexcl.add_argument('--size', type=sizetype, default=0)
+        sizeexcl.add_argument('--fixed-size', type=sizetype, default=0)
+
         part.add_argument('--source')
         part.add_argument('--sourceparams')
         part.add_argument('--system-id', type=systemidtype)
@@ -156,7 +173,7 @@
 
         self._parse(parser, confpath)
         if not self.bootloader:
-            msger.warning('bootloader config not specified, using defaults')
+            logger.warning('bootloader config not specified, using defaults\n')
             self.bootloader = bootloader.parse_args([])
 
     def _parse(self, parser, confpath):
@@ -170,11 +187,33 @@
                 lineno += 1
                 if line and line[0] != '#':
                     try:
-                        parsed = parser.parse_args(shlex.split(line))
+                        line_args = shlex.split(line)
+                        parsed = parser.parse_args(line_args)
                     except ArgumentError as err:
                         raise KickStartError('%s:%d: %s' % \
                                              (confpath, lineno, err))
                     if line.startswith('part'):
+                        # using ArgumentParser one cannot easily tell if option
+                        # was passed as argument, if said option has a default
+                        # value; --overhead-factor/--extra-space cannot be used
+                        # with --fixed-size, so at least detect when these were
+                        # passed with non-0 values ...
+                        if parsed.fixed_size:
+                            if parsed.overhead_factor or parsed.extra_space:
+                                err = "%s:%d: arguments --overhead-factor and --extra-space not "\
+                                      "allowed with argument --fixed-size" \
+                                      % (confpath, lineno)
+                                raise KickStartError(err)
+                        else:
+                            # ... and provide defaults if not using
+                            # --fixed-size iff given option was not used
+                            # (again, one cannot tell if option was passed but
+                            # with value equal to 0)
+                            if '--overhead-factor' not in line_args:
+                                parsed.overhead_factor = self.DEFAULT_OVERHEAD_FACTOR
+                            if '--extra-space' not in line_args:
+                                parsed.extra_space = self.DEFAULT_EXTRA_SPACE
+
                         self.partnum += 1
                         self.partitions.append(Partition(parsed, self.partnum))
                     elif line.startswith('include'):
diff --git a/import-layers/yocto-poky/scripts/lib/wic/msger.py b/import-layers/yocto-poky/scripts/lib/wic/msger.py
deleted file mode 100644
index fb8336d..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/msger.py
+++ /dev/null
@@ -1,235 +0,0 @@
-#!/usr/bin/env python -tt
-# vim: ai ts=4 sts=4 et sw=4
-#
-# Copyright (c) 2009, 2010, 2011 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import sys
-import re
-import time
-
-__ALL__ = ['get_loglevel',
-           'set_loglevel',
-           'set_logfile',
-           'debug',
-           'verbose',
-           'info',
-           'warning',
-           'error',
-          ]
-
-# COLORs in ANSI
-INFO_COLOR = 32 # green
-WARN_COLOR = 33 # yellow
-ERR_COLOR = 31 # red
-ASK_COLOR = 34 # blue
-NO_COLOR = 0
-
-PREFIX_RE = re.compile('^<(.*?)>\s*(.*)', re.S)
-
-INTERACTIVE = True
-
-LOG_LEVEL = 1
-LOG_LEVELS = {
-    'quiet': 0,
-    'normal': 1,
-    'verbose': 2,
-    'debug': 3,
-    'never': 4,
-}
-
-LOG_FILE_FP = None
-LOG_CONTENT = ''
-CATCHERR_BUFFILE_FD = -1
-CATCHERR_BUFFILE_PATH = None
-CATCHERR_SAVED_2 = -1
-
-def _general_print(head, color, msg=None, stream=None, level='normal'):
-    global LOG_CONTENT
-    if not stream:
-        stream = sys.stdout
-
-    if LOG_LEVELS[level] > LOG_LEVEL:
-        # skip
-        return
-
-    errormsg = ''
-    if CATCHERR_BUFFILE_FD > 0:
-        size = os.lseek(CATCHERR_BUFFILE_FD, 0, os.SEEK_END)
-        os.lseek(CATCHERR_BUFFILE_FD, 0, os.SEEK_SET)
-        errormsg = os.read(CATCHERR_BUFFILE_FD, size)
-        os.ftruncate(CATCHERR_BUFFILE_FD, 0)
-
-    # append error msg to LOG
-    if errormsg:
-        LOG_CONTENT += errormsg
-
-    # append normal msg to LOG
-    save_msg = msg.strip() if msg else None
-    if save_msg:
-        timestr = time.strftime("[%m/%d %H:%M:%S %Z] ", time.localtime())
-        LOG_CONTENT += timestr + save_msg + '\n'
-
-    if errormsg:
-        _color_print('', NO_COLOR, errormsg, stream, level)
-
-    _color_print(head, color, msg, stream, level)
-
-def _color_print(head, color, msg, stream, level):
-    colored = True
-    if color == NO_COLOR or \
-       not stream.isatty() or \
-       os.getenv('ANSI_COLORS_DISABLED') is not None:
-        colored = False
-
-    if head.startswith('\r'):
-        # need not \n at last
-        newline = False
-    else:
-        newline = True
-
-    if colored:
-        head = '\033[%dm%s:\033[0m ' %(color, head)
-        if not newline:
-            # ESC cmd to clear line
-            head = '\033[2K' + head
-    else:
-        if head:
-            head += ': '
-            if head.startswith('\r'):
-                head = head.lstrip()
-                newline = True
-
-    if msg is not None:
-        stream.write('%s%s' % (head, msg))
-        if newline:
-            stream.write('\n')
-
-    stream.flush()
-
-def _color_perror(head, color, msg, level='normal'):
-    if CATCHERR_BUFFILE_FD > 0:
-        _general_print(head, color, msg, sys.stdout, level)
-    else:
-        _general_print(head, color, msg, sys.stderr, level)
-
-def _split_msg(head, msg):
-    if isinstance(msg, list):
-        msg = '\n'.join(map(str, msg))
-
-    if msg.startswith('\n'):
-        # means print \n at first
-        msg = msg.lstrip()
-        head = '\n' + head
-
-    elif msg.startswith('\r'):
-        # means print \r at first
-        msg = msg.lstrip()
-        head = '\r' + head
-
-    match = PREFIX_RE.match(msg)
-    if match:
-        head += ' <%s>' % match.group(1)
-        msg = match.group(2)
-
-    return head, msg
-
-def get_loglevel():
-    return next((k for k, v in LOG_LEVELS.items() if v == LOG_LEVEL))
-
-def set_loglevel(level):
-    global LOG_LEVEL
-    if level not in LOG_LEVELS:
-        # no effect
-        return
-
-    LOG_LEVEL = LOG_LEVELS[level]
-
-def set_interactive(mode=True):
-    global INTERACTIVE
-    if mode:
-        INTERACTIVE = True
-    else:
-        INTERACTIVE = False
-
-def log(msg=''):
-    # log msg to LOG_CONTENT then save to logfile
-    global LOG_CONTENT
-    if msg:
-        LOG_CONTENT += msg
-
-def info(msg):
-    head, msg = _split_msg('Info', msg)
-    _general_print(head, INFO_COLOR, msg)
-
-def verbose(msg):
-    head, msg = _split_msg('Verbose', msg)
-    _general_print(head, INFO_COLOR, msg, level='verbose')
-
-def warning(msg):
-    head, msg = _split_msg('Warning', msg)
-    _color_perror(head, WARN_COLOR, msg)
-
-def debug(msg):
-    head, msg = _split_msg('Debug', msg)
-    _color_perror(head, ERR_COLOR, msg, level='debug')
-
-def error(msg):
-    head, msg = _split_msg('Error', msg)
-    _color_perror(head, ERR_COLOR, msg)
-    sys.exit(1)
-
-def set_logfile(fpath):
-    global LOG_FILE_FP
-
-    def _savelogf():
-        if LOG_FILE_FP:
-            with open(LOG_FILE_FP, 'w') as log:
-                log.write(LOG_CONTENT)
-
-    if LOG_FILE_FP is not None:
-        warning('duplicate log file configuration')
-
-    LOG_FILE_FP = fpath
-
-    import atexit
-    atexit.register(_savelogf)
-
-def enable_logstderr(fpath):
-    global CATCHERR_BUFFILE_FD
-    global CATCHERR_BUFFILE_PATH
-    global CATCHERR_SAVED_2
-
-    if os.path.exists(fpath):
-        os.remove(fpath)
-    CATCHERR_BUFFILE_PATH = fpath
-    CATCHERR_BUFFILE_FD = os.open(CATCHERR_BUFFILE_PATH, os.O_RDWR|os.O_CREAT)
-    CATCHERR_SAVED_2 = os.dup(2)
-    os.dup2(CATCHERR_BUFFILE_FD, 2)
-
-def disable_logstderr():
-    global CATCHERR_BUFFILE_FD
-    global CATCHERR_BUFFILE_PATH
-    global CATCHERR_SAVED_2
-
-    raw(msg=None) # flush message buffer and print it.
-    os.dup2(CATCHERR_SAVED_2, 2)
-    os.close(CATCHERR_SAVED_2)
-    os.close(CATCHERR_BUFFILE_FD)
-    os.unlink(CATCHERR_BUFFILE_PATH)
-    CATCHERR_BUFFILE_FD = -1
-    CATCHERR_BUFFILE_PATH = None
-    CATCHERR_SAVED_2 = -1
diff --git a/import-layers/yocto-poky/scripts/lib/wic/partition.py b/import-layers/yocto-poky/scripts/lib/wic/partition.py
index ec3aa66..939e667 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/partition.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/partition.py
@@ -24,18 +24,15 @@
 # Tom Zanussi <tom.zanussi (at] linux.intel.com>
 # Ed Bartosh <ed.bartosh> (at] linux.intel.com>
 
+import logging
 import os
 import tempfile
 
-from wic.utils.oe.misc import msger, parse_sourceparams
-from wic.utils.oe.misc import exec_cmd, exec_native_cmd
-from wic.plugin import pluginmgr
+from wic import WicError
+from wic.utils.misc import exec_cmd, exec_native_cmd, get_bitbake_var
+from wic.pluginbase import PluginMgr
 
-partition_methods = {
-    "do_stage_partition":None,
-    "do_prepare_partition":None,
-    "do_configure_partition":None,
-}
+logger = logging.getLogger('wic')
 
 class Partition():
 
@@ -44,16 +41,20 @@
         self.active = args.active
         self.align = args.align
         self.disk = args.disk
+        self.device = None
         self.extra_space = args.extra_space
+        self.exclude_path = args.exclude_path
         self.fsopts = args.fsopts
         self.fstype = args.fstype
         self.label = args.label
         self.mountpoint = args.mountpoint
         self.no_table = args.no_table
+        self.num = None
         self.overhead_factor = args.overhead_factor
         self.part_type = args.part_type
         self.rootfs_dir = args.rootfs_dir
         self.size = args.size
+        self.fixed_size = args.fixed_size
         self.source = args.source
         self.sourceparams = args.sourceparams
         self.system_id = args.system_id
@@ -71,100 +72,128 @@
         number of (1k) blocks we need to add to get to --size, 0 if
         we're already there or beyond.
         """
-        msger.debug("Requested partition size for %s: %d" % \
-                    (self.mountpoint, self.size))
+        logger.debug("Requested partition size for %s: %d",
+                     self.mountpoint, self.size)
 
         if not self.size:
             return 0
 
         requested_blocks = self.size
 
-        msger.debug("Requested blocks %d, current_blocks %d" % \
-                    (requested_blocks, current_blocks))
+        logger.debug("Requested blocks %d, current_blocks %d",
+                     requested_blocks, current_blocks)
 
         if requested_blocks > current_blocks:
             return requested_blocks - current_blocks
         else:
             return 0
 
+    def get_rootfs_size(self, actual_rootfs_size=0):
+        """
+        Calculate the required size of rootfs taking into consideration
+        --size/--fixed-size flags as well as overhead and extra space, as
+        specified in kickstart file. Raises an error if the
+        `actual_rootfs_size` is larger than fixed-size rootfs.
+
+        """
+        if self.fixed_size:
+            rootfs_size = self.fixed_size
+            if actual_rootfs_size > rootfs_size:
+                raise WicError("Actual rootfs size (%d kB) is larger than "
+                               "allowed size %d kB" %
+                               (actual_rootfs_size, rootfs_size))
+        else:
+            extra_blocks = self.get_extra_block_count(actual_rootfs_size)
+            if extra_blocks < self.extra_space:
+                extra_blocks = self.extra_space
+
+            rootfs_size = actual_rootfs_size + extra_blocks
+            rootfs_size *= self.overhead_factor
+
+            logger.debug("Added %d extra blocks to %s to get to %d total blocks",
+                         extra_blocks, self.mountpoint, rootfs_size)
+
+        return rootfs_size
+
+    @property
+    def disk_size(self):
+        """
+        Obtain on-disk size of partition taking into consideration
+        --size/--fixed-size options.
+
+        """
+        return self.fixed_size if self.fixed_size else self.size
+
     def prepare(self, creator, cr_workdir, oe_builddir, rootfs_dir,
                 bootimg_dir, kernel_dir, native_sysroot):
         """
         Prepare content for individual partitions, depending on
         partition command parameters.
         """
-        if self.sourceparams:
-            self.sourceparams_dict = parse_sourceparams(self.sourceparams)
-
         if not self.source:
-            if not self.size:
-                msger.error("The %s partition has a size of zero.  Please "
-                            "specify a non-zero --size for that partition." % \
-                            self.mountpoint)
-            if self.fstype and self.fstype == "swap":
+            if not self.size and not self.fixed_size:
+                raise WicError("The %s partition has a size of zero. Please "
+                               "specify a non-zero --size/--fixed-size for that "
+                               "partition." % self.mountpoint)
+
+            if self.fstype == "swap":
                 self.prepare_swap_partition(cr_workdir, oe_builddir,
                                             native_sysroot)
                 self.source_file = "%s/fs.%s" % (cr_workdir, self.fstype)
-            elif self.fstype:
+            else:
+                if self.fstype == 'squashfs':
+                    raise WicError("It's not possible to create empty squashfs "
+                                   "partition '%s'" % (self.mountpoint))
+
                 rootfs = "%s/fs_%s.%s.%s" % (cr_workdir, self.label,
                                              self.lineno, self.fstype)
                 if os.path.isfile(rootfs):
                     os.remove(rootfs)
-                for prefix in ("ext", "btrfs", "vfat", "squashfs"):
-                    if self.fstype.startswith(prefix):
-                        method = getattr(self,
-                                         "prepare_empty_partition_" + prefix)
-                        method(rootfs, oe_builddir, native_sysroot)
-                        self.source_file = rootfs
-                        break
+
+                prefix = "ext" if self.fstype.startswith("ext") else self.fstype
+                method = getattr(self, "prepare_empty_partition_" + prefix)
+                method(rootfs, oe_builddir, native_sysroot)
+                self.source_file = rootfs
             return
 
-        plugins = pluginmgr.get_source_plugins()
+        plugins = PluginMgr.get_plugins('source')
 
         if self.source not in plugins:
-            msger.error("The '%s' --source specified for %s doesn't exist.\n\t"
-                        "See 'wic list source-plugins' for a list of available"
-                        " --sources.\n\tSee 'wic help source-plugins' for "
-                        "details on adding a new source plugin." % \
-                        (self.source, self.mountpoint))
+            raise WicError("The '%s' --source specified for %s doesn't exist.\n\t"
+                           "See 'wic list source-plugins' for a list of available"
+                           " --sources.\n\tSee 'wic help source-plugins' for "
+                           "details on adding a new source plugin." %
+                           (self.source, self.mountpoint))
 
-        self._source_methods = pluginmgr.get_source_plugin_methods(\
-                                   self.source, partition_methods)
-        self._source_methods["do_configure_partition"](self, self.sourceparams_dict,
-                                                       creator, cr_workdir,
-                                                       oe_builddir,
-                                                       bootimg_dir,
-                                                       kernel_dir,
-                                                       native_sysroot)
-        self._source_methods["do_stage_partition"](self, self.sourceparams_dict,
-                                                   creator, cr_workdir,
-                                                   oe_builddir,
-                                                   bootimg_dir, kernel_dir,
-                                                   native_sysroot)
-        self._source_methods["do_prepare_partition"](self, self.sourceparams_dict,
-                                                     creator, cr_workdir,
-                                                     oe_builddir,
-                                                     bootimg_dir, kernel_dir, rootfs_dir,
-                                                     native_sysroot)
+        srcparams_dict = {}
+        if self.sourceparams:
+            # Split sourceparams string of the form key1=val1[,key2=val2,...]
+            # into a dict.  Also accepts valueless keys i.e. without =
+            splitted = self.sourceparams.split(',')
+            srcparams_dict = dict(par.split('=') for par in splitted if par)
+
+        plugin = PluginMgr.get_plugins('source')[self.source]
+        plugin.do_configure_partition(self, srcparams_dict, creator,
+                                      cr_workdir, oe_builddir, bootimg_dir,
+                                      kernel_dir, native_sysroot)
+        plugin.do_stage_partition(self, srcparams_dict, creator,
+                                  cr_workdir, oe_builddir, bootimg_dir,
+                                  kernel_dir, native_sysroot)
+        plugin.do_prepare_partition(self, srcparams_dict, creator,
+                                    cr_workdir, oe_builddir, bootimg_dir,
+                                    kernel_dir, rootfs_dir, native_sysroot)
+
         # further processing required Partition.size to be an integer, make
         # sure that it is one
-        if type(self.size) is not int:
-            msger.error("Partition %s internal size is not an integer. " \
-                          "This a bug in source plugin %s and needs to be fixed." \
-                          % (self.mountpoint, self.source))
+        if not isinstance(self.size, int):
+            raise WicError("Partition %s internal size is not an integer. "
+                           "This a bug in source plugin %s and needs to be fixed." %
+                           (self.mountpoint, self.source))
 
-    def prepare_rootfs_from_fs_image(self, cr_workdir, oe_builddir,
-                                     rootfs_dir):
-        """
-        Handle an already-created partition e.g. xxx.ext3
-        """
-        rootfs = oe_builddir
-        du_cmd = "du -Lbks %s" % rootfs
-        out = exec_cmd(du_cmd)
-        rootfs_size = out.split()[0]
-
-        self.size = int(rootfs_size)
-        self.source_file = rootfs
+        if self.fixed_size and self.size > self.fixed_size:
+            raise WicError("File system image of partition %s is "
+                           "larger (%d kB) than its allowed size %d kB" %
+                           (self.mountpoint, self.size, self.fixed_size))
 
     def prepare_rootfs(self, cr_workdir, oe_builddir, rootfs_dir,
                        native_sysroot):
@@ -183,30 +212,36 @@
         pseudo += "export PSEUDO_LOCALSTATEDIR=%s;" % p_localstatedir
         pseudo += "export PSEUDO_PASSWD=%s;" % p_passwd
         pseudo += "export PSEUDO_NOSYMLINKEXP=%s;" % p_nosymlinkexp
-        pseudo += "%s/usr/bin/pseudo " % native_sysroot
+        pseudo += "%s " % get_bitbake_var("FAKEROOTCMD")
 
         rootfs = "%s/rootfs_%s.%s.%s" % (cr_workdir, self.label,
                                          self.lineno, self.fstype)
         if os.path.isfile(rootfs):
             os.remove(rootfs)
 
-        if not self.fstype:
-            msger.error("File system for partition %s not specified in kickstart, " \
-                        "use --fstype option" % (self.mountpoint))
+        # Get rootfs size from bitbake variable if it's not set in .ks file
+        if not self.size:
+            # Bitbake variable ROOTFS_SIZE is calculated in
+            # Image._get_rootfs_size method from meta/lib/oe/image.py
+            # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT,
+            # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE
+            rsize_bb = get_bitbake_var('ROOTFS_SIZE')
+            if rsize_bb:
+                logger.warning('overhead-factor was specified, but size was not,'
+                               ' so bitbake variables will be used for the size.'
+                               ' In this case both IMAGE_OVERHEAD_FACTOR and '
+                               '--overhead-factor will be applied')
+                self.size = int(round(float(rsize_bb)))
 
-        for prefix in ("ext", "btrfs", "vfat", "squashfs"):
-            if self.fstype.startswith(prefix):
-                method = getattr(self, "prepare_rootfs_" + prefix)
-                method(rootfs, oe_builddir, rootfs_dir, native_sysroot, pseudo)
+        prefix = "ext" if self.fstype.startswith("ext") else self.fstype
+        method = getattr(self, "prepare_rootfs_" + prefix)
+        method(rootfs, oe_builddir, rootfs_dir, native_sysroot, pseudo)
+        self.source_file = rootfs
 
-                self.source_file = rootfs
-
-                # get the rootfs size in the right units for kickstart (kB)
-                du_cmd = "du -Lbks %s" % rootfs
-                out = exec_cmd(du_cmd)
-                self.size = int(out.split()[0])
-
-                break
+        # get the rootfs size in the right units for kickstart (kB)
+        du_cmd = "du -Lbks %s" % rootfs
+        out = exec_cmd(du_cmd)
+        self.size = int(out.split()[0])
 
     def prepare_rootfs_ext(self, rootfs, oe_builddir, rootfs_dir,
                            native_sysroot, pseudo):
@@ -217,17 +252,10 @@
         out = exec_cmd(du_cmd)
         actual_rootfs_size = int(out.split()[0])
 
-        extra_blocks = self.get_extra_block_count(actual_rootfs_size)
-        if extra_blocks < self.extra_space:
-            extra_blocks = self.extra_space
+        rootfs_size = self.get_rootfs_size(actual_rootfs_size)
 
-        rootfs_size = actual_rootfs_size + extra_blocks
-        rootfs_size *= self.overhead_factor
-
-        msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
-                    (extra_blocks, self.mountpoint, rootfs_size))
-
-        exec_cmd("truncate %s -s %d" % (rootfs, rootfs_size * 1024))
+        with open(rootfs, 'w') as sparse:
+            os.ftruncate(sparse.fileno(), rootfs_size * 1024)
 
         extra_imagecmd = "-i 8192"
 
@@ -239,7 +267,7 @@
             (self.fstype, extra_imagecmd, rootfs, label_str, rootfs_dir)
         exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
 
-        mkfs_cmd = "fsck.%s -pvfD %s || [ $? -le 3 ]" % (self.fstype, rootfs)
+        mkfs_cmd = "fsck.%s -pvfD %s" % (self.fstype, rootfs)
         exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
 
     def prepare_rootfs_btrfs(self, rootfs, oe_builddir, rootfs_dir,
@@ -253,17 +281,10 @@
         out = exec_cmd(du_cmd)
         actual_rootfs_size = int(out.split()[0])
 
-        extra_blocks = self.get_extra_block_count(actual_rootfs_size)
-        if extra_blocks < self.extra_space:
-            extra_blocks = self.extra_space
+        rootfs_size = self.get_rootfs_size(actual_rootfs_size)
 
-        rootfs_size = actual_rootfs_size + extra_blocks
-        rootfs_size *= self.overhead_factor
-
-        msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
-                    (extra_blocks, self.mountpoint, rootfs_size))
-
-        exec_cmd("truncate %s -s %d" % (rootfs, rootfs_size * 1024))
+        with open(rootfs, 'w') as sparse:
+            os.ftruncate(sparse.fileno(), rootfs_size * 1024)
 
         label_str = ""
         if self.label:
@@ -273,29 +294,27 @@
             (self.fstype, rootfs_size * 1024, rootfs_dir, label_str, rootfs)
         exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
 
-    def prepare_rootfs_vfat(self, rootfs, oe_builddir, rootfs_dir,
-                            native_sysroot, pseudo):
+    def prepare_rootfs_msdos(self, rootfs, oe_builddir, rootfs_dir,
+                             native_sysroot, pseudo):
         """
-        Prepare content for a vfat rootfs partition.
+        Prepare content for a msdos/vfat rootfs partition.
         """
         du_cmd = "du -bks %s" % rootfs_dir
         out = exec_cmd(du_cmd)
         blocks = int(out.split()[0])
 
-        extra_blocks = self.get_extra_block_count(blocks)
-        if extra_blocks < self.extra_space:
-            extra_blocks = self.extra_space
-
-        blocks += extra_blocks
-
-        msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
-                    (extra_blocks, self.mountpoint, blocks))
+        rootfs_size = self.get_rootfs_size(blocks)
 
         label_str = "-n boot"
         if self.label:
             label_str = "-n %s" % self.label
 
-        dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks)
+        size_str = ""
+        if self.fstype == 'msdos':
+            size_str = "-F 16" # FAT 16
+
+        dosfs_cmd = "mkdosfs %s -S 512 %s -C %s %d" % (label_str, size_str,
+                                                       rootfs, rootfs_size)
         exec_native_cmd(dosfs_cmd, native_sysroot)
 
         mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir)
@@ -304,6 +323,8 @@
         chmod_cmd = "chmod 644 %s" % rootfs
         exec_cmd(chmod_cmd)
 
+    prepare_rootfs_vfat = prepare_rootfs_msdos
+
     def prepare_rootfs_squashfs(self, rootfs, oe_builddir, rootfs_dir,
                                 native_sysroot, pseudo):
         """
@@ -318,7 +339,9 @@
         """
         Prepare an empty ext2/3/4 partition.
         """
-        exec_cmd("truncate %s -s %d" % (rootfs, self.size * 1024))
+        size = self.disk_size
+        with open(rootfs, 'w') as sparse:
+            os.ftruncate(sparse.fileno(), size * 1024)
 
         extra_imagecmd = "-i 8192"
 
@@ -335,7 +358,9 @@
         """
         Prepare an empty btrfs partition.
         """
-        exec_cmd("truncate %s -s %d" % (rootfs, self.size * 1024))
+        size = self.disk_size
+        with open(rootfs, 'w') as sparse:
+            os.ftruncate(sparse.fileno(), size * 1024)
 
         label_str = ""
         if self.label:
@@ -345,50 +370,29 @@
             (self.fstype, self.size * 1024, label_str, rootfs)
         exec_native_cmd(mkfs_cmd, native_sysroot)
 
-    def prepare_empty_partition_vfat(self, rootfs, oe_builddir,
-                                     native_sysroot):
+    def prepare_empty_partition_msdos(self, rootfs, oe_builddir,
+                                      native_sysroot):
         """
         Prepare an empty vfat partition.
         """
-        blocks = self.size
+        blocks = self.disk_size
 
         label_str = "-n boot"
         if self.label:
             label_str = "-n %s" % self.label
 
-        dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks)
+        size_str = ""
+        if self.fstype == 'msdos':
+            size_str = "-F 16" # FAT 16
+
+        dosfs_cmd = "mkdosfs %s -S 512 %s -C %s %d" % (label_str, size_str,
+                                                       rootfs, blocks)
         exec_native_cmd(dosfs_cmd, native_sysroot)
 
         chmod_cmd = "chmod 644 %s" % rootfs
         exec_cmd(chmod_cmd)
 
-    def prepare_empty_partition_squashfs(self, cr_workdir, oe_builddir,
-                                         native_sysroot):
-        """
-        Prepare an empty squashfs partition.
-        """
-        msger.warning("Creating of an empty squashfs %s partition was attempted. " \
-                      "Proceeding as requested." % self.mountpoint)
-
-        path = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
-        os.path.isfile(path) and os.remove(path)
-
-        # it is not possible to create a squashfs without source data,
-        # thus prepare an empty temp dir that is used as source
-        tmpdir = tempfile.mkdtemp()
-
-        squashfs_cmd = "mksquashfs %s %s -noappend" % \
-                       (tmpdir, path)
-        exec_native_cmd(squashfs_cmd, native_sysroot)
-
-        os.rmdir(tmpdir)
-
-        # get the rootfs size in the right units for kickstart (kB)
-        du_cmd = "du -Lbks %s" % path
-        out = exec_cmd(du_cmd)
-        fs_size = out.split()[0]
-
-        self.size = int(fs_size)
+    prepare_empty_partition_vfat = prepare_empty_partition_msdos
 
     def prepare_swap_partition(self, cr_workdir, oe_builddir, native_sysroot):
         """
@@ -396,7 +400,8 @@
         """
         path = "%s/fs.%s" % (cr_workdir, self.fstype)
 
-        exec_cmd("truncate %s -s %d" % (path, self.size * 1024))
+        with open(path, 'w') as sparse:
+            os.ftruncate(sparse.fileno(), self.size * 1024)
 
         import uuid
         label_str = ""
@@ -404,4 +409,3 @@
             label_str = "-L %s" % self.label
         mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), path)
         exec_native_cmd(mkswap_cmd, native_sysroot)
-
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugin.py b/import-layers/yocto-poky/scripts/lib/wic/plugin.py
deleted file mode 100644
index 306b324..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/plugin.py
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/usr/bin/env python -tt
-#
-# Copyright (c) 2011 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os, sys
-
-from wic import msger
-from wic import pluginbase
-from wic.utils import errors
-from wic.utils.oe.misc import get_bitbake_var
-
-__ALL__ = ['PluginMgr', 'pluginmgr']
-
-PLUGIN_TYPES = ["imager", "source"]
-
-PLUGIN_DIR = "/lib/wic/plugins" # relative to scripts
-SCRIPTS_PLUGIN_DIR = "scripts" + PLUGIN_DIR
-
-class PluginMgr():
-    plugin_dirs = {}
-
-    # make the manager class as singleton
-    _instance = None
-    def __new__(cls, *args, **kwargs):
-        if not cls._instance:
-            cls._instance = super(PluginMgr, cls).__new__(cls, *args, **kwargs)
-
-        return cls._instance
-
-    def __init__(self):
-        wic_path = os.path.dirname(__file__)
-        eos = wic_path.rfind('scripts') + len('scripts')
-        scripts_path = wic_path[:eos]
-        self.scripts_path = scripts_path
-        self.plugin_dir = scripts_path + PLUGIN_DIR
-        self.layers_path = None
-
-    def _build_plugin_dir_list(self, plugin_dir, ptype):
-        if self.layers_path is None:
-            self.layers_path = get_bitbake_var("BBLAYERS")
-        layer_dirs = []
-
-        if self.layers_path is not None:
-            for layer_path in self.layers_path.split():
-                path = os.path.join(layer_path, SCRIPTS_PLUGIN_DIR, ptype)
-                layer_dirs.append(path)
-
-        path = os.path.join(plugin_dir, ptype)
-        layer_dirs.append(path)
-
-        return layer_dirs
-
-    def append_dirs(self, dirs):
-        for path in dirs:
-            self._add_plugindir(path)
-
-        # load all the plugins AGAIN
-        self._load_all()
-
-    def _add_plugindir(self, path):
-        path = os.path.abspath(os.path.expanduser(path))
-
-        if not os.path.isdir(path):
-            return
-
-        if path not in self.plugin_dirs:
-            self.plugin_dirs[path] = False
-            # the value True/False means "loaded"
-
-    def _load_all(self):
-        for (pdir, loaded) in self.plugin_dirs.items():
-            if loaded:
-                continue
-
-            sys.path.insert(0, pdir)
-            for mod in [x[:-3] for x in os.listdir(pdir) if x.endswith(".py")]:
-                if mod and mod != '__init__':
-                    if mod in sys.modules:
-                        #self.plugin_dirs[pdir] = True
-                        msger.warning("Module %s already exists, skip" % mod)
-                    else:
-                        try:
-                            pymod = __import__(mod)
-                            self.plugin_dirs[pdir] = True
-                            msger.debug("Plugin module %s:%s imported"\
-                                        % (mod, pymod.__file__))
-                        except ImportError as err:
-                            msg = 'Failed to load plugin %s/%s: %s' \
-                                % (os.path.basename(pdir), mod, err)
-                            msger.warning(msg)
-
-            del sys.path[0]
-
-    def get_plugins(self, ptype):
-        """ the return value is dict of name:class pairs """
-
-        if ptype not in PLUGIN_TYPES:
-            raise errors.CreatorError('%s is not valid plugin type' % ptype)
-
-        plugins_dir = self._build_plugin_dir_list(self.plugin_dir, ptype)
-
-        self.append_dirs(plugins_dir)
-
-        return pluginbase.get_plugins(ptype)
-
-    def get_source_plugins(self):
-        """
-        Return list of available source plugins.
-        """
-        plugins_dir = self._build_plugin_dir_list(self.plugin_dir, 'source')
-
-        self.append_dirs(plugins_dir)
-
-        return self.get_plugins('source')
-
-
-    def get_source_plugin_methods(self, source_name, methods):
-        """
-        The methods param is a dict with the method names to find.  On
-        return, the dict values will be filled in with pointers to the
-        corresponding methods.  If one or more methods are not found,
-        None is returned.
-        """
-        return_methods = None
-        for _source_name, klass in self.get_plugins('source').items():
-            if _source_name == source_name:
-                for _method_name in methods:
-                    if not hasattr(klass, _method_name):
-                        msger.warning("Unimplemented %s source interface for: %s"\
-                                      % (_method_name, _source_name))
-                        return None
-                    func = getattr(klass, _method_name)
-                    methods[_method_name] = func
-                    return_methods = methods
-        return return_methods
-
-pluginmgr = PluginMgr()
diff --git a/import-layers/yocto-poky/scripts/lib/wic/pluginbase.py b/import-layers/yocto-poky/scripts/lib/wic/pluginbase.py
index e737dee..fb3d179 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/pluginbase.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/pluginbase.py
@@ -15,26 +15,74 @@
 # with this program; if not, write to the Free Software Foundation, Inc., 59
 # Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-__all__ = ['ImagerPlugin', 'SourcePlugin', 'get_plugins']
+__all__ = ['ImagerPlugin', 'SourcePlugin']
 
-import sys
+import os
+import logging
+
 from collections import defaultdict
+from importlib.machinery import SourceFileLoader
 
-from wic import msger
+from wic import WicError
+from wic.utils.misc import get_bitbake_var
+
+PLUGIN_TYPES = ["imager", "source"]
+
+SCRIPTS_PLUGIN_DIR = "scripts/lib/wic/plugins"
+
+logger = logging.getLogger('wic')
+
+PLUGINS = defaultdict(dict)
+
+class PluginMgr:
+    _plugin_dirs = []
+
+    @classmethod
+    def get_plugins(cls, ptype):
+        """Get dictionary of <plugin_name>:<class> pairs."""
+        if ptype not in PLUGIN_TYPES:
+            raise WicError('%s is not valid plugin type' % ptype)
+
+        # collect plugin directories
+        if not cls._plugin_dirs:
+            cls._plugin_dirs = [os.path.join(os.path.dirname(__file__), 'plugins')]
+            layers = get_bitbake_var("BBLAYERS") or ''
+            for layer_path in layers.split():
+                path = os.path.join(layer_path, SCRIPTS_PLUGIN_DIR)
+                path = os.path.abspath(os.path.expanduser(path))
+                if path not in cls._plugin_dirs and os.path.isdir(path):
+                    cls._plugin_dirs.insert(0, path)
+
+        if ptype not in PLUGINS:
+            # load all ptype plugins
+            for pdir in cls._plugin_dirs:
+                ppath = os.path.join(pdir, ptype)
+                if os.path.isdir(ppath):
+                    for fname in os.listdir(ppath):
+                        if fname.endswith('.py'):
+                            mname = fname[:-3]
+                            mpath = os.path.join(ppath, fname)
+                            logger.debug("loading plugin module %s", mpath)
+                            SourceFileLoader(mname, mpath).load_module()
+
+        return PLUGINS.get(ptype)
 
 class PluginMeta(type):
-    plugins = defaultdict(dict)
     def __new__(cls, name, bases, attrs):
         class_type = type.__new__(cls, name, bases, attrs)
         if 'name' in attrs:
-            cls.plugins[class_type.wic_plugin_type][attrs['name']] = class_type
+            PLUGINS[class_type.wic_plugin_type][attrs['name']] = class_type
 
         return class_type
 
-class ImagerPlugin(PluginMeta("Plugin", (), {})):
+class ImagerPlugin(metaclass=PluginMeta):
     wic_plugin_type = "imager"
 
-class SourcePlugin(PluginMeta("Plugin", (), {})):
+    def do_create(self):
+        raise WicError("Method %s.do_create is not implemented" %
+                       self.__class__.__name__)
+
+class SourcePlugin(metaclass=PluginMeta):
     wic_plugin_type = "source"
     """
     The methods that can be implemented by --source plugins.
@@ -50,7 +98,7 @@
         disk image.  This provides a hook to allow finalization of a
         disk image e.g. to write an MBR to it.
         """
-        msger.debug("SourcePlugin: do_install_disk: disk: %s" % disk_name)
+        logger.debug("SourcePlugin: do_install_disk: disk: %s", disk_name)
 
     @classmethod
     def do_stage_partition(cls, part, source_params, creator, cr_workdir,
@@ -67,7 +115,7 @@
         Not that get_bitbake_var() allows you to acces non-standard
         variables that you might want to use for this.
         """
-        msger.debug("SourcePlugin: do_stage_partition: part: %s" % part)
+        logger.debug("SourcePlugin: do_stage_partition: part: %s", part)
 
     @classmethod
     def do_configure_partition(cls, part, source_params, creator, cr_workdir,
@@ -78,7 +126,7 @@
         custom configuration files for a partition, for example
         syslinux or grub config files.
         """
-        msger.debug("SourcePlugin: do_configure_partition: part: %s" % part)
+        logger.debug("SourcePlugin: do_configure_partition: part: %s", part)
 
     @classmethod
     def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
@@ -88,7 +136,5 @@
         Called to do the actual content population for a partition i.e. it
         'prepares' the partition to be incorporated into the image.
         """
-        msger.debug("SourcePlugin: do_prepare_partition: part: %s" % part)
+        logger.debug("SourcePlugin: do_prepare_partition: part: %s", part)
 
-def get_plugins(typen):
-    return PluginMeta.plugins.get(typen)
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/imager/direct.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/imager/direct.py
new file mode 100644
index 0000000..f2e6127
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/imager/direct.py
@@ -0,0 +1,561 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2013, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This implements the 'direct' imager plugin class for 'wic'
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+
+import logging
+import os
+import shutil
+import tempfile
+import uuid
+
+from time import strftime
+
+from wic import WicError
+from wic.filemap import sparse_copy
+from wic.ksparser import KickStart, KickStartError
+from wic.pluginbase import PluginMgr, ImagerPlugin
+from wic.utils.misc import get_bitbake_var, exec_cmd, exec_native_cmd
+
+logger = logging.getLogger('wic')
+
+class DirectPlugin(ImagerPlugin):
+    """
+    Install a system into a file containing a partitioned disk image.
+
+    An image file is formatted with a partition table, each partition
+    created from a rootfs or other OpenEmbedded build artifact and dd'ed
+    into the virtual disk. The disk image can subsequently be dd'ed onto
+    media and used on actual hardware.
+    """
+    name = 'direct'
+
+    def __init__(self, wks_file, rootfs_dir, bootimg_dir, kernel_dir,
+                 native_sysroot, oe_builddir, options):
+        try:
+            self.ks = KickStart(wks_file)
+        except KickStartError as err:
+            raise WicError(str(err))
+
+        # parse possible 'rootfs=name' items
+        self.rootfs_dir = dict(rdir.split('=') for rdir in rootfs_dir.split(' '))
+        self.bootimg_dir = bootimg_dir
+        self.kernel_dir = kernel_dir
+        self.native_sysroot = native_sysroot
+        self.oe_builddir = oe_builddir
+
+        self.outdir = options.outdir
+        self.compressor = options.compressor
+        self.bmap = options.bmap
+
+        self.name = "%s-%s" % (os.path.splitext(os.path.basename(wks_file))[0],
+                               strftime("%Y%m%d%H%M"))
+        self.workdir = tempfile.mkdtemp(dir=self.outdir, prefix='tmp.wic.')
+        self._image = None
+        self.ptable_format = self.ks.bootloader.ptable
+        self.parts = self.ks.partitions
+
+        # as a convenience, set source to the boot partition source
+        # instead of forcing it to be set via bootloader --source
+        for part in self.parts:
+            if not self.ks.bootloader.source and part.mountpoint == "/boot":
+                self.ks.bootloader.source = part.source
+                break
+
+        image_path = self._full_path(self.workdir, self.parts[0].disk, "direct")
+        self._image = PartitionedImage(image_path, self.ptable_format,
+                                       self.parts, self.native_sysroot)
+
+    def do_create(self):
+        """
+        Plugin entry point.
+        """
+        try:
+            self.create()
+            self.assemble()
+            self.finalize()
+            self.print_info()
+        finally:
+            self.cleanup()
+
+    def _write_fstab(self, image_rootfs):
+        """overriden to generate fstab (temporarily) in rootfs. This is called
+        from _create, make sure it doesn't get called from
+        BaseImage.create()
+        """
+        if not image_rootfs:
+            return
+
+        fstab_path = image_rootfs + "/etc/fstab"
+        if not os.path.isfile(fstab_path):
+            return
+
+        with open(fstab_path) as fstab:
+            fstab_lines = fstab.readlines()
+
+        if self._update_fstab(fstab_lines, self.parts):
+            shutil.copyfile(fstab_path, fstab_path + ".orig")
+
+            with open(fstab_path, "w") as fstab:
+                fstab.writelines(fstab_lines)
+
+            return fstab_path
+
+    def _update_fstab(self, fstab_lines, parts):
+        """Assume partition order same as in wks"""
+        updated = False
+        for part in parts:
+            if not part.realnum or not part.mountpoint \
+               or part.mountpoint in ("/", "/boot"):
+                continue
+
+            # mmc device partitions are named mmcblk0p1, mmcblk0p2..
+            prefix = 'p' if  part.disk.startswith('mmcblk') else ''
+            device_name = "/dev/%s%s%d" % (part.disk, prefix, part.realnum)
+
+            opts = part.fsopts if part.fsopts else "defaults"
+            line = "\t".join([device_name, part.mountpoint, part.fstype,
+                              opts, "0", "0"]) + "\n"
+
+            fstab_lines.append(line)
+            updated = True
+
+        return updated
+
+    def _full_path(self, path, name, extention):
+        """ Construct full file path to a file we generate. """
+        return os.path.join(path, "%s-%s.%s" % (self.name, name, extention))
+
+    #
+    # Actual implemention
+    #
+    def create(self):
+        """
+        For 'wic', we already have our build artifacts - we just create
+        filesystems from the artifacts directly and combine them into
+        a partitioned image.
+        """
+        fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
+
+        for part in self.parts:
+            # get rootfs size from bitbake variable if it's not set in .ks file
+            if not part.size:
+                # and if rootfs name is specified for the partition
+                image_name = self.rootfs_dir.get(part.rootfs_dir)
+                if image_name and os.path.sep not in image_name:
+                    # Bitbake variable ROOTFS_SIZE is calculated in
+                    # Image._get_rootfs_size method from meta/lib/oe/image.py
+                    # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT,
+                    # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE
+                    rsize_bb = get_bitbake_var('ROOTFS_SIZE', image_name)
+                    if rsize_bb:
+                        part.size = int(round(float(rsize_bb)))
+
+        self._image.prepare(self)
+
+        if fstab_path:
+            shutil.move(fstab_path + ".orig", fstab_path)
+
+        self._image.layout_partitions()
+        self._image.create()
+
+    def assemble(self):
+        """
+        Assemble partitions into disk image
+        """
+        self._image.assemble()
+
+    def finalize(self):
+        """
+        Finalize the disk image.
+
+        For example, prepare the image to be bootable by e.g.
+        creating and installing a bootloader configuration.
+        """
+        source_plugin = self.ks.bootloader.source
+        disk_name = self.parts[0].disk
+        if source_plugin:
+            plugin = PluginMgr.get_plugins('source')[source_plugin]
+            plugin.do_install_disk(self._image, disk_name, self, self.workdir,
+                                   self.oe_builddir, self.bootimg_dir,
+                                   self.kernel_dir, self.native_sysroot)
+
+        full_path = self._image.path
+        # Generate .bmap
+        if self.bmap:
+            logger.debug("Generating bmap file for %s", disk_name)
+            exec_native_cmd("bmaptool create %s -o %s.bmap" % (full_path, full_path),
+                            self.native_sysroot)
+        # Compress the image
+        if self.compressor:
+            logger.debug("Compressing disk %s with %s", disk_name, self.compressor)
+            exec_cmd("%s %s" % (self.compressor, full_path))
+
+    def print_info(self):
+        """
+        Print the image(s) and artifacts used, for the user.
+        """
+        msg = "The new image(s) can be found here:\n"
+
+        extension = "direct" + {"gzip": ".gz",
+                                "bzip2": ".bz2",
+                                "xz": ".xz",
+                                None: ""}.get(self.compressor)
+        full_path = self._full_path(self.outdir, self.parts[0].disk, extension)
+        msg += '  %s\n\n' % full_path
+
+        msg += 'The following build artifacts were used to create the image(s):\n'
+        for part in self.parts:
+            if part.rootfs_dir is None:
+                continue
+            if part.mountpoint == '/':
+                suffix = ':'
+            else:
+                suffix = '["%s"]:' % (part.mountpoint or part.label)
+            msg += '  ROOTFS_DIR%s%s\n' % (suffix.ljust(20), part.rootfs_dir)
+
+        msg += '  BOOTIMG_DIR:                  %s\n' % self.bootimg_dir
+        msg += '  KERNEL_DIR:                   %s\n' % self.kernel_dir
+        msg += '  NATIVE_SYSROOT:               %s\n' % self.native_sysroot
+
+        logger.info(msg)
+
+    @property
+    def rootdev(self):
+        """
+        Get root device name to use as a 'root' parameter
+        in kernel command line.
+
+        Assume partition order same as in wks
+        """
+        for part in self.parts:
+            if part.mountpoint == "/":
+                if part.uuid:
+                    return "PARTUUID=%s" % part.uuid
+                else:
+                    suffix = 'p' if part.disk.startswith('mmcblk') else ''
+                    return "/dev/%s%s%-d" % (part.disk, suffix, part.realnum)
+
+    def cleanup(self):
+        if self._image:
+            self._image.cleanup()
+
+        # Move results to the output dir
+        if not os.path.exists(self.outdir):
+            os.makedirs(self.outdir)
+
+        for fname in os.listdir(self.workdir):
+            path = os.path.join(self.workdir, fname)
+            if os.path.isfile(path):
+                shutil.move(path, os.path.join(self.outdir, fname))
+
+        # remove work directory
+        shutil.rmtree(self.workdir, ignore_errors=True)
+
+# Overhead of the MBR partitioning scheme (just one sector)
+MBR_OVERHEAD = 1
+
+# Overhead of the GPT partitioning scheme
+GPT_OVERHEAD = 34
+
+# Size of a sector in bytes
+SECTOR_SIZE = 512
+
+class PartitionedImage():
+    """
+    Partitioned image in a file.
+    """
+
+    def __init__(self, path, ptable_format, partitions, native_sysroot=None):
+        self.path = path  # Path to the image file
+        self.numpart = 0  # Number of allocated partitions
+        self.realpart = 0 # Number of partitions in the partition table
+        self.offset = 0   # Offset of next partition (in sectors)
+        self.min_size = 0 # Minimum required disk size to fit
+                          # all partitions (in bytes)
+        self.ptable_format = ptable_format  # Partition table format
+        # Disk system identifier
+        self.identifier = int.from_bytes(os.urandom(4), 'little')
+
+        self.partitions = partitions
+        self.partimages = []
+        # Size of a sector used in calculations
+        self.sector_size = SECTOR_SIZE
+        self.native_sysroot = native_sysroot
+
+        # calculate the real partition number, accounting for partitions not
+        # in the partition table and logical partitions
+        realnum = 0
+        for part in self.partitions:
+            if part.no_table:
+                part.realnum = 0
+            else:
+                realnum += 1
+                if self.ptable_format == 'msdos' and realnum > 3:
+                    part.realnum = realnum + 1
+                    continue
+                part.realnum = realnum
+
+        # generate parition UUIDs
+        for part in self.partitions:
+            if not part.uuid and part.use_uuid:
+                if self.ptable_format == 'gpt':
+                    part.uuid = str(uuid.uuid4())
+                else: # msdos partition table
+                    part.uuid = '%08x-%02d' % (self.identifier, part.realnum)
+
+    def prepare(self, imager):
+        """Prepare an image. Call prepare method of all image partitions."""
+        for part in self.partitions:
+            # need to create the filesystems in order to get their
+            # sizes before we can add them and do the layout.
+            part.prepare(imager, imager.workdir, imager.oe_builddir,
+                         imager.rootfs_dir, imager.bootimg_dir,
+                         imager.kernel_dir, imager.native_sysroot)
+
+            # Converting kB to sectors for parted
+            part.size_sec = part.disk_size * 1024 // self.sector_size
+
+    def layout_partitions(self):
+        """ Layout the partitions, meaning calculate the position of every
+        partition on the disk. The 'ptable_format' parameter defines the
+        partition table format and may be "msdos". """
+
+        logger.debug("Assigning %s partitions to disks", self.ptable_format)
+
+        # The number of primary and logical partitions. Extended partition and
+        # partitions not listed in the table are not included.
+        num_real_partitions = len([p for p in self.partitions if not p.no_table])
+
+        # Go through partitions in the order they are added in .ks file
+        for num in range(len(self.partitions)):
+            part = self.partitions[num]
+
+            if self.ptable_format == 'msdos' and part.part_type:
+                # The --part-type can also be implemented for MBR partitions,
+                # in which case it would map to the 1-byte "partition type"
+                # filed at offset 3 of the partition entry.
+                raise WicError("setting custom partition type is not " \
+                               "implemented for msdos partitions")
+
+            # Get the disk where the partition is located
+            self.numpart += 1
+            if not part.no_table:
+                self.realpart += 1
+
+            if self.numpart == 1:
+                if self.ptable_format == "msdos":
+                    overhead = MBR_OVERHEAD
+                elif self.ptable_format == "gpt":
+                    overhead = GPT_OVERHEAD
+
+                # Skip one sector required for the partitioning scheme overhead
+                self.offset += overhead
+
+            if self.realpart > 3 and num_real_partitions > 4:
+                # Reserve a sector for EBR for every logical partition
+                # before alignment is performed.
+                if self.ptable_format == "msdos":
+                    self.offset += 1
+
+            if part.align:
+                # If not first partition and we do have alignment set we need
+                # to align the partition.
+                # FIXME: This leaves a empty spaces to the disk. To fill the
+                # gaps we could enlargea the previous partition?
+
+                # Calc how much the alignment is off.
+                align_sectors = self.offset % (part.align * 1024 // self.sector_size)
+
+                if align_sectors:
+                    # If partition is not aligned as required, we need
+                    # to move forward to the next alignment point
+                    align_sectors = (part.align * 1024 // self.sector_size) - align_sectors
+
+                    logger.debug("Realignment for %s%s with %s sectors, original"
+                                 " offset %s, target alignment is %sK.",
+                                 part.disk, self.numpart, align_sectors,
+                                 self.offset, part.align)
+
+                    # increase the offset so we actually start the partition on right alignment
+                    self.offset += align_sectors
+
+            part.start = self.offset
+            self.offset += part.size_sec
+
+            part.type = 'primary'
+            if not part.no_table:
+                part.num = self.realpart
+            else:
+                part.num = 0
+
+            if self.ptable_format == "msdos":
+                # only count the partitions that are in partition table
+                if num_real_partitions > 4:
+                    if self.realpart > 3:
+                        part.type = 'logical'
+                        part.num = self.realpart + 1
+
+            logger.debug("Assigned %s to %s%d, sectors range %d-%d size %d "
+                         "sectors (%d bytes).", part.mountpoint, part.disk,
+                         part.num, part.start, self.offset - 1, part.size_sec,
+                         part.size_sec * self.sector_size)
+
+        # Once all the partitions have been layed out, we can calculate the
+        # minumim disk size
+        self.min_size = self.offset
+        if self.ptable_format == "gpt":
+            self.min_size += GPT_OVERHEAD
+
+        self.min_size *= self.sector_size
+
+    def _create_partition(self, device, parttype, fstype, start, size):
+        """ Create a partition on an image described by the 'device' object. """
+
+        # Start is included to the size so we need to substract one from the end.
+        end = start + size - 1
+        logger.debug("Added '%s' partition, sectors %d-%d, size %d sectors",
+                     parttype, start, end, size)
+
+        cmd = "parted -s %s unit s mkpart %s" % (device, parttype)
+        if fstype:
+            cmd += " %s" % fstype
+        cmd += " %d %d" % (start, end)
+
+        return exec_native_cmd(cmd, self.native_sysroot)
+
+    def create(self):
+        logger.debug("Creating sparse file %s", self.path)
+        with open(self.path, 'w') as sparse:
+            os.ftruncate(sparse.fileno(), self.min_size)
+
+        logger.debug("Initializing partition table for %s", self.path)
+        exec_native_cmd("parted -s %s mklabel %s" %
+                        (self.path, self.ptable_format), self.native_sysroot)
+
+        logger.debug("Set disk identifier %x", self.identifier)
+        with open(self.path, 'r+b') as img:
+            img.seek(0x1B8)
+            img.write(self.identifier.to_bytes(4, 'little'))
+
+        logger.debug("Creating partitions")
+
+        for part in self.partitions:
+            if part.num == 0:
+                continue
+
+            if self.ptable_format == "msdos" and part.num == 5:
+                # Create an extended partition (note: extended
+                # partition is described in MBR and contains all
+                # logical partitions). The logical partitions save a
+                # sector for an EBR just before the start of a
+                # partition. The extended partition must start one
+                # sector before the start of the first logical
+                # partition. This way the first EBR is inside of the
+                # extended partition. Since the extended partitions
+                # starts a sector before the first logical partition,
+                # add a sector at the back, so that there is enough
+                # room for all logical partitions.
+                self._create_partition(self.path, "extended",
+                                       None, part.start - 1,
+                                       self.offset - part.start + 1)
+
+            if part.fstype == "swap":
+                parted_fs_type = "linux-swap"
+            elif part.fstype == "vfat":
+                parted_fs_type = "fat32"
+            elif part.fstype == "msdos":
+                parted_fs_type = "fat16"
+                if not part.system_id:
+                    part.system_id = '0x6' # FAT16
+            else:
+                # Type for ext2/ext3/ext4/btrfs
+                parted_fs_type = "ext2"
+
+            # Boot ROM of OMAP boards require vfat boot partition to have an
+            # even number of sectors.
+            if part.mountpoint == "/boot" and part.fstype in ["vfat", "msdos"] \
+               and part.size_sec % 2:
+                logger.debug("Subtracting one sector from '%s' partition to "
+                             "get even number of sectors for the partition",
+                             part.mountpoint)
+                part.size_sec -= 1
+
+            self._create_partition(self.path, part.type,
+                                   parted_fs_type, part.start, part.size_sec)
+
+            if part.part_type:
+                logger.debug("partition %d: set type UID to %s",
+                             part.num, part.part_type)
+                exec_native_cmd("sgdisk --typecode=%d:%s %s" % \
+                                         (part.num, part.part_type,
+                                          self.path), self.native_sysroot)
+
+            if part.uuid and self.ptable_format == "gpt":
+                logger.debug("partition %d: set UUID to %s",
+                             part.num, part.uuid)
+                exec_native_cmd("sgdisk --partition-guid=%d:%s %s" % \
+                                (part.num, part.uuid, self.path),
+                                self.native_sysroot)
+
+            if part.label and self.ptable_format == "gpt":
+                logger.debug("partition %d: set name to %s",
+                             part.num, part.label)
+                exec_native_cmd("parted -s %s name %d %s" % \
+                                (self.path, part.num, part.label),
+                                self.native_sysroot)
+
+            if part.active:
+                flag_name = "legacy_boot" if self.ptable_format == 'gpt' else "boot"
+                logger.debug("Set '%s' flag for partition '%s' on disk '%s'",
+                             flag_name, part.num, self.path)
+                exec_native_cmd("parted -s %s set %d %s on" % \
+                                (self.path, part.num, flag_name),
+                                self.native_sysroot)
+            if part.system_id:
+                exec_native_cmd("sfdisk --part-type %s %s %s" % \
+                                (self.path, part.num, part.system_id),
+                                self.native_sysroot)
+
+    def cleanup(self):
+        # remove partition images
+        for image in set(self.partimages):
+            os.remove(image)
+
+    def assemble(self):
+        logger.debug("Installing partitions")
+
+        for part in self.partitions:
+            source = part.source_file
+            if source:
+                # install source_file contents into a partition
+                sparse_copy(source, self.path, part.start * self.sector_size)
+
+                logger.debug("Installed %s in partition %d, sectors %d-%d, "
+                             "size %d sectors", source, part.num, part.start,
+                             part.start + part.size_sec - 1, part.size_sec)
+
+                partimage = self.path + '.p%d' % part.num
+                os.rename(source, partimage)
+                self.partimages.append(partimage)
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/imager/direct_plugin.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/imager/direct_plugin.py
deleted file mode 100644
index 8fe3930..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/plugins/imager/direct_plugin.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# Copyright (c) 2013, Intel Corporation.
-# All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# DESCRIPTION
-# This implements the 'direct' imager plugin class for 'wic'
-#
-# AUTHORS
-# Tom Zanussi <tom.zanussi (at] linux.intel.com>
-#
-
-from wic.utils import errors
-from wic.conf import configmgr
-
-import wic.imager.direct as direct
-from wic.pluginbase import ImagerPlugin
-
-class DirectPlugin(ImagerPlugin):
-    """
-    Install a system into a file containing a partitioned disk image.
-
-    An image file is formatted with a partition table, each partition
-    created from a rootfs or other OpenEmbedded build artifact and dd'ed
-    into the virtual disk. The disk image can subsequently be dd'ed onto
-    media and used on actual hardware.
-    """
-
-    name = 'direct'
-
-    @classmethod
-    def __rootfs_dir_to_dict(cls, rootfs_dirs):
-        """
-        Gets a string that contain 'connection=dir' splitted by
-        space and return a dict
-        """
-        krootfs_dir = {}
-        for rootfs_dir in rootfs_dirs.split(' '):
-            key, val = rootfs_dir.split('=')
-            krootfs_dir[key] = val
-
-        return krootfs_dir
-
-    @classmethod
-    def do_create(cls, opts, *args):
-        """
-        Create direct image, called from creator as 'direct' cmd
-        """
-        if len(args) != 8:
-            raise errors.Usage("Extra arguments given")
-
-        native_sysroot = args[0]
-        kernel_dir = args[1]
-        bootimg_dir = args[2]
-        rootfs_dir = args[3]
-
-        creatoropts = configmgr.create
-        ksconf = args[4]
-
-        image_output_dir = args[5]
-        oe_builddir = args[6]
-        compressor = args[7]
-
-        krootfs_dir = cls.__rootfs_dir_to_dict(rootfs_dir)
-
-        configmgr._ksconf = ksconf
-
-        creator = direct.DirectImageCreator(oe_builddir,
-                                            image_output_dir,
-                                            krootfs_dir,
-                                            bootimg_dir,
-                                            kernel_dir,
-                                            native_sysroot,
-                                            compressor,
-                                            creatoropts,
-                                            opts.bmap)
-
-        try:
-            creator.create()
-            creator.assemble()
-            creator.finalize()
-            creator.print_outimage_info()
-
-        except errors.CreatorError:
-            raise
-        finally:
-            creator.cleanup()
-
-        return 0
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-efi.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-efi.py
index 4adb80b..9879cb9 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -24,25 +24,28 @@
 # Tom Zanussi <tom.zanussi (at] linux.intel.com>
 #
 
+import logging
 import os
 import shutil
 
-from wic import msger
+from wic import WicError
+from wic.engine import get_custom_config
 from wic.pluginbase import SourcePlugin
-from wic.utils.misc import get_custom_config
-from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var, \
-                              BOOTDD_EXTRA_SPACE
+from wic.utils.misc import (exec_cmd, exec_native_cmd, get_bitbake_var,
+                            BOOTDD_EXTRA_SPACE)
+
+logger = logging.getLogger('wic')
 
 class BootimgEFIPlugin(SourcePlugin):
     """
     Create EFI boot partition.
-    This plugin supports GRUB 2 and gummiboot bootloaders.
+    This plugin supports GRUB 2 and systemd-boot bootloaders.
     """
 
     name = 'bootimg-efi'
 
     @classmethod
-    def do_configure_grubefi(cls, hdddir, creator, cr_workdir):
+    def do_configure_grubefi(cls, creator, cr_workdir):
         """
         Create loader-specific (grub-efi) config
         """
@@ -53,11 +56,11 @@
             if custom_cfg:
                 # Use a custom configuration for grub
                 grubefi_conf = custom_cfg
-                msger.debug("Using custom configuration file "
-                        "%s for grub.cfg" % configfile)
+                logger.debug("Using custom configuration file "
+                             "%s for grub.cfg", configfile)
             else:
-                msger.error("configfile is specified but failed to "
-                        "get it from %s." % configfile)
+                raise WicError("configfile is specified but failed to "
+                               "get it from %s." % configfile)
 
         if not custom_cfg:
             # Create grub configuration using parameters from wks file
@@ -75,14 +78,14 @@
                 % (kernel, creator.rootdev, bootloader.append)
             grubefi_conf += "}\n"
 
-        msger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg" \
-                        % cr_workdir)
+        logger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg",
+                     cr_workdir)
         cfg = open("%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir, "w")
         cfg.write(grubefi_conf)
         cfg.close()
 
     @classmethod
-    def do_configure_gummiboot(cls, hdddir, creator, cr_workdir):
+    def do_configure_systemdboot(cls, hdddir, creator, cr_workdir, source_params):
         """
         Create loader-specific systemd-boot/gummiboot config
         """
@@ -98,8 +101,21 @@
         loader_conf += "default boot\n"
         loader_conf += "timeout %d\n" % bootloader.timeout
 
-        msger.debug("Writing gummiboot config %s/hdd/boot/loader/loader.conf" \
-                        % cr_workdir)
+        initrd = source_params.get('initrd')
+
+        if initrd:
+            # obviously we need to have a common common deploy var
+            bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+            if not bootimg_dir:
+                raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
+
+            cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir)
+            exec_cmd(cp_cmd, True)
+        else:
+            logger.debug("Ignoring missing initrd")
+
+        logger.debug("Writing systemd-boot config "
+                     "%s/hdd/boot/loader/loader.conf", cr_workdir)
         cfg = open("%s/hdd/boot/loader/loader.conf" % cr_workdir, "w")
         cfg.write(loader_conf)
         cfg.close()
@@ -109,16 +125,16 @@
         if configfile:
             custom_cfg = get_custom_config(configfile)
             if custom_cfg:
-                # Use a custom configuration for gummiboot
+                # Use a custom configuration for systemd-boot
                 boot_conf = custom_cfg
-                msger.debug("Using custom configuration file "
-                        "%s for gummiboots's boot.conf" % configfile)
+                logger.debug("Using custom configuration file "
+                             "%s for systemd-boots's boot.conf", configfile)
             else:
-                msger.error("configfile is specified but failed to "
-                        "get it from %s." % configfile)
+                raise WicError("configfile is specified but failed to "
+                               "get it from %s.", configfile)
 
         if not custom_cfg:
-            # Create gummiboot configuration using parameters from wks file
+            # Create systemd-boot configuration using parameters from wks file
             kernel = "/bzImage"
 
             boot_conf = ""
@@ -127,8 +143,11 @@
             boot_conf += "options LABEL=Boot root=%s %s\n" % \
                              (creator.rootdev, bootloader.append)
 
-        msger.debug("Writing gummiboot config %s/hdd/boot/loader/entries/boot.conf" \
-                        % cr_workdir)
+            if initrd:
+                boot_conf += "initrd /%s\n" % initrd
+
+        logger.debug("Writing systemd-boot config "
+                     "%s/hdd/boot/loader/entries/boot.conf", cr_workdir)
         cfg = open("%s/hdd/boot/loader/entries/boot.conf" % cr_workdir, "w")
         cfg.write(boot_conf)
         cfg.close()
@@ -148,14 +167,13 @@
 
         try:
             if source_params['loader'] == 'grub-efi':
-                cls.do_configure_grubefi(hdddir, creator, cr_workdir)
-            elif source_params['loader'] == 'gummiboot' \
-                 or source_params['loader'] == 'systemd-boot':
-                cls.do_configure_gummiboot(hdddir, creator, cr_workdir)
+                cls.do_configure_grubefi(creator, cr_workdir)
+            elif source_params['loader'] == 'systemd-boot':
+                cls.do_configure_systemdboot(hdddir, creator, cr_workdir, source_params)
             else:
-                msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader'])
+                raise WicError("unrecognized bootimg-efi loader: %s" % source_params['loader'])
         except KeyError:
-            msger.error("bootimg-efi requires a loader, none specified")
+            raise WicError("bootimg-efi requires a loader, none specified")
 
 
     @classmethod
@@ -167,12 +185,10 @@
         'prepares' the partition to be incorporated into the image.
         In this case, prepare content for an EFI (grub) boot partition.
         """
-        if not bootimg_dir:
-            bootimg_dir = get_bitbake_var("HDDDIR")
-            if not bootimg_dir:
-                msger.error("Couldn't find HDDDIR, exiting\n")
-            # just so the result notes display it
-            creator.set_bootimg_dir(bootimg_dir)
+        if not kernel_dir:
+            kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+            if not kernel_dir:
+                raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
 
         staging_kernel_dir = kernel_dir
 
@@ -182,24 +198,27 @@
             (staging_kernel_dir, hdddir)
         exec_cmd(install_cmd)
 
+
         try:
             if source_params['loader'] == 'grub-efi':
                 shutil.copyfile("%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir,
                                 "%s/grub.cfg" % cr_workdir)
-                cp_cmd = "cp %s/EFI/BOOT/* %s/EFI/BOOT" % (bootimg_dir, hdddir)
-                exec_cmd(cp_cmd, True)
+                for mod in [x for x in os.listdir(kernel_dir) if x.startswith("grub-efi-")]:
+                    cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[9:])
+                    exec_cmd(cp_cmd, True)
                 shutil.move("%s/grub.cfg" % cr_workdir,
                             "%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir)
-            elif source_params['loader'] == 'gummiboot' \
-                 or source_params['loader'] == 'systemd-boot':
-                cp_cmd = "cp %s/EFI/BOOT/* %s/EFI/BOOT" % (bootimg_dir, hdddir)
-                exec_cmd(cp_cmd, True)
+            elif source_params['loader'] == 'systemd-boot':
+                for mod in [x for x in os.listdir(kernel_dir) if x.startswith("systemd-")]:
+                    cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[8:])
+                    exec_cmd(cp_cmd, True)
             else:
-                msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader'])
+                raise WicError("unrecognized bootimg-efi loader: %s" %
+                               source_params['loader'])
         except KeyError:
-            msger.error("bootimg-efi requires a loader, none specified")
+            raise WicError("bootimg-efi requires a loader, none specified")
 
-        startup = os.path.join(bootimg_dir, "startup.nsh")
+        startup = os.path.join(kernel_dir, "startup.nsh")
         if os.path.exists(startup):
             cp_cmd = "cp %s %s/" % (startup, hdddir)
             exec_cmd(cp_cmd, True)
@@ -215,8 +234,8 @@
 
         blocks += extra_blocks
 
-        msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
-                    (extra_blocks, part.mountpoint, blocks))
+        logger.debug("Added %d extra blocks to %s to get to %d total blocks",
+                     extra_blocks, part.mountpoint, blocks)
 
         # dosfs image, created by mkdosfs
         bootimg = "%s/boot.img" % cr_workdir
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-partition.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-partition.py
index b76c121..13fddbd 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-partition.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -23,14 +23,18 @@
 # Maciej Borzecki <maciej.borzecki (at] open-rnd.pl>
 #
 
+import logging
 import os
 import re
 
-from wic import msger
-from wic.pluginbase import SourcePlugin
-from wic.utils.oe.misc import exec_cmd, get_bitbake_var
 from glob import glob
 
+from wic import WicError
+from wic.pluginbase import SourcePlugin
+from wic.utils.misc import exec_cmd, get_bitbake_var
+
+logger = logging.getLogger('wic')
+
 class BootimgPartitionPlugin(SourcePlugin):
     """
     Create an image of boot partition, copying over files
@@ -40,26 +44,6 @@
     name = 'bootimg-partition'
 
     @classmethod
-    def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir,
-                        bootimg_dir, kernel_dir, native_sysroot):
-        """
-        Called after all partitions have been prepared and assembled into a
-        disk image. Do nothing.
-        """
-        pass
-
-    @classmethod
-    def do_configure_partition(cls, part, source_params, cr, cr_workdir,
-                               oe_builddir, bootimg_dir, kernel_dir,
-                               native_sysroot):
-        """
-        Called before do_prepare_partition(). Possibly prepare
-        configuration files of some sort.
-
-        """
-        pass
-
-    @classmethod
     def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
                              oe_builddir, bootimg_dir, kernel_dir,
                              rootfs_dir, native_sysroot):
@@ -74,19 +58,19 @@
         install_cmd = "install -d %s" % hdddir
         exec_cmd(install_cmd)
 
-        if not bootimg_dir:
-            bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
-            if not bootimg_dir:
-                msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n")
+        if not kernel_dir:
+            kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+            if not kernel_dir:
+                raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
 
-        msger.debug('Bootimg dir: %s' % bootimg_dir)
+        logger.debug('Kernel dir: %s', bootimg_dir)
 
         boot_files = get_bitbake_var("IMAGE_BOOT_FILES")
 
         if not boot_files:
-            msger.error('No boot files defined, IMAGE_BOOT_FILES unset')
+            raise WicError('No boot files defined, IMAGE_BOOT_FILES unset')
 
-        msger.debug('Boot files: %s' % boot_files)
+        logger.debug('Boot files: %s', boot_files)
 
         # list of tuples (src_name, dst_name)
         deploy_files = []
@@ -94,11 +78,11 @@
             if ';' in src_entry:
                 dst_entry = tuple(src_entry.split(';'))
                 if not dst_entry[0] or not dst_entry[1]:
-                    msger.error('Malformed boot file entry: %s' % (src_entry))
+                    raise WicError('Malformed boot file entry: %s' % src_entry)
             else:
                 dst_entry = (src_entry, src_entry)
 
-            msger.debug('Destination entry: %r' % (dst_entry,))
+            logger.debug('Destination entry: %r', dst_entry)
             deploy_files.append(dst_entry)
 
         for deploy_entry in deploy_files:
@@ -114,27 +98,26 @@
                                     os.path.join(dst,
                                                  os.path.basename(name))
 
-                srcs = glob(os.path.join(bootimg_dir, src))
+                srcs = glob(os.path.join(kernel_dir, src))
 
-                msger.debug('Globbed sources: %s' % (', '.join(srcs)))
+                logger.debug('Globbed sources: %s', ', '.join(srcs))
                 for entry in srcs:
                     entry_dst_name = entry_name_fn(entry)
                     install_task.append((entry,
                                          os.path.join(hdddir,
                                                       entry_dst_name)))
             else:
-                install_task = [(os.path.join(bootimg_dir, src),
+                install_task = [(os.path.join(kernel_dir, src),
                                  os.path.join(hdddir, dst))]
 
             for task in install_task:
                 src_path, dst_path = task
-                msger.debug('Install %s as %s' % (os.path.basename(src_path),
-                                                  dst_path))
+                logger.debug('Install %s as %s',
+                             os.path.basename(src_path), dst_path)
                 install_cmd = "install -m 0644 -D %s %s" \
                               % (src_path, dst_path)
                 exec_cmd(install_cmd)
 
-        msger.debug('Prepare boot partition using rootfs in %s' % (hdddir))
+        logger.debug('Prepare boot partition using rootfs in %s', hdddir)
         part.prepare_rootfs(cr_workdir, oe_builddir, hdddir,
                             native_sysroot)
-
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index f204daa..5890c12 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -24,15 +24,17 @@
 # Tom Zanussi <tom.zanussi (at] linux.intel.com>
 #
 
+import logging
 import os
 
-from wic.utils.errors import ImageError
-from wic import msger
+from wic import WicError
+from wic.engine import get_custom_config
 from wic.utils import runner
-from wic.utils.misc import get_custom_config
 from wic.pluginbase import SourcePlugin
-from wic.utils.oe.misc import exec_cmd, exec_native_cmd, \
-                              get_bitbake_var, BOOTDD_EXTRA_SPACE
+from wic.utils.misc import (exec_cmd, exec_native_cmd,
+                            get_bitbake_var, BOOTDD_EXTRA_SPACE)
+
+logger = logging.getLogger('wic')
 
 class BootimgPcbiosPlugin(SourcePlugin):
     """
@@ -42,33 +44,45 @@
     name = 'bootimg-pcbios'
 
     @classmethod
+    def _get_bootimg_dir(cls, bootimg_dir, dirname):
+        """
+        Check if dirname exists in default bootimg_dir or
+        in wic-tools STAGING_DIR.
+        """
+        for result in (bootimg_dir, get_bitbake_var("STAGING_DATADIR", "wic-tools")):
+            if os.path.exists("%s/%s" % (result, dirname)):
+                return result
+
+        raise WicError("Couldn't find correct bootimg_dir, exiting")
+
+    @classmethod
     def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
                         bootimg_dir, kernel_dir, native_sysroot):
         """
         Called after all partitions have been prepared and assembled into a
         disk image.  In this case, we install the MBR.
         """
+        bootimg_dir = cls._get_bootimg_dir(bootimg_dir, 'syslinux')
         mbrfile = "%s/syslinux/" % bootimg_dir
         if creator.ptable_format == 'msdos':
             mbrfile += "mbr.bin"
         elif creator.ptable_format == 'gpt':
             mbrfile += "gptmbr.bin"
         else:
-            msger.error("Unsupported partition table: %s" % creator.ptable_format)
+            raise WicError("Unsupported partition table: %s" %
+                           creator.ptable_format)
 
         if not os.path.exists(mbrfile):
-            msger.error("Couldn't find %s.  If using the -e option, do you "
-                        "have the right MACHINE set in local.conf?  If not, "
-                        "is the bootimg_dir path correct?" % mbrfile)
+            raise WicError("Couldn't find %s.  If using the -e option, do you "
+                           "have the right MACHINE set in local.conf?  If not, "
+                           "is the bootimg_dir path correct?" % mbrfile)
 
         full_path = creator._full_path(workdir, disk_name, "direct")
-        msger.debug("Installing MBR on disk %s as %s with size %s bytes" \
-                    % (disk_name, full_path, disk['min_size']))
+        logger.debug("Installing MBR on disk %s as %s with size %s bytes",
+                     disk_name, full_path, disk.min_size)
 
-        rcode = runner.show(['dd', 'if=%s' % mbrfile,
-                             'of=%s' % full_path, 'conv=notrunc'])
-        if rcode != 0:
-            raise ImageError("Unable to set MBR to %s" % full_path)
+        dd_cmd = "dd if=%s of=%s conv=notrunc" % (mbrfile, full_path)
+        exec_cmd(dd_cmd, native_sysroot)
 
     @classmethod
     def do_configure_partition(cls, part, source_params, creator, cr_workdir,
@@ -90,11 +104,11 @@
             if custom_cfg:
                 # Use a custom configuration for grub
                 syslinux_conf = custom_cfg
-                msger.debug("Using custom configuration file "
-                            "%s for syslinux.cfg" % bootloader.configfile)
+                logger.debug("Using custom configuration file %s "
+                             "for syslinux.cfg", bootloader.configfile)
             else:
-                msger.error("configfile is specified but failed to "
-                            "get it from %s." % bootloader.configfile)
+                raise WicError("configfile is specified but failed to "
+                               "get it from %s." % bootloader.configfile)
 
         if not custom_cfg:
             # Create syslinux configuration using parameters from wks file
@@ -122,8 +136,8 @@
             syslinux_conf += "APPEND label=boot root=%s %s\n" % \
                              (creator.rootdev, bootloader.append)
 
-        msger.debug("Writing syslinux config %s/hdd/boot/syslinux.cfg" \
-                    % cr_workdir)
+        logger.debug("Writing syslinux config %s/hdd/boot/syslinux.cfg",
+                     cr_workdir)
         cfg = open("%s/hdd/boot/syslinux.cfg" % cr_workdir, "w")
         cfg.write(syslinux_conf)
         cfg.close()
@@ -137,33 +151,25 @@
         'prepares' the partition to be incorporated into the image.
         In this case, prepare content for legacy bios boot partition.
         """
-        def _has_syslinux(dirname):
-            if dirname:
-                syslinux = "%s/syslinux" % dirname
-                if os.path.exists(syslinux):
-                    return True
-            return False
-
-        if not _has_syslinux(bootimg_dir):
-            bootimg_dir = get_bitbake_var("STAGING_DATADIR")
-            if not bootimg_dir:
-                msger.error("Couldn't find STAGING_DATADIR, exiting\n")
-            if not _has_syslinux(bootimg_dir):
-                msger.error("Please build syslinux first\n")
-            # just so the result notes display it
-            creator.set_bootimg_dir(bootimg_dir)
+        bootimg_dir = cls._get_bootimg_dir(bootimg_dir, 'syslinux')
 
         staging_kernel_dir = kernel_dir
 
         hdddir = "%s/hdd/boot" % cr_workdir
 
-        install_cmd = "install -m 0644 %s/bzImage %s/vmlinuz" \
-            % (staging_kernel_dir, hdddir)
-        exec_cmd(install_cmd)
+        cmds = ("install -m 0644 %s/bzImage %s/vmlinuz" %
+                (staging_kernel_dir, hdddir),
+                "install -m 444 %s/syslinux/ldlinux.sys %s/ldlinux.sys" %
+                (bootimg_dir, hdddir),
+                "install -m 0644 %s/syslinux/vesamenu.c32 %s/vesamenu.c32" %
+                (bootimg_dir, hdddir),
+                "install -m 444 %s/syslinux/libcom32.c32 %s/libcom32.c32" %
+                (bootimg_dir, hdddir),
+                "install -m 444 %s/syslinux/libutil.c32 %s/libutil.c32" %
+                (bootimg_dir, hdddir))
 
-        install_cmd = "install -m 444 %s/syslinux/ldlinux.sys %s/ldlinux.sys" \
-            % (bootimg_dir, hdddir)
-        exec_cmd(install_cmd)
+        for install_cmd in cmds:
+            exec_cmd(install_cmd)
 
         du_cmd = "du -bks %s" % hdddir
         out = exec_cmd(du_cmd)
@@ -176,8 +182,8 @@
 
         blocks += extra_blocks
 
-        msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
-                    (extra_blocks, part.mountpoint, blocks))
+        logger.debug("Added %d extra blocks to %s to get to %d total blocks",
+                     extra_blocks, part.mountpoint, blocks)
 
         # dosfs image, created by mkdosfs
         bootimg = "%s/boot.img" % cr_workdir
@@ -198,7 +204,5 @@
         out = exec_cmd(du_cmd)
         bootimg_size = out.split()[0]
 
-        part.size = int(out.split()[0])
+        part.size = int(bootimg_size)
         part.source_file = bootimg
-
-
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/fsimage.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/fsimage.py
deleted file mode 100644
index f894e89..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/fsimage.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-import os
-
-from wic import msger
-from wic.pluginbase import SourcePlugin
-from wic.utils.oe.misc import get_bitbake_var
-
-class FSImagePlugin(SourcePlugin):
-    """
-    Add an already existing filesystem image to the partition layout.
-    """
-
-    name = 'fsimage'
-
-    @classmethod
-    def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir,
-                        bootimg_dir, kernel_dir, native_sysroot):
-        """
-        Called after all partitions have been prepared and assembled into a
-        disk image. Do nothing.
-        """
-        pass
-
-    @classmethod
-    def do_configure_partition(cls, part, source_params, cr, cr_workdir,
-                               oe_builddir, bootimg_dir, kernel_dir,
-                               native_sysroot):
-        """
-        Called before do_prepare_partition(). Possibly prepare
-        configuration files of some sort.
-        """
-        pass
-
-    @classmethod
-    def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
-                             oe_builddir, bootimg_dir, kernel_dir,
-                             rootfs_dir, native_sysroot):
-        """
-        Called to do the actual content population for a partition i.e. it
-        'prepares' the partition to be incorporated into the image.
-        """
-        if not bootimg_dir:
-            bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
-            if not bootimg_dir:
-                msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n")
-
-        msger.debug('Bootimg dir: %s' % bootimg_dir)
-
-        if 'file' not in source_params:
-            msger.error("No file specified\n")
-            return
-
-        src = os.path.join(bootimg_dir, source_params['file'])
-
-
-        msger.debug('Preparing partition using image %s' % (src))
-        part.prepare_rootfs_from_fs_image(cr_workdir, src, "")
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 3858fd4..1ceba62 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -20,15 +20,18 @@
 # AUTHORS
 # Mihaly Varga <mihaly.varga (at] ni.com>
 
+import glob
+import logging
 import os
 import re
 import shutil
-import glob
 
-from wic import msger
+from wic import WicError
+from wic.engine import get_custom_config
 from wic.pluginbase import SourcePlugin
-from wic.utils.misc import get_custom_config
-from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var
+from wic.utils.misc import exec_cmd, exec_native_cmd, get_bitbake_var
+
+logger = logging.getLogger('wic')
 
 class IsoImagePlugin(SourcePlugin):
     """
@@ -85,8 +88,9 @@
         syslinux_conf += "APPEND initrd=/initrd LABEL=boot %s\n" \
                              % bootloader.append
 
-        msger.debug("Writing syslinux config %s/ISO/isolinux/isolinux.cfg" \
-                    % cr_workdir)
+        logger.debug("Writing syslinux config %s/ISO/isolinux/isolinux.cfg",
+                     cr_workdir)
+
         with open("%s/ISO/isolinux/isolinux.cfg" % cr_workdir, "w") as cfg:
             cfg.write(syslinux_conf)
 
@@ -99,11 +103,11 @@
         if configfile:
             grubefi_conf = get_custom_config(configfile)
             if grubefi_conf:
-                msger.debug("Using custom configuration file "
-                        "%s for grub.cfg" % configfile)
+                logger.debug("Using custom configuration file %s for grub.cfg",
+                             configfile)
             else:
-                msger.error("configfile is specified but failed to "
-                        "get it from %s." % configfile)
+                raise WicError("configfile is specified "
+                               "but failed to get it from %s", configfile)
         else:
             splash = os.path.join(cr_workdir, "EFI/boot/splash.jpg")
             if os.path.exists(splash):
@@ -133,8 +137,8 @@
             if splashline:
                 grubefi_conf += "%s\n" % splashline
 
-        msger.debug("Writing grubefi config %s/EFI/BOOT/grub.cfg" \
-                        % cr_workdir)
+        logger.debug("Writing grubefi config %s/EFI/BOOT/grub.cfg", cr_workdir)
+
         with open("%s/EFI/BOOT/grub.cfg" % cr_workdir, "w") as cfg:
             cfg.write(grubefi_conf)
 
@@ -144,25 +148,25 @@
         Create path for initramfs image
         """
 
-        initrd = get_bitbake_var("INITRD")
+        initrd = get_bitbake_var("INITRD_LIVE") or get_bitbake_var("INITRD")
         if not initrd:
             initrd_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
             if not initrd_dir:
-                msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting.\n")
+                raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting.")
 
             image_name = get_bitbake_var("IMAGE_BASENAME")
             if not image_name:
-                msger.error("Couldn't find IMAGE_BASENAME, exiting.\n")
+                raise WicError("Couldn't find IMAGE_BASENAME, exiting.")
 
             image_type = get_bitbake_var("INITRAMFS_FSTYPES")
             if not image_type:
-                msger.error("Couldn't find INITRAMFS_FSTYPES, exiting.\n")
+                raise WicError("Couldn't find INITRAMFS_FSTYPES, exiting.")
 
-            machine_arch = get_bitbake_var("MACHINE_ARCH")
-            if not machine_arch:
-                msger.error("Couldn't find MACHINE_ARCH, exiting.\n")
+            target_arch = get_bitbake_var("TRANSLATED_TARGET_ARCH")
+            if not target_arch:
+                raise WicError("Couldn't find TRANSLATED_TARGET_ARCH, exiting.")
 
-            initrd = glob.glob('%s/%s*%s.%s' % (initrd_dir, image_name, machine_arch, image_type))[0]
+            initrd = glob.glob('%s/%s*%s.%s' % (initrd_dir, image_name, target_arch, image_type))[0]
 
         if not os.path.exists(initrd):
             # Create initrd from rootfs directory
@@ -183,7 +187,7 @@
                 os.symlink(os.readlink("%s/sbin/init" % rootfs_dir), \
                             "%s/init" % initrd_dir)
             else:
-                msger.error("Couldn't find or build initrd, exiting.\n")
+                raise WicError("Couldn't find or build initrd, exiting.")
 
             exec_cmd("cd %s && find . | cpio -o -H newc -R +0:+0 >./initrd.cpio " \
                     % initrd_dir, as_shell=True)
@@ -194,55 +198,6 @@
         return initrd
 
     @classmethod
-    def do_stage_partition(cls, part, source_params, creator, cr_workdir,
-                           oe_builddir, bootimg_dir, kernel_dir,
-                           native_sysroot):
-        """
-        Special content staging called before do_prepare_partition().
-        It cheks if all necessary tools are available, if not
-        tries to instal them.
-        """
-        # Make sure parted is available in native sysroot
-        if not os.path.isfile("%s/usr/sbin/parted" % native_sysroot):
-            msger.info("Building parted-native...\n")
-            exec_cmd("bitbake parted-native")
-
-        # Make sure mkfs.ext2/3/4 is available in native sysroot
-        if not os.path.isfile("%s/sbin/mkfs.ext2" % native_sysroot):
-            msger.info("Building e2fsprogs-native...\n")
-            exec_cmd("bitbake e2fsprogs-native")
-
-        # Make sure syslinux is available in sysroot and in native sysroot
-        syslinux_dir = get_bitbake_var("STAGING_DATADIR")
-        if not syslinux_dir:
-            msger.error("Couldn't find STAGING_DATADIR, exiting.\n")
-        if not os.path.exists("%s/syslinux" % syslinux_dir):
-            msger.info("Building syslinux...\n")
-            exec_cmd("bitbake syslinux")
-        if not os.path.exists("%s/syslinux" % syslinux_dir):
-            msger.error("Please build syslinux first\n")
-
-        # Make sure syslinux is available in native sysroot
-        if not os.path.exists("%s/usr/bin/syslinux" % native_sysroot):
-            msger.info("Building syslinux-native...\n")
-            exec_cmd("bitbake syslinux-native")
-
-        #Make sure mkisofs is available in native sysroot
-        if not os.path.isfile("%s/usr/bin/mkisofs" % native_sysroot):
-            msger.info("Building cdrtools-native...\n")
-            exec_cmd("bitbake cdrtools-native")
-
-        # Make sure mkfs.vfat is available in native sysroot
-        if not os.path.isfile("%s/sbin/mkfs.vfat" % native_sysroot):
-            msger.info("Building dosfstools-native...\n")
-            exec_cmd("bitbake dosfstools-native")
-
-        # Make sure mtools is available in native sysroot
-        if not os.path.isfile("%s/usr/bin/mcopy" % native_sysroot):
-            msger.info("Building mtools-native...\n")
-            exec_cmd("bitbake mtools-native")
-
-    @classmethod
     def do_configure_partition(cls, part, source_params, creator, cr_workdir,
                                oe_builddir, bootimg_dir, kernel_dir,
                                native_sysroot):
@@ -258,11 +213,11 @@
         exec_cmd(install_cmd)
 
         # Overwrite the name of the created image
-        msger.debug("%s" % source_params)
+        logger.debug(source_params)
         if 'image_name' in source_params and \
                     source_params['image_name'].strip():
             creator.name = source_params['image_name'].strip()
-            msger.debug("The name of the image is: %s" % creator.name)
+            logger.debug("The name of the image is: %s", creator.name)
 
     @classmethod
     def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
@@ -278,7 +233,7 @@
 
         if part.rootfs_dir is None:
             if not 'ROOTFS_DIR' in rootfs_dir:
-                msger.error("Couldn't find --rootfs-dir, exiting.\n")
+                raise WicError("Couldn't find --rootfs-dir, exiting.")
             rootfs_dir = rootfs_dir['ROOTFS_DIR']
         else:
             if part.rootfs_dir in rootfs_dir:
@@ -286,24 +241,21 @@
             elif part.rootfs_dir:
                 rootfs_dir = part.rootfs_dir
             else:
-                msg = "Couldn't find --rootfs-dir=%s connection "
-                msg += "or it is not a valid path, exiting.\n"
-                msger.error(msg % part.rootfs_dir)
+                raise WicError("Couldn't find --rootfs-dir=%s connection "
+                               "or it is not a valid path, exiting." %
+                               part.rootfs_dir)
 
         if not os.path.isdir(rootfs_dir):
             rootfs_dir = get_bitbake_var("IMAGE_ROOTFS")
         if not os.path.isdir(rootfs_dir):
-            msger.error("Couldn't find IMAGE_ROOTFS, exiting.\n")
+            raise WicError("Couldn't find IMAGE_ROOTFS, exiting.")
 
         part.rootfs_dir = rootfs_dir
 
         # Prepare rootfs.img
-        hdd_dir = get_bitbake_var("HDDDIR")
+        deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
         img_iso_dir = get_bitbake_var("ISODIR")
-
-        rootfs_img = "%s/rootfs.img" % hdd_dir
-        if not os.path.isfile(rootfs_img):
-            rootfs_img = "%s/rootfs.img" % img_iso_dir
+        rootfs_img = "%s/rootfs.img" % img_iso_dir
         if not os.path.isfile(rootfs_img):
             # check if rootfs.img is in deploydir
             deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
@@ -331,15 +283,22 @@
         if os.path.isfile(part.source_file):
             os.remove(part.source_file)
 
-        # Prepare initial ramdisk
-        initrd = "%s/initrd" % hdd_dir
-        if not os.path.isfile(initrd):
-            initrd = "%s/initrd" % img_iso_dir
-        if not os.path.isfile(initrd):
-            initrd = cls._build_initramfs_path(rootfs_dir, cr_workdir)
+        # Support using a different initrd other than default
+        if source_params.get('initrd'):
+            initrd = source_params['initrd']
+            if not deploy_dir:
+                raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
+            cp_cmd = "cp %s/%s %s" % (deploy_dir, initrd, cr_workdir)
+            exec_cmd(cp_cmd)
+        else:
+            # Prepare initial ramdisk
+            initrd = "%s/initrd" % deploy_dir
+            if not os.path.isfile(initrd):
+                initrd = "%s/initrd" % img_iso_dir
+            if not os.path.isfile(initrd):
+                initrd = cls._build_initramfs_path(rootfs_dir, cr_workdir)
 
-        install_cmd = "install -m 0644 %s %s/initrd" \
-            % (initrd, isodir)
+        install_cmd = "install -m 0644 %s %s/initrd" % (initrd, isodir)
         exec_cmd(install_cmd)
 
         # Remove the temporary file created by _build_initramfs_path function
@@ -348,7 +307,7 @@
 
         # Install bzImage
         install_cmd = "install -m 0644 %s/bzImage %s/bzImage" % \
-            (kernel_dir, isodir)
+                      (kernel_dir, isodir)
         exec_cmd(install_cmd)
 
         #Create bootloader for efi boot
@@ -371,7 +330,7 @@
                 # didn't contains it
                 target_arch = get_bitbake_var("TARGET_SYS")
                 if not target_arch:
-                    msger.error("Coludn't find target architecture\n")
+                    raise WicError("Coludn't find target architecture")
 
                 if re.match("x86_64", target_arch):
                     grub_target = 'x86_64-efi'
@@ -380,21 +339,18 @@
                     grub_target = 'i386-efi'
                     grub_image = "bootia32.efi"
                 else:
-                    msger.error("grub-efi is incompatible with target %s\n" \
-                                % target_arch)
+                    raise WicError("grub-efi is incompatible with target %s" %
+                                   target_arch)
 
                 if not os.path.isfile("%s/EFI/BOOT/%s" \
                                 % (bootimg_dir, grub_image)):
-                    grub_path = get_bitbake_var("STAGING_LIBDIR")
+                    grub_path = get_bitbake_var("STAGING_LIBDIR", "wic-tools")
                     if not grub_path:
-                        msger.error("Couldn't find STAGING_LIBDIR, exiting.\n")
+                        raise WicError("Couldn't find STAGING_LIBDIR, exiting.")
 
                     grub_core = "%s/grub/%s" % (grub_path, grub_target)
                     if not os.path.exists(grub_core):
-                        msger.info("Building grub-efi...\n")
-                        exec_cmd("bitbake grub-efi")
-                    if not os.path.exists(grub_core):
-                        msger.error("Please build grub-efi first\n")
+                        raise WicError("Please build grub-efi first")
 
                     grub_cmd = "grub-mkimage -p '/EFI/BOOT' "
                     grub_cmd += "-d %s "  % grub_core
@@ -410,11 +366,10 @@
                     exec_native_cmd(grub_cmd, native_sysroot)
 
             else:
-                # TODO: insert gummiboot stuff
-                msger.error("unrecognized bootimg-efi loader: %s" \
-                            % source_params['loader'])
+                raise WicError("unrecognized bootimg-efi loader: %s" %
+                               source_params['loader'])
         except KeyError:
-            msger.error("bootimg-efi requires a loader, none specified")
+            raise WicError("bootimg-efi requires a loader, none specified")
 
         if os.path.exists("%s/EFI/BOOT" % isodir):
             shutil.rmtree("%s/EFI/BOOT" % isodir)
@@ -437,9 +392,8 @@
             blocks = int(out.split()[0])
             # Add some extra space for file system overhead
             blocks += 100
-            msg = "Added 100 extra blocks to %s to get to %d total blocks" \
-                    % (part.mountpoint, blocks)
-            msger.debug(msg)
+            logger.debug("Added 100 extra blocks to %s to get to %d "
+                         "total blocks", part.mountpoint, blocks)
 
             # dosfs image for EFI boot
             bootimg = "%s/efi.img" % isodir
@@ -459,9 +413,9 @@
             exec_cmd(chmod_cmd)
 
         # Prepare files for legacy boot
-        syslinux_dir = get_bitbake_var("STAGING_DATADIR")
+        syslinux_dir = get_bitbake_var("STAGING_DATADIR", "wic-tools")
         if not syslinux_dir:
-            msger.error("Couldn't find STAGING_DATADIR, exiting.\n")
+            raise WicError("Couldn't find STAGING_DATADIR, exiting.")
 
         if os.path.exists("%s/isolinux" % isodir):
             shutil.rmtree("%s/isolinux" % isodir)
@@ -501,7 +455,7 @@
         mkisofs_cmd += "-eltorito-platform 0xEF -eltorito-boot %s " % efi_img
         mkisofs_cmd += "-no-emul-boot %s " % isodir
 
-        msger.debug("running command: %s" % mkisofs_cmd)
+        logger.debug("running command: %s", mkisofs_cmd)
         exec_native_cmd(mkisofs_cmd, native_sysroot)
 
         shutil.rmtree(isodir)
@@ -522,23 +476,19 @@
         utility for booting via BIOS from disk storage devices.
         """
 
+        iso_img = "%s.p1" % disk.path
         full_path = creator._full_path(workdir, disk_name, "direct")
-        iso_img = "%s.p1" % full_path
         full_path_iso = creator._full_path(workdir, disk_name, "iso")
 
         isohybrid_cmd = "isohybrid -u %s" % iso_img
-        msger.debug("running command: %s" % \
-                    isohybrid_cmd)
+        logger.debug("running command: %s", isohybrid_cmd)
         exec_native_cmd(isohybrid_cmd, native_sysroot)
 
         # Replace the image created by direct plugin with the one created by
         # mkisofs command. This is necessary because the iso image created by
         # mkisofs has a very specific MBR is system area of the ISO image, and
         # direct plugin adds and configures an another MBR.
-        msger.debug("Replaceing the image created by direct plugin\n")
-        os.remove(full_path)
+        logger.debug("Replaceing the image created by direct plugin\n")
+        os.remove(disk.path)
         shutil.copy2(iso_img, full_path_iso)
         shutil.copy2(full_path_iso, full_path)
-
-        # Remove temporary ISO file
-        os.remove(iso_img)
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rawcopy.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rawcopy.py
index 618dd44..e1c4f5e 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rawcopy.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rawcopy.py
@@ -15,13 +15,16 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
+import logging
 import os
 
-from wic import msger
+from wic import WicError
 from wic.pluginbase import SourcePlugin
-from wic.utils.oe.misc import exec_cmd, get_bitbake_var
+from wic.utils.misc import exec_cmd, get_bitbake_var
 from wic.filemap import sparse_copy
 
+logger = logging.getLogger('wic')
+
 class RawCopyPlugin(SourcePlugin):
     """
     Populate partition content from raw image file.
@@ -30,25 +33,6 @@
     name = 'rawcopy'
 
     @classmethod
-    def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir,
-                        bootimg_dir, kernel_dir, native_sysroot):
-        """
-        Called after all partitions have been prepared and assembled into a
-        disk image. Do nothing.
-        """
-        pass
-
-    @classmethod
-    def do_configure_partition(cls, part, source_params, cr, cr_workdir,
-                               oe_builddir, bootimg_dir, kernel_dir,
-                               native_sysroot):
-        """
-        Called before do_prepare_partition(). Possibly prepare
-        configuration files of some sort.
-        """
-        pass
-
-    @classmethod
     def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
                              oe_builddir, bootimg_dir, kernel_dir,
                              rootfs_dir, native_sysroot):
@@ -56,18 +40,17 @@
         Called to do the actual content population for a partition i.e. it
         'prepares' the partition to be incorporated into the image.
         """
-        if not bootimg_dir:
-            bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
-            if not bootimg_dir:
-                msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n")
+        if not kernel_dir:
+            kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+            if not kernel_dir:
+                raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
 
-        msger.debug('Bootimg dir: %s' % bootimg_dir)
+        logger.debug('Kernel dir: %s', kernel_dir)
 
         if 'file' not in source_params:
-            msger.error("No file specified\n")
-            return
+            raise WicError("No file specified")
 
-        src = os.path.join(bootimg_dir, source_params['file'])
+        src = os.path.join(kernel_dir, source_params['file'])
         dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno))
 
         if 'skip' in source_params:
@@ -84,4 +67,3 @@
             part.size = filesize
 
         part.source_file = dst
-
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs.py
index 425da8b..f2e2ca8 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs.py
@@ -25,11 +25,17 @@
 # Joao Henrique Ferreira de Freitas <joaohf (at] gmail.com>
 #
 
+import logging
 import os
+import shutil
 
-from wic import msger
+from oe.path import copyhardlinktree
+
+from wic import WicError
 from wic.pluginbase import SourcePlugin
-from wic.utils.oe.misc import get_bitbake_var
+from wic.utils.misc import get_bitbake_var, exec_cmd
+
+logger = logging.getLogger('wic')
 
 class RootfsPlugin(SourcePlugin):
     """
@@ -45,10 +51,9 @@
 
         image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir)
         if not os.path.isdir(image_rootfs_dir):
-            msg = "No valid artifact IMAGE_ROOTFS from image named"
-            msg += " %s has been found at %s, exiting.\n" % \
-                (rootfs_dir, image_rootfs_dir)
-            msger.error(msg)
+            raise WicError("No valid artifact IMAGE_ROOTFS from image "
+                           "named %s has been found at %s, exiting." %
+                           (rootfs_dir, image_rootfs_dir))
 
         return image_rootfs_dir
 
@@ -63,8 +68,8 @@
         """
         if part.rootfs_dir is None:
             if not 'ROOTFS_DIR' in krootfs_dir:
-                msg = "Couldn't find --rootfs-dir, exiting"
-                msger.error(msg)
+                raise WicError("Couldn't find --rootfs-dir, exiting")
+
             rootfs_dir = krootfs_dir['ROOTFS_DIR']
         else:
             if part.rootfs_dir in krootfs_dir:
@@ -72,12 +77,49 @@
             elif part.rootfs_dir:
                 rootfs_dir = part.rootfs_dir
             else:
-                msg = "Couldn't find --rootfs-dir=%s connection"
-                msg += " or it is not a valid path, exiting"
-                msger.error(msg % part.rootfs_dir)
+                raise WicError("Couldn't find --rootfs-dir=%s connection or "
+                               "it is not a valid path, exiting" % part.rootfs_dir)
 
         real_rootfs_dir = cls.__get_rootfs_dir(rootfs_dir)
 
-        part.rootfs_dir = real_rootfs_dir
-        part.prepare_rootfs(cr_workdir, oe_builddir, real_rootfs_dir, native_sysroot)
+        # Handle excluded paths.
+        if part.exclude_path is not None:
+            # We need a new rootfs directory we can delete files from. Copy to
+            # workdir.
+            new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs"))
 
+            if os.path.lexists(new_rootfs):
+                shutil.rmtree(os.path.join(new_rootfs))
+
+            copyhardlinktree(real_rootfs_dir, new_rootfs)
+
+            real_rootfs_dir = new_rootfs
+
+            for orig_path in part.exclude_path:
+                path = orig_path
+                if os.path.isabs(path):
+                    msger.error("Must be relative: --exclude-path=%s" % orig_path)
+
+                full_path = os.path.realpath(os.path.join(new_rootfs, path))
+
+                # Disallow climbing outside of parent directory using '..',
+                # because doing so could be quite disastrous (we will delete the
+                # directory).
+                if not full_path.startswith(new_rootfs):
+                    msger.error("'%s' points to a path outside the rootfs" % orig_path)
+
+                if path.endswith(os.sep):
+                    # Delete content only.
+                    for entry in os.listdir(full_path):
+                        full_entry = os.path.join(full_path, entry)
+                        if os.path.isdir(full_entry) and not os.path.islink(full_entry):
+                            shutil.rmtree(full_entry)
+                        else:
+                            os.remove(full_entry)
+                else:
+                    # Delete whole directory.
+                    shutil.rmtree(full_path)
+
+        part.rootfs_dir = real_rootfs_dir
+        part.prepare_rootfs(cr_workdir, oe_builddir,
+                            real_rootfs_dir, native_sysroot)
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
deleted file mode 100644
index 3d60e6f..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
+++ /dev/null
@@ -1,177 +0,0 @@
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# This program is free software; you can distribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for mo details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# AUTHOR
-# Adrian Freihofer <adrian.freihofer (at] neratec.com>
-#
-
-import os
-from wic import msger
-from wic.utils import syslinux
-from wic.utils import runner
-from wic.utils.oe import misc
-from wic.utils.errors import ImageError
-from wic.pluginbase import SourcePlugin
-
-
-# pylint: disable=no-init
-class RootfsPlugin(SourcePlugin):
-    """
-    Create root partition and install syslinux bootloader
-
-    This plugin creates a disk image containing a bootable root partition with
-    syslinux installed. The filesystem is ext2/3/4, no extra boot partition is
-    required.
-
-    Example kickstart file:
-    part / --source rootfs-pcbios-ext --ondisk sda --fstype=ext4 --label rootfs --align 1024
-    bootloader --source rootfs-pcbios-ext --timeout=0 --append="rootwait rootfstype=ext4"
-
-    The first line generates a root file system including a syslinux.cfg file
-    The "--source rootfs-pcbios-ext" in the second line triggers the installation
-    of ldlinux.sys into the image.
-    """
-
-    name = 'rootfs-pcbios-ext'
-
-    @staticmethod
-    def _get_rootfs_dir(rootfs_dir):
-        """
-        Find rootfs pseudo dir
-
-        If rootfs_dir is a directory consider it as rootfs directory.
-        Otherwise ask bitbake about the IMAGE_ROOTFS directory.
-        """
-        if os.path.isdir(rootfs_dir):
-            return rootfs_dir
-
-        image_rootfs_dir = misc.get_bitbake_var("IMAGE_ROOTFS", rootfs_dir)
-        if not os.path.isdir(image_rootfs_dir):
-            msg = "No valid artifact IMAGE_ROOTFS from image named"
-            msg += " %s has been found at %s, exiting.\n" % \
-                (rootfs_dir, image_rootfs_dir)
-            msger.error(msg)
-
-        return image_rootfs_dir
-
-    # pylint: disable=unused-argument
-    @classmethod
-    def do_configure_partition(cls, part, source_params, image_creator,
-                               image_creator_workdir, oe_builddir, bootimg_dir,
-                               kernel_dir, native_sysroot):
-        """
-        Creates syslinux config in rootfs directory
-
-        Called before do_prepare_partition()
-        """
-        bootloader = image_creator.ks.bootloader
-
-        syslinux_conf = ""
-        syslinux_conf += "PROMPT 0\n"
-
-        syslinux_conf += "TIMEOUT " + str(bootloader.timeout) + "\n"
-        syslinux_conf += "ALLOWOPTIONS 1\n"
-
-        # Derive SERIAL... line from from kernel boot parameters
-        syslinux_conf += syslinux.serial_console_form_kargs(options) + "\n"
-
-        syslinux_conf += "DEFAULT linux\n"
-        syslinux_conf += "LABEL linux\n"
-        syslinux_conf += "  KERNEL /boot/bzImage\n"
-
-        syslinux_conf += "  APPEND label=boot root=%s %s\n" % \
-                             (image_creator.rootdev, bootloader.append)
-
-        syslinux_cfg = os.path.join(image_creator.rootfs_dir['ROOTFS_DIR'], "boot", "syslinux.cfg")
-        msger.debug("Writing syslinux config %s" % syslinux_cfg)
-        with open(syslinux_cfg, "w") as cfg:
-            cfg.write(syslinux_conf)
-
-    @classmethod
-    def do_prepare_partition(cls, part, source_params, image_creator,
-                             image_creator_workdir, oe_builddir, bootimg_dir,
-                             kernel_dir, krootfs_dir, native_sysroot):
-        """
-        Creates partition out of rootfs directory
-
-        Prepare content for a rootfs partition i.e. create a partition
-        and fill it from a /rootfs dir.
-        Install syslinux bootloader into root partition image file
-        """
-        def is_exe(exepath):
-            """Verify exepath is an executable file"""
-            return os.path.isfile(exepath) and os.access(exepath, os.X_OK)
-
-        # Make sure syslinux-nomtools is available in native sysroot or fail
-        native_syslinux_nomtools = os.path.join(native_sysroot, "usr/bin/syslinux-nomtools")
-        if not is_exe(native_syslinux_nomtools):
-            msger.info("building syslinux-native...")
-            misc.exec_cmd("bitbake syslinux-native")
-        if not is_exe(native_syslinux_nomtools):
-            msger.error("Couldn't find syslinux-nomtools (%s), exiting\n" %
-                        native_syslinux_nomtools)
-
-        if part.rootfs is None:
-            if 'ROOTFS_DIR' not in krootfs_dir:
-                msger.error("Couldn't find --rootfs-dir, exiting")
-            rootfs_dir = krootfs_dir['ROOTFS_DIR']
-        else:
-            if part.rootfs in krootfs_dir:
-                rootfs_dir = krootfs_dir[part.rootfs]
-            elif part.rootfs:
-                rootfs_dir = part.rootfs
-            else:
-                msg = "Couldn't find --rootfs-dir=%s connection"
-                msg += " or it is not a valid path, exiting"
-                msger.error(msg % part.rootfs)
-
-        real_rootfs_dir = cls._get_rootfs_dir(rootfs_dir)
-
-        part.rootfs_dir = real_rootfs_dir
-        part.prepare_rootfs(image_creator_workdir, oe_builddir, real_rootfs_dir, native_sysroot)
-
-        # install syslinux into rootfs partition
-        syslinux_cmd = "syslinux-nomtools -d /boot -i %s" % part.source_file
-        misc.exec_native_cmd(syslinux_cmd, native_sysroot)
-
-    @classmethod
-    def do_install_disk(cls, disk, disk_name, image_creator, workdir, oe_builddir,
-                        bootimg_dir, kernel_dir, native_sysroot):
-        """
-        Assemble partitions to disk image
-
-        Called after all partitions have been prepared and assembled into a
-        disk image. In this case, we install the MBR.
-        """
-        mbrfile = os.path.join(native_sysroot, "usr/share/syslinux/")
-        if image_creator.ptable_format == 'msdos':
-            mbrfile += "mbr.bin"
-        elif image_creator.ptable_format == 'gpt':
-            mbrfile += "gptmbr.bin"
-        else:
-            msger.error("Unsupported partition table: %s" % \
-                        image_creator.ptable_format)
-
-        if not os.path.exists(mbrfile):
-            msger.error("Couldn't find %s. Has syslinux-native been baked?" % mbrfile)
-
-        full_path = disk['disk'].device
-        msger.debug("Installing MBR on disk %s as %s with size %s bytes" \
-                    % (disk_name, full_path, disk['min_size']))
-
-        ret_code = runner.show(['dd', 'if=%s' % mbrfile, 'of=%s' % full_path, 'conv=notrunc'])
-        if ret_code != 0:
-            raise ImageError("Unable to set MBR to %s" % full_path)
diff --git a/import-layers/yocto-poky/scripts/lib/wic/test b/import-layers/yocto-poky/scripts/lib/wic/test
deleted file mode 100644
index 9daeafb..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/test
+++ /dev/null
@@ -1 +0,0 @@
-test
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/errors.py b/import-layers/yocto-poky/scripts/lib/wic/utils/errors.py
deleted file mode 100644
index d1b514d..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/utils/errors.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python -tt
-#
-# Copyright (c) 2007 Red Hat, Inc.
-# Copyright (c) 2011 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-class WicError(Exception):
-    pass
-
-class CreatorError(WicError):
-    pass
-
-class Usage(WicError):
-    pass
-
-class ImageError(WicError):
-    pass
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/misc.py b/import-layers/yocto-poky/scripts/lib/wic/utils/misc.py
index 1415ae9..37e0ad6 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/utils/misc.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/misc.py
@@ -1,95 +1,230 @@
-#!/usr/bin/env python -tt
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
 #
-# Copyright (c) 2010, 2011 Intel Inc.
+# Copyright (c) 2013, Intel Corporation.
+# All rights reserved.
 #
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
 #
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This module provides a place to collect various wic-related utils
+# for the OpenEmbedded Image Tools.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+"""Miscellaneous functions."""
 
+import logging
 import os
-import time
-import wic.engine
+import re
 
-def build_name(kscfg, release=None, prefix=None, suffix=None):
-    """Construct and return an image name string.
+from collections import defaultdict
+from distutils import spawn
 
-    This is a utility function to help create sensible name and fslabel
-    strings. The name is constructed using the sans-prefix-and-extension
-    kickstart filename and the supplied prefix and suffix.
+from wic import WicError
+from wic.utils import runner
 
-    kscfg -- a path to a kickstart file
-    release --  a replacement to suffix for image release
-    prefix -- a prefix to prepend to the name; defaults to None, which causes
-              no prefix to be used
-    suffix -- a suffix to append to the name; defaults to None, which causes
-              a YYYYMMDDHHMM suffix to be used
+logger = logging.getLogger('wic')
 
-    Note, if maxlen is less then the len(suffix), you get to keep both pieces.
+# executable -> recipe pairs for exec_native_cmd
+NATIVE_RECIPES = {"bmaptool": "bmap-tools",
+                  "grub-mkimage": "grub-efi",
+                  "isohybrid": "syslinux",
+                  "mcopy": "mtools",
+                  "mkdosfs": "dosfstools",
+                  "mkisofs": "cdrtools",
+                  "mkfs.btrfs": "btrfs-tools",
+                  "mkfs.ext2": "e2fsprogs",
+                  "mkfs.ext3": "e2fsprogs",
+                  "mkfs.ext4": "e2fsprogs",
+                  "mkfs.vfat": "dosfstools",
+                  "mksquashfs": "squashfs-tools",
+                  "mkswap": "util-linux",
+                  "mmd": "syslinux",
+                  "parted": "parted",
+                  "sfdisk": "util-linux",
+                  "sgdisk": "gptfdisk",
+                  "syslinux": "syslinux"
+                 }
 
+def _exec_cmd(cmd_and_args, as_shell=False):
     """
-    name = os.path.basename(kscfg)
-    idx = name.rfind('.')
-    if idx >= 0:
-        name = name[:idx]
+    Execute command, catching stderr, stdout
 
-    if release is not None:
-        suffix = ""
-    if prefix is None:
-        prefix = ""
-    if suffix is None:
-        suffix = time.strftime("%Y%m%d%H%M")
-
-    if name.startswith(prefix):
-        name = name[len(prefix):]
-
-    prefix = "%s-" % prefix if prefix else ""
-    suffix = "-%s" % suffix if suffix else ""
-
-    ret = prefix + name + suffix
-
-    return ret
-
-def find_canned(scripts_path, file_name):
+    Need to execute as_shell if the command uses wildcards
     """
-    Find a file either by its path or by name in the canned files dir.
+    logger.debug("_exec_cmd: %s", cmd_and_args)
+    args = cmd_and_args.split()
+    logger.debug(args)
 
-    Return None if not found
+    if as_shell:
+        ret, out = runner.runtool(cmd_and_args)
+    else:
+        ret, out = runner.runtool(args)
+    out = out.strip()
+    if ret != 0:
+        raise WicError("_exec_cmd: %s returned '%s' instead of 0\noutput: %s" % \
+                       (cmd_and_args, ret, out))
+
+    logger.debug("_exec_cmd: output for %s (rc = %d): %s",
+                 cmd_and_args, ret, out)
+
+    return ret, out
+
+
+def exec_cmd(cmd_and_args, as_shell=False):
     """
-    if os.path.exists(file_name):
-        return file_name
-
-    layers_canned_wks_dir = wic.engine.build_canned_image_list(scripts_path)
-    for canned_wks_dir in layers_canned_wks_dir:
-        for root, dirs, files in os.walk(canned_wks_dir):
-            for fname in files:
-                if fname == file_name:
-                    fullpath = os.path.join(canned_wks_dir, fname)
-                    return fullpath
-
-def get_custom_config(boot_file):
+    Execute command, return output
     """
-    Get the custom configuration to be used for the bootloader.
+    return _exec_cmd(cmd_and_args, as_shell)[1]
 
-    Return None if the file can't be found.
+
+def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""):
     """
-    scripts_path = os.path.abspath(os.path.dirname(__file__))
-    # Get the scripts path of poky
-    for x in range(0, 3):
-        scripts_path = os.path.dirname(scripts_path)
+    Execute native command, catching stderr, stdout
 
-    cfg_file = find_canned(scripts_path, boot_file)
-    if cfg_file:
-        with open(cfg_file, "r") as f:
-            config = f.read()
-        return config
+    Need to execute as_shell if the command uses wildcards
 
-    return None
+    Always need to execute native commands as_shell
+    """
+    # The reason -1 is used is because there may be "export" commands.
+    args = cmd_and_args.split(';')[-1].split()
+    logger.debug(args)
+
+    if pseudo:
+        cmd_and_args = pseudo + cmd_and_args
+
+    wtools_sysroot = get_bitbake_var("RECIPE_SYSROOT_NATIVE", "wic-tools")
+
+    native_paths = \
+            "%s/sbin:%s/usr/sbin:%s/usr/bin:%s/sbin:%s/usr/sbin:%s/usr/bin" % \
+            (wtools_sysroot, wtools_sysroot, wtools_sysroot,
+             native_sysroot, native_sysroot, native_sysroot)
+    native_cmd_and_args = "export PATH=%s:$PATH;%s" % \
+                           (native_paths, cmd_and_args)
+    logger.debug("exec_native_cmd: %s", native_cmd_and_args)
+
+    # If the command isn't in the native sysroot say we failed.
+    if spawn.find_executable(args[0], native_paths):
+        ret, out = _exec_cmd(native_cmd_and_args, True)
+    else:
+        ret = 127
+        out = "can't find native executable %s in %s" % (args[0], native_paths)
+
+    prog = args[0]
+    # shell command-not-found
+    if ret == 127 \
+       or (pseudo and ret == 1 and out == "Can't find '%s' in $PATH." % prog):
+        msg = "A native program %s required to build the image "\
+              "was not found (see details above).\n\n" % prog
+        recipe = NATIVE_RECIPES.get(prog)
+        if recipe:
+            msg += "Please make sure wic-tools have %s-native in its DEPENDS, bake it with 'bitbake wic-tools' "\
+                   "and try again.\n" % recipe
+        else:
+            msg += "Wic failed to find a recipe to build native %s. Please "\
+                   "file a bug against wic.\n" % prog
+        raise WicError(msg)
+
+    return ret, out
+
+BOOTDD_EXTRA_SPACE = 16384
+
+class BitbakeVars(defaultdict):
+    """
+    Container for Bitbake variables.
+    """
+    def __init__(self):
+        defaultdict.__init__(self, dict)
+
+        # default_image and vars_dir attributes should be set from outside
+        self.default_image = None
+        self.vars_dir = None
+
+    def _parse_line(self, line, image, matcher=re.compile(r"^([a-zA-Z0-9\-_+./~]+)=(.*)")):
+        """
+        Parse one line from bitbake -e output or from .env file.
+        Put result key-value pair into the storage.
+        """
+        if "=" not in line:
+            return
+        match = matcher.match(line)
+        if not match:
+            return
+        key, val = match.groups()
+        self[image][key] = val.strip('"')
+
+    def get_var(self, var, image=None, cache=True):
+        """
+        Get bitbake variable from 'bitbake -e' output or from .env file.
+        This is a lazy method, i.e. it runs bitbake or parses file only when
+        only when variable is requested. It also caches results.
+        """
+        if not image:
+            image = self.default_image
+
+        if image not in self:
+            if image and self.vars_dir:
+                fname = os.path.join(self.vars_dir, image + '.env')
+                if os.path.isfile(fname):
+                    # parse .env file
+                    with open(fname) as varsfile:
+                        for line in varsfile:
+                            self._parse_line(line, image)
+                else:
+                    print("Couldn't get bitbake variable from %s." % fname)
+                    print("File %s doesn't exist." % fname)
+                    return
+            else:
+                # Get bitbake -e output
+                cmd = "bitbake -e"
+                if image:
+                    cmd += " %s" % image
+
+                log_level = logger.getEffectiveLevel()
+                logger.setLevel(logging.INFO)
+                ret, lines = _exec_cmd(cmd)
+                logger.setLevel(log_level)
+
+                if ret:
+                    logger.error("Couldn't get '%s' output.", cmd)
+                    logger.error("Bitbake failed with error:\n%s\n", lines)
+                    return
+
+                # Parse bitbake -e output
+                for line in lines.split('\n'):
+                    self._parse_line(line, image)
+
+            # Make first image a default set of variables
+            if cache:
+                images = [key for key in self if key]
+                if len(images) == 1:
+                    self[None] = self[image]
+
+        result = self[image].get(var)
+        if not cache:
+            self.pop(image, None)
+
+        return result
+
+# Create BB_VARS singleton
+BB_VARS = BitbakeVars()
+
+def get_bitbake_var(var, image=None, cache=True):
+    """
+    Provide old get_bitbake_var API by wrapping
+    get_var method of BB_VARS singleton.
+    """
+    return BB_VARS.get_var(var, image, cache)
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/oe/__init__.py b/import-layers/yocto-poky/scripts/lib/wic/utils/oe/__init__.py
deleted file mode 100644
index 0a81575..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/utils/oe/__init__.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# OpenEmbedded wic utils library
-#
-# Copyright (c) 2013, Intel Corporation.
-# All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# AUTHORS
-# Tom Zanussi <tom.zanussi (at] linux.intel.com>
-#
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/oe/misc.py b/import-layers/yocto-poky/scripts/lib/wic/utils/oe/misc.py
deleted file mode 100644
index fe188c9..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/utils/oe/misc.py
+++ /dev/null
@@ -1,246 +0,0 @@
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# Copyright (c) 2013, Intel Corporation.
-# All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# DESCRIPTION
-# This module provides a place to collect various wic-related utils
-# for the OpenEmbedded Image Tools.
-#
-# AUTHORS
-# Tom Zanussi <tom.zanussi (at] linux.intel.com>
-#
-"""Miscellaneous functions."""
-
-import os
-from collections import defaultdict
-from distutils import spawn
-
-from wic import msger
-from wic.utils import runner
-
-# executable -> recipe pairs for exec_native_cmd
-NATIVE_RECIPES = {"bmaptool": "bmap-tools",
-                  "mcopy": "mtools",
-                  "mkdosfs": "dosfstools",
-                  "mkfs.btrfs": "btrfs-tools",
-                  "mkfs.ext2": "e2fsprogs",
-                  "mkfs.ext3": "e2fsprogs",
-                  "mkfs.ext4": "e2fsprogs",
-                  "mkfs.vfat": "dosfstools",
-                  "mksquashfs": "squashfs-tools",
-                  "mkswap": "util-linux",
-                  "parted": "parted",
-                  "sfdisk": "util-linux",
-                  "sgdisk": "gptfdisk",
-                  "syslinux": "syslinux"
-                 }
-
-def _exec_cmd(cmd_and_args, as_shell=False, catch=3):
-    """
-    Execute command, catching stderr, stdout
-
-    Need to execute as_shell if the command uses wildcards
-    """
-    msger.debug("_exec_cmd: %s" % cmd_and_args)
-    args = cmd_and_args.split()
-    msger.debug(args)
-
-    if as_shell:
-        ret, out = runner.runtool(cmd_and_args, catch)
-    else:
-        ret, out = runner.runtool(args, catch)
-    out = out.strip()
-    msger.debug("_exec_cmd: output for %s (rc = %d): %s" % \
-                (cmd_and_args, ret, out))
-
-    return (ret, out)
-
-
-def exec_cmd(cmd_and_args, as_shell=False, catch=3):
-    """
-    Execute command, catching stderr, stdout
-
-    Exits if rc non-zero
-    """
-    ret, out = _exec_cmd(cmd_and_args, as_shell, catch)
-
-    if ret != 0:
-        msger.error("exec_cmd: %s returned '%s' instead of 0" % \
-                    (cmd_and_args, ret))
-
-    return out
-
-def exec_native_cmd(cmd_and_args, native_sysroot, catch=3, pseudo=""):
-    """
-    Execute native command, catching stderr, stdout
-
-    Need to execute as_shell if the command uses wildcards
-
-    Always need to execute native commands as_shell
-    """
-    # The reason -1 is used is because there may be "export" commands.
-    args = cmd_and_args.split(';')[-1].split()
-    msger.debug(args)
-
-    if pseudo:
-        cmd_and_args = pseudo + cmd_and_args
-    native_paths = \
-        "%s/sbin:%s/usr/sbin:%s/usr/bin" % \
-        (native_sysroot, native_sysroot, native_sysroot)
-    native_cmd_and_args = "export PATH=%s:$PATH;%s" % \
-                           (native_paths, cmd_and_args)
-    msger.debug("exec_native_cmd: %s" % cmd_and_args)
-
-    # If the command isn't in the native sysroot say we failed.
-    if spawn.find_executable(args[0], native_paths):
-        ret, out = _exec_cmd(native_cmd_and_args, True, catch)
-    else:
-        ret = 127
-
-    prog = args[0]
-    # shell command-not-found
-    if ret == 127 \
-       or (pseudo and ret == 1 and out == "Can't find '%s' in $PATH." % prog):
-        msg = "A native program %s required to build the image "\
-              "was not found (see details above).\n\n" % prog
-        recipe = NATIVE_RECIPES.get(prog)
-        if recipe:
-            msg += "Please bake it with 'bitbake %s-native' "\
-                   "and try again.\n" % recipe
-        else:
-            msg += "Wic failed to find a recipe to build native %s. Please "\
-                   "file a bug against wic.\n" % prog
-        msger.error(msg)
-    if out:
-        msger.debug('"%s" output: %s' % (args[0], out))
-
-    if ret != 0:
-        msger.error("exec_cmd: '%s' returned '%s' instead of 0" % \
-                    (cmd_and_args, ret))
-
-    return ret, out
-
-BOOTDD_EXTRA_SPACE = 16384
-
-class BitbakeVars(defaultdict):
-    """
-    Container for Bitbake variables.
-    """
-    def __init__(self):
-        defaultdict.__init__(self, dict)
-
-        # default_image and vars_dir attributes should be set from outside
-        self.default_image = None
-        self.vars_dir = None
-
-    def _parse_line(self, line, image):
-        """
-        Parse one line from bitbake -e output or from .env file.
-        Put result key-value pair into the storage.
-        """
-        if "=" not in line:
-            return
-        try:
-            key, val = line.split("=")
-        except ValueError:
-            return
-        key = key.strip()
-        val = val.strip()
-        if key.replace('_', '').isalnum():
-            self[image][key] = val.strip('"')
-
-    def get_var(self, var, image=None):
-        """
-        Get bitbake variable from 'bitbake -e' output or from .env file.
-        This is a lazy method, i.e. it runs bitbake or parses file only when
-        only when variable is requested. It also caches results.
-        """
-        if not image:
-            image = self.default_image
-
-        if image not in self:
-            if image and self.vars_dir:
-                fname = os.path.join(self.vars_dir, image + '.env')
-                if os.path.isfile(fname):
-                    # parse .env file
-                    with open(fname) as varsfile:
-                        for line in varsfile:
-                            self._parse_line(line, image)
-                else:
-                    print("Couldn't get bitbake variable from %s." % fname)
-                    print("File %s doesn't exist." % fname)
-                    return
-            else:
-                # Get bitbake -e output
-                cmd = "bitbake -e"
-                if image:
-                    cmd += " %s" % image
-
-                log_level = msger.get_loglevel()
-                msger.set_loglevel('normal')
-                ret, lines = _exec_cmd(cmd)
-                msger.set_loglevel(log_level)
-
-                if ret:
-                    print("Couldn't get '%s' output." % cmd)
-                    print("Bitbake failed with error:\n%s\n" % lines)
-                    return
-
-                # Parse bitbake -e output
-                for line in lines.split('\n'):
-                    self._parse_line(line, image)
-
-            # Make first image a default set of variables
-            images = [key for key in self if key]
-            if len(images) == 1:
-                self[None] = self[image]
-
-        return self[image].get(var)
-
-# Create BB_VARS singleton
-BB_VARS = BitbakeVars()
-
-def get_bitbake_var(var, image=None):
-    """
-    Provide old get_bitbake_var API by wrapping
-    get_var method of BB_VARS singleton.
-    """
-    return BB_VARS.get_var(var, image)
-
-def parse_sourceparams(sourceparams):
-    """
-    Split sourceparams string of the form key1=val1[,key2=val2,...]
-    into a dict.  Also accepts valueless keys i.e. without =.
-
-    Returns dict of param key/val pairs (note that val may be None).
-    """
-    params_dict = {}
-
-    params = sourceparams.split(',')
-    if params:
-        for par in params:
-            if not par:
-                continue
-            if not '=' in par:
-                key = par
-                val = None
-            else:
-                key, val = par.split('=')
-            params_dict[key] = val
-
-    return params_dict
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/partitionedfs.py b/import-layers/yocto-poky/scripts/lib/wic/utils/partitionedfs.py
deleted file mode 100644
index 9ea4a30..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/utils/partitionedfs.py
+++ /dev/null
@@ -1,379 +0,0 @@
-#!/usr/bin/env python -tt
-#
-# Copyright (c) 2009, 2010, 2011 Intel, Inc.
-# Copyright (c) 2007, 2008 Red Hat, Inc.
-# Copyright (c) 2008 Daniel P. Berrange
-# Copyright (c) 2008 David P. Huff
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-from wic import msger
-from wic.utils.errors import ImageError
-from wic.utils.oe.misc import exec_cmd, exec_native_cmd
-from wic.filemap import sparse_copy
-
-# Overhead of the MBR partitioning scheme (just one sector)
-MBR_OVERHEAD = 1
-
-# Overhead of the GPT partitioning scheme
-GPT_OVERHEAD = 34
-
-# Size of a sector in bytes
-SECTOR_SIZE = 512
-
-class Image():
-    """
-    Generic base object for an image.
-
-    An Image is a container for a set of DiskImages and associated
-    partitions.
-    """
-    def __init__(self, native_sysroot=None):
-        self.disks = {}
-        self.partitions = []
-        self.partimages = []
-        # Size of a sector used in calculations
-        self.sector_size = SECTOR_SIZE
-        self._partitions_layed_out = False
-        self.native_sysroot = native_sysroot
-
-    def __add_disk(self, disk_name):
-        """ Add a disk 'disk_name' to the internal list of disks. Note,
-        'disk_name' is the name of the disk in the target system
-        (e.g., sdb). """
-
-        if disk_name in self.disks:
-            # We already have this disk
-            return
-
-        assert not self._partitions_layed_out
-
-        self.disks[disk_name] = \
-                {'disk': None,     # Disk object
-                 'numpart': 0,     # Number of allocate partitions
-                 'realpart': 0,    # Number of partitions in the partition table
-                 'partitions': [], # Indexes to self.partitions
-                 'offset': 0,      # Offset of next partition (in sectors)
-                 # Minimum required disk size to fit all partitions (in bytes)
-                 'min_size': 0,
-                 'ptable_format': "msdos", # Partition table format
-                 'identifier': None} # Disk system identifier
-
-    def add_disk(self, disk_name, disk_obj, identifier):
-        """ Add a disk object which have to be partitioned. More than one disk
-        can be added. In case of multiple disks, disk partitions have to be
-        added for each disk separately with 'add_partition()". """
-
-        self.__add_disk(disk_name)
-        self.disks[disk_name]['disk'] = disk_obj
-        self.disks[disk_name]['identifier'] = identifier
-
-    def __add_partition(self, part):
-        """ This is a helper function for 'add_partition()' which adds a
-        partition to the internal list of partitions. """
-
-        assert not self._partitions_layed_out
-
-        self.partitions.append(part)
-        self.__add_disk(part['disk_name'])
-
-    def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None,
-                      label=None, fsopts=None, boot=False, align=None, no_table=False,
-                      part_type=None, uuid=None, system_id=None):
-        """ Add the next partition. Partitions have to be added in the
-        first-to-last order. """
-
-        ks_pnum = len(self.partitions)
-
-        # Converting kB to sectors for parted
-        size = size * 1024 // self.sector_size
-
-        part = {'ks_pnum': ks_pnum, # Partition number in the KS file
-                'size': size, # In sectors
-                'mountpoint': mountpoint, # Mount relative to chroot
-                'source_file': source_file, # partition contents
-                'fstype': fstype, # Filesystem type
-                'fsopts': fsopts, # Filesystem mount options
-                'label': label, # Partition label
-                'disk_name': disk_name, # physical disk name holding partition
-                'device': None, # kpartx device node for partition
-                'num': None, # Partition number
-                'boot': boot, # Bootable flag
-                'align': align, # Partition alignment
-                'no_table' : no_table, # Partition does not appear in partition table
-                'part_type' : part_type, # Partition type
-                'uuid': uuid, # Partition UUID
-                'system_id': system_id} # Partition system id
-
-        self.__add_partition(part)
-
-    def layout_partitions(self, ptable_format="msdos"):
-        """ Layout the partitions, meaning calculate the position of every
-        partition on the disk. The 'ptable_format' parameter defines the
-        partition table format and may be "msdos". """
-
-        msger.debug("Assigning %s partitions to disks" % ptable_format)
-
-        if self._partitions_layed_out:
-            return
-
-        self._partitions_layed_out = True
-
-        # Go through partitions in the order they are added in .ks file
-        for num in range(len(self.partitions)):
-            part = self.partitions[num]
-
-            if part['disk_name'] not in self.disks:
-                raise ImageError("No disk %s for partition %s" \
-                                 % (part['disk_name'], part['mountpoint']))
-
-            if ptable_format == 'msdos' and part['part_type']:
-                # The --part-type can also be implemented for MBR partitions,
-                # in which case it would map to the 1-byte "partition type"
-                # filed at offset 3 of the partition entry.
-                raise ImageError("setting custom partition type is not " \
-                                 "implemented for msdos partitions")
-
-            # Get the disk where the partition is located
-            disk = self.disks[part['disk_name']]
-            disk['numpart'] += 1
-            if not part['no_table']:
-                disk['realpart'] += 1
-            disk['ptable_format'] = ptable_format
-
-            if disk['numpart'] == 1:
-                if ptable_format == "msdos":
-                    overhead = MBR_OVERHEAD
-                elif ptable_format == "gpt":
-                    overhead = GPT_OVERHEAD
-
-                # Skip one sector required for the partitioning scheme overhead
-                disk['offset'] += overhead
-
-            if disk['realpart'] > 3:
-                # Reserve a sector for EBR for every logical partition
-                # before alignment is performed.
-                if ptable_format == "msdos":
-                    disk['offset'] += 1
-
-
-            if part['align']:
-                # If not first partition and we do have alignment set we need
-                # to align the partition.
-                # FIXME: This leaves a empty spaces to the disk. To fill the
-                # gaps we could enlargea the previous partition?
-
-                # Calc how much the alignment is off.
-                align_sectors = disk['offset'] % (part['align'] * 1024 // self.sector_size)
-
-                if align_sectors:
-                    # If partition is not aligned as required, we need
-                    # to move forward to the next alignment point
-                    align_sectors = (part['align'] * 1024 // self.sector_size) - align_sectors
-
-                    msger.debug("Realignment for %s%s with %s sectors, original"
-                                " offset %s, target alignment is %sK." %
-                                (part['disk_name'], disk['numpart'], align_sectors,
-                                 disk['offset'], part['align']))
-
-                    # increase the offset so we actually start the partition on right alignment
-                    disk['offset'] += align_sectors
-
-            part['start'] = disk['offset']
-            disk['offset'] += part['size']
-
-            part['type'] = 'primary'
-            if not part['no_table']:
-                part['num'] = disk['realpart']
-            else:
-                part['num'] = 0
-
-            if disk['ptable_format'] == "msdos":
-                if len(self.partitions) > 4:
-                    if disk['realpart'] > 3:
-                        part['type'] = 'logical'
-                        part['num'] = disk['realpart'] + 1
-
-            disk['partitions'].append(num)
-            msger.debug("Assigned %s to %s%d, sectors range %d-%d size %d "
-                        "sectors (%d bytes)." \
-                            % (part['mountpoint'], part['disk_name'], part['num'],
-                               part['start'], part['start'] + part['size'] - 1,
-                               part['size'], part['size'] * self.sector_size))
-
-        # Once all the partitions have been layed out, we can calculate the
-        # minumim disk sizes.
-        for disk in self.disks.values():
-            disk['min_size'] = disk['offset']
-            if disk['ptable_format'] == "gpt":
-                disk['min_size'] += GPT_OVERHEAD
-
-            disk['min_size'] *= self.sector_size
-
-    def __create_partition(self, device, parttype, fstype, start, size):
-        """ Create a partition on an image described by the 'device' object. """
-
-        # Start is included to the size so we need to substract one from the end.
-        end = start + size - 1
-        msger.debug("Added '%s' partition, sectors %d-%d, size %d sectors" %
-                    (parttype, start, end, size))
-
-        cmd = "parted -s %s unit s mkpart %s" % (device, parttype)
-        if fstype:
-            cmd += " %s" % fstype
-        cmd += " %d %d" % (start, end)
-
-        return exec_native_cmd(cmd, self.native_sysroot)
-
-    def __format_disks(self):
-        self.layout_partitions()
-
-        for dev in self.disks:
-            disk = self.disks[dev]
-            msger.debug("Initializing partition table for %s" % \
-                        (disk['disk'].device))
-            exec_native_cmd("parted -s %s mklabel %s" % \
-                            (disk['disk'].device, disk['ptable_format']),
-                            self.native_sysroot)
-
-            if disk['identifier']:
-                msger.debug("Set disk identifier %x" % disk['identifier'])
-                with open(disk['disk'].device, 'r+b') as img:
-                    img.seek(0x1B8)
-                    img.write(disk['identifier'].to_bytes(4, 'little'))
-
-        msger.debug("Creating partitions")
-
-        for part in self.partitions:
-            if part['num'] == 0:
-                continue
-
-            disk = self.disks[part['disk_name']]
-            if disk['ptable_format'] == "msdos" and part['num'] == 5:
-                # Create an extended partition (note: extended
-                # partition is described in MBR and contains all
-                # logical partitions). The logical partitions save a
-                # sector for an EBR just before the start of a
-                # partition. The extended partition must start one
-                # sector before the start of the first logical
-                # partition. This way the first EBR is inside of the
-                # extended partition. Since the extended partitions
-                # starts a sector before the first logical partition,
-                # add a sector at the back, so that there is enough
-                # room for all logical partitions.
-                self.__create_partition(disk['disk'].device, "extended",
-                                        None, part['start'] - 1,
-                                        disk['offset'] - part['start'] + 1)
-
-            if part['fstype'] == "swap":
-                parted_fs_type = "linux-swap"
-            elif part['fstype'] == "vfat":
-                parted_fs_type = "fat32"
-            elif part['fstype'] == "msdos":
-                parted_fs_type = "fat16"
-            elif part['fstype'] == "ontrackdm6aux3":
-                parted_fs_type = "ontrackdm6aux3"
-            else:
-                # Type for ext2/ext3/ext4/btrfs
-                parted_fs_type = "ext2"
-
-            # Boot ROM of OMAP boards require vfat boot partition to have an
-            # even number of sectors.
-            if part['mountpoint'] == "/boot" and part['fstype'] in ["vfat", "msdos"] \
-               and part['size'] % 2:
-                msger.debug("Subtracting one sector from '%s' partition to " \
-                            "get even number of sectors for the partition" % \
-                            part['mountpoint'])
-                part['size'] -= 1
-
-            self.__create_partition(disk['disk'].device, part['type'],
-                                    parted_fs_type, part['start'], part['size'])
-
-            if part['part_type']:
-                msger.debug("partition %d: set type UID to %s" % \
-                            (part['num'], part['part_type']))
-                exec_native_cmd("sgdisk --typecode=%d:%s %s" % \
-                                         (part['num'], part['part_type'],
-                                          disk['disk'].device), self.native_sysroot)
-
-            if part['uuid'] and disk['ptable_format'] == "gpt":
-                msger.debug("partition %d: set UUID to %s" % \
-                            (part['num'], part['uuid']))
-                exec_native_cmd("sgdisk --partition-guid=%d:%s %s" % \
-                                (part['num'], part['uuid'], disk['disk'].device),
-                                self.native_sysroot)
-
-            if part['boot']:
-                flag_name = "legacy_boot" if disk['ptable_format'] == 'gpt' else "boot"
-                msger.debug("Set '%s' flag for partition '%s' on disk '%s'" % \
-                            (flag_name, part['num'], disk['disk'].device))
-                exec_native_cmd("parted -s %s set %d %s on" % \
-                                (disk['disk'].device, part['num'], flag_name),
-                                self.native_sysroot)
-            if part['system_id']:
-                exec_native_cmd("sfdisk --part-type %s %s %s" % \
-                                (disk['disk'].device, part['num'], part['system_id']),
-                                self.native_sysroot)
-
-            # Parted defaults to enabling the lba flag for fat16 partitions,
-            # which causes compatibility issues with some firmware (and really
-            # isn't necessary).
-            if parted_fs_type == "fat16":
-                if disk['ptable_format'] == 'msdos':
-                    msger.debug("Disable 'lba' flag for partition '%s' on disk '%s'" % \
-                                (part['num'], disk['disk'].device))
-                    exec_native_cmd("parted -s %s set %d lba off" % \
-                                    (disk['disk'].device, part['num']),
-                                    self.native_sysroot)
-
-    def cleanup(self):
-        if self.disks:
-            for dev in self.disks:
-                disk = self.disks[dev]
-                try:
-                    disk['disk'].cleanup()
-                except:
-                    pass
-        # remove partition images
-        for image in self.partimages:
-            if os.path.isfile(image):
-                os.remove(image)
-
-    def assemble(self, image_file):
-        msger.debug("Installing partitions")
-
-        for part in self.partitions:
-            source = part['source_file']
-            if source:
-                # install source_file contents into a partition
-                sparse_copy(source, image_file, part['start'] * self.sector_size)
-
-                msger.debug("Installed %s in partition %d, sectors %d-%d, "
-                            "size %d sectors" % \
-                            (source, part['num'], part['start'],
-                             part['start'] + part['size'] - 1, part['size']))
-
-                partimage = image_file + '.p%d' % part['num']
-                os.rename(source, partimage)
-                self.partimages.append(partimage)
-
-    def create(self):
-        for dev in self.disks:
-            disk = self.disks[dev]
-            disk['disk'].create()
-
-        self.__format_disks()
-
-        return
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/runner.py b/import-layers/yocto-poky/scripts/lib/wic/utils/runner.py
index db536ba..4aa00fb 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/utils/runner.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/runner.py
@@ -14,29 +14,17 @@
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc., 59
 # Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
 import subprocess
 
-from wic import msger
+from wic import WicError
 
-def runtool(cmdln_or_args, catch=1):
+def runtool(cmdln_or_args):
     """ wrapper for most of the subprocess calls
     input:
         cmdln_or_args: can be both args and cmdln str (shell=True)
-        catch: 0, quitely run
-               1, only STDOUT
-               2, only STDERR
-               3, both STDOUT and STDERR
     return:
-        (rc, output)
-        if catch==0: the output will always None
+        rc, output
     """
-
-    if catch not in (0, 1, 2, 3):
-        # invalid catch selection, will cause exception, that's good
-        return None
-
     if isinstance(cmdln_or_args, list):
         cmd = cmdln_or_args[0]
         shell = False
@@ -45,66 +33,20 @@
         cmd = shlex.split(cmdln_or_args)[0]
         shell = True
 
-    if catch != 3:
-        dev_null = os.open("/dev/null", os.O_WRONLY)
-
-    if catch == 0:
-        sout = dev_null
-        serr = dev_null
-    elif catch == 1:
-        sout = subprocess.PIPE
-        serr = dev_null
-    elif catch == 2:
-        sout = dev_null
-        serr = subprocess.PIPE
-    elif catch == 3:
-        sout = subprocess.PIPE
-        serr = subprocess.STDOUT
+    sout = subprocess.PIPE
+    serr = subprocess.STDOUT
 
     try:
         process = subprocess.Popen(cmdln_or_args, stdout=sout,
                                    stderr=serr, shell=shell)
-        (sout, serr) = process.communicate()
+        sout, serr = process.communicate()
         # combine stdout and stderr, filter None out and decode
         out = ''.join([out.decode('utf-8') for out in [sout, serr] if out])
     except OSError as err:
         if err.errno == 2:
             # [Errno 2] No such file or directory
-            msger.error('Cannot run command: %s, lost dependency?' % cmd)
+            raise WicError('Cannot run command: %s, lost dependency?' % cmd)
         else:
             raise # relay
-    finally:
-        if catch != 3:
-            os.close(dev_null)
 
-    return (process.returncode, out)
-
-def show(cmdln_or_args):
-    # show all the message using msger.verbose
-
-    rcode, out = runtool(cmdln_or_args, catch=3)
-
-    if isinstance(cmdln_or_args, list):
-        cmd = ' '.join(cmdln_or_args)
-    else:
-        cmd = cmdln_or_args
-
-    msg = 'running command: "%s"' % cmd
-    if out:
-        out = out.strip()
-    if out:
-        msg += ', with output::'
-        msg += '\n  +----------------'
-        for line in out.splitlines():
-            msg += '\n  | %s' % line
-        msg += '\n  +----------------'
-
-    msger.verbose(msg)
-    return rcode
-
-def outs(cmdln_or_args, catch=1):
-    # get the outputs of tools
-    return runtool(cmdln_or_args, catch)[1].strip()
-
-def quiet(cmdln_or_args):
-    return runtool(cmdln_or_args, catch=0)[0]
+    return process.returncode, out
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/syslinux.py b/import-layers/yocto-poky/scripts/lib/wic/utils/syslinux.py
deleted file mode 100644
index aace286..0000000
--- a/import-layers/yocto-poky/scripts/lib/wic/utils/syslinux.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# AUTHOR
-# Adrian Freihofer <adrian.freihofer (at] neratec.com>
-
-
-import re
-from wic import msger
-
-
-def serial_console_form_kargs(kernel_args):
-    """
-    Create SERIAL... line from kernel parameters
-
-    syslinux needs a line SERIAL port [baudrate [flowcontrol]]
-    in the syslinux.cfg file. The config line is generated based
-    on kernel boot parameters. The the parameters of the first
-    ttyS console are considered for syslinux config.
-    @param kernel_args kernel command line
-    @return line for syslinux config file e.g. "SERIAL 0 115200"
-    """
-    syslinux_conf = ""
-    for param in kernel_args.split():
-        param_match = re.match("console=ttyS([0-9]+),?([0-9]*)([noe]?)([0-9]?)(r?)", param)
-        if param_match:
-            syslinux_conf += "SERIAL " + param_match.group(1)
-            # baudrate
-            if param_match.group(2):
-                syslinux_conf += " " + param_match.group(2)
-            # parity
-            if param_match.group(3) and param_match.group(3) != 'n':
-                msger.warning("syslinux does not support parity for console. {} is ignored."
-                              .format(param_match.group(3)))
-            # number of bits
-            if param_match.group(4) and param_match.group(4) != '8':
-                msger.warning("syslinux supports 8 bit console configuration only. {} is ignored."
-                              .format(param_match.group(4)))
-            # flow control
-            if param_match.group(5) and param_match.group(5) != '':
-                msger.warning("syslinux console flowcontrol configuration. {} is ignored."
-                              .format(param_match.group(5)))
-            break
-
-    return syslinux_conf
diff --git a/import-layers/yocto-poky/scripts/multilib_header_wrapper.h b/import-layers/yocto-poky/scripts/multilib_header_wrapper.h
index 5a87540..f516673 100644
--- a/import-layers/yocto-poky/scripts/multilib_header_wrapper.h
+++ b/import-layers/yocto-poky/scripts/multilib_header_wrapper.h
@@ -21,11 +21,23 @@
  * 
  */
 
+
+#if defined (__arm__)
+#define __MHWORDSIZE			32
+#elif defined (__aarch64__) && defined ( __LP64__)
+#define __MHWORDSIZE			64
+#elif defined (__aarch64__)
+#define __MHWORDSIZE			32
+#else
 #include <bits/wordsize.h>
+#if defined (__WORDSIZE)
+#define __MHWORDSIZE			__WORDSIZE
+#else
+#error "__WORDSIZE is not defined"
+#endif
+#endif
 
-#ifdef __WORDSIZE
-
-#if __WORDSIZE == 32
+#if __MHWORDSIZE == 32
 
 #ifdef _MIPS_SIM
 
@@ -41,15 +53,9 @@
 #include <ENTER_HEADER_FILENAME_HERE-32.h>
 #endif
 
-#elif __WORDSIZE == 64
+#elif __MHWORDSIZE == 64
 #include <ENTER_HEADER_FILENAME_HERE-64.h>
 #else
 #error "Unknown __WORDSIZE detected"
 #endif /* matches #if __WORDSIZE == 32 */
-
-#else /* __WORDSIZE is not defined */
-
-#error "__WORDSIZE is not defined"
-
-#endif
   
diff --git a/import-layers/yocto-poky/scripts/oe-build-perf-report b/import-layers/yocto-poky/scripts/oe-build-perf-report
new file mode 100755
index 0000000..6f0b84f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-build-perf-report
@@ -0,0 +1,534 @@
+#!/usr/bin/python3
+#
+# Examine build performance test results
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+import argparse
+import json
+import logging
+import os
+import re
+import sys
+from collections import namedtuple, OrderedDict
+from operator import attrgetter
+from xml.etree import ElementTree as ET
+
+# Import oe libs
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(scripts_path, 'lib'))
+import scriptpath
+from build_perf import print_table
+from build_perf.report import (metadata_xml_to_json, results_xml_to_json,
+                               aggregate_data, aggregate_metadata, measurement_stats)
+from build_perf import html
+
+scriptpath.add_oe_lib_path()
+
+from oeqa.utils.git import GitRepo
+
+
+# Setup logging
+logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
+log = logging.getLogger('oe-build-perf-report')
+
+
+# Container class for tester revisions
+TestedRev = namedtuple('TestedRev', 'commit commit_number tags')
+
+
+def get_test_runs(repo, tag_name, **kwargs):
+    """Get a sorted list of test runs, matching given pattern"""
+    # First, get field names from the tag name pattern
+    field_names = [m.group(1) for m in re.finditer(r'{(\w+)}', tag_name)]
+    undef_fields = [f for f in field_names if f not in kwargs.keys()]
+
+    # Fields for formatting tag name pattern
+    str_fields = dict([(f, '*') for f in field_names])
+    str_fields.update(kwargs)
+
+    # Get a list of all matching tags
+    tag_pattern = tag_name.format(**str_fields)
+    tags = repo.run_cmd(['tag', '-l', tag_pattern]).splitlines()
+    log.debug("Found %d tags matching pattern '%s'", len(tags), tag_pattern)
+
+    # Parse undefined fields from tag names
+    str_fields = dict([(f, r'(?P<{}>[\w\-.()]+)'.format(f)) for f in field_names])
+    str_fields['branch'] = r'(?P<branch>[\w\-.()/]+)'
+    str_fields['commit'] = '(?P<commit>[0-9a-f]{7,40})'
+    str_fields['commit_number'] = '(?P<commit_number>[0-9]{1,7})'
+    str_fields['tag_number'] = '(?P<tag_number>[0-9]{1,5})'
+    # escape parenthesis in fields in order to not messa up the regexp
+    fixed_fields = dict([(k, v.replace('(', r'\(').replace(')', r'\)')) for k, v in kwargs.items()])
+    str_fields.update(fixed_fields)
+    tag_re = re.compile(tag_name.format(**str_fields))
+
+    # Parse fields from tags
+    revs = []
+    for tag in tags:
+        m = tag_re.match(tag)
+        groups = m.groupdict()
+        revs.append([groups[f] for f in undef_fields] + [tag])
+
+    # Return field names and a sorted list of revs
+    return undef_fields, sorted(revs)
+
+def list_test_revs(repo, tag_name, **kwargs):
+    """Get list of all tested revisions"""
+    fields, revs = get_test_runs(repo, tag_name, **kwargs)
+    ignore_fields = ['tag_number']
+    print_fields = [i for i, f in enumerate(fields) if f not in ignore_fields]
+
+    # Sort revs
+    rows = [[fields[i].upper() for i in print_fields] + ['TEST RUNS']]
+    prev = [''] * len(revs)
+    for rev in revs:
+        # Only use fields that we want to print
+        rev = [rev[i] for i in print_fields]
+
+        if rev != prev:
+            new_row = [''] * len(print_fields) + [1]
+            for i in print_fields:
+                if rev[i] != prev[i]:
+                    break
+            new_row[i:-1] = rev[i:]
+            rows.append(new_row)
+        else:
+            rows[-1][-1] += 1
+        prev = rev
+
+    print_table(rows)
+
+def get_test_revs(repo, tag_name, **kwargs):
+    """Get list of all tested revisions"""
+    fields, runs = get_test_runs(repo, tag_name, **kwargs)
+
+    revs = {}
+    commit_i = fields.index('commit')
+    commit_num_i = fields.index('commit_number')
+    for run in runs:
+        commit = run[commit_i]
+        commit_num = run[commit_num_i]
+        tag = run[-1]
+        if not commit in revs:
+            revs[commit] = TestedRev(commit, commit_num, [tag])
+        else:
+            assert commit_num == revs[commit].commit_number, "Commit numbers do not match"
+            revs[commit].tags.append(tag)
+
+    # Return in sorted table
+    revs = sorted(revs.values(), key=attrgetter('commit_number'))
+    log.debug("Found %d tested revisions:\n    %s", len(revs),
+              "\n    ".join(['{} ({})'.format(rev.commit_number, rev.commit) for rev in revs]))
+    return revs
+
+def rev_find(revs, attr, val):
+    """Search from a list of TestedRev"""
+    for i, rev in enumerate(revs):
+        if getattr(rev, attr) == val:
+            return i
+    raise ValueError("Unable to find '{}' value '{}'".format(attr, val))
+
+def is_xml_format(repo, commit):
+    """Check if the commit contains xml (or json) data"""
+    if repo.rev_parse(commit + ':results.xml'):
+        log.debug("Detected report in xml format in %s", commit)
+        return True
+    else:
+        log.debug("No xml report in %s, assuming json formatted results", commit)
+        return False
+
+def read_results(repo, tags, xml=True):
+    """Read result files from repo"""
+
+    def parse_xml_stream(data):
+        """Parse multiple concatenated XML objects"""
+        objs = []
+        xml_d = ""
+        for line in data.splitlines():
+            if xml_d and line.startswith('<?xml version='):
+                objs.append(ET.fromstring(xml_d))
+                xml_d = line
+            else:
+                xml_d += line
+        objs.append(ET.fromstring(xml_d))
+        return objs
+
+    def parse_json_stream(data):
+        """Parse multiple concatenated JSON objects"""
+        objs = []
+        json_d = ""
+        for line in data.splitlines():
+            if line == '}{':
+                json_d += '}'
+                objs.append(json.loads(json_d, object_pairs_hook=OrderedDict))
+                json_d = '{'
+            else:
+                json_d += line
+        objs.append(json.loads(json_d, object_pairs_hook=OrderedDict))
+        return objs
+
+    num_revs = len(tags)
+
+    # Optimize by reading all data with one git command
+    log.debug("Loading raw result data from %d tags, %s...", num_revs, tags[0])
+    if xml:
+        git_objs = [tag + ':metadata.xml' for tag in tags] + [tag + ':results.xml' for tag in tags]
+        data = parse_xml_stream(repo.run_cmd(['show'] + git_objs + ['--']))
+        return ([metadata_xml_to_json(e) for e in data[0:num_revs]],
+                [results_xml_to_json(e) for e in data[num_revs:]])
+    else:
+        git_objs = [tag + ':metadata.json' for tag in tags] + [tag + ':results.json' for tag in tags]
+        data = parse_json_stream(repo.run_cmd(['show'] + git_objs + ['--']))
+        return data[0:num_revs], data[num_revs:]
+
+
+def get_data_item(data, key):
+    """Nested getitem lookup"""
+    for k in key.split('.'):
+        data = data[k]
+    return data
+
+
+def metadata_diff(metadata_l, metadata_r):
+    """Prepare a metadata diff for printing"""
+    keys = [('Hostname', 'hostname', 'hostname'),
+            ('Branch', 'branch', 'layers.meta.branch'),
+            ('Commit number', 'commit_num', 'layers.meta.commit_count'),
+            ('Commit', 'commit', 'layers.meta.commit'),
+            ('Number of test runs', 'testrun_count', 'testrun_count')
+           ]
+
+    def _metadata_diff(key):
+        """Diff metadata from two test reports"""
+        try:
+            val1 = get_data_item(metadata_l, key)
+        except KeyError:
+            val1 = '(N/A)'
+        try:
+            val2 = get_data_item(metadata_r, key)
+        except KeyError:
+            val2 = '(N/A)'
+        return val1, val2
+
+    metadata = OrderedDict()
+    for title, key, key_json in keys:
+        value_l, value_r = _metadata_diff(key_json)
+        metadata[key] = {'title': title,
+                         'value_old': value_l,
+                         'value': value_r}
+    return metadata
+
+
+def print_diff_report(metadata_l, data_l, metadata_r, data_r):
+    """Print differences between two data sets"""
+
+    # First, print general metadata
+    print("\nTEST METADATA:\n==============")
+    meta_diff = metadata_diff(metadata_l, metadata_r)
+    rows = []
+    row_fmt = ['{:{wid}} ', '{:<{wid}}   ', '{:<{wid}}']
+    rows = [['', 'CURRENT COMMIT', 'COMPARING WITH']]
+    for key, val in meta_diff.items():
+        # Shorten commit hashes
+        if key == 'commit':
+            rows.append([val['title'] + ':', val['value'][:20], val['value_old'][:20]])
+        else:
+            rows.append([val['title'] + ':', val['value'], val['value_old']])
+    print_table(rows, row_fmt)
+
+
+    # Print test results
+    print("\nTEST RESULTS:\n=============")
+
+    tests = list(data_l['tests'].keys())
+    # Append tests that are only present in 'right' set
+    tests += [t for t in list(data_r['tests'].keys()) if t not in tests]
+
+    # Prepare data to be printed
+    rows = []
+    row_fmt = ['{:8}', '{:{wid}}', '{:{wid}}', '  {:>{wid}}', ' {:{wid}} ', '{:{wid}}',
+               '  {:>{wid}}', '  {:>{wid}}']
+    num_cols = len(row_fmt)
+    for test in tests:
+        test_l = data_l['tests'][test] if test in data_l['tests'] else None
+        test_r = data_r['tests'][test] if test in data_r['tests'] else None
+        pref = ' '
+        if test_l is None:
+            pref = '+'
+        elif test_r is None:
+            pref = '-'
+        descr = test_l['description'] if test_l else test_r['description']
+        heading = "{} {}: {}".format(pref, test, descr)
+
+        rows.append([heading])
+
+        # Generate the list of measurements
+        meas_l = test_l['measurements'] if test_l else {}
+        meas_r = test_r['measurements'] if test_r else {}
+        measurements = list(meas_l.keys())
+        measurements += [m for m in list(meas_r.keys()) if m not in measurements]
+
+        for meas in measurements:
+            m_pref = ' '
+            if meas in meas_l:
+                stats_l = measurement_stats(meas_l[meas], 'l.')
+            else:
+                stats_l = measurement_stats(None, 'l.')
+                m_pref = '+'
+            if meas in meas_r:
+                stats_r = measurement_stats(meas_r[meas], 'r.')
+            else:
+                stats_r = measurement_stats(None, 'r.')
+                m_pref = '-'
+            stats = stats_l.copy()
+            stats.update(stats_r)
+
+            absdiff = stats['val_cls'](stats['r.mean'] - stats['l.mean'])
+            reldiff = "{:+.1f} %".format(absdiff * 100 / stats['l.mean'])
+            if stats['r.mean'] > stats['l.mean']:
+                absdiff = '+' + str(absdiff)
+            else:
+                absdiff = str(absdiff)
+            rows.append(['', m_pref, stats['name'] + ' ' + stats['quantity'],
+                         str(stats['l.mean']), '->', str(stats['r.mean']),
+                         absdiff, reldiff])
+        rows.append([''] * num_cols)
+
+    print_table(rows, row_fmt)
+
+    print()
+
+
+def print_html_report(data, id_comp):
+    """Print report in html format"""
+    # Handle metadata
+    metadata = {'branch': {'title': 'Branch', 'value': 'master'},
+                'hostname': {'title': 'Hostname', 'value': 'foobar'},
+                'commit': {'title': 'Commit', 'value': '1234'}
+               }
+    metadata = metadata_diff(data[id_comp][0], data[-1][0])
+
+
+    # Generate list of tests
+    tests = []
+    for test in data[-1][1]['tests'].keys():
+        test_r = data[-1][1]['tests'][test]
+        new_test = {'name': test_r['name'],
+                    'description': test_r['description'],
+                    'status': test_r['status'],
+                    'measurements': [],
+                    'err_type': test_r.get('err_type'),
+                   }
+        # Limit length of err output shown
+        if 'message' in test_r:
+            lines = test_r['message'].splitlines()
+            if len(lines) > 20:
+                new_test['message'] = '...\n' + '\n'.join(lines[-20:])
+            else:
+                new_test['message'] = test_r['message']
+
+
+        # Generate the list of measurements
+        for meas in test_r['measurements'].keys():
+            meas_r = test_r['measurements'][meas]
+            meas_type = 'time' if meas_r['type'] == 'sysres' else 'size'
+            new_meas = {'name': meas_r['name'],
+                        'legend': meas_r['legend'],
+                        'description': meas_r['name'] + ' ' + meas_type,
+                       }
+            samples = []
+
+            # Run through all revisions in our data
+            for meta, test_data in data:
+                if (not test in test_data['tests'] or
+                        not meas in test_data['tests'][test]['measurements']):
+                    samples.append(measurement_stats(None))
+                    continue
+                test_i = test_data['tests'][test]
+                meas_i = test_i['measurements'][meas]
+                commit_num = get_data_item(meta, 'layers.meta.commit_count')
+                samples.append(measurement_stats(meas_i))
+                samples[-1]['commit_num'] = commit_num
+
+            absdiff = samples[-1]['val_cls'](samples[-1]['mean'] - samples[id_comp]['mean'])
+            new_meas['absdiff'] = absdiff
+            new_meas['absdiff_str'] = str(absdiff) if absdiff < 0 else '+' + str(absdiff)
+            new_meas['reldiff'] = "{:+.1f} %".format(absdiff * 100 / samples[id_comp]['mean'])
+            new_meas['samples'] = samples
+            new_meas['value'] = samples[-1]
+            new_meas['value_type'] = samples[-1]['val_cls']
+
+            new_test['measurements'].append(new_meas)
+        tests.append(new_test)
+
+    # Chart options
+    chart_opts = {'haxis': {'min': get_data_item(data[0][0], 'layers.meta.commit_count'),
+                            'max': get_data_item(data[-1][0], 'layers.meta.commit_count')}
+                 }
+
+    print(html.template.render(metadata=metadata, test_data=tests, chart_opts=chart_opts))
+
+
+def auto_args(repo, args):
+    """Guess arguments, if not defined by the user"""
+    # Get the latest commit in the repo
+    log.debug("Guessing arguments from the latest commit")
+    msg = repo.run_cmd(['log', '-1', '--branches', '--remotes', '--format=%b'])
+    for line in msg.splitlines():
+        split = line.split(':', 1)
+        if len(split) != 2:
+            continue
+
+        key = split[0]
+        val = split[1].strip()
+        if key == 'hostname':
+            log.debug("Using hostname %s", val)
+            args.hostname = val
+        elif key == 'branch':
+            log.debug("Using branch %s", val)
+            args.branch = val
+
+
+def parse_args(argv):
+    """Parse command line arguments"""
+    description = """
+Examine build performance test results from a Git repository"""
+    parser = argparse.ArgumentParser(
+        formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+        description=description)
+
+    parser.add_argument('--debug', '-d', action='store_true',
+                        help="Verbose logging")
+    parser.add_argument('--repo', '-r', required=True,
+                        help="Results repository (local git clone)")
+    parser.add_argument('--list', '-l', action='store_true',
+                        help="List available test runs")
+    parser.add_argument('--html', action='store_true',
+                        help="Generate report in html format")
+    group = parser.add_argument_group('Tag and revision')
+    group.add_argument('--tag-name', '-t',
+                       default='{hostname}/{branch}/{machine}/{commit_number}-g{commit}/{tag_number}',
+                       help="Tag name (pattern) for finding results")
+    group.add_argument('--hostname', '-H')
+    group.add_argument('--branch', '-B', default='master')
+    group.add_argument('--machine', default='qemux86')
+    group.add_argument('--history-length', default=25, type=int,
+                       help="Number of tested revisions to plot in html report")
+    group.add_argument('--commit',
+                       help="Revision to search for")
+    group.add_argument('--commit-number',
+                       help="Revision number to search for, redundant if "
+                            "--commit is specified")
+    group.add_argument('--commit2',
+                       help="Revision to compare with")
+    group.add_argument('--commit-number2',
+                       help="Revision number to compare with, redundant if "
+                            "--commit2 is specified")
+
+    return parser.parse_args(argv)
+
+
+def main(argv=None):
+    """Script entry point"""
+    args = parse_args(argv)
+    if args.debug:
+        log.setLevel(logging.DEBUG)
+
+    repo = GitRepo(args.repo)
+
+    if args.list:
+        list_test_revs(repo, args.tag_name)
+        return 0
+
+    # Determine hostname which to use
+    if not args.hostname:
+        auto_args(repo, args)
+
+    revs = get_test_revs(repo, args.tag_name, hostname=args.hostname,
+                         branch=args.branch, machine=args.machine)
+    if len(revs) < 2:
+        log.error("%d tester revisions found, unable to generate report",
+                  len(revs))
+        return 1
+
+    # Pick revisions
+    if args.commit:
+        if args.commit_number:
+            log.warning("Ignoring --commit-number as --commit was specified")
+        index1 = rev_find(revs, 'commit', args.commit)
+    elif args.commit_number:
+        index1 = rev_find(revs, 'commit_number', args.commit_number)
+    else:
+        index1 = len(revs) - 1
+
+    if args.commit2:
+        if args.commit_number2:
+            log.warning("Ignoring --commit-number2 as --commit2 was specified")
+        index2 = rev_find(revs, 'commit', args.commit2)
+    elif args.commit_number2:
+        index2 = rev_find(revs, 'commit_number', args.commit_number2)
+    else:
+        if index1 > 0:
+            index2 = index1 - 1
+        else:
+            log.error("Unable to determine the other commit, use "
+                      "--commit2 or --commit-number2 to specify it")
+            return 1
+
+    index_l = min(index1, index2)
+    index_r = max(index1, index2)
+
+    rev_l = revs[index_l]
+    rev_r = revs[index_r]
+    log.debug("Using 'left' revision %s (%s), %s test runs:\n    %s",
+              rev_l.commit_number, rev_l.commit, len(rev_l.tags),
+              '\n    '.join(rev_l.tags))
+    log.debug("Using 'right' revision %s (%s), %s test runs:\n    %s",
+              rev_r.commit_number, rev_r.commit, len(rev_r.tags),
+              '\n    '.join(rev_r.tags))
+
+    # Check report format used in the repo (assume all reports in the same fmt)
+    xml = is_xml_format(repo, revs[index_r].tags[-1])
+
+    if args.html:
+        index_0 = max(0, index_r - args.history_length)
+        rev_range = range(index_0, index_r + 1)
+    else:
+        # We do not need range of commits for text report (no graphs)
+        index_0 = index_l
+        rev_range = (index_l, index_r)
+
+    # Read raw data
+    log.debug("Reading %d revisions, starting from %s (%s)",
+              len(rev_range), revs[index_0].commit_number, revs[index_0].commit)
+    raw_data = [read_results(repo, revs[i].tags, xml) for i in rev_range]
+
+    data = []
+    for raw_m, raw_d in raw_data:
+        data.append((aggregate_metadata(raw_m), aggregate_data(raw_d)))
+
+    # Re-map list indexes to the new table starting from index 0
+    index_r = index_r - index_0
+    index_l = index_l - index_0
+
+    # Print report
+    if not args.html:
+        print_diff_report(data[index_l][0], data[index_l][1],
+                          data[index_r][0], data[index_r][1])
+    else:
+        print_html_report(data, index_l)
+
+    return 0
+
+if __name__ == "__main__":
+    sys.exit(main())
diff --git a/import-layers/yocto-poky/scripts/oe-build-perf-test b/import-layers/yocto-poky/scripts/oe-build-perf-test
index 638e195..669470f 100755
--- a/import-layers/yocto-poky/scripts/oe-build-perf-test
+++ b/import-layers/yocto-poky/scripts/oe-build-perf-test
@@ -17,21 +17,23 @@
 import argparse
 import errno
 import fcntl
+import json
 import logging
 import os
+import re
 import shutil
 import sys
-import unittest
 from datetime import datetime
 
 sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib')
 import scriptpath
 scriptpath.add_oe_lib_path()
+scriptpath.add_bitbake_lib_path()
 import oeqa.buildperf
 from oeqa.buildperf import (BuildPerfTestLoader, BuildPerfTestResult,
                             BuildPerfTestRunner, KernelDropCaches)
 from oeqa.utils.commands import runCmd
-from oeqa.utils.git import GitRepo, GitError
+from oeqa.utils.metadata import metadata_from_bb, write_metadata_file
 
 
 # Set-up logging
@@ -71,31 +73,6 @@
         return False
     return True
 
-def init_git_repo(path):
-    """Check/create Git repository where to store results"""
-    path = os.path.abspath(path)
-    if os.path.isfile(path):
-        log.error("Invalid Git repo %s: path exists but is not a directory", path)
-        return False
-    if not os.path.isdir(path):
-        try:
-            os.mkdir(path)
-        except (FileNotFoundError, PermissionError) as err:
-            log.error("Failed to mkdir %s: %s", path, err)
-            return False
-    if not os.listdir(path):
-        log.info("Initializing a new Git repo at %s", path)
-        GitRepo.init(path)
-    try:
-        GitRepo(path, is_topdir=True)
-    except GitError:
-        log.error("No Git repository but a non-empty directory found at %s.\n"
-                  "Please specify a Git repository, an empty directory or "
-                  "a non-existing directory", path)
-        return False
-    return True
-
-
 def setup_file_logging(log_file):
     """Setup loggin to file"""
     log_dir = os.path.dirname(log_file)
@@ -115,6 +92,38 @@
     shutil.copytree(src_dir, tgt_dir)
 
 
+def update_globalres_file(result_obj, filename, metadata):
+    """Write results to globalres csv file"""
+    # Map test names to time and size columns in globalres
+    # The tuples represent index and length of times and sizes
+    # respectively
+    gr_map = {'test1': ((0, 1), (8, 1)),
+              'test12': ((1, 1), (None, None)),
+              'test13': ((2, 1), (9, 1)),
+              'test2': ((3, 1), (None, None)),
+              'test3': ((4, 3), (None, None)),
+              'test4': ((7, 1), (10, 2))}
+
+    values = ['0'] * 12
+    for status, test, _ in result_obj.all_results():
+        if status in ['ERROR', 'SKIPPED']:
+            continue
+        (t_ind, t_len), (s_ind, s_len) = gr_map[test.name]
+        if t_ind is not None:
+            values[t_ind:t_ind + t_len] = test.times
+        if s_ind is not None:
+            values[s_ind:s_ind + s_len] = test.sizes
+
+    log.debug("Writing globalres log to %s", filename)
+    rev_info = metadata['layers']['meta']
+    with open(filename, 'a') as fobj:
+        fobj.write('{},{}:{},{},'.format(metadata['hostname'],
+                                         rev_info['branch'],
+                                         rev_info['commit'],
+                                         rev_info['commit']))
+        fobj.write(','.join(values) + '\n')
+
+
 def parse_args(argv):
     """Parse command line arguments"""
     parser = argparse.ArgumentParser(
@@ -131,20 +140,13 @@
     parser.add_argument('-o', '--out-dir', default='results-{date}',
                         type=os.path.abspath,
                         help="Output directory for test results")
+    parser.add_argument('-x', '--xml', action='store_true',
+                        help='Enable JUnit xml output')
     parser.add_argument('--log-file',
                         default='{out_dir}/oe-build-perf-test.log',
                         help="Log file of this script")
     parser.add_argument('--run-tests', nargs='+', metavar='TEST',
                         help="List of tests to run")
-    parser.add_argument('--commit-results', metavar='GIT_DIR',
-                        type=os.path.abspath,
-                        help="Commit result data to a (local) git repository")
-    parser.add_argument('--commit-results-branch', metavar='BRANCH',
-                        default="{git_branch}",
-                        help="Commit results to branch BRANCH.")
-    parser.add_argument('--commit-results-tag', metavar='TAG',
-                        default="{git_branch}/{git_commit_count}-g{git_commit}/{tag_num}",
-                        help="Tag results commit with TAG.")
 
     return parser.parse_args(argv)
 
@@ -167,9 +169,6 @@
 
     if not pre_run_sanity_check():
         return 1
-    if args.commit_results:
-        if not init_git_repo(args.commit_results):
-            return 1
 
     # Check our capability to drop caches and ask pass if needed
     KernelDropCaches.check()
@@ -181,7 +180,19 @@
     else:
         suite = loader.loadTestsFromModule(oeqa.buildperf)
 
+    # Save test metadata
+    metadata = metadata_from_bb()
+    log.info("Testing Git revision branch:commit %s:%s (%s)",
+             metadata['layers']['meta']['branch'],
+             metadata['layers']['meta']['commit'],
+             metadata['layers']['meta']['commit_count'])
+    if args.xml:
+        write_metadata_file(os.path.join(out_dir, 'metadata.xml'), metadata)
+    else:
+        with open(os.path.join(out_dir, 'metadata.json'), 'w') as fobj:
+            json.dump(metadata, fobj, indent=2)
     archive_build_conf(out_dir)
+
     runner = BuildPerfTestRunner(out_dir, verbosity=2)
 
     # Suppress logger output to stderr so that the output from unittest
@@ -194,12 +205,13 @@
     # Restore logger output to stderr
     log.handlers[0].setLevel(log.level)
 
+    if args.xml:
+        result.write_results_xml()
+    else:
+        result.write_results_json()
+    result.write_buildstats_json()
     if args.globalres_file:
-        result.update_globalres_file(args.globalres_file)
-    if args.commit_results:
-        result.git_commit_results(args.commit_results,
-                                  args.commit_results_branch,
-                                  args.commit_results_tag)
+        update_globalres_file(result, args.globalres_file, metadata)
     if result.wasSuccessful():
         return 0
 
diff --git a/import-layers/yocto-poky/scripts/oe-buildenv-internal b/import-layers/yocto-poky/scripts/oe-buildenv-internal
index 9fae3b4..c890552 100755
--- a/import-layers/yocto-poky/scripts/oe-buildenv-internal
+++ b/import-layers/yocto-poky/scripts/oe-buildenv-internal
@@ -18,6 +18,18 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+if ! $(return >/dev/null 2>&1) ; then
+    echo 'oe-buildenv-internal: error: this script must be sourced'
+    echo ''
+    echo 'Usage: . $OEROOT/scripts/oe-buildenv-internal &&'
+    echo ''
+    echo 'OpenEmbedded oe-buildenv-internal - an internal script that is'
+    echo 'used in oe-init-build-env and oe-init-build-env-memres to'
+    echo 'initialize oe build environment'
+    echo ''
+    exit 2
+fi
+
 # It is assumed OEROOT is already defined when this is called
 if [ -z "$OEROOT" ]; then
     echo >&2 "Error: OEROOT is not defined!"
diff --git a/import-layers/yocto-poky/scripts/oe-find-native-sysroot b/import-layers/yocto-poky/scripts/oe-find-native-sysroot
index 81d62b8..235a67c 100755
--- a/import-layers/yocto-poky/scripts/oe-find-native-sysroot
+++ b/import-layers/yocto-poky/scripts/oe-find-native-sysroot
@@ -2,14 +2,14 @@
 #
 # Find a native sysroot to use - either from an in-tree OE build or
 # from a toolchain installation. It then ensures the variable
-# $OECORE_NATIVE_SYSROOT is set to the sysroot's base directory, and sets 
+# $OECORE_NATIVE_SYSROOT is set to the sysroot's base directory, and sets
 # $PSEUDO to the path of the pseudo binary.
 #
 # This script is intended to be run within other scripts by source'ing
 # it, e.g:
 #
 # SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot`
-# . $SYSROOT_SETUP_SCRIPT
+# . $SYSROOT_SETUP_SCRIPT <recipe>
 #
 # This script will terminate execution of your calling program unless
 # you set a variable $SKIP_STRICT_SYSROOT_CHECK to a non-empty string
@@ -30,6 +30,38 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+if [ "$1" = '--help' -o "$1" = '-h' -o $# -ne 1 ] ; then
+    echo 'Usage: oe-find-native-sysroot <recipe> [-h|--help]'
+    echo ''
+    echo 'OpenEmbedded find-native-sysroot - helper script to set'
+    echo 'environment variables OECORE_NATIVE_SYSROOT and PSEUDO'
+    echo 'to the path of the native sysroot directory and pseudo'
+    echo 'executable binary'
+    echo ''
+    echo 'options:'
+    echo '  recipe              its STAGING_DIR_NATIVE is used as native sysroot'
+    echo '  -h, --help          show this help message and exit'
+    echo ''
+    exit 2
+fi
+
+# Global vars
+BITBAKE_E=""
+set_oe_native_sysroot(){
+    echo "Running bitbake -e $1"
+    BITBAKE_E="`bitbake -e $1`"
+    OECORE_NATIVE_SYSROOT=`echo "$BITBAKE_E" | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2`
+
+    if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
+        # This indicates that there was an error running bitbake -e that
+        # the user needs to be informed of
+        echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"
+        echo "Here is the output from bitbake -e $1"
+        echo $BITBAKE_E
+        exit 1
+    fi
+}
+
 if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
     BITBAKE=`which bitbake 2> /dev/null`
     if [ "x$BITBAKE" != "x" ]; then
@@ -40,10 +72,10 @@
                 exit 1
             fi
             touch conf/sanity.conf
-            OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2`
+            set_oe_native_sysroot $1
             rm -f conf/sanity.conf
         else
-            OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2`
+            set_oe_native_sysroot $1
         fi
     else
         echo "Error: Unable to locate bitbake command."
@@ -55,21 +87,15 @@
     fi
 fi
 
-if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
-    # This indicates that there was an error running bitbake -e that
-    # the user needs to be informed of
-    echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"
-    echo "Here is the output from bitbake -e"
-    bitbake -e
-    exit 1
-fi
-
-# Set up pseudo command
-if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then
-    echo "Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin/"
+if [ ! -e "$OECORE_NATIVE_SYSROOT/" ]; then
+    echo "Error: $OECORE_NATIVE_SYSROOT doesn't exist."
 
     if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then
-        echo "Have you run 'bitbake meta-ide-support'?"
+        if [[ $1 =~ .*native.* ]]; then
+            echo "Have you run 'bitbake $1 -caddto_recipe_sysroot'?"
+        else
+            echo "Have you run 'bitbake $1 '?"
+        fi
     else
         echo "This shouldn't happen - something is wrong with your toolchain installation"
     fi
@@ -78,4 +104,12 @@
         exit 1
     fi
 fi
-PSEUDO="$OECORE_NATIVE_SYSROOT/usr/bin/pseudo"
+
+# Set up pseudo command
+pseudo="$OECORE_NATIVE_SYSROOT/usr/bin/pseudo"
+if [ -e "$pseudo" ]; then
+    echo "PSEUDO=$pseudo"
+    PSEUDO="$pseudo"
+else
+    echo "PSEUDO $pseudo is not found."
+fi
diff --git a/import-layers/yocto-poky/scripts/oe-git-archive b/import-layers/yocto-poky/scripts/oe-git-archive
new file mode 100755
index 0000000..ab19cb9
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-git-archive
@@ -0,0 +1,271 @@
+#!/usr/bin/python3
+#
+# Helper script for committing data to git and pushing upstream
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+import argparse
+import glob
+import json
+import logging
+import math
+import os
+import re
+import sys
+from collections import namedtuple, OrderedDict
+from datetime import datetime, timedelta, tzinfo
+from operator import attrgetter
+
+# Import oe and bitbake libs
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(scripts_path, 'lib'))
+import scriptpath
+scriptpath.add_bitbake_lib_path()
+scriptpath.add_oe_lib_path()
+
+from oeqa.utils.git import GitRepo, GitError
+from oeqa.utils.metadata import metadata_from_bb
+
+
+# Setup logging
+logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
+log = logging.getLogger()
+
+
+class ArchiveError(Exception):
+    """Internal error handling of this script"""
+
+
+def format_str(string, fields):
+    """Format string using the given fields (dict)"""
+    try:
+        return string.format(**fields)
+    except KeyError as err:
+        raise ArchiveError("Unable to expand string '{}': unknown field {} "
+                           "(valid fields are: {})".format(
+                               string, err, ', '.join(sorted(fields.keys()))))
+
+
+def init_git_repo(path, no_create, bare):
+    """Initialize local Git repository"""
+    path = os.path.abspath(path)
+    if os.path.isfile(path):
+        raise ArchiveError("Invalid Git repo at {}: path exists but is not a "
+                           "directory".format(path))
+    if not os.path.isdir(path) or not os.listdir(path):
+        if no_create:
+            raise ArchiveError("No git repo at {}, refusing to create "
+                               "one".format(path))
+        if not os.path.isdir(path):
+            try:
+                os.mkdir(path)
+            except (FileNotFoundError, PermissionError) as err:
+                raise ArchiveError("Failed to mkdir {}: {}".format(path, err))
+        if not os.listdir(path):
+            log.info("Initializing a new Git repo at %s", path)
+            repo = GitRepo.init(path, bare)
+    try:
+        repo = GitRepo(path, is_topdir=True)
+    except GitError:
+        raise ArchiveError("Non-empty directory that is not a Git repository "
+                           "at {}\nPlease specify an existing Git repository, "
+                           "an empty directory or a non-existing directory "
+                           "path.".format(path))
+    return repo
+
+
+def git_commit_data(repo, data_dir, branch, message, exclude, notes):
+    """Commit data into a Git repository"""
+    log.info("Committing data into to branch %s", branch)
+    tmp_index = os.path.join(repo.git_dir, 'index.oe-git-archive')
+    try:
+        # Create new tree object from the data
+        env_update = {'GIT_INDEX_FILE': tmp_index,
+                      'GIT_WORK_TREE': os.path.abspath(data_dir)}
+        repo.run_cmd('add .', env_update)
+
+        # Remove files that are excluded
+        if exclude:
+            repo.run_cmd(['rm', '--cached'] + [f for f in exclude], env_update)
+
+        tree = repo.run_cmd('write-tree', env_update)
+
+        # Create new commit object from the tree
+        parent = repo.rev_parse(branch)
+        git_cmd = ['commit-tree', tree, '-m', message]
+        if parent:
+            git_cmd += ['-p', parent]
+        commit = repo.run_cmd(git_cmd, env_update)
+
+        # Create git notes
+        for ref, filename in notes:
+            ref = ref.format(branch_name=branch)
+            repo.run_cmd(['notes', '--ref', ref, 'add',
+                          '-F', os.path.abspath(filename), commit])
+
+        # Update branch head
+        git_cmd = ['update-ref', 'refs/heads/' + branch, commit]
+        if parent:
+            git_cmd.append(parent)
+        repo.run_cmd(git_cmd)
+
+        # Update current HEAD, if we're on branch 'branch'
+        if not repo.bare and repo.get_current_branch() == branch:
+            log.info("Updating %s HEAD to latest commit", repo.top_dir)
+            repo.run_cmd('reset --hard')
+
+        return commit
+    finally:
+        if os.path.exists(tmp_index):
+            os.unlink(tmp_index)
+
+
+def expand_tag_strings(repo, name_pattern, msg_subj_pattern, msg_body_pattern,
+                       keywords):
+    """Generate tag name and message, with support for running id number"""
+    keyws = keywords.copy()
+    # Tag number is handled specially: if not defined, we autoincrement it
+    if 'tag_number' not in keyws:
+        # Fill in all other fields than 'tag_number'
+        keyws['tag_number'] = '{tag_number}'
+        tag_re = format_str(name_pattern, keyws)
+        # Replace parentheses for proper regex matching
+        tag_re = tag_re.replace('(', '\(').replace(')', '\)') + '$'
+        # Inject regex group pattern for 'tag_number'
+        tag_re = tag_re.format(tag_number='(?P<tag_number>[0-9]{1,5})')
+
+        keyws['tag_number'] = 0
+        for existing_tag in repo.run_cmd('tag').splitlines():
+            match = re.match(tag_re, existing_tag)
+
+            if match and int(match.group('tag_number')) >= keyws['tag_number']:
+                keyws['tag_number'] = int(match.group('tag_number')) + 1
+
+    tag_name = format_str(name_pattern, keyws)
+    msg_subj= format_str(msg_subj_pattern.strip(), keyws)
+    msg_body = format_str(msg_body_pattern, keyws)
+    return tag_name, msg_subj + '\n\n' + msg_body
+
+
+def parse_args(argv):
+    """Parse command line arguments"""
+    parser = argparse.ArgumentParser(
+            description="Commit data to git and push upstream",
+            formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+
+    parser.add_argument('--debug', '-D', action='store_true',
+                        help="Verbose logging")
+    parser.add_argument('--git-dir', '-g', required=True,
+                        help="Local git directory to use")
+    parser.add_argument('--no-create', action='store_true',
+                        help="If GIT_DIR is not a valid Git repository, do not "
+                             "try to create one")
+    parser.add_argument('--bare', action='store_true',
+                        help="Initialize a bare repository when creating a "
+                             "new one")
+    parser.add_argument('--push', '-p', nargs='?', default=False, const=True,
+                        help="Push to remote")
+    parser.add_argument('--branch-name', '-b',
+                        default='{hostname}/{branch}/{machine}',
+                        help="Git branch name (pattern) to use")
+    parser.add_argument('--no-tag', action='store_true',
+                        help="Do not create Git tag")
+    parser.add_argument('--tag-name', '-t',
+                        default='{hostname}/{branch}/{machine}/{commit_count}-g{commit}/{tag_number}',
+                        help="Tag name (pattern) to use")
+    parser.add_argument('--commit-msg-subject',
+                        default='Results of {branch}:{commit} on {hostname}',
+                        help="Subject line (pattern) to use in the commit message")
+    parser.add_argument('--commit-msg-body',
+                        default='branch: {branch}\ncommit: {commit}\nhostname: {hostname}',
+                        help="Commit message body (pattern)")
+    parser.add_argument('--tag-msg-subject',
+                        default='Test run #{tag_number} of {branch}:{commit} on {hostname}',
+                        help="Subject line (pattern) of the tag message")
+    parser.add_argument('--tag-msg-body',
+                        default='',
+                        help="Tag message body (pattern)")
+    parser.add_argument('--exclude', action='append', default=[],
+                        help="Glob to exclude files from the commit. Relative "
+                             "to DATA_DIR. May be specified multiple times")
+    parser.add_argument('--notes', nargs=2, action='append', default=[],
+                        metavar=('GIT_REF', 'FILE'),
+                        help="Add a file as a note under refs/notes/GIT_REF. "
+                             "{branch_name} in GIT_REF will be expanded to the "
+                             "actual target branch name (specified by "
+                             "--branch-name). This option may be specified "
+                             "multiple times.")
+    parser.add_argument('data_dir', metavar='DATA_DIR',
+                        help="Data to commit")
+    return parser.parse_args(argv)
+
+
+def main(argv=None):
+    """Script entry point"""
+    args = parse_args(argv)
+    if args.debug:
+        log.setLevel(logging.DEBUG)
+
+    try:
+        if not os.path.isdir(args.data_dir):
+            raise ArchiveError("Not a directory: {}".format(args.data_dir))
+
+        data_repo = init_git_repo(args.git_dir, args.no_create, args.bare)
+
+        # Get keywords to be used in tag and branch names and messages
+        metadata = metadata_from_bb()
+        keywords = {'hostname': metadata['hostname'],
+                    'branch': metadata['layers']['meta']['branch'],
+                    'commit': metadata['layers']['meta']['commit'],
+                    'commit_count': metadata['layers']['meta']['commit_count'],
+                    'machine': metadata['config']['MACHINE']}
+
+        # Expand strings early in order to avoid getting into inconsistent
+        # state (e.g. no tag even if data was committed)
+        commit_msg = format_str(args.commit_msg_subject.strip(), keywords)
+        commit_msg += '\n\n' + format_str(args.commit_msg_body, keywords)
+        branch_name = format_str(args.branch_name, keywords)
+        tag_name = None
+        if not args.no_tag and args.tag_name:
+            tag_name, tag_msg = expand_tag_strings(data_repo, args.tag_name,
+                                                   args.tag_msg_subject,
+                                                   args.tag_msg_body, keywords)
+
+        # Commit data
+        commit = git_commit_data(data_repo, args.data_dir, branch_name,
+                                 commit_msg, args.exclude, args.notes)
+
+        # Create tag
+        if tag_name:
+            log.info("Creating tag %s", tag_name)
+            data_repo.run_cmd(['tag', '-a', '-m', tag_msg, tag_name, commit])
+
+        # Push data to remote
+        if args.push:
+            cmd = ['push', '--tags']
+            # If no remote is given we push with the default settings from
+            # gitconfig
+            if args.push is not True:
+                notes_refs = ['refs/notes/' + ref.format(branch_name=branch_name)
+                                for ref, _ in args.notes]
+                cmd.extend([args.push, branch_name] + notes_refs)
+            log.info("Pushing data to remote")
+            data_repo.run_cmd(cmd)
+
+    except ArchiveError as err:
+        log.error(str(err))
+        return 1
+
+    return 0
+
+if __name__ == "__main__":
+    sys.exit(main())
diff --git a/import-layers/yocto-poky/scripts/oe-git-proxy b/import-layers/yocto-poky/scripts/oe-git-proxy
index 0078e95..7a43fe6 100755
--- a/import-layers/yocto-poky/scripts/oe-git-proxy
+++ b/import-layers/yocto-poky/scripts/oe-git-proxy
@@ -18,6 +18,27 @@
 # AUTHORS
 # Darren Hart <dvhart@linux.intel.com>
 
+if [ $# -lt 2 -o "$1" = '--help' -o "$1" = '-h' ] ; then
+    echo 'oe-git-proxy: error: the following arguments are required: host port'
+    echo 'Usage: oe-git-proxy host port'
+    echo ''
+    echo 'OpenEmbedded git-proxy - a simple tool to be used via GIT_PROXY_COMMAND.'
+    echo 'It uses socat to make SOCKS or HTTPS proxy connections.'
+    echo 'It uses ALL_PROXY to determine the proxy server, protocol, and port.'
+    echo 'It uses NO_PROXY to skip using the proxy for a comma delimited list'
+    echo 'of hosts, host globs (*.example.com), IPs, or CIDR masks (192.168.1.0/24).'
+    echo 'It is known to work with both bash and dash shells.runs native tools'
+    echo ''
+    echo 'arguments:'
+    echo '  host                proxy host to use'
+    echo '  port                proxy port to use'
+    echo ''
+    echo 'options:'
+    echo '  -h, --help          show this help message and exit'
+    echo ''
+    exit 2
+fi
+
 # Locate the netcat binary
 SOCAT=$(which socat 2>/dev/null)
 if [ $? -ne 0 ]; then
diff --git a/import-layers/yocto-poky/scripts/oe-pkgdata-util b/import-layers/yocto-poky/scripts/oe-pkgdata-util
index dbffd6a..677effe 100755
--- a/import-layers/yocto-poky/scripts/oe-pkgdata-util
+++ b/import-layers/yocto-poky/scripts/oe-pkgdata-util
@@ -174,15 +174,16 @@
             logger.error("No packages specified")
             sys.exit(1)
 
-    def readvar(pkgdata_file, valuename):
+    def readvar(pkgdata_file, valuename, mappedpkg):
         val = ""
         with open(pkgdata_file, 'r') as f:
             for line in f:
-                if line.startswith(valuename + ":"):
+                if (line.startswith(valuename + ":") or
+                    line.startswith(valuename + "_" + mappedpkg + ":")):
                     val = line.split(': ', 1)[1].rstrip()
         return val
 
-    logger.debug("read-value('%s', '%s' '%s'" % (args.pkgdata_dir, args.valuename, packages))
+    logger.debug("read-value('%s', '%s' '%s')" % (args.pkgdata_dir, args.valuename, packages))
     for package in packages:
         pkg_split = package.split('_')
         pkg_name = pkg_split[0]
@@ -192,18 +193,17 @@
         if os.path.exists(revlink):
             mappedpkg = os.path.basename(os.readlink(revlink))
             qvar = args.valuename
+            value = readvar(revlink, qvar, mappedpkg)
             if qvar == "PKGSIZE":
-                # append packagename
-                qvar = "%s_%s" % (args.valuename, mappedpkg)
                 # PKGSIZE is now in bytes, but we we want it in KB
-                pkgsize = (int(readvar(revlink, qvar)) + 1024 // 2) // 1024
+                pkgsize = (int(value) + 1024 // 2) // 1024
                 value = "%d" % pkgsize
-            else:
-                value = readvar(revlink, qvar)
             if args.prefix_name:
                 print('%s %s' % (pkg_name, value))
             else:
                 print(value)
+        else:
+            logger.debug("revlink %s does not exist", revlink)
 
 def lookup_pkglist(pkgs, pkgdata_dir, reverse):
     if reverse:
@@ -325,8 +325,15 @@
             recipe_version = recipe_version + "-" + mappings[pkg]['PR']
         pkg_size = mappings[pkg]['PKGSIZE']
 
-        items.append("%s %s %s %s %s" %
-                     (pkg, pkg_version, recipe, recipe_version, pkg_size))
+        line = "%s %s %s %s %s" % (pkg, pkg_version, recipe, recipe_version, pkg_size)
+
+        if args.extra:
+            for var in args.extra:
+                val = mappings[pkg][var].strip()
+                val = re.sub(r'\s+', ' ', val)
+                line += ' "%s"' % val
+
+        items.append(line)
     print('\n'.join(items))
 
 def get_recipe_pkgs(pkgdata_dir, recipe, unpackaged):
@@ -530,6 +537,7 @@
                                           description='Looks up the specified runtime package(s) and display information')
     parser_package_info.add_argument('pkg', nargs='*', help='Runtime package name to look up')
     parser_package_info.add_argument('-f', '--file', help='Read package names from the specified file (one per line, first field only)')
+    parser_package_info.add_argument('-e', '--extra', help='Extra variables to display, e.g., LICENSE (can be specified multiple times)', action='append')
     parser_package_info.set_defaults(func=package_info)
 
     parser_find_path = subparsers.add_parser('find-path',
@@ -570,7 +578,7 @@
         logger.debug('Found bitbake path: %s' % bitbakepath)
         tinfoil = tinfoil_init()
         try:
-            args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR', True)
+            args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
         finally:
             tinfoil.shutdown()
         logger.debug('Value of PKGDATA_DIR is "%s"' % args.pkgdata_dir)
diff --git a/import-layers/yocto-poky/scripts/oe-publish-sdk b/import-layers/yocto-poky/scripts/oe-publish-sdk
index 4fe8974..9f7963c 100755
--- a/import-layers/yocto-poky/scripts/oe-publish-sdk
+++ b/import-layers/yocto-poky/scripts/oe-publish-sdk
@@ -114,9 +114,9 @@
 
     # Setting up the git repo
     if not is_remote:
-        cmd = 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; echo "*.pyc\n*.pyo" > .gitignore; fi; git add -A .; git config user.email "oe@oe.oe" && git config user.name "OE" && git commit -q -m "init repo" || true; git update-server-info' % (destination, destination)
+        cmd = 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; echo "*.pyc\n*.pyo\npyshtables.py" > .gitignore; fi; git add -A .; git config user.email "oe@oe.oe" && git config user.name "OE" && git commit -q -m "init repo" || true; git update-server-info' % (destination, destination)
     else:
-        cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; echo '*.pyc\n*.pyo' > .gitignore; fi; git add -A .; git config user.email 'oe@oe.oe' && git config user.name 'OE' && git commit -q -m \"init repo\" || true; git update-server-info'" % (host, destdir, destdir)
+        cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; echo '*.pyc\n*.pyo\npyshtables.py' > .gitignore; fi; git add -A .; git config user.email 'oe@oe.oe' && git config user.name 'OE' && git commit -q -m \"init repo\" || true; git update-server-info'" % (host, destdir, destdir)
     ret = subprocess.call(cmd, shell=True)
     if ret == 0:
         logger.info('SDK published successfully')
diff --git a/import-layers/yocto-poky/scripts/oe-run-native b/import-layers/yocto-poky/scripts/oe-run-native
index 496e34f..1131122 100755
--- a/import-layers/yocto-poky/scripts/oe-run-native
+++ b/import-layers/yocto-poky/scripts/oe-run-native
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (c) 2016,  Intel Corporation.
 # All Rights Reserved
@@ -22,27 +22,47 @@
 #
 
 if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then
-    echo "Usage: $0 <native tool> [parameters]"
+    echo 'oe-run-native: the following arguments are required: <native recipe> <native tool>'
+    echo 'Usage: oe-run-native native-recipe tool [parameters]'
+    echo ''
+    echo 'OpenEmbedded run-native - runs native tools'
+    echo ''
+    echo 'arguments:'
+    echo '  native-recipe       The recipe which provoides tool'
+    echo '  tool                Native tool to run'
+    echo ''
+    exit 2
+fi
+
+native_recipe="$1"
+tool="$2"
+
+if [ "${native_recipe%-native}" = "$native_recipe" ]; then
+    echo Error: $native_recipe is not a native recipe
+    echo Error: Use \"oe-run-native -h\" for help
     exit 1
 fi
 
+shift
+
 SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
 if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
         echo "Error: Unable to find oe-find-native-sysroot script"
         exit 1
 fi
-. $SYSROOT_SETUP_SCRIPT
+. $SYSROOT_SETUP_SCRIPT $native_recipe
 
-OLDPATH=$PATH
+OLD_PATH=$PATH
 
 # look for a tool only in native sysroot
 PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin
-tool=`/usr/bin/which $1 2>/dev/null`
+tool_find=`/usr/bin/which $tool 2>/dev/null`
 
-if [ -n "$tool" ] ; then
+if [ -n "$tool_find" ] ; then
     # add old path to allow usage of host tools
     PATH=$PATH:$OLD_PATH $@
 else
-    echo "Error: Unable to find '$1' in native sysroot"
+    echo "Error: Unable to find '$tool' in $PATH"
+    echo "Error: Have you run 'bitbake $native_recipe -caddto_recipe_sysroot'?"
     exit 1
 fi
diff --git a/import-layers/yocto-poky/scripts/oe-selftest b/import-layers/yocto-poky/scripts/oe-selftest
index d9ffd40..52366b1 100755
--- a/import-layers/yocto-poky/scripts/oe-selftest
+++ b/import-layers/yocto-poky/scripts/oe-selftest
@@ -46,6 +46,7 @@
 import oeqa.selftest
 import oeqa.utils.ftools as ftools
 from oeqa.utils.commands import runCmd, get_bb_var, get_test_layer
+from oeqa.utils.metadata import metadata_from_bb, write_metadata_file
 from oeqa.selftest.base import oeSelfTest, get_available_machines
 
 try:
@@ -61,7 +62,8 @@
 
 def logger_create():
     log_file = log_prefix + ".log"
-    if os.path.exists("oe-selftest.log"): os.remove("oe-selftest.log")
+    if os.path.lexists("oe-selftest.log"):
+        os.remove("oe-selftest.log")
     os.symlink(log_file, "oe-selftest.log")
 
     log = logging.getLogger("selftest")
@@ -85,7 +87,7 @@
 log = logger_create()
 
 def get_args_parser():
-    description = "Script that runs unit tests agains bitbake and other Yocto related tools. The goal is to validate tools functionality and metadata integrity. Refer to https://wiki.yoctoproject.org/wiki/Oe-selftest for more information."
+    description = "Script that runs unit tests against bitbake and other Yocto related tools. The goal is to validate tools functionality and metadata integrity. Refer to https://wiki.yoctoproject.org/wiki/Oe-selftest for more information."
     parser = argparse_oe.ArgumentParser(description=description)
     group = parser.add_mutually_exclusive_group(required=True)
     group.add_argument('-r', '--run-tests', required=False, action='store', nargs='*', dest="run_tests", default=None, help='Select what tests to run (modules, classes or test methods). Format should be: <module>.<class>.<test_method>')
@@ -106,11 +108,17 @@
                        help='List all tags that have been set to test cases.')
     parser.add_argument('--machine', required=False, dest='machine', choices=['random', 'all'], default=None,
                         help='Run tests on different machines (random/all).')
+    parser.add_argument('--repository', required=False, dest='repository', default='', action='store',
+                        help='Submit test results to a repository')
     return parser
 
+builddir = None
+
 
 def preflight_check():
 
+    global builddir
+
     log.info("Checking that everything is in order before running the tests")
 
     if not os.environ.get("BUILDDIR"):
@@ -123,7 +131,27 @@
         os.chdir(builddir)
 
     if not "meta-selftest" in get_bb_var("BBLAYERS"):
-        log.error("You don't seem to have the meta-selftest layer in BBLAYERS")
+        log.warn("meta-selftest layer not found in BBLAYERS, adding it")
+        meta_selftestdir = os.path.join(
+                get_bb_var("BBLAYERS_FETCH_DIR"),
+                'meta-selftest')
+        if os.path.isdir(meta_selftestdir):
+            runCmd("bitbake-layers add-layer %s" %meta_selftestdir)
+        else:
+            log.error("could not locate meta-selftest in:\n%s"
+                    %meta_selftestdir)
+            return False
+
+    if "buildhistory.bbclass" in get_bb_var("BBINCLUDED"):
+        log.error("You have buildhistory enabled already and this isn't recommended for selftest, please disable it first.")
+        return False
+
+    if get_bb_var("PRSERV_HOST"):
+        log.error("Please unset PRSERV_HOST in order to run oe-selftest")
+        return False
+
+    if get_bb_var("SANITY_TESTED_DISTROS"):
+        log.error("Please unset SANITY_TESTED_DISTROS in order to run oe-selftest")
         return False
 
     log.info("Running bitbake -p")
@@ -132,7 +160,7 @@
     return True
 
 def add_include():
-    builddir = os.environ.get("BUILDDIR")
+    global builddir
     if "#include added by oe-selftest.py" \
         not in ftools.read_file(os.path.join(builddir, "conf/local.conf")):
             log.info("Adding: \"include selftest.inc\" in local.conf")
@@ -146,7 +174,7 @@
                     "\n#include added by oe-selftest.py\ninclude bblayers.inc")
 
 def remove_include():
-    builddir = os.environ.get("BUILDDIR")
+    global builddir
     if builddir is None:
         return
     if "#include added by oe-selftest.py" \
@@ -162,18 +190,21 @@
                     "\n#include added by oe-selftest.py\ninclude bblayers.inc")
 
 def remove_inc_files():
+    global builddir
+    if builddir is None:
+        return
     try:
-        os.remove(os.path.join(os.environ.get("BUILDDIR"), "conf/selftest.inc"))
+        os.remove(os.path.join(builddir, "conf/selftest.inc"))
         for root, _, files in os.walk(get_test_layer()):
             for f in files:
                 if f == 'test_recipe.inc':
                     os.remove(os.path.join(root, f))
-    except (AttributeError, OSError,) as e:    # AttributeError may happen if BUILDDIR is not set
+    except OSError as e:
         pass
 
     for incl_file in ['conf/bblayers.inc', 'conf/machine.inc']:
         try:
-            os.remove(os.path.join(os.environ.get("BUILDDIR"), incl_file))
+            os.remove(os.path.join(builddir, incl_file))
         except:
             pass
 
@@ -336,10 +367,15 @@
     # Get a testsuite based on 'keyword'
     # criteria: name, class, module, id, tag
     # keyword: a list of tests, classes, modules, ids, tags
-
-    ts = sorted([ (tc.tcid, tc.tctag, tc.tcname, tc.tcclass, tc.tcmodule) for tc in get_testsuite_by(criteria, keyword) ])
-
-    print('%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % ('id', 'tag', 'name', 'class', 'module'))
+    def tc_key(t):
+        if t[0] is None:
+            return  (0,) + t[1:]
+        return t
+    # tcid may be None if no ID was assigned, in which case sorted() will throw
+    # a TypeError as Python 3 does not allow comparison (<,<=,>=,>) of
+    # heterogeneous types, handle this by using a custom key generator
+    ts = sorted([ (tc.tcid, tc.tctag, tc.tcname, tc.tcclass, tc.tcmodule) \
+                  for tc in get_testsuite_by(criteria, keyword) ], key=tc_key)
     print('_' * 150)
     for t in ts:
         if isinstance(t[1], (tuple, list)):
@@ -386,7 +422,7 @@
     """ Set up the coverage measurement for the testcases to be run """
     import datetime
     import subprocess
-    builddir = os.environ.get("BUILDDIR")
+    global builddir
     pokydir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
     curcommit= subprocess.check_output(["git", "--git-dir", os.path.join(pokydir, ".git"), "rev-parse", "HEAD"]).decode('utf-8')
     coveragerc = "%s/.coveragerc" % builddir
@@ -463,6 +499,9 @@
     sys.path.extend(layer_libdirs)
     imp.reload(oeqa.selftest)
 
+    # act like bitbake and enforce en_US.UTF-8 locale
+    os.environ["LC_ALL"] = "en_US.UTF-8"
+
     if args.run_tests_by and len(args.run_tests_by) >= 2:
         valid_options = ['name', 'class', 'module', 'id', 'tag']
         if args.run_tests_by[0] not in valid_options:
@@ -564,6 +603,76 @@
 
         log.info("Finished")
 
+        if args.repository:
+            import git
+            # Commit tests results to repository
+            metadata = metadata_from_bb()
+            git_dir = os.path.join(os.getcwd(), 'selftest')
+            if not os.path.isdir(git_dir):
+                os.mkdir(git_dir)
+
+            log.debug('Checking for git repository in %s' % git_dir)
+            try:
+                repo = git.Repo(git_dir)
+            except git.exc.InvalidGitRepositoryError:
+                log.debug("Couldn't find git repository %s; "
+                         "cloning from %s" % (git_dir, args.repository))
+                repo = git.Repo.clone_from(args.repository, git_dir)
+
+            r_branches = repo.git.branch(r=True)
+            r_branches = set(r_branches.replace('origin/', '').split())
+            l_branches = {str(branch) for branch in repo.branches}
+            branch = '%s/%s/%s' % (metadata['hostname'],
+                                   metadata['layers']['meta'].get('branch', '(nogit)'),
+                                   metadata['config']['MACHINE'])
+
+            if branch in l_branches:
+                log.debug('Found branch in local repository, checking out')
+                repo.git.checkout(branch)
+            elif branch in r_branches:
+                log.debug('Found branch in remote repository, checking'
+                          ' out and pulling')
+                repo.git.checkout(branch)
+                repo.git.pull()
+            else:
+                log.debug('New branch %s' % branch)
+                repo.git.checkout('master')
+                repo.git.checkout(b=branch)
+
+            cleanResultsDir(repo)
+            xml_dir = os.path.join(os.getcwd(), log_prefix)
+            copyResultFiles(xml_dir, git_dir, repo)
+            metadata_file = os.path.join(git_dir, 'metadata.xml')
+            write_metadata_file(metadata_file, metadata)
+            repo.index.add([metadata_file])
+            repo.index.write()
+
+            # Get information for commit message
+            layer_info = ''
+            for layer, values in metadata['layers'].items():
+                layer_info = '%s%-17s = %s:%s\n' % (layer_info, layer,
+                              values.get('branch', '(nogit)'), values.get('commit', '0'*40))
+            msg = 'Selftest for build %s of %s for machine %s on %s\n\n%s' % (
+                   log_prefix[12:], metadata['distro']['pretty_name'],
+                   metadata['config']['MACHINE'], metadata['hostname'], layer_info)
+
+            log.debug('Commiting results to local repository')
+            repo.index.commit(msg)
+            if not repo.is_dirty():
+                try:
+                    if branch in r_branches:
+                        log.debug('Pushing changes to remote repository')
+                        repo.git.push()
+                    else:
+                        log.debug('Pushing changes to remote repository '
+                                  'creating new branch')
+                        repo.git.push('-u', 'origin', branch)
+                except GitCommandError:
+                    log.error('Falied to push to remote repository')
+                    return 1
+            else:
+                log.error('Local repository is dirty, not pushing commits')
+
         if result.wasSuccessful():
             return 0
         else:
@@ -647,6 +756,35 @@
 
     return StampedResult
 
+def cleanResultsDir(repo):
+    """ Remove result files from directory """
+
+    xml_files = []
+    directory = repo.working_tree_dir
+    for f in os.listdir(directory):
+        path = os.path.join(directory, f)
+        if os.path.isfile(path) and path.endswith('.xml'):
+            xml_files.append(f)
+    repo.index.remove(xml_files, working_tree=True)
+
+def copyResultFiles(src, dst, repo):
+    """ Copy result files from src to dst removing the time stamp. """
+
+    import shutil
+
+    re_time = re.compile("-[0-9]+")
+    file_list = []
+
+    for root, subdirs, files in os.walk(src):
+        tmp_dir = root.replace(src, '').lstrip('/')
+        for s in subdirs:
+            os.mkdir(os.path.join(dst, tmp_dir, s))
+        for f in files:
+            file_name = os.path.join(dst, tmp_dir, re_time.sub("", f))
+            shutil.copy2(os.path.join(root, f), file_name)
+            file_list.append(file_name)
+    repo.index.add(file_list)
+
 class TestRunner(_TestRunner):
     """Test runner class aware of exporting tests."""
     def __init__(self, *args, **kwargs):
diff --git a/import-layers/yocto-poky/scripts/oe-setup-builddir b/import-layers/yocto-poky/scripts/oe-setup-builddir
index e53f73c..ef49551 100755
--- a/import-layers/yocto-poky/scripts/oe-setup-builddir
+++ b/import-layers/yocto-poky/scripts/oe-setup-builddir
@@ -23,6 +23,14 @@
     exit 1
 fi
 
+if [ "$1" = '--help' -o "$1" = '-h' ]; then
+    echo 'Usage: oe-setup-builddir'
+    echo ''
+    echo "OpenEmbedded setup-builddir - setup build directory $BUILDDIR"
+    echo ''
+    exit 2
+fi
+
 mkdir -p "$BUILDDIR/conf"
 
 if [ ! -d "$BUILDDIR" ]; then
diff --git a/import-layers/yocto-poky/scripts/oe-setup-rpmrepo b/import-layers/yocto-poky/scripts/oe-setup-rpmrepo
index 917b98b..df1c614 100755
--- a/import-layers/yocto-poky/scripts/oe-setup-rpmrepo
+++ b/import-layers/yocto-poky/scripts/oe-setup-rpmrepo
@@ -23,16 +23,6 @@
 # Instead, use OE_TMPDIR for passing this in externally.
 TMPDIR="$OE_TMPDIR"
 
-function usage() {
-	echo "Usage: $0 <rpm-dir>"
-	echo "  <rpm-dir>: default is $TMPDIR/deploy/rpm"
-}
-
-if [ $# -gt 1 ]; then
-	usage
-	exit 1
-fi
-
 setup_tmpdir() {
     if [ -z "$TMPDIR" ]; then
         # Try to get TMPDIR from bitbake
@@ -53,6 +43,23 @@
     fi
 }
 
+setup_tmpdir
+
+function usage() {
+    echo 'Usage: oe-setup-rpmrepo rpm-dir'
+    echo ''
+    echo 'OpenEmbedded setup-rpmrepo - setup rpm repository'
+    echo ''
+    echo 'arguments:'
+    echo "  rpm-dir               rpm repo directory, default is $TMPDIR/deploy/rpm"
+    echo ''
+}
+
+if [ $# -gt 1 -o "$1" = '--help' -o "$1" = '-h' ]; then
+    usage
+    exit 2
+fi
+
 setup_sysroot() {
 	# Toolchain installs set up $OECORE_NATIVE_SYSROOT in their
 	# environment script. If that variable isn't set, we're
@@ -68,7 +75,6 @@
 	fi 
 }
 
-setup_tmpdir
 setup_sysroot
 
 
@@ -83,7 +89,7 @@
 	exit 1
 fi
 
-CREATEREPO=$OECORE_NATIVE_SYSROOT/usr/bin/createrepo
+CREATEREPO=$OECORE_NATIVE_SYSROOT/usr/bin/createrepo_c
 if [ ! -e "$CREATEREPO" ]; then
    	echo "Error: can't find createrepo binary"
 	echo "please run bitbake createrepo-native first"
diff --git a/import-layers/yocto-poky/scripts/oe-test b/import-layers/yocto-poky/scripts/oe-test
new file mode 100755
index 0000000..a1d282d
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-test
@@ -0,0 +1,105 @@
+#!/usr/bin/env python3
+
+# OpenEmbedded test tool
+#
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import argparse
+import importlib
+import logging
+
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+import argparse_oe
+import scriptutils
+
+# oe-test is used for testexport and it doesn't have oe lib
+# so we just skip adding these libraries (not used in testexport)
+try:
+    import scriptpath
+    scriptpath.add_oe_lib_path()
+except ImportError:
+    pass
+
+from oeqa.core.context import OETestContextExecutor
+
+logger = scriptutils.logger_create('oe-test')
+
+def _load_test_components(logger):
+    components = {}
+
+    for path in sys.path:
+        base_dir = os.path.join(path, 'oeqa')
+        if os.path.exists(base_dir) and os.path.isdir(base_dir):
+            for file in os.listdir(base_dir):
+                comp_name = file
+                comp_context = os.path.join(base_dir, file, 'context.py')
+                if os.path.exists(comp_context):
+                    comp_plugin = importlib.import_module('oeqa.%s.%s' % \
+                            (comp_name, 'context'))
+                    try:
+                        if not issubclass(comp_plugin._executor_class,
+                                OETestContextExecutor):
+                            raise TypeError("Component %s in %s, _executor_class "\
+                                "isn't derived from OETestContextExecutor."\
+                                % (comp_name, comp_context))
+
+                        components[comp_name] = comp_plugin._executor_class()
+                    except AttributeError:
+                        raise AttributeError("Component %s in %s don't have "\
+                                "_executor_class defined." % (comp_name, comp_context))
+
+    return components
+
+def main():
+    parser = argparse_oe.ArgumentParser(description="OpenEmbedded test tool",
+                                        add_help=False,
+                                        epilog="Use %(prog)s <subcommand> --help to get help on a specific command")
+    parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
+    parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
+    global_args, unparsed_args = parser.parse_known_args()
+
+    # Help is added here rather than via add_help=True, as we don't want it to
+    # be handled by parse_known_args()
+    parser.add_argument('-h', '--help', action='help', default=argparse.SUPPRESS,
+                        help='show this help message and exit')
+
+    if global_args.debug:
+        logger.setLevel(logging.DEBUG)
+    elif global_args.quiet:
+        logger.setLevel(logging.ERROR)
+
+    components = _load_test_components(logger)
+
+    subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>')
+    subparsers.add_subparser_group('components', 'Test components')
+    subparsers.required = True
+    for comp_name in sorted(components.keys()):
+        comp = components[comp_name]
+        comp.register_commands(logger, subparsers)
+
+    try:
+        args = parser.parse_args(unparsed_args, namespace=global_args)
+        results = args.func(logger, args)
+        ret = 0 if results.wasSuccessful() else 1
+    except SystemExit as err:
+        if err.code != 0:
+            raise err
+        ret = err.code
+    except argparse_oe.ArgumentUsageError as ae:
+        parser.error_subcommand(ae.message, ae.subcommand)
+
+    return ret
+
+if __name__ == '__main__':
+    try:
+        ret = main()
+    except Exception:
+        ret = 1
+        import traceback
+        traceback.print_exc()
+    sys.exit(ret)
diff --git a/import-layers/yocto-poky/scripts/oe-trim-schemas b/import-layers/yocto-poky/scripts/oe-trim-schemas
index 66a1b8d..7c199ef 100755
--- a/import-layers/yocto-poky/scripts/oe-trim-schemas
+++ b/import-layers/yocto-poky/scripts/oe-trim-schemas
@@ -18,6 +18,15 @@
         l = [e for e in l if e.tag == name]
     return l
 
+if len(sys.argv) < 2 or sys.argv[1] in ('-h', '--help'):
+    print('oe-trim-schemas: error: the following arguments are required: schema\n'
+          'Usage: oe-trim-schemas schema\n\n'
+          'OpenEmbedded trim schemas - remove unneeded schema locale translations\n'
+          '                            from gconf schema files\n\n'
+          'arguments:\n'
+          '  schema                gconf schema file to trim\n')
+    sys.exit(2)
+
 xml = etree.parse(sys.argv[1])
 
 for schema in child(xml.getroot(), "schemalist").getchildren():
diff --git a/import-layers/yocto-poky/scripts/oepydevshell-internal.py b/import-layers/yocto-poky/scripts/oepydevshell-internal.py
index a22bec3..04621ae 100755
--- a/import-layers/yocto-poky/scripts/oepydevshell-internal.py
+++ b/import-layers/yocto-poky/scripts/oepydevshell-internal.py
@@ -22,9 +22,16 @@
     old[3] = old[3] &~ termios.ECHO &~ termios.ICANON
     termios.tcsetattr(fd, termios.TCSADRAIN, old)
 
-if len(sys.argv) != 3:
-    print("Incorrect parameters")
-    sys.exit(1)
+if len(sys.argv) != 3 or sys.argv[1] in ('-h', '--help'):
+    print('oepydevshell-internal.py: error: the following arguments are required: pty, pid\n'
+          'Usage: oepydevshell-internal.py pty pid\n\n'
+          'OpenEmbedded oepydevshell-internal.py - internal script called from meta/classes/devshell.bbclass\n\n'
+          'arguments:\n'
+          '  pty                   pty device name\n'
+          '  pid                   parent process id\n\n'
+          'options:\n'
+          '  -h, --help            show this help message and exit\n')
+    sys.exit(2)
 
 pty = open(sys.argv[1], "w+b", 0)
 parent = int(sys.argv[2])
@@ -38,7 +45,7 @@
 try:
     readline.read_history_file(histfile)
 except IOError:
-    pass 
+    pass
 
 try:
 
diff --git a/import-layers/yocto-poky/scripts/postinst-intercepts/update_gio_module_cache b/import-layers/yocto-poky/scripts/postinst-intercepts/update_gio_module_cache
index fe46809..fc3f9d0 100644
--- a/import-layers/yocto-poky/scripts/postinst-intercepts/update_gio_module_cache
+++ b/import-layers/yocto-poky/scripts/postinst-intercepts/update_gio_module_cache
@@ -3,5 +3,7 @@
 set -e
 
 PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
-        $D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
+	$D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
 
+[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
+	chown root:root $D${libdir}/gio/modules/giomodule.cache
diff --git a/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/draw.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/draw.py
index 8c574be..201ce45 100644
--- a/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/draw.py
+++ b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/draw.py
@@ -133,6 +133,16 @@
 # Package Write RPM/DEB/IPK task color
 TASK_COLOR_PACKAGE_WRITE = (0.0, 0.50, 0.50, 1.0)
 
+# Distinct colors used for different disk volumnes.
+# If we have more volumns, colors get re-used.
+VOLUME_COLORS = [
+	(1.0, 1.0, 0.00, 1.0),
+	(0.0, 1.00, 0.00, 1.0),
+	(1.0, 0.00, 1.00, 1.0),
+	(0.0, 0.00, 1.00, 1.0),
+	(0.0, 1.00, 1.00, 1.0),
+]
+
 # Process states
 STATE_UNDEFINED = 0
 STATE_RUNNING   = 1
@@ -256,7 +266,7 @@
 	# avoid divide by zero
 	if max_y == 0:
 		max_y = 1.0
-	xscale = float (chart_bounds[2]) / max_x
+	xscale = float (chart_bounds[2]) / (max_x - x_shift)
 	# If data_range is given, scale the chart so that the value range in
 	# data_range matches the chart bounds exactly.
 	# Otherwise, scale so that the actual data matches the chart bounds.
@@ -321,6 +331,16 @@
 	w = int ((end - start) * sec_w_base * xscale) + 2 * off_x
 	h = proc_h * processes + header_h + 2 * off_y
 
+	if options.charts:
+		if trace.cpu_stats:
+			h += 30 + bar_h
+		if trace.disk_stats:
+			h += 30 + bar_h
+		if trace.monitor_disk:
+			h += 30 + bar_h
+		if trace.mem_stats:
+			h += meminfo_bar_h
+
 	return (w, h)
 
 def clip_visible(clip, rect):
@@ -334,80 +354,134 @@
 	proc_tree = options.proc_tree(trace)
 
 	# render bar legend
-	ctx.set_font_size(LEGEND_FONT_SIZE)
+	if trace.cpu_stats:
+		ctx.set_font_size(LEGEND_FONT_SIZE)
 
-	draw_legend_box(ctx, "CPU (user+sys)", CPU_COLOR, off_x, curr_y+20, leg_s)
-	draw_legend_box(ctx, "I/O (wait)", IO_COLOR, off_x + 120, curr_y+20, leg_s)
+		draw_legend_box(ctx, "CPU (user+sys)", CPU_COLOR, off_x, curr_y+20, leg_s)
+		draw_legend_box(ctx, "I/O (wait)", IO_COLOR, off_x + 120, curr_y+20, leg_s)
 
-	# render I/O wait
-	chart_rect = (off_x, curr_y+30, w, bar_h)
-	if clip_visible (clip, chart_rect):
-		draw_box_ticks (ctx, chart_rect, sec_w)
-		draw_annotations (ctx, proc_tree, trace.times, chart_rect)
-		draw_chart (ctx, IO_COLOR, True, chart_rect, \
-			    [(sample.time, sample.user + sample.sys + sample.io) for sample in trace.cpu_stats], \
-			    proc_tree, None)
-		# render CPU load
-		draw_chart (ctx, CPU_COLOR, True, chart_rect, \
-			    [(sample.time, sample.user + sample.sys) for sample in trace.cpu_stats], \
-			    proc_tree, None)
+		# render I/O wait
+		chart_rect = (off_x, curr_y+30, w, bar_h)
+		if clip_visible (clip, chart_rect):
+			draw_box_ticks (ctx, chart_rect, sec_w)
+			draw_annotations (ctx, proc_tree, trace.times, chart_rect)
+			draw_chart (ctx, IO_COLOR, True, chart_rect, \
+				    [(sample.time, sample.user + sample.sys + sample.io) for sample in trace.cpu_stats], \
+				    proc_tree, None)
+			# render CPU load
+			draw_chart (ctx, CPU_COLOR, True, chart_rect, \
+				    [(sample.time, sample.user + sample.sys) for sample in trace.cpu_stats], \
+				    proc_tree, None)
 
-	curr_y = curr_y + 30 + bar_h
+		curr_y = curr_y + 30 + bar_h
 
 	# render second chart
-	draw_legend_line(ctx, "Disk throughput", DISK_TPUT_COLOR, off_x, curr_y+20, leg_s)
-	draw_legend_box(ctx, "Disk utilization", IO_COLOR, off_x + 120, curr_y+20, leg_s)
+	if trace.disk_stats:
+		draw_legend_line(ctx, "Disk throughput", DISK_TPUT_COLOR, off_x, curr_y+20, leg_s)
+		draw_legend_box(ctx, "Disk utilization", IO_COLOR, off_x + 120, curr_y+20, leg_s)
 
-        # render I/O utilization
-	chart_rect = (off_x, curr_y+30, w, bar_h)
-	if clip_visible (clip, chart_rect):
-		draw_box_ticks (ctx, chart_rect, sec_w)
-		draw_annotations (ctx, proc_tree, trace.times, chart_rect)
-		draw_chart (ctx, IO_COLOR, True, chart_rect, \
-			    [(sample.time, sample.util) for sample in trace.disk_stats], \
-			    proc_tree, None)
+		# render I/O utilization
+		chart_rect = (off_x, curr_y+30, w, bar_h)
+		if clip_visible (clip, chart_rect):
+			draw_box_ticks (ctx, chart_rect, sec_w)
+			draw_annotations (ctx, proc_tree, trace.times, chart_rect)
+			draw_chart (ctx, IO_COLOR, True, chart_rect, \
+				    [(sample.time, sample.util) for sample in trace.disk_stats], \
+				    proc_tree, None)
 
-	# render disk throughput
-	max_sample = max (trace.disk_stats, key = lambda s: s.tput)
-	if clip_visible (clip, chart_rect):
-		draw_chart (ctx, DISK_TPUT_COLOR, False, chart_rect, \
-			    [(sample.time, sample.tput) for sample in trace.disk_stats], \
-			    proc_tree, None)
+		# render disk throughput
+		max_sample = max (trace.disk_stats, key = lambda s: s.tput)
+		if clip_visible (clip, chart_rect):
+			draw_chart (ctx, DISK_TPUT_COLOR, False, chart_rect, \
+				    [(sample.time, sample.tput) for sample in trace.disk_stats], \
+				    proc_tree, None)
 
-	pos_x = off_x + ((max_sample.time - proc_tree.start_time) * w / proc_tree.duration)
+		pos_x = off_x + ((max_sample.time - proc_tree.start_time) * w / proc_tree.duration)
 
-	shift_x, shift_y = -20, 20
-	if (pos_x < off_x + 245):
-		shift_x, shift_y = 5, 40
+		shift_x, shift_y = -20, 20
+		if (pos_x < off_x + 245):
+			shift_x, shift_y = 5, 40
 
-	label = "%dMB/s" % round ((max_sample.tput) / 1024.0)
-	draw_text (ctx, label, DISK_TPUT_COLOR, pos_x + shift_x, curr_y + shift_y)
+		label = "%dMB/s" % round ((max_sample.tput) / 1024.0)
+		draw_text (ctx, label, DISK_TPUT_COLOR, pos_x + shift_x, curr_y + shift_y)
 
-	curr_y = curr_y + 30 + bar_h
+		curr_y = curr_y + 30 + bar_h
+
+	# render disk space usage
+	#
+	# Draws the amount of disk space used on each volume relative to the
+	# lowest recorded amount. The graphs for each volume are stacked above
+	# each other so that total disk usage is visible.
+	if trace.monitor_disk:
+		ctx.set_font_size(LEGEND_FONT_SIZE)
+		# Determine set of volumes for which we have
+		# information and the minimal amount of used disk
+		# space for each. Currently samples are allowed to
+		# not have a values for all volumes; drawing could be
+		# made more efficient if that wasn't the case.
+		volumes = set()
+		min_used = {}
+		for sample in trace.monitor_disk:
+			for volume, used in sample.records.items():
+				volumes.add(volume)
+				if volume not in min_used or min_used[volume] > used:
+					min_used[volume] = used
+		volumes = sorted(list(volumes))
+		disk_scale = 0
+		for i, volume in enumerate(volumes):
+			volume_scale = max([sample.records[volume] - min_used[volume]
+			                    for sample in trace.monitor_disk
+			                    if volume in sample.records])
+			# Does not take length of volume name into account, but fixed offset
+			# works okay in practice.
+			draw_legend_box(ctx, '%s (max: %u MiB)' % (volume, volume_scale / 1024 / 1024),
+			                VOLUME_COLORS[i % len(VOLUME_COLORS)],
+			                off_x + i * 250, curr_y+20, leg_s)
+			disk_scale += volume_scale
+
+		# render used amount of disk space
+		chart_rect = (off_x, curr_y+30, w, bar_h)
+		if clip_visible (clip, chart_rect):
+			draw_box_ticks (ctx, chart_rect, sec_w)
+			draw_annotations (ctx, proc_tree, trace.times, chart_rect)
+			for i in range(len(volumes), 0, -1):
+				draw_chart (ctx, VOLUME_COLORS[(i - 1) % len(VOLUME_COLORS)], True, chart_rect, \
+				            [(sample.time,
+				              # Sum up used space of all volumes including the current one
+				              # so that the graphs appear as stacked on top of each other.
+				              reduce(lambda x,y: x+y,
+				                     [sample.records[volume] - min_used[volume]
+				                      for volume in volumes[0:i]
+				                      if volume in sample.records],
+				                     0))
+				             for sample in trace.monitor_disk], \
+				            proc_tree, [0, disk_scale])
+
+		curr_y = curr_y + 30 + bar_h
 
 	# render mem usage
 	chart_rect = (off_x, curr_y+30, w, meminfo_bar_h)
 	mem_stats = trace.mem_stats
 	if mem_stats and clip_visible (clip, chart_rect):
-		mem_scale = max(sample.records['MemTotal'] - sample.records['MemFree'] for sample in mem_stats)
+		mem_scale = max(sample.buffers for sample in mem_stats)
 		draw_legend_box(ctx, "Mem cached (scale: %u MiB)" % (float(mem_scale) / 1024), MEM_CACHED_COLOR, off_x, curr_y+20, leg_s)
 		draw_legend_box(ctx, "Used", MEM_USED_COLOR, off_x + 240, curr_y+20, leg_s)
 		draw_legend_box(ctx, "Buffers", MEM_BUFFERS_COLOR, off_x + 360, curr_y+20, leg_s)
-		draw_legend_line(ctx, "Swap (scale: %u MiB)" % max([(sample.records['SwapTotal'] - sample.records['SwapFree'])/1024 for sample in mem_stats]), \
+		draw_legend_line(ctx, "Swap (scale: %u MiB)" % max([(sample.swap)/1024 for sample in mem_stats]), \
 				 MEM_SWAP_COLOR, off_x + 480, curr_y+20, leg_s)
 		draw_box_ticks(ctx, chart_rect, sec_w)
 		draw_annotations(ctx, proc_tree, trace.times, chart_rect)
 		draw_chart(ctx, MEM_BUFFERS_COLOR, True, chart_rect, \
-			   [(sample.time, sample.records['MemTotal'] - sample.records['MemFree']) for sample in trace.mem_stats], \
+			   [(sample.time, sample.buffers) for sample in trace.mem_stats], \
 			   proc_tree, [0, mem_scale])
 		draw_chart(ctx, MEM_USED_COLOR, True, chart_rect, \
-			   [(sample.time, sample.records['MemTotal'] - sample.records['MemFree'] - sample.records['Buffers']) for sample in mem_stats], \
+			   [(sample.time, sample.used) for sample in mem_stats], \
 			   proc_tree, [0, mem_scale])
 		draw_chart(ctx, MEM_CACHED_COLOR, True, chart_rect, \
-			   [(sample.time, sample.records['Cached']) for sample in mem_stats], \
+			   [(sample.time, sample.cached) for sample in mem_stats], \
 			   proc_tree, [0, mem_scale])
 		draw_chart(ctx, MEM_SWAP_COLOR, False, chart_rect, \
-			   [(sample.time, float(sample.records['SwapTotal'] - sample.records['SwapFree'])) for sample in mem_stats], \
+			   [(sample.time, float(sample.swap)) for sample in mem_stats], \
 			   proc_tree, None)
 
 		curr_y = curr_y + meminfo_bar_h
@@ -415,7 +489,7 @@
 	return curr_y
 
 def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w):
-        chart_rect = [off_x, curr_y+header_h, w, h - 2 * off_y - (curr_y+header_h) + proc_h]
+        chart_rect = [off_x, curr_y+header_h, w, h - 2 * off_y - header_h - leg_s + proc_h]
 
 	draw_legend_box (ctx, "Configure", \
 			 TASK_COLOR_CONFIGURE, off_x  , curr_y + 45, leg_s)
@@ -496,6 +570,9 @@
 	w -= 2*off_x
 	curr_y = off_y;
 
+	if options.charts:
+		curr_y = render_charts (ctx, options, clip, trace, curr_y, w, h, sec_w)
+
 	curr_y = render_processes_chart (ctx, options, trace, curr_y, w, h, sec_w)
 
 	return
@@ -513,9 +590,6 @@
 	else:
 		curr_y = off_y;
 
-	if options.charts:
-		curr_y = render_charts (ctx, options, clip, trace, curr_y, w, h, sec_w)
-
 	# draw process boxes
 	proc_height = h
 	if proc_tree.taskstats and options.cumulative:
diff --git a/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/parsing.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/parsing.py
index a3a0b0b..bcfb2da 100644
--- a/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/parsing.py
+++ b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/parsing.py
@@ -38,16 +38,18 @@
         self.min = None
         self.max = None
         self.headers = None
-        self.disk_stats = None
+        self.disk_stats =  []
         self.ps_stats = None
         self.taskstats = None
-        self.cpu_stats = None
+        self.cpu_stats = []
         self.cmdline = None
         self.kernel = None
         self.kernel_tree = None
         self.filename = None
         self.parent_map = None
-        self.mem_stats = None
+        self.mem_stats = []
+        self.monitor_disk = None
+        self.times = [] # Always empty, but expected by draw.py when drawing system charts.
 
         if len(paths):
             parse_paths (writer, self, paths)
@@ -58,6 +60,19 @@
                 self.min = min(self.start.keys())
                 self.max = max(self.end.keys())
 
+
+        # Rendering system charts depends on start and end
+        # time. Provide them where the original drawing code expects
+        # them, i.e. in proc_tree.
+        class BitbakeProcessTree:
+            def __init__(self, start_time, end_time):
+                self.start_time = start_time
+                self.end_time = end_time
+                self.duration = self.end_time - self.start_time
+        self.proc_tree = BitbakeProcessTree(min(self.start.keys()),
+                                            max(self.end.keys()))
+
+
         return
 
         # Turn that parsed information into something more useful
@@ -427,7 +442,13 @@
         # skip the rest of statistics lines
     return samples
 
-def _parse_proc_disk_stat_log(file, numCpu):
+def _parse_reduced_log(file, sample_class):
+    samples = []
+    for time, lines in _parse_timed_blocks(file):
+        samples.append(sample_class(time, *[float(x) for x in lines[0].split()]))
+    return samples
+
+def _parse_proc_disk_stat_log(file):
     """
     Parse file for disk stats, but only look at the whole device, eg. sda,
     not sda1, sda2 etc. The format of relevant lines should be:
@@ -462,12 +483,31 @@
         sums = [ a - b for a, b in zip(sample1.diskdata, sample2.diskdata) ]
         readTput = sums[0] / 2.0 * 100.0 / interval
         writeTput = sums[1] / 2.0 * 100.0 / interval
-        util = float( sums[2] ) / 10 / interval / numCpu
+        util = float( sums[2] ) / 10 / interval
         util = max(0.0, min(1.0, util))
         disk_stats.append(DiskSample(sample2.time, readTput, writeTput, util))
 
     return disk_stats
 
+def _parse_reduced_proc_meminfo_log(file):
+    """
+    Parse file for global memory statistics with
+    'MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree' values
+    (in that order) directly stored on one line.
+    """
+    used_values = ('MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree',)
+
+    mem_stats = []
+    for time, lines in _parse_timed_blocks(file):
+        sample = MemSample(time)
+        for name, value in zip(used_values, lines[0].split()):
+            sample.add_value(name, int(value))
+
+        if sample.valid():
+            mem_stats.append(DrawMemSample(sample))
+
+    return mem_stats
+
 def _parse_proc_meminfo_log(file):
     """
     Parse file for global memory statistics.
@@ -484,14 +524,37 @@
         for line in lines:
             match = meminfo_re.match(line)
             if not match:
-                raise ParseError("Invalid meminfo line \"%s\"" % match.groups(0))
+                raise ParseError("Invalid meminfo line \"%s\"" % line)
             sample.add_value(match.group(1), int(match.group(2)))
 
         if sample.valid():
-            mem_stats.append(sample)
+            mem_stats.append(DrawMemSample(sample))
 
     return mem_stats
 
+def _parse_monitor_disk_log(file):
+    """
+    Parse file with information about amount of diskspace used.
+    The format of relevant lines should be: ^volume path: number-of-bytes?
+    """
+    disk_stats = []
+    diskinfo_re = re.compile(r'^(.+):\s*(\d+)$')
+
+    for time, lines in _parse_timed_blocks(file):
+        sample = DiskSpaceSample(time)
+
+        for line in lines:
+            match = diskinfo_re.match(line)
+            if not match:
+                raise ParseError("Invalid monitor_disk line \"%s\"" % line)
+            sample.add_value(match.group(1), int(match.group(2)))
+
+        if sample.valid():
+            disk_stats.append(sample)
+
+    return disk_stats
+
+
 # if we boot the kernel with: initcall_debug printk.time=1 we can
 # get all manner of interesting data from the dmesg output
 # We turn this into a pseudo-process tree: each event is
@@ -628,6 +691,20 @@
             cmdLines[pid] = values
     return cmdLines
 
+def _parse_bitbake_buildstats(writer, state, filename, file):
+    paths = filename.split("/")
+    task = paths[-1]
+    pn = paths[-2]
+    start = None
+    end = None
+    for line in file:
+        if line.startswith("Started:"):
+            start = int(float(line.split()[-1]))
+        elif line.startswith("Ended:"):
+            end = int(float(line.split()[-1]))
+    if start and end:
+        state.add_process(pn + ":" + task, start, end)
+
 def get_num_cpus(headers):
     """Get the number of CPUs from the system.cpu header property. As the
     CPU utilization graphs are relative, the number of CPUs currently makes
@@ -647,18 +724,25 @@
 def _do_parse(writer, state, filename, file):
     writer.info("parsing '%s'" % filename)
     t1 = clock()
-    paths = filename.split("/")
-    task = paths[-1]
-    pn = paths[-2]
-    start = None
-    end = None
-    for line in file:
-        if line.startswith("Started:"):
-            start = int(float(line.split()[-1]))
-        elif line.startswith("Ended:"):
-            end = int(float(line.split()[-1]))
-    if start and end:
-        state.add_process(pn + ":" + task, start, end)
+    name = os.path.basename(filename)
+    if name == "proc_diskstats.log":
+        state.disk_stats = _parse_proc_disk_stat_log(file)
+    elif name == "reduced_proc_diskstats.log":
+        state.disk_stats = _parse_reduced_log(file, DiskSample)
+    elif name == "proc_stat.log":
+        state.cpu_stats = _parse_proc_stat_log(file)
+    elif name == "reduced_proc_stat.log":
+        state.cpu_stats = _parse_reduced_log(file, CPUSample)
+    elif name == "proc_meminfo.log":
+        state.mem_stats = _parse_proc_meminfo_log(file)
+    elif name == "reduced_proc_meminfo.log":
+        state.mem_stats = _parse_reduced_proc_meminfo_log(file)
+    elif name == "cmdline2.log":
+        state.cmdline = _parse_cmdline_log(writer, file)
+    elif name == "monitor_disk.log":
+        state.monitor_disk = _parse_monitor_disk_log(file)
+    elif not filename.endswith('.log'):
+        _parse_bitbake_buildstats(writer, state, filename, file)
     t2 = clock()
     writer.info("  %s seconds" % str(t2-t1))
     return state
diff --git a/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/samples.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/samples.py
index 015d743..9fc309b 100644
--- a/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/samples.py
+++ b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/samples.py
@@ -53,6 +53,33 @@
         # discard incomplete samples
         return [v for v in MemSample.used_values if v not in keys] == []
 
+class DrawMemSample:
+    """
+    Condensed version of a MemSample with exactly the values used by the drawing code.
+    Initialized either from a valid MemSample or
+    a tuple/list of buffer/used/cached/swap values.
+    """
+    def __init__(self, mem_sample):
+        self.time = mem_sample.time
+        if isinstance(mem_sample, MemSample):
+            self.buffers = mem_sample.records['MemTotal'] - mem_sample.records['MemFree']
+            self.used = mem_sample.records['MemTotal'] - mem_sample.records['MemFree'] - mem_sample.records['Buffers']
+            self.cached = mem_sample.records['Cached']
+            self.swap = mem_sample.records['SwapTotal'] - mem_sample.records['SwapFree']
+        else:
+            self.buffers, self.used, self.cached, self.swap = mem_sample
+
+class DiskSpaceSample:
+    def __init__(self, time):
+        self.time = time
+        self.records = {}
+
+    def add_value(self, name, value):
+        self.records[name] = value
+
+    def valid(self):
+        return bool(self.records)
+
 class ProcessSample:
     def __init__(self, time, state, cpu_sample):
         self.time = time
diff --git a/import-layers/yocto-poky/scripts/recipetool b/import-layers/yocto-poky/scripts/recipetool
index 1052cd2..3765ec7 100755
--- a/import-layers/yocto-poky/scripts/recipetool
+++ b/import-layers/yocto-poky/scripts/recipetool
@@ -73,13 +73,14 @@
         logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
         sys.exit(1)
     logger.debug('Found bitbake path: %s' % bitbakepath)
+    scriptpath.add_oe_lib_path()
 
     scriptutils.logger_setup_color(logger, global_args.color)
 
     tinfoil = tinfoil_init(False)
     try:
-        for path in ([scripts_path] +
-                    tinfoil.config_data.getVar('BBPATH', True).split(':')):
+        for path in (tinfoil.config_data.getVar('BBPATH').split(':')
+                     + [scripts_path]):
             pluginpath = os.path.join(path, 'lib', 'recipetool')
             scriptutils.load_plugins(logger, plugins, pluginpath)
 
diff --git a/import-layers/yocto-poky/scripts/relocate_sdk.py b/import-layers/yocto-poky/scripts/relocate_sdk.py
index e47b4d9..c752fa2 100755
--- a/import-layers/yocto-poky/scripts/relocate_sdk.py
+++ b/import-layers/yocto-poky/scripts/relocate_sdk.py
@@ -103,6 +103,8 @@
                fname.startswith(b("/lib32/")) or fname.startswith(b("/usr/lib32/")) or \
                fname.startswith(b("/usr/lib32/")) or fname.startswith(b("/usr/lib64/")):
                 break
+            if p_filesz == 0:
+                break
             if (len(new_dl_path) >= p_filesz):
                 print("ERROR: could not relocate %s, interp size = %i and %i is needed." \
                     % (elf_file_name, p_memsz, len(new_dl_path) + 1))
diff --git a/import-layers/yocto-poky/scripts/rpm2cpio.sh b/import-layers/yocto-poky/scripts/rpm2cpio.sh
index 5df8c0f..cf23472 100755
--- a/import-layers/yocto-poky/scripts/rpm2cpio.sh
+++ b/import-layers/yocto-poky/scripts/rpm2cpio.sh
@@ -1,53 +1,55 @@
-#!/bin/sh
+#!/bin/sh -efu
 
-# This comes from the RPM5 5.4.0 distribution.
+# This file comes from rpm 4.x distribution
 
-pkg=$1
-if [ "$pkg" = "" -o ! -e "$pkg" ]; then
-    echo "no package supplied" 1>&2
-   exit 1
-fi
+fatal() {
+	echo "$*" >&2
+	exit 1
+}
 
-leadsize=96
-o=`expr $leadsize + 8`
-set `od -j $o -N 8 -t u1 $pkg`
-il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
-dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
-# echo "sig il: $il dl: $dl"
+pkg="$1"
+[ -n "$pkg" -a -e "$pkg" ] ||
+	fatal "No package supplied"
 
-sigsize=`expr 8 + 16 \* $il + $dl`
-o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`
-set `od -j $o -N 8 -t u1 $pkg`
-il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
-dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
-# echo "hdr il: $il dl: $dl"
+_dd() {
+	local o="$1"; shift
+	dd if="$pkg" skip="$o" iflag=skip_bytes status=none $*
+}
 
-hdrsize=`expr 8 + 16 \* $il + $dl`
-o=`expr $o + $hdrsize`
-EXTRACTOR="dd if=$pkg ibs=$o skip=1"
+calcsize() {
+	offset=$(($1 + 8))
 
-COMPRESSION=`($EXTRACTOR |file -) 2>/dev/null`
-if echo $COMPRESSION |grep -iq gzip; then
-	DECOMPRESSOR=gunzip
-elif echo $COMPRESSION |grep -iq bzip2; then
-	DECOMPRESSOR=bunzip2
-elif echo $COMPRESSION |grep -iq xz; then
-	DECOMPRESSOR=unxz
-elif echo $COMPRESSION |grep -iq cpio; then
-	DECOMPRESSOR=cat
-else
-	# Most versions of file don't support LZMA, therefore we assume
-	# anything not detected is LZMA
-	DECOMPRESSOR=`which unlzma 2>/dev/null`
-	case "$DECOMPRESSOR" in
-	    /* ) ;;
-	    *  ) DECOMPRESSOR=`which lzmash 2>/dev/null`
-	         case "$DECOMPRESSOR" in
-	             /* ) DECOMPRESSOR="lzmash -d -c" ;;
-	             *  ) DECOMPRESSOR=cat ;;
-	         esac
-	         ;;
-	esac
-fi
+	local i b b0 b1 b2 b3 b4 b5 b6 b7
 
-$EXTRACTOR 2>/dev/null | $DECOMPRESSOR
+	i=0
+	while [ $i -lt 8 ]; do
+		b="$(_dd $(($offset + $i)) bs=1 count=1)"
+		[ -z "$b" ] &&
+			b="0" ||
+			b="$(exec printf '%u\n' "'$b")"
+		eval "b$i=\$b"
+		i=$(($i + 1))
+	done
+
+	rsize=$((8 + ((($b0 << 24) + ($b1 << 16) + ($b2 << 8) + $b3) << 4) + ($b4 << 24) + ($b5 << 16) + ($b6 << 8) + $b7))
+	offset=$(($offset + $rsize))
+}
+
+case "$(_dd 0 bs=8 count=1)" in
+	"$(printf '\355\253\356\333')"*) ;; # '\xed\xab\xee\xdb'
+	*) fatal "File doesn't look like rpm: $pkg" ;;
+esac
+
+calcsize 96
+sigsize=$rsize
+
+calcsize $(($offset + (8 - ($sigsize % 8)) % 8))
+hdrsize=$rsize
+
+case "$(_dd $offset bs=3 count=1)" in
+	"$(printf '\102\132')"*) _dd $offset | bunzip2 ;; # '\x42\x5a'
+	"$(printf '\037\213')"*) _dd $offset | gunzip  ;; # '\x1f\x8b'
+	"$(printf '\375\067')"*) _dd $offset | xzcat   ;; # '\xfd\x37'
+	"$(printf '\135\000')"*) _dd $offset | unlzma  ;; # '\x5d\x00'
+	*) fatal "Unrecognized rpm file: $pkg" ;;
+esac
diff --git a/import-layers/yocto-poky/scripts/runqemu b/import-layers/yocto-poky/scripts/runqemu
index 6748cb2..9b6d330 100755
--- a/import-layers/yocto-poky/scripts/runqemu
+++ b/import-layers/yocto-poky/scripts/runqemu
@@ -74,17 +74,19 @@
     kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
     publicvnc - enable a VNC server open to all hosts
     audio - enable audio
+    [*/]ovmf* - OVMF firmware file or base name for booting with UEFI
   tcpserial=<port> - specify tcp serial port number
   biosdir=<dir> - specify custom bios dir
   biosfilename=<filename> - specify bios filename
   qemuparams=<xyz> - specify custom parameters to QEMU
   bootparams=<xyz> - specify custom kernel parameters during boot
-  help: print this text
+  help, -h, --help: print this text
 
 Examples:
+  runqemu
   runqemu qemuarm
   runqemu tmp/deploy/images/qemuarm
-  runqemu tmp/deploy/images/qemux86/.qemuboot.conf
+  runqemu tmp/deploy/images/qemux86/<qemuboot.conf>
   runqemu qemux86-64 core-image-sato ext4
   runqemu qemux86-64 wic-image-minimal wic
   runqemu path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial
@@ -96,7 +98,7 @@
 """)
 
 def check_tun():
-    """Check /dev/net/run"""
+    """Check /dev/net/tun"""
     dev_tun = '/dev/net/tun'
     if not os.path.exists(dev_tun):
         raise Exception("TUN control device %s is unavailable; you may need to enable TUN (e.g. sudo modprobe tun)" % dev_tun)
@@ -147,21 +149,46 @@
                     return f
     return ''
 
+def check_free_port(host, port):
+    """ Check whether the port is free or not """
+    import socket
+    from contextlib import closing
+
+    with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
+        if sock.connect_ex((host, port)) == 0:
+            # Port is open, so not free
+            return False
+        else:
+            # Port is not open, so free
+            return True
+
 class BaseConfig(object):
     def __init__(self):
-        # Vars can be merged with .qemuboot.conf, use a dict to manage them.
-        self.d = {
-            'MACHINE': '',
-            'DEPLOY_DIR_IMAGE': '',
-            'QB_KERNEL_ROOT': '/dev/vda',
-        }
+        # The self.d saved vars from self.set(), part of them are from qemuboot.conf
+        self.d = {'QB_KERNEL_ROOT': '/dev/vda'}
+
+        # Supported env vars, add it here if a var can be got from env,
+        # and don't use os.getenv in the code.
+        self.env_vars = ('MACHINE',
+                        'ROOTFS',
+                        'KERNEL',
+                        'DEPLOY_DIR_IMAGE',
+                        'OE_TMPDIR',
+                        'OECORE_NATIVE_SYSROOT',
+                        )
 
         self.qemu_opt = ''
         self.qemu_opt_script = ''
-        self.nfs_dir = ''
         self.clean_nfs_dir = False
         self.nfs_server = ''
         self.rootfs = ''
+        # File name(s) of a OVMF firmware file or variable store,
+        # to be added with -drive if=pflash.
+        # Found in the same places as the rootfs, with or without one of
+        # these suffices: qcow2, bin.
+        # Setting one also adds "-vga std" because that is all that
+        # OVMF supports.
+        self.ovmf_bios = []
         self.qemuboot = ''
         self.qbconfload = False
         self.kernel = ''
@@ -187,6 +214,15 @@
         self.snapshot = False
         self.fstypes = ('ext2', 'ext3', 'ext4', 'jffs2', 'nfs', 'btrfs', 'cpio.gz', 'cpio', 'ramfs')
         self.vmtypes = ('hddimg', 'hdddirect', 'wic', 'vmdk', 'qcow2', 'vdi', 'iso')
+        self.network_device = "-device e1000,netdev=net0,mac=@MAC@"
+        # Use different mac section for tap and slirp to avoid
+        # conflicts, e.g., when one is running with tap, the other is
+        # running with slirp.
+        # The last section is dynamic, which is for avoiding conflicts,
+        # when multiple qemus are running, e.g., when multiple tap or
+        # slirp qemus are running.
+        self.mac_tap = "52:54:00:12:34:"
+        self.mac_slirp = "52:54:00:12:35:"
 
     def acquire_lock(self):
         logger.info("Acquiring lockfile %s..." % self.lock)
@@ -208,6 +244,8 @@
     def get(self, key):
         if key in self.d:
             return self.d.get(key)
+        elif os.getenv(key):
+            return os.getenv(key)
         else:
             return ''
 
@@ -219,7 +257,7 @@
             if not re.search('.qemuboot.conf$', '\n'.join(os.listdir(p)), re.M):
                 logger.info("Can't find required *.qemuboot.conf in %s" % p)
                 return False
-            if not re.search('-image-', '\n'.join(os.listdir(p))):
+            if not any(map(lambda name: '-image-' in name, os.listdir(p))):
                 logger.info("Can't find *-image-* in %s" % p)
                 return False
             return True
@@ -246,12 +284,11 @@
 
     def check_arg_nfs(self, p):
         if os.path.isdir(p):
-            self.nfs_dir = p
+            self.rootfs = p
         else:
             m = re.match('(.*):(.*)', p)
             self.nfs_server = m.group(1)
-            self.nfs_dir = m.group(2)
-        self.rootfs = ""
+            self.rootfs = m.group(2)
         self.check_arg_fstype('nfs')
 
     def check_arg_path(self, p):
@@ -260,6 +297,7 @@
         - Check whether is a kernel file
         - Check whether is a image file
         - Check whether it is a nfs dir
+        - Check whether it is a OVMF flash file
         """
         if p.endswith('.qemuboot.conf'):
             self.qemuboot = p
@@ -268,37 +306,52 @@
              re.search('zImage', p) or re.search('vmlinux', p) or \
              re.search('fitImage', p) or re.search('uImage', p):
             self.kernel =  p
-        elif os.path.exists(p) and (not os.path.isdir(p)) and re.search('-image-', os.path.basename(p)):
+        elif os.path.exists(p) and (not os.path.isdir(p)) and '-image-' in os.path.basename(p):
             self.rootfs = p
-            dirpath = os.path.dirname(p)
-            m = re.search('(.*)\.(.*)$', p)
-            if m:
-                qb = '%s%s' % (re.sub('\.rootfs$', '', m.group(1)), '.qemuboot.conf')
+            # Check filename against self.fstypes can hanlde <file>.cpio.gz,
+            # otherwise, its type would be "gz", which is incorrect.
+            fst = ""
+            for t in self.fstypes:
+                if p.endswith(t):
+                    fst = t
+                    break
+            if not fst:
+                m = re.search('.*\.(.*)$', self.rootfs)
+                if m:
+                    fst =  m.group(1)
+            if fst:
+                self.check_arg_fstype(fst)
+                qb = re.sub('\.' + fst + "$", '', self.rootfs)
+                qb = '%s%s' % (re.sub('\.rootfs$', '', qb), '.qemuboot.conf')
                 if os.path.exists(qb):
                     self.qemuboot = qb
                     self.qbconfload = True
                 else:
                     logger.warn("%s doesn't exist" % qb)
-                fst = m.group(2)
-                self.check_arg_fstype(fst)
             else:
                 raise Exception("Can't find FSTYPE from: %s" % p)
-        elif os.path.isdir(p) or re.search(':', arg) and re.search('/', arg):
+
+        elif os.path.isdir(p) or re.search(':', p) and re.search('/', p):
             if self.is_deploy_dir_image(p):
                 logger.info('DEPLOY_DIR_IMAGE: %s' % p)
                 self.set("DEPLOY_DIR_IMAGE", p)
             else:
                 logger.info("Assuming %s is an nfs rootfs" % p)
                 self.check_arg_nfs(p)
+        elif os.path.basename(p).startswith('ovmf'):
+            self.ovmf_bios.append(p)
         else:
             raise Exception("Unknown path arg %s" % p)
 
     def check_arg_machine(self, arg):
         """Check whether it is a machine"""
-        if self.get('MACHINE') and self.get('MACHINE') != arg or re.search('/', arg):
-            raise Exception("Unknown arg: %s" % arg)
-        elif self.get('MACHINE') == arg:
+        if self.get('MACHINE') == arg:
             return
+        elif self.get('MACHINE') and self.get('MACHINE') != arg:
+            raise Exception("Maybe conflicted MACHINE: %s vs %s" % (self.get('MACHINE'), arg))
+        elif re.search('/', arg):
+            raise Exception("Unknown arg: %s" % arg)
+
         logger.info('Assuming MACHINE = %s' % arg)
 
         # if we're running under testimage, or similarly as a child
@@ -307,14 +360,14 @@
         # FIXME: testimage.bbclass exports these two variables into env,
         # are there other scenarios in which we need to support being
         # invoked by bitbake?
-        deploy = os.environ.get('DEPLOY_DIR_IMAGE')
-        bbchild = deploy and os.environ.get('OE_TMPDIR')
+        deploy = self.get('DEPLOY_DIR_IMAGE')
+        bbchild = deploy and self.get('OE_TMPDIR')
         if bbchild:
             self.set_machine_deploy_dir(arg, deploy)
             return
         # also check whether we're running under a sourced toolchain
         # environment file
-        if os.environ.get('OECORE_NATIVE_SYSROOT'):
+        if self.get('OECORE_NATIVE_SYSROOT'):
             self.set("MACHINE", arg)
             return
 
@@ -372,11 +425,13 @@
                 self.bootparams = arg[len('bootparams='):]
             elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)):
                 self.check_arg_path(os.path.abspath(arg))
-            elif re.search('-image-', arg):
+            elif re.search(r'-image-|-image$', arg):
                 # Lazy rootfs
                 self.rootfs = arg
+            elif arg.startswith('ovmf'):
+                self.ovmf_bios.append(arg)
             else:
-                # At last, assume is it the MACHINE
+                # At last, assume it is the MACHINE
                 if (not unknown_arg) or unknown_arg == arg:
                     unknown_arg = arg
                 else:
@@ -385,19 +440,20 @@
         if unknown_arg:
             if self.get('MACHINE') == unknown_arg:
                 return
-            if not self.get('DEPLOY_DIR_IMAGE'):
-                # Trying to get DEPLOY_DIR_IMAGE from env.
-                p = os.getenv('DEPLOY_DIR_IMAGE')
-                if p and self.is_deploy_dir_image(p):
-                    machine = os.path.basename(p)
-                    if unknown_arg == machine:
-                        self.set_machine_deploy_dir(machine, p)
-                        return
-                    else:
-                        logger.info('DEPLOY_DIR_IMAGE: %s' % p)
-                        self.set("DEPLOY_DIR_IMAGE", p)
+            if self.get('DEPLOY_DIR_IMAGE'):
+                machine = os.path.basename(self.get('DEPLOY_DIR_IMAGE'))
+                if unknown_arg == machine:
+                    self.set("MACHINE", machine)
+                    return
+
             self.check_arg_machine(unknown_arg)
 
+        if not self.get('DEPLOY_DIR_IMAGE'):
+            self.load_bitbake_env()
+            s = re.search('^DEPLOY_DIR_IMAGE="(.*)"', self.bitbake_e, re.M)
+            if s:
+                self.set("DEPLOY_DIR_IMAGE", s.group(1))
+
     def check_kvm(self):
         """Check kvm and kvm-host"""
         if not (self.kvm_enabled or self.vhost_enabled):
@@ -426,6 +482,11 @@
 
         if os.access(dev_kvm, os.W_OK|os.R_OK):
             self.qemu_opt_script += ' -enable-kvm'
+            if self.get('MACHINE') == "qemux86":
+                # Workaround for broken APIC window on pre 4.15 host kernels which causes boot hangs
+                # See YOCTO #12301
+                # On 64 bit we use x2apic
+                self.kernel_cmdline_script += " clocksource=kvm-clock hpet=disable noapic nolapic"
         else:
             logger.error("You have no read or write permission on /dev/kvm.")
             logger.error("Please change the ownership of this file as described at:")
@@ -454,6 +515,15 @@
     def check_rootfs(self):
         """Check and set rootfs"""
 
+        if self.fstype == "none":
+            return
+
+        if self.get('ROOTFS'):
+            if not self.rootfs:
+                self.rootfs = self.get('ROOTFS')
+            elif self.get('ROOTFS') != self.rootfs:
+                raise Exception("Maybe conflicted ROOTFS: %s vs %s" % (self.get('ROOTFS'), self.rootfs))
+
         if self.fstype == 'nfs':
             return
 
@@ -473,15 +543,36 @@
         if not os.path.exists(self.rootfs):
             raise Exception("Can't find rootfs: %s" % self.rootfs)
 
+    def check_ovmf(self):
+        """Check and set full path for OVMF firmware and variable file(s)."""
+
+        for index, ovmf in enumerate(self.ovmf_bios):
+            if os.path.exists(ovmf):
+                continue
+            for suffix in ('qcow2', 'bin'):
+                path = '%s/%s.%s' % (self.get('DEPLOY_DIR_IMAGE'), ovmf, suffix)
+                if os.path.exists(path):
+                    self.ovmf_bios[index] = path
+                    break
+            else:
+                raise Exception("Can't find OVMF firmware: %s" % ovmf)
+
     def check_kernel(self):
         """Check and set kernel, dtb"""
         # The vm image doesn't need a kernel
         if self.fstype in self.vmtypes:
             return
 
+        # QB_DEFAULT_KERNEL is always a full file path
+        kernel_name = os.path.basename(self.get('QB_DEFAULT_KERNEL'))
+
+        # The user didn't want a kernel to be loaded
+        if kernel_name == "none":
+            return
+
         deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
         if not self.kernel:
-            kernel_match_name = "%s/%s" % (deploy_dir_image, self.get('QB_DEFAULT_KERNEL'))
+            kernel_match_name = "%s/%s" % (deploy_dir_image, kernel_name)
             kernel_match_link = "%s/%s" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE'))
             kernel_startswith = "%s/%s*" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE'))
             cmds = (kernel_match_name, kernel_match_link, kernel_startswith)
@@ -543,7 +634,8 @@
     def check_and_set(self):
         """Check configs sanity and set when needed"""
         self.validate_paths()
-        check_tun()
+        if not self.slirp_enabled:
+            check_tun()
         # Check audio
         if self.audio_enabled:
             if not self.get('QB_AUDIO_DRV'):
@@ -559,6 +651,7 @@
         self.check_kvm()
         self.check_fstype()
         self.check_rootfs()
+        self.check_ovmf()
         self.check_kernel()
         self.check_biosdir()
         self.check_mem()
@@ -568,8 +661,6 @@
         if not self.qemuboot:
             if self.get('DEPLOY_DIR_IMAGE'):
                 deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
-            elif os.getenv('DEPLOY_DIR_IMAGE'):
-                deploy_dir_image = os.getenv('DEPLOY_DIR_IMAGE')
             else:
                 logger.info("Can't find qemuboot conf file, DEPLOY_DIR_IMAGE is NULL!")
                 return
@@ -586,7 +677,15 @@
                 logger.info('Running %s...' % cmd)
                 qbs = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
                 if qbs:
-                    self.qemuboot = qbs.split()[0]
+                    for qb in qbs.split():
+                        # Don't use initramfs when other choices unless fstype is ramfs
+                        if '-initramfs-' in os.path.basename(qb) and self.fstype != 'cpio.gz':
+                                continue
+                        self.qemuboot = qb
+                        break
+                    if not self.qemuboot:
+                        # Use the first one when no choice
+                        self.qemuboot = qbs.split()[0]
                     self.qbconfload = True
 
         if not self.qemuboot:
@@ -595,7 +694,7 @@
             return
 
         if not os.path.exists(self.qemuboot):
-            raise Exception("Failed to find <image>.qemuboot.conf!")
+            raise Exception("Failed to find %s (wrong image name or BSP does not support running under qemu?)." % self.qemuboot)
 
         logger.info('CONFFILE: %s' % self.qemuboot)
 
@@ -611,8 +710,8 @@
         # artefacts are relative to that file, rather than in whatever
         # directory DEPLOY_DIR_IMAGE in the conf file points to.
         if self.qbconfload:
-            imgdir = os.path.dirname(self.qemuboot)
-            if imgdir != self.get('DEPLOY_DIR_IMAGE'):
+            imgdir = os.path.realpath(os.path.dirname(self.qemuboot))
+            if imgdir != os.path.realpath(self.get('DEPLOY_DIR_IMAGE')):
                 logger.info('Setting DEPLOY_DIR_IMAGE to folder containing %s (%s)' % (self.qemuboot, imgdir))
                 self.set('DEPLOY_DIR_IMAGE', imgdir)
 
@@ -627,7 +726,7 @@
                 self.load_bitbake_env()
 
             if self.bitbake_e:
-                native_vars = ['STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE']
+                native_vars = ['STAGING_DIR_NATIVE']
                 for nv in native_vars:
                     s = re.search('^%s="(.*)"' % nv, self.bitbake_e, re.M)
                     if s and s.group(1) != self.get(nv):
@@ -638,8 +737,8 @@
                 # be able to call `bitbake -e`, then try:
                 # - get OE_TMPDIR from environment and guess paths based on it
                 # - get OECORE_NATIVE_SYSROOT from environment (for sdk)
-                tmpdir = os.environ.get('OE_TMPDIR', None)
-                oecore_native_sysroot = os.environ.get('OECORE_NATIVE_SYSROOT', None)
+                tmpdir = self.get('OE_TMPDIR')
+                oecore_native_sysroot = self.get('OECORE_NATIVE_SYSROOT')
                 if tmpdir:
                     logger.info('Setting STAGING_DIR_NATIVE and STAGING_BINDIR_NATIVE relative to OE_TMPDIR (%s)' % tmpdir)
                     hostos, _, _, _, machine = os.uname()
@@ -664,9 +763,11 @@
         print('MACHINE: [%s]' % self.get('MACHINE'))
         print('FSTYPE: [%s]' % self.fstype)
         if self.fstype  == 'nfs':
-            print('NFS_DIR: [%s]' % self.nfs_dir)
+            print('NFS_DIR: [%s]' % self.rootfs)
         else:
             print('ROOTFS: [%s]' % self.rootfs)
+        if self.ovmf_bios:
+            print('OVMF: %s' % self.ovmf_bios)
         print('CONFFILE: [%s]' % self.qemuboot)
         print('')
 
@@ -707,13 +808,13 @@
 
         self.unfs_opts="nfsvers=3,port=%s,mountprog=%s,nfsprog=%s,udp,mountport=%s" % (nfsd_port, mountd_rpcport, nfsd_rpcport, mountd_port)
 
-        # Extract .tar.bz2 or .tar.bz if no self.nfs_dir
-        if not self.nfs_dir:
+        # Extract .tar.bz2 or .tar.bz if no nfs dir
+        if not (self.rootfs and os.path.isdir(self.rootfs)):
             src_prefix = '%s/%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_LINK_NAME'))
             dest = "%s-nfsroot" % src_prefix
             if os.path.exists('%s.pseudo_state' % dest):
                 logger.info('Use %s as NFS_DIR' % dest)
-                self.nfs_dir = dest
+                self.rootfs = dest
             else:
                 src = ""
                 src1 = '%s.tar.bz2' % src_prefix
@@ -730,24 +831,49 @@
                 if subprocess.call(cmd, shell=True) != 0:
                     raise Exception('Failed to run %s' % cmd)
                 self.clean_nfs_dir = True
-                self.nfs_dir = dest
+                self.rootfs = dest
 
         # Start the userspace NFS server
-        cmd = 'runqemu-export-rootfs start %s' % self.nfs_dir
+        cmd = 'runqemu-export-rootfs start %s' % self.rootfs
         logger.info('Running %s...' % cmd)
         if subprocess.call(cmd, shell=True) != 0:
             raise Exception('Failed to run %s' % cmd)
 
         self.nfs_running = True
 
-
     def setup_slirp(self):
         """Setup user networking"""
 
         if self.fstype == 'nfs':
             self.setup_nfs()
         self.kernel_cmdline_script += ' ip=dhcp'
-        self.set('NETWORK_CMD', self.get('QB_SLIRP_OPT'))
+        # Port mapping
+        hostfwd = ",hostfwd=tcp::2222-:22,hostfwd=tcp::2323-:23"
+        qb_slirp_opt_default = "-netdev user,id=net0%s" % hostfwd
+        qb_slirp_opt = self.get('QB_SLIRP_OPT') or qb_slirp_opt_default
+        # Figure out the port
+        ports = re.findall('hostfwd=[^-]*:([0-9]+)-[^,-]*', qb_slirp_opt)
+        ports = [int(i) for i in ports]
+        mac = 2
+        # Find a free port to avoid conflicts
+        for p in ports[:]:
+            p_new = p
+            while not check_free_port('localhost', p_new):
+                p_new += 1
+                mac += 1
+                while p_new in ports:
+                        p_new += 1
+                        mac += 1
+            if p != p_new:
+                ports.append(p_new)
+                qb_slirp_opt = re.sub(':%s-' % p, ':%s-' % p_new, qb_slirp_opt)
+                logger.info("Port forward changed: %s -> %s" % (p, p_new))
+        mac = "%s%02x" % (self.mac_slirp, mac)
+        self.set('NETWORK_CMD', '%s %s' % (self.network_device.replace('@MAC@', mac), qb_slirp_opt))
+        # Print out port foward
+        hostfwd = re.findall('(hostfwd=[^,]*)', qb_slirp_opt)
+        if hostfwd:
+            logger.info('Port forward: %s' % ' '.join(hostfwd))
 
     def setup_tap(self):
         """Setup tap"""
@@ -799,7 +925,7 @@
             gid = os.getgid()
             uid = os.getuid()
             logger.info("Setting up tap interface under sudo")
-            cmd = 'sudo %s %s %s %s' % (self.qemuifup, uid, gid, self.get('STAGING_DIR_NATIVE'))
+            cmd = 'sudo %s %s %s %s' % (self.qemuifup, uid, gid, self.bindir_native)
             tap = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8').rstrip('\n')
             lockfile = os.path.join(lockdir, tap)
             self.lock = lockfile + '.lock'
@@ -816,27 +942,35 @@
         client = gateway + 1
         if self.fstype == 'nfs':
             self.setup_nfs()
-        self.kernel_cmdline_script += " ip=192.168.7.%s::192.168.7.%s:255.255.255.0" % (client, gateway)
-        mac = "52:54:00:12:34:%02x" % client
+        netconf = "192.168.7.%s::192.168.7.%s:255.255.255.0" % (client, gateway)
+        logger.info("Network configuration: %s", netconf)
+        self.kernel_cmdline_script += " ip=%s" % netconf
+        mac = "%s%02x" % (self.mac_tap, client)
         qb_tap_opt = self.get('QB_TAP_OPT')
         if qb_tap_opt:
-            qemu_tap_opt = qb_tap_opt.replace('@TAP@', tap).replace('@MAC@', mac)
+            qemu_tap_opt = qb_tap_opt.replace('@TAP@', tap)
         else:
-            qemu_tap_opt = "-device virtio-net-pci,netdev=net0,mac=%s -netdev tap,id=net0,ifname=%s,script=no,downscript=no" % (mac, self.tap)
+            qemu_tap_opt = "-netdev tap,id=net0,ifname=%s,script=no,downscript=no" % (self.tap)
 
         if self.vhost_enabled:
             qemu_tap_opt += ',vhost=on'
 
-        self.set('NETWORK_CMD', qemu_tap_opt)
+        self.set('NETWORK_CMD', '%s %s' % (self.network_device.replace('@MAC@', mac), qemu_tap_opt))
 
     def setup_network(self):
+        if self.get('QB_NET') == 'none':
+            return
         cmd = "stty -g"
         self.saved_stty = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
+        self.network_device = self.get('QB_NETWORK_DEVICE') or self.network_device
         if self.slirp_enabled:
             self.setup_slirp()
         else:
             self.setup_tap()
 
+    def setup_rootfs(self):
+        if self.get('QB_ROOTFS') == 'none':
+            return
         rootfs_format = self.fstype if self.fstype in ('vmdk', 'qcow2', 'vdi') else 'raw'
 
         qb_rootfs_opt = self.get('QB_ROOTFS_OPT')
@@ -849,31 +983,40 @@
             self.kernel_cmdline = 'root=/dev/ram0 rw debugshell'
             self.rootfs_options = '-initrd %s' % self.rootfs
         else:
+            vm_drive = ''
             if self.fstype in self.vmtypes:
                 if self.fstype == 'iso':
                     vm_drive = '-cdrom %s' % self.rootfs
-                else:
-                    cmd1 = "grep -q 'root=/dev/sd' %s" % self.rootfs
-                    cmd2 = "grep -q 'root=/dev/hd' %s" % self.rootfs
-                    if subprocess.call(cmd1, shell=True) == 0:
+                elif self.get('QB_DRIVE_TYPE'):
+                    drive_type = self.get('QB_DRIVE_TYPE')
+                    if drive_type.startswith("/dev/sd"):
                         logger.info('Using scsi drive')
                         vm_drive = '-drive if=none,id=hd,file=%s,format=%s -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd' \
                                        % (self.rootfs, rootfs_format)
-                    elif subprocess.call(cmd2, shell=True) == 0:
+                    elif drive_type.startswith("/dev/hd"):
                         logger.info('Using ide drive')
                         vm_drive = "%s,format=%s" % (self.rootfs, rootfs_format)
                     else:
-                        logger.warn("Can't detect drive type %s" % self.rootfs)
-                        logger.warn('Trying to use virtio block drive')
+                        # virtio might have been selected explicitly (just use it), or
+                        # is used as fallback (then warn about that).
+                        if not drive_type.startswith("/dev/vd"):
+                            logger.warn("Unknown QB_DRIVE_TYPE: %s" % drive_type)
+                            logger.warn("Failed to figure out drive type, consider define or fix QB_DRIVE_TYPE")
+                            logger.warn('Trying to use virtio block drive')
                         vm_drive = '-drive if=virtio,file=%s,format=%s' % (self.rootfs, rootfs_format)
+
+                # All branches above set vm_drive.
                 self.rootfs_options = '%s -no-reboot' % vm_drive
             self.kernel_cmdline = 'root=%s rw highres=off' % (self.get('QB_KERNEL_ROOT'))
 
         if self.fstype == 'nfs':
             self.rootfs_options = ''
-            k_root = '/dev/nfs nfsroot=%s:%s,%s' % (self.nfs_server, self.nfs_dir, self.unfs_opts)
+            k_root = '/dev/nfs nfsroot=%s:%s,%s' % (self.nfs_server, self.rootfs, self.unfs_opts)
             self.kernel_cmdline = 'root=%s rw highres=off' % k_root
 
+        if self.fstype == 'none':
+            self.rootfs_options = ''
+
         self.set('ROOTFS_OPTIONS', self.rootfs_options)
 
     def guess_qb_system(self):
@@ -921,13 +1064,38 @@
         if not qemu_system:
             raise Exception("Failed to boot, QB_SYSTEM_NAME is NULL!")
 
-        qemu_bin = '%s/%s' % (self.get('STAGING_BINDIR_NATIVE'), qemu_system)
+        qemu_bin = '%s/%s' % (self.bindir_native, qemu_system)
+
+        # It is possible to have qemu-native in ASSUME_PROVIDED, and it won't
+        # find QEMU in sysroot, it needs to use host's qemu.
+        if not os.path.exists(qemu_bin):
+            logger.info("QEMU binary not found in %s, trying host's QEMU" % qemu_bin)
+            for path in (os.environ['PATH'] or '').split(':'):
+                qemu_bin_tmp = os.path.join(path, qemu_system)
+                logger.info("Trying: %s" % qemu_bin_tmp)
+                if os.path.exists(qemu_bin_tmp):
+                    qemu_bin = qemu_bin_tmp
+                    if not os.path.isabs(qemu_bin):
+                        qemu_bin = os.path.abspath(qemu_bin)
+                    logger.info("Using host's QEMU: %s" % qemu_bin)
+                    break
+
         if not os.access(qemu_bin, os.X_OK):
             raise OEPathError("No QEMU binary '%s' could be found" % qemu_bin)
 
         check_libgl(qemu_bin)
 
-        self.qemu_opt = "%s %s %s %s %s" % (qemu_bin, self.get('NETWORK_CMD'), self.qemu_opt_script, self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND'))
+        self.qemu_opt = "%s %s %s %s" % (qemu_bin, self.get('NETWORK_CMD'), self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND'))
+
+        for ovmf in self.ovmf_bios:
+            format = ovmf.rsplit('.', 1)[-1]
+            self.qemu_opt += ' -drive if=pflash,format=%s,file=%s' % (format, ovmf)
+        if self.ovmf_bios:
+            # OVMF only supports normal VGA, i.e. we need to override a -vga vmware
+            # that gets added for example for normal qemux86.
+            self.qemu_opt += ' -vga std'
+
+        self.qemu_opt += ' ' + self.qemu_opt_script
 
         if self.snapshot:
             self.qemu_opt += " -snapshot"
@@ -953,6 +1121,17 @@
             elif serial_num == 1:
                 self.qemu_opt += " %s" % self.get("QB_SERIAL_OPT")
 
+        # We always wants ttyS0 and ttyS1 in qemu machines (see SERIAL_CONSOLES),
+        # if not serial or serialtcp options was specified only ttyS0 is created
+        # and sysvinit shows an error trying to enable ttyS1:
+        #     INIT: Id "S1" respawning too fast: disabled for 5 minutes
+        serial_num = len(re.findall("-serial", self.qemu_opt))
+        if serial_num == 0:
+            if re.search("-nographic", self.qemu_opt):
+                self.qemu_opt += " -serial mon:stdio -serial null"
+            else:
+                self.qemu_opt += " -serial mon:vc -serial null"
+
     def start_qemu(self):
         if self.kernel:
             kernel_opts = "-kernel %s -append '%s %s %s %s'" % (self.kernel, self.kernel_cmdline,
@@ -969,7 +1148,7 @@
 
     def cleanup(self):
         if self.cleantap:
-            cmd = 'sudo %s %s %s' % (self.qemuifdown, self.tap, self.get('STAGING_DIR_NATIVE'))
+            cmd = 'sudo %s %s %s' % (self.qemuifdown, self.tap, self.bindir_native)
             logger.info('Running %s' % cmd)
             subprocess.call(cmd, shell=True)
         if self.lock_descriptor:
@@ -978,7 +1157,7 @@
 
         if self.nfs_running:
             logger.info("Shutting down the userspace NFS server...")
-            cmd = "runqemu-export-rootfs stop %s" % self.nfs_dir
+            cmd = "runqemu-export-rootfs stop %s" % self.rootfs
             logger.info('Running %s' % cmd)
             subprocess.call(cmd, shell=True)
 
@@ -987,9 +1166,9 @@
             subprocess.call(cmd, shell=True)
 
         if self.clean_nfs_dir:
-            logger.info('Removing %s' % self.nfs_dir)
-            shutil.rmtree(self.nfs_dir)
-            shutil.rmtree('%s.pseudo_state' % self.nfs_dir)
+            logger.info('Removing %s' % self.rootfs)
+            shutil.rmtree(self.rootfs)
+            shutil.rmtree('%s.pseudo_state' % self.rootfs)
 
     def load_bitbake_env(self, mach=None):
         if self.bitbake_e:
@@ -1014,8 +1193,30 @@
             self.bitbake_e = ''
             logger.warn("Couldn't run 'bitbake -e' to gather environment information:\n%s" % err.output.decode('utf-8'))
 
+    @property
+    def bindir_native(self):
+        result = self.get('STAGING_BINDIR_NATIVE')
+        if result and os.path.exists(result):
+            return result
+
+        cmd = 'bitbake qemu-helper-native -e'
+        logger.info('Running %s...' % cmd)
+        out = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
+        out = out.stdout.read().decode('utf-8')
+
+        match = re.search('^STAGING_BINDIR_NATIVE="(.*)"', out, re.M)
+        if match:
+            result = match.group(1)
+            if os.path.exists(result):
+                self.set('STAGING_BINDIR_NATIVE', result)
+                return result
+            raise Exception("Native sysroot directory %s doesn't exist" % result)
+        else:
+            raise Exception("Can't find STAGING_BINDIR_NATIVE in '%s' output" % cmd)
+
+
 def main():
-    if len(sys.argv) == 1 or "help" in sys.argv:
+    if "help" in sys.argv or '-h' in sys.argv or '--help' in sys.argv:
         print_usage()
         return 0
     config = BaseConfig()
@@ -1030,6 +1231,7 @@
     config.print_config()
     try:
         config.setup_network()
+        config.setup_rootfs()
         config.setup_final()
         config.start_qemu()
     finally:
diff --git a/import-layers/yocto-poky/scripts/runqemu-export-rootfs b/import-layers/yocto-poky/scripts/runqemu-export-rootfs
index 7ebc071..c7992d8 100755
--- a/import-layers/yocto-poky/scripts/runqemu-export-rootfs
+++ b/import-layers/yocto-poky/scripts/runqemu-export-rootfs
@@ -44,7 +44,7 @@
 	echo "Did you forget to source your build environment setup script?"
 	exit 1
 fi
-. $SYSROOT_SETUP_SCRIPT
+. $SYSROOT_SETUP_SCRIPT meta-ide-support
 
 if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/unfsd" ]; then
 	echo "Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/bin/"
diff --git a/import-layers/yocto-poky/scripts/runqemu-extract-sdk b/import-layers/yocto-poky/scripts/runqemu-extract-sdk
index 32ddd48..2a0dd50 100755
--- a/import-layers/yocto-poky/scripts/runqemu-extract-sdk
+++ b/import-layers/yocto-poky/scripts/runqemu-extract-sdk
@@ -35,7 +35,7 @@
     echo "Did you forget to source your build system environment setup script?"
     exit 1
 fi
-. $SYSROOT_SETUP_SCRIPT
+. $SYSROOT_SETUP_SCRIPT meta-ide-support
 PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr"
 
 ROOTFS_TARBALL=$1
diff --git a/import-layers/yocto-poky/scripts/runqemu-gen-tapdevs b/import-layers/yocto-poky/scripts/runqemu-gen-tapdevs
index bfb60f4..11de318 100755
--- a/import-layers/yocto-poky/scripts/runqemu-gen-tapdevs
+++ b/import-layers/yocto-poky/scripts/runqemu-gen-tapdevs
@@ -23,11 +23,13 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 usage() {
-	echo "Usage: sudo $0 <uid> <gid> <num> <native-sysroot-basedir>"
+	echo "Usage: sudo $0 <uid> <gid> <num> <staging_bindir_native>"
         echo "Where <uid> is the numeric user id the tap devices will be owned by"
 	echo "Where <gid> is the numeric group id the tap devices will be owned by"
 	echo "<num> is the number of tap devices to create (0 to remove all)"
 	echo "<native-sysroot-basedir> is the path to the build system's native sysroot"
+	echo "e.g. $ bitbake qemu-helper-native"
+	echo "$ sudo $0 1000 1000 4 tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin"
 	exit 1
 }
 
@@ -44,9 +46,9 @@
 TUID=$1
 GID=$2
 COUNT=$3
-SYSROOT=$4
+STAGING_BINDIR_NATIVE=$4
 
-TUNCTL=$SYSROOT/usr/bin/tunctl
+TUNCTL=$STAGING_BINDIR_NATIVE/tunctl
 if [[ ! -x "$TUNCTL" || -d "$TUNCTL" ]]; then
 	echo "Error: $TUNCTL is not an executable"
 	usage
@@ -85,7 +87,7 @@
 	echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..."
 	for ((index=0; index < $COUNT; index++)); do
 		echo "Creating tap$index"
-		ifup=`$RUNQEMU_IFUP $TUID $GID $SYSROOT 2>&1`
+		ifup=`$RUNQEMU_IFUP $TUID $GID $STAGING_BINDIR_NATIVE 2>&1`
 		if [ $? -ne 0 ]; then
 			echo "Error running tunctl: $ifup"
 			exit 1
diff --git a/import-layers/yocto-poky/scripts/runqemu-ifdown b/import-layers/yocto-poky/scripts/runqemu-ifdown
index 8f66cfa..ffbc9de 100755
--- a/import-layers/yocto-poky/scripts/runqemu-ifdown
+++ b/import-layers/yocto-poky/scripts/runqemu-ifdown
@@ -41,11 +41,11 @@
 fi
 
 TAP=$1
-NATIVE_SYSROOT_DIR=$2
+STAGING_BINDIR_NATIVE=$2
 
-TUNCTL=$NATIVE_SYSROOT_DIR/usr/bin/tunctl
+TUNCTL=$STAGING_BINDIR_NATIVE/tunctl
 if [ ! -e "$TUNCTL" ]; then
-	echo "Error: Unable to find tunctl binary in '$NATIVE_SYSROOT_DIR/usr/bin', please bitbake qemu-helper-native"
+	echo "Error: Unable to find tunctl binary in '$STAGING_BINDIR_NATIVE', please bitbake qemu-helper-native"
 	exit 1
 fi
 
diff --git a/import-layers/yocto-poky/scripts/runqemu-ifup b/import-layers/yocto-poky/scripts/runqemu-ifup
index d9bd894..59a15ea 100755
--- a/import-layers/yocto-poky/scripts/runqemu-ifup
+++ b/import-layers/yocto-poky/scripts/runqemu-ifup
@@ -49,11 +49,11 @@
 
 USERID="-u $1"
 GROUP="-g $2"
-NATIVE_SYSROOT_DIR=$3
+STAGING_BINDIR_NATIVE=$3
 
-TUNCTL=$NATIVE_SYSROOT_DIR/usr/bin/tunctl
+TUNCTL=$STAGING_BINDIR_NATIVE/tunctl
 if [ ! -x "$TUNCTL" ]; then
-       echo "Error: Unable to find tunctl binary in '$NATIVE_SYSROOT_DIR/usr/bin', please bitbake qemu-helper-native"
+       echo "Error: Unable to find tunctl binary in '$STAGING_BINDIR_NATIVE', please bitbake qemu-helper-native"
 	exit 1
 fi
 
diff --git a/import-layers/yocto-poky/scripts/sysroot-relativelinks.py b/import-layers/yocto-poky/scripts/sysroot-relativelinks.py
index e44eba2..ffe2547 100755
--- a/import-layers/yocto-poky/scripts/sysroot-relativelinks.py
+++ b/import-layers/yocto-poky/scripts/sysroot-relativelinks.py
@@ -24,7 +24,7 @@
     os.symlink(os.path.relpath(topdir+link, subdir), filep)
 
 for subdir, dirs, files in os.walk(topdir):
-    for f in files:
+    for f in dirs + files:
         filep = os.path.join(subdir, f)
         if os.path.islink(filep):
             #print("Considering %s" % filep)
diff --git a/import-layers/yocto-poky/scripts/task-time b/import-layers/yocto-poky/scripts/task-time
new file mode 100755
index 0000000..e58040a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/task-time
@@ -0,0 +1,132 @@
+#!/usr/bin/env python3
+
+import argparse
+import os
+import re
+import sys
+
+arg_parser = argparse.ArgumentParser(
+    description="""
+Reports time consumed for one or more task in a format similar to the standard
+Bash 'time' builtin. Optionally sorts tasks by real (wall-clock), user (user
+space CPU), or sys (kernel CPU) time.
+""")
+
+arg_parser.add_argument(
+    "paths",
+    metavar="path",
+    nargs="+",
+    help="""
+A path containing task buildstats. If the path is a directory, e.g.
+build/tmp/buildstats, then all task found (recursively) in it will be
+processed. If the path is a single task buildstat, e.g.
+build/tmp/buildstats/20161018083535/foo-1.0-r0/do_compile, then just that
+buildstat will be processed. Multiple paths can be specified to process all of
+them. Files whose names do not start with "do_" are ignored.
+""")
+
+arg_parser.add_argument(
+    "--sort",
+    choices=("none", "real", "user", "sys"),
+    default="none",
+    help="""
+The measurement to sort the output by. Defaults to 'none', which means to sort
+by the order paths were given on the command line. For other options, tasks are
+sorted in descending order from the highest value.
+""")
+
+args = arg_parser.parse_args()
+
+# Field names and regexes for parsing out their values from buildstat files
+field_regexes = (("elapsed",    ".*Elapsed time: ([0-9.]+)"),
+                 ("user",       "rusage ru_utime: ([0-9.]+)"),
+                 ("sys",        "rusage ru_stime: ([0-9.]+)"),
+                 ("child user", "Child rusage ru_utime: ([0-9.]+)"),
+                 ("child sys",  "Child rusage ru_stime: ([0-9.]+)"))
+
+# A list of (<path>, <dict>) tuples, where <path> is the path of a do_* task
+# buildstat file and <dict> maps fields from the file to their values
+task_infos = []
+
+def save_times_for_task(path):
+    """Saves information for the buildstat file 'path' in 'task_infos'."""
+
+    if not os.path.basename(path).startswith("do_"):
+        return
+
+    with open(path) as f:
+        fields = {}
+
+        for line in f:
+            for name, regex in field_regexes:
+                match = re.match(regex, line)
+                if match:
+                    fields[name] = float(match.group(1))
+                    break
+
+        # Check that all expected fields were present
+        for name, regex in field_regexes:
+            if name not in fields:
+                print("Warning: Skipping '{}' because no field matching '{}' could be found"
+                      .format(path, regex),
+                      file=sys.stderr)
+                return
+
+        task_infos.append((path, fields))
+
+def save_times_for_dir(path):
+    """Runs save_times_for_task() for each file in path and its subdirs, recursively."""
+
+    # Raise an exception for os.walk() errors instead of ignoring them
+    def walk_onerror(e):
+        raise e
+
+    for root, _, files in os.walk(path, onerror=walk_onerror):
+        for fname in files:
+            save_times_for_task(os.path.join(root, fname))
+
+for path in args.paths:
+    if os.path.isfile(path):
+        save_times_for_task(path)
+    else:
+        save_times_for_dir(path)
+
+def elapsed_time(task_info):
+    return task_info[1]["elapsed"]
+
+def tot_user_time(task_info):
+    return task_info[1]["user"] + task_info[1]["child user"]
+
+def tot_sys_time(task_info):
+    return task_info[1]["sys"] + task_info[1]["child sys"]
+
+if args.sort != "none":
+    sort_fn = {"real": elapsed_time, "user": tot_user_time, "sys": tot_sys_time}
+    task_infos.sort(key=sort_fn[args.sort], reverse=True)
+
+first_entry = True
+
+# Catching BrokenPipeError avoids annoying errors when the output is piped into
+# e.g. 'less' or 'head' and not completely read
+try:
+    for task_info in task_infos:
+        real = elapsed_time(task_info)
+        user = tot_user_time(task_info)
+        sys = tot_sys_time(task_info)
+
+        if not first_entry:
+            print()
+        first_entry = False
+
+        # Mimic Bash's 'time' builtin
+        print("{}:\n"
+              "real\t{}m{:.3f}s\n"
+              "user\t{}m{:.3f}s\n"
+              "sys\t{}m{:.3f}s"
+              .format(task_info[0],
+                      int(real//60), real%60,
+                      int(user//60), user%60,
+                      int(sys//60), sys%60))
+
+except BrokenPipeError:
+    pass
diff --git a/import-layers/yocto-poky/scripts/tiny/ksize.py b/import-layers/yocto-poky/scripts/tiny/ksize.py
index b9d2b19..ea1ca7f 100755
--- a/import-layers/yocto-poky/scripts/tiny/ksize.py
+++ b/import-layers/yocto-poky/scripts/tiny/ksize.py
@@ -41,7 +41,7 @@
 class Sizes:
     def __init__(self, glob):
         self.title = glob
-        p = Popen("size -t " + glob, shell=True, stdout=PIPE, stderr=PIPE)
+        p = Popen("size -t " + str(glob), shell=True, stdout=PIPE, stderr=PIPE)
         output = p.communicate()[0].splitlines()
         if len(output) > 2:
             sizes = output[-1].split()[0:4]
@@ -62,18 +62,18 @@
         r = Report(filename, title)
         path = os.path.dirname(filename)
 
-        p = Popen("ls " + path + "/*.o | grep -v built-in.o",
+        p = Popen("ls " + str(path) + "/*.o | grep -v built-in.o",
                   shell=True, stdout=PIPE, stderr=PIPE)
         glob = ' '.join(p.communicate()[0].splitlines())
-        oreport = Report(glob, path + "/*.o")
-        oreport.sizes.title = path + "/*.o"
+        oreport = Report(glob, str(path) + "/*.o")
+        oreport.sizes.title = str(path) + "/*.o"
         r.parts.append(oreport)
 
         if subglob:
             p = Popen("ls " + subglob, shell=True, stdout=PIPE, stderr=PIPE)
             for f in p.communicate()[0].splitlines():
                 path = os.path.dirname(f)
-                r.parts.append(Report.create(f, path, path + "/*/built-in.o"))
+                r.parts.append(Report.create(f, path, str(path) + "/*/built-in.o"))
             r.parts.sort(reverse=True)
 
         for b in r.parts:
@@ -116,6 +116,13 @@
                self.deltas["data"], self.deltas["bss"]))
         print("\n")
 
+    def __lt__(this, that):
+        if that is None:
+            return 1
+        if not isinstance(that, Report):
+            raise TypeError
+        return this.sizes.total < that.sizes.total
+
     def __cmp__(this, that):
         if that is None:
             return 1
diff --git a/import-layers/yocto-poky/scripts/tiny/ksum.py b/import-layers/yocto-poky/scripts/tiny/ksum.py
new file mode 100755
index 0000000..d4f3892
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/tiny/ksum.py
@@ -0,0 +1,168 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2016, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION 'ksum.py' generates a combined summary of vmlinux and
+# module sizes for a built kernel, as a quick tool for comparing the
+# overall effects of systemic tinification changes.  Execute from the
+# base directory of the kernel build you want to summarize.  Setting
+# the 'verbose' flag will display the sizes for each file included in
+# the summary.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+
+__version__ = "0.1.0"
+
+# Python Standard Library modules
+import os
+import sys
+import getopt
+from subprocess import *
+
+def usage():
+    prog = os.path.basename(sys.argv[0])
+    print('Usage: %s [OPTION]...' % prog)
+    print('  -v,                 display sizes for each file')
+    print('  -h, --help          display this help and exit')
+    print('')
+    print('Run %s from the top-level Linux kernel build directory.' % prog)
+
+verbose = False
+
+n_ko_files = 0
+ko_file_list = []
+
+ko_text = 0
+ko_data = 0
+ko_bss = 0
+ko_total = 0
+
+vmlinux_file = ""
+vmlinux_level = 0
+
+vmlinux_text = 0
+vmlinux_data = 0
+vmlinux_bss = 0
+vmlinux_total = 0
+
+def is_vmlinux_file(filename):
+    global vmlinux_level
+    if filename == ("vmlinux") and vmlinux_level == 0:
+        vmlinux_level += 1
+        return True
+    return False
+
+def is_ko_file(filename):
+    if filename.endswith(".ko"):
+        return True
+    return False
+
+def collect_object_files():
+    print "Collecting object files recursively from %s..." % os.getcwd()
+    for dirpath, dirs, files in os.walk(os.getcwd()):
+        for filename in files:
+            if is_ko_file(filename):
+                ko_file_list.append(os.path.join(dirpath, filename))
+            elif is_vmlinux_file(filename):
+                global vmlinux_file
+                vmlinux_file = os.path.join(dirpath, filename)
+    print "Collecting object files [DONE]"
+
+def add_ko_file(filename):
+        p = Popen("size -t " + filename, shell=True, stdout=PIPE, stderr=PIPE)
+        output = p.communicate()[0].splitlines()
+        if len(output) > 2:
+            sizes = output[-1].split()[0:4]
+            if verbose:
+                print "     %10d %10d %10d %10d\t" % \
+                    (int(sizes[0]), int(sizes[1]), int(sizes[2]), int(sizes[3])),
+                print "%s" % filename[len(os.getcwd()) + 1:]
+            global n_ko_files, ko_text, ko_data, ko_bss, ko_total
+            ko_text += int(sizes[0])
+            ko_data += int(sizes[1])
+            ko_bss += int(sizes[2])
+            ko_total += int(sizes[3])
+            n_ko_files += 1
+
+def get_vmlinux_totals():
+        p = Popen("size -t " + vmlinux_file, shell=True, stdout=PIPE, stderr=PIPE)
+        output = p.communicate()[0].splitlines()
+        if len(output) > 2:
+            sizes = output[-1].split()[0:4]
+            if verbose:
+                print "     %10d %10d %10d %10d\t" % \
+                    (int(sizes[0]), int(sizes[1]), int(sizes[2]), int(sizes[3])),
+                print "%s" % vmlinux_file[len(os.getcwd()) + 1:]
+            global vmlinux_text, vmlinux_data, vmlinux_bss, vmlinux_total
+            vmlinux_text += int(sizes[0])
+            vmlinux_data += int(sizes[1])
+            vmlinux_bss += int(sizes[2])
+            vmlinux_total += int(sizes[3])
+
+def sum_ko_files():
+    for ko_file in ko_file_list:
+        add_ko_file(ko_file)
+
+def main():
+    try:
+        opts, args = getopt.getopt(sys.argv[1:], "vh", ["help"])
+    except getopt.GetoptError as err:
+        print('%s' % str(err))
+        usage()
+        sys.exit(2)
+
+    for o, a in opts:
+        if o == '-v':
+            global verbose
+            verbose = True
+        elif o in ('-h', '--help'):
+            usage()
+            sys.exit(0)
+        else:
+            assert False, "unhandled option"
+
+    collect_object_files()
+    sum_ko_files()
+    get_vmlinux_totals()
+
+    print "\nTotals:"
+    print "\nvmlinux:"
+    print "    text\tdata\t\tbss\t\ttotal"
+    print "    %-10d\t%-10d\t%-10d\t%-10d" % \
+        (vmlinux_text, vmlinux_data, vmlinux_bss, vmlinux_total)
+    print "\nmodules (%d):" % n_ko_files
+    print "    text\tdata\t\tbss\t\ttotal"
+    print "    %-10d\t%-10d\t%-10d\t%-10d" % \
+        (ko_text, ko_data, ko_bss, ko_total)
+    print "\nvmlinux + modules:"
+    print "    text\tdata\t\tbss\t\ttotal"
+    print "    %-10d\t%-10d\t%-10d\t%-10d" % \
+        (vmlinux_text + ko_text, vmlinux_data + ko_data, \
+         vmlinux_bss + ko_bss, vmlinux_total + ko_total)
+
+if __name__ == "__main__":
+    try:
+        ret = main()
+    except Exception:
+        ret = 1
+        import traceback
+        traceback.print_exc(5)
+    sys.exit(ret)
diff --git a/import-layers/yocto-poky/scripts/verify-bashisms b/import-layers/yocto-poky/scripts/verify-bashisms
index 0741e18..dab64ef 100755
--- a/import-layers/yocto-poky/scripts/verify-bashisms
+++ b/import-layers/yocto-poky/scripts/verify-bashisms
@@ -6,7 +6,7 @@
     # type is supported by dash
     'if type systemctl >/dev/null 2>/dev/null; then',
     'if type systemd-tmpfiles >/dev/null 2>/dev/null; then',
-    'if type update-rc.d >/dev/null 2>/dev/null; then',
+    'type update-rc.d >/dev/null 2>/dev/null; then',
     'command -v',
     # HOSTNAME is set locally
     'buildhistory_single_commit "$CMDLINE" "$HOSTNAME"',
@@ -22,7 +22,10 @@
             return True
     return False
 
-def process(recipe, function, script):
+SCRIPT_LINENO_RE = re.compile(r' line (\d+) ')
+BASHISM_WARNING = re.compile(r'^(possible bashism in.*)$', re.MULTILINE)
+
+def process(filename, function, lineno, script):
     import tempfile
 
     if not script.startswith("#!"):
@@ -40,18 +43,38 @@
         # TODO check exit code is 1
 
         # Replace the temporary filename with the function and split it
-        output = e.output.replace(fn.name, function).splitlines()
-        if len(results) % 2 != 0:
-            print("Unexpected output from checkbashism: %s" % str(output))
-            return
+        output = e.output.replace(fn.name, function)
+        if not output or not output.startswith('possible bashism'):
+            # Probably starts with or contains only warnings. Dump verbatim
+            # with one space indention. Can't do the splitting and whitelist
+            # checking below.
+            return '\n'.join([filename,
+                              ' Unexpected output from checkbashisms.pl'] +
+                             [' ' + x for x in output.splitlines()])
 
-        # Turn the output into a list of (message, source) values
+        # We know that the first line matches and that therefore the first
+        # list entry will be empty - skip it.
+        output = BASHISM_WARNING.split(output)[1:]
+        # Turn the output into a single string like this:
+        # /.../foobar.bb
+        #  possible bashism in updatercd_postrm line 2 (type):
+        #   if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
+        #  ...
+        #   ...
         result = []
         # Check the results against the whitelist
         for message, source in zip(output[0::2], output[1::2]):
             if not is_whitelisted(source):
-                result.append((message, source))
-        return result
+                if lineno is not None:
+                    message = SCRIPT_LINENO_RE.sub(lambda m: ' line %d ' % (int(m.group(1)) + int(lineno) - 1),
+                                                   message)
+                result.append(' ' + message.strip())
+                result.extend(['  %s' % x for x in source.splitlines()])
+        if result:
+            result.insert(0, filename)
+            return '\n'.join(result)
+        else:
+            return None
 
 def get_tinfoil():
     scripts_path = os.path.dirname(os.path.realpath(__file__))
@@ -68,9 +91,19 @@
 if __name__=='__main__':
     import shutil
     if shutil.which("checkbashisms.pl") is None:
-        print("Cannot find checkbashisms.pl on $PATH")
+        print("Cannot find checkbashisms.pl on $PATH, get it from https://anonscm.debian.org/cgit/collab-maint/devscripts.git/plain/scripts/checkbashisms.pl")
         sys.exit(1)
 
+    # The order of defining the worker function,
+    # initializing the pool and connecting to the
+    # bitbake server is crucial, don't change it.
+    def func(item):
+        (filename, key, lineno), script = item
+        return process(filename, key, lineno, script)
+
+    import multiprocessing
+    pool = multiprocessing.Pool()
+
     tinfoil = get_tinfoil()
 
     # This is only the default configuration and should iterate over
@@ -83,34 +116,33 @@
     else:
         initial_pns = sorted(pkg_pn)
 
-    pns = []
-    print("Generating file list...")
+    pns = set()
+    scripts = {}
+    print("Generating scripts...")
     for pn in initial_pns:
         for fn in pkg_pn[pn]:
             # There's no point checking multiple BBCLASSEXTENDed variants of the same recipe
+            # (at least in general - there is some risk that the variants contain different scripts)
             realfn, _, _ = bb.cache.virtualfn2realfn(fn)
             if realfn not in pns:
-                pns.append(realfn)
+                pns.add(realfn)
+                data = tinfoil.parse_recipe_file(realfn)
+                for key in data.keys():
+                    if data.getVarFlag(key, "func") and not data.getVarFlag(key, "python"):
+                        script = data.getVar(key, False)
+                        if script:
+                            filename = data.getVarFlag(key, "filename")
+                            lineno = data.getVarFlag(key, "lineno")
+                            # There's no point in checking a function multiple
+                            # times just because different recipes include it.
+                            # We identify unique scripts by file, name, and (just in case)
+                            # line number.
+                            attributes = (filename or realfn, key, lineno)
+                            scripts.setdefault(attributes, script)
 
 
-    def func(fn):
-        result = []
-        data = tinfoil.parse_recipe_file(fn)
-        for key in data.keys():
-            if data.getVarFlag(key, "func", True) and not data.getVarFlag(key, "python", True):
-                script = data.getVar(key, False)
-                if not script: continue
-                #print ("%s:%s" % (fn, key))
-                r = process(fn, key, script)
-                if r: result.extend(r)
-        return fn, result
-
     print("Scanning scripts...\n")
-    import multiprocessing
-    pool = multiprocessing.Pool()
-    for pn,results in pool.imap(func, pns):
-        if results:
-            print(pn)
-            for message,source in results:
-                print(" %s\n  %s" % (message, source))
-            print()
+    for result in pool.imap(func, scripts.items()):
+        if result:
+            print(result)
+    tinfoil.shutdown()
diff --git a/import-layers/yocto-poky/scripts/wic b/import-layers/yocto-poky/scripts/wic
index fe2c33f..a5f2dbf 100755
--- a/import-layers/yocto-poky/scripts/wic
+++ b/import-layers/yocto-poky/scripts/wic
@@ -41,6 +41,8 @@
 scripts_path = os.path.abspath(os.path.dirname(__file__))
 lib_path = scripts_path + '/lib'
 sys.path.insert(0, lib_path)
+oe_lib_path = os.path.join(os.path.dirname(scripts_path), 'meta', 'lib')
+sys.path.insert(0, oe_lib_path)
 
 bitbake_exe = spawn.find_executable('bitbake')
 if bitbake_exe:
@@ -51,11 +53,28 @@
 else:
     bitbake_main = None
 
-from wic.utils.oe.misc import get_bitbake_var, BB_VARS
-from wic.utils.errors import WicError
+from wic import WicError
+from wic.utils.misc import get_bitbake_var, BB_VARS
 from wic import engine
 from wic import help as hlp
 
+
+def wic_logger():
+    """Create and convfigure wic logger."""
+    logger = logging.getLogger('wic')
+    logger.setLevel(logging.INFO)
+
+    handler = logging.StreamHandler()
+
+    formatter = logging.Formatter('%(levelname)s: %(message)s')
+    handler.setFormatter(formatter)
+
+    logger.addHandler(handler)
+
+    return logger
+
+logger = wic_logger()
+
 def rootfs_dir_to_args(krootfs_dir):
     """
     Get a rootfs_dir dict and serialize to string
@@ -88,7 +107,7 @@
     """
     parser = optparse.OptionParser(usage=usage_str)
 
-    parser.add_option("-o", "--outdir", dest="outdir",
+    parser.add_option("-o", "--outdir", dest="outdir", default='.',
                       help="name of directory to create image in")
     parser.add_option("-e", "--image-name", dest="image_name",
                       help="name of the image to use the artifacts from "
@@ -107,7 +126,7 @@
     parser.add_option("-n", "--native-sysroot", dest="native_sysroot",
                       help="path to the native sysroot containing the tools "
                            "to use to build the image")
-    parser.add_option("-p", "--skip-build-check", dest="build_check",
+    parser.add_option("-s", "--skip-build-check", dest="build_check",
                       action="store_false", default=True, help="skip the build check")
     parser.add_option("-f", "--build-rootfs", action="store_true", help="build rootfs")
     parser.add_option("-c", "--compress-with", choices=("gzip", "bzip2", "xz"),
@@ -123,13 +142,11 @@
     (options, args) = parser.parse_args(args)
 
     if len(args) != 1:
-        logging.error("Wrong number of arguments, exiting\n")
         parser.print_help()
-        sys.exit(1)
+        raise WicError("Wrong number of arguments, exiting")
 
     if options.build_rootfs and not bitbake_main:
-        logging.error("Can't build roofs as bitbake is not in the $PATH")
-        sys.exit(1)
+        raise WicError("Can't build rootfs as bitbake is not in the $PATH")
 
     if not options.image_name:
         missed = []
@@ -140,9 +157,8 @@
             if not val:
                 missed.append(opt)
         if missed:
-            print("The following build artifacts are not specified:")
-            print("  " + ", ".join(missed))
-            sys.exit(1)
+            raise WicError("The following build artifacts are not specified: %s" %
+                           ", ".join(missed))
 
     if options.image_name:
         BB_VARS.default_image = options.image_name
@@ -152,15 +168,11 @@
     if options.vars_dir:
         BB_VARS.vars_dir = options.vars_dir
 
-    if options.build_check:
-        print("Checking basic build environment...")
-        if not engine.verify_build_env():
-            print("Couldn't verify build environment, exiting\n")
-            sys.exit(1)
-        else:
-            print("Done.\n")
+    if options.build_check and not engine.verify_build_env():
+        raise WicError("Couldn't verify build environment, exiting")
 
-    bootimg_dir = ""
+    if options.debug:
+        logger.setLevel(logging.DEBUG)
 
     if options.image_name:
         if options.build_rootfs:
@@ -168,33 +180,40 @@
             if options.debug:
                 argv.append("--debug")
 
-            print("Building rootfs...\n")
+            logger.info("Building rootfs...\n")
             if bitbake_main(BitBakeConfigParameters(argv),
                             cookerdata.CookerConfiguration()):
-                sys.exit(1)
+                raise WicError("bitbake exited with error")
 
         rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", options.image_name)
         kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE", options.image_name)
-        native_sysroot = get_bitbake_var("STAGING_DIR_NATIVE",
-                                         options.image_name)
+        bootimg_dir = get_bitbake_var("STAGING_DATADIR", options.image_name)
+        native_sysroot = get_bitbake_var("RECIPE_SYSROOT_NATIVE",
+                                         options.image_name) #, cache=False)
     else:
         if options.build_rootfs:
-            print("Image name is not specified, exiting. (Use -e/--image-name to specify it)\n")
-            sys.exit(1)
+            raise WicError("Image name is not specified, exiting. "
+                           "(Use -e/--image-name to specify it)")
+        native_sysroot = options.native_sysroot
+
+    if not native_sysroot or not os.path.isdir(native_sysroot):
+        logger.info("Building wic-tools...\n")
+        if bitbake_main(BitBakeConfigParameters("bitbake wic-tools".split()),
+                        cookerdata.CookerConfiguration()):
+            raise WicError("bitbake wic-tools failed")
+        native_sysroot = get_bitbake_var("RECIPE_SYSROOT_NATIVE", "wic-tools")
+        if not native_sysroot:
+            raise WicError("Unable to find the location of the native "
+                           "tools sysroot to use")
 
     wks_file = args[0]
 
     if not wks_file.endswith(".wks"):
         wks_file = engine.find_canned_image(scripts_path, wks_file)
         if not wks_file:
-            print("No image named %s found, exiting.  (Use 'wic list images' "\
-                  "to list available images, or specify a fully-qualified OE "\
-                  "kickstart (.wks) filename)\n" % args[0])
-            sys.exit(1)
-
-    image_output_dir = ""
-    if options.outdir:
-        image_output_dir = options.outdir
+            raise WicError("No image named %s found, exiting.  (Use 'wic list images' "
+                           "to list available images, or specify a fully-qualified OE "
+                           "kickstart (.wks) filename)" % args[0])
 
     if not options.image_name:
         rootfs_dir = ''
@@ -204,17 +223,13 @@
         kernel_dir = options.kernel_dir
         native_sysroot = options.native_sysroot
         if rootfs_dir and not os.path.isdir(rootfs_dir):
-            print("--roofs-dir (-r) not found, exiting\n")
-            sys.exit(1)
+            raise WicError("--rootfs-dir (-r) not found, exiting")
         if not os.path.isdir(bootimg_dir):
-            print("--bootimg-dir (-b) not found, exiting\n")
-            sys.exit(1)
+            raise WicError("--bootimg-dir (-b) not found, exiting")
         if not os.path.isdir(kernel_dir):
-            print("--kernel-dir (-k) not found, exiting\n")
-            sys.exit(1)
+            raise WicError("--kernel-dir (-k) not found, exiting")
         if not os.path.isdir(native_sysroot):
-            print("--native-sysroot (-n) not found, exiting\n")
-            sys.exit(1)
+            raise WicError("--native-sysroot (-n) not found, exiting")
     else:
         not_found = not_found_dir = ""
         if not os.path.isdir(rootfs_dir):
@@ -226,13 +241,11 @@
         if not_found:
             if not not_found_dir:
                 not_found_dir = "Completely missing artifact - wrong image (.wks) used?"
-            print("Build artifacts not found, exiting.")
-            print("  (Please check that the build artifacts for the machine")
-            print("   selected in local.conf actually exist and that they")
-            print("   are the correct artifacts for the image (.wks file)).\n")
-            print("The artifact that couldn't be found was %s:\n  %s" % \
-                (not_found, not_found_dir))
-            sys.exit(1)
+            logger.info("Build artifacts not found, exiting.")
+            logger.info("  (Please check that the build artifacts for the machine")
+            logger.info("   selected in local.conf actually exist and that they")
+            logger.info("   are the correct artifacts for the image (.wks file)).\n")
+            raise WicError("The artifact that couldn't be found was %s:\n  %s", not_found, not_found_dir)
 
     krootfs_dir = options.rootfs_dir
     if krootfs_dir is None:
@@ -241,10 +254,9 @@
 
     rootfs_dir = rootfs_dir_to_args(krootfs_dir)
 
-    print("Creating image(s)...\n")
+    logger.info("Creating image(s)...\n")
     engine.wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
-                      native_sysroot, scripts_path, image_output_dir,
-                      options.compressor, options.bmap, options.debug)
+                      native_sysroot, options)
 
 
 def wic_list_subcommand(args, usage_str):
@@ -256,9 +268,8 @@
     args = parser.parse_args(args)[1]
 
     if not engine.wic_list(args, scripts_path):
-        logging.error("Bad list arguments, exiting\n")
         parser.print_help()
-        sys.exit(1)
+        raise WicError("Bad list arguments, exiting")
 
 
 def wic_help_topic_subcommand(args, usage_str):
@@ -293,10 +304,6 @@
 }
 
 
-def start_logging(loglevel):
-    logging.basicConfig(filename='wic.log', filemode='w', level=loglevel)
-
-
 def main(argv):
     parser = optparse.OptionParser(version="wic version %s" % __version__,
                                    usage=hlp.wic_usage)
@@ -309,7 +316,7 @@
         if args[0] == "help":
             if len(args) == 1:
                 parser.print_help()
-                sys.exit(1)
+                raise WicError("help command requires parameter")
 
     return hlp.invoke_subcommand(args, parser, hlp.wic_help_usage, subcommands)
 
@@ -318,6 +325,6 @@
     try:
         sys.exit(main(sys.argv[1:]))
     except WicError as err:
-        print("ERROR:", err, file=sys.stderr)
+        print()
+        logger.error(err)
         sys.exit(1)
-
diff --git a/import-layers/yocto-poky/scripts/wipe-sysroot b/import-layers/yocto-poky/scripts/wipe-sysroot
deleted file mode 100755
index 5e6b1a4..0000000
--- a/import-layers/yocto-poky/scripts/wipe-sysroot
+++ /dev/null
@@ -1,54 +0,0 @@
-#! /bin/sh
-
-# Wipe out all of the sysroots and all of the stamps that populated it.
-# Author: Ross Burton <ross.burton@intel.com>
-#
-# Copyright (c) 2012 Intel Corporation
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-set -e
-
-if [ $# -gt 0 ]; then
-    echo "Wipe all sysroots and sysroot-related stamps for the current build directory." >&2
-    echo "Usage: $0" >&2
-    exit 1
-fi
-
-ENVS=`mktemp --suffix -wipe-sysroot-envs`
-bitbake -p -e > $ENVS
-
-eval `grep -F SSTATE_MANIFESTS= $ENVS`
-eval `grep -F STAGING_DIR= $ENVS`
-eval `grep -F STAMPS_DIR= $ENVS`
-rm -f $ENVS
-
-if [ -z "$SSTATE_MANIFESTS" -o -z "$STAGING_DIR" -o -z "$STAMPS_DIR" ]; then
-    echo "Could not determine SSTATE_MANIFESTS/STAGING_DIR/STAMPS_DIR from bitbake, check above for errors"
-    exit 1
-fi
-
-echo "Deleting the sysroots in $STAGING_DIR, and selected stamps in $SSTATE_MANIFESTS and $STAMPS_DIR."
-
-# The sysroots themselves
-rm -rf $STAGING_DIR ${STAGING_DIR}-uninative
-
-# The stamps that said the sysroot was populated
-rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot.*
-rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot_setscene.*
-rm -rf $STAMPS_DIR/*/*/*.do_packagedata.*
-rm -rf $STAMPS_DIR/*/*/*.do_packagedata_setscene.*
-
-# The sstate manifests
-rm -rf $SSTATE_MANIFESTS/manifest-*.populate_sysroot
diff --git a/import-layers/yocto-poky/scripts/yocto-compat-layer-wrapper b/import-layers/yocto-poky/scripts/yocto-compat-layer-wrapper
new file mode 100755
index 0000000..db4b687
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/yocto-compat-layer-wrapper
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# Yocto Project compatibility layer tool wrapper
+#
+# Creates a temprary build directory to run Yocto Project Compatible
+# script to avoid a contaminated environment.
+#
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+if [ -z "$BUILDDIR" ]; then
+	echo "Please source oe-init-build-env before run this script."
+	exit 2
+fi
+
+base_dir=$(realpath $BUILDDIR/../)
+cd $base_dir
+
+build_dir=$(mktemp -p $base_dir -d -t build-XXXX)
+
+source oe-init-build-env $build_dir
+yocto-compat-layer.py "$@"
+retcode=$?
+
+rm -rf $build_dir
+
+exit $retcode
diff --git a/import-layers/yocto-poky/scripts/yocto-compat-layer.py b/import-layers/yocto-poky/scripts/yocto-compat-layer.py
new file mode 100755
index 0000000..ba64b4d
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/yocto-compat-layer.py
@@ -0,0 +1,205 @@
+#!/usr/bin/env python3
+
+# Yocto Project compatibility layer tool
+#
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import argparse
+import logging
+import time
+import signal
+import shutil
+import collections
+
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+import scriptutils
+import scriptpath
+scriptpath.add_oe_lib_path()
+scriptpath.add_bitbake_lib_path()
+
+from compatlayer import LayerType, detect_layers, add_layer, add_layer_dependencies, get_signatures
+from oeqa.utils.commands import get_bb_vars
+
+PROGNAME = 'yocto-compat-layer'
+CASES_PATHS = [os.path.join(os.path.abspath(os.path.dirname(__file__)),
+                'lib', 'compatlayer', 'cases')]
+logger = scriptutils.logger_create(PROGNAME, stream=sys.stdout)
+
+def test_layer_compatibility(td, layer, test_software_layer_signatures):
+    from compatlayer.context import CompatLayerTestContext
+    logger.info("Starting to analyze: %s" % layer['name'])
+    logger.info("----------------------------------------------------------------------")
+
+    tc = CompatLayerTestContext(td=td, logger=logger, layer=layer, test_software_layer_signatures=test_software_layer_signatures)
+    tc.loadTests(CASES_PATHS)
+    return tc.runTests()
+
+def main():
+    parser = argparse.ArgumentParser(
+            description="Yocto Project compatibility layer tool",
+            add_help=False)
+    parser.add_argument('layers', metavar='LAYER_DIR', nargs='+',
+            help='Layer to test compatibility with Yocto Project')
+    parser.add_argument('-o', '--output-log',
+            help='File to output log (optional)', action='store')
+    parser.add_argument('--dependency', nargs="+",
+            help='Layers to process for dependencies', action='store')
+    parser.add_argument('--machines', nargs="+",
+            help='List of MACHINEs to be used during testing', action='store')
+    parser.add_argument('--additional-layers', nargs="+",
+            help='List of additional layers to add during testing', action='store')
+    group = parser.add_mutually_exclusive_group()
+    group.add_argument('--with-software-layer-signature-check', action='store_true', dest='test_software_layer_signatures',
+                       default=True,
+                       help='check that software layers do not change signatures (on by default)')
+    group.add_argument('--without-software-layer-signature-check', action='store_false', dest='test_software_layer_signatures',
+                       help='disable signature checking for software layers')
+    parser.add_argument('-n', '--no-auto', help='Disable auto layer discovery',
+            action='store_true')
+    parser.add_argument('-d', '--debug', help='Enable debug output',
+            action='store_true')
+    parser.add_argument('-q', '--quiet', help='Print only errors',
+            action='store_true')
+
+    parser.add_argument('-h', '--help', action='help',
+            default=argparse.SUPPRESS,
+            help='show this help message and exit')
+
+    args = parser.parse_args()
+
+    if args.output_log:
+        fh = logging.FileHandler(args.output_log)
+        fh.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+        logger.addHandler(fh)
+    if args.debug:
+        logger.setLevel(logging.DEBUG)
+    elif args.quiet:
+        logger.setLevel(logging.ERROR)
+
+    if not 'BUILDDIR' in os.environ:
+        logger.error("You must source the environment before run this script.")
+        logger.error("$ source oe-init-build-env")
+        return 1
+    builddir = os.environ['BUILDDIR']
+    bblayersconf = os.path.join(builddir, 'conf', 'bblayers.conf')
+
+    layers = detect_layers(args.layers, args.no_auto)
+    if not layers:
+        logger.error("Fail to detect layers")
+        return 1
+    if args.additional_layers:
+        additional_layers = detect_layers(args.additional_layers, args.no_auto)
+    else:
+        additional_layers = []
+    if args.dependency:
+        dep_layers = detect_layers(args.dependency, args.no_auto)
+        dep_layers = dep_layers + layers
+    else:
+        dep_layers = layers
+
+    logger.info("Detected layers:")
+    for layer in layers:
+        if layer['type'] == LayerType.ERROR_BSP_DISTRO:
+            logger.error("%s: Can't be DISTRO and BSP type at the same time."\
+                     " The conf/distro and conf/machine folders was found."\
+                     % layer['name'])
+            layers.remove(layer)
+        elif layer['type'] == LayerType.ERROR_NO_LAYER_CONF:
+            logger.error("%s: Don't have conf/layer.conf file."\
+                     % layer['name'])
+            layers.remove(layer)
+        else:
+            logger.info("%s: %s, %s" % (layer['name'], layer['type'],
+                layer['path']))
+    if not layers:
+        return 1
+
+    shutil.copyfile(bblayersconf, bblayersconf + '.backup')
+    def cleanup_bblayers(signum, frame):
+        shutil.copyfile(bblayersconf + '.backup', bblayersconf)
+        os.unlink(bblayersconf + '.backup')
+    signal.signal(signal.SIGTERM, cleanup_bblayers)
+    signal.signal(signal.SIGINT, cleanup_bblayers)
+
+    td = {}
+    results = collections.OrderedDict()
+    results_status = collections.OrderedDict()
+
+    layers_tested = 0
+    for layer in layers:
+        if layer['type'] == LayerType.ERROR_NO_LAYER_CONF or \
+                layer['type'] == LayerType.ERROR_BSP_DISTRO:
+            continue
+
+        logger.info('')
+        logger.info("Setting up for %s(%s), %s" % (layer['name'], layer['type'],
+            layer['path']))
+
+        shutil.copyfile(bblayersconf + '.backup', bblayersconf)
+
+        missing_dependencies = not add_layer_dependencies(bblayersconf, layer, dep_layers, logger)
+        if not missing_dependencies:
+            for additional_layer in additional_layers:
+                if not add_layer_dependencies(bblayersconf, additional_layer, dep_layers, logger):
+                    missing_dependencies = True
+                    break
+        if not add_layer_dependencies(bblayersconf, layer, dep_layers, logger) or \
+           any(map(lambda additional_layer: not add_layer_dependencies(bblayersconf, additional_layer, dep_layers, logger),
+                   additional_layers)):
+            logger.info('Skipping %s due to missing dependencies.' % layer['name'])
+            results[layer['name']] = None
+            results_status[layer['name']] = 'SKIPPED (Missing dependencies)'
+            layers_tested = layers_tested + 1
+            continue
+
+        if any(map(lambda additional_layer: not add_layer(bblayersconf, additional_layer, dep_layers, logger),
+                   additional_layers)):
+            logger.info('Skipping %s due to missing additional layers.' % layer['name'])
+            results[layer['name']] = None
+            results_status[layer['name']] = 'SKIPPED (Missing additional layers)'
+            layers_tested = layers_tested + 1
+            continue
+
+        logger.info('Getting initial bitbake variables ...')
+        td['bbvars'] = get_bb_vars()
+        logger.info('Getting initial signatures ...')
+        td['builddir'] = builddir
+        td['sigs'], td['tunetasks'] = get_signatures(td['builddir'])
+        td['machines'] = args.machines
+
+        if not add_layer(bblayersconf, layer, dep_layers, logger):
+            logger.info('Skipping %s ???.' % layer['name'])
+            results[layer['name']] = None
+            results_status[layer['name']] = 'SKIPPED (Unknown)'
+            layers_tested = layers_tested + 1
+            continue
+
+        result = test_layer_compatibility(td, layer, args.test_software_layer_signatures)
+        results[layer['name']] = result
+        results_status[layer['name']] = 'PASS' if results[layer['name']].wasSuccessful() else 'FAIL'
+        layers_tested = layers_tested + 1
+
+    if layers_tested:
+        logger.info('')
+        logger.info('Summary of results:')
+        logger.info('')
+        for layer_name in results_status:
+            logger.info('%s ... %s' % (layer_name, results_status[layer_name]))
+
+    cleanup_bblayers(None, None)
+
+    return 0
+
+if __name__ == '__main__':
+    try:
+        ret =  main()
+    except Exception:
+        ret = 1
+        import traceback
+        traceback.print_exc()
+    sys.exit(ret)
diff --git a/meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/files/default-gcc.patch b/meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/files/default-gcc.patch
new file mode 100644
index 0000000..04184df
--- /dev/null
+++ b/meta-openbmc-bsp/meta-aspeed/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/meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/u-boot-common.inc b/meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/u-boot-common_2016.07.inc
similarity index 100%
rename from meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/u-boot-common.inc
rename to meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/u-boot-common_2016.07.inc
diff --git a/meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/u-boot-fw-utils_2016.07.bb b/meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/u-boot-fw-utils_2016.07.bb
index e5a9036..2631499 100644
--- a/meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/u-boot-fw-utils_2016.07.bb
+++ b/meta-openbmc-bsp/meta-aspeed/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/meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/u-boot_2016.07.bb b/meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/u-boot_2016.07.bb
index 0df7f2b..05b1c89 100644
--- a/meta-openbmc-bsp/meta-aspeed/common/recipes-bsp/u-boot/u-boot_2016.07.bb
+++ b/meta-openbmc-bsp/meta-aspeed/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"
diff --git a/meta-phosphor/classes/image_types_phosphor.bbclass b/meta-phosphor/classes/image_types_phosphor.bbclass
index 78ff846..87381fa 100644
--- a/meta-phosphor/classes/image_types_phosphor.bbclass
+++ b/meta-phosphor/classes/image_types_phosphor.bbclass
@@ -1,15 +1,5 @@
 # Base image class extension, inlined into every image.
 
-def build_uboot(d):
-    fstypes = d.getVar('IMAGE_FSTYPES', True).split()
-    if any([x.endswith('u-boot') for x in fstypes]):
-        return 'image_types_uboot'
-    return ''
-
-
-# Inherit u-boot classes if legacy uboot images are in use.
-IMAGE_TYPE_uboot = '${@build_uboot(d)}'
-inherit ${IMAGE_TYPE_uboot}
 inherit image_version
 
 # Phosphor image types
diff --git a/meta-phosphor/common/recipes-core/dropbear/dropbear_%.bbappend b/meta-phosphor/common/recipes-core/dropbear/dropbear_%.bbappend
index 165a19e..8071497 100644
--- a/meta-phosphor/common/recipes-core/dropbear/dropbear_%.bbappend
+++ b/meta-phosphor/common/recipes-core/dropbear/dropbear_%.bbappend
@@ -1,5 +1,3 @@
-inherit obmc-phosphor-discovery-service
-
 # 0001-Only-load-dropbear-default-host-keys-if-a-key-is-not.patch
 # has been upstreamed.  This patch can be removed once we upgrade
 # to yocto 2.5 or later which will pull in the latest dropbear code.
@@ -7,5 +5,3 @@
 SRC_URI += "file://dropbearkey.service \
 	    file://0001-dropbear-Add-c-command-option-to-force-a-specific-co.patch \
 	    file://0001-Only-load-dropbear-default-host-keys-if-a-key-is-not.patch"
-
-REGISTERED_SERVICES_${PN} += "ssh:tcp:22 sftp:tcp:22"
diff --git a/meta-phosphor/common/recipes-devtools/gcc/gcc-source_6.2.bbappend b/meta-phosphor/common/recipes-devtools/gcc/gcc-source_6.2.bbappend
deleted file mode 100644
index b7cb542..0000000
--- a/meta-phosphor/common/recipes-devtools/gcc/gcc-source_6.2.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-FILESEXTRAPATHS_append := "${THISDIR}/gcc_6.2:"
-SRC_URI_append = "file://0001-Support-exception-propagation-without-lock-free-atom.patch"
diff --git a/meta-phosphor/common/recipes-devtools/gcc/gcc-source_6.3.bbappend b/meta-phosphor/common/recipes-devtools/gcc/gcc-source_6.3.bbappend
new file mode 100644
index 0000000..2fadb55
--- /dev/null
+++ b/meta-phosphor/common/recipes-devtools/gcc/gcc-source_6.3.bbappend
@@ -0,0 +1,2 @@
+FILESEXTRAPATHS_append := "${THISDIR}/gcc_6.3:"
+SRC_URI_append = "file://0001-Support-exception-propagation-without-lock-free-atom.patch"
diff --git a/meta-phosphor/common/recipes-devtools/gcc/gcc_6.2/0001-Support-exception-propagation-without-lock-free-atom.patch b/meta-phosphor/common/recipes-devtools/gcc/gcc_6.2/0001-Support-exception-propagation-without-lock-free-atom.patch
deleted file mode 100644
index 597be32..0000000
--- a/meta-phosphor/common/recipes-devtools/gcc/gcc_6.2/0001-Support-exception-propagation-without-lock-free-atom.patch
+++ /dev/null
@@ -1,2011 +0,0 @@
-From cf17b2b404eed4778664b69d20e1943b619bfd38 Mon Sep 17 00:00:00 2001
-From: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Wed, 4 Jan 2017 10:54:59 +0000
-Subject: [PATCH 1/1] Support exception propagation without lock-free atomic
- int
-
-2017-01-04  Pauli Nieminen  <suokkos@gmail.com>
-	    Jonathan Wakely  <jwakely@redhat.com>
-
-	PR libstdc++/64735
-	* acinclude.m4 (GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER): Define.
-	* config.h.in: Regenerate.
-	* config/abi/pre/gnu.ver [HAVE_EXCEPTION_PTR_SINCE_GCC46]
-	(GLIBCXX_3.4.15, GLIBCXX_3.4.21, CXXABI_1.3.3, CXXABI_1.3.5): Make
-	exports for exception_ptr, nested_exception, and future conditional.
-	[HAVE_EXCEPTION_PTR_SINCE_GCC46] (GLIBCXX_3.4.23, CXXABI_1.3.11): Add
-	exports for exception_ptr, nested_exception, and future conditional.
-	* configure: Regenerate.
-	* configure.ac: Use GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER.
-	* include/std/future: Remove check for ATOMIC_INT_LOCK_FREE
-	* libsupc++/eh_atomics.h: New file for internal use only.
-	(__eh_atomic_inc, __eh_atomic_dec): New.
-	* libsupc++/eh_ptr.cc (exception_ptr::_M_addref)
-	(exception_ptr::_M_release) (__gxx_dependent_exception_cleanup)
-	(rethrow_exception): Use eh_atomics.h reference counting helpers.
-	* libsupc++/eh_throw.cc (__gxx_exception_cleanup): Likewise.
-	* libsupc++/eh_tm.cc (free_any_cxa_exception): Likewise.
-	* libsupc++/exception: Remove check for ATOMIC_INT_LOCK_FREE.
-	* libsupc++/exception_ptr.h: Likewise.
-	* libsupc++/guard.cc: Include header for ATOMIC_INT_LOCK_FREE macro.
-	* libsupc++/nested_exception.cc: Remove check for
-	ATOMIC_INT_LOCK_FREE.
-	* libsupc++/nested_exception.h: Likewise.
-	* src/c++11/future.cc: Likewise.
-	* testsuite/18_support/exception_ptr/*: Remove atomic builtins checks.
-	* testsuite/18_support/nested_exception/*: Likewise.
-	* testsuite/30_threads/async/*: Likewise.
-	* testsuite/30_threads/future/*: Likewise.
-	* testsuite/30_threads/headers/future/types_std_c++0x.cc: Likewise.
-	* testsuite/30_threads/packaged_task/*: Likewise.
-	* testsuite/30_threads/promise/*: Likewise.
-	* testsuite/30_threads/shared_future/*: Likewise.
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244051 138bc75d-0d04-0410-961f-82ee72b054a4
-
-This is a backport of the upstream commit.
-
-Signed-off-by: James Feist <james.feist@linux.intel.com>
----
- libstdc++-v3/ChangeLog                             | 38 +++++++++-
- libstdc++-v3/acinclude.m4                          | 37 ++++++++++
- libstdc++-v3/config.h.in                           |  3 +
- libstdc++-v3/config/abi/pre/gnu.ver                | 10 +++
- libstdc++-v3/configure                             | 49 +++++++++++++
- libstdc++-v3/configure.ac                          |  3 +
- libstdc++-v3/include/std/future                    |  4 +-
- libstdc++-v3/libsupc++/eh_atomics.h                | 84 ++++++++++++++++++++++
- libstdc++-v3/libsupc++/eh_ptr.cc                   | 14 ++--
- libstdc++-v3/libsupc++/eh_throw.cc                 |  7 +-
- libstdc++-v3/libsupc++/eh_tm.cc                    |  5 +-
- libstdc++-v3/libsupc++/exception                   |  3 +-
- libstdc++-v3/libsupc++/exception_ptr.h             |  4 --
- libstdc++-v3/libsupc++/guard.cc                    |  1 +
- libstdc++-v3/libsupc++/nested_exception.cc         |  2 -
- libstdc++-v3/libsupc++/nested_exception.h          |  4 --
- libstdc++-v3/src/c++11/future.cc                   |  3 +-
- .../testsuite/18_support/exception_ptr/40296.cc    |  1 -
- .../18_support/exception_ptr/60612-terminate.cc    |  1 -
- .../18_support/exception_ptr/60612-unexpected.cc   |  1 -
- .../testsuite/18_support/exception_ptr/62258.cc    |  1 -
- .../testsuite/18_support/exception_ptr/64241.cc    |  1 -
- .../18_support/exception_ptr/current_exception.cc  |  1 -
- .../testsuite/18_support/exception_ptr/lifespan.cc |  1 -
- .../18_support/exception_ptr/make_exception_ptr.cc |  1 -
- .../testsuite/18_support/exception_ptr/move.cc     |  1 -
- .../18_support/exception_ptr/requirements.cc       |  1 -
- .../18_support/exception_ptr/requirements_neg.cc   |  1 -
- .../18_support/exception_ptr/rethrow_exception.cc  |  1 -
- .../testsuite/18_support/nested_exception/51438.cc |  1 -
- .../testsuite/18_support/nested_exception/62154.cc |  1 -
- .../testsuite/18_support/nested_exception/68139.cc |  1 -
- .../testsuite/18_support/nested_exception/cons.cc  |  1 -
- .../18_support/nested_exception/nested_ptr.cc      |  1 -
- .../nested_exception/rethrow_if_nested.cc          |  1 -
- .../18_support/nested_exception/rethrow_nested.cc  |  1 -
- .../nested_exception/throw_with_nested.cc          |  1 -
- libstdc++-v3/testsuite/30_threads/async/42819.cc   |  1 -
- libstdc++-v3/testsuite/30_threads/async/49668.cc   |  1 -
- libstdc++-v3/testsuite/30_threads/async/54297.cc   |  1 -
- libstdc++-v3/testsuite/30_threads/async/any.cc     |  1 -
- libstdc++-v3/testsuite/30_threads/async/async.cc   |  1 -
- libstdc++-v3/testsuite/30_threads/async/except.cc  |  1 -
- .../testsuite/30_threads/async/forced_unwind.cc    |  1 -
- libstdc++-v3/testsuite/30_threads/async/launch.cc  |  1 -
- libstdc++-v3/testsuite/30_threads/async/lwg2021.cc |  1 -
- libstdc++-v3/testsuite/30_threads/async/sync.cc    |  1 -
- .../testsuite/30_threads/future/cons/assign_neg.cc |  1 -
- .../testsuite/30_threads/future/cons/constexpr.cc  |  1 -
- .../testsuite/30_threads/future/cons/copy_neg.cc   |  1 -
- .../testsuite/30_threads/future/cons/default.cc    |  1 -
- .../testsuite/30_threads/future/cons/move.cc       |  1 -
- .../30_threads/future/cons/move_assign.cc          |  1 -
- .../testsuite/30_threads/future/members/45133.cc   |  1 -
- .../testsuite/30_threads/future/members/get.cc     |  1 -
- .../testsuite/30_threads/future/members/get2.cc    |  1 -
- .../testsuite/30_threads/future/members/share.cc   |  1 -
- .../testsuite/30_threads/future/members/valid.cc   |  1 -
- .../testsuite/30_threads/future/members/wait.cc    |  1 -
- .../30_threads/future/members/wait_for.cc          |  1 -
- .../30_threads/future/members/wait_until.cc        |  1 -
- .../future/requirements/explicit_instantiation.cc  |  1 -
- .../30_threads/headers/future/types_std_c++0x.cc   |  1 -
- .../testsuite/30_threads/packaged_task/49668.cc    |  1 -
- .../testsuite/30_threads/packaged_task/60564.cc    |  1 -
- .../testsuite/30_threads/packaged_task/cons/1.cc   |  1 -
- .../testsuite/30_threads/packaged_task/cons/2.cc   |  1 -
- .../testsuite/30_threads/packaged_task/cons/3.cc   |  1 -
- .../30_threads/packaged_task/cons/56492.cc         |  1 -
- .../30_threads/packaged_task/cons/alloc.cc         |  1 -
- .../30_threads/packaged_task/cons/alloc2.cc        |  1 -
- .../30_threads/packaged_task/cons/alloc_min.cc     |  1 -
- .../30_threads/packaged_task/cons/assign_neg.cc    |  1 -
- .../30_threads/packaged_task/cons/copy_neg.cc      |  1 -
- .../30_threads/packaged_task/cons/move.cc          |  1 -
- .../30_threads/packaged_task/cons/move_assign.cc   |  1 -
- .../30_threads/packaged_task/forced_unwind.cc      |  1 -
- .../packaged_task/members/at_thread_exit.cc        |  1 -
- .../30_threads/packaged_task/members/get_future.cc |  1 -
- .../packaged_task/members/get_future2.cc           |  1 -
- .../30_threads/packaged_task/members/invoke.cc     |  1 -
- .../30_threads/packaged_task/members/invoke2.cc    |  1 -
- .../30_threads/packaged_task/members/invoke3.cc    |  1 -
- .../30_threads/packaged_task/members/invoke4.cc    |  1 -
- .../30_threads/packaged_task/members/invoke5.cc    |  1 -
- .../30_threads/packaged_task/members/reset.cc      |  1 -
- .../30_threads/packaged_task/members/reset2.cc     |  1 -
- .../30_threads/packaged_task/members/swap.cc       |  1 -
- .../30_threads/packaged_task/members/valid.cc      |  1 -
- .../requirements/explicit_instantiation.cc         |  1 -
- .../30_threads/packaged_task/uses_allocator.cc     |  1 -
- libstdc++-v3/testsuite/30_threads/promise/60966.cc |  1 -
- libstdc++-v3/testsuite/30_threads/promise/69106.cc |  1 -
- .../testsuite/30_threads/promise/cons/1.cc         |  1 -
- .../testsuite/30_threads/promise/cons/alloc.cc     |  1 -
- .../testsuite/30_threads/promise/cons/alloc2.cc    |  1 -
- .../testsuite/30_threads/promise/cons/alloc_min.cc |  1 -
- .../30_threads/promise/cons/assign_neg.cc          |  1 -
- .../testsuite/30_threads/promise/cons/copy_neg.cc  |  1 -
- .../testsuite/30_threads/promise/cons/move.cc      |  1 -
- .../30_threads/promise/cons/move_assign.cc         |  1 -
- .../30_threads/promise/members/at_thread_exit.cc   |  1 -
- .../30_threads/promise/members/get_future.cc       |  1 -
- .../30_threads/promise/members/get_future2.cc      |  1 -
- .../30_threads/promise/members/set_exception.cc    |  1 -
- .../30_threads/promise/members/set_exception2.cc   |  1 -
- .../30_threads/promise/members/set_value.cc        |  1 -
- .../30_threads/promise/members/set_value2.cc       |  1 -
- .../30_threads/promise/members/set_value3.cc       |  1 -
- .../testsuite/30_threads/promise/members/swap.cc   |  1 -
- .../promise/requirements/explicit_instantiation.cc |  1 -
- .../testsuite/30_threads/promise/uses_allocator.cc |  1 -
- .../30_threads/shared_future/cons/assign.cc        |  1 -
- .../30_threads/shared_future/cons/constexpr.cc     |  1 -
- .../30_threads/shared_future/cons/copy.cc          |  1 -
- .../30_threads/shared_future/cons/default.cc       |  1 -
- .../30_threads/shared_future/cons/move.cc          |  1 -
- .../30_threads/shared_future/cons/move_assign.cc   |  1 -
- .../30_threads/shared_future/members/45133.cc      |  1 -
- .../30_threads/shared_future/members/get.cc        |  1 -
- .../30_threads/shared_future/members/get2.cc       |  1 -
- .../30_threads/shared_future/members/valid.cc      |  1 -
- .../30_threads/shared_future/members/wait.cc       |  1 -
- .../30_threads/shared_future/members/wait_for.cc   |  1 -
- .../30_threads/shared_future/members/wait_until.cc |  1 -
- .../requirements/explicit_instantiation.cc         |  1 -
- 126 files changed, 236 insertions(+), 144 deletions(-)
- create mode 100644 libstdc++-v3/libsupc++/eh_atomics.h
-
-diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
-index 3e8f33c..cb70bd2 100644
---- a/libstdc++-v3/ChangeLog
-+++ b/libstdc++-v3/ChangeLog
-@@ -1,4 +1,40 @@
--2016-08-22  Release Manager
-+2017-01-04  Pauli Nieminen  <suokkos@gmail.com>
-+	    Jonathan Wakely  <jwakely@redhat.com>
-+
-+	PR libstdc++/64735
-+	* acinclude.m4 (GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER): Define.
-+	* config.h.in: Regenerate.
-+	* config/abi/pre/gnu.ver [HAVE_EXCEPTION_PTR_SINCE_GCC46]
-+	(GLIBCXX_3.4.15, GLIBCXX_3.4.21, CXXABI_1.3.3, CXXABI_1.3.5): Make
-+	exports for exception_ptr, nested_exception, and future conditional.
-+	[HAVE_EXCEPTION_PTR_SINCE_GCC46] (GLIBCXX_3.4.23, CXXABI_1.3.11): Add
-+	exports for exception_ptr, nested_exception, and future conditional.
-+	* configure: Regenerate.
-+	* configure.ac: Use GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER.
-+	* include/std/future: Remove check for ATOMIC_INT_LOCK_FREE
-+	* libsupc++/eh_atomics.h: New file for internal use only.
-+	(__eh_atomic_inc, __eh_atomic_dec): New.
-+	* libsupc++/eh_ptr.cc (exception_ptr::_M_addref)
-+	(exception_ptr::_M_release) (__gxx_dependent_exception_cleanup)
-+	(rethrow_exception): Use eh_atomics.h reference counting helpers.
-+	* libsupc++/eh_throw.cc (__gxx_exception_cleanup): Likewise.
-+	* libsupc++/eh_tm.cc (free_any_cxa_exception): Likewise.
-+	* libsupc++/exception: Remove check for ATOMIC_INT_LOCK_FREE.
-+	* libsupc++/exception_ptr.h: Likewise.
-+	* libsupc++/guard.cc: Include header for ATOMIC_INT_LOCK_FREE macro.
-+	* libsupc++/nested_exception.cc: Remove check for
-+	ATOMIC_INT_LOCK_FREE.
-+	* libsupc++/nested_exception.h: Likewise.
-+	* src/c++11/future.cc: Likewise.
-+	* testsuite/18_support/exception_ptr/*: Remove atomic builtins checks.
-+	* testsuite/18_support/nested_exception/*: Likewise.
-+	* testsuite/30_threads/async/*: Likewise.
-+	* testsuite/30_threads/future/*: Likewise.
-+	* testsuite/30_threads/headers/future/types_std_c++0x.cc: Likewise.
-+	* testsuite/30_threads/packaged_task/*: Likewise.
-+	* testsuite/30_threads/promise/*: Likewise.
-+	* testsuite/30_threads/shared_future/*: Likewise.
-+
- 
- 	* GCC 6.2.0 released.
- 
-diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
-index b0f88cb..8341769 100644
---- a/libstdc++-v3/acinclude.m4
-+++ b/libstdc++-v3/acinclude.m4
-@@ -4419,6 +4419,43 @@ AC_DEFUN([GLIBCXX_CHECK_SIZE_T_MANGLING], [
-     [Define to the letter to which size_t is mangled.])
- ])
- 
-+dnl
-+dnl Determine whether std::exception_ptr symbols should be exported with
-+dnl the symbol versions from GCC 4.6.0 or GCC 7.1.0, depending on which
-+dnl release first added support for std::exception_ptr. Originally it was
-+dnl only supported for targets with always-lock-free atomics for int, but
-+dnl since GCC 7.1 it is supported for all targets.
-+dnl
-+AC_DEFUN([GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER], [
-+  if test $enable_symvers != no; then
-+    AC_MSG_CHECKING([for first version to support std::exception_ptr])
-+    case ${target} in
-+      aarch64-*-* | alpha-*-* | hppa*-*-* | i?86-*-* | x86_64-*-* | \
-+      m68k-*-* | powerpc*-*-* | s390*-*-* | *-*-solaris* )
-+        ac_exception_ptr_since_gcc46=yes
-+        ;;
-+      *)
-+        # If the value of this macro changes then we will need to hardcode
-+        # yes/no here for additional targets based on the original value.
-+        AC_TRY_COMPILE([], [
-+          #if __GCC_ATOMIC_INT_LOCK_FREE <= 1
-+          # error atomic int not always lock free
-+          #endif
-+          ],
-+          [ac_exception_ptr_since_gcc46=yes],
-+          [ac_exception_ptr_since_gcc46=no])
-+        ;;
-+    esac
-+    if test x"$ac_exception_ptr_since_gcc46" = x"yes" ; then
-+      AC_DEFINE(HAVE_EXCEPTION_PTR_SINCE_GCC46, 1,
-+        [Define to 1 if GCC 4.6 supported std::exception_ptr for the target])
-+      AC_MSG_RESULT([4.6.0])
-+    else
-+      AC_MSG_RESULT([7.1.0])
-+    fi
-+  fi
-+])
-+
- # Macros from the top-level gcc directory.
- m4_include([../config/gc++filt.m4])
- m4_include([../config/tls.m4])
-diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
-index 701d479..cc7dbe5 100644
---- a/libstdc++-v3/config.h.in
-+++ b/libstdc++-v3/config.h.in
-@@ -120,6 +120,9 @@
- /* Define if EWOULDBLOCK exists. */
- #undef HAVE_EWOULDBLOCK
- 
-+/* Define to 1 if GCC 4.6 supported std::exception_ptr for the target */
-+#undef HAVE_EXCEPTION_PTR_SINCE_GCC46
-+
- /* Define to 1 if you have the <execinfo.h> header file. */
- #undef HAVE_EXECINFO_H
- 
-diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
-index 5c6b0fe..f0a5732 100644
---- a/libstdc++-v3/config/abi/pre/gnu.ver
-+++ b/libstdc++-v3/config/abi/pre/gnu.ver
-@@ -1490,6 +1490,9 @@ GLIBCXX_3.4.15 {
-     _ZNSt14error_categoryC*;
-     _ZNSt14error_categoryD*;
- 
-+#ifdef HAVE_EXCEPTION_PTR_SINCE_GCC46
-+    # std::future symbols are only present in this version when
-+    # atomic operations on int are always lock-free.
-     _ZNSt13__future_base12_Result_baseC*;
-     _ZNSt13__future_base12_Result_baseD*;
-     _ZTINSt13__future_base12_Result_baseE;
-@@ -1498,6 +1501,7 @@ GLIBCXX_3.4.15 {
-     _ZNSt13__future_base11_State_baseD*;
-     _ZTINSt13__future_base11_State_baseE;
-     _ZTVNSt13__future_base11_State_baseE;
-+#endif
- 
- } GLIBCXX_3.4.14;
- 
-@@ -1674,8 +1678,10 @@ GLIBCXX_3.4.21 {
- 
-     # std::notify_all_at_thread_exit
-     _ZSt25notify_all_at_thread_exitRSt18condition_variableSt11unique_lockISt5mutexE;
-+#ifdef HAVE_EXCEPTION_PTR_SINCE_GCC46
-     # std::__future_base::_State_baseV2::_Make_ready::_M_set()
-     _ZNSt13__future_base13_State_baseV211_Make_ready6_M_setEv;
-+#endif
- 
-     # ABI-tagged std::basic_string
-     _ZNSt7__cxx1112basic_string*;
-@@ -2040,6 +2046,7 @@ CXXABI_1.3.3 {
-     _ZTIPDi;
-     _ZTIPKDi;
- 
-+#ifdef HAVE_EXCEPTION_PTR_SINCE_GCC46
-     # exception_ptr
-     _ZNSt15__exception_ptr13exception_ptrC1Ev;
-     _ZNSt15__exception_ptr13exception_ptrC2Ev;
-@@ -2059,6 +2066,7 @@ CXXABI_1.3.3 {
- 
-     _ZSt17current_exceptionv;
-     _ZSt17rethrow_exceptionNSt15__exception_ptr13exception_ptrE;
-+#endif
- 
- } CXXABI_1.3.2;
- 
-@@ -2089,10 +2097,12 @@ CXXABI_1.3.5 {
-     # FNV hash.
-     _ZSt15_Fnv_hash_bytesPKv*;
- 
-+#ifdef HAVE_EXCEPTION_PTR_SINCE_GCC46
-     # std::nested_exception
-     _ZNSt16nested_exceptionD*;
-     _ZTISt16nested_exception;
-     _ZTVSt16nested_exception;
-+#endif
- 
- } CXXABI_1.3.4;
- 
-diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
-index 41797a9..7830085 100755
---- a/libstdc++-v3/configure
-+++ b/libstdc++-v3/configure
-@@ -80509,6 +80509,55 @@ _ACEOF
- 
- 
- 
-+# Check which release added std::exception_ptr for the target
-+
-+  if test $enable_symvers != no; then
-+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for first version to support std::exception_ptr" >&5
-+$as_echo_n "checking for first version to support std::exception_ptr... " >&6; }
-+    case ${target} in
-+      aarch64-*-* | alpha-*-* | hppa*-*-* | i?86-*-* | x86_64-*-* | \
-+      m68k-*-* | powerpc*-*-* | s390*-*-* | *-*-solaris* )
-+        ac_exception_ptr_since_gcc46=yes
-+        ;;
-+      *)
-+        # If the value of this macro changes then we will need to hardcode
-+        # yes/no here for additional targets based on the original value.
-+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
-+
-+          #if __GCC_ATOMIC_INT_LOCK_FREE <= 1
-+          # error atomic int not always lock free
-+          #endif
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+  ac_exception_ptr_since_gcc46=yes
-+else
-+  ac_exception_ptr_since_gcc46=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+        ;;
-+    esac
-+    if test x"$ac_exception_ptr_since_gcc46" = x"yes" ; then
-+
-+$as_echo "#define HAVE_EXCEPTION_PTR_SINCE_GCC46 1" >>confdefs.h
-+
-+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: 4.6.0" >&5
-+$as_echo "4.6.0" >&6; }
-+    else
-+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: 7.1.0" >&5
-+$as_echo "7.1.0" >&6; }
-+    fi
-+  fi
-+
-+
- # Define documentation rules conditionally.
- 
- # See if makeinfo has been installed and is modern enough
-diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
-index 9e19e99..7dbb758 100644
---- a/libstdc++-v3/configure.ac
-+++ b/libstdc++-v3/configure.ac
-@@ -411,6 +411,9 @@ GLIBCXX_CHECK_FILESYSTEM_DEPS
- # For Transactional Memory TS
- GLIBCXX_CHECK_SIZE_T_MANGLING
- 
-+# Check which release added std::exception_ptr for the target
-+GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER
-+
- # Define documentation rules conditionally.
- 
- # See if makeinfo has been installed and is modern enough
-diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
-index 80b7b06..7a16bf8 100644
---- a/libstdc++-v3/include/std/future
-+++ b/libstdc++-v3/include/std/future
-@@ -182,8 +182,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-     future<__async_result_of<_Fn, _Args...>>
-     async(_Fn&& __fn, _Args&&... __args);
- 
--#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
--  && (ATOMIC_INT_LOCK_FREE > 1)
-+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
- 
-   /// Base class and enclosing scope.
-   struct __future_base
-@@ -1745,7 +1744,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- 
- #endif // _GLIBCXX_ASYNC_ABI_COMPAT
- #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
--       // && ATOMIC_INT_LOCK_FREE
- 
-   // @} group futures
- _GLIBCXX_END_NAMESPACE_VERSION
-diff --git a/libstdc++-v3/libsupc++/eh_atomics.h b/libstdc++-v3/libsupc++/eh_atomics.h
-new file mode 100644
-index 0000000..71b42a4
---- /dev/null
-+++ b/libstdc++-v3/libsupc++/eh_atomics.h
-@@ -0,0 +1,84 @@
-+// Exception Handling support header for -*- C++ -*-
-+
-+// Copyright (C) 2016 Free Software Foundation, Inc.
-+//
-+// This file is part of GCC.
-+//
-+// GCC is free software; you can redistribute it and/or modify
-+// it under the terms of the GNU General Public License as published by
-+// the Free Software Foundation; either version 3, or (at your option)
-+// any later version.
-+//
-+// GCC is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+//
-+// Under Section 7 of GPL version 3, you are granted additional
-+// permissions described in the GCC Runtime Library Exception, version
-+// 3.1, as published by the Free Software Foundation.
-+
-+// You should have received a copy of the GNU General Public License and
-+// a copy of the GCC Runtime Library Exception along with this program;
-+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-+// <http://www.gnu.org/licenses/>.
-+
-+/** @file eh_atomics.h
-+ *  This is an internal header file, included by library source files.
-+ *  Do not attempt to use it directly.
-+ */
-+
-+#ifndef _EH_ATOMICS_H
-+#define _EH_ATOMICS_H 1
-+
-+#include <bits/c++config.h>
-+#include <bits/atomic_word.h>
-+#include <bits/atomic_lockfree_defines.h>
-+#if ATOMIC_INT_LOCK_FREE <= 1
-+# include <ext/atomicity.h>
-+#endif
-+
-+#pragma GCC visibility push(default)
-+extern "C++" {
-+namespace __gnu_cxx
-+{
-+  void
-+  __eh_atomic_inc (_Atomic_word* __count) __attribute__((always_inline));
-+
-+  bool
-+  __eh_atomic_dec (_Atomic_word* __count) __attribute__((always_inline));
-+
-+  // Increments the count.
-+  inline void
-+  __eh_atomic_inc (_Atomic_word* __count)
-+  {
-+#if ATOMIC_INT_LOCK_FREE > 1
-+    __atomic_add_fetch (__count, 1, __ATOMIC_ACQ_REL);
-+#else
-+    _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE (__count);
-+    __gnu_cxx::__atomic_add_dispatch (__count, 1);
-+    _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER (__count);
-+#endif
-+  }
-+
-+  // Decrements the count and returns true if it reached zero.
-+  inline bool
-+  __eh_atomic_dec (_Atomic_word* __count)
-+  {
-+#if ATOMIC_INT_LOCK_FREE > 1
-+    return __atomic_sub_fetch (__count, 1, __ATOMIC_ACQ_REL) == 0;
-+#else
-+    _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE (__count);
-+    if (__gnu_cxx::__exchange_and_add_dispatch (__count, -1) == 1)
-+      {
-+	_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER (__count);
-+	return true;
-+      }
-+    return false;
-+#endif
-+  }
-+} // namespace __gnu_cxx
-+}
-+#pragma GCC visibility pop
-+
-+#endif // _EH_ATOMICS_H
-diff --git a/libstdc++-v3/libsupc++/eh_ptr.cc b/libstdc++-v3/libsupc++/eh_ptr.cc
-index 3b8e0a01..bb68656 100644
---- a/libstdc++-v3/libsupc++/eh_ptr.cc
-+++ b/libstdc++-v3/libsupc++/eh_ptr.cc
-@@ -23,9 +23,7 @@
- // <http://www.gnu.org/licenses/>.
- 
- #include <bits/c++config.h>
--#include <bits/atomic_lockfree_defines.h>
--
--#if ATOMIC_INT_LOCK_FREE > 1
-+#include "eh_atomics.h"
- 
- #define _GLIBCXX_EH_PTR_COMPAT
- 
-@@ -103,7 +101,7 @@ std::__exception_ptr::exception_ptr::_M_addref() _GLIBCXX_USE_NOEXCEPT
-     {
-       __cxa_refcounted_exception *eh =
- 	__get_refcounted_exception_header_from_obj (_M_exception_object);
--      __atomic_add_fetch (&eh->referenceCount, 1, __ATOMIC_ACQ_REL);
-+      __gnu_cxx::__eh_atomic_inc (&eh->referenceCount);
-     }
- }
- 
-@@ -115,7 +113,7 @@ std::__exception_ptr::exception_ptr::_M_release() _GLIBCXX_USE_NOEXCEPT
-     {
-       __cxa_refcounted_exception *eh =
- 	__get_refcounted_exception_header_from_obj (_M_exception_object);
--      if (__atomic_sub_fetch (&eh->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
-+      if (__gnu_cxx::__eh_atomic_dec (&eh->referenceCount))
-         {
- 	  if (eh->exc.exceptionDestructor)
- 	    eh->exc.exceptionDestructor (_M_exception_object);
-@@ -219,7 +217,7 @@ __gxx_dependent_exception_cleanup(_Unwind_Reason_Code code,
- 
-   __cxa_free_dependent_exception (dep);
- 
--  if (__atomic_sub_fetch (&header->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
-+  if (__gnu_cxx::__eh_atomic_dec (&header->referenceCount))
-     {
-       if (header->exc.exceptionDestructor)
- 	header->exc.exceptionDestructor (header + 1);
-@@ -238,7 +236,7 @@ std::rethrow_exception(std::exception_ptr ep)
- 
-   __cxa_dependent_exception *dep = __cxa_allocate_dependent_exception ();
-   dep->primaryException = obj;
--  __atomic_add_fetch (&eh->referenceCount, 1,  __ATOMIC_ACQ_REL);
-+  __gnu_cxx::__eh_atomic_inc (&eh->referenceCount);
- 
-   dep->unexpectedHandler = get_unexpected ();
-   dep->terminateHandler = get_terminate ();
-@@ -260,5 +258,3 @@ std::rethrow_exception(std::exception_ptr ep)
- }
- 
- #undef _GLIBCXX_EH_PTR_COMPAT
--
--#endif
-diff --git a/libstdc++-v3/libsupc++/eh_throw.cc b/libstdc++-v3/libsupc++/eh_throw.cc
-index 9aac218..2bd4780 100644
---- a/libstdc++-v3/libsupc++/eh_throw.cc
-+++ b/libstdc++-v3/libsupc++/eh_throw.cc
-@@ -24,6 +24,7 @@
- 
- #include <bits/c++config.h>
- #include "unwind-cxx.h"
-+#include "eh_atomics.h"
- 
- using namespace __cxxabiv1;
- 
-@@ -42,17 +43,13 @@ __gxx_exception_cleanup (_Unwind_Reason_Code code, _Unwind_Exception *exc)
-   if (code != _URC_FOREIGN_EXCEPTION_CAUGHT && code != _URC_NO_REASON)
-     __terminate (header->exc.terminateHandler);
- 
--#if ATOMIC_INT_LOCK_FREE > 1
--  if (__atomic_sub_fetch (&header->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
-+  if (__gnu_cxx::__eh_atomic_dec (&header->referenceCount))
-     {
--#endif
-       if (header->exc.exceptionDestructor)
- 	header->exc.exceptionDestructor (header + 1);
- 
-       __cxa_free_exception (header + 1);
--#if ATOMIC_INT_LOCK_FREE > 1
-     }
--#endif
- }
- 
- 
-diff --git a/libstdc++-v3/libsupc++/eh_tm.cc b/libstdc++-v3/libsupc++/eh_tm.cc
-index c05f611..85ae46c 100644
---- a/libstdc++-v3/libsupc++/eh_tm.cc
-+++ b/libstdc++-v3/libsupc++/eh_tm.cc
-@@ -24,6 +24,7 @@
- 
- #include <cstdlib>
- #include "unwind-cxx.h"
-+#include "eh_atomics.h"
- 
- using namespace __cxxabiv1;
- 
-@@ -45,9 +46,7 @@ free_any_cxa_exception (_Unwind_Exception *eo)
-       __cxa_free_dependent_exception (dep);
-     }
- 
--#if __GCC_ATOMIC_INT_LOCK_FREE > 1
--  if (__atomic_sub_fetch (&h->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
--#endif
-+  if (__gnu_cxx::__eh_atomic_dec (&h->referenceCount))
-     __cxa_free_exception (h + 1);
- }
- 
-diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception
-index 63631f6..22cffd6 100644
---- a/libstdc++-v3/libsupc++/exception
-+++ b/libstdc++-v3/libsupc++/exception
-@@ -35,7 +35,6 @@
- #pragma GCC visibility push(default)
- 
- #include <bits/c++config.h>
--#include <bits/atomic_lockfree_defines.h>
- 
- extern "C++" {
- 
-@@ -166,7 +165,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
- 
- #pragma GCC visibility pop
- 
--#if (__cplusplus >= 201103L) && (ATOMIC_INT_LOCK_FREE > 1)
-+#if (__cplusplus >= 201103L)
- #include <bits/exception_ptr.h>
- #include <bits/nested_exception.h>
- #endif
-diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h
-index 783e539..3429b57 100644
---- a/libstdc++-v3/libsupc++/exception_ptr.h
-+++ b/libstdc++-v3/libsupc++/exception_ptr.h
-@@ -36,10 +36,6 @@
- #include <bits/c++config.h>
- #include <bits/exception_defines.h>
- 
--#if ATOMIC_INT_LOCK_FREE < 2
--#  error This platform does not support exception propagation.
--#endif
--
- extern "C++" {
- 
- namespace std 
-diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc
-index 9b61799..66edffb 100644
---- a/libstdc++-v3/libsupc++/guard.cc
-+++ b/libstdc++-v3/libsupc++/guard.cc
-@@ -30,6 +30,7 @@
- #include <new>
- #include <ext/atomicity.h>
- #include <ext/concurrence.h>
-+#include <bits/atomic_lockfree_defines.h>
- #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \
-   && (ATOMIC_INT_LOCK_FREE > 1) && defined(_GLIBCXX_HAVE_LINUX_FUTEX)
- # include <climits>
-diff --git a/libstdc++-v3/libsupc++/nested_exception.cc b/libstdc++-v3/libsupc++/nested_exception.cc
-index c1a7b7a..82dddb1 100644
---- a/libstdc++-v3/libsupc++/nested_exception.cc
-+++ b/libstdc++-v3/libsupc++/nested_exception.cc
-@@ -25,7 +25,5 @@
- 
- namespace std 
- {
--#if ATOMIC_INT_LOCK_FREE > 1
-   nested_exception::~nested_exception() noexcept = default;
--#endif
- } // namespace std
-diff --git a/libstdc++-v3/libsupc++/nested_exception.h b/libstdc++-v3/libsupc++/nested_exception.h
-index 377b803..b9c6baa 100644
---- a/libstdc++-v3/libsupc++/nested_exception.h
-+++ b/libstdc++-v3/libsupc++/nested_exception.h
-@@ -39,10 +39,6 @@
- #include <bits/c++config.h>
- #include <bits/move.h>
- 
--#if ATOMIC_INT_LOCK_FREE < 2
--#  error This platform does not support exception propagation.
--#endif
--
- extern "C++" {
- 
- namespace std
-diff --git a/libstdc++-v3/src/c++11/future.cc b/libstdc++-v3/src/c++11/future.cc
-index 7809a37..a14051a 100644
---- a/libstdc++-v3/src/c++11/future.cc
-+++ b/libstdc++-v3/src/c++11/future.cc
-@@ -78,8 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-   const char*
-   future_error::what() const noexcept { return logic_error::what(); }
- 
--#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
--  && (ATOMIC_INT_LOCK_FREE > 1)
-+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
-   __future_base::_Result_base::_Result_base() = default;
- 
-   __future_base::_Result_base::~_Result_base() = default;
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/40296.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/40296.cc
-index 23d8fed..9e866d6 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/40296.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/40296.cc
-@@ -1,6 +1,5 @@
- // { dg-do compile }
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc
-index de5ed4a..01faaa2 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2014-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc
-index 14f6ffe..e507262 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2014-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc
-index a714aa3..81f9ab7 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2015-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/64241.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/64241.cc
-index 25002d5..f9d6fb6 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/64241.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/64241.cc
-@@ -16,7 +16,6 @@
- // <http://www.gnu.org/licenses/>.
- 
- // { dg-options "-std=gnu++11 -fno-exceptions -O0" }
--// { dg-require-atomic-builtins "" }
- 
- #include <exception>
- #include <testsuite_hooks.h>
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/current_exception.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/current_exception.cc
-index 47d521b..497b63d 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/current_exception.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/current_exception.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // 2008-05-25  Sebastian Redl  <sebastian.redl@getdesigned.at>
- 
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc
-index bf4f4ab..25b8e41 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // 2008-05-25  Sebastian Redl  <sebastian.redl@getdesigned.at>
- 
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc
-index 0ea80b1..d0076dc 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/move.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/move.cc
-index 762e3dc..20a0d01 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/move.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/move.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/requirements.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/requirements.cc
-index ec016ca..a326bdd 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/requirements.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/requirements.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/requirements_neg.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/requirements_neg.cc
-index d5f7c91..8d6d274 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/requirements_neg.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/requirements_neg.cc
-@@ -1,6 +1,5 @@
- // { dg-do compile }
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc
-index 2afe03d..65fd6ea 100644
---- a/libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc
-+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // 2008-05-25  Sebastian Redl  <sebastian.redl@getdesigned.at>
- 
-diff --git a/libstdc++-v3/testsuite/18_support/nested_exception/51438.cc b/libstdc++-v3/testsuite/18_support/nested_exception/51438.cc
-index cfabf66..046db76 100644
---- a/libstdc++-v3/testsuite/18_support/nested_exception/51438.cc
-+++ b/libstdc++-v3/testsuite/18_support/nested_exception/51438.cc
-@@ -1,6 +1,5 @@
- // { dg-do compile }
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/nested_exception/62154.cc b/libstdc++-v3/testsuite/18_support/nested_exception/62154.cc
-index 4af2b1f..a9aa587 100644
---- a/libstdc++-v3/testsuite/18_support/nested_exception/62154.cc
-+++ b/libstdc++-v3/testsuite/18_support/nested_exception/62154.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2014-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/nested_exception/68139.cc b/libstdc++-v3/testsuite/18_support/nested_exception/68139.cc
-index 6be7ec1..18fbc59 100644
---- a/libstdc++-v3/testsuite/18_support/nested_exception/68139.cc
-+++ b/libstdc++-v3/testsuite/18_support/nested_exception/68139.cc
-@@ -1,6 +1,5 @@
- // { dg-do compile }
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2015-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/nested_exception/cons.cc b/libstdc++-v3/testsuite/18_support/nested_exception/cons.cc
-index 25437d9..30e2c32 100644
---- a/libstdc++-v3/testsuite/18_support/nested_exception/cons.cc
-+++ b/libstdc++-v3/testsuite/18_support/nested_exception/cons.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/nested_exception/nested_ptr.cc b/libstdc++-v3/testsuite/18_support/nested_exception/nested_ptr.cc
-index 9adb7ee..1382ffe 100644
---- a/libstdc++-v3/testsuite/18_support/nested_exception/nested_ptr.cc
-+++ b/libstdc++-v3/testsuite/18_support/nested_exception/nested_ptr.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_if_nested.cc b/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_if_nested.cc
-index d98a082..e0a49ea 100644
---- a/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_if_nested.cc
-+++ b/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_if_nested.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_nested.cc b/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_nested.cc
-index 6487efa..7fa0015 100644
---- a/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_nested.cc
-+++ b/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_nested.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/18_support/nested_exception/throw_with_nested.cc b/libstdc++-v3/testsuite/18_support/nested_exception/throw_with_nested.cc
-index 5579cc0..4acff59 100644
---- a/libstdc++-v3/testsuite/18_support/nested_exception/throw_with_nested.cc
-+++ b/libstdc++-v3/testsuite/18_support/nested_exception/throw_with_nested.cc
-@@ -1,5 +1,4 @@
- // { dg-options "-std=gnu++11" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/async/42819.cc b/libstdc++-v3/testsuite/30_threads/async/42819.cc
-index fd00759..d46c9b0 100644
---- a/libstdc++-v3/testsuite/30_threads/async/42819.cc
-+++ b/libstdc++-v3/testsuite/30_threads/async/42819.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/async/49668.cc b/libstdc++-v3/testsuite/30_threads/async/49668.cc
-index f912bdd..99de898 100644
---- a/libstdc++-v3/testsuite/30_threads/async/49668.cc
-+++ b/libstdc++-v3/testsuite/30_threads/async/49668.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/async/54297.cc b/libstdc++-v3/testsuite/30_threads/async/54297.cc
-index 2462a99..adf1d19 100644
---- a/libstdc++-v3/testsuite/30_threads/async/54297.cc
-+++ b/libstdc++-v3/testsuite/30_threads/async/54297.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- // { dg-require-sleep "" }
- 
- // Copyright (C) 2012-2016 Free Software Foundation, Inc.
-diff --git a/libstdc++-v3/testsuite/30_threads/async/any.cc b/libstdc++-v3/testsuite/30_threads/async/any.cc
-index 552b6e7..ee6a9a7 100644
---- a/libstdc++-v3/testsuite/30_threads/async/any.cc
-+++ b/libstdc++-v3/testsuite/30_threads/async/any.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/async/async.cc b/libstdc++-v3/testsuite/30_threads/async/async.cc
-index b8f2d5a..f8e24b6 100644
---- a/libstdc++-v3/testsuite/30_threads/async/async.cc
-+++ b/libstdc++-v3/testsuite/30_threads/async/async.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/async/except.cc b/libstdc++-v3/testsuite/30_threads/async/except.cc
-index fd9d628..36f9e57 100644
---- a/libstdc++-v3/testsuite/30_threads/async/except.cc
-+++ b/libstdc++-v3/testsuite/30_threads/async/except.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc b/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc
-index 9e56095..5bd902a 100644
---- a/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc
-+++ b/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc
-@@ -2,7 +2,6 @@
- // { dg-options " -std=gnu++11 -pthread" { target *-*-linux* *-*-gnu* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2014-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/async/launch.cc b/libstdc++-v3/testsuite/30_threads/async/launch.cc
-index 3b04f88..aa789f2 100644
---- a/libstdc++-v3/testsuite/30_threads/async/launch.cc
-+++ b/libstdc++-v3/testsuite/30_threads/async/launch.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/async/lwg2021.cc b/libstdc++-v3/testsuite/30_threads/async/lwg2021.cc
-index ea21083..fb2ca6a 100644
---- a/libstdc++-v3/testsuite/30_threads/async/lwg2021.cc
-+++ b/libstdc++-v3/testsuite/30_threads/async/lwg2021.cc
-@@ -21,7 +21,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // LWG 2021. Further incorrect usages of result_of
- // Arguments to result_of should use decay.
-diff --git a/libstdc++-v3/testsuite/30_threads/async/sync.cc b/libstdc++-v3/testsuite/30_threads/async/sync.cc
-index b2f7588..80de8e1 100644
---- a/libstdc++-v3/testsuite/30_threads/async/sync.cc
-+++ b/libstdc++-v3/testsuite/30_threads/async/sync.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/future/cons/assign_neg.cc
-index 5eded61..a5e52ea 100644
---- a/libstdc++-v3/testsuite/30_threads/future/cons/assign_neg.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/cons/assign_neg.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/cons/constexpr.cc b/libstdc++-v3/testsuite/30_threads/future/cons/constexpr.cc
-index ebfacee..96d8f63 100644
---- a/libstdc++-v3/testsuite/30_threads/future/cons/constexpr.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/cons/constexpr.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11 -fno-inline -g0" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- // { dg-final { scan-assembler-not "_ZNSt6futureIvEC2Ev" } }
- // { dg-final { scan-assembler-not "_ZNSt6futureIiEC2Ev" } }
- 
-diff --git a/libstdc++-v3/testsuite/30_threads/future/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/future/cons/copy_neg.cc
-index 5146eb8..f92d157 100644
---- a/libstdc++-v3/testsuite/30_threads/future/cons/copy_neg.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/cons/copy_neg.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/cons/default.cc b/libstdc++-v3/testsuite/30_threads/future/cons/default.cc
-index bd22ff1..c46df93 100644
---- a/libstdc++-v3/testsuite/30_threads/future/cons/default.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/cons/default.cc
-@@ -1,7 +1,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/cons/move.cc b/libstdc++-v3/testsuite/30_threads/future/cons/move.cc
-index 1f92177..157a0d3 100644
---- a/libstdc++-v3/testsuite/30_threads/future/cons/move.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/cons/move.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/cons/move_assign.cc b/libstdc++-v3/testsuite/30_threads/future/cons/move_assign.cc
-index 21b9a09..c1f204a 100644
---- a/libstdc++-v3/testsuite/30_threads/future/cons/move_assign.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/cons/move_assign.cc
-@@ -1,7 +1,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/members/45133.cc b/libstdc++-v3/testsuite/30_threads/future/members/45133.cc
-index 35fbdb7..d013bf0 100644
---- a/libstdc++-v3/testsuite/30_threads/future/members/45133.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/members/45133.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/members/get.cc b/libstdc++-v3/testsuite/30_threads/future/members/get.cc
-index 984fbe3..4d84396 100644
---- a/libstdc++-v3/testsuite/30_threads/future/members/get.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/members/get.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/members/get2.cc b/libstdc++-v3/testsuite/30_threads/future/members/get2.cc
-index e8683f8..c3cacdf 100644
---- a/libstdc++-v3/testsuite/30_threads/future/members/get2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/members/get2.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/members/share.cc b/libstdc++-v3/testsuite/30_threads/future/members/share.cc
-index 0992fc0..96662fd 100644
---- a/libstdc++-v3/testsuite/30_threads/future/members/share.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/members/share.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/members/valid.cc b/libstdc++-v3/testsuite/30_threads/future/members/valid.cc
-index 2bb9b11..4b56fe5 100644
---- a/libstdc++-v3/testsuite/30_threads/future/members/valid.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/members/valid.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/members/wait.cc b/libstdc++-v3/testsuite/30_threads/future/members/wait.cc
-index 7782871..1b4134e 100644
---- a/libstdc++-v3/testsuite/30_threads/future/members/wait.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/members/wait.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc b/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc
-index b7bd874..77f9c38 100644
---- a/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc b/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc
-index 1ce7118..816411f 100644
---- a/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc
-index 95ddf4d..8ab100a 100644
---- a/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc
-+++ b/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/headers/future/types_std_c++0x.cc b/libstdc++-v3/testsuite/30_threads/headers/future/types_std_c++0x.cc
-index ccd85ab..c596685 100644
---- a/libstdc++-v3/testsuite/30_threads/headers/future/types_std_c++0x.cc
-+++ b/libstdc++-v3/testsuite/30_threads/headers/future/types_std_c++0x.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" } 
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc
-index 46ab3d5..a492de1 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/60564.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/60564.cc
-index 6021fdb..bc828cb 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/60564.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/60564.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2014-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc
-index 919f136..45ede56 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc
-index 0611d8a..ff53be1 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
-index 11203d5..a08a85e 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc
-index 0338f98..48de913 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2013-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc
-index 83c5d9f..640d269 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc
-index b53fd8d..ea9b147 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc_min.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc_min.cc
-index deacad1..ca22639 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc_min.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc_min.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc
-index dd40133..4517dc4 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc
-index a4e47fd..0b7356d 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc
-index cb1d8e0..99c2123 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc
-index 8025dbf..ed4bec5 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc
-index 13be918..2c2c85c 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc
-@@ -2,7 +2,6 @@
- // { dg-options " -std=gnu++11 -pthread" { target *-*-linux* *-*-gnu* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2014-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/at_thread_exit.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/at_thread_exit.cc
-index b217090..76dfee9 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/at_thread_exit.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/at_thread_exit.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2014-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc
-index 5fab0de..a5aa5c2 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc
-index a343772..68f4e8d 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc
-index 5e4c038..8d2955e 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc
-index 3a3d3a3..b003fb7 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc
-index a56a895..07dd695 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc
-index 080a9a8..012fea3 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc
-index be90276..7dfb177 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc
-index c7cb184..f08ed64 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc
-index aade3db..09597e3 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc
-index d61256b..975db20 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc
-index 047ffeb..e11411b 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc
-index 7b7e0f5..37e0676 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/uses_allocator.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/uses_allocator.cc
-index 1c31673..733ed8b 100644
---- a/libstdc++-v3/testsuite/30_threads/packaged_task/uses_allocator.cc
-+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/uses_allocator.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/60966.cc b/libstdc++-v3/testsuite/30_threads/promise/60966.cc
-index 663075a..37fb84a 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/60966.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/60966.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2014-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/69106.cc b/libstdc++-v3/testsuite/30_threads/promise/69106.cc
-index 921ded1..7130a18 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/69106.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/69106.cc
-@@ -19,7 +19,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- #include <future>
- 
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc
-index 1258483..873d26f 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc
-index f35b2b7..ca1686c 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc
-index c881fc1..a4465c8 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc
-index 4c8b24b..fac06a2 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc
-index 018bac3..b4f09e7 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc
-index d0386e2..f359a07 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc
-index c1699e4..b1f4b52 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc
-index 68debd5..1845298 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/at_thread_exit.cc b/libstdc++-v3/testsuite/30_threads/promise/members/at_thread_exit.cc
-index 1c8469a..b3f8bba 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/members/at_thread_exit.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/members/at_thread_exit.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2014-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc b/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc
-index 44c9205..2ec33c7 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc b/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc
-index 56c3107..fac6267 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc b/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc
-index b753c24..bdc0944 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc b/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc
-index d9850ca..49023cf 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc b/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc
-index a50a7b8..c29788b 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc b/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc
-index 9c308c5..5306644 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc b/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc
-index 16f2b3d..1f170cb 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc b/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc
-index 834ce97..4a467d0 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc
-index 1f7fb88..e30a63f 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/promise/uses_allocator.cc b/libstdc++-v3/testsuite/30_threads/promise/uses_allocator.cc
-index e9ded97..0aef18e 100644
---- a/libstdc++-v3/testsuite/30_threads/promise/uses_allocator.cc
-+++ b/libstdc++-v3/testsuite/30_threads/promise/uses_allocator.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2011-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign.cc b/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign.cc
-index d0dd9ca..d27fc95 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign.cc
-@@ -1,7 +1,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/cons/constexpr.cc b/libstdc++-v3/testsuite/30_threads/shared_future/cons/constexpr.cc
-index f82e280..8cf6e38 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/cons/constexpr.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/cons/constexpr.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11 -fno-inline -g0" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- // { dg-final { scan-assembler-not "_ZNSt13shared_futureIvEC2Ev" } }
- // { dg-final { scan-assembler-not "_ZNSt13shared_futureIiEC2Ev" } }
- 
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/cons/copy.cc b/libstdc++-v3/testsuite/30_threads/shared_future/cons/copy.cc
-index 61985d8..1448d6c 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/cons/copy.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/cons/copy.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/cons/default.cc b/libstdc++-v3/testsuite/30_threads/shared_future/cons/default.cc
-index d4a8b67..51d22e8 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/cons/default.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/cons/default.cc
-@@ -1,7 +1,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc b/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc
-index 2017f48..ecb9dc4 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/cons/move_assign.cc b/libstdc++-v3/testsuite/30_threads/shared_future/cons/move_assign.cc
-index 05852d0..adb9ccd3 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/cons/move_assign.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/cons/move_assign.cc
-@@ -1,7 +1,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc
-index e9f1566..3e125c6 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc
-index cfbb83a..dfd60ef 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc
-index 1d5a807..7db5d4d 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc
-index 25cd342..80d43b4 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2010-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc
-index d4aef51..46bc01e 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc
-index 929ba87..15bfd1b 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc
-index 52d045d..eebacdd 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc
-@@ -4,7 +4,6 @@
- // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
-diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc
-index 767131e..69b6a5c 100644
---- a/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc
-+++ b/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc
-@@ -2,7 +2,6 @@
- // { dg-options "-std=gnu++11" }
- // { dg-require-cstdint "" }
- // { dg-require-gthreads "" }
--// { dg-require-atomic-builtins "" }
- 
- // Copyright (C) 2009-2016 Free Software Foundation, Inc.
- //
--- 
-2.7.4
-
diff --git a/meta-phosphor/common/recipes-devtools/gcc/gcc_6.3/0001-Support-exception-propagation-without-lock-free-atom.patch b/meta-phosphor/common/recipes-devtools/gcc/gcc_6.3/0001-Support-exception-propagation-without-lock-free-atom.patch
new file mode 100644
index 0000000..5ace034
--- /dev/null
+++ b/meta-phosphor/common/recipes-devtools/gcc/gcc_6.3/0001-Support-exception-propagation-without-lock-free-atom.patch
@@ -0,0 +1,2010 @@
+From cf17b2b404eed4778664b69d20e1943b619bfd38 Mon Sep 17 00:00:00 2001
+From: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 4 Jan 2017 10:54:59 +0000
+Subject: [PATCH 1/1] Support exception propagation without lock-free atomic
+ int
+
+2017-01-04  Pauli Nieminen  <suokkos@gmail.com>
+	    Jonathan Wakely  <jwakely@redhat.com>
+
+	PR libstdc++/64735
+	* acinclude.m4 (GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER): Define.
+	* config.h.in: Regenerate.
+	* config/abi/pre/gnu.ver [HAVE_EXCEPTION_PTR_SINCE_GCC46]
+	(GLIBCXX_3.4.15, GLIBCXX_3.4.21, CXXABI_1.3.3, CXXABI_1.3.5): Make
+	exports for exception_ptr, nested_exception, and future conditional.
+	[HAVE_EXCEPTION_PTR_SINCE_GCC46] (GLIBCXX_3.4.23, CXXABI_1.3.11): Add
+	exports for exception_ptr, nested_exception, and future conditional.
+	* configure: Regenerate.
+	* configure.ac: Use GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER.
+	* include/std/future: Remove check for ATOMIC_INT_LOCK_FREE
+	* libsupc++/eh_atomics.h: New file for internal use only.
+	(__eh_atomic_inc, __eh_atomic_dec): New.
+	* libsupc++/eh_ptr.cc (exception_ptr::_M_addref)
+	(exception_ptr::_M_release) (__gxx_dependent_exception_cleanup)
+	(rethrow_exception): Use eh_atomics.h reference counting helpers.
+	* libsupc++/eh_throw.cc (__gxx_exception_cleanup): Likewise.
+	* libsupc++/eh_tm.cc (free_any_cxa_exception): Likewise.
+	* libsupc++/exception: Remove check for ATOMIC_INT_LOCK_FREE.
+	* libsupc++/exception_ptr.h: Likewise.
+	* libsupc++/guard.cc: Include header for ATOMIC_INT_LOCK_FREE macro.
+	* libsupc++/nested_exception.cc: Remove check for
+	ATOMIC_INT_LOCK_FREE.
+	* libsupc++/nested_exception.h: Likewise.
+	* src/c++11/future.cc: Likewise.
+	* testsuite/18_support/exception_ptr/*: Remove atomic builtins checks.
+	* testsuite/18_support/nested_exception/*: Likewise.
+	* testsuite/30_threads/async/*: Likewise.
+	* testsuite/30_threads/future/*: Likewise.
+	* testsuite/30_threads/headers/future/types_std_c++0x.cc: Likewise.
+	* testsuite/30_threads/packaged_task/*: Likewise.
+	* testsuite/30_threads/promise/*: Likewise.
+	* testsuite/30_threads/shared_future/*: Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244051 138bc75d-0d04-0410-961f-82ee72b054a4
+
+This is a backport of the upstream commit.
+
+Signed-off-by: James Feist <james.feist@linux.intel.com>
+---
+ libstdc++-v3/ChangeLog                             | 38 +++++++++-
+ libstdc++-v3/acinclude.m4                          | 37 ++++++++++
+ libstdc++-v3/config.h.in                           |  3 +
+ libstdc++-v3/config/abi/pre/gnu.ver                | 10 +++
+ libstdc++-v3/configure                             | 49 +++++++++++++
+ libstdc++-v3/configure.ac                          |  3 +
+ libstdc++-v3/include/std/future                    |  4 +-
+ libstdc++-v3/libsupc++/eh_atomics.h                | 84 ++++++++++++++++++++++
+ libstdc++-v3/libsupc++/eh_ptr.cc                   | 14 ++--
+ libstdc++-v3/libsupc++/eh_throw.cc                 |  7 +-
+ libstdc++-v3/libsupc++/eh_tm.cc                    |  5 +-
+ libstdc++-v3/libsupc++/exception                   |  3 +-
+ libstdc++-v3/libsupc++/exception_ptr.h             |  4 --
+ libstdc++-v3/libsupc++/guard.cc                    |  1 +
+ libstdc++-v3/libsupc++/nested_exception.cc         |  2 -
+ libstdc++-v3/libsupc++/nested_exception.h          |  4 --
+ libstdc++-v3/src/c++11/future.cc                   |  3 +-
+ .../testsuite/18_support/exception_ptr/40296.cc    |  1 -
+ .../18_support/exception_ptr/60612-terminate.cc    |  1 -
+ .../18_support/exception_ptr/60612-unexpected.cc   |  1 -
+ .../testsuite/18_support/exception_ptr/62258.cc    |  1 -
+ .../testsuite/18_support/exception_ptr/64241.cc    |  1 -
+ .../18_support/exception_ptr/current_exception.cc  |  1 -
+ .../testsuite/18_support/exception_ptr/lifespan.cc |  1 -
+ .../18_support/exception_ptr/make_exception_ptr.cc |  1 -
+ .../testsuite/18_support/exception_ptr/move.cc     |  1 -
+ .../18_support/exception_ptr/requirements.cc       |  1 -
+ .../18_support/exception_ptr/requirements_neg.cc   |  1 -
+ .../18_support/exception_ptr/rethrow_exception.cc  |  1 -
+ .../testsuite/18_support/nested_exception/51438.cc |  1 -
+ .../testsuite/18_support/nested_exception/62154.cc |  1 -
+ .../testsuite/18_support/nested_exception/68139.cc |  1 -
+ .../testsuite/18_support/nested_exception/cons.cc  |  1 -
+ .../18_support/nested_exception/nested_ptr.cc      |  1 -
+ .../nested_exception/rethrow_if_nested.cc          |  1 -
+ .../18_support/nested_exception/rethrow_nested.cc  |  1 -
+ .../nested_exception/throw_with_nested.cc          |  1 -
+ libstdc++-v3/testsuite/30_threads/async/42819.cc   |  1 -
+ libstdc++-v3/testsuite/30_threads/async/49668.cc   |  1 -
+ libstdc++-v3/testsuite/30_threads/async/54297.cc   |  1 -
+ libstdc++-v3/testsuite/30_threads/async/any.cc     |  1 -
+ libstdc++-v3/testsuite/30_threads/async/async.cc   |  1 -
+ libstdc++-v3/testsuite/30_threads/async/except.cc  |  1 -
+ .../testsuite/30_threads/async/forced_unwind.cc    |  1 -
+ libstdc++-v3/testsuite/30_threads/async/launch.cc  |  1 -
+ libstdc++-v3/testsuite/30_threads/async/lwg2021.cc |  1 -
+ libstdc++-v3/testsuite/30_threads/async/sync.cc    |  1 -
+ .../testsuite/30_threads/future/cons/assign_neg.cc |  1 -
+ .../testsuite/30_threads/future/cons/constexpr.cc  |  1 -
+ .../testsuite/30_threads/future/cons/copy_neg.cc   |  1 -
+ .../testsuite/30_threads/future/cons/default.cc    |  1 -
+ .../testsuite/30_threads/future/cons/move.cc       |  1 -
+ .../30_threads/future/cons/move_assign.cc          |  1 -
+ .../testsuite/30_threads/future/members/45133.cc   |  1 -
+ .../testsuite/30_threads/future/members/get.cc     |  1 -
+ .../testsuite/30_threads/future/members/get2.cc    |  1 -
+ .../testsuite/30_threads/future/members/share.cc   |  1 -
+ .../testsuite/30_threads/future/members/valid.cc   |  1 -
+ .../testsuite/30_threads/future/members/wait.cc    |  1 -
+ .../30_threads/future/members/wait_for.cc          |  1 -
+ .../30_threads/future/members/wait_until.cc        |  1 -
+ .../future/requirements/explicit_instantiation.cc  |  1 -
+ .../30_threads/headers/future/types_std_c++0x.cc   |  1 -
+ .../testsuite/30_threads/packaged_task/49668.cc    |  1 -
+ .../testsuite/30_threads/packaged_task/60564.cc    |  1 -
+ .../testsuite/30_threads/packaged_task/cons/1.cc   |  1 -
+ .../testsuite/30_threads/packaged_task/cons/2.cc   |  1 -
+ .../testsuite/30_threads/packaged_task/cons/3.cc   |  1 -
+ .../30_threads/packaged_task/cons/56492.cc         |  1 -
+ .../30_threads/packaged_task/cons/alloc.cc         |  1 -
+ .../30_threads/packaged_task/cons/alloc2.cc        |  1 -
+ .../30_threads/packaged_task/cons/alloc_min.cc     |  1 -
+ .../30_threads/packaged_task/cons/assign_neg.cc    |  1 -
+ .../30_threads/packaged_task/cons/copy_neg.cc      |  1 -
+ .../30_threads/packaged_task/cons/move.cc          |  1 -
+ .../30_threads/packaged_task/cons/move_assign.cc   |  1 -
+ .../30_threads/packaged_task/forced_unwind.cc      |  1 -
+ .../packaged_task/members/at_thread_exit.cc        |  1 -
+ .../30_threads/packaged_task/members/get_future.cc |  1 -
+ .../packaged_task/members/get_future2.cc           |  1 -
+ .../30_threads/packaged_task/members/invoke.cc     |  1 -
+ .../30_threads/packaged_task/members/invoke2.cc    |  1 -
+ .../30_threads/packaged_task/members/invoke3.cc    |  1 -
+ .../30_threads/packaged_task/members/invoke4.cc    |  1 -
+ .../30_threads/packaged_task/members/invoke5.cc    |  1 -
+ .../30_threads/packaged_task/members/reset.cc      |  1 -
+ .../30_threads/packaged_task/members/reset2.cc     |  1 -
+ .../30_threads/packaged_task/members/swap.cc       |  1 -
+ .../30_threads/packaged_task/members/valid.cc      |  1 -
+ .../requirements/explicit_instantiation.cc         |  1 -
+ .../30_threads/packaged_task/uses_allocator.cc     |  1 -
+ libstdc++-v3/testsuite/30_threads/promise/60966.cc |  1 -
+ libstdc++-v3/testsuite/30_threads/promise/69106.cc |  1 -
+ .../testsuite/30_threads/promise/cons/1.cc         |  1 -
+ .../testsuite/30_threads/promise/cons/alloc.cc     |  1 -
+ .../testsuite/30_threads/promise/cons/alloc2.cc    |  1 -
+ .../testsuite/30_threads/promise/cons/alloc_min.cc |  1 -
+ .../30_threads/promise/cons/assign_neg.cc          |  1 -
+ .../testsuite/30_threads/promise/cons/copy_neg.cc  |  1 -
+ .../testsuite/30_threads/promise/cons/move.cc      |  1 -
+ .../30_threads/promise/cons/move_assign.cc         |  1 -
+ .../30_threads/promise/members/at_thread_exit.cc   |  1 -
+ .../30_threads/promise/members/get_future.cc       |  1 -
+ .../30_threads/promise/members/get_future2.cc      |  1 -
+ .../30_threads/promise/members/set_exception.cc    |  1 -
+ .../30_threads/promise/members/set_exception2.cc   |  1 -
+ .../30_threads/promise/members/set_value.cc        |  1 -
+ .../30_threads/promise/members/set_value2.cc       |  1 -
+ .../30_threads/promise/members/set_value3.cc       |  1 -
+ .../testsuite/30_threads/promise/members/swap.cc   |  1 -
+ .../promise/requirements/explicit_instantiation.cc |  1 -
+ .../testsuite/30_threads/promise/uses_allocator.cc |  1 -
+ .../30_threads/shared_future/cons/assign.cc        |  1 -
+ .../30_threads/shared_future/cons/constexpr.cc     |  1 -
+ .../30_threads/shared_future/cons/copy.cc          |  1 -
+ .../30_threads/shared_future/cons/default.cc       |  1 -
+ .../30_threads/shared_future/cons/move.cc          |  1 -
+ .../30_threads/shared_future/cons/move_assign.cc   |  1 -
+ .../30_threads/shared_future/members/45133.cc      |  1 -
+ .../30_threads/shared_future/members/get.cc        |  1 -
+ .../30_threads/shared_future/members/get2.cc       |  1 -
+ .../30_threads/shared_future/members/valid.cc      |  1 -
+ .../30_threads/shared_future/members/wait.cc       |  1 -
+ .../30_threads/shared_future/members/wait_for.cc   |  1 -
+ .../30_threads/shared_future/members/wait_until.cc |  1 -
+ .../requirements/explicit_instantiation.cc         |  1 -
+ 126 files changed, 236 insertions(+), 144 deletions(-)
+ create mode 100644 libstdc++-v3/libsupc++/eh_atomics.h
+
+
+Index: gcc-6.3.0/libstdc++-v3/acinclude.m4
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/acinclude.m4
++++ gcc-6.3.0/libstdc++-v3/acinclude.m4
+@@ -4517,6 +4517,43 @@ AC_DEFUN([GLIBCXX_CHECK_SIZE_T_MANGLING]
+     [Define to the letter to which size_t is mangled.])
+ ])
+ 
++dnl
++dnl Determine whether std::exception_ptr symbols should be exported with
++dnl the symbol versions from GCC 4.6.0 or GCC 7.1.0, depending on which
++dnl release first added support for std::exception_ptr. Originally it was
++dnl only supported for targets with always-lock-free atomics for int, but
++dnl since GCC 7.1 it is supported for all targets.
++dnl
++AC_DEFUN([GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER], [
++  if test $enable_symvers != no; then
++    AC_MSG_CHECKING([for first version to support std::exception_ptr])
++    case ${target} in
++      aarch64-*-* | alpha-*-* | hppa*-*-* | i?86-*-* | x86_64-*-* | \
++      m68k-*-* | powerpc*-*-* | s390*-*-* | *-*-solaris* )
++        ac_exception_ptr_since_gcc46=yes
++        ;;
++      *)
++        # If the value of this macro changes then we will need to hardcode
++        # yes/no here for additional targets based on the original value.
++        AC_TRY_COMPILE([], [
++          #if __GCC_ATOMIC_INT_LOCK_FREE <= 1
++          # error atomic int not always lock free
++          #endif
++          ],
++          [ac_exception_ptr_since_gcc46=yes],
++          [ac_exception_ptr_since_gcc46=no])
++        ;;
++    esac
++    if test x"$ac_exception_ptr_since_gcc46" = x"yes" ; then
++      AC_DEFINE(HAVE_EXCEPTION_PTR_SINCE_GCC46, 1,
++        [Define to 1 if GCC 4.6 supported std::exception_ptr for the target])
++      AC_MSG_RESULT([4.6.0])
++    else
++      AC_MSG_RESULT([7.1.0])
++    fi
++  fi
++])
++
+ # Macros from the top-level gcc directory.
+ m4_include([../config/gc++filt.m4])
+ m4_include([../config/tls.m4])
+Index: gcc-6.3.0/libstdc++-v3/config.h.in
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/config.h.in
++++ gcc-6.3.0/libstdc++-v3/config.h.in
+@@ -120,6 +120,9 @@
+ /* Define if EWOULDBLOCK exists. */
+ #undef HAVE_EWOULDBLOCK
+ 
++/* Define to 1 if GCC 4.6 supported std::exception_ptr for the target */
++#undef HAVE_EXCEPTION_PTR_SINCE_GCC46
++
+ /* Define to 1 if you have the <execinfo.h> header file. */
+ #undef HAVE_EXECINFO_H
+ 
+Index: gcc-6.3.0/libstdc++-v3/config/abi/pre/gnu.ver
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/config/abi/pre/gnu.ver
++++ gcc-6.3.0/libstdc++-v3/config/abi/pre/gnu.ver
+@@ -1490,6 +1490,9 @@ GLIBCXX_3.4.15 {
+     _ZNSt14error_categoryC*;
+     _ZNSt14error_categoryD*;
+ 
++#ifdef HAVE_EXCEPTION_PTR_SINCE_GCC46
++    # std::future symbols are only present in this version when
++    # atomic operations on int are always lock-free.
+     _ZNSt13__future_base12_Result_baseC*;
+     _ZNSt13__future_base12_Result_baseD*;
+     _ZTINSt13__future_base12_Result_baseE;
+@@ -1498,6 +1501,7 @@ GLIBCXX_3.4.15 {
+     _ZNSt13__future_base11_State_baseD*;
+     _ZTINSt13__future_base11_State_baseE;
+     _ZTVNSt13__future_base11_State_baseE;
++#endif
+ 
+ } GLIBCXX_3.4.14;
+ 
+@@ -1674,8 +1678,10 @@ GLIBCXX_3.4.21 {
+ 
+     # std::notify_all_at_thread_exit
+     _ZSt25notify_all_at_thread_exitRSt18condition_variableSt11unique_lockISt5mutexE;
++#ifdef HAVE_EXCEPTION_PTR_SINCE_GCC46
+     # std::__future_base::_State_baseV2::_Make_ready::_M_set()
+     _ZNSt13__future_base13_State_baseV211_Make_ready6_M_setEv;
++#endif
+ 
+     # ABI-tagged std::basic_string
+     _ZNSt7__cxx1112basic_string*;
+@@ -2040,6 +2046,7 @@ CXXABI_1.3.3 {
+     _ZTIPDi;
+     _ZTIPKDi;
+ 
++#ifdef HAVE_EXCEPTION_PTR_SINCE_GCC46
+     # exception_ptr
+     _ZNSt15__exception_ptr13exception_ptrC1Ev;
+     _ZNSt15__exception_ptr13exception_ptrC2Ev;
+@@ -2059,6 +2066,7 @@ CXXABI_1.3.3 {
+ 
+     _ZSt17current_exceptionv;
+     _ZSt17rethrow_exceptionNSt15__exception_ptr13exception_ptrE;
++#endif
+ 
+ } CXXABI_1.3.2;
+ 
+@@ -2089,10 +2097,12 @@ CXXABI_1.3.5 {
+     # FNV hash.
+     _ZSt15_Fnv_hash_bytesPKv*;
+ 
++#ifdef HAVE_EXCEPTION_PTR_SINCE_GCC46
+     # std::nested_exception
+     _ZNSt16nested_exceptionD*;
+     _ZTISt16nested_exception;
+     _ZTVSt16nested_exception;
++#endif
+ 
+ } CXXABI_1.3.4;
+ 
+Index: gcc-6.3.0/libstdc++-v3/configure
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/configure
++++ gcc-6.3.0/libstdc++-v3/configure
+@@ -80655,6 +80655,55 @@ _ACEOF
+ 
+ 
+ 
++# Check which release added std::exception_ptr for the target
++
++  if test $enable_symvers != no; then
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for first version to support std::exception_ptr" >&5
++$as_echo_n "checking for first version to support std::exception_ptr... " >&6; }
++    case ${target} in
++      aarch64-*-* | alpha-*-* | hppa*-*-* | i?86-*-* | x86_64-*-* | \
++      m68k-*-* | powerpc*-*-* | s390*-*-* | *-*-solaris* )
++        ac_exception_ptr_since_gcc46=yes
++        ;;
++      *)
++        # If the value of this macro changes then we will need to hardcode
++        # yes/no here for additional targets based on the original value.
++        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++          #if __GCC_ATOMIC_INT_LOCK_FREE <= 1
++          # error atomic int not always lock free
++          #endif
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  ac_exception_ptr_since_gcc46=yes
++else
++  ac_exception_ptr_since_gcc46=no
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++        ;;
++    esac
++    if test x"$ac_exception_ptr_since_gcc46" = x"yes" ; then
++
++$as_echo "#define HAVE_EXCEPTION_PTR_SINCE_GCC46 1" >>confdefs.h
++
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: 4.6.0" >&5
++$as_echo "4.6.0" >&6; }
++    else
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: 7.1.0" >&5
++$as_echo "7.1.0" >&6; }
++    fi
++  fi
++
++
+ # Define documentation rules conditionally.
+ 
+ # See if makeinfo has been installed and is modern enough
+Index: gcc-6.3.0/libstdc++-v3/configure.ac
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/configure.ac
++++ gcc-6.3.0/libstdc++-v3/configure.ac
+@@ -411,6 +411,9 @@ GLIBCXX_CHECK_FILESYSTEM_DEPS
+ # For Transactional Memory TS
+ GLIBCXX_CHECK_SIZE_T_MANGLING
+ 
++# Check which release added std::exception_ptr for the target
++GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER
++
+ # Define documentation rules conditionally.
+ 
+ # See if makeinfo has been installed and is modern enough
+Index: gcc-6.3.0/libstdc++-v3/include/std/future
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/include/std/future
++++ gcc-6.3.0/libstdc++-v3/include/std/future
+@@ -182,8 +182,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+     future<__async_result_of<_Fn, _Args...>>
+     async(_Fn&& __fn, _Args&&... __args);
+ 
+-#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
+-  && (ATOMIC_INT_LOCK_FREE > 1)
++#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+ 
+   /// Base class and enclosing scope.
+   struct __future_base
+@@ -1745,7 +1744,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ 
+ #endif // _GLIBCXX_ASYNC_ABI_COMPAT
+ #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+-       // && ATOMIC_INT_LOCK_FREE
+ 
+   // @} group futures
+ _GLIBCXX_END_NAMESPACE_VERSION
+Index: gcc-6.3.0/libstdc++-v3/libsupc++/eh_atomics.h
+===================================================================
+--- /dev/null
++++ gcc-6.3.0/libstdc++-v3/libsupc++/eh_atomics.h
+@@ -0,0 +1,84 @@
++// Exception Handling support header for -*- C++ -*-
++
++// Copyright (C) 2016 Free Software Foundation, Inc.
++//
++// This file is part of GCC.
++//
++// GCC is free software; you can redistribute it and/or modify
++// it under the terms of the GNU General Public License as published by
++// the Free Software Foundation; either version 3, or (at your option)
++// any later version.
++//
++// GCC is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++// GNU General Public License for more details.
++//
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
++// <http://www.gnu.org/licenses/>.
++
++/** @file eh_atomics.h
++ *  This is an internal header file, included by library source files.
++ *  Do not attempt to use it directly.
++ */
++
++#ifndef _EH_ATOMICS_H
++#define _EH_ATOMICS_H 1
++
++#include <bits/c++config.h>
++#include <bits/atomic_word.h>
++#include <bits/atomic_lockfree_defines.h>
++#if ATOMIC_INT_LOCK_FREE <= 1
++# include <ext/atomicity.h>
++#endif
++
++#pragma GCC visibility push(default)
++extern "C++" {
++namespace __gnu_cxx
++{
++  void
++  __eh_atomic_inc (_Atomic_word* __count) __attribute__((always_inline));
++
++  bool
++  __eh_atomic_dec (_Atomic_word* __count) __attribute__((always_inline));
++
++  // Increments the count.
++  inline void
++  __eh_atomic_inc (_Atomic_word* __count)
++  {
++#if ATOMIC_INT_LOCK_FREE > 1
++    __atomic_add_fetch (__count, 1, __ATOMIC_ACQ_REL);
++#else
++    _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE (__count);
++    __gnu_cxx::__atomic_add_dispatch (__count, 1);
++    _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER (__count);
++#endif
++  }
++
++  // Decrements the count and returns true if it reached zero.
++  inline bool
++  __eh_atomic_dec (_Atomic_word* __count)
++  {
++#if ATOMIC_INT_LOCK_FREE > 1
++    return __atomic_sub_fetch (__count, 1, __ATOMIC_ACQ_REL) == 0;
++#else
++    _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE (__count);
++    if (__gnu_cxx::__exchange_and_add_dispatch (__count, -1) == 1)
++      {
++	_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER (__count);
++	return true;
++      }
++    return false;
++#endif
++  }
++} // namespace __gnu_cxx
++}
++#pragma GCC visibility pop
++
++#endif // _EH_ATOMICS_H
+Index: gcc-6.3.0/libstdc++-v3/libsupc++/eh_ptr.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/libsupc++/eh_ptr.cc
++++ gcc-6.3.0/libstdc++-v3/libsupc++/eh_ptr.cc
+@@ -23,9 +23,7 @@
+ // <http://www.gnu.org/licenses/>.
+ 
+ #include <bits/c++config.h>
+-#include <bits/atomic_lockfree_defines.h>
+-
+-#if ATOMIC_INT_LOCK_FREE > 1
++#include "eh_atomics.h"
+ 
+ #define _GLIBCXX_EH_PTR_COMPAT
+ 
+@@ -103,7 +101,7 @@ std::__exception_ptr::exception_ptr::_M_
+     {
+       __cxa_refcounted_exception *eh =
+ 	__get_refcounted_exception_header_from_obj (_M_exception_object);
+-      __atomic_add_fetch (&eh->referenceCount, 1, __ATOMIC_ACQ_REL);
++      __gnu_cxx::__eh_atomic_inc (&eh->referenceCount);
+     }
+ }
+ 
+@@ -115,7 +113,7 @@ std::__exception_ptr::exception_ptr::_M_
+     {
+       __cxa_refcounted_exception *eh =
+ 	__get_refcounted_exception_header_from_obj (_M_exception_object);
+-      if (__atomic_sub_fetch (&eh->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
++      if (__gnu_cxx::__eh_atomic_dec (&eh->referenceCount))
+         {
+ 	  if (eh->exc.exceptionDestructor)
+ 	    eh->exc.exceptionDestructor (_M_exception_object);
+@@ -219,7 +217,7 @@ __gxx_dependent_exception_cleanup(_Unwin
+ 
+   __cxa_free_dependent_exception (dep);
+ 
+-  if (__atomic_sub_fetch (&header->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
++  if (__gnu_cxx::__eh_atomic_dec (&header->referenceCount))
+     {
+       if (header->exc.exceptionDestructor)
+ 	header->exc.exceptionDestructor (header + 1);
+@@ -238,7 +236,7 @@ std::rethrow_exception(std::exception_pt
+ 
+   __cxa_dependent_exception *dep = __cxa_allocate_dependent_exception ();
+   dep->primaryException = obj;
+-  __atomic_add_fetch (&eh->referenceCount, 1,  __ATOMIC_ACQ_REL);
++  __gnu_cxx::__eh_atomic_inc (&eh->referenceCount);
+ 
+   dep->unexpectedHandler = get_unexpected ();
+   dep->terminateHandler = get_terminate ();
+@@ -260,5 +258,3 @@ std::rethrow_exception(std::exception_pt
+ }
+ 
+ #undef _GLIBCXX_EH_PTR_COMPAT
+-
+-#endif
+Index: gcc-6.3.0/libstdc++-v3/libsupc++/eh_throw.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/libsupc++/eh_throw.cc
++++ gcc-6.3.0/libstdc++-v3/libsupc++/eh_throw.cc
+@@ -24,6 +24,7 @@
+ 
+ #include <bits/c++config.h>
+ #include "unwind-cxx.h"
++#include "eh_atomics.h"
+ 
+ using namespace __cxxabiv1;
+ 
+@@ -42,17 +43,13 @@ __gxx_exception_cleanup (_Unwind_Reason_
+   if (code != _URC_FOREIGN_EXCEPTION_CAUGHT && code != _URC_NO_REASON)
+     __terminate (header->exc.terminateHandler);
+ 
+-#if ATOMIC_INT_LOCK_FREE > 1
+-  if (__atomic_sub_fetch (&header->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
++  if (__gnu_cxx::__eh_atomic_dec (&header->referenceCount))
+     {
+-#endif
+       if (header->exc.exceptionDestructor)
+ 	header->exc.exceptionDestructor (header + 1);
+ 
+       __cxa_free_exception (header + 1);
+-#if ATOMIC_INT_LOCK_FREE > 1
+     }
+-#endif
+ }
+ 
+ 
+Index: gcc-6.3.0/libstdc++-v3/libsupc++/eh_tm.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/libsupc++/eh_tm.cc
++++ gcc-6.3.0/libstdc++-v3/libsupc++/eh_tm.cc
+@@ -24,6 +24,7 @@
+ 
+ #include <cstdlib>
+ #include "unwind-cxx.h"
++#include "eh_atomics.h"
+ 
+ using namespace __cxxabiv1;
+ 
+@@ -45,9 +46,7 @@ free_any_cxa_exception (_Unwind_Exceptio
+       __cxa_free_dependent_exception (dep);
+     }
+ 
+-#if __GCC_ATOMIC_INT_LOCK_FREE > 1
+-  if (__atomic_sub_fetch (&h->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
+-#endif
++  if (__gnu_cxx::__eh_atomic_dec (&h->referenceCount))
+     __cxa_free_exception (h + 1);
+ }
+ 
+Index: gcc-6.3.0/libstdc++-v3/libsupc++/exception
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/libsupc++/exception
++++ gcc-6.3.0/libstdc++-v3/libsupc++/exception
+@@ -35,7 +35,6 @@
+ #pragma GCC visibility push(default)
+ 
+ #include <bits/c++config.h>
+-#include <bits/atomic_lockfree_defines.h>
+ 
+ extern "C++" {
+ 
+@@ -166,7 +165,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
+ 
+ #pragma GCC visibility pop
+ 
+-#if (__cplusplus >= 201103L) && (ATOMIC_INT_LOCK_FREE > 1)
++#if (__cplusplus >= 201103L)
+ #include <bits/exception_ptr.h>
+ #include <bits/nested_exception.h>
+ #endif
+Index: gcc-6.3.0/libstdc++-v3/libsupc++/exception_ptr.h
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/libsupc++/exception_ptr.h
++++ gcc-6.3.0/libstdc++-v3/libsupc++/exception_ptr.h
+@@ -36,10 +36,6 @@
+ #include <bits/c++config.h>
+ #include <bits/exception_defines.h>
+ 
+-#if ATOMIC_INT_LOCK_FREE < 2
+-#  error This platform does not support exception propagation.
+-#endif
+-
+ extern "C++" {
+ 
+ namespace std 
+Index: gcc-6.3.0/libstdc++-v3/libsupc++/guard.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/libsupc++/guard.cc
++++ gcc-6.3.0/libstdc++-v3/libsupc++/guard.cc
+@@ -30,6 +30,7 @@
+ #include <new>
+ #include <ext/atomicity.h>
+ #include <ext/concurrence.h>
++#include <bits/atomic_lockfree_defines.h>
+ #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \
+   && (ATOMIC_INT_LOCK_FREE > 1) && defined(_GLIBCXX_HAVE_LINUX_FUTEX)
+ # include <climits>
+Index: gcc-6.3.0/libstdc++-v3/libsupc++/nested_exception.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/libsupc++/nested_exception.cc
++++ gcc-6.3.0/libstdc++-v3/libsupc++/nested_exception.cc
+@@ -25,7 +25,5 @@
+ 
+ namespace std 
+ {
+-#if ATOMIC_INT_LOCK_FREE > 1
+   nested_exception::~nested_exception() noexcept = default;
+-#endif
+ } // namespace std
+Index: gcc-6.3.0/libstdc++-v3/libsupc++/nested_exception.h
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/libsupc++/nested_exception.h
++++ gcc-6.3.0/libstdc++-v3/libsupc++/nested_exception.h
+@@ -39,10 +39,6 @@
+ #include <bits/c++config.h>
+ #include <bits/move.h>
+ 
+-#if ATOMIC_INT_LOCK_FREE < 2
+-#  error This platform does not support exception propagation.
+-#endif
+-
+ extern "C++" {
+ 
+ namespace std
+Index: gcc-6.3.0/libstdc++-v3/src/c++11/future.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/src/c++11/future.cc
++++ gcc-6.3.0/libstdc++-v3/src/c++11/future.cc
+@@ -78,8 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+   const char*
+   future_error::what() const noexcept { return logic_error::what(); }
+ 
+-#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
+-  && (ATOMIC_INT_LOCK_FREE > 1)
++#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+   __future_base::_Result_base::_Result_base() = default;
+ 
+   __future_base::_Result_base::~_Result_base() = default;
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/40296.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/40296.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/40296.cc
+@@ -1,6 +1,5 @@
+ // { dg-do compile }
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/64241.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/64241.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/64241.cc
+@@ -16,7 +16,6 @@
+ // <http://www.gnu.org/licenses/>.
+ 
+ // { dg-options "-std=gnu++11 -fno-exceptions -O0" }
+-// { dg-require-atomic-builtins "" }
+ 
+ #include <exception>
+ #include <testsuite_hooks.h>
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/current_exception.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/current_exception.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/current_exception.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // 2008-05-25  Sebastian Redl  <sebastian.redl@getdesigned.at>
+ 
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // 2008-05-25  Sebastian Redl  <sebastian.redl@getdesigned.at>
+ 
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/move.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/move.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/move.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/requirements.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/requirements.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/requirements.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/requirements_neg.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/requirements_neg.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/requirements_neg.cc
+@@ -1,6 +1,5 @@
+ // { dg-do compile }
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // 2008-05-25  Sebastian Redl  <sebastian.redl@getdesigned.at>
+ 
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/51438.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/nested_exception/51438.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/51438.cc
+@@ -1,6 +1,5 @@
+ // { dg-do compile }
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/62154.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/nested_exception/62154.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/62154.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/68139.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/nested_exception/68139.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/68139.cc
+@@ -1,6 +1,5 @@
+ // { dg-do compile }
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/cons.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/nested_exception/cons.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/cons.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/nested_ptr.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/nested_exception/nested_ptr.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/nested_ptr.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_if_nested.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_if_nested.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_if_nested.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_nested.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_nested.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/rethrow_nested.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/throw_with_nested.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/18_support/nested_exception/throw_with_nested.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/18_support/nested_exception/throw_with_nested.cc
+@@ -1,5 +1,4 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/42819.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/async/42819.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/42819.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/49668.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/async/49668.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/49668.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/54297.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/async/54297.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/54297.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ // { dg-require-sleep "" }
+ 
+ // Copyright (C) 2012-2016 Free Software Foundation, Inc.
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/any.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/async/any.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/any.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/async.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/async/async.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/async.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/except.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/async/except.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/except.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/forced_unwind.cc
+@@ -2,7 +2,6 @@
+ // { dg-options " -std=gnu++11 -pthread" { target *-*-linux* *-*-gnu* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/launch.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/async/launch.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/launch.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/lwg2021.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/async/lwg2021.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/lwg2021.cc
+@@ -21,7 +21,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // LWG 2021. Further incorrect usages of result_of
+ // Arguments to result_of should use decay.
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/sync.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/async/sync.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/async/sync.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/assign_neg.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/cons/assign_neg.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/assign_neg.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/constexpr.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/cons/constexpr.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/constexpr.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11 -fno-inline -g0" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ // { dg-final { scan-assembler-not "_ZNSt6futureIvEC2Ev" } }
+ // { dg-final { scan-assembler-not "_ZNSt6futureIiEC2Ev" } }
+ 
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/copy_neg.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/cons/copy_neg.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/copy_neg.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/default.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/cons/default.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/default.cc
+@@ -1,7 +1,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/move.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/cons/move.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/move.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/move_assign.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/cons/move_assign.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/cons/move_assign.cc
+@@ -1,7 +1,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/45133.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/members/45133.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/45133.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/get.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/members/get.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/get.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/get2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/members/get2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/get2.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/share.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/members/share.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/share.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/valid.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/members/valid.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/valid.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/wait.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/members/wait.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/wait.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/headers/future/types_std_c++0x.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/headers/future/types_std_c++0x.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/headers/future/types_std_c++0x.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" } 
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/60564.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/60564.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/60564.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/56492.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc2.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc_min.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc_min.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc_min.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/assign_neg.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/copy_neg.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/forced_unwind.cc
+@@ -2,7 +2,6 @@
+ // { dg-options " -std=gnu++11 -pthread" { target *-*-linux* *-*-gnu* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/at_thread_exit.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/at_thread_exit.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/at_thread_exit.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/uses_allocator.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/packaged_task/uses_allocator.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/packaged_task/uses_allocator.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/60966.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/60966.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/60966.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/69106.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/69106.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/69106.cc
+@@ -19,7 +19,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ #include <future>
+ 
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/1.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/alloc2.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/assign_neg.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/copy_neg.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/move.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/at_thread_exit.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/members/at_thread_exit.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/at_thread_exit.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/members/swap.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/uses_allocator.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/promise/uses_allocator.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/promise/uses_allocator.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/assign.cc
+@@ -1,7 +1,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/constexpr.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/cons/constexpr.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/constexpr.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11 -fno-inline -g0" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ // { dg-final { scan-assembler-not "_ZNSt13shared_futureIvEC2Ev" } }
+ // { dg-final { scan-assembler-not "_ZNSt13shared_futureIiEC2Ev" } }
+ 
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/copy.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/cons/copy.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/copy.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/default.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/cons/default.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/default.cc
+@@ -1,7 +1,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/move_assign.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/cons/move_assign.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/cons/move_assign.cc
+@@ -1,7 +1,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc
+@@ -4,7 +4,6 @@
+ // { dg-options " -std=gnu++11 " { target *-*-cygwin *-*-rtems* *-*-darwin* } }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc
++++ gcc-6.3.0/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc
+@@ -2,7 +2,6 @@
+ // { dg-options "-std=gnu++11" }
+ // { dg-require-cstdint "" }
+ // { dg-require-gthreads "" }
+-// { dg-require-atomic-builtins "" }
+ 
+ // Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ //
+Index: gcc-6.3.0/libstdc++-v3/ChangeLog
+===================================================================
+--- gcc-6.3.0.orig/libstdc++-v3/ChangeLog
++++ gcc-6.3.0/libstdc++-v3/ChangeLog
+@@ -2,6 +2,43 @@
+ 
+ 	* GCC 6.3.0 released.
+ 
++2017-01-04  Pauli Nieminen  <suokkos@gmail.com>
++           Jonathan Wakely  <jwakely@redhat.com>
++
++       PR libstdc++/64735
++       * acinclude.m4 (GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER): Define.
++       * config.h.in: Regenerate.
++       * config/abi/pre/gnu.ver [HAVE_EXCEPTION_PTR_SINCE_GCC46]
++       (GLIBCXX_3.4.15, GLIBCXX_3.4.21, CXXABI_1.3.3, CXXABI_1.3.5): Make
++       exports for exception_ptr, nested_exception, and future conditional.
++       [HAVE_EXCEPTION_PTR_SINCE_GCC46] (GLIBCXX_3.4.23, CXXABI_1.3.11): Add
++       exports for exception_ptr, nested_exception, and future conditional.
++       * configure: Regenerate.
++       * configure.ac: Use GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER.
++       * include/std/future: Remove check for ATOMIC_INT_LOCK_FREE
++       * libsupc++/eh_atomics.h: New file for internal use only.
++       (__eh_atomic_inc, __eh_atomic_dec): New.
++       * libsupc++/eh_ptr.cc (exception_ptr::_M_addref)
++       (exception_ptr::_M_release) (__gxx_dependent_exception_cleanup)
++       (rethrow_exception): Use eh_atomics.h reference counting helpers.
++       * libsupc++/eh_throw.cc (__gxx_exception_cleanup): Likewise.
++       * libsupc++/eh_tm.cc (free_any_cxa_exception): Likewise.
++       * libsupc++/exception: Remove check for ATOMIC_INT_LOCK_FREE.
++       * libsupc++/exception_ptr.h: Likewise.
++       * libsupc++/guard.cc: Include header for ATOMIC_INT_LOCK_FREE macro.
++       * libsupc++/nested_exception.cc: Remove check for
++       ATOMIC_INT_LOCK_FREE.
++       * libsupc++/nested_exception.h: Likewise.
++       * src/c++11/future.cc: Likewise.
++       * testsuite/18_support/exception_ptr/*: Remove atomic builtins checks.
++       * testsuite/18_support/nested_exception/*: Likewise.
++       * testsuite/30_threads/async/*: Likewise.
++       * testsuite/30_threads/future/*: Likewise.
++       * testsuite/30_threads/headers/future/types_std_c++0x.cc: Likewise.
++       * testsuite/30_threads/packaged_task/*: Likewise.
++       * testsuite/30_threads/promise/*: Likewise.
++       * testsuite/30_threads/shared_future/*: Likewise.
++
+ 2016-12-12  Jonathan Wakely  <jwakely@redhat.com>
+ 
+ 	Backport from mainline
diff --git a/meta-phosphor/common/recipes-devtools/nodejs/nodejs_4.6.1.bbappend b/meta-phosphor/common/recipes-devtools/nodejs/nodejs_4.8.2.bbappend
similarity index 100%
rename from meta-phosphor/common/recipes-devtools/nodejs/nodejs_4.6.1.bbappend
rename to meta-phosphor/common/recipes-devtools/nodejs/nodejs_4.8.2.bbappend
diff --git a/meta-phosphor/common/recipes-devtools/python/python/issue_27934_use-float-repr.patch b/meta-phosphor/common/recipes-devtools/python/python/issue_27934_use-float-repr.patch
deleted file mode 100644
index 0f8bb33..0000000
--- a/meta-phosphor/common/recipes-devtools/python/python/issue_27934_use-float-repr.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-# HG changeset patch
-# User Mark Dickinson <dickinsm@gmail.com>
-# Date 1472921100 -3600
-# Node ID 86d66a627b774d741d9a8834f16706ba3de61953
-# Parent  e065aec0e6fa04000e3e57da45139e11df0c675f
-Issue #27934: Use float.__repr__ instead of plain repr when JSON-encoding an instance of a float subclass. Thanks Eddie James.
-
-diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py
---- a/Lib/json/encoder.py
-+++ b/Lib/json/encoder.py
-@@ -28,7 +28,7 @@ for i in range(0x20):
-     #ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,))
- 
- INFINITY = float('inf')
--FLOAT_REPR = repr
-+FLOAT_REPR = float.__repr__
- 
- def encode_basestring(s):
-     """Return a JSON representation of a Python string
-diff --git a/Lib/json/tests/test_float.py b/Lib/json/tests/test_float.py
---- a/Lib/json/tests/test_float.py
-+++ b/Lib/json/tests/test_float.py
-@@ -32,6 +32,17 @@ class TestFloat(object):
-                 self.assertNotEqual(res[0], res[0])
-             self.assertRaises(ValueError, self.dumps, [val], allow_nan=False)
- 
-+    def test_float_subclasses_use_float_repr(self):
-+        # Issue 27934.
-+        class PeculiarFloat(float):
-+            def __repr__(self):
-+                return "I'm not valid JSON"
-+            def __str__(self):
-+                return "Neither am I"
-+
-+        val = PeculiarFloat(3.2)
-+        self.assertEqual(self.loads(self.dumps(val)), val)
-+
- 
- class TestPyFloat(TestFloat, PyTest): pass
- class TestCFloat(TestFloat, CTest): pass
-diff --git a/Misc/ACKS b/Misc/ACKS
---- a/Misc/ACKS
-+++ b/Misc/ACKS
-@@ -636,6 +636,7 @@ Manuel Jacob
- David Jacobs
- Kevin Jacobs
- Kjetil Jacobsen
-+Eddie James
- Bertrand Janin
- Geert Jansen
- Jack Jansen
-diff --git a/Modules/_json.c b/Modules/_json.c
---- a/Modules/_json.c
-+++ b/Modules/_json.c
-@@ -1960,8 +1960,8 @@ encoder_encode_float(PyEncoderObject *s,
-             return PyString_FromString("NaN");
-         }
-     }
--    /* Use a better float format here? */
--    return PyObject_Repr(obj);
-+    /* Make sure to use the base float class repr method */
-+    return PyFloat_Type.tp_repr(obj);
- }
- 
- static PyObject *
-
diff --git a/meta-phosphor/common/recipes-devtools/python/python_2.%.bbappend b/meta-phosphor/common/recipes-devtools/python/python_2.%.bbappend
index f5c58e3..569e753 100644
--- a/meta-phosphor/common/recipes-devtools/python/python_2.%.bbappend
+++ b/meta-phosphor/common/recipes-devtools/python/python_2.%.bbappend
@@ -1,6 +1,5 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 SRC_URI += "file://__init__.email_min.py"
-SRC_URI += "file://issue_27934_use-float-repr.patch"
 
 do_install_append_class-target() {
 	dir=${libdir}/python${PYTHON_MAJMIN}/email
diff --git a/meta-phosphor/common/recipes-phosphor/mboxd/mboxd.bb b/meta-phosphor/common/recipes-phosphor/mboxd/mboxd.bb
index f90ab86..0a30b7b 100644
--- a/meta-phosphor/common/recipes-phosphor/mboxd/mboxd.bb
+++ b/meta-phosphor/common/recipes-phosphor/mboxd/mboxd.bb
@@ -8,6 +8,11 @@
 inherit obmc-phosphor-systemd
 
 DEPENDS += "autoconf-archive-native"
+
+# Drop gnome-common-native if AX_CODE_COVERAGE ever comes back to
+# autoconf-archive upstream.
+DEPENDS += "gnome-common-native"
+
 DEPENDS += "systemd"
 DEPENDS += "phosphor-logging"
 RDEPENDS_${PN} += "libsystemd"